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/scripts/check-cmakelists.sh b/.github/scripts/check-cmakelists.sh deleted file mode 100755 index 88eb3dfbc4b..00000000000 --- a/.github/scripts/check-cmakelists.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# -# This script is for Travis. 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 -# - -set -e - -# pull all submodules -git submodule update --init --recursive - -# find all source files in repo -REPO_SRCS=`find cores/esp32/ libraries/ -name 'examples' -prune -o -name '*.c' -print -o -name '*.cpp' -print | sort` - -# find all source files named in CMakeLists.txt COMPONENT_SRCS -CMAKE_SRCS=`cmake --trace-expand -C CMakeLists.txt 2>&1 | grep COMPONENT_SRCS | sed 's/.\+COMPONENT_SRCS //' | sed 's/ )//' | tr ' ;' '\n' | sort` - -if ! diff -u0 --label "Repo Files" --label "COMPONENT_SRCS" <(echo "$REPO_SRCS") <(echo "$CMAKE_SRCS"); then - echo "Source files in repo (-) and source files in CMakeLists.txt (+) don't match" - echo "Edit CMakeLists.txt as appropriate to add/remove source files from COMPONENT_SRCS" - exit 1 -fi - -echo "CMakeLists.txt and repo source files match" -exit 0 diff --git a/.github/scripts/install-arduino-core-esp32.sh b/.github/scripts/install-arduino-core-esp32.sh deleted file mode 100644 index 271ce2883a2..00000000000 --- a/.github/scripts/install-arduino-core-esp32.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -export ARDUINO_ESP32_PATH="$ARDUINO_USR_PATH/hardware/espressif/esp32" -if [ ! -d "$ARDUINO_ESP32_PATH" ]; then - echo "Installing ESP32 Arduino Core in '$ARDUINO_ESP32_PATH'..." - script_init_path="$PWD" - mkdir -p "$ARDUINO_USR_PATH/hardware/espressif" && \ - cd "$ARDUINO_USR_PATH/hardware/espressif" - if [ $? -ne 0 ]; then exit 1; fi - - if [ "$GITHUB_REPOSITORY" == "espressif/arduino-esp32" ]; then - echo "Linking Core..." && \ - ln -s $GITHUB_WORKSPACE esp32 - else - echo "Cloning Core Repository..." && \ - git clone https://github.com/espressif/arduino-esp32.git esp32 > /dev/null 2>&1 - if [ $? -ne 0 ]; then echo "ERROR: GIT clone failed"; exit 1; fi - fi - - cd esp32 && \ - echo "Updating submodules..." && \ - git submodule update --init --recursive > /dev/null 2>&1 - if [ $? -ne 0 ]; then echo "ERROR: Submodule update failed"; exit 1; fi - - echo "Installing Python Serial..." && \ - pip install pyserial > /dev/null - if [ $? -ne 0 ]; then echo "ERROR: Install failed"; exit 1; fi - - if [ "$OS_IS_WINDOWS" == "1" ]; then - echo "Installing Python Requests..." - pip install requests > /dev/null - if [ $? -ne 0 ]; then echo "ERROR: Install failed"; exit 1; fi - fi - - echo "Downloading the tools and the toolchain..." - cd tools && python get.py > /dev/null - if [ $? -ne 0 ]; then echo "ERROR: Download failed"; exit 1; fi - cd $script_init_path - - echo "ESP32 Arduino has been installed in '$ARDUINO_ESP32_PATH'" - echo "" -fi diff --git a/.github/scripts/install-arduino-ide.sh b/.github/scripts/install-arduino-ide.sh deleted file mode 100644 index 1a5e3d46a53..00000000000 --- a/.github/scripts/install-arduino-ide.sh +++ /dev/null @@ -1,217 +0,0 @@ -#!/bin/bash - -#OSTYPE: 'linux-gnu', ARCH: 'x86_64' => linux64 -#OSTYPE: 'msys', ARCH: 'x86_64' => win32 -#OSTYPE: 'darwin18', ARCH: 'i386' => macos - -OSBITS=`arch` -if [[ "$OSTYPE" == "linux"* ]]; then - export OS_IS_LINUX="1" - ARCHIVE_FORMAT="tar.xz" - if [[ "$OSBITS" == "i686" ]]; then - OS_NAME="linux32" - elif [[ "$OSBITS" == "x86_64" ]]; then - OS_NAME="linux64" - elif [[ "$OSBITS" == "armv7l" ]]; then - OS_NAME="linuxarm" - else - OS_NAME="$OSTYPE-$OSBITS" - echo "Unknown OS '$OS_NAME'" - exit 1 - fi -elif [[ "$OSTYPE" == "darwin"* ]]; then - export OS_IS_MACOS="1" - ARCHIVE_FORMAT="zip" - OS_NAME="macosx" -elif [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "win32" ]]; then - export OS_IS_WINDOWS="1" - ARCHIVE_FORMAT="zip" - OS_NAME="windows" -else - OS_NAME="$OSTYPE-$OSBITS" - echo "Unknown OS '$OS_NAME'" - exit 1 -fi -export OS_NAME - -ARDUINO_BUILD_DIR="$HOME/.arduino/build.tmp" -ARDUINO_CACHE_DIR="$HOME/.arduino/cache.tmp" - -if [ "$OS_IS_MACOS" == "1" ]; then - export ARDUINO_IDE_PATH="/Applications/Arduino.app/Contents/Java" - export ARDUINO_USR_PATH="$HOME/Documents/Arduino" -else - export ARDUINO_IDE_PATH="$HOME/arduino_ide" - export ARDUINO_USR_PATH="$HOME/Arduino" -fi - -if [ ! -d "$ARDUINO_IDE_PATH" ]; then - echo "Installing Arduino IDE on $OS_NAME..." - echo "Downloading 'arduino-nightly-$OS_NAME.$ARCHIVE_FORMAT' to 'arduino.$ARCHIVE_FORMAT'..." - if [ "$OS_IS_LINUX" == "1" ]; then - wget -O "arduino.$ARCHIVE_FORMAT" "https://www.arduino.cc/download.php?f=/arduino-nightly-$OS_NAME.$ARCHIVE_FORMAT" > /dev/null 2>&1 - if [ $? -ne 0 ]; then echo "ERROR: Download failed"; exit 1; fi - echo "Extracting 'arduino.$ARCHIVE_FORMAT'..." - tar xf "arduino.$ARCHIVE_FORMAT" > /dev/null - if [ $? -ne 0 ]; then exit 1; fi - mv arduino-nightly "$ARDUINO_IDE_PATH" - else - curl -o "arduino.$ARCHIVE_FORMAT" -L "https://www.arduino.cc/download.php?f=/arduino-nightly-$OS_NAME.$ARCHIVE_FORMAT" > /dev/null 2>&1 - if [ $? -ne 0 ]; then echo "ERROR: Download failed"; exit 1; fi - echo "Extracting 'arduino.$ARCHIVE_FORMAT'..." - unzip "arduino.$ARCHIVE_FORMAT" > /dev/null - if [ $? -ne 0 ]; then exit 1; fi - if [ "$OS_IS_MACOS" == "1" ]; then - mv "Arduino.app" "/Applications/Arduino.app" - else - mv arduino-nightly "$ARDUINO_IDE_PATH" - fi - fi - if [ $? -ne 0 ]; then exit 1; fi - rm -rf "arduino.$ARCHIVE_FORMAT" - - mkdir -p "$ARDUINO_USR_PATH/libraries" - mkdir -p "$ARDUINO_USR_PATH/hardware" - - echo "Arduino IDE Installed in '$ARDUINO_IDE_PATH'" - echo "" -fi - -function build_sketch(){ # build_sketch [extra-options] - if [ "$#" -lt 2 ]; then - echo "ERROR: Illegal number of parameters" - echo "USAGE: build_sketch [extra-options]" - return 1 - fi - - local fqbn="$1" - local sketch="$2" - local xtra_opts="$3" - local win_opts="" - if [ "$OS_IS_WINDOWS" == "1" ]; then - local ctags_version=`ls "$ARDUINO_IDE_PATH/tools-builder/ctags/"` - local preprocessor_version=`ls "$ARDUINO_IDE_PATH/tools-builder/arduino-preprocessor/"` - win_opts="-prefs=runtime.tools.ctags.path=$ARDUINO_IDE_PATH/tools-builder/ctags/$ctags_version -prefs=runtime.tools.arduino-preprocessor.path=$ARDUINO_IDE_PATH/tools-builder/arduino-preprocessor/$preprocessor_version" - fi - - echo "" - echo "Compiling '"$(basename "$sketch")"'..." - mkdir -p "$ARDUINO_BUILD_DIR" - mkdir -p "$ARDUINO_CACHE_DIR" - $ARDUINO_IDE_PATH/arduino-builder -compile -logger=human -core-api-version=10810 \ - -fqbn=$fqbn \ - -warnings="all" \ - -tools "$ARDUINO_IDE_PATH/tools-builder" \ - -tools "$ARDUINO_IDE_PATH/tools" \ - -built-in-libraries "$ARDUINO_IDE_PATH/libraries" \ - -hardware "$ARDUINO_IDE_PATH/hardware" \ - -hardware "$ARDUINO_USR_PATH/hardware" \ - -libraries "$ARDUINO_USR_PATH/libraries" \ - -build-cache "$ARDUINO_CACHE_DIR" \ - -build-path "$ARDUINO_BUILD_DIR" \ - $win_opts $xtra_opts "$sketch" -} - -function count_sketches() # count_sketches -{ - local examples="$1" - local sketches=$(find $examples -name *.ino) - local sketchnum=0 - rm -rf sketches.txt - for sketch in $sketches; do - local sketchdir=$(dirname $sketch) - local sketchdirname=$(basename $sketchdir) - local sketchname=$(basename $sketch) - if [[ "${sketchdirname}.ino" != "$sketchname" ]]; then - continue - fi; - if [[ -f "$sketchdir/.test.skip" ]]; then - continue - fi - echo $sketch >> sketches.txt - sketchnum=$(($sketchnum + 1)) - done - return $sketchnum -} - -function build_sketches() # build_sketches [extra-options] -{ - local fqbn=$1 - local examples=$2 - local chunk_idex=$3 - local chunks_num=$4 - local xtra_opts=$5 - - if [ "$#" -lt 2 ]; then - echo "ERROR: Illegal number of parameters" - echo "USAGE: build_sketches [ ] [extra-options]" - return 1 - fi - - if [ "$#" -lt 4 ]; then - chunk_idex="0" - chunks_num="1" - xtra_opts=$3 - fi - - if [ "$chunks_num" -le 0 ]; then - echo "ERROR: Chunks count must be positive number" - return 1 - fi - if [ "$chunk_idex" -ge "$chunks_num" ]; then - echo "ERROR: Chunk index must be less than chunks count" - return 1 - fi - - count_sketches "$examples" - local sketchcount=$? - local sketches=$(cat sketches.txt) - rm -rf sketches.txt - - local chunk_size=$(( $sketchcount / $chunks_num )) - local all_chunks=$(( $chunks_num * $chunk_size )) - if [ "$all_chunks" -lt "$sketchcount" ]; then - chunk_size=$(( $chunk_size + 1 )) - fi - - local start_index=$(( $chunk_idex * $chunk_size )) - if [ "$sketchcount" -le "$start_index" ]; then - echo "Skipping job" - return 0 - fi - - local end_index=$(( $(( $chunk_idex + 1 )) * $chunk_size )) - if [ "$end_index" -gt "$sketchcount" ]; then - end_index=$sketchcount - fi - - local start_num=$(( $start_index + 1 )) - echo "Found $sketchcount Sketches"; - echo "Chunk Count : $chunks_num" - echo "Chunk Size : $chunk_size" - echo "Start Sketch: $start_num" - echo "End Sketch : $end_index" - - local sketchnum=0 - for sketch in $sketches; do - local sketchdir=$(dirname $sketch) - local sketchdirname=$(basename $sketchdir) - local sketchname=$(basename $sketch) - if [ "${sketchdirname}.ino" != "$sketchname" ] \ - || [ -f "$sketchdir/.test.skip" ]; then - continue - fi - sketchnum=$(($sketchnum + 1)) - if [ "$sketchnum" -le "$start_index" ] \ - || [ "$sketchnum" -gt "$end_index" ]; then - continue - fi - build_sketch "$fqbn" "$sketch" "$xtra_opts" - local result=$? - if [ $result -ne 0 ]; then - return $result - fi - done - return 0 -} - diff --git a/.github/scripts/install-platformio-esp32.sh b/.github/scripts/install-platformio-esp32.sh deleted file mode 100644 index e822a5ca358..00000000000 --- a/.github/scripts/install-platformio-esp32.sh +++ /dev/null @@ -1,153 +0,0 @@ -#!/bin/bash - -export PLATFORMIO_ESP32_PATH="$HOME/.platformio/packages/framework-arduinoespressif32" - -echo "Installing Python Wheel..." -pip install wheel > /dev/null 2>&1 -if [ $? -ne 0 ]; then echo "ERROR: Install failed"; exit 1; fi - -echo "Installing PlatformIO..." -pip install -U https://github.com/platformio/platformio/archive/develop.zip > /dev/null 2>&1 -if [ $? -ne 0 ]; then echo "ERROR: Install failed"; exit 1; fi - -echo "Installing Platform ESP32..." -python -m platformio platform install https://github.com/platformio/platform-espressif32.git#feature/stage > /dev/null 2>&1 -if [ $? -ne 0 ]; then echo "ERROR: Install failed"; exit 1; fi - -echo "Replacing the framework version..." -if [[ "$OSTYPE" == "darwin"* ]]; then - sed 's/https:\/\/github\.com\/espressif\/arduino-esp32\.git/*/' "$HOME/.platformio/platforms/espressif32/platform.json" > "platform.json" && \ - mv -f "platform.json" "$HOME/.platformio/platforms/espressif32/platform.json" -else - sed -i 's/https:\/\/github\.com\/espressif\/arduino-esp32\.git/*/' "$HOME/.platformio/platforms/espressif32/platform.json" -fi -if [ $? -ne 0 ]; then echo "ERROR: Replace failed"; exit 1; fi - -if [ "$GITHUB_REPOSITORY" == "espressif/arduino-esp32" ]; then - echo "Linking Core..." && \ - ln -s $GITHUB_WORKSPACE "$PLATFORMIO_ESP32_PATH" -else - echo "Cloning Core Repository..." && \ - git clone https://github.com/espressif/arduino-esp32.git "$PLATFORMIO_ESP32_PATH" > /dev/null 2>&1 - if [ $? -ne 0 ]; then echo "ERROR: GIT clone failed"; exit 1; fi -fi - -echo "PlatformIO for ESP32 has been installed" -echo "" - - -function build_pio_sketch(){ # build_pio_sketch - if [ "$#" -lt 2 ]; then - echo "ERROR: Illegal number of parameters" - echo "USAGE: build_pio_sketch " - return 1 - fi - - local board="$1" - local sketch="$2" - local sketch_dir=$(dirname "$sketch") - echo "" - echo "Compiling '"$(basename "$sketch")"'..." - python -m platformio ci --board "$board" "$sketch_dir" --project-option="board_build.partitions = huge_app.csv" -} - -function count_sketches() # count_sketches -{ - local examples="$1" - local sketches=$(find $examples -name *.ino) - local sketchnum=0 - rm -rf sketches.txt - for sketch in $sketches; do - local sketchdir=$(dirname $sketch) - local sketchdirname=$(basename $sketchdir) - local sketchname=$(basename $sketch) - if [[ "${sketchdirname}.ino" != "$sketchname" ]]; then - continue - fi; - if [[ -f "$sketchdir/.test.skip" ]]; then - continue - fi - echo $sketch >> sketches.txt - sketchnum=$(($sketchnum + 1)) - done - return $sketchnum -} - -function build_pio_sketches() # build_pio_sketches -{ - if [ "$#" -lt 2 ]; then - echo "ERROR: Illegal number of parameters" - echo "USAGE: build_pio_sketches [ ]" - return 1 - fi - - local board=$1 - local examples=$2 - local chunk_idex=$3 - local chunks_num=$4 - - if [ "$#" -lt 4 ]; then - chunk_idex="0" - chunks_num="1" - fi - - if [ "$chunks_num" -le 0 ]; then - echo "ERROR: Chunks count must be positive number" - return 1 - fi - if [ "$chunk_idex" -ge "$chunks_num" ]; then - echo "ERROR: Chunk index must be less than chunks count" - return 1 - fi - - count_sketches "$examples" - local sketchcount=$? - local sketches=$(cat sketches.txt) - rm -rf sketches.txt - - local chunk_size=$(( $sketchcount / $chunks_num )) - local all_chunks=$(( $chunks_num * $chunk_size )) - if [ "$all_chunks" -lt "$sketchcount" ]; then - chunk_size=$(( $chunk_size + 1 )) - fi - - local start_index=$(( $chunk_idex * $chunk_size )) - if [ "$sketchcount" -le "$start_index" ]; then - echo "Skipping job" - return 0 - fi - - local end_index=$(( $(( $chunk_idex + 1 )) * $chunk_size )) - if [ "$end_index" -gt "$sketchcount" ]; then - end_index=$sketchcount - fi - - local start_num=$(( $start_index + 1 )) - echo "Found $sketchcount Sketches"; - echo "Chunk Count : $chunks_num" - echo "Chunk Size : $chunk_size" - echo "Start Sketch: $start_num" - echo "End Sketch : $end_index" - - local sketchnum=0 - for sketch in $sketches; do - local sketchdir=$(dirname $sketch) - local sketchdirname=$(basename $sketchdir) - local sketchname=$(basename $sketch) - if [ "${sketchdirname}.ino" != "$sketchname" ] \ - || [ -f "$sketchdir/.test.skip" ]; then - continue - fi - sketchnum=$(($sketchnum + 1)) - if [ "$sketchnum" -le "$start_index" ] \ - || [ "$sketchnum" -gt "$end_index" ]; then - continue - fi - build_pio_sketch "$board" "$sketch" - local result=$? - if [ $result -ne 0 ]; then - return $result - fi - done - return 0 -} diff --git a/.github/scripts/merge_packages.py b/.github/scripts/merge_packages.py deleted file mode 100755 index 53fbbd9b0a9..00000000000 --- a/.github/scripts/merge_packages.py +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env python -# This script merges two Arduino Board Manager package json files. -# Usage: -# python merge_packages.py package_esp8266com_index.json version/new/package_esp8266com_index.json -# Written by Ivan Grokhotkov, 2015 -# -from __future__ import print_function -from distutils.version import LooseVersion -import re -import json -import sys - -def load_package(filename): - pkg = json.load(open(filename))['packages'][0] - print("Loaded package {0} from {1}".format(pkg['name'], filename), file=sys.stderr) - print("{0} platform(s), {1} tools".format(len(pkg['platforms']), len(pkg['tools'])), file=sys.stderr) - return pkg - -def merge_objects(versions, obj): - for o in obj: - name = o['name'].encode('ascii') - ver = o['version'].encode('ascii') - if not name in versions: - print("found new object, {0}".format(name), file=sys.stderr) - versions[name] = {} - if not ver in versions[name]: - print("found new version {0} for object {1}".format(ver, name), file=sys.stderr) - versions[name][ver] = o - return versions - -# Normalize ESP release version string (x.x.x) by adding '-rc' (x.x.x-rc9223372036854775807) to ensure having REL above any RC -# Dummy approach, functional anyway for current ESP package versioning (unlike NormalizedVersion/LooseVersion/StrictVersion & similar crap) -def pkgVersionNormalized(versionString): - - verStr = str(versionString) - verParts = re.split('\.|-rc', verStr, flags=re.IGNORECASE) - - if len(verParts) == 3: - if (sys.version_info > (3, 0)): # Python 3 - verStr = str(versionString) + '-rc' + str(sys.maxsize) - else: # Python 2 - verStr = str(versionString) + '-rc' + str(sys.maxint) - - elif len(verParts) != 4: - print("pkgVersionNormalized WARNING: unexpected version format: {0})".format(verStr), file=sys.stderr) - - return verStr - - -def main(args): - if len(args) < 3: - print("Usage: {0} ".format(args[0]), file=sys.stderr) - return 1 - - tools = {} - platforms = {} - pkg1 = load_package(args[1]) - tools = merge_objects(tools, pkg1['tools']); - platforms = merge_objects(platforms, pkg1['platforms']); - pkg2 = load_package(args[2]) - tools = merge_objects(tools, pkg2['tools']); - platforms = merge_objects(platforms, pkg2['platforms']); - - pkg1['tools'] = [] - pkg1['platforms'] = [] - - for name in tools: - for version in tools[name]: - print("Adding tool {0}-{1}".format(name, version), file=sys.stderr) - pkg1['tools'].append(tools[name][version]) - - for name in platforms: - for version in platforms[name]: - print("Adding platform {0}-{1}".format(name, version), file=sys.stderr) - pkg1['platforms'].append(platforms[name][version]) - - pkg1['platforms'] = sorted(pkg1['platforms'], key=lambda k: LooseVersion(pkgVersionNormalized(k['version'])), reverse=True) - - json.dump({'packages':[pkg1]}, sys.stdout, indent=2) - -if __name__ == '__main__': - sys.exit(main(sys.argv)) diff --git a/.github/scripts/on-push.sh b/.github/scripts/on-push.sh deleted file mode 100755 index 96b88bb8765..00000000000 --- a/.github/scripts/on-push.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash - -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 - export GITHUB_WORKSPACE="$PWD" - export GITHUB_REPOSITORY="espressif/arduino-esp32" -fi - -CHUNK_INDEX=$1 -CHUNKS_CNT=$2 -BUILD_PIO=0 -if [ "$#" -lt 2 ] || [ "$CHUNKS_CNT" -le 0 ]; then - CHUNK_INDEX=0 - CHUNKS_CNT=1 -elif [ "$CHUNK_INDEX" -gt "$CHUNKS_CNT" ]; then - CHUNK_INDEX=$CHUNKS_CNT -elif [ "$CHUNK_INDEX" -eq "$CHUNKS_CNT" ]; then - BUILD_PIO=1 -fi - -echo "Updating submodules ..." -git -C "$GITHUB_WORKSPACE" submodule update --init --recursive > /dev/null 2>&1 - -if [ "$BUILD_PIO" -eq 0 ]; then - # ArduinoIDE Test - FQBN="espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app" - source ./.github/scripts/install-arduino-ide.sh - source ./.github/scripts/install-arduino-core-esp32.sh - if [ "$OS_IS_WINDOWS" == "1" ]; then - build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino" && \ - build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/BLE/examples/BLE_server/BLE_server.ino" && \ - build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/AzureIoT/examples/GetStarted/GetStarted.ino" && \ - build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino" - elif [ "$OS_IS_MACOS" == "1" ]; then - build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \ - build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino" && \ - build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino" && \ - build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/BLE/examples/BLE_server/BLE_server.ino" && \ - build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/AzureIoT/examples/GetStarted/GetStarted.ino" && \ - build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino" - else - # CMake Test - if [ "$CHUNK_INDEX" -eq 0 ]; then - bash "$ARDUINO_ESP32_PATH/.github/scripts/check-cmakelists.sh" - if [ $? -ne 0 ]; then exit 1; fi - fi - build_sketches "$FQBN" "$ARDUINO_ESP32_PATH/libraries" "$CHUNK_INDEX" "$CHUNKS_CNT" - fi -else - # PlatformIO Test - source ./.github/scripts/install-platformio-esp32.sh - BOARD="esp32dev" - build_pio_sketch "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \ - build_pio_sketch "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino" && \ - build_pio_sketch "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino" && \ - build_pio_sketch "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/BLE/examples/BLE_server/BLE_server.ino" && \ - build_pio_sketch "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/AzureIoT/examples/GetStarted/GetStarted.ino" && \ - build_pio_sketch "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino" - #build_pio_sketches esp32dev "$PLATFORMIO_ESP32_PATH/libraries" -fi -if [ $? -ne 0 ]; then exit 1; fi diff --git a/.github/scripts/on-release.sh b/.github/scripts/on-release.sh deleted file mode 100755 index e5e320099dd..00000000000 --- a/.github/scripts/on-release.sh +++ /dev/null @@ -1,380 +0,0 @@ -#!/bin/bash - -if [ ! $GITHUB_EVENT_NAME == "release" ]; then - echo "Wrong event '$GITHUB_EVENT_NAME'!" - exit 1 -fi - -EVENT_JSON=`cat $GITHUB_EVENT_PATH` - -action=`echo $EVENT_JSON | jq -r '.action'` -if [ ! $action == "published" ]; then - echo "Wrong action '$action'. Exiting now..." - exit 0 -fi - -draft=`echo $EVENT_JSON | jq -r '.release.draft'` -if [ $draft == "true" ]; then - echo "It's a draft release. Exiting now..." - exit 0 -fi - -RELEASE_PRE=`echo $EVENT_JSON | jq -r '.release.prerelease'` -RELEASE_TAG=`echo $EVENT_JSON | jq -r '.release.tag_name'` -RELEASE_BRANCH=`echo $EVENT_JSON | jq -r '.release.target_commitish'` -RELEASE_ID=`echo $EVENT_JSON | jq -r '.release.id'` -RELEASE_BODY=`echo $EVENT_JSON | jq -r '.release.body'` - -OUTPUT_DIR="$GITHUB_WORKSPACE/build" -PACKAGE_NAME="esp32-$RELEASE_TAG" -PACKAGE_JSON_MERGE="$GITHUB_WORKSPACE/.github/scripts/merge_packages.py" -PACKAGE_JSON_TEMPLATE="$GITHUB_WORKSPACE/package/package_esp32_index.template.json" -PACKAGE_JSON_DEV="package_esp32_dev_index.json" -PACKAGE_JSON_REL="package_esp32_index.json" - -echo "Event: $GITHUB_EVENT_NAME, Repo: $GITHUB_REPOSITORY, Path: $GITHUB_WORKSPACE, Ref: $GITHUB_REF" -echo "Action: $action, Branch: $RELEASE_BRANCH, ID: $RELEASE_ID" -echo "Tag: $RELEASE_TAG, Draft: $draft, Pre-Release: $RELEASE_PRE" - -function get_file_size(){ - local file="$1" - if [[ "$OSTYPE" == "darwin"* ]]; then - eval `stat -s "$file"` - local res="$?" - echo "$st_size" - return $res - else - stat --printf="%s" "$file" - return $? - fi -} - -function git_upload_asset(){ - local name=$(basename "$1") - # local mime=$(file -b --mime-type "$1") - curl -k -X POST -sH "Authorization: token $GITHUB_TOKEN" -H "Content-Type: application/octet-stream" --data-binary @"$1" "https://uploads.github.com/repos/$GITHUB_REPOSITORY/releases/$RELEASE_ID/assets?name=$name" -} - -function git_safe_upload_asset(){ - local file="$1" - local name=$(basename "$file") - local size=`get_file_size "$file"` - local upload_res=`git_upload_asset "$file"` - if [ $? -ne 0 ]; then - >&2 echo "ERROR: Failed to upload '$name' ($?)" - return 1 - fi - up_size=`echo "$upload_res" | jq -r '.size'` - if [ $up_size -ne $size ]; then - >&2 echo "ERROR: Uploaded size does not match! $up_size != $size" - #git_delete_asset - return 1 - fi - echo "$upload_res" | jq -r '.browser_download_url' - return $? -} - -function git_upload_to_pages(){ - local path=$1 - local src=$2 - - if [ ! -f "$src" ]; then - >&2 echo "Input is not a file! Aborting..." - return 1 - fi - - local info=`curl -s -k -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3.object+json" -X GET "https://api.github.com/repos/$GITHUB_REPOSITORY/contents/$path?ref=gh-pages"` - local type=`echo "$info" | jq -r '.type'` - local message=$(basename $path) - local sha="" - local content="" - - if [ $type == "file" ]; then - sha=`echo "$info" | jq -r '.sha'` - sha=",\"sha\":\"$sha\"" - message="Updating $message" - elif [ ! $type == "null" ]; then - >&2 echo "Wrong type '$type'" - return 1 - else - message="Creating $message" - fi - - content=`base64 -i "$src"` - data="{\"branch\":\"gh-pages\",\"message\":\"$message\",\"content\":\"$content\"$sha}" - - echo "$data" | curl -s -k -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3.raw+json" -X PUT --data @- "https://api.github.com/repos/$GITHUB_REPOSITORY/contents/$path" -} - -function git_safe_upload_to_pages(){ - local path=$1 - local file="$2" - local name=$(basename "$file") - local size=`get_file_size "$file"` - local upload_res=`git_upload_to_pages "$path" "$file"` - if [ $? -ne 0 ]; then - >&2 echo "ERROR: Failed to upload '$name' ($?)" - return 1 - fi - up_size=`echo "$upload_res" | jq -r '.content.size'` - if [ $up_size -ne $size ]; then - >&2 echo "ERROR: Uploaded size does not match! $up_size != $size" - #git_delete_asset - return 1 - fi - echo "$upload_res" | jq -r '.content.download_url' - return $? -} - -function merge_package_json(){ - local jsonLink=$1 - local jsonOut=$2 - local old_json=$OUTPUT_DIR/oldJson.json - local merged_json=$OUTPUT_DIR/mergedJson.json - - echo "Downloading previous JSON $jsonLink ..." - curl -L -o "$old_json" "https://github.com/$GITHUB_REPOSITORY/releases/download/$jsonLink?access_token=$GITHUB_TOKEN" 2>/dev/null - if [ $? -ne 0 ]; then echo "ERROR: Download Failed! $?"; exit 1; fi - - echo "Creating new JSON ..." - set +e - stdbuf -oL python "$PACKAGE_JSON_MERGE" "$jsonOut" "$old_json" > "$merged_json" - set -e - - set -v - if [ ! -s $merged_json ]; then - rm -f "$merged_json" - echo "Nothing to merge" - else - rm -f "$jsonOut" - mv "$merged_json" "$jsonOut" - echo "JSON data successfully merged" - fi - rm -f "$old_json" - set +v -} - -set -e - -## -## PACKAGE ZIP -## - -mkdir -p "$OUTPUT_DIR" -PKG_DIR="$OUTPUT_DIR/$PACKAGE_NAME" -PACKAGE_ZIP="$PACKAGE_NAME.zip" - -echo "Updating submodules ..." -git -C "$GITHUB_WORKSPACE" submodule update --init --recursive > /dev/null 2>&1 - -mkdir -p "$PKG_DIR/tools" - -# Copy all core files to the package folder -echo "Copying files for packaging ..." -cp -f "$GITHUB_WORKSPACE/boards.txt" "$PKG_DIR/" -cp -f "$GITHUB_WORKSPACE/programmers.txt" "$PKG_DIR/" -cp -Rf "$GITHUB_WORKSPACE/cores" "$PKG_DIR/" -cp -Rf "$GITHUB_WORKSPACE/libraries" "$PKG_DIR/" -cp -Rf "$GITHUB_WORKSPACE/variants" "$PKG_DIR/" -cp -f "$GITHUB_WORKSPACE/tools/espota.exe" "$PKG_DIR/tools/" -cp -f "$GITHUB_WORKSPACE/tools/espota.py" "$PKG_DIR/tools/" -cp -f "$GITHUB_WORKSPACE/tools/esptool.py" "$PKG_DIR/tools/" -cp -f "$GITHUB_WORKSPACE/tools/gen_esp32part.py" "$PKG_DIR/tools/" -cp -f "$GITHUB_WORKSPACE/tools/gen_esp32part.exe" "$PKG_DIR/tools/" -cp -Rf "$GITHUB_WORKSPACE/tools/partitions" "$PKG_DIR/tools/" -cp -Rf "$GITHUB_WORKSPACE/tools/sdk" "$PKG_DIR/tools/" - -# Remove unnecessary files in the package folder -echo "Cleaning up folders ..." -find "$PKG_DIR" -name '*.DS_Store' -exec rm -f {} \; -find "$PKG_DIR" -name '*.git*' -type f -delete - -# Replace tools locations in platform.txt -echo "Generating platform.txt..." -cat "$GITHUB_WORKSPACE/platform.txt" | \ -sed "s/version=.*/version=$ver$extent/g" | \ -sed 's/runtime.tools.xtensa-esp32-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-esp32-elf//g' | \ -sed 's/tools.esptool_py.path={runtime.platform.path}\/tools\/esptool/tools.esptool_py.path=\{runtime.tools.esptool_py.path\}/g' \ - > "$PKG_DIR/platform.txt" - -# Add header with version information -echo "Generating core_version.h ..." -ver_define=`echo $RELEASE_TAG | tr "[:lower:].\055" "[:upper:]_"` -ver_hex=`git -C "$GITHUB_WORKSPACE" rev-parse --short=8 HEAD 2>/dev/null` -echo \#define ARDUINO_ESP32_GIT_VER 0x$ver_hex > "$PKG_DIR/cores/esp32/core_version.h" -echo \#define ARDUINO_ESP32_GIT_DESC `git -C "$GITHUB_WORKSPACE" describe --tags 2>/dev/null` >> "$PKG_DIR/cores/esp32/core_version.h" -echo \#define ARDUINO_ESP32_RELEASE_$ver_define >> "$PKG_DIR/cores/esp32/core_version.h" -echo \#define ARDUINO_ESP32_RELEASE \"$ver_define\" >> "$PKG_DIR/cores/esp32/core_version.h" - -# Compress package folder -echo "Creating ZIP ..." -pushd "$OUTPUT_DIR" >/dev/null -zip -qr "$PACKAGE_ZIP" "$PACKAGE_NAME" -if [ $? -ne 0 ]; then echo "ERROR: Failed to create $PACKAGE_ZIP ($?)"; exit 1; fi - -# Calculate SHA-256 -echo "Calculating SHA sum ..." -PACKAGE_PATH="$OUTPUT_DIR/$PACKAGE_ZIP" -PACKAGE_SHA=`shasum -a 256 "$PACKAGE_ZIP" | cut -f 1 -d ' '` -PACKAGE_SIZE=`get_file_size "$PACKAGE_ZIP"` -popd >/dev/null -rm -rf "$PKG_DIR" -echo "'$PACKAGE_ZIP' Created! Size: $PACKAGE_SIZE, SHA-256: $PACKAGE_SHA" -echo - -# Upload package to release page -echo "Uploading package to release page ..." -PACKAGE_URL=`git_safe_upload_asset "$PACKAGE_PATH"` -echo "Package Uploaded" -echo "Download URL: $PACKAGE_URL" -echo - -## -## PACKAGE JSON -## - -# Construct JQ argument with package data -jq_arg=".packages[0].platforms[0].version = \"$RELEASE_TAG\" | \ - .packages[0].platforms[0].url = \"$PACKAGE_URL\" |\ - .packages[0].platforms[0].archiveFileName = \"$PACKAGE_ZIP\" |\ - .packages[0].platforms[0].size = \"$PACKAGE_SIZE\" |\ - .packages[0].platforms[0].checksum = \"SHA-256:$PACKAGE_SHA\"" - -# Generate package JSONs -echo "Genarating $PACKAGE_JSON_DEV ..." -cat "$PACKAGE_JSON_TEMPLATE" | jq "$jq_arg" > "$OUTPUT_DIR/$PACKAGE_JSON_DEV" -if [ "$RELEASE_PRE" == "false" ]; then - echo "Genarating $PACKAGE_JSON_REL ..." - cat "$PACKAGE_JSON_TEMPLATE" | jq "$jq_arg" > "$OUTPUT_DIR/$PACKAGE_JSON_REL" -fi - -# Figure out the last release or pre-release -echo "Getting previous releases ..." -releasesJson=`curl -sH "Authorization: token $GITHUB_TOKEN" "https://api.github.com/repos/$GITHUB_REPOSITORY/releases" 2>/dev/null` -if [ $? -ne 0 ]; then echo "ERROR: Get Releases Failed! ($?)"; exit 1; fi - -set +e -prev_release=$(echo "$releasesJson" | jq -e -r '. | map(select(.draft == false and .prerelease == false)) | sort_by(.created_at | - fromdateiso8601) | .[0].tag_name') -prev_any_release=$(echo "$releasesJson" | jq -e -r '. | map(select(.draft == false)) | sort_by(.created_at | - fromdateiso8601) | .[0].tag_name') -shopt -s nocasematch -if [ "$prev_any_release" == "$RELEASE_TAG" ]; then - prev_release=$(echo "$releasesJson" | jq -e -r '. | map(select(.draft == false and .prerelease == false)) | sort_by(.created_at | - fromdateiso8601) | .[1].tag_name') - prev_any_release=$(echo "$releasesJson" | jq -e -r '. | map(select(.draft == false)) | sort_by(.created_at | - fromdateiso8601) | .[1].tag_name') -fi -COMMITS_SINCE_RELEASE="$prev_any_release" -shopt -u nocasematch -set -e - -# Merge package JSONs with previous releases -if [ ! -z "$prev_any_release" ] && [ "$prev_any_release" != "null" ]; then - echo "Merging with JSON from $prev_any_release ..." - merge_package_json "$prev_any_release/$PACKAGE_JSON_DEV" "$OUTPUT_DIR/$PACKAGE_JSON_DEV" -fi - -if [ "$RELEASE_PRE" == "false" ]; then - COMMITS_SINCE_RELEASE="$prev_release" - if [ ! -z "$prev_release" ] && [ "$prev_release" != "null" ]; then - echo "Merging with JSON from $prev_release ..." - merge_package_json "$prev_release/$PACKAGE_JSON_REL" "$OUTPUT_DIR/$PACKAGE_JSON_REL" - fi -fi - -echo "Previous Release: $prev_release" -echo "Previous (any)release: $prev_any_release" -echo - -# Upload package JSONs -echo "Uploading $PACKAGE_JSON_DEV ..." -echo "Download URL: "`git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_DEV"` -echo "Pages URL: "`git_safe_upload_to_pages "$PACKAGE_JSON_DEV" "$OUTPUT_DIR/$PACKAGE_JSON_DEV"` -echo -if [ "$RELEASE_PRE" == "false" ]; then - echo "Uploading $PACKAGE_JSON_REL ..." - echo "Download URL: "`git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_REL"` - echo "Pages URL: "`git_safe_upload_to_pages "$PACKAGE_JSON_REL" "$OUTPUT_DIR/$PACKAGE_JSON_REL"` - echo -fi - -## -## RELEASE NOTES -## - -# Create release notes -echo "Preparing release notes ..." -releaseNotes="" - -# Process annotated tags -relNotesRaw=`git -C "$GITHUB_WORKSPACE" show -s --format=%b $RELEASE_TAG` -readarray -t msgArray <<<"$relNotesRaw" -arrLen=${#msgArray[@]} -if [ $arrLen > 3 ] && [ "${msgArray[0]:0:3}" == "tag" ]; then - ind=3 - while [ $ind -lt $arrLen ]; do - if [ $ind -eq 3 ]; then - releaseNotes="#### ${msgArray[ind]}" - releaseNotes+=$'\r\n' - else - oneLine="$(echo -e "${msgArray[ind]}" | sed -e 's/^[[:space:]]*//')" - if [ ${#oneLine} -gt 0 ]; then - if [ "${oneLine:0:2}" == "* " ]; then oneLine=$(echo ${oneLine/\*/-}); fi - if [ "${oneLine:0:2}" != "- " ]; then releaseNotes+="- "; fi - releaseNotes+="$oneLine" - releaseNotes+=$'\r\n' - fi - fi - let ind=$ind+1 - done -fi - -# Append Commit Messages -if [ ! -z "$COMMITS_SINCE_RELEASE" ] && [ "$COMMITS_SINCE_RELEASE" != "null" ]; then - echo "Getting commits since $COMMITS_SINCE_RELEASE ..." - commitFile=$OUTPUT_DIR/commits.txt - git -C "$GITHUB_WORKSPACE" log --oneline $COMMITS_SINCE_RELEASE.. > "$OUTPUT_DIR/commits.txt" - releaseNotes+=$'\r\n##### Commits\r\n' - IFS=$'\n' - for next in `cat $commitFile` - do - IFS=' ' read -r commitId commitMsg <<< "$next" - commitLine="- [$commitId](https://github.com/$GITHUB_REPOSITORY/commit/$commitId) $commitMsg" - releaseNotes+="$commitLine" - releaseNotes+=$'\r\n' - done - rm -f $commitFile -fi - -# Prepend the original release body -if [ "${RELEASE_BODY: -1}" == $'\r' ]; then - RELEASE_BODY="${RELEASE_BODY:0:-1}" -else - RELEASE_BODY="$RELEASE_BODY" -fi -RELEASE_BODY+=$'\r\n' -releaseNotes="$RELEASE_BODY$releaseNotes" - -# Update release page -echo "Updating release notes ..." -releaseNotes=$(printf '%s' "$releaseNotes" | python -c 'import json,sys; print(json.dumps(sys.stdin.read()))') -releaseNotes=${releaseNotes:1:-1} -curlData="{\"body\": \"$releaseNotes\"}" -releaseData=`curl --data "$curlData" "https://api.github.com/repos/$GITHUB_REPOSITORY/releases/$RELEASE_ID?access_token=$GITHUB_TOKEN" 2>/dev/null` -if [ $? -ne 0 ]; then echo "ERROR: Updating Release Failed: $?"; exit 1; fi -echo "Release notes successfully updated" -echo - -## -## SUBMODULE VERSIONS -## - -# Upload submodules versions -echo "Generating submodules.txt ..." -git -C "$GITHUB_WORKSPACE" submodule status > "$OUTPUT_DIR/submodules.txt" -echo "Uploading submodules.txt ..." -echo "Download URL: "`git_safe_upload_asset "$OUTPUT_DIR/submodules.txt"` -echo "" -set +e - -## -## DONE -## -echo "DONE!" diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index e969fcba5b1..00000000000 --- a/.github/stale.yml +++ /dev/null @@ -1,64 +0,0 @@ -# Configuration for probot-stale - https://github.com/probot/stale - -# Number of days of inactivity before an Issue or Pull Request becomes stale -daysUntilStale: 60 - -# Number of days of inactivity before an Issue or Pull Request with the stale label is closed. -# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. -daysUntilClose: 14 - -# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled) -onlyLabels: [] - -# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable -exemptLabels: - - pinned - - security - - "to be implemented" - - "for reference" - - "move to PR" - - "enhancement" - -# Set to true to ignore issues in a project (defaults to false) -exemptProjects: false - -# Set to true to ignore issues in a milestone (defaults to false) -exemptMilestones: false - -# Set to true to ignore issues with an assignee (defaults to false) -exemptAssignees: false - -# Label to use when marking as stale -staleLabel: stale - -# Comment to post when marking as stale. Set to `false` to disable -markComment: > - [STALE_SET] This issue has been automatically marked as stale because it has not had - recent activity. It will be closed in 14 days if no further activity occurs. Thank you - for your contributions. - -# Comment to post when removing the stale label. -unmarkComment: > - [STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future. - -# Comment to post when closing a stale Issue or Pull Request. -closeComment: > - [STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions. - -# Limit the number of actions per hour, from 1-30. Default is 30 -limitPerRun: 30 - -# Limit to only `issues` or `pulls` -only: issues - -# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls': -# pulls: -# daysUntilStale: 30 -# markComment: > -# This pull request has been automatically marked as stale because it has not had -# recent activity. It will be closed if no further activity occurs. Thank you -# for your contributions. - -# issues: -# exemptLabels: -# - confirmed diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml deleted file mode 100644 index 42d4735f106..00000000000 --- a/.github/workflows/push.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: ESP32 Arduino CI - -on: - push: - branches: - - master - - release/* - pull_request: - -jobs: - - # Ubuntu - build-arduino-linux: - name: Arduino ${{ matrix.chunk }} on ubuntu-latest - runs-on: ubuntu-latest - strategy: - matrix: - chunk: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] - - steps: - - uses: actions/checkout@v1 - - name: Build Sketches - run: bash ./.github/scripts/on-push.sh ${{ matrix.chunk }} 15 - - # Windows and MacOS - build-arduino-win-mac: - name: Arduino on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-latest, macOS-latest] - - steps: - - uses: actions/checkout@v1 - - name: Build Sketches - run: bash ./.github/scripts/on-push.sh - - # PlatformIO on Windows, Ubuntu and Mac - build-platformio: - name: PlatformIO on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macOS-latest] - - steps: - - uses: actions/checkout@v1 - - name: Build Sketches - run: bash ./.github/scripts/on-push.sh 1 1 #equal and non-zero to trigger PIO diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 83b625164f7..00000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: ESP32 Arduino Release - -on: - release: - types: published - -jobs: - build: - name: Publish Release - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@master - - name: Build Release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: bash ./.github/scripts/on-release.sh diff --git a/.gitignore b/.gitignore index a09a7a0d6b9..9a90619a107 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,9 @@ -tools/xtensa-esp32-elf -tools/dist -tools/esptool -tools/esptool.exe -tools/mkspiffs/mkspiffs -tools/mkspiffs/mkspiffs.exe +tools/ +.vale/ +docs/ +tests/ + .DS_Store - #Ignore files built by Visual Studio/Visual Micro [Dd]ebug*/ [Rr]elease*/ diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index c9e5e6fd92e..00000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "libraries/AzureIoT"] - path = libraries/AzureIoT - url = https://github.com/VSChina/ESP32_AzureIoT_Arduino 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/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 32979ad4acf..00000000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,216 +0,0 @@ -set(CORE_SRCS - cores/esp32/base64.cpp - cores/esp32/cbuf.cpp - cores/esp32/esp32-hal-adc.c - cores/esp32/esp32-hal-bt.c - cores/esp32/esp32-hal-cpu.c - cores/esp32/esp32-hal-dac.c - cores/esp32/esp32-hal-gpio.c - cores/esp32/esp32-hal-i2c.c - cores/esp32/esp32-hal-ledc.c - cores/esp32/esp32-hal-matrix.c - cores/esp32/esp32-hal-misc.c - cores/esp32/esp32-hal-psram.c - cores/esp32/esp32-hal-sigmadelta.c - cores/esp32/esp32-hal-spi.c - cores/esp32/esp32-hal-time.c - cores/esp32/esp32-hal-timer.c - cores/esp32/esp32-hal-touch.c - cores/esp32/esp32-hal-uart.c - cores/esp32/esp32-hal-rmt.c - cores/esp32/Esp.cpp - cores/esp32/FunctionalInterrupt.cpp - cores/esp32/HardwareSerial.cpp - cores/esp32/IPAddress.cpp - cores/esp32/IPv6Address.cpp - cores/esp32/libb64/cdecode.c - cores/esp32/libb64/cencode.c - cores/esp32/main.cpp - cores/esp32/MD5Builder.cpp - cores/esp32/Print.cpp - cores/esp32/stdlib_noniso.c - cores/esp32/Stream.cpp - cores/esp32/StreamString.cpp - cores/esp32/wiring_pulse.c - cores/esp32/wiring_shift.c - cores/esp32/WMath.cpp - cores/esp32/WString.cpp - ) - -set(LIBRARY_SRCS - libraries/ArduinoOTA/src/ArduinoOTA.cpp - libraries/AsyncUDP/src/AsyncUDP.cpp - libraries/BluetoothSerial/src/BluetoothSerial.cpp - libraries/DNSServer/src/DNSServer.cpp - libraries/EEPROM/src/EEPROM.cpp - libraries/ESPmDNS/src/ESPmDNS.cpp - libraries/FFat/src/FFat.cpp - libraries/FS/src/FS.cpp - libraries/FS/src/vfs_api.cpp - libraries/HTTPClient/src/HTTPClient.cpp - libraries/HTTPUpdate/src/HTTPUpdate.cpp - libraries/NetBIOS/src/NetBIOS.cpp - libraries/Preferences/src/Preferences.cpp - libraries/SD_MMC/src/SD_MMC.cpp - libraries/SD/src/SD.cpp - libraries/SD/src/sd_diskio.cpp - libraries/SD/src/sd_diskio_crc.c - libraries/SimpleBLE/src/SimpleBLE.cpp - libraries/SPIFFS/src/SPIFFS.cpp - libraries/SPI/src/SPI.cpp - libraries/Ticker/src/Ticker.cpp - libraries/Update/src/Updater.cpp - libraries/WebServer/src/WebServer.cpp - libraries/WebServer/src/Parsing.cpp - libraries/WebServer/src/detail/mimetable.cpp - libraries/WiFiClientSecure/src/ssl_client.cpp - libraries/WiFiClientSecure/src/WiFiClientSecure.cpp - libraries/WiFi/src/ETH.cpp - libraries/WiFi/src/WiFiAP.cpp - libraries/WiFi/src/WiFiClient.cpp - libraries/WiFi/src/WiFi.cpp - libraries/WiFi/src/WiFiGeneric.cpp - libraries/WiFi/src/WiFiMulti.cpp - libraries/WiFi/src/WiFiScan.cpp - libraries/WiFi/src/WiFiServer.cpp - libraries/WiFi/src/WiFiSTA.cpp - libraries/WiFi/src/WiFiUdp.cpp - libraries/Wire/src/Wire.cpp - ) - -set(AZURE_SRCS - libraries/AzureIoT/src/az_iot/azureiotcerts.c - libraries/AzureIoT/src/az_iot/c-utility/pal/agenttime.c - libraries/AzureIoT/src/az_iot/c-utility/pal/dns_async.c - libraries/AzureIoT/src/az_iot/c-utility/pal/freertos/lock.c - libraries/AzureIoT/src/az_iot/c-utility/pal/freertos/threadapi.c - libraries/AzureIoT/src/az_iot/c-utility/pal/freertos/tickcounter.c - libraries/AzureIoT/src/az_iot/c-utility/pal/lwip/sntp_lwip.c - libraries/AzureIoT/src/az_iot/c-utility/pal/socket_async.c - libraries/AzureIoT/src/az_iot/c-utility/pal/src/platform_openssl_compact.c - libraries/AzureIoT/src/az_iot/c-utility/pal/src/tlsio_openssl_compact.c - libraries/AzureIoT/src/az_iot/c-utility/pal/tlsio_options.c - libraries/AzureIoT/src/az_iot/c-utility/src/base64.c - libraries/AzureIoT/src/az_iot/c-utility/src/buffer.c - libraries/AzureIoT/src/az_iot/c-utility/src/connection_string_parser.c - libraries/AzureIoT/src/az_iot/c-utility/src/consolelogger.c - libraries/AzureIoT/src/az_iot/c-utility/src/constbuffer.c - libraries/AzureIoT/src/az_iot/c-utility/src/constmap.c - libraries/AzureIoT/src/az_iot/c-utility/src/crt_abstractions.c - libraries/AzureIoT/src/az_iot/c-utility/src/doublylinkedlist.c - libraries/AzureIoT/src/az_iot/c-utility/src/gballoc.c - libraries/AzureIoT/src/az_iot/c-utility/src/gb_stdio.c - libraries/AzureIoT/src/az_iot/c-utility/src/gb_time.c - libraries/AzureIoT/src/az_iot/c-utility/src/hmac.c - libraries/AzureIoT/src/az_iot/c-utility/src/hmacsha256.c - libraries/AzureIoT/src/az_iot/c-utility/src/httpapiex.c - libraries/AzureIoT/src/az_iot/c-utility/src/httpapiexsas.c - libraries/AzureIoT/src/az_iot/c-utility/src/httpheaders.c - libraries/AzureIoT/src/az_iot/c-utility/src/http_proxy_io.c - libraries/AzureIoT/src/az_iot/c-utility/src/map.c - libraries/AzureIoT/src/az_iot/c-utility/src/optionhandler.c - libraries/AzureIoT/src/az_iot/c-utility/src/sastoken.c - libraries/AzureIoT/src/az_iot/c-utility/src/sha1.c - libraries/AzureIoT/src/az_iot/c-utility/src/sha224.c - libraries/AzureIoT/src/az_iot/c-utility/src/sha384-512.c - libraries/AzureIoT/src/az_iot/c-utility/src/singlylinkedlist.c - libraries/AzureIoT/src/az_iot/c-utility/src/strings.c - libraries/AzureIoT/src/az_iot/c-utility/src/string_tokenizer.c - libraries/AzureIoT/src/az_iot/c-utility/src/urlencode.c - libraries/AzureIoT/src/az_iot/c-utility/src/usha.c - libraries/AzureIoT/src/az_iot/c-utility/src/vector.c - libraries/AzureIoT/src/az_iot/c-utility/src/xio.c - libraries/AzureIoT/src/az_iot/c-utility/src/xlogging.c - libraries/AzureIoT/src/az_iot/iothub_client/src/blob.c - libraries/AzureIoT/src/az_iot/iothub_client/src/iothub_client_authorization.c - libraries/AzureIoT/src/az_iot/iothub_client/src/iothub_client.c - libraries/AzureIoT/src/az_iot/iothub_client/src/iothub_client_ll.c - libraries/AzureIoT/src/az_iot/iothub_client/src/iothub_client_retry_control.c - libraries/AzureIoT/src/az_iot/iothub_client/src/iothub_message.c - libraries/AzureIoT/src/az_iot/iothub_client/src/iothubtransport.c - libraries/AzureIoT/src/az_iot/iothub_client/src/iothubtransportmqtt.c - libraries/AzureIoT/src/az_iot/iothub_client/src/iothubtransport_mqtt_common.c - libraries/AzureIoT/src/az_iot/iothub_client/src/version.c - libraries/AzureIoT/src/az_iot/umqtt/src/mqtt_client.c - libraries/AzureIoT/src/az_iot/umqtt/src/mqtt_codec.c - libraries/AzureIoT/src/az_iot/umqtt/src/mqtt_message.c - libraries/AzureIoT/src/AzureIotHub.cpp - libraries/AzureIoT/src/Esp32MQTTClient.cpp - ) - -set(BLE_SRCS - libraries/BLE/src/BLE2902.cpp - libraries/BLE/src/BLE2904.cpp - libraries/BLE/src/BLEAddress.cpp - libraries/BLE/src/BLEAdvertisedDevice.cpp - libraries/BLE/src/BLEAdvertising.cpp - libraries/BLE/src/BLEBeacon.cpp - libraries/BLE/src/BLECharacteristic.cpp - libraries/BLE/src/BLECharacteristicMap.cpp - libraries/BLE/src/BLEClient.cpp - libraries/BLE/src/BLEDescriptor.cpp - libraries/BLE/src/BLEDescriptorMap.cpp - libraries/BLE/src/BLEDevice.cpp - libraries/BLE/src/BLEEddystoneTLM.cpp - libraries/BLE/src/BLEEddystoneURL.cpp - libraries/BLE/src/BLEExceptions.cpp - libraries/BLE/src/BLEHIDDevice.cpp - libraries/BLE/src/BLERemoteCharacteristic.cpp - libraries/BLE/src/BLERemoteDescriptor.cpp - libraries/BLE/src/BLERemoteService.cpp - libraries/BLE/src/BLEScan.cpp - libraries/BLE/src/BLESecurity.cpp - libraries/BLE/src/BLEServer.cpp - libraries/BLE/src/BLEService.cpp - libraries/BLE/src/BLEServiceMap.cpp - libraries/BLE/src/BLEUtils.cpp - libraries/BLE/src/BLEUUID.cpp - libraries/BLE/src/BLEValue.cpp - libraries/BLE/src/FreeRTOS.cpp - libraries/BLE/src/GeneralUtils.cpp - ) - -set(COMPONENT_SRCS ${CORE_SRCS} ${LIBRARY_SRCS} ${AZURE_SRCS} ${BLE_SRCS}) - -set(COMPONENT_ADD_INCLUDEDIRS - variants/esp32/ - cores/esp32/ - libraries/ArduinoOTA/src - libraries/AsyncUDP/src - libraries/AzureIoT/src - libraries/BLE/src - libraries/BluetoothSerial/src - libraries/DNSServer/src - libraries/EEPROM/src - libraries/ESP32/src - libraries/ESPmDNS/src - libraries/FFat/src - libraries/FS/src - libraries/HTTPClient/src - libraries/HTTPUpdate/src - libraries/NetBIOS/src - libraries/Preferences/src - libraries/SD_MMC/src - libraries/SD/src - libraries/SimpleBLE/src - libraries/SPIFFS/src - libraries/SPI/src - libraries/Ticker/src - libraries/Update/src - libraries/WebServer/src - libraries/WiFiClientSecure/src - libraries/WiFi/src - libraries/Wire/src - ) - -set(COMPONENT_PRIV_INCLUDEDIRS cores/esp32/libb64) - -set(COMPONENT_REQUIRES spi_flash mbedtls mdns ethernet) -set(COMPONENT_PRIV_REQUIRES fatfs nvs_flash app_update spiffs bootloader_support openssl bt) - -register_component() - -set_source_files_properties(libraries/AzureIoT/src/az_iot/iothub_client/src/iothubtransport_mqtt_common.c - PROPERTIES COMPILE_FLAGS - -Wno-maybe-uninitialized -) diff --git a/Kconfig.projbuild b/Kconfig.projbuild deleted file mode 100644 index 10bbf25181e..00000000000 --- a/Kconfig.projbuild +++ /dev/null @@ -1,325 +0,0 @@ -menu "Arduino Configuration" - -config ENABLE_ARDUINO_DEPENDS - bool - select LWIP_SO_RCVBUF - select ETHERNET - select WIFI_ENABLED - select ESP32_PHY_CALIBRATION_AND_DATA_STORAGE - select MEMMAP_SMP - default "y" - -config AUTOSTART_ARDUINO - bool "Autostart Arduino setup and loop on boot" - default "n" - help - Enabling this option will implement app_main and start Arduino. - All you need to implement in your main.cpp is setup() and loop() - and include Arduino.h - If disabled, you can call initArduino() to run any preparations - required by the framework - -choice ARDUINO_RUNNING_CORE - bool "Core on which Arduino's setup() and loop() are running" - default ARDUINO_RUN_CORE1 - help - Select on which core Arduino's setup() and loop() functions run - - config ARDUINO_RUN_CORE0 - bool "CORE 0" - config ARDUINO_RUN_CORE1 - bool "CORE 1" - config ARDUINO_RUN_NO_AFFINITY - bool "BOTH" - -endchoice - -config ARDUINO_RUNNING_CORE - int - default 0 if ARDUINO_RUN_CORE0 - default 1 if ARDUINO_RUN_CORE1 - default -1 if ARDUINO_RUN_NO_AFFINITY - -choice ARDUINO_EVENT_RUNNING_CORE - bool "Core on which Arduino's event handler is running" - default ARDUINO_EVENT_RUN_CORE1 - help - Select on which core Arduino's WiFi.onEvent() run - - config ARDUINO_EVENT_RUN_CORE0 - bool "CORE 0" - config ARDUINO_EVENT_RUN_CORE1 - bool "CORE 1" - config ARDUINO_EVENT_RUN_NO_AFFINITY - bool "BOTH" - -endchoice - -config ARDUINO_EVENT_RUNNING_CORE - int - default 0 if ARDUINO_EVENT_RUN_CORE0 - default 1 if ARDUINO_EVENT_RUN_CORE1 - default -1 if ARDUINO_EVENT_RUN_NO_AFFINITY - -choice ARDUINO_UDP_RUNNING_CORE - bool "Core on which Arduino's UDP is running" - default ARDUINO_UDP_RUN_CORE1 - help - Select on which core Arduino's UDP run - - config ARDUINO_UDP_RUN_CORE0 - bool "CORE 0" - config ARDUINO_UDP_RUN_CORE1 - bool "CORE 1" - config ARDUINO_UDP_RUN_NO_AFFINITY - bool "BOTH" - -endchoice - -config ARDUINO_UDP_RUNNING_CORE - int - default 0 if ARDUINO_UDP_RUN_CORE0 - default 1 if ARDUINO_UDP_RUN_CORE1 - default -1 if ARDUINO_UDP_RUN_NO_AFFINITY - - -config DISABLE_HAL_LOCKS - bool "Disable mutex locks for HAL" - default "n" - help - Enabling this option will run all hardware abstraction without locks. - While communication with external hardware will be faster, you need to - make sure that there is no option to use the same bus from another thread - or interrupt at the same time. Option is best used with Arduino enabled - and code implemented only in setup/loop and Arduino callbacks - -menu "Debug Log Configuration" -choice ARDUHAL_LOG_DEFAULT_LEVEL - bool "Default log level" - default ARDUHAL_LOG_DEFAULT_LEVEL_ERROR - help - Specify how much output to see in logs by default. - -config ARDUHAL_LOG_DEFAULT_LEVEL_NONE - bool "No output" -config ARDUHAL_LOG_DEFAULT_LEVEL_ERROR - bool "Error" -config ARDUHAL_LOG_DEFAULT_LEVEL_WARN - bool "Warning" -config ARDUHAL_LOG_DEFAULT_LEVEL_INFO - bool "Info" -config ARDUHAL_LOG_DEFAULT_LEVEL_DEBUG - bool "Debug" -config ARDUHAL_LOG_DEFAULT_LEVEL_VERBOSE - bool "Verbose" -endchoice - -config ARDUHAL_LOG_DEFAULT_LEVEL - int - default 0 if ARDUHAL_LOG_DEFAULT_LEVEL_NONE - default 1 if ARDUHAL_LOG_DEFAULT_LEVEL_ERROR - default 2 if ARDUHAL_LOG_DEFAULT_LEVEL_WARN - default 3 if ARDUHAL_LOG_DEFAULT_LEVEL_INFO - default 4 if ARDUHAL_LOG_DEFAULT_LEVEL_DEBUG - default 5 if ARDUHAL_LOG_DEFAULT_LEVEL_VERBOSE - -config ARDUHAL_LOG_COLORS - bool "Use ANSI terminal colors in log output" - default "n" - help - Enable ANSI terminal color codes in bootloader output. - In order to view these, your terminal program must support ANSI color codes. - -config ARDUHAL_ESP_LOG - bool "Forward ESP_LOGx to Arduino log output" - default "n" - help - This option will redefine the ESP_LOGx macros to Arduino's log_x macros. - To enable for your application, add the follwing after your includes: - #ifdef ARDUINO_ARCH_ESP32 - #include "esp32-hal-log.h" - #endif - -endmenu - -choice ARDUHAL_PARTITION_SCHEME - bool "Used partition scheme" - default ARDUHAL_PARTITION_SCHEME_DEFAULT - help - Specify which partition scheme to be used. - -config ARDUHAL_PARTITION_SCHEME_DEFAULT - bool "Default" -config ARDUHAL_PARTITION_SCHEME_MINIMAL - bool "Minimal (for 2MB FLASH)" -config ARDUHAL_PARTITION_SCHEME_NO_OTA - bool "No OTA (for large apps)" -config ARDUHAL_PARTITION_SCHEME_HUGE_APP - bool "Huge App (for very large apps)" -config ARDUHAL_PARTITION_SCHEME_MIN_SPIFFS - bool "Minimal SPIFFS (for large apps with OTA)" -endchoice - -config ARDUHAL_PARTITION_SCHEME - string - default "default" if ARDUHAL_PARTITION_SCHEME_DEFAULT - default "minimal" if ARDUHAL_PARTITION_SCHEME_MINIMAL - default "no_ota" if ARDUHAL_PARTITION_SCHEME_NO_OTA - default "huge_app" if ARDUHAL_PARTITION_SCHEME_HUGE_APP - default "min_spiffs" if ARDUHAL_PARTITION_SCHEME_MIN_SPIFFS - - -config AUTOCONNECT_WIFI - bool "Autoconnect WiFi on boot" - default "n" - depends on AUTOSTART_ARDUINO - select ARDUINO_SELECTIVE_WiFi - help - If enabled, WiFi will connect to the last used SSID (if station was enabled), - else connection will be started only after calling WiFi.begin(ssid, password) - -config ARDUINO_SELECTIVE_COMPILATION - bool "Include only specific Arduino libraries" - default n - -config ARDUINO_SELECTIVE_ArduinoOTA - bool "Enable ArduinoOTA" - depends on ARDUINO_SELECTIVE_COMPILATION - select ARDUINO_SELECTIVE_WiFi - select ARDUINO_SELECTIVE_ESPmDNS - default y - -config ARDUINO_SELECTIVE_AsyncUDP - bool "Enable AsyncUDP" - depends on ARDUINO_SELECTIVE_COMPILATION - default y - -config ARDUINO_SELECTIVE_AzureIoT - bool "Enable AzureIoT" - depends on ARDUINO_SELECTIVE_COMPILATION - select ARDUINO_SELECTIVE_HTTPClient - default y - -config ARDUINO_SELECTIVE_BLE - bool "Enable BLE" - depends on ARDUINO_SELECTIVE_COMPILATION - default y - -config ARDUINO_SELECTIVE_BluetoothSerial - bool "Enable BluetoothSerial" - depends on ARDUINO_SELECTIVE_COMPILATION - default y - -config ARDUINO_SELECTIVE_DNSServer - bool "Enable DNSServer" - depends on ARDUINO_SELECTIVE_COMPILATION - select ARDUINO_SELECTIVE_WiFi - default y - -config ARDUINO_SELECTIVE_EEPROM - bool "Enable EEPROM" - depends on ARDUINO_SELECTIVE_COMPILATION - default y - -config ARDUINO_SELECTIVE_ESP32 - bool "Enable ESP32" - depends on ARDUINO_SELECTIVE_COMPILATION - default y - -config ARDUINO_SELECTIVE_ESPmDNS - bool "Enable ESPmDNS" - depends on ARDUINO_SELECTIVE_COMPILATION - select ARDUINO_SELECTIVE_WiFi - default y - -config ARDUINO_SELECTIVE_FFat - bool "Enable FFat" - depends on ARDUINO_SELECTIVE_COMPILATION - select ARDUINO_SELECTIVE_FS - default y - -config ARDUINO_SELECTIVE_FS - bool "Enable FS" - depends on ARDUINO_SELECTIVE_COMPILATION - default y - -config ARDUINO_SELECTIVE_HTTPClient - bool "Enable HTTPClient" - depends on ARDUINO_SELECTIVE_COMPILATION - select ARDUINO_SELECTIVE_WiFi - select ARDUINO_SELECTIVE_WiFiClientSecure - default y - -config ARDUINO_SELECTIVE_NetBIOS - bool "Enable NetBIOS" - depends on ARDUINO_SELECTIVE_COMPILATION - select ARDUINO_SELECTIVE_WiFi - default y - -config ARDUINO_SELECTIVE_Preferences - bool "Enable Preferences" - depends on ARDUINO_SELECTIVE_COMPILATION - default y - -config ARDUINO_SELECTIVE_SD - bool "Enable SD" - depends on ARDUINO_SELECTIVE_COMPILATION - select ARDUINO_SELECTIVE_FS - default y - -config ARDUINO_SELECTIVE_SD_MMC - bool "Enable SD_MMC" - depends on ARDUINO_SELECTIVE_COMPILATION - select ARDUINO_SELECTIVE_FS - default y - -config ARDUINO_SELECTIVE_SimpleBLE - bool "Enable SimpleBLE" - depends on ARDUINO_SELECTIVE_COMPILATION - default y - -config ARDUINO_SELECTIVE_SPI - bool "Enable SPI" - depends on ARDUINO_SELECTIVE_COMPILATION - default y - -config ARDUINO_SELECTIVE_SPIFFS - bool "Enable SPIFFS" - depends on ARDUINO_SELECTIVE_COMPILATION - select ARDUINO_SELECTIVE_FS - default y - -config ARDUINO_SELECTIVE_Ticker - bool "Enable Ticker" - depends on ARDUINO_SELECTIVE_COMPILATION - default y - -config ARDUINO_SELECTIVE_Update - bool "Enable Update" - depends on ARDUINO_SELECTIVE_COMPILATION - default y - -config ARDUINO_SELECTIVE_WebServer - bool "Enable WebServer" - depends on ARDUINO_SELECTIVE_COMPILATION - default y - select ARDUINO_SELECTIVE_FS - -config ARDUINO_SELECTIVE_WiFi - bool "Enable WiFi" - depends on ARDUINO_SELECTIVE_COMPILATION - default y - -config ARDUINO_SELECTIVE_WiFiClientSecure - bool "Enable WiFiClientSecure" - depends on ARDUINO_SELECTIVE_COMPILATION - select ARDUINO_SELECTIVE_WiFi - default y - -config ARDUINO_SELECTIVE_Wire - bool "Enable Wire" - depends on ARDUINO_SELECTIVE_COMPILATION - default y - - -endmenu diff --git a/LIBRARIES_TEST.md b/LIBRARIES_TEST.md new file mode 100644 index 00000000000..cd598956c23 --- /dev/null +++ b/LIBRARIES_TEST.md @@ -0,0 +1,18 @@ +### External libraries build test + +Library|ESP32|ESP32C3|ESP32C6|ESP32H2|ESP32P4|ESP32S2|ESP32S3 +-|:-:|:-:|:-:|:-:|:-:|:-:|:-: +Adafruit NeoPixel|1 :white_check_mark: |1 :white_check_mark: |1 :white_check_mark: |1 :white_check_mark: |1 :white_check_mark: |1 :white_check_mark: |1 :white_check_mark: +ArduinoBLE|1 :white_check_mark: |1 :white_check_mark: |1 :white_check_mark: |1 :white_check_mark: |1 :x: |N/A|1 :white_check_mark: +ESP32Servo|1 :white_check_mark: |1 :white_check_mark: |1 :white_check_mark: |1 :white_check_mark: |1 :white_check_mark: |1 :white_check_mark: |1 :white_check_mark: +ESPAsyncWebServer|32 :white_check_mark: |32 :white_check_mark: |32 :white_check_mark: |32 :white_check_mark: |32 :white_check_mark: |32 :white_check_mark: |32 :white_check_mark: +EthernetESP32|2 :warning: |2 :white_check_mark: |2 :white_check_mark: |2 :white_check_mark: |2 :x: |2 :white_check_mark: |2 :white_check_mark: +FastLED|1 :white_check_mark: |1 :white_check_mark: |1 :white_check_mark: |1 :warning: |1 :warning: |1 :white_check_mark: |1 :warning: +IRremote|1 :warning: |1 :white_check_mark: |1 :white_check_mark: |1 :white_check_mark: |1 :warning: |1 :white_check_mark: |1 :white_check_mark: +MFRC522|1 :white_check_mark: |1 :white_check_mark: |1 :white_check_mark: |1 :white_check_mark: |1 :white_check_mark: |1 :white_check_mark: |1 :white_check_mark: +WS2812FX|1 :white_check_mark: |1 :white_check_mark: |1 :white_check_mark: |1 :white_check_mark: |1 :white_check_mark: |1 :white_check_mark: |1 :white_check_mark: +ZACwire for TSic|2 :warning: |2 :warning: |2 :warning: |2 :warning: |2 :warning: |2 :warning: |2 :warning: + + +Generated on: Apr-20-2025 04:33:53 +/ [GitHub Action Link](https://github.com/espressif/arduino-esp32/actions/runs/14555801834) diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index d55f6088e5e..00000000000 --- a/LICENSE.md +++ /dev/null @@ -1,503 +0,0 @@ -### GNU LESSER GENERAL PUBLIC LICENSE - -Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - [This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - -### Preamble - -The licenses for most software are designed to take away your freedom -to share and change it. By contrast, the GNU General Public Licenses -are intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. - -This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations -below. - -When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - -To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - -For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - -We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - -To protect each distributor, we want to make it very clear that there -is no warranty for the free library. Also, if the library is modified -by someone else and passed on, the recipients should know that what -they have is not the original version, so that the original author's -reputation will not be affected by problems that might be introduced -by others. - -Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - -Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - -When a program is linked with a library, whether statically or using a -shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - -We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - -For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it -becomes a de-facto standard. To achieve this, non-free programs must -be allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - -In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - -Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - -The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - -### TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - -**0.** This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). Each -licensee is addressed as "you". - -A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - -The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - -"Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control -compilation and installation of the library. - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does and -what the program that uses the Library does. - -**1.** You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a -fee. - -**2.** You may modify your copy or copies of the Library or any -portion of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - -- **a)** The modified work must itself be a software library. -- **b)** You must cause the files modified to carry prominent - notices stating that you changed the files and the date of - any change. -- **c)** You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. -- **d)** If a facility in the modified Library refers to a function - or a table of data to be supplied by an application program that - uses the facility, other than as an argument passed when the - facility is invoked, then you must make a good faith effort to - ensure that, in the event an application does not supply such - function or table, the facility still operates, and performs - whatever part of its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of - the application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - -**3.** You may opt to apply the terms of the ordinary GNU General -Public License instead of this License to a given copy of the Library. -To do this, you must alter all the notices that refer to this License, -so that they refer to the ordinary GNU General Public License, version -2, instead of to this License. (If a newer version than version 2 of -the ordinary GNU General Public License has appeared, then you can -specify that version instead if you wish.) Do not make any other -change in these notices. - -Once this change is made in a given copy, it is irreversible for that -copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - -This option is useful when you wish to copy part of the code of the -Library into a program that is not a library. - -**4.** You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - -If distribution of object code is made by offering access to copy from -a designated place, then offering equivalent access to copy the source -code from the same place satisfies the requirement to distribute the -source code, even though third parties are not compelled to copy the -source along with the object code. - -**5.** A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a work, -in isolation, is not a derivative work of the Library, and therefore -falls outside the scope of this License. - -However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. Section -6 states terms for distribution of such executables. - -When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - -If such an object file uses only numerical parameters, data structure -layouts and accessors, and small macros and small inline functions -(ten lines or less in length), then the use of the object file is -unrestricted, regardless of whether it is legally a derivative work. -(Executables containing this object code plus portions of the Library -will still fall under Section 6.) - -Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - -**6.** As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a work -containing portions of the Library, and distribute that work under -terms of your choice, provided that the terms permit modification of -the work for the customer's own use and reverse engineering for -debugging such modifications. - -You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - -- **a)** Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood that - the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) -- **b)** Use a suitable shared library mechanism for linking with - the Library. A suitable mechanism is one that (1) uses at run time - a copy of the library already present on the user's computer - system, rather than copying library functions into the executable, - and (2) will operate properly with a modified version of the - library, if the user installs one, as long as the modified version - is interface-compatible with the version that the work was - made with. -- **c)** Accompany the work with a written offer, valid for at least - three years, to give the same user the materials specified in - Subsection 6a, above, for a charge no more than the cost of - performing this distribution. -- **d)** If distribution of the work is made by offering access to - copy from a designated place, offer equivalent access to copy the - above specified materials from the same place. -- **e)** Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - -For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - -It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - -**7.** You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - -- **a)** Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other - library facilities. This must be distributed under the terms of - the Sections above. -- **b)** Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - -**8.** You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - -**9.** You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - -**10.** Each time you redistribute the Library (or any work based on -the Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - -**11.** If, as a consequence of a court judgment or allegation of -patent infringement or for any other reason (not limited to patent -issues), conditions are imposed on you (whether by court order, -agreement or otherwise) that contradict the conditions of this -License, they do not excuse you from the conditions of this License. -If you cannot distribute so as to satisfy simultaneously your -obligations under this License and any other pertinent obligations, -then as a consequence you may not distribute the Library at all. For -example, if a patent license would not permit royalty-free -redistribution of the Library by all those who receive copies directly -or indirectly through you, then the only way you could satisfy both it -and this License would be to refrain entirely from distribution of the -Library. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply, and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - -**12.** If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - -**13.** The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. Such -new versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - -**14.** If you wish to incorporate parts of the Library into other -free programs whose distribution conditions are incompatible with -these, write to the author to ask for permission. For software which -is copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - -**NO WARRANTY** - -**15.** BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -**16.** IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - -### END OF TERMS AND CONDITIONS - -### How to Apply These Terms to Your New Libraries - -If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms -of the ordinary General Public License). - -To apply these terms, attach the following notices to the library. It -is safest to attach them to the start of each source file to most -effectively convey the exclusion of warranty; and each file should -have at least the "copyright" line and a pointer to where the full -notice is found. - - one line to give the library's name and an idea of what it does. - Copyright (C) year name of author - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper -mail. - -You should also get your employer (if you work as a programmer) or -your school, if any, to sign a "copyright disclaimer" for the library, -if necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in - the library `Frob' (a library for tweaking knobs) written - by James Random Hacker. - - signature of Ty Coon, 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! \ No newline at end of file diff --git a/Makefile.projbuild b/Makefile.projbuild deleted file mode 100644 index 26b43787a6f..00000000000 --- a/Makefile.projbuild +++ /dev/null @@ -1,7 +0,0 @@ -BOOT_APP_BIN_ROOT := $(call dequote,$(COMPONENT_PATH)) - -ifndef CONFIG_PARTITION_TABLE_CUSTOM -PARTITION_TABLE_CSV_PATH = $(call dequote,$(abspath $(BOOT_APP_BIN_ROOT)/$(subst $(quote),,tools/partitions/$(CONFIG_ARDUHAL_PARTITION_SCHEME).csv))) -endif - -CPPFLAGS += -DARDUINO=10800 -DESP32=1 -DARDUINO_ARCH_ESP32=1 -DBOARD_HAS_PSRAM diff --git a/README.md b/README.md deleted file mode 100644 index 76c15971a0b..00000000000 --- a/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# Arduino core for the ESP32 -[![Build Status](https://travis-ci.org/espressif/arduino-esp32.svg?branch=master)](https://travis-ci.org/espressif/arduino-esp32) ![](https://github.com/espressif/arduino-esp32/workflows/ESP32%20Arduino%20CI/badge.svg) - -### Need help or have a question? Join the chat at [![https://gitter.im/espressif/arduino-esp32](https://badges.gitter.im/espressif/arduino-esp32.svg)](https://gitter.im/espressif/arduino-esp32?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - -## Contents -- [Development Status](#development-status) -- [Installation Instructions](#installation-instructions) -- [Decoding Exceptions](#decoding-exceptions) -- [Issue/Bug report template](#issuebug-report-template) -- [ESP32Dev Board PINMAP](#esp32dev-board-pinmap) - -### Development Status -[Latest stable release ![Release Version](https://img.shields.io/github/release/espressif/arduino-esp32.svg?style=plastic) ![Release Date](https://img.shields.io/github/release-date/espressif/arduino-esp32.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/latest/) ![Downloads](https://img.shields.io/github/downloads/espressif/arduino-esp32/latest/total.svg?style=plastic) - -[Latest development release ![Development Version](https://img.shields.io/github/release/espressif/arduino-esp32/all.svg?style=plastic) ![Development Date](https://img.shields.io/github/release-date-pre/espressif/arduino-esp32.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/latest/) ![Downloads](https://img.shields.io/github/downloads-pre/espressif/arduino-esp32/latest/total.svg?style=plastic) - -### Installation Instructions -- Using Arduino IDE Boards Manager (preferred) - + [Instructions for Boards Manager](docs/arduino-ide/boards_manager.md) -- Using Arduino IDE with the development repository - + [Instructions for Windows](docs/arduino-ide/windows.md) - + [Instructions for Mac](docs/arduino-ide/mac.md) - + [Instructions for Debian/Ubuntu Linux](docs/arduino-ide/debian_ubuntu.md) - + [Instructions for Fedora](docs/arduino-ide/fedora.md) - + [Instructions for openSUSE](docs/arduino-ide/opensuse.md) -- [Using PlatformIO](docs/platformio.md) -- [Building with make](docs/make.md) -- [Using as ESP-IDF component](docs/esp-idf_component.md) -- [Using OTAWebUpdater](docs/OTAWebUpdate/OTAWebUpdate.md) - -### Decoding exceptions - -You can use [EspExceptionDecoder](https://github.com/me-no-dev/EspExceptionDecoder) to get meaningful call trace. - -### 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 [for reference](https://github.com/espressif/arduino-esp32/issues?utf8=%E2%9C%93&q=is%3Aissue%20label%3A%22for%20reference%22%20). - -Finally, if you're sure no one else had the issue, follow the [ISSUE_TEMPLATE](docs/ISSUE_TEMPLATE.md) while reporting any issue. - -### ESP32Dev Board PINMAP - -![Pin Functions](docs/esp32_pinmap.png) - -### Hint - -Sometimes to program ESP32 via serial you must keep GPIO0 LOW during the programming process diff --git a/SIZES_TEST.md b/SIZES_TEST.md new file mode 100644 index 00000000000..f9c8d3369aa --- /dev/null +++ b/SIZES_TEST.md @@ -0,0 +1,238 @@ +### Memory usage test + +The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target. + + + + + + + + + + +
MemoryFLASH [bytes]FLASH [%]RAM [bytes]RAM [%]
TargetDECINCDECINCDECINCDECINC
ESP32S3:green_heart: -3K:bangbang: +209K:green_heart: -0.89:bangbang: +32.03:green_heart: -7K0:green_heart: -26.120.00
ESP32S2:green_heart: -431K:bangbang: +207K:green_heart: -31.46:bangbang: +32.70:green_heart: -15K0:green_heart: -41.420.00
ESP32C3:green_heart: -11K:bangbang: +221K:green_heart: -4.35:bangbang: +32.70:green_heart: -7K0:green_heart: -34.510.00
ESP32C6000.000.00000.000.00
ESP32H2000.000.00000.000.00
ESP32:green_heart: -474K:bangbang: +200K:green_heart: -36.63:bangbang: +28.22:green_heart: -22K0:green_heart: -51.170.00
+ +
+Click to expand the detailed deltas report [usage change in BYTES] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TargetESP32S3ESP32S2ESP32C3ESP32C6ESP32H2ESP32
ExampleFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAM
ArduinoOTA/examples/BasicOTA:bangbang: +179K:green_heart: -6K:bangbang: +176K:green_heart: -5K:bangbang: +194K:green_heart: -5K----:bangbang: +154K:green_heart: -3K
AsyncUDP/examples/AsyncUDPClient:bangbang: +159K:green_heart: -6K:bangbang: +158K:green_heart: -5K:bangbang: +176K:green_heart: -6K----:bangbang: +148K:green_heart: -3K
AsyncUDP/examples/AsyncUDPMulticastServer:bangbang: +159K:green_heart: -6K:bangbang: +158K:green_heart: -5K:bangbang: +176K:green_heart: -6K----:bangbang: +147K:green_heart: -3K
AsyncUDP/examples/AsyncUDPServer:bangbang: +159K:green_heart: -6K:bangbang: +158K:green_heart: -5K:bangbang: +176K:green_heart: -6K----:bangbang: +147K:green_heart: -3K
BLE/examples/BLE5_extended_scan:bangbang: +17K:green_heart: -4K--:green_heart: -1704:green_heart: -4K------
BLE/examples/BLE5_multi_advertising:bangbang: +17K:green_heart: -4K--:green_heart: -1674:green_heart: -4K------
BLE/examples/BLE5_periodic_advertising:bangbang: +17K:green_heart: -4K--:green_heart: -1722:green_heart: -4K------
BLE/examples/BLE5_periodic_sync:bangbang: +17K:green_heart: -4K--:green_heart: -1722:green_heart: -4K------
BLE/examples/Beacon_Scanner------------
BLE/examples/Client------------
BLE/examples/EddystoneTLM_Beacon------------
BLE/examples/EddystoneURL_Beacon------------
BLE/examples/Notify------------
BLE/examples/Scan------------
BLE/examples/Server------------
BLE/examples/Server_multiconnect------------
BLE/examples/UART------------
BLE/examples/Write------------
BLE/examples/iBeacon------------
DNSServer/examples/CaptivePortal:bangbang: +209K:green_heart: -6K:bangbang: +207K:green_heart: -5K:bangbang: +221K:green_heart: -6K----:bangbang: +200K:green_heart: -3K
EEPROM/examples/eeprom_class:bangbang: +7K:green_heart: -4K:bangbang: +20K:green_heart: -4K:green_heart: -11K:green_heart: -4K----:green_heart: -3K:green_heart: -4K
EEPROM/examples/eeprom_extra:bangbang: +7K:green_heart: -4K:bangbang: +5K:green_heart: -4K:green_heart: -11K:green_heart: -4K----:green_heart: -3K:green_heart: -4K
EEPROM/examples/eeprom_write:bangbang: +7K:green_heart: -4K:bangbang: +20K:green_heart: -4K:bangbang: +6K:green_heart: -4K----:green_heart: -3K:green_heart: -4K
ESP32/examples/AnalogOut/LEDCFade------------
ESP32/examples/AnalogOut/LEDCSoftwareFade:bangbang: +20K:green_heart: -4K:bangbang: +31K:green_heart: -4K:bangbang: +12K:green_heart: -4K----:bangbang: +14K:green_heart: -4K
ESP32/examples/AnalogOut/SigmaDelta:bangbang: +23K:green_heart: -4K:bangbang: +33K:green_heart: -4K:bangbang: +14K:green_heart: -4K----:bangbang: +16K:green_heart: -4K
ESP32/examples/AnalogOut/ledcFrequency:bangbang: +20K:green_heart: -4K:bangbang: +18K:green_heart: -4K:bangbang: +12K:green_heart: -4K----:bangbang: +13K:green_heart: -4K
ESP32/examples/AnalogOut/ledcWrite_RGB:bangbang: +7K:green_heart: -4K:bangbang: +20K:green_heart: -4K:warning: +1344:green_heart: -4K----:green_heart: -2K:green_heart: -4K
ESP32/examples/AnalogRead:bangbang: +8K:green_heart: -4K:bangbang: +7K:green_heart: -4K:bangbang: +8K:green_heart: -4K----:green_heart: -2K:green_heart: -4K
ESP32/examples/AnalogReadContinuous------------
ESP32/examples/ArduinoStackSize:bangbang: +7K:green_heart: -4K:bangbang: +6K:green_heart: -4K:warning: +1232:green_heart: -4K----:green_heart: -2K:green_heart: -4K
ESP32/examples/CI/CIBoardsTest:bangbang: +23K:green_heart: -4K:bangbang: +33K:green_heart: -4K:bangbang: +16K:green_heart: -4K----:warning: +1548:green_heart: -4K
ESP32/examples/Camera/CameraWebServer:bangbang: +147K:green_heart: -6K:green_heart: -431K:green_heart: -15K------:green_heart: -474K:green_heart: -14K
ESP32/examples/ChipID/GetChipID:bangbang: +8K:green_heart: -4K:bangbang: +7K:green_heart: -4K:bangbang: +3K:green_heart: -4K----:green_heart: -712:green_heart: -4K
ESP32/examples/DeepSleep/ExternalWakeUp:warning: +320:green_heart: -5K:green_heart: -8K:green_heart: -7K------:green_heart: -12K:green_heart: -5K
ESP32/examples/DeepSleep/TimerWakeUp:warning: +308:green_heart: -5K:green_heart: -8K:green_heart: -7K:green_heart: -5K:green_heart: -5K----:green_heart: -12K:green_heart: -5K
ESP32/examples/DeepSleep/TouchWakeUp:bangbang: +2K:green_heart: -5K:green_heart: -6K:green_heart: -7K------:green_heart: -13K:green_heart: -6K
ESP32/examples/FreeRTOS/BasicMultiThreading:bangbang: +21K:green_heart: -4K:bangbang: +18K:green_heart: -4K:bangbang: +18K:green_heart: -4K----:green_heart: -836:green_heart: -4K
ESP32/examples/FreeRTOS/Mutex:bangbang: +7K:green_heart: -4K:bangbang: +6K:green_heart: -4K:warning: +1246:green_heart: -4K----:green_heart: -2K:green_heart: -4K
ESP32/examples/FreeRTOS/Queue:bangbang: +7K:green_heart: -4K:bangbang: +6K:green_heart: -4K:warning: +1228:green_heart: -4K----:green_heart: -2K:green_heart: -4K
ESP32/examples/FreeRTOS/Semaphore:bangbang: +7K:green_heart: -4K:bangbang: +6K:green_heart: -4K:warning: +1240:green_heart: -4K----:green_heart: -2K:green_heart: -4K
ESP32/examples/GPIO/BlinkRGB:bangbang: +29K:green_heart: -4K:bangbang: +38K:green_heart: -4K:bangbang: +19K:green_heart: -4K----:bangbang: +15K:green_heart: -4K
ESP32/examples/GPIO/FunctionalInterrupt:bangbang: +8K:green_heart: -4K:bangbang: +7K:green_heart: -4K:bangbang: +3K:green_heart: -4K----:green_heart: -2K:green_heart: -4K
ESP32/examples/GPIO/FunctionalInterruptStruct:bangbang: +8K:green_heart: -4K:bangbang: +7K:green_heart: -4K:bangbang: +3K:green_heart: -4K----:green_heart: -2K:green_heart: -4K
ESP32/examples/GPIO/GPIOInterrupt:bangbang: +8K:green_heart: -4K:bangbang: +7K:green_heart: -4K:bangbang: +3K:green_heart: -4K----:green_heart: -2K:green_heart: -4K
ESP32/examples/HWCDC_Events:bangbang: +21K:green_heart: -4K--:bangbang: +11K:green_heart: -4K------
ESP32/examples/MacAddress/GetMacAddress------------
ESP32/examples/RMT/RMTCallback:bangbang: +20K:green_heart: -4K:bangbang: +16K:green_heart: -3K:bangbang: +12K:green_heart: -3K----:bangbang: +7K:green_heart: -3K
ESP32/examples/RMT/RMTLoopback:bangbang: +18K:green_heart: -4K:bangbang: +15K:green_heart: -4K:bangbang: +11K:green_heart: -4K----:bangbang: +6K:green_heart: -4K
ESP32/examples/RMT/RMTReadXJT:bangbang: +20K:green_heart: -4K:bangbang: +17K:green_heart: -3K:bangbang: +12K:green_heart: -3K----:bangbang: +7K:green_heart: -4K
ESP32/examples/RMT/RMTWriteNeoPixel:bangbang: +19K:green_heart: -4K:bangbang: +16K:green_heart: -4K:bangbang: +12K:green_heart: -4K----:bangbang: +6K:green_heart: -4K
ESP32/examples/RMT/RMT_CPUFreq_Test------------
ESP32/examples/RMT/RMT_EndOfTransmissionState------------
ESP32/examples/RMT/RMT_LED_Blink------------
ESP32/examples/ResetReason/ResetReason------------
ESP32/examples/ResetReason/ResetReason2------------
ESP32/examples/Serial/BaudRateDetect_Demo------------
ESP32/examples/Serial/OnReceiveError_BREAK_Demo:bangbang: +7K:green_heart: -4K:bangbang: +6K:green_heart: -4K:warning: +1280:green_heart: -4K----:green_heart: -2K:green_heart: -4K
ESP32/examples/Serial/OnReceive_Demo:bangbang: +7K:green_heart: -4K:bangbang: +6K:green_heart: -4K:warning: +1258:green_heart: -4K----:green_heart: -2K:green_heart: -4K
ESP32/examples/Serial/RS485_Echo_Demo------------
ESP32/examples/Serial/RxFIFOFull_Demo:bangbang: +7K:green_heart: -4K:bangbang: +6K:green_heart: -4K:warning: +1298:green_heart: -4K----:green_heart: -2K:green_heart: -4K
ESP32/examples/Serial/RxTimeout_Demo:bangbang: +7K:green_heart: -4K:bangbang: +6K:green_heart: -4K:warning: +1258:green_heart: -4K----:green_heart: -2K:green_heart: -4K
ESP32/examples/Serial/Serial_All_CPU_Freqs:bangbang: +7K:green_heart: -4K:bangbang: +6K:green_heart: -4K:warning: +1176:green_heart: -4K----:green_heart: -2K:green_heart: -4K
ESP32/examples/Serial/Serial_STD_Func_OnReceive:bangbang: +7K:green_heart: -4K:bangbang: +6K:green_heart: -4K:warning: +1252:green_heart: -4K----:green_heart: -2K:green_heart: -4K
ESP32/examples/Serial/onReceiveExample------------
ESP32/examples/TWAI/TWAIreceive:bangbang: +7K:green_heart: -4K:bangbang: +6K:green_heart: -4K:warning: +1830:green_heart: -4K----:green_heart: -2K:green_heart: -4K
ESP32/examples/TWAI/TWAItransmit:bangbang: +7K:green_heart: -4K:bangbang: +6K:green_heart: -4K:warning: +1802:green_heart: -4K----:green_heart: -2K:green_heart: -4K
ESP32/examples/Template/ExampleTemplate:bangbang: +21K:green_heart: -4K:bangbang: +32K:green_heart: -4K:bangbang: +12K:green_heart: -4K----:bangbang: +15K:green_heart: -4K
ESP32/examples/Time/SimpleTime:bangbang: +160K:green_heart: -6K:bangbang: +159K:green_heart: -5K:bangbang: +177K:green_heart: -6K----:bangbang: +146K:green_heart: -3K
ESP32/examples/Timer/RepeatTimer:bangbang: +8K:green_heart: -4K:bangbang: +22K:green_heart: -4K:bangbang: +3K:green_heart: -4K----:green_heart: -3K:green_heart: -4K
ESP32/examples/Timer/WatchdogTimer:bangbang: +8K:green_heart: -4K:bangbang: +22K:green_heart: -4K:bangbang: +3K:green_heart: -4K----:green_heart: -3K:green_heart: -4K
ESP32/examples/Touch/TouchButtonV2:bangbang: +8K:green_heart: -4K:bangbang: +21K:green_heart: -4K--------
ESP32/examples/Touch/TouchInterrupt:bangbang: +8K:green_heart: -4K:bangbang: +21K:green_heart: -4K------:green_heart: -4K:green_heart: -5K
ESP32/examples/Touch/TouchRead:bangbang: +9K:green_heart: -4K:bangbang: +22K:green_heart: -4K------:green_heart: -3K:green_heart: -5K
ESP32/examples/Utilities/HEXBuilder------------
ESP32/examples/Utilities/MD5Builder------------
ESP32/examples/Utilities/SHA1Builder------------
ESP_I2S/examples/ES8388_loopback------------
ESP_I2S/examples/Record_to_WAV------------
ESP_I2S/examples/Simple_tone------------
ESP_NOW/examples/ESP_NOW_Broadcast_Master------------
ESP_NOW/examples/ESP_NOW_Broadcast_Slave------------
ESP_NOW/examples/ESP_NOW_Network------------
ESP_NOW/examples/ESP_NOW_Serial------------
ESP_SR/examples/Basic------------
ESPmDNS/examples/mDNS-SD_Extended:bangbang: +164K:green_heart: -6K:bangbang: +163K:green_heart: -5K:bangbang: +182K:green_heart: -6K----:bangbang: +151K:green_heart: -3K
ESPmDNS/examples/mDNS_Web_Server:bangbang: +165K:green_heart: -6K:bangbang: +164K:green_heart: -5K:bangbang: +183K:green_heart: -6K----:bangbang: +151K:green_heart: -3K
Ethernet/examples/ETH_W5500_Arduino_SPI------------
Ethernet/examples/ETH_W5500_IDF_SPI------------
FFat/examples/FFat_Test:bangbang: +9K:green_heart: -4K:bangbang: +8K:green_heart: -4K:bangbang: +3K:green_heart: -4K----:green_heart: -1848:green_heart: -4K
FFat/examples/FFat_time:bangbang: +162K:green_heart: -6K:bangbang: +161K:green_heart: -5K:bangbang: +179K:green_heart: -6K----:bangbang: +148K:green_heart: -3K
HTTPClient/examples/Authorization:bangbang: +180K:green_heart: -6K:bangbang: +179K:green_heart: -5K:bangbang: +204K:green_heart: -6K----:bangbang: +164K:green_heart: -2K
HTTPClient/examples/BasicHttpClient:bangbang: +180K:green_heart: -6K:bangbang: +179K:green_heart: -5K:bangbang: +204K:green_heart: -6K----:bangbang: +164K:green_heart: -2K
HTTPClient/examples/BasicHttpsClient:bangbang: +180K:green_heart: -6K:bangbang: +180K:green_heart: -5K:bangbang: +204K:green_heart: -6K----:bangbang: +164K:green_heart: -2K
HTTPClient/examples/HTTPClientEnterprise:bangbang: +194K:green_heart: -6K:bangbang: +193K:green_heart: -5K:bangbang: +218K:green_heart: -6K----:bangbang: +177K:green_heart: -2K
HTTPClient/examples/ReuseConnection:bangbang: +181K:green_heart: -6K:bangbang: +180K:green_heart: -5K:bangbang: +204K:green_heart: -6K----:bangbang: +164K:green_heart: -2K
HTTPClient/examples/StreamHttpClient:bangbang: +181K:green_heart: -6K:bangbang: +180K:green_heart: -5K:bangbang: +204K:green_heart: -6K----:bangbang: +164K:green_heart: -2K
HTTPUpdate/examples/httpUpdate:bangbang: +167K:green_heart: -6K:bangbang: +164K:green_heart: -5K:bangbang: +188K:green_heart: -5K----:bangbang: +143K:green_heart: -2K
HTTPUpdate/examples/httpUpdateSPIFFS:bangbang: +167K:green_heart: -6K:bangbang: +164K:green_heart: -5K:bangbang: +188K:green_heart: -5K----:bangbang: +143K:green_heart: -2K
HTTPUpdate/examples/httpUpdateSecure:bangbang: +193K:green_heart: -6K:bangbang: +190K:green_heart: -5K:bangbang: +213K:green_heart: -5K----:bangbang: +166K:green_heart: -2K
HTTPUpdateServer/examples/WebUpdater:bangbang: +179K:green_heart: -6K:bangbang: +177K:green_heart: -5K:bangbang: +194K:green_heart: -6K----:bangbang: +154K:green_heart: -3K
Insights/examples/DiagnosticsSmokeTest:bangbang: +121K:green_heart: -7K:bangbang: +120K:green_heart: -6K:bangbang: +136K:green_heart: -6K----:bangbang: +105K:green_heart: -3K
Insights/examples/MinimalDiagnostics:bangbang: +121K:green_heart: -7K:bangbang: +120K:green_heart: -6K:bangbang: +136K:green_heart: -6K----:bangbang: +105K:green_heart: -3K
LittleFS/examples/LITTLEFS_test:bangbang: +8K:green_heart: -4K:bangbang: +6K:green_heart: -4K:warning: +1238:green_heart: -4K----:green_heart: -2K:green_heart: -4K
LittleFS/examples/LITTLEFS_time:bangbang: +161K:green_heart: -6K:bangbang: +160K:green_heart: -5K:bangbang: +177K:green_heart: -6K----:bangbang: +147K:green_heart: -3K
NetBIOS/examples/ESP_NBNST:bangbang: +159K:green_heart: -6K:bangbang: +158K:green_heart: -5K:bangbang: +174K:green_heart: -6K----:bangbang: +147K:green_heart: -3K
NetworkClientSecure/examples/WiFiClientInsecure------------
NetworkClientSecure/examples/WiFiClientPSK------------
NetworkClientSecure/examples/WiFiClientSecure------------
NetworkClientSecure/examples/WiFiClientSecureEnterprise------------
NetworkClientSecure/examples/WiFiClientSecureProtocolUpgrade------------
NetworkClientSecure/examples/WiFiClientShowPeerCredentials------------
NetworkClientSecure/examples/WiFiClientTrustOnFirstUse------------
PPP/examples/PPP_Basic------------
Preferences/examples/Prefs2Struct:bangbang: +7K:green_heart: -4K:bangbang: +5K:green_heart: -4K:bangbang: +6K:green_heart: -4K----:green_heart: -3K:green_heart: -4K
Preferences/examples/StartCounter:bangbang: +7K:green_heart: -4K:bangbang: +5K:green_heart: -4K:bangbang: +2K:green_heart: -4K----:green_heart: -3K:green_heart: -4K
RainMaker/examples/RMakerCustom:bangbang: +150K:green_heart: -7K:bangbang: +141K:green_heart: -6K:bangbang: +173K:green_heart: -6K----:bangbang: +111K:green_heart: -3K
RainMaker/examples/RMakerCustomAirCooler:bangbang: +149K:green_heart: -7K:bangbang: +141K:green_heart: -6K:bangbang: +172K:green_heart: -6K----:bangbang: +111K:green_heart: -3K
RainMaker/examples/RMakerSonoffDualR3:bangbang: +150K:green_heart: -7K:bangbang: +142K:green_heart: -6K:bangbang: +173K:green_heart: -6K----:bangbang: +112K:green_heart: -3K
RainMaker/examples/RMakerSwitch:bangbang: +151K:green_heart: -7K:bangbang: +142K:green_heart: -6K:bangbang: +172K:green_heart: -6K----:bangbang: +112K:green_heart: -3K
SD/examples/SD_Test:bangbang: +21K:green_heart: -4K:bangbang: +16K:green_heart: -4K:bangbang: +14K:green_heart: -4K----:green_heart: -2040:green_heart: -4K
SD/examples/SD_time:bangbang: +171K:green_heart: -6K:bangbang: +168K:green_heart: -5K:bangbang: +187K:green_heart: -6K----:bangbang: +147K:green_heart: -3K
SD_MMC/examples/SDMMC_Test:green_heart: -3K:green_heart: -4K--------:green_heart: -14K:green_heart: -5K
SD_MMC/examples/SDMMC_time:bangbang: +151K:green_heart: -6K--------:bangbang: +136K:green_heart: -3K
SPI/examples/SPI_Multiple_Buses:bangbang: +27K:green_heart: -4K:bangbang: +36K:green_heart: -4K------:bangbang: +10K:green_heart: -4K
SPIFFS/examples/SPIFFS_Test:bangbang: +8K:green_heart: -4K:bangbang: +6K:green_heart: -4K:warning: +756:green_heart: -4K----:green_heart: -2K:green_heart: -4K
SPIFFS/examples/SPIFFS_time:bangbang: +161K:green_heart: -6K:bangbang: +159K:green_heart: -5K:bangbang: +176K:green_heart: -6K----:bangbang: +146K:green_heart: -3K
SimpleBLE/examples/SimpleBleDevice:bangbang: +17K:green_heart: -4K--------:green_heart: -9K:green_heart: -4K
TFLiteMicro/examples/hello_world------------
Ticker/examples/Blinker:bangbang: +28K:green_heart: -4K:bangbang: +37K:green_heart: -4K:bangbang: +17K:green_heart: -4K----:bangbang: +12K:green_heart: -4K
Ticker/examples/TickerBasic------------
Ticker/examples/TickerParameter------------
USB/examples/CompositeDevice:bangbang: +24K:green_heart: -4K:bangbang: +14K:green_heart: -4K--------
USB/examples/ConsumerControl:bangbang: +30K:green_heart: -4K:bangbang: +20K:green_heart: -4K--------
USB/examples/CustomHIDDevice:bangbang: +24K:green_heart: -4K:bangbang: +12K:green_heart: -4K--------
USB/examples/FirmwareMSC:bangbang: +20K:green_heart: -4K:bangbang: +7K:green_heart: -4K--------
USB/examples/Gamepad:bangbang: +24K:green_heart: -4K:bangbang: +12K:green_heart: -4K--------
USB/examples/HIDVendor:bangbang: +24K:green_heart: -4K:bangbang: +12K:green_heart: -4K--------
USB/examples/Keyboard/KeyboardLogout:bangbang: +30K:green_heart: -4K:bangbang: +20K:green_heart: -4K--------
USB/examples/Keyboard/KeyboardMessage:bangbang: +30K:green_heart: -4K:bangbang: +20K:green_heart: -4K--------
USB/examples/Keyboard/KeyboardReprogram:bangbang: +30K:green_heart: -4K:bangbang: +20K:green_heart: -4K--------
USB/examples/Keyboard/KeyboardSerial:bangbang: +24K:green_heart: -4K:bangbang: +10K:green_heart: -4K--------
USB/examples/KeyboardAndMouseControl:bangbang: +24K:green_heart: -4K:bangbang: +12K:green_heart: -4K--------
USB/examples/MIDI/MidiController------------
USB/examples/MIDI/MidiInterface------------
USB/examples/MIDI/MidiMusicBox------------
USB/examples/MIDI/ReceiveMidi------------
USB/examples/Mouse/ButtonMouseControl:bangbang: +30K:green_heart: -4K:bangbang: +20K:green_heart: -4K--------
USB/examples/SystemControl:bangbang: +30K:green_heart: -4K:bangbang: +20K:green_heart: -4K--------
USB/examples/USBMSC:bangbang: +20K:green_heart: -4K:bangbang: +7K:green_heart: -4K--------
USB/examples/USBSerial:bangbang: +23K:green_heart: -4K:bangbang: +10K:green_heart: -4K--------
USB/examples/USBVendor:bangbang: +24K:green_heart: -4K:bangbang: +12K:green_heart: -4K--------
Update/examples/AWS_S3_OTA_Update:bangbang: +172K:green_heart: -6K:bangbang: +169K:green_heart: -5K:bangbang: +186K:green_heart: -6K----:bangbang: +150K:green_heart: -3K
Update/examples/HTTPS_OTA_Update:bangbang: +126K:green_heart: -6K:bangbang: +125K:green_heart: -5K:bangbang: +141K:green_heart: -6K----:bangbang: +109K:green_heart: -3K
Update/examples/HTTP_Client_AES_OTA_Update------------
Update/examples/HTTP_Server_AES_OTA_Update------------
Update/examples/OTAWebUpdater------------
Update/examples/SD_Update:bangbang: +25K:green_heart: -4K:bangbang: +18K:green_heart: -4K:bangbang: +17K:green_heart: -4K----:warning: +100:green_heart: -4K
WebServer/examples/AdvancedWebServer:bangbang: +175K:green_heart: -6K:bangbang: +172K:green_heart: -5K:bangbang: +180K:green_heart: -6K----:bangbang: +152K:green_heart: -3K
WebServer/examples/FSBrowser:bangbang: +166K:green_heart: -7K:bangbang: +164K:green_heart: -5K:bangbang: +175K:green_heart: -6K----:bangbang: +151K:green_heart: -3K
WebServer/examples/HelloServer:bangbang: +175K:green_heart: -6K:bangbang: +172K:green_heart: -5K:bangbang: +180K:green_heart: -6K----:bangbang: +152K:green_heart: -3K
WebServer/examples/HttpAdvancedAuth:bangbang: +180K:green_heart: -6K:bangbang: +177K:green_heart: -5K:bangbang: +193K:green_heart: -6K----:bangbang: +155K:green_heart: -3K
WebServer/examples/HttpAuthCallback------------
WebServer/examples/HttpAuthCallbackInline------------
WebServer/examples/HttpBasicAuth:bangbang: +180K:green_heart: -6K:bangbang: +177K:green_heart: -5K:bangbang: +193K:green_heart: -6K----:bangbang: +155K:green_heart: -3K
WebServer/examples/HttpBasicAuthSHA1------------
WebServer/examples/HttpBasicAuthSHA1orBearerToken------------
WebServer/examples/MultiHomedServers:bangbang: +175K:green_heart: -7K:bangbang: +172K:green_heart: -5K:bangbang: +180K:green_heart: -6K----:bangbang: +152K:green_heart: -3K
WebServer/examples/PathArgServer:bangbang: +175K:green_heart: -6K:bangbang: +174K:green_heart: -5K:bangbang: +166K:green_heart: -6K----:bangbang: +149K:green_heart: -3K
WebServer/examples/SDWebServer:bangbang: +177K:green_heart: -6K:bangbang: +174K:green_heart: -5K:bangbang: +184K:green_heart: -6K----:bangbang: +152K:green_heart: -3K
WebServer/examples/SimpleAuthentification:bangbang: +161K:green_heart: -7K:bangbang: +160K:green_heart: -5K:bangbang: +166K:green_heart: -6K----:bangbang: +148K:green_heart: -3K
WebServer/examples/UploadHugeFile:bangbang: +183K:green_heart: -6K:bangbang: +179K:green_heart: -5K:bangbang: +161K:green_heart: -6K----:bangbang: +146K:green_heart: -3K
WebServer/examples/WebServer------------
WebServer/examples/WebUpdate:bangbang: +178K:green_heart: -6K:bangbang: +175K:green_heart: -5K:bangbang: +193K:green_heart: -6K----:bangbang: +154K:green_heart: -3K
WiFi/examples/FTM/FTM_Initiator:bangbang: +159K:green_heart: -7K:bangbang: +158K:green_heart: -5K:bangbang: +176K:green_heart: -6K----:bangbang: +147K:green_heart: -3K
WiFi/examples/FTM/FTM_Responder:bangbang: +159K:green_heart: -6K:bangbang: +159K:green_heart: -5K:bangbang: +176K:green_heart: -6K----:bangbang: +148K:green_heart: -3K
WiFi/examples/SimpleWiFiServer:bangbang: +170K:green_heart: -6K:bangbang: +167K:green_heart: -5K:bangbang: +186K:green_heart: -6K----:bangbang: +148K:green_heart: -3K
WiFi/examples/WPS:bangbang: +159K:green_heart: -6K:bangbang: +158K:green_heart: -5K:bangbang: +175K:green_heart: -6K----:bangbang: +147K:green_heart: -3K
WiFi/examples/WiFiAccessPoint:bangbang: +170K:green_heart: -6K:bangbang: +167K:green_heart: -5K:bangbang: +186K:green_heart: -6K----:bangbang: +148K:green_heart: -3K
WiFi/examples/WiFiBlueToothSwitch:bangbang: +159K:green_heart: -6K--:bangbang: +177K:green_heart: -6K----:bangbang: +120K:green_heart: -3K
WiFi/examples/WiFiClient:bangbang: +161K:green_heart: -6K:bangbang: +160K:green_heart: -5K:bangbang: +177K:green_heart: -6K----:bangbang: +148K:green_heart: -3K
WiFi/examples/WiFiClientBasic:bangbang: +161K:green_heart: -6K:bangbang: +160K:green_heart: -5K:bangbang: +177K:green_heart: -6K----:bangbang: +149K:green_heart: -3K
WiFi/examples/WiFiClientConnect:bangbang: +161K:green_heart: -6K:bangbang: +160K:green_heart: -5K:bangbang: +178K:green_heart: -6K----:bangbang: +148K:green_heart: -3K
WiFi/examples/WiFiClientEnterprise:bangbang: +124K:green_heart: -6K:bangbang: +124K:green_heart: -5K:bangbang: +139K:green_heart: -6K----:bangbang: +109K:green_heart: -3K
WiFi/examples/WiFiClientEvents:bangbang: +159K:green_heart: -6K:bangbang: +158K:green_heart: -5K:bangbang: +176K:green_heart: -6K----:bangbang: +147K:green_heart: -3K
WiFi/examples/WiFiClientStaticIP:bangbang: +160K:green_heart: -6K:bangbang: +159K:green_heart: -5K:bangbang: +176K:green_heart: -6K----:bangbang: +148K:green_heart: -3K
WiFi/examples/WiFiIPv6:bangbang: +160K:green_heart: -6K:bangbang: +160K:green_heart: -5K:bangbang: +177K:green_heart: -6K----:bangbang: +148K:green_heart: -3K
WiFi/examples/WiFiMulti:bangbang: +160K:green_heart: -6K:bangbang: +159K:green_heart: -5K:bangbang: +176K:green_heart: -6K----:bangbang: +148K:green_heart: -3K
WiFi/examples/WiFiMultiAdvanced------------
WiFi/examples/WiFiScan:bangbang: +159K:green_heart: -6K:bangbang: +159K:green_heart: -5K:bangbang: +176K:green_heart: -6K----:bangbang: +148K:green_heart: -3K
WiFi/examples/WiFiScanAsync------------
WiFi/examples/WiFiScanDualAntenna:bangbang: +159K:green_heart: -6K:bangbang: +159K:green_heart: -5K:bangbang: +176K:green_heart: -6K----:bangbang: +148K:green_heart: -3K
WiFi/examples/WiFiSmartConfig:bangbang: +159K:green_heart: -7K:bangbang: +159K:green_heart: -5K:bangbang: +41K:green_heart: -7K----:bangbang: +148K:green_heart: -3K
WiFi/examples/WiFiTelnetToSerial:bangbang: +161K:green_heart: -6K:bangbang: +160K:green_heart: -5K:bangbang: +178K:green_heart: -6K----:bangbang: +148K:green_heart: -3K
WiFi/examples/WiFiUDPClient:bangbang: +160K:green_heart: -6K:bangbang: +159K:green_heart: -5K:bangbang: +177K:green_heart: -6K----:bangbang: +148K:green_heart: -3K
WiFiProv/examples/WiFiProv:bangbang: +177K:green_heart: -6K:bangbang: +172K:green_heart: -5K:bangbang: +198K:green_heart: -6K----:bangbang: +151K:green_heart: -3K
Wire/examples/WireMaster:bangbang: +11K:green_heart: -4K:bangbang: +9K:green_heart: -4K:bangbang: +5K:green_heart: -4K----:warning: +888:green_heart: -4K
Wire/examples/WireScan:bangbang: +12K:green_heart: -4K:bangbang: +11K:green_heart: -4K:bangbang: +7K:green_heart: -4K----:bangbang: +2K:green_heart: -4K
Wire/examples/WireSlave:bangbang: +17K:green_heart: -4K:bangbang: +16K:green_heart: -4K:bangbang: +12K:green_heart: -4K----:bangbang: +8K:green_heart: -4K
BluetoothSerial/examples/DiscoverConnect----------:green_heart: -9K:green_heart: -4K
BluetoothSerial/examples/GetLocalMAC----------:green_heart: -10K:green_heart: -4K
BluetoothSerial/examples/SerialToSerialBT----------:green_heart: -10K:green_heart: -4K
BluetoothSerial/examples/SerialToSerialBTM----------:green_heart: -10K:green_heart: -4K
BluetoothSerial/examples/SerialToSerialBT_Legacy------------
BluetoothSerial/examples/SerialToSerialBT_SSP------------
BluetoothSerial/examples/bt_classic_device_discovery----------:green_heart: -10K:green_heart: -4K
BluetoothSerial/examples/bt_remove_paired_devices----------:bangbang: +15K:green_heart: -3K
ESP32/examples/DeepSleep/SmoothBlink_ULP_Code----------:green_heart: -12K:green_heart: -5K
ESP32/examples/Touch/TouchButton----------:green_heart: -3K:green_heart: -5K
Ethernet/examples/ETH_LAN8720----------:green_heart: -279K:green_heart: -22K
Ethernet/examples/ETH_TLK110----------:green_heart: -279K:green_heart: -22K
+ +
+ +Generated on: Jun-03-2024 07:45:39 +/ [GitHub Action Link](https://github.com/espressif/arduino-esp32/actions/runs/9346243271) diff --git a/_config.yml b/_config.yml new file mode 100644 index 00000000000..c4192631f25 --- /dev/null +++ b/_config.yml @@ -0,0 +1 @@ +theme: jekyll-theme-cayman \ No newline at end of file diff --git a/boards.txt b/boards.txt deleted file mode 100644 index 86b5f48d3d7..00000000000 --- a/boards.txt +++ /dev/null @@ -1,4204 +0,0 @@ -menu.UploadSpeed=Upload Speed -menu.CPUFreq=CPU Frequency -menu.FlashFreq=Flash Frequency -menu.FlashMode=Flash Mode -menu.FlashSize=Flash Size -menu.PartitionScheme=Partition Scheme -menu.DebugLevel=Core Debug Level -menu.PSRAM=PSRAM -menu.Revision=Board Revision - -############################################################## -### DO NOT PUT BOARDS ABOVE THE OFFICIAL ESPRESSIF BOARDS! ### -############################################################## - -esp32.name=ESP32 Dev Module - -esp32.upload.tool=esptool_py -esp32.upload.maximum_size=1310720 -esp32.upload.maximum_data_size=327680 -esp32.upload.wait_for_upload_port=true - -esp32.serial.disableDTR=true -esp32.serial.disableRTS=true - -esp32.build.mcu=esp32 -esp32.build.core=esp32 -esp32.build.variant=esp32 -esp32.build.board=ESP32_DEV - -esp32.build.f_cpu=240000000L -esp32.build.flash_size=4MB -esp32.build.flash_freq=40m -esp32.build.flash_mode=dio -esp32.build.boot=dio -esp32.build.partitions=default -esp32.build.defines= - -esp32.menu.PSRAM.disabled=Disabled -esp32.menu.PSRAM.disabled.build.defines= -esp32.menu.PSRAM.enabled=Enabled -esp32.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue - -esp32.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) -esp32.menu.PartitionScheme.default.build.partitions=default -esp32.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) -esp32.menu.PartitionScheme.defaultffat.build.partitions=default_ffat -esp32.menu.PartitionScheme.default_8MB=8M Flash (3MB APP/1.5MB FAT) -esp32.menu.PartitionScheme.default_8MB.build.partitions=default_8MB -esp32.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 -esp32.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS) -esp32.menu.PartitionScheme.minimal.build.partitions=minimal -esp32.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS) -esp32.menu.PartitionScheme.no_ota.build.partitions=no_ota -esp32.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -esp32.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS) -esp32.menu.PartitionScheme.noota_3g.build.partitions=noota_3g -esp32.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576 -esp32.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS) -esp32.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat -esp32.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152 -esp32.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS) -esp32.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat -esp32.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576 -esp32.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS) -esp32.menu.PartitionScheme.huge_app.build.partitions=huge_app -esp32.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 -esp32.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) -esp32.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -esp32.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 -esp32.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FAT) -esp32.menu.PartitionScheme.fatflash.build.partitions=ffat -esp32.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 -esp32.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9MB FATFS) -esp32.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB -esp32.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 - -esp32.menu.CPUFreq.240=240MHz (WiFi/BT) -esp32.menu.CPUFreq.240.build.f_cpu=240000000L -esp32.menu.CPUFreq.160=160MHz (WiFi/BT) -esp32.menu.CPUFreq.160.build.f_cpu=160000000L -esp32.menu.CPUFreq.80=80MHz (WiFi/BT) -esp32.menu.CPUFreq.80.build.f_cpu=80000000L -esp32.menu.CPUFreq.40=40MHz (40MHz XTAL) -esp32.menu.CPUFreq.40.build.f_cpu=40000000L -esp32.menu.CPUFreq.26=26MHz (26MHz XTAL) -esp32.menu.CPUFreq.26.build.f_cpu=26000000L -esp32.menu.CPUFreq.20=20MHz (40MHz XTAL) -esp32.menu.CPUFreq.20.build.f_cpu=20000000L -esp32.menu.CPUFreq.13=13MHz (26MHz XTAL) -esp32.menu.CPUFreq.13.build.f_cpu=13000000L -esp32.menu.CPUFreq.10=10MHz (40MHz XTAL) -esp32.menu.CPUFreq.10.build.f_cpu=10000000L - -esp32.menu.FlashMode.qio=QIO -esp32.menu.FlashMode.qio.build.flash_mode=dio -esp32.menu.FlashMode.qio.build.boot=qio -esp32.menu.FlashMode.dio=DIO -esp32.menu.FlashMode.dio.build.flash_mode=dio -esp32.menu.FlashMode.dio.build.boot=dio -esp32.menu.FlashMode.qout=QOUT -esp32.menu.FlashMode.qout.build.flash_mode=dout -esp32.menu.FlashMode.qout.build.boot=qout -esp32.menu.FlashMode.dout=DOUT -esp32.menu.FlashMode.dout.build.flash_mode=dout -esp32.menu.FlashMode.dout.build.boot=dout - -esp32.menu.FlashFreq.80=80MHz -esp32.menu.FlashFreq.80.build.flash_freq=80m -esp32.menu.FlashFreq.40=40MHz -esp32.menu.FlashFreq.40.build.flash_freq=40m - -esp32.menu.FlashSize.4M=4MB (32Mb) -esp32.menu.FlashSize.4M.build.flash_size=4MB -esp32.menu.FlashSize.8M=8MB (64Mb) -esp32.menu.FlashSize.8M.build.flash_size=8MB -esp32.menu.FlashSize.8M.build.partitions=default_8MB -esp32.menu.FlashSize.2M=2MB (16Mb) -esp32.menu.FlashSize.2M.build.flash_size=2MB -esp32.menu.FlashSize.2M.build.partitions=minimal -esp32.menu.FlashSize.16M=16MB (128Mb) -esp32.menu.FlashSize.16M.build.flash_size=16MB - -esp32.menu.UploadSpeed.921600=921600 -esp32.menu.UploadSpeed.921600.upload.speed=921600 -esp32.menu.UploadSpeed.115200=115200 -esp32.menu.UploadSpeed.115200.upload.speed=115200 -esp32.menu.UploadSpeed.256000.windows=256000 -esp32.menu.UploadSpeed.256000.upload.speed=256000 -esp32.menu.UploadSpeed.230400.windows.upload.speed=256000 -esp32.menu.UploadSpeed.230400=230400 -esp32.menu.UploadSpeed.230400.upload.speed=230400 -esp32.menu.UploadSpeed.460800.linux=460800 -esp32.menu.UploadSpeed.460800.macosx=460800 -esp32.menu.UploadSpeed.460800.upload.speed=460800 -esp32.menu.UploadSpeed.512000.windows=512000 -esp32.menu.UploadSpeed.512000.upload.speed=512000 - -esp32.menu.DebugLevel.none=None -esp32.menu.DebugLevel.none.build.code_debug=0 -esp32.menu.DebugLevel.error=Error -esp32.menu.DebugLevel.error.build.code_debug=1 -esp32.menu.DebugLevel.warn=Warn -esp32.menu.DebugLevel.warn.build.code_debug=2 -esp32.menu.DebugLevel.info=Info -esp32.menu.DebugLevel.info.build.code_debug=3 -esp32.menu.DebugLevel.debug=Debug -esp32.menu.DebugLevel.debug.build.code_debug=4 -esp32.menu.DebugLevel.verbose=Verbose -esp32.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - -esp32wrover.name=ESP32 Wrover Module - -esp32wrover.upload.tool=esptool_py -esp32wrover.upload.maximum_size=1310720 -esp32wrover.upload.maximum_data_size=327680 -esp32wrover.upload.wait_for_upload_port=true - -esp32wrover.serial.disableDTR=true -esp32wrover.serial.disableRTS=true - -esp32wrover.build.mcu=esp32 -esp32wrover.build.core=esp32 -esp32wrover.build.variant=esp32 -esp32wrover.build.board=ESP32_DEV - -esp32wrover.build.f_cpu=240000000L -esp32wrover.build.flash_size=4MB -esp32wrover.build.flash_freq=40m -esp32wrover.build.flash_mode=dio -esp32wrover.build.boot=dio -esp32wrover.build.partitions=default -esp32wrover.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue - -esp32wrover.menu.PartitionScheme.default=Default -esp32wrover.menu.PartitionScheme.default.build.partitions=default -esp32wrover.menu.PartitionScheme.minimal=Minimal (2MB FLASH) -esp32wrover.menu.PartitionScheme.minimal.build.partitions=minimal -esp32wrover.menu.PartitionScheme.no_ota=No OTA (Large APP) -esp32wrover.menu.PartitionScheme.no_ota.build.partitions=no_ota -esp32wrover.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -esp32wrover.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA) -esp32wrover.menu.PartitionScheme.huge_app.build.partitions=huge_app -esp32wrover.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 -esp32wrover.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -esp32wrover.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -esp32wrover.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 - -esp32wrover.menu.FlashMode.qio=QIO -esp32wrover.menu.FlashMode.qio.build.flash_mode=dio -esp32wrover.menu.FlashMode.qio.build.boot=qio -esp32wrover.menu.FlashMode.dio=DIO -esp32wrover.menu.FlashMode.dio.build.flash_mode=dio -esp32wrover.menu.FlashMode.dio.build.boot=dio -esp32wrover.menu.FlashMode.qout=QOUT -esp32wrover.menu.FlashMode.qout.build.flash_mode=dout -esp32wrover.menu.FlashMode.qout.build.boot=qout -esp32wrover.menu.FlashMode.dout=DOUT -esp32wrover.menu.FlashMode.dout.build.flash_mode=dout -esp32wrover.menu.FlashMode.dout.build.boot=dout - -esp32wrover.menu.FlashFreq.80=80MHz -esp32wrover.menu.FlashFreq.80.build.flash_freq=80m -esp32wrover.menu.FlashFreq.40=40MHz -esp32wrover.menu.FlashFreq.40.build.flash_freq=40m - -esp32wrover.menu.UploadSpeed.921600=921600 -esp32wrover.menu.UploadSpeed.921600.upload.speed=921600 -esp32wrover.menu.UploadSpeed.115200=115200 -esp32wrover.menu.UploadSpeed.115200.upload.speed=115200 -esp32wrover.menu.UploadSpeed.256000.windows=256000 -esp32wrover.menu.UploadSpeed.256000.upload.speed=256000 -esp32wrover.menu.UploadSpeed.230400.windows.upload.speed=256000 -esp32wrover.menu.UploadSpeed.230400=230400 -esp32wrover.menu.UploadSpeed.230400.upload.speed=230400 -esp32wrover.menu.UploadSpeed.460800.linux=460800 -esp32wrover.menu.UploadSpeed.460800.macosx=460800 -esp32wrover.menu.UploadSpeed.460800.upload.speed=460800 -esp32wrover.menu.UploadSpeed.512000.windows=512000 -esp32wrover.menu.UploadSpeed.512000.upload.speed=512000 - -esp32wrover.menu.DebugLevel.none=None -esp32wrover.menu.DebugLevel.none.build.code_debug=0 -esp32wrover.menu.DebugLevel.error=Error -esp32wrover.menu.DebugLevel.error.build.code_debug=1 -esp32wrover.menu.DebugLevel.warn=Warn -esp32wrover.menu.DebugLevel.warn.build.code_debug=2 -esp32wrover.menu.DebugLevel.info=Info -esp32wrover.menu.DebugLevel.info.build.code_debug=3 -esp32wrover.menu.DebugLevel.debug=Debug -esp32wrover.menu.DebugLevel.debug.build.code_debug=4 -esp32wrover.menu.DebugLevel.verbose=Verbose -esp32wrover.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## -pico32.name=ESP32 Pico Kit - -pico32.upload.tool=esptool_py -pico32.upload.maximum_size=1310720 -pico32.upload.maximum_data_size=327680 -pico32.upload.wait_for_upload_port=true - -pico32.serial.disableDTR=true -pico32.serial.disableRTS=true - -pico32.build.mcu=esp32 -pico32.build.core=esp32 -pico32.build.variant=pico32 -pico32.build.board=ESP32_PICO - -pico32.build.f_cpu=240000000L -pico32.build.flash_size=4MB -pico32.build.flash_freq=80m -pico32.build.flash_mode=dio -pico32.build.boot=dio -pico32.build.partitions=default -pico32.build.defines= - -pico32.menu.PartitionScheme.default=Default -pico32.menu.PartitionScheme.default.build.partitions=default -pico32.menu.PartitionScheme.no_ota=No OTA (Large APP) -pico32.menu.PartitionScheme.no_ota.build.partitions=no_ota -pico32.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -pico32.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -pico32.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -pico32.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 - -pico32.menu.UploadSpeed.921600=921600 -pico32.menu.UploadSpeed.921600.upload.speed=921600 -pico32.menu.UploadSpeed.115200=115200 -pico32.menu.UploadSpeed.115200.upload.speed=115200 -pico32.menu.UploadSpeed.256000.windows=256000 -pico32.menu.UploadSpeed.256000.upload.speed=256000 -pico32.menu.UploadSpeed.230400.windows.upload.speed=256000 -pico32.menu.UploadSpeed.230400=230400 -pico32.menu.UploadSpeed.230400.upload.speed=230400 -pico32.menu.UploadSpeed.460800.linux=460800 -pico32.menu.UploadSpeed.460800.macosx=460800 -pico32.menu.UploadSpeed.460800.upload.speed=460800 -pico32.menu.UploadSpeed.512000.windows=512000 -pico32.menu.UploadSpeed.512000.upload.speed=512000 - -pico32.menu.DebugLevel.none=None -pico32.menu.DebugLevel.none.build.code_debug=0 -pico32.menu.DebugLevel.error=Error -pico32.menu.DebugLevel.error.build.code_debug=1 -pico32.menu.DebugLevel.warn=Warn -pico32.menu.DebugLevel.warn.build.code_debug=2 -pico32.menu.DebugLevel.info=Info -pico32.menu.DebugLevel.info.build.code_debug=3 -pico32.menu.DebugLevel.debug=Debug -pico32.menu.DebugLevel.debug.build.code_debug=4 -pico32.menu.DebugLevel.verbose=Verbose -pico32.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - -tinypico.name=TinyPICO - -tinypico.upload.tool=esptool_py -tinypico.upload.maximum_size=1310720 -tinypico.upload.maximum_data_size=327680 -tinypico.upload.wait_for_upload_port=true - -tinypico.serial.disableDTR=true -tinypico.serial.disableRTS=true - -tinypico.build.mcu=esp32 -tinypico.build.core=esp32 -tinypico.build.variant=pico32 -tinypico.build.board=ESP32_PICO - -tinypico.build.f_cpu=240000000L -tinypico.build.flash_size=4MB -tinypico.build.flash_freq=80m -tinypico.build.flash_mode=dio -tinypico.build.boot=dio -tinypico.build.partitions=default -tinypico.build.defines= - -tinypico.menu.UploadSpeed.921600=921600 -tinypico.menu.UploadSpeed.921600.upload.speed=921600 -tinypico.menu.UploadSpeed.115200=115200 -tinypico.menu.UploadSpeed.115200.upload.speed=115200 -tinypico.menu.UploadSpeed.256000.windows=256000 -tinypico.menu.UploadSpeed.256000.upload.speed=256000 -tinypico.menu.UploadSpeed.230400.windows.upload.speed=256000 -tinypico.menu.UploadSpeed.230400=230400 -tinypico.menu.UploadSpeed.230400.upload.speed=230400 -tinypico.menu.UploadSpeed.460800.linux=460800 -tinypico.menu.UploadSpeed.460800.macosx=460800 -tinypico.menu.UploadSpeed.460800.upload.speed=460800 -tinypico.menu.UploadSpeed.512000.windows=512000 -tinypico.menu.UploadSpeed.512000.upload.speed=512000 - -tinypico.menu.FlashMode.qio=QIO -tinypico.menu.FlashMode.qio.build.flash_mode=dio -tinypico.menu.FlashMode.qio.build.boot=qio -tinypico.menu.FlashMode.dio=DIO -tinypico.menu.FlashMode.dio.build.flash_mode=dio -tinypico.menu.FlashMode.dio.build.boot=dio - -tinypico.menu.FlashFreq.80=80MHz -tinypico.menu.FlashFreq.80.build.flash_freq=80m -tinypico.menu.FlashFreq.40=40MHz -tinypico.menu.FlashFreq.40.build.flash_freq=40m - -tinypico.menu.PSRAM.enabled=Enabled -tinypico.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -tinypico.menu.PSRAM.disabled=Disabled -tinypico.menu.PSRAM.disabled.build.defines= - -tinypico.menu.DebugLevel.none=None -tinypico.menu.DebugLevel.none.build.code_debug=0 -tinypico.menu.DebugLevel.error=Error -tinypico.menu.DebugLevel.error.build.code_debug=1 -tinypico.menu.DebugLevel.warn=Warn -tinypico.menu.DebugLevel.warn.build.code_debug=2 -tinypico.menu.DebugLevel.info=Info -tinypico.menu.DebugLevel.info.build.code_debug=3 -tinypico.menu.DebugLevel.debug=Debug -tinypico.menu.DebugLevel.debug.build.code_debug=4 -tinypico.menu.DebugLevel.verbose=Verbose -tinypico.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## -magicbit.name=MagicBit - -magicbit.upload.tool=esptool_py -magicbit.upload.maximum_size=1310720 -magicbit.upload.maximum_data_size=327680 -magicbit.upload.wait_for_upload_port=true - -magicbit.serial.disableDTR=true -magicbit.serial.disableRTS=true - -magicbit.build.mcu=esp32 -magicbit.build.core=esp32 -magicbit.build.variant=magicbit -magicbit.build.board=ESP32_DEV - -magicbit.build.f_cpu=240000000L -magicbit.build.flash_size=4MB -magicbit.build.flash_freq=40m -magicbit.build.flash_mode=dio -magicbit.build.boot=dio -magicbit.build.partitions=default - -magicbit.menu.CPUFreq.240=240MHz (WiFi/BT) -magicbit.menu.CPUFreq.240.build.f_cpu=240000000L -magicbit.menu.CPUFreq.160=160MHz (WiFi/BT) -magicbit.menu.CPUFreq.160.build.f_cpu=160000000L -magicbit.menu.CPUFreq.80=80MHz (WiFi/BT) -magicbit.menu.CPUFreq.80.build.f_cpu=80000000L -magicbit.menu.CPUFreq.40=40MHz (40MHz XTAL) - -magicbit.menu.UploadSpeed.921600=921600 -magicbit.menu.UploadSpeed.921600.upload.speed=921600 -magicbit.menu.UploadSpeed.115200=115200 -magicbit.menu.UploadSpeed.115200.upload.speed=115200 -############################################################## -turta_iot_node.name=Turta IoT Node - -turta_iot_node.upload.tool=esptool_py -turta_iot_node.upload.maximum_size=1310720 -turta_iot_node.upload.maximum_data_size=327680 -turta_iot_node.upload.wait_for_upload_port=true - -turta_iot_node.serial.disableDTR=true -turta_iot_node.serial.disableRTS=true - -turta_iot_node.build.mcu=esp32 -turta_iot_node.build.core=esp32 -turta_iot_node.build.variant=pico32 -turta_iot_node.build.board=ESP32_PICO - -turta_iot_node.build.f_cpu=240000000L -turta_iot_node.build.flash_size=4MB -turta_iot_node.build.flash_freq=80m -turta_iot_node.build.flash_mode=dio -turta_iot_node.build.boot=dio -turta_iot_node.build.partitions=default -turta_iot_node.build.defines= - -turta_iot_node.menu.UploadSpeed.921600=921600 -turta_iot_node.menu.UploadSpeed.921600.upload.speed=921600 -turta_iot_node.menu.UploadSpeed.115200=115200 -turta_iot_node.menu.UploadSpeed.115200.upload.speed=115200 - -turta_iot_node.menu.DebugLevel.none=None -turta_iot_node.menu.DebugLevel.none.build.code_debug=0 -turta_iot_node.menu.DebugLevel.error=Error -turta_iot_node.menu.DebugLevel.error.build.code_debug=1 -turta_iot_node.menu.DebugLevel.warn=Warn -turta_iot_node.menu.DebugLevel.warn.build.code_debug=2 -turta_iot_node.menu.DebugLevel.info=Info -turta_iot_node.menu.DebugLevel.info.build.code_debug=3 -turta_iot_node.menu.DebugLevel.debug=Debug -turta_iot_node.menu.DebugLevel.debug.build.code_debug=4 -turta_iot_node.menu.DebugLevel.verbose=Verbose -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.wait_for_upload_port=true - -ttgo-lora32-v1.serial.disableDTR=true -ttgo-lora32-v1.serial.disableRTS=true - -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-t1.name=TTGO T1 - -ttgo-t1.upload.tool=esptool_py -ttgo-t1.upload.maximum_size=1310720 -ttgo-t1.upload.maximum_data_size=327680 -ttgo-t1.upload.wait_for_upload_port=true - -ttgo-t1.serial.disableDTR=true -ttgo-t1.serial.disableRTS=true - -ttgo-t1.build.mcu=esp32 -ttgo-t1.build.core=esp32 -ttgo-t1.build.variant=ttgo-t1 -ttgo-t1.build.board=TTGO_T1 - -ttgo-t1.build.f_cpu=240000000L -ttgo-t1.build.flash_size=4MB -ttgo-t1.build.flash_freq=40m -ttgo-t1.build.flash_mode=dio -ttgo-t1.build.boot=dio -ttgo-t1.build.partitions=default -ttgo-t1.build.defines= - -ttgo-t1.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) -ttgo-t1.menu.PartitionScheme.default.build.partitions=default -ttgo-t1.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) -ttgo-t1.menu.PartitionScheme.defaultffat.build.partitions=default_ffat -ttgo-t1.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS) -ttgo-t1.menu.PartitionScheme.minimal.build.partitions=minimal -ttgo-t1.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS) -ttgo-t1.menu.PartitionScheme.no_ota.build.partitions=no_ota -ttgo-t1.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -ttgo-t1.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS) -ttgo-t1.menu.PartitionScheme.noota_3g.build.partitions=noota_3g -ttgo-t1.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576 -ttgo-t1.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS) -ttgo-t1.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat -ttgo-t1.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152 -ttgo-t1.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS) -ttgo-t1.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat -ttgo-t1.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576 -ttgo-t1.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS) -ttgo-t1.menu.PartitionScheme.huge_app.build.partitions=huge_app -ttgo-t1.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 -ttgo-t1.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) -ttgo-t1.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -ttgo-t1.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 - -ttgo-t1.menu.CPUFreq.240=240MHz (WiFi/BT) -ttgo-t1.menu.CPUFreq.240.build.f_cpu=240000000L -ttgo-t1.menu.CPUFreq.160=160MHz (WiFi/BT) -ttgo-t1.menu.CPUFreq.160.build.f_cpu=160000000L -ttgo-t1.menu.CPUFreq.80=80MHz (WiFi/BT) -ttgo-t1.menu.CPUFreq.80.build.f_cpu=80000000L -ttgo-t1.menu.CPUFreq.40=40MHz (40MHz XTAL) -ttgo-t1.menu.CPUFreq.40.build.f_cpu=40000000L -ttgo-t1.menu.CPUFreq.26=26MHz (26MHz XTAL) -ttgo-t1.menu.CPUFreq.26.build.f_cpu=26000000L -ttgo-t1.menu.CPUFreq.20=20MHz (40MHz XTAL) -ttgo-t1.menu.CPUFreq.20.build.f_cpu=20000000L -ttgo-t1.menu.CPUFreq.13=13MHz (26MHz XTAL) -ttgo-t1.menu.CPUFreq.13.build.f_cpu=13000000L -ttgo-t1.menu.CPUFreq.10=10MHz (40MHz XTAL) -ttgo-t1.menu.CPUFreq.10.build.f_cpu=10000000L - -ttgo-t1.menu.FlashMode.qio=QIO -ttgo-t1.menu.FlashMode.qio.build.flash_mode=dio -ttgo-t1.menu.FlashMode.qio.build.boot=qio -ttgo-t1.menu.FlashMode.dio=DIO -ttgo-t1.menu.FlashMode.dio.build.flash_mode=dio -ttgo-t1.menu.FlashMode.dio.build.boot=dio -ttgo-t1.menu.FlashMode.qout=QOUT -ttgo-t1.menu.FlashMode.qout.build.flash_mode=dout -ttgo-t1.menu.FlashMode.qout.build.boot=qout -ttgo-t1.menu.FlashMode.dout=DOUT -ttgo-t1.menu.FlashMode.dout.build.flash_mode=dout -ttgo-t1.menu.FlashMode.dout.build.boot=dout - -ttgo-t1.menu.FlashFreq.80=80MHz -ttgo-t1.menu.FlashFreq.80.build.flash_freq=80m -ttgo-t1.menu.FlashFreq.40=40MHz -ttgo-t1.menu.FlashFreq.40.build.flash_freq=40m - -ttgo-t1.menu.FlashSize.4M=4MB (32Mb) -ttgo-t1.menu.FlashSize.4M.build.flash_size=4MB -ttgo-t1.menu.FlashSize.2M=2MB (16Mb) -ttgo-t1.menu.FlashSize.2M.build.flash_size=2MB -ttgo-t1.menu.FlashSize.2M.build.partitions=minimal -ttgo-t1.menu.FlashSize.16M=16MB (128Mb) -ttgo-t1.menu.FlashSize.16M.build.flash_size=16MB -ttgo-t1.menu.FlashSize.16M.build.partitions=ffat - -ttgo-t1.menu.UploadSpeed.921600=921600 -ttgo-t1.menu.UploadSpeed.921600.upload.speed=921600 -ttgo-t1.menu.UploadSpeed.115200=115200 -ttgo-t1.menu.UploadSpeed.115200.upload.speed=115200 -ttgo-t1.menu.UploadSpeed.256000.windows=256000 -ttgo-t1.menu.UploadSpeed.256000.upload.speed=256000 -ttgo-t1.menu.UploadSpeed.230400.windows.upload.speed=256000 -ttgo-t1.menu.UploadSpeed.230400=230400 -ttgo-t1.menu.UploadSpeed.230400.upload.speed=230400 -ttgo-t1.menu.UploadSpeed.460800.linux=460800 -ttgo-t1.menu.UploadSpeed.460800.macosx=460800 -ttgo-t1.menu.UploadSpeed.460800.upload.speed=460800 -ttgo-t1.menu.UploadSpeed.512000.windows=512000 -ttgo-t1.menu.UploadSpeed.512000.upload.speed=512000 - -ttgo-t1.menu.DebugLevel.none=None -ttgo-t1.menu.DebugLevel.none.build.code_debug=0 -ttgo-t1.menu.DebugLevel.error=Error -ttgo-t1.menu.DebugLevel.error.build.code_debug=1 -ttgo-t1.menu.DebugLevel.warn=Warn -ttgo-t1.menu.DebugLevel.warn.build.code_debug=2 -ttgo-t1.menu.DebugLevel.info=Info -ttgo-t1.menu.DebugLevel.info.build.code_debug=3 -ttgo-t1.menu.DebugLevel.debug=Debug -ttgo-t1.menu.DebugLevel.debug.build.code_debug=4 -ttgo-t1.menu.DebugLevel.verbose=Verbose -ttgo-t1.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - -cw02.name=XinaBox CW02 - -cw02.upload.tool=esptool_py -cw02.upload.maximum_size=1310720 -cw02.upload.maximum_data_size=294912 -cw02.upload.wait_for_upload_port=true - -cw02.serial.disableDTR=true -cw02.serial.disableRTS=true - -cw02.build.mcu=esp32 -cw02.build.core=esp32 -cw02.build.variant=xinabox -cw02.build.board=ESP32_DEV - -cw02.build.f_cpu=240000000L -cw02.build.flash_size=4MB -cw02.build.flash_freq=40m -cw02.build.flash_mode=dio -cw02.build.boot=dio -cw02.build.partitions=default - -cw02.menu.FlashMode.qio=QIO -cw02.menu.FlashMode.qio.build.flash_mode=dio -cw02.menu.FlashMode.qio.build.boot=qio -cw02.menu.FlashMode.dio=DIO -cw02.menu.FlashMode.dio.build.flash_mode=dio -cw02.menu.FlashMode.dio.build.boot=dio -cw02.menu.FlashMode.qout=QOUT -cw02.menu.FlashMode.qout.build.flash_mode=dout -cw02.menu.FlashMode.qout.build.boot=qout -cw02.menu.FlashMode.dout=DOUT -cw02.menu.FlashMode.dout.build.flash_mode=dout -cw02.menu.FlashMode.dout.build.boot=dout - -cw02.menu.FlashFreq.80=80MHz -cw02.menu.FlashFreq.80.build.flash_freq=80m -cw02.menu.FlashFreq.40=40MHz -cw02.menu.FlashFreq.40.build.flash_freq=40m - -cw02.menu.FlashSize.4M=4MB (32Mb) -cw02.menu.FlashSize.4M.build.flash_size=4MB -cw02.menu.FlashSize.2M=2MB (16Mb) -cw02.menu.FlashSize.2M.build.flash_size=2MB -cw02.menu.FlashSize.2M.build.partitions=minimal - -cw02.menu.UploadSpeed.921600=921600 -cw02.menu.UploadSpeed.921600.upload.speed=921600 -cw02.menu.UploadSpeed.115200=115200 -cw02.menu.UploadSpeed.115200.upload.speed=115200 -cw02.menu.UploadSpeed.256000.windows=256000 -cw02.menu.UploadSpeed.256000.upload.speed=256000 -cw02.menu.UploadSpeed.230400.windows.upload.speed=256000 -cw02.menu.UploadSpeed.230400=230400 -cw02.menu.UploadSpeed.230400.upload.speed=230400 -cw02.menu.UploadSpeed.460800.linux=460800 -cw02.menu.UploadSpeed.460800.macosx=460800 -cw02.menu.UploadSpeed.460800.upload.speed=460800 -cw02.menu.UploadSpeed.512000.windows=512000 -cw02.menu.UploadSpeed.512000.upload.speed=512000 - -cw02.menu.DebugLevel.none=None -cw02.menu.DebugLevel.none.build.code_debug=0 -cw02.menu.DebugLevel.error=Error -cw02.menu.DebugLevel.error.build.code_debug=1 -cw02.menu.DebugLevel.warn=Warn -cw02.menu.DebugLevel.warn.build.code_debug=2 -cw02.menu.DebugLevel.info=Info -cw02.menu.DebugLevel.info.build.code_debug=3 -cw02.menu.DebugLevel.debug=Debug -cw02.menu.DebugLevel.debug.build.code_debug=4 -cw02.menu.DebugLevel.verbose=Verbose -cw02.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - -esp32thing.name=SparkFun ESP32 Thing - -esp32thing.upload.tool=esptool_py -esp32thing.upload.maximum_size=1310720 -esp32thing.upload.maximum_data_size=327680 -esp32thing.upload.wait_for_upload_port=true - -esp32thing.serial.disableDTR=true -esp32thing.serial.disableRTS=true - -esp32thing.build.mcu=esp32 -esp32thing.build.core=esp32 -esp32thing.build.variant=esp32thing -esp32thing.build.board=ESP32_THING - -esp32thing.build.f_cpu=240000000L -esp32thing.build.flash_mode=dio -esp32thing.build.flash_size=4MB -esp32thing.build.boot=dio -esp32thing.build.partitions=default -esp32thing.build.defines= - -esp32thing.menu.FlashFreq.80=80MHz -esp32thing.menu.FlashFreq.80.build.flash_freq=80m -esp32thing.menu.FlashFreq.40=40MHz -esp32thing.menu.FlashFreq.40.build.flash_freq=40m - -esp32thing.menu.PartitionScheme.default=Default -esp32thing.menu.PartitionScheme.default.build.partitions=default -esp32thing.menu.PartitionScheme.no_ota=No OTA (Large APP) -esp32thing.menu.PartitionScheme.no_ota.build.partitions=no_ota -esp32thing.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -esp32thing.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -esp32thing.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -esp32thing.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 - -esp32thing.menu.UploadSpeed.921600=921600 -esp32thing.menu.UploadSpeed.921600.upload.speed=921600 -esp32thing.menu.UploadSpeed.115200=115200 -esp32thing.menu.UploadSpeed.115200.upload.speed=115200 -esp32thing.menu.UploadSpeed.256000.windows=256000 -esp32thing.menu.UploadSpeed.256000.upload.speed=256000 -esp32thing.menu.UploadSpeed.230400.windows.upload.speed=256000 -esp32thing.menu.UploadSpeed.230400=230400 -esp32thing.menu.UploadSpeed.230400.upload.speed=230400 -esp32thing.menu.UploadSpeed.460800.linux=460800 -esp32thing.menu.UploadSpeed.460800.macosx=460800 -esp32thing.menu.UploadSpeed.460800.upload.speed=460800 -esp32thing.menu.UploadSpeed.512000.windows=512000 -esp32thing.menu.UploadSpeed.512000.upload.speed=512000 - -esp32thing.menu.DebugLevel.none=None -esp32thing.menu.DebugLevel.none.build.code_debug=0 -esp32thing.menu.DebugLevel.error=Error -esp32thing.menu.DebugLevel.error.build.code_debug=1 -esp32thing.menu.DebugLevel.warn=Warn -esp32thing.menu.DebugLevel.warn.build.code_debug=2 -esp32thing.menu.DebugLevel.info=Info -esp32thing.menu.DebugLevel.info.build.code_debug=3 -esp32thing.menu.DebugLevel.debug=Debug -esp32thing.menu.DebugLevel.debug.build.code_debug=4 -esp32thing.menu.DebugLevel.verbose=Verbose -esp32thing.menu.DebugLevel.verbose.build.code_debug=5 - - -############################################################## - -nina_w10.name=u-blox NINA-W10 series (ESP32) - -nina_w10.upload.tool=esptool_py -nina_w10.upload.maximum_size=1310720 -nina_w10.upload.maximum_data_size=327680 -nina_w10.upload.wait_for_upload_port=true - -nina_w10.serial.disableDTR=true -nina_w10.serial.disableRTS=true - -nina_w10.build.mcu=esp32 -nina_w10.build.core=esp32 -nina_w10.build.variant=nina_w10 -nina_w10.build.board=UBLOX_NINA_W10 -nina_w10.build.f_cpu=240000000L -nina_w10.build.boot=dio -nina_w10.build.partitions=minimal -nina_w10.build.flash_mode=dio -nina_w10.build.flash_size=2MB -nina_w10.build.flash_freq=40m -nina_w10.build.defines= - -nina_w10.menu.UploadSpeed.921600=921600 -nina_w10.menu.UploadSpeed.921600.upload.speed=921600 -nina_w10.menu.UploadSpeed.115200=115200 -nina_w10.menu.UploadSpeed.115200.upload.speed=115200 -nina_w10.menu.UploadSpeed.256000.windows=256000 -nina_w10.menu.UploadSpeed.256000.upload.speed=256000 -nina_w10.menu.UploadSpeed.230400.windows.upload.speed=256000 -nina_w10.menu.UploadSpeed.230400=230400 -nina_w10.menu.UploadSpeed.230400.upload.speed=230400 -nina_w10.menu.UploadSpeed.460800.linux=460800 -nina_w10.menu.UploadSpeed.460800.macosx=460800 -nina_w10.menu.UploadSpeed.460800.upload.speed=460800 -nina_w10.menu.UploadSpeed.512000.windows=512000 -nina_w10.menu.UploadSpeed.512000.upload.speed=512000 - -############################################################## - -widora-air.name=Widora AIR - -widora-air.upload.tool=esptool_py -widora-air.upload.maximum_size=1310720 -widora-air.upload.maximum_data_size=327680 -widora-air.upload.wait_for_upload_port=true - -widora-air.serial.disableDTR=true -widora-air.serial.disableRTS=true - -widora-air.build.mcu=esp32 -widora-air.build.core=esp32 -widora-air.build.variant=widora-air -widora-air.build.board=WIDORA_AIR - -widora-air.build.f_cpu=240000000L -widora-air.build.flash_mode=dio -widora-air.build.flash_size=16MB -widora-air.build.boot=dio -widora-air.build.partitions=default -widora-air.build.defines= - -widora-air.menu.FlashFreq.80=80MHz -widora-air.menu.FlashFreq.80.build.flash_freq=80m -widora-air.menu.FlashFreq.40=40MHz -widora-air.menu.FlashFreq.40.build.flash_freq=40m - -widora-air.menu.UploadSpeed.921600=921600 -widora-air.menu.UploadSpeed.921600.upload.speed=921600 -widora-air.menu.UploadSpeed.115200=115200 -widora-air.menu.UploadSpeed.115200.upload.speed=115200 -widora-air.menu.UploadSpeed.256000.windows=256000 -widora-air.menu.UploadSpeed.256000.upload.speed=256000 -widora-air.menu.UploadSpeed.230400.windows.upload.speed=256000 -widora-air.menu.UploadSpeed.230400=230400 -widora-air.menu.UploadSpeed.230400.upload.speed=230400 -widora-air.menu.UploadSpeed.460800.linux=460800 -widora-air.menu.UploadSpeed.460800.macosx=460800 -widora-air.menu.UploadSpeed.460800.upload.speed=460800 -widora-air.menu.UploadSpeed.512000.windows=512000 -widora-air.menu.UploadSpeed.512000.upload.speed=512000 - -############################################################## - -esp320.name=Electronic SweetPeas - ESP320 - -esp320.upload.tool=esptool_py -esp320.upload.maximum_size=1310720 -esp320.upload.maximum_data_size=327680 -esp320.upload.wait_for_upload_port=true - -esp320.serial.disableDTR=true -esp320.serial.disableRTS=true - -esp320.build.mcu=esp32 -esp320.build.core=esp32 -esp320.build.variant=esp320 -esp320.build.board=ESP320 - -esp320.build.f_cpu=240000000L -esp320.build.flash_mode=qio -esp320.build.flash_size=4MB -esp320.build.boot=dio -esp320.build.partitions=default -esp320.build.defines= - -esp320.menu.FlashFreq.80=80MHz -esp320.menu.FlashFreq.80.build.flash_freq=80m -esp320.menu.FlashFreq.40=40MHz -esp320.menu.FlashFreq.40.build.flash_freq=40m - -esp320.menu.UploadSpeed.921600=921600 -esp320.menu.UploadSpeed.921600.upload.speed=921600 -esp320.menu.UploadSpeed.115200=115200 -esp320.menu.UploadSpeed.115200.upload.speed=115200 -esp320.menu.UploadSpeed.256000.windows=256000 -esp320.menu.UploadSpeed.256000.upload.speed=256000 -esp320.menu.UploadSpeed.230400.windows.upload.speed=256000 -esp320.menu.UploadSpeed.230400=230400 -esp320.menu.UploadSpeed.230400.upload.speed=230400 -esp320.menu.UploadSpeed.460800.linux=460800 -esp320.menu.UploadSpeed.460800.macosx=460800 -esp320.menu.UploadSpeed.460800.upload.speed=460800 -esp320.menu.UploadSpeed.512000.windows=512000 -esp320.menu.UploadSpeed.512000.upload.speed=512000 - -############################################################## - -nano32.name=Nano32 - -nano32.upload.tool=esptool_py -nano32.upload.maximum_size=1310720 -nano32.upload.maximum_data_size=327680 -nano32.upload.wait_for_upload_port=true - -nano32.serial.disableDTR=true -nano32.serial.disableRTS=true - -nano32.build.mcu=esp32 -nano32.build.core=esp32 -nano32.build.variant=nano32 -nano32.build.board=NANO32 - -nano32.build.f_cpu=240000000L -nano32.build.flash_mode=dio -nano32.build.flash_size=4MB -nano32.build.boot=dio -nano32.build.partitions=default -nano32.build.defines= - -nano32.menu.FlashFreq.80=80MHz -nano32.menu.FlashFreq.80.build.flash_freq=80m -nano32.menu.FlashFreq.40=40MHz -nano32.menu.FlashFreq.40.build.flash_freq=40m - -nano32.menu.UploadSpeed.921600=921600 -nano32.menu.UploadSpeed.921600.upload.speed=921600 -nano32.menu.UploadSpeed.115200=115200 -nano32.menu.UploadSpeed.115200.upload.speed=115200 -nano32.menu.UploadSpeed.256000.windows=256000 -nano32.menu.UploadSpeed.256000.upload.speed=256000 -nano32.menu.UploadSpeed.230400.windows.upload.speed=256000 -nano32.menu.UploadSpeed.230400=230400 -nano32.menu.UploadSpeed.230400.upload.speed=230400 -nano32.menu.UploadSpeed.460800.linux=460800 -nano32.menu.UploadSpeed.460800.macosx=460800 -nano32.menu.UploadSpeed.460800.upload.speed=460800 -nano32.menu.UploadSpeed.512000.windows=512000 -nano32.menu.UploadSpeed.512000.upload.speed=512000 - -############################################################## - -d32.name=LOLIN D32 - -d32.upload.tool=esptool_py -d32.upload.maximum_size=1310720 -d32.upload.maximum_data_size=327680 -d32.upload.wait_for_upload_port=true - -d32.serial.disableDTR=true -d32.serial.disableRTS=true - -d32.build.mcu=esp32 -d32.build.core=esp32 -d32.build.variant=d32 -d32.build.board=LOLIN_D32 - -d32.build.f_cpu=240000000L -d32.build.flash_size=4MB -d32.build.flash_freq=40m -d32.build.flash_mode=dio -d32.build.boot=dio -d32.build.partitions=default -d32.build.defines= - -d32.menu.PartitionScheme.default=Default -d32.menu.PartitionScheme.default.build.partitions=default -d32.menu.PartitionScheme.minimal=Minimal (2MB FLASH) -d32.menu.PartitionScheme.minimal.build.partitions=minimal -d32.menu.PartitionScheme.no_ota=No OTA (Large APP) -d32.menu.PartitionScheme.no_ota.build.partitions=no_ota -d32.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -d32.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -d32.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -d32.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 - - - -d32.menu.FlashFreq.80=80MHz -d32.menu.FlashFreq.80.build.flash_freq=80m -d32.menu.FlashFreq.40=40MHz -d32.menu.FlashFreq.40.build.flash_freq=40m - - - -d32.menu.UploadSpeed.921600=921600 -d32.menu.UploadSpeed.921600.upload.speed=921600 -d32.menu.UploadSpeed.115200=115200 -d32.menu.UploadSpeed.115200.upload.speed=115200 -d32.menu.UploadSpeed.256000.windows=256000 -d32.menu.UploadSpeed.256000.upload.speed=256000 -d32.menu.UploadSpeed.230400.windows.upload.speed=256000 -d32.menu.UploadSpeed.230400=230400 -d32.menu.UploadSpeed.230400.upload.speed=230400 -d32.menu.UploadSpeed.460800.linux=460800 -d32.menu.UploadSpeed.460800.macosx=460800 -d32.menu.UploadSpeed.460800.upload.speed=460800 -d32.menu.UploadSpeed.512000.windows=512000 -d32.menu.UploadSpeed.512000.upload.speed=512000 - -d32.menu.DebugLevel.none=None -d32.menu.DebugLevel.none.build.code_debug=0 -d32.menu.DebugLevel.error=Error -d32.menu.DebugLevel.error.build.code_debug=1 -d32.menu.DebugLevel.warn=Warn -d32.menu.DebugLevel.warn.build.code_debug=2 -d32.menu.DebugLevel.info=Info -d32.menu.DebugLevel.info.build.code_debug=3 -d32.menu.DebugLevel.debug=Debug -d32.menu.DebugLevel.debug.build.code_debug=4 -d32.menu.DebugLevel.verbose=Verbose -d32.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - -d32_pro.name=LOLIN D32 PRO - -d32_pro.upload.tool=esptool_py -d32_pro.upload.maximum_size=1310720 -d32_pro.upload.maximum_data_size=327680 -d32_pro.upload.wait_for_upload_port=true - -d32_pro.serial.disableDTR=true -d32_pro.serial.disableRTS=true - -d32_pro.build.mcu=esp32 -d32_pro.build.core=esp32 -d32_pro.build.variant=d32_pro -d32_pro.build.board=LOLIN_D32_PRO - -d32_pro.build.f_cpu=240000000L -d32_pro.build.flash_size=4MB -d32_pro.build.flash_freq=40m -d32_pro.build.flash_mode=dio -d32_pro.build.boot=dio -d32_pro.build.partitions=default -d32_pro.build.defines= - -d32_pro.menu.PSRAM.disabled=Disabled -d32_pro.menu.PSRAM.disabled.build.defines= -d32_pro.menu.PSRAM.enabled=Enabled -d32_pro.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue - -d32_pro.menu.PartitionScheme.default=Default -d32_pro.menu.PartitionScheme.default.build.partitions=default -d32_pro.menu.PartitionScheme.minimal=Minimal (2MB FLASH) -d32_pro.menu.PartitionScheme.minimal.build.partitions=minimal -d32_pro.menu.PartitionScheme.no_ota=No OTA (Large APP) -d32_pro.menu.PartitionScheme.no_ota.build.partitions=no_ota -d32_pro.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -d32_pro.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -d32_pro.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -d32_pro.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 - - - -d32_pro.menu.FlashFreq.80=80MHz -d32_pro.menu.FlashFreq.80.build.flash_freq=80m -d32_pro.menu.FlashFreq.40=40MHz -d32_pro.menu.FlashFreq.40.build.flash_freq=40m - - - -d32_pro.menu.UploadSpeed.921600=921600 -d32_pro.menu.UploadSpeed.921600.upload.speed=921600 -d32_pro.menu.UploadSpeed.115200=115200 -d32_pro.menu.UploadSpeed.115200.upload.speed=115200 -d32_pro.menu.UploadSpeed.256000.windows=256000 -d32_pro.menu.UploadSpeed.256000.upload.speed=256000 -d32_pro.menu.UploadSpeed.230400.windows.upload.speed=256000 -d32_pro.menu.UploadSpeed.230400=230400 -d32_pro.menu.UploadSpeed.230400.upload.speed=230400 -d32_pro.menu.UploadSpeed.460800.linux=460800 -d32_pro.menu.UploadSpeed.460800.macosx=460800 -d32_pro.menu.UploadSpeed.460800.upload.speed=460800 -d32_pro.menu.UploadSpeed.512000.windows=512000 -d32_pro.menu.UploadSpeed.512000.upload.speed=512000 - -d32_pro.menu.DebugLevel.none=None -d32_pro.menu.DebugLevel.none.build.code_debug=0 -d32_pro.menu.DebugLevel.error=Error -d32_pro.menu.DebugLevel.error.build.code_debug=1 -d32_pro.menu.DebugLevel.warn=Warn -d32_pro.menu.DebugLevel.warn.build.code_debug=2 -d32_pro.menu.DebugLevel.info=Info -d32_pro.menu.DebugLevel.info.build.code_debug=3 -d32_pro.menu.DebugLevel.debug=Debug -d32_pro.menu.DebugLevel.debug.build.code_debug=4 -d32_pro.menu.DebugLevel.verbose=Verbose -d32_pro.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - -lolin32.name=WEMOS LOLIN32 - -lolin32.upload.tool=esptool_py -lolin32.upload.maximum_size=1310720 -lolin32.upload.maximum_data_size=327680 -lolin32.upload.wait_for_upload_port=true - -lolin32.serial.disableDTR=true -lolin32.serial.disableRTS=true - -lolin32.build.mcu=esp32 -lolin32.build.core=esp32 -lolin32.build.variant=lolin32 -lolin32.build.board=LOLIN32 - -lolin32.build.f_cpu=240000000L -lolin32.build.flash_mode=dio -lolin32.build.flash_size=4MB -lolin32.build.boot=dio -lolin32.build.partitions=default -lolin32.build.defines= - -lolin32.menu.FlashFreq.80=80MHz -lolin32.menu.FlashFreq.80.build.flash_freq=80m -lolin32.menu.FlashFreq.40=40MHz -lolin32.menu.FlashFreq.40.build.flash_freq=40m - -lolin32.menu.PartitionScheme.default=Default -lolin32.menu.PartitionScheme.default.build.partitions=default -lolin32.menu.PartitionScheme.no_ota=No OTA (Large APP) -lolin32.menu.PartitionScheme.no_ota.build.partitions=no_ota -lolin32.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -lolin32.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -lolin32.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -lolin32.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 - -lolin32.menu.CPUFreq.240=240MHz (WiFi/BT) -lolin32.menu.CPUFreq.240.build.f_cpu=240000000L -lolin32.menu.CPUFreq.160=160MHz (WiFi/BT) -lolin32.menu.CPUFreq.160.build.f_cpu=160000000L -lolin32.menu.CPUFreq.80=80MHz (WiFi/BT) -lolin32.menu.CPUFreq.80.build.f_cpu=80000000L -lolin32.menu.CPUFreq.40=40MHz (40MHz XTAL) -lolin32.menu.CPUFreq.40.build.f_cpu=40000000L -lolin32.menu.CPUFreq.26=26MHz (26MHz XTAL) -lolin32.menu.CPUFreq.26.build.f_cpu=26000000L -lolin32.menu.CPUFreq.20=20MHz (40MHz XTAL) -lolin32.menu.CPUFreq.20.build.f_cpu=20000000L -lolin32.menu.CPUFreq.13=13MHz (26MHz XTAL) -lolin32.menu.CPUFreq.13.build.f_cpu=13000000L -lolin32.menu.CPUFreq.10=10MHz (40MHz XTAL) -lolin32.menu.CPUFreq.10.build.f_cpu=10000000L - -lolin32.menu.UploadSpeed.921600=921600 -lolin32.menu.UploadSpeed.921600.upload.speed=921600 -lolin32.menu.UploadSpeed.115200=115200 -lolin32.menu.UploadSpeed.115200.upload.speed=115200 -lolin32.menu.UploadSpeed.256000.windows=256000 -lolin32.menu.UploadSpeed.256000.upload.speed=256000 -lolin32.menu.UploadSpeed.230400.windows.upload.speed=256000 -lolin32.menu.UploadSpeed.230400=230400 -lolin32.menu.UploadSpeed.230400.upload.speed=230400 -lolin32.menu.UploadSpeed.460800.linux=460800 -lolin32.menu.UploadSpeed.460800.macosx=460800 -lolin32.menu.UploadSpeed.460800.upload.speed=460800 -lolin32.menu.UploadSpeed.512000.windows=512000 -lolin32.menu.UploadSpeed.512000.upload.speed=512000 - -############################################################## - -pocket_32.name=Dongsen Tech Pocket 32 - -pocket_32.upload.tool=esptool_py -pocket_32.upload.maximum_size=1310720 -pocket_32.upload.maximum_data_size=327680 -pocket_32.upload.wait_for_upload_port=true - -pocket_32.serial.disableDTR=true -pocket_32.serial.disableRTS=true - -pocket_32.build.mcu=esp32 -pocket_32.build.core=esp32 -pocket_32.build.variant=pocket_32 -pocket_32.build.board=Pocket32 - -pocket_32.build.f_cpu=240000000L -pocket_32.build.flash_mode=dio -pocket_32.build.flash_size=4MB -pocket_32.build.boot=dio -pocket_32.build.partitions=default -pocket_32.build.defines= - -pocket_32.menu.FlashFreq.80=80MHz -pocket_32.menu.FlashFreq.80.build.flash_freq=80m -pocket_32.menu.FlashFreq.40=40MHz -pocket_32.menu.FlashFreq.40.build.flash_freq=40m - -pocket_32.menu.UploadSpeed.921600=921600 -pocket_32.menu.UploadSpeed.921600.upload.speed=921600 -pocket_32.menu.UploadSpeed.115200=115200 -pocket_32.menu.UploadSpeed.115200.upload.speed=115200 -pocket_32.menu.UploadSpeed.256000.windows=256000 -pocket_32.menu.UploadSpeed.256000.upload.speed=256000 -pocket_32.menu.UploadSpeed.230400.windows.upload.speed=256000 -pocket_32.menu.UploadSpeed.230400=230400 -pocket_32.menu.UploadSpeed.230400.upload.speed=230400 -pocket_32.menu.UploadSpeed.460800.linux=460800 -pocket_32.menu.UploadSpeed.460800.macosx=460800 -pocket_32.menu.UploadSpeed.460800.upload.speed=460800 -pocket_32.menu.UploadSpeed.512000.windows=512000 -pocket_32.menu.UploadSpeed.512000.upload.speed=512000 - -############################################################## - -WeMosBat.name=WeMos WiFi&Bluetooth Battery - -WeMosBat.upload.tool=esptool_py -WeMosBat.upload.maximum_size=1310720 -WeMosBat.upload.maximum_data_size=327680 -WeMosBat.upload.wait_for_upload_port=true - -WeMosBat.serial.disableDTR=true -WeMosBat.serial.disableRTS=true - -WeMosBat.build.mcu=esp32 -WeMosBat.build.core=esp32 -WeMosBat.build.variant=pocket_32 -WeMosBat.build.board=Pocket32 - -WeMosBat.build.f_cpu=240000000L -WeMosBat.build.flash_mode=dio -WeMosBat.build.flash_size=4MB -WeMosBat.build.boot=dio -WeMosBat.build.partitions=default -WeMosBat.build.defines= - -WeMosBat.menu.FlashFreq.80=80MHz -WeMosBat.menu.FlashFreq.80.build.flash_freq=80m -WeMosBat.menu.FlashFreq.40=40MHz -WeMosBat.menu.FlashFreq.40.build.flash_freq=40m - -WeMosBat.menu.UploadSpeed.921600=921600 -WeMosBat.menu.UploadSpeed.921600.upload.speed=921600 -WeMosBat.menu.UploadSpeed.115200=115200 -WeMosBat.menu.UploadSpeed.115200.upload.speed=115200 -WeMosBat.menu.UploadSpeed.256000.windows=256000 -WeMosBat.menu.UploadSpeed.256000.upload.speed=256000 -WeMosBat.menu.UploadSpeed.230400.windows.upload.speed=256000 -WeMosBat.menu.UploadSpeed.230400=230400 -WeMosBat.menu.UploadSpeed.230400.upload.speed=230400 -WeMosBat.menu.UploadSpeed.460800.linux=460800 -WeMosBat.menu.UploadSpeed.460800.macosx=460800 -WeMosBat.menu.UploadSpeed.460800.upload.speed=460800 -WeMosBat.menu.UploadSpeed.512000.windows=512000 -WeMosBat.menu.UploadSpeed.512000.upload.speed=512000 - -WeMosBat.menu.DebugLevel.none=None -WeMosBat.menu.DebugLevel.none.build.code_debug=0 -WeMosBat.menu.DebugLevel.error=Error -WeMosBat.menu.DebugLevel.error.build.code_debug=1 -WeMosBat.menu.DebugLevel.warn=Warn -WeMosBat.menu.DebugLevel.warn.build.code_debug=2 -WeMosBat.menu.DebugLevel.info=Info -WeMosBat.menu.DebugLevel.info.build.code_debug=3 -WeMosBat.menu.DebugLevel.debug=Debug -WeMosBat.menu.DebugLevel.debug.build.code_debug=4 -WeMosBat.menu.DebugLevel.verbose=Verbose -WeMosBat.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - -espea32.name=ESPea32 - -espea32.upload.tool=esptool_py -espea32.upload.maximum_size=1310720 -espea32.upload.maximum_data_size=327680 -espea32.upload.wait_for_upload_port=true - -espea32.serial.disableDTR=true -espea32.serial.disableRTS=true - -espea32.build.mcu=esp32 -espea32.build.core=esp32 -espea32.build.variant=espea32 -espea32.build.board=ESPea32 - -espea32.build.f_cpu=240000000L -espea32.build.flash_mode=dio -espea32.build.flash_size=4MB -espea32.build.boot=dio -espea32.build.partitions=default -espea32.build.defines= - -espea32.menu.FlashFreq.80=80MHz -espea32.menu.FlashFreq.80.build.flash_freq=80m -espea32.menu.FlashFreq.40=40MHz -espea32.menu.FlashFreq.40.build.flash_freq=40m - -espea32.menu.UploadSpeed.921600=921600 -espea32.menu.UploadSpeed.921600.upload.speed=921600 -espea32.menu.UploadSpeed.115200=115200 -espea32.menu.UploadSpeed.115200.upload.speed=115200 -espea32.menu.UploadSpeed.256000.windows=256000 -espea32.menu.UploadSpeed.256000.upload.speed=256000 -espea32.menu.UploadSpeed.230400.windows.upload.speed=256000 -espea32.menu.UploadSpeed.230400=230400 -espea32.menu.UploadSpeed.230400.upload.speed=230400 -espea32.menu.UploadSpeed.460800.linux=460800 -espea32.menu.UploadSpeed.460800.macosx=460800 -espea32.menu.UploadSpeed.460800.upload.speed=460800 -espea32.menu.UploadSpeed.512000.windows=512000 -espea32.menu.UploadSpeed.512000.upload.speed=512000 - -############################################################## - -quantum.name=Noduino Quantum - -quantum.upload.tool=esptool_py -quantum.upload.maximum_size=1310720 -quantum.upload.maximum_data_size=327680 -quantum.upload.wait_for_upload_port=true - -quantum.serial.disableDTR=true -quantum.serial.disableRTS=true - -quantum.build.mcu=esp32 -quantum.build.core=esp32 -quantum.build.variant=quantum -quantum.build.board=QUANTUM - -quantum.build.f_cpu=240000000L -quantum.build.flash_mode=qio -quantum.build.flash_size=16MB -quantum.build.boot=dio -quantum.build.partitions=default -quantum.build.defines= - -quantum.menu.FlashFreq.80=80MHz -quantum.menu.FlashFreq.80.build.flash_freq=80m -quantum.menu.FlashFreq.40=40MHz -quantum.menu.FlashFreq.40.build.flash_freq=40m - -quantum.menu.UploadSpeed.921600=921600 -quantum.menu.UploadSpeed.921600.upload.speed=921600 -quantum.menu.UploadSpeed.115200=115200 -quantum.menu.UploadSpeed.115200.upload.speed=115200 -quantum.menu.UploadSpeed.256000.windows=256000 -quantum.menu.UploadSpeed.256000.upload.speed=256000 -quantum.menu.UploadSpeed.230400.windows.upload.speed=256000 -quantum.menu.UploadSpeed.230400=230400 -quantum.menu.UploadSpeed.230400.upload.speed=230400 -quantum.menu.UploadSpeed.460800.linux=460800 -quantum.menu.UploadSpeed.460800.macosx=460800 -quantum.menu.UploadSpeed.460800.upload.speed=460800 -quantum.menu.UploadSpeed.512000.windows=512000 -quantum.menu.UploadSpeed.512000.upload.speed=512000 - -############################################################## - -node32s.name=Node32s - -node32s.upload.tool=esptool_py -node32s.upload.maximum_size=1310720 -node32s.upload.maximum_data_size=327680 -node32s.upload.wait_for_upload_port=true - -node32s.serial.disableDTR=true -node32s.serial.disableRTS=true - -node32s.build.mcu=esp32 -node32s.build.core=esp32 -node32s.build.variant=node32s -node32s.build.board=Node32s - -node32s.build.f_cpu=240000000L -node32s.build.flash_mode=dio -node32s.build.flash_size=4MB -node32s.build.boot=dio -node32s.build.partitions=default -node32s.build.defines= - -node32s.menu.FlashFreq.80=80MHz -node32s.menu.FlashFreq.80.build.flash_freq=80m -node32s.menu.FlashFreq.40=40MHz -node32s.menu.FlashFreq.40.build.flash_freq=40m - -node32s.menu.UploadSpeed.921600=921600 -node32s.menu.UploadSpeed.921600.upload.speed=921600 -node32s.menu.UploadSpeed.115200=115200 -node32s.menu.UploadSpeed.115200.upload.speed=115200 -node32s.menu.UploadSpeed.256000.windows=256000 -node32s.menu.UploadSpeed.256000.upload.speed=256000 -node32s.menu.UploadSpeed.230400.windows.upload.speed=256000 -node32s.menu.UploadSpeed.230400=230400 -node32s.menu.UploadSpeed.230400.upload.speed=230400 -node32s.menu.UploadSpeed.460800.linux=460800 -node32s.menu.UploadSpeed.460800.macosx=460800 -node32s.menu.UploadSpeed.460800.upload.speed=460800 -node32s.menu.UploadSpeed.512000.windows=512000 -node32s.menu.UploadSpeed.512000.upload.speed=512000 - -############################################################## - -hornbill32dev.name=Hornbill ESP32 Dev - -hornbill32dev.upload.tool=esptool_py -hornbill32dev.upload.maximum_size=1310720 -hornbill32dev.upload.maximum_data_size=327680 -hornbill32dev.upload.wait_for_upload_port=true - -hornbill32dev.serial.disableDTR=true -hornbill32dev.serial.disableRTS=true - -hornbill32dev.build.mcu=esp32 -hornbill32dev.build.core=esp32 -hornbill32dev.build.variant=hornbill32dev -hornbill32dev.build.board=HORNBILL_ESP32_DEV - -hornbill32dev.build.f_cpu=240000000L -hornbill32dev.build.flash_mode=dio -hornbill32dev.build.flash_size=4MB -hornbill32dev.build.boot=dio -hornbill32dev.build.partitions=default -hornbill32dev.build.defines= - -hornbill32dev.menu.FlashFreq.80=80MHz -hornbill32dev.menu.FlashFreq.80.build.flash_freq=80m -hornbill32dev.menu.FlashFreq.40=40MHz -hornbill32dev.menu.FlashFreq.40.build.flash_freq=40m - -hornbill32dev.menu.UploadSpeed.921600=921600 -hornbill32dev.menu.UploadSpeed.921600.upload.speed=921600 -hornbill32dev.menu.UploadSpeed.115200=115200 -hornbill32dev.menu.UploadSpeed.115200.upload.speed=115200 -hornbill32dev.menu.UploadSpeed.256000.windows=256000 -hornbill32dev.menu.UploadSpeed.256000.upload.speed=256000 -hornbill32dev.menu.UploadSpeed.230400.windows.upload.speed=256000 -hornbill32dev.menu.UploadSpeed.230400=230400 -hornbill32dev.menu.UploadSpeed.230400.upload.speed=230400 -hornbill32dev.menu.UploadSpeed.460800.linux=460800 -hornbill32dev.menu.UploadSpeed.460800.macosx=460800 -hornbill32dev.menu.UploadSpeed.460800.upload.speed=460800 -hornbill32dev.menu.UploadSpeed.512000.windows=512000 -hornbill32dev.menu.UploadSpeed.512000.upload.speed=512000 - -############################################################## - -hornbill32minima.name=Hornbill ESP32 Minima - -hornbill32minima.upload.tool=esptool_py -hornbill32minima.upload.maximum_size=1310720 -hornbill32minima.upload.maximum_data_size=327680 -hornbill32minima.upload.wait_for_upload_port=true - -hornbill32minima.serial.disableDTR=true -hornbill32minima.serial.disableRTS=true - -hornbill32minima.build.mcu=esp32 -hornbill32minima.build.core=esp32 -hornbill32minima.build.variant=hornbill32minima -hornbill32minima.build.board=HORNBILL_ESP32_MINIMA -hornbill32minima.build.f_cpu=240000000L -hornbill32minima.build.flash_mode=dio -hornbill32minima.build.flash_size=4MB -hornbill32minima.build.boot=dio -hornbill32minima.build.partitions=default -hornbill32minima.build.defines= - -hornbill32minima.menu.FlashFreq.80=80MHz -hornbill32minima.menu.FlashFreq.80.build.flash_freq=80m -hornbill32minima.menu.FlashFreq.40=40MHz -hornbill32minima.menu.FlashFreq.40.build.flash_freq=40m - -hornbill32minima.menu.UploadSpeed.921600=921600 -hornbill32minima.menu.UploadSpeed.921600.upload.speed=921600 -hornbill32minima.menu.UploadSpeed.115200=115200 -hornbill32minima.menu.UploadSpeed.115200.upload.speed=115200 -hornbill32minima.menu.UploadSpeed.256000.windows=256000 -hornbill32minima.menu.UploadSpeed.256000.upload.speed=256000 -hornbill32minima.menu.UploadSpeed.230400.windows.upload.speed=256000 -hornbill32minima.menu.UploadSpeed.230400=230400 -hornbill32minima.menu.UploadSpeed.230400.upload.speed=230400 -hornbill32minima.menu.UploadSpeed.460800.linux=460800 -hornbill32minima.menu.UploadSpeed.460800.macosx=460800 -hornbill32minima.menu.UploadSpeed.460800.upload.speed=460800 -hornbill32minima.menu.UploadSpeed.512000.windows=512000 -hornbill32minima.menu.UploadSpeed.512000.upload.speed=512000 - -############################################################## - -firebeetle32.name=FireBeetle-ESP32 - -firebeetle32.upload.tool=esptool_py -firebeetle32.upload.maximum_size=1310720 -firebeetle32.upload.maximum_data_size=327680 -firebeetle32.upload.wait_for_upload_port=true - -firebeetle32.serial.disableDTR=true -firebeetle32.serial.disableRTS=true - -firebeetle32.build.mcu=esp32 -firebeetle32.build.core=esp32 -firebeetle32.build.variant=firebeetle32 -firebeetle32.build.board=ESP32_DEV - -firebeetle32.build.f_cpu=240000000L -firebeetle32.build.flash_mode=dio -firebeetle32.build.flash_size=4MB -firebeetle32.build.boot=dio -firebeetle32.build.partitions=default -firebeetle32.build.defines= - -firebeetle32.menu.FlashFreq.80=80MHz -firebeetle32.menu.FlashFreq.80.build.flash_freq=80m -firebeetle32.menu.FlashFreq.40=40MHz -firebeetle32.menu.FlashFreq.40.build.flash_freq=40m - -firebeetle32.menu.UploadSpeed.921600=921600 -firebeetle32.menu.UploadSpeed.921600.upload.speed=921600 -firebeetle32.menu.UploadSpeed.115200=115200 -firebeetle32.menu.UploadSpeed.115200.upload.speed=115200 -firebeetle32.menu.UploadSpeed.256000.windows=256000 -firebeetle32.menu.UploadSpeed.256000.upload.speed=256000 -firebeetle32.menu.UploadSpeed.230400.windows.upload.speed=256000 -firebeetle32.menu.UploadSpeed.230400=230400 -firebeetle32.menu.UploadSpeed.230400.upload.speed=230400 -firebeetle32.menu.UploadSpeed.460800.linux=460800 -firebeetle32.menu.UploadSpeed.460800.macosx=460800 -firebeetle32.menu.UploadSpeed.460800.upload.speed=460800 -firebeetle32.menu.UploadSpeed.512000.windows=512000 -firebeetle32.menu.UploadSpeed.512000.upload.speed=512000 - -############################################################## - -intorobot-fig.name=IntoRobot Fig - -intorobot-fig.upload.tool=esptool_py -intorobot-fig.upload.maximum_size=1310720 -intorobot-fig.upload.maximum_data_size=327680 -intorobot-fig.upload.wait_for_upload_port=true - -intorobot-fig.serial.disableDTR=true -intorobot-fig.serial.disableRTS=true - -intorobot-fig.build.mcu=esp32 -intorobot-fig.build.core=esp32 -intorobot-fig.build.variant=intorobot-fig -intorobot-fig.build.board=INTOROBOT_ESP32_DEV - -intorobot-fig.build.f_cpu=240000000L -intorobot-fig.build.flash_mode=dio -intorobot-fig.build.flash_size=4MB -intorobot-fig.build.boot=dio -intorobot-fig.build.partitions=default -intorobot-fig.build.defines= - -intorobot-fig.menu.FlashFreq.80=80MHz -intorobot-fig.menu.FlashFreq.80.build.flash_freq=80m -intorobot-fig.menu.FlashFreq.40=40MHz -intorobot-fig.menu.FlashFreq.40.build.flash_freq=40m - -intorobot-fig.menu.UploadSpeed.921600=921600 -intorobot-fig.menu.UploadSpeed.921600.upload.speed=921600 -intorobot-fig.menu.UploadSpeed.115200=115200 -intorobot-fig.menu.UploadSpeed.115200.upload.speed=115200 -intorobot-fig.menu.UploadSpeed.256000.windows=256000 -intorobot-fig.menu.UploadSpeed.256000.upload.speed=256000 -intorobot-fig.menu.UploadSpeed.230400.windows.upload.speed=256000 -intorobot-fig.menu.UploadSpeed.230400=230400 -intorobot-fig.menu.UploadSpeed.230400.upload.speed=230400 -intorobot-fig.menu.UploadSpeed.460800.linux=460800 -intorobot-fig.menu.UploadSpeed.460800.macosx=460800 -intorobot-fig.menu.UploadSpeed.460800.upload.speed=460800 -intorobot-fig.menu.UploadSpeed.512000.windows=512000 -intorobot-fig.menu.UploadSpeed.512000.upload.speed=512000 - -############################################################## - -onehorse32dev.name=Onehorse ESP32 Dev Module - -onehorse32dev.upload.tool=esptool_py -onehorse32dev.upload.maximum_size=1310720 -onehorse32dev.upload.maximum_data_size=327680 -onehorse32dev.upload.wait_for_upload_port=true - -onehorse32dev.serial.disableDTR=true -onehorse32dev.serial.disableRTS=true - -onehorse32dev.build.mcu=esp32 -onehorse32dev.build.core=esp32 -onehorse32dev.build.variant=onehorse32dev -onehorse32dev.build.board=ONEHORSE_ESP32_DEV - -onehorse32dev.build.f_cpu=240000000L -onehorse32dev.build.flash_mode=dout -onehorse32dev.build.flash_size=4MB -onehorse32dev.build.boot=dio -onehorse32dev.build.partitions=default -onehorse32dev.build.defines= - -onehorse32dev.menu.FlashFreq.80=80MHz -onehorse32dev.menu.FlashFreq.80.build.flash_freq=80m -onehorse32dev.menu.FlashFreq.40=40MHz -onehorse32dev.menu.FlashFreq.40.build.flash_freq=40m - -onehorse32dev.menu.UploadSpeed.921600=921600 -onehorse32dev.menu.UploadSpeed.921600.upload.speed=921600 -onehorse32dev.menu.UploadSpeed.115200=115200 -onehorse32dev.menu.UploadSpeed.115200.upload.speed=115200 -onehorse32dev.menu.UploadSpeed.256000.windows=256000 -onehorse32dev.menu.UploadSpeed.256000.upload.speed=256000 -onehorse32dev.menu.UploadSpeed.230400.windows.upload.speed=256000 -onehorse32dev.menu.UploadSpeed.230400=230400 -onehorse32dev.menu.UploadSpeed.230400.upload.speed=230400 -onehorse32dev.menu.UploadSpeed.460800.linux=460800 -onehorse32dev.menu.UploadSpeed.460800.macosx=460800 -onehorse32dev.menu.UploadSpeed.460800.upload.speed=460800 -onehorse32dev.menu.UploadSpeed.512000.windows=512000 -onehorse32dev.menu.UploadSpeed.512000.upload.speed=512000 - -############################################################## - -featheresp32.name=Adafruit ESP32 Feather - -featheresp32.upload.tool=esptool_py -featheresp32.upload.maximum_size=1310720 -featheresp32.upload.maximum_data_size=327680 -featheresp32.upload.wait_for_upload_port=true - -featheresp32.serial.disableDTR=true -featheresp32.serial.disableRTS=true - -featheresp32.build.mcu=esp32 -featheresp32.build.core=esp32 -featheresp32.build.variant=feather_esp32 -featheresp32.build.board=FEATHER_ESP32 - -featheresp32.build.f_cpu=240000000L -featheresp32.build.flash_mode=dio -featheresp32.build.flash_size=4MB -featheresp32.build.boot=dio -featheresp32.build.partitions=default -featheresp32.build.defines= - -featheresp32.menu.FlashFreq.80=80MHz -featheresp32.menu.FlashFreq.80.build.flash_freq=80m -featheresp32.menu.FlashFreq.40=40MHz -featheresp32.menu.FlashFreq.40.build.flash_freq=40m - -featheresp32.menu.UploadSpeed.921600=921600 -featheresp32.menu.UploadSpeed.921600.upload.speed=921600 -featheresp32.menu.UploadSpeed.115200=115200 -featheresp32.menu.UploadSpeed.115200.upload.speed=115200 -featheresp32.menu.UploadSpeed.256000.windows=256000 -featheresp32.menu.UploadSpeed.256000.upload.speed=256000 -featheresp32.menu.UploadSpeed.230400.windows.upload.speed=256000 -featheresp32.menu.UploadSpeed.230400=230400 -featheresp32.menu.UploadSpeed.230400.upload.speed=230400 -featheresp32.menu.UploadSpeed.460800.linux=460800 -featheresp32.menu.UploadSpeed.460800.macosx=460800 -featheresp32.menu.UploadSpeed.460800.upload.speed=460800 -featheresp32.menu.UploadSpeed.512000.windows=512000 -featheresp32.menu.UploadSpeed.512000.upload.speed=512000 - -featheresp32.menu.DebugLevel.none=None -featheresp32.menu.DebugLevel.none.build.code_debug=0 -featheresp32.menu.DebugLevel.error=Error -featheresp32.menu.DebugLevel.error.build.code_debug=1 -featheresp32.menu.DebugLevel.warn=Warn -featheresp32.menu.DebugLevel.warn.build.code_debug=2 -featheresp32.menu.DebugLevel.info=Info -featheresp32.menu.DebugLevel.info.build.code_debug=3 -featheresp32.menu.DebugLevel.debug=Debug -featheresp32.menu.DebugLevel.debug.build.code_debug=4 -featheresp32.menu.DebugLevel.verbose=Verbose -featheresp32.menu.DebugLevel.verbose.build.code_debug=5 - -featheresp32.menu.PartitionScheme.default=Default -featheresp32.menu.PartitionScheme.default.build.partitions=default -featheresp32.menu.PartitionScheme.no_ota=No OTA (Large APP) -featheresp32.menu.PartitionScheme.no_ota.build.partitions=no_ota -featheresp32.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -featheresp32.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -featheresp32.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -featheresp32.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 - -############################################################## - -nodemcu-32s.name=NodeMCU-32S - -nodemcu-32s.upload.tool=esptool_py -nodemcu-32s.upload.maximum_size=1310720 -nodemcu-32s.upload.maximum_data_size=327680 -nodemcu-32s.upload.wait_for_upload_port=true - -nodemcu-32s.serial.disableDTR=true -nodemcu-32s.serial.disableRTS=true - -nodemcu-32s.build.mcu=esp32 -nodemcu-32s.build.core=esp32 -nodemcu-32s.build.variant=nodemcu-32s -nodemcu-32s.build.board=NodeMCU_32S - -nodemcu-32s.build.f_cpu=240000000L -nodemcu-32s.build.flash_mode=dio -nodemcu-32s.build.flash_size=4MB -nodemcu-32s.build.boot=dio -nodemcu-32s.build.partitions=default -nodemcu-32s.build.defines= - -nodemcu-32s.menu.FlashFreq.80=80MHz -nodemcu-32s.menu.FlashFreq.80.build.flash_freq=80m -nodemcu-32s.menu.FlashFreq.40=40MHz -nodemcu-32s.menu.FlashFreq.40.build.flash_freq=40m - -nodemcu-32s.menu.UploadSpeed.921600=921600 -nodemcu-32s.menu.UploadSpeed.921600.upload.speed=921600 -nodemcu-32s.menu.UploadSpeed.115200=115200 -nodemcu-32s.menu.UploadSpeed.115200.upload.speed=115200 -nodemcu-32s.menu.UploadSpeed.256000.windows=256000 -nodemcu-32s.menu.UploadSpeed.256000.upload.speed=256000 -nodemcu-32s.menu.UploadSpeed.230400.windows.upload.speed=256000 -nodemcu-32s.menu.UploadSpeed.230400=230400 -nodemcu-32s.menu.UploadSpeed.230400.upload.speed=230400 -nodemcu-32s.menu.UploadSpeed.460800.linux=460800 -nodemcu-32s.menu.UploadSpeed.460800.macosx=460800 -nodemcu-32s.menu.UploadSpeed.460800.upload.speed=460800 -nodemcu-32s.menu.UploadSpeed.512000.windows=512000 -nodemcu-32s.menu.UploadSpeed.512000.upload.speed=512000 - -############################################################## - -mhetesp32devkit.name=MH ET LIVE ESP32DevKIT - -mhetesp32devkit.upload.tool=esptool_py -mhetesp32devkit.upload.maximum_size=1310720 -mhetesp32devkit.upload.maximum_data_size=327680 -mhetesp32devkit.upload.wait_for_upload_port=true - -mhetesp32devkit.serial.disableDTR=true -mhetesp32devkit.serial.disableRTS=true - -mhetesp32devkit.build.mcu=esp32 -mhetesp32devkit.build.core=esp32 -mhetesp32devkit.build.variant=mhetesp32devkit -mhetesp32devkit.build.board=MH_ET_LIVE_ESP32DEVKIT - -mhetesp32devkit.build.f_cpu=240000000L -mhetesp32devkit.build.flash_mode=dio -mhetesp32devkit.build.flash_size=4MB -mhetesp32devkit.build.boot=dio -mhetesp32devkit.build.partitions=default -mhetesp32devkit.build.defines= - -mhetesp32devkit.menu.FlashFreq.80=80MHz -mhetesp32devkit.menu.FlashFreq.80.build.flash_freq=80m -mhetesp32devkit.menu.FlashFreq.40=40MHz -mhetesp32devkit.menu.FlashFreq.40.build.flash_freq=40m - -mhetesp32devkit.menu.PartitionScheme.default=Default -mhetesp32devkit.menu.PartitionScheme.default.build.partitions=default -mhetesp32devkit.menu.PartitionScheme.no_ota=No OTA (Large APP) -mhetesp32devkit.menu.PartitionScheme.no_ota.build.partitions=no_ota -mhetesp32devkit.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -mhetesp32devkit.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -mhetesp32devkit.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -mhetesp32devkit.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 - -mhetesp32devkit.menu.UploadSpeed.921600=921600 -mhetesp32devkit.menu.UploadSpeed.921600.upload.speed=921600 -mhetesp32devkit.menu.UploadSpeed.115200=115200 -mhetesp32devkit.menu.UploadSpeed.115200.upload.speed=115200 -mhetesp32devkit.menu.UploadSpeed.256000.windows=256000 -mhetesp32devkit.menu.UploadSpeed.256000.upload.speed=256000 -mhetesp32devkit.menu.UploadSpeed.230400.windows.upload.speed=256000 -mhetesp32devkit.menu.UploadSpeed.230400=230400 -mhetesp32devkit.menu.UploadSpeed.230400.upload.speed=230400 -mhetesp32devkit.menu.UploadSpeed.460800.linux=460800 -mhetesp32devkit.menu.UploadSpeed.460800.macosx=460800 -mhetesp32devkit.menu.UploadSpeed.460800.upload.speed=460800 -mhetesp32devkit.menu.UploadSpeed.512000.windows=512000 -mhetesp32devkit.menu.UploadSpeed.512000.upload.speed=512000 - -mhetesp32devkit.menu.DebugLevel.none=None -mhetesp32devkit.menu.DebugLevel.none.build.code_debug=0 -mhetesp32devkit.menu.DebugLevel.error=Error -mhetesp32devkit.menu.DebugLevel.error.build.code_debug=1 -mhetesp32devkit.menu.DebugLevel.warn=Warn -mhetesp32devkit.menu.DebugLevel.warn.build.code_debug=2 -mhetesp32devkit.menu.DebugLevel.info=Info -mhetesp32devkit.menu.DebugLevel.info.build.code_debug=3 -mhetesp32devkit.menu.DebugLevel.debug=Debug -mhetesp32devkit.menu.DebugLevel.debug.build.code_debug=4 -mhetesp32devkit.menu.DebugLevel.verbose=Verbose -mhetesp32devkit.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - -mhetesp32minikit.name=MH ET LIVE ESP32MiniKit - -mhetesp32minikit.upload.tool=esptool_py -mhetesp32minikit.upload.maximum_size=1310720 -mhetesp32minikit.upload.maximum_data_size=327680 -mhetesp32minikit.upload.wait_for_upload_port=true - -mhetesp32minikit.serial.disableDTR=true -mhetesp32minikit.serial.disableRTS=true - -mhetesp32minikit.build.mcu=esp32 -mhetesp32minikit.build.core=esp32 -mhetesp32minikit.build.variant=mhetesp32minikit -mhetesp32minikit.build.board=MH_ET_LIVE_ESP32MINIKIT - -mhetesp32minikit.build.f_cpu=240000000L -mhetesp32minikit.build.flash_mode=dio -mhetesp32minikit.build.flash_size=4MB -mhetesp32minikit.build.boot=dio -mhetesp32minikit.build.partitions=default -mhetesp32minikit.build.defines= - -mhetesp32minikit.menu.FlashFreq.80=80MHz -mhetesp32minikit.menu.FlashFreq.80.build.flash_freq=80m -mhetesp32minikit.menu.FlashFreq.40=40MHz -mhetesp32minikit.menu.FlashFreq.40.build.flash_freq=40m - -mhetesp32minikit.menu.PartitionScheme.default=Default with spiffs -mhetesp32minikit.menu.PartitionScheme.default.build.partitions=default -mhetesp32minikit.menu.PartitionScheme.defaultffat=Default with ffat -mhetesp32minikit.menu.PartitionScheme.defaultffat.build.partitions=default_ffat -mhetesp32minikit.menu.PartitionScheme.no_ota=No OTA (Large APP) -mhetesp32minikit.menu.PartitionScheme.no_ota.build.partitions=no_ota -mhetesp32minikit.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -mhetesp32minikit.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -mhetesp32minikit.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -mhetesp32minikit.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 - -mhetesp32minikit.menu.UploadSpeed.921600=921600 -mhetesp32minikit.menu.UploadSpeed.921600.upload.speed=921600 -mhetesp32minikit.menu.UploadSpeed.115200=115200 -mhetesp32minikit.menu.UploadSpeed.115200.upload.speed=115200 -mhetesp32minikit.menu.UploadSpeed.256000.windows=256000 -mhetesp32minikit.menu.UploadSpeed.256000.upload.speed=256000 -mhetesp32minikit.menu.UploadSpeed.230400.windows.upload.speed=256000 -mhetesp32minikit.menu.UploadSpeed.230400=230400 -mhetesp32minikit.menu.UploadSpeed.230400.upload.speed=230400 -mhetesp32minikit.menu.UploadSpeed.460800.linux=460800 -mhetesp32minikit.menu.UploadSpeed.460800.macosx=460800 -mhetesp32minikit.menu.UploadSpeed.460800.upload.speed=460800 -mhetesp32minikit.menu.UploadSpeed.512000.windows=512000 -mhetesp32minikit.menu.UploadSpeed.512000.upload.speed=512000 - -mhetesp32minikit.menu.DebugLevel.none=None -mhetesp32minikit.menu.DebugLevel.none.build.code_debug=0 -mhetesp32minikit.menu.DebugLevel.error=Error -mhetesp32minikit.menu.DebugLevel.error.build.code_debug=1 -mhetesp32minikit.menu.DebugLevel.warn=Warn -mhetesp32minikit.menu.DebugLevel.warn.build.code_debug=2 -mhetesp32minikit.menu.DebugLevel.info=Info -mhetesp32minikit.menu.DebugLevel.info.build.code_debug=3 -mhetesp32minikit.menu.DebugLevel.debug=Debug -mhetesp32minikit.menu.DebugLevel.debug.build.code_debug=4 -mhetesp32minikit.menu.DebugLevel.verbose=Verbose -mhetesp32minikit.menu.DebugLevel.verbose.build.code_debug=5 - -################################################################# - -esp32vn-iot-uno.name=ESP32vn IoT Uno - -esp32vn-iot-uno.upload.tool=esptool_py -esp32vn-iot-uno.upload.maximum_size=1310720 -esp32vn-iot-uno.upload.maximum_data_size=327680 -esp32vn-iot-uno.upload.wait_for_upload_port=true - -esp32vn-iot-uno.serial.disableDTR=true -esp32vn-iot-uno.serial.disableRTS=true - -esp32vn-iot-uno.build.mcu=esp32 -esp32vn-iot-uno.build.core=esp32 -esp32vn-iot-uno.build.variant=esp32vn-iot-uno -esp32vn-iot-uno.build.board=esp32vn_iot_uno - -esp32vn-iot-uno.build.f_cpu=240000000L -esp32vn-iot-uno.build.flash_mode=dio -esp32vn-iot-uno.build.flash_size=4MB -esp32vn-iot-uno.build.boot=dio -esp32vn-iot-uno.build.partitions=default -esp32vn-iot-uno.build.defines= - -esp32vn-iot-uno.menu.FlashFreq.80=80MHz -esp32vn-iot-uno.menu.FlashFreq.80.build.flash_freq=80m -esp32vn-iot-uno.menu.FlashFreq.40=40MHz -esp32vn-iot-uno.menu.FlashFreq.40.build.flash_freq=40m - -esp32vn-iot-uno.menu.UploadSpeed.921600=921600 -esp32vn-iot-uno.menu.UploadSpeed.921600.upload.speed=921600 -esp32vn-iot-uno.menu.UploadSpeed.115200=115200 -esp32vn-iot-uno.menu.UploadSpeed.115200.upload.speed=115200 -esp32vn-iot-uno.menu.UploadSpeed.256000.windows=256000 -esp32vn-iot-uno.menu.UploadSpeed.256000.upload.speed=256000 -esp32vn-iot-uno.menu.UploadSpeed.230400.windows.upload.speed=256000 -esp32vn-iot-uno.menu.UploadSpeed.230400=230400 -esp32vn-iot-uno.menu.UploadSpeed.230400.upload.speed=230400 -esp32vn-iot-uno.menu.UploadSpeed.460800.linux=460800 -esp32vn-iot-uno.menu.UploadSpeed.460800.macosx=460800 -esp32vn-iot-uno.menu.UploadSpeed.460800.upload.speed=460800 -esp32vn-iot-uno.menu.UploadSpeed.512000.windows=512000 -esp32vn-iot-uno.menu.UploadSpeed.512000.upload.speed=512000 - -############################################################## - -esp32doit-devkit-v1.name=DOIT ESP32 DEVKIT V1 - -esp32doit-devkit-v1.upload.tool=esptool_py -esp32doit-devkit-v1.upload.maximum_size=1310720 -esp32doit-devkit-v1.upload.maximum_data_size=327680 -esp32doit-devkit-v1.upload.wait_for_upload_port=true - -esp32doit-devkit-v1.serial.disableDTR=true -esp32doit-devkit-v1.serial.disableRTS=true - -esp32doit-devkit-v1.build.mcu=esp32 -esp32doit-devkit-v1.build.core=esp32 -esp32doit-devkit-v1.build.variant=doitESP32devkitV1 -esp32doit-devkit-v1.build.board=ESP32_DEV - -esp32doit-devkit-v1.build.f_cpu=240000000L -esp32doit-devkit-v1.build.flash_mode=dio -esp32doit-devkit-v1.build.flash_size=4MB -esp32doit-devkit-v1.build.boot=dio -esp32doit-devkit-v1.build.partitions=default -esp32doit-devkit-v1.build.defines= - -esp32doit-devkit-v1.menu.FlashFreq.80=80MHz -esp32doit-devkit-v1.menu.FlashFreq.80.build.flash_freq=80m -esp32doit-devkit-v1.menu.FlashFreq.40=40MHz -esp32doit-devkit-v1.menu.FlashFreq.40.build.flash_freq=40m - -esp32doit-devkit-v1.menu.UploadSpeed.921600=921600 -esp32doit-devkit-v1.menu.UploadSpeed.921600.upload.speed=921600 -esp32doit-devkit-v1.menu.UploadSpeed.115200=115200 -esp32doit-devkit-v1.menu.UploadSpeed.115200.upload.speed=115200 -esp32doit-devkit-v1.menu.UploadSpeed.256000.windows=256000 -esp32doit-devkit-v1.menu.UploadSpeed.256000.upload.speed=256000 -esp32doit-devkit-v1.menu.UploadSpeed.230400.windows.upload.speed=256000 -esp32doit-devkit-v1.menu.UploadSpeed.230400=230400 -esp32doit-devkit-v1.menu.UploadSpeed.230400.upload.speed=230400 -esp32doit-devkit-v1.menu.UploadSpeed.460800.linux=460800 -esp32doit-devkit-v1.menu.UploadSpeed.460800.macosx=460800 -esp32doit-devkit-v1.menu.UploadSpeed.460800.upload.speed=460800 -esp32doit-devkit-v1.menu.UploadSpeed.512000.windows=512000 -esp32doit-devkit-v1.menu.UploadSpeed.512000.upload.speed=512000 - -esp32doit-devkit-v1.menu.DebugLevel.none=None -esp32doit-devkit-v1.menu.DebugLevel.none.build.code_debug=0 -esp32doit-devkit-v1.menu.DebugLevel.error=Error -esp32doit-devkit-v1.menu.DebugLevel.error.build.code_debug=1 -esp32doit-devkit-v1.menu.DebugLevel.warn=Warn -esp32doit-devkit-v1.menu.DebugLevel.warn.build.code_debug=2 -esp32doit-devkit-v1.menu.DebugLevel.info=Info -esp32doit-devkit-v1.menu.DebugLevel.info.build.code_debug=3 -esp32doit-devkit-v1.menu.DebugLevel.debug=Debug -esp32doit-devkit-v1.menu.DebugLevel.debug.build.code_debug=4 - -############################################################## - -esp32-evb.name=OLIMEX ESP32-EVB - -esp32-evb.upload.tool=esptool_py -esp32-evb.upload.maximum_size=1310720 -esp32-evb.upload.maximum_data_size=327680 -esp32-evb.upload.wait_for_upload_port=true - -esp32-evb.serial.disableDTR=true -esp32-evb.serial.disableRTS=true - -esp32-evb.build.mcu=esp32 -esp32-evb.build.core=esp32 -esp32-evb.build.variant=esp32-evb -esp32-evb.build.board=ESP32_EVB - -esp32-evb.build.f_cpu=240000000L -esp32-evb.build.flash_mode=dio -esp32-evb.build.flash_size=4MB -esp32-evb.build.boot=dio -esp32-evb.build.partitions=default -esp32-evb.build.defines= - -esp32-evb.menu.FlashFreq.80=80MHz -esp32-evb.menu.FlashFreq.80.build.flash_freq=80m -esp32-evb.menu.FlashFreq.40=40MHz -esp32-evb.menu.FlashFreq.40.build.flash_freq=40m - - -esp32-evb.menu.UploadSpeed.115200=115200 -esp32-evb.menu.UploadSpeed.115200.upload.speed=115200 - -esp32-evb.menu.PartitionScheme.default=Default -esp32-evb.menu.PartitionScheme.default.build.partitions=default -esp32-evb.menu.PartitionScheme.no_ota=No OTA (Large APP) -esp32-evb.menu.PartitionScheme.no_ota.build.partitions=no_ota -esp32-evb.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -esp32-evb.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -esp32-evb.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -esp32-evb.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 - -############################################################## - -esp32-gateway.name=OLIMEX ESP32-GATEWAY - -esp32-gateway.upload.tool=esptool_py -esp32-gateway.upload.maximum_size=1310720 -esp32-gateway.upload.maximum_data_size=327680 -esp32-gateway.upload.wait_for_upload_port=true - -esp32-gateway.serial.disableDTR=true -esp32-gateway.serial.disableRTS=true - -esp32-gateway.build.mcu=esp32 -esp32-gateway.build.core=esp32 -esp32-gateway.build.variant=esp32-gateway -esp32-gateway.build.board=ESP32_GATEWAY -esp32-gateway.menu.Revision.RevC=Revision C or older -esp32-gateway.menu.Revision.RevC.build.board=ESP32_GATEWAY='C' -esp32-gateway.menu.Revision.RevE=Revision E -esp32-gateway.menu.Revision.RevE.build.board=ESP32_GATEWAY='E' -esp32-gateway.menu.Revision.RevF=Revision F -esp32-gateway.menu.Revision.RevF.build.board=ESP32_GATEWAY='F' - -esp32-gateway.build.f_cpu=240000000L -esp32-gateway.build.flash_mode=dio -esp32-gateway.build.flash_size=4MB -esp32-gateway.build.boot=dio -esp32-gateway.build.partitions=default -esp32-gateway.build.defines= - -esp32-gateway.menu.FlashFreq.80=80MHz -esp32-gateway.menu.FlashFreq.80.build.flash_freq=80m -esp32-gateway.menu.FlashFreq.40=40MHz -esp32-gateway.menu.FlashFreq.40.build.flash_freq=40m - - -esp32-gateway.menu.UploadSpeed.115200=115200 -esp32-gateway.menu.UploadSpeed.115200.upload.speed=115200 - -esp32-gateway.menu.PartitionScheme.default=Default -esp32-gateway.menu.PartitionScheme.default.build.partitions=default -esp32-gateway.menu.PartitionScheme.no_ota=No OTA (Large APP) -esp32-gateway.menu.PartitionScheme.no_ota.build.partitions=no_ota -esp32-gateway.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -esp32-gateway.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -esp32-gateway.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -esp32-gateway.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 - -############################################################## - -esp32-poe.name=OLIMEX ESP32-PoE - -esp32-poe.upload.tool=esptool_py -esp32-poe.upload.maximum_size=1310720 -esp32-poe.upload.maximum_data_size=327680 -esp32-poe.upload.wait_for_upload_port=true - -esp32-poe.serial.disableDTR=true -esp32-poe.serial.disableRTS=true - -esp32-poe.build.mcu=esp32 -esp32-poe.build.core=esp32 -esp32-poe.build.variant=esp32-poe -esp32-poe.build.board=ESP32_POE - -esp32-poe.build.f_cpu=240000000L -esp32-poe.build.flash_mode=dio -esp32-poe.build.flash_size=4MB -esp32-poe.build.boot=dio -esp32-poe.build.partitions=default -esp32-poe.build.defines= - -esp32-poe.menu.FlashFreq.80=80MHz -esp32-poe.menu.FlashFreq.80.build.flash_freq=80m -esp32-poe.menu.FlashFreq.40=40MHz -esp32-poe.menu.FlashFreq.40.build.flash_freq=40m - - -esp32-poe.menu.UploadSpeed.115200=115200 -esp32-poe.menu.UploadSpeed.115200.upload.speed=115200 - -esp32-poe.menu.PartitionScheme.default=Default -esp32-poe.menu.PartitionScheme.default.build.partitions=default -esp32-poe.menu.PartitionScheme.no_ota=No OTA (Large APP) -esp32-poe.menu.PartitionScheme.no_ota.build.partitions=no_ota -esp32-poe.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -esp32-poe.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -esp32-poe.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -esp32-poe.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 - -############################################################## - -esp32-poe-iso.name=OLIMEX ESP32-PoE-ISO - -esp32-poe-iso.upload.tool=esptool_py -esp32-poe-iso.upload.maximum_size=1310720 -esp32-poe-iso.upload.maximum_data_size=327680 -esp32-poe-iso.upload.wait_for_upload_port=true - -esp32-poe-iso.serial.disableDTR=true -esp32-poe-iso.serial.disableRTS=true - -esp32-poe-iso.build.mcu=esp32 -esp32-poe-iso.build.core=esp32 -esp32-poe-iso.build.variant=esp32-poe-iso -esp32-poe-iso.build.board=ESP32_POE_ISO - -esp32-poe-iso.build.f_cpu=240000000L -esp32-poe-iso.build.flash_mode=dio -esp32-poe-iso.build.flash_size=4MB -esp32-poe-iso.build.boot=dio -esp32-poe-iso.build.partitions=default -esp32-poe-iso.build.defines= - -esp32-poe-iso.menu.FlashFreq.80=80MHz -esp32-poe-iso.menu.FlashFreq.80.build.flash_freq=80m -esp32-poe-iso.menu.FlashFreq.40=40MHz -esp32-poe-iso.menu.FlashFreq.40.build.flash_freq=40m - - -esp32-poe-iso.menu.UploadSpeed.115200=115200 -esp32-poe-iso.menu.UploadSpeed.115200.upload.speed=115200 - -esp32-poe-iso.menu.PartitionScheme.default=Default -esp32-poe-iso.menu.PartitionScheme.default.build.partitions=default -esp32-poe-iso.menu.PartitionScheme.no_ota=No OTA (Large APP) -esp32-poe-iso.menu.PartitionScheme.no_ota.build.partitions=no_ota -esp32-poe-iso.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -esp32-poe-iso.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -esp32-poe-iso.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -esp32-poe-iso.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 - -############################################################## - -esp32-DevKitLipo.name=OLIMEX ESP32-DevKit-LiPo - -esp32-DevKitLipo.upload.tool=esptool_py -esp32-DevKitLipo.upload.maximum_size=1310720 -esp32-DevKitLipo.upload.maximum_data_size=327680 -esp32-DevKitLipo.upload.wait_for_upload_port=true - -esp32-DevKitLipo.serial.disableDTR=true -esp32-DevKitLipo.serial.disableRTS=true - -esp32-DevKitLipo.build.mcu=esp32 -esp32-DevKitLipo.build.core=esp32 -esp32-DevKitLipo.build.variant=esp32-devkit-lipo -esp32-DevKitLipo.build.board=ESP32_DEVKIT_LIPO - -esp32-DevKitLipo.build.f_cpu=240000000L -esp32-DevKitLipo.build.flash_size=4MB -esp32-DevKitLipo.build.flash_freq=40m -esp32-DevKitLipo.build.flash_mode=dio -esp32-DevKitLipo.build.boot=dio -esp32-DevKitLipo.build.partitions=default -esp32-DevKitLipo.build.defines= - -esp32-DevKitLipo.menu.PartitionScheme.default=Default -esp32-DevKitLipo.menu.PartitionScheme.default.build.partitions=default -esp32-DevKitLipo.menu.PartitionScheme.minimal=Minimal (2MB FLASH) -esp32-DevKitLipo.menu.PartitionScheme.minimal.build.partitions=minimal -esp32-DevKitLipo.menu.PartitionScheme.no_ota=No OTA (Large APP) -esp32-DevKitLipo.menu.PartitionScheme.no_ota.build.partitions=no_ota -esp32-DevKitLipo.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -esp32-DevKitLipo.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA) -esp32-DevKitLipo.menu.PartitionScheme.huge_app.build.partitions=huge_app -esp32-DevKitLipo.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 -esp32-DevKitLipo.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -esp32-DevKitLipo.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -esp32-DevKitLipo.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 -esp32-DevKitLipo.menu.PartitionScheme.fatflash=16M Fat -esp32-DevKitLipo.menu.PartitionScheme.fatflash.build.partitions=ffat - -esp32-DevKitLipo.menu.FlashMode.qio=QIO -esp32-DevKitLipo.menu.FlashMode.qio.build.flash_mode=dio -esp32-DevKitLipo.menu.FlashMode.qio.build.boot=qio -esp32-DevKitLipo.menu.FlashMode.dio=DIO -esp32-DevKitLipo.menu.FlashMode.dio.build.flash_mode=dio -esp32-DevKitLipo.menu.FlashMode.dio.build.boot=dio -esp32-DevKitLipo.menu.FlashMode.qout=QOUT -esp32-DevKitLipo.menu.FlashMode.qout.build.flash_mode=dout -esp32-DevKitLipo.menu.FlashMode.qout.build.boot=qout -esp32-DevKitLipo.menu.FlashMode.dout=DOUT -esp32-DevKitLipo.menu.FlashMode.dout.build.flash_mode=dout -esp32-DevKitLipo.menu.FlashMode.dout.build.boot=dout - -esp32-DevKitLipo.menu.FlashFreq.80=80MHz -esp32-DevKitLipo.menu.FlashFreq.80.build.flash_freq=80m -esp32-DevKitLipo.menu.FlashFreq.40=40MHz -esp32-DevKitLipo.menu.FlashFreq.40.build.flash_freq=40m - -esp32-DevKitLipo.menu.UploadSpeed.921600=921600 -esp32-DevKitLipo.menu.UploadSpeed.921600.upload.speed=921600 -esp32-DevKitLipo.menu.UploadSpeed.115200=115200 -esp32-DevKitLipo.menu.UploadSpeed.115200.upload.speed=115200 -esp32-DevKitLipo.menu.UploadSpeed.256000.windows=256000 -esp32-DevKitLipo.menu.UploadSpeed.256000.upload.speed=256000 -esp32-DevKitLipo.menu.UploadSpeed.230400.windows.upload.speed=256000 -esp32-DevKitLipo.menu.UploadSpeed.230400=230400 -esp32-DevKitLipo.menu.UploadSpeed.230400.upload.speed=230400 -esp32-DevKitLipo.menu.UploadSpeed.460800.linux=460800 -esp32-DevKitLipo.menu.UploadSpeed.460800.macosx=460800 -esp32-DevKitLipo.menu.UploadSpeed.460800.upload.speed=460800 -esp32-DevKitLipo.menu.UploadSpeed.512000.windows=512000 -esp32-DevKitLipo.menu.UploadSpeed.512000.upload.speed=512000 -############################################################## - -espino32.name=ThaiEasyElec's ESPino32 - -espino32.upload.tool=esptool_py -espino32.upload.maximum_size=1310720 -espino32.upload.maximum_data_size=327680 -espino32.upload.wait_for_upload_port=true - -espino32.serial.disableDTR=true -espino32.serial.disableRTS=true - -espino32.build.mcu=esp32 -espino32.build.core=esp32 -espino32.build.variant=espino32 -espino32.build.board=ESPino32 - -espino32.build.f_cpu=240000000L -espino32.build.flash_mode=dio -espino32.build.flash_size=4MB -espino32.build.boot=dio -espino32.build.partitions=default -espino32.build.defines= - -espino32.menu.FlashFreq.80=80MHz -espino32.menu.FlashFreq.80.build.flash_freq=80m -espino32.menu.FlashFreq.40=40MHz -espino32.menu.FlashFreq.40.build.flash_freq=40m - -espino32.menu.UploadSpeed.921600=921600 -espino32.menu.UploadSpeed.921600.upload.speed=921600 -espino32.menu.UploadSpeed.115200=115200 -espino32.menu.UploadSpeed.115200.upload.speed=115200 -espino32.menu.UploadSpeed.256000.windows=256000 -espino32.menu.UploadSpeed.256000.upload.speed=256000 -espino32.menu.UploadSpeed.230400.windows.upload.speed=256000 -espino32.menu.UploadSpeed.230400=230400 -espino32.menu.UploadSpeed.230400.upload.speed=230400 -espino32.menu.UploadSpeed.460800.linux=460800 -espino32.menu.UploadSpeed.460800.macosx=460800 -espino32.menu.UploadSpeed.460800.upload.speed=460800 -espino32.menu.UploadSpeed.512000.windows=512000 -espino32.menu.UploadSpeed.512000.upload.speed=512000 - -############################################################## - -m5stack-core-esp32.name=M5Stack-Core-ESP32 - -m5stack-core-esp32.upload.tool=esptool_py -m5stack-core-esp32.upload.maximum_size=1310720 -m5stack-core-esp32.upload.maximum_data_size=327680 -m5stack-core-esp32.upload.wait_for_upload_port=true - -m5stack-core-esp32.serial.disableDTR=true -m5stack-core-esp32.serial.disableRTS=true - -m5stack-core-esp32.build.mcu=esp32 -m5stack-core-esp32.build.core=esp32 -m5stack-core-esp32.build.variant=m5stack_core_esp32 -m5stack-core-esp32.build.board=M5Stack_Core_ESP32 - -m5stack-core-esp32.build.f_cpu=240000000L -m5stack-core-esp32.build.flash_size=4MB -m5stack-core-esp32.build.flash_mode=dio -m5stack-core-esp32.build.boot=dio -m5stack-core-esp32.build.partitions=default -m5stack-core-esp32.build.defines= - -m5stack-core-esp32.menu.FlashMode.qio=QIO -m5stack-core-esp32.menu.FlashMode.qio.build.flash_mode=dio -m5stack-core-esp32.menu.FlashMode.qio.build.boot=qio -m5stack-core-esp32.menu.FlashMode.dio=DIO -m5stack-core-esp32.menu.FlashMode.dio.build.flash_mode=dio -m5stack-core-esp32.menu.FlashMode.dio.build.boot=dio -m5stack-core-esp32.menu.FlashMode.qout=QOUT -m5stack-core-esp32.menu.FlashMode.qout.build.flash_mode=dout -m5stack-core-esp32.menu.FlashMode.qout.build.boot=qout -m5stack-core-esp32.menu.FlashMode.dout=DOUT -m5stack-core-esp32.menu.FlashMode.dout.build.flash_mode=dout -m5stack-core-esp32.menu.FlashMode.dout.build.boot=dout - -m5stack-core-esp32.menu.FlashFreq.80=80MHz -m5stack-core-esp32.menu.FlashFreq.80.build.flash_freq=80m -m5stack-core-esp32.menu.FlashFreq.40=40MHz -m5stack-core-esp32.menu.FlashFreq.40.build.flash_freq=40m - -m5stack-core-esp32.menu.PartitionScheme.default=Default -m5stack-core-esp32.menu.PartitionScheme.default.build.partitions=default -m5stack-core-esp32.menu.PartitionScheme.no_ota=No OTA (Large APP) -m5stack-core-esp32.menu.PartitionScheme.no_ota.build.partitions=no_ota -m5stack-core-esp32.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -m5stack-core-esp32.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -m5stack-core-esp32.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -m5stack-core-esp32.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 - -m5stack-core-esp32.menu.UploadSpeed.921600=921600 -m5stack-core-esp32.menu.UploadSpeed.921600.upload.speed=921600 -m5stack-core-esp32.menu.UploadSpeed.115200=115200 -m5stack-core-esp32.menu.UploadSpeed.115200.upload.speed=115200 -m5stack-core-esp32.menu.UploadSpeed.256000.windows=256000 -m5stack-core-esp32.menu.UploadSpeed.256000.upload.speed=256000 -m5stack-core-esp32.menu.UploadSpeed.230400.windows.upload.speed=256000 -m5stack-core-esp32.menu.UploadSpeed.230400=230400 -m5stack-core-esp32.menu.UploadSpeed.230400.upload.speed=230400 -m5stack-core-esp32.menu.UploadSpeed.460800.linux=460800 -m5stack-core-esp32.menu.UploadSpeed.460800.macosx=460800 -m5stack-core-esp32.menu.UploadSpeed.460800.upload.speed=460800 -m5stack-core-esp32.menu.UploadSpeed.512000.windows=512000 -m5stack-core-esp32.menu.UploadSpeed.512000.upload.speed=512000 - -m5stack-core-esp32.menu.DebugLevel.none=None -m5stack-core-esp32.menu.DebugLevel.none.build.code_debug=0 -m5stack-core-esp32.menu.DebugLevel.error=Error -m5stack-core-esp32.menu.DebugLevel.error.build.code_debug=1 -m5stack-core-esp32.menu.DebugLevel.warn=Warn -m5stack-core-esp32.menu.DebugLevel.warn.build.code_debug=2 -m5stack-core-esp32.menu.DebugLevel.info=Info -m5stack-core-esp32.menu.DebugLevel.info.build.code_debug=3 -m5stack-core-esp32.menu.DebugLevel.debug=Debug -m5stack-core-esp32.menu.DebugLevel.debug.build.code_debug=4 -m5stack-core-esp32.menu.DebugLevel.verbose=Verbose -m5stack-core-esp32.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - -m5stack-fire.name=M5Stack-FIRE - -m5stack-fire.upload.tool=esptool_py -m5stack-fire.upload.maximum_size=6553600 -m5stack-fire.upload.maximum_data_size=4521984 -m5stack-fire.upload.wait_for_upload_port=true - -m5stack-fire.serial.disableDTR=true -m5stack-fire.serial.disableRTS=true - -m5stack-fire.build.mcu=esp32 -m5stack-fire.build.core=esp32 -m5stack-fire.build.variant=m5stack_fire -m5stack-fire.build.board=M5STACK_FIRE - -m5stack-fire.build.f_cpu=240000000L -m5stack-fire.build.flash_size=16MB -m5stack-fire.build.flash_freq=80m -m5stack-fire.build.flash_mode=dio -m5stack-fire.build.boot=dio -m5stack-fire.build.partitions=default_16MB -m5stack-fire.build.defines= - -m5stack-fire.menu.PSRAM.enabled=Enabled -m5stack-fire.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -m5stack-fire.menu.PSRAM.disabled=Disabled -m5stack-fire.menu.PSRAM.disabled.build.defines= - -m5stack-fire.menu.PartitionScheme.default=Default (2 x 6.5 MB app, 3.6 MB SPIFFS) -m5stack-fire.menu.PartitionScheme.default.build.partitions=default_16MB -m5stack-fire.menu.PartitionScheme.default.upload.maximum_size=6553600 -m5stack-fire.menu.PartitionScheme.large_spiffs=Large SPIFFS (7 MB) -m5stack-fire.menu.PartitionScheme.large_spiffs.build.partitions=large_spiffs_16MB -m5stack-fire.menu.PartitionScheme.large_spiffs.upload.maximum_size=4685824 - -m5stack-fire.menu.UploadSpeed.921600=921600 -m5stack-fire.menu.UploadSpeed.921600.upload.speed=921600 -m5stack-fire.menu.UploadSpeed.115200=115200 -m5stack-fire.menu.UploadSpeed.115200.upload.speed=115200 -m5stack-fire.menu.UploadSpeed.256000.windows=256000 -m5stack-fire.menu.UploadSpeed.256000.upload.speed=256000 -m5stack-fire.menu.UploadSpeed.230400.windows.upload.speed=256000 -m5stack-fire.menu.UploadSpeed.230400=230400 -m5stack-fire.menu.UploadSpeed.230400.upload.speed=230400 -m5stack-fire.menu.UploadSpeed.460800.linux=460800 -m5stack-fire.menu.UploadSpeed.460800.macosx=460800 -m5stack-fire.menu.UploadSpeed.460800.upload.speed=460800 -m5stack-fire.menu.UploadSpeed.512000.windows=512000 -m5stack-fire.menu.UploadSpeed.512000.upload.speed=512000 - -m5stack-fire.menu.DebugLevel.none=None -m5stack-fire.menu.DebugLevel.none.build.code_debug=0 -m5stack-fire.menu.DebugLevel.error=Error -m5stack-fire.menu.DebugLevel.error.build.code_debug=1 -m5stack-fire.menu.DebugLevel.warn=Warn -m5stack-fire.menu.DebugLevel.warn.build.code_debug=2 -m5stack-fire.menu.DebugLevel.info=Info -m5stack-fire.menu.DebugLevel.info.build.code_debug=3 -m5stack-fire.menu.DebugLevel.debug=Debug -m5stack-fire.menu.DebugLevel.debug.build.code_debug=4 -m5stack-fire.menu.DebugLevel.verbose=Verbose -m5stack-fire.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - -m5stick-c.name=M5Stick-C - -m5stick-c.upload.tool=esptool_py -m5stick-c.upload.maximum_size=1310720 -m5stick-c.upload.maximum_data_size=327680 -m5stick-c.upload.wait_for_upload_port=true - -m5stick-c.serial.disableDTR=true -m5stick-c.serial.disableRTS=true - -m5stick-c.build.mcu=esp32 -m5stick-c.build.core=esp32 -m5stick-c.build.variant=m5stick_c -m5stick-c.build.board=M5Stick_C - -m5stick-c.build.f_cpu=240000000L -m5stick-c.build.flash_size=4MB -m5stick-c.build.flash_freq=80m -m5stick-c.build.flash_mode=dio -m5stick-c.build.boot=dio -m5stick-c.build.partitions=default -m5stick-c.build.defines= - -m5stick-c.menu.PartitionScheme.default=Default -m5stick-c.menu.PartitionScheme.default.build.partitions=default -m5stick-c.menu.PartitionScheme.no_ota=No OTA (Large APP) -m5stick-c.menu.PartitionScheme.no_ota.build.partitions=no_ota -m5stick-c.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -m5stick-c.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -m5stick-c.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -m5stick-c.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 - - -m5stick-c.menu.UploadSpeed.1500000=1500000 -m5stick-c.menu.UploadSpeed.1500000.upload.speed=1500000 -m5stick-c.menu.UploadSpeed.750000=750000 -m5stick-c.menu.UploadSpeed.750000.upload.speed=750000 -m5stick-c.menu.UploadSpeed.500000=500000 -m5stick-c.menu.UploadSpeed.500000.upload.speed=500000 -m5stick-c.menu.UploadSpeed.250000=250000 -m5stick-c.menu.UploadSpeed.250000.upload.speed=250000 -m5stick-c.menu.UploadSpeed.115200=115200 -m5stick-c.menu.UploadSpeed.115200.upload.speed=115200 - - - -m5stick-c.menu.DebugLevel.none=None -m5stick-c.menu.DebugLevel.none.build.code_debug=0 -m5stick-c.menu.DebugLevel.error=Error -m5stick-c.menu.DebugLevel.error.build.code_debug=1 -m5stick-c.menu.DebugLevel.warn=Warn -m5stick-c.menu.DebugLevel.warn.build.code_debug=2 -m5stick-c.menu.DebugLevel.info=Info -m5stick-c.menu.DebugLevel.info.build.code_debug=3 -m5stick-c.menu.DebugLevel.debug=Debug -m5stick-c.menu.DebugLevel.debug.build.code_debug=4 -m5stick-c.menu.DebugLevel.verbose=Verbose -m5stick-c.menu.DebugLevel.verbose.build.code_debug=5 - - -############################################################## - -odroid_esp32.name=ODROID ESP32 - -odroid_esp32.upload.tool=esptool_py -odroid_esp32.upload.maximum_size=1310720 -odroid_esp32.upload.maximum_data_size=327680 -odroid_esp32.upload.wait_for_upload_port=true - -odroid_esp32.serial.disableDTR=true -odroid_esp32.serial.disableRTS=true - -odroid_esp32.build.mcu=esp32 -odroid_esp32.build.core=esp32 -odroid_esp32.build.variant=odroid_esp32 -odroid_esp32.build.board=ODROID_ESP32 - -odroid_esp32.build.f_cpu=240000000L -odroid_esp32.build.flash_size=16MB -odroid_esp32.build.flash_mode=dio -odroid_esp32.build.boot=dio -odroid_esp32.build.partitions=default -odroid_esp32.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue - -odroid_esp32.menu.FlashMode.qio=QIO -odroid_esp32.menu.FlashMode.qio.build.flash_mode=dio -odroid_esp32.menu.FlashMode.qio.build.boot=qio -odroid_esp32.menu.FlashMode.dio=DIO -odroid_esp32.menu.FlashMode.dio.build.flash_mode=dio -odroid_esp32.menu.FlashMode.dio.build.boot=dio -odroid_esp32.menu.FlashMode.qout=QOUT -odroid_esp32.menu.FlashMode.qout.build.flash_mode=dout -odroid_esp32.menu.FlashMode.qout.build.boot=qout -odroid_esp32.menu.FlashMode.dout=DOUT -odroid_esp32.menu.FlashMode.dout.build.flash_mode=dout -odroid_esp32.menu.FlashMode.dout.build.boot=dout - -odroid_esp32.menu.FlashFreq.80=80MHz -odroid_esp32.menu.FlashFreq.80.build.flash_freq=80m -odroid_esp32.menu.FlashFreq.40=40MHz -odroid_esp32.menu.FlashFreq.40.build.flash_freq=40m - -odroid_esp32.menu.PartitionScheme.default=Default -odroid_esp32.menu.PartitionScheme.default.build.partitions=default -odroid_esp32.menu.PartitionScheme.no_ota=No OTA (Large APP) -odroid_esp32.menu.PartitionScheme.no_ota.build.partitions=no_ota -odroid_esp32.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -odroid_esp32.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -odroid_esp32.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -odroid_esp32.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 - -odroid_esp32.menu.UploadSpeed.921600=921600 -odroid_esp32.menu.UploadSpeed.921600.upload.speed=921600 -odroid_esp32.menu.UploadSpeed.115200=115200 -odroid_esp32.menu.UploadSpeed.115200.upload.speed=115200 -odroid_esp32.menu.UploadSpeed.256000.windows=256000 -odroid_esp32.menu.UploadSpeed.256000.upload.speed=256000 -odroid_esp32.menu.UploadSpeed.230400.windows.upload.speed=256000 -odroid_esp32.menu.UploadSpeed.230400=230400 -odroid_esp32.menu.UploadSpeed.230400.upload.speed=230400 -odroid_esp32.menu.UploadSpeed.460800.linux=460800 -odroid_esp32.menu.UploadSpeed.460800.macosx=460800 -odroid_esp32.menu.UploadSpeed.460800.upload.speed=460800 -odroid_esp32.menu.UploadSpeed.512000.windows=512000 -odroid_esp32.menu.UploadSpeed.512000.upload.speed=512000 - -odroid_esp32.menu.DebugLevel.none=None -odroid_esp32.menu.DebugLevel.none.build.code_debug=0 -odroid_esp32.menu.DebugLevel.error=Error -odroid_esp32.menu.DebugLevel.error.build.code_debug=1 -odroid_esp32.menu.DebugLevel.warn=Warn -odroid_esp32.menu.DebugLevel.warn.build.code_debug=2 -odroid_esp32.menu.DebugLevel.info=Info -odroid_esp32.menu.DebugLevel.info.build.code_debug=3 -odroid_esp32.menu.DebugLevel.debug=Debug -odroid_esp32.menu.DebugLevel.debug.build.code_debug=4 -odroid_esp32.menu.DebugLevel.verbose=Verbose -odroid_esp32.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - -heltec_wifi_kit_32.name=Heltec WiFi Kit 32 - -heltec_wifi_kit_32.upload.tool=esptool_py -heltec_wifi_kit_32.upload.maximum_size=1310720 -heltec_wifi_kit_32.upload.maximum_data_size=327680 -heltec_wifi_kit_32.upload.wait_for_upload_port=true - -heltec_wifi_kit_32.serial.disableDTR=true -heltec_wifi_kit_32.serial.disableRTS=true - -heltec_wifi_kit_32.build.mcu=esp32 -heltec_wifi_kit_32.build.core=esp32 -heltec_wifi_kit_32.build.variant=heltec_wifi_kit_32 -heltec_wifi_kit_32.build.board=HELTEC_WIFI_KIT_32 - -heltec_wifi_kit_32.build.f_cpu=240000000L -heltec_wifi_kit_32.build.flash_size=4MB -heltec_wifi_kit_32.build.flash_freq=40m -heltec_wifi_kit_32.build.flash_mode=dio -heltec_wifi_kit_32.build.boot=dio -heltec_wifi_kit_32.build.partitions=default -heltec_wifi_kit_32.build.defines= - -heltec_wifi_kit_32.menu.PSRAM.disabled=Disabled -heltec_wifi_kit_32.menu.PSRAM.disabled.build.defines= -heltec_wifi_kit_32.menu.PSRAM.enabled=Enabled -heltec_wifi_kit_32.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue - -heltec_wifi_kit_32.menu.PartitionScheme.default=Default -heltec_wifi_kit_32.menu.PartitionScheme.default.build.partitions=default -heltec_wifi_kit_32.menu.PartitionScheme.minimal=Minimal (2MB FLASH) -heltec_wifi_kit_32.menu.PartitionScheme.minimal.build.partitions=minimal -heltec_wifi_kit_32.menu.PartitionScheme.no_ota=No OTA (Large APP) -heltec_wifi_kit_32.menu.PartitionScheme.no_ota.build.partitions=no_ota -heltec_wifi_kit_32.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -heltec_wifi_kit_32.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA) -heltec_wifi_kit_32.menu.PartitionScheme.huge_app.build.partitions=huge_app -heltec_wifi_kit_32.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 -heltec_wifi_kit_32.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -heltec_wifi_kit_32.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -heltec_wifi_kit_32.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 -heltec_wifi_kit_32.menu.PartitionScheme.fatflash=16M Fat -heltec_wifi_kit_32.menu.PartitionScheme.fatflash.build.partitions=ffat - -heltec_wifi_kit_32.menu.CPUFreq.240=240MHz (WiFi/BT) -heltec_wifi_kit_32.menu.CPUFreq.240.build.f_cpu=240000000L -heltec_wifi_kit_32.menu.CPUFreq.160=160MHz (WiFi/BT) -heltec_wifi_kit_32.menu.CPUFreq.160.build.f_cpu=160000000L -heltec_wifi_kit_32.menu.CPUFreq.80=80MHz (WiFi/BT) -heltec_wifi_kit_32.menu.CPUFreq.80.build.f_cpu=80000000L -heltec_wifi_kit_32.menu.CPUFreq.26=26MHz (26MHz XTAL) -heltec_wifi_kit_32.menu.CPUFreq.26.build.f_cpu=26000000L -heltec_wifi_kit_32.menu.CPUFreq.13=13MHz (26MHz XTAL) -heltec_wifi_kit_32.menu.CPUFreq.13.build.f_cpu=13000000L - -heltec_wifi_kit_32.menu.FlashMode.qio=QIO -heltec_wifi_kit_32.menu.FlashMode.qio.build.flash_mode=dio -heltec_wifi_kit_32.menu.FlashMode.qio.build.boot=qio -heltec_wifi_kit_32.menu.FlashMode.dio=DIO -heltec_wifi_kit_32.menu.FlashMode.dio.build.flash_mode=dio -heltec_wifi_kit_32.menu.FlashMode.dio.build.boot=dio -heltec_wifi_kit_32.menu.FlashMode.qout=QOUT -heltec_wifi_kit_32.menu.FlashMode.qout.build.flash_mode=dout -heltec_wifi_kit_32.menu.FlashMode.qout.build.boot=qout -heltec_wifi_kit_32.menu.FlashMode.dout=DOUT -heltec_wifi_kit_32.menu.FlashMode.dout.build.flash_mode=dout -heltec_wifi_kit_32.menu.FlashMode.dout.build.boot=dout - -heltec_wifi_kit_32.menu.FlashFreq.40=40MHz -heltec_wifi_kit_32.menu.FlashFreq.40.build.flash_freq=40m -heltec_wifi_kit_32.menu.FlashFreq.80=80MHz -heltec_wifi_kit_32.menu.FlashFreq.80.build.flash_freq=80m - -heltec_wifi_kit_32.menu.FlashSize.4M=4MB (32Mb) -heltec_wifi_kit_32.menu.FlashSize.4M.build.flash_size=4MB -heltec_wifi_kit_32.menu.FlashSize.2M=2MB (16Mb) -heltec_wifi_kit_32.menu.FlashSize.2M.build.flash_size=2MB -heltec_wifi_kit_32.menu.FlashSize.2M.build.partitions=minimal -heltec_wifi_kit_32.menu.FlashSize.16M=16MB (128Mb) -heltec_wifi_kit_32.menu.FlashSize.16M.build.flash_size=16MB -heltec_wifi_kit_32.menu.FlashSize.16M.build.partitions=ffat - -heltec_wifi_kit_32.menu.UploadSpeed.921600=921600 -heltec_wifi_kit_32.menu.UploadSpeed.921600.upload.speed=921600 -heltec_wifi_kit_32.menu.UploadSpeed.115200=115200 -heltec_wifi_kit_32.menu.UploadSpeed.115200.upload.speed=115200 -heltec_wifi_kit_32.menu.UploadSpeed.256000.windows=256000 -heltec_wifi_kit_32.menu.UploadSpeed.256000.upload.speed=256000 -heltec_wifi_kit_32.menu.UploadSpeed.230400.windows.upload.speed=256000 -heltec_wifi_kit_32.menu.UploadSpeed.230400=230400 -heltec_wifi_kit_32.menu.UploadSpeed.230400.upload.speed=230400 -heltec_wifi_kit_32.menu.UploadSpeed.460800.linux=460800 -heltec_wifi_kit_32.menu.UploadSpeed.460800.macosx=460800 -heltec_wifi_kit_32.menu.UploadSpeed.460800.upload.speed=460800 -heltec_wifi_kit_32.menu.UploadSpeed.512000.windows=512000 -heltec_wifi_kit_32.menu.UploadSpeed.512000.upload.speed=512000 - -heltec_wifi_kit_32.menu.DebugLevel.none=None -heltec_wifi_kit_32.menu.DebugLevel.none.build.code_debug=0 -heltec_wifi_kit_32.menu.DebugLevel.error=Error -heltec_wifi_kit_32.menu.DebugLevel.error.build.code_debug=1 -heltec_wifi_kit_32.menu.DebugLevel.warn=Warn -heltec_wifi_kit_32.menu.DebugLevel.warn.build.code_debug=2 -heltec_wifi_kit_32.menu.DebugLevel.info=Info -heltec_wifi_kit_32.menu.DebugLevel.info.build.code_debug=3 -heltec_wifi_kit_32.menu.DebugLevel.debug=Debug -heltec_wifi_kit_32.menu.DebugLevel.debug.build.code_debug=4 -heltec_wifi_kit_32.menu.DebugLevel.verbose=Verbose -heltec_wifi_kit_32.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - -heltec_wifi_lora_32.name=Heltec WiFi LoRa 32 - -heltec_wifi_lora_32.upload.tool=esptool_py -heltec_wifi_lora_32.upload.maximum_size=1310720 -heltec_wifi_lora_32.upload.maximum_data_size=327680 -heltec_wifi_lora_32.upload.wait_for_upload_port=true - -heltec_wifi_lora_32.serial.disableDTR=true -heltec_wifi_lora_32.serial.disableRTS=true - -heltec_wifi_lora_32.build.mcu=esp32 -heltec_wifi_lora_32.build.core=esp32 -heltec_wifi_lora_32.build.variant=heltec_wifi_lora_32 -heltec_wifi_lora_32.build.board=HELTEC_WIFI_LORA_32 - -heltec_wifi_lora_32.build.f_cpu=240000000L -heltec_wifi_lora_32.build.flash_size=4MB -heltec_wifi_lora_32.build.flash_freq=40m -heltec_wifi_lora_32.build.flash_mode=dio -heltec_wifi_lora_32.build.boot=dio -heltec_wifi_lora_32.build.partitions=default -heltec_wifi_lora_32.build.defines= - -heltec_wifi_lora_32.menu.PSRAM.disabled=Disabled -heltec_wifi_lora_32.menu.PSRAM.disabled.build.defines= -heltec_wifi_lora_32.menu.PSRAM.enabled=Enabled -heltec_wifi_lora_32.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue - -heltec_wifi_lora_32.menu.PartitionScheme.default=Default -heltec_wifi_lora_32.menu.PartitionScheme.default.build.partitions=default -heltec_wifi_lora_32.menu.PartitionScheme.minimal=Minimal (2MB FLASH) -heltec_wifi_lora_32.menu.PartitionScheme.minimal.build.partitions=minimal -heltec_wifi_lora_32.menu.PartitionScheme.no_ota=No OTA (Large APP) -heltec_wifi_lora_32.menu.PartitionScheme.no_ota.build.partitions=no_ota -heltec_wifi_lora_32.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -heltec_wifi_lora_32.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA) -heltec_wifi_lora_32.menu.PartitionScheme.huge_app.build.partitions=huge_app -heltec_wifi_lora_32.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 -heltec_wifi_lora_32.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -heltec_wifi_lora_32.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -heltec_wifi_lora_32.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 -heltec_wifi_lora_32.menu.PartitionScheme.fatflash=16M Fat -heltec_wifi_lora_32.menu.PartitionScheme.fatflash.build.partitions=ffat - -heltec_wifi_lora_32.menu.CPUFreq.240=240MHz (WiFi/BT) -heltec_wifi_lora_32.menu.CPUFreq.240.build.f_cpu=240000000L -heltec_wifi_lora_32.menu.CPUFreq.160=160MHz (WiFi/BT) -heltec_wifi_lora_32.menu.CPUFreq.160.build.f_cpu=160000000L -heltec_wifi_lora_32.menu.CPUFreq.80=80MHz (WiFi/BT) -heltec_wifi_lora_32.menu.CPUFreq.80.build.f_cpu=80000000L -heltec_wifi_lora_32.menu.CPUFreq.26=26MHz (26MHz XTAL) -heltec_wifi_lora_32.menu.CPUFreq.26.build.f_cpu=26000000L -heltec_wifi_lora_32.menu.CPUFreq.13=13MHz (26MHz XTAL) -heltec_wifi_lora_32.menu.CPUFreq.13.build.f_cpu=13000000L - -heltec_wifi_lora_32.menu.FlashMode.qio=QIO -heltec_wifi_lora_32.menu.FlashMode.qio.build.flash_mode=dio -heltec_wifi_lora_32.menu.FlashMode.qio.build.boot=qio -heltec_wifi_lora_32.menu.FlashMode.dio=DIO -heltec_wifi_lora_32.menu.FlashMode.dio.build.flash_mode=dio -heltec_wifi_lora_32.menu.FlashMode.dio.build.boot=dio -heltec_wifi_lora_32.menu.FlashMode.qout=QOUT -heltec_wifi_lora_32.menu.FlashMode.qout.build.flash_mode=dout -heltec_wifi_lora_32.menu.FlashMode.qout.build.boot=qout -heltec_wifi_lora_32.menu.FlashMode.dout=DOUT -heltec_wifi_lora_32.menu.FlashMode.dout.build.flash_mode=dout -heltec_wifi_lora_32.menu.FlashMode.dout.build.boot=dout - -heltec_wifi_lora_32.menu.FlashFreq.40=40MHz -heltec_wifi_lora_32.menu.FlashFreq.40.build.flash_freq=40m -heltec_wifi_lora_32.menu.FlashFreq.80=80MHz -heltec_wifi_lora_32.menu.FlashFreq.80.build.flash_freq=80m - -heltec_wifi_lora_32.menu.FlashSize.4M=4MB (32Mb) -heltec_wifi_lora_32.menu.FlashSize.4M.build.flash_size=4MB -heltec_wifi_lora_32.menu.FlashSize.2M=2MB (16Mb) -heltec_wifi_lora_32.menu.FlashSize.2M.build.flash_size=2MB -heltec_wifi_lora_32.menu.FlashSize.2M.build.partitions=minimal -heltec_wifi_lora_32.menu.FlashSize.16M=16MB (128Mb) -heltec_wifi_lora_32.menu.FlashSize.16M.build.flash_size=16MB -heltec_wifi_lora_32.menu.FlashSize.16M.build.partitions=ffat - -heltec_wifi_lora_32.menu.UploadSpeed.921600=921600 -heltec_wifi_lora_32.menu.UploadSpeed.921600.upload.speed=921600 -heltec_wifi_lora_32.menu.UploadSpeed.115200=115200 -heltec_wifi_lora_32.menu.UploadSpeed.115200.upload.speed=115200 -heltec_wifi_lora_32.menu.UploadSpeed.256000.windows=256000 -heltec_wifi_lora_32.menu.UploadSpeed.256000.upload.speed=256000 -heltec_wifi_lora_32.menu.UploadSpeed.230400.windows.upload.speed=256000 -heltec_wifi_lora_32.menu.UploadSpeed.230400=230400 -heltec_wifi_lora_32.menu.UploadSpeed.230400.upload.speed=230400 -heltec_wifi_lora_32.menu.UploadSpeed.460800.linux=460800 -heltec_wifi_lora_32.menu.UploadSpeed.460800.macosx=460800 -heltec_wifi_lora_32.menu.UploadSpeed.460800.upload.speed=460800 -heltec_wifi_lora_32.menu.UploadSpeed.512000.windows=512000 -heltec_wifi_lora_32.menu.UploadSpeed.512000.upload.speed=512000 - -heltec_wifi_lora_32.menu.DebugLevel.none=None -heltec_wifi_lora_32.menu.DebugLevel.none.build.code_debug=0 -heltec_wifi_lora_32.menu.DebugLevel.error=Error -heltec_wifi_lora_32.menu.DebugLevel.error.build.code_debug=1 -heltec_wifi_lora_32.menu.DebugLevel.warn=Warn -heltec_wifi_lora_32.menu.DebugLevel.warn.build.code_debug=2 -heltec_wifi_lora_32.menu.DebugLevel.info=Info -heltec_wifi_lora_32.menu.DebugLevel.info.build.code_debug=3 -heltec_wifi_lora_32.menu.DebugLevel.debug=Debug -heltec_wifi_lora_32.menu.DebugLevel.debug.build.code_debug=4 -heltec_wifi_lora_32.menu.DebugLevel.verbose=Verbose -heltec_wifi_lora_32.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - -heltec_wifi_lora_32_V2.name=Heltec WiFi LoRa 32(V2) - -heltec_wifi_lora_32_V2.upload.tool=esptool_py -heltec_wifi_lora_32_V2.upload.maximum_size=1310720 -heltec_wifi_lora_32_V2.upload.maximum_data_size=327680 -heltec_wifi_lora_32_V2.upload.wait_for_upload_port=true - -heltec_wifi_lora_32_V2.serial.disableDTR=true -heltec_wifi_lora_32_V2.serial.disableRTS=true - -heltec_wifi_lora_32_V2.build.mcu=esp32 -heltec_wifi_lora_32_V2.build.core=esp32 -heltec_wifi_lora_32_V2.build.variant=heltec_wifi_lora_32_V2 -heltec_wifi_lora_32_V2.build.board=HELTEC_WIFI_LORA_32_V2 - -heltec_wifi_lora_32_V2.build.f_cpu=240000000L -heltec_wifi_lora_32_V2.build.flash_size=8MB -heltec_wifi_lora_32_V2.build.flash_freq=40m -heltec_wifi_lora_32_V2.build.flash_mode=dio -heltec_wifi_lora_32_V2.build.boot=dio -heltec_wifi_lora_32_V2.build.partitions=default_8MB -heltec_wifi_lora_32_V2.build.defines= - -heltec_wifi_lora_32_V2.menu.PSRAM.disabled=Disabled -heltec_wifi_lora_32_V2.menu.PSRAM.disabled.build.defines= -heltec_wifi_lora_32_V2.menu.PSRAM.enabled=Enabled -heltec_wifi_lora_32_V2.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue - -heltec_wifi_lora_32_V2.menu.PartitionScheme.default=default_8MB -heltec_wifi_lora_32_V2.menu.PartitionScheme.default.build.partitions=default_8MB -heltec_wifi_lora_32_V2.menu.PartitionScheme.default.upload.maximum_size=3342336 -heltec_wifi_lora_32_V2.menu.PartitionScheme.minimal=Minimal (2MB FLASH) -heltec_wifi_lora_32_V2.menu.PartitionScheme.minimal.build.partitions=minimal -heltec_wifi_lora_32_V2.menu.PartitionScheme.no_ota=No OTA (Large APP) -heltec_wifi_lora_32_V2.menu.PartitionScheme.no_ota.build.partitions=no_ota -heltec_wifi_lora_32_V2.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -heltec_wifi_lora_32_V2.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA) -heltec_wifi_lora_32_V2.menu.PartitionScheme.huge_app.build.partitions=huge_app -heltec_wifi_lora_32_V2.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 -heltec_wifi_lora_32_V2.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -heltec_wifi_lora_32_V2.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -heltec_wifi_lora_32_V2.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 -heltec_wifi_lora_32_V2.menu.PartitionScheme.fatflash=16M Fat -heltec_wifi_lora_32_V2.menu.PartitionScheme.fatflash.build.partitions=ffat - -heltec_wifi_lora_32_V2.menu.CPUFreq.240=240MHz (WiFi/BT) -heltec_wifi_lora_32_V2.menu.CPUFreq.240.build.f_cpu=240000000L -heltec_wifi_lora_32_V2.menu.CPUFreq.160=160MHz (WiFi/BT) -heltec_wifi_lora_32_V2.menu.CPUFreq.160.build.f_cpu=160000000L -heltec_wifi_lora_32_V2.menu.CPUFreq.80=80MHz (WiFi/BT) -heltec_wifi_lora_32_V2.menu.CPUFreq.80.build.f_cpu=80000000L -heltec_wifi_lora_32_V2.menu.CPUFreq.40=40MHz (40MHz XTAL) -heltec_wifi_lora_32_V2.menu.CPUFreq.40.build.f_cpu=40000000L -heltec_wifi_lora_32_V2.menu.CPUFreq.20=20MHz (40MHz XTAL) -heltec_wifi_lora_32_V2.menu.CPUFreq.20.build.f_cpu=20000000L -heltec_wifi_lora_32_V2.menu.CPUFreq.10=10MHz (40MHz XTAL) -heltec_wifi_lora_32_V2.menu.CPUFreq.10.build.f_cpu=10000000L - -heltec_wifi_lora_32_V2.menu.FlashMode.qio=QIO -heltec_wifi_lora_32_V2.menu.FlashMode.qio.build.flash_mode=dio -heltec_wifi_lora_32_V2.menu.FlashMode.qio.build.boot=qio -heltec_wifi_lora_32_V2.menu.FlashMode.dio=DIO -heltec_wifi_lora_32_V2.menu.FlashMode.dio.build.flash_mode=dio -heltec_wifi_lora_32_V2.menu.FlashMode.dio.build.boot=dio -heltec_wifi_lora_32_V2.menu.FlashMode.qout=QOUT -heltec_wifi_lora_32_V2.menu.FlashMode.qout.build.flash_mode=dout -heltec_wifi_lora_32_V2.menu.FlashMode.qout.build.boot=qout -heltec_wifi_lora_32_V2.menu.FlashMode.dout=DOUT -heltec_wifi_lora_32_V2.menu.FlashMode.dout.build.flash_mode=dout -heltec_wifi_lora_32_V2.menu.FlashMode.dout.build.boot=dout - -heltec_wifi_lora_32_V2.menu.FlashFreq.80=80MHz -heltec_wifi_lora_32_V2.menu.FlashFreq.80.build.flash_freq=80m -heltec_wifi_lora_32_V2.menu.FlashFreq.40=40MHz -heltec_wifi_lora_32_V2.menu.FlashFreq.40.build.flash_freq=40m - -heltec_wifi_lora_32_V2.menu.FlashSize.8M=8MB (64Mb) -heltec_wifi_lora_32_V2.menu.FlashSize.8M.build.flash_size=8MB -heltec_wifi_lora_32_V2.menu.FlashSize.8M.build.partitions=default_8MB -heltec_wifi_lora_32_V2.menu.FlashSize.4M=4MB (32Mb) -heltec_wifi_lora_32_V2.menu.FlashSize.4M.build.flash_size=4MB -heltec_wifi_lora_32_V2.menu.FlashSize.2M=2MB (16Mb) -heltec_wifi_lora_32_V2.menu.FlashSize.2M.build.flash_size=2MB -heltec_wifi_lora_32_V2.menu.FlashSize.2M.build.partitions=minimal -heltec_wifi_lora_32_V2.menu.FlashSize.16M=16MB (128Mb) -heltec_wifi_lora_32_V2.menu.FlashSize.16M.build.flash_size=16MB -heltec_wifi_lora_32_V2.menu.FlashSize.16M.build.partitions=ffat - -heltec_wifi_lora_32_V2.menu.UploadSpeed.921600=921600 -heltec_wifi_lora_32_V2.menu.UploadSpeed.921600.upload.speed=921600 -heltec_wifi_lora_32_V2.menu.UploadSpeed.115200=115200 -heltec_wifi_lora_32_V2.menu.UploadSpeed.115200.upload.speed=115200 -heltec_wifi_lora_32_V2.menu.UploadSpeed.256000.windows=256000 -heltec_wifi_lora_32_V2.menu.UploadSpeed.256000.upload.speed=256000 -heltec_wifi_lora_32_V2.menu.UploadSpeed.230400.windows.upload.speed=256000 -heltec_wifi_lora_32_V2.menu.UploadSpeed.230400=230400 -heltec_wifi_lora_32_V2.menu.UploadSpeed.230400.upload.speed=230400 -heltec_wifi_lora_32_V2.menu.UploadSpeed.460800.linux=460800 -heltec_wifi_lora_32_V2.menu.UploadSpeed.460800.macosx=460800 -heltec_wifi_lora_32_V2.menu.UploadSpeed.460800.upload.speed=460800 -heltec_wifi_lora_32_V2.menu.UploadSpeed.512000.windows=512000 -heltec_wifi_lora_32_V2.menu.UploadSpeed.512000.upload.speed=512000 - -heltec_wifi_lora_32_V2.menu.DebugLevel.none=None -heltec_wifi_lora_32_V2.menu.DebugLevel.none.build.code_debug=0 -heltec_wifi_lora_32_V2.menu.DebugLevel.error=Error -heltec_wifi_lora_32_V2.menu.DebugLevel.error.build.code_debug=1 -heltec_wifi_lora_32_V2.menu.DebugLevel.warn=Warn -heltec_wifi_lora_32_V2.menu.DebugLevel.warn.build.code_debug=2 -heltec_wifi_lora_32_V2.menu.DebugLevel.info=Info -heltec_wifi_lora_32_V2.menu.DebugLevel.info.build.code_debug=3 -heltec_wifi_lora_32_V2.menu.DebugLevel.debug=Debug -heltec_wifi_lora_32_V2.menu.DebugLevel.debug.build.code_debug=4 -heltec_wifi_lora_32_V2.menu.DebugLevel.verbose=Verbose -heltec_wifi_lora_32_V2.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - -heltec_wireless_stick.name=Heltec Wireless Stick - -heltec_wireless_stick.upload.tool=esptool_py -heltec_wireless_stick.upload.maximum_size=1310720 -heltec_wireless_stick.upload.maximum_data_size=327680 -heltec_wireless_stick.upload.wait_for_upload_port=true - -heltec_wireless_stick.serial.disableDTR=true -heltec_wireless_stick.serial.disableRTS=true - -heltec_wireless_stick.build.mcu=esp32 -heltec_wireless_stick.build.core=esp32 -heltec_wireless_stick.build.variant=heltec_wireless_stick -heltec_wireless_stick.build.board=HELTEC_WIRELESS_STICK - -heltec_wireless_stick.build.f_cpu=240000000L -heltec_wireless_stick.build.flash_size=8MB -heltec_wireless_stick.build.flash_freq=40m -heltec_wireless_stick.build.flash_mode=dio -heltec_wireless_stick.build.boot=dio -heltec_wireless_stick.build.partitions=default_8MB -heltec_wireless_stick.build.defines= - -heltec_wireless_stick.menu.PSRAM.disabled=Disabled -heltec_wireless_stick.menu.PSRAM.disabled.build.defines= -heltec_wireless_stick.menu.PSRAM.enabled=Enabled -heltec_wireless_stick.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue - -heltec_wireless_stick.menu.PartitionScheme.default=default_8MB -heltec_wireless_stick.menu.PartitionScheme.default.build.partitions=default_8MB -heltec_wireless_stick.menu.PartitionScheme.default.upload.maximum_size=3342336 -heltec_wireless_stick.menu.PartitionScheme.minimal=Minimal (2MB FLASH) -heltec_wireless_stick.menu.PartitionScheme.minimal.build.partitions=minimal -heltec_wireless_stick.menu.PartitionScheme.no_ota=No OTA (Large APP) -heltec_wireless_stick.menu.PartitionScheme.no_ota.build.partitions=no_ota -heltec_wireless_stick.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -heltec_wireless_stick.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA) -heltec_wireless_stick.menu.PartitionScheme.huge_app.build.partitions=huge_app -heltec_wireless_stick.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 -heltec_wireless_stick.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -heltec_wireless_stick.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -heltec_wireless_stick.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 -heltec_wireless_stick.menu.PartitionScheme.fatflash=16M Fat -heltec_wireless_stick.menu.PartitionScheme.fatflash.build.partitions=ffat - -heltec_wireless_stick.menu.CPUFreq.240=240MHz (WiFi/BT) -heltec_wireless_stick.menu.CPUFreq.240.build.f_cpu=240000000L -heltec_wireless_stick.menu.CPUFreq.160=160MHz (WiFi/BT) -heltec_wireless_stick.menu.CPUFreq.160.build.f_cpu=160000000L -heltec_wireless_stick.menu.CPUFreq.80=80MHz (WiFi/BT) -heltec_wireless_stick.menu.CPUFreq.80.build.f_cpu=80000000L -heltec_wireless_stick.menu.CPUFreq.40=40MHz (40MHz XTAL) -heltec_wireless_stick.menu.CPUFreq.40.build.f_cpu=40000000L -heltec_wireless_stick.menu.CPUFreq.20=20MHz (40MHz XTAL) -heltec_wireless_stick.menu.CPUFreq.20.build.f_cpu=20000000L -heltec_wireless_stick.menu.CPUFreq.10=10MHz (40MHz XTAL) -heltec_wireless_stick.menu.CPUFreq.10.build.f_cpu=10000000L - -heltec_wireless_stick.menu.FlashMode.qio=QIO -heltec_wireless_stick.menu.FlashMode.qio.build.flash_mode=dio -heltec_wireless_stick.menu.FlashMode.qio.build.boot=qio -heltec_wireless_stick.menu.FlashMode.dio=DIO -heltec_wireless_stick.menu.FlashMode.dio.build.flash_mode=dio -heltec_wireless_stick.menu.FlashMode.dio.build.boot=dio -heltec_wireless_stick.menu.FlashMode.qout=QOUT -heltec_wireless_stick.menu.FlashMode.qout.build.flash_mode=dout -heltec_wireless_stick.menu.FlashMode.qout.build.boot=qout -heltec_wireless_stick.menu.FlashMode.dout=DOUT -heltec_wireless_stick.menu.FlashMode.dout.build.flash_mode=dout -heltec_wireless_stick.menu.FlashMode.dout.build.boot=dout - -heltec_wireless_stick.menu.FlashFreq.80=80MHz -heltec_wireless_stick.menu.FlashFreq.80.build.flash_freq=80m -heltec_wireless_stick.menu.FlashFreq.40=40MHz -heltec_wireless_stick.menu.FlashFreq.40.build.flash_freq=40m - -heltec_wireless_stick.menu.FlashSize.8M=8MB (64Mb) -heltec_wireless_stick.menu.FlashSize.8M.build.flash_size=8MB -heltec_wireless_stick.menu.FlashSize.2M.build.partitions=default_8MB -heltec_wireless_stick.menu.FlashSize.4M=4MB (32Mb) -heltec_wireless_stick.menu.FlashSize.4M.build.flash_size=4MB -heltec_wireless_stick.menu.FlashSize.2M=2MB (16Mb) -heltec_wireless_stick.menu.FlashSize.2M.build.flash_size=2MB -heltec_wireless_stick.menu.FlashSize.2M.build.partitions=minimal -heltec_wireless_stick.menu.FlashSize.16M=16MB (128Mb) -heltec_wireless_stick.menu.FlashSize.16M.build.flash_size=16MB -heltec_wireless_stick.menu.FlashSize.16M.build.partitions=ffat - -heltec_wireless_stick.menu.UploadSpeed.921600=921600 -heltec_wireless_stick.menu.UploadSpeed.921600.upload.speed=921600 -heltec_wireless_stick.menu.UploadSpeed.115200=115200 -heltec_wireless_stick.menu.UploadSpeed.115200.upload.speed=115200 -heltec_wireless_stick.menu.UploadSpeed.256000.windows=256000 -heltec_wireless_stick.menu.UploadSpeed.256000.upload.speed=256000 -heltec_wireless_stick.menu.UploadSpeed.230400.windows.upload.speed=256000 -heltec_wireless_stick.menu.UploadSpeed.230400=230400 -heltec_wireless_stick.menu.UploadSpeed.230400.upload.speed=230400 -heltec_wireless_stick.menu.UploadSpeed.460800.linux=460800 -heltec_wireless_stick.menu.UploadSpeed.460800.macosx=460800 -heltec_wireless_stick.menu.UploadSpeed.460800.upload.speed=460800 -heltec_wireless_stick.menu.UploadSpeed.512000.windows=512000 -heltec_wireless_stick.menu.UploadSpeed.512000.upload.speed=512000 - -heltec_wireless_stick.menu.DebugLevel.none=None -heltec_wireless_stick.menu.DebugLevel.none.build.code_debug=0 -heltec_wireless_stick.menu.DebugLevel.error=Error -heltec_wireless_stick.menu.DebugLevel.error.build.code_debug=1 -heltec_wireless_stick.menu.DebugLevel.warn=Warn -heltec_wireless_stick.menu.DebugLevel.warn.build.code_debug=2 -heltec_wireless_stick.menu.DebugLevel.info=Info -heltec_wireless_stick.menu.DebugLevel.info.build.code_debug=3 -heltec_wireless_stick.menu.DebugLevel.debug=Debug -heltec_wireless_stick.menu.DebugLevel.debug.build.code_debug=4 -heltec_wireless_stick.menu.DebugLevel.verbose=Verbose -heltec_wireless_stick.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - -espectro32.name=ESPectro32 - -espectro32.upload.tool=esptool_py -espectro32.upload.maximum_size=1310720 -espectro32.upload.maximum_data_size=327680 -espectro32.upload.wait_for_upload_port=true - -espectro32.serial.disableDTR=true -espectro32.serial.disableRTS=true - -espectro32.build.mcu=esp32 -espectro32.build.core=esp32 -espectro32.build.variant=espectro32 -espectro32.build.board=ESPECTRO32 - -espectro32.build.f_cpu=240000000L -espectro32.build.flash_size=4MB -espectro32.build.flash_mode=dio -espectro32.build.boot=dio -espectro32.build.partitions=default -espectro32.build.defines= - -espectro32.menu.FlashMode.qio=QIO -espectro32.menu.FlashMode.qio.build.flash_mode=dio -espectro32.menu.FlashMode.qio.build.boot=qio -espectro32.menu.FlashMode.dio=DIO -espectro32.menu.FlashMode.dio.build.flash_mode=dio -espectro32.menu.FlashMode.dio.build.boot=dio -espectro32.menu.FlashMode.qout=QOUT -espectro32.menu.FlashMode.qout.build.flash_mode=dout -espectro32.menu.FlashMode.qout.build.boot=qout -espectro32.menu.FlashMode.dout=DOUT -espectro32.menu.FlashMode.dout.build.flash_mode=dout -espectro32.menu.FlashMode.dout.build.boot=dout - -espectro32.menu.FlashFreq.80=80MHz -espectro32.menu.FlashFreq.80.build.flash_freq=80m -espectro32.menu.FlashFreq.40=40MHz -espectro32.menu.FlashFreq.40.build.flash_freq=40m - -espectro32.menu.FlashSize.4M=4MB (32Mb) -espectro32.menu.FlashSize.4M.build.flash_size=4MB -espectro32.menu.FlashSize.2M=2MB (16Mb) -espectro32.menu.FlashSize.2M.build.flash_size=2MB -espectro32.menu.FlashSize.2M.build.partitions=minimal - -espectro32.menu.UploadSpeed.921600=921600 -espectro32.menu.UploadSpeed.921600.upload.speed=921600 -espectro32.menu.UploadSpeed.115200=115200 -espectro32.menu.UploadSpeed.115200.upload.speed=115200 -espectro32.menu.UploadSpeed.256000.windows=256000 -espectro32.menu.UploadSpeed.256000.upload.speed=256000 -espectro32.menu.UploadSpeed.230400.windows.upload.speed=256000 -espectro32.menu.UploadSpeed.230400=230400 -espectro32.menu.UploadSpeed.230400.upload.speed=230400 -espectro32.menu.UploadSpeed.460800.linux=460800 -espectro32.menu.UploadSpeed.460800.macosx=460800 -espectro32.menu.UploadSpeed.460800.upload.speed=460800 -espectro32.menu.UploadSpeed.512000.windows=512000 -espectro32.menu.UploadSpeed.512000.upload.speed=512000 - -espectro32.menu.DebugLevel.none=None -espectro32.menu.DebugLevel.none.build.code_debug=0 -espectro32.menu.DebugLevel.error=Error -espectro32.menu.DebugLevel.error.build.code_debug=1 -espectro32.menu.DebugLevel.warn=Warn -espectro32.menu.DebugLevel.warn.build.code_debug=2 -espectro32.menu.DebugLevel.info=Info -espectro32.menu.DebugLevel.info.build.code_debug=3 -espectro32.menu.DebugLevel.debug=Debug -espectro32.menu.DebugLevel.debug.build.code_debug=4 -espectro32.menu.DebugLevel.verbose=Verbose -espectro32.menu.DebugLevel.verbose.build.code_debug=5 - - -############################################################## -CoreESP32.name=Microduino-CoreESP32 - -CoreESP32.upload.tool=esptool_py -CoreESP32.upload.maximum_size=1310720 -CoreESP32.upload.maximum_data_size=327680 -CoreESP32.upload.wait_for_upload_port=true - -CoreESP32.serial.disableDTR=true -CoreESP32.serial.disableRTS=true - -CoreESP32.build.mcu=esp32 -CoreESP32.build.core=esp32 -CoreESP32.build.variant=Microduino-esp32 -CoreESP32.build.board=CoreESP32 - -CoreESP32.build.f_cpu=240000000L -CoreESP32.build.flash_mode=dio -CoreESP32.build.flash_size=4MB -CoreESP32.build.boot=dio -CoreESP32.build.partitions=default -CoreESP32.build.defines= - -CoreESP32.menu.FlashFreq.80=80MHz -CoreESP32.menu.FlashFreq.80.build.flash_freq=80m -CoreESP32.menu.FlashFreq.40=40MHz -CoreESP32.menu.FlashFreq.40.build.flash_freq=40m - -CoreESP32.menu.UploadSpeed.921600=921600 -CoreESP32.menu.UploadSpeed.921600.upload.speed=921600 -CoreESP32.menu.UploadSpeed.115200=115200 -CoreESP32.menu.UploadSpeed.115200.upload.speed=115200 -CoreESP32.menu.UploadSpeed.256000.windows=256000 -CoreESP32.menu.UploadSpeed.256000.upload.speed=256000 -CoreESP32.menu.UploadSpeed.230400.windows.upload.speed=256000 -CoreESP32.menu.UploadSpeed.230400=230400 -CoreESP32.menu.UploadSpeed.230400.upload.speed=230400 -CoreESP32.menu.UploadSpeed.460800.linux=460800 -CoreESP32.menu.UploadSpeed.460800.macosx=460800 -CoreESP32.menu.UploadSpeed.460800.upload.speed=460800 -CoreESP32.menu.UploadSpeed.512000.windows=512000 -CoreESP32.menu.UploadSpeed.512000.upload.speed=512000 - -############################################################## - - -alksesp32.name=ALKS ESP32 - -alksesp32.upload.tool=esptool_py -alksesp32.upload.maximum_size=1310720 -alksesp32.upload.maximum_data_size=327680 -alksesp32.upload.wait_for_upload_port=true - -alksesp32.serial.disableDTR=true -alksesp32.serial.disableRTS=true - -alksesp32.build.mcu=esp32 -alksesp32.build.core=esp32 -alksesp32.build.variant=alksesp32 -alksesp32.build.board=ALKS - -alksesp32.build.f_cpu=240000000L -alksesp32.build.flash_size=4MB -alksesp32.build.flash_freq=40m -alksesp32.build.flash_mode=dio -alksesp32.build.boot=dio -alksesp32.build.partitions=default -alksesp32.build.defines= - -alksesp32.menu.PSRAM.disabled=Disabled -alksesp32.menu.PSRAM.disabled.build.defines= -alksesp32.menu.PSRAM.enabled=Enabled -alksesp32.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue - -alksesp32.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) -alksesp32.menu.PartitionScheme.default.build.partitions=default -alksesp32.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) -alksesp32.menu.PartitionScheme.defaultffat.build.partitions=default_ffat -alksesp32.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS) -alksesp32.menu.PartitionScheme.minimal.build.partitions=minimal -alksesp32.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS) -alksesp32.menu.PartitionScheme.no_ota.build.partitions=no_ota -alksesp32.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -alksesp32.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS) -alksesp32.menu.PartitionScheme.noota_3g.build.partitions=noota_3g -alksesp32.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576 -alksesp32.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS) -alksesp32.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat -alksesp32.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152 -alksesp32.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS) -alksesp32.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat -alksesp32.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576 -alksesp32.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS) -alksesp32.menu.PartitionScheme.huge_app.build.partitions=huge_app -alksesp32.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 -alksesp32.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) -alksesp32.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -alksesp32.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 -alksesp32.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FAT) -alksesp32.menu.PartitionScheme.fatflash.build.partitions=ffat - -alksesp32.menu.CPUFreq.240=240MHz (WiFi/BT) -alksesp32.menu.CPUFreq.240.build.f_cpu=240000000L -alksesp32.menu.CPUFreq.160=160MHz (WiFi/BT) -alksesp32.menu.CPUFreq.160.build.f_cpu=160000000L -alksesp32.menu.CPUFreq.80=80MHz (WiFi/BT) -alksesp32.menu.CPUFreq.80.build.f_cpu=80000000L -alksesp32.menu.CPUFreq.40=40MHz (40MHz XTAL) -alksesp32.menu.CPUFreq.40.build.f_cpu=40000000L -alksesp32.menu.CPUFreq.26=26MHz (26MHz XTAL) -alksesp32.menu.CPUFreq.26.build.f_cpu=26000000L -alksesp32.menu.CPUFreq.20=20MHz (40MHz XTAL) -alksesp32.menu.CPUFreq.20.build.f_cpu=20000000L -alksesp32.menu.CPUFreq.13=13MHz (26MHz XTAL) -alksesp32.menu.CPUFreq.13.build.f_cpu=13000000L -alksesp32.menu.CPUFreq.10=10MHz (40MHz XTAL) -alksesp32.menu.CPUFreq.10.build.f_cpu=10000000L - -alksesp32.menu.FlashMode.qio=QIO -alksesp32.menu.FlashMode.qio.build.flash_mode=dio -alksesp32.menu.FlashMode.qio.build.boot=qio -alksesp32.menu.FlashMode.dio=DIO -alksesp32.menu.FlashMode.dio.build.flash_mode=dio -alksesp32.menu.FlashMode.dio.build.boot=dio -alksesp32.menu.FlashMode.qout=QOUT -alksesp32.menu.FlashMode.qout.build.flash_mode=dout -alksesp32.menu.FlashMode.qout.build.boot=qout -alksesp32.menu.FlashMode.dout=DOUT -alksesp32.menu.FlashMode.dout.build.flash_mode=dout -alksesp32.menu.FlashMode.dout.build.boot=dout - -alksesp32.menu.FlashFreq.80=80MHz -alksesp32.menu.FlashFreq.80.build.flash_freq=80m -alksesp32.menu.FlashFreq.40=40MHz -alksesp32.menu.FlashFreq.40.build.flash_freq=40m - -alksesp32.menu.FlashSize.4M=4MB (32Mb) -alksesp32.menu.FlashSize.4M.build.flash_size=4MB -alksesp32.menu.FlashSize.2M=2MB (16Mb) -alksesp32.menu.FlashSize.2M.build.flash_size=2MB -alksesp32.menu.FlashSize.2M.build.partitions=minimal -alksesp32.menu.FlashSize.16M=16MB (128Mb) -alksesp32.menu.FlashSize.16M.build.flash_size=16MB -alksesp32.menu.FlashSize.16M.build.partitions=ffat - -alksesp32.menu.UploadSpeed.921600=921600 -alksesp32.menu.UploadSpeed.921600.upload.speed=921600 -alksesp32.menu.UploadSpeed.115200=115200 -alksesp32.menu.UploadSpeed.115200.upload.speed=115200 -alksesp32.menu.UploadSpeed.256000.windows=256000 -alksesp32.menu.UploadSpeed.256000.upload.speed=256000 -alksesp32.menu.UploadSpeed.230400.windows.upload.speed=256000 -alksesp32.menu.UploadSpeed.230400=230400 -alksesp32.menu.UploadSpeed.230400.upload.speed=230400 -alksesp32.menu.UploadSpeed.460800.linux=460800 -alksesp32.menu.UploadSpeed.460800.macosx=460800 -alksesp32.menu.UploadSpeed.460800.upload.speed=460800 -alksesp32.menu.UploadSpeed.512000.windows=512000 -alksesp32.menu.UploadSpeed.512000.upload.speed=512000 - -alksesp32.menu.DebugLevel.none=None -alksesp32.menu.DebugLevel.none.build.code_debug=0 -alksesp32.menu.DebugLevel.error=Error -alksesp32.menu.DebugLevel.error.build.code_debug=1 -alksesp32.menu.DebugLevel.warn=Warn -alksesp32.menu.DebugLevel.warn.build.code_debug=2 -alksesp32.menu.DebugLevel.info=Info -alksesp32.menu.DebugLevel.info.build.code_debug=3 -alksesp32.menu.DebugLevel.debug=Debug -alksesp32.menu.DebugLevel.debug.build.code_debug=4 -alksesp32.menu.DebugLevel.verbose=Verbose -alksesp32.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - - -wipy3.name=WiPy 3.0 - -wipy3.upload.tool=esptool_py -wipy3.upload.maximum_size=1310720 -wipy3.upload.maximum_data_size=294912 -wipy3.upload.wait_for_upload_port=true - -wipy3.serial.disableDTR=true -wipy3.serial.disableRTS=true - -wipy3.build.mcu=esp32 -wipy3.build.core=esp32 -wipy3.build.variant=wipy3 -wipy3.build.board=WIPY3 - -wipy3.build.f_cpu=240000000L -wipy3.build.flash_mode=dio -wipy3.build.flash_size=8MB -wipy3.build.boot=dio -wipy3.build.partitions=default -wipy3.build.defines= - -wipy3.menu.FlashFreq.80=80MHz -wipy3.menu.FlashFreq.80.build.flash_freq=80m -wipy3.menu.FlashFreq.40=40MHz -wipy3.menu.FlashFreq.40.build.flash_freq=40m - -wipy3.menu.UploadSpeed.921600=921600 -wipy3.menu.UploadSpeed.921600.upload.speed=921600 -wipy3.menu.UploadSpeed.115200=115200 -wipy3.menu.UploadSpeed.115200.upload.speed=115200 -wipy3.menu.UploadSpeed.256000.windows=256000 -wipy3.menu.UploadSpeed.256000.upload.speed=256000 -wipy3.menu.UploadSpeed.230400.windows.upload.speed=256000 -wipy3.menu.UploadSpeed.230400=230400 -wipy3.menu.UploadSpeed.230400.upload.speed=230400 -wipy3.menu.UploadSpeed.460800.linux=460800 -wipy3.menu.UploadSpeed.460800.macosx=460800 -wipy3.menu.UploadSpeed.460800.upload.speed=460800 -wipy3.menu.UploadSpeed.512000.windows=512000 -wipy3.menu.UploadSpeed.512000.upload.speed=512000 - -wipy3.menu.DebugLevel.none=None -wipy3.menu.DebugLevel.none.build.code_debug=0 -wipy3.menu.DebugLevel.error=Error -wipy3.menu.DebugLevel.error.build.code_debug=1 -wipy3.menu.DebugLevel.warn=Warn -wipy3.menu.DebugLevel.warn.build.code_debug=2 -wipy3.menu.DebugLevel.info=Info -wipy3.menu.DebugLevel.info.build.code_debug=3 -wipy3.menu.DebugLevel.debug=Debug -wipy3.menu.DebugLevel.debug.build.code_debug=4 -wipy3.menu.DebugLevel.verbose=Verbose -wipy3.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - -bpi-bit.name=BPI-BIT - -bpi-bit.upload.tool=esptool_py -bpi-bit.upload.maximum_size=1310720 -bpi-bit.upload.maximum_data_size=294912 -bpi-bit.upload.wait_for_upload_port=true - -bpi-bit.serial.disableDTR=true -bpi-bit.serial.disableRTS=true - -bpi-bit.build.mcu=esp32 -bpi-bit.build.core=esp32 -bpi-bit.build.variant=bpi-bit -bpi-bit.build.board=BPI-BIT - -bpi-bit.build.f_cpu=160000000L -bpi-bit.build.flash_mode=dio -bpi-bit.build.flash_size=4MB -bpi-bit.build.boot=dio -bpi-bit.build.partitions=default - -bpi-bit.menu.FlashFreq.80=80MHz -bpi-bit.menu.FlashFreq.80.build.flash_freq=80m -bpi-bit.menu.FlashFreq.40=40MHz -bpi-bit.menu.FlashFreq.40.build.flash_freq=40m - -bpi-bit.menu.UploadSpeed.921600=921600 -bpi-bit.menu.UploadSpeed.921600.upload.speed=921600 -bpi-bit.menu.UploadSpeed.115200=115200 -bpi-bit.menu.UploadSpeed.115200.upload.speed=115200 -bpi-bit.menu.UploadSpeed.256000.windows=256000 -bpi-bit.menu.UploadSpeed.256000.upload.speed=256000 -bpi-bit.menu.UploadSpeed.230400.windows.upload.speed=256000 -bpi-bit.menu.UploadSpeed.230400=230400 -bpi-bit.menu.UploadSpeed.230400.upload.speed=230400 -bpi-bit.menu.UploadSpeed.460800.linux=460800 -bpi-bit.menu.UploadSpeed.460800.macosx=460800 -bpi-bit.menu.UploadSpeed.460800.upload.speed=460800 -bpi-bit.menu.UploadSpeed.512000.windows=512000 -bpi-bit.menu.UploadSpeed.512000.upload.speed=512000 - -############################################################## - -wesp32.name=Silicognition wESP32 - -wesp32.upload.tool=esptool_py -wesp32.upload.maximum_size=1310720 -wesp32.upload.maximum_data_size=327680 -wesp32.upload.wait_for_upload_port=true - -wesp32.serial.disableDTR=true -wesp32.serial.disableRTS=true - -wesp32.build.mcu=esp32 -wesp32.build.core=esp32 -wesp32.build.variant=wesp32 -wesp32.build.board=WESP32 - -wesp32.build.f_cpu=240000000L -wesp32.build.flash_mode=dio -wesp32.build.flash_size=4MB -wesp32.build.boot=dio -wesp32.build.partitions=default -wesp32.build.defines= - -wesp32.menu.FlashFreq.80=80MHz -wesp32.menu.FlashFreq.80.build.flash_freq=80m -wesp32.menu.FlashFreq.40=40MHz -wesp32.menu.FlashFreq.40.build.flash_freq=40m - -wesp32.menu.UploadSpeed.921600=921600 -wesp32.menu.UploadSpeed.921600.upload.speed=921600 -wesp32.menu.UploadSpeed.115200=115200 -wesp32.menu.UploadSpeed.115200.upload.speed=115200 -wesp32.menu.UploadSpeed.256000.windows=256000 -wesp32.menu.UploadSpeed.256000.upload.speed=256000 -wesp32.menu.UploadSpeed.230400.windows.upload.speed=256000 -wesp32.menu.UploadSpeed.230400=230400 -wesp32.menu.UploadSpeed.230400.upload.speed=230400 -wesp32.menu.UploadSpeed.460800.linux=460800 -wesp32.menu.UploadSpeed.460800.macosx=460800 -wesp32.menu.UploadSpeed.460800.upload.speed=460800 -wesp32.menu.UploadSpeed.512000.windows=512000 -wesp32.menu.UploadSpeed.512000.upload.speed=512000 - -wesp32.menu.DebugLevel.none=None -wesp32.menu.DebugLevel.none.build.code_debug=0 -wesp32.menu.DebugLevel.error=Error -wesp32.menu.DebugLevel.error.build.code_debug=1 -wesp32.menu.DebugLevel.warn=Warn -wesp32.menu.DebugLevel.warn.build.code_debug=2 -wesp32.menu.DebugLevel.info=Info -wesp32.menu.DebugLevel.info.build.code_debug=3 -wesp32.menu.DebugLevel.debug=Debug -wesp32.menu.DebugLevel.debug.build.code_debug=4 -wesp32.menu.DebugLevel.verbose=Verbose -wesp32.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - -t-beam.name=T-Beam - -t-beam.upload.tool=esptool_py -t-beam.upload.maximum_size=1310720 -t-beam.upload.maximum_data_size=327680 -t-beam.upload.wait_for_upload_port=true - -t-beam.serial.disableDTR=true -t-beam.serial.disableRTS=true - -t-beam.build.mcu=esp32 -t-beam.build.core=esp32 -t-beam.build.variant=t-beam -t-beam.build.board=T-Beam - -t-beam.build.f_cpu=240000000L -t-beam.build.flash_mode=dio -t-beam.build.flash_size=4MB -t-beam.build.boot=dio -t-beam.build.partitions=default - -t-beam.menu.PSRAM.disabled=Disabled -t-beam.menu.PSRAM.disabled.build.defines= -t-beam.menu.PSRAM.enabled=Enabled -t-beam.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue - -t-beam.menu.FlashFreq.80=80MHz -t-beam.menu.FlashFreq.80.build.flash_freq=80m -t-beam.menu.FlashFreq.40=40MHz -t-beam.menu.FlashFreq.40.build.flash_freq=40m - -t-beam.menu.UploadSpeed.921600=921600 -t-beam.menu.UploadSpeed.921600.upload.speed=921600 -t-beam.menu.UploadSpeed.115200=115200 -t-beam.menu.UploadSpeed.115200.upload.speed=115200 -t-beam.menu.UploadSpeed.256000.windows=256000 -t-beam.menu.UploadSpeed.256000.upload.speed=256000 -t-beam.menu.UploadSpeed.230400.windows.upload.speed=256000 -t-beam.menu.UploadSpeed.230400=230400 -t-beam.menu.UploadSpeed.230400.upload.speed=230400 -t-beam.menu.UploadSpeed.460800.linux=460800 -t-beam.menu.UploadSpeed.460800.macosx=460800 -t-beam.menu.UploadSpeed.460800.upload.speed=460800 -t-beam.menu.UploadSpeed.512000.windows=512000 -t-beam.menu.UploadSpeed.512000.upload.speed=512000 - -t-beam.menu.DebugLevel.none=None -t-beam.menu.DebugLevel.none.build.code_debug=0 -t-beam.menu.DebugLevel.error=Error -t-beam.menu.DebugLevel.error.build.code_debug=1 -t-beam.menu.DebugLevel.warn=Warn -t-beam.menu.DebugLevel.warn.build.code_debug=2 -t-beam.menu.DebugLevel.info=Info -t-beam.menu.DebugLevel.info.build.code_debug=3 -t-beam.menu.DebugLevel.debug=Debug -t-beam.menu.DebugLevel.debug.build.code_debug=4 -t-beam.menu.DebugLevel.verbose=Verbose -t-beam.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - -d-duino-32.name=D-duino-32 - -d-duino-32.upload.tool=esptool_py -d-duino-32.upload.maximum_size=1310720 -d-duino-32.upload.maximum_data_size=327680 -d-duino-32.upload.wait_for_upload_port=true - -d-duino-32.serial.disableDTR=true -d-duino-32.serial.disableRTS=true - -d-duino-32.build.mcu=esp32 -d-duino-32.build.core=esp32 -d-duino-32.build.variant=d-duino-32 -d-duino-32.build.board=D-duino-32 - -d-duino-32.build.f_cpu=240000000L -d-duino-32.build.flash_size=4MB -d-duino-32.build.flash_freq=40m -d-duino-32.build.flash_mode=dio -d-duino-32.build.boot=dio -d-duino-32.build.partitions=default -d-duino-32.build.defines= - -d-duino-32.menu.PartitionScheme.default=Default -d-duino-32.menu.PartitionScheme.default.build.partitions=default -d-duino-32.menu.PartitionScheme.minimal=Minimal (2MB FLASH) -d-duino-32.menu.PartitionScheme.minimal.build.partitions=minimal -d-duino-32.menu.PartitionScheme.no_ota=No OTA (Large APP) -d-duino-32.menu.PartitionScheme.no_ota.build.partitions=no_ota -d-duino-32.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -d-duino-32.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -d-duino-32.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -d-duino-32.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 -d-duino-32.menu.PartitionScheme.fatflash=16M Fat -d-duino-32.menu.PartitionScheme.fatflash.build.partitions=ffat - -d-duino-32.menu.FlashFreq.80=80MHz -d-duino-32.menu.FlashFreq.80.build.flash_freq=80m -d-duino-32.menu.FlashFreq.40=40MHz -d-duino-32.menu.FlashFreq.40.build.flash_freq=40m - -d-duino-32.menu.UploadSpeed.921600=921600 -d-duino-32.menu.UploadSpeed.921600.upload.speed=921600 -d-duino-32.menu.UploadSpeed.115200=115200 -d-duino-32.menu.UploadSpeed.115200.upload.speed=115200 -d-duino-32.menu.UploadSpeed.256000.windows=256000 -d-duino-32.menu.UploadSpeed.256000.upload.speed=256000 -d-duino-32.menu.UploadSpeed.230400.windows.upload.speed=256000 -d-duino-32.menu.UploadSpeed.230400=230400 -d-duino-32.menu.UploadSpeed.230400.upload.speed=230400 -d-duino-32.menu.UploadSpeed.460800.linux=460800 -d-duino-32.menu.UploadSpeed.460800.macosx=460800 -d-duino-32.menu.UploadSpeed.460800.upload.speed=460800 -d-duino-32.menu.UploadSpeed.512000.windows=512000 -d-duino-32.menu.UploadSpeed.512000.upload.speed=512000 - -d-duino-32.menu.DebugLevel.none=None -d-duino-32.menu.DebugLevel.none.build.code_debug=0 -d-duino-32.menu.DebugLevel.error=Error -d-duino-32.menu.DebugLevel.error.build.code_debug=1 -d-duino-32.menu.DebugLevel.warn=Warn -d-duino-32.menu.DebugLevel.warn.build.code_debug=2 -d-duino-32.menu.DebugLevel.info=Info -d-duino-32.menu.DebugLevel.info.build.code_debug=3 -d-duino-32.menu.DebugLevel.debug=Debug -d-duino-32.menu.DebugLevel.debug.build.code_debug=4 -d-duino-32.menu.DebugLevel.verbose=Verbose -d-duino-32.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - -lopy.name=LoPy - -lopy.upload.tool=esptool_py -lopy.upload.maximum_size=1310720 -lopy.upload.maximum_data_size=327680 -lopy.upload.wait_for_upload_port=true - -lopy.serial.disableDTR=true -lopy.serial.disableRTS=true - -lopy.build.mcu=esp32 -lopy.build.core=esp32 -lopy.build.variant=lopy -lopy.build.board=LoPy - -lopy.build.f_cpu=240000000L -lopy.build.flash_mode=dio -lopy.build.flash_size=4MB -lopy.build.boot=dio -lopy.build.partitions=default - -lopy.menu.FlashFreq.80=80MHz -lopy.menu.FlashFreq.80.build.flash_freq=80m -lopy.menu.FlashFreq.40=40MHz -lopy.menu.FlashFreq.40.build.flash_freq=40m - -lopy.menu.UploadSpeed.921600=921600 -lopy.menu.UploadSpeed.921600.upload.speed=921600 -lopy.menu.UploadSpeed.115200=115200 -lopy.menu.UploadSpeed.115200.upload.speed=115200 -lopy.menu.UploadSpeed.256000.windows=256000 -lopy.menu.UploadSpeed.256000.upload.speed=256000 -lopy.menu.UploadSpeed.230400.windows.upload.speed=256000 -lopy.menu.UploadSpeed.230400=230400 -lopy.menu.UploadSpeed.230400.upload.speed=230400 -lopy.menu.UploadSpeed.460800.linux=460800 -lopy.menu.UploadSpeed.460800.macosx=460800 -lopy.menu.UploadSpeed.460800.upload.speed=460800 -lopy.menu.UploadSpeed.512000.windows=512000 -lopy.menu.UploadSpeed.512000.upload.speed=512000 - -lopy.menu.DebugLevel.none=None -lopy.menu.DebugLevel.none.build.code_debug=0 -lopy.menu.DebugLevel.error=Error -lopy.menu.DebugLevel.error.build.code_debug=1 -lopy.menu.DebugLevel.warn=Warn -lopy.menu.DebugLevel.warn.build.code_debug=2 -lopy.menu.DebugLevel.info=Info -lopy.menu.DebugLevel.info.build.code_debug=3 -lopy.menu.DebugLevel.debug=Debug -lopy.menu.DebugLevel.debug.build.code_debug=4 -lopy.menu.DebugLevel.verbose=Verbose -lopy.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - -lopy4.name=LoPy4 - -lopy4.upload.tool=esptool_py -lopy4.upload.maximum_size=1310720 -lopy4.upload.maximum_data_size=327680 -lopy4.upload.wait_for_upload_port=true - -lopy4.serial.disableDTR=true -lopy4.serial.disableRTS=true - -lopy4.build.mcu=esp32 -lopy4.build.core=esp32 -lopy4.build.variant=lopy4 -lopy4.build.board=LoPy4 - -lopy4.build.f_cpu=240000000L -lopy4.build.flash_mode=dio -lopy4.build.flash_size=4MB -lopy4.build.boot=dio -lopy4.build.partitions=default - -lopy4.menu.PSRAM.disabled=Disabled -lopy4.menu.PSRAM.disabled.build.defines= -lopy4.menu.PSRAM.enabled=Enabled -lopy4.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue - -lopy4.menu.FlashFreq.80=80MHz -lopy4.menu.FlashFreq.80.build.flash_freq=80m -lopy4.menu.FlashFreq.40=40MHz -lopy4.menu.FlashFreq.40.build.flash_freq=40m - -lopy4.menu.UploadSpeed.921600=921600 -lopy4.menu.UploadSpeed.921600.upload.speed=921600 -lopy4.menu.UploadSpeed.115200=115200 -lopy4.menu.UploadSpeed.115200.upload.speed=115200 -lopy4.menu.UploadSpeed.256000.windows=256000 -lopy4.menu.UploadSpeed.256000.upload.speed=256000 -lopy4.menu.UploadSpeed.230400.windows.upload.speed=256000 -lopy4.menu.UploadSpeed.230400=230400 -lopy4.menu.UploadSpeed.230400.upload.speed=230400 -lopy4.menu.UploadSpeed.460800.linux=460800 -lopy4.menu.UploadSpeed.460800.macosx=460800 -lopy4.menu.UploadSpeed.460800.upload.speed=460800 -lopy4.menu.UploadSpeed.512000.windows=512000 -lopy4.menu.UploadSpeed.512000.upload.speed=512000 - -lopy4.menu.DebugLevel.none=None -lopy4.menu.DebugLevel.none.build.code_debug=0 -lopy4.menu.DebugLevel.error=Error -lopy4.menu.DebugLevel.error.build.code_debug=1 -lopy4.menu.DebugLevel.warn=Warn -lopy4.menu.DebugLevel.warn.build.code_debug=2 -lopy4.menu.DebugLevel.info=Info -lopy4.menu.DebugLevel.info.build.code_debug=3 -lopy4.menu.DebugLevel.debug=Debug -lopy4.menu.DebugLevel.debug.build.code_debug=4 -lopy4.menu.DebugLevel.verbose=Verbose -lopy4.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - -oroca_edubot.name=OROCA EduBot - -oroca_edubot.upload.tool=esptool_py -oroca_edubot.upload.maximum_size=3145728 -oroca_edubot.upload.maximum_data_size=327680 -oroca_edubot.upload.wait_for_upload_port=true - -oroca_edubot.serial.disableDTR=true -oroca_edubot.serial.disableRTS=true - -oroca_edubot.build.mcu=esp32 -oroca_edubot.build.core=esp32 -oroca_edubot.build.variant=oroca_edubot -oroca_edubot.build.board=OROCA_EDUBOT - -oroca_edubot.build.f_cpu=240000000L -oroca_edubot.build.flash_mode=dio -oroca_edubot.build.flash_size=4MB -oroca_edubot.build.boot=dio -oroca_edubot.build.partitions=huge_app -oroca_edubot.build.defines= - -oroca_edubot.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA) -oroca_edubot.menu.PartitionScheme.huge_app.build.partitions=huge_app -oroca_edubot.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 -oroca_edubot.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -oroca_edubot.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -oroca_edubot.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 - -oroca_edubot.menu.FlashFreq.80=80MHz -oroca_edubot.menu.FlashFreq.80.build.flash_freq=80m -oroca_edubot.menu.FlashFreq.40=40MHz -oroca_edubot.menu.FlashFreq.40.build.flash_freq=40m - -oroca_edubot.menu.UploadSpeed.921600=921600 -oroca_edubot.menu.UploadSpeed.921600.upload.speed=921600 -oroca_edubot.menu.UploadSpeed.115200=115200 -oroca_edubot.menu.UploadSpeed.115200.upload.speed=115200 -oroca_edubot.menu.UploadSpeed.256000.windows=256000 -oroca_edubot.menu.UploadSpeed.256000.upload.speed=256000 -oroca_edubot.menu.UploadSpeed.230400.windows.upload.speed=256000 -oroca_edubot.menu.UploadSpeed.230400=230400 -oroca_edubot.menu.UploadSpeed.230400.upload.speed=230400 -oroca_edubot.menu.UploadSpeed.460800.linux=460800 -oroca_edubot.menu.UploadSpeed.460800.macosx=460800 -oroca_edubot.menu.UploadSpeed.460800.upload.speed=460800 -oroca_edubot.menu.UploadSpeed.512000.windows=512000 -oroca_edubot.menu.UploadSpeed.512000.upload.speed=512000 - -oroca_edubot.menu.DebugLevel.none=None -oroca_edubot.menu.DebugLevel.none.build.code_debug=0 -oroca_edubot.menu.DebugLevel.error=Error -oroca_edubot.menu.DebugLevel.error.build.code_debug=1 -oroca_edubot.menu.DebugLevel.warn=Warn -oroca_edubot.menu.DebugLevel.warn.build.code_debug=2 -oroca_edubot.menu.DebugLevel.info=Info -oroca_edubot.menu.DebugLevel.info.build.code_debug=3 -oroca_edubot.menu.DebugLevel.debug=Debug -oroca_edubot.menu.DebugLevel.debug.build.code_debug=4 -oroca_edubot.menu.DebugLevel.verbose=Verbose -oroca_edubot.menu.DebugLevel.verbose.build.code_debug=5 - - - -############################################################## - -fm-devkit.name=ESP32 FM DevKit - -fm-devkit.upload.tool=esptool -fm-devkit.upload.maximum_size=1310720 -fm-devkit.upload.maximum_data_size=327680 -fm-devkit.upload.wait_for_upload_port=true - -fm-devkit.serial.disableDTR=true -fm-devkit.serial.disableRTS=true - -fm-devkit.build.mcu=esp32 -fm-devkit.build.core=esp32 -fm-devkit.build.variant=fm-devkit -fm-devkit.build.board=fm-devkit - -fm-devkit.build.f_cpu=240000000L -fm-devkit.build.flash_size=4MB -fm-devkit.build.flash_freq=80m -fm-devkit.build.flash_mode=dio -fm-devkit.build.boot=dio -fm-devkit.build.partitions=default -fm-devkit.build.defines= - -fm-devkit.menu.UploadSpeed.921600=921600 -fm-devkit.menu.UploadSpeed.921600.upload.speed=921600 -fm-devkit.menu.UploadSpeed.115200=115200 -fm-devkit.menu.UploadSpeed.115200.upload.speed=115200 -fm-devkit.menu.UploadSpeed.256000.windows=256000 -fm-devkit.menu.UploadSpeed.256000.upload.speed=256000 -fm-devkit.menu.UploadSpeed.230400.windows.upload.speed=256000 -fm-devkit.menu.UploadSpeed.230400=230400 -fm-devkit.menu.UploadSpeed.230400.upload.speed=230400 -fm-devkit.menu.UploadSpeed.460800.linux=460800 -fm-devkit.menu.UploadSpeed.460800.macosx=460800 -fm-devkit.menu.UploadSpeed.460800.upload.speed=460800 -fm-devkit.menu.UploadSpeed.512000.windows=512000 -fm-devkit.menu.UploadSpeed.512000.upload.speed=512000 - -fm-devkit.menu.DebugLevel.none=None -fm-devkit.menu.DebugLevel.none.build.code_debug=0 -fm-devkit.menu.DebugLevel.error=Error -fm-devkit.menu.DebugLevel.error.build.code_debug=1 -fm-devkit.menu.DebugLevel.warn=Warn -fm-devkit.menu.DebugLevel.warn.build.code_debug=2 -fm-devkit.menu.DebugLevel.info=Info -fm-devkit.menu.DebugLevel.info.build.code_debug=3 -fm-devkit.menu.DebugLevel.debug=Debug -fm-devkit.menu.DebugLevel.debug.build.code_debug=4 -fm-devkit.menu.DebugLevel.verbose=Verbose -fm-devkit.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - -frogboard.name=Frog Board ESP32 - -frogboard.upload.tool=esptool_py -frogboard.upload.maximum_size=1310720 -frogboard.upload.maximum_data_size=327680 -frogboard.upload.wait_for_upload_port=true - -frogboard.serial.disableDTR=true -frogboard.serial.disableRTS=true - -frogboard.build.mcu=esp32 -frogboard.build.core=esp32 -frogboard.build.variant=frog32 -frogboard.build.board=FROG_ESP32 -frogboard.build.f_cpu=240000000L -frogboard.build.flash_size=4MB -frogboard.build.flash_freq=40m -frogboard.build.flash_mode=dio -frogboard.build.boot=dio -frogboard.build.partitions=default -frogboard.build.defines= - -frogboard.menu.PSRAM.disabled=Disabled -frogboard.menu.PSRAM.disabled.build.defines= -frogboard.menu.PSRAM.enabled=Enabled -frogboard.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue - -frogboard.menu.PartitionScheme.default=Default -frogboard.menu.PartitionScheme.default.build.partitions=default -frogboard.menu.PartitionScheme.minimal=Minimal (2MB FLASH) -frogboard.menu.PartitionScheme.minimal.build.partitions=minimal -frogboard.menu.PartitionScheme.no_ota=No OTA (Large APP) -frogboard.menu.PartitionScheme.no_ota.build.partitions=no_ota -frogboard.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -frogboard.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -frogboard.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -frogboard.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 - -frogboard.menu.FlashMode.qio=QIO -frogboard.menu.FlashMode.qio.build.flash_mode=dio -frogboard.menu.FlashMode.qio.build.boot=qio -frogboard.menu.FlashMode.dio=DIO -frogboard.menu.FlashMode.dio.build.flash_mode=dio -frogboard.menu.FlashMode.dio.build.boot=dio -frogboard.menu.FlashMode.qout=QOUT -frogboard.menu.FlashMode.qout.build.flash_mode=dout -frogboard.menu.FlashMode.qout.build.boot=qout -frogboard.menu.FlashMode.dout=DOUT -frogboard.menu.FlashMode.dout.build.flash_mode=dout -frogboard.menu.FlashMode.dout.build.boot=dout -frogboard.menu.FlashFreq.80=80MHz -frogboard.menu.FlashFreq.80.build.flash_freq=80m -frogboard.menu.FlashFreq.40=40MHz -frogboard.menu.FlashFreq.40.build.flash_freq=40m -frogboard.menu.FlashSize.4M=4MB (32Mb) -frogboard.menu.FlashSize.4M.build.flash_size=4MB -frogboard.menu.FlashSize.2M=2MB (16Mb) -frogboard.menu.FlashSize.2M.build.flash_size=2MB -frogboard.menu.FlashSize.2M.build.partitions=minimal - -frogboard.menu.UploadSpeed.921600=921600 -frogboard.menu.UploadSpeed.921600.upload.speed=921600 -frogboard.menu.UploadSpeed.115200=115200 -frogboard.menu.UploadSpeed.115200.upload.speed=115200 -frogboard.menu.UploadSpeed.256000.windows=256000 -frogboard.menu.UploadSpeed.256000.upload.speed=256000 -frogboard.menu.UploadSpeed.230400.windows.upload.speed=256000 -frogboard.menu.UploadSpeed.230400=230400 -frogboard.menu.UploadSpeed.230400.upload.speed=230400 -frogboard.menu.UploadSpeed.460800.linux=460800 -frogboard.menu.UploadSpeed.460800.macosx=460800 -frogboard.menu.UploadSpeed.460800.upload.speed=460800 -frogboard.menu.UploadSpeed.512000.windows=512000 -frogboard.menu.UploadSpeed.512000.upload.speed=512000 - -frogboard.menu.DebugLevel.none=None -frogboard.menu.DebugLevel.none.build.code_debug=0 -frogboard.menu.DebugLevel.error=Error -frogboard.menu.DebugLevel.error.build.code_debug=1 -frogboard.menu.DebugLevel.warn=Warn -frogboard.menu.DebugLevel.warn.build.code_debug=2 -frogboard.menu.DebugLevel.info=Info -frogboard.menu.DebugLevel.info.build.code_debug=3 -frogboard.menu.DebugLevel.debug=Debug -frogboard.menu.DebugLevel.debug.build.code_debug=4 -frogboard.menu.DebugLevel.verbose=Verbose -frogboard.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - -esp32cam.name=AI Thinker ESP32-CAM - -esp32cam.upload.tool=esptool_py -esp32cam.upload.maximum_size=3145728 -esp32cam.upload.maximum_data_size=327680 -esp32cam.upload.wait_for_upload_port=true -esp32cam.upload.speed=460800 - -esp32cam.serial.disableDTR=true -esp32cam.serial.disableRTS=true - -esp32cam.build.mcu=esp32 -esp32cam.build.core=esp32 -esp32cam.build.variant=esp32 -esp32cam.build.board=ESP32_DEV -esp32cam.build.f_cpu=240000000L -esp32cam.build.flash_size=4MB -esp32cam.build.flash_freq=80m -esp32cam.build.flash_mode=dio -esp32cam.build.boot=qio -esp32cam.build.partitions=huge_app -esp32cam.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -esp32cam.build.code_debug=0 - -############################################################## - -sparkfun_lora_gateway_1-channel.name=SparkFun LoRa Gateway 1-Channel - -sparkfun_lora_gateway_1-channel.upload.tool=esptool_py -sparkfun_lora_gateway_1-channel.upload.maximum_size=1310720 -sparkfun_lora_gateway_1-channel.upload.maximum_data_size=294912 -sparkfun_lora_gateway_1-channel.upload.wait_for_upload_port=true - -sparkfun_lora_gateway_1-channel.serial.disableDTR=true -sparkfun_lora_gateway_1-channel.serial.disableRTS=true - -sparkfun_lora_gateway_1-channel.build.mcu=esp32 -sparkfun_lora_gateway_1-channel.build.core=esp32 -sparkfun_lora_gateway_1-channel.build.variant=sparkfun_lora_gateway_1-channel -sparkfun_lora_gateway_1-channel.build.board=ESP32_DEV - -sparkfun_lora_gateway_1-channel.build.f_cpu=240000000L -sparkfun_lora_gateway_1-channel.build.flash_size=4MB -sparkfun_lora_gateway_1-channel.build.flash_freq=40m -sparkfun_lora_gateway_1-channel.build.flash_mode=dio -sparkfun_lora_gateway_1-channel.build.boot=dio -sparkfun_lora_gateway_1-channel.build.partitions=default - -sparkfun_lora_gateway_1-channel.menu.PartitionScheme.default=Default -sparkfun_lora_gateway_1-channel.menu.PartitionScheme.default.build.partitions=default -sparkfun_lora_gateway_1-channel.menu.PartitionScheme.minimal=Minimal (2MB FLASH) -sparkfun_lora_gateway_1-channel.menu.PartitionScheme.minimal.build.partitions=minimal -sparkfun_lora_gateway_1-channel.menu.PartitionScheme.no_ota=No OTA (Large APP) -sparkfun_lora_gateway_1-channel.menu.PartitionScheme.no_ota.build.partitions=no_ota -sparkfun_lora_gateway_1-channel.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -sparkfun_lora_gateway_1-channel.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -sparkfun_lora_gateway_1-channel.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -sparkfun_lora_gateway_1-channel.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 - -sparkfun_lora_gateway_1-channel.menu.FlashMode.qio=QIO -sparkfun_lora_gateway_1-channel.menu.FlashMode.qio.build.flash_mode=dio -sparkfun_lora_gateway_1-channel.menu.FlashMode.qio.build.boot=qio -sparkfun_lora_gateway_1-channel.menu.FlashMode.dio=DIO -sparkfun_lora_gateway_1-channel.menu.FlashMode.dio.build.flash_mode=dio -sparkfun_lora_gateway_1-channel.menu.FlashMode.dio.build.boot=dio -sparkfun_lora_gateway_1-channel.menu.FlashMode.qout=QOUT -sparkfun_lora_gateway_1-channel.menu.FlashMode.qout.build.flash_mode=dout -sparkfun_lora_gateway_1-channel.menu.FlashMode.qout.build.boot=qout -sparkfun_lora_gateway_1-channel.menu.FlashMode.dout=DOUT -sparkfun_lora_gateway_1-channel.menu.FlashMode.dout.build.flash_mode=dout -sparkfun_lora_gateway_1-channel.menu.FlashMode.dout.build.boot=dout - -sparkfun_lora_gateway_1-channel.menu.FlashFreq.80=80MHz -sparkfun_lora_gateway_1-channel.menu.FlashFreq.80.build.flash_freq=80m -sparkfun_lora_gateway_1-channel.menu.FlashFreq.40=40MHz -sparkfun_lora_gateway_1-channel.menu.FlashFreq.40.build.flash_freq=40m - -sparkfun_lora_gateway_1-channel.menu.FlashSize.4M=4MB (32Mb) -sparkfun_lora_gateway_1-channel.menu.FlashSize.4M.build.flash_size=4MB - -sparkfun_lora_gateway_1-channel.menu.UploadSpeed.921600=921600 -sparkfun_lora_gateway_1-channel.menu.UploadSpeed.921600.upload.speed=921600 -sparkfun_lora_gateway_1-channel.menu.UploadSpeed.115200=115200 -sparkfun_lora_gateway_1-channel.menu.UploadSpeed.115200.upload.speed=115200 -sparkfun_lora_gateway_1-channel.menu.UploadSpeed.256000.windows=256000 -sparkfun_lora_gateway_1-channel.menu.UploadSpeed.256000.upload.speed=256000 -sparkfun_lora_gateway_1-channel.menu.UploadSpeed.230400.windows.upload.speed=256000 -sparkfun_lora_gateway_1-channel.menu.UploadSpeed.230400=230400 -sparkfun_lora_gateway_1-channel.menu.UploadSpeed.230400.upload.speed=230400 -sparkfun_lora_gateway_1-channel.menu.UploadSpeed.460800.linux=460800 -sparkfun_lora_gateway_1-channel.menu.UploadSpeed.460800.macosx=460800 -sparkfun_lora_gateway_1-channel.menu.UploadSpeed.460800.upload.speed=460800 -sparkfun_lora_gateway_1-channel.menu.UploadSpeed.512000.windows=512000 -sparkfun_lora_gateway_1-channel.menu.UploadSpeed.512000.upload.speed=512000 - -############################################################## - -ttgo-t-watch.name=TTGO T-Watch - -ttgo-t-watch.upload.tool=esptool_py -ttgo-t-watch.upload.maximum_size=6553600 -ttgo-t-watch.upload.maximum_data_size=4521984 -ttgo-t-watch.upload.wait_for_upload_port=true - -ttgo-t-watch.serial.disableDTR=true -ttgo-t-watch.serial.disableRTS=true - -ttgo-t-watch.build.mcu=esp32 -ttgo-t-watch.build.core=esp32 -ttgo-t-watch.build.variant=twatch -ttgo-t-watch.build.board=T-Watch - -ttgo-t-watch.build.f_cpu=240000000L -ttgo-t-watch.build.flash_size=16MB -ttgo-t-watch.build.flash_freq=80m -ttgo-t-watch.build.flash_mode=dio -ttgo-t-watch.build.boot=dio -ttgo-t-watch.build.partitions=default_16MB -ttgo-t-watch.build.defines= - -ttgo-t-watch.menu.PSRAM.enabled=Enabled -ttgo-t-watch.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -ttgo-t-watch.menu.PSRAM.disabled=Disabled -ttgo-t-watch.menu.PSRAM.disabled.build.defines= - -ttgo-t-watch.menu.PartitionScheme.default=Default (2 x 6.5 MB app, 3.6 MB SPIFFS) -ttgo-t-watch.menu.PartitionScheme.default.build.partitions=default_16MB -ttgo-t-watch.menu.PartitionScheme.default.upload.maximum_size=6553600 -ttgo-t-watch.menu.PartitionScheme.large_spiffs=Large SPIFFS (7 MB) -ttgo-t-watch.menu.PartitionScheme.large_spiffs.build.partitions=large_spiffs_16MB -ttgo-t-watch.menu.PartitionScheme.large_spiffs.upload.maximum_size=4685824 - -ttgo-t-watch.menu.UploadSpeed.2000000=2000000 -ttgo-t-watch.menu.UploadSpeed.2000000.upload.speed=2000000 -ttgo-t-watch.menu.UploadSpeed.1152000=1152000 -ttgo-t-watch.menu.UploadSpeed.1152000.upload.speed=1152000 -ttgo-t-watch.menu.UploadSpeed.921600=921600 -ttgo-t-watch.menu.UploadSpeed.921600.upload.speed=921600 -ttgo-t-watch.menu.UploadSpeed.115200=115200 -ttgo-t-watch.menu.UploadSpeed.115200.upload.speed=115200 -ttgo-t-watch.menu.UploadSpeed.256000.windows=256000 -ttgo-t-watch.menu.UploadSpeed.256000.upload.speed=256000 -ttgo-t-watch.menu.UploadSpeed.230400.windows.upload.speed=256000 -ttgo-t-watch.menu.UploadSpeed.230400=230400 -ttgo-t-watch.menu.UploadSpeed.230400.upload.speed=230400 -ttgo-t-watch.menu.UploadSpeed.460800.linux=460800 -ttgo-t-watch.menu.UploadSpeed.460800.macosx=460800 -ttgo-t-watch.menu.UploadSpeed.460800.upload.speed=460800 -ttgo-t-watch.menu.UploadSpeed.512000.windows=512000 -ttgo-t-watch.menu.UploadSpeed.512000.upload.speed=512000 - -ttgo-t-watch.menu.DebugLevel.none=None -ttgo-t-watch.menu.DebugLevel.none.build.code_debug=0 -ttgo-t-watch.menu.DebugLevel.error=Error -ttgo-t-watch.menu.DebugLevel.error.build.code_debug=1 -ttgo-t-watch.menu.DebugLevel.warn=Warn -ttgo-t-watch.menu.DebugLevel.warn.build.code_debug=2 -ttgo-t-watch.menu.DebugLevel.info=Info -ttgo-t-watch.menu.DebugLevel.info.build.code_debug=3 -ttgo-t-watch.menu.DebugLevel.debug=Debug -ttgo-t-watch.menu.DebugLevel.debug.build.code_debug=4 -ttgo-t-watch.menu.DebugLevel.verbose=Verbose -ttgo-t-watch.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - -d1_mini32.name=WEMOS D1 MINI ESP32 - -d1_mini32.upload.tool=esptool_py -d1_mini32.upload.maximum_size=1310720 -d1_mini32.upload.maximum_data_size=327680 -d1_mini32.upload.wait_for_upload_port=true - -d1_mini32.serial.disableDTR=true -d1_mini32.serial.disableRTS=true - -d1_mini32.build.mcu=esp32 -d1_mini32.build.core=esp32 -d1_mini32.build.variant=d1_mini32 -d1_mini32.build.board=D1_MINI32 - -d1_mini32.build.f_cpu=240000000L -d1_mini32.build.flash_mode=dio -d1_mini32.build.flash_size=4MB -d1_mini32.build.boot=dio -d1_mini32.build.partitions=default -d1_mini32.build.defines= - -d1_mini32.menu.FlashFreq.80=80MHz -d1_mini32.menu.FlashFreq.80.build.flash_freq=80m -d1_mini32.menu.FlashFreq.40=40MHz -d1_mini32.menu.FlashFreq.40.build.flash_freq=40m - -d1_mini32.menu.PartitionScheme.default=Default -d1_mini32.menu.PartitionScheme.default.build.partitions=default -d1_mini32.menu.PartitionScheme.no_ota=No OTA (Large APP) -d1_mini32.menu.PartitionScheme.no_ota.build.partitions=no_ota -d1_mini32.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -d1_mini32.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) -d1_mini32.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -d1_mini32.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 - -d1_mini32.menu.CPUFreq.240=240MHz (WiFi/BT) -d1_mini32.menu.CPUFreq.240.build.f_cpu=240000000L -d1_mini32.menu.CPUFreq.160=160MHz (WiFi/BT) -d1_mini32.menu.CPUFreq.160.build.f_cpu=160000000L -d1_mini32.menu.CPUFreq.80=80MHz (WiFi/BT) -d1_mini32.menu.CPUFreq.80.build.f_cpu=80000000L -d1_mini32.menu.CPUFreq.40=40MHz (40MHz XTAL) -d1_mini32.menu.CPUFreq.40.build.f_cpu=40000000L -d1_mini32.menu.CPUFreq.26=26MHz (26MHz XTAL) -d1_mini32.menu.CPUFreq.26.build.f_cpu=26000000L -d1_mini32.menu.CPUFreq.20=20MHz (40MHz XTAL) -d1_mini32.menu.CPUFreq.20.build.f_cpu=20000000L -d1_mini32.menu.CPUFreq.13=13MHz (26MHz XTAL) -d1_mini32.menu.CPUFreq.13.build.f_cpu=13000000L -d1_mini32.menu.CPUFreq.10=10MHz (40MHz XTAL) -d1_mini32.menu.CPUFreq.10.build.f_cpu=10000000L - -d1_mini32.menu.UploadSpeed.921600=921600 -d1_mini32.menu.UploadSpeed.921600.upload.speed=921600 -d1_mini32.menu.UploadSpeed.115200=115200 -d1_mini32.menu.UploadSpeed.115200.upload.speed=115200 -d1_mini32.menu.UploadSpeed.256000.windows=256000 -d1_mini32.menu.UploadSpeed.256000.upload.speed=256000 -d1_mini32.menu.UploadSpeed.230400.windows.upload.speed=256000 -d1_mini32.menu.UploadSpeed.230400=230400 -d1_mini32.menu.UploadSpeed.230400.upload.speed=230400 -d1_mini32.menu.UploadSpeed.460800.linux=460800 -d1_mini32.menu.UploadSpeed.460800.macosx=460800 -d1_mini32.menu.UploadSpeed.460800.upload.speed=460800 -d1_mini32.menu.UploadSpeed.512000.windows=512000 -d1_mini32.menu.UploadSpeed.512000.upload.speed=512000 - -############################################################## - -gpy.name=Pycom GPy - -gpy.upload.tool=esptool_py -gpy.upload.maximum_size=1310720 -gpy.upload.maximum_data_size=327680 -gpy.upload.wait_for_upload_port=true - -gpy.serial.disableDTR=true -gpy.serial.disableRTS=true - -gpy.build.mcu=esp32 -gpy.build.core=esp32 -gpy.build.variant=gpy -gpy.build.board=PYCOM_GPY - -gpy.build.f_cpu=240000000L -gpy.build.flash_mode=dio -gpy.build.flash_size=8MB -gpy.build.boot=dio -gpy.build.partitions=default - -gpy.menu.FlashFreq.80=80MHz -gpy.menu.FlashFreq.80.build.flash_freq=80m -gpy.menu.FlashFreq.40=40MHz -gpy.menu.FlashFreq.40.build.flash_freq=40m - -gpy.menu.UploadSpeed.921600=921600 -gpy.menu.UploadSpeed.921600.upload.speed=921600 -gpy.menu.UploadSpeed.115200=115200 -gpy.menu.UploadSpeed.115200.upload.speed=115200 -gpy.menu.UploadSpeed.256000.windows=256000 -gpy.menu.UploadSpeed.256000.upload.speed=256000 -gpy.menu.UploadSpeed.230400.windows.upload.speed=256000 -gpy.menu.UploadSpeed.230400=230400 -gpy.menu.UploadSpeed.230400.upload.speed=230400 -gpy.menu.UploadSpeed.460800.linux=460800 -gpy.menu.UploadSpeed.460800.macosx=460800 -gpy.menu.UploadSpeed.460800.upload.speed=460800 -gpy.menu.UploadSpeed.512000.windows=512000 -gpy.menu.UploadSpeed.512000.upload.speed=512000 - -gpy.menu.DebugLevel.none=None -gpy.menu.DebugLevel.none.build.code_debug=0 -gpy.menu.DebugLevel.error=Error -gpy.menu.DebugLevel.error.build.code_debug=1 -gpy.menu.DebugLevel.warn=Warn -gpy.menu.DebugLevel.warn.build.code_debug=2 -gpy.menu.DebugLevel.info=Info -gpy.menu.DebugLevel.info.build.code_debug=3 -gpy.menu.DebugLevel.debug=Debug -gpy.menu.DebugLevel.debug.build.code_debug=4 -gpy.menu.DebugLevel.verbose=Verbose -gpy.menu.DebugLevel.verbose.build.code_debug=5 - -############################################################## - -vintlabs-devkit-v1.name=VintLabs ESP32 Devkit - -vintlabs-devkit-v1.upload.tool=esptool_py -vintlabs-devkit-v1.upload.maximum_size=1310720 -vintlabs-devkit-v1.upload.maximum_data_size=327680 -vintlabs-devkit-v1.upload.wait_for_upload_port=true - -vintlabs-devkit-v1.serial.disableDTR=true -vintlabs-devkit-v1.serial.disableRTS=true - -vintlabs-devkit-v1.build.mcu=esp32 -vintlabs-devkit-v1.build.core=esp32 -vintlabs-devkit-v1.build.variant=vintlabsdevkitv1 -vintlabs-devkit-v1.build.board=ESP32_DEV - -vintlabs-devkit-v1.build.f_cpu=240000000L -vintlabs-devkit-v1.build.flash_mode=dio -vintlabs-devkit-v1.build.flash_size=4MB -vintlabs-devkit-v1.build.boot=dio -vintlabs-devkit-v1.build.partitions=default -vintlabs-devkit-v1.build.defines= - -vintlabs-devkit-v1.menu.FlashFreq.80=80MHz -vintlabs-devkit-v1.menu.FlashFreq.80.build.flash_freq=80m -vintlabs-devkit-v1.menu.FlashFreq.40=40MHz -vintlabs-devkit-v1.menu.FlashFreq.40.build.flash_freq=40m - -vintlabs-devkit-v1.menu.UploadSpeed.2000000=2000000 -vintlabs-devkit-v1.menu.UploadSpeed.2000000.upload.speed=2000000 -vintlabs-devkit-v1.menu.UploadSpeed.921600=921600 -vintlabs-devkit-v1.menu.UploadSpeed.921600.upload.speed=921600 -vintlabs-devkit-v1.menu.UploadSpeed.115200=115200 -vintlabs-devkit-v1.menu.UploadSpeed.115200.upload.speed=115200 -vintlabs-devkit-v1.menu.UploadSpeed.256000.windows=256000 -vintlabs-devkit-v1.menu.UploadSpeed.256000.upload.speed=256000 -vintlabs-devkit-v1.menu.UploadSpeed.230400.windows.upload.speed=256000 -vintlabs-devkit-v1.menu.UploadSpeed.230400=230400 -vintlabs-devkit-v1.menu.UploadSpeed.230400.upload.speed=230400 -vintlabs-devkit-v1.menu.UploadSpeed.460800.linux=460800 -vintlabs-devkit-v1.menu.UploadSpeed.460800.macosx=460800 -vintlabs-devkit-v1.menu.UploadSpeed.460800.upload.speed=460800 -vintlabs-devkit-v1.menu.UploadSpeed.512000.windows=512000 -vintlabs-devkit-v1.menu.UploadSpeed.512000.upload.speed=512000 - -vintlabs-devkit-v1.menu.DebugLevel.none=None -vintlabs-devkit-v1.menu.DebugLevel.none.build.code_debug=0 -vintlabs-devkit-v1.menu.DebugLevel.error=Error -vintlabs-devkit-v1.menu.DebugLevel.error.build.code_debug=1 -vintlabs-devkit-v1.menu.DebugLevel.warn=Warn -vintlabs-devkit-v1.menu.DebugLevel.warn.build.code_debug=2 -vintlabs-devkit-v1.menu.DebugLevel.info=Info -vintlabs-devkit-v1.menu.DebugLevel.info.build.code_debug=3 -vintlabs-devkit-v1.menu.DebugLevel.debug=Debug -vintlabs-devkit-v1.menu.DebugLevel.debug.build.code_debug=4 - -############################################################## - diff --git a/c6-hosted/bootloader.bin b/c6-hosted/bootloader.bin new file mode 100644 index 00000000000..829737ba722 Binary files /dev/null and b/c6-hosted/bootloader.bin differ diff --git a/c6-hosted/esp-logo.e558125a.png b/c6-hosted/esp-logo.e558125a.png new file mode 100644 index 00000000000..e4cb4387d26 Binary files /dev/null and b/c6-hosted/esp-logo.e558125a.png differ diff --git a/c6-hosted/favicon.ee2246ac.ico b/c6-hosted/favicon.ee2246ac.ico new file mode 100644 index 00000000000..520ef4b6ce6 Binary files /dev/null and b/c6-hosted/favicon.ee2246ac.ico differ diff --git a/c6-hosted/flash.sh b/c6-hosted/flash.sh new file mode 100755 index 00000000000..c114f5a3437 --- /dev/null +++ b/c6-hosted/flash.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +if [ "$#" -eq 1 ]; then + esptool.py --port $1 --chip esp32c6 -b 2000000 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size 4MB --flash_freq 80m 0x0 ./bootloader.bin 0x8000 ./partition-table.bin 0xd000 ./ota_data_initial.bin 0x10000 ./network_adapter.bin +else + echo "Error: You must pass the port as argument." + exit 1 +fi diff --git a/c6-hosted/index.82fa246c.js b/c6-hosted/index.82fa246c.js new file mode 100644 index 00000000000..8371ed14410 --- /dev/null +++ b/c6-hosted/index.82fa246c.js @@ -0,0 +1,3692 @@ +class $ec3de3bad43fb783$var$A extends Error { +} +/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */ function $ec3de3bad43fb783$var$t(A) { + let t = A.length; + for(; --t >= 0;)A[t] = 0; +} +const $ec3de3bad43fb783$var$e = 256, $ec3de3bad43fb783$var$i = 286, $ec3de3bad43fb783$var$s = 30, $ec3de3bad43fb783$var$a = 15, $ec3de3bad43fb783$var$n = new Uint8Array([ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 4, + 4, + 4, + 4, + 5, + 5, + 5, + 5, + 0 +]), $ec3de3bad43fb783$var$E = new Uint8Array([ + 0, + 0, + 0, + 0, + 1, + 1, + 2, + 2, + 3, + 3, + 4, + 4, + 5, + 5, + 6, + 6, + 7, + 7, + 8, + 8, + 9, + 9, + 10, + 10, + 11, + 11, + 12, + 12, + 13, + 13 +]), $ec3de3bad43fb783$var$h = new Uint8Array([ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 3, + 7 +]), $ec3de3bad43fb783$var$r = new Uint8Array([ + 16, + 17, + 18, + 0, + 8, + 7, + 9, + 6, + 10, + 5, + 11, + 4, + 12, + 3, + 13, + 2, + 14, + 1, + 15 +]), $ec3de3bad43fb783$var$g = new Array(576); +$ec3de3bad43fb783$var$t($ec3de3bad43fb783$var$g); +const $ec3de3bad43fb783$var$o = new Array(60); +$ec3de3bad43fb783$var$t($ec3de3bad43fb783$var$o); +const $ec3de3bad43fb783$var$B = new Array(512); +$ec3de3bad43fb783$var$t($ec3de3bad43fb783$var$B); +const $ec3de3bad43fb783$var$w = new Array(256); +$ec3de3bad43fb783$var$t($ec3de3bad43fb783$var$w); +const $ec3de3bad43fb783$var$c = new Array(29); +$ec3de3bad43fb783$var$t($ec3de3bad43fb783$var$c); +const $ec3de3bad43fb783$var$C = new Array($ec3de3bad43fb783$var$s); +function $ec3de3bad43fb783$var$I(A, t, e, i, s) { + this.static_tree = A, this.extra_bits = t, this.extra_base = e, this.elems = i, this.max_length = s, this.has_stree = A && A.length; +} +let $ec3de3bad43fb783$var$_, $ec3de3bad43fb783$var$l, $ec3de3bad43fb783$var$d; +function $ec3de3bad43fb783$var$M(A, t) { + this.dyn_tree = A, this.max_code = 0, this.stat_desc = t; +} +$ec3de3bad43fb783$var$t($ec3de3bad43fb783$var$C); +const $ec3de3bad43fb783$var$D = (A)=>A < 256 ? $ec3de3bad43fb783$var$B[A] : $ec3de3bad43fb783$var$B[256 + (A >>> 7)], $ec3de3bad43fb783$var$R = (A, t)=>{ + A.pending_buf[A.pending++] = 255 & t, A.pending_buf[A.pending++] = t >>> 8 & 255; +}, $ec3de3bad43fb783$var$S = (A, t, e)=>{ + A.bi_valid > 16 - e ? (A.bi_buf |= t << A.bi_valid & 65535, $ec3de3bad43fb783$var$R(A, A.bi_buf), A.bi_buf = t >> 16 - A.bi_valid, A.bi_valid += e - 16) : (A.bi_buf |= t << A.bi_valid & 65535, A.bi_valid += e); +}, $ec3de3bad43fb783$var$Q = (A, t, e)=>{ + $ec3de3bad43fb783$var$S(A, e[2 * t], e[2 * t + 1]); +}, $ec3de3bad43fb783$var$f = (A, t)=>{ + let e = 0; + do e |= 1 & A, A >>>= 1, e <<= 1; + while (--t > 0); + return e >>> 1; +}, $ec3de3bad43fb783$var$F = (A, t, e)=>{ + const i = new Array(16); + let s, n, E = 0; + for(s = 1; s <= $ec3de3bad43fb783$var$a; s++)E = E + e[s - 1] << 1, i[s] = E; + for(n = 0; n <= t; n++){ + let t = A[2 * n + 1]; + 0 !== t && (A[2 * n] = $ec3de3bad43fb783$var$f(i[t]++, t)); + } +}, $ec3de3bad43fb783$var$T = (A)=>{ + let t; + for(t = 0; t < $ec3de3bad43fb783$var$i; t++)A.dyn_ltree[2 * t] = 0; + for(t = 0; t < $ec3de3bad43fb783$var$s; t++)A.dyn_dtree[2 * t] = 0; + for(t = 0; t < 19; t++)A.bl_tree[2 * t] = 0; + A.dyn_ltree[512] = 1, A.opt_len = A.static_len = 0, A.sym_next = A.matches = 0; +}, $ec3de3bad43fb783$var$u = (A)=>{ + A.bi_valid > 8 ? $ec3de3bad43fb783$var$R(A, A.bi_buf) : A.bi_valid > 0 && (A.pending_buf[A.pending++] = A.bi_buf), A.bi_buf = 0, A.bi_valid = 0; +}, $ec3de3bad43fb783$var$p = (A, t, e, i)=>{ + const s = 2 * t, a = 2 * e; + return A[s] < A[a] || A[s] === A[a] && i[t] <= i[e]; +}, $ec3de3bad43fb783$var$y = (A, t, e)=>{ + const i = A.heap[e]; + let s = e << 1; + for(; s <= A.heap_len && (s < A.heap_len && $ec3de3bad43fb783$var$p(t, A.heap[s + 1], A.heap[s], A.depth) && s++, !$ec3de3bad43fb783$var$p(t, i, A.heap[s], A.depth));)A.heap[e] = A.heap[s], e = s, s <<= 1; + A.heap[e] = i; +}, $ec3de3bad43fb783$var$k = (A, t, i)=>{ + let s, a, h, r, g = 0; + if (0 !== A.sym_next) do s = 255 & A.pending_buf[A.sym_buf + g++], s += (255 & A.pending_buf[A.sym_buf + g++]) << 8, a = A.pending_buf[A.sym_buf + g++], 0 === s ? $ec3de3bad43fb783$var$Q(A, a, t) : (h = $ec3de3bad43fb783$var$w[a], $ec3de3bad43fb783$var$Q(A, h + $ec3de3bad43fb783$var$e + 1, t), r = $ec3de3bad43fb783$var$n[h], 0 !== r && (a -= $ec3de3bad43fb783$var$c[h], $ec3de3bad43fb783$var$S(A, a, r)), s--, h = $ec3de3bad43fb783$var$D(s), $ec3de3bad43fb783$var$Q(A, h, i), r = $ec3de3bad43fb783$var$E[h], 0 !== r && (s -= $ec3de3bad43fb783$var$C[h], $ec3de3bad43fb783$var$S(A, s, r))); + while (g < A.sym_next); + $ec3de3bad43fb783$var$Q(A, 256, t); +}, $ec3de3bad43fb783$var$H = (A, t)=>{ + const e = t.dyn_tree, i = t.stat_desc.static_tree, s = t.stat_desc.has_stree, n = t.stat_desc.elems; + let E, h, r, g = -1; + for(A.heap_len = 0, A.heap_max = 573, E = 0; E < n; E++)0 !== e[2 * E] ? (A.heap[++A.heap_len] = g = E, A.depth[E] = 0) : e[2 * E + 1] = 0; + for(; A.heap_len < 2;)r = A.heap[++A.heap_len] = g < 2 ? ++g : 0, e[2 * r] = 1, A.depth[r] = 0, A.opt_len--, s && (A.static_len -= i[2 * r + 1]); + for(t.max_code = g, E = A.heap_len >> 1; E >= 1; E--)$ec3de3bad43fb783$var$y(A, e, E); + r = n; + do E = A.heap[1], A.heap[1] = A.heap[A.heap_len--], $ec3de3bad43fb783$var$y(A, e, 1), h = A.heap[1], A.heap[--A.heap_max] = E, A.heap[--A.heap_max] = h, e[2 * r] = e[2 * E] + e[2 * h], A.depth[r] = (A.depth[E] >= A.depth[h] ? A.depth[E] : A.depth[h]) + 1, e[2 * E + 1] = e[2 * h + 1] = r, A.heap[1] = r++, $ec3de3bad43fb783$var$y(A, e, 1); + while (A.heap_len >= 2); + A.heap[--A.heap_max] = A.heap[1], ((A, t)=>{ + const e = t.dyn_tree, i = t.max_code, s = t.stat_desc.static_tree, n = t.stat_desc.has_stree, E = t.stat_desc.extra_bits, h = t.stat_desc.extra_base, r = t.stat_desc.max_length; + let g, o, B, w, c, C, I = 0; + for(w = 0; w <= $ec3de3bad43fb783$var$a; w++)A.bl_count[w] = 0; + for(e[2 * A.heap[A.heap_max] + 1] = 0, g = A.heap_max + 1; g < 573; g++)o = A.heap[g], w = e[2 * e[2 * o + 1] + 1] + 1, w > r && (w = r, I++), e[2 * o + 1] = w, o > i || (A.bl_count[w]++, c = 0, o >= h && (c = E[o - h]), C = e[2 * o], A.opt_len += C * (w + c), n && (A.static_len += C * (s[2 * o + 1] + c))); + if (0 !== I) { + do { + for(w = r - 1; 0 === A.bl_count[w];)w--; + A.bl_count[w]--, A.bl_count[w + 1] += 2, A.bl_count[r]--, I -= 2; + }while (I > 0); + for(w = r; 0 !== w; w--)for(o = A.bl_count[w]; 0 !== o;)B = A.heap[--g], B > i || (e[2 * B + 1] !== w && (A.opt_len += (w - e[2 * B + 1]) * e[2 * B], e[2 * B + 1] = w), o--); + } + })(A, t), $ec3de3bad43fb783$var$F(e, g, A.bl_count); +}, $ec3de3bad43fb783$var$P = (A, t, e)=>{ + let i, s, a = -1, n = t[1], E = 0, h = 7, r = 4; + for(0 === n && (h = 138, r = 3), t[2 * (e + 1) + 1] = 65535, i = 0; i <= e; i++)s = n, n = t[2 * (i + 1) + 1], ++E < h && s === n || (E < r ? A.bl_tree[2 * s] += E : 0 !== s ? (s !== a && A.bl_tree[2 * s]++, A.bl_tree[32]++) : E <= 10 ? A.bl_tree[34]++ : A.bl_tree[36]++, E = 0, a = s, 0 === n ? (h = 138, r = 3) : s === n ? (h = 6, r = 3) : (h = 7, r = 4)); +}, $ec3de3bad43fb783$var$O = (A, t, e)=>{ + let i, s, a = -1, n = t[1], E = 0, h = 7, r = 4; + for(0 === n && (h = 138, r = 3), i = 0; i <= e; i++)if (s = n, n = t[2 * (i + 1) + 1], !(++E < h && s === n)) { + if (E < r) do $ec3de3bad43fb783$var$Q(A, s, A.bl_tree); + while (0 != --E); + else 0 !== s ? (s !== a && ($ec3de3bad43fb783$var$Q(A, s, A.bl_tree), E--), $ec3de3bad43fb783$var$Q(A, 16, A.bl_tree), $ec3de3bad43fb783$var$S(A, E - 3, 2)) : E <= 10 ? ($ec3de3bad43fb783$var$Q(A, 17, A.bl_tree), $ec3de3bad43fb783$var$S(A, E - 3, 3)) : ($ec3de3bad43fb783$var$Q(A, 18, A.bl_tree), $ec3de3bad43fb783$var$S(A, E - 11, 7)); + E = 0, a = s, 0 === n ? (h = 138, r = 3) : s === n ? (h = 6, r = 3) : (h = 7, r = 4); + } +}; +let $ec3de3bad43fb783$var$U = !1; +const $ec3de3bad43fb783$var$G = (A, t, e, i)=>{ + $ec3de3bad43fb783$var$S(A, 0 + (i ? 1 : 0), 3), $ec3de3bad43fb783$var$u(A), $ec3de3bad43fb783$var$R(A, e), $ec3de3bad43fb783$var$R(A, ~e), e && A.pending_buf.set(A.window.subarray(t, t + e), A.pending), A.pending += e; +}; +var $ec3de3bad43fb783$var$m = (A, t, i, s)=>{ + let a, n, E = 0; + A.level > 0 ? (2 === A.strm.data_type && (A.strm.data_type = ((A)=>{ + let t, i = 4093624447; + for(t = 0; t <= 31; t++, i >>>= 1)if (1 & i && 0 !== A.dyn_ltree[2 * t]) return 0; + if (0 !== A.dyn_ltree[18] || 0 !== A.dyn_ltree[20] || 0 !== A.dyn_ltree[26]) return 1; + for(t = 32; t < $ec3de3bad43fb783$var$e; t++)if (0 !== A.dyn_ltree[2 * t]) return 1; + return 0; + })(A)), $ec3de3bad43fb783$var$H(A, A.l_desc), $ec3de3bad43fb783$var$H(A, A.d_desc), E = ((A)=>{ + let t; + for($ec3de3bad43fb783$var$P(A, A.dyn_ltree, A.l_desc.max_code), $ec3de3bad43fb783$var$P(A, A.dyn_dtree, A.d_desc.max_code), $ec3de3bad43fb783$var$H(A, A.bl_desc), t = 18; t >= 3 && 0 === A.bl_tree[2 * $ec3de3bad43fb783$var$r[t] + 1]; t--); + return A.opt_len += 3 * (t + 1) + 5 + 5 + 4, t; + })(A), a = A.opt_len + 3 + 7 >>> 3, n = A.static_len + 3 + 7 >>> 3, n <= a && (a = n)) : a = n = i + 5, i + 4 <= a && -1 !== t ? $ec3de3bad43fb783$var$G(A, t, i, s) : 4 === A.strategy || n === a ? ($ec3de3bad43fb783$var$S(A, 2 + (s ? 1 : 0), 3), $ec3de3bad43fb783$var$k(A, $ec3de3bad43fb783$var$g, $ec3de3bad43fb783$var$o)) : ($ec3de3bad43fb783$var$S(A, 4 + (s ? 1 : 0), 3), ((A, t, e, i)=>{ + let s; + for($ec3de3bad43fb783$var$S(A, t - 257, 5), $ec3de3bad43fb783$var$S(A, e - 1, 5), $ec3de3bad43fb783$var$S(A, i - 4, 4), s = 0; s < i; s++)$ec3de3bad43fb783$var$S(A, A.bl_tree[2 * $ec3de3bad43fb783$var$r[s] + 1], 3); + $ec3de3bad43fb783$var$O(A, A.dyn_ltree, t - 1), $ec3de3bad43fb783$var$O(A, A.dyn_dtree, e - 1); + })(A, A.l_desc.max_code + 1, A.d_desc.max_code + 1, E + 1), $ec3de3bad43fb783$var$k(A, A.dyn_ltree, A.dyn_dtree)), $ec3de3bad43fb783$var$T(A), s && $ec3de3bad43fb783$var$u(A); +}, $ec3de3bad43fb783$var$Y = { + _tr_init: (A)=>{ + $ec3de3bad43fb783$var$U || ((()=>{ + let A, t, e, r, M; + const D = new Array(16); + for(e = 0, r = 0; r < 28; r++)for($ec3de3bad43fb783$var$c[r] = e, A = 0; A < 1 << $ec3de3bad43fb783$var$n[r]; A++)$ec3de3bad43fb783$var$w[e++] = r; + for($ec3de3bad43fb783$var$w[e - 1] = r, M = 0, r = 0; r < 16; r++)for($ec3de3bad43fb783$var$C[r] = M, A = 0; A < 1 << $ec3de3bad43fb783$var$E[r]; A++)$ec3de3bad43fb783$var$B[M++] = r; + for(M >>= 7; r < $ec3de3bad43fb783$var$s; r++)for($ec3de3bad43fb783$var$C[r] = M << 7, A = 0; A < 1 << $ec3de3bad43fb783$var$E[r] - 7; A++)$ec3de3bad43fb783$var$B[256 + M++] = r; + for(t = 0; t <= $ec3de3bad43fb783$var$a; t++)D[t] = 0; + for(A = 0; A <= 143;)$ec3de3bad43fb783$var$g[2 * A + 1] = 8, A++, D[8]++; + for(; A <= 255;)$ec3de3bad43fb783$var$g[2 * A + 1] = 9, A++, D[9]++; + for(; A <= 279;)$ec3de3bad43fb783$var$g[2 * A + 1] = 7, A++, D[7]++; + for(; A <= 287;)$ec3de3bad43fb783$var$g[2 * A + 1] = 8, A++, D[8]++; + for($ec3de3bad43fb783$var$F($ec3de3bad43fb783$var$g, 287, D), A = 0; A < $ec3de3bad43fb783$var$s; A++)$ec3de3bad43fb783$var$o[2 * A + 1] = 5, $ec3de3bad43fb783$var$o[2 * A] = $ec3de3bad43fb783$var$f(A, 5); + $ec3de3bad43fb783$var$_ = new $ec3de3bad43fb783$var$I($ec3de3bad43fb783$var$g, $ec3de3bad43fb783$var$n, 257, $ec3de3bad43fb783$var$i, $ec3de3bad43fb783$var$a), $ec3de3bad43fb783$var$l = new $ec3de3bad43fb783$var$I($ec3de3bad43fb783$var$o, $ec3de3bad43fb783$var$E, 0, $ec3de3bad43fb783$var$s, $ec3de3bad43fb783$var$a), $ec3de3bad43fb783$var$d = new $ec3de3bad43fb783$var$I(new Array(0), $ec3de3bad43fb783$var$h, 0, 19, 7); + })(), $ec3de3bad43fb783$var$U = !0), A.l_desc = new $ec3de3bad43fb783$var$M(A.dyn_ltree, $ec3de3bad43fb783$var$_), A.d_desc = new $ec3de3bad43fb783$var$M(A.dyn_dtree, $ec3de3bad43fb783$var$l), A.bl_desc = new $ec3de3bad43fb783$var$M(A.bl_tree, $ec3de3bad43fb783$var$d), A.bi_buf = 0, A.bi_valid = 0, $ec3de3bad43fb783$var$T(A); + }, + _tr_stored_block: $ec3de3bad43fb783$var$G, + _tr_flush_block: $ec3de3bad43fb783$var$m, + _tr_tally: (A, t, i)=>(A.pending_buf[A.sym_buf + A.sym_next++] = t, A.pending_buf[A.sym_buf + A.sym_next++] = t >> 8, A.pending_buf[A.sym_buf + A.sym_next++] = i, 0 === t ? A.dyn_ltree[2 * i]++ : (A.matches++, t--, A.dyn_ltree[2 * ($ec3de3bad43fb783$var$w[i] + $ec3de3bad43fb783$var$e + 1)]++, A.dyn_dtree[2 * $ec3de3bad43fb783$var$D(t)]++), A.sym_next === A.sym_end), + _tr_align: (A)=>{ + $ec3de3bad43fb783$var$S(A, 2, 3), $ec3de3bad43fb783$var$Q(A, 256, $ec3de3bad43fb783$var$g), ((A)=>{ + 16 === A.bi_valid ? ($ec3de3bad43fb783$var$R(A, A.bi_buf), A.bi_buf = 0, A.bi_valid = 0) : A.bi_valid >= 8 && (A.pending_buf[A.pending++] = 255 & A.bi_buf, A.bi_buf >>= 8, A.bi_valid -= 8); + })(A); + } +}; +var $ec3de3bad43fb783$var$b = (A, t, e, i)=>{ + let s = 65535 & A | 0, a = A >>> 16 & 65535 | 0, n = 0; + for(; 0 !== e;){ + n = e > 2e3 ? 2e3 : e, e -= n; + do s = s + t[i++] | 0, a = a + s | 0; + while (--n); + s %= 65521, a %= 65521; + } + return s | a << 16 | 0; +}; +const $ec3de3bad43fb783$var$K = new Uint32Array((()=>{ + let A, t = []; + for(var e = 0; e < 256; e++){ + A = e; + for(var i = 0; i < 8; i++)A = 1 & A ? 3988292384 ^ A >>> 1 : A >>> 1; + t[e] = A; + } + return t; +})()); +var $ec3de3bad43fb783$var$x = (A, t, e, i)=>{ + const s = $ec3de3bad43fb783$var$K, a = i + e; + A ^= -1; + for(let e = i; e < a; e++)A = A >>> 8 ^ s[255 & (A ^ t[e])]; + return -1 ^ A; +}, $ec3de3bad43fb783$var$L = { + 2: "need dictionary", + 1: "stream end", + 0: "", + "-1": "file error", + "-2": "stream error", + "-3": "data error", + "-4": "insufficient memory", + "-5": "buffer error", + "-6": "incompatible version" +}, $ec3de3bad43fb783$var$J = { + Z_NO_FLUSH: 0, + Z_PARTIAL_FLUSH: 1, + Z_SYNC_FLUSH: 2, + Z_FULL_FLUSH: 3, + Z_FINISH: 4, + Z_BLOCK: 5, + Z_TREES: 6, + Z_OK: 0, + Z_STREAM_END: 1, + Z_NEED_DICT: 2, + Z_ERRNO: -1, + Z_STREAM_ERROR: -2, + Z_DATA_ERROR: -3, + Z_MEM_ERROR: -4, + Z_BUF_ERROR: -5, + Z_NO_COMPRESSION: 0, + Z_BEST_SPEED: 1, + Z_BEST_COMPRESSION: 9, + Z_DEFAULT_COMPRESSION: -1, + Z_FILTERED: 1, + Z_HUFFMAN_ONLY: 2, + Z_RLE: 3, + Z_FIXED: 4, + Z_DEFAULT_STRATEGY: 0, + Z_BINARY: 0, + Z_TEXT: 1, + Z_UNKNOWN: 2, + Z_DEFLATED: 8 +}; +const { _tr_init: $ec3de3bad43fb783$var$z, _tr_stored_block: $ec3de3bad43fb783$var$N, _tr_flush_block: $ec3de3bad43fb783$var$v, _tr_tally: $ec3de3bad43fb783$var$j, _tr_align: $ec3de3bad43fb783$var$Z } = $ec3de3bad43fb783$var$Y, { Z_NO_FLUSH: $ec3de3bad43fb783$var$W, Z_PARTIAL_FLUSH: $ec3de3bad43fb783$var$X, Z_FULL_FLUSH: $ec3de3bad43fb783$var$q, Z_FINISH: $ec3de3bad43fb783$var$V, Z_BLOCK: $ec3de3bad43fb783$var$$, Z_OK: $ec3de3bad43fb783$var$AA, Z_STREAM_END: $ec3de3bad43fb783$var$tA, Z_STREAM_ERROR: $ec3de3bad43fb783$var$eA, Z_DATA_ERROR: $ec3de3bad43fb783$var$iA, Z_BUF_ERROR: $ec3de3bad43fb783$var$sA, Z_DEFAULT_COMPRESSION: $ec3de3bad43fb783$var$aA, Z_FILTERED: $ec3de3bad43fb783$var$nA, Z_HUFFMAN_ONLY: $ec3de3bad43fb783$var$EA, Z_RLE: $ec3de3bad43fb783$var$hA, Z_FIXED: $ec3de3bad43fb783$var$rA, Z_DEFAULT_STRATEGY: $ec3de3bad43fb783$var$gA, Z_UNKNOWN: $ec3de3bad43fb783$var$oA, Z_DEFLATED: $ec3de3bad43fb783$var$BA } = $ec3de3bad43fb783$var$J, $ec3de3bad43fb783$var$wA = 258, $ec3de3bad43fb783$var$cA = 262, $ec3de3bad43fb783$var$CA = 42, $ec3de3bad43fb783$var$IA = 113, $ec3de3bad43fb783$var$_A = 666, $ec3de3bad43fb783$var$lA = (A, t)=>(A.msg = $ec3de3bad43fb783$var$L[t], t), $ec3de3bad43fb783$var$dA = (A)=>2 * A - (A > 4 ? 9 : 0), $ec3de3bad43fb783$var$MA = (A)=>{ + let t = A.length; + for(; --t >= 0;)A[t] = 0; +}, $ec3de3bad43fb783$var$DA = (A)=>{ + let t, e, i, s = A.w_size; + t = A.hash_size, i = t; + do e = A.head[--i], A.head[i] = e >= s ? e - s : 0; + while (--t); + t = s, i = t; + do e = A.prev[--i], A.prev[i] = e >= s ? e - s : 0; + while (--t); +}; +let $ec3de3bad43fb783$var$RA = (A, t, e)=>(t << A.hash_shift ^ e) & A.hash_mask; +const $ec3de3bad43fb783$var$SA = (A)=>{ + const t = A.state; + let e = t.pending; + e > A.avail_out && (e = A.avail_out), 0 !== e && (A.output.set(t.pending_buf.subarray(t.pending_out, t.pending_out + e), A.next_out), A.next_out += e, t.pending_out += e, A.total_out += e, A.avail_out -= e, t.pending -= e, 0 === t.pending && (t.pending_out = 0)); +}, $ec3de3bad43fb783$var$QA = (A, t)=>{ + $ec3de3bad43fb783$var$v(A, A.block_start >= 0 ? A.block_start : -1, A.strstart - A.block_start, t), A.block_start = A.strstart, $ec3de3bad43fb783$var$SA(A.strm); +}, $ec3de3bad43fb783$var$fA = (A, t)=>{ + A.pending_buf[A.pending++] = t; +}, $ec3de3bad43fb783$var$FA = (A, t)=>{ + A.pending_buf[A.pending++] = t >>> 8 & 255, A.pending_buf[A.pending++] = 255 & t; +}, $ec3de3bad43fb783$var$TA = (A, t, e, i)=>{ + let s = A.avail_in; + return s > i && (s = i), 0 === s ? 0 : (A.avail_in -= s, t.set(A.input.subarray(A.next_in, A.next_in + s), e), 1 === A.state.wrap ? A.adler = $ec3de3bad43fb783$var$b(A.adler, t, s, e) : 2 === A.state.wrap && (A.adler = $ec3de3bad43fb783$var$x(A.adler, t, s, e)), A.next_in += s, A.total_in += s, s); +}, $ec3de3bad43fb783$var$uA = (A, t)=>{ + let e, i, s = A.max_chain_length, a = A.strstart, n = A.prev_length, E = A.nice_match; + const h = A.strstart > A.w_size - $ec3de3bad43fb783$var$cA ? A.strstart - (A.w_size - $ec3de3bad43fb783$var$cA) : 0, r = A.window, g = A.w_mask, o = A.prev, B = A.strstart + $ec3de3bad43fb783$var$wA; + let w = r[a + n - 1], c = r[a + n]; + A.prev_length >= A.good_match && (s >>= 2), E > A.lookahead && (E = A.lookahead); + do if (e = t, r[e + n] === c && r[e + n - 1] === w && r[e] === r[a] && r[++e] === r[a + 1]) { + a += 2, e++; + do ; + while (r[++a] === r[++e] && r[++a] === r[++e] && r[++a] === r[++e] && r[++a] === r[++e] && r[++a] === r[++e] && r[++a] === r[++e] && r[++a] === r[++e] && r[++a] === r[++e] && a < B); + if (i = $ec3de3bad43fb783$var$wA - (B - a), a = B - $ec3de3bad43fb783$var$wA, i > n) { + if (A.match_start = t, n = i, i >= E) break; + w = r[a + n - 1], c = r[a + n]; + } + } + while ((t = o[t & g]) > h && 0 != --s); + return n <= A.lookahead ? n : A.lookahead; +}, $ec3de3bad43fb783$var$pA = (A)=>{ + const t = A.w_size; + let e, i, s; + do { + if (i = A.window_size - A.lookahead - A.strstart, A.strstart >= t + (t - $ec3de3bad43fb783$var$cA) && (A.window.set(A.window.subarray(t, t + t - i), 0), A.match_start -= t, A.strstart -= t, A.block_start -= t, A.insert > A.strstart && (A.insert = A.strstart), $ec3de3bad43fb783$var$DA(A), i += t), 0 === A.strm.avail_in) break; + if (e = $ec3de3bad43fb783$var$TA(A.strm, A.window, A.strstart + A.lookahead, i), A.lookahead += e, A.lookahead + A.insert >= 3) for(s = A.strstart - A.insert, A.ins_h = A.window[s], A.ins_h = $ec3de3bad43fb783$var$RA(A, A.ins_h, A.window[s + 1]); A.insert && (A.ins_h = $ec3de3bad43fb783$var$RA(A, A.ins_h, A.window[s + 3 - 1]), A.prev[s & A.w_mask] = A.head[A.ins_h], A.head[A.ins_h] = s, s++, A.insert--, !(A.lookahead + A.insert < 3));); + }while (A.lookahead < $ec3de3bad43fb783$var$cA && 0 !== A.strm.avail_in); +}, $ec3de3bad43fb783$var$yA = (A, t)=>{ + let e, i, s, a = A.pending_buf_size - 5 > A.w_size ? A.w_size : A.pending_buf_size - 5, n = 0, E = A.strm.avail_in; + do { + if (e = 65535, s = A.bi_valid + 42 >> 3, A.strm.avail_out < s) break; + if (s = A.strm.avail_out - s, i = A.strstart - A.block_start, e > i + A.strm.avail_in && (e = i + A.strm.avail_in), e > s && (e = s), e < a && (0 === e && t !== $ec3de3bad43fb783$var$V || t === $ec3de3bad43fb783$var$W || e !== i + A.strm.avail_in)) break; + n = t === $ec3de3bad43fb783$var$V && e === i + A.strm.avail_in ? 1 : 0, $ec3de3bad43fb783$var$N(A, 0, 0, n), A.pending_buf[A.pending - 4] = e, A.pending_buf[A.pending - 3] = e >> 8, A.pending_buf[A.pending - 2] = ~e, A.pending_buf[A.pending - 1] = ~e >> 8, $ec3de3bad43fb783$var$SA(A.strm), i && (i > e && (i = e), A.strm.output.set(A.window.subarray(A.block_start, A.block_start + i), A.strm.next_out), A.strm.next_out += i, A.strm.avail_out -= i, A.strm.total_out += i, A.block_start += i, e -= i), e && ($ec3de3bad43fb783$var$TA(A.strm, A.strm.output, A.strm.next_out, e), A.strm.next_out += e, A.strm.avail_out -= e, A.strm.total_out += e); + }while (0 === n); + return E -= A.strm.avail_in, E && (E >= A.w_size ? (A.matches = 2, A.window.set(A.strm.input.subarray(A.strm.next_in - A.w_size, A.strm.next_in), 0), A.strstart = A.w_size, A.insert = A.strstart) : (A.window_size - A.strstart <= E && (A.strstart -= A.w_size, A.window.set(A.window.subarray(A.w_size, A.w_size + A.strstart), 0), A.matches < 2 && A.matches++, A.insert > A.strstart && (A.insert = A.strstart)), A.window.set(A.strm.input.subarray(A.strm.next_in - E, A.strm.next_in), A.strstart), A.strstart += E, A.insert += E > A.w_size - A.insert ? A.w_size - A.insert : E), A.block_start = A.strstart), A.high_water < A.strstart && (A.high_water = A.strstart), n ? 4 : t !== $ec3de3bad43fb783$var$W && t !== $ec3de3bad43fb783$var$V && 0 === A.strm.avail_in && A.strstart === A.block_start ? 2 : (s = A.window_size - A.strstart, A.strm.avail_in > s && A.block_start >= A.w_size && (A.block_start -= A.w_size, A.strstart -= A.w_size, A.window.set(A.window.subarray(A.w_size, A.w_size + A.strstart), 0), A.matches < 2 && A.matches++, s += A.w_size, A.insert > A.strstart && (A.insert = A.strstart)), s > A.strm.avail_in && (s = A.strm.avail_in), s && ($ec3de3bad43fb783$var$TA(A.strm, A.window, A.strstart, s), A.strstart += s, A.insert += s > A.w_size - A.insert ? A.w_size - A.insert : s), A.high_water < A.strstart && (A.high_water = A.strstart), s = A.bi_valid + 42 >> 3, s = A.pending_buf_size - s > 65535 ? 65535 : A.pending_buf_size - s, a = s > A.w_size ? A.w_size : s, i = A.strstart - A.block_start, (i >= a || (i || t === $ec3de3bad43fb783$var$V) && t !== $ec3de3bad43fb783$var$W && 0 === A.strm.avail_in && i <= s) && (e = i > s ? s : i, n = t === $ec3de3bad43fb783$var$V && 0 === A.strm.avail_in && e === i ? 1 : 0, $ec3de3bad43fb783$var$N(A, A.block_start, e, n), A.block_start += e, $ec3de3bad43fb783$var$SA(A.strm)), n ? 3 : 1); +}, $ec3de3bad43fb783$var$kA = (A, t)=>{ + let e, i; + for(;;){ + if (A.lookahead < $ec3de3bad43fb783$var$cA) { + if ($ec3de3bad43fb783$var$pA(A), A.lookahead < $ec3de3bad43fb783$var$cA && t === $ec3de3bad43fb783$var$W) return 1; + if (0 === A.lookahead) break; + } + if (e = 0, A.lookahead >= 3 && (A.ins_h = $ec3de3bad43fb783$var$RA(A, A.ins_h, A.window[A.strstart + 3 - 1]), e = A.prev[A.strstart & A.w_mask] = A.head[A.ins_h], A.head[A.ins_h] = A.strstart), 0 !== e && A.strstart - e <= A.w_size - $ec3de3bad43fb783$var$cA && (A.match_length = $ec3de3bad43fb783$var$uA(A, e)), A.match_length >= 3) { + if (i = $ec3de3bad43fb783$var$j(A, A.strstart - A.match_start, A.match_length - 3), A.lookahead -= A.match_length, A.match_length <= A.max_lazy_match && A.lookahead >= 3) { + A.match_length--; + do A.strstart++, A.ins_h = $ec3de3bad43fb783$var$RA(A, A.ins_h, A.window[A.strstart + 3 - 1]), e = A.prev[A.strstart & A.w_mask] = A.head[A.ins_h], A.head[A.ins_h] = A.strstart; + while (0 != --A.match_length); + A.strstart++; + } else A.strstart += A.match_length, A.match_length = 0, A.ins_h = A.window[A.strstart], A.ins_h = $ec3de3bad43fb783$var$RA(A, A.ins_h, A.window[A.strstart + 1]); + } else i = $ec3de3bad43fb783$var$j(A, 0, A.window[A.strstart]), A.lookahead--, A.strstart++; + if (i && ($ec3de3bad43fb783$var$QA(A, !1), 0 === A.strm.avail_out)) return 1; + } + return A.insert = A.strstart < 2 ? A.strstart : 2, t === $ec3de3bad43fb783$var$V ? ($ec3de3bad43fb783$var$QA(A, !0), 0 === A.strm.avail_out ? 3 : 4) : A.sym_next && ($ec3de3bad43fb783$var$QA(A, !1), 0 === A.strm.avail_out) ? 1 : 2; +}, $ec3de3bad43fb783$var$HA = (A, t)=>{ + let e, i, s; + for(;;){ + if (A.lookahead < $ec3de3bad43fb783$var$cA) { + if ($ec3de3bad43fb783$var$pA(A), A.lookahead < $ec3de3bad43fb783$var$cA && t === $ec3de3bad43fb783$var$W) return 1; + if (0 === A.lookahead) break; + } + if (e = 0, A.lookahead >= 3 && (A.ins_h = $ec3de3bad43fb783$var$RA(A, A.ins_h, A.window[A.strstart + 3 - 1]), e = A.prev[A.strstart & A.w_mask] = A.head[A.ins_h], A.head[A.ins_h] = A.strstart), A.prev_length = A.match_length, A.prev_match = A.match_start, A.match_length = 2, 0 !== e && A.prev_length < A.max_lazy_match && A.strstart - e <= A.w_size - $ec3de3bad43fb783$var$cA && (A.match_length = $ec3de3bad43fb783$var$uA(A, e), A.match_length <= 5 && (A.strategy === $ec3de3bad43fb783$var$nA || 3 === A.match_length && A.strstart - A.match_start > 4096) && (A.match_length = 2)), A.prev_length >= 3 && A.match_length <= A.prev_length) { + s = A.strstart + A.lookahead - 3, i = $ec3de3bad43fb783$var$j(A, A.strstart - 1 - A.prev_match, A.prev_length - 3), A.lookahead -= A.prev_length - 1, A.prev_length -= 2; + do ++A.strstart <= s && (A.ins_h = $ec3de3bad43fb783$var$RA(A, A.ins_h, A.window[A.strstart + 3 - 1]), e = A.prev[A.strstart & A.w_mask] = A.head[A.ins_h], A.head[A.ins_h] = A.strstart); + while (0 != --A.prev_length); + if (A.match_available = 0, A.match_length = 2, A.strstart++, i && ($ec3de3bad43fb783$var$QA(A, !1), 0 === A.strm.avail_out)) return 1; + } else if (A.match_available) { + if (i = $ec3de3bad43fb783$var$j(A, 0, A.window[A.strstart - 1]), i && $ec3de3bad43fb783$var$QA(A, !1), A.strstart++, A.lookahead--, 0 === A.strm.avail_out) return 1; + } else A.match_available = 1, A.strstart++, A.lookahead--; + } + return A.match_available && (i = $ec3de3bad43fb783$var$j(A, 0, A.window[A.strstart - 1]), A.match_available = 0), A.insert = A.strstart < 2 ? A.strstart : 2, t === $ec3de3bad43fb783$var$V ? ($ec3de3bad43fb783$var$QA(A, !0), 0 === A.strm.avail_out ? 3 : 4) : A.sym_next && ($ec3de3bad43fb783$var$QA(A, !1), 0 === A.strm.avail_out) ? 1 : 2; +}; +function $ec3de3bad43fb783$var$PA(A, t, e, i, s) { + this.good_length = A, this.max_lazy = t, this.nice_length = e, this.max_chain = i, this.func = s; +} +const $ec3de3bad43fb783$var$OA = [ + new $ec3de3bad43fb783$var$PA(0, 0, 0, 0, $ec3de3bad43fb783$var$yA), + new $ec3de3bad43fb783$var$PA(4, 4, 8, 4, $ec3de3bad43fb783$var$kA), + new $ec3de3bad43fb783$var$PA(4, 5, 16, 8, $ec3de3bad43fb783$var$kA), + new $ec3de3bad43fb783$var$PA(4, 6, 32, 32, $ec3de3bad43fb783$var$kA), + new $ec3de3bad43fb783$var$PA(4, 4, 16, 16, $ec3de3bad43fb783$var$HA), + new $ec3de3bad43fb783$var$PA(8, 16, 32, 32, $ec3de3bad43fb783$var$HA), + new $ec3de3bad43fb783$var$PA(8, 16, 128, 128, $ec3de3bad43fb783$var$HA), + new $ec3de3bad43fb783$var$PA(8, 32, 128, 256, $ec3de3bad43fb783$var$HA), + new $ec3de3bad43fb783$var$PA(32, 128, 258, 1024, $ec3de3bad43fb783$var$HA), + new $ec3de3bad43fb783$var$PA(32, 258, 258, 4096, $ec3de3bad43fb783$var$HA) +]; +function $ec3de3bad43fb783$var$UA() { + this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = $ec3de3bad43fb783$var$BA, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new Uint16Array(1146), this.dyn_dtree = new Uint16Array(122), this.bl_tree = new Uint16Array(78), $ec3de3bad43fb783$var$MA(this.dyn_ltree), $ec3de3bad43fb783$var$MA(this.dyn_dtree), $ec3de3bad43fb783$var$MA(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new Uint16Array(16), this.heap = new Uint16Array(573), $ec3de3bad43fb783$var$MA(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new Uint16Array(573), $ec3de3bad43fb783$var$MA(this.depth), this.sym_buf = 0, this.lit_bufsize = 0, this.sym_next = 0, this.sym_end = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0; +} +const $ec3de3bad43fb783$var$GA = (A)=>{ + if (!A) return 1; + const t = A.state; + return !t || t.strm !== A || t.status !== $ec3de3bad43fb783$var$CA && 57 !== t.status && 69 !== t.status && 73 !== t.status && 91 !== t.status && 103 !== t.status && t.status !== $ec3de3bad43fb783$var$IA && t.status !== $ec3de3bad43fb783$var$_A ? 1 : 0; +}, $ec3de3bad43fb783$var$mA = (A)=>{ + if ($ec3de3bad43fb783$var$GA(A)) return $ec3de3bad43fb783$var$lA(A, $ec3de3bad43fb783$var$eA); + A.total_in = A.total_out = 0, A.data_type = $ec3de3bad43fb783$var$oA; + const t = A.state; + return t.pending = 0, t.pending_out = 0, t.wrap < 0 && (t.wrap = -t.wrap), t.status = 2 === t.wrap ? 57 : t.wrap ? $ec3de3bad43fb783$var$CA : $ec3de3bad43fb783$var$IA, A.adler = 2 === t.wrap ? 0 : 1, t.last_flush = -2, $ec3de3bad43fb783$var$z(t), $ec3de3bad43fb783$var$AA; +}, $ec3de3bad43fb783$var$YA = (A)=>{ + const t = $ec3de3bad43fb783$var$mA(A); + var e; + return t === $ec3de3bad43fb783$var$AA && ((e = A.state).window_size = 2 * e.w_size, $ec3de3bad43fb783$var$MA(e.head), e.max_lazy_match = $ec3de3bad43fb783$var$OA[e.level].max_lazy, e.good_match = $ec3de3bad43fb783$var$OA[e.level].good_length, e.nice_match = $ec3de3bad43fb783$var$OA[e.level].nice_length, e.max_chain_length = $ec3de3bad43fb783$var$OA[e.level].max_chain, e.strstart = 0, e.block_start = 0, e.lookahead = 0, e.insert = 0, e.match_length = e.prev_length = 2, e.match_available = 0, e.ins_h = 0), t; +}, $ec3de3bad43fb783$var$bA = (A, t, e, i, s, a)=>{ + if (!A) return $ec3de3bad43fb783$var$eA; + let n = 1; + if (t === $ec3de3bad43fb783$var$aA && (t = 6), i < 0 ? (n = 0, i = -i) : i > 15 && (n = 2, i -= 16), s < 1 || s > 9 || e !== $ec3de3bad43fb783$var$BA || i < 8 || i > 15 || t < 0 || t > 9 || a < 0 || a > $ec3de3bad43fb783$var$rA || 8 === i && 1 !== n) return $ec3de3bad43fb783$var$lA(A, $ec3de3bad43fb783$var$eA); + 8 === i && (i = 9); + const E = new $ec3de3bad43fb783$var$UA; + return A.state = E, E.strm = A, E.status = $ec3de3bad43fb783$var$CA, E.wrap = n, E.gzhead = null, E.w_bits = i, E.w_size = 1 << E.w_bits, E.w_mask = E.w_size - 1, E.hash_bits = s + 7, E.hash_size = 1 << E.hash_bits, E.hash_mask = E.hash_size - 1, E.hash_shift = ~~((E.hash_bits + 3 - 1) / 3), E.window = new Uint8Array(2 * E.w_size), E.head = new Uint16Array(E.hash_size), E.prev = new Uint16Array(E.w_size), E.lit_bufsize = 1 << s + 6, E.pending_buf_size = 4 * E.lit_bufsize, E.pending_buf = new Uint8Array(E.pending_buf_size), E.sym_buf = E.lit_bufsize, E.sym_end = 3 * (E.lit_bufsize - 1), E.level = t, E.strategy = a, E.method = e, $ec3de3bad43fb783$var$YA(A); +}; +var $ec3de3bad43fb783$var$KA = { + deflateInit: (A, t)=>$ec3de3bad43fb783$var$bA(A, t, $ec3de3bad43fb783$var$BA, 15, 8, $ec3de3bad43fb783$var$gA), + deflateInit2: $ec3de3bad43fb783$var$bA, + deflateReset: $ec3de3bad43fb783$var$YA, + deflateResetKeep: $ec3de3bad43fb783$var$mA, + deflateSetHeader: (A, t)=>$ec3de3bad43fb783$var$GA(A) || 2 !== A.state.wrap ? $ec3de3bad43fb783$var$eA : (A.state.gzhead = t, $ec3de3bad43fb783$var$AA), + deflate: (A, t)=>{ + if ($ec3de3bad43fb783$var$GA(A) || t > $ec3de3bad43fb783$var$$ || t < 0) return A ? $ec3de3bad43fb783$var$lA(A, $ec3de3bad43fb783$var$eA) : $ec3de3bad43fb783$var$eA; + const e = A.state; + if (!A.output || 0 !== A.avail_in && !A.input || e.status === $ec3de3bad43fb783$var$_A && t !== $ec3de3bad43fb783$var$V) return $ec3de3bad43fb783$var$lA(A, 0 === A.avail_out ? $ec3de3bad43fb783$var$sA : $ec3de3bad43fb783$var$eA); + const i = e.last_flush; + if (e.last_flush = t, 0 !== e.pending) { + if ($ec3de3bad43fb783$var$SA(A), 0 === A.avail_out) return e.last_flush = -1, $ec3de3bad43fb783$var$AA; + } else if (0 === A.avail_in && $ec3de3bad43fb783$var$dA(t) <= $ec3de3bad43fb783$var$dA(i) && t !== $ec3de3bad43fb783$var$V) return $ec3de3bad43fb783$var$lA(A, $ec3de3bad43fb783$var$sA); + if (e.status === $ec3de3bad43fb783$var$_A && 0 !== A.avail_in) return $ec3de3bad43fb783$var$lA(A, $ec3de3bad43fb783$var$sA); + if (e.status === $ec3de3bad43fb783$var$CA && 0 === e.wrap && (e.status = $ec3de3bad43fb783$var$IA), e.status === $ec3de3bad43fb783$var$CA) { + let t = $ec3de3bad43fb783$var$BA + (e.w_bits - 8 << 4) << 8, i = -1; + if (i = e.strategy >= $ec3de3bad43fb783$var$EA || e.level < 2 ? 0 : e.level < 6 ? 1 : 6 === e.level ? 2 : 3, t |= i << 6, 0 !== e.strstart && (t |= 32), t += 31 - t % 31, $ec3de3bad43fb783$var$FA(e, t), 0 !== e.strstart && ($ec3de3bad43fb783$var$FA(e, A.adler >>> 16), $ec3de3bad43fb783$var$FA(e, 65535 & A.adler)), A.adler = 1, e.status = $ec3de3bad43fb783$var$IA, $ec3de3bad43fb783$var$SA(A), 0 !== e.pending) return e.last_flush = -1, $ec3de3bad43fb783$var$AA; + } + if (57 === e.status) { + if (A.adler = 0, $ec3de3bad43fb783$var$fA(e, 31), $ec3de3bad43fb783$var$fA(e, 139), $ec3de3bad43fb783$var$fA(e, 8), e.gzhead) $ec3de3bad43fb783$var$fA(e, (e.gzhead.text ? 1 : 0) + (e.gzhead.hcrc ? 2 : 0) + (e.gzhead.extra ? 4 : 0) + (e.gzhead.name ? 8 : 0) + (e.gzhead.comment ? 16 : 0)), $ec3de3bad43fb783$var$fA(e, 255 & e.gzhead.time), $ec3de3bad43fb783$var$fA(e, e.gzhead.time >> 8 & 255), $ec3de3bad43fb783$var$fA(e, e.gzhead.time >> 16 & 255), $ec3de3bad43fb783$var$fA(e, e.gzhead.time >> 24 & 255), $ec3de3bad43fb783$var$fA(e, 9 === e.level ? 2 : e.strategy >= $ec3de3bad43fb783$var$EA || e.level < 2 ? 4 : 0), $ec3de3bad43fb783$var$fA(e, 255 & e.gzhead.os), e.gzhead.extra && e.gzhead.extra.length && ($ec3de3bad43fb783$var$fA(e, 255 & e.gzhead.extra.length), $ec3de3bad43fb783$var$fA(e, e.gzhead.extra.length >> 8 & 255)), e.gzhead.hcrc && (A.adler = $ec3de3bad43fb783$var$x(A.adler, e.pending_buf, e.pending, 0)), e.gzindex = 0, e.status = 69; + else if ($ec3de3bad43fb783$var$fA(e, 0), $ec3de3bad43fb783$var$fA(e, 0), $ec3de3bad43fb783$var$fA(e, 0), $ec3de3bad43fb783$var$fA(e, 0), $ec3de3bad43fb783$var$fA(e, 0), $ec3de3bad43fb783$var$fA(e, 9 === e.level ? 2 : e.strategy >= $ec3de3bad43fb783$var$EA || e.level < 2 ? 4 : 0), $ec3de3bad43fb783$var$fA(e, 3), e.status = $ec3de3bad43fb783$var$IA, $ec3de3bad43fb783$var$SA(A), 0 !== e.pending) return e.last_flush = -1, $ec3de3bad43fb783$var$AA; + } + if (69 === e.status) { + if (e.gzhead.extra) { + let t = e.pending, i = (65535 & e.gzhead.extra.length) - e.gzindex; + for(; e.pending + i > e.pending_buf_size;){ + let s = e.pending_buf_size - e.pending; + if (e.pending_buf.set(e.gzhead.extra.subarray(e.gzindex, e.gzindex + s), e.pending), e.pending = e.pending_buf_size, e.gzhead.hcrc && e.pending > t && (A.adler = $ec3de3bad43fb783$var$x(A.adler, e.pending_buf, e.pending - t, t)), e.gzindex += s, $ec3de3bad43fb783$var$SA(A), 0 !== e.pending) return e.last_flush = -1, $ec3de3bad43fb783$var$AA; + t = 0, i -= s; + } + let s = new Uint8Array(e.gzhead.extra); + e.pending_buf.set(s.subarray(e.gzindex, e.gzindex + i), e.pending), e.pending += i, e.gzhead.hcrc && e.pending > t && (A.adler = $ec3de3bad43fb783$var$x(A.adler, e.pending_buf, e.pending - t, t)), e.gzindex = 0; + } + e.status = 73; + } + if (73 === e.status) { + if (e.gzhead.name) { + let t, i = e.pending; + do { + if (e.pending === e.pending_buf_size) { + if (e.gzhead.hcrc && e.pending > i && (A.adler = $ec3de3bad43fb783$var$x(A.adler, e.pending_buf, e.pending - i, i)), $ec3de3bad43fb783$var$SA(A), 0 !== e.pending) return e.last_flush = -1, $ec3de3bad43fb783$var$AA; + i = 0; + } + t = e.gzindex < e.gzhead.name.length ? 255 & e.gzhead.name.charCodeAt(e.gzindex++) : 0, $ec3de3bad43fb783$var$fA(e, t); + }while (0 !== t); + e.gzhead.hcrc && e.pending > i && (A.adler = $ec3de3bad43fb783$var$x(A.adler, e.pending_buf, e.pending - i, i)), e.gzindex = 0; + } + e.status = 91; + } + if (91 === e.status) { + if (e.gzhead.comment) { + let t, i = e.pending; + do { + if (e.pending === e.pending_buf_size) { + if (e.gzhead.hcrc && e.pending > i && (A.adler = $ec3de3bad43fb783$var$x(A.adler, e.pending_buf, e.pending - i, i)), $ec3de3bad43fb783$var$SA(A), 0 !== e.pending) return e.last_flush = -1, $ec3de3bad43fb783$var$AA; + i = 0; + } + t = e.gzindex < e.gzhead.comment.length ? 255 & e.gzhead.comment.charCodeAt(e.gzindex++) : 0, $ec3de3bad43fb783$var$fA(e, t); + }while (0 !== t); + e.gzhead.hcrc && e.pending > i && (A.adler = $ec3de3bad43fb783$var$x(A.adler, e.pending_buf, e.pending - i, i)); + } + e.status = 103; + } + if (103 === e.status) { + if (e.gzhead.hcrc) { + if (e.pending + 2 > e.pending_buf_size && ($ec3de3bad43fb783$var$SA(A), 0 !== e.pending)) return e.last_flush = -1, $ec3de3bad43fb783$var$AA; + $ec3de3bad43fb783$var$fA(e, 255 & A.adler), $ec3de3bad43fb783$var$fA(e, A.adler >> 8 & 255), A.adler = 0; + } + if (e.status = $ec3de3bad43fb783$var$IA, $ec3de3bad43fb783$var$SA(A), 0 !== e.pending) return e.last_flush = -1, $ec3de3bad43fb783$var$AA; + } + if (0 !== A.avail_in || 0 !== e.lookahead || t !== $ec3de3bad43fb783$var$W && e.status !== $ec3de3bad43fb783$var$_A) { + let i = 0 === e.level ? $ec3de3bad43fb783$var$yA(e, t) : e.strategy === $ec3de3bad43fb783$var$EA ? ((A, t)=>{ + let e; + for(;;){ + if (0 === A.lookahead && ($ec3de3bad43fb783$var$pA(A), 0 === A.lookahead)) { + if (t === $ec3de3bad43fb783$var$W) return 1; + break; + } + if (A.match_length = 0, e = $ec3de3bad43fb783$var$j(A, 0, A.window[A.strstart]), A.lookahead--, A.strstart++, e && ($ec3de3bad43fb783$var$QA(A, !1), 0 === A.strm.avail_out)) return 1; + } + return A.insert = 0, t === $ec3de3bad43fb783$var$V ? ($ec3de3bad43fb783$var$QA(A, !0), 0 === A.strm.avail_out ? 3 : 4) : A.sym_next && ($ec3de3bad43fb783$var$QA(A, !1), 0 === A.strm.avail_out) ? 1 : 2; + })(e, t) : e.strategy === $ec3de3bad43fb783$var$hA ? ((A, t)=>{ + let e, i, s, a; + const n = A.window; + for(;;){ + if (A.lookahead <= $ec3de3bad43fb783$var$wA) { + if ($ec3de3bad43fb783$var$pA(A), A.lookahead <= $ec3de3bad43fb783$var$wA && t === $ec3de3bad43fb783$var$W) return 1; + if (0 === A.lookahead) break; + } + if (A.match_length = 0, A.lookahead >= 3 && A.strstart > 0 && (s = A.strstart - 1, i = n[s], i === n[++s] && i === n[++s] && i === n[++s])) { + a = A.strstart + $ec3de3bad43fb783$var$wA; + do ; + while (i === n[++s] && i === n[++s] && i === n[++s] && i === n[++s] && i === n[++s] && i === n[++s] && i === n[++s] && i === n[++s] && s < a); + A.match_length = $ec3de3bad43fb783$var$wA - (a - s), A.match_length > A.lookahead && (A.match_length = A.lookahead); + } + if (A.match_length >= 3 ? (e = $ec3de3bad43fb783$var$j(A, 1, A.match_length - 3), A.lookahead -= A.match_length, A.strstart += A.match_length, A.match_length = 0) : (e = $ec3de3bad43fb783$var$j(A, 0, A.window[A.strstart]), A.lookahead--, A.strstart++), e && ($ec3de3bad43fb783$var$QA(A, !1), 0 === A.strm.avail_out)) return 1; + } + return A.insert = 0, t === $ec3de3bad43fb783$var$V ? ($ec3de3bad43fb783$var$QA(A, !0), 0 === A.strm.avail_out ? 3 : 4) : A.sym_next && ($ec3de3bad43fb783$var$QA(A, !1), 0 === A.strm.avail_out) ? 1 : 2; + })(e, t) : $ec3de3bad43fb783$var$OA[e.level].func(e, t); + if (3 !== i && 4 !== i || (e.status = $ec3de3bad43fb783$var$_A), 1 === i || 3 === i) return 0 === A.avail_out && (e.last_flush = -1), $ec3de3bad43fb783$var$AA; + if (2 === i && (t === $ec3de3bad43fb783$var$X ? $ec3de3bad43fb783$var$Z(e) : t !== $ec3de3bad43fb783$var$$ && ($ec3de3bad43fb783$var$N(e, 0, 0, !1), t === $ec3de3bad43fb783$var$q && ($ec3de3bad43fb783$var$MA(e.head), 0 === e.lookahead && (e.strstart = 0, e.block_start = 0, e.insert = 0))), $ec3de3bad43fb783$var$SA(A), 0 === A.avail_out)) return e.last_flush = -1, $ec3de3bad43fb783$var$AA; + } + return t !== $ec3de3bad43fb783$var$V ? $ec3de3bad43fb783$var$AA : e.wrap <= 0 ? $ec3de3bad43fb783$var$tA : (2 === e.wrap ? ($ec3de3bad43fb783$var$fA(e, 255 & A.adler), $ec3de3bad43fb783$var$fA(e, A.adler >> 8 & 255), $ec3de3bad43fb783$var$fA(e, A.adler >> 16 & 255), $ec3de3bad43fb783$var$fA(e, A.adler >> 24 & 255), $ec3de3bad43fb783$var$fA(e, 255 & A.total_in), $ec3de3bad43fb783$var$fA(e, A.total_in >> 8 & 255), $ec3de3bad43fb783$var$fA(e, A.total_in >> 16 & 255), $ec3de3bad43fb783$var$fA(e, A.total_in >> 24 & 255)) : ($ec3de3bad43fb783$var$FA(e, A.adler >>> 16), $ec3de3bad43fb783$var$FA(e, 65535 & A.adler)), $ec3de3bad43fb783$var$SA(A), e.wrap > 0 && (e.wrap = -e.wrap), 0 !== e.pending ? $ec3de3bad43fb783$var$AA : $ec3de3bad43fb783$var$tA); + }, + deflateEnd: (A)=>{ + if ($ec3de3bad43fb783$var$GA(A)) return $ec3de3bad43fb783$var$eA; + const t = A.state.status; + return A.state = null, t === $ec3de3bad43fb783$var$IA ? $ec3de3bad43fb783$var$lA(A, $ec3de3bad43fb783$var$iA) : $ec3de3bad43fb783$var$AA; + }, + deflateSetDictionary: (A, t)=>{ + let e = t.length; + if ($ec3de3bad43fb783$var$GA(A)) return $ec3de3bad43fb783$var$eA; + const i = A.state, s = i.wrap; + if (2 === s || 1 === s && i.status !== $ec3de3bad43fb783$var$CA || i.lookahead) return $ec3de3bad43fb783$var$eA; + if (1 === s && (A.adler = $ec3de3bad43fb783$var$b(A.adler, t, e, 0)), i.wrap = 0, e >= i.w_size) { + 0 === s && ($ec3de3bad43fb783$var$MA(i.head), i.strstart = 0, i.block_start = 0, i.insert = 0); + let A = new Uint8Array(i.w_size); + A.set(t.subarray(e - i.w_size, e), 0), t = A, e = i.w_size; + } + const a = A.avail_in, n = A.next_in, E = A.input; + for(A.avail_in = e, A.next_in = 0, A.input = t, $ec3de3bad43fb783$var$pA(i); i.lookahead >= 3;){ + let A = i.strstart, t = i.lookahead - 2; + do i.ins_h = $ec3de3bad43fb783$var$RA(i, i.ins_h, i.window[A + 3 - 1]), i.prev[A & i.w_mask] = i.head[i.ins_h], i.head[i.ins_h] = A, A++; + while (--t); + i.strstart = A, i.lookahead = 2, $ec3de3bad43fb783$var$pA(i); + } + return i.strstart += i.lookahead, i.block_start = i.strstart, i.insert = i.lookahead, i.lookahead = 0, i.match_length = i.prev_length = 2, i.match_available = 0, A.next_in = n, A.input = E, A.avail_in = a, i.wrap = s, $ec3de3bad43fb783$var$AA; + }, + deflateInfo: "pako deflate (from Nodeca project)" +}; +const $ec3de3bad43fb783$var$xA = (A, t)=>Object.prototype.hasOwnProperty.call(A, t); +var $ec3de3bad43fb783$var$LA = { + assign: function(A) { + const t = Array.prototype.slice.call(arguments, 1); + for(; t.length;){ + const e = t.shift(); + if (e) { + if ("object" != typeof e) throw new TypeError(e + "must be non-object"); + for(const t in e)$ec3de3bad43fb783$var$xA(e, t) && (A[t] = e[t]); + } + } + return A; + }, + flattenChunks: (A)=>{ + let t = 0; + for(let e = 0, i = A.length; e < i; e++)t += A[e].length; + const e = new Uint8Array(t); + for(let t = 0, i = 0, s = A.length; t < s; t++){ + let s = A[t]; + e.set(s, i), i += s.length; + } + return e; + } +}; +let $ec3de3bad43fb783$var$JA = !0; +try { + String.fromCharCode.apply(null, new Uint8Array(1)); +} catch (A) { + $ec3de3bad43fb783$var$JA = !1; +} +const $ec3de3bad43fb783$var$zA = new Uint8Array(256); +for(let A = 0; A < 256; A++)$ec3de3bad43fb783$var$zA[A] = A >= 252 ? 6 : A >= 248 ? 5 : A >= 240 ? 4 : A >= 224 ? 3 : A >= 192 ? 2 : 1; +$ec3de3bad43fb783$var$zA[254] = $ec3de3bad43fb783$var$zA[254] = 1; +var $ec3de3bad43fb783$var$NA = { + string2buf: (A)=>{ + if ("function" == typeof TextEncoder && TextEncoder.prototype.encode) return (new TextEncoder).encode(A); + let t, e, i, s, a, n = A.length, E = 0; + for(s = 0; s < n; s++)e = A.charCodeAt(s), 55296 == (64512 & e) && s + 1 < n && (i = A.charCodeAt(s + 1), 56320 == (64512 & i) && (e = 65536 + (e - 55296 << 10) + (i - 56320), s++)), E += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4; + for(t = new Uint8Array(E), a = 0, s = 0; a < E; s++)e = A.charCodeAt(s), 55296 == (64512 & e) && s + 1 < n && (i = A.charCodeAt(s + 1), 56320 == (64512 & i) && (e = 65536 + (e - 55296 << 10) + (i - 56320), s++)), e < 128 ? t[a++] = e : e < 2048 ? (t[a++] = 192 | e >>> 6, t[a++] = 128 | 63 & e) : e < 65536 ? (t[a++] = 224 | e >>> 12, t[a++] = 128 | e >>> 6 & 63, t[a++] = 128 | 63 & e) : (t[a++] = 240 | e >>> 18, t[a++] = 128 | e >>> 12 & 63, t[a++] = 128 | e >>> 6 & 63, t[a++] = 128 | 63 & e); + return t; + }, + buf2string: (A, t)=>{ + const e = t || A.length; + if ("function" == typeof TextDecoder && TextDecoder.prototype.decode) return (new TextDecoder).decode(A.subarray(0, t)); + let i, s; + const a = new Array(2 * e); + for(s = 0, i = 0; i < e;){ + let t = A[i++]; + if (t < 128) { + a[s++] = t; + continue; + } + let n = $ec3de3bad43fb783$var$zA[t]; + if (n > 4) a[s++] = 65533, i += n - 1; + else { + for(t &= 2 === n ? 31 : 3 === n ? 15 : 7; n > 1 && i < e;)t = t << 6 | 63 & A[i++], n--; + n > 1 ? a[s++] = 65533 : t < 65536 ? a[s++] = t : (t -= 65536, a[s++] = 55296 | t >> 10 & 1023, a[s++] = 56320 | 1023 & t); + } + } + return ((A, t)=>{ + if (t < 65534 && A.subarray && $ec3de3bad43fb783$var$JA) return String.fromCharCode.apply(null, A.length === t ? A : A.subarray(0, t)); + let e = ""; + for(let i = 0; i < t; i++)e += String.fromCharCode(A[i]); + return e; + })(a, s); + }, + utf8border: (A, t)=>{ + (t = t || A.length) > A.length && (t = A.length); + let e = t - 1; + for(; e >= 0 && 128 == (192 & A[e]);)e--; + return e < 0 || 0 === e ? t : e + $ec3de3bad43fb783$var$zA[A[e]] > t ? e : t; + } +}; +var $ec3de3bad43fb783$var$vA = function() { + this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0; +}; +const $ec3de3bad43fb783$var$jA = Object.prototype.toString, { Z_NO_FLUSH: $ec3de3bad43fb783$var$ZA, Z_SYNC_FLUSH: $ec3de3bad43fb783$var$WA, Z_FULL_FLUSH: $ec3de3bad43fb783$var$XA, Z_FINISH: $ec3de3bad43fb783$var$qA, Z_OK: $ec3de3bad43fb783$var$VA, Z_STREAM_END: $ec3de3bad43fb783$var$$A, Z_DEFAULT_COMPRESSION: $ec3de3bad43fb783$var$At, Z_DEFAULT_STRATEGY: $ec3de3bad43fb783$var$tt, Z_DEFLATED: $ec3de3bad43fb783$var$et } = $ec3de3bad43fb783$var$J; +function $ec3de3bad43fb783$var$it(A) { + this.options = $ec3de3bad43fb783$var$LA.assign({ + level: $ec3de3bad43fb783$var$At, + method: $ec3de3bad43fb783$var$et, + chunkSize: 16384, + windowBits: 15, + memLevel: 8, + strategy: $ec3de3bad43fb783$var$tt + }, A || {}); + let t = this.options; + t.raw && t.windowBits > 0 ? t.windowBits = -t.windowBits : t.gzip && t.windowBits > 0 && t.windowBits < 16 && (t.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new $ec3de3bad43fb783$var$vA, this.strm.avail_out = 0; + let e = $ec3de3bad43fb783$var$KA.deflateInit2(this.strm, t.level, t.method, t.windowBits, t.memLevel, t.strategy); + if (e !== $ec3de3bad43fb783$var$VA) throw new Error($ec3de3bad43fb783$var$L[e]); + if (t.header && $ec3de3bad43fb783$var$KA.deflateSetHeader(this.strm, t.header), t.dictionary) { + let A; + if (A = "string" == typeof t.dictionary ? $ec3de3bad43fb783$var$NA.string2buf(t.dictionary) : "[object ArrayBuffer]" === $ec3de3bad43fb783$var$jA.call(t.dictionary) ? new Uint8Array(t.dictionary) : t.dictionary, e = $ec3de3bad43fb783$var$KA.deflateSetDictionary(this.strm, A), e !== $ec3de3bad43fb783$var$VA) throw new Error($ec3de3bad43fb783$var$L[e]); + this._dict_set = !0; + } +} +function $ec3de3bad43fb783$var$st(A, t) { + const e = new $ec3de3bad43fb783$var$it(t); + if (e.push(A, !0), e.err) throw e.msg || $ec3de3bad43fb783$var$L[e.err]; + return e.result; +} +$ec3de3bad43fb783$var$it.prototype.push = function(A, t) { + const e = this.strm, i = this.options.chunkSize; + let s, a; + if (this.ended) return !1; + for(a = t === ~~t ? t : !0 === t ? $ec3de3bad43fb783$var$qA : $ec3de3bad43fb783$var$ZA, "string" == typeof A ? e.input = $ec3de3bad43fb783$var$NA.string2buf(A) : "[object ArrayBuffer]" === $ec3de3bad43fb783$var$jA.call(A) ? e.input = new Uint8Array(A) : e.input = A, e.next_in = 0, e.avail_in = e.input.length;;)if (0 === e.avail_out && (e.output = new Uint8Array(i), e.next_out = 0, e.avail_out = i), (a === $ec3de3bad43fb783$var$WA || a === $ec3de3bad43fb783$var$XA) && e.avail_out <= 6) this.onData(e.output.subarray(0, e.next_out)), e.avail_out = 0; + else { + if (s = $ec3de3bad43fb783$var$KA.deflate(e, a), s === $ec3de3bad43fb783$var$$A) return e.next_out > 0 && this.onData(e.output.subarray(0, e.next_out)), s = $ec3de3bad43fb783$var$KA.deflateEnd(this.strm), this.onEnd(s), this.ended = !0, s === $ec3de3bad43fb783$var$VA; + if (0 !== e.avail_out) { + if (a > 0 && e.next_out > 0) this.onData(e.output.subarray(0, e.next_out)), e.avail_out = 0; + else if (0 === e.avail_in) break; + } else this.onData(e.output); + } + return !0; +}, $ec3de3bad43fb783$var$it.prototype.onData = function(A) { + this.chunks.push(A); +}, $ec3de3bad43fb783$var$it.prototype.onEnd = function(A) { + A === $ec3de3bad43fb783$var$VA && (this.result = $ec3de3bad43fb783$var$LA.flattenChunks(this.chunks)), this.chunks = [], this.err = A, this.msg = this.strm.msg; +}; +var $ec3de3bad43fb783$var$at = { + Deflate: $ec3de3bad43fb783$var$it, + deflate: $ec3de3bad43fb783$var$st, + deflateRaw: function(A, t) { + return (t = t || {}).raw = !0, $ec3de3bad43fb783$var$st(A, t); + }, + gzip: function(A, t) { + return (t = t || {}).gzip = !0, $ec3de3bad43fb783$var$st(A, t); + }, + constants: $ec3de3bad43fb783$var$J +}; +const $ec3de3bad43fb783$var$nt = 16209; +var $ec3de3bad43fb783$var$Et = function(A, t) { + let e, i, s, a, n, E, h, r, g, o, B, w, c, C, I, _, l, d, M, D, R, S, Q, f; + const F = A.state; + e = A.next_in, Q = A.input, i = e + (A.avail_in - 5), s = A.next_out, f = A.output, a = s - (t - A.avail_out), n = s + (A.avail_out - 257), E = F.dmax, h = F.wsize, r = F.whave, g = F.wnext, o = F.window, B = F.hold, w = F.bits, c = F.lencode, C = F.distcode, I = (1 << F.lenbits) - 1, _ = (1 << F.distbits) - 1; + A: do { + w < 15 && (B += Q[e++] << w, w += 8, B += Q[e++] << w, w += 8), l = c[B & I]; + t: for(;;){ + if (d = l >>> 24, B >>>= d, w -= d, d = l >>> 16 & 255, 0 === d) f[s++] = 65535 & l; + else { + if (!(16 & d)) { + if (0 == (64 & d)) { + l = c[(65535 & l) + (B & (1 << d) - 1)]; + continue t; + } + if (32 & d) { + F.mode = 16191; + break A; + } + A.msg = "invalid literal/length code", F.mode = $ec3de3bad43fb783$var$nt; + break A; + } + M = 65535 & l, d &= 15, d && (w < d && (B += Q[e++] << w, w += 8), M += B & (1 << d) - 1, B >>>= d, w -= d), w < 15 && (B += Q[e++] << w, w += 8, B += Q[e++] << w, w += 8), l = C[B & _]; + e: for(;;){ + if (d = l >>> 24, B >>>= d, w -= d, d = l >>> 16 & 255, !(16 & d)) { + if (0 == (64 & d)) { + l = C[(65535 & l) + (B & (1 << d) - 1)]; + continue e; + } + A.msg = "invalid distance code", F.mode = $ec3de3bad43fb783$var$nt; + break A; + } + if (D = 65535 & l, d &= 15, w < d && (B += Q[e++] << w, w += 8, w < d && (B += Q[e++] << w, w += 8)), D += B & (1 << d) - 1, D > E) { + A.msg = "invalid distance too far back", F.mode = $ec3de3bad43fb783$var$nt; + break A; + } + if (B >>>= d, w -= d, d = s - a, D > d) { + if (d = D - d, d > r && F.sane) { + A.msg = "invalid distance too far back", F.mode = $ec3de3bad43fb783$var$nt; + break A; + } + if (R = 0, S = o, 0 === g) { + if (R += h - d, d < M) { + M -= d; + do f[s++] = o[R++]; + while (--d); + R = s - D, S = f; + } + } else if (g < d) { + if (R += h + g - d, d -= g, d < M) { + M -= d; + do f[s++] = o[R++]; + while (--d); + if (R = 0, g < M) { + d = g, M -= d; + do f[s++] = o[R++]; + while (--d); + R = s - D, S = f; + } + } + } else if (R += g - d, d < M) { + M -= d; + do f[s++] = o[R++]; + while (--d); + R = s - D, S = f; + } + for(; M > 2;)f[s++] = S[R++], f[s++] = S[R++], f[s++] = S[R++], M -= 3; + M && (f[s++] = S[R++], M > 1 && (f[s++] = S[R++])); + } else { + R = s - D; + do f[s++] = f[R++], f[s++] = f[R++], f[s++] = f[R++], M -= 3; + while (M > 2); + M && (f[s++] = f[R++], M > 1 && (f[s++] = f[R++])); + } + break; + } + } + break; + } + }while (e < i && s < n); + M = w >> 3, e -= M, w -= M << 3, B &= (1 << w) - 1, A.next_in = e, A.next_out = s, A.avail_in = e < i ? i - e + 5 : 5 - (e - i), A.avail_out = s < n ? n - s + 257 : 257 - (s - n), F.hold = B, F.bits = w; +}; +const $ec3de3bad43fb783$var$ht = 15, $ec3de3bad43fb783$var$rt = new Uint16Array([ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 13, + 15, + 17, + 19, + 23, + 27, + 31, + 35, + 43, + 51, + 59, + 67, + 83, + 99, + 115, + 131, + 163, + 195, + 227, + 258, + 0, + 0 +]), $ec3de3bad43fb783$var$gt = new Uint8Array([ + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 17, + 17, + 17, + 17, + 18, + 18, + 18, + 18, + 19, + 19, + 19, + 19, + 20, + 20, + 20, + 20, + 21, + 21, + 21, + 21, + 16, + 72, + 78 +]), $ec3de3bad43fb783$var$ot = new Uint16Array([ + 1, + 2, + 3, + 4, + 5, + 7, + 9, + 13, + 17, + 25, + 33, + 49, + 65, + 97, + 129, + 193, + 257, + 385, + 513, + 769, + 1025, + 1537, + 2049, + 3073, + 4097, + 6145, + 8193, + 12289, + 16385, + 24577, + 0, + 0 +]), $ec3de3bad43fb783$var$Bt = new Uint8Array([ + 16, + 16, + 16, + 16, + 17, + 17, + 18, + 18, + 19, + 19, + 20, + 20, + 21, + 21, + 22, + 22, + 23, + 23, + 24, + 24, + 25, + 25, + 26, + 26, + 27, + 27, + 28, + 28, + 29, + 29, + 64, + 64 +]); +var $ec3de3bad43fb783$var$wt = (A, t, e, i, s, a, n, E)=>{ + const h = E.bits; + let r, g, o, B, w, c, C = 0, I = 0, _ = 0, l = 0, d = 0, M = 0, D = 0, R = 0, S = 0, Q = 0, f = null; + const F = new Uint16Array(16), T = new Uint16Array(16); + let u, p, y, k = null; + for(C = 0; C <= $ec3de3bad43fb783$var$ht; C++)F[C] = 0; + for(I = 0; I < i; I++)F[t[e + I]]++; + for(d = h, l = $ec3de3bad43fb783$var$ht; l >= 1 && 0 === F[l]; l--); + if (d > l && (d = l), 0 === l) return s[a++] = 20971520, s[a++] = 20971520, E.bits = 1, 0; + for(_ = 1; _ < l && 0 === F[_]; _++); + for(d < _ && (d = _), R = 1, C = 1; C <= $ec3de3bad43fb783$var$ht; C++)if (R <<= 1, R -= F[C], R < 0) return -1; + if (R > 0 && (0 === A || 1 !== l)) return -1; + for(T[1] = 0, C = 1; C < $ec3de3bad43fb783$var$ht; C++)T[C + 1] = T[C] + F[C]; + for(I = 0; I < i; I++)0 !== t[e + I] && (n[T[t[e + I]]++] = I); + if (0 === A ? (f = k = n, c = 20) : 1 === A ? (f = $ec3de3bad43fb783$var$rt, k = $ec3de3bad43fb783$var$gt, c = 257) : (f = $ec3de3bad43fb783$var$ot, k = $ec3de3bad43fb783$var$Bt, c = 0), Q = 0, I = 0, C = _, w = a, M = d, D = 0, o = -1, S = 1 << d, B = S - 1, 1 === A && S > 852 || 2 === A && S > 592) return 1; + for(;;){ + u = C - D, n[I] + 1 < c ? (p = 0, y = n[I]) : n[I] >= c ? (p = k[n[I] - c], y = f[n[I] - c]) : (p = 96, y = 0), r = 1 << C - D, g = 1 << M, _ = g; + do g -= r, s[w + (Q >> D) + g] = u << 24 | p << 16 | y | 0; + while (0 !== g); + for(r = 1 << C - 1; Q & r;)r >>= 1; + if (0 !== r ? (Q &= r - 1, Q += r) : Q = 0, I++, 0 == --F[C]) { + if (C === l) break; + C = t[e + n[I]]; + } + if (C > d && (Q & B) !== o) { + for(0 === D && (D = d), w += _, M = C - D, R = 1 << M; M + D < l && (R -= F[M + D], !(R <= 0));)M++, R <<= 1; + if (S += 1 << M, 1 === A && S > 852 || 2 === A && S > 592) return 1; + o = Q & B, s[o] = d << 24 | M << 16 | w - a | 0; + } + } + return 0 !== Q && (s[w + Q] = C - D << 24 | 4194304), E.bits = d, 0; +}; +const { Z_FINISH: $ec3de3bad43fb783$var$ct, Z_BLOCK: $ec3de3bad43fb783$var$Ct, Z_TREES: $ec3de3bad43fb783$var$It, Z_OK: $ec3de3bad43fb783$var$_t, Z_STREAM_END: $ec3de3bad43fb783$var$lt, Z_NEED_DICT: $ec3de3bad43fb783$var$dt, Z_STREAM_ERROR: $ec3de3bad43fb783$var$Mt, Z_DATA_ERROR: $ec3de3bad43fb783$var$Dt, Z_MEM_ERROR: $ec3de3bad43fb783$var$Rt, Z_BUF_ERROR: $ec3de3bad43fb783$var$St, Z_DEFLATED: $ec3de3bad43fb783$var$Qt } = $ec3de3bad43fb783$var$J, $ec3de3bad43fb783$var$ft = 16180, $ec3de3bad43fb783$var$Ft = 16190, $ec3de3bad43fb783$var$Tt = 16191, $ec3de3bad43fb783$var$ut = 16192, $ec3de3bad43fb783$var$pt = 16194, $ec3de3bad43fb783$var$yt = 16199, $ec3de3bad43fb783$var$kt = 16200, $ec3de3bad43fb783$var$Ht = 16206, $ec3de3bad43fb783$var$Pt = 16209, $ec3de3bad43fb783$var$Ot = (A)=>(A >>> 24 & 255) + (A >>> 8 & 65280) + ((65280 & A) << 8) + ((255 & A) << 24); +function $ec3de3bad43fb783$var$Ut() { + this.strm = null, this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new Uint16Array(320), this.work = new Uint16Array(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0; +} +const $ec3de3bad43fb783$var$Gt = (A)=>{ + if (!A) return 1; + const t = A.state; + return !t || t.strm !== A || t.mode < $ec3de3bad43fb783$var$ft || t.mode > 16211 ? 1 : 0; +}, $ec3de3bad43fb783$var$mt = (A)=>{ + if ($ec3de3bad43fb783$var$Gt(A)) return $ec3de3bad43fb783$var$Mt; + const t = A.state; + return A.total_in = A.total_out = t.total = 0, A.msg = "", t.wrap && (A.adler = 1 & t.wrap), t.mode = $ec3de3bad43fb783$var$ft, t.last = 0, t.havedict = 0, t.flags = -1, t.dmax = 32768, t.head = null, t.hold = 0, t.bits = 0, t.lencode = t.lendyn = new Int32Array(852), t.distcode = t.distdyn = new Int32Array(592), t.sane = 1, t.back = -1, $ec3de3bad43fb783$var$_t; +}, $ec3de3bad43fb783$var$Yt = (A)=>{ + if ($ec3de3bad43fb783$var$Gt(A)) return $ec3de3bad43fb783$var$Mt; + const t = A.state; + return t.wsize = 0, t.whave = 0, t.wnext = 0, $ec3de3bad43fb783$var$mt(A); +}, $ec3de3bad43fb783$var$bt = (A, t)=>{ + let e; + if ($ec3de3bad43fb783$var$Gt(A)) return $ec3de3bad43fb783$var$Mt; + const i = A.state; + return t < 0 ? (e = 0, t = -t) : (e = 5 + (t >> 4), t < 48 && (t &= 15)), t && (t < 8 || t > 15) ? $ec3de3bad43fb783$var$Mt : (null !== i.window && i.wbits !== t && (i.window = null), i.wrap = e, i.wbits = t, $ec3de3bad43fb783$var$Yt(A)); +}, $ec3de3bad43fb783$var$Kt = (A, t)=>{ + if (!A) return $ec3de3bad43fb783$var$Mt; + const e = new $ec3de3bad43fb783$var$Ut; + A.state = e, e.strm = A, e.window = null, e.mode = $ec3de3bad43fb783$var$ft; + const i = $ec3de3bad43fb783$var$bt(A, t); + return i !== $ec3de3bad43fb783$var$_t && (A.state = null), i; +}; +let $ec3de3bad43fb783$var$xt, $ec3de3bad43fb783$var$Lt, $ec3de3bad43fb783$var$Jt = !0; +const $ec3de3bad43fb783$var$zt = (A)=>{ + if ($ec3de3bad43fb783$var$Jt) { + $ec3de3bad43fb783$var$xt = new Int32Array(512), $ec3de3bad43fb783$var$Lt = new Int32Array(32); + let t = 0; + for(; t < 144;)A.lens[t++] = 8; + for(; t < 256;)A.lens[t++] = 9; + for(; t < 280;)A.lens[t++] = 7; + for(; t < 288;)A.lens[t++] = 8; + for($ec3de3bad43fb783$var$wt(1, A.lens, 0, 288, $ec3de3bad43fb783$var$xt, 0, A.work, { + bits: 9 + }), t = 0; t < 32;)A.lens[t++] = 5; + $ec3de3bad43fb783$var$wt(2, A.lens, 0, 32, $ec3de3bad43fb783$var$Lt, 0, A.work, { + bits: 5 + }), $ec3de3bad43fb783$var$Jt = !1; + } + A.lencode = $ec3de3bad43fb783$var$xt, A.lenbits = 9, A.distcode = $ec3de3bad43fb783$var$Lt, A.distbits = 5; +}, $ec3de3bad43fb783$var$Nt = (A, t, e, i)=>{ + let s; + const a = A.state; + return null === a.window && (a.wsize = 1 << a.wbits, a.wnext = 0, a.whave = 0, a.window = new Uint8Array(a.wsize)), i >= a.wsize ? (a.window.set(t.subarray(e - a.wsize, e), 0), a.wnext = 0, a.whave = a.wsize) : (s = a.wsize - a.wnext, s > i && (s = i), a.window.set(t.subarray(e - i, e - i + s), a.wnext), (i -= s) ? (a.window.set(t.subarray(e - i, e), 0), a.wnext = i, a.whave = a.wsize) : (a.wnext += s, a.wnext === a.wsize && (a.wnext = 0), a.whave < a.wsize && (a.whave += s))), 0; +}; +var $ec3de3bad43fb783$var$vt = { + inflateReset: $ec3de3bad43fb783$var$Yt, + inflateReset2: $ec3de3bad43fb783$var$bt, + inflateResetKeep: $ec3de3bad43fb783$var$mt, + inflateInit: (A)=>$ec3de3bad43fb783$var$Kt(A, 15), + inflateInit2: $ec3de3bad43fb783$var$Kt, + inflate: (A, t)=>{ + let e, i, s, a, n, E, h, r, g, o, B, w, c, C, I, _, l, d, M, D, R, S, Q = 0; + const f = new Uint8Array(4); + let F, T; + const u = new Uint8Array([ + 16, + 17, + 18, + 0, + 8, + 7, + 9, + 6, + 10, + 5, + 11, + 4, + 12, + 3, + 13, + 2, + 14, + 1, + 15 + ]); + if ($ec3de3bad43fb783$var$Gt(A) || !A.output || !A.input && 0 !== A.avail_in) return $ec3de3bad43fb783$var$Mt; + e = A.state, e.mode === $ec3de3bad43fb783$var$Tt && (e.mode = $ec3de3bad43fb783$var$ut), n = A.next_out, s = A.output, h = A.avail_out, a = A.next_in, i = A.input, E = A.avail_in, r = e.hold, g = e.bits, o = E, B = h, S = $ec3de3bad43fb783$var$_t; + A: for(;;)switch(e.mode){ + case $ec3de3bad43fb783$var$ft: + if (0 === e.wrap) { + e.mode = $ec3de3bad43fb783$var$ut; + break; + } + for(; g < 16;){ + if (0 === E) break A; + E--, r += i[a++] << g, g += 8; + } + if (2 & e.wrap && 35615 === r) { + 0 === e.wbits && (e.wbits = 15), e.check = 0, f[0] = 255 & r, f[1] = r >>> 8 & 255, e.check = $ec3de3bad43fb783$var$x(e.check, f, 2, 0), r = 0, g = 0, e.mode = 16181; + break; + } + if (e.head && (e.head.done = !1), !(1 & e.wrap) || (((255 & r) << 8) + (r >> 8)) % 31) { + A.msg = "incorrect header check", e.mode = $ec3de3bad43fb783$var$Pt; + break; + } + if ((15 & r) !== $ec3de3bad43fb783$var$Qt) { + A.msg = "unknown compression method", e.mode = $ec3de3bad43fb783$var$Pt; + break; + } + if (r >>>= 4, g -= 4, R = 8 + (15 & r), 0 === e.wbits && (e.wbits = R), R > 15 || R > e.wbits) { + A.msg = "invalid window size", e.mode = $ec3de3bad43fb783$var$Pt; + break; + } + e.dmax = 1 << e.wbits, e.flags = 0, A.adler = e.check = 1, e.mode = 512 & r ? 16189 : $ec3de3bad43fb783$var$Tt, r = 0, g = 0; + break; + case 16181: + for(; g < 16;){ + if (0 === E) break A; + E--, r += i[a++] << g, g += 8; + } + if (e.flags = r, (255 & e.flags) !== $ec3de3bad43fb783$var$Qt) { + A.msg = "unknown compression method", e.mode = $ec3de3bad43fb783$var$Pt; + break; + } + if (57344 & e.flags) { + A.msg = "unknown header flags set", e.mode = $ec3de3bad43fb783$var$Pt; + break; + } + e.head && (e.head.text = r >> 8 & 1), 512 & e.flags && 4 & e.wrap && (f[0] = 255 & r, f[1] = r >>> 8 & 255, e.check = $ec3de3bad43fb783$var$x(e.check, f, 2, 0)), r = 0, g = 0, e.mode = 16182; + case 16182: + for(; g < 32;){ + if (0 === E) break A; + E--, r += i[a++] << g, g += 8; + } + e.head && (e.head.time = r), 512 & e.flags && 4 & e.wrap && (f[0] = 255 & r, f[1] = r >>> 8 & 255, f[2] = r >>> 16 & 255, f[3] = r >>> 24 & 255, e.check = $ec3de3bad43fb783$var$x(e.check, f, 4, 0)), r = 0, g = 0, e.mode = 16183; + case 16183: + for(; g < 16;){ + if (0 === E) break A; + E--, r += i[a++] << g, g += 8; + } + e.head && (e.head.xflags = 255 & r, e.head.os = r >> 8), 512 & e.flags && 4 & e.wrap && (f[0] = 255 & r, f[1] = r >>> 8 & 255, e.check = $ec3de3bad43fb783$var$x(e.check, f, 2, 0)), r = 0, g = 0, e.mode = 16184; + case 16184: + if (1024 & e.flags) { + for(; g < 16;){ + if (0 === E) break A; + E--, r += i[a++] << g, g += 8; + } + e.length = r, e.head && (e.head.extra_len = r), 512 & e.flags && 4 & e.wrap && (f[0] = 255 & r, f[1] = r >>> 8 & 255, e.check = $ec3de3bad43fb783$var$x(e.check, f, 2, 0)), r = 0, g = 0; + } else e.head && (e.head.extra = null); + e.mode = 16185; + case 16185: + if (1024 & e.flags && (w = e.length, w > E && (w = E), w && (e.head && (R = e.head.extra_len - e.length, e.head.extra || (e.head.extra = new Uint8Array(e.head.extra_len)), e.head.extra.set(i.subarray(a, a + w), R)), 512 & e.flags && 4 & e.wrap && (e.check = $ec3de3bad43fb783$var$x(e.check, i, w, a)), E -= w, a += w, e.length -= w), e.length)) break A; + e.length = 0, e.mode = 16186; + case 16186: + if (2048 & e.flags) { + if (0 === E) break A; + w = 0; + do R = i[a + w++], e.head && R && e.length < 65536 && (e.head.name += String.fromCharCode(R)); + while (R && w < E); + if (512 & e.flags && 4 & e.wrap && (e.check = $ec3de3bad43fb783$var$x(e.check, i, w, a)), E -= w, a += w, R) break A; + } else e.head && (e.head.name = null); + e.length = 0, e.mode = 16187; + case 16187: + if (4096 & e.flags) { + if (0 === E) break A; + w = 0; + do R = i[a + w++], e.head && R && e.length < 65536 && (e.head.comment += String.fromCharCode(R)); + while (R && w < E); + if (512 & e.flags && 4 & e.wrap && (e.check = $ec3de3bad43fb783$var$x(e.check, i, w, a)), E -= w, a += w, R) break A; + } else e.head && (e.head.comment = null); + e.mode = 16188; + case 16188: + if (512 & e.flags) { + for(; g < 16;){ + if (0 === E) break A; + E--, r += i[a++] << g, g += 8; + } + if (4 & e.wrap && r !== (65535 & e.check)) { + A.msg = "header crc mismatch", e.mode = $ec3de3bad43fb783$var$Pt; + break; + } + r = 0, g = 0; + } + e.head && (e.head.hcrc = e.flags >> 9 & 1, e.head.done = !0), A.adler = e.check = 0, e.mode = $ec3de3bad43fb783$var$Tt; + break; + case 16189: + for(; g < 32;){ + if (0 === E) break A; + E--, r += i[a++] << g, g += 8; + } + A.adler = e.check = $ec3de3bad43fb783$var$Ot(r), r = 0, g = 0, e.mode = $ec3de3bad43fb783$var$Ft; + case $ec3de3bad43fb783$var$Ft: + if (0 === e.havedict) return A.next_out = n, A.avail_out = h, A.next_in = a, A.avail_in = E, e.hold = r, e.bits = g, $ec3de3bad43fb783$var$dt; + A.adler = e.check = 1, e.mode = $ec3de3bad43fb783$var$Tt; + case $ec3de3bad43fb783$var$Tt: + if (t === $ec3de3bad43fb783$var$Ct || t === $ec3de3bad43fb783$var$It) break A; + case $ec3de3bad43fb783$var$ut: + if (e.last) { + r >>>= 7 & g, g -= 7 & g, e.mode = $ec3de3bad43fb783$var$Ht; + break; + } + for(; g < 3;){ + if (0 === E) break A; + E--, r += i[a++] << g, g += 8; + } + switch(e.last = 1 & r, r >>>= 1, g -= 1, 3 & r){ + case 0: + e.mode = 16193; + break; + case 1: + if ($ec3de3bad43fb783$var$zt(e), e.mode = $ec3de3bad43fb783$var$yt, t === $ec3de3bad43fb783$var$It) { + r >>>= 2, g -= 2; + break A; + } + break; + case 2: + e.mode = 16196; + break; + case 3: + A.msg = "invalid block type", e.mode = $ec3de3bad43fb783$var$Pt; + } + r >>>= 2, g -= 2; + break; + case 16193: + for(r >>>= 7 & g, g -= 7 & g; g < 32;){ + if (0 === E) break A; + E--, r += i[a++] << g, g += 8; + } + if ((65535 & r) != (r >>> 16 ^ 65535)) { + A.msg = "invalid stored block lengths", e.mode = $ec3de3bad43fb783$var$Pt; + break; + } + if (e.length = 65535 & r, r = 0, g = 0, e.mode = $ec3de3bad43fb783$var$pt, t === $ec3de3bad43fb783$var$It) break A; + case $ec3de3bad43fb783$var$pt: + e.mode = 16195; + case 16195: + if (w = e.length, w) { + if (w > E && (w = E), w > h && (w = h), 0 === w) break A; + s.set(i.subarray(a, a + w), n), E -= w, a += w, h -= w, n += w, e.length -= w; + break; + } + e.mode = $ec3de3bad43fb783$var$Tt; + break; + case 16196: + for(; g < 14;){ + if (0 === E) break A; + E--, r += i[a++] << g, g += 8; + } + if (e.nlen = 257 + (31 & r), r >>>= 5, g -= 5, e.ndist = 1 + (31 & r), r >>>= 5, g -= 5, e.ncode = 4 + (15 & r), r >>>= 4, g -= 4, e.nlen > 286 || e.ndist > 30) { + A.msg = "too many length or distance symbols", e.mode = $ec3de3bad43fb783$var$Pt; + break; + } + e.have = 0, e.mode = 16197; + case 16197: + for(; e.have < e.ncode;){ + for(; g < 3;){ + if (0 === E) break A; + E--, r += i[a++] << g, g += 8; + } + e.lens[u[e.have++]] = 7 & r, r >>>= 3, g -= 3; + } + for(; e.have < 19;)e.lens[u[e.have++]] = 0; + if (e.lencode = e.lendyn, e.lenbits = 7, F = { + bits: e.lenbits + }, S = $ec3de3bad43fb783$var$wt(0, e.lens, 0, 19, e.lencode, 0, e.work, F), e.lenbits = F.bits, S) { + A.msg = "invalid code lengths set", e.mode = $ec3de3bad43fb783$var$Pt; + break; + } + e.have = 0, e.mode = 16198; + case 16198: + for(; e.have < e.nlen + e.ndist;){ + for(; Q = e.lencode[r & (1 << e.lenbits) - 1], I = Q >>> 24, _ = Q >>> 16 & 255, l = 65535 & Q, !(I <= g);){ + if (0 === E) break A; + E--, r += i[a++] << g, g += 8; + } + if (l < 16) r >>>= I, g -= I, e.lens[e.have++] = l; + else { + if (16 === l) { + for(T = I + 2; g < T;){ + if (0 === E) break A; + E--, r += i[a++] << g, g += 8; + } + if (r >>>= I, g -= I, 0 === e.have) { + A.msg = "invalid bit length repeat", e.mode = $ec3de3bad43fb783$var$Pt; + break; + } + R = e.lens[e.have - 1], w = 3 + (3 & r), r >>>= 2, g -= 2; + } else if (17 === l) { + for(T = I + 3; g < T;){ + if (0 === E) break A; + E--, r += i[a++] << g, g += 8; + } + r >>>= I, g -= I, R = 0, w = 3 + (7 & r), r >>>= 3, g -= 3; + } else { + for(T = I + 7; g < T;){ + if (0 === E) break A; + E--, r += i[a++] << g, g += 8; + } + r >>>= I, g -= I, R = 0, w = 11 + (127 & r), r >>>= 7, g -= 7; + } + if (e.have + w > e.nlen + e.ndist) { + A.msg = "invalid bit length repeat", e.mode = $ec3de3bad43fb783$var$Pt; + break; + } + for(; w--;)e.lens[e.have++] = R; + } + } + if (e.mode === $ec3de3bad43fb783$var$Pt) break; + if (0 === e.lens[256]) { + A.msg = "invalid code -- missing end-of-block", e.mode = $ec3de3bad43fb783$var$Pt; + break; + } + if (e.lenbits = 9, F = { + bits: e.lenbits + }, S = $ec3de3bad43fb783$var$wt(1, e.lens, 0, e.nlen, e.lencode, 0, e.work, F), e.lenbits = F.bits, S) { + A.msg = "invalid literal/lengths set", e.mode = $ec3de3bad43fb783$var$Pt; + break; + } + if (e.distbits = 6, e.distcode = e.distdyn, F = { + bits: e.distbits + }, S = $ec3de3bad43fb783$var$wt(2, e.lens, e.nlen, e.ndist, e.distcode, 0, e.work, F), e.distbits = F.bits, S) { + A.msg = "invalid distances set", e.mode = $ec3de3bad43fb783$var$Pt; + break; + } + if (e.mode = $ec3de3bad43fb783$var$yt, t === $ec3de3bad43fb783$var$It) break A; + case $ec3de3bad43fb783$var$yt: + e.mode = $ec3de3bad43fb783$var$kt; + case $ec3de3bad43fb783$var$kt: + if (E >= 6 && h >= 258) { + A.next_out = n, A.avail_out = h, A.next_in = a, A.avail_in = E, e.hold = r, e.bits = g, $ec3de3bad43fb783$var$Et(A, B), n = A.next_out, s = A.output, h = A.avail_out, a = A.next_in, i = A.input, E = A.avail_in, r = e.hold, g = e.bits, e.mode === $ec3de3bad43fb783$var$Tt && (e.back = -1); + break; + } + for(e.back = 0; Q = e.lencode[r & (1 << e.lenbits) - 1], I = Q >>> 24, _ = Q >>> 16 & 255, l = 65535 & Q, !(I <= g);){ + if (0 === E) break A; + E--, r += i[a++] << g, g += 8; + } + if (_ && 0 == (240 & _)) { + for(d = I, M = _, D = l; Q = e.lencode[D + ((r & (1 << d + M) - 1) >> d)], I = Q >>> 24, _ = Q >>> 16 & 255, l = 65535 & Q, !(d + I <= g);){ + if (0 === E) break A; + E--, r += i[a++] << g, g += 8; + } + r >>>= d, g -= d, e.back += d; + } + if (r >>>= I, g -= I, e.back += I, e.length = l, 0 === _) { + e.mode = 16205; + break; + } + if (32 & _) { + e.back = -1, e.mode = $ec3de3bad43fb783$var$Tt; + break; + } + if (64 & _) { + A.msg = "invalid literal/length code", e.mode = $ec3de3bad43fb783$var$Pt; + break; + } + e.extra = 15 & _, e.mode = 16201; + case 16201: + if (e.extra) { + for(T = e.extra; g < T;){ + if (0 === E) break A; + E--, r += i[a++] << g, g += 8; + } + e.length += r & (1 << e.extra) - 1, r >>>= e.extra, g -= e.extra, e.back += e.extra; + } + e.was = e.length, e.mode = 16202; + case 16202: + for(; Q = e.distcode[r & (1 << e.distbits) - 1], I = Q >>> 24, _ = Q >>> 16 & 255, l = 65535 & Q, !(I <= g);){ + if (0 === E) break A; + E--, r += i[a++] << g, g += 8; + } + if (0 == (240 & _)) { + for(d = I, M = _, D = l; Q = e.distcode[D + ((r & (1 << d + M) - 1) >> d)], I = Q >>> 24, _ = Q >>> 16 & 255, l = 65535 & Q, !(d + I <= g);){ + if (0 === E) break A; + E--, r += i[a++] << g, g += 8; + } + r >>>= d, g -= d, e.back += d; + } + if (r >>>= I, g -= I, e.back += I, 64 & _) { + A.msg = "invalid distance code", e.mode = $ec3de3bad43fb783$var$Pt; + break; + } + e.offset = l, e.extra = 15 & _, e.mode = 16203; + case 16203: + if (e.extra) { + for(T = e.extra; g < T;){ + if (0 === E) break A; + E--, r += i[a++] << g, g += 8; + } + e.offset += r & (1 << e.extra) - 1, r >>>= e.extra, g -= e.extra, e.back += e.extra; + } + if (e.offset > e.dmax) { + A.msg = "invalid distance too far back", e.mode = $ec3de3bad43fb783$var$Pt; + break; + } + e.mode = 16204; + case 16204: + if (0 === h) break A; + if (w = B - h, e.offset > w) { + if (w = e.offset - w, w > e.whave && e.sane) { + A.msg = "invalid distance too far back", e.mode = $ec3de3bad43fb783$var$Pt; + break; + } + w > e.wnext ? (w -= e.wnext, c = e.wsize - w) : c = e.wnext - w, w > e.length && (w = e.length), C = e.window; + } else C = s, c = n - e.offset, w = e.length; + w > h && (w = h), h -= w, e.length -= w; + do s[n++] = C[c++]; + while (--w); + 0 === e.length && (e.mode = $ec3de3bad43fb783$var$kt); + break; + case 16205: + if (0 === h) break A; + s[n++] = e.length, h--, e.mode = $ec3de3bad43fb783$var$kt; + break; + case $ec3de3bad43fb783$var$Ht: + if (e.wrap) { + for(; g < 32;){ + if (0 === E) break A; + E--, r |= i[a++] << g, g += 8; + } + if (B -= h, A.total_out += B, e.total += B, 4 & e.wrap && B && (A.adler = e.check = e.flags ? $ec3de3bad43fb783$var$x(e.check, s, B, n - B) : $ec3de3bad43fb783$var$b(e.check, s, B, n - B)), B = h, 4 & e.wrap && (e.flags ? r : $ec3de3bad43fb783$var$Ot(r)) !== e.check) { + A.msg = "incorrect data check", e.mode = $ec3de3bad43fb783$var$Pt; + break; + } + r = 0, g = 0; + } + e.mode = 16207; + case 16207: + if (e.wrap && e.flags) { + for(; g < 32;){ + if (0 === E) break A; + E--, r += i[a++] << g, g += 8; + } + if (4 & e.wrap && r !== (4294967295 & e.total)) { + A.msg = "incorrect length check", e.mode = $ec3de3bad43fb783$var$Pt; + break; + } + r = 0, g = 0; + } + e.mode = 16208; + case 16208: + S = $ec3de3bad43fb783$var$lt; + break A; + case $ec3de3bad43fb783$var$Pt: + S = $ec3de3bad43fb783$var$Dt; + break A; + case 16210: + return $ec3de3bad43fb783$var$Rt; + default: + return $ec3de3bad43fb783$var$Mt; + } + return A.next_out = n, A.avail_out = h, A.next_in = a, A.avail_in = E, e.hold = r, e.bits = g, (e.wsize || B !== A.avail_out && e.mode < $ec3de3bad43fb783$var$Pt && (e.mode < $ec3de3bad43fb783$var$Ht || t !== $ec3de3bad43fb783$var$ct)) && $ec3de3bad43fb783$var$Nt(A, A.output, A.next_out, B - A.avail_out), o -= A.avail_in, B -= A.avail_out, A.total_in += o, A.total_out += B, e.total += B, 4 & e.wrap && B && (A.adler = e.check = e.flags ? $ec3de3bad43fb783$var$x(e.check, s, B, A.next_out - B) : $ec3de3bad43fb783$var$b(e.check, s, B, A.next_out - B)), A.data_type = e.bits + (e.last ? 64 : 0) + (e.mode === $ec3de3bad43fb783$var$Tt ? 128 : 0) + (e.mode === $ec3de3bad43fb783$var$yt || e.mode === $ec3de3bad43fb783$var$pt ? 256 : 0), (0 === o && 0 === B || t === $ec3de3bad43fb783$var$ct) && S === $ec3de3bad43fb783$var$_t && (S = $ec3de3bad43fb783$var$St), S; + }, + inflateEnd: (A)=>{ + if ($ec3de3bad43fb783$var$Gt(A)) return $ec3de3bad43fb783$var$Mt; + let t = A.state; + return t.window && (t.window = null), A.state = null, $ec3de3bad43fb783$var$_t; + }, + inflateGetHeader: (A, t)=>{ + if ($ec3de3bad43fb783$var$Gt(A)) return $ec3de3bad43fb783$var$Mt; + const e = A.state; + return 0 == (2 & e.wrap) ? $ec3de3bad43fb783$var$Mt : (e.head = t, t.done = !1, $ec3de3bad43fb783$var$_t); + }, + inflateSetDictionary: (A, t)=>{ + const e = t.length; + let i, s, a; + return $ec3de3bad43fb783$var$Gt(A) ? $ec3de3bad43fb783$var$Mt : (i = A.state, 0 !== i.wrap && i.mode !== $ec3de3bad43fb783$var$Ft ? $ec3de3bad43fb783$var$Mt : i.mode === $ec3de3bad43fb783$var$Ft && (s = 1, s = $ec3de3bad43fb783$var$b(s, t, e, 0), s !== i.check) ? $ec3de3bad43fb783$var$Dt : (a = $ec3de3bad43fb783$var$Nt(A, t, e, e), a ? (i.mode = 16210, $ec3de3bad43fb783$var$Rt) : (i.havedict = 1, $ec3de3bad43fb783$var$_t))); + }, + inflateInfo: "pako inflate (from Nodeca project)" +}; +var $ec3de3bad43fb783$var$jt = function() { + this.text = 0, this.time = 0, this.xflags = 0, this.os = 0, this.extra = null, this.extra_len = 0, this.name = "", this.comment = "", this.hcrc = 0, this.done = !1; +}; +const $ec3de3bad43fb783$var$Zt = Object.prototype.toString, { Z_NO_FLUSH: $ec3de3bad43fb783$var$Wt, Z_FINISH: $ec3de3bad43fb783$var$Xt, Z_OK: $ec3de3bad43fb783$var$qt, Z_STREAM_END: $ec3de3bad43fb783$var$Vt, Z_NEED_DICT: $ec3de3bad43fb783$var$$t, Z_STREAM_ERROR: $ec3de3bad43fb783$var$Ae, Z_DATA_ERROR: $ec3de3bad43fb783$var$te, Z_MEM_ERROR: $ec3de3bad43fb783$var$ee } = $ec3de3bad43fb783$var$J; +function $ec3de3bad43fb783$var$ie(A) { + this.options = $ec3de3bad43fb783$var$LA.assign({ + chunkSize: 65536, + windowBits: 15, + to: "" + }, A || {}); + const t = this.options; + t.raw && t.windowBits >= 0 && t.windowBits < 16 && (t.windowBits = -t.windowBits, 0 === t.windowBits && (t.windowBits = -15)), !(t.windowBits >= 0 && t.windowBits < 16) || A && A.windowBits || (t.windowBits += 32), t.windowBits > 15 && t.windowBits < 48 && 0 == (15 & t.windowBits) && (t.windowBits |= 15), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new $ec3de3bad43fb783$var$vA, this.strm.avail_out = 0; + let e = $ec3de3bad43fb783$var$vt.inflateInit2(this.strm, t.windowBits); + if (e !== $ec3de3bad43fb783$var$qt) throw new Error($ec3de3bad43fb783$var$L[e]); + if (this.header = new $ec3de3bad43fb783$var$jt, $ec3de3bad43fb783$var$vt.inflateGetHeader(this.strm, this.header), t.dictionary && ("string" == typeof t.dictionary ? t.dictionary = $ec3de3bad43fb783$var$NA.string2buf(t.dictionary) : "[object ArrayBuffer]" === $ec3de3bad43fb783$var$Zt.call(t.dictionary) && (t.dictionary = new Uint8Array(t.dictionary)), t.raw && (e = $ec3de3bad43fb783$var$vt.inflateSetDictionary(this.strm, t.dictionary), e !== $ec3de3bad43fb783$var$qt))) throw new Error($ec3de3bad43fb783$var$L[e]); +} +function $ec3de3bad43fb783$var$se(A, t) { + const e = new $ec3de3bad43fb783$var$ie(t); + if (e.push(A), e.err) throw e.msg || $ec3de3bad43fb783$var$L[e.err]; + return e.result; +} +$ec3de3bad43fb783$var$ie.prototype.push = function(A, t) { + const e = this.strm, i = this.options.chunkSize, s = this.options.dictionary; + let a, n, E; + if (this.ended) return !1; + for(n = t === ~~t ? t : !0 === t ? $ec3de3bad43fb783$var$Xt : $ec3de3bad43fb783$var$Wt, "[object ArrayBuffer]" === $ec3de3bad43fb783$var$Zt.call(A) ? e.input = new Uint8Array(A) : e.input = A, e.next_in = 0, e.avail_in = e.input.length;;){ + for(0 === e.avail_out && (e.output = new Uint8Array(i), e.next_out = 0, e.avail_out = i), a = $ec3de3bad43fb783$var$vt.inflate(e, n), a === $ec3de3bad43fb783$var$$t && s && (a = $ec3de3bad43fb783$var$vt.inflateSetDictionary(e, s), a === $ec3de3bad43fb783$var$qt ? a = $ec3de3bad43fb783$var$vt.inflate(e, n) : a === $ec3de3bad43fb783$var$te && (a = $ec3de3bad43fb783$var$$t)); e.avail_in > 0 && a === $ec3de3bad43fb783$var$Vt && e.state.wrap > 0 && 0 !== A[e.next_in];)$ec3de3bad43fb783$var$vt.inflateReset(e), a = $ec3de3bad43fb783$var$vt.inflate(e, n); + switch(a){ + case $ec3de3bad43fb783$var$Ae: + case $ec3de3bad43fb783$var$te: + case $ec3de3bad43fb783$var$$t: + case $ec3de3bad43fb783$var$ee: + return this.onEnd(a), this.ended = !0, !1; + } + if (E = e.avail_out, e.next_out && (0 === e.avail_out || a === $ec3de3bad43fb783$var$Vt)) { + if ("string" === this.options.to) { + let A = $ec3de3bad43fb783$var$NA.utf8border(e.output, e.next_out), t = e.next_out - A, s = $ec3de3bad43fb783$var$NA.buf2string(e.output, A); + e.next_out = t, e.avail_out = i - t, t && e.output.set(e.output.subarray(A, A + t), 0), this.onData(s); + } else this.onData(e.output.length === e.next_out ? e.output : e.output.subarray(0, e.next_out)); + } + if (a !== $ec3de3bad43fb783$var$qt || 0 !== E) { + if (a === $ec3de3bad43fb783$var$Vt) return a = $ec3de3bad43fb783$var$vt.inflateEnd(this.strm), this.onEnd(a), this.ended = !0, !0; + if (0 === e.avail_in) break; + } + } + return !0; +}, $ec3de3bad43fb783$var$ie.prototype.onData = function(A) { + this.chunks.push(A); +}, $ec3de3bad43fb783$var$ie.prototype.onEnd = function(A) { + A === $ec3de3bad43fb783$var$qt && ("string" === this.options.to ? this.result = this.chunks.join("") : this.result = $ec3de3bad43fb783$var$LA.flattenChunks(this.chunks)), this.chunks = [], this.err = A, this.msg = this.strm.msg; +}; +var $ec3de3bad43fb783$var$ae = { + Inflate: $ec3de3bad43fb783$var$ie, + inflate: $ec3de3bad43fb783$var$se, + inflateRaw: function(A, t) { + return (t = t || {}).raw = !0, $ec3de3bad43fb783$var$se(A, t); + }, + ungzip: $ec3de3bad43fb783$var$se, + constants: $ec3de3bad43fb783$var$J +}; +const { Deflate: $ec3de3bad43fb783$var$ne, deflate: $ec3de3bad43fb783$var$Ee, deflateRaw: $ec3de3bad43fb783$var$he, gzip: $ec3de3bad43fb783$var$re } = $ec3de3bad43fb783$var$at, { Inflate: $ec3de3bad43fb783$var$ge, inflate: $ec3de3bad43fb783$var$oe, inflateRaw: $ec3de3bad43fb783$var$Be, ungzip: $ec3de3bad43fb783$var$we } = $ec3de3bad43fb783$var$ae; +var $ec3de3bad43fb783$var$ce = $ec3de3bad43fb783$var$Ee, $ec3de3bad43fb783$var$Ce = $ec3de3bad43fb783$var$ge; +class $ec3de3bad43fb783$export$86495b081fef8e52 { + constructor(A, t = !1, e = !0){ + this.device = A, this.tracing = t, this.slipReaderEnabled = !1, this.leftOver = new Uint8Array(0), this.baudrate = 0, this.traceLog = "", this.lastTraceTime = Date.now(), this._DTR_state = !1, this.slipReaderEnabled = e; + } + getInfo() { + const A = this.device.getInfo(); + return A.usbVendorId && A.usbProductId ? `WebSerial VendorID 0x${A.usbVendorId.toString(16)} ProductID 0x${A.usbProductId.toString(16)}` : ""; + } + getPid() { + return this.device.getInfo().usbProductId; + } + trace(A) { + const t = `${`TRACE ${(Date.now() - this.lastTraceTime).toFixed(3)}`} ${A}`; + console.log(t), this.traceLog += t + "\n"; + } + async returnTrace() { + try { + await navigator.clipboard.writeText(this.traceLog), console.log("Text copied to clipboard!"); + } catch (A) { + console.error("Failed to copy text:", A); + } + } + hexify(A) { + return Array.from(A).map((A)=>A.toString(16).padStart(2, "0")).join("").padEnd(16, " "); + } + hexConvert(A, t = !0) { + if (t && A.length > 16) { + let t = "", e = A; + for(; e.length > 0;){ + const A = e.slice(0, 16), i = String.fromCharCode(...A).split("").map((A)=>" " === A || A >= " " && A <= "~" && " " !== A ? A : ".").join(""); + e = e.slice(16), t += `\n ${this.hexify(A.slice(0, 8))} ${this.hexify(A.slice(8))} | ${i}`; + } + return t; + } + return this.hexify(A); + } + slipWriter(A) { + const t = []; + t.push(192); + for(let e = 0; e < A.length; e++)219 === A[e] ? t.push(219, 221) : 192 === A[e] ? t.push(219, 220) : t.push(A[e]); + return t.push(192), new Uint8Array(t); + } + async write(A) { + const t = this.slipWriter(A); + if (this.device.writable) { + const A = this.device.writable.getWriter(); + this.tracing && (console.log("Write bytes"), this.trace(`Write ${t.length} bytes: ${this.hexConvert(t)}`)), await A.write(t), A.releaseLock(); + } + } + _appendBuffer(A, t) { + const e = new Uint8Array(A.byteLength + t.byteLength); + return e.set(new Uint8Array(A), 0), e.set(new Uint8Array(t), A.byteLength), e.buffer; + } + slipReader(A) { + let t = 0, e = 0, i = 0, s = "init"; + for(; t < A.length;)if ("init" !== s || 192 != A[t]) { + if ("valid_data" === s && 192 == A[t]) { + i = t - 1, s = "packet_complete"; + break; + } + t++; + } else e = t + 1, s = "valid_data", t++; + if ("packet_complete" !== s) return this.leftOver = A, new Uint8Array(0); + this.leftOver = A.slice(i + 2); + const a = new Uint8Array(i - e + 1); + let n = 0; + for(t = e; t <= i; t++, n++)219 !== A[t] || 220 !== A[t + 1] ? 219 !== A[t] || 221 !== A[t + 1] ? a[n] = A[t] : (a[n] = 219, t++) : (a[n] = 192, t++); + return a.slice(0, n); + } + async read(A = 0, t = 12) { + let e, i = this.leftOver; + if (this.leftOver = new Uint8Array(0), this.slipReaderEnabled) { + const A = this.slipReader(i); + if (A.length > 0) return A; + i = this.leftOver, this.leftOver = new Uint8Array(0); + } + if (null == this.device.readable) return this.leftOver; + this.reader = this.device.readable.getReader(); + try { + A > 0 && (e = setTimeout(()=>{ + this.reader && this.reader.cancel(); + }, A)); + do { + const { value: A, done: t } = await this.reader.read(); + if (t) throw this.leftOver = i, new Error("Timeout"); + i = new Uint8Array(this._appendBuffer(i.buffer, A.buffer)); + }while (i.length < t); + } finally{ + A > 0 && clearTimeout(e), this.reader.releaseLock(); + } + if (this.tracing && (console.log("Read bytes"), this.trace(`Read ${i.length} bytes: ${this.hexConvert(i)}`)), this.slipReaderEnabled) { + const A = this.slipReader(i); + return this.tracing && (console.log("Slip reader results"), this.trace(`Read ${A.length} bytes: ${this.hexConvert(A)}`)), A; + } + return i; + } + async rawRead(A = 0) { + if (0 != this.leftOver.length) { + const A = this.leftOver; + return this.leftOver = new Uint8Array(0), A; + } + if (!this.device.readable) return this.leftOver; + let t; + this.reader = this.device.readable.getReader(); + try { + A > 0 && (t = setTimeout(()=>{ + this.reader && this.reader.cancel(); + }, A)); + const { value: e, done: i } = await this.reader.read(); + return i || this.tracing && (console.log("Raw Read bytes"), this.trace(`Read ${e.length} bytes: ${this.hexConvert(e)}`)), e; + } finally{ + A > 0 && clearTimeout(t), this.reader.releaseLock(); + } + } + async setRTS(A) { + await this.device.setSignals({ + requestToSend: A + }), await this.setDTR(this._DTR_state); + } + async setDTR(A) { + this._DTR_state = A, await this.device.setSignals({ + dataTerminalReady: A + }); + } + async connect(A = 115200, t = {}) { + await this.device.open({ + baudRate: A, + dataBits: null == t ? void 0 : t.dataBits, + stopBits: null == t ? void 0 : t.stopBits, + bufferSize: null == t ? void 0 : t.bufferSize, + parity: null == t ? void 0 : t.parity, + flowControl: null == t ? void 0 : t.flowControl + }), this.baudrate = A, this.leftOver = new Uint8Array(0); + } + async sleep(A) { + return new Promise((t)=>setTimeout(t, A)); + } + async waitForUnlock(A) { + for(; this.device.readable && this.device.readable.locked || this.device.writable && this.device.writable.locked;)await this.sleep(A); + } + async disconnect() { + var A, t; + (null === (A = this.device.readable) || void 0 === A ? void 0 : A.locked) && await (null === (t = this.reader) || void 0 === t ? void 0 : t.cancel()), await this.waitForUnlock(400), this.reader = void 0, await this.device.close(); + } +} +function $ec3de3bad43fb783$var$_e(A) { + return new Promise((t)=>setTimeout(t, A)); +} +async function $ec3de3bad43fb783$export$d3423661fbfd2b60(A, t = 50) { + await A.setDTR(!1), await A.setRTS(!0), await $ec3de3bad43fb783$var$_e(100), await A.setDTR(!0), await A.setRTS(!1), await $ec3de3bad43fb783$var$_e(t), await A.setDTR(!1); +} +async function $ec3de3bad43fb783$export$3252bdf5627aa8a3(A) { + await A.setRTS(!1), await A.setDTR(!1), await $ec3de3bad43fb783$var$_e(100), await A.setDTR(!0), await A.setRTS(!1), await $ec3de3bad43fb783$var$_e(100), await A.setRTS(!0), await A.setDTR(!1), await A.setRTS(!0), await $ec3de3bad43fb783$var$_e(100), await A.setRTS(!1), await A.setDTR(!1); +} +async function $ec3de3bad43fb783$export$4ff35e5b1175d6f6(A, t = !1) { + t ? (await $ec3de3bad43fb783$var$_e(200), await A.setRTS(!1), await $ec3de3bad43fb783$var$_e(200)) : (await $ec3de3bad43fb783$var$_e(100), await A.setRTS(!1)); +} +function $ec3de3bad43fb783$export$929a22f56823f4cb(A) { + const t = [ + "D", + "R", + "W" + ], e = A.split("|"); + for (const A of e){ + const e = A[0], i = A.slice(1); + if (!t.includes(e)) return !1; + if ("D" === e || "R" === e) { + if ("0" !== i && "1" !== i) return !1; + } else if ("W" === e) { + const A = parseInt(i); + if (isNaN(A) || A <= 0) return !1; + } + } + return !0; +} +async function $ec3de3bad43fb783$export$e5e6796b349bcc84(A, t) { + const e = { + D: async (t)=>await A.setDTR(t), + R: async (t)=>await A.setRTS(t), + W: async (A)=>await $ec3de3bad43fb783$var$_e(A) + }; + try { + if (!$ec3de3bad43fb783$export$929a22f56823f4cb(t)) return; + const A = t.split("|"); + for (const t of A){ + const A = t[0], i = t.slice(1); + "W" === A ? await e.W(Number(i)) : "D" !== A && "R" !== A || await e[A]("1" === i); + } + } catch (A) { + throw new Error("Invalid custom reset sequence"); + } +} +var $ec3de3bad43fb783$var$Se = function(A) { + return atob(A); +}; +class $ec3de3bad43fb783$export$b0f7a6c745790308 { + constructor(A){ + this.ESP_RAM_BLOCK = 6144, this.ESP_FLASH_BEGIN = 2, this.ESP_FLASH_DATA = 3, this.ESP_FLASH_END = 4, this.ESP_MEM_BEGIN = 5, this.ESP_MEM_END = 6, this.ESP_MEM_DATA = 7, this.ESP_WRITE_REG = 9, this.ESP_READ_REG = 10, this.ESP_SPI_ATTACH = 13, this.ESP_CHANGE_BAUDRATE = 15, this.ESP_FLASH_DEFL_BEGIN = 16, this.ESP_FLASH_DEFL_DATA = 17, this.ESP_FLASH_DEFL_END = 18, this.ESP_SPI_FLASH_MD5 = 19, this.ESP_ERASE_FLASH = 208, this.ESP_ERASE_REGION = 209, this.ESP_READ_FLASH = 210, this.ESP_RUN_USER_CODE = 211, this.ESP_IMAGE_MAGIC = 233, this.ESP_CHECKSUM_MAGIC = 239, this.ROM_INVALID_RECV_MSG = 5, this.ERASE_REGION_TIMEOUT_PER_MB = 3e4, this.ERASE_WRITE_TIMEOUT_PER_MB = 4e4, this.MD5_TIMEOUT_PER_MB = 8e3, this.CHIP_ERASE_TIMEOUT = 12e4, this.FLASH_READ_TIMEOUT = 1e5, this.MAX_TIMEOUT = 2 * this.CHIP_ERASE_TIMEOUT, this.CHIP_DETECT_MAGIC_REG_ADDR = 1073745920, this.DETECTED_FLASH_SIZES = { + 18: "256KB", + 19: "512KB", + 20: "1MB", + 21: "2MB", + 22: "4MB", + 23: "8MB", + 24: "16MB" + }, this.DETECTED_FLASH_SIZES_NUM = { + 18: 256, + 19: 512, + 20: 1024, + 21: 2048, + 22: 4096, + 23: 8192, + 24: 16384 + }, this.USB_JTAG_SERIAL_PID = 4097, this.romBaudrate = 115200, this.debugLogging = !1, this.syncStubDetected = !1, this.checksum = function(A) { + let t, e = 239; + for(t = 0; t < A.length; t++)e ^= A[t]; + return e; + }, this.timeoutPerMb = function(A, t) { + const e = A * (t / 1e6); + return e < 3e3 ? 3e3 : e; + }, this.flashSizeBytes = function(A) { + let t = -1; + return -1 !== A.indexOf("KB") ? t = 1024 * parseInt(A.slice(0, A.indexOf("KB"))) : -1 !== A.indexOf("MB") && (t = 1024 * parseInt(A.slice(0, A.indexOf("MB"))) * 1024), t; + }, this.IS_STUB = !1, this.FLASH_WRITE_SIZE = 16384, this.transport = A.transport, this.baudrate = A.baudrate, A.serialOptions && (this.serialOptions = A.serialOptions), A.romBaudrate && (this.romBaudrate = A.romBaudrate), A.terminal && (this.terminal = A.terminal, this.terminal.clean()), void 0 !== A.debugLogging && (this.debugLogging = A.debugLogging), A.port && (this.transport = new $ec3de3bad43fb783$export$86495b081fef8e52(A.port)), void 0 !== A.enableTracing && (this.transport.tracing = A.enableTracing), this.info("esptool.js"), this.info("Serial port " + this.transport.getInfo()); + } + _sleep(A) { + return new Promise((t)=>setTimeout(t, A)); + } + write(A, t = !0) { + this.terminal ? t ? this.terminal.writeLine(A) : this.terminal.write(A) : console.log(A); + } + error(A, t = !0) { + this.write(`Error: ${A}`, t); + } + info(A, t = !0) { + this.write(A, t); + } + debug(A, t = !0) { + this.debugLogging && this.write(`Debug: ${A}`, t); + } + _shortToBytearray(A) { + return new Uint8Array([ + 255 & A, + A >> 8 & 255 + ]); + } + _intToByteArray(A) { + return new Uint8Array([ + 255 & A, + A >> 8 & 255, + A >> 16 & 255, + A >> 24 & 255 + ]); + } + _byteArrayToShort(A, t) { + return A | t >> 8; + } + _byteArrayToInt(A, t, e, i) { + return A | t << 8 | e << 16 | i << 24; + } + _appendBuffer(A, t) { + const e = new Uint8Array(A.byteLength + t.byteLength); + return e.set(new Uint8Array(A), 0), e.set(new Uint8Array(t), A.byteLength), e.buffer; + } + _appendArray(A, t) { + const e = new Uint8Array(A.length + t.length); + return e.set(A, 0), e.set(t, A.length), e; + } + ui8ToBstr(A) { + let t = ""; + for(let e = 0; e < A.length; e++)t += String.fromCharCode(A[e]); + return t; + } + bstrToUi8(A) { + const t = new Uint8Array(A.length); + for(let e = 0; e < A.length; e++)t[e] = A.charCodeAt(e); + return t; + } + async flushInput() { + try { + await this.transport.rawRead(200); + } catch (A) { + this.error(A.message); + } + } + async readPacket(t = null, e = 3e3) { + for(let i = 0; i < 100; i++){ + const i = await this.transport.read(e), s = i[0], a = i[1], n = this._byteArrayToInt(i[4], i[5], i[6], i[7]), E = i.slice(8); + if (1 == s) { + if (null == t || a == t) return [ + n, + E + ]; + if (0 != E[0] && E[1] == this.ROM_INVALID_RECV_MSG) throw await this.flushInput(), new $ec3de3bad43fb783$var$A("unsupported command error"); + } + } + throw new $ec3de3bad43fb783$var$A("invalid response"); + } + async command(A = null, t = new Uint8Array(0), e = 0, i = !0, s = 3e3) { + if (null != A) { + this.transport.tracing && this.transport.trace(`command op:0x${A.toString(16).padStart(2, "0")} data len=${t.length} wait_response=${i ? 1 : 0} timeout=${(s / 1e3).toFixed(3)} data=${this.transport.hexConvert(t)}`); + const a = new Uint8Array(8 + t.length); + let n; + for(a[0] = 0, a[1] = A, a[2] = this._shortToBytearray(t.length)[0], a[3] = this._shortToBytearray(t.length)[1], a[4] = this._intToByteArray(e)[0], a[5] = this._intToByteArray(e)[1], a[6] = this._intToByteArray(e)[2], a[7] = this._intToByteArray(e)[3], n = 0; n < t.length; n++)a[8 + n] = t[n]; + await this.transport.write(a); + } + return i ? this.readPacket(A, s) : [ + 0, + new Uint8Array(0) + ]; + } + async readReg(A, t = 3e3) { + const e = this._intToByteArray(A); + return (await this.command(this.ESP_READ_REG, e, void 0, void 0, t))[0]; + } + async writeReg(A, t, e = 4294967295, i = 0, s = 0) { + let a = this._appendArray(this._intToByteArray(A), this._intToByteArray(t)); + a = this._appendArray(a, this._intToByteArray(e)), a = this._appendArray(a, this._intToByteArray(i)), s > 0 && (a = this._appendArray(a, this._intToByteArray(this.chip.UART_DATE_REG_ADDR)), a = this._appendArray(a, this._intToByteArray(0)), a = this._appendArray(a, this._intToByteArray(0)), a = this._appendArray(a, this._intToByteArray(s))), await this.checkCommand("write target memory", this.ESP_WRITE_REG, a); + } + async sync() { + this.debug("Sync"); + const A = new Uint8Array(36); + let t; + for(A[0] = 7, A[1] = 7, A[2] = 18, A[3] = 32, t = 0; t < 32; t++)A[4 + t] = 85; + try { + const t = await this.command(8, A, void 0, void 0, 100); + return this.syncStubDetected = this.syncStubDetected && 0 === t[0], t; + } catch (A) { + throw this.debug("Sync err " + A), A; + } + } + async _connectAttempt(A = "default_reset", t = !1) { + if (this.debug("_connect_attempt " + A + " " + t), "no_reset" !== A) { + if (this.transport.getPid() === this.USB_JTAG_SERIAL_PID) await $ec3de3bad43fb783$export$3252bdf5627aa8a3(this.transport); + else { + const A = t ? "D0|R1|W100|W2000|D1|R0|W50|D0" : "D0|R1|W100|D1|R0|W50|D0"; + await $ec3de3bad43fb783$export$e5e6796b349bcc84(this.transport, A); + } + } + let e = 0, i = !0; + for(; i;){ + try { + e += (await this.transport.read(1e3)).length; + } catch (A) { + if (this.debug(A.message), A instanceof Error) { + i = !1; + break; + } + } + await this._sleep(50); + } + for(this.transport.slipReaderEnabled = !0, this.syncStubDetected = !0, e = 7; e--;){ + try { + const A = await this.sync(); + return this.debug(A[0].toString()), "success"; + } catch (A) { + A instanceof Error && (t ? this.info("_", !1) : this.info(".", !1)); + } + await this._sleep(50); + } + return "error"; + } + async connect(t = "default_reset", e = 7, i = !1) { + let s, a; + for(this.info("Connecting...", !1), await this.transport.connect(this.romBaudrate, this.serialOptions), s = 0; s < e && (a = await this._connectAttempt(t, !1), "success" !== a) && (a = await this._connectAttempt(t, !0), "success" !== a); s++); + if ("success" !== a) throw new $ec3de3bad43fb783$var$A("Failed to connect with the device"); + if (this.info("\n\r", !1), !i) { + const t = await this.readReg(1073745920) >>> 0; + this.debug("Chip Magic " + t.toString(16)); + const e = await async function(A) { + switch(A){ + case 15736195: + { + const { ESP32ROM: A } = await Promise.resolve().then(function() { + return $ec3de3bad43fb783$var$He; + }); + return new A; + } + case 1867591791: + case 2084675695: + { + const { ESP32C2ROM: A } = await Promise.resolve().then(function() { + return $ec3de3bad43fb783$var$Ne; + }); + return new A; + } + case 1763790959: + case 456216687: + case 1216438383: + case 1130455151: + { + const { ESP32C3ROM: A } = await Promise.resolve().then(function() { + return $ec3de3bad43fb783$var$be; + }); + return new A; + } + case 752910447: + { + const { ESP32C6ROM: A } = await Promise.resolve().then(function() { + return $ec3de3bad43fb783$var$Ve; + }); + return new A; + } + case 285294703: + { + const { ESP32C5ROM: A } = await Promise.resolve().then(function() { + return $ec3de3bad43fb783$var$si; + }); + return new A; + } + case 3619110528: + { + const { ESP32H2ROM: A } = await Promise.resolve().then(function() { + return $ec3de3bad43fb783$var$gi; + }); + return new A; + } + case 9: + { + const { ESP32S3ROM: A } = await Promise.resolve().then(function() { + return $ec3de3bad43fb783$var$Ii; + }); + return new A; + } + case 1990: + { + const { ESP32S2ROM: A } = await Promise.resolve().then(function() { + return $ec3de3bad43fb783$var$Ri; + }); + return new A; + } + case 4293968129: + { + const { ESP8266ROM: A } = await Promise.resolve().then(function() { + return $ec3de3bad43fb783$var$ui; + }); + return new A; + } + case 0: + case 182303440: + case 117676761: + { + const { ESP32P4ROM: A } = await Promise.resolve().then(function() { + return $ec3de3bad43fb783$var$Oi; + }); + return new A; + } + default: + return null; + } + }(t); + if (null === this.chip) throw new $ec3de3bad43fb783$var$A(`Unexpected CHIP magic value ${t}. Failed to autodetect chip type.`); + this.chip = e; + } + } + async detectChip(A = "default_reset") { + await this.connect(A), this.info("Detecting chip type... ", !1), null != this.chip ? this.info(this.chip.CHIP_NAME) : this.info("unknown!"); + } + async checkCommand(A = "", t = null, e = new Uint8Array(0), i = 0, s = 3e3) { + this.debug("check_command " + A); + const a = await this.command(t, e, i, void 0, s); + return a[1].length > 4 ? a[1] : a[0]; + } + async memBegin(A, t, e, i) { + this.debug("mem_begin " + A + " " + t + " " + e + " " + i.toString(16)); + let s = this._appendArray(this._intToByteArray(A), this._intToByteArray(t)); + s = this._appendArray(s, this._intToByteArray(e)), s = this._appendArray(s, this._intToByteArray(i)), await this.checkCommand("enter RAM download mode", this.ESP_MEM_BEGIN, s); + } + async memBlock(A, t) { + let e = this._appendArray(this._intToByteArray(A.length), this._intToByteArray(t)); + e = this._appendArray(e, this._intToByteArray(0)), e = this._appendArray(e, this._intToByteArray(0)), e = this._appendArray(e, A); + const i = this.checksum(A); + await this.checkCommand("write to target RAM", this.ESP_MEM_DATA, e, i); + } + async memFinish(A) { + const t = 0 === A ? 1 : 0, e = this._appendArray(this._intToByteArray(t), this._intToByteArray(A)); + await this.checkCommand("leave RAM download mode", this.ESP_MEM_END, e, void 0, 50); + } + async flashSpiAttach(A) { + const t = this._intToByteArray(A); + await this.checkCommand("configure SPI flash pins", this.ESP_SPI_ATTACH, t); + } + async flashBegin(A, t) { + const e = Math.floor((A + this.FLASH_WRITE_SIZE - 1) / this.FLASH_WRITE_SIZE), i = this.chip.getEraseSize(t, A), s = new Date, a = s.getTime(); + let n = 3e3; + 0 == this.IS_STUB && (n = this.timeoutPerMb(this.ERASE_REGION_TIMEOUT_PER_MB, A)), this.debug("flash begin " + i + " " + e + " " + this.FLASH_WRITE_SIZE + " " + t + " " + A); + let E = this._appendArray(this._intToByteArray(i), this._intToByteArray(e)); + E = this._appendArray(E, this._intToByteArray(this.FLASH_WRITE_SIZE)), E = this._appendArray(E, this._intToByteArray(t)), 0 == this.IS_STUB && (E = this._appendArray(E, this._intToByteArray(0))), await this.checkCommand("enter Flash download mode", this.ESP_FLASH_BEGIN, E, void 0, n); + const h = s.getTime(); + return 0 != A && 0 == this.IS_STUB && this.info("Took " + (h - a) / 1e3 + "." + (h - a) % 1e3 + "s to erase flash block"), e; + } + async flashDeflBegin(A, t, e) { + const i = Math.floor((t + this.FLASH_WRITE_SIZE - 1) / this.FLASH_WRITE_SIZE), s = Math.floor((A + this.FLASH_WRITE_SIZE - 1) / this.FLASH_WRITE_SIZE), a = new Date, n = a.getTime(); + let E, h; + this.IS_STUB ? (E = A, h = 3e3) : (E = s * this.FLASH_WRITE_SIZE, h = this.timeoutPerMb(this.ERASE_REGION_TIMEOUT_PER_MB, E)), this.info("Compressed " + A + " bytes to " + t + "..."); + let r = this._appendArray(this._intToByteArray(E), this._intToByteArray(i)); + r = this._appendArray(r, this._intToByteArray(this.FLASH_WRITE_SIZE)), r = this._appendArray(r, this._intToByteArray(e)), "ESP32-S2" !== this.chip.CHIP_NAME && "ESP32-S3" !== this.chip.CHIP_NAME && "ESP32-C3" !== this.chip.CHIP_NAME && "ESP32-C2" !== this.chip.CHIP_NAME || !1 !== this.IS_STUB || (r = this._appendArray(r, this._intToByteArray(0))), await this.checkCommand("enter compressed flash mode", this.ESP_FLASH_DEFL_BEGIN, r, void 0, h); + const g = a.getTime(); + return 0 != A && !1 === this.IS_STUB && this.info("Took " + (g - n) / 1e3 + "." + (g - n) % 1e3 + "s to erase flash block"), i; + } + async flashBlock(A, t, e) { + let i = this._appendArray(this._intToByteArray(A.length), this._intToByteArray(t)); + i = this._appendArray(i, this._intToByteArray(0)), i = this._appendArray(i, this._intToByteArray(0)), i = this._appendArray(i, A); + const s = this.checksum(A); + await this.checkCommand("write to target Flash after seq " + t, this.ESP_FLASH_DATA, i, s, e); + } + async flashDeflBlock(A, t, e) { + let i = this._appendArray(this._intToByteArray(A.length), this._intToByteArray(t)); + i = this._appendArray(i, this._intToByteArray(0)), i = this._appendArray(i, this._intToByteArray(0)), i = this._appendArray(i, A); + const s = this.checksum(A); + this.debug("flash_defl_block " + A[0].toString(16) + " " + A[1].toString(16)), await this.checkCommand("write compressed data to flash after seq " + t, this.ESP_FLASH_DEFL_DATA, i, s, e); + } + async flashFinish(A = !1) { + const t = A ? 0 : 1, e = this._intToByteArray(t); + await this.checkCommand("leave Flash mode", this.ESP_FLASH_END, e); + } + async flashDeflFinish(A = !1) { + const t = A ? 0 : 1, e = this._intToByteArray(t); + await this.checkCommand("leave compressed flash mode", this.ESP_FLASH_DEFL_END, e); + } + async runSpiflashCommand(t, e, i) { + const s = this.chip.SPI_REG_BASE, a = s + 0, n = s + this.chip.SPI_USR_OFFS, E = s + this.chip.SPI_USR1_OFFS, h = s + this.chip.SPI_USR2_OFFS, r = s + this.chip.SPI_W0_OFFS; + let g; + g = null != this.chip.SPI_MOSI_DLEN_OFFS ? async (A, t)=>{ + const e = s + this.chip.SPI_MOSI_DLEN_OFFS, i = s + this.chip.SPI_MISO_DLEN_OFFS; + A > 0 && await this.writeReg(e, A - 1), t > 0 && await this.writeReg(i, t - 1); + } : async (A, t)=>{ + const e = E, i = (0 === t ? 0 : t - 1) << 8 | (0 === A ? 0 : A - 1) << 17; + await this.writeReg(e, i); + }; + const o = 262144; + if (i > 32) throw new $ec3de3bad43fb783$var$A("Reading more than 32 bits back from a SPI flash operation is unsupported"); + if (e.length > 64) throw new $ec3de3bad43fb783$var$A("Writing more than 64 bytes of data with one SPI command is unsupported"); + const B = 8 * e.length, w = await this.readReg(n), c = await this.readReg(h); + let C, I = -2147483648; + i > 0 && (I |= 268435456), B > 0 && (I |= 134217728), await g(B, i), await this.writeReg(n, I); + let _ = 1879048192 | t; + if (await this.writeReg(h, _), 0 == B) await this.writeReg(r, 0); + else { + if (e.length % 4 != 0) { + const A = new Uint8Array(e.length % 4); + e = this._appendArray(e, A); + } + let A = r; + for(C = 0; C < e.length - 4; C += 4)_ = this._byteArrayToInt(e[C], e[C + 1], e[C + 2], e[C + 3]), await this.writeReg(A, _), A += 4; + } + for(await this.writeReg(a, o), C = 0; C < 10 && (_ = await this.readReg(a) & o, 0 != _); C++); + if (10 === C) throw new $ec3de3bad43fb783$var$A("SPI command did not complete in time"); + const l = await this.readReg(r); + return await this.writeReg(n, w), await this.writeReg(h, c), l; + } + async readFlashId() { + const A = new Uint8Array(0); + return await this.runSpiflashCommand(159, A, 24); + } + async eraseFlash() { + this.info("Erasing flash (this may take a while)..."); + let A = new Date; + const t = A.getTime(), e = await this.checkCommand("erase flash", this.ESP_ERASE_FLASH, void 0, void 0, this.CHIP_ERASE_TIMEOUT); + A = new Date; + const i = A.getTime(); + return this.info("Chip erase completed successfully in " + (i - t) / 1e3 + "s"), e; + } + toHex(A) { + return Array.prototype.map.call(A, (A)=>("00" + A.toString(16)).slice(-2)).join(""); + } + async flashMd5sum(A, t) { + const e = this.timeoutPerMb(this.MD5_TIMEOUT_PER_MB, t); + let i = this._appendArray(this._intToByteArray(A), this._intToByteArray(t)); + i = this._appendArray(i, this._intToByteArray(0)), i = this._appendArray(i, this._intToByteArray(0)); + let s = await this.checkCommand("calculate md5sum", this.ESP_SPI_FLASH_MD5, i, void 0, e); + s instanceof Uint8Array && s.length > 16 && (s = s.slice(0, 16)); + return this.toHex(s); + } + async readFlash(t, e, i = null) { + let s = this._appendArray(this._intToByteArray(t), this._intToByteArray(e)); + s = this._appendArray(s, this._intToByteArray(4096)), s = this._appendArray(s, this._intToByteArray(1024)); + const a = await this.checkCommand("read flash", this.ESP_READ_FLASH, s); + if (0 != a) throw new $ec3de3bad43fb783$var$A("Failed to read memory: " + a); + let n = new Uint8Array(0); + for(; n.length < e;){ + const t = await this.transport.read(this.FLASH_READ_TIMEOUT); + if (!(t instanceof Uint8Array)) throw new $ec3de3bad43fb783$var$A("Failed to read memory: " + t); + t.length > 0 && (n = this._appendArray(n, t), await this.transport.write(this._intToByteArray(n.length)), i && i(t, n.length, e)); + } + return n; + } + async runStub() { + if (this.syncStubDetected) return this.info("Stub is already running. No upload is necessary."), this.chip; + this.info("Uploading stub..."); + let t = $ec3de3bad43fb783$var$Se(this.chip.ROM_TEXT), e = t.split("").map(function(A) { + return A.charCodeAt(0); + }); + const i = new Uint8Array(e); + t = $ec3de3bad43fb783$var$Se(this.chip.ROM_DATA), e = t.split("").map(function(A) { + return A.charCodeAt(0); + }); + const s = new Uint8Array(e); + let a, n = Math.floor((i.length + this.ESP_RAM_BLOCK - 1) / this.ESP_RAM_BLOCK); + for(await this.memBegin(i.length, n, this.ESP_RAM_BLOCK, this.chip.TEXT_START), a = 0; a < n; a++){ + const A = a * this.ESP_RAM_BLOCK, t = A + this.ESP_RAM_BLOCK; + await this.memBlock(i.slice(A, t), a); + } + for(n = Math.floor((s.length + this.ESP_RAM_BLOCK - 1) / this.ESP_RAM_BLOCK), await this.memBegin(s.length, n, this.ESP_RAM_BLOCK, this.chip.DATA_START), a = 0; a < n; a++){ + const A = a * this.ESP_RAM_BLOCK, t = A + this.ESP_RAM_BLOCK; + await this.memBlock(s.slice(A, t), a); + } + this.info("Running stub..."), await this.memFinish(this.chip.ENTRY); + for(let A = 0; A < 100; A++){ + const A = await this.transport.read(1e3, 6); + if (79 === A[0] && 72 === A[1] && 65 === A[2] && 73 === A[3]) return this.info("Stub running..."), this.IS_STUB = !0, this.FLASH_WRITE_SIZE = 16384, this.chip; + } + throw new $ec3de3bad43fb783$var$A("Failed to start stub. Unexpected response"); + } + async changeBaud() { + this.info("Changing baudrate to " + this.baudrate); + const A = this.IS_STUB ? this.transport.baudrate : 0, t = this._appendArray(this._intToByteArray(this.baudrate), this._intToByteArray(A)), e = await this.command(this.ESP_CHANGE_BAUDRATE, t); + this.debug(e[0].toString()), this.info("Changed"), await this.transport.disconnect(), await this._sleep(50), await this.transport.connect(this.baudrate, this.serialOptions); + try { + let A = 64; + for(; A--;){ + try { + await this.sync(); + break; + } catch (A) { + this.debug(A.message); + } + await this._sleep(10); + } + } catch (A) { + this.debug(A.message); + } + } + async main(A = "default_reset") { + await this.detectChip(A); + const t = await this.chip.getChipDescription(this); + return this.info("Chip is " + t), this.info("Features: " + await this.chip.getChipFeatures(this)), this.info("Crystal is " + await this.chip.getCrystalFreq(this) + "MHz"), this.info("MAC: " + await this.chip.readMac(this)), await this.chip.readMac(this), void 0 !== this.chip.postConnect && await this.chip.postConnect(this), await this.runStub(), this.romBaudrate !== this.baudrate && await this.changeBaud(), t; + } + parseFlashSizeArg(t) { + if (void 0 === this.chip.FLASH_SIZES[t]) throw new $ec3de3bad43fb783$var$A("Flash size " + t + " is not supported by this chip type. Supported sizes: " + this.chip.FLASH_SIZES); + return this.chip.FLASH_SIZES[t]; + } + _updateImageFlashParams(A, t, e, i, s) { + if (this.debug("_update_image_flash_params " + e + " " + i + " " + s), A.length < 8) return A; + if (t != this.chip.BOOTLOADER_FLASH_OFFSET) return A; + if ("keep" === e && "keep" === i && "keep" === s) return this.info("Not changing the image"), A; + const a = parseInt(A[0]); + let n = parseInt(A[2]); + const E = parseInt(A[3]); + if (a !== this.ESP_IMAGE_MAGIC) return this.info("Warning: Image file at 0x" + t.toString(16) + " doesn't look like an image file, so not changing any flash settings."), A; + if ("keep" !== i) n = ({ + qio: 0, + qout: 1, + dio: 2, + dout: 3 + })[i]; + let h = 15 & E; + if ("keep" !== s) h = ({ + "40m": 0, + "26m": 1, + "20m": 2, + "80m": 15 + })[s]; + let r = 240 & E; + "keep" !== e && (r = this.parseFlashSizeArg(e)); + const g = n << 8 | h + r; + return this.info("Flash params set to " + g.toString(16)), parseInt(A[2]) !== n << 8 && (A = A.substring(0, 2) + (n << 8).toString() + A.substring(3)), parseInt(A[3]) !== h + r && (A = A.substring(0, 3) + (h + r).toString() + A.substring(4)), A; + } + async writeFlash(t) { + if (this.debug("EspLoader program"), "keep" !== t.flashSize) { + const e = this.flashSizeBytes(t.flashSize); + for(let i = 0; i < t.fileArray.length; i++)if (t.fileArray[i].data.length + t.fileArray[i].address > e) throw new $ec3de3bad43fb783$var$A(`File ${i + 1} doesn't fit in the available flash`); + } + let e, i; + !0 === this.IS_STUB && !0 === t.eraseAll && await this.eraseFlash(); + for(let s = 0; s < t.fileArray.length; s++){ + this.debug("Data Length " + t.fileArray[s].data.length), e = t.fileArray[s].data; + const a = t.fileArray[s].data.length % 4; + if (a > 0 && (e += "\xff\xff\xff\xff".substring(4 - a)), i = t.fileArray[s].address, this.debug("Image Length " + e.length), 0 === e.length) { + this.debug("Warning: File is empty"); + continue; + } + e = this._updateImageFlashParams(e, i, t.flashSize, t.flashMode, t.flashFreq); + let n = null; + t.calculateMD5Hash && (n = t.calculateMD5Hash(e), this.debug("Image MD5 " + n)); + const E = e.length; + let h; + if (t.compress) { + const A = this.bstrToUi8(e); + e = this.ui8ToBstr($ec3de3bad43fb783$var$ce(A, { + level: 9 + })), h = await this.flashDeflBegin(E, e.length, i); + } else h = await this.flashBegin(E, i); + let r = 0, g = 0; + const o = e.length; + t.reportProgress && t.reportProgress(s, 0, o); + let B = new Date; + const w = B.getTime(); + let c = 5e3; + const C = new $ec3de3bad43fb783$var$Ce({ + chunkSize: 1 + }); + let I = 0; + for(C.onData = function(A) { + I += A.byteLength; + }; e.length > 0;){ + this.debug("Write loop " + i + " " + r + " " + h), this.info("Writing at 0x" + (i + I).toString(16) + "... (" + Math.floor(100 * (r + 1) / h) + "%)"); + const a = this.bstrToUi8(e.slice(0, this.FLASH_WRITE_SIZE)); + if (!t.compress) throw new $ec3de3bad43fb783$var$A("Yet to handle Non Compressed writes"); + { + const A = I; + C.push(a, !1); + const t = I - A; + let e = 3e3; + this.timeoutPerMb(this.ERASE_WRITE_TIMEOUT_PER_MB, t) > 3e3 && (e = this.timeoutPerMb(this.ERASE_WRITE_TIMEOUT_PER_MB, t)), !1 === this.IS_STUB && (c = e), await this.flashDeflBlock(a, r, c), this.IS_STUB && (c = e); + } + g += a.length, e = e.slice(this.FLASH_WRITE_SIZE, e.length), r++, t.reportProgress && t.reportProgress(s, g, o); + } + this.IS_STUB && await this.readReg(this.CHIP_DETECT_MAGIC_REG_ADDR, c), B = new Date; + const _ = B.getTime() - w; + if (t.compress && this.info("Wrote " + E + " bytes (" + g + " compressed) at 0x" + i.toString(16) + " in " + _ / 1e3 + " seconds."), n) { + const t = await this.flashMd5sum(i, E); + if (new String(t).valueOf() != new String(n).valueOf()) throw this.info("File md5: " + n), this.info("Flash md5: " + t), new $ec3de3bad43fb783$var$A("MD5 of file does not match data in flash!"); + this.info("Hash of data verified."); + } + } + this.info("Leaving..."), this.IS_STUB && (await this.flashBegin(0, 0), t.compress ? await this.flashDeflFinish() : await this.flashFinish()); + } + async flashId() { + this.debug("flash_id"); + const A = await this.readFlashId(); + this.info("Manufacturer: " + (255 & A).toString(16)); + const t = A >> 16 & 255; + this.info("Device: " + (A >> 8 & 255).toString(16) + t.toString(16)), this.info("Detected flash size: " + this.DETECTED_FLASH_SIZES[t]); + } + async getFlashSize() { + this.debug("flash_id"); + const A = await this.readFlashId() >> 16 & 255; + return this.DETECTED_FLASH_SIZES_NUM[A]; + } + async hardReset() { + await this.transport.setRTS(!0), await this._sleep(100), await this.transport.setRTS(!1); + } + async softReset() { + if (this.IS_STUB) { + if ("ESP8266" != this.chip.CHIP_NAME) throw new $ec3de3bad43fb783$var$A("Soft resetting is currently only supported on ESP8266"); + await this.command(this.ESP_RUN_USER_CODE, void 0, void 0, !1); + } else await this.flashBegin(0, 0), await this.flashFinish(!1); + } +} +class $ec3de3bad43fb783$export$c643cc54d6326a6f { + getEraseSize(A, t) { + return t; + } +} +var $ec3de3bad43fb783$var$Fe = 1074521560, $ec3de3bad43fb783$var$Te = "CAD0PxwA9D8AAPQ/AMD8PxAA9D82QQAh+v/AIAA4AkH5/8AgACgEICB0nOIGBQAAAEH1/4H2/8AgAKgEiAigoHTgCAALImYC54b0/yHx/8AgADkCHfAAAKDr/T8Ya/0/hIAAAEBAAABYq/0/pOv9PzZBALH5/yCgdBARIKXHAJYaBoH2/5KhAZCZEZqYwCAAuAmR8/+goHSaiMAgAJIYAJCQ9BvJwMD0wCAAwlgAmpvAIACiSQDAIACSGACB6v+QkPSAgPSHmUeB5f+SoQGQmRGamMAgAMgJoeX/seP/h5wXxgEAfOiHGt7GCADAIACJCsAgALkJRgIAwCAAuQrAIACJCZHX/5qIDAnAIACSWAAd8AAA+CD0P/gw9D82QQCR/f/AIACICYCAJFZI/5H6/8AgAIgJgIAkVkj/HfAAAAAQIPQ/ACD0PwAAAAg2QQAQESCl/P8h+v8MCMAgAIJiAJH6/4H4/8AgAJJoAMAgAJgIVnn/wCAAiAJ88oAiMCAgBB3wAAAAAEA2QQAQESDl+/8Wav+B7P+R+//AIACSaADAIACYCFZ5/x3wAAAMwPw/////AAQg9D82QQAh/P84QhaDBhARIGX4/xb6BQz4DAQ3qA2YIoCZEIKgAZBIg0BAdBARICX6/xARICXz/4giDBtAmBGQqwHMFICrAbHt/7CZELHs/8AgAJJrAJHO/8AgAKJpAMAgAKgJVnr/HAkMGkCag5AzwJqIOUKJIh3wAAAskgBANkEAoqDAgf3/4AgAHfAAADZBAIKgwK0Ch5IRoqDbgff/4AgAoqDcRgQAAAAAgqDbh5IIgfL/4AgAoqDdgfD/4AgAHfA2QQA6MsYCAACiAgAbIhARIKX7/zeS8R3wAAAAfNoFQNguBkCc2gVAHNsFQDYhIaLREIH6/+AIAEYLAAAADBRARBFAQ2PNBL0BrQKB9f/gCACgoHT8Ws0EELEgotEQgfH/4AgASiJAM8BWA/0iogsQIrAgoiCy0RCB7P/gCACtAhwLEBEgpff/LQOGAAAioGMd8AAA/GcAQNCSAEAIaABANkEhYqEHwGYRGmZZBiwKYtEQDAVSZhqB9//gCAAMGECIEUe4AkZFAK0GgdT/4AgAhjQAAJKkHVBzwOCZERqZQHdjiQnNB70BIKIggc3/4AgAkqQd4JkRGpmgoHSICYyqDAiCZhZ9CIYWAAAAkqQd4JkREJmAgmkAEBEgJer/vQetARARIKXt/xARICXp/80HELEgYKYggbv/4AgAkqQd4JkRGpmICXAigHBVgDe1sJKhB8CZERqZmAmAdcCXtwJG3P+G5v8MCIJGbKKkGxCqoIHK/+AIAFYK/7KiC6IGbBC7sBARIKWPAPfqEvZHD7KiDRC7sHq7oksAG3eG8f9867eawWZHCIImGje4Aoe1nCKiCxAisGC2IK0CgZv/4AgAEBEgpd//rQIcCxARICXj/xARIKXe/ywKgbH/4AgAHfAIIPQ/cOL6P0gkBkDwIgZANmEAEBEg5cr/EKEggfv/4AgAPQoMEvwqiAGSogCQiBCJARARIKXP/5Hy/6CiAcAgAIIpAKCIIMAgAIJpALIhAKHt/4Hu/+AIAKAjgx3wAAD/DwAANkEAgTv/DBmSSAAwnEGZKJH7/zkYKTgwMLSaIiozMDxBDAIpWDlIEBEgJfj/LQqMGiKgxR3wAABQLQZANkEAQSz/WDRQM2MWYwRYFFpTUFxBRgEAEBEgZcr/iESmGASIJIel7xARIKXC/xZq/6gUzQO9AoHx/+AIAKCgdIxKUqDEUmQFWBQ6VVkUWDQwVcBZNB3wAADA/D9PSEFJqOv9P3DgC0AU4AtADAD0PzhA9D///wAAjIAAABBAAACs6/0/vOv9PwTA/D8IwPw/BOz9PxQA9D/w//8AqOv9Pxjr/D8kwPw/fGgAQOxnAEBYhgBAbCoGQDgyBkAULAZAzCwGQEwsBkA0hQBAzJAAQHguBkAw7wVAWJIAQEyCAEA2wQAh3v8MCiJhCEKgAIHu/+AIACHZ/zHa/8YAAEkCSyI3MvgQESBlw/8MS6LBIBARIOXG/yKhARARICXC/1GR/pAiESolMc//sc//wCAAWQIheP4MDAxaMmIAgdz/4AgAMcr/QqEBwCAAKAMsCkAiIMAgACkDgTH/4AgAgdX/4AgAIcP/wCAAKALMuhzDMCIQIsL4DBMgo4MMC4HO/+AIAPG8/wwdwqABDBvioQBA3REAzBGAuwGioACBx//gCAAhtv8MBCpVIcP+ctIrwCAAKAUWcv/AIAA4BQwSwCAASQUiQRAiAwEMKCJBEYJRCUlRJpIHHDiHEh4GCAAiAwOCAwKAIhGAIiBmQhEoI8AgACgCKVFGAQAAHCIiUQkQESCls/8Mi6LBEBARIGW3/4IDAyIDAoCIESCIICGY/yAg9IeyHKKgwBARICWy/6Kg7hARIKWx/xARICWw/4bb/wAAIgMBHDknOTT2IhjG1AAAACLCLyAgdPZCcJGJ/5AioCgCoAIAIsL+ICB0HBknuQLGywCRhP+QIqAoAqACAJLCMJCQdLZZyQbGACxKbQQioMCnGAIGxABJUQxyrQQQESDlqv+tBBARIGWq/xARIOWo/xARIKWo/wyLosEQIsL/EBEg5av/ViL9RikADBJWyCyCYQ+Bev/gCACI8aAog8auACaIBAwSxqwAmCNoM2CJIICAtFbY/pnBEBEgZcf/mMFqKZwqBvf/AACgrEGBbf/gCABW6vxi1vBgosDMJgaBAACgkPRWGf6GBACgoPWZwYFl/+AIAJjBVpr6kGbADBkAmRFgosBnOeEGBAAAAKCsQYFc/+AIAFaq+GLW8GCiwFam/sZvAABtBCKgwCaIAoaNAG0EDALGiwAAACa484ZhAAwSJrgCBoUAuDOoIxARIOWh/6AkgwaBAAwcZrhTiEMgrBFtBCKgwoe6AoZ+ALhTqCPJ4RARIOXA/8YLAAwcZrgviEMgrBFtBCKgwoe6AoZ1ACgzuFOoIyBogsnhEBEgZb7/ITT+SWIi0itpIsjhoMSDLQyGaQChL/5tBLIKACKgxhY7GpgjgsjwIqDAh5kBKFoMCaKg70YCAJqzsgsYG5mwqjCHKfKCAwWSAwSAiBGQiCCSAwZtBACZEYCZIIIDB4CIAZCIIICqwIKgwaAok0ZVAIEY/m0EoggAIqDGFnoUqDgioMhW+hMoWKJIAMZNAByKbQQMEqcYAsZKAPhz6GPYU8hDuDOoI4EM/+AIAG0KoCSDRkQAAAwSJkgCRj8AqCO9BIEE/+AIAAYeAICwNG0EIqDAVgsPgGRBi8N8/UYOAKg8ucHJ4dnRgQD/4AgAyOG4wSgsmByoDNIhDZCSECYCDsAgAOIqACAtMOAiECCZIMAgAJkKG7vCzBBnO8LGm/9mSAJGmv9tBCKgwAYmAAwSJrgCRiEAIdz+mFOII5kCIdv+iQItBIYcAGHX/gwb2AaCyPCtBC0EgCuT0KuDIKoQbQQioMZW6gXB0f4ioMnoDIc+U4DwFCKgwFavBC0KRgIAKqOoaksiqQmtCyD+wCqdhzLtFprfIcT++QyZAsZ7/wwSZogWIcH+iAIWKACCoMhJAiG9/kkCDBKAJINtBEYBAABtBCKg/yCgdBARIOV5/2CgdBARIGV5/xARIOV3/1aiviIDARwoJzge9jICBvf+IsL9ICB0DPgnuAKG8/6BrP6AIqAoAqACAIKg0ocSUoKg1IcSegbt/gAAAIgzoqJxwKoRaCOJ8YGw/uAIACGh/pGi/sAgACgCiPEgNDXAIhGQIhAgIyCAIoKtBGCywoGn/uAIAKKj6IGk/uAIAAbb/gAA2FPIQ7gzqCMQESAlff9G1v4AsgMDIgMCgLsRILsgssvwosMYEBEgZZn/Rs/+ACIDA4IDAmGP/YAiEZg2gCIgIsLwkCJjFiKymBaakpCcQUYCAJnBEBEgZWL/mMGoRqYaBKgmp6nrEBEgpVr/Fmr/qBbNArLDGIGG/uAIAIw6MqDEOVY4FiozORY4NiAjwCk2xrX+ggMCIsMYMgMDDByAMxGAMyAyw/AGIwCBbP6RHf3oCDlx4JnAmWGYJwwal7MBDDqJ8anR6cEQESAlW/+o0ZFj/ujBqQGhYv7dCb0CwsEc8sEYmcGBa/7gCAC4J80KqHGI8aC7wLknoDPAuAiqIqhhmMGqu90EDBq5CMDag5C7wNDgdMx90tuA0K6TFmoBrQmJ8ZnByeEQESAlif+I8ZjByOGSaABhTv2INoyjwJ8xwJnA1ikAVvj11qwAMUn9IqDHKVNGAACMPJwIxoL+FoigYUT9IqDIKVZGf/4AMUH9IqDJKVNGfP4oI1bCnq0EgUX+4AgAoqJxwKoRgT7+4AgAgUL+4AgAxnP+AAAoMxaCnK0EgTz+4AgAoqPogTb+4AgA4AIARmz+HfAAAAA2QQCdAoKgwCgDh5kPzDIMEoYHAAwCKQN84oYPACYSByYiGIYDAAAAgqDbgCkjh5kqDCIpA3zyRggAAAAioNwnmQoMEikDLQgGBAAAAIKg3Xzyh5kGDBIpAyKg2x3wAAA=", $ec3de3bad43fb783$var$ue = 1074520064, $ec3de3bad43fb783$var$pe = "GOv8P9jnC0Bx6AtA8+wLQO3oC0CP6AtA7egLQEnpC0AG6gtAeOoLQCHqC0CB5wtAo+kLQPjpC0Bn6QtAmuoLQI7pC0Ca6gtAXegLQLPoC0Dt6AtASekLQHfoC0BM6wtAs+wLQKXmC0DX7AtApeYLQKXmC0Cl5gtApeYLQKXmC0Cl5gtApeYLQKXmC0Dz6gtApeYLQM3rC0Cz7AtA", $ec3de3bad43fb783$var$ye = 1073605544; +class $ec3de3bad43fb783$var$ke extends $ec3de3bad43fb783$export$c643cc54d6326a6f { + constructor(){ + super(...arguments), this.CHIP_NAME = "ESP32", this.IMAGE_CHIP_ID = 0, this.EFUSE_RD_REG_BASE = 1073061888, this.DR_REG_SYSCON_BASE = 1073111040, this.UART_CLKDIV_REG = 1072955412, this.UART_CLKDIV_MASK = 1048575, this.UART_DATE_REG_ADDR = 1610612856, this.XTAL_CLK_DIVIDER = 1, this.FLASH_SIZES = { + "1MB": 0, + "2MB": 16, + "4MB": 32, + "8MB": 48, + "16MB": 64 + }, this.FLASH_WRITE_SIZE = 1024, this.BOOTLOADER_FLASH_OFFSET = 4096, this.SPI_REG_BASE = 1072963584, this.SPI_USR_OFFS = 28, this.SPI_USR1_OFFS = 32, this.SPI_USR2_OFFS = 36, this.SPI_W0_OFFS = 128, this.SPI_MOSI_DLEN_OFFS = 40, this.SPI_MISO_DLEN_OFFS = 44, this.TEXT_START = $ec3de3bad43fb783$var$ue, this.ENTRY = $ec3de3bad43fb783$var$Fe, this.DATA_START = $ec3de3bad43fb783$var$ye, this.ROM_DATA = $ec3de3bad43fb783$var$pe, this.ROM_TEXT = $ec3de3bad43fb783$var$Te; + } + async readEfuse(A, t) { + const e = this.EFUSE_RD_REG_BASE + 4 * t; + return A.debug("Read efuse " + e), await A.readReg(e); + } + async getPkgVersion(A) { + const t = await this.readEfuse(A, 3); + let e = t >> 9 & 7; + return e += (t >> 2 & 1) << 3, e; + } + async getChipRevision(A) { + const t = await this.readEfuse(A, 3), e = await this.readEfuse(A, 5), i = await A.readReg(this.DR_REG_SYSCON_BASE + 124); + return 0 != (t >> 15 & 1) ? 0 != (e >> 20 & 1) ? 0 != (i >> 31 & 1) ? 3 : 2 : 1 : 0; + } + async getChipDescription(A) { + const t = [ + "ESP32-D0WDQ6", + "ESP32-D0WD", + "ESP32-D2WD", + "", + "ESP32-U4WDH", + "ESP32-PICO-D4", + "ESP32-PICO-V3-02" + ]; + let e = ""; + const i = await this.getPkgVersion(A), s = await this.getChipRevision(A), a = 3 == s; + return 0 != (1 & await this.readEfuse(A, 3)) && (t[0] = "ESP32-S0WDQ6", t[1] = "ESP32-S0WD"), a && (t[5] = "ESP32-PICO-V3"), e = i >= 0 && i <= 6 ? t[i] : "Unknown ESP32", !a || 0 !== i && 1 !== i || (e += "-V3"), e + " (revision " + s + ")"; + } + async getChipFeatures(A) { + const t = [ + "Wi-Fi" + ], e = await this.readEfuse(A, 3); + 0 === (2 & e) && t.push(" BT"); + 0 !== (1 & e) ? t.push(" Single Core") : t.push(" Dual Core"); + if (0 !== (8192 & e)) 0 !== (4096 & e) ? t.push(" 160MHz") : t.push(" 240MHz"); + const i = await this.getPkgVersion(A); + -1 !== [ + 2, + 4, + 5, + 6 + ].indexOf(i) && t.push(" Embedded Flash"), 6 === i && t.push(" Embedded PSRAM"); + 0 !== (await this.readEfuse(A, 4) >> 8 & 31) && t.push(" VRef calibration in efuse"); + 0 !== (e >> 14 & 1) && t.push(" BLK3 partially reserved"); + const s = 3 & await this.readEfuse(A, 6); + return t.push(" Coding Scheme " + [ + "None", + "3/4", + "Repeat (UNSUPPORTED)", + "Invalid" + ][s]), t; + } + async getCrystalFreq(A) { + const t = await A.readReg(this.UART_CLKDIV_REG) & this.UART_CLKDIV_MASK, e = A.transport.baudrate * t / 1e6 / this.XTAL_CLK_DIVIDER; + let i; + return i = e > 33 ? 40 : 26, Math.abs(i - e) > 1 && A.info("WARNING: Unsupported crystal in use"), i; + } + _d2h(A) { + const t = (+A).toString(16); + return 1 === t.length ? "0" + t : t; + } + async readMac(A) { + let t = await this.readEfuse(A, 1); + t >>>= 0; + let e = await this.readEfuse(A, 2); + e >>>= 0; + const i = new Uint8Array(6); + return i[0] = e >> 8 & 255, i[1] = 255 & e, i[2] = t >> 24 & 255, i[3] = t >> 16 & 255, i[4] = t >> 8 & 255, i[5] = 255 & t, this._d2h(i[0]) + ":" + this._d2h(i[1]) + ":" + this._d2h(i[2]) + ":" + this._d2h(i[3]) + ":" + this._d2h(i[4]) + ":" + this._d2h(i[5]); + } +} +var $ec3de3bad43fb783$var$He = Object.freeze({ + __proto__: null, + ESP32ROM: $ec3de3bad43fb783$var$ke +}), $ec3de3bad43fb783$var$Pe = 1077413532, $ec3de3bad43fb783$var$Oe = "QREixCbCBsa3NwRgEUc3RMg/2Mu3NARgEwQEANxAkYuR57JAIkSSREEBgoCIQBxAE3X1D4KX3bcBEbcHAGBOxoOphwBKyDdJyD8mylLEBs4izLcEAGB9WhMJCQDATBN09D8N4PJAYkQjqDQBQknSRLJJIkoFYYKAiECDJwkAE3X1D4KXfRTjGUT/yb8TBwAMlEGqh2MY5QCFR4XGI6AFAHlVgoAFR2OH5gAJRmONxgB9VYKAQgUTB7ANQYVjlecCiUecwfW3kwbADWMW1QCYwRMFAAyCgJMG0A19VWOV1wCYwRMFsA2CgLd1yT9BEZOFhboGxmE/Y0UFBrd3yT+ThweyA6cHCAPWRwgTdfUPkwYWAMIGwYIjktcIMpcjAKcAA9dHCJFnk4cHBGMe9wI398g/EwcHsqFnupcDpgcItzbJP7d3yT+Thweyk4YGtmMf5gAjpscII6DXCCOSBwghoPlX4wb1/LJAQQGCgCOm1wgjoOcI3bc3JwBgfEudi/X/NzcAYHxLnYv1/4KAQREGxt03tycAYCOmBwI3BwAImMOYQ33/yFeyQBNF9f8FiUEBgoBBEQbG2T993TcHAEC3JwBgmMM3JwBgHEP9/7JAQQGCgEERIsQ3RMg/kwdEAUrAA6kHAQbGJsJjCgkERTc5xb1HEwREAYFEY9YnAQREvYiTtBQAfTeFPxxENwaAABOXxwCZ4DcGAAG39v8AdY+3JgBg2MKQwphCff9BR5HgBUczCelAupcjKCQBHMSyQCJEkkQCSUEBgoABEQbOIswlNzcEzj9sABMFRP+XAMj/54Ag8KqHBUWV57JHk/cHID7GiTc3JwBgHEe3BkAAEwVE/9WPHMeyRZcAyP/ngKDtMzWgAPJAYkQFYYKAQRG3R8g/BsaTh0cBBUcjgOcAE9fFAJjHBWd9F8zDyMf5jTqVqpWxgYzLI6oHAEE3GcETBVAMskBBAYKAAREizDdEyD+TB0QBJsrER07GBs5KyKqJEwREAWPzlQCuhKnAAylEACaZE1nJABxIY1XwABxEY175ArU9fd1IQCaGzoWXAMj/54Ag4RN19Q8BxZMHQAxcyFxAppdcwFxEhY9cxPJAYkTSREJJskkFYYKAaTVtv0ERBsaXAMj/54AA1gNFhQGyQHUVEzUVAEEBgoBBEQbGxTcdyTdHyD8TBwcAXEONxxBHHcK3BgxgmEYNinGbUY+YxgVmuE4TBgbA8Y99dhMG9j9xj9mPvM6yQEEBgoBBEQbGeT8RwQ1FskBBARcDyP9nAIPMQREGxpcAyP/ngEDKQTcBxbJAQQHZv7JAQQGCgEERBsYTBwAMYxrlABMFsA3RPxMFwA2yQEEB6bcTB7AN4xvl/sE3EwXQDfW3QREixCbCBsYqhLMEtQBjF5QAskAiRJJEQQGCgANFBAAFBE0/7bc1cSbLTsf9coVp/XQizUrJUsVWwwbPk4SE+haRk4cJB6aXGAizhOcAKokmhS6ElwDI/+eAgBuThwkHGAgFarqXs4pHQTHkBWd9dZMFhfqTBwcHEwWF+RQIqpczhdcAkwcHB66Xs4XXACrGlwDI/+eAQBgyRcFFlTcBRYViFpH6QGpE2kRKSbpJKkqaSg1hgoCiiWNzigCFaU6G1oVKhZcAyP/ngEDGE3X1DwHtTobWhSaFlwDI/+eAgBNOmTMENEFRtxMFMAZVvxMFAAzZtTFx/XIFZ07XUtVW017PBt8i3SbbStla0WLNZstqyW7H/XcWkRMHBwc+lxwIupc+xiOqB/iqiS6Ksoq2ixE9kwcAAhnBtwcCAD6FlwDI/+eAIAyFZ2PlVxMFZH15EwmJ+pMHBAfKlxgIM4nnAEqFlwDI/+eAoAp9exMMO/mTDIv5EwcEB5MHBAcUCGKX5peBRDMM1wCzjNcAUk1jfE0JY/GkA0GomT+ihQgBjTW5NyKGDAFKhZcAyP/ngIAGopmilGP1RAOzh6RBY/F3AzMEmkBj84oAVoQihgwBToWXAMj/54CAtRN19Q9V3QLMAUR5XY1NowkBAGKFlwDI/+eAwKd9+QNFMQHmhWE0Y08FAOPijf6FZ5OHBweilxgIupfalyOKp/gFBPG34xWl/ZFH4wX09gVnfXWTBwcHkwWF+hMFhfkUCKqXM4XXAJMHBweul7OF1wAqxpcAyP/ngKD8cT0yRcFFZTNRPeUxtwcCABnhkwcAAj6FlwDI/+eAoPmFYhaR+lBqVNpUSlm6WSpamloKW/pLakzaTEpNuk0pYYKAt1dBSRlxk4f3hAFFht6i3KbaytjO1tLU1tLa0N7O4szmyurI7sY+zpcAyP/ngICfQTENzbcEDGCcRDdEyD8TBAQAHMS8TH13Ewf3P1zA+Y+T5wdAvMwTBUAGlwDI/+eAoJUcRPGbk+cXAJzEkTEhwbeHAGA3R9hQk4aHChMHF6qYwhOHBwkjIAcANzcdjyOgBgATB6cSk4YHC5jCk4fHCphDNwYAgFGPmMMjoAYAt0fIPzd3yT+ThwcAEwcHuyGgI6AHAJEH4+3n/kE7kUVoCHE5YTO398g/k4cHsiFnPpcjIPcItwc4QDdJyD+Th4cOIyD5ALd5yT9lPhMJCQCTiQmyYwsFELcnDGBFR7jXhUVFRZcAyP/ngCDjtwU4QAFGk4UFAEVFlwDI/+eAIOQ3NwRgHEs3BQIAk+dHABzLlwDI/+eAIOOXAMj/54Cg87dHAGCcXwnl8YvhFxO1FwCBRZcAyP/ngICWwWe3RMg//RcTBwAQhWZBZrcFAAEBRZOERAENard6yD+XAMj/54AAkSaaE4sKsoOnyQj134OryQiFRyOmCQgjAvECg8cbAAlHIxPhAqMC8QIC1E1HY4HnCFFHY4/nBilHY5/nAIPHOwADxysAogfZjxFHY5bnAIOniwCcQz7UlTmhRUgQQTaDxzsAA8crAKIH2Y8RZ0EHY3T3BBMFsA05PhMFwA0hPhMF4A4JPpkxQbe3BThAAUaThYUDFUWXAMj/54BA1DcHAGBcRxMFAAKT5xcQXMcJt8lHIxPxAk23A8cbANFGY+fmAoVGY+bmAAFMEwTwD4WoeRcTd/cPyUbj6Ob+t3bJPwoHk4ZGuzaXGEMCh5MGBwOT9vYPEUbjadb8Ewf3AhN39w+NRmPr5gi3dsk/CgeThgbANpcYQwKHEwdAAmOY5xAC1B1EAUWFPAFFYTRFNnk+oUVIEH0UZTR19AFMAUQTdfQPhTwTdfwPrTRJNuMeBOqDxxsASUdjY/cuCUfjdvfq9ReT9/cPPUfjYPfqN3fJP4oHEwcHwbqXnEOChwVEnetwEIFFAUWXsMz/54CgAh3h0UVoEKk0AUQxqAVEge+X8Mf/54CAdTM0oAApoCFHY4XnAAVEAUxhtwOsiwADpMsAs2eMANIH9ffv8H+FffHBbCKc/Rx9fTMFjEBV3LN3lQGV48FsMwWMQGPmjAL9fDMFjEBV0DGBl/DH/+eAgHBV+WaU9bcxgZfwx//ngIBvVfFqlNG3QYGX8Mf/54BAblH5MwSUQcG3IUfjiefwAUwTBAAMMbdBR82/QUcFROOc5/aDpcsAA6WLAHU6sb9BRwVE45Ln9gOnCwGRZ2Pl5xyDpUsBA6WLAO/wv4A1v0FHBUTjkuf0g6cLARFnY2X3GgOnywCDpUsBA6WLADOE5wLv8C/+I6wEACMkirAxtwPHBABjDgcQA6eLAMEXEwQADGMT9wDASAFHkwbwDmNG9wKDx1sAA8dLAAFMogfZjwPHawBCB12Pg8d7AOIH2Y/jgfbmEwQQDKm9M4brAANGhgEFB7GO4beDxwQA8cPcRGOYBxLASCOABAB9tWFHY5bnAoOnywEDp4sBg6ZLAQOmCwGDpcsAA6WLAJfwx//ngEBeKowzNKAAKbUBTAVEEbURRwVE45rn5gOliwCBRZfwx//ngABfkbUT9/cA4xoH7JPcRwAThIsAAUx9XeN5nN1IRJfwx//ngIBLGERUQBBA+Y5jB6cBHEITR/f/fY/ZjhTCBQxBBNm/EUdJvUFHBUTjnOfgg6eLAAOnSwEjKPkAIybpAN2zgyXJAMEXkeWJzwFMEwRgDLW7AycJAWNm9wYT9zcA4x4H5AMoCQEBRgFHMwXoQLOG5QBjafcA4wkG1CMoqQAjJtkAmbMzhusAEE4RB5DCBUbpvyFHBUTjlufaAyQJARnAEwSADCMoCQAjJgkAMzSAAEm7AUwTBCAMEbsBTBMEgAwxswFMEwSQDBGzEwcgDWOD5wwTB0AN45DnvAPEOwCDxysAIgRdjJfwx//ngGBJA6zEAEEUY3OEASKM4w4MuMBAYpQxgJxIY1XwAJxEY1v0Cu/wD8513chAYoaThYsBl/DH/+eAYEUBxZMHQAzcyNxA4pfcwNxEs4eHQdzEl/DH/+eAQESJvgllEwUFcQOsywADpIsAl/DH/+eAADa3BwBg2Eu3BgABwRaTV0cBEgd1j72L2Y+zh4cDAUWz1YcCl/DH/+eA4DYTBYA+l/DH/+eAoDIRtoOmSwEDpgsBg6XLAAOliwDv8M/7/bSDxTsAg8crABOFiwGiBd2NwRXv8O/X2bzv8E/HPb+DxzsAA8crABOMiwGiB9mPE40H/wVEt3vJP9xEYwUNAJnDY0yAAGNQBAoTB3AM2MjjnweokweQDGGok4cLu5hDt/fIP5OHB7KZjz7WgyeKsLd8yD9q0JOMTAGTjQu7BUhjc/0ADUhCxjrE7/BPwCJHMkg3Rcg/4oV8EJOGCrIQEBMFxQKX8Mf/54DAMIJXA6eMsIOlDQAzDf1AHY8+nLJXI6TssCqEvpUjoL0Ak4cKsp2NAcWhZ+OS9fZahe/wb8sjoG0Bmb8t9OODB6CTB4AM3Mj1uoOniwDjmwee7/Cv1gllEwUFcZfwx//ngGAg7/Bv0Zfwx//ngKAj0boDpMsA4wcEnO/wL9QTBYA+l/DH/+eAAB7v8A/PApRVuu/wj872UGZU1lRGWbZZJlqWWgZb9ktmTNZMRk22TQlhgoAAAA==", $ec3de3bad43fb783$var$Ue = 1077411840, $ec3de3bad43fb783$var$Ge = "IGvIP3YKOEDGCjhAHgs4QMILOEAuDDhA3As4QEIJOEB+CzhAvgs4QDILOEDyCDhAZgs4QPIIOEBQCjhAlgo4QMYKOEAeCzhAYgo4QKYJOEDWCThAXgo4QIAOOEDGCjhARg04QDgOOEAyCDhAYA44QDIIOEAyCDhAMgg4QDIIOEAyCDhAMgg4QDIIOEAyCDhA4gw4QDIIOEBkDThAOA44QA==", $ec3de3bad43fb783$var$me = 1070164912; +class $ec3de3bad43fb783$var$Ye extends $ec3de3bad43fb783$export$c643cc54d6326a6f { + constructor(){ + super(...arguments), this.CHIP_NAME = "ESP32-C3", this.IMAGE_CHIP_ID = 5, this.EFUSE_BASE = 1610647552, this.MAC_EFUSE_REG = this.EFUSE_BASE + 68, this.UART_CLKDIV_REG = 1072955412, this.UART_CLKDIV_MASK = 1048575, this.UART_DATE_REG_ADDR = 1610612860, this.FLASH_WRITE_SIZE = 1024, this.BOOTLOADER_FLASH_OFFSET = 0, this.FLASH_SIZES = { + "1MB": 0, + "2MB": 16, + "4MB": 32, + "8MB": 48, + "16MB": 64 + }, this.SPI_REG_BASE = 1610620928, this.SPI_USR_OFFS = 24, this.SPI_USR1_OFFS = 28, this.SPI_USR2_OFFS = 32, this.SPI_MOSI_DLEN_OFFS = 36, this.SPI_MISO_DLEN_OFFS = 40, this.SPI_W0_OFFS = 88, this.TEXT_START = $ec3de3bad43fb783$var$Ue, this.ENTRY = $ec3de3bad43fb783$var$Pe, this.DATA_START = $ec3de3bad43fb783$var$me, this.ROM_DATA = $ec3de3bad43fb783$var$Ge, this.ROM_TEXT = $ec3de3bad43fb783$var$Oe; + } + async getPkgVersion(A) { + const t = this.EFUSE_BASE + 68 + 12; + return await A.readReg(t) >> 21 & 7; + } + async getChipRevision(A) { + const t = this.EFUSE_BASE + 68 + 12; + return (await A.readReg(t) & 1835008) >> 18; + } + async getChipDescription(A) { + let t; + t = 0 === await this.getPkgVersion(A) ? "ESP32-C3" : "unknown ESP32-C3"; + return t += " (revision " + await this.getChipRevision(A) + ")", t; + } + async getFlashCap(A) { + const t = this.EFUSE_BASE + 68 + 12; + return await A.readReg(t) >> 27 & 7; + } + async getFlashVendor(A) { + const t = this.EFUSE_BASE + 68 + 16; + return ({ + 1: "XMC", + 2: "GD", + 3: "FM", + 4: "TT", + 5: "ZBIT" + })[await A.readReg(t) >> 0 & 7] || ""; + } + async getChipFeatures(A) { + const t = [ + "Wi-Fi", + "BLE" + ], e = await this.getFlashCap(A), i = await this.getFlashVendor(A), s = { + 0: null, + 1: "Embedded Flash 4MB", + 2: "Embedded Flash 2MB", + 3: "Embedded Flash 1MB", + 4: "Embedded Flash 8MB" + }[e], a = void 0 !== s ? s : "Unknown Embedded Flash"; + return null !== s && t.push(`${a} (${i})`), t; + } + async getCrystalFreq(A) { + return 40; + } + _d2h(A) { + const t = (+A).toString(16); + return 1 === t.length ? "0" + t : t; + } + async readMac(A) { + let t = await A.readReg(this.MAC_EFUSE_REG); + t >>>= 0; + let e = await A.readReg(this.MAC_EFUSE_REG + 4); + e = e >>> 0 & 65535; + const i = new Uint8Array(6); + return i[0] = e >> 8 & 255, i[1] = 255 & e, i[2] = t >> 24 & 255, i[3] = t >> 16 & 255, i[4] = t >> 8 & 255, i[5] = 255 & t, this._d2h(i[0]) + ":" + this._d2h(i[1]) + ":" + this._d2h(i[2]) + ":" + this._d2h(i[3]) + ":" + this._d2h(i[4]) + ":" + this._d2h(i[5]); + } + getEraseSize(A, t) { + return t; + } +} +var $ec3de3bad43fb783$var$be = Object.freeze({ + __proto__: null, + ESP32C3ROM: $ec3de3bad43fb783$var$Ye +}), $ec3de3bad43fb783$var$Ke = 1077413304, $ec3de3bad43fb783$var$xe = "ARG3BwBgTsaDqYcASsg3Sco/JspSxAbOIsy3BABgfVoTCQkAwEwTdPQ/DeDyQGJEI6g0AUJJ0kSySSJKBWGCgIhAgycJABN19Q+Cl30U4xlE/8m/EwcADJRBqodjGOUAhUeFxiOgBQB5VYKABUdjh+YACUZjjcYAfVWCgEIFEwewDUGFY5XnAolHnMH1t5MGwA1jFtUAmMETBQAMgoCTBtANfVVjldcAmMETBbANgoC3dcs/QRGThQW6BsZhP2NFBQa3d8s/k4eHsQOnBwgD1kcIE3X1D5MGFgDCBsGCI5LXCDKXIwCnAAPXRwiRZ5OHBwRjHvcCN/fKPxMHh7GhZ7qXA6YHCLc2yz+3d8s/k4eHsZOGhrVjH+YAI6bHCCOg1wgjkgcIIaD5V+MG9fyyQEEBgoAjptcII6DnCN23NycAYHxLnYv1/zc3AGB8S52L9f+CgEERBsbdN7cnAGAjpgcCNwcACJjDmEN9/8hXskATRfX/BYlBAYKAQREGxtk/fd03BwBAtycAYJjDNycAYBxD/f+yQEEBgoBBESLEN8TKP5MHxABKwAOpBwEGxibCYwoJBEU3OcW9RxMExACBRGPWJwEERL2Ik7QUAH03hT8cRDcGgAATl8cAmeA3BgABt/b/AHWPtyYAYNjCkMKYQn3/QUeR4AVHMwnpQLqXIygkARzEskAiRJJEAklBAYKAQREGxhMHAAxjEOUCEwWwDZcAyP/ngIDjEwXADbJAQQEXA8j/ZwCD4hMHsA3jGOX+lwDI/+eAgOETBdANxbdBESLEJsIGxiqEswS1AGMXlACyQCJEkkRBAYKAA0UEAAUERTfttxMFAAwXA8j/ZwAD3nVxJsPO3v10hWn9cpOEhPqThwkHIsVKwdLc1tqmlwbHFpGzhCcAKokmhS6ElzDI/+eAgJOThwkHBWqKl7OKR0Ep5AVnfXUTBIX5kwcHB6KXM4QnABMFhfqTBwcHqpeihTOFJwCXMMj/54CAkCKFwUW5PwFFhWIWkbpAKkSaRApJ9llmWtZaSWGCgKKJY3OKAIVpTobWhUqFlwDI/+eAQOITdfUPAe1OhtaFJoWXMMj/54DAi06ZMwQ0QVm3EwUwBlW/cXH9ck7PUs1Wy17HBtci1SbTStFayWLFZsNqwe7eqokWkRMFAAIuirKKtosCwpcAyP/ngEBIhWdj7FcRhWR9dBMEhPqThwQHopczhCcAIoWXMMj/54AghX17Eww7+ZMMi/kThwQHk4cEB2KX5pcBSTMMJwCzjCcAEk1je00JY3GpA3mgfTWmhYgYSTVdNSaGjBgihZcwyP/ngCCBppkmmWN1SQOzB6lBY/F3A7MEKkFj85oA1oQmhowYToWXAMj/54Dg0xN19Q9V3QLEgUR5XY1NowEBAGKFlwDI/+eAYMR9+QNFMQDmhS0xY04FAOPinf6FZ5OHBweml4qX2pcjiqf4hQT5t+MWpf2RR+OG9PYFZ311kwcHBxMEhfmilzOEJwATBYX6kwcHB6qXM4UnAKKFlyDI/+eAgHflOyKFwUXxM8U7EwUAApcAyP/ngOA2hWIWkbpQKlSaVApZ+klqStpKSku6SypMmkwKTfZdTWGCgAERBs4izFExNwTOP2wAEwVE/5cAyP/ngKDKqocFRZXnskeT9wcgPsZ5OTcnAGAcR7cGQAATBUT/1Y8cx7JFlwDI/+eAIMgzNaAA8kBiRAVhgoBBEbfHyj8GxpOHxwAFRyOA5wAT18UAmMcFZ30XzMPIx/mNOpWqlbGBjMsjqgcAQTcZwRMFUAyyQEEBgoABESLMN8TKP5MHxAAmysRHTsYGzkrIqokTBMQAY/OVAK6EqcADKUQAJpkTWckAHEhjVfAAHERjXvkC4T593UhAJobOhZcAyP/ngCC7E3X1DwHFkwdADFzIXECml1zAXESFj1zE8kBiRNJEQkmySQVhgoDdNm2/t1dBSRlxk4f3hAFFPs6G3qLcptrK2M7W0tTW0trQ3s7izObK6sjuxpcAyP/ngICtt0fKPzd3yz+ThwcAEweHumPg5xSlOZFFaAixMYU5t/fKP5OHh7EhZz6XIyD3CLcFOEC3BzhAAUaThwcLk4UFADdJyj8VRSMg+QCXAMj/54DgGzcHAGBcRxMFAAK3xMo/k+cXEFzHlwDI/+eAoBq3RwBgiF+BRbd5yz9xiWEVEzUVAJcAyP/ngOCwwWf9FxMHABCFZkFmtwUAAQFFk4TEALdKyj8NapcAyP/ngOCrk4mJsRMJCQATi8oAJpqDp8kI9d+Dq8kIhUcjpgkIIwLxAoPHGwAJRyMT4QKjAvECAtRNR2OL5wZRR2OJ5wYpR2Of5wCDxzsAA8crAKIH2Y8RR2OW5wCDp4sAnEM+1EE2oUVIEJE+g8c7AAPHKwCiB9mPEWdBB2N+9wITBbANlwDI/+eAQJQTBcANlwDI/+eAgJMTBeAOlwDI/+eAwJKBNr23I6AHAJEHbb3JRyMT8QJ9twPHGwDRRmPn5gKFRmPm5gABTBME8A+dqHkXE3f3D8lG4+jm/rd2yz8KB5OGxro2lxhDAoeTBgcDk/b2DxFG42nW/BMH9wITd/cPjUZj7uYIt3bLPwoHk4aGvzaXGEMChxMHQAJjmucQAtQdRAFFlwDI/+eAIIoBRYE8TTxFPKFFSBB9FEk0ffABTAFEE3X0DyU8E3X8Dw08UTzjEQTsg8cbAElHY2X3MAlH43n36vUXk/f3Dz1H42P36jd3yz+KBxMHh8C6l5xDgocFRJ3rcBCBRQFFlwDI/+eAQIkd4dFFaBAVNAFEMagFRIHvlwDI/+eAwI0zNKAAKaAhR2OF5wAFRAFMYbcDrIsAA6TLALNnjADSB/X3mTll9cFsIpz9HH19MwWMQF3cs3eVAZXjwWwzBYxAY+aMAv18MwWMQF3QMYGXAMj/54Bgil35ZpT1tzGBlwDI/+eAYIld8WqU0bdBgZcAyP/ngKCIWfkzBJRBwbchR+OK5/ABTBMEAAw5t0FHzb9BRwVE453n9oOlywADpYsAVTK5v0FHBUTjk+f2A6cLAZFnY+jnHoOlSwEDpYsAMTGBt0FHBUTjlOf0g6cLARFnY2n3HAOnywCDpUsBA6WLADOE5wLdNiOsBAAjJIqwCb8DxwQAYwMHFAOniwDBFxMEAAxjE/cAwEgBR5MG8A5jRvcCg8dbAAPHSwABTKIH2Y8Dx2sAQgddj4PHewDiB9mP44T25hMEEAyFtTOG6wADRoYBBQexjuG3g8cEAP3H3ERjnQcUwEgjgAQAVb1hR2OW5wKDp8sBA6eLAYOmSwEDpgsBg6XLAAOliwCX8Mf/54BgeSqMMzSgAAG9AUwFRCm1EUcFROOd5+a3lwBgtENld30XBWb5jtGOA6WLALTDtEeBRfmO0Y60x/RD+Y7RjvTD1F91j1GP2N+X8Mf/54BAdwW1E/f3AOMXB+qT3EcAE4SLAAFMfV3jd5zbSESX8Mf/54DAYRhEVEAQQPmOYwenARxCE0f3/32P2Y4UwgUMQQTZvxFHtbVBRwVE45rn3oOniwADp0sBIyT5ACMi6QDJs4MlSQDBF5Hlic8BTBMEYAyhuwMniQBjZvcGE/c3AOMbB+IDKIkAAUYBRzMF6ECzhuUAY2n3AOMHBtIjJKkAIyLZAA2zM4brABBOEQeQwgVG6b8hRwVE45Tn2AMkiQAZwBMEgAwjJAkAIyIJADM0gAC9swFMEwQgDMW5AUwTBIAM5bEBTBMEkAzFsRMHIA1jg+cMEwdADeOR57oDxDsAg8crACIEXYyX8Mf/54BgXwOsxABBFGNzhAEijOMPDLbAQGKUMYCcSGNV8ACcRGNa9Arv8I/hdd3IQGKGk4WLAZfwx//ngGBbAcWTB0AM3MjcQOKX3MDcRLOHh0HcxJfwx//ngEBaFb4JZRMFBXEDrMsAA6SLAJfwx//ngEBMtwcAYNhLtwYAAcEWk1dHARIHdY+9i9mPs4eHAwFFs9WHApfwx//ngOBMEwWAPpfwx//ngOBI3bSDpksBA6YLAYOlywADpYsA7/Av98G8g8U7AIPHKwAThYsBogXdjcEVqTptvO/w79qBtwPEOwCDxysAE4yLASIEXYzcREEUxeORR4VLY/6HCJMHkAzcyHm0A6cNACLQBUizh+xAPtaDJ4qwY3P0AA1IQsY6xO/wb9YiRzJIN8XKP+KFfBCThsoAEBATBUUCl/DH/+eA4Ek398o/kwjHAIJXA6eIsIOlDQAdjB2PPpyyVyOk6LCqi76VI6C9AJOHygCdjQHFoWdjlvUAWoVdOCOgbQEJxNxEmcPjQHD5Y98LAJMHcAyFv4VLt33LP7fMyj+TjY26k4zMAOm/45ULntxE44IHnpMHgAyxt4OniwDjmwecAUWX8Mf/54DAOQllEwUFcZfwx//ngCA2l/DH/+eA4DlNugOkywDjBgSaAUWX8Mf/54AgNxMFgD6X8Mf/54CgMwKUQbr2UGZU1lRGWbZZJlqWWgZb9ktmTNZMRk22TQlhgoA=", $ec3de3bad43fb783$var$Le = 1077411840, $ec3de3bad43fb783$var$Je = "DEDKP+AIOEAsCThAhAk4QFIKOEC+CjhAbAo4QKgHOEAOCjhATgo4QJgJOEBYBzhAzAk4QFgHOEC6CDhA/gg4QCwJOECECThAzAg4QBIIOEBCCDhAyAg4QBYNOEAsCThA1gs4QMoMOECkBjhA9Aw4QKQGOECkBjhApAY4QKQGOECkBjhApAY4QKQGOECkBjhAcgs4QKQGOEDyCzhAygw4QA==", $ec3de3bad43fb783$var$ze = 1070295976; +var $ec3de3bad43fb783$var$Ne = Object.freeze({ + __proto__: null, + ESP32C2ROM: class extends $ec3de3bad43fb783$var$Ye { + constructor(){ + super(...arguments), this.CHIP_NAME = "ESP32-C2", this.IMAGE_CHIP_ID = 12, this.EFUSE_BASE = 1610647552, this.MAC_EFUSE_REG = this.EFUSE_BASE + 64, this.UART_CLKDIV_REG = 1610612756, this.UART_CLKDIV_MASK = 1048575, this.UART_DATE_REG_ADDR = 1610612860, this.XTAL_CLK_DIVIDER = 1, this.FLASH_WRITE_SIZE = 1024, this.BOOTLOADER_FLASH_OFFSET = 0, this.FLASH_SIZES = { + "1MB": 0, + "2MB": 16, + "4MB": 32, + "8MB": 48, + "16MB": 64 + }, this.SPI_REG_BASE = 1610620928, this.SPI_USR_OFFS = 24, this.SPI_USR1_OFFS = 28, this.SPI_USR2_OFFS = 32, this.SPI_MOSI_DLEN_OFFS = 36, this.SPI_MISO_DLEN_OFFS = 40, this.SPI_W0_OFFS = 88, this.TEXT_START = $ec3de3bad43fb783$var$Le, this.ENTRY = $ec3de3bad43fb783$var$Ke, this.DATA_START = $ec3de3bad43fb783$var$ze, this.ROM_DATA = $ec3de3bad43fb783$var$Je, this.ROM_TEXT = $ec3de3bad43fb783$var$xe; + } + async getPkgVersion(A) { + const t = this.EFUSE_BASE + 64 + 4; + return await A.readReg(t) >> 22 & 7; + } + async getChipRevision(A) { + const t = this.EFUSE_BASE + 64 + 4; + return (await A.readReg(t) & 3145728) >> 20; + } + async getChipDescription(A) { + let t; + const e = await this.getPkgVersion(A); + t = 0 === e || 1 === e ? "ESP32-C2" : "unknown ESP32-C2"; + return t += " (revision " + await this.getChipRevision(A) + ")", t; + } + async getChipFeatures(A) { + return [ + "Wi-Fi", + "BLE" + ]; + } + async getCrystalFreq(A) { + const t = await A.readReg(this.UART_CLKDIV_REG) & this.UART_CLKDIV_MASK, e = A.transport.baudrate * t / 1e6 / this.XTAL_CLK_DIVIDER; + let i; + return i = e > 33 ? 40 : 26, Math.abs(i - e) > 1 && A.info("WARNING: Unsupported crystal in use"), i; + } + async changeBaudRate(A) { + 26 === await this.getCrystalFreq(A) && A.changeBaud(); + } + _d2h(A) { + const t = (+A).toString(16); + return 1 === t.length ? "0" + t : t; + } + async readMac(A) { + let t = await A.readReg(this.MAC_EFUSE_REG); + t >>>= 0; + let e = await A.readReg(this.MAC_EFUSE_REG + 4); + e = e >>> 0 & 65535; + const i = new Uint8Array(6); + return i[0] = e >> 8 & 255, i[1] = 255 & e, i[2] = t >> 24 & 255, i[3] = t >> 16 & 255, i[4] = t >> 8 & 255, i[5] = 255 & t, this._d2h(i[0]) + ":" + this._d2h(i[1]) + ":" + this._d2h(i[2]) + ":" + this._d2h(i[3]) + ":" + this._d2h(i[4]) + ":" + this._d2h(i[5]); + } + getEraseSize(A, t) { + return t; + } + } +}), $ec3de3bad43fb783$var$ve = 1082132112, $ec3de3bad43fb783$var$je = "QREixCbCBsa39wBgEUc3BIRA2Mu39ABgEwQEANxAkYuR57JAIkSSREEBgoCIQBxAE3X1D4KX3bcBEbcHAGBOxoOphwBKyDcJhEAmylLEBs4izLcEAGB9WhMJCQDATBN09A8N4PJAYkQjqDQBQknSRLJJIkoFYYKAiECDJwkAE3X1D4KXfRTjGUT/yb8TBwAMlEGqh2MY5QCFR4XGI6AFAHlVgoAFR2OH5gAJRmONxgB9VYKAQgUTB7ANQYVjlecCiUecwfW3kwbADWMW1QCYwRMFAAyCgJMG0A19VWOV1wCYwRMFsA2CgLc1hUBBEZOFRboGxmE/Y0UFBrc3hUCTh8exA6cHCAPWRwgTdfUPkwYWAMIGwYIjktcIMpcjAKcAA9dHCJFnk4cHBGMe9wI3t4RAEwfHsaFnupcDpgcIt/aEQLc3hUCTh8exk4bGtWMf5gAjpscII6DXCCOSBwghoPlX4wb1/LJAQQGCgCOm1wgjoOcI3bc3NwBgfEudi/X/NycAYHxLnYv1/4KAQREGxt03tzcAYCOmBwI3BwAImMOYQ33/yFeyQBNF9f8FiUEBgoBBEQbG2T993TcHAEC3NwBgmMM3NwBgHEP9/7JAQQGCgEERIsQ3BIRAkwcEAUrAA6kHAQbGJsJjCgkERTc5xb1HEwQEAYFEY9YnAQREvYiTtBQAfTeFPxxENwaAABOXxwCZ4DcGAAG39v8AdY+3NgBg2MKQwphCff9BR5HgBUczCelAupcjKCQBHMSyQCJEkkQCSUEBgoABEQbOIswlNzcEzj9sABMFRP+XAID/54Cg8qqHBUWV57JHk/cHID7GiTc3NwBgHEe3BkAAEwVE/9WPHMeyRZcAgP/ngCDwMzWgAPJAYkQFYYKAQRG3B4RABsaThwcBBUcjgOcAE9fFAJjHBWd9F8zDyMf5jTqVqpWxgYzLI6oHAEE3GcETBVAMskBBAYKAAREizDcEhECTBwQBJsrER07GBs5KyKqJEwQEAWPzlQCuhKnAAylEACaZE1nJABxIY1XwABxEY175ArU9fd1IQCaGzoWXAID/54Ag4xN19Q8BxZMHQAxcyFxAppdcwFxEhY9cxPJAYkTSREJJskkFYYKAaTVtv0ERBsaXAID/54BA1gNFhQGyQHUVEzUVAEEBgoBBEQbGxTcNxbcHhECThwcA1EOZzjdnCWATBwcRHEM3Bv3/fRbxjzcGAwDxjtWPHMOyQEEBgoBBEQbGbTcRwQ1FskBBARcDgP9nAIPMQREGxpcAgP/ngEDKcTcBxbJAQQHZv7JAQQGCgEERBsYTBwAMYxrlABMFsA3RPxMFwA2yQEEB6bcTB7AN4xvl/sE3EwXQDfW3QREixCbCBsYqhLMEtQBjF5QAskAiRJJEQQGCgANFBAAFBE0/7bc1cSbLTsf9coVp/XQizUrJUsVWwwbPk4SE+haRk4cJB6aXGAizhOcAKokmhS6ElwCA/+eAwC+ThwkHGAgFarqXs4pHQTHkBWd9dZMFhfqTBwcHEwWF+RQIqpczhdcAkwcHB66Xs4XXACrGlwCA/+eAgCwyRcFFlTcBRYViFpH6QGpE2kRKSbpJKkqaSg1hgoCiiWNzigCFaU6G1oVKhZcAgP/ngADJE3X1DwHtTobWhSaFlwCA/+eAwCdOmTMENEFRtxMFMAZVvxMFAAzZtTFx/XIFZ07XUtVW017PBt8i3SbbStla0WLNZstqyW7H/XcWkRMHBwc+lxwIupc+xiOqB/iqiS6Ksoq2iwU1kwcAAhnBtwcCAD6FlwCA/+eAYCCFZ2PlVxMFZH15EwmJ+pMHBAfKlxgIM4nnAEqFlwCA/+eA4B59exMMO/mTDIv5EwcEB5MHBAcUCGKX5peBRDMM1wCzjNcAUk1jfE0JY/GkA0GomT+ihQgBjTW5NyKGDAFKhZcAgP/ngMAaopmilGP1RAOzh6RBY/F3AzMEmkBj84oAVoQihgwBToWXAID/54BAuBN19Q9V3QLMAUR5XY1NowkBAGKFlwCA/+eAgKd9+QNFMQHmhVE8Y08FAOPijf6FZ5OHBweilxgIupfalyOKp/gFBPG34xWl/ZFH4wX09gVnfXWTBwcHkwWF+hMFhfkUCKqXM4XXAJMHBweul7OF1wAqxpcAgP/ngOAQcT0yRcFFZTNRPdU5twcCABnhkwcAAj6FlwCA/+eA4A2FYhaR+lBqVNpUSlm6WSpamloKW/pLakzaTEpNuk0pYYKAt1dBSRlxk4f3hAFFht6i3KbaytjO1tLU1tLa0N7O4szmyurI7sY+zpcAgP/ngMCgcTENwTdnCWATBwcRHEO3BoRAI6L2ALcG/f/9FvWPwWbVjxzDpTEFzbcnC2A3R9hQk4aHwRMHF6qYwhOGB8AjIAYAI6AGAJOGB8KYwpOHx8GYQzcGBABRj5jDI6AGALcHhEA3N4VAk4cHABMHx7ohoCOgBwCRB+Pt5/5FO5FFaAh1OWUzt7eEQJOHx7EhZz6XIyD3CLcHgEA3CYRAk4eHDiMg+QC3OYVA1TYTCQkAk4nJsWMHBRC3BwFgRUcjoOcMhUVFRZcAgP/ngED5twWAQAFGk4UFAEVFlwCA/+eAQPo39wBgHEs3BQIAk+dHABzLlwCA/+eAQPm3FwlgiF+BRbcEhEBxiWEVEzUVAJcAgP/ngAChwWf9FxMHABCFZkFmtwUAAQFFk4QEAQ1qtzqEQJcAgP/ngACXJpoTi8qxg6fJCPXfg6vJCIVHI6YJCCMC8QKDxxsACUcjE+ECowLxAgLUTUdjgecIUUdjj+cGKUdjn+cAg8c7AAPHKwCiB9mPEUdjlucAg6eLAJxDPtRxOaFFSBBlNoPHOwADxysAogfZjxFnQQdjdPcEEwWwDZk2EwXADYE2EwXgDi0+vTFBt7cFgEABRpOFhQMVRZcAgP/ngADrNwcAYFxHEwUAApPnFxBcxzG3yUcjE/ECTbcDxxsA0UZj5+YChUZj5uYAAUwTBPAPhah5FxN39w/JRuPo5v63NoVACgeThga7NpcYQwKHkwYHA5P29g8RRuNp1vwTB/cCE3f3D41GY+vmCLc2hUAKB5OGxr82lxhDAocTB0ACY5jnEALUHUQBRWE8AUVFPOE22TahRUgQfRTBPHX0AUwBRBN19A9hPBN1/A9JPG024x4E6oPHGwBJR2Nj9y4JR+N29+r1F5P39w89R+Ng9+o3N4VAigcTB8fAupecQ4KHBUSd63AQgUUBRZfwf//ngAB0HeHRRWgQjTwBRDGoBUSB75fwf//ngAB5MzSgACmgIUdjhecABUQBTGG3A6yLAAOkywCzZ4wA0gf19+/wv4h98cFsIpz9HH19MwWMQFXcs3eVAZXjwWwzBYxAY+aMAv18MwWMQFXQMYGX8H//54CAdVX5ZpT1tzGBl/B//+eAgHRV8WqU0bdBgZfwf//ngMBzUfkzBJRBwbchR+OJ5/ABTBMEAAwxt0FHzb9BRwVE45zn9oOlywADpYsA1TKxv0FHBUTjkuf2A6cLAZFnY+XnHIOlSwEDpYsA7/D/gzW/QUcFROOS5/SDpwsBEWdjZfcaA6fLAIOlSwEDpYsAM4TnAu/wf4EjrAQAIySKsDG3A8cEAGMOBxADp4sAwRcTBAAMYxP3AMBIAUeTBvAOY0b3AoPHWwADx0sAAUyiB9mPA8drAEIHXY+Dx3sA4gfZj+OB9uYTBBAMqb0zhusAA0aGAQUHsY7ht4PHBADxw9xEY5gHEsBII4AEAH21YUdjlucCg6fLAQOniwGDpksBA6YLAYOlywADpYsAl/B//+eAQGQqjDM0oAAptQFMBUQRtRFHBUTjmufmA6WLAIFFl/B//+eAwGmRtRP39wDjGgfsk9xHABOEiwABTH1d43mc3UhEl/B//+eAwE0YRFRAEED5jmMHpwEcQhNH9/99j9mOFMIFDEEE2b8RR0m9QUcFROOc5+CDp4sAA6dLASMm+QAjJOkA3bODJYkAwReR5YnPAUwTBGAMtbsDJ8kAY2b3BhP3NwDjHgfkAyjJAAFGAUczBehAs4blAGNp9wDjCQbUIyapACMk2QCZszOG6wAQThEHkMIFRum/IUcFROOW59oDJMkAGcATBIAMIyYJACMkCQAzNIAASbsBTBMEIAwRuwFMEwSADDGzAUwTBJAMEbMTByANY4PnDBMHQA3jkOe8A8Q7AIPHKwAiBF2Ml/B//+eA4EwDrMQAQRRjc4QBIozjDgy4wEBilDGAnEhjVfAAnERjW/QK7/BP0XXdyEBihpOFiwGX8H//54DgSAHFkwdADNzI3EDil9zA3ESzh4dB3MSX8H//54DAR4m+CWUTBQVxA6zLAAOkiwCX8H//54BAOLcHAGDYS7cGAAHBFpNXRwESB3WPvYvZj7OHhwMBRbPVhwKX8H//54BgORMFgD6X8H//54DgNBG2g6ZLAQOmCwGDpcsAA6WLAO/wT/79tIPFOwCDxysAE4WLAaIF3Y3BFe/wL9vZvO/wj8o9v4PHOwADxysAE4yLAaIH2Y8TjQf/BUS3O4VA3ERjBQ0AmcNjTIAAY1AEChMHcAzYyOOfB6iTB5AMYaiTh8u6mEO3t4RAk4fHsZmPPtaDJ4qwtzyEQGrQk4wMAZONy7oFSGNz/QANSELGOsTv8I/DIkcySDcFhEDihXwQk4bKsRAQEwWFApfwf//ngEA0glcDp4ywg6UNADMN/UAdjz6cslcjpOywKoS+lSOgvQCTh8qxnY0BxaFn45L19lqF7/CvziOgbQGZvy3044MHoJMHgAzcyPW6g6eLAOObB57v8C/ZCWUTBQVxl/B//+eAoCLv8K/Ul/B//+eA4CbRugOkywDjBwSc7/Cv1hMFgD6X8H//54BAIO/wT9IClFW67/DP0fZQZlTWVEZZtlkmWpZaBlv2S2ZM1kxGTbZNCWGCgAAA", $ec3de3bad43fb783$var$Ze = 1082130432, $ec3de3bad43fb783$var$We = "HCuEQEIKgECSCoBA6gqAQI4LgED6C4BAqAuAQA4JgEBKC4BAiguAQP4KgEC+CIBAMguAQL4IgEAcCoBAYgqAQJIKgEDqCoBALgqAQHIJgECiCYBAKgqAQEwOgECSCoBAEg2AQAQOgED+B4BALA6AQP4HgED+B4BA/geAQP4HgED+B4BA/geAQP4HgED+B4BArgyAQP4HgEAwDYBABA6AQA==", $ec3de3bad43fb783$var$Xe = 1082469292; +class $ec3de3bad43fb783$var$qe extends $ec3de3bad43fb783$export$c643cc54d6326a6f { + constructor(){ + super(...arguments), this.CHIP_NAME = "ESP32-C6", this.IMAGE_CHIP_ID = 13, this.EFUSE_BASE = 1611335680, this.MAC_EFUSE_REG = this.EFUSE_BASE + 68, this.UART_CLKDIV_REG = 1072955412, this.UART_CLKDIV_MASK = 1048575, this.UART_DATE_REG_ADDR = 1610612860, this.FLASH_WRITE_SIZE = 1024, this.BOOTLOADER_FLASH_OFFSET = 0, this.FLASH_SIZES = { + "1MB": 0, + "2MB": 16, + "4MB": 32, + "8MB": 48, + "16MB": 64 + }, this.SPI_REG_BASE = 1610620928, this.SPI_USR_OFFS = 24, this.SPI_USR1_OFFS = 28, this.SPI_USR2_OFFS = 32, this.SPI_MOSI_DLEN_OFFS = 36, this.SPI_MISO_DLEN_OFFS = 40, this.SPI_W0_OFFS = 88, this.TEXT_START = $ec3de3bad43fb783$var$Ze, this.ENTRY = $ec3de3bad43fb783$var$ve, this.DATA_START = $ec3de3bad43fb783$var$Xe, this.ROM_DATA = $ec3de3bad43fb783$var$We, this.ROM_TEXT = $ec3de3bad43fb783$var$je; + } + async getPkgVersion(A) { + const t = this.EFUSE_BASE + 68 + 12; + return await A.readReg(t) >> 21 & 7; + } + async getChipRevision(A) { + const t = this.EFUSE_BASE + 68 + 12; + return (await A.readReg(t) & 1835008) >> 18; + } + async getChipDescription(A) { + let t; + t = 0 === await this.getPkgVersion(A) ? "ESP32-C6" : "unknown ESP32-C6"; + return t += " (revision " + await this.getChipRevision(A) + ")", t; + } + async getChipFeatures(A) { + return [ + "Wi-Fi 6", + "BT 5", + "IEEE802.15.4" + ]; + } + async getCrystalFreq(A) { + return 40; + } + _d2h(A) { + const t = (+A).toString(16); + return 1 === t.length ? "0" + t : t; + } + async readMac(A) { + let t = await A.readReg(this.MAC_EFUSE_REG); + t >>>= 0; + let e = await A.readReg(this.MAC_EFUSE_REG + 4); + e = e >>> 0 & 65535; + const i = new Uint8Array(6); + return i[0] = e >> 8 & 255, i[1] = 255 & e, i[2] = t >> 24 & 255, i[3] = t >> 16 & 255, i[4] = t >> 8 & 255, i[5] = 255 & t, this._d2h(i[0]) + ":" + this._d2h(i[1]) + ":" + this._d2h(i[2]) + ":" + this._d2h(i[3]) + ":" + this._d2h(i[4]) + ":" + this._d2h(i[5]); + } + getEraseSize(A, t) { + return t; + } +} +var $ec3de3bad43fb783$var$Ve = Object.freeze({ + __proto__: null, + ESP32C6ROM: $ec3de3bad43fb783$var$qe +}), $ec3de3bad43fb783$var$$e = 1082132164, $ec3de3bad43fb783$var$Ai = "QREixCbCBsa39wBgEUc3BIRA2Mu39ABgEwQEANxAkYuR57JAIkSSREEBgoCIQBxAE3X1D4KX3bcBEbcHAGBOxoOphwBKyDcJhEAmylLEBs4izLcEAGB9WhMJCQDATBN09D8N4PJAYkQjqDQBQknSRLJJIkoFYYKAiECDJwkAE3X1D4KXfRTjGUT/yb8TBwAMlEGqh2MY5QCFR4XGI6AFAHlVgoAFR2OH5gAJRmONxgB9VYKAQgUTB7ANQYVjlecCiUecwfW3kwbADWMW1QCYwRMFAAyCgJMG0A19VWOV1wCYwRMFsA2CgLc1hUBBEZOFhboGxmE/Y0UFBrc3hUCThweyA6cHCAPWRwgTdfUPkwYWAMIGwYIjktcIMpcjAKcAA9dHCJFnk4cHBGMe9wI3t4RAEwcHsqFnupcDpgcIt/aEQLc3hUCThweyk4YGtmMf5gAjpscII6DXCCOSBwghoPlX4wb1/LJAQQGCgCOm1wgjoOcI3bc3NwBgfEudi/X/NycAYHxLnYv1/4KAQREGxt03tzcAYCOmBwI3BwAImMOYQ33/yFeyQBNF9f8FiUEBgoBBEQbG2T993TcHAEC3NwBgmMM3NwBgHEP9/7JAQQGCgEERIsQ3hIRAkwdEAUrAA6kHAQbGJsJjCgkERTc5xb1HEwREAYFEY9YnAQREvYiTtBQAfTeFPxxENwaAABOXxwCZ4DcGAAG39v8AdY+3NgBg2MKQwphCff9BR5HgBUczCelAupcjKCQBHMSyQCJEkkQCSUEBgoABEQbOIswlNzcEzj9sABMFRP+XAID/54Cg86qHBUWV57JHk/cHID7GiTc3NwBgHEe3BkAAEwVE/9WPHMeyRZcAgP/ngCDxMzWgAPJAYkQFYYKAQRG3h4RABsaTh0cBBUcjgOcAE9fFAJjHBWd9F8zDyMf5jTqVqpWxgYzLI6oHAEE3GcETBVAMskBBAYKAAREizDeEhECTB0QBJsrER07GBs5KyKqJEwREAWPzlQCuhKnAAylEACaZE1nJABxIY1XwABxEY175ArU9fd1IQCaGzoWXAID/54Ag5BN19Q8BxZMHQAxcyFxAppdcwFxEhY9cxPJAYkTSREJJskkFYYKAaTVtv0ERBsaXAID/54CA1gNFhQGyQHUVEzUVAEEBgoBBEQbGxTcNxbcHhECThwcA1EOZzjdnCWATB8cQHEM3Bv3/fRbxjzcGAwDxjtWPHMOyQEEBgoBBEQbGbTcRwQ1FskBBARcDgP9nAIPMQREGxibCIsSqhJcAgP/ngKDJWTcNyTcHhECTBgcAg9eGABMEBwCFB8IHwYMjlPYAkwYADGOG1AATB+ADY3X3AG03IxQEALJAIkSSREEBgoBBEQbGEwcADGMa5QATBbANRTcTBcANskBBAVm/EwewDeMb5f5xNxMF0A31t0ERIsQmwgbGKoSzBLUAYxeUALJAIkSSREEBgoADRQQABQRNP+23NXEmy07H/XKFaf10Is1KyVLFVsMGz5OEhPoWkZOHCQemlxgIs4TnACqJJoUuhJcAgP/ngEAxk4cJBxgIBWq6l7OKR0Ex5AVnfXWTBYX6kwcHBxMFhfkUCKqXM4XXAJMHBweul7OF1wAqxpcAgP/ngAAuMkXBRZU3AUWFYhaR+kBqRNpESkm6SSpKmkoNYYKAooljc4oAhWlOhtaFSoWXAID/54DAxhN19Q8B7U6G1oUmhZcAgP/ngEApTpkzBDRBUbcTBTAGVb8TBQAMSb0xcf1yBWdO11LVVtNezwbfIt0m20rZWtFizWbLaslux/13FpETBwcHPpccCLqXPsYjqgf4qokuirKKtov1M5MHAAIZwbcHAgA+hZcAgP/ngCAghWdj5VcTBWR9eRMJifqTBwQHypcYCDOJ5wBKhZcAgP/ngGAgfXsTDDv5kwyL+RMHBAeTBwQHFAhil+aXgUQzDNcAs4zXAFJNY3xNCWPxpANBqJk/ooUIAY01uTcihgwBSoWXAID/54BAHKKZopRj9UQDs4ekQWPxdwMzBJpAY/OKAFaEIoYMAU6FlwCA/+eAALYTdfUPVd0CzAFEeV2NTaMJAQBihZcAgP/ngECkffkDRTEB5oWFNGNPBQDj4o3+hWeThwcHopcYCLqX2pcjiqf4BQTxt+MVpf2RR+MF9PYFZ311kwcHB5MFhfoTBYX5FAiqlzOF1wCTBwcHrpezhdcAKsaXAID/54BgEnE9MkXBRWUzUT3BMbcHAgAZ4ZMHAAI+hZcAgP/ngKANhWIWkfpQalTaVEpZulkqWppaClv6S2pM2kxKTbpNKWGCgLdXQUkZcZOH94QBRYbeotym2srYztbS1NbS2tDezuLM5srqyO7GPs6XAID/54DAnaE5Ec23Zwlgk4fHEJhDtwaEQCOi5gC3BgMAVY+Ywy05Bc23JwtgN0fYUJOGh8ETBxeqmMIThgfAIyAGACOgBgCThgfCmMKTh8fBmEM3BgQAUY+YwyOgBgC3B4RANzeFQJOHBwATBwe7IaAjoAcAkQfj7ef+XTuRRWgIyTF9M7e3hECThweyIWc+lyMg9wi3B4BANwmEQJOHhw4jIPkAtzmFQF0+EwkJAJOJCbJjBgUQtwcBYBMHEAIjqOcMhUVFRZcAgP/ngAD5twWAQAFGk4UFAEVFlwCA/+eAQPq39wBgEUeYyzcFAgCXAID/54CA+bcXCWCIX4FFt4SEQHGJYRUTNRUAlwCA/+eAgJ/BZ/0XEwcAEIVmQWa3BQABAUWThEQBtwqEQA1qlwCA/+eAQJUTi0oBJpqDp8kI9d+Dq8kIhUcjpgkIIwLxAoPHGwAJRyMT4QKjAvECAtRNR2OB5whRR2OP5wYpR2Of5wCDxzsAA8crAKIH2Y8RR2OW5wCDp4sAnEM+1FUxoUVIEEU+g8c7AAPHKwCiB9mPEWdBB2N09wQTBbANKT4TBcANET4TBeAOOTadOUG3twWAQAFGk4WFAxVFlwCA/+eAQOs3BwBgXEcTBQACk+cXEFzHMbfJRyMT8QJNtwPHGwDRRmPn5gKFRmPm5gABTBME8A+FqHkXE3f3D8lG4+jm/rc2hUAKB5OGRrs2lxhDAoeTBgcDk/b2DxFG42nW/BMH9wITd/cPjUZj6+YItzaFQAoHk4YGwDaXGEMChxMHQAJjmOcQAtQdRAFFtTQBRWU8wT75NqFFSBB9FOE8dfQBTAFEE3X0D0U0E3X8D2k8TT7jHgTqg8cbAElHY2j3MAlH43b36vUXk/f3Dz1H42D36jc3hUCKBxMHB8G6l5xDgocFRJ3rcBCBRQFFl/B//+eAgHEd4dFFaBCtPAFEMagFRIHvl/B//+eAQHczNKAAKaAhR2OF5wAFRAFMYbcDrIsAA6TLALNnjADSB/X37/D/hX3xwWwinP0cfX0zBYxAVdyzd5UBlePBbDMFjEBj5owC/XwzBYxAVdAxgZfwf//ngMBzVflmlPW3MYGX8H//54DAclXxapTRt0GBl/B//+eAAHJR+TMElEHBtyFH44nn8AFMEwQADDG3QUfNv0FHBUTjnOf2g6XLAAOliwD1MrG/QUcFROOS5/YDpwsBkWdj6uceg6VLAQOliwDv8D+BNb9BRwVE45Ln9IOnCwERZ2Nq9xwDp8sAg6VLAQOliwAzhOcC7/Cv/iOsBAAjJIqwMbcDxwQAYwMHFAOniwDBFxMEAAxjE/cAwEgBR5MG8A5jRvcCg8dbAAPHSwABTKIH2Y8Dx2sAQgddj4PHewDiB9mP44H25hMEEAypvTOG6wADRoYBBQexjuG3g8cEAP3H3ERjnQcUwEgjgAQAfbVhR2OW5wKDp8sBA6eLAYOmSwEDpgsBg6XLAAOliwCX8H//54CAYiqMMzSgACm1AUwFRBG1EUcFROOa5+a3lwBgtF9ld30XBWb5jtGOA6WLALTftFeBRfmO0Y601/Rf+Y7RjvTf9FN1j1GP+NOX8H//54CgZSm9E/f3AOMVB+qT3EcAE4SLAAFMfV3jdJzbSESX8H//54AgSBhEVEAQQPmOYwenARxCE0f3/32P2Y4UwgUMQQTZvxFHpbVBRwVE45fn3oOniwADp0sBIyj5ACMm6QB1u4MlyQDBF5Hlic8BTBMEYAyJuwMnCQFjZvcGE/c3AOMZB+IDKAkBAUYBRzMF6ECzhuUAY2n3AOMEBtIjKKkAIybZADG7M4brABBOEQeQwgVG6b8hRwVE45Hn2AMkCQEZwBMEgAwjKAkAIyYJADM0gAClswFMEwQgDO2xAUwTBIAMzbEBTBMEkAzpuRMHIA1jg+cMEwdADeOb57gDxDsAg8crACIEXYyX8H//54CASAOsxABBFGNzhAEijOMJDLbAQGKUMYCcSGNV8ACcRGNb9Arv8O/Ldd3IQGKGk4WLAZfwf//ngIBEAcWTB0AM3MjcQOKX3MDcRLOHh0HcxJfwf//ngGBDJbYJZRMFBXEDrMsAA6SLAJfwf//ngKAytwcAYNhLtwYAAcEWk1dHARIHdY+9i9mPs4eHAwFFs9WHApfwf//ngAA0EwWAPpfwf//ngEAv6byDpksBA6YLAYOlywADpYsA7/Av/NG0g8U7AIPHKwAThYsBogXdjcEV7/DP1XW07/AvxT2/A8Q7AIPHKwATjIsBIgRdjNxEQRTN45FHhUtj/4cIkweQDNzIQbQDpw0AItAFSLOH7EA+1oMnirBjc/QADUhCxjrE7/CvwCJHMkg3hYRA4oV8EJOGSgEQEBMFxQKX8H//54CgMTe3hECTCEcBglcDp4iwg6UNAB2MHY8+nLJXI6TosKqLvpUjoL0Ak4dKAZ2NAcWhZ2OX9QBahe/wb8sjoG0BCcTcRJnD409w92PfCwCTB3AMvbeFS7c9hUC3jIRAk40Nu5OMTAHpv+OdC5zcROOKB5yTB4AMqbeDp4sA45MHnO/wb9MJZRMFBXGX8H//54CgHO/w786X8H//54BgIVWyA6TLAOMPBJjv8O/QEwWAPpfwf//ngEAa7/CPzAKUUbLv8A/M9lBmVNZURlm2WSZalloGW/ZLZkzWTEZNtk0JYYKAAAA=", $ec3de3bad43fb783$var$ti = 1082130432, $ec3de3bad43fb783$var$ei = "FACEQG4KgEC+CoBAFguAQOQLgEBQDIBA/guAQDoJgECgC4BA4AuAQCoLgEDqCIBAXguAQOoIgEBICoBAjgqAQL4KgEAWC4BAWgqAQJ4JgEDOCYBAVgqAQKgOgEC+CoBAaA2AQGAOgEAqCIBAiA6AQCoIgEAqCIBAKgiAQCoIgEAqCIBAKgiAQCoIgEAqCIBABA2AQCoIgECGDYBAYA6AQA==", $ec3de3bad43fb783$var$ii = 1082469296; +var $ec3de3bad43fb783$var$si = Object.freeze({ + __proto__: null, + ESP32C5ROM: class extends $ec3de3bad43fb783$var$qe { + constructor(){ + super(...arguments), this.CHIP_NAME = "ESP32-C5", this.IMAGE_CHIP_ID = 23, this.EFUSE_BASE = 1611352064, this.EFUSE_BLOCK1_ADDR = this.EFUSE_BASE + 68, this.MAC_EFUSE_REG = this.EFUSE_BASE + 68, this.UART_CLKDIV_REG = 1610612756, this.TEXT_START = $ec3de3bad43fb783$var$ti, this.ENTRY = $ec3de3bad43fb783$var$$e, this.DATA_START = $ec3de3bad43fb783$var$ii, this.ROM_DATA = $ec3de3bad43fb783$var$ei, this.ROM_TEXT = $ec3de3bad43fb783$var$Ai, this.EFUSE_RD_REG_BASE = this.EFUSE_BASE + 48, this.EFUSE_PURPOSE_KEY0_REG = this.EFUSE_BASE + 52, this.EFUSE_PURPOSE_KEY0_SHIFT = 24, this.EFUSE_PURPOSE_KEY1_REG = this.EFUSE_BASE + 52, this.EFUSE_PURPOSE_KEY1_SHIFT = 28, this.EFUSE_PURPOSE_KEY2_REG = this.EFUSE_BASE + 56, this.EFUSE_PURPOSE_KEY2_SHIFT = 0, this.EFUSE_PURPOSE_KEY3_REG = this.EFUSE_BASE + 56, this.EFUSE_PURPOSE_KEY3_SHIFT = 4, this.EFUSE_PURPOSE_KEY4_REG = this.EFUSE_BASE + 56, this.EFUSE_PURPOSE_KEY4_SHIFT = 8, this.EFUSE_PURPOSE_KEY5_REG = this.EFUSE_BASE + 56, this.EFUSE_PURPOSE_KEY5_SHIFT = 12, this.EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT_REG = this.EFUSE_RD_REG_BASE, this.EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT = 1048576, this.EFUSE_SPI_BOOT_CRYPT_CNT_REG = this.EFUSE_BASE + 52, this.EFUSE_SPI_BOOT_CRYPT_CNT_MASK = 1835008, this.EFUSE_SECURE_BOOT_EN_REG = this.EFUSE_BASE + 56, this.EFUSE_SECURE_BOOT_EN_MASK = 1048576, this.IROM_MAP_START = 1107296256, this.IROM_MAP_END = 1115684864, this.DROM_MAP_START = 1115684864, this.DROM_MAP_END = 1124073472, this.PCR_SYSCLK_CONF_REG = 1611227408, this.PCR_SYSCLK_XTAL_FREQ_V = 2130706432, this.PCR_SYSCLK_XTAL_FREQ_S = 24, this.XTAL_CLK_DIVIDER = 1, this.UARTDEV_BUF_NO = 1082520860, this.CHIP_DETECT_MAGIC_VALUE = [ + 285294703 + ], this.FLASH_FREQUENCY = { + "80m": 15, + "40m": 0, + "20m": 2 + }, this.MEMORY_MAP = [ + [ + 0, + 65536, + "PADDING" + ], + [ + 1115684864, + 1124073472, + "DROM" + ], + [ + 1082130432, + 1082523648, + "DRAM" + ], + [ + 1082130432, + 1082523648, + "BYTE_ACCESSIBLE" + ], + [ + 1073979392, + 1074003968, + "DROM_MASK" + ], + [ + 1073741824, + 1073979392, + "IROM_MASK" + ], + [ + 1107296256, + 1115684864, + "IROM" + ], + [ + 1082130432, + 1082523648, + "IRAM" + ], + [ + 1342177280, + 1342193664, + "RTC_IRAM" + ], + [ + 1342177280, + 1342193664, + "RTC_DRAM" + ], + [ + 1611653120, + 1611661312, + "MEM_INTERNAL2" + ] + ], this.UF2_FAMILY_ID = 4145808195, this.EFUSE_MAX_KEY = 5, this.KEY_PURPOSES = { + 0: "USER/EMPTY", + 1: "ECDSA_KEY", + 2: "XTS_AES_256_KEY_1", + 3: "XTS_AES_256_KEY_2", + 4: "XTS_AES_128_KEY", + 5: "HMAC_DOWN_ALL", + 6: "HMAC_DOWN_JTAG", + 7: "HMAC_DOWN_DIGITAL_SIGNATURE", + 8: "HMAC_UP", + 9: "SECURE_BOOT_DIGEST0", + 10: "SECURE_BOOT_DIGEST1", + 11: "SECURE_BOOT_DIGEST2", + 12: "KM_INIT_KEY" + }; + } + async getPkgVersion(A) { + return await A.readReg(this.EFUSE_BLOCK1_ADDR + 8) >> 26 & 7; + } + async getMinorChipVersion(A) { + return await A.readReg(this.EFUSE_BLOCK1_ADDR + 8) >> 0 & 15; + } + async getMajorChipVersion(A) { + return await A.readReg(this.EFUSE_BLOCK1_ADDR + 8) >> 4 & 3; + } + async getChipDescription(A) { + let t; + t = 0 === await this.getPkgVersion(A) ? "ESP32-C5" : "unknown ESP32-C5"; + return `${t} (revision v${await this.getMajorChipVersion(A)}.${await this.getMinorChipVersion(A)})`; + } + async getCrystalFreq(A) { + const t = await A.readReg(this.UART_CLKDIV_REG) & this.UART_CLKDIV_MASK, e = A.transport.baudrate * t / 1e6 / this.XTAL_CLK_DIVIDER; + let i; + return i = e > 45 ? 48 : e > 33 ? 40 : 26, Math.abs(i - e) > 1 && A.info("WARNING: Unsupported crystal in use"), i; + } + async getCrystalFreqRomExpect(A) { + return (await A.readReg(this.PCR_SYSCLK_CONF_REG) & this.PCR_SYSCLK_XTAL_FREQ_V) >> this.PCR_SYSCLK_XTAL_FREQ_S; + } + } +}), $ec3de3bad43fb783$var$ai = 1082132112, $ec3de3bad43fb783$var$ni = "QREixCbCBsa39wBgEUc3BINA2Mu39ABgEwQEANxAkYuR57JAIkSSREEBgoCIQBxAE3X1D4KX3bcBEbcHAGBOxoOphwBKyDcJg0AmylLEBs4izLcEAGB9WhMJCQDATBN09A8N4PJAYkQjqDQBQknSRLJJIkoFYYKAiECDJwkAE3X1D4KXfRTjGUT/yb8TBwAMlEGqh2MY5QCFR4XGI6AFAHlVgoAFR2OH5gAJRmONxgB9VYKAQgUTB7ANQYVjlecCiUecwfW3kwbADWMW1QCYwRMFAAyCgJMG0A19VWOV1wCYwRMFsA2CgLc1hEBBEZOFRboGxmE/Y0UFBrc3hECTh8exA6cHCAPWRwgTdfUPkwYWAMIGwYIjktcIMpcjAKcAA9dHCJFnk4cHBGMe9wI3t4NAEwfHsaFnupcDpgcIt/aDQLc3hECTh8exk4bGtWMf5gAjpscII6DXCCOSBwghoPlX4wb1/LJAQQGCgCOm1wgjoOcI3bc3NwBgfEudi/X/NycAYHxLnYv1/4KAQREGxt03tzcAYCOmBwI3BwAImMOYQ33/yFeyQBNF9f8FiUEBgoBBEQbG2T993TcHAEC3NwBgmMM3NwBgHEP9/7JAQQGCgEERIsQ3hINAkwcEAUrAA6kHAQbGJsJjCgkERTc5xb1HEwQEAYFEY9YnAQREvYiTtBQAfTeFPxxENwaAABOXxwCZ4DcGAAG39v8AdY+3NgBg2MKQwphCff9BR5HgBUczCelAupcjKCQBHMSyQCJEkkQCSUEBgoABEQbOIswlNzcEhUBsABMFBP+XAID/54Ag8qqHBUWV57JHk/cHID7GiTc3NwBgHEe3BkAAEwUE/9WPHMeyRZcAgP/ngKDvMzWgAPJAYkQFYYKAQRG3h4NABsaThwcBBUcjgOcAE9fFAJjHBWd9F8zDyMf5jTqVqpWxgYzLI6oHAEE3GcETBVAMskBBAYKAAREizDeEg0CTBwQBJsrER07GBs5KyKqJEwQEAWPzlQCuhKnAAylEACaZE1nJABxIY1XwABxEY175ArU9fd1IQCaGzoWXAID/54Cg4hN19Q8BxZMHQAxcyFxAppdcwFxEhY9cxPJAYkTSREJJskkFYYKAaTVtv0ERBsaXAID/54BA1gNFhQGyQHUVEzUVAEEBgoBBEQbGxTcNxbcHg0CThwcA1EOZzjdnCWATB8cQHEM3Bv3/fRbxjzcGAwDxjtWPHMOyQEEBgoBBEQbGbTcRwQ1FskBBARcDgP9nAIPMQREGxpcAgP/ngEDKcTcBxbJAQQHZv7JAQQGCgEERBsYTBwAMYxrlABMFsA3RPxMFwA2yQEEB6bcTB7AN4xvl/sE3EwXQDfW3QREixCbCBsYqhLMEtQBjF5QAskAiRJJEQQGCgANFBAAFBE0/7bc1cSbLTsf9coVp/XQizUrJUsVWwwbPk4SE+haRk4cJB6aXGAizhOcAKokmhS6ElwCA/+eAgCyThwkHGAgFarqXs4pHQTHkBWd9dZMFhfqTBwcHEwWF+RQIqpczhdcAkwcHB66Xs4XXACrGlwCA/+eAQCkyRcFFlTcBRYViFpH6QGpE2kRKSbpJKkqaSg1hgoCiiWNzigCFaU6G1oVKhZcAgP/ngIDIE3X1DwHtTobWhSaFlwCA/+eAgCROmTMENEFRtxMFMAZVvxMFAAzZtTFx/XIFZ07XUtVW017PBt8i3SbbStla0WLNZstqyW7H/XcWkRMHBwc+lxwIupc+xiOqB/iqiS6Ksoq2iwU1kwcAAhnBtwcCAD6FlwCA/+eAIB2FZ2PlVxMFZH15EwmJ+pMHBAfKlxgIM4nnAEqFlwCA/+eAoBt9exMMO/mTDIv5EwcEB5MHBAcUCGKX5peBRDMM1wCzjNcAUk1jfE0JY/GkA0GomT+ihQgBjTW5NyKGDAFKhZcAgP/ngIAXopmilGP1RAOzh6RBY/F3AzMEmkBj84oAVoQihgwBToWXAID/54DAtxN19Q9V3QLMAUR5XY1NowkBAGKFlwCA/+eAgKd9+QNFMQHmhVE8Y08FAOPijf6FZ5OHBweilxgIupfalyOKp/gFBPG34xWl/ZFH4wX09gVnfXWTBwcHkwWF+hMFhfkUCKqXM4XXAJMHBweul7OF1wAqxpcAgP/ngKANcT0yRcFFZTNRPdU5twcCABnhkwcAAj6FlwCA/+eAoAqFYhaR+lBqVNpUSlm6WSpamloKW/pLakzaTEpNuk0pYYKAt1dBSRlxk4f3hAFFht6i3KbaytjO1tLU1tLa0N7O4szmyurI7sY+zpcAgP/ngMCgcTENwTdnCWATB8cQHEO3BoNAI6L2ALcG/f/9FvWPwWbVjxzDpTEFzbcnC2A3R9hQk4bHwRMHF6qYwhOGB8AjIAYAI6AGAJOGR8KYwpOHB8KYQzcGBABRj5jDI6AGALcHg0A3N4RAk4cHABMHx7ohoCOgBwCRB+Pt5/5FO5FFaAh1OWUzt7eDQJOHx7EhZz6XIyD3CLcHgEA3CYNAk4eHDiMg+QC3OYRA1TYTCQkAk4nJsWMHBRC3BwFgRUcjqucIhUVFRZcAgP/ngAD2twWAQAFGk4UFAEVFlwCA/+eAAPc39wBgHEs3BQIAk+dHABzLlwCA/+eAAPa3FwlgiF+BRbeEg0BxiWEVEzUVAJcAgP/ngICgwWf9FxMHABCFZkFmtwUAAQFFk4QEAbcKg0ANapcAgP/ngICWE4sKASaag6fJCPXfg6vJCIVHI6YJCCMC8QKDxxsACUcjE+ECowLxAgLUTUdjgecIUUdjj+cGKUdjn+cAg8c7AAPHKwCiB9mPEUdjlucAg6eLAJxDPtRxOaFFSBBlNoPHOwADxysAogfZjxFnQQdjdPcEEwWwDZk2EwXADYE2EwXgDi0+vTFBt7cFgEABRpOFhQMVRZcAgP/ngMDnNwcAYFxHEwUAApPnFxBcxzG3yUcjE/ECTbcDxxsA0UZj5+YChUZj5uYAAUwTBPAPhah5FxN39w/JRuPo5v63NoRACgeThga7NpcYQwKHkwYHA5P29g8RRuNp1vwTB/cCE3f3D41GY+vmCLc2hEAKB5OGxr82lxhDAocTB0ACY5jnEALUHUQBRWE8AUVFPOE22TahRUgQfRTBPHX0AUwBRBN19A9hPBN1/A9JPG024x4E6oPHGwBJR2Nj9y4JR+N29+r1F5P39w89R+Ng9+o3N4RAigcTB8fAupecQ4KHBUSd63AQgUUBRZfwf//ngAB0HeHRRWgQjTwBRDGoBUSB75fwf//ngIB4MzSgACmgIUdjhecABUQBTGG3A6yLAAOkywCzZ4wA0gf19+/wv4h98cFsIpz9HH19MwWMQFXcs3eVAZXjwWwzBYxAY+aMAv18MwWMQFXQMYGX8H//54AAdVX5ZpT1tzGBl/B//+eAAHRV8WqU0bdBgZfwf//ngEBzUfkzBJRBwbchR+OJ5/ABTBMEAAwxt0FHzb9BRwVE45zn9oOlywADpYsA1TKxv0FHBUTjkuf2A6cLAZFnY+XnHIOlSwEDpYsA7/D/gzW/QUcFROOS5/SDpwsBEWdjZfcaA6fLAIOlSwEDpYsAM4TnAu/wf4EjrAQAIySKsDG3A8cEAGMOBxADp4sAwRcTBAAMYxP3AMBIAUeTBvAOY0b3AoPHWwADx0sAAUyiB9mPA8drAEIHXY+Dx3sA4gfZj+OB9uYTBBAMqb0zhusAA0aGAQUHsY7ht4PHBADxw9xEY5gHEsBII4AEAH21YUdjlucCg6fLAQOniwGDpksBA6YLAYOlywADpYsAl/B//+eAwGMqjDM0oAAptQFMBUQRtRFHBUTjmufmA6WLAIFFl/B//+eAQGmRtRP39wDjGgfsk9xHABOEiwABTH1d43mc3UhEl/B//+eAwE0YRFRAEED5jmMHpwEcQhNH9/99j9mOFMIFDEEE2b8RR0m9QUcFROOc5+CDp4sAA6dLASMm+QAjJOkA3bODJYkAwReR5YnPAUwTBGAMtbsDJ8kAY2b3BhP3NwDjHgfkAyjJAAFGAUczBehAs4blAGNp9wDjCQbUIyapACMk2QCZszOG6wAQThEHkMIFRum/IUcFROOW59oDJMkAGcATBIAMIyYJACMkCQAzNIAASbsBTBMEIAwRuwFMEwSADDGzAUwTBJAMEbMTByANY4PnDBMHQA3jkOe8A8Q7AIPHKwAiBF2Ml/B//+eAYEwDrMQAQRRjc4QBIozjDgy4wEBilDGAnEhjVfAAnERjW/QK7/BP0XXdyEBihpOFiwGX8H//54BgSAHFkwdADNzI3EDil9zA3ESzh4dB3MSX8H//54BAR4m+CWUTBQVxA6zLAAOkiwCX8H//54BAOLcHAGDYS7cGAAHBFpNXRwESB3WPvYvZj7OHhwMBRbPVhwKX8H//54BgORMFgD6X8H//54DgNBG2g6ZLAQOmCwGDpcsAA6WLAO/wT/79tIPFOwCDxysAE4WLAaIF3Y3BFe/wL9vZvO/wj8o9vwPEOwCDxysAE4yLASIEXYzcREEUzeORR4VLY/+HCJMHkAzcyG20A6cNACLQBUizh+xAPtaDJ4qwY3P0AA1IQsY6xO/wD8YiRzJIN4WDQOKFfBCThgoBEBATBYUCl/B//+eAwDY3t4NAkwgHAYJXA6eIsIOlDQAdjB2PPpyyVyOk6LCqi76VI6C9AJOHCgGdjQHFoWdjl/UAWoXv8M/QI6BtAQnE3ESZw+NPcPdj3wsAkwdwDL23hUu3PYRAt4yDQJONzbqTjAwB6b/jkgug3ETjjweekweADKm3g6eLAOOYB57v8M/YCWUTBQVxl/B//+eAQCLv8E/Ul/B//+eAgCb5sgOkywDjBASc7/BP1hMFgD6X8H//54DgH+/w79EClH2y7/Bv0fZQZlTWVEZZtlkmWpZaBlv2S2ZM1kxGTbZNCWGCgA==", $ec3de3bad43fb783$var$Ei = 1082130432, $ec3de3bad43fb783$var$hi = "EACDQEIKgECSCoBA6gqAQI4LgED6C4BAqAuAQA4JgEBKC4BAiguAQP4KgEC+CIBAMguAQL4IgEAcCoBAYgqAQJIKgEDqCoBALgqAQHIJgECiCYBAKgqAQFIOgECSCoBAEg2AQAoOgED+B4BAMg6AQP4HgED+B4BA/geAQP4HgED+B4BA/geAQP4HgED+B4BArgyAQP4HgEAwDYBACg6AQA==", $ec3de3bad43fb783$var$ri = 1082403756; +var $ec3de3bad43fb783$var$gi = Object.freeze({ + __proto__: null, + ESP32H2ROM: class extends $ec3de3bad43fb783$export$c643cc54d6326a6f { + constructor(){ + super(...arguments), this.CHIP_NAME = "ESP32-H2", this.IMAGE_CHIP_ID = 16, this.EFUSE_BASE = 1610647552, this.MAC_EFUSE_REG = this.EFUSE_BASE + 68, this.UART_CLKDIV_REG = 1072955412, this.UART_CLKDIV_MASK = 1048575, this.UART_DATE_REG_ADDR = 1610612860, this.FLASH_WRITE_SIZE = 1024, this.BOOTLOADER_FLASH_OFFSET = 0, this.FLASH_SIZES = { + "1MB": 0, + "2MB": 16, + "4MB": 32, + "8MB": 48, + "16MB": 64 + }, this.SPI_REG_BASE = 1610620928, this.SPI_USR_OFFS = 24, this.SPI_USR1_OFFS = 28, this.SPI_USR2_OFFS = 32, this.SPI_MOSI_DLEN_OFFS = 36, this.SPI_MISO_DLEN_OFFS = 40, this.SPI_W0_OFFS = 88, this.USB_RAM_BLOCK = 2048, this.UARTDEV_BUF_NO_USB = 3, this.UARTDEV_BUF_NO = 1070526796, this.TEXT_START = $ec3de3bad43fb783$var$Ei, this.ENTRY = $ec3de3bad43fb783$var$ai, this.DATA_START = $ec3de3bad43fb783$var$ri, this.ROM_DATA = $ec3de3bad43fb783$var$hi, this.ROM_TEXT = $ec3de3bad43fb783$var$ni; + } + async getChipDescription(A) { + return this.CHIP_NAME; + } + async getChipFeatures(A) { + return [ + "BLE", + "IEEE802.15.4" + ]; + } + async getCrystalFreq(A) { + return 32; + } + _d2h(A) { + const t = (+A).toString(16); + return 1 === t.length ? "0" + t : t; + } + async postConnect(A) { + const t = 255 & await A.readReg(this.UARTDEV_BUF_NO); + A.debug("In _post_connect " + t), t == this.UARTDEV_BUF_NO_USB && (A.ESP_RAM_BLOCK = this.USB_RAM_BLOCK); + } + async readMac(A) { + let t = await A.readReg(this.MAC_EFUSE_REG); + t >>>= 0; + let e = await A.readReg(this.MAC_EFUSE_REG + 4); + e = e >>> 0 & 65535; + const i = new Uint8Array(6); + return i[0] = e >> 8 & 255, i[1] = 255 & e, i[2] = t >> 24 & 255, i[3] = t >> 16 & 255, i[4] = t >> 8 & 255, i[5] = 255 & t, this._d2h(i[0]) + ":" + this._d2h(i[1]) + ":" + this._d2h(i[2]) + ":" + this._d2h(i[3]) + ":" + this._d2h(i[4]) + ":" + this._d2h(i[5]); + } + getEraseSize(A, t) { + return t; + } + } +}), $ec3de3bad43fb783$var$oi = 1077381696, $ec3de3bad43fb783$var$Bi = "FIADYACAA2BIAMo/BIADYDZBAIH7/wxJwCAAmQjGBAAAgfj/wCAAqAiB9/+goHSICOAIACH2/8AgAIgCJ+jhHfAAAAAIAABgHAAAYBAAAGA2QQAh/P/AIAA4AkH7/8AgACgEICCUnOJB6P9GBAAMODCIAcAgAKgIiASgoHTgCAALImYC6Ib0/yHx/8AgADkCHfAAAOwryz9kq8o/hIAAAEBAAACk68o/8CvLPzZBALH5/yCgdBARIKUrAZYaBoH2/5KhAZCZEZqYwCAAuAmR8/+goHSaiMAgAJIYAJCQ9BvJwMD0wCAAwlgAmpvAIACiSQDAIACSGACB6v+QkPSAgPSHmUeB5f+SoQGQmRGamMAgAMgJoeX/seP/h5wXxgEAfOiHGt7GCADAIACJCsAgALkJRgIAwCAAuQrAIACJCZHX/5qIDAnAIACSWAAd8AAAVCAAYFQwAGA2QQCR/f/AIACICYCAJFZI/5H6/8AgAIgJgIAkVkj/HfAAAAAsIABgACAAYAAAAAg2QQAQESCl/P8h+v8MCMAgAIJiAJH6/4H4/8AgAJJoAMAgAJgIVnn/wCAAiAJ88oAiMCAgBB3wAAAAAEA2QQAQESDl+/8Wav+B7P+R+//AIACSaADAIACYCFZ5/x3wAAAUKABANkEAIKIggf3/4AgAHfAAAHDi+j8IIABgvAoAQMgKAEA2YQAQESBl9P8x+f+9Aa0Dgfr/4AgATQoMEuzqiAGSogCQiBCJARARIOX4/5Hy/6CiAcAgAIgJoIggwCAAiQm4Aa0Dge7/4AgAoCSDHfAAAFgAyj//DwAABCAAQOgIAEA2QQCB+/8MGZJIADCcQZkokfn/ORgpODAwtJoiKjMwPEEMAjlIKViB9P/gCAAnGgiB8//gCAAGAwAQESAl9v8tCowaIqDFHfC4CABANoEAgev/4AgAHAYGDAAAAGBUQwwIDBrQlREMjTkx7QKJYalRmUGJIYkR2QEsDwzMDEuB8v/gCABQRMBaM1oi5hTNDAId8AAA////AAQgAGD0CABADAkAQAAJAEA2gQAx0f8oQxaCERARIGXm/xb6EAz4DAQnqAyIIwwSgIA0gCSTIEB0EBEgZej/EBEgJeH/gcf/4AgAFjoKqCOB6/9AKhEW9AQnKDyBwv/gCACB6P/gCADoIwwCDBqpYalRHI9A7hEMjcKg2AxbKUEpMSkhKREpAYHK/+AIAIG1/+AIAIYCAAAAoKQhgdv/4AgAHAoGIAAAACcoOYGu/+AIAIHU/+AIAOgjDBIcj0DuEQyNLAwMW60CKWEpUUlBSTFJIUkRSQGBtv/gCACBov/gCABGAQCByf/gCAAMGoYNAAAoIwwZQCIRkIkBzBSAiQGRv/+QIhCRvv/AIAAiaQAhW//AIACCYgDAIACIAlZ4/xwKDBJAooMoQ6AiwClDKCOqIikjHfAAADaBAIGK/+AIACwGhg8AAACBr//gCABgVEMMCAwa0JUR7QKpYalRiUGJMZkhORGJASwPDI3CoBKyoASBj//gCACBe//gCABaM1oiUETA5hS/HfAAABQKAEA2YQBBcf9YNFAzYxajC1gUWlNQXEFGAQAQESBl5v9oRKYWBWIkAmel7hARIGXM/xZq/4Fn/+AIABaaBmIkAYFl/+AIAGBQdIKhAFB4wHezCM0DvQKtBgYPAM0HvQKtBlLV/xARICX0/zpVUFhBDAjGBQAAAADCoQCJARARIKXy/4gBctcBG4iAgHRwpoBwsoBXOOFww8AQESDl8P+BTv/gCACGBQCoFM0DvQKB1P/gCACgoHSMSiKgxCJkBSgUOiIpFCg0MCLAKTQd8ABcBwBANkEAgf7/4AgAggoYDAmCyPwMEoApkx3wNkEAgfj/4AgAggoYDAmCyP0MEoApkx3wvP/OP0QAyj9MAMo/QCYAQDQmAEDQJgBANmEAfMitAoeTLTH3/8YFAACoAwwcvQGB9//gCACBj/6iAQCICOAIAKgDgfP/4AgA5hrdxgoAAABmAyYMA80BDCsyYQCB7v/gCACYAYHo/zeZDagIZhoIMeb/wCAAokMAmQgd8EAAyj8AAMo/KCYAQDZBACH8/4Hc/8gCqAix+v+B+//gCAAMCIkCHfCQBgBANkEAEBEgpfP/jLqB8v+ICIxIEBEgpfz/EBEg5fD/FioAoqAEgfb/4AgAHfBIBgBANkEAEBEgpfD/vBqR5v+ICRuoqQmR5f8MCoqZIkkAgsjBDBmAqYOggHTMiqKvQKoiIJiTnNkQESBl9/9GBQCtAoHv/+AIABARIOXq/4xKEBEg5ff/HfAAADZBAKKgwBARIOX5/x3wAAA2QQCCoMCtAoeSEaKg2xARIGX4/6Kg3EYEAAAAAIKg24eSCBARICX3/6Kg3RARIKX2/x3wNkEAOjLGAgAAogIAGyIQESCl+/83kvEd8AAAAFwcAEAgCgBAaBwAQHQcAEA2ISGi0RCB+v/gCABGEAAAAAwUQEQRgcb+4AgAQENjzQS9AYyqrQIQESCltf8GAgAArQKB8P/gCACgoHT8Ws0EELEgotEQgez/4AgASiJAM8BWw/siogsQIrAgoiCy0RCB5//gCACtAhwLEBEgZfb/LQOGAAAioGMd8AAAiCYAQIQbAECUJgBAkBsAQDZBABARIGXb/6yKDBNBcf/wMwGMsqgEgfb/4AgArQPGCQCtA4H0/+AIAKgEgfP/4AgABgkAEBEgpdb/DBjwiAEsA6CDg60IFpIAgez/4AgAhgEAAIHo/+AIAB3wYAYAQDZBIWKkHeBmERpmWQYMF1KgAGLREFClIEB3EVJmGhARIOX3/0e3AsZCAK0Ggbb/4AgAxi8AUHPAgYP+4AgAQHdjzQe9AYy6IKIgEBEgpaT/BgIAAK0Cgaz/4AgAoKB0jJoMCIJmFn0IBhIAABARIGXj/70HrQEQESDl5v8QESBl4v/NBxCxIGCmIIGg/+AIAHoielU3tcmSoQfAmRGCpB0ameCIEZgJGoiICJB1wIc3gwbr/wwJkkZsoqQbEKqggc//4AgAVgr/sqILogZsELuwEBEg5acA9+oS9kcPkqINEJmwepmiSQAbd4bx/3zpl5rBZkcSgqEHkiYawIgRGoiZCDe5Ape1iyKiCxAisL0GrQKBf//gCAAQESCl2P+tAhwLEBEgJdz/EBEgpdf/DBoQESDl5v8d8AAAyj9PSEFJsIAAYKE62FCYgABguIAAYCoxHY+0gABg9CvLP6yAN0CYIAxg7IE3QKyFN0AIAAhggCEMYBCAN0AQgANgUIA3QAwAAGA4QABglCzLP///AAAsgQBgjIAAABBAAAD4K8s/CCzLP1AAyj9UAMo/VCzLPxQAAGDw//8A9CvLP2Qryj9wAMo/gAcAQHgbAEC4JgBAZCYAQHQfAEDsCgBAVAkAQFAKAEAABgBAHCkAQCQnAEAIKABA5AYAQHSBBECcCQBA/AkAQAgKAECoBgBAhAkAQGwJAECQCQBAKAgAQNgGAEA24QAhxv8MCinBgeb/4AgAEBEgJbH/FpoEMcH/IcL/QcL/wCAAKQMMAsAgACkEwCAAKQNRvv8xvv9hvv/AIAA5BcAgADgGfPQQRAFAMyDAIAA5BsAgACkFxgEAAEkCSyIGAgAhrf8xtP9CoAA3MuwQESAlwf8MS6LBMBARIKXE/yKhARARIOW//0Fz/ZAiESokwCAASQIxqf8hS/05AhARIKWp/y0KFvoFIar+wav+qAIMK4Gt/uAIADGh/7Gi/xwaDAzAIACpA4G4/+AIAAwa8KoBgSr/4AgAsZv/qAIMFYGz/+AIAKgCgSL/4AgAqAKBsP/gCAAxlf/AIAAoA1AiIMAgACkDhhgAEBEgZaH/vBoxj/8cGrGP/8AgAKJjACDCIIGh/+AIADGM/wxFwCAAKAMMGlAiIMAgACkD8KoBxggAAACxhv/NCgxagZf/4AgAMYP/UqEBwCAAKAMsClAiIMAgACkDgQX/4AgAgZL/4AgAIXz/wCAAKALMuhzDMCIQIsL4DBMgo4MMC4GL/+AIAIGk/eAIAIzaoXP/gYj/4AgAgaH94AgA8XH/DB0MHAwb4qEAQN0RAMwRYLsBDAqBgP/gCAAha/8qRCGU/WLSK4YXAAAAUWH+wCAAMgUAMDB0FtMEDBrwqgHAIAAiRQCB4f7gCACionHAqhGBcv/gCACBcf/gCABxWv986MAgADgHfPqAMxAQqgHAIAA5B4Fr/+AIAIFr/+AIAK0CgWr/4AgAwCAAKAQWovkMB8AgADgEDBLAIAB5BCJBJCIDAQwoeaEiQSWCURMcN3cSJBxHdxIhZpIhIgMDcgMCgCIRcCIgZkISKCPAIAAoAimhhgEAAAAcIiJRExARIKWf/7KgCKLBJBARICWj/7IDAyIDAoC7ESBbICE0/yAg9FeyGqKgwBARIOWd/6Kg7hARIGWd/xARICWc/wba/yIDARxHJzc39iIbxvgAACLCLyAgdLZCAgYlAHEm/3AioCgCoAIAACLC/iAgdBwnJ7cCBu8AcSD/cCKgKAKgAgBywjBwcHS2V8VG6QAsSQwHIqDAlxUCRucAeaEMcq0HEBEgpZb/rQcQESAllv8QESCllP8QESBllP8Mi6LBJCLC/xARIKWX/1Yi/UZEAAwSVqU1wsEQvQWtBYEd/+AIAFaqNBxLosEQEBEgZZX/hrAADBJWdTOBF//gCACgJYPGygAmhQQMEsbIAHgjKDMghyCAgLRW2P4QESClQv8qd6zaBvj/AIEd/eAIAFBcQZwKrQWBRf3gCACGAwAAItLwRgMArQWBBf/gCAAW6v4G7f8gV8DMEsaWAFCQ9FZp/IYLAIEO/eAIAFBQ9ZxKrQWBNf3gCACGBAAAfPgAiBGKIkYDAK0Fgfb+4AgAFqr+Bt3/DBkAmREgV8AnOcVGCwAAAACB/vzgCABQXEGcCq0FgSb94AgAhgMAACLS8EYDAK0Fgeb+4AgAFur+Bs7/IFfAVuL8hncADAcioMAmhQLGlQAMBy0HBpQAJrX1BmoADBImtQIGjgC4M6gjDAcQESDlhv+gJ4OGiQAMGWa1X4hDIKkRDAcioMKHugLGhgC4U6gjkmEREBEg5Tf/kiERoJeDRg4ADBlmtTSIQyCpEQwHIqDCh7oCBnwAKDO4U6gjIHiCkmEREBEg5TT/Ic78DAiSIRGJYiLSK3JiAqCYgy0JBm8AAJHI/AwHogkAIqDGd5oCBm0AeCOyxfAioMC3lwEoWQwHkqDvRgIAeoOCCBgbd4CZMLcn8oIDBXIDBICIEXCIIHIDBgB3EYB3IIIDB4CIAXCIIICZwIKgwQwHkCiThlkAgbD8IqDGkggAfQkWiRWYOAwHIqDIdxkCxlIAKFiSSABGTgAciQwHDBKXFQLGTQD4c+hj2FPIQ7gzqCOBi/7gCAAMCH0KoCiDxkYAAAAMEiZFAsZBAKgjDAuBgf7gCAAGIAAAUJA0DAcioMB3GQJGPQBQVEGLw3z4Rg8AqDyCYRKSYRHCYRCBef7gCADCIRCCIRIoLHgcqAySIRFwchAmAg3AIADYCiAoMNAiECB3IMAgAHkKG5nCzBBXOb7Gk/9mRQJGkv8MByKgwEYmAAwSJrUCxiEAIVX+iFN4I4kCIVT+eQIMAgYdAKFQ/gwH6AoMGbLF8I0HLQewKZPgiYMgiBAioMZ3mF/BSv59CNgMIqDJtz1SsPAUIqDAVp8ELQiGAgAAKoOIaEsiiQeNCSp+IP3AtzLtFmjd+Qx5CsZz/wAMEmaFFyE6/ogCjBiCoMgMB3kCITb+eQIMEoAngwwHBgEADAcioP8goHQQESDlXP9woHQQESBlXP8QESDlWv9WYrUiAwEcJyc3IPYyAgbS/iLC/SAgdAz3J7cChs7+cSX+cCKgKAKgAgAAAHKg0ncSX3Kg1HeSAgYhAMbG/igzOCMQESDlQf+NClbKsKKiccCqEYJhEoEl/uAIAHEX/pEX/sAgAHgHgiEScLQ1wHcRkHcQcLsgILuCrQgwu8KBJP7gCACio+iBGf7gCABGsv4AANhTyEO4M6gjEBEgpWb/hq3+ALIDAyIDAoC7ESC7ILLL8KLDGBARICUs/4am/gAiAwNyAwKAIhFwIiCBEv7gCABxHPwiwvCIN4AiYxaSp4gXioKAjEFGAwAAAIJhEhARIKUQ/4IhEpInBKYZBZInApeo5xARIKX2/hZq/6gXzQKywxiBAf7gCACMOjKgxDlXOBcqMzkXODcgI8ApN4H7/eAIAIaI/gAAcgMCIsMYMgMDDBmAMxFwMyAyw/AGIwBx3P2Bi/uYBzmxkIjAiUGIJgwZh7MBDDmSYREQESDlCP+SIRGB1P2ZAegHodP93QggsiDCwSzywRCCYRKB5f3gCAC4Jp0KqLGCIRKgu8C5JqAzwLgHqiKoQQwMqrsMGrkHkMqDgLvAwNB0VowAwtuAwK2TFmoBrQiCYRKSYREQESClGv+CIRKSIRGCZwBR2ft4NYyjkI8xkIjA1igAVvf11qkAMdT7IqDHKVNGAACMOYz3BlX+FheVUc/7IqDIKVWGUf4xzPsioMkpU8ZO/igjVmKTEBEg5S//oqJxwKoRga/94AgAgbv94AgAxkb+KDMWYpEQESDlLf+io+iBqP3gCADgAgBGQP4d8AAANkEAnQKCoMAoA4eZD8wyDBKGBwAMAikDfOKGDwAmEgcmIhiGAwAAAIKg24ApI4eZKgwiKQN88kYIAAAAIqDcJ5kKDBIpAy0IBgQAAACCoN188oeZBgwSKQMioNsd8AAA", $ec3de3bad43fb783$var$wi = 1077379072, $ec3de3bad43fb783$var$ci = "ZCvKP8qNN0CvjjdAcJM3QDqPN0DPjjdAOo83QJmPN0BmkDdA2ZA3QIGQN0BVjTdA/I83QFiQN0C8jzdA+5A3QOaPN0D7kDdAnY43QPqON0A6jzdAmY83QLWON0CWjTdAvJE3QDaTN0ByjDdAVpM3QHKMN0ByjDdAcow3QHKMN0ByjDdAcow3QHKMN0ByjDdAVpE3QHKMN0BRkjdANpM3QAQInwAAAAAAAAAYAQQIBQAAAAAAAAAIAQQIBgAAAAAAAAAAAQQIIQAAAAAAIAAAEQQI3AAAAAAAIAAAEQQIDAAAAAAAIAAAAQQIEgAAAAAAIAAAESAoDAAQAQAA", $ec3de3bad43fb783$var$Ci = 1070279668; +var $ec3de3bad43fb783$var$Ii = Object.freeze({ + __proto__: null, + ESP32S3ROM: class extends $ec3de3bad43fb783$export$c643cc54d6326a6f { + constructor(){ + super(...arguments), this.CHIP_NAME = "ESP32-S3", this.IMAGE_CHIP_ID = 9, this.EFUSE_BASE = 1610641408, this.MAC_EFUSE_REG = this.EFUSE_BASE + 68, this.UART_CLKDIV_REG = 1610612756, this.UART_CLKDIV_MASK = 1048575, this.UART_DATE_REG_ADDR = 1610612864, this.FLASH_WRITE_SIZE = 1024, this.BOOTLOADER_FLASH_OFFSET = 0, this.FLASH_SIZES = { + "1MB": 0, + "2MB": 16, + "4MB": 32, + "8MB": 48, + "16MB": 64 + }, this.SPI_REG_BASE = 1610620928, this.SPI_USR_OFFS = 24, this.SPI_USR1_OFFS = 28, this.SPI_USR2_OFFS = 32, this.SPI_MOSI_DLEN_OFFS = 36, this.SPI_MISO_DLEN_OFFS = 40, this.SPI_W0_OFFS = 88, this.USB_RAM_BLOCK = 2048, this.UARTDEV_BUF_NO_USB = 3, this.UARTDEV_BUF_NO = 1070526796, this.TEXT_START = $ec3de3bad43fb783$var$wi, this.ENTRY = $ec3de3bad43fb783$var$oi, this.DATA_START = $ec3de3bad43fb783$var$Ci, this.ROM_DATA = $ec3de3bad43fb783$var$ci, this.ROM_TEXT = $ec3de3bad43fb783$var$Bi; + } + async getChipDescription(A) { + return "ESP32-S3"; + } + async getFlashCap(A) { + const t = this.EFUSE_BASE + 68 + 12; + return await A.readReg(t) >> 27 & 7; + } + async getFlashVendor(A) { + const t = this.EFUSE_BASE + 68 + 16; + return ({ + 1: "XMC", + 2: "GD", + 3: "FM", + 4: "TT", + 5: "BY" + })[await A.readReg(t) >> 0 & 7] || ""; + } + async getPsramCap(A) { + const t = this.EFUSE_BASE + 68 + 16; + return await A.readReg(t) >> 3 & 3; + } + async getPsramVendor(A) { + const t = this.EFUSE_BASE + 68 + 16; + return ({ + 1: "AP_3v3", + 2: "AP_1v8" + })[await A.readReg(t) >> 7 & 3] || ""; + } + async getChipFeatures(A) { + const t = [ + "Wi-Fi", + "BLE" + ], e = await this.getFlashCap(A), i = await this.getFlashVendor(A), s = { + 0: null, + 1: "Embedded Flash 8MB", + 2: "Embedded Flash 4MB" + }[e], a = void 0 !== s ? s : "Unknown Embedded Flash"; + null !== s && t.push(`${a} (${i})`); + const n = await this.getPsramCap(A), E = await this.getPsramVendor(A), h = { + 0: null, + 1: "Embedded PSRAM 8MB", + 2: "Embedded PSRAM 2MB" + }[n], r = void 0 !== h ? h : "Unknown Embedded PSRAM"; + return null !== h && t.push(`${r} (${E})`), t; + } + async getCrystalFreq(A) { + return 40; + } + _d2h(A) { + const t = (+A).toString(16); + return 1 === t.length ? "0" + t : t; + } + async postConnect(A) { + const t = 255 & await A.readReg(this.UARTDEV_BUF_NO); + A.debug("In _post_connect " + t), t == this.UARTDEV_BUF_NO_USB && (A.ESP_RAM_BLOCK = this.USB_RAM_BLOCK); + } + async readMac(A) { + let t = await A.readReg(this.MAC_EFUSE_REG); + t >>>= 0; + let e = await A.readReg(this.MAC_EFUSE_REG + 4); + e = e >>> 0 & 65535; + const i = new Uint8Array(6); + return i[0] = e >> 8 & 255, i[1] = 255 & e, i[2] = t >> 24 & 255, i[3] = t >> 16 & 255, i[4] = t >> 8 & 255, i[5] = 255 & t, this._d2h(i[0]) + ":" + this._d2h(i[1]) + ":" + this._d2h(i[2]) + ":" + this._d2h(i[3]) + ":" + this._d2h(i[4]) + ":" + this._d2h(i[5]); + } + getEraseSize(A, t) { + return t; + } + } +}), $ec3de3bad43fb783$var$_i = 1073907696, $ec3de3bad43fb783$var$li = "CAAAYBwAAGBIAP0/EAAAYDZBACH7/8AgADgCQfr/wCAAKAQgIJSc4kH4/0YEAAw4MIgBwCAAqAiIBKCgdOAIAAsiZgLohvT/IfH/wCAAOQId8AAA7Cv+P2Sr/T+EgAAAQEAAAKTr/T/wK/4/NkEAsfn/IKB0EBEgZQEBlhoGgfb/kqEBkJkRmpjAIAC4CZHz/6CgdJqIwCAAkhgAkJD0G8nAwPTAIADCWACam8AgAKJJAMAgAJIYAIHq/5CQ9ICA9IeZR4Hl/5KhAZCZEZqYwCAAyAmh5f+x4/+HnBfGAQB86Ica3sYIAMAgAIkKwCAAuQlGAgDAIAC5CsAgAIkJkdf/mogMCcAgAJJYAB3wAABUIEA/VDBAPzZBAJH9/8AgAIgJgIAkVkj/kfr/wCAAiAmAgCRWSP8d8AAAACwgQD8AIEA/AAAACDZBABARIKX8/yH6/wwIwCAAgmIAkfr/gfj/wCAAkmgAwCAAmAhWef/AIACIAnzygCIwICAEHfAAAAAAQDZBABARIOX7/xZq/4Hs/5H7/8AgAJJoAMAgAJgIVnn/HfAAAFgA/T////8ABCBAPzZBACH8/zhCFoMGEBEgZfj/FvoFDPgMBDeoDZgigJkQgqABkEiDQEB0EBEgJfr/EBEgJfP/iCIMG0CYEZCrAcwUgKsBse3/sJkQsez/wCAAkmsAkc7/wCAAomkAwCAAqAlWev8cCQwaQJqDkDPAmog5QokiHfAAAHDi+j8IIEA/hGIBQKRiAUA2YQAQESBl7f8x+f+9Aa0Dgfr/4AgATQoMEuzqiAGSogCQiBCJARARIOXx/5Hy/6CiAcAgAIgJoIggwCAAiQm4Aa0Dge7/4AgAoCSDHfAAAP8PAAA2QQCBxf8MGZJIADCcQZkokfv/ORgpODAwtJoiKjMwPEEMAilYOUgQESAl+P8tCowaIqDFHfAAAMxxAUA2QQBBtv9YNFAzYxZjBFgUWlNQXEFGAQAQESDl7P+IRKYYBIgkh6XvEBEgJeX/Fmr/qBTNA70CgfH/4AgAoKB0jEpSoMRSZAVYFDpVWRRYNDBVwFk0HfAA+Pz/P0QA/T9MAP0/ADIBQOwxAUAwMwFANmEAfMitAoeTLTH3/8YFAKgDDBwQsSCB9//gCACBK/+iAQCICOAIAKgDgfP/4AgA5hrcxgoAAABmAyYMA80BDCsyYQCB7v/gCACYAYHo/zeZDagIZhoIMeb/wCAAokMAmQgd8EAA/T8AAP0/jDEBQDZBACH8/4Hc/8gCqAix+v+B+//gCAAMCIkCHfBgLwFANkEAgf7/4AgAggoYDAmCyP4MEoApkx3w+Cv+P/Qr/j8YAEw/jABMP//z//82QQAQESDl/P8WWgSh+P+ICrzYgff/mAi8abH2/3zMwCAAiAuQkBTAiBCQiCDAIACJC4gKsfH/DDpgqhHAIACYC6CIEKHu/6CZEJCIIMAgAIkLHfAoKwFANkEAEBEgZff/vBqR0f+ICRuoqQmR0P8MCoqZIkkAgsjBDBmAqYOggHTMiqKvQKoiIJiTjPkQESAl8v/GAQCtAoHv/+AIAB3wNkEAoqDAEBEg5fr/HfAAADZBAIKgwK0Ch5IRoqDbEBEgZfn/oqDcRgQAAAAAgqDbh5IIEBEgJfj/oqDdEBEgpff/HfA2QQA6MsYCAKICACLCARARIKX7/zeS8B3wAAAAbFIAQIxyAUCMUgBADFMAQDYhIaLREIH6/+AIAEYLAAAADBRARBFAQ2PNBL0BrQKB9f/gCACgoHT8Ws0EELEgotEQgfH/4AgASiJAM8BWA/0iogsQIrAgoiCy0RCB7P/gCACtAhwLEBEgpff/LQOGAAAioGMd8AAAQCsBQDZBABARICXl/4y6gYj/iAiMSBARICXi/wwKgfj/4AgAHfAAAIQyAUC08QBAkDIBQMDxAEA2QQAQESDl4f+smjFc/4ziqAOB9//gCACiogDGBgAAAKKiAIH0/+AIAKgDgfP/4AgARgUAAAAsCoyCgfD/4AgAhgEAAIHs/+AIAB3w8CsBQDZBIWKhB8BmERpmWQYMBWLREK0FUmYaEBEgZfn/DBhAiBFHuAJGRACtBoG1/+AIAIYzAACSpB1Qc8DgmREamUB3Y4kJzQe9ASCiIIGu/+AIAJKkHeCZERqZoKB0iAmMigwIgmYWfQiGFQCSpB3gmREamYkJEBEgpeL/vQetARARICXm/xARIKXh/80HELEgYKYggZ3/4AgAkqQd4JkRGpmICXAigHBVgDe1tJKhB8CZERqZmAmAdcCXtwJG3f+G5/8MCIJGbKKkGxCqoIHM/+AIAFYK/7KiC6IGbBC7sBARIGWbAPfqEvZHD7KiDRC7sHq7oksAG3eG8f9867eawWZHCIImGje4Aoe1nCKiCxAisGC2IK0CgX3/4AgAEBEgJdj/rQIcCxARIKXb/xARICXX/wwaEBEgpef/HfAAAP0/T0hBSfwr/j9sgAJASDwBQDyDAkAIAAhgEIACQAwAAGA4QEA///8AACiBQD+MgAAAEEAAAAAs/j8QLP4/UAD9P1QA/T9cLP4/FAAAYPD//wD8K/4/ZCv9P3AA/T9c8gBAiNgAQNDxAECk8QBA1DIBQFgyAUCg5ABABHABQAB1AUCASQFA6DUBQOw7AUCAAAFAmCABQOxwAUBscQFADHEBQIQpAUB4dgFA4HcBQJR2AUAAMABAaAABQDbBACHR/wwKKaGB5v/gCAAQESClvP8W6gQx+P5B9/7AIAAoA1H3/ikEwCAAKAVh8f6ioGQpBmHz/mAiEGKkAGAiIMAgACkFgdj/4AgASAR8wkAiEAwkQCIgwCAAKQOGAQBJAksixgEAIbf/Mbj/DAQ3Mu0QESAlw/8MS6LBKBARIKXG/yKhARARIOXB/0H2/ZAiESokwCAASQIxrf8h3v0yYgAQESBls/8WOgYhov7Bov6oAgwrgaT+4AgADJw8CwwKgbr/4AgAsaP/DAwMmoG4/+AIAKKiAIE3/+AIALGe/6gCUqABgbP/4AgAqAKBLv/gCACoAoGw/+AIADGY/8AgACgDUCIgwCAAKQMGCgAAsZT/zQoMWoGm/+AIADGR/1KhAcAgACgDLApQIiDAIAApA4Eg/+AIAIGh/+AIACGK/8AgACgCzLocwzAiECLC+AwTIKODDAuBmv/gCADxg/8MHQwcsqAB4qEAQN0RAMwRgLsBoqAAgZP/4AgAIX7/KkQhDf5i0itGFwAAAFFs/sAgADIFADAwdBbDBKKiAMAgACJFAIEC/+AIAKKiccCqEYF+/+AIAIGE/+AIAHFt/3zowCAAOAd8+oAzEBCqAcAgADkHgX7/4AgAgX3/4AgAIKIggXz/4AgAwCAAKAQWsvkMB8AgADgEDBLAIAB5BCJBHCIDAQwoeYEiQR2CUQ8cN3cSIhxHdxIjZpIlIgMDcgMCgCIRcCIgZkIWKCPAIAAoAimBhgIAHCKGAAAADMIiUQ8QESAlpv8Mi6LBHBARIOWp/7IDAyIDAoC7ESBbICFG/yAg9FeyHKKgwBARIKWk/6Kg7hARICWk/xARIKWi/0bZ/wAAIgMBHEcnNzf2IhlG4QAiwi8gIHS2QgKGJQBxN/9wIqAoAqACACLC/iAgdBwnJ7cCBtgAcTL/cCKgKAKgAgAAAHLCMHBwdLZXxMbRACxJDAcioMCXFQLGzwB5gQxyrQcQESAlnf+tBxARIKWc/xARICWb/xARIOWa/7KgCKLBHCLC/xARICWe/1YS/cYtAAwSVqUvwsEQvQWtBYEu/+AIAFaqLgzLosEQEBEg5Zv/hpgADBJWdS2BKP/gCACgJYPGsgAmhQQMEsawACgjeDNwgiCAgLRW2P4QESDlbv96IpwKBvj/oKxBgR3/4AgAVkr9ctfwcKLAzCcGhgAAoID0Vhj+hgMAoKD1gRb/4AgAVjr7UHfADBUAVRFwosB3NeWGAwCgrEGBDf/gCABWavly1/BwosBWp/5GdgAADAcioMAmhQKGlAAMBy0HxpIAJrX1hmgADBImtQKGjAC4M6IjAnKgABARIOWS/6Ang4aHAAwZZrVciEMgqREMByKgwoe6AgaFALhToiMCkmENEBEg5Wj/mNGgl4OGDQAMGWa1MYhDIKkRDAcioMKHugJGegAoM7hTqCMgeIKZ0RARIOVl/yFd/QwImNGJYiLSK3kioJiDLQnGbQCRV/0MB6IJACKgxneaAkZsAHgjssXwIqDAt5cBKFkMB5Kg70YCAHqDgggYG3eAmTC3J/KCAwVyAwSAiBFwiCByAwYAdxGAdyCCAweAiAFwiCCAmcCCoMEMB5Aok8ZYAIE//SKgxpIIAH0JFlkVmDgMByKgyHcZAgZSAChYkkgARk0AHIkMBwwSlxUCBk0A+HPoY9hTyEO4M6gjgbT+4AgADAh9CqAogwZGAAAADBImRQLGQACoIwwLgav+4AgABh8AUJA0DAcioMB3GQLGPABQVEGLw3z4hg4AAKg8ieGZ0cnBgZv+4AgAyMGI4SgseByoDJIhDXByECYCDsAgANIqACAoMNAiECB3IMAgAHkKG5nCzBBXOcJGlf9mRQLGk/8MByKgwIYmAAwSJrUCxiEAIX7+iFN4I4kCIX3+eQIMAgYdAKF5/gwH2AoMGbLF8I0HLQfQKYOwiZMgiBAioMZ3mGDBc/59COgMIqDJtz5TsPAUIqDAVq8ELQiGAgAAKoOIaEsiiQeNCSD+wCp9tzLtFsjd+Qx5CkZ1/wAMEmaFFyFj/ogCjBiCoMgMB3kCIV/+eQIMEoAngwwHRgEAAAwHIqD/IKB0EBEgZWn/cKB0EBEgpWj/EBEgZWf/VvK6IgMBHCcnNx/2MgJG6P4iwv0gIHQM9ye3Asbk/nFO/nAioCgCoAIAAHKg0ncSX3Kg1HeSAgYhAEbd/gAAKDM4IxARICVW/40KVkq2oqJxwKoRieGBR/7gCABxP/6RQP7AIAB4B4jhcLQ1wHcRkHcQcLsgILuCrQgwu8KBTf7gCACio+iBO/7gCADGyP4AANhTyEO4M6gjEBEgZXP/BsT+sgMDIgMCgLsRILsgssvwosMYEBEg5T7/Rr3+AAAiAwNyAwKAIhFwIiCBO/7gCABxrPwiwvCIN4AiYxYyrYgXioKAjEGGAgCJ4RARICUq/4IhDpInBKYZBJgnl6jpEBEgJSL/Fmr/qBfNArLDGIEr/uAIAIw6MqDEOVc4FyozORc4NyAjwCk3gSX+4AgABqD+AAByAwIiwxgyAwMMGYAzEXAzIDLD8AYiAHEG/oE5/OgHOZHgiMCJQYgmDBmHswEMOZJhDeJhDBARICUi/4H+/ZjR6MGh/f3dCL0CmQHCwSTywRCJ4YEP/uAIALgmnQqokYjhoLvAuSagM8C4B6oiqEEMDKq7DBq5B5DKg4C7wMDQdFZ8AMLbgMCtk5w6rQiCYQ6SYQ0QESDlLf+I4ZjRgmcAUWv8eDWMo5CPMZCIwNYoAFY39tapADFm/CKgxylTRgAAjDmcB4Zt/hY3m1Fh/CKgyClVBmr+ADFe/CKgySlTBmf+AAAoI1ZSmRARIOVS/6KiccCqEYHS/eAIABARICU6/4Hk/eAIAAZd/gAAKDMW0pYQESBlUP+io+iByf3gCAAQESClN//gAgCGVP4AEBEg5Tb/HfAAADZBAJ0CgqDAKAOHmQ/MMgwShgcADAIpA3zihg8AJhIHJiIYhgMAAACCoNuAKSOHmSoMIikDfPJGCAAAACKg3CeZCgwSKQMtCAYEAAAAgqDdfPKHmQYMEikDIqDbHfAAAA==", $ec3de3bad43fb783$var$di = 1073905664, $ec3de3bad43fb783$var$Mi = "ZCv9PzaLAkDBiwJAhpACQEqMAkDjiwJASowCQKmMAkByjQJA5Y0CQI2NAkDAigJAC40CQGSNAkDMjAJACI4CQPaMAkAIjgJAr4sCQA6MAkBKjAJAqYwCQMeLAkACiwJAx44CQD2QAkDYiQJAZZACQNiJAkDYiQJA2IkCQNiJAkDYiQJA2IkCQNiJAkDYiQJAZI4CQNiJAkBZjwJAPZACQA==", $ec3de3bad43fb783$var$Di = 1073622012; +var $ec3de3bad43fb783$var$Ri = Object.freeze({ + __proto__: null, + ESP32S2ROM: class extends $ec3de3bad43fb783$export$c643cc54d6326a6f { + constructor(){ + super(...arguments), this.CHIP_NAME = "ESP32-S2", this.IMAGE_CHIP_ID = 2, this.MAC_EFUSE_REG = 1061265476, this.EFUSE_BASE = 1061265408, this.UART_CLKDIV_REG = 1061158932, this.UART_CLKDIV_MASK = 1048575, this.UART_DATE_REG_ADDR = 1610612856, this.FLASH_WRITE_SIZE = 1024, this.BOOTLOADER_FLASH_OFFSET = 4096, this.FLASH_SIZES = { + "1MB": 0, + "2MB": 16, + "4MB": 32, + "8MB": 48, + "16MB": 64 + }, this.SPI_REG_BASE = 1061167104, this.SPI_USR_OFFS = 24, this.SPI_USR1_OFFS = 28, this.SPI_USR2_OFFS = 32, this.SPI_W0_OFFS = 88, this.SPI_MOSI_DLEN_OFFS = 36, this.SPI_MISO_DLEN_OFFS = 40, this.TEXT_START = $ec3de3bad43fb783$var$di, this.ENTRY = $ec3de3bad43fb783$var$_i, this.DATA_START = $ec3de3bad43fb783$var$Di, this.ROM_DATA = $ec3de3bad43fb783$var$Mi, this.ROM_TEXT = $ec3de3bad43fb783$var$li; + } + async getPkgVersion(A) { + const t = this.EFUSE_BASE + 68 + 12; + return await A.readReg(t) >> 21 & 15; + } + async getChipDescription(A) { + const t = [ + "ESP32-S2", + "ESP32-S2FH16", + "ESP32-S2FH32" + ], e = await this.getPkgVersion(A); + return e >= 0 && e <= 2 ? t[e] : "unknown ESP32-S2"; + } + async getFlashCap(A) { + const t = this.EFUSE_BASE + 68 + 12; + return await A.readReg(t) >> 21 & 15; + } + async getPsramCap(A) { + const t = this.EFUSE_BASE + 68 + 12; + return await A.readReg(t) >> 28 & 15; + } + async getBlock2Version(A) { + const t = this.EFUSE_BASE + 92 + 16; + return await A.readReg(t) >> 4 & 7; + } + async getChipFeatures(A) { + const t = [ + "Wi-Fi" + ], e = { + 0: "No Embedded Flash", + 1: "Embedded Flash 2MB", + 2: "Embedded Flash 4MB" + }[await this.getFlashCap(A)] || "Unknown Embedded Flash"; + t.push(e); + const i = { + 0: "No Embedded Flash", + 1: "Embedded PSRAM 2MB", + 2: "Embedded PSRAM 4MB" + }[await this.getPsramCap(A)] || "Unknown Embedded PSRAM"; + t.push(i); + const s = { + 0: "No calibration in BLK2 of efuse", + 1: "ADC and temperature sensor calibration in BLK2 of efuse V1", + 2: "ADC and temperature sensor calibration in BLK2 of efuse V2" + }[await this.getBlock2Version(A)] || "Unknown Calibration in BLK2"; + return t.push(s), t; + } + async getCrystalFreq(A) { + return 40; + } + _d2h(A) { + const t = (+A).toString(16); + return 1 === t.length ? "0" + t : t; + } + async readMac(A) { + let t = await A.readReg(this.MAC_EFUSE_REG); + t >>>= 0; + let e = await A.readReg(this.MAC_EFUSE_REG + 4); + e = e >>> 0 & 65535; + const i = new Uint8Array(6); + return i[0] = e >> 8 & 255, i[1] = 255 & e, i[2] = t >> 24 & 255, i[3] = t >> 16 & 255, i[4] = t >> 8 & 255, i[5] = 255 & t, this._d2h(i[0]) + ":" + this._d2h(i[1]) + ":" + this._d2h(i[2]) + ":" + this._d2h(i[3]) + ":" + this._d2h(i[4]) + ":" + this._d2h(i[5]); + } + getEraseSize(A, t) { + return t; + } + } +}), $ec3de3bad43fb783$var$Si = 1074843652, $ec3de3bad43fb783$var$Qi = "qBAAQAH//0Z0AAAAkIH/PwgB/z+AgAAAhIAAAEBAAABIQf8/lIH/PzH5/xLB8CAgdAJhA4XvATKv/pZyA1H0/0H2/zH0/yAgdDA1gEpVwCAAaANCFQBAMPQbQ0BA9MAgAEJVADo2wCAAIkMAIhUAMev/ICD0N5I/Ieb/Meb/Qen/OjLAIABoA1Hm/yeWEoYAAAAAAMAgACkEwCAAWQNGAgDAIABZBMAgACkDMdv/OiIMA8AgADJSAAgxEsEQDfAAoA0AAJiB/z8Agf4/T0hBSais/z+krP8/KNAQQEzqEEAMAABg//8AAAAQAAAAAAEAAAAAAYyAAAAQQAAAAAD//wBAAAAAgf4/BIH+PxAnAAAUAABg//8PAKis/z8Igf4/uKz/PwCAAAA4KQAAkI//PwiD/z8Qg/8/rKz/P5yv/z8wnf8/iK//P5gbAAAACAAAYAkAAFAOAABQEgAAPCkAALCs/z+0rP8/1Kr/PzspAADwgf8/DK//P5Cu/z+ACwAAEK7/P5Ct/z8BAAAAAAAAALAVAADx/wAAmKz/P5iq/z+8DwBAiA8AQKgPAEBYPwBAREYAQCxMAEB4SABAAEoAQLRJAEDMLgBA2DkAQEjfAECQ4QBATCYAQIRJAEAhvP+SoRCQEcAiYSMioAACYUPCYULSYUHiYUDyYT8B6f/AAAAhsv8xs/8MBAYBAABJAksiNzL4hbUBIqCMDEMqIcWnAYW0ASF8/8F6/zGr/yoswCAAyQIhqP8MBDkCMaj/DFIB2f/AAAAxpv8ioQHAIABIAyAkIMAgACkDIqAgAdP/wAAAAdL/wAAAAdL/wAAAcZ3/UZ7/QZ7/MZ7/YqEADAIBzf/AAAAhnP8xYv8qI8AgADgCFnP/wCAA2AIMA8AgADkCDBIiQYQiDQEMJCJBhUJRQzJhIiaSCRwzNxIghggAAAAiDQMyDQKAIhEwIiBmQhEoLcAgACgCImEiBgEAHCIiUUOFqAEioIQMgxoiBZsBIg0DMg0CgCIRMDIgIX//N7ITIqDAxZUBIqDuRZUBxaUBRtz/AAAiDQEMtEeSAgaZACc0Q2ZiAsbLAPZyIGYyAoZxAPZCCGYiAsZWAEbKAGZCAgaHAGZSAsarAIbGACaCefaCAoarAAyUR5ICho8AZpICBqMABsAAHCRHkgJGfAAnNCcM9EeSAoY+ACc0CwzUR5IChoMAxrcAAGayAkZLABwUR5ICRlgARrMAQqDRRxJoJzQRHDRHkgJGOABCoNBHEk/GrAAAQqDSR5IChi8AMqDTN5ICRpcFRqcALEIMDieTAgZqBUYrACKgAEWIASKgAAWIAYWYAUWYASKghDKgCBoiC8yFigFW3P0MDs0ORpsAAMwThl8FRpUAJoMCxpMABmAFAWn/wAAA+sycIsaPAAAAICxBAWb/wAAAVhIj8t/w8CzAzC+GaQUAIDD0VhP+4Sv/hgMAICD1AV7/wAAAVtIg4P/A8CzA9z7qhgMAICxBAVf/wAAAVlIf8t/w8CzAVq/+RloFJoOAxgEAAABmswJG3f8MDsKgwIZ4AAAAZrMCRkQFBnIAAMKgASazAgZwACItBDEX/+KgAMKgwiezAsZuADhdKC1FdgFGPAUAwqABJrMChmYAMi0EIQ7/4qAAwqDCN7ICRmUAKD0MHCDjgjhdKC2FcwEx9/4MBEljMtMr6SMgxIMGWgAAIfP+DA5CAgDCoMbnlALGWADIUigtMsPwMCLAQqDAIMSTIs0YTQJioO/GAQBSBAAbRFBmMCBUwDcl8TINBVINBCINBoAzEQAiEVBDIEAyICINBwwOgCIBMCIgICbAMqDBIMOThkMAAAAh2f4MDjICAMKgxueTAsY+ADgywqDI5xMCBjwA4kIAyFIGOgAcggwODBwnEwIGNwAGCQVmQwKGDwVGMAAwIDQMDsKgwOcSAoYwADD0QYvtzQJ888YMACg+MmExAQL/wAAASC4oHmIuACAkEDIhMSYEDsAgAFImAEBDMFBEEEAiIMAgACkGG8zizhD3PMjGgf9mQwJGgP8Gov9mswIG+QTGFgAAAGHA/gwOSAYMFTLD8C0OQCWDMF6DUCIQwqDG55JLcbn+7QKIB8KgyTc4PjBQFMKgwKLNGIzVBgwAWiooAktVKQRLRAwSUJjANzXtFmLaSQaZB8Zn/2aDAoblBAwcDA7GAQAAAOKgAMKg/8AgdMVeAeAgdIVeAQVvAVZMwCINAQzzNxIxJzMVZkICxq4EZmIChrMEJjICxvn+BhkAABwjN5ICxqgEMqDSNxJFHBM3EgJG8/5GGQAhlP7oPdItAgHA/sAAACGS/sAgADgCIZH+ICMQ4CKC0D0gxYoBPQItDAG5/sAAACKj6AG2/sAAAMbj/lhdSE04PSItAoVqAQbg/gAyDQMiDQKAMxEgMyAyw/AizRgFSQHG2f4AAABSzRhSYSQiDQMyDQKAIhEwIiAiwvAiYSoMH4Z0BCF3/nGW/rIiAGEy/oKgAyInApIhKoJhJ7DGwCc5BAwaomEnsmE2hTkBsiE2cW3+UiEkYiEqcEvAykRqVQuEUmElgmEshwQCxk0Ed7sCRkwEmO2iLRBSLRUobZJhKKJhJlJhKTxTyH3iLRT4/SezAkbuAzFc/jAioCgCoAIAMUL+DA4MEumT6YMp0ymj4mEm/Q7iYSjNDkYGAHIhJwwTcGEEfMRgQ5NtBDliXQtyISQG4AMAgiEkkiElITP+l7jZMggAG3g5goYGAKIhJwwjMGoQfMUMFGBFg20EOWJdC0bUA3IhJFIhJSEo/le321IHAPiCWZKALxEc81oiQmExUmE0smE2G9cFeQEME0IhMVIhNLIhNlYSASKgICBVEFaFAPAgNCLC+CA1g/D0QYv/DBJhLv4AH0AAUqFXNg8AD0BA8JEMBvBigzBmIJxGDB8GAQAAANIhJCEM/ixDOWJdCwabAF0Ltjwehg4AciEnfMNwYQQMEmAjg20CDDOGFQBdC9IhJEYAAP0GgiElh73bG90LLSICAAAcQAAioYvMIO4gtjzkbQ9x+P3gICQptyAhQSnH4ONBwsz9VuIfwCAkJzwoRhEAkiEnfMOQYQQMEmAjg20CDFMh7P05Yn0NxpQDAAAAXQvSISRGAAD9BqIhJae90RvdCy0iAgAAHEAAIqGLzCDuIMAgJCc84cAgJAACQODgkSKv+CDMEPKgABacBoYMAAAAciEnfMNwYQQMEmAjg20CDGMG5//SISRdC4IhJYe94BvdCy0iAgAAHEAAIqEg7iCLzLaM5CHM/cLM+PoyIeP9KiPiQgDg6EGGDAAAAJIhJwwTkGEEfMRgNINtAwxzxtT/0iEkXQuiISUhv/2nvd1B1v0yDQD6IkoiMkIAG90b//ZPAobc/yHt/Xz28hIcIhIdIGYwYGD0Z58Hxh0A0iEkXQssc8Y/ALaMIAYPAHIhJ3zDcGEEDBJgI4NtAjwzBrz/AABdC9IhJEYAAP0GgiElh73ZG90LLSICAAAcQAAioYvMIO4gtozkbQ/gkHSSYSjg6EHCzPj9BkYCADxDhtQC0iEkXQsha/0nte+iISgLb6JFABtVFoYHVrz4hhwADJPGywJdC9IhJEYAAP0GIWH9J7XqhgYAciEnfMNwYQQMEmAjg20CLGPGmf8AANIhJF0LgiElh73ekVb90GjAUCnAZ7IBbQJnvwFtD00G0D0gUCUgUmE0YmE1smE2Abz9wAAAYiE1UiE0siE2at1qVWBvwFZm+UbQAv0GJjIIxgQAANIhJF0LDKMhb/05Yn0NBhcDAAAMDyYSAkYgACKhICJnESwEIYL9QmcSMqAFUmE0YmE1cmEzsmE2Aab9wAAAciEzsiE2YiE1UiE0PQcioJBCoAhCQ1gLIhszVlL/IqBwDJMyR+gLIht3VlL/HJRyoViRVf0MeEYCAAB6IpoigkIALQMbMkeT8SFq/TFq/QyEBgEAQkIAGyI3kvdGYQEhZ/36IiICACc8HUYPAAAAoiEnfMOgYQQMEmAjg20CDLMGVP/SISRdCyFc/foiYiElZ73bG90LPTIDAAAcQAAzoTDuIDICAIvMNzzhIVT9QVT9+iIyAgAMEgATQAAioUBPoAsi4CIQMMzAAANA4OCRSAQxLf0qJDA/oCJjERv/9j8Cht7/IUf9QqEgDANSYTSyYTYBaP3AAAB9DQwPUiE0siE2RhUAAACCISd8w4BhBAwSYCODbQIM4wa0AnIhJF0LkiEll7fgG3cLJyICAAAcQAAioSDuIIvMtjzkITP9QRL9+iIiAgDgMCQqRCEw/cLM/SokMkIA4ONBG/8hC/0yIhM3P9McMzJiE90HbQ8GHQEATAQyoAAiwURSYTRiYTWyYTZyYTMBQ/3AAAByITOB/fwioWCAh4JBHv0qKPoiDAMiwhiCYTIBO/3AAACCITIhGf1CpIAqKPoiDAMiwhgBNf3AAACoz4IhMvAqoCIiEYr/omEtImEuTQ9SITRiITVyITOyITbGAwAiD1gb/xAioDIiERszMmIRMiEuQC/ANzLmDAIpESkBrQIME+BDEZLBREr5mA9KQSop8CIRGzMpFJqqZrPlMeb8OiKMEvYqKyHW/EKm0EBHgoLIWCqIIqC8KiSCYSsMCXzzQmE5ImEwxkMAAF0L0iEkRgAA/QYsM8aZAACiISuCCgCCYTcWiA4QKKB4Ahv3+QL9CAwC8CIRImE4QiE4cCAEImEvC/9AIiBwcUFWX/4Mp4c3O3B4EZB3IAB3EXBwMUIhMHJhLwwacbb8ABhAAKqhKoRwiJDw+hFyo/+GAgAAQiEvqiJCWAD6iCe38gYgAHIhOSCAlIqHoqCwQan8qohAiJBymAzMZzJYDH0DMsP+IClBoaP88qSwxgoAIIAEgIfAQiE5fPeAhzCKhPCIgKCIkHKYDMx3MlgMMHMgMsP+giE3C4iCYTdCITcMuCAhQYeUyCAgBCB3wHz6IiE5cHowenIipLAqdyGO/CB3kJJXDEIhKxuZG0RCYStyIS6XFwLGvf+CIS0mKALGmQBGggAM4seyAsYwAJIhJdApwKYiAoYlACGj/OAwlEF9/CojQCKQIhIMADIRMCAxlvIAMCkxFjIFJzwCRiQAhhIAAAyjx7NEkZj8fPgAA0DgYJFgYAQgKDAqJpoiQCKQIpIMG3PWggYrYz0HZ7zdhgYAoiEnfMOgYQQMEmAjg20CHAPGdv4AANIhJF0LYiElZ73eIg0AGz0AHEAAIqEg7iCLzAzi3QPHMgLG2v8GCAAiDQEyzAgAE0AAMqEiDQDSzQIAHEAAIqEgIyAg7iDCzBAhdfzgMJRhT/wqI2AikDISDAAzETAgMZaiADA5MSAghEYJAAAAgWz8DKR89xs0AARA4ECRQEAEICcwKiSKImAikCKSDE0DliL+AANA4OCRMMzAImEoDPMnIxUhOvxyISj6MiFe/Bv/KiNyQgAGNAAAgiEoZrga3H8cCZJhKAYBANIhJF0LHBMhL/x89jliBkH+MVP8KiMiwvAiAgAiYSYnPB0GDgCiISd8w6BhBAwSYCODbQIcI8Y1/gAA0iEkXQtiISVnvd4b3QstIgIAciEmABxAACKhi8wg7iB3POGCISYxQPySISgMFgAYQABmoZozC2Yyw/DgJhBiAwAACEDg4JEqZiE5/IDMwCovDANmuQwxDPz6QzE1/Do0MgMATQZSYTRiYTWyYTYBSfzAAABiITVSITRq/7IhNoYAAAAMD3EB/EInEWInEmpkZ78Chnj/95YHhgIA0iEkXQscU0bJ/wDxIfwhIvw9D1JhNGJhNbJhNnJhMwE1/MAAAHIhMyEL/DInEUInEjo/ATD8wAAAsiE2YiE1UiE0Mer7KMMLIinD8ej7eM/WN7iGPgFiISUM4tA2wKZDDkG2+1A0wKYjAkZNAMYyAseyAoYuAKYjAkYlAEHc++AglEAikCISvAAyETAgMZYSATApMRZSBSc8AsYkAAYTAAAAAAyjx7NEfPiSpLAAA0DgYJFgYAQgKDAqJpoiQCKQIpIMG3PWggYrYz0HZ7zdhgYAciEnfMNwYQQMEmAjg20CHHPG1P0AANIhJF0LgiElh73eIg0AGz0AHEAAIqEg7iCLzAzi3QPHMgKG2/8GCAAAACINAYs8ABNAADKhIg0AK90AHEAAIqEgIyAg7iDCzBBBr/vgIJRAIpAiErwAIhEg8DGWjwAgKTHw8ITGCAAMo3z3YqSwGyMAA0DgMJEwMATw9zD682r/QP+Q8p8MPQKWL/4AAkDg4JEgzMAioP/3ogLGQACGAgAAHIMG0wDSISRdCyFp+ye17/JFAG0PG1VG6wAM4scyGTINASINAIAzESAjIAAcQAAioSDuICvdwswQMYr74CCUqiIwIpAiEgwAIhEgMDEgKTHWEwIMpBskAARA4ECRQEAEMDkwOjRBf/uKM0AzkDKTDE0ClvP9/QMAAkDg4JEgzMB3g3xioA7HNhpCDQEiDQCARBEgJCAAHEAAIqEg7iDSzQLCzBBBcPvgIJSqIkAikEISDABEEUAgMUBJMdYSAgymG0YABkDgYJFgYAQgKTAqJmFl+4oiYCKQIpIMbQSW8v0yRQAABEDg4JFAzMB3AggbVf0CRgIAAAAiRQErVQZz//BghGb2AoazACKu/ypmIYH74GYRaiIoAiJhJiF/+3IhJmpi+AYWhwV3PBzGDQCCISd8w4BhBAwSYCODbQIck4Zb/QDSISRdC5IhJZe93xvdCy0iAgCiISYAHEAAIqGLzCDuIKc84WIhJgwSABZAACKhCyLgIhBgzMAABkDg4JEq/wzix7IChjAAciEl0CfApiICxiUAQTP74CCUQCKQItIPIhIMADIRMCAxlgIBMCkxFkIFJzwChiQAxhIAAAAMo8ezRJFW+3z4AANA4GCRYGAEICgwKiaaIkAikCKSDBtz1oIGK2M9B2e83YYGAIIhJ3zDgGEEDBJgI4NtAhyjxiv9AADSISRdC5IhJZe93iINABs9ABxAACKhIO4gi8wM4t0DxzICBtv/BggAAAAiDQGLPAATQAAyoSINACvdABxAACKhICMgIO4gwswQYQb74CCUYCKQItIPMhIMADMRMCAxloIAMDkxICCExggAgSv7DKR89xs0AARA4ECRQEAEICcwKiSKImAikCKSDE0DliL+AANA4OCRMMzAMSH74CIRKjM4AzJhJjEf+6IhJiojKAIiYSgWCganPB5GDgByISd8w3BhBAwSYCODbQIcs8b3/AAAANIhJF0LgiElh73dG90LLSICAJIhJgAcQAAioYvMIO4glzzhoiEmDBIAGkAAIqFiISgLIuAiECpmAApA4OCRoMzAYmEocen6giEocHXAkiEsMeb6gCfAkCIQOiJyYSk9BSe1AT0CQZ36+jNtDze0bQYSACHH+ixTOWLGbQA8UyHE+n0NOWIMJgZsAF0L0iEkRgAA/QYhkvonteGiISliIShyISxgKsAx0PpwIhAqIyICABuqIkUAomEpG1ULb1Yf/QYMAAAyAgBixv0yRQAyAgEyRQEyAgI7IjJFAjtV9jbjFgYBMgIAMkUAZiYFIgIBIkUBalX9BqKgsHz5gqSwcqEABr3+IaP6KLIH4gIGl/zAICQnPCBGDwCCISd8w4BhBAwSYCODbQIsAwas/AAAXQvSISRGAAD9BpIhJZe92RvdCy0iAgAAHEAAIqGLzCDuIMAgJCc84cAgJAACQODgkXyCIMwQfQ1GAQAAC3fCzPiiISR3ugL2jPEht/oxt/pNDFJhNHJhM7JhNgWVAAsisiE2ciEzUiE0IO4QDA8WLAaGDAAAAIIhJ3zDgGEEDBJgI4NtAiyTBg8AciEkXQuSISWXt+AbdwsnIgIAABxAACKhIO4gi8y2jOTgMHTCzPjg6EEGCgCiISd8w6BhBAwSYCODbQIsoyFm+jliRg8AciEkXQtiISVnt9syBwAbd0Fg+hv/KKSAIhEwIiAppPZPCEbe/wByISRdCyFa+iwjOWIMBoYBAHIhJF0LfPYmFhVLJsxyhgMAAAt3wsz4giEkd7gC9ozxgU/6IX/6MX/6yXhNDFJhNGJhNXJhM4JhMrJhNoWGAIIhMpIhKKIhJgsimeiSISng4hCiaBByITOiISRSITSyITZiITX5+OJoFJJoFaDXwLDFwP0GllYOMWz6+NgtDMV+APDg9E0C8PD1fQwMeGIhNbIhNkYlAAAAkgIAogIC6umSAgHqmZru+v7iAgOampr/mp7iAgSa/5qe4gIFmv+anuICBpr/mp7iAgea/5ru6v+LIjqSRznAQCNBsCKwsJBgRgIAADICABsiOu7q/yo5vQJHM+8xTvotDkJhMWJhNXJhM4JhMrJhNgV2ADFI+u0CLQ+FdQBCITFyITOyITZAd8CCITJBQfpiITX9AoyHLQuwOMDG5v8AAAD/ESEI+urv6dL9BtxW+KLw7sB87+D3g0YCAAAAAAwM3Qzyr/0xNPpSISooI2IhJNAiwNBVwNpm0RD6KSM4DXEP+lJhKspTWQ1wNcAMAgwV8CWDYmEkICB0VoIAQtOAQCWDFpIAwQX6LQzFKQDJDYIhKtHs+Yz4KD0WsgDwLzHwIsDWIgDGhPvWjwAioMcpXQY6AABWTw4oPcwSRlH6IqDIhgAAIqDJKV3GTfooLYwSBkz6Ie75ARv6wAAAAR76wAAAhkf6yD3MHMZF+iKj6AEV+sAAAMAMAAZC+gDiYSIMfEaU+gEV+sAAAAwcDAMGCAAAyC34PfAsICAgtMwSxpv6Ri77Mi0DIi0CRTMAMqAADBwgw4PGKft4fWhtWF1ITTg9KC0MDAH7+cAAAO0CDBLgwpOGJfsAAAH1+cAAAAwMBh/7ACHI+UhdOC1JAiHG+TkCBvr/QcT5DAI4BMKgyDDCgykEQcD5PQwMHCkEMMKDBhP7xzICxvP9xvr9KD0WIvLGF/oCIUOSoRDCIULSIUHiIUDyIT+aEQ3wAAAIAABgHAAAYAAAAGAQAABgIfz/EsHw6QHAIADoAgkxySHZESH4/8AgAMgCwMB0nOzRmvlGBAAAADH0/8AgACgDOA0gIHTAAwALzGYM6ob0/yHv/wgxwCAA6QLIIdgR6AESwRAN8AAAAPgCAGAQAgBgAAIAYAAAAAgh/P/AIAA4AjAwJFZD/yH5/0H6/8AgADkCMff/wCAASQPAIABIA1Z0/8AgACgCDBMgIAQwIjAN8AAAgAAAAABA////AAQCAGASwfDJIcFw+QkxKEzZERaCCEX6/xYiCChMDPMMDSejDCgsMCIQDBMg04PQ0HQQESBF+P8WYv8h3v8x7v/AIAA5AsAgADIiAFZj/zHX/8AgACgDICAkVkL/KCwx5f9AQhEhZfnQMoMh5P8gJBBB5P/AIAApBCHP/8AgADkCwCAAOAJWc/8MEhwD0COT3QIoTNAiwClMKCza0tksCDHIIdgREsEQDfAAAABMSgBAEsHgyWHBRfn5Mfg86UEJcdlR7QL3swH9AxYfBNgc2t/Q3EEGAQAAAIXy/yhMphIEKCwnrfJF7f8Wkv8oHE0PPQ4B7v/AAAAgIHSMMiKgxClcKBxIPPoi8ETAKRxJPAhxyGHYUehB+DESwSAN8AAAAP8PAABRKvkSwfAJMQwUQkUAMExBSSVB+v85FSk1MDC0SiIqIyAsQSlFDAIiZQUBXPnAAAAIMTKgxSAjkxLBEA3wAAAAMDsAQBLB8AkxMqDAN5IRIqDbAfv/wAAAIqDcRgQAAAAAMqDbN5IIAfb/wAAAIqDdAfT/wAAACDESwRAN8AAAABLB8Mkh2REJMc0COtJGAgAAIgwAwswBxfr/15zzAiEDwiEC2BESwRAN8AAAWBAAAHAQAAAYmABAHEsAQDSYAEAAmQBAkfv/EsHgyWHpQfkxCXHZUZARwO0CItEQzQMB9f/AAADx+viGCgDdDMe/Ad0PTQ09AS0OAfD/wAAAICB0/EJNDT0BItEQAez/wAAA0O6A0MzAVhz9IeX/MtEQECKAAef/wAAAIeH/HAMaIgX1/y0MBgEAAAAioGOR3f+aEQhxyGHYUehB+DESwSAN8AASwfAioMAJMQG6/8AAAAgxEsEQDfAAAABsEAAAaBAAAHQQAAB4EAAAfBAAAIAQAACQEAAAmA8AQIw7AEASweCR/P/5Mf0CIcb/yWHZUQlx6UGQEcAaIjkCMfL/LAIaM0kDQfD/0tEQGkTCoABSZADCbRoB8P/AAABh6v8hwPgaZmgGZ7ICxkkALQ0Btv/AAAAhs/8x5f8qQRozSQNGPgAAAGGv/zHf/xpmaAYaM+gDwCbA57ICIOIgYd3/PQEaZlkGTQ7wLyABqP/AAAAx2P8gIHQaM1gDjLIMBEJtFu0ExhIAAAAAQdH/6v8aRFkEBfH/PQ4tAYXj/0Xw/00OPQHQLSABmv/AAABhyf/qzBpmWAYhk/8aIigCJ7y8McL/UCzAGjM4AzeyAkbd/0bq/0KgAEJNbCG5/xAigAG//8AAAFYC/2G5/yINbBBmgDgGRQcA9+IR9k4OQbH/GkTqNCJDABvuxvH/Mq/+N5LBJk4pIXv/0D0gECKAAX7/wAAABej/IXb/HAMaIkXa/0Xn/ywCAav4wAAAhgUAYXH/Ui0aGmZoBme1yFc8AgbZ/8bv/wCRoP+aEQhxyGHYUehB+DESwSAN8F0CQqDAKANHlQ7MMgwShgYADAIpA3ziDfAmEgUmIhHGCwBCoNstBUeVKQwiKQMGCAAioNwnlQgMEikDLQQN8ABCoN188keVCwwSKQMioNsN8AB88g3wAAC2IzBtAlD2QEDzQEe1KVBEwAAUQAAzoQwCNzYEMGbAGyLwIhEwMUELRFbE/jc2ARsiDfAAjJMN8Dc2DAwSDfAAAAAAAERJVjAMAg3wtiMoUPJAQPNAR7UXUETAABRAADOhNzICMCLAMDFBQsT/VgT/NzICMCLADfDMUwAAAERJVjAMAg3wAAAAABRA5sQJIDOBACKhDfAAAAAyoQwCDfAA", $ec3de3bad43fb783$var$fi = 1074843648, $ec3de3bad43fb783$var$Fi = "CIH+PwUFBAACAwcAAwMLALnXEEDv1xBAHdgQQLrYEEBo5xBAHtkQQHTZEEDA2RBAaOcQQILaEED/2hBAwNsQQGjnEEBo5xBAWNwQQGjnEEA33xBAAOAQQDvgEEBo5xBAaOcQQNfgEEBo5xBAv+EQQGXiEECj4xBAY+QQQDTlEEBo5xBAaOcQQGjnEEBo5xBAYuYQQGjnEEBX5xBAkN0QQI/YEECm5RBAq9oQQPzZEEBo5xBA7OYQQDHnEEBo5xBAaOcQQGjnEEBo5xBAaOcQQGjnEEBo5xBAaOcQQCLaEEBf2hBAvuUQQAEAAAACAAAAAwAAAAQAAAAFAAAABwAAAAkAAAANAAAAEQAAABkAAAAhAAAAMQAAAEEAAABhAAAAgQAAAMEAAAABAQAAgQEAAAECAAABAwAAAQQAAAEGAAABCAAAAQwAAAEQAAABGAAAASAAAAEwAAABQAAAAWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAUAAAAGAAAABgAAAAcAAAAHAAAACAAAAAgAAAAJAAAACQAAAAoAAAAKAAAACwAAAAsAAAAMAAAADAAAAA0AAAANAAAAAAAAAAAAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAANAAAADwAAABEAAAATAAAAFwAAABsAAAAfAAAAIwAAACsAAAAzAAAAOwAAAEMAAABTAAAAYwAAAHMAAACDAAAAowAAAMMAAADjAAAAAgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAgAAAAMAAAADAAAAAwAAAAMAAAAEAAAABAAAAAQAAAAEAAAABQAAAAUAAAAFAAAABQAAAAAAAAAAAAAAAAAAABAREgAIBwkGCgULBAwDDQIOAQ8AAQEAAAEAAAAEAAAA", $ec3de3bad43fb783$var$Ti = 1073720488; +var $ec3de3bad43fb783$var$ui = Object.freeze({ + __proto__: null, + ESP8266ROM: class extends $ec3de3bad43fb783$export$c643cc54d6326a6f { + constructor(){ + super(...arguments), this.CHIP_NAME = "ESP8266", this.CHIP_DETECT_MAGIC_VALUE = [ + 4293968129 + ], this.EFUSE_RD_REG_BASE = 1072693328, this.UART_CLKDIV_REG = 1610612756, this.UART_CLKDIV_MASK = 1048575, this.XTAL_CLK_DIVIDER = 2, this.FLASH_WRITE_SIZE = 16384, this.BOOTLOADER_FLASH_OFFSET = 0, this.UART_DATE_REG_ADDR = 0, this.FLASH_SIZES = { + "512KB": 0, + "256KB": 16, + "1MB": 32, + "2MB": 48, + "4MB": 64, + "2MB-c1": 80, + "4MB-c1": 96, + "8MB": 128, + "16MB": 144 + }, this.SPI_REG_BASE = 1610613248, this.SPI_USR_OFFS = 28, this.SPI_USR1_OFFS = 32, this.SPI_USR2_OFFS = 36, this.SPI_MOSI_DLEN_OFFS = 0, this.SPI_MISO_DLEN_OFFS = 0, this.SPI_W0_OFFS = 64, this.TEXT_START = $ec3de3bad43fb783$var$fi, this.ENTRY = $ec3de3bad43fb783$var$Si, this.DATA_START = $ec3de3bad43fb783$var$Ti, this.ROM_DATA = $ec3de3bad43fb783$var$Fi, this.ROM_TEXT = $ec3de3bad43fb783$var$Qi, this.getChipFeatures = async (A)=>{ + const t = [ + "WiFi" + ]; + return "ESP8285" == await this.getChipDescription(A) && t.push("Embedded Flash"), t; + }; + } + async readEfuse(A, t) { + const e = this.EFUSE_RD_REG_BASE + 4 * t; + return A.debug("Read efuse " + e), await A.readReg(e); + } + async getChipDescription(A) { + const t = await this.readEfuse(A, 2); + return 0 != (16 & await this.readEfuse(A, 0) | 65536 & t) ? "ESP8285" : "ESP8266EX"; + } + async getCrystalFreq(A) { + const t = await A.readReg(this.UART_CLKDIV_REG) & this.UART_CLKDIV_MASK, e = A.transport.baudrate * t / 1e6 / this.XTAL_CLK_DIVIDER; + let i; + return i = e > 33 ? 40 : 26, Math.abs(i - e) > 1 && A.info("WARNING: Detected crystal freq " + e + "MHz is quite different to normalized freq " + i + "MHz. Unsupported crystal in use?"), i; + } + _d2h(A) { + const t = (+A).toString(16); + return 1 === t.length ? "0" + t : t; + } + async readMac(A) { + let t = await this.readEfuse(A, 0); + t >>>= 0; + let e = await this.readEfuse(A, 1); + e >>>= 0; + let i = await this.readEfuse(A, 3); + i >>>= 0; + const s = new Uint8Array(6); + return 0 != i ? (s[0] = i >> 16 & 255, s[1] = i >> 8 & 255, s[2] = 255 & i) : 0 == (e >> 16 & 255) ? (s[0] = 24, s[1] = 254, s[2] = 52) : 1 == (e >> 16 & 255) ? (s[0] = 172, s[1] = 208, s[2] = 116) : A.error("Unknown OUI"), s[3] = e >> 8 & 255, s[4] = 255 & e, s[5] = t >> 24 & 255, this._d2h(s[0]) + ":" + this._d2h(s[1]) + ":" + this._d2h(s[2]) + ":" + this._d2h(s[3]) + ":" + this._d2h(s[4]) + ":" + this._d2h(s[5]); + } + getEraseSize(A, t) { + return t; + } + } +}), $ec3de3bad43fb783$var$pi = 1341195918, $ec3de3bad43fb783$var$yi = "QREixCbCBsa3Jw1QEUc3BPVP2Mu3JA1QEwQEANxAkYuR57JAIkSSREEBgoCIQBxAE3X1D4KX3bcBEbenDFBOxoOphwBKyDcJ9U8mylLEBs4izLekDFB9WhMJCQDATBN09D8N4PJAYkQjqDQBQknSRLJJIkoFYYKAiECDJwkAE3X1D4KXfRTjGUT/yb8TBwAMlEGqh2MY5QCFR4XGI6AFAHlVgoAFR2OH5gAJRmONxgB9VYKAQgUTB7ANQYVjlecCiUecwfW3kwbADWMW1QCYwRMFAAyCgJMG0A19VWOV1wCYwRMFsA2CgLc19k9BEZOFRboGxmE/Y0UFBrc39k+Th8exA6cHCAPWRwgTdfUPkwYWAMIGwYIjktcIMpcjAKcAA9dHCJFnk4cHBGMe9wI3t/VPEwfHsaFnupcDpgcIt/b1T7c39k+Th8exk4bGtWMf5gAjpscII6DXCCOSBwghoPlX4wb1/LJAQQGCgCOm1wgjoOcI3bc31whQfEudi/X/N8cIUHxLnYv1/4KAQREGxt03t9cIUCOmBwI3BwAImMOYQ33/yFeyQBNF9f8FiUEBgoBBEQbG2T993TcHAEC31whQmMM31whQHEP9/7JAQQGCgEERIsQ3hPVPkwcEAUrAA6kHAQbGJsJjCgkERTc5xb1HEwQEAYFEY9YnAQREvYiTtBQAfTeFPxxENwaAABOXxwCZ4DcGAAG39v8AdY+31ghQ2MKQwphCff9BR5HgBUczCelAupcjKCQBHMSyQCJEkkQCSUEBgoABEQbOIswlNzcE9E9sABMFxP6XAM//54Ag86qHBUWV57JHk/cHID7GiTc31whQHEe3BkAAEwXE/tWPHMeyRZcAz//ngKDwMzWgAPJAYkQFYYKAQRG3h/VPBsaThwcBBUcjgOcAE9fFAJjHBWd9F8zDyMf5jTqVqpWxgYzLI6oHAEE3GcETBVAMskBBAYKAAREizDeE9U+TBwQBJsrER07GBs5KyKqJEwQEAWPzlQCuhKnAAylEACaZE1nJABxIY1XwABxEY175ArU9fd1IQCaGzoWXAM//54Cg4xN19Q8BxZMHQAxcyFxAppdcwFxEhY9cxPJAYkTSREJJskkFYYKAaTVtv0ERBsaXAM//54BA1gNFhQGyQGkVEzUVAEEBgoBBEQbGxTcRwRlFskBBARcDz/9nAOPPQREGxibCIsSqhJcAz//ngADNdT8NyTcH9U+TBgcAg9dGABMEBwCFB8IHwYMjkvYAkwYADGOG1AATB+ADY3X3AG03IxIEALJAIkSSREEBgoBBEQbGEwcADGMa5QATBbANRTcTBcANskBBAVm/EwewDeMb5f5xNxMF0A31t0ERIsQmwgbGKoSzBLUAYxeUALJAIkSSREEBgoADRQQABQRNP+23NXEmy07H/XKFaf10Is1KyVLFVsMGz5OEhPoWkZOHCQemlxgIs4TnACqJJoUuhJcAz//ngOAZk4cJBxgIBWq6l7OKR0Ex5AVnfXWTBYX6kwcHBxMFhfkUCKqXM4XXAJMHBweul7OF1wAqxpcAz//ngKAWMkXBRZU3AUWFYhaR+kBqRNpESkm6SSpKmkoNYYKAooljc4oAhWlOhtaFSoWXAM//54CgyRN19Q8B7U6G1oUmhZcAz//ngOARTpkzBDRBUbcTBTAGVb8TBQAMSb0xcf1yBWdO11LVVtNezwbfIt0m20rZWtFizWbLaslux/13FpETBwcHPpccCLqXPsYjqgf4qokuirKKtosNNZMHAAIZwbcHAgA+hZcAz//ngIAKhWdj5VcTBWR9eRMJifqTBwQHypcYCDOJ5wBKhZcAz//ngAAJfXsTDDv5kwyL+RMHBAeTBwQHFAhil+aXgUQzDNcAs4zXAFJNY3xNCWPxpANBqJk/ooUIAY01uTcihgwBSoWXAM//54DgBKKZopRj9UQDs4ekQWPxdwMzBJpAY/OKAFaEIoYMAU6FlwDP/+eA4LgTdfUPVd0CzAFEeV2NTaMJAQBihZcAz//ngKCnffkDRTEB5oVZPGNPBQDj4o3+hWeThwcHopcYCLqX2pcjiqf4BQTxt+MVpf2RR+MF9PYFZ311kwcHB5MFhfoTBYX5FAiqlzOF1wCTBwcHrpezhdcAKsaXAM//54AA+3E9MkXBRWUzUT3dObcHAgAZ4ZMHAAI+hZcAz//ngAD4hWIWkfpQalTaVEpZulkqWppaClv6S2pM2kxKTbpNKWGCgLdXQUkZcZOH94QBRYbeotym2srYztbS1NbS2tDezuLM5srqyO7GPs6XAM//54DgoHkxBcU3R9hQt2cRUBMHF6qYzyOgBwAjrAcAmNPYT7cGBABVj9jPI6AHArcH9U83N/ZPk4cHABMHx7ohoCOgBwCRB+Pt5/7VM5FFaAjFOfE7t7f1T5OHx7EhZz6XIyD3CLcH8U83CfVPk4eHDiMg+QC3OfZPKTmTicmxEwkJAGMFBRC3Zw1QEwcQArjPhUVFRZcAz//ngKDmtwXxTwFGk4UFAEVFlwDP/+eAoOe3Jw1QEUeYyzcFAgCXAM//54Dg5rcHDlCIX4FFt4T1T3GJYRUTNRUAlwDP/+eAYKXBZ/0XEwcAEIVmQWa3BQABAUWThAQBtwr1Tw1qlwDP/+eAIJsTiwoBJpqDp8kI9d+Dq8kIhUcjpgkIIwLxAoPHGwAJRyMT4QKjAvECAtRNR2OB5whRR2OP5wYpR2Of5wCDxzsAA8crAKIH2Y8RR2OW5wCDp4sAnEM+1NE5oUVIEMU2g8c7AAPHKwCiB9mPEWdBB2N09wQTBbANqTYTBcANkTYTBeAOPT5dMUG3twXxTwFGk4WFAxVFlwDP/+eAoNg3pwxQXEcTBQACk+cXEFzHMbfJRyMT8QJNtwPHGwDRRmPn5gKFRmPm5gABTBME8A+FqHkXE3f3D8lG4+jm/rc29k8KB5OGBrs2lxhDAoeTBgcDk/b2DxFG42nW/BMH9wITd/cPjUZj6+YItzb2TwoHk4bGvzaXGEMChxMHQAJjl+cQAtQdRAFFcTwBReU0ATH9PqFFSBB9FCE2dfQBTAFEE3X0D8E8E3X8D+k0zTbjHgTqg8cbAElHY2v3MAlH43b36vUXk/f3Dz1H42D36jc39k+KBxMHx8C6l5xDgocFRJ3rcBCBRQFFl/DO/+eAoHcd4dFFaBBtNAFEMagFRIHvl/DO/+eAIH0zNKAAKaAhR2OF5wAFRAFMYbcDrIsAA6TLALNnjADSB/X30TBl9cFsIpz9HH19MwWMQF3cs3eVAZXjwWwzBYxAY+aMAv18MwWMQF3QMYGX8M7/54DAeV35ZpT1tzGBl/DO/+eAwHhd8WqU0bdBgZfwzv/ngAB4WfkzBJRBwbchR+OK5/ABTBMEAAw5t0FHzb9BRwVE453n9oOlywADpYsAOTy5v0FHBUTjk+f2A6cLAZFnY+7nHoOlSwEDpYsA7/C/hz2/QUcFROOT5/SDpwsBEWdjbvccA6fLAIOlSwEDpYsAM4TnAu/wP4UjrAQAIySKsDm3A8cEAGMHBxQDp4sAwRcTBAAMYxP3AMBIAUeTBvAOY0b3AoPHWwADx0sAAUyiB9mPA8drAEIHXY+Dx3sA4gfZj+OC9uYTBBAMsb0zhusAA0aGAQUHsY7ht4PHBAD9y9xEY5EHFsBII4AEAEW9YUdjlucCg6fLAQOniwGDpksBA6YLAYOlywADpYsAl/DO/+eAgGgqjDM0oAAxtQFMBUQZtRFHBUTjm+fmtxcOUPRfZXd9FwVm+Y7RjgOliwCThQcI9N+UQfmO0Y6UwZOFRwiUQfmO0Y6UwbRfgUV1j1GPuN+X8M7/54AgaxG9E/f3AOMRB+qT3EcAE4SLAAFMfV3jcZzbSESX8M7/54AgThhEVEAQQPmOYwenARxCE0f3/32P2Y4UwgUMQQTZvxFHhbVBRwVE45Tn3oOniwADp0sBIyb5ACMk6QBdu4MliQDBF5Hlic8BTBMEYAyxswMnyQBjZvcGE/c3AOMVB+IDKMkAAUYBRzMF6ECzhuUAY2n3AOMBBtIjJqkAIyTZABm7M4brABBOEQeQwgVG6b8hRwVE457n1gMkyQAZwBMEgAwjJgkAIyQJADM0gACNswFMEwQgDNWxAUwTBIAM8bkBTBMEkAzRuRMHIA1jg+cMEwdADeOY57gDxDsAg8crACIEXYyX8M7/54AATgOsxABBFGNzhAEijOMGDLbAQGKUMYCcSGNV8ACcRGNb9Arv8O/Rdd3IQGKGk4WLAZfwzv/ngABKAcWTB0AM3MjcQOKX3MDcRLOHh0HcxJfwzv/ngOBIDbYJZRMFBXEDrMsAA6SLAJfwzv/ngKA4t6cMUNhLtwYAAcEWk1dHARIHdY+9i9mPs4eHAwFFs9WHApfwzv/ngAA6EwWAPpfwzv/ngEA10byDpksBA6YLAYOlywADpYsA7/DP/n28g8U7AIPHKwAThYsBogXdjcEV7/DP21207/Avyz2/A8Q7AIPHKwATjIsBIgRdjNxEQRTN45FHhUtj/4cIkweQDNzIrbwDpw0AItAFSLOH7EA+1oMnirBjc/QADUhCxjrE7/CvxiJHMkg3hfVP4oV8EJOGCgEQEBMFhQKX8M7/54BgNze39U+TCAcBglcDp4iwg6UNAB2MHY8+nLJXI6TosKqLvpUjoL0Ak4cKAZ2NAcWhZ2OX9QBahe/wb9EjoG0BCcTcRJnD409w92PfCwCTB3AMvbeFS7c99k+3jPVPk43NupOMDAHpv+OaC5zcROOHB5yTB4AMqbeDp4sA45AHnO/wD9YJZRMFBXGX8M7/54CgIpfwzv/ngKAnTbIDpMsA4w4EmO/wz9MTBYA+l/DO/+eAgCAClFmy9lBmVNZURlm2WSZalloGW/ZLZkzWTEZNtk0JYYKAAAA=", $ec3de3bad43fb783$var$ki = 1341194240, $ec3de3bad43fb783$var$Hi = "EAD1TwYK8U9WCvFPrgrxT4QL8U/wC/FPngvxT9QI8U9AC/FPgAvxT8IK8U+ECPFP9grxT4QI8U/gCfFPJgrxT1YK8U+uCvFP8gnxTzgJ8U9oCfFP7gnxT0AO8U9WCvFPCA3xTwAO8U/EB/FPJA7xT8QH8U/EB/FPxAfxT8QH8U/EB/FPxAfxT8QH8U/EB/FPpAzxT8QH8U8mDfFPAA7xTw==", $ec3de3bad43fb783$var$Pi = 1341533100; +var $ec3de3bad43fb783$var$Oi = Object.freeze({ + __proto__: null, + ESP32P4ROM: class extends $ec3de3bad43fb783$var$ke { + constructor(){ + super(...arguments), this.CHIP_NAME = "ESP32-P4", this.IMAGE_CHIP_ID = 18, this.IROM_MAP_START = 1073741824, this.IROM_MAP_END = 1275068416, this.DROM_MAP_START = 1073741824, this.DROM_MAP_END = 1275068416, this.BOOTLOADER_FLASH_OFFSET = 8192, this.CHIP_DETECT_MAGIC_VALUE = [ + 0, + 182303440 + ], this.UART_DATE_REG_ADDR = 1343004812, this.EFUSE_BASE = 1343410176, this.EFUSE_BLOCK1_ADDR = this.EFUSE_BASE + 68, this.MAC_EFUSE_REG = this.EFUSE_BASE + 68, this.SPI_REG_BASE = 1342754816, this.SPI_USR_OFFS = 24, this.SPI_USR1_OFFS = 28, this.SPI_USR2_OFFS = 32, this.SPI_MOSI_DLEN_OFFS = 36, this.SPI_MISO_DLEN_OFFS = 40, this.SPI_W0_OFFS = 88, this.EFUSE_RD_REG_BASE = this.EFUSE_BASE + 48, this.EFUSE_PURPOSE_KEY0_REG = this.EFUSE_BASE + 52, this.EFUSE_PURPOSE_KEY0_SHIFT = 24, this.EFUSE_PURPOSE_KEY1_REG = this.EFUSE_BASE + 52, this.EFUSE_PURPOSE_KEY1_SHIFT = 28, this.EFUSE_PURPOSE_KEY2_REG = this.EFUSE_BASE + 56, this.EFUSE_PURPOSE_KEY2_SHIFT = 0, this.EFUSE_PURPOSE_KEY3_REG = this.EFUSE_BASE + 56, this.EFUSE_PURPOSE_KEY3_SHIFT = 4, this.EFUSE_PURPOSE_KEY4_REG = this.EFUSE_BASE + 56, this.EFUSE_PURPOSE_KEY4_SHIFT = 8, this.EFUSE_PURPOSE_KEY5_REG = this.EFUSE_BASE + 56, this.EFUSE_PURPOSE_KEY5_SHIFT = 12, this.EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT_REG = this.EFUSE_RD_REG_BASE, this.EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT = 1048576, this.EFUSE_SPI_BOOT_CRYPT_CNT_REG = this.EFUSE_BASE + 52, this.EFUSE_SPI_BOOT_CRYPT_CNT_MASK = 1835008, this.EFUSE_SECURE_BOOT_EN_REG = this.EFUSE_BASE + 56, this.EFUSE_SECURE_BOOT_EN_MASK = 1048576, this.PURPOSE_VAL_XTS_AES256_KEY_1 = 2, this.PURPOSE_VAL_XTS_AES256_KEY_2 = 3, this.PURPOSE_VAL_XTS_AES128_KEY = 4, this.SUPPORTS_ENCRYPTED_FLASH = !0, this.FLASH_ENCRYPTED_WRITE_ALIGN = 16, this.MEMORY_MAP = [ + [ + 0, + 65536, + "PADDING" + ], + [ + 1073741824, + 1275068416, + "DROM" + ], + [ + 1341128704, + 1341784064, + "DRAM" + ], + [ + 1341128704, + 1341784064, + "BYTE_ACCESSIBLE" + ], + [ + 1337982976, + 1338114048, + "DROM_MASK" + ], + [ + 1337982976, + 1338114048, + "IROM_MASK" + ], + [ + 1073741824, + 1275068416, + "IROM" + ], + [ + 1341128704, + 1341784064, + "IRAM" + ], + [ + 1343258624, + 1343291392, + "RTC_IRAM" + ], + [ + 1343258624, + 1343291392, + "RTC_DRAM" + ], + [ + 1611653120, + 1611661312, + "MEM_INTERNAL2" + ] + ], this.UF2_FAMILY_ID = 1026592404, this.EFUSE_MAX_KEY = 5, this.KEY_PURPOSES = { + 0: "USER/EMPTY", + 1: "ECDSA_KEY", + 2: "XTS_AES_256_KEY_1", + 3: "XTS_AES_256_KEY_2", + 4: "XTS_AES_128_KEY", + 5: "HMAC_DOWN_ALL", + 6: "HMAC_DOWN_JTAG", + 7: "HMAC_DOWN_DIGITAL_SIGNATURE", + 8: "HMAC_UP", + 9: "SECURE_BOOT_DIGEST0", + 10: "SECURE_BOOT_DIGEST1", + 11: "SECURE_BOOT_DIGEST2", + 12: "KM_INIT_KEY" + }, this.TEXT_START = $ec3de3bad43fb783$var$ki, this.ENTRY = $ec3de3bad43fb783$var$pi, this.DATA_START = $ec3de3bad43fb783$var$Pi, this.ROM_DATA = $ec3de3bad43fb783$var$Hi, this.ROM_TEXT = $ec3de3bad43fb783$var$yi; + } + async getPkgVersion(A) { + const t = this.EFUSE_BLOCK1_ADDR + 8; + return await A.readReg(t) >> 27 & 7; + } + async getMinorChipVersion(A) { + const t = this.EFUSE_BLOCK1_ADDR + 8; + return await A.readReg(t) >> 0 & 15; + } + async getMajorChipVersion(A) { + const t = this.EFUSE_BLOCK1_ADDR + 8; + return await A.readReg(t) >> 4 & 3; + } + async getChipDescription(A) { + return `${0 === await this.getPkgVersion(A) ? "ESP32-P4" : "unknown ESP32-P4"} (revision v${await this.getMajorChipVersion(A)}.${await this.getMinorChipVersion(A)})`; + } + async getChipFeatures(A) { + return [ + "High-Performance MCU" + ]; + } + async getCrystalFreq(A) { + return 40; + } + async getFlashVoltage(A) {} + async overrideVddsdio(A) { + A.debug("VDD_SDIO overrides are not supported for ESP32-P4"); + } + async readMac(A) { + let t = await A.readReg(this.MAC_EFUSE_REG); + t >>>= 0; + let e = await A.readReg(this.MAC_EFUSE_REG + 4); + e = e >>> 0 & 65535; + const i = new Uint8Array(6); + return i[0] = e >> 8 & 255, i[1] = 255 & e, i[2] = t >> 24 & 255, i[3] = t >> 16 & 255, i[4] = t >> 8 & 255, i[5] = 255 & t, this._d2h(i[0]) + ":" + this._d2h(i[1]) + ":" + this._d2h(i[2]) + ":" + this._d2h(i[3]) + ":" + this._d2h(i[4]) + ":" + this._d2h(i[5]); + } + async getFlashCryptConfig(A) {} + async getSecureBootEnabled(A) { + return await A.readReg(this.EFUSE_SECURE_BOOT_EN_REG) & this.EFUSE_SECURE_BOOT_EN_MASK; + } + async getKeyBlockPurpose(A, t) { + if (t < 0 || t > this.EFUSE_MAX_KEY) return void A.debug(`Valid key block numbers must be in range 0-${this.EFUSE_MAX_KEY}`); + const e = [ + [ + this.EFUSE_PURPOSE_KEY0_REG, + this.EFUSE_PURPOSE_KEY0_SHIFT + ], + [ + this.EFUSE_PURPOSE_KEY1_REG, + this.EFUSE_PURPOSE_KEY1_SHIFT + ], + [ + this.EFUSE_PURPOSE_KEY2_REG, + this.EFUSE_PURPOSE_KEY2_SHIFT + ], + [ + this.EFUSE_PURPOSE_KEY3_REG, + this.EFUSE_PURPOSE_KEY3_SHIFT + ], + [ + this.EFUSE_PURPOSE_KEY4_REG, + this.EFUSE_PURPOSE_KEY4_SHIFT + ], + [ + this.EFUSE_PURPOSE_KEY5_REG, + this.EFUSE_PURPOSE_KEY5_SHIFT + ] + ], [i, s] = e[t]; + return await A.readReg(i) >> s & 15; + } + async isFlashEncryptionKeyValid(A) { + const t = []; + for(let e = 0; e <= this.EFUSE_MAX_KEY; e++){ + const i = await this.getKeyBlockPurpose(A, e); + t.push(i); + } + t.find((A)=>A === this.PURPOSE_VAL_XTS_AES128_KEY); + return !0; + const e = t.find((A)=>A === this.PURPOSE_VAL_XTS_AES256_KEY_1), i = t.find((A)=>A === this.PURPOSE_VAL_XTS_AES256_KEY_2); + return true; + } + } +}); + + +/* + * Copyright 2019 Google LLC + * + * 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 + * + * https://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. + */ "use strict"; +var $d2bbb828b377f05f$export$24d5ae9391ffe6e0; +(function(SerialPolyfillProtocol) { + SerialPolyfillProtocol[SerialPolyfillProtocol["UsbCdcAcm"] = 0] = "UsbCdcAcm"; +})($d2bbb828b377f05f$export$24d5ae9391ffe6e0 || ($d2bbb828b377f05f$export$24d5ae9391ffe6e0 = {})); +const $d2bbb828b377f05f$var$kSetLineCoding = 0x20; +const $d2bbb828b377f05f$var$kSetControlLineState = 0x22; +const $d2bbb828b377f05f$var$kSendBreak = 0x23; +const $d2bbb828b377f05f$var$kDefaultBufferSize = 255; +const $d2bbb828b377f05f$var$kDefaultDataBits = 8; +const $d2bbb828b377f05f$var$kDefaultParity = "none"; +const $d2bbb828b377f05f$var$kDefaultStopBits = 1; +const $d2bbb828b377f05f$var$kAcceptableDataBits = [ + 16, + 8, + 7, + 6, + 5 +]; +const $d2bbb828b377f05f$var$kAcceptableStopBits = [ + 1, + 2 +]; +const $d2bbb828b377f05f$var$kAcceptableParity = [ + "none", + "even", + "odd" +]; +const $d2bbb828b377f05f$var$kParityIndexMapping = [ + "none", + "odd", + "even" +]; +const $d2bbb828b377f05f$var$kStopBitsIndexMapping = [ + 1, + 1.5, + 2 +]; +const $d2bbb828b377f05f$var$kDefaultPolyfillOptions = { + protocol: $d2bbb828b377f05f$export$24d5ae9391ffe6e0.UsbCdcAcm, + usbControlInterfaceClass: 2, + usbTransferInterfaceClass: 10 +}; +/** + * Utility function to get the interface implementing a desired class. + * @param {USBDevice} device The USB device. + * @param {number} classCode The desired interface class. + * @return {USBInterface} The first interface found that implements the desired + * class. + * @throws TypeError if no interface is found. + */ function $d2bbb828b377f05f$var$findInterface(device, classCode) { + const configuration = device.configurations[0]; + for (const iface of configuration.interfaces){ + const alternate = iface.alternates[0]; + if (alternate.interfaceClass === classCode) return iface; + } + throw new TypeError(`Unable to find interface with class ${classCode}.`); +} +/** + * Utility function to get an endpoint with a particular direction. + * @param {USBInterface} iface The interface to search. + * @param {USBDirection} direction The desired transfer direction. + * @return {USBEndpoint} The first endpoint with the desired transfer direction. + * @throws TypeError if no endpoint is found. + */ function $d2bbb828b377f05f$var$findEndpoint(iface, direction) { + const alternate = iface.alternates[0]; + for (const endpoint of alternate.endpoints){ + if (endpoint.direction == direction) return endpoint; + } + throw new TypeError(`Interface ${iface.interfaceNumber} does not have an ` + `${direction} endpoint.`); +} +/** + * Implementation of the underlying source API[1] which reads data from a USB + * endpoint. This can be used to construct a ReadableStream. + * + * [1]: https://streams.spec.whatwg.org/#underlying-source-api + */ class $d2bbb828b377f05f$var$UsbEndpointUnderlyingSource { + /** + * Constructs a new UnderlyingSource that will pull data from the specified + * endpoint on the given USB device. + * + * @param {USBDevice} device + * @param {USBEndpoint} endpoint + * @param {function} onError function to be called on error + */ constructor(device, endpoint, onError){ + this.type = "bytes"; + this.device_ = device; + this.endpoint_ = endpoint; + this.onError_ = onError; + } + /** + * Reads a chunk of data from the device. + * + * @param {ReadableByteStreamController} controller + */ pull(controller) { + (async ()=>{ + var _a; + let chunkSize; + if (controller.desiredSize) { + const d = controller.desiredSize / this.endpoint_.packetSize; + chunkSize = Math.ceil(d) * this.endpoint_.packetSize; + } else chunkSize = this.endpoint_.packetSize; + try { + const result = await this.device_.transferIn(this.endpoint_.endpointNumber, chunkSize); + if (result.status != "ok") { + controller.error(`USB error: ${result.status}`); + this.onError_(); + } + if ((_a = result.data) === null || _a === void 0 ? void 0 : _a.buffer) { + const chunk = new Uint8Array(result.data.buffer, result.data.byteOffset, result.data.byteLength); + controller.enqueue(chunk); + } + } catch (error) { + controller.error(error.toString()); + this.onError_(); + } + })(); + } +} +/** + * Implementation of the underlying sink API[2] which writes data to a USB + * endpoint. This can be used to construct a WritableStream. + * + * [2]: https://streams.spec.whatwg.org/#underlying-sink-api + */ class $d2bbb828b377f05f$var$UsbEndpointUnderlyingSink { + /** + * Constructs a new UnderlyingSink that will write data to the specified + * endpoint on the given USB device. + * + * @param {USBDevice} device + * @param {USBEndpoint} endpoint + * @param {function} onError function to be called on error + */ constructor(device, endpoint, onError){ + this.device_ = device; + this.endpoint_ = endpoint; + this.onError_ = onError; + } + /** + * Writes a chunk to the device. + * + * @param {Uint8Array} chunk + * @param {WritableStreamDefaultController} controller + */ async write(chunk, controller) { + try { + const result = await this.device_.transferOut(this.endpoint_.endpointNumber, chunk); + if (result.status != "ok") { + controller.error(result.status); + this.onError_(); + } + } catch (error) { + controller.error(error.toString()); + this.onError_(); + } + } +} +class $d2bbb828b377f05f$export$237d90817cb05a2f { + /** + * constructor taking a WebUSB device that creates a SerialPort instance. + * @param {USBDevice} device A device acquired from the WebUSB API + * @param {SerialPolyfillOptions} polyfillOptions Optional options to + * configure the polyfill. + */ constructor(device, polyfillOptions){ + this.polyfillOptions_ = Object.assign(Object.assign({}, $d2bbb828b377f05f$var$kDefaultPolyfillOptions), polyfillOptions); + this.outputSignals_ = { + dataTerminalReady: false, + requestToSend: false, + break: false + }; + this.device_ = device; + this.controlInterface_ = $d2bbb828b377f05f$var$findInterface(this.device_, this.polyfillOptions_.usbControlInterfaceClass); + this.transferInterface_ = $d2bbb828b377f05f$var$findInterface(this.device_, this.polyfillOptions_.usbTransferInterfaceClass); + this.inEndpoint_ = $d2bbb828b377f05f$var$findEndpoint(this.transferInterface_, "in"); + this.outEndpoint_ = $d2bbb828b377f05f$var$findEndpoint(this.transferInterface_, "out"); + } + /** + * Getter for the readable attribute. Constructs a new ReadableStream as + * necessary. + * @return {ReadableStream} the current readable stream + */ get readable() { + var _a; + if (!this.readable_ && this.device_.opened) this.readable_ = new ReadableStream(new $d2bbb828b377f05f$var$UsbEndpointUnderlyingSource(this.device_, this.inEndpoint_, ()=>{ + this.readable_ = null; + }), { + highWaterMark: (_a = this.serialOptions_.bufferSize) !== null && _a !== void 0 ? _a : $d2bbb828b377f05f$var$kDefaultBufferSize + }); + return this.readable_; + } + /** + * Getter for the writable attribute. Constructs a new WritableStream as + * necessary. + * @return {WritableStream} the current writable stream + */ get writable() { + var _a; + if (!this.writable_ && this.device_.opened) this.writable_ = new WritableStream(new $d2bbb828b377f05f$var$UsbEndpointUnderlyingSink(this.device_, this.outEndpoint_, ()=>{ + this.writable_ = null; + }), new ByteLengthQueuingStrategy({ + highWaterMark: (_a = this.serialOptions_.bufferSize) !== null && _a !== void 0 ? _a : $d2bbb828b377f05f$var$kDefaultBufferSize + })); + return this.writable_; + } + /** + * a function that opens the device and claims all interfaces needed to + * control and communicate to and from the serial device + * @param {SerialOptions} options Object containing serial options + * @return {Promise} A promise that will resolve when device is ready + * for communication + */ async open(options) { + this.serialOptions_ = options; + this.validateOptions(); + try { + await this.device_.open(); + if (this.device_.configuration === null) await this.device_.selectConfiguration(1); + await this.device_.claimInterface(this.controlInterface_.interfaceNumber); + if (this.controlInterface_ !== this.transferInterface_) await this.device_.claimInterface(this.transferInterface_.interfaceNumber); + await this.setLineCoding(); + await this.setSignals({ + dataTerminalReady: true + }); + } catch (error) { + if (this.device_.opened) await this.device_.close(); + throw new Error("Error setting up device: " + error.toString()); + } + } + /** + * Closes the port. + * + * @return {Promise} A promise that will resolve when the port is + * closed. + */ async close() { + const promises = []; + if (this.readable_) promises.push(this.readable_.cancel()); + if (this.writable_) promises.push(this.writable_.abort()); + await Promise.all(promises); + this.readable_ = null; + this.writable_ = null; + if (this.device_.opened) { + await this.setSignals({ + dataTerminalReady: false, + requestToSend: false + }); + await this.device_.close(); + } + } + /** + * Forgets the port. + * + * @return {Promise} A promise that will resolve when the port is + * forgotten. + */ async forget() { + return this.device_.forget(); + } + /** + * A function that returns properties of the device. + * @return {SerialPortInfo} Device properties. + */ getInfo() { + return { + usbVendorId: this.device_.vendorId, + usbProductId: this.device_.productId + }; + } + /** + * A function used to change the serial settings of the device + * @param {object} options the object which carries serial settings data + * @return {Promise} A promise that will resolve when the options are + * set + */ reconfigure(options) { + this.serialOptions_ = Object.assign(Object.assign({}, this.serialOptions_), options); + this.validateOptions(); + return this.setLineCoding(); + } + /** + * Sets control signal state for the port. + * @param {SerialOutputSignals} signals The signals to enable or disable. + * @return {Promise} a promise that is resolved when the signal state + * has been changed. + */ async setSignals(signals) { + this.outputSignals_ = Object.assign(Object.assign({}, this.outputSignals_), signals); + if (signals.dataTerminalReady !== undefined || signals.requestToSend !== undefined) { + // The Set_Control_Line_State command expects a bitmap containing the + // values of all output signals that should be enabled or disabled. + // + // Ref: USB CDC specification version 1.1 §6.2.14. + const value = (this.outputSignals_.dataTerminalReady ? 1 : 0) | (this.outputSignals_.requestToSend ? 2 : 0); + await this.device_.controlTransferOut({ + "requestType": "class", + "recipient": "interface", + "request": $d2bbb828b377f05f$var$kSetControlLineState, + "value": value, + "index": this.controlInterface_.interfaceNumber + }); + } + if (signals.break !== undefined) { + // The SendBreak command expects to be given a duration for how long the + // break signal should be asserted. Passing 0xFFFF enables the signal + // until 0x0000 is send. + // + // Ref: USB CDC specification version 1.1 §6.2.15. + const value = this.outputSignals_.break ? 0xFFFF : 0x0000; + await this.device_.controlTransferOut({ + "requestType": "class", + "recipient": "interface", + "request": $d2bbb828b377f05f$var$kSendBreak, + "value": value, + "index": this.controlInterface_.interfaceNumber + }); + } + } + /** + * Checks the serial options for validity and throws an error if it is + * not valid + */ validateOptions() { + if (!this.isValidBaudRate(this.serialOptions_.baudRate)) throw new RangeError("invalid Baud Rate " + this.serialOptions_.baudRate); + if (!this.isValidDataBits(this.serialOptions_.dataBits)) throw new RangeError("invalid dataBits " + this.serialOptions_.dataBits); + if (!this.isValidStopBits(this.serialOptions_.stopBits)) throw new RangeError("invalid stopBits " + this.serialOptions_.stopBits); + if (!this.isValidParity(this.serialOptions_.parity)) throw new RangeError("invalid parity " + this.serialOptions_.parity); + } + /** + * Checks the baud rate for validity + * @param {number} baudRate the baud rate to check + * @return {boolean} A boolean that reflects whether the baud rate is valid + */ isValidBaudRate(baudRate) { + return baudRate % 1 === 0; + } + /** + * Checks the data bits for validity + * @param {number} dataBits the data bits to check + * @return {boolean} A boolean that reflects whether the data bits setting is + * valid + */ isValidDataBits(dataBits) { + if (typeof dataBits === "undefined") return true; + return $d2bbb828b377f05f$var$kAcceptableDataBits.includes(dataBits); + } + /** + * Checks the stop bits for validity + * @param {number} stopBits the stop bits to check + * @return {boolean} A boolean that reflects whether the stop bits setting is + * valid + */ isValidStopBits(stopBits) { + if (typeof stopBits === "undefined") return true; + return $d2bbb828b377f05f$var$kAcceptableStopBits.includes(stopBits); + } + /** + * Checks the parity for validity + * @param {string} parity the parity to check + * @return {boolean} A boolean that reflects whether the parity is valid + */ isValidParity(parity) { + if (typeof parity === "undefined") return true; + return $d2bbb828b377f05f$var$kAcceptableParity.includes(parity); + } + /** + * sends the options alog the control interface to set them on the device + * @return {Promise} a promise that will resolve when the options are set + */ async setLineCoding() { + var _a, _b, _c; + // Ref: USB CDC specification version 1.1 §6.2.12. + const buffer = new ArrayBuffer(7); + const view = new DataView(buffer); + view.setUint32(0, this.serialOptions_.baudRate, true); + view.setUint8(4, $d2bbb828b377f05f$var$kStopBitsIndexMapping.indexOf((_a = this.serialOptions_.stopBits) !== null && _a !== void 0 ? _a : $d2bbb828b377f05f$var$kDefaultStopBits)); + view.setUint8(5, $d2bbb828b377f05f$var$kParityIndexMapping.indexOf((_b = this.serialOptions_.parity) !== null && _b !== void 0 ? _b : $d2bbb828b377f05f$var$kDefaultParity)); + view.setUint8(6, (_c = this.serialOptions_.dataBits) !== null && _c !== void 0 ? _c : $d2bbb828b377f05f$var$kDefaultDataBits); + const result = await this.device_.controlTransferOut({ + "requestType": "class", + "recipient": "interface", + "request": $d2bbb828b377f05f$var$kSetLineCoding, + "value": 0x00, + "index": this.controlInterface_.interfaceNumber + }, buffer); + if (result.status != "ok") throw new DOMException("NetworkError", "Failed to set line coding."); + } +} +/** implementation of the global navigator.serial object */ class $d2bbb828b377f05f$var$Serial { + /** + * Requests permission to access a new port. + * + * @param {SerialPortRequestOptions} options + * @param {SerialPolyfillOptions} polyfillOptions + * @return {Promise} + */ async requestPort(options, polyfillOptions) { + polyfillOptions = Object.assign(Object.assign({}, $d2bbb828b377f05f$var$kDefaultPolyfillOptions), polyfillOptions); + const usbFilters = []; + if (options && options.filters) for (const filter of options.filters){ + const usbFilter = { + classCode: polyfillOptions.usbControlInterfaceClass + }; + if (filter.usbVendorId !== undefined) usbFilter.vendorId = filter.usbVendorId; + if (filter.usbProductId !== undefined) usbFilter.productId = filter.usbProductId; + usbFilters.push(usbFilter); + } + if (usbFilters.length === 0) usbFilters.push({ + classCode: polyfillOptions.usbControlInterfaceClass + }); + const device = await navigator.usb.requestDevice({ + "filters": usbFilters + }); + const port = new $d2bbb828b377f05f$export$237d90817cb05a2f(device, polyfillOptions); + return port; + } + /** + * Get the set of currently available ports. + * + * @param {SerialPolyfillOptions} polyfillOptions Polyfill configuration that + * should be applied to these ports. + * @return {Promise} a promise that is resolved with a list of + * ports. + */ async getPorts(polyfillOptions) { + polyfillOptions = Object.assign(Object.assign({}, $d2bbb828b377f05f$var$kDefaultPolyfillOptions), polyfillOptions); + const devices = await navigator.usb.getDevices(); + const ports = []; + devices.forEach((device)=>{ + try { + const port = new $d2bbb828b377f05f$export$237d90817cb05a2f(device, polyfillOptions); + ports.push(port); + } catch (e) { + // Skip unrecognized port. + } + }); + return ports; + } +} +const $d2bbb828b377f05f$export$6c2c9a00e27c07e8 = new $d2bbb828b377f05f$var$Serial(); + + +const $382e02c9bbd5d50b$var$baudrates = document.getElementById("baudrates"); +const $382e02c9bbd5d50b$var$connectButton = document.getElementById("connectButton"); +const $382e02c9bbd5d50b$var$traceButton = document.getElementById("copyTraceButton"); +const $382e02c9bbd5d50b$var$disconnectButton = document.getElementById("disconnectButton"); +const $382e02c9bbd5d50b$var$resetButton = document.getElementById("resetButton"); +const $382e02c9bbd5d50b$var$eraseButton = document.getElementById("eraseButton"); +const $382e02c9bbd5d50b$var$programButton = document.getElementById("programButton"); +const $382e02c9bbd5d50b$var$filesDiv = document.getElementById("files"); +const $382e02c9bbd5d50b$var$terminal = document.getElementById("terminal"); +const $382e02c9bbd5d50b$var$programDiv = document.getElementById("program"); +const $382e02c9bbd5d50b$var$lblBaudrate = document.getElementById("lblBaudrate"); +const $382e02c9bbd5d50b$var$lblConnTo = document.getElementById("lblConnTo"); +const $382e02c9bbd5d50b$var$table = document.getElementById("fileTable"); +if (!navigator.serial && navigator.usb) navigator.serial = (0, $d2bbb828b377f05f$export$6c2c9a00e27c07e8); +const $382e02c9bbd5d50b$var$term = new Terminal({ + cols: 120, + rows: 40 +}); +$382e02c9bbd5d50b$var$term.open($382e02c9bbd5d50b$var$terminal); +let $382e02c9bbd5d50b$var$device = null; +let $382e02c9bbd5d50b$var$transport; +let $382e02c9bbd5d50b$var$chip = null; +let $382e02c9bbd5d50b$var$esploader; +const $382e02c9bbd5d50b$var$fileArray = []; +$382e02c9bbd5d50b$var$disconnectButton.style.display = "none"; +$382e02c9bbd5d50b$var$traceButton.style.display = "none"; +$382e02c9bbd5d50b$var$eraseButton.style.display = "none"; +$382e02c9bbd5d50b$var$resetButton.style.display = "none"; +$382e02c9bbd5d50b$var$filesDiv.style.display = "none"; +const $382e02c9bbd5d50b$var$espLoaderTerminal = { + clean () { + $382e02c9bbd5d50b$var$term.clear(); + }, + writeLine (data) { + $382e02c9bbd5d50b$var$term.writeln(data); + }, + write (data) { + $382e02c9bbd5d50b$var$term.write(data); + } +}; +function $382e02c9bbd5d50b$var$cleanUp() { + $382e02c9bbd5d50b$var$device = null; + $382e02c9bbd5d50b$var$transport = null; + $382e02c9bbd5d50b$var$chip = null; +} +$382e02c9bbd5d50b$var$traceButton.onclick = async ()=>{ + if ($382e02c9bbd5d50b$var$transport) $382e02c9bbd5d50b$var$transport.returnTrace(); +}; +$382e02c9bbd5d50b$var$resetButton.onclick = async ()=>{ + if ($382e02c9bbd5d50b$var$transport) { + await $382e02c9bbd5d50b$var$transport.setDTR(false); + await new Promise((resolve)=>setTimeout(resolve, 100)); + await $382e02c9bbd5d50b$var$transport.setDTR(true); + } +}; +$382e02c9bbd5d50b$var$eraseButton.onclick = async ()=>{ + $382e02c9bbd5d50b$var$eraseButton.disabled = true; + try { + await $382e02c9bbd5d50b$var$esploader.eraseFlash(); + } catch (e) { + console.error(e); + $382e02c9bbd5d50b$var$term.writeln(`Error: ${e.message}`); + } finally{ + $382e02c9bbd5d50b$var$eraseButton.disabled = false; + } +}; +$382e02c9bbd5d50b$var$connectButton.onclick = async ()=>{ + if ($382e02c9bbd5d50b$var$device === null) { + $382e02c9bbd5d50b$var$device = await navigator.serial.requestPort({}); + $382e02c9bbd5d50b$var$transport = new (0, $ec3de3bad43fb783$export$86495b081fef8e52)($382e02c9bbd5d50b$var$device, true); + } + try { + const flashOptions = { + transport: $382e02c9bbd5d50b$var$transport, + baudrate: parseInt($382e02c9bbd5d50b$var$baudrates.value), + terminal: $382e02c9bbd5d50b$var$espLoaderTerminal + }; + $382e02c9bbd5d50b$var$esploader = new (0, $ec3de3bad43fb783$export$b0f7a6c745790308)(flashOptions); + $382e02c9bbd5d50b$var$lblBaudrate.style.display = "none"; + $382e02c9bbd5d50b$var$baudrates.style.display = "none"; + $382e02c9bbd5d50b$var$connectButton.style.display = "none"; + $382e02c9bbd5d50b$var$chip = await $382e02c9bbd5d50b$var$esploader.main(); + if (!$382e02c9bbd5d50b$var$chip.startsWith("ESP32-C6")) { + $382e02c9bbd5d50b$var$term.writeln("Error! Wrong chip connected. Expected is ESP32-C6"); + await $382e02c9bbd5d50b$var$transport.disconnect(); + $382e02c9bbd5d50b$var$cleanUp(); + $382e02c9bbd5d50b$var$lblBaudrate.style.display = "initial"; + $382e02c9bbd5d50b$var$baudrates.style.display = "initial"; + $382e02c9bbd5d50b$var$connectButton.style.display = "initial"; + return; + } + } catch (e) { + console.error(e); + $382e02c9bbd5d50b$var$term.writeln(""); + $382e02c9bbd5d50b$var$term.writeln(`Error: ${e.message}`); + await $382e02c9bbd5d50b$var$transport.disconnect(); + $382e02c9bbd5d50b$var$cleanUp(); + $382e02c9bbd5d50b$var$lblBaudrate.style.display = "initial"; + $382e02c9bbd5d50b$var$baudrates.style.display = "initial"; + $382e02c9bbd5d50b$var$connectButton.style.display = "initial"; + return; + } + console.log("Settings done for :" + $382e02c9bbd5d50b$var$chip); + $382e02c9bbd5d50b$var$lblBaudrate.style.display = "none"; + $382e02c9bbd5d50b$var$baudrates.style.display = "none"; + $382e02c9bbd5d50b$var$lblConnTo.innerHTML = "Connected to device: " + $382e02c9bbd5d50b$var$chip; + $382e02c9bbd5d50b$var$lblConnTo.style.display = "block"; + $382e02c9bbd5d50b$var$connectButton.style.display = "none"; + $382e02c9bbd5d50b$var$disconnectButton.style.display = "initial"; + $382e02c9bbd5d50b$var$traceButton.style.display = "initial"; + $382e02c9bbd5d50b$var$eraseButton.style.display = "initial"; + $382e02c9bbd5d50b$var$filesDiv.style.display = "initial"; +}; +$382e02c9bbd5d50b$var$disconnectButton.onclick = async ()=>{ + if ($382e02c9bbd5d50b$var$transport) await $382e02c9bbd5d50b$var$transport.disconnect(); + $382e02c9bbd5d50b$var$term.reset(); + $382e02c9bbd5d50b$var$lblBaudrate.style.display = "initial"; + $382e02c9bbd5d50b$var$baudrates.style.display = "initial"; + $382e02c9bbd5d50b$var$connectButton.style.display = "initial"; + $382e02c9bbd5d50b$var$disconnectButton.style.display = "none"; + $382e02c9bbd5d50b$var$traceButton.style.display = "none"; + $382e02c9bbd5d50b$var$eraseButton.style.display = "none"; + $382e02c9bbd5d50b$var$lblConnTo.style.display = "none"; + $382e02c9bbd5d50b$var$filesDiv.style.display = "none"; + $382e02c9bbd5d50b$var$programButton.style.display = "initial"; + $382e02c9bbd5d50b$var$resetButton.style.display = "none"; + for(let index = 1; index < $382e02c9bbd5d50b$var$table.rows.length; index++)$382e02c9bbd5d50b$var$table.rows[index].cells[3].childNodes[0].value = "0"; + $382e02c9bbd5d50b$var$cleanUp(); +}; +$382e02c9bbd5d50b$var$programButton.onclick = async ()=>{ + const progressBars = []; + for(let index = 1; index < $382e02c9bbd5d50b$var$table.rows.length; index++){ + const row = $382e02c9bbd5d50b$var$table.rows[index]; + const progressBar = row.cells[3].childNodes[0]; + progressBar.textContent = "0"; + progressBars.push(progressBar); + } + try { + const flashOptions = { + fileArray: $382e02c9bbd5d50b$var$fileArray, + eraseAll: false, + compress: true, + flashSize: "keep", + flashFreq: "80MHz", + flashMode: "DIO", + reportProgress: (fileIndex, written, total)=>{ + progressBars[fileIndex].value = written / total * 100; + }, + calculateMD5Hash: (image)=>CryptoJS.MD5(CryptoJS.enc.Latin1.parse(image)) + }; + $382e02c9bbd5d50b$var$programButton.style.display = "none"; + $382e02c9bbd5d50b$var$eraseButton.style.display = "none"; + await $382e02c9bbd5d50b$var$esploader.writeFlash(flashOptions); + } catch (e) { + console.error(e); + $382e02c9bbd5d50b$var$programButton.style.display = "initial"; + $382e02c9bbd5d50b$var$term.writeln(`Error: ${e.message}`); + } finally{ + // Switch to console + await $382e02c9bbd5d50b$var$transport.disconnect(); + await $382e02c9bbd5d50b$var$transport.connect(115200); + await $382e02c9bbd5d50b$var$transport.setDTR(false); + await new Promise((resolve)=>setTimeout(resolve, 100)); + await $382e02c9bbd5d50b$var$transport.setDTR(true); + $382e02c9bbd5d50b$var$resetButton.style.display = "initial"; + while(true){ + const val = await $382e02c9bbd5d50b$var$transport.rawRead(); + if (typeof val !== "undefined") $382e02c9bbd5d50b$var$term.write(val); + else { + console.log("Leaving monitor"); + break; + } + } + } +}; +// addFileButton.onclick = () => { +function $382e02c9bbd5d50b$var$addFileRow(addr, path, size) { + const rowCount = $382e02c9bbd5d50b$var$table.rows.length; + const row = $382e02c9bbd5d50b$var$table.insertRow(rowCount); + //Column 1 - Offset + const cell1 = row.insertCell(0); + const element1 = document.createElement("span"); + element1.innerHTML = addr; + cell1.appendChild(element1); + // Column 2 - File selector + const cell2 = row.insertCell(1); + const element2 = document.createElement("span"); + element2.innerHTML = path; + cell2.appendChild(element2); + // Column 3 - File Size + const cell3 = row.insertCell(2); + const element3 = document.createElement("span"); + element3.innerHTML = size + " B"; + cell3.appendChild(element3); + // Column 4 - Progress + const cell4 = row.insertCell(3); + cell4.classList.add("progress-cell"); + cell4.innerHTML = ``; +} +function $382e02c9bbd5d50b$var$addFileForFlashing(outArray, addr, path) { + console.log("load", addr, path); + var request = new XMLHttpRequest(); + request.open("GET", path, true); + request.responseType = "blob"; + request.onload = function() { + console.log("blob", addr, path, request.response); + var size = request.response.size; + var reader = new FileReader(); + reader.onload = function(e) { + outArray.push({ + data: e.target.result, + address: parseInt(addr) + }); + console.log("push", addr, path); + $382e02c9bbd5d50b$var$addFileRow(addr, path, size); + }; + reader.readAsBinaryString(request.response); + }; + request.send(); +} +$382e02c9bbd5d50b$var$addFileForFlashing($382e02c9bbd5d50b$var$fileArray, "0x0", "bootloader.bin"); +$382e02c9bbd5d50b$var$addFileForFlashing($382e02c9bbd5d50b$var$fileArray, "0x8000", "partition-table.bin"); +$382e02c9bbd5d50b$var$addFileForFlashing($382e02c9bbd5d50b$var$fileArray, "0xd000", "ota_data_initial.bin"); +$382e02c9bbd5d50b$var$addFileForFlashing($382e02c9bbd5d50b$var$fileArray, "0x10000", "network_adapter.bin"); + + +//# sourceMappingURL=index.82fa246c.js.map diff --git a/c6-hosted/index.82fa246c.js.map b/c6-hosted/index.82fa246c.js.map new file mode 100644 index 00000000000..13f35cd9afc --- /dev/null +++ b/c6-hosted/index.82fa246c.js.map @@ -0,0 +1 @@ +{"mappings":"ACAA,MAAM,gCAAU;AAAM;AACtB,sEAAsE,GAAE,SAAS,wBAAE,CAAC;IAAE,IAAI,IAAE,EAAE,MAAM;IAAC,MAAK,EAAE,KAAG,GAAG,CAAC,CAAC,EAAE,GAAC;AAAC;AAAC,MAAM,0BAAE,KAAI,0BAAE,KAAI,0BAAE,IAAG,0BAAE,IAAG,0BAAE,IAAI,WAAW;IAAC;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;CAAE,GAAE,0BAAE,IAAI,WAAW;IAAC;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;CAAG,GAAE,0BAAE,IAAI,WAAW;IAAC;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;CAAE,GAAE,0BAAE,IAAI,WAAW;IAAC;IAAG;IAAG;IAAG;IAAE;IAAE;IAAE;IAAE;IAAE;IAAG;IAAE;IAAG;IAAE;IAAG;IAAE;IAAG;IAAE;IAAG;IAAE;CAAG,GAAE,0BAAE,IAAI,MAAM;AAAK,wBAAE;AAAG,MAAM,0BAAE,IAAI,MAAM;AAAI,wBAAE;AAAG,MAAM,0BAAE,IAAI,MAAM;AAAK,wBAAE;AAAG,MAAM,0BAAE,IAAI,MAAM;AAAK,wBAAE;AAAG,MAAM,0BAAE,IAAI,MAAM;AAAI,wBAAE;AAAG,MAAM,0BAAE,IAAI,MAAM;AAAG,SAAS,wBAAE,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC;IAAE,IAAI,CAAC,WAAW,GAAC,GAAE,IAAI,CAAC,UAAU,GAAC,GAAE,IAAI,CAAC,UAAU,GAAC,GAAE,IAAI,CAAC,KAAK,GAAC,GAAE,IAAI,CAAC,UAAU,GAAC,GAAE,IAAI,CAAC,SAAS,GAAC,KAAG,EAAE,MAAM;AAAA;AAAC,IAAI,yBAAE,yBAAE;AAAE,SAAS,wBAAE,CAAC,EAAC,CAAC;IAAE,IAAI,CAAC,QAAQ,GAAC,GAAE,IAAI,CAAC,QAAQ,GAAC,GAAE,IAAI,CAAC,SAAS,GAAC;AAAC;AAAC,wBAAE;AAAG,MAAM,0BAAE,CAAA,IAAG,IAAE,MAAI,uBAAC,CAAC,EAAE,GAAC,uBAAC,CAAC,MAAK,CAAA,MAAI,CAAA,EAAG,EAAC,0BAAE,CAAC,GAAE;IAAK,EAAE,WAAW,CAAC,EAAE,OAAO,GAAG,GAAC,MAAI,GAAE,EAAE,WAAW,CAAC,EAAE,OAAO,GAAG,GAAC,MAAI,IAAE;AAAG,GAAE,0BAAE,CAAC,GAAE,GAAE;IAAK,EAAE,QAAQ,GAAC,KAAG,IAAG,CAAA,EAAE,MAAM,IAAE,KAAG,EAAE,QAAQ,GAAC,OAAM,wBAAE,GAAE,EAAE,MAAM,GAAE,EAAE,MAAM,GAAC,KAAG,KAAG,EAAE,QAAQ,EAAC,EAAE,QAAQ,IAAE,IAAE,EAAC,IAAI,CAAA,EAAE,MAAM,IAAE,KAAG,EAAE,QAAQ,GAAC,OAAM,EAAE,QAAQ,IAAE,CAAA;AAAE,GAAE,0BAAE,CAAC,GAAE,GAAE;IAAK,wBAAE,GAAE,CAAC,CAAC,IAAE,EAAE,EAAC,CAAC,CAAC,IAAE,IAAE,EAAE;AAAC,GAAE,0BAAE,CAAC,GAAE;IAAK,IAAI,IAAE;IAAE,GAAG,KAAG,IAAE,GAAE,OAAK,GAAE,MAAI;WAAQ,EAAE,IAAE,GAAG;IAAA,OAAO,MAAI;AAAC,GAAE,0BAAE,CAAC,GAAE,GAAE;IAAK,MAAM,IAAE,IAAI,MAAM;IAAI,IAAI,GAAE,GAAE,IAAE;IAAE,IAAI,IAAE,GAAE,KAAG,yBAAE,IAAI,IAAE,IAAE,CAAC,CAAC,IAAE,EAAE,IAAE,GAAE,CAAC,CAAC,EAAE,GAAC;IAAE,IAAI,IAAE,GAAE,KAAG,GAAE,IAAI;QAAC,IAAI,IAAE,CAAC,CAAC,IAAE,IAAE,EAAE;QAAC,MAAI,KAAI,CAAA,CAAC,CAAC,IAAE,EAAE,GAAC,wBAAE,CAAC,CAAC,EAAE,IAAG,EAAC;IAAE;AAAC,GAAE,0BAAE,CAAA;IAAI,IAAI;IAAE,IAAI,IAAE,GAAE,IAAE,yBAAE,IAAI,EAAE,SAAS,CAAC,IAAE,EAAE,GAAC;IAAE,IAAI,IAAE,GAAE,IAAE,yBAAE,IAAI,EAAE,SAAS,CAAC,IAAE,EAAE,GAAC;IAAE,IAAI,IAAE,GAAE,IAAE,IAAG,IAAI,EAAE,OAAO,CAAC,IAAE,EAAE,GAAC;IAAE,EAAE,SAAS,CAAC,IAAI,GAAC,GAAE,EAAE,OAAO,GAAC,EAAE,UAAU,GAAC,GAAE,EAAE,QAAQ,GAAC,EAAE,OAAO,GAAC;AAAC,GAAE,0BAAE,CAAA;IAAI,EAAE,QAAQ,GAAC,IAAE,wBAAE,GAAE,EAAE,MAAM,IAAE,EAAE,QAAQ,GAAC,KAAI,CAAA,EAAE,WAAW,CAAC,EAAE,OAAO,GAAG,GAAC,EAAE,MAAM,AAAD,GAAG,EAAE,MAAM,GAAC,GAAE,EAAE,QAAQ,GAAC;AAAC,GAAE,0BAAE,CAAC,GAAE,GAAE,GAAE;IAAK,MAAM,IAAE,IAAE,GAAE,IAAE,IAAE;IAAE,OAAO,CAAC,CAAC,EAAE,GAAC,CAAC,CAAC,EAAE,IAAE,CAAC,CAAC,EAAE,KAAG,CAAC,CAAC,EAAE,IAAE,CAAC,CAAC,EAAE,IAAE,CAAC,CAAC,EAAE;AAAA,GAAE,0BAAE,CAAC,GAAE,GAAE;IAAK,MAAM,IAAE,EAAE,IAAI,CAAC,EAAE;IAAC,IAAI,IAAE,KAAG;IAAE,MAAK,KAAG,EAAE,QAAQ,IAAG,CAAA,IAAE,EAAE,QAAQ,IAAE,wBAAE,GAAE,EAAE,IAAI,CAAC,IAAE,EAAE,EAAC,EAAE,IAAI,CAAC,EAAE,EAAC,EAAE,KAAK,KAAG,KAAI,CAAC,wBAAE,GAAE,GAAE,EAAE,IAAI,CAAC,EAAE,EAAC,EAAE,KAAK,CAAA,GAAI,EAAE,IAAI,CAAC,EAAE,GAAC,EAAE,IAAI,CAAC,EAAE,EAAC,IAAE,GAAE,MAAI;IAAE,EAAE,IAAI,CAAC,EAAE,GAAC;AAAC,GAAE,0BAAE,CAAC,GAAE,GAAE;IAAK,IAAI,GAAE,GAAE,GAAE,GAAE,IAAE;IAAE,IAAG,MAAI,EAAE,QAAQ,EAAC,GAAG,IAAE,MAAI,EAAE,WAAW,CAAC,EAAE,OAAO,GAAC,IAAI,EAAC,KAAG,AAAC,CAAA,MAAI,EAAE,WAAW,CAAC,EAAE,OAAO,GAAC,IAAI,AAAD,KAAI,GAAE,IAAE,EAAE,WAAW,CAAC,EAAE,OAAO,GAAC,IAAI,EAAC,MAAI,IAAE,wBAAE,GAAE,GAAE,KAAI,CAAA,IAAE,uBAAC,CAAC,EAAE,EAAC,wBAAE,GAAE,IAAE,0BAAE,GAAE,IAAG,IAAE,uBAAC,CAAC,EAAE,EAAC,MAAI,KAAI,CAAA,KAAG,uBAAC,CAAC,EAAE,EAAC,wBAAE,GAAE,GAAE,EAAC,GAAG,KAAI,IAAE,wBAAE,IAAG,wBAAE,GAAE,GAAE,IAAG,IAAE,uBAAC,CAAC,EAAE,EAAC,MAAI,KAAI,CAAA,KAAG,uBAAC,CAAC,EAAE,EAAC,wBAAE,GAAE,GAAE,EAAC,CAAC;WAAS,IAAE,EAAE,QAAQ,EAAE;IAAA,wBAAE,GAAE,KAAI;AAAE,GAAE,0BAAE,CAAC,GAAE;IAAK,MAAM,IAAE,EAAE,QAAQ,EAAC,IAAE,EAAE,SAAS,CAAC,WAAW,EAAC,IAAE,EAAE,SAAS,CAAC,SAAS,EAAC,IAAE,EAAE,SAAS,CAAC,KAAK;IAAC,IAAI,GAAE,GAAE,GAAE,IAAE;IAAG,IAAI,EAAE,QAAQ,GAAC,GAAE,EAAE,QAAQ,GAAC,KAAI,IAAE,GAAE,IAAE,GAAE,IAAI,MAAI,CAAC,CAAC,IAAE,EAAE,GAAE,CAAA,EAAE,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,GAAC,IAAE,GAAE,EAAE,KAAK,CAAC,EAAE,GAAC,CAAA,IAAG,CAAC,CAAC,IAAE,IAAE,EAAE,GAAC;IAAE,MAAK,EAAE,QAAQ,GAAC,GAAG,IAAE,EAAE,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,GAAC,IAAE,IAAE,EAAE,IAAE,GAAE,CAAC,CAAC,IAAE,EAAE,GAAC,GAAE,EAAE,KAAK,CAAC,EAAE,GAAC,GAAE,EAAE,OAAO,IAAG,KAAI,CAAA,EAAE,UAAU,IAAE,CAAC,CAAC,IAAE,IAAE,EAAE,AAAD;IAAG,IAAI,EAAE,QAAQ,GAAC,GAAE,IAAE,EAAE,QAAQ,IAAE,GAAE,KAAG,GAAE,IAAI,wBAAE,GAAE,GAAE;IAAG,IAAE;IAAE,GAAG,IAAE,EAAE,IAAI,CAAC,EAAE,EAAC,EAAE,IAAI,CAAC,EAAE,GAAC,EAAE,IAAI,CAAC,EAAE,QAAQ,GAAG,EAAC,wBAAE,GAAE,GAAE,IAAG,IAAE,EAAE,IAAI,CAAC,EAAE,EAAC,EAAE,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,GAAC,GAAE,EAAE,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,GAAC,GAAE,CAAC,CAAC,IAAE,EAAE,GAAC,CAAC,CAAC,IAAE,EAAE,GAAC,CAAC,CAAC,IAAE,EAAE,EAAC,EAAE,KAAK,CAAC,EAAE,GAAC,AAAC,CAAA,EAAE,KAAK,CAAC,EAAE,IAAE,EAAE,KAAK,CAAC,EAAE,GAAC,EAAE,KAAK,CAAC,EAAE,GAAC,EAAE,KAAK,CAAC,EAAE,AAAD,IAAG,GAAE,CAAC,CAAC,IAAE,IAAE,EAAE,GAAC,CAAC,CAAC,IAAE,IAAE,EAAE,GAAC,GAAE,EAAE,IAAI,CAAC,EAAE,GAAC,KAAI,wBAAE,GAAE,GAAE;WAAS,EAAE,QAAQ,IAAE,GAAG;IAAA,EAAE,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,GAAC,EAAE,IAAI,CAAC,EAAE,EAAC,AAAC,CAAA,CAAC,GAAE;QAAK,MAAM,IAAE,EAAE,QAAQ,EAAC,IAAE,EAAE,QAAQ,EAAC,IAAE,EAAE,SAAS,CAAC,WAAW,EAAC,IAAE,EAAE,SAAS,CAAC,SAAS,EAAC,IAAE,EAAE,SAAS,CAAC,UAAU,EAAC,IAAE,EAAE,SAAS,CAAC,UAAU,EAAC,IAAE,EAAE,SAAS,CAAC,UAAU;QAAC,IAAI,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,IAAE;QAAE,IAAI,IAAE,GAAE,KAAG,yBAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,GAAC;QAAE,IAAI,CAAC,CAAC,IAAE,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,GAAC,EAAE,GAAC,GAAE,IAAE,EAAE,QAAQ,GAAC,GAAE,IAAE,KAAI,IAAI,IAAE,EAAE,IAAI,CAAC,EAAE,EAAC,IAAE,CAAC,CAAC,IAAE,CAAC,CAAC,IAAE,IAAE,EAAE,GAAC,EAAE,GAAC,GAAE,IAAE,KAAI,CAAA,IAAE,GAAE,GAAE,GAAG,CAAC,CAAC,IAAE,IAAE,EAAE,GAAC,GAAE,IAAE,KAAI,CAAA,EAAE,QAAQ,CAAC,EAAE,IAAG,IAAE,GAAE,KAAG,KAAI,CAAA,IAAE,CAAC,CAAC,IAAE,EAAE,AAAD,GAAG,IAAE,CAAC,CAAC,IAAE,EAAE,EAAC,EAAE,OAAO,IAAE,IAAG,CAAA,IAAE,CAAA,GAAG,KAAI,CAAA,EAAE,UAAU,IAAE,IAAG,CAAA,CAAC,CAAC,IAAE,IAAE,EAAE,GAAC,CAAA,CAAC,CAAC;QAAG,IAAG,MAAI,GAAE;YAAC,GAAE;gBAAC,IAAI,IAAE,IAAE,GAAE,MAAI,EAAE,QAAQ,CAAC,EAAE,EAAE;gBAAI,EAAE,QAAQ,CAAC,EAAE,IAAG,EAAE,QAAQ,CAAC,IAAE,EAAE,IAAE,GAAE,EAAE,QAAQ,CAAC,EAAE,IAAG,KAAG;YAAC,QAAO,IAAE,GAAG;YAAA,IAAI,IAAE,GAAE,MAAI,GAAE,IAAI,IAAI,IAAE,EAAE,QAAQ,CAAC,EAAE,EAAC,MAAI,GAAG,IAAE,EAAE,IAAI,CAAC,EAAE,EAAE,EAAC,IAAE,KAAI,CAAA,CAAC,CAAC,IAAE,IAAE,EAAE,KAAG,KAAI,CAAA,EAAE,OAAO,IAAE,AAAC,CAAA,IAAE,CAAC,CAAC,IAAE,IAAE,EAAE,AAAD,IAAG,CAAC,CAAC,IAAE,EAAE,EAAC,CAAC,CAAC,IAAE,IAAE,EAAE,GAAC,CAAA,GAAG,GAAE;QAAE;IAAC,CAAA,EAAG,GAAE,IAAG,wBAAE,GAAE,GAAE,EAAE,QAAQ;AAAC,GAAE,0BAAE,CAAC,GAAE,GAAE;IAAK,IAAI,GAAE,GAAE,IAAE,IAAG,IAAE,CAAC,CAAC,EAAE,EAAC,IAAE,GAAE,IAAE,GAAE,IAAE;IAAE,IAAI,MAAI,KAAI,CAAA,IAAE,KAAI,IAAE,CAAA,GAAG,CAAC,CAAC,IAAG,CAAA,IAAE,CAAA,IAAG,EAAE,GAAC,OAAM,IAAE,GAAE,KAAG,GAAE,IAAI,IAAE,GAAE,IAAE,CAAC,CAAC,IAAG,CAAA,IAAE,CAAA,IAAG,EAAE,EAAC,EAAE,IAAE,KAAG,MAAI,KAAI,CAAA,IAAE,IAAE,EAAE,OAAO,CAAC,IAAE,EAAE,IAAE,IAAE,MAAI,IAAG,CAAA,MAAI,KAAG,EAAE,OAAO,CAAC,IAAE,EAAE,IAAG,EAAE,OAAO,CAAC,GAAG,EAAC,IAAG,KAAG,KAAG,EAAE,OAAO,CAAC,GAAG,KAAG,EAAE,OAAO,CAAC,GAAG,IAAG,IAAE,GAAE,IAAE,GAAE,MAAI,IAAG,CAAA,IAAE,KAAI,IAAE,CAAA,IAAG,MAAI,IAAG,CAAA,IAAE,GAAE,IAAE,CAAA,IAAI,CAAA,IAAE,GAAE,IAAE,CAAA,CAAC;AAAE,GAAE,0BAAE,CAAC,GAAE,GAAE;IAAK,IAAI,GAAE,GAAE,IAAE,IAAG,IAAE,CAAC,CAAC,EAAE,EAAC,IAAE,GAAE,IAAE,GAAE,IAAE;IAAE,IAAI,MAAI,KAAI,CAAA,IAAE,KAAI,IAAE,CAAA,GAAG,IAAE,GAAE,KAAG,GAAE,IAAI,IAAG,IAAE,GAAE,IAAE,CAAC,CAAC,IAAG,CAAA,IAAE,CAAA,IAAG,EAAE,EAAC,CAAE,CAAA,EAAE,IAAE,KAAG,MAAI,CAAA,GAAG;QAAC,IAAG,IAAE,GAAE,GAAG,wBAAE,GAAE,GAAE,EAAE,OAAO;eAAQ,KAAG,EAAE,GAAG;aAAK,MAAI,IAAG,CAAA,MAAI,KAAI,CAAA,wBAAE,GAAE,GAAE,EAAE,OAAO,GAAE,GAAE,GAAG,wBAAE,GAAE,IAAG,EAAE,OAAO,GAAE,wBAAE,GAAE,IAAE,GAAE,EAAC,IAAG,KAAG,KAAI,CAAA,wBAAE,GAAE,IAAG,EAAE,OAAO,GAAE,wBAAE,GAAE,IAAE,GAAE,EAAC,IAAI,CAAA,wBAAE,GAAE,IAAG,EAAE,OAAO,GAAE,wBAAE,GAAE,IAAE,IAAG,EAAC;QAAG,IAAE,GAAE,IAAE,GAAE,MAAI,IAAG,CAAA,IAAE,KAAI,IAAE,CAAA,IAAG,MAAI,IAAG,CAAA,IAAE,GAAE,IAAE,CAAA,IAAI,CAAA,IAAE,GAAE,IAAE,CAAA;IAAE;AAAC;AAAE,IAAI,0BAAE,CAAC;AAAE,MAAM,0BAAE,CAAC,GAAE,GAAE,GAAE;IAAK,wBAAE,GAAE,IAAG,CAAA,IAAE,IAAE,CAAA,GAAG,IAAG,wBAAE,IAAG,wBAAE,GAAE,IAAG,wBAAE,GAAE,CAAC,IAAG,KAAG,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAE,IAAE,IAAG,EAAE,OAAO,GAAE,EAAE,OAAO,IAAE;AAAC;AAAE,IAAI,0BAAE,CAAC,GAAE,GAAE,GAAE;IAAK,IAAI,GAAE,GAAE,IAAE;IAAE,EAAE,KAAK,GAAC,IAAG,CAAA,MAAI,EAAE,IAAI,CAAC,SAAS,IAAG,CAAA,EAAE,IAAI,CAAC,SAAS,GAAC,AAAC,CAAA,CAAA;QAAI,IAAI,GAAE,IAAE;QAAW,IAAI,IAAE,GAAE,KAAG,IAAG,KAAI,OAAK,EAAE,IAAG,IAAE,KAAG,MAAI,EAAE,SAAS,CAAC,IAAE,EAAE,EAAC,OAAO;QAAE,IAAG,MAAI,EAAE,SAAS,CAAC,GAAG,IAAE,MAAI,EAAE,SAAS,CAAC,GAAG,IAAE,MAAI,EAAE,SAAS,CAAC,GAAG,EAAC,OAAO;QAAE,IAAI,IAAE,IAAG,IAAE,yBAAE,IAAI,IAAG,MAAI,EAAE,SAAS,CAAC,IAAE,EAAE,EAAC,OAAO;QAAE,OAAO;IAAC,CAAA,EAAG,EAAC,GAAG,wBAAE,GAAE,EAAE,MAAM,GAAE,wBAAE,GAAE,EAAE,MAAM,GAAE,IAAE,AAAC,CAAA,CAAA;QAAI,IAAI;QAAE,IAAI,wBAAE,GAAE,EAAE,SAAS,EAAC,EAAE,MAAM,CAAC,QAAQ,GAAE,wBAAE,GAAE,EAAE,SAAS,EAAC,EAAE,MAAM,CAAC,QAAQ,GAAE,wBAAE,GAAE,EAAE,OAAO,GAAE,IAAE,IAAG,KAAG,KAAG,MAAI,EAAE,OAAO,CAAC,IAAE,uBAAC,CAAC,EAAE,GAAC,EAAE,EAAC;QAAK,OAAO,EAAE,OAAO,IAAE,IAAG,CAAA,IAAE,CAAA,IAAG,IAAE,IAAE,GAAE;IAAC,CAAA,EAAG,IAAG,IAAE,EAAE,OAAO,GAAC,IAAE,MAAI,GAAE,IAAE,EAAE,UAAU,GAAC,IAAE,MAAI,GAAE,KAAG,KAAI,CAAA,IAAE,CAAA,CAAC,IAAG,IAAE,IAAE,IAAE,GAAE,IAAE,KAAG,KAAG,OAAK,IAAE,wBAAE,GAAE,GAAE,GAAE,KAAG,MAAI,EAAE,QAAQ,IAAE,MAAI,IAAG,CAAA,wBAAE,GAAE,IAAG,CAAA,IAAE,IAAE,CAAA,GAAG,IAAG,wBAAE,GAAE,yBAAE,wBAAC,IAAI,CAAA,wBAAE,GAAE,IAAG,CAAA,IAAE,IAAE,CAAA,GAAG,IAAG,AAAC,CAAA,CAAC,GAAE,GAAE,GAAE;QAAK,IAAI;QAAE,IAAI,wBAAE,GAAE,IAAE,KAAI,IAAG,wBAAE,GAAE,IAAE,GAAE,IAAG,wBAAE,GAAE,IAAE,GAAE,IAAG,IAAE,GAAE,IAAE,GAAE,IAAI,wBAAE,GAAE,EAAE,OAAO,CAAC,IAAE,uBAAC,CAAC,EAAE,GAAC,EAAE,EAAC;QAAG,wBAAE,GAAE,EAAE,SAAS,EAAC,IAAE,IAAG,wBAAE,GAAE,EAAE,SAAS,EAAC,IAAE;IAAE,CAAA,EAAG,GAAE,EAAE,MAAM,CAAC,QAAQ,GAAC,GAAE,EAAE,MAAM,CAAC,QAAQ,GAAC,GAAE,IAAE,IAAG,wBAAE,GAAE,EAAE,SAAS,EAAC,EAAE,SAAS,CAAA,GAAG,wBAAE,IAAG,KAAG,wBAAE;AAAE,GAAE,0BAAE;IAAC,UAAS,CAAA;QAAI,2BAAI,CAAA,AAAC,CAAA;YAAK,IAAI,GAAE,GAAE,GAAE,GAAE;YAAE,MAAM,IAAE,IAAI,MAAM;YAAI,IAAI,IAAE,GAAE,IAAE,GAAE,IAAE,IAAG,IAAI,IAAI,uBAAC,CAAC,EAAE,GAAC,GAAE,IAAE,GAAE,IAAE,KAAG,uBAAC,CAAC,EAAE,EAAC,IAAI,uBAAC,CAAC,IAAI,GAAC;YAAE,IAAI,uBAAC,CAAC,IAAE,EAAE,GAAC,GAAE,IAAE,GAAE,IAAE,GAAE,IAAE,IAAG,IAAI,IAAI,uBAAC,CAAC,EAAE,GAAC,GAAE,IAAE,GAAE,IAAE,KAAG,uBAAC,CAAC,EAAE,EAAC,IAAI,uBAAC,CAAC,IAAI,GAAC;YAAE,IAAI,MAAI,GAAE,IAAE,yBAAE,IAAI,IAAI,uBAAC,CAAC,EAAE,GAAC,KAAG,GAAE,IAAE,GAAE,IAAE,KAAG,uBAAC,CAAC,EAAE,GAAC,GAAE,IAAI,uBAAC,CAAC,MAAI,IAAI,GAAC;YAAE,IAAI,IAAE,GAAE,KAAG,yBAAE,IAAI,CAAC,CAAC,EAAE,GAAC;YAAE,IAAI,IAAE,GAAE,KAAG,KAAK,uBAAC,CAAC,IAAE,IAAE,EAAE,GAAC,GAAE,KAAI,CAAC,CAAC,EAAE;YAAG,MAAK,KAAG,KAAK,uBAAC,CAAC,IAAE,IAAE,EAAE,GAAC,GAAE,KAAI,CAAC,CAAC,EAAE;YAAG,MAAK,KAAG,KAAK,uBAAC,CAAC,IAAE,IAAE,EAAE,GAAC,GAAE,KAAI,CAAC,CAAC,EAAE;YAAG,MAAK,KAAG,KAAK,uBAAC,CAAC,IAAE,IAAE,EAAE,GAAC,GAAE,KAAI,CAAC,CAAC,EAAE;YAAG,IAAI,wBAAE,yBAAE,KAAI,IAAG,IAAE,GAAE,IAAE,yBAAE,IAAI,uBAAC,CAAC,IAAE,IAAE,EAAE,GAAC,GAAE,uBAAC,CAAC,IAAE,EAAE,GAAC,wBAAE,GAAE;YAAG,0BAAE,IAAI,wBAAE,yBAAE,yBAAE,KAAI,yBAAE,0BAAG,0BAAE,IAAI,wBAAE,yBAAE,yBAAE,GAAE,yBAAE,0BAAG,0BAAE,IAAI,wBAAE,IAAI,MAAM,IAAG,yBAAE,GAAE,IAAG;QAAE,CAAA,KAAK,0BAAE,CAAC,CAAA,GAAG,EAAE,MAAM,GAAC,IAAI,wBAAE,EAAE,SAAS,EAAC,0BAAG,EAAE,MAAM,GAAC,IAAI,wBAAE,EAAE,SAAS,EAAC,0BAAG,EAAE,OAAO,GAAC,IAAI,wBAAE,EAAE,OAAO,EAAC,0BAAG,EAAE,MAAM,GAAC,GAAE,EAAE,QAAQ,GAAC,GAAE,wBAAE;IAAE;IAAE,kBAAiB;IAAE,iBAAgB;IAAE,WAAU,CAAC,GAAE,GAAE,IAAK,CAAA,EAAE,WAAW,CAAC,EAAE,OAAO,GAAC,EAAE,QAAQ,GAAG,GAAC,GAAE,EAAE,WAAW,CAAC,EAAE,OAAO,GAAC,EAAE,QAAQ,GAAG,GAAC,KAAG,GAAE,EAAE,WAAW,CAAC,EAAE,OAAO,GAAC,EAAE,QAAQ,GAAG,GAAC,GAAE,MAAI,IAAE,EAAE,SAAS,CAAC,IAAE,EAAE,KAAI,CAAA,EAAE,OAAO,IAAG,KAAI,EAAE,SAAS,CAAC,IAAG,CAAA,uBAAC,CAAC,EAAE,GAAC,0BAAE,CAAA,EAAG,IAAG,EAAE,SAAS,CAAC,IAAE,wBAAE,GAAG,EAAC,GAAG,EAAE,QAAQ,KAAG,EAAE,OAAO,AAAD;IAAG,WAAU,CAAA;QAAI,wBAAE,GAAE,GAAE,IAAG,wBAAE,GAAE,KAAI,0BAAG,AAAC,CAAA,CAAA;YAAI,OAAK,EAAE,QAAQ,GAAE,CAAA,wBAAE,GAAE,EAAE,MAAM,GAAE,EAAE,MAAM,GAAC,GAAE,EAAE,QAAQ,GAAC,CAAA,IAAG,EAAE,QAAQ,IAAE,KAAI,CAAA,EAAE,WAAW,CAAC,EAAE,OAAO,GAAG,GAAC,MAAI,EAAE,MAAM,EAAC,EAAE,MAAM,KAAG,GAAE,EAAE,QAAQ,IAAE,CAAA;QAAE,CAAA,EAAG;IAAE;AAAC;AAAE,IAAI,0BAAE,CAAC,GAAE,GAAE,GAAE;IAAK,IAAI,IAAE,QAAM,IAAE,GAAE,IAAE,MAAI,KAAG,QAAM,GAAE,IAAE;IAAE,MAAK,MAAI,GAAG;QAAC,IAAE,IAAE,MAAI,MAAI,GAAE,KAAG;QAAE,GAAG,IAAE,IAAE,CAAC,CAAC,IAAI,GAAC,GAAE,IAAE,IAAE,IAAE;eAAQ,EAAE,GAAG;QAAA,KAAG,OAAM,KAAG;IAAK;IAAC,OAAO,IAAE,KAAG,KAAG;AAAC;AAAE,MAAM,0BAAE,IAAI,YAAY,AAAC,CAAA;IAAK,IAAI,GAAE,IAAE,EAAE;IAAC,IAAI,IAAI,IAAE,GAAE,IAAE,KAAI,IAAI;QAAC,IAAE;QAAE,IAAI,IAAI,IAAE,GAAE,IAAE,GAAE,IAAI,IAAE,IAAE,IAAE,aAAW,MAAI,IAAE,MAAI;QAAE,CAAC,CAAC,EAAE,GAAC;IAAC;IAAC,OAAO;AAAC,CAAA;AAAM,IAAI,0BAAE,CAAC,GAAE,GAAE,GAAE;IAAK,MAAM,IAAE,yBAAE,IAAE,IAAE;IAAE,KAAG;IAAG,IAAI,IAAI,IAAE,GAAE,IAAE,GAAE,IAAI,IAAE,MAAI,IAAE,CAAC,CAAC,MAAK,CAAA,IAAE,CAAC,CAAC,EAAE,AAAD,EAAG;IAAC,OAAM,KAAG;AAAC,GAAE,0BAAE;IAAC,GAAE;IAAkB,GAAE;IAAa,GAAE;IAAG,MAAK;IAAa,MAAK;IAAe,MAAK;IAAa,MAAK;IAAsB,MAAK;IAAe,MAAK;AAAsB,GAAE,0BAAE;IAAC,YAAW;IAAE,iBAAgB;IAAE,cAAa;IAAE,cAAa;IAAE,UAAS;IAAE,SAAQ;IAAE,SAAQ;IAAE,MAAK;IAAE,cAAa;IAAE,aAAY;IAAE,SAAQ;IAAG,gBAAe;IAAG,cAAa;IAAG,aAAY;IAAG,aAAY;IAAG,kBAAiB;IAAE,cAAa;IAAE,oBAAmB;IAAE,uBAAsB;IAAG,YAAW;IAAE,gBAAe;IAAE,OAAM;IAAE,SAAQ;IAAE,oBAAmB;IAAE,UAAS;IAAE,QAAO;IAAE,WAAU;IAAE,YAAW;AAAC;AAAE,MAAK,EAAC,UAAS,uBAAC,EAAC,kBAAiB,uBAAC,EAAC,iBAAgB,uBAAC,EAAC,WAAU,uBAAC,EAAC,WAAU,uBAAC,EAAC,GAAC,yBAAE,EAAC,YAAW,uBAAC,EAAC,iBAAgB,uBAAC,EAAC,cAAa,uBAAC,EAAC,UAAS,uBAAC,EAAC,SAAQ,uBAAC,EAAC,MAAK,wBAAE,EAAC,cAAa,wBAAE,EAAC,gBAAe,wBAAE,EAAC,cAAa,wBAAE,EAAC,aAAY,wBAAE,EAAC,uBAAsB,wBAAE,EAAC,YAAW,wBAAE,EAAC,gBAAe,wBAAE,EAAC,OAAM,wBAAE,EAAC,SAAQ,wBAAE,EAAC,oBAAmB,wBAAE,EAAC,WAAU,wBAAE,EAAC,YAAW,wBAAE,EAAC,GAAC,yBAAE,2BAAG,KAAI,2BAAG,KAAI,2BAAG,IAAG,2BAAG,KAAI,2BAAG,KAAI,2BAAG,CAAC,GAAE,IAAK,CAAA,EAAE,GAAG,GAAC,uBAAC,CAAC,EAAE,EAAC,CAAA,GAAG,2BAAG,CAAA,IAAG,IAAE,IAAG,CAAA,IAAE,IAAE,IAAE,CAAA,GAAG,2BAAG,CAAA;IAAI,IAAI,IAAE,EAAE,MAAM;IAAC,MAAK,EAAE,KAAG,GAAG,CAAC,CAAC,EAAE,GAAC;AAAC,GAAE,2BAAG,CAAA;IAAI,IAAI,GAAE,GAAE,GAAE,IAAE,EAAE,MAAM;IAAC,IAAE,EAAE,SAAS,EAAC,IAAE;IAAE,GAAG,IAAE,EAAE,IAAI,CAAC,EAAE,EAAE,EAAC,EAAE,IAAI,CAAC,EAAE,GAAC,KAAG,IAAE,IAAE,IAAE;WAAQ,EAAE,GAAG;IAAA,IAAE,GAAE,IAAE;IAAE,GAAG,IAAE,EAAE,IAAI,CAAC,EAAE,EAAE,EAAC,EAAE,IAAI,CAAC,EAAE,GAAC,KAAG,IAAE,IAAE,IAAE;WAAQ,EAAE,GAAE;AAAA;AAAE,IAAI,2BAAG,CAAC,GAAE,GAAE,IAAI,AAAC,CAAA,KAAG,EAAE,UAAU,GAAC,CAAA,IAAG,EAAE,SAAS;AAAC,MAAM,2BAAG,CAAA;IAAI,MAAM,IAAE,EAAE,KAAK;IAAC,IAAI,IAAE,EAAE,OAAO;IAAC,IAAE,EAAE,SAAS,IAAG,CAAA,IAAE,EAAE,SAAS,AAAD,GAAG,MAAI,KAAI,CAAA,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAC,EAAE,WAAW,GAAC,IAAG,EAAE,QAAQ,GAAE,EAAE,QAAQ,IAAE,GAAE,EAAE,WAAW,IAAE,GAAE,EAAE,SAAS,IAAE,GAAE,EAAE,SAAS,IAAE,GAAE,EAAE,OAAO,IAAE,GAAE,MAAI,EAAE,OAAO,IAAG,CAAA,EAAE,WAAW,GAAC,CAAA,CAAC;AAAE,GAAE,2BAAG,CAAC,GAAE;IAAK,wBAAE,GAAE,EAAE,WAAW,IAAE,IAAE,EAAE,WAAW,GAAC,IAAG,EAAE,QAAQ,GAAC,EAAE,WAAW,EAAC,IAAG,EAAE,WAAW,GAAC,EAAE,QAAQ,EAAC,yBAAG,EAAE,IAAI;AAAC,GAAE,2BAAG,CAAC,GAAE;IAAK,EAAE,WAAW,CAAC,EAAE,OAAO,GAAG,GAAC;AAAC,GAAE,2BAAG,CAAC,GAAE;IAAK,EAAE,WAAW,CAAC,EAAE,OAAO,GAAG,GAAC,MAAI,IAAE,KAAI,EAAE,WAAW,CAAC,EAAE,OAAO,GAAG,GAAC,MAAI;AAAC,GAAE,2BAAG,CAAC,GAAE,GAAE,GAAE;IAAK,IAAI,IAAE,EAAE,QAAQ;IAAC,OAAO,IAAE,KAAI,CAAA,IAAE,CAAA,GAAG,MAAI,IAAE,IAAG,CAAA,EAAE,QAAQ,IAAE,GAAE,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAC,EAAE,OAAO,GAAC,IAAG,IAAG,MAAI,EAAE,KAAK,CAAC,IAAI,GAAC,EAAE,KAAK,GAAC,wBAAE,EAAE,KAAK,EAAC,GAAE,GAAE,KAAG,MAAI,EAAE,KAAK,CAAC,IAAI,IAAG,CAAA,EAAE,KAAK,GAAC,wBAAE,EAAE,KAAK,EAAC,GAAE,GAAE,EAAC,GAAG,EAAE,OAAO,IAAE,GAAE,EAAE,QAAQ,IAAE,GAAE,CAAA;AAAE,GAAE,2BAAG,CAAC,GAAE;IAAK,IAAI,GAAE,GAAE,IAAE,EAAE,gBAAgB,EAAC,IAAE,EAAE,QAAQ,EAAC,IAAE,EAAE,WAAW,EAAC,IAAE,EAAE,UAAU;IAAC,MAAM,IAAE,EAAE,QAAQ,GAAC,EAAE,MAAM,GAAC,2BAAG,EAAE,QAAQ,GAAE,CAAA,EAAE,MAAM,GAAC,wBAAC,IAAG,GAAE,IAAE,EAAE,MAAM,EAAC,IAAE,EAAE,MAAM,EAAC,IAAE,EAAE,IAAI,EAAC,IAAE,EAAE,QAAQ,GAAC;IAAG,IAAI,IAAE,CAAC,CAAC,IAAE,IAAE,EAAE,EAAC,IAAE,CAAC,CAAC,IAAE,EAAE;IAAC,EAAE,WAAW,IAAE,EAAE,UAAU,IAAG,CAAA,MAAI,CAAA,GAAG,IAAE,EAAE,SAAS,IAAG,CAAA,IAAE,EAAE,SAAS,AAAD;IAAG,GAAG,IAAG,IAAE,GAAE,CAAC,CAAC,IAAE,EAAE,KAAG,KAAG,CAAC,CAAC,IAAE,IAAE,EAAE,KAAG,KAAG,CAAC,CAAC,EAAE,KAAG,CAAC,CAAC,EAAE,IAAE,CAAC,CAAC,EAAE,EAAE,KAAG,CAAC,CAAC,IAAE,EAAE,EAAC;QAAC,KAAG,GAAE;QAAI;eAAU,CAAC,CAAC,EAAE,EAAE,KAAG,CAAC,CAAC,EAAE,EAAE,IAAE,CAAC,CAAC,EAAE,EAAE,KAAG,CAAC,CAAC,EAAE,EAAE,IAAE,CAAC,CAAC,EAAE,EAAE,KAAG,CAAC,CAAC,EAAE,EAAE,IAAE,CAAC,CAAC,EAAE,EAAE,KAAG,CAAC,CAAC,EAAE,EAAE,IAAE,CAAC,CAAC,EAAE,EAAE,KAAG,CAAC,CAAC,EAAE,EAAE,IAAE,CAAC,CAAC,EAAE,EAAE,KAAG,CAAC,CAAC,EAAE,EAAE,IAAE,CAAC,CAAC,EAAE,EAAE,KAAG,CAAC,CAAC,EAAE,EAAE,IAAE,CAAC,CAAC,EAAE,EAAE,KAAG,CAAC,CAAC,EAAE,EAAE,IAAE,IAAE,GAAG;QAAA,IAAG,IAAE,2BAAI,CAAA,IAAE,CAAA,GAAG,IAAE,IAAE,0BAAG,IAAE,GAAE;YAAC,IAAG,EAAE,WAAW,GAAC,GAAE,IAAE,GAAE,KAAG,GAAE;YAAM,IAAE,CAAC,CAAC,IAAE,IAAE,EAAE,EAAC,IAAE,CAAC,CAAC,IAAE,EAAE;QAAA;IAAC;WAAQ,AAAC,CAAA,IAAE,CAAC,CAAC,IAAE,EAAE,AAAD,IAAG,KAAG,KAAG,EAAE,GAAG;IAAA,OAAO,KAAG,EAAE,SAAS,GAAC,IAAE,EAAE,SAAS;AAAA,GAAE,2BAAG,CAAA;IAAI,MAAM,IAAE,EAAE,MAAM;IAAC,IAAI,GAAE,GAAE;IAAE,GAAE;QAAC,IAAG,IAAE,EAAE,WAAW,GAAC,EAAE,SAAS,GAAC,EAAE,QAAQ,EAAC,EAAE,QAAQ,IAAE,IAAG,CAAA,IAAE,wBAAC,KAAK,CAAA,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAE,IAAE,IAAE,IAAG,IAAG,EAAE,WAAW,IAAE,GAAE,EAAE,QAAQ,IAAE,GAAE,EAAE,WAAW,IAAE,GAAE,EAAE,MAAM,GAAC,EAAE,QAAQ,IAAG,CAAA,EAAE,MAAM,GAAC,EAAE,QAAQ,AAAD,GAAG,yBAAG,IAAG,KAAG,CAAA,GAAG,MAAI,EAAE,IAAI,CAAC,QAAQ,EAAC;QAAM,IAAG,IAAE,yBAAG,EAAE,IAAI,EAAC,EAAE,MAAM,EAAC,EAAE,QAAQ,GAAC,EAAE,SAAS,EAAC,IAAG,EAAE,SAAS,IAAE,GAAE,EAAE,SAAS,GAAC,EAAE,MAAM,IAAE,GAAE,IAAI,IAAE,EAAE,QAAQ,GAAC,EAAE,MAAM,EAAC,EAAE,KAAK,GAAC,EAAE,MAAM,CAAC,EAAE,EAAC,EAAE,KAAK,GAAC,yBAAG,GAAE,EAAE,KAAK,EAAC,EAAE,MAAM,CAAC,IAAE,EAAE,GAAE,EAAE,MAAM,IAAG,CAAA,EAAE,KAAK,GAAC,yBAAG,GAAE,EAAE,KAAK,EAAC,EAAE,MAAM,CAAC,IAAE,IAAE,EAAE,GAAE,EAAE,IAAI,CAAC,IAAE,EAAE,MAAM,CAAC,GAAC,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,EAAC,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,GAAC,GAAE,KAAI,EAAE,MAAM,IAAG,CAAE,CAAA,EAAE,SAAS,GAAC,EAAE,MAAM,GAAC,CAAA,CAAC;IAAK,QAAO,EAAE,SAAS,GAAC,4BAAI,MAAI,EAAE,IAAI,CAAC,QAAQ,EAAC;AAAA,GAAE,2BAAG,CAAC,GAAE;IAAK,IAAI,GAAE,GAAE,GAAE,IAAE,EAAE,gBAAgB,GAAC,IAAE,EAAE,MAAM,GAAC,EAAE,MAAM,GAAC,EAAE,gBAAgB,GAAC,GAAE,IAAE,GAAE,IAAE,EAAE,IAAI,CAAC,QAAQ;IAAC,GAAE;QAAC,IAAG,IAAE,OAAM,IAAE,EAAE,QAAQ,GAAC,MAAI,GAAE,EAAE,IAAI,CAAC,SAAS,GAAC,GAAE;QAAM,IAAG,IAAE,EAAE,IAAI,CAAC,SAAS,GAAC,GAAE,IAAE,EAAE,QAAQ,GAAC,EAAE,WAAW,EAAC,IAAE,IAAE,EAAE,IAAI,CAAC,QAAQ,IAAG,CAAA,IAAE,IAAE,EAAE,IAAI,CAAC,QAAQ,AAAD,GAAG,IAAE,KAAI,CAAA,IAAE,CAAA,GAAG,IAAE,KAAI,CAAA,MAAI,KAAG,MAAI,2BAAG,MAAI,2BAAG,MAAI,IAAE,EAAE,IAAI,CAAC,QAAQ,AAAD,GAAG;QAAM,IAAE,MAAI,2BAAG,MAAI,IAAE,EAAE,IAAI,CAAC,QAAQ,GAAC,IAAE,GAAE,wBAAE,GAAE,GAAE,GAAE,IAAG,EAAE,WAAW,CAAC,EAAE,OAAO,GAAC,EAAE,GAAC,GAAE,EAAE,WAAW,CAAC,EAAE,OAAO,GAAC,EAAE,GAAC,KAAG,GAAE,EAAE,WAAW,CAAC,EAAE,OAAO,GAAC,EAAE,GAAC,CAAC,GAAE,EAAE,WAAW,CAAC,EAAE,OAAO,GAAC,EAAE,GAAC,CAAC,KAAG,GAAE,yBAAG,EAAE,IAAI,GAAE,KAAI,CAAA,IAAE,KAAI,CAAA,IAAE,CAAA,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAC,EAAE,WAAW,GAAC,IAAG,EAAE,IAAI,CAAC,QAAQ,GAAE,EAAE,IAAI,CAAC,QAAQ,IAAE,GAAE,EAAE,IAAI,CAAC,SAAS,IAAE,GAAE,EAAE,IAAI,CAAC,SAAS,IAAE,GAAE,EAAE,WAAW,IAAE,GAAE,KAAG,CAAA,GAAG,KAAI,CAAA,yBAAG,EAAE,IAAI,EAAC,EAAE,IAAI,CAAC,MAAM,EAAC,EAAE,IAAI,CAAC,QAAQ,EAAC,IAAG,EAAE,IAAI,CAAC,QAAQ,IAAE,GAAE,EAAE,IAAI,CAAC,SAAS,IAAE,GAAE,EAAE,IAAI,CAAC,SAAS,IAAE,CAAA;IAAE,QAAO,MAAI,GAAG;IAAA,OAAO,KAAG,EAAE,IAAI,CAAC,QAAQ,EAAC,KAAI,CAAA,KAAG,EAAE,MAAM,GAAE,CAAA,EAAE,OAAO,GAAC,GAAE,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,OAAO,GAAC,EAAE,MAAM,EAAC,EAAE,IAAI,CAAC,OAAO,GAAE,IAAG,EAAE,QAAQ,GAAC,EAAE,MAAM,EAAC,EAAE,MAAM,GAAC,EAAE,QAAQ,AAAD,IAAI,CAAA,EAAE,WAAW,GAAC,EAAE,QAAQ,IAAE,KAAI,CAAA,EAAE,QAAQ,IAAE,EAAE,MAAM,EAAC,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAC,EAAE,MAAM,GAAC,EAAE,QAAQ,GAAE,IAAG,EAAE,OAAO,GAAC,KAAG,EAAE,OAAO,IAAG,EAAE,MAAM,GAAC,EAAE,QAAQ,IAAG,CAAA,EAAE,MAAM,GAAC,EAAE,QAAQ,AAAD,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,OAAO,GAAC,GAAE,EAAE,IAAI,CAAC,OAAO,GAAE,EAAE,QAAQ,GAAE,EAAE,QAAQ,IAAE,GAAE,EAAE,MAAM,IAAE,IAAE,EAAE,MAAM,GAAC,EAAE,MAAM,GAAC,EAAE,MAAM,GAAC,EAAE,MAAM,GAAC,CAAA,GAAG,EAAE,WAAW,GAAC,EAAE,QAAQ,AAAD,GAAG,EAAE,UAAU,GAAC,EAAE,QAAQ,IAAG,CAAA,EAAE,UAAU,GAAC,EAAE,QAAQ,AAAD,GAAG,IAAE,IAAE,MAAI,2BAAG,MAAI,2BAAG,MAAI,EAAE,IAAI,CAAC,QAAQ,IAAE,EAAE,QAAQ,KAAG,EAAE,WAAW,GAAC,IAAG,CAAA,IAAE,EAAE,WAAW,GAAC,EAAE,QAAQ,EAAC,EAAE,IAAI,CAAC,QAAQ,GAAC,KAAG,EAAE,WAAW,IAAE,EAAE,MAAM,IAAG,CAAA,EAAE,WAAW,IAAE,EAAE,MAAM,EAAC,EAAE,QAAQ,IAAE,EAAE,MAAM,EAAC,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAC,EAAE,MAAM,GAAC,EAAE,QAAQ,GAAE,IAAG,EAAE,OAAO,GAAC,KAAG,EAAE,OAAO,IAAG,KAAG,EAAE,MAAM,EAAC,EAAE,MAAM,GAAC,EAAE,QAAQ,IAAG,CAAA,EAAE,MAAM,GAAC,EAAE,QAAQ,AAAD,CAAC,GAAG,IAAE,EAAE,IAAI,CAAC,QAAQ,IAAG,CAAA,IAAE,EAAE,IAAI,CAAC,QAAQ,AAAD,GAAG,KAAI,CAAA,yBAAG,EAAE,IAAI,EAAC,EAAE,MAAM,EAAC,EAAE,QAAQ,EAAC,IAAG,EAAE,QAAQ,IAAE,GAAE,EAAE,MAAM,IAAE,IAAE,EAAE,MAAM,GAAC,EAAE,MAAM,GAAC,EAAE,MAAM,GAAC,EAAE,MAAM,GAAC,CAAA,GAAG,EAAE,UAAU,GAAC,EAAE,QAAQ,IAAG,CAAA,EAAE,UAAU,GAAC,EAAE,QAAQ,AAAD,GAAG,IAAE,EAAE,QAAQ,GAAC,MAAI,GAAE,IAAE,EAAE,gBAAgB,GAAC,IAAE,QAAM,QAAM,EAAE,gBAAgB,GAAC,GAAE,IAAE,IAAE,EAAE,MAAM,GAAC,EAAE,MAAM,GAAC,GAAE,IAAE,EAAE,QAAQ,GAAC,EAAE,WAAW,EAAC,AAAC,CAAA,KAAG,KAAG,AAAC,CAAA,KAAG,MAAI,uBAAA,KAAI,MAAI,2BAAG,MAAI,EAAE,IAAI,CAAC,QAAQ,IAAE,KAAG,CAAA,KAAK,CAAA,IAAE,IAAE,IAAE,IAAE,GAAE,IAAE,MAAI,2BAAG,MAAI,EAAE,IAAI,CAAC,QAAQ,IAAE,MAAI,IAAE,IAAE,GAAE,wBAAE,GAAE,EAAE,WAAW,EAAC,GAAE,IAAG,EAAE,WAAW,IAAE,GAAE,yBAAG,EAAE,IAAI,CAAA,GAAG,IAAE,IAAE,CAAA;AAAE,GAAE,2BAAG,CAAC,GAAE;IAAK,IAAI,GAAE;IAAE,OAAO;QAAC,IAAG,EAAE,SAAS,GAAC,0BAAG;YAAC,IAAG,yBAAG,IAAG,EAAE,SAAS,GAAC,4BAAI,MAAI,yBAAE,OAAO;YAAE,IAAG,MAAI,EAAE,SAAS,EAAC;QAAK;QAAC,IAAG,IAAE,GAAE,EAAE,SAAS,IAAE,KAAI,CAAA,EAAE,KAAK,GAAC,yBAAG,GAAE,EAAE,KAAK,EAAC,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAC,IAAE,EAAE,GAAE,IAAE,EAAE,IAAI,CAAC,EAAE,QAAQ,GAAC,EAAE,MAAM,CAAC,GAAC,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,EAAC,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,GAAC,EAAE,QAAQ,AAAD,GAAG,MAAI,KAAG,EAAE,QAAQ,GAAC,KAAG,EAAE,MAAM,GAAC,4BAAK,CAAA,EAAE,YAAY,GAAC,yBAAG,GAAE,EAAC,GAAG,EAAE,YAAY,IAAE;YAAE,IAAG,IAAE,wBAAE,GAAE,EAAE,QAAQ,GAAC,EAAE,WAAW,EAAC,EAAE,YAAY,GAAC,IAAG,EAAE,SAAS,IAAE,EAAE,YAAY,EAAC,EAAE,YAAY,IAAE,EAAE,cAAc,IAAE,EAAE,SAAS,IAAE,GAAE;gBAAC,EAAE,YAAY;gBAAG,GAAG,EAAE,QAAQ,IAAG,EAAE,KAAK,GAAC,yBAAG,GAAE,EAAE,KAAK,EAAC,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAC,IAAE,EAAE,GAAE,IAAE,EAAE,IAAI,CAAC,EAAE,QAAQ,GAAC,EAAE,MAAM,CAAC,GAAC,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,EAAC,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,GAAC,EAAE,QAAQ;uBAAO,KAAG,EAAE,EAAE,YAAY,EAAE;gBAAA,EAAE,QAAQ;YAAE,OAAM,EAAE,QAAQ,IAAE,EAAE,YAAY,EAAC,EAAE,YAAY,GAAC,GAAE,EAAE,KAAK,GAAC,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,EAAC,EAAE,KAAK,GAAC,yBAAG,GAAE,EAAE,KAAK,EAAC,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAC,EAAE;eAAO,IAAE,wBAAE,GAAE,GAAE,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,GAAE,EAAE,SAAS,IAAG,EAAE,QAAQ;QAAG,IAAG,KAAI,CAAA,yBAAG,GAAE,CAAC,IAAG,MAAI,EAAE,IAAI,CAAC,SAAS,AAAD,GAAG,OAAO;IAAC;IAAC,OAAO,EAAE,MAAM,GAAC,EAAE,QAAQ,GAAC,IAAE,EAAE,QAAQ,GAAC,GAAE,MAAI,0BAAG,CAAA,yBAAG,GAAE,CAAC,IAAG,MAAI,EAAE,IAAI,CAAC,SAAS,GAAC,IAAE,CAAA,IAAG,EAAE,QAAQ,IAAG,CAAA,yBAAG,GAAE,CAAC,IAAG,MAAI,EAAE,IAAI,CAAC,SAAS,AAAD,IAAG,IAAE;AAAC,GAAE,2BAAG,CAAC,GAAE;IAAK,IAAI,GAAE,GAAE;IAAE,OAAO;QAAC,IAAG,EAAE,SAAS,GAAC,0BAAG;YAAC,IAAG,yBAAG,IAAG,EAAE,SAAS,GAAC,4BAAI,MAAI,yBAAE,OAAO;YAAE,IAAG,MAAI,EAAE,SAAS,EAAC;QAAK;QAAC,IAAG,IAAE,GAAE,EAAE,SAAS,IAAE,KAAI,CAAA,EAAE,KAAK,GAAC,yBAAG,GAAE,EAAE,KAAK,EAAC,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAC,IAAE,EAAE,GAAE,IAAE,EAAE,IAAI,CAAC,EAAE,QAAQ,GAAC,EAAE,MAAM,CAAC,GAAC,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,EAAC,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,GAAC,EAAE,QAAQ,AAAD,GAAG,EAAE,WAAW,GAAC,EAAE,YAAY,EAAC,EAAE,UAAU,GAAC,EAAE,WAAW,EAAC,EAAE,YAAY,GAAC,GAAE,MAAI,KAAG,EAAE,WAAW,GAAC,EAAE,cAAc,IAAE,EAAE,QAAQ,GAAC,KAAG,EAAE,MAAM,GAAC,4BAAK,CAAA,EAAE,YAAY,GAAC,yBAAG,GAAE,IAAG,EAAE,YAAY,IAAE,KAAI,CAAA,EAAE,QAAQ,KAAG,4BAAI,MAAI,EAAE,YAAY,IAAE,EAAE,QAAQ,GAAC,EAAE,WAAW,GAAC,IAAG,KAAK,CAAA,EAAE,YAAY,GAAC,CAAA,CAAC,GAAG,EAAE,WAAW,IAAE,KAAG,EAAE,YAAY,IAAE,EAAE,WAAW,EAAC;YAAC,IAAE,EAAE,QAAQ,GAAC,EAAE,SAAS,GAAC,GAAE,IAAE,wBAAE,GAAE,EAAE,QAAQ,GAAC,IAAE,EAAE,UAAU,EAAC,EAAE,WAAW,GAAC,IAAG,EAAE,SAAS,IAAE,EAAE,WAAW,GAAC,GAAE,EAAE,WAAW,IAAE;YAAE,GAAG,EAAE,EAAE,QAAQ,IAAE,KAAI,CAAA,EAAE,KAAK,GAAC,yBAAG,GAAE,EAAE,KAAK,EAAC,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAC,IAAE,EAAE,GAAE,IAAE,EAAE,IAAI,CAAC,EAAE,QAAQ,GAAC,EAAE,MAAM,CAAC,GAAC,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,EAAC,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,GAAC,EAAE,QAAQ,AAAD;mBAAS,KAAG,EAAE,EAAE,WAAW,EAAE;YAAA,IAAG,EAAE,eAAe,GAAC,GAAE,EAAE,YAAY,GAAC,GAAE,EAAE,QAAQ,IAAG,KAAI,CAAA,yBAAG,GAAE,CAAC,IAAG,MAAI,EAAE,IAAI,CAAC,SAAS,AAAD,GAAG,OAAO;QAAC,OAAM,IAAG,EAAE,eAAe,EAAC;YAAC,IAAG,IAAE,wBAAE,GAAE,GAAE,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAC,EAAE,GAAE,KAAG,yBAAG,GAAE,CAAC,IAAG,EAAE,QAAQ,IAAG,EAAE,SAAS,IAAG,MAAI,EAAE,IAAI,CAAC,SAAS,EAAC,OAAO;QAAC,OAAM,EAAE,eAAe,GAAC,GAAE,EAAE,QAAQ,IAAG,EAAE,SAAS;IAAE;IAAC,OAAO,EAAE,eAAe,IAAG,CAAA,IAAE,wBAAE,GAAE,GAAE,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAC,EAAE,GAAE,EAAE,eAAe,GAAC,CAAA,GAAG,EAAE,MAAM,GAAC,EAAE,QAAQ,GAAC,IAAE,EAAE,QAAQ,GAAC,GAAE,MAAI,0BAAG,CAAA,yBAAG,GAAE,CAAC,IAAG,MAAI,EAAE,IAAI,CAAC,SAAS,GAAC,IAAE,CAAA,IAAG,EAAE,QAAQ,IAAG,CAAA,yBAAG,GAAE,CAAC,IAAG,MAAI,EAAE,IAAI,CAAC,SAAS,AAAD,IAAG,IAAE;AAAC;AAAE,SAAS,yBAAG,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC;IAAE,IAAI,CAAC,WAAW,GAAC,GAAE,IAAI,CAAC,QAAQ,GAAC,GAAE,IAAI,CAAC,WAAW,GAAC,GAAE,IAAI,CAAC,SAAS,GAAC,GAAE,IAAI,CAAC,IAAI,GAAC;AAAC;AAAC,MAAM,2BAAG;IAAC,IAAI,yBAAG,GAAE,GAAE,GAAE,GAAE;IAAI,IAAI,yBAAG,GAAE,GAAE,GAAE,GAAE;IAAI,IAAI,yBAAG,GAAE,GAAE,IAAG,GAAE;IAAI,IAAI,yBAAG,GAAE,GAAE,IAAG,IAAG;IAAI,IAAI,yBAAG,GAAE,GAAE,IAAG,IAAG;IAAI,IAAI,yBAAG,GAAE,IAAG,IAAG,IAAG;IAAI,IAAI,yBAAG,GAAE,IAAG,KAAI,KAAI;IAAI,IAAI,yBAAG,GAAE,IAAG,KAAI,KAAI;IAAI,IAAI,yBAAG,IAAG,KAAI,KAAI,MAAK;IAAI,IAAI,yBAAG,IAAG,KAAI,KAAI,MAAK;CAAI;AAAC,SAAS;IAAK,IAAI,CAAC,IAAI,GAAC,MAAK,IAAI,CAAC,MAAM,GAAC,GAAE,IAAI,CAAC,WAAW,GAAC,MAAK,IAAI,CAAC,gBAAgB,GAAC,GAAE,IAAI,CAAC,WAAW,GAAC,GAAE,IAAI,CAAC,OAAO,GAAC,GAAE,IAAI,CAAC,IAAI,GAAC,GAAE,IAAI,CAAC,MAAM,GAAC,MAAK,IAAI,CAAC,OAAO,GAAC,GAAE,IAAI,CAAC,MAAM,GAAC,0BAAG,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,MAAM,GAAC,GAAE,IAAI,CAAC,MAAM,GAAC,GAAE,IAAI,CAAC,MAAM,GAAC,GAAE,IAAI,CAAC,MAAM,GAAC,MAAK,IAAI,CAAC,WAAW,GAAC,GAAE,IAAI,CAAC,IAAI,GAAC,MAAK,IAAI,CAAC,IAAI,GAAC,MAAK,IAAI,CAAC,KAAK,GAAC,GAAE,IAAI,CAAC,SAAS,GAAC,GAAE,IAAI,CAAC,SAAS,GAAC,GAAE,IAAI,CAAC,SAAS,GAAC,GAAE,IAAI,CAAC,UAAU,GAAC,GAAE,IAAI,CAAC,WAAW,GAAC,GAAE,IAAI,CAAC,YAAY,GAAC,GAAE,IAAI,CAAC,UAAU,GAAC,GAAE,IAAI,CAAC,eAAe,GAAC,GAAE,IAAI,CAAC,QAAQ,GAAC,GAAE,IAAI,CAAC,WAAW,GAAC,GAAE,IAAI,CAAC,SAAS,GAAC,GAAE,IAAI,CAAC,WAAW,GAAC,GAAE,IAAI,CAAC,gBAAgB,GAAC,GAAE,IAAI,CAAC,cAAc,GAAC,GAAE,IAAI,CAAC,KAAK,GAAC,GAAE,IAAI,CAAC,QAAQ,GAAC,GAAE,IAAI,CAAC,UAAU,GAAC,GAAE,IAAI,CAAC,UAAU,GAAC,GAAE,IAAI,CAAC,SAAS,GAAC,IAAI,YAAY,OAAM,IAAI,CAAC,SAAS,GAAC,IAAI,YAAY,MAAK,IAAI,CAAC,OAAO,GAAC,IAAI,YAAY,KAAI,yBAAG,IAAI,CAAC,SAAS,GAAE,yBAAG,IAAI,CAAC,SAAS,GAAE,yBAAG,IAAI,CAAC,OAAO,GAAE,IAAI,CAAC,MAAM,GAAC,MAAK,IAAI,CAAC,MAAM,GAAC,MAAK,IAAI,CAAC,OAAO,GAAC,MAAK,IAAI,CAAC,QAAQ,GAAC,IAAI,YAAY,KAAI,IAAI,CAAC,IAAI,GAAC,IAAI,YAAY,MAAK,yBAAG,IAAI,CAAC,IAAI,GAAE,IAAI,CAAC,QAAQ,GAAC,GAAE,IAAI,CAAC,QAAQ,GAAC,GAAE,IAAI,CAAC,KAAK,GAAC,IAAI,YAAY,MAAK,yBAAG,IAAI,CAAC,KAAK,GAAE,IAAI,CAAC,OAAO,GAAC,GAAE,IAAI,CAAC,WAAW,GAAC,GAAE,IAAI,CAAC,QAAQ,GAAC,GAAE,IAAI,CAAC,OAAO,GAAC,GAAE,IAAI,CAAC,OAAO,GAAC,GAAE,IAAI,CAAC,UAAU,GAAC,GAAE,IAAI,CAAC,OAAO,GAAC,GAAE,IAAI,CAAC,MAAM,GAAC,GAAE,IAAI,CAAC,MAAM,GAAC,GAAE,IAAI,CAAC,QAAQ,GAAC;AAAC;AAAC,MAAM,2BAAG,CAAA;IAAI,IAAG,CAAC,GAAE,OAAO;IAAE,MAAM,IAAE,EAAE,KAAK;IAAC,OAAM,CAAC,KAAG,EAAE,IAAI,KAAG,KAAG,EAAE,MAAM,KAAG,4BAAI,OAAK,EAAE,MAAM,IAAE,OAAK,EAAE,MAAM,IAAE,OAAK,EAAE,MAAM,IAAE,OAAK,EAAE,MAAM,IAAE,QAAM,EAAE,MAAM,IAAE,EAAE,MAAM,KAAG,4BAAI,EAAE,MAAM,KAAG,2BAAG,IAAE;AAAC,GAAE,2BAAG,CAAA;IAAI,IAAG,yBAAG,IAAG,OAAO,yBAAG,GAAE;IAAI,EAAE,QAAQ,GAAC,EAAE,SAAS,GAAC,GAAE,EAAE,SAAS,GAAC;IAAG,MAAM,IAAE,EAAE,KAAK;IAAC,OAAO,EAAE,OAAO,GAAC,GAAE,EAAE,WAAW,GAAC,GAAE,EAAE,IAAI,GAAC,KAAI,CAAA,EAAE,IAAI,GAAC,CAAC,EAAE,IAAI,AAAD,GAAG,EAAE,MAAM,GAAC,MAAI,EAAE,IAAI,GAAC,KAAG,EAAE,IAAI,GAAC,2BAAG,0BAAG,EAAE,KAAK,GAAC,MAAI,EAAE,IAAI,GAAC,IAAE,GAAE,EAAE,UAAU,GAAC,IAAG,wBAAE,IAAG;AAAE,GAAE,2BAAG,CAAA;IAAI,MAAM,IAAE,yBAAG;IAAG,IAAI;IAAE,OAAO,MAAI,4BAAK,CAAA,AAAC,CAAA,IAAE,EAAE,KAAK,AAAD,EAAG,WAAW,GAAC,IAAE,EAAE,MAAM,EAAC,yBAAG,EAAE,IAAI,GAAE,EAAE,cAAc,GAAC,wBAAE,CAAC,EAAE,KAAK,CAAC,CAAC,QAAQ,EAAC,EAAE,UAAU,GAAC,wBAAE,CAAC,EAAE,KAAK,CAAC,CAAC,WAAW,EAAC,EAAE,UAAU,GAAC,wBAAE,CAAC,EAAE,KAAK,CAAC,CAAC,WAAW,EAAC,EAAE,gBAAgB,GAAC,wBAAE,CAAC,EAAE,KAAK,CAAC,CAAC,SAAS,EAAC,EAAE,QAAQ,GAAC,GAAE,EAAE,WAAW,GAAC,GAAE,EAAE,SAAS,GAAC,GAAE,EAAE,MAAM,GAAC,GAAE,EAAE,YAAY,GAAC,EAAE,WAAW,GAAC,GAAE,EAAE,eAAe,GAAC,GAAE,EAAE,KAAK,GAAC,CAAA,GAAG;AAAC,GAAE,2BAAG,CAAC,GAAE,GAAE,GAAE,GAAE,GAAE;IAAK,IAAG,CAAC,GAAE,OAAO;IAAG,IAAI,IAAE;IAAE,IAAG,MAAI,4BAAK,CAAA,IAAE,CAAA,GAAG,IAAE,IAAG,CAAA,IAAE,GAAE,IAAE,CAAC,CAAA,IAAG,IAAE,MAAK,CAAA,IAAE,GAAE,KAAG,EAAC,GAAG,IAAE,KAAG,IAAE,KAAG,MAAI,4BAAI,IAAE,KAAG,IAAE,MAAI,IAAE,KAAG,IAAE,KAAG,IAAE,KAAG,IAAE,4BAAI,MAAI,KAAG,MAAI,GAAE,OAAO,yBAAG,GAAE;IAAI,MAAI,KAAI,CAAA,IAAE,CAAA;IAAG,MAAM,IAAE,IAAI;IAAG,OAAO,EAAE,KAAK,GAAC,GAAE,EAAE,IAAI,GAAC,GAAE,EAAE,MAAM,GAAC,0BAAG,EAAE,IAAI,GAAC,GAAE,EAAE,MAAM,GAAC,MAAK,EAAE,MAAM,GAAC,GAAE,EAAE,MAAM,GAAC,KAAG,EAAE,MAAM,EAAC,EAAE,MAAM,GAAC,EAAE,MAAM,GAAC,GAAE,EAAE,SAAS,GAAC,IAAE,GAAE,EAAE,SAAS,GAAC,KAAG,EAAE,SAAS,EAAC,EAAE,SAAS,GAAC,EAAE,SAAS,GAAC,GAAE,EAAE,UAAU,GAAC,CAAC,CAAE,CAAA,AAAC,CAAA,EAAE,SAAS,GAAC,IAAE,CAAA,IAAG,CAAA,GAAG,EAAE,MAAM,GAAC,IAAI,WAAW,IAAE,EAAE,MAAM,GAAE,EAAE,IAAI,GAAC,IAAI,YAAY,EAAE,SAAS,GAAE,EAAE,IAAI,GAAC,IAAI,YAAY,EAAE,MAAM,GAAE,EAAE,WAAW,GAAC,KAAG,IAAE,GAAE,EAAE,gBAAgB,GAAC,IAAE,EAAE,WAAW,EAAC,EAAE,WAAW,GAAC,IAAI,WAAW,EAAE,gBAAgB,GAAE,EAAE,OAAO,GAAC,EAAE,WAAW,EAAC,EAAE,OAAO,GAAC,IAAG,CAAA,EAAE,WAAW,GAAC,CAAA,GAAG,EAAE,KAAK,GAAC,GAAE,EAAE,QAAQ,GAAC,GAAE,EAAE,MAAM,GAAC,GAAE,yBAAG;AAAE;AAAE,IAAI,2BAAG;IAAC,aAAY,CAAC,GAAE,IAAI,yBAAG,GAAE,GAAE,0BAAG,IAAG,GAAE;IAAI,cAAa;IAAG,cAAa;IAAG,kBAAiB;IAAG,kBAAiB,CAAC,GAAE,IAAI,yBAAG,MAAI,MAAI,EAAE,KAAK,CAAC,IAAI,GAAC,2BAAI,CAAA,EAAE,KAAK,CAAC,MAAM,GAAC,GAAE,wBAAC;IAAG,SAAQ,CAAC,GAAE;QAAK,IAAG,yBAAG,MAAI,IAAE,2BAAG,IAAE,GAAE,OAAO,IAAE,yBAAG,GAAE,4BAAI;QAAG,MAAM,IAAE,EAAE,KAAK;QAAC,IAAG,CAAC,EAAE,MAAM,IAAE,MAAI,EAAE,QAAQ,IAAE,CAAC,EAAE,KAAK,IAAE,EAAE,MAAM,KAAG,4BAAI,MAAI,yBAAE,OAAO,yBAAG,GAAE,MAAI,EAAE,SAAS,GAAC,2BAAG;QAAI,MAAM,IAAE,EAAE,UAAU;QAAC,IAAG,EAAE,UAAU,GAAC,GAAE,MAAI,EAAE,OAAO,EAAC;YAAC,IAAG,yBAAG,IAAG,MAAI,EAAE,SAAS,EAAC,OAAO,EAAE,UAAU,GAAC,IAAG;QAAE,OAAM,IAAG,MAAI,EAAE,QAAQ,IAAE,yBAAG,MAAI,yBAAG,MAAI,MAAI,yBAAE,OAAO,yBAAG,GAAE;QAAI,IAAG,EAAE,MAAM,KAAG,4BAAI,MAAI,EAAE,QAAQ,EAAC,OAAO,yBAAG,GAAE;QAAI,IAAG,EAAE,MAAM,KAAG,4BAAI,MAAI,EAAE,IAAI,IAAG,CAAA,EAAE,MAAM,GAAC,wBAAC,GAAG,EAAE,MAAM,KAAG,0BAAG;YAAC,IAAI,IAAE,2BAAI,CAAA,EAAE,MAAM,GAAC,KAAG,CAAA,KAAI,GAAE,IAAE;YAAG,IAAG,IAAE,EAAE,QAAQ,IAAE,4BAAI,EAAE,KAAK,GAAC,IAAE,IAAE,EAAE,KAAK,GAAC,IAAE,IAAE,MAAI,EAAE,KAAK,GAAC,IAAE,GAAE,KAAG,KAAG,GAAE,MAAI,EAAE,QAAQ,IAAG,CAAA,KAAG,EAAC,GAAG,KAAG,KAAG,IAAE,IAAG,yBAAG,GAAE,IAAG,MAAI,EAAE,QAAQ,IAAG,CAAA,yBAAG,GAAE,EAAE,KAAK,KAAG,KAAI,yBAAG,GAAE,QAAM,EAAE,KAAK,CAAA,GAAG,EAAE,KAAK,GAAC,GAAE,EAAE,MAAM,GAAC,0BAAG,yBAAG,IAAG,MAAI,EAAE,OAAO,EAAC,OAAO,EAAE,UAAU,GAAC,IAAG;QAAE;QAAC,IAAG,OAAK,EAAE,MAAM,EAAC;YAAA,IAAG,EAAE,KAAK,GAAC,GAAE,yBAAG,GAAE,KAAI,yBAAG,GAAE,MAAK,yBAAG,GAAE,IAAG,EAAE,MAAM,EAAC,yBAAG,GAAE,AAAC,CAAA,EAAE,MAAM,CAAC,IAAI,GAAC,IAAE,CAAA,IAAI,CAAA,EAAE,MAAM,CAAC,IAAI,GAAC,IAAE,CAAA,IAAI,CAAA,EAAE,MAAM,CAAC,KAAK,GAAC,IAAE,CAAA,IAAI,CAAA,EAAE,MAAM,CAAC,IAAI,GAAC,IAAE,CAAA,IAAI,CAAA,EAAE,MAAM,CAAC,OAAO,GAAC,KAAG,CAAA,IAAI,yBAAG,GAAE,MAAI,EAAE,MAAM,CAAC,IAAI,GAAE,yBAAG,GAAE,EAAE,MAAM,CAAC,IAAI,IAAE,IAAE,MAAK,yBAAG,GAAE,EAAE,MAAM,CAAC,IAAI,IAAE,KAAG,MAAK,yBAAG,GAAE,EAAE,MAAM,CAAC,IAAI,IAAE,KAAG,MAAK,yBAAG,GAAE,MAAI,EAAE,KAAK,GAAC,IAAE,EAAE,QAAQ,IAAE,4BAAI,EAAE,KAAK,GAAC,IAAE,IAAE,IAAG,yBAAG,GAAE,MAAI,EAAE,MAAM,CAAC,EAAE,GAAE,EAAE,MAAM,CAAC,KAAK,IAAE,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,IAAG,CAAA,yBAAG,GAAE,MAAI,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,GAAE,yBAAG,GAAE,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,IAAE,IAAE,IAAG,GAAG,EAAE,MAAM,CAAC,IAAI,IAAG,CAAA,EAAE,KAAK,GAAC,wBAAE,EAAE,KAAK,EAAC,EAAE,WAAW,EAAC,EAAE,OAAO,EAAC,EAAC,GAAG,EAAE,OAAO,GAAC,GAAE,EAAE,MAAM,GAAC;iBAAQ,IAAG,yBAAG,GAAE,IAAG,yBAAG,GAAE,IAAG,yBAAG,GAAE,IAAG,yBAAG,GAAE,IAAG,yBAAG,GAAE,IAAG,yBAAG,GAAE,MAAI,EAAE,KAAK,GAAC,IAAE,EAAE,QAAQ,IAAE,4BAAI,EAAE,KAAK,GAAC,IAAE,IAAE,IAAG,yBAAG,GAAE,IAAG,EAAE,MAAM,GAAC,0BAAG,yBAAG,IAAG,MAAI,EAAE,OAAO,EAAC,OAAO,EAAE,UAAU,GAAC,IAAG;QAAE;QAAC,IAAG,OAAK,EAAE,MAAM,EAAC;YAAC,IAAG,EAAE,MAAM,CAAC,KAAK,EAAC;gBAAC,IAAI,IAAE,EAAE,OAAO,EAAC,IAAE,AAAC,CAAA,QAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,AAAD,IAAG,EAAE,OAAO;gBAAC,MAAK,EAAE,OAAO,GAAC,IAAE,EAAE,gBAAgB,EAAE;oBAAC,IAAI,IAAE,EAAE,gBAAgB,GAAC,EAAE,OAAO;oBAAC,IAAG,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAC,EAAE,OAAO,GAAC,IAAG,EAAE,OAAO,GAAE,EAAE,OAAO,GAAC,EAAE,gBAAgB,EAAC,EAAE,MAAM,CAAC,IAAI,IAAE,EAAE,OAAO,GAAC,KAAI,CAAA,EAAE,KAAK,GAAC,wBAAE,EAAE,KAAK,EAAC,EAAE,WAAW,EAAC,EAAE,OAAO,GAAC,GAAE,EAAC,GAAG,EAAE,OAAO,IAAE,GAAE,yBAAG,IAAG,MAAI,EAAE,OAAO,EAAC,OAAO,EAAE,UAAU,GAAC,IAAG;oBAAG,IAAE,GAAE,KAAG;gBAAC;gBAAC,IAAI,IAAE,IAAI,WAAW,EAAE,MAAM,CAAC,KAAK;gBAAE,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,EAAE,OAAO,EAAC,EAAE,OAAO,GAAC,IAAG,EAAE,OAAO,GAAE,EAAE,OAAO,IAAE,GAAE,EAAE,MAAM,CAAC,IAAI,IAAE,EAAE,OAAO,GAAC,KAAI,CAAA,EAAE,KAAK,GAAC,wBAAE,EAAE,KAAK,EAAC,EAAE,WAAW,EAAC,EAAE,OAAO,GAAC,GAAE,EAAC,GAAG,EAAE,OAAO,GAAC;YAAC;YAAC,EAAE,MAAM,GAAC;QAAE;QAAC,IAAG,OAAK,EAAE,MAAM,EAAC;YAAC,IAAG,EAAE,MAAM,CAAC,IAAI,EAAC;gBAAC,IAAI,GAAE,IAAE,EAAE,OAAO;gBAAC,GAAE;oBAAC,IAAG,EAAE,OAAO,KAAG,EAAE,gBAAgB,EAAC;wBAAC,IAAG,EAAE,MAAM,CAAC,IAAI,IAAE,EAAE,OAAO,GAAC,KAAI,CAAA,EAAE,KAAK,GAAC,wBAAE,EAAE,KAAK,EAAC,EAAE,WAAW,EAAC,EAAE,OAAO,GAAC,GAAE,EAAC,GAAG,yBAAG,IAAG,MAAI,EAAE,OAAO,EAAC,OAAO,EAAE,UAAU,GAAC,IAAG;wBAAG,IAAE;oBAAC;oBAAC,IAAE,EAAE,OAAO,GAAC,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,GAAC,MAAI,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,OAAO,MAAI,GAAE,yBAAG,GAAE;gBAAE,QAAO,MAAI,GAAG;gBAAA,EAAE,MAAM,CAAC,IAAI,IAAE,EAAE,OAAO,GAAC,KAAI,CAAA,EAAE,KAAK,GAAC,wBAAE,EAAE,KAAK,EAAC,EAAE,WAAW,EAAC,EAAE,OAAO,GAAC,GAAE,EAAC,GAAG,EAAE,OAAO,GAAC;YAAC;YAAC,EAAE,MAAM,GAAC;QAAE;QAAC,IAAG,OAAK,EAAE,MAAM,EAAC;YAAC,IAAG,EAAE,MAAM,CAAC,OAAO,EAAC;gBAAC,IAAI,GAAE,IAAE,EAAE,OAAO;gBAAC,GAAE;oBAAC,IAAG,EAAE,OAAO,KAAG,EAAE,gBAAgB,EAAC;wBAAC,IAAG,EAAE,MAAM,CAAC,IAAI,IAAE,EAAE,OAAO,GAAC,KAAI,CAAA,EAAE,KAAK,GAAC,wBAAE,EAAE,KAAK,EAAC,EAAE,WAAW,EAAC,EAAE,OAAO,GAAC,GAAE,EAAC,GAAG,yBAAG,IAAG,MAAI,EAAE,OAAO,EAAC,OAAO,EAAE,UAAU,GAAC,IAAG;wBAAG,IAAE;oBAAC;oBAAC,IAAE,EAAE,OAAO,GAAC,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,GAAC,MAAI,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,OAAO,MAAI,GAAE,yBAAG,GAAE;gBAAE,QAAO,MAAI,GAAG;gBAAA,EAAE,MAAM,CAAC,IAAI,IAAE,EAAE,OAAO,GAAC,KAAI,CAAA,EAAE,KAAK,GAAC,wBAAE,EAAE,KAAK,EAAC,EAAE,WAAW,EAAC,EAAE,OAAO,GAAC,GAAE,EAAC;YAAE;YAAC,EAAE,MAAM,GAAC;QAAG;QAAC,IAAG,QAAM,EAAE,MAAM,EAAC;YAAC,IAAG,EAAE,MAAM,CAAC,IAAI,EAAC;gBAAC,IAAG,EAAE,OAAO,GAAC,IAAE,EAAE,gBAAgB,IAAG,CAAA,yBAAG,IAAG,MAAI,EAAE,OAAO,AAAD,GAAG,OAAO,EAAE,UAAU,GAAC,IAAG;gBAAG,yBAAG,GAAE,MAAI,EAAE,KAAK,GAAE,yBAAG,GAAE,EAAE,KAAK,IAAE,IAAE,MAAK,EAAE,KAAK,GAAC;YAAC;YAAC,IAAG,EAAE,MAAM,GAAC,0BAAG,yBAAG,IAAG,MAAI,EAAE,OAAO,EAAC,OAAO,EAAE,UAAU,GAAC,IAAG;QAAE;QAAC,IAAG,MAAI,EAAE,QAAQ,IAAE,MAAI,EAAE,SAAS,IAAE,MAAI,2BAAG,EAAE,MAAM,KAAG,0BAAG;YAAC,IAAI,IAAE,MAAI,EAAE,KAAK,GAAC,yBAAG,GAAE,KAAG,EAAE,QAAQ,KAAG,2BAAG,AAAC,CAAA,CAAC,GAAE;gBAAK,IAAI;gBAAE,OAAO;oBAAC,IAAG,MAAI,EAAE,SAAS,IAAG,CAAA,yBAAG,IAAG,MAAI,EAAE,SAAS,AAAD,GAAG;wBAAC,IAAG,MAAI,yBAAE,OAAO;wBAAE;oBAAK;oBAAC,IAAG,EAAE,YAAY,GAAC,GAAE,IAAE,wBAAE,GAAE,GAAE,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,GAAE,EAAE,SAAS,IAAG,EAAE,QAAQ,IAAG,KAAI,CAAA,yBAAG,GAAE,CAAC,IAAG,MAAI,EAAE,IAAI,CAAC,SAAS,AAAD,GAAG,OAAO;gBAAC;gBAAC,OAAO,EAAE,MAAM,GAAC,GAAE,MAAI,0BAAG,CAAA,yBAAG,GAAE,CAAC,IAAG,MAAI,EAAE,IAAI,CAAC,SAAS,GAAC,IAAE,CAAA,IAAG,EAAE,QAAQ,IAAG,CAAA,yBAAG,GAAE,CAAC,IAAG,MAAI,EAAE,IAAI,CAAC,SAAS,AAAD,IAAG,IAAE;YAAC,CAAA,EAAG,GAAE,KAAG,EAAE,QAAQ,KAAG,2BAAG,AAAC,CAAA,CAAC,GAAE;gBAAK,IAAI,GAAE,GAAE,GAAE;gBAAE,MAAM,IAAE,EAAE,MAAM;gBAAC,OAAO;oBAAC,IAAG,EAAE,SAAS,IAAE,0BAAG;wBAAC,IAAG,yBAAG,IAAG,EAAE,SAAS,IAAE,4BAAI,MAAI,yBAAE,OAAO;wBAAE,IAAG,MAAI,EAAE,SAAS,EAAC;oBAAK;oBAAC,IAAG,EAAE,YAAY,GAAC,GAAE,EAAE,SAAS,IAAE,KAAG,EAAE,QAAQ,GAAC,KAAI,CAAA,IAAE,EAAE,QAAQ,GAAC,GAAE,IAAE,CAAC,CAAC,EAAE,EAAC,MAAI,CAAC,CAAC,EAAE,EAAE,IAAE,MAAI,CAAC,CAAC,EAAE,EAAE,IAAE,MAAI,CAAC,CAAC,EAAE,EAAE,AAAD,GAAG;wBAAC,IAAE,EAAE,QAAQ,GAAC;wBAAG;+BAAU,MAAI,CAAC,CAAC,EAAE,EAAE,IAAE,MAAI,CAAC,CAAC,EAAE,EAAE,IAAE,MAAI,CAAC,CAAC,EAAE,EAAE,IAAE,MAAI,CAAC,CAAC,EAAE,EAAE,IAAE,MAAI,CAAC,CAAC,EAAE,EAAE,IAAE,MAAI,CAAC,CAAC,EAAE,EAAE,IAAE,MAAI,CAAC,CAAC,EAAE,EAAE,IAAE,MAAI,CAAC,CAAC,EAAE,EAAE,IAAE,IAAE,GAAG;wBAAA,EAAE,YAAY,GAAC,2BAAI,CAAA,IAAE,CAAA,GAAG,EAAE,YAAY,GAAC,EAAE,SAAS,IAAG,CAAA,EAAE,YAAY,GAAC,EAAE,SAAS,AAAD;oBAAE;oBAAC,IAAG,EAAE,YAAY,IAAE,IAAG,CAAA,IAAE,wBAAE,GAAE,GAAE,EAAE,YAAY,GAAC,IAAG,EAAE,SAAS,IAAE,EAAE,YAAY,EAAC,EAAE,QAAQ,IAAE,EAAE,YAAY,EAAC,EAAE,YAAY,GAAC,CAAA,IAAI,CAAA,IAAE,wBAAE,GAAE,GAAE,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,GAAE,EAAE,SAAS,IAAG,EAAE,QAAQ,EAAC,GAAG,KAAI,CAAA,yBAAG,GAAE,CAAC,IAAG,MAAI,EAAE,IAAI,CAAC,SAAS,AAAD,GAAG,OAAO;gBAAC;gBAAC,OAAO,EAAE,MAAM,GAAC,GAAE,MAAI,0BAAG,CAAA,yBAAG,GAAE,CAAC,IAAG,MAAI,EAAE,IAAI,CAAC,SAAS,GAAC,IAAE,CAAA,IAAG,EAAE,QAAQ,IAAG,CAAA,yBAAG,GAAE,CAAC,IAAG,MAAI,EAAE,IAAI,CAAC,SAAS,AAAD,IAAG,IAAE;YAAC,CAAA,EAAG,GAAE,KAAG,wBAAE,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,GAAE;YAAG,IAAG,MAAI,KAAG,MAAI,KAAI,CAAA,EAAE,MAAM,GAAC,wBAAC,GAAG,MAAI,KAAG,MAAI,GAAE,OAAO,MAAI,EAAE,SAAS,IAAG,CAAA,EAAE,UAAU,GAAC,EAAC,GAAG;YAAG,IAAG,MAAI,KAAI,CAAA,MAAI,0BAAE,wBAAE,KAAG,MAAI,2BAAI,CAAA,wBAAE,GAAE,GAAE,GAAE,CAAC,IAAG,MAAI,2BAAI,CAAA,yBAAG,EAAE,IAAI,GAAE,MAAI,EAAE,SAAS,IAAG,CAAA,EAAE,QAAQ,GAAC,GAAE,EAAE,WAAW,GAAC,GAAE,EAAE,MAAM,GAAC,CAAA,CAAC,CAAC,GAAG,yBAAG,IAAG,MAAI,EAAE,SAAS,AAAD,GAAG,OAAO,EAAE,UAAU,GAAC,IAAG;QAAE;QAAC,OAAO,MAAI,0BAAE,2BAAG,EAAE,IAAI,IAAE,IAAE,2BAAI,CAAA,MAAI,EAAE,IAAI,GAAE,CAAA,yBAAG,GAAE,MAAI,EAAE,KAAK,GAAE,yBAAG,GAAE,EAAE,KAAK,IAAE,IAAE,MAAK,yBAAG,GAAE,EAAE,KAAK,IAAE,KAAG,MAAK,yBAAG,GAAE,EAAE,KAAK,IAAE,KAAG,MAAK,yBAAG,GAAE,MAAI,EAAE,QAAQ,GAAE,yBAAG,GAAE,EAAE,QAAQ,IAAE,IAAE,MAAK,yBAAG,GAAE,EAAE,QAAQ,IAAE,KAAG,MAAK,yBAAG,GAAE,EAAE,QAAQ,IAAE,KAAG,IAAG,IAAI,CAAA,yBAAG,GAAE,EAAE,KAAK,KAAG,KAAI,yBAAG,GAAE,QAAM,EAAE,KAAK,CAAA,GAAG,yBAAG,IAAG,EAAE,IAAI,GAAC,KAAI,CAAA,EAAE,IAAI,GAAC,CAAC,EAAE,IAAI,AAAD,GAAG,MAAI,EAAE,OAAO,GAAC,2BAAG,wBAAC;IAAE;IAAE,YAAW,CAAA;QAAI,IAAG,yBAAG,IAAG,OAAO;QAAG,MAAM,IAAE,EAAE,KAAK,CAAC,MAAM;QAAC,OAAO,EAAE,KAAK,GAAC,MAAK,MAAI,2BAAG,yBAAG,GAAE,4BAAI;IAAE;IAAE,sBAAqB,CAAC,GAAE;QAAK,IAAI,IAAE,EAAE,MAAM;QAAC,IAAG,yBAAG,IAAG,OAAO;QAAG,MAAM,IAAE,EAAE,KAAK,EAAC,IAAE,EAAE,IAAI;QAAC,IAAG,MAAI,KAAG,MAAI,KAAG,EAAE,MAAM,KAAG,4BAAI,EAAE,SAAS,EAAC,OAAO;QAAG,IAAG,MAAI,KAAI,CAAA,EAAE,KAAK,GAAC,wBAAE,EAAE,KAAK,EAAC,GAAE,GAAE,EAAC,GAAG,EAAE,IAAI,GAAC,GAAE,KAAG,EAAE,MAAM,EAAC;YAAC,MAAI,KAAI,CAAA,yBAAG,EAAE,IAAI,GAAE,EAAE,QAAQ,GAAC,GAAE,EAAE,WAAW,GAAC,GAAE,EAAE,MAAM,GAAC,CAAA;YAAG,IAAI,IAAE,IAAI,WAAW,EAAE,MAAM;YAAE,EAAE,GAAG,CAAC,EAAE,QAAQ,CAAC,IAAE,EAAE,MAAM,EAAC,IAAG,IAAG,IAAE,GAAE,IAAE,EAAE,MAAM;QAAA;QAAC,MAAM,IAAE,EAAE,QAAQ,EAAC,IAAE,EAAE,OAAO,EAAC,IAAE,EAAE,KAAK;QAAC,IAAI,EAAE,QAAQ,GAAC,GAAE,EAAE,OAAO,GAAC,GAAE,EAAE,KAAK,GAAC,GAAE,yBAAG,IAAG,EAAE,SAAS,IAAE,GAAG;YAAC,IAAI,IAAE,EAAE,QAAQ,EAAC,IAAE,EAAE,SAAS,GAAC;YAAE,GAAG,EAAE,KAAK,GAAC,yBAAG,GAAE,EAAE,KAAK,EAAC,EAAE,MAAM,CAAC,IAAE,IAAE,EAAE,GAAE,EAAE,IAAI,CAAC,IAAE,EAAE,MAAM,CAAC,GAAC,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,EAAC,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,GAAC,GAAE;mBAAU,EAAE,GAAG;YAAA,EAAE,QAAQ,GAAC,GAAE,EAAE,SAAS,GAAC,GAAE,yBAAG;QAAE;QAAC,OAAO,EAAE,QAAQ,IAAE,EAAE,SAAS,EAAC,EAAE,WAAW,GAAC,EAAE,QAAQ,EAAC,EAAE,MAAM,GAAC,EAAE,SAAS,EAAC,EAAE,SAAS,GAAC,GAAE,EAAE,YAAY,GAAC,EAAE,WAAW,GAAC,GAAE,EAAE,eAAe,GAAC,GAAE,EAAE,OAAO,GAAC,GAAE,EAAE,KAAK,GAAC,GAAE,EAAE,QAAQ,GAAC,GAAE,EAAE,IAAI,GAAC,GAAE;IAAE;IAAE,aAAY;AAAoC;AAAE,MAAM,2BAAG,CAAC,GAAE,IAAI,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAE;AAAG,IAAI,2BAAG;IAAC,QAAO,SAAS,CAAC;QAAE,MAAM,IAAE,MAAM,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,WAAU;QAAG,MAAK,EAAE,MAAM,EAAE;YAAC,MAAM,IAAE,EAAE,KAAK;YAAG,IAAG,GAAE;gBAAC,IAAG,YAAU,OAAO,GAAE,MAAM,IAAI,UAAU,IAAE;gBAAsB,IAAI,MAAM,KAAK,EAAE,yBAAG,GAAE,MAAK,CAAA,CAAC,CAAC,EAAE,GAAC,CAAC,CAAC,EAAE,AAAD;YAAE;QAAC;QAAC,OAAO;IAAC;IAAE,eAAc,CAAA;QAAI,IAAI,IAAE;QAAE,IAAI,IAAI,IAAE,GAAE,IAAE,EAAE,MAAM,EAAC,IAAE,GAAE,IAAI,KAAG,CAAC,CAAC,EAAE,CAAC,MAAM;QAAC,MAAM,IAAE,IAAI,WAAW;QAAG,IAAI,IAAI,IAAE,GAAE,IAAE,GAAE,IAAE,EAAE,MAAM,EAAC,IAAE,GAAE,IAAI;YAAC,IAAI,IAAE,CAAC,CAAC,EAAE;YAAC,EAAE,GAAG,CAAC,GAAE,IAAG,KAAG,EAAE,MAAM;QAAA;QAAC,OAAO;IAAC;AAAC;AAAE,IAAI,2BAAG,CAAC;AAAE,IAAG;IAAC,OAAO,YAAY,CAAC,KAAK,CAAC,MAAK,IAAI,WAAW;AAAG,EAAC,OAAM,GAAE;IAAC,2BAAG,CAAC;AAAC;AAAC,MAAM,2BAAG,IAAI,WAAW;AAAK,IAAI,IAAI,IAAE,GAAE,IAAE,KAAI,IAAI,wBAAE,CAAC,EAAE,GAAC,KAAG,MAAI,IAAE,KAAG,MAAI,IAAE,KAAG,MAAI,IAAE,KAAG,MAAI,IAAE,KAAG,MAAI,IAAE;AAAE,wBAAE,CAAC,IAAI,GAAC,wBAAE,CAAC,IAAI,GAAC;AAAE,IAAI,2BAAG;IAAC,YAAW,CAAA;QAAI,IAAG,cAAY,OAAO,eAAa,YAAY,SAAS,CAAC,MAAM,EAAC,OAAM,AAAC,CAAA,IAAI,WAAU,EAAG,MAAM,CAAC;QAAG,IAAI,GAAE,GAAE,GAAE,GAAE,GAAE,IAAE,EAAE,MAAM,EAAC,IAAE;QAAE,IAAI,IAAE,GAAE,IAAE,GAAE,IAAI,IAAE,EAAE,UAAU,CAAC,IAAG,SAAQ,CAAA,QAAM,CAAA,KAAI,IAAE,IAAE,KAAI,CAAA,IAAE,EAAE,UAAU,CAAC,IAAE,IAAG,SAAQ,CAAA,QAAM,CAAA,KAAK,CAAA,IAAE,QAAO,CAAA,IAAE,SAAO,EAAC,IAAI,CAAA,IAAE,KAAI,GAAG,GAAE,CAAC,GAAG,KAAG,IAAE,MAAI,IAAE,IAAE,OAAK,IAAE,IAAE,QAAM,IAAE;QAAE,IAAI,IAAE,IAAI,WAAW,IAAG,IAAE,GAAE,IAAE,GAAE,IAAE,GAAE,IAAI,IAAE,EAAE,UAAU,CAAC,IAAG,SAAQ,CAAA,QAAM,CAAA,KAAI,IAAE,IAAE,KAAI,CAAA,IAAE,EAAE,UAAU,CAAC,IAAE,IAAG,SAAQ,CAAA,QAAM,CAAA,KAAK,CAAA,IAAE,QAAO,CAAA,IAAE,SAAO,EAAC,IAAI,CAAA,IAAE,KAAI,GAAG,GAAE,CAAC,GAAG,IAAE,MAAI,CAAC,CAAC,IAAI,GAAC,IAAE,IAAE,OAAM,CAAA,CAAC,CAAC,IAAI,GAAC,MAAI,MAAI,GAAE,CAAC,CAAC,IAAI,GAAC,MAAI,KAAG,CAAA,IAAG,IAAE,QAAO,CAAA,CAAC,CAAC,IAAI,GAAC,MAAI,MAAI,IAAG,CAAC,CAAC,IAAI,GAAC,MAAI,MAAI,IAAE,IAAG,CAAC,CAAC,IAAI,GAAC,MAAI,KAAG,CAAA,IAAI,CAAA,CAAC,CAAC,IAAI,GAAC,MAAI,MAAI,IAAG,CAAC,CAAC,IAAI,GAAC,MAAI,MAAI,KAAG,IAAG,CAAC,CAAC,IAAI,GAAC,MAAI,MAAI,IAAE,IAAG,CAAC,CAAC,IAAI,GAAC,MAAI,KAAG,CAAA;QAAG,OAAO;IAAC;IAAE,YAAW,CAAC,GAAE;QAAK,MAAM,IAAE,KAAG,EAAE,MAAM;QAAC,IAAG,cAAY,OAAO,eAAa,YAAY,SAAS,CAAC,MAAM,EAAC,OAAM,AAAC,CAAA,IAAI,WAAU,EAAG,MAAM,CAAC,EAAE,QAAQ,CAAC,GAAE;QAAI,IAAI,GAAE;QAAE,MAAM,IAAE,IAAI,MAAM,IAAE;QAAG,IAAI,IAAE,GAAE,IAAE,GAAE,IAAE,GAAG;YAAC,IAAI,IAAE,CAAC,CAAC,IAAI;YAAC,IAAG,IAAE,KAAI;gBAAC,CAAC,CAAC,IAAI,GAAC;gBAAE;YAAQ;YAAC,IAAI,IAAE,wBAAE,CAAC,EAAE;YAAC,IAAG,IAAE,GAAE,CAAC,CAAC,IAAI,GAAC,OAAM,KAAG,IAAE;iBAAM;gBAAC,IAAI,KAAG,MAAI,IAAE,KAAG,MAAI,IAAE,KAAG,GAAE,IAAE,KAAG,IAAE,GAAG,IAAE,KAAG,IAAE,KAAG,CAAC,CAAC,IAAI,EAAC;gBAAI,IAAE,IAAE,CAAC,CAAC,IAAI,GAAC,QAAM,IAAE,QAAM,CAAC,CAAC,IAAI,GAAC,IAAG,CAAA,KAAG,OAAM,CAAC,CAAC,IAAI,GAAC,QAAM,KAAG,KAAG,MAAK,CAAC,CAAC,IAAI,GAAC,QAAM,OAAK,CAAA;YAAE;QAAC;QAAC,OAAM,AAAC,CAAA,CAAC,GAAE;YAAK,IAAG,IAAE,SAAO,EAAE,QAAQ,IAAE,0BAAG,OAAO,OAAO,YAAY,CAAC,KAAK,CAAC,MAAK,EAAE,MAAM,KAAG,IAAE,IAAE,EAAE,QAAQ,CAAC,GAAE;YAAI,IAAI,IAAE;YAAG,IAAI,IAAI,IAAE,GAAE,IAAE,GAAE,IAAI,KAAG,OAAO,YAAY,CAAC,CAAC,CAAC,EAAE;YAAE,OAAO;QAAC,CAAA,EAAG,GAAE;IAAE;IAAE,YAAW,CAAC,GAAE;QAAM,CAAA,IAAE,KAAG,EAAE,MAAM,AAAD,IAAG,EAAE,MAAM,IAAG,CAAA,IAAE,EAAE,MAAM,AAAD;QAAG,IAAI,IAAE,IAAE;QAAE,MAAK,KAAG,KAAG,OAAM,CAAA,MAAI,CAAC,CAAC,EAAE,AAAD,GAAI;QAAI,OAAO,IAAE,KAAG,MAAI,IAAE,IAAE,IAAE,wBAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAC,IAAE,IAAE;IAAC;AAAC;AAAE,IAAI,2BAAG;IAAW,IAAI,CAAC,KAAK,GAAC,MAAK,IAAI,CAAC,OAAO,GAAC,GAAE,IAAI,CAAC,QAAQ,GAAC,GAAE,IAAI,CAAC,QAAQ,GAAC,GAAE,IAAI,CAAC,MAAM,GAAC,MAAK,IAAI,CAAC,QAAQ,GAAC,GAAE,IAAI,CAAC,SAAS,GAAC,GAAE,IAAI,CAAC,SAAS,GAAC,GAAE,IAAI,CAAC,GAAG,GAAC,IAAG,IAAI,CAAC,KAAK,GAAC,MAAK,IAAI,CAAC,SAAS,GAAC,GAAE,IAAI,CAAC,KAAK,GAAC;AAAC;AAAE,MAAM,2BAAG,OAAO,SAAS,CAAC,QAAQ,EAAC,EAAC,YAAW,wBAAE,EAAC,cAAa,wBAAE,EAAC,cAAa,wBAAE,EAAC,UAAS,wBAAE,EAAC,MAAK,wBAAE,EAAC,cAAa,wBAAE,EAAC,uBAAsB,wBAAE,EAAC,oBAAmB,wBAAE,EAAC,YAAW,wBAAE,EAAC,GAAC;AAAE,SAAS,yBAAG,CAAC;IAAE,IAAI,CAAC,OAAO,GAAC,yBAAG,MAAM,CAAC;QAAC,OAAM;QAAG,QAAO;QAAG,WAAU;QAAM,YAAW;QAAG,UAAS;QAAE,UAAS;IAAE,GAAE,KAAG,CAAC;IAAG,IAAI,IAAE,IAAI,CAAC,OAAO;IAAC,EAAE,GAAG,IAAE,EAAE,UAAU,GAAC,IAAE,EAAE,UAAU,GAAC,CAAC,EAAE,UAAU,GAAC,EAAE,IAAI,IAAE,EAAE,UAAU,GAAC,KAAG,EAAE,UAAU,GAAC,MAAK,CAAA,EAAE,UAAU,IAAE,EAAC,GAAG,IAAI,CAAC,GAAG,GAAC,GAAE,IAAI,CAAC,GAAG,GAAC,IAAG,IAAI,CAAC,KAAK,GAAC,CAAC,GAAE,IAAI,CAAC,MAAM,GAAC,EAAE,EAAC,IAAI,CAAC,IAAI,GAAC,IAAI,0BAAG,IAAI,CAAC,IAAI,CAAC,SAAS,GAAC;IAAE,IAAI,IAAE,yBAAG,YAAY,CAAC,IAAI,CAAC,IAAI,EAAC,EAAE,KAAK,EAAC,EAAE,MAAM,EAAC,EAAE,UAAU,EAAC,EAAE,QAAQ,EAAC,EAAE,QAAQ;IAAE,IAAG,MAAI,0BAAG,MAAM,IAAI,MAAM,uBAAC,CAAC,EAAE;IAAE,IAAG,EAAE,MAAM,IAAE,yBAAG,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAC,EAAE,MAAM,GAAE,EAAE,UAAU,EAAC;QAAC,IAAI;QAAE,IAAG,IAAE,YAAU,OAAO,EAAE,UAAU,GAAC,yBAAG,UAAU,CAAC,EAAE,UAAU,IAAE,2BAAyB,yBAAG,IAAI,CAAC,EAAE,UAAU,IAAE,IAAI,WAAW,EAAE,UAAU,IAAE,EAAE,UAAU,EAAC,IAAE,yBAAG,oBAAoB,CAAC,IAAI,CAAC,IAAI,EAAC,IAAG,MAAI,0BAAG,MAAM,IAAI,MAAM,uBAAC,CAAC,EAAE;QAAE,IAAI,CAAC,SAAS,GAAC,CAAC;IAAC;AAAC;AAAC,SAAS,yBAAG,CAAC,EAAC,CAAC;IAAE,MAAM,IAAE,IAAI,yBAAG;IAAG,IAAG,EAAE,IAAI,CAAC,GAAE,CAAC,IAAG,EAAE,GAAG,EAAC,MAAM,EAAE,GAAG,IAAE,uBAAC,CAAC,EAAE,GAAG,CAAC;IAAC,OAAO,EAAE,MAAM;AAAA;AAAC,yBAAG,SAAS,CAAC,IAAI,GAAC,SAAS,CAAC,EAAC,CAAC;IAAE,MAAM,IAAE,IAAI,CAAC,IAAI,EAAC,IAAE,IAAI,CAAC,OAAO,CAAC,SAAS;IAAC,IAAI,GAAE;IAAE,IAAG,IAAI,CAAC,KAAK,EAAC,OAAM,CAAC;IAAE,IAAI,IAAE,MAAI,CAAC,CAAC,IAAE,IAAE,CAAC,MAAI,IAAE,2BAAG,0BAAG,YAAU,OAAO,IAAE,EAAE,KAAK,GAAC,yBAAG,UAAU,CAAC,KAAG,2BAAyB,yBAAG,IAAI,CAAC,KAAG,EAAE,KAAK,GAAC,IAAI,WAAW,KAAG,EAAE,KAAK,GAAC,GAAE,EAAE,OAAO,GAAC,GAAE,EAAE,QAAQ,GAAC,EAAE,KAAK,CAAC,MAAM,GAAG,IAAG,MAAI,EAAE,SAAS,IAAG,CAAA,EAAE,MAAM,GAAC,IAAI,WAAW,IAAG,EAAE,QAAQ,GAAC,GAAE,EAAE,SAAS,GAAC,CAAA,GAAG,AAAC,CAAA,MAAI,4BAAI,MAAI,wBAAC,KAAI,EAAE,SAAS,IAAE,GAAE,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAE,EAAE,QAAQ,IAAG,EAAE,SAAS,GAAC;SAAM;QAAC,IAAG,IAAE,yBAAG,OAAO,CAAC,GAAE,IAAG,MAAI,0BAAG,OAAO,EAAE,QAAQ,GAAC,KAAG,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAE,EAAE,QAAQ,IAAG,IAAE,yBAAG,UAAU,CAAC,IAAI,CAAC,IAAI,GAAE,IAAI,CAAC,KAAK,CAAC,IAAG,IAAI,CAAC,KAAK,GAAC,CAAC,GAAE,MAAI;QAAG,IAAG,MAAI,EAAE,SAAS,EAAC;YAAC,IAAG,IAAE,KAAG,EAAE,QAAQ,GAAC,GAAE,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAE,EAAE,QAAQ,IAAG,EAAE,SAAS,GAAC;iBAAO,IAAG,MAAI,EAAE,QAAQ,EAAC;QAAK,OAAM,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM;IAAC;IAAC,OAAM,CAAC;AAAC,GAAE,yBAAG,SAAS,CAAC,MAAM,GAAC,SAAS,CAAC;IAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;AAAE,GAAE,yBAAG,SAAS,CAAC,KAAK,GAAC,SAAS,CAAC;IAAE,MAAI,4BAAK,CAAA,IAAI,CAAC,MAAM,GAAC,yBAAG,aAAa,CAAC,IAAI,CAAC,MAAM,CAAA,GAAG,IAAI,CAAC,MAAM,GAAC,EAAE,EAAC,IAAI,CAAC,GAAG,GAAC,GAAE,IAAI,CAAC,GAAG,GAAC,IAAI,CAAC,IAAI,CAAC,GAAG;AAAA;AAAE,IAAI,2BAAG;IAAC,SAAQ;IAAG,SAAQ;IAAG,YAAW,SAAS,CAAC,EAAC,CAAC;QAAE,OAAM,AAAC,CAAA,IAAE,KAAG,CAAC,CAAA,EAAG,GAAG,GAAC,CAAC,GAAE,yBAAG,GAAE;IAAE;IAAE,MAAK,SAAS,CAAC,EAAC,CAAC;QAAE,OAAM,AAAC,CAAA,IAAE,KAAG,CAAC,CAAA,EAAG,IAAI,GAAC,CAAC,GAAE,yBAAG,GAAE;IAAE;IAAE,WAAU;AAAC;AAAE,MAAM,2BAAG;AAAM,IAAI,2BAAG,SAAS,CAAC,EAAC,CAAC;IAAE,IAAI,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE;IAAE,MAAM,IAAE,EAAE,KAAK;IAAC,IAAE,EAAE,OAAO,EAAC,IAAE,EAAE,KAAK,EAAC,IAAE,IAAG,CAAA,EAAE,QAAQ,GAAC,CAAA,GAAG,IAAE,EAAE,QAAQ,EAAC,IAAE,EAAE,MAAM,EAAC,IAAE,IAAG,CAAA,IAAE,EAAE,SAAS,AAAD,GAAG,IAAE,IAAG,CAAA,EAAE,SAAS,GAAC,GAAE,GAAG,IAAE,EAAE,IAAI,EAAC,IAAE,EAAE,KAAK,EAAC,IAAE,EAAE,KAAK,EAAC,IAAE,EAAE,KAAK,EAAC,IAAE,EAAE,MAAM,EAAC,IAAE,EAAE,IAAI,EAAC,IAAE,EAAE,IAAI,EAAC,IAAE,EAAE,OAAO,EAAC,IAAE,EAAE,QAAQ,EAAC,IAAE,AAAC,CAAA,KAAG,EAAE,OAAO,AAAD,IAAG,GAAE,IAAE,AAAC,CAAA,KAAG,EAAE,QAAQ,AAAD,IAAG;IAAE,GAAE,GAAE;QAAC,IAAE,MAAK,CAAA,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG,GAAE,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG,CAAA,GAAG,IAAE,CAAC,CAAC,IAAE,EAAE;QAAC,GAAE,OAAO;YAAC,IAAG,IAAE,MAAI,IAAG,OAAK,GAAE,KAAG,GAAE,IAAE,MAAI,KAAG,KAAI,MAAI,GAAE,CAAC,CAAC,IAAI,GAAC,QAAM;iBAAM;gBAAC,IAAG,CAAE,CAAA,KAAG,CAAA,GAAG;oBAAC,IAAG,KAAI,CAAA,KAAG,CAAA,GAAG;wBAAC,IAAE,CAAC,CAAC,AAAC,CAAA,QAAM,CAAA,IAAI,CAAA,IAAE,AAAC,CAAA,KAAG,CAAA,IAAG,CAAA,EAAG;wBAAC,SAAS;oBAAC;oBAAC,IAAG,KAAG,GAAE;wBAAC,EAAE,IAAI,GAAC;wBAAM,MAAM;oBAAC;oBAAC,EAAE,GAAG,GAAC,+BAA8B,EAAE,IAAI,GAAC;oBAAG,MAAM;gBAAC;gBAAC,IAAE,QAAM,GAAE,KAAG,IAAG,KAAI,CAAA,IAAE,KAAI,CAAA,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG,CAAA,GAAG,KAAG,IAAE,AAAC,CAAA,KAAG,CAAA,IAAG,GAAE,OAAK,GAAE,KAAG,CAAA,GAAG,IAAE,MAAK,CAAA,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG,GAAE,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG,CAAA,GAAG,IAAE,CAAC,CAAC,IAAE,EAAE;gBAAC,GAAE,OAAO;oBAAC,IAAG,IAAE,MAAI,IAAG,OAAK,GAAE,KAAG,GAAE,IAAE,MAAI,KAAG,KAAI,CAAE,CAAA,KAAG,CAAA,GAAG;wBAAC,IAAG,KAAI,CAAA,KAAG,CAAA,GAAG;4BAAC,IAAE,CAAC,CAAC,AAAC,CAAA,QAAM,CAAA,IAAI,CAAA,IAAE,AAAC,CAAA,KAAG,CAAA,IAAG,CAAA,EAAG;4BAAC,SAAS;wBAAC;wBAAC,EAAE,GAAG,GAAC,yBAAwB,EAAE,IAAI,GAAC;wBAAG,MAAM;oBAAC;oBAAC,IAAG,IAAE,QAAM,GAAE,KAAG,IAAG,IAAE,KAAI,CAAA,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG,GAAE,IAAE,KAAI,CAAA,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG,CAAA,CAAC,GAAG,KAAG,IAAE,AAAC,CAAA,KAAG,CAAA,IAAG,GAAE,IAAE,GAAE;wBAAC,EAAE,GAAG,GAAC,iCAAgC,EAAE,IAAI,GAAC;wBAAG,MAAM;oBAAC;oBAAC,IAAG,OAAK,GAAE,KAAG,GAAE,IAAE,IAAE,GAAE,IAAE,GAAE;wBAAC,IAAG,IAAE,IAAE,GAAE,IAAE,KAAG,EAAE,IAAI,EAAC;4BAAC,EAAE,GAAG,GAAC,iCAAgC,EAAE,IAAI,GAAC;4BAAG,MAAM;wBAAC;wBAAC,IAAG,IAAE,GAAE,IAAE,GAAE,MAAI,GAAG;4BAAA,IAAG,KAAG,IAAE,GAAE,IAAE,GAAE;gCAAC,KAAG;gCAAE,GAAG,CAAC,CAAC,IAAI,GAAC,CAAC,CAAC,IAAI;uCAAO,EAAE,GAAG;gCAAA,IAAE,IAAE,GAAE,IAAE;4BAAC;wBAAA,OAAO,IAAG,IAAE,GAAG;4BAAA,IAAG,KAAG,IAAE,IAAE,GAAE,KAAG,GAAE,IAAE,GAAE;gCAAC,KAAG;gCAAE,GAAG,CAAC,CAAC,IAAI,GAAC,CAAC,CAAC,IAAI;uCAAO,EAAE,GAAG;gCAAA,IAAG,IAAE,GAAE,IAAE,GAAE;oCAAC,IAAE,GAAE,KAAG;oCAAE,GAAG,CAAC,CAAC,IAAI,GAAC,CAAC,CAAC,IAAI;2CAAO,EAAE,GAAG;oCAAA,IAAE,IAAE,GAAE,IAAE;gCAAC;4BAAC;wBAAA,OAAO,IAAG,KAAG,IAAE,GAAE,IAAE,GAAE;4BAAC,KAAG;4BAAE,GAAG,CAAC,CAAC,IAAI,GAAC,CAAC,CAAC,IAAI;mCAAO,EAAE,GAAG;4BAAA,IAAE,IAAE,GAAE,IAAE;wBAAC;wBAAC,MAAK,IAAE,GAAG,CAAC,CAAC,IAAI,GAAC,CAAC,CAAC,IAAI,EAAC,CAAC,CAAC,IAAI,GAAC,CAAC,CAAC,IAAI,EAAC,CAAC,CAAC,IAAI,GAAC,CAAC,CAAC,IAAI,EAAC,KAAG;wBAAE,KAAI,CAAA,CAAC,CAAC,IAAI,GAAC,CAAC,CAAC,IAAI,EAAC,IAAE,KAAI,CAAA,CAAC,CAAC,IAAI,GAAC,CAAC,CAAC,IAAI,AAAD,CAAC;oBAAE,OAAK;wBAAC,IAAE,IAAE;wBAAE,GAAG,CAAC,CAAC,IAAI,GAAC,CAAC,CAAC,IAAI,EAAC,CAAC,CAAC,IAAI,GAAC,CAAC,CAAC,IAAI,EAAC,CAAC,CAAC,IAAI,GAAC,CAAC,CAAC,IAAI,EAAC,KAAG;+BAAQ,IAAE,GAAG;wBAAA,KAAI,CAAA,CAAC,CAAC,IAAI,GAAC,CAAC,CAAC,IAAI,EAAC,IAAE,KAAI,CAAA,CAAC,CAAC,IAAI,GAAC,CAAC,CAAC,IAAI,AAAD,CAAC;oBAAE;oBAAC;gBAAK;YAAC;YAAC;QAAK;IAAC,QAAO,IAAE,KAAG,IAAE,GAAG;IAAA,IAAE,KAAG,GAAE,KAAG,GAAE,KAAG,KAAG,GAAE,KAAG,AAAC,CAAA,KAAG,CAAA,IAAG,GAAE,EAAE,OAAO,GAAC,GAAE,EAAE,QAAQ,GAAC,GAAE,EAAE,QAAQ,GAAC,IAAE,IAAE,IAAE,IAAE,IAAE,IAAG,CAAA,IAAE,CAAA,GAAG,EAAE,SAAS,GAAC,IAAE,IAAE,IAAE,IAAE,MAAI,MAAK,CAAA,IAAE,CAAA,GAAG,EAAE,IAAI,GAAC,GAAE,EAAE,IAAI,GAAC;AAAC;AAAE,MAAM,2BAAG,IAAG,2BAAG,IAAI,YAAY;IAAC;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAI;IAAI;IAAI;IAAI;IAAI;IAAI;IAAE;CAAE,GAAE,2BAAG,IAAI,WAAW;IAAC;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;CAAG,GAAE,2BAAG,IAAI,YAAY;IAAC;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAE;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAI;IAAI;IAAI;IAAI;IAAI;IAAI;IAAK;IAAK;IAAK;IAAK;IAAK;IAAK;IAAK;IAAM;IAAM;IAAM;IAAE;CAAE,GAAE,2BAAG,IAAI,WAAW;IAAC;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;IAAG;CAAG;AAAE,IAAI,2BAAG,CAAC,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE;IAAK,MAAM,IAAE,EAAE,IAAI;IAAC,IAAI,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,IAAE,GAAE,IAAE,GAAE,IAAE,GAAE,IAAE,GAAE,IAAE,GAAE,IAAE,GAAE,IAAE,GAAE,IAAE,GAAE,IAAE,GAAE,IAAE,GAAE,IAAE;IAAK,MAAM,IAAE,IAAI,YAAY,KAAI,IAAE,IAAI,YAAY;IAAI,IAAI,GAAE,GAAE,GAAE,IAAE;IAAK,IAAI,IAAE,GAAE,KAAG,0BAAG,IAAI,CAAC,CAAC,EAAE,GAAC;IAAE,IAAI,IAAE,GAAE,IAAE,GAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAE,EAAE,CAAC;IAAG,IAAI,IAAE,GAAE,IAAE,0BAAG,KAAG,KAAG,MAAI,CAAC,CAAC,EAAE,EAAC;IAAK,IAAG,IAAE,KAAI,CAAA,IAAE,CAAA,GAAG,MAAI,GAAE,OAAO,CAAC,CAAC,IAAI,GAAC,UAAS,CAAC,CAAC,IAAI,GAAC,UAAS,EAAE,IAAI,GAAC,GAAE;IAAE,IAAI,IAAE,GAAE,IAAE,KAAG,MAAI,CAAC,CAAC,EAAE,EAAC;IAAK,IAAI,IAAE,KAAI,CAAA,IAAE,CAAA,GAAG,IAAE,GAAE,IAAE,GAAE,KAAG,0BAAG,IAAI,IAAG,MAAI,GAAE,KAAG,CAAC,CAAC,EAAE,EAAC,IAAE,GAAE,OAAM;IAAG,IAAG,IAAE,KAAI,CAAA,MAAI,KAAG,MAAI,CAAA,GAAG,OAAM;IAAG,IAAI,CAAC,CAAC,EAAE,GAAC,GAAE,IAAE,GAAE,IAAE,0BAAG,IAAI,CAAC,CAAC,IAAE,EAAE,GAAC,CAAC,CAAC,EAAE,GAAC,CAAC,CAAC,EAAE;IAAC,IAAI,IAAE,GAAE,IAAE,GAAE,IAAI,MAAI,CAAC,CAAC,IAAE,EAAE,IAAG,CAAA,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAE,EAAE,CAAC,GAAG,GAAC,CAAA;IAAG,IAAG,MAAI,IAAG,CAAA,IAAE,IAAE,GAAE,IAAE,EAAC,IAAG,MAAI,IAAG,CAAA,IAAE,0BAAG,IAAE,0BAAG,IAAE,GAAE,IAAI,CAAA,IAAE,0BAAG,IAAE,0BAAG,IAAE,CAAA,GAAG,IAAE,GAAE,IAAE,GAAE,IAAE,GAAE,IAAE,GAAE,IAAE,GAAE,IAAE,GAAE,IAAE,IAAG,IAAE,KAAG,GAAE,IAAE,IAAE,GAAE,MAAI,KAAG,IAAE,OAAK,MAAI,KAAG,IAAE,KAAI,OAAO;IAAE,OAAO;QAAC,IAAE,IAAE,GAAE,CAAC,CAAC,EAAE,GAAC,IAAE,IAAG,CAAA,IAAE,GAAE,IAAE,CAAC,CAAC,EAAE,AAAD,IAAG,CAAC,CAAC,EAAE,IAAE,IAAG,CAAA,IAAE,CAAC,CAAC,CAAC,CAAC,EAAE,GAAC,EAAE,EAAC,IAAE,CAAC,CAAC,CAAC,CAAC,EAAE,GAAC,EAAE,AAAD,IAAI,CAAA,IAAE,IAAG,IAAE,CAAA,GAAG,IAAE,KAAG,IAAE,GAAE,IAAE,KAAG,GAAE,IAAE;QAAE,GAAG,KAAG,GAAE,CAAC,CAAC,IAAG,CAAA,KAAG,CAAA,IAAG,EAAE,GAAC,KAAG,KAAG,KAAG,KAAG,IAAE;eAAQ,MAAI,GAAG;QAAA,IAAI,IAAE,KAAG,IAAE,GAAE,IAAE,GAAG,MAAI;QAAE,IAAG,MAAI,IAAG,CAAA,KAAG,IAAE,GAAE,KAAG,CAAA,IAAG,IAAE,GAAE,KAAI,KAAG,EAAE,CAAC,CAAC,EAAE,EAAC;YAAC,IAAG,MAAI,GAAE;YAAM,IAAE,CAAC,CAAC,IAAE,CAAC,CAAC,EAAE,CAAC;QAAA;QAAC,IAAG,IAAE,KAAG,AAAC,CAAA,IAAE,CAAA,MAAK,GAAE;YAAC,IAAI,MAAI,KAAI,CAAA,IAAE,CAAA,GAAG,KAAG,GAAE,IAAE,IAAE,GAAE,IAAE,KAAG,GAAE,IAAE,IAAE,KAAI,CAAA,KAAG,CAAC,CAAC,IAAE,EAAE,EAAC,CAAE,CAAA,KAAG,CAAA,CAAC,GAAI,KAAI,MAAI;YAAE,IAAG,KAAG,KAAG,GAAE,MAAI,KAAG,IAAE,OAAK,MAAI,KAAG,IAAE,KAAI,OAAO;YAAE,IAAE,IAAE,GAAE,CAAC,CAAC,EAAE,GAAC,KAAG,KAAG,KAAG,KAAG,IAAE,IAAE;QAAC;IAAC;IAAC,OAAO,MAAI,KAAI,CAAA,CAAC,CAAC,IAAE,EAAE,GAAC,IAAE,KAAG,KAAL,OAAe,GAAG,EAAE,IAAI,GAAC,GAAE;AAAC;AAAE,MAAK,EAAC,UAAS,wBAAE,EAAC,SAAQ,wBAAE,EAAC,SAAQ,wBAAE,EAAC,MAAK,wBAAE,EAAC,cAAa,wBAAE,EAAC,aAAY,wBAAE,EAAC,gBAAe,wBAAE,EAAC,cAAa,wBAAE,EAAC,aAAY,wBAAE,EAAC,aAAY,wBAAE,EAAC,YAAW,wBAAE,EAAC,GAAC,yBAAE,2BAAG,OAAM,2BAAG,OAAM,2BAAG,OAAM,2BAAG,OAAM,2BAAG,OAAM,2BAAG,OAAM,2BAAG,OAAM,2BAAG,OAAM,2BAAG,OAAM,2BAAG,CAAA,IAAG,AAAC,CAAA,MAAI,KAAG,GAAE,IAAI,CAAA,MAAI,IAAE,KAAI,IAAI,CAAA,AAAC,CAAA,QAAM,CAAA,KAAI,CAAA,IAAI,CAAA,AAAC,CAAA,MAAI,CAAA,KAAI,EAAC;AAAG,SAAS;IAAK,IAAI,CAAC,IAAI,GAAC,MAAK,IAAI,CAAC,IAAI,GAAC,GAAE,IAAI,CAAC,IAAI,GAAC,CAAC,GAAE,IAAI,CAAC,IAAI,GAAC,GAAE,IAAI,CAAC,QAAQ,GAAC,CAAC,GAAE,IAAI,CAAC,KAAK,GAAC,GAAE,IAAI,CAAC,IAAI,GAAC,GAAE,IAAI,CAAC,KAAK,GAAC,GAAE,IAAI,CAAC,KAAK,GAAC,GAAE,IAAI,CAAC,IAAI,GAAC,MAAK,IAAI,CAAC,KAAK,GAAC,GAAE,IAAI,CAAC,KAAK,GAAC,GAAE,IAAI,CAAC,KAAK,GAAC,GAAE,IAAI,CAAC,KAAK,GAAC,GAAE,IAAI,CAAC,MAAM,GAAC,MAAK,IAAI,CAAC,IAAI,GAAC,GAAE,IAAI,CAAC,IAAI,GAAC,GAAE,IAAI,CAAC,MAAM,GAAC,GAAE,IAAI,CAAC,MAAM,GAAC,GAAE,IAAI,CAAC,KAAK,GAAC,GAAE,IAAI,CAAC,OAAO,GAAC,MAAK,IAAI,CAAC,QAAQ,GAAC,MAAK,IAAI,CAAC,OAAO,GAAC,GAAE,IAAI,CAAC,QAAQ,GAAC,GAAE,IAAI,CAAC,KAAK,GAAC,GAAE,IAAI,CAAC,IAAI,GAAC,GAAE,IAAI,CAAC,KAAK,GAAC,GAAE,IAAI,CAAC,IAAI,GAAC,GAAE,IAAI,CAAC,IAAI,GAAC,MAAK,IAAI,CAAC,IAAI,GAAC,IAAI,YAAY,MAAK,IAAI,CAAC,IAAI,GAAC,IAAI,YAAY,MAAK,IAAI,CAAC,MAAM,GAAC,MAAK,IAAI,CAAC,OAAO,GAAC,MAAK,IAAI,CAAC,IAAI,GAAC,GAAE,IAAI,CAAC,IAAI,GAAC,GAAE,IAAI,CAAC,GAAG,GAAC;AAAC;AAAC,MAAM,2BAAG,CAAA;IAAI,IAAG,CAAC,GAAE,OAAO;IAAE,MAAM,IAAE,EAAE,KAAK;IAAC,OAAM,CAAC,KAAG,EAAE,IAAI,KAAG,KAAG,EAAE,IAAI,GAAC,4BAAI,EAAE,IAAI,GAAC,QAAM,IAAE;AAAC,GAAE,2BAAG,CAAA;IAAI,IAAG,yBAAG,IAAG,OAAO;IAAG,MAAM,IAAE,EAAE,KAAK;IAAC,OAAO,EAAE,QAAQ,GAAC,EAAE,SAAS,GAAC,EAAE,KAAK,GAAC,GAAE,EAAE,GAAG,GAAC,IAAG,EAAE,IAAI,IAAG,CAAA,EAAE,KAAK,GAAC,IAAE,EAAE,IAAI,AAAD,GAAG,EAAE,IAAI,GAAC,0BAAG,EAAE,IAAI,GAAC,GAAE,EAAE,QAAQ,GAAC,GAAE,EAAE,KAAK,GAAC,IAAG,EAAE,IAAI,GAAC,OAAM,EAAE,IAAI,GAAC,MAAK,EAAE,IAAI,GAAC,GAAE,EAAE,IAAI,GAAC,GAAE,EAAE,OAAO,GAAC,EAAE,MAAM,GAAC,IAAI,WAAW,MAAK,EAAE,QAAQ,GAAC,EAAE,OAAO,GAAC,IAAI,WAAW,MAAK,EAAE,IAAI,GAAC,GAAE,EAAE,IAAI,GAAC,IAAG;AAAE,GAAE,2BAAG,CAAA;IAAI,IAAG,yBAAG,IAAG,OAAO;IAAG,MAAM,IAAE,EAAE,KAAK;IAAC,OAAO,EAAE,KAAK,GAAC,GAAE,EAAE,KAAK,GAAC,GAAE,EAAE,KAAK,GAAC,GAAE,yBAAG;AAAE,GAAE,2BAAG,CAAC,GAAE;IAAK,IAAI;IAAE,IAAG,yBAAG,IAAG,OAAO;IAAG,MAAM,IAAE,EAAE,KAAK;IAAC,OAAO,IAAE,IAAG,CAAA,IAAE,GAAE,IAAE,CAAC,CAAA,IAAI,CAAA,IAAE,IAAG,CAAA,KAAG,CAAA,GAAG,IAAE,MAAK,CAAA,KAAG,EAAC,CAAC,GAAG,KAAI,CAAA,IAAE,KAAG,IAAE,EAAC,IAAG,2BAAI,CAAA,SAAO,EAAE,MAAM,IAAE,EAAE,KAAK,KAAG,KAAI,CAAA,EAAE,MAAM,GAAC,IAAG,GAAG,EAAE,IAAI,GAAC,GAAE,EAAE,KAAK,GAAC,GAAE,yBAAG,EAAC;AAAE,GAAE,2BAAG,CAAC,GAAE;IAAK,IAAG,CAAC,GAAE,OAAO;IAAG,MAAM,IAAE,IAAI;IAAG,EAAE,KAAK,GAAC,GAAE,EAAE,IAAI,GAAC,GAAE,EAAE,MAAM,GAAC,MAAK,EAAE,IAAI,GAAC;IAAG,MAAM,IAAE,yBAAG,GAAE;IAAG,OAAO,MAAI,4BAAK,CAAA,EAAE,KAAK,GAAC,IAAG,GAAG;AAAC;AAAE,IAAI,0BAAG,0BAAG,2BAAG,CAAC;AAAE,MAAM,2BAAG,CAAA;IAAI,IAAG,0BAAG;QAAC,2BAAG,IAAI,WAAW,MAAK,2BAAG,IAAI,WAAW;QAAI,IAAI,IAAE;QAAE,MAAK,IAAE,KAAK,EAAE,IAAI,CAAC,IAAI,GAAC;QAAE,MAAK,IAAE,KAAK,EAAE,IAAI,CAAC,IAAI,GAAC;QAAE,MAAK,IAAE,KAAK,EAAE,IAAI,CAAC,IAAI,GAAC;QAAE,MAAK,IAAE,KAAK,EAAE,IAAI,CAAC,IAAI,GAAC;QAAE,IAAI,yBAAG,GAAE,EAAE,IAAI,EAAC,GAAE,KAAI,0BAAG,GAAE,EAAE,IAAI,EAAC;YAAC,MAAK;QAAC,IAAG,IAAE,GAAE,IAAE,IAAI,EAAE,IAAI,CAAC,IAAI,GAAC;QAAE,yBAAG,GAAE,EAAE,IAAI,EAAC,GAAE,IAAG,0BAAG,GAAE,EAAE,IAAI,EAAC;YAAC,MAAK;QAAC,IAAG,2BAAG,CAAC;IAAC;IAAC,EAAE,OAAO,GAAC,0BAAG,EAAE,OAAO,GAAC,GAAE,EAAE,QAAQ,GAAC,0BAAG,EAAE,QAAQ,GAAC;AAAC,GAAE,2BAAG,CAAC,GAAE,GAAE,GAAE;IAAK,IAAI;IAAE,MAAM,IAAE,EAAE,KAAK;IAAC,OAAO,SAAO,EAAE,MAAM,IAAG,CAAA,EAAE,KAAK,GAAC,KAAG,EAAE,KAAK,EAAC,EAAE,KAAK,GAAC,GAAE,EAAE,KAAK,GAAC,GAAE,EAAE,MAAM,GAAC,IAAI,WAAW,EAAE,KAAK,CAAA,GAAG,KAAG,EAAE,KAAK,GAAE,CAAA,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,IAAE,EAAE,KAAK,EAAC,IAAG,IAAG,EAAE,KAAK,GAAC,GAAE,EAAE,KAAK,GAAC,EAAE,KAAK,AAAD,IAAI,CAAA,IAAE,EAAE,KAAK,GAAC,EAAE,KAAK,EAAC,IAAE,KAAI,CAAA,IAAE,CAAA,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,IAAE,GAAE,IAAE,IAAE,IAAG,EAAE,KAAK,GAAE,AAAC,CAAA,KAAG,CAAA,IAAI,CAAA,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,IAAE,GAAE,IAAG,IAAG,EAAE,KAAK,GAAC,GAAE,EAAE,KAAK,GAAC,EAAE,KAAK,AAAD,IAAI,CAAA,EAAE,KAAK,IAAE,GAAE,EAAE,KAAK,KAAG,EAAE,KAAK,IAAG,CAAA,EAAE,KAAK,GAAC,CAAA,GAAG,EAAE,KAAK,GAAC,EAAE,KAAK,IAAG,CAAA,EAAE,KAAK,IAAE,CAAA,CAAC,CAAC,GAAG;AAAC;AAAE,IAAI,2BAAG;IAAC,cAAa;IAAG,eAAc;IAAG,kBAAiB;IAAG,aAAY,CAAA,IAAG,yBAAG,GAAE;IAAI,cAAa;IAAG,SAAQ,CAAC,GAAE;QAAK,IAAI,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,IAAE;QAAE,MAAM,IAAE,IAAI,WAAW;QAAG,IAAI,GAAE;QAAE,MAAM,IAAE,IAAI,WAAW;YAAC;YAAG;YAAG;YAAG;YAAE;YAAE;YAAE;YAAE;YAAE;YAAG;YAAE;YAAG;YAAE;YAAG;YAAE;YAAG;YAAE;YAAG;YAAE;SAAG;QAAE,IAAG,yBAAG,MAAI,CAAC,EAAE,MAAM,IAAE,CAAC,EAAE,KAAK,IAAE,MAAI,EAAE,QAAQ,EAAC,OAAO;QAAG,IAAE,EAAE,KAAK,EAAC,EAAE,IAAI,KAAG,4BAAK,CAAA,EAAE,IAAI,GAAC,wBAAC,GAAG,IAAE,EAAE,QAAQ,EAAC,IAAE,EAAE,MAAM,EAAC,IAAE,EAAE,SAAS,EAAC,IAAE,EAAE,OAAO,EAAC,IAAE,EAAE,KAAK,EAAC,IAAE,EAAE,QAAQ,EAAC,IAAE,EAAE,IAAI,EAAC,IAAE,EAAE,IAAI,EAAC,IAAE,GAAE,IAAE,GAAE,IAAE;QAAG,GAAE,OAAO,OAAO,EAAE,IAAI;YAAE,KAAK;gBAAG,IAAG,MAAI,EAAE,IAAI,EAAC;oBAAC,EAAE,IAAI,GAAC;oBAAG;gBAAK;gBAAC,MAAK,IAAE,IAAI;oBAAC,IAAG,MAAI,GAAE,MAAM;oBAAE,KAAI,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG;gBAAC;gBAAC,IAAG,IAAE,EAAE,IAAI,IAAE,UAAQ,GAAE;oBAAC,MAAI,EAAE,KAAK,IAAG,CAAA,EAAE,KAAK,GAAC,EAAC,GAAG,EAAE,KAAK,GAAC,GAAE,CAAC,CAAC,EAAE,GAAC,MAAI,GAAE,CAAC,CAAC,EAAE,GAAC,MAAI,IAAE,KAAI,EAAE,KAAK,GAAC,wBAAE,EAAE,KAAK,EAAC,GAAE,GAAE,IAAG,IAAE,GAAE,IAAE,GAAE,EAAE,IAAI,GAAC;oBAAM;gBAAK;gBAAC,IAAG,EAAE,IAAI,IAAG,CAAA,EAAE,IAAI,CAAC,IAAI,GAAC,CAAC,CAAA,GAAG,CAAE,CAAA,IAAE,EAAE,IAAI,AAAD,KAAI,AAAC,CAAA,AAAC,CAAA,AAAC,CAAA,MAAI,CAAA,KAAI,CAAA,IAAI,CAAA,KAAG,CAAA,CAAC,IAAG,IAAG;oBAAC,EAAE,GAAG,GAAC,0BAAyB,EAAE,IAAI,GAAC;oBAAG;gBAAK;gBAAC,IAAG,AAAC,CAAA,KAAG,CAAA,MAAK,0BAAG;oBAAC,EAAE,GAAG,GAAC,8BAA6B,EAAE,IAAI,GAAC;oBAAG;gBAAK;gBAAC,IAAG,OAAK,GAAE,KAAG,GAAE,IAAE,IAAG,CAAA,KAAG,CAAA,GAAG,MAAI,EAAE,KAAK,IAAG,CAAA,EAAE,KAAK,GAAC,CAAA,GAAG,IAAE,MAAI,IAAE,EAAE,KAAK,EAAC;oBAAC,EAAE,GAAG,GAAC,uBAAsB,EAAE,IAAI,GAAC;oBAAG;gBAAK;gBAAC,EAAE,IAAI,GAAC,KAAG,EAAE,KAAK,EAAC,EAAE,KAAK,GAAC,GAAE,EAAE,KAAK,GAAC,EAAE,KAAK,GAAC,GAAE,EAAE,IAAI,GAAC,MAAI,IAAE,QAAM,0BAAG,IAAE,GAAE,IAAE;gBAAE;YAAM,KAAK;gBAAM,MAAK,IAAE,IAAI;oBAAC,IAAG,MAAI,GAAE,MAAM;oBAAE,KAAI,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG;gBAAC;gBAAC,IAAG,EAAE,KAAK,GAAC,GAAE,AAAC,CAAA,MAAI,EAAE,KAAK,AAAD,MAAK,0BAAG;oBAAC,EAAE,GAAG,GAAC,8BAA6B,EAAE,IAAI,GAAC;oBAAG;gBAAK;gBAAC,IAAG,QAAM,EAAE,KAAK,EAAC;oBAAC,EAAE,GAAG,GAAC,4BAA2B,EAAE,IAAI,GAAC;oBAAG;gBAAK;gBAAC,EAAE,IAAI,IAAG,CAAA,EAAE,IAAI,CAAC,IAAI,GAAC,KAAG,IAAE,CAAA,GAAG,MAAI,EAAE,KAAK,IAAE,IAAE,EAAE,IAAI,IAAG,CAAA,CAAC,CAAC,EAAE,GAAC,MAAI,GAAE,CAAC,CAAC,EAAE,GAAC,MAAI,IAAE,KAAI,EAAE,KAAK,GAAC,wBAAE,EAAE,KAAK,EAAC,GAAE,GAAE,EAAC,GAAG,IAAE,GAAE,IAAE,GAAE,EAAE,IAAI,GAAC;YAAM,KAAK;gBAAM,MAAK,IAAE,IAAI;oBAAC,IAAG,MAAI,GAAE,MAAM;oBAAE,KAAI,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG;gBAAC;gBAAC,EAAE,IAAI,IAAG,CAAA,EAAE,IAAI,CAAC,IAAI,GAAC,CAAA,GAAG,MAAI,EAAE,KAAK,IAAE,IAAE,EAAE,IAAI,IAAG,CAAA,CAAC,CAAC,EAAE,GAAC,MAAI,GAAE,CAAC,CAAC,EAAE,GAAC,MAAI,IAAE,KAAI,CAAC,CAAC,EAAE,GAAC,MAAI,KAAG,KAAI,CAAC,CAAC,EAAE,GAAC,MAAI,KAAG,KAAI,EAAE,KAAK,GAAC,wBAAE,EAAE,KAAK,EAAC,GAAE,GAAE,EAAC,GAAG,IAAE,GAAE,IAAE,GAAE,EAAE,IAAI,GAAC;YAAM,KAAK;gBAAM,MAAK,IAAE,IAAI;oBAAC,IAAG,MAAI,GAAE,MAAM;oBAAE,KAAI,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG;gBAAC;gBAAC,EAAE,IAAI,IAAG,CAAA,EAAE,IAAI,CAAC,MAAM,GAAC,MAAI,GAAE,EAAE,IAAI,CAAC,EAAE,GAAC,KAAG,CAAA,GAAG,MAAI,EAAE,KAAK,IAAE,IAAE,EAAE,IAAI,IAAG,CAAA,CAAC,CAAC,EAAE,GAAC,MAAI,GAAE,CAAC,CAAC,EAAE,GAAC,MAAI,IAAE,KAAI,EAAE,KAAK,GAAC,wBAAE,EAAE,KAAK,EAAC,GAAE,GAAE,EAAC,GAAG,IAAE,GAAE,IAAE,GAAE,EAAE,IAAI,GAAC;YAAM,KAAK;gBAAM,IAAG,OAAK,EAAE,KAAK,EAAC;oBAAC,MAAK,IAAE,IAAI;wBAAC,IAAG,MAAI,GAAE,MAAM;wBAAE,KAAI,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG;oBAAC;oBAAC,EAAE,MAAM,GAAC,GAAE,EAAE,IAAI,IAAG,CAAA,EAAE,IAAI,CAAC,SAAS,GAAC,CAAA,GAAG,MAAI,EAAE,KAAK,IAAE,IAAE,EAAE,IAAI,IAAG,CAAA,CAAC,CAAC,EAAE,GAAC,MAAI,GAAE,CAAC,CAAC,EAAE,GAAC,MAAI,IAAE,KAAI,EAAE,KAAK,GAAC,wBAAE,EAAE,KAAK,EAAC,GAAE,GAAE,EAAC,GAAG,IAAE,GAAE,IAAE;gBAAC,OAAM,EAAE,IAAI,IAAG,CAAA,EAAE,IAAI,CAAC,KAAK,GAAC,IAAG;gBAAG,EAAE,IAAI,GAAC;YAAM,KAAK;gBAAM,IAAG,OAAK,EAAE,KAAK,IAAG,CAAA,IAAE,EAAE,MAAM,EAAC,IAAE,KAAI,CAAA,IAAE,CAAA,GAAG,KAAI,CAAA,EAAE,IAAI,IAAG,CAAA,IAAE,EAAE,IAAI,CAAC,SAAS,GAAC,EAAE,MAAM,EAAC,EAAE,IAAI,CAAC,KAAK,IAAG,CAAA,EAAE,IAAI,CAAC,KAAK,GAAC,IAAI,WAAW,EAAE,IAAI,CAAC,SAAS,CAAA,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,GAAE,IAAE,IAAG,EAAC,GAAG,MAAI,EAAE,KAAK,IAAE,IAAE,EAAE,IAAI,IAAG,CAAA,EAAE,KAAK,GAAC,wBAAE,EAAE,KAAK,EAAC,GAAE,GAAE,EAAC,GAAG,KAAG,GAAE,KAAG,GAAE,EAAE,MAAM,IAAE,CAAA,GAAG,EAAE,MAAM,AAAD,GAAG,MAAM;gBAAE,EAAE,MAAM,GAAC,GAAE,EAAE,IAAI,GAAC;YAAM,KAAK;gBAAM,IAAG,OAAK,EAAE,KAAK,EAAC;oBAAC,IAAG,MAAI,GAAE,MAAM;oBAAE,IAAE;oBAAE,GAAG,IAAE,CAAC,CAAC,IAAE,IAAI,EAAC,EAAE,IAAI,IAAE,KAAG,EAAE,MAAM,GAAC,SAAQ,CAAA,EAAE,IAAI,CAAC,IAAI,IAAE,OAAO,YAAY,CAAC,EAAC;2BAAS,KAAG,IAAE,GAAG;oBAAA,IAAG,MAAI,EAAE,KAAK,IAAE,IAAE,EAAE,IAAI,IAAG,CAAA,EAAE,KAAK,GAAC,wBAAE,EAAE,KAAK,EAAC,GAAE,GAAE,EAAC,GAAG,KAAG,GAAE,KAAG,GAAE,GAAE,MAAM;gBAAC,OAAM,EAAE,IAAI,IAAG,CAAA,EAAE,IAAI,CAAC,IAAI,GAAC,IAAG;gBAAG,EAAE,MAAM,GAAC,GAAE,EAAE,IAAI,GAAC;YAAM,KAAK;gBAAM,IAAG,OAAK,EAAE,KAAK,EAAC;oBAAC,IAAG,MAAI,GAAE,MAAM;oBAAE,IAAE;oBAAE,GAAG,IAAE,CAAC,CAAC,IAAE,IAAI,EAAC,EAAE,IAAI,IAAE,KAAG,EAAE,MAAM,GAAC,SAAQ,CAAA,EAAE,IAAI,CAAC,OAAO,IAAE,OAAO,YAAY,CAAC,EAAC;2BAAS,KAAG,IAAE,GAAG;oBAAA,IAAG,MAAI,EAAE,KAAK,IAAE,IAAE,EAAE,IAAI,IAAG,CAAA,EAAE,KAAK,GAAC,wBAAE,EAAE,KAAK,EAAC,GAAE,GAAE,EAAC,GAAG,KAAG,GAAE,KAAG,GAAE,GAAE,MAAM;gBAAC,OAAM,EAAE,IAAI,IAAG,CAAA,EAAE,IAAI,CAAC,OAAO,GAAC,IAAG;gBAAG,EAAE,IAAI,GAAC;YAAM,KAAK;gBAAM,IAAG,MAAI,EAAE,KAAK,EAAC;oBAAC,MAAK,IAAE,IAAI;wBAAC,IAAG,MAAI,GAAE,MAAM;wBAAE,KAAI,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG;oBAAC;oBAAC,IAAG,IAAE,EAAE,IAAI,IAAE,MAAK,CAAA,QAAM,EAAE,KAAK,AAAD,GAAG;wBAAC,EAAE,GAAG,GAAC,uBAAsB,EAAE,IAAI,GAAC;wBAAG;oBAAK;oBAAC,IAAE,GAAE,IAAE;gBAAC;gBAAC,EAAE,IAAI,IAAG,CAAA,EAAE,IAAI,CAAC,IAAI,GAAC,EAAE,KAAK,IAAE,IAAE,GAAE,EAAE,IAAI,CAAC,IAAI,GAAC,CAAC,CAAA,GAAG,EAAE,KAAK,GAAC,EAAE,KAAK,GAAC,GAAE,EAAE,IAAI,GAAC;gBAAG;YAAM,KAAK;gBAAM,MAAK,IAAE,IAAI;oBAAC,IAAG,MAAI,GAAE,MAAM;oBAAE,KAAI,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG;gBAAC;gBAAC,EAAE,KAAK,GAAC,EAAE,KAAK,GAAC,yBAAG,IAAG,IAAE,GAAE,IAAE,GAAE,EAAE,IAAI,GAAC;YAAG,KAAK;gBAAG,IAAG,MAAI,EAAE,QAAQ,EAAC,OAAO,EAAE,QAAQ,GAAC,GAAE,EAAE,SAAS,GAAC,GAAE,EAAE,OAAO,GAAC,GAAE,EAAE,QAAQ,GAAC,GAAE,EAAE,IAAI,GAAC,GAAE,EAAE,IAAI,GAAC,GAAE;gBAAG,EAAE,KAAK,GAAC,EAAE,KAAK,GAAC,GAAE,EAAE,IAAI,GAAC;YAAG,KAAK;gBAAG,IAAG,MAAI,4BAAI,MAAI,0BAAG,MAAM;YAAE,KAAK;gBAAG,IAAG,EAAE,IAAI,EAAC;oBAAC,OAAK,IAAE,GAAE,KAAG,IAAE,GAAE,EAAE,IAAI,GAAC;oBAAG;gBAAK;gBAAC,MAAK,IAAE,GAAG;oBAAC,IAAG,MAAI,GAAE,MAAM;oBAAE,KAAI,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG;gBAAC;gBAAC,OAAO,EAAE,IAAI,GAAC,IAAE,GAAE,OAAK,GAAE,KAAG,GAAE,IAAE;oBAAG,KAAK;wBAAE,EAAE,IAAI,GAAC;wBAAM;oBAAM,KAAK;wBAAE,IAAG,yBAAG,IAAG,EAAE,IAAI,GAAC,0BAAG,MAAI,0BAAG;4BAAC,OAAK,GAAE,KAAG;4BAAE,MAAM;wBAAC;wBAAC;oBAAM,KAAK;wBAAE,EAAE,IAAI,GAAC;wBAAM;oBAAM,KAAK;wBAAE,EAAE,GAAG,GAAC,sBAAqB,EAAE,IAAI,GAAC;gBAAE;gBAAC,OAAK,GAAE,KAAG;gBAAE;YAAM,KAAK;gBAAM,IAAI,OAAK,IAAE,GAAE,KAAG,IAAE,GAAE,IAAE,IAAI;oBAAC,IAAG,MAAI,GAAE,MAAM;oBAAE,KAAI,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG;gBAAC;gBAAC,IAAG,AAAC,CAAA,QAAM,CAAA,KAAK,CAAA,MAAI,KAAG,KAAI,GAAG;oBAAC,EAAE,GAAG,GAAC,gCAA+B,EAAE,IAAI,GAAC;oBAAG;gBAAK;gBAAC,IAAG,EAAE,MAAM,GAAC,QAAM,GAAE,IAAE,GAAE,IAAE,GAAE,EAAE,IAAI,GAAC,0BAAG,MAAI,0BAAG,MAAM;YAAE,KAAK;gBAAG,EAAE,IAAI,GAAC;YAAM,KAAK;gBAAM,IAAG,IAAE,EAAE,MAAM,EAAC,GAAE;oBAAC,IAAG,IAAE,KAAI,CAAA,IAAE,CAAA,GAAG,IAAE,KAAI,CAAA,IAAE,CAAA,GAAG,MAAI,GAAE,MAAM;oBAAE,EAAE,GAAG,CAAC,EAAE,QAAQ,CAAC,GAAE,IAAE,IAAG,IAAG,KAAG,GAAE,KAAG,GAAE,KAAG,GAAE,KAAG,GAAE,EAAE,MAAM,IAAE;oBAAE;gBAAK;gBAAC,EAAE,IAAI,GAAC;gBAAG;YAAM,KAAK;gBAAM,MAAK,IAAE,IAAI;oBAAC,IAAG,MAAI,GAAE,MAAM;oBAAE,KAAI,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG;gBAAC;gBAAC,IAAG,EAAE,IAAI,GAAC,MAAK,CAAA,KAAG,CAAA,GAAG,OAAK,GAAE,KAAG,GAAE,EAAE,KAAK,GAAC,IAAG,CAAA,KAAG,CAAA,GAAG,OAAK,GAAE,KAAG,GAAE,EAAE,KAAK,GAAC,IAAG,CAAA,KAAG,CAAA,GAAG,OAAK,GAAE,KAAG,GAAE,EAAE,IAAI,GAAC,OAAK,EAAE,KAAK,GAAC,IAAG;oBAAC,EAAE,GAAG,GAAC,uCAAsC,EAAE,IAAI,GAAC;oBAAG;gBAAK;gBAAC,EAAE,IAAI,GAAC,GAAE,EAAE,IAAI,GAAC;YAAM,KAAK;gBAAM,MAAK,EAAE,IAAI,GAAC,EAAE,KAAK,EAAE;oBAAC,MAAK,IAAE,GAAG;wBAAC,IAAG,MAAI,GAAE,MAAM;wBAAE,KAAI,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG;oBAAC;oBAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,GAAC,IAAE,GAAE,OAAK,GAAE,KAAG;gBAAC;gBAAC,MAAK,EAAE,IAAI,GAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,GAAC;gBAAE,IAAG,EAAE,OAAO,GAAC,EAAE,MAAM,EAAC,EAAE,OAAO,GAAC,GAAE,IAAE;oBAAC,MAAK,EAAE,OAAO;gBAAA,GAAE,IAAE,yBAAG,GAAE,EAAE,IAAI,EAAC,GAAE,IAAG,EAAE,OAAO,EAAC,GAAE,EAAE,IAAI,EAAC,IAAG,EAAE,OAAO,GAAC,EAAE,IAAI,EAAC,GAAE;oBAAC,EAAE,GAAG,GAAC,4BAA2B,EAAE,IAAI,GAAC;oBAAG;gBAAK;gBAAC,EAAE,IAAI,GAAC,GAAE,EAAE,IAAI,GAAC;YAAM,KAAK;gBAAM,MAAK,EAAE,IAAI,GAAC,EAAE,IAAI,GAAC,EAAE,KAAK,EAAE;oBAAC,MAAK,IAAE,EAAE,OAAO,CAAC,IAAE,AAAC,CAAA,KAAG,EAAE,OAAO,AAAD,IAAG,EAAE,EAAC,IAAE,MAAI,IAAG,IAAE,MAAI,KAAG,KAAI,IAAE,QAAM,GAAE,CAAE,CAAA,KAAG,CAAA,GAAI;wBAAC,IAAG,MAAI,GAAE,MAAM;wBAAE,KAAI,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG;oBAAC;oBAAC,IAAG,IAAE,IAAG,OAAK,GAAE,KAAG,GAAE,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,GAAC;yBAAM;wBAAC,IAAG,OAAK,GAAE;4BAAC,IAAI,IAAE,IAAE,GAAE,IAAE,GAAG;gCAAC,IAAG,MAAI,GAAE,MAAM;gCAAE,KAAI,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG;4BAAC;4BAAC,IAAG,OAAK,GAAE,KAAG,GAAE,MAAI,EAAE,IAAI,EAAC;gCAAC,EAAE,GAAG,GAAC,6BAA4B,EAAE,IAAI,GAAC;gCAAG;4BAAK;4BAAC,IAAE,EAAE,IAAI,CAAC,EAAE,IAAI,GAAC,EAAE,EAAC,IAAE,IAAG,CAAA,IAAE,CAAA,GAAG,OAAK,GAAE,KAAG;wBAAC,OAAM,IAAG,OAAK,GAAE;4BAAC,IAAI,IAAE,IAAE,GAAE,IAAE,GAAG;gCAAC,IAAG,MAAI,GAAE,MAAM;gCAAE,KAAI,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG;4BAAC;4BAAC,OAAK,GAAE,KAAG,GAAE,IAAE,GAAE,IAAE,IAAG,CAAA,IAAE,CAAA,GAAG,OAAK,GAAE,KAAG;wBAAC,OAAK;4BAAC,IAAI,IAAE,IAAE,GAAE,IAAE,GAAG;gCAAC,IAAG,MAAI,GAAE,MAAM;gCAAE,KAAI,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG;4BAAC;4BAAC,OAAK,GAAE,KAAG,GAAE,IAAE,GAAE,IAAE,KAAI,CAAA,MAAI,CAAA,GAAG,OAAK,GAAE,KAAG;wBAAC;wBAAC,IAAG,EAAE,IAAI,GAAC,IAAE,EAAE,IAAI,GAAC,EAAE,KAAK,EAAC;4BAAC,EAAE,GAAG,GAAC,6BAA4B,EAAE,IAAI,GAAC;4BAAG;wBAAK;wBAAC,MAAK,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,GAAC;oBAAC;gBAAC;gBAAC,IAAG,EAAE,IAAI,KAAG,0BAAG;gBAAM,IAAG,MAAI,EAAE,IAAI,CAAC,IAAI,EAAC;oBAAC,EAAE,GAAG,GAAC,wCAAuC,EAAE,IAAI,GAAC;oBAAG;gBAAK;gBAAC,IAAG,EAAE,OAAO,GAAC,GAAE,IAAE;oBAAC,MAAK,EAAE,OAAO;gBAAA,GAAE,IAAE,yBAAG,GAAE,EAAE,IAAI,EAAC,GAAE,EAAE,IAAI,EAAC,EAAE,OAAO,EAAC,GAAE,EAAE,IAAI,EAAC,IAAG,EAAE,OAAO,GAAC,EAAE,IAAI,EAAC,GAAE;oBAAC,EAAE,GAAG,GAAC,+BAA8B,EAAE,IAAI,GAAC;oBAAG;gBAAK;gBAAC,IAAG,EAAE,QAAQ,GAAC,GAAE,EAAE,QAAQ,GAAC,EAAE,OAAO,EAAC,IAAE;oBAAC,MAAK,EAAE,QAAQ;gBAAA,GAAE,IAAE,yBAAG,GAAE,EAAE,IAAI,EAAC,EAAE,IAAI,EAAC,EAAE,KAAK,EAAC,EAAE,QAAQ,EAAC,GAAE,EAAE,IAAI,EAAC,IAAG,EAAE,QAAQ,GAAC,EAAE,IAAI,EAAC,GAAE;oBAAC,EAAE,GAAG,GAAC,yBAAwB,EAAE,IAAI,GAAC;oBAAG;gBAAK;gBAAC,IAAG,EAAE,IAAI,GAAC,0BAAG,MAAI,0BAAG,MAAM;YAAE,KAAK;gBAAG,EAAE,IAAI,GAAC;YAAG,KAAK;gBAAG,IAAG,KAAG,KAAG,KAAG,KAAI;oBAAC,EAAE,QAAQ,GAAC,GAAE,EAAE,SAAS,GAAC,GAAE,EAAE,OAAO,GAAC,GAAE,EAAE,QAAQ,GAAC,GAAE,EAAE,IAAI,GAAC,GAAE,EAAE,IAAI,GAAC,GAAE,yBAAG,GAAE,IAAG,IAAE,EAAE,QAAQ,EAAC,IAAE,EAAE,MAAM,EAAC,IAAE,EAAE,SAAS,EAAC,IAAE,EAAE,OAAO,EAAC,IAAE,EAAE,KAAK,EAAC,IAAE,EAAE,QAAQ,EAAC,IAAE,EAAE,IAAI,EAAC,IAAE,EAAE,IAAI,EAAC,EAAE,IAAI,KAAG,4BAAK,CAAA,EAAE,IAAI,GAAC,EAAC;oBAAG;gBAAK;gBAAC,IAAI,EAAE,IAAI,GAAC,GAAE,IAAE,EAAE,OAAO,CAAC,IAAE,AAAC,CAAA,KAAG,EAAE,OAAO,AAAD,IAAG,EAAE,EAAC,IAAE,MAAI,IAAG,IAAE,MAAI,KAAG,KAAI,IAAE,QAAM,GAAE,CAAE,CAAA,KAAG,CAAA,GAAI;oBAAC,IAAG,MAAI,GAAE,MAAM;oBAAE,KAAI,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG;gBAAC;gBAAC,IAAG,KAAG,KAAI,CAAA,MAAI,CAAA,GAAG;oBAAC,IAAI,IAAE,GAAE,IAAE,GAAE,IAAE,GAAE,IAAE,EAAE,OAAO,CAAC,IAAG,CAAA,AAAC,CAAA,IAAE,AAAC,CAAA,KAAG,IAAE,CAAA,IAAG,CAAA,KAAI,CAAA,EAAG,EAAC,IAAE,MAAI,IAAG,IAAE,MAAI,KAAG,KAAI,IAAE,QAAM,GAAE,CAAE,CAAA,IAAE,KAAG,CAAA,GAAI;wBAAC,IAAG,MAAI,GAAE,MAAM;wBAAE,KAAI,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG;oBAAC;oBAAC,OAAK,GAAE,KAAG,GAAE,EAAE,IAAI,IAAE;gBAAC;gBAAC,IAAG,OAAK,GAAE,KAAG,GAAE,EAAE,IAAI,IAAE,GAAE,EAAE,MAAM,GAAC,GAAE,MAAI,GAAE;oBAAC,EAAE,IAAI,GAAC;oBAAM;gBAAK;gBAAC,IAAG,KAAG,GAAE;oBAAC,EAAE,IAAI,GAAC,IAAG,EAAE,IAAI,GAAC;oBAAG;gBAAK;gBAAC,IAAG,KAAG,GAAE;oBAAC,EAAE,GAAG,GAAC,+BAA8B,EAAE,IAAI,GAAC;oBAAG;gBAAK;gBAAC,EAAE,KAAK,GAAC,KAAG,GAAE,EAAE,IAAI,GAAC;YAAM,KAAK;gBAAM,IAAG,EAAE,KAAK,EAAC;oBAAC,IAAI,IAAE,EAAE,KAAK,EAAC,IAAE,GAAG;wBAAC,IAAG,MAAI,GAAE,MAAM;wBAAE,KAAI,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG;oBAAC;oBAAC,EAAE,MAAM,IAAE,IAAE,AAAC,CAAA,KAAG,EAAE,KAAK,AAAD,IAAG,GAAE,OAAK,EAAE,KAAK,EAAC,KAAG,EAAE,KAAK,EAAC,EAAE,IAAI,IAAE,EAAE,KAAK;gBAAA;gBAAC,EAAE,GAAG,GAAC,EAAE,MAAM,EAAC,EAAE,IAAI,GAAC;YAAM,KAAK;gBAAM,MAAK,IAAE,EAAE,QAAQ,CAAC,IAAE,AAAC,CAAA,KAAG,EAAE,QAAQ,AAAD,IAAG,EAAE,EAAC,IAAE,MAAI,IAAG,IAAE,MAAI,KAAG,KAAI,IAAE,QAAM,GAAE,CAAE,CAAA,KAAG,CAAA,GAAI;oBAAC,IAAG,MAAI,GAAE,MAAM;oBAAE,KAAI,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG;gBAAC;gBAAC,IAAG,KAAI,CAAA,MAAI,CAAA,GAAG;oBAAC,IAAI,IAAE,GAAE,IAAE,GAAE,IAAE,GAAE,IAAE,EAAE,QAAQ,CAAC,IAAG,CAAA,AAAC,CAAA,IAAE,AAAC,CAAA,KAAG,IAAE,CAAA,IAAG,CAAA,KAAI,CAAA,EAAG,EAAC,IAAE,MAAI,IAAG,IAAE,MAAI,KAAG,KAAI,IAAE,QAAM,GAAE,CAAE,CAAA,IAAE,KAAG,CAAA,GAAI;wBAAC,IAAG,MAAI,GAAE,MAAM;wBAAE,KAAI,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG;oBAAC;oBAAC,OAAK,GAAE,KAAG,GAAE,EAAE,IAAI,IAAE;gBAAC;gBAAC,IAAG,OAAK,GAAE,KAAG,GAAE,EAAE,IAAI,IAAE,GAAE,KAAG,GAAE;oBAAC,EAAE,GAAG,GAAC,yBAAwB,EAAE,IAAI,GAAC;oBAAG;gBAAK;gBAAC,EAAE,MAAM,GAAC,GAAE,EAAE,KAAK,GAAC,KAAG,GAAE,EAAE,IAAI,GAAC;YAAM,KAAK;gBAAM,IAAG,EAAE,KAAK,EAAC;oBAAC,IAAI,IAAE,EAAE,KAAK,EAAC,IAAE,GAAG;wBAAC,IAAG,MAAI,GAAE,MAAM;wBAAE,KAAI,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG;oBAAC;oBAAC,EAAE,MAAM,IAAE,IAAE,AAAC,CAAA,KAAG,EAAE,KAAK,AAAD,IAAG,GAAE,OAAK,EAAE,KAAK,EAAC,KAAG,EAAE,KAAK,EAAC,EAAE,IAAI,IAAE,EAAE,KAAK;gBAAA;gBAAC,IAAG,EAAE,MAAM,GAAC,EAAE,IAAI,EAAC;oBAAC,EAAE,GAAG,GAAC,iCAAgC,EAAE,IAAI,GAAC;oBAAG;gBAAK;gBAAC,EAAE,IAAI,GAAC;YAAM,KAAK;gBAAM,IAAG,MAAI,GAAE,MAAM;gBAAE,IAAG,IAAE,IAAE,GAAE,EAAE,MAAM,GAAC,GAAE;oBAAC,IAAG,IAAE,EAAE,MAAM,GAAC,GAAE,IAAE,EAAE,KAAK,IAAE,EAAE,IAAI,EAAC;wBAAC,EAAE,GAAG,GAAC,iCAAgC,EAAE,IAAI,GAAC;wBAAG;oBAAK;oBAAC,IAAE,EAAE,KAAK,GAAE,CAAA,KAAG,EAAE,KAAK,EAAC,IAAE,EAAE,KAAK,GAAC,CAAA,IAAG,IAAE,EAAE,KAAK,GAAC,GAAE,IAAE,EAAE,MAAM,IAAG,CAAA,IAAE,EAAE,MAAM,AAAD,GAAG,IAAE,EAAE,MAAM;gBAAA,OAAM,IAAE,GAAE,IAAE,IAAE,EAAE,MAAM,EAAC,IAAE,EAAE,MAAM;gBAAC,IAAE,KAAI,CAAA,IAAE,CAAA,GAAG,KAAG,GAAE,EAAE,MAAM,IAAE;gBAAE,GAAG,CAAC,CAAC,IAAI,GAAC,CAAC,CAAC,IAAI;uBAAO,EAAE,GAAG;gBAAA,MAAI,EAAE,MAAM,IAAG,CAAA,EAAE,IAAI,GAAC,wBAAC;gBAAG;YAAM,KAAK;gBAAM,IAAG,MAAI,GAAE,MAAM;gBAAE,CAAC,CAAC,IAAI,GAAC,EAAE,MAAM,EAAC,KAAI,EAAE,IAAI,GAAC;gBAAG;YAAM,KAAK;gBAAG,IAAG,EAAE,IAAI,EAAC;oBAAC,MAAK,IAAE,IAAI;wBAAC,IAAG,MAAI,GAAE,MAAM;wBAAE,KAAI,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG;oBAAC;oBAAC,IAAG,KAAG,GAAE,EAAE,SAAS,IAAE,GAAE,EAAE,KAAK,IAAE,GAAE,IAAE,EAAE,IAAI,IAAE,KAAI,CAAA,EAAE,KAAK,GAAC,EAAE,KAAK,GAAC,EAAE,KAAK,GAAC,wBAAE,EAAE,KAAK,EAAC,GAAE,GAAE,IAAE,KAAG,wBAAE,EAAE,KAAK,EAAC,GAAE,GAAE,IAAE,EAAC,GAAG,IAAE,GAAE,IAAE,EAAE,IAAI,IAAE,AAAC,CAAA,EAAE,KAAK,GAAC,IAAE,yBAAG,EAAC,MAAK,EAAE,KAAK,EAAC;wBAAC,EAAE,GAAG,GAAC,wBAAuB,EAAE,IAAI,GAAC;wBAAG;oBAAK;oBAAC,IAAE,GAAE,IAAE;gBAAC;gBAAC,EAAE,IAAI,GAAC;YAAM,KAAK;gBAAM,IAAG,EAAE,IAAI,IAAE,EAAE,KAAK,EAAC;oBAAC,MAAK,IAAE,IAAI;wBAAC,IAAG,MAAI,GAAE,MAAM;wBAAE,KAAI,KAAG,CAAC,CAAC,IAAI,IAAE,GAAE,KAAG;oBAAC;oBAAC,IAAG,IAAE,EAAE,IAAI,IAAE,MAAK,CAAA,aAAW,EAAE,KAAK,AAAD,GAAG;wBAAC,EAAE,GAAG,GAAC,0BAAyB,EAAE,IAAI,GAAC;wBAAG;oBAAK;oBAAC,IAAE,GAAE,IAAE;gBAAC;gBAAC,EAAE,IAAI,GAAC;YAAM,KAAK;gBAAM,IAAE;gBAAG,MAAM;YAAE,KAAK;gBAAG,IAAE;gBAAG,MAAM;YAAE,KAAK;gBAAM,OAAO;YAAG;gBAAQ,OAAO;QAAE;QAAC,OAAO,EAAE,QAAQ,GAAC,GAAE,EAAE,SAAS,GAAC,GAAE,EAAE,OAAO,GAAC,GAAE,EAAE,QAAQ,GAAC,GAAE,EAAE,IAAI,GAAC,GAAE,EAAE,IAAI,GAAC,GAAE,AAAC,CAAA,EAAE,KAAK,IAAE,MAAI,EAAE,SAAS,IAAE,EAAE,IAAI,GAAC,4BAAK,CAAA,EAAE,IAAI,GAAC,4BAAI,MAAI,wBAAC,CAAC,KAAI,yBAAG,GAAE,EAAE,MAAM,EAAC,EAAE,QAAQ,EAAC,IAAE,EAAE,SAAS,GAAE,KAAG,EAAE,QAAQ,EAAC,KAAG,EAAE,SAAS,EAAC,EAAE,QAAQ,IAAE,GAAE,EAAE,SAAS,IAAE,GAAE,EAAE,KAAK,IAAE,GAAE,IAAE,EAAE,IAAI,IAAE,KAAI,CAAA,EAAE,KAAK,GAAC,EAAE,KAAK,GAAC,EAAE,KAAK,GAAC,wBAAE,EAAE,KAAK,EAAC,GAAE,GAAE,EAAE,QAAQ,GAAC,KAAG,wBAAE,EAAE,KAAK,EAAC,GAAE,GAAE,EAAE,QAAQ,GAAC,EAAC,GAAG,EAAE,SAAS,GAAC,EAAE,IAAI,GAAE,CAAA,EAAE,IAAI,GAAC,KAAG,CAAA,IAAI,CAAA,EAAE,IAAI,KAAG,2BAAG,MAAI,CAAA,IAAI,CAAA,EAAE,IAAI,KAAG,4BAAI,EAAE,IAAI,KAAG,2BAAG,MAAI,CAAA,GAAG,AAAC,CAAA,MAAI,KAAG,MAAI,KAAG,MAAI,wBAAC,KAAI,MAAI,4BAAK,CAAA,IAAE,wBAAC,GAAG;IAAC;IAAE,YAAW,CAAA;QAAI,IAAG,yBAAG,IAAG,OAAO;QAAG,IAAI,IAAE,EAAE,KAAK;QAAC,OAAO,EAAE,MAAM,IAAG,CAAA,EAAE,MAAM,GAAC,IAAG,GAAG,EAAE,KAAK,GAAC,MAAK;IAAE;IAAE,kBAAiB,CAAC,GAAE;QAAK,IAAG,yBAAG,IAAG,OAAO;QAAG,MAAM,IAAE,EAAE,KAAK;QAAC,OAAO,KAAI,CAAA,IAAE,EAAE,IAAI,AAAD,IAAG,2BAAI,CAAA,EAAE,IAAI,GAAC,GAAE,EAAE,IAAI,GAAC,CAAC,GAAE,wBAAC;IAAE;IAAE,sBAAqB,CAAC,GAAE;QAAK,MAAM,IAAE,EAAE,MAAM;QAAC,IAAI,GAAE,GAAE;QAAE,OAAO,yBAAG,KAAG,2BAAI,CAAA,IAAE,EAAE,KAAK,EAAC,MAAI,EAAE,IAAI,IAAE,EAAE,IAAI,KAAG,2BAAG,2BAAG,EAAE,IAAI,KAAG,4BAAK,CAAA,IAAE,GAAE,IAAE,wBAAE,GAAE,GAAE,GAAE,IAAG,MAAI,EAAE,KAAK,AAAD,IAAG,2BAAI,CAAA,IAAE,yBAAG,GAAE,GAAE,GAAE,IAAG,IAAG,CAAA,EAAE,IAAI,GAAC,OAAM,wBAAC,IAAI,CAAA,EAAE,QAAQ,GAAC,GAAE,wBAAC,CAAC,CAAC;IAAE;IAAE,aAAY;AAAoC;AAAE,IAAI,2BAAG;IAAW,IAAI,CAAC,IAAI,GAAC,GAAE,IAAI,CAAC,IAAI,GAAC,GAAE,IAAI,CAAC,MAAM,GAAC,GAAE,IAAI,CAAC,EAAE,GAAC,GAAE,IAAI,CAAC,KAAK,GAAC,MAAK,IAAI,CAAC,SAAS,GAAC,GAAE,IAAI,CAAC,IAAI,GAAC,IAAG,IAAI,CAAC,OAAO,GAAC,IAAG,IAAI,CAAC,IAAI,GAAC,GAAE,IAAI,CAAC,IAAI,GAAC,CAAC;AAAC;AAAE,MAAM,2BAAG,OAAO,SAAS,CAAC,QAAQ,EAAC,EAAC,YAAW,wBAAE,EAAC,UAAS,wBAAE,EAAC,MAAK,wBAAE,EAAC,cAAa,wBAAE,EAAC,aAAY,wBAAE,EAAC,gBAAe,wBAAE,EAAC,cAAa,wBAAE,EAAC,aAAY,wBAAE,EAAC,GAAC;AAAE,SAAS,yBAAG,CAAC;IAAE,IAAI,CAAC,OAAO,GAAC,yBAAG,MAAM,CAAC;QAAC,WAAU;QAAM,YAAW;QAAG,IAAG;IAAE,GAAE,KAAG,CAAC;IAAG,MAAM,IAAE,IAAI,CAAC,OAAO;IAAC,EAAE,GAAG,IAAE,EAAE,UAAU,IAAE,KAAG,EAAE,UAAU,GAAC,MAAK,CAAA,EAAE,UAAU,GAAC,CAAC,EAAE,UAAU,EAAC,MAAI,EAAE,UAAU,IAAG,CAAA,EAAE,UAAU,GAAC,GAAE,CAAC,GAAG,CAAE,CAAA,EAAE,UAAU,IAAE,KAAG,EAAE,UAAU,GAAC,EAAC,KAAI,KAAG,EAAE,UAAU,IAAG,CAAA,EAAE,UAAU,IAAE,EAAC,GAAG,EAAE,UAAU,GAAC,MAAI,EAAE,UAAU,GAAC,MAAI,KAAI,CAAA,KAAG,EAAE,UAAU,AAAD,KAAK,CAAA,EAAE,UAAU,IAAE,EAAC,GAAG,IAAI,CAAC,GAAG,GAAC,GAAE,IAAI,CAAC,GAAG,GAAC,IAAG,IAAI,CAAC,KAAK,GAAC,CAAC,GAAE,IAAI,CAAC,MAAM,GAAC,EAAE,EAAC,IAAI,CAAC,IAAI,GAAC,IAAI,0BAAG,IAAI,CAAC,IAAI,CAAC,SAAS,GAAC;IAAE,IAAI,IAAE,yBAAG,YAAY,CAAC,IAAI,CAAC,IAAI,EAAC,EAAE,UAAU;IAAE,IAAG,MAAI,0BAAG,MAAM,IAAI,MAAM,uBAAC,CAAC,EAAE;IAAE,IAAG,IAAI,CAAC,MAAM,GAAC,IAAI,0BAAG,yBAAG,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAC,IAAI,CAAC,MAAM,GAAE,EAAE,UAAU,IAAG,CAAA,YAAU,OAAO,EAAE,UAAU,GAAC,EAAE,UAAU,GAAC,yBAAG,UAAU,CAAC,EAAE,UAAU,IAAE,2BAAyB,yBAAG,IAAI,CAAC,EAAE,UAAU,KAAI,CAAA,EAAE,UAAU,GAAC,IAAI,WAAW,EAAE,UAAU,CAAA,GAAG,EAAE,GAAG,IAAG,CAAA,IAAE,yBAAG,oBAAoB,CAAC,IAAI,CAAC,IAAI,EAAC,EAAE,UAAU,GAAE,MAAI,wBAAC,CAAC,GAAG,MAAM,IAAI,MAAM,uBAAC,CAAC,EAAE;AAAC;AAAC,SAAS,yBAAG,CAAC,EAAC,CAAC;IAAE,MAAM,IAAE,IAAI,yBAAG;IAAG,IAAG,EAAE,IAAI,CAAC,IAAG,EAAE,GAAG,EAAC,MAAM,EAAE,GAAG,IAAE,uBAAC,CAAC,EAAE,GAAG,CAAC;IAAC,OAAO,EAAE,MAAM;AAAA;AAAC,yBAAG,SAAS,CAAC,IAAI,GAAC,SAAS,CAAC,EAAC,CAAC;IAAE,MAAM,IAAE,IAAI,CAAC,IAAI,EAAC,IAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAC,IAAE,IAAI,CAAC,OAAO,CAAC,UAAU;IAAC,IAAI,GAAE,GAAE;IAAE,IAAG,IAAI,CAAC,KAAK,EAAC,OAAM,CAAC;IAAE,IAAI,IAAE,MAAI,CAAC,CAAC,IAAE,IAAE,CAAC,MAAI,IAAE,2BAAG,0BAAG,2BAAyB,yBAAG,IAAI,CAAC,KAAG,EAAE,KAAK,GAAC,IAAI,WAAW,KAAG,EAAE,KAAK,GAAC,GAAE,EAAE,OAAO,GAAC,GAAE,EAAE,QAAQ,GAAC,EAAE,KAAK,CAAC,MAAM,GAAG;QAAC,IAAI,MAAI,EAAE,SAAS,IAAG,CAAA,EAAE,MAAM,GAAC,IAAI,WAAW,IAAG,EAAE,QAAQ,GAAC,GAAE,EAAE,SAAS,GAAC,CAAA,GAAG,IAAE,yBAAG,OAAO,CAAC,GAAE,IAAG,MAAI,4BAAI,KAAI,CAAA,IAAE,yBAAG,oBAAoB,CAAC,GAAE,IAAG,MAAI,2BAAG,IAAE,yBAAG,OAAO,CAAC,GAAE,KAAG,MAAI,4BAAK,CAAA,IAAE,wBAAC,CAAC,GAAG,EAAE,QAAQ,GAAC,KAAG,MAAI,4BAAI,EAAE,KAAK,CAAC,IAAI,GAAC,KAAG,MAAI,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,yBAAG,YAAY,CAAC,IAAG,IAAE,yBAAG,OAAO,CAAC,GAAE;QAAG,OAAO;YAAG,KAAK;YAAG,KAAK;YAAG,KAAK;YAAG,KAAK;gBAAG,OAAO,IAAI,CAAC,KAAK,CAAC,IAAG,IAAI,CAAC,KAAK,GAAC,CAAC,GAAE,CAAC;QAAC;QAAC,IAAG,IAAE,EAAE,SAAS,EAAC,EAAE,QAAQ,IAAG,CAAA,MAAI,EAAE,SAAS,IAAE,MAAI,wBAAC;YAAG,IAAG,aAAW,IAAI,CAAC,OAAO,CAAC,EAAE,EAAC;gBAAC,IAAI,IAAE,yBAAG,UAAU,CAAC,EAAE,MAAM,EAAC,EAAE,QAAQ,GAAE,IAAE,EAAE,QAAQ,GAAC,GAAE,IAAE,yBAAG,UAAU,CAAC,EAAE,MAAM,EAAC;gBAAG,EAAE,QAAQ,GAAC,GAAE,EAAE,SAAS,GAAC,IAAE,GAAE,KAAG,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAE,IAAE,IAAG,IAAG,IAAI,CAAC,MAAM,CAAC;YAAE,OAAM,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,KAAG,EAAE,QAAQ,GAAC,EAAE,MAAM,GAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAE,EAAE,QAAQ;;QAAG,IAAG,MAAI,4BAAI,MAAI,GAAE;YAAC,IAAG,MAAI,0BAAG,OAAO,IAAE,yBAAG,UAAU,CAAC,IAAI,CAAC,IAAI,GAAE,IAAI,CAAC,KAAK,CAAC,IAAG,IAAI,CAAC,KAAK,GAAC,CAAC,GAAE,CAAC;YAAE,IAAG,MAAI,EAAE,QAAQ,EAAC;QAAK;IAAC;IAAC,OAAM,CAAC;AAAC,GAAE,yBAAG,SAAS,CAAC,MAAM,GAAC,SAAS,CAAC;IAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;AAAE,GAAE,yBAAG,SAAS,CAAC,KAAK,GAAC,SAAS,CAAC;IAAE,MAAI,4BAAK,CAAA,aAAW,IAAI,CAAC,OAAO,CAAC,EAAE,GAAC,IAAI,CAAC,MAAM,GAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAI,IAAI,CAAC,MAAM,GAAC,yBAAG,aAAa,CAAC,IAAI,CAAC,MAAM,CAAA,GAAG,IAAI,CAAC,MAAM,GAAC,EAAE,EAAC,IAAI,CAAC,GAAG,GAAC,GAAE,IAAI,CAAC,GAAG,GAAC,IAAI,CAAC,IAAI,CAAC,GAAG;AAAA;AAAE,IAAI,2BAAG;IAAC,SAAQ;IAAG,SAAQ;IAAG,YAAW,SAAS,CAAC,EAAC,CAAC;QAAE,OAAM,AAAC,CAAA,IAAE,KAAG,CAAC,CAAA,EAAG,GAAG,GAAC,CAAC,GAAE,yBAAG,GAAE;IAAE;IAAE,QAAO;IAAG,WAAU;AAAC;AAAE,MAAK,EAAC,SAAQ,wBAAE,EAAC,SAAQ,wBAAE,EAAC,YAAW,wBAAE,EAAC,MAAK,wBAAE,EAAC,GAAC,0BAAG,EAAC,SAAQ,wBAAE,EAAC,SAAQ,wBAAE,EAAC,YAAW,wBAAE,EAAC,QAAO,wBAAE,EAAC,GAAC;AAAG,IAAI,2BAAG,0BAAG,2BAAG;AAAG,MAAM;IAAG,YAAY,CAAC,EAAC,IAAE,CAAC,CAAC,EAAC,IAAE,CAAC,CAAC,CAAC;QAAC,IAAI,CAAC,MAAM,GAAC,GAAE,IAAI,CAAC,OAAO,GAAC,GAAE,IAAI,CAAC,iBAAiB,GAAC,CAAC,GAAE,IAAI,CAAC,QAAQ,GAAC,IAAI,WAAW,IAAG,IAAI,CAAC,QAAQ,GAAC,GAAE,IAAI,CAAC,QAAQ,GAAC,IAAG,IAAI,CAAC,aAAa,GAAC,KAAK,GAAG,IAAG,IAAI,CAAC,UAAU,GAAC,CAAC,GAAE,IAAI,CAAC,iBAAiB,GAAC;IAAC;IAAC,UAAS;QAAC,MAAM,IAAE,IAAI,CAAC,MAAM,CAAC,OAAO;QAAG,OAAO,EAAE,WAAW,IAAE,EAAE,YAAY,GAAC,CAAC,qBAAqB,EAAE,EAAE,WAAW,CAAC,QAAQ,CAAC,IAAI,aAAa,EAAE,EAAE,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAC;IAAE;IAAC,SAAQ;QAAC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,YAAY;IAAA;IAAC,MAAM,CAAC,EAAC;QAAC,MAAM,IAAE,CAAC,EAAE,CAAC,MAAM,EAAE,AAAC,CAAA,KAAK,GAAG,KAAG,IAAI,CAAC,aAAa,AAAD,EAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAAC,QAAQ,GAAG,CAAC,IAAG,IAAI,CAAC,QAAQ,IAAE,IAAE;IAAI;IAAC,MAAM,cAAa;QAAC,IAAG;YAAC,MAAM,UAAU,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,GAAE,QAAQ,GAAG,CAAC;QAA4B,EAAC,OAAM,GAAE;YAAC,QAAQ,KAAK,CAAC,wBAAuB;QAAE;IAAC;IAAC,OAAO,CAAC,EAAC;QAAC,OAAO,MAAM,IAAI,CAAC,GAAG,GAAG,CAAE,CAAA,IAAG,EAAE,QAAQ,CAAC,IAAI,QAAQ,CAAC,GAAE,MAAO,IAAI,CAAC,IAAI,MAAM,CAAC,IAAG;IAAI;IAAC,WAAW,CAAC,EAAC,IAAE,CAAC,CAAC,EAAC;QAAC,IAAG,KAAG,EAAE,MAAM,GAAC,IAAG;YAAC,IAAI,IAAE,IAAG,IAAE;YAAE,MAAK,EAAE,MAAM,GAAC,GAAG;gBAAC,MAAM,IAAE,EAAE,KAAK,CAAC,GAAE,KAAI,IAAE,OAAO,YAAY,IAAI,GAAG,KAAK,CAAC,IAAI,GAAG,CAAE,CAAA,IAAG,QAAM,KAAG,KAAG,OAAK,KAAG,OAAK,SAAO,IAAE,IAAE,KAAM,IAAI,CAAC;gBAAI,IAAE,EAAE,KAAK,CAAC,KAAI,KAAG,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,GAAE,IAAI,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,IAAI,GAAG,EAAE,EAAE,CAAC;YAAA;YAAC,OAAO;QAAC;QAAC,OAAO,IAAI,CAAC,MAAM,CAAC;IAAE;IAAC,WAAW,CAAC,EAAC;QAAC,MAAM,IAAE,EAAE;QAAC,EAAE,IAAI,CAAC;QAAK,IAAI,IAAI,IAAE,GAAE,IAAE,EAAE,MAAM,EAAC,IAAI,QAAM,CAAC,CAAC,EAAE,GAAC,EAAE,IAAI,CAAC,KAAI,OAAK,QAAM,CAAC,CAAC,EAAE,GAAC,EAAE,IAAI,CAAC,KAAI,OAAK,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE;QAAE,OAAO,EAAE,IAAI,CAAC,MAAK,IAAI,WAAW;IAAE;IAAC,MAAM,MAAM,CAAC,EAAC;QAAC,MAAM,IAAE,IAAI,CAAC,UAAU,CAAC;QAAG,IAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAC;YAAC,MAAM,IAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS;YAAG,IAAI,CAAC,OAAO,IAAG,CAAA,QAAQ,GAAG,CAAC,gBAAe,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA,GAAG,MAAM,EAAE,KAAK,CAAC,IAAG,EAAE,WAAW;QAAE;IAAC;IAAC,cAAc,CAAC,EAAC,CAAC,EAAC;QAAC,MAAM,IAAE,IAAI,WAAW,EAAE,UAAU,GAAC,EAAE,UAAU;QAAE,OAAO,EAAE,GAAG,CAAC,IAAI,WAAW,IAAG,IAAG,EAAE,GAAG,CAAC,IAAI,WAAW,IAAG,EAAE,UAAU,GAAE,EAAE,MAAM;IAAA;IAAC,WAAW,CAAC,EAAC;QAAC,IAAI,IAAE,GAAE,IAAE,GAAE,IAAE,GAAE,IAAE;QAAO,MAAK,IAAE,EAAE,MAAM,EAAE,IAAG,WAAS,KAAG,OAAK,CAAC,CAAC,EAAE,EAAC;YAAC,IAAG,iBAAe,KAAG,OAAK,CAAC,CAAC,EAAE,EAAC;gBAAC,IAAE,IAAE,GAAE,IAAE;gBAAkB;YAAK;YAAC;QAAG,OAAM,IAAE,IAAE,GAAE,IAAE,cAAa;QAAI,IAAG,sBAAoB,GAAE,OAAO,IAAI,CAAC,QAAQ,GAAC,GAAE,IAAI,WAAW;QAAG,IAAI,CAAC,QAAQ,GAAC,EAAE,KAAK,CAAC,IAAE;QAAG,MAAM,IAAE,IAAI,WAAW,IAAE,IAAE;QAAG,IAAI,IAAE;QAAE,IAAI,IAAE,GAAE,KAAG,GAAE,KAAI,IAAI,QAAM,CAAC,CAAC,EAAE,IAAE,QAAM,CAAC,CAAC,IAAE,EAAE,GAAC,QAAM,CAAC,CAAC,EAAE,IAAE,QAAM,CAAC,CAAC,IAAE,EAAE,GAAC,CAAC,CAAC,EAAE,GAAC,CAAC,CAAC,EAAE,GAAE,CAAA,CAAC,CAAC,EAAE,GAAC,KAAI,GAAE,IAAI,CAAA,CAAC,CAAC,EAAE,GAAC,KAAI,GAAE;QAAG,OAAO,EAAE,KAAK,CAAC,GAAE;IAAE;IAAC,MAAM,KAAK,IAAE,CAAC,EAAC,IAAE,EAAE,EAAC;QAAC,IAAI,GAAE,IAAE,IAAI,CAAC,QAAQ;QAAC,IAAG,IAAI,CAAC,QAAQ,GAAC,IAAI,WAAW,IAAG,IAAI,CAAC,iBAAiB,EAAC;YAAC,MAAM,IAAE,IAAI,CAAC,UAAU,CAAC;YAAG,IAAG,EAAE,MAAM,GAAC,GAAE,OAAO;YAAE,IAAE,IAAI,CAAC,QAAQ,EAAC,IAAI,CAAC,QAAQ,GAAC,IAAI,WAAW;QAAE;QAAC,IAAG,QAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAC,OAAO,IAAI,CAAC,QAAQ;QAAC,IAAI,CAAC,MAAM,GAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS;QAAG,IAAG;YAAC,IAAE,KAAI,CAAA,IAAE,WAAY;gBAAK,IAAI,CAAC,MAAM,IAAE,IAAI,CAAC,MAAM,CAAC,MAAM;YAAE,GAAG,EAAC;YAAG,GAAE;gBAAC,MAAK,EAAC,OAAM,CAAC,EAAC,MAAK,CAAC,EAAC,GAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI;gBAAG,IAAG,GAAE,MAAM,IAAI,CAAC,QAAQ,GAAC,GAAE,IAAI,MAAM;gBAAW,IAAE,IAAI,WAAW,IAAI,CAAC,aAAa,CAAC,EAAE,MAAM,EAAC,EAAE,MAAM;YAAE,QAAO,EAAE,MAAM,GAAC,GAAE;QAAA,SAAQ;YAAC,IAAE,KAAG,aAAa,IAAG,IAAI,CAAC,MAAM,CAAC,WAAW;QAAE;QAAC,IAAG,IAAI,CAAC,OAAO,IAAG,CAAA,QAAQ,GAAG,CAAC,eAAc,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA,GAAG,IAAI,CAAC,iBAAiB,EAAC;YAAC,MAAM,IAAE,IAAI,CAAC,UAAU,CAAC;YAAG,OAAO,IAAI,CAAC,OAAO,IAAG,CAAA,QAAQ,GAAG,CAAC,wBAAuB,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA,GAAG;QAAC;QAAC,OAAO;IAAC;IAAC,MAAM,QAAQ,IAAE,CAAC,EAAC;QAAC,IAAG,KAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAC;YAAC,MAAM,IAAE,IAAI,CAAC,QAAQ;YAAC,OAAO,IAAI,CAAC,QAAQ,GAAC,IAAI,WAAW,IAAG;QAAC;QAAC,IAAG,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAC,OAAO,IAAI,CAAC,QAAQ;QAAC,IAAI;QAAE,IAAI,CAAC,MAAM,GAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS;QAAG,IAAG;YAAC,IAAE,KAAI,CAAA,IAAE,WAAY;gBAAK,IAAI,CAAC,MAAM,IAAE,IAAI,CAAC,MAAM,CAAC,MAAM;YAAE,GAAG,EAAC;YAAG,MAAK,EAAC,OAAM,CAAC,EAAC,MAAK,CAAC,EAAC,GAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI;YAAG,OAAO,KAAG,IAAI,CAAC,OAAO,IAAG,CAAA,QAAQ,GAAG,CAAC,mBAAkB,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA,GAAG;QAAC,SAAQ;YAAC,IAAE,KAAG,aAAa,IAAG,IAAI,CAAC,MAAM,CAAC,WAAW;QAAE;IAAC;IAAC,MAAM,OAAO,CAAC,EAAC;QAAC,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;YAAC,eAAc;QAAC,IAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU;IAAC;IAAC,MAAM,OAAO,CAAC,EAAC;QAAC,IAAI,CAAC,UAAU,GAAC,GAAE,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;YAAC,mBAAkB;QAAC;IAAE;IAAC,MAAM,QAAQ,IAAE,MAAM,EAAC,IAAE,CAAC,CAAC,EAAC;QAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YAAC,UAAS;YAAE,UAAS,QAAM,IAAE,KAAK,IAAE,EAAE,QAAQ;YAAC,UAAS,QAAM,IAAE,KAAK,IAAE,EAAE,QAAQ;YAAC,YAAW,QAAM,IAAE,KAAK,IAAE,EAAE,UAAU;YAAC,QAAO,QAAM,IAAE,KAAK,IAAE,EAAE,MAAM;YAAC,aAAY,QAAM,IAAE,KAAK,IAAE,EAAE,WAAW;QAAA,IAAG,IAAI,CAAC,QAAQ,GAAC,GAAE,IAAI,CAAC,QAAQ,GAAC,IAAI,WAAW;IAAE;IAAC,MAAM,MAAM,CAAC,EAAC;QAAC,OAAO,IAAI,QAAS,CAAA,IAAG,WAAW,GAAE;IAAI;IAAC,MAAM,cAAc,CAAC,EAAC;QAAC,MAAK,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,IAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,KAAK,CAAC;IAAE;IAAC,MAAM,aAAY;QAAC,IAAI,GAAE;QAAG,CAAA,SAAQ,CAAA,IAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,AAAD,KAAI,KAAK,MAAI,IAAE,KAAK,IAAE,EAAE,MAAM,AAAD,KAAI,MAAM,CAAA,SAAQ,CAAA,IAAE,IAAI,CAAC,MAAM,AAAD,KAAI,KAAK,MAAI,IAAE,KAAK,IAAE,EAAE,MAAM,EAAC,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,MAAK,IAAI,CAAC,MAAM,GAAC,KAAK,GAAE,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK;IAAE;AAAC;AAAC,SAAS,yBAAG,CAAC;IAAE,OAAO,IAAI,QAAS,CAAA,IAAG,WAAW,GAAE;AAAI;AAAC,eAAe,0CAAG,CAAC,EAAC,IAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC,CAAC,IAAG,MAAM,EAAE,MAAM,CAAC,CAAC,IAAG,MAAM,yBAAG,MAAK,MAAM,EAAE,MAAM,CAAC,CAAC,IAAG,MAAM,EAAE,MAAM,CAAC,CAAC,IAAG,MAAM,yBAAG,IAAG,MAAM,EAAE,MAAM,CAAC,CAAC;AAAE;AAAC,eAAe,0CAAG,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC,CAAC,IAAG,MAAM,EAAE,MAAM,CAAC,CAAC,IAAG,MAAM,yBAAG,MAAK,MAAM,EAAE,MAAM,CAAC,CAAC,IAAG,MAAM,EAAE,MAAM,CAAC,CAAC,IAAG,MAAM,yBAAG,MAAK,MAAM,EAAE,MAAM,CAAC,CAAC,IAAG,MAAM,EAAE,MAAM,CAAC,CAAC,IAAG,MAAM,EAAE,MAAM,CAAC,CAAC,IAAG,MAAM,yBAAG,MAAK,MAAM,EAAE,MAAM,CAAC,CAAC,IAAG,MAAM,EAAE,MAAM,CAAC,CAAC;AAAE;AAAC,eAAe,0CAAG,CAAC,EAAC,IAAE,CAAC,CAAC;IAAE,IAAG,CAAA,MAAM,yBAAG,MAAK,MAAM,EAAE,MAAM,CAAC,CAAC,IAAG,MAAM,yBAAG,IAAG,IAAI,CAAA,MAAM,yBAAG,MAAK,MAAM,EAAE,MAAM,CAAC,CAAC,EAAC;AAAE;AAAC,SAAS,0CAAG,CAAC;IAAE,MAAM,IAAE;QAAC;QAAI;QAAI;KAAI,EAAC,IAAE,EAAE,KAAK,CAAC;IAAK,KAAI,MAAM,KAAK,EAAE;QAAC,MAAM,IAAE,CAAC,CAAC,EAAE,EAAC,IAAE,EAAE,KAAK,CAAC;QAAG,IAAG,CAAC,EAAE,QAAQ,CAAC,IAAG,OAAM,CAAC;QAAE,IAAG,QAAM,KAAG,QAAM,GAAE;YAAC,IAAG,QAAM,KAAG,QAAM,GAAE,OAAM,CAAC;QAAC,OAAM,IAAG,QAAM,GAAE;YAAC,MAAM,IAAE,SAAS;YAAG,IAAG,MAAM,MAAI,KAAG,GAAE,OAAM,CAAC;QAAC;IAAC;IAAC,OAAM,CAAC;AAAC;AAAC,eAAe,0CAAG,CAAC,EAAC,CAAC;IAAE,MAAM,IAAE;QAAC,GAAE,OAAM,IAAG,MAAM,EAAE,MAAM,CAAC;QAAG,GAAE,OAAM,IAAG,MAAM,EAAE,MAAM,CAAC;QAAG,GAAE,OAAM,IAAG,MAAM,yBAAG;IAAE;IAAE,IAAG;QAAC,IAAG,CAAC,0CAAG,IAAG;QAAO,MAAM,IAAE,EAAE,KAAK,CAAC;QAAK,KAAI,MAAM,KAAK,EAAE;YAAC,MAAM,IAAE,CAAC,CAAC,EAAE,EAAC,IAAE,EAAE,KAAK,CAAC;YAAG,QAAM,IAAE,MAAM,EAAE,CAAC,CAAC,OAAO,MAAI,QAAM,KAAG,QAAM,KAAG,MAAM,CAAC,CAAC,EAAE,CAAC,QAAM;QAAE;IAAC,EAAC,OAAM,GAAE;QAAC,MAAM,IAAI,MAAM;IAAgC;AAAC;AAAC,IAAI,2BAAG,SAAS,CAAC;IAAE,OAAO,KAAK;AAAE;AAAE,MAAM;IAAG,YAAY,CAAC,CAAC;QAAC,IAAI,CAAC,aAAa,GAAC,MAAK,IAAI,CAAC,eAAe,GAAC,GAAE,IAAI,CAAC,cAAc,GAAC,GAAE,IAAI,CAAC,aAAa,GAAC,GAAE,IAAI,CAAC,aAAa,GAAC,GAAE,IAAI,CAAC,WAAW,GAAC,GAAE,IAAI,CAAC,YAAY,GAAC,GAAE,IAAI,CAAC,aAAa,GAAC,GAAE,IAAI,CAAC,YAAY,GAAC,IAAG,IAAI,CAAC,cAAc,GAAC,IAAG,IAAI,CAAC,mBAAmB,GAAC,IAAG,IAAI,CAAC,oBAAoB,GAAC,IAAG,IAAI,CAAC,mBAAmB,GAAC,IAAG,IAAI,CAAC,kBAAkB,GAAC,IAAG,IAAI,CAAC,iBAAiB,GAAC,IAAG,IAAI,CAAC,eAAe,GAAC,KAAI,IAAI,CAAC,gBAAgB,GAAC,KAAI,IAAI,CAAC,cAAc,GAAC,KAAI,IAAI,CAAC,iBAAiB,GAAC,KAAI,IAAI,CAAC,eAAe,GAAC,KAAI,IAAI,CAAC,kBAAkB,GAAC,KAAI,IAAI,CAAC,oBAAoB,GAAC,GAAE,IAAI,CAAC,2BAA2B,GAAC,KAAI,IAAI,CAAC,0BAA0B,GAAC,KAAI,IAAI,CAAC,kBAAkB,GAAC,KAAI,IAAI,CAAC,kBAAkB,GAAC,MAAK,IAAI,CAAC,kBAAkB,GAAC,KAAI,IAAI,CAAC,WAAW,GAAC,IAAE,IAAI,CAAC,kBAAkB,EAAC,IAAI,CAAC,0BAA0B,GAAC,YAAW,IAAI,CAAC,oBAAoB,GAAC;YAAC,IAAG;YAAQ,IAAG;YAAQ,IAAG;YAAM,IAAG;YAAM,IAAG;YAAM,IAAG;YAAM,IAAG;QAAM,GAAE,IAAI,CAAC,wBAAwB,GAAC;YAAC,IAAG;YAAI,IAAG;YAAI,IAAG;YAAK,IAAG;YAAK,IAAG;YAAK,IAAG;YAAK,IAAG;QAAK,GAAE,IAAI,CAAC,mBAAmB,GAAC,MAAK,IAAI,CAAC,WAAW,GAAC,QAAO,IAAI,CAAC,YAAY,GAAC,CAAC,GAAE,IAAI,CAAC,gBAAgB,GAAC,CAAC,GAAE,IAAI,CAAC,QAAQ,GAAC,SAAS,CAAC;YAAE,IAAI,GAAE,IAAE;YAAI,IAAI,IAAE,GAAE,IAAE,EAAE,MAAM,EAAC,IAAI,KAAG,CAAC,CAAC,EAAE;YAAC,OAAO;QAAC,GAAE,IAAI,CAAC,YAAY,GAAC,SAAS,CAAC,EAAC,CAAC;YAAE,MAAM,IAAE,IAAG,CAAA,IAAE,GAAE;YAAG,OAAO,IAAE,MAAI,MAAI;QAAC,GAAE,IAAI,CAAC,cAAc,GAAC,SAAS,CAAC;YAAE,IAAI,IAAE;YAAG,OAAM,OAAK,EAAE,OAAO,CAAC,QAAM,IAAE,OAAK,SAAS,EAAE,KAAK,CAAC,GAAE,EAAE,OAAO,CAAC,UAAQ,OAAK,EAAE,OAAO,CAAC,SAAQ,CAAA,IAAE,OAAK,SAAS,EAAE,KAAK,CAAC,GAAE,EAAE,OAAO,CAAC,UAAQ,IAAG,GAAG;QAAC,GAAE,IAAI,CAAC,OAAO,GAAC,CAAC,GAAE,IAAI,CAAC,gBAAgB,GAAC,OAAM,IAAI,CAAC,SAAS,GAAC,EAAE,SAAS,EAAC,IAAI,CAAC,QAAQ,GAAC,EAAE,QAAQ,EAAC,EAAE,aAAa,IAAG,CAAA,IAAI,CAAC,aAAa,GAAC,EAAE,aAAa,AAAD,GAAG,EAAE,WAAW,IAAG,CAAA,IAAI,CAAC,WAAW,GAAC,EAAE,WAAW,AAAD,GAAG,EAAE,QAAQ,IAAG,CAAA,IAAI,CAAC,QAAQ,GAAC,EAAE,QAAQ,EAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAC,GAAG,KAAK,MAAI,EAAE,YAAY,IAAG,CAAA,IAAI,CAAC,YAAY,GAAC,EAAE,YAAY,AAAD,GAAG,EAAE,IAAI,IAAG,CAAA,IAAI,CAAC,SAAS,GAAC,IAAI,0CAAG,EAAE,IAAI,CAAA,GAAG,KAAK,MAAI,EAAE,aAAa,IAAG,CAAA,IAAI,CAAC,SAAS,CAAC,OAAO,GAAC,EAAE,aAAa,AAAD,GAAG,IAAI,CAAC,IAAI,CAAC,eAAc,IAAI,CAAC,IAAI,CAAC,iBAAe,IAAI,CAAC,SAAS,CAAC,OAAO;IAAG;IAAC,OAAO,CAAC,EAAC;QAAC,OAAO,IAAI,QAAS,CAAA,IAAG,WAAW,GAAE;IAAI;IAAC,MAAM,CAAC,EAAC,IAAE,CAAC,CAAC,EAAC;QAAC,IAAI,CAAC,QAAQ,GAAC,IAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAG,QAAQ,GAAG,CAAC;IAAE;IAAC,MAAM,CAAC,EAAC,IAAE,CAAC,CAAC,EAAC;QAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,EAAC;IAAE;IAAC,KAAK,CAAC,EAAC,IAAE,CAAC,CAAC,EAAC;QAAC,IAAI,CAAC,KAAK,CAAC,GAAE;IAAE;IAAC,MAAM,CAAC,EAAC,IAAE,CAAC,CAAC,EAAC;QAAC,IAAI,CAAC,YAAY,IAAE,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,EAAC;IAAE;IAAC,kBAAkB,CAAC,EAAC;QAAC,OAAO,IAAI,WAAW;YAAC,MAAI;YAAE,KAAG,IAAE;SAAI;IAAC;IAAC,gBAAgB,CAAC,EAAC;QAAC,OAAO,IAAI,WAAW;YAAC,MAAI;YAAE,KAAG,IAAE;YAAI,KAAG,KAAG;YAAI,KAAG,KAAG;SAAI;IAAC;IAAC,kBAAkB,CAAC,EAAC,CAAC,EAAC;QAAC,OAAO,IAAE,KAAG;IAAC;IAAC,gBAAgB,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC;QAAC,OAAO,IAAE,KAAG,IAAE,KAAG,KAAG,KAAG;IAAE;IAAC,cAAc,CAAC,EAAC,CAAC,EAAC;QAAC,MAAM,IAAE,IAAI,WAAW,EAAE,UAAU,GAAC,EAAE,UAAU;QAAE,OAAO,EAAE,GAAG,CAAC,IAAI,WAAW,IAAG,IAAG,EAAE,GAAG,CAAC,IAAI,WAAW,IAAG,EAAE,UAAU,GAAE,EAAE,MAAM;IAAA;IAAC,aAAa,CAAC,EAAC,CAAC,EAAC;QAAC,MAAM,IAAE,IAAI,WAAW,EAAE,MAAM,GAAC,EAAE,MAAM;QAAE,OAAO,EAAE,GAAG,CAAC,GAAE,IAAG,EAAE,GAAG,CAAC,GAAE,EAAE,MAAM,GAAE;IAAC;IAAC,UAAU,CAAC,EAAC;QAAC,IAAI,IAAE;QAAG,IAAI,IAAI,IAAE,GAAE,IAAE,EAAE,MAAM,EAAC,IAAI,KAAG,OAAO,YAAY,CAAC,CAAC,CAAC,EAAE;QAAE,OAAO;IAAC;IAAC,UAAU,CAAC,EAAC;QAAC,MAAM,IAAE,IAAI,WAAW,EAAE,MAAM;QAAE,IAAI,IAAI,IAAE,GAAE,IAAE,EAAE,MAAM,EAAC,IAAI,CAAC,CAAC,EAAE,GAAC,EAAE,UAAU,CAAC;QAAG,OAAO;IAAC;IAAC,MAAM,aAAY;QAAC,IAAG;YAAC,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;QAAI,EAAC,OAAM,GAAE;YAAC,IAAI,CAAC,KAAK,CAAC,EAAE,OAAO;QAAC;IAAC;IAAC,MAAM,WAAW,IAAE,IAAI,EAAC,IAAE,GAAG,EAAC;QAAC,IAAI,IAAI,IAAE,GAAE,IAAE,KAAI,IAAI;YAAC,MAAM,IAAE,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAG,IAAE,CAAC,CAAC,EAAE,EAAC,IAAE,CAAC,CAAC,EAAE,EAAC,IAAE,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,EAAC,CAAC,CAAC,EAAE,EAAC,CAAC,CAAC,EAAE,EAAC,CAAC,CAAC,EAAE,GAAE,IAAE,EAAE,KAAK,CAAC;YAAG,IAAG,KAAG,GAAE;gBAAC,IAAG,QAAM,KAAG,KAAG,GAAE,OAAM;oBAAC;oBAAE;iBAAE;gBAAC,IAAG,KAAG,CAAC,CAAC,EAAE,IAAE,CAAC,CAAC,EAAE,IAAE,IAAI,CAAC,oBAAoB,EAAC,MAAM,MAAM,IAAI,CAAC,UAAU,IAAG,IAAI,wBAAE;YAA4B;QAAC;QAAC,MAAM,IAAI,wBAAE;IAAmB;IAAC,MAAM,QAAQ,IAAE,IAAI,EAAC,IAAE,IAAI,WAAW,EAAE,EAAC,IAAE,CAAC,EAAC,IAAE,CAAC,CAAC,EAAC,IAAE,GAAG,EAAC;QAAC,IAAG,QAAM,GAAE;YAAC,IAAI,CAAC,SAAS,CAAC,OAAO,IAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,aAAa,EAAE,EAAE,QAAQ,CAAC,IAAI,QAAQ,CAAC,GAAE,KAAK,UAAU,EAAE,EAAE,MAAM,CAAC,eAAe,EAAE,IAAE,IAAE,EAAE,SAAS,EAAE,AAAC,CAAA,IAAE,GAAE,EAAG,OAAO,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,MAAM,IAAE,IAAI,WAAW,IAAE,EAAE,MAAM;YAAE,IAAI;YAAE,IAAI,CAAC,CAAC,EAAE,GAAC,GAAE,CAAC,CAAC,EAAE,GAAC,GAAE,CAAC,CAAC,EAAE,GAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,EAAC,CAAC,CAAC,EAAE,GAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,EAAC,CAAC,CAAC,EAAE,GAAC,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,EAAC,CAAC,CAAC,EAAE,GAAC,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,EAAC,CAAC,CAAC,EAAE,GAAC,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,EAAC,CAAC,CAAC,EAAE,GAAC,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,EAAC,IAAE,GAAE,IAAE,EAAE,MAAM,EAAC,IAAI,CAAC,CAAC,IAAE,EAAE,GAAC,CAAC,CAAC,EAAE;YAAC,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;QAAE;QAAC,OAAO,IAAE,IAAI,CAAC,UAAU,CAAC,GAAE,KAAG;YAAC;YAAE,IAAI,WAAW;SAAG;IAAA;IAAC,MAAM,QAAQ,CAAC,EAAC,IAAE,GAAG,EAAC;QAAC,MAAM,IAAE,IAAI,CAAC,eAAe,CAAC;QAAG,OAAM,AAAC,CAAA,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAC,GAAE,KAAK,GAAE,KAAK,GAAE,EAAC,CAAE,CAAC,EAAE;IAAA;IAAC,MAAM,SAAS,CAAC,EAAC,CAAC,EAAC,IAAE,UAAU,EAAC,IAAE,CAAC,EAAC,IAAE,CAAC,EAAC;QAAC,IAAI,IAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,IAAG,IAAI,CAAC,eAAe,CAAC;QAAI,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE,IAAI,CAAC,eAAe,CAAC,KAAI,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE,IAAI,CAAC,eAAe,CAAC,KAAI,IAAE,KAAI,CAAA,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,IAAG,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE,IAAI,CAAC,eAAe,CAAC,KAAI,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE,IAAI,CAAC,eAAe,CAAC,KAAI,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE,IAAI,CAAC,eAAe,CAAC,GAAE,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,uBAAsB,IAAI,CAAC,aAAa,EAAC;IAAE;IAAC,MAAM,OAAM;QAAC,IAAI,CAAC,KAAK,CAAC;QAAQ,MAAM,IAAE,IAAI,WAAW;QAAI,IAAI;QAAE,IAAI,CAAC,CAAC,EAAE,GAAC,GAAE,CAAC,CAAC,EAAE,GAAC,GAAE,CAAC,CAAC,EAAE,GAAC,IAAG,CAAC,CAAC,EAAE,GAAC,IAAG,IAAE,GAAE,IAAE,IAAG,IAAI,CAAC,CAAC,IAAE,EAAE,GAAC;QAAG,IAAG;YAAC,MAAM,IAAE,MAAM,IAAI,CAAC,OAAO,CAAC,GAAE,GAAE,KAAK,GAAE,KAAK,GAAE;YAAK,OAAO,IAAI,CAAC,gBAAgB,GAAC,IAAI,CAAC,gBAAgB,IAAE,MAAI,CAAC,CAAC,EAAE,EAAC;QAAC,EAAC,OAAM,GAAE;YAAC,MAAM,IAAI,CAAC,KAAK,CAAC,cAAY,IAAG;QAAC;IAAC;IAAC,MAAM,gBAAgB,IAAE,eAAe,EAAC,IAAE,CAAC,CAAC,EAAC;QAAC,IAAG,IAAI,CAAC,KAAK,CAAC,sBAAoB,IAAE,MAAI,IAAG,eAAa;YAAE,IAAG,IAAI,CAAC,SAAS,CAAC,MAAM,OAAK,IAAI,CAAC,mBAAmB,EAAC,MAAM,0CAAG,IAAI,CAAC,SAAS;iBAAM;gBAAC,MAAM,IAAE,IAAE,kCAAgC;gBAA0B,MAAM,0CAAG,IAAI,CAAC,SAAS,EAAC;YAAE;;QAAC,IAAI,IAAE,GAAE,IAAE,CAAC;QAAE,MAAK,GAAG;YAAC,IAAG;gBAAC,KAAG,AAAC,CAAA,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAG,EAAG,MAAM;YAAA,EAAC,OAAM,GAAE;gBAAC,IAAG,IAAI,CAAC,KAAK,CAAC,EAAE,OAAO,GAAE,aAAa,OAAM;oBAAC,IAAE,CAAC;oBAAE;gBAAK;YAAC;YAAC,MAAM,IAAI,CAAC,MAAM,CAAC;QAAG;QAAC,IAAI,IAAI,CAAC,SAAS,CAAC,iBAAiB,GAAC,CAAC,GAAE,IAAI,CAAC,gBAAgB,GAAC,CAAC,GAAE,IAAE,GAAE,KAAK;YAAC,IAAG;gBAAC,MAAM,IAAE,MAAM,IAAI,CAAC,IAAI;gBAAG,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,KAAI;YAAS,EAAC,OAAM,GAAE;gBAAC,aAAa,SAAQ,CAAA,IAAE,IAAI,CAAC,IAAI,CAAC,KAAI,CAAC,KAAG,IAAI,CAAC,IAAI,CAAC,KAAI,CAAC,EAAC;YAAE;YAAC,MAAM,IAAI,CAAC,MAAM,CAAC;QAAG;QAAC,OAAM;IAAO;IAAC,MAAM,QAAQ,IAAE,eAAe,EAAC,IAAE,CAAC,EAAC,IAAE,CAAC,CAAC,EAAC;QAAC,IAAI,GAAE;QAAE,IAAI,IAAI,CAAC,IAAI,CAAC,iBAAgB,CAAC,IAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAC,IAAI,CAAC,aAAa,GAAE,IAAE,GAAE,IAAE,KAAI,CAAA,IAAE,MAAM,IAAI,CAAC,eAAe,CAAC,GAAE,CAAC,IAAG,cAAY,CAAA,KAAK,CAAA,IAAE,MAAM,IAAI,CAAC,eAAe,CAAC,GAAE,CAAC,IAAG,cAAY,CAAA,GAAG;QAAK,IAAG,cAAY,GAAE,MAAM,IAAI,wBAAE;QAAqC,IAAG,IAAI,CAAC,IAAI,CAAC,QAAO,CAAC,IAAG,CAAC,GAAE;YAAC,MAAM,IAAE,MAAM,IAAI,CAAC,OAAO,CAAC,gBAAc;YAAE,IAAI,CAAC,KAAK,CAAC,gBAAc,EAAE,QAAQ,CAAC;YAAK,MAAM,IAAE,MAAM,eAAe,CAAC;gBAAE,OAAO;oBAAG,KAAK;wBAAS;4BAAC,MAAK,EAAC,UAAS,CAAC,EAAC,GAAC,MAAM,QAAQ,OAAO,GAAG,IAAI,CAAE;gCAAW,OAAO;4BAAE;4BAAI,OAAO,IAAI;wBAAC;oBAAC,KAAK;oBAAW,KAAK;wBAAW;4BAAC,MAAK,EAAC,YAAW,CAAC,EAAC,GAAC,MAAM,QAAQ,OAAO,GAAG,IAAI,CAAE;gCAAW,OAAO;4BAAE;4BAAI,OAAO,IAAI;wBAAC;oBAAC,KAAK;oBAAW,KAAK;oBAAU,KAAK;oBAAW,KAAK;wBAAW;4BAAC,MAAK,EAAC,YAAW,CAAC,EAAC,GAAC,MAAM,QAAQ,OAAO,GAAG,IAAI,CAAE;gCAAW,OAAO;4BAAE;4BAAI,OAAO,IAAI;wBAAC;oBAAC,KAAK;wBAAU;4BAAC,MAAK,EAAC,YAAW,CAAC,EAAC,GAAC,MAAM,QAAQ,OAAO,GAAG,IAAI,CAAE;gCAAW,OAAO;4BAAE;4BAAI,OAAO,IAAI;wBAAC;oBAAC,KAAK;wBAAU;4BAAC,MAAK,EAAC,YAAW,CAAC,EAAC,GAAC,MAAM,QAAQ,OAAO,GAAG,IAAI,CAAE;gCAAW,OAAO;4BAAE;4BAAI,OAAO,IAAI;wBAAC;oBAAC,KAAK;wBAAW;4BAAC,MAAK,EAAC,YAAW,CAAC,EAAC,GAAC,MAAM,QAAQ,OAAO,GAAG,IAAI,CAAE;gCAAW,OAAO;4BAAE;4BAAI,OAAO,IAAI;wBAAC;oBAAC,KAAK;wBAAE;4BAAC,MAAK,EAAC,YAAW,CAAC,EAAC,GAAC,MAAM,QAAQ,OAAO,GAAG,IAAI,CAAE;gCAAW,OAAO;4BAAE;4BAAI,OAAO,IAAI;wBAAC;oBAAC,KAAK;wBAAK;4BAAC,MAAK,EAAC,YAAW,CAAC,EAAC,GAAC,MAAM,QAAQ,OAAO,GAAG,IAAI,CAAE;gCAAW,OAAO;4BAAE;4BAAI,OAAO,IAAI;wBAAC;oBAAC,KAAK;wBAAW;4BAAC,MAAK,EAAC,YAAW,CAAC,EAAC,GAAC,MAAM,QAAQ,OAAO,GAAG,IAAI,CAAE;gCAAW,OAAO;4BAAE;4BAAI,OAAO,IAAI;wBAAC;oBAAC,KAAK;oBAAE,KAAK;oBAAU,KAAK;wBAAU;4BAAC,MAAK,EAAC,YAAW,CAAC,EAAC,GAAC,MAAM,QAAQ,OAAO,GAAG,IAAI,CAAE;gCAAW,OAAO;4BAAE;4BAAI,OAAO,IAAI;wBAAC;oBAAC;wBAAQ,OAAO;gBAAI;YAAC,EAAE;YAAG,IAAG,SAAO,IAAI,CAAC,IAAI,EAAC,MAAM,IAAI,wBAAE,CAAC,4BAA4B,EAAE,EAAE,iCAAiC,CAAC;YAAE,IAAI,CAAC,IAAI,GAAC;QAAC;IAAC;IAAC,MAAM,WAAW,IAAE,eAAe,EAAC;QAAC,MAAM,IAAI,CAAC,OAAO,CAAC,IAAG,IAAI,CAAC,IAAI,CAAC,2BAA0B,CAAC,IAAG,QAAM,IAAI,CAAC,IAAI,GAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,IAAE,IAAI,CAAC,IAAI,CAAC;IAAW;IAAC,MAAM,aAAa,IAAE,EAAE,EAAC,IAAE,IAAI,EAAC,IAAE,IAAI,WAAW,EAAE,EAAC,IAAE,CAAC,EAAC,IAAE,GAAG,EAAC;QAAC,IAAI,CAAC,KAAK,CAAC,mBAAiB;QAAG,MAAM,IAAE,MAAM,IAAI,CAAC,OAAO,CAAC,GAAE,GAAE,GAAE,KAAK,GAAE;QAAG,OAAO,CAAC,CAAC,EAAE,CAAC,MAAM,GAAC,IAAE,CAAC,CAAC,EAAE,GAAC,CAAC,CAAC,EAAE;IAAA;IAAC,MAAM,SAAS,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC;QAAC,IAAI,CAAC,KAAK,CAAC,eAAa,IAAE,MAAI,IAAE,MAAI,IAAE,MAAI,EAAE,QAAQ,CAAC;QAAK,IAAI,IAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,IAAG,IAAI,CAAC,eAAe,CAAC;QAAI,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE,IAAI,CAAC,eAAe,CAAC,KAAI,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE,IAAI,CAAC,eAAe,CAAC,KAAI,MAAM,IAAI,CAAC,YAAY,CAAC,2BAA0B,IAAI,CAAC,aAAa,EAAC;IAAE;IAAC,MAAM,SAAS,CAAC,EAAC,CAAC,EAAC;QAAC,IAAI,IAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,MAAM,GAAE,IAAI,CAAC,eAAe,CAAC;QAAI,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE,IAAI,CAAC,eAAe,CAAC,KAAI,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE,IAAI,CAAC,eAAe,CAAC,KAAI,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE;QAAG,MAAM,IAAE,IAAI,CAAC,QAAQ,CAAC;QAAG,MAAM,IAAI,CAAC,YAAY,CAAC,uBAAsB,IAAI,CAAC,YAAY,EAAC,GAAE;IAAE;IAAC,MAAM,UAAU,CAAC,EAAC;QAAC,MAAM,IAAE,MAAI,IAAE,IAAE,GAAE,IAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,IAAG,IAAI,CAAC,eAAe,CAAC;QAAI,MAAM,IAAI,CAAC,YAAY,CAAC,2BAA0B,IAAI,CAAC,WAAW,EAAC,GAAE,KAAK,GAAE;IAAG;IAAC,MAAM,eAAe,CAAC,EAAC;QAAC,MAAM,IAAE,IAAI,CAAC,eAAe,CAAC;QAAG,MAAM,IAAI,CAAC,YAAY,CAAC,4BAA2B,IAAI,CAAC,cAAc,EAAC;IAAE;IAAC,MAAM,WAAW,CAAC,EAAC,CAAC,EAAC;QAAC,MAAM,IAAE,KAAK,KAAK,CAAC,AAAC,CAAA,IAAE,IAAI,CAAC,gBAAgB,GAAC,CAAA,IAAG,IAAI,CAAC,gBAAgB,GAAE,IAAE,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,GAAE,IAAG,IAAE,IAAI,MAAK,IAAE,EAAE,OAAO;QAAG,IAAI,IAAE;QAAI,KAAG,IAAI,CAAC,OAAO,IAAG,CAAA,IAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,2BAA2B,EAAC,EAAC,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAe,IAAE,MAAI,IAAE,MAAI,IAAI,CAAC,gBAAgB,GAAC,MAAI,IAAE,MAAI;QAAG,IAAI,IAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,IAAG,IAAI,CAAC,eAAe,CAAC;QAAI,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,gBAAgB,IAAG,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE,IAAI,CAAC,eAAe,CAAC,KAAI,KAAG,IAAI,CAAC,OAAO,IAAG,CAAA,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE,IAAI,CAAC,eAAe,CAAC,GAAE,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,6BAA4B,IAAI,CAAC,eAAe,EAAC,GAAE,KAAK,GAAE;QAAG,MAAM,IAAE,EAAE,OAAO;QAAG,OAAO,KAAG,KAAG,KAAG,IAAI,CAAC,OAAO,IAAE,IAAI,CAAC,IAAI,CAAC,UAAQ,AAAC,CAAA,IAAE,CAAA,IAAG,MAAI,MAAI,AAAC,CAAA,IAAE,CAAA,IAAG,MAAI,2BAA0B;IAAC;IAAC,MAAM,eAAe,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC;QAAC,MAAM,IAAE,KAAK,KAAK,CAAC,AAAC,CAAA,IAAE,IAAI,CAAC,gBAAgB,GAAC,CAAA,IAAG,IAAI,CAAC,gBAAgB,GAAE,IAAE,KAAK,KAAK,CAAC,AAAC,CAAA,IAAE,IAAI,CAAC,gBAAgB,GAAC,CAAA,IAAG,IAAI,CAAC,gBAAgB,GAAE,IAAE,IAAI,MAAK,IAAE,EAAE,OAAO;QAAG,IAAI,GAAE;QAAE,IAAI,CAAC,OAAO,GAAE,CAAA,IAAE,GAAE,IAAE,GAAE,IAAI,CAAA,IAAE,IAAE,IAAI,CAAC,gBAAgB,EAAC,IAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,2BAA2B,EAAC,EAAC,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAc,IAAE,eAAa,IAAE;QAAO,IAAI,IAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,IAAG,IAAI,CAAC,eAAe,CAAC;QAAI,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,gBAAgB,IAAG,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE,IAAI,CAAC,eAAe,CAAC,KAAI,eAAa,IAAI,CAAC,IAAI,CAAC,SAAS,IAAE,eAAa,IAAI,CAAC,IAAI,CAAC,SAAS,IAAE,eAAa,IAAI,CAAC,IAAI,CAAC,SAAS,IAAE,eAAa,IAAI,CAAC,IAAI,CAAC,SAAS,IAAE,CAAC,MAAI,IAAI,CAAC,OAAO,IAAG,CAAA,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE,IAAI,CAAC,eAAe,CAAC,GAAE,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,+BAA8B,IAAI,CAAC,oBAAoB,EAAC,GAAE,KAAK,GAAE;QAAG,MAAM,IAAE,EAAE,OAAO;QAAG,OAAO,KAAG,KAAG,CAAC,MAAI,IAAI,CAAC,OAAO,IAAE,IAAI,CAAC,IAAI,CAAC,UAAQ,AAAC,CAAA,IAAE,CAAA,IAAG,MAAI,MAAI,AAAC,CAAA,IAAE,CAAA,IAAG,MAAI,2BAA0B;IAAC;IAAC,MAAM,WAAW,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC;QAAC,IAAI,IAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,MAAM,GAAE,IAAI,CAAC,eAAe,CAAC;QAAI,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE,IAAI,CAAC,eAAe,CAAC,KAAI,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE,IAAI,CAAC,eAAe,CAAC,KAAI,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE;QAAG,MAAM,IAAE,IAAI,CAAC,QAAQ,CAAC;QAAG,MAAM,IAAI,CAAC,YAAY,CAAC,qCAAmC,GAAE,IAAI,CAAC,cAAc,EAAC,GAAE,GAAE;IAAE;IAAC,MAAM,eAAe,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC;QAAC,IAAI,IAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,MAAM,GAAE,IAAI,CAAC,eAAe,CAAC;QAAI,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE,IAAI,CAAC,eAAe,CAAC,KAAI,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE,IAAI,CAAC,eAAe,CAAC,KAAI,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE;QAAG,MAAM,IAAE,IAAI,CAAC,QAAQ,CAAC;QAAG,IAAI,CAAC,KAAK,CAAC,sBAAoB,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAI,MAAI,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAK,MAAM,IAAI,CAAC,YAAY,CAAC,8CAA4C,GAAE,IAAI,CAAC,mBAAmB,EAAC,GAAE,GAAE;IAAE;IAAC,MAAM,YAAY,IAAE,CAAC,CAAC,EAAC;QAAC,MAAM,IAAE,IAAE,IAAE,GAAE,IAAE,IAAI,CAAC,eAAe,CAAC;QAAG,MAAM,IAAI,CAAC,YAAY,CAAC,oBAAmB,IAAI,CAAC,aAAa,EAAC;IAAE;IAAC,MAAM,gBAAgB,IAAE,CAAC,CAAC,EAAC;QAAC,MAAM,IAAE,IAAE,IAAE,GAAE,IAAE,IAAI,CAAC,eAAe,CAAC;QAAG,MAAM,IAAI,CAAC,YAAY,CAAC,+BAA8B,IAAI,CAAC,kBAAkB,EAAC;IAAE;IAAC,MAAM,mBAAmB,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC;QAAC,MAAM,IAAE,IAAI,CAAC,IAAI,CAAC,YAAY,EAAC,IAAE,IAAE,GAAE,IAAE,IAAE,IAAI,CAAC,IAAI,CAAC,YAAY,EAAC,IAAE,IAAE,IAAI,CAAC,IAAI,CAAC,aAAa,EAAC,IAAE,IAAE,IAAI,CAAC,IAAI,CAAC,aAAa,EAAC,IAAE,IAAE,IAAI,CAAC,IAAI,CAAC,WAAW;QAAC,IAAI;QAAE,IAAE,QAAM,IAAI,CAAC,IAAI,CAAC,kBAAkB,GAAC,OAAM,GAAE;YAAK,MAAM,IAAE,IAAE,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAC,IAAE,IAAE,IAAI,CAAC,IAAI,CAAC,kBAAkB;YAAC,IAAE,KAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAE,IAAE,IAAG,IAAE,KAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAE,IAAE;QAAE,IAAE,OAAM,GAAE;YAAK,MAAM,IAAE,GAAE,IAAE,AAAC,CAAA,MAAI,IAAE,IAAE,IAAE,CAAA,KAAI,IAAE,AAAC,CAAA,MAAI,IAAE,IAAE,IAAE,CAAA,KAAI;YAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAE;QAAE;QAAE,MAAM,IAAE;QAAM,IAAG,IAAE,IAAG,MAAM,IAAI,wBAAE;QAA4E,IAAG,EAAE,MAAM,GAAC,IAAG,MAAM,IAAI,wBAAE;QAA0E,MAAM,IAAE,IAAE,EAAE,MAAM,EAAC,IAAE,MAAM,IAAI,CAAC,OAAO,CAAC,IAAG,IAAE,MAAM,IAAI,CAAC,OAAO,CAAC;QAAG,IAAI,GAAE,IAAE;QAAM,IAAE,KAAI,CAAA,KAAG,SAAQ,GAAG,IAAE,KAAI,CAAA,KAAG,SAAQ,GAAG,MAAM,EAAE,GAAE,IAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAE;QAAG,IAAI,IAAE,aAAM;QAAE,IAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAE,IAAG,KAAG,GAAE,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAE;aAAO;YAAC,IAAG,EAAE,MAAM,GAAC,KAAG,GAAE;gBAAC,MAAM,IAAE,IAAI,WAAW,EAAE,MAAM,GAAC;gBAAG,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE;YAAE;YAAC,IAAI,IAAE;YAAE,IAAI,IAAE,GAAE,IAAE,EAAE,MAAM,GAAC,GAAE,KAAG,EAAE,IAAE,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,EAAC,CAAC,CAAC,IAAE,EAAE,EAAC,CAAC,CAAC,IAAE,EAAE,EAAC,CAAC,CAAC,IAAE,EAAE,GAAE,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAE,IAAG,KAAG;QAAC;QAAC,IAAI,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAE,IAAG,IAAE,GAAE,IAAE,MAAK,CAAA,IAAE,MAAM,IAAI,CAAC,OAAO,CAAC,KAAG,GAAE,KAAG,CAAA,GAAG;QAAK,IAAG,OAAK,GAAE,MAAM,IAAI,wBAAE;QAAwC,MAAM,IAAE,MAAM,IAAI,CAAC,OAAO,CAAC;QAAG,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAE,IAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAE,IAAG;IAAC;IAAC,MAAM,cAAa;QAAC,MAAM,IAAE,IAAI,WAAW;QAAG,OAAO,MAAM,IAAI,CAAC,kBAAkB,CAAC,KAAI,GAAE;IAAG;IAAC,MAAM,aAAY;QAAC,IAAI,CAAC,IAAI,CAAC;QAA4C,IAAI,IAAE,IAAI;QAAK,MAAM,IAAE,EAAE,OAAO,IAAG,IAAE,MAAM,IAAI,CAAC,YAAY,CAAC,eAAc,IAAI,CAAC,eAAe,EAAC,KAAK,GAAE,KAAK,GAAE,IAAI,CAAC,kBAAkB;QAAE,IAAE,IAAI;QAAK,MAAM,IAAE,EAAE,OAAO;QAAG,OAAO,IAAI,CAAC,IAAI,CAAC,0CAAwC,AAAC,CAAA,IAAE,CAAA,IAAG,MAAI,MAAK;IAAC;IAAC,MAAM,CAAC,EAAC;QAAC,OAAO,MAAM,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAA,IAAG,AAAC,CAAA,OAAK,EAAE,QAAQ,CAAC,GAAE,EAAG,KAAK,CAAC,KAAM,IAAI,CAAC;IAAG;IAAC,MAAM,YAAY,CAAC,EAAC,CAAC,EAAC;QAAC,MAAM,IAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,kBAAkB,EAAC;QAAG,IAAI,IAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,IAAG,IAAI,CAAC,eAAe,CAAC;QAAI,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE,IAAI,CAAC,eAAe,CAAC,KAAI,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE,IAAI,CAAC,eAAe,CAAC;QAAI,IAAI,IAAE,MAAM,IAAI,CAAC,YAAY,CAAC,oBAAmB,IAAI,CAAC,iBAAiB,EAAC,GAAE,KAAK,GAAE;QAAG,aAAa,cAAY,EAAE,MAAM,GAAC,MAAK,CAAA,IAAE,EAAE,KAAK,CAAC,GAAE,GAAE;QAAG,OAAO,IAAI,CAAC,KAAK,CAAC;IAAE;IAAC,MAAM,UAAU,CAAC,EAAC,CAAC,EAAC,IAAE,IAAI,EAAC;QAAC,IAAI,IAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,IAAG,IAAI,CAAC,eAAe,CAAC;QAAI,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE,IAAI,CAAC,eAAe,CAAC,QAAO,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE,IAAI,CAAC,eAAe,CAAC;QAAO,MAAM,IAAE,MAAM,IAAI,CAAC,YAAY,CAAC,cAAa,IAAI,CAAC,cAAc,EAAC;QAAG,IAAG,KAAG,GAAE,MAAM,IAAI,wBAAE,4BAA0B;QAAG,IAAI,IAAE,IAAI,WAAW;QAAG,MAAK,EAAE,MAAM,GAAC,GAAG;YAAC,MAAM,IAAE,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB;YAAE,IAAG,CAAE,CAAA,aAAa,UAAS,GAAG,MAAM,IAAI,wBAAE,4BAA0B;YAAG,EAAE,MAAM,GAAC,KAAI,CAAA,IAAE,IAAI,CAAC,YAAY,CAAC,GAAE,IAAG,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,MAAM,IAAG,KAAG,EAAE,GAAE,EAAE,MAAM,EAAC,EAAC;QAAE;QAAC,OAAO;IAAC;IAAC,MAAM,UAAS;QAAC,IAAG,IAAI,CAAC,gBAAgB,EAAC,OAAO,IAAI,CAAC,IAAI,CAAC,qDAAoD,IAAI,CAAC,IAAI;QAAC,IAAI,CAAC,IAAI,CAAC;QAAqB,IAAI,IAAE,yBAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAE,IAAE,EAAE,KAAK,CAAC,IAAI,GAAG,CAAE,SAAS,CAAC;YAAE,OAAO,EAAE,UAAU,CAAC;QAAE;QAAI,MAAM,IAAE,IAAI,WAAW;QAAG,IAAE,yBAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAE,IAAE,EAAE,KAAK,CAAC,IAAI,GAAG,CAAE,SAAS,CAAC;YAAE,OAAO,EAAE,UAAU,CAAC;QAAE;QAAI,MAAM,IAAE,IAAI,WAAW;QAAG,IAAI,GAAE,IAAE,KAAK,KAAK,CAAC,AAAC,CAAA,EAAE,MAAM,GAAC,IAAI,CAAC,aAAa,GAAC,CAAA,IAAG,IAAI,CAAC,aAAa;QAAE,IAAI,MAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAC,GAAE,IAAI,CAAC,aAAa,EAAC,IAAI,CAAC,IAAI,CAAC,UAAU,GAAE,IAAE,GAAE,IAAE,GAAE,IAAI;YAAC,MAAM,IAAE,IAAE,IAAI,CAAC,aAAa,EAAC,IAAE,IAAE,IAAI,CAAC,aAAa;YAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,GAAE,IAAG;QAAE;QAAC,IAAI,IAAE,KAAK,KAAK,CAAC,AAAC,CAAA,EAAE,MAAM,GAAC,IAAI,CAAC,aAAa,GAAC,CAAA,IAAG,IAAI,CAAC,aAAa,GAAE,MAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAC,GAAE,IAAI,CAAC,aAAa,EAAC,IAAI,CAAC,IAAI,CAAC,UAAU,GAAE,IAAE,GAAE,IAAE,GAAE,IAAI;YAAC,MAAM,IAAE,IAAE,IAAI,CAAC,aAAa,EAAC,IAAE,IAAE,IAAI,CAAC,aAAa;YAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,GAAE,IAAG;QAAE;QAAC,IAAI,CAAC,IAAI,CAAC,oBAAmB,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK;QAAE,IAAI,IAAI,IAAE,GAAE,IAAE,KAAI,IAAI;YAAC,MAAM,IAAE,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAI;YAAG,IAAG,OAAK,CAAC,CAAC,EAAE,IAAE,OAAK,CAAC,CAAC,EAAE,IAAE,OAAK,CAAC,CAAC,EAAE,IAAE,OAAK,CAAC,CAAC,EAAE,EAAC,OAAO,IAAI,CAAC,IAAI,CAAC,oBAAmB,IAAI,CAAC,OAAO,GAAC,CAAC,GAAE,IAAI,CAAC,gBAAgB,GAAC,OAAM,IAAI,CAAC,IAAI;QAAA;QAAC,MAAM,IAAI,wBAAE;IAA4C;IAAC,MAAM,aAAY;QAAC,IAAI,CAAC,IAAI,CAAC,0BAAwB,IAAI,CAAC,QAAQ;QAAE,MAAM,IAAE,IAAI,CAAC,OAAO,GAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,GAAC,GAAE,IAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,GAAE,IAAI,CAAC,eAAe,CAAC,KAAI,IAAE,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAC;QAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,KAAI,IAAI,CAAC,IAAI,CAAC,YAAW,MAAM,IAAI,CAAC,SAAS,CAAC,UAAU,IAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAI,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAC,IAAI,CAAC,aAAa;QAAE,IAAG;YAAC,IAAI,IAAE;YAAG,MAAK,KAAK;gBAAC,IAAG;oBAAC,MAAM,IAAI,CAAC,IAAI;oBAAG;gBAAK,EAAC,OAAM,GAAE;oBAAC,IAAI,CAAC,KAAK,CAAC,EAAE,OAAO;gBAAC;gBAAC,MAAM,IAAI,CAAC,MAAM,CAAC;YAAG;QAAC,EAAC,OAAM,GAAE;YAAC,IAAI,CAAC,KAAK,CAAC,EAAE,OAAO;QAAC;IAAC;IAAC,MAAM,KAAK,IAAE,eAAe,EAAC;QAAC,MAAM,IAAI,CAAC,UAAU,CAAC;QAAG,MAAM,IAAE,MAAM,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC,aAAW,IAAG,IAAI,CAAC,IAAI,CAAC,eAAa,MAAM,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,IAAG,IAAI,CAAC,IAAI,CAAC,gBAAc,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,IAAE,QAAO,IAAI,CAAC,IAAI,CAAC,UAAQ,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,IAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,GAAE,KAAK,MAAI,IAAI,CAAC,IAAI,CAAC,WAAW,IAAE,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,GAAE,MAAM,IAAI,CAAC,OAAO,IAAG,IAAI,CAAC,WAAW,KAAG,IAAI,CAAC,QAAQ,IAAE,MAAM,IAAI,CAAC,UAAU,IAAG;IAAC;IAAC,kBAAkB,CAAC,EAAC;QAAC,IAAG,KAAK,MAAI,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,EAAC,MAAM,IAAI,wBAAE,gBAAc,IAAE,2DAAyD,IAAI,CAAC,IAAI,CAAC,WAAW;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;IAAA;IAAC,wBAAwB,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC;QAAC,IAAG,IAAI,CAAC,KAAK,CAAC,gCAA8B,IAAE,MAAI,IAAE,MAAI,IAAG,EAAE,MAAM,GAAC,GAAE,OAAO;QAAE,IAAG,KAAG,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAC,OAAO;QAAE,IAAG,WAAS,KAAG,WAAS,KAAG,WAAS,GAAE,OAAO,IAAI,CAAC,IAAI,CAAC,2BAA0B;QAAE,MAAM,IAAE,SAAS,CAAC,CAAC,EAAE;QAAE,IAAI,IAAE,SAAS,CAAC,CAAC,EAAE;QAAE,MAAM,IAAE,SAAS,CAAC,CAAC,EAAE;QAAE,IAAG,MAAI,IAAI,CAAC,eAAe,EAAC,OAAO,IAAI,CAAC,IAAI,CAAC,8BAA4B,EAAE,QAAQ,CAAC,MAAI,0EAAyE;QAAE,IAAG,WAAS,GAAG,IAAE,CAAA;YAAC,KAAI;YAAE,MAAK;YAAE,KAAI;YAAE,MAAK;QAAC,CAAA,CAAC,CAAC,EAAE;QAAC,IAAI,IAAE,KAAG;QAAE,IAAG,WAAS,GAAG,IAAE,CAAA;YAAC,OAAM;YAAE,OAAM;YAAE,OAAM;YAAE,OAAM;QAAE,CAAA,CAAC,CAAC,EAAE;QAAC,IAAI,IAAE,MAAI;QAAE,WAAS,KAAI,CAAA,IAAE,IAAI,CAAC,iBAAiB,CAAC,EAAC;QAAG,MAAM,IAAE,KAAG,IAAE,IAAE;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC,yBAAuB,EAAE,QAAQ,CAAC,MAAK,SAAS,CAAC,CAAC,EAAE,MAAI,KAAG,KAAI,CAAA,IAAE,EAAE,SAAS,CAAC,GAAE,KAAG,AAAC,CAAA,KAAG,CAAA,EAAG,QAAQ,KAAG,EAAE,SAAS,CAAC,EAAC,GAAG,SAAS,CAAC,CAAC,EAAE,MAAI,IAAE,KAAI,CAAA,IAAE,EAAE,SAAS,CAAC,GAAE,KAAG,AAAC,CAAA,IAAE,CAAA,EAAG,QAAQ,KAAG,EAAE,SAAS,CAAC,EAAC,GAAG;IAAC;IAAC,MAAM,WAAW,CAAC,EAAC;QAAC,IAAG,IAAI,CAAC,KAAK,CAAC,sBAAqB,WAAS,EAAE,SAAS,EAAC;YAAC,MAAM,IAAE,IAAI,CAAC,cAAc,CAAC,EAAE,SAAS;YAAE,IAAI,IAAI,IAAE,GAAE,IAAE,EAAE,SAAS,CAAC,MAAM,EAAC,IAAI,IAAG,EAAE,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,GAAC,EAAE,SAAS,CAAC,EAAE,CAAC,OAAO,GAAC,GAAE,MAAM,IAAI,wBAAE,CAAC,KAAK,EAAE,IAAE,EAAE,mCAAmC,CAAC;QAAC;QAAC,IAAI,GAAE;QAAE,CAAC,MAAI,IAAI,CAAC,OAAO,IAAE,CAAC,MAAI,EAAE,QAAQ,IAAE,MAAM,IAAI,CAAC,UAAU;QAAG,IAAI,IAAI,IAAE,GAAE,IAAE,EAAE,SAAS,CAAC,MAAM,EAAC,IAAI;YAAC,IAAI,CAAC,KAAK,CAAC,iBAAe,EAAE,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,GAAE,IAAE,EAAE,SAAS,CAAC,EAAE,CAAC,IAAI;YAAC,MAAM,IAAE,EAAE,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,GAAC;YAAE,IAAG,IAAE,KAAI,CAAA,KAAG,mBAAO,SAAS,CAAC,IAAE,EAAC,GAAG,IAAE,EAAE,SAAS,CAAC,EAAE,CAAC,OAAO,EAAC,IAAI,CAAC,KAAK,CAAC,kBAAgB,EAAE,MAAM,GAAE,MAAI,EAAE,MAAM,EAAC;gBAAC,IAAI,CAAC,KAAK,CAAC;gBAA0B;YAAQ;YAAC,IAAE,IAAI,CAAC,uBAAuB,CAAC,GAAE,GAAE,EAAE,SAAS,EAAC,EAAE,SAAS,EAAC,EAAE,SAAS;YAAE,IAAI,IAAE;YAAK,EAAE,gBAAgB,IAAG,CAAA,IAAE,EAAE,gBAAgB,CAAC,IAAG,IAAI,CAAC,KAAK,CAAC,eAAa,EAAC;YAAG,MAAM,IAAE,EAAE,MAAM;YAAC,IAAI;YAAE,IAAG,EAAE,QAAQ,EAAC;gBAAC,MAAM,IAAE,IAAI,CAAC,SAAS,CAAC;gBAAG,IAAE,IAAI,CAAC,SAAS,CAAC,yBAAG,GAAE;oBAAC,OAAM;gBAAC,KAAI,IAAE,MAAM,IAAI,CAAC,cAAc,CAAC,GAAE,EAAE,MAAM,EAAC;YAAE,OAAM,IAAE,MAAM,IAAI,CAAC,UAAU,CAAC,GAAE;YAAG,IAAI,IAAE,GAAE,IAAE;YAAE,MAAM,IAAE,EAAE,MAAM;YAAC,EAAE,cAAc,IAAE,EAAE,cAAc,CAAC,GAAE,GAAE;YAAG,IAAI,IAAE,IAAI;YAAK,MAAM,IAAE,EAAE,OAAO;YAAG,IAAI,IAAE;YAAI,MAAM,IAAE,IAAI,yBAAG;gBAAC,WAAU;YAAC;YAAG,IAAI,IAAE;YAAE,IAAI,EAAE,MAAM,GAAC,SAAS,CAAC;gBAAE,KAAG,EAAE,UAAU;YAAA,GAAE,EAAE,MAAM,GAAC,GAAG;gBAAC,IAAI,CAAC,KAAK,CAAC,gBAAc,IAAE,MAAI,IAAE,MAAI,IAAG,IAAI,CAAC,IAAI,CAAC,kBAAgB,AAAC,CAAA,IAAE,CAAA,EAAG,QAAQ,CAAC,MAAI,UAAQ,KAAK,KAAK,CAAC,MAAK,CAAA,IAAE,CAAA,IAAG,KAAG;gBAAM,MAAM,IAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,CAAC,GAAE,IAAI,CAAC,gBAAgB;gBAAG,IAAG,CAAC,EAAE,QAAQ,EAAC,MAAM,IAAI,wBAAE;gBAAuC;oBAAC,MAAM,IAAE;oBAAE,EAAE,IAAI,CAAC,GAAE,CAAC;oBAAG,MAAM,IAAE,IAAE;oBAAE,IAAI,IAAE;oBAAI,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,0BAA0B,EAAC,KAAG,OAAM,CAAA,IAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,0BAA0B,EAAC,EAAC,GAAG,CAAC,MAAI,IAAI,CAAC,OAAO,IAAG,CAAA,IAAE,CAAA,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,GAAE,GAAE,IAAG,IAAI,CAAC,OAAO,IAAG,CAAA,IAAE,CAAA;gBAAE;gBAAC,KAAG,EAAE,MAAM,EAAC,IAAE,EAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,EAAC,EAAE,MAAM,GAAE,KAAI,EAAE,cAAc,IAAE,EAAE,cAAc,CAAC,GAAE,GAAE;YAAE;YAAC,IAAI,CAAC,OAAO,IAAE,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAC,IAAG,IAAE,IAAI;YAAK,MAAM,IAAE,EAAE,OAAO,KAAG;YAAE,IAAG,EAAE,QAAQ,IAAE,IAAI,CAAC,IAAI,CAAC,WAAS,IAAE,aAAW,IAAE,uBAAqB,EAAE,QAAQ,CAAC,MAAI,SAAO,IAAE,MAAI,cAAa,GAAE;gBAAC,MAAM,IAAE,MAAM,IAAI,CAAC,WAAW,CAAC,GAAE;gBAAG,IAAG,IAAI,OAAO,GAAG,OAAO,MAAI,IAAI,OAAO,GAAG,OAAO,IAAG,MAAM,IAAI,CAAC,IAAI,CAAC,gBAAc,IAAG,IAAI,CAAC,IAAI,CAAC,gBAAc,IAAG,IAAI,wBAAE;gBAA6C,IAAI,CAAC,IAAI,CAAC;YAAyB;QAAC;QAAC,IAAI,CAAC,IAAI,CAAC,eAAc,IAAI,CAAC,OAAO,IAAG,CAAA,MAAM,IAAI,CAAC,UAAU,CAAC,GAAE,IAAG,EAAE,QAAQ,GAAC,MAAM,IAAI,CAAC,eAAe,KAAG,MAAM,IAAI,CAAC,WAAW,EAAC;IAAE;IAAC,MAAM,UAAS;QAAC,IAAI,CAAC,KAAK,CAAC;QAAY,MAAM,IAAE,MAAM,IAAI,CAAC,WAAW;QAAG,IAAI,CAAC,IAAI,CAAC,mBAAiB,AAAC,CAAA,MAAI,CAAA,EAAG,QAAQ,CAAC;QAAK,MAAM,IAAE,KAAG,KAAG;QAAI,IAAI,CAAC,IAAI,CAAC,aAAW,AAAC,CAAA,KAAG,IAAE,GAAE,EAAG,QAAQ,CAAC,MAAI,EAAE,QAAQ,CAAC,MAAK,IAAI,CAAC,IAAI,CAAC,0BAAwB,IAAI,CAAC,oBAAoB,CAAC,EAAE;IAAC;IAAC,MAAM,eAAc;QAAC,IAAI,CAAC,KAAK,CAAC;QAAY,MAAM,IAAE,MAAM,IAAI,CAAC,WAAW,MAAI,KAAG;QAAI,OAAO,IAAI,CAAC,wBAAwB,CAAC,EAAE;IAAA;IAAC,MAAM,YAAW;QAAC,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,IAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAK,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAAE;IAAC,MAAM,YAAW;QAAC,IAAG,IAAI,CAAC,OAAO,EAAC;YAAC,IAAG,aAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,MAAM,IAAI,wBAAE;YAAyD,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAC,KAAK,GAAE,KAAK,GAAE,CAAC;QAAE,OAAM,MAAM,IAAI,CAAC,UAAU,CAAC,GAAE,IAAG,MAAM,IAAI,CAAC,WAAW,CAAC,CAAC;IAAE;AAAC;AAAC,MAAM;IAAG,aAAa,CAAC,EAAC,CAAC,EAAC;QAAC,OAAO;IAAC;AAAC;AAAC,IAAI,2BAAG,YAAW,2BAAG,g9IAA+8I,2BAAG,YAAW,2BAAG,oNAAmN,2BAAG;AAAW,MAAM,iCAAW;IAAG,aAAa;QAAC,KAAK,IAAI,YAAW,IAAI,CAAC,SAAS,GAAC,SAAQ,IAAI,CAAC,aAAa,GAAC,GAAE,IAAI,CAAC,iBAAiB,GAAC,YAAW,IAAI,CAAC,kBAAkB,GAAC,YAAW,IAAI,CAAC,eAAe,GAAC,YAAW,IAAI,CAAC,gBAAgB,GAAC,SAAQ,IAAI,CAAC,kBAAkB,GAAC,YAAW,IAAI,CAAC,gBAAgB,GAAC,GAAE,IAAI,CAAC,WAAW,GAAC;YAAC,OAAM;YAAE,OAAM;YAAG,OAAM;YAAG,OAAM;YAAG,QAAO;QAAE,GAAE,IAAI,CAAC,gBAAgB,GAAC,MAAK,IAAI,CAAC,uBAAuB,GAAC,MAAK,IAAI,CAAC,YAAY,GAAC,YAAW,IAAI,CAAC,YAAY,GAAC,IAAG,IAAI,CAAC,aAAa,GAAC,IAAG,IAAI,CAAC,aAAa,GAAC,IAAG,IAAI,CAAC,WAAW,GAAC,KAAI,IAAI,CAAC,kBAAkB,GAAC,IAAG,IAAI,CAAC,kBAAkB,GAAC,IAAG,IAAI,CAAC,UAAU,GAAC,0BAAG,IAAI,CAAC,KAAK,GAAC,0BAAG,IAAI,CAAC,UAAU,GAAC,0BAAG,IAAI,CAAC,QAAQ,GAAC,0BAAG,IAAI,CAAC,QAAQ,GAAC;IAAE;IAAC,MAAM,UAAU,CAAC,EAAC,CAAC,EAAC;QAAC,MAAM,IAAE,IAAI,CAAC,iBAAiB,GAAC,IAAE;QAAE,OAAO,EAAE,KAAK,CAAC,gBAAc,IAAG,MAAM,EAAE,OAAO,CAAC;IAAE;IAAC,MAAM,cAAc,CAAC,EAAC;QAAC,MAAM,IAAE,MAAM,IAAI,CAAC,SAAS,CAAC,GAAE;QAAG,IAAI,IAAE,KAAG,IAAE;QAAE,OAAO,KAAG,AAAC,CAAA,KAAG,IAAE,CAAA,KAAI,GAAE;IAAC;IAAC,MAAM,gBAAgB,CAAC,EAAC;QAAC,MAAM,IAAE,MAAM,IAAI,CAAC,SAAS,CAAC,GAAE,IAAG,IAAE,MAAM,IAAI,CAAC,SAAS,CAAC,GAAE,IAAG,IAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,kBAAkB,GAAC;QAAK,OAAO,KAAI,CAAA,KAAG,KAAG,CAAA,IAAG,KAAI,CAAA,KAAG,KAAG,CAAA,IAAG,KAAI,CAAA,KAAG,KAAG,CAAA,IAAG,IAAE,IAAE,IAAE;IAAC;IAAC,MAAM,mBAAmB,CAAC,EAAC;QAAC,MAAM,IAAE;YAAC;YAAe;YAAa;YAAa;YAAG;YAAc;YAAgB;SAAmB;QAAC,IAAI,IAAE;QAAG,MAAM,IAAE,MAAM,IAAI,CAAC,aAAa,CAAC,IAAG,IAAE,MAAM,IAAI,CAAC,eAAe,CAAC,IAAG,IAAE,KAAG;QAAE,OAAO,KAAI,CAAA,IAAE,MAAM,IAAI,CAAC,SAAS,CAAC,GAAE,EAAC,KAAK,CAAA,CAAC,CAAC,EAAE,GAAC,gBAAe,CAAC,CAAC,EAAE,GAAC,YAAW,GAAG,KAAI,CAAA,CAAC,CAAC,EAAE,GAAC,eAAc,GAAG,IAAE,KAAG,KAAG,KAAG,IAAE,CAAC,CAAC,EAAE,GAAC,iBAAgB,CAAC,KAAG,MAAI,KAAG,MAAI,KAAI,CAAA,KAAG,KAAI,GAAG,IAAE,gBAAc,IAAE;IAAG;IAAC,MAAM,gBAAgB,CAAC,EAAC;QAAC,MAAM,IAAE;YAAC;SAAQ,EAAC,IAAE,MAAM,IAAI,CAAC,SAAS,CAAC,GAAE;QAAG,MAAK,CAAA,IAAE,CAAA,KAAI,EAAE,IAAI,CAAC;QAAO,MAAK,CAAA,IAAE,CAAA,IAAG,EAAE,IAAI,CAAC,kBAAgB,EAAE,IAAI,CAAC;QAAc,IAAG,MAAK,CAAA,OAAK,CAAA,GAAI,MAAK,CAAA,OAAK,CAAA,IAAG,EAAE,IAAI,CAAC,aAAW,EAAE,IAAI,CAAC;QAAW,MAAM,IAAE,MAAM,IAAI,CAAC,aAAa,CAAC;QAAG,OAAK;YAAC;YAAE;YAAE;YAAE;SAAE,CAAC,OAAO,CAAC,MAAI,EAAE,IAAI,CAAC,oBAAmB,MAAI,KAAG,EAAE,IAAI,CAAC;QAAmB,MAAK,CAAA,MAAM,IAAI,CAAC,SAAS,CAAC,GAAE,MAAI,IAAE,EAAC,KAAI,EAAE,IAAI,CAAC;QAA8B,MAAK,CAAA,KAAG,KAAG,CAAA,KAAI,EAAE,IAAI,CAAC;QAA4B,MAAM,IAAE,IAAE,MAAM,IAAI,CAAC,SAAS,CAAC,GAAE;QAAG,OAAO,EAAE,IAAI,CAAC,oBAAkB;YAAC;YAAO;YAAM;YAAuB;SAAU,CAAC,EAAE,GAAE;IAAC;IAAC,MAAM,eAAe,CAAC,EAAC;QAAC,MAAM,IAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,IAAE,IAAI,CAAC,gBAAgB,EAAC,IAAE,EAAE,SAAS,CAAC,QAAQ,GAAC,IAAE,MAAI,IAAI,CAAC,gBAAgB;QAAC,IAAI;QAAE,OAAO,IAAE,IAAE,KAAG,KAAG,IAAG,KAAK,GAAG,CAAC,IAAE,KAAG,KAAG,EAAE,IAAI,CAAC,wCAAuC;IAAC;IAAC,KAAK,CAAC,EAAC;QAAC,MAAM,IAAE,AAAC,CAAA,CAAC,CAAA,EAAG,QAAQ,CAAC;QAAI,OAAO,MAAI,EAAE,MAAM,GAAC,MAAI,IAAE;IAAC;IAAC,MAAM,QAAQ,CAAC,EAAC;QAAC,IAAI,IAAE,MAAM,IAAI,CAAC,SAAS,CAAC,GAAE;QAAG,OAAK;QAAE,IAAI,IAAE,MAAM,IAAI,CAAC,SAAS,CAAC,GAAE;QAAG,OAAK;QAAE,MAAM,IAAE,IAAI,WAAW;QAAG,OAAO,CAAC,CAAC,EAAE,GAAC,KAAG,IAAE,KAAI,CAAC,CAAC,EAAE,GAAC,MAAI,GAAE,CAAC,CAAC,EAAE,GAAC,KAAG,KAAG,KAAI,CAAC,CAAC,EAAE,GAAC,KAAG,KAAG,KAAI,CAAC,CAAC,EAAE,GAAC,KAAG,IAAE,KAAI,CAAC,CAAC,EAAE,GAAC,MAAI,GAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;IAAC;AAAC;AAAC,IAAI,2BAAG,OAAO,MAAM,CAAC;IAAC,WAAU;IAAK,UAAS;AAAE,IAAG,2BAAG,YAAW,2BAAG,44JAA24J,2BAAG,YAAW,2BAAG,4NAA2N,2BAAG;AAAW,MAAM,iCAAW;IAAG,aAAa;QAAC,KAAK,IAAI,YAAW,IAAI,CAAC,SAAS,GAAC,YAAW,IAAI,CAAC,aAAa,GAAC,GAAE,IAAI,CAAC,UAAU,GAAC,YAAW,IAAI,CAAC,aAAa,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,eAAe,GAAC,YAAW,IAAI,CAAC,gBAAgB,GAAC,SAAQ,IAAI,CAAC,kBAAkB,GAAC,YAAW,IAAI,CAAC,gBAAgB,GAAC,MAAK,IAAI,CAAC,uBAAuB,GAAC,GAAE,IAAI,CAAC,WAAW,GAAC;YAAC,OAAM;YAAE,OAAM;YAAG,OAAM;YAAG,OAAM;YAAG,QAAO;QAAE,GAAE,IAAI,CAAC,YAAY,GAAC,YAAW,IAAI,CAAC,YAAY,GAAC,IAAG,IAAI,CAAC,aAAa,GAAC,IAAG,IAAI,CAAC,aAAa,GAAC,IAAG,IAAI,CAAC,kBAAkB,GAAC,IAAG,IAAI,CAAC,kBAAkB,GAAC,IAAG,IAAI,CAAC,WAAW,GAAC,IAAG,IAAI,CAAC,UAAU,GAAC,0BAAG,IAAI,CAAC,KAAK,GAAC,0BAAG,IAAI,CAAC,UAAU,GAAC,0BAAG,IAAI,CAAC,QAAQ,GAAC,0BAAG,IAAI,CAAC,QAAQ,GAAC;IAAE;IAAC,MAAM,cAAc,CAAC,EAAC;QAAC,MAAM,IAAE,IAAI,CAAC,UAAU,GAAC,KAAG;QAAG,OAAO,MAAM,EAAE,OAAO,CAAC,MAAI,KAAG;IAAC;IAAC,MAAM,gBAAgB,CAAC,EAAC;QAAC,MAAM,IAAE,IAAI,CAAC,UAAU,GAAC,KAAG;QAAG,OAAM,AAAC,CAAA,MAAM,EAAE,OAAO,CAAC,KAAG,OAAI,KAAI;IAAE;IAAC,MAAM,mBAAmB,CAAC,EAAC;QAAC,IAAI;QAAE,IAAE,MAAI,MAAM,IAAI,CAAC,aAAa,CAAC,KAAG,aAAW;QAAmB,OAAO,KAAG,gBAAc,MAAM,IAAI,CAAC,eAAe,CAAC,KAAG,KAAI;IAAC;IAAC,MAAM,YAAY,CAAC,EAAC;QAAC,MAAM,IAAE,IAAI,CAAC,UAAU,GAAC,KAAG;QAAG,OAAO,MAAM,EAAE,OAAO,CAAC,MAAI,KAAG;IAAC;IAAC,MAAM,eAAe,CAAC,EAAC;QAAC,MAAM,IAAE,IAAI,CAAC,UAAU,GAAC,KAAG;QAAG,OAAM,CAAA;YAAC,GAAE;YAAM,GAAE;YAAK,GAAE;YAAK,GAAE;YAAK,GAAE;QAAM,CAAA,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,MAAI,IAAE,EAAE,IAAE;IAAE;IAAC,MAAM,gBAAgB,CAAC,EAAC;QAAC,MAAM,IAAE;YAAC;YAAQ;SAAM,EAAC,IAAE,MAAM,IAAI,CAAC,WAAW,CAAC,IAAG,IAAE,MAAM,IAAI,CAAC,cAAc,CAAC,IAAG,IAAE;YAAC,GAAE;YAAK,GAAE;YAAqB,GAAE;YAAqB,GAAE;YAAqB,GAAE;QAAoB,CAAC,CAAC,EAAE,EAAC,IAAE,KAAK,MAAI,IAAE,IAAE;QAAyB,OAAO,SAAO,KAAG,EAAE,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,GAAE;IAAC;IAAC,MAAM,eAAe,CAAC,EAAC;QAAC,OAAO;IAAE;IAAC,KAAK,CAAC,EAAC;QAAC,MAAM,IAAE,AAAC,CAAA,CAAC,CAAA,EAAG,QAAQ,CAAC;QAAI,OAAO,MAAI,EAAE,MAAM,GAAC,MAAI,IAAE;IAAC;IAAC,MAAM,QAAQ,CAAC,EAAC;QAAC,IAAI,IAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa;QAAE,OAAK;QAAE,IAAI,IAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa,GAAC;QAAG,IAAE,MAAI,IAAE;QAAM,MAAM,IAAE,IAAI,WAAW;QAAG,OAAO,CAAC,CAAC,EAAE,GAAC,KAAG,IAAE,KAAI,CAAC,CAAC,EAAE,GAAC,MAAI,GAAE,CAAC,CAAC,EAAE,GAAC,KAAG,KAAG,KAAI,CAAC,CAAC,EAAE,GAAC,KAAG,KAAG,KAAI,CAAC,CAAC,EAAE,GAAC,KAAG,IAAE,KAAI,CAAC,CAAC,EAAE,GAAC,MAAI,GAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;IAAC;IAAC,aAAa,CAAC,EAAC,CAAC,EAAC;QAAC,OAAO;IAAC;AAAC;AAAC,IAAI,2BAAG,OAAO,MAAM,CAAC;IAAC,WAAU;IAAK,YAAW;AAAE,IAAG,2BAAG,YAAW,2BAAG,g6IAA+5I,2BAAG,YAAW,2BAAG,4NAA2N,2BAAG;AAAW,IAAI,2BAAG,OAAO,MAAM,CAAC;IAAC,WAAU;IAAK,YAAW,cAAc;QAAG,aAAa;YAAC,KAAK,IAAI,YAAW,IAAI,CAAC,SAAS,GAAC,YAAW,IAAI,CAAC,aAAa,GAAC,IAAG,IAAI,CAAC,UAAU,GAAC,YAAW,IAAI,CAAC,aAAa,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,eAAe,GAAC,YAAW,IAAI,CAAC,gBAAgB,GAAC,SAAQ,IAAI,CAAC,kBAAkB,GAAC,YAAW,IAAI,CAAC,gBAAgB,GAAC,GAAE,IAAI,CAAC,gBAAgB,GAAC,MAAK,IAAI,CAAC,uBAAuB,GAAC,GAAE,IAAI,CAAC,WAAW,GAAC;gBAAC,OAAM;gBAAE,OAAM;gBAAG,OAAM;gBAAG,OAAM;gBAAG,QAAO;YAAE,GAAE,IAAI,CAAC,YAAY,GAAC,YAAW,IAAI,CAAC,YAAY,GAAC,IAAG,IAAI,CAAC,aAAa,GAAC,IAAG,IAAI,CAAC,aAAa,GAAC,IAAG,IAAI,CAAC,kBAAkB,GAAC,IAAG,IAAI,CAAC,kBAAkB,GAAC,IAAG,IAAI,CAAC,WAAW,GAAC,IAAG,IAAI,CAAC,UAAU,GAAC,0BAAG,IAAI,CAAC,KAAK,GAAC,0BAAG,IAAI,CAAC,UAAU,GAAC,0BAAG,IAAI,CAAC,QAAQ,GAAC,0BAAG,IAAI,CAAC,QAAQ,GAAC;QAAE;QAAC,MAAM,cAAc,CAAC,EAAC;YAAC,MAAM,IAAE,IAAI,CAAC,UAAU,GAAC,KAAG;YAAE,OAAO,MAAM,EAAE,OAAO,CAAC,MAAI,KAAG;QAAC;QAAC,MAAM,gBAAgB,CAAC,EAAC;YAAC,MAAM,IAAE,IAAI,CAAC,UAAU,GAAC,KAAG;YAAE,OAAM,AAAC,CAAA,MAAM,EAAE,OAAO,CAAC,KAAG,OAAI,KAAI;QAAE;QAAC,MAAM,mBAAmB,CAAC,EAAC;YAAC,IAAI;YAAE,MAAM,IAAE,MAAM,IAAI,CAAC,aAAa,CAAC;YAAG,IAAE,MAAI,KAAG,MAAI,IAAE,aAAW;YAAmB,OAAO,KAAG,gBAAc,MAAM,IAAI,CAAC,eAAe,CAAC,KAAG,KAAI;QAAC;QAAC,MAAM,gBAAgB,CAAC,EAAC;YAAC,OAAM;gBAAC;gBAAQ;aAAM;QAAA;QAAC,MAAM,eAAe,CAAC,EAAC;YAAC,MAAM,IAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,IAAE,IAAI,CAAC,gBAAgB,EAAC,IAAE,EAAE,SAAS,CAAC,QAAQ,GAAC,IAAE,MAAI,IAAI,CAAC,gBAAgB;YAAC,IAAI;YAAE,OAAO,IAAE,IAAE,KAAG,KAAG,IAAG,KAAK,GAAG,CAAC,IAAE,KAAG,KAAG,EAAE,IAAI,CAAC,wCAAuC;QAAC;QAAC,MAAM,eAAe,CAAC,EAAC;YAAC,OAAK,MAAM,IAAI,CAAC,cAAc,CAAC,MAAI,EAAE,UAAU;QAAE;QAAC,KAAK,CAAC,EAAC;YAAC,MAAM,IAAE,AAAC,CAAA,CAAC,CAAA,EAAG,QAAQ,CAAC;YAAI,OAAO,MAAI,EAAE,MAAM,GAAC,MAAI,IAAE;QAAC;QAAC,MAAM,QAAQ,CAAC,EAAC;YAAC,IAAI,IAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa;YAAE,OAAK;YAAE,IAAI,IAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa,GAAC;YAAG,IAAE,MAAI,IAAE;YAAM,MAAM,IAAE,IAAI,WAAW;YAAG,OAAO,CAAC,CAAC,EAAE,GAAC,KAAG,IAAE,KAAI,CAAC,CAAC,EAAE,GAAC,MAAI,GAAE,CAAC,CAAC,EAAE,GAAC,KAAG,KAAG,KAAI,CAAC,CAAC,EAAE,GAAC,KAAG,KAAG,KAAI,CAAC,CAAC,EAAE,GAAC,KAAG,IAAE,KAAI,CAAC,CAAC,EAAE,GAAC,MAAI,GAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;QAAC;QAAC,aAAa,CAAC,EAAC,CAAC,EAAC;YAAC,OAAO;QAAC;IAAC;AAAC,IAAG,2BAAG,YAAW,2BAAG,o0JAAm0J,2BAAG,YAAW,2BAAG,4NAA2N,2BAAG;AAAW,MAAM,iCAAW;IAAG,aAAa;QAAC,KAAK,IAAI,YAAW,IAAI,CAAC,SAAS,GAAC,YAAW,IAAI,CAAC,aAAa,GAAC,IAAG,IAAI,CAAC,UAAU,GAAC,YAAW,IAAI,CAAC,aAAa,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,eAAe,GAAC,YAAW,IAAI,CAAC,gBAAgB,GAAC,SAAQ,IAAI,CAAC,kBAAkB,GAAC,YAAW,IAAI,CAAC,gBAAgB,GAAC,MAAK,IAAI,CAAC,uBAAuB,GAAC,GAAE,IAAI,CAAC,WAAW,GAAC;YAAC,OAAM;YAAE,OAAM;YAAG,OAAM;YAAG,OAAM;YAAG,QAAO;QAAE,GAAE,IAAI,CAAC,YAAY,GAAC,YAAW,IAAI,CAAC,YAAY,GAAC,IAAG,IAAI,CAAC,aAAa,GAAC,IAAG,IAAI,CAAC,aAAa,GAAC,IAAG,IAAI,CAAC,kBAAkB,GAAC,IAAG,IAAI,CAAC,kBAAkB,GAAC,IAAG,IAAI,CAAC,WAAW,GAAC,IAAG,IAAI,CAAC,UAAU,GAAC,0BAAG,IAAI,CAAC,KAAK,GAAC,0BAAG,IAAI,CAAC,UAAU,GAAC,0BAAG,IAAI,CAAC,QAAQ,GAAC,0BAAG,IAAI,CAAC,QAAQ,GAAC;IAAE;IAAC,MAAM,cAAc,CAAC,EAAC;QAAC,MAAM,IAAE,IAAI,CAAC,UAAU,GAAC,KAAG;QAAG,OAAO,MAAM,EAAE,OAAO,CAAC,MAAI,KAAG;IAAC;IAAC,MAAM,gBAAgB,CAAC,EAAC;QAAC,MAAM,IAAE,IAAI,CAAC,UAAU,GAAC,KAAG;QAAG,OAAM,AAAC,CAAA,MAAM,EAAE,OAAO,CAAC,KAAG,OAAI,KAAI;IAAE;IAAC,MAAM,mBAAmB,CAAC,EAAC;QAAC,IAAI;QAAE,IAAE,MAAI,MAAM,IAAI,CAAC,aAAa,CAAC,KAAG,aAAW;QAAmB,OAAO,KAAG,gBAAc,MAAM,IAAI,CAAC,eAAe,CAAC,KAAG,KAAI;IAAC;IAAC,MAAM,gBAAgB,CAAC,EAAC;QAAC,OAAM;YAAC;YAAU;YAAO;SAAe;IAAA;IAAC,MAAM,eAAe,CAAC,EAAC;QAAC,OAAO;IAAE;IAAC,KAAK,CAAC,EAAC;QAAC,MAAM,IAAE,AAAC,CAAA,CAAC,CAAA,EAAG,QAAQ,CAAC;QAAI,OAAO,MAAI,EAAE,MAAM,GAAC,MAAI,IAAE;IAAC;IAAC,MAAM,QAAQ,CAAC,EAAC;QAAC,IAAI,IAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa;QAAE,OAAK;QAAE,IAAI,IAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa,GAAC;QAAG,IAAE,MAAI,IAAE;QAAM,MAAM,IAAE,IAAI,WAAW;QAAG,OAAO,CAAC,CAAC,EAAE,GAAC,KAAG,IAAE,KAAI,CAAC,CAAC,EAAE,GAAC,MAAI,GAAE,CAAC,CAAC,EAAE,GAAC,KAAG,KAAG,KAAI,CAAC,CAAC,EAAE,GAAC,KAAG,KAAG,KAAI,CAAC,CAAC,EAAE,GAAC,KAAG,IAAE,KAAI,CAAC,CAAC,EAAE,GAAC,MAAI,GAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;IAAC;IAAC,aAAa,CAAC,EAAC,CAAC,EAAC;QAAC,OAAO;IAAC;AAAC;AAAC,IAAI,2BAAG,OAAO,MAAM,CAAC;IAAC,WAAU;IAAK,YAAW;AAAE,IAAG,2BAAG,YAAW,2BAAG,g8JAA+7J,2BAAG,YAAW,2BAAG,4NAA2N,2BAAG;AAAW,IAAI,2BAAG,OAAO,MAAM,CAAC;IAAC,WAAU;IAAK,YAAW,cAAc;QAAG,aAAa;YAAC,KAAK,IAAI,YAAW,IAAI,CAAC,SAAS,GAAC,YAAW,IAAI,CAAC,aAAa,GAAC,IAAG,IAAI,CAAC,UAAU,GAAC,YAAW,IAAI,CAAC,iBAAiB,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,aAAa,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,eAAe,GAAC,YAAW,IAAI,CAAC,UAAU,GAAC,0BAAG,IAAI,CAAC,KAAK,GAAC,0BAAG,IAAI,CAAC,UAAU,GAAC,0BAAG,IAAI,CAAC,QAAQ,GAAC,0BAAG,IAAI,CAAC,QAAQ,GAAC,0BAAG,IAAI,CAAC,iBAAiB,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,sBAAsB,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,wBAAwB,GAAC,IAAG,IAAI,CAAC,sBAAsB,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,wBAAwB,GAAC,IAAG,IAAI,CAAC,sBAAsB,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,wBAAwB,GAAC,GAAE,IAAI,CAAC,sBAAsB,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,wBAAwB,GAAC,GAAE,IAAI,CAAC,sBAAsB,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,wBAAwB,GAAC,GAAE,IAAI,CAAC,sBAAsB,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,wBAAwB,GAAC,IAAG,IAAI,CAAC,qCAAqC,GAAC,IAAI,CAAC,iBAAiB,EAAC,IAAI,CAAC,iCAAiC,GAAC,SAAM,IAAI,CAAC,4BAA4B,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,6BAA6B,GAAC,SAAM,IAAI,CAAC,wBAAwB,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,yBAAyB,GAAC,SAAM,IAAI,CAAC,cAAc,GAAC,YAAW,IAAI,CAAC,YAAY,GAAC,YAAW,IAAI,CAAC,cAAc,GAAC,YAAW,IAAI,CAAC,YAAY,GAAC,YAAW,IAAI,CAAC,mBAAmB,GAAC,YAAW,IAAI,CAAC,sBAAsB,GAAC,YAAQ,IAAI,CAAC,sBAAsB,GAAC,IAAG,IAAI,CAAC,gBAAgB,GAAC,GAAE,IAAI,CAAC,cAAc,GAAC,YAAW,IAAI,CAAC,uBAAuB,GAAC;gBAAC;aAAU,EAAC,IAAI,CAAC,eAAe,GAAC;gBAAC,OAAM;gBAAG,OAAM;gBAAE,OAAM;YAAC,GAAE,IAAI,CAAC,UAAU,GAAC;gBAAC;oBAAC;oBAAE;oBAAM;iBAAU;gBAAC;oBAAC;oBAAW;oBAAW;iBAAO;gBAAC;oBAAC;oBAAW;oBAAW;iBAAO;gBAAC;oBAAC;oBAAW;oBAAW;iBAAkB;gBAAC;oBAAC;oBAAW;oBAAW;iBAAY;gBAAC;oBAAC;oBAAW;oBAAW;iBAAY;gBAAC;oBAAC;oBAAW;oBAAW;iBAAO;gBAAC;oBAAC;oBAAW;oBAAW;iBAAO;gBAAC;oBAAC;oBAAW;oBAAW;iBAAW;gBAAC;oBAAC;oBAAW;oBAAW;iBAAW;gBAAC;oBAAC;oBAAW;oBAAW;iBAAgB;aAAC,EAAC,IAAI,CAAC,aAAa,GAAC,YAAW,IAAI,CAAC,aAAa,GAAC,GAAE,IAAI,CAAC,YAAY,GAAC;gBAAC,GAAE;gBAAa,GAAE;gBAAY,GAAE;gBAAoB,GAAE;gBAAoB,GAAE;gBAAkB,GAAE;gBAAgB,GAAE;gBAAiB,GAAE;gBAA8B,GAAE;gBAAU,GAAE;gBAAsB,IAAG;gBAAsB,IAAG;gBAAsB,IAAG;YAAa;QAAC;QAAC,MAAM,cAAc,CAAC,EAAC;YAAC,OAAO,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,iBAAiB,GAAC,MAAI,KAAG;QAAC;QAAC,MAAM,oBAAoB,CAAC,EAAC;YAAC,OAAO,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,iBAAiB,GAAC,MAAI,IAAE;QAAE;QAAC,MAAM,oBAAoB,CAAC,EAAC;YAAC,OAAO,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,iBAAiB,GAAC,MAAI,IAAE;QAAC;QAAC,MAAM,mBAAmB,CAAC,EAAC;YAAC,IAAI;YAAE,IAAE,MAAI,MAAM,IAAI,CAAC,aAAa,CAAC,KAAG,aAAW;YAAmB,OAAM,CAAC,EAAE,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;QAAA;QAAC,MAAM,eAAe,CAAC,EAAC;YAAC,MAAM,IAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,IAAE,IAAI,CAAC,gBAAgB,EAAC,IAAE,EAAE,SAAS,CAAC,QAAQ,GAAC,IAAE,MAAI,IAAI,CAAC,gBAAgB;YAAC,IAAI;YAAE,OAAO,IAAE,IAAE,KAAG,KAAG,IAAE,KAAG,KAAG,IAAG,KAAK,GAAG,CAAC,IAAE,KAAG,KAAG,EAAE,IAAI,CAAC,wCAAuC;QAAC;QAAC,MAAM,wBAAwB,CAAC,EAAC;YAAC,OAAM,AAAC,CAAA,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,mBAAmB,IAAE,IAAI,CAAC,sBAAsB,AAAD,KAAI,IAAI,CAAC,sBAAsB;QAAA;IAAC;AAAC,IAAG,2BAAG,YAAW,2BAAG,40JAA20J,2BAAG,YAAW,2BAAG,4NAA2N,2BAAG;AAAW,IAAI,2BAAG,OAAO,MAAM,CAAC;IAAC,WAAU;IAAK,YAAW,cAAc;QAAG,aAAa;YAAC,KAAK,IAAI,YAAW,IAAI,CAAC,SAAS,GAAC,YAAW,IAAI,CAAC,aAAa,GAAC,IAAG,IAAI,CAAC,UAAU,GAAC,YAAW,IAAI,CAAC,aAAa,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,eAAe,GAAC,YAAW,IAAI,CAAC,gBAAgB,GAAC,SAAQ,IAAI,CAAC,kBAAkB,GAAC,YAAW,IAAI,CAAC,gBAAgB,GAAC,MAAK,IAAI,CAAC,uBAAuB,GAAC,GAAE,IAAI,CAAC,WAAW,GAAC;gBAAC,OAAM;gBAAE,OAAM;gBAAG,OAAM;gBAAG,OAAM;gBAAG,QAAO;YAAE,GAAE,IAAI,CAAC,YAAY,GAAC,YAAW,IAAI,CAAC,YAAY,GAAC,IAAG,IAAI,CAAC,aAAa,GAAC,IAAG,IAAI,CAAC,aAAa,GAAC,IAAG,IAAI,CAAC,kBAAkB,GAAC,IAAG,IAAI,CAAC,kBAAkB,GAAC,IAAG,IAAI,CAAC,WAAW,GAAC,IAAG,IAAI,CAAC,aAAa,GAAC,MAAK,IAAI,CAAC,kBAAkB,GAAC,GAAE,IAAI,CAAC,cAAc,GAAC,YAAW,IAAI,CAAC,UAAU,GAAC,0BAAG,IAAI,CAAC,KAAK,GAAC,0BAAG,IAAI,CAAC,UAAU,GAAC,0BAAG,IAAI,CAAC,QAAQ,GAAC,0BAAG,IAAI,CAAC,QAAQ,GAAC;QAAE;QAAC,MAAM,mBAAmB,CAAC,EAAC;YAAC,OAAO,IAAI,CAAC,SAAS;QAAA;QAAC,MAAM,gBAAgB,CAAC,EAAC;YAAC,OAAM;gBAAC;gBAAM;aAAe;QAAA;QAAC,MAAM,eAAe,CAAC,EAAC;YAAC,OAAO;QAAE;QAAC,KAAK,CAAC,EAAC;YAAC,MAAM,IAAE,AAAC,CAAA,CAAC,CAAA,EAAG,QAAQ,CAAC;YAAI,OAAO,MAAI,EAAE,MAAM,GAAC,MAAI,IAAE;QAAC;QAAC,MAAM,YAAY,CAAC,EAAC;YAAC,MAAM,IAAE,MAAI,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,cAAc;YAAE,EAAE,KAAK,CAAC,sBAAoB,IAAG,KAAG,IAAI,CAAC,kBAAkB,IAAG,CAAA,EAAE,aAAa,GAAC,IAAI,CAAC,aAAa,AAAD;QAAE;QAAC,MAAM,QAAQ,CAAC,EAAC;YAAC,IAAI,IAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa;YAAE,OAAK;YAAE,IAAI,IAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa,GAAC;YAAG,IAAE,MAAI,IAAE;YAAM,MAAM,IAAE,IAAI,WAAW;YAAG,OAAO,CAAC,CAAC,EAAE,GAAC,KAAG,IAAE,KAAI,CAAC,CAAC,EAAE,GAAC,MAAI,GAAE,CAAC,CAAC,EAAE,GAAC,KAAG,KAAG,KAAI,CAAC,CAAC,EAAE,GAAC,KAAG,KAAG,KAAI,CAAC,CAAC,EAAE,GAAC,KAAG,IAAE,KAAI,CAAC,CAAC,EAAE,GAAC,MAAI,GAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;QAAC;QAAC,aAAa,CAAC,EAAC,CAAC,EAAC;YAAC,OAAO;QAAC;IAAC;AAAC,IAAG,2BAAG,YAAW,2BAAG,onNAAmnN,2BAAG,YAAW,2BAAG,oVAAmV,2BAAG;AAAW,IAAI,2BAAG,OAAO,MAAM,CAAC;IAAC,WAAU;IAAK,YAAW,cAAc;QAAG,aAAa;YAAC,KAAK,IAAI,YAAW,IAAI,CAAC,SAAS,GAAC,YAAW,IAAI,CAAC,aAAa,GAAC,GAAE,IAAI,CAAC,UAAU,GAAC,YAAW,IAAI,CAAC,aAAa,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,eAAe,GAAC,YAAW,IAAI,CAAC,gBAAgB,GAAC,SAAQ,IAAI,CAAC,kBAAkB,GAAC,YAAW,IAAI,CAAC,gBAAgB,GAAC,MAAK,IAAI,CAAC,uBAAuB,GAAC,GAAE,IAAI,CAAC,WAAW,GAAC;gBAAC,OAAM;gBAAE,OAAM;gBAAG,OAAM;gBAAG,OAAM;gBAAG,QAAO;YAAE,GAAE,IAAI,CAAC,YAAY,GAAC,YAAW,IAAI,CAAC,YAAY,GAAC,IAAG,IAAI,CAAC,aAAa,GAAC,IAAG,IAAI,CAAC,aAAa,GAAC,IAAG,IAAI,CAAC,kBAAkB,GAAC,IAAG,IAAI,CAAC,kBAAkB,GAAC,IAAG,IAAI,CAAC,WAAW,GAAC,IAAG,IAAI,CAAC,aAAa,GAAC,MAAK,IAAI,CAAC,kBAAkB,GAAC,GAAE,IAAI,CAAC,cAAc,GAAC,YAAW,IAAI,CAAC,UAAU,GAAC,0BAAG,IAAI,CAAC,KAAK,GAAC,0BAAG,IAAI,CAAC,UAAU,GAAC,0BAAG,IAAI,CAAC,QAAQ,GAAC,0BAAG,IAAI,CAAC,QAAQ,GAAC;QAAE;QAAC,MAAM,mBAAmB,CAAC,EAAC;YAAC,OAAM;QAAU;QAAC,MAAM,YAAY,CAAC,EAAC;YAAC,MAAM,IAAE,IAAI,CAAC,UAAU,GAAC,KAAG;YAAG,OAAO,MAAM,EAAE,OAAO,CAAC,MAAI,KAAG;QAAC;QAAC,MAAM,eAAe,CAAC,EAAC;YAAC,MAAM,IAAE,IAAI,CAAC,UAAU,GAAC,KAAG;YAAG,OAAM,CAAA;gBAAC,GAAE;gBAAM,GAAE;gBAAK,GAAE;gBAAK,GAAE;gBAAK,GAAE;YAAI,CAAA,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,MAAI,IAAE,EAAE,IAAE;QAAE;QAAC,MAAM,YAAY,CAAC,EAAC;YAAC,MAAM,IAAE,IAAI,CAAC,UAAU,GAAC,KAAG;YAAG,OAAO,MAAM,EAAE,OAAO,CAAC,MAAI,IAAE;QAAC;QAAC,MAAM,eAAe,CAAC,EAAC;YAAC,MAAM,IAAE,IAAI,CAAC,UAAU,GAAC,KAAG;YAAG,OAAM,CAAA;gBAAC,GAAE;gBAAS,GAAE;YAAQ,CAAA,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,MAAI,IAAE,EAAE,IAAE;QAAE;QAAC,MAAM,gBAAgB,CAAC,EAAC;YAAC,MAAM,IAAE;gBAAC;gBAAQ;aAAM,EAAC,IAAE,MAAM,IAAI,CAAC,WAAW,CAAC,IAAG,IAAE,MAAM,IAAI,CAAC,cAAc,CAAC,IAAG,IAAE;gBAAC,GAAE;gBAAK,GAAE;gBAAqB,GAAE;YAAoB,CAAC,CAAC,EAAE,EAAC,IAAE,KAAK,MAAI,IAAE,IAAE;YAAyB,SAAO,KAAG,EAAE,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;YAAE,MAAM,IAAE,MAAM,IAAI,CAAC,WAAW,CAAC,IAAG,IAAE,MAAM,IAAI,CAAC,cAAc,CAAC,IAAG,IAAE;gBAAC,GAAE;gBAAK,GAAE;gBAAqB,GAAE;YAAoB,CAAC,CAAC,EAAE,EAAC,IAAE,KAAK,MAAI,IAAE,IAAE;YAAyB,OAAO,SAAO,KAAG,EAAE,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,GAAE;QAAC;QAAC,MAAM,eAAe,CAAC,EAAC;YAAC,OAAO;QAAE;QAAC,KAAK,CAAC,EAAC;YAAC,MAAM,IAAE,AAAC,CAAA,CAAC,CAAA,EAAG,QAAQ,CAAC;YAAI,OAAO,MAAI,EAAE,MAAM,GAAC,MAAI,IAAE;QAAC;QAAC,MAAM,YAAY,CAAC,EAAC;YAAC,MAAM,IAAE,MAAI,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,cAAc;YAAE,EAAE,KAAK,CAAC,sBAAoB,IAAG,KAAG,IAAI,CAAC,kBAAkB,IAAG,CAAA,EAAE,aAAa,GAAC,IAAI,CAAC,aAAa,AAAD;QAAE;QAAC,MAAM,QAAQ,CAAC,EAAC;YAAC,IAAI,IAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa;YAAE,OAAK;YAAE,IAAI,IAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa,GAAC;YAAG,IAAE,MAAI,IAAE;YAAM,MAAM,IAAE,IAAI,WAAW;YAAG,OAAO,CAAC,CAAC,EAAE,GAAC,KAAG,IAAE,KAAI,CAAC,CAAC,EAAE,GAAC,MAAI,GAAE,CAAC,CAAC,EAAE,GAAC,KAAG,KAAG,KAAI,CAAC,CAAC,EAAE,GAAC,KAAG,KAAG,KAAI,CAAC,CAAC,EAAE,GAAC,KAAG,IAAE,KAAI,CAAC,CAAC,EAAE,GAAC,MAAI,GAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;QAAC;QAAC,aAAa,CAAC,EAAC,CAAC,EAAC;YAAC,OAAO;QAAC;IAAC;AAAC,IAAG,2BAAG,YAAW,2BAAG,4pLAA2pL,2BAAG,YAAW,2BAAG,4NAA2N,2BAAG;AAAW,IAAI,2BAAG,OAAO,MAAM,CAAC;IAAC,WAAU;IAAK,YAAW,cAAc;QAAG,aAAa;YAAC,KAAK,IAAI,YAAW,IAAI,CAAC,SAAS,GAAC,YAAW,IAAI,CAAC,aAAa,GAAC,GAAE,IAAI,CAAC,aAAa,GAAC,YAAW,IAAI,CAAC,UAAU,GAAC,YAAW,IAAI,CAAC,eAAe,GAAC,YAAW,IAAI,CAAC,gBAAgB,GAAC,SAAQ,IAAI,CAAC,kBAAkB,GAAC,YAAW,IAAI,CAAC,gBAAgB,GAAC,MAAK,IAAI,CAAC,uBAAuB,GAAC,MAAK,IAAI,CAAC,WAAW,GAAC;gBAAC,OAAM;gBAAE,OAAM;gBAAG,OAAM;gBAAG,OAAM;gBAAG,QAAO;YAAE,GAAE,IAAI,CAAC,YAAY,GAAC,YAAW,IAAI,CAAC,YAAY,GAAC,IAAG,IAAI,CAAC,aAAa,GAAC,IAAG,IAAI,CAAC,aAAa,GAAC,IAAG,IAAI,CAAC,WAAW,GAAC,IAAG,IAAI,CAAC,kBAAkB,GAAC,IAAG,IAAI,CAAC,kBAAkB,GAAC,IAAG,IAAI,CAAC,UAAU,GAAC,0BAAG,IAAI,CAAC,KAAK,GAAC,0BAAG,IAAI,CAAC,UAAU,GAAC,0BAAG,IAAI,CAAC,QAAQ,GAAC,0BAAG,IAAI,CAAC,QAAQ,GAAC;QAAE;QAAC,MAAM,cAAc,CAAC,EAAC;YAAC,MAAM,IAAE,IAAI,CAAC,UAAU,GAAC,KAAG;YAAG,OAAO,MAAM,EAAE,OAAO,CAAC,MAAI,KAAG;QAAE;QAAC,MAAM,mBAAmB,CAAC,EAAC;YAAC,MAAM,IAAE;gBAAC;gBAAW;gBAAe;aAAe,EAAC,IAAE,MAAM,IAAI,CAAC,aAAa,CAAC;YAAG,OAAO,KAAG,KAAG,KAAG,IAAE,CAAC,CAAC,EAAE,GAAC;QAAkB;QAAC,MAAM,YAAY,CAAC,EAAC;YAAC,MAAM,IAAE,IAAI,CAAC,UAAU,GAAC,KAAG;YAAG,OAAO,MAAM,EAAE,OAAO,CAAC,MAAI,KAAG;QAAE;QAAC,MAAM,YAAY,CAAC,EAAC;YAAC,MAAM,IAAE,IAAI,CAAC,UAAU,GAAC,KAAG;YAAG,OAAO,MAAM,EAAE,OAAO,CAAC,MAAI,KAAG;QAAE;QAAC,MAAM,iBAAiB,CAAC,EAAC;YAAC,MAAM,IAAE,IAAI,CAAC,UAAU,GAAC,KAAG;YAAG,OAAO,MAAM,EAAE,OAAO,CAAC,MAAI,IAAE;QAAC;QAAC,MAAM,gBAAgB,CAAC,EAAC;YAAC,MAAM,IAAE;gBAAC;aAAQ,EAAC,IAAE;gBAAC,GAAE;gBAAoB,GAAE;gBAAqB,GAAE;YAAoB,CAAC,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,IAAE;YAAyB,EAAE,IAAI,CAAC;YAAG,MAAM,IAAE;gBAAC,GAAE;gBAAoB,GAAE;gBAAqB,GAAE;YAAoB,CAAC,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,IAAE;YAAyB,EAAE,IAAI,CAAC;YAAG,MAAM,IAAE;gBAAC,GAAE;gBAAkC,GAAE;gBAA6D,GAAE;YAA4D,CAAC,CAAC,MAAM,IAAI,CAAC,gBAAgB,CAAC,GAAG,IAAE;YAA8B,OAAO,EAAE,IAAI,CAAC,IAAG;QAAC;QAAC,MAAM,eAAe,CAAC,EAAC;YAAC,OAAO;QAAE;QAAC,KAAK,CAAC,EAAC;YAAC,MAAM,IAAE,AAAC,CAAA,CAAC,CAAA,EAAG,QAAQ,CAAC;YAAI,OAAO,MAAI,EAAE,MAAM,GAAC,MAAI,IAAE;QAAC;QAAC,MAAM,QAAQ,CAAC,EAAC;YAAC,IAAI,IAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa;YAAE,OAAK;YAAE,IAAI,IAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa,GAAC;YAAG,IAAE,MAAI,IAAE;YAAM,MAAM,IAAE,IAAI,WAAW;YAAG,OAAO,CAAC,CAAC,EAAE,GAAC,KAAG,IAAE,KAAI,CAAC,CAAC,EAAE,GAAC,MAAI,GAAE,CAAC,CAAC,EAAE,GAAC,KAAG,KAAG,KAAI,CAAC,CAAC,EAAE,GAAC,KAAG,KAAG,KAAI,CAAC,CAAC,EAAE,GAAC,KAAG,IAAE,KAAI,CAAC,CAAC,EAAE,GAAC,MAAI,GAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;QAAC;QAAC,aAAa,CAAC,EAAC,CAAC,EAAC;YAAC,OAAO;QAAC;IAAC;AAAC,IAAG,2BAAG,YAAW,2BAAG,ouVAAmuV,2BAAG,YAAW,2BAAG,ogCAAmgC,2BAAG;AAAW,IAAI,2BAAG,OAAO,MAAM,CAAC;IAAC,WAAU;IAAK,YAAW,cAAc;QAAG,aAAa;YAAC,KAAK,IAAI,YAAW,IAAI,CAAC,SAAS,GAAC,WAAU,IAAI,CAAC,uBAAuB,GAAC;gBAAC;aAAW,EAAC,IAAI,CAAC,iBAAiB,GAAC,YAAW,IAAI,CAAC,eAAe,GAAC,YAAW,IAAI,CAAC,gBAAgB,GAAC,SAAQ,IAAI,CAAC,gBAAgB,GAAC,GAAE,IAAI,CAAC,gBAAgB,GAAC,OAAM,IAAI,CAAC,uBAAuB,GAAC,GAAE,IAAI,CAAC,kBAAkB,GAAC,GAAE,IAAI,CAAC,WAAW,GAAC;gBAAC,SAAQ;gBAAE,SAAQ;gBAAG,OAAM;gBAAG,OAAM;gBAAG,OAAM;gBAAG,UAAS;gBAAG,UAAS;gBAAG,OAAM;gBAAI,QAAO;YAAG,GAAE,IAAI,CAAC,YAAY,GAAC,YAAW,IAAI,CAAC,YAAY,GAAC,IAAG,IAAI,CAAC,aAAa,GAAC,IAAG,IAAI,CAAC,aAAa,GAAC,IAAG,IAAI,CAAC,kBAAkB,GAAC,GAAE,IAAI,CAAC,kBAAkB,GAAC,GAAE,IAAI,CAAC,WAAW,GAAC,IAAG,IAAI,CAAC,UAAU,GAAC,0BAAG,IAAI,CAAC,KAAK,GAAC,0BAAG,IAAI,CAAC,UAAU,GAAC,0BAAG,IAAI,CAAC,QAAQ,GAAC,0BAAG,IAAI,CAAC,QAAQ,GAAC,0BAAG,IAAI,CAAC,eAAe,GAAC,OAAM;gBAAI,MAAM,IAAE;oBAAC;iBAAO;gBAAC,OAAM,aAAW,MAAM,IAAI,CAAC,kBAAkB,CAAC,MAAI,EAAE,IAAI,CAAC,mBAAkB;YAAC;QAAC;QAAC,MAAM,UAAU,CAAC,EAAC,CAAC,EAAC;YAAC,MAAM,IAAE,IAAI,CAAC,iBAAiB,GAAC,IAAE;YAAE,OAAO,EAAE,KAAK,CAAC,gBAAc,IAAG,MAAM,EAAE,OAAO,CAAC;QAAE;QAAC,MAAM,mBAAmB,CAAC,EAAC;YAAC,MAAM,IAAE,MAAM,IAAI,CAAC,SAAS,CAAC,GAAE;YAAG,OAAO,KAAI,CAAA,KAAG,MAAM,IAAI,CAAC,SAAS,CAAC,GAAE,KAAG,QAAM,CAAA,IAAG,YAAU;QAAW;QAAC,MAAM,eAAe,CAAC,EAAC;YAAC,MAAM,IAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,IAAE,IAAI,CAAC,gBAAgB,EAAC,IAAE,EAAE,SAAS,CAAC,QAAQ,GAAC,IAAE,MAAI,IAAI,CAAC,gBAAgB;YAAC,IAAI;YAAE,OAAO,IAAE,IAAE,KAAG,KAAG,IAAG,KAAK,GAAG,CAAC,IAAE,KAAG,KAAG,EAAE,IAAI,CAAC,oCAAkC,IAAE,+CAA6C,IAAE,qCAAoC;QAAC;QAAC,KAAK,CAAC,EAAC;YAAC,MAAM,IAAE,AAAC,CAAA,CAAC,CAAA,EAAG,QAAQ,CAAC;YAAI,OAAO,MAAI,EAAE,MAAM,GAAC,MAAI,IAAE;QAAC;QAAC,MAAM,QAAQ,CAAC,EAAC;YAAC,IAAI,IAAE,MAAM,IAAI,CAAC,SAAS,CAAC,GAAE;YAAG,OAAK;YAAE,IAAI,IAAE,MAAM,IAAI,CAAC,SAAS,CAAC,GAAE;YAAG,OAAK;YAAE,IAAI,IAAE,MAAM,IAAI,CAAC,SAAS,CAAC,GAAE;YAAG,OAAK;YAAE,MAAM,IAAE,IAAI,WAAW;YAAG,OAAO,KAAG,IAAG,CAAA,CAAC,CAAC,EAAE,GAAC,KAAG,KAAG,KAAI,CAAC,CAAC,EAAE,GAAC,KAAG,IAAE,KAAI,CAAC,CAAC,EAAE,GAAC,MAAI,CAAA,IAAG,KAAI,CAAA,KAAG,KAAG,GAAE,IAAI,CAAA,CAAC,CAAC,EAAE,GAAC,IAAG,CAAC,CAAC,EAAE,GAAC,KAAI,CAAC,CAAC,EAAE,GAAC,EAAC,IAAG,KAAI,CAAA,KAAG,KAAG,GAAE,IAAI,CAAA,CAAC,CAAC,EAAE,GAAC,KAAI,CAAC,CAAC,EAAE,GAAC,KAAI,CAAC,CAAC,EAAE,GAAC,GAAE,IAAG,EAAE,KAAK,CAAC,gBAAe,CAAC,CAAC,EAAE,GAAC,KAAG,IAAE,KAAI,CAAC,CAAC,EAAE,GAAC,MAAI,GAAE,CAAC,CAAC,EAAE,GAAC,KAAG,KAAG,KAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;QAAC;QAAC,aAAa,CAAC,EAAC,CAAC,EAAC;YAAC,OAAO;QAAC;IAAC;AAAC,IAAG,2BAAG,YAAW,2BAAG,gzJAA+yJ,2BAAG,YAAW,2BAAG,4NAA2N,2BAAG;AAAW,IAAI,2BAAG,OAAO,MAAM,CAAC;IAAC,WAAU;IAAK,YAAW,cAAc;QAAG,aAAa;YAAC,KAAK,IAAI,YAAW,IAAI,CAAC,SAAS,GAAC,YAAW,IAAI,CAAC,aAAa,GAAC,IAAG,IAAI,CAAC,cAAc,GAAC,YAAW,IAAI,CAAC,YAAY,GAAC,YAAW,IAAI,CAAC,cAAc,GAAC,YAAW,IAAI,CAAC,YAAY,GAAC,YAAW,IAAI,CAAC,uBAAuB,GAAC,MAAK,IAAI,CAAC,uBAAuB,GAAC;gBAAC;gBAAE;aAAU,EAAC,IAAI,CAAC,kBAAkB,GAAC,YAAW,IAAI,CAAC,UAAU,GAAC,YAAW,IAAI,CAAC,iBAAiB,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,aAAa,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,YAAY,GAAC,YAAW,IAAI,CAAC,YAAY,GAAC,IAAG,IAAI,CAAC,aAAa,GAAC,IAAG,IAAI,CAAC,aAAa,GAAC,IAAG,IAAI,CAAC,kBAAkB,GAAC,IAAG,IAAI,CAAC,kBAAkB,GAAC,IAAG,IAAI,CAAC,WAAW,GAAC,IAAG,IAAI,CAAC,iBAAiB,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,sBAAsB,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,wBAAwB,GAAC,IAAG,IAAI,CAAC,sBAAsB,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,wBAAwB,GAAC,IAAG,IAAI,CAAC,sBAAsB,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,wBAAwB,GAAC,GAAE,IAAI,CAAC,sBAAsB,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,wBAAwB,GAAC,GAAE,IAAI,CAAC,sBAAsB,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,wBAAwB,GAAC,GAAE,IAAI,CAAC,sBAAsB,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,wBAAwB,GAAC,IAAG,IAAI,CAAC,qCAAqC,GAAC,IAAI,CAAC,iBAAiB,EAAC,IAAI,CAAC,iCAAiC,GAAC,SAAM,IAAI,CAAC,4BAA4B,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,6BAA6B,GAAC,SAAM,IAAI,CAAC,wBAAwB,GAAC,IAAI,CAAC,UAAU,GAAC,IAAG,IAAI,CAAC,yBAAyB,GAAC,SAAM,IAAI,CAAC,4BAA4B,GAAC,GAAE,IAAI,CAAC,4BAA4B,GAAC,GAAE,IAAI,CAAC,0BAA0B,GAAC,GAAE,IAAI,CAAC,wBAAwB,GAAC,CAAC,GAAE,IAAI,CAAC,2BAA2B,GAAC,IAAG,IAAI,CAAC,UAAU,GAAC;gBAAC;oBAAC;oBAAE;oBAAM;iBAAU;gBAAC;oBAAC;oBAAW;oBAAW;iBAAO;gBAAC;oBAAC;oBAAW;oBAAW;iBAAO;gBAAC;oBAAC;oBAAW;oBAAW;iBAAkB;gBAAC;oBAAC;oBAAW;oBAAW;iBAAY;gBAAC;oBAAC;oBAAW;oBAAW;iBAAY;gBAAC;oBAAC;oBAAW;oBAAW;iBAAO;gBAAC;oBAAC;oBAAW;oBAAW;iBAAO;gBAAC;oBAAC;oBAAW;oBAAW;iBAAW;gBAAC;oBAAC;oBAAW;oBAAW;iBAAW;gBAAC;oBAAC;oBAAW;oBAAW;iBAAgB;aAAC,EAAC,IAAI,CAAC,aAAa,GAAC,YAAW,IAAI,CAAC,aAAa,GAAC,GAAE,IAAI,CAAC,YAAY,GAAC;gBAAC,GAAE;gBAAa,GAAE;gBAAY,GAAE;gBAAoB,GAAE;gBAAoB,GAAE;gBAAkB,GAAE;gBAAgB,GAAE;gBAAiB,GAAE;gBAA8B,GAAE;gBAAU,GAAE;gBAAsB,IAAG;gBAAsB,IAAG;gBAAsB,IAAG;YAAa,GAAE,IAAI,CAAC,UAAU,GAAC,0BAAG,IAAI,CAAC,KAAK,GAAC,0BAAG,IAAI,CAAC,UAAU,GAAC,0BAAG,IAAI,CAAC,QAAQ,GAAC,0BAAG,IAAI,CAAC,QAAQ,GAAC;QAAE;QAAC,MAAM,cAAc,CAAC,EAAC;YAAC,MAAM,IAAE,IAAI,CAAC,iBAAiB,GAAC;YAAE,OAAO,MAAM,EAAE,OAAO,CAAC,MAAI,KAAG;QAAC;QAAC,MAAM,oBAAoB,CAAC,EAAC;YAAC,MAAM,IAAE,IAAI,CAAC,iBAAiB,GAAC;YAAE,OAAO,MAAM,EAAE,OAAO,CAAC,MAAI,IAAE;QAAE;QAAC,MAAM,oBAAoB,CAAC,EAAC;YAAC,MAAM,IAAE,IAAI,CAAC,iBAAiB,GAAC;YAAE,OAAO,MAAM,EAAE,OAAO,CAAC,MAAI,IAAE;QAAC;QAAC,MAAM,mBAAmB,CAAC,EAAC;YAAC,OAAM,CAAC,EAAE,MAAI,MAAM,IAAI,CAAC,aAAa,CAAC,KAAG,aAAW,mBAAmB,YAAY,EAAE,MAAM,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;QAAA;QAAC,MAAM,gBAAgB,CAAC,EAAC;YAAC,OAAM;gBAAC;aAAuB;QAAA;QAAC,MAAM,eAAe,CAAC,EAAC;YAAC,OAAO;QAAE;QAAC,MAAM,gBAAgB,CAAC,EAAC,CAAC;QAAC,MAAM,gBAAgB,CAAC,EAAC;YAAC,EAAE,KAAK,CAAC;QAAoD;QAAC,MAAM,QAAQ,CAAC,EAAC;YAAC,IAAI,IAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa;YAAE,OAAK;YAAE,IAAI,IAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa,GAAC;YAAG,IAAE,MAAI,IAAE;YAAM,MAAM,IAAE,IAAI,WAAW;YAAG,OAAO,CAAC,CAAC,EAAE,GAAC,KAAG,IAAE,KAAI,CAAC,CAAC,EAAE,GAAC,MAAI,GAAE,CAAC,CAAC,EAAE,GAAC,KAAG,KAAG,KAAI,CAAC,CAAC,EAAE,GAAC,KAAG,KAAG,KAAI,CAAC,CAAC,EAAE,GAAC,KAAG,IAAE,KAAI,CAAC,CAAC,EAAE,GAAC,MAAI,GAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAE,MAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;QAAC;QAAC,MAAM,oBAAoB,CAAC,EAAC,CAAC;QAAC,MAAM,qBAAqB,CAAC,EAAC;YAAC,OAAO,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,wBAAwB,IAAE,IAAI,CAAC,yBAAyB;QAAA;QAAC,MAAM,mBAAmB,CAAC,EAAC,CAAC,EAAC;YAAC,IAAG,IAAE,KAAG,IAAE,IAAI,CAAC,aAAa,EAAC,OAAO,KAAK,EAAE,KAAK,CAAC,CAAC,2CAA2C,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;YAAE,MAAM,IAAE;gBAAC;oBAAC,IAAI,CAAC,sBAAsB;oBAAC,IAAI,CAAC,wBAAwB;iBAAC;gBAAC;oBAAC,IAAI,CAAC,sBAAsB;oBAAC,IAAI,CAAC,wBAAwB;iBAAC;gBAAC;oBAAC,IAAI,CAAC,sBAAsB;oBAAC,IAAI,CAAC,wBAAwB;iBAAC;gBAAC;oBAAC,IAAI,CAAC,sBAAsB;oBAAC,IAAI,CAAC,wBAAwB;iBAAC;gBAAC;oBAAC,IAAI,CAAC,sBAAsB;oBAAC,IAAI,CAAC,wBAAwB;iBAAC;gBAAC;oBAAC,IAAI,CAAC,sBAAsB;oBAAC,IAAI,CAAC,wBAAwB;iBAAC;aAAC,EAAC,CAAC,GAAE,EAAE,GAAC,CAAC,CAAC,EAAE;YAAC,OAAO,MAAM,EAAE,OAAO,CAAC,MAAI,IAAE;QAAE;QAAC,MAAM,0BAA0B,CAAC,EAAC;YAAC,MAAM,IAAE,EAAE;YAAC,IAAI,IAAI,IAAE,GAAE,KAAG,IAAI,CAAC,aAAa,EAAC,IAAI;gBAAC,MAAM,IAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,GAAE;gBAAG,EAAE,IAAI,CAAC;YAAE;YAAoB,EAAE,IAAI,CAAE,CAAA,IAAG,MAAI,IAAI,CAAC,0BAA0B;YAAG,OAAM,CAAC;YAAE,MAAM,IAAE,EAAE,IAAI,CAAE,CAAA,IAAG,MAAI,IAAI,CAAC,4BAA4B,GAAG,IAAE,EAAE,IAAI,CAAE,CAAA,IAAG,MAAI,IAAI,CAAC,4BAA4B;YAAG,OAA0B;QAAiB;IAAC;AAAC;;;AEDt0zJ;;;;;;;;;;;;;;;;CAgBG,GACH;AAEA,IAAY;AAAZ,CAAA,SAAY,sBAAsB;IAChC,sBAAA,CAAA,sBAAA,CAAA,YAAA,GAAA,EAAA,GAAA;AACF,CAAA,EAFY,6CAAA,CAAA,4CAAsB,CAAA,CAAA;AAUlC,MAAM,uCAAiB;AACvB,MAAM,6CAAuB;AAC7B,MAAM,mCAAa;AAEnB,MAAM,2CAAqB;AAC3B,MAAM,yCAAmB;AACzB,MAAM,uCAAiB;AACvB,MAAM,yCAAmB;AAEzB,MAAM,4CAAsB;IAAC;IAAI;IAAG;IAAG;IAAG;CAAE;AAC5C,MAAM,4CAAsB;IAAC;IAAG;CAAE;AAClC,MAAM,0CAAoB;IAAC;IAAQ;IAAQ;CAAM;AAEjD,MAAM,4CACF;IAAC;IAAQ;IAAO;CAAO;AAC3B,MAAM,8CAAwB;IAAC;IAAG;IAAK;CAAE;AAEzC,MAAM,gDAA0B;IAC9B,UAAU,0CAAuB,SAAS;IAC1C,0BAA0B;IAC1B,2BAA2B;AAC5B;AAED;;;;;;;CAOG,GACH,SAAS,oCAAc,MAAiB,EAAE,SAAiB;IACzD,MAAM,gBAAgB,OAAO,cAAc,CAAC,EAAE;IAC9C,KAAK,MAAM,SAAS,cAAc,UAAU,CAAE;QAC5C,MAAM,YAAY,MAAM,UAAU,CAAC,EAAE;QACrC,IAAI,UAAU,cAAc,KAAK,WAC/B,OAAO;IAEV;IACD,MAAM,IAAI,UAAU,CAAA,oCAAA,EAAuC,UAAS,CAAA,CAAG;AACzE;AAEA;;;;;;CAMG,GACH,SAAS,mCAAa,KAAmB,EAAE,SAAuB;IAEhE,MAAM,YAAY,MAAM,UAAU,CAAC,EAAE;IACrC,KAAK,MAAM,YAAY,UAAU,SAAS,CAAE;QAC1C,IAAI,SAAS,SAAS,IAAI,WACxB,OAAO;IAEV;IACD,MAAM,IAAI,UAAU,CAAA,UAAA,EAAa,MAAM,eAAe,CAAA,kBAAA,CAAoB,GACtD,CAAA,EAAG,UAAS,UAAA,CAAY;AAC9C;AAEA;;;;;CAKG,GACH,MAAM;IAOJ;;;;;;;KAOG,GACH,YAAY,MAAiB,EAAE,QAAqB,EAAE,OAAmB,CAAzE;QACE,IAAI,CAAC,IAAI,GAAG;QACZ,IAAI,CAAC,OAAO,GAAG;QACf,IAAI,CAAC,SAAS,GAAG;QACjB,IAAI,CAAC,QAAQ,GAAG;IAClB;IAEA;;;;KAIG,GACH,KAAK,UAAwC,EAA7C;QACG,CAAA;Y,I;YACC,IAAI;YACJ,IAAI,WAAW,WAAW,EAAE;gBAC1B,MAAM,IAAI,WAAW,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU;gBAC5D,YAAY,KAAK,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,UAAU;YACrD,OACC,YAAY,IAAI,CAAC,SAAS,CAAC,UAAU;YAGvC,IAAI;gBACF,MAAM,SAAS,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CACxC,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE;gBACnC,IAAI,OAAO,MAAM,IAAI,MAAM;oBACzB,WAAW,KAAK,CAAC,CAAA,WAAA,EAAc,OAAO,MAAM,CAAA,CAAE;oBAC9C,IAAI,CAAC,QAAQ;gBACd;gBACD,IAAI,AAAA,CAAA,KAAA,OAAO,IAAI,AAAJ,MAAI,QAAA,OAAA,KAAA,IAAA,KAAA,IAAA,GAAE,MAAM,EAAE;oBACvB,MAAM,QAAQ,IAAI,WACd,OAAO,IAAI,CAAC,MAAM,EAAE,OAAO,IAAI,CAAC,UAAU,EAC1C,OAAO,IAAI,CAAC,UAAU;oBAC1B,WAAW,OAAO,CAAC;gBACpB;YACF,EAAC,OAAO,OAAO;gBACd,WAAW,KAAK,CAAC,MAAM,QAAQ;gBAC/B,IAAI,CAAC,QAAQ;YACd;QACH,CAAA;IACF;AACD;AAED;;;;;CAKG,GACH,MAAM;IAKJ;;;;;;;KAOG,GACH,YAAY,MAAiB,EAAE,QAAqB,EAAE,OAAmB,CAAzE;QACE,IAAI,CAAC,OAAO,GAAG;QACf,IAAI,CAAC,SAAS,GAAG;QACjB,IAAI,CAAC,QAAQ,GAAG;IAClB;IAEA;;;;;KAKG,GACH,MAAM,MACF,KAAiB,EACjB,UAA2C,EAF/C;QAGE,IAAI;YACF,MAAM,SACF,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE;YAClE,IAAI,OAAO,MAAM,IAAI,MAAM;gBACzB,WAAW,KAAK,CAAC,OAAO,MAAM;gBAC9B,IAAI,CAAC,QAAQ;YACd;QACF,EAAC,OAAO,OAAO;YACd,WAAW,KAAK,CAAC,MAAM,QAAQ;YAC/B,IAAI,CAAC,QAAQ;QACd;IACH;AACD;AAGK,MAAO;IAaX;;;;;KAKG,GACH,YACI,MAAiB,EACjB,eAAuC,CAF3C;QAGE,IAAI,CAAC,gBAAgB,GAAA,OAAA,MAAA,CAAA,OAAA,MAAA,CAAA,CAAA,GAAO,gDAA4B;QACxD,IAAI,CAAC,cAAc,GAAG;YACpB,mBAAmB;YACnB,eAAe;YACf,OAAO;QACR;QAED,IAAI,CAAC,OAAO,GAAG;QACf,IAAI,CAAC,iBAAiB,GAAG,oCACrB,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,gBAAgB,CAAC,wBAAkC;QAC5D,IAAI,CAAC,kBAAkB,GAAG,oCACtB,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,gBAAgB,CAAC,yBAAmC;QAC7D,IAAI,CAAC,WAAW,GAAG,mCAAa,IAAI,CAAC,kBAAkB,EAAE;QACzD,IAAI,CAAC,YAAY,GAAG,mCAAa,IAAI,CAAC,kBAAkB,EAAE;IAC5D;IAEA;;;;KAIG,GACH,IAAW,WAAX;Q,I;QACE,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EACxC,IAAI,CAAC,SAAS,GAAG,IAAI,eACjB,IAAI,kDACA,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE;YAC9B,IAAI,CAAC,SAAS,GAAG;QACnB,IACJ;YACE,eAAe,AAAA,CAAA,KAAA,IAAI,CAAC,cAAc,CAAC,UAAU,AAAV,MAAU,QAAA,OAAA,KAAA,IAAA,KAAI;QAClD;QAEP,OAAO,IAAI,CAAC,SAAS;IACvB;IAEA;;;;KAIG,GACH,IAAW,WAAX;Q,I;QACE,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EACxC,IAAI,CAAC,SAAS,GAAG,IAAI,eACjB,IAAI,gDACA,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE;YAC/B,IAAI,CAAC,SAAS,GAAG;QACnB,IACJ,IAAI,0BAA0B;YAC5B,eAAe,AAAA,CAAA,KAAA,IAAI,CAAC,cAAc,CAAC,UAAU,AAAV,MAAU,QAAA,OAAA,KAAA,IAAA,KAAI;QAClD;QAEP,OAAO,IAAI,CAAC,SAAS;IACvB;IAEA;;;;;;KAMG,GACI,MAAM,KAAK,OAAsB,EAAjC;QACL,IAAI,CAAC,cAAc,GAAG;QACtB,IAAI,CAAC,eAAe;QAEpB,IAAI;YACF,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI;YACvB,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,KAAK,MACjC,MAAM,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC;YAGzC,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,iBAAiB,CAAC,eAAe;YACxE,IAAI,IAAI,CAAC,iBAAiB,KAAK,IAAI,CAAC,kBAAkB,EACpD,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,CAC7B,IAAI,CAAC,kBAAkB,CAAC,eAAe;YAG7C,MAAM,IAAI,CAAC,aAAa;YACxB,MAAM,IAAI,CAAC,UAAU,CAAC;gBAAC,mBAAmB;YAAI;QAC/C,EAAC,OAAO,OAAO;YACd,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EACrB,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK;YAE1B,MAAM,IAAI,MAAM,8BAA8B,MAAM,QAAQ;QAC7D;IACH;IAEA;;;;;KAKG,GACI,MAAM,QAAN;QACL,MAAM,WAAW,EAAE;QACnB,IAAI,IAAI,CAAC,SAAS,EAChB,SAAS,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM;QAErC,IAAI,IAAI,CAAC,SAAS,EAChB,SAAS,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK;QAEpC,MAAM,QAAQ,GAAG,CAAC;QAClB,IAAI,CAAC,SAAS,GAAG;QACjB,IAAI,CAAC,SAAS,GAAG;QACjB,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YACvB,MAAM,IAAI,CAAC,UAAU,CAAC;gBAAC,mBAAmB;gBAAO,eAAe;YAAK;YACrE,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK;QACzB;IACH;IAEA;;;;;KAKG,GACI,MAAM,SAAN;QACL,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM;IAC5B;IAEA;;;KAGG,GACI,UAAA;QACL,OAAO;YACL,aAAa,IAAI,CAAC,OAAO,CAAC,QAAQ;YAClC,cAAc,IAAI,CAAC,OAAO,CAAC,SAAS;QACrC;IACH;IAEA;;;;;KAKG,GACI,YAAY,OAAsB,EAAlC;QACL,IAAI,CAAC,cAAc,GAAA,OAAA,MAAA,CAAA,OAAA,MAAA,CAAA,CAAA,GAAO,IAAI,CAAC,cAAc,GAAK;QAClD,IAAI,CAAC,eAAe;QACpB,OAAO,IAAI,CAAC,aAAa;IAC3B;IAEA;;;;;KAKG,GACI,MAAM,WAAW,OAA4B,EAA7C;QACL,IAAI,CAAC,cAAc,GAAA,OAAA,MAAA,CAAA,OAAA,MAAA,CAAA,CAAA,GAAO,IAAI,CAAC,cAAc,GAAK;QAElD,IAAI,QAAQ,iBAAiB,KAAK,aAC9B,QAAQ,aAAa,KAAK,WAAW;YACvC,qEAAqE;YACrE,mEAAmE;YACnE,EAAE;YACF,kDAAkD;YAClD,MAAM,QAAQ,AAAC,CAAA,IAAI,CAAC,cAAc,CAAC,iBAAiB,GAAG,IAAS,CAAA,IACjD,CAAA,IAAI,CAAC,cAAc,CAAC,aAAa,GAAG,IAAS,CAAA;YAE5D,MAAM,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC;gBACpC,eAAe;gBACf,aAAa;gBACb,WAAW;gBACX,SAAS;gBACT,SAAS,IAAI,CAAC,iBAAiB,CAAC,eAAe;YAChD;QACF;QAED,IAAI,QAAQ,KAAK,KAAK,WAAW;YAC/B,wEAAwE;YACxE,qEAAqE;YACrE,wBAAwB;YACxB,EAAE;YACF,kDAAkD;YAClD,MAAM,QAAQ,IAAI,CAAC,cAAc,CAAC,KAAK,GAAG,SAAS;YAEnD,MAAM,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC;gBACpC,eAAe;gBACf,aAAa;gBACb,WAAW;gBACX,SAAS;gBACT,SAAS,IAAI,CAAC,iBAAiB,CAAC,eAAe;YAChD;QACF;IACH;IAEA;;;KAGG,GACK,kBAAA;QACN,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,GACpD,MAAM,IAAI,WAAW,uBAAuB,IAAI,CAAC,cAAc,CAAC,QAAQ;QAG1E,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,GACpD,MAAM,IAAI,WAAW,sBAAsB,IAAI,CAAC,cAAc,CAAC,QAAQ;QAGzE,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,GACpD,MAAM,IAAI,WAAW,sBAAsB,IAAI,CAAC,cAAc,CAAC,QAAQ;QAGzE,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,GAChD,MAAM,IAAI,WAAW,oBAAoB,IAAI,CAAC,cAAc,CAAC,MAAM;IAEvE;IAEA;;;;KAIG,GACK,gBAAgB,QAAgB,EAAhC;QACN,OAAO,WAAW,MAAM;IAC1B;IAEA;;;;;KAKG,GACK,gBAAgB,QAA4B,EAA5C;QACN,IAAI,OAAO,aAAa,aACtB,OAAO;QAET,OAAO,0CAAoB,QAAQ,CAAC;IACtC;IAEA;;;;;KAKG,GACK,gBAAgB,QAA4B,EAA5C;QACN,IAAI,OAAO,aAAa,aACtB,OAAO;QAET,OAAO,0CAAoB,QAAQ,CAAC;IACtC;IAEA;;;;KAIG,GACK,cAAc,MAA8B,EAA5C;QACN,IAAI,OAAO,WAAW,aACpB,OAAO;QAET,OAAO,wCAAkB,QAAQ,CAAC;IACpC;IAEA;;;KAGG,GACK,MAAM,gBAAN;Q,I,I,I;QACN,kDAAkD;QAClD,MAAM,SAAS,IAAI,YAAY;QAC/B,MAAM,OAAO,IAAI,SAAS;QAC1B,KAAK,SAAS,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE;QAChD,KAAK,QAAQ,CACT,GAAG,4CAAsB,OAAO,CAC5B,AAAA,CAAA,KAAA,IAAI,CAAC,cAAc,CAAC,QAAQ,AAAR,MAAQ,QAAA,OAAA,KAAA,IAAA,KAAI;QACxC,KAAK,QAAQ,CACT,GAAG,0CAAoB,OAAO,CAC1B,AAAA,CAAA,KAAA,IAAI,CAAC,cAAc,CAAC,MAAM,AAAN,MAAM,QAAA,OAAA,KAAA,IAAA,KAAI;QACtC,KAAK,QAAQ,CAAC,GAAG,AAAA,CAAA,KAAA,IAAI,CAAC,cAAc,CAAC,QAAQ,AAAR,MAAQ,QAAA,OAAA,KAAA,IAAA,KAAI;QAEjD,MAAM,SAAS,MAAM,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC;YACnD,eAAe;YACf,aAAa;YACb,WAAW;YACX,SAAS;YACT,SAAS,IAAI,CAAC,iBAAiB,CAAC,eAAe;QAChD,GAAE;QACH,IAAI,OAAO,MAAM,IAAI,MACnB,MAAM,IAAI,aAAa,gBAAgB;IAE3C;AACD;AAED,yDAAA,GACA,MAAM;IACJ;;;;;;KAMG,GACH,MAAM,YACF,OAAkC,EAClC,eAAuC,EAF3C;QAGE,kBAAe,OAAA,MAAA,CAAA,OAAA,MAAA,CAAA,CAAA,GAAO,gDAA4B;QAElD,MAAM,aAAgC,EAAE;QACxC,IAAI,WAAW,QAAQ,OAAO,EAC5B,KAAK,MAAM,UAAU,QAAQ,OAAO,CAAE;YACpC,MAAM,YAA6B;gBACjC,WAAW,gBAAgB,wBAAwB;YACpD;YACD,IAAI,OAAO,WAAW,KAAK,WACzB,UAAU,QAAQ,GAAG,OAAO,WAAW;YAEzC,IAAI,OAAO,YAAY,KAAK,WAC1B,UAAU,SAAS,GAAG,OAAO,YAAY;YAE3C,WAAW,IAAI,CAAC;QACjB;QAGH,IAAI,WAAW,MAAM,KAAK,GACxB,WAAW,IAAI,CAAC;YACd,WAAW,gBAAgB,wBAAwB;QACpD;QAGH,MAAM,SAAS,MAAM,UAAU,GAAG,CAAC,aAAa,CAAC;YAAC,WAAW;QAAU;QACvE,MAAM,OAAO,IAAI,0CAAW,QAAQ;QACpC,OAAO;IACT;IAEA;;;;;;;KAOG,GACH,MAAM,SAAS,eAAuC,EAAtD;QAEE,kBAAe,OAAA,MAAA,CAAA,OAAA,MAAA,CAAA,CAAA,GAAO,gDAA4B;QAElD,MAAM,UAAU,MAAM,UAAU,GAAG,CAAC,UAAU;QAC9C,MAAM,QAAsB,EAAE;QAC9B,QAAQ,OAAO,CAAC,CAAC;YACf,IAAI;gBACF,MAAM,OAAO,IAAI,0CAAW,QAAQ;gBACpC,MAAM,IAAI,CAAC;YACZ,EAAC,OAAO,GAAG;YACV,0BAA0B;YAC3B;QACH;QACA,OAAO;IACT;AACD;AAGM,MAAM,4CAAS,IAAI;;;AHtkB1B,MAAM,kCAAY,SAAS,cAAc,CAAC;AAC1C,MAAM,sCAAgB,SAAS,cAAc,CAAC;AAC9C,MAAM,oCAAc,SAAS,cAAc,CAAC;AAC5C,MAAM,yCAAmB,SAAS,cAAc,CAAC;AACjD,MAAM,oCAAc,SAAS,cAAc,CAAC;AAC5C,MAAM,oCAAc,SAAS,cAAc,CAAC;AAC5C,MAAM,sCAAgB,SAAS,cAAc,CAAC;AAC9C,MAAM,iCAAW,SAAS,cAAc,CAAC;AACzC,MAAM,iCAAW,SAAS,cAAc,CAAC;AACzC,MAAM,mCAAa,SAAS,cAAc,CAAC;AAC3C,MAAM,oCAAc,SAAS,cAAc,CAAC;AAC5C,MAAM,kCAAY,SAAS,cAAc,CAAC;AAC1C,MAAM,8BAAQ,SAAS,cAAc,CAAC;AAItC,IAAI,CAAC,UAAU,MAAM,IAAI,UAAU,GAAG,EAAE,UAAU,MAAM,GAAG,CAAA,GAAA,yCAAK;AAKhE,MAAM,6BAAO,IAAI,SAAS;IAAE,MAAM;IAAK,MAAM;AAAG;AAChD,2BAAK,IAAI,CAAC;AAEV,IAAI,+BAAS;AACb,IAAI;AACJ,IAAI,6BAAe;AACnB,IAAI;AAEJ,MAAM,kCAAY,EAAE;AAEpB,uCAAiB,KAAK,CAAC,OAAO,GAAG;AACjC,kCAAY,KAAK,CAAC,OAAO,GAAG;AAC5B,kCAAY,KAAK,CAAC,OAAO,GAAG;AAC5B,kCAAY,KAAK,CAAC,OAAO,GAAG;AAC5B,+BAAS,KAAK,CAAC,OAAO,GAAG;AAEzB,MAAM,0CAAoB;IACxB;QACE,2BAAK,KAAK;IACZ;IACA,WAAU,IAAI;QACZ,2BAAK,OAAO,CAAC;IACf;IACA,OAAM,IAAI;QACR,2BAAK,KAAK,CAAC;IACb;AACF;AAEA,SAAS;IACP,+BAAS;IACT,kCAAY;IACZ,6BAAO;AACT;AAEA,kCAAY,OAAO,GAAG;IACpB,IAAI,iCACF,gCAAU,WAAW;AAEzB;AAEA,kCAAY,OAAO,GAAG;IACpB,IAAI,iCAAW;QACb,MAAM,gCAAU,MAAM,CAAC;QACvB,MAAM,IAAI,QAAQ,CAAC,UAAY,WAAW,SAAS;QACnD,MAAM,gCAAU,MAAM,CAAC;IACzB;AACF;AAEA,kCAAY,OAAO,GAAG;IACpB,kCAAY,QAAQ,GAAG;IACvB,IAAI;QACF,MAAM,gCAAU,UAAU;IAC5B,EAAE,OAAO,GAAG;QACV,QAAQ,KAAK,CAAC;QACd,2BAAK,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IACpC,SAAU;QACR,kCAAY,QAAQ,GAAG;IACzB;AACF;AAEA,oCAAc,OAAO,GAAG;IACtB,IAAI,iCAAW,MAAM;QACnB,+BAAS,MAAM,UAAU,MAAM,CAAC,WAAW,CAAC,CAAC;QAC7C,kCAAY,IAAI,CAAA,GAAA,yCAAQ,EAAE,8BAAQ;IACpC;IAEA,IAAI;QACF,MAAM,eAAe;uBACnB;YACA,UAAU,SAAS,gCAAU,KAAK;YAClC,UAAU;QACZ;QACA,kCAAY,IAAI,CAAA,GAAA,yCAAQ,EAAE;QAE1B,kCAAY,KAAK,CAAC,OAAO,GAAG;QAC5B,gCAAU,KAAK,CAAC,OAAO,GAAG;QAC1B,oCAAc,KAAK,CAAC,OAAO,GAAG;QAE9B,6BAAO,MAAM,gCAAU,IAAI;QAE3B,IAAG,CAAC,2BAAK,UAAU,CAAC,aAAY;YAC9B,2BAAK,OAAO,CAAC;YACb,MAAM,gCAAU,UAAU;YAC1B;YACA,kCAAY,KAAK,CAAC,OAAO,GAAG;YAC5B,gCAAU,KAAK,CAAC,OAAO,GAAG;YAC1B,oCAAc,KAAK,CAAC,OAAO,GAAG;YAC9B;QACF;IACF,EAAE,OAAO,GAAG;QACV,QAAQ,KAAK,CAAC;QACd,2BAAK,OAAO,CAAC;QACb,2BAAK,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;QAClC,MAAM,gCAAU,UAAU;QAC1B;QACA,kCAAY,KAAK,CAAC,OAAO,GAAG;QAC5B,gCAAU,KAAK,CAAC,OAAO,GAAG;QAC1B,oCAAc,KAAK,CAAC,OAAO,GAAG;QAC9B;IACF;IAEA,QAAQ,GAAG,CAAC,wBAAwB;IACpC,kCAAY,KAAK,CAAC,OAAO,GAAG;IAC5B,gCAAU,KAAK,CAAC,OAAO,GAAG;IAC1B,gCAAU,SAAS,GAAG,0BAA0B;IAChD,gCAAU,KAAK,CAAC,OAAO,GAAG;IAC1B,oCAAc,KAAK,CAAC,OAAO,GAAG;IAC9B,uCAAiB,KAAK,CAAC,OAAO,GAAG;IACjC,kCAAY,KAAK,CAAC,OAAO,GAAG;IAC5B,kCAAY,KAAK,CAAC,OAAO,GAAG;IAC5B,+BAAS,KAAK,CAAC,OAAO,GAAG;AAC3B;AAEA,uCAAiB,OAAO,GAAG;IACzB,IAAI,iCAAW,MAAM,gCAAU,UAAU;IAEzC,2BAAK,KAAK;IACV,kCAAY,KAAK,CAAC,OAAO,GAAG;IAC5B,gCAAU,KAAK,CAAC,OAAO,GAAG;IAC1B,oCAAc,KAAK,CAAC,OAAO,GAAG;IAC9B,uCAAiB,KAAK,CAAC,OAAO,GAAG;IACjC,kCAAY,KAAK,CAAC,OAAO,GAAG;IAC5B,kCAAY,KAAK,CAAC,OAAO,GAAG;IAC5B,gCAAU,KAAK,CAAC,OAAO,GAAG;IAC1B,+BAAS,KAAK,CAAC,OAAO,GAAG;IACzB,oCAAc,KAAK,CAAC,OAAO,GAAG;IAC9B,kCAAY,KAAK,CAAC,OAAO,GAAG;IAC5B,IAAK,IAAI,QAAQ,GAAG,QAAQ,4BAAM,IAAI,CAAC,MAAM,EAAE,QAC7C,4BAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,GAAG;IAEnD;AACF;AAEA,oCAAc,OAAO,GAAG;IACtB,MAAM,eAAe,EAAE;IAEvB,IAAK,IAAI,QAAQ,GAAG,QAAQ,4BAAM,IAAI,CAAC,MAAM,EAAE,QAAS;QACtD,MAAM,MAAM,4BAAM,IAAI,CAAC,MAAM;QAC7B,MAAM,cAAc,IAAI,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE;QAE9C,YAAY,WAAW,GAAG;QAC1B,aAAa,IAAI,CAAC;IACpB;IAEA,IAAI;QACF,MAAM,eAA6B;YACjC,WAAW;YACX,UAAU;YACV,UAAU;YACV,WAAW;YACX,WAAW;YACX,WAAW;YACX,gBAAgB,CAAC,WAAW,SAAS;gBACnC,YAAY,CAAC,UAAU,CAAC,KAAK,GAAG,AAAC,UAAU,QAAS;YACtD;YACA,kBAAkB,CAAC,QAAU,SAAS,GAAG,CAAC,SAAS,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC;QACtE;QACA,oCAAc,KAAK,CAAC,OAAO,GAAG;QAC9B,kCAAY,KAAK,CAAC,OAAO,GAAG;QAC5B,MAAM,gCAAU,UAAU,CAAC;IAC7B,EAAE,OAAO,GAAG;QACV,QAAQ,KAAK,CAAC;QACd,oCAAc,KAAK,CAAC,OAAO,GAAG;QAC9B,2BAAK,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IACpC,SAAU;QACR,oBAAoB;QACpB,MAAM,gCAAU,UAAU;QAC1B,MAAM,gCAAU,OAAO,CAAC;QACxB,MAAM,gCAAU,MAAM,CAAC;QACvB,MAAM,IAAI,QAAQ,CAAC,UAAY,WAAW,SAAS;QACnD,MAAM,gCAAU,MAAM,CAAC;QACvB,kCAAY,KAAK,CAAC,OAAO,GAAG;QAC5B,MAAO,KAAM;YACX,MAAM,MAAM,MAAM,gCAAU,OAAO;YACnC,IAAI,OAAO,QAAQ,aACjB,2BAAK,KAAK,CAAC;iBACN;gBACL,QAAQ,GAAG,CAAC;gBACZ;YACF;QACF;IACF;AACF;AAEA,kCAAkC;AAClC,SAAS,iCAAW,IAAI,EAAE,IAAI,EAAE,IAAI;IAClC,MAAM,WAAW,4BAAM,IAAI,CAAC,MAAM;IAClC,MAAM,MAAM,4BAAM,SAAS,CAAC;IAE5B,mBAAmB;IACnB,MAAM,QAAQ,IAAI,UAAU,CAAC;IAC7B,MAAM,WAAW,SAAS,aAAa,CAAC;IACxC,SAAS,SAAS,GAAG;IACrB,MAAM,WAAW,CAAC;IAElB,2BAA2B;IAC3B,MAAM,QAAQ,IAAI,UAAU,CAAC;IAC7B,MAAM,WAAW,SAAS,aAAa,CAAC;IACxC,SAAS,SAAS,GAAG;IACrB,MAAM,WAAW,CAAC;IAElB,uBAAuB;IACvB,MAAM,QAAQ,IAAI,UAAU,CAAC;IAC7B,MAAM,WAAW,SAAS,aAAa,CAAC;IACxC,SAAS,SAAS,GAAG,OAAK;IAC1B,MAAM,WAAW,CAAC;IAElB,uBAAuB;IACvB,MAAM,QAAQ,IAAI,UAAU,CAAC;IAC7B,MAAM,SAAS,CAAC,GAAG,CAAC;IACpB,MAAM,SAAS,GAAG,CAAC,6DAA6D,CAAC;AACnF;AAEA,SAAS,yCAAmB,QAAQ,EAAE,IAAI,EAAE,IAAI;IAC9C,QAAQ,GAAG,CAAC,QAAQ,MAAM;IAC1B,IAAI,UAAU,IAAI;IAClB,QAAQ,IAAI,CAAC,OAAO,MAAM;IAC1B,QAAQ,YAAY,GAAG;IACvB,QAAQ,MAAM,GAAG;QACb,QAAQ,GAAG,CAAC,QAAQ,MAAM,MAAM,QAAQ,QAAQ;QAChD,IAAI,OAAO,QAAQ,QAAQ,CAAC,IAAI;QAChC,IAAI,SAAS,IAAI;QACjB,OAAO,MAAM,GAAI,SAAS,CAAC;YACvB,SAAS,IAAI,CAAC;gBAAE,MAAM,EAAE,MAAM,CAAC,MAAM;gBAAE,SAAS,SAAS;YAAM;YAC/D,QAAQ,GAAG,CAAC,QAAQ,MAAM;YAC1B,iCAAW,MAAM,MAAM;QAC3B;QACA,OAAO,kBAAkB,CAAC,QAAQ,QAAQ;IAC9C;IACA,QAAQ,IAAI;AACd;AAEA,yCAAmB,iCAAW,OAAO;AACrC,yCAAmB,iCAAW,UAAU;AACxC,yCAAmB,iCAAW,UAAU;AACxC,yCAAmB,iCAAW,WAAW","sources":["src/index.ts","assets/bundle.js","node_modules/web-serial-polyfill/dist/serial.js","node_modules/web-serial-polyfill/serial.ts"],"sourcesContent":["const baudrates = document.getElementById(\"baudrates\") as HTMLSelectElement;\nconst connectButton = document.getElementById(\"connectButton\") as HTMLButtonElement;\nconst traceButton = document.getElementById(\"copyTraceButton\") as HTMLButtonElement;\nconst disconnectButton = document.getElementById(\"disconnectButton\") as HTMLButtonElement;\nconst resetButton = document.getElementById(\"resetButton\") as HTMLButtonElement;\nconst eraseButton = document.getElementById(\"eraseButton\") as HTMLButtonElement;\nconst programButton = document.getElementById(\"programButton\");\nconst filesDiv = document.getElementById(\"files\");\nconst terminal = document.getElementById(\"terminal\");\nconst programDiv = document.getElementById(\"program\");\nconst lblBaudrate = document.getElementById(\"lblBaudrate\");\nconst lblConnTo = document.getElementById(\"lblConnTo\");\nconst table = document.getElementById(\"fileTable\") as HTMLTableElement;\n\nimport { ESPLoader, FlashOptions, LoaderOptions, Transport } from \"../assets/bundle.js\";\nimport { serial } from \"web-serial-polyfill\";\nif (!navigator.serial && navigator.usb) navigator.serial = serial;\n\ndeclare let Terminal; // Terminal is imported in HTML script\ndeclare let CryptoJS; // CryptoJS is imported in HTML script\n\nconst term = new Terminal({ cols: 120, rows: 40 });\nterm.open(terminal);\n\nlet device = null;\nlet transport: Transport;\nlet chip: string = null;\nlet esploader: ESPLoader;\n\nconst fileArray = [];\n\ndisconnectButton.style.display = \"none\";\ntraceButton.style.display = \"none\";\neraseButton.style.display = \"none\";\nresetButton.style.display = \"none\";\nfilesDiv.style.display = \"none\";\n\nconst espLoaderTerminal = {\n clean() {\n term.clear();\n },\n writeLine(data) {\n term.writeln(data);\n },\n write(data) {\n term.write(data);\n },\n};\n\nfunction cleanUp() {\n device = null;\n transport = null;\n chip = null;\n}\n\ntraceButton.onclick = async () => {\n if (transport) {\n transport.returnTrace();\n }\n};\n\nresetButton.onclick = async () => {\n if (transport) {\n await transport.setDTR(false);\n await new Promise((resolve) => setTimeout(resolve, 100));\n await transport.setDTR(true);\n }\n};\n\neraseButton.onclick = async () => {\n eraseButton.disabled = true;\n try {\n await esploader.eraseFlash();\n } catch (e) {\n console.error(e);\n term.writeln(`Error: ${e.message}`);\n } finally {\n eraseButton.disabled = false;\n }\n};\n\nconnectButton.onclick = async () => {\n if (device === null) {\n device = await navigator.serial.requestPort({});\n transport = new Transport(device, true);\n }\n\n try {\n const flashOptions = {\n transport,\n baudrate: parseInt(baudrates.value),\n terminal: espLoaderTerminal,\n } as LoaderOptions;\n esploader = new ESPLoader(flashOptions);\n\n lblBaudrate.style.display = \"none\";\n baudrates.style.display = \"none\";\n connectButton.style.display = \"none\";\n\n chip = await esploader.main();\n\n if(!chip.startsWith(\"ESP32-C6\")){\n term.writeln(\"Error! Wrong chip connected. Expected is ESP32-C6\");\n await transport.disconnect();\n cleanUp();\n lblBaudrate.style.display = \"initial\";\n baudrates.style.display = \"initial\";\n connectButton.style.display = \"initial\";\n return;\n }\n } catch (e) {\n console.error(e);\n term.writeln(\"\");\n term.writeln(`Error: ${e.message}`);\n await transport.disconnect();\n cleanUp();\n lblBaudrate.style.display = \"initial\";\n baudrates.style.display = \"initial\";\n connectButton.style.display = \"initial\";\n return;\n }\n\n console.log(\"Settings done for :\" + chip);\n lblBaudrate.style.display = \"none\";\n baudrates.style.display = \"none\";\n lblConnTo.innerHTML = \"Connected to device: \" + chip;\n lblConnTo.style.display = \"block\";\n connectButton.style.display = \"none\";\n disconnectButton.style.display = \"initial\";\n traceButton.style.display = \"initial\";\n eraseButton.style.display = \"initial\";\n filesDiv.style.display = \"initial\";\n};\n\ndisconnectButton.onclick = async () => {\n if (transport) await transport.disconnect();\n\n term.reset();\n lblBaudrate.style.display = \"initial\";\n baudrates.style.display = \"initial\";\n connectButton.style.display = \"initial\";\n disconnectButton.style.display = \"none\";\n traceButton.style.display = \"none\";\n eraseButton.style.display = \"none\";\n lblConnTo.style.display = \"none\";\n filesDiv.style.display = \"none\";\n programButton.style.display = \"initial\";\n resetButton.style.display = \"none\";\n for (let index = 1; index < table.rows.length; index++) {\n table.rows[index].cells[3].childNodes[0].value = \"0\";\n }\n cleanUp();\n};\n\nprogramButton.onclick = async () => {\n const progressBars = [];\n\n for (let index = 1; index < table.rows.length; index++) {\n const row = table.rows[index];\n const progressBar = row.cells[3].childNodes[0];\n\n progressBar.textContent = \"0\";\n progressBars.push(progressBar);\n }\n\n try {\n const flashOptions: FlashOptions = {\n fileArray: fileArray,\n eraseAll: false,\n compress: true,\n flashSize: \"keep\",\n flashFreq: \"80MHz\",\n flashMode: \"DIO\",\n reportProgress: (fileIndex, written, total) => {\n progressBars[fileIndex].value = (written / total) * 100;\n },\n calculateMD5Hash: (image) => CryptoJS.MD5(CryptoJS.enc.Latin1.parse(image)),\n } as FlashOptions;\n programButton.style.display = \"none\";\n eraseButton.style.display = \"none\";\n await esploader.writeFlash(flashOptions);\n } catch (e) {\n console.error(e);\n programButton.style.display = \"initial\";\n term.writeln(`Error: ${e.message}`);\n } finally {\n // Switch to console\n await transport.disconnect();\n await transport.connect(115200);\n await transport.setDTR(false);\n await new Promise((resolve) => setTimeout(resolve, 100));\n await transport.setDTR(true);\n resetButton.style.display = \"initial\";\n while (true) {\n const val = await transport.rawRead();\n if (typeof val !== \"undefined\") {\n term.write(val);\n } else {\n console.log(\"Leaving monitor\");\n break;\n }\n }\n }\n};\n\n// addFileButton.onclick = () => {\nfunction addFileRow(addr, path, size) {\n const rowCount = table.rows.length;\n const row = table.insertRow(rowCount);\n\n //Column 1 - Offset\n const cell1 = row.insertCell(0);\n const element1 = document.createElement(\"span\");\n element1.innerHTML = addr;\n cell1.appendChild(element1);\n\n // Column 2 - File selector\n const cell2 = row.insertCell(1);\n const element2 = document.createElement(\"span\");\n element2.innerHTML = path;\n cell2.appendChild(element2);\n\n // Column 3 - File Size\n const cell3 = row.insertCell(2);\n const element3 = document.createElement(\"span\");\n element3.innerHTML = size+\" B\";\n cell3.appendChild(element3);\n\n // Column 4 - Progress\n const cell4 = row.insertCell(3);\n cell4.classList.add(\"progress-cell\");\n cell4.innerHTML = ``;\n};\n\nfunction addFileForFlashing(outArray, addr, path) {\n console.log(\"load\", addr, path);\n var request = new XMLHttpRequest();\n request.open('GET', path, true);\n request.responseType = 'blob';\n request.onload = function() {\n console.log(\"blob\", addr, path, request.response);\n var size = request.response.size;\n var reader = new FileReader();\n reader.onload = function(e){\n outArray.push({ data: e.target.result, address: parseInt(addr) });\n console.log(\"push\", addr, path);\n addFileRow(addr, path, size);\n };\n reader.readAsBinaryString(request.response);\n };\n request.send();\n}\n\naddFileForFlashing(fileArray, \"0x0\", \"bootloader.bin\");\naddFileForFlashing(fileArray, \"0x8000\", \"partition-table.bin\");\naddFileForFlashing(fileArray, \"0xd000\", \"ota_data_initial.bin\");\naddFileForFlashing(fileArray, \"0x10000\", \"network_adapter.bin\");\n","class A extends Error{}\n/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */function t(A){let t=A.length;for(;--t>=0;)A[t]=0}const e=256,i=286,s=30,a=15,n=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),E=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),h=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),r=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),g=new Array(576);t(g);const o=new Array(60);t(o);const B=new Array(512);t(B);const w=new Array(256);t(w);const c=new Array(29);t(c);const C=new Array(s);function I(A,t,e,i,s){this.static_tree=A,this.extra_bits=t,this.extra_base=e,this.elems=i,this.max_length=s,this.has_stree=A&&A.length}let _,l,d;function M(A,t){this.dyn_tree=A,this.max_code=0,this.stat_desc=t}t(C);const D=A=>A<256?B[A]:B[256+(A>>>7)],R=(A,t)=>{A.pending_buf[A.pending++]=255&t,A.pending_buf[A.pending++]=t>>>8&255},S=(A,t,e)=>{A.bi_valid>16-e?(A.bi_buf|=t<>16-A.bi_valid,A.bi_valid+=e-16):(A.bi_buf|=t<{S(A,e[2*t],e[2*t+1])},f=(A,t)=>{let e=0;do{e|=1&A,A>>>=1,e<<=1}while(--t>0);return e>>>1},F=(A,t,e)=>{const i=new Array(16);let s,n,E=0;for(s=1;s<=a;s++)E=E+e[s-1]<<1,i[s]=E;for(n=0;n<=t;n++){let t=A[2*n+1];0!==t&&(A[2*n]=f(i[t]++,t))}},T=A=>{let t;for(t=0;t{A.bi_valid>8?R(A,A.bi_buf):A.bi_valid>0&&(A.pending_buf[A.pending++]=A.bi_buf),A.bi_buf=0,A.bi_valid=0},p=(A,t,e,i)=>{const s=2*t,a=2*e;return A[s]{const i=A.heap[e];let s=e<<1;for(;s<=A.heap_len&&(s{let s,a,h,r,g=0;if(0!==A.sym_next)do{s=255&A.pending_buf[A.sym_buf+g++],s+=(255&A.pending_buf[A.sym_buf+g++])<<8,a=A.pending_buf[A.sym_buf+g++],0===s?Q(A,a,t):(h=w[a],Q(A,h+e+1,t),r=n[h],0!==r&&(a-=c[h],S(A,a,r)),s--,h=D(s),Q(A,h,i),r=E[h],0!==r&&(s-=C[h],S(A,s,r)))}while(g{const e=t.dyn_tree,i=t.stat_desc.static_tree,s=t.stat_desc.has_stree,n=t.stat_desc.elems;let E,h,r,g=-1;for(A.heap_len=0,A.heap_max=573,E=0;E>1;E>=1;E--)y(A,e,E);r=n;do{E=A.heap[1],A.heap[1]=A.heap[A.heap_len--],y(A,e,1),h=A.heap[1],A.heap[--A.heap_max]=E,A.heap[--A.heap_max]=h,e[2*r]=e[2*E]+e[2*h],A.depth[r]=(A.depth[E]>=A.depth[h]?A.depth[E]:A.depth[h])+1,e[2*E+1]=e[2*h+1]=r,A.heap[1]=r++,y(A,e,1)}while(A.heap_len>=2);A.heap[--A.heap_max]=A.heap[1],((A,t)=>{const e=t.dyn_tree,i=t.max_code,s=t.stat_desc.static_tree,n=t.stat_desc.has_stree,E=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,r=t.stat_desc.max_length;let g,o,B,w,c,C,I=0;for(w=0;w<=a;w++)A.bl_count[w]=0;for(e[2*A.heap[A.heap_max]+1]=0,g=A.heap_max+1;g<573;g++)o=A.heap[g],w=e[2*e[2*o+1]+1]+1,w>r&&(w=r,I++),e[2*o+1]=w,o>i||(A.bl_count[w]++,c=0,o>=h&&(c=E[o-h]),C=e[2*o],A.opt_len+=C*(w+c),n&&(A.static_len+=C*(s[2*o+1]+c)));if(0!==I){do{for(w=r-1;0===A.bl_count[w];)w--;A.bl_count[w]--,A.bl_count[w+1]+=2,A.bl_count[r]--,I-=2}while(I>0);for(w=r;0!==w;w--)for(o=A.bl_count[w];0!==o;)B=A.heap[--g],B>i||(e[2*B+1]!==w&&(A.opt_len+=(w-e[2*B+1])*e[2*B],e[2*B+1]=w),o--)}})(A,t),F(e,g,A.bl_count)},P=(A,t,e)=>{let i,s,a=-1,n=t[1],E=0,h=7,r=4;for(0===n&&(h=138,r=3),t[2*(e+1)+1]=65535,i=0;i<=e;i++)s=n,n=t[2*(i+1)+1],++E{let i,s,a=-1,n=t[1],E=0,h=7,r=4;for(0===n&&(h=138,r=3),i=0;i<=e;i++)if(s=n,n=t[2*(i+1)+1],!(++E{S(A,0+(i?1:0),3),u(A),R(A,e),R(A,~e),e&&A.pending_buf.set(A.window.subarray(t,t+e),A.pending),A.pending+=e};var m=(A,t,i,s)=>{let a,n,E=0;A.level>0?(2===A.strm.data_type&&(A.strm.data_type=(A=>{let t,i=4093624447;for(t=0;t<=31;t++,i>>>=1)if(1&i&&0!==A.dyn_ltree[2*t])return 0;if(0!==A.dyn_ltree[18]||0!==A.dyn_ltree[20]||0!==A.dyn_ltree[26])return 1;for(t=32;t{let t;for(P(A,A.dyn_ltree,A.l_desc.max_code),P(A,A.dyn_dtree,A.d_desc.max_code),H(A,A.bl_desc),t=18;t>=3&&0===A.bl_tree[2*r[t]+1];t--);return A.opt_len+=3*(t+1)+5+5+4,t})(A),a=A.opt_len+3+7>>>3,n=A.static_len+3+7>>>3,n<=a&&(a=n)):a=n=i+5,i+4<=a&&-1!==t?G(A,t,i,s):4===A.strategy||n===a?(S(A,2+(s?1:0),3),k(A,g,o)):(S(A,4+(s?1:0),3),((A,t,e,i)=>{let s;for(S(A,t-257,5),S(A,e-1,5),S(A,i-4,4),s=0;s{U||((()=>{let A,t,e,r,M;const D=new Array(16);for(e=0,r=0;r<28;r++)for(c[r]=e,A=0;A<1<>=7;r(A.pending_buf[A.sym_buf+A.sym_next++]=t,A.pending_buf[A.sym_buf+A.sym_next++]=t>>8,A.pending_buf[A.sym_buf+A.sym_next++]=i,0===t?A.dyn_ltree[2*i]++:(A.matches++,t--,A.dyn_ltree[2*(w[i]+e+1)]++,A.dyn_dtree[2*D(t)]++),A.sym_next===A.sym_end),_tr_align:A=>{S(A,2,3),Q(A,256,g),(A=>{16===A.bi_valid?(R(A,A.bi_buf),A.bi_buf=0,A.bi_valid=0):A.bi_valid>=8&&(A.pending_buf[A.pending++]=255&A.bi_buf,A.bi_buf>>=8,A.bi_valid-=8)})(A)}};var b=(A,t,e,i)=>{let s=65535&A|0,a=A>>>16&65535|0,n=0;for(;0!==e;){n=e>2e3?2e3:e,e-=n;do{s=s+t[i++]|0,a=a+s|0}while(--n);s%=65521,a%=65521}return s|a<<16|0};const K=new Uint32Array((()=>{let A,t=[];for(var e=0;e<256;e++){A=e;for(var i=0;i<8;i++)A=1&A?3988292384^A>>>1:A>>>1;t[e]=A}return t})());var x=(A,t,e,i)=>{const s=K,a=i+e;A^=-1;for(let e=i;e>>8^s[255&(A^t[e])];return-1^A},L={2:\"need dictionary\",1:\"stream end\",0:\"\",\"-1\":\"file error\",\"-2\":\"stream error\",\"-3\":\"data error\",\"-4\":\"insufficient memory\",\"-5\":\"buffer error\",\"-6\":\"incompatible version\"},J={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:z,_tr_stored_block:N,_tr_flush_block:v,_tr_tally:j,_tr_align:Z}=Y,{Z_NO_FLUSH:W,Z_PARTIAL_FLUSH:X,Z_FULL_FLUSH:q,Z_FINISH:V,Z_BLOCK:$,Z_OK:AA,Z_STREAM_END:tA,Z_STREAM_ERROR:eA,Z_DATA_ERROR:iA,Z_BUF_ERROR:sA,Z_DEFAULT_COMPRESSION:aA,Z_FILTERED:nA,Z_HUFFMAN_ONLY:EA,Z_RLE:hA,Z_FIXED:rA,Z_DEFAULT_STRATEGY:gA,Z_UNKNOWN:oA,Z_DEFLATED:BA}=J,wA=258,cA=262,CA=42,IA=113,_A=666,lA=(A,t)=>(A.msg=L[t],t),dA=A=>2*A-(A>4?9:0),MA=A=>{let t=A.length;for(;--t>=0;)A[t]=0},DA=A=>{let t,e,i,s=A.w_size;t=A.hash_size,i=t;do{e=A.head[--i],A.head[i]=e>=s?e-s:0}while(--t);t=s,i=t;do{e=A.prev[--i],A.prev[i]=e>=s?e-s:0}while(--t)};let RA=(A,t,e)=>(t<{const t=A.state;let e=t.pending;e>A.avail_out&&(e=A.avail_out),0!==e&&(A.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+e),A.next_out),A.next_out+=e,t.pending_out+=e,A.total_out+=e,A.avail_out-=e,t.pending-=e,0===t.pending&&(t.pending_out=0))},QA=(A,t)=>{v(A,A.block_start>=0?A.block_start:-1,A.strstart-A.block_start,t),A.block_start=A.strstart,SA(A.strm)},fA=(A,t)=>{A.pending_buf[A.pending++]=t},FA=(A,t)=>{A.pending_buf[A.pending++]=t>>>8&255,A.pending_buf[A.pending++]=255&t},TA=(A,t,e,i)=>{let s=A.avail_in;return s>i&&(s=i),0===s?0:(A.avail_in-=s,t.set(A.input.subarray(A.next_in,A.next_in+s),e),1===A.state.wrap?A.adler=b(A.adler,t,s,e):2===A.state.wrap&&(A.adler=x(A.adler,t,s,e)),A.next_in+=s,A.total_in+=s,s)},uA=(A,t)=>{let e,i,s=A.max_chain_length,a=A.strstart,n=A.prev_length,E=A.nice_match;const h=A.strstart>A.w_size-cA?A.strstart-(A.w_size-cA):0,r=A.window,g=A.w_mask,o=A.prev,B=A.strstart+wA;let w=r[a+n-1],c=r[a+n];A.prev_length>=A.good_match&&(s>>=2),E>A.lookahead&&(E=A.lookahead);do{if(e=t,r[e+n]===c&&r[e+n-1]===w&&r[e]===r[a]&&r[++e]===r[a+1]){a+=2,e++;do{}while(r[++a]===r[++e]&&r[++a]===r[++e]&&r[++a]===r[++e]&&r[++a]===r[++e]&&r[++a]===r[++e]&&r[++a]===r[++e]&&r[++a]===r[++e]&&r[++a]===r[++e]&&an){if(A.match_start=t,n=i,i>=E)break;w=r[a+n-1],c=r[a+n]}}}while((t=o[t&g])>h&&0!=--s);return n<=A.lookahead?n:A.lookahead},pA=A=>{const t=A.w_size;let e,i,s;do{if(i=A.window_size-A.lookahead-A.strstart,A.strstart>=t+(t-cA)&&(A.window.set(A.window.subarray(t,t+t-i),0),A.match_start-=t,A.strstart-=t,A.block_start-=t,A.insert>A.strstart&&(A.insert=A.strstart),DA(A),i+=t),0===A.strm.avail_in)break;if(e=TA(A.strm,A.window,A.strstart+A.lookahead,i),A.lookahead+=e,A.lookahead+A.insert>=3)for(s=A.strstart-A.insert,A.ins_h=A.window[s],A.ins_h=RA(A,A.ins_h,A.window[s+1]);A.insert&&(A.ins_h=RA(A,A.ins_h,A.window[s+3-1]),A.prev[s&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=s,s++,A.insert--,!(A.lookahead+A.insert<3)););}while(A.lookahead{let e,i,s,a=A.pending_buf_size-5>A.w_size?A.w_size:A.pending_buf_size-5,n=0,E=A.strm.avail_in;do{if(e=65535,s=A.bi_valid+42>>3,A.strm.avail_outi+A.strm.avail_in&&(e=i+A.strm.avail_in),e>s&&(e=s),e>8,A.pending_buf[A.pending-2]=~e,A.pending_buf[A.pending-1]=~e>>8,SA(A.strm),i&&(i>e&&(i=e),A.strm.output.set(A.window.subarray(A.block_start,A.block_start+i),A.strm.next_out),A.strm.next_out+=i,A.strm.avail_out-=i,A.strm.total_out+=i,A.block_start+=i,e-=i),e&&(TA(A.strm,A.strm.output,A.strm.next_out,e),A.strm.next_out+=e,A.strm.avail_out-=e,A.strm.total_out+=e)}while(0===n);return E-=A.strm.avail_in,E&&(E>=A.w_size?(A.matches=2,A.window.set(A.strm.input.subarray(A.strm.next_in-A.w_size,A.strm.next_in),0),A.strstart=A.w_size,A.insert=A.strstart):(A.window_size-A.strstart<=E&&(A.strstart-=A.w_size,A.window.set(A.window.subarray(A.w_size,A.w_size+A.strstart),0),A.matches<2&&A.matches++,A.insert>A.strstart&&(A.insert=A.strstart)),A.window.set(A.strm.input.subarray(A.strm.next_in-E,A.strm.next_in),A.strstart),A.strstart+=E,A.insert+=E>A.w_size-A.insert?A.w_size-A.insert:E),A.block_start=A.strstart),A.high_waters&&A.block_start>=A.w_size&&(A.block_start-=A.w_size,A.strstart-=A.w_size,A.window.set(A.window.subarray(A.w_size,A.w_size+A.strstart),0),A.matches<2&&A.matches++,s+=A.w_size,A.insert>A.strstart&&(A.insert=A.strstart)),s>A.strm.avail_in&&(s=A.strm.avail_in),s&&(TA(A.strm,A.window,A.strstart,s),A.strstart+=s,A.insert+=s>A.w_size-A.insert?A.w_size-A.insert:s),A.high_water>3,s=A.pending_buf_size-s>65535?65535:A.pending_buf_size-s,a=s>A.w_size?A.w_size:s,i=A.strstart-A.block_start,(i>=a||(i||t===V)&&t!==W&&0===A.strm.avail_in&&i<=s)&&(e=i>s?s:i,n=t===V&&0===A.strm.avail_in&&e===i?1:0,N(A,A.block_start,e,n),A.block_start+=e,SA(A.strm)),n?3:1)},kA=(A,t)=>{let e,i;for(;;){if(A.lookahead=3&&(A.ins_h=RA(A,A.ins_h,A.window[A.strstart+3-1]),e=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),0!==e&&A.strstart-e<=A.w_size-cA&&(A.match_length=uA(A,e)),A.match_length>=3)if(i=j(A,A.strstart-A.match_start,A.match_length-3),A.lookahead-=A.match_length,A.match_length<=A.max_lazy_match&&A.lookahead>=3){A.match_length--;do{A.strstart++,A.ins_h=RA(A,A.ins_h,A.window[A.strstart+3-1]),e=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart}while(0!=--A.match_length);A.strstart++}else A.strstart+=A.match_length,A.match_length=0,A.ins_h=A.window[A.strstart],A.ins_h=RA(A,A.ins_h,A.window[A.strstart+1]);else i=j(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++;if(i&&(QA(A,!1),0===A.strm.avail_out))return 1}return A.insert=A.strstart<2?A.strstart:2,t===V?(QA(A,!0),0===A.strm.avail_out?3:4):A.sym_next&&(QA(A,!1),0===A.strm.avail_out)?1:2},HA=(A,t)=>{let e,i,s;for(;;){if(A.lookahead=3&&(A.ins_h=RA(A,A.ins_h,A.window[A.strstart+3-1]),e=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),A.prev_length=A.match_length,A.prev_match=A.match_start,A.match_length=2,0!==e&&A.prev_length4096)&&(A.match_length=2)),A.prev_length>=3&&A.match_length<=A.prev_length){s=A.strstart+A.lookahead-3,i=j(A,A.strstart-1-A.prev_match,A.prev_length-3),A.lookahead-=A.prev_length-1,A.prev_length-=2;do{++A.strstart<=s&&(A.ins_h=RA(A,A.ins_h,A.window[A.strstart+3-1]),e=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart)}while(0!=--A.prev_length);if(A.match_available=0,A.match_length=2,A.strstart++,i&&(QA(A,!1),0===A.strm.avail_out))return 1}else if(A.match_available){if(i=j(A,0,A.window[A.strstart-1]),i&&QA(A,!1),A.strstart++,A.lookahead--,0===A.strm.avail_out)return 1}else A.match_available=1,A.strstart++,A.lookahead--}return A.match_available&&(i=j(A,0,A.window[A.strstart-1]),A.match_available=0),A.insert=A.strstart<2?A.strstart:2,t===V?(QA(A,!0),0===A.strm.avail_out?3:4):A.sym_next&&(QA(A,!1),0===A.strm.avail_out)?1:2};function PA(A,t,e,i,s){this.good_length=A,this.max_lazy=t,this.nice_length=e,this.max_chain=i,this.func=s}const OA=[new PA(0,0,0,0,yA),new PA(4,4,8,4,kA),new PA(4,5,16,8,kA),new PA(4,6,32,32,kA),new PA(4,4,16,16,HA),new PA(8,16,32,32,HA),new PA(8,16,128,128,HA),new PA(8,32,128,256,HA),new PA(32,128,258,1024,HA),new PA(32,258,258,4096,HA)];function UA(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=BA,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),MA(this.dyn_ltree),MA(this.dyn_dtree),MA(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),MA(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),MA(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const GA=A=>{if(!A)return 1;const t=A.state;return!t||t.strm!==A||t.status!==CA&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==IA&&t.status!==_A?1:0},mA=A=>{if(GA(A))return lA(A,eA);A.total_in=A.total_out=0,A.data_type=oA;const t=A.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?CA:IA,A.adler=2===t.wrap?0:1,t.last_flush=-2,z(t),AA},YA=A=>{const t=mA(A);var e;return t===AA&&((e=A.state).window_size=2*e.w_size,MA(e.head),e.max_lazy_match=OA[e.level].max_lazy,e.good_match=OA[e.level].good_length,e.nice_match=OA[e.level].nice_length,e.max_chain_length=OA[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),t},bA=(A,t,e,i,s,a)=>{if(!A)return eA;let n=1;if(t===aA&&(t=6),i<0?(n=0,i=-i):i>15&&(n=2,i-=16),s<1||s>9||e!==BA||i<8||i>15||t<0||t>9||a<0||a>rA||8===i&&1!==n)return lA(A,eA);8===i&&(i=9);const E=new UA;return A.state=E,E.strm=A,E.status=CA,E.wrap=n,E.gzhead=null,E.w_bits=i,E.w_size=1<bA(A,t,BA,15,8,gA),deflateInit2:bA,deflateReset:YA,deflateResetKeep:mA,deflateSetHeader:(A,t)=>GA(A)||2!==A.state.wrap?eA:(A.state.gzhead=t,AA),deflate:(A,t)=>{if(GA(A)||t>$||t<0)return A?lA(A,eA):eA;const e=A.state;if(!A.output||0!==A.avail_in&&!A.input||e.status===_A&&t!==V)return lA(A,0===A.avail_out?sA:eA);const i=e.last_flush;if(e.last_flush=t,0!==e.pending){if(SA(A),0===A.avail_out)return e.last_flush=-1,AA}else if(0===A.avail_in&&dA(t)<=dA(i)&&t!==V)return lA(A,sA);if(e.status===_A&&0!==A.avail_in)return lA(A,sA);if(e.status===CA&&0===e.wrap&&(e.status=IA),e.status===CA){let t=BA+(e.w_bits-8<<4)<<8,i=-1;if(i=e.strategy>=EA||e.level<2?0:e.level<6?1:6===e.level?2:3,t|=i<<6,0!==e.strstart&&(t|=32),t+=31-t%31,FA(e,t),0!==e.strstart&&(FA(e,A.adler>>>16),FA(e,65535&A.adler)),A.adler=1,e.status=IA,SA(A),0!==e.pending)return e.last_flush=-1,AA}if(57===e.status)if(A.adler=0,fA(e,31),fA(e,139),fA(e,8),e.gzhead)fA(e,(e.gzhead.text?1:0)+(e.gzhead.hcrc?2:0)+(e.gzhead.extra?4:0)+(e.gzhead.name?8:0)+(e.gzhead.comment?16:0)),fA(e,255&e.gzhead.time),fA(e,e.gzhead.time>>8&255),fA(e,e.gzhead.time>>16&255),fA(e,e.gzhead.time>>24&255),fA(e,9===e.level?2:e.strategy>=EA||e.level<2?4:0),fA(e,255&e.gzhead.os),e.gzhead.extra&&e.gzhead.extra.length&&(fA(e,255&e.gzhead.extra.length),fA(e,e.gzhead.extra.length>>8&255)),e.gzhead.hcrc&&(A.adler=x(A.adler,e.pending_buf,e.pending,0)),e.gzindex=0,e.status=69;else if(fA(e,0),fA(e,0),fA(e,0),fA(e,0),fA(e,0),fA(e,9===e.level?2:e.strategy>=EA||e.level<2?4:0),fA(e,3),e.status=IA,SA(A),0!==e.pending)return e.last_flush=-1,AA;if(69===e.status){if(e.gzhead.extra){let t=e.pending,i=(65535&e.gzhead.extra.length)-e.gzindex;for(;e.pending+i>e.pending_buf_size;){let s=e.pending_buf_size-e.pending;if(e.pending_buf.set(e.gzhead.extra.subarray(e.gzindex,e.gzindex+s),e.pending),e.pending=e.pending_buf_size,e.gzhead.hcrc&&e.pending>t&&(A.adler=x(A.adler,e.pending_buf,e.pending-t,t)),e.gzindex+=s,SA(A),0!==e.pending)return e.last_flush=-1,AA;t=0,i-=s}let s=new Uint8Array(e.gzhead.extra);e.pending_buf.set(s.subarray(e.gzindex,e.gzindex+i),e.pending),e.pending+=i,e.gzhead.hcrc&&e.pending>t&&(A.adler=x(A.adler,e.pending_buf,e.pending-t,t)),e.gzindex=0}e.status=73}if(73===e.status){if(e.gzhead.name){let t,i=e.pending;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>i&&(A.adler=x(A.adler,e.pending_buf,e.pending-i,i)),SA(A),0!==e.pending)return e.last_flush=-1,AA;i=0}t=e.gzindexi&&(A.adler=x(A.adler,e.pending_buf,e.pending-i,i)),e.gzindex=0}e.status=91}if(91===e.status){if(e.gzhead.comment){let t,i=e.pending;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>i&&(A.adler=x(A.adler,e.pending_buf,e.pending-i,i)),SA(A),0!==e.pending)return e.last_flush=-1,AA;i=0}t=e.gzindexi&&(A.adler=x(A.adler,e.pending_buf,e.pending-i,i))}e.status=103}if(103===e.status){if(e.gzhead.hcrc){if(e.pending+2>e.pending_buf_size&&(SA(A),0!==e.pending))return e.last_flush=-1,AA;fA(e,255&A.adler),fA(e,A.adler>>8&255),A.adler=0}if(e.status=IA,SA(A),0!==e.pending)return e.last_flush=-1,AA}if(0!==A.avail_in||0!==e.lookahead||t!==W&&e.status!==_A){let i=0===e.level?yA(e,t):e.strategy===EA?((A,t)=>{let e;for(;;){if(0===A.lookahead&&(pA(A),0===A.lookahead)){if(t===W)return 1;break}if(A.match_length=0,e=j(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++,e&&(QA(A,!1),0===A.strm.avail_out))return 1}return A.insert=0,t===V?(QA(A,!0),0===A.strm.avail_out?3:4):A.sym_next&&(QA(A,!1),0===A.strm.avail_out)?1:2})(e,t):e.strategy===hA?((A,t)=>{let e,i,s,a;const n=A.window;for(;;){if(A.lookahead<=wA){if(pA(A),A.lookahead<=wA&&t===W)return 1;if(0===A.lookahead)break}if(A.match_length=0,A.lookahead>=3&&A.strstart>0&&(s=A.strstart-1,i=n[s],i===n[++s]&&i===n[++s]&&i===n[++s])){a=A.strstart+wA;do{}while(i===n[++s]&&i===n[++s]&&i===n[++s]&&i===n[++s]&&i===n[++s]&&i===n[++s]&&i===n[++s]&&i===n[++s]&&sA.lookahead&&(A.match_length=A.lookahead)}if(A.match_length>=3?(e=j(A,1,A.match_length-3),A.lookahead-=A.match_length,A.strstart+=A.match_length,A.match_length=0):(e=j(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++),e&&(QA(A,!1),0===A.strm.avail_out))return 1}return A.insert=0,t===V?(QA(A,!0),0===A.strm.avail_out?3:4):A.sym_next&&(QA(A,!1),0===A.strm.avail_out)?1:2})(e,t):OA[e.level].func(e,t);if(3!==i&&4!==i||(e.status=_A),1===i||3===i)return 0===A.avail_out&&(e.last_flush=-1),AA;if(2===i&&(t===X?Z(e):t!==$&&(N(e,0,0,!1),t===q&&(MA(e.head),0===e.lookahead&&(e.strstart=0,e.block_start=0,e.insert=0))),SA(A),0===A.avail_out))return e.last_flush=-1,AA}return t!==V?AA:e.wrap<=0?tA:(2===e.wrap?(fA(e,255&A.adler),fA(e,A.adler>>8&255),fA(e,A.adler>>16&255),fA(e,A.adler>>24&255),fA(e,255&A.total_in),fA(e,A.total_in>>8&255),fA(e,A.total_in>>16&255),fA(e,A.total_in>>24&255)):(FA(e,A.adler>>>16),FA(e,65535&A.adler)),SA(A),e.wrap>0&&(e.wrap=-e.wrap),0!==e.pending?AA:tA)},deflateEnd:A=>{if(GA(A))return eA;const t=A.state.status;return A.state=null,t===IA?lA(A,iA):AA},deflateSetDictionary:(A,t)=>{let e=t.length;if(GA(A))return eA;const i=A.state,s=i.wrap;if(2===s||1===s&&i.status!==CA||i.lookahead)return eA;if(1===s&&(A.adler=b(A.adler,t,e,0)),i.wrap=0,e>=i.w_size){0===s&&(MA(i.head),i.strstart=0,i.block_start=0,i.insert=0);let A=new Uint8Array(i.w_size);A.set(t.subarray(e-i.w_size,e),0),t=A,e=i.w_size}const a=A.avail_in,n=A.next_in,E=A.input;for(A.avail_in=e,A.next_in=0,A.input=t,pA(i);i.lookahead>=3;){let A=i.strstart,t=i.lookahead-2;do{i.ins_h=RA(i,i.ins_h,i.window[A+3-1]),i.prev[A&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=A,A++}while(--t);i.strstart=A,i.lookahead=2,pA(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,A.next_in=n,A.input=E,A.avail_in=a,i.wrap=s,AA},deflateInfo:\"pako deflate (from Nodeca project)\"};const xA=(A,t)=>Object.prototype.hasOwnProperty.call(A,t);var LA={assign:function(A){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const e=t.shift();if(e){if(\"object\"!=typeof e)throw new TypeError(e+\"must be non-object\");for(const t in e)xA(e,t)&&(A[t]=e[t])}}return A},flattenChunks:A=>{let t=0;for(let e=0,i=A.length;e=252?6:A>=248?5:A>=240?4:A>=224?3:A>=192?2:1;zA[254]=zA[254]=1;var NA={string2buf:A=>{if(\"function\"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(A);let t,e,i,s,a,n=A.length,E=0;for(s=0;s>>6,t[a++]=128|63&e):e<65536?(t[a++]=224|e>>>12,t[a++]=128|e>>>6&63,t[a++]=128|63&e):(t[a++]=240|e>>>18,t[a++]=128|e>>>12&63,t[a++]=128|e>>>6&63,t[a++]=128|63&e);return t},buf2string:(A,t)=>{const e=t||A.length;if(\"function\"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(A.subarray(0,t));let i,s;const a=new Array(2*e);for(s=0,i=0;i4)a[s++]=65533,i+=n-1;else{for(t&=2===n?31:3===n?15:7;n>1&&i1?a[s++]=65533:t<65536?a[s++]=t:(t-=65536,a[s++]=55296|t>>10&1023,a[s++]=56320|1023&t)}}return((A,t)=>{if(t<65534&&A.subarray&&JA)return String.fromCharCode.apply(null,A.length===t?A:A.subarray(0,t));let e=\"\";for(let i=0;i{(t=t||A.length)>A.length&&(t=A.length);let e=t-1;for(;e>=0&&128==(192&A[e]);)e--;return e<0||0===e?t:e+zA[A[e]]>t?e:t}};var vA=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0};const jA=Object.prototype.toString,{Z_NO_FLUSH:ZA,Z_SYNC_FLUSH:WA,Z_FULL_FLUSH:XA,Z_FINISH:qA,Z_OK:VA,Z_STREAM_END:$A,Z_DEFAULT_COMPRESSION:At,Z_DEFAULT_STRATEGY:tt,Z_DEFLATED:et}=J;function it(A){this.options=LA.assign({level:At,method:et,chunkSize:16384,windowBits:15,memLevel:8,strategy:tt},A||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new vA,this.strm.avail_out=0;let e=KA.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==VA)throw new Error(L[e]);if(t.header&&KA.deflateSetHeader(this.strm,t.header),t.dictionary){let A;if(A=\"string\"==typeof t.dictionary?NA.string2buf(t.dictionary):\"[object ArrayBuffer]\"===jA.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,e=KA.deflateSetDictionary(this.strm,A),e!==VA)throw new Error(L[e]);this._dict_set=!0}}function st(A,t){const e=new it(t);if(e.push(A,!0),e.err)throw e.msg||L[e.err];return e.result}it.prototype.push=function(A,t){const e=this.strm,i=this.options.chunkSize;let s,a;if(this.ended)return!1;for(a=t===~~t?t:!0===t?qA:ZA,\"string\"==typeof A?e.input=NA.string2buf(A):\"[object ArrayBuffer]\"===jA.call(A)?e.input=new Uint8Array(A):e.input=A,e.next_in=0,e.avail_in=e.input.length;;)if(0===e.avail_out&&(e.output=new Uint8Array(i),e.next_out=0,e.avail_out=i),(a===WA||a===XA)&&e.avail_out<=6)this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;else{if(s=KA.deflate(e,a),s===$A)return e.next_out>0&&this.onData(e.output.subarray(0,e.next_out)),s=KA.deflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===VA;if(0!==e.avail_out){if(a>0&&e.next_out>0)this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;else if(0===e.avail_in)break}else this.onData(e.output)}return!0},it.prototype.onData=function(A){this.chunks.push(A)},it.prototype.onEnd=function(A){A===VA&&(this.result=LA.flattenChunks(this.chunks)),this.chunks=[],this.err=A,this.msg=this.strm.msg};var at={Deflate:it,deflate:st,deflateRaw:function(A,t){return(t=t||{}).raw=!0,st(A,t)},gzip:function(A,t){return(t=t||{}).gzip=!0,st(A,t)},constants:J};const nt=16209;var Et=function(A,t){let e,i,s,a,n,E,h,r,g,o,B,w,c,C,I,_,l,d,M,D,R,S,Q,f;const F=A.state;e=A.next_in,Q=A.input,i=e+(A.avail_in-5),s=A.next_out,f=A.output,a=s-(t-A.avail_out),n=s+(A.avail_out-257),E=F.dmax,h=F.wsize,r=F.whave,g=F.wnext,o=F.window,B=F.hold,w=F.bits,c=F.lencode,C=F.distcode,I=(1<>>24,B>>>=d,w-=d,d=l>>>16&255,0===d)f[s++]=65535&l;else{if(!(16&d)){if(0==(64&d)){l=c[(65535&l)+(B&(1<>>=d,w-=d),w<15&&(B+=Q[e++]<>>24,B>>>=d,w-=d,d=l>>>16&255,!(16&d)){if(0==(64&d)){l=C[(65535&l)+(B&(1<E){A.msg=\"invalid distance too far back\",F.mode=nt;break A}if(B>>>=d,w-=d,d=s-a,D>d){if(d=D-d,d>r&&F.sane){A.msg=\"invalid distance too far back\",F.mode=nt;break A}if(R=0,S=o,0===g){if(R+=h-d,d2;)f[s++]=S[R++],f[s++]=S[R++],f[s++]=S[R++],M-=3;M&&(f[s++]=S[R++],M>1&&(f[s++]=S[R++]))}else{R=s-D;do{f[s++]=f[R++],f[s++]=f[R++],f[s++]=f[R++],M-=3}while(M>2);M&&(f[s++]=f[R++],M>1&&(f[s++]=f[R++]))}break}}break}}while(e>3,e-=M,w-=M<<3,B&=(1<{const h=E.bits;let r,g,o,B,w,c,C=0,I=0,_=0,l=0,d=0,M=0,D=0,R=0,S=0,Q=0,f=null;const F=new Uint16Array(16),T=new Uint16Array(16);let u,p,y,k=null;for(C=0;C<=ht;C++)F[C]=0;for(I=0;I=1&&0===F[l];l--);if(d>l&&(d=l),0===l)return s[a++]=20971520,s[a++]=20971520,E.bits=1,0;for(_=1;_0&&(0===A||1!==l))return-1;for(T[1]=0,C=1;C852||2===A&&S>592)return 1;for(;;){u=C-D,n[I]+1=c?(p=k[n[I]-c],y=f[n[I]-c]):(p=96,y=0),r=1<>D)+g]=u<<24|p<<16|y|0}while(0!==g);for(r=1<>=1;if(0!==r?(Q&=r-1,Q+=r):Q=0,I++,0==--F[C]){if(C===l)break;C=t[e+n[I]]}if(C>d&&(Q&B)!==o){for(0===D&&(D=d),w+=_,M=C-D,R=1<852||2===A&&S>592)return 1;o=Q&B,s[o]=d<<24|M<<16|w-a|0}}return 0!==Q&&(s[w+Q]=C-D<<24|64<<16|0),E.bits=d,0};const{Z_FINISH:ct,Z_BLOCK:Ct,Z_TREES:It,Z_OK:_t,Z_STREAM_END:lt,Z_NEED_DICT:dt,Z_STREAM_ERROR:Mt,Z_DATA_ERROR:Dt,Z_MEM_ERROR:Rt,Z_BUF_ERROR:St,Z_DEFLATED:Qt}=J,ft=16180,Ft=16190,Tt=16191,ut=16192,pt=16194,yt=16199,kt=16200,Ht=16206,Pt=16209,Ot=A=>(A>>>24&255)+(A>>>8&65280)+((65280&A)<<8)+((255&A)<<24);function Ut(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Gt=A=>{if(!A)return 1;const t=A.state;return!t||t.strm!==A||t.mode16211?1:0},mt=A=>{if(Gt(A))return Mt;const t=A.state;return A.total_in=A.total_out=t.total=0,A.msg=\"\",t.wrap&&(A.adler=1&t.wrap),t.mode=ft,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,_t},Yt=A=>{if(Gt(A))return Mt;const t=A.state;return t.wsize=0,t.whave=0,t.wnext=0,mt(A)},bt=(A,t)=>{let e;if(Gt(A))return Mt;const i=A.state;return t<0?(e=0,t=-t):(e=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Mt:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=e,i.wbits=t,Yt(A))},Kt=(A,t)=>{if(!A)return Mt;const e=new Ut;A.state=e,e.strm=A,e.window=null,e.mode=ft;const i=bt(A,t);return i!==_t&&(A.state=null),i};let xt,Lt,Jt=!0;const zt=A=>{if(Jt){xt=new Int32Array(512),Lt=new Int32Array(32);let t=0;for(;t<144;)A.lens[t++]=8;for(;t<256;)A.lens[t++]=9;for(;t<280;)A.lens[t++]=7;for(;t<288;)A.lens[t++]=8;for(wt(1,A.lens,0,288,xt,0,A.work,{bits:9}),t=0;t<32;)A.lens[t++]=5;wt(2,A.lens,0,32,Lt,0,A.work,{bits:5}),Jt=!1}A.lencode=xt,A.lenbits=9,A.distcode=Lt,A.distbits=5},Nt=(A,t,e,i)=>{let s;const a=A.state;return null===a.window&&(a.wsize=1<=a.wsize?(a.window.set(t.subarray(e-a.wsize,e),0),a.wnext=0,a.whave=a.wsize):(s=a.wsize-a.wnext,s>i&&(s=i),a.window.set(t.subarray(e-i,e-i+s),a.wnext),(i-=s)?(a.window.set(t.subarray(e-i,e),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=s,a.wnext===a.wsize&&(a.wnext=0),a.whaveKt(A,15),inflateInit2:Kt,inflate:(A,t)=>{let e,i,s,a,n,E,h,r,g,o,B,w,c,C,I,_,l,d,M,D,R,S,Q=0;const f=new Uint8Array(4);let F,T;const u=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Gt(A)||!A.output||!A.input&&0!==A.avail_in)return Mt;e=A.state,e.mode===Tt&&(e.mode=ut),n=A.next_out,s=A.output,h=A.avail_out,a=A.next_in,i=A.input,E=A.avail_in,r=e.hold,g=e.bits,o=E,B=h,S=_t;A:for(;;)switch(e.mode){case ft:if(0===e.wrap){e.mode=ut;break}for(;g<16;){if(0===E)break A;E--,r+=i[a++]<>>8&255,e.check=x(e.check,f,2,0),r=0,g=0,e.mode=16181;break}if(e.head&&(e.head.done=!1),!(1&e.wrap)||(((255&r)<<8)+(r>>8))%31){A.msg=\"incorrect header check\",e.mode=Pt;break}if((15&r)!==Qt){A.msg=\"unknown compression method\",e.mode=Pt;break}if(r>>>=4,g-=4,R=8+(15&r),0===e.wbits&&(e.wbits=R),R>15||R>e.wbits){A.msg=\"invalid window size\",e.mode=Pt;break}e.dmax=1<>8&1),512&e.flags&&4&e.wrap&&(f[0]=255&r,f[1]=r>>>8&255,e.check=x(e.check,f,2,0)),r=0,g=0,e.mode=16182;case 16182:for(;g<32;){if(0===E)break A;E--,r+=i[a++]<>>8&255,f[2]=r>>>16&255,f[3]=r>>>24&255,e.check=x(e.check,f,4,0)),r=0,g=0,e.mode=16183;case 16183:for(;g<16;){if(0===E)break A;E--,r+=i[a++]<>8),512&e.flags&&4&e.wrap&&(f[0]=255&r,f[1]=r>>>8&255,e.check=x(e.check,f,2,0)),r=0,g=0,e.mode=16184;case 16184:if(1024&e.flags){for(;g<16;){if(0===E)break A;E--,r+=i[a++]<>>8&255,e.check=x(e.check,f,2,0)),r=0,g=0}else e.head&&(e.head.extra=null);e.mode=16185;case 16185:if(1024&e.flags&&(w=e.length,w>E&&(w=E),w&&(e.head&&(R=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Uint8Array(e.head.extra_len)),e.head.extra.set(i.subarray(a,a+w),R)),512&e.flags&&4&e.wrap&&(e.check=x(e.check,i,w,a)),E-=w,a+=w,e.length-=w),e.length))break A;e.length=0,e.mode=16186;case 16186:if(2048&e.flags){if(0===E)break A;w=0;do{R=i[a+w++],e.head&&R&&e.length<65536&&(e.head.name+=String.fromCharCode(R))}while(R&&w>9&1,e.head.done=!0),A.adler=e.check=0,e.mode=Tt;break;case 16189:for(;g<32;){if(0===E)break A;E--,r+=i[a++]<>>=7&g,g-=7&g,e.mode=Ht;break}for(;g<3;){if(0===E)break A;E--,r+=i[a++]<>>=1,g-=1,3&r){case 0:e.mode=16193;break;case 1:if(zt(e),e.mode=yt,t===It){r>>>=2,g-=2;break A}break;case 2:e.mode=16196;break;case 3:A.msg=\"invalid block type\",e.mode=Pt}r>>>=2,g-=2;break;case 16193:for(r>>>=7&g,g-=7&g;g<32;){if(0===E)break A;E--,r+=i[a++]<>>16^65535)){A.msg=\"invalid stored block lengths\",e.mode=Pt;break}if(e.length=65535&r,r=0,g=0,e.mode=pt,t===It)break A;case pt:e.mode=16195;case 16195:if(w=e.length,w){if(w>E&&(w=E),w>h&&(w=h),0===w)break A;s.set(i.subarray(a,a+w),n),E-=w,a+=w,h-=w,n+=w,e.length-=w;break}e.mode=Tt;break;case 16196:for(;g<14;){if(0===E)break A;E--,r+=i[a++]<>>=5,g-=5,e.ndist=1+(31&r),r>>>=5,g-=5,e.ncode=4+(15&r),r>>>=4,g-=4,e.nlen>286||e.ndist>30){A.msg=\"too many length or distance symbols\",e.mode=Pt;break}e.have=0,e.mode=16197;case 16197:for(;e.have>>=3,g-=3}for(;e.have<19;)e.lens[u[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,F={bits:e.lenbits},S=wt(0,e.lens,0,19,e.lencode,0,e.work,F),e.lenbits=F.bits,S){A.msg=\"invalid code lengths set\",e.mode=Pt;break}e.have=0,e.mode=16198;case 16198:for(;e.have>>24,_=Q>>>16&255,l=65535&Q,!(I<=g);){if(0===E)break A;E--,r+=i[a++]<>>=I,g-=I,e.lens[e.have++]=l;else{if(16===l){for(T=I+2;g>>=I,g-=I,0===e.have){A.msg=\"invalid bit length repeat\",e.mode=Pt;break}R=e.lens[e.have-1],w=3+(3&r),r>>>=2,g-=2}else if(17===l){for(T=I+3;g>>=I,g-=I,R=0,w=3+(7&r),r>>>=3,g-=3}else{for(T=I+7;g>>=I,g-=I,R=0,w=11+(127&r),r>>>=7,g-=7}if(e.have+w>e.nlen+e.ndist){A.msg=\"invalid bit length repeat\",e.mode=Pt;break}for(;w--;)e.lens[e.have++]=R}}if(e.mode===Pt)break;if(0===e.lens[256]){A.msg=\"invalid code -- missing end-of-block\",e.mode=Pt;break}if(e.lenbits=9,F={bits:e.lenbits},S=wt(1,e.lens,0,e.nlen,e.lencode,0,e.work,F),e.lenbits=F.bits,S){A.msg=\"invalid literal/lengths set\",e.mode=Pt;break}if(e.distbits=6,e.distcode=e.distdyn,F={bits:e.distbits},S=wt(2,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,F),e.distbits=F.bits,S){A.msg=\"invalid distances set\",e.mode=Pt;break}if(e.mode=yt,t===It)break A;case yt:e.mode=kt;case kt:if(E>=6&&h>=258){A.next_out=n,A.avail_out=h,A.next_in=a,A.avail_in=E,e.hold=r,e.bits=g,Et(A,B),n=A.next_out,s=A.output,h=A.avail_out,a=A.next_in,i=A.input,E=A.avail_in,r=e.hold,g=e.bits,e.mode===Tt&&(e.back=-1);break}for(e.back=0;Q=e.lencode[r&(1<>>24,_=Q>>>16&255,l=65535&Q,!(I<=g);){if(0===E)break A;E--,r+=i[a++]<>d)],I=Q>>>24,_=Q>>>16&255,l=65535&Q,!(d+I<=g);){if(0===E)break A;E--,r+=i[a++]<>>=d,g-=d,e.back+=d}if(r>>>=I,g-=I,e.back+=I,e.length=l,0===_){e.mode=16205;break}if(32&_){e.back=-1,e.mode=Tt;break}if(64&_){A.msg=\"invalid literal/length code\",e.mode=Pt;break}e.extra=15&_,e.mode=16201;case 16201:if(e.extra){for(T=e.extra;g>>=e.extra,g-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=16202;case 16202:for(;Q=e.distcode[r&(1<>>24,_=Q>>>16&255,l=65535&Q,!(I<=g);){if(0===E)break A;E--,r+=i[a++]<>d)],I=Q>>>24,_=Q>>>16&255,l=65535&Q,!(d+I<=g);){if(0===E)break A;E--,r+=i[a++]<>>=d,g-=d,e.back+=d}if(r>>>=I,g-=I,e.back+=I,64&_){A.msg=\"invalid distance code\",e.mode=Pt;break}e.offset=l,e.extra=15&_,e.mode=16203;case 16203:if(e.extra){for(T=e.extra;g>>=e.extra,g-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){A.msg=\"invalid distance too far back\",e.mode=Pt;break}e.mode=16204;case 16204:if(0===h)break A;if(w=B-h,e.offset>w){if(w=e.offset-w,w>e.whave&&e.sane){A.msg=\"invalid distance too far back\",e.mode=Pt;break}w>e.wnext?(w-=e.wnext,c=e.wsize-w):c=e.wnext-w,w>e.length&&(w=e.length),C=e.window}else C=s,c=n-e.offset,w=e.length;w>h&&(w=h),h-=w,e.length-=w;do{s[n++]=C[c++]}while(--w);0===e.length&&(e.mode=kt);break;case 16205:if(0===h)break A;s[n++]=e.length,h--,e.mode=kt;break;case Ht:if(e.wrap){for(;g<32;){if(0===E)break A;E--,r|=i[a++]<{if(Gt(A))return Mt;let t=A.state;return t.window&&(t.window=null),A.state=null,_t},inflateGetHeader:(A,t)=>{if(Gt(A))return Mt;const e=A.state;return 0==(2&e.wrap)?Mt:(e.head=t,t.done=!1,_t)},inflateSetDictionary:(A,t)=>{const e=t.length;let i,s,a;return Gt(A)?Mt:(i=A.state,0!==i.wrap&&i.mode!==Ft?Mt:i.mode===Ft&&(s=1,s=b(s,t,e,0),s!==i.check)?Dt:(a=Nt(A,t,e,e),a?(i.mode=16210,Rt):(i.havedict=1,_t)))},inflateInfo:\"pako inflate (from Nodeca project)\"};var jt=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=\"\",this.comment=\"\",this.hcrc=0,this.done=!1};const Zt=Object.prototype.toString,{Z_NO_FLUSH:Wt,Z_FINISH:Xt,Z_OK:qt,Z_STREAM_END:Vt,Z_NEED_DICT:$t,Z_STREAM_ERROR:Ae,Z_DATA_ERROR:te,Z_MEM_ERROR:ee}=J;function ie(A){this.options=LA.assign({chunkSize:65536,windowBits:15,to:\"\"},A||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||A&&A.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new vA,this.strm.avail_out=0;let e=vt.inflateInit2(this.strm,t.windowBits);if(e!==qt)throw new Error(L[e]);if(this.header=new jt,vt.inflateGetHeader(this.strm,this.header),t.dictionary&&(\"string\"==typeof t.dictionary?t.dictionary=NA.string2buf(t.dictionary):\"[object ArrayBuffer]\"===Zt.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(e=vt.inflateSetDictionary(this.strm,t.dictionary),e!==qt)))throw new Error(L[e])}function se(A,t){const e=new ie(t);if(e.push(A),e.err)throw e.msg||L[e.err];return e.result}ie.prototype.push=function(A,t){const e=this.strm,i=this.options.chunkSize,s=this.options.dictionary;let a,n,E;if(this.ended)return!1;for(n=t===~~t?t:!0===t?Xt:Wt,\"[object ArrayBuffer]\"===Zt.call(A)?e.input=new Uint8Array(A):e.input=A,e.next_in=0,e.avail_in=e.input.length;;){for(0===e.avail_out&&(e.output=new Uint8Array(i),e.next_out=0,e.avail_out=i),a=vt.inflate(e,n),a===$t&&s&&(a=vt.inflateSetDictionary(e,s),a===qt?a=vt.inflate(e,n):a===te&&(a=$t));e.avail_in>0&&a===Vt&&e.state.wrap>0&&0!==A[e.next_in];)vt.inflateReset(e),a=vt.inflate(e,n);switch(a){case Ae:case te:case $t:case ee:return this.onEnd(a),this.ended=!0,!1}if(E=e.avail_out,e.next_out&&(0===e.avail_out||a===Vt))if(\"string\"===this.options.to){let A=NA.utf8border(e.output,e.next_out),t=e.next_out-A,s=NA.buf2string(e.output,A);e.next_out=t,e.avail_out=i-t,t&&e.output.set(e.output.subarray(A,A+t),0),this.onData(s)}else this.onData(e.output.length===e.next_out?e.output:e.output.subarray(0,e.next_out));if(a!==qt||0!==E){if(a===Vt)return a=vt.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(0===e.avail_in)break}}return!0},ie.prototype.onData=function(A){this.chunks.push(A)},ie.prototype.onEnd=function(A){A===qt&&(\"string\"===this.options.to?this.result=this.chunks.join(\"\"):this.result=LA.flattenChunks(this.chunks)),this.chunks=[],this.err=A,this.msg=this.strm.msg};var ae={Inflate:ie,inflate:se,inflateRaw:function(A,t){return(t=t||{}).raw=!0,se(A,t)},ungzip:se,constants:J};const{Deflate:ne,deflate:Ee,deflateRaw:he,gzip:re}=at,{Inflate:ge,inflate:oe,inflateRaw:Be,ungzip:we}=ae;var ce=Ee,Ce=ge;class Ie{constructor(A,t=!1,e=!0){this.device=A,this.tracing=t,this.slipReaderEnabled=!1,this.leftOver=new Uint8Array(0),this.baudrate=0,this.traceLog=\"\",this.lastTraceTime=Date.now(),this._DTR_state=!1,this.slipReaderEnabled=e}getInfo(){const A=this.device.getInfo();return A.usbVendorId&&A.usbProductId?`WebSerial VendorID 0x${A.usbVendorId.toString(16)} ProductID 0x${A.usbProductId.toString(16)}`:\"\"}getPid(){return this.device.getInfo().usbProductId}trace(A){const t=`${`TRACE ${(Date.now()-this.lastTraceTime).toFixed(3)}`} ${A}`;console.log(t),this.traceLog+=t+\"\\n\"}async returnTrace(){try{await navigator.clipboard.writeText(this.traceLog),console.log(\"Text copied to clipboard!\")}catch(A){console.error(\"Failed to copy text:\",A)}}hexify(A){return Array.from(A).map((A=>A.toString(16).padStart(2,\"0\"))).join(\"\").padEnd(16,\" \")}hexConvert(A,t=!0){if(t&&A.length>16){let t=\"\",e=A;for(;e.length>0;){const A=e.slice(0,16),i=String.fromCharCode(...A).split(\"\").map((A=>\" \"===A||A>=\" \"&&A<=\"~\"&&\" \"!==A?A:\".\")).join(\"\");e=e.slice(16),t+=`\\n ${this.hexify(A.slice(0,8))} ${this.hexify(A.slice(8))} | ${i}`}return t}return this.hexify(A)}slipWriter(A){const t=[];t.push(192);for(let e=0;e0)return A;i=this.leftOver,this.leftOver=new Uint8Array(0)}if(null==this.device.readable)return this.leftOver;this.reader=this.device.readable.getReader();try{A>0&&(e=setTimeout((()=>{this.reader&&this.reader.cancel()}),A));do{const{value:A,done:t}=await this.reader.read();if(t)throw this.leftOver=i,new Error(\"Timeout\");i=new Uint8Array(this._appendBuffer(i.buffer,A.buffer))}while(i.length0&&clearTimeout(e),this.reader.releaseLock()}if(this.tracing&&(console.log(\"Read bytes\"),this.trace(`Read ${i.length} bytes: ${this.hexConvert(i)}`)),this.slipReaderEnabled){const A=this.slipReader(i);return this.tracing&&(console.log(\"Slip reader results\"),this.trace(`Read ${A.length} bytes: ${this.hexConvert(A)}`)),A}return i}async rawRead(A=0){if(0!=this.leftOver.length){const A=this.leftOver;return this.leftOver=new Uint8Array(0),A}if(!this.device.readable)return this.leftOver;let t;this.reader=this.device.readable.getReader();try{A>0&&(t=setTimeout((()=>{this.reader&&this.reader.cancel()}),A));const{value:e,done:i}=await this.reader.read();return i||this.tracing&&(console.log(\"Raw Read bytes\"),this.trace(`Read ${e.length} bytes: ${this.hexConvert(e)}`)),e}finally{A>0&&clearTimeout(t),this.reader.releaseLock()}}async setRTS(A){await this.device.setSignals({requestToSend:A}),await this.setDTR(this._DTR_state)}async setDTR(A){this._DTR_state=A,await this.device.setSignals({dataTerminalReady:A})}async connect(A=115200,t={}){await this.device.open({baudRate:A,dataBits:null==t?void 0:t.dataBits,stopBits:null==t?void 0:t.stopBits,bufferSize:null==t?void 0:t.bufferSize,parity:null==t?void 0:t.parity,flowControl:null==t?void 0:t.flowControl}),this.baudrate=A,this.leftOver=new Uint8Array(0)}async sleep(A){return new Promise((t=>setTimeout(t,A)))}async waitForUnlock(A){for(;this.device.readable&&this.device.readable.locked||this.device.writable&&this.device.writable.locked;)await this.sleep(A)}async disconnect(){var A,t;(null===(A=this.device.readable)||void 0===A?void 0:A.locked)&&await(null===(t=this.reader)||void 0===t?void 0:t.cancel()),await this.waitForUnlock(400),this.reader=void 0,await this.device.close()}}function _e(A){return new Promise((t=>setTimeout(t,A)))}async function le(A,t=50){await A.setDTR(!1),await A.setRTS(!0),await _e(100),await A.setDTR(!0),await A.setRTS(!1),await _e(t),await A.setDTR(!1)}async function de(A){await A.setRTS(!1),await A.setDTR(!1),await _e(100),await A.setDTR(!0),await A.setRTS(!1),await _e(100),await A.setRTS(!0),await A.setDTR(!1),await A.setRTS(!0),await _e(100),await A.setRTS(!1),await A.setDTR(!1)}async function Me(A,t=!1){t?(await _e(200),await A.setRTS(!1),await _e(200)):(await _e(100),await A.setRTS(!1))}function De(A){const t=[\"D\",\"R\",\"W\"],e=A.split(\"|\");for(const A of e){const e=A[0],i=A.slice(1);if(!t.includes(e))return!1;if(\"D\"===e||\"R\"===e){if(\"0\"!==i&&\"1\"!==i)return!1}else if(\"W\"===e){const A=parseInt(i);if(isNaN(A)||A<=0)return!1}}return!0}async function Re(A,t){const e={D:async t=>await A.setDTR(t),R:async t=>await A.setRTS(t),W:async A=>await _e(A)};try{if(!De(t))return;const A=t.split(\"|\");for(const t of A){const A=t[0],i=t.slice(1);\"W\"===A?await e.W(Number(i)):\"D\"!==A&&\"R\"!==A||await e[A](\"1\"===i)}}catch(A){throw new Error(\"Invalid custom reset sequence\")}}var Se=function(A){return atob(A)};class Qe{constructor(A){this.ESP_RAM_BLOCK=6144,this.ESP_FLASH_BEGIN=2,this.ESP_FLASH_DATA=3,this.ESP_FLASH_END=4,this.ESP_MEM_BEGIN=5,this.ESP_MEM_END=6,this.ESP_MEM_DATA=7,this.ESP_WRITE_REG=9,this.ESP_READ_REG=10,this.ESP_SPI_ATTACH=13,this.ESP_CHANGE_BAUDRATE=15,this.ESP_FLASH_DEFL_BEGIN=16,this.ESP_FLASH_DEFL_DATA=17,this.ESP_FLASH_DEFL_END=18,this.ESP_SPI_FLASH_MD5=19,this.ESP_ERASE_FLASH=208,this.ESP_ERASE_REGION=209,this.ESP_READ_FLASH=210,this.ESP_RUN_USER_CODE=211,this.ESP_IMAGE_MAGIC=233,this.ESP_CHECKSUM_MAGIC=239,this.ROM_INVALID_RECV_MSG=5,this.ERASE_REGION_TIMEOUT_PER_MB=3e4,this.ERASE_WRITE_TIMEOUT_PER_MB=4e4,this.MD5_TIMEOUT_PER_MB=8e3,this.CHIP_ERASE_TIMEOUT=12e4,this.FLASH_READ_TIMEOUT=1e5,this.MAX_TIMEOUT=2*this.CHIP_ERASE_TIMEOUT,this.CHIP_DETECT_MAGIC_REG_ADDR=1073745920,this.DETECTED_FLASH_SIZES={18:\"256KB\",19:\"512KB\",20:\"1MB\",21:\"2MB\",22:\"4MB\",23:\"8MB\",24:\"16MB\"},this.DETECTED_FLASH_SIZES_NUM={18:256,19:512,20:1024,21:2048,22:4096,23:8192,24:16384},this.USB_JTAG_SERIAL_PID=4097,this.romBaudrate=115200,this.debugLogging=!1,this.syncStubDetected=!1,this.checksum=function(A){let t,e=239;for(t=0;tsetTimeout(t,A)))}write(A,t=!0){this.terminal?t?this.terminal.writeLine(A):this.terminal.write(A):console.log(A)}error(A,t=!0){this.write(`Error: ${A}`,t)}info(A,t=!0){this.write(A,t)}debug(A,t=!0){this.debugLogging&&this.write(`Debug: ${A}`,t)}_shortToBytearray(A){return new Uint8Array([255&A,A>>8&255])}_intToByteArray(A){return new Uint8Array([255&A,A>>8&255,A>>16&255,A>>24&255])}_byteArrayToShort(A,t){return A|t>>8}_byteArrayToInt(A,t,e,i){return A|t<<8|e<<16|i<<24}_appendBuffer(A,t){const e=new Uint8Array(A.byteLength+t.byteLength);return e.set(new Uint8Array(A),0),e.set(new Uint8Array(t),A.byteLength),e.buffer}_appendArray(A,t){const e=new Uint8Array(A.length+t.length);return e.set(A,0),e.set(t,A.length),e}ui8ToBstr(A){let t=\"\";for(let e=0;e0&&(a=this._appendArray(a,this._intToByteArray(this.chip.UART_DATE_REG_ADDR)),a=this._appendArray(a,this._intToByteArray(0)),a=this._appendArray(a,this._intToByteArray(0)),a=this._appendArray(a,this._intToByteArray(s))),await this.checkCommand(\"write target memory\",this.ESP_WRITE_REG,a)}async sync(){this.debug(\"Sync\");const A=new Uint8Array(36);let t;for(A[0]=7,A[1]=7,A[2]=18,A[3]=32,t=0;t<32;t++)A[4+t]=85;try{const t=await this.command(8,A,void 0,void 0,100);return this.syncStubDetected=this.syncStubDetected&&0===t[0],t}catch(A){throw this.debug(\"Sync err \"+A),A}}async _connectAttempt(A=\"default_reset\",t=!1){if(this.debug(\"_connect_attempt \"+A+\" \"+t),\"no_reset\"!==A)if(this.transport.getPid()===this.USB_JTAG_SERIAL_PID)await de(this.transport);else{const A=t?\"D0|R1|W100|W2000|D1|R0|W50|D0\":\"D0|R1|W100|D1|R0|W50|D0\";await Re(this.transport,A)}let e=0,i=!0;for(;i;){try{e+=(await this.transport.read(1e3)).length}catch(A){if(this.debug(A.message),A instanceof Error){i=!1;break}}await this._sleep(50)}for(this.transport.slipReaderEnabled=!0,this.syncStubDetected=!0,e=7;e--;){try{const A=await this.sync();return this.debug(A[0].toString()),\"success\"}catch(A){A instanceof Error&&(t?this.info(\"_\",!1):this.info(\".\",!1))}await this._sleep(50)}return\"error\"}async connect(t=\"default_reset\",e=7,i=!1){let s,a;for(this.info(\"Connecting...\",!1),await this.transport.connect(this.romBaudrate,this.serialOptions),s=0;s>>0;this.debug(\"Chip Magic \"+t.toString(16));const e=await async function(A){switch(A){case 15736195:{const{ESP32ROM:A}=await Promise.resolve().then((function(){return He}));return new A}case 1867591791:case 2084675695:{const{ESP32C2ROM:A}=await Promise.resolve().then((function(){return Ne}));return new A}case 1763790959:case 456216687:case 1216438383:case 1130455151:{const{ESP32C3ROM:A}=await Promise.resolve().then((function(){return be}));return new A}case 752910447:{const{ESP32C6ROM:A}=await Promise.resolve().then((function(){return Ve}));return new A}case 285294703:{const{ESP32C5ROM:A}=await Promise.resolve().then((function(){return si}));return new A}case 3619110528:{const{ESP32H2ROM:A}=await Promise.resolve().then((function(){return gi}));return new A}case 9:{const{ESP32S3ROM:A}=await Promise.resolve().then((function(){return Ii}));return new A}case 1990:{const{ESP32S2ROM:A}=await Promise.resolve().then((function(){return Ri}));return new A}case 4293968129:{const{ESP8266ROM:A}=await Promise.resolve().then((function(){return ui}));return new A}case 0:case 182303440:case 117676761:{const{ESP32P4ROM:A}=await Promise.resolve().then((function(){return Oi}));return new A}default:return null}}(t);if(null===this.chip)throw new A(`Unexpected CHIP magic value ${t}. Failed to autodetect chip type.`);this.chip=e}}async detectChip(A=\"default_reset\"){await this.connect(A),this.info(\"Detecting chip type... \",!1),null!=this.chip?this.info(this.chip.CHIP_NAME):this.info(\"unknown!\")}async checkCommand(A=\"\",t=null,e=new Uint8Array(0),i=0,s=3e3){this.debug(\"check_command \"+A);const a=await this.command(t,e,i,void 0,s);return a[1].length>4?a[1]:a[0]}async memBegin(A,t,e,i){this.debug(\"mem_begin \"+A+\" \"+t+\" \"+e+\" \"+i.toString(16));let s=this._appendArray(this._intToByteArray(A),this._intToByteArray(t));s=this._appendArray(s,this._intToByteArray(e)),s=this._appendArray(s,this._intToByteArray(i)),await this.checkCommand(\"enter RAM download mode\",this.ESP_MEM_BEGIN,s)}async memBlock(A,t){let e=this._appendArray(this._intToByteArray(A.length),this._intToByteArray(t));e=this._appendArray(e,this._intToByteArray(0)),e=this._appendArray(e,this._intToByteArray(0)),e=this._appendArray(e,A);const i=this.checksum(A);await this.checkCommand(\"write to target RAM\",this.ESP_MEM_DATA,e,i)}async memFinish(A){const t=0===A?1:0,e=this._appendArray(this._intToByteArray(t),this._intToByteArray(A));await this.checkCommand(\"leave RAM download mode\",this.ESP_MEM_END,e,void 0,50)}async flashSpiAttach(A){const t=this._intToByteArray(A);await this.checkCommand(\"configure SPI flash pins\",this.ESP_SPI_ATTACH,t)}async flashBegin(A,t){const e=Math.floor((A+this.FLASH_WRITE_SIZE-1)/this.FLASH_WRITE_SIZE),i=this.chip.getEraseSize(t,A),s=new Date,a=s.getTime();let n=3e3;0==this.IS_STUB&&(n=this.timeoutPerMb(this.ERASE_REGION_TIMEOUT_PER_MB,A)),this.debug(\"flash begin \"+i+\" \"+e+\" \"+this.FLASH_WRITE_SIZE+\" \"+t+\" \"+A);let E=this._appendArray(this._intToByteArray(i),this._intToByteArray(e));E=this._appendArray(E,this._intToByteArray(this.FLASH_WRITE_SIZE)),E=this._appendArray(E,this._intToByteArray(t)),0==this.IS_STUB&&(E=this._appendArray(E,this._intToByteArray(0))),await this.checkCommand(\"enter Flash download mode\",this.ESP_FLASH_BEGIN,E,void 0,n);const h=s.getTime();return 0!=A&&0==this.IS_STUB&&this.info(\"Took \"+(h-a)/1e3+\".\"+(h-a)%1e3+\"s to erase flash block\"),e}async flashDeflBegin(A,t,e){const i=Math.floor((t+this.FLASH_WRITE_SIZE-1)/this.FLASH_WRITE_SIZE),s=Math.floor((A+this.FLASH_WRITE_SIZE-1)/this.FLASH_WRITE_SIZE),a=new Date,n=a.getTime();let E,h;this.IS_STUB?(E=A,h=3e3):(E=s*this.FLASH_WRITE_SIZE,h=this.timeoutPerMb(this.ERASE_REGION_TIMEOUT_PER_MB,E)),this.info(\"Compressed \"+A+\" bytes to \"+t+\"...\");let r=this._appendArray(this._intToByteArray(E),this._intToByteArray(i));r=this._appendArray(r,this._intToByteArray(this.FLASH_WRITE_SIZE)),r=this._appendArray(r,this._intToByteArray(e)),\"ESP32-S2\"!==this.chip.CHIP_NAME&&\"ESP32-S3\"!==this.chip.CHIP_NAME&&\"ESP32-C3\"!==this.chip.CHIP_NAME&&\"ESP32-C2\"!==this.chip.CHIP_NAME||!1!==this.IS_STUB||(r=this._appendArray(r,this._intToByteArray(0))),await this.checkCommand(\"enter compressed flash mode\",this.ESP_FLASH_DEFL_BEGIN,r,void 0,h);const g=a.getTime();return 0!=A&&!1===this.IS_STUB&&this.info(\"Took \"+(g-n)/1e3+\".\"+(g-n)%1e3+\"s to erase flash block\"),i}async flashBlock(A,t,e){let i=this._appendArray(this._intToByteArray(A.length),this._intToByteArray(t));i=this._appendArray(i,this._intToByteArray(0)),i=this._appendArray(i,this._intToByteArray(0)),i=this._appendArray(i,A);const s=this.checksum(A);await this.checkCommand(\"write to target Flash after seq \"+t,this.ESP_FLASH_DATA,i,s,e)}async flashDeflBlock(A,t,e){let i=this._appendArray(this._intToByteArray(A.length),this._intToByteArray(t));i=this._appendArray(i,this._intToByteArray(0)),i=this._appendArray(i,this._intToByteArray(0)),i=this._appendArray(i,A);const s=this.checksum(A);this.debug(\"flash_defl_block \"+A[0].toString(16)+\" \"+A[1].toString(16)),await this.checkCommand(\"write compressed data to flash after seq \"+t,this.ESP_FLASH_DEFL_DATA,i,s,e)}async flashFinish(A=!1){const t=A?0:1,e=this._intToByteArray(t);await this.checkCommand(\"leave Flash mode\",this.ESP_FLASH_END,e)}async flashDeflFinish(A=!1){const t=A?0:1,e=this._intToByteArray(t);await this.checkCommand(\"leave compressed flash mode\",this.ESP_FLASH_DEFL_END,e)}async runSpiflashCommand(t,e,i){const s=this.chip.SPI_REG_BASE,a=s+0,n=s+this.chip.SPI_USR_OFFS,E=s+this.chip.SPI_USR1_OFFS,h=s+this.chip.SPI_USR2_OFFS,r=s+this.chip.SPI_W0_OFFS;let g;g=null!=this.chip.SPI_MOSI_DLEN_OFFS?async(A,t)=>{const e=s+this.chip.SPI_MOSI_DLEN_OFFS,i=s+this.chip.SPI_MISO_DLEN_OFFS;A>0&&await this.writeReg(e,A-1),t>0&&await this.writeReg(i,t-1)}:async(A,t)=>{const e=E,i=(0===t?0:t-1)<<8|(0===A?0:A-1)<<17;await this.writeReg(e,i)};const o=1<<18;if(i>32)throw new A(\"Reading more than 32 bits back from a SPI flash operation is unsupported\");if(e.length>64)throw new A(\"Writing more than 64 bytes of data with one SPI command is unsupported\");const B=8*e.length,w=await this.readReg(n),c=await this.readReg(h);let C,I=1<<31;i>0&&(I|=268435456),B>0&&(I|=134217728),await g(B,i),await this.writeReg(n,I);let _=7<<28|t;if(await this.writeReg(h,_),0==B)await this.writeReg(r,0);else{if(e.length%4!=0){const A=new Uint8Array(e.length%4);e=this._appendArray(e,A)}let A=r;for(C=0;C(\"00\"+A.toString(16)).slice(-2))).join(\"\")}async flashMd5sum(A,t){const e=this.timeoutPerMb(this.MD5_TIMEOUT_PER_MB,t);let i=this._appendArray(this._intToByteArray(A),this._intToByteArray(t));i=this._appendArray(i,this._intToByteArray(0)),i=this._appendArray(i,this._intToByteArray(0));let s=await this.checkCommand(\"calculate md5sum\",this.ESP_SPI_FLASH_MD5,i,void 0,e);s instanceof Uint8Array&&s.length>16&&(s=s.slice(0,16));return this.toHex(s)}async readFlash(t,e,i=null){let s=this._appendArray(this._intToByteArray(t),this._intToByteArray(e));s=this._appendArray(s,this._intToByteArray(4096)),s=this._appendArray(s,this._intToByteArray(1024));const a=await this.checkCommand(\"read flash\",this.ESP_READ_FLASH,s);if(0!=a)throw new A(\"Failed to read memory: \"+a);let n=new Uint8Array(0);for(;n.length0&&(n=this._appendArray(n,t),await this.transport.write(this._intToByteArray(n.length)),i&&i(t,n.length,e))}return n}async runStub(){if(this.syncStubDetected)return this.info(\"Stub is already running. No upload is necessary.\"),this.chip;this.info(\"Uploading stub...\");let t=Se(this.chip.ROM_TEXT),e=t.split(\"\").map((function(A){return A.charCodeAt(0)}));const i=new Uint8Array(e);t=Se(this.chip.ROM_DATA),e=t.split(\"\").map((function(A){return A.charCodeAt(0)}));const s=new Uint8Array(e);let a,n=Math.floor((i.length+this.ESP_RAM_BLOCK-1)/this.ESP_RAM_BLOCK);for(await this.memBegin(i.length,n,this.ESP_RAM_BLOCK,this.chip.TEXT_START),a=0;ae)throw new A(`File ${i+1} doesn't fit in the available flash`)}let e,i;!0===this.IS_STUB&&!0===t.eraseAll&&await this.eraseFlash();for(let s=0;s0&&(e+=\"ÿÿÿÿ\".substring(4-a)),i=t.fileArray[s].address,this.debug(\"Image Length \"+e.length),0===e.length){this.debug(\"Warning: File is empty\");continue}e=this._updateImageFlashParams(e,i,t.flashSize,t.flashMode,t.flashFreq);let n=null;t.calculateMD5Hash&&(n=t.calculateMD5Hash(e),this.debug(\"Image MD5 \"+n));const E=e.length;let h;if(t.compress){const A=this.bstrToUi8(e);e=this.ui8ToBstr(ce(A,{level:9})),h=await this.flashDeflBegin(E,e.length,i)}else h=await this.flashBegin(E,i);let r=0,g=0;const o=e.length;t.reportProgress&&t.reportProgress(s,0,o);let B=new Date;const w=B.getTime();let c=5e3;const C=new Ce({chunkSize:1});let I=0;for(C.onData=function(A){I+=A.byteLength};e.length>0;){this.debug(\"Write loop \"+i+\" \"+r+\" \"+h),this.info(\"Writing at 0x\"+(i+I).toString(16)+\"... (\"+Math.floor(100*(r+1)/h)+\"%)\");const a=this.bstrToUi8(e.slice(0,this.FLASH_WRITE_SIZE));if(!t.compress)throw new A(\"Yet to handle Non Compressed writes\");{const A=I;C.push(a,!1);const t=I-A;let e=3e3;this.timeoutPerMb(this.ERASE_WRITE_TIMEOUT_PER_MB,t)>3e3&&(e=this.timeoutPerMb(this.ERASE_WRITE_TIMEOUT_PER_MB,t)),!1===this.IS_STUB&&(c=e),await this.flashDeflBlock(a,r,c),this.IS_STUB&&(c=e)}g+=a.length,e=e.slice(this.FLASH_WRITE_SIZE,e.length),r++,t.reportProgress&&t.reportProgress(s,g,o)}this.IS_STUB&&await this.readReg(this.CHIP_DETECT_MAGIC_REG_ADDR,c),B=new Date;const _=B.getTime()-w;if(t.compress&&this.info(\"Wrote \"+E+\" bytes (\"+g+\" compressed) at 0x\"+i.toString(16)+\" in \"+_/1e3+\" seconds.\"),n){const t=await this.flashMd5sum(i,E);if(new String(t).valueOf()!=new String(n).valueOf())throw this.info(\"File md5: \"+n),this.info(\"Flash md5: \"+t),new A(\"MD5 of file does not match data in flash!\");this.info(\"Hash of data verified.\")}}this.info(\"Leaving...\"),this.IS_STUB&&(await this.flashBegin(0,0),t.compress?await this.flashDeflFinish():await this.flashFinish())}async flashId(){this.debug(\"flash_id\");const A=await this.readFlashId();this.info(\"Manufacturer: \"+(255&A).toString(16));const t=A>>16&255;this.info(\"Device: \"+(A>>8&255).toString(16)+t.toString(16)),this.info(\"Detected flash size: \"+this.DETECTED_FLASH_SIZES[t])}async getFlashSize(){this.debug(\"flash_id\");const A=await this.readFlashId()>>16&255;return this.DETECTED_FLASH_SIZES_NUM[A]}async hardReset(){await this.transport.setRTS(!0),await this._sleep(100),await this.transport.setRTS(!1)}async softReset(){if(this.IS_STUB){if(\"ESP8266\"!=this.chip.CHIP_NAME)throw new A(\"Soft resetting is currently only supported on ESP8266\");await this.command(this.ESP_RUN_USER_CODE,void 0,void 0,!1)}else await this.flashBegin(0,0),await this.flashFinish(!1)}}class fe{getEraseSize(A,t){return t}}var Fe=1074521560,Te=\"CAD0PxwA9D8AAPQ/AMD8PxAA9D82QQAh+v/AIAA4AkH5/8AgACgEICB0nOIGBQAAAEH1/4H2/8AgAKgEiAigoHTgCAALImYC54b0/yHx/8AgADkCHfAAAKDr/T8Ya/0/hIAAAEBAAABYq/0/pOv9PzZBALH5/yCgdBARIKXHAJYaBoH2/5KhAZCZEZqYwCAAuAmR8/+goHSaiMAgAJIYAJCQ9BvJwMD0wCAAwlgAmpvAIACiSQDAIACSGACB6v+QkPSAgPSHmUeB5f+SoQGQmRGamMAgAMgJoeX/seP/h5wXxgEAfOiHGt7GCADAIACJCsAgALkJRgIAwCAAuQrAIACJCZHX/5qIDAnAIACSWAAd8AAA+CD0P/gw9D82QQCR/f/AIACICYCAJFZI/5H6/8AgAIgJgIAkVkj/HfAAAAAQIPQ/ACD0PwAAAAg2QQAQESCl/P8h+v8MCMAgAIJiAJH6/4H4/8AgAJJoAMAgAJgIVnn/wCAAiAJ88oAiMCAgBB3wAAAAAEA2QQAQESDl+/8Wav+B7P+R+//AIACSaADAIACYCFZ5/x3wAAAMwPw/////AAQg9D82QQAh/P84QhaDBhARIGX4/xb6BQz4DAQ3qA2YIoCZEIKgAZBIg0BAdBARICX6/xARICXz/4giDBtAmBGQqwHMFICrAbHt/7CZELHs/8AgAJJrAJHO/8AgAKJpAMAgAKgJVnr/HAkMGkCag5AzwJqIOUKJIh3wAAAskgBANkEAoqDAgf3/4AgAHfAAADZBAIKgwK0Ch5IRoqDbgff/4AgAoqDcRgQAAAAAgqDbh5IIgfL/4AgAoqDdgfD/4AgAHfA2QQA6MsYCAACiAgAbIhARIKX7/zeS8R3wAAAAfNoFQNguBkCc2gVAHNsFQDYhIaLREIH6/+AIAEYLAAAADBRARBFAQ2PNBL0BrQKB9f/gCACgoHT8Ws0EELEgotEQgfH/4AgASiJAM8BWA/0iogsQIrAgoiCy0RCB7P/gCACtAhwLEBEgpff/LQOGAAAioGMd8AAA/GcAQNCSAEAIaABANkEhYqEHwGYRGmZZBiwKYtEQDAVSZhqB9//gCAAMGECIEUe4AkZFAK0GgdT/4AgAhjQAAJKkHVBzwOCZERqZQHdjiQnNB70BIKIggc3/4AgAkqQd4JkRGpmgoHSICYyqDAiCZhZ9CIYWAAAAkqQd4JkREJmAgmkAEBEgJer/vQetARARIKXt/xARICXp/80HELEgYKYggbv/4AgAkqQd4JkRGpmICXAigHBVgDe1sJKhB8CZERqZmAmAdcCXtwJG3P+G5v8MCIJGbKKkGxCqoIHK/+AIAFYK/7KiC6IGbBC7sBARIKWPAPfqEvZHD7KiDRC7sHq7oksAG3eG8f9867eawWZHCIImGje4Aoe1nCKiCxAisGC2IK0CgZv/4AgAEBEgpd//rQIcCxARICXj/xARIKXe/ywKgbH/4AgAHfAIIPQ/cOL6P0gkBkDwIgZANmEAEBEg5cr/EKEggfv/4AgAPQoMEvwqiAGSogCQiBCJARARIKXP/5Hy/6CiAcAgAIIpAKCIIMAgAIJpALIhAKHt/4Hu/+AIAKAjgx3wAAD/DwAANkEAgTv/DBmSSAAwnEGZKJH7/zkYKTgwMLSaIiozMDxBDAIpWDlIEBEgJfj/LQqMGiKgxR3wAABQLQZANkEAQSz/WDRQM2MWYwRYFFpTUFxBRgEAEBEgZcr/iESmGASIJIel7xARIKXC/xZq/6gUzQO9AoHx/+AIAKCgdIxKUqDEUmQFWBQ6VVkUWDQwVcBZNB3wAADA/D9PSEFJqOv9P3DgC0AU4AtADAD0PzhA9D///wAAjIAAABBAAACs6/0/vOv9PwTA/D8IwPw/BOz9PxQA9D/w//8AqOv9Pxjr/D8kwPw/fGgAQOxnAEBYhgBAbCoGQDgyBkAULAZAzCwGQEwsBkA0hQBAzJAAQHguBkAw7wVAWJIAQEyCAEA2wQAh3v8MCiJhCEKgAIHu/+AIACHZ/zHa/8YAAEkCSyI3MvgQESBlw/8MS6LBIBARIOXG/yKhARARICXC/1GR/pAiESolMc//sc//wCAAWQIheP4MDAxaMmIAgdz/4AgAMcr/QqEBwCAAKAMsCkAiIMAgACkDgTH/4AgAgdX/4AgAIcP/wCAAKALMuhzDMCIQIsL4DBMgo4MMC4HO/+AIAPG8/wwdwqABDBvioQBA3REAzBGAuwGioACBx//gCAAhtv8MBCpVIcP+ctIrwCAAKAUWcv/AIAA4BQwSwCAASQUiQRAiAwEMKCJBEYJRCUlRJpIHHDiHEh4GCAAiAwOCAwKAIhGAIiBmQhEoI8AgACgCKVFGAQAAHCIiUQkQESCls/8Mi6LBEBARIGW3/4IDAyIDAoCIESCIICGY/yAg9IeyHKKgwBARICWy/6Kg7hARIKWx/xARICWw/4bb/wAAIgMBHDknOTT2IhjG1AAAACLCLyAgdPZCcJGJ/5AioCgCoAIAIsL+ICB0HBknuQLGywCRhP+QIqAoAqACAJLCMJCQdLZZyQbGACxKbQQioMCnGAIGxABJUQxyrQQQESDlqv+tBBARIGWq/xARIOWo/xARIKWo/wyLosEQIsL/EBEg5av/ViL9RikADBJWyCyCYQ+Bev/gCACI8aAog8auACaIBAwSxqwAmCNoM2CJIICAtFbY/pnBEBEgZcf/mMFqKZwqBvf/AACgrEGBbf/gCABW6vxi1vBgosDMJgaBAACgkPRWGf6GBACgoPWZwYFl/+AIAJjBVpr6kGbADBkAmRFgosBnOeEGBAAAAKCsQYFc/+AIAFaq+GLW8GCiwFam/sZvAABtBCKgwCaIAoaNAG0EDALGiwAAACa484ZhAAwSJrgCBoUAuDOoIxARIOWh/6AkgwaBAAwcZrhTiEMgrBFtBCKgwoe6AoZ+ALhTqCPJ4RARIOXA/8YLAAwcZrgviEMgrBFtBCKgwoe6AoZ1ACgzuFOoIyBogsnhEBEgZb7/ITT+SWIi0itpIsjhoMSDLQyGaQChL/5tBLIKACKgxhY7GpgjgsjwIqDAh5kBKFoMCaKg70YCAJqzsgsYG5mwqjCHKfKCAwWSAwSAiBGQiCCSAwZtBACZEYCZIIIDB4CIAZCIIICqwIKgwaAok0ZVAIEY/m0EoggAIqDGFnoUqDgioMhW+hMoWKJIAMZNAByKbQQMEqcYAsZKAPhz6GPYU8hDuDOoI4EM/+AIAG0KoCSDRkQAAAwSJkgCRj8AqCO9BIEE/+AIAAYeAICwNG0EIqDAVgsPgGRBi8N8/UYOAKg8ucHJ4dnRgQD/4AgAyOG4wSgsmByoDNIhDZCSECYCDsAgAOIqACAtMOAiECCZIMAgAJkKG7vCzBBnO8LGm/9mSAJGmv9tBCKgwAYmAAwSJrgCRiEAIdz+mFOII5kCIdv+iQItBIYcAGHX/gwb2AaCyPCtBC0EgCuT0KuDIKoQbQQioMZW6gXB0f4ioMnoDIc+U4DwFCKgwFavBC0KRgIAKqOoaksiqQmtCyD+wCqdhzLtFprfIcT++QyZAsZ7/wwSZogWIcH+iAIWKACCoMhJAiG9/kkCDBKAJINtBEYBAABtBCKg/yCgdBARIOV5/2CgdBARIGV5/xARIOV3/1aiviIDARwoJzge9jICBvf+IsL9ICB0DPgnuAKG8/6BrP6AIqAoAqACAIKg0ocSUoKg1IcSegbt/gAAAIgzoqJxwKoRaCOJ8YGw/uAIACGh/pGi/sAgACgCiPEgNDXAIhGQIhAgIyCAIoKtBGCywoGn/uAIAKKj6IGk/uAIAAbb/gAA2FPIQ7gzqCMQESAlff9G1v4AsgMDIgMCgLsRILsgssvwosMYEBEgZZn/Rs/+ACIDA4IDAmGP/YAiEZg2gCIgIsLwkCJjFiKymBaakpCcQUYCAJnBEBEgZWL/mMGoRqYaBKgmp6nrEBEgpVr/Fmr/qBbNArLDGIGG/uAIAIw6MqDEOVY4FiozORY4NiAjwCk2xrX+ggMCIsMYMgMDDByAMxGAMyAyw/AGIwCBbP6RHf3oCDlx4JnAmWGYJwwal7MBDDqJ8anR6cEQESAlW/+o0ZFj/ujBqQGhYv7dCb0CwsEc8sEYmcGBa/7gCAC4J80KqHGI8aC7wLknoDPAuAiqIqhhmMGqu90EDBq5CMDag5C7wNDgdMx90tuA0K6TFmoBrQmJ8ZnByeEQESAlif+I8ZjByOGSaABhTv2INoyjwJ8xwJnA1ikAVvj11qwAMUn9IqDHKVNGAACMPJwIxoL+FoigYUT9IqDIKVZGf/4AMUH9IqDJKVNGfP4oI1bCnq0EgUX+4AgAoqJxwKoRgT7+4AgAgUL+4AgAxnP+AAAoMxaCnK0EgTz+4AgAoqPogTb+4AgA4AIARmz+HfAAAAA2QQCdAoKgwCgDh5kPzDIMEoYHAAwCKQN84oYPACYSByYiGIYDAAAAgqDbgCkjh5kqDCIpA3zyRggAAAAioNwnmQoMEikDLQgGBAAAAIKg3Xzyh5kGDBIpAyKg2x3wAAA=\",ue=1074520064,pe=\"GOv8P9jnC0Bx6AtA8+wLQO3oC0CP6AtA7egLQEnpC0AG6gtAeOoLQCHqC0CB5wtAo+kLQPjpC0Bn6QtAmuoLQI7pC0Ca6gtAXegLQLPoC0Dt6AtASekLQHfoC0BM6wtAs+wLQKXmC0DX7AtApeYLQKXmC0Cl5gtApeYLQKXmC0Cl5gtApeYLQKXmC0Dz6gtApeYLQM3rC0Cz7AtA\",ye=1073605544;class ke extends fe{constructor(){super(...arguments),this.CHIP_NAME=\"ESP32\",this.IMAGE_CHIP_ID=0,this.EFUSE_RD_REG_BASE=1073061888,this.DR_REG_SYSCON_BASE=1073111040,this.UART_CLKDIV_REG=1072955412,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612856,this.XTAL_CLK_DIVIDER=1,this.FLASH_SIZES={\"1MB\":0,\"2MB\":16,\"4MB\":32,\"8MB\":48,\"16MB\":64},this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=4096,this.SPI_REG_BASE=1072963584,this.SPI_USR_OFFS=28,this.SPI_USR1_OFFS=32,this.SPI_USR2_OFFS=36,this.SPI_W0_OFFS=128,this.SPI_MOSI_DLEN_OFFS=40,this.SPI_MISO_DLEN_OFFS=44,this.TEXT_START=ue,this.ENTRY=Fe,this.DATA_START=ye,this.ROM_DATA=pe,this.ROM_TEXT=Te}async readEfuse(A,t){const e=this.EFUSE_RD_REG_BASE+4*t;return A.debug(\"Read efuse \"+e),await A.readReg(e)}async getPkgVersion(A){const t=await this.readEfuse(A,3);let e=t>>9&7;return e+=(t>>2&1)<<3,e}async getChipRevision(A){const t=await this.readEfuse(A,3),e=await this.readEfuse(A,5),i=await A.readReg(this.DR_REG_SYSCON_BASE+124);return 0!=(t>>15&1)?0!=(e>>20&1)?0!=(i>>31&1)?3:2:1:0}async getChipDescription(A){const t=[\"ESP32-D0WDQ6\",\"ESP32-D0WD\",\"ESP32-D2WD\",\"\",\"ESP32-U4WDH\",\"ESP32-PICO-D4\",\"ESP32-PICO-V3-02\"];let e=\"\";const i=await this.getPkgVersion(A),s=await this.getChipRevision(A),a=3==s;return 0!=(1&await this.readEfuse(A,3))&&(t[0]=\"ESP32-S0WDQ6\",t[1]=\"ESP32-S0WD\"),a&&(t[5]=\"ESP32-PICO-V3\"),e=i>=0&&i<=6?t[i]:\"Unknown ESP32\",!a||0!==i&&1!==i||(e+=\"-V3\"),e+\" (revision \"+s+\")\"}async getChipFeatures(A){const t=[\"Wi-Fi\"],e=await this.readEfuse(A,3);0===(2&e)&&t.push(\" BT\");0!==(1&e)?t.push(\" Single Core\"):t.push(\" Dual Core\");if(0!==(8192&e)){0!==(4096&e)?t.push(\" 160MHz\"):t.push(\" 240MHz\")}const i=await this.getPkgVersion(A);-1!==[2,4,5,6].indexOf(i)&&t.push(\" Embedded Flash\"),6===i&&t.push(\" Embedded PSRAM\");0!==(await this.readEfuse(A,4)>>8&31)&&t.push(\" VRef calibration in efuse\");0!==(e>>14&1)&&t.push(\" BLK3 partially reserved\");const s=3&await this.readEfuse(A,6);return t.push(\" Coding Scheme \"+[\"None\",\"3/4\",\"Repeat (UNSUPPORTED)\",\"Invalid\"][s]),t}async getCrystalFreq(A){const t=await A.readReg(this.UART_CLKDIV_REG)&this.UART_CLKDIV_MASK,e=A.transport.baudrate*t/1e6/this.XTAL_CLK_DIVIDER;let i;return i=e>33?40:26,Math.abs(i-e)>1&&A.info(\"WARNING: Unsupported crystal in use\"),i}_d2h(A){const t=(+A).toString(16);return 1===t.length?\"0\"+t:t}async readMac(A){let t=await this.readEfuse(A,1);t>>>=0;let e=await this.readEfuse(A,2);e>>>=0;const i=new Uint8Array(6);return i[0]=e>>8&255,i[1]=255&e,i[2]=t>>24&255,i[3]=t>>16&255,i[4]=t>>8&255,i[5]=255&t,this._d2h(i[0])+\":\"+this._d2h(i[1])+\":\"+this._d2h(i[2])+\":\"+this._d2h(i[3])+\":\"+this._d2h(i[4])+\":\"+this._d2h(i[5])}}var He=Object.freeze({__proto__:null,ESP32ROM:ke}),Pe=1077413532,Oe=\"QREixCbCBsa3NwRgEUc3RMg/2Mu3NARgEwQEANxAkYuR57JAIkSSREEBgoCIQBxAE3X1D4KX3bcBEbcHAGBOxoOphwBKyDdJyD8mylLEBs4izLcEAGB9WhMJCQDATBN09D8N4PJAYkQjqDQBQknSRLJJIkoFYYKAiECDJwkAE3X1D4KXfRTjGUT/yb8TBwAMlEGqh2MY5QCFR4XGI6AFAHlVgoAFR2OH5gAJRmONxgB9VYKAQgUTB7ANQYVjlecCiUecwfW3kwbADWMW1QCYwRMFAAyCgJMG0A19VWOV1wCYwRMFsA2CgLd1yT9BEZOFhboGxmE/Y0UFBrd3yT+ThweyA6cHCAPWRwgTdfUPkwYWAMIGwYIjktcIMpcjAKcAA9dHCJFnk4cHBGMe9wI398g/EwcHsqFnupcDpgcItzbJP7d3yT+Thweyk4YGtmMf5gAjpscII6DXCCOSBwghoPlX4wb1/LJAQQGCgCOm1wgjoOcI3bc3JwBgfEudi/X/NzcAYHxLnYv1/4KAQREGxt03tycAYCOmBwI3BwAImMOYQ33/yFeyQBNF9f8FiUEBgoBBEQbG2T993TcHAEC3JwBgmMM3JwBgHEP9/7JAQQGCgEERIsQ3RMg/kwdEAUrAA6kHAQbGJsJjCgkERTc5xb1HEwREAYFEY9YnAQREvYiTtBQAfTeFPxxENwaAABOXxwCZ4DcGAAG39v8AdY+3JgBg2MKQwphCff9BR5HgBUczCelAupcjKCQBHMSyQCJEkkQCSUEBgoABEQbOIswlNzcEzj9sABMFRP+XAMj/54Ag8KqHBUWV57JHk/cHID7GiTc3JwBgHEe3BkAAEwVE/9WPHMeyRZcAyP/ngKDtMzWgAPJAYkQFYYKAQRG3R8g/BsaTh0cBBUcjgOcAE9fFAJjHBWd9F8zDyMf5jTqVqpWxgYzLI6oHAEE3GcETBVAMskBBAYKAAREizDdEyD+TB0QBJsrER07GBs5KyKqJEwREAWPzlQCuhKnAAylEACaZE1nJABxIY1XwABxEY175ArU9fd1IQCaGzoWXAMj/54Ag4RN19Q8BxZMHQAxcyFxAppdcwFxEhY9cxPJAYkTSREJJskkFYYKAaTVtv0ERBsaXAMj/54AA1gNFhQGyQHUVEzUVAEEBgoBBEQbGxTcdyTdHyD8TBwcAXEONxxBHHcK3BgxgmEYNinGbUY+YxgVmuE4TBgbA8Y99dhMG9j9xj9mPvM6yQEEBgoBBEQbGeT8RwQ1FskBBARcDyP9nAIPMQREGxpcAyP/ngEDKQTcBxbJAQQHZv7JAQQGCgEERBsYTBwAMYxrlABMFsA3RPxMFwA2yQEEB6bcTB7AN4xvl/sE3EwXQDfW3QREixCbCBsYqhLMEtQBjF5QAskAiRJJEQQGCgANFBAAFBE0/7bc1cSbLTsf9coVp/XQizUrJUsVWwwbPk4SE+haRk4cJB6aXGAizhOcAKokmhS6ElwDI/+eAgBuThwkHGAgFarqXs4pHQTHkBWd9dZMFhfqTBwcHEwWF+RQIqpczhdcAkwcHB66Xs4XXACrGlwDI/+eAQBgyRcFFlTcBRYViFpH6QGpE2kRKSbpJKkqaSg1hgoCiiWNzigCFaU6G1oVKhZcAyP/ngEDGE3X1DwHtTobWhSaFlwDI/+eAgBNOmTMENEFRtxMFMAZVvxMFAAzZtTFx/XIFZ07XUtVW017PBt8i3SbbStla0WLNZstqyW7H/XcWkRMHBwc+lxwIupc+xiOqB/iqiS6Ksoq2ixE9kwcAAhnBtwcCAD6FlwDI/+eAIAyFZ2PlVxMFZH15EwmJ+pMHBAfKlxgIM4nnAEqFlwDI/+eAoAp9exMMO/mTDIv5EwcEB5MHBAcUCGKX5peBRDMM1wCzjNcAUk1jfE0JY/GkA0GomT+ihQgBjTW5NyKGDAFKhZcAyP/ngIAGopmilGP1RAOzh6RBY/F3AzMEmkBj84oAVoQihgwBToWXAMj/54CAtRN19Q9V3QLMAUR5XY1NowkBAGKFlwDI/+eAwKd9+QNFMQHmhWE0Y08FAOPijf6FZ5OHBweilxgIupfalyOKp/gFBPG34xWl/ZFH4wX09gVnfXWTBwcHkwWF+hMFhfkUCKqXM4XXAJMHBweul7OF1wAqxpcAyP/ngKD8cT0yRcFFZTNRPeUxtwcCABnhkwcAAj6FlwDI/+eAoPmFYhaR+lBqVNpUSlm6WSpamloKW/pLakzaTEpNuk0pYYKAt1dBSRlxk4f3hAFFht6i3KbaytjO1tLU1tLa0N7O4szmyurI7sY+zpcAyP/ngICfQTENzbcEDGCcRDdEyD8TBAQAHMS8TH13Ewf3P1zA+Y+T5wdAvMwTBUAGlwDI/+eAoJUcRPGbk+cXAJzEkTEhwbeHAGA3R9hQk4aHChMHF6qYwhOHBwkjIAcANzcdjyOgBgATB6cSk4YHC5jCk4fHCphDNwYAgFGPmMMjoAYAt0fIPzd3yT+ThwcAEwcHuyGgI6AHAJEH4+3n/kE7kUVoCHE5YTO398g/k4cHsiFnPpcjIPcItwc4QDdJyD+Th4cOIyD5ALd5yT9lPhMJCQCTiQmyYwsFELcnDGBFR7jXhUVFRZcAyP/ngCDjtwU4QAFGk4UFAEVFlwDI/+eAIOQ3NwRgHEs3BQIAk+dHABzLlwDI/+eAIOOXAMj/54Cg87dHAGCcXwnl8YvhFxO1FwCBRZcAyP/ngICWwWe3RMg//RcTBwAQhWZBZrcFAAEBRZOERAENard6yD+XAMj/54AAkSaaE4sKsoOnyQj134OryQiFRyOmCQgjAvECg8cbAAlHIxPhAqMC8QIC1E1HY4HnCFFHY4/nBilHY5/nAIPHOwADxysAogfZjxFHY5bnAIOniwCcQz7UlTmhRUgQQTaDxzsAA8crAKIH2Y8RZ0EHY3T3BBMFsA05PhMFwA0hPhMF4A4JPpkxQbe3BThAAUaThYUDFUWXAMj/54BA1DcHAGBcRxMFAAKT5xcQXMcJt8lHIxPxAk23A8cbANFGY+fmAoVGY+bmAAFMEwTwD4WoeRcTd/cPyUbj6Ob+t3bJPwoHk4ZGuzaXGEMCh5MGBwOT9vYPEUbjadb8Ewf3AhN39w+NRmPr5gi3dsk/CgeThgbANpcYQwKHEwdAAmOY5xAC1B1EAUWFPAFFYTRFNnk+oUVIEH0UZTR19AFMAUQTdfQPhTwTdfwPrTRJNuMeBOqDxxsASUdjY/cuCUfjdvfq9ReT9/cPPUfjYPfqN3fJP4oHEwcHwbqXnEOChwVEnetwEIFFAUWXsMz/54CgAh3h0UVoEKk0AUQxqAVEge+X8Mf/54CAdTM0oAApoCFHY4XnAAVEAUxhtwOsiwADpMsAs2eMANIH9ffv8H+FffHBbCKc/Rx9fTMFjEBV3LN3lQGV48FsMwWMQGPmjAL9fDMFjEBV0DGBl/DH/+eAgHBV+WaU9bcxgZfwx//ngIBvVfFqlNG3QYGX8Mf/54BAblH5MwSUQcG3IUfjiefwAUwTBAAMMbdBR82/QUcFROOc5/aDpcsAA6WLAHU6sb9BRwVE45Ln9gOnCwGRZ2Pl5xyDpUsBA6WLAO/wv4A1v0FHBUTjkuf0g6cLARFnY2X3GgOnywCDpUsBA6WLADOE5wLv8C/+I6wEACMkirAxtwPHBABjDgcQA6eLAMEXEwQADGMT9wDASAFHkwbwDmNG9wKDx1sAA8dLAAFMogfZjwPHawBCB12Pg8d7AOIH2Y/jgfbmEwQQDKm9M4brAANGhgEFB7GO4beDxwQA8cPcRGOYBxLASCOABAB9tWFHY5bnAoOnywEDp4sBg6ZLAQOmCwGDpcsAA6WLAJfwx//ngEBeKowzNKAAKbUBTAVEEbURRwVE45rn5gOliwCBRZfwx//ngABfkbUT9/cA4xoH7JPcRwAThIsAAUx9XeN5nN1IRJfwx//ngIBLGERUQBBA+Y5jB6cBHEITR/f/fY/ZjhTCBQxBBNm/EUdJvUFHBUTjnOfgg6eLAAOnSwEjKPkAIybpAN2zgyXJAMEXkeWJzwFMEwRgDLW7AycJAWNm9wYT9zcA4x4H5AMoCQEBRgFHMwXoQLOG5QBjafcA4wkG1CMoqQAjJtkAmbMzhusAEE4RB5DCBUbpvyFHBUTjlufaAyQJARnAEwSADCMoCQAjJgkAMzSAAEm7AUwTBCAMEbsBTBMEgAwxswFMEwSQDBGzEwcgDWOD5wwTB0AN45DnvAPEOwCDxysAIgRdjJfwx//ngGBJA6zEAEEUY3OEASKM4w4MuMBAYpQxgJxIY1XwAJxEY1v0Cu/wD8513chAYoaThYsBl/DH/+eAYEUBxZMHQAzcyNxA4pfcwNxEs4eHQdzEl/DH/+eAQESJvgllEwUFcQOsywADpIsAl/DH/+eAADa3BwBg2Eu3BgABwRaTV0cBEgd1j72L2Y+zh4cDAUWz1YcCl/DH/+eA4DYTBYA+l/DH/+eAoDIRtoOmSwEDpgsBg6XLAAOliwDv8M/7/bSDxTsAg8crABOFiwGiBd2NwRXv8O/X2bzv8E/HPb+DxzsAA8crABOMiwGiB9mPE40H/wVEt3vJP9xEYwUNAJnDY0yAAGNQBAoTB3AM2MjjnweokweQDGGok4cLu5hDt/fIP5OHB7KZjz7WgyeKsLd8yD9q0JOMTAGTjQu7BUhjc/0ADUhCxjrE7/BPwCJHMkg3Rcg/4oV8EJOGCrIQEBMFxQKX8Mf/54DAMIJXA6eMsIOlDQAzDf1AHY8+nLJXI6TssCqEvpUjoL0Ak4cKsp2NAcWhZ+OS9fZahe/wb8sjoG0Bmb8t9OODB6CTB4AM3Mj1uoOniwDjmwee7/Cv1gllEwUFcZfwx//ngGAg7/Bv0Zfwx//ngKAj0boDpMsA4wcEnO/wL9QTBYA+l/DH/+eAAB7v8A/PApRVuu/wj872UGZU1lRGWbZZJlqWWgZb9ktmTNZMRk22TQlhgoAAAA==\",Ue=1077411840,Ge=\"IGvIP3YKOEDGCjhAHgs4QMILOEAuDDhA3As4QEIJOEB+CzhAvgs4QDILOEDyCDhAZgs4QPIIOEBQCjhAlgo4QMYKOEAeCzhAYgo4QKYJOEDWCThAXgo4QIAOOEDGCjhARg04QDgOOEAyCDhAYA44QDIIOEAyCDhAMgg4QDIIOEAyCDhAMgg4QDIIOEAyCDhA4gw4QDIIOEBkDThAOA44QA==\",me=1070164912;class Ye extends fe{constructor(){super(...arguments),this.CHIP_NAME=\"ESP32-C3\",this.IMAGE_CHIP_ID=5,this.EFUSE_BASE=1610647552,this.MAC_EFUSE_REG=this.EFUSE_BASE+68,this.UART_CLKDIV_REG=1072955412,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612860,this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=0,this.FLASH_SIZES={\"1MB\":0,\"2MB\":16,\"4MB\":32,\"8MB\":48,\"16MB\":64},this.SPI_REG_BASE=1610620928,this.SPI_USR_OFFS=24,this.SPI_USR1_OFFS=28,this.SPI_USR2_OFFS=32,this.SPI_MOSI_DLEN_OFFS=36,this.SPI_MISO_DLEN_OFFS=40,this.SPI_W0_OFFS=88,this.TEXT_START=Ue,this.ENTRY=Pe,this.DATA_START=me,this.ROM_DATA=Ge,this.ROM_TEXT=Oe}async getPkgVersion(A){const t=this.EFUSE_BASE+68+12;return await A.readReg(t)>>21&7}async getChipRevision(A){const t=this.EFUSE_BASE+68+12;return(await A.readReg(t)&7<<18)>>18}async getChipDescription(A){let t;t=0===await this.getPkgVersion(A)?\"ESP32-C3\":\"unknown ESP32-C3\";return t+=\" (revision \"+await this.getChipRevision(A)+\")\",t}async getFlashCap(A){const t=this.EFUSE_BASE+68+12;return await A.readReg(t)>>27&7}async getFlashVendor(A){const t=this.EFUSE_BASE+68+16;return{1:\"XMC\",2:\"GD\",3:\"FM\",4:\"TT\",5:\"ZBIT\"}[await A.readReg(t)>>0&7]||\"\"}async getChipFeatures(A){const t=[\"Wi-Fi\",\"BLE\"],e=await this.getFlashCap(A),i=await this.getFlashVendor(A),s={0:null,1:\"Embedded Flash 4MB\",2:\"Embedded Flash 2MB\",3:\"Embedded Flash 1MB\",4:\"Embedded Flash 8MB\"}[e],a=void 0!==s?s:\"Unknown Embedded Flash\";return null!==s&&t.push(`${a} (${i})`),t}async getCrystalFreq(A){return 40}_d2h(A){const t=(+A).toString(16);return 1===t.length?\"0\"+t:t}async readMac(A){let t=await A.readReg(this.MAC_EFUSE_REG);t>>>=0;let e=await A.readReg(this.MAC_EFUSE_REG+4);e=e>>>0&65535;const i=new Uint8Array(6);return i[0]=e>>8&255,i[1]=255&e,i[2]=t>>24&255,i[3]=t>>16&255,i[4]=t>>8&255,i[5]=255&t,this._d2h(i[0])+\":\"+this._d2h(i[1])+\":\"+this._d2h(i[2])+\":\"+this._d2h(i[3])+\":\"+this._d2h(i[4])+\":\"+this._d2h(i[5])}getEraseSize(A,t){return t}}var be=Object.freeze({__proto__:null,ESP32C3ROM:Ye}),Ke=1077413304,xe=\"ARG3BwBgTsaDqYcASsg3Sco/JspSxAbOIsy3BABgfVoTCQkAwEwTdPQ/DeDyQGJEI6g0AUJJ0kSySSJKBWGCgIhAgycJABN19Q+Cl30U4xlE/8m/EwcADJRBqodjGOUAhUeFxiOgBQB5VYKABUdjh+YACUZjjcYAfVWCgEIFEwewDUGFY5XnAolHnMH1t5MGwA1jFtUAmMETBQAMgoCTBtANfVVjldcAmMETBbANgoC3dcs/QRGThQW6BsZhP2NFBQa3d8s/k4eHsQOnBwgD1kcIE3X1D5MGFgDCBsGCI5LXCDKXIwCnAAPXRwiRZ5OHBwRjHvcCN/fKPxMHh7GhZ7qXA6YHCLc2yz+3d8s/k4eHsZOGhrVjH+YAI6bHCCOg1wgjkgcIIaD5V+MG9fyyQEEBgoAjptcII6DnCN23NycAYHxLnYv1/zc3AGB8S52L9f+CgEERBsbdN7cnAGAjpgcCNwcACJjDmEN9/8hXskATRfX/BYlBAYKAQREGxtk/fd03BwBAtycAYJjDNycAYBxD/f+yQEEBgoBBESLEN8TKP5MHxABKwAOpBwEGxibCYwoJBEU3OcW9RxMExACBRGPWJwEERL2Ik7QUAH03hT8cRDcGgAATl8cAmeA3BgABt/b/AHWPtyYAYNjCkMKYQn3/QUeR4AVHMwnpQLqXIygkARzEskAiRJJEAklBAYKAQREGxhMHAAxjEOUCEwWwDZcAyP/ngIDjEwXADbJAQQEXA8j/ZwCD4hMHsA3jGOX+lwDI/+eAgOETBdANxbdBESLEJsIGxiqEswS1AGMXlACyQCJEkkRBAYKAA0UEAAUERTfttxMFAAwXA8j/ZwAD3nVxJsPO3v10hWn9cpOEhPqThwkHIsVKwdLc1tqmlwbHFpGzhCcAKokmhS6ElzDI/+eAgJOThwkHBWqKl7OKR0Ep5AVnfXUTBIX5kwcHB6KXM4QnABMFhfqTBwcHqpeihTOFJwCXMMj/54CAkCKFwUW5PwFFhWIWkbpAKkSaRApJ9llmWtZaSWGCgKKJY3OKAIVpTobWhUqFlwDI/+eAQOITdfUPAe1OhtaFJoWXMMj/54DAi06ZMwQ0QVm3EwUwBlW/cXH9ck7PUs1Wy17HBtci1SbTStFayWLFZsNqwe7eqokWkRMFAAIuirKKtosCwpcAyP/ngEBIhWdj7FcRhWR9dBMEhPqThwQHopczhCcAIoWXMMj/54AghX17Eww7+ZMMi/kThwQHk4cEB2KX5pcBSTMMJwCzjCcAEk1je00JY3GpA3mgfTWmhYgYSTVdNSaGjBgihZcwyP/ngCCBppkmmWN1SQOzB6lBY/F3A7MEKkFj85oA1oQmhowYToWXAMj/54Dg0xN19Q9V3QLEgUR5XY1NowEBAGKFlwDI/+eAYMR9+QNFMQDmhS0xY04FAOPinf6FZ5OHBweml4qX2pcjiqf4hQT5t+MWpf2RR+OG9PYFZ311kwcHBxMEhfmilzOEJwATBYX6kwcHB6qXM4UnAKKFlyDI/+eAgHflOyKFwUXxM8U7EwUAApcAyP/ngOA2hWIWkbpQKlSaVApZ+klqStpKSku6SypMmkwKTfZdTWGCgAERBs4izFExNwTOP2wAEwVE/5cAyP/ngKDKqocFRZXnskeT9wcgPsZ5OTcnAGAcR7cGQAATBUT/1Y8cx7JFlwDI/+eAIMgzNaAA8kBiRAVhgoBBEbfHyj8GxpOHxwAFRyOA5wAT18UAmMcFZ30XzMPIx/mNOpWqlbGBjMsjqgcAQTcZwRMFUAyyQEEBgoABESLMN8TKP5MHxAAmysRHTsYGzkrIqokTBMQAY/OVAK6EqcADKUQAJpkTWckAHEhjVfAAHERjXvkC4T593UhAJobOhZcAyP/ngCC7E3X1DwHFkwdADFzIXECml1zAXESFj1zE8kBiRNJEQkmySQVhgoDdNm2/t1dBSRlxk4f3hAFFPs6G3qLcptrK2M7W0tTW0trQ3s7izObK6sjuxpcAyP/ngICtt0fKPzd3yz+ThwcAEweHumPg5xSlOZFFaAixMYU5t/fKP5OHh7EhZz6XIyD3CLcFOEC3BzhAAUaThwcLk4UFADdJyj8VRSMg+QCXAMj/54DgGzcHAGBcRxMFAAK3xMo/k+cXEFzHlwDI/+eAoBq3RwBgiF+BRbd5yz9xiWEVEzUVAJcAyP/ngOCwwWf9FxMHABCFZkFmtwUAAQFFk4TEALdKyj8NapcAyP/ngOCrk4mJsRMJCQATi8oAJpqDp8kI9d+Dq8kIhUcjpgkIIwLxAoPHGwAJRyMT4QKjAvECAtRNR2OL5wZRR2OJ5wYpR2Of5wCDxzsAA8crAKIH2Y8RR2OW5wCDp4sAnEM+1EE2oUVIEJE+g8c7AAPHKwCiB9mPEWdBB2N+9wITBbANlwDI/+eAQJQTBcANlwDI/+eAgJMTBeAOlwDI/+eAwJKBNr23I6AHAJEHbb3JRyMT8QJ9twPHGwDRRmPn5gKFRmPm5gABTBME8A+dqHkXE3f3D8lG4+jm/rd2yz8KB5OGxro2lxhDAoeTBgcDk/b2DxFG42nW/BMH9wITd/cPjUZj7uYIt3bLPwoHk4aGvzaXGEMChxMHQAJjmucQAtQdRAFFlwDI/+eAIIoBRYE8TTxFPKFFSBB9FEk0ffABTAFEE3X0DyU8E3X8Dw08UTzjEQTsg8cbAElHY2X3MAlH43n36vUXk/f3Dz1H42P36jd3yz+KBxMHh8C6l5xDgocFRJ3rcBCBRQFFlwDI/+eAQIkd4dFFaBAVNAFEMagFRIHvlwDI/+eAwI0zNKAAKaAhR2OF5wAFRAFMYbcDrIsAA6TLALNnjADSB/X3mTll9cFsIpz9HH19MwWMQF3cs3eVAZXjwWwzBYxAY+aMAv18MwWMQF3QMYGXAMj/54Bgil35ZpT1tzGBlwDI/+eAYIld8WqU0bdBgZcAyP/ngKCIWfkzBJRBwbchR+OK5/ABTBMEAAw5t0FHzb9BRwVE453n9oOlywADpYsAVTK5v0FHBUTjk+f2A6cLAZFnY+jnHoOlSwEDpYsAMTGBt0FHBUTjlOf0g6cLARFnY2n3HAOnywCDpUsBA6WLADOE5wLdNiOsBAAjJIqwCb8DxwQAYwMHFAOniwDBFxMEAAxjE/cAwEgBR5MG8A5jRvcCg8dbAAPHSwABTKIH2Y8Dx2sAQgddj4PHewDiB9mP44T25hMEEAyFtTOG6wADRoYBBQexjuG3g8cEAP3H3ERjnQcUwEgjgAQAVb1hR2OW5wKDp8sBA6eLAYOmSwEDpgsBg6XLAAOliwCX8Mf/54BgeSqMMzSgAAG9AUwFRCm1EUcFROOd5+a3lwBgtENld30XBWb5jtGOA6WLALTDtEeBRfmO0Y60x/RD+Y7RjvTD1F91j1GP2N+X8Mf/54BAdwW1E/f3AOMXB+qT3EcAE4SLAAFMfV3jd5zbSESX8Mf/54DAYRhEVEAQQPmOYwenARxCE0f3/32P2Y4UwgUMQQTZvxFHtbVBRwVE45rn3oOniwADp0sBIyT5ACMi6QDJs4MlSQDBF5Hlic8BTBMEYAyhuwMniQBjZvcGE/c3AOMbB+IDKIkAAUYBRzMF6ECzhuUAY2n3AOMHBtIjJKkAIyLZAA2zM4brABBOEQeQwgVG6b8hRwVE45Tn2AMkiQAZwBMEgAwjJAkAIyIJADM0gAC9swFMEwQgDMW5AUwTBIAM5bEBTBMEkAzFsRMHIA1jg+cMEwdADeOR57oDxDsAg8crACIEXYyX8Mf/54BgXwOsxABBFGNzhAEijOMPDLbAQGKUMYCcSGNV8ACcRGNa9Arv8I/hdd3IQGKGk4WLAZfwx//ngGBbAcWTB0AM3MjcQOKX3MDcRLOHh0HcxJfwx//ngEBaFb4JZRMFBXEDrMsAA6SLAJfwx//ngEBMtwcAYNhLtwYAAcEWk1dHARIHdY+9i9mPs4eHAwFFs9WHApfwx//ngOBMEwWAPpfwx//ngOBI3bSDpksBA6YLAYOlywADpYsA7/Av98G8g8U7AIPHKwAThYsBogXdjcEVqTptvO/w79qBtwPEOwCDxysAE4yLASIEXYzcREEUxeORR4VLY/6HCJMHkAzcyHm0A6cNACLQBUizh+xAPtaDJ4qwY3P0AA1IQsY6xO/wb9YiRzJIN8XKP+KFfBCThsoAEBATBUUCl/DH/+eA4Ek398o/kwjHAIJXA6eIsIOlDQAdjB2PPpyyVyOk6LCqi76VI6C9AJOHygCdjQHFoWdjlvUAWoVdOCOgbQEJxNxEmcPjQHD5Y98LAJMHcAyFv4VLt33LP7fMyj+TjY26k4zMAOm/45ULntxE44IHnpMHgAyxt4OniwDjmwecAUWX8Mf/54DAOQllEwUFcZfwx//ngCA2l/DH/+eA4DlNugOkywDjBgSaAUWX8Mf/54AgNxMFgD6X8Mf/54CgMwKUQbr2UGZU1lRGWbZZJlqWWgZb9ktmTNZMRk22TQlhgoA=\",Le=1077411840,Je=\"DEDKP+AIOEAsCThAhAk4QFIKOEC+CjhAbAo4QKgHOEAOCjhATgo4QJgJOEBYBzhAzAk4QFgHOEC6CDhA/gg4QCwJOECECThAzAg4QBIIOEBCCDhAyAg4QBYNOEAsCThA1gs4QMoMOECkBjhA9Aw4QKQGOECkBjhApAY4QKQGOECkBjhApAY4QKQGOECkBjhAcgs4QKQGOEDyCzhAygw4QA==\",ze=1070295976;var Ne=Object.freeze({__proto__:null,ESP32C2ROM:class extends Ye{constructor(){super(...arguments),this.CHIP_NAME=\"ESP32-C2\",this.IMAGE_CHIP_ID=12,this.EFUSE_BASE=1610647552,this.MAC_EFUSE_REG=this.EFUSE_BASE+64,this.UART_CLKDIV_REG=1610612756,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612860,this.XTAL_CLK_DIVIDER=1,this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=0,this.FLASH_SIZES={\"1MB\":0,\"2MB\":16,\"4MB\":32,\"8MB\":48,\"16MB\":64},this.SPI_REG_BASE=1610620928,this.SPI_USR_OFFS=24,this.SPI_USR1_OFFS=28,this.SPI_USR2_OFFS=32,this.SPI_MOSI_DLEN_OFFS=36,this.SPI_MISO_DLEN_OFFS=40,this.SPI_W0_OFFS=88,this.TEXT_START=Le,this.ENTRY=Ke,this.DATA_START=ze,this.ROM_DATA=Je,this.ROM_TEXT=xe}async getPkgVersion(A){const t=this.EFUSE_BASE+64+4;return await A.readReg(t)>>22&7}async getChipRevision(A){const t=this.EFUSE_BASE+64+4;return(await A.readReg(t)&3<<20)>>20}async getChipDescription(A){let t;const e=await this.getPkgVersion(A);t=0===e||1===e?\"ESP32-C2\":\"unknown ESP32-C2\";return t+=\" (revision \"+await this.getChipRevision(A)+\")\",t}async getChipFeatures(A){return[\"Wi-Fi\",\"BLE\"]}async getCrystalFreq(A){const t=await A.readReg(this.UART_CLKDIV_REG)&this.UART_CLKDIV_MASK,e=A.transport.baudrate*t/1e6/this.XTAL_CLK_DIVIDER;let i;return i=e>33?40:26,Math.abs(i-e)>1&&A.info(\"WARNING: Unsupported crystal in use\"),i}async changeBaudRate(A){26===await this.getCrystalFreq(A)&&A.changeBaud()}_d2h(A){const t=(+A).toString(16);return 1===t.length?\"0\"+t:t}async readMac(A){let t=await A.readReg(this.MAC_EFUSE_REG);t>>>=0;let e=await A.readReg(this.MAC_EFUSE_REG+4);e=e>>>0&65535;const i=new Uint8Array(6);return i[0]=e>>8&255,i[1]=255&e,i[2]=t>>24&255,i[3]=t>>16&255,i[4]=t>>8&255,i[5]=255&t,this._d2h(i[0])+\":\"+this._d2h(i[1])+\":\"+this._d2h(i[2])+\":\"+this._d2h(i[3])+\":\"+this._d2h(i[4])+\":\"+this._d2h(i[5])}getEraseSize(A,t){return t}}}),ve=1082132112,je=\"QREixCbCBsa39wBgEUc3BIRA2Mu39ABgEwQEANxAkYuR57JAIkSSREEBgoCIQBxAE3X1D4KX3bcBEbcHAGBOxoOphwBKyDcJhEAmylLEBs4izLcEAGB9WhMJCQDATBN09A8N4PJAYkQjqDQBQknSRLJJIkoFYYKAiECDJwkAE3X1D4KXfRTjGUT/yb8TBwAMlEGqh2MY5QCFR4XGI6AFAHlVgoAFR2OH5gAJRmONxgB9VYKAQgUTB7ANQYVjlecCiUecwfW3kwbADWMW1QCYwRMFAAyCgJMG0A19VWOV1wCYwRMFsA2CgLc1hUBBEZOFRboGxmE/Y0UFBrc3hUCTh8exA6cHCAPWRwgTdfUPkwYWAMIGwYIjktcIMpcjAKcAA9dHCJFnk4cHBGMe9wI3t4RAEwfHsaFnupcDpgcIt/aEQLc3hUCTh8exk4bGtWMf5gAjpscII6DXCCOSBwghoPlX4wb1/LJAQQGCgCOm1wgjoOcI3bc3NwBgfEudi/X/NycAYHxLnYv1/4KAQREGxt03tzcAYCOmBwI3BwAImMOYQ33/yFeyQBNF9f8FiUEBgoBBEQbG2T993TcHAEC3NwBgmMM3NwBgHEP9/7JAQQGCgEERIsQ3BIRAkwcEAUrAA6kHAQbGJsJjCgkERTc5xb1HEwQEAYFEY9YnAQREvYiTtBQAfTeFPxxENwaAABOXxwCZ4DcGAAG39v8AdY+3NgBg2MKQwphCff9BR5HgBUczCelAupcjKCQBHMSyQCJEkkQCSUEBgoABEQbOIswlNzcEzj9sABMFRP+XAID/54Cg8qqHBUWV57JHk/cHID7GiTc3NwBgHEe3BkAAEwVE/9WPHMeyRZcAgP/ngCDwMzWgAPJAYkQFYYKAQRG3B4RABsaThwcBBUcjgOcAE9fFAJjHBWd9F8zDyMf5jTqVqpWxgYzLI6oHAEE3GcETBVAMskBBAYKAAREizDcEhECTBwQBJsrER07GBs5KyKqJEwQEAWPzlQCuhKnAAylEACaZE1nJABxIY1XwABxEY175ArU9fd1IQCaGzoWXAID/54Ag4xN19Q8BxZMHQAxcyFxAppdcwFxEhY9cxPJAYkTSREJJskkFYYKAaTVtv0ERBsaXAID/54BA1gNFhQGyQHUVEzUVAEEBgoBBEQbGxTcNxbcHhECThwcA1EOZzjdnCWATBwcRHEM3Bv3/fRbxjzcGAwDxjtWPHMOyQEEBgoBBEQbGbTcRwQ1FskBBARcDgP9nAIPMQREGxpcAgP/ngEDKcTcBxbJAQQHZv7JAQQGCgEERBsYTBwAMYxrlABMFsA3RPxMFwA2yQEEB6bcTB7AN4xvl/sE3EwXQDfW3QREixCbCBsYqhLMEtQBjF5QAskAiRJJEQQGCgANFBAAFBE0/7bc1cSbLTsf9coVp/XQizUrJUsVWwwbPk4SE+haRk4cJB6aXGAizhOcAKokmhS6ElwCA/+eAwC+ThwkHGAgFarqXs4pHQTHkBWd9dZMFhfqTBwcHEwWF+RQIqpczhdcAkwcHB66Xs4XXACrGlwCA/+eAgCwyRcFFlTcBRYViFpH6QGpE2kRKSbpJKkqaSg1hgoCiiWNzigCFaU6G1oVKhZcAgP/ngADJE3X1DwHtTobWhSaFlwCA/+eAwCdOmTMENEFRtxMFMAZVvxMFAAzZtTFx/XIFZ07XUtVW017PBt8i3SbbStla0WLNZstqyW7H/XcWkRMHBwc+lxwIupc+xiOqB/iqiS6Ksoq2iwU1kwcAAhnBtwcCAD6FlwCA/+eAYCCFZ2PlVxMFZH15EwmJ+pMHBAfKlxgIM4nnAEqFlwCA/+eA4B59exMMO/mTDIv5EwcEB5MHBAcUCGKX5peBRDMM1wCzjNcAUk1jfE0JY/GkA0GomT+ihQgBjTW5NyKGDAFKhZcAgP/ngMAaopmilGP1RAOzh6RBY/F3AzMEmkBj84oAVoQihgwBToWXAID/54BAuBN19Q9V3QLMAUR5XY1NowkBAGKFlwCA/+eAgKd9+QNFMQHmhVE8Y08FAOPijf6FZ5OHBweilxgIupfalyOKp/gFBPG34xWl/ZFH4wX09gVnfXWTBwcHkwWF+hMFhfkUCKqXM4XXAJMHBweul7OF1wAqxpcAgP/ngOAQcT0yRcFFZTNRPdU5twcCABnhkwcAAj6FlwCA/+eA4A2FYhaR+lBqVNpUSlm6WSpamloKW/pLakzaTEpNuk0pYYKAt1dBSRlxk4f3hAFFht6i3KbaytjO1tLU1tLa0N7O4szmyurI7sY+zpcAgP/ngMCgcTENwTdnCWATBwcRHEO3BoRAI6L2ALcG/f/9FvWPwWbVjxzDpTEFzbcnC2A3R9hQk4aHwRMHF6qYwhOGB8AjIAYAI6AGAJOGB8KYwpOHx8GYQzcGBABRj5jDI6AGALcHhEA3N4VAk4cHABMHx7ohoCOgBwCRB+Pt5/5FO5FFaAh1OWUzt7eEQJOHx7EhZz6XIyD3CLcHgEA3CYRAk4eHDiMg+QC3OYVA1TYTCQkAk4nJsWMHBRC3BwFgRUcjoOcMhUVFRZcAgP/ngED5twWAQAFGk4UFAEVFlwCA/+eAQPo39wBgHEs3BQIAk+dHABzLlwCA/+eAQPm3FwlgiF+BRbcEhEBxiWEVEzUVAJcAgP/ngAChwWf9FxMHABCFZkFmtwUAAQFFk4QEAQ1qtzqEQJcAgP/ngACXJpoTi8qxg6fJCPXfg6vJCIVHI6YJCCMC8QKDxxsACUcjE+ECowLxAgLUTUdjgecIUUdjj+cGKUdjn+cAg8c7AAPHKwCiB9mPEUdjlucAg6eLAJxDPtRxOaFFSBBlNoPHOwADxysAogfZjxFnQQdjdPcEEwWwDZk2EwXADYE2EwXgDi0+vTFBt7cFgEABRpOFhQMVRZcAgP/ngADrNwcAYFxHEwUAApPnFxBcxzG3yUcjE/ECTbcDxxsA0UZj5+YChUZj5uYAAUwTBPAPhah5FxN39w/JRuPo5v63NoVACgeThga7NpcYQwKHkwYHA5P29g8RRuNp1vwTB/cCE3f3D41GY+vmCLc2hUAKB5OGxr82lxhDAocTB0ACY5jnEALUHUQBRWE8AUVFPOE22TahRUgQfRTBPHX0AUwBRBN19A9hPBN1/A9JPG024x4E6oPHGwBJR2Nj9y4JR+N29+r1F5P39w89R+Ng9+o3N4VAigcTB8fAupecQ4KHBUSd63AQgUUBRZfwf//ngAB0HeHRRWgQjTwBRDGoBUSB75fwf//ngAB5MzSgACmgIUdjhecABUQBTGG3A6yLAAOkywCzZ4wA0gf19+/wv4h98cFsIpz9HH19MwWMQFXcs3eVAZXjwWwzBYxAY+aMAv18MwWMQFXQMYGX8H//54CAdVX5ZpT1tzGBl/B//+eAgHRV8WqU0bdBgZfwf//ngMBzUfkzBJRBwbchR+OJ5/ABTBMEAAwxt0FHzb9BRwVE45zn9oOlywADpYsA1TKxv0FHBUTjkuf2A6cLAZFnY+XnHIOlSwEDpYsA7/D/gzW/QUcFROOS5/SDpwsBEWdjZfcaA6fLAIOlSwEDpYsAM4TnAu/wf4EjrAQAIySKsDG3A8cEAGMOBxADp4sAwRcTBAAMYxP3AMBIAUeTBvAOY0b3AoPHWwADx0sAAUyiB9mPA8drAEIHXY+Dx3sA4gfZj+OB9uYTBBAMqb0zhusAA0aGAQUHsY7ht4PHBADxw9xEY5gHEsBII4AEAH21YUdjlucCg6fLAQOniwGDpksBA6YLAYOlywADpYsAl/B//+eAQGQqjDM0oAAptQFMBUQRtRFHBUTjmufmA6WLAIFFl/B//+eAwGmRtRP39wDjGgfsk9xHABOEiwABTH1d43mc3UhEl/B//+eAwE0YRFRAEED5jmMHpwEcQhNH9/99j9mOFMIFDEEE2b8RR0m9QUcFROOc5+CDp4sAA6dLASMm+QAjJOkA3bODJYkAwReR5YnPAUwTBGAMtbsDJ8kAY2b3BhP3NwDjHgfkAyjJAAFGAUczBehAs4blAGNp9wDjCQbUIyapACMk2QCZszOG6wAQThEHkMIFRum/IUcFROOW59oDJMkAGcATBIAMIyYJACMkCQAzNIAASbsBTBMEIAwRuwFMEwSADDGzAUwTBJAMEbMTByANY4PnDBMHQA3jkOe8A8Q7AIPHKwAiBF2Ml/B//+eA4EwDrMQAQRRjc4QBIozjDgy4wEBilDGAnEhjVfAAnERjW/QK7/BP0XXdyEBihpOFiwGX8H//54DgSAHFkwdADNzI3EDil9zA3ESzh4dB3MSX8H//54DAR4m+CWUTBQVxA6zLAAOkiwCX8H//54BAOLcHAGDYS7cGAAHBFpNXRwESB3WPvYvZj7OHhwMBRbPVhwKX8H//54BgORMFgD6X8H//54DgNBG2g6ZLAQOmCwGDpcsAA6WLAO/wT/79tIPFOwCDxysAE4WLAaIF3Y3BFe/wL9vZvO/wj8o9v4PHOwADxysAE4yLAaIH2Y8TjQf/BUS3O4VA3ERjBQ0AmcNjTIAAY1AEChMHcAzYyOOfB6iTB5AMYaiTh8u6mEO3t4RAk4fHsZmPPtaDJ4qwtzyEQGrQk4wMAZONy7oFSGNz/QANSELGOsTv8I/DIkcySDcFhEDihXwQk4bKsRAQEwWFApfwf//ngEA0glcDp4ywg6UNADMN/UAdjz6cslcjpOywKoS+lSOgvQCTh8qxnY0BxaFn45L19lqF7/CvziOgbQGZvy3044MHoJMHgAzcyPW6g6eLAOObB57v8C/ZCWUTBQVxl/B//+eAoCLv8K/Ul/B//+eA4CbRugOkywDjBwSc7/Cv1hMFgD6X8H//54BAIO/wT9IClFW67/DP0fZQZlTWVEZZtlkmWpZaBlv2S2ZM1kxGTbZNCWGCgAAA\",Ze=1082130432,We=\"HCuEQEIKgECSCoBA6gqAQI4LgED6C4BAqAuAQA4JgEBKC4BAiguAQP4KgEC+CIBAMguAQL4IgEAcCoBAYgqAQJIKgEDqCoBALgqAQHIJgECiCYBAKgqAQEwOgECSCoBAEg2AQAQOgED+B4BALA6AQP4HgED+B4BA/geAQP4HgED+B4BA/geAQP4HgED+B4BArgyAQP4HgEAwDYBABA6AQA==\",Xe=1082469292;class qe extends fe{constructor(){super(...arguments),this.CHIP_NAME=\"ESP32-C6\",this.IMAGE_CHIP_ID=13,this.EFUSE_BASE=1611335680,this.MAC_EFUSE_REG=this.EFUSE_BASE+68,this.UART_CLKDIV_REG=1072955412,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612860,this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=0,this.FLASH_SIZES={\"1MB\":0,\"2MB\":16,\"4MB\":32,\"8MB\":48,\"16MB\":64},this.SPI_REG_BASE=1610620928,this.SPI_USR_OFFS=24,this.SPI_USR1_OFFS=28,this.SPI_USR2_OFFS=32,this.SPI_MOSI_DLEN_OFFS=36,this.SPI_MISO_DLEN_OFFS=40,this.SPI_W0_OFFS=88,this.TEXT_START=Ze,this.ENTRY=ve,this.DATA_START=Xe,this.ROM_DATA=We,this.ROM_TEXT=je}async getPkgVersion(A){const t=this.EFUSE_BASE+68+12;return await A.readReg(t)>>21&7}async getChipRevision(A){const t=this.EFUSE_BASE+68+12;return(await A.readReg(t)&7<<18)>>18}async getChipDescription(A){let t;t=0===await this.getPkgVersion(A)?\"ESP32-C6\":\"unknown ESP32-C6\";return t+=\" (revision \"+await this.getChipRevision(A)+\")\",t}async getChipFeatures(A){return[\"Wi-Fi 6\",\"BT 5\",\"IEEE802.15.4\"]}async getCrystalFreq(A){return 40}_d2h(A){const t=(+A).toString(16);return 1===t.length?\"0\"+t:t}async readMac(A){let t=await A.readReg(this.MAC_EFUSE_REG);t>>>=0;let e=await A.readReg(this.MAC_EFUSE_REG+4);e=e>>>0&65535;const i=new Uint8Array(6);return i[0]=e>>8&255,i[1]=255&e,i[2]=t>>24&255,i[3]=t>>16&255,i[4]=t>>8&255,i[5]=255&t,this._d2h(i[0])+\":\"+this._d2h(i[1])+\":\"+this._d2h(i[2])+\":\"+this._d2h(i[3])+\":\"+this._d2h(i[4])+\":\"+this._d2h(i[5])}getEraseSize(A,t){return t}}var Ve=Object.freeze({__proto__:null,ESP32C6ROM:qe}),$e=1082132164,Ai=\"QREixCbCBsa39wBgEUc3BIRA2Mu39ABgEwQEANxAkYuR57JAIkSSREEBgoCIQBxAE3X1D4KX3bcBEbcHAGBOxoOphwBKyDcJhEAmylLEBs4izLcEAGB9WhMJCQDATBN09D8N4PJAYkQjqDQBQknSRLJJIkoFYYKAiECDJwkAE3X1D4KXfRTjGUT/yb8TBwAMlEGqh2MY5QCFR4XGI6AFAHlVgoAFR2OH5gAJRmONxgB9VYKAQgUTB7ANQYVjlecCiUecwfW3kwbADWMW1QCYwRMFAAyCgJMG0A19VWOV1wCYwRMFsA2CgLc1hUBBEZOFhboGxmE/Y0UFBrc3hUCThweyA6cHCAPWRwgTdfUPkwYWAMIGwYIjktcIMpcjAKcAA9dHCJFnk4cHBGMe9wI3t4RAEwcHsqFnupcDpgcIt/aEQLc3hUCThweyk4YGtmMf5gAjpscII6DXCCOSBwghoPlX4wb1/LJAQQGCgCOm1wgjoOcI3bc3NwBgfEudi/X/NycAYHxLnYv1/4KAQREGxt03tzcAYCOmBwI3BwAImMOYQ33/yFeyQBNF9f8FiUEBgoBBEQbG2T993TcHAEC3NwBgmMM3NwBgHEP9/7JAQQGCgEERIsQ3hIRAkwdEAUrAA6kHAQbGJsJjCgkERTc5xb1HEwREAYFEY9YnAQREvYiTtBQAfTeFPxxENwaAABOXxwCZ4DcGAAG39v8AdY+3NgBg2MKQwphCff9BR5HgBUczCelAupcjKCQBHMSyQCJEkkQCSUEBgoABEQbOIswlNzcEzj9sABMFRP+XAID/54Cg86qHBUWV57JHk/cHID7GiTc3NwBgHEe3BkAAEwVE/9WPHMeyRZcAgP/ngCDxMzWgAPJAYkQFYYKAQRG3h4RABsaTh0cBBUcjgOcAE9fFAJjHBWd9F8zDyMf5jTqVqpWxgYzLI6oHAEE3GcETBVAMskBBAYKAAREizDeEhECTB0QBJsrER07GBs5KyKqJEwREAWPzlQCuhKnAAylEACaZE1nJABxIY1XwABxEY175ArU9fd1IQCaGzoWXAID/54Ag5BN19Q8BxZMHQAxcyFxAppdcwFxEhY9cxPJAYkTSREJJskkFYYKAaTVtv0ERBsaXAID/54CA1gNFhQGyQHUVEzUVAEEBgoBBEQbGxTcNxbcHhECThwcA1EOZzjdnCWATB8cQHEM3Bv3/fRbxjzcGAwDxjtWPHMOyQEEBgoBBEQbGbTcRwQ1FskBBARcDgP9nAIPMQREGxibCIsSqhJcAgP/ngKDJWTcNyTcHhECTBgcAg9eGABMEBwCFB8IHwYMjlPYAkwYADGOG1AATB+ADY3X3AG03IxQEALJAIkSSREEBgoBBEQbGEwcADGMa5QATBbANRTcTBcANskBBAVm/EwewDeMb5f5xNxMF0A31t0ERIsQmwgbGKoSzBLUAYxeUALJAIkSSREEBgoADRQQABQRNP+23NXEmy07H/XKFaf10Is1KyVLFVsMGz5OEhPoWkZOHCQemlxgIs4TnACqJJoUuhJcAgP/ngEAxk4cJBxgIBWq6l7OKR0Ex5AVnfXWTBYX6kwcHBxMFhfkUCKqXM4XXAJMHBweul7OF1wAqxpcAgP/ngAAuMkXBRZU3AUWFYhaR+kBqRNpESkm6SSpKmkoNYYKAooljc4oAhWlOhtaFSoWXAID/54DAxhN19Q8B7U6G1oUmhZcAgP/ngEApTpkzBDRBUbcTBTAGVb8TBQAMSb0xcf1yBWdO11LVVtNezwbfIt0m20rZWtFizWbLaslux/13FpETBwcHPpccCLqXPsYjqgf4qokuirKKtov1M5MHAAIZwbcHAgA+hZcAgP/ngCAghWdj5VcTBWR9eRMJifqTBwQHypcYCDOJ5wBKhZcAgP/ngGAgfXsTDDv5kwyL+RMHBAeTBwQHFAhil+aXgUQzDNcAs4zXAFJNY3xNCWPxpANBqJk/ooUIAY01uTcihgwBSoWXAID/54BAHKKZopRj9UQDs4ekQWPxdwMzBJpAY/OKAFaEIoYMAU6FlwCA/+eAALYTdfUPVd0CzAFEeV2NTaMJAQBihZcAgP/ngECkffkDRTEB5oWFNGNPBQDj4o3+hWeThwcHopcYCLqX2pcjiqf4BQTxt+MVpf2RR+MF9PYFZ311kwcHB5MFhfoTBYX5FAiqlzOF1wCTBwcHrpezhdcAKsaXAID/54BgEnE9MkXBRWUzUT3BMbcHAgAZ4ZMHAAI+hZcAgP/ngKANhWIWkfpQalTaVEpZulkqWppaClv6S2pM2kxKTbpNKWGCgLdXQUkZcZOH94QBRYbeotym2srYztbS1NbS2tDezuLM5srqyO7GPs6XAID/54DAnaE5Ec23Zwlgk4fHEJhDtwaEQCOi5gC3BgMAVY+Ywy05Bc23JwtgN0fYUJOGh8ETBxeqmMIThgfAIyAGACOgBgCThgfCmMKTh8fBmEM3BgQAUY+YwyOgBgC3B4RANzeFQJOHBwATBwe7IaAjoAcAkQfj7ef+XTuRRWgIyTF9M7e3hECThweyIWc+lyMg9wi3B4BANwmEQJOHhw4jIPkAtzmFQF0+EwkJAJOJCbJjBgUQtwcBYBMHEAIjqOcMhUVFRZcAgP/ngAD5twWAQAFGk4UFAEVFlwCA/+eAQPq39wBgEUeYyzcFAgCXAID/54CA+bcXCWCIX4FFt4SEQHGJYRUTNRUAlwCA/+eAgJ/BZ/0XEwcAEIVmQWa3BQABAUWThEQBtwqEQA1qlwCA/+eAQJUTi0oBJpqDp8kI9d+Dq8kIhUcjpgkIIwLxAoPHGwAJRyMT4QKjAvECAtRNR2OB5whRR2OP5wYpR2Of5wCDxzsAA8crAKIH2Y8RR2OW5wCDp4sAnEM+1FUxoUVIEEU+g8c7AAPHKwCiB9mPEWdBB2N09wQTBbANKT4TBcANET4TBeAOOTadOUG3twWAQAFGk4WFAxVFlwCA/+eAQOs3BwBgXEcTBQACk+cXEFzHMbfJRyMT8QJNtwPHGwDRRmPn5gKFRmPm5gABTBME8A+FqHkXE3f3D8lG4+jm/rc2hUAKB5OGRrs2lxhDAoeTBgcDk/b2DxFG42nW/BMH9wITd/cPjUZj6+YItzaFQAoHk4YGwDaXGEMChxMHQAJjmOcQAtQdRAFFtTQBRWU8wT75NqFFSBB9FOE8dfQBTAFEE3X0D0U0E3X8D2k8TT7jHgTqg8cbAElHY2j3MAlH43b36vUXk/f3Dz1H42D36jc3hUCKBxMHB8G6l5xDgocFRJ3rcBCBRQFFl/B//+eAgHEd4dFFaBCtPAFEMagFRIHvl/B//+eAQHczNKAAKaAhR2OF5wAFRAFMYbcDrIsAA6TLALNnjADSB/X37/D/hX3xwWwinP0cfX0zBYxAVdyzd5UBlePBbDMFjEBj5owC/XwzBYxAVdAxgZfwf//ngMBzVflmlPW3MYGX8H//54DAclXxapTRt0GBl/B//+eAAHJR+TMElEHBtyFH44nn8AFMEwQADDG3QUfNv0FHBUTjnOf2g6XLAAOliwD1MrG/QUcFROOS5/YDpwsBkWdj6uceg6VLAQOliwDv8D+BNb9BRwVE45Ln9IOnCwERZ2Nq9xwDp8sAg6VLAQOliwAzhOcC7/Cv/iOsBAAjJIqwMbcDxwQAYwMHFAOniwDBFxMEAAxjE/cAwEgBR5MG8A5jRvcCg8dbAAPHSwABTKIH2Y8Dx2sAQgddj4PHewDiB9mP44H25hMEEAypvTOG6wADRoYBBQexjuG3g8cEAP3H3ERjnQcUwEgjgAQAfbVhR2OW5wKDp8sBA6eLAYOmSwEDpgsBg6XLAAOliwCX8H//54CAYiqMMzSgACm1AUwFRBG1EUcFROOa5+a3lwBgtF9ld30XBWb5jtGOA6WLALTftFeBRfmO0Y601/Rf+Y7RjvTf9FN1j1GP+NOX8H//54CgZSm9E/f3AOMVB+qT3EcAE4SLAAFMfV3jdJzbSESX8H//54AgSBhEVEAQQPmOYwenARxCE0f3/32P2Y4UwgUMQQTZvxFHpbVBRwVE45fn3oOniwADp0sBIyj5ACMm6QB1u4MlyQDBF5Hlic8BTBMEYAyJuwMnCQFjZvcGE/c3AOMZB+IDKAkBAUYBRzMF6ECzhuUAY2n3AOMEBtIjKKkAIybZADG7M4brABBOEQeQwgVG6b8hRwVE45Hn2AMkCQEZwBMEgAwjKAkAIyYJADM0gAClswFMEwQgDO2xAUwTBIAMzbEBTBMEkAzpuRMHIA1jg+cMEwdADeOb57gDxDsAg8crACIEXYyX8H//54CASAOsxABBFGNzhAEijOMJDLbAQGKUMYCcSGNV8ACcRGNb9Arv8O/Ldd3IQGKGk4WLAZfwf//ngIBEAcWTB0AM3MjcQOKX3MDcRLOHh0HcxJfwf//ngGBDJbYJZRMFBXEDrMsAA6SLAJfwf//ngKAytwcAYNhLtwYAAcEWk1dHARIHdY+9i9mPs4eHAwFFs9WHApfwf//ngAA0EwWAPpfwf//ngEAv6byDpksBA6YLAYOlywADpYsA7/Av/NG0g8U7AIPHKwAThYsBogXdjcEV7/DP1XW07/AvxT2/A8Q7AIPHKwATjIsBIgRdjNxEQRTN45FHhUtj/4cIkweQDNzIQbQDpw0AItAFSLOH7EA+1oMnirBjc/QADUhCxjrE7/CvwCJHMkg3hYRA4oV8EJOGSgEQEBMFxQKX8H//54CgMTe3hECTCEcBglcDp4iwg6UNAB2MHY8+nLJXI6TosKqLvpUjoL0Ak4dKAZ2NAcWhZ2OX9QBahe/wb8sjoG0BCcTcRJnD409w92PfCwCTB3AMvbeFS7c9hUC3jIRAk40Nu5OMTAHpv+OdC5zcROOKB5yTB4AMqbeDp4sA45MHnO/wb9MJZRMFBXGX8H//54CgHO/w786X8H//54BgIVWyA6TLAOMPBJjv8O/QEwWAPpfwf//ngEAa7/CPzAKUUbLv8A/M9lBmVNZURlm2WSZalloGW/ZLZkzWTEZNtk0JYYKAAAA=\",ti=1082130432,ei=\"FACEQG4KgEC+CoBAFguAQOQLgEBQDIBA/guAQDoJgECgC4BA4AuAQCoLgEDqCIBAXguAQOoIgEBICoBAjgqAQL4KgEAWC4BAWgqAQJ4JgEDOCYBAVgqAQKgOgEC+CoBAaA2AQGAOgEAqCIBAiA6AQCoIgEAqCIBAKgiAQCoIgEAqCIBAKgiAQCoIgEAqCIBABA2AQCoIgECGDYBAYA6AQA==\",ii=1082469296;var si=Object.freeze({__proto__:null,ESP32C5ROM:class extends qe{constructor(){super(...arguments),this.CHIP_NAME=\"ESP32-C5\",this.IMAGE_CHIP_ID=23,this.EFUSE_BASE=1611352064,this.EFUSE_BLOCK1_ADDR=this.EFUSE_BASE+68,this.MAC_EFUSE_REG=this.EFUSE_BASE+68,this.UART_CLKDIV_REG=1610612756,this.TEXT_START=ti,this.ENTRY=$e,this.DATA_START=ii,this.ROM_DATA=ei,this.ROM_TEXT=Ai,this.EFUSE_RD_REG_BASE=this.EFUSE_BASE+48,this.EFUSE_PURPOSE_KEY0_REG=this.EFUSE_BASE+52,this.EFUSE_PURPOSE_KEY0_SHIFT=24,this.EFUSE_PURPOSE_KEY1_REG=this.EFUSE_BASE+52,this.EFUSE_PURPOSE_KEY1_SHIFT=28,this.EFUSE_PURPOSE_KEY2_REG=this.EFUSE_BASE+56,this.EFUSE_PURPOSE_KEY2_SHIFT=0,this.EFUSE_PURPOSE_KEY3_REG=this.EFUSE_BASE+56,this.EFUSE_PURPOSE_KEY3_SHIFT=4,this.EFUSE_PURPOSE_KEY4_REG=this.EFUSE_BASE+56,this.EFUSE_PURPOSE_KEY4_SHIFT=8,this.EFUSE_PURPOSE_KEY5_REG=this.EFUSE_BASE+56,this.EFUSE_PURPOSE_KEY5_SHIFT=12,this.EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT_REG=this.EFUSE_RD_REG_BASE,this.EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT=1<<20,this.EFUSE_SPI_BOOT_CRYPT_CNT_REG=this.EFUSE_BASE+52,this.EFUSE_SPI_BOOT_CRYPT_CNT_MASK=7<<18,this.EFUSE_SECURE_BOOT_EN_REG=this.EFUSE_BASE+56,this.EFUSE_SECURE_BOOT_EN_MASK=1<<20,this.IROM_MAP_START=1107296256,this.IROM_MAP_END=1115684864,this.DROM_MAP_START=1115684864,this.DROM_MAP_END=1124073472,this.PCR_SYSCLK_CONF_REG=1611227408,this.PCR_SYSCLK_XTAL_FREQ_V=127<<24,this.PCR_SYSCLK_XTAL_FREQ_S=24,this.XTAL_CLK_DIVIDER=1,this.UARTDEV_BUF_NO=1082520860,this.CHIP_DETECT_MAGIC_VALUE=[285294703],this.FLASH_FREQUENCY={\"80m\":15,\"40m\":0,\"20m\":2},this.MEMORY_MAP=[[0,65536,\"PADDING\"],[1115684864,1124073472,\"DROM\"],[1082130432,1082523648,\"DRAM\"],[1082130432,1082523648,\"BYTE_ACCESSIBLE\"],[1073979392,1074003968,\"DROM_MASK\"],[1073741824,1073979392,\"IROM_MASK\"],[1107296256,1115684864,\"IROM\"],[1082130432,1082523648,\"IRAM\"],[1342177280,1342193664,\"RTC_IRAM\"],[1342177280,1342193664,\"RTC_DRAM\"],[1611653120,1611661312,\"MEM_INTERNAL2\"]],this.UF2_FAMILY_ID=4145808195,this.EFUSE_MAX_KEY=5,this.KEY_PURPOSES={0:\"USER/EMPTY\",1:\"ECDSA_KEY\",2:\"XTS_AES_256_KEY_1\",3:\"XTS_AES_256_KEY_2\",4:\"XTS_AES_128_KEY\",5:\"HMAC_DOWN_ALL\",6:\"HMAC_DOWN_JTAG\",7:\"HMAC_DOWN_DIGITAL_SIGNATURE\",8:\"HMAC_UP\",9:\"SECURE_BOOT_DIGEST0\",10:\"SECURE_BOOT_DIGEST1\",11:\"SECURE_BOOT_DIGEST2\",12:\"KM_INIT_KEY\"}}async getPkgVersion(A){return await A.readReg(this.EFUSE_BLOCK1_ADDR+8)>>26&7}async getMinorChipVersion(A){return await A.readReg(this.EFUSE_BLOCK1_ADDR+8)>>0&15}async getMajorChipVersion(A){return await A.readReg(this.EFUSE_BLOCK1_ADDR+8)>>4&3}async getChipDescription(A){let t;t=0===await this.getPkgVersion(A)?\"ESP32-C5\":\"unknown ESP32-C5\";return`${t} (revision v${await this.getMajorChipVersion(A)}.${await this.getMinorChipVersion(A)})`}async getCrystalFreq(A){const t=await A.readReg(this.UART_CLKDIV_REG)&this.UART_CLKDIV_MASK,e=A.transport.baudrate*t/1e6/this.XTAL_CLK_DIVIDER;let i;return i=e>45?48:e>33?40:26,Math.abs(i-e)>1&&A.info(\"WARNING: Unsupported crystal in use\"),i}async getCrystalFreqRomExpect(A){return(await A.readReg(this.PCR_SYSCLK_CONF_REG)&this.PCR_SYSCLK_XTAL_FREQ_V)>>this.PCR_SYSCLK_XTAL_FREQ_S}}}),ai=1082132112,ni=\"QREixCbCBsa39wBgEUc3BINA2Mu39ABgEwQEANxAkYuR57JAIkSSREEBgoCIQBxAE3X1D4KX3bcBEbcHAGBOxoOphwBKyDcJg0AmylLEBs4izLcEAGB9WhMJCQDATBN09A8N4PJAYkQjqDQBQknSRLJJIkoFYYKAiECDJwkAE3X1D4KXfRTjGUT/yb8TBwAMlEGqh2MY5QCFR4XGI6AFAHlVgoAFR2OH5gAJRmONxgB9VYKAQgUTB7ANQYVjlecCiUecwfW3kwbADWMW1QCYwRMFAAyCgJMG0A19VWOV1wCYwRMFsA2CgLc1hEBBEZOFRboGxmE/Y0UFBrc3hECTh8exA6cHCAPWRwgTdfUPkwYWAMIGwYIjktcIMpcjAKcAA9dHCJFnk4cHBGMe9wI3t4NAEwfHsaFnupcDpgcIt/aDQLc3hECTh8exk4bGtWMf5gAjpscII6DXCCOSBwghoPlX4wb1/LJAQQGCgCOm1wgjoOcI3bc3NwBgfEudi/X/NycAYHxLnYv1/4KAQREGxt03tzcAYCOmBwI3BwAImMOYQ33/yFeyQBNF9f8FiUEBgoBBEQbG2T993TcHAEC3NwBgmMM3NwBgHEP9/7JAQQGCgEERIsQ3hINAkwcEAUrAA6kHAQbGJsJjCgkERTc5xb1HEwQEAYFEY9YnAQREvYiTtBQAfTeFPxxENwaAABOXxwCZ4DcGAAG39v8AdY+3NgBg2MKQwphCff9BR5HgBUczCelAupcjKCQBHMSyQCJEkkQCSUEBgoABEQbOIswlNzcEhUBsABMFBP+XAID/54Ag8qqHBUWV57JHk/cHID7GiTc3NwBgHEe3BkAAEwUE/9WPHMeyRZcAgP/ngKDvMzWgAPJAYkQFYYKAQRG3h4NABsaThwcBBUcjgOcAE9fFAJjHBWd9F8zDyMf5jTqVqpWxgYzLI6oHAEE3GcETBVAMskBBAYKAAREizDeEg0CTBwQBJsrER07GBs5KyKqJEwQEAWPzlQCuhKnAAylEACaZE1nJABxIY1XwABxEY175ArU9fd1IQCaGzoWXAID/54Cg4hN19Q8BxZMHQAxcyFxAppdcwFxEhY9cxPJAYkTSREJJskkFYYKAaTVtv0ERBsaXAID/54BA1gNFhQGyQHUVEzUVAEEBgoBBEQbGxTcNxbcHg0CThwcA1EOZzjdnCWATB8cQHEM3Bv3/fRbxjzcGAwDxjtWPHMOyQEEBgoBBEQbGbTcRwQ1FskBBARcDgP9nAIPMQREGxpcAgP/ngEDKcTcBxbJAQQHZv7JAQQGCgEERBsYTBwAMYxrlABMFsA3RPxMFwA2yQEEB6bcTB7AN4xvl/sE3EwXQDfW3QREixCbCBsYqhLMEtQBjF5QAskAiRJJEQQGCgANFBAAFBE0/7bc1cSbLTsf9coVp/XQizUrJUsVWwwbPk4SE+haRk4cJB6aXGAizhOcAKokmhS6ElwCA/+eAgCyThwkHGAgFarqXs4pHQTHkBWd9dZMFhfqTBwcHEwWF+RQIqpczhdcAkwcHB66Xs4XXACrGlwCA/+eAQCkyRcFFlTcBRYViFpH6QGpE2kRKSbpJKkqaSg1hgoCiiWNzigCFaU6G1oVKhZcAgP/ngIDIE3X1DwHtTobWhSaFlwCA/+eAgCROmTMENEFRtxMFMAZVvxMFAAzZtTFx/XIFZ07XUtVW017PBt8i3SbbStla0WLNZstqyW7H/XcWkRMHBwc+lxwIupc+xiOqB/iqiS6Ksoq2iwU1kwcAAhnBtwcCAD6FlwCA/+eAIB2FZ2PlVxMFZH15EwmJ+pMHBAfKlxgIM4nnAEqFlwCA/+eAoBt9exMMO/mTDIv5EwcEB5MHBAcUCGKX5peBRDMM1wCzjNcAUk1jfE0JY/GkA0GomT+ihQgBjTW5NyKGDAFKhZcAgP/ngIAXopmilGP1RAOzh6RBY/F3AzMEmkBj84oAVoQihgwBToWXAID/54DAtxN19Q9V3QLMAUR5XY1NowkBAGKFlwCA/+eAgKd9+QNFMQHmhVE8Y08FAOPijf6FZ5OHBweilxgIupfalyOKp/gFBPG34xWl/ZFH4wX09gVnfXWTBwcHkwWF+hMFhfkUCKqXM4XXAJMHBweul7OF1wAqxpcAgP/ngKANcT0yRcFFZTNRPdU5twcCABnhkwcAAj6FlwCA/+eAoAqFYhaR+lBqVNpUSlm6WSpamloKW/pLakzaTEpNuk0pYYKAt1dBSRlxk4f3hAFFht6i3KbaytjO1tLU1tLa0N7O4szmyurI7sY+zpcAgP/ngMCgcTENwTdnCWATB8cQHEO3BoNAI6L2ALcG/f/9FvWPwWbVjxzDpTEFzbcnC2A3R9hQk4bHwRMHF6qYwhOGB8AjIAYAI6AGAJOGR8KYwpOHB8KYQzcGBABRj5jDI6AGALcHg0A3N4RAk4cHABMHx7ohoCOgBwCRB+Pt5/5FO5FFaAh1OWUzt7eDQJOHx7EhZz6XIyD3CLcHgEA3CYNAk4eHDiMg+QC3OYRA1TYTCQkAk4nJsWMHBRC3BwFgRUcjqucIhUVFRZcAgP/ngAD2twWAQAFGk4UFAEVFlwCA/+eAAPc39wBgHEs3BQIAk+dHABzLlwCA/+eAAPa3FwlgiF+BRbeEg0BxiWEVEzUVAJcAgP/ngICgwWf9FxMHABCFZkFmtwUAAQFFk4QEAbcKg0ANapcAgP/ngICWE4sKASaag6fJCPXfg6vJCIVHI6YJCCMC8QKDxxsACUcjE+ECowLxAgLUTUdjgecIUUdjj+cGKUdjn+cAg8c7AAPHKwCiB9mPEUdjlucAg6eLAJxDPtRxOaFFSBBlNoPHOwADxysAogfZjxFnQQdjdPcEEwWwDZk2EwXADYE2EwXgDi0+vTFBt7cFgEABRpOFhQMVRZcAgP/ngMDnNwcAYFxHEwUAApPnFxBcxzG3yUcjE/ECTbcDxxsA0UZj5+YChUZj5uYAAUwTBPAPhah5FxN39w/JRuPo5v63NoRACgeThga7NpcYQwKHkwYHA5P29g8RRuNp1vwTB/cCE3f3D41GY+vmCLc2hEAKB5OGxr82lxhDAocTB0ACY5jnEALUHUQBRWE8AUVFPOE22TahRUgQfRTBPHX0AUwBRBN19A9hPBN1/A9JPG024x4E6oPHGwBJR2Nj9y4JR+N29+r1F5P39w89R+Ng9+o3N4RAigcTB8fAupecQ4KHBUSd63AQgUUBRZfwf//ngAB0HeHRRWgQjTwBRDGoBUSB75fwf//ngIB4MzSgACmgIUdjhecABUQBTGG3A6yLAAOkywCzZ4wA0gf19+/wv4h98cFsIpz9HH19MwWMQFXcs3eVAZXjwWwzBYxAY+aMAv18MwWMQFXQMYGX8H//54AAdVX5ZpT1tzGBl/B//+eAAHRV8WqU0bdBgZfwf//ngEBzUfkzBJRBwbchR+OJ5/ABTBMEAAwxt0FHzb9BRwVE45zn9oOlywADpYsA1TKxv0FHBUTjkuf2A6cLAZFnY+XnHIOlSwEDpYsA7/D/gzW/QUcFROOS5/SDpwsBEWdjZfcaA6fLAIOlSwEDpYsAM4TnAu/wf4EjrAQAIySKsDG3A8cEAGMOBxADp4sAwRcTBAAMYxP3AMBIAUeTBvAOY0b3AoPHWwADx0sAAUyiB9mPA8drAEIHXY+Dx3sA4gfZj+OB9uYTBBAMqb0zhusAA0aGAQUHsY7ht4PHBADxw9xEY5gHEsBII4AEAH21YUdjlucCg6fLAQOniwGDpksBA6YLAYOlywADpYsAl/B//+eAwGMqjDM0oAAptQFMBUQRtRFHBUTjmufmA6WLAIFFl/B//+eAQGmRtRP39wDjGgfsk9xHABOEiwABTH1d43mc3UhEl/B//+eAwE0YRFRAEED5jmMHpwEcQhNH9/99j9mOFMIFDEEE2b8RR0m9QUcFROOc5+CDp4sAA6dLASMm+QAjJOkA3bODJYkAwReR5YnPAUwTBGAMtbsDJ8kAY2b3BhP3NwDjHgfkAyjJAAFGAUczBehAs4blAGNp9wDjCQbUIyapACMk2QCZszOG6wAQThEHkMIFRum/IUcFROOW59oDJMkAGcATBIAMIyYJACMkCQAzNIAASbsBTBMEIAwRuwFMEwSADDGzAUwTBJAMEbMTByANY4PnDBMHQA3jkOe8A8Q7AIPHKwAiBF2Ml/B//+eAYEwDrMQAQRRjc4QBIozjDgy4wEBilDGAnEhjVfAAnERjW/QK7/BP0XXdyEBihpOFiwGX8H//54BgSAHFkwdADNzI3EDil9zA3ESzh4dB3MSX8H//54BAR4m+CWUTBQVxA6zLAAOkiwCX8H//54BAOLcHAGDYS7cGAAHBFpNXRwESB3WPvYvZj7OHhwMBRbPVhwKX8H//54BgORMFgD6X8H//54DgNBG2g6ZLAQOmCwGDpcsAA6WLAO/wT/79tIPFOwCDxysAE4WLAaIF3Y3BFe/wL9vZvO/wj8o9vwPEOwCDxysAE4yLASIEXYzcREEUzeORR4VLY/+HCJMHkAzcyG20A6cNACLQBUizh+xAPtaDJ4qwY3P0AA1IQsY6xO/wD8YiRzJIN4WDQOKFfBCThgoBEBATBYUCl/B//+eAwDY3t4NAkwgHAYJXA6eIsIOlDQAdjB2PPpyyVyOk6LCqi76VI6C9AJOHCgGdjQHFoWdjl/UAWoXv8M/QI6BtAQnE3ESZw+NPcPdj3wsAkwdwDL23hUu3PYRAt4yDQJONzbqTjAwB6b/jkgug3ETjjweekweADKm3g6eLAOOYB57v8M/YCWUTBQVxl/B//+eAQCLv8E/Ul/B//+eAgCb5sgOkywDjBASc7/BP1hMFgD6X8H//54DgH+/w79EClH2y7/Bv0fZQZlTWVEZZtlkmWpZaBlv2S2ZM1kxGTbZNCWGCgA==\",Ei=1082130432,hi=\"EACDQEIKgECSCoBA6gqAQI4LgED6C4BAqAuAQA4JgEBKC4BAiguAQP4KgEC+CIBAMguAQL4IgEAcCoBAYgqAQJIKgEDqCoBALgqAQHIJgECiCYBAKgqAQFIOgECSCoBAEg2AQAoOgED+B4BAMg6AQP4HgED+B4BA/geAQP4HgED+B4BA/geAQP4HgED+B4BArgyAQP4HgEAwDYBACg6AQA==\",ri=1082403756;var gi=Object.freeze({__proto__:null,ESP32H2ROM:class extends fe{constructor(){super(...arguments),this.CHIP_NAME=\"ESP32-H2\",this.IMAGE_CHIP_ID=16,this.EFUSE_BASE=1610647552,this.MAC_EFUSE_REG=this.EFUSE_BASE+68,this.UART_CLKDIV_REG=1072955412,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612860,this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=0,this.FLASH_SIZES={\"1MB\":0,\"2MB\":16,\"4MB\":32,\"8MB\":48,\"16MB\":64},this.SPI_REG_BASE=1610620928,this.SPI_USR_OFFS=24,this.SPI_USR1_OFFS=28,this.SPI_USR2_OFFS=32,this.SPI_MOSI_DLEN_OFFS=36,this.SPI_MISO_DLEN_OFFS=40,this.SPI_W0_OFFS=88,this.USB_RAM_BLOCK=2048,this.UARTDEV_BUF_NO_USB=3,this.UARTDEV_BUF_NO=1070526796,this.TEXT_START=Ei,this.ENTRY=ai,this.DATA_START=ri,this.ROM_DATA=hi,this.ROM_TEXT=ni}async getChipDescription(A){return this.CHIP_NAME}async getChipFeatures(A){return[\"BLE\",\"IEEE802.15.4\"]}async getCrystalFreq(A){return 32}_d2h(A){const t=(+A).toString(16);return 1===t.length?\"0\"+t:t}async postConnect(A){const t=255&await A.readReg(this.UARTDEV_BUF_NO);A.debug(\"In _post_connect \"+t),t==this.UARTDEV_BUF_NO_USB&&(A.ESP_RAM_BLOCK=this.USB_RAM_BLOCK)}async readMac(A){let t=await A.readReg(this.MAC_EFUSE_REG);t>>>=0;let e=await A.readReg(this.MAC_EFUSE_REG+4);e=e>>>0&65535;const i=new Uint8Array(6);return i[0]=e>>8&255,i[1]=255&e,i[2]=t>>24&255,i[3]=t>>16&255,i[4]=t>>8&255,i[5]=255&t,this._d2h(i[0])+\":\"+this._d2h(i[1])+\":\"+this._d2h(i[2])+\":\"+this._d2h(i[3])+\":\"+this._d2h(i[4])+\":\"+this._d2h(i[5])}getEraseSize(A,t){return t}}}),oi=1077381696,Bi=\"FIADYACAA2BIAMo/BIADYDZBAIH7/wxJwCAAmQjGBAAAgfj/wCAAqAiB9/+goHSICOAIACH2/8AgAIgCJ+jhHfAAAAAIAABgHAAAYBAAAGA2QQAh/P/AIAA4AkH7/8AgACgEICCUnOJB6P9GBAAMODCIAcAgAKgIiASgoHTgCAALImYC6Ib0/yHx/8AgADkCHfAAAOwryz9kq8o/hIAAAEBAAACk68o/8CvLPzZBALH5/yCgdBARIKUrAZYaBoH2/5KhAZCZEZqYwCAAuAmR8/+goHSaiMAgAJIYAJCQ9BvJwMD0wCAAwlgAmpvAIACiSQDAIACSGACB6v+QkPSAgPSHmUeB5f+SoQGQmRGamMAgAMgJoeX/seP/h5wXxgEAfOiHGt7GCADAIACJCsAgALkJRgIAwCAAuQrAIACJCZHX/5qIDAnAIACSWAAd8AAAVCAAYFQwAGA2QQCR/f/AIACICYCAJFZI/5H6/8AgAIgJgIAkVkj/HfAAAAAsIABgACAAYAAAAAg2QQAQESCl/P8h+v8MCMAgAIJiAJH6/4H4/8AgAJJoAMAgAJgIVnn/wCAAiAJ88oAiMCAgBB3wAAAAAEA2QQAQESDl+/8Wav+B7P+R+//AIACSaADAIACYCFZ5/x3wAAAUKABANkEAIKIggf3/4AgAHfAAAHDi+j8IIABgvAoAQMgKAEA2YQAQESBl9P8x+f+9Aa0Dgfr/4AgATQoMEuzqiAGSogCQiBCJARARIOX4/5Hy/6CiAcAgAIgJoIggwCAAiQm4Aa0Dge7/4AgAoCSDHfAAAFgAyj//DwAABCAAQOgIAEA2QQCB+/8MGZJIADCcQZkokfn/ORgpODAwtJoiKjMwPEEMAjlIKViB9P/gCAAnGgiB8//gCAAGAwAQESAl9v8tCowaIqDFHfC4CABANoEAgev/4AgAHAYGDAAAAGBUQwwIDBrQlREMjTkx7QKJYalRmUGJIYkR2QEsDwzMDEuB8v/gCABQRMBaM1oi5hTNDAId8AAA////AAQgAGD0CABADAkAQAAJAEA2gQAx0f8oQxaCERARIGXm/xb6EAz4DAQnqAyIIwwSgIA0gCSTIEB0EBEgZej/EBEgJeH/gcf/4AgAFjoKqCOB6/9AKhEW9AQnKDyBwv/gCACB6P/gCADoIwwCDBqpYalRHI9A7hEMjcKg2AxbKUEpMSkhKREpAYHK/+AIAIG1/+AIAIYCAAAAoKQhgdv/4AgAHAoGIAAAACcoOYGu/+AIAIHU/+AIAOgjDBIcj0DuEQyNLAwMW60CKWEpUUlBSTFJIUkRSQGBtv/gCACBov/gCABGAQCByf/gCAAMGoYNAAAoIwwZQCIRkIkBzBSAiQGRv/+QIhCRvv/AIAAiaQAhW//AIACCYgDAIACIAlZ4/xwKDBJAooMoQ6AiwClDKCOqIikjHfAAADaBAIGK/+AIACwGhg8AAACBr//gCABgVEMMCAwa0JUR7QKpYalRiUGJMZkhORGJASwPDI3CoBKyoASBj//gCACBe//gCABaM1oiUETA5hS/HfAAABQKAEA2YQBBcf9YNFAzYxajC1gUWlNQXEFGAQAQESBl5v9oRKYWBWIkAmel7hARIGXM/xZq/4Fn/+AIABaaBmIkAYFl/+AIAGBQdIKhAFB4wHezCM0DvQKtBgYPAM0HvQKtBlLV/xARICX0/zpVUFhBDAjGBQAAAADCoQCJARARIKXy/4gBctcBG4iAgHRwpoBwsoBXOOFww8AQESDl8P+BTv/gCACGBQCoFM0DvQKB1P/gCACgoHSMSiKgxCJkBSgUOiIpFCg0MCLAKTQd8ABcBwBANkEAgf7/4AgAggoYDAmCyPwMEoApkx3wNkEAgfj/4AgAggoYDAmCyP0MEoApkx3wvP/OP0QAyj9MAMo/QCYAQDQmAEDQJgBANmEAfMitAoeTLTH3/8YFAACoAwwcvQGB9//gCACBj/6iAQCICOAIAKgDgfP/4AgA5hrdxgoAAABmAyYMA80BDCsyYQCB7v/gCACYAYHo/zeZDagIZhoIMeb/wCAAokMAmQgd8EAAyj8AAMo/KCYAQDZBACH8/4Hc/8gCqAix+v+B+//gCAAMCIkCHfCQBgBANkEAEBEgpfP/jLqB8v+ICIxIEBEgpfz/EBEg5fD/FioAoqAEgfb/4AgAHfBIBgBANkEAEBEgpfD/vBqR5v+ICRuoqQmR5f8MCoqZIkkAgsjBDBmAqYOggHTMiqKvQKoiIJiTnNkQESBl9/9GBQCtAoHv/+AIABARIOXq/4xKEBEg5ff/HfAAADZBAKKgwBARIOX5/x3wAAA2QQCCoMCtAoeSEaKg2xARIGX4/6Kg3EYEAAAAAIKg24eSCBARICX3/6Kg3RARIKX2/x3wNkEAOjLGAgAAogIAGyIQESCl+/83kvEd8AAAAFwcAEAgCgBAaBwAQHQcAEA2ISGi0RCB+v/gCABGEAAAAAwUQEQRgcb+4AgAQENjzQS9AYyqrQIQESCltf8GAgAArQKB8P/gCACgoHT8Ws0EELEgotEQgez/4AgASiJAM8BWw/siogsQIrAgoiCy0RCB5//gCACtAhwLEBEgZfb/LQOGAAAioGMd8AAAiCYAQIQbAECUJgBAkBsAQDZBABARIGXb/6yKDBNBcf/wMwGMsqgEgfb/4AgArQPGCQCtA4H0/+AIAKgEgfP/4AgABgkAEBEgpdb/DBjwiAEsA6CDg60IFpIAgez/4AgAhgEAAIHo/+AIAB3wYAYAQDZBIWKkHeBmERpmWQYMF1KgAGLREFClIEB3EVJmGhARIOX3/0e3AsZCAK0Ggbb/4AgAxi8AUHPAgYP+4AgAQHdjzQe9AYy6IKIgEBEgpaT/BgIAAK0Cgaz/4AgAoKB0jJoMCIJmFn0IBhIAABARIGXj/70HrQEQESDl5v8QESBl4v/NBxCxIGCmIIGg/+AIAHoielU3tcmSoQfAmRGCpB0ameCIEZgJGoiICJB1wIc3gwbr/wwJkkZsoqQbEKqggc//4AgAVgr/sqILogZsELuwEBEg5acA9+oS9kcPkqINEJmwepmiSQAbd4bx/3zpl5rBZkcSgqEHkiYawIgRGoiZCDe5Ape1iyKiCxAisL0GrQKBf//gCAAQESCl2P+tAhwLEBEgJdz/EBEgpdf/DBoQESDl5v8d8AAAyj9PSEFJsIAAYKE62FCYgABguIAAYCoxHY+0gABg9CvLP6yAN0CYIAxg7IE3QKyFN0AIAAhggCEMYBCAN0AQgANgUIA3QAwAAGA4QABglCzLP///AAAsgQBgjIAAABBAAAD4K8s/CCzLP1AAyj9UAMo/VCzLPxQAAGDw//8A9CvLP2Qryj9wAMo/gAcAQHgbAEC4JgBAZCYAQHQfAEDsCgBAVAkAQFAKAEAABgBAHCkAQCQnAEAIKABA5AYAQHSBBECcCQBA/AkAQAgKAECoBgBAhAkAQGwJAECQCQBAKAgAQNgGAEA24QAhxv8MCinBgeb/4AgAEBEgJbH/FpoEMcH/IcL/QcL/wCAAKQMMAsAgACkEwCAAKQNRvv8xvv9hvv/AIAA5BcAgADgGfPQQRAFAMyDAIAA5BsAgACkFxgEAAEkCSyIGAgAhrf8xtP9CoAA3MuwQESAlwf8MS6LBMBARIKXE/yKhARARIOW//0Fz/ZAiESokwCAASQIxqf8hS/05AhARIKWp/y0KFvoFIar+wav+qAIMK4Gt/uAIADGh/7Gi/xwaDAzAIACpA4G4/+AIAAwa8KoBgSr/4AgAsZv/qAIMFYGz/+AIAKgCgSL/4AgAqAKBsP/gCAAxlf/AIAAoA1AiIMAgACkDhhgAEBEgZaH/vBoxj/8cGrGP/8AgAKJjACDCIIGh/+AIADGM/wxFwCAAKAMMGlAiIMAgACkD8KoBxggAAACxhv/NCgxagZf/4AgAMYP/UqEBwCAAKAMsClAiIMAgACkDgQX/4AgAgZL/4AgAIXz/wCAAKALMuhzDMCIQIsL4DBMgo4MMC4GL/+AIAIGk/eAIAIzaoXP/gYj/4AgAgaH94AgA8XH/DB0MHAwb4qEAQN0RAMwRYLsBDAqBgP/gCAAha/8qRCGU/WLSK4YXAAAAUWH+wCAAMgUAMDB0FtMEDBrwqgHAIAAiRQCB4f7gCACionHAqhGBcv/gCACBcf/gCABxWv986MAgADgHfPqAMxAQqgHAIAA5B4Fr/+AIAIFr/+AIAK0CgWr/4AgAwCAAKAQWovkMB8AgADgEDBLAIAB5BCJBJCIDAQwoeaEiQSWCURMcN3cSJBxHdxIhZpIhIgMDcgMCgCIRcCIgZkISKCPAIAAoAimhhgEAAAAcIiJRExARIKWf/7KgCKLBJBARICWj/7IDAyIDAoC7ESBbICE0/yAg9FeyGqKgwBARIOWd/6Kg7hARIGWd/xARICWc/wba/yIDARxHJzc39iIbxvgAACLCLyAgdLZCAgYlAHEm/3AioCgCoAIAACLC/iAgdBwnJ7cCBu8AcSD/cCKgKAKgAgBywjBwcHS2V8VG6QAsSQwHIqDAlxUCRucAeaEMcq0HEBEgpZb/rQcQESAllv8QESCllP8QESBllP8Mi6LBJCLC/xARIKWX/1Yi/UZEAAwSVqU1wsEQvQWtBYEd/+AIAFaqNBxLosEQEBEgZZX/hrAADBJWdTOBF//gCACgJYPGygAmhQQMEsbIAHgjKDMghyCAgLRW2P4QESClQv8qd6zaBvj/AIEd/eAIAFBcQZwKrQWBRf3gCACGAwAAItLwRgMArQWBBf/gCAAW6v4G7f8gV8DMEsaWAFCQ9FZp/IYLAIEO/eAIAFBQ9ZxKrQWBNf3gCACGBAAAfPgAiBGKIkYDAK0Fgfb+4AgAFqr+Bt3/DBkAmREgV8AnOcVGCwAAAACB/vzgCABQXEGcCq0FgSb94AgAhgMAACLS8EYDAK0Fgeb+4AgAFur+Bs7/IFfAVuL8hncADAcioMAmhQLGlQAMBy0HBpQAJrX1BmoADBImtQIGjgC4M6gjDAcQESDlhv+gJ4OGiQAMGWa1X4hDIKkRDAcioMKHugLGhgC4U6gjkmEREBEg5Tf/kiERoJeDRg4ADBlmtTSIQyCpEQwHIqDCh7oCBnwAKDO4U6gjIHiCkmEREBEg5TT/Ic78DAiSIRGJYiLSK3JiAqCYgy0JBm8AAJHI/AwHogkAIqDGd5oCBm0AeCOyxfAioMC3lwEoWQwHkqDvRgIAeoOCCBgbd4CZMLcn8oIDBXIDBICIEXCIIHIDBgB3EYB3IIIDB4CIAXCIIICZwIKgwQwHkCiThlkAgbD8IqDGkggAfQkWiRWYOAwHIqDIdxkCxlIAKFiSSABGTgAciQwHDBKXFQLGTQD4c+hj2FPIQ7gzqCOBi/7gCAAMCH0KoCiDxkYAAAAMEiZFAsZBAKgjDAuBgf7gCAAGIAAAUJA0DAcioMB3GQJGPQBQVEGLw3z4Rg8AqDyCYRKSYRHCYRCBef7gCADCIRCCIRIoLHgcqAySIRFwchAmAg3AIADYCiAoMNAiECB3IMAgAHkKG5nCzBBXOb7Gk/9mRQJGkv8MByKgwEYmAAwSJrUCxiEAIVX+iFN4I4kCIVT+eQIMAgYdAKFQ/gwH6AoMGbLF8I0HLQewKZPgiYMgiBAioMZ3mF/BSv59CNgMIqDJtz1SsPAUIqDAVp8ELQiGAgAAKoOIaEsiiQeNCSp+IP3AtzLtFmjd+Qx5CsZz/wAMEmaFFyE6/ogCjBiCoMgMB3kCITb+eQIMEoAngwwHBgEADAcioP8goHQQESDlXP9woHQQESBlXP8QESDlWv9WYrUiAwEcJyc3IPYyAgbS/iLC/SAgdAz3J7cChs7+cSX+cCKgKAKgAgAAAHKg0ncSX3Kg1HeSAgYhAMbG/igzOCMQESDlQf+NClbKsKKiccCqEYJhEoEl/uAIAHEX/pEX/sAgAHgHgiEScLQ1wHcRkHcQcLsgILuCrQgwu8KBJP7gCACio+iBGf7gCABGsv4AANhTyEO4M6gjEBEgpWb/hq3+ALIDAyIDAoC7ESC7ILLL8KLDGBARICUs/4am/gAiAwNyAwKAIhFwIiCBEv7gCABxHPwiwvCIN4AiYxaSp4gXioKAjEFGAwAAAIJhEhARIKUQ/4IhEpInBKYZBZInApeo5xARIKX2/hZq/6gXzQKywxiBAf7gCACMOjKgxDlXOBcqMzkXODcgI8ApN4H7/eAIAIaI/gAAcgMCIsMYMgMDDBmAMxFwMyAyw/AGIwBx3P2Bi/uYBzmxkIjAiUGIJgwZh7MBDDmSYREQESDlCP+SIRGB1P2ZAegHodP93QggsiDCwSzywRCCYRKB5f3gCAC4Jp0KqLGCIRKgu8C5JqAzwLgHqiKoQQwMqrsMGrkHkMqDgLvAwNB0VowAwtuAwK2TFmoBrQiCYRKSYREQESClGv+CIRKSIRGCZwBR2ft4NYyjkI8xkIjA1igAVvf11qkAMdT7IqDHKVNGAACMOYz3BlX+FheVUc/7IqDIKVWGUf4xzPsioMkpU8ZO/igjVmKTEBEg5S//oqJxwKoRga/94AgAgbv94AgAxkb+KDMWYpEQESDlLf+io+iBqP3gCADgAgBGQP4d8AAANkEAnQKCoMAoA4eZD8wyDBKGBwAMAikDfOKGDwAmEgcmIhiGAwAAAIKg24ApI4eZKgwiKQN88kYIAAAAIqDcJ5kKDBIpAy0IBgQAAACCoN188oeZBgwSKQMioNsd8AAA\",wi=1077379072,ci=\"ZCvKP8qNN0CvjjdAcJM3QDqPN0DPjjdAOo83QJmPN0BmkDdA2ZA3QIGQN0BVjTdA/I83QFiQN0C8jzdA+5A3QOaPN0D7kDdAnY43QPqON0A6jzdAmY83QLWON0CWjTdAvJE3QDaTN0ByjDdAVpM3QHKMN0ByjDdAcow3QHKMN0ByjDdAcow3QHKMN0ByjDdAVpE3QHKMN0BRkjdANpM3QAQInwAAAAAAAAAYAQQIBQAAAAAAAAAIAQQIBgAAAAAAAAAAAQQIIQAAAAAAIAAAEQQI3AAAAAAAIAAAEQQIDAAAAAAAIAAAAQQIEgAAAAAAIAAAESAoDAAQAQAA\",Ci=1070279668;var Ii=Object.freeze({__proto__:null,ESP32S3ROM:class extends fe{constructor(){super(...arguments),this.CHIP_NAME=\"ESP32-S3\",this.IMAGE_CHIP_ID=9,this.EFUSE_BASE=1610641408,this.MAC_EFUSE_REG=this.EFUSE_BASE+68,this.UART_CLKDIV_REG=1610612756,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612864,this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=0,this.FLASH_SIZES={\"1MB\":0,\"2MB\":16,\"4MB\":32,\"8MB\":48,\"16MB\":64},this.SPI_REG_BASE=1610620928,this.SPI_USR_OFFS=24,this.SPI_USR1_OFFS=28,this.SPI_USR2_OFFS=32,this.SPI_MOSI_DLEN_OFFS=36,this.SPI_MISO_DLEN_OFFS=40,this.SPI_W0_OFFS=88,this.USB_RAM_BLOCK=2048,this.UARTDEV_BUF_NO_USB=3,this.UARTDEV_BUF_NO=1070526796,this.TEXT_START=wi,this.ENTRY=oi,this.DATA_START=Ci,this.ROM_DATA=ci,this.ROM_TEXT=Bi}async getChipDescription(A){return\"ESP32-S3\"}async getFlashCap(A){const t=this.EFUSE_BASE+68+12;return await A.readReg(t)>>27&7}async getFlashVendor(A){const t=this.EFUSE_BASE+68+16;return{1:\"XMC\",2:\"GD\",3:\"FM\",4:\"TT\",5:\"BY\"}[await A.readReg(t)>>0&7]||\"\"}async getPsramCap(A){const t=this.EFUSE_BASE+68+16;return await A.readReg(t)>>3&3}async getPsramVendor(A){const t=this.EFUSE_BASE+68+16;return{1:\"AP_3v3\",2:\"AP_1v8\"}[await A.readReg(t)>>7&3]||\"\"}async getChipFeatures(A){const t=[\"Wi-Fi\",\"BLE\"],e=await this.getFlashCap(A),i=await this.getFlashVendor(A),s={0:null,1:\"Embedded Flash 8MB\",2:\"Embedded Flash 4MB\"}[e],a=void 0!==s?s:\"Unknown Embedded Flash\";null!==s&&t.push(`${a} (${i})`);const n=await this.getPsramCap(A),E=await this.getPsramVendor(A),h={0:null,1:\"Embedded PSRAM 8MB\",2:\"Embedded PSRAM 2MB\"}[n],r=void 0!==h?h:\"Unknown Embedded PSRAM\";return null!==h&&t.push(`${r} (${E})`),t}async getCrystalFreq(A){return 40}_d2h(A){const t=(+A).toString(16);return 1===t.length?\"0\"+t:t}async postConnect(A){const t=255&await A.readReg(this.UARTDEV_BUF_NO);A.debug(\"In _post_connect \"+t),t==this.UARTDEV_BUF_NO_USB&&(A.ESP_RAM_BLOCK=this.USB_RAM_BLOCK)}async readMac(A){let t=await A.readReg(this.MAC_EFUSE_REG);t>>>=0;let e=await A.readReg(this.MAC_EFUSE_REG+4);e=e>>>0&65535;const i=new Uint8Array(6);return i[0]=e>>8&255,i[1]=255&e,i[2]=t>>24&255,i[3]=t>>16&255,i[4]=t>>8&255,i[5]=255&t,this._d2h(i[0])+\":\"+this._d2h(i[1])+\":\"+this._d2h(i[2])+\":\"+this._d2h(i[3])+\":\"+this._d2h(i[4])+\":\"+this._d2h(i[5])}getEraseSize(A,t){return t}}}),_i=1073907696,li=\"CAAAYBwAAGBIAP0/EAAAYDZBACH7/8AgADgCQfr/wCAAKAQgIJSc4kH4/0YEAAw4MIgBwCAAqAiIBKCgdOAIAAsiZgLohvT/IfH/wCAAOQId8AAA7Cv+P2Sr/T+EgAAAQEAAAKTr/T/wK/4/NkEAsfn/IKB0EBEgZQEBlhoGgfb/kqEBkJkRmpjAIAC4CZHz/6CgdJqIwCAAkhgAkJD0G8nAwPTAIADCWACam8AgAKJJAMAgAJIYAIHq/5CQ9ICA9IeZR4Hl/5KhAZCZEZqYwCAAyAmh5f+x4/+HnBfGAQB86Ica3sYIAMAgAIkKwCAAuQlGAgDAIAC5CsAgAIkJkdf/mogMCcAgAJJYAB3wAABUIEA/VDBAPzZBAJH9/8AgAIgJgIAkVkj/kfr/wCAAiAmAgCRWSP8d8AAAACwgQD8AIEA/AAAACDZBABARIKX8/yH6/wwIwCAAgmIAkfr/gfj/wCAAkmgAwCAAmAhWef/AIACIAnzygCIwICAEHfAAAAAAQDZBABARIOX7/xZq/4Hs/5H7/8AgAJJoAMAgAJgIVnn/HfAAAFgA/T////8ABCBAPzZBACH8/zhCFoMGEBEgZfj/FvoFDPgMBDeoDZgigJkQgqABkEiDQEB0EBEgJfr/EBEgJfP/iCIMG0CYEZCrAcwUgKsBse3/sJkQsez/wCAAkmsAkc7/wCAAomkAwCAAqAlWev8cCQwaQJqDkDPAmog5QokiHfAAAHDi+j8IIEA/hGIBQKRiAUA2YQAQESBl7f8x+f+9Aa0Dgfr/4AgATQoMEuzqiAGSogCQiBCJARARIOXx/5Hy/6CiAcAgAIgJoIggwCAAiQm4Aa0Dge7/4AgAoCSDHfAAAP8PAAA2QQCBxf8MGZJIADCcQZkokfv/ORgpODAwtJoiKjMwPEEMAilYOUgQESAl+P8tCowaIqDFHfAAAMxxAUA2QQBBtv9YNFAzYxZjBFgUWlNQXEFGAQAQESDl7P+IRKYYBIgkh6XvEBEgJeX/Fmr/qBTNA70CgfH/4AgAoKB0jEpSoMRSZAVYFDpVWRRYNDBVwFk0HfAA+Pz/P0QA/T9MAP0/ADIBQOwxAUAwMwFANmEAfMitAoeTLTH3/8YFAKgDDBwQsSCB9//gCACBK/+iAQCICOAIAKgDgfP/4AgA5hrcxgoAAABmAyYMA80BDCsyYQCB7v/gCACYAYHo/zeZDagIZhoIMeb/wCAAokMAmQgd8EAA/T8AAP0/jDEBQDZBACH8/4Hc/8gCqAix+v+B+//gCAAMCIkCHfBgLwFANkEAgf7/4AgAggoYDAmCyP4MEoApkx3w+Cv+P/Qr/j8YAEw/jABMP//z//82QQAQESDl/P8WWgSh+P+ICrzYgff/mAi8abH2/3zMwCAAiAuQkBTAiBCQiCDAIACJC4gKsfH/DDpgqhHAIACYC6CIEKHu/6CZEJCIIMAgAIkLHfAoKwFANkEAEBEgZff/vBqR0f+ICRuoqQmR0P8MCoqZIkkAgsjBDBmAqYOggHTMiqKvQKoiIJiTjPkQESAl8v/GAQCtAoHv/+AIAB3wNkEAoqDAEBEg5fr/HfAAADZBAIKgwK0Ch5IRoqDbEBEgZfn/oqDcRgQAAAAAgqDbh5IIEBEgJfj/oqDdEBEgpff/HfA2QQA6MsYCAKICACLCARARIKX7/zeS8B3wAAAAbFIAQIxyAUCMUgBADFMAQDYhIaLREIH6/+AIAEYLAAAADBRARBFAQ2PNBL0BrQKB9f/gCACgoHT8Ws0EELEgotEQgfH/4AgASiJAM8BWA/0iogsQIrAgoiCy0RCB7P/gCACtAhwLEBEgpff/LQOGAAAioGMd8AAAQCsBQDZBABARICXl/4y6gYj/iAiMSBARICXi/wwKgfj/4AgAHfAAAIQyAUC08QBAkDIBQMDxAEA2QQAQESDl4f+smjFc/4ziqAOB9//gCACiogDGBgAAAKKiAIH0/+AIAKgDgfP/4AgARgUAAAAsCoyCgfD/4AgAhgEAAIHs/+AIAB3w8CsBQDZBIWKhB8BmERpmWQYMBWLREK0FUmYaEBEgZfn/DBhAiBFHuAJGRACtBoG1/+AIAIYzAACSpB1Qc8DgmREamUB3Y4kJzQe9ASCiIIGu/+AIAJKkHeCZERqZoKB0iAmMigwIgmYWfQiGFQCSpB3gmREamYkJEBEgpeL/vQetARARICXm/xARIKXh/80HELEgYKYggZ3/4AgAkqQd4JkRGpmICXAigHBVgDe1tJKhB8CZERqZmAmAdcCXtwJG3f+G5/8MCIJGbKKkGxCqoIHM/+AIAFYK/7KiC6IGbBC7sBARIGWbAPfqEvZHD7KiDRC7sHq7oksAG3eG8f9867eawWZHCIImGje4Aoe1nCKiCxAisGC2IK0CgX3/4AgAEBEgJdj/rQIcCxARIKXb/xARICXX/wwaEBEgpef/HfAAAP0/T0hBSfwr/j9sgAJASDwBQDyDAkAIAAhgEIACQAwAAGA4QEA///8AACiBQD+MgAAAEEAAAAAs/j8QLP4/UAD9P1QA/T9cLP4/FAAAYPD//wD8K/4/ZCv9P3AA/T9c8gBAiNgAQNDxAECk8QBA1DIBQFgyAUCg5ABABHABQAB1AUCASQFA6DUBQOw7AUCAAAFAmCABQOxwAUBscQFADHEBQIQpAUB4dgFA4HcBQJR2AUAAMABAaAABQDbBACHR/wwKKaGB5v/gCAAQESClvP8W6gQx+P5B9/7AIAAoA1H3/ikEwCAAKAVh8f6ioGQpBmHz/mAiEGKkAGAiIMAgACkFgdj/4AgASAR8wkAiEAwkQCIgwCAAKQOGAQBJAksixgEAIbf/Mbj/DAQ3Mu0QESAlw/8MS6LBKBARIKXG/yKhARARIOXB/0H2/ZAiESokwCAASQIxrf8h3v0yYgAQESBls/8WOgYhov7Bov6oAgwrgaT+4AgADJw8CwwKgbr/4AgAsaP/DAwMmoG4/+AIAKKiAIE3/+AIALGe/6gCUqABgbP/4AgAqAKBLv/gCACoAoGw/+AIADGY/8AgACgDUCIgwCAAKQMGCgAAsZT/zQoMWoGm/+AIADGR/1KhAcAgACgDLApQIiDAIAApA4Eg/+AIAIGh/+AIACGK/8AgACgCzLocwzAiECLC+AwTIKODDAuBmv/gCADxg/8MHQwcsqAB4qEAQN0RAMwRgLsBoqAAgZP/4AgAIX7/KkQhDf5i0itGFwAAAFFs/sAgADIFADAwdBbDBKKiAMAgACJFAIEC/+AIAKKiccCqEYF+/+AIAIGE/+AIAHFt/3zowCAAOAd8+oAzEBCqAcAgADkHgX7/4AgAgX3/4AgAIKIggXz/4AgAwCAAKAQWsvkMB8AgADgEDBLAIAB5BCJBHCIDAQwoeYEiQR2CUQ8cN3cSIhxHdxIjZpIlIgMDcgMCgCIRcCIgZkIWKCPAIAAoAimBhgIAHCKGAAAADMIiUQ8QESAlpv8Mi6LBHBARIOWp/7IDAyIDAoC7ESBbICFG/yAg9FeyHKKgwBARIKWk/6Kg7hARICWk/xARIKWi/0bZ/wAAIgMBHEcnNzf2IhlG4QAiwi8gIHS2QgKGJQBxN/9wIqAoAqACACLC/iAgdBwnJ7cCBtgAcTL/cCKgKAKgAgAAAHLCMHBwdLZXxMbRACxJDAcioMCXFQLGzwB5gQxyrQcQESAlnf+tBxARIKWc/xARICWb/xARIOWa/7KgCKLBHCLC/xARICWe/1YS/cYtAAwSVqUvwsEQvQWtBYEu/+AIAFaqLgzLosEQEBEg5Zv/hpgADBJWdS2BKP/gCACgJYPGsgAmhQQMEsawACgjeDNwgiCAgLRW2P4QESDlbv96IpwKBvj/oKxBgR3/4AgAVkr9ctfwcKLAzCcGhgAAoID0Vhj+hgMAoKD1gRb/4AgAVjr7UHfADBUAVRFwosB3NeWGAwCgrEGBDf/gCABWavly1/BwosBWp/5GdgAADAcioMAmhQKGlAAMBy0HxpIAJrX1hmgADBImtQKGjAC4M6IjAnKgABARIOWS/6Ang4aHAAwZZrVciEMgqREMByKgwoe6AgaFALhToiMCkmENEBEg5Wj/mNGgl4OGDQAMGWa1MYhDIKkRDAcioMKHugJGegAoM7hTqCMgeIKZ0RARIOVl/yFd/QwImNGJYiLSK3kioJiDLQnGbQCRV/0MB6IJACKgxneaAkZsAHgjssXwIqDAt5cBKFkMB5Kg70YCAHqDgggYG3eAmTC3J/KCAwVyAwSAiBFwiCByAwYAdxGAdyCCAweAiAFwiCCAmcCCoMEMB5Aok8ZYAIE//SKgxpIIAH0JFlkVmDgMByKgyHcZAgZSAChYkkgARk0AHIkMBwwSlxUCBk0A+HPoY9hTyEO4M6gjgbT+4AgADAh9CqAogwZGAAAADBImRQLGQACoIwwLgav+4AgABh8AUJA0DAcioMB3GQLGPABQVEGLw3z4hg4AAKg8ieGZ0cnBgZv+4AgAyMGI4SgseByoDJIhDXByECYCDsAgANIqACAoMNAiECB3IMAgAHkKG5nCzBBXOcJGlf9mRQLGk/8MByKgwIYmAAwSJrUCxiEAIX7+iFN4I4kCIX3+eQIMAgYdAKF5/gwH2AoMGbLF8I0HLQfQKYOwiZMgiBAioMZ3mGDBc/59COgMIqDJtz5TsPAUIqDAVq8ELQiGAgAAKoOIaEsiiQeNCSD+wCp9tzLtFsjd+Qx5CkZ1/wAMEmaFFyFj/ogCjBiCoMgMB3kCIV/+eQIMEoAngwwHRgEAAAwHIqD/IKB0EBEgZWn/cKB0EBEgpWj/EBEgZWf/VvK6IgMBHCcnNx/2MgJG6P4iwv0gIHQM9ye3Asbk/nFO/nAioCgCoAIAAHKg0ncSX3Kg1HeSAgYhAEbd/gAAKDM4IxARICVW/40KVkq2oqJxwKoRieGBR/7gCABxP/6RQP7AIAB4B4jhcLQ1wHcRkHcQcLsgILuCrQgwu8KBTf7gCACio+iBO/7gCADGyP4AANhTyEO4M6gjEBEgZXP/BsT+sgMDIgMCgLsRILsgssvwosMYEBEg5T7/Rr3+AAAiAwNyAwKAIhFwIiCBO/7gCABxrPwiwvCIN4AiYxYyrYgXioKAjEGGAgCJ4RARICUq/4IhDpInBKYZBJgnl6jpEBEgJSL/Fmr/qBfNArLDGIEr/uAIAIw6MqDEOVc4FyozORc4NyAjwCk3gSX+4AgABqD+AAByAwIiwxgyAwMMGYAzEXAzIDLD8AYiAHEG/oE5/OgHOZHgiMCJQYgmDBmHswEMOZJhDeJhDBARICUi/4H+/ZjR6MGh/f3dCL0CmQHCwSTywRCJ4YEP/uAIALgmnQqokYjhoLvAuSagM8C4B6oiqEEMDKq7DBq5B5DKg4C7wMDQdFZ8AMLbgMCtk5w6rQiCYQ6SYQ0QESDlLf+I4ZjRgmcAUWv8eDWMo5CPMZCIwNYoAFY39tapADFm/CKgxylTRgAAjDmcB4Zt/hY3m1Fh/CKgyClVBmr+ADFe/CKgySlTBmf+AAAoI1ZSmRARIOVS/6KiccCqEYHS/eAIABARICU6/4Hk/eAIAAZd/gAAKDMW0pYQESBlUP+io+iByf3gCAAQESClN//gAgCGVP4AEBEg5Tb/HfAAADZBAJ0CgqDAKAOHmQ/MMgwShgcADAIpA3zihg8AJhIHJiIYhgMAAACCoNuAKSOHmSoMIikDfPJGCAAAACKg3CeZCgwSKQMtCAYEAAAAgqDdfPKHmQYMEikDIqDbHfAAAA==\",di=1073905664,Mi=\"ZCv9PzaLAkDBiwJAhpACQEqMAkDjiwJASowCQKmMAkByjQJA5Y0CQI2NAkDAigJAC40CQGSNAkDMjAJACI4CQPaMAkAIjgJAr4sCQA6MAkBKjAJAqYwCQMeLAkACiwJAx44CQD2QAkDYiQJAZZACQNiJAkDYiQJA2IkCQNiJAkDYiQJA2IkCQNiJAkDYiQJAZI4CQNiJAkBZjwJAPZACQA==\",Di=1073622012;var Ri=Object.freeze({__proto__:null,ESP32S2ROM:class extends fe{constructor(){super(...arguments),this.CHIP_NAME=\"ESP32-S2\",this.IMAGE_CHIP_ID=2,this.MAC_EFUSE_REG=1061265476,this.EFUSE_BASE=1061265408,this.UART_CLKDIV_REG=1061158932,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612856,this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=4096,this.FLASH_SIZES={\"1MB\":0,\"2MB\":16,\"4MB\":32,\"8MB\":48,\"16MB\":64},this.SPI_REG_BASE=1061167104,this.SPI_USR_OFFS=24,this.SPI_USR1_OFFS=28,this.SPI_USR2_OFFS=32,this.SPI_W0_OFFS=88,this.SPI_MOSI_DLEN_OFFS=36,this.SPI_MISO_DLEN_OFFS=40,this.TEXT_START=di,this.ENTRY=_i,this.DATA_START=Di,this.ROM_DATA=Mi,this.ROM_TEXT=li}async getPkgVersion(A){const t=this.EFUSE_BASE+68+12;return await A.readReg(t)>>21&15}async getChipDescription(A){const t=[\"ESP32-S2\",\"ESP32-S2FH16\",\"ESP32-S2FH32\"],e=await this.getPkgVersion(A);return e>=0&&e<=2?t[e]:\"unknown ESP32-S2\"}async getFlashCap(A){const t=this.EFUSE_BASE+68+12;return await A.readReg(t)>>21&15}async getPsramCap(A){const t=this.EFUSE_BASE+68+12;return await A.readReg(t)>>28&15}async getBlock2Version(A){const t=this.EFUSE_BASE+92+16;return await A.readReg(t)>>4&7}async getChipFeatures(A){const t=[\"Wi-Fi\"],e={0:\"No Embedded Flash\",1:\"Embedded Flash 2MB\",2:\"Embedded Flash 4MB\"}[await this.getFlashCap(A)]||\"Unknown Embedded Flash\";t.push(e);const i={0:\"No Embedded Flash\",1:\"Embedded PSRAM 2MB\",2:\"Embedded PSRAM 4MB\"}[await this.getPsramCap(A)]||\"Unknown Embedded PSRAM\";t.push(i);const s={0:\"No calibration in BLK2 of efuse\",1:\"ADC and temperature sensor calibration in BLK2 of efuse V1\",2:\"ADC and temperature sensor calibration in BLK2 of efuse V2\"}[await this.getBlock2Version(A)]||\"Unknown Calibration in BLK2\";return t.push(s),t}async getCrystalFreq(A){return 40}_d2h(A){const t=(+A).toString(16);return 1===t.length?\"0\"+t:t}async readMac(A){let t=await A.readReg(this.MAC_EFUSE_REG);t>>>=0;let e=await A.readReg(this.MAC_EFUSE_REG+4);e=e>>>0&65535;const i=new Uint8Array(6);return i[0]=e>>8&255,i[1]=255&e,i[2]=t>>24&255,i[3]=t>>16&255,i[4]=t>>8&255,i[5]=255&t,this._d2h(i[0])+\":\"+this._d2h(i[1])+\":\"+this._d2h(i[2])+\":\"+this._d2h(i[3])+\":\"+this._d2h(i[4])+\":\"+this._d2h(i[5])}getEraseSize(A,t){return t}}}),Si=1074843652,Qi=\"qBAAQAH//0Z0AAAAkIH/PwgB/z+AgAAAhIAAAEBAAABIQf8/lIH/PzH5/xLB8CAgdAJhA4XvATKv/pZyA1H0/0H2/zH0/yAgdDA1gEpVwCAAaANCFQBAMPQbQ0BA9MAgAEJVADo2wCAAIkMAIhUAMev/ICD0N5I/Ieb/Meb/Qen/OjLAIABoA1Hm/yeWEoYAAAAAAMAgACkEwCAAWQNGAgDAIABZBMAgACkDMdv/OiIMA8AgADJSAAgxEsEQDfAAoA0AAJiB/z8Agf4/T0hBSais/z+krP8/KNAQQEzqEEAMAABg//8AAAAQAAAAAAEAAAAAAYyAAAAQQAAAAAD//wBAAAAAgf4/BIH+PxAnAAAUAABg//8PAKis/z8Igf4/uKz/PwCAAAA4KQAAkI//PwiD/z8Qg/8/rKz/P5yv/z8wnf8/iK//P5gbAAAACAAAYAkAAFAOAABQEgAAPCkAALCs/z+0rP8/1Kr/PzspAADwgf8/DK//P5Cu/z+ACwAAEK7/P5Ct/z8BAAAAAAAAALAVAADx/wAAmKz/P5iq/z+8DwBAiA8AQKgPAEBYPwBAREYAQCxMAEB4SABAAEoAQLRJAEDMLgBA2DkAQEjfAECQ4QBATCYAQIRJAEAhvP+SoRCQEcAiYSMioAACYUPCYULSYUHiYUDyYT8B6f/AAAAhsv8xs/8MBAYBAABJAksiNzL4hbUBIqCMDEMqIcWnAYW0ASF8/8F6/zGr/yoswCAAyQIhqP8MBDkCMaj/DFIB2f/AAAAxpv8ioQHAIABIAyAkIMAgACkDIqAgAdP/wAAAAdL/wAAAAdL/wAAAcZ3/UZ7/QZ7/MZ7/YqEADAIBzf/AAAAhnP8xYv8qI8AgADgCFnP/wCAA2AIMA8AgADkCDBIiQYQiDQEMJCJBhUJRQzJhIiaSCRwzNxIghggAAAAiDQMyDQKAIhEwIiBmQhEoLcAgACgCImEiBgEAHCIiUUOFqAEioIQMgxoiBZsBIg0DMg0CgCIRMDIgIX//N7ITIqDAxZUBIqDuRZUBxaUBRtz/AAAiDQEMtEeSAgaZACc0Q2ZiAsbLAPZyIGYyAoZxAPZCCGYiAsZWAEbKAGZCAgaHAGZSAsarAIbGACaCefaCAoarAAyUR5ICho8AZpICBqMABsAAHCRHkgJGfAAnNCcM9EeSAoY+ACc0CwzUR5IChoMAxrcAAGayAkZLABwUR5ICRlgARrMAQqDRRxJoJzQRHDRHkgJGOABCoNBHEk/GrAAAQqDSR5IChi8AMqDTN5ICRpcFRqcALEIMDieTAgZqBUYrACKgAEWIASKgAAWIAYWYAUWYASKghDKgCBoiC8yFigFW3P0MDs0ORpsAAMwThl8FRpUAJoMCxpMABmAFAWn/wAAA+sycIsaPAAAAICxBAWb/wAAAVhIj8t/w8CzAzC+GaQUAIDD0VhP+4Sv/hgMAICD1AV7/wAAAVtIg4P/A8CzA9z7qhgMAICxBAVf/wAAAVlIf8t/w8CzAVq/+RloFJoOAxgEAAABmswJG3f8MDsKgwIZ4AAAAZrMCRkQFBnIAAMKgASazAgZwACItBDEX/+KgAMKgwiezAsZuADhdKC1FdgFGPAUAwqABJrMChmYAMi0EIQ7/4qAAwqDCN7ICRmUAKD0MHCDjgjhdKC2FcwEx9/4MBEljMtMr6SMgxIMGWgAAIfP+DA5CAgDCoMbnlALGWADIUigtMsPwMCLAQqDAIMSTIs0YTQJioO/GAQBSBAAbRFBmMCBUwDcl8TINBVINBCINBoAzEQAiEVBDIEAyICINBwwOgCIBMCIgICbAMqDBIMOThkMAAAAh2f4MDjICAMKgxueTAsY+ADgywqDI5xMCBjwA4kIAyFIGOgAcggwODBwnEwIGNwAGCQVmQwKGDwVGMAAwIDQMDsKgwOcSAoYwADD0QYvtzQJ888YMACg+MmExAQL/wAAASC4oHmIuACAkEDIhMSYEDsAgAFImAEBDMFBEEEAiIMAgACkGG8zizhD3PMjGgf9mQwJGgP8Gov9mswIG+QTGFgAAAGHA/gwOSAYMFTLD8C0OQCWDMF6DUCIQwqDG55JLcbn+7QKIB8KgyTc4PjBQFMKgwKLNGIzVBgwAWiooAktVKQRLRAwSUJjANzXtFmLaSQaZB8Zn/2aDAoblBAwcDA7GAQAAAOKgAMKg/8AgdMVeAeAgdIVeAQVvAVZMwCINAQzzNxIxJzMVZkICxq4EZmIChrMEJjICxvn+BhkAABwjN5ICxqgEMqDSNxJFHBM3EgJG8/5GGQAhlP7oPdItAgHA/sAAACGS/sAgADgCIZH+ICMQ4CKC0D0gxYoBPQItDAG5/sAAACKj6AG2/sAAAMbj/lhdSE04PSItAoVqAQbg/gAyDQMiDQKAMxEgMyAyw/AizRgFSQHG2f4AAABSzRhSYSQiDQMyDQKAIhEwIiAiwvAiYSoMH4Z0BCF3/nGW/rIiAGEy/oKgAyInApIhKoJhJ7DGwCc5BAwaomEnsmE2hTkBsiE2cW3+UiEkYiEqcEvAykRqVQuEUmElgmEshwQCxk0Ed7sCRkwEmO2iLRBSLRUobZJhKKJhJlJhKTxTyH3iLRT4/SezAkbuAzFc/jAioCgCoAIAMUL+DA4MEumT6YMp0ymj4mEm/Q7iYSjNDkYGAHIhJwwTcGEEfMRgQ5NtBDliXQtyISQG4AMAgiEkkiElITP+l7jZMggAG3g5goYGAKIhJwwjMGoQfMUMFGBFg20EOWJdC0bUA3IhJFIhJSEo/le321IHAPiCWZKALxEc81oiQmExUmE0smE2G9cFeQEME0IhMVIhNLIhNlYSASKgICBVEFaFAPAgNCLC+CA1g/D0QYv/DBJhLv4AH0AAUqFXNg8AD0BA8JEMBvBigzBmIJxGDB8GAQAAANIhJCEM/ixDOWJdCwabAF0Ltjwehg4AciEnfMNwYQQMEmAjg20CDDOGFQBdC9IhJEYAAP0GgiElh73bG90LLSICAAAcQAAioYvMIO4gtjzkbQ9x+P3gICQptyAhQSnH4ONBwsz9VuIfwCAkJzwoRhEAkiEnfMOQYQQMEmAjg20CDFMh7P05Yn0NxpQDAAAAXQvSISRGAAD9BqIhJae90RvdCy0iAgAAHEAAIqGLzCDuIMAgJCc84cAgJAACQODgkSKv+CDMEPKgABacBoYMAAAAciEnfMNwYQQMEmAjg20CDGMG5//SISRdC4IhJYe94BvdCy0iAgAAHEAAIqEg7iCLzLaM5CHM/cLM+PoyIeP9KiPiQgDg6EGGDAAAAJIhJwwTkGEEfMRgNINtAwxzxtT/0iEkXQuiISUhv/2nvd1B1v0yDQD6IkoiMkIAG90b//ZPAobc/yHt/Xz28hIcIhIdIGYwYGD0Z58Hxh0A0iEkXQssc8Y/ALaMIAYPAHIhJ3zDcGEEDBJgI4NtAjwzBrz/AABdC9IhJEYAAP0GgiElh73ZG90LLSICAAAcQAAioYvMIO4gtozkbQ/gkHSSYSjg6EHCzPj9BkYCADxDhtQC0iEkXQsha/0nte+iISgLb6JFABtVFoYHVrz4hhwADJPGywJdC9IhJEYAAP0GIWH9J7XqhgYAciEnfMNwYQQMEmAjg20CLGPGmf8AANIhJF0LgiElh73ekVb90GjAUCnAZ7IBbQJnvwFtD00G0D0gUCUgUmE0YmE1smE2Abz9wAAAYiE1UiE0siE2at1qVWBvwFZm+UbQAv0GJjIIxgQAANIhJF0LDKMhb/05Yn0NBhcDAAAMDyYSAkYgACKhICJnESwEIYL9QmcSMqAFUmE0YmE1cmEzsmE2Aab9wAAAciEzsiE2YiE1UiE0PQcioJBCoAhCQ1gLIhszVlL/IqBwDJMyR+gLIht3VlL/HJRyoViRVf0MeEYCAAB6IpoigkIALQMbMkeT8SFq/TFq/QyEBgEAQkIAGyI3kvdGYQEhZ/36IiICACc8HUYPAAAAoiEnfMOgYQQMEmAjg20CDLMGVP/SISRdCyFc/foiYiElZ73bG90LPTIDAAAcQAAzoTDuIDICAIvMNzzhIVT9QVT9+iIyAgAMEgATQAAioUBPoAsi4CIQMMzAAANA4OCRSAQxLf0qJDA/oCJjERv/9j8Cht7/IUf9QqEgDANSYTSyYTYBaP3AAAB9DQwPUiE0siE2RhUAAACCISd8w4BhBAwSYCODbQIM4wa0AnIhJF0LkiEll7fgG3cLJyICAAAcQAAioSDuIIvMtjzkITP9QRL9+iIiAgDgMCQqRCEw/cLM/SokMkIA4ONBG/8hC/0yIhM3P9McMzJiE90HbQ8GHQEATAQyoAAiwURSYTRiYTWyYTZyYTMBQ/3AAAByITOB/fwioWCAh4JBHv0qKPoiDAMiwhiCYTIBO/3AAACCITIhGf1CpIAqKPoiDAMiwhgBNf3AAACoz4IhMvAqoCIiEYr/omEtImEuTQ9SITRiITVyITOyITbGAwAiD1gb/xAioDIiERszMmIRMiEuQC/ANzLmDAIpESkBrQIME+BDEZLBREr5mA9KQSop8CIRGzMpFJqqZrPlMeb8OiKMEvYqKyHW/EKm0EBHgoLIWCqIIqC8KiSCYSsMCXzzQmE5ImEwxkMAAF0L0iEkRgAA/QYsM8aZAACiISuCCgCCYTcWiA4QKKB4Ahv3+QL9CAwC8CIRImE4QiE4cCAEImEvC/9AIiBwcUFWX/4Mp4c3O3B4EZB3IAB3EXBwMUIhMHJhLwwacbb8ABhAAKqhKoRwiJDw+hFyo/+GAgAAQiEvqiJCWAD6iCe38gYgAHIhOSCAlIqHoqCwQan8qohAiJBymAzMZzJYDH0DMsP+IClBoaP88qSwxgoAIIAEgIfAQiE5fPeAhzCKhPCIgKCIkHKYDMx3MlgMMHMgMsP+giE3C4iCYTdCITcMuCAhQYeUyCAgBCB3wHz6IiE5cHowenIipLAqdyGO/CB3kJJXDEIhKxuZG0RCYStyIS6XFwLGvf+CIS0mKALGmQBGggAM4seyAsYwAJIhJdApwKYiAoYlACGj/OAwlEF9/CojQCKQIhIMADIRMCAxlvIAMCkxFjIFJzwCRiQAhhIAAAyjx7NEkZj8fPgAA0DgYJFgYAQgKDAqJpoiQCKQIpIMG3PWggYrYz0HZ7zdhgYAoiEnfMOgYQQMEmAjg20CHAPGdv4AANIhJF0LYiElZ73eIg0AGz0AHEAAIqEg7iCLzAzi3QPHMgLG2v8GCAAiDQEyzAgAE0AAMqEiDQDSzQIAHEAAIqEgIyAg7iDCzBAhdfzgMJRhT/wqI2AikDISDAAzETAgMZaiADA5MSAghEYJAAAAgWz8DKR89xs0AARA4ECRQEAEICcwKiSKImAikCKSDE0DliL+AANA4OCRMMzAImEoDPMnIxUhOvxyISj6MiFe/Bv/KiNyQgAGNAAAgiEoZrga3H8cCZJhKAYBANIhJF0LHBMhL/x89jliBkH+MVP8KiMiwvAiAgAiYSYnPB0GDgCiISd8w6BhBAwSYCODbQIcI8Y1/gAA0iEkXQtiISVnvd4b3QstIgIAciEmABxAACKhi8wg7iB3POGCISYxQPySISgMFgAYQABmoZozC2Yyw/DgJhBiAwAACEDg4JEqZiE5/IDMwCovDANmuQwxDPz6QzE1/Do0MgMATQZSYTRiYTWyYTYBSfzAAABiITVSITRq/7IhNoYAAAAMD3EB/EInEWInEmpkZ78Chnj/95YHhgIA0iEkXQscU0bJ/wDxIfwhIvw9D1JhNGJhNbJhNnJhMwE1/MAAAHIhMyEL/DInEUInEjo/ATD8wAAAsiE2YiE1UiE0Mer7KMMLIinD8ej7eM/WN7iGPgFiISUM4tA2wKZDDkG2+1A0wKYjAkZNAMYyAseyAoYuAKYjAkYlAEHc++AglEAikCISvAAyETAgMZYSATApMRZSBSc8AsYkAAYTAAAAAAyjx7NEfPiSpLAAA0DgYJFgYAQgKDAqJpoiQCKQIpIMG3PWggYrYz0HZ7zdhgYAciEnfMNwYQQMEmAjg20CHHPG1P0AANIhJF0LgiElh73eIg0AGz0AHEAAIqEg7iCLzAzi3QPHMgKG2/8GCAAAACINAYs8ABNAADKhIg0AK90AHEAAIqEgIyAg7iDCzBBBr/vgIJRAIpAiErwAIhEg8DGWjwAgKTHw8ITGCAAMo3z3YqSwGyMAA0DgMJEwMATw9zD682r/QP+Q8p8MPQKWL/4AAkDg4JEgzMAioP/3ogLGQACGAgAAHIMG0wDSISRdCyFp+ye17/JFAG0PG1VG6wAM4scyGTINASINAIAzESAjIAAcQAAioSDuICvdwswQMYr74CCUqiIwIpAiEgwAIhEgMDEgKTHWEwIMpBskAARA4ECRQEAEMDkwOjRBf/uKM0AzkDKTDE0ClvP9/QMAAkDg4JEgzMB3g3xioA7HNhpCDQEiDQCARBEgJCAAHEAAIqEg7iDSzQLCzBBBcPvgIJSqIkAikEISDABEEUAgMUBJMdYSAgymG0YABkDgYJFgYAQgKTAqJmFl+4oiYCKQIpIMbQSW8v0yRQAABEDg4JFAzMB3AggbVf0CRgIAAAAiRQErVQZz//BghGb2AoazACKu/ypmIYH74GYRaiIoAiJhJiF/+3IhJmpi+AYWhwV3PBzGDQCCISd8w4BhBAwSYCODbQIck4Zb/QDSISRdC5IhJZe93xvdCy0iAgCiISYAHEAAIqGLzCDuIKc84WIhJgwSABZAACKhCyLgIhBgzMAABkDg4JEq/wzix7IChjAAciEl0CfApiICxiUAQTP74CCUQCKQItIPIhIMADIRMCAxlgIBMCkxFkIFJzwChiQAxhIAAAAMo8ezRJFW+3z4AANA4GCRYGAEICgwKiaaIkAikCKSDBtz1oIGK2M9B2e83YYGAIIhJ3zDgGEEDBJgI4NtAhyjxiv9AADSISRdC5IhJZe93iINABs9ABxAACKhIO4gi8wM4t0DxzICBtv/BggAAAAiDQGLPAATQAAyoSINACvdABxAACKhICMgIO4gwswQYQb74CCUYCKQItIPMhIMADMRMCAxloIAMDkxICCExggAgSv7DKR89xs0AARA4ECRQEAEICcwKiSKImAikCKSDE0DliL+AANA4OCRMMzAMSH74CIRKjM4AzJhJjEf+6IhJiojKAIiYSgWCganPB5GDgByISd8w3BhBAwSYCODbQIcs8b3/AAAANIhJF0LgiElh73dG90LLSICAJIhJgAcQAAioYvMIO4glzzhoiEmDBIAGkAAIqFiISgLIuAiECpmAApA4OCRoMzAYmEocen6giEocHXAkiEsMeb6gCfAkCIQOiJyYSk9BSe1AT0CQZ36+jNtDze0bQYSACHH+ixTOWLGbQA8UyHE+n0NOWIMJgZsAF0L0iEkRgAA/QYhkvonteGiISliIShyISxgKsAx0PpwIhAqIyICABuqIkUAomEpG1ULb1Yf/QYMAAAyAgBixv0yRQAyAgEyRQEyAgI7IjJFAjtV9jbjFgYBMgIAMkUAZiYFIgIBIkUBalX9BqKgsHz5gqSwcqEABr3+IaP6KLIH4gIGl/zAICQnPCBGDwCCISd8w4BhBAwSYCODbQIsAwas/AAAXQvSISRGAAD9BpIhJZe92RvdCy0iAgAAHEAAIqGLzCDuIMAgJCc84cAgJAACQODgkXyCIMwQfQ1GAQAAC3fCzPiiISR3ugL2jPEht/oxt/pNDFJhNHJhM7JhNgWVAAsisiE2ciEzUiE0IO4QDA8WLAaGDAAAAIIhJ3zDgGEEDBJgI4NtAiyTBg8AciEkXQuSISWXt+AbdwsnIgIAABxAACKhIO4gi8y2jOTgMHTCzPjg6EEGCgCiISd8w6BhBAwSYCODbQIsoyFm+jliRg8AciEkXQtiISVnt9syBwAbd0Fg+hv/KKSAIhEwIiAppPZPCEbe/wByISRdCyFa+iwjOWIMBoYBAHIhJF0LfPYmFhVLJsxyhgMAAAt3wsz4giEkd7gC9ozxgU/6IX/6MX/6yXhNDFJhNGJhNXJhM4JhMrJhNoWGAIIhMpIhKKIhJgsimeiSISng4hCiaBByITOiISRSITSyITZiITX5+OJoFJJoFaDXwLDFwP0GllYOMWz6+NgtDMV+APDg9E0C8PD1fQwMeGIhNbIhNkYlAAAAkgIAogIC6umSAgHqmZru+v7iAgOampr/mp7iAgSa/5qe4gIFmv+anuICBpr/mp7iAgea/5ru6v+LIjqSRznAQCNBsCKwsJBgRgIAADICABsiOu7q/yo5vQJHM+8xTvotDkJhMWJhNXJhM4JhMrJhNgV2ADFI+u0CLQ+FdQBCITFyITOyITZAd8CCITJBQfpiITX9AoyHLQuwOMDG5v8AAAD/ESEI+urv6dL9BtxW+KLw7sB87+D3g0YCAAAAAAwM3Qzyr/0xNPpSISooI2IhJNAiwNBVwNpm0RD6KSM4DXEP+lJhKspTWQ1wNcAMAgwV8CWDYmEkICB0VoIAQtOAQCWDFpIAwQX6LQzFKQDJDYIhKtHs+Yz4KD0WsgDwLzHwIsDWIgDGhPvWjwAioMcpXQY6AABWTw4oPcwSRlH6IqDIhgAAIqDJKV3GTfooLYwSBkz6Ie75ARv6wAAAAR76wAAAhkf6yD3MHMZF+iKj6AEV+sAAAMAMAAZC+gDiYSIMfEaU+gEV+sAAAAwcDAMGCAAAyC34PfAsICAgtMwSxpv6Ri77Mi0DIi0CRTMAMqAADBwgw4PGKft4fWhtWF1ITTg9KC0MDAH7+cAAAO0CDBLgwpOGJfsAAAH1+cAAAAwMBh/7ACHI+UhdOC1JAiHG+TkCBvr/QcT5DAI4BMKgyDDCgykEQcD5PQwMHCkEMMKDBhP7xzICxvP9xvr9KD0WIvLGF/oCIUOSoRDCIULSIUHiIUDyIT+aEQ3wAAAIAABgHAAAYAAAAGAQAABgIfz/EsHw6QHAIADoAgkxySHZESH4/8AgAMgCwMB0nOzRmvlGBAAAADH0/8AgACgDOA0gIHTAAwALzGYM6ob0/yHv/wgxwCAA6QLIIdgR6AESwRAN8AAAAPgCAGAQAgBgAAIAYAAAAAgh/P/AIAA4AjAwJFZD/yH5/0H6/8AgADkCMff/wCAASQPAIABIA1Z0/8AgACgCDBMgIAQwIjAN8AAAgAAAAABA////AAQCAGASwfDJIcFw+QkxKEzZERaCCEX6/xYiCChMDPMMDSejDCgsMCIQDBMg04PQ0HQQESBF+P8WYv8h3v8x7v/AIAA5AsAgADIiAFZj/zHX/8AgACgDICAkVkL/KCwx5f9AQhEhZfnQMoMh5P8gJBBB5P/AIAApBCHP/8AgADkCwCAAOAJWc/8MEhwD0COT3QIoTNAiwClMKCza0tksCDHIIdgREsEQDfAAAABMSgBAEsHgyWHBRfn5Mfg86UEJcdlR7QL3swH9AxYfBNgc2t/Q3EEGAQAAAIXy/yhMphIEKCwnrfJF7f8Wkv8oHE0PPQ4B7v/AAAAgIHSMMiKgxClcKBxIPPoi8ETAKRxJPAhxyGHYUehB+DESwSAN8AAAAP8PAABRKvkSwfAJMQwUQkUAMExBSSVB+v85FSk1MDC0SiIqIyAsQSlFDAIiZQUBXPnAAAAIMTKgxSAjkxLBEA3wAAAAMDsAQBLB8AkxMqDAN5IRIqDbAfv/wAAAIqDcRgQAAAAAMqDbN5IIAfb/wAAAIqDdAfT/wAAACDESwRAN8AAAABLB8Mkh2REJMc0COtJGAgAAIgwAwswBxfr/15zzAiEDwiEC2BESwRAN8AAAWBAAAHAQAAAYmABAHEsAQDSYAEAAmQBAkfv/EsHgyWHpQfkxCXHZUZARwO0CItEQzQMB9f/AAADx+viGCgDdDMe/Ad0PTQ09AS0OAfD/wAAAICB0/EJNDT0BItEQAez/wAAA0O6A0MzAVhz9IeX/MtEQECKAAef/wAAAIeH/HAMaIgX1/y0MBgEAAAAioGOR3f+aEQhxyGHYUehB+DESwSAN8AASwfAioMAJMQG6/8AAAAgxEsEQDfAAAABsEAAAaBAAAHQQAAB4EAAAfBAAAIAQAACQEAAAmA8AQIw7AEASweCR/P/5Mf0CIcb/yWHZUQlx6UGQEcAaIjkCMfL/LAIaM0kDQfD/0tEQGkTCoABSZADCbRoB8P/AAABh6v8hwPgaZmgGZ7ICxkkALQ0Btv/AAAAhs/8x5f8qQRozSQNGPgAAAGGv/zHf/xpmaAYaM+gDwCbA57ICIOIgYd3/PQEaZlkGTQ7wLyABqP/AAAAx2P8gIHQaM1gDjLIMBEJtFu0ExhIAAAAAQdH/6v8aRFkEBfH/PQ4tAYXj/0Xw/00OPQHQLSABmv/AAABhyf/qzBpmWAYhk/8aIigCJ7y8McL/UCzAGjM4AzeyAkbd/0bq/0KgAEJNbCG5/xAigAG//8AAAFYC/2G5/yINbBBmgDgGRQcA9+IR9k4OQbH/GkTqNCJDABvuxvH/Mq/+N5LBJk4pIXv/0D0gECKAAX7/wAAABej/IXb/HAMaIkXa/0Xn/ywCAav4wAAAhgUAYXH/Ui0aGmZoBme1yFc8AgbZ/8bv/wCRoP+aEQhxyGHYUehB+DESwSAN8F0CQqDAKANHlQ7MMgwShgYADAIpA3ziDfAmEgUmIhHGCwBCoNstBUeVKQwiKQMGCAAioNwnlQgMEikDLQQN8ABCoN188keVCwwSKQMioNsN8AB88g3wAAC2IzBtAlD2QEDzQEe1KVBEwAAUQAAzoQwCNzYEMGbAGyLwIhEwMUELRFbE/jc2ARsiDfAAjJMN8Dc2DAwSDfAAAAAAAERJVjAMAg3wtiMoUPJAQPNAR7UXUETAABRAADOhNzICMCLAMDFBQsT/VgT/NzICMCLADfDMUwAAAERJVjAMAg3wAAAAABRA5sQJIDOBACKhDfAAAAAyoQwCDfAA\",fi=1074843648,Fi=\"CIH+PwUFBAACAwcAAwMLALnXEEDv1xBAHdgQQLrYEEBo5xBAHtkQQHTZEEDA2RBAaOcQQILaEED/2hBAwNsQQGjnEEBo5xBAWNwQQGjnEEA33xBAAOAQQDvgEEBo5xBAaOcQQNfgEEBo5xBAv+EQQGXiEECj4xBAY+QQQDTlEEBo5xBAaOcQQGjnEEBo5xBAYuYQQGjnEEBX5xBAkN0QQI/YEECm5RBAq9oQQPzZEEBo5xBA7OYQQDHnEEBo5xBAaOcQQGjnEEBo5xBAaOcQQGjnEEBo5xBAaOcQQCLaEEBf2hBAvuUQQAEAAAACAAAAAwAAAAQAAAAFAAAABwAAAAkAAAANAAAAEQAAABkAAAAhAAAAMQAAAEEAAABhAAAAgQAAAMEAAAABAQAAgQEAAAECAAABAwAAAQQAAAEGAAABCAAAAQwAAAEQAAABGAAAASAAAAEwAAABQAAAAWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAUAAAAGAAAABgAAAAcAAAAHAAAACAAAAAgAAAAJAAAACQAAAAoAAAAKAAAACwAAAAsAAAAMAAAADAAAAA0AAAANAAAAAAAAAAAAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAANAAAADwAAABEAAAATAAAAFwAAABsAAAAfAAAAIwAAACsAAAAzAAAAOwAAAEMAAABTAAAAYwAAAHMAAACDAAAAowAAAMMAAADjAAAAAgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAgAAAAMAAAADAAAAAwAAAAMAAAAEAAAABAAAAAQAAAAEAAAABQAAAAUAAAAFAAAABQAAAAAAAAAAAAAAAAAAABAREgAIBwkGCgULBAwDDQIOAQ8AAQEAAAEAAAAEAAAA\",Ti=1073720488;var ui=Object.freeze({__proto__:null,ESP8266ROM:class extends fe{constructor(){super(...arguments),this.CHIP_NAME=\"ESP8266\",this.CHIP_DETECT_MAGIC_VALUE=[4293968129],this.EFUSE_RD_REG_BASE=1072693328,this.UART_CLKDIV_REG=1610612756,this.UART_CLKDIV_MASK=1048575,this.XTAL_CLK_DIVIDER=2,this.FLASH_WRITE_SIZE=16384,this.BOOTLOADER_FLASH_OFFSET=0,this.UART_DATE_REG_ADDR=0,this.FLASH_SIZES={\"512KB\":0,\"256KB\":16,\"1MB\":32,\"2MB\":48,\"4MB\":64,\"2MB-c1\":80,\"4MB-c1\":96,\"8MB\":128,\"16MB\":144},this.SPI_REG_BASE=1610613248,this.SPI_USR_OFFS=28,this.SPI_USR1_OFFS=32,this.SPI_USR2_OFFS=36,this.SPI_MOSI_DLEN_OFFS=0,this.SPI_MISO_DLEN_OFFS=0,this.SPI_W0_OFFS=64,this.TEXT_START=fi,this.ENTRY=Si,this.DATA_START=Ti,this.ROM_DATA=Fi,this.ROM_TEXT=Qi,this.getChipFeatures=async A=>{const t=[\"WiFi\"];return\"ESP8285\"==await this.getChipDescription(A)&&t.push(\"Embedded Flash\"),t}}async readEfuse(A,t){const e=this.EFUSE_RD_REG_BASE+4*t;return A.debug(\"Read efuse \"+e),await A.readReg(e)}async getChipDescription(A){const t=await this.readEfuse(A,2);return 0!=(16&await this.readEfuse(A,0)|65536&t)?\"ESP8285\":\"ESP8266EX\"}async getCrystalFreq(A){const t=await A.readReg(this.UART_CLKDIV_REG)&this.UART_CLKDIV_MASK,e=A.transport.baudrate*t/1e6/this.XTAL_CLK_DIVIDER;let i;return i=e>33?40:26,Math.abs(i-e)>1&&A.info(\"WARNING: Detected crystal freq \"+e+\"MHz is quite different to normalized freq \"+i+\"MHz. Unsupported crystal in use?\"),i}_d2h(A){const t=(+A).toString(16);return 1===t.length?\"0\"+t:t}async readMac(A){let t=await this.readEfuse(A,0);t>>>=0;let e=await this.readEfuse(A,1);e>>>=0;let i=await this.readEfuse(A,3);i>>>=0;const s=new Uint8Array(6);return 0!=i?(s[0]=i>>16&255,s[1]=i>>8&255,s[2]=255&i):0==(e>>16&255)?(s[0]=24,s[1]=254,s[2]=52):1==(e>>16&255)?(s[0]=172,s[1]=208,s[2]=116):A.error(\"Unknown OUI\"),s[3]=e>>8&255,s[4]=255&e,s[5]=t>>24&255,this._d2h(s[0])+\":\"+this._d2h(s[1])+\":\"+this._d2h(s[2])+\":\"+this._d2h(s[3])+\":\"+this._d2h(s[4])+\":\"+this._d2h(s[5])}getEraseSize(A,t){return t}}}),pi=1341195918,yi=\"QREixCbCBsa3Jw1QEUc3BPVP2Mu3JA1QEwQEANxAkYuR57JAIkSSREEBgoCIQBxAE3X1D4KX3bcBEbenDFBOxoOphwBKyDcJ9U8mylLEBs4izLekDFB9WhMJCQDATBN09D8N4PJAYkQjqDQBQknSRLJJIkoFYYKAiECDJwkAE3X1D4KXfRTjGUT/yb8TBwAMlEGqh2MY5QCFR4XGI6AFAHlVgoAFR2OH5gAJRmONxgB9VYKAQgUTB7ANQYVjlecCiUecwfW3kwbADWMW1QCYwRMFAAyCgJMG0A19VWOV1wCYwRMFsA2CgLc19k9BEZOFRboGxmE/Y0UFBrc39k+Th8exA6cHCAPWRwgTdfUPkwYWAMIGwYIjktcIMpcjAKcAA9dHCJFnk4cHBGMe9wI3t/VPEwfHsaFnupcDpgcIt/b1T7c39k+Th8exk4bGtWMf5gAjpscII6DXCCOSBwghoPlX4wb1/LJAQQGCgCOm1wgjoOcI3bc31whQfEudi/X/N8cIUHxLnYv1/4KAQREGxt03t9cIUCOmBwI3BwAImMOYQ33/yFeyQBNF9f8FiUEBgoBBEQbG2T993TcHAEC31whQmMM31whQHEP9/7JAQQGCgEERIsQ3hPVPkwcEAUrAA6kHAQbGJsJjCgkERTc5xb1HEwQEAYFEY9YnAQREvYiTtBQAfTeFPxxENwaAABOXxwCZ4DcGAAG39v8AdY+31ghQ2MKQwphCff9BR5HgBUczCelAupcjKCQBHMSyQCJEkkQCSUEBgoABEQbOIswlNzcE9E9sABMFxP6XAM//54Ag86qHBUWV57JHk/cHID7GiTc31whQHEe3BkAAEwXE/tWPHMeyRZcAz//ngKDwMzWgAPJAYkQFYYKAQRG3h/VPBsaThwcBBUcjgOcAE9fFAJjHBWd9F8zDyMf5jTqVqpWxgYzLI6oHAEE3GcETBVAMskBBAYKAAREizDeE9U+TBwQBJsrER07GBs5KyKqJEwQEAWPzlQCuhKnAAylEACaZE1nJABxIY1XwABxEY175ArU9fd1IQCaGzoWXAM//54Cg4xN19Q8BxZMHQAxcyFxAppdcwFxEhY9cxPJAYkTSREJJskkFYYKAaTVtv0ERBsaXAM//54BA1gNFhQGyQGkVEzUVAEEBgoBBEQbGxTcRwRlFskBBARcDz/9nAOPPQREGxibCIsSqhJcAz//ngADNdT8NyTcH9U+TBgcAg9dGABMEBwCFB8IHwYMjkvYAkwYADGOG1AATB+ADY3X3AG03IxIEALJAIkSSREEBgoBBEQbGEwcADGMa5QATBbANRTcTBcANskBBAVm/EwewDeMb5f5xNxMF0A31t0ERIsQmwgbGKoSzBLUAYxeUALJAIkSSREEBgoADRQQABQRNP+23NXEmy07H/XKFaf10Is1KyVLFVsMGz5OEhPoWkZOHCQemlxgIs4TnACqJJoUuhJcAz//ngOAZk4cJBxgIBWq6l7OKR0Ex5AVnfXWTBYX6kwcHBxMFhfkUCKqXM4XXAJMHBweul7OF1wAqxpcAz//ngKAWMkXBRZU3AUWFYhaR+kBqRNpESkm6SSpKmkoNYYKAooljc4oAhWlOhtaFSoWXAM//54CgyRN19Q8B7U6G1oUmhZcAz//ngOARTpkzBDRBUbcTBTAGVb8TBQAMSb0xcf1yBWdO11LVVtNezwbfIt0m20rZWtFizWbLaslux/13FpETBwcHPpccCLqXPsYjqgf4qokuirKKtosNNZMHAAIZwbcHAgA+hZcAz//ngIAKhWdj5VcTBWR9eRMJifqTBwQHypcYCDOJ5wBKhZcAz//ngAAJfXsTDDv5kwyL+RMHBAeTBwQHFAhil+aXgUQzDNcAs4zXAFJNY3xNCWPxpANBqJk/ooUIAY01uTcihgwBSoWXAM//54DgBKKZopRj9UQDs4ekQWPxdwMzBJpAY/OKAFaEIoYMAU6FlwDP/+eA4LgTdfUPVd0CzAFEeV2NTaMJAQBihZcAz//ngKCnffkDRTEB5oVZPGNPBQDj4o3+hWeThwcHopcYCLqX2pcjiqf4BQTxt+MVpf2RR+MF9PYFZ311kwcHB5MFhfoTBYX5FAiqlzOF1wCTBwcHrpezhdcAKsaXAM//54AA+3E9MkXBRWUzUT3dObcHAgAZ4ZMHAAI+hZcAz//ngAD4hWIWkfpQalTaVEpZulkqWppaClv6S2pM2kxKTbpNKWGCgLdXQUkZcZOH94QBRYbeotym2srYztbS1NbS2tDezuLM5srqyO7GPs6XAM//54DgoHkxBcU3R9hQt2cRUBMHF6qYzyOgBwAjrAcAmNPYT7cGBABVj9jPI6AHArcH9U83N/ZPk4cHABMHx7ohoCOgBwCRB+Pt5/7VM5FFaAjFOfE7t7f1T5OHx7EhZz6XIyD3CLcH8U83CfVPk4eHDiMg+QC3OfZPKTmTicmxEwkJAGMFBRC3Zw1QEwcQArjPhUVFRZcAz//ngKDmtwXxTwFGk4UFAEVFlwDP/+eAoOe3Jw1QEUeYyzcFAgCXAM//54Dg5rcHDlCIX4FFt4T1T3GJYRUTNRUAlwDP/+eAYKXBZ/0XEwcAEIVmQWa3BQABAUWThAQBtwr1Tw1qlwDP/+eAIJsTiwoBJpqDp8kI9d+Dq8kIhUcjpgkIIwLxAoPHGwAJRyMT4QKjAvECAtRNR2OB5whRR2OP5wYpR2Of5wCDxzsAA8crAKIH2Y8RR2OW5wCDp4sAnEM+1NE5oUVIEMU2g8c7AAPHKwCiB9mPEWdBB2N09wQTBbANqTYTBcANkTYTBeAOPT5dMUG3twXxTwFGk4WFAxVFlwDP/+eAoNg3pwxQXEcTBQACk+cXEFzHMbfJRyMT8QJNtwPHGwDRRmPn5gKFRmPm5gABTBME8A+FqHkXE3f3D8lG4+jm/rc29k8KB5OGBrs2lxhDAoeTBgcDk/b2DxFG42nW/BMH9wITd/cPjUZj6+YItzb2TwoHk4bGvzaXGEMChxMHQAJjl+cQAtQdRAFFcTwBReU0ATH9PqFFSBB9FCE2dfQBTAFEE3X0D8E8E3X8D+k0zTbjHgTqg8cbAElHY2v3MAlH43b36vUXk/f3Dz1H42D36jc39k+KBxMHx8C6l5xDgocFRJ3rcBCBRQFFl/DO/+eAoHcd4dFFaBBtNAFEMagFRIHvl/DO/+eAIH0zNKAAKaAhR2OF5wAFRAFMYbcDrIsAA6TLALNnjADSB/X30TBl9cFsIpz9HH19MwWMQF3cs3eVAZXjwWwzBYxAY+aMAv18MwWMQF3QMYGX8M7/54DAeV35ZpT1tzGBl/DO/+eAwHhd8WqU0bdBgZfwzv/ngAB4WfkzBJRBwbchR+OK5/ABTBMEAAw5t0FHzb9BRwVE453n9oOlywADpYsAOTy5v0FHBUTjk+f2A6cLAZFnY+7nHoOlSwEDpYsA7/C/hz2/QUcFROOT5/SDpwsBEWdjbvccA6fLAIOlSwEDpYsAM4TnAu/wP4UjrAQAIySKsDm3A8cEAGMHBxQDp4sAwRcTBAAMYxP3AMBIAUeTBvAOY0b3AoPHWwADx0sAAUyiB9mPA8drAEIHXY+Dx3sA4gfZj+OC9uYTBBAMsb0zhusAA0aGAQUHsY7ht4PHBAD9y9xEY5EHFsBII4AEAEW9YUdjlucCg6fLAQOniwGDpksBA6YLAYOlywADpYsAl/DO/+eAgGgqjDM0oAAxtQFMBUQZtRFHBUTjm+fmtxcOUPRfZXd9FwVm+Y7RjgOliwCThQcI9N+UQfmO0Y6UwZOFRwiUQfmO0Y6UwbRfgUV1j1GPuN+X8M7/54AgaxG9E/f3AOMRB+qT3EcAE4SLAAFMfV3jcZzbSESX8M7/54AgThhEVEAQQPmOYwenARxCE0f3/32P2Y4UwgUMQQTZvxFHhbVBRwVE45Tn3oOniwADp0sBIyb5ACMk6QBdu4MliQDBF5Hlic8BTBMEYAyxswMnyQBjZvcGE/c3AOMVB+IDKMkAAUYBRzMF6ECzhuUAY2n3AOMBBtIjJqkAIyTZABm7M4brABBOEQeQwgVG6b8hRwVE457n1gMkyQAZwBMEgAwjJgkAIyQJADM0gACNswFMEwQgDNWxAUwTBIAM8bkBTBMEkAzRuRMHIA1jg+cMEwdADeOY57gDxDsAg8crACIEXYyX8M7/54AATgOsxABBFGNzhAEijOMGDLbAQGKUMYCcSGNV8ACcRGNb9Arv8O/Rdd3IQGKGk4WLAZfwzv/ngABKAcWTB0AM3MjcQOKX3MDcRLOHh0HcxJfwzv/ngOBIDbYJZRMFBXEDrMsAA6SLAJfwzv/ngKA4t6cMUNhLtwYAAcEWk1dHARIHdY+9i9mPs4eHAwFFs9WHApfwzv/ngAA6EwWAPpfwzv/ngEA10byDpksBA6YLAYOlywADpYsA7/DP/n28g8U7AIPHKwAThYsBogXdjcEV7/DP21207/Avyz2/A8Q7AIPHKwATjIsBIgRdjNxEQRTN45FHhUtj/4cIkweQDNzIrbwDpw0AItAFSLOH7EA+1oMnirBjc/QADUhCxjrE7/CvxiJHMkg3hfVP4oV8EJOGCgEQEBMFhQKX8M7/54BgNze39U+TCAcBglcDp4iwg6UNAB2MHY8+nLJXI6TosKqLvpUjoL0Ak4cKAZ2NAcWhZ2OX9QBahe/wb9EjoG0BCcTcRJnD409w92PfCwCTB3AMvbeFS7c99k+3jPVPk43NupOMDAHpv+OaC5zcROOHB5yTB4AMqbeDp4sA45AHnO/wD9YJZRMFBXGX8M7/54CgIpfwzv/ngKAnTbIDpMsA4w4EmO/wz9MTBYA+l/DO/+eAgCAClFmy9lBmVNZURlm2WSZalloGW/ZLZkzWTEZNtk0JYYKAAAA=\",ki=1341194240,Hi=\"EAD1TwYK8U9WCvFPrgrxT4QL8U/wC/FPngvxT9QI8U9AC/FPgAvxT8IK8U+ECPFP9grxT4QI8U/gCfFPJgrxT1YK8U+uCvFP8gnxTzgJ8U9oCfFP7gnxT0AO8U9WCvFPCA3xTwAO8U/EB/FPJA7xT8QH8U/EB/FPxAfxT8QH8U/EB/FPxAfxT8QH8U/EB/FPpAzxT8QH8U8mDfFPAA7xTw==\",Pi=1341533100;var Oi=Object.freeze({__proto__:null,ESP32P4ROM:class extends ke{constructor(){super(...arguments),this.CHIP_NAME=\"ESP32-P4\",this.IMAGE_CHIP_ID=18,this.IROM_MAP_START=1073741824,this.IROM_MAP_END=1275068416,this.DROM_MAP_START=1073741824,this.DROM_MAP_END=1275068416,this.BOOTLOADER_FLASH_OFFSET=8192,this.CHIP_DETECT_MAGIC_VALUE=[0,182303440],this.UART_DATE_REG_ADDR=1343004812,this.EFUSE_BASE=1343410176,this.EFUSE_BLOCK1_ADDR=this.EFUSE_BASE+68,this.MAC_EFUSE_REG=this.EFUSE_BASE+68,this.SPI_REG_BASE=1342754816,this.SPI_USR_OFFS=24,this.SPI_USR1_OFFS=28,this.SPI_USR2_OFFS=32,this.SPI_MOSI_DLEN_OFFS=36,this.SPI_MISO_DLEN_OFFS=40,this.SPI_W0_OFFS=88,this.EFUSE_RD_REG_BASE=this.EFUSE_BASE+48,this.EFUSE_PURPOSE_KEY0_REG=this.EFUSE_BASE+52,this.EFUSE_PURPOSE_KEY0_SHIFT=24,this.EFUSE_PURPOSE_KEY1_REG=this.EFUSE_BASE+52,this.EFUSE_PURPOSE_KEY1_SHIFT=28,this.EFUSE_PURPOSE_KEY2_REG=this.EFUSE_BASE+56,this.EFUSE_PURPOSE_KEY2_SHIFT=0,this.EFUSE_PURPOSE_KEY3_REG=this.EFUSE_BASE+56,this.EFUSE_PURPOSE_KEY3_SHIFT=4,this.EFUSE_PURPOSE_KEY4_REG=this.EFUSE_BASE+56,this.EFUSE_PURPOSE_KEY4_SHIFT=8,this.EFUSE_PURPOSE_KEY5_REG=this.EFUSE_BASE+56,this.EFUSE_PURPOSE_KEY5_SHIFT=12,this.EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT_REG=this.EFUSE_RD_REG_BASE,this.EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT=1<<20,this.EFUSE_SPI_BOOT_CRYPT_CNT_REG=this.EFUSE_BASE+52,this.EFUSE_SPI_BOOT_CRYPT_CNT_MASK=7<<18,this.EFUSE_SECURE_BOOT_EN_REG=this.EFUSE_BASE+56,this.EFUSE_SECURE_BOOT_EN_MASK=1<<20,this.PURPOSE_VAL_XTS_AES256_KEY_1=2,this.PURPOSE_VAL_XTS_AES256_KEY_2=3,this.PURPOSE_VAL_XTS_AES128_KEY=4,this.SUPPORTS_ENCRYPTED_FLASH=!0,this.FLASH_ENCRYPTED_WRITE_ALIGN=16,this.MEMORY_MAP=[[0,65536,\"PADDING\"],[1073741824,1275068416,\"DROM\"],[1341128704,1341784064,\"DRAM\"],[1341128704,1341784064,\"BYTE_ACCESSIBLE\"],[1337982976,1338114048,\"DROM_MASK\"],[1337982976,1338114048,\"IROM_MASK\"],[1073741824,1275068416,\"IROM\"],[1341128704,1341784064,\"IRAM\"],[1343258624,1343291392,\"RTC_IRAM\"],[1343258624,1343291392,\"RTC_DRAM\"],[1611653120,1611661312,\"MEM_INTERNAL2\"]],this.UF2_FAMILY_ID=1026592404,this.EFUSE_MAX_KEY=5,this.KEY_PURPOSES={0:\"USER/EMPTY\",1:\"ECDSA_KEY\",2:\"XTS_AES_256_KEY_1\",3:\"XTS_AES_256_KEY_2\",4:\"XTS_AES_128_KEY\",5:\"HMAC_DOWN_ALL\",6:\"HMAC_DOWN_JTAG\",7:\"HMAC_DOWN_DIGITAL_SIGNATURE\",8:\"HMAC_UP\",9:\"SECURE_BOOT_DIGEST0\",10:\"SECURE_BOOT_DIGEST1\",11:\"SECURE_BOOT_DIGEST2\",12:\"KM_INIT_KEY\"},this.TEXT_START=ki,this.ENTRY=pi,this.DATA_START=Pi,this.ROM_DATA=Hi,this.ROM_TEXT=yi}async getPkgVersion(A){const t=this.EFUSE_BLOCK1_ADDR+8;return await A.readReg(t)>>27&7}async getMinorChipVersion(A){const t=this.EFUSE_BLOCK1_ADDR+8;return await A.readReg(t)>>0&15}async getMajorChipVersion(A){const t=this.EFUSE_BLOCK1_ADDR+8;return await A.readReg(t)>>4&3}async getChipDescription(A){return`${0===await this.getPkgVersion(A)?\"ESP32-P4\":\"unknown ESP32-P4\"} (revision v${await this.getMajorChipVersion(A)}.${await this.getMinorChipVersion(A)})`}async getChipFeatures(A){return[\"High-Performance MCU\"]}async getCrystalFreq(A){return 40}async getFlashVoltage(A){}async overrideVddsdio(A){A.debug(\"VDD_SDIO overrides are not supported for ESP32-P4\")}async readMac(A){let t=await A.readReg(this.MAC_EFUSE_REG);t>>>=0;let e=await A.readReg(this.MAC_EFUSE_REG+4);e=e>>>0&65535;const i=new Uint8Array(6);return i[0]=e>>8&255,i[1]=255&e,i[2]=t>>24&255,i[3]=t>>16&255,i[4]=t>>8&255,i[5]=255&t,this._d2h(i[0])+\":\"+this._d2h(i[1])+\":\"+this._d2h(i[2])+\":\"+this._d2h(i[3])+\":\"+this._d2h(i[4])+\":\"+this._d2h(i[5])}async getFlashCryptConfig(A){}async getSecureBootEnabled(A){return await A.readReg(this.EFUSE_SECURE_BOOT_EN_REG)&this.EFUSE_SECURE_BOOT_EN_MASK}async getKeyBlockPurpose(A,t){if(t<0||t>this.EFUSE_MAX_KEY)return void A.debug(`Valid key block numbers must be in range 0-${this.EFUSE_MAX_KEY}`);const e=[[this.EFUSE_PURPOSE_KEY0_REG,this.EFUSE_PURPOSE_KEY0_SHIFT],[this.EFUSE_PURPOSE_KEY1_REG,this.EFUSE_PURPOSE_KEY1_SHIFT],[this.EFUSE_PURPOSE_KEY2_REG,this.EFUSE_PURPOSE_KEY2_SHIFT],[this.EFUSE_PURPOSE_KEY3_REG,this.EFUSE_PURPOSE_KEY3_SHIFT],[this.EFUSE_PURPOSE_KEY4_REG,this.EFUSE_PURPOSE_KEY4_SHIFT],[this.EFUSE_PURPOSE_KEY5_REG,this.EFUSE_PURPOSE_KEY5_SHIFT]],[i,s]=e[t];return await A.readReg(i)>>s&15}async isFlashEncryptionKeyValid(A){const t=[];for(let e=0;e<=this.EFUSE_MAX_KEY;e++){const i=await this.getKeyBlockPurpose(A,e);t.push(i)}if(void 0!==typeof t.find((A=>A===this.PURPOSE_VAL_XTS_AES128_KEY)))return!0;const e=t.find((A=>A===this.PURPOSE_VAL_XTS_AES256_KEY_1)),i=t.find((A=>A===this.PURPOSE_VAL_XTS_AES256_KEY_2));return void 0!==typeof e&&void 0!==typeof i}}});export{Qe as ESPLoader,fe as ROM,Ie as Transport,le as classicReset,Re as customReset,Me as hardReset,de as usbJTAGSerialReset,De as validateCustomResetStringSequence};\n","/*\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in\n * compliance with the License. You may obtain a copy of\n * the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in\n * writing, software distributed under the License is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES\n * OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing\n * permissions and limitations under the License.\n */\n'use strict';\nexport var SerialPolyfillProtocol;\n(function (SerialPolyfillProtocol) {\n SerialPolyfillProtocol[SerialPolyfillProtocol[\"UsbCdcAcm\"] = 0] = \"UsbCdcAcm\";\n})(SerialPolyfillProtocol || (SerialPolyfillProtocol = {}));\nconst kSetLineCoding = 0x20;\nconst kSetControlLineState = 0x22;\nconst kSendBreak = 0x23;\nconst kDefaultBufferSize = 255;\nconst kDefaultDataBits = 8;\nconst kDefaultParity = 'none';\nconst kDefaultStopBits = 1;\nconst kAcceptableDataBits = [16, 8, 7, 6, 5];\nconst kAcceptableStopBits = [1, 2];\nconst kAcceptableParity = ['none', 'even', 'odd'];\nconst kParityIndexMapping = ['none', 'odd', 'even'];\nconst kStopBitsIndexMapping = [1, 1.5, 2];\nconst kDefaultPolyfillOptions = {\n protocol: SerialPolyfillProtocol.UsbCdcAcm,\n usbControlInterfaceClass: 2,\n usbTransferInterfaceClass: 10,\n};\n/**\n * Utility function to get the interface implementing a desired class.\n * @param {USBDevice} device The USB device.\n * @param {number} classCode The desired interface class.\n * @return {USBInterface} The first interface found that implements the desired\n * class.\n * @throws TypeError if no interface is found.\n */\nfunction findInterface(device, classCode) {\n const configuration = device.configurations[0];\n for (const iface of configuration.interfaces) {\n const alternate = iface.alternates[0];\n if (alternate.interfaceClass === classCode) {\n return iface;\n }\n }\n throw new TypeError(`Unable to find interface with class ${classCode}.`);\n}\n/**\n * Utility function to get an endpoint with a particular direction.\n * @param {USBInterface} iface The interface to search.\n * @param {USBDirection} direction The desired transfer direction.\n * @return {USBEndpoint} The first endpoint with the desired transfer direction.\n * @throws TypeError if no endpoint is found.\n */\nfunction findEndpoint(iface, direction) {\n const alternate = iface.alternates[0];\n for (const endpoint of alternate.endpoints) {\n if (endpoint.direction == direction) {\n return endpoint;\n }\n }\n throw new TypeError(`Interface ${iface.interfaceNumber} does not have an ` +\n `${direction} endpoint.`);\n}\n/**\n * Implementation of the underlying source API[1] which reads data from a USB\n * endpoint. This can be used to construct a ReadableStream.\n *\n * [1]: https://streams.spec.whatwg.org/#underlying-source-api\n */\nclass UsbEndpointUnderlyingSource {\n /**\n * Constructs a new UnderlyingSource that will pull data from the specified\n * endpoint on the given USB device.\n *\n * @param {USBDevice} device\n * @param {USBEndpoint} endpoint\n * @param {function} onError function to be called on error\n */\n constructor(device, endpoint, onError) {\n this.type = 'bytes';\n this.device_ = device;\n this.endpoint_ = endpoint;\n this.onError_ = onError;\n }\n /**\n * Reads a chunk of data from the device.\n *\n * @param {ReadableByteStreamController} controller\n */\n pull(controller) {\n (async () => {\n var _a;\n let chunkSize;\n if (controller.desiredSize) {\n const d = controller.desiredSize / this.endpoint_.packetSize;\n chunkSize = Math.ceil(d) * this.endpoint_.packetSize;\n }\n else {\n chunkSize = this.endpoint_.packetSize;\n }\n try {\n const result = await this.device_.transferIn(this.endpoint_.endpointNumber, chunkSize);\n if (result.status != 'ok') {\n controller.error(`USB error: ${result.status}`);\n this.onError_();\n }\n if ((_a = result.data) === null || _a === void 0 ? void 0 : _a.buffer) {\n const chunk = new Uint8Array(result.data.buffer, result.data.byteOffset, result.data.byteLength);\n controller.enqueue(chunk);\n }\n }\n catch (error) {\n controller.error(error.toString());\n this.onError_();\n }\n })();\n }\n}\n/**\n * Implementation of the underlying sink API[2] which writes data to a USB\n * endpoint. This can be used to construct a WritableStream.\n *\n * [2]: https://streams.spec.whatwg.org/#underlying-sink-api\n */\nclass UsbEndpointUnderlyingSink {\n /**\n * Constructs a new UnderlyingSink that will write data to the specified\n * endpoint on the given USB device.\n *\n * @param {USBDevice} device\n * @param {USBEndpoint} endpoint\n * @param {function} onError function to be called on error\n */\n constructor(device, endpoint, onError) {\n this.device_ = device;\n this.endpoint_ = endpoint;\n this.onError_ = onError;\n }\n /**\n * Writes a chunk to the device.\n *\n * @param {Uint8Array} chunk\n * @param {WritableStreamDefaultController} controller\n */\n async write(chunk, controller) {\n try {\n const result = await this.device_.transferOut(this.endpoint_.endpointNumber, chunk);\n if (result.status != 'ok') {\n controller.error(result.status);\n this.onError_();\n }\n }\n catch (error) {\n controller.error(error.toString());\n this.onError_();\n }\n }\n}\n/** a class used to control serial devices over WebUSB */\nexport class SerialPort {\n /**\n * constructor taking a WebUSB device that creates a SerialPort instance.\n * @param {USBDevice} device A device acquired from the WebUSB API\n * @param {SerialPolyfillOptions} polyfillOptions Optional options to\n * configure the polyfill.\n */\n constructor(device, polyfillOptions) {\n this.polyfillOptions_ = Object.assign(Object.assign({}, kDefaultPolyfillOptions), polyfillOptions);\n this.outputSignals_ = {\n dataTerminalReady: false,\n requestToSend: false,\n break: false,\n };\n this.device_ = device;\n this.controlInterface_ = findInterface(this.device_, this.polyfillOptions_.usbControlInterfaceClass);\n this.transferInterface_ = findInterface(this.device_, this.polyfillOptions_.usbTransferInterfaceClass);\n this.inEndpoint_ = findEndpoint(this.transferInterface_, 'in');\n this.outEndpoint_ = findEndpoint(this.transferInterface_, 'out');\n }\n /**\n * Getter for the readable attribute. Constructs a new ReadableStream as\n * necessary.\n * @return {ReadableStream} the current readable stream\n */\n get readable() {\n var _a;\n if (!this.readable_ && this.device_.opened) {\n this.readable_ = new ReadableStream(new UsbEndpointUnderlyingSource(this.device_, this.inEndpoint_, () => {\n this.readable_ = null;\n }), {\n highWaterMark: (_a = this.serialOptions_.bufferSize) !== null && _a !== void 0 ? _a : kDefaultBufferSize,\n });\n }\n return this.readable_;\n }\n /**\n * Getter for the writable attribute. Constructs a new WritableStream as\n * necessary.\n * @return {WritableStream} the current writable stream\n */\n get writable() {\n var _a;\n if (!this.writable_ && this.device_.opened) {\n this.writable_ = new WritableStream(new UsbEndpointUnderlyingSink(this.device_, this.outEndpoint_, () => {\n this.writable_ = null;\n }), new ByteLengthQueuingStrategy({\n highWaterMark: (_a = this.serialOptions_.bufferSize) !== null && _a !== void 0 ? _a : kDefaultBufferSize,\n }));\n }\n return this.writable_;\n }\n /**\n * a function that opens the device and claims all interfaces needed to\n * control and communicate to and from the serial device\n * @param {SerialOptions} options Object containing serial options\n * @return {Promise} A promise that will resolve when device is ready\n * for communication\n */\n async open(options) {\n this.serialOptions_ = options;\n this.validateOptions();\n try {\n await this.device_.open();\n if (this.device_.configuration === null) {\n await this.device_.selectConfiguration(1);\n }\n await this.device_.claimInterface(this.controlInterface_.interfaceNumber);\n if (this.controlInterface_ !== this.transferInterface_) {\n await this.device_.claimInterface(this.transferInterface_.interfaceNumber);\n }\n await this.setLineCoding();\n await this.setSignals({ dataTerminalReady: true });\n }\n catch (error) {\n if (this.device_.opened) {\n await this.device_.close();\n }\n throw new Error('Error setting up device: ' + error.toString());\n }\n }\n /**\n * Closes the port.\n *\n * @return {Promise} A promise that will resolve when the port is\n * closed.\n */\n async close() {\n const promises = [];\n if (this.readable_) {\n promises.push(this.readable_.cancel());\n }\n if (this.writable_) {\n promises.push(this.writable_.abort());\n }\n await Promise.all(promises);\n this.readable_ = null;\n this.writable_ = null;\n if (this.device_.opened) {\n await this.setSignals({ dataTerminalReady: false, requestToSend: false });\n await this.device_.close();\n }\n }\n /**\n * Forgets the port.\n *\n * @return {Promise} A promise that will resolve when the port is\n * forgotten.\n */\n async forget() {\n return this.device_.forget();\n }\n /**\n * A function that returns properties of the device.\n * @return {SerialPortInfo} Device properties.\n */\n getInfo() {\n return {\n usbVendorId: this.device_.vendorId,\n usbProductId: this.device_.productId,\n };\n }\n /**\n * A function used to change the serial settings of the device\n * @param {object} options the object which carries serial settings data\n * @return {Promise} A promise that will resolve when the options are\n * set\n */\n reconfigure(options) {\n this.serialOptions_ = Object.assign(Object.assign({}, this.serialOptions_), options);\n this.validateOptions();\n return this.setLineCoding();\n }\n /**\n * Sets control signal state for the port.\n * @param {SerialOutputSignals} signals The signals to enable or disable.\n * @return {Promise} a promise that is resolved when the signal state\n * has been changed.\n */\n async setSignals(signals) {\n this.outputSignals_ = Object.assign(Object.assign({}, this.outputSignals_), signals);\n if (signals.dataTerminalReady !== undefined ||\n signals.requestToSend !== undefined) {\n // The Set_Control_Line_State command expects a bitmap containing the\n // values of all output signals that should be enabled or disabled.\n //\n // Ref: USB CDC specification version 1.1 §6.2.14.\n const value = (this.outputSignals_.dataTerminalReady ? 1 << 0 : 0) |\n (this.outputSignals_.requestToSend ? 1 << 1 : 0);\n await this.device_.controlTransferOut({\n 'requestType': 'class',\n 'recipient': 'interface',\n 'request': kSetControlLineState,\n 'value': value,\n 'index': this.controlInterface_.interfaceNumber,\n });\n }\n if (signals.break !== undefined) {\n // The SendBreak command expects to be given a duration for how long the\n // break signal should be asserted. Passing 0xFFFF enables the signal\n // until 0x0000 is send.\n //\n // Ref: USB CDC specification version 1.1 §6.2.15.\n const value = this.outputSignals_.break ? 0xFFFF : 0x0000;\n await this.device_.controlTransferOut({\n 'requestType': 'class',\n 'recipient': 'interface',\n 'request': kSendBreak,\n 'value': value,\n 'index': this.controlInterface_.interfaceNumber,\n });\n }\n }\n /**\n * Checks the serial options for validity and throws an error if it is\n * not valid\n */\n validateOptions() {\n if (!this.isValidBaudRate(this.serialOptions_.baudRate)) {\n throw new RangeError('invalid Baud Rate ' + this.serialOptions_.baudRate);\n }\n if (!this.isValidDataBits(this.serialOptions_.dataBits)) {\n throw new RangeError('invalid dataBits ' + this.serialOptions_.dataBits);\n }\n if (!this.isValidStopBits(this.serialOptions_.stopBits)) {\n throw new RangeError('invalid stopBits ' + this.serialOptions_.stopBits);\n }\n if (!this.isValidParity(this.serialOptions_.parity)) {\n throw new RangeError('invalid parity ' + this.serialOptions_.parity);\n }\n }\n /**\n * Checks the baud rate for validity\n * @param {number} baudRate the baud rate to check\n * @return {boolean} A boolean that reflects whether the baud rate is valid\n */\n isValidBaudRate(baudRate) {\n return baudRate % 1 === 0;\n }\n /**\n * Checks the data bits for validity\n * @param {number} dataBits the data bits to check\n * @return {boolean} A boolean that reflects whether the data bits setting is\n * valid\n */\n isValidDataBits(dataBits) {\n if (typeof dataBits === 'undefined') {\n return true;\n }\n return kAcceptableDataBits.includes(dataBits);\n }\n /**\n * Checks the stop bits for validity\n * @param {number} stopBits the stop bits to check\n * @return {boolean} A boolean that reflects whether the stop bits setting is\n * valid\n */\n isValidStopBits(stopBits) {\n if (typeof stopBits === 'undefined') {\n return true;\n }\n return kAcceptableStopBits.includes(stopBits);\n }\n /**\n * Checks the parity for validity\n * @param {string} parity the parity to check\n * @return {boolean} A boolean that reflects whether the parity is valid\n */\n isValidParity(parity) {\n if (typeof parity === 'undefined') {\n return true;\n }\n return kAcceptableParity.includes(parity);\n }\n /**\n * sends the options alog the control interface to set them on the device\n * @return {Promise} a promise that will resolve when the options are set\n */\n async setLineCoding() {\n var _a, _b, _c;\n // Ref: USB CDC specification version 1.1 §6.2.12.\n const buffer = new ArrayBuffer(7);\n const view = new DataView(buffer);\n view.setUint32(0, this.serialOptions_.baudRate, true);\n view.setUint8(4, kStopBitsIndexMapping.indexOf((_a = this.serialOptions_.stopBits) !== null && _a !== void 0 ? _a : kDefaultStopBits));\n view.setUint8(5, kParityIndexMapping.indexOf((_b = this.serialOptions_.parity) !== null && _b !== void 0 ? _b : kDefaultParity));\n view.setUint8(6, (_c = this.serialOptions_.dataBits) !== null && _c !== void 0 ? _c : kDefaultDataBits);\n const result = await this.device_.controlTransferOut({\n 'requestType': 'class',\n 'recipient': 'interface',\n 'request': kSetLineCoding,\n 'value': 0x00,\n 'index': this.controlInterface_.interfaceNumber,\n }, buffer);\n if (result.status != 'ok') {\n throw new DOMException('NetworkError', 'Failed to set line coding.');\n }\n }\n}\n/** implementation of the global navigator.serial object */\nclass Serial {\n /**\n * Requests permission to access a new port.\n *\n * @param {SerialPortRequestOptions} options\n * @param {SerialPolyfillOptions} polyfillOptions\n * @return {Promise}\n */\n async requestPort(options, polyfillOptions) {\n polyfillOptions = Object.assign(Object.assign({}, kDefaultPolyfillOptions), polyfillOptions);\n const usbFilters = [];\n if (options && options.filters) {\n for (const filter of options.filters) {\n const usbFilter = {\n classCode: polyfillOptions.usbControlInterfaceClass,\n };\n if (filter.usbVendorId !== undefined) {\n usbFilter.vendorId = filter.usbVendorId;\n }\n if (filter.usbProductId !== undefined) {\n usbFilter.productId = filter.usbProductId;\n }\n usbFilters.push(usbFilter);\n }\n }\n if (usbFilters.length === 0) {\n usbFilters.push({\n classCode: polyfillOptions.usbControlInterfaceClass,\n });\n }\n const device = await navigator.usb.requestDevice({ 'filters': usbFilters });\n const port = new SerialPort(device, polyfillOptions);\n return port;\n }\n /**\n * Get the set of currently available ports.\n *\n * @param {SerialPolyfillOptions} polyfillOptions Polyfill configuration that\n * should be applied to these ports.\n * @return {Promise} a promise that is resolved with a list of\n * ports.\n */\n async getPorts(polyfillOptions) {\n polyfillOptions = Object.assign(Object.assign({}, kDefaultPolyfillOptions), polyfillOptions);\n const devices = await navigator.usb.getDevices();\n const ports = [];\n devices.forEach((device) => {\n try {\n const port = new SerialPort(device, polyfillOptions);\n ports.push(port);\n }\n catch (e) {\n // Skip unrecognized port.\n }\n });\n return ports;\n }\n}\n/* an object to be used for starting the serial workflow */\nexport const serial = new Serial();\n//# sourceMappingURL=serial.js.map","/*\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in\n * compliance with the License. You may obtain a copy of\n * the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in\n * writing, software distributed under the License is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES\n * OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing\n * permissions and limitations under the License.\n */\n'use strict';\n\nexport enum SerialPolyfillProtocol {\n UsbCdcAcm, // eslint-disable-line no-unused-vars\n}\n\nexport interface SerialPolyfillOptions {\n protocol?: SerialPolyfillProtocol;\n usbControlInterfaceClass?: number;\n usbTransferInterfaceClass?: number;\n}\n\nconst kSetLineCoding = 0x20;\nconst kSetControlLineState = 0x22;\nconst kSendBreak = 0x23;\n\nconst kDefaultBufferSize = 255;\nconst kDefaultDataBits = 8;\nconst kDefaultParity = 'none';\nconst kDefaultStopBits = 1;\n\nconst kAcceptableDataBits = [16, 8, 7, 6, 5];\nconst kAcceptableStopBits = [1, 2];\nconst kAcceptableParity = ['none', 'even', 'odd'];\n\nconst kParityIndexMapping: ParityType[] =\n ['none', 'odd', 'even'];\nconst kStopBitsIndexMapping = [1, 1.5, 2];\n\nconst kDefaultPolyfillOptions = {\n protocol: SerialPolyfillProtocol.UsbCdcAcm,\n usbControlInterfaceClass: 2,\n usbTransferInterfaceClass: 10,\n};\n\n/**\n * Utility function to get the interface implementing a desired class.\n * @param {USBDevice} device The USB device.\n * @param {number} classCode The desired interface class.\n * @return {USBInterface} The first interface found that implements the desired\n * class.\n * @throws TypeError if no interface is found.\n */\nfunction findInterface(device: USBDevice, classCode: number): USBInterface {\n const configuration = device.configurations[0];\n for (const iface of configuration.interfaces) {\n const alternate = iface.alternates[0];\n if (alternate.interfaceClass === classCode) {\n return iface;\n }\n }\n throw new TypeError(`Unable to find interface with class ${classCode}.`);\n}\n\n/**\n * Utility function to get an endpoint with a particular direction.\n * @param {USBInterface} iface The interface to search.\n * @param {USBDirection} direction The desired transfer direction.\n * @return {USBEndpoint} The first endpoint with the desired transfer direction.\n * @throws TypeError if no endpoint is found.\n */\nfunction findEndpoint(iface: USBInterface, direction: USBDirection):\n USBEndpoint {\n const alternate = iface.alternates[0];\n for (const endpoint of alternate.endpoints) {\n if (endpoint.direction == direction) {\n return endpoint;\n }\n }\n throw new TypeError(`Interface ${iface.interfaceNumber} does not have an ` +\n `${direction} endpoint.`);\n}\n\n/**\n * Implementation of the underlying source API[1] which reads data from a USB\n * endpoint. This can be used to construct a ReadableStream.\n *\n * [1]: https://streams.spec.whatwg.org/#underlying-source-api\n */\nclass UsbEndpointUnderlyingSource implements UnderlyingByteSource {\n private device_: USBDevice;\n private endpoint_: USBEndpoint;\n private onError_: () => void;\n\n type: 'bytes';\n\n /**\n * Constructs a new UnderlyingSource that will pull data from the specified\n * endpoint on the given USB device.\n *\n * @param {USBDevice} device\n * @param {USBEndpoint} endpoint\n * @param {function} onError function to be called on error\n */\n constructor(device: USBDevice, endpoint: USBEndpoint, onError: () => void) {\n this.type = 'bytes';\n this.device_ = device;\n this.endpoint_ = endpoint;\n this.onError_ = onError;\n }\n\n /**\n * Reads a chunk of data from the device.\n *\n * @param {ReadableByteStreamController} controller\n */\n pull(controller: ReadableByteStreamController): void {\n (async (): Promise => {\n let chunkSize;\n if (controller.desiredSize) {\n const d = controller.desiredSize / this.endpoint_.packetSize;\n chunkSize = Math.ceil(d) * this.endpoint_.packetSize;\n } else {\n chunkSize = this.endpoint_.packetSize;\n }\n\n try {\n const result = await this.device_.transferIn(\n this.endpoint_.endpointNumber, chunkSize);\n if (result.status != 'ok') {\n controller.error(`USB error: ${result.status}`);\n this.onError_();\n }\n if (result.data?.buffer) {\n const chunk = new Uint8Array(\n result.data.buffer, result.data.byteOffset,\n result.data.byteLength);\n controller.enqueue(chunk);\n }\n } catch (error) {\n controller.error(error.toString());\n this.onError_();\n }\n })();\n }\n}\n\n/**\n * Implementation of the underlying sink API[2] which writes data to a USB\n * endpoint. This can be used to construct a WritableStream.\n *\n * [2]: https://streams.spec.whatwg.org/#underlying-sink-api\n */\nclass UsbEndpointUnderlyingSink implements UnderlyingSink {\n private device_: USBDevice;\n private endpoint_: USBEndpoint;\n private onError_: () => void;\n\n /**\n * Constructs a new UnderlyingSink that will write data to the specified\n * endpoint on the given USB device.\n *\n * @param {USBDevice} device\n * @param {USBEndpoint} endpoint\n * @param {function} onError function to be called on error\n */\n constructor(device: USBDevice, endpoint: USBEndpoint, onError: () => void) {\n this.device_ = device;\n this.endpoint_ = endpoint;\n this.onError_ = onError;\n }\n\n /**\n * Writes a chunk to the device.\n *\n * @param {Uint8Array} chunk\n * @param {WritableStreamDefaultController} controller\n */\n async write(\n chunk: Uint8Array,\n controller: WritableStreamDefaultController): Promise {\n try {\n const result =\n await this.device_.transferOut(this.endpoint_.endpointNumber, chunk);\n if (result.status != 'ok') {\n controller.error(result.status);\n this.onError_();\n }\n } catch (error) {\n controller.error(error.toString());\n this.onError_();\n }\n }\n}\n\n/** a class used to control serial devices over WebUSB */\nexport class SerialPort {\n private polyfillOptions_: SerialPolyfillOptions;\n private device_: USBDevice;\n private controlInterface_: USBInterface;\n private transferInterface_: USBInterface;\n private inEndpoint_: USBEndpoint;\n private outEndpoint_: USBEndpoint;\n\n private serialOptions_: SerialOptions;\n private readable_: ReadableStream | null;\n private writable_: WritableStream | null;\n private outputSignals_: SerialOutputSignals;\n\n /**\n * constructor taking a WebUSB device that creates a SerialPort instance.\n * @param {USBDevice} device A device acquired from the WebUSB API\n * @param {SerialPolyfillOptions} polyfillOptions Optional options to\n * configure the polyfill.\n */\n public constructor(\n device: USBDevice,\n polyfillOptions?: SerialPolyfillOptions) {\n this.polyfillOptions_ = {...kDefaultPolyfillOptions, ...polyfillOptions};\n this.outputSignals_ = {\n dataTerminalReady: false,\n requestToSend: false,\n break: false,\n };\n\n this.device_ = device;\n this.controlInterface_ = findInterface(\n this.device_,\n this.polyfillOptions_.usbControlInterfaceClass as number);\n this.transferInterface_ = findInterface(\n this.device_,\n this.polyfillOptions_.usbTransferInterfaceClass as number);\n this.inEndpoint_ = findEndpoint(this.transferInterface_, 'in');\n this.outEndpoint_ = findEndpoint(this.transferInterface_, 'out');\n }\n\n /**\n * Getter for the readable attribute. Constructs a new ReadableStream as\n * necessary.\n * @return {ReadableStream} the current readable stream\n */\n public get readable(): ReadableStream | null {\n if (!this.readable_ && this.device_.opened) {\n this.readable_ = new ReadableStream(\n new UsbEndpointUnderlyingSource(\n this.device_, this.inEndpoint_, () => {\n this.readable_ = null;\n }),\n {\n highWaterMark: this.serialOptions_.bufferSize ?? kDefaultBufferSize,\n });\n }\n return this.readable_;\n }\n\n /**\n * Getter for the writable attribute. Constructs a new WritableStream as\n * necessary.\n * @return {WritableStream} the current writable stream\n */\n public get writable(): WritableStream | null {\n if (!this.writable_ && this.device_.opened) {\n this.writable_ = new WritableStream(\n new UsbEndpointUnderlyingSink(\n this.device_, this.outEndpoint_, () => {\n this.writable_ = null;\n }),\n new ByteLengthQueuingStrategy({\n highWaterMark: this.serialOptions_.bufferSize ?? kDefaultBufferSize,\n }));\n }\n return this.writable_;\n }\n\n /**\n * a function that opens the device and claims all interfaces needed to\n * control and communicate to and from the serial device\n * @param {SerialOptions} options Object containing serial options\n * @return {Promise} A promise that will resolve when device is ready\n * for communication\n */\n public async open(options: SerialOptions): Promise {\n this.serialOptions_ = options;\n this.validateOptions();\n\n try {\n await this.device_.open();\n if (this.device_.configuration === null) {\n await this.device_.selectConfiguration(1);\n }\n\n await this.device_.claimInterface(this.controlInterface_.interfaceNumber);\n if (this.controlInterface_ !== this.transferInterface_) {\n await this.device_.claimInterface(\n this.transferInterface_.interfaceNumber);\n }\n\n await this.setLineCoding();\n await this.setSignals({dataTerminalReady: true});\n } catch (error) {\n if (this.device_.opened) {\n await this.device_.close();\n }\n throw new Error('Error setting up device: ' + error.toString());\n }\n }\n\n /**\n * Closes the port.\n *\n * @return {Promise} A promise that will resolve when the port is\n * closed.\n */\n public async close(): Promise {\n const promises = [];\n if (this.readable_) {\n promises.push(this.readable_.cancel());\n }\n if (this.writable_) {\n promises.push(this.writable_.abort());\n }\n await Promise.all(promises);\n this.readable_ = null;\n this.writable_ = null;\n if (this.device_.opened) {\n await this.setSignals({dataTerminalReady: false, requestToSend: false});\n await this.device_.close();\n }\n }\n\n /**\n * Forgets the port.\n *\n * @return {Promise} A promise that will resolve when the port is\n * forgotten.\n */\n public async forget(): Promise {\n return this.device_.forget();\n }\n\n /**\n * A function that returns properties of the device.\n * @return {SerialPortInfo} Device properties.\n */\n public getInfo(): SerialPortInfo {\n return {\n usbVendorId: this.device_.vendorId,\n usbProductId: this.device_.productId,\n };\n }\n\n /**\n * A function used to change the serial settings of the device\n * @param {object} options the object which carries serial settings data\n * @return {Promise} A promise that will resolve when the options are\n * set\n */\n public reconfigure(options: SerialOptions): Promise {\n this.serialOptions_ = {...this.serialOptions_, ...options};\n this.validateOptions();\n return this.setLineCoding();\n }\n\n /**\n * Sets control signal state for the port.\n * @param {SerialOutputSignals} signals The signals to enable or disable.\n * @return {Promise} a promise that is resolved when the signal state\n * has been changed.\n */\n public async setSignals(signals: SerialOutputSignals): Promise {\n this.outputSignals_ = {...this.outputSignals_, ...signals};\n\n if (signals.dataTerminalReady !== undefined ||\n signals.requestToSend !== undefined) {\n // The Set_Control_Line_State command expects a bitmap containing the\n // values of all output signals that should be enabled or disabled.\n //\n // Ref: USB CDC specification version 1.1 §6.2.14.\n const value = (this.outputSignals_.dataTerminalReady ? 1 << 0 : 0) |\n (this.outputSignals_.requestToSend ? 1 << 1 : 0);\n\n await this.device_.controlTransferOut({\n 'requestType': 'class',\n 'recipient': 'interface',\n 'request': kSetControlLineState,\n 'value': value,\n 'index': this.controlInterface_.interfaceNumber,\n });\n }\n\n if (signals.break !== undefined) {\n // The SendBreak command expects to be given a duration for how long the\n // break signal should be asserted. Passing 0xFFFF enables the signal\n // until 0x0000 is send.\n //\n // Ref: USB CDC specification version 1.1 §6.2.15.\n const value = this.outputSignals_.break ? 0xFFFF : 0x0000;\n\n await this.device_.controlTransferOut({\n 'requestType': 'class',\n 'recipient': 'interface',\n 'request': kSendBreak,\n 'value': value,\n 'index': this.controlInterface_.interfaceNumber,\n });\n }\n }\n\n /**\n * Checks the serial options for validity and throws an error if it is\n * not valid\n */\n private validateOptions(): void {\n if (!this.isValidBaudRate(this.serialOptions_.baudRate)) {\n throw new RangeError('invalid Baud Rate ' + this.serialOptions_.baudRate);\n }\n\n if (!this.isValidDataBits(this.serialOptions_.dataBits)) {\n throw new RangeError('invalid dataBits ' + this.serialOptions_.dataBits);\n }\n\n if (!this.isValidStopBits(this.serialOptions_.stopBits)) {\n throw new RangeError('invalid stopBits ' + this.serialOptions_.stopBits);\n }\n\n if (!this.isValidParity(this.serialOptions_.parity)) {\n throw new RangeError('invalid parity ' + this.serialOptions_.parity);\n }\n }\n\n /**\n * Checks the baud rate for validity\n * @param {number} baudRate the baud rate to check\n * @return {boolean} A boolean that reflects whether the baud rate is valid\n */\n private isValidBaudRate(baudRate: number): boolean {\n return baudRate % 1 === 0;\n }\n\n /**\n * Checks the data bits for validity\n * @param {number} dataBits the data bits to check\n * @return {boolean} A boolean that reflects whether the data bits setting is\n * valid\n */\n private isValidDataBits(dataBits: number | undefined): boolean {\n if (typeof dataBits === 'undefined') {\n return true;\n }\n return kAcceptableDataBits.includes(dataBits);\n }\n\n /**\n * Checks the stop bits for validity\n * @param {number} stopBits the stop bits to check\n * @return {boolean} A boolean that reflects whether the stop bits setting is\n * valid\n */\n private isValidStopBits(stopBits: number | undefined): boolean {\n if (typeof stopBits === 'undefined') {\n return true;\n }\n return kAcceptableStopBits.includes(stopBits);\n }\n\n /**\n * Checks the parity for validity\n * @param {string} parity the parity to check\n * @return {boolean} A boolean that reflects whether the parity is valid\n */\n private isValidParity(parity: ParityType | undefined): boolean {\n if (typeof parity === 'undefined') {\n return true;\n }\n return kAcceptableParity.includes(parity);\n }\n\n /**\n * sends the options alog the control interface to set them on the device\n * @return {Promise} a promise that will resolve when the options are set\n */\n private async setLineCoding(): Promise {\n // Ref: USB CDC specification version 1.1 §6.2.12.\n const buffer = new ArrayBuffer(7);\n const view = new DataView(buffer);\n view.setUint32(0, this.serialOptions_.baudRate, true);\n view.setUint8(\n 4, kStopBitsIndexMapping.indexOf(\n this.serialOptions_.stopBits ?? kDefaultStopBits));\n view.setUint8(\n 5, kParityIndexMapping.indexOf(\n this.serialOptions_.parity ?? kDefaultParity));\n view.setUint8(6, this.serialOptions_.dataBits ?? kDefaultDataBits);\n\n const result = await this.device_.controlTransferOut({\n 'requestType': 'class',\n 'recipient': 'interface',\n 'request': kSetLineCoding,\n 'value': 0x00,\n 'index': this.controlInterface_.interfaceNumber,\n }, buffer);\n if (result.status != 'ok') {\n throw new DOMException('NetworkError', 'Failed to set line coding.');\n }\n }\n}\n\n/** implementation of the global navigator.serial object */\nclass Serial {\n /**\n * Requests permission to access a new port.\n *\n * @param {SerialPortRequestOptions} options\n * @param {SerialPolyfillOptions} polyfillOptions\n * @return {Promise}\n */\n async requestPort(\n options?: SerialPortRequestOptions,\n polyfillOptions?: SerialPolyfillOptions): Promise {\n polyfillOptions = {...kDefaultPolyfillOptions, ...polyfillOptions};\n\n const usbFilters: USBDeviceFilter[] = [];\n if (options && options.filters) {\n for (const filter of options.filters) {\n const usbFilter: USBDeviceFilter = {\n classCode: polyfillOptions.usbControlInterfaceClass,\n };\n if (filter.usbVendorId !== undefined) {\n usbFilter.vendorId = filter.usbVendorId;\n }\n if (filter.usbProductId !== undefined) {\n usbFilter.productId = filter.usbProductId;\n }\n usbFilters.push(usbFilter);\n }\n }\n\n if (usbFilters.length === 0) {\n usbFilters.push({\n classCode: polyfillOptions.usbControlInterfaceClass,\n });\n }\n\n const device = await navigator.usb.requestDevice({'filters': usbFilters});\n const port = new SerialPort(device, polyfillOptions);\n return port;\n }\n\n /**\n * Get the set of currently available ports.\n *\n * @param {SerialPolyfillOptions} polyfillOptions Polyfill configuration that\n * should be applied to these ports.\n * @return {Promise} a promise that is resolved with a list of\n * ports.\n */\n async getPorts(polyfillOptions?: SerialPolyfillOptions):\n Promise {\n polyfillOptions = {...kDefaultPolyfillOptions, ...polyfillOptions};\n\n const devices = await navigator.usb.getDevices();\n const ports: SerialPort[] = [];\n devices.forEach((device) => {\n try {\n const port = new SerialPort(device, polyfillOptions);\n ports.push(port);\n } catch (e) {\n // Skip unrecognized port.\n }\n });\n return ports;\n }\n}\n\n/* an object to be used for starting the serial workflow */\nexport const serial = new Serial();\n"],"names":[],"version":3,"file":"index.82fa246c.js.map"} \ No newline at end of file diff --git a/c6-hosted/index.html b/c6-hosted/index.html new file mode 100644 index 00000000000..0e0357dd9f3 --- /dev/null +++ b/c6-hosted/index.html @@ -0,0 +1,72 @@ + + + + + ESP32-C6 SDIO-Hosted + + + + + + + + + + +

ESP Tool

+

A Serial Flasher utility for Espressif chips

+ +
+
+
+ +

Program ESP32-C6 as SDIO ESP-Hosted adapter

+ + + + + + + +
+ + +
+ + + + + + + + + + + +
Flash AddressFileSizeProgress
+ +
+ + + +
+
+
+ + + + diff --git a/c6-hosted/network_adapter.bin b/c6-hosted/network_adapter.bin new file mode 100644 index 00000000000..86bd5784e8e Binary files /dev/null and b/c6-hosted/network_adapter.bin differ diff --git a/tools/partitions/boot_app0.bin b/c6-hosted/ota_data_initial.bin similarity index 98% rename from tools/partitions/boot_app0.bin rename to c6-hosted/ota_data_initial.bin index 13562cabb96..b4033a70859 100644 Binary files a/tools/partitions/boot_app0.bin and b/c6-hosted/ota_data_initial.bin differ diff --git a/tools/partitions/default.bin b/c6-hosted/partition-table.bin similarity index 93% rename from tools/partitions/default.bin rename to c6-hosted/partition-table.bin index eabbf0cb455..e5d55905ad6 100644 Binary files a/tools/partitions/default.bin and b/c6-hosted/partition-table.bin differ diff --git a/component.mk b/component.mk deleted file mode 100644 index 4b85ee4f217..00000000000 --- a/component.mk +++ /dev/null @@ -1,36 +0,0 @@ -ARDUINO_ALL_LIBRARIES := $(patsubst $(COMPONENT_PATH)/libraries/%,%,$(wildcard $(COMPONENT_PATH)/libraries/*)) - -# Macro returns non-empty if Arduino library $(1) should be included in the build -# (either because selective compilation is of, or this library is enabled -define ARDUINO_LIBRARY_ENABLED -$(if $(CONFIG_ARDUINO_SELECTIVE_COMPILATION),$(CONFIG_ARDUINO_SELECTIVE_$(1)),y) -endef - -ARDUINO_ENABLED_LIBRARIES := $(foreach LIBRARY,$(sort $(ARDUINO_ALL_LIBRARIES)),$(if $(call ARDUINO_LIBRARY_ENABLED,$(LIBRARY)),$(LIBRARY))) - -$(info Arduino libraries in build: $(ARDUINO_ENABLED_LIBRARIES)) - -# Expand all subdirs under $(1) -define EXPAND_SUBDIRS -$(sort $(dir $(wildcard $(1)/* $(1)/*/* $(1)/*/*/* $(1)/*/*/*/* $(1)/*/*/*/*/*))) -endef - -# Macro returns SRCDIRS for library -define ARDUINO_LIBRARY_GET_SRCDIRS - $(if $(wildcard $(COMPONENT_PATH)/libraries/$(1)/src/.), \ - $(call EXPAND_SUBDIRS,$(COMPONENT_PATH)/libraries/$(1)/src), \ - $(filter-out $(call EXPAND_SUBDIRS,$(COMPONENT_PATH)/libraries/$(1)/examples), \ - $(call EXPAND_SUBDIRS,$(COMPONENT_PATH)/libraries/$(1)) \ - ) \ - ) -endef - -# Make a list of all srcdirs in enabled libraries -ARDUINO_LIBRARY_SRCDIRS := $(patsubst $(COMPONENT_PATH)/%,%,$(foreach LIBRARY,$(ARDUINO_ENABLED_LIBRARIES),$(call ARDUINO_LIBRARY_GET_SRCDIRS,$(LIBRARY)))) - -#$(info Arduino libraries src dirs: $(ARDUINO_LIBRARY_SRCDIRS)) - -COMPONENT_ADD_INCLUDEDIRS := cores/esp32 variants/esp32 $(ARDUINO_LIBRARY_SRCDIRS) -COMPONENT_PRIV_INCLUDEDIRS := cores/esp32/libb64 -COMPONENT_SRCDIRS := cores/esp32/libb64 cores/esp32 variants/esp32 $(ARDUINO_LIBRARY_SRCDIRS) -CXXFLAGS += -fno-rtti diff --git a/cores/esp32/Arduino.h b/cores/esp32/Arduino.h deleted file mode 100644 index 645b407034f..00000000000 --- a/cores/esp32/Arduino.h +++ /dev/null @@ -1,187 +0,0 @@ -/* - Arduino.h - Main include file for the Arduino SDK - Copyright (c) 2005-2013 Arduino Team. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef Arduino_h -#define Arduino_h - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "freertos/semphr.h" -#include "esp32-hal.h" -#include "esp8266-compat.h" -#include "soc/gpio_reg.h" - -#include "stdlib_noniso.h" -#include "binary.h" - -#define PI 3.1415926535897932384626433832795 -#define HALF_PI 1.5707963267948966192313216916398 -#define TWO_PI 6.283185307179586476925286766559 -#define DEG_TO_RAD 0.017453292519943295769236907684886 -#define RAD_TO_DEG 57.295779513082320876798154814105 -#define EULER 2.718281828459045235360287471352 - -#define SERIAL 0x0 -#define DISPLAY 0x1 - -#define LSBFIRST 0 -#define MSBFIRST 1 - -//Interrupt Modes -#define RISING 0x01 -#define FALLING 0x02 -#define CHANGE 0x03 -#define ONLOW 0x04 -#define ONHIGH 0x05 -#define ONLOW_WE 0x0C -#define ONHIGH_WE 0x0D - -#define DEFAULT 1 -#define EXTERNAL 0 - -#ifndef __STRINGIFY -#define __STRINGIFY(a) #a -#endif - -#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt))) -#define radians(deg) ((deg)*DEG_TO_RAD) -#define degrees(rad) ((rad)*RAD_TO_DEG) -#define sq(x) ((x)*(x)) - -#define sei() -#define cli() -#define interrupts() sei() -#define noInterrupts() cli() - -#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L ) -#define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() ) -#define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() ) - -#define lowByte(w) ((uint8_t) ((w) & 0xff)) -#define highByte(w) ((uint8_t) ((w) >> 8)) - -#define bitRead(value, bit) (((value) >> (bit)) & 0x01) -#define bitSet(value, bit) ((value) |= (1UL << (bit))) -#define bitClear(value, bit) ((value) &= ~(1UL << (bit))) -#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit)) - -// avr-libc defines _NOP() since 1.6.2 -#ifndef _NOP -#define _NOP() do { __asm__ volatile ("nop"); } while (0) -#endif - -#define bit(b) (1UL << (b)) -#define _BV(b) (1UL << (b)) - -#define digitalPinToPort(pin) (((pin)>31)?1:0) -#define digitalPinToBitMask(pin) (1UL << (((pin)>31)?((pin)-32):(pin))) -#define digitalPinToTimer(pin) (0) -#define analogInPinToBit(P) (P) -#define portOutputRegister(port) ((volatile uint32_t*)((port)?GPIO_OUT1_REG:GPIO_OUT_REG)) -#define portInputRegister(port) ((volatile uint32_t*)((port)?GPIO_IN1_REG:GPIO_IN_REG)) -#define portModeRegister(port) ((volatile uint32_t*)((port)?GPIO_ENABLE1_REG:GPIO_ENABLE_REG)) - -#define NOT_A_PIN -1 -#define NOT_A_PORT -1 -#define NOT_AN_INTERRUPT -1 -#define NOT_ON_TIMER 0 - -typedef bool boolean; -typedef uint8_t byte; -typedef unsigned int word; - -void setup(void); -void loop(void); - -long random(long, long); -void randomSeed(unsigned long); -long map(long, long, long, long, long); - -#ifdef __cplusplus -extern "C" { -#endif - -void init(void); -void initVariant(void); -void initArduino(void); - -unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout); -unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout); - -uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder); -void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val); - -#ifdef __cplusplus -} - -#include -#include - -#include "WCharacter.h" -#include "WString.h" -#include "Stream.h" -#include "Printable.h" -#include "Print.h" -#include "IPAddress.h" -#include "Client.h" -#include "Server.h" -#include "Udp.h" -#include "HardwareSerial.h" -#include "Esp.h" - -using std::abs; -using std::isinf; -using std::isnan; -using std::max; -using std::min; -using ::round; - -uint16_t makeWord(uint16_t w); -uint16_t makeWord(byte h, byte l); - -#define word(...) makeWord(__VA_ARGS__) - -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); - -extern "C" bool getLocalTime(struct tm * info, uint32_t ms = 5000); -extern "C" void configTime(long gmtOffset_sec, int daylightOffset_sec, - const char* server1, const char* server2 = nullptr, const char* server3 = nullptr); -extern "C" void configTzTime(const char* tz, - const char* server1, const char* server2 = nullptr, const char* server3 = nullptr); - -// WMath prototypes -long random(long); -#endif /* __cplusplus */ - -#define _min(a,b) ((a)<(b)?(a):(b)) -#define _max(a,b) ((a)>(b)?(a):(b)) - -#include "pins_arduino.h" - -#endif /* _ESP32_CORE_ARDUINO_H_ */ diff --git a/cores/esp32/Client.h b/cores/esp32/Client.h deleted file mode 100644 index 962cacc51da..00000000000 --- a/cores/esp32/Client.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - Client.h - Base class that provides Client - Copyright (c) 2011 Adrian McEwen. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef client_h -#define client_h -#include "Print.h" -#include "Stream.h" -#include "IPAddress.h" - -class Client: public Stream -{ -public: - virtual int connect(IPAddress ip, uint16_t port) =0; - virtual int connect(const char *host, uint16_t port) =0; - virtual size_t write(uint8_t) =0; - virtual size_t write(const uint8_t *buf, size_t size) =0; - virtual int available() = 0; - virtual int read() = 0; - virtual int read(uint8_t *buf, size_t size) = 0; - virtual int peek() = 0; - virtual void flush() = 0; - virtual void stop() = 0; - virtual uint8_t connected() = 0; - virtual operator bool() = 0; -protected: - uint8_t* rawIPAddress(IPAddress& addr) - { - return addr.raw_address(); - } -}; - -#endif diff --git a/cores/esp32/Esp.cpp b/cores/esp32/Esp.cpp deleted file mode 100644 index 54451127ef3..00000000000 --- a/cores/esp32/Esp.cpp +++ /dev/null @@ -1,318 +0,0 @@ -/* - Esp.cpp - ESP31B-specific APIs - Copyright (c) 2015 Ivan Grokhotkov. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "Arduino.h" -#include "Esp.h" -#include "rom/spi_flash.h" -#include "esp_sleep.h" -#include "esp_spi_flash.h" -#include -#include -#include -#include -extern "C" { -#include "esp_ota_ops.h" -#include "esp_image_format.h" -} -#include - -/** - * User-defined Literals - * usage: - * - * uint32_t = test = 10_MHz; // --> 10000000 - */ - -unsigned long long operator"" _kHz(unsigned long long x) -{ - return x * 1000; -} - -unsigned long long operator"" _MHz(unsigned long long x) -{ - return x * 1000 * 1000; -} - -unsigned long long operator"" _GHz(unsigned long long x) -{ - return x * 1000 * 1000 * 1000; -} - -unsigned long long operator"" _kBit(unsigned long long x) -{ - return x * 1024; -} - -unsigned long long operator"" _MBit(unsigned long long x) -{ - return x * 1024 * 1024; -} - -unsigned long long operator"" _GBit(unsigned long long x) -{ - return x * 1024 * 1024 * 1024; -} - -unsigned long long operator"" _kB(unsigned long long x) -{ - return x * 1024; -} - -unsigned long long operator"" _MB(unsigned long long x) -{ - return x * 1024 * 1024; -} - -unsigned long long operator"" _GB(unsigned long long x) -{ - return x * 1024 * 1024 * 1024; -} - - -EspClass ESP; - -void EspClass::deepSleep(uint32_t time_us) -{ - esp_deep_sleep(time_us); -} - -void EspClass::restart(void) -{ - esp_restart(); -} - -uint32_t EspClass::getHeapSize(void) -{ - multi_heap_info_t info; - heap_caps_get_info(&info, MALLOC_CAP_INTERNAL); - return info.total_free_bytes + info.total_allocated_bytes; -} - -uint32_t EspClass::getFreeHeap(void) -{ - return heap_caps_get_free_size(MALLOC_CAP_INTERNAL); -} - -uint32_t EspClass::getMinFreeHeap(void) -{ - return heap_caps_get_minimum_free_size(MALLOC_CAP_INTERNAL); -} - -uint32_t EspClass::getMaxAllocHeap(void) -{ - return heap_caps_get_largest_free_block(MALLOC_CAP_INTERNAL); -} - -uint32_t EspClass::getPsramSize(void) -{ - multi_heap_info_t info; - heap_caps_get_info(&info, MALLOC_CAP_SPIRAM); - return info.total_free_bytes + info.total_allocated_bytes; -} - -uint32_t EspClass::getFreePsram(void) -{ - return heap_caps_get_free_size(MALLOC_CAP_SPIRAM); -} - -uint32_t EspClass::getMinFreePsram(void) -{ - return heap_caps_get_minimum_free_size(MALLOC_CAP_SPIRAM); -} - -uint32_t EspClass::getMaxAllocPsram(void) -{ - return heap_caps_get_largest_free_block(MALLOC_CAP_SPIRAM); -} - -static uint32_t sketchSize(sketchSize_t response) { - esp_image_metadata_t data; - const esp_partition_t *running = esp_ota_get_running_partition(); - if (!running) return 0; - const esp_partition_pos_t running_pos = { - .offset = running->address, - .size = running->size, - }; - data.start_addr = running_pos.offset; - esp_image_verify(ESP_IMAGE_VERIFY, &running_pos, &data); - if (response) { - return running_pos.size - data.image_len; - } else { - return data.image_len; - } -} - -uint32_t EspClass::getSketchSize () { - return sketchSize(SKETCH_SIZE_TOTAL); -} - -String EspClass::getSketchMD5() -{ - static String result; - if (result.length()) { - return result; - } - uint32_t lengthLeft = getSketchSize(); - - const esp_partition_t *running = esp_ota_get_running_partition(); - if (!running) { - log_e("Partition could not be found"); - - return String(); - } - const size_t bufSize = SPI_FLASH_SEC_SIZE; - std::unique_ptr buf(new uint8_t[bufSize]); - uint32_t offset = 0; - if(!buf.get()) { - log_e("Not enough memory to allocate buffer"); - - return String(); - } - MD5Builder md5; - md5.begin(); - while( lengthLeft > 0) { - size_t readBytes = (lengthLeft < bufSize) ? lengthLeft : bufSize; - if (!ESP.flashRead(running->address + offset, reinterpret_cast(buf.get()), (readBytes + 3) & ~3)) { - log_e("Could not read buffer from flash"); - - return String(); - } - md5.add(buf.get(), readBytes); - lengthLeft -= readBytes; - offset += readBytes; - } - md5.calculate(); - result = md5.toString(); - return result; -} - -uint32_t EspClass::getFreeSketchSpace () { - const esp_partition_t* _partition = esp_ota_get_next_update_partition(NULL); - if(!_partition){ - return 0; - } - - return _partition->size; -} - -uint8_t EspClass::getChipRevision(void) -{ - esp_chip_info_t chip_info; - esp_chip_info(&chip_info); - return chip_info.revision; -} - -const char * EspClass::getSdkVersion(void) -{ - return esp_get_idf_version(); -} - -uint32_t EspClass::getFlashChipSize(void) -{ - esp_image_header_t fhdr; - if(flashRead(0x1000, (uint32_t*)&fhdr, sizeof(esp_image_header_t)) && fhdr.magic != ESP_IMAGE_HEADER_MAGIC) { - return 0; - } - return magicFlashChipSize(fhdr.spi_size); -} - -uint32_t EspClass::getFlashChipSpeed(void) -{ - esp_image_header_t fhdr; - if(flashRead(0x1000, (uint32_t*)&fhdr, sizeof(esp_image_header_t)) && fhdr.magic != ESP_IMAGE_HEADER_MAGIC) { - return 0; - } - return magicFlashChipSpeed(fhdr.spi_speed); -} - -FlashMode_t EspClass::getFlashChipMode(void) -{ - esp_image_header_t fhdr; - if(flashRead(0x1000, (uint32_t*)&fhdr, sizeof(esp_image_header_t)) && fhdr.magic != ESP_IMAGE_HEADER_MAGIC) { - return FM_UNKNOWN; - } - return magicFlashChipMode(fhdr.spi_mode); -} - -uint32_t EspClass::magicFlashChipSize(uint8_t byte) -{ - switch(byte & 0x0F) { - case 0x0: // 8 MBit (1MB) - return (1_MB); - case 0x1: // 16 MBit (2MB) - return (2_MB); - case 0x2: // 32 MBit (4MB) - return (4_MB); - case 0x3: // 64 MBit (8MB) - return (8_MB); - case 0x4: // 128 MBit (16MB) - return (16_MB); - default: // fail? - return 0; - } -} - -uint32_t EspClass::magicFlashChipSpeed(uint8_t byte) -{ - switch(byte & 0x0F) { - case 0x0: // 40 MHz - return (40_MHz); - case 0x1: // 26 MHz - return (26_MHz); - case 0x2: // 20 MHz - return (20_MHz); - case 0xf: // 80 MHz - return (80_MHz); - default: // fail? - return 0; - } -} - -FlashMode_t EspClass::magicFlashChipMode(uint8_t byte) -{ - FlashMode_t mode = (FlashMode_t) byte; - if(mode > FM_SLOW_READ) { - mode = FM_UNKNOWN; - } - return mode; -} - -bool EspClass::flashEraseSector(uint32_t sector) -{ - return spi_flash_erase_sector(sector) == ESP_OK; -} - -// Warning: These functions do not work with encrypted flash -bool EspClass::flashWrite(uint32_t offset, uint32_t *data, size_t size) -{ - return spi_flash_write(offset, (uint32_t*) data, size) == ESP_OK; -} - -bool EspClass::flashRead(uint32_t offset, uint32_t *data, size_t size) -{ - return spi_flash_read(offset, (uint32_t*) data, size) == ESP_OK; -} - - -uint64_t EspClass::getEfuseMac(void) -{ - uint64_t _chipmacid = 0LL; - esp_efuse_mac_get_default((uint8_t*) (&_chipmacid)); - return _chipmacid; -} diff --git a/cores/esp32/Esp.h b/cores/esp32/Esp.h deleted file mode 100644 index 2580eecf65b..00000000000 --- a/cores/esp32/Esp.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - Esp.h - ESP31B-specific APIs - Copyright (c) 2015 Ivan Grokhotkov. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef ESP_H -#define ESP_H - -#include - -/** - * AVR macros for WDT managment - */ -typedef enum { - WDTO_0MS = 0, //!< WDTO_0MS - WDTO_15MS = 15, //!< WDTO_15MS - WDTO_30MS = 30, //!< WDTO_30MS - WDTO_60MS = 60, //!< WDTO_60MS - WDTO_120MS = 120, //!< WDTO_120MS - WDTO_250MS = 250, //!< WDTO_250MS - WDTO_500MS = 500, //!< WDTO_500MS - WDTO_1S = 1000,//!< WDTO_1S - WDTO_2S = 2000,//!< WDTO_2S - WDTO_4S = 4000,//!< WDTO_4S - WDTO_8S = 8000 //!< WDTO_8S -} WDTO_t; - - -typedef enum { - FM_QIO = 0x00, - FM_QOUT = 0x01, - FM_DIO = 0x02, - FM_DOUT = 0x03, - FM_FAST_READ = 0x04, - FM_SLOW_READ = 0x05, - FM_UNKNOWN = 0xff -} FlashMode_t; - -typedef enum { - SKETCH_SIZE_TOTAL = 0, - SKETCH_SIZE_FREE = 1 -} sketchSize_t; - -class EspClass -{ -public: - EspClass() {} - ~EspClass() {} - void restart(); - - //Internal RAM - uint32_t getHeapSize(); //total heap size - uint32_t getFreeHeap(); //available heap - uint32_t getMinFreeHeap(); //lowest level of free heap since boot - uint32_t getMaxAllocHeap(); //largest block of heap that can be allocated at once - - //SPI RAM - uint32_t getPsramSize(); - uint32_t getFreePsram(); - uint32_t getMinFreePsram(); - uint32_t getMaxAllocPsram(); - - uint8_t getChipRevision(); - uint32_t getCpuFreqMHz(){ return getCpuFrequencyMhz(); } - inline uint32_t getCycleCount() __attribute__((always_inline)); - const char * getSdkVersion(); - - void deepSleep(uint32_t time_us); - - uint32_t getFlashChipSize(); - uint32_t getFlashChipSpeed(); - FlashMode_t getFlashChipMode(); - - uint32_t magicFlashChipSize(uint8_t byte); - uint32_t magicFlashChipSpeed(uint8_t byte); - FlashMode_t magicFlashChipMode(uint8_t byte); - - uint32_t getSketchSize(); - String getSketchMD5(); - uint32_t getFreeSketchSpace(); - - bool flashEraseSector(uint32_t sector); - bool flashWrite(uint32_t offset, uint32_t *data, size_t size); - bool flashRead(uint32_t offset, uint32_t *data, size_t size); - - uint64_t getEfuseMac(); - -}; - -uint32_t IRAM_ATTR EspClass::getCycleCount() -{ - uint32_t ccount; - __asm__ __volatile__("esync; rsr %0,ccount":"=a" (ccount)); - return ccount; -} - -extern EspClass ESP; - -#endif //ESP_H diff --git a/cores/esp32/FunctionalInterrupt.cpp b/cores/esp32/FunctionalInterrupt.cpp deleted file mode 100644 index d2e6dfd4236..00000000000 --- a/cores/esp32/FunctionalInterrupt.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * FunctionalInterrupt.cpp - * - * Created on: 8 jul. 2018 - * Author: Herman - */ - -#include "FunctionalInterrupt.h" -#include "Arduino.h" - -typedef void (*voidFuncPtr)(void); -typedef void (*voidFuncPtrArg)(void*); - -extern "C" -{ - extern void __attachInterruptFunctionalArg(uint8_t pin, voidFuncPtrArg userFunc, void * arg, int intr_type, bool functional); -} - -void IRAM_ATTR interruptFunctional(void* arg) -{ - InterruptArgStructure* localArg = (InterruptArgStructure*)arg; - if (localArg->interruptFunction) - { - localArg->interruptFunction(); - } -} - -void attachInterrupt(uint8_t pin, std::function intRoutine, int mode) -{ - // use the local interrupt routine which takes the ArgStructure as argument - __attachInterruptFunctionalArg (pin, (voidFuncPtrArg)interruptFunctional, new InterruptArgStructure{intRoutine}, mode, true); -} - -extern "C" -{ - void cleanupFunctional(void* arg) - { - delete (InterruptArgStructure*)arg; - } -} - - - - diff --git a/cores/esp32/FunctionalInterrupt.h b/cores/esp32/FunctionalInterrupt.h deleted file mode 100644 index b5e3181f986..00000000000 --- a/cores/esp32/FunctionalInterrupt.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * FunctionalInterrupt.h - * - * Created on: 8 jul. 2018 - * Author: Herman - */ - -#ifndef CORE_CORE_FUNCTIONALINTERRUPT_H_ -#define CORE_CORE_FUNCTIONALINTERRUPT_H_ - -#include - -struct InterruptArgStructure { - std::function interruptFunction; -}; - -void attachInterrupt(uint8_t pin, std::function intRoutine, int mode); - - -#endif /* CORE_CORE_FUNCTIONALINTERRUPT_H_ */ diff --git a/cores/esp32/HardwareSerial.cpp b/cores/esp32/HardwareSerial.cpp deleted file mode 100644 index 545c9b05562..00000000000 --- a/cores/esp32/HardwareSerial.cpp +++ /dev/null @@ -1,158 +0,0 @@ -#include -#include -#include -#include - -#include "pins_arduino.h" -#include "HardwareSerial.h" - -#ifndef RX1 -#define RX1 9 -#endif - -#ifndef TX1 -#define TX1 10 -#endif - -#ifndef RX2 -#define RX2 16 -#endif - -#ifndef TX2 -#define TX2 17 -#endif - -#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL) -HardwareSerial Serial(0); -HardwareSerial Serial1(1); -HardwareSerial Serial2(2); -#endif - -HardwareSerial::HardwareSerial(int uart_nr) : _uart_nr(uart_nr), _uart(NULL) {} - -void HardwareSerial::begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t txPin, bool invert, unsigned long timeout_ms) -{ - if(0 > _uart_nr || _uart_nr > 2) { - log_e("Serial number is invalid, please use 0, 1 or 2"); - return; - } - if(_uart) { - end(); - } - if(_uart_nr == 0 && rxPin < 0 && txPin < 0) { - rxPin = 3; - txPin = 1; - } - if(_uart_nr == 1 && rxPin < 0 && txPin < 0) { - rxPin = RX1; - txPin = TX1; - } - if(_uart_nr == 2 && rxPin < 0 && txPin < 0) { - rxPin = RX2; - txPin = TX2; - } - - _uart = uartBegin(_uart_nr, baud ? baud : 9600, config, rxPin, txPin, 256, invert); - - if(!baud) { - uartStartDetectBaudrate(_uart); - time_t startMillis = millis(); - unsigned long detectedBaudRate = 0; - while(millis() - startMillis < timeout_ms && !(detectedBaudRate = uartDetectBaudrate(_uart))) { - yield(); - } - - end(); - - if(detectedBaudRate) { - delay(100); // Give some time... - _uart = uartBegin(_uart_nr, detectedBaudRate, config, rxPin, txPin, 256, invert); - } else { - log_e("Could not detect baudrate. Serial data at the port must be present within the timeout for detection to be possible"); - _uart = NULL; - } - } -} - -void HardwareSerial::updateBaudRate(unsigned long baud) -{ - uartSetBaudRate(_uart, baud); -} - -void HardwareSerial::end() -{ - if(uartGetDebug() == _uart_nr) { - uartSetDebug(0); - } - uartEnd(_uart); - _uart = 0; -} - -size_t HardwareSerial::setRxBufferSize(size_t new_size) { - return uartResizeRxBuffer(_uart, new_size); -} - -void HardwareSerial::setDebugOutput(bool en) -{ - if(_uart == 0) { - return; - } - if(en) { - uartSetDebug(_uart); - } else { - if(uartGetDebug() == _uart_nr) { - uartSetDebug(0); - } - } -} - -int HardwareSerial::available(void) -{ - return uartAvailable(_uart); -} -int HardwareSerial::availableForWrite(void) -{ - return uartAvailableForWrite(_uart); -} - -int HardwareSerial::peek(void) -{ - if (available()) { - return uartPeek(_uart); - } - return -1; -} - -int HardwareSerial::read(void) -{ - if(available()) { - return uartRead(_uart); - } - return -1; -} - -void HardwareSerial::flush() -{ - uartFlush(_uart); -} - -size_t HardwareSerial::write(uint8_t c) -{ - uartWrite(_uart, c); - return 1; -} - -size_t HardwareSerial::write(const uint8_t *buffer, size_t size) -{ - uartWriteBuf(_uart, buffer, size); - return size; -} -uint32_t HardwareSerial::baudRate() - -{ - return uartGetBaudRate(_uart); -} -HardwareSerial::operator bool() const -{ - return true; -} diff --git a/cores/esp32/HardwareSerial.h b/cores/esp32/HardwareSerial.h deleted file mode 100644 index 89eacf85d0e..00000000000 --- a/cores/esp32/HardwareSerial.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - HardwareSerial.h - Hardware serial library for Wiring - Copyright (c) 2006 Nicholas Zambetti. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Modified 28 September 2010 by Mark Sproul - Modified 14 August 2012 by Alarus - Modified 3 December 2013 by Matthijs Kooijman - Modified 18 December 2014 by Ivan Grokhotkov (esp8266 platform support) - Modified 31 March 2015 by Markus Sattler (rewrite the code for UART0 + UART1 support in ESP8266) - Modified 25 April 2015 by Thomas Flayols (add configuration different from 8N1 in ESP8266) - Modified 13 October 2018 by Jeroen Döll (add baudrate detection) - Baudrate detection example usage (detection on Serial1): - void setup() { - Serial.begin(115200); - delay(100); - Serial.println(); - - Serial1.begin(0, SERIAL_8N1, -1, -1, true, 11000UL); // Passing 0 for baudrate to detect it, the last parameter is a timeout in ms - - unsigned long detectedBaudRate = Serial1.baudRate(); - if(detectedBaudRate) { - Serial.printf("Detected baudrate is %lu\n", detectedBaudRate); - } else { - Serial.println("No baudrate detected, Serial1 will not work!"); - } - } - - Pay attention: the baudrate returned by baudRate() may be rounded, eg 115200 returns 115201 - */ - -#ifndef HardwareSerial_h -#define HardwareSerial_h - -#include - -#include "Stream.h" -#include "esp32-hal.h" - -class HardwareSerial: public Stream -{ -public: - HardwareSerial(int uart_nr); - - void begin(unsigned long baud, uint32_t config=SERIAL_8N1, int8_t rxPin=-1, int8_t txPin=-1, bool invert=false, unsigned long timeout_ms = 20000UL); - void end(); - void updateBaudRate(unsigned long baud); - int available(void); - int availableForWrite(void); - int peek(void); - int read(void); - void flush(void); - size_t write(uint8_t); - size_t write(const uint8_t *buffer, size_t size); - - inline size_t write(const char * s) - { - return write((uint8_t*) s, strlen(s)); - } - inline size_t write(unsigned long n) - { - return write((uint8_t) n); - } - inline size_t write(long n) - { - return write((uint8_t) n); - } - inline size_t write(unsigned int n) - { - return write((uint8_t) n); - } - inline size_t write(int n) - { - return write((uint8_t) n); - } - uint32_t baudRate(); - operator bool() const; - - size_t setRxBufferSize(size_t); - void setDebugOutput(bool); - -protected: - int _uart_nr; - uart_t* _uart; -}; - -#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL) -extern HardwareSerial Serial; -extern HardwareSerial Serial1; -extern HardwareSerial Serial2; -#endif - -#endif diff --git a/cores/esp32/IPAddress.cpp b/cores/esp32/IPAddress.cpp deleted file mode 100644 index cabfdf32d26..00000000000 --- a/cores/esp32/IPAddress.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* - IPAddress.cpp - Base class that provides IPAddress - Copyright (c) 2011 Adrian McEwen. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include -#include -#include - -IPAddress::IPAddress() -{ - _address.dword = 0; -} - -IPAddress::IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet) -{ - _address.bytes[0] = first_octet; - _address.bytes[1] = second_octet; - _address.bytes[2] = third_octet; - _address.bytes[3] = fourth_octet; -} - -IPAddress::IPAddress(uint32_t address) -{ - _address.dword = address; -} - -IPAddress::IPAddress(const uint8_t *address) -{ - memcpy(_address.bytes, address, sizeof(_address.bytes)); -} - -IPAddress& IPAddress::operator=(const uint8_t *address) -{ - memcpy(_address.bytes, address, sizeof(_address.bytes)); - return *this; -} - -IPAddress& IPAddress::operator=(uint32_t address) -{ - _address.dword = address; - return *this; -} - -bool IPAddress::operator==(const uint8_t* addr) const -{ - return memcmp(addr, _address.bytes, sizeof(_address.bytes)) == 0; -} - -size_t IPAddress::printTo(Print& p) const -{ - size_t n = 0; - for(int i = 0; i < 3; i++) { - n += p.print(_address.bytes[i], DEC); - n += p.print('.'); - } - n += p.print(_address.bytes[3], DEC); - return n; -} - -String IPAddress::toString() const -{ - char szRet[16]; - sprintf(szRet,"%u.%u.%u.%u", _address.bytes[0], _address.bytes[1], _address.bytes[2], _address.bytes[3]); - return String(szRet); -} - -bool IPAddress::fromString(const char *address) -{ - // TODO: add support for "a", "a.b", "a.b.c" formats - - uint16_t acc = 0; // Accumulator - uint8_t dots = 0; - - while (*address) - { - char c = *address++; - if (c >= '0' && c <= '9') - { - acc = acc * 10 + (c - '0'); - if (acc > 255) { - // Value out of [0..255] range - return false; - } - } - else if (c == '.') - { - if (dots == 3) { - // Too much dots (there must be 3 dots) - return false; - } - _address.bytes[dots++] = acc; - acc = 0; - } - else - { - // Invalid char - return false; - } - } - - if (dots != 3) { - // Too few dots (there must be 3 dots) - return false; - } - _address.bytes[3] = acc; - return true; -} diff --git a/cores/esp32/IPAddress.h b/cores/esp32/IPAddress.h deleted file mode 100644 index aa1d10cee29..00000000000 --- a/cores/esp32/IPAddress.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - IPAddress.h - Base class that provides IPAddress - Copyright (c) 2011 Adrian McEwen. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef IPAddress_h -#define IPAddress_h - -#include -#include -#include - -// A class to make it easier to handle and pass around IP addresses - -class IPAddress: public Printable -{ -private: - union { - uint8_t bytes[4]; // IPv4 address - uint32_t dword; - } _address; - - // Access the raw byte array containing the address. Because this returns a pointer - // to the internal structure rather than a copy of the address this function should only - // be used when you know that the usage of the returned uint8_t* will be transient and not - // stored. - uint8_t* raw_address() - { - return _address.bytes; - } - -public: - // Constructors - IPAddress(); - IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet); - IPAddress(uint32_t address); - IPAddress(const uint8_t *address); - virtual ~IPAddress() {} - - bool fromString(const char *address); - bool fromString(const String &address) { return fromString(address.c_str()); } - - // Overloaded cast operator to allow IPAddress objects to be used where a pointer - // to a four-byte uint8_t array is expected - operator uint32_t() const - { - return _address.dword; - } - bool operator==(const IPAddress& addr) const - { - return _address.dword == addr._address.dword; - } - bool operator==(const uint8_t* addr) const; - - // Overloaded index operator to allow getting and setting individual octets of the address - uint8_t operator[](int index) const - { - return _address.bytes[index]; - } - uint8_t& operator[](int index) - { - return _address.bytes[index]; - } - - // Overloaded copy operators to allow initialisation of IPAddress objects from other types - IPAddress& operator=(const uint8_t *address); - IPAddress& operator=(uint32_t address); - - virtual size_t printTo(Print& p) const; - String toString() const; - - friend class EthernetClass; - friend class UDP; - friend class Client; - friend class Server; - friend class DhcpClass; - friend class DNSClient; -}; - -const IPAddress INADDR_NONE(0, 0, 0, 0); - -#endif diff --git a/cores/esp32/IPv6Address.cpp b/cores/esp32/IPv6Address.cpp deleted file mode 100644 index 7d3c0de5f53..00000000000 --- a/cores/esp32/IPv6Address.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - IPv6Address.cpp - Base class that provides IPv6Address - Copyright (c) 2011 Adrian McEwen. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include -#include -#include - -IPv6Address::IPv6Address() -{ - memset(_address.bytes, 0, sizeof(_address.bytes)); -} - -IPv6Address::IPv6Address(const uint8_t *address) -{ - memcpy(_address.bytes, address, sizeof(_address.bytes)); -} - -IPv6Address::IPv6Address(const uint32_t *address) -{ - memcpy(_address.bytes, (const uint8_t *)address, sizeof(_address.bytes)); -} - -IPv6Address& IPv6Address::operator=(const uint8_t *address) -{ - memcpy(_address.bytes, address, sizeof(_address.bytes)); - return *this; -} - -bool IPv6Address::operator==(const uint8_t* addr) const -{ - return memcmp(addr, _address.bytes, sizeof(_address.bytes)) == 0; -} - -size_t IPv6Address::printTo(Print& p) const -{ - size_t n = 0; - for(int i = 0; i < 16; i+=2) { - if(i){ - n += p.print(':'); - } - n += p.printf("%02x", _address.bytes[i]); - n += p.printf("%02x", _address.bytes[i+1]); - - } - return n; -} - -String IPv6Address::toString() const -{ - char szRet[40]; - sprintf(szRet,"%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x", - _address.bytes[0], _address.bytes[1], _address.bytes[2], _address.bytes[3], - _address.bytes[4], _address.bytes[5], _address.bytes[6], _address.bytes[7], - _address.bytes[8], _address.bytes[9], _address.bytes[10], _address.bytes[11], - _address.bytes[12], _address.bytes[13], _address.bytes[14], _address.bytes[15]); - return String(szRet); -} - -bool IPv6Address::fromString(const char *address) -{ - //format 0011:2233:4455:6677:8899:aabb:ccdd:eeff - if(strlen(address) != 39){ - return false; - } - char * pos = (char *)address; - size_t i = 0; - for(i = 0; i < 16; i+=2) { - if(!sscanf(pos, "%2hhx", &_address.bytes[i]) || !sscanf(pos+2, "%2hhx", &_address.bytes[i+1])){ - return false; - } - pos += 5; - } - return true; -} diff --git a/cores/esp32/IPv6Address.h b/cores/esp32/IPv6Address.h deleted file mode 100644 index e61d0e7b371..00000000000 --- a/cores/esp32/IPv6Address.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - IPv6Address.h - Base class that provides IPv6Address - Copyright (c) 2011 Adrian McEwen. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef IPv6Address_h -#define IPv6Address_h - -#include -#include -#include - -// A class to make it easier to handle and pass around IP addresses - -class IPv6Address: public Printable -{ -private: - union { - uint8_t bytes[16]; // IPv4 address - uint32_t dword[4]; - } _address; - - // Access the raw byte array containing the address. Because this returns a pointer - // to the internal structure rather than a copy of the address this function should only - // be used when you know that the usage of the returned uint8_t* will be transient and not - // stored. - uint8_t* raw_address() - { - return _address.bytes; - } - -public: - // Constructors - IPv6Address(); - IPv6Address(const uint8_t *address); - IPv6Address(const uint32_t *address); - virtual ~IPv6Address() {} - - bool fromString(const char *address); - bool fromString(const String &address) { return fromString(address.c_str()); } - - operator const uint8_t*() const - { - return _address.bytes; - } - operator const uint32_t*() const - { - return _address.dword; - } - bool operator==(const IPv6Address& addr) const - { - return (_address.dword[0] == addr._address.dword[0]) - && (_address.dword[1] == addr._address.dword[1]) - && (_address.dword[2] == addr._address.dword[2]) - && (_address.dword[3] == addr._address.dword[3]); - } - bool operator==(const uint8_t* addr) const; - - // Overloaded index operator to allow getting and setting individual octets of the address - uint8_t operator[](int index) const - { - return _address.bytes[index]; - } - uint8_t& operator[](int index) - { - return _address.bytes[index]; - } - - // Overloaded copy operators to allow initialisation of IPv6Address objects from other types - IPv6Address& operator=(const uint8_t *address); - - virtual size_t printTo(Print& p) const; - String toString() const; - - friend class UDP; - friend class Client; - friend class Server; -}; - -#endif diff --git a/cores/esp32/MD5Builder.cpp b/cores/esp32/MD5Builder.cpp deleted file mode 100644 index f2168f4e6c4..00000000000 --- a/cores/esp32/MD5Builder.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* - Copyright (c) 2015 Hristo Gochkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#include -#include - -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)) : - (c >= '0' && c<= '9') ? (c - (uint8_t)'0') : 0; -} - -void MD5Builder::begin(void) -{ - memset(_buf, 0x00, 16); - MD5Init(&_ctx); -} - -void MD5Builder::add(uint8_t * data, uint16_t len) -{ - MD5Update(&_ctx, data, len); -} - -void MD5Builder::addHexString(const char * data) -{ - uint16_t i, len = strlen(data); - uint8_t * tmp = (uint8_t*)malloc(len/2); - if(tmp == NULL) { - return; - } - for(i=0; i 0) && (maxLengthLeft > 0)) { - - // determine number of bytes to read - int readBytes = bytesAvailable; - if(readBytes > maxLengthLeft) { - readBytes = maxLengthLeft ; // read only until max_len - } - if(readBytes > buf_size) { - readBytes = buf_size; // not read more the buffer can handle - } - - // read data and check if we got something - int numBytesRead = stream.readBytes(buf, readBytes); - if(numBytesRead< 1) { - return false; - } - - // Update MD5 with buffer payload - MD5Update(&_ctx, buf, numBytesRead); - - // update available number of bytes - maxLengthLeft -= numBytesRead; - bytesAvailable = stream.available(); - } - free(buf); - return true; -} - -void MD5Builder::calculate(void) -{ - MD5Final(_buf, &_ctx); -} - -void MD5Builder::getBytes(uint8_t * output) -{ - memcpy(output, _buf, 16); -} - -void MD5Builder::getChars(char * output) -{ - for(uint8_t i = 0; i < 16; i++) { - sprintf(output + (i * 2), "%02x", _buf[i]); - } -} - -String MD5Builder::toString(void) -{ - char out[33]; - getChars(out); - return String(out); -} diff --git a/cores/esp32/MD5Builder.h b/cores/esp32/MD5Builder.h deleted file mode 100644 index 5429d9aea60..00000000000 --- a/cores/esp32/MD5Builder.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright (c) 2015 Hristo Gochkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#ifndef __ESP8266_MD5_BUILDER__ -#define __ESP8266_MD5_BUILDER__ - -#include -#include -#include "rom/md5_hash.h" - -class MD5Builder -{ -private: - struct MD5Context _ctx; - uint8_t _buf[16]; -public: - void begin(void); - void add(uint8_t * data, uint16_t len); - void add(const char * data) - { - add((uint8_t*)data, strlen(data)); - } - void add(char * data) - { - add((const char*)data); - } - void add(String data) - { - add(data.c_str()); - } - void addHexString(const char * data); - void addHexString(char * data) - { - addHexString((const char*)data); - } - void addHexString(String data) - { - addHexString(data.c_str()); - } - bool addStream(Stream & stream, const size_t maxLen); - void calculate(void); - void getBytes(uint8_t * output); - void getChars(char * output); - String toString(void); -}; - - -#endif diff --git a/cores/esp32/Print.cpp b/cores/esp32/Print.cpp deleted file mode 100644 index 60964703306..00000000000 --- a/cores/esp32/Print.cpp +++ /dev/null @@ -1,324 +0,0 @@ -/* - Print.cpp - Base class that provides print() and println() - Copyright (c) 2008 David A. Mellis. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Modified 23 November 2006 by David A. Mellis - Modified December 2014 by Ivan Grokhotkov - Modified May 2015 by Michael C. Miller - ESP31B progmem support - */ - -#include -#include -#include -#include -#include "Arduino.h" - -#include "Print.h" -extern "C" { - #include "time.h" -} - -// Public Methods ////////////////////////////////////////////////////////////// - -/* default implementation: may be overridden */ -size_t Print::write(const uint8_t *buffer, size_t size) -{ - size_t n = 0; - while(size--) { - n += write(*buffer++); - } - return n; -} - -size_t Print::printf(const char *format, ...) -{ - char loc_buf[64]; - char * temp = loc_buf; - va_list arg; - va_list copy; - va_start(arg, format); - va_copy(copy, arg); - int len = vsnprintf(temp, sizeof(loc_buf), format, copy); - va_end(copy); - if(len < 0) { - va_end(arg); - return 0; - }; - if(len >= sizeof(loc_buf)){ - temp = (char*) malloc(len+1); - if(temp == NULL) { - va_end(arg); - return 0; - } - len = vsnprintf(temp, len+1, format, arg); - } - va_end(arg); - len = write((uint8_t*)temp, len); - if(temp != loc_buf){ - free(temp); - } - return len; -} - -size_t Print::print(const __FlashStringHelper *ifsh) -{ - return print(reinterpret_cast(ifsh)); -} - -size_t Print::print(const String &s) -{ - return write(s.c_str(), s.length()); -} - -size_t Print::print(const char str[]) -{ - return write(str); -} - -size_t Print::print(char c) -{ - return write(c); -} - -size_t Print::print(unsigned char b, int base) -{ - return print((unsigned long) b, base); -} - -size_t Print::print(int n, int base) -{ - return print((long) n, base); -} - -size_t Print::print(unsigned int n, int base) -{ - return print((unsigned long) n, base); -} - -size_t Print::print(long n, int base) -{ - if(base == 0) { - return write(n); - } else if(base == 10) { - if(n < 0) { - int t = print('-'); - n = -n; - return printNumber(n, 10) + t; - } - return printNumber(n, 10); - } else { - return printNumber(n, base); - } -} - -size_t Print::print(unsigned long n, int base) -{ - if(base == 0) { - return write(n); - } else { - return printNumber(n, base); - } -} - -size_t Print::print(double n, int digits) -{ - return printFloat(n, digits); -} - -size_t Print::println(const __FlashStringHelper *ifsh) -{ - size_t n = print(ifsh); - n += println(); - return n; -} - -size_t Print::print(const Printable& x) -{ - return x.printTo(*this); -} - -size_t Print::print(struct tm * timeinfo, const char * format) -{ - const char * f = format; - if(!f){ - f = "%c"; - } - char buf[64]; - size_t written = strftime(buf, 64, f, timeinfo); - if(written == 0){ - return written; - } - return print(buf); -} - -size_t Print::println(void) -{ - return print("\r\n"); -} - -size_t Print::println(const String &s) -{ - size_t n = print(s); - n += println(); - return n; -} - -size_t Print::println(const char c[]) -{ - size_t n = print(c); - n += println(); - return n; -} - -size_t Print::println(char c) -{ - size_t n = print(c); - n += println(); - return n; -} - -size_t Print::println(unsigned char b, int base) -{ - size_t n = print(b, base); - n += println(); - return n; -} - -size_t Print::println(int num, int base) -{ - size_t n = print(num, base); - n += println(); - return n; -} - -size_t Print::println(unsigned int num, int base) -{ - size_t n = print(num, base); - n += println(); - return n; -} - -size_t Print::println(long num, int base) -{ - size_t n = print(num, base); - n += println(); - return n; -} - -size_t Print::println(unsigned long num, int base) -{ - size_t n = print(num, base); - n += println(); - return n; -} - -size_t Print::println(double num, int digits) -{ - size_t n = print(num, digits); - n += println(); - return n; -} - -size_t Print::println(const Printable& x) -{ - size_t n = print(x); - n += println(); - return n; -} - -size_t Print::println(struct tm * timeinfo, const char * format) -{ - size_t n = print(timeinfo, format); - n += println(); - return n; -} - -// Private Methods ///////////////////////////////////////////////////////////// - -size_t Print::printNumber(unsigned long n, uint8_t base) -{ - char buf[8 * sizeof(long) + 1]; // Assumes 8-bit chars plus zero byte. - char *str = &buf[sizeof(buf) - 1]; - - *str = '\0'; - - // prevent crash if called with base == 1 - if(base < 2) { - base = 10; - } - - do { - unsigned long m = n; - n /= base; - char c = m - base * n; - *--str = c < 10 ? c + '0' : c + 'A' - 10; - } while(n); - - return write(str); -} - -size_t Print::printFloat(double number, uint8_t digits) -{ - size_t n = 0; - - if(isnan(number)) { - return print("nan"); - } - if(isinf(number)) { - return print("inf"); - } - if(number > 4294967040.0) { - return print("ovf"); // constant determined empirically - } - if(number < -4294967040.0) { - return print("ovf"); // constant determined empirically - } - - // Handle negative numbers - if(number < 0.0) { - n += print('-'); - number = -number; - } - - // Round correctly so that print(1.999, 2) prints as "2.00" - double rounding = 0.5; - for(uint8_t i = 0; i < digits; ++i) { - rounding /= 10.0; - } - - number += rounding; - - // Extract the integer part of the number and print it - unsigned long int_part = (unsigned long) number; - double remainder = number - (double) int_part; - n += print(int_part); - - // Print the decimal point, but only if there are digits beyond - if(digits > 0) { - n += print("."); - } - - // Extract digits from the remainder one at a time - while(digits-- > 0) { - remainder *= 10.0; - int toPrint = int(remainder); - n += print(toPrint); - remainder -= toPrint; - } - - return n; -} diff --git a/cores/esp32/Print.h b/cores/esp32/Print.h deleted file mode 100644 index eb2958584d9..00000000000 --- a/cores/esp32/Print.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - Print.h - Base class that provides print() and println() - Copyright (c) 2008 David A. Mellis. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef Print_h -#define Print_h - -#include -#include - -#include "WString.h" -#include "Printable.h" - -#define DEC 10 -#define HEX 16 -#define OCT 8 -#define BIN 2 - -class Print -{ -private: - int write_error; - size_t printNumber(unsigned long, uint8_t); - size_t printFloat(double, uint8_t); -protected: - void setWriteError(int err = 1) - { - write_error = err; - } -public: - Print() : - write_error(0) - { - } - virtual ~Print() {} - int getWriteError() - { - return write_error; - } - void clearWriteError() - { - setWriteError(0); - } - - virtual size_t write(uint8_t) = 0; - size_t write(const char *str) - { - if(str == NULL) { - return 0; - } - return write((const uint8_t *) str, strlen(str)); - } - virtual size_t write(const uint8_t *buffer, size_t size); - size_t write(const char *buffer, size_t size) - { - return write((const uint8_t *) buffer, size); - } - - size_t printf(const char * format, ...) __attribute__ ((format (printf, 2, 3))); - size_t print(const __FlashStringHelper *); - size_t print(const String &); - size_t print(const char[]); - size_t print(char); - size_t print(unsigned char, int = DEC); - size_t print(int, int = DEC); - size_t print(unsigned int, int = DEC); - size_t print(long, int = DEC); - size_t print(unsigned long, int = DEC); - size_t print(double, int = 2); - size_t print(const Printable&); - size_t print(struct tm * timeinfo, const char * format = NULL); - - size_t println(const __FlashStringHelper *); - size_t println(const String &s); - size_t println(const char[]); - size_t println(char); - size_t println(unsigned char, int = DEC); - size_t println(int, int = DEC); - size_t println(unsigned int, int = DEC); - size_t println(long, int = DEC); - size_t println(unsigned long, int = DEC); - size_t println(double, int = 2); - size_t println(const Printable&); - size_t println(struct tm * timeinfo, const char * format = NULL); - size_t println(void); -}; - -#endif diff --git a/cores/esp32/Printable.h b/cores/esp32/Printable.h deleted file mode 100644 index aa4e62f8f11..00000000000 --- a/cores/esp32/Printable.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - Printable.h - Interface class that allows printing of complex types - Copyright (c) 2011 Adrian McEwen. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef Printable_h -#define Printable_h - -#include - -class Print; - -/** The Printable class provides a way for new classes to allow themselves to be printed. - By deriving from Printable and implementing the printTo method, it will then be possible - for users to print out instances of this class by passing them into the usual - Print::print and Print::println methods. - */ - -class Printable -{ -public: - virtual ~Printable() {} - virtual size_t printTo(Print& p) const = 0; -}; - -#endif - diff --git a/cores/esp32/Server.h b/cores/esp32/Server.h deleted file mode 100644 index 6a940a0b5fa..00000000000 --- a/cores/esp32/Server.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - Server.h - Base class that provides Server - Copyright (c) 2011 Adrian McEwen. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef server_h -#define server_h - -#include "Print.h" - -class Server: public Print -{ -public: - virtual void begin(uint16_t port=0) =0; -}; - -#endif diff --git a/cores/esp32/Stream.cpp b/cores/esp32/Stream.cpp deleted file mode 100644 index 5c090791968..00000000000 --- a/cores/esp32/Stream.cpp +++ /dev/null @@ -1,294 +0,0 @@ -/* - Stream.cpp - adds parsing methods to Stream class - Copyright (c) 2008 David A. Mellis. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Created July 2011 - parsing functions based on TextFinder library by Michael Margolis - */ - -#include "Arduino.h" -#include "Stream.h" -#include "esp32-hal.h" - -#define PARSE_TIMEOUT 1000 // default number of milli-seconds to wait -#define NO_SKIP_CHAR 1 // a magic char not found in a valid ASCII numeric field - -// private method to read stream with timeout -int Stream::timedRead() -{ - int c; - _startMillis = millis(); - do { - c = read(); - if(c >= 0) { - return c; - } - } while(millis() - _startMillis < _timeout); - return -1; // -1 indicates timeout -} - -// private method to peek stream with timeout -int Stream::timedPeek() -{ - int c; - _startMillis = millis(); - do { - c = peek(); - if(c >= 0) { - return c; - } - } while(millis() - _startMillis < _timeout); - return -1; // -1 indicates timeout -} - -// returns peek of the next digit in the stream or -1 if timeout -// discards non-numeric characters -int Stream::peekNextDigit() -{ - int c; - while(1) { - c = timedPeek(); - if(c < 0) { - return c; // timeout - } - if(c == '-') { - return c; - } - if(c >= '0' && c <= '9') { - return c; - } - read(); // discard non-numeric - } -} - -// Public Methods -////////////////////////////////////////////////////////////// - -void Stream::setTimeout(unsigned long timeout) // sets the maximum number of milliseconds to wait -{ - _timeout = timeout; -} -unsigned long Stream::getTimeout(void) { - return _timeout; -} - -// find returns true if the target string is found -bool Stream::find(const char *target) -{ - return findUntil(target, (char*) ""); -} - -// reads data from the stream until the target string of given length is found -// returns true if target string is found, false if timed out -bool Stream::find(const char *target, size_t length) -{ - return findUntil(target, length, NULL, 0); -} - -// as find but search ends if the terminator string is found -bool Stream::findUntil(const char *target, const char *terminator) -{ - return findUntil(target, strlen(target), terminator, strlen(terminator)); -} - -// reads data from the stream until the target string of the given length is found -// search terminated if the terminator string is found -// returns true if target string is found, false if terminated or timed out -bool Stream::findUntil(const char *target, size_t targetLen, const char *terminator, size_t termLen) -{ - size_t index = 0; // maximum target string length is 64k bytes! - size_t termIndex = 0; - int c; - - if(*target == 0) { - return true; // return true if target is a null string - } - while((c = timedRead()) > 0) { - - if(c != target[index]) { - index = 0; // reset index if any char does not match - } - - if(c == target[index]) { - //////Serial.print("found "); Serial.write(c); Serial.print("index now"); Serial.println(index+1); - if(++index >= targetLen) { // return true if all chars in the target match - return true; - } - } - - if(termLen > 0 && c == terminator[termIndex]) { - if(++termIndex >= termLen) { - return false; // return false if terminate string found before target string - } - } else { - termIndex = 0; - } - } - return false; -} - -// returns the first valid (long) integer value from the current position. -// initial characters that are not digits (or the minus sign) are skipped -// function is terminated by the first character that is not a digit. -long Stream::parseInt() -{ - return parseInt(NO_SKIP_CHAR); // terminate on first non-digit character (or timeout) -} - -// as above but a given skipChar is ignored -// this allows format characters (typically commas) in values to be ignored -long Stream::parseInt(char skipChar) -{ - boolean isNegative = false; - long value = 0; - int c; - - c = peekNextDigit(); - // ignore non numeric leading characters - if(c < 0) { - return 0; // zero returned if timeout - } - - do { - if(c == skipChar) { - } // ignore this charactor - else if(c == '-') { - isNegative = true; - } else if(c >= '0' && c <= '9') { // is c a digit? - value = value * 10 + c - '0'; - } - read(); // consume the character we got with peek - c = timedPeek(); - } while((c >= '0' && c <= '9') || c == skipChar); - - if(isNegative) { - value = -value; - } - return value; -} - -// as parseInt but returns a floating point value -float Stream::parseFloat() -{ - return parseFloat(NO_SKIP_CHAR); -} - -// as above but the given skipChar is ignored -// this allows format characters (typically commas) in values to be ignored -float Stream::parseFloat(char skipChar) -{ - boolean isNegative = false; - boolean isFraction = false; - long value = 0; - int c; - float fraction = 1.0; - - c = peekNextDigit(); - // ignore non numeric leading characters - if(c < 0) { - return 0; // zero returned if timeout - } - - do { - if(c == skipChar) { - } // ignore - else if(c == '-') { - isNegative = true; - } else if(c == '.') { - isFraction = true; - } else if(c >= '0' && c <= '9') { // is c a digit? - value = value * 10 + c - '0'; - if(isFraction) { - fraction *= 0.1; - } - } - read(); // consume the character we got with peek - c = timedPeek(); - } while((c >= '0' && c <= '9') || c == '.' || c == skipChar); - - if(isNegative) { - value = -value; - } - if(isFraction) { - return value * fraction; - } else { - return value; - } -} - -// read characters from stream into buffer -// terminates if length characters have been read, or timeout (see setTimeout) -// returns the number of characters placed in the buffer -// the buffer is NOT null terminated. -// -size_t Stream::readBytes(char *buffer, size_t length) -{ - size_t count = 0; - while(count < length) { - int c = timedRead(); - if(c < 0) { - break; - } - *buffer++ = (char) c; - count++; - } - return count; -} - -// as readBytes with terminator character -// terminates if length characters have been read, timeout, or if the terminator character detected -// returns the number of characters placed in the buffer (0 means no valid data found) - -size_t Stream::readBytesUntil(char terminator, char *buffer, size_t length) -{ - if(length < 1) { - return 0; - } - size_t index = 0; - while(index < length) { - int c = timedRead(); - if(c < 0 || c == terminator) { - break; - } - *buffer++ = (char) c; - index++; - } - return index; // return number of characters, not including null terminator -} - -String Stream::readString() -{ - String ret; - int c = timedRead(); - while(c >= 0) { - ret += (char) c; - c = timedRead(); - } - return ret; -} - -String Stream::readStringUntil(char terminator) -{ - String ret; - int c = timedRead(); - while(c >= 0 && c != terminator) { - ret += (char) c; - c = timedRead(); - } - return ret; -} - diff --git a/cores/esp32/Stream.h b/cores/esp32/Stream.h deleted file mode 100644 index 4ce31955acd..00000000000 --- a/cores/esp32/Stream.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - Stream.h - base class for character-based streams. - Copyright (c) 2010 David A. Mellis. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - parsing functions based on TextFinder library by Michael Margolis - */ - -#ifndef Stream_h -#define Stream_h - -#include -#include "Print.h" - -// compatability macros for testing -/* - #define getInt() parseInt() - #define getInt(skipChar) parseInt(skipchar) - #define getFloat() parseFloat() - #define getFloat(skipChar) parseFloat(skipChar) - #define getString( pre_string, post_string, buffer, length) - readBytesBetween( pre_string, terminator, buffer, length) - */ - -class Stream: public Print -{ -protected: - unsigned long _timeout; // number of milliseconds to wait for the next char before aborting timed read - unsigned long _startMillis; // used for timeout measurement - int timedRead(); // private method to read stream with timeout - int timedPeek(); // private method to peek stream with timeout - int peekNextDigit(); // returns the next numeric digit in the stream or -1 if timeout - -public: - virtual int available() = 0; - virtual int read() = 0; - virtual int peek() = 0; - virtual void flush() = 0; - - Stream():_startMillis(0) - { - _timeout = 1000; - } - virtual ~Stream() {} - -// parsing methods - - void setTimeout(unsigned long timeout); // sets maximum milliseconds to wait for stream data, default is 1 second - unsigned long getTimeout(void); - bool find(const char *target); // reads data from the stream until the target string is found - bool find(uint8_t *target) - { - return find((char *) target); - } - // returns true if target string is found, false if timed out (see setTimeout) - - bool find(const char *target, size_t length); // reads data from the stream until the target string of given length is found - bool find(const uint8_t *target, size_t length) - { - return find((char *) target, length); - } - // returns true if target string is found, false if timed out - - bool find(char target) - { - return find (&target, 1); - } - - bool findUntil(const char *target, const char *terminator); // as find but search ends if the terminator string is found - bool findUntil(const uint8_t *target, const char *terminator) - { - return findUntil((char *) target, terminator); - } - - bool findUntil(const char *target, size_t targetLen, const char *terminate, size_t termLen); // as above but search ends if the terminate string is found - bool findUntil(const uint8_t *target, size_t targetLen, const char *terminate, size_t termLen) - { - return findUntil((char *) target, targetLen, terminate, termLen); - } - - long parseInt(); // returns the first valid (long) integer value from the current position. - // initial characters that are not digits (or the minus sign) are skipped - // integer is terminated by the first character that is not a digit. - - float parseFloat(); // float version of parseInt - - virtual size_t readBytes(char *buffer, size_t length); // read chars from stream into buffer - virtual size_t readBytes(uint8_t *buffer, size_t length) - { - return readBytes((char *) buffer, length); - } - // terminates if length characters have been read or timeout (see setTimeout) - // returns the number of characters placed in the buffer (0 means no valid data found) - - size_t readBytesUntil(char terminator, char *buffer, size_t length); // as readBytes with terminator character - size_t readBytesUntil(char terminator, uint8_t *buffer, size_t length) - { - return readBytesUntil(terminator, (char *) buffer, length); - } - // terminates if length characters have been read, timeout, or if the terminator character detected - // returns the number of characters placed in the buffer (0 means no valid data found) - - // Arduino String functions to be added here - virtual String readString(); - String readStringUntil(char terminator); - -protected: - long parseInt(char skipChar); // as above but the given skipChar is ignored - // as above but the given skipChar is ignored - // this allows format characters (typically commas) in values to be ignored - - float parseFloat(char skipChar); // as above but the given skipChar is ignored -}; - -#endif diff --git a/cores/esp32/StreamString.cpp b/cores/esp32/StreamString.cpp deleted file mode 100644 index f50b6825b55..00000000000 --- a/cores/esp32/StreamString.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/** - StreamString.cpp - - Copyright (c) 2015 Markus Sattler. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - */ - -#include -#include "StreamString.h" - -size_t StreamString::write(const uint8_t *data, size_t size) { - if(size && data) { - const unsigned int newlen = length() + size; - if(reserve(newlen + 1)) { - memcpy((void *) (wbuffer() + len()), (const void *) data, size); - setLen(newlen); - *(wbuffer() + newlen) = 0x00; // add null for string end - return size; - } - } - return 0; -} - -size_t StreamString::write(uint8_t data) { - return concat((char) data); -} - -int StreamString::available() { - return length(); -} - -int StreamString::read() { - if(length()) { - char c = charAt(0); - remove(0, 1); - return c; - - } - return -1; -} - -int StreamString::peek() { - if(length()) { - char c = charAt(0); - return c; - } - return -1; -} - -void StreamString::flush() { -} - diff --git a/cores/esp32/StreamString.h b/cores/esp32/StreamString.h deleted file mode 100644 index dbdf3fb0097..00000000000 --- a/cores/esp32/StreamString.h +++ /dev/null @@ -1,39 +0,0 @@ -/** - StreamString.h - - Copyright (c) 2015 Markus Sattler. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -*/ - -#ifndef STREAMSTRING_H_ -#define STREAMSTRING_H_ - - -class StreamString: public Stream, public String -{ -public: - size_t write(const uint8_t *buffer, size_t size) override; - size_t write(uint8_t data) override; - - int available() override; - int read() override; - int peek() override; - void flush() override; -}; - - -#endif /* STREAMSTRING_H_ */ diff --git a/cores/esp32/Udp.h b/cores/esp32/Udp.h deleted file mode 100644 index f47f83cc8e0..00000000000 --- a/cores/esp32/Udp.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Udp.cpp: Library to send/receive UDP packets. - * - * NOTE: UDP is fast, but has some important limitations (thanks to Warren Gray for mentioning these) - * 1) UDP does not guarantee the order in which assembled UDP packets are received. This - * might not happen often in practice, but in larger network topologies, a UDP - * packet can be received out of sequence. - * 2) UDP does not guard against lost packets - so packets *can* disappear without the sender being - * aware of it. Again, this may not be a concern in practice on small local networks. - * For more information, see http://www.cafeaulait.org/course/week12/35.html - * - * MIT License: - * Copyright (c) 2008 Bjoern Hartmann - * 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. - * - * bjoern@cs.stanford.edu 12/30/2008 - */ - -#ifndef udp_h -#define udp_h - -#include -#include - -class UDP: public Stream -{ - -public: - virtual uint8_t begin(uint16_t) =0; // initialize, start listening on specified port. Returns 1 if successful, 0 if there are no sockets available to use - virtual void stop() =0; // Finish with the UDP socket - - // Sending UDP packets - - // Start building up a packet to send to the remote host specific in ip and port - // Returns 1 if successful, 0 if there was a problem with the supplied IP address or port - virtual int beginPacket(IPAddress ip, uint16_t port) =0; - // Start building up a packet to send to the remote host specific in host and port - // Returns 1 if successful, 0 if there was a problem resolving the hostname or port - virtual int beginPacket(const char *host, uint16_t port) =0; - // Finish off this packet and send it - // Returns 1 if the packet was sent successfully, 0 if there was an error - virtual int endPacket() =0; - // Write a single byte into the packet - virtual size_t write(uint8_t) =0; - // Write size bytes from buffer into the packet - virtual size_t write(const uint8_t *buffer, size_t size) =0; - - // Start processing the next available incoming packet - // Returns the size of the packet in bytes, or 0 if no packets are available - virtual int parsePacket() =0; - // Number of bytes remaining in the current packet - virtual int available() =0; - // Read a single byte from the current packet - virtual int read() =0; - // Read up to len bytes from the current packet and place them into buffer - // Returns the number of bytes read, or 0 if none are available - virtual int read(unsigned char* buffer, size_t len) =0; - // Read up to len characters from the current packet and place them into buffer - // Returns the number of characters read, or 0 if none are available - virtual int read(char* buffer, size_t len) =0; - // Return the next byte from the current packet without moving on to the next byte - virtual int peek() =0; - virtual void flush() =0; // Finish reading the current packet - - // Return the IP address of the host who sent the current incoming packet - virtual IPAddress remoteIP() =0; - // Return the port of the host who sent the current incoming packet - virtual uint16_t remotePort() =0; -protected: - uint8_t* rawIPAddress(IPAddress& addr) - { - return addr.raw_address(); - } -}; - -#endif diff --git a/cores/esp32/WCharacter.h b/cores/esp32/WCharacter.h deleted file mode 100644 index 53428873421..00000000000 --- a/cores/esp32/WCharacter.h +++ /dev/null @@ -1,154 +0,0 @@ -/* - WCharacter.h - Character utility functions for Wiring & Arduino - Copyright (c) 2010 Hernando Barragan. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef Character_h -#define Character_h - -#include -#define isascii(__c) ((unsigned)(__c)<=0177) -#define toascii(__c) ((__c)&0177) - -// WCharacter.h prototypes -inline boolean isAlphaNumeric(int c) __attribute__((always_inline)); -inline boolean isAlpha(int c) __attribute__((always_inline)); -inline boolean isAscii(int c) __attribute__((always_inline)); -inline boolean isWhitespace(int c) __attribute__((always_inline)); -inline boolean isControl(int c) __attribute__((always_inline)); -inline boolean isDigit(int c) __attribute__((always_inline)); -inline boolean isGraph(int c) __attribute__((always_inline)); -inline boolean isLowerCase(int c) __attribute__((always_inline)); -inline boolean isPrintable(int c) __attribute__((always_inline)); -inline boolean isPunct(int c) __attribute__((always_inline)); -inline boolean isSpace(int c) __attribute__((always_inline)); -inline boolean isUpperCase(int c) __attribute__((always_inline)); -inline boolean isHexadecimalDigit(int c) __attribute__((always_inline)); -inline int toAscii(int c) __attribute__((always_inline)); -inline int toLowerCase(int c) __attribute__((always_inline)); -inline int toUpperCase(int c) __attribute__((always_inline)); - -// Checks for an alphanumeric character. -// It is equivalent to (isalpha(c) || isdigit(c)). -inline boolean isAlphaNumeric(int c) -{ - return (isalnum(c) == 0 ? false : true); -} - -// Checks for an alphabetic character. -// It is equivalent to (isupper(c) || islower(c)). -inline boolean isAlpha(int c) -{ - return (isalpha(c) == 0 ? false : true); -} - -// Checks whether c is a 7-bit unsigned char value -// that fits into the ASCII character set. -inline boolean isAscii(int c) -{ - return ( isascii (c) == 0 ? false : true); -} - -// Checks for a blank character, that is, a space or a tab. -inline boolean isWhitespace(int c) -{ - return (isblank(c) == 0 ? false : true); -} - -// Checks for a control character. -inline boolean isControl(int c) -{ - return (iscntrl(c) == 0 ? false : true); -} - -// Checks for a digit (0 through 9). -inline boolean isDigit(int c) -{ - return (isdigit(c) == 0 ? false : true); -} - -// Checks for any printable character except space. -inline boolean isGraph(int c) -{ - return (isgraph(c) == 0 ? false : true); -} - -// Checks for a lower-case character. -inline boolean isLowerCase(int c) -{ - return (islower(c) == 0 ? false : true); -} - -// Checks for any printable character including space. -inline boolean isPrintable(int c) -{ - return (isprint(c) == 0 ? false : true); -} - -// Checks for any printable character which is not a space -// or an alphanumeric character. -inline boolean isPunct(int c) -{ - return (ispunct(c) == 0 ? false : true); -} - -// Checks for white-space characters. For the avr-libc library, -// these are: space, formfeed ('\f'), newline ('\n'), carriage -// return ('\r'), horizontal tab ('\t'), and vertical tab ('\v'). -inline boolean isSpace(int c) -{ - return (isspace(c) == 0 ? false : true); -} - -// Checks for an uppercase letter. -inline boolean isUpperCase(int c) -{ - return (isupper(c) == 0 ? false : true); -} - -// Checks for a hexadecimal digits, i.e. one of 0 1 2 3 4 5 6 7 -// 8 9 a b c d e f A B C D E F. -inline boolean isHexadecimalDigit(int c) -{ - return (isxdigit(c) == 0 ? false : true); -} - -// Converts c to a 7-bit unsigned char value that fits into the -// ASCII character set, by clearing the high-order bits. -inline int toAscii(int c) -{ - return toascii(c); -} - -// Warning: -// Many people will be unhappy if you use this function. -// This function will convert accented letters into random -// characters. - -// Converts the letter c to lower case, if possible. -inline int toLowerCase(int c) -{ - return tolower(c); -} - -// Converts the letter c to upper case, if possible. -inline int toUpperCase(int c) -{ - return toupper(c); -} - -#endif diff --git a/cores/esp32/WMath.cpp b/cores/esp32/WMath.cpp deleted file mode 100644 index abec110b04c..00000000000 --- a/cores/esp32/WMath.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Wiring project - http://wiring.org.co - Copyright (c) 2004-06 Hernando Barragan - Modified 13 August 2006, David A. Mellis for Arduino - http://www.arduino.cc/ - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA - - $Id$ - */ - -extern "C" { -#include -#include "esp_system.h" -} - -void randomSeed(unsigned long seed) -{ - if(seed != 0) { - srand(seed); - } -} - -long random(long howbig) -{ - uint32_t x = esp_random(); - uint64_t m = uint64_t(x) * uint64_t(howbig); - uint32_t l = uint32_t(m); - if (l < howbig) { - uint32_t t = -howbig; - if (t >= howbig) { - t -= howbig; - if (t >= howbig) - t %= howbig; - } - while (l < t) { - x = esp_random(); - m = uint64_t(x) * uint64_t(howbig); - l = uint32_t(m); - } - } - return m >> 32; -} - -long random(long howsmall, long howbig) -{ - if(howsmall >= howbig) { - return howsmall; - } - long diff = howbig - howsmall; - return random(diff) + howsmall; -} - -long map(long x, long in_min, long in_max, long out_min, long out_max) { - long divisor = (in_max - in_min); - if(divisor == 0){ - return -1; //AVR returns -1, SAM returns 0 - } - return (x - in_min) * (out_max - out_min) / divisor + out_min; -} - -unsigned int makeWord(unsigned int w) -{ - return w; -} - -unsigned int makeWord(unsigned char h, unsigned char l) -{ - return (h << 8) | l; -} diff --git a/cores/esp32/WString.cpp b/cores/esp32/WString.cpp deleted file mode 100644 index aee4b1c94bd..00000000000 --- a/cores/esp32/WString.cpp +++ /dev/null @@ -1,861 +0,0 @@ -/* - WString.cpp - String library for Wiring & Arduino - ...mostly rewritten by Paul Stoffregen... - Copyright (c) 2009-10 Hernando Barragan. All rights reserved. - Copyright 2011, Paul Stoffregen, paul@pjrc.com - Modified by Ivan Grokhotkov, 2014 - esp8266 support - Modified by Michael C. Miller, 2015 - esp8266 progmem support - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include -#include "WString.h" -#include "stdlib_noniso.h" - -/*********************************************/ -/* Constructors */ -/*********************************************/ - -String::String(const char *cstr) { - init(); - if (cstr) - copy(cstr, strlen(cstr)); -} - -String::String(const String &value) { - init(); - *this = value; -} - -String::String(const __FlashStringHelper *pstr) { - init(); - *this = pstr; // see operator = -} - -#ifdef __GXX_EXPERIMENTAL_CXX0X__ -String::String(String &&rval) { - init(); - move(rval); -} - -String::String(StringSumHelper &&rval) { - init(); - move(rval); -} -#endif - -String::String(char c) { - init(); - char buf[2]; - buf[0] = c; - buf[1] = 0; - *this = buf; -} - -String::String(unsigned char value, unsigned char base) { - init(); - char buf[1 + 8 * sizeof(unsigned char)]; - utoa(value, buf, base); - *this = buf; -} - -String::String(int value, unsigned char base) { - init(); - char buf[2 + 8 * sizeof(int)]; - if (base == 10) { - sprintf(buf, "%d", value); - } else { - itoa(value, buf, base); - } - *this = buf; -} - -String::String(unsigned int value, unsigned char base) { - init(); - char buf[1 + 8 * sizeof(unsigned int)]; - utoa(value, buf, base); - *this = buf; -} - -String::String(long value, unsigned char base) { - init(); - char buf[2 + 8 * sizeof(long)]; - if (base==10) { - sprintf(buf, "%ld", value); - } else { - ltoa(value, buf, base); - } - *this = buf; -} - -String::String(unsigned long value, unsigned char base) { - init(); - char buf[1 + 8 * sizeof(unsigned long)]; - ultoa(value, buf, base); - *this = buf; -} - -String::String(float value, unsigned char decimalPlaces) { - init(); - char buf[33]; - *this = dtostrf(value, (decimalPlaces + 2), decimalPlaces, buf); -} - -String::String(double value, unsigned char decimalPlaces) { - init(); - char buf[33]; - *this = dtostrf(value, (decimalPlaces + 2), decimalPlaces, buf); -} - -String::~String() { - invalidate(); -} - -// /*********************************************/ -// /* Memory Management */ -// /*********************************************/ - -inline void String::init(void) { - setSSO(false); - setCapacity(0); - setLen(0); - setBuffer(nullptr); -} - -void String::invalidate(void) { - if(!isSSO() && wbuffer()) - free(wbuffer()); - init(); -} - -unsigned char String::reserve(unsigned int size) { - if(buffer() && capacity() >= size) - return 1; - if(changeBuffer(size)) { - if(len() == 0) - wbuffer()[0] = 0; - return 1; - } - return 0; -} - -unsigned char String::changeBuffer(unsigned int maxStrLen) { - // Can we use SSO here to avoid allocation? - if (maxStrLen < sizeof(sso.buff) - 1) { - if (isSSO() || !buffer()) { - // Already using SSO, nothing to do - uint16_t oldLen = len(); - setSSO(true); - setLen(oldLen); - return 1; - } else { // if bufptr && !isSSO() - // Using bufptr, need to shrink into sso.buff - char temp[sizeof(sso.buff)]; - memcpy(temp, buffer(), maxStrLen); - free(wbuffer()); - uint16_t oldLen = len(); - setSSO(true); - setLen(oldLen); - memcpy(wbuffer(), temp, maxStrLen); - return 1; - } - } - // Fallthrough to normal allocator - size_t newSize = (maxStrLen + 16) & (~0xf); - // Make sure we can fit newsize in the buffer - if (newSize > CAPACITY_MAX) { - return false; - } - uint16_t oldLen = len(); - char *newbuffer = (char *) realloc(isSSO() ? nullptr : wbuffer(), newSize); - if (newbuffer) { - size_t oldSize = capacity() + 1; // include NULL. - if (isSSO()) { - // Copy the SSO buffer into allocated space - memmove(newbuffer, sso.buff, sizeof(sso.buff)); - } - if (newSize > oldSize) - { - memset(newbuffer + oldSize, 0, newSize - oldSize); - } - setSSO(false); - setCapacity(newSize - 1); - setLen(oldLen); // Needed in case of SSO where len() never existed - setBuffer(newbuffer); - return 1; - } - return 0; -} - -// /*********************************************/ -// /* Copy and Move */ -// /*********************************************/ - -String & String::copy(const char *cstr, unsigned int length) { - if(!reserve(length)) { - invalidate(); - return *this; - } - setLen(length); - memmove(wbuffer(), cstr, length + 1); - return *this; -} - -String & String::copy(const __FlashStringHelper *pstr, unsigned int length) { - if (!reserve(length)) { - invalidate(); - return *this; - } - setLen(length); - memcpy_P(wbuffer(), (PGM_P)pstr, length + 1); // We know wbuffer() cannot ever be in PROGMEM, so memcpy safe here - return *this; -} - -#ifdef __GXX_EXPERIMENTAL_CXX0X__ -void String::move(String &rhs) { - if(buffer()) { - if(capacity() >= rhs.len()) { - memmove(wbuffer(), rhs.buffer(), rhs.length() + 1); - setLen(rhs.len()); - rhs.invalidate(); - return; - } else { - if (!isSSO()) { - free(wbuffer()); - setBuffer(nullptr); - } - } - } - if (rhs.isSSO()) { - setSSO(true); - memmove(sso.buff, rhs.sso.buff, sizeof(sso.buff)); - } else { - setSSO(false); - setBuffer(rhs.wbuffer()); - } - setCapacity(rhs.capacity()); - setLen(rhs.len()); - rhs.setSSO(false); - rhs.setCapacity(0); - rhs.setLen(0); - rhs.setBuffer(nullptr); -} -#endif - -String & String::operator =(const String &rhs) { - if(this == &rhs) - return *this; - - if(rhs.buffer()) - copy(rhs.buffer(), rhs.len()); - else - invalidate(); - - return *this; -} - -#ifdef __GXX_EXPERIMENTAL_CXX0X__ -String & String::operator =(String &&rval) { - if(this != &rval) - move(rval); - return *this; -} - -String & String::operator =(StringSumHelper &&rval) { - if(this != &rval) - move(rval); - return *this; -} -#endif - -String & String::operator =(const char *cstr) { - if(cstr) - copy(cstr, strlen(cstr)); - else - invalidate(); - - return *this; -} - -String & String::operator = (const __FlashStringHelper *pstr) -{ - if (pstr) copy(pstr, strlen_P((PGM_P)pstr)); - else invalidate(); - - return *this; -} - -// /*********************************************/ -// /* concat */ -// /*********************************************/ - -unsigned char String::concat(const String &s) { - // Special case if we're concatting ourself (s += s;) since we may end up - // realloc'ing the buffer and moving s.buffer in the method called - if (&s == this) { - unsigned int newlen = 2 * len(); - if (!s.buffer()) - return 0; - if (s.len() == 0) - return 1; - if (!reserve(newlen)) - return 0; - memmove(wbuffer() + len(), buffer(), len()); - setLen(newlen); - wbuffer()[len()] = 0; - return 1; - } else { - return concat(s.buffer(), s.len()); - } -} - -unsigned char String::concat(const char *cstr, unsigned int length) { - unsigned int newlen = len() + length; - if(!cstr) - return 0; - if(length == 0) - return 1; - if(!reserve(newlen)) - return 0; - if (cstr >= wbuffer() && cstr < wbuffer() + len()) - // compatible with SSO in ram #6155 (case "x += x.c_str()") - memmove(wbuffer() + len(), cstr, length + 1); - else - // compatible with source in flash #6367 - memcpy_P(wbuffer() + len(), cstr, length + 1); - setLen(newlen); - return 1; -} - -unsigned char String::concat(const char *cstr) { - if(!cstr) - return 0; - return concat(cstr, strlen(cstr)); -} - -unsigned char String::concat(char c) { - char buf[2]; - buf[0] = c; - buf[1] = 0; - return concat(buf, 1); -} - -unsigned char String::concat(unsigned char num) { - char buf[1 + 3 * sizeof(unsigned char)]; - sprintf(buf, "%d", num); - return concat(buf, strlen(buf)); -} - -unsigned char String::concat(int num) { - char buf[2 + 3 * sizeof(int)]; - sprintf(buf, "%d", num); - return concat(buf, strlen(buf)); -} - -unsigned char String::concat(unsigned int num) { - char buf[1 + 3 * sizeof(unsigned int)]; - utoa(num, buf, 10); - return concat(buf, strlen(buf)); -} - -unsigned char String::concat(long num) { - char buf[2 + 3 * sizeof(long)]; - sprintf(buf, "%ld", num); - return concat(buf, strlen(buf)); -} - -unsigned char String::concat(unsigned long num) { - char buf[1 + 3 * sizeof(unsigned long)]; - ultoa(num, buf, 10); - return concat(buf, strlen(buf)); -} - -unsigned char String::concat(float num) { - char buf[20]; - char* string = dtostrf(num, 4, 2, buf); - return concat(string, strlen(string)); -} - -unsigned char String::concat(double num) { - char buf[20]; - char* string = dtostrf(num, 4, 2, buf); - return concat(string, strlen(string)); -} - -unsigned char String::concat(const __FlashStringHelper * str) { - if (!str) return 0; - int length = strlen_P((PGM_P)str); - if (length == 0) return 1; - unsigned int newlen = len() + length; - if (!reserve(newlen)) return 0; - memcpy_P(wbuffer() + len(), (PGM_P)str, length + 1); - setLen(newlen); - return 1; -} - -/*********************************************/ -/* Concatenate */ -/*********************************************/ - -StringSumHelper & operator +(const StringSumHelper &lhs, const String &rhs) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(rhs.buffer(), rhs.len())) - a.invalidate(); - return a; -} - -StringSumHelper & operator +(const StringSumHelper &lhs, const char *cstr) { - StringSumHelper &a = const_cast(lhs); - if(!cstr || !a.concat(cstr, strlen(cstr))) - a.invalidate(); - return a; -} - -StringSumHelper & operator +(const StringSumHelper &lhs, char c) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(c)) - a.invalidate(); - return a; -} - -StringSumHelper & operator +(const StringSumHelper &lhs, unsigned char num) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(num)) - a.invalidate(); - return a; -} - -StringSumHelper & operator +(const StringSumHelper &lhs, int num) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(num)) - a.invalidate(); - return a; -} - -StringSumHelper & operator +(const StringSumHelper &lhs, unsigned int num) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(num)) - a.invalidate(); - return a; -} - -StringSumHelper & operator +(const StringSumHelper &lhs, long num) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(num)) - a.invalidate(); - return a; -} - -StringSumHelper & operator +(const StringSumHelper &lhs, unsigned long num) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(num)) - a.invalidate(); - return a; -} - -StringSumHelper & operator +(const StringSumHelper &lhs, float num) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(num)) - a.invalidate(); - return a; -} - -StringSumHelper & operator +(const StringSumHelper &lhs, double num) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(num)) - a.invalidate(); - return a; -} - -StringSumHelper & operator + (const StringSumHelper &lhs, const __FlashStringHelper *rhs) -{ - StringSumHelper &a = const_cast(lhs); - if (!a.concat(rhs)) - a.invalidate(); - return a; -} - -// /*********************************************/ -// /* Comparison */ -// /*********************************************/ - -int String::compareTo(const String &s) const { - if(!buffer() || !s.buffer()) { - if(s.buffer() && s.len() > 0) - return 0 - *(unsigned char *) s.buffer(); - if(buffer() && len() > 0) - return *(unsigned char *) buffer(); - return 0; - } - return strcmp(buffer(), s.buffer()); -} - -unsigned char String::equals(const String &s2) const { - return (len() == s2.len() && compareTo(s2) == 0); -} - -unsigned char String::equals(const char *cstr) const { - if(len() == 0) - return (cstr == NULL || *cstr == 0); - if(cstr == NULL) - return buffer()[0] == 0; - return strcmp(buffer(), cstr) == 0; -} - -unsigned char String::operator<(const String &rhs) const { - return compareTo(rhs) < 0; -} - -unsigned char String::operator>(const String &rhs) const { - return compareTo(rhs) > 0; -} - -unsigned char String::operator<=(const String &rhs) const { - return compareTo(rhs) <= 0; -} - -unsigned char String::operator>=(const String &rhs) const { - return compareTo(rhs) >= 0; -} - -unsigned char String::equalsIgnoreCase(const String &s2) const { - if(this == &s2) - return 1; - if(len() != s2.len()) - return 0; - if(len() == 0) - return 1; - const char *p1 = buffer(); - const char *p2 = s2.buffer(); - while(*p1) { - if(tolower(*p1++) != tolower(*p2++)) - return 0; - } - return 1; -} - -unsigned char String::equalsConstantTime(const String &s2) const { - // To avoid possible time-based attacks present function - // compares given strings in a constant time. - if(len() != s2.len()) - return 0; - //at this point lengths are the same - if(len() == 0) - return 1; - //at this point lenghts are the same and non-zero - const char *p1 = buffer(); - const char *p2 = s2.buffer(); - unsigned int equalchars = 0; - unsigned int diffchars = 0; - while(*p1) { - if(*p1 == *p2) - ++equalchars; - else - ++diffchars; - ++p1; - ++p2; - } - //the following should force a constant time eval of the condition without a compiler "logical shortcut" - unsigned char equalcond = (equalchars == len()); - unsigned char diffcond = (diffchars == 0); - return (equalcond & diffcond); //bitwise AND -} - -unsigned char String::startsWith(const String &s2) const { - if(len() < s2.len()) - return 0; - return startsWith(s2, 0); -} - -unsigned char String::startsWith(const String &s2, unsigned int offset) const { - if(offset > (unsigned)(len() - s2.len()) || !buffer() || !s2.buffer()) - return 0; - return strncmp(&buffer()[offset], s2.buffer(), s2.len()) == 0; -} - -unsigned char String::endsWith(const String &s2) const { - if(len() < s2.len() || !buffer() || !s2.buffer()) - return 0; - return strcmp(&buffer()[len() - s2.len()], s2.buffer()) == 0; -} - -// /*********************************************/ -// /* Character Access */ -// /*********************************************/ - -char String::charAt(unsigned int loc) const { - return operator[](loc); -} - -void String::setCharAt(unsigned int loc, char c) { - if(loc < len()) - wbuffer()[loc] = c; -} - -char & String::operator[](unsigned int index) { - static char dummy_writable_char; - if(index >= len() || !buffer()) { - dummy_writable_char = 0; - return dummy_writable_char; - } - return wbuffer()[index]; -} - -char String::operator[](unsigned int index) const { - if(index >= len() || !buffer()) - return 0; - return buffer()[index]; -} - -void String::getBytes(unsigned char *buf, unsigned int bufsize, unsigned int index) const { - if(!bufsize || !buf) - return; - if(index >= len()) { - buf[0] = 0; - return; - } - unsigned int n = bufsize - 1; - if(n > len() - index) - n = len() - index; - strncpy((char *) buf, buffer() + index, n); - buf[n] = 0; -} - -// /*********************************************/ -// /* Search */ -// /*********************************************/ - -int String::indexOf(char c) const { - return indexOf(c, 0); -} - -int String::indexOf(char ch, unsigned int fromIndex) const { - if(fromIndex >= len()) - return -1; - const char* temp = strchr(buffer() + fromIndex, ch); - if(temp == NULL) - return -1; - return temp - buffer(); -} - -int String::indexOf(const String &s2) const { - return indexOf(s2, 0); -} - -int String::indexOf(const String &s2, unsigned int fromIndex) const { - if(fromIndex >= len()) - return -1; - const char *found = strstr(buffer() + fromIndex, s2.buffer()); - if(found == NULL) - return -1; - return found - buffer(); -} - -int String::lastIndexOf(char theChar) const { - return lastIndexOf(theChar, len() - 1); -} - -int String::lastIndexOf(char ch, unsigned int fromIndex) const { - if(fromIndex >= len()) - return -1; - char tempchar = buffer()[fromIndex + 1]; - wbuffer()[fromIndex + 1] = '\0'; - char* temp = strrchr(wbuffer(), ch); - wbuffer()[fromIndex + 1] = tempchar; - if(temp == NULL) - return -1; - return temp - buffer(); -} - -int String::lastIndexOf(const String &s2) const { - return lastIndexOf(s2, len() - s2.len()); -} - -int String::lastIndexOf(const String &s2, unsigned int fromIndex) const { - if(s2.len() == 0 || len() == 0 || s2.len() > len()) - return -1; - if(fromIndex >= len()) - fromIndex = len() - 1; - int found = -1; - for(char *p = wbuffer(); p <= wbuffer() + fromIndex; p++) { - p = strstr(p, s2.buffer()); - if(!p) - break; - if((unsigned int) (p - wbuffer()) <= fromIndex) - found = p - buffer(); - } - return found; -} - -String String::substring(unsigned int left, unsigned int right) const { - if(left > right) { - unsigned int temp = right; - right = left; - left = temp; - } - String out; - if(left >= len()) - return out; - if(right > len()) - right = len(); - char temp = buffer()[right]; // save the replaced character - wbuffer()[right] = '\0'; - out = wbuffer() + left; // pointer arithmetic - wbuffer()[right] = temp; //restore character - return out; -} - -// /*********************************************/ -// /* Modification */ -// /*********************************************/ - -void String::replace(char find, char replace) { - if(!buffer()) - return; - for(char *p = wbuffer(); *p; p++) { - if(*p == find) - *p = replace; - } -} - -void String::replace(const String& find, const String& replace) { - if(len() == 0 || find.len() == 0) - return; - int diff = replace.len() - find.len(); - char *readFrom = wbuffer(); - char *foundAt; - if(diff == 0) { - while((foundAt = strstr(readFrom, find.buffer())) != NULL) { - memmove(foundAt, replace.buffer(), replace.len()); - readFrom = foundAt + replace.len(); - } - } else if(diff < 0) { - char *writeTo = wbuffer(); - while((foundAt = strstr(readFrom, find.buffer())) != NULL) { - unsigned int n = foundAt - readFrom; - memmove(writeTo, readFrom, n); - writeTo += n; - memmove(writeTo, replace.buffer(), replace.len()); - writeTo += replace.len(); - readFrom = foundAt + find.len(); - setLen(len() + diff); - } - memmove(writeTo, readFrom, strlen(readFrom)+1); - } else { - unsigned int size = len(); // compute size needed for result - while((foundAt = strstr(readFrom, find.buffer())) != NULL) { - readFrom = foundAt + find.len(); - size += diff; - } - if(size == len()) - return; - if(size > capacity() && !changeBuffer(size)) - return; // XXX: tell user! - int index = len() - 1; - while(index >= 0 && (index = lastIndexOf(find, index)) >= 0) { - readFrom = wbuffer() + index + find.len(); - memmove(readFrom + diff, readFrom, len() - (readFrom - buffer())); - int newLen = len() + diff; - memmove(wbuffer() + index, replace.buffer(), replace.len()); - setLen(newLen); - wbuffer()[newLen] = 0; - index--; - } - } -} - -void String::remove(unsigned int index) { - // Pass the biggest integer as the count. The remove method - // below will take care of truncating it at the end of the - // string. - remove(index, (unsigned int) -1); -} - -void String::remove(unsigned int index, unsigned int count) { - if(index >= len()) { - return; - } - if(count <= 0) { - return; - } - if(count > len() - index) { - count = len() - index; - } - char *writeTo = wbuffer() + index; - unsigned int newlen = len() - count; - setLen(newlen); - memmove(writeTo, wbuffer() + index + count, newlen - index); - wbuffer()[newlen] = 0; -} - -void String::toLowerCase(void) { - if(!buffer()) - return; - for(char *p = wbuffer(); *p; p++) { - *p = tolower(*p); - } -} - -void String::toUpperCase(void) { - if(!buffer()) - return; - for(char *p = wbuffer(); *p; p++) { - *p = toupper(*p); - } -} - -void String::trim(void) { - if(!buffer() || len() == 0) - return; - char *begin = wbuffer(); - while(isspace(*begin)) - begin++; - char *end = wbuffer() + len() - 1; - while(isspace(*end) && end >= begin) - end--; - unsigned int newlen = end + 1 - begin; - setLen(newlen); - if(begin > buffer()) - memmove(wbuffer(), begin, newlen); - wbuffer()[newlen] = 0; -} - -// /*********************************************/ -// /* Parsing / Conversion */ -// /*********************************************/ - -long String::toInt(void) const { - if (buffer()) - return atol(buffer()); - return 0; -} - -float String::toFloat(void) const { - if (buffer()) - return atof(buffer()); - return 0; -} - -double String::toDouble(void) const -{ - if (buffer()) - return atof(buffer()); - return 0.0; -} - -// global empty string to allow returning const String& with nothing - -const String emptyString; diff --git a/cores/esp32/WString.h b/cores/esp32/WString.h deleted file mode 100644 index 38bd116f4ae..00000000000 --- a/cores/esp32/WString.h +++ /dev/null @@ -1,335 +0,0 @@ -/* - WString.h - String library for Wiring & Arduino - ...mostly rewritten by Paul Stoffregen... - Copyright (c) 2009-10 Hernando Barragan. All right reserved. - Copyright 2011, Paul Stoffregen, paul@pjrc.com - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef String_class_h -#define String_class_h -#ifdef __cplusplus - -#include -#include -#include -#include -#include - -// An inherited class for holding the result of a concatenation. These -// result objects are assumed to be writable by subsequent concatenations. -class StringSumHelper; - -// an abstract class used as a means to proide a unique pointer type -// but really has no body -class __FlashStringHelper; -#define FPSTR(pstr_pointer) (reinterpret_cast(pstr_pointer)) -#define F(string_literal) (FPSTR(PSTR(string_literal))) - -// The string class -class String { - // use a function pointer to allow for "if (s)" without the - // complications of an operator bool(). for more information, see: - // http://www.artima.com/cppsource/safebool.html - typedef void (String::*StringIfHelperType)() const; - void StringIfHelper() const { - } - - public: - // constructors - // creates a copy of the initial value. - // if the initial value is null or invalid, or if memory allocation - // fails, the string will be marked as invalid (i.e. "if (s)" will - // be false). - String(const char *cstr = ""); - String(const String &str); - String(const __FlashStringHelper *str); -#ifdef __GXX_EXPERIMENTAL_CXX0X__ - String(String &&rval); - String(StringSumHelper &&rval); -#endif - explicit String(char c); - explicit String(unsigned char, unsigned char base = 10); - explicit String(int, unsigned char base = 10); - explicit String(unsigned int, unsigned char base = 10); - explicit String(long, unsigned char base = 10); - explicit String(unsigned long, unsigned char base = 10); - explicit String(float, unsigned char decimalPlaces = 2); - explicit String(double, unsigned char decimalPlaces = 2); - ~String(void); - - // memory management - // return true on success, false on failure (in which case, the string - // is left unchanged). reserve(0), if successful, will validate an - // invalid string (i.e., "if (s)" will be true afterwards) - unsigned char reserve(unsigned int size); - inline unsigned int length(void) const { - if(buffer()) { - return len(); - } else { - return 0; - } - } - inline void clear(void) { - setLen(0); - } - inline bool isEmpty(void) const { - return length() == 0; - } - - // creates a copy of the assigned value. if the value is null or - // invalid, or if the memory allocation fails, the string will be - // marked as invalid ("if (s)" will be false). - String & operator =(const String &rhs); - String & operator =(const char *cstr); - String & operator = (const __FlashStringHelper *str); -#ifdef __GXX_EXPERIMENTAL_CXX0X__ - String & operator =(String &&rval); - String & operator =(StringSumHelper &&rval); -#endif - - // concatenate (works w/ built-in types) - - // returns true on success, false on failure (in which case, the string - // is left unchanged). if the argument is null or invalid, the - // concatenation is considered unsuccessful. - unsigned char concat(const String &str); - unsigned char concat(const char *cstr); - unsigned char concat(char c); - unsigned char concat(unsigned char c); - unsigned char concat(int num); - unsigned char concat(unsigned int num); - unsigned char concat(long num); - unsigned char concat(unsigned long num); - unsigned char concat(float num); - unsigned char concat(double num); - unsigned char concat(const __FlashStringHelper * str); - - // if there's not enough memory for the concatenated value, the string - // will be left unchanged (but this isn't signalled in any way) - String & operator +=(const String &rhs) { - concat(rhs); - return (*this); - } - String & operator +=(const char *cstr) { - concat(cstr); - return (*this); - } - String & operator +=(char c) { - concat(c); - return (*this); - } - String & operator +=(unsigned char num) { - concat(num); - return (*this); - } - String & operator +=(int num) { - concat(num); - return (*this); - } - String & operator +=(unsigned int num) { - concat(num); - return (*this); - } - String & operator +=(long num) { - concat(num); - return (*this); - } - String & operator +=(unsigned long num) { - concat(num); - return (*this); - } - String & operator +=(float num) { - concat(num); - return (*this); - } - String & operator +=(double num) { - concat(num); - return (*this); - } - String & operator += (const __FlashStringHelper *str){ - concat(str); - return (*this); - } - - friend StringSumHelper & operator +(const StringSumHelper &lhs, const String &rhs); - friend StringSumHelper & operator +(const StringSumHelper &lhs, const char *cstr); - friend StringSumHelper & operator +(const StringSumHelper &lhs, char c); - friend StringSumHelper & operator +(const StringSumHelper &lhs, unsigned char num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, int num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, unsigned int num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, long num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, unsigned long num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, float num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, double num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, const __FlashStringHelper *rhs); - - // comparison (only works w/ Strings and "strings") - operator StringIfHelperType() const { - return buffer() ? &String::StringIfHelper : 0; - } - int compareTo(const String &s) const; - unsigned char equals(const String &s) const; - unsigned char equals(const char *cstr) const; - unsigned char operator ==(const String &rhs) const { - return equals(rhs); - } - unsigned char operator ==(const char *cstr) const { - return equals(cstr); - } - unsigned char operator !=(const String &rhs) const { - return !equals(rhs); - } - unsigned char operator !=(const char *cstr) const { - return !equals(cstr); - } - unsigned char operator <(const String &rhs) const; - unsigned char operator >(const String &rhs) const; - unsigned char operator <=(const String &rhs) const; - unsigned char operator >=(const String &rhs) const; - unsigned char equalsIgnoreCase(const String &s) const; - unsigned char equalsConstantTime(const String &s) const; - unsigned char startsWith(const String &prefix) const; - unsigned char startsWith(const String &prefix, unsigned int offset) const; - unsigned char endsWith(const String &suffix) const; - - // character access - char charAt(unsigned int index) const; - void setCharAt(unsigned int index, char c); - char operator [](unsigned int index) const; - char& operator [](unsigned int index); - void getBytes(unsigned char *buf, unsigned int bufsize, unsigned int index = 0) const; - void toCharArray(char *buf, unsigned int bufsize, unsigned int index = 0) const { - getBytes((unsigned char *) buf, bufsize, index); - } - const char* c_str() const { return buffer(); } - char* begin() { return wbuffer(); } - char* end() { return wbuffer() + length(); } - const char* begin() const { return c_str(); } - const char* end() const { return c_str() + length(); } - - // search - int indexOf(char ch) const; - int indexOf(char ch, unsigned int fromIndex) const; - int indexOf(const String &str) const; - int indexOf(const String &str, unsigned int fromIndex) const; - int lastIndexOf(char ch) const; - int lastIndexOf(char ch, unsigned int fromIndex) const; - int lastIndexOf(const String &str) const; - int lastIndexOf(const String &str, unsigned int fromIndex) const; - String substring(unsigned int beginIndex) const { - return substring(beginIndex, len()); - } - ; - String substring(unsigned int beginIndex, unsigned int endIndex) const; - - // modification - void replace(char find, char replace); - void replace(const String& find, const String& replace); - void remove(unsigned int index); - void remove(unsigned int index, unsigned int count); - void toLowerCase(void); - void toUpperCase(void); - void trim(void); - - // parsing/conversion - long toInt(void) const; - float toFloat(void) const; - double toDouble(void) const; - - protected: - // Contains the string info when we're not in SSO mode - struct _ptr { - char * buff; - uint16_t cap; - uint16_t len; - }; - // This allows strings up up to 11 (10 + \0 termination) without any extra space. - enum { SSOSIZE = sizeof(struct _ptr) + 4 - 1 }; // Characters to allocate space for SSO, must be 12 or more - struct _sso { - char buff[SSOSIZE]; - unsigned char len : 7; // Ensure only one byte is allocated by GCC for the bitfields - unsigned char isSSO : 1; - } __attribute__((packed)); // Ensure that GCC doesn't expand the flag byte to a 32-bit word for alignment issues - enum { CAPACITY_MAX = 65535 }; // If typeof(cap) changed from uint16_t, be sure to update this enum to the max value storable in the type - union { - struct _ptr ptr; - struct _sso sso; - }; - // Accessor functions - inline bool isSSO() const { return sso.isSSO; } - inline unsigned int len() const { return isSSO() ? sso.len : ptr.len; } - inline unsigned int capacity() const { return isSSO() ? (unsigned int)SSOSIZE - 1 : ptr.cap; } // Size of max string not including terminal NUL - inline void setSSO(bool set) { sso.isSSO = set; } - inline void setLen(int len) { if (isSSO()) sso.len = len; else ptr.len = len; } - inline void setCapacity(int cap) { if (!isSSO()) ptr.cap = cap; } - inline void setBuffer(char *buff) { if (!isSSO()) ptr.buff = buff; } - // Buffer accessor functions - inline const char *buffer() const { return (const char *)(isSSO() ? sso.buff : ptr.buff); } - inline char *wbuffer() const { return isSSO() ? const_cast(sso.buff) : ptr.buff; } // Writable version of buffer - - protected: - void init(void); - void invalidate(void); - unsigned char changeBuffer(unsigned int maxStrLen); - unsigned char concat(const char *cstr, unsigned int length); - - // copy and move - String & copy(const char *cstr, unsigned int length); - String & copy(const __FlashStringHelper *pstr, unsigned int length); -#ifdef __GXX_EXPERIMENTAL_CXX0X__ - void move(String &rhs); -#endif -}; - -class StringSumHelper: public String { - public: - StringSumHelper(const String &s) : - String(s) { - } - StringSumHelper(const char *p) : - String(p) { - } - StringSumHelper(char c) : - String(c) { - } - StringSumHelper(unsigned char num) : - String(num) { - } - StringSumHelper(int num) : - String(num) { - } - StringSumHelper(unsigned int num) : - String(num) { - } - StringSumHelper(long num) : - String(num) { - } - StringSumHelper(unsigned long num) : - String(num) { - } - StringSumHelper(float num) : - String(num) { - } - StringSumHelper(double num) : - String(num) { - } -}; - -extern const String emptyString; - -#endif // __cplusplus -#endif // String_class_h diff --git a/cores/esp32/apps/sntp/sntp.h b/cores/esp32/apps/sntp/sntp.h deleted file mode 100644 index 8a940f88076..00000000000 --- a/cores/esp32/apps/sntp/sntp.h +++ /dev/null @@ -1 +0,0 @@ -#include "lwip/apps/sntp.h" diff --git a/cores/esp32/base64.cpp b/cores/esp32/base64.cpp deleted file mode 100644 index e7ba3fadbec..00000000000 --- a/cores/esp32/base64.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/** - * base64.cpp - * - * Created on: 09.12.2015 - * - * Copyright (c) 2015 Markus Sattler. All rights reserved. - * This file is part of the ESP31B core for Arduino. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#include "Arduino.h" -extern "C" { -#include "libb64/cdecode.h" -#include "libb64/cencode.h" -} -#include "base64.h" - -/** - * convert input data to base64 - * @param data uint8_t * - * @param length size_t - * @return String - */ -String base64::encode(uint8_t * data, size_t length) -{ - size_t size = base64_encode_expected_len(length) + 1; - char * buffer = (char *) malloc(size); - if(buffer) { - base64_encodestate _state; - base64_init_encodestate(&_state); - int len = base64_encode_block((const char *) &data[0], length, &buffer[0], &_state); - len = base64_encode_blockend((buffer + len), &_state); - - String base64 = String(buffer); - free(buffer); - return base64; - } - return String("-FAIL-"); -} - -/** - * convert input data to base64 - * @param text String - * @return String - */ -String base64::encode(String text) -{ - return base64::encode((uint8_t *) text.c_str(), text.length()); -} - diff --git a/cores/esp32/base64.h b/cores/esp32/base64.h deleted file mode 100644 index 8e6726a35d7..00000000000 --- a/cores/esp32/base64.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef CORE_BASE64_H_ -#define CORE_BASE64_H_ - -class base64 -{ -public: - static String encode(uint8_t * data, size_t length); - static String encode(String text); -private: -}; - - -#endif /* CORE_BASE64_H_ */ diff --git a/cores/esp32/binary.h b/cores/esp32/binary.h deleted file mode 100644 index c2f189dad18..00000000000 --- a/cores/esp32/binary.h +++ /dev/null @@ -1,534 +0,0 @@ -/* - binary.h - Definitions for binary constants - Copyright (c) 2006 David A. Mellis. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef Binary_h -#define Binary_h - -#define B0 0 -#define B00 0 -#define B000 0 -#define B0000 0 -#define B00000 0 -#define B000000 0 -#define B0000000 0 -#define B00000000 0 -#define B1 1 -#define B01 1 -#define B001 1 -#define B0001 1 -#define B00001 1 -#define B000001 1 -#define B0000001 1 -#define B00000001 1 -#define B10 2 -#define B010 2 -#define B0010 2 -#define B00010 2 -#define B000010 2 -#define B0000010 2 -#define B00000010 2 -#define B11 3 -#define B011 3 -#define B0011 3 -#define B00011 3 -#define B000011 3 -#define B0000011 3 -#define B00000011 3 -#define B100 4 -#define B0100 4 -#define B00100 4 -#define B000100 4 -#define B0000100 4 -#define B00000100 4 -#define B101 5 -#define B0101 5 -#define B00101 5 -#define B000101 5 -#define B0000101 5 -#define B00000101 5 -#define B110 6 -#define B0110 6 -#define B00110 6 -#define B000110 6 -#define B0000110 6 -#define B00000110 6 -#define B111 7 -#define B0111 7 -#define B00111 7 -#define B000111 7 -#define B0000111 7 -#define B00000111 7 -#define B1000 8 -#define B01000 8 -#define B001000 8 -#define B0001000 8 -#define B00001000 8 -#define B1001 9 -#define B01001 9 -#define B001001 9 -#define B0001001 9 -#define B00001001 9 -#define B1010 10 -#define B01010 10 -#define B001010 10 -#define B0001010 10 -#define B00001010 10 -#define B1011 11 -#define B01011 11 -#define B001011 11 -#define B0001011 11 -#define B00001011 11 -#define B1100 12 -#define B01100 12 -#define B001100 12 -#define B0001100 12 -#define B00001100 12 -#define B1101 13 -#define B01101 13 -#define B001101 13 -#define B0001101 13 -#define B00001101 13 -#define B1110 14 -#define B01110 14 -#define B001110 14 -#define B0001110 14 -#define B00001110 14 -#define B1111 15 -#define B01111 15 -#define B001111 15 -#define B0001111 15 -#define B00001111 15 -#define B10000 16 -#define B010000 16 -#define B0010000 16 -#define B00010000 16 -#define B10001 17 -#define B010001 17 -#define B0010001 17 -#define B00010001 17 -#define B10010 18 -#define B010010 18 -#define B0010010 18 -#define B00010010 18 -#define B10011 19 -#define B010011 19 -#define B0010011 19 -#define B00010011 19 -#define B10100 20 -#define B010100 20 -#define B0010100 20 -#define B00010100 20 -#define B10101 21 -#define B010101 21 -#define B0010101 21 -#define B00010101 21 -#define B10110 22 -#define B010110 22 -#define B0010110 22 -#define B00010110 22 -#define B10111 23 -#define B010111 23 -#define B0010111 23 -#define B00010111 23 -#define B11000 24 -#define B011000 24 -#define B0011000 24 -#define B00011000 24 -#define B11001 25 -#define B011001 25 -#define B0011001 25 -#define B00011001 25 -#define B11010 26 -#define B011010 26 -#define B0011010 26 -#define B00011010 26 -#define B11011 27 -#define B011011 27 -#define B0011011 27 -#define B00011011 27 -#define B11100 28 -#define B011100 28 -#define B0011100 28 -#define B00011100 28 -#define B11101 29 -#define B011101 29 -#define B0011101 29 -#define B00011101 29 -#define B11110 30 -#define B011110 30 -#define B0011110 30 -#define B00011110 30 -#define B11111 31 -#define B011111 31 -#define B0011111 31 -#define B00011111 31 -#define B100000 32 -#define B0100000 32 -#define B00100000 32 -#define B100001 33 -#define B0100001 33 -#define B00100001 33 -#define B100010 34 -#define B0100010 34 -#define B00100010 34 -#define B100011 35 -#define B0100011 35 -#define B00100011 35 -#define B100100 36 -#define B0100100 36 -#define B00100100 36 -#define B100101 37 -#define B0100101 37 -#define B00100101 37 -#define B100110 38 -#define B0100110 38 -#define B00100110 38 -#define B100111 39 -#define B0100111 39 -#define B00100111 39 -#define B101000 40 -#define B0101000 40 -#define B00101000 40 -#define B101001 41 -#define B0101001 41 -#define B00101001 41 -#define B101010 42 -#define B0101010 42 -#define B00101010 42 -#define B101011 43 -#define B0101011 43 -#define B00101011 43 -#define B101100 44 -#define B0101100 44 -#define B00101100 44 -#define B101101 45 -#define B0101101 45 -#define B00101101 45 -#define B101110 46 -#define B0101110 46 -#define B00101110 46 -#define B101111 47 -#define B0101111 47 -#define B00101111 47 -#define B110000 48 -#define B0110000 48 -#define B00110000 48 -#define B110001 49 -#define B0110001 49 -#define B00110001 49 -#define B110010 50 -#define B0110010 50 -#define B00110010 50 -#define B110011 51 -#define B0110011 51 -#define B00110011 51 -#define B110100 52 -#define B0110100 52 -#define B00110100 52 -#define B110101 53 -#define B0110101 53 -#define B00110101 53 -#define B110110 54 -#define B0110110 54 -#define B00110110 54 -#define B110111 55 -#define B0110111 55 -#define B00110111 55 -#define B111000 56 -#define B0111000 56 -#define B00111000 56 -#define B111001 57 -#define B0111001 57 -#define B00111001 57 -#define B111010 58 -#define B0111010 58 -#define B00111010 58 -#define B111011 59 -#define B0111011 59 -#define B00111011 59 -#define B111100 60 -#define B0111100 60 -#define B00111100 60 -#define B111101 61 -#define B0111101 61 -#define B00111101 61 -#define B111110 62 -#define B0111110 62 -#define B00111110 62 -#define B111111 63 -#define B0111111 63 -#define B00111111 63 -#define B1000000 64 -#define B01000000 64 -#define B1000001 65 -#define B01000001 65 -#define B1000010 66 -#define B01000010 66 -#define B1000011 67 -#define B01000011 67 -#define B1000100 68 -#define B01000100 68 -#define B1000101 69 -#define B01000101 69 -#define B1000110 70 -#define B01000110 70 -#define B1000111 71 -#define B01000111 71 -#define B1001000 72 -#define B01001000 72 -#define B1001001 73 -#define B01001001 73 -#define B1001010 74 -#define B01001010 74 -#define B1001011 75 -#define B01001011 75 -#define B1001100 76 -#define B01001100 76 -#define B1001101 77 -#define B01001101 77 -#define B1001110 78 -#define B01001110 78 -#define B1001111 79 -#define B01001111 79 -#define B1010000 80 -#define B01010000 80 -#define B1010001 81 -#define B01010001 81 -#define B1010010 82 -#define B01010010 82 -#define B1010011 83 -#define B01010011 83 -#define B1010100 84 -#define B01010100 84 -#define B1010101 85 -#define B01010101 85 -#define B1010110 86 -#define B01010110 86 -#define B1010111 87 -#define B01010111 87 -#define B1011000 88 -#define B01011000 88 -#define B1011001 89 -#define B01011001 89 -#define B1011010 90 -#define B01011010 90 -#define B1011011 91 -#define B01011011 91 -#define B1011100 92 -#define B01011100 92 -#define B1011101 93 -#define B01011101 93 -#define B1011110 94 -#define B01011110 94 -#define B1011111 95 -#define B01011111 95 -#define B1100000 96 -#define B01100000 96 -#define B1100001 97 -#define B01100001 97 -#define B1100010 98 -#define B01100010 98 -#define B1100011 99 -#define B01100011 99 -#define B1100100 100 -#define B01100100 100 -#define B1100101 101 -#define B01100101 101 -#define B1100110 102 -#define B01100110 102 -#define B1100111 103 -#define B01100111 103 -#define B1101000 104 -#define B01101000 104 -#define B1101001 105 -#define B01101001 105 -#define B1101010 106 -#define B01101010 106 -#define B1101011 107 -#define B01101011 107 -#define B1101100 108 -#define B01101100 108 -#define B1101101 109 -#define B01101101 109 -#define B1101110 110 -#define B01101110 110 -#define B1101111 111 -#define B01101111 111 -#define B1110000 112 -#define B01110000 112 -#define B1110001 113 -#define B01110001 113 -#define B1110010 114 -#define B01110010 114 -#define B1110011 115 -#define B01110011 115 -#define B1110100 116 -#define B01110100 116 -#define B1110101 117 -#define B01110101 117 -#define B1110110 118 -#define B01110110 118 -#define B1110111 119 -#define B01110111 119 -#define B1111000 120 -#define B01111000 120 -#define B1111001 121 -#define B01111001 121 -#define B1111010 122 -#define B01111010 122 -#define B1111011 123 -#define B01111011 123 -#define B1111100 124 -#define B01111100 124 -#define B1111101 125 -#define B01111101 125 -#define B1111110 126 -#define B01111110 126 -#define B1111111 127 -#define B01111111 127 -#define B10000000 128 -#define B10000001 129 -#define B10000010 130 -#define B10000011 131 -#define B10000100 132 -#define B10000101 133 -#define B10000110 134 -#define B10000111 135 -#define B10001000 136 -#define B10001001 137 -#define B10001010 138 -#define B10001011 139 -#define B10001100 140 -#define B10001101 141 -#define B10001110 142 -#define B10001111 143 -#define B10010000 144 -#define B10010001 145 -#define B10010010 146 -#define B10010011 147 -#define B10010100 148 -#define B10010101 149 -#define B10010110 150 -#define B10010111 151 -#define B10011000 152 -#define B10011001 153 -#define B10011010 154 -#define B10011011 155 -#define B10011100 156 -#define B10011101 157 -#define B10011110 158 -#define B10011111 159 -#define B10100000 160 -#define B10100001 161 -#define B10100010 162 -#define B10100011 163 -#define B10100100 164 -#define B10100101 165 -#define B10100110 166 -#define B10100111 167 -#define B10101000 168 -#define B10101001 169 -#define B10101010 170 -#define B10101011 171 -#define B10101100 172 -#define B10101101 173 -#define B10101110 174 -#define B10101111 175 -#define B10110000 176 -#define B10110001 177 -#define B10110010 178 -#define B10110011 179 -#define B10110100 180 -#define B10110101 181 -#define B10110110 182 -#define B10110111 183 -#define B10111000 184 -#define B10111001 185 -#define B10111010 186 -#define B10111011 187 -#define B10111100 188 -#define B10111101 189 -#define B10111110 190 -#define B10111111 191 -#define B11000000 192 -#define B11000001 193 -#define B11000010 194 -#define B11000011 195 -#define B11000100 196 -#define B11000101 197 -#define B11000110 198 -#define B11000111 199 -#define B11001000 200 -#define B11001001 201 -#define B11001010 202 -#define B11001011 203 -#define B11001100 204 -#define B11001101 205 -#define B11001110 206 -#define B11001111 207 -#define B11010000 208 -#define B11010001 209 -#define B11010010 210 -#define B11010011 211 -#define B11010100 212 -#define B11010101 213 -#define B11010110 214 -#define B11010111 215 -#define B11011000 216 -#define B11011001 217 -#define B11011010 218 -#define B11011011 219 -#define B11011100 220 -#define B11011101 221 -#define B11011110 222 -#define B11011111 223 -#define B11100000 224 -#define B11100001 225 -#define B11100010 226 -#define B11100011 227 -#define B11100100 228 -#define B11100101 229 -#define B11100110 230 -#define B11100111 231 -#define B11101000 232 -#define B11101001 233 -#define B11101010 234 -#define B11101011 235 -#define B11101100 236 -#define B11101101 237 -#define B11101110 238 -#define B11101111 239 -#define B11110000 240 -#define B11110001 241 -#define B11110010 242 -#define B11110011 243 -#define B11110100 244 -#define B11110101 245 -#define B11110110 246 -#define B11110111 247 -#define B11111000 248 -#define B11111001 249 -#define B11111010 250 -#define B11111011 251 -#define B11111100 252 -#define B11111101 253 -#define B11111110 254 -#define B11111111 255 - -#endif diff --git a/cores/esp32/cbuf.cpp b/cores/esp32/cbuf.cpp deleted file mode 100644 index ef7370a8a07..00000000000 --- a/cores/esp32/cbuf.cpp +++ /dev/null @@ -1,196 +0,0 @@ -/* - cbuf.cpp - Circular buffer implementation - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "cbuf.h" - -cbuf::cbuf(size_t size) : - next(NULL), _size(size+1), _buf(new char[size+1]), _bufend(_buf + size + 1), _begin(_buf), _end(_begin) -{ -} - -cbuf::~cbuf() -{ - delete[] _buf; -} - -size_t cbuf::resizeAdd(size_t addSize) -{ - return resize(_size + addSize); -} - -size_t cbuf::resize(size_t newSize) -{ - - size_t bytes_available = available(); - newSize += 1; - // not lose any data - // if data can be lost use remove or flush before resize - if((newSize < bytes_available) || (newSize == _size)) { - return _size; - } - - char *newbuf = new char[newSize]; - char *oldbuf = _buf; - - if(!newbuf) { - return _size; - } - - if(_buf) { - read(newbuf, bytes_available); - memset((newbuf + bytes_available), 0x00, (newSize - bytes_available)); - } - - _begin = newbuf; - _end = newbuf + bytes_available; - _bufend = newbuf + newSize; - _size = newSize; - - _buf = newbuf; - delete[] oldbuf; - - return _size; -} - -size_t cbuf::available() const -{ - if(_end >= _begin) { - return _end - _begin; - } - return _size - (_begin - _end); -} - -size_t cbuf::size() -{ - return _size; -} - -size_t cbuf::room() const -{ - if(_end >= _begin) { - return _size - (_end - _begin) - 1; - } - return _begin - _end - 1; -} - -int cbuf::peek() -{ - if(empty()) { - return -1; - } - - return static_cast(*_begin); -} - -size_t cbuf::peek(char *dst, size_t size) -{ - size_t bytes_available = available(); - size_t size_to_read = (size < bytes_available) ? size : bytes_available; - size_t size_read = size_to_read; - char * begin = _begin; - if(_end < _begin && size_to_read > (size_t) (_bufend - _begin)) { - size_t top_size = _bufend - _begin; - memcpy(dst, _begin, top_size); - begin = _buf; - size_to_read -= top_size; - dst += top_size; - } - memcpy(dst, begin, size_to_read); - return size_read; -} - -int cbuf::read() -{ - if(empty()) { - return -1; - } - - char result = *_begin; - _begin = wrap_if_bufend(_begin + 1); - return static_cast(result); -} - -size_t cbuf::read(char* dst, size_t size) -{ - size_t bytes_available = available(); - size_t size_to_read = (size < bytes_available) ? size : bytes_available; - size_t size_read = size_to_read; - if(_end < _begin && size_to_read > (size_t) (_bufend - _begin)) { - size_t top_size = _bufend - _begin; - memcpy(dst, _begin, top_size); - _begin = _buf; - size_to_read -= top_size; - dst += top_size; - } - memcpy(dst, _begin, size_to_read); - _begin = wrap_if_bufend(_begin + size_to_read); - return size_read; -} - -size_t cbuf::write(char c) -{ - if(full()) { - return 0; - } - - *_end = c; - _end = wrap_if_bufend(_end + 1); - return 1; -} - -size_t cbuf::write(const char* src, size_t size) -{ - size_t bytes_available = room(); - size_t size_to_write = (size < bytes_available) ? size : bytes_available; - size_t size_written = size_to_write; - if(_end >= _begin && size_to_write > (size_t) (_bufend - _end)) { - size_t top_size = _bufend - _end; - memcpy(_end, src, top_size); - _end = _buf; - size_to_write -= top_size; - src += top_size; - } - memcpy(_end, src, size_to_write); - _end = wrap_if_bufend(_end + size_to_write); - return size_written; -} - -void cbuf::flush() -{ - _begin = _buf; - _end = _buf; -} - -size_t cbuf::remove(size_t size) -{ - size_t bytes_available = available(); - if(size >= bytes_available) { - flush(); - return 0; - } - size_t size_to_remove = (size < bytes_available) ? size : bytes_available; - if(_end < _begin && size_to_remove > (size_t) (_bufend - _begin)) { - size_t top_size = _bufend - _begin; - _begin = _buf; - size_to_remove -= top_size; - } - _begin = wrap_if_bufend(_begin + size_to_remove); - return available(); -} diff --git a/cores/esp32/cbuf.h b/cores/esp32/cbuf.h deleted file mode 100644 index ca65affcce9..00000000000 --- a/cores/esp32/cbuf.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - cbuf.h - Circular buffer implementation - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef __cbuf_h -#define __cbuf_h - -#include -#include -#include - -class cbuf -{ -public: - cbuf(size_t size); - ~cbuf(); - - size_t resizeAdd(size_t addSize); - size_t resize(size_t newSize); - size_t available() const; - size_t size(); - - size_t room() const; - - inline bool empty() const - { - return _begin == _end; - } - - inline bool full() const - { - return wrap_if_bufend(_end + 1) == _begin; - } - - int peek(); - size_t peek(char *dst, size_t size); - - int read(); - size_t read(char* dst, size_t size); - - size_t write(char c); - size_t write(const char* src, size_t size); - - void flush(); - size_t remove(size_t size); - - cbuf *next; - -private: - inline char* wrap_if_bufend(char* ptr) const - { - return (ptr == _bufend) ? _buf : ptr; - } - - size_t _size; - char* _buf; - const char* _bufend; - char* _begin; - char* _end; - -}; - -#endif//__cbuf_h diff --git a/cores/esp32/esp32-hal-adc.c b/cores/esp32/esp32-hal-adc.c deleted file mode 100644 index b578fb597d9..00000000000 --- a/cores/esp32/esp32-hal-adc.c +++ /dev/null @@ -1,273 +0,0 @@ -// 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. - -#include "esp32-hal-adc.h" -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "rom/ets_sys.h" -#include "esp_attr.h" -#include "esp_intr.h" -#include "soc/rtc_io_reg.h" -#include "soc/rtc_cntl_reg.h" -#include "soc/sens_reg.h" - -static uint8_t __analogAttenuation = 3;//11db -static uint8_t __analogWidth = 3;//12 bits -static uint8_t __analogCycles = 8; -static uint8_t __analogSamples = 0;//1 sample -static uint8_t __analogClockDiv = 1; - -// Width of returned answer () -static uint8_t __analogReturnedWidth = 12; - -void __analogSetWidth(uint8_t bits){ - if(bits < 9){ - bits = 9; - } else if(bits > 12){ - bits = 12; - } - __analogReturnedWidth = bits; - __analogWidth = bits - 9; - SET_PERI_REG_BITS(SENS_SAR_START_FORCE_REG, SENS_SAR1_BIT_WIDTH, __analogWidth, SENS_SAR1_BIT_WIDTH_S); - SET_PERI_REG_BITS(SENS_SAR_READ_CTRL_REG, SENS_SAR1_SAMPLE_BIT, __analogWidth, SENS_SAR1_SAMPLE_BIT_S); - - SET_PERI_REG_BITS(SENS_SAR_START_FORCE_REG, SENS_SAR2_BIT_WIDTH, __analogWidth, SENS_SAR2_BIT_WIDTH_S); - SET_PERI_REG_BITS(SENS_SAR_READ_CTRL2_REG, SENS_SAR2_SAMPLE_BIT, __analogWidth, SENS_SAR2_SAMPLE_BIT_S); -} - -void __analogSetCycles(uint8_t cycles){ - __analogCycles = cycles; - SET_PERI_REG_BITS(SENS_SAR_READ_CTRL_REG, SENS_SAR1_SAMPLE_CYCLE, __analogCycles, SENS_SAR1_SAMPLE_CYCLE_S); - SET_PERI_REG_BITS(SENS_SAR_READ_CTRL2_REG, SENS_SAR2_SAMPLE_CYCLE, __analogCycles, SENS_SAR2_SAMPLE_CYCLE_S); -} - -void __analogSetSamples(uint8_t samples){ - if(!samples){ - return; - } - __analogSamples = samples - 1; - SET_PERI_REG_BITS(SENS_SAR_READ_CTRL_REG, SENS_SAR1_SAMPLE_NUM, __analogSamples, SENS_SAR1_SAMPLE_NUM_S); - SET_PERI_REG_BITS(SENS_SAR_READ_CTRL2_REG, SENS_SAR2_SAMPLE_NUM, __analogSamples, SENS_SAR2_SAMPLE_NUM_S); -} - -void __analogSetClockDiv(uint8_t clockDiv){ - if(!clockDiv){ - return; - } - __analogClockDiv = clockDiv; - SET_PERI_REG_BITS(SENS_SAR_READ_CTRL_REG, SENS_SAR1_CLK_DIV, __analogClockDiv, SENS_SAR1_CLK_DIV_S); - SET_PERI_REG_BITS(SENS_SAR_READ_CTRL2_REG, SENS_SAR2_CLK_DIV, __analogClockDiv, SENS_SAR2_CLK_DIV_S); -} - -void __analogSetAttenuation(adc_attenuation_t attenuation) -{ - __analogAttenuation = attenuation & 3; - uint32_t att_data = 0; - int i = 10; - while(i--){ - att_data |= __analogAttenuation << (i * 2); - } - WRITE_PERI_REG(SENS_SAR_ATTEN1_REG, att_data & 0xFFFF);//ADC1 has 8 channels - WRITE_PERI_REG(SENS_SAR_ATTEN2_REG, att_data); -} - -void IRAM_ATTR __analogInit(){ - static bool initialized = false; - if(initialized){ - return; - } - - __analogSetAttenuation(__analogAttenuation); - __analogSetCycles(__analogCycles); - __analogSetSamples(__analogSamples + 1);//in samples - __analogSetClockDiv(__analogClockDiv); - __analogSetWidth(__analogWidth + 9);//in bits - - SET_PERI_REG_MASK(SENS_SAR_READ_CTRL_REG, SENS_SAR1_DATA_INV); - SET_PERI_REG_MASK(SENS_SAR_READ_CTRL2_REG, SENS_SAR2_DATA_INV); - - SET_PERI_REG_MASK(SENS_SAR_MEAS_START1_REG, SENS_MEAS1_START_FORCE_M); //SAR ADC1 controller (in RTC) is started by SW - SET_PERI_REG_MASK(SENS_SAR_MEAS_START1_REG, SENS_SAR1_EN_PAD_FORCE_M); //SAR ADC1 pad enable bitmap is controlled by SW - SET_PERI_REG_MASK(SENS_SAR_MEAS_START2_REG, SENS_MEAS2_START_FORCE_M); //SAR ADC2 controller (in RTC) is started by SW - SET_PERI_REG_MASK(SENS_SAR_MEAS_START2_REG, SENS_SAR2_EN_PAD_FORCE_M); //SAR ADC2 pad enable bitmap is controlled by SW - - CLEAR_PERI_REG_MASK(SENS_SAR_MEAS_WAIT2_REG, SENS_FORCE_XPD_SAR_M); //force XPD_SAR=0, use XPD_FSM - SET_PERI_REG_BITS(SENS_SAR_MEAS_WAIT2_REG, SENS_FORCE_XPD_AMP, 0x2, SENS_FORCE_XPD_AMP_S); //force XPD_AMP=0 - - CLEAR_PERI_REG_MASK(SENS_SAR_MEAS_CTRL_REG, 0xfff << SENS_AMP_RST_FB_FSM_S); //clear FSM - SET_PERI_REG_BITS(SENS_SAR_MEAS_WAIT1_REG, SENS_SAR_AMP_WAIT1, 0x1, SENS_SAR_AMP_WAIT1_S); - SET_PERI_REG_BITS(SENS_SAR_MEAS_WAIT1_REG, SENS_SAR_AMP_WAIT2, 0x1, SENS_SAR_AMP_WAIT2_S); - SET_PERI_REG_BITS(SENS_SAR_MEAS_WAIT2_REG, SENS_SAR_AMP_WAIT3, 0x1, SENS_SAR_AMP_WAIT3_S); - while (GET_PERI_REG_BITS2(SENS_SAR_SLAVE_ADDR1_REG, 0x7, SENS_MEAS_STATUS_S) != 0); //wait det_fsm== - - initialized = true; -} - -void __analogSetPinAttenuation(uint8_t pin, adc_attenuation_t attenuation) -{ - int8_t channel = digitalPinToAnalogChannel(pin); - if(channel < 0 || attenuation > 3){ - return ; - } - __analogInit(); - if(channel > 7){ - SET_PERI_REG_BITS(SENS_SAR_ATTEN2_REG, 3, attenuation, ((channel - 10) * 2)); - } else { - SET_PERI_REG_BITS(SENS_SAR_ATTEN1_REG, 3, attenuation, (channel * 2)); - } -} - -bool IRAM_ATTR __adcAttachPin(uint8_t pin){ - - int8_t channel = digitalPinToAnalogChannel(pin); - if(channel < 0){ - return false;//not adc pin - } - - int8_t pad = digitalPinToTouchChannel(pin); - if(pad >= 0){ - uint32_t touch = READ_PERI_REG(SENS_SAR_TOUCH_ENABLE_REG); - if(touch & (1 << pad)){ - touch &= ~((1 << (pad + SENS_TOUCH_PAD_OUTEN2_S)) - | (1 << (pad + SENS_TOUCH_PAD_OUTEN1_S)) - | (1 << (pad + SENS_TOUCH_PAD_WORKEN_S))); - WRITE_PERI_REG(SENS_SAR_TOUCH_ENABLE_REG, touch); - } - } else if(pin == 25){ - CLEAR_PERI_REG_MASK(RTC_IO_PAD_DAC1_REG, RTC_IO_PDAC1_XPD_DAC | RTC_IO_PDAC1_DAC_XPD_FORCE);//stop dac1 - } else if(pin == 26){ - CLEAR_PERI_REG_MASK(RTC_IO_PAD_DAC2_REG, RTC_IO_PDAC2_XPD_DAC | RTC_IO_PDAC2_DAC_XPD_FORCE);//stop dac2 - } - - pinMode(pin, ANALOG); - - __analogInit(); - return true; -} - -bool IRAM_ATTR __adcStart(uint8_t pin){ - - int8_t channel = digitalPinToAnalogChannel(pin); - if(channel < 0){ - return false;//not adc pin - } - - if(channel > 9){ - channel -= 10; - CLEAR_PERI_REG_MASK(SENS_SAR_MEAS_START2_REG, SENS_MEAS2_START_SAR_M); - SET_PERI_REG_BITS(SENS_SAR_MEAS_START2_REG, SENS_SAR2_EN_PAD, (1 << channel), SENS_SAR2_EN_PAD_S); - SET_PERI_REG_MASK(SENS_SAR_MEAS_START2_REG, SENS_MEAS2_START_SAR_M); - } else { - CLEAR_PERI_REG_MASK(SENS_SAR_MEAS_START1_REG, SENS_MEAS1_START_SAR_M); - SET_PERI_REG_BITS(SENS_SAR_MEAS_START1_REG, SENS_SAR1_EN_PAD, (1 << channel), SENS_SAR1_EN_PAD_S); - SET_PERI_REG_MASK(SENS_SAR_MEAS_START1_REG, SENS_MEAS1_START_SAR_M); - } - return true; -} - -bool IRAM_ATTR __adcBusy(uint8_t pin){ - - int8_t channel = digitalPinToAnalogChannel(pin); - if(channel < 0){ - return false;//not adc pin - } - - if(channel > 7){ - return (GET_PERI_REG_MASK(SENS_SAR_MEAS_START2_REG, SENS_MEAS2_DONE_SAR) == 0); - } - return (GET_PERI_REG_MASK(SENS_SAR_MEAS_START1_REG, SENS_MEAS1_DONE_SAR) == 0); -} - -uint16_t IRAM_ATTR __adcEnd(uint8_t pin) -{ - - uint16_t value = 0; - int8_t channel = digitalPinToAnalogChannel(pin); - if(channel < 0){ - return 0;//not adc pin - } - if(channel > 7){ - while (GET_PERI_REG_MASK(SENS_SAR_MEAS_START2_REG, SENS_MEAS2_DONE_SAR) == 0); //wait for conversion - value = GET_PERI_REG_BITS2(SENS_SAR_MEAS_START2_REG, SENS_MEAS2_DATA_SAR, SENS_MEAS2_DATA_SAR_S); - } else { - while (GET_PERI_REG_MASK(SENS_SAR_MEAS_START1_REG, SENS_MEAS1_DONE_SAR) == 0); //wait for conversion - value = GET_PERI_REG_BITS2(SENS_SAR_MEAS_START1_REG, SENS_MEAS1_DATA_SAR, SENS_MEAS1_DATA_SAR_S); - } - - // Shift result if necessary - uint8_t from = __analogWidth + 9; - if (from == __analogReturnedWidth) { - return value; - } - if (from > __analogReturnedWidth) { - return value >> (from - __analogReturnedWidth); - } - return value << (__analogReturnedWidth - from); -} - -uint16_t IRAM_ATTR __analogRead(uint8_t pin) -{ - if(!__adcAttachPin(pin) || !__adcStart(pin)){ - return 0; - } - return __adcEnd(pin); -} - -void __analogReadResolution(uint8_t bits) -{ - if(!bits || bits > 16){ - return; - } - __analogSetWidth(bits); // hadware from 9 to 12 - __analogReturnedWidth = bits; // software from 1 to 16 -} - -int __hallRead() //hall sensor without LNA -{ - int Sens_Vp0; - int Sens_Vn0; - int Sens_Vp1; - int Sens_Vn1; - - pinMode(36, ANALOG); - pinMode(39, ANALOG); - SET_PERI_REG_MASK(SENS_SAR_TOUCH_CTRL1_REG, SENS_XPD_HALL_FORCE_M); // hall sens force enable - SET_PERI_REG_MASK(RTC_IO_HALL_SENS_REG, RTC_IO_XPD_HALL); // xpd hall - SET_PERI_REG_MASK(SENS_SAR_TOUCH_CTRL1_REG, SENS_HALL_PHASE_FORCE_M); // phase force - CLEAR_PERI_REG_MASK(RTC_IO_HALL_SENS_REG, RTC_IO_HALL_PHASE); // hall phase - Sens_Vp0 = __analogRead(36); - Sens_Vn0 = __analogRead(39); - SET_PERI_REG_MASK(RTC_IO_HALL_SENS_REG, RTC_IO_HALL_PHASE); - Sens_Vp1 = __analogRead(36); - Sens_Vn1 = __analogRead(39); - SET_PERI_REG_BITS(SENS_SAR_MEAS_WAIT2_REG, SENS_FORCE_XPD_SAR, 0, SENS_FORCE_XPD_SAR_S); - CLEAR_PERI_REG_MASK(SENS_SAR_TOUCH_CTRL1_REG, SENS_XPD_HALL_FORCE); - CLEAR_PERI_REG_MASK(SENS_SAR_TOUCH_CTRL1_REG, SENS_HALL_PHASE_FORCE); - return (Sens_Vp1 - Sens_Vp0) - (Sens_Vn1 - Sens_Vn0); -} - -extern uint16_t analogRead(uint8_t pin) __attribute__ ((weak, alias("__analogRead"))); -extern void analogReadResolution(uint8_t bits) __attribute__ ((weak, alias("__analogReadResolution"))); -extern void analogSetWidth(uint8_t bits) __attribute__ ((weak, alias("__analogSetWidth"))); -extern void analogSetCycles(uint8_t cycles) __attribute__ ((weak, alias("__analogSetCycles"))); -extern void analogSetSamples(uint8_t samples) __attribute__ ((weak, alias("__analogSetSamples"))); -extern void analogSetClockDiv(uint8_t clockDiv) __attribute__ ((weak, alias("__analogSetClockDiv"))); -extern void analogSetAttenuation(adc_attenuation_t attenuation) __attribute__ ((weak, alias("__analogSetAttenuation"))); -extern void analogSetPinAttenuation(uint8_t pin, adc_attenuation_t attenuation) __attribute__ ((weak, alias("__analogSetPinAttenuation"))); -extern int hallRead() __attribute__ ((weak, alias("__hallRead"))); - -extern bool adcAttachPin(uint8_t pin) __attribute__ ((weak, alias("__adcAttachPin"))); -extern bool adcStart(uint8_t pin) __attribute__ ((weak, alias("__adcStart"))); -extern bool adcBusy(uint8_t pin) __attribute__ ((weak, alias("__adcBusy"))); -extern uint16_t adcEnd(uint8_t pin) __attribute__ ((weak, alias("__adcEnd"))); diff --git a/cores/esp32/esp32-hal-adc.h b/cores/esp32/esp32-hal-adc.h deleted file mode 100644 index ab751df4975..00000000000 --- a/cores/esp32/esp32-hal-adc.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - Arduino.h - Main include file for the Arduino SDK - Copyright (c) 2005-2013 Arduino Team. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef MAIN_ESP32_HAL_ADC_H_ -#define MAIN_ESP32_HAL_ADC_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "esp32-hal.h" - -typedef enum { - ADC_0db, - ADC_2_5db, - ADC_6db, - ADC_11db -} adc_attenuation_t; - -/* - * Get ADC value for pin - * */ -uint16_t analogRead(uint8_t pin); - -/* - * Set the resolution of analogRead return values. Default is 12 bits (range from 0 to 4096). - * If between 9 and 12, it will equal the set hardware resolution, else value will be shifted. - * Range is 1 - 16 - * - * Note: compatibility with Arduino SAM - */ -void analogReadResolution(uint8_t bits); - -/* - * Sets the sample bits and read resolution - * Default is 12bit (0 - 4095) - * Range is 9 - 12 - * */ -void analogSetWidth(uint8_t bits); - -/* - * Set number of cycles per sample - * Default is 8 and seems to do well - * Range is 1 - 255 - * */ -void analogSetCycles(uint8_t cycles); - -/* - * Set number of samples in the range. - * Default is 1 - * Range is 1 - 255 - * This setting splits the range into - * "samples" pieces, which could look - * like the sensitivity has been multiplied - * that many times - * */ -void analogSetSamples(uint8_t samples); - -/* - * Set the divider for the ADC clock. - * Default is 1 - * Range is 1 - 255 - * */ -void analogSetClockDiv(uint8_t clockDiv); - -/* - * Set the attenuation for all channels - * Default is 11db - * */ -void analogSetAttenuation(adc_attenuation_t attenuation); - -/* - * Set the attenuation for particular pin - * Default is 11db - * */ -void analogSetPinAttenuation(uint8_t pin, adc_attenuation_t attenuation); - -/* - * Get value for HALL sensor (without LNA) - * connected to pins 36(SVP) and 39(SVN) - * */ -int hallRead(); - -/* - * Non-Blocking API (almost) - * - * Note: ADC conversion can run only for single pin at a time. - * That means that if you want to run ADC on two pins on the same bus, - * you need to run them one after another. Probably the best use would be - * to start conversion on both buses in parallel. - * */ - -/* - * Attach pin to ADC (will also clear any other analog mode that could be on) - * */ -bool adcAttachPin(uint8_t pin); - -/* - * Start ADC conversion on attached pin's bus - * */ -bool adcStart(uint8_t pin); - -/* - * Check if conversion on the pin's ADC bus is currently running - * */ -bool adcBusy(uint8_t pin); - -/* - * Get the result of the conversion (will wait if it have not finished) - * */ -uint16_t adcEnd(uint8_t pin); - -#ifdef __cplusplus -} -#endif - -#endif /* MAIN_ESP32_HAL_ADC_H_ */ diff --git a/cores/esp32/esp32-hal-bt.c b/cores/esp32/esp32-hal-bt.c deleted file mode 100644 index 826438b418f..00000000000 --- a/cores/esp32/esp32-hal-bt.c +++ /dev/null @@ -1,91 +0,0 @@ -// 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. - -#include "esp32-hal-bt.h" - -#ifdef CONFIG_BT_ENABLED - -bool btInUse(){ return true; } - -#ifdef CONFIG_BLUEDROID_ENABLED -#include "esp_bt.h" - -#ifdef CONFIG_CLASSIC_BT_ENABLED -#define BT_MODE ESP_BT_MODE_BTDM -#else -#define BT_MODE ESP_BT_MODE_BLE -#endif - -bool btStarted(){ - return (esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_ENABLED); -} - -bool btStart(){ - esp_bt_controller_config_t cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT(); - if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_ENABLED){ - return true; - } - if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_IDLE){ - esp_bt_controller_init(&cfg); - while(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_IDLE){} - } - if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_INITED){ - if (esp_bt_controller_enable(BT_MODE)) { - log_e("BT Enable failed"); - return false; - } - } - if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_ENABLED){ - return true; - } - log_e("BT Start failed"); - return false; -} - -bool btStop(){ - if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_IDLE){ - return true; - } - if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_ENABLED){ - if (esp_bt_controller_disable()) { - log_e("BT Disable failed"); - return false; - } - while(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_ENABLED); - } - if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_INITED){ - return true; - } - log_e("BT Stop failed"); - return false; -} - -#else -bool btStarted() -{ - return false; -} - -bool btStart() -{ - return false; -} - -bool btStop() -{ - return false; -} -#endif -#endif - diff --git a/cores/esp32/esp32-hal-bt.h b/cores/esp32/esp32-hal-bt.h deleted file mode 100644 index 56222da3182..00000000000 --- a/cores/esp32/esp32-hal-bt.h +++ /dev/null @@ -1,32 +0,0 @@ -// 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. - -#ifndef _ESP32_ESP32_HAL_BT_H_ -#define _ESP32_ESP32_HAL_BT_H_ - -#include "esp32-hal.h" - -#ifdef __cplusplus -extern "C" { -#endif - -bool btStarted(); -bool btStart(); -bool btStop(); - -#ifdef __cplusplus -} -#endif - -#endif /* _ESP32_ESP32_HAL_BT_H_ */ diff --git a/cores/esp32/esp32-hal-cpu.c b/cores/esp32/esp32-hal-cpu.c deleted file mode 100644 index 1e30bcf71b1..00000000000 --- a/cores/esp32/esp32-hal-cpu.c +++ /dev/null @@ -1,219 +0,0 @@ -// 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. - -#include "sdkconfig.h" -#include "freertos/FreeRTOS.h" -#include "freertos/semphr.h" -#include "freertos/task.h" -#include "freertos/xtensa_timer.h" -#include "esp_attr.h" -#include "esp_log.h" -#include "soc/rtc.h" -#include "soc/rtc_cntl_reg.h" -#include "rom/rtc.h" -#include "soc/apb_ctrl_reg.h" -#include "soc/efuse_reg.h" -#include "esp32-hal.h" -#include "esp32-hal-cpu.h" - -typedef struct apb_change_cb_s { - struct apb_change_cb_s * next; - void * arg; - apb_change_cb_t cb; -} apb_change_t; - -const uint32_t MHZ = 1000000; - -static apb_change_t * apb_change_callbacks = NULL; -static xSemaphoreHandle apb_change_lock = NULL; - -static void initApbChangeCallback(){ - static volatile bool initialized = false; - if(!initialized){ - initialized = true; - apb_change_lock = xSemaphoreCreateMutex(); - if(!apb_change_lock){ - initialized = false; - } - } -} - -static void triggerApbChangeCallback(apb_change_ev_t ev_type, uint32_t old_apb, uint32_t new_apb){ - initApbChangeCallback(); - xSemaphoreTake(apb_change_lock, portMAX_DELAY); - apb_change_t * r = apb_change_callbacks; - while(r != NULL){ - r->cb(r->arg, ev_type, old_apb, new_apb); - r=r->next; - } - xSemaphoreGive(apb_change_lock); -} - -bool addApbChangeCallback(void * arg, apb_change_cb_t cb){ - initApbChangeCallback(); - apb_change_t * c = (apb_change_t*)malloc(sizeof(apb_change_t)); - if(!c){ - log_e("Callback Object Malloc Failed"); - return false; - } - c->next = NULL; - c->arg = arg; - c->cb = cb; - xSemaphoreTake(apb_change_lock, portMAX_DELAY); - if(apb_change_callbacks == NULL){ - apb_change_callbacks = c; - } else { - apb_change_t * r = apb_change_callbacks; - if(r->cb != cb || r->arg != arg){ - while(r->next){ - r = r->next; - if(r->cb == cb && r->arg == arg){ - free(c); - goto unlock_and_exit; - } - } - r->next = c; - } - } -unlock_and_exit: - xSemaphoreGive(apb_change_lock); - return true; -} - -bool removeApbChangeCallback(void * arg, apb_change_cb_t cb){ - initApbChangeCallback(); - xSemaphoreTake(apb_change_lock, portMAX_DELAY); - apb_change_t * r = apb_change_callbacks; - if(r == NULL){ - xSemaphoreGive(apb_change_lock); - return false; - } - if(r->cb == cb && r->arg == arg){ - apb_change_callbacks = r->next; - free(r); - } else { - while(r->next && (r->next->cb != cb || r->next->arg != arg)){ - r = r->next; - } - if(r->next == NULL || r->next->cb != cb || r->next->arg != arg){ - xSemaphoreGive(apb_change_lock); - return false; - } - apb_change_t * c = r->next; - r->next = c->next; - free(c); - } - xSemaphoreGive(apb_change_lock); - return true; -} - -static uint32_t calculateApb(rtc_cpu_freq_config_t * conf){ - if(conf->freq_mhz >= 80){ - return 80 * MHZ; - } - return (conf->source_freq_mhz * MHZ) / conf->div; -} - -void esp_timer_impl_update_apb_freq(uint32_t apb_ticks_per_us); //private in IDF - -bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz){ - rtc_cpu_freq_config_t conf, cconf; - uint32_t capb, apb; - //Get XTAL Frequency and calculate min CPU MHz - rtc_xtal_freq_t xtal = rtc_clk_xtal_freq_get(); - if(xtal > RTC_XTAL_FREQ_AUTO){ - if(xtal < RTC_XTAL_FREQ_40M) { - if(cpu_freq_mhz <= xtal && cpu_freq_mhz != xtal && cpu_freq_mhz != (xtal/2)){ - log_e("Bad frequency: %u MHz! Options are: 240, 160, 80, %u and %u MHz", cpu_freq_mhz, xtal, xtal/2); - return false; - } - } else if(cpu_freq_mhz <= xtal && cpu_freq_mhz != xtal && cpu_freq_mhz != (xtal/2) && cpu_freq_mhz != (xtal/4)){ - log_e("Bad frequency: %u MHz! Options are: 240, 160, 80, %u, %u and %u MHz", cpu_freq_mhz, xtal, xtal/2, xtal/4); - return false; - } - } - if(cpu_freq_mhz > xtal && cpu_freq_mhz != 240 && cpu_freq_mhz != 160 && cpu_freq_mhz != 80){ - if(xtal >= RTC_XTAL_FREQ_40M){ - log_e("Bad frequency: %u MHz! Options are: 240, 160, 80, %u, %u and %u MHz", cpu_freq_mhz, xtal, xtal/2, xtal/4); - } else { - log_e("Bad frequency: %u MHz! Options are: 240, 160, 80, %u and %u MHz", cpu_freq_mhz, xtal, xtal/2); - } - return false; - } - //check if cpu supports the frequency - if(cpu_freq_mhz == 240){ - //Check if ESP32 is rated for a CPU frequency of 160MHz only - if (REG_GET_BIT(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_CPU_FREQ_RATED) && - REG_GET_BIT(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_CPU_FREQ_LOW)) { - log_e("Can not switch to 240 MHz! Chip CPU frequency rated for 160MHz."); - cpu_freq_mhz = 160; - } - } - //Get current CPU clock configuration - rtc_clk_cpu_freq_get_config(&cconf); - //return if frequency has not changed - if(cconf.freq_mhz == cpu_freq_mhz){ - return true; - } - //Get configuration for the new CPU frequency - if(!rtc_clk_cpu_freq_mhz_to_config(cpu_freq_mhz, &conf)){ - log_e("CPU clock could not be set to %u MHz", cpu_freq_mhz); - return false; - } - //Current APB - capb = calculateApb(&cconf); - //New APB - apb = calculateApb(&conf); - log_d("%s: %u / %u = %u Mhz, APB: %u Hz", (conf.source == RTC_CPU_FREQ_SRC_PLL)?"PLL":((conf.source == RTC_CPU_FREQ_SRC_APLL)?"APLL":((conf.source == RTC_CPU_FREQ_SRC_XTAL)?"XTAL":"8M")), conf.source_freq_mhz, conf.div, conf.freq_mhz, apb); - //Call peripheral functions before the APB change - if(apb_change_callbacks){ - triggerApbChangeCallback(APB_BEFORE_CHANGE, capb, apb); - } - //Make the frequency change - rtc_clk_cpu_freq_set_config_fast(&conf); - if(capb != apb){ - //Update REF_TICK (uncomment if REF_TICK is different than 1MHz) - //if(conf.freq_mhz < 80){ - // ESP_REG(APB_CTRL_XTAL_TICK_CONF_REG) = conf.freq_mhz / (REF_CLK_FREQ / MHZ) - 1; - //} - //Update APB Freq REG - rtc_clk_apb_freq_update(apb); - //Update esp_timer divisor - esp_timer_impl_update_apb_freq(apb / MHZ); - } - //Update FreeRTOS Tick Divisor - uint32_t fcpu = (conf.freq_mhz >= 80)?(conf.freq_mhz * MHZ):(apb); - _xt_tick_divisor = fcpu / XT_TICK_PER_SEC; - //Call peripheral functions after the APB change - if(apb_change_callbacks){ - triggerApbChangeCallback(APB_AFTER_CHANGE, capb, apb); - } - return true; -} - -uint32_t getCpuFrequencyMhz(){ - rtc_cpu_freq_config_t conf; - rtc_clk_cpu_freq_get_config(&conf); - return conf.freq_mhz; -} - -uint32_t getXtalFrequencyMhz(){ - return rtc_clk_xtal_freq_get(); -} - -uint32_t getApbFrequency(){ - rtc_cpu_freq_config_t conf; - rtc_clk_cpu_freq_get_config(&conf); - return calculateApb(&conf); -} diff --git a/cores/esp32/esp32-hal-cpu.h b/cores/esp32/esp32-hal-cpu.h deleted file mode 100644 index 646b59858f5..00000000000 --- a/cores/esp32/esp32-hal-cpu.h +++ /dev/null @@ -1,48 +0,0 @@ -// 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. - -#ifndef _ESP32_HAL_CPU_H_ -#define _ESP32_HAL_CPU_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include - -typedef enum { APB_BEFORE_CHANGE, APB_AFTER_CHANGE } apb_change_ev_t; - -typedef void (* apb_change_cb_t)(void * arg, apb_change_ev_t ev_type, uint32_t old_apb, uint32_t new_apb); - -bool addApbChangeCallback(void * arg, apb_change_cb_t cb); -bool removeApbChangeCallback(void * arg, apb_change_cb_t cb); - -//function takes the following frequencies as valid values: -// 240, 160, 80 <<< For all XTAL types -// 40, 20, 10 <<< For 40MHz XTAL -// 26, 13 <<< For 26MHz XTAL -// 24, 12 <<< For 24MHz XTAL -bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz); - -uint32_t getCpuFrequencyMhz(); // In MHz -uint32_t getXtalFrequencyMhz(); // In MHz -uint32_t getApbFrequency(); // In Hz - -#ifdef __cplusplus -} -#endif - -#endif /* _ESP32_HAL_CPU_H_ */ diff --git a/cores/esp32/esp32-hal-dac.c b/cores/esp32/esp32-hal-dac.c deleted file mode 100644 index e407c221116..00000000000 --- a/cores/esp32/esp32-hal-dac.c +++ /dev/null @@ -1,54 +0,0 @@ -// 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. - -#include "esp32-hal-dac.h" -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "rom/ets_sys.h" -#include "esp_attr.h" -#include "esp_intr.h" -#include "soc/rtc_io_reg.h" -#include "soc/rtc_cntl_reg.h" -#include "soc/sens_reg.h" - -void IRAM_ATTR __dacWrite(uint8_t pin, uint8_t value) -{ - if(pin < 25 || pin > 26){ - return;//not dac pin - } - pinMode(pin, ANALOG); - uint8_t channel = pin - 25; - - - //Disable Tone - CLEAR_PERI_REG_MASK(SENS_SAR_DAC_CTRL1_REG, SENS_SW_TONE_EN); - - if (channel) { - //Disable Channel Tone - CLEAR_PERI_REG_MASK(SENS_SAR_DAC_CTRL2_REG, SENS_DAC_CW_EN2_M); - //Set the Dac value - SET_PERI_REG_BITS(RTC_IO_PAD_DAC2_REG, RTC_IO_PDAC2_DAC, value, RTC_IO_PDAC2_DAC_S); //dac_output - //Channel output enable - SET_PERI_REG_MASK(RTC_IO_PAD_DAC2_REG, RTC_IO_PDAC2_XPD_DAC | RTC_IO_PDAC2_DAC_XPD_FORCE); - } else { - //Disable Channel Tone - CLEAR_PERI_REG_MASK(SENS_SAR_DAC_CTRL2_REG, SENS_DAC_CW_EN1_M); - //Set the Dac value - SET_PERI_REG_BITS(RTC_IO_PAD_DAC1_REG, RTC_IO_PDAC1_DAC, value, RTC_IO_PDAC1_DAC_S); //dac_output - //Channel output enable - SET_PERI_REG_MASK(RTC_IO_PAD_DAC1_REG, RTC_IO_PDAC1_XPD_DAC | RTC_IO_PDAC1_DAC_XPD_FORCE); - } -} - -extern void dacWrite(uint8_t pin, uint8_t value) __attribute__ ((weak, alias("__dacWrite"))); diff --git a/cores/esp32/esp32-hal-dac.h b/cores/esp32/esp32-hal-dac.h deleted file mode 100644 index 47b2265800f..00000000000 --- a/cores/esp32/esp32-hal-dac.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - Arduino.h - Main include file for the Arduino SDK - Copyright (c) 2005-2013 Arduino Team. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef MAIN_ESP32_HAL_DAC_H_ -#define MAIN_ESP32_HAL_DAC_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "esp32-hal.h" -#include "driver/gpio.h" - -void dacWrite(uint8_t pin, uint8_t value); - -#ifdef __cplusplus -} -#endif - -#endif /* MAIN_ESP32_HAL_DAC_H_ */ diff --git a/cores/esp32/esp32-hal-gpio.c b/cores/esp32/esp32-hal-gpio.c deleted file mode 100644 index d22af774c81..00000000000 --- a/cores/esp32/esp32-hal-gpio.c +++ /dev/null @@ -1,304 +0,0 @@ -// 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. - -#include "esp32-hal-gpio.h" -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "rom/ets_sys.h" -#include "esp_attr.h" -#include "esp_intr.h" -#include "rom/gpio.h" -#include "soc/gpio_reg.h" -#include "soc/io_mux_reg.h" -#include "soc/gpio_struct.h" -#include "soc/rtc_io_reg.h" - -const int8_t esp32_adc2gpio[20] = {36, 37, 38, 39, 32, 33, 34, 35, -1, -1, 4, 0, 2, 15, 13, 12, 14, 27, 25, 26}; - -const DRAM_ATTR esp32_gpioMux_t esp32_gpioMux[GPIO_PIN_COUNT]={ - {0x44, 11, 11, 1}, - {0x88, -1, -1, -1}, - {0x40, 12, 12, 2}, - {0x84, -1, -1, -1}, - {0x48, 10, 10, 0}, - {0x6c, -1, -1, -1}, - {0x60, -1, -1, -1}, - {0x64, -1, -1, -1}, - {0x68, -1, -1, -1}, - {0x54, -1, -1, -1}, - {0x58, -1, -1, -1}, - {0x5c, -1, -1, -1}, - {0x34, 15, 15, 5}, - {0x38, 14, 14, 4}, - {0x30, 16, 16, 6}, - {0x3c, 13, 13, 3}, - {0x4c, -1, -1, -1}, - {0x50, -1, -1, -1}, - {0x70, -1, -1, -1}, - {0x74, -1, -1, -1}, - {0x78, -1, -1, -1}, - {0x7c, -1, -1, -1}, - {0x80, -1, -1, -1}, - {0x8c, -1, -1, -1}, - {0, -1, -1, -1}, - {0x24, 6, 18, -1}, //DAC1 - {0x28, 7, 19, -1}, //DAC2 - {0x2c, 17, 17, 7}, - {0, -1, -1, -1}, - {0, -1, -1, -1}, - {0, -1, -1, -1}, - {0, -1, -1, -1}, - {0x1c, 9, 4, 9}, - {0x20, 8, 5, 8}, - {0x14, 4, 6, -1}, - {0x18, 5, 7, -1}, - {0x04, 0, 0, -1}, - {0x08, 1, 1, -1}, - {0x0c, 2, 2, -1}, - {0x10, 3, 3, -1} -}; - -typedef void (*voidFuncPtr)(void); -typedef void (*voidFuncPtrArg)(void*); -typedef struct { - voidFuncPtr fn; - void* arg; - bool functional; -} InterruptHandle_t; -static InterruptHandle_t __pinInterruptHandlers[GPIO_PIN_COUNT] = {0,}; - -#include "driver/rtc_io.h" - -extern void IRAM_ATTR __pinMode(uint8_t pin, uint8_t mode) -{ - - if(!digitalPinIsValid(pin)) { - return; - } - - uint32_t rtc_reg = rtc_gpio_desc[pin].reg; - if(mode == ANALOG) { - if(!rtc_reg) { - return;//not rtc pin - } - //lock rtc - uint32_t reg_val = ESP_REG(rtc_reg); - if(reg_val & rtc_gpio_desc[pin].mux){ - return;//already in adc mode - } - reg_val &= ~( - (RTC_IO_TOUCH_PAD1_FUN_SEL_V << rtc_gpio_desc[pin].func) - |rtc_gpio_desc[pin].ie - |rtc_gpio_desc[pin].pullup - |rtc_gpio_desc[pin].pulldown); - ESP_REG(RTC_GPIO_ENABLE_W1TC_REG) = (1 << (rtc_gpio_desc[pin].rtc_num + RTC_GPIO_ENABLE_W1TC_S)); - ESP_REG(rtc_reg) = reg_val | rtc_gpio_desc[pin].mux; - //unlock rtc - ESP_REG(DR_REG_IO_MUX_BASE + esp32_gpioMux[pin].reg) = ((uint32_t)2 << MCU_SEL_S) | ((uint32_t)2 << FUN_DRV_S) | FUN_IE; - return; - } - - //RTC pins PULL settings - if(rtc_reg) { - //lock rtc - ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_gpio_desc[pin].mux); - if(mode & PULLUP) { - ESP_REG(rtc_reg) = (ESP_REG(rtc_reg) | rtc_gpio_desc[pin].pullup) & ~(rtc_gpio_desc[pin].pulldown); - } else if(mode & PULLDOWN) { - ESP_REG(rtc_reg) = (ESP_REG(rtc_reg) | rtc_gpio_desc[pin].pulldown) & ~(rtc_gpio_desc[pin].pullup); - } else { - ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_gpio_desc[pin].pullup | rtc_gpio_desc[pin].pulldown); - } - //unlock rtc - } - - uint32_t pinFunction = 0, pinControl = 0; - - //lock gpio - if(mode & INPUT) { - if(pin < 32) { - GPIO.enable_w1tc = ((uint32_t)1 << pin); - } else { - GPIO.enable1_w1tc.val = ((uint32_t)1 << (pin - 32)); - } - } else if(mode & OUTPUT) { - if(pin > 33){ - //unlock gpio - return;//pins above 33 can be only inputs - } else if(pin < 32) { - GPIO.enable_w1ts = ((uint32_t)1 << pin); - } else { - GPIO.enable1_w1ts.val = ((uint32_t)1 << (pin - 32)); - } - } - - if(mode & PULLUP) { - pinFunction |= FUN_PU; - } else if(mode & PULLDOWN) { - pinFunction |= FUN_PD; - } - - pinFunction |= ((uint32_t)2 << FUN_DRV_S);//what are the drivers? - pinFunction |= FUN_IE;//input enable but required for output as well? - - if(mode & (INPUT | OUTPUT)) { - pinFunction |= ((uint32_t)2 << MCU_SEL_S); - } else if(mode == SPECIAL) { - pinFunction |= ((uint32_t)(((pin)==1||(pin)==3)?0:1) << MCU_SEL_S); - } else { - pinFunction |= ((uint32_t)(mode >> 5) << MCU_SEL_S); - } - - ESP_REG(DR_REG_IO_MUX_BASE + esp32_gpioMux[pin].reg) = pinFunction; - - if(mode & OPEN_DRAIN) { - pinControl = (1 << GPIO_PIN0_PAD_DRIVER_S); - } - - GPIO.pin[pin].val = pinControl; - //unlock gpio -} - -extern void IRAM_ATTR __digitalWrite(uint8_t pin, uint8_t val) -{ - if(val) { - if(pin < 32) { - GPIO.out_w1ts = ((uint32_t)1 << pin); - } else if(pin < 34) { - GPIO.out1_w1ts.val = ((uint32_t)1 << (pin - 32)); - } - } else { - if(pin < 32) { - GPIO.out_w1tc = ((uint32_t)1 << pin); - } else if(pin < 34) { - GPIO.out1_w1tc.val = ((uint32_t)1 << (pin - 32)); - } - } -} - -extern int IRAM_ATTR __digitalRead(uint8_t pin) -{ - if(pin < 32) { - return (GPIO.in >> pin) & 0x1; - } else if(pin < 40) { - return (GPIO.in1.val >> (pin - 32)) & 0x1; - } - return 0; -} - -static intr_handle_t gpio_intr_handle = NULL; - -static void IRAM_ATTR __onPinInterrupt() -{ - uint32_t gpio_intr_status_l=0; - uint32_t gpio_intr_status_h=0; - - gpio_intr_status_l = GPIO.status; - gpio_intr_status_h = GPIO.status1.val; - GPIO.status_w1tc = gpio_intr_status_l;//Clear intr for gpio0-gpio31 - GPIO.status1_w1tc.val = gpio_intr_status_h;//Clear intr for gpio32-39 - - uint8_t pin=0; - if(gpio_intr_status_l) { - do { - if(gpio_intr_status_l & ((uint32_t)1 << pin)) { - if(__pinInterruptHandlers[pin].fn) { - if(__pinInterruptHandlers[pin].arg){ - ((voidFuncPtrArg)__pinInterruptHandlers[pin].fn)(__pinInterruptHandlers[pin].arg); - } else { - __pinInterruptHandlers[pin].fn(); - } - } - } - } while(++pin<32); - } - if(gpio_intr_status_h) { - pin=32; - do { - if(gpio_intr_status_h & ((uint32_t)1 << (pin - 32))) { - if(__pinInterruptHandlers[pin].fn) { - if(__pinInterruptHandlers[pin].arg){ - ((voidFuncPtrArg)__pinInterruptHandlers[pin].fn)(__pinInterruptHandlers[pin].arg); - } else { - __pinInterruptHandlers[pin].fn(); - } - } - } - } while(++pin= ARDUHAL_LOG_LEVEL_INFO) && (defined ENABLE_I2C_DEBUG_BUFFER) -#define INTBUFFMAX 64 -#define FIFOMAX 512 -static uint32_t intBuff[INTBUFFMAX][3][2]; -static uint32_t intPos[2]= {0,0}; -static uint16_t fifoBuffer[FIFOMAX]; -static uint16_t fifoPos = 0; -#endif - -// start from tools/sdk/include/soc/soc/i2c_struct.h - -typedef union { - struct { - uint32_t byte_num: 8; /*Byte_num represent the number of data need to be send or data need to be received.*/ - uint32_t ack_en: 1; /*ack_check_en ack_exp and ack value are used to control the ack bit.*/ - uint32_t ack_exp: 1; /*ack_check_en ack_exp and ack value are used to control the ack bit.*/ - uint32_t ack_val: 1; /*ack_check_en ack_exp and ack value are used to control the ack bit.*/ - uint32_t op_code: 3; /*op_code is the command 0:RSTART 1:WRITE 2:READ 3:STOP . 4:END.*/ - uint32_t reserved14: 17; - uint32_t done: 1; /*When command0 is done in I2C Master mode this bit changes to high level.*/ - }; - uint32_t val; -} I2C_COMMAND_t; - -typedef union { - struct { - uint32_t rx_fifo_full_thrhd: 5; - uint32_t tx_fifo_empty_thrhd:5; //Config tx_fifo empty threhd value when using apb fifo access * / - uint32_t nonfifo_en: 1; //Set this bit to enble apb nonfifo access. * / - uint32_t fifo_addr_cfg_en: 1; //When this bit is set to 1 then the byte after address represent the offset address of I2C Slave's ram. * / - uint32_t rx_fifo_rst: 1; //Set this bit to reset rx fifo when using apb fifo access. * / - // chuck while this bit is 1, the RX fifo is held in REST, Toggle it * / - uint32_t tx_fifo_rst: 1; //Set this bit to reset tx fifo when using apb fifo access. * / - // chuck while this bit is 1, the TX fifo is held in REST, Toggle it * / - uint32_t nonfifo_rx_thres: 6; //when I2C receives more than nonfifo_rx_thres data it will produce rx_send_full_int_raw interrupt and update the current offset address of the receiving data.* / - uint32_t nonfifo_tx_thres: 6; //when I2C sends more than nonfifo_tx_thres data it will produce tx_send_empty_int_raw interrupt and update the current offset address of the sending data. * / - uint32_t reserved26: 6; - }; - uint32_t val; -} I2C_FIFO_CONF_t; - -typedef union { - struct { - uint32_t rx_fifo_start_addr: 5; /*This is the offset address of the last receiving data as described in nonfifo_rx_thres_register.*/ - uint32_t rx_fifo_end_addr: 5; /*This is the offset address of the first receiving data as described in nonfifo_rx_thres_register.*/ - uint32_t tx_fifo_start_addr: 5; /*This is the offset address of the first sending data as described in nonfifo_tx_thres register.*/ - uint32_t tx_fifo_end_addr: 5; /*This is the offset address of the last sending data as described in nonfifo_tx_thres register.*/ - uint32_t reserved20: 12; - }; - uint32_t val; - } I2C_FIFO_ST_t; - -// end from tools/sdk/include/soc/soc/i2c_struct.h - -// sync between dispatch(i2cProcQueue) and worker(i2c_isr_handler_default) -typedef enum { - //I2C_NONE=0, - I2C_STARTUP=1, - I2C_RUNNING, - I2C_DONE -} I2C_STAGE_t; - -typedef enum { - I2C_NONE=0, - I2C_MASTER, - I2C_SLAVE, - I2C_MASTERSLAVE -} I2C_MODE_t; - -// internal Error condition -typedef enum { - // I2C_NONE=0, - I2C_OK=1, - I2C_ERROR, - I2C_ADDR_NAK, - I2C_DATA_NAK, - I2C_ARBITRATION, - I2C_TIMEOUT -} I2C_ERROR_t; - -// i2c_event bits for EVENTGROUP bits -// needed to minimize change events, FreeRTOS Daemon overload, so ISR will only set values -// on Exit. Dispatcher will set bits for each dq before/after ISR completion -#define EVENT_ERROR_NAK (BIT(0)) -#define EVENT_ERROR (BIT(1)) -#define EVENT_ERROR_BUS_BUSY (BIT(2)) -#define EVENT_RUNNING (BIT(3)) -#define EVENT_DONE (BIT(4)) -#define EVENT_IN_END (BIT(5)) -#define EVENT_ERROR_PREV (BIT(6)) -#define EVENT_ERROR_TIMEOUT (BIT(7)) -#define EVENT_ERROR_ARBITRATION (BIT(8)) -#define EVENT_ERROR_DATA_NAK (BIT(9)) -#define EVENT_MASK 0x3F - -// control record for each dq entry -typedef union { - struct { - uint32_t addr: 16; // I2C address, if 10bit must have 0x7800 mask applied, else 8bit - uint32_t mode: 1; // transaction direction 0 write, 1 read - uint32_t stop: 1; // sendStop 0 no, 1 yes - uint32_t startCmdSent: 1; // START cmd has been added to command[] - uint32_t addrCmdSent: 1; // addr WRITE cmd has been added to command[] - uint32_t dataCmdSent: 1; // all necessary DATA(READ/WRITE) cmds added to command[] - uint32_t stopCmdSent: 1; // completed all necessary commands - uint32_t addrReq: 2; // number of addr bytes need to send address - uint32_t addrSent: 2; // number of addr bytes added to FIFO - uint32_t reserved_31: 6; - }; - uint32_t val; -} I2C_DATA_CTRL_t; - -// individual dq element -typedef struct { - uint8_t *data; // data pointer for read/write buffer - uint16_t length; // size of data buffer - uint16_t position; // current position for next char in buffer (lock, portMAX_DELAY) != pdPASS) -#define I2C_MUTEX_UNLOCK() xSemaphoreGiveRecursive(i2c->lock) - -static i2c_t _i2c_bus_array[2] = { - {(volatile i2c_dev_t *)(DR_REG_I2C_EXT_BASE_FIXED), NULL, 0, -1, -1, I2C_NONE,I2C_NONE,I2C_ERROR_OK,NULL,NULL,NULL,0,0,0,0,0,0}, - {(volatile i2c_dev_t *)(DR_REG_I2C1_EXT_BASE_FIXED), NULL, 1, -1, -1,I2C_NONE,I2C_NONE,I2C_ERROR_OK,NULL,NULL,NULL,0,0,0,0,0,0} -}; -#endif - -/* - * index - command index (0 to 15) - * op_code - is the command - * byte_num - This register is to store the amounts of data that is read and written. byte_num in RSTART, STOP, END is null. - * ack_val - Each data byte is terminated by an ACK bit used to set the bit level. - * ack_exp - This bit is to set an expected ACK value for the transmitter. - * ack_check - This bit is to decide whether the transmitter checks ACK bit. 1 means yes and 0 means no. - * */ - - -/* Stickbreaker ISR mode debug support - */ -static void IRAM_ATTR i2cDumpCmdQueue(i2c_t *i2c) -{ -#if (ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_ERROR)&&(defined ENABLE_I2C_DEBUG_BUFFER) - static const char * const cmdName[] ={"RSTART","WRITE","READ","STOP","END"}; - uint8_t i=0; - while(i<16) { - I2C_COMMAND_t c; - c.val=i2c->dev->command[i].val; - log_e("[%2d]\t%c\t%s\tval[%d]\texp[%d]\ten[%d]\tbytes[%d]",i,(c.done?'Y':'N'), - cmdName[c.op_code], - c.ack_val, - c.ack_exp, - c.ack_en, - c.byte_num); - i++; - } -#endif -} - -/* Stickbreaker ISR mode debug support - */ -#if (ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO) -static void i2cDumpDqData(i2c_t * i2c) -{ -#if defined (ENABLE_I2C_DEBUG_BUFFER) - uint16_t a=0; - char buff[140]; - I2C_DATA_QUEUE_t *tdq; - int digits=0,lenDigits=0; - a = i2c->queueCount; - while(a>0) { - digits++; - a /= 10; - } - while(aqueueCount) { // find maximum number of len decimal digits for formatting - if (i2c->dq[a].length > lenDigits ) lenDigits = i2c->dq[a].length; - a++; - } - a=0; - while(lenDigits>0){ - a++; - lenDigits /= 10; - } - lenDigits = a; - a = 0; - while(aqueueCount) { - tdq=&i2c->dq[a]; - char buf1[10],buf2[10]; - sprintf(buf1,"%0*d",lenDigits,tdq->length); - sprintf(buf2,"%0*d",lenDigits,tdq->position); - log_i("[%0*d] %sbit %x %c %s buf@=%p, len=%s, pos=%s, ctrl=%d%d%d%d%d",digits,a, - (tdq->ctrl.addr>0x100)?"10":"7", - (tdq->ctrl.addr>0x100)?(((tdq->ctrl.addr&0x600)>>1)|(tdq->ctrl.addr&0xff)):(tdq->ctrl.addr>>1), - (tdq->ctrl.mode)?'R':'W', - (tdq->ctrl.stop)?"STOP":"", - tdq->data, - buf1,buf2, - tdq->ctrl.startCmdSent,tdq->ctrl.addrCmdSent,tdq->ctrl.dataCmdSent,(tdq->ctrl.stop)?tdq->ctrl.stopCmdSent:0,tdq->ctrl.addrSent - ); - uint16_t offset = 0; - while(offsetlength) { - memset(buff,' ',140); - buff[139]='\0'; - uint16_t i = 0,j; - j=sprintf(buff,"0x%04x: ",offset); - while((i<32)&&(offset < tdq->length)) { - char ch = tdq->data[offset]; - sprintf((char*)&buff[(i*3)+41],"%02x ",ch); - if((ch<32)||(ch>126)) { - ch='.'; - } - j+=sprintf((char*)&buff[j],"%c",ch); - buff[j]=' '; - i++; - offset++; - } - log_i("%s",buff); - } - a++; - } -#else - log_i("Debug Buffer not Enabled"); -#endif -} -#endif -#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO -static void i2cDumpI2c(i2c_t * i2c) -{ - log_e("i2c=%p",i2c); - log_i("dev=%p date=%p",i2c->dev,i2c->dev->date); -#if !CONFIG_DISABLE_HAL_LOCKS - log_i("lock=%p",i2c->lock); -#endif - log_i("num=%d",i2c->num); - log_i("mode=%d",i2c->mode); - log_i("stage=%d",i2c->stage); - log_i("error=%d",i2c->error); - log_i("event=%p bits=%x",i2c->i2c_event,(i2c->i2c_event)?xEventGroupGetBits(i2c->i2c_event):0); - log_i("intr_handle=%p",i2c->intr_handle); - log_i("dq=%p",i2c->dq); - log_i("queueCount=%d",i2c->queueCount); - log_i("queuePos=%d",i2c->queuePos); - log_i("errorByteCnt=%d",i2c->errorByteCnt); - log_i("errorQueue=%d",i2c->errorQueue); - log_i("debugFlags=0x%08X",i2c->debugFlags); - if(i2c->dq) { - i2cDumpDqData(i2c); - } -} -#endif - -#if (ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO) -static void i2cDumpInts(uint8_t num) -{ -#if defined (ENABLE_I2C_DEBUG_BUFFER) - uint32_t b; - log_i("%u row\tcount\tINTR\tTX\tRX\tTick ",num); - for(uint32_t a=1; a<=INTBUFFMAX; a++) { - b=(a+intPos[num])%INTBUFFMAX; - if(intBuff[b][0][num]!=0) { - log_i("[%02d]\t0x%04x\t0x%04x\t0x%04x\t0x%04x\t0x%08x",b,((intBuff[b][0][num]>>16)&0xFFFF),(intBuff[b][0][num]&0xFFFF),((intBuff[b][1][num]>>16)&0xFFFF),(intBuff[b][1][num]&0xFFFF),intBuff[b][2][num]); - } - } -#else - log_i("Debug Buffer not Enabled"); -#endif -} -#endif - -#if (ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO)&&(defined ENABLE_I2C_DEBUG_BUFFER) -static void IRAM_ATTR i2cDumpStatus(i2c_t * i2c){ - typedef union { - struct { - uint32_t ack_rec: 1; /*This register stores the value of ACK bit.*/ - uint32_t slave_rw: 1; /*when in slave mode 1:master read slave 0: master write slave.*/ - uint32_t time_out: 1; /*when I2C takes more than time_out_reg clocks to receive a data then this register changes to high level.*/ - uint32_t arb_lost: 1; /*when I2C lost control of SDA line this register changes to high level.*/ - uint32_t bus_busy: 1; /*1:I2C bus is busy transferring data. 0:I2C bus is in idle state.*/ - uint32_t slave_addressed: 1; /*when configured as i2c slave and the address send by master is equal to slave's address then this bit will be high level.*/ - uint32_t byte_trans: 1; /*This register changes to high level when one byte is transferred.*/ - uint32_t reserved7: 1; - uint32_t rx_fifo_cnt: 6; /*This register represent the amount of data need to send.*/ - uint32_t reserved14: 4; - uint32_t tx_fifo_cnt: 6; /*This register stores the amount of received data in ram.*/ - uint32_t scl_main_state_last: 3; /*This register stores the value of state machine for i2c module. 3'h0: SCL_MAIN_IDLE 3'h1: SCL_ADDRESS_SHIFT 3'h2: SCL_ACK_ADDRESS 3'h3: SCL_RX_DATA 3'h4 SCL_TX_DATA 3'h5:SCL_SEND_ACK 3'h6:SCL_WAIT_ACK*/ - uint32_t reserved27: 1; - uint32_t scl_state_last: 3; /*This register stores the value of state machine to produce SCL. 3'h0: SCL_IDLE 3'h1:SCL_START 3'h2:SCL_LOW_EDGE 3'h3: SCL_LOW 3'h4:SCL_HIGH_EDGE 3'h5:SCL_HIGH 3'h6:SCL_STOP*/ - uint32_t reserved31: 1; - }; - uint32_t val; - } status_reg; - - status_reg sr; - sr.val= i2c->dev->status_reg.val; - - log_i("ack(%d) sl_rw(%d) to(%d) arb(%d) busy(%d) sl(%d) trans(%d) rx(%d) tx(%d) sclMain(%d) scl(%d)",sr.ack_rec,sr.slave_rw,sr.time_out,sr.arb_lost,sr.bus_busy,sr.slave_addressed,sr.byte_trans, sr.rx_fifo_cnt, sr.tx_fifo_cnt,sr.scl_main_state_last, sr.scl_state_last); -} -#endif - -#if (ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO)&&(defined ENABLE_I2C_DEBUG_BUFFER) -static void i2cDumpFifo(i2c_t * i2c){ -char buf[64]; -uint16_t k = 0; -uint16_t i = fifoPos+1; - i %=FIFOMAX; -while((fifoBuffer[i]==0)&&(i!=fifoPos)){ - i++; - i %=FIFOMAX; -} -if(i != fifoPos){// actual data - do{ - if(fifoBuffer[i] & 0x8000){ // address byte - if(fifoBuffer[i] & 0x100) { // read - if(fifoBuffer[i] & 0x1) { // valid read dev id - k+= sprintf(&buf[k],"READ 0x%02X",(fifoBuffer[i]&0xff)>>1); - } else { // invalid read dev id - k+= sprintf(&buf[k],"Bad READ 0x%02X",(fifoBuffer[i]&0xff)); - } - } else { // write - if(fifoBuffer[i] & 0x1) { // bad write dev id - k+= sprintf(&buf[k],"bad WRITE 0x%02X",(fifoBuffer[i]&0xff)); - } else { // good Write - k+= sprintf(&buf[k],"WRITE 0x%02X",(fifoBuffer[i]&0xff)>>1); - } - } - } else k += sprintf(&buf[k],"% 4X ",fifoBuffer[i]); - - i++; - i %= FIFOMAX; - bool outBuffer=false; - if( fifoBuffer[i] & 0x8000){ - outBuffer=true; - k=0; - } - if((outBuffer)||(k>50)||(i==fifoPos)) log_i("%s",buf); - outBuffer = false; - if(k>50) { - k=sprintf(buf,"-> "); - } - }while( i!= fifoPos); -} -} -#endif - -static void IRAM_ATTR i2cTriggerDumps(i2c_t * i2c, uint8_t trigger, const char locus[]){ -#if (ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO)&&(defined ENABLE_I2C_DEBUG_BUFFER) - if( trigger ){ - log_i("%s",locus); - if(trigger & 1) i2cDumpI2c(i2c); - if(trigger & 2) i2cDumpInts(i2c->num); - if(trigger & 4) i2cDumpCmdQueue(i2c); - if(trigger & 8) i2cDumpStatus(i2c); - if(trigger & 16) i2cDumpFifo(i2c); - } -#endif -} - // end of debug support routines - -/* Start of CPU Clock change Support -*/ - -static void i2cApbChangeCallback(void * arg, apb_change_ev_t ev_type, uint32_t old_apb, uint32_t new_apb){ - i2c_t* i2c = (i2c_t*) arg; // recover data - if(i2c == NULL) { // point to peripheral control block does not exits - return; - } - uint32_t oldFreq=0; - switch(ev_type){ - case APB_BEFORE_CHANGE : - if(new_apb < 3000000) {// too slow - log_e("apb speed %d too slow",new_apb); - break; - } - I2C_MUTEX_LOCK(); // lock will spin until current transaction is completed - break; - case APB_AFTER_CHANGE : - oldFreq = (i2c->dev->scl_low_period.period+i2c->dev->scl_high_period.period); //read old apbCycles - if(oldFreq>0) { // was configured with value - oldFreq = old_apb / oldFreq; - i2cSetFrequency(i2c,oldFreq); - } - I2C_MUTEX_UNLOCK(); - break; - default : - log_e("unk ev %u",ev_type); - I2C_MUTEX_UNLOCK(); - } - return; -} -/* End of CPU Clock change Support -*/ -static void IRAM_ATTR i2cSetCmd(i2c_t * i2c, uint8_t index, uint8_t op_code, uint8_t byte_num, bool ack_val, bool ack_exp, bool ack_check) -{ - I2C_COMMAND_t cmd; - cmd.val=0; - cmd.ack_en = ack_check; - cmd.ack_exp = ack_exp; - cmd.ack_val = ack_val; - cmd.byte_num = byte_num; - cmd.op_code = op_code; - i2c->dev->command[index].val = cmd.val; -} - - -static void IRAM_ATTR fillCmdQueue(i2c_t * i2c, bool INTS) -{ - /* this function is called on initial i2cProcQueue() or when a I2C_END_DETECT_INT occurs - */ - uint16_t cmdIdx = 0; - uint16_t qp = i2c->queuePos; // all queues before queuePos have been completely processed, - // so look start by checking the 'current queue' so see if it needs commands added to - // hardware peripheral command list. walk through each queue entry until all queues have been - // checked - bool done; - bool needMoreCmds = false; - bool ena_rx=false; // if we add a read op, better enable Rx_Fifo IRQ - bool ena_tx=false; // if we add a Write op, better enable TX_Fifo IRQ - - while(!needMoreCmds&&(qp < i2c->queueCount)) { // check if more possible cmds - if(i2c->dq[qp].ctrl.stopCmdSent) {// marks that all required cmds[] have been added to peripheral - qp++; - } else { - needMoreCmds=true; - } - } - //log_e("needMoreCmds=%d",needMoreCmds); - done=(!needMoreCmds)||(cmdIdx>14); - - while(!done) { // fill the command[] until either 0..14 filled or out of cmds and last cmd is STOP - //CMD START - I2C_DATA_QUEUE_t *tdq=&i2c->dq[qp]; // simpler coding - - if((!tdq->ctrl.startCmdSent) && (cmdIdx < 14)) { // has this dq element's START command been added? - // (cmdIdx<14) because a START op cannot directly precede an END op, else a time out cascade occurs - i2cSetCmd(i2c, cmdIdx++, I2C_CMD_RSTART, 0, false, false, false); - tdq->ctrl.startCmdSent=1; - } - - //CMD WRITE ADDRESS - if((!done)&&(tdq->ctrl.startCmdSent)) { // have to leave room for continue(END), and START must have been sent! - if(!tdq->ctrl.addrCmdSent) { - i2cSetCmd(i2c, cmdIdx++, I2C_CMD_WRITE, tdq->ctrl.addrReq, false, false, true); //load address in cmdlist, validate (low) ack - tdq->ctrl.addrCmdSent=1; - done =(cmdIdx>14); - ena_tx=true; // tx Data necessary - } - } - - /* Can I have another Sir? - ALL CMD queues must be terminated with either END or STOP. - - If END is used, when refilling the cmd[] next time, no entries from END to [15] can be used. - AND the cmd[] must be filled starting at [0] with commands. Either fill all 15 [0]..[14] and leave the - END in [15] or include a STOP in one of the positions [0]..[14]. Any entries after a STOP are IGNORED by the StateMachine. - The END operation does not complete until ctr->trans_start=1 has been issued. - - So, only refill from [0]..[14], leave [15] for a continuation(END) if necessary. - As a corollary, once END exists in [15], you do not need to overwrite it for the - next continuation. It is never modified. But, I update it every time because it might - actually be the first time! - - 23NOV17 START cannot proceed END. if START is in[14], END cannot be in [15]. - So, if END is moved to [14], [14] and [15] can no longer be used for anything other than END. - If a START is found in [14] then a prior READ or WRITE must be expanded so that there is no START element in [14]. - */ - - if((!done)&&(tdq->ctrl.addrCmdSent)) { //room in command[] for at least One data (read/Write) cmd - uint8_t blkSize=0; // max is 255 - while(( tdq->cmdBytesNeeded > tdq->ctrl.mode )&&(!done )) { // more bytes needed and room in cmd queue, leave room for END - blkSize = (tdq->cmdBytesNeeded > 255)?255:(tdq->cmdBytesNeeded - tdq->ctrl.mode); // Last read cmd needs different ACK setting, so leave 1 byte remainder on reads - tdq->cmdBytesNeeded -= blkSize; - if(tdq->ctrl.mode==1) { //read mode - i2cSetCmd(i2c, (cmdIdx)++, I2C_CMD_READ, blkSize,false,false,false); // read cmd, this can't be the last read. - ena_rx=true; // need to enable rxFifo IRQ - } else { // write - i2cSetCmd(i2c, cmdIdx++, I2C_CMD_WRITE, blkSize, false, false, true); // check for Nak - ena_tx=true; // need to enable txFifo IRQ - } - done = cmdIdx>14; //have to leave room for END - } - - if(!done) { // buffer is not filled completely - if((tdq->ctrl.mode==1)&&(tdq->cmdBytesNeeded==1)) { //special last read byte NAK - i2cSetCmd(i2c, (cmdIdx)++, I2C_CMD_READ, 1,true,false,false); - // send NAK to mark end of read - tdq->cmdBytesNeeded=0; - done = cmdIdx > 14; - ena_rx=true; - } - } - - tdq->ctrl.dataCmdSent=(tdq->cmdBytesNeeded==0); // enough command[] to send all data - - if((!done)&&(tdq->ctrl.dataCmdSent)) { // possibly add stop - if(!tdq->ctrl.stopCmdSent){ - if(tdq->ctrl.stop) { //send a stop - i2cSetCmd(i2c, (cmdIdx)++,I2C_CMD_STOP,0,false,false,false); - done = cmdIdx > 14; - } - tdq->ctrl.stopCmdSent = 1; - } - } - } - - if((cmdIdx==14)&&(!tdq->ctrl.startCmdSent)) { - // START would have preceded END, causes SM TIMEOUT - // need to stretch out a prior WRITE or READ to two Command[] elements - done = false; // reuse it - uint16_t i = 13; // start working back until a READ/WRITE has >1 numBytes - cmdIdx =15; - while(!done) { - i2c->dev->command[i+1].val = i2c->dev->command[i].val; // push it down - if (((i2c->dev->command[i].op_code == 1)||(i2c->dev->command[i].op_code==2))) { - /* add a dummy read/write cmd[] with num_bytes set to zero,just a place holder in the cmd[]list - */ - i2c->dev->command[i].byte_num = 0; - done = true; - - } else { - if(i > 0) { - i--; - } else { // unable to stretch, fatal - log_e("invalid CMD[] layout Stretch Failed"); - i2cDumpCmdQueue(i2c); - done = true; - } - } - } - - } - - - if(cmdIdx==15) { //need continuation, even if STOP is in 14, it will not matter - // cmd buffer is almost full, Add END as a continuation feature - i2cSetCmd(i2c, (cmdIdx)++,I2C_CMD_END, 0,false,false,false); - i2c->dev->int_ena.end_detect=1; - i2c->dev->int_clr.end_detect=1; - done = true; - } - - if(!done) { - if(tdq->ctrl.stopCmdSent) { // this queue element has been completely added to command[] buffer - qp++; - if(qp < i2c->queueCount) { - tdq = &i2c->dq[qp]; - } else { - done = true; - } - } - } - - }// while(!done) - if(INTS) { // don't want to prematurely enable fifo ints until ISR is ready to handle them. - if(ena_rx) { - i2c->dev->int_ena.rx_fifo_full = 1; - } - if(ena_tx) { - i2c->dev->int_ena.tx_fifo_empty = 1; - } - } -} - -static void IRAM_ATTR fillTxFifo(i2c_t * i2c) -{ - /* - 12/01/2017 The Fifo's are independent, 32 bytes of tx and 32 bytes of Rx. - overlap is not an issue, just keep them full/empty the status_reg.xx_fifo_cnt - tells the truth. And the INT's fire correctly - */ - uint16_t a=i2c->queuePos; // currently executing dq, - bool full=!(i2c->dev->status_reg.tx_fifo_cnt<31); - uint8_t cnt; - bool rxQueueEncountered = false; - while((a < i2c->queueCount) && !full) { - I2C_DATA_QUEUE_t *tdq = &i2c->dq[a]; - cnt=0; - // add to address to fifo ctrl.addr already has R/W bit positioned correctly - if(tdq->ctrl.addrSent < tdq->ctrl.addrReq) { // need to send address bytes - if(tdq->ctrl.addrReq==2) { //10bit - if(tdq->ctrl.addrSent==0) { //10bit highbyte needs sent - if(!full) { // room in fifo - i2c->dev->fifo_data.val = ((tdq->ctrl.addr>>8)&0xFF); - cnt++; - tdq->ctrl.addrSent=1; //10bit highbyte sent - } - } - full=!(i2c->dev->status_reg.tx_fifo_cnt<31); - - if(tdq->ctrl.addrSent==1) { //10bit Lowbyte needs sent - if(!full) { // room in fifo - i2c->dev->fifo_data.val = tdq->ctrl.addr&0xFF; - cnt++; - tdq->ctrl.addrSent=2; //10bit lowbyte sent - } - } - } else { // 7bit} - if(tdq->ctrl.addrSent==0) { // 7bit Lowbyte needs sent - if(!full) { // room in fifo - i2c->dev->fifo_data.val = tdq->ctrl.addr&0xFF; - cnt++; - tdq->ctrl.addrSent=1; // 7bit lowbyte sent -#if (ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO) && (defined ENABLE_I2C_DEBUG_BUFFER) - uint16_t a = 0x8000 | tdq->ctrl.addr | (tdq->ctrl.mode<<8); - fifoBuffer[fifoPos++] = a; - fifoPos %= FIFOMAX; -#endif - } - } - } - } - // add write data to fifo - if(tdq->ctrl.mode==0) { // write - if(tdq->ctrl.addrSent == tdq->ctrl.addrReq) { //address has been sent, is Write Mode! - uint32_t moveCnt = 32 - i2c->dev->status_reg.tx_fifo_cnt; // how much room in txFifo? - while(( moveCnt>0)&&(tdq->position < tdq->length)) { -#if (ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO) && (defined ENABLE_I2C_DEBUG_BUFFER) - fifoBuffer[fifoPos++] = tdq->data[tdq->position]; - fifoPos %= FIFOMAX; -#endif - i2c->dev->fifo_data.val = tdq->data[tdq->position++]; - cnt++; - moveCnt--; - - } - } - } else { // read Queue Encountered, can't update QueuePos past this point, emptyRxfifo will do it - if( ! rxQueueEncountered ) { - rxQueueEncountered = true; - if(a > i2c->queuePos){ - i2c->queuePos = a; - } - } - } -#if (ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO) && (defined ENABLE_I2C_DEBUG_BUFFER) - - // update debug buffer tx counts - cnt += intBuff[intPos[i2c->num]][1][i2c->num]>>16; - intBuff[intPos[i2c->num]][1][i2c->num] = (intBuff[intPos[i2c->num]][1][i2c->num]&0xFFFF)|(cnt<<16); - -#endif - full=!(i2c->dev->status_reg.tx_fifo_cnt<31); - if(!full) { - a++; // check next buffer for address tx, or write data - } - } - - if(a >= i2c->queueCount ) { // disable TX IRQ, all tx Data has been queued - i2c->dev->int_ena.tx_fifo_empty= 0; - } - - i2c->dev->int_clr.tx_fifo_empty=1; -} - - -static void IRAM_ATTR emptyRxFifo(i2c_t * i2c) -{ - uint32_t d, cnt=0, moveCnt; - - moveCnt = i2c->dev->status_reg.rx_fifo_cnt;//no need to check the reg until this many are read - - while((moveCnt > 0)&&(i2c->queuePos < i2c->queueCount)){ // data to move - - I2C_DATA_QUEUE_t *tdq =&i2c->dq[i2c->queuePos]; //short cut - - while((tdq->position >= tdq->length)&&( i2c->queuePos < i2c->queueCount)){ // find were to store - i2c->queuePos++; - tdq = &i2c->dq[i2c->queuePos]; - } - - if(i2c->queuePos >= i2c->queueCount){ // bad stuff, rx data but no place to put it! - log_e("no Storage location for %d",moveCnt); - // discard - while(moveCnt>0){ - d = i2c->dev->fifo_data.val; - moveCnt--; - cnt++; - } - break; - } - - if(tdq->ctrl.mode == 1){ // read command - if(moveCnt > (tdq->length - tdq->position)) { //make sure they go in this dq - // part of these reads go into the next dq - moveCnt = (tdq->length - tdq->position); - } - } else {// error - log_e("RxEmpty(%d) call on TxBuffer? dq=%d",moveCnt,i2c->queuePos); - // discard - while(moveCnt>0){ - d = i2c->dev->fifo_data.val; - moveCnt--; - cnt++; - } - break; - } - - while(moveCnt > 0) { // store data - d = i2c->dev->fifo_data.val; - moveCnt--; - cnt++; - tdq->data[tdq->position++] = (d&0xFF); - } - - moveCnt = i2c->dev->status_reg.rx_fifo_cnt; //any more out there? - } - -#if (ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO)&& (defined ENABLE_I2C_DEBUG_BUFFER) - // update Debug rxCount - cnt += (intBuff[intPos[i2c->num]][1][i2c->num])&0xffFF; - intBuff[intPos[i2c->num]][1][i2c->num] = (intBuff[intPos[i2c->num]][1][i2c->num]&0xFFFF0000)|cnt; -#endif -} - -static void IRAM_ATTR i2cIsrExit(i2c_t * i2c,const uint32_t eventCode,bool Fatal) -{ - - switch(eventCode) { - case EVENT_DONE: - i2c->error = I2C_OK; - break; - case EVENT_ERROR_NAK : - i2c->error =I2C_ADDR_NAK; - break; - case EVENT_ERROR_DATA_NAK : - i2c->error =I2C_DATA_NAK; - break; - case EVENT_ERROR_TIMEOUT : - i2c->error = I2C_TIMEOUT; - break; - case EVENT_ERROR_ARBITRATION: - i2c->error = I2C_ARBITRATION; - break; - default : - i2c->error = I2C_ERROR; - } - uint32_t exitCode = EVENT_DONE | eventCode |(Fatal?EVENT_ERROR:0); - if((i2c->queuePos < i2c->queueCount) && (i2c->dq[i2c->queuePos].ctrl.mode == 1)) { - emptyRxFifo(i2c); // grab last few characters - } - i2c->dev->int_ena.val = 0; // shut down interrupts - i2c->dev->int_clr.val = 0x1FFF; - i2c->stage = I2C_DONE; - i2c->exitCode = exitCode; //true eventcode - - portBASE_TYPE HPTaskAwoken = pdFALSE,xResult; - // try to notify Dispatch we are done, - // else the 50ms time out will recover the APP, just a little slower - HPTaskAwoken = pdFALSE; - xResult = xEventGroupSetBitsFromISR(i2c->i2c_event, exitCode, &HPTaskAwoken); - if(xResult == pdPASS) { - if(HPTaskAwoken==pdTRUE) { - portYIELD_FROM_ISR(); - // log_e("Yield to Higher"); - } - } - -} - -static void IRAM_ATTR i2c_update_error_byte_cnt(i2c_t * i2c) -{ -/* i2c_update_error_byte_cnt 07/18/2018 - Only called after an error has occurred, so, most of the time this function is never used. - This function obliterates the need to interrupt monitor each byte transferred, at high bitrates - the byte interrupts were overwhelming the OS. Spurious Interrupts were being generated. - it updates errorByteCnt, errorQueue. - */ - uint16_t a=0; // start at top of DQ, count how many bytes added to tx fifo, and received from rx_fifo. - int16_t bc = 0; - I2C_DATA_QUEUE_t *tdq; - i2c->errorByteCnt = 0; - while( a < i2c->queueCount){ // add up all bytes loaded into fifo's - tdq = &i2c->dq[a]; - i2c->errorByteCnt += tdq->ctrl.addrSent; - i2c->errorByteCnt += tdq->position; - a++; - } - // now errorByteCnt contains total bytes moved into and out of FIFO's - // but, there may still be bytes waiting in Fifo's - i2c->errorByteCnt -= i2c->dev->status_reg.tx_fifo_cnt; // waiting to go out; - i2c->errorByteCnt += i2c->dev->status_reg.rx_fifo_cnt; // already received -// now walk thru DQ again, find which byte is 'current' - bc = i2c->errorByteCnt; - i2c->errorQueue = 0; - while( i2c->errorQueue < i2c->queueCount ){ - tdq = &i2c->dq[i2c->errorQueue]; - if(bc>0){ // not found yet - if( tdq->ctrl.addrSent >= bc){ // in address - bc = -1; // in address - break; - } else { - bc -= tdq->ctrl.addrSent; - if( tdq->length > bc) { // data nak - break; - } else { // count down - bc -= tdq->length; - } - } - } else break; - - i2c->errorQueue++; - } - - i2c->errorByteCnt = bc; - } - -static void IRAM_ATTR i2c_isr_handler_default(void* arg) -{ - i2c_t* p_i2c = (i2c_t*) arg; // recover data - uint32_t activeInt = p_i2c->dev->int_status.val&0x7FF; - - if(p_i2c->stage==I2C_DONE) { //get Out, can't service, not configured - p_i2c->dev->int_ena.val = 0; - p_i2c->dev->int_clr.val = 0x1FFF; -#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_VERBOSE - uint32_t raw = p_i2c->dev->int_raw.val; - log_w("eject raw=%p, int=%p",raw,activeInt); -#endif - return; - } - while (activeInt != 0) { // Ordering of 'if(activeInt)' statements is important, don't change - - #if (ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO) && (defined ENABLE_I2C_DEBUG_BUFFER) - if(activeInt==(intBuff[intPos[p_i2c->num]][0][p_i2c->num]&0x1fff)) { - intBuff[intPos[p_i2c->num]][0][p_i2c->num] = (((intBuff[intPos[p_i2c->num]][0][p_i2c->num]>>16)+1)<<16)|activeInt; - } else { - intPos[p_i2c->num]++; - intPos[p_i2c->num] %= INTBUFFMAX; - intBuff[intPos[p_i2c->num]][0][p_i2c->num] = (1<<16) | activeInt; - intBuff[intPos[p_i2c->num]][1][p_i2c->num] = 0; - } - - intBuff[intPos[p_i2c->num]][2][p_i2c->num] = xTaskGetTickCountFromISR(); // when IRQ fired - -#endif - - if (activeInt & I2C_TRANS_START_INT_ST_M) { - if(p_i2c->stage==I2C_STARTUP) { - p_i2c->stage=I2C_RUNNING; - } - - activeInt &=~I2C_TRANS_START_INT_ST_M; - p_i2c->dev->int_ena.trans_start = 1; // already enabled? why Again? - p_i2c->dev->int_clr.trans_start = 1; // so that will trigger after next 'END' - } - - if (activeInt & I2C_TXFIFO_EMPTY_INT_ST) {//should this be before Trans_start? - fillTxFifo(p_i2c); //fillTxFifo will enable/disable/clear interrupt - activeInt&=~I2C_TXFIFO_EMPTY_INT_ST; - } - - if(activeInt & I2C_RXFIFO_FULL_INT_ST) { - emptyRxFifo(p_i2c); - p_i2c->dev->int_clr.rx_fifo_full=1; - p_i2c->dev->int_ena.rx_fifo_full=1; //why? - - activeInt &=~I2C_RXFIFO_FULL_INT_ST; - } - - if (activeInt & I2C_ACK_ERR_INT_ST_M) {//fatal error, abort i2c service - if (p_i2c->mode == I2C_MASTER) { - i2c_update_error_byte_cnt(p_i2c); // calc which byte caused ack Error, check if address or data - if(p_i2c->errorByteCnt < 0 ) { // address - i2cIsrExit(p_i2c,EVENT_ERROR_NAK,true); - } else { - i2cIsrExit(p_i2c,EVENT_ERROR_DATA_NAK,true); //data - } - } - return; - } - - if (activeInt & I2C_TIME_OUT_INT_ST_M) { - // let Gross timeout occur, Slave may release SCL before the configured timeout expires - // the Statemachine only has a 13.1ms max timout, some Devices >500ms - p_i2c->dev->int_clr.time_out =1; - activeInt &=~I2C_TIME_OUT_INT_ST; - // since a timeout occurred, capture the rxFifo data - emptyRxFifo(p_i2c); - p_i2c->dev->int_clr.rx_fifo_full=1; - p_i2c->dev->int_ena.rx_fifo_full=1; //why? - - } - - if (activeInt & I2C_TRANS_COMPLETE_INT_ST_M) { - p_i2c->dev->int_clr.trans_complete = 1; - i2cIsrExit(p_i2c,EVENT_DONE,false); - return; // no more work to do - /* - // how does slave mode act? - if (p_i2c->mode == I2C_SLAVE) { // STOP detected - // empty fifo - // dispatch callback - */ - } - - if (activeInt & I2C_ARBITRATION_LOST_INT_ST_M) { //fatal - i2cIsrExit(p_i2c,EVENT_ERROR_ARBITRATION,true); - return; // no more work to do - } - - if (activeInt & I2C_SLAVE_TRAN_COMP_INT_ST_M) { - p_i2c->dev->int_clr.slave_tran_comp = 1; - // need to complete this ! - } - - if (activeInt & I2C_END_DETECT_INT_ST_M) { - p_i2c->dev->int_ena.end_detect = 0; - p_i2c->dev->int_clr.end_detect = 1; - p_i2c->dev->ctr.trans_start=0; - fillCmdQueue(p_i2c,true); // enable interrupts - p_i2c->dev->ctr.trans_start=1; // go for it - activeInt&=~I2C_END_DETECT_INT_ST_M; - } - - if(activeInt) { // clear unhandled if possible? What about Disabling interrupt? - p_i2c->dev->int_clr.val = activeInt; - log_e("unknown int=%x",activeInt); - // disable unhandled IRQ, - p_i2c->dev->int_ena.val = p_i2c->dev->int_ena.val & (~activeInt); - } - -// activeInt = p_i2c->dev->int_status.val; // start all over if another interrupt happened -// 01AUG2018 if another interrupt happened, the OS will schedule another interrupt -// this is the source of spurious interrupts - } -} - -/* Stickbreaker added for ISR 11/2017 -functional with Silicon date=0x16042000 - */ -static i2c_err_t i2cAddQueue(i2c_t * i2c,uint8_t mode, uint16_t i2cDeviceAddr, uint8_t *dataPtr, uint16_t dataLen,bool sendStop, bool dataOnly, EventGroupHandle_t event) -{ - // need to grab a MUTEX for exclusive Queue, - // what about if ISR is running? - - if(i2c==NULL) { - return I2C_ERROR_DEV; - } - - I2C_DATA_QUEUE_t dqx; - dqx.data = dataPtr; - dqx.length = dataLen; - dqx.position = 0; - dqx.cmdBytesNeeded = dataLen; - dqx.ctrl.val = 0; - if( dataOnly) { - /* special case to add a queue data only element. - START and devAddr will not be sent, this dq element can have a STOP. - allows multiple buffers to be used for one transaction. - sequence: normal transaction(sendStop==false), [dataonly(sendStop==false)],dataOnly(sendStop==true) - *** Currently only works with WRITE, final byte NAK an READ will cause a fail between dq buffer elements. (in progress 30JUL2018) - */ - dqx.ctrl.startCmdSent = 1; // mark as already sent - dqx.ctrl.addrCmdSent = 1; - } else { - dqx.ctrl.addrReq = ((i2cDeviceAddr&0xFC00)==0x7800)?2:1; // 10bit or 7bit address - } - dqx.ctrl.addr = i2cDeviceAddr; - dqx.ctrl.mode = mode; - dqx.ctrl.stop= sendStop; - dqx.queueEvent = event; - - if(event) { // an eventGroup exist, so, initialize it - xEventGroupClearBits(event, EVENT_MASK); // all of them - } - - if(i2c->dq!=NULL) { // expand - //log_i("expand"); - I2C_DATA_QUEUE_t* tq =(I2C_DATA_QUEUE_t*)realloc(i2c->dq,sizeof(I2C_DATA_QUEUE_t)*(i2c->queueCount +1)); - if(tq!=NULL) { // ok - i2c->dq = tq; - memmove(&i2c->dq[i2c->queueCount++],&dqx,sizeof(I2C_DATA_QUEUE_t)); - } else { // bad stuff, unable to allocate more memory! - log_e("realloc Failure"); - return I2C_ERROR_MEMORY; - } - } else { // first Time - //log_i("new"); - i2c->queueCount=0; - i2c->dq =(I2C_DATA_QUEUE_t*)malloc(sizeof(I2C_DATA_QUEUE_t)); - if(i2c->dq!=NULL) { - memmove(&i2c->dq[i2c->queueCount++],&dqx,sizeof(I2C_DATA_QUEUE_t)); - } else { - log_e("malloc failure"); - return I2C_ERROR_MEMORY; - } - } - return I2C_ERROR_OK; -} - -i2c_err_t i2cAddQueueWrite(i2c_t * i2c, uint16_t i2cDeviceAddr, uint8_t *dataPtr, uint16_t dataLen,bool sendStop,EventGroupHandle_t event) -{ - return i2cAddQueue(i2c,0,i2cDeviceAddr,dataPtr,dataLen,sendStop,false,event); -} - -i2c_err_t i2cAddQueueRead(i2c_t * i2c, uint16_t i2cDeviceAddr, uint8_t *dataPtr, uint16_t dataLen,bool sendStop,EventGroupHandle_t event) -{ - //10bit read is kind of weird, first you do a 0byte Write with 10bit - // address, then a ReSTART then a 7bit Read using the the upper 7bit + - // readBit. - - // this might cause an internal register pointer problem with 10bit - // devices, But, Don't have any to test against. - // this is the Industry Standard specification. - - if((i2cDeviceAddr &0xFC00)==0x7800) { // ten bit read - i2c_err_t err = i2cAddQueue(i2c,0,i2cDeviceAddr,NULL,0,false,false,event); - if(err==I2C_ERROR_OK) { - return i2cAddQueue(i2c,1,(i2cDeviceAddr>>8),dataPtr,dataLen,sendStop,false,event); - } else { - return err; - } - } - return i2cAddQueue(i2c,1,i2cDeviceAddr,dataPtr,dataLen,sendStop,false,event); -} - -i2c_err_t i2cProcQueue(i2c_t * i2c, uint32_t *readCount, uint16_t timeOutMillis) -{ - /* do the hard stuff here - install ISR if necessary - setup EventGroup - handle bus busy? - */ - //log_e("procQueue i2c=%p",&i2c); - if(readCount){ //total reads accomplished in all queue elements - *readCount = 0; - } - if(i2c == NULL) { - return I2C_ERROR_DEV; - } - if(i2c->debugFlags & 0xff000000) i2cTriggerDumps(i2c,(i2c->debugFlags>>24),"before ProcQueue"); - if (i2c->dev->status_reg.bus_busy) { // return error, let TwoWire() handle resetting the hardware. - /* if multi master then this if should be changed to this 03/12/2018 - if(multiMaster){// try to let the bus clear by its self - uint32_t timeOutTick = millis(); - while((i2c->dev->status_reg.bus_busy)&&(millis()-timeOutTickdev->status_reg.bus_busy){ // still busy, so die - */ - log_i("Bus busy, reinit"); - return I2C_ERROR_BUSY; - } - - I2C_MUTEX_LOCK(); - /* what about co-existence with SLAVE mode? - Should I check if a slaveMode xfer is in progress and hang - until it completes? - if i2c->stage == I2C_RUNNING or I2C_SLAVE_ACTIVE - */ - i2c->stage = I2C_DONE; // until ready - -#if (ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO) && (defined ENABLE_I2C_DEBUG_BUFFER) - for(uint16_t i=0; inum] = 0; - intBuff[i][1][i2c->num] = 0; - intBuff[i][2][i2c->num] = 0; - } - intPos[i2c->num] = 0; - fifoPos = 0; - memset(fifoBuffer,0,FIFOMAX); -#endif - // EventGroup is used to signal transmission completion from ISR - // not always reliable. Sometimes, the FreeRTOS scheduler is maxed out and refuses request - // if that happens, this call hangs until the timeout period expires, then it continues. - if(!i2c->i2c_event) { - i2c->i2c_event = xEventGroupCreate(); - } - if(i2c->i2c_event) { - xEventGroupClearBits(i2c->i2c_event, 0xFF); - } else { // failed to create EventGroup - log_e("eventCreate failed=%p",i2c->i2c_event); - I2C_MUTEX_UNLOCK(); - return I2C_ERROR_MEMORY; - } - - i2c_err_t reason = I2C_ERROR_OK; - i2c->mode = I2C_MASTER; - i2c->dev->ctr.trans_start=0; // Pause Machine - i2c->dev->timeout.tout = 0xFFFFF; // max 13ms - i2c->dev->int_clr.val = 0x1FFF; // kill them All! - - i2c->dev->ctr.ms_mode = 1; // master! - i2c->queuePos=0; - i2c->errorByteCnt=0; - i2c->errorQueue = 0; - uint32_t totalBytes=0; // total number of bytes to be Moved! - // convert address field to required I2C format - while(i2c->queuePos < i2c->queueCount) { // need to push these address modes upstream, to AddQueue - I2C_DATA_QUEUE_t *tdq = &i2c->dq[i2c->queuePos++]; - uint16_t taddr=0; - if(tdq->ctrl.addrReq ==2) { // 10bit address - taddr =((tdq->ctrl.addr >> 7) & 0xFE) - |tdq->ctrl.mode; - taddr = (taddr <<8) | (tdq->ctrl.addr&0xFF); - } else { // 7bit address - taddr = ((tdq->ctrl.addr<<1)&0xFE) - |tdq->ctrl.mode; - } - tdq->ctrl.addr = taddr; // all fixed with R/W bit - totalBytes += tdq->length + tdq->ctrl.addrReq; // total number of byte to be moved! - } - i2c->queuePos=0; - - fillCmdQueue(i2c,false); // don't enable Tx/RX irq's - // start adding command[], END irq will keep it full - //Data Fifo will be filled after trans_start is issued - i2c->exitCode=0; - - I2C_FIFO_CONF_t f; - f.val = i2c->dev->fifo_conf.val; - f.rx_fifo_rst = 1; // fifo in reset - f.tx_fifo_rst = 1; // fifo in reset - f.nonfifo_en = 0; // use fifo mode - f.nonfifo_tx_thres = 31; - // need to adjust threshold based on I2C clock rate, at 100k, 30 usually works, - // sometimes the emptyRx() actually moves 31 bytes - // it hasn't overflowed yet, I cannot tell if the new byte is added while - // emptyRX() is executing or before? - // let i2cSetFrequency() set thrhds - // f.rx_fifo_full_thrhd = 30; // 30 bytes before INT is issued - // f.tx_fifo_empty_thrhd = 0; - f.fifo_addr_cfg_en = 0; // no directed access - i2c->dev->fifo_conf.val = f.val; // post them all - - f.rx_fifo_rst = 0; // release fifo - f.tx_fifo_rst = 0; - i2c->dev->fifo_conf.val = f.val; // post them all - - i2c->stage = I2C_STARTUP; // everything configured, now start the I2C StateMachine, and - // As soon as interrupts are enabled, the ISR will start handling them. - // it should receive a TXFIFO_EMPTY immediately, even before it - // receives the TRANS_START - - - uint32_t interruptsEnabled = - I2C_ACK_ERR_INT_ENA | // (BIT(10)) Causes Fatal Error Exit - I2C_TRANS_START_INT_ENA | // (BIT(9)) Triggered by trans_start=1, initial,END - I2C_TIME_OUT_INT_ENA | //(BIT(8)) Trigger by SLAVE SCL stretching, NOT an ERROR - I2C_TRANS_COMPLETE_INT_ENA | // (BIT(7)) triggered by STOP, successful exit - I2C_ARBITRATION_LOST_INT_ENA | // (BIT(5)) cause fatal error exit - I2C_SLAVE_TRAN_COMP_INT_ENA | // (BIT(4)) unhandled - I2C_END_DETECT_INT_ENA | // (BIT(3)) refills cmd[] list - I2C_RXFIFO_OVF_INT_ENA | //(BIT(2)) unhandled - I2C_TXFIFO_EMPTY_INT_ENA | // (BIT(1)) triggers fillTxFifo() - I2C_RXFIFO_FULL_INT_ENA; // (BIT(0)) trigger emptyRxFifo() - - i2c->dev->int_ena.val = interruptsEnabled; - - if(!i2c->intr_handle) { // create ISR for either peripheral - // log_i("create ISR %d",i2c->num); - uint32_t ret = 0; - uint32_t flags = ESP_INTR_FLAG_IRAM | //< ISR can be called if cache is disabled - ESP_INTR_FLAG_LOWMED | //< Low and medium prio interrupts. These can be handled in C. - ESP_INTR_FLAG_SHARED; //< Reduce resource requirements, Share interrupts - - if(i2c->num) { - ret = esp_intr_alloc_intrstatus(ETS_I2C_EXT1_INTR_SOURCE, flags, (uint32_t)&i2c->dev->int_status.val, interruptsEnabled, &i2c_isr_handler_default,i2c, &i2c->intr_handle); - } else { - ret = esp_intr_alloc_intrstatus(ETS_I2C_EXT0_INTR_SOURCE, flags, (uint32_t)&i2c->dev->int_status.val, interruptsEnabled, &i2c_isr_handler_default,i2c, &i2c->intr_handle); - } - - if(ret!=ESP_OK) { - log_e("install interrupt handler Failed=%d",ret); - I2C_MUTEX_UNLOCK(); - return I2C_ERROR_MEMORY; - } - if( !addApbChangeCallback( i2c, i2cApbChangeCallback)) { - log_e("install apb Callback failed"); - I2C_MUTEX_UNLOCK(); - return I2C_ERROR_DEV; - } - - } - //hang until it completes. - - // how many ticks should it take to transfer totalBytes through the I2C hardware, - // add user supplied timeOutMillis to Calculated Value - - portTickType ticksTimeOut = ((totalBytes*10*1000)/(i2cGetFrequency(i2c))+timeOutMillis)/portTICK_PERIOD_MS; - - i2c->dev->ctr.trans_start=1; // go for it - -#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG - portTickType tBefore=xTaskGetTickCount(); -#endif - - // wait for ISR to complete the transfer, or until timeOut in case of bus fault, hardware problem - - uint32_t eBits = xEventGroupWaitBits(i2c->i2c_event,EVENT_DONE,pdFALSE,pdTRUE,ticksTimeOut); - -#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG - portTickType tAfter=xTaskGetTickCount(); -#endif - - - // if xEventGroupSetBitsFromISR() failed, the ISR could have succeeded but never been - // able to mark the success - - if(i2c->exitCode!=eBits) { // try to recover from O/S failure - // log_e("EventGroup Failed:%p!=%p",eBits,i2c->exitCode); - eBits=i2c->exitCode; - } - if((eBits&EVENT_ERROR)||(!(eBits & EVENT_DONE))){ // need accurate errorByteCnt for debug - i2c_update_error_byte_cnt(i2c); - } - - if(!(eBits==EVENT_DONE)&&(eBits&~(EVENT_ERROR_NAK|EVENT_ERROR_DATA_NAK|EVENT_ERROR|EVENT_DONE))) { // not only Done, therefore error, exclude ADDR NAK, DATA_NAK -#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO - i2cDumpI2c(i2c); - i2cDumpInts(i2c->num); -#endif - } - - if(eBits&EVENT_DONE) { // no gross timeout - switch(i2c->error) { - case I2C_OK : - reason = I2C_ERROR_OK; - break; - case I2C_ERROR : - reason = I2C_ERROR_DEV; - break; - case I2C_ADDR_NAK: - reason = I2C_ERROR_ACK; - break; - case I2C_DATA_NAK: - reason = I2C_ERROR_ACK; - break; - case I2C_ARBITRATION: - reason = I2C_ERROR_BUS; - break; - case I2C_TIMEOUT: - reason = I2C_ERROR_TIMEOUT; - break; - default : - reason = I2C_ERROR_DEV; - } - } else { // GROSS timeout, shutdown ISR , report Timeout - i2c->stage = I2C_DONE; - i2c->dev->int_ena.val =0; - i2c->dev->int_clr.val = 0x1FFF; - i2c_update_error_byte_cnt(i2c); - if((i2c->errorByteCnt == 0)&&(i2c->errorQueue==0)) { // Bus Busy no bytes Moved - reason = I2C_ERROR_BUSY; - eBits = eBits | EVENT_ERROR_BUS_BUSY|EVENT_ERROR|EVENT_DONE; -#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG - log_d(" Busy Timeout start=0x%x, end=0x%x, =%d, max=%d error=%d",tBefore,tAfter,(tAfter-tBefore),ticksTimeOut,i2c->error); - i2cDumpI2c(i2c); - i2cDumpInts(i2c->num); -#endif - } else { // just a timeout, some data made it out or in. - reason = I2C_ERROR_TIMEOUT; - eBits = eBits | EVENT_ERROR_TIMEOUT|EVENT_ERROR|EVENT_DONE; - -#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG - log_d(" Gross Timeout Dead start=0x%x, end=0x%x, =%d, max=%d error=%d",tBefore,tAfter,(tAfter-tBefore),ticksTimeOut,i2c->error); - i2cDumpI2c(i2c); - i2cDumpInts(i2c->num); -#endif - } - } - - /* offloading all EventGroups to dispatch, EventGroups in ISR is not always successful - 11/20/2017 - if error, need to trigger all succeeding dataQueue events with the EVENT_ERROR_PREV - 07/22/2018 - Need to use the queueEvent value to identify transaction blocks, if an error occurs, - all subsequent queue items with the same queueEvent value will receive the EVENT_ERROR_PREV. - But, ProcQue should re-queue queue items that have a different queueEvent value(different transaction) - This change will support multi-thread i2c usage. Use the queueEvent as the transaction event - identifier. - */ - uint32_t b = 0; - - while(b < i2c->queueCount) { - if(i2c->dq[b].ctrl.mode==1 && readCount) { - *readCount += i2c->dq[b].position; // number of data bytes received - } - if(b < i2c->queuePos) { // before any error - if(i2c->dq[b].queueEvent) { // this data queue element has an EventGroup - xEventGroupSetBits(i2c->dq[b].queueEvent,EVENT_DONE); - } - } else if(b == i2c->queuePos) { // last processed queue - if(i2c->dq[b].queueEvent) { // this data queue element has an EventGroup - xEventGroupSetBits(i2c->dq[b].queueEvent,eBits); - } - } else { // never processed queues - if(i2c->dq[b].queueEvent) { // this data queue element has an EventGroup - xEventGroupSetBits(i2c->dq[b].queueEvent,eBits|EVENT_ERROR_PREV); - } - } - b++; - } - if(i2c->debugFlags & 0x00ff0000) i2cTriggerDumps(i2c,(i2c->debugFlags>>16),"after ProcQueue"); - - I2C_MUTEX_UNLOCK(); - return reason; -} - -static void i2cReleaseISR(i2c_t * i2c) -{ - if(i2c->intr_handle) { - esp_intr_free(i2c->intr_handle); - i2c->intr_handle=NULL; - if (!removeApbChangeCallback( i2c, i2cApbChangeCallback)) { - log_e("unable to release apbCallback"); - } - } -} - -static bool i2cCheckLineState(int8_t sda, int8_t scl){ - if(sda < 0 || scl < 0){ - return false;//return false since there is nothing to do - } - // if the bus is not 'clear' try the cycling SCL until SDA goes High or 9 cycles - digitalWrite(sda, HIGH); - digitalWrite(scl, HIGH); - pinMode(sda, PULLUP|OPEN_DRAIN|INPUT); - pinMode(scl, PULLUP|OPEN_DRAIN|OUTPUT); - - if(!digitalRead(sda) || !digitalRead(scl)) { // bus in busy state - log_w("invalid state sda(%d)=%d, scl(%d)=%d", sda, digitalRead(sda), scl, digitalRead(scl)); - digitalWrite(scl, HIGH); - for(uint8_t a=0; a<9; a++) { - delayMicroseconds(5); - digitalWrite(scl, LOW); - delayMicroseconds(5); - digitalWrite(scl, HIGH); - if(digitalRead(sda)){ // bus recovered - log_d("Recovered after %d Cycles",a+1); - break; - } - } - } - - if(!digitalRead(sda) || !digitalRead(scl)) { // bus in busy state - log_e("Bus Invalid State, TwoWire() Can't init sda=%d, scl=%d",digitalRead(sda),digitalRead(scl)); - return false; // bus is busy - } - return true; -} - -i2c_err_t i2cAttachSCL(i2c_t * i2c, int8_t scl) -{ - if(i2c == NULL) { - return I2C_ERROR_DEV; - } - digitalWrite(scl, HIGH); - pinMode(scl, OPEN_DRAIN | PULLUP | INPUT | OUTPUT); - pinMatrixOutAttach(scl, I2C_SCL_IDX(i2c->num), false, false); - pinMatrixInAttach(scl, I2C_SCL_IDX(i2c->num), false); - return I2C_ERROR_OK; -} - -i2c_err_t i2cDetachSCL(i2c_t * i2c, int8_t scl) -{ - if(i2c == NULL) { - return I2C_ERROR_DEV; - } - pinMatrixOutDetach(scl, false, false); - pinMatrixInDetach(I2C_SCL_IDX(i2c->num), false, false); - pinMode(scl, INPUT | PULLUP); - return I2C_ERROR_OK; -} - -i2c_err_t i2cAttachSDA(i2c_t * i2c, int8_t sda) -{ - if(i2c == NULL) { - return I2C_ERROR_DEV; - } - digitalWrite(sda, HIGH); - pinMode(sda, OPEN_DRAIN | PULLUP | INPUT | OUTPUT ); - pinMatrixOutAttach(sda, I2C_SDA_IDX(i2c->num), false, false); - pinMatrixInAttach(sda, I2C_SDA_IDX(i2c->num), false); - return I2C_ERROR_OK; -} - -i2c_err_t i2cDetachSDA(i2c_t * i2c, int8_t sda) -{ - if(i2c == NULL) { - return I2C_ERROR_DEV; - } - pinMatrixOutDetach(sda, false, false); - pinMatrixInDetach(I2C_SDA_IDX(i2c->num), false, false); - pinMode(sda, INPUT | PULLUP); - return I2C_ERROR_OK; -} - -/* - * PUBLIC API - * */ -// 24Nov17 only supports Master Mode -i2c_t * i2cInit(uint8_t i2c_num, int8_t sda, int8_t scl, uint32_t frequency) { -#ifdef ENABLE_I2C_DEBUG_BUFFER - log_v("num=%d sda=%d scl=%d freq=%d",i2c_num, sda, scl, frequency); -#endif - if(i2c_num > 1) { - return NULL; - } - - i2c_t * i2c = &_i2c_bus_array[i2c_num]; - - // pins should be detached, else glitch - if(i2c->sda >= 0){ - i2cDetachSDA(i2c, i2c->sda); - } - if(i2c->scl >= 0){ - i2cDetachSCL(i2c, i2c->scl); - } - i2c->sda = sda; - i2c->scl = scl; - -#if !CONFIG_DISABLE_HAL_LOCKS - if(i2c->lock == NULL) { - i2c->lock = xSemaphoreCreateRecursiveMutex(); - if(i2c->lock == NULL) { - return NULL; - } - } -#endif - I2C_MUTEX_LOCK(); - - i2cReleaseISR(i2c); // ISR exists, release it before disabling hardware - - if(frequency == 0) {// don't change existing frequency - frequency = i2cGetFrequency(i2c); - if(frequency == 0) { - frequency = 100000L; // default to 100khz - } - } - - if(i2c_num == 0) { - DPORT_SET_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG,DPORT_I2C_EXT0_RST); //reset hardware - DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG,DPORT_I2C_EXT0_CLK_EN); - DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG,DPORT_I2C_EXT0_RST);// release reset - } else { - DPORT_SET_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG,DPORT_I2C_EXT1_RST); //reset Hardware - DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG,DPORT_I2C_EXT1_CLK_EN); - DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG,DPORT_I2C_EXT1_RST); - } - i2c->dev->ctr.val = 0; - i2c->dev->ctr.ms_mode = 1; - i2c->dev->ctr.sda_force_out = 1 ; - i2c->dev->ctr.scl_force_out = 1 ; - i2c->dev->ctr.clk_en = 1; - - //the max clock number of receiving a data - i2c->dev->timeout.tout = 400000;//clocks max=1048575 - //disable apb nonfifo access - i2c->dev->fifo_conf.nonfifo_en = 0; - - i2c->dev->slave_addr.val = 0; - I2C_MUTEX_UNLOCK(); - - i2cSetFrequency(i2c, frequency); // reconfigure - - if(!i2cCheckLineState(i2c->sda, i2c->scl)){ - return NULL; - } - - if(i2c->sda >= 0){ - i2cAttachSDA(i2c, i2c->sda); - } - if(i2c->scl >= 0){ - i2cAttachSCL(i2c, i2c->scl); - } - return i2c; -} - -void i2cRelease(i2c_t *i2c) // release all resources, power down peripheral -{ - I2C_MUTEX_LOCK(); - - if(i2c->sda >= 0){ - i2cDetachSDA(i2c, i2c->sda); - } - if(i2c->scl >= 0){ - i2cDetachSCL(i2c, i2c->scl); - } - - i2cReleaseISR(i2c); - - if(i2c->i2c_event) { - vEventGroupDelete(i2c->i2c_event); - i2c->i2c_event = NULL; - } - - i2cFlush(i2c); - - // reset the I2C hardware and shut off the clock, power it down. - if(i2c->num == 0) { - DPORT_SET_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG,DPORT_I2C_EXT0_RST); //reset hardware - DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG,DPORT_I2C_EXT0_CLK_EN); // shutdown hardware - } else { - DPORT_SET_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG,DPORT_I2C_EXT1_RST); //reset Hardware - DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG,DPORT_I2C_EXT1_CLK_EN); // shutdown Hardware - } - - I2C_MUTEX_UNLOCK(); -} - -i2c_err_t i2cFlush(i2c_t * i2c) -{ - if(i2c==NULL) { - return I2C_ERROR_DEV; - } - i2cTriggerDumps(i2c,i2c->debugFlags & 0xff, "FLUSH"); - - // need to grab a MUTEX for exclusive Queue, - // what out if ISR is running? - i2c_err_t rc=I2C_ERROR_OK; - if(i2c->dq!=NULL) { - // log_i("free"); - // what about EventHandle? - free(i2c->dq); - i2c->dq = NULL; - } - i2c->queueCount=0; - i2c->queuePos=0; - // release Mutex - return rc; -} - -i2c_err_t i2cWrite(i2c_t * i2c, uint16_t address, uint8_t* buff, uint16_t size, bool sendStop, uint16_t timeOutMillis){ - if((i2c==NULL)||((size>0)&&(buff==NULL))) { // need to have location to store requested data - return I2C_ERROR_DEV; - } - i2c_err_t last_error = i2cAddQueueWrite(i2c, address, buff, size, sendStop, NULL); - - if(last_error == I2C_ERROR_OK) { //queued - if(sendStop) { //now actually process the queued commands, including READs - last_error = i2cProcQueue(i2c, NULL, timeOutMillis); - if(last_error == I2C_ERROR_BUSY) { // try to clear the bus - if(i2cInit(i2c->num, i2c->sda, i2c->scl, 0)) { - last_error = i2cProcQueue(i2c, NULL, timeOutMillis); - } - } - i2cFlush(i2c); - } else { // stop not received, so wait for I2C stop, - last_error = I2C_ERROR_CONTINUE; - } - } - return last_error; -} - -i2c_err_t i2cRead(i2c_t * i2c, uint16_t address, uint8_t* buff, uint16_t size, bool sendStop, uint16_t timeOutMillis, uint32_t *readCount){ - if((size == 0)||(i2c == NULL)||(buff==NULL)){ // hardware will hang if no data requested on READ - return I2C_ERROR_DEV; - } - i2c_err_t last_error=i2cAddQueueRead(i2c, address, buff, size, sendStop, NULL); - - if(last_error == I2C_ERROR_OK) { //queued - if(sendStop) { //now actually process the queued commands, including READs - last_error = i2cProcQueue(i2c, readCount, timeOutMillis); - if(last_error == I2C_ERROR_BUSY) { // try to clear the bus - if(i2cInit(i2c->num, i2c->sda, i2c->scl, 0)) { - last_error = i2cProcQueue(i2c, readCount, timeOutMillis); - } - } - i2cFlush(i2c); - } else { // stop not received, so wait for I2C stop, - last_error = I2C_ERROR_CONTINUE; - } - } - return last_error; -} - -#define MIN_I2C_CLKS 100 // minimum ratio between cpu and i2c Bus clocks -#define INTERRUPT_CYCLE_OVERHEAD 16000 // number of cpu clocks necessary to respond to interrupt -i2c_err_t i2cSetFrequency(i2c_t * i2c, uint32_t clk_speed) -{ - if(i2c == NULL) { - return I2C_ERROR_DEV; - } - uint32_t apb = getApbFrequency(); - uint32_t period = (apb/clk_speed) / 2; - - if((apb/8192 > clk_speed)||(apb/MIN_I2C_CLKS < clk_speed)){ //out of bounds - log_d("i2c freq(%d) out of bounds.vs APB Clock(%d), min=%d, max=%d",clk_speed,apb,(apb/8192),(apb/MIN_I2C_CLKS)); - } - if(period < (MIN_I2C_CLKS/2) ){ - period = (MIN_I2C_CLKS/2); - clk_speed = apb/(period*2); - log_d("APB Freq too slow, Reducing i2c Freq to %d Hz",clk_speed); - } else if ( period> 4095) { - period = 4095; - clk_speed = apb/(period*2); - log_d("APB Freq too fast, Increasing i2c Freq to %d Hz",clk_speed); - } -#ifdef ENABLE_I2C_DEBUG_BUFFER - log_v("freq=%dHz",clk_speed); -#endif - uint32_t halfPeriod = period/2; - uint32_t quarterPeriod = period/4; - - I2C_MUTEX_LOCK(); - - I2C_FIFO_CONF_t f; - - f.val = i2c->dev->fifo_conf.val; -/* Adjust Fifo thresholds based on differential between cpu frequency and bus clock. - The fifo_delta is calculated such that at least INTERRUPT_CYCLE_OVERHEAD cpu clocks are - available when a Fifo interrupt is triggered. This allows enough room in the Fifo so that - interrupt latency does not cause a Fifo overflow/underflow event. -*/ -#ifdef ENABLE_I2C_DEBUG_BUFFER - log_v("cpu Freq=%dMhz, i2c Freq=%dHz",getCpuFrequencyMhz(),clk_speed); -#endif - uint32_t fifo_delta = (INTERRUPT_CYCLE_OVERHEAD/((getCpuFrequencyMhz()*1000000 / clk_speed)*10))+1; - if (fifo_delta > 24) fifo_delta=24; - f.rx_fifo_full_thrhd = 32 - fifo_delta; - f.tx_fifo_empty_thrhd = fifo_delta; - i2c->dev->fifo_conf.val = f.val; // set thresholds -#ifdef ENABLE_I2C_DEBUG_BUFFER - log_v("Fifo delta=%d",fifo_delta); -#endif - //the clock num during SCL is low level - i2c->dev->scl_low_period.period = period; - //the clock num during SCL is high level - i2c->dev->scl_high_period.period = period; - - //the clock num between the negedge of SDA and negedge of SCL for start mark - i2c->dev->scl_start_hold.time = halfPeriod; - //the clock num between the posedge of SCL and the negedge of SDA for restart mark - i2c->dev->scl_rstart_setup.time = halfPeriod; - - //the clock num after the STOP bit's posedge - i2c->dev->scl_stop_hold.time = halfPeriod; - //the clock num between the posedge of SCL and the posedge of SDA - i2c->dev->scl_stop_setup.time = halfPeriod; - - //the clock num I2C used to hold the data after the negedge of SCL. - i2c->dev->sda_hold.time = quarterPeriod; - //the clock num I2C used to sample data on SDA after the posedge of SCL - i2c->dev->sda_sample.time = quarterPeriod; - I2C_MUTEX_UNLOCK(); - return I2C_ERROR_OK; -} - -uint32_t i2cGetFrequency(i2c_t * i2c) -{ - if(i2c == NULL) { - return 0; - } - uint32_t result = 0; - uint32_t old_count = (i2c->dev->scl_low_period.period+i2c->dev->scl_high_period.period); - if(old_count>0) { - result = getApbFrequency() / old_count; - } else { - result = 0; - } - return result; -} - - -uint32_t i2cDebug(i2c_t * i2c, uint32_t setBits, uint32_t resetBits){ - if(i2c != NULL) { - i2c->debugFlags = ((i2c->debugFlags | setBits) & ~resetBits); - return i2c->debugFlags; - } - return 0; - - } - -uint32_t i2cGetStatus(i2c_t * i2c){ - if(i2c != NULL){ - return i2c->dev->status_reg.val; - } - else return 0; -} - - -/* todo - 22JUL18 - need to add multi-thread capability, use dq.queueEvent as the group marker. When multiple threads - transactions are present in the same queue, and an error occurs, abort all succeeding unserviced transactions - with the same dq.queueEvent value. Succeeding unserviced transactions with different dq.queueEvent values - can be re-queued and processed independently. - 30JUL18 complete data only queue elements, this will allow transfers to use multiple data blocks, - */ - diff --git a/cores/esp32/esp32-hal-i2c.h b/cores/esp32/esp32-hal-i2c.h deleted file mode 100644 index 1a696aca7d6..00000000000 --- a/cores/esp32/esp32-hal-i2c.h +++ /dev/null @@ -1,82 +0,0 @@ -// 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. -// modified Nov 2017 by Chuck Todd to support Interrupt Driven I/O - -#ifndef _ESP32_HAL_I2C_H_ -#define _ESP32_HAL_I2C_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include "freertos/FreeRTOS.h" -#include "freertos/event_groups.h" - -// External Wire.h equivalent error Codes -typedef enum { - I2C_ERROR_OK=0, - I2C_ERROR_DEV, - I2C_ERROR_ACK, - I2C_ERROR_TIMEOUT, - I2C_ERROR_BUS, - I2C_ERROR_BUSY, - I2C_ERROR_MEMORY, - I2C_ERROR_CONTINUE, - I2C_ERROR_NO_BEGIN -} i2c_err_t; - -struct i2c_struct_t; -typedef struct i2c_struct_t i2c_t; - -i2c_t * i2cInit(uint8_t i2c_num, int8_t sda, int8_t scl, uint32_t clk_speed); -void i2cRelease(i2c_t *i2c); // free ISR, Free DQ, Power off peripheral clock. Must call i2cInit() to recover -i2c_err_t i2cWrite(i2c_t * i2c, uint16_t address, uint8_t* buff, uint16_t size, bool sendStop, uint16_t timeOutMillis); -i2c_err_t i2cRead(i2c_t * i2c, uint16_t address, uint8_t* buff, uint16_t size, bool sendStop, uint16_t timeOutMillis, uint32_t *readCount); -i2c_err_t i2cFlush(i2c_t *i2c); -i2c_err_t i2cSetFrequency(i2c_t * i2c, uint32_t clk_speed); -uint32_t i2cGetFrequency(i2c_t * i2c); -uint32_t i2cGetStatus(i2c_t * i2c); // Status register of peripheral - -//Functions below should be used only if well understood -//Might be deprecated and removed in future -i2c_err_t i2cAttachSCL(i2c_t * i2c, int8_t scl); -i2c_err_t i2cDetachSCL(i2c_t * i2c, int8_t scl); -i2c_err_t i2cAttachSDA(i2c_t * i2c, int8_t sda); -i2c_err_t i2cDetachSDA(i2c_t * i2c, int8_t sda); - -//Stickbreakers ISR Support -i2c_err_t i2cProcQueue(i2c_t *i2c, uint32_t *readCount, uint16_t timeOutMillis); -i2c_err_t i2cAddQueueWrite(i2c_t *i2c, uint16_t i2cDeviceAddr, uint8_t *dataPtr, uint16_t dataLen, bool SendStop, EventGroupHandle_t event); -i2c_err_t i2cAddQueueRead(i2c_t *i2c, uint16_t i2cDeviceAddr, uint8_t *dataPtr, uint16_t dataLen, bool SendStop, EventGroupHandle_t event); - -//stickbreaker debug support -uint32_t i2cDebug(i2c_t *, uint32_t setBits, uint32_t resetBits); -// Debug actions have 3 currently defined locus -// 0xXX------ : at entry of ProcQueue -// 0x--XX---- : at exit of ProcQueue -// 0x------XX : at entry of Flush -// -// bit 0 causes DumpI2c to execute -// bit 1 causes DumpInts to execute -// bit 2 causes DumpCmdqueue to execute -// bit 3 causes DumpStatus to execute -// bit 4 causes DumpFifo to execute - -#ifdef __cplusplus -} -#endif - -#endif /* _ESP32_HAL_I2C_H_ */ diff --git a/cores/esp32/esp32-hal-ledc.c b/cores/esp32/esp32-hal-ledc.c deleted file mode 100644 index 336d1efbb6b..00000000000 --- a/cores/esp32/esp32-hal-ledc.c +++ /dev/null @@ -1,270 +0,0 @@ -// 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. - -#include "esp32-hal.h" -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "freertos/semphr.h" -#include "rom/ets_sys.h" -#include "esp32-hal-matrix.h" -#include "soc/dport_reg.h" -#include "soc/ledc_reg.h" -#include "soc/ledc_struct.h" - -#if CONFIG_DISABLE_HAL_LOCKS -#define LEDC_MUTEX_LOCK() -#define LEDC_MUTEX_UNLOCK() -#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; -#endif - -/* - * LEDC Chan to Group/Channel/Timer Mapping -** ledc: 0 => Group: 0, Channel: 0, Timer: 0 -** ledc: 1 => Group: 0, Channel: 1, Timer: 0 -** ledc: 2 => Group: 0, Channel: 2, Timer: 1 -** ledc: 3 => Group: 0, Channel: 3, Timer: 1 -** ledc: 4 => Group: 0, Channel: 4, Timer: 2 -** ledc: 5 => Group: 0, Channel: 5, Timer: 2 -** ledc: 6 => Group: 0, Channel: 6, Timer: 3 -** ledc: 7 => Group: 0, Channel: 7, Timer: 3 -** ledc: 8 => Group: 1, Channel: 0, Timer: 0 -** ledc: 9 => Group: 1, Channel: 1, Timer: 0 -** ledc: 10 => Group: 1, Channel: 2, Timer: 1 -** ledc: 11 => Group: 1, Channel: 3, Timer: 1 -** ledc: 12 => Group: 1, Channel: 4, Timer: 2 -** ledc: 13 => Group: 1, Channel: 5, Timer: 2 -** 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){ - uint32_t iarg = (uint32_t)arg; - uint8_t chan = iarg; - uint8_t group=(chan/8), timer=((chan/2)%4); - old_apb /= 1000000; - new_apb /= 1000000; - 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){ - new_apb = REF_CLK_FREQ / 1000000; - div_num = (new_apb * 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(); - } - } -} - -//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; - if(!tHasStarted) { - tHasStarted = true; - DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_LEDC_CLK_EN); - DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_LEDC_RST); - LEDC.conf.apb_clk_sel = 1;//LS use apb clock -#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(group) { - LEDC_TIMER(group, timer).conf.low_speed_update = 1;//This bit is only useful for low speed timer channels, reserved for high speed timers - } - 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(); - uint32_t iarg = chan; - addApbChangeCallback((void*)iarg, _on_apb_change); -} - -//max div_num 0x3FFFF (262143) -//max bit_num 0x1F (31) -static double _ledcSetupTimerFreq(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 - } - _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(group) { - LEDC_CHAN(group, channel).conf0.low_speed_update = 1; - } else { - LEDC_CHAN(group, channel).conf0.clk_en = 0; - } - LEDC_MUTEX_UNLOCK(); -} - -double ledcSetup(uint8_t chan, double freq, uint8_t bit_num) -{ - if(chan > 15) { - return 0; - } - double res_freq = _ledcSetupTimerFreq(chan, freq, bit_num); - _ledcSetupChannel(chan, LOW); - return res_freq; -} - -void ledcWrite(uint8_t chan, uint32_t duty) -{ - if(chan > 15) { - 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(group) { - LEDC_CHAN(group, channel).conf0.low_speed_update = 1; - } else { - LEDC_CHAN(group, channel).conf0.clk_en = 1; - } - } 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(group) { - LEDC_CHAN(group, channel).conf0.low_speed_update = 1; - } else { - LEDC_CHAN(group, channel).conf0.clk_en = 0; - } - } - LEDC_MUTEX_UNLOCK(); -} - -uint32_t ledcRead(uint8_t chan) -{ - if(chan > 15) { - return 0; - } - return LEDC.channel_group[chan/8].channel[chan%8].duty.duty >> 4; -} - -double ledcReadFreq(uint8_t chan) -{ - if(!ledcRead(chan)){ - return 0; - } - return _ledcTimerRead(chan); -} - -double ledcWriteTone(uint8_t chan, double freq) -{ - if(chan > 15) { - return 0; - } - if(!freq) { - ledcWrite(chan, 0); - return 0; - } - double res_freq = _ledcSetupTimerFreq(chan, freq, 10); - ledcWrite(chan, 0x1FF); - return res_freq; -} - -double ledcWriteNote(uint8_t chan, note_t note, uint8_t octave){ - const uint16_t noteFrequencyBase[12] = { - // C C# D Eb E F F# G G# A Bb B - 4186, 4435, 4699, 4978, 5274, 5588, 5920, 6272, 6645, 7040, 7459, 7902 - }; - - if(octave > 8 || note >= NOTE_MAX){ - return 0; - } - double noteFreq = (double)noteFrequencyBase[note] / (double)(1 << (8-octave)); - return ledcWriteTone(chan, noteFreq); -} - -void ledcAttachPin(uint8_t pin, uint8_t chan) -{ - if(chan > 15) { - return; - } - pinMode(pin, OUTPUT); - pinMatrixOutAttach(pin, ((chan/8)?LEDC_LS_SIG_OUT0_IDX:LEDC_HS_SIG_OUT0_IDX) + (chan%8), false, false); -} - -void ledcDetachPin(uint8_t pin) -{ - pinMatrixOutDetach(pin, false, false); -} diff --git a/cores/esp32/esp32-hal-ledc.h b/cores/esp32/esp32-hal-ledc.h deleted file mode 100644 index 159f98d5351..00000000000 --- a/cores/esp32/esp32-hal-ledc.h +++ /dev/null @@ -1,44 +0,0 @@ -// 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. - -#ifndef _ESP32_HAL_LEDC_H_ -#define _ESP32_HAL_LEDC_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -typedef enum { - NOTE_C, NOTE_Cs, NOTE_D, NOTE_Eb, NOTE_E, NOTE_F, NOTE_Fs, NOTE_G, NOTE_Gs, NOTE_A, NOTE_Bb, NOTE_B, NOTE_MAX -} note_t; - -//channel 0-15 resolution 1-16bits freq limits depend on resolution -double ledcSetup(uint8_t channel, double freq, uint8_t resolution_bits); -void ledcWrite(uint8_t channel, uint32_t duty); -double ledcWriteTone(uint8_t channel, double freq); -double ledcWriteNote(uint8_t channel, note_t note, uint8_t octave); -uint32_t ledcRead(uint8_t channel); -double ledcReadFreq(uint8_t channel); -void ledcAttachPin(uint8_t pin, uint8_t channel); -void ledcDetachPin(uint8_t pin); - - -#ifdef __cplusplus -} -#endif - -#endif /* _ESP32_HAL_LEDC_H_ */ diff --git a/cores/esp32/esp32-hal-log.h b/cores/esp32/esp32-hal-log.h deleted file mode 100644 index e1d4e56f3bb..00000000000 --- a/cores/esp32/esp32-hal-log.h +++ /dev/null @@ -1,158 +0,0 @@ -// 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. -#ifndef __ARDUHAL_LOG_H__ -#define __ARDUHAL_LOG_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include "sdkconfig.h" - -#define ARDUHAL_LOG_LEVEL_NONE (0) -#define ARDUHAL_LOG_LEVEL_ERROR (1) -#define ARDUHAL_LOG_LEVEL_WARN (2) -#define ARDUHAL_LOG_LEVEL_INFO (3) -#define ARDUHAL_LOG_LEVEL_DEBUG (4) -#define ARDUHAL_LOG_LEVEL_VERBOSE (5) - -#ifndef CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL -#define CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL ARDUHAL_LOG_LEVEL_NONE -#endif - -#ifndef CORE_DEBUG_LEVEL -#define ARDUHAL_LOG_LEVEL CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL -#else -#define ARDUHAL_LOG_LEVEL CORE_DEBUG_LEVEL -#endif - -#ifndef CONFIG_ARDUHAL_LOG_COLORS -#define CONFIG_ARDUHAL_LOG_COLORS 0 -#endif - -#if CONFIG_ARDUHAL_LOG_COLORS -#define ARDUHAL_LOG_COLOR_BLACK "30" -#define ARDUHAL_LOG_COLOR_RED "31" //ERROR -#define ARDUHAL_LOG_COLOR_GREEN "32" //INFO -#define ARDUHAL_LOG_COLOR_YELLOW "33" //WARNING -#define ARDUHAL_LOG_COLOR_BLUE "34" -#define ARDUHAL_LOG_COLOR_MAGENTA "35" -#define ARDUHAL_LOG_COLOR_CYAN "36" //DEBUG -#define ARDUHAL_LOG_COLOR_GRAY "37" //VERBOSE -#define ARDUHAL_LOG_COLOR_WHITE "38" - -#define ARDUHAL_LOG_COLOR(COLOR) "\033[0;" COLOR "m" -#define ARDUHAL_LOG_BOLD(COLOR) "\033[1;" COLOR "m" -#define ARDUHAL_LOG_RESET_COLOR "\033[0m" - -#define ARDUHAL_LOG_COLOR_E ARDUHAL_LOG_COLOR(ARDUHAL_LOG_COLOR_RED) -#define ARDUHAL_LOG_COLOR_W ARDUHAL_LOG_COLOR(ARDUHAL_LOG_COLOR_YELLOW) -#define ARDUHAL_LOG_COLOR_I ARDUHAL_LOG_COLOR(ARDUHAL_LOG_COLOR_GREEN) -#define ARDUHAL_LOG_COLOR_D ARDUHAL_LOG_COLOR(ARDUHAL_LOG_COLOR_CYAN) -#define ARDUHAL_LOG_COLOR_V ARDUHAL_LOG_COLOR(ARDUHAL_LOG_COLOR_GRAY) -#else -#define ARDUHAL_LOG_COLOR_E -#define ARDUHAL_LOG_COLOR_W -#define ARDUHAL_LOG_COLOR_I -#define ARDUHAL_LOG_COLOR_D -#define ARDUHAL_LOG_COLOR_V -#define ARDUHAL_LOG_RESET_COLOR -#endif - -const char * pathToFileName(const char * path); -int log_printf(const char *fmt, ...); - -#define ARDUHAL_SHORT_LOG_FORMAT(letter, format) ARDUHAL_LOG_COLOR_ ## letter format ARDUHAL_LOG_RESET_COLOR "\r\n" -#define ARDUHAL_LOG_FORMAT(letter, format) ARDUHAL_LOG_COLOR_ ## letter "[" #letter "][%s:%u] %s(): " format ARDUHAL_LOG_RESET_COLOR "\r\n", pathToFileName(__FILE__), __LINE__, __FUNCTION__ - -#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_VERBOSE -#define log_v(format, ...) log_printf(ARDUHAL_LOG_FORMAT(V, format), ##__VA_ARGS__) -#define isr_log_v(format, ...) ets_printf(ARDUHAL_LOG_FORMAT(V, format), ##__VA_ARGS__) -#else -#define log_v(format, ...) -#define isr_log_v(format, ...) -#endif - -#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG -#define log_d(format, ...) log_printf(ARDUHAL_LOG_FORMAT(D, format), ##__VA_ARGS__) -#define isr_log_d(format, ...) ets_printf(ARDUHAL_LOG_FORMAT(D, format), ##__VA_ARGS__) -#else -#define log_d(format, ...) -#define isr_log_d(format, ...) -#endif - -#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO -#define log_i(format, ...) log_printf(ARDUHAL_LOG_FORMAT(I, format), ##__VA_ARGS__) -#define isr_log_i(format, ...) ets_printf(ARDUHAL_LOG_FORMAT(I, format), ##__VA_ARGS__) -#else -#define log_i(format, ...) -#define isr_log_i(format, ...) -#endif - -#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_WARN -#define log_w(format, ...) log_printf(ARDUHAL_LOG_FORMAT(W, format), ##__VA_ARGS__) -#define isr_log_w(format, ...) ets_printf(ARDUHAL_LOG_FORMAT(W, format), ##__VA_ARGS__) -#else -#define log_w(format, ...) -#define isr_log_w(format, ...) -#endif - -#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_ERROR -#define log_e(format, ...) log_printf(ARDUHAL_LOG_FORMAT(E, format), ##__VA_ARGS__) -#define isr_log_e(format, ...) ets_printf(ARDUHAL_LOG_FORMAT(E, format), ##__VA_ARGS__) -#else -#define log_e(format, ...) -#define isr_log_e(format, ...) -#endif - -#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_NONE -#define log_n(format, ...) log_printf(ARDUHAL_LOG_FORMAT(E, format), ##__VA_ARGS__) -#define isr_log_n(format, ...) ets_printf(ARDUHAL_LOG_FORMAT(E, format), ##__VA_ARGS__) -#else -#define log_n(format, ...) -#define isr_log_n(format, ...) -#endif - -#include "esp_log.h" - -#ifdef CONFIG_ARDUHAL_ESP_LOG -#undef ESP_LOGE -#undef ESP_LOGW -#undef ESP_LOGI -#undef ESP_LOGD -#undef ESP_LOGV -#undef ESP_EARLY_LOGE -#undef ESP_EARLY_LOGW -#undef ESP_EARLY_LOGI -#undef ESP_EARLY_LOGD -#undef ESP_EARLY_LOGV - -#define ESP_LOGE(tag, ...) log_e(__VA_ARGS__) -#define ESP_LOGW(tag, ...) log_w(__VA_ARGS__) -#define ESP_LOGI(tag, ...) log_i(__VA_ARGS__) -#define ESP_LOGD(tag, ...) log_d(__VA_ARGS__) -#define ESP_LOGV(tag, ...) log_v(__VA_ARGS__) -#define ESP_EARLY_LOGE(tag, ...) isr_log_e(__VA_ARGS__) -#define ESP_EARLY_LOGW(tag, ...) isr_log_w(__VA_ARGS__) -#define ESP_EARLY_LOGI(tag, ...) isr_log_i(__VA_ARGS__) -#define ESP_EARLY_LOGD(tag, ...) isr_log_d(__VA_ARGS__) -#define ESP_EARLY_LOGV(tag, ...) isr_log_v(__VA_ARGS__) -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_LOGGING_H__ */ diff --git a/cores/esp32/esp32-hal-matrix.c b/cores/esp32/esp32-hal-matrix.c deleted file mode 100644 index fb1b498c4c8..00000000000 --- a/cores/esp32/esp32-hal-matrix.c +++ /dev/null @@ -1,47 +0,0 @@ -// 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. - -#include "esp32-hal-matrix.h" -#include "esp_attr.h" -#include "rom/gpio.h" - -#define MATRIX_DETACH_OUT_SIG 0x100 -#define MATRIX_DETACH_IN_LOW_PIN 0x30 -#define MATRIX_DETACH_IN_LOW_HIGH 0x38 - -void IRAM_ATTR pinMatrixOutAttach(uint8_t pin, uint8_t function, bool invertOut, bool invertEnable) -{ - gpio_matrix_out(pin, function, invertOut, invertEnable); -} - -void IRAM_ATTR pinMatrixOutDetach(uint8_t pin, bool invertOut, bool invertEnable) -{ - gpio_matrix_out(pin, MATRIX_DETACH_OUT_SIG, invertOut, invertEnable); -} - -void IRAM_ATTR pinMatrixInAttach(uint8_t pin, uint8_t signal, bool inverted) -{ - gpio_matrix_in(pin, signal, inverted); -} - -void IRAM_ATTR pinMatrixInDetach(uint8_t signal, bool high, bool inverted) -{ - gpio_matrix_in(high?MATRIX_DETACH_IN_LOW_HIGH:MATRIX_DETACH_IN_LOW_PIN, signal, inverted); -} -/* -void IRAM_ATTR intrMatrixAttach(uint32_t source, uint32_t inum){ - intr_matrix_set(PRO_CPU_NUM, source, inum); -} -*/ - diff --git a/cores/esp32/esp32-hal-matrix.h b/cores/esp32/esp32-hal-matrix.h deleted file mode 100644 index 3bc90498d6b..00000000000 --- a/cores/esp32/esp32-hal-matrix.h +++ /dev/null @@ -1,35 +0,0 @@ -// 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. - -#ifndef _ESP32_HAL_MATRIX_H_ -#define _ESP32_HAL_MATRIX_H_ - - -#ifdef __cplusplus -extern "C" { -#endif - -#include "esp32-hal.h" -#include "soc/gpio_sig_map.h" - -void pinMatrixOutAttach(uint8_t pin, uint8_t function, bool invertOut, bool invertEnable); -void pinMatrixOutDetach(uint8_t pin, bool invertOut, bool invertEnable); -void pinMatrixInAttach(uint8_t pin, uint8_t signal, bool inverted); -void pinMatrixInDetach(uint8_t signal, bool high, bool inverted); - -#ifdef __cplusplus -} -#endif - -#endif /* COMPONENTS_ARDUHAL_INCLUDE_ESP32_HAL_MATRIX_H_ */ diff --git a/cores/esp32/esp32-hal-misc.c b/cores/esp32/esp32-hal-misc.c deleted file mode 100644 index ae06edc3378..00000000000 --- a/cores/esp32/esp32-hal-misc.c +++ /dev/null @@ -1,242 +0,0 @@ -// 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. - -#include "sdkconfig.h" -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "esp_attr.h" -#include "nvs_flash.h" -#include "nvs.h" -#include "esp_partition.h" -#include "esp_log.h" -#include "esp_timer.h" -#ifdef CONFIG_APP_ROLLBACK_ENABLE -#include "esp_ota_ops.h" -#endif //CONFIG_APP_ROLLBACK_ENABLE -#ifdef CONFIG_BT_ENABLED -#include "esp_bt.h" -#endif //CONFIG_BT_ENABLED -#include -#include "soc/rtc.h" -#include "soc/rtc_cntl_reg.h" -#include "soc/apb_ctrl_reg.h" -#include "rom/rtc.h" -#include "esp_task_wdt.h" -#include "esp32-hal.h" - -//Undocumented!!! Get chip temperature in Farenheit -//Source: https://github.com/pcbreflux/espressif/blob/master/esp32/arduino/sketchbook/ESP32_int_temp_sensor/ESP32_int_temp_sensor.ino -uint8_t temprature_sens_read(); - -float temperatureRead() -{ - return (temprature_sens_read() - 32) / 1.8; -} - -void yield() -{ - vPortYield(); -} - -#if CONFIG_AUTOSTART_ARDUINO - -extern TaskHandle_t loopTaskHandle; -extern bool loopTaskWDTEnabled; - -void enableLoopWDT(){ - if(loopTaskHandle != NULL){ - if(esp_task_wdt_add(loopTaskHandle) != ESP_OK){ - log_e("Failed to add loop task to WDT"); - } else { - loopTaskWDTEnabled = true; - } - } -} - -void disableLoopWDT(){ - if(loopTaskHandle != NULL && loopTaskWDTEnabled){ - loopTaskWDTEnabled = false; - if(esp_task_wdt_delete(loopTaskHandle) != ESP_OK){ - log_e("Failed to remove loop task from WDT"); - } - } -} - -void feedLoopWDT(){ - esp_err_t err = esp_task_wdt_reset(); - if(err != ESP_OK){ - log_e("Failed to feed WDT! Error: %d", err); - } -} -#endif - -void enableCore0WDT(){ - TaskHandle_t idle_0 = xTaskGetIdleTaskHandleForCPU(0); - if(idle_0 == NULL || esp_task_wdt_add(idle_0) != ESP_OK){ - log_e("Failed to add Core 0 IDLE task to WDT"); - } -} - -void disableCore0WDT(){ - TaskHandle_t idle_0 = xTaskGetIdleTaskHandleForCPU(0); - if(idle_0 == NULL || esp_task_wdt_delete(idle_0) != ESP_OK){ - log_e("Failed to remove Core 0 IDLE task from WDT"); - } -} - -#ifndef CONFIG_FREERTOS_UNICORE -void enableCore1WDT(){ - TaskHandle_t idle_1 = xTaskGetIdleTaskHandleForCPU(1); - if(idle_1 == NULL || esp_task_wdt_add(idle_1) != ESP_OK){ - log_e("Failed to add Core 1 IDLE task to WDT"); - } -} - -void disableCore1WDT(){ - TaskHandle_t idle_1 = xTaskGetIdleTaskHandleForCPU(1); - if(idle_1 == NULL || esp_task_wdt_delete(idle_1) != ESP_OK){ - log_e("Failed to remove Core 1 IDLE task from WDT"); - } -} -#endif - -BaseType_t xTaskCreateUniversal( TaskFunction_t pxTaskCode, - const char * const pcName, - const uint32_t usStackDepth, - void * const pvParameters, - UBaseType_t uxPriority, - TaskHandle_t * const pxCreatedTask, - const BaseType_t xCoreID ){ -#ifndef CONFIG_FREERTOS_UNICORE - if(xCoreID >= 0 && xCoreID < 2) { - return xTaskCreatePinnedToCore(pxTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask, xCoreID); - } else { -#endif - return xTaskCreate(pxTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask); -#ifndef CONFIG_FREERTOS_UNICORE - } -#endif -} - -unsigned long IRAM_ATTR micros() -{ - return (unsigned long) (esp_timer_get_time()); -} - -unsigned long IRAM_ATTR millis() -{ - return (unsigned long) (esp_timer_get_time() / 1000ULL); -} - -void delay(uint32_t ms) -{ - vTaskDelay(ms / portTICK_PERIOD_MS); -} - -void IRAM_ATTR delayMicroseconds(uint32_t us) -{ - uint32_t m = micros(); - if(us){ - uint32_t e = (m + us); - if(m > e){ //overflow - while(micros() > e){ - NOP(); - } - } - while(micros() < e){ - NOP(); - } - } -} - -void initVariant() __attribute__((weak)); -void initVariant() {} - -void init() __attribute__((weak)); -void init() {} - -bool verifyOta() __attribute__((weak)); -bool verifyOta() { return true; } - -#ifdef CONFIG_BT_ENABLED -//overwritten in esp32-hal-bt.c -bool btInUse() __attribute__((weak)); -bool btInUse(){ return false; } -#endif - -void initArduino() -{ -#ifdef CONFIG_APP_ROLLBACK_ENABLE - const esp_partition_t *running = esp_ota_get_running_partition(); - esp_ota_img_states_t ota_state; - if (esp_ota_get_state_partition(running, &ota_state) == ESP_OK) { - if (ota_state == ESP_OTA_IMG_PENDING_VERIFY) { - if (verifyOta()) { - esp_ota_mark_app_valid_cancel_rollback(); - } else { - log_e("OTA verification failed! Start rollback to the previous version ..."); - esp_ota_mark_app_invalid_rollback_and_reboot(); - } - } - } -#endif - //init proper ref tick value for PLL (uncomment if REF_TICK is different than 1MHz) - //ESP_REG(APB_CTRL_PLL_TICK_CONF_REG) = APB_CLK_FREQ / REF_CLK_FREQ - 1; -#ifdef F_CPU - setCpuFrequencyMhz(F_CPU/1000000); -#endif -#if CONFIG_SPIRAM_SUPPORT - psramInit(); -#endif - esp_log_level_set("*", CONFIG_LOG_DEFAULT_LEVEL); - esp_err_t err = nvs_flash_init(); - if(err == ESP_ERR_NVS_NO_FREE_PAGES){ - const esp_partition_t* partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_NVS, NULL); - if (partition != NULL) { - err = esp_partition_erase_range(partition, 0, partition->size); - if(!err){ - err = nvs_flash_init(); - } else { - log_e("Failed to format the broken NVS partition!"); - } - } - } - if(err) { - log_e("Failed to initialize NVS! Error: %u", err); - } -#ifdef CONFIG_BT_ENABLED - if(!btInUse()){ - esp_bt_controller_mem_release(ESP_BT_MODE_BTDM); - } -#endif - init(); - initVariant(); -} - -//used by hal log -const char * IRAM_ATTR pathToFileName(const char * path) -{ - size_t i = 0; - size_t pos = 0; - char * p = (char *)path; - while(*p){ - i++; - if(*p == '/' || *p == '\\'){ - pos = i; - } - p++; - } - return path+pos; -} - diff --git a/cores/esp32/esp32-hal-psram.c b/cores/esp32/esp32-hal-psram.c deleted file mode 100644 index 905cb96a313..00000000000 --- a/cores/esp32/esp32-hal-psram.c +++ /dev/null @@ -1,98 +0,0 @@ - -#include "esp32-hal.h" - -#if CONFIG_SPIRAM_SUPPORT -#include "esp_spiram.h" -#include "soc/efuse_reg.h" -#include "esp_heap_caps.h" - -static volatile bool spiramDetected = false; -static volatile bool spiramFailed = false; - -bool psramInit(){ - if (spiramDetected) { - return true; - } -#ifndef CONFIG_SPIRAM_BOOT_INIT - if (spiramFailed) { - return false; - } - uint32_t chip_ver = REG_GET_FIELD(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_VER_PKG); - uint32_t pkg_ver = chip_ver & 0x7; - if (pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32D2WDQ5 || pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32PICOD2) { - spiramFailed = true; - log_w("PSRAM not supported!"); - return false; - } - esp_spiram_init_cache(); - if (esp_spiram_init() != ESP_OK) { - spiramFailed = true; - log_w("PSRAM init failed!"); - pinMatrixOutDetach(16, false, false); - pinMatrixOutDetach(17, false, false); - return false; - } - if (!esp_spiram_test()) { - spiramFailed = true; - log_e("PSRAM test failed!"); - return false; - } - if (esp_spiram_add_to_heapalloc() != ESP_OK) { - spiramFailed = true; - log_e("PSRAM could not be added to the heap!"); - return false; - } -#endif - spiramDetected = true; - log_d("PSRAM enabled"); - return true; -} - -bool IRAM_ATTR psramFound(){ - return spiramDetected; -} - -void IRAM_ATTR *ps_malloc(size_t size){ - if(!spiramDetected){ - return NULL; - } - return heap_caps_malloc(size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT); -} - -void IRAM_ATTR *ps_calloc(size_t n, size_t size){ - if(!spiramDetected){ - return NULL; - } - return heap_caps_calloc(n, size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT); -} - -void IRAM_ATTR *ps_realloc(void *ptr, size_t size){ - if(!spiramDetected){ - return NULL; - } - return heap_caps_realloc(ptr, size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT); -} - -#else - -bool psramInit(){ - return false; -} - -bool IRAM_ATTR psramFound(){ - return false; -} - -void IRAM_ATTR *ps_malloc(size_t size){ - return NULL; -} - -void IRAM_ATTR *ps_calloc(size_t n, size_t size){ - return NULL; -} - -void IRAM_ATTR *ps_realloc(void *ptr, size_t size){ - return NULL; -} - -#endif diff --git a/cores/esp32/esp32-hal-psram.h b/cores/esp32/esp32-hal-psram.h deleted file mode 100644 index 36acc0a03de..00000000000 --- a/cores/esp32/esp32-hal-psram.h +++ /dev/null @@ -1,33 +0,0 @@ -// 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. - -#ifndef _ESP32_HAL_PSRAM_H_ -#define _ESP32_HAL_PSRAM_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -bool psramInit(); -bool psramFound(); - -void *ps_malloc(size_t size); -void *ps_calloc(size_t n, size_t size); -void *ps_realloc(void *ptr, size_t size); - -#ifdef __cplusplus -} -#endif - -#endif /* _ESP32_HAL_PSRAM_H_ */ diff --git a/cores/esp32/esp32-hal-rmt.c b/cores/esp32/esp32-hal-rmt.c deleted file mode 100644 index 0a614226c29..00000000000 --- a/cores/esp32/esp32-hal-rmt.c +++ /dev/null @@ -1,820 +0,0 @@ -// 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. - -#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/gpio_reg.h" - -#include "esp32-hal-rmt.h" -#include "driver/periph_ctrl.h" - -#include "soc/rmt_struct.h" -#include "esp_intr_alloc.h" - -/** - * Internal macros - */ -#define MAX_CHANNELS 8 -#define MAX_DATA_PER_CHANNEL 64 -#define MAX_DATA_PER_ITTERATION 62 -#define _ABS(a) (a>0?a:-a) -#define _LIMIT(a,b) (a>b?b:a) -#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)) - -#if CONFIG_DISABLE_HAL_LOCKS -# define RMT_MUTEX_LOCK(channel) -# define RMT_MUTEX_UNLOCK(channel) -#else -# define RMT_MUTEX_LOCK(channel) do {} while (xSemaphoreTake(g_rmt_objlocks[channel], portMAX_DELAY) != pdPASS) -# define RMT_MUTEX_UNLOCK(channel) xSemaphoreGive(g_rmt_objlocks[channel]) -#endif /* CONFIG_DISABLE_HAL_LOCKS */ - -#define _RMT_INTERNAL_DEBUG -#ifdef _RMT_INTERNAL_DEBUG -# define DEBUG_INTERRUPT_START(pin) digitalWrite(pin, 1); -# define DEBUG_INTERRUPT_END(pin) digitalWrite(pin, 0); -#else -# define DEBUG_INTERRUPT_START(pin) -# define DEBUG_INTERRUPT_END(pin) -#endif /* _RMT_INTERNAL_DEBUG */ - -/** - * 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; -}; - -/** - * Internal variables for channel descriptors - */ -static xSemaphoreHandle g_rmt_objlocks[MAX_CHANNELS] = { - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL -}; - -static rmt_obj_t g_rmt_objects[MAX_CHANNELS] = { - { false, NULL, 0, 0, 0, 0, 0, NULL, E_NO_INTR, E_INACTIVE, NULL, false}, - { false, NULL, 0, 0, 0, 0, 0, NULL, E_NO_INTR, E_INACTIVE, NULL, false}, - { false, NULL, 0, 0, 0, 0, 0, NULL, E_NO_INTR, E_INACTIVE, NULL, false}, - { false, NULL, 0, 0, 0, 0, 0, NULL, E_NO_INTR, E_INACTIVE, NULL, false}, - { false, NULL, 0, 0, 0, 0, 0, NULL, E_NO_INTR, E_INACTIVE, NULL, false}, - { false, NULL, 0, 0, 0, 0, 0, NULL, E_NO_INTR, E_INACTIVE, NULL, false}, - { false, NULL, 0, 0, 0, 0, 0, NULL, E_NO_INTR, E_INACTIVE, NULL, false}, - { false, NULL, 0, 0, 0, 0, 0, NULL, E_NO_INTR, E_INACTIVE, NULL, false}, -}; - -/** - * 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); - -static void IRAM_ATTR _rmt_isr(void* arg); - -static rmt_obj_t* _rmtAllocate(int pin, int from, int size); - -static void _initPin(int pin, int channel, bool tx_not_rx); - -static int IRAM_ATTR _rmt_get_mem_len(uint8_t channel); - -static void IRAM_ATTR _rmt_tx_mem_first(uint8_t ch); - -static void IRAM_ATTR _rmt_tx_mem_second(uint8_t ch); - - -/** - * 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) { - return false; - } - size_t channel = rmt->channel; - - RMT_MUTEX_LOCK(channel); - - 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; - - RMT_MUTEX_UNLOCK(channel); - - return true; - -} - -bool rmtSetFilter(rmt_obj_t* rmt, bool filter_en, uint32_t filter_level) -{ - if (!rmt || filter_level > 0xFF) { - return false; - } - size_t channel = rmt->channel; - - RMT_MUTEX_LOCK(channel); - - RMT.conf_ch[channel].conf1.rx_filter_thres = filter_level; - RMT.conf_ch[channel].conf1.rx_filter_en = filter_en; - - RMT_MUTEX_UNLOCK(channel); - - return true; - -} - -bool rmtSetRxThreshold(rmt_obj_t* rmt, uint32_t value) -{ - if (!rmt || value > 0xFFFF) { - return false; - } - size_t channel = rmt->channel; - - RMT_MUTEX_LOCK(channel); - RMT.conf_ch[channel].conf0.idle_thres = value; - RMT_MUTEX_UNLOCK(channel); - - return true; -} - - -bool rmtDeinit(rmt_obj_t *rmt) -{ - if (!rmt) { - return false; - } - - // sanity check - if (rmt != &(g_rmt_objects[rmt->channel])) { - return false; - } - - 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; - - return true; -} - -bool rmtWrite(rmt_obj_t* rmt, rmt_data_t* data, size_t size) -{ - if (!rmt) { - return false; - } - - int channel = rmt->channel; - int allocated_size = MAX_DATA_PER_CHANNEL * rmt->buffers; - - if (size > allocated_size) { - - 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)ESP_INTR_FLAG_IRAM, _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; - - // 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; - - // 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); - } else { - // use one-go mode if data fits one buffer - return _rmtSendOnce(rmt, data, size); - } -} - -bool rmtReadData(rmt_obj_t* rmt, uint32_t* data, size_t size) -{ - if (!rmt) { - return false; - } - int channel = rmt->channel; - - if (g_rmt_objects[channel].buffers < size/MAX_DATA_PER_CHANNEL) { - 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); - - 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; - - return true; -} - -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; - } -} - -bool rmtRead(rmt_obj_t* rmt, rmt_rx_data_cb_t cb) -{ - if (!rmt && !cb) { - return false; - } - int channel = rmt->channel; - - RMT_MUTEX_LOCK(channel); - 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; - } - - RMT.conf_ch[channel].conf1.mem_owner = 1; - - 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); - - RMT.conf_ch[channel].conf1.mem_wr_rst = 1; - - RMT.conf_ch[channel].conf1.rx_en = 1; - RMT_MUTEX_UNLOCK(channel); - - return true; -} - -bool rmtReadAsync(rmt_obj_t* rmt, rmt_data_t* data, size_t size, void* eventFlag, bool waitForData, uint32_t timeout) -{ - if (!rmt) { - return false; - } - int channel = rmt->channel; - - if (g_rmt_objects[channel].buffers < size/MAX_DATA_PER_CHANNEL) { - return false; - } - - 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; - - RMT.conf_ch[channel].conf1.mem_owner = 1; - - 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); - - RMT.conf_ch[channel].conf1.mem_wr_rst = 1; - - RMT.conf_ch[channel].conf1.rx_en = 1; - RMT_MUTEX_UNLOCK(channel); - - // wait for data if requested so - if (waitForData && eventFlag) { - uint32_t flags = xEventGroupWaitBits(eventFlag, RMT_FLAGS_ALL, - pdTRUE /* clear on exit */, pdFALSE /* wait for all bits */, timeout); - if (flags & RMT_FLAG_ERROR) { - return false; - } - } - - return true; -} - -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 - */ - int apb_div = _LIMIT(tick/12.5, 256); - int ref_div = _LIMIT(tick/1000, 256); - - float apb_tick = 12.5 * apb_div; - float ref_tick = 1000.0 * ref_div; - - size_t channel = rmt->channel; - - 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; - } -} - -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; - - // create common block mutex for protecting allocs from multiple threads - if (!g_rmt_block_lock) { - g_rmt_block_lock = xSemaphoreCreateMutex(); - } - // lock - while (xSemaphoreTake(g_rmt_block_lock, portMAX_DELAY) != pdPASS) {} - - for (i=0; i= MAX_CHANNELS || j != buffers) { - xSemaphoreGive(g_rmt_block_lock); - return NULL; - } - rmt = _rmtAllocate(pin, i, buffers); - - xSemaphoreGive(g_rmt_block_lock); - - size_t channel = i; - -#if !CONFIG_DISABLE_HAL_LOCKS - if(g_rmt_objlocks[channel] == NULL) { - g_rmt_objlocks[channel] = xSemaphoreCreateMutex(); - if(g_rmt_objlocks[channel] == NULL) { - return NULL; - } - } -#endif - - RMT_MUTEX_LOCK(channel); - - rmt->pin = pin; - rmt->tx_not_rx = tx_not_rx; - rmt->buffers =buffers; - rmt->channel = channel; - _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) - 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; - RMT.conf_ch[channel].conf0.mem_pd = 0; - - 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; - RMT.conf_ch[channel].conf1.ref_cnt_rst = 0; - 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; - - 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; - } 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; - } - - // install interrupt if at least one channel is active - if (!intr_handle) { - esp_intr_alloc(ETS_RMT_INTR_SOURCE, (int)ESP_INTR_FLAG_IRAM, _rmt_isr, NULL, &intr_handle); - } - RMT_MUTEX_UNLOCK(channel); - - return rmt; -} - -/** - * Private methods definitions - */ -bool _rmtSendOnce(rmt_obj_t* rmt, rmt_data_t* data, size_t size) -{ - if (!rmt) { - return false; - } - int channel = rmt->channel; - RMT.apb_conf.fifo_mask = 1; - 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); - RMT.conf_ch[channel].conf1.mem_rd_rst = 1; - RMT.conf_ch[channel].conf1.tx_start = 1; - 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)); - - // restart the reception - 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; - 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 - 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; - } - - 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); - - // initial setup of continuous mode - if (g_rmt_objects[ch].tx_state & E_SET_CONTI) { - RMT.conf_ch[ch].conf1.tx_conti_mode = 1; - g_rmt_objects[ch].intr_mode &= ~E_SET_CONTI; - } - _rmt_tx_mem_first(ch); - } - } -} - -static void IRAM_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; - - RMT.tx_lim_ch[ch].limit = half_tx_nr+2; - RMT.int_clr.val = _INT_THR_EVNT(ch); - RMT.int_ena.val |= _INT_THR_EVNT(ch); - - g_rmt_objects[ch].tx_state |= E_FIRST_HALF; - - if (data) { - int remaining_size = g_rmt_objects[ch].data_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; - - } - } else if ((!(g_rmt_objects[ch].tx_state & E_LAST_DATA)) && - (!(g_rmt_objects[ch].tx_state & E_END_TRANS))) { - 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; - RMT.conf_ch[ch].conf1.tx_conti_mode = 0; - } else { - log_d("RMT Tx finished %d!\n", ch); - RMT.conf_ch[ch].conf1.tx_conti_mode = 0; - 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 IRAM_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); - RMT.tx_lim_ch[ch].limit = 0; - - if (data) { - int remaining_size = g_rmt_objects[ch].data_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); - RMT.tx_lim_ch[ch].limit = 0; - 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 { - 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; - RMT.tx_lim_ch[ch].limit = 0; - g_rmt_objects[ch].tx_state |= E_LAST_DATA; - RMT.conf_ch[ch].conf1.tx_conti_mode = 0; - } - DEBUG_INTERRUPT_END(2); -} - -static int IRAM_ATTR _rmt_get_mem_len(uint8_t channel) -{ - int block_num = RMT.conf_ch[channel].conf0.mem_size; - int item_block_len = block_num * 64; - 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; - } - } - return idx; -} diff --git a/cores/esp32/esp32-hal-rmt.h b/cores/esp32/esp32-hal-rmt.h deleted file mode 100644 index 19afcef89c7..00000000000 --- a/cores/esp32/esp32-hal-rmt.h +++ /dev/null @@ -1,141 +0,0 @@ -// 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. - -#ifndef MAIN_ESP32_HAL_RMT_H_ -#define MAIN_ESP32_HAL_RMT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -// notification flags -#define RMT_FLAG_TX_DONE (1) -#define RMT_FLAG_RX_DONE (2) -#define RMT_FLAG_ERROR (4) -#define RMT_FLAGS_ALL (RMT_FLAG_TX_DONE | RMT_FLAG_RX_DONE | RMT_FLAG_ERROR) - -struct rmt_obj_s; - -typedef enum { - RMT_MEM_64 = 1, - RMT_MEM_128 = 2, - RMT_MEM_192 = 3, - RMT_MEM_256 = 4, - RMT_MEM_320 = 5, - RMT_MEM_384 = 6, - RMT_MEM_448 = 7, - RMT_MEM_512 = 8, -} rmt_reserve_memsize_t; - -typedef struct rmt_obj_s rmt_obj_t; - -typedef void (*rmt_rx_data_cb_t)(uint32_t *data, size_t len); - -typedef struct { - union { - struct { - uint32_t duration0 :15; - uint32_t level0 :1; - uint32_t duration1 :15; - uint32_t level1 :1; - }; - uint32_t val; - }; -} rmt_data_t; - -/** -* Initialize the object -* -*/ -rmt_obj_t* rmtInit(int pin, bool tx_not_rx, rmt_reserve_memsize_t memsize); - -/** -* Sets the clock/divider of timebase the nearest tick to the supplied value in nanoseconds -* return the real actual tick value in ns -*/ -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) -* -*/ -bool rmtWrite(rmt_obj_t* rmt, rmt_data_t* data, size_t size); - -/** -* Initiates async receive, event flag indicates data received -* -*/ -bool rmtReadAsync(rmt_obj_t* rmt, rmt_data_t* data, size_t size, void* eventFlag, bool waitForData, uint32_t timeout); - -/** -* Initiates async receive with automatic buffering -* and callback with data from ISR -* -*/ -bool rmtRead(rmt_obj_t* rmt, rmt_rx_data_cb_t cb); - - -/* Additional interface */ - -/** -* Start reception -* -*/ -bool rmtBeginReceive(rmt_obj_t* rmt); - -/** -* Checks if reception completes -* -*/ -bool rmtReceiveCompleted(rmt_obj_t* rmt); - -/** -* Reads the data for particular channel -* -*/ -bool rmtReadData(rmt_obj_t* rmt, uint32_t* data, size_t size); - -/** - * Setting threshold for Rx completed - */ -bool rmtSetRxThreshold(rmt_obj_t* rmt, uint32_t value); - -/** - * Setting carrier - */ -bool rmtSetCarrier(rmt_obj_t* rmt, bool carrier_en, bool carrier_level, uint32_t low, uint32_t high); - -/** - * Setting input filter - */ -bool rmtSetFilter(rmt_obj_t* rmt, bool filter_en, uint32_t filter_level); - -/** - * Deinitialize the driver - */ -bool rmtDeinit(rmt_obj_t *rmt); - -// TODO: -// * uninstall interrupt when all channels are deinit -// * send only-conti mode with circular-buffer -// * put sanity checks to some macro or inlines -// * doxy comments -// * error reporting - -#ifdef __cplusplus -} -#endif - -#endif /* MAIN_ESP32_HAL_RMT_H_ */ diff --git a/cores/esp32/esp32-hal-sigmadelta.c b/cores/esp32/esp32-hal-sigmadelta.c deleted file mode 100644 index 098181c77ae..00000000000 --- a/cores/esp32/esp32-hal-sigmadelta.c +++ /dev/null @@ -1,115 +0,0 @@ -// 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. - -#include "esp32-hal.h" -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "freertos/semphr.h" -#include "rom/ets_sys.h" -#include "esp32-hal-matrix.h" -#include "soc/gpio_sd_reg.h" -#include "soc/gpio_sd_struct.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 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){ - return; - } - uint32_t iarg = (uint32_t)arg; - uint8_t channel = iarg; - if(ev_type == APB_BEFORE_CHANGE){ - SIGMADELTA.cg.clk_en = 0; - } else { - 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 sigmaDeltaSetup(uint8_t channel, uint32_t freq) //chan 0-7 freq 1220-312500 -{ - if(channel > 7) { - 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(); - SIGMADELTA.channel[channel].prescale = prescale; - SIGMADELTA.cg.clk_en = 0; - SIGMADELTA.cg.clk_en = 1; - SD_MUTEX_UNLOCK(); - 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 -{ - if(channel > 7) { - return; - } - duty -= 128; - SD_MUTEX_LOCK(); - SIGMADELTA.channel[channel].duty = duty; - SD_MUTEX_UNLOCK(); -} - -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; -} - -void sigmaDeltaAttachPin(uint8_t pin, uint8_t channel) //channel 0-7 -{ - if(channel > 7) { - return; - } - pinMode(pin, OUTPUT); - pinMatrixOutAttach(pin, GPIO_SD0_OUT_IDX + channel, false, false); -} - -void sigmaDeltaDetachPin(uint8_t pin) -{ - pinMatrixOutDetach(pin, false, false); -} diff --git a/cores/esp32/esp32-hal-sigmadelta.h b/cores/esp32/esp32-hal-sigmadelta.h deleted file mode 100644 index 95bcb17c22c..00000000000 --- a/cores/esp32/esp32-hal-sigmadelta.h +++ /dev/null @@ -1,37 +0,0 @@ -// 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. - -#ifndef _ESP32_HAL_SD_H_ -#define _ESP32_HAL_SD_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -//channel 0-7 freq 1220-312500 duty 0-255 -uint32_t sigmaDeltaSetup(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); - - -#ifdef __cplusplus -} -#endif - -#endif /* _ESP32_HAL_SD_H_ */ diff --git a/cores/esp32/esp32-hal-spi.c b/cores/esp32/esp32-hal-spi.c deleted file mode 100644 index d28abf4a5ba..00000000000 --- a/cores/esp32/esp32-hal-spi.c +++ /dev/null @@ -1,1098 +0,0 @@ -// 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. - -#include "esp32-hal-spi.h" -#include "esp32-hal.h" -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "freertos/semphr.h" -#include "rom/ets_sys.h" -#include "esp_attr.h" -#include "esp_intr.h" -#include "rom/gpio.h" -#include "soc/spi_reg.h" -#include "soc/spi_struct.h" -#include "soc/io_mux_reg.h" -#include "soc/gpio_sig_map.h" -#include "soc/dport_reg.h" -#include "soc/rtc.h" - -#define SPI_CLK_IDX(p) ((p==0)?SPICLK_OUT_IDX:((p==1)?SPICLK_OUT_IDX:((p==2)?HSPICLK_OUT_IDX:((p==3)?VSPICLK_OUT_IDX:0)))) -#define SPI_MISO_IDX(p) ((p==0)?SPIQ_OUT_IDX:((p==1)?SPIQ_OUT_IDX:((p==2)?HSPIQ_OUT_IDX:((p==3)?VSPIQ_OUT_IDX:0)))) -#define SPI_MOSI_IDX(p) ((p==0)?SPID_IN_IDX:((p==1)?SPID_IN_IDX:((p==2)?HSPID_IN_IDX:((p==3)?VSPID_IN_IDX:0)))) - -#define SPI_SPI_SS_IDX(n) ((n==0)?SPICS0_OUT_IDX:((n==1)?SPICS1_OUT_IDX:((n==2)?SPICS2_OUT_IDX:SPICS0_OUT_IDX))) -#define SPI_HSPI_SS_IDX(n) ((n==0)?HSPICS0_OUT_IDX:((n==1)?HSPICS1_OUT_IDX:((n==2)?HSPICS2_OUT_IDX:HSPICS0_OUT_IDX))) -#define SPI_VSPI_SS_IDX(n) ((n==0)?VSPICS0_OUT_IDX:((n==1)?VSPICS1_OUT_IDX:((n==2)?VSPICS2_OUT_IDX:VSPICS0_OUT_IDX))) -#define SPI_SS_IDX(p, n) ((p==0)?SPI_SPI_SS_IDX(n):((p==1)?SPI_SPI_SS_IDX(n):((p==2)?SPI_HSPI_SS_IDX(n):((p==3)?SPI_VSPI_SS_IDX(n):0)))) - -#define SPI_INUM(u) (2) -#define SPI_INTR_SOURCE(u) ((u==0)?ETS_SPI0_INTR_SOURCE:((u==1)?ETS_SPI1_INTR_SOURCE:((u==2)?ETS_SPI2_INTR_SOURCE:((p==3)?ETS_SPI3_INTR_SOURCE:0)))) - -struct spi_struct_t { - spi_dev_t * dev; -#if !CONFIG_DISABLE_HAL_LOCKS - xSemaphoreHandle lock; -#endif - uint8_t num; -}; - -#if CONFIG_DISABLE_HAL_LOCKS -#define SPI_MUTEX_LOCK() -#define SPI_MUTEX_UNLOCK() - -static spi_t _spi_bus_array[4] = { - {(volatile spi_dev_t *)(DR_REG_SPI0_BASE), 0}, - {(volatile spi_dev_t *)(DR_REG_SPI1_BASE), 1}, - {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), 2}, - {(volatile spi_dev_t *)(DR_REG_SPI3_BASE), 3} -}; -#else -#define SPI_MUTEX_LOCK() do {} while (xSemaphoreTake(spi->lock, portMAX_DELAY) != pdPASS) -#define SPI_MUTEX_UNLOCK() xSemaphoreGive(spi->lock) - -static spi_t _spi_bus_array[4] = { - {(volatile spi_dev_t *)(DR_REG_SPI0_BASE), NULL, 0}, - {(volatile spi_dev_t *)(DR_REG_SPI1_BASE), NULL, 1}, - {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 2}, - {(volatile spi_dev_t *)(DR_REG_SPI3_BASE), NULL, 3} -}; -#endif - -void spiAttachSCK(spi_t * spi, int8_t sck) -{ - if(!spi) { - return; - } - if(sck < 0) { - if(spi->num == HSPI) { - sck = 14; - } else if(spi->num == VSPI) { - sck = 18; - } else { - sck = 6; - } - } - pinMode(sck, OUTPUT); - pinMatrixOutAttach(sck, SPI_CLK_IDX(spi->num), false, false); -} - -void spiAttachMISO(spi_t * spi, int8_t miso) -{ - if(!spi) { - return; - } - if(miso < 0) { - if(spi->num == HSPI) { - miso = 12; - } else if(spi->num == VSPI) { - miso = 19; - } else { - miso = 7; - } - } - SPI_MUTEX_LOCK(); - pinMode(miso, INPUT); - pinMatrixInAttach(miso, SPI_MISO_IDX(spi->num), false); - SPI_MUTEX_UNLOCK(); -} - -void spiAttachMOSI(spi_t * spi, int8_t mosi) -{ - if(!spi) { - return; - } - if(mosi < 0) { - if(spi->num == HSPI) { - mosi = 13; - } else if(spi->num == VSPI) { - mosi = 23; - } else { - mosi = 8; - } - } - pinMode(mosi, OUTPUT); - pinMatrixOutAttach(mosi, SPI_MOSI_IDX(spi->num), false, false); -} - -void spiDetachSCK(spi_t * spi, int8_t sck) -{ - if(!spi) { - return; - } - if(sck < 0) { - if(spi->num == HSPI) { - sck = 14; - } else if(spi->num == VSPI) { - sck = 18; - } else { - sck = 6; - } - } - pinMatrixOutDetach(sck, false, false); - pinMode(sck, INPUT); -} - -void spiDetachMISO(spi_t * spi, int8_t miso) -{ - if(!spi) { - return; - } - if(miso < 0) { - if(spi->num == HSPI) { - miso = 12; - } else if(spi->num == VSPI) { - miso = 19; - } else { - miso = 7; - } - } - pinMatrixInDetach(SPI_MISO_IDX(spi->num), false, false); - pinMode(miso, INPUT); -} - -void spiDetachMOSI(spi_t * spi, int8_t mosi) -{ - if(!spi) { - return; - } - if(mosi < 0) { - if(spi->num == HSPI) { - mosi = 13; - } else if(spi->num == VSPI) { - mosi = 23; - } else { - mosi = 8; - } - } - pinMatrixOutDetach(mosi, false, false); - pinMode(mosi, INPUT); -} - -void spiAttachSS(spi_t * spi, uint8_t cs_num, int8_t ss) -{ - if(!spi) { - return; - } - if(cs_num > 2) { - return; - } - if(ss < 0) { - cs_num = 0; - if(spi->num == HSPI) { - ss = 15; - } else if(spi->num == VSPI) { - ss = 5; - } else { - ss = 11; - } - } - pinMode(ss, OUTPUT); - pinMatrixOutAttach(ss, SPI_SS_IDX(spi->num, cs_num), false, false); - spiEnableSSPins(spi, (1 << cs_num)); -} - -void spiDetachSS(spi_t * spi, int8_t ss) -{ - if(!spi) { - return; - } - if(ss < 0) { - if(spi->num == HSPI) { - ss = 15; - } else if(spi->num == VSPI) { - ss = 5; - } else { - ss = 11; - } - } - pinMatrixOutDetach(ss, false, false); - pinMode(ss, INPUT); -} - -void spiEnableSSPins(spi_t * spi, uint8_t cs_mask) -{ - if(!spi) { - return; - } - SPI_MUTEX_LOCK(); - spi->dev->pin.val &= ~(cs_mask & SPI_CS_MASK_ALL); - SPI_MUTEX_UNLOCK(); -} - -void spiDisableSSPins(spi_t * spi, uint8_t cs_mask) -{ - if(!spi) { - return; - } - SPI_MUTEX_LOCK(); - spi->dev->pin.val |= (cs_mask & SPI_CS_MASK_ALL); - SPI_MUTEX_UNLOCK(); -} - -void spiSSEnable(spi_t * spi) -{ - if(!spi) { - return; - } - SPI_MUTEX_LOCK(); - spi->dev->user.cs_setup = 1; - spi->dev->user.cs_hold = 1; - SPI_MUTEX_UNLOCK(); -} - -void spiSSDisable(spi_t * spi) -{ - if(!spi) { - return; - } - SPI_MUTEX_LOCK(); - spi->dev->user.cs_setup = 0; - spi->dev->user.cs_hold = 0; - SPI_MUTEX_UNLOCK(); -} - -void spiSSSet(spi_t * spi) -{ - if(!spi) { - return; - } - SPI_MUTEX_LOCK(); - spi->dev->pin.cs_keep_active = 1; - SPI_MUTEX_UNLOCK(); -} - -void spiSSClear(spi_t * spi) -{ - if(!spi) { - return; - } - SPI_MUTEX_LOCK(); - spi->dev->pin.cs_keep_active = 0; - SPI_MUTEX_UNLOCK(); -} - -uint32_t spiGetClockDiv(spi_t * spi) -{ - if(!spi) { - return 0; - } - return spi->dev->clock.val; -} - -void spiSetClockDiv(spi_t * spi, uint32_t clockDiv) -{ - if(!spi) { - return; - } - SPI_MUTEX_LOCK(); - spi->dev->clock.val = clockDiv; - SPI_MUTEX_UNLOCK(); -} - -uint8_t spiGetDataMode(spi_t * spi) -{ - if(!spi) { - return 0; - } - bool idleEdge = spi->dev->pin.ck_idle_edge; - bool outEdge = spi->dev->user.ck_out_edge; - if(idleEdge) { - if(outEdge) { - return SPI_MODE2; - } - return SPI_MODE3; - } - if(outEdge) { - return SPI_MODE1; - } - return SPI_MODE0; -} - -void spiSetDataMode(spi_t * spi, uint8_t dataMode) -{ - if(!spi) { - return; - } - SPI_MUTEX_LOCK(); - switch (dataMode) { - case SPI_MODE1: - spi->dev->pin.ck_idle_edge = 0; - spi->dev->user.ck_out_edge = 1; - break; - case SPI_MODE2: - spi->dev->pin.ck_idle_edge = 1; - spi->dev->user.ck_out_edge = 1; - break; - case SPI_MODE3: - spi->dev->pin.ck_idle_edge = 1; - spi->dev->user.ck_out_edge = 0; - break; - case SPI_MODE0: - default: - spi->dev->pin.ck_idle_edge = 0; - spi->dev->user.ck_out_edge = 0; - break; - } - SPI_MUTEX_UNLOCK(); -} - -uint8_t spiGetBitOrder(spi_t * spi) -{ - if(!spi) { - return 0; - } - return (spi->dev->ctrl.wr_bit_order | spi->dev->ctrl.rd_bit_order) == 0; -} - -void spiSetBitOrder(spi_t * spi, uint8_t bitOrder) -{ - if(!spi) { - return; - } - SPI_MUTEX_LOCK(); - if (SPI_MSBFIRST == bitOrder) { - spi->dev->ctrl.wr_bit_order = 0; - spi->dev->ctrl.rd_bit_order = 0; - } else if (SPI_LSBFIRST == bitOrder) { - spi->dev->ctrl.wr_bit_order = 1; - spi->dev->ctrl.rd_bit_order = 1; - } - SPI_MUTEX_UNLOCK(); -} - -static void _on_apb_change(void * arg, apb_change_ev_t ev_type, uint32_t old_apb, uint32_t new_apb) -{ - spi_t * spi = (spi_t *)arg; - if(ev_type == APB_BEFORE_CHANGE){ - SPI_MUTEX_LOCK(); - while(spi->dev->cmd.usr); - } else { - spi->dev->clock.val = spiFrequencyToClockDiv(old_apb / ((spi->dev->clock.clkdiv_pre + 1) * (spi->dev->clock.clkcnt_n + 1))); - SPI_MUTEX_UNLOCK(); - } -} - -void spiStopBus(spi_t * spi) -{ - if(!spi) { - return; - } - SPI_MUTEX_LOCK(); - spi->dev->slave.trans_done = 0; - spi->dev->slave.slave_mode = 0; - spi->dev->pin.val = 0; - spi->dev->user.val = 0; - spi->dev->user1.val = 0; - spi->dev->ctrl.val = 0; - spi->dev->ctrl1.val = 0; - spi->dev->ctrl2.val = 0; - spi->dev->clock.val = 0; - SPI_MUTEX_UNLOCK(); - removeApbChangeCallback(spi, _on_apb_change); -} - -spi_t * spiStartBus(uint8_t spi_num, uint32_t clockDiv, uint8_t dataMode, uint8_t bitOrder) -{ - if(spi_num > 3){ - return NULL; - } - - spi_t * spi = &_spi_bus_array[spi_num]; - -#if !CONFIG_DISABLE_HAL_LOCKS - if(spi->lock == NULL){ - spi->lock = xSemaphoreCreateMutex(); - if(spi->lock == NULL) { - return NULL; - } - } -#endif - - if(spi_num == HSPI) { - DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI_CLK_EN); - DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_RST); - } else if(spi_num == VSPI) { - DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI_CLK_EN_2); - DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_RST_2); - } else { - DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI_CLK_EN_1); - DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_RST_1); - } - - spiStopBus(spi); - spiSetDataMode(spi, dataMode); - spiSetBitOrder(spi, bitOrder); - spiSetClockDiv(spi, clockDiv); - - SPI_MUTEX_LOCK(); - spi->dev->user.usr_mosi = 1; - spi->dev->user.usr_miso = 1; - spi->dev->user.doutdin = 1; - - int i; - for(i=0; i<16; i++) { - spi->dev->data_buf[i] = 0x00000000; - } - SPI_MUTEX_UNLOCK(); - - addApbChangeCallback(spi, _on_apb_change); - return spi; -} - -void spiWaitReady(spi_t * spi) -{ - if(!spi) { - return; - } - while(spi->dev->cmd.usr); -} - -void spiWrite(spi_t * spi, uint32_t *data, uint8_t len) -{ - if(!spi) { - return; - } - int i; - if(len > 16) { - len = 16; - } - SPI_MUTEX_LOCK(); - spi->dev->mosi_dlen.usr_mosi_dbitlen = (len * 32) - 1; - spi->dev->miso_dlen.usr_miso_dbitlen = 0; - for(i=0; idev->data_buf[i] = data[i]; - } - spi->dev->cmd.usr = 1; - while(spi->dev->cmd.usr); - SPI_MUTEX_UNLOCK(); -} - -void spiTransfer(spi_t * spi, uint32_t *data, uint8_t len) -{ - if(!spi) { - return; - } - int i; - if(len > 16) { - len = 16; - } - SPI_MUTEX_LOCK(); - spi->dev->mosi_dlen.usr_mosi_dbitlen = (len * 32) - 1; - spi->dev->miso_dlen.usr_miso_dbitlen = (len * 32) - 1; - for(i=0; idev->data_buf[i] = data[i]; - } - spi->dev->cmd.usr = 1; - while(spi->dev->cmd.usr); - for(i=0; idev->data_buf[i]; - } - SPI_MUTEX_UNLOCK(); -} - -void spiWriteByte(spi_t * spi, uint8_t data) -{ - if(!spi) { - return; - } - SPI_MUTEX_LOCK(); - spi->dev->mosi_dlen.usr_mosi_dbitlen = 7; - spi->dev->miso_dlen.usr_miso_dbitlen = 0; - spi->dev->data_buf[0] = data; - spi->dev->cmd.usr = 1; - while(spi->dev->cmd.usr); - SPI_MUTEX_UNLOCK(); -} - -uint8_t spiTransferByte(spi_t * spi, uint8_t data) -{ - if(!spi) { - return 0; - } - SPI_MUTEX_LOCK(); - spi->dev->mosi_dlen.usr_mosi_dbitlen = 7; - spi->dev->miso_dlen.usr_miso_dbitlen = 7; - spi->dev->data_buf[0] = data; - spi->dev->cmd.usr = 1; - while(spi->dev->cmd.usr); - data = spi->dev->data_buf[0] & 0xFF; - SPI_MUTEX_UNLOCK(); - return data; -} - -uint32_t __spiTranslate24(uint32_t data) -{ - union { - uint32_t l; - uint8_t b[4]; - } out; - out.l = data; - return out.b[2] | (out.b[1] << 8) | (out.b[0] << 16); -} - -uint32_t __spiTranslate32(uint32_t data) -{ - union { - uint32_t l; - uint8_t b[4]; - } out; - out.l = data; - return out.b[3] | (out.b[2] << 8) | (out.b[1] << 16) | (out.b[0] << 24); -} - -void spiWriteWord(spi_t * spi, uint16_t data) -{ - if(!spi) { - return; - } - if(!spi->dev->ctrl.wr_bit_order){ - data = (data >> 8) | (data << 8); - } - SPI_MUTEX_LOCK(); - spi->dev->mosi_dlen.usr_mosi_dbitlen = 15; - spi->dev->miso_dlen.usr_miso_dbitlen = 0; - spi->dev->data_buf[0] = data; - spi->dev->cmd.usr = 1; - while(spi->dev->cmd.usr); - SPI_MUTEX_UNLOCK(); -} - -uint16_t spiTransferWord(spi_t * spi, uint16_t data) -{ - if(!spi) { - return 0; - } - if(!spi->dev->ctrl.wr_bit_order){ - data = (data >> 8) | (data << 8); - } - SPI_MUTEX_LOCK(); - spi->dev->mosi_dlen.usr_mosi_dbitlen = 15; - spi->dev->miso_dlen.usr_miso_dbitlen = 15; - spi->dev->data_buf[0] = data; - spi->dev->cmd.usr = 1; - while(spi->dev->cmd.usr); - data = spi->dev->data_buf[0]; - SPI_MUTEX_UNLOCK(); - if(!spi->dev->ctrl.rd_bit_order){ - data = (data >> 8) | (data << 8); - } - return data; -} - -void spiWriteLong(spi_t * spi, uint32_t data) -{ - if(!spi) { - return; - } - if(!spi->dev->ctrl.wr_bit_order){ - data = __spiTranslate32(data); - } - SPI_MUTEX_LOCK(); - spi->dev->mosi_dlen.usr_mosi_dbitlen = 31; - spi->dev->miso_dlen.usr_miso_dbitlen = 0; - spi->dev->data_buf[0] = data; - spi->dev->cmd.usr = 1; - while(spi->dev->cmd.usr); - SPI_MUTEX_UNLOCK(); -} - -uint32_t spiTransferLong(spi_t * spi, uint32_t data) -{ - if(!spi) { - return 0; - } - if(!spi->dev->ctrl.wr_bit_order){ - data = __spiTranslate32(data); - } - SPI_MUTEX_LOCK(); - spi->dev->mosi_dlen.usr_mosi_dbitlen = 31; - spi->dev->miso_dlen.usr_miso_dbitlen = 31; - spi->dev->data_buf[0] = data; - spi->dev->cmd.usr = 1; - while(spi->dev->cmd.usr); - data = spi->dev->data_buf[0]; - SPI_MUTEX_UNLOCK(); - if(!spi->dev->ctrl.rd_bit_order){ - data = __spiTranslate32(data); - } - return data; -} - -void __spiTransferBytes(spi_t * spi, uint8_t * data, uint8_t * out, uint32_t bytes) -{ - if(!spi) { - return; - } - int i; - - if(bytes > 64) { - bytes = 64; - } - - uint32_t words = (bytes + 3) / 4;//16 max - - uint32_t wordsBuf[16] = {0,}; - uint8_t * bytesBuf = (uint8_t *) wordsBuf; - - if(data) { - memcpy(bytesBuf, data, bytes);//copy data to buffer - } else { - memset(bytesBuf, 0xFF, bytes); - } - - spi->dev->mosi_dlen.usr_mosi_dbitlen = ((bytes * 8) - 1); - spi->dev->miso_dlen.usr_miso_dbitlen = ((bytes * 8) - 1); - - for(i=0; idev->data_buf[i] = wordsBuf[i]; //copy buffer to spi fifo - } - - spi->dev->cmd.usr = 1; - - while(spi->dev->cmd.usr); - - if(out) { - for(i=0; idev->data_buf[i];//copy spi fifo to buffer - } - memcpy(out, bytesBuf, bytes);//copy buffer to output - } -} - -void spiTransferBytes(spi_t * spi, uint8_t * data, uint8_t * out, uint32_t size) -{ - if(!spi) { - return; - } - SPI_MUTEX_LOCK(); - while(size) { - if(size > 64) { - __spiTransferBytes(spi, data, out, 64); - size -= 64; - if(data) { - data += 64; - } - if(out) { - out += 64; - } - } else { - __spiTransferBytes(spi, data, out, size); - size = 0; - } - } - SPI_MUTEX_UNLOCK(); -} - -void spiTransferBits(spi_t * spi, uint32_t data, uint32_t * out, uint8_t bits) -{ - if(!spi) { - return; - } - SPI_MUTEX_LOCK(); - spiTransferBitsNL(spi, data, out, bits); - SPI_MUTEX_UNLOCK(); -} - -/* - * Manual Lock Management - * */ - -#define MSB_32_SET(var, val) { uint8_t * d = (uint8_t *)&(val); (var) = d[3] | (d[2] << 8) | (d[1] << 16) | (d[0] << 24); } -#define MSB_24_SET(var, val) { uint8_t * d = (uint8_t *)&(val); (var) = d[2] | (d[1] << 8) | (d[0] << 16); } -#define MSB_16_SET(var, val) { (var) = (((val) & 0xFF00) >> 8) | (((val) & 0xFF) << 8); } -#define MSB_PIX_SET(var, val) { uint8_t * d = (uint8_t *)&(val); (var) = d[1] | (d[0] << 8) | (d[3] << 16) | (d[2] << 24); } - -void spiTransaction(spi_t * spi, uint32_t clockDiv, uint8_t dataMode, uint8_t bitOrder) -{ - if(!spi) { - return; - } - SPI_MUTEX_LOCK(); - spi->dev->clock.val = clockDiv; - switch (dataMode) { - case SPI_MODE1: - spi->dev->pin.ck_idle_edge = 0; - spi->dev->user.ck_out_edge = 1; - break; - case SPI_MODE2: - spi->dev->pin.ck_idle_edge = 1; - spi->dev->user.ck_out_edge = 1; - break; - case SPI_MODE3: - spi->dev->pin.ck_idle_edge = 1; - spi->dev->user.ck_out_edge = 0; - break; - case SPI_MODE0: - default: - spi->dev->pin.ck_idle_edge = 0; - spi->dev->user.ck_out_edge = 0; - break; - } - if (SPI_MSBFIRST == bitOrder) { - spi->dev->ctrl.wr_bit_order = 0; - spi->dev->ctrl.rd_bit_order = 0; - } else if (SPI_LSBFIRST == bitOrder) { - spi->dev->ctrl.wr_bit_order = 1; - spi->dev->ctrl.rd_bit_order = 1; - } -} - -void spiSimpleTransaction(spi_t * spi) -{ - if(!spi) { - return; - } - SPI_MUTEX_LOCK(); -} - -void spiEndTransaction(spi_t * spi) -{ - if(!spi) { - return; - } - SPI_MUTEX_UNLOCK(); -} - -void IRAM_ATTR spiWriteByteNL(spi_t * spi, uint8_t data) -{ - if(!spi) { - return; - } - spi->dev->mosi_dlen.usr_mosi_dbitlen = 7; - spi->dev->miso_dlen.usr_miso_dbitlen = 0; - spi->dev->data_buf[0] = data; - spi->dev->cmd.usr = 1; - while(spi->dev->cmd.usr); -} - -uint8_t spiTransferByteNL(spi_t * spi, uint8_t data) -{ - if(!spi) { - return 0; - } - spi->dev->mosi_dlen.usr_mosi_dbitlen = 7; - spi->dev->miso_dlen.usr_miso_dbitlen = 7; - spi->dev->data_buf[0] = data; - spi->dev->cmd.usr = 1; - while(spi->dev->cmd.usr); - data = spi->dev->data_buf[0] & 0xFF; - return data; -} - -void IRAM_ATTR spiWriteShortNL(spi_t * spi, uint16_t data) -{ - if(!spi) { - return; - } - if(!spi->dev->ctrl.wr_bit_order){ - MSB_16_SET(data, data); - } - spi->dev->mosi_dlen.usr_mosi_dbitlen = 15; - spi->dev->miso_dlen.usr_miso_dbitlen = 0; - spi->dev->data_buf[0] = data; - spi->dev->cmd.usr = 1; - while(spi->dev->cmd.usr); -} - -uint16_t spiTransferShortNL(spi_t * spi, uint16_t data) -{ - if(!spi) { - return 0; - } - if(!spi->dev->ctrl.wr_bit_order){ - MSB_16_SET(data, data); - } - spi->dev->mosi_dlen.usr_mosi_dbitlen = 15; - spi->dev->miso_dlen.usr_miso_dbitlen = 15; - spi->dev->data_buf[0] = data; - spi->dev->cmd.usr = 1; - while(spi->dev->cmd.usr); - data = spi->dev->data_buf[0] & 0xFFFF; - if(!spi->dev->ctrl.rd_bit_order){ - MSB_16_SET(data, data); - } - return data; -} - -void IRAM_ATTR spiWriteLongNL(spi_t * spi, uint32_t data) -{ - if(!spi) { - return; - } - if(!spi->dev->ctrl.wr_bit_order){ - MSB_32_SET(data, data); - } - spi->dev->mosi_dlen.usr_mosi_dbitlen = 31; - spi->dev->miso_dlen.usr_miso_dbitlen = 0; - spi->dev->data_buf[0] = data; - spi->dev->cmd.usr = 1; - while(spi->dev->cmd.usr); -} - -uint32_t spiTransferLongNL(spi_t * spi, uint32_t data) -{ - if(!spi) { - return 0; - } - if(!spi->dev->ctrl.wr_bit_order){ - MSB_32_SET(data, data); - } - spi->dev->mosi_dlen.usr_mosi_dbitlen = 31; - spi->dev->miso_dlen.usr_miso_dbitlen = 31; - spi->dev->data_buf[0] = data; - spi->dev->cmd.usr = 1; - while(spi->dev->cmd.usr); - data = spi->dev->data_buf[0]; - if(!spi->dev->ctrl.rd_bit_order){ - MSB_32_SET(data, data); - } - return data; -} - -void spiWriteNL(spi_t * spi, const void * data_in, size_t len){ - size_t longs = len >> 2; - if(len & 3){ - longs++; - } - uint32_t * data = (uint32_t*)data_in; - size_t c_len = 0, c_longs = 0; - - while(len){ - c_len = (len>64)?64:len; - c_longs = (longs > 16)?16:longs; - - spi->dev->mosi_dlen.usr_mosi_dbitlen = (c_len*8)-1; - spi->dev->miso_dlen.usr_miso_dbitlen = 0; - for (int i=0; idev->data_buf[i] = data[i]; - } - spi->dev->cmd.usr = 1; - while(spi->dev->cmd.usr); - - data += c_longs; - longs -= c_longs; - len -= c_len; - } -} - -void spiTransferBytesNL(spi_t * spi, const void * data_in, uint8_t * data_out, size_t len){ - if(!spi) { - return; - } - size_t longs = len >> 2; - if(len & 3){ - longs++; - } - uint32_t * data = (uint32_t*)data_in; - uint32_t * result = (uint32_t*)data_out; - size_t c_len = 0, c_longs = 0; - - while(len){ - c_len = (len>64)?64:len; - c_longs = (longs > 16)?16:longs; - - spi->dev->mosi_dlen.usr_mosi_dbitlen = (c_len*8)-1; - spi->dev->miso_dlen.usr_miso_dbitlen = (c_len*8)-1; - if(data){ - for (int i=0; idev->data_buf[i] = data[i]; - } - } else { - for (int i=0; idev->data_buf[i] = 0xFFFFFFFF; - } - } - spi->dev->cmd.usr = 1; - while(spi->dev->cmd.usr); - if(result){ - for (int i=0; idev->data_buf[i]; - } - } - if(data){ - data += c_longs; - } - if(result){ - result += c_longs; - } - longs -= c_longs; - len -= c_len; - } -} - -void spiTransferBitsNL(spi_t * spi, uint32_t data, uint32_t * out, uint8_t bits) -{ - if(!spi) { - return; - } - - if(bits > 32) { - bits = 32; - } - uint32_t bytes = (bits + 7) / 8;//64 max - uint32_t mask = (((uint64_t)1 << bits) - 1) & 0xFFFFFFFF; - data = data & mask; - if(!spi->dev->ctrl.wr_bit_order){ - if(bytes == 2) { - MSB_16_SET(data, data); - } else if(bytes == 3) { - MSB_24_SET(data, data); - } else { - MSB_32_SET(data, data); - } - } - - spi->dev->mosi_dlen.usr_mosi_dbitlen = (bits - 1); - spi->dev->miso_dlen.usr_miso_dbitlen = (bits - 1); - spi->dev->data_buf[0] = data; - spi->dev->cmd.usr = 1; - while(spi->dev->cmd.usr); - data = spi->dev->data_buf[0]; - if(out) { - *out = data; - if(!spi->dev->ctrl.rd_bit_order){ - if(bytes == 2) { - MSB_16_SET(*out, data); - } else if(bytes == 3) { - MSB_24_SET(*out, data); - } else { - MSB_32_SET(*out, data); - } - } - } -} - -void IRAM_ATTR spiWritePixelsNL(spi_t * spi, const void * data_in, size_t len){ - size_t longs = len >> 2; - if(len & 3){ - longs++; - } - bool msb = !spi->dev->ctrl.wr_bit_order; - uint32_t * data = (uint32_t*)data_in; - size_t c_len = 0, c_longs = 0, l_bytes = 0; - - while(len){ - c_len = (len>64)?64:len; - c_longs = (longs > 16)?16:longs; - l_bytes = (c_len & 3); - - spi->dev->mosi_dlen.usr_mosi_dbitlen = (c_len*8)-1; - spi->dev->miso_dlen.usr_miso_dbitlen = 0; - for (int i=0; idev->data_buf[i], data[i]); - } else { - spi->dev->data_buf[i] = data[i] & 0xFF; - } - } else { - MSB_PIX_SET(spi->dev->data_buf[i], data[i]); - } - } else { - spi->dev->data_buf[i] = data[i]; - } - } - spi->dev->cmd.usr = 1; - while(spi->dev->cmd.usr); - - data += c_longs; - longs -= c_longs; - len -= c_len; - } -} - - - -/* - * Clock Calculators - * - * */ - -typedef union { - uint32_t value; - struct { - uint32_t clkcnt_l: 6; /*it must be equal to spi_clkcnt_N.*/ - uint32_t clkcnt_h: 6; /*it must be floor((spi_clkcnt_N+1)/2-1).*/ - uint32_t clkcnt_n: 6; /*it is the divider of spi_clk. So spi_clk frequency is system/(spi_clkdiv_pre+1)/(spi_clkcnt_N+1)*/ - uint32_t clkdiv_pre: 13; /*it is pre-divider of spi_clk.*/ - uint32_t clk_equ_sysclk: 1; /*1: spi_clk is eqaul to system 0: spi_clk is divided from system clock.*/ - }; -} spiClk_t; - -#define ClkRegToFreq(reg) (apb_freq / (((reg)->clkdiv_pre + 1) * ((reg)->clkcnt_n + 1))) - -uint32_t spiClockDivToFrequency(uint32_t clockDiv) -{ - uint32_t apb_freq = getApbFrequency(); - spiClk_t reg = { clockDiv }; - return ClkRegToFreq(®); -} - -uint32_t spiFrequencyToClockDiv(uint32_t freq) -{ - uint32_t apb_freq = getApbFrequency(); - - if(freq >= apb_freq) { - return SPI_CLK_EQU_SYSCLK; - } - - const spiClk_t minFreqReg = { 0x7FFFF000 }; - uint32_t minFreq = ClkRegToFreq((spiClk_t*) &minFreqReg); - if(freq < minFreq) { - return minFreqReg.value; - } - - uint8_t calN = 1; - spiClk_t bestReg = { 0 }; - int32_t bestFreq = 0; - - while(calN <= 0x3F) { - spiClk_t reg = { 0 }; - int32_t calFreq; - int32_t calPre; - int8_t calPreVari = -2; - - reg.clkcnt_n = calN; - - while(calPreVari++ <= 1) { - calPre = (((apb_freq / (reg.clkcnt_n + 1)) / freq) - 1) + calPreVari; - if(calPre > 0x1FFF) { - reg.clkdiv_pre = 0x1FFF; - } else if(calPre <= 0) { - reg.clkdiv_pre = 0; - } else { - reg.clkdiv_pre = calPre; - } - reg.clkcnt_l = ((reg.clkcnt_n + 1) / 2); - calFreq = ClkRegToFreq(®); - if(calFreq == (int32_t) freq) { - memcpy(&bestReg, ®, sizeof(bestReg)); - break; - } else if(calFreq < (int32_t) freq) { - if(abs(freq - calFreq) < abs(freq - bestFreq)) { - bestFreq = calFreq; - memcpy(&bestReg, ®, sizeof(bestReg)); - } - } - } - if(calFreq == (int32_t) freq) { - break; - } - calN++; - } - return bestReg.value; -} - diff --git a/cores/esp32/esp32-hal-spi.h b/cores/esp32/esp32-hal-spi.h deleted file mode 100644 index 78ef10fa3dd..00000000000 --- a/cores/esp32/esp32-hal-spi.h +++ /dev/null @@ -1,141 +0,0 @@ -// 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. - -#ifndef MAIN_ESP32_HAL_SPI_H_ -#define MAIN_ESP32_HAL_SPI_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#define SPI_HAS_TRANSACTION - -#define FSPI 1 //SPI bus attached to the flash (can use the same data lines but different SS) -#define HSPI 2 //SPI bus normally mapped to pins 12 - 15, but can be matrixed to any pins -#define VSPI 3 //SPI bus normally attached to pins 5, 18, 19 and 23, but can be matrixed to any pins - -// This defines are not representing the real Divider of the ESP32 -// the Defines match to an AVR Arduino on 16MHz for better compatibility -#define SPI_CLOCK_DIV2 0x00101001 //8 MHz -#define SPI_CLOCK_DIV4 0x00241001 //4 MHz -#define SPI_CLOCK_DIV8 0x004c1001 //2 MHz -#define SPI_CLOCK_DIV16 0x009c1001 //1 MHz -#define SPI_CLOCK_DIV32 0x013c1001 //500 KHz -#define SPI_CLOCK_DIV64 0x027c1001 //250 KHz -#define SPI_CLOCK_DIV128 0x04fc1001 //125 KHz - -#define SPI_MODE0 0 -#define SPI_MODE1 1 -#define SPI_MODE2 2 -#define SPI_MODE3 3 - -#define SPI_CS0 0 -#define SPI_CS1 1 -#define SPI_CS2 2 -#define SPI_CS_MASK_ALL 0x7 - -#define SPI_LSBFIRST 0 -#define SPI_MSBFIRST 1 - -struct spi_struct_t; -typedef struct spi_struct_t spi_t; - -spi_t * spiStartBus(uint8_t spi_num, uint32_t freq, uint8_t dataMode, uint8_t bitOrder); -void spiStopBus(spi_t * spi); - -//Attach/Detach Signal Pins -void spiAttachSCK(spi_t * spi, int8_t sck); -void spiAttachMISO(spi_t * spi, int8_t miso); -void spiAttachMOSI(spi_t * spi, int8_t mosi); -void spiDetachSCK(spi_t * spi, int8_t sck); -void spiDetachMISO(spi_t * spi, int8_t miso); -void spiDetachMOSI(spi_t * spi, int8_t mosi); - -//Attach/Detach SS pin to SPI_CSx signal -void spiAttachSS(spi_t * spi, uint8_t cs_num, int8_t ss); -void spiDetachSS(spi_t * spi, int8_t ss); - -//Enable/Disable SPI_CSx pins -void spiEnableSSPins(spi_t * spi, uint8_t cs_mask); -void spiDisableSSPins(spi_t * spi, uint8_t cs_mask); - -//Enable/Disable hardware control of SPI_CSx pins -void spiSSEnable(spi_t * spi); -void spiSSDisable(spi_t * spi); - -//Activate enabled SPI_CSx pins -void spiSSSet(spi_t * spi); -//Deactivate enabled SPI_CSx pins -void spiSSClear(spi_t * spi); - -void spiWaitReady(spi_t * spi); - -uint32_t spiGetClockDiv(spi_t * spi); -uint8_t spiGetDataMode(spi_t * spi); -uint8_t spiGetBitOrder(spi_t * spi); - - -/* - * Non transaction based lock methods (each locks and unlocks when called) - * */ -void spiSetClockDiv(spi_t * spi, uint32_t clockDiv); -void spiSetDataMode(spi_t * spi, uint8_t dataMode); -void spiSetBitOrder(spi_t * spi, uint8_t bitOrder); - -void spiWrite(spi_t * spi, uint32_t *data, uint8_t len); -void spiWriteByte(spi_t * spi, uint8_t data); -void spiWriteWord(spi_t * spi, uint16_t data); -void spiWriteLong(spi_t * spi, uint32_t data); - -void spiTransfer(spi_t * spi, uint32_t *out, uint8_t len); -uint8_t spiTransferByte(spi_t * spi, uint8_t data); -uint16_t spiTransferWord(spi_t * spi, uint16_t data); -uint32_t spiTransferLong(spi_t * spi, uint32_t data); -void spiTransferBytes(spi_t * spi, uint8_t * data, uint8_t * out, uint32_t size); -void spiTransferBits(spi_t * spi, uint32_t data, uint32_t * out, uint8_t bits); - -/* - * New (EXPERIMENTAL) Transaction lock based API (lock once until endTransaction) - * */ -void spiTransaction(spi_t * spi, uint32_t clockDiv, uint8_t dataMode, uint8_t bitOrder); -void spiSimpleTransaction(spi_t * spi); -void spiEndTransaction(spi_t * spi); - -void spiWriteNL(spi_t * spi, const void * data, uint32_t len); -void spiWriteByteNL(spi_t * spi, uint8_t data); -void spiWriteShortNL(spi_t * spi, uint16_t data); -void spiWriteLongNL(spi_t * spi, uint32_t data); -void spiWritePixelsNL(spi_t * spi, const void * data, uint32_t len); - -#define spiTransferNL(spi, data, len) spiTransferBytesNL(spi, data, data, len) -uint8_t spiTransferByteNL(spi_t * spi, uint8_t data); -uint16_t spiTransferShortNL(spi_t * spi, uint16_t data); -uint32_t spiTransferLongNL(spi_t * spi, uint32_t data); -void spiTransferBytesNL(spi_t * spi, const void * data_in, uint8_t * data_out, uint32_t len); -void spiTransferBitsNL(spi_t * spi, uint32_t data_in, uint32_t * data_out, uint8_t bits); - -/* - * Helper functions to translate frequency to clock divider and back - * */ -uint32_t spiFrequencyToClockDiv(uint32_t freq); -uint32_t spiClockDivToFrequency(uint32_t freq); - -#ifdef __cplusplus -} -#endif - -#endif /* MAIN_ESP32_HAL_SPI_H_ */ diff --git a/cores/esp32/esp32-hal-time.c b/cores/esp32/esp32-hal-time.c deleted file mode 100644 index e64c764b478..00000000000 --- a/cores/esp32/esp32-hal-time.c +++ /dev/null @@ -1,91 +0,0 @@ -// 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. - -#include "esp32-hal.h" -#include "lwip/apps/sntp.h" - -static void setTimeZone(long offset, int daylight) -{ - char cst[17] = {0}; - char cdt[17] = "DST"; - char tz[33] = {0}; - - if(offset % 3600){ - sprintf(cst, "UTC%ld:%02u:%02u", offset / 3600, abs((offset % 3600) / 60), abs(offset % 60)); - } else { - sprintf(cst, "UTC%ld", offset / 3600); - } - if(daylight != 3600){ - long tz_dst = offset - daylight; - if(tz_dst % 3600){ - sprintf(cdt, "DST%ld:%02u:%02u", tz_dst / 3600, abs((tz_dst % 3600) / 60), abs(tz_dst % 60)); - } else { - sprintf(cdt, "DST%ld", tz_dst / 3600); - } - } - sprintf(tz, "%s%s", cst, cdt); - setenv("TZ", tz, 1); - tzset(); -} - -/* - * configTime - * Source: https://github.com/esp8266/Arduino/blob/master/cores/esp8266/time.c - * */ -void configTime(long gmtOffset_sec, int daylightOffset_sec, const char* server1, const char* server2, const char* server3) -{ - if(sntp_enabled()){ - sntp_stop(); - } - sntp_setoperatingmode(SNTP_OPMODE_POLL); - sntp_setservername(0, (char*)server1); - sntp_setservername(1, (char*)server2); - sntp_setservername(2, (char*)server3); - sntp_init(); - setTimeZone(-gmtOffset_sec, daylightOffset_sec); -} - -/* - * configTzTime - * sntp setup using TZ environment variable - * */ -void configTzTime(const char* tz, const char* server1, const char* server2, const char* server3) -{ - if(sntp_enabled()){ - sntp_stop(); - } - sntp_setoperatingmode(SNTP_OPMODE_POLL); - sntp_setservername(0, (char*)server1); - sntp_setservername(1, (char*)server2); - sntp_setservername(2, (char*)server3); - sntp_init(); - setenv("TZ", tz, 1); - tzset(); -} - -bool getLocalTime(struct tm * info, uint32_t ms) -{ - uint32_t start = millis(); - time_t now; - while((millis()-start) <= ms) { - time(&now); - localtime_r(&now, info); - if(info->tm_year > (2016 - 1900)){ - return true; - } - delay(10); - } - return false; -} - diff --git a/cores/esp32/esp32-hal-timer.c b/cores/esp32/esp32-hal-timer.c deleted file mode 100644 index ed804d4e348..00000000000 --- a/cores/esp32/esp32-hal-timer.c +++ /dev/null @@ -1,308 +0,0 @@ -// 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. - -#include "esp32-hal-timer.h" -#include "freertos/FreeRTOS.h" -#include "freertos/xtensa_api.h" -#include "freertos/task.h" -#include "rom/ets_sys.h" -#include "soc/timer_group_struct.h" -#include "soc/dport_reg.h" -#include "esp_attr.h" -#include "esp_intr.h" - -#define HWTIMER_LOCK() portENTER_CRITICAL(timer->lock) -#define HWTIMER_UNLOCK() portEXIT_CRITICAL(timer->lock) - -typedef 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; -} 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} -}; - -typedef void (*voidFuncPtr)(void); -static voidFuncPtr __timerInterruptHandlers[4] = {0,0,0,0}; - -void IRAM_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](); - } - } -} - -uint64_t timerRead(hw_timer_t *timer){ - timer->dev->update = 1; - uint64_t h = timer->dev->cnt_high; - uint64_t l = timer->dev->cnt_low; - return (h << 32) | l; -} - -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; -} - -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; -} - -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; -} - -void timerSetConfig(hw_timer_t *timer, uint32_t config){ - timer->dev->config.val = config; -} - -uint32_t timerGetConfig(hw_timer_t *timer){ - return timer->dev->config.val; -} - -void timerSetCountUp(hw_timer_t *timer, bool countUp){ - timer->dev->config.increase = countUp; -} - -bool timerGetCountUp(hw_timer_t *timer){ - return timer->dev->config.increase; -} - -void timerSetAutoReload(hw_timer_t *timer, bool autoreload){ - timer->dev->config.autoreload = autoreload; -} - -bool timerGetAutoReload(hw_timer_t *timer){ - return timer->dev->config.autoreload; -} - -void timerSetDivider(hw_timer_t *timer, uint16_t divider){//2 to 65536 - if(!divider){ - divider = 0xFFFF; - } else if(divider == 1){ - divider = 2; - } - int timer_en = timer->dev->config.enable; - timer->dev->config.enable = 0; - timer->dev->config.divider = divider; - timer->dev->config.enable = timer_en; -} - -uint16_t timerGetDivider(hw_timer_t *timer){ - return timer->dev->config.divider; -} - -void timerStart(hw_timer_t *timer){ - timer->dev->config.enable = 1; -} - -void timerStop(hw_timer_t *timer){ - timer->dev->config.enable = 0; -} - -void timerRestart(hw_timer_t *timer){ - timer->dev->config.enable = 0; - timer->dev->reload = 1; - timer->dev->config.enable = 1; -} - -bool timerStarted(hw_timer_t *timer){ - return timer->dev->config.enable; -} - -void timerAlarmEnable(hw_timer_t *timer){ - timer->dev->config.alarm_en = 1; -} - -void timerAlarmDisable(hw_timer_t *timer){ - timer->dev->config.alarm_en = 0; -} - -bool timerAlarmEnabled(hw_timer_t *timer){ - return timer->dev->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; - } else { - old_apb /= 1000000; - new_apb /= 1000000; - timer->dev->config.divider = (new_apb * timer->dev->config.divider) / old_apb; - timer->dev->config.enable = 1; - } -} - -hw_timer_t * timerBegin(uint8_t num, uint16_t divider, bool countUp){ - if(num > 3){ - return NULL; - } - hw_timer_t * timer = &hw_timer[num]; - if(timer->group) { - DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_TIMERGROUP1_CLK_EN); - DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_TIMERGROUP1_RST); - TIMERG1.int_ena.val &= ~BIT(timer->timer); - } else { - DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_TIMERGROUP_CLK_EN); - DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_TIMERGROUP_RST); - TIMERG0.int_ena.val &= ~BIT(timer->timer); - } - timer->dev->config.enable = 0; - timerSetDivider(timer, divider); - timerSetCountUp(timer, countUp); - timerSetAutoReload(timer, false); - timerAttachInterrupt(timer, NULL, false); - timerWrite(timer, 0); - timer->dev->config.enable = 1; - 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); -} - -void timerAttachInterrupt(hw_timer_t *timer, void (*fn)(void), bool edge){ - 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){ - TIMERG1.int_ena.val &= ~BIT(timer->timer); - } else { - TIMERG0.int_ena.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; - if(!edge){ - if(timer->group){ - intr_source = ETS_TG1_T0_LEVEL_INTR_SOURCE + timer->timer; - } else { - intr_source = ETS_TG0_T0_LEVEL_INTR_SOURCE + timer->timer; - } - } 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; - } - } - if(!initialized){ - initialized = true; - esp_intr_alloc(intr_source, (int)(ESP_INTR_FLAG_IRAM|ESP_INTR_FLAG_LOWMED|ESP_INTR_FLAG_EDGE), __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){ - TIMERG1.int_ena.val |= BIT(timer->timer); - } else { - TIMERG0.int_ena.val |= BIT(timer->timer); - } - } - if(intr_handle){ - esp_intr_enable(intr_handle); - } -} - -void timerDetachInterrupt(hw_timer_t *timer){ - timerAttachInterrupt(timer, NULL, false); -} - -uint64_t timerReadMicros(hw_timer_t *timer){ - uint64_t timer_val = timerRead(timer); - uint16_t div = timerGetDivider(timer); - return timer_val * div / (getApbFrequency() / 1000000); -} - -double timerReadSeconds(hw_timer_t *timer){ - uint64_t timer_val = timerRead(timer); - uint16_t div = timerGetDivider(timer); - return (double)timer_val * div / getApbFrequency(); -} - -uint64_t timerAlarmReadMicros(hw_timer_t *timer){ - uint64_t timer_val = timerAlarmRead(timer); - uint16_t div = timerGetDivider(timer); - return timer_val * div / (getApbFrequency() / 1000000); -} - -double timerAlarmReadSeconds(hw_timer_t *timer){ - uint64_t timer_val = timerAlarmRead(timer); - uint16_t div = timerGetDivider(timer); - return (double)timer_val * div / getApbFrequency(); -} diff --git a/cores/esp32/esp32-hal-timer.h b/cores/esp32/esp32-hal-timer.h deleted file mode 100644 index 7624fc5a9f6..00000000000 --- a/cores/esp32/esp32-hal-timer.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - Arduino.h - Main include file for the Arduino SDK - Copyright (c) 2005-2013 Arduino Team. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef MAIN_ESP32_HAL_TIMER_H_ -#define MAIN_ESP32_HAL_TIMER_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; - -hw_timer_t * timerBegin(uint8_t timer, uint16_t divider, bool countUp); -void timerEnd(hw_timer_t *timer); - -void timerSetConfig(hw_timer_t *timer, uint32_t config); -uint32_t timerGetConfig(hw_timer_t *timer); - -void timerAttachInterrupt(hw_timer_t *timer, void (*fn)(void), bool edge); -void timerDetachInterrupt(hw_timer_t *timer); - -void timerStart(hw_timer_t *timer); -void timerStop(hw_timer_t *timer); -void timerRestart(hw_timer_t *timer); -void timerWrite(hw_timer_t *timer, uint64_t val); -void timerSetDivider(hw_timer_t *timer, uint16_t divider); -void timerSetCountUp(hw_timer_t *timer, bool countUp); -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); -double timerReadSeconds(hw_timer_t *timer); -uint16_t timerGetDivider(hw_timer_t *timer); -bool timerGetCountUp(hw_timer_t *timer); -bool timerGetAutoReload(hw_timer_t *timer); - -void timerAlarmEnable(hw_timer_t *timer); -void timerAlarmDisable(hw_timer_t *timer); -void timerAlarmWrite(hw_timer_t *timer, uint64_t interruptAt, bool autoreload); - -bool timerAlarmEnabled(hw_timer_t *timer); -uint64_t timerAlarmRead(hw_timer_t *timer); -uint64_t timerAlarmReadMicros(hw_timer_t *timer); -double timerAlarmReadSeconds(hw_timer_t *timer); - - -#ifdef __cplusplus -} -#endif - -#endif /* MAIN_ESP32_HAL_TIMER_H_ */ diff --git a/cores/esp32/esp32-hal-touch.c b/cores/esp32/esp32-hal-touch.c deleted file mode 100644 index 94e8a8b8ac3..00000000000 --- a/cores/esp32/esp32-hal-touch.c +++ /dev/null @@ -1,168 +0,0 @@ -// 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. - -#include "esp32-hal-touch.h" -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "rom/ets_sys.h" -#include "esp_attr.h" -#include "esp_intr.h" -#include "soc/rtc_io_reg.h" -#include "soc/rtc_cntl_reg.h" -#include "soc/sens_reg.h" - -static uint16_t __touchSleepCycles = 0x1000; -static uint16_t __touchMeasureCycles = 0x1000; - -typedef void (*voidFuncPtr)(void); -static voidFuncPtr __touchInterruptHandlers[10] = {0,}; -static intr_handle_t touch_intr_handle = NULL; - -void IRAM_ATTR __touchISR(void * arg) -{ - uint32_t pad_intr = READ_PERI_REG(SENS_SAR_TOUCH_CTRL2_REG) & 0x3ff; - uint32_t rtc_intr = READ_PERI_REG(RTC_CNTL_INT_ST_REG); - uint8_t i = 0; - //clear interrupt - WRITE_PERI_REG(RTC_CNTL_INT_CLR_REG, rtc_intr); - SET_PERI_REG_MASK(SENS_SAR_TOUCH_CTRL2_REG, SENS_TOUCH_MEAS_EN_CLR); - - if (rtc_intr & RTC_CNTL_TOUCH_INT_ST) { - for (i = 0; i < 10; ++i) { - if ((pad_intr >> i) & 0x01) { - if(__touchInterruptHandlers[i]){ - __touchInterruptHandlers[i](); - } - } - } - } -} - -void __touchSetCycles(uint16_t measure, uint16_t sleep) -{ - __touchSleepCycles = sleep; - __touchMeasureCycles = measure; - //Touch pad SleepCycle Time - SET_PERI_REG_BITS(SENS_SAR_TOUCH_CTRL2_REG, SENS_TOUCH_SLEEP_CYCLES, __touchSleepCycles, SENS_TOUCH_SLEEP_CYCLES_S); - //Touch Pad Measure Time - SET_PERI_REG_BITS(SENS_SAR_TOUCH_CTRL1_REG, SENS_TOUCH_MEAS_DELAY, __touchMeasureCycles, SENS_TOUCH_MEAS_DELAY_S); -} - -void __touchInit() -{ - static bool initialized = false; - if(initialized){ - return; - } - initialized = true; - SET_PERI_REG_BITS(RTC_IO_TOUCH_CFG_REG, RTC_IO_TOUCH_XPD_BIAS, 1, RTC_IO_TOUCH_XPD_BIAS_S); - SET_PERI_REG_MASK(SENS_SAR_TOUCH_CTRL2_REG, SENS_TOUCH_MEAS_EN_CLR); - //clear touch enable - WRITE_PERI_REG(SENS_SAR_TOUCH_ENABLE_REG, 0x0); - SET_PERI_REG_MASK(RTC_CNTL_STATE0_REG, RTC_CNTL_TOUCH_SLP_TIMER_EN); - - __touchSetCycles(__touchMeasureCycles, __touchSleepCycles); - - esp_intr_alloc(ETS_RTC_CORE_INTR_SOURCE, (int)ESP_INTR_FLAG_IRAM, __touchISR, NULL, &touch_intr_handle); -} - -uint16_t __touchRead(uint8_t pin) -{ - int8_t pad = digitalPinToTouchChannel(pin); - if(pad < 0){ - return 0; - } - - pinMode(pin, ANALOG); - - __touchInit(); - - uint32_t v0 = READ_PERI_REG(SENS_SAR_TOUCH_ENABLE_REG); - //Disable Intr & enable touch pad - WRITE_PERI_REG(SENS_SAR_TOUCH_ENABLE_REG, - (v0 & ~((1 << (pad + SENS_TOUCH_PAD_OUTEN2_S)) | (1 << (pad + SENS_TOUCH_PAD_OUTEN1_S)))) - | (1 << (pad + SENS_TOUCH_PAD_WORKEN_S))); - - SET_PERI_REG_MASK(SENS_SAR_TOUCH_ENABLE_REG, (1 << (pad + SENS_TOUCH_PAD_WORKEN_S))); - - uint32_t rtc_tio_reg = RTC_IO_TOUCH_PAD0_REG + pad * 4; - WRITE_PERI_REG(rtc_tio_reg, (READ_PERI_REG(rtc_tio_reg) - & ~(RTC_IO_TOUCH_PAD0_DAC_M)) - | (7 << RTC_IO_TOUCH_PAD0_DAC_S)//Touch Set Slope - | RTC_IO_TOUCH_PAD0_TIE_OPT_M //Enable Tie,Init Level - | RTC_IO_TOUCH_PAD0_START_M //Enable Touch Pad IO - | RTC_IO_TOUCH_PAD0_XPD_M); //Enable Touch Pad Power on - - //force oneTime test start - SET_PERI_REG_MASK(SENS_SAR_TOUCH_CTRL2_REG, SENS_TOUCH_START_EN_M|SENS_TOUCH_START_FORCE_M); - - SET_PERI_REG_BITS(SENS_SAR_TOUCH_CTRL1_REG, SENS_TOUCH_XPD_WAIT, 10, SENS_TOUCH_XPD_WAIT_S); - - while (GET_PERI_REG_MASK(SENS_SAR_TOUCH_CTRL2_REG, SENS_TOUCH_MEAS_DONE) == 0) {}; - - uint16_t touch_value = READ_PERI_REG(SENS_SAR_TOUCH_OUT1_REG + (pad / 2) * 4) >> ((pad & 1) ? SENS_TOUCH_MEAS_OUT1_S : SENS_TOUCH_MEAS_OUT0_S); - - //clear touch force ,select the Touch mode is Timer - CLEAR_PERI_REG_MASK(SENS_SAR_TOUCH_CTRL2_REG, SENS_TOUCH_START_EN_M|SENS_TOUCH_START_FORCE_M); - - //restore previous value - WRITE_PERI_REG(SENS_SAR_TOUCH_ENABLE_REG, v0); - return touch_value; -} - -void __touchAttachInterrupt(uint8_t pin, void (*userFunc)(void), uint16_t threshold) -{ - int8_t pad = digitalPinToTouchChannel(pin); - if(pad < 0){ - return; - } - - pinMode(pin, ANALOG); - - __touchInit(); - - __touchInterruptHandlers[pad] = userFunc; - - //clear touch force ,select the Touch mode is Timer - CLEAR_PERI_REG_MASK(SENS_SAR_TOUCH_CTRL2_REG, SENS_TOUCH_START_EN_M|SENS_TOUCH_START_FORCE_M); - - //interrupt when touch value < threshold - CLEAR_PERI_REG_MASK(SENS_SAR_TOUCH_CTRL1_REG, SENS_TOUCH_OUT_SEL); - //Intr will give ,when SET0 < threshold - SET_PERI_REG_MASK(SENS_SAR_TOUCH_CTRL1_REG, SENS_TOUCH_OUT_1EN); - //Enable Rtc Touch Module Intr,the Interrupt need Rtc out Enable - SET_PERI_REG_MASK(RTC_CNTL_INT_ENA_REG, RTC_CNTL_TOUCH_INT_ENA); - - //set threshold - uint8_t shift = (pad & 1) ? SENS_TOUCH_OUT_TH1_S : SENS_TOUCH_OUT_TH0_S; - SET_PERI_REG_BITS((SENS_SAR_TOUCH_THRES1_REG + (pad / 2) * 4), SENS_TOUCH_OUT_TH0, threshold, shift); - - uint32_t rtc_tio_reg = RTC_IO_TOUCH_PAD0_REG + pad * 4; - WRITE_PERI_REG(rtc_tio_reg, (READ_PERI_REG(rtc_tio_reg) - & ~(RTC_IO_TOUCH_PAD0_DAC_M)) - | (7 << RTC_IO_TOUCH_PAD0_DAC_S)//Touch Set Slope - | RTC_IO_TOUCH_PAD0_TIE_OPT_M //Enable Tie,Init Level - | RTC_IO_TOUCH_PAD0_START_M //Enable Touch Pad IO - | RTC_IO_TOUCH_PAD0_XPD_M); //Enable Touch Pad Power on - - //Enable Digital rtc control :work mode and out mode - SET_PERI_REG_MASK(SENS_SAR_TOUCH_ENABLE_REG, - (1 << (pad + SENS_TOUCH_PAD_WORKEN_S)) | \ - (1 << (pad + SENS_TOUCH_PAD_OUTEN2_S)) | \ - (1 << (pad + SENS_TOUCH_PAD_OUTEN1_S))); -} - -extern uint16_t touchRead(uint8_t pin) __attribute__ ((weak, alias("__touchRead"))); -extern void touchAttachInterrupt(uint8_t pin, void (*userFunc)(void), uint16_t threshold) __attribute__ ((weak, alias("__touchAttachInterrupt"))); -extern void touchSetCycles(uint16_t measure, uint16_t sleep) __attribute__ ((weak, alias("__touchSetCycles"))); diff --git a/cores/esp32/esp32-hal-touch.h b/cores/esp32/esp32-hal-touch.h deleted file mode 100644 index 6f3b0fd0f7d..00000000000 --- a/cores/esp32/esp32-hal-touch.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - Arduino.h - Main include file for the Arduino SDK - Copyright (c) 2005-2013 Arduino Team. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef MAIN_ESP32_HAL_TOUCH_H_ -#define MAIN_ESP32_HAL_TOUCH_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "esp32-hal.h" - -/* - * Set cycles that measurement operation takes - * The result from touchRead, threshold and detection - * accuracy depend on these values. Defaults are - * 0x1000 for measure and 0x1000 for sleep. - * With default values touchRead takes 0.5ms - * */ -void touchSetCycles(uint16_t measure, uint16_t sleep); - -/* - * Read touch pad (values close to 0 mean touch detected) - * You can use this method to chose a good threshold value - * to use as value for touchAttachInterrupt - * */ -uint16_t touchRead(uint8_t pin); - -/* - * Set function to be called if touch pad value falls - * below the given threshold. Use touchRead to determine - * a proper threshold between touched and untouched state - * */ -void touchAttachInterrupt(uint8_t pin, void (*userFunc)(void), uint16_t threshold); - -#ifdef __cplusplus -} -#endif - -#endif /* MAIN_ESP32_HAL_TOUCH_H_ */ diff --git a/cores/esp32/esp32-hal-uart.c b/cores/esp32/esp32-hal-uart.c deleted file mode 100644 index 2dee63dc325..00000000000 --- a/cores/esp32/esp32-hal-uart.c +++ /dev/null @@ -1,582 +0,0 @@ -// 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. - -#include "esp32-hal-uart.h" -#include "esp32-hal.h" -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "freertos/queue.h" -#include "freertos/semphr.h" -#include "rom/ets_sys.h" -#include "esp_attr.h" -#include "esp_intr.h" -#include "rom/uart.h" -#include "soc/uart_reg.h" -#include "soc/uart_struct.h" -#include "soc/io_mux_reg.h" -#include "soc/gpio_sig_map.h" -#include "soc/dport_reg.h" -#include "soc/rtc.h" -#include "esp_intr_alloc.h" - -#define UART_REG_BASE(u) ((u==0)?DR_REG_UART_BASE:( (u==1)?DR_REG_UART1_BASE:( (u==2)?DR_REG_UART2_BASE:0))) -#define UART_RXD_IDX(u) ((u==0)?U0RXD_IN_IDX:( (u==1)?U1RXD_IN_IDX:( (u==2)?U2RXD_IN_IDX:0))) -#define UART_TXD_IDX(u) ((u==0)?U0TXD_OUT_IDX:( (u==1)?U1TXD_OUT_IDX:( (u==2)?U2TXD_OUT_IDX:0))) -#define UART_INTR_SOURCE(u) ((u==0)?ETS_UART0_INTR_SOURCE:( (u==1)?ETS_UART1_INTR_SOURCE:((u==2)?ETS_UART2_INTR_SOURCE:0))) - -static int s_uart_debug_nr = 0; - -struct uart_struct_t { - uart_dev_t * dev; -#if !CONFIG_DISABLE_HAL_LOCKS - xSemaphoreHandle lock; -#endif - uint8_t num; - xQueueHandle queue; - intr_handle_t intr_handle; -}; - -#if CONFIG_DISABLE_HAL_LOCKS -#define UART_MUTEX_LOCK() -#define UART_MUTEX_UNLOCK() - -static uart_t _uart_bus_array[3] = { - {(volatile uart_dev_t *)(DR_REG_UART_BASE), 0, NULL, NULL}, - {(volatile uart_dev_t *)(DR_REG_UART1_BASE), 1, NULL, NULL}, - {(volatile uart_dev_t *)(DR_REG_UART2_BASE), 2, NULL, NULL} -}; -#else -#define UART_MUTEX_LOCK() do {} while (xSemaphoreTake(uart->lock, portMAX_DELAY) != pdPASS) -#define UART_MUTEX_UNLOCK() xSemaphoreGive(uart->lock) - -static uart_t _uart_bus_array[3] = { - {(volatile uart_dev_t *)(DR_REG_UART_BASE), NULL, 0, NULL, NULL}, - {(volatile uart_dev_t *)(DR_REG_UART1_BASE), NULL, 1, NULL, NULL}, - {(volatile uart_dev_t *)(DR_REG_UART2_BASE), NULL, 2, NULL, NULL} -}; -#endif - -static void uart_on_apb_change(void * arg, apb_change_ev_t ev_type, uint32_t old_apb, uint32_t new_apb); - -static void IRAM_ATTR _uart_isr(void *arg) -{ - uint8_t i, c; - BaseType_t xHigherPriorityTaskWoken; - uart_t* uart; - - for(i=0;i<3;i++){ - uart = &_uart_bus_array[i]; - if(uart->intr_handle == NULL){ - continue; - } - uart->dev->int_clr.rxfifo_full = 1; - uart->dev->int_clr.frm_err = 1; - uart->dev->int_clr.rxfifo_tout = 1; - while(uart->dev->status.rxfifo_cnt || (uart->dev->mem_rx_status.wr_addr != uart->dev->mem_rx_status.rd_addr)) { - c = uart->dev->fifo.rw_byte; - if(uart->queue != NULL && !xQueueIsQueueFullFromISR(uart->queue)) { - xQueueSendFromISR(uart->queue, &c, &xHigherPriorityTaskWoken); - } - } - } - - if (xHigherPriorityTaskWoken) { - portYIELD_FROM_ISR(); - } -} - -void uartEnableInterrupt(uart_t* uart) -{ - UART_MUTEX_LOCK(); - uart->dev->conf1.rxfifo_full_thrhd = 112; - uart->dev->conf1.rx_tout_thrhd = 2; - uart->dev->conf1.rx_tout_en = 1; - uart->dev->int_ena.rxfifo_full = 1; - uart->dev->int_ena.frm_err = 1; - uart->dev->int_ena.rxfifo_tout = 1; - uart->dev->int_clr.val = 0xffffffff; - - esp_intr_alloc(UART_INTR_SOURCE(uart->num), (int)ESP_INTR_FLAG_IRAM, _uart_isr, NULL, &uart->intr_handle); - UART_MUTEX_UNLOCK(); -} - -void uartDisableInterrupt(uart_t* uart) -{ - UART_MUTEX_LOCK(); - uart->dev->conf1.val = 0; - uart->dev->int_ena.val = 0; - uart->dev->int_clr.val = 0xffffffff; - - esp_intr_free(uart->intr_handle); - uart->intr_handle = NULL; - - UART_MUTEX_UNLOCK(); -} - -void uartDetachRx(uart_t* uart) -{ - if(uart == NULL) { - return; - } - pinMatrixInDetach(UART_RXD_IDX(uart->num), false, false); - uartDisableInterrupt(uart); -} - -void uartDetachTx(uart_t* uart) -{ - if(uart == NULL) { - return; - } - pinMatrixOutDetach(UART_TXD_IDX(uart->num), false, false); -} - -void uartAttachRx(uart_t* uart, uint8_t rxPin, bool inverted) -{ - if(uart == NULL || rxPin > 39) { - return; - } - pinMode(rxPin, INPUT); - pinMatrixInAttach(rxPin, UART_RXD_IDX(uart->num), inverted); - uartEnableInterrupt(uart); -} - -void uartAttachTx(uart_t* uart, uint8_t txPin, bool inverted) -{ - if(uart == NULL || txPin > 39) { - return; - } - pinMode(txPin, OUTPUT); - pinMatrixOutAttach(txPin, UART_TXD_IDX(uart->num), inverted, false); -} - -uart_t* uartBegin(uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rxPin, int8_t txPin, uint16_t queueLen, bool inverted) -{ - if(uart_nr > 2) { - return NULL; - } - - if(rxPin == -1 && txPin == -1) { - return NULL; - } - - uart_t* uart = &_uart_bus_array[uart_nr]; - -#if !CONFIG_DISABLE_HAL_LOCKS - if(uart->lock == NULL) { - uart->lock = xSemaphoreCreateMutex(); - if(uart->lock == NULL) { - return NULL; - } - } -#endif - - if(queueLen && uart->queue == NULL) { - uart->queue = xQueueCreate(queueLen, sizeof(uint8_t)); //initialize the queue - if(uart->queue == NULL) { - return NULL; - } - } - if(uart_nr == 1){ - DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_UART1_CLK_EN); - DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_UART1_RST); - } else if(uart_nr == 2){ - DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_UART2_CLK_EN); - DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_UART2_RST); - } else { - DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_UART_CLK_EN); - DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_UART_RST); - } - uartFlush(uart); - uartSetBaudRate(uart, baudrate); - UART_MUTEX_LOCK(); - uart->dev->conf0.val = config; - #define TWO_STOP_BITS_CONF 0x3 - #define ONE_STOP_BITS_CONF 0x1 - - if ( uart->dev->conf0.stop_bit_num == TWO_STOP_BITS_CONF) { - uart->dev->conf0.stop_bit_num = ONE_STOP_BITS_CONF; - uart->dev->rs485_conf.dl1_en = 1; - } - UART_MUTEX_UNLOCK(); - - if(rxPin != -1) { - uartAttachRx(uart, rxPin, inverted); - } - - if(txPin != -1) { - uartAttachTx(uart, txPin, inverted); - } - - addApbChangeCallback(uart, uart_on_apb_change); - return uart; -} - -void uartEnd(uart_t* uart) -{ - if(uart == NULL) { - return; - } - removeApbChangeCallback(uart, uart_on_apb_change); - - UART_MUTEX_LOCK(); - if(uart->queue != NULL) { - vQueueDelete(uart->queue); - uart->queue = NULL; - } - - uart->dev->conf0.val = 0; - - UART_MUTEX_UNLOCK(); - - uartDetachRx(uart); - uartDetachTx(uart); -} - -size_t uartResizeRxBuffer(uart_t * uart, size_t new_size) { - if(uart == NULL) { - return 0; - } - - UART_MUTEX_LOCK(); - if(uart->queue != NULL) { - vQueueDelete(uart->queue); - uart->queue = xQueueCreate(new_size, sizeof(uint8_t)); - if(uart->queue == NULL) { - return NULL; - } - } - UART_MUTEX_UNLOCK(); - - return new_size; -} - -uint32_t uartAvailable(uart_t* uart) -{ - if(uart == NULL || uart->queue == NULL) { - return 0; - } - return uxQueueMessagesWaiting(uart->queue); -} - -uint32_t uartAvailableForWrite(uart_t* uart) -{ - if(uart == NULL) { - return 0; - } - return 0x7f - uart->dev->status.txfifo_cnt; -} - -uint8_t uartRead(uart_t* uart) -{ - if(uart == NULL || uart->queue == NULL) { - return 0; - } - uint8_t c; - if(xQueueReceive(uart->queue, &c, 0)) { - return c; - } - return 0; -} - -uint8_t uartPeek(uart_t* uart) -{ - if(uart == NULL || uart->queue == NULL) { - return 0; - } - uint8_t c; - if(xQueuePeek(uart->queue, &c, 0)) { - return c; - } - return 0; -} - -void uartWrite(uart_t* uart, uint8_t c) -{ - if(uart == NULL) { - return; - } - UART_MUTEX_LOCK(); - while(uart->dev->status.txfifo_cnt == 0x7F); - uart->dev->fifo.rw_byte = c; - UART_MUTEX_UNLOCK(); -} - -void uartWriteBuf(uart_t* uart, const uint8_t * data, size_t len) -{ - if(uart == NULL) { - return; - } - UART_MUTEX_LOCK(); - while(len) { - while(uart->dev->status.txfifo_cnt == 0x7F); - uart->dev->fifo.rw_byte = *data++; - len--; - } - UART_MUTEX_UNLOCK(); -} - -void uartFlush(uart_t* uart) -{ - if(uart == NULL) { - return; - } - - UART_MUTEX_LOCK(); - while(uart->dev->status.txfifo_cnt || uart->dev->status.st_utx_out); - - //Due to hardware issue, we can not use fifo_rst to reset uart fifo. - //See description about UART_TXFIFO_RST and UART_RXFIFO_RST in <> v2.6 or later. - - // we read the data out and make `fifo_len == 0 && rd_addr == wr_addr`. - while(uart->dev->status.rxfifo_cnt != 0 || (uart->dev->mem_rx_status.wr_addr != uart->dev->mem_rx_status.rd_addr)) { - READ_PERI_REG(UART_FIFO_REG(uart->num)); - } - - xQueueReset(uart->queue); - - UART_MUTEX_UNLOCK(); -} - -void uartSetBaudRate(uart_t* uart, uint32_t baud_rate) -{ - if(uart == NULL) { - return; - } - UART_MUTEX_LOCK(); - uint32_t clk_div = ((getApbFrequency()<<4)/baud_rate); - uart->dev->clk_div.div_int = clk_div>>4 ; - uart->dev->clk_div.div_frag = clk_div & 0xf; - UART_MUTEX_UNLOCK(); -} - -static void uart_on_apb_change(void * arg, apb_change_ev_t ev_type, uint32_t old_apb, uint32_t new_apb) -{ - uart_t* uart = (uart_t*)arg; - if(ev_type == APB_BEFORE_CHANGE){ - UART_MUTEX_LOCK(); - //disabple interrupt - uart->dev->int_ena.val = 0; - uart->dev->int_clr.val = 0xffffffff; - // read RX fifo - uint8_t c; - BaseType_t xHigherPriorityTaskWoken; - while(uart->dev->status.rxfifo_cnt != 0 || (uart->dev->mem_rx_status.wr_addr != uart->dev->mem_rx_status.rd_addr)) { - c = uart->dev->fifo.rw_byte; - if(uart->queue != NULL && !xQueueIsQueueFullFromISR(uart->queue)) { - xQueueSendFromISR(uart->queue, &c, &xHigherPriorityTaskWoken); - } - } - // wait TX empty - while(uart->dev->status.txfifo_cnt || uart->dev->status.st_utx_out); - } else { - //todo: - // set baudrate - uint32_t clk_div = (uart->dev->clk_div.div_int << 4) | (uart->dev->clk_div.div_frag & 0x0F); - uint32_t baud_rate = ((old_apb<<4)/clk_div); - clk_div = ((new_apb<<4)/baud_rate); - uart->dev->clk_div.div_int = clk_div>>4 ; - uart->dev->clk_div.div_frag = clk_div & 0xf; - //enable interrupts - uart->dev->int_ena.rxfifo_full = 1; - uart->dev->int_ena.frm_err = 1; - uart->dev->int_ena.rxfifo_tout = 1; - uart->dev->int_clr.val = 0xffffffff; - UART_MUTEX_UNLOCK(); - } -} - -uint32_t uartGetBaudRate(uart_t* uart) -{ - if(uart == NULL) { - return 0; - } - - uint32_t clk_div = (uart->dev->clk_div.div_int << 4) | (uart->dev->clk_div.div_frag & 0x0F); - if(!clk_div) { - return 0; - } - - return ((getApbFrequency()<<4)/clk_div); -} - -static void IRAM_ATTR uart0_write_char(char c) -{ - while(((ESP_REG(0x01C+DR_REG_UART_BASE) >> UART_TXFIFO_CNT_S) & 0x7F) == 0x7F); - ESP_REG(DR_REG_UART_BASE) = c; -} - -static void IRAM_ATTR uart1_write_char(char c) -{ - while(((ESP_REG(0x01C+DR_REG_UART1_BASE) >> UART_TXFIFO_CNT_S) & 0x7F) == 0x7F); - ESP_REG(DR_REG_UART1_BASE) = c; -} - -static void IRAM_ATTR uart2_write_char(char c) -{ - while(((ESP_REG(0x01C+DR_REG_UART2_BASE) >> UART_TXFIFO_CNT_S) & 0x7F) == 0x7F); - ESP_REG(DR_REG_UART2_BASE) = c; -} - -void uart_install_putc() -{ - switch(s_uart_debug_nr) { - case 0: - ets_install_putc1((void (*)(char)) &uart0_write_char); - break; - case 1: - ets_install_putc1((void (*)(char)) &uart1_write_char); - break; - case 2: - ets_install_putc1((void (*)(char)) &uart2_write_char); - break; - default: - ets_install_putc1(NULL); - break; - } -} - -void uartSetDebug(uart_t* uart) -{ - if(uart == NULL || uart->num > 2) { - s_uart_debug_nr = -1; - //ets_install_putc1(NULL); - //return; - } else - if(s_uart_debug_nr == uart->num) { - return; - } else - s_uart_debug_nr = uart->num; - uart_install_putc(); -} - -int uartGetDebug() -{ - return s_uart_debug_nr; -} - -int log_printf(const char *format, ...) -{ - if(s_uart_debug_nr < 0){ - return 0; - } - static char loc_buf[64]; - char * temp = loc_buf; - int len; - va_list arg; - va_list copy; - va_start(arg, format); - va_copy(copy, arg); - len = vsnprintf(NULL, 0, format, arg); - va_end(copy); - if(len >= sizeof(loc_buf)){ - temp = (char*)malloc(len+1); - if(temp == NULL) { - return 0; - } - } - vsnprintf(temp, len+1, format, arg); -#if !CONFIG_DISABLE_HAL_LOCKS - if(_uart_bus_array[s_uart_debug_nr].lock){ - xSemaphoreTake(_uart_bus_array[s_uart_debug_nr].lock, portMAX_DELAY); - ets_printf("%s", temp); - xSemaphoreGive(_uart_bus_array[s_uart_debug_nr].lock); - } else { - ets_printf("%s", temp); - } -#else - ets_printf("%s", temp); -#endif - va_end(arg); - if(len >= sizeof(loc_buf)){ - free(temp); - } - return len; -} - -/* - * if enough pulses are detected return the minimum high pulse duration + minimum low pulse duration divided by two. - * This equals one bit period. If flag is true the function return inmediately, otherwise it waits for enough pulses. - */ -unsigned long uartBaudrateDetect(uart_t *uart, bool flg) -{ - while(uart->dev->rxd_cnt.edge_cnt < 30) { // UART_PULSE_NUM(uart_num) - if(flg) return 0; - ets_delay_us(1000); - } - - UART_MUTEX_LOCK(); - unsigned long ret = ((uart->dev->lowpulse.min_cnt + uart->dev->highpulse.min_cnt) >> 1) + 12; - UART_MUTEX_UNLOCK(); - - return ret; -} - -/* - * To start detection of baud rate with the uart the auto_baud.en bit needs to be cleared and set. The bit period is - * detected calling uartBadrateDetect(). The raw baudrate is computed using the UART_CLK_FREQ. The raw baudrate is - * rounded to the closed real baudrate. -*/ -void uartStartDetectBaudrate(uart_t *uart) { - if(!uart) return; - - uart->dev->auto_baud.glitch_filt = 0x08; - uart->dev->auto_baud.en = 0; - uart->dev->auto_baud.en = 1; -} - -unsigned long -uartDetectBaudrate(uart_t *uart) -{ - static bool uartStateDetectingBaudrate = false; - - if(!uartStateDetectingBaudrate) { - uart->dev->auto_baud.glitch_filt = 0x08; - uart->dev->auto_baud.en = 0; - uart->dev->auto_baud.en = 1; - uartStateDetectingBaudrate = true; - } - - unsigned long divisor = uartBaudrateDetect(uart, true); - if (!divisor) { - return 0; - } - - uart->dev->auto_baud.en = 0; - uartStateDetectingBaudrate = false; // Initialize for the next round - - unsigned long baudrate = getApbFrequency() / divisor; - - static const unsigned long default_rates[] = {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 74880, 115200, 230400, 256000, 460800, 921600, 1843200, 3686400}; - - size_t i; - for (i = 1; i < sizeof(default_rates) / sizeof(default_rates[0]) - 1; i++) // find the nearest real baudrate - { - if (baudrate <= default_rates[i]) - { - if (baudrate - default_rates[i - 1] < default_rates[i] - baudrate) { - i--; - } - break; - } - } - - return default_rates[i]; -} - -/* - * Returns the status of the RX state machine, if the value is non-zero the state machine is active. - */ -bool uartRxActive(uart_t* uart) { - return uart->dev->status.st_urx_out != 0; -} diff --git a/cores/esp32/esp32-hal-uart.h b/cores/esp32/esp32-hal-uart.h deleted file mode 100644 index 821ca9c6ce0..00000000000 --- a/cores/esp32/esp32-hal-uart.h +++ /dev/null @@ -1,84 +0,0 @@ -// 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. - -#ifndef MAIN_ESP32_HAL_UART_H_ -#define MAIN_ESP32_HAL_UART_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include - -#define SERIAL_5N1 0x8000010 -#define SERIAL_6N1 0x8000014 -#define SERIAL_7N1 0x8000018 -#define SERIAL_8N1 0x800001c -#define SERIAL_5N2 0x8000030 -#define SERIAL_6N2 0x8000034 -#define SERIAL_7N2 0x8000038 -#define SERIAL_8N2 0x800003c -#define SERIAL_5E1 0x8000012 -#define SERIAL_6E1 0x8000016 -#define SERIAL_7E1 0x800001a -#define SERIAL_8E1 0x800001e -#define SERIAL_5E2 0x8000032 -#define SERIAL_6E2 0x8000036 -#define SERIAL_7E2 0x800003a -#define SERIAL_8E2 0x800003e -#define SERIAL_5O1 0x8000013 -#define SERIAL_6O1 0x8000017 -#define SERIAL_7O1 0x800001b -#define SERIAL_8O1 0x800001f -#define SERIAL_5O2 0x8000033 -#define SERIAL_6O2 0x8000037 -#define SERIAL_7O2 0x800003b -#define SERIAL_8O2 0x800003f - -struct uart_struct_t; -typedef struct uart_struct_t uart_t; - -uart_t* uartBegin(uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rxPin, int8_t txPin, uint16_t queueLen, bool inverted); -void uartEnd(uart_t* uart); - -uint32_t uartAvailable(uart_t* uart); -uint32_t uartAvailableForWrite(uart_t* uart); -uint8_t uartRead(uart_t* uart); -uint8_t uartPeek(uart_t* uart); - -void uartWrite(uart_t* uart, uint8_t c); -void uartWriteBuf(uart_t* uart, const uint8_t * data, size_t len); - -void uartFlush(uart_t* uart); - -void uartSetBaudRate(uart_t* uart, uint32_t baud_rate); -uint32_t uartGetBaudRate(uart_t* uart); - -size_t uartResizeRxBuffer(uart_t* uart, size_t new_size); - -void uartSetDebug(uart_t* uart); -int uartGetDebug(); - -void uartStartDetectBaudrate(uart_t *uart); -unsigned long uartDetectBaudrate(uart_t *uart); - -bool uartRxActive(uart_t* uart); - -#ifdef __cplusplus -} -#endif - -#endif /* MAIN_ESP32_HAL_UART_H_ */ diff --git a/cores/esp32/esp32-hal.h b/cores/esp32/esp32-hal.h deleted file mode 100644 index 4b5fb2c2ebb..00000000000 --- a/cores/esp32/esp32-hal.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - Arduino.h - Main include file for the Arduino SDK - Copyright (c) 2005-2013 Arduino Team. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef HAL_ESP32_HAL_H_ -#define HAL_ESP32_HAL_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include "sdkconfig.h" -#include "esp_system.h" - -#ifndef F_CPU -#define F_CPU (CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ * 1000000U) -#endif - -//forward declaration from freertos/portmacro.h -void vPortYield(void); -void yield(void); -#define optimistic_yield(u) - -#define ESP_REG(addr) *((volatile uint32_t *)(addr)) -#define NOP() asm volatile ("nop") - -#include "esp32-hal-log.h" -#include "esp32-hal-matrix.h" -#include "esp32-hal-uart.h" -#include "esp32-hal-gpio.h" -#include "esp32-hal-touch.h" -#include "esp32-hal-dac.h" -#include "esp32-hal-adc.h" -#include "esp32-hal-spi.h" -#include "esp32-hal-i2c.h" -#include "esp32-hal-ledc.h" -#include "esp32-hal-rmt.h" -#include "esp32-hal-sigmadelta.h" -#include "esp32-hal-timer.h" -#include "esp32-hal-bt.h" -#include "esp32-hal-psram.h" -#include "esp32-hal-cpu.h" - -#ifndef BOARD_HAS_PSRAM -#ifdef CONFIG_SPIRAM_SUPPORT -#undef CONFIG_SPIRAM_SUPPORT -#endif -#endif - -//returns chip temperature in Celsius -float temperatureRead(); - -#if CONFIG_AUTOSTART_ARDUINO -//enable/disable WDT for Arduino's setup and loop functions -void enableLoopWDT(); -void disableLoopWDT(); -//feed WDT for the loop task -void feedLoopWDT(); -#endif - -//enable/disable WDT for the IDLE task on Core 0 (SYSTEM) -void enableCore0WDT(); -void disableCore0WDT(); -#ifndef CONFIG_FREERTOS_UNICORE -//enable/disable WDT for the IDLE task on Core 1 (Arduino) -void enableCore1WDT(); -void disableCore1WDT(); -#endif - -//if xCoreID < 0 or CPU is unicore, it will use xTaskCreate, else xTaskCreatePinnedToCore -//allows to easily handle all possible situations without repetitive code -BaseType_t xTaskCreateUniversal( TaskFunction_t pxTaskCode, - const char * const pcName, - const uint32_t usStackDepth, - void * const pvParameters, - UBaseType_t uxPriority, - TaskHandle_t * const pxCreatedTask, - const BaseType_t xCoreID ); - -unsigned long micros(); -unsigned long millis(); -void delay(uint32_t); -void delayMicroseconds(uint32_t us); - -#if !CONFIG_ESP32_PHY_AUTO_INIT -void arduino_phy_init(); -#endif - -#if !CONFIG_AUTOSTART_ARDUINO -void initArduino(); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* HAL_ESP32_HAL_H_ */ diff --git a/cores/esp32/esp8266-compat.h b/cores/esp32/esp8266-compat.h deleted file mode 100644 index 078fdb72f09..00000000000 --- a/cores/esp32/esp8266-compat.h +++ /dev/null @@ -1,24 +0,0 @@ -// esp8266-compat.h - Compatibility functions to help ESP8266 libraries and user code run on ESP32 - -// Copyright (c) 2017 Evandro Luis Copercini. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef _ESP8266_COMPAT_H_ -#define _ESP8266_COMPAT_H_ - -#define ICACHE_FLASH_ATTR -#define ICACHE_RAM_ATTR IRAM_ATTR - - -#endif /* _ESP8266_COMPAT_H_ */ \ No newline at end of file diff --git a/cores/esp32/libb64/AUTHORS b/cores/esp32/libb64/AUTHORS deleted file mode 100755 index af68737569a..00000000000 --- a/cores/esp32/libb64/AUTHORS +++ /dev/null @@ -1,7 +0,0 @@ -libb64: Base64 Encoding/Decoding Routines -====================================== - -Authors: -------- - -Chris Venter chris.venter@gmail.com http://rocketpod.blogspot.com diff --git a/cores/esp32/libb64/LICENSE b/cores/esp32/libb64/LICENSE deleted file mode 100755 index a6b56069e7f..00000000000 --- a/cores/esp32/libb64/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -Copyright-Only Dedication (based on United States law) -or Public Domain Certification - -The person or persons who have associated work with this document (the -"Dedicator" or "Certifier") hereby either (a) certifies that, to the best of -his knowledge, the work of authorship identified is in the public domain of the -country from which the work is published, or (b) hereby dedicates whatever -copyright the dedicators holds in the work of authorship identified below (the -"Work") to the public domain. A certifier, moreover, dedicates any copyright -interest he may have in the associated work, and for these purposes, is -described as a "dedicator" below. - -A certifier has taken reasonable steps to verify the copyright status of this -work. Certifier recognizes that his good faith efforts may not shield him from -liability if in fact the work certified is not in the public domain. - -Dedicator makes this dedication for the benefit of the public at large and to -the detriment of the Dedicator's heirs and successors. Dedicator intends this -dedication to be an overt act of relinquishment in perpetuity of all present -and future rights under copyright law, whether vested or contingent, in the -Work. Dedicator understands that such relinquishment of all rights includes -the relinquishment of all rights to enforce (by lawsuit or otherwise) those -copyrights in the Work. - -Dedicator recognizes that, once placed in the public domain, the Work may be -freely reproduced, distributed, transmitted, used, modified, built upon, or -otherwise exploited by anyone for any purpose, commercial or non-commercial, -and in any way, including by methods that have not yet been invented or -conceived. \ No newline at end of file diff --git a/cores/esp32/libb64/cdecode.c b/cores/esp32/libb64/cdecode.c deleted file mode 100755 index aa84ef60a8d..00000000000 --- a/cores/esp32/libb64/cdecode.c +++ /dev/null @@ -1,99 +0,0 @@ -/* -cdecoder.c - c source to a base64 decoding algorithm implementation - -This is part of the libb64 project, and has been placed in the public domain. -For details, see http://sourceforge.net/projects/libb64 -*/ - -#include "cdecode.h" -#include - -static int base64_decode_value_signed(int8_t value_in){ - static const int8_t decoding[] = {62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-2,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51}; - static const int8_t decoding_size = sizeof(decoding); - value_in -= 43; - if (value_in < 0 || value_in > decoding_size) return -1; - return decoding[(int)value_in]; -} - -void base64_init_decodestate(base64_decodestate* state_in){ - state_in->step = step_a; - state_in->plainchar = 0; -} - -static int base64_decode_block_signed(const int8_t* code_in, const int length_in, int8_t* plaintext_out, base64_decodestate* state_in){ - const int8_t* codechar = code_in; - int8_t* plainchar = plaintext_out; - int8_t fragment; - - *plainchar = state_in->plainchar; - - switch (state_in->step){ - while (1){ - case step_a: - do { - if (codechar == code_in+length_in){ - state_in->step = step_a; - state_in->plainchar = *plainchar; - return plainchar - plaintext_out; - } - fragment = (int8_t)base64_decode_value_signed(*codechar++); - } while (fragment < 0); - *plainchar = (fragment & 0x03f) << 2; - case step_b: - do { - if (codechar == code_in+length_in){ - state_in->step = step_b; - state_in->plainchar = *plainchar; - return plainchar - plaintext_out; - } - fragment = (int8_t)base64_decode_value_signed(*codechar++); - } while (fragment < 0); - *plainchar++ |= (fragment & 0x030) >> 4; - *plainchar = (fragment & 0x00f) << 4; - case step_c: - do { - if (codechar == code_in+length_in){ - state_in->step = step_c; - state_in->plainchar = *plainchar; - return plainchar - plaintext_out; - } - fragment = (int8_t)base64_decode_value_signed(*codechar++); - } while (fragment < 0); - *plainchar++ |= (fragment & 0x03c) >> 2; - *plainchar = (fragment & 0x003) << 6; - case step_d: - do { - if (codechar == code_in+length_in){ - state_in->step = step_d; - state_in->plainchar = *plainchar; - return plainchar - plaintext_out; - } - fragment = (int8_t)base64_decode_value_signed(*codechar++); - } while (fragment < 0); - *plainchar++ |= (fragment & 0x03f); - } - } - /* control should not reach here */ - return plainchar - plaintext_out; -} - -static int base64_decode_chars_signed(const int8_t* code_in, const int length_in, int8_t* plaintext_out){ - base64_decodestate _state; - base64_init_decodestate(&_state); - int len = base64_decode_block_signed(code_in, length_in, plaintext_out, &_state); - if(len > 0) plaintext_out[len] = 0; - return len; -} - -int base64_decode_value(char value_in){ - return base64_decode_value_signed(*((int8_t *) &value_in)); -} - -int base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in){ - return base64_decode_block_signed((int8_t *) code_in, length_in, (int8_t *) plaintext_out, state_in); -} - -int base64_decode_chars(const char* code_in, const int length_in, char* plaintext_out){ - return base64_decode_chars_signed((int8_t *) code_in, length_in, (int8_t *) plaintext_out); -} diff --git a/cores/esp32/libb64/cdecode.h b/cores/esp32/libb64/cdecode.h deleted file mode 100755 index 44f114f691c..00000000000 --- a/cores/esp32/libb64/cdecode.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -cdecode.h - c header for a base64 decoding algorithm - -This is part of the libb64 project, and has been placed in the public domain. -For details, see http://sourceforge.net/projects/libb64 -*/ - -#ifndef BASE64_CDECODE_H -#define BASE64_CDECODE_H - -#define base64_decode_expected_len(n) ((n * 3) / 4) - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - step_a, step_b, step_c, step_d -} base64_decodestep; - -typedef struct { - base64_decodestep step; - char plainchar; -} base64_decodestate; - -void base64_init_decodestate(base64_decodestate* state_in); - -int base64_decode_value(char value_in); - -int base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in); - -int base64_decode_chars(const char* code_in, const int length_in, char* plaintext_out); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif /* BASE64_CDECODE_H */ diff --git a/cores/esp32/libb64/cencode.c b/cores/esp32/libb64/cencode.c deleted file mode 100755 index 48a0d30b7e9..00000000000 --- a/cores/esp32/libb64/cencode.c +++ /dev/null @@ -1,102 +0,0 @@ -/* -cencoder.c - c source to a base64 encoding algorithm implementation - -This is part of the libb64 project, and has been placed in the public domain. -For details, see http://sourceforge.net/projects/libb64 -*/ - -#include "cencode.h" - -void base64_init_encodestate(base64_encodestate* state_in) -{ - state_in->step = step_A; - state_in->result = 0; -} - -char base64_encode_value(char value_in) -{ - static const char* encoding = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - if (value_in > 63) { - return '='; - } - return encoding[(int)value_in]; -} - -int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, base64_encodestate* state_in) -{ - const char* plainchar = plaintext_in; - const char* const plaintextend = plaintext_in + length_in; - char* codechar = code_out; - char result; - char fragment; - - result = state_in->result; - - switch (state_in->step) { - while (1) { - case step_A: - if (plainchar == plaintextend) { - state_in->result = result; - state_in->step = step_A; - return codechar - code_out; - } - fragment = *plainchar++; - result = (fragment & 0x0fc) >> 2; - *codechar++ = base64_encode_value(result); - result = (fragment & 0x003) << 4; - case step_B: - if (plainchar == plaintextend) { - state_in->result = result; - state_in->step = step_B; - return codechar - code_out; - } - fragment = *plainchar++; - result |= (fragment & 0x0f0) >> 4; - *codechar++ = base64_encode_value(result); - result = (fragment & 0x00f) << 2; - case step_C: - if (plainchar == plaintextend) { - state_in->result = result; - state_in->step = step_C; - return codechar - code_out; - } - fragment = *plainchar++; - result |= (fragment & 0x0c0) >> 6; - *codechar++ = base64_encode_value(result); - result = (fragment & 0x03f) >> 0; - *codechar++ = base64_encode_value(result); - } - } - /* control should not reach here */ - return codechar - code_out; -} - -int base64_encode_blockend(char* code_out, base64_encodestate* state_in) -{ - char* codechar = code_out; - - switch (state_in->step) { - case step_B: - *codechar++ = base64_encode_value(state_in->result); - *codechar++ = '='; - *codechar++ = '='; - break; - case step_C: - *codechar++ = base64_encode_value(state_in->result); - *codechar++ = '='; - break; - case step_A: - break; - } - *codechar = 0x00; - - return codechar - code_out; -} - -int base64_encode_chars(const char* plaintext_in, int length_in, char* code_out) -{ - base64_encodestate _state; - base64_init_encodestate(&_state); - int len = base64_encode_block(plaintext_in, length_in, code_out, &_state); - return len + base64_encode_blockend((code_out + len), &_state); -} diff --git a/cores/esp32/libb64/cencode.h b/cores/esp32/libb64/cencode.h deleted file mode 100755 index 51bb3f3dd75..00000000000 --- a/cores/esp32/libb64/cencode.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -cencode.h - c header for a base64 encoding algorithm - -This is part of the libb64 project, and has been placed in the public domain. -For details, see http://sourceforge.net/projects/libb64 -*/ - -#ifndef BASE64_CENCODE_H -#define BASE64_CENCODE_H - -#define base64_encode_expected_len(n) ((((4 * n) / 3) + 3) & ~3) - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - step_A, step_B, step_C -} base64_encodestep; - -typedef struct { - base64_encodestep step; - char result; - int stepcount; -} base64_encodestate; - -void base64_init_encodestate(base64_encodestate* state_in); - -char base64_encode_value(char value_in); - -int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, base64_encodestate* state_in); - -int base64_encode_blockend(char* code_out, base64_encodestate* state_in); - -int base64_encode_chars(const char* plaintext_in, int length_in, char* code_out); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif /* BASE64_CENCODE_H */ diff --git a/cores/esp32/main.cpp b/cores/esp32/main.cpp deleted file mode 100644 index 3a455c8a878..00000000000 --- a/cores/esp32/main.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "esp_task_wdt.h" -#include "Arduino.h" - -TaskHandle_t loopTaskHandle = NULL; - -#if CONFIG_AUTOSTART_ARDUINO - -bool loopTaskWDTEnabled; - -void loopTask(void *pvParameters) -{ - setup(); - for(;;) { - if(loopTaskWDTEnabled){ - esp_task_wdt_reset(); - } - loop(); - } -} - -extern "C" void app_main() -{ - loopTaskWDTEnabled = false; - initArduino(); - xTaskCreateUniversal(loopTask, "loopTask", 8192, NULL, 1, &loopTaskHandle, CONFIG_ARDUINO_RUNNING_CORE); -} - -#endif diff --git a/cores/esp32/pgmspace.h b/cores/esp32/pgmspace.h deleted file mode 100644 index aa58775ff57..00000000000 --- a/cores/esp32/pgmspace.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - Copyright (c) 2015 Hristo Gochkov. All rights reserved. - This file is part of the RaspberryPi core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#ifndef PGMSPACE_INCLUDE -#define PGMSPACE_INCLUDE - -typedef void prog_void; -typedef char prog_char; -typedef unsigned char prog_uchar; -typedef char prog_int8_t; -typedef unsigned char prog_uint8_t; -typedef short prog_int16_t; -typedef unsigned short prog_uint16_t; -typedef long prog_int32_t; -typedef unsigned long prog_uint32_t; - -#define PROGMEM -#define PGM_P const char * -#define PGM_VOID_P const void * -#define PSTR(s) (s) -#define _SFR_BYTE(n) (n) - -#define pgm_read_byte(addr) (*(const unsigned char *)(addr)) -#define pgm_read_word(addr) ({ \ - typeof(addr) _addr = (addr); \ - *(const unsigned short *)(_addr); \ -}) -#define pgm_read_dword(addr) ({ \ - typeof(addr) _addr = (addr); \ - *(const unsigned long *)(_addr); \ -}) -#define pgm_read_float(addr) ({ \ - typeof(addr) _addr = (addr); \ - *(const float *)(_addr); \ -}) -#define pgm_read_ptr(addr) ({ \ - typeof(addr) _addr = (addr); \ - *(void * const *)(_addr); \ -}) - -#define pgm_read_byte_near(addr) pgm_read_byte(addr) -#define pgm_read_word_near(addr) pgm_read_word(addr) -#define pgm_read_dword_near(addr) pgm_read_dword(addr) -#define pgm_read_float_near(addr) pgm_read_float(addr) -#define pgm_read_ptr_near(addr) pgm_read_ptr(addr) -#define pgm_read_byte_far(addr) pgm_read_byte(addr) -#define pgm_read_word_far(addr) pgm_read_word(addr) -#define pgm_read_dword_far(addr) pgm_read_dword(addr) -#define pgm_read_float_far(addr) pgm_read_float(addr) -#define pgm_read_ptr_far(addr) pgm_read_ptr(addr) - -#define memcmp_P memcmp -#define memccpy_P memccpy -#define memmem_P memmem -#define memcpy_P memcpy -#define strcpy_P strcpy -#define strncpy_P strncpy -#define strcat_P strcat -#define strncat_P strncat -#define strcmp_P strcmp -#define strncmp_P strncmp -#define strcasecmp_P strcasecmp -#define strncasecmp_P strncasecmp -#define strlen_P strlen -#define strnlen_P strnlen -#define strstr_P strstr -#define printf_P printf -#define sprintf_P sprintf -#define snprintf_P snprintf -#define vsnprintf_P vsnprintf - -#endif diff --git a/cores/esp32/stdlib_noniso.c b/cores/esp32/stdlib_noniso.c deleted file mode 100644 index e7920489037..00000000000 --- a/cores/esp32/stdlib_noniso.c +++ /dev/null @@ -1,161 +0,0 @@ -/* - core_esp8266_noniso.c - nonstandard (but usefull) conversion functions - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Modified 03 April 2015 by Markus Sattler - - */ - -#include -#include -#include -#include -#include -#include "stdlib_noniso.h" - -void reverse(char* begin, char* end) { - char *is = begin; - char *ie = end - 1; - while(is < ie) { - char tmp = *ie; - *ie = *is; - *is = tmp; - ++is; - --ie; - } -} - -char* ltoa(long value, char* result, int base) { - if(base < 2 || base > 16) { - *result = 0; - return result; - } - - char* out = result; - long quotient = abs(value); - - do { - const long tmp = quotient / base; - *out = "0123456789abcdef"[quotient - (tmp * base)]; - ++out; - quotient = tmp; - } while(quotient); - - // Apply negative sign - if(value < 0) - *out++ = '-'; - - reverse(result, out); - *out = 0; - return result; -} - -char* ultoa(unsigned long value, char* result, int base) { - if(base < 2 || base > 16) { - *result = 0; - return result; - } - - char* out = result; - unsigned long quotient = value; - - do { - const unsigned long tmp = quotient / base; - *out = "0123456789abcdef"[quotient - (tmp * base)]; - ++out; - quotient = tmp; - } while(quotient); - - reverse(result, out); - *out = 0; - return result; -} - -char * dtostrf(double number, signed char width, unsigned char prec, char *s) { - bool negative = false; - - if (isnan(number)) { - strcpy(s, "nan"); - return s; - } - if (isinf(number)) { - strcpy(s, "inf"); - return s; - } - - char* out = s; - - int fillme = width; // how many cells to fill for the integer part - if (prec > 0) { - fillme -= (prec+1); - } - - // Handle negative numbers - if (number < 0.0) { - negative = true; - fillme--; - number = -number; - } - - // Round correctly so that print(1.999, 2) prints as "2.00" - // I optimized out most of the divisions - double rounding = 2.0; - for (uint8_t i = 0; i < prec; ++i) - rounding *= 10.0; - rounding = 1.0 / rounding; - - number += rounding; - - // Figure out how big our number really is - double tenpow = 1.0; - int digitcount = 1; - while (number >= 10.0 * tenpow) { - tenpow *= 10.0; - digitcount++; - } - - number /= tenpow; - fillme -= digitcount; - - // Pad unused cells with spaces - while (fillme-- > 0) { - *out++ = ' '; - } - - // Handle negative sign - if (negative) *out++ = '-'; - - // Print the digits, and if necessary, the decimal point - digitcount += prec; - int8_t digit = 0; - while (digitcount-- > 0) { - digit = (int8_t)number; - if (digit > 9) digit = 9; // insurance - *out++ = (char)('0' | digit); - if ((digitcount == prec) && (prec > 0)) { - *out++ = '.'; - } - number -= digit; - number *= 10.0; - } - - // make sure the string is terminated - *out = 0; - return s; -} diff --git a/cores/esp32/stdlib_noniso.h b/cores/esp32/stdlib_noniso.h deleted file mode 100644 index 3df2cc2a1b6..00000000000 --- a/cores/esp32/stdlib_noniso.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - stdlib_noniso.h - nonstandard (but usefull) conversion functions - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef STDLIB_NONISO_H -#define STDLIB_NONISO_H - -#ifdef __cplusplus -extern "C" { -#endif - -int atoi(const char *s); - -long atol(const char* s); - -double atof(const char* s); - -char* itoa (int val, char *s, int radix); - -char* ltoa (long val, char *s, int radix); - -char* utoa (unsigned int val, char *s, int radix); - -char* ultoa (unsigned long val, char *s, int radix); - -char* dtostrf (double val, signed char width, unsigned char prec, char *s); - -#ifdef __cplusplus -} // extern "C" -#endif - - -#endif diff --git a/cores/esp32/wiring_private.h b/cores/esp32/wiring_private.h deleted file mode 100644 index 2c53565a674..00000000000 --- a/cores/esp32/wiring_private.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - wiring_private.h - Internal header file. - Part of Arduino - http://www.arduino.cc/ - - Copyright (c) 2005-2006 David A. Mellis - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA - - $Id: wiring.h 239 2007-01-12 17:58:39Z mellis $ - */ - -#ifndef WiringPrivate_h -#define WiringPrivate_h - -#include -#include - -#include "Arduino.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void (*voidFuncPtr)(void); - -void initPins(); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif diff --git a/cores/esp32/wiring_pulse.c b/cores/esp32/wiring_pulse.c deleted file mode 100644 index e63267895d4..00000000000 --- a/cores/esp32/wiring_pulse.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - pulse.c - wiring pulseIn implementation for esp8266 - Copyright (c) 2015 Hristo Gochkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -//#include -#include "wiring_private.h" -#include "pins_arduino.h" - - -extern uint32_t xthal_get_ccount(); - -#define WAIT_FOR_PIN_STATE(state) \ - while (digitalRead(pin) != (state)) { \ - if (xthal_get_ccount() - start_cycle_count > timeout_cycles) { \ - return 0; \ - } \ - } - -// max timeout is 27 seconds at 160MHz clock and 54 seconds at 80MHz clock -unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout) -{ - const uint32_t max_timeout_us = clockCyclesToMicroseconds(UINT_MAX); - if (timeout > max_timeout_us) { - timeout = max_timeout_us; - } - const uint32_t timeout_cycles = microsecondsToClockCycles(timeout); - const uint32_t start_cycle_count = xthal_get_ccount(); - WAIT_FOR_PIN_STATE(!state); - WAIT_FOR_PIN_STATE(state); - const uint32_t pulse_start_cycle_count = xthal_get_ccount(); - WAIT_FOR_PIN_STATE(!state); - return clockCyclesToMicroseconds(xthal_get_ccount() - pulse_start_cycle_count); -} - -unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout) -{ - return pulseIn(pin, state, timeout); -} diff --git a/cores/esp32/wiring_shift.c b/cores/esp32/wiring_shift.c deleted file mode 100644 index c6c279aa8a3..00000000000 --- a/cores/esp32/wiring_shift.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - wiring_shift.c - shiftOut() function - Part of Arduino - http://www.arduino.cc/ - Copyright (c) 2005-2006 David A. Mellis - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA - $Id: wiring.c 248 2007-02-03 15:36:30Z mellis $ - */ - -#include "esp32-hal.h" -#include "wiring_private.h" - -uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder) { - uint8_t value = 0; - uint8_t i; - - for(i = 0; i < 8; ++i) { - //digitalWrite(clockPin, HIGH); - if(bitOrder == LSBFIRST) - value |= digitalRead(dataPin) << i; - else - value |= digitalRead(dataPin) << (7 - i); - digitalWrite(clockPin, HIGH); - digitalWrite(clockPin, LOW); - } - return value; -} - -void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val) { - uint8_t i; - - for(i = 0; i < 8; i++) { - if(bitOrder == LSBFIRST) - digitalWrite(dataPin, !!(val & (1 << i))); - else - digitalWrite(dataPin, !!(val & (1 << (7 - i)))); - - digitalWrite(clockPin, HIGH); - digitalWrite(clockPin, LOW); - } -} diff --git a/docs/ISSUE_TEMPLATE.md b/docs/ISSUE_TEMPLATE.md deleted file mode 100644 index 55f00770c68..00000000000 --- a/docs/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,45 +0,0 @@ -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) -Then if someone is interested and knowledgeable you might get a answer. 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/update date: ?11/jul/2017? -IDE name: ?Arduino IDE? ?Platform.io? ?IDF component? -Flash Frequency: ?40Mhz? -PSRAM enabled: ?no? -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/docs/OTAWebUpdate/OTAWebUpdate.md b/docs/OTAWebUpdate/OTAWebUpdate.md deleted file mode 100644 index 383f6214433..00000000000 --- a/docs/OTAWebUpdate/OTAWebUpdate.md +++ /dev/null @@ -1,59 +0,0 @@ -# Over the Air through Web browser -OTAWebUpdate is done with a web browser that can be useful in the following typical scenarios: -- Once the application developed and loading directly from Arduino IDE is inconvenient or not possible -- after deployment if user is unable to expose Firmware for OTA from external update server -- provide updates after deployment to small quantity of modules when setting an update server is not practicable - -## Requirements -- The ESP and the computer must be connected to the same network - -## Implementation -The sample implementation has been done using: -- example sketch OTAWebUpdater.ino -- ESP32 (Dev Module) - -You can use another module also if it meets Flash chip size of the sketch - -1-Before you begin, please make sure that you have the following software installed: - - Arduino IDE - - Host software depending on O/S you use: - - Avahi http://avahi.org/ for Linux - - Bonjour http://www.apple.com/support/bonjour/ for Windows - - Mac OSX and iOS - support is already built in / no any extra s/w is required - -Prepare the sketch and configuration for initial upload with a serial port -- Start Arduino IDE and load sketch OTAWebUpdater.ino available under File > Examples > OTAWebUpdater.ino -- Update ssid and pass in the sketch so the module can join your Wi-Fi network -- Open File > Preferences, look for “Show verbose output during:” and check out “compilation” option - -![verbrose](esp32verbose.PNG) - -- Upload sketch (Ctrl+U) -- Now open web browser and enter the url, i.e. http://esp32.local. Once entered, browser should display a form - -![login](esp32login.PNG) - -> username= admin - -> password= admin - -**Note**-*If entering “http://ESP32.local” does not work, try replacing “ESP32” with module’s IP address.This workaround is useful in case the host software installed does not work*. - -Now click on Login button and browser will display a upload form - -![upload](esp32upload.PNG) - -For Uploading the New Firmware you need to provide the Binary File of your Code. - -Exporting Binary file of the Firmware (Code) -- Open up the Arduino IDE -- Open up the Code, for Exporting up Binary file -- Now go to Sketch > export compiled Binary -![export](exportTobinary.PNG) - -- Binary file is exported to the same Directory where your code is present - -Once you are comfortable with this procedure go ahead and modify OTAWebUpdater.ino sketch to print some additional messages, compile it, Export new binary file and upload it using web browser to see entered changes on a Serial Monitor - - - diff --git a/docs/OTAWebUpdate/esp32login.PNG b/docs/OTAWebUpdate/esp32login.PNG deleted file mode 100644 index 48c90c7f452..00000000000 Binary files a/docs/OTAWebUpdate/esp32login.PNG and /dev/null differ diff --git a/docs/OTAWebUpdate/esp32upload.PNG b/docs/OTAWebUpdate/esp32upload.PNG deleted file mode 100644 index 81f2eaba79d..00000000000 Binary files a/docs/OTAWebUpdate/esp32upload.PNG and /dev/null differ diff --git a/docs/OTAWebUpdate/esp32verbose.PNG b/docs/OTAWebUpdate/esp32verbose.PNG deleted file mode 100644 index bd9c3fc41fe..00000000000 Binary files a/docs/OTAWebUpdate/esp32verbose.PNG and /dev/null differ diff --git a/docs/OTAWebUpdate/exportTobinary.PNG b/docs/OTAWebUpdate/exportTobinary.PNG deleted file mode 100644 index 62d85831724..00000000000 Binary files a/docs/OTAWebUpdate/exportTobinary.PNG and /dev/null differ diff --git a/docs/arduino-ide/boards_manager.md b/docs/arduino-ide/boards_manager.md deleted file mode 100644 index 9161ba6ff3e..00000000000 --- a/docs/arduino-ide/boards_manager.md +++ /dev/null @@ -1,13 +0,0 @@ -Installation instructions using Arduino IDE Boards Manager -========================================================== - -Starting with 1.6.4, Arduino allows installation of third-party platform packages using Boards Manager. We have packages available for Windows, Mac OS, and Linux (32 and 64 bit). - -- Install the current upstream Arduino IDE at the 1.8 level or later. The current version is at the [Arduino website](http://www.arduino.cc/en/main/software). -- Start Arduino and open Preferences window. -- Enter ```https://dl.espressif.com/dl/package_esp32_index.json``` into *Additional Board Manager URLs* field. You can add multiple URLs, separating them with commas. -- Open Boards Manager from Tools > Board menu and install *esp32* platform (and don't forget to select your ESP32 board from Tools > Board menu after installation). - -Stable release link: `https://dl.espressif.com/dl/package_esp32_index.json` - -Development release link: `https://dl.espressif.com/dl/package_esp32_dev_index.json` diff --git a/docs/arduino-ide/debian_ubuntu.md b/docs/arduino-ide/debian_ubuntu.md deleted file mode 100644 index 79149673677..00000000000 --- a/docs/arduino-ide/debian_ubuntu.md +++ /dev/null @@ -1,36 +0,0 @@ -Installation instructions for Debian / Ubuntu OS -================================================= - -- Install latest Arduino IDE from [arduino.cc](https://www.arduino.cc/en/Main/Software) -- Open Terminal and execute the following command (copy->paste and hit enter): - - ```bash - sudo usermod -a -G dialout $USER && \ - sudo apt-get install git && \ - wget https://bootstrap.pypa.io/get-pip.py && \ - sudo python get-pip.py && \ - sudo pip install pyserial && \ - mkdir -p ~/Arduino/hardware/espressif && \ - cd ~/Arduino/hardware/espressif && \ - git clone https://github.com/espressif/arduino-esp32.git esp32 && \ - cd esp32 && \ - git submodule update --init --recursive && \ - cd tools && \ - python3 get.py - ``` -- Restart Arduino IDE - - - -- If you have Arduino installed to ~/, modify the installation as follows, beginning at `mkdir -p ~/Arduino/hardware`: - - ```bash - cd ~/Arduino/hardware - mkdir -p espressif && \ - cd espressif && \ - git clone https://github.com/espressif/arduino-esp32.git esp32 && \ - cd esp32 && \ - git submodule update --init --recursive && \ - cd tools && \ - python3 get.py - ``` diff --git a/docs/arduino-ide/fedora.md b/docs/arduino-ide/fedora.md deleted file mode 100644 index c28a2cace5b..00000000000 --- a/docs/arduino-ide/fedora.md +++ /dev/null @@ -1,18 +0,0 @@ -Installation instructions for Fedora -===================================== - -- Install the latest Arduino IDE from [arduino.cc](https://www.arduino.cc/en/Main/Software). `$ sudo dnf -y install arduino` will most likely install an older release. -- Open Terminal and execute the following command (copy->paste and hit enter): - - ```bash - sudo usermod -a -G dialout $USER && \ - sudo dnf install git python3-pip python3-pyserial && \ - mkdir -p ~/Arduino/hardware/espressif && \ - cd ~/Arduino/hardware/espressif && \ - git clone https://github.com/espressif/arduino-esp32.git esp32 && \ - cd esp32 && \ - git submodule update --init --recursive && \ - cd tools && \ - python get.py - ``` -- Restart Arduino IDE diff --git a/docs/arduino-ide/mac.md b/docs/arduino-ide/mac.md deleted file mode 100644 index 9807cc7df2d..00000000000 --- a/docs/arduino-ide/mac.md +++ /dev/null @@ -1,29 +0,0 @@ -Installation instructions for Mac OS -===================================== - -- Install latest Arduino IDE from [arduino.cc](https://www.arduino.cc/en/Main/Software) -- Open Terminal and execute the following command (copy->paste and hit enter): - - ```bash - mkdir -p ~/Documents/Arduino/hardware/espressif && \ - cd ~/Documents/Arduino/hardware/espressif && \ - git clone https://github.com/espressif/arduino-esp32.git esp32 && \ - cd esp32 && \ - git submodule update --init --recursive && \ - cd tools && \ - python get.py - ``` - Where `~/Documents/Arduino` represents your sketch book location as per "Arduino" > "Preferences" > "Sketchbook location" (in the IDE once started). Adjust the command above accordingly if necessary! -   -- If you get the error below. Install the command line dev tools with xcode-select --install and try the command above again: - - ```xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun``` - - ```xcode-select --install``` - -- Try `python3` instead of `python` if you get the error: `IOError: [Errno socket error] [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)` when running `python get.py` - -- If you get the following error when running `python get.py` urllib.error.URLError: Applications > Python3.6 folder (or any other python version), and run the following scripts: Install Certificates.command and Update Shell Profile.command - -- Restart Arduino IDE - diff --git a/docs/arduino-ide/opensuse.md b/docs/arduino-ide/opensuse.md deleted file mode 100644 index 4f28b9dd346..00000000000 --- a/docs/arduino-ide/opensuse.md +++ /dev/null @@ -1,22 +0,0 @@ -Installation instructions for openSUSE -====================================== - -- Install the latest Arduino IDE from [arduino.cc](https://www.arduino.cc/en/Main/Software). -- Open Terminal and execute the following command (copy->paste and hit enter): - - ```bash - sudo usermod -a -G dialout $USER && \ - if [ `python --version 2>&1 | grep '2.7' | wc -l` = "1" ]; then \ - sudo zypper install git python-pip python-pyserial; \ - else \ - sudo zypper install git python3-pip python3-pyserial; \ - fi && \ - mkdir -p ~/Arduino/hardware/espressif && \ - cd ~/Arduino/hardware/espressif && \ - git clone https://github.com/espressif/arduino-esp32.git esp32 && \ - cd esp32 && \ - git submodule update --init --recursive && \ - cd tools && \ - python get.py - ``` -- Restart Arduino IDE diff --git a/docs/arduino-ide/win-screenshots/arduino-ide.png b/docs/arduino-ide/win-screenshots/arduino-ide.png deleted file mode 100644 index bef12aceace..00000000000 Binary files a/docs/arduino-ide/win-screenshots/arduino-ide.png and /dev/null differ diff --git a/docs/arduino-ide/win-screenshots/win-gui-1.png b/docs/arduino-ide/win-screenshots/win-gui-1.png deleted file mode 100644 index 5129cd0d581..00000000000 Binary files a/docs/arduino-ide/win-screenshots/win-gui-1.png and /dev/null differ diff --git a/docs/arduino-ide/win-screenshots/win-gui-2.png b/docs/arduino-ide/win-screenshots/win-gui-2.png deleted file mode 100644 index b4a2ebbaa7b..00000000000 Binary files a/docs/arduino-ide/win-screenshots/win-gui-2.png and /dev/null differ diff --git a/docs/arduino-ide/win-screenshots/win-gui-3.png b/docs/arduino-ide/win-screenshots/win-gui-3.png deleted file mode 100644 index 4f0fe759959..00000000000 Binary files a/docs/arduino-ide/win-screenshots/win-gui-3.png and /dev/null differ diff --git a/docs/arduino-ide/win-screenshots/win-gui-4.png b/docs/arduino-ide/win-screenshots/win-gui-4.png deleted file mode 100644 index 9e975c08be1..00000000000 Binary files a/docs/arduino-ide/win-screenshots/win-gui-4.png and /dev/null differ diff --git a/docs/arduino-ide/win-screenshots/win-gui-5.png b/docs/arduino-ide/win-screenshots/win-gui-5.png deleted file mode 100644 index 5eeb1b41603..00000000000 Binary files a/docs/arduino-ide/win-screenshots/win-gui-5.png and /dev/null differ diff --git a/docs/arduino-ide/win-screenshots/win-gui-update-1.png b/docs/arduino-ide/win-screenshots/win-gui-update-1.png deleted file mode 100644 index 9162bf46430..00000000000 Binary files a/docs/arduino-ide/win-screenshots/win-gui-update-1.png and /dev/null differ diff --git a/docs/arduino-ide/win-screenshots/win-gui-update-2.png b/docs/arduino-ide/win-screenshots/win-gui-update-2.png deleted file mode 100644 index 702c9b0a858..00000000000 Binary files a/docs/arduino-ide/win-screenshots/win-gui-update-2.png and /dev/null differ diff --git a/docs/arduino-ide/windows.md b/docs/arduino-ide/windows.md deleted file mode 100644 index d98f2b285ab..00000000000 --- a/docs/arduino-ide/windows.md +++ /dev/null @@ -1,49 +0,0 @@ -## Steps to install Arduino ESP32 support on Windows -### Tested on 32 and 64 bit Windows 10 machines - -1. Download and install the latest Arduino IDE ```Windows Installer``` from [arduino.cc](https://www.arduino.cc/en/Main/Software) -2. Download and install Git from [git-scm.com](https://git-scm.com/download/win) -3. Start ```Git GUI``` and run through the following steps: - - Select ```Clone Existing Repository``` - - ![Step 1](win-screenshots/win-gui-1.png) - - - Select source and destination - - Sketchbook Directory: Usually ```C:/Users/[YOUR_USER_NAME]/Documents/Arduino``` and is listed underneath the "Sketchbook location" in Arduino preferences. - - Source Location: ```https://github.com/espressif/arduino-esp32.git``` - - Target Directory: ```[ARDUINO_SKETCHBOOK_DIR]/hardware/espressif/esp32``` - - Click ```Clone``` to start cloning the repository - - ![Step 2](win-screenshots/win-gui-2.png) - ![Step 3](win-screenshots/win-gui-3.png) - - open a `Git Bash` session pointing to ```[ARDUINO_SKETCHBOOK_DIR]/hardware/espressif/esp32``` and execute ```git submodule update --init --recursive``` - - Open ```[ARDUINO_SKETCHBOOK_DIR]/hardware/espressif/esp32/tools``` and double-click ```get.exe``` - - ![Step 4](win-screenshots/win-gui-4.png) - - - When ```get.exe``` finishes, you should see the following files in the directory - - ![Step 5](win-screenshots/win-gui-5.png) - -4. Plug your ESP32 board and wait for the drivers to install (or install manually any that might be required) -5. Start Arduino IDE -6. Select your board in ```Tools > Board``` menu -7. Select the COM port that the board is attached to -8. Compile and upload (You might need to hold the boot button while uploading) - - ![Arduino IDE Example](win-screenshots/arduino-ide.png) - -### How to update to the latest code - -1. Start ```Git GUI``` and you should see the repository under ```Open Recent Repository```. Click on it! - - ![Update Step 1](win-screenshots/win-gui-update-1.png) - -2. From menu ```Remote``` select ```Fetch from``` > ```origin``` - - ![Update Step 2](win-screenshots/win-gui-update-2.png) - -3. Wait for git to pull any changes and close ```Git GUI``` -4. Open ```[ARDUINO_SKETCHBOOK_DIR]/hardware/espressif/esp32/tools``` and double-click ```get.exe``` - - ![Step 4](win-screenshots/win-gui-4.png) diff --git a/docs/esp-idf_component.md b/docs/esp-idf_component.md deleted file mode 100644 index e58c157328d..00000000000 --- a/docs/esp-idf_component.md +++ /dev/null @@ -1,73 +0,0 @@ -To use as a component of ESP-IDF -================================================= - -## Installation - -- Download and install [esp-idf](https://github.com/espressif/esp-idf) -- Create blank idf project (from one of the examples) -- in the project folder, create a folder called components and clone this repository inside - - ```bash - mkdir -p components && \ - cd components && \ - git clone https://github.com/espressif/arduino-esp32.git arduino && \ - cd arduino && \ - git submodule update --init --recursive && \ - cd ../.. && \ - make menuconfig - ``` -- ```make menuconfig``` has some Arduino options - - "Autostart Arduino setup and loop on boot" - - If you enable this options, your main.cpp should be formated like any other sketch - - ```arduino - //file: main.cpp - #include "Arduino.h" - - void setup(){ - Serial.begin(115200); - } - - void loop(){ - Serial.println("loop"); - delay(1000); - } - ``` - - - Else 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 [esp-idf](https://github.com/espressif/esp-idf/tree/master/examples), please make sure move the app_main() function in main.cpp from the files in the example. - - ```arduino - //file: main.cpp - #include "Arduino.h" - - extern "C" void app_main() - { - initArduino(); - pinMode(4, OUTPUT); - digitalWrite(4, HIGH); - //do your own thing - } - ``` - - "Disable mutex locks for HAL" - - If enabled, there will be no protection on the drivers from concurently accessing them from another thread/interrupt/core - - "Autoconnect WiFi on boot" - - If enabled, WiFi will start with the last known configuration - - Else it will wait for WiFi.begin -- ```make flash monitor``` will build, upload and open serial monitor to your board - -## Logging To Serial - -If you are writing code that does not require Arduino to compile and you want your `ESP_LOGx` macros to work in Arduino IDE, you can enable the compatibility by adding the following lines after your includes: - -```cpp -#ifdef ARDUINO_ARCH_ESP32 -#include "esp32-hal-log.h" -#endif -``` - -## Compilation Errors - -As commits are made to esp-idf and submodules, the codebases can develop incompatibilities which cause compilation errors. If you have problems compiling, follow the instructions in [Issue #1142](https://github.com/espressif/arduino-esp32/issues/1142) to roll esp-idf back to a known good version. diff --git a/docs/esp32_pinmap.png b/docs/esp32_pinmap.png deleted file mode 100644 index 2c46148f330..00000000000 Binary files a/docs/esp32_pinmap.png and /dev/null differ diff --git a/docs/make.md b/docs/make.md deleted file mode 100644 index 1fca5d79f9f..00000000000 --- a/docs/make.md +++ /dev/null @@ -1,4 +0,0 @@ -To use make -============ - - [makeEspArduino](https://github.com/plerup/makeEspArduino) is a generic makefile for any ESP8266/ESP32 Arduino project.Using make instead of the Arduino IDE makes it easier to do automated and production builds. diff --git a/docs/platformio.md b/docs/platformio.md deleted file mode 100644 index 33f4b22cba3..00000000000 --- a/docs/platformio.md +++ /dev/null @@ -1,11 +0,0 @@ -Installation instructions for using PlatformIO -================================================= - -- [What is PlatformIO?](https://docs.platformio.org/en/latest/what-is-platformio.html?utm_source=github&utm_medium=arduino-esp32) -- [PlatformIO IDE](https://platformio.org/platformio-ide?utm_source=github&utm_medium=arduino-esp32) -- [PlatformIO Core](https://docs.platformio.org/en/latest/core.html?utm_source=github&utm_medium=arduino-esp32) (command line tool) -- [Advanced usage](https://docs.platformio.org/en/latest/platforms/espressif32.html?utm_source=github&utm_medium=arduino-esp32) - - custom settings, uploading to SPIFFS, Over-the-Air (OTA), staging version -- [Integration with Cloud and Standalone IDEs](https://docs.platformio.org/en/latest/ide.html?utm_source=github&utm_medium=arduino-esp32) - - Cloud9, Codeanywhere, Eclipse Che (Codenvy), Atom, CLion, Eclipse, Emacs, NetBeans, Qt Creator, Sublime Text, VIM, Visual Studio, and VSCode -- [Project Examples](https://docs.platformio.org/en/latest/platforms/espressif32.html?utm_source=github&utm_medium=arduino-esp32#examples) diff --git a/index.md b/index.md new file mode 100644 index 00000000000..f40315c03cc --- /dev/null +++ b/index.md @@ -0,0 +1,105 @@ +# Arduino core for the ESP32, ESP32-C3, ESP32-C6, ESP32-H2, ESP32-P4, ESP32-S2 and ESP32-S3. + +[![Build Status](https://img.shields.io/github/actions/workflow/status/espressif/arduino-esp32/push.yml?branch=master&event=push&label=Compilation%20Tests)](https://github.com/espressif/arduino-esp32/actions/workflows/push.yml?query=branch%3Amaster+event%3Apush) +[![Verbose Build Status](https://img.shields.io/github/actions/workflow/status/espressif/arduino-esp32/push.yml?branch=master&event=schedule&label=Compilation%20Tests%20(Verbose))](https://github.com/espressif/arduino-esp32/actions/workflows/push.yml?query=branch%3Amaster+event%3Aschedule) +[![External Libraries Test](https://img.shields.io/github/actions/workflow/status/espressif/arduino-esp32/lib.yml?branch=master&event=schedule&label=External%20Libraries%20Test)](https://github.com/espressif/arduino-esp32/blob/gh-pages/LIBRARIES_TEST.md) +[![Runtime Tests](https://github.com/espressif/arduino-esp32/blob/gh-pages/runtime-tests-results/badge.svg)](https://github.com/espressif/arduino-esp32/blob/gh-pages/runtime-tests-results/RUNTIME_TESTS_REPORT.md) + +### Need help or have a question? Join the chat at [Discord](https://discord.gg/8xY6e9crwv) or [open a new Discussion](https://github.com/espressif/arduino-esp32/discussions) + +[![Discord invite](https://img.shields.io/discord/1327272229427216425?logo=discord&logoColor=white&logoSize=auto&label=Discord)](https://discord.gg/8xY6e9crwv) + +## Contents + + - [Development Status](#development-status) + - [Development Planning](#development-planning) + - [Documentation](#documentation) + - [Supported Chips](#supported-chips) + - [Decoding exceptions](#decoding-exceptions) + - [Issue/Bug report template](#issuebug-report-template) + - [Contributing](#contributing) + +### Development Status + +#### Latest Stable Release + +[![Release Version](https://img.shields.io/github/release/espressif/arduino-esp32.svg)](https://github.com/espressif/arduino-esp32/releases/latest/) +[![Release Date](https://img.shields.io/github/release-date/espressif/arduino-esp32.svg)](https://github.com/espressif/arduino-esp32/releases/latest/) +[![Downloads](https://img.shields.io/github/downloads/espressif/arduino-esp32/latest/total.svg)](https://github.com/espressif/arduino-esp32/releases/latest/) + +#### Latest Development Release + +[![Release Version](https://img.shields.io/github/release/espressif/arduino-esp32/all.svg)](https://github.com/espressif/arduino-esp32/releases/) +[![Release Date](https://img.shields.io/github/release-date-pre/espressif/arduino-esp32.svg)](https://github.com/espressif/arduino-esp32/releases/) +[![Downloads](https://img.shields.io/github/downloads-pre/espressif/arduino-esp32/latest/total.svg)](https://github.com/espressif/arduino-esp32/releases/) + +### Development Planning + +Our Development is fully tracked on this public **[Roadmap 🎉](https://github.com/orgs/espressif/projects/3)** + +For even more information you can join our **[Monthly Community Meetings 🔔](https://github.com/espressif/arduino-esp32/discussions/categories/monthly-community-meetings).** + +### Documentation + +You can use the [Arduino-ESP32 Online Documentation](https://docs.espressif.com/projects/arduino-esp32/en/latest/) to get all information about this project. + +--- + +**Migration guide from version 2.x to 3.x is available [here](https://docs.espressif.com/projects/arduino-esp32/en/latest/migration_guides/2.x_to_3.0.html).** + +--- + +**APIs compatibility with ESP8266 and Arduino-CORE (Arduino.cc) is explained [here](https://docs.espressif.com/projects/arduino-esp32/en/latest/libraries.html#apis).** + +--- + +* [Getting Started](https://docs.espressif.com/projects/arduino-esp32/en/latest/getting_started.html) +* [Installing (Windows, Linux and macOS)](https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html) +* [Libraries](https://docs.espressif.com/projects/arduino-esp32/en/latest/libraries.html) +* [Arduino as an ESP-IDF component](https://docs.espressif.com/projects/arduino-esp32/en/latest/esp-idf_component.html) +* [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 + +Here are the ESP32 series supported by the Arduino-ESP32 project: + +| **SoC** | **Stable** | **Development** | **Datasheet** | +|----------|:----------:|:---------------:|:-------------------------------------------------------------------------------------------------:| +| ESP32 | Yes | Yes | [ESP32](https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf) | +| ESP32-C3 | Yes | Yes | [ESP32-C3](https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf) | +| ESP32-C6 | Yes | Yes | [ESP32-C6](https://www.espressif.com/sites/default/files/documentation/esp32-c6_datasheet_en.pdf) | +| ESP32-H2 | Yes | Yes | [ESP32-H2](https://www.espressif.com/sites/default/files/documentation/esp32-h2_datasheet_en.pdf) | +| ESP32-P4 | Yes | Yes | [ESP32-P4](https://www.espressif.com/sites/default/files/documentation/esp32-p4_datasheet_en.pdf) | +| ESP32-S2 | Yes | Yes | [ESP32-S2](https://www.espressif.com/sites/default/files/documentation/esp32-s2_datasheet_en.pdf) | +| ESP32-S3 | Yes | Yes | [ESP32-S3](https://www.espressif.com/sites/default/files/documentation/esp32-s3_datasheet_en.pdf) | + +> [!NOTE] +> ESP32-C2 is also supported by Arduino-ESP32 but requires using Arduino as an ESP-IDF component or rebuilding the static libraries. +> For more information, see the [Arduino as an ESP-IDF component documentation](https://docs.espressif.com/projects/arduino-esp32/en/latest/esp-idf_component.html) or the +> [Lib Builder documentation](https://docs.espressif.com/projects/arduino-esp32/en/latest/lib_builder.html), respectively. + +For more details visit the [supported chips](https://docs.espressif.com/projects/arduino-esp32/en/latest/getting_started.html#supported-soc-s) documentation page. + +### Decoding exceptions + +You can use [EspExceptionDecoder](https://github.com/me-no-dev/EspExceptionDecoder) to get meaningful call trace. + +### 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 labeled 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** or **Feature request template** while reporting any [new Issue](https://github.com/espressif/arduino-esp32/issues/new/choose). + +### External libraries compilation test + +We have set-up CI testing for external libraries for ESP32 Arduino core. You can check test results in the file [LIBRARIES_TEST](https://github.com/espressif/arduino-esp32/blob/gh-pages/LIBRARIES_TEST.md). +For more information and how to add your library to the test see [external library testing](https://docs.espressif.com/projects/arduino-esp32/en/latest/external_libraries_test.html) in the documentation. + +### Contributing + +We welcome contributions to the Arduino ESP32 project! + +See [contributing](https://docs.espressif.com/projects/arduino-esp32/en/latest/contributing.html) in the documentation for more information on how to contribute to the project. + +> We would like to have this repository in a polite and friendly atmosphere, so please be kind and respectful to others. For more details, look at [Code of Conduct](https://github.com/espressif/arduino-esp32/blob/master/CODE_OF_CONDUCT.md). diff --git a/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino b/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino deleted file mode 100644 index 83652495295..00000000000 --- a/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino +++ /dev/null @@ -1,68 +0,0 @@ -#include -#include -#include -#include - -const char* ssid = ".........."; -const char* password = ".........."; - -void setup() { - Serial.begin(115200); - Serial.println("Booting"); - WiFi.mode(WIFI_STA); - WiFi.begin(ssid, password); - while (WiFi.waitForConnectResult() != WL_CONNECTED) { - Serial.println("Connection Failed! Rebooting..."); - delay(5000); - ESP.restart(); - } - - // Port defaults to 3232 - // ArduinoOTA.setPort(3232); - - // Hostname defaults to esp3232-[MAC] - // ArduinoOTA.setHostname("myesp32"); - - // No authentication by default - // ArduinoOTA.setPassword("admin"); - - // Password can be set with it's md5 value as well - // MD5(admin) = 21232f297a57a5a743894a0e4a801fc3 - // ArduinoOTA.setPasswordHash("21232f297a57a5a743894a0e4a801fc3"); - - ArduinoOTA - .onStart([]() { - String type; - if (ArduinoOTA.getCommand() == U_FLASH) - type = "sketch"; - else // U_SPIFFS - type = "filesystem"; - - // NOTE: if updating SPIFFS this would be the place to unmount SPIFFS using SPIFFS.end() - Serial.println("Start updating " + type); - }) - .onEnd([]() { - Serial.println("\nEnd"); - }) - .onProgress([](unsigned int progress, unsigned int total) { - Serial.printf("Progress: %u%%\r", (progress / (total / 100))); - }) - .onError([](ota_error_t error) { - Serial.printf("Error[%u]: ", error); - if (error == OTA_AUTH_ERROR) Serial.println("Auth Failed"); - else if (error == OTA_BEGIN_ERROR) Serial.println("Begin Failed"); - else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed"); - else if (error == OTA_RECEIVE_ERROR) Serial.println("Receive Failed"); - else if (error == OTA_END_ERROR) Serial.println("End Failed"); - }); - - ArduinoOTA.begin(); - - Serial.println("Ready"); - Serial.print("IP address: "); - Serial.println(WiFi.localIP()); -} - -void loop() { - ArduinoOTA.handle(); -} \ No newline at end of file diff --git a/libraries/ArduinoOTA/examples/OTAWebUpdater/OTAWebUpdater.ino b/libraries/ArduinoOTA/examples/OTAWebUpdater/OTAWebUpdater.ino deleted file mode 100644 index ed93c59f975..00000000000 --- a/libraries/ArduinoOTA/examples/OTAWebUpdater/OTAWebUpdater.ino +++ /dev/null @@ -1,168 +0,0 @@ -#include -#include -#include -#include -#include - -const char* host = "esp32"; -const char* ssid = "xxx"; -const char* password = "xxxx"; - -WebServer server(80); - -/* - * Login page - */ - -const char* loginIndex = - "
" - "" - "" - "" - "
" - "
" - "" - "" - "" - "" - "
" - "
" - "" - "" - "" - "
" - "
" - "" - "" - "" - "" - "
" - "
ESP32 Login Page
" - "
" - "
Username:
Password:
" -"
" -""; - -/* - * Server Index Page - */ - -const char* serverIndex = -"" -"
" - "" - "" - "
" - "
progress: 0%
" - ""; - -/* - * setup function - */ -void setup(void) { - Serial.begin(115200); - - // Connect to WiFi network - WiFi.begin(ssid, password); - Serial.println(""); - - // Wait for connection - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - } - Serial.println(""); - Serial.print("Connected to "); - Serial.println(ssid); - Serial.print("IP address: "); - Serial.println(WiFi.localIP()); - - /*use mdns for host name resolution*/ - if (!MDNS.begin(host)) { //http://esp32.local - Serial.println("Error setting up MDNS responder!"); - while (1) { - delay(1000); - } - } - Serial.println("mDNS responder started"); - /*return index page which is stored in serverIndex */ - server.on("/", HTTP_GET, []() { - server.sendHeader("Connection", "close"); - server.send(200, "text/html", loginIndex); - }); - server.on("/serverIndex", HTTP_GET, []() { - server.sendHeader("Connection", "close"); - server.send(200, "text/html", serverIndex); - }); - /*handling uploading firmware file */ - server.on("/update", HTTP_POST, []() { - server.sendHeader("Connection", "close"); - server.send(200, "text/plain", (Update.hasError()) ? "FAIL" : "OK"); - ESP.restart(); - }, []() { - HTTPUpload& upload = server.upload(); - if (upload.status == UPLOAD_FILE_START) { - Serial.printf("Update: %s\n", upload.filename.c_str()); - if (!Update.begin(UPDATE_SIZE_UNKNOWN)) { //start with max available size - Update.printError(Serial); - } - } else if (upload.status == UPLOAD_FILE_WRITE) { - /* flashing firmware to ESP*/ - if (Update.write(upload.buf, upload.currentSize) != upload.currentSize) { - Update.printError(Serial); - } - } else if (upload.status == UPLOAD_FILE_END) { - if (Update.end(true)) { //true to set the size to the current progress - Serial.printf("Update Success: %u\nRebooting...\n", upload.totalSize); - } else { - Update.printError(Serial); - } - } - }); - server.begin(); -} - -void loop(void) { - server.handleClient(); - delay(1); -} diff --git a/libraries/ArduinoOTA/keywords.txt b/libraries/ArduinoOTA/keywords.txt deleted file mode 100644 index 1c14d9e8989..00000000000 --- a/libraries/ArduinoOTA/keywords.txt +++ /dev/null @@ -1,26 +0,0 @@ -####################################### -# Syntax Coloring Map For Ultrasound -####################################### - -####################################### -# Datatypes (KEYWORD1) -####################################### - -ArduinoOTA KEYWORD1 - -####################################### -# Methods and Functions (KEYWORD2) -####################################### - -begin KEYWORD2 -setup KEYWORD2 -handle KEYWORD2 -onStart KEYWORD2 -onEnd KEYWORD2 -onError KEYWORD2 -onProgress KEYWORD2 - -####################################### -# Constants (LITERAL1) -####################################### - diff --git a/libraries/ArduinoOTA/library.properties b/libraries/ArduinoOTA/library.properties deleted file mode 100644 index 22d78c55a7b..00000000000 --- a/libraries/ArduinoOTA/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=ArduinoOTA -version=1.0 -author=Ivan Grokhotkov and Hristo Gochkov -maintainer=Hristo Gochkov -sentence=Enables Over The Air upgrades, via wifi and espota.py UDP request/TCP download. -paragraph=With this library you can enable your sketch to be upgraded over network. Includes mdns anounces to get discovered by the arduino IDE. -category=Communication -url= -architectures=esp32 diff --git a/libraries/ArduinoOTA/src/ArduinoOTA.cpp b/libraries/ArduinoOTA/src/ArduinoOTA.cpp deleted file mode 100644 index 884c9d341c1..00000000000 --- a/libraries/ArduinoOTA/src/ArduinoOTA.cpp +++ /dev/null @@ -1,383 +0,0 @@ -#ifndef LWIP_OPEN_SRC -#define LWIP_OPEN_SRC -#endif -#include -#include -#include "ArduinoOTA.h" -#include "ESPmDNS.h" -#include "MD5Builder.h" -#include "Update.h" - - -// #define OTA_DEBUG Serial - -ArduinoOTAClass::ArduinoOTAClass() -: _port(0) -, _initialized(false) -, _rebootOnSuccess(true) -, _mdnsEnabled(true) -, _state(OTA_IDLE) -, _size(0) -, _cmd(0) -, _ota_port(0) -, _ota_timeout(1000) -, _start_callback(NULL) -, _end_callback(NULL) -, _error_callback(NULL) -, _progress_callback(NULL) -{ -} - -ArduinoOTAClass::~ArduinoOTAClass(){ - _udp_ota.stop(); -} - -ArduinoOTAClass& ArduinoOTAClass::onStart(THandlerFunction fn) { - _start_callback = fn; - return *this; -} - -ArduinoOTAClass& ArduinoOTAClass::onEnd(THandlerFunction fn) { - _end_callback = fn; - return *this; -} - -ArduinoOTAClass& ArduinoOTAClass::onProgress(THandlerFunction_Progress fn) { - _progress_callback = fn; - return *this; -} - -ArduinoOTAClass& ArduinoOTAClass::onError(THandlerFunction_Error fn) { - _error_callback = fn; - return *this; -} - -ArduinoOTAClass& ArduinoOTAClass::setPort(uint16_t port) { - if (!_initialized && !_port && port) { - _port = port; - } - return *this; -} - -ArduinoOTAClass& ArduinoOTAClass::setHostname(const char * hostname) { - if (!_initialized && !_hostname.length() && hostname) { - _hostname = hostname; - } - return *this; -} - -String ArduinoOTAClass::getHostname() { - return _hostname; -} - -ArduinoOTAClass& ArduinoOTAClass::setPassword(const char * password) { - if (!_initialized && !_password.length() && password) { - MD5Builder passmd5; - passmd5.begin(); - passmd5.add(password); - passmd5.calculate(); - _password = passmd5.toString(); - } - return *this; -} - -ArduinoOTAClass& ArduinoOTAClass::setPasswordHash(const char * password) { - if (!_initialized && !_password.length() && password) { - _password = password; - } - return *this; -} - -ArduinoOTAClass& ArduinoOTAClass::setRebootOnSuccess(bool reboot){ - _rebootOnSuccess = reboot; - return *this; -} - -ArduinoOTAClass& ArduinoOTAClass::setMdnsEnabled(bool enabled){ - _mdnsEnabled = enabled; - return *this; -} - -void ArduinoOTAClass::begin() { - if (_initialized){ - log_w("already initialized"); - return; - } - - if (!_port) { - _port = 3232; - } - - if(!_udp_ota.begin(_port)){ - log_e("udp bind failed"); - return; - } - - - if (!_hostname.length()) { - char tmp[20]; - uint8_t mac[6]; - WiFi.macAddress(mac); - sprintf(tmp, "esp32-%02x%02x%02x%02x%02x%02x", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - _hostname = tmp; - } - if(_mdnsEnabled){ - MDNS.begin(_hostname.c_str()); - MDNS.enableArduino(_port, (_password.length() > 0)); - } - _initialized = true; - _state = OTA_IDLE; - log_i("OTA server at: %s.local:%u", _hostname.c_str(), _port); -} - -int ArduinoOTAClass::parseInt(){ - char data[INT_BUFFER_SIZE]; - uint8_t index = 0; - char value; - while(_udp_ota.peek() == ' ') _udp_ota.read(); - while(index < INT_BUFFER_SIZE - 1){ - value = _udp_ota.peek(); - if(value < '0' || value > '9'){ - data[index++] = '\0'; - return atoi(data); - } - data[index++] = _udp_ota.read(); - } - return 0; -} - -String ArduinoOTAClass::readStringUntil(char end){ - String res = ""; - int value; - while(true){ - value = _udp_ota.read(); - if(value <= 0 || value == end){ - return res; - } - res += (char)value; - } - return res; -} - -void ArduinoOTAClass::_onRx(){ - if (_state == OTA_IDLE) { - int cmd = parseInt(); - if (cmd != U_FLASH && cmd != U_SPIFFS) - return; - _cmd = cmd; - _ota_port = parseInt(); - _size = parseInt(); - _udp_ota.read(); - _md5 = readStringUntil('\n'); - _md5.trim(); - if(_md5.length() != 32){ - log_e("bad md5 length"); - return; - } - - if (_password.length()){ - MD5Builder nonce_md5; - nonce_md5.begin(); - nonce_md5.add(String(micros())); - nonce_md5.calculate(); - _nonce = nonce_md5.toString(); - - _udp_ota.beginPacket(_udp_ota.remoteIP(), _udp_ota.remotePort()); - _udp_ota.printf("AUTH %s", _nonce.c_str()); - _udp_ota.endPacket(); - _state = OTA_WAITAUTH; - return; - } else { - _udp_ota.beginPacket(_udp_ota.remoteIP(), _udp_ota.remotePort()); - _udp_ota.print("OK"); - _udp_ota.endPacket(); - _ota_ip = _udp_ota.remoteIP(); - _state = OTA_RUNUPDATE; - } - } else if (_state == OTA_WAITAUTH) { - int cmd = parseInt(); - if (cmd != U_AUTH) { - log_e("%d was expected. got %d instead", U_AUTH, cmd); - _state = OTA_IDLE; - return; - } - _udp_ota.read(); - String cnonce = readStringUntil(' '); - String response = readStringUntil('\n'); - if (cnonce.length() != 32 || response.length() != 32) { - log_e("auth param fail"); - _state = OTA_IDLE; - return; - } - - String challenge = _password + ":" + String(_nonce) + ":" + cnonce; - MD5Builder _challengemd5; - _challengemd5.begin(); - _challengemd5.add(challenge); - _challengemd5.calculate(); - String result = _challengemd5.toString(); - - if(result.equals(response)){ - _udp_ota.beginPacket(_udp_ota.remoteIP(), _udp_ota.remotePort()); - _udp_ota.print("OK"); - _udp_ota.endPacket(); - _ota_ip = _udp_ota.remoteIP(); - _state = OTA_RUNUPDATE; - } else { - _udp_ota.beginPacket(_udp_ota.remoteIP(), _udp_ota.remotePort()); - _udp_ota.print("Authentication Failed"); - log_w("Authentication Failed"); - _udp_ota.endPacket(); - if (_error_callback) _error_callback(OTA_AUTH_ERROR); - _state = OTA_IDLE; - } - } -} - -void ArduinoOTAClass::_runUpdate() { - if (!Update.begin(_size, _cmd)) { - - log_e("Begin ERROR: %s", Update.errorString()); - - if (_error_callback) { - _error_callback(OTA_BEGIN_ERROR); - } - _state = OTA_IDLE; - return; - } - Update.setMD5(_md5.c_str()); - - if (_start_callback) { - _start_callback(); - } - if (_progress_callback) { - _progress_callback(0, _size); - } - - WiFiClient client; - if (!client.connect(_ota_ip, _ota_port)) { - if (_error_callback) { - _error_callback(OTA_CONNECT_ERROR); - } - _state = OTA_IDLE; - } - - uint32_t written = 0, total = 0, tried = 0; - - while (!Update.isFinished() && client.connected()) { - size_t waited = _ota_timeout; - size_t available = client.available(); - while (!available && waited){ - delay(1); - waited -=1 ; - available = client.available(); - } - if (!waited){ - if(written && tried++ < 3){ - log_i("Try[%u]: %u", tried, written); - if(!client.printf("%u", written)){ - log_e("failed to respond"); - _state = OTA_IDLE; - break; - } - continue; - } - log_e("Receive Failed"); - if (_error_callback) { - _error_callback(OTA_RECEIVE_ERROR); - } - _state = OTA_IDLE; - Update.abort(); - return; - } - if(!available){ - log_e("No Data: %u", waited); - _state = OTA_IDLE; - break; - } - tried = 0; - static uint8_t buf[1460]; - if(available > 1460){ - available = 1460; - } - size_t r = client.read(buf, available); - if(r != available){ - log_w("didn't read enough! %u != %u", r, available); - } - - written = Update.write(buf, r); - if (written > 0) { - if(written != r){ - log_w("didn't write enough! %u != %u", written, r); - } - if(!client.printf("%u", written)){ - log_w("failed to respond"); - } - total += written; - if(_progress_callback) { - _progress_callback(total, _size); - } - } else { - log_e("Write ERROR: %s", Update.errorString()); - } - } - - if (Update.end()) { - client.print("OK"); - client.stop(); - delay(10); - if (_end_callback) { - _end_callback(); - } - if(_rebootOnSuccess){ - //let serial/network finish tasks that might be given in _end_callback - delay(100); - ESP.restart(); - } - } else { - if (_error_callback) { - _error_callback(OTA_END_ERROR); - } - Update.printError(client); - client.stop(); - delay(10); - log_e("Update ERROR: %s", Update.errorString()); - _state = OTA_IDLE; - } -} - -void ArduinoOTAClass::end() { - _initialized = false; - _udp_ota.stop(); - if(_mdnsEnabled){ - MDNS.end(); - } - _state = OTA_IDLE; - log_i("OTA server stopped."); -} - -void ArduinoOTAClass::handle() { - if (!_initialized) { - return; - } - if (_state == OTA_RUNUPDATE) { - _runUpdate(); - _state = OTA_IDLE; - } - if(_udp_ota.parsePacket()){ - _onRx(); - } - _udp_ota.flush(); // always flush, even zero length packets must be flushed. -} - -int ArduinoOTAClass::getCommand() { - return _cmd; -} - -void ArduinoOTAClass::setTimeout(int timeoutInMillis) { - _ota_timeout = timeoutInMillis; -} - -#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_ARDUINOOTA) -ArduinoOTAClass ArduinoOTA; -#endif diff --git a/libraries/ArduinoOTA/src/ArduinoOTA.h b/libraries/ArduinoOTA/src/ArduinoOTA.h deleted file mode 100644 index db0ead631db..00000000000 --- a/libraries/ArduinoOTA/src/ArduinoOTA.h +++ /dev/null @@ -1,111 +0,0 @@ -#ifndef __ARDUINO_OTA_H -#define __ARDUINO_OTA_H - -#include -#include -#include "Update.h" - -#define INT_BUFFER_SIZE 16 - -typedef enum { - OTA_IDLE, - OTA_WAITAUTH, - OTA_RUNUPDATE -} ota_state_t; - -typedef enum { - OTA_AUTH_ERROR, - OTA_BEGIN_ERROR, - OTA_CONNECT_ERROR, - OTA_RECEIVE_ERROR, - OTA_END_ERROR -} ota_error_t; - -class ArduinoOTAClass -{ - public: - typedef std::function THandlerFunction; - typedef std::function THandlerFunction_Error; - typedef std::function THandlerFunction_Progress; - - ArduinoOTAClass(); - ~ArduinoOTAClass(); - - //Sets the service port. Default 3232 - ArduinoOTAClass& setPort(uint16_t port); - - //Sets the device hostname. Default esp32-xxxxxx - ArduinoOTAClass& setHostname(const char *hostname); - String getHostname(); - - //Sets the password that will be required for OTA. Default NULL - ArduinoOTAClass& setPassword(const char *password); - - //Sets the password as above but in the form MD5(password). Default NULL - ArduinoOTAClass& setPasswordHash(const char *password); - - //Sets if the device should be rebooted after successful update. Default true - ArduinoOTAClass& setRebootOnSuccess(bool reboot); - - //Sets if the device should advertise itself to Arduino IDE. Default true - ArduinoOTAClass& setMdnsEnabled(bool enabled); - - //This callback will be called when OTA connection has begun - ArduinoOTAClass& onStart(THandlerFunction fn); - - //This callback will be called when OTA has finished - ArduinoOTAClass& onEnd(THandlerFunction fn); - - //This callback will be called when OTA encountered Error - ArduinoOTAClass& onError(THandlerFunction_Error fn); - - //This callback will be called when OTA is receiving data - ArduinoOTAClass& onProgress(THandlerFunction_Progress fn); - - //Starts the ArduinoOTA service - void begin(); - - //Ends the ArduinoOTA service - void end(); - - //Call this in loop() to run the service - void handle(); - - //Gets update command type after OTA has started. Either U_FLASH or U_SPIFFS - int getCommand(); - - void setTimeout(int timeoutInMillis); - - private: - int _port; - String _password; - String _hostname; - String _nonce; - WiFiUDP _udp_ota; - bool _initialized; - bool _rebootOnSuccess; - bool _mdnsEnabled; - ota_state_t _state; - int _size; - int _cmd; - int _ota_port; - int _ota_timeout; - IPAddress _ota_ip; - String _md5; - - THandlerFunction _start_callback; - THandlerFunction _end_callback; - THandlerFunction_Error _error_callback; - THandlerFunction_Progress _progress_callback; - - void _runUpdate(void); - void _onRx(void); - int parseInt(void); - String readStringUntil(char end); -}; - -#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_ARDUINOOTA) -extern ArduinoOTAClass ArduinoOTA; -#endif - -#endif /* __ARDUINO_OTA_H */ \ No newline at end of file diff --git a/libraries/AsyncUDP/examples/AsyncUDPClient/AsyncUDPClient.ino b/libraries/AsyncUDP/examples/AsyncUDPClient/AsyncUDPClient.ino deleted file mode 100644 index 3348f8a76a4..00000000000 --- a/libraries/AsyncUDP/examples/AsyncUDPClient/AsyncUDPClient.ino +++ /dev/null @@ -1,51 +0,0 @@ -#include "WiFi.h" -#include "AsyncUDP.h" - -const char * ssid = "***********"; -const char * password = "***********"; - -AsyncUDP udp; - -void setup() -{ - Serial.begin(115200); - WiFi.mode(WIFI_STA); - WiFi.begin(ssid, password); - if (WiFi.waitForConnectResult() != WL_CONNECTED) { - Serial.println("WiFi Failed"); - while(1) { - delay(1000); - } - } - if(udp.connect(IPAddress(192,168,1,100), 1234)) { - Serial.println("UDP connected"); - udp.onPacket([](AsyncUDPPacket packet) { - Serial.print("UDP Packet Type: "); - Serial.print(packet.isBroadcast()?"Broadcast":packet.isMulticast()?"Multicast":"Unicast"); - Serial.print(", From: "); - Serial.print(packet.remoteIP()); - Serial.print(":"); - Serial.print(packet.remotePort()); - Serial.print(", To: "); - Serial.print(packet.localIP()); - Serial.print(":"); - Serial.print(packet.localPort()); - Serial.print(", Length: "); - Serial.print(packet.length()); - Serial.print(", Data: "); - Serial.write(packet.data(), packet.length()); - Serial.println(); - //reply to the client - packet.printf("Got %u bytes of data", packet.length()); - }); - //Send unicast - udp.print("Hello Server!"); - } -} - -void loop() -{ - delay(1000); - //Send broadcast on port 1234 - udp.broadcastTo("Anyone here?", 1234); -} diff --git a/libraries/AsyncUDP/examples/AsyncUDPMulticastServer/AsyncUDPMulticastServer.ino b/libraries/AsyncUDP/examples/AsyncUDPMulticastServer/AsyncUDPMulticastServer.ino deleted file mode 100644 index 2bbbac51c4d..00000000000 --- a/libraries/AsyncUDP/examples/AsyncUDPMulticastServer/AsyncUDPMulticastServer.ino +++ /dev/null @@ -1,52 +0,0 @@ -#include "WiFi.h" -#include "AsyncUDP.h" - -const char * ssid = "***********"; -const char * password = "***********"; - -AsyncUDP udp; - -void setup() -{ - Serial.begin(115200); - WiFi.mode(WIFI_STA); - WiFi.begin(ssid, password); - if (WiFi.waitForConnectResult() != WL_CONNECTED) { - Serial.println("WiFi Failed"); - while(1) { - delay(1000); - } - } - if(udp.listenMulticast(IPAddress(239,1,2,3), 1234)) { - Serial.print("UDP Listening on IP: "); - Serial.println(WiFi.localIP()); - udp.onPacket([](AsyncUDPPacket packet) { - Serial.print("UDP Packet Type: "); - Serial.print(packet.isBroadcast()?"Broadcast":packet.isMulticast()?"Multicast":"Unicast"); - Serial.print(", From: "); - Serial.print(packet.remoteIP()); - Serial.print(":"); - Serial.print(packet.remotePort()); - Serial.print(", To: "); - Serial.print(packet.localIP()); - Serial.print(":"); - Serial.print(packet.localPort()); - Serial.print(", Length: "); - Serial.print(packet.length()); - Serial.print(", Data: "); - Serial.write(packet.data(), packet.length()); - Serial.println(); - //reply to the client - packet.printf("Got %u bytes of data", packet.length()); - }); - //Send multicast - udp.print("Hello!"); - } -} - -void loop() -{ - delay(1000); - //Send multicast - udp.print("Anyone here?"); -} diff --git a/libraries/AsyncUDP/examples/AsyncUDPServer/AsyncUDPServer.ino b/libraries/AsyncUDP/examples/AsyncUDPServer/AsyncUDPServer.ino deleted file mode 100644 index 1f8529bd51d..00000000000 --- a/libraries/AsyncUDP/examples/AsyncUDPServer/AsyncUDPServer.ino +++ /dev/null @@ -1,50 +0,0 @@ -#include "WiFi.h" -#include "AsyncUDP.h" - -const char * ssid = "***********"; -const char * password = "***********"; - -AsyncUDP udp; - -void setup() -{ - Serial.begin(115200); - WiFi.mode(WIFI_STA); - WiFi.begin(ssid, password); - if (WiFi.waitForConnectResult() != WL_CONNECTED) { - Serial.println("WiFi Failed"); - while(1) { - delay(1000); - } - } - if(udp.listen(1234)) { - Serial.print("UDP Listening on IP: "); - Serial.println(WiFi.localIP()); - udp.onPacket([](AsyncUDPPacket packet) { - Serial.print("UDP Packet Type: "); - Serial.print(packet.isBroadcast()?"Broadcast":packet.isMulticast()?"Multicast":"Unicast"); - Serial.print(", From: "); - Serial.print(packet.remoteIP()); - Serial.print(":"); - Serial.print(packet.remotePort()); - Serial.print(", To: "); - Serial.print(packet.localIP()); - Serial.print(":"); - Serial.print(packet.localPort()); - Serial.print(", Length: "); - Serial.print(packet.length()); - Serial.print(", Data: "); - Serial.write(packet.data(), packet.length()); - Serial.println(); - //reply to the client - packet.printf("Got %u bytes of data", packet.length()); - }); - } -} - -void loop() -{ - delay(1000); - //Send broadcast - udp.broadcast("Anyone here?"); -} diff --git a/libraries/AsyncUDP/keywords.txt b/libraries/AsyncUDP/keywords.txt deleted file mode 100644 index 67c0b97a715..00000000000 --- a/libraries/AsyncUDP/keywords.txt +++ /dev/null @@ -1,33 +0,0 @@ -####################################### -# Syntax Coloring Map For Ultrasound -####################################### - -####################################### -# Datatypes (KEYWORD1) -####################################### - -AsyncUDP KEYWORD1 -AsyncUDPPacket KEYWORD1 - -####################################### -# Methods and Functions (KEYWORD2) -####################################### - -connect KEYWORD2 -connected KEYWORD2 -listen KEYWORD2 -listenMulticast KEYWORD2 -close KEYWORD2 -write KEYWORD2 -broadcast KEYWORD2 -onPacket KEYWORD2 -data KEYWORD2 -length KEYWORD2 -localIP KEYWORD2 -localPort KEYWORD2 -remoteIP KEYWORD2 -remotePort KEYWORD2 - -####################################### -# Constants (LITERAL1) -####################################### diff --git a/libraries/AsyncUDP/library.properties b/libraries/AsyncUDP/library.properties deleted file mode 100644 index 95a5e148d2f..00000000000 --- a/libraries/AsyncUDP/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=ESP32 Async UDP -version=1.0.0 -author=Me-No-Dev -maintainer=Me-No-Dev -sentence=Async UDP Library for ESP32 -paragraph=Async UDP Library for ESP32 -category=Other -url=https://github.com/me-no-dev/ESPAsyncUDP -architectures=* diff --git a/libraries/AsyncUDP/src/AsyncUDP.cpp b/libraries/AsyncUDP/src/AsyncUDP.cpp deleted file mode 100644 index 762529b9e0f..00000000000 --- a/libraries/AsyncUDP/src/AsyncUDP.cpp +++ /dev/null @@ -1,881 +0,0 @@ -#include "Arduino.h" -#include "AsyncUDP.h" - -extern "C" { -#include "lwip/opt.h" -#include "lwip/inet.h" -#include "lwip/udp.h" -#include "lwip/igmp.h" -#include "lwip/ip_addr.h" -#include "lwip/mld6.h" -#include "lwip/prot/ethernet.h" -#include -#include -} - -#include "lwip/priv/tcpip_priv.h" - -typedef struct { - struct tcpip_api_call_data call; - udp_pcb * pcb; - const ip_addr_t *addr; - uint16_t port; - struct pbuf *pb; - struct netif *netif; - err_t err; -} udp_api_call_t; - -static err_t _udp_connect_api(struct tcpip_api_call_data *api_call_msg){ - udp_api_call_t * msg = (udp_api_call_t *)api_call_msg; - msg->err = udp_connect(msg->pcb, msg->addr, msg->port); - return msg->err; -} - -static err_t _udp_connect(struct udp_pcb *pcb, const ip_addr_t *addr, u16_t port){ - udp_api_call_t msg; - msg.pcb = pcb; - msg.addr = addr; - msg.port = port; - tcpip_api_call(_udp_connect_api, (struct tcpip_api_call_data*)&msg); - return msg.err; -} - -static err_t _udp_disconnect_api(struct tcpip_api_call_data *api_call_msg){ - udp_api_call_t * msg = (udp_api_call_t *)api_call_msg; - msg->err = 0; - udp_disconnect(msg->pcb); - return msg->err; -} - -static void _udp_disconnect(struct udp_pcb *pcb){ - udp_api_call_t msg; - msg.pcb = pcb; - tcpip_api_call(_udp_disconnect_api, (struct tcpip_api_call_data*)&msg); -} - -static err_t _udp_remove_api(struct tcpip_api_call_data *api_call_msg){ - udp_api_call_t * msg = (udp_api_call_t *)api_call_msg; - msg->err = 0; - udp_remove(msg->pcb); - return msg->err; -} - -static void _udp_remove(struct udp_pcb *pcb){ - udp_api_call_t msg; - msg.pcb = pcb; - tcpip_api_call(_udp_remove_api, (struct tcpip_api_call_data*)&msg); -} - -static err_t _udp_bind_api(struct tcpip_api_call_data *api_call_msg){ - udp_api_call_t * msg = (udp_api_call_t *)api_call_msg; - msg->err = udp_bind(msg->pcb, msg->addr, msg->port); - return msg->err; -} - -static err_t _udp_bind(struct udp_pcb *pcb, const ip_addr_t *addr, u16_t port){ - udp_api_call_t msg; - msg.pcb = pcb; - msg.addr = addr; - msg.port = port; - tcpip_api_call(_udp_bind_api, (struct tcpip_api_call_data*)&msg); - return msg.err; -} - -static err_t _udp_sendto_api(struct tcpip_api_call_data *api_call_msg){ - udp_api_call_t * msg = (udp_api_call_t *)api_call_msg; - msg->err = udp_sendto(msg->pcb, msg->pb, msg->addr, msg->port); - return msg->err; -} - -static err_t _udp_sendto(struct udp_pcb *pcb, struct pbuf *pb, const ip_addr_t *addr, u16_t port){ - udp_api_call_t msg; - msg.pcb = pcb; - msg.addr = addr; - msg.port = port; - msg.pb = pb; - tcpip_api_call(_udp_sendto_api, (struct tcpip_api_call_data*)&msg); - return msg.err; -} - -static err_t _udp_sendto_if_api(struct tcpip_api_call_data *api_call_msg){ - udp_api_call_t * msg = (udp_api_call_t *)api_call_msg; - msg->err = udp_sendto_if(msg->pcb, msg->pb, msg->addr, msg->port, msg->netif); - return msg->err; -} - -static err_t _udp_sendto_if(struct udp_pcb *pcb, struct pbuf *pb, const ip_addr_t *addr, u16_t port, struct netif *netif){ - udp_api_call_t msg; - msg.pcb = pcb; - msg.addr = addr; - msg.port = port; - msg.pb = pb; - msg.netif = netif; - tcpip_api_call(_udp_sendto_if_api, (struct tcpip_api_call_data*)&msg); - return msg.err; -} - -typedef struct { - void *arg; - udp_pcb *pcb; - pbuf *pb; - const ip_addr_t *addr; - uint16_t port; - struct netif * netif; -} lwip_event_packet_t; - -static xQueueHandle _udp_queue; -static volatile TaskHandle_t _udp_task_handle = NULL; - -static void _udp_task(void *pvParameters){ - lwip_event_packet_t * e = NULL; - for (;;) { - if(xQueueReceive(_udp_queue, &e, portMAX_DELAY) == pdTRUE){ - if(!e->pb){ - free((void*)(e)); - continue; - } - AsyncUDP::_s_recv(e->arg, e->pcb, e->pb, e->addr, e->port, e->netif); - free((void*)(e)); - } - } - _udp_task_handle = NULL; - vTaskDelete(NULL); -} - -static bool _udp_task_start(){ - if(!_udp_queue){ - _udp_queue = xQueueCreate(32, sizeof(lwip_event_packet_t *)); - if(!_udp_queue){ - return false; - } - } - if(!_udp_task_handle){ - xTaskCreateUniversal(_udp_task, "async_udp", 4096, NULL, 3, (TaskHandle_t*)&_udp_task_handle, CONFIG_ARDUINO_UDP_RUNNING_CORE); - if(!_udp_task_handle){ - return false; - } - } - return true; -} - -static bool _udp_task_post(void *arg, udp_pcb *pcb, pbuf *pb, const ip_addr_t *addr, uint16_t port, struct netif *netif) -{ - if(!_udp_task_handle || !_udp_queue){ - return false; - } - lwip_event_packet_t * e = (lwip_event_packet_t *)malloc(sizeof(lwip_event_packet_t)); - if(!e){ - return false; - } - e->arg = arg; - e->pcb = pcb; - e->pb = pb; - e->addr = addr; - e->port = port; - e->netif = netif; - if (xQueueSend(_udp_queue, &e, portMAX_DELAY) != pdPASS) { - free((void*)(e)); - return false; - } - return true; -} - -static void _udp_recv(void *arg, udp_pcb *pcb, pbuf *pb, const ip_addr_t *addr, uint16_t port) -{ - while(pb != NULL) { - pbuf * this_pb = pb; - pb = pb->next; - this_pb->next = NULL; - if(!_udp_task_post(arg, pcb, this_pb, addr, port, ip_current_input_netif())){ - pbuf_free(this_pb); - } - } -} -/* -static bool _udp_task_stop(){ - if(!_udp_task_post(NULL, NULL, NULL, NULL, 0, NULL)){ - return false; - } - while(_udp_task_handle){ - vTaskDelay(10); - } - - lwip_event_packet_t * e; - while (xQueueReceive(_udp_queue, &e, 0) == pdTRUE) { - if(e->pb){ - pbuf_free(e->pb); - } - free((void*)(e)); - } - vQueueDelete(_udp_queue); - _udp_queue = NULL; -} -*/ - - - -#define UDP_MUTEX_LOCK() //xSemaphoreTake(_lock, portMAX_DELAY) -#define UDP_MUTEX_UNLOCK() //xSemaphoreGive(_lock) - - -AsyncUDPMessage::AsyncUDPMessage(size_t size) -{ - _index = 0; - if(size > CONFIG_TCP_MSS) { - size = CONFIG_TCP_MSS; - } - _size = size; - _buffer = (uint8_t *)malloc(size); -} - -AsyncUDPMessage::~AsyncUDPMessage() -{ - if(_buffer) { - free(_buffer); - } -} - -size_t AsyncUDPMessage::write(const uint8_t *data, size_t len) -{ - if(_buffer == NULL) { - return 0; - } - size_t s = space(); - if(len > s) { - len = s; - } - memcpy(_buffer + _index, data, len); - _index += len; - return len; -} - -size_t AsyncUDPMessage::write(uint8_t data) -{ - return write(&data, 1); -} - -size_t AsyncUDPMessage::space() -{ - if(_buffer == NULL) { - return 0; - } - return _size - _index; -} - -uint8_t * AsyncUDPMessage::data() -{ - return _buffer; -} - -size_t AsyncUDPMessage::length() -{ - return _index; -} - -void AsyncUDPMessage::flush() -{ - _index = 0; -} - - -AsyncUDPPacket::AsyncUDPPacket(AsyncUDP *udp, pbuf *pb, const ip_addr_t *raddr, uint16_t rport, struct netif * ntif) -{ - _udp = udp; - _pb = pb; - _if = TCPIP_ADAPTER_IF_MAX; - _data = (uint8_t*)(pb->payload); - _len = pb->len; - _index = 0; - - pbuf_ref(_pb); - - //memcpy(&_remoteIp, raddr, sizeof(ip_addr_t)); - _remoteIp.type = raddr->type; - _localIp.type = _remoteIp.type; - - eth_hdr* eth = NULL; - udp_hdr* udphdr = reinterpret_cast(_data - UDP_HLEN); - _localPort = ntohs(udphdr->dest); - _remotePort = ntohs(udphdr->src); - - if (_remoteIp.type == IPADDR_TYPE_V4) { - eth = (eth_hdr *)(((uint8_t *)(pb->payload)) - UDP_HLEN - IP_HLEN - SIZEOF_ETH_HDR); - struct ip_hdr * iphdr = (struct ip_hdr *)(((uint8_t *)(pb->payload)) - UDP_HLEN - IP_HLEN); - _localIp.u_addr.ip4.addr = iphdr->dest.addr; - _remoteIp.u_addr.ip4.addr = iphdr->src.addr; - } else { - eth = (eth_hdr *)(((uint8_t *)(pb->payload)) - UDP_HLEN - IP6_HLEN - SIZEOF_ETH_HDR); - struct ip6_hdr * ip6hdr = (struct ip6_hdr *)(((uint8_t *)(pb->payload)) - UDP_HLEN - IP6_HLEN); - memcpy(&_localIp.u_addr.ip6.addr, (uint8_t *)ip6hdr->dest.addr, 16); - memcpy(&_remoteIp.u_addr.ip6.addr, (uint8_t *)ip6hdr->src.addr, 16); - } - memcpy(_remoteMac, eth->src.addr, 6); - - struct netif * netif = NULL; - void * nif = NULL; - int i; - for (i=0; i a){ - len = a; - } - for(i=0;iwriteTo(data, len, &_remoteIp, _remotePort, _if); -} - -size_t AsyncUDPPacket::write(uint8_t data) -{ - return write(&data, 1); -} - -size_t AsyncUDPPacket::send(AsyncUDPMessage &message) -{ - return write(message.data(), message.length()); -} - -bool AsyncUDP::_init(){ - if(_pcb){ - return true; - } - _pcb = udp_new(); - if(!_pcb){ - return false; - } - //_lock = xSemaphoreCreateMutex(); - udp_recv(_pcb, &_udp_recv, (void *) this); - return true; -} - -AsyncUDP::AsyncUDP() -{ - _pcb = NULL; - _connected = false; - _handler = NULL; -} - -AsyncUDP::~AsyncUDP() -{ - close(); - UDP_MUTEX_LOCK(); - udp_recv(_pcb, NULL, NULL); - _udp_remove(_pcb); - _pcb = NULL; - UDP_MUTEX_UNLOCK(); - //vSemaphoreDelete(_lock); -} - -void AsyncUDP::close() -{ - UDP_MUTEX_LOCK(); - if(_pcb != NULL) { - if(_connected) { - _udp_disconnect(_pcb); - } - _connected = false; - //todo: unjoin multicast group - } - UDP_MUTEX_UNLOCK(); -} - -bool AsyncUDP::connect(const ip_addr_t *addr, uint16_t port) -{ - if(!_udp_task_start()){ - log_e("failed to start task"); - return false; - } - if(!_init()) { - return false; - } - close(); - UDP_MUTEX_LOCK(); - err_t err = _udp_connect(_pcb, addr, port); - if(err != ERR_OK) { - UDP_MUTEX_UNLOCK(); - return false; - } - _connected = true; - UDP_MUTEX_UNLOCK(); - return true; -} - -bool AsyncUDP::listen(const ip_addr_t *addr, uint16_t port) -{ - if(!_udp_task_start()){ - log_e("failed to start task"); - return false; - } - if(!_init()) { - return false; - } - close(); - if(addr){ - IP_SET_TYPE_VAL(_pcb->local_ip, addr->type); - IP_SET_TYPE_VAL(_pcb->remote_ip, addr->type); - } - UDP_MUTEX_LOCK(); - if(_udp_bind(_pcb, addr, port) != ERR_OK) { - UDP_MUTEX_UNLOCK(); - return false; - } - _connected = true; - UDP_MUTEX_UNLOCK(); - return true; -} - -static esp_err_t joinMulticastGroup(const ip_addr_t *addr, bool join, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX) -{ - struct netif * netif = NULL; - if(tcpip_if < TCPIP_ADAPTER_IF_MAX){ - void * nif = NULL; - esp_err_t err = tcpip_adapter_get_netif(tcpip_if, &nif); - if (err) { - return ESP_ERR_INVALID_ARG; - } - netif = (struct netif *)nif; - - if (addr->type == IPADDR_TYPE_V4) { - if(join){ - if (igmp_joingroup_netif(netif, (const ip4_addr *)&(addr->u_addr.ip4))) { - return ESP_ERR_INVALID_STATE; - } - } else { - if (igmp_leavegroup_netif(netif, (const ip4_addr *)&(addr->u_addr.ip4))) { - return ESP_ERR_INVALID_STATE; - } - } - } else { - if(join){ - if (mld6_joingroup_netif(netif, &(addr->u_addr.ip6))) { - return ESP_ERR_INVALID_STATE; - } - } else { - if (mld6_leavegroup_netif(netif, &(addr->u_addr.ip6))) { - return ESP_ERR_INVALID_STATE; - } - } - } - } else { - if (addr->type == IPADDR_TYPE_V4) { - if(join){ - if (igmp_joingroup((const ip4_addr *)IP4_ADDR_ANY, (const ip4_addr *)&(addr->u_addr.ip4))) { - return ESP_ERR_INVALID_STATE; - } - } else { - if (igmp_leavegroup((const ip4_addr *)IP4_ADDR_ANY, (const ip4_addr *)&(addr->u_addr.ip4))) { - return ESP_ERR_INVALID_STATE; - } - } - } else { - if(join){ - if (mld6_joingroup((const ip6_addr *)IP6_ADDR_ANY, &(addr->u_addr.ip6))) { - return ESP_ERR_INVALID_STATE; - } - } else { - if (mld6_leavegroup((const ip6_addr *)IP6_ADDR_ANY, &(addr->u_addr.ip6))) { - return ESP_ERR_INVALID_STATE; - } - } - } - } - return ESP_OK; -} - -bool AsyncUDP::listenMulticast(const ip_addr_t *addr, uint16_t port, uint8_t ttl, tcpip_adapter_if_t tcpip_if) -{ - if(!ip_addr_ismulticast(addr)) { - return false; - } - - if (joinMulticastGroup(addr, true, tcpip_if)!= ERR_OK) { - return false; - } - - if(!listen(NULL, port)) { - return false; - } - - UDP_MUTEX_LOCK(); - _pcb->mcast_ttl = ttl; - _pcb->remote_port = port; - ip_addr_copy(_pcb->remote_ip, *addr); - //ip_addr_copy(_pcb->remote_ip, ip_addr_any_type); - UDP_MUTEX_UNLOCK(); - - return true; -} - -size_t AsyncUDP::writeTo(const uint8_t * data, size_t len, const ip_addr_t * addr, uint16_t port, tcpip_adapter_if_t tcpip_if) -{ - if(!_pcb) { - UDP_MUTEX_LOCK(); - _pcb = udp_new(); - UDP_MUTEX_UNLOCK(); - if(_pcb == NULL) { - return 0; - } - } - if(len > CONFIG_TCP_MSS) { - len = CONFIG_TCP_MSS; - } - err_t err = ERR_OK; - pbuf* pbt = pbuf_alloc(PBUF_TRANSPORT, len, PBUF_RAM); - if(pbt != NULL) { - uint8_t* dst = reinterpret_cast(pbt->payload); - memcpy(dst, data, len); - UDP_MUTEX_LOCK(); - if(tcpip_if < TCPIP_ADAPTER_IF_MAX){ - void * nif = NULL; - tcpip_adapter_get_netif((tcpip_adapter_if_t)tcpip_if, &nif); - if(!nif){ - err = _udp_sendto(_pcb, pbt, addr, port); - } else { - err = _udp_sendto_if(_pcb, pbt, addr, port, (struct netif *)nif); - } - } else { - err = _udp_sendto(_pcb, pbt, addr, port); - } - UDP_MUTEX_UNLOCK(); - pbuf_free(pbt); - if(err < ERR_OK) { - return 0; - } - return len; - } - return 0; -} - -void AsyncUDP::_recv(udp_pcb *upcb, pbuf *pb, const ip_addr_t *addr, uint16_t port, struct netif * netif) -{ - while(pb != NULL) { - pbuf * this_pb = pb; - pb = pb->next; - this_pb->next = NULL; - if(_handler) { - AsyncUDPPacket packet(this, this_pb, addr, port, netif); - _handler(packet); - } else { - pbuf_free(this_pb); - } - } -} - -void AsyncUDP::_s_recv(void *arg, udp_pcb *upcb, pbuf *p, const ip_addr_t *addr, uint16_t port, struct netif * netif) -{ - reinterpret_cast(arg)->_recv(upcb, p, addr, port, netif); -} - -bool AsyncUDP::listen(uint16_t port) -{ - return listen(IP_ANY_TYPE, port); -} - -bool AsyncUDP::listen(const IPAddress addr, uint16_t port) -{ - ip_addr_t laddr; - laddr.type = IPADDR_TYPE_V4; - laddr.u_addr.ip4.addr = addr; - return listen(&laddr, port); -} - -bool AsyncUDP::listenMulticast(const IPAddress addr, uint16_t port, uint8_t ttl, tcpip_adapter_if_t tcpip_if) -{ - ip_addr_t laddr; - laddr.type = IPADDR_TYPE_V4; - laddr.u_addr.ip4.addr = addr; - return listenMulticast(&laddr, port, ttl, tcpip_if); -} - -bool AsyncUDP::connect(const IPAddress addr, uint16_t port) -{ - ip_addr_t daddr; - daddr.type = IPADDR_TYPE_V4; - daddr.u_addr.ip4.addr = addr; - return connect(&daddr, port); -} - -size_t AsyncUDP::writeTo(const uint8_t *data, size_t len, const IPAddress addr, uint16_t port, tcpip_adapter_if_t tcpip_if) -{ - ip_addr_t daddr; - daddr.type = IPADDR_TYPE_V4; - daddr.u_addr.ip4.addr = addr; - return writeTo(data, len, &daddr, port, tcpip_if); -} - -IPAddress AsyncUDP::listenIP() -{ - if(!_pcb || _pcb->remote_ip.type != IPADDR_TYPE_V4){ - return IPAddress(); - } - return IPAddress(_pcb->remote_ip.u_addr.ip4.addr); -} - -bool AsyncUDP::listen(const IPv6Address addr, uint16_t port) -{ - ip_addr_t laddr; - laddr.type = IPADDR_TYPE_V6; - memcpy((uint8_t*)(laddr.u_addr.ip6.addr), (const uint8_t*)addr, 16); - return listen(&laddr, port); -} - -bool AsyncUDP::listenMulticast(const IPv6Address addr, uint16_t port, uint8_t ttl, tcpip_adapter_if_t tcpip_if) -{ - ip_addr_t laddr; - laddr.type = IPADDR_TYPE_V6; - memcpy((uint8_t*)(laddr.u_addr.ip6.addr), (const uint8_t*)addr, 16); - return listenMulticast(&laddr, port, ttl, tcpip_if); -} - -bool AsyncUDP::connect(const IPv6Address addr, uint16_t port) -{ - ip_addr_t daddr; - daddr.type = IPADDR_TYPE_V6; - memcpy((uint8_t*)(daddr.u_addr.ip6.addr), (const uint8_t*)addr, 16); - return connect(&daddr, port); -} - -size_t AsyncUDP::writeTo(const uint8_t *data, size_t len, const IPv6Address addr, uint16_t port, tcpip_adapter_if_t tcpip_if) -{ - ip_addr_t daddr; - daddr.type = IPADDR_TYPE_V6; - memcpy((uint8_t*)(daddr.u_addr.ip6.addr), (const uint8_t*)addr, 16); - return writeTo(data, len, &daddr, port, tcpip_if); -} - -IPv6Address AsyncUDP::listenIPv6() -{ - if(!_pcb || _pcb->remote_ip.type != IPADDR_TYPE_V6){ - return IPv6Address(); - } - return IPv6Address(_pcb->remote_ip.u_addr.ip6.addr); -} - -size_t AsyncUDP::write(const uint8_t *data, size_t len) -{ - return writeTo(data, len, &(_pcb->remote_ip), _pcb->remote_port); -} - -size_t AsyncUDP::write(uint8_t data) -{ - return write(&data, 1); -} - -size_t AsyncUDP::broadcastTo(uint8_t *data, size_t len, uint16_t port, tcpip_adapter_if_t tcpip_if) -{ - return writeTo(data, len, IP_ADDR_BROADCAST, port, tcpip_if); -} - -size_t AsyncUDP::broadcastTo(const char * data, uint16_t port, tcpip_adapter_if_t tcpip_if) -{ - return broadcastTo((uint8_t *)data, strlen(data), port, tcpip_if); -} - -size_t AsyncUDP::broadcast(uint8_t *data, size_t len) -{ - if(_pcb->local_port != 0) { - return broadcastTo(data, len, _pcb->local_port); - } - return 0; -} - -size_t AsyncUDP::broadcast(const char * data) -{ - return broadcast((uint8_t *)data, strlen(data)); -} - - -size_t AsyncUDP::sendTo(AsyncUDPMessage &message, const ip_addr_t *addr, uint16_t port, tcpip_adapter_if_t tcpip_if) -{ - if(!message) { - return 0; - } - return writeTo(message.data(), message.length(), addr, port, tcpip_if); -} - -size_t AsyncUDP::sendTo(AsyncUDPMessage &message, const IPAddress addr, uint16_t port, tcpip_adapter_if_t tcpip_if) -{ - if(!message) { - return 0; - } - return writeTo(message.data(), message.length(), addr, port, tcpip_if); -} - -size_t AsyncUDP::sendTo(AsyncUDPMessage &message, const IPv6Address addr, uint16_t port, tcpip_adapter_if_t tcpip_if) -{ - if(!message) { - return 0; - } - return writeTo(message.data(), message.length(), addr, port, tcpip_if); -} - -size_t AsyncUDP::send(AsyncUDPMessage &message) -{ - if(!message) { - return 0; - } - return writeTo(message.data(), message.length(), &(_pcb->remote_ip), _pcb->remote_port); -} - -size_t AsyncUDP::broadcastTo(AsyncUDPMessage &message, uint16_t port, tcpip_adapter_if_t tcpip_if) -{ - if(!message) { - return 0; - } - return broadcastTo(message.data(), message.length(), port, tcpip_if); -} - -size_t AsyncUDP::broadcast(AsyncUDPMessage &message) -{ - if(!message) { - return 0; - } - return broadcast(message.data(), message.length()); -} - -AsyncUDP::operator bool() -{ - return _connected; -} - -bool AsyncUDP::connected() -{ - return _connected; -} - -void AsyncUDP::onPacket(AuPacketHandlerFunctionWithArg cb, void * arg) -{ - onPacket(std::bind(cb, arg, std::placeholders::_1)); -} - -void AsyncUDP::onPacket(AuPacketHandlerFunction cb) -{ - _handler = cb; -} diff --git a/libraries/AsyncUDP/src/AsyncUDP.h b/libraries/AsyncUDP/src/AsyncUDP.h deleted file mode 100644 index 2ac48a69684..00000000000 --- a/libraries/AsyncUDP/src/AsyncUDP.h +++ /dev/null @@ -1,152 +0,0 @@ -#ifndef ESPASYNCUDP_H -#define ESPASYNCUDP_H - -#include "IPAddress.h" -#include "IPv6Address.h" -#include "Print.h" -#include -extern "C" { -#include "lwip/ip_addr.h" -#include -#include "freertos/queue.h" -#include "freertos/semphr.h" -} - -class AsyncUDP; -class AsyncUDPPacket; -class AsyncUDPMessage; -struct udp_pcb; -struct pbuf; -struct netif; - -typedef std::function AuPacketHandlerFunction; -typedef std::function AuPacketHandlerFunctionWithArg; - -class AsyncUDPMessage : public Print -{ -protected: - uint8_t *_buffer; - size_t _index; - size_t _size; -public: - AsyncUDPMessage(size_t size=CONFIG_TCP_MSS); - virtual ~AsyncUDPMessage(); - size_t write(const uint8_t *data, size_t len); - size_t write(uint8_t data); - size_t space(); - uint8_t * data(); - size_t length(); - void flush(); - operator bool() - { - return _buffer != NULL; - } -}; - -class AsyncUDPPacket : public Stream -{ -protected: - AsyncUDP *_udp; - pbuf *_pb; - tcpip_adapter_if_t _if; - ip_addr_t _localIp; - uint16_t _localPort; - ip_addr_t _remoteIp; - uint16_t _remotePort; - uint8_t _remoteMac[6]; - uint8_t *_data; - size_t _len; - size_t _index; -public: - AsyncUDPPacket(AsyncUDP *udp, pbuf *pb, const ip_addr_t *addr, uint16_t port, struct netif * netif); - virtual ~AsyncUDPPacket(); - - uint8_t * data(); - size_t length(); - bool isBroadcast(); - bool isMulticast(); - bool isIPv6(); - - tcpip_adapter_if_t interface(); - - IPAddress localIP(); - IPv6Address localIPv6(); - uint16_t localPort(); - IPAddress remoteIP(); - IPv6Address remoteIPv6(); - uint16_t remotePort(); - void remoteMac(uint8_t * mac); - - size_t send(AsyncUDPMessage &message); - - int available(); - size_t read(uint8_t *data, size_t len); - int read(); - int peek(); - void flush(); - - size_t write(const uint8_t *data, size_t len); - size_t write(uint8_t data); -}; - -class AsyncUDP : public Print -{ -protected: - udp_pcb *_pcb; - //xSemaphoreHandle _lock; - bool _connected; - AuPacketHandlerFunction _handler; - - bool _init(); - void _recv(udp_pcb *upcb, pbuf *pb, const ip_addr_t *addr, uint16_t port, struct netif * netif); - -public: - AsyncUDP(); - virtual ~AsyncUDP(); - - void onPacket(AuPacketHandlerFunctionWithArg cb, void * arg=NULL); - void onPacket(AuPacketHandlerFunction cb); - - bool listen(const ip_addr_t *addr, uint16_t port); - bool listen(const IPAddress addr, uint16_t port); - bool listen(const IPv6Address addr, uint16_t port); - bool listen(uint16_t port); - - bool listenMulticast(const ip_addr_t *addr, uint16_t port, uint8_t ttl=1, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX); - bool listenMulticast(const IPAddress addr, uint16_t port, uint8_t ttl=1, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX); - bool listenMulticast(const IPv6Address addr, uint16_t port, uint8_t ttl=1, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX); - - bool connect(const ip_addr_t *addr, uint16_t port); - bool connect(const IPAddress addr, uint16_t port); - bool connect(const IPv6Address addr, uint16_t port); - - void close(); - - size_t writeTo(const uint8_t *data, size_t len, const ip_addr_t *addr, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX); - size_t writeTo(const uint8_t *data, size_t len, const IPAddress addr, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX); - size_t writeTo(const uint8_t *data, size_t len, const IPv6Address addr, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX); - size_t write(const uint8_t *data, size_t len); - size_t write(uint8_t data); - - size_t broadcastTo(uint8_t *data, size_t len, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX); - size_t broadcastTo(const char * data, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX); - size_t broadcast(uint8_t *data, size_t len); - size_t broadcast(const char * data); - - size_t sendTo(AsyncUDPMessage &message, const ip_addr_t *addr, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX); - size_t sendTo(AsyncUDPMessage &message, const IPAddress addr, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX); - size_t sendTo(AsyncUDPMessage &message, const IPv6Address addr, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX); - size_t send(AsyncUDPMessage &message); - - size_t broadcastTo(AsyncUDPMessage &message, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX); - size_t broadcast(AsyncUDPMessage &message); - - IPAddress listenIP(); - IPv6Address listenIPv6(); - bool connected(); - operator bool(); - - static void _s_recv(void *arg, udp_pcb *upcb, pbuf *p, const ip_addr_t *addr, uint16_t port, struct netif * netif); -}; - -#endif diff --git a/libraries/AzureIoT b/libraries/AzureIoT deleted file mode 160000 index 67dfa4f31ef..00000000000 --- a/libraries/AzureIoT +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 67dfa4f31ef88b0938dd87d955612100dea5562e diff --git a/libraries/BLE/README.md b/libraries/BLE/README.md deleted file mode 100644 index e80fbe0c52b..00000000000 --- a/libraries/BLE/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# ESP32 BLE for Arduino -The Arduino IDE provides an excellent library package manager where versions of libraries can be downloaded and installed. This Github project provides the repository for the ESP32 BLE support for Arduino. - -The actual source of the project which is being maintained can be found here: - -https://github.com/nkolban/esp32-snippets - -Issues and questions should be raised here: - -https://github.com/nkolban/esp32-snippets/issues - - -Documentation for using the library can be found here: - -https://github.com/nkolban/esp32-snippets/tree/master/Documentation \ No newline at end of file diff --git a/libraries/BLE/examples/BLE_client/BLE_client.ino b/libraries/BLE/examples/BLE_client/BLE_client.ino deleted file mode 100644 index 8950075ce5b..00000000000 --- a/libraries/BLE/examples/BLE_client/BLE_client.ino +++ /dev/null @@ -1,161 +0,0 @@ -/** - * A BLE client example that is rich in capabilities. - * There is a lot new capabilities implemented. - * author unknown - * updated by chegewara - */ - -#include "BLEDevice.h" -//#include "BLEScan.h" - -// The remote service we wish to connect to. -static BLEUUID serviceUUID("4fafc201-1fb5-459e-8fcc-c5c9c331914b"); -// The characteristic of the remote service we are interested in. -static BLEUUID charUUID("beb5483e-36e1-4688-b7f5-ea07361b26a8"); - -static boolean doConnect = false; -static boolean connected = false; -static boolean doScan = false; -static BLERemoteCharacteristic* pRemoteCharacteristic; -static BLEAdvertisedDevice* myDevice; - -static void notifyCallback( - BLERemoteCharacteristic* pBLERemoteCharacteristic, - uint8_t* pData, - size_t length, - bool isNotify) { - Serial.print("Notify callback for characteristic "); - Serial.print(pBLERemoteCharacteristic->getUUID().toString().c_str()); - Serial.print(" of data length "); - Serial.println(length); - Serial.print("data: "); - Serial.println((char*)pData); -} - -class MyClientCallback : public BLEClientCallbacks { - void onConnect(BLEClient* pclient) { - } - - void onDisconnect(BLEClient* pclient) { - connected = false; - Serial.println("onDisconnect"); - } -}; - -bool connectToServer() { - Serial.print("Forming a connection to "); - Serial.println(myDevice->getAddress().toString().c_str()); - - BLEClient* pClient = BLEDevice::createClient(); - Serial.println(" - Created client"); - - pClient->setClientCallbacks(new MyClientCallback()); - - // Connect to the remove BLE Server. - pClient->connect(myDevice); // if you pass BLEAdvertisedDevice instead of address, it will be recognized type of peer device address (public or private) - Serial.println(" - Connected to server"); - - // Obtain a reference to the service we are after in the remote BLE server. - BLERemoteService* pRemoteService = pClient->getService(serviceUUID); - if (pRemoteService == nullptr) { - Serial.print("Failed to find our service UUID: "); - Serial.println(serviceUUID.toString().c_str()); - pClient->disconnect(); - return false; - } - Serial.println(" - Found our service"); - - - // Obtain a reference to the characteristic in the service of the remote BLE server. - pRemoteCharacteristic = pRemoteService->getCharacteristic(charUUID); - if (pRemoteCharacteristic == nullptr) { - Serial.print("Failed to find our characteristic UUID: "); - Serial.println(charUUID.toString().c_str()); - pClient->disconnect(); - return false; - } - Serial.println(" - Found our characteristic"); - - // Read the value of the characteristic. - if(pRemoteCharacteristic->canRead()) { - std::string value = pRemoteCharacteristic->readValue(); - Serial.print("The characteristic value was: "); - Serial.println(value.c_str()); - } - - if(pRemoteCharacteristic->canNotify()) - pRemoteCharacteristic->registerForNotify(notifyCallback); - - connected = true; - return true; -} -/** - * Scan for BLE servers and find the first one that advertises the service we are looking for. - */ -class MyAdvertisedDeviceCallbacks: public BLEAdvertisedDeviceCallbacks { - /** - * Called for each advertising BLE server. - */ - void onResult(BLEAdvertisedDevice advertisedDevice) { - Serial.print("BLE Advertised Device found: "); - Serial.println(advertisedDevice.toString().c_str()); - - // We have found a device, let us now see if it contains the service we are looking for. - if (advertisedDevice.haveServiceUUID() && advertisedDevice.isAdvertisingService(serviceUUID)) { - - BLEDevice::getScan()->stop(); - myDevice = new BLEAdvertisedDevice(advertisedDevice); - doConnect = true; - doScan = true; - - } // Found our server - } // onResult -}; // MyAdvertisedDeviceCallbacks - - -void setup() { - Serial.begin(115200); - Serial.println("Starting Arduino BLE Client application..."); - BLEDevice::init(""); - - // Retrieve a Scanner and set the callback we want to use to be informed when we - // have detected a new device. Specify that we want active scanning and start the - // scan to run for 5 seconds. - BLEScan* pBLEScan = BLEDevice::getScan(); - pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks()); - pBLEScan->setInterval(1349); - pBLEScan->setWindow(449); - pBLEScan->setActiveScan(true); - pBLEScan->start(5, false); -} // End of setup. - - -// This is the Arduino main loop function. -void loop() { - - // If the flag "doConnect" is true then we have scanned for and found the desired - // BLE Server with which we wish to connect. Now we connect to it. Once we are - // connected we set the connected flag to be true. - if (doConnect == true) { - if (connectToServer()) { - Serial.println("We are now connected to the BLE Server."); - } else { - Serial.println("We have failed to connect to the server; there is nothin more we will do."); - } - doConnect = false; - } - - // If we are connected to a peer BLE Server, update the characteristic each time we are reached - // with the current time since boot. - if (connected) { - String newValue = "Time since boot: " + String(millis()/1000); - Serial.println("Setting new characteristic value to \"" + newValue + "\""); - - // Set the characteristic's value to be the array of bytes that is actually a string. - pRemoteCharacteristic->writeValue(newValue.c_str(), newValue.length()); - }else if(doScan){ - BLEDevice::getScan()->start(0); // this is just eample to start scan after disconnect, most likely there is better way to do it in arduino - } - - delay(1000); // Delay a second between loops. -} // End of loop diff --git a/libraries/BLE/examples/BLE_iBeacon/BLE_iBeacon.ino b/libraries/BLE/examples/BLE_iBeacon/BLE_iBeacon.ino deleted file mode 100644 index e43174d4d51..00000000000 --- a/libraries/BLE/examples/BLE_iBeacon/BLE_iBeacon.ino +++ /dev/null @@ -1,103 +0,0 @@ -/* - Based on Neil Kolban example for IDF: https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLE%20Tests/SampleScan.cpp - Ported to Arduino ESP32 by pcbreflux -*/ - - -/* - Create a BLE server that will send periodic iBeacon frames. - The design of creating the BLE server is: - 1. Create a BLE Server - 2. Create advertising data - 3. Start advertising. - 4. wait - 5. Stop advertising. - 6. deep sleep - -*/ -#include "sys/time.h" - -#include "BLEDevice.h" -#include "BLEUtils.h" -#include "BLEBeacon.h" -#include "esp_sleep.h" - -#define GPIO_DEEP_SLEEP_DURATION 10 // sleep x seconds and then wake up -RTC_DATA_ATTR static time_t last; // remember last boot in RTC Memory -RTC_DATA_ATTR static uint32_t bootcount; // remember number of boots in RTC Memory - -#ifdef __cplusplus -extern "C" { -#endif - -uint8_t temprature_sens_read(); -//uint8_t g_phyFuns; - -#ifdef __cplusplus -} -#endif - -// See the following for generating UUIDs: -// https://www.uuidgenerator.net/ -BLEAdvertising *pAdvertising; -struct timeval now; - -#define BEACON_UUID "8ec76ea3-6668-48da-9866-75be8bc86f4d" // UUID 1 128-Bit (may use linux tool uuidgen or random numbers via https://www.uuidgenerator.net/) - -void setBeacon() { - - BLEBeacon oBeacon = BLEBeacon(); - oBeacon.setManufacturerId(0x4C00); // fake Apple 0x004C LSB (ENDIAN_CHANGE_U16!) - oBeacon.setProximityUUID(BLEUUID(BEACON_UUID)); - oBeacon.setMajor((bootcount & 0xFFFF0000) >> 16); - oBeacon.setMinor(bootcount&0xFFFF); - BLEAdvertisementData oAdvertisementData = BLEAdvertisementData(); - BLEAdvertisementData oScanResponseData = BLEAdvertisementData(); - - oAdvertisementData.setFlags(0x04); // BR_EDR_NOT_SUPPORTED 0x04 - - std::string strServiceData = ""; - - strServiceData += (char)26; // Len - strServiceData += (char)0xFF; // Type - strServiceData += oBeacon.getData(); - oAdvertisementData.addData(strServiceData); - - pAdvertising->setAdvertisementData(oAdvertisementData); - pAdvertising->setScanResponseData(oScanResponseData); - -} - -void setup() { - - - Serial.begin(115200); - gettimeofday(&now, NULL); - - Serial.printf("start ESP32 %d\n",bootcount++); - - Serial.printf("deep sleep (%lds since last reset, %lds since last boot)\n",now.tv_sec,now.tv_sec-last); - - last = now.tv_sec; - - // Create the BLE Device - BLEDevice::init(""); - - // Create the BLE Server - // BLEServer *pServer = BLEDevice::createServer(); // <-- no longer required to instantiate BLEServer, less flash and ram usage - - pAdvertising = BLEDevice::getAdvertising(); - - setBeacon(); - // Start advertising - pAdvertising->start(); - Serial.println("Advertizing started..."); - delay(100); - pAdvertising->stop(); - Serial.printf("enter deep sleep\n"); - esp_deep_sleep(1000000LL * GPIO_DEEP_SLEEP_DURATION); - Serial.printf("in deep sleep\n"); -} - -void loop() { -} diff --git a/libraries/BLE/examples/BLE_notify/BLE_notify.ino b/libraries/BLE/examples/BLE_notify/BLE_notify.ino deleted file mode 100644 index 42b9e7273f3..00000000000 --- a/libraries/BLE/examples/BLE_notify/BLE_notify.ino +++ /dev/null @@ -1,110 +0,0 @@ -/* - Video: https://www.youtube.com/watch?v=oCMOYS71NIU - Based on Neil Kolban example for IDF: https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLE%20Tests/SampleNotify.cpp - Ported to Arduino ESP32 by Evandro Copercini - updated by chegewara - - Create a BLE server that, once we receive a connection, will send periodic notifications. - The service advertises itself as: 4fafc201-1fb5-459e-8fcc-c5c9c331914b - And has a characteristic of: beb5483e-36e1-4688-b7f5-ea07361b26a8 - - The design of creating the BLE server is: - 1. Create a BLE Server - 2. Create a BLE Service - 3. Create a BLE Characteristic on the Service - 4. Create a BLE Descriptor on the characteristic - 5. Start the service. - 6. Start advertising. - - A connect hander associated with the server starts a background task that performs notification - every couple of seconds. -*/ -#include -#include -#include -#include - -BLEServer* pServer = NULL; -BLECharacteristic* pCharacteristic = NULL; -bool deviceConnected = false; -bool oldDeviceConnected = false; -uint32_t value = 0; - -// See the following for generating UUIDs: -// https://www.uuidgenerator.net/ - -#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b" -#define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8" - - -class MyServerCallbacks: public BLEServerCallbacks { - void onConnect(BLEServer* pServer) { - deviceConnected = true; - }; - - void onDisconnect(BLEServer* pServer) { - deviceConnected = false; - } -}; - - - -void setup() { - Serial.begin(115200); - - // Create the BLE Device - BLEDevice::init("ESP32"); - - // Create the BLE Server - pServer = BLEDevice::createServer(); - pServer->setCallbacks(new MyServerCallbacks()); - - // Create the BLE Service - BLEService *pService = pServer->createService(SERVICE_UUID); - - // Create a BLE Characteristic - pCharacteristic = pService->createCharacteristic( - CHARACTERISTIC_UUID, - BLECharacteristic::PROPERTY_READ | - BLECharacteristic::PROPERTY_WRITE | - BLECharacteristic::PROPERTY_NOTIFY | - BLECharacteristic::PROPERTY_INDICATE - ); - - // https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml - // Create a BLE Descriptor - pCharacteristic->addDescriptor(new BLE2902()); - - // Start the service - pService->start(); - - // Start advertising - BLEAdvertising *pAdvertising = BLEDevice::getAdvertising(); - pAdvertising->addServiceUUID(SERVICE_UUID); - pAdvertising->setScanResponse(false); - pAdvertising->setMinPreferred(0x0); // set value to 0x00 to not advertise this parameter - BLEDevice::startAdvertising(); - Serial.println("Waiting a client connection to notify..."); -} - -void loop() { - // notify changed value - if (deviceConnected) { - pCharacteristic->setValue((uint8_t*)&value, 4); - pCharacteristic->notify(); - value++; - delay(3); // bluetooth stack will go into congestion, if too many packets are sent, in 6 hours test i was able to go as low as 3ms - } - // disconnecting - if (!deviceConnected && oldDeviceConnected) { - delay(500); // give the bluetooth stack the chance to get things ready - pServer->startAdvertising(); // restart advertising - Serial.println("start advertising"); - oldDeviceConnected = deviceConnected; - } - // connecting - if (deviceConnected && !oldDeviceConnected) { - // do stuff here on connecting - oldDeviceConnected = deviceConnected; - } -} \ No newline at end of file diff --git a/libraries/BLE/examples/BLE_scan/BLE_scan.ino b/libraries/BLE/examples/BLE_scan/BLE_scan.ino deleted file mode 100644 index 094f7933ac7..00000000000 --- a/libraries/BLE/examples/BLE_scan/BLE_scan.ino +++ /dev/null @@ -1,40 +0,0 @@ -/* - Based on Neil Kolban example for IDF: https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLE%20Tests/SampleScan.cpp - Ported to Arduino ESP32 by Evandro Copercini -*/ - -#include -#include -#include -#include - -int scanTime = 5; //In seconds -BLEScan* pBLEScan; - -class MyAdvertisedDeviceCallbacks: public BLEAdvertisedDeviceCallbacks { - void onResult(BLEAdvertisedDevice advertisedDevice) { - Serial.printf("Advertised Device: %s \n", advertisedDevice.toString().c_str()); - } -}; - -void setup() { - Serial.begin(115200); - Serial.println("Scanning..."); - - BLEDevice::init(""); - pBLEScan = BLEDevice::getScan(); //create new scan - pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks()); - pBLEScan->setActiveScan(true); //active scan uses more power, but get results faster - pBLEScan->setInterval(100); - pBLEScan->setWindow(99); // less or equal setInterval value -} - -void loop() { - // put your main code here, to run repeatedly: - BLEScanResults foundDevices = pBLEScan->start(scanTime, false); - Serial.print("Devices found: "); - Serial.println(foundDevices.getCount()); - Serial.println("Scan done!"); - pBLEScan->clearResults(); // delete results fromBLEScan buffer to release memory - delay(2000); -} \ No newline at end of file diff --git a/libraries/BLE/examples/BLE_server/BLE_server.ino b/libraries/BLE/examples/BLE_server/BLE_server.ino deleted file mode 100644 index 3f9176acf5e..00000000000 --- a/libraries/BLE/examples/BLE_server/BLE_server.ino +++ /dev/null @@ -1,45 +0,0 @@ -/* - Based on Neil Kolban example for IDF: https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLE%20Tests/SampleServer.cpp - Ported to Arduino ESP32 by Evandro Copercini - updates by chegewara -*/ - -#include -#include -#include - -// See the following for generating UUIDs: -// https://www.uuidgenerator.net/ - -#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b" -#define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8" - -void setup() { - Serial.begin(115200); - Serial.println("Starting BLE work!"); - - BLEDevice::init("Long name works now"); - BLEServer *pServer = BLEDevice::createServer(); - BLEService *pService = pServer->createService(SERVICE_UUID); - BLECharacteristic *pCharacteristic = pService->createCharacteristic( - CHARACTERISTIC_UUID, - BLECharacteristic::PROPERTY_READ | - BLECharacteristic::PROPERTY_WRITE - ); - - pCharacteristic->setValue("Hello World says Neil"); - pService->start(); - // BLEAdvertising *pAdvertising = pServer->getAdvertising(); // this still is working for backward compatibility - BLEAdvertising *pAdvertising = BLEDevice::getAdvertising(); - pAdvertising->addServiceUUID(SERVICE_UUID); - pAdvertising->setScanResponse(true); - pAdvertising->setMinPreferred(0x06); // functions that help with iPhone connections issue - pAdvertising->setMinPreferred(0x12); - BLEDevice::startAdvertising(); - Serial.println("Characteristic defined! Now you can read it in your phone!"); -} - -void loop() { - // put your main code here, to run repeatedly: - delay(2000); -} \ No newline at end of file diff --git a/libraries/BLE/examples/BLE_server_multiconnect/BLE_server_multiconnect.ino b/libraries/BLE/examples/BLE_server_multiconnect/BLE_server_multiconnect.ino deleted file mode 100644 index 90704ef16ad..00000000000 --- a/libraries/BLE/examples/BLE_server_multiconnect/BLE_server_multiconnect.ino +++ /dev/null @@ -1,111 +0,0 @@ -/* - Video: https://www.youtube.com/watch?v=oCMOYS71NIU - Based on Neil Kolban example for IDF: https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLE%20Tests/SampleNotify.cpp - Ported to Arduino ESP32 by Evandro Copercini - updated by chegewara - - Create a BLE server that, once we receive a connection, will send periodic notifications. - The service advertises itself as: 4fafc201-1fb5-459e-8fcc-c5c9c331914b - And has a characteristic of: beb5483e-36e1-4688-b7f5-ea07361b26a8 - - The design of creating the BLE server is: - 1. Create a BLE Server - 2. Create a BLE Service - 3. Create a BLE Characteristic on the Service - 4. Create a BLE Descriptor on the characteristic - 5. Start the service. - 6. Start advertising. - - A connect hander associated with the server starts a background task that performs notification - every couple of seconds. -*/ -#include -#include -#include -#include - -BLEServer* pServer = NULL; -BLECharacteristic* pCharacteristic = NULL; -bool deviceConnected = false; -bool oldDeviceConnected = false; -uint32_t value = 0; - -// See the following for generating UUIDs: -// https://www.uuidgenerator.net/ - -#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b" -#define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8" - - -class MyServerCallbacks: public BLEServerCallbacks { - void onConnect(BLEServer* pServer) { - deviceConnected = true; - BLEDevice::startAdvertising(); - }; - - void onDisconnect(BLEServer* pServer) { - deviceConnected = false; - } -}; - - - -void setup() { - Serial.begin(115200); - - // Create the BLE Device - BLEDevice::init("ESP32"); - - // Create the BLE Server - pServer = BLEDevice::createServer(); - pServer->setCallbacks(new MyServerCallbacks()); - - // Create the BLE Service - BLEService *pService = pServer->createService(SERVICE_UUID); - - // Create a BLE Characteristic - pCharacteristic = pService->createCharacteristic( - CHARACTERISTIC_UUID, - BLECharacteristic::PROPERTY_READ | - BLECharacteristic::PROPERTY_WRITE | - BLECharacteristic::PROPERTY_NOTIFY | - BLECharacteristic::PROPERTY_INDICATE - ); - - // https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml - // Create a BLE Descriptor - pCharacteristic->addDescriptor(new BLE2902()); - - // Start the service - pService->start(); - - // Start advertising - BLEAdvertising *pAdvertising = BLEDevice::getAdvertising(); - pAdvertising->addServiceUUID(SERVICE_UUID); - pAdvertising->setScanResponse(false); - pAdvertising->setMinPreferred(0x0); // set value to 0x00 to not advertise this parameter - BLEDevice::startAdvertising(); - Serial.println("Waiting a client connection to notify..."); -} - -void loop() { - // notify changed value - if (deviceConnected) { - pCharacteristic->setValue((uint8_t*)&value, 4); - pCharacteristic->notify(); - value++; - delay(10); // bluetooth stack will go into congestion, if too many packets are sent, in 6 hours test i was able to go as low as 3ms - } - // disconnecting - if (!deviceConnected && oldDeviceConnected) { - delay(500); // give the bluetooth stack the chance to get things ready - pServer->startAdvertising(); // restart advertising - Serial.println("start advertising"); - oldDeviceConnected = deviceConnected; - } - // connecting - if (deviceConnected && !oldDeviceConnected) { - // do stuff here on connecting - oldDeviceConnected = deviceConnected; - } -} diff --git a/libraries/BLE/examples/BLE_uart/BLE_uart.ino b/libraries/BLE/examples/BLE_uart/BLE_uart.ino deleted file mode 100644 index 35b570b9192..00000000000 --- a/libraries/BLE/examples/BLE_uart/BLE_uart.ino +++ /dev/null @@ -1,125 +0,0 @@ -/* - Video: https://www.youtube.com/watch?v=oCMOYS71NIU - Based on Neil Kolban example for IDF: https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLE%20Tests/SampleNotify.cpp - Ported to Arduino ESP32 by Evandro Copercini - - Create a BLE server that, once we receive a connection, will send periodic notifications. - The service advertises itself as: 6E400001-B5A3-F393-E0A9-E50E24DCCA9E - Has a characteristic of: 6E400002-B5A3-F393-E0A9-E50E24DCCA9E - used for receiving data with "WRITE" - Has a characteristic of: 6E400003-B5A3-F393-E0A9-E50E24DCCA9E - used to send data with "NOTIFY" - - The design of creating the BLE server is: - 1. Create a BLE Server - 2. Create a BLE Service - 3. Create a BLE Characteristic on the Service - 4. Create a BLE Descriptor on the characteristic - 5. Start the service. - 6. Start advertising. - - In this example rxValue is the data received (only accessible inside that function). - And txValue is the data to be sent, in this example just a byte incremented every second. -*/ -#include -#include -#include -#include - -BLEServer *pServer = NULL; -BLECharacteristic * pTxCharacteristic; -bool deviceConnected = false; -bool oldDeviceConnected = false; -uint8_t txValue = 0; - -// See the following for generating UUIDs: -// https://www.uuidgenerator.net/ - -#define SERVICE_UUID "6E400001-B5A3-F393-E0A9-E50E24DCCA9E" // UART service UUID -#define CHARACTERISTIC_UUID_RX "6E400002-B5A3-F393-E0A9-E50E24DCCA9E" -#define CHARACTERISTIC_UUID_TX "6E400003-B5A3-F393-E0A9-E50E24DCCA9E" - - -class MyServerCallbacks: public BLEServerCallbacks { - void onConnect(BLEServer* pServer) { - deviceConnected = true; - }; - - void onDisconnect(BLEServer* pServer) { - deviceConnected = false; - } -}; - -class MyCallbacks: public BLECharacteristicCallbacks { - void onWrite(BLECharacteristic *pCharacteristic) { - std::string rxValue = pCharacteristic->getValue(); - - if (rxValue.length() > 0) { - Serial.println("*********"); - Serial.print("Received Value: "); - for (int i = 0; i < rxValue.length(); i++) - Serial.print(rxValue[i]); - - Serial.println(); - Serial.println("*********"); - } - } -}; - - -void setup() { - Serial.begin(115200); - - // Create the BLE Device - BLEDevice::init("UART Service"); - - // Create the BLE Server - pServer = BLEDevice::createServer(); - pServer->setCallbacks(new MyServerCallbacks()); - - // Create the BLE Service - BLEService *pService = pServer->createService(SERVICE_UUID); - - // Create a BLE Characteristic - pTxCharacteristic = pService->createCharacteristic( - CHARACTERISTIC_UUID_TX, - BLECharacteristic::PROPERTY_NOTIFY - ); - - pTxCharacteristic->addDescriptor(new BLE2902()); - - BLECharacteristic * pRxCharacteristic = pService->createCharacteristic( - CHARACTERISTIC_UUID_RX, - BLECharacteristic::PROPERTY_WRITE - ); - - pRxCharacteristic->setCallbacks(new MyCallbacks()); - - // Start the service - pService->start(); - - // Start advertising - pServer->getAdvertising()->start(); - Serial.println("Waiting a client connection to notify..."); -} - -void loop() { - - if (deviceConnected) { - pTxCharacteristic->setValue(&txValue, 1); - pTxCharacteristic->notify(); - txValue++; - delay(10); // bluetooth stack will go into congestion, if too many packets are sent - } - - // disconnecting - if (!deviceConnected && oldDeviceConnected) { - delay(500); // give the bluetooth stack the chance to get things ready - pServer->startAdvertising(); // restart advertising - Serial.println("start advertising"); - oldDeviceConnected = deviceConnected; - } - // connecting - if (deviceConnected && !oldDeviceConnected) { - // do stuff here on connecting - oldDeviceConnected = deviceConnected; - } -} diff --git a/libraries/BLE/examples/BLE_write/BLE_write.ino b/libraries/BLE/examples/BLE_write/BLE_write.ino deleted file mode 100644 index 24a0cd23d7a..00000000000 --- a/libraries/BLE/examples/BLE_write/BLE_write.ino +++ /dev/null @@ -1,65 +0,0 @@ -/* - Based on Neil Kolban example for IDF: https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLE%20Tests/SampleWrite.cpp - Ported to Arduino ESP32 by Evandro Copercini -*/ - -#include -#include -#include - -// See the following for generating UUIDs: -// https://www.uuidgenerator.net/ - -#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b" -#define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8" - - -class MyCallbacks: public BLECharacteristicCallbacks { - void onWrite(BLECharacteristic *pCharacteristic) { - std::string value = pCharacteristic->getValue(); - - if (value.length() > 0) { - Serial.println("*********"); - Serial.print("New value: "); - for (int i = 0; i < value.length(); i++) - Serial.print(value[i]); - - Serial.println(); - Serial.println("*********"); - } - } -}; - -void setup() { - Serial.begin(115200); - - Serial.println("1- Download and install an BLE scanner app in your phone"); - Serial.println("2- Scan for BLE devices in the app"); - Serial.println("3- Connect to MyESP32"); - Serial.println("4- Go to CUSTOM CHARACTERISTIC in CUSTOM SERVICE and write something"); - Serial.println("5- See the magic =)"); - - BLEDevice::init("MyESP32"); - BLEServer *pServer = BLEDevice::createServer(); - - BLEService *pService = pServer->createService(SERVICE_UUID); - - BLECharacteristic *pCharacteristic = pService->createCharacteristic( - CHARACTERISTIC_UUID, - BLECharacteristic::PROPERTY_READ | - BLECharacteristic::PROPERTY_WRITE - ); - - pCharacteristic->setCallbacks(new MyCallbacks()); - - pCharacteristic->setValue("Hello World"); - pService->start(); - - BLEAdvertising *pAdvertising = pServer->getAdvertising(); - pAdvertising->start(); -} - -void loop() { - // put your main code here, to run repeatedly: - delay(2000); -} \ No newline at end of file diff --git a/libraries/BLE/library.properties b/libraries/BLE/library.properties deleted file mode 100644 index 8c2a019fe57..00000000000 --- a/libraries/BLE/library.properties +++ /dev/null @@ -1,10 +0,0 @@ -name=ESP32 BLE Arduino -version=1.0.1 -author=Neil Kolban -maintainer=Dariusz Krempa -sentence=BLE functions for ESP32 -paragraph=This library provides an implementation Bluetooth Low Energy support for the ESP32 using the Arduino platform. -category=Communication -url=https://github.com/nkolban/ESP32_BLE_Arduino -architectures=esp32 -includes=BLEDevice.h, BLEUtils.h, BLEScan.h, BLEAdvertisedDevice.h diff --git a/libraries/BLE/src/BLE2902.cpp b/libraries/BLE/src/BLE2902.cpp deleted file mode 100644 index 23d9c77c093..00000000000 --- a/libraries/BLE/src/BLE2902.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * BLE2902.cpp - * - * Created on: Jun 25, 2017 - * Author: kolban - */ - -/* - * See also: - * https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml - */ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) - -#include "BLE2902.h" - -BLE2902::BLE2902() : BLEDescriptor(BLEUUID((uint16_t) 0x2902)) { - uint8_t data[2] = { 0, 0 }; - setValue(data, 2); -} // BLE2902 - - -/** - * @brief Get the notifications value. - * @return The notifications value. True if notifications are enabled and false if not. - */ -bool BLE2902::getNotifications() { - return (getValue()[0] & (1 << 0)) != 0; -} // getNotifications - - -/** - * @brief Get the indications value. - * @return The indications value. True if indications are enabled and false if not. - */ -bool BLE2902::getIndications() { - return (getValue()[0] & (1 << 1)) != 0; -} // getIndications - - -/** - * @brief Set the indications flag. - * @param [in] flag The indications flag. - */ -void BLE2902::setIndications(bool flag) { - uint8_t *pValue = getValue(); - if (flag) pValue[0] |= 1 << 1; - else pValue[0] &= ~(1 << 1); -} // setIndications - - -/** - * @brief Set the notifications flag. - * @param [in] flag The notifications flag. - */ -void BLE2902::setNotifications(bool flag) { - uint8_t *pValue = getValue(); - if (flag) pValue[0] |= 1 << 0; - else pValue[0] &= ~(1 << 0); -} // setNotifications - -#endif diff --git a/libraries/BLE/src/BLE2902.h b/libraries/BLE/src/BLE2902.h deleted file mode 100644 index 397360ab128..00000000000 --- a/libraries/BLE/src/BLE2902.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * BLE2902.h - * - * Created on: Jun 25, 2017 - * Author: kolban - */ - -#ifndef COMPONENTS_CPP_UTILS_BLE2902_H_ -#define COMPONENTS_CPP_UTILS_BLE2902_H_ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) - -#include "BLEDescriptor.h" - -/** - * @brief Descriptor for Client Characteristic Configuration. - * - * This is a convenience descriptor for the Client Characteristic Configuration which has a UUID of 0x2902. - * - * See also: - * https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml - */ -class BLE2902: public BLEDescriptor { -public: - BLE2902(); - bool getNotifications(); - bool getIndications(); - void setNotifications(bool flag); - void setIndications(bool flag); - -}; // BLE2902 - -#endif /* CONFIG_BT_ENABLED */ -#endif /* COMPONENTS_CPP_UTILS_BLE2902_H_ */ diff --git a/libraries/BLE/src/BLE2904.cpp b/libraries/BLE/src/BLE2904.cpp deleted file mode 100644 index 02252a1d676..00000000000 --- a/libraries/BLE/src/BLE2904.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * BLE2904.cpp - * - * Created on: Dec 23, 2017 - * Author: kolban - */ - -/* - * See also: - * https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.characteristic_presentation_format.xml - */ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) - -#include "BLE2904.h" - - -BLE2904::BLE2904() : BLEDescriptor(BLEUUID((uint16_t) 0x2904)) { - m_data.m_format = 0; - m_data.m_exponent = 0; - m_data.m_namespace = 1; // 1 = Bluetooth SIG Assigned Numbers - m_data.m_unit = 0; - m_data.m_description = 0; - setValue((uint8_t*) &m_data, sizeof(m_data)); -} // BLE2902 - - -/** - * @brief Set the description. - */ -void BLE2904::setDescription(uint16_t description) { - m_data.m_description = description; - setValue((uint8_t*) &m_data, sizeof(m_data)); -} - - -/** - * @brief Set the exponent. - */ -void BLE2904::setExponent(int8_t exponent) { - m_data.m_exponent = exponent; - setValue((uint8_t*) &m_data, sizeof(m_data)); -} // setExponent - - -/** - * @brief Set the format. - */ -void BLE2904::setFormat(uint8_t format) { - m_data.m_format = format; - setValue((uint8_t*) &m_data, sizeof(m_data)); -} // setFormat - - -/** - * @brief Set the namespace. - */ -void BLE2904::setNamespace(uint8_t namespace_value) { - m_data.m_namespace = namespace_value; - setValue((uint8_t*) &m_data, sizeof(m_data)); -} // setNamespace - - -/** - * @brief Set the units for this value. It should be one of the encoded values defined here: - * https://www.bluetooth.com/specifications/assigned-numbers/units - * @param [in] unit The type of units of this characteristic as defined by assigned numbers. - */ -void BLE2904::setUnit(uint16_t unit) { - m_data.m_unit = unit; - setValue((uint8_t*) &m_data, sizeof(m_data)); -} // setUnit - -#endif diff --git a/libraries/BLE/src/BLE2904.h b/libraries/BLE/src/BLE2904.h deleted file mode 100644 index cb337e22bed..00000000000 --- a/libraries/BLE/src/BLE2904.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * BLE2904.h - * - * Created on: Dec 23, 2017 - * Author: kolban - */ - -#ifndef COMPONENTS_CPP_UTILS_BLE2904_H_ -#define COMPONENTS_CPP_UTILS_BLE2904_H_ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) - -#include "BLEDescriptor.h" - -struct BLE2904_Data { - uint8_t m_format; - int8_t m_exponent; - uint16_t m_unit; // See https://www.bluetooth.com/specifications/assigned-numbers/units - uint8_t m_namespace; - uint16_t m_description; - -} __attribute__((packed)); - -/** - * @brief Descriptor for Characteristic Presentation Format. - * - * This is a convenience descriptor for the Characteristic Presentation Format which has a UUID of 0x2904. - * - * See also: - * https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.characteristic_presentation_format.xml - */ -class BLE2904: public BLEDescriptor { -public: - BLE2904(); - static const uint8_t FORMAT_BOOLEAN = 1; - static const uint8_t FORMAT_UINT2 = 2; - static const uint8_t FORMAT_UINT4 = 3; - static const uint8_t FORMAT_UINT8 = 4; - static const uint8_t FORMAT_UINT12 = 5; - static const uint8_t FORMAT_UINT16 = 6; - static const uint8_t FORMAT_UINT24 = 7; - static const uint8_t FORMAT_UINT32 = 8; - static const uint8_t FORMAT_UINT48 = 9; - static const uint8_t FORMAT_UINT64 = 10; - static const uint8_t FORMAT_UINT128 = 11; - static const uint8_t FORMAT_SINT8 = 12; - static const uint8_t FORMAT_SINT12 = 13; - static const uint8_t FORMAT_SINT16 = 14; - static const uint8_t FORMAT_SINT24 = 15; - static const uint8_t FORMAT_SINT32 = 16; - static const uint8_t FORMAT_SINT48 = 17; - static const uint8_t FORMAT_SINT64 = 18; - static const uint8_t FORMAT_SINT128 = 19; - static const uint8_t FORMAT_FLOAT32 = 20; - static const uint8_t FORMAT_FLOAT64 = 21; - static const uint8_t FORMAT_SFLOAT16 = 22; - static const uint8_t FORMAT_SFLOAT32 = 23; - static const uint8_t FORMAT_IEEE20601 = 24; - static const uint8_t FORMAT_UTF8 = 25; - static const uint8_t FORMAT_UTF16 = 26; - static const uint8_t FORMAT_OPAQUE = 27; - - void setDescription(uint16_t); - void setExponent(int8_t exponent); - void setFormat(uint8_t format); - void setNamespace(uint8_t namespace_value); - void setUnit(uint16_t unit); - -private: - BLE2904_Data m_data; -}; // BLE2904 - -#endif /* CONFIG_BT_ENABLED */ -#endif /* COMPONENTS_CPP_UTILS_BLE2904_H_ */ diff --git a/libraries/BLE/src/BLEAddress.cpp b/libraries/BLE/src/BLEAddress.cpp deleted file mode 100644 index 6d83b17e68e..00000000000 --- a/libraries/BLE/src/BLEAddress.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - * BLEAddress.cpp - * - * Created on: Jul 2, 2017 - * Author: kolban - */ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) - -#include "BLEAddress.h" -#include -#include -#include -#include -#include -#include -#ifdef ARDUINO_ARCH_ESP32 -#include "esp32-hal-log.h" -#endif - - -/** - * @brief Create an address from the native ESP32 representation. - * @param [in] address The native representation. - */ -BLEAddress::BLEAddress(esp_bd_addr_t address) { - memcpy(m_address, address, ESP_BD_ADDR_LEN); -} // BLEAddress - - -/** - * @brief Create an address from a hex string - * - * A hex string is of the format: - * ``` - * 00:00:00:00:00:00 - * ``` - * which is 17 characters in length. - * - * @param [in] stringAddress The hex representation of the address. - */ -BLEAddress::BLEAddress(std::string stringAddress) { - if (stringAddress.length() != 17) return; - - int data[6]; - sscanf(stringAddress.c_str(), "%x:%x:%x:%x:%x:%x", &data[0], &data[1], &data[2], &data[3], &data[4], &data[5]); - m_address[0] = (uint8_t) data[0]; - m_address[1] = (uint8_t) data[1]; - m_address[2] = (uint8_t) data[2]; - m_address[3] = (uint8_t) data[3]; - m_address[4] = (uint8_t) data[4]; - m_address[5] = (uint8_t) data[5]; -} // BLEAddress - - -/** - * @brief Determine if this address equals another. - * @param [in] otherAddress The other address to compare against. - * @return True if the addresses are equal. - */ -bool BLEAddress::equals(BLEAddress otherAddress) { - return memcmp(otherAddress.getNative(), m_address, 6) == 0; -} // equals - - -/** - * @brief Return the native representation of the address. - * @return The native representation of the address. - */ -esp_bd_addr_t *BLEAddress::getNative() { - return &m_address; -} // getNative - - -/** - * @brief Convert a BLE address to a string. - * - * A string representation of an address is in the format: - * - * ``` - * xx:xx:xx:xx:xx:xx - * ``` - * - * @return The string representation of the address. - */ -std::string BLEAddress::toString() { - auto size = 18; - char *res = (char*)malloc(size); - snprintf(res, size, "%02x:%02x:%02x:%02x:%02x:%02x", m_address[0], m_address[1], m_address[2], m_address[3], m_address[4], m_address[5]); - std::string ret(res); - free(res); - return ret; -} // toString -#endif diff --git a/libraries/BLE/src/BLEAddress.h b/libraries/BLE/src/BLEAddress.h deleted file mode 100644 index 7eff4da4bb6..00000000000 --- a/libraries/BLE/src/BLEAddress.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * BLEAddress.h - * - * Created on: Jul 2, 2017 - * Author: kolban - */ - -#ifndef COMPONENTS_CPP_UTILS_BLEADDRESS_H_ -#define COMPONENTS_CPP_UTILS_BLEADDRESS_H_ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include // ESP32 BLE -#include - - -/** - * @brief A %BLE device address. - * - * Every %BLE device has a unique address which can be used to identify it and form connections. - */ -class BLEAddress { -public: - BLEAddress(esp_bd_addr_t address); - BLEAddress(std::string stringAddress); - bool equals(BLEAddress otherAddress); - esp_bd_addr_t* getNative(); - std::string toString(); - -private: - esp_bd_addr_t m_address; -}; - -#endif /* CONFIG_BT_ENABLED */ -#endif /* COMPONENTS_CPP_UTILS_BLEADDRESS_H_ */ diff --git a/libraries/BLE/src/BLEAdvertisedDevice.cpp b/libraries/BLE/src/BLEAdvertisedDevice.cpp deleted file mode 100644 index 1c341cf2412..00000000000 --- a/libraries/BLE/src/BLEAdvertisedDevice.cpp +++ /dev/null @@ -1,529 +0,0 @@ -/* - * BLEAdvertisedDevice.cpp - * - * During the scanning procedure, we will be finding advertised BLE devices. This class - * models a found device. - * - * - * See also: - * https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile - * - * Created on: Jul 3, 2017 - * Author: kolban - */ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include -#include "BLEAdvertisedDevice.h" -#include "BLEUtils.h" -#include "esp32-hal-log.h" - -BLEAdvertisedDevice::BLEAdvertisedDevice() { - m_adFlag = 0; - m_appearance = 0; - m_deviceType = 0; - m_manufacturerData = ""; - m_name = ""; - m_rssi = -9999; - m_serviceData = ""; - m_txPower = 0; - m_pScan = nullptr; - - m_haveAppearance = false; - m_haveManufacturerData = false; - m_haveName = false; - m_haveRSSI = false; - m_haveServiceData = false; - m_haveServiceUUID = false; - m_haveTXPower = false; - -} // BLEAdvertisedDevice - - -/** - * @brief Get the address. - * - * Every %BLE device exposes an address that is used to identify it and subsequently connect to it. - * Call this function to obtain the address of the advertised device. - * - * @return The address of the advertised device. - */ -BLEAddress BLEAdvertisedDevice::getAddress() { - return m_address; -} // getAddress - - -/** - * @brief Get the appearance. - * - * A %BLE device can declare its own appearance. The appearance is how it would like to be shown to an end user - * typcially in the form of an icon. - * - * @return The appearance of the advertised device. - */ -uint16_t BLEAdvertisedDevice::getAppearance() { - return m_appearance; -} // getAppearance - - -/** - * @brief Get the manufacturer data. - * @return The manufacturer data of the advertised device. - */ -std::string BLEAdvertisedDevice::getManufacturerData() { - return m_manufacturerData; -} // getManufacturerData - - -/** - * @brief Get the name. - * @return The name of the advertised device. - */ -std::string BLEAdvertisedDevice::getName() { - return m_name; -} // getName - - -/** - * @brief Get the RSSI. - * @return The RSSI of the advertised device. - */ -int BLEAdvertisedDevice::getRSSI() { - return m_rssi; -} // getRSSI - - -/** - * @brief Get the scan object that created this advertisement. - * @return The scan object. - */ -BLEScan* BLEAdvertisedDevice::getScan() { - return m_pScan; -} // getScan - - -/** - * @brief Get the service data. - * @return The ServiceData of the advertised device. - */ -std::string BLEAdvertisedDevice::getServiceData() { - return m_serviceData; -} //getServiceData - - -/** - * @brief Get the service data UUID. - * @return The service data UUID. - */ -BLEUUID BLEAdvertisedDevice::getServiceDataUUID() { - return m_serviceDataUUID; -} // getServiceDataUUID - - -/** - * @brief Get the Service UUID. - * @return The Service UUID of the advertised device. - */ -BLEUUID BLEAdvertisedDevice::getServiceUUID() { //TODO Remove it eventually, is no longer useful - return m_serviceUUIDs[0]; -} // getServiceUUID - -/** - * @brief Check advertised serviced for existence required UUID - * @return Return true if service is advertised - */ -bool BLEAdvertisedDevice::isAdvertisingService(BLEUUID uuid){ - for (int i = 0; i < m_serviceUUIDs.size(); i++) { - if (m_serviceUUIDs[i].equals(uuid)) return true; - } - return false; -} - -/** - * @brief Get the TX Power. - * @return The TX Power of the advertised device. - */ -int8_t BLEAdvertisedDevice::getTXPower() { - return m_txPower; -} // getTXPower - - - -/** - * @brief Does this advertisement have an appearance value? - * @return True if there is an appearance value present. - */ -bool BLEAdvertisedDevice::haveAppearance() { - return m_haveAppearance; -} // haveAppearance - - -/** - * @brief Does this advertisement have manufacturer data? - * @return True if there is manufacturer data present. - */ -bool BLEAdvertisedDevice::haveManufacturerData() { - return m_haveManufacturerData; -} // haveManufacturerData - - -/** - * @brief Does this advertisement have a name value? - * @return True if there is a name value present. - */ -bool BLEAdvertisedDevice::haveName() { - return m_haveName; -} // haveName - - -/** - * @brief Does this advertisement have a signal strength value? - * @return True if there is a signal strength value present. - */ -bool BLEAdvertisedDevice::haveRSSI() { - return m_haveRSSI; -} // haveRSSI - - -/** - * @brief Does this advertisement have a service data value? - * @return True if there is a service data value present. - */ -bool BLEAdvertisedDevice::haveServiceData() { - return m_haveServiceData; -} // haveServiceData - - -/** - * @brief Does this advertisement have a service UUID value? - * @return True if there is a service UUID value present. - */ -bool BLEAdvertisedDevice::haveServiceUUID() { - return m_haveServiceUUID; -} // haveServiceUUID - - -/** - * @brief Does this advertisement have a transmission power value? - * @return True if there is a transmission power value present. - */ -bool BLEAdvertisedDevice::haveTXPower() { - return m_haveTXPower; -} // haveTXPower - - -/** - * @brief Parse the advertising pay load. - * - * The pay load is a buffer of bytes that is either 31 bytes long or terminated by - * a 0 length value. Each entry in the buffer has the format: - * [length][type][data...] - * - * The length does not include itself but does include everything after it until the next record. A record - * with a length value of 0 indicates a terminator. - * - * https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile - */ -void BLEAdvertisedDevice::parseAdvertisement(uint8_t* payload, size_t total_len) { - uint8_t length; - uint8_t ad_type; - uint8_t sizeConsumed = 0; - bool finished = false; - m_payload = payload; - m_payloadLength = total_len; - - while(!finished) { - length = *payload; // Retrieve the length of the record. - payload++; // Skip to type - sizeConsumed += 1 + length; // increase the size consumed. - - if (length != 0) { // A length of 0 indicates that we have reached the end. - ad_type = *payload; - payload++; - length--; - - char* pHex = BLEUtils::buildHexData(nullptr, payload, length); - log_d("Type: 0x%.2x (%s), length: %d, data: %s", - ad_type, BLEUtils::advTypeToString(ad_type), length, pHex); - free(pHex); - - switch(ad_type) { - case ESP_BLE_AD_TYPE_NAME_CMPL: { // Adv Data Type: 0x09 - setName(std::string(reinterpret_cast(payload), length)); - break; - } // ESP_BLE_AD_TYPE_NAME_CMPL - - case ESP_BLE_AD_TYPE_TX_PWR: { // Adv Data Type: 0x0A - setTXPower(*payload); - break; - } // ESP_BLE_AD_TYPE_TX_PWR - - case ESP_BLE_AD_TYPE_APPEARANCE: { // Adv Data Type: 0x19 - setAppearance(*reinterpret_cast(payload)); - break; - } // ESP_BLE_AD_TYPE_APPEARANCE - - case ESP_BLE_AD_TYPE_FLAG: { // Adv Data Type: 0x01 - setAdFlag(*payload); - break; - } // ESP_BLE_AD_TYPE_FLAG - - case ESP_BLE_AD_TYPE_16SRV_CMPL: - case ESP_BLE_AD_TYPE_16SRV_PART: { // Adv Data Type: 0x02 - for (int var = 0; var < length/2; ++var) { - setServiceUUID(BLEUUID(*reinterpret_cast(payload + var * 2))); - } - break; - } // ESP_BLE_AD_TYPE_16SRV_PART - - case ESP_BLE_AD_TYPE_32SRV_CMPL: - case ESP_BLE_AD_TYPE_32SRV_PART: { // Adv Data Type: 0x04 - for (int var = 0; var < length/4; ++var) { - setServiceUUID(BLEUUID(*reinterpret_cast(payload + var * 4))); - } - break; - } // ESP_BLE_AD_TYPE_32SRV_PART - - case ESP_BLE_AD_TYPE_128SRV_CMPL: { // Adv Data Type: 0x07 - setServiceUUID(BLEUUID(payload, 16, false)); - break; - } // ESP_BLE_AD_TYPE_128SRV_CMPL - - case ESP_BLE_AD_TYPE_128SRV_PART: { // Adv Data Type: 0x06 - setServiceUUID(BLEUUID(payload, 16, false)); - break; - } // ESP_BLE_AD_TYPE_128SRV_PART - - // See CSS Part A 1.4 Manufacturer Specific Data - case ESP_BLE_AD_MANUFACTURER_SPECIFIC_TYPE: { - setManufacturerData(std::string(reinterpret_cast(payload), length)); - break; - } // ESP_BLE_AD_MANUFACTURER_SPECIFIC_TYPE - - case ESP_BLE_AD_TYPE_SERVICE_DATA: { // Adv Data Type: 0x16 (Service Data) - 2 byte UUID - if (length < 2) { - log_e("Length too small for ESP_BLE_AD_TYPE_SERVICE_DATA"); - break; - } - uint16_t uuid = *(uint16_t*)payload; - setServiceDataUUID(BLEUUID(uuid)); - if (length > 2) { - setServiceData(std::string(reinterpret_cast(payload + 2), length - 2)); - } - break; - } //ESP_BLE_AD_TYPE_SERVICE_DATA - - case ESP_BLE_AD_TYPE_32SERVICE_DATA: { // Adv Data Type: 0x20 (Service Data) - 4 byte UUID - if (length < 4) { - log_e("Length too small for ESP_BLE_AD_TYPE_32SERVICE_DATA"); - break; - } - uint32_t uuid = *(uint32_t*) payload; - setServiceDataUUID(BLEUUID(uuid)); - if (length > 4) { - setServiceData(std::string(reinterpret_cast(payload + 4), length - 4)); - } - break; - } //ESP_BLE_AD_TYPE_32SERVICE_DATA - - case ESP_BLE_AD_TYPE_128SERVICE_DATA: { // Adv Data Type: 0x21 (Service Data) - 16 byte UUID - if (length < 16) { - log_e("Length too small for ESP_BLE_AD_TYPE_128SERVICE_DATA"); - break; - } - - setServiceDataUUID(BLEUUID(payload, (size_t)16, false)); - if (length > 16) { - setServiceData(std::string(reinterpret_cast(payload + 16), length - 16)); - } - break; - } //ESP_BLE_AD_TYPE_32SERVICE_DATA - - default: { - log_d("Unhandled type: adType: %d - 0x%.2x", ad_type, ad_type); - break; - } - } // switch - payload += length; - } // Length <> 0 - - - if (sizeConsumed >= total_len) - finished = true; - - } // !finished -} // parseAdvertisement - - -/** - * @brief Set the address of the advertised device. - * @param [in] address The address of the advertised device. - */ -void BLEAdvertisedDevice::setAddress(BLEAddress address) { - m_address = address; -} // setAddress - - -/** - * @brief Set the adFlag for this device. - * @param [in] The discovered adFlag. - */ -void BLEAdvertisedDevice::setAdFlag(uint8_t adFlag) { - m_adFlag = adFlag; -} // setAdFlag - - -/** - * @brief Set the appearance for this device. - * @param [in] The discovered appearance. - */ -void BLEAdvertisedDevice::setAppearance(uint16_t appearance) { - m_appearance = appearance; - m_haveAppearance = true; - log_d("- appearance: %d", m_appearance); -} // setAppearance - - -/** - * @brief Set the manufacturer data for this device. - * @param [in] The discovered manufacturer data. - */ -void BLEAdvertisedDevice::setManufacturerData(std::string manufacturerData) { - m_manufacturerData = manufacturerData; - m_haveManufacturerData = true; - char* pHex = BLEUtils::buildHexData(nullptr, (uint8_t*) m_manufacturerData.data(), (uint8_t) m_manufacturerData.length()); - log_d("- manufacturer data: %s", pHex); - free(pHex); -} // setManufacturerData - - -/** - * @brief Set the name for this device. - * @param [in] name The discovered name. - */ -void BLEAdvertisedDevice::setName(std::string name) { - m_name = name; - m_haveName = true; - log_d("- setName(): name: %s", m_name.c_str()); -} // setName - - -/** - * @brief Set the RSSI for this device. - * @param [in] rssi The discovered RSSI. - */ -void BLEAdvertisedDevice::setRSSI(int rssi) { - m_rssi = rssi; - m_haveRSSI = true; - log_d("- setRSSI(): rssi: %d", m_rssi); -} // setRSSI - - -/** - * @brief Set the Scan that created this advertised device. - * @param pScan The Scan that created this advertised device. - */ -void BLEAdvertisedDevice::setScan(BLEScan* pScan) { - m_pScan = pScan; -} // setScan - - -/** - * @brief Set the Service UUID for this device. - * @param [in] serviceUUID The discovered serviceUUID - */ -void BLEAdvertisedDevice::setServiceUUID(const char* serviceUUID) { - return setServiceUUID(BLEUUID(serviceUUID)); -} // setServiceUUID - - -/** - * @brief Set the Service UUID for this device. - * @param [in] serviceUUID The discovered serviceUUID - */ -void BLEAdvertisedDevice::setServiceUUID(BLEUUID serviceUUID) { - m_serviceUUIDs.push_back(serviceUUID); - m_haveServiceUUID = true; - log_d("- addServiceUUID(): serviceUUID: %s", serviceUUID.toString().c_str()); -} // setServiceUUID - - -/** - * @brief Set the ServiceData value. - * @param [in] data ServiceData value. - */ -void BLEAdvertisedDevice::setServiceData(std::string serviceData) { - m_haveServiceData = true; // Set the flag that indicates we have service data. - m_serviceData = serviceData; // Save the service data that we received. -} //setServiceData - - -/** - * @brief Set the ServiceDataUUID value. - * @param [in] data ServiceDataUUID value. - */ -void BLEAdvertisedDevice::setServiceDataUUID(BLEUUID uuid) { - m_haveServiceData = true; // Set the flag that indicates we have service data. - m_serviceDataUUID = uuid; -} // setServiceDataUUID - - -/** - * @brief Set the power level for this device. - * @param [in] txPower The discovered power level. - */ -void BLEAdvertisedDevice::setTXPower(int8_t txPower) { - m_txPower = txPower; - m_haveTXPower = true; - log_d("- txPower: %d", m_txPower); -} // setTXPower - - -/** - * @brief Create a string representation of this device. - * @return A string representation of this device. - */ -std::string BLEAdvertisedDevice::toString() { - std::string res = "Name: " + getName() + ", Address: " + getAddress().toString(); - if (haveAppearance()) { - char val[6]; - snprintf(val, sizeof(val), "%d", getAppearance()); - res += ", appearance: "; - res += val; - } - if (haveManufacturerData()) { - char *pHex = BLEUtils::buildHexData(nullptr, (uint8_t*)getManufacturerData().data(), getManufacturerData().length()); - res += ", manufacturer data: "; - res += pHex; - free(pHex); - } - if (haveServiceUUID()) { - res += ", serviceUUID: " + getServiceUUID().toString(); - } - if (haveTXPower()) { - char val[4]; - snprintf(val, sizeof(val), "%d", getTXPower()); - res += ", txPower: "; - res += val; - } - return res; -} // toString - -uint8_t* BLEAdvertisedDevice::getPayload() { - return m_payload; -} - -esp_ble_addr_type_t BLEAdvertisedDevice::getAddressType() { - return m_addressType; -} - -void BLEAdvertisedDevice::setAddressType(esp_ble_addr_type_t type) { - m_addressType = type; -} - -size_t BLEAdvertisedDevice::getPayloadLength() { - return m_payloadLength; -} - -#endif /* CONFIG_BT_ENABLED */ - diff --git a/libraries/BLE/src/BLEAdvertisedDevice.h b/libraries/BLE/src/BLEAdvertisedDevice.h deleted file mode 100644 index aec83746ed8..00000000000 --- a/libraries/BLE/src/BLEAdvertisedDevice.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * BLEAdvertisedDevice.h - * - * Created on: Jul 3, 2017 - * Author: kolban - */ - -#ifndef COMPONENTS_CPP_UTILS_BLEADVERTISEDDEVICE_H_ -#define COMPONENTS_CPP_UTILS_BLEADVERTISEDDEVICE_H_ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include - -#include - -#include "BLEAddress.h" -#include "BLEScan.h" -#include "BLEUUID.h" - - -class BLEScan; -/** - * @brief A representation of a %BLE advertised device found by a scan. - * - * When we perform a %BLE scan, the result will be a set of devices that are advertising. This - * class provides a model of a detected device. - */ -class BLEAdvertisedDevice { -public: - BLEAdvertisedDevice(); - - BLEAddress getAddress(); - uint16_t getAppearance(); - std::string getManufacturerData(); - std::string getName(); - int getRSSI(); - BLEScan* getScan(); - std::string getServiceData(); - BLEUUID getServiceDataUUID(); - BLEUUID getServiceUUID(); - int8_t getTXPower(); - uint8_t* getPayload(); - size_t getPayloadLength(); - esp_ble_addr_type_t getAddressType(); - void setAddressType(esp_ble_addr_type_t type); - - - bool isAdvertisingService(BLEUUID uuid); - bool haveAppearance(); - bool haveManufacturerData(); - bool haveName(); - bool haveRSSI(); - bool haveServiceData(); - bool haveServiceUUID(); - bool haveTXPower(); - - std::string toString(); - -private: - friend class BLEScan; - - void parseAdvertisement(uint8_t* payload, size_t total_len=62); - void setAddress(BLEAddress address); - void setAdFlag(uint8_t adFlag); - void setAdvertizementResult(uint8_t* payload); - void setAppearance(uint16_t appearance); - void setManufacturerData(std::string manufacturerData); - void setName(std::string name); - void setRSSI(int rssi); - void setScan(BLEScan* pScan); - void setServiceData(std::string data); - void setServiceDataUUID(BLEUUID uuid); - void setServiceUUID(const char* serviceUUID); - void setServiceUUID(BLEUUID serviceUUID); - void setTXPower(int8_t txPower); - - bool m_haveAppearance; - bool m_haveManufacturerData; - bool m_haveName; - bool m_haveRSSI; - bool m_haveServiceData; - bool m_haveServiceUUID; - bool m_haveTXPower; - - - BLEAddress m_address = BLEAddress((uint8_t*)"\0\0\0\0\0\0"); - uint8_t m_adFlag; - uint16_t m_appearance; - int m_deviceType; - std::string m_manufacturerData; - std::string m_name; - BLEScan* m_pScan; - int m_rssi; - std::vector m_serviceUUIDs; - int8_t m_txPower; - std::string m_serviceData; - BLEUUID m_serviceDataUUID; - uint8_t* m_payload; - size_t m_payloadLength = 0; - esp_ble_addr_type_t m_addressType; -}; - -/** - * @brief A callback handler for callbacks associated device scanning. - * - * When we are performing a scan as a %BLE client, we may wish to know when a new device that is advertising - * has been found. This class can be sub-classed and registered such that when a scan is performed and - * a new advertised device has been found, we will be called back to be notified. - */ -class BLEAdvertisedDeviceCallbacks { -public: - virtual ~BLEAdvertisedDeviceCallbacks() {} - /** - * @brief Called when a new scan result is detected. - * - * As we are scanning, we will find new devices. When found, this call back is invoked with a reference to the - * device that was found. During any individual scan, a device will only be detected one time. - */ - virtual void onResult(BLEAdvertisedDevice advertisedDevice) = 0; -}; - -#endif /* CONFIG_BT_ENABLED */ -#endif /* COMPONENTS_CPP_UTILS_BLEADVERTISEDDEVICE_H_ */ diff --git a/libraries/BLE/src/BLEAdvertising.cpp b/libraries/BLE/src/BLEAdvertising.cpp deleted file mode 100644 index ec73400c6d8..00000000000 --- a/libraries/BLE/src/BLEAdvertising.cpp +++ /dev/null @@ -1,517 +0,0 @@ -/* - * BLEAdvertising.cpp - * - * This class encapsulates advertising a BLE Server. - * Created on: Jun 21, 2017 - * Author: kolban - * - * The ESP-IDF provides a framework for BLE advertising. It has determined that there are a common set - * of properties that are advertised and has built a data structure that can be populated by the programmer. - * This means that the programmer doesn't have to "mess with" the low level construction of a low level - * BLE advertising frame. Many of the fields are determined for us while others we can set before starting - * to advertise. - * - * Should we wish to construct our own payload, we can use the BLEAdvertisementData class and call the setters - * upon it. Once it is populated, we can then associate it with the advertising and what ever the programmer - * set in the data will be advertised. - * - */ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include "BLEAdvertising.h" -#include -#include "BLEUtils.h" -#include "GeneralUtils.h" -#include "esp32-hal-log.h" - -/** - * @brief Construct a default advertising object. - * - */ -BLEAdvertising::BLEAdvertising() { - m_advData.set_scan_rsp = false; - m_advData.include_name = true; - m_advData.include_txpower = true; - m_advData.min_interval = 0x20; - m_advData.max_interval = 0x40; - m_advData.appearance = 0x00; - m_advData.manufacturer_len = 0; - m_advData.p_manufacturer_data = nullptr; - m_advData.service_data_len = 0; - m_advData.p_service_data = nullptr; - m_advData.service_uuid_len = 0; - m_advData.p_service_uuid = nullptr; - m_advData.flag = (ESP_BLE_ADV_FLAG_GEN_DISC | ESP_BLE_ADV_FLAG_BREDR_NOT_SPT); - - m_advParams.adv_int_min = 0x20; - m_advParams.adv_int_max = 0x40; - m_advParams.adv_type = ADV_TYPE_IND; - m_advParams.own_addr_type = BLE_ADDR_TYPE_PUBLIC; - m_advParams.channel_map = ADV_CHNL_ALL; - m_advParams.adv_filter_policy = ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY; - m_advParams.peer_addr_type = BLE_ADDR_TYPE_PUBLIC; - - m_customAdvData = false; // No custom advertising data - m_customScanResponseData = false; // No custom scan response data -} // BLEAdvertising - - -/** - * @brief Add a service uuid to exposed list of services. - * @param [in] serviceUUID The UUID of the service to expose. - */ -void BLEAdvertising::addServiceUUID(BLEUUID serviceUUID) { - m_serviceUUIDs.push_back(serviceUUID); -} // addServiceUUID - - -/** - * @brief Add a service uuid to exposed list of services. - * @param [in] serviceUUID The string representation of the service to expose. - */ -void BLEAdvertising::addServiceUUID(const char* serviceUUID) { - addServiceUUID(BLEUUID(serviceUUID)); -} // addServiceUUID - - -/** - * @brief Set the device appearance in the advertising data. - * The appearance attribute is of type 0x19. The codes for distinct appearances can be found here: - * https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.gap.appearance.xml. - * @param [in] appearance The appearance of the device in the advertising data. - * @return N/A. - */ -void BLEAdvertising::setAppearance(uint16_t appearance) { - m_advData.appearance = appearance; -} // setAppearance - -void BLEAdvertising::setMinInterval(uint16_t mininterval) { - m_advParams.adv_int_min = mininterval; -} // setMinInterval - -void BLEAdvertising::setMaxInterval(uint16_t maxinterval) { - m_advParams.adv_int_max = maxinterval; -} // setMaxInterval - -void BLEAdvertising::setMinPreferred(uint16_t mininterval) { - m_advData.min_interval = mininterval; -} // - -void BLEAdvertising::setMaxPreferred(uint16_t maxinterval) { - m_advData.max_interval = maxinterval; -} // - -void BLEAdvertising::setScanResponse(bool set) { - m_scanResp = set; -} - -/** - * @brief Set the filtering for the scan filter. - * @param [in] scanRequestWhitelistOnly If true, only allow scan requests from those on the white list. - * @param [in] connectWhitelistOnly If true, only allow connections from those on the white list. - */ -void BLEAdvertising::setScanFilter(bool scanRequestWhitelistOnly, bool connectWhitelistOnly) { - log_v(">> setScanFilter: scanRequestWhitelistOnly: %d, connectWhitelistOnly: %d", scanRequestWhitelistOnly, connectWhitelistOnly); - if (!scanRequestWhitelistOnly && !connectWhitelistOnly) { - m_advParams.adv_filter_policy = ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY; - log_v("<< setScanFilter"); - return; - } - if (scanRequestWhitelistOnly && !connectWhitelistOnly) { - m_advParams.adv_filter_policy = ADV_FILTER_ALLOW_SCAN_WLST_CON_ANY; - log_v("<< setScanFilter"); - return; - } - if (!scanRequestWhitelistOnly && connectWhitelistOnly) { - m_advParams.adv_filter_policy = ADV_FILTER_ALLOW_SCAN_ANY_CON_WLST; - log_v("<< setScanFilter"); - return; - } - if (scanRequestWhitelistOnly && connectWhitelistOnly) { - m_advParams.adv_filter_policy = ADV_FILTER_ALLOW_SCAN_WLST_CON_WLST; - log_v("<< setScanFilter"); - return; - } -} // setScanFilter - - -/** - * @brief Set the advertisement data that is to be published in a regular advertisement. - * @param [in] advertisementData The data to be advertised. - */ -void BLEAdvertising::setAdvertisementData(BLEAdvertisementData& advertisementData) { - log_v(">> setAdvertisementData"); - esp_err_t errRc = ::esp_ble_gap_config_adv_data_raw( - (uint8_t*)advertisementData.getPayload().data(), - advertisementData.getPayload().length()); - if (errRc != ESP_OK) { - log_e("esp_ble_gap_config_adv_data_raw: %d %s", errRc, GeneralUtils::errorToString(errRc)); - } - m_customAdvData = true; // Set the flag that indicates we are using custom advertising data. - log_v("<< setAdvertisementData"); -} // setAdvertisementData - - -/** - * @brief Set the advertisement data that is to be published in a scan response. - * @param [in] advertisementData The data to be advertised. - */ -void BLEAdvertising::setScanResponseData(BLEAdvertisementData& advertisementData) { - log_v(">> setScanResponseData"); - esp_err_t errRc = ::esp_ble_gap_config_scan_rsp_data_raw( - (uint8_t*)advertisementData.getPayload().data(), - advertisementData.getPayload().length()); - if (errRc != ESP_OK) { - log_e("esp_ble_gap_config_scan_rsp_data_raw: %d %s", errRc, GeneralUtils::errorToString(errRc)); - } - m_customScanResponseData = true; // Set the flag that indicates we are using custom scan response data. - log_v("<< setScanResponseData"); -} // setScanResponseData - -/** - * @brief Start advertising. - * Start advertising. - * @return N/A. - */ -void BLEAdvertising::start() { - log_v(">> start: customAdvData: %d, customScanResponseData: %d", m_customAdvData, m_customScanResponseData); - - // We have a vector of service UUIDs that we wish to advertise. In order to use the - // ESP-IDF framework, these must be supplied in a contiguous array of their 128bit (16 byte) - // representations. If we have 1 or more services to advertise then we allocate enough - // storage to host them and then copy them in one at a time into the contiguous storage. - int numServices = m_serviceUUIDs.size(); - if (numServices > 0) { - m_advData.service_uuid_len = 16 * numServices; - m_advData.p_service_uuid = new uint8_t[m_advData.service_uuid_len]; - uint8_t* p = m_advData.p_service_uuid; - for (int i = 0; i < numServices; i++) { - log_d("- advertising service: %s", m_serviceUUIDs[i].toString().c_str()); - BLEUUID serviceUUID128 = m_serviceUUIDs[i].to128(); - memcpy(p, serviceUUID128.getNative()->uuid.uuid128, 16); - p += 16; - } - } else { - m_advData.service_uuid_len = 0; - log_d("- no services advertised"); - } - - esp_err_t errRc; - - if (!m_customAdvData) { - // Set the configuration for advertising. - m_advData.set_scan_rsp = false; - m_advData.include_name = !m_scanResp; - m_advData.include_txpower = !m_scanResp; - errRc = ::esp_ble_gap_config_adv_data(&m_advData); - if (errRc != ESP_OK) { - log_e("<< esp_ble_gap_config_adv_data: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; - } - } - - if (!m_customScanResponseData && m_scanResp) { - m_advData.set_scan_rsp = true; - m_advData.include_name = m_scanResp; - m_advData.include_txpower = m_scanResp; - errRc = ::esp_ble_gap_config_adv_data(&m_advData); - if (errRc != ESP_OK) { - log_e("<< esp_ble_gap_config_adv_data (Scan response): rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; - } - } - - // If we had services to advertise then we previously allocated some storage for them. - // Here we release that storage. - if (m_advData.service_uuid_len > 0) { - delete[] m_advData.p_service_uuid; - m_advData.p_service_uuid = nullptr; - } - - // Start advertising. - errRc = ::esp_ble_gap_start_advertising(&m_advParams); - if (errRc != ESP_OK) { - log_e("<< esp_ble_gap_start_advertising: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; - } - log_v("<< start"); -} // start - - -/** - * @brief Stop advertising. - * Stop advertising. - * @return N/A. - */ -void BLEAdvertising::stop() { - log_v(">> stop"); - esp_err_t errRc = ::esp_ble_gap_stop_advertising(); - if (errRc != ESP_OK) { - log_e("esp_ble_gap_stop_advertising: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; - } - log_v("<< stop"); -} // stop - -/** - * @brief Set BLE address. - * @param [in] Bluetooth address. - * @param [in] Bluetooth address type. - * Set BLE address. - */ - -void BLEAdvertising::setDeviceAddress(esp_bd_addr_t addr, esp_ble_addr_type_t type) -{ - log_v(">> setPrivateAddress"); - - m_advParams.own_addr_type = type; - esp_err_t errRc = esp_ble_gap_set_rand_addr((uint8_t*)addr); - if (errRc != ESP_OK) - { - log_e("esp_ble_gap_set_rand_addr: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; - } - log_v("<< setPrivateAddress"); -} // setPrivateAddress - -/** - * @brief Add data to the payload to be advertised. - * @param [in] data The data to be added to the payload. - */ -void BLEAdvertisementData::addData(std::string data) { - if ((m_payload.length() + data.length()) > ESP_BLE_ADV_DATA_LEN_MAX) { - return; - } - m_payload.append(data); -} // addData - - -/** - * @brief Set the appearance. - * @param [in] appearance The appearance code value. - * - * See also: - * https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.gap.appearance.xml - */ -void BLEAdvertisementData::setAppearance(uint16_t appearance) { - char cdata[2]; - cdata[0] = 3; - cdata[1] = ESP_BLE_AD_TYPE_APPEARANCE; // 0x19 - addData(std::string(cdata, 2) + std::string((char*) &appearance, 2)); -} // setAppearance - - -/** - * @brief Set the complete services. - * @param [in] uuid The single service to advertise. - */ -void BLEAdvertisementData::setCompleteServices(BLEUUID uuid) { - char cdata[2]; - switch (uuid.bitSize()) { - case 16: { - // [Len] [0x02] [LL] [HH] - cdata[0] = 3; - cdata[1] = ESP_BLE_AD_TYPE_16SRV_CMPL; // 0x03 - addData(std::string(cdata, 2) + std::string((char*) &uuid.getNative()->uuid.uuid16, 2)); - break; - } - - case 32: { - // [Len] [0x04] [LL] [LL] [HH] [HH] - cdata[0] = 5; - cdata[1] = ESP_BLE_AD_TYPE_32SRV_CMPL; // 0x05 - addData(std::string(cdata, 2) + std::string((char*) &uuid.getNative()->uuid.uuid32, 4)); - break; - } - - case 128: { - // [Len] [0x04] [0] [1] ... [15] - cdata[0] = 17; - cdata[1] = ESP_BLE_AD_TYPE_128SRV_CMPL; // 0x07 - addData(std::string(cdata, 2) + std::string((char*) uuid.getNative()->uuid.uuid128, 16)); - break; - } - - default: - return; - } -} // setCompleteServices - - -/** - * @brief Set the advertisement flags. - * @param [in] The flags to be set in the advertisement. - * - * * ESP_BLE_ADV_FLAG_LIMIT_DISC - * * ESP_BLE_ADV_FLAG_GEN_DISC - * * ESP_BLE_ADV_FLAG_BREDR_NOT_SPT - * * ESP_BLE_ADV_FLAG_DMT_CONTROLLER_SPT - * * ESP_BLE_ADV_FLAG_DMT_HOST_SPT - * * ESP_BLE_ADV_FLAG_NON_LIMIT_DISC - */ -void BLEAdvertisementData::setFlags(uint8_t flag) { - char cdata[3]; - cdata[0] = 2; - cdata[1] = ESP_BLE_AD_TYPE_FLAG; // 0x01 - cdata[2] = flag; - addData(std::string(cdata, 3)); -} // setFlag - - - -/** - * @brief Set manufacturer specific data. - * @param [in] data Manufacturer data. - */ -void BLEAdvertisementData::setManufacturerData(std::string data) { - log_d("BLEAdvertisementData", ">> setManufacturerData"); - char cdata[2]; - cdata[0] = data.length() + 1; - cdata[1] = ESP_BLE_AD_MANUFACTURER_SPECIFIC_TYPE; // 0xff - addData(std::string(cdata, 2) + data); - log_d("BLEAdvertisementData", "<< setManufacturerData"); -} // setManufacturerData - - -/** - * @brief Set the name. - * @param [in] The complete name of the device. - */ -void BLEAdvertisementData::setName(std::string name) { - log_d("BLEAdvertisementData", ">> setName: %s", name.c_str()); - char cdata[2]; - cdata[0] = name.length() + 1; - cdata[1] = ESP_BLE_AD_TYPE_NAME_CMPL; // 0x09 - addData(std::string(cdata, 2) + name); - log_d("BLEAdvertisementData", "<< setName"); -} // setName - - -/** - * @brief Set the partial services. - * @param [in] uuid The single service to advertise. - */ -void BLEAdvertisementData::setPartialServices(BLEUUID uuid) { - char cdata[2]; - switch (uuid.bitSize()) { - case 16: { - // [Len] [0x02] [LL] [HH] - cdata[0] = 3; - cdata[1] = ESP_BLE_AD_TYPE_16SRV_PART; // 0x02 - addData(std::string(cdata, 2) + std::string((char *) &uuid.getNative()->uuid.uuid16, 2)); - break; - } - - case 32: { - // [Len] [0x04] [LL] [LL] [HH] [HH] - cdata[0] = 5; - cdata[1] = ESP_BLE_AD_TYPE_32SRV_PART; // 0x04 - addData(std::string(cdata, 2) + std::string((char *) &uuid.getNative()->uuid.uuid32, 4)); - break; - } - - case 128: { - // [Len] [0x04] [0] [1] ... [15] - cdata[0] = 17; - cdata[1] = ESP_BLE_AD_TYPE_128SRV_PART; // 0x06 - addData(std::string(cdata, 2) + std::string((char *) &uuid.getNative()->uuid.uuid128, 16)); - break; - } - - default: - return; - } -} // setPartialServices - - -/** - * @brief Set the service data (UUID + data) - * @param [in] uuid The UUID to set with the service data. Size of UUID will be used. - * @param [in] data The data to be associated with the service data advert. - */ -void BLEAdvertisementData::setServiceData(BLEUUID uuid, std::string data) { - char cdata[2]; - switch (uuid.bitSize()) { - case 16: { - // [Len] [0x16] [UUID16] data - cdata[0] = data.length() + 3; - cdata[1] = ESP_BLE_AD_TYPE_SERVICE_DATA; // 0x16 - addData(std::string(cdata, 2) + std::string((char*) &uuid.getNative()->uuid.uuid16, 2) + data); - break; - } - - case 32: { - // [Len] [0x20] [UUID32] data - cdata[0] = data.length() + 5; - cdata[1] = ESP_BLE_AD_TYPE_32SERVICE_DATA; // 0x20 - addData(std::string(cdata, 2) + std::string((char*) &uuid.getNative()->uuid.uuid32, 4) + data); - break; - } - - case 128: { - // [Len] [0x21] [UUID128] data - cdata[0] = data.length() + 17; - cdata[1] = ESP_BLE_AD_TYPE_128SERVICE_DATA; // 0x21 - addData(std::string(cdata, 2) + std::string((char*) &uuid.getNative()->uuid.uuid128, 16) + data); - break; - } - - default: - return; - } -} // setServiceData - - -/** - * @brief Set the short name. - * @param [in] The short name of the device. - */ -void BLEAdvertisementData::setShortName(std::string name) { - log_d("BLEAdvertisementData", ">> setShortName: %s", name.c_str()); - char cdata[2]; - cdata[0] = name.length() + 1; - cdata[1] = ESP_BLE_AD_TYPE_NAME_SHORT; // 0x08 - addData(std::string(cdata, 2) + name); - log_d("BLEAdvertisementData", "<< setShortName"); -} // setShortName - - -/** - * @brief Retrieve the payload that is to be advertised. - * @return The payload that is to be advertised. - */ -std::string BLEAdvertisementData::getPayload() { - return m_payload; -} // getPayload - -void BLEAdvertising::handleGAPEvent( - esp_gap_ble_cb_event_t event, - esp_ble_gap_cb_param_t* param) { - - log_d("handleGAPEvent [event no: %d]", (int)event); - - switch(event) { - case ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT: { - // m_semaphoreSetAdv.give(); - break; - } - case ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT: { - // m_semaphoreSetAdv.give(); - break; - } - case ESP_GAP_BLE_ADV_START_COMPLETE_EVT: { - // m_semaphoreSetAdv.give(); - break; - } - case ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT: { - log_i("STOP advertising"); - //start(); - break; - } - default: - break; - } -} - - -#endif /* CONFIG_BT_ENABLED */ diff --git a/libraries/BLE/src/BLEAdvertising.h b/libraries/BLE/src/BLEAdvertising.h deleted file mode 100644 index be85371ec64..00000000000 --- a/libraries/BLE/src/BLEAdvertising.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * BLEAdvertising.h - * - * Created on: Jun 21, 2017 - * Author: kolban - */ - -#ifndef COMPONENTS_CPP_UTILS_BLEADVERTISING_H_ -#define COMPONENTS_CPP_UTILS_BLEADVERTISING_H_ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include -#include "BLEUUID.h" -#include -#include "FreeRTOS.h" - -/** - * @brief Advertisement data set by the programmer to be published by the %BLE server. - */ -class BLEAdvertisementData { - // Only a subset of the possible BLE architected advertisement fields are currently exposed. Others will - // be exposed on demand/request or as time permits. - // -public: - void setAppearance(uint16_t appearance); - void setCompleteServices(BLEUUID uuid); - void setFlags(uint8_t); - void setManufacturerData(std::string data); - void setName(std::string name); - void setPartialServices(BLEUUID uuid); - void setServiceData(BLEUUID uuid, std::string data); - void setShortName(std::string name); - void addData(std::string data); // Add data to the payload. - std::string getPayload(); // Retrieve the current advert payload. - -private: - friend class BLEAdvertising; - std::string m_payload; // The payload of the advertisement. -}; // BLEAdvertisementData - - -/** - * @brief Perform and manage %BLE advertising. - * - * A %BLE server will want to perform advertising in order to make itself known to %BLE clients. - */ -class BLEAdvertising { -public: - BLEAdvertising(); - void addServiceUUID(BLEUUID serviceUUID); - void addServiceUUID(const char* serviceUUID); - void start(); - void stop(); - void setAppearance(uint16_t appearance); - void setMaxInterval(uint16_t maxinterval); - void setMinInterval(uint16_t mininterval); - void setAdvertisementData(BLEAdvertisementData& advertisementData); - void setScanFilter(bool scanRequertWhitelistOnly, bool connectWhitelistOnly); - void setScanResponseData(BLEAdvertisementData& advertisementData); - void setPrivateAddress(esp_ble_addr_type_t type = BLE_ADDR_TYPE_RANDOM); - void setDeviceAddress(esp_bd_addr_t addr, esp_ble_addr_type_t type = BLE_ADDR_TYPE_RANDOM); - - void handleGAPEvent(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t* param); - void setMinPreferred(uint16_t); - void setMaxPreferred(uint16_t); - void setScanResponse(bool); - -private: - esp_ble_adv_data_t m_advData; - esp_ble_adv_params_t m_advParams; - std::vector m_serviceUUIDs; - bool m_customAdvData = false; // Are we using custom advertising data? - bool m_customScanResponseData = false; // Are we using custom scan response data? - FreeRTOS::Semaphore m_semaphoreSetAdv = FreeRTOS::Semaphore("startAdvert"); - bool m_scanResp = true; - -}; -#endif /* CONFIG_BT_ENABLED */ -#endif /* COMPONENTS_CPP_UTILS_BLEADVERTISING_H_ */ \ No newline at end of file diff --git a/libraries/BLE/src/BLEBeacon.cpp b/libraries/BLE/src/BLEBeacon.cpp deleted file mode 100644 index 1056cd54b04..00000000000 --- a/libraries/BLE/src/BLEBeacon.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - * BLEBeacon.cpp - * - * Created on: Jan 4, 2018 - * Author: kolban - */ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include -#include "BLEBeacon.h" -#include "esp32-hal-log.h" - -#define ENDIAN_CHANGE_U16(x) ((((x)&0xFF00)>>8) + (((x)&0xFF)<<8)) - - -BLEBeacon::BLEBeacon() { - m_beaconData.manufacturerId = 0x4c00; - m_beaconData.subType = 0x02; - m_beaconData.subTypeLength = 0x15; - m_beaconData.major = 0; - m_beaconData.minor = 0; - m_beaconData.signalPower = 0; - memset(m_beaconData.proximityUUID, 0, sizeof(m_beaconData.proximityUUID)); -} // BLEBeacon - -std::string BLEBeacon::getData() { - return std::string((char*) &m_beaconData, sizeof(m_beaconData)); -} // getData - -uint16_t BLEBeacon::getMajor() { - return m_beaconData.major; -} - -uint16_t BLEBeacon::getManufacturerId() { - return m_beaconData.manufacturerId; -} - -uint16_t BLEBeacon::getMinor() { - return m_beaconData.minor; -} - -BLEUUID BLEBeacon::getProximityUUID() { - return BLEUUID(m_beaconData.proximityUUID, 16, false); -} - -int8_t BLEBeacon::getSignalPower() { - return m_beaconData.signalPower; -} - -/** - * Set the raw data for the beacon record. - */ -void BLEBeacon::setData(std::string data) { - if (data.length() != sizeof(m_beaconData)) { - log_e("Unable to set the data ... length passed in was %d and expected %d", data.length(), sizeof(m_beaconData)); - return; - } - memcpy(&m_beaconData, data.data(), sizeof(m_beaconData)); -} // setData - -void BLEBeacon::setMajor(uint16_t major) { - m_beaconData.major = ENDIAN_CHANGE_U16(major); -} // setMajor - -void BLEBeacon::setManufacturerId(uint16_t manufacturerId) { - m_beaconData.manufacturerId = ENDIAN_CHANGE_U16(manufacturerId); -} // setManufacturerId - -void BLEBeacon::setMinor(uint16_t minor) { - m_beaconData.minor = ENDIAN_CHANGE_U16(minor); -} // setMinior - -void BLEBeacon::setProximityUUID(BLEUUID uuid) { - uuid = uuid.to128(); - memcpy(m_beaconData.proximityUUID, uuid.getNative()->uuid.uuid128, 16); -} // setProximityUUID - -void BLEBeacon::setSignalPower(int8_t signalPower) { - m_beaconData.signalPower = signalPower; -} // setSignalPower - - -#endif diff --git a/libraries/BLE/src/BLEBeacon.h b/libraries/BLE/src/BLEBeacon.h deleted file mode 100644 index 277bd670776..00000000000 --- a/libraries/BLE/src/BLEBeacon.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * BLEBeacon2.h - * - * Created on: Jan 4, 2018 - * Author: kolban - */ - -#ifndef COMPONENTS_CPP_UTILS_BLEBEACON_H_ -#define COMPONENTS_CPP_UTILS_BLEBEACON_H_ -#include "BLEUUID.h" -/** - * @brief Representation of a beacon. - * See: - * * https://en.wikipedia.org/wiki/IBeacon - */ -class BLEBeacon { -private: - struct { - uint16_t manufacturerId; - uint8_t subType; - uint8_t subTypeLength; - uint8_t proximityUUID[16]; - uint16_t major; - uint16_t minor; - int8_t signalPower; - } __attribute__((packed)) m_beaconData; -public: - BLEBeacon(); - std::string getData(); - uint16_t getMajor(); - uint16_t getMinor(); - uint16_t getManufacturerId(); - BLEUUID getProximityUUID(); - int8_t getSignalPower(); - void setData(std::string data); - void setMajor(uint16_t major); - void setMinor(uint16_t minor); - void setManufacturerId(uint16_t manufacturerId); - void setProximityUUID(BLEUUID uuid); - void setSignalPower(int8_t signalPower); -}; // BLEBeacon - -#endif /* COMPONENTS_CPP_UTILS_BLEBEACON_H_ */ diff --git a/libraries/BLE/src/BLECharacteristic.cpp b/libraries/BLE/src/BLECharacteristic.cpp deleted file mode 100644 index 25146136184..00000000000 --- a/libraries/BLE/src/BLECharacteristic.cpp +++ /dev/null @@ -1,799 +0,0 @@ -/* - * BLECharacteristic.cpp - * - * Created on: Jun 22, 2017 - * Author: kolban - */ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include -#include -#include -#include -#include "sdkconfig.h" -#include -#include "BLECharacteristic.h" -#include "BLEService.h" -#include "BLEDevice.h" -#include "BLEUtils.h" -#include "BLE2902.h" -#include "GeneralUtils.h" -#include "esp32-hal-log.h" - -#define NULL_HANDLE (0xffff) - -static BLECharacteristicCallbacks defaultCallback; //null-object-pattern - -/** - * @brief Construct a characteristic - * @param [in] uuid - UUID (const char*) for the characteristic. - * @param [in] properties - Properties for the characteristic. - */ -BLECharacteristic::BLECharacteristic(const char* uuid, uint32_t properties) : BLECharacteristic(BLEUUID(uuid), properties) { -} - -/** - * @brief Construct a characteristic - * @param [in] uuid - UUID for the characteristic. - * @param [in] properties - Properties for the characteristic. - */ -BLECharacteristic::BLECharacteristic(BLEUUID uuid, uint32_t properties) { - m_bleUUID = uuid; - m_handle = NULL_HANDLE; - m_properties = (esp_gatt_char_prop_t)0; - m_pCallbacks = &defaultCallback; - - setBroadcastProperty((properties & PROPERTY_BROADCAST) != 0); - setReadProperty((properties & PROPERTY_READ) != 0); - setWriteProperty((properties & PROPERTY_WRITE) != 0); - setNotifyProperty((properties & PROPERTY_NOTIFY) != 0); - setIndicateProperty((properties & PROPERTY_INDICATE) != 0); - setWriteNoResponseProperty((properties & PROPERTY_WRITE_NR) != 0); -} // BLECharacteristic - -/** - * @brief Destructor. - */ -BLECharacteristic::~BLECharacteristic() { - //free(m_value.attr_value); // Release the storage for the value. -} // ~BLECharacteristic - - -/** - * @brief Associate a descriptor with this characteristic. - * @param [in] pDescriptor - * @return N/A. - */ -void BLECharacteristic::addDescriptor(BLEDescriptor* pDescriptor) { - log_v(">> addDescriptor(): Adding %s to %s", pDescriptor->toString().c_str(), toString().c_str()); - m_descriptorMap.setByUUID(pDescriptor->getUUID(), pDescriptor); - log_v("<< addDescriptor()"); -} // addDescriptor - - -/** - * @brief Register a new characteristic with the ESP runtime. - * @param [in] pService The service with which to associate this characteristic. - */ -void BLECharacteristic::executeCreate(BLEService* pService) { - log_v(">> executeCreate()"); - - if (m_handle != NULL_HANDLE) { - log_e("Characteristic already has a handle."); - return; - } - - m_pService = pService; // Save the service to which this characteristic belongs. - - log_d("Registering characteristic (esp_ble_gatts_add_char): uuid: %s, service: %s", - getUUID().toString().c_str(), - m_pService->toString().c_str()); - - esp_attr_control_t control; - control.auto_rsp = ESP_GATT_RSP_BY_APP; - - m_semaphoreCreateEvt.take("executeCreate"); - esp_err_t errRc = ::esp_ble_gatts_add_char( - m_pService->getHandle(), - getUUID().getNative(), - static_cast(m_permissions), - getProperties(), - nullptr, - &control); // Whether to auto respond or not. - - if (errRc != ESP_OK) { - log_e("<< esp_ble_gatts_add_char: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; - } - m_semaphoreCreateEvt.wait("executeCreate"); - - BLEDescriptor* pDescriptor = m_descriptorMap.getFirst(); - while (pDescriptor != nullptr) { - pDescriptor->executeCreate(this); - pDescriptor = m_descriptorMap.getNext(); - } // End while - - log_v("<< executeCreate"); -} // executeCreate - - -/** - * @brief Return the BLE Descriptor for the given UUID if associated with this characteristic. - * @param [in] descriptorUUID The UUID of the descriptor that we wish to retrieve. - * @return The BLE Descriptor. If no such descriptor is associated with the characteristic, nullptr is returned. - */ -BLEDescriptor* BLECharacteristic::getDescriptorByUUID(const char* descriptorUUID) { - return m_descriptorMap.getByUUID(BLEUUID(descriptorUUID)); -} // getDescriptorByUUID - - -/** - * @brief Return the BLE Descriptor for the given UUID if associated with this characteristic. - * @param [in] descriptorUUID The UUID of the descriptor that we wish to retrieve. - * @return The BLE Descriptor. If no such descriptor is associated with the characteristic, nullptr is returned. - */ -BLEDescriptor* BLECharacteristic::getDescriptorByUUID(BLEUUID descriptorUUID) { - return m_descriptorMap.getByUUID(descriptorUUID); -} // getDescriptorByUUID - - -/** - * @brief Get the handle of the characteristic. - * @return The handle of the characteristic. - */ -uint16_t BLECharacteristic::getHandle() { - return m_handle; -} // getHandle - -void BLECharacteristic::setAccessPermissions(esp_gatt_perm_t perm) { - m_permissions = perm; -} - -esp_gatt_char_prop_t BLECharacteristic::getProperties() { - return m_properties; -} // getProperties - - -/** - * @brief Get the service associated with this characteristic. - */ -BLEService* BLECharacteristic::getService() { - return m_pService; -} // getService - - -/** - * @brief Get the UUID of the characteristic. - * @return The UUID of the characteristic. - */ -BLEUUID BLECharacteristic::getUUID() { - return m_bleUUID; -} // getUUID - - -/** - * @brief Retrieve the current value of the characteristic. - * @return A pointer to storage containing the current characteristic value. - */ -std::string BLECharacteristic::getValue() { - return m_value.getValue(); -} // getValue - -/** - * @brief Retrieve the current raw data of the characteristic. - * @return A pointer to storage containing the current characteristic data. - */ -uint8_t* BLECharacteristic::getData() { - return m_value.getData(); -} // getData - - -/** - * Handle a GATT server event. - */ -void BLECharacteristic::handleGATTServerEvent( - esp_gatts_cb_event_t event, - esp_gatt_if_t gatts_if, - esp_ble_gatts_cb_param_t* param) { - log_v(">> handleGATTServerEvent: %s", BLEUtils::gattServerEventTypeToString(event).c_str()); - - switch(event) { - // Events handled: - // - // ESP_GATTS_ADD_CHAR_EVT - // ESP_GATTS_CONF_EVT - // ESP_GATTS_CONNECT_EVT - // ESP_GATTS_DISCONNECT_EVT - // ESP_GATTS_EXEC_WRITE_EVT - // ESP_GATTS_READ_EVT - // ESP_GATTS_WRITE_EVT - - // - // ESP_GATTS_EXEC_WRITE_EVT - // When we receive this event it is an indication that a previous write long needs to be committed. - // - // exec_write: - // - uint16_t conn_id - // - uint32_t trans_id - // - esp_bd_addr_t bda - // - uint8_t exec_write_flag - Either ESP_GATT_PREP_WRITE_EXEC or ESP_GATT_PREP_WRITE_CANCEL - // - case ESP_GATTS_EXEC_WRITE_EVT: { - if (param->exec_write.exec_write_flag == ESP_GATT_PREP_WRITE_EXEC) { - m_value.commit(); - m_pCallbacks->onWrite(this); // Invoke the onWrite callback handler. - } else { - m_value.cancel(); - } -// ??? - esp_err_t errRc = ::esp_ble_gatts_send_response( - gatts_if, - param->write.conn_id, - param->write.trans_id, ESP_GATT_OK, nullptr); - if (errRc != ESP_OK) { - log_e("esp_ble_gatts_send_response: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - } - break; - } // ESP_GATTS_EXEC_WRITE_EVT - - - // ESP_GATTS_ADD_CHAR_EVT - Indicate that a characteristic was added to the service. - // add_char: - // - esp_gatt_status_t status - // - uint16_t attr_handle - // - uint16_t service_handle - // - esp_bt_uuid_t char_uuid - case ESP_GATTS_ADD_CHAR_EVT: { - if (getHandle() == param->add_char.attr_handle) { - // we have created characteristic, now we can create descriptors - // BLEDescriptor* pDescriptor = m_descriptorMap.getFirst(); - // while (pDescriptor != nullptr) { - // pDescriptor->executeCreate(this); - // pDescriptor = m_descriptorMap.getNext(); - // } // End while - m_semaphoreCreateEvt.give(); - } - break; - } // ESP_GATTS_ADD_CHAR_EVT - - - // ESP_GATTS_WRITE_EVT - A request to write the value of a characteristic has arrived. - // - // write: - // - uint16_t conn_id - // - uint16_t trans_id - // - esp_bd_addr_t bda - // - uint16_t handle - // - uint16_t offset - // - bool need_rsp - // - bool is_prep - // - uint16_t len - // - uint8_t *value - // - case ESP_GATTS_WRITE_EVT: { -// We check if this write request is for us by comparing the handles in the event. If it is for us -// we save the new value. Next we look at the need_rsp flag which indicates whether or not we need -// to send a response. If we do, then we formulate a response and send it. - if (param->write.handle == m_handle) { - if (param->write.is_prep) { - m_value.addPart(param->write.value, param->write.len); - } else { - setValue(param->write.value, param->write.len); - } - - log_d(" - Response to write event: New value: handle: %.2x, uuid: %s", - getHandle(), getUUID().toString().c_str()); - - char* pHexData = BLEUtils::buildHexData(nullptr, param->write.value, param->write.len); - log_d(" - Data: length: %d, data: %s", param->write.len, pHexData); - free(pHexData); - - if (param->write.need_rsp) { - esp_gatt_rsp_t rsp; - - rsp.attr_value.len = param->write.len; - rsp.attr_value.handle = m_handle; - rsp.attr_value.offset = param->write.offset; - rsp.attr_value.auth_req = ESP_GATT_AUTH_REQ_NONE; - memcpy(rsp.attr_value.value, param->write.value, param->write.len); - - esp_err_t errRc = ::esp_ble_gatts_send_response( - gatts_if, - param->write.conn_id, - param->write.trans_id, ESP_GATT_OK, &rsp); - if (errRc != ESP_OK) { - log_e("esp_ble_gatts_send_response: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - } - } // Response needed - - if (param->write.is_prep != true) { - m_pCallbacks->onWrite(this); // Invoke the onWrite callback handler. - } - } // Match on handles. - break; - } // ESP_GATTS_WRITE_EVT - - - // ESP_GATTS_READ_EVT - A request to read the value of a characteristic has arrived. - // - // read: - // - uint16_t conn_id - // - uint32_t trans_id - // - esp_bd_addr_t bda - // - uint16_t handle - // - uint16_t offset - // - bool is_long - // - bool need_rsp - // - case ESP_GATTS_READ_EVT: { - if (param->read.handle == m_handle) { - - - -// Here's an interesting thing. The read request has the option of saying whether we need a response -// or not. What would it "mean" to receive a read request and NOT send a response back? That feels like -// a very strange read. -// -// We have to handle the case where the data we wish to send back to the client is greater than the maximum -// packet size of 22 bytes. In this case, we become responsible for chunking the data into units of 22 bytes. -// The apparent algorithm is as follows: -// -// If the is_long flag is set then this is a follow on from an original read and we will already have sent at least 22 bytes. -// If the is_long flag is not set then we need to check how much data we are going to send. If we are sending LESS than -// 22 bytes, then we "just" send it and thats the end of the story. -// If we are sending 22 bytes exactly, we just send it BUT we will get a follow on request. -// If we are sending more than 22 bytes, we send the first 22 bytes and we will get a follow on request. -// Because of follow on request processing, we need to maintain an offset of how much data we have already sent -// so that when a follow on request arrives, we know where to start in the data to send the next sequence. -// Note that the indication that the client will send a follow on request is that we sent exactly 22 bytes as a response. -// If our payload is divisible by 22 then the last response will be a response of 0 bytes in length. -// -// The following code has deliberately not been factored to make it fewer statements because this would cloud the -// the logic flow comprehension. -// - - // get mtu for peer device that we are sending read request to - uint16_t maxOffset = getService()->getServer()->getPeerMTU(param->read.conn_id) - 1; - log_d("mtu value: %d", maxOffset); - if (param->read.need_rsp) { - log_d("Sending a response (esp_ble_gatts_send_response)"); - esp_gatt_rsp_t rsp; - - if (param->read.is_long) { - std::string value = m_value.getValue(); - - if (value.length() - m_value.getReadOffset() < maxOffset) { - // This is the last in the chain - rsp.attr_value.len = value.length() - m_value.getReadOffset(); - rsp.attr_value.offset = m_value.getReadOffset(); - memcpy(rsp.attr_value.value, value.data() + rsp.attr_value.offset, rsp.attr_value.len); - m_value.setReadOffset(0); - } else { - // There will be more to come. - rsp.attr_value.len = maxOffset; - rsp.attr_value.offset = m_value.getReadOffset(); - memcpy(rsp.attr_value.value, value.data() + rsp.attr_value.offset, rsp.attr_value.len); - m_value.setReadOffset(rsp.attr_value.offset + maxOffset); - } - } else { // read.is_long == false - - // If is.long is false then this is the first (or only) request to read data, so invoke the callback - // Invoke the read callback. - m_pCallbacks->onRead(this); - - std::string value = m_value.getValue(); - - if (value.length() + 1 > maxOffset) { - // Too big for a single shot entry. - m_value.setReadOffset(maxOffset); - rsp.attr_value.len = maxOffset; - rsp.attr_value.offset = 0; - memcpy(rsp.attr_value.value, value.data(), rsp.attr_value.len); - } else { - // Will fit in a single packet with no callbacks required. - rsp.attr_value.len = value.length(); - rsp.attr_value.offset = 0; - memcpy(rsp.attr_value.value, value.data(), rsp.attr_value.len); - } - } - rsp.attr_value.handle = param->read.handle; - rsp.attr_value.auth_req = ESP_GATT_AUTH_REQ_NONE; - - char *pHexData = BLEUtils::buildHexData(nullptr, rsp.attr_value.value, rsp.attr_value.len); - log_d(" - Data: length=%d, data=%s, offset=%d", rsp.attr_value.len, pHexData, rsp.attr_value.offset); - free(pHexData); - - esp_err_t errRc = ::esp_ble_gatts_send_response( - gatts_if, param->read.conn_id, - param->read.trans_id, - ESP_GATT_OK, - &rsp); - if (errRc != ESP_OK) { - log_e("esp_ble_gatts_send_response: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - } - } // Response needed - } // Handle matches this characteristic. - break; - } // ESP_GATTS_READ_EVT - - - // ESP_GATTS_CONF_EVT - // - // conf: - // - esp_gatt_status_t status – The status code. - // - uint16_t conn_id – The connection used. - // - case ESP_GATTS_CONF_EVT: { - // log_d("m_handle = %d, conf->handle = %d", m_handle, param->conf.handle); - if(param->conf.conn_id == getService()->getServer()->getConnId()) // && param->conf.handle == m_handle) // bug in esp-idf and not implemented in arduino yet - m_semaphoreConfEvt.give(param->conf.status); - break; - } - - case ESP_GATTS_CONNECT_EVT: { - break; - } - - case ESP_GATTS_DISCONNECT_EVT: { - m_semaphoreConfEvt.give(); - break; - } - - default: { - break; - } // default - - } // switch event - - // Give each of the descriptors associated with this characteristic the opportunity to handle the - // event. - - m_descriptorMap.handleGATTServerEvent(event, gatts_if, param); - log_v("<< handleGATTServerEvent"); -} // handleGATTServerEvent - - -/** - * @brief Send an indication. - * An indication is a transmission of up to the first 20 bytes of the characteristic value. An indication - * will block waiting a positive confirmation from the client. - * @return N/A - */ -void BLECharacteristic::indicate() { - - log_v(">> indicate: length: %d", m_value.getValue().length()); - notify(false); - log_v("<< indicate"); -} // indicate - - -/** - * @brief Send a notify. - * A notification is a transmission of up to the first 20 bytes of the characteristic value. An notification - * will not block; it is a fire and forget. - * @return N/A. - */ -void BLECharacteristic::notify(bool is_notification) { - log_v(">> notify: length: %d", m_value.getValue().length()); - - assert(getService() != nullptr); - assert(getService()->getServer() != nullptr); - - m_pCallbacks->onNotify(this); // Invoke the notify callback. - - GeneralUtils::hexDump((uint8_t*)m_value.getValue().data(), m_value.getValue().length()); - - if (getService()->getServer()->getConnectedCount() == 0) { - log_v("<< notify: No connected clients."); - m_pCallbacks->onStatus(this, BLECharacteristicCallbacks::Status::ERROR_NO_CLIENT, 0); - return; - } - - // Test to see if we have a 0x2902 descriptor. If we do, then check to see if notification is enabled - // and, if not, prevent the notification. - - BLE2902 *p2902 = (BLE2902*)getDescriptorByUUID((uint16_t)0x2902); - if(is_notification) { - if (p2902 != nullptr && !p2902->getNotifications()) { - log_v("<< notifications disabled; ignoring"); - m_pCallbacks->onStatus(this, BLECharacteristicCallbacks::Status::ERROR_NOTIFY_DISABLED, 0); // Invoke the notify callback. - return; - } - } - else{ - if (p2902 != nullptr && !p2902->getIndications()) { - log_v("<< indications disabled; ignoring"); - m_pCallbacks->onStatus(this, BLECharacteristicCallbacks::Status::ERROR_INDICATE_DISABLED, 0); // Invoke the notify callback. - return; - } - } - for (auto &myPair : getService()->getServer()->getPeerDevices(false)) { - uint16_t _mtu = (myPair.second.mtu); - if (m_value.getValue().length() > _mtu - 3) { - log_w("- Truncating to %d bytes (maximum notify size)", _mtu - 3); - } - - size_t length = m_value.getValue().length(); - if(!is_notification) // is indication - m_semaphoreConfEvt.take("indicate"); - esp_err_t errRc = ::esp_ble_gatts_send_indicate( - getService()->getServer()->getGattsIf(), - myPair.first, - getHandle(), length, (uint8_t*)m_value.getValue().data(), !is_notification); // The need_confirm = false makes this a notify. - if (errRc != ESP_OK) { - log_e("<< esp_ble_gatts_send_ %s: rc=%d %s",is_notification?"notify":"indicate", errRc, GeneralUtils::errorToString(errRc)); - m_semaphoreConfEvt.give(); - m_pCallbacks->onStatus(this, BLECharacteristicCallbacks::Status::ERROR_GATT, errRc); // Invoke the notify callback. - return; - } - if(!is_notification){ // is indication - if(!m_semaphoreConfEvt.timedWait("indicate", indicationTimeout)){ - m_pCallbacks->onStatus(this, BLECharacteristicCallbacks::Status::ERROR_INDICATE_TIMEOUT, 0); // Invoke the notify callback. - } else { - auto code = (esp_gatt_status_t) m_semaphoreConfEvt.value(); - if(code == ESP_GATT_OK) { - m_pCallbacks->onStatus(this, BLECharacteristicCallbacks::Status::SUCCESS_INDICATE, code); // Invoke the notify callback. - } else { - m_pCallbacks->onStatus(this, BLECharacteristicCallbacks::Status::ERROR_INDICATE_FAILURE, code); - } - } - } else { - m_pCallbacks->onStatus(this, BLECharacteristicCallbacks::Status::SUCCESS_NOTIFY, 0); // Invoke the notify callback. - } - } - log_v("<< notify"); -} // Notify - - -/** - * @brief Set the permission to broadcast. - * A characteristics has properties associated with it which define what it is capable of doing. - * One of these is the broadcast flag. - * @param [in] value The flag value of the property. - * @return N/A - */ -void BLECharacteristic::setBroadcastProperty(bool value) { - //log_d("setBroadcastProperty(%d)", value); - if (value) { - m_properties = (esp_gatt_char_prop_t)(m_properties | ESP_GATT_CHAR_PROP_BIT_BROADCAST); - } else { - m_properties = (esp_gatt_char_prop_t)(m_properties & ~ESP_GATT_CHAR_PROP_BIT_BROADCAST); - } -} // setBroadcastProperty - - -/** - * @brief Set the callback handlers for this characteristic. - * @param [in] pCallbacks An instance of a callbacks structure used to define any callbacks for the characteristic. - */ -void BLECharacteristic::setCallbacks(BLECharacteristicCallbacks* pCallbacks) { - log_v(">> setCallbacks: 0x%x", (uint32_t)pCallbacks); - if (pCallbacks != nullptr){ - m_pCallbacks = pCallbacks; - } else { - m_pCallbacks = &defaultCallback; - } - log_v("<< setCallbacks"); -} // setCallbacks - - -/** - * @brief Set the BLE handle associated with this characteristic. - * A user program will request that a characteristic be created against a service. When the characteristic has been - * registered, the service will be given a "handle" that it knows the characteristic as. This handle is unique to the - * server/service but it is told to the service, not the characteristic associated with the service. This internally - * exposed function can be invoked by the service against this model of the characteristic to allow the characteristic - * to learn its own handle. Once the characteristic knows its own handle, it will be able to see incoming GATT events - * that will be propagated down to it which contain a handle value and now know that the event is destined for it. - * @param [in] handle The handle associated with this characteristic. - */ -void BLECharacteristic::setHandle(uint16_t handle) { - log_v(">> setHandle: handle=0x%.2x, characteristic uuid=%s", handle, getUUID().toString().c_str()); - m_handle = handle; - log_v("<< setHandle"); -} // setHandle - - -/** - * @brief Set the Indicate property value. - * @param [in] value Set to true if we are to allow indicate messages. - */ -void BLECharacteristic::setIndicateProperty(bool value) { - //log_d("setIndicateProperty(%d)", value); - if (value) { - m_properties = (esp_gatt_char_prop_t)(m_properties | ESP_GATT_CHAR_PROP_BIT_INDICATE); - } else { - m_properties = (esp_gatt_char_prop_t)(m_properties & ~ESP_GATT_CHAR_PROP_BIT_INDICATE); - } -} // setIndicateProperty - - -/** - * @brief Set the Notify property value. - * @param [in] value Set to true if we are to allow notification messages. - */ -void BLECharacteristic::setNotifyProperty(bool value) { - //log_d("setNotifyProperty(%d)", value); - if (value) { - m_properties = (esp_gatt_char_prop_t)(m_properties | ESP_GATT_CHAR_PROP_BIT_NOTIFY); - } else { - m_properties = (esp_gatt_char_prop_t)(m_properties & ~ESP_GATT_CHAR_PROP_BIT_NOTIFY); - } -} // setNotifyProperty - - -/** - * @brief Set the Read property value. - * @param [in] value Set to true if we are to allow reads. - */ -void BLECharacteristic::setReadProperty(bool value) { - //log_d("setReadProperty(%d)", value); - if (value) { - m_properties = (esp_gatt_char_prop_t)(m_properties | ESP_GATT_CHAR_PROP_BIT_READ); - } else { - m_properties = (esp_gatt_char_prop_t)(m_properties & ~ESP_GATT_CHAR_PROP_BIT_READ); - } -} // setReadProperty - - -/** - * @brief Set the value of the characteristic. - * @param [in] data The data to set for the characteristic. - * @param [in] length The length of the data in bytes. - */ -void BLECharacteristic::setValue(uint8_t* data, size_t length) { - char* pHex = BLEUtils::buildHexData(nullptr, data, length); - log_v(">> setValue: length=%d, data=%s, characteristic UUID=%s", length, pHex, getUUID().toString().c_str()); - free(pHex); - if (length > ESP_GATT_MAX_ATTR_LEN) { - log_e("Size %d too large, must be no bigger than %d", length, ESP_GATT_MAX_ATTR_LEN); - return; - } - m_semaphoreSetValue.take(); - m_value.setValue(data, length); - m_semaphoreSetValue.give(); - log_v("<< setValue"); -} // setValue - - -/** - * @brief Set the value of the characteristic from string data. - * We set the value of the characteristic from the bytes contained in the - * string. - * @param [in] Set the value of the characteristic. - * @return N/A. - */ -void BLECharacteristic::setValue(std::string value) { - setValue((uint8_t*)(value.data()), value.length()); -} // setValue - -void BLECharacteristic::setValue(uint16_t& data16) { - uint8_t temp[2]; - temp[0] = data16; - temp[1] = data16 >> 8; - setValue(temp, 2); -} // setValue - -void BLECharacteristic::setValue(uint32_t& data32) { - uint8_t temp[4]; - temp[0] = data32; - temp[1] = data32 >> 8; - temp[2] = data32 >> 16; - temp[3] = data32 >> 24; - setValue(temp, 4); -} // setValue - -void BLECharacteristic::setValue(int& data32) { - uint8_t temp[4]; - temp[0] = data32; - temp[1] = data32 >> 8; - temp[2] = data32 >> 16; - temp[3] = data32 >> 24; - setValue(temp, 4); -} // setValue - -void BLECharacteristic::setValue(float& data32) { - float temp = data32; - setValue((uint8_t*)&temp, 4); -} // setValue - -void BLECharacteristic::setValue(double& data64) { - double temp = data64; - setValue((uint8_t*)&temp, 8); -} // setValue - - -/** - * @brief Set the Write No Response property value. - * @param [in] value Set to true if we are to allow writes with no response. - */ -void BLECharacteristic::setWriteNoResponseProperty(bool value) { - //log_d("setWriteNoResponseProperty(%d)", value); - if (value) { - m_properties = (esp_gatt_char_prop_t)(m_properties | ESP_GATT_CHAR_PROP_BIT_WRITE_NR); - } else { - m_properties = (esp_gatt_char_prop_t)(m_properties & ~ESP_GATT_CHAR_PROP_BIT_WRITE_NR); - } -} // setWriteNoResponseProperty - - -/** - * @brief Set the Write property value. - * @param [in] value Set to true if we are to allow writes. - */ -void BLECharacteristic::setWriteProperty(bool value) { - //log_d("setWriteProperty(%d)", value); - if (value) { - m_properties = (esp_gatt_char_prop_t)(m_properties | ESP_GATT_CHAR_PROP_BIT_WRITE); - } else { - m_properties = (esp_gatt_char_prop_t)(m_properties & ~ESP_GATT_CHAR_PROP_BIT_WRITE); - } -} // setWriteProperty - - -/** - * @brief Return a string representation of the characteristic. - * @return A string representation of the characteristic. - */ -std::string BLECharacteristic::toString() { - std::string res = "UUID: " + m_bleUUID.toString() + ", handle : 0x"; - char hex[5]; - snprintf(hex, sizeof(hex), "%04x", m_handle); - res += hex; - res += " "; - if (m_properties & ESP_GATT_CHAR_PROP_BIT_READ) res += "Read "; - if (m_properties & ESP_GATT_CHAR_PROP_BIT_WRITE) res += "Write "; - if (m_properties & ESP_GATT_CHAR_PROP_BIT_WRITE_NR) res += "WriteNoResponse "; - if (m_properties & ESP_GATT_CHAR_PROP_BIT_BROADCAST) res += "Broadcast "; - if (m_properties & ESP_GATT_CHAR_PROP_BIT_NOTIFY) res += "Notify "; - if (m_properties & ESP_GATT_CHAR_PROP_BIT_INDICATE) res += "Indicate "; - return res; -} // toString - - -BLECharacteristicCallbacks::~BLECharacteristicCallbacks() {} - - -/** - * @brief Callback function to support a read request. - * @param [in] pCharacteristic The characteristic that is the source of the event. - */ -void BLECharacteristicCallbacks::onRead(BLECharacteristic* pCharacteristic) { - log_d("BLECharacteristicCallbacks", ">> onRead: default"); - log_d("BLECharacteristicCallbacks", "<< onRead"); -} // onRead - - -/** - * @brief Callback function to support a write request. - * @param [in] pCharacteristic The characteristic that is the source of the event. - */ -void BLECharacteristicCallbacks::onWrite(BLECharacteristic* pCharacteristic) { - log_d("BLECharacteristicCallbacks", ">> onWrite: default"); - log_d("BLECharacteristicCallbacks", "<< onWrite"); -} // onWrite - - -/** - * @brief Callback function to support a Notify request. - * @param [in] pCharacteristic The characteristic that is the source of the event. - */ -void BLECharacteristicCallbacks::onNotify(BLECharacteristic* pCharacteristic) { - log_d("BLECharacteristicCallbacks", ">> onNotify: default"); - log_d("BLECharacteristicCallbacks", "<< onNotify"); -} // onNotify - - -/** - * @brief Callback function to support a Notify/Indicate Status report. - * @param [in] pCharacteristic The characteristic that is the source of the event. - * @param [in] s Status of the notification/indication - * @param [in] code Additional code of underlying errors - */ -void BLECharacteristicCallbacks::onStatus(BLECharacteristic* pCharacteristic, Status s, uint32_t code) { - log_d("BLECharacteristicCallbacks", ">> onStatus: default"); - log_d("BLECharacteristicCallbacks", "<< onStatus"); -} // onStatus - - -#endif /* CONFIG_BT_ENABLED */ diff --git a/libraries/BLE/src/BLECharacteristic.h b/libraries/BLE/src/BLECharacteristic.h deleted file mode 100644 index adec9587ee0..00000000000 --- a/libraries/BLE/src/BLECharacteristic.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - * BLECharacteristic.h - * - * Created on: Jun 22, 2017 - * Author: kolban - */ - -#ifndef COMPONENTS_CPP_UTILS_BLECHARACTERISTIC_H_ -#define COMPONENTS_CPP_UTILS_BLECHARACTERISTIC_H_ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include -#include -#include "BLEUUID.h" -#include -#include -#include "BLEDescriptor.h" -#include "BLEValue.h" -#include "FreeRTOS.h" - -class BLEService; -class BLEDescriptor; -class BLECharacteristicCallbacks; - -/** - * @brief A management structure for %BLE descriptors. - */ -class BLEDescriptorMap { -public: - void setByUUID(const char* uuid, BLEDescriptor* pDescriptor); - void setByUUID(BLEUUID uuid, BLEDescriptor* pDescriptor); - void setByHandle(uint16_t handle, BLEDescriptor* pDescriptor); - BLEDescriptor* getByUUID(const char* uuid); - BLEDescriptor* getByUUID(BLEUUID uuid); - BLEDescriptor* getByHandle(uint16_t handle); - std::string toString(); - void handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t* param); - BLEDescriptor* getFirst(); - BLEDescriptor* getNext(); -private: - std::map m_uuidMap; - std::map m_handleMap; - std::map::iterator m_iterator; -}; - - -/** - * @brief The model of a %BLE Characteristic. - * - * A BLE Characteristic is an identified value container that manages a value. It is exposed by a BLE server and - * can be read and written to by a %BLE client. - */ -class BLECharacteristic { -public: - BLECharacteristic(const char* uuid, uint32_t properties = 0); - BLECharacteristic(BLEUUID uuid, uint32_t properties = 0); - virtual ~BLECharacteristic(); - - void addDescriptor(BLEDescriptor* pDescriptor); - BLEDescriptor* getDescriptorByUUID(const char* descriptorUUID); - BLEDescriptor* getDescriptorByUUID(BLEUUID descriptorUUID); - BLEUUID getUUID(); - std::string getValue(); - uint8_t* getData(); - - void indicate(); - void notify(bool is_notification = true); - void setBroadcastProperty(bool value); - void setCallbacks(BLECharacteristicCallbacks* pCallbacks); - void setIndicateProperty(bool value); - void setNotifyProperty(bool value); - void setReadProperty(bool value); - void setValue(uint8_t* data, size_t size); - void setValue(std::string value); - void setValue(uint16_t& data16); - void setValue(uint32_t& data32); - void setValue(int& data32); - void setValue(float& data32); - void setValue(double& data64); - void setWriteProperty(bool value); - void setWriteNoResponseProperty(bool value); - std::string toString(); - uint16_t getHandle(); - void setAccessPermissions(esp_gatt_perm_t perm); - - static const uint32_t PROPERTY_READ = 1<<0; - static const uint32_t PROPERTY_WRITE = 1<<1; - static const uint32_t PROPERTY_NOTIFY = 1<<2; - static const uint32_t PROPERTY_BROADCAST = 1<<3; - static const uint32_t PROPERTY_INDICATE = 1<<4; - static const uint32_t PROPERTY_WRITE_NR = 1<<5; - - static const uint32_t indicationTimeout = 1000; - -private: - - friend class BLEServer; - friend class BLEService; - friend class BLEDescriptor; - friend class BLECharacteristicMap; - - BLEUUID m_bleUUID; - BLEDescriptorMap m_descriptorMap; - uint16_t m_handle; - esp_gatt_char_prop_t m_properties; - BLECharacteristicCallbacks* m_pCallbacks; - BLEService* m_pService; - BLEValue m_value; - esp_gatt_perm_t m_permissions = ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE; - - void handleGATTServerEvent( - esp_gatts_cb_event_t event, - esp_gatt_if_t gatts_if, - esp_ble_gatts_cb_param_t* param); - - void executeCreate(BLEService* pService); - esp_gatt_char_prop_t getProperties(); - BLEService* getService(); - void setHandle(uint16_t handle); - FreeRTOS::Semaphore m_semaphoreCreateEvt = FreeRTOS::Semaphore("CreateEvt"); - FreeRTOS::Semaphore m_semaphoreConfEvt = FreeRTOS::Semaphore("ConfEvt"); - FreeRTOS::Semaphore m_semaphoreSetValue = FreeRTOS::Semaphore("SetValue"); -}; // BLECharacteristic - - -/** - * @brief Callbacks that can be associated with a %BLE characteristic to inform of events. - * - * When a server application creates a %BLE characteristic, we may wish to be informed when there is either - * a read or write request to the characteristic's value. An application can register a - * sub-classed instance of this class and will be notified when such an event happens. - */ -class BLECharacteristicCallbacks { -public: - typedef enum { - SUCCESS_INDICATE, - SUCCESS_NOTIFY, - ERROR_INDICATE_DISABLED, - ERROR_NOTIFY_DISABLED, - ERROR_GATT, - ERROR_NO_CLIENT, - ERROR_INDICATE_TIMEOUT, - ERROR_INDICATE_FAILURE - }Status; - - virtual ~BLECharacteristicCallbacks(); - virtual void onRead(BLECharacteristic* pCharacteristic); - virtual void onWrite(BLECharacteristic* pCharacteristic); - virtual void onNotify(BLECharacteristic* pCharacteristic); - virtual void onStatus(BLECharacteristic* pCharacteristic, Status s, uint32_t code); -}; -#endif /* CONFIG_BT_ENABLED */ -#endif /* COMPONENTS_CPP_UTILS_BLECHARACTERISTIC_H_ */ diff --git a/libraries/BLE/src/BLECharacteristicMap.cpp b/libraries/BLE/src/BLECharacteristicMap.cpp deleted file mode 100644 index 6e648fc7cdc..00000000000 --- a/libraries/BLE/src/BLECharacteristicMap.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/* - * BLECharacteristicMap.cpp - * - * Created on: Jun 22, 2017 - * Author: kolban - */ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include -#include -#include "BLEService.h" -#ifdef ARDUINO_ARCH_ESP32 -#include "esp32-hal-log.h" -#endif - - -/** - * @brief Return the characteristic by handle. - * @param [in] handle The handle to look up the characteristic. - * @return The characteristic. - */ -BLECharacteristic* BLECharacteristicMap::getByHandle(uint16_t handle) { - return m_handleMap.at(handle); -} // getByHandle - - -/** - * @brief Return the characteristic by UUID. - * @param [in] UUID The UUID to look up the characteristic. - * @return The characteristic. - */ -BLECharacteristic* BLECharacteristicMap::getByUUID(const char* uuid) { - return getByUUID(BLEUUID(uuid)); -} - - -/** - * @brief Return the characteristic by UUID. - * @param [in] UUID The UUID to look up the characteristic. - * @return The characteristic. - */ -BLECharacteristic* BLECharacteristicMap::getByUUID(BLEUUID uuid) { - for (auto &myPair : m_uuidMap) { - if (myPair.first->getUUID().equals(uuid)) { - return myPair.first; - } - } - //return m_uuidMap.at(uuid.toString()); - return nullptr; -} // getByUUID - - -/** - * @brief Get the first characteristic in the map. - * @return The first characteristic in the map. - */ -BLECharacteristic* BLECharacteristicMap::getFirst() { - m_iterator = m_uuidMap.begin(); - if (m_iterator == m_uuidMap.end()) return nullptr; - BLECharacteristic* pRet = m_iterator->first; - m_iterator++; - return pRet; -} // getFirst - - -/** - * @brief Get the next characteristic in the map. - * @return The next characteristic in the map. - */ -BLECharacteristic* BLECharacteristicMap::getNext() { - if (m_iterator == m_uuidMap.end()) return nullptr; - BLECharacteristic* pRet = m_iterator->first; - m_iterator++; - return pRet; -} // getNext - - -/** - * @brief Pass the GATT server event onwards to each of the characteristics found in the mapping - * @param [in] event - * @param [in] gatts_if - * @param [in] param - */ -void BLECharacteristicMap::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t* param) { - // Invoke the handler for every Service we have. - for (auto& myPair : m_uuidMap) { - myPair.first->handleGATTServerEvent(event, gatts_if, param); - } -} // handleGATTServerEvent - - -/** - * @brief Set the characteristic by handle. - * @param [in] handle The handle of the characteristic. - * @param [in] characteristic The characteristic to cache. - * @return N/A. - */ -void BLECharacteristicMap::setByHandle(uint16_t handle, BLECharacteristic* characteristic) { - m_handleMap.insert(std::pair(handle, characteristic)); -} // setByHandle - - -/** - * @brief Set the characteristic by UUID. - * @param [in] uuid The uuid of the characteristic. - * @param [in] characteristic The characteristic to cache. - * @return N/A. - */ -void BLECharacteristicMap::setByUUID(BLECharacteristic* pCharacteristic, BLEUUID uuid) { - m_uuidMap.insert(std::pair(pCharacteristic, uuid.toString())); -} // setByUUID - - -/** - * @brief Return a string representation of the characteristic map. - * @return A string representation of the characteristic map. - */ -std::string BLECharacteristicMap::toString() { - std::string res; - int count = 0; - char hex[5]; - for (auto &myPair: m_uuidMap) { - if (count > 0) {res += "\n";} - snprintf(hex, sizeof(hex), "%04x", myPair.first->getHandle()); - count++; - res += "handle: 0x"; - res += hex; - res += ", uuid: " + myPair.first->getUUID().toString(); - } - return res; -} // toString - - -#endif /* CONFIG_BT_ENABLED */ diff --git a/libraries/BLE/src/BLEClient.cpp b/libraries/BLE/src/BLEClient.cpp deleted file mode 100644 index 436813f859d..00000000000 --- a/libraries/BLE/src/BLEClient.cpp +++ /dev/null @@ -1,529 +0,0 @@ -/* - * BLEDevice.cpp - * - * Created on: Mar 22, 2017 - * Author: kolban - */ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include -#include -#include -#include -#include "BLEClient.h" -#include "BLEUtils.h" -#include "BLEService.h" -#include "GeneralUtils.h" -#include -#include -#include -#include "BLEDevice.h" -#include "esp32-hal-log.h" - -/* - * Design - * ------ - * When we perform a searchService() requests, we are asking the BLE server to return each of the services - * that it exposes. For each service, we received an ESP_GATTC_SEARCH_RES_EVT event which contains details - * of the exposed service including its UUID. - * - * The objects we will invent for a BLEClient will be as follows: - * * BLERemoteService - A model of a remote service. - * * BLERemoteCharacteristic - A model of a remote characteristic - * * BLERemoteDescriptor - A model of a remote descriptor. - * - * Since there is a hierarchical relationship here, we will have the idea that from a BLERemoteService will own - * zero or more remote characteristics and a BLERemoteCharacteristic will own zero or more remote BLEDescriptors. - * - * We will assume that a BLERemoteService contains a map that maps BLEUUIDs to the set of owned characteristics - * and that a BLECharacteristic contains a map that maps BLEUUIDs to the set of owned descriptors. - * - * - */ - -BLEClient::BLEClient() { - m_pClientCallbacks = nullptr; - m_conn_id = ESP_GATT_IF_NONE; - m_gattc_if = ESP_GATT_IF_NONE; - m_haveServices = false; - m_isConnected = false; // Initially, we are flagged as not connected. -} // BLEClient - - -/** - * @brief Destructor. - */ -BLEClient::~BLEClient() { - // We may have allocated service references associated with this client. Before we are finished - // with the client, we must release resources. - for (auto &myPair : m_servicesMap) { - delete myPair.second; - } - m_servicesMap.clear(); -} // ~BLEClient - - -/** - * @brief Clear any existing services. - * - */ -void BLEClient::clearServices() { - log_v(">> clearServices"); - // Delete all the services. - for (auto &myPair : m_servicesMap) { - delete myPair.second; - } - m_servicesMap.clear(); - m_haveServices = false; - log_v("<< clearServices"); -} // clearServices - -/** - * Add overloaded function to ease connect to peer device with not public address - */ -bool BLEClient::connect(BLEAdvertisedDevice* device) { - BLEAddress address = device->getAddress(); - esp_ble_addr_type_t type = device->getAddressType(); - return connect(address, type); -} - -/** - * @brief Connect to the partner (BLE Server). - * @param [in] address The address of the partner. - * @return True on success. - */ -bool BLEClient::connect(BLEAddress address, esp_ble_addr_type_t type) { - log_v(">> connect(%s)", address.toString().c_str()); - -// We need the connection handle that we get from registering the application. We register the app -// and then block on its completion. When the event has arrived, we will have the handle. - m_appId = BLEDevice::m_appId++; - BLEDevice::addPeerDevice(this, true, m_appId); - m_semaphoreRegEvt.take("connect"); - - // clearServices(); // we dont need to delete services since every client is unique? - esp_err_t errRc = ::esp_ble_gattc_app_register(m_appId); - if (errRc != ESP_OK) { - log_e("esp_ble_gattc_app_register: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return false; - } - - m_semaphoreRegEvt.wait("connect"); - - m_peerAddress = address; - - // Perform the open connection request against the target BLE Server. - m_semaphoreOpenEvt.take("connect"); - errRc = ::esp_ble_gattc_open( - m_gattc_if, - *getPeerAddress().getNative(), // address - type, // Note: This was added on 2018-04-03 when the latest ESP-IDF was detected to have changed the signature. - 1 // direct connection <-- maybe needs to be changed in case of direct indirect connection??? - ); - if (errRc != ESP_OK) { - log_e("esp_ble_gattc_open: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return false; - } - - uint32_t rc = m_semaphoreOpenEvt.wait("connect"); // Wait for the connection to complete. - log_v("<< connect(), rc=%d", rc==ESP_GATT_OK); - return rc == ESP_GATT_OK; -} // connect - - -/** - * @brief Disconnect from the peer. - * @return N/A. - */ -void BLEClient::disconnect() { - log_v(">> disconnect()"); - esp_err_t errRc = ::esp_ble_gattc_close(getGattcIf(), getConnId()); - if (errRc != ESP_OK) { - log_e("esp_ble_gattc_close: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; - } - log_v("<< disconnect()"); -} // disconnect - - -/** - * @brief Handle GATT Client events - */ -void BLEClient::gattClientEventHandler( - esp_gattc_cb_event_t event, - esp_gatt_if_t gattc_if, - esp_ble_gattc_cb_param_t* evtParam) { - - log_d("gattClientEventHandler [esp_gatt_if: %d] ... %s", - gattc_if, BLEUtils::gattClientEventTypeToString(event).c_str()); - - // Execute handler code based on the type of event received. - switch(event) { - - case ESP_GATTC_SRVC_CHG_EVT: - log_i("SERVICE CHANGED"); - break; - - case ESP_GATTC_CLOSE_EVT: { - // esp_ble_gattc_app_unregister(m_appId); - // BLEDevice::removePeerDevice(m_gattc_if, true); - break; - } - - // - // ESP_GATTC_DISCONNECT_EVT - // - // disconnect: - // - esp_gatt_status_t status - // - uint16_t conn_id - // - esp_bd_addr_t remote_bda - case ESP_GATTC_DISCONNECT_EVT: { - // If we receive a disconnect event, set the class flag that indicates that we are - // no longer connected. - m_isConnected = false; - if (m_pClientCallbacks != nullptr) { - m_pClientCallbacks->onDisconnect(this); - } - esp_ble_gattc_app_unregister(m_gattc_if); - m_semaphoreOpenEvt.give(ESP_GATT_IF_NONE); - m_semaphoreRssiCmplEvt.give(); - m_semaphoreSearchCmplEvt.give(1); - BLEDevice::removePeerDevice(m_appId, true); - break; - } // ESP_GATTC_DISCONNECT_EVT - - // - // ESP_GATTC_OPEN_EVT - // - // open: - // - esp_gatt_status_t status - // - uint16_t conn_id - // - esp_bd_addr_t remote_bda - // - case ESP_GATTC_OPEN_EVT: { - m_conn_id = evtParam->open.conn_id; - if (m_pClientCallbacks != nullptr) { - m_pClientCallbacks->onConnect(this); - } - if (evtParam->open.status == ESP_GATT_OK) { - m_isConnected = true; // Flag us as connected. - } - m_semaphoreOpenEvt.give(evtParam->open.status); - break; - } // ESP_GATTC_OPEN_EVT - - - // - // ESP_GATTC_REG_EVT - // - // reg: - // esp_gatt_status_t status - // uint16_t app_id - // - case ESP_GATTC_REG_EVT: { - m_gattc_if = gattc_if; - m_semaphoreRegEvt.give(); - break; - } // ESP_GATTC_REG_EVT - - case ESP_GATTC_CFG_MTU_EVT: - if(evtParam->cfg_mtu.status != ESP_GATT_OK) { - log_e("Config mtu failed"); - } - m_mtu = evtParam->cfg_mtu.mtu; - break; - - case ESP_GATTC_CONNECT_EVT: { - BLEDevice::updatePeerDevice(this, true, m_gattc_if); - esp_err_t errRc = esp_ble_gattc_send_mtu_req(gattc_if, evtParam->connect.conn_id); - if (errRc != ESP_OK) { - log_e("esp_ble_gattc_send_mtu_req: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - } -#ifdef CONFIG_BLE_SMP_ENABLE // Check that BLE SMP (security) is configured in make menuconfig - if(BLEDevice::m_securityLevel){ - esp_ble_set_encryption(evtParam->connect.remote_bda, BLEDevice::m_securityLevel); - } -#endif // CONFIG_BLE_SMP_ENABLE - break; - } // ESP_GATTC_CONNECT_EVT - - // - // ESP_GATTC_SEARCH_CMPL_EVT - // - // search_cmpl: - // - esp_gatt_status_t status - // - uint16_t conn_id - // - case ESP_GATTC_SEARCH_CMPL_EVT: { - esp_ble_gattc_cb_param_t* p_data = (esp_ble_gattc_cb_param_t*)evtParam; - if (p_data->search_cmpl.status != ESP_GATT_OK){ - log_e("search service failed, error status = %x", p_data->search_cmpl.status); - break; - } -#ifndef ARDUINO_ARCH_ESP32 -// commented out just for now to keep backward compatibility - // if(p_data->search_cmpl.searched_service_source == ESP_GATT_SERVICE_FROM_REMOTE_DEVICE) { - // log_i("Get service information from remote device"); - // } else if (p_data->search_cmpl.searched_service_source == ESP_GATT_SERVICE_FROM_NVS_FLASH) { - // log_i("Get service information from flash"); - // } else { - // log_i("unknown service source"); - // } -#endif - m_semaphoreSearchCmplEvt.give(0); - break; - } // ESP_GATTC_SEARCH_CMPL_EVT - - - // - // ESP_GATTC_SEARCH_RES_EVT - // - // search_res: - // - uint16_t conn_id - // - uint16_t start_handle - // - uint16_t end_handle - // - esp_gatt_id_t srvc_id - // - case ESP_GATTC_SEARCH_RES_EVT: { - BLEUUID uuid = BLEUUID(evtParam->search_res.srvc_id); - BLERemoteService* pRemoteService = new BLERemoteService( - evtParam->search_res.srvc_id, - this, - evtParam->search_res.start_handle, - evtParam->search_res.end_handle - ); - m_servicesMap.insert(std::pair(uuid.toString(), pRemoteService)); - m_servicesMapByInstID.insert(std::pair(pRemoteService, evtParam->search_res.srvc_id.inst_id)); - break; - } // ESP_GATTC_SEARCH_RES_EVT - - - default: { - break; - } - } // Switch - - // Pass the request on to all services. - for (auto &myPair : m_servicesMap) { - myPair.second->gattClientEventHandler(event, gattc_if, evtParam); - } - -} // gattClientEventHandler - - -uint16_t BLEClient::getConnId() { - return m_conn_id; -} // getConnId - - - -esp_gatt_if_t BLEClient::getGattcIf() { - return m_gattc_if; -} // getGattcIf - - -/** - * @brief Retrieve the address of the peer. - * - * Returns the Bluetooth device address of the %BLE peer to which this client is connected. - */ -BLEAddress BLEClient::getPeerAddress() { - return m_peerAddress; -} // getAddress - - -/** - * @brief Ask the BLE server for the RSSI value. - * @return The RSSI value. - */ -int BLEClient::getRssi() { - log_v(">> getRssi()"); - if (!isConnected()) { - log_v("<< getRssi(): Not connected"); - return 0; - } - // We make the API call to read the RSSI value which is an asynchronous operation. We expect to receive - // an ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT to indicate completion. - // - m_semaphoreRssiCmplEvt.take("getRssi"); - esp_err_t rc = ::esp_ble_gap_read_rssi(*getPeerAddress().getNative()); - if (rc != ESP_OK) { - log_e("<< getRssi: esp_ble_gap_read_rssi: rc=%d %s", rc, GeneralUtils::errorToString(rc)); - return 0; - } - int rssiValue = m_semaphoreRssiCmplEvt.wait("getRssi"); - log_v("<< getRssi(): %d", rssiValue); - return rssiValue; -} // getRssi - - -/** - * @brief Get the service BLE Remote Service instance corresponding to the uuid. - * @param [in] uuid The UUID of the service being sought. - * @return A reference to the Service or nullptr if don't know about it. - */ -BLERemoteService* BLEClient::getService(const char* uuid) { - return getService(BLEUUID(uuid)); -} // getService - - -/** - * @brief Get the service object corresponding to the uuid. - * @param [in] uuid The UUID of the service being sought. - * @return A reference to the Service or nullptr if don't know about it. - * @throws BLEUuidNotFound - */ -BLERemoteService* BLEClient::getService(BLEUUID uuid) { - log_v(">> getService: uuid: %s", uuid.toString().c_str()); -// Design -// ------ -// We wish to retrieve the service given its UUID. It is possible that we have not yet asked the -// device what services it has in which case we have nothing to match against. If we have not -// asked the device about its services, then we do that now. Once we get the results we can then -// examine the services map to see if it has the service we are looking for. - if (!m_haveServices) { - getServices(); - } - std::string uuidStr = uuid.toString(); - for (auto &myPair : m_servicesMap) { - if (myPair.first == uuidStr) { - log_v("<< getService: found the service with uuid: %s", uuid.toString().c_str()); - return myPair.second; - } - } // End of each of the services. - log_v("<< getService: not found"); - return nullptr; -} // getService - - -/** - * @brief Ask the remote %BLE server for its services. - * A %BLE Server exposes a set of services for its partners. Here we ask the server for its set of - * services and wait until we have received them all. - * @return N/A - */ -std::map* BLEClient::getServices() { -/* - * Design - * ------ - * We invoke esp_ble_gattc_search_service. This will request a list of the service exposed by the - * peer BLE partner to be returned as events. Each event will be an an instance of ESP_GATTC_SEARCH_RES_EVT - * and will culminate with an ESP_GATTC_SEARCH_CMPL_EVT when all have been received. - */ - log_v(">> getServices"); -// TODO implement retrieving services from cache - clearServices(); // Clear any services that may exist. - - esp_err_t errRc = esp_ble_gattc_search_service( - getGattcIf(), - getConnId(), - NULL // Filter UUID - ); - - m_semaphoreSearchCmplEvt.take("getServices"); - if (errRc != ESP_OK) { - log_e("esp_ble_gattc_search_service: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return &m_servicesMap; - } - // If sucessfull, remember that we now have services. - m_haveServices = (m_semaphoreSearchCmplEvt.wait("getServices") == 0); - log_v("<< getServices"); - return &m_servicesMap; -} // getServices - - -/** - * @brief Get the value of a specific characteristic associated with a specific service. - * @param [in] serviceUUID The service that owns the characteristic. - * @param [in] characteristicUUID The characteristic whose value we wish to read. - * @throws BLEUuidNotFound - */ -std::string BLEClient::getValue(BLEUUID serviceUUID, BLEUUID characteristicUUID) { - log_v(">> getValue: serviceUUID: %s, characteristicUUID: %s", serviceUUID.toString().c_str(), characteristicUUID.toString().c_str()); - std::string ret = getService(serviceUUID)->getCharacteristic(characteristicUUID)->readValue(); - log_v("<read_rssi_cmpl.rssi); - break; - } // ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT - - default: - break; - } -} // handleGAPEvent - - -/** - * @brief Are we connected to a partner? - * @return True if we are connected and false if we are not connected. - */ -bool BLEClient::isConnected() { - return m_isConnected; -} // isConnected - - - - -/** - * @brief Set the callbacks that will be invoked. - */ -void BLEClient::setClientCallbacks(BLEClientCallbacks* pClientCallbacks) { - m_pClientCallbacks = pClientCallbacks; -} // setClientCallbacks - - -/** - * @brief Set the value of a specific characteristic associated with a specific service. - * @param [in] serviceUUID The service that owns the characteristic. - * @param [in] characteristicUUID The characteristic whose value we wish to write. - * @throws BLEUuidNotFound - */ -void BLEClient::setValue(BLEUUID serviceUUID, BLEUUID characteristicUUID, std::string value) { - log_v(">> setValue: serviceUUID: %s, characteristicUUID: %s", serviceUUID.toString().c_str(), characteristicUUID.toString().c_str()); - getService(serviceUUID)->getCharacteristic(characteristicUUID)->writeValue(value); - log_v("<< setValue"); -} // setValue - -uint16_t BLEClient::getMTU() { - return m_mtu; -} - -/** - * @brief Return a string representation of this client. - * @return A string representation of this client. - */ -std::string BLEClient::toString() { - std::string res = "peer address: " + m_peerAddress.toString(); - res += "\nServices:\n"; - for (auto &myPair : m_servicesMap) { - res += myPair.second->toString() + "\n"; - // myPair.second is the value - } - return res; -} // toString - - -#endif // CONFIG_BT_ENABLED diff --git a/libraries/BLE/src/BLEClient.h b/libraries/BLE/src/BLEClient.h deleted file mode 100644 index 75a288e4329..00000000000 --- a/libraries/BLE/src/BLEClient.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * BLEDevice.h - * - * Created on: Mar 22, 2017 - * Author: kolban - */ - -#ifndef MAIN_BLEDEVICE_H_ -#define MAIN_BLEDEVICE_H_ - -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) - -#include -#include -#include -#include -//#include "BLEExceptions.h" -#include "BLERemoteService.h" -#include "BLEService.h" -#include "BLEAddress.h" -#include "BLEAdvertisedDevice.h" - -class BLERemoteService; -class BLEClientCallbacks; -class BLEAdvertisedDevice; - -/** - * @brief A model of a %BLE client. - */ -class BLEClient { -public: - BLEClient(); - ~BLEClient(); - - bool connect(BLEAdvertisedDevice* device); - bool connect(BLEAddress address, esp_ble_addr_type_t type = BLE_ADDR_TYPE_PUBLIC); // Connect to the remote BLE Server - void disconnect(); // Disconnect from the remote BLE Server - BLEAddress getPeerAddress(); // Get the address of the remote BLE Server - int getRssi(); // Get the RSSI of the remote BLE Server - std::map* getServices(); // Get a map of the services offered by the remote BLE Server - BLERemoteService* getService(const char* uuid); // Get a reference to a specified service offered by the remote BLE server. - BLERemoteService* getService(BLEUUID uuid); // Get a reference to a specified service offered by the remote BLE server. - std::string getValue(BLEUUID serviceUUID, BLEUUID characteristicUUID); // Get the value of a given characteristic at a given service. - - - void handleGAPEvent( - esp_gap_ble_cb_event_t event, - esp_ble_gap_cb_param_t* param); - - bool isConnected(); // Return true if we are connected. - - void setClientCallbacks(BLEClientCallbacks *pClientCallbacks); - void setValue(BLEUUID serviceUUID, BLEUUID characteristicUUID, std::string value); // Set the value of a given characteristic at a given service. - - std::string toString(); // Return a string representation of this client. - uint16_t getConnId(); - esp_gatt_if_t getGattcIf(); - uint16_t getMTU(); - -uint16_t m_appId; -private: - friend class BLEDevice; - friend class BLERemoteService; - friend class BLERemoteCharacteristic; - friend class BLERemoteDescriptor; - - void gattClientEventHandler( - esp_gattc_cb_event_t event, - esp_gatt_if_t gattc_if, - esp_ble_gattc_cb_param_t* param); - - BLEAddress m_peerAddress = BLEAddress((uint8_t*)"\0\0\0\0\0\0"); // The BD address of the remote server. - uint16_t m_conn_id; -// int m_deviceType; - esp_gatt_if_t m_gattc_if; - bool m_haveServices = false; // Have we previously obtain the set of services from the remote server. - bool m_isConnected = false; // Are we currently connected. - - BLEClientCallbacks* m_pClientCallbacks; - FreeRTOS::Semaphore m_semaphoreRegEvt = FreeRTOS::Semaphore("RegEvt"); - FreeRTOS::Semaphore m_semaphoreOpenEvt = FreeRTOS::Semaphore("OpenEvt"); - FreeRTOS::Semaphore m_semaphoreSearchCmplEvt = FreeRTOS::Semaphore("SearchCmplEvt"); - FreeRTOS::Semaphore m_semaphoreRssiCmplEvt = FreeRTOS::Semaphore("RssiCmplEvt"); - std::map m_servicesMap; - std::map m_servicesMapByInstID; - void clearServices(); // Clear any existing services. - uint16_t m_mtu = 23; -}; // class BLEDevice - - -/** - * @brief Callbacks associated with a %BLE client. - */ -class BLEClientCallbacks { -public: - virtual ~BLEClientCallbacks() {}; - virtual void onConnect(BLEClient *pClient) = 0; - virtual void onDisconnect(BLEClient *pClient) = 0; -}; - -#endif // CONFIG_BT_ENABLED -#endif /* MAIN_BLEDEVICE_H_ */ diff --git a/libraries/BLE/src/BLEDescriptor.cpp b/libraries/BLE/src/BLEDescriptor.cpp deleted file mode 100644 index 96b2de87c95..00000000000 --- a/libraries/BLE/src/BLEDescriptor.cpp +++ /dev/null @@ -1,287 +0,0 @@ -/* - * BLEDescriptor.cpp - * - * Created on: Jun 22, 2017 - * Author: kolban - */ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include -#include -#include -#include -#include "sdkconfig.h" -#include -#include "BLEService.h" -#include "BLEDescriptor.h" -#include "GeneralUtils.h" -#include "esp32-hal-log.h" - -#define NULL_HANDLE (0xffff) - - -/** - * @brief BLEDescriptor constructor. - */ -BLEDescriptor::BLEDescriptor(const char* uuid, uint16_t len) : BLEDescriptor(BLEUUID(uuid), len) { -} - -/** - * @brief BLEDescriptor constructor. - */ -BLEDescriptor::BLEDescriptor(BLEUUID uuid, uint16_t max_len) { - m_bleUUID = uuid; - m_value.attr_len = 0; // Initial length is 0. - m_value.attr_max_len = max_len; // Maximum length of the data. - m_handle = NULL_HANDLE; // Handle is initially unknown. - m_pCharacteristic = nullptr; // No initial characteristic. - m_pCallback = nullptr; // No initial callback. - - m_value.attr_value = (uint8_t*) malloc(max_len); // Allocate storage for the value. -} // BLEDescriptor - - -/** - * @brief BLEDescriptor destructor. - */ -BLEDescriptor::~BLEDescriptor() { - free(m_value.attr_value); // Release the storage we created in the constructor. -} // ~BLEDescriptor - - -/** - * @brief Execute the creation of the descriptor with the BLE runtime in ESP. - * @param [in] pCharacteristic The characteristic to which to register this descriptor. - */ -void BLEDescriptor::executeCreate(BLECharacteristic* pCharacteristic) { - log_v(">> executeCreate(): %s", toString().c_str()); - - if (m_handle != NULL_HANDLE) { - log_e("Descriptor already has a handle."); - return; - } - - m_pCharacteristic = pCharacteristic; // Save the characteristic associated with this service. - - esp_attr_control_t control; - control.auto_rsp = ESP_GATT_AUTO_RSP; - m_semaphoreCreateEvt.take("executeCreate"); - esp_err_t errRc = ::esp_ble_gatts_add_char_descr( - pCharacteristic->getService()->getHandle(), - getUUID().getNative(), - (esp_gatt_perm_t)m_permissions, - &m_value, - &control); - if (errRc != ESP_OK) { - log_e("<< esp_ble_gatts_add_char_descr: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; - } - - m_semaphoreCreateEvt.wait("executeCreate"); - log_v("<< executeCreate"); -} // executeCreate - - -/** - * @brief Get the BLE handle for this descriptor. - * @return The handle for this descriptor. - */ -uint16_t BLEDescriptor::getHandle() { - return m_handle; -} // getHandle - - -/** - * @brief Get the length of the value of this descriptor. - * @return The length (in bytes) of the value of this descriptor. - */ -size_t BLEDescriptor::getLength() { - return m_value.attr_len; -} // getLength - - -/** - * @brief Get the UUID of the descriptor. - */ -BLEUUID BLEDescriptor::getUUID() { - return m_bleUUID; -} // getUUID - - - -/** - * @brief Get the value of this descriptor. - * @return A pointer to the value of this descriptor. - */ -uint8_t* BLEDescriptor::getValue() { - return m_value.attr_value; -} // getValue - - -/** - * @brief Handle GATT server events for the descripttor. - * @param [in] event - * @param [in] gatts_if - * @param [in] param - */ -void BLEDescriptor::handleGATTServerEvent( - esp_gatts_cb_event_t event, - esp_gatt_if_t gatts_if, - esp_ble_gatts_cb_param_t* param) { - switch (event) { - // ESP_GATTS_ADD_CHAR_DESCR_EVT - // - // add_char_descr: - // - esp_gatt_status_t status - // - uint16_t attr_handle - // - uint16_t service_handle - // - esp_bt_uuid_t char_uuid - case ESP_GATTS_ADD_CHAR_DESCR_EVT: { - if (m_pCharacteristic != nullptr && - m_bleUUID.equals(BLEUUID(param->add_char_descr.descr_uuid)) && - m_pCharacteristic->getService()->getHandle() == param->add_char_descr.service_handle && - m_pCharacteristic == m_pCharacteristic->getService()->getLastCreatedCharacteristic()) { - setHandle(param->add_char_descr.attr_handle); - m_semaphoreCreateEvt.give(); - } - break; - } // ESP_GATTS_ADD_CHAR_DESCR_EVT - - // ESP_GATTS_WRITE_EVT - A request to write the value of a descriptor has arrived. - // - // write: - // - uint16_t conn_id - // - uint16_t trans_id - // - esp_bd_addr_t bda - // - uint16_t handle - // - uint16_t offset - // - bool need_rsp - // - bool is_prep - // - uint16_t len - // - uint8_t *value - case ESP_GATTS_WRITE_EVT: { - if (param->write.handle == m_handle) { - setValue(param->write.value, param->write.len); // Set the value of the descriptor. - - if (m_pCallback != nullptr) { // We have completed the write, if there is a user supplied callback handler, invoke it now. - m_pCallback->onWrite(this); // Invoke the onWrite callback handler. - } - } // End of ... this is our handle. - - break; - } // ESP_GATTS_WRITE_EVT - - // ESP_GATTS_READ_EVT - A request to read the value of a descriptor has arrived. - // - // read: - // - uint16_t conn_id - // - uint32_t trans_id - // - esp_bd_addr_t bda - // - uint16_t handle - // - uint16_t offset - // - bool is_long - // - bool need_rsp - // - case ESP_GATTS_READ_EVT: { - if (param->read.handle == m_handle) { // If this event is for this descriptor ... process it - - if (m_pCallback != nullptr) { // If we have a user supplied callback, invoke it now. - m_pCallback->onRead(this); // Invoke the onRead callback method in the callback handler. - } - - } // End of this is our handle - break; - } // ESP_GATTS_READ_EVT - - default: - break; - } // switch event -} // handleGATTServerEvent - - -/** - * @brief Set the callback handlers for this descriptor. - * @param [in] pCallbacks An instance of a callback structure used to define any callbacks for the descriptor. - */ -void BLEDescriptor::setCallbacks(BLEDescriptorCallbacks* pCallback) { - log_v(">> setCallbacks: 0x%x", (uint32_t) pCallback); - m_pCallback = pCallback; - log_v("<< setCallbacks"); -} // setCallbacks - - -/** - * @brief Set the handle of this descriptor. - * Set the handle of this descriptor to be the supplied value. - * @param [in] handle The handle to be associated with this descriptor. - * @return N/A. - */ -void BLEDescriptor::setHandle(uint16_t handle) { - log_v(">> setHandle(0x%.2x): Setting descriptor handle to be 0x%.2x", handle, handle); - m_handle = handle; - log_v("<< setHandle()"); -} // setHandle - - -/** - * @brief Set the value of the descriptor. - * @param [in] data The data to set for the descriptor. - * @param [in] length The length of the data in bytes. - */ -void BLEDescriptor::setValue(uint8_t* data, size_t length) { - if (length > ESP_GATT_MAX_ATTR_LEN) { - log_e("Size %d too large, must be no bigger than %d", length, ESP_GATT_MAX_ATTR_LEN); - return; - } - m_value.attr_len = length; - memcpy(m_value.attr_value, data, length); -} // setValue - - -/** - * @brief Set the value of the descriptor. - * @param [in] value The value of the descriptor in string form. - */ -void BLEDescriptor::setValue(std::string value) { - setValue((uint8_t*) value.data(), value.length()); -} // setValue - -void BLEDescriptor::setAccessPermissions(esp_gatt_perm_t perm) { - m_permissions = perm; -} - -/** - * @brief Return a string representation of the descriptor. - * @return A string representation of the descriptor. - */ -std::string BLEDescriptor::toString() { - char hex[5]; - snprintf(hex, sizeof(hex), "%04x", m_handle); - std::string res = "UUID: " + m_bleUUID.toString() + ", handle: 0x" + hex; - return res; -} // toString - - -BLEDescriptorCallbacks::~BLEDescriptorCallbacks() {} - -/** - * @brief Callback function to support a read request. - * @param [in] pDescriptor The descriptor that is the source of the event. - */ -void BLEDescriptorCallbacks::onRead(BLEDescriptor* pDescriptor) { - log_d("BLEDescriptorCallbacks", ">> onRead: default"); - log_d("BLEDescriptorCallbacks", "<< onRead"); -} // onRead - - -/** - * @brief Callback function to support a write request. - * @param [in] pDescriptor The descriptor that is the source of the event. - */ -void BLEDescriptorCallbacks::onWrite(BLEDescriptor* pDescriptor) { - log_d("BLEDescriptorCallbacks", ">> onWrite: default"); - log_d("BLEDescriptorCallbacks", "<< onWrite"); -} // onWrite - - -#endif /* CONFIG_BT_ENABLED */ diff --git a/libraries/BLE/src/BLEDescriptor.h b/libraries/BLE/src/BLEDescriptor.h deleted file mode 100644 index 03cc5791727..00000000000 --- a/libraries/BLE/src/BLEDescriptor.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * BLEDescriptor.h - * - * Created on: Jun 22, 2017 - * Author: kolban - */ - -#ifndef COMPONENTS_CPP_UTILS_BLEDESCRIPTOR_H_ -#define COMPONENTS_CPP_UTILS_BLEDESCRIPTOR_H_ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include -#include "BLEUUID.h" -#include "BLECharacteristic.h" -#include -#include "FreeRTOS.h" - -class BLEService; -class BLECharacteristic; -class BLEDescriptorCallbacks; - -/** - * @brief A model of a %BLE descriptor. - */ -class BLEDescriptor { -public: - BLEDescriptor(const char* uuid, uint16_t max_len = 100); - BLEDescriptor(BLEUUID uuid, uint16_t max_len = 100); - virtual ~BLEDescriptor(); - - uint16_t getHandle(); // Get the handle of the descriptor. - size_t getLength(); // Get the length of the value of the descriptor. - BLEUUID getUUID(); // Get the UUID of the descriptor. - uint8_t* getValue(); // Get a pointer to the value of the descriptor. - void handleGATTServerEvent( - esp_gatts_cb_event_t event, - esp_gatt_if_t gatts_if, - esp_ble_gatts_cb_param_t* param); - - void setAccessPermissions(esp_gatt_perm_t perm); // Set the permissions of the descriptor. - void setCallbacks(BLEDescriptorCallbacks* pCallbacks); // Set callbacks to be invoked for the descriptor. - void setValue(uint8_t* data, size_t size); // Set the value of the descriptor as a pointer to data. - void setValue(std::string value); // Set the value of the descriptor as a data buffer. - - std::string toString(); // Convert the descriptor to a string representation. - -private: - friend class BLEDescriptorMap; - friend class BLECharacteristic; - BLEUUID m_bleUUID; - uint16_t m_handle; - BLEDescriptorCallbacks* m_pCallback; - BLECharacteristic* m_pCharacteristic; - esp_gatt_perm_t m_permissions = ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE; - FreeRTOS::Semaphore m_semaphoreCreateEvt = FreeRTOS::Semaphore("CreateEvt"); - esp_attr_value_t m_value; - - void executeCreate(BLECharacteristic* pCharacteristic); - void setHandle(uint16_t handle); -}; // BLEDescriptor - - -/** - * @brief Callbacks that can be associated with a %BLE descriptors to inform of events. - * - * When a server application creates a %BLE descriptor, we may wish to be informed when there is either - * a read or write request to the descriptors value. An application can register a - * sub-classed instance of this class and will be notified when such an event happens. - */ -class BLEDescriptorCallbacks { -public: - virtual ~BLEDescriptorCallbacks(); - virtual void onRead(BLEDescriptor* pDescriptor); - virtual void onWrite(BLEDescriptor* pDescriptor); -}; -#endif /* CONFIG_BT_ENABLED */ -#endif /* COMPONENTS_CPP_UTILS_BLEDESCRIPTOR_H_ */ diff --git a/libraries/BLE/src/BLEDescriptorMap.cpp b/libraries/BLE/src/BLEDescriptorMap.cpp deleted file mode 100644 index 0b5d3175a9d..00000000000 --- a/libraries/BLE/src/BLEDescriptorMap.cpp +++ /dev/null @@ -1,148 +0,0 @@ -/* - * BLEDescriptorMap.cpp - * - * Created on: Jun 22, 2017 - * Author: kolban - */ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include -#include -#include "BLECharacteristic.h" -#include "BLEDescriptor.h" -#include // ESP32 BLE -#ifdef ARDUINO_ARCH_ESP32 -#include "esp32-hal-log.h" -#endif - -/** - * @brief Return the descriptor by UUID. - * @param [in] UUID The UUID to look up the descriptor. - * @return The descriptor. If not present, then nullptr is returned. - */ -BLEDescriptor* BLEDescriptorMap::getByUUID(const char* uuid) { - return getByUUID(BLEUUID(uuid)); -} - - -/** - * @brief Return the descriptor by UUID. - * @param [in] UUID The UUID to look up the descriptor. - * @return The descriptor. If not present, then nullptr is returned. - */ -BLEDescriptor* BLEDescriptorMap::getByUUID(BLEUUID uuid) { - for (auto &myPair : m_uuidMap) { - if (myPair.first->getUUID().equals(uuid)) { - return myPair.first; - } - } - //return m_uuidMap.at(uuid.toString()); - return nullptr; -} // getByUUID - - -/** - * @brief Return the descriptor by handle. - * @param [in] handle The handle to look up the descriptor. - * @return The descriptor. - */ -BLEDescriptor* BLEDescriptorMap::getByHandle(uint16_t handle) { - return m_handleMap.at(handle); -} // getByHandle - - -/** - * @brief Set the descriptor by UUID. - * @param [in] uuid The uuid of the descriptor. - * @param [in] characteristic The descriptor to cache. - * @return N/A. - */ -void BLEDescriptorMap::setByUUID(const char* uuid, BLEDescriptor* pDescriptor){ - m_uuidMap.insert(std::pair(pDescriptor, uuid)); -} // setByUUID - - - -/** - * @brief Set the descriptor by UUID. - * @param [in] uuid The uuid of the descriptor. - * @param [in] characteristic The descriptor to cache. - * @return N/A. - */ -void BLEDescriptorMap::setByUUID(BLEUUID uuid, BLEDescriptor* pDescriptor) { - m_uuidMap.insert(std::pair(pDescriptor, uuid.toString())); -} // setByUUID - - -/** - * @brief Set the descriptor by handle. - * @param [in] handle The handle of the descriptor. - * @param [in] descriptor The descriptor to cache. - * @return N/A. - */ -void BLEDescriptorMap::setByHandle(uint16_t handle, BLEDescriptor* pDescriptor) { - m_handleMap.insert(std::pair(handle, pDescriptor)); -} // setByHandle - - -/** - * @brief Return a string representation of the descriptor map. - * @return A string representation of the descriptor map. - */ -std::string BLEDescriptorMap::toString() { - std::string res; - char hex[5]; - int count = 0; - for (auto &myPair : m_uuidMap) { - if (count > 0) {res += "\n";} - snprintf(hex, sizeof(hex), "%04x", myPair.first->getHandle()); - count++; - res += "handle: 0x"; - res += hex; - res += ", uuid: " + myPair.first->getUUID().toString(); - } - return res; -} // toString - - -/** - * @breif Pass the GATT server event onwards to each of the descriptors found in the mapping - * @param [in] event - * @param [in] gatts_if - * @param [in] param - */ -void BLEDescriptorMap::handleGATTServerEvent( - esp_gatts_cb_event_t event, - esp_gatt_if_t gatts_if, - esp_ble_gatts_cb_param_t* param) { - // Invoke the handler for every descriptor we have. - for (auto &myPair : m_uuidMap) { - myPair.first->handleGATTServerEvent(event, gatts_if, param); - } -} // handleGATTServerEvent - - -/** - * @brief Get the first descriptor in the map. - * @return The first descriptor in the map. - */ -BLEDescriptor* BLEDescriptorMap::getFirst() { - m_iterator = m_uuidMap.begin(); - if (m_iterator == m_uuidMap.end()) return nullptr; - BLEDescriptor* pRet = m_iterator->first; - m_iterator++; - return pRet; -} // getFirst - - -/** - * @brief Get the next descriptor in the map. - * @return The next descriptor in the map. - */ -BLEDescriptor* BLEDescriptorMap::getNext() { - if (m_iterator == m_uuidMap.end()) return nullptr; - BLEDescriptor* pRet = m_iterator->first; - m_iterator++; - return pRet; -} // getNext -#endif /* CONFIG_BT_ENABLED */ diff --git a/libraries/BLE/src/BLEDevice.cpp b/libraries/BLE/src/BLEDevice.cpp deleted file mode 100644 index cd0dd6bfab5..00000000000 --- a/libraries/BLE/src/BLEDevice.cpp +++ /dev/null @@ -1,649 +0,0 @@ -/* - * BLE.cpp - * - * Created on: Mar 16, 2017 - * Author: kolban - */ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include -#include -#include -#include -#include -#include // ESP32 BLE -#include // ESP32 BLE -#include // ESP32 BLE -#include // ESP32 BLE -#include // ESP32 BLE -#include // ESP32 BLE -#include // ESP32 BLE -#include // ESP32 ESP-IDF -#include // Part of C++ Standard library -#include // Part of C++ Standard library -#include // Part of C++ Standard library - -#include "BLEDevice.h" -#include "BLEClient.h" -#include "BLEUtils.h" -#include "GeneralUtils.h" - -#if defined(ARDUINO_ARCH_ESP32) -#include "esp32-hal-bt.h" -#endif - -#if defined(CONFIG_ARDUHAL_ESP_LOG) -#include "esp32-hal-log.h" - -#else -#include "esp_log.h" -static const char* LOG_TAG = "BLEDevice"; -#endif - - -/** - * Singletons for the BLEDevice. - */ -BLEServer* BLEDevice::m_pServer = nullptr; -BLEScan* BLEDevice::m_pScan = nullptr; -BLEClient* BLEDevice::m_pClient = nullptr; -bool initialized = false; -esp_ble_sec_act_t BLEDevice::m_securityLevel = (esp_ble_sec_act_t)0; -BLESecurityCallbacks* BLEDevice::m_securityCallbacks = nullptr; -uint16_t BLEDevice::m_localMTU = 23; // not sure if this variable is useful -BLEAdvertising* BLEDevice::m_bleAdvertising = nullptr; -uint16_t BLEDevice::m_appId = 0; -std::map BLEDevice::m_connectedClientsMap; -gap_event_handler BLEDevice::m_customGapHandler = nullptr; -gattc_event_handler BLEDevice::m_customGattcHandler = nullptr; -gatts_event_handler BLEDevice::m_customGattsHandler = nullptr; - -/** - * @brief Create a new instance of a client. - * @return A new instance of the client. - */ -/* STATIC */ BLEClient* BLEDevice::createClient() { - log_v(">> createClient"); -#ifndef CONFIG_GATTC_ENABLE // Check that BLE GATTC is enabled in make menuconfig - log_e("BLE GATTC is not enabled - CONFIG_GATTC_ENABLE not defined"); - abort(); -#endif // CONFIG_GATTC_ENABLE - m_pClient = new BLEClient(); - log_v("<< createClient"); - return m_pClient; -} // createClient - - -/** - * @brief Create a new instance of a server. - * @return A new instance of the server. - */ -/* STATIC */ BLEServer* BLEDevice::createServer() { - log_v(">> createServer"); -#ifndef CONFIG_GATTS_ENABLE // Check that BLE GATTS is enabled in make menuconfig - log_e("BLE GATTS is not enabled - CONFIG_GATTS_ENABLE not defined"); - abort(); -#endif // CONFIG_GATTS_ENABLE - m_pServer = new BLEServer(); - m_pServer->createApp(m_appId++); - log_v("<< createServer"); - return m_pServer; -} // createServer - - -/** - * @brief Handle GATT server events. - * - * @param [in] event The event that has been newly received. - * @param [in] gatts_if The connection to the GATT interface. - * @param [in] param Parameters for the event. - */ -/* STATIC */ void BLEDevice::gattServerEventHandler( - esp_gatts_cb_event_t event, - esp_gatt_if_t gatts_if, - esp_ble_gatts_cb_param_t* param -) { - log_d("gattServerEventHandler [esp_gatt_if: %d] ... %s", - gatts_if, - BLEUtils::gattServerEventTypeToString(event).c_str()); - - BLEUtils::dumpGattServerEvent(event, gatts_if, param); - - switch (event) { - case ESP_GATTS_CONNECT_EVT: { -#ifdef CONFIG_BLE_SMP_ENABLE // Check that BLE SMP (security) is configured in make menuconfig - if(BLEDevice::m_securityLevel){ - esp_ble_set_encryption(param->connect.remote_bda, BLEDevice::m_securityLevel); - } -#endif // CONFIG_BLE_SMP_ENABLE - break; - } // ESP_GATTS_CONNECT_EVT - - default: { - break; - } - } // switch - - - if (BLEDevice::m_pServer != nullptr) { - BLEDevice::m_pServer->handleGATTServerEvent(event, gatts_if, param); - } - - if(m_customGattsHandler != nullptr) { - m_customGattsHandler(event, gatts_if, param); - } - -} // gattServerEventHandler - - -/** - * @brief Handle GATT client events. - * - * Handler for the GATT client events. - * - * @param [in] event - * @param [in] gattc_if - * @param [in] param - */ -/* STATIC */ void BLEDevice::gattClientEventHandler( - esp_gattc_cb_event_t event, - esp_gatt_if_t gattc_if, - esp_ble_gattc_cb_param_t* param) { - - log_d("gattClientEventHandler [esp_gatt_if: %d] ... %s", - gattc_if, BLEUtils::gattClientEventTypeToString(event).c_str()); - BLEUtils::dumpGattClientEvent(event, gattc_if, param); - - switch(event) { - case ESP_GATTC_CONNECT_EVT: { -#ifdef CONFIG_BLE_SMP_ENABLE // Check that BLE SMP (security) is configured in make menuconfig - if(BLEDevice::m_securityLevel){ - esp_ble_set_encryption(param->connect.remote_bda, BLEDevice::m_securityLevel); - } -#endif // CONFIG_BLE_SMP_ENABLE - break; - } // ESP_GATTS_CONNECT_EVT - - default: - break; - } // switch - for(auto &myPair : BLEDevice::getPeerDevices(true)) { - conn_status_t conn_status = (conn_status_t)myPair.second; - if(((BLEClient*)conn_status.peer_device)->getGattcIf() == gattc_if || ((BLEClient*)conn_status.peer_device)->getGattcIf() == ESP_GATT_IF_NONE || gattc_if == ESP_GATT_IF_NONE){ - ((BLEClient*)conn_status.peer_device)->gattClientEventHandler(event, gattc_if, param); - } - } - - if(m_customGattcHandler != nullptr) { - m_customGattcHandler(event, gattc_if, param); - } - - -} // gattClientEventHandler - - -/** - * @brief Handle GAP events. - */ -/* STATIC */ void BLEDevice::gapEventHandler( - esp_gap_ble_cb_event_t event, - esp_ble_gap_cb_param_t *param) { - - BLEUtils::dumpGapEvent(event, param); - - switch(event) { - - case ESP_GAP_BLE_OOB_REQ_EVT: /* OOB request event */ - log_i("ESP_GAP_BLE_OOB_REQ_EVT"); - break; - case ESP_GAP_BLE_LOCAL_IR_EVT: /* BLE local IR event */ - log_i("ESP_GAP_BLE_LOCAL_IR_EVT"); - break; - case ESP_GAP_BLE_LOCAL_ER_EVT: /* BLE local ER event */ - log_i("ESP_GAP_BLE_LOCAL_ER_EVT"); - break; - case ESP_GAP_BLE_NC_REQ_EVT: /* NUMERIC CONFIRMATION */ - log_i("ESP_GAP_BLE_NC_REQ_EVT"); -#ifdef CONFIG_BLE_SMP_ENABLE // Check that BLE SMP (security) is configured in make menuconfig - if(BLEDevice::m_securityCallbacks != nullptr){ - esp_ble_confirm_reply(param->ble_security.ble_req.bd_addr, BLEDevice::m_securityCallbacks->onConfirmPIN(param->ble_security.key_notif.passkey)); - } -#endif // CONFIG_BLE_SMP_ENABLE - break; - case ESP_GAP_BLE_PASSKEY_REQ_EVT: /* passkey request event */ - log_i("ESP_GAP_BLE_PASSKEY_REQ_EVT: "); - // esp_log_buffer_hex(m_remote_bda, sizeof(m_remote_bda)); -#ifdef CONFIG_BLE_SMP_ENABLE // Check that BLE SMP (security) is configured in make menuconfig - if(BLEDevice::m_securityCallbacks != nullptr){ - esp_ble_passkey_reply(param->ble_security.ble_req.bd_addr, true, BLEDevice::m_securityCallbacks->onPassKeyRequest()); - } -#endif // CONFIG_BLE_SMP_ENABLE - break; - /* - * TODO should we add white/black list comparison? - */ - case ESP_GAP_BLE_SEC_REQ_EVT: - /* send the positive(true) security response to the peer device to accept the security request. - If not accept the security request, should sent the security response with negative(false) accept value*/ - log_i("ESP_GAP_BLE_SEC_REQ_EVT"); -#ifdef CONFIG_BLE_SMP_ENABLE // Check that BLE SMP (security) is configured in make menuconfig - if(BLEDevice::m_securityCallbacks!=nullptr){ - esp_ble_gap_security_rsp(param->ble_security.ble_req.bd_addr, BLEDevice::m_securityCallbacks->onSecurityRequest()); - } - else{ - esp_ble_gap_security_rsp(param->ble_security.ble_req.bd_addr, true); - } -#endif // CONFIG_BLE_SMP_ENABLE - break; - /* - * - */ - case ESP_GAP_BLE_PASSKEY_NOTIF_EVT: //the app will receive this evt when the IO has Output capability and the peer device IO has Input capability. - //display the passkey number to the user to input it in the peer deivce within 30 seconds - log_i("ESP_GAP_BLE_PASSKEY_NOTIF_EVT"); -#ifdef CONFIG_BLE_SMP_ENABLE // Check that BLE SMP (security) is configured in make menuconfig - log_i("passKey = %d", param->ble_security.key_notif.passkey); - if(BLEDevice::m_securityCallbacks!=nullptr){ - BLEDevice::m_securityCallbacks->onPassKeyNotify(param->ble_security.key_notif.passkey); - } -#endif // CONFIG_BLE_SMP_ENABLE - break; - case ESP_GAP_BLE_KEY_EVT: - //shows the ble key type info share with peer device to the user. - log_d("ESP_GAP_BLE_KEY_EVT"); -#ifdef CONFIG_BLE_SMP_ENABLE // Check that BLE SMP (security) is configured in make menuconfig - log_i("key type = %s", BLESecurity::esp_key_type_to_str(param->ble_security.ble_key.key_type)); -#endif // CONFIG_BLE_SMP_ENABLE - break; - case ESP_GAP_BLE_AUTH_CMPL_EVT: - log_i("ESP_GAP_BLE_AUTH_CMPL_EVT"); -#ifdef CONFIG_BLE_SMP_ENABLE // Check that BLE SMP (security) is configured in make menuconfig - if(BLEDevice::m_securityCallbacks != nullptr){ - BLEDevice::m_securityCallbacks->onAuthenticationComplete(param->ble_security.auth_cmpl); - } -#endif // CONFIG_BLE_SMP_ENABLE - break; - default: { - break; - } - } // switch - - if (BLEDevice::m_pClient != nullptr) { - BLEDevice::m_pClient->handleGAPEvent(event, param); - } - - if (BLEDevice::m_pScan != nullptr) { - BLEDevice::getScan()->handleGAPEvent(event, param); - } - - if(m_bleAdvertising != nullptr) { - BLEDevice::getAdvertising()->handleGAPEvent(event, param); - } - - if(m_customGapHandler != nullptr) { - BLEDevice::m_customGapHandler(event, param); - } - -} // gapEventHandler - - -/** - * @brief Get the BLE device address. - * @return The BLE device address. - */ -/* STATIC*/ BLEAddress BLEDevice::getAddress() { - const uint8_t* bdAddr = esp_bt_dev_get_address(); - esp_bd_addr_t addr; - memcpy(addr, bdAddr, sizeof(addr)); - return BLEAddress(addr); -} // getAddress - - -/** - * @brief Retrieve the Scan object that we use for scanning. - * @return The scanning object reference. This is a singleton object. The caller should not - * try and release/delete it. - */ -/* STATIC */ BLEScan* BLEDevice::getScan() { - //log_v(">> getScan"); - if (m_pScan == nullptr) { - m_pScan = new BLEScan(); - //log_d(" - creating a new scan object"); - } - //log_v("<< getScan: Returning object at 0x%x", (uint32_t)m_pScan); - return m_pScan; -} // getScan - - -/** - * @brief Get the value of a characteristic of a service on a remote device. - * @param [in] bdAddress - * @param [in] serviceUUID - * @param [in] characteristicUUID - */ -/* STATIC */ std::string BLEDevice::getValue(BLEAddress bdAddress, BLEUUID serviceUUID, BLEUUID characteristicUUID) { - log_v(">> getValue: bdAddress: %s, serviceUUID: %s, characteristicUUID: %s", bdAddress.toString().c_str(), serviceUUID.toString().c_str(), characteristicUUID.toString().c_str()); - BLEClient* pClient = createClient(); - pClient->connect(bdAddress); - std::string ret = pClient->getValue(serviceUUID, characteristicUUID); - pClient->disconnect(); - log_v("<< getValue"); - return ret; -} // getValue - - -/** - * @brief Initialize the %BLE environment. - * @param deviceName The device name of the device. - */ -/* STATIC */ void BLEDevice::init(std::string deviceName) { - if(!initialized){ - initialized = true; // Set the initialization flag to ensure we are only initialized once. - - esp_err_t errRc = ESP_OK; -#ifdef ARDUINO_ARCH_ESP32 - if (!btStart()) { - errRc = ESP_FAIL; - return; - } -#else - errRc = ::nvs_flash_init(); - if (errRc != ESP_OK) { - log_e("nvs_flash_init: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; - } - -#ifndef CLASSIC_BT_ENABLED - esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT); -#endif - esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT(); - errRc = esp_bt_controller_init(&bt_cfg); - if (errRc != ESP_OK) { - log_e("esp_bt_controller_init: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; - } - -#ifndef CLASSIC_BT_ENABLED - errRc = esp_bt_controller_enable(ESP_BT_MODE_BLE); - if (errRc != ESP_OK) { - log_e("esp_bt_controller_enable: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; - } -#else - errRc = esp_bt_controller_enable(ESP_BT_MODE_BTDM); - if (errRc != ESP_OK) { - log_e("esp_bt_controller_enable: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; - } -#endif -#endif - - esp_bluedroid_status_t bt_state = esp_bluedroid_get_status(); - if (bt_state == ESP_BLUEDROID_STATUS_UNINITIALIZED) { - errRc = esp_bluedroid_init(); - if (errRc != ESP_OK) { - log_e("esp_bluedroid_init: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; - } - } - - if (bt_state != ESP_BLUEDROID_STATUS_ENABLED) { - errRc = esp_bluedroid_enable(); - if (errRc != ESP_OK) { - log_e("esp_bluedroid_enable: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; - } - } - - errRc = esp_ble_gap_register_callback(BLEDevice::gapEventHandler); - if (errRc != ESP_OK) { - log_e("esp_ble_gap_register_callback: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; - } - -#ifdef CONFIG_GATTC_ENABLE // Check that BLE client is configured in make menuconfig - errRc = esp_ble_gattc_register_callback(BLEDevice::gattClientEventHandler); - if (errRc != ESP_OK) { - log_e("esp_ble_gattc_register_callback: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; - } -#endif // CONFIG_GATTC_ENABLE - -#ifdef CONFIG_GATTS_ENABLE // Check that BLE server is configured in make menuconfig - errRc = esp_ble_gatts_register_callback(BLEDevice::gattServerEventHandler); - if (errRc != ESP_OK) { - log_e("esp_ble_gatts_register_callback: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; - } -#endif // CONFIG_GATTS_ENABLE - - errRc = ::esp_ble_gap_set_device_name(deviceName.c_str()); - if (errRc != ESP_OK) { - log_e("esp_ble_gap_set_device_name: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; - }; - -#ifdef CONFIG_BLE_SMP_ENABLE // Check that BLE SMP (security) is configured in make menuconfig - esp_ble_io_cap_t iocap = ESP_IO_CAP_NONE; - errRc = ::esp_ble_gap_set_security_param(ESP_BLE_SM_IOCAP_MODE, &iocap, sizeof(uint8_t)); - if (errRc != ESP_OK) { - log_e("esp_ble_gap_set_security_param: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; - }; -#endif // CONFIG_BLE_SMP_ENABLE - } - vTaskDelay(200 / portTICK_PERIOD_MS); // Delay for 200 msecs as a workaround to an apparent Arduino environment issue. -} // init - - -/** - * @brief Set the transmission power. - * The power level can be one of: - * * ESP_PWR_LVL_N14 - * * ESP_PWR_LVL_N11 - * * ESP_PWR_LVL_N8 - * * ESP_PWR_LVL_N5 - * * ESP_PWR_LVL_N2 - * * ESP_PWR_LVL_P1 - * * ESP_PWR_LVL_P4 - * * ESP_PWR_LVL_P7 - * @param [in] powerLevel. - */ -/* STATIC */ void BLEDevice::setPower(esp_power_level_t powerLevel) { - log_v(">> setPower: %d", powerLevel); - esp_err_t errRc = ::esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_DEFAULT, powerLevel); - if (errRc != ESP_OK) { - log_e("esp_ble_tx_power_set: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - }; - log_v("<< setPower"); -} // setPower - - -/** - * @brief Set the value of a characteristic of a service on a remote device. - * @param [in] bdAddress - * @param [in] serviceUUID - * @param [in] characteristicUUID - */ -/* STATIC */ void BLEDevice::setValue(BLEAddress bdAddress, BLEUUID serviceUUID, BLEUUID characteristicUUID, std::string value) { - log_v(">> setValue: bdAddress: %s, serviceUUID: %s, characteristicUUID: %s", bdAddress.toString().c_str(), serviceUUID.toString().c_str(), characteristicUUID.toString().c_str()); - BLEClient* pClient = createClient(); - pClient->connect(bdAddress); - pClient->setValue(serviceUUID, characteristicUUID, value); - pClient->disconnect(); -} // setValue - - -/** - * @brief Return a string representation of the nature of this device. - * @return A string representation of the nature of this device. - */ -/* STATIC */ std::string BLEDevice::toString() { - std::string res = "BD Address: " + getAddress().toString(); - return res; -} // toString - - -/** - * @brief Add an entry to the BLE white list. - * @param [in] address The address to add to the white list. - */ -void BLEDevice::whiteListAdd(BLEAddress address) { - log_v(">> whiteListAdd: %s", address.toString().c_str()); - esp_err_t errRc = esp_ble_gap_update_whitelist(true, *address.getNative()); // True to add an entry. - if (errRc != ESP_OK) { - log_e("esp_ble_gap_update_whitelist: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - } - log_v("<< whiteListAdd"); -} // whiteListAdd - - -/** - * @brief Remove an entry from the BLE white list. - * @param [in] address The address to remove from the white list. - */ -void BLEDevice::whiteListRemove(BLEAddress address) { - log_v(">> whiteListRemove: %s", address.toString().c_str()); - esp_err_t errRc = esp_ble_gap_update_whitelist(false, *address.getNative()); // False to remove an entry. - if (errRc != ESP_OK) { - log_e("esp_ble_gap_update_whitelist: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - } - log_v("<< whiteListRemove"); -} // whiteListRemove - -/* - * @brief Set encryption level that will be negotiated with peer device durng connection - * @param [in] level Requested encryption level - */ -void BLEDevice::setEncryptionLevel(esp_ble_sec_act_t level) { - BLEDevice::m_securityLevel = level; -} - -/* - * @brief Set callbacks that will be used to handle encryption negotiation events and authentication events - * @param [in] cllbacks Pointer to BLESecurityCallbacks class callback - */ -void BLEDevice::setSecurityCallbacks(BLESecurityCallbacks* callbacks) { - BLEDevice::m_securityCallbacks = callbacks; -} - -/* - * @brief Setup local mtu that will be used to negotiate mtu during request from client peer - * @param [in] mtu Value to set local mtu, should be larger than 23 and lower or equal to 517 - */ -esp_err_t BLEDevice::setMTU(uint16_t mtu) { - log_v(">> setLocalMTU: %d", mtu); - esp_err_t err = esp_ble_gatt_set_local_mtu(mtu); - if (err == ESP_OK) { - m_localMTU = mtu; - } else { - log_e("can't set local mtu value: %d", mtu); - } - log_v("<< setLocalMTU"); - return err; -} - -/* - * @brief Get local MTU value set during mtu request or default value - */ -uint16_t BLEDevice::getMTU() { - return m_localMTU; -} - -bool BLEDevice::getInitialized() { - return initialized; -} - -BLEAdvertising* BLEDevice::getAdvertising() { - if(m_bleAdvertising == nullptr) { - m_bleAdvertising = new BLEAdvertising(); - log_i("create advertising"); - } - log_d("get advertising"); - return m_bleAdvertising; -} - -void BLEDevice::startAdvertising() { - log_v(">> startAdvertising"); - getAdvertising()->start(); - log_v("<< startAdvertising"); -} // startAdvertising - -/* multi connect support */ -/* requires a little more work */ -std::map BLEDevice::getPeerDevices(bool _client) { - return m_connectedClientsMap; -} - -BLEClient* BLEDevice::getClientByGattIf(uint16_t conn_id) { - return (BLEClient*)m_connectedClientsMap.find(conn_id)->second.peer_device; -} - -void BLEDevice::updatePeerDevice(void* peer, bool _client, uint16_t conn_id) { - log_d("update conn_id: %d, GATT role: %s", conn_id, _client? "client":"server"); - std::map::iterator it = m_connectedClientsMap.find(ESP_GATT_IF_NONE); - if (it != m_connectedClientsMap.end()) { - std::swap(m_connectedClientsMap[conn_id], it->second); - m_connectedClientsMap.erase(it); - }else{ - it = m_connectedClientsMap.find(conn_id); - if (it != m_connectedClientsMap.end()) { - conn_status_t _st = it->second; - _st.peer_device = peer; - std::swap(m_connectedClientsMap[conn_id], _st); - } - } -} - -void BLEDevice::addPeerDevice(void* peer, bool _client, uint16_t conn_id) { - log_i("add conn_id: %d, GATT role: %s", conn_id, _client? "client":"server"); - conn_status_t status = { - .peer_device = peer, - .connected = true, - .mtu = 23 - }; - - m_connectedClientsMap.insert(std::pair(conn_id, status)); -} - -void BLEDevice::removePeerDevice(uint16_t conn_id, bool _client) { - log_i("remove: %d, GATT role %s", conn_id, _client?"client":"server"); - if(m_connectedClientsMap.find(conn_id) != m_connectedClientsMap.end()) - m_connectedClientsMap.erase(conn_id); -} - -/* multi connect support */ - -/** - * @brief de-Initialize the %BLE environment. - * @param release_memory release the internal BT stack memory - */ -/* STATIC */ void BLEDevice::deinit(bool release_memory) { - if (!initialized) return; - - esp_bluedroid_disable(); - esp_bluedroid_deinit(); - esp_bt_controller_disable(); - esp_bt_controller_deinit(); -#ifdef ARDUINO_ARCH_ESP32 - if (release_memory) { - esp_bt_controller_mem_release(ESP_BT_MODE_BTDM); // <-- require tests because we released classic BT memory and this can cause crash (most likely not, esp-idf takes care of it) - } else { - initialized = false; - } -#endif -} - -void BLEDevice::setCustomGapHandler(gap_event_handler handler) { - m_customGapHandler = handler; -} - -void BLEDevice::setCustomGattcHandler(gattc_event_handler handler) { - m_customGattcHandler = handler; -} - -void BLEDevice::setCustomGattsHandler(gatts_event_handler handler) { - m_customGattsHandler = handler; -} - -#endif // CONFIG_BT_ENABLED diff --git a/libraries/BLE/src/BLEDevice.h b/libraries/BLE/src/BLEDevice.h deleted file mode 100644 index e9cd40a34a2..00000000000 --- a/libraries/BLE/src/BLEDevice.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * BLEDevice.h - * - * Created on: Mar 16, 2017 - * Author: kolban - */ - -#ifndef MAIN_BLEDevice_H_ -#define MAIN_BLEDevice_H_ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include // ESP32 BLE -#include // ESP32 BLE -#include // Part of C++ STL -#include -#include - -#include "BLEServer.h" -#include "BLEClient.h" -#include "BLEUtils.h" -#include "BLEScan.h" -#include "BLEAddress.h" - -/** - * @brief BLE functions. - */ -typedef void (*gap_event_handler)(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t* param); -typedef void (*gattc_event_handler)(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t* param); -typedef void (*gatts_event_handler)(esp_gatts_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gatts_cb_param_t* param); - -class BLEDevice { -public: - - static BLEClient* createClient(); // Create a new BLE client. - static BLEServer* createServer(); // Cretae a new BLE server. - static BLEAddress getAddress(); // Retrieve our own local BD address. - static BLEScan* getScan(); // Get the scan object - static std::string getValue(BLEAddress bdAddress, BLEUUID serviceUUID, BLEUUID characteristicUUID); // Get the value of a characteristic of a service on a server. - static void init(std::string deviceName); // Initialize the local BLE environment. - static void setPower(esp_power_level_t powerLevel); // Set our power level. - static void setValue(BLEAddress bdAddress, BLEUUID serviceUUID, BLEUUID characteristicUUID, std::string value); // Set the value of a characteristic on a service on a server. - static std::string toString(); // Return a string representation of our device. - static void whiteListAdd(BLEAddress address); // Add an entry to the BLE white list. - static void whiteListRemove(BLEAddress address); // Remove an entry from the BLE white list. - static void setEncryptionLevel(esp_ble_sec_act_t level); - static void setSecurityCallbacks(BLESecurityCallbacks* pCallbacks); - static esp_err_t setMTU(uint16_t mtu); - static uint16_t getMTU(); - static bool getInitialized(); // Returns the state of the device, is it initialized or not? - /* move advertising to BLEDevice for saving ram and flash in beacons */ - static BLEAdvertising* getAdvertising(); - static void startAdvertising(); - static uint16_t m_appId; - /* multi connect */ - static std::map getPeerDevices(bool client); - static void addPeerDevice(void* peer, bool is_client, uint16_t conn_id); - static void updatePeerDevice(void* peer, bool _client, uint16_t conn_id); - static void removePeerDevice(uint16_t conn_id, bool client); - static BLEClient* getClientByGattIf(uint16_t conn_id); - static void setCustomGapHandler(gap_event_handler handler); - static void setCustomGattcHandler(gattc_event_handler handler); - static void setCustomGattsHandler(gatts_event_handler handler); - static void deinit(bool release_memory = false); - static uint16_t m_localMTU; - static esp_ble_sec_act_t m_securityLevel; - -private: - static BLEServer* m_pServer; - static BLEScan* m_pScan; - static BLEClient* m_pClient; - static BLESecurityCallbacks* m_securityCallbacks; - static BLEAdvertising* m_bleAdvertising; - static esp_gatt_if_t getGattcIF(); - static std::map m_connectedClientsMap; - - static void gattClientEventHandler( - esp_gattc_cb_event_t event, - esp_gatt_if_t gattc_if, - esp_ble_gattc_cb_param_t* param); - - static void gattServerEventHandler( - esp_gatts_cb_event_t event, - esp_gatt_if_t gatts_if, - esp_ble_gatts_cb_param_t* param); - - static void gapEventHandler( - esp_gap_ble_cb_event_t event, - esp_ble_gap_cb_param_t* param); - -public: -/* custom gap and gatt handlers for flexibility */ - static gap_event_handler m_customGapHandler; - static gattc_event_handler m_customGattcHandler; - static gatts_event_handler m_customGattsHandler; - -}; // class BLE - -#endif // CONFIG_BT_ENABLED -#endif /* MAIN_BLEDevice_H_ */ diff --git a/libraries/BLE/src/BLEEddystoneTLM.cpp b/libraries/BLE/src/BLEEddystoneTLM.cpp deleted file mode 100644 index 1ab794932e2..00000000000 --- a/libraries/BLE/src/BLEEddystoneTLM.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/* - * BLEEddystoneTLM.cpp - * - * Created on: Mar 12, 2018 - * Author: pcbreflux - */ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include -#include -#include "esp32-hal-log.h" -#include "BLEEddystoneTLM.h" - -static const char LOG_TAG[] = "BLEEddystoneTLM"; -#define ENDIAN_CHANGE_U16(x) ((((x)&0xFF00)>>8) + (((x)&0xFF)<<8)) -#define ENDIAN_CHANGE_U32(x) ((((x)&0xFF000000)>>24) + (((x)&0x00FF0000)>>8)) + ((((x)&0xFF00)<<8) + (((x)&0xFF)<<24)) - -BLEEddystoneTLM::BLEEddystoneTLM() { - beaconUUID = 0xFEAA; - m_eddystoneData.frameType = EDDYSTONE_TLM_FRAME_TYPE; - m_eddystoneData.version = 0; - m_eddystoneData.volt = 3300; // 3300mV = 3.3V - m_eddystoneData.temp = (uint16_t) ((float) 23.00); - m_eddystoneData.advCount = 0; - m_eddystoneData.tmil = 0; -} // BLEEddystoneTLM - -std::string BLEEddystoneTLM::getData() { - return std::string((char*) &m_eddystoneData, sizeof(m_eddystoneData)); -} // getData - -BLEUUID BLEEddystoneTLM::getUUID() { - return BLEUUID(beaconUUID); -} // getUUID - -uint8_t BLEEddystoneTLM::getVersion() { - return m_eddystoneData.version; -} // getVersion - -uint16_t BLEEddystoneTLM::getVolt() { - return m_eddystoneData.volt; -} // getVolt - -float BLEEddystoneTLM::getTemp() { - return (float)m_eddystoneData.temp; -} // getTemp - -uint32_t BLEEddystoneTLM::getCount() { - return m_eddystoneData.advCount; -} // getCount - -uint32_t BLEEddystoneTLM::getTime() { - return m_eddystoneData.tmil; -} // getTime - -std::string BLEEddystoneTLM::toString() { - std::string out = ""; - uint32_t rawsec = ENDIAN_CHANGE_U32(m_eddystoneData.tmil); - char val[6]; - - out += "Version " + m_eddystoneData.version; - out += "\n"; - out += "Battery Voltage " + ENDIAN_CHANGE_U16(m_eddystoneData.volt); - out += " mV\n"; - - out += "Temperature "; - snprintf(val, sizeof(val), "%d", m_eddystoneData.temp); - out += val; - out += ".0 °C\n"; - - out += "Adv. Count "; - snprintf(val, sizeof(val), "%d", ENDIAN_CHANGE_U32(m_eddystoneData.advCount)); - out += val; - out += "\n"; - - out += "Time "; - - snprintf(val, sizeof(val), "%04d", rawsec / 864000); - out += val; - out += "."; - - snprintf(val, sizeof(val), "%02d", (rawsec / 36000) % 24); - out += val; - out += ":"; - - snprintf(val, sizeof(val), "%02d", (rawsec / 600) % 60); - out += val; - out += ":"; - - snprintf(val, sizeof(val), "%02d", (rawsec / 10) % 60); - out += val; - out += "\n"; - - return out; -} // toString - -/** - * Set the raw data for the beacon record. - */ -void BLEEddystoneTLM::setData(std::string data) { - if (data.length() != sizeof(m_eddystoneData)) { - log_e("Unable to set the data ... length passed in was %d and expected %d", data.length(), sizeof(m_eddystoneData)); - return; - } - memcpy(&m_eddystoneData, data.data(), data.length()); -} // setData - -void BLEEddystoneTLM::setUUID(BLEUUID l_uuid) { - beaconUUID = l_uuid.getNative()->uuid.uuid16; -} // setUUID - -void BLEEddystoneTLM::setVersion(uint8_t version) { - m_eddystoneData.version = version; -} // setVersion - -void BLEEddystoneTLM::setVolt(uint16_t volt) { - m_eddystoneData.volt = volt; -} // setVolt - -void BLEEddystoneTLM::setTemp(float temp) { - m_eddystoneData.temp = (uint16_t)temp; -} // setTemp - -void BLEEddystoneTLM::setCount(uint32_t advCount) { - m_eddystoneData.advCount = advCount; -} // setCount - -void BLEEddystoneTLM::setTime(uint32_t tmil) { - m_eddystoneData.tmil = tmil; -} // setTime - -#endif diff --git a/libraries/BLE/src/BLEEddystoneTLM.h b/libraries/BLE/src/BLEEddystoneTLM.h deleted file mode 100644 index a93e224fdf0..00000000000 --- a/libraries/BLE/src/BLEEddystoneTLM.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * BLEEddystoneTLM.cpp - * - * Created on: Mar 12, 2018 - * Author: pcbreflux - */ - -#ifndef _BLEEddystoneTLM_H_ -#define _BLEEddystoneTLM_H_ -#include "BLEUUID.h" - -#define EDDYSTONE_TLM_FRAME_TYPE 0x20 - -/** - * @brief Representation of a beacon. - * See: - * * https://github.com/google/eddystone - */ -class BLEEddystoneTLM { -public: - BLEEddystoneTLM(); - std::string getData(); - BLEUUID getUUID(); - uint8_t getVersion(); - uint16_t getVolt(); - float getTemp(); - uint32_t getCount(); - uint32_t getTime(); - std::string toString(); - void setData(std::string data); - void setUUID(BLEUUID l_uuid); - void setVersion(uint8_t version); - void setVolt(uint16_t volt); - void setTemp(float temp); - void setCount(uint32_t advCount); - void setTime(uint32_t tmil); - -private: - uint16_t beaconUUID; - struct { - uint8_t frameType; - uint8_t version; - uint16_t volt; - uint16_t temp; - uint32_t advCount; - uint32_t tmil; - } __attribute__((packed)) m_eddystoneData; - -}; // BLEEddystoneTLM - -#endif /* _BLEEddystoneTLM_H_ */ diff --git a/libraries/BLE/src/BLEEddystoneURL.cpp b/libraries/BLE/src/BLEEddystoneURL.cpp deleted file mode 100644 index 19a56b28b79..00000000000 --- a/libraries/BLE/src/BLEEddystoneURL.cpp +++ /dev/null @@ -1,148 +0,0 @@ -/* - * BLEEddystoneURL.cpp - * - * Created on: Mar 12, 2018 - * Author: pcbreflux - */ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include -#include "esp32-hal-log.h" -#include "BLEEddystoneURL.h" - -static const char LOG_TAG[] = "BLEEddystoneURL"; - -BLEEddystoneURL::BLEEddystoneURL() { - beaconUUID = 0xFEAA; - lengthURL = 0; - m_eddystoneData.frameType = EDDYSTONE_URL_FRAME_TYPE; - m_eddystoneData.advertisedTxPower = 0; - memset(m_eddystoneData.url, 0, sizeof(m_eddystoneData.url)); -} // BLEEddystoneURL - -std::string BLEEddystoneURL::getData() { - return std::string((char*) &m_eddystoneData, sizeof(m_eddystoneData)); -} // getData - -BLEUUID BLEEddystoneURL::getUUID() { - return BLEUUID(beaconUUID); -} // getUUID - -int8_t BLEEddystoneURL::getPower() { - return m_eddystoneData.advertisedTxPower; -} // getPower - -std::string BLEEddystoneURL::getURL() { - return std::string((char*) &m_eddystoneData.url, sizeof(m_eddystoneData.url)); -} // getURL - -std::string BLEEddystoneURL::getDecodedURL() { - std::string decodedURL = ""; - - switch (m_eddystoneData.url[0]) { - case 0x00: - decodedURL += "http://www."; - break; - case 0x01: - decodedURL += "https://www."; - break; - case 0x02: - decodedURL += "http://"; - break; - case 0x03: - decodedURL += "https://"; - break; - default: - decodedURL += m_eddystoneData.url[0]; - } - - for (int i = 1; i < lengthURL; i++) { - if (m_eddystoneData.url[i] > 33 && m_eddystoneData.url[i] < 127) { - decodedURL += m_eddystoneData.url[i]; - } else { - switch (m_eddystoneData.url[i]) { - case 0x00: - decodedURL += ".com/"; - break; - case 0x01: - decodedURL += ".org/"; - break; - case 0x02: - decodedURL += ".edu/"; - break; - case 0x03: - decodedURL += ".net/"; - break; - case 0x04: - decodedURL += ".info/"; - break; - case 0x05: - decodedURL += ".biz/"; - break; - case 0x06: - decodedURL += ".gov/"; - break; - case 0x07: - decodedURL += ".com"; - break; - case 0x08: - decodedURL += ".org"; - break; - case 0x09: - decodedURL += ".edu"; - break; - case 0x0A: - decodedURL += ".net"; - break; - case 0x0B: - decodedURL += ".info"; - break; - case 0x0C: - decodedURL += ".biz"; - break; - case 0x0D: - decodedURL += ".gov"; - break; - default: - break; - } - } - } - return decodedURL; -} // getDecodedURL - - - -/** - * Set the raw data for the beacon record. - */ -void BLEEddystoneURL::setData(std::string data) { - if (data.length() > sizeof(m_eddystoneData)) { - log_e("Unable to set the data ... length passed in was %d and max expected %d", data.length(), sizeof(m_eddystoneData)); - return; - } - memset(&m_eddystoneData, 0, sizeof(m_eddystoneData)); - memcpy(&m_eddystoneData, data.data(), data.length()); - lengthURL = data.length() - (sizeof(m_eddystoneData) - sizeof(m_eddystoneData.url)); -} // setData - -void BLEEddystoneURL::setUUID(BLEUUID l_uuid) { - beaconUUID = l_uuid.getNative()->uuid.uuid16; -} // setUUID - -void BLEEddystoneURL::setPower(int8_t advertisedTxPower) { - m_eddystoneData.advertisedTxPower = advertisedTxPower; -} // setPower - -void BLEEddystoneURL::setURL(std::string url) { - if (url.length() > sizeof(m_eddystoneData.url)) { - log_e("Unable to set the url ... length passed in was %d and max expected %d", url.length(), sizeof(m_eddystoneData.url)); - return; - } - memset(m_eddystoneData.url, 0, sizeof(m_eddystoneData.url)); - memcpy(m_eddystoneData.url, url.data(), url.length()); - lengthURL = url.length(); -} // setURL - - -#endif diff --git a/libraries/BLE/src/BLEEddystoneURL.h b/libraries/BLE/src/BLEEddystoneURL.h deleted file mode 100644 index 0b538c07d00..00000000000 --- a/libraries/BLE/src/BLEEddystoneURL.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * BLEEddystoneURL.cpp - * - * Created on: Mar 12, 2018 - * Author: pcbreflux - */ - -#ifndef _BLEEddystoneURL_H_ -#define _BLEEddystoneURL_H_ -#include "BLEUUID.h" - -#define EDDYSTONE_URL_FRAME_TYPE 0x10 - -/** - * @brief Representation of a beacon. - * See: - * * https://github.com/google/eddystone - */ -class BLEEddystoneURL { -public: - BLEEddystoneURL(); - std::string getData(); - BLEUUID getUUID(); - int8_t getPower(); - std::string getURL(); - std::string getDecodedURL(); - void setData(std::string data); - void setUUID(BLEUUID l_uuid); - void setPower(int8_t advertisedTxPower); - void setURL(std::string url); - -private: - uint16_t beaconUUID; - uint8_t lengthURL; - struct { - uint8_t frameType; - int8_t advertisedTxPower; - uint8_t url[16]; - } __attribute__((packed)) m_eddystoneData; - -}; // BLEEddystoneURL - -#endif /* _BLEEddystoneURL_H_ */ diff --git a/libraries/BLE/src/BLEExceptions.cpp b/libraries/BLE/src/BLEExceptions.cpp deleted file mode 100644 index 549e4425bd8..00000000000 --- a/libraries/BLE/src/BLEExceptions.cpp +++ /dev/null @@ -1,9 +0,0 @@ -/* - * BLExceptions.cpp - * - * Created on: Nov 27, 2017 - * Author: kolban - */ - -//#include "BLEExceptions.h" - diff --git a/libraries/BLE/src/BLEExceptions.h b/libraries/BLE/src/BLEExceptions.h deleted file mode 100644 index ea9db8550bc..00000000000 --- a/libraries/BLE/src/BLEExceptions.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * BLExceptions.h - * - * Created on: Nov 27, 2017 - * Author: kolban - */ - -#ifndef COMPONENTS_CPP_UTILS_BLEEXCEPTIONS_H_ -#define COMPONENTS_CPP_UTILS_BLEEXCEPTIONS_H_ -#include "sdkconfig.h" - -#if CONFIG_CXX_EXCEPTIONS != 1 -#error "C++ exception handling must be enabled within make menuconfig. See Compiler Options > Enable C++ Exceptions." -#endif - -#include - - -class BLEDisconnectedException : public std::exception { - const char* what() const throw () { - return "BLE Disconnected"; - } -}; - -class BLEUuidNotFoundException : public std::exception { - const char* what() const throw () { - return "No such UUID"; - } -}; - -#endif /* COMPONENTS_CPP_UTILS_BLEEXCEPTIONS_H_ */ diff --git a/libraries/BLE/src/BLEHIDDevice.cpp b/libraries/BLE/src/BLEHIDDevice.cpp deleted file mode 100644 index 69e18be7a5f..00000000000 --- a/libraries/BLE/src/BLEHIDDevice.cpp +++ /dev/null @@ -1,243 +0,0 @@ -/* - * BLEHIDDevice.cpp - * - * Created on: Jan 03, 2018 - * Author: chegewara - */ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) - -#include "BLEHIDDevice.h" -#include "BLE2904.h" - - -BLEHIDDevice::BLEHIDDevice(BLEServer* server) { - /* - * Here we create mandatory services described in bluetooth specification - */ - m_deviceInfoService = server->createService(BLEUUID((uint16_t) 0x180a)); - m_hidService = server->createService(BLEUUID((uint16_t) 0x1812), 40); - m_batteryService = server->createService(BLEUUID((uint16_t) 0x180f)); - - /* - * Mandatory characteristic for device info service - */ - m_pnpCharacteristic = m_deviceInfoService->createCharacteristic((uint16_t) 0x2a50, BLECharacteristic::PROPERTY_READ); - - /* - * Mandatory characteristics for HID service - */ - m_hidInfoCharacteristic = m_hidService->createCharacteristic((uint16_t) 0x2a4a, BLECharacteristic::PROPERTY_READ); - m_reportMapCharacteristic = m_hidService->createCharacteristic((uint16_t) 0x2a4b, BLECharacteristic::PROPERTY_READ); - m_hidControlCharacteristic = m_hidService->createCharacteristic((uint16_t) 0x2a4c, BLECharacteristic::PROPERTY_WRITE_NR); - m_protocolModeCharacteristic = m_hidService->createCharacteristic((uint16_t) 0x2a4e, BLECharacteristic::PROPERTY_WRITE_NR | BLECharacteristic::PROPERTY_READ); - - /* - * Mandatory battery level characteristic with notification and presence descriptor - */ - BLE2904* batteryLevelDescriptor = new BLE2904(); - batteryLevelDescriptor->setFormat(BLE2904::FORMAT_UINT8); - batteryLevelDescriptor->setNamespace(1); - batteryLevelDescriptor->setUnit(0x27ad); - - m_batteryLevelCharacteristic = m_batteryService->createCharacteristic((uint16_t) 0x2a19, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_NOTIFY); - m_batteryLevelCharacteristic->addDescriptor(batteryLevelDescriptor); - m_batteryLevelCharacteristic->addDescriptor(new BLE2902()); - - /* - * This value is setup here because its default value in most usage cases, its very rare to use boot mode - * and we want to simplify library using as much as possible - */ - const uint8_t pMode[] = { 0x01 }; - protocolMode()->setValue((uint8_t*) pMode, 1); -} - -BLEHIDDevice::~BLEHIDDevice() { -} - -/* - * @brief - */ -void BLEHIDDevice::reportMap(uint8_t* map, uint16_t size) { - m_reportMapCharacteristic->setValue(map, size); -} - -/* - * @brief This function suppose to be called at the end, when we have created all characteristics we need to build HID service - */ -void BLEHIDDevice::startServices() { - m_deviceInfoService->start(); - m_hidService->start(); - m_batteryService->start(); -} - -/* - * @brief Create manufacturer characteristic (this characteristic is optional) - */ -BLECharacteristic* BLEHIDDevice::manufacturer() { - m_manufacturerCharacteristic = m_deviceInfoService->createCharacteristic((uint16_t) 0x2a29, BLECharacteristic::PROPERTY_READ); - return m_manufacturerCharacteristic; -} - -/* - * @brief Set manufacturer name - * @param [in] name manufacturer name - */ -void BLEHIDDevice::manufacturer(std::string name) { - m_manufacturerCharacteristic->setValue(name); -} - -/* - * @brief - */ -void BLEHIDDevice::pnp(uint8_t sig, uint16_t vid, uint16_t pid, uint16_t version) { - uint8_t pnp[] = { sig, (uint8_t) (vid >> 8), (uint8_t) vid, (uint8_t) (pid >> 8), (uint8_t) pid, (uint8_t) (version >> 8), (uint8_t) version }; - m_pnpCharacteristic->setValue(pnp, sizeof(pnp)); -} - -/* - * @brief - */ -void BLEHIDDevice::hidInfo(uint8_t country, uint8_t flags) { - uint8_t info[] = { 0x11, 0x1, country, flags }; - m_hidInfoCharacteristic->setValue(info, sizeof(info)); -} - -/* - * @brief Create input report characteristic that need to be saved as new characteristic object so can be further used - * @param [in] reportID input report ID, the same as in report map for input object related to created characteristic - * @return pointer to new input report characteristic - */ -BLECharacteristic* BLEHIDDevice::inputReport(uint8_t reportID) { - BLECharacteristic* inputReportCharacteristic = m_hidService->createCharacteristic((uint16_t) 0x2a4d, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_NOTIFY); - BLEDescriptor* inputReportDescriptor = new BLEDescriptor(BLEUUID((uint16_t) 0x2908)); - BLE2902* p2902 = new BLE2902(); - inputReportCharacteristic->setAccessPermissions(ESP_GATT_PERM_READ_ENCRYPTED | ESP_GATT_PERM_WRITE_ENCRYPTED); - inputReportDescriptor->setAccessPermissions(ESP_GATT_PERM_READ_ENCRYPTED | ESP_GATT_PERM_WRITE_ENCRYPTED); - p2902->setAccessPermissions(ESP_GATT_PERM_READ_ENCRYPTED | ESP_GATT_PERM_WRITE_ENCRYPTED); - - uint8_t desc1_val[] = { reportID, 0x01 }; - inputReportDescriptor->setValue((uint8_t*) desc1_val, 2); - inputReportCharacteristic->addDescriptor(p2902); - inputReportCharacteristic->addDescriptor(inputReportDescriptor); - - return inputReportCharacteristic; -} - -/* - * @brief Create output report characteristic that need to be saved as new characteristic object so can be further used - * @param [in] reportID Output report ID, the same as in report map for output object related to created characteristic - * @return Pointer to new output report characteristic - */ -BLECharacteristic* BLEHIDDevice::outputReport(uint8_t reportID) { - BLECharacteristic* outputReportCharacteristic = m_hidService->createCharacteristic((uint16_t) 0x2a4d, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_WRITE_NR); - BLEDescriptor* outputReportDescriptor = new BLEDescriptor(BLEUUID((uint16_t) 0x2908)); - outputReportCharacteristic->setAccessPermissions(ESP_GATT_PERM_READ_ENCRYPTED | ESP_GATT_PERM_WRITE_ENCRYPTED); - outputReportDescriptor->setAccessPermissions(ESP_GATT_PERM_READ_ENCRYPTED | ESP_GATT_PERM_WRITE_ENCRYPTED); - - uint8_t desc1_val[] = { reportID, 0x02 }; - outputReportDescriptor->setValue((uint8_t*) desc1_val, 2); - outputReportCharacteristic->addDescriptor(outputReportDescriptor); - - return outputReportCharacteristic; -} - -/* - * @brief Create feature report characteristic that need to be saved as new characteristic object so can be further used - * @param [in] reportID Feature report ID, the same as in report map for feature object related to created characteristic - * @return Pointer to new feature report characteristic - */ -BLECharacteristic* BLEHIDDevice::featureReport(uint8_t reportID) { - BLECharacteristic* featureReportCharacteristic = m_hidService->createCharacteristic((uint16_t) 0x2a4d, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE); - BLEDescriptor* featureReportDescriptor = new BLEDescriptor(BLEUUID((uint16_t) 0x2908)); - - featureReportCharacteristic->setAccessPermissions(ESP_GATT_PERM_READ_ENCRYPTED | ESP_GATT_PERM_WRITE_ENCRYPTED); - featureReportDescriptor->setAccessPermissions(ESP_GATT_PERM_READ_ENCRYPTED | ESP_GATT_PERM_WRITE_ENCRYPTED); - - uint8_t desc1_val[] = { reportID, 0x03 }; - featureReportDescriptor->setValue((uint8_t*) desc1_val, 2); - featureReportCharacteristic->addDescriptor(featureReportDescriptor); - - return featureReportCharacteristic; -} - -/* - * @brief - */ -BLECharacteristic* BLEHIDDevice::bootInput() { - BLECharacteristic* bootInputCharacteristic = m_hidService->createCharacteristic((uint16_t) 0x2a22, BLECharacteristic::PROPERTY_NOTIFY); - bootInputCharacteristic->addDescriptor(new BLE2902()); - - return bootInputCharacteristic; -} - -/* - * @brief - */ -BLECharacteristic* BLEHIDDevice::bootOutput() { - return m_hidService->createCharacteristic((uint16_t) 0x2a32, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_WRITE_NR); -} - -/* - * @brief - */ -BLECharacteristic* BLEHIDDevice::hidControl() { - return m_hidControlCharacteristic; -} - -/* - * @brief - */ -BLECharacteristic* BLEHIDDevice::protocolMode() { - return m_protocolModeCharacteristic; -} - -void BLEHIDDevice::setBatteryLevel(uint8_t level) { - m_batteryLevelCharacteristic->setValue(&level, 1); -} -/* - * @brief Returns battery level characteristic - * @ return battery level characteristic - *//* -BLECharacteristic* BLEHIDDevice::batteryLevel() { - return m_batteryLevelCharacteristic; -} - - - -BLECharacteristic* BLEHIDDevice::reportMap() { - return m_reportMapCharacteristic; -} - -BLECharacteristic* BLEHIDDevice::pnp() { - return m_pnpCharacteristic; -} - - -BLECharacteristic* BLEHIDDevice::hidInfo() { - return m_hidInfoCharacteristic; -} -*/ -/* - * @brief - */ -BLEService* BLEHIDDevice::deviceInfo() { - return m_deviceInfoService; -} - -/* - * @brief - */ -BLEService* BLEHIDDevice::hidService() { - return m_hidService; -} - -/* - * @brief - */ -BLEService* BLEHIDDevice::batteryService() { - return m_batteryService; -} - -#endif // CONFIG_BT_ENABLED - diff --git a/libraries/BLE/src/BLEHIDDevice.h b/libraries/BLE/src/BLEHIDDevice.h deleted file mode 100644 index 33e6b46c540..00000000000 --- a/libraries/BLE/src/BLEHIDDevice.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * BLEHIDDevice.h - * - * Created on: Jan 03, 2018 - * Author: chegewara - */ - -#ifndef _BLEHIDDEVICE_H_ -#define _BLEHIDDEVICE_H_ - -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) - -#include "BLECharacteristic.h" -#include "BLEService.h" -#include "BLEDescriptor.h" -#include "BLE2902.h" -#include "HIDTypes.h" - -#define GENERIC_HID 0x03C0 -#define HID_KEYBOARD 0x03C1 -#define HID_MOUSE 0x03C2 -#define HID_JOYSTICK 0x03C3 -#define HID_GAMEPAD 0x03C4 -#define HID_TABLET 0x03C5 -#define HID_CARD_READER 0x03C6 -#define HID_DIGITAL_PEN 0x03C7 -#define HID_BARCODE 0x03C8 - -class BLEHIDDevice { -public: - BLEHIDDevice(BLEServer*); - virtual ~BLEHIDDevice(); - - void reportMap(uint8_t* map, uint16_t); - void startServices(); - - BLEService* deviceInfo(); - BLEService* hidService(); - BLEService* batteryService(); - - BLECharacteristic* manufacturer(); - void manufacturer(std::string name); - //BLECharacteristic* pnp(); - void pnp(uint8_t sig, uint16_t vid, uint16_t pid, uint16_t version); - //BLECharacteristic* hidInfo(); - void hidInfo(uint8_t country, uint8_t flags); - //BLECharacteristic* batteryLevel(); - void setBatteryLevel(uint8_t level); - - - //BLECharacteristic* reportMap(); - BLECharacteristic* hidControl(); - BLECharacteristic* inputReport(uint8_t reportID); - BLECharacteristic* outputReport(uint8_t reportID); - BLECharacteristic* featureReport(uint8_t reportID); - BLECharacteristic* protocolMode(); - BLECharacteristic* bootInput(); - BLECharacteristic* bootOutput(); - -private: - BLEService* m_deviceInfoService; //0x180a - BLEService* m_hidService; //0x1812 - BLEService* m_batteryService = 0; //0x180f - - BLECharacteristic* m_manufacturerCharacteristic; //0x2a29 - BLECharacteristic* m_pnpCharacteristic; //0x2a50 - BLECharacteristic* m_hidInfoCharacteristic; //0x2a4a - BLECharacteristic* m_reportMapCharacteristic; //0x2a4b - BLECharacteristic* m_hidControlCharacteristic; //0x2a4c - BLECharacteristic* m_protocolModeCharacteristic; //0x2a4e - BLECharacteristic* m_batteryLevelCharacteristic; //0x2a19 -}; -#endif // CONFIG_BT_ENABLED -#endif /* _BLEHIDDEVICE_H_ */ diff --git a/libraries/BLE/src/BLERemoteCharacteristic.cpp b/libraries/BLE/src/BLERemoteCharacteristic.cpp deleted file mode 100644 index 840076f8f2f..00000000000 --- a/libraries/BLE/src/BLERemoteCharacteristic.cpp +++ /dev/null @@ -1,587 +0,0 @@ -/* - * BLERemoteCharacteristic.cpp - * - * Created on: Jul 8, 2017 - * Author: kolban - */ - -#include "BLERemoteCharacteristic.h" - -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) - -#include -#include - -#include -//#include "BLEExceptions.h" -#include "BLEUtils.h" -#include "GeneralUtils.h" -#include "BLERemoteDescriptor.h" -#include "esp32-hal-log.h" - - -/** - * @brief Constructor. - * @param [in] handle The BLE server side handle of this characteristic. - * @param [in] uuid The UUID of this characteristic. - * @param [in] charProp The properties of this characteristic. - * @param [in] pRemoteService A reference to the remote service to which this remote characteristic pertains. - */ -BLERemoteCharacteristic::BLERemoteCharacteristic( - uint16_t handle, - BLEUUID uuid, - esp_gatt_char_prop_t charProp, - BLERemoteService* pRemoteService) { - log_v(">> BLERemoteCharacteristic: handle: %d 0x%d, uuid: %s", handle, handle, uuid.toString().c_str()); - m_handle = handle; - m_uuid = uuid; - m_charProp = charProp; - m_pRemoteService = pRemoteService; - m_notifyCallback = nullptr; - m_rawData = nullptr; - - retrieveDescriptors(); // Get the descriptors for this characteristic - log_v("<< BLERemoteCharacteristic"); -} // BLERemoteCharacteristic - - -/** - *@brief Destructor. - */ -BLERemoteCharacteristic::~BLERemoteCharacteristic() { - removeDescriptors(); // Release resources for any descriptor information we may have allocated. -} // ~BLERemoteCharacteristic - - -/** - * @brief Does the characteristic support broadcasting? - * @return True if the characteristic supports broadcasting. - */ -bool BLERemoteCharacteristic::canBroadcast() { - return (m_charProp & ESP_GATT_CHAR_PROP_BIT_BROADCAST) != 0; -} // canBroadcast - - -/** - * @brief Does the characteristic support indications? - * @return True if the characteristic supports indications. - */ -bool BLERemoteCharacteristic::canIndicate() { - return (m_charProp & ESP_GATT_CHAR_PROP_BIT_INDICATE) != 0; -} // canIndicate - - -/** - * @brief Does the characteristic support notifications? - * @return True if the characteristic supports notifications. - */ -bool BLERemoteCharacteristic::canNotify() { - return (m_charProp & ESP_GATT_CHAR_PROP_BIT_NOTIFY) != 0; -} // canNotify - - -/** - * @brief Does the characteristic support reading? - * @return True if the characteristic supports reading. - */ -bool BLERemoteCharacteristic::canRead() { - return (m_charProp & ESP_GATT_CHAR_PROP_BIT_READ) != 0; -} // canRead - - -/** - * @brief Does the characteristic support writing? - * @return True if the characteristic supports writing. - */ -bool BLERemoteCharacteristic::canWrite() { - return (m_charProp & ESP_GATT_CHAR_PROP_BIT_WRITE) != 0; -} // canWrite - - -/** - * @brief Does the characteristic support writing with no response? - * @return True if the characteristic supports writing with no response. - */ -bool BLERemoteCharacteristic::canWriteNoResponse() { - return (m_charProp & ESP_GATT_CHAR_PROP_BIT_WRITE_NR) != 0; -} // canWriteNoResponse - - -/* -static bool compareSrvcId(esp_gatt_srvc_id_t id1, esp_gatt_srvc_id_t id2) { - if (id1.id.inst_id != id2.id.inst_id) { - return false; - } - if (!BLEUUID(id1.id.uuid).equals(BLEUUID(id2.id.uuid))) { - return false; - } - return true; -} // compareSrvcId -*/ - -/* -static bool compareGattId(esp_gatt_id_t id1, esp_gatt_id_t id2) { - if (id1.inst_id != id2.inst_id) { - return false; - } - if (!BLEUUID(id1.uuid).equals(BLEUUID(id2.uuid))) { - return false; - } - return true; -} // compareCharId -*/ - - -/** - * @brief Handle GATT Client events. - * When an event arrives for a GATT client we give this characteristic the opportunity to - * take a look at it to see if there is interest in it. - * @param [in] event The type of event. - * @param [in] gattc_if The interface on which the event was received. - * @param [in] evtParam Payload data for the event. - * @returns N/A - */ -void BLERemoteCharacteristic::gattClientEventHandler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t* evtParam) { - switch(event) { - // ESP_GATTC_NOTIFY_EVT - // - // notify - // - uint16_t conn_id - The connection identifier of the server. - // - esp_bd_addr_t remote_bda - The device address of the BLE server. - // - uint16_t handle - The handle of the characteristic for which the event is being received. - // - uint16_t value_len - The length of the received data. - // - uint8_t* value - The received data. - // - bool is_notify - True if this is a notify, false if it is an indicate. - // - // We have received a notification event which means that the server wishes us to know about a notification - // piece of data. What we must now do is find the characteristic with the associated handle and then - // invoke its notification callback (if it has one). - case ESP_GATTC_NOTIFY_EVT: { - if (evtParam->notify.handle != getHandle()) break; - if (m_notifyCallback != nullptr) { - log_d("Invoking callback for notification on characteristic %s", toString().c_str()); - m_notifyCallback(this, evtParam->notify.value, evtParam->notify.value_len, evtParam->notify.is_notify); - } // End we have a callback function ... - break; - } // ESP_GATTC_NOTIFY_EVT - - // ESP_GATTC_READ_CHAR_EVT - // This event indicates that the server has responded to the read request. - // - // read: - // - esp_gatt_status_t status - // - uint16_t conn_id - // - uint16_t handle - // - uint8_t* value - // - uint16_t value_len - case ESP_GATTC_READ_CHAR_EVT: { - // If this event is not for us, then nothing further to do. - if (evtParam->read.handle != getHandle()) break; - - // At this point, we have determined that the event is for us, so now we save the value - // and unlock the semaphore to ensure that the requestor of the data can continue. - if (evtParam->read.status == ESP_GATT_OK) { - m_value = std::string((char*) evtParam->read.value, evtParam->read.value_len); - if(m_rawData != nullptr) free(m_rawData); - m_rawData = (uint8_t*) calloc(evtParam->read.value_len, sizeof(uint8_t)); - memcpy(m_rawData, evtParam->read.value, evtParam->read.value_len); - } else { - m_value = ""; - } - - m_semaphoreReadCharEvt.give(); - break; - } // ESP_GATTC_READ_CHAR_EVT - - // ESP_GATTC_REG_FOR_NOTIFY_EVT - // - // reg_for_notify: - // - esp_gatt_status_t status - // - uint16_t handle - case ESP_GATTC_REG_FOR_NOTIFY_EVT: { - // If the request is not for this BLERemoteCharacteristic then move on to the next. - if (evtParam->reg_for_notify.handle != getHandle()) break; - - // We have processed the notify registration and can unlock the semaphore. - m_semaphoreRegForNotifyEvt.give(); - break; - } // ESP_GATTC_REG_FOR_NOTIFY_EVT - - // ESP_GATTC_UNREG_FOR_NOTIFY_EVT - // - // unreg_for_notify: - // - esp_gatt_status_t status - // - uint16_t handle - case ESP_GATTC_UNREG_FOR_NOTIFY_EVT: { - if (evtParam->unreg_for_notify.handle != getHandle()) break; - // We have processed the notify un-registration and can unlock the semaphore. - m_semaphoreRegForNotifyEvt.give(); - break; - } // ESP_GATTC_UNREG_FOR_NOTIFY_EVT: - - // ESP_GATTC_WRITE_CHAR_EVT - // - // write: - // - esp_gatt_status_t status - // - uint16_t conn_id - // - uint16_t handle - case ESP_GATTC_WRITE_CHAR_EVT: { - // Determine if this event is for us and, if not, pass onwards. - if (evtParam->write.handle != getHandle()) break; - - // There is nothing further we need to do here. This is merely an indication - // that the write has completed and we can unlock the caller. - m_semaphoreWriteCharEvt.give(); - break; - } // ESP_GATTC_WRITE_CHAR_EVT - - - default: - break; - } // End switch -}; // gattClientEventHandler - - -/** - * @brief Populate the descriptors (if any) for this characteristic. - */ -void BLERemoteCharacteristic::retrieveDescriptors() { - log_v(">> retrieveDescriptors() for characteristic: %s", getUUID().toString().c_str()); - - removeDescriptors(); // Remove any existing descriptors. - - // Loop over each of the descriptors within the service associated with this characteristic. - // For each descriptor we find, create a BLERemoteDescriptor instance. - uint16_t offset = 0; - esp_gattc_descr_elem_t result; - while(true) { - uint16_t count = 10; - esp_gatt_status_t status = ::esp_ble_gattc_get_all_descr( - getRemoteService()->getClient()->getGattcIf(), - getRemoteService()->getClient()->getConnId(), - getHandle(), - &result, - &count, - offset - ); - - if (status == ESP_GATT_INVALID_OFFSET) { // We have reached the end of the entries. - break; - } - - if (status != ESP_GATT_OK) { - log_e("esp_ble_gattc_get_all_descr: %s", BLEUtils::gattStatusToString(status).c_str()); - break; - } - - if (count == 0) break; - - log_d("Found a descriptor: Handle: %d, UUID: %s", result.handle, BLEUUID(result.uuid).toString().c_str()); - - // We now have a new characteristic ... let us add that to our set of known characteristics - BLERemoteDescriptor* pNewRemoteDescriptor = new BLERemoteDescriptor( - result.handle, - BLEUUID(result.uuid), - this - ); - - m_descriptorMap.insert(std::pair(pNewRemoteDescriptor->getUUID().toString(), pNewRemoteDescriptor)); - - offset++; - } // while true - //m_haveCharacteristics = true; // Remember that we have received the characteristics. - log_v("<< retrieveDescriptors(): Found %d descriptors.", offset); -} // getDescriptors - - -/** - * @brief Retrieve the map of descriptors keyed by UUID. - */ -std::map* BLERemoteCharacteristic::getDescriptors() { - return &m_descriptorMap; -} // getDescriptors - - -/** - * @brief Get the handle for this characteristic. - * @return The handle for this characteristic. - */ -uint16_t BLERemoteCharacteristic::getHandle() { - //log_v(">> getHandle: Characteristic: %s", getUUID().toString().c_str()); - //log_v("<< getHandle: %d 0x%.2x", m_handle, m_handle); - return m_handle; -} // getHandle - - -/** - * @brief Get the descriptor instance with the given UUID that belongs to this characteristic. - * @param [in] uuid The UUID of the descriptor to find. - * @return The Remote descriptor (if present) or null if not present. - */ -BLERemoteDescriptor* BLERemoteCharacteristic::getDescriptor(BLEUUID uuid) { - log_v(">> getDescriptor: uuid: %s", uuid.toString().c_str()); - std::string v = uuid.toString(); - for (auto &myPair : m_descriptorMap) { - if (myPair.first == v) { - log_v("<< getDescriptor: found"); - return myPair.second; - } - } - log_v("<< getDescriptor: Not found"); - return nullptr; -} // getDescriptor - - -/** - * @brief Get the remote service associated with this characteristic. - * @return The remote service associated with this characteristic. - */ -BLERemoteService* BLERemoteCharacteristic::getRemoteService() { - return m_pRemoteService; -} // getRemoteService - - -/** - * @brief Get the UUID for this characteristic. - * @return The UUID for this characteristic. - */ -BLEUUID BLERemoteCharacteristic::getUUID() { - return m_uuid; -} // getUUID - - -/** - * @brief Read an unsigned 16 bit value - * @return The unsigned 16 bit value. - */ -uint16_t BLERemoteCharacteristic::readUInt16() { - std::string value = readValue(); - if (value.length() >= 2) { - return *(uint16_t*)(value.data()); - } - return 0; -} // readUInt16 - - -/** - * @brief Read an unsigned 32 bit value. - * @return the unsigned 32 bit value. - */ -uint32_t BLERemoteCharacteristic::readUInt32() { - std::string value = readValue(); - if (value.length() >= 4) { - return *(uint32_t*)(value.data()); - } - return 0; -} // readUInt32 - - -/** - * @brief Read a byte value - * @return The value as a byte - */ -uint8_t BLERemoteCharacteristic::readUInt8() { - std::string value = readValue(); - if (value.length() >= 1) { - return (uint8_t)value[0]; - } - return 0; -} // readUInt8 - - -/** - * @brief Read the value of the remote characteristic. - * @return The value of the remote characteristic. - */ -std::string BLERemoteCharacteristic::readValue() { - log_v(">> readValue(): uuid: %s, handle: %d 0x%.2x", getUUID().toString().c_str(), getHandle(), getHandle()); - - // Check to see that we are connected. - if (!getRemoteService()->getClient()->isConnected()) { - log_e("Disconnected"); - return std::string(); - } - - m_semaphoreReadCharEvt.take("readValue"); - - // Ask the BLE subsystem to retrieve the value for the remote hosted characteristic. - // This is an asynchronous request which means that we must block waiting for the response - // to become available. - esp_err_t errRc = ::esp_ble_gattc_read_char( - m_pRemoteService->getClient()->getGattcIf(), - m_pRemoteService->getClient()->getConnId(), // The connection ID to the BLE server - getHandle(), // The handle of this characteristic - ESP_GATT_AUTH_REQ_NONE); // Security - - if (errRc != ESP_OK) { - log_e("esp_ble_gattc_read_char: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return ""; - } - - // Block waiting for the event that indicates that the read has completed. When it has, the std::string found - // in m_value will contain our data. - m_semaphoreReadCharEvt.wait("readValue"); - - log_v("<< readValue(): length: %d", m_value.length()); - return m_value; -} // readValue - - -/** - * @brief Register for notifications. - * @param [in] notifyCallback A callback to be invoked for a notification. If NULL is provided then we are - * unregistering a notification. - * @return N/A. - */ -void BLERemoteCharacteristic::registerForNotify(notify_callback notifyCallback, bool notifications) { - log_v(">> registerForNotify(): %s", toString().c_str()); - - m_notifyCallback = notifyCallback; // Save the notification callback. - - m_semaphoreRegForNotifyEvt.take("registerForNotify"); - - if (notifyCallback != nullptr) { // If we have a callback function, then this is a registration. - esp_err_t errRc = ::esp_ble_gattc_register_for_notify( - m_pRemoteService->getClient()->getGattcIf(), - *m_pRemoteService->getClient()->getPeerAddress().getNative(), - getHandle() - ); - - if (errRc != ESP_OK) { - log_e("esp_ble_gattc_register_for_notify: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - } - - uint8_t val[] = {0x01, 0x00}; - if(!notifications) val[0] = 0x02; - BLERemoteDescriptor* desc = getDescriptor(BLEUUID((uint16_t)0x2902)); - desc->writeValue(val, 2); - } // End Register - else { // If we weren't passed a callback function, then this is an unregistration. - esp_err_t errRc = ::esp_ble_gattc_unregister_for_notify( - m_pRemoteService->getClient()->getGattcIf(), - *m_pRemoteService->getClient()->getPeerAddress().getNative(), - getHandle() - ); - - if (errRc != ESP_OK) { - log_e("esp_ble_gattc_unregister_for_notify: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - } - - uint8_t val[] = {0x00, 0x00}; - BLERemoteDescriptor* desc = getDescriptor((uint16_t)0x2902); - desc->writeValue(val, 2); - } // End Unregister - - m_semaphoreRegForNotifyEvt.wait("registerForNotify"); - - log_v("<< registerForNotify()"); -} // registerForNotify - - -/** - * @brief Delete the descriptors in the descriptor map. - * We maintain a map called m_descriptorMap that contains pointers to BLERemoteDescriptors - * object references. Since we allocated these in this class, we are also responsible for deleteing - * them. This method does just that. - * @return N/A. - */ -void BLERemoteCharacteristic::removeDescriptors() { - // Iterate through all the descriptors releasing their storage and erasing them from the map. - for (auto &myPair : m_descriptorMap) { - m_descriptorMap.erase(myPair.first); - delete myPair.second; - } - m_descriptorMap.clear(); // Technically not neeeded, but just to be sure. -} // removeCharacteristics - - -/** - * @brief Convert a BLERemoteCharacteristic to a string representation; - * @return a String representation. - */ -std::string BLERemoteCharacteristic::toString() { - std::string res = "Characteristic: uuid: " + m_uuid.toString(); - char val[6]; - res += ", handle: "; - snprintf(val, sizeof(val), "%d", getHandle()); - res += val; - res += " 0x"; - snprintf(val, sizeof(val), "%04x", getHandle()); - res += val; - res += ", props: " + BLEUtils::characteristicPropertiesToString(m_charProp); - return res; -} // toString - - -/** - * @brief Write the new value for the characteristic. - * @param [in] newValue The new value to write. - * @param [in] response Do we expect a response? - * @return N/A. - */ -void BLERemoteCharacteristic::writeValue(std::string newValue, bool response) { - writeValue((uint8_t*)newValue.c_str(), strlen(newValue.c_str()), response); -} // writeValue - - -/** - * @brief Write the new value for the characteristic. - * - * This is a convenience function. Many BLE characteristics are a single byte of data. - * @param [in] newValue The new byte value to write. - * @param [in] response Whether we require a response from the write. - * @return N/A. - */ -void BLERemoteCharacteristic::writeValue(uint8_t newValue, bool response) { - writeValue(&newValue, 1, response); -} // writeValue - - -/** - * @brief Write the new value for the characteristic from a data buffer. - * @param [in] data A pointer to a data buffer. - * @param [in] length The length of the data in the data buffer. - * @param [in] response Whether we require a response from the write. - */ -void BLERemoteCharacteristic::writeValue(uint8_t* data, size_t length, bool response) { - // writeValue(std::string((char*)data, length), response); - log_v(">> writeValue(), length: %d", length); - - // Check to see that we are connected. - if (!getRemoteService()->getClient()->isConnected()) { - log_e("Disconnected"); - return; - } - - m_semaphoreWriteCharEvt.take("writeValue"); - // Invoke the ESP-IDF API to perform the write. - esp_err_t errRc = ::esp_ble_gattc_write_char( - m_pRemoteService->getClient()->getGattcIf(), - m_pRemoteService->getClient()->getConnId(), - getHandle(), - length, - data, - response?ESP_GATT_WRITE_TYPE_RSP:ESP_GATT_WRITE_TYPE_NO_RSP, - ESP_GATT_AUTH_REQ_NONE - ); - - if (errRc != ESP_OK) { - log_e("esp_ble_gattc_write_char: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; - } - - m_semaphoreWriteCharEvt.wait("writeValue"); - - log_v("<< writeValue"); -} // writeValue - -/** - * @brief Read raw data from remote characteristic as hex bytes - * @return return pointer data read - */ -uint8_t* BLERemoteCharacteristic::readRawData() { - return m_rawData; -} - -#endif /* CONFIG_BT_ENABLED */ diff --git a/libraries/BLE/src/BLERemoteCharacteristic.h b/libraries/BLE/src/BLERemoteCharacteristic.h deleted file mode 100644 index fbcafe8d306..00000000000 --- a/libraries/BLE/src/BLERemoteCharacteristic.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * BLERemoteCharacteristic.h - * - * Created on: Jul 8, 2017 - * Author: kolban - */ - -#ifndef COMPONENTS_CPP_UTILS_BLEREMOTECHARACTERISTIC_H_ -#define COMPONENTS_CPP_UTILS_BLEREMOTECHARACTERISTIC_H_ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) - -#include - -#include - -#include "BLERemoteService.h" -#include "BLERemoteDescriptor.h" -#include "BLEUUID.h" -#include "FreeRTOS.h" - -class BLERemoteService; -class BLERemoteDescriptor; -typedef void (*notify_callback)(BLERemoteCharacteristic* pBLERemoteCharacteristic, uint8_t* pData, size_t length, bool isNotify); - -/** - * @brief A model of a remote %BLE characteristic. - */ -class BLERemoteCharacteristic { -public: - ~BLERemoteCharacteristic(); - - // Public member functions - bool canBroadcast(); - bool canIndicate(); - bool canNotify(); - bool canRead(); - bool canWrite(); - bool canWriteNoResponse(); - BLERemoteDescriptor* getDescriptor(BLEUUID uuid); - std::map* getDescriptors(); - uint16_t getHandle(); - BLEUUID getUUID(); - std::string readValue(); - uint8_t readUInt8(); - uint16_t readUInt16(); - uint32_t readUInt32(); - void registerForNotify(notify_callback _callback, bool notifications = true); - void writeValue(uint8_t* data, size_t length, bool response = false); - void writeValue(std::string newValue, bool response = false); - void writeValue(uint8_t newValue, bool response = false); - std::string toString(); - uint8_t* readRawData(); - -private: - BLERemoteCharacteristic(uint16_t handle, BLEUUID uuid, esp_gatt_char_prop_t charProp, BLERemoteService* pRemoteService); - friend class BLEClient; - friend class BLERemoteService; - friend class BLERemoteDescriptor; - - // Private member functions - void gattClientEventHandler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t* evtParam); - - BLERemoteService* getRemoteService(); - void removeDescriptors(); - void retrieveDescriptors(); - - // Private properties - BLEUUID m_uuid; - esp_gatt_char_prop_t m_charProp; - uint16_t m_handle; - BLERemoteService* m_pRemoteService; - FreeRTOS::Semaphore m_semaphoreReadCharEvt = FreeRTOS::Semaphore("ReadCharEvt"); - FreeRTOS::Semaphore m_semaphoreRegForNotifyEvt = FreeRTOS::Semaphore("RegForNotifyEvt"); - FreeRTOS::Semaphore m_semaphoreWriteCharEvt = FreeRTOS::Semaphore("WriteCharEvt"); - std::string m_value; - uint8_t *m_rawData; - notify_callback m_notifyCallback; - - // We maintain a map of descriptors owned by this characteristic keyed by a string representation of the UUID. - std::map m_descriptorMap; -}; // BLERemoteCharacteristic -#endif /* CONFIG_BT_ENABLED */ -#endif /* COMPONENTS_CPP_UTILS_BLEREMOTECHARACTERISTIC_H_ */ diff --git a/libraries/BLE/src/BLERemoteDescriptor.cpp b/libraries/BLE/src/BLERemoteDescriptor.cpp deleted file mode 100644 index 54e59759a04..00000000000 --- a/libraries/BLE/src/BLERemoteDescriptor.cpp +++ /dev/null @@ -1,175 +0,0 @@ -/* - * BLERemoteDescriptor.cpp - * - * Created on: Jul 8, 2017 - * Author: kolban - */ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include -#include "BLERemoteDescriptor.h" -#include "GeneralUtils.h" -#include "esp32-hal-log.h" - -BLERemoteDescriptor::BLERemoteDescriptor( - uint16_t handle, - BLEUUID uuid, - BLERemoteCharacteristic* pRemoteCharacteristic) { - - m_handle = handle; - m_uuid = uuid; - m_pRemoteCharacteristic = pRemoteCharacteristic; -} - - -/** - * @brief Retrieve the handle associated with this remote descriptor. - * @return The handle associated with this remote descriptor. - */ -uint16_t BLERemoteDescriptor::getHandle() { - return m_handle; -} // getHandle - - -/** - * @brief Get the characteristic that owns this descriptor. - * @return The characteristic that owns this descriptor. - */ -BLERemoteCharacteristic* BLERemoteDescriptor::getRemoteCharacteristic() { - return m_pRemoteCharacteristic; -} // getRemoteCharacteristic - - -/** - * @brief Retrieve the UUID associated this remote descriptor. - * @return The UUID associated this remote descriptor. - */ -BLEUUID BLERemoteDescriptor::getUUID() { - return m_uuid; -} // getUUID - - -std::string BLERemoteDescriptor::readValue() { - log_v(">> readValue: %s", toString().c_str()); - - // Check to see that we are connected. - if (!getRemoteCharacteristic()->getRemoteService()->getClient()->isConnected()) { - log_e("Disconnected"); - return std::string(); - } - - m_semaphoreReadDescrEvt.take("readValue"); - - // Ask the BLE subsystem to retrieve the value for the remote hosted characteristic. - esp_err_t errRc = ::esp_ble_gattc_read_char_descr( - m_pRemoteCharacteristic->getRemoteService()->getClient()->getGattcIf(), - m_pRemoteCharacteristic->getRemoteService()->getClient()->getConnId(), // The connection ID to the BLE server - getHandle(), // The handle of this characteristic - ESP_GATT_AUTH_REQ_NONE); // Security - - if (errRc != ESP_OK) { - log_e("esp_ble_gattc_read_char: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return ""; - } - - // Block waiting for the event that indicates that the read has completed. When it has, the std::string found - // in m_value will contain our data. - m_semaphoreReadDescrEvt.wait("readValue"); - - log_v("<< readValue(): length: %d", m_value.length()); - return m_value; -} // readValue - - -uint8_t BLERemoteDescriptor::readUInt8() { - std::string value = readValue(); - if (value.length() >= 1) { - return (uint8_t) value[0]; - } - return 0; -} // readUInt8 - - -uint16_t BLERemoteDescriptor::readUInt16() { - std::string value = readValue(); - if (value.length() >= 2) { - return *(uint16_t*) value.data(); - } - return 0; -} // readUInt16 - - -uint32_t BLERemoteDescriptor::readUInt32() { - std::string value = readValue(); - if (value.length() >= 4) { - return *(uint32_t*) value.data(); - } - return 0; -} // readUInt32 - - -/** - * @brief Return a string representation of this BLE Remote Descriptor. - * @retun A string representation of this BLE Remote Descriptor. - */ -std::string BLERemoteDescriptor::toString() { - char val[6]; - snprintf(val, sizeof(val), "%d", getHandle()); - std::string res = "handle: "; - res += val; - res += ", uuid: " + getUUID().toString(); - return res; -} // toString - - -/** - * @brief Write data to the BLE Remote Descriptor. - * @param [in] data The data to send to the remote descriptor. - * @param [in] length The length of the data to send. - * @param [in] response True if we expect a response. - */ -void BLERemoteDescriptor::writeValue(uint8_t* data, size_t length, bool response) { - log_v(">> writeValue: %s", toString().c_str()); - // Check to see that we are connected. - if (!getRemoteCharacteristic()->getRemoteService()->getClient()->isConnected()) { - log_e("Disconnected"); - return; - } - - esp_err_t errRc = ::esp_ble_gattc_write_char_descr( - m_pRemoteCharacteristic->getRemoteService()->getClient()->getGattcIf(), - m_pRemoteCharacteristic->getRemoteService()->getClient()->getConnId(), - getHandle(), - length, // Data length - data, // Data - response ? ESP_GATT_WRITE_TYPE_RSP : ESP_GATT_WRITE_TYPE_NO_RSP, - ESP_GATT_AUTH_REQ_NONE - ); - if (errRc != ESP_OK) { - log_e("esp_ble_gattc_write_char_descr: %d", errRc); - } - log_v("<< writeValue"); -} // writeValue - - -/** - * @brief Write data represented as a string to the BLE Remote Descriptor. - * @param [in] newValue The data to send to the remote descriptor. - * @param [in] response True if we expect a response. - */ -void BLERemoteDescriptor::writeValue(std::string newValue, bool response) { - writeValue((uint8_t*) newValue.data(), newValue.length(), response); -} // writeValue - - -/** - * @brief Write a byte value to the Descriptor. - * @param [in] The single byte to write. - * @param [in] True if we expect a response. - */ -void BLERemoteDescriptor::writeValue(uint8_t newValue, bool response) { - writeValue(&newValue, 1, response); -} // writeValue - - -#endif /* CONFIG_BT_ENABLED */ diff --git a/libraries/BLE/src/BLERemoteDescriptor.h b/libraries/BLE/src/BLERemoteDescriptor.h deleted file mode 100644 index 7bbc48f12d9..00000000000 --- a/libraries/BLE/src/BLERemoteDescriptor.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * BLERemoteDescriptor.h - * - * Created on: Jul 8, 2017 - * Author: kolban - */ - -#ifndef COMPONENTS_CPP_UTILS_BLEREMOTEDESCRIPTOR_H_ -#define COMPONENTS_CPP_UTILS_BLEREMOTEDESCRIPTOR_H_ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include - -#include - -#include "BLERemoteCharacteristic.h" -#include "BLEUUID.h" -#include "FreeRTOS.h" - -class BLERemoteCharacteristic; -/** - * @brief A model of remote %BLE descriptor. - */ -class BLERemoteDescriptor { -public: - uint16_t getHandle(); - BLERemoteCharacteristic* getRemoteCharacteristic(); - BLEUUID getUUID(); - std::string readValue(void); - uint8_t readUInt8(void); - uint16_t readUInt16(void); - uint32_t readUInt32(void); - std::string toString(void); - void writeValue(uint8_t* data, size_t length, bool response = false); - void writeValue(std::string newValue, bool response = false); - void writeValue(uint8_t newValue, bool response = false); - - -private: - friend class BLERemoteCharacteristic; - BLERemoteDescriptor( - uint16_t handle, - BLEUUID uuid, - BLERemoteCharacteristic* pRemoteCharacteristic - ); - uint16_t m_handle; // Server handle of this descriptor. - BLEUUID m_uuid; // UUID of this descriptor. - std::string m_value; // Last received value of the descriptor. - BLERemoteCharacteristic* m_pRemoteCharacteristic; // Reference to the Remote characteristic of which this descriptor is associated. - FreeRTOS::Semaphore m_semaphoreReadDescrEvt = FreeRTOS::Semaphore("ReadDescrEvt"); - - -}; -#endif /* CONFIG_BT_ENABLED */ -#endif /* COMPONENTS_CPP_UTILS_BLEREMOTEDESCRIPTOR_H_ */ diff --git a/libraries/BLE/src/BLERemoteService.cpp b/libraries/BLE/src/BLERemoteService.cpp deleted file mode 100644 index 278e9c1cab4..00000000000 --- a/libraries/BLE/src/BLERemoteService.cpp +++ /dev/null @@ -1,357 +0,0 @@ -/* - * BLERemoteService.cpp - * - * Created on: Jul 8, 2017 - * Author: kolban - */ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) - -#include -#include "BLERemoteService.h" -#include "BLEUtils.h" -#include "GeneralUtils.h" -#include -#include "esp32-hal-log.h" - -#pragma GCC diagnostic warning "-Wunused-but-set-parameter" - -BLERemoteService::BLERemoteService( - esp_gatt_id_t srvcId, - BLEClient* pClient, - uint16_t startHandle, - uint16_t endHandle - ) { - - log_v(">> BLERemoteService()"); - m_srvcId = srvcId; - m_pClient = pClient; - m_uuid = BLEUUID(m_srvcId); - m_haveCharacteristics = false; - m_startHandle = startHandle; - m_endHandle = endHandle; - - log_v("<< BLERemoteService()"); -} - - -BLERemoteService::~BLERemoteService() { - removeCharacteristics(); -} - -/* -static bool compareSrvcId(esp_gatt_srvc_id_t id1, esp_gatt_srvc_id_t id2) { - if (id1.id.inst_id != id2.id.inst_id) { - return false; - } - if (!BLEUUID(id1.id.uuid).equals(BLEUUID(id2.id.uuid))) { - return false; - } - return true; -} // compareSrvcId -*/ - -/** - * @brief Handle GATT Client events - */ -void BLERemoteService::gattClientEventHandler( - esp_gattc_cb_event_t event, - esp_gatt_if_t gattc_if, - esp_ble_gattc_cb_param_t* evtParam) { - switch (event) { - // - // ESP_GATTC_GET_CHAR_EVT - // - // get_char: - // - esp_gatt_status_t status - // - uin1t6_t conn_id - // - esp_gatt_srvc_id_t srvc_id - // - esp_gatt_id_t char_id - // - esp_gatt_char_prop_t char_prop - // - /* - case ESP_GATTC_GET_CHAR_EVT: { - // Is this event for this service? If yes, then the local srvc_id and the event srvc_id will be - // the same. - if (compareSrvcId(m_srvcId, evtParam->get_char.srvc_id) == false) { - break; - } - - // If the status is NOT OK then we have a problem and continue. - if (evtParam->get_char.status != ESP_GATT_OK) { - m_semaphoreGetCharEvt.give(); - break; - } - - // This is an indication that we now have the characteristic details for a characteristic owned - // by this service so remember it. - m_characteristicMap.insert(std::pair( - BLEUUID(evtParam->get_char.char_id.uuid).toString(), - new BLERemoteCharacteristic(evtParam->get_char.char_id, evtParam->get_char.char_prop, this) )); - - - // Now that we have received a characteristic, lets ask for the next one. - esp_err_t errRc = ::esp_ble_gattc_get_characteristic( - m_pClient->getGattcIf(), - m_pClient->getConnId(), - &m_srvcId, - &evtParam->get_char.char_id); - if (errRc != ESP_OK) { - log_e("esp_ble_gattc_get_characteristic: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - break; - } - - //m_semaphoreGetCharEvt.give(); - break; - } // ESP_GATTC_GET_CHAR_EVT -*/ - default: - break; - } // switch - - // Send the event to each of the characteristics owned by this service. - for (auto &myPair : m_characteristicMapByHandle) { - myPair.second->gattClientEventHandler(event, gattc_if, evtParam); - } -} // gattClientEventHandler - - -/** - * @brief Get the remote characteristic object for the characteristic UUID. - * @param [in] uuid Remote characteristic uuid. - * @return Reference to the remote characteristic object. - * @throws BLEUuidNotFoundException - */ -BLERemoteCharacteristic* BLERemoteService::getCharacteristic(const char* uuid) { - return getCharacteristic(BLEUUID(uuid)); -} // getCharacteristic - -/** - * @brief Get the characteristic object for the UUID. - * @param [in] uuid Characteristic uuid. - * @return Reference to the characteristic object. - * @throws BLEUuidNotFoundException - */ -BLERemoteCharacteristic* BLERemoteService::getCharacteristic(BLEUUID uuid) { -// Design -// ------ -// We wish to retrieve the characteristic given its UUID. It is possible that we have not yet asked the -// device what characteristics it has in which case we have nothing to match against. If we have not -// asked the device about its characteristics, then we do that now. Once we get the results we can then -// examine the characteristics map to see if it has the characteristic we are looking for. - if (!m_haveCharacteristics) { - retrieveCharacteristics(); - } - std::string v = uuid.toString(); - for (auto &myPair : m_characteristicMap) { - if (myPair.first == v) { - return myPair.second; - } - } - // throw new BLEUuidNotFoundException(); // <-- we dont want exception here, which will cause app crash, we want to search if any characteristic can be found one after another - return nullptr; -} // getCharacteristic - - -/** - * @brief Retrieve all the characteristics for this service. - * This function will not return until we have all the characteristics. - * @return N/A - */ -void BLERemoteService::retrieveCharacteristics() { - log_v(">> getCharacteristics() for service: %s", getUUID().toString().c_str()); - - removeCharacteristics(); // Forget any previous characteristics. - - uint16_t offset = 0; - esp_gattc_char_elem_t result; - while (true) { - uint16_t count = 1; // only room for 1 result allocated, so go one by one - esp_gatt_status_t status = ::esp_ble_gattc_get_all_char( - getClient()->getGattcIf(), - getClient()->getConnId(), - m_startHandle, - m_endHandle, - &result, - &count, - offset - ); - - if (status == ESP_GATT_INVALID_OFFSET) { // We have reached the end of the entries. - break; - } - - if (status != ESP_GATT_OK) { // If we got an error, end. - log_e("esp_ble_gattc_get_all_char: %s", BLEUtils::gattStatusToString(status).c_str()); - break; - } - - if (count == 0) { // If we failed to get any new records, end. - break; - } - - log_d("Found a characteristic: Handle: %d, UUID: %s", result.char_handle, BLEUUID(result.uuid).toString().c_str()); - - // We now have a new characteristic ... let us add that to our set of known characteristics - BLERemoteCharacteristic *pNewRemoteCharacteristic = new BLERemoteCharacteristic( - result.char_handle, - BLEUUID(result.uuid), - result.properties, - this - ); - - m_characteristicMap.insert(std::pair(pNewRemoteCharacteristic->getUUID().toString(), pNewRemoteCharacteristic)); - m_characteristicMapByHandle.insert(std::pair(result.char_handle, pNewRemoteCharacteristic)); - offset++; // Increment our count of number of descriptors found. - } // Loop forever (until we break inside the loop). - - m_haveCharacteristics = true; // Remember that we have received the characteristics. - log_v("<< getCharacteristics()"); -} // getCharacteristics - - -/** - * @brief Retrieve a map of all the characteristics of this service. - * @return A map of all the characteristics of this service. - */ -std::map* BLERemoteService::getCharacteristics() { - log_v(">> getCharacteristics() for service: %s", getUUID().toString().c_str()); - // If is possible that we have not read the characteristics associated with the service so do that - // now. The request to retrieve the characteristics by calling "retrieveCharacteristics" is a blocking - // call and does not return until all the characteristics are available. - if (!m_haveCharacteristics) { - retrieveCharacteristics(); - } - log_v("<< getCharacteristics() for service: %s", getUUID().toString().c_str()); - return &m_characteristicMap; -} // getCharacteristics - -/** - * @brief Retrieve a map of all the characteristics of this service. - * @return A map of all the characteristics of this service. - */ -std::map* BLERemoteService::getCharacteristicsByHandle() { - // If is possible that we have not read the characteristics associated with the service so do that - // now. The request to retrieve the characteristics by calling "retrieveCharacteristics" is a blocking - // call and does not return until all the characteristics are available. - if (!m_haveCharacteristics) { - retrieveCharacteristics(); - } - return &m_characteristicMapByHandle; -} // getCharacteristicsByHandle - -/** - * @brief This function is designed to get characteristics map when we have multiple characteristics with the same UUID - */ -void BLERemoteService::getCharacteristics(std::map* pCharacteristicMap) { - pCharacteristicMap = &m_characteristicMapByHandle; -} // Get the characteristics map. - -/** - * @brief Get the client associated with this service. - * @return A reference to the client associated with this service. - */ -BLEClient* BLERemoteService::getClient() { - return m_pClient; -} // getClient - - -uint16_t BLERemoteService::getEndHandle() { - return m_endHandle; -} // getEndHandle - - -esp_gatt_id_t* BLERemoteService::getSrvcId() { - return &m_srvcId; -} // getSrvcId - - -uint16_t BLERemoteService::getStartHandle() { - return m_startHandle; -} // getStartHandle - - -uint16_t BLERemoteService::getHandle() { - log_v(">> getHandle: service: %s", getUUID().toString().c_str()); - log_v("<< getHandle: %d 0x%.2x", getStartHandle(), getStartHandle()); - return getStartHandle(); -} // getHandle - - -BLEUUID BLERemoteService::getUUID() { - return m_uuid; -} - -/** - * @brief Read the value of a characteristic associated with this service. - */ -std::string BLERemoteService::getValue(BLEUUID characteristicUuid) { - log_v(">> readValue: uuid: %s", characteristicUuid.toString().c_str()); - std::string ret = getCharacteristic(characteristicUuid)->readValue(); - log_v("<< readValue"); - return ret; -} // readValue - - - -/** - * @brief Delete the characteristics in the characteristics map. - * We maintain a map called m_characteristicsMap that contains pointers to BLERemoteCharacteristic - * object references. Since we allocated these in this class, we are also responsible for deleteing - * them. This method does just that. - * @return N/A. - */ -void BLERemoteService::removeCharacteristics() { - for (auto &myPair : m_characteristicMap) { - delete myPair.second; - //m_characteristicMap.erase(myPair.first); // Should be no need to delete as it will be deleted by the clear - } - m_characteristicMap.clear(); // Clear the map - for (auto &myPair : m_characteristicMapByHandle) { - delete myPair.second; - } - m_characteristicMapByHandle.clear(); // Clear the map -} // removeCharacteristics - - -/** - * @brief Set the value of a characteristic. - * @param [in] characteristicUuid The characteristic to set. - * @param [in] value The value to set. - * @throws BLEUuidNotFound - */ -void BLERemoteService::setValue(BLEUUID characteristicUuid, std::string value) { - log_v(">> setValue: uuid: %s", characteristicUuid.toString().c_str()); - getCharacteristic(characteristicUuid)->writeValue(value); - log_v("<< setValue"); -} // setValue - - -/** - * @brief Create a string representation of this remote service. - * @return A string representation of this remote service. - */ -std::string BLERemoteService::toString() { - std::string res = "Service: uuid: " + m_uuid.toString(); - char val[6]; - res += ", start_handle: "; - snprintf(val, sizeof(val), "%d", m_startHandle); - res += val; - snprintf(val, sizeof(val), "%04x", m_startHandle); - res += " 0x"; - res += val; - res += ", end_handle: "; - snprintf(val, sizeof(val), "%d", m_endHandle); - res += val; - snprintf(val, sizeof(val), "%04x", m_endHandle); - res += " 0x"; - res += val; - for (auto &myPair : m_characteristicMap) { - res += "\n" + myPair.second->toString(); - // myPair.second is the value - } - return res; -} // toString - - -#endif /* CONFIG_BT_ENABLED */ diff --git a/libraries/BLE/src/BLERemoteService.h b/libraries/BLE/src/BLERemoteService.h deleted file mode 100644 index 2ab86738452..00000000000 --- a/libraries/BLE/src/BLERemoteService.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * BLERemoteService.h - * - * Created on: Jul 8, 2017 - * Author: kolban - */ - -#ifndef COMPONENTS_CPP_UTILS_BLEREMOTESERVICE_H_ -#define COMPONENTS_CPP_UTILS_BLEREMOTESERVICE_H_ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) - -#include - -#include "BLEClient.h" -#include "BLERemoteCharacteristic.h" -#include "BLEUUID.h" -#include "FreeRTOS.h" - -class BLEClient; -class BLERemoteCharacteristic; - - -/** - * @brief A model of a remote %BLE service. - */ -class BLERemoteService { -public: - virtual ~BLERemoteService(); - - // Public methods - BLERemoteCharacteristic* getCharacteristic(const char* uuid); // Get the specified characteristic reference. - BLERemoteCharacteristic* getCharacteristic(BLEUUID uuid); // Get the specified characteristic reference. - BLERemoteCharacteristic* getCharacteristic(uint16_t uuid); // Get the specified characteristic reference. - std::map* getCharacteristics(); - std::map* getCharacteristicsByHandle(); // Get the characteristics map. - void getCharacteristics(std::map* pCharacteristicMap); - - BLEClient* getClient(void); // Get a reference to the client associated with this service. - uint16_t getHandle(); // Get the handle of this service. - BLEUUID getUUID(void); // Get the UUID of this service. - std::string getValue(BLEUUID characteristicUuid); // Get the value of a characteristic. - void setValue(BLEUUID characteristicUuid, std::string value); // Set the value of a characteristic. - std::string toString(void); - -private: - // Private constructor ... never meant to be created by a user application. - BLERemoteService(esp_gatt_id_t srvcId, BLEClient* pClient, uint16_t startHandle, uint16_t endHandle); - - // Friends - friend class BLEClient; - friend class BLERemoteCharacteristic; - - // Private methods - void retrieveCharacteristics(void); // Retrieve the characteristics from the BLE Server. - esp_gatt_id_t* getSrvcId(void); - uint16_t getStartHandle(); // Get the start handle for this service. - uint16_t getEndHandle(); // Get the end handle for this service. - - void gattClientEventHandler( - esp_gattc_cb_event_t event, - esp_gatt_if_t gattc_if, - esp_ble_gattc_cb_param_t* evtParam); - - void removeCharacteristics(); - - // Properties - - // We maintain a map of characteristics owned by this service keyed by a string representation of the UUID. - std::map m_characteristicMap; - - // We maintain a map of characteristics owned by this service keyed by a handle. - std::map m_characteristicMapByHandle; - - bool m_haveCharacteristics; // Have we previously obtained the characteristics. - BLEClient* m_pClient; - FreeRTOS::Semaphore m_semaphoreGetCharEvt = FreeRTOS::Semaphore("GetCharEvt"); - esp_gatt_id_t m_srvcId; - BLEUUID m_uuid; // The UUID of this service. - uint16_t m_startHandle; // The starting handle of this service. - uint16_t m_endHandle; // The ending handle of this service. -}; // BLERemoteService - -#endif /* CONFIG_BT_ENABLED */ -#endif /* COMPONENTS_CPP_UTILS_BLEREMOTESERVICE_H_ */ diff --git a/libraries/BLE/src/BLEScan.cpp b/libraries/BLE/src/BLEScan.cpp deleted file mode 100644 index cb28dd395a7..00000000000 --- a/libraries/BLE/src/BLEScan.cpp +++ /dev/null @@ -1,322 +0,0 @@ -/* - * BLEScan.cpp - * - * Created on: Jul 1, 2017 - * Author: kolban - */ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) - - -#include - -#include - -#include "BLEAdvertisedDevice.h" -#include "BLEScan.h" -#include "BLEUtils.h" -#include "GeneralUtils.h" -#include "esp32-hal-log.h" - -/** - * Constructor - */ -BLEScan::BLEScan() { - m_scan_params.scan_type = BLE_SCAN_TYPE_PASSIVE; // Default is a passive scan. - m_scan_params.own_addr_type = BLE_ADDR_TYPE_PUBLIC; - m_scan_params.scan_filter_policy = BLE_SCAN_FILTER_ALLOW_ALL; - m_pAdvertisedDeviceCallbacks = nullptr; - m_stopped = true; - m_wantDuplicates = false; - setInterval(100); - setWindow(100); -} // BLEScan - - -/** - * @brief Handle GAP events related to scans. - * @param [in] event The event type for this event. - * @param [in] param Parameter data for this event. - */ -void BLEScan::handleGAPEvent( - esp_gap_ble_cb_event_t event, - esp_ble_gap_cb_param_t* param) { - - switch(event) { - - // --------------------------- - // scan_rst: - // esp_gap_search_evt_t search_evt - // esp_bd_addr_t bda - // esp_bt_dev_type_t dev_type - // esp_ble_addr_type_t ble_addr_type - // esp_ble_evt_type_t ble_evt_type - // int rssi - // uint8_t ble_adv[ESP_BLE_ADV_DATA_LEN_MAX] - // int flag - // int num_resps - // uint8_t adv_data_len - // uint8_t scan_rsp_len - case ESP_GAP_BLE_SCAN_RESULT_EVT: { - - switch(param->scan_rst.search_evt) { - // - // ESP_GAP_SEARCH_INQ_CMPL_EVT - // - // Event that indicates that the duration allowed for the search has completed or that we have been - // asked to stop. - case ESP_GAP_SEARCH_INQ_CMPL_EVT: { - log_w("ESP_GAP_SEARCH_INQ_CMPL_EVT"); - m_stopped = true; - m_semaphoreScanEnd.give(); - if (m_scanCompleteCB != nullptr) { - m_scanCompleteCB(m_scanResults); - } - break; - } // ESP_GAP_SEARCH_INQ_CMPL_EVT - - // - // ESP_GAP_SEARCH_INQ_RES_EVT - // - // Result that has arrived back from a Scan inquiry. - case ESP_GAP_SEARCH_INQ_RES_EVT: { - if (m_stopped) { // If we are not scanning, nothing to do with the extra results. - break; - } - -// Examine our list of previously scanned addresses and, if we found this one already, -// ignore it. - BLEAddress advertisedAddress(param->scan_rst.bda); - bool found = false; - - if (m_scanResults.m_vectorAdvertisedDevices.count(advertisedAddress.toString()) != 0) { - found = true; - } - - if (found && !m_wantDuplicates) { // If we found a previous entry AND we don't want duplicates, then we are done. - log_d("Ignoring %s, already seen it.", advertisedAddress.toString().c_str()); - vTaskDelay(1); // <--- allow to switch task in case we scan infinity and dont have new devices to report, or we are blocked here - break; - } - - // We now construct a model of the advertised device that we have just found for the first - // time. - // ESP_LOG_BUFFER_HEXDUMP((uint8_t*)param->scan_rst.ble_adv, param->scan_rst.adv_data_len + param->scan_rst.scan_rsp_len, ESP_LOG_DEBUG); - // log_w("bytes length: %d + %d, addr type: %d", param->scan_rst.adv_data_len, param->scan_rst.scan_rsp_len, param->scan_rst.ble_addr_type); - BLEAdvertisedDevice *advertisedDevice = new BLEAdvertisedDevice(); - advertisedDevice->setAddress(advertisedAddress); - advertisedDevice->setRSSI(param->scan_rst.rssi); - advertisedDevice->setAdFlag(param->scan_rst.flag); - advertisedDevice->parseAdvertisement((uint8_t*)param->scan_rst.ble_adv, param->scan_rst.adv_data_len + param->scan_rst.scan_rsp_len); - advertisedDevice->setScan(this); - advertisedDevice->setAddressType(param->scan_rst.ble_addr_type); - - if (!found) { // If we have previously seen this device, don't record it again. - m_scanResults.m_vectorAdvertisedDevices.insert(std::pair(advertisedAddress.toString(), advertisedDevice)); - } - - if (m_pAdvertisedDeviceCallbacks) { - m_pAdvertisedDeviceCallbacks->onResult(*advertisedDevice); - } - if(found) - delete advertisedDevice; - - break; - } // ESP_GAP_SEARCH_INQ_RES_EVT - - default: { - break; - } - } // switch - search_evt - - - break; - } // ESP_GAP_BLE_SCAN_RESULT_EVT - - default: { - break; - } // default - } // End switch -} // gapEventHandler - - -/** - * @brief Should we perform an active or passive scan? - * The default is a passive scan. An active scan means that we will wish a scan response. - * @param [in] active If true, we perform an active scan otherwise a passive scan. - * @return N/A. - */ -void BLEScan::setActiveScan(bool active) { - if (active) { - m_scan_params.scan_type = BLE_SCAN_TYPE_ACTIVE; - } else { - m_scan_params.scan_type = BLE_SCAN_TYPE_PASSIVE; - } -} // setActiveScan - - -/** - * @brief Set the call backs to be invoked. - * @param [in] pAdvertisedDeviceCallbacks Call backs to be invoked. - * @param [in] wantDuplicates True if we wish to be called back with duplicates. Default is false. - */ -void BLEScan::setAdvertisedDeviceCallbacks(BLEAdvertisedDeviceCallbacks* pAdvertisedDeviceCallbacks, bool wantDuplicates) { - m_wantDuplicates = wantDuplicates; - m_pAdvertisedDeviceCallbacks = pAdvertisedDeviceCallbacks; -} // setAdvertisedDeviceCallbacks - - -/** - * @brief Set the interval to scan. - * @param [in] The interval in msecs. - */ -void BLEScan::setInterval(uint16_t intervalMSecs) { - m_scan_params.scan_interval = intervalMSecs / 0.625; -} // setInterval - - -/** - * @brief Set the window to actively scan. - * @param [in] windowMSecs How long to actively scan. - */ -void BLEScan::setWindow(uint16_t windowMSecs) { - m_scan_params.scan_window = windowMSecs / 0.625; -} // setWindow - - -/** - * @brief Start scanning. - * @param [in] duration The duration in seconds for which to scan. - * @param [in] scanCompleteCB A function to be called when scanning has completed. - * @param [in] are we continue scan (true) or we want to clear stored devices (false) - * @return True if scan started or false if there was an error. - */ -bool BLEScan::start(uint32_t duration, void (*scanCompleteCB)(BLEScanResults), bool is_continue) { - log_v(">> start(duration=%d)", duration); - - m_semaphoreScanEnd.take(std::string("start")); - m_scanCompleteCB = scanCompleteCB; // Save the callback to be invoked when the scan completes. - - // if we are connecting to devices that are advertising even after being connected, multiconnecting peripherals - // then we should not clear map or we will connect the same device few times - if(!is_continue) { - for(auto _dev : m_scanResults.m_vectorAdvertisedDevices){ - delete _dev.second; - } - m_scanResults.m_vectorAdvertisedDevices.clear(); - } - - esp_err_t errRc = ::esp_ble_gap_set_scan_params(&m_scan_params); - - if (errRc != ESP_OK) { - log_e("esp_ble_gap_set_scan_params: err: %d, text: %s", errRc, GeneralUtils::errorToString(errRc)); - m_semaphoreScanEnd.give(); - return false; - } - - errRc = ::esp_ble_gap_start_scanning(duration); - - if (errRc != ESP_OK) { - log_e("esp_ble_gap_start_scanning: err: %d, text: %s", errRc, GeneralUtils::errorToString(errRc)); - m_semaphoreScanEnd.give(); - return false; - } - - m_stopped = false; - - log_v("<< start()"); - return true; -} // start - - -/** - * @brief Start scanning and block until scanning has been completed. - * @param [in] duration The duration in seconds for which to scan. - * @return The BLEScanResults. - */ -BLEScanResults BLEScan::start(uint32_t duration, bool is_continue) { - if(start(duration, nullptr, is_continue)) { - m_semaphoreScanEnd.wait("start"); // Wait for the semaphore to release. - } - return m_scanResults; -} // start - - -/** - * @brief Stop an in progress scan. - * @return N/A. - */ -void BLEScan::stop() { - log_v(">> stop()"); - - esp_err_t errRc = ::esp_ble_gap_stop_scanning(); - - m_stopped = true; - m_semaphoreScanEnd.give(); - - if (errRc != ESP_OK) { - log_e("esp_ble_gap_stop_scanning: err: %d, text: %s", errRc, GeneralUtils::errorToString(errRc)); - return; - } - - log_v("<< stop()"); -} // stop - -// delete peer device from cache after disconnecting, it is required in case we are connecting to devices with not public address -void BLEScan::erase(BLEAddress address) { - log_i("erase device: %s", address.toString().c_str()); - BLEAdvertisedDevice *advertisedDevice = m_scanResults.m_vectorAdvertisedDevices.find(address.toString())->second; - m_scanResults.m_vectorAdvertisedDevices.erase(address.toString()); - delete advertisedDevice; -} - - -/** - * @brief Dump the scan results to the log. - */ -void BLEScanResults::dump() { - log_v(">> Dump scan results:"); - for (int i=0; isecond; - for (auto it = m_vectorAdvertisedDevices.begin(); it != m_vectorAdvertisedDevices.end(); it++) { - dev = *it->second; - if (x==i) break; - x++; - } - return dev; -} - -BLEScanResults BLEScan::getResults() { - return m_scanResults; -} - -void BLEScan::clearResults() { - for(auto _dev : m_scanResults.m_vectorAdvertisedDevices){ - delete _dev.second; - } - m_scanResults.m_vectorAdvertisedDevices.clear(); -} - -#endif /* CONFIG_BT_ENABLED */ diff --git a/libraries/BLE/src/BLEScan.h b/libraries/BLE/src/BLEScan.h deleted file mode 100644 index 2f71a72738e..00000000000 --- a/libraries/BLE/src/BLEScan.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * BLEScan.h - * - * Created on: Jul 1, 2017 - * Author: kolban - */ - -#ifndef COMPONENTS_CPP_UTILS_BLESCAN_H_ -#define COMPONENTS_CPP_UTILS_BLESCAN_H_ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include - -// #include -#include -#include "BLEAdvertisedDevice.h" -#include "BLEClient.h" -#include "FreeRTOS.h" - -class BLEAdvertisedDevice; -class BLEAdvertisedDeviceCallbacks; -class BLEClient; -class BLEScan; - - -/** - * @brief The result of having performed a scan. - * When a scan completes, we have a set of found devices. Each device is described - * by a BLEAdvertisedDevice object. The number of items in the set is given by - * getCount(). We can retrieve a device by calling getDevice() passing in the - * index (starting at 0) of the desired device. - */ -class BLEScanResults { -public: - void dump(); - int getCount(); - BLEAdvertisedDevice getDevice(uint32_t i); - -private: - friend BLEScan; - std::map m_vectorAdvertisedDevices; -}; - -/** - * @brief Perform and manage %BLE scans. - * - * Scanning is associated with a %BLE client that is attempting to locate BLE servers. - */ -class BLEScan { -public: - void setActiveScan(bool active); - void setAdvertisedDeviceCallbacks( - BLEAdvertisedDeviceCallbacks* pAdvertisedDeviceCallbacks, - bool wantDuplicates = false); - void setInterval(uint16_t intervalMSecs); - void setWindow(uint16_t windowMSecs); - bool start(uint32_t duration, void (*scanCompleteCB)(BLEScanResults), bool is_continue = false); - BLEScanResults start(uint32_t duration, bool is_continue = false); - void stop(); - void erase(BLEAddress address); - BLEScanResults getResults(); - void clearResults(); - -private: - BLEScan(); // One doesn't create a new instance instead one asks the BLEDevice for the singleton. - friend class BLEDevice; - void handleGAPEvent( - esp_gap_ble_cb_event_t event, - esp_ble_gap_cb_param_t* param); - void parseAdvertisement(BLEClient* pRemoteDevice, uint8_t *payload); - - - esp_ble_scan_params_t m_scan_params; - BLEAdvertisedDeviceCallbacks* m_pAdvertisedDeviceCallbacks = nullptr; - bool m_stopped = true; - FreeRTOS::Semaphore m_semaphoreScanEnd = FreeRTOS::Semaphore("ScanEnd"); - BLEScanResults m_scanResults; - bool m_wantDuplicates; - void (*m_scanCompleteCB)(BLEScanResults scanResults); -}; // BLEScan - -#endif /* CONFIG_BT_ENABLED */ -#endif /* COMPONENTS_CPP_UTILS_BLESCAN_H_ */ diff --git a/libraries/BLE/src/BLESecurity.cpp b/libraries/BLE/src/BLESecurity.cpp deleted file mode 100644 index 921f5424431..00000000000 --- a/libraries/BLE/src/BLESecurity.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * BLESecurity.cpp - * - * Created on: Dec 17, 2017 - * Author: chegewara - */ - -#include "BLESecurity.h" -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) - -BLESecurity::BLESecurity() { -} - -BLESecurity::~BLESecurity() { -} -/* - * @brief Set requested authentication mode - */ -void BLESecurity::setAuthenticationMode(esp_ble_auth_req_t auth_req) { - m_authReq = auth_req; - esp_ble_gap_set_security_param(ESP_BLE_SM_AUTHEN_REQ_MODE, &m_authReq, sizeof(uint8_t)); // <--- setup requested authentication mode -} - -/** - * @brief Set our device IO capability to let end user perform authorization - * either by displaying or entering generated 6-digits pin code - */ -void BLESecurity::setCapability(esp_ble_io_cap_t iocap) { - m_iocap = iocap; - esp_ble_gap_set_security_param(ESP_BLE_SM_IOCAP_MODE, &iocap, sizeof(uint8_t)); -} // setCapability - - -/** - * @brief Init encryption key by server - * @param key_size is value between 7 and 16 - */ -void BLESecurity::setInitEncryptionKey(uint8_t init_key) { - m_initKey = init_key; - esp_ble_gap_set_security_param(ESP_BLE_SM_SET_INIT_KEY, &m_initKey, sizeof(uint8_t)); -} // setInitEncryptionKey - - -/** - * @brief Init encryption key by client - * @param key_size is value between 7 and 16 - */ -void BLESecurity::setRespEncryptionKey(uint8_t resp_key) { - m_respKey = resp_key; - esp_ble_gap_set_security_param(ESP_BLE_SM_SET_RSP_KEY, &m_respKey, sizeof(uint8_t)); -} // setRespEncryptionKey - - -/** - * - * - */ -void BLESecurity::setKeySize(uint8_t key_size) { - m_keySize = key_size; - esp_ble_gap_set_security_param(ESP_BLE_SM_MAX_KEY_SIZE, &m_keySize, sizeof(uint8_t)); -} //setKeySize - - -/** - * @brief Debug function to display what keys are exchanged by peers - */ -char* BLESecurity::esp_key_type_to_str(esp_ble_key_type_t key_type) { - char* key_str = nullptr; - switch (key_type) { - case ESP_LE_KEY_NONE: - key_str = (char*) "ESP_LE_KEY_NONE"; - break; - case ESP_LE_KEY_PENC: - key_str = (char*) "ESP_LE_KEY_PENC"; - break; - case ESP_LE_KEY_PID: - key_str = (char*) "ESP_LE_KEY_PID"; - break; - case ESP_LE_KEY_PCSRK: - key_str = (char*) "ESP_LE_KEY_PCSRK"; - break; - case ESP_LE_KEY_PLK: - key_str = (char*) "ESP_LE_KEY_PLK"; - break; - case ESP_LE_KEY_LLK: - key_str = (char*) "ESP_LE_KEY_LLK"; - break; - case ESP_LE_KEY_LENC: - key_str = (char*) "ESP_LE_KEY_LENC"; - break; - case ESP_LE_KEY_LID: - key_str = (char*) "ESP_LE_KEY_LID"; - break; - case ESP_LE_KEY_LCSRK: - key_str = (char*) "ESP_LE_KEY_LCSRK"; - break; - default: - key_str = (char*) "INVALID BLE KEY TYPE"; - break; - } - return key_str; -} // esp_key_type_to_str -#endif // CONFIG_BT_ENABLED diff --git a/libraries/BLE/src/BLESecurity.h b/libraries/BLE/src/BLESecurity.h deleted file mode 100644 index 48d09d2f3f6..00000000000 --- a/libraries/BLE/src/BLESecurity.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * BLESecurity.h - * - * Created on: Dec 17, 2017 - * Author: chegewara - */ - -#ifndef COMPONENTS_CPP_UTILS_BLESECURITY_H_ -#define COMPONENTS_CPP_UTILS_BLESECURITY_H_ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) - -#include - -class BLESecurity { -public: - BLESecurity(); - virtual ~BLESecurity(); - void setAuthenticationMode(esp_ble_auth_req_t auth_req); - void setCapability(esp_ble_io_cap_t iocap); - void setInitEncryptionKey(uint8_t init_key); - void setRespEncryptionKey(uint8_t resp_key); - void setKeySize(uint8_t key_size = 16); - static char* esp_key_type_to_str(esp_ble_key_type_t key_type); - -private: - esp_ble_auth_req_t m_authReq; - esp_ble_io_cap_t m_iocap; - uint8_t m_initKey; - uint8_t m_respKey; - uint8_t m_keySize; - -}; // BLESecurity - - -/* - * @brief Callbacks to handle GAP events related to authorization - */ -class BLESecurityCallbacks { -public: - virtual ~BLESecurityCallbacks() {}; - - /** - * @brief Its request from peer device to input authentication pin code displayed on peer device. - * It requires that our device is capable to input 6-digits code by end user - * @return Return 6-digits integer value from input device - */ - virtual uint32_t onPassKeyRequest() = 0; - - /** - * @brief Provide us 6-digits code to perform authentication. - * It requires that our device is capable to display this code to end user - * @param - */ - virtual void onPassKeyNotify(uint32_t pass_key) = 0; - - /** - * @brief Here we can make decision if we want to let negotiate authorization with peer device or not - * return Return true if we accept this peer device request - */ - - virtual bool onSecurityRequest() = 0 ; - /** - * Provide us information when authentication process is completed - */ - virtual void onAuthenticationComplete(esp_ble_auth_cmpl_t) = 0; - - virtual bool onConfirmPIN(uint32_t pin) = 0; -}; // BLESecurityCallbacks - -#endif // CONFIG_BT_ENABLED -#endif // COMPONENTS_CPP_UTILS_BLESECURITY_H_ diff --git a/libraries/BLE/src/BLEServer.cpp b/libraries/BLE/src/BLEServer.cpp deleted file mode 100644 index 73d60c81cfe..00000000000 --- a/libraries/BLE/src/BLEServer.cpp +++ /dev/null @@ -1,420 +0,0 @@ -/* - * BLEServer.cpp - * - * Created on: Apr 16, 2017 - * Author: kolban - */ - -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include -#include -#include "GeneralUtils.h" -#include "BLEDevice.h" -#include "BLEServer.h" -#include "BLEService.h" -#include "BLEUtils.h" -#include -#include -#include -#include "esp32-hal-log.h" - -/** - * @brief Construct a %BLE Server - * - * This class is not designed to be individually instantiated. Instead one should create a server by asking - * the BLEDevice class. - */ -BLEServer::BLEServer() { - m_appId = ESP_GATT_IF_NONE; - m_gatts_if = ESP_GATT_IF_NONE; - m_connectedCount = 0; - m_connId = ESP_GATT_IF_NONE; - m_pServerCallbacks = nullptr; -} // BLEServer - - -void BLEServer::createApp(uint16_t appId) { - m_appId = appId; - registerApp(appId); -} // createApp - - -/** - * @brief Create a %BLE Service. - * - * With a %BLE server, we can host one or more services. Invoking this function causes the creation of a definition - * of a new service. Every service must have a unique UUID. - * @param [in] uuid The UUID of the new service. - * @return A reference to the new service object. - */ -BLEService* BLEServer::createService(const char* uuid) { - return createService(BLEUUID(uuid)); -} - - -/** - * @brief Create a %BLE Service. - * - * With a %BLE server, we can host one or more services. Invoking this function causes the creation of a definition - * of a new service. Every service must have a unique UUID. - * @param [in] uuid The UUID of the new service. - * @param [in] numHandles The maximum number of handles associated with this service. - * @param [in] inst_id With multiple services with the same UUID we need to provide inst_id value different for each service. - * @return A reference to the new service object. - */ -BLEService* BLEServer::createService(BLEUUID uuid, uint32_t numHandles, uint8_t inst_id) { - log_v(">> createService - %s", uuid.toString().c_str()); - m_semaphoreCreateEvt.take("createService"); - - // Check that a service with the supplied UUID does not already exist. - if (m_serviceMap.getByUUID(uuid) != nullptr) { - log_w("<< Attempt to create a new service with uuid %s but a service with that UUID already exists.", - uuid.toString().c_str()); - } - - BLEService* pService = new BLEService(uuid, numHandles); - pService->m_instId = inst_id; - m_serviceMap.setByUUID(uuid, pService); // Save a reference to this service being on this server. - pService->executeCreate(this); // Perform the API calls to actually create the service. - - m_semaphoreCreateEvt.wait("createService"); - - log_v("<< createService"); - return pService; -} // createService - - -/** - * @brief Get a %BLE Service by its UUID - * @param [in] uuid The UUID of the new service. - * @return A reference to the service object. - */ -BLEService* BLEServer::getServiceByUUID(const char* uuid) { - return m_serviceMap.getByUUID(uuid); -} - -/** - * @brief Get a %BLE Service by its UUID - * @param [in] uuid The UUID of the new service. - * @return A reference to the service object. - */ -BLEService* BLEServer::getServiceByUUID(BLEUUID uuid) { - return m_serviceMap.getByUUID(uuid); -} - -/** - * @brief Retrieve the advertising object that can be used to advertise the existence of the server. - * - * @return An advertising object. - */ -BLEAdvertising* BLEServer::getAdvertising() { - return BLEDevice::getAdvertising(); -} - -uint16_t BLEServer::getConnId() { - return m_connId; -} - - -/** - * @brief Return the number of connected clients. - * @return The number of connected clients. - */ -uint32_t BLEServer::getConnectedCount() { - return m_connectedCount; -} // getConnectedCount - - -uint16_t BLEServer::getGattsIf() { - return m_gatts_if; -} - - -/** - * @brief Handle a GATT Server Event. - * - * @param [in] event - * @param [in] gatts_if - * @param [in] param - * - */ -void BLEServer::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t* param) { - log_v(">> handleGATTServerEvent: %s", - BLEUtils::gattServerEventTypeToString(event).c_str()); - - switch(event) { - // ESP_GATTS_ADD_CHAR_EVT - Indicate that a characteristic was added to the service. - // add_char: - // - esp_gatt_status_t status - // - uint16_t attr_handle - // - uint16_t service_handle - // - esp_bt_uuid_t char_uuid - // - case ESP_GATTS_ADD_CHAR_EVT: { - break; - } // ESP_GATTS_ADD_CHAR_EVT - - case ESP_GATTS_MTU_EVT: - updatePeerMTU(param->mtu.conn_id, param->mtu.mtu); - break; - - // ESP_GATTS_CONNECT_EVT - // connect: - // - uint16_t conn_id - // - esp_bd_addr_t remote_bda - // - case ESP_GATTS_CONNECT_EVT: { - m_connId = param->connect.conn_id; - addPeerDevice((void*)this, false, m_connId); - if (m_pServerCallbacks != nullptr) { - m_pServerCallbacks->onConnect(this); - m_pServerCallbacks->onConnect(this, param); - } - m_connectedCount++; // Increment the number of connected devices count. - break; - } // ESP_GATTS_CONNECT_EVT - - - // ESP_GATTS_CREATE_EVT - // Called when a new service is registered as having been created. - // - // create: - // * esp_gatt_status_t status - // * uint16_t service_handle - // * esp_gatt_srvc_id_t service_id - // - case ESP_GATTS_CREATE_EVT: { - BLEService* pService = m_serviceMap.getByUUID(param->create.service_id.id.uuid, param->create.service_id.id.inst_id); // <--- very big bug for multi services with the same uuid - m_serviceMap.setByHandle(param->create.service_handle, pService); - m_semaphoreCreateEvt.give(); - break; - } // ESP_GATTS_CREATE_EVT - - - // ESP_GATTS_DISCONNECT_EVT - // - // disconnect - // - uint16_t conn_id - // - esp_bd_addr_t remote_bda - // - esp_gatt_conn_reason_t reason - // - // If we receive a disconnect event then invoke the callback for disconnects (if one is present). - // we also want to start advertising again. - case ESP_GATTS_DISCONNECT_EVT: { - m_connectedCount--; // Decrement the number of connected devices count. - if (m_pServerCallbacks != nullptr) { // If we have callbacks, call now. - m_pServerCallbacks->onDisconnect(this); - } - startAdvertising(); //- do this with some delay from the loop() - removePeerDevice(param->disconnect.conn_id, false); - break; - } // ESP_GATTS_DISCONNECT_EVT - - - // ESP_GATTS_READ_EVT - A request to read the value of a characteristic has arrived. - // - // read: - // - uint16_t conn_id - // - uint32_t trans_id - // - esp_bd_addr_t bda - // - uint16_t handle - // - uint16_t offset - // - bool is_long - // - bool need_rsp - // - case ESP_GATTS_READ_EVT: { - break; - } // ESP_GATTS_READ_EVT - - - // ESP_GATTS_REG_EVT - // reg: - // - esp_gatt_status_t status - // - uint16_t app_id - // - case ESP_GATTS_REG_EVT: { - m_gatts_if = gatts_if; - m_semaphoreRegisterAppEvt.give(); // Unlock the mutex waiting for the registration of the app. - break; - } // ESP_GATTS_REG_EVT - - - // ESP_GATTS_WRITE_EVT - A request to write the value of a characteristic has arrived. - // - // write: - // - uint16_t conn_id - // - uint16_t trans_id - // - esp_bd_addr_t bda - // - uint16_t handle - // - uint16_t offset - // - bool need_rsp - // - bool is_prep - // - uint16_t len - // - uint8_t* value - // - case ESP_GATTS_WRITE_EVT: { - break; - } - - case ESP_GATTS_OPEN_EVT: - m_semaphoreOpenEvt.give(param->open.status); - break; - - default: - break; - } - - // Invoke the handler for every Service we have. - m_serviceMap.handleGATTServerEvent(event, gatts_if, param); - - log_v("<< handleGATTServerEvent"); -} // handleGATTServerEvent - - -/** - * @brief Register the app. - * - * @return N/A - */ -void BLEServer::registerApp(uint16_t m_appId) { - log_v(">> registerApp - %d", m_appId); - m_semaphoreRegisterAppEvt.take("registerApp"); // Take the mutex, will be released by ESP_GATTS_REG_EVT event. - ::esp_ble_gatts_app_register(m_appId); - m_semaphoreRegisterAppEvt.wait("registerApp"); - log_v("<< registerApp"); -} // registerApp - - -/** - * @brief Set the server callbacks. - * - * As a %BLE server operates, it will generate server level events such as a new client connecting or a previous client - * disconnecting. This function can be called to register a callback handler that will be invoked when these - * events are detected. - * - * @param [in] pCallbacks The callbacks to be invoked. - */ -void BLEServer::setCallbacks(BLEServerCallbacks* pCallbacks) { - m_pServerCallbacks = pCallbacks; -} // setCallbacks - -/* - * Remove service - */ -void BLEServer::removeService(BLEService* service) { - service->stop(); - service->executeDelete(); - m_serviceMap.removeService(service); -} - -/** - * @brief Start advertising. - * - * Start the server advertising its existence. This is a convenience function and is equivalent to - * retrieving the advertising object and invoking start upon it. - */ -void BLEServer::startAdvertising() { - log_v(">> startAdvertising"); - BLEDevice::startAdvertising(); - log_v("<< startAdvertising"); -} // startAdvertising - -/** - * Allow to connect GATT server to peer device - * Probably can be used in ANCS for iPhone - */ -bool BLEServer::connect(BLEAddress address) { - esp_bd_addr_t addr; - memcpy(&addr, address.getNative(), 6); - // Perform the open connection request against the target BLE Server. - m_semaphoreOpenEvt.take("connect"); - esp_err_t errRc = ::esp_ble_gatts_open( - getGattsIf(), - addr, // address - 1 // direct connection - ); - if (errRc != ESP_OK) { - log_e("esp_ble_gattc_open: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return false; - } - - uint32_t rc = m_semaphoreOpenEvt.wait("connect"); // Wait for the connection to complete. - log_v("<< connect(), rc=%d", rc==ESP_GATT_OK); - return rc == ESP_GATT_OK; -} // connect - - - -void BLEServerCallbacks::onConnect(BLEServer* pServer) { - log_d("BLEServerCallbacks", ">> onConnect(): Default"); - log_d("BLEServerCallbacks", "Device: %s", BLEDevice::toString().c_str()); - log_d("BLEServerCallbacks", "<< onConnect()"); -} // onConnect - -void BLEServerCallbacks::onConnect(BLEServer* pServer, esp_ble_gatts_cb_param_t* param) { - log_d("BLEServerCallbacks", ">> onConnect(): Default"); - log_d("BLEServerCallbacks", "Device: %s", BLEDevice::toString().c_str()); - log_d("BLEServerCallbacks", "<< onConnect()"); -} // onConnect - - -void BLEServerCallbacks::onDisconnect(BLEServer* pServer) { - log_d("BLEServerCallbacks", ">> onDisconnect(): Default"); - log_d("BLEServerCallbacks", "Device: %s", BLEDevice::toString().c_str()); - log_d("BLEServerCallbacks", "<< onDisconnect()"); -} // onDisconnect - -/* multi connect support */ -/* TODO do some more tweaks */ -void BLEServer::updatePeerMTU(uint16_t conn_id, uint16_t mtu) { - // set mtu in conn_status_t - const std::map::iterator it = m_connectedServersMap.find(conn_id); - if (it != m_connectedServersMap.end()) { - it->second.mtu = mtu; - std::swap(m_connectedServersMap[conn_id], it->second); - } -} - -std::map BLEServer::getPeerDevices(bool _client) { - return m_connectedServersMap; -} - - -uint16_t BLEServer::getPeerMTU(uint16_t conn_id) { - return m_connectedServersMap.find(conn_id)->second.mtu; -} - -void BLEServer::addPeerDevice(void* peer, bool _client, uint16_t conn_id) { - conn_status_t status = { - .peer_device = peer, - .connected = true, - .mtu = 23 - }; - - m_connectedServersMap.insert(std::pair(conn_id, status)); -} - -void BLEServer::removePeerDevice(uint16_t conn_id, bool _client) { - m_connectedServersMap.erase(conn_id); -} -/* multi connect support */ - -/** - * Update connection parameters can be called only after connection has been established - */ -void BLEServer::updateConnParams(esp_bd_addr_t remote_bda, uint16_t minInterval, uint16_t maxInterval, uint16_t latency, uint16_t timeout) { - esp_ble_conn_update_params_t conn_params; - memcpy(conn_params.bda, remote_bda, sizeof(esp_bd_addr_t)); - conn_params.latency = latency; - conn_params.max_int = maxInterval; // max_int = 0x20*1.25ms = 40ms - conn_params.min_int = minInterval; // min_int = 0x10*1.25ms = 20ms - conn_params.timeout = timeout; // timeout = 400*10ms = 4000ms - esp_ble_gap_update_conn_params(&conn_params); -} - -void BLEServer::disconnect(uint16_t connId) { - esp_ble_gatts_close(m_gatts_if, connId); -} - -#endif // CONFIG_BT_ENABLED diff --git a/libraries/BLE/src/BLEServer.h b/libraries/BLE/src/BLEServer.h deleted file mode 100644 index d2f8038d268..00000000000 --- a/libraries/BLE/src/BLEServer.h +++ /dev/null @@ -1,141 +0,0 @@ -/* - * BLEServer.h - * - * Created on: Apr 16, 2017 - * Author: kolban - */ - -#ifndef COMPONENTS_CPP_UTILS_BLESERVER_H_ -#define COMPONENTS_CPP_UTILS_BLESERVER_H_ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include - -#include -#include -// #include "BLEDevice.h" - -#include "BLEUUID.h" -#include "BLEAdvertising.h" -#include "BLECharacteristic.h" -#include "BLEService.h" -#include "BLESecurity.h" -#include "FreeRTOS.h" -#include "BLEAddress.h" - -class BLEServerCallbacks; -/* TODO possibly refactor this struct */ -typedef struct { - void *peer_device; // peer device BLEClient or BLEServer - maybe its better to have 2 structures or union here - bool connected; // do we need it? - uint16_t mtu; // every peer device negotiate own mtu -} conn_status_t; - - -/** - * @brief A data structure that manages the %BLE servers owned by a BLE server. - */ -class BLEServiceMap { -public: - BLEService* getByHandle(uint16_t handle); - BLEService* getByUUID(const char* uuid); - BLEService* getByUUID(BLEUUID uuid, uint8_t inst_id = 0); - void handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t* param); - void setByHandle(uint16_t handle, BLEService* service); - void setByUUID(const char* uuid, BLEService* service); - void setByUUID(BLEUUID uuid, BLEService* service); - std::string toString(); - BLEService* getFirst(); - BLEService* getNext(); - void removeService(BLEService *service); - int getRegisteredServiceCount(); - -private: - std::map m_handleMap; - std::map m_uuidMap; - std::map::iterator m_iterator; -}; - - -/** - * @brief The model of a %BLE server. - */ -class BLEServer { -public: - uint32_t getConnectedCount(); - BLEService* createService(const char* uuid); - BLEService* createService(BLEUUID uuid, uint32_t numHandles=15, uint8_t inst_id=0); - BLEAdvertising* getAdvertising(); - void setCallbacks(BLEServerCallbacks* pCallbacks); - void startAdvertising(); - void removeService(BLEService* service); - BLEService* getServiceByUUID(const char* uuid); - BLEService* getServiceByUUID(BLEUUID uuid); - bool connect(BLEAddress address); - void disconnect(uint16_t connId); - uint16_t m_appId; - void updateConnParams(esp_bd_addr_t remote_bda, uint16_t minInterval, uint16_t maxInterval, uint16_t latency, uint16_t timeout); - - /* multi connection support */ - std::map getPeerDevices(bool client); - void addPeerDevice(void* peer, bool is_client, uint16_t conn_id); - void removePeerDevice(uint16_t conn_id, bool client); - BLEServer* getServerByConnId(uint16_t conn_id); - void updatePeerMTU(uint16_t connId, uint16_t mtu); - uint16_t getPeerMTU(uint16_t conn_id); - uint16_t getConnId(); - - -private: - BLEServer(); - friend class BLEService; - friend class BLECharacteristic; - friend class BLEDevice; - esp_ble_adv_data_t m_adv_data; - // BLEAdvertising m_bleAdvertising; - uint16_t m_connId; - uint32_t m_connectedCount; - uint16_t m_gatts_if; - std::map m_connectedServersMap; - - FreeRTOS::Semaphore m_semaphoreRegisterAppEvt = FreeRTOS::Semaphore("RegisterAppEvt"); - FreeRTOS::Semaphore m_semaphoreCreateEvt = FreeRTOS::Semaphore("CreateEvt"); - FreeRTOS::Semaphore m_semaphoreOpenEvt = FreeRTOS::Semaphore("OpenEvt"); - BLEServiceMap m_serviceMap; - BLEServerCallbacks* m_pServerCallbacks = nullptr; - - void createApp(uint16_t appId); - uint16_t getGattsIf(); - void handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param); - void registerApp(uint16_t); -}; // BLEServer - - -/** - * @brief Callbacks associated with the operation of a %BLE server. - */ -class BLEServerCallbacks { -public: - virtual ~BLEServerCallbacks() {}; - /** - * @brief Handle a new client connection. - * - * When a new client connects, we are invoked. - * - * @param [in] pServer A reference to the %BLE server that received the client connection. - */ - virtual void onConnect(BLEServer* pServer); - virtual void onConnect(BLEServer* pServer, esp_ble_gatts_cb_param_t *param); - /** - * @brief Handle an existing client disconnection. - * - * When an existing client disconnects, we are invoked. - * - * @param [in] pServer A reference to the %BLE server that received the existing client disconnection. - */ - virtual void onDisconnect(BLEServer* pServer); -}; // BLEServerCallbacks - - -#endif /* CONFIG_BT_ENABLED */ -#endif /* COMPONENTS_CPP_UTILS_BLESERVER_H_ */ diff --git a/libraries/BLE/src/BLEService.cpp b/libraries/BLE/src/BLEService.cpp deleted file mode 100644 index 3ea6141c0d4..00000000000 --- a/libraries/BLE/src/BLEService.cpp +++ /dev/null @@ -1,413 +0,0 @@ -/* - * BLEService.cpp - * - * Created on: Mar 25, 2017 - * Author: kolban - */ - -// A service is identified by a UUID. A service is also the container for one or more characteristics. - -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include -#include - -#include -#include -#include - -#include "BLEServer.h" -#include "BLEService.h" -#include "BLEUtils.h" -#include "GeneralUtils.h" -#include "esp32-hal-log.h" - -#define NULL_HANDLE (0xffff) - - -/** - * @brief Construct an instance of the BLEService - * @param [in] uuid The UUID of the service. - * @param [in] numHandles The maximum number of handles associated with the service. - */ -BLEService::BLEService(const char* uuid, uint16_t numHandles) : BLEService(BLEUUID(uuid), numHandles) { -} - - -/** - * @brief Construct an instance of the BLEService - * @param [in] uuid The UUID of the service. - * @param [in] numHandles The maximum number of handles associated with the service. - */ -BLEService::BLEService(BLEUUID uuid, uint16_t numHandles) { - m_uuid = uuid; - m_handle = NULL_HANDLE; - m_pServer = nullptr; - //m_serializeMutex.setName("BLEService"); - m_lastCreatedCharacteristic = nullptr; - m_numHandles = numHandles; -} // BLEService - - -/** - * @brief Create the service. - * Create the service. - * @param [in] gatts_if The handle of the GATT server interface. - * @return N/A. - */ - -void BLEService::executeCreate(BLEServer* pServer) { - log_v(">> executeCreate() - Creating service (esp_ble_gatts_create_service) service uuid: %s", getUUID().toString().c_str()); - m_pServer = pServer; - m_semaphoreCreateEvt.take("executeCreate"); // Take the mutex and release at event ESP_GATTS_CREATE_EVT - - esp_gatt_srvc_id_t srvc_id; - srvc_id.is_primary = true; - srvc_id.id.inst_id = m_instId; - srvc_id.id.uuid = *m_uuid.getNative(); - esp_err_t errRc = ::esp_ble_gatts_create_service(getServer()->getGattsIf(), &srvc_id, m_numHandles); // The maximum number of handles associated with the service. - - if (errRc != ESP_OK) { - log_e("esp_ble_gatts_create_service: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; - } - - m_semaphoreCreateEvt.wait("executeCreate"); - log_v("<< executeCreate"); -} // executeCreate - - -/** - * @brief Delete the service. - * Delete the service. - * @return N/A. - */ - -void BLEService::executeDelete() { - log_v(">> executeDelete()"); - m_semaphoreDeleteEvt.take("executeDelete"); // Take the mutex and release at event ESP_GATTS_DELETE_EVT - - esp_err_t errRc = ::esp_ble_gatts_delete_service(getHandle()); - - if (errRc != ESP_OK) { - log_e("esp_ble_gatts_delete_service: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; - } - - m_semaphoreDeleteEvt.wait("executeDelete"); - log_v("<< executeDelete"); -} // executeDelete - - -/** - * @brief Dump details of this BLE GATT service. - * @return N/A. - */ -void BLEService::dump() { - log_d("Service: uuid:%s, handle: 0x%.2x", - m_uuid.toString().c_str(), - m_handle); - log_d("Characteristics:\n%s", m_characteristicMap.toString().c_str()); -} // dump - - -/** - * @brief Get the UUID of the service. - * @return the UUID of the service. - */ -BLEUUID BLEService::getUUID() { - return m_uuid; -} // getUUID - - -/** - * @brief Start the service. - * Here we wish to start the service which means that we will respond to partner requests about it. - * Starting a service also means that we can create the corresponding characteristics. - * @return Start the service. - */ -void BLEService::start() { -// We ask the BLE runtime to start the service and then create each of the characteristics. -// We start the service through its local handle which was returned in the ESP_GATTS_CREATE_EVT event -// obtained as a result of calling esp_ble_gatts_create_service(). -// - log_v(">> start(): Starting service (esp_ble_gatts_start_service): %s", toString().c_str()); - if (m_handle == NULL_HANDLE) { - log_e("<< !!! We attempted to start a service but don't know its handle!"); - return; - } - - BLECharacteristic *pCharacteristic = m_characteristicMap.getFirst(); - - while (pCharacteristic != nullptr) { - m_lastCreatedCharacteristic = pCharacteristic; - pCharacteristic->executeCreate(this); - - pCharacteristic = m_characteristicMap.getNext(); - } - // Start each of the characteristics ... these are found in the m_characteristicMap. - - m_semaphoreStartEvt.take("start"); - esp_err_t errRc = ::esp_ble_gatts_start_service(m_handle); - - if (errRc != ESP_OK) { - log_e("<< esp_ble_gatts_start_service: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; - } - m_semaphoreStartEvt.wait("start"); - - log_v("<< start()"); -} // start - - -/** - * @brief Stop the service. - */ -void BLEService::stop() { -// We ask the BLE runtime to start the service and then create each of the characteristics. -// We start the service through its local handle which was returned in the ESP_GATTS_CREATE_EVT event -// obtained as a result of calling esp_ble_gatts_create_service(). - log_v(">> stop(): Stopping service (esp_ble_gatts_stop_service): %s", toString().c_str()); - if (m_handle == NULL_HANDLE) { - log_e("<< !!! We attempted to stop a service but don't know its handle!"); - return; - } - - m_semaphoreStopEvt.take("stop"); - esp_err_t errRc = ::esp_ble_gatts_stop_service(m_handle); - - if (errRc != ESP_OK) { - log_e("<< esp_ble_gatts_stop_service: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; - } - m_semaphoreStopEvt.wait("stop"); - - log_v("<< stop()"); -} // start - - -/** - * @brief Set the handle associated with this service. - * @param [in] handle The handle associated with the service. - */ -void BLEService::setHandle(uint16_t handle) { - log_v(">> setHandle - Handle=0x%.2x, service UUID=%s)", handle, getUUID().toString().c_str()); - if (m_handle != NULL_HANDLE) { - log_e("!!! Handle is already set %.2x", m_handle); - return; - } - m_handle = handle; - log_v("<< setHandle"); -} // setHandle - - -/** - * @brief Get the handle associated with this service. - * @return The handle associated with this service. - */ -uint16_t BLEService::getHandle() { - return m_handle; -} // getHandle - - -/** - * @brief Add a characteristic to the service. - * @param [in] pCharacteristic A pointer to the characteristic to be added. - */ -void BLEService::addCharacteristic(BLECharacteristic* pCharacteristic) { - // We maintain a mapping of characteristics owned by this service. These are managed by the - // BLECharacteristicMap class instance found in m_characteristicMap. We add the characteristic - // to the map and then ask the service to add the characteristic at the BLE level (ESP-IDF). - - log_v(">> addCharacteristic()"); - log_d("Adding characteristic: uuid=%s to service: %s", - pCharacteristic->getUUID().toString().c_str(), - toString().c_str()); - - // Check that we don't add the same characteristic twice. - if (m_characteristicMap.getByUUID(pCharacteristic->getUUID()) != nullptr) { - log_w("<< Adding a new characteristic with the same UUID as a previous one"); - //return; - } - - // Remember this characteristic in our map of characteristics. At this point, we can lookup by UUID - // but not by handle. The handle is allocated to us on the ESP_GATTS_ADD_CHAR_EVT. - m_characteristicMap.setByUUID(pCharacteristic, pCharacteristic->getUUID()); - - log_v("<< addCharacteristic()"); -} // addCharacteristic - - -/** - * @brief Create a new BLE Characteristic associated with this service. - * @param [in] uuid - The UUID of the characteristic. - * @param [in] properties - The properties of the characteristic. - * @return The new BLE characteristic. - */ -BLECharacteristic* BLEService::createCharacteristic(const char* uuid, uint32_t properties) { - return createCharacteristic(BLEUUID(uuid), properties); -} - - -/** - * @brief Create a new BLE Characteristic associated with this service. - * @param [in] uuid - The UUID of the characteristic. - * @param [in] properties - The properties of the characteristic. - * @return The new BLE characteristic. - */ -BLECharacteristic* BLEService::createCharacteristic(BLEUUID uuid, uint32_t properties) { - BLECharacteristic* pCharacteristic = new BLECharacteristic(uuid, properties); - addCharacteristic(pCharacteristic); - return pCharacteristic; -} // createCharacteristic - - -/** - * @brief Handle a GATTS server event. - */ -void BLEService::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t* param) { - switch (event) { - // ESP_GATTS_ADD_CHAR_EVT - Indicate that a characteristic was added to the service. - // add_char: - // - esp_gatt_status_t status - // - uint16_t attr_handle - // - uint16_t service_handle - // - esp_bt_uuid_t char_uuid - - // If we have reached the correct service, then locate the characteristic and remember the handle - // for that characteristic. - case ESP_GATTS_ADD_CHAR_EVT: { - if (m_handle == param->add_char.service_handle) { - BLECharacteristic *pCharacteristic = getLastCreatedCharacteristic(); - if (pCharacteristic == nullptr) { - log_e("Expected to find characteristic with UUID: %s, but didnt!", - BLEUUID(param->add_char.char_uuid).toString().c_str()); - dump(); - break; - } - pCharacteristic->setHandle(param->add_char.attr_handle); - m_characteristicMap.setByHandle(param->add_char.attr_handle, pCharacteristic); - break; - } // Reached the correct service. - break; - } // ESP_GATTS_ADD_CHAR_EVT - - - // ESP_GATTS_START_EVT - // - // start: - // esp_gatt_status_t status - // uint16_t service_handle - case ESP_GATTS_START_EVT: { - if (param->start.service_handle == getHandle()) { - m_semaphoreStartEvt.give(); - } - break; - } // ESP_GATTS_START_EVT - - // ESP_GATTS_STOP_EVT - // - // stop: - // esp_gatt_status_t status - // uint16_t service_handle - // - case ESP_GATTS_STOP_EVT: { - if (param->stop.service_handle == getHandle()) { - m_semaphoreStopEvt.give(); - } - break; - } // ESP_GATTS_STOP_EVT - - - // ESP_GATTS_CREATE_EVT - // Called when a new service is registered as having been created. - // - // create: - // * esp_gatt_status_t status - // * uint16_t service_handle - // * esp_gatt_srvc_id_t service_id - // * - esp_gatt_id id - // * - esp_bt_uuid uuid - // * - uint8_t inst_id - // * - bool is_primary - // - case ESP_GATTS_CREATE_EVT: { - if (getUUID().equals(BLEUUID(param->create.service_id.id.uuid)) && m_instId == param->create.service_id.id.inst_id) { - setHandle(param->create.service_handle); - m_semaphoreCreateEvt.give(); - } - break; - } // ESP_GATTS_CREATE_EVT - - - // ESP_GATTS_DELETE_EVT - // Called when a service is deleted. - // - // delete: - // * esp_gatt_status_t status - // * uint16_t service_handle - // - case ESP_GATTS_DELETE_EVT: { - if (param->del.service_handle == getHandle()) { - m_semaphoreDeleteEvt.give(); - } - break; - } // ESP_GATTS_DELETE_EVT - - default: - break; - } // Switch - - // Invoke the GATTS handler in each of the associated characteristics. - m_characteristicMap.handleGATTServerEvent(event, gatts_if, param); -} // handleGATTServerEvent - - -BLECharacteristic* BLEService::getCharacteristic(const char* uuid) { - return getCharacteristic(BLEUUID(uuid)); -} - - -BLECharacteristic* BLEService::getCharacteristic(BLEUUID uuid) { - return m_characteristicMap.getByUUID(uuid); -} - - -/** - * @brief Return a string representation of this service. - * A service is defined by: - * * Its UUID - * * Its handle - * @return A string representation of this service. - */ -std::string BLEService::toString() { - std::string res = "UUID: " + getUUID().toString(); - char hex[5]; - snprintf(hex, sizeof(hex), "%04x", getHandle()); - res += ", handle: 0x"; - res += hex; - return res; -} // toString - - -/** - * @brief Get the last created characteristic. - * It is lamentable that this function has to exist. It returns the last created characteristic. - * We need this because the descriptor API is built around the notion that a new descriptor, when created, - * is associated with the last characteristics created and we need that information. - * @return The last created characteristic. - */ -BLECharacteristic* BLEService::getLastCreatedCharacteristic() { - return m_lastCreatedCharacteristic; -} // getLastCreatedCharacteristic - - -/** - * @brief Get the BLE server associated with this service. - * @return The BLEServer associated with this service. - */ -BLEServer* BLEService::getServer() { - return m_pServer; -} // getServer - -#endif // CONFIG_BT_ENABLED diff --git a/libraries/BLE/src/BLEService.h b/libraries/BLE/src/BLEService.h deleted file mode 100644 index b42d57f2afb..00000000000 --- a/libraries/BLE/src/BLEService.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * BLEService.h - * - * Created on: Mar 25, 2017 - * Author: kolban - */ - -#ifndef COMPONENTS_CPP_UTILS_BLESERVICE_H_ -#define COMPONENTS_CPP_UTILS_BLESERVICE_H_ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) - -#include - -#include "BLECharacteristic.h" -#include "BLEServer.h" -#include "BLEUUID.h" -#include "FreeRTOS.h" - -class BLEServer; - -/** - * @brief A data mapping used to manage the set of %BLE characteristics known to the server. - */ -class BLECharacteristicMap { -public: - void setByUUID(BLECharacteristic* pCharacteristic, const char* uuid); - void setByUUID(BLECharacteristic* pCharacteristic, BLEUUID uuid); - void setByHandle(uint16_t handle, BLECharacteristic* pCharacteristic); - BLECharacteristic* getByUUID(const char* uuid); - BLECharacteristic* getByUUID(BLEUUID uuid); - BLECharacteristic* getByHandle(uint16_t handle); - BLECharacteristic* getFirst(); - BLECharacteristic* getNext(); - std::string toString(); - void handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t* param); - -private: - std::map m_uuidMap; - std::map m_handleMap; - std::map::iterator m_iterator; -}; - - -/** - * @brief The model of a %BLE service. - * - */ -class BLEService { -public: - void addCharacteristic(BLECharacteristic* pCharacteristic); - BLECharacteristic* createCharacteristic(const char* uuid, uint32_t properties); - BLECharacteristic* createCharacteristic(BLEUUID uuid, uint32_t properties); - void dump(); - void executeCreate(BLEServer* pServer); - void executeDelete(); - BLECharacteristic* getCharacteristic(const char* uuid); - BLECharacteristic* getCharacteristic(BLEUUID uuid); - BLEUUID getUUID(); - BLEServer* getServer(); - void start(); - void stop(); - std::string toString(); - uint16_t getHandle(); - uint8_t m_instId = 0; - -private: - BLEService(const char* uuid, uint16_t numHandles); - BLEService(BLEUUID uuid, uint16_t numHandles); - friend class BLEServer; - friend class BLEServiceMap; - friend class BLEDescriptor; - friend class BLECharacteristic; - friend class BLEDevice; - - BLECharacteristicMap m_characteristicMap; - uint16_t m_handle; - BLECharacteristic* m_lastCreatedCharacteristic = nullptr; - BLEServer* m_pServer = nullptr; - BLEUUID m_uuid; - - FreeRTOS::Semaphore m_semaphoreCreateEvt = FreeRTOS::Semaphore("CreateEvt"); - FreeRTOS::Semaphore m_semaphoreDeleteEvt = FreeRTOS::Semaphore("DeleteEvt"); - FreeRTOS::Semaphore m_semaphoreStartEvt = FreeRTOS::Semaphore("StartEvt"); - FreeRTOS::Semaphore m_semaphoreStopEvt = FreeRTOS::Semaphore("StopEvt"); - - uint16_t m_numHandles; - - BLECharacteristic* getLastCreatedCharacteristic(); - void handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t* param); - void setHandle(uint16_t handle); - //void setService(esp_gatt_srvc_id_t srvc_id); -}; // BLEService - - -#endif // CONFIG_BT_ENABLED -#endif /* COMPONENTS_CPP_UTILS_BLESERVICE_H_ */ diff --git a/libraries/BLE/src/BLEServiceMap.cpp b/libraries/BLE/src/BLEServiceMap.cpp deleted file mode 100644 index a8a1f8e567c..00000000000 --- a/libraries/BLE/src/BLEServiceMap.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/* - * BLEServiceMap.cpp - * - * Created on: Jun 22, 2017 - * Author: kolban - */ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include -#include -#include "BLEService.h" - - -/** - * @brief Return the service by UUID. - * @param [in] UUID The UUID to look up the service. - * @return The characteristic. - */ -BLEService* BLEServiceMap::getByUUID(const char* uuid) { - return getByUUID(BLEUUID(uuid)); -} - -/** - * @brief Return the service by UUID. - * @param [in] UUID The UUID to look up the service. - * @return The characteristic. - */ -BLEService* BLEServiceMap::getByUUID(BLEUUID uuid, uint8_t inst_id) { - for (auto &myPair : m_uuidMap) { - if (myPair.first->getUUID().equals(uuid)) { - return myPair.first; - } - } - //return m_uuidMap.at(uuid.toString()); - return nullptr; -} // getByUUID - - -/** - * @brief Return the service by handle. - * @param [in] handle The handle to look up the service. - * @return The service. - */ -BLEService* BLEServiceMap::getByHandle(uint16_t handle) { - return m_handleMap.at(handle); -} // getByHandle - - -/** - * @brief Set the service by UUID. - * @param [in] uuid The uuid of the service. - * @param [in] characteristic The service to cache. - * @return N/A. - */ -void BLEServiceMap::setByUUID(BLEUUID uuid, BLEService* service) { - m_uuidMap.insert(std::pair(service, uuid.toString())); -} // setByUUID - - -/** - * @brief Set the service by handle. - * @param [in] handle The handle of the service. - * @param [in] service The service to cache. - * @return N/A. - */ -void BLEServiceMap::setByHandle(uint16_t handle, BLEService* service) { - m_handleMap.insert(std::pair(handle, service)); -} // setByHandle - - -/** - * @brief Return a string representation of the service map. - * @return A string representation of the service map. - */ -std::string BLEServiceMap::toString() { - std::string res; - char hex[5]; - for (auto &myPair: m_handleMap) { - res += "handle: 0x"; - snprintf(hex, sizeof(hex), "%04x", myPair.first); - res += hex; - res += ", uuid: " + myPair.second->getUUID().toString() + "\n"; - } - return res; -} // toString - -void BLEServiceMap::handleGATTServerEvent( - esp_gatts_cb_event_t event, - esp_gatt_if_t gatts_if, - esp_ble_gatts_cb_param_t* param) { - // Invoke the handler for every Service we have. - for (auto &myPair : m_uuidMap) { - myPair.first->handleGATTServerEvent(event, gatts_if, param); - } -} - -/** - * @brief Get the first service in the map. - * @return The first service in the map. - */ -BLEService* BLEServiceMap::getFirst() { - m_iterator = m_uuidMap.begin(); - if (m_iterator == m_uuidMap.end()) return nullptr; - BLEService* pRet = m_iterator->first; - m_iterator++; - return pRet; -} // getFirst - -/** - * @brief Get the next service in the map. - * @return The next service in the map. - */ -BLEService* BLEServiceMap::getNext() { - if (m_iterator == m_uuidMap.end()) return nullptr; - BLEService* pRet = m_iterator->first; - m_iterator++; - return pRet; -} // getNext - -/** - * @brief Removes service from maps. - * @return N/A. - */ -void BLEServiceMap::removeService(BLEService* service) { - m_handleMap.erase(service->getHandle()); - m_uuidMap.erase(service); -} // removeService - -/** - * @brief Returns the amount of registered services - * @return amount of registered services - */ -int BLEServiceMap::getRegisteredServiceCount(){ - return m_handleMap.size(); -} - -#endif /* CONFIG_BT_ENABLED */ diff --git a/libraries/BLE/src/BLEUUID.cpp b/libraries/BLE/src/BLEUUID.cpp deleted file mode 100644 index 1a9473678b2..00000000000 --- a/libraries/BLE/src/BLEUUID.cpp +++ /dev/null @@ -1,386 +0,0 @@ -/* - * BLEUUID.cpp - * - * Created on: Jun 21, 2017 - * Author: kolban - */ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include -#include -#include -#include -#include -#include -#include "BLEUUID.h" -#include "esp32-hal-log.h" - -/** - * @brief Copy memory from source to target but in reverse order. - * - * When we move memory from one location it is normally: - * - * ``` - * [0][1][2]...[n] -> [0][1][2]...[n] - * ``` - * - * with this function, it is: - * - * ``` - * [0][1][2]...[n] -> [n][n-1][n-2]...[0] - * ``` - * - * @param [in] target The target of the copy - * @param [in] source The source of the copy - * @param [in] size The number of bytes to copy - */ -static void memrcpy(uint8_t* target, uint8_t* source, uint32_t size) { - assert(size > 0); - target += (size - 1); // Point target to the last byte of the target data - while (size > 0) { - *target = *source; - target--; - source++; - size--; - } -} // memrcpy - - -/** - * @brief Create a UUID from a string. - * - * Create a UUID from a string. There will be two possible stories here. Either the string represents - * a binary data field or the string represents a hex encoding of a UUID. - * For the hex encoding, here is an example: - * - * ``` - * "beb5483e-36e1-4688-b7f5-ea07361b26a8" - * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 - * 12345678-90ab-cdef-1234-567890abcdef - * ``` - * - * This has a length of 36 characters. We need to parse this into 16 bytes. - * - * @param [in] value The string to build a UUID from. - */ -BLEUUID::BLEUUID(std::string value) { - m_valueSet = true; - if (value.length() == 4) { - m_uuid.len = ESP_UUID_LEN_16; - m_uuid.uuid.uuid16 = 0; - for(int i=0;i '9') MSB -= 7; - if(LSB > '9') LSB -= 7; - m_uuid.uuid.uuid16 += (((MSB&0x0F) <<4) | (LSB & 0x0F))<<(2-i)*4; - i+=2; - } - } - else if (value.length() == 8) { - m_uuid.len = ESP_UUID_LEN_32; - m_uuid.uuid.uuid32 = 0; - for(int i=0;i '9') MSB -= 7; - if(LSB > '9') LSB -= 7; - m_uuid.uuid.uuid32 += (((MSB&0x0F) <<4) | (LSB & 0x0F))<<(6-i)*4; - i+=2; - } - } - else if (value.length() == 16) { // how we can have 16 byte length string reprezenting 128 bit uuid??? needs to be investigated (lack of time) - m_uuid.len = ESP_UUID_LEN_128; - memrcpy(m_uuid.uuid.uuid128, (uint8_t*)value.data(), 16); - } - else if (value.length() == 36) { - // If the length of the string is 36 bytes then we will assume it is a long hex string in - // UUID format. - m_uuid.len = ESP_UUID_LEN_128; - int n = 0; - for(int i=0;i '9') MSB -= 7; - if(LSB > '9') LSB -= 7; - m_uuid.uuid.uuid128[15-n++] = ((MSB&0x0F) <<4) | (LSB & 0x0F); - i+=2; - } - } - else { - log_e("ERROR: UUID value not 2, 4, 16 or 36 bytes"); - m_valueSet = false; - } -} //BLEUUID(std::string) - - -/** - * @brief Create a UUID from 16 bytes of memory. - * - * @param [in] pData The pointer to the start of the UUID. - * @param [in] size The size of the data. - * @param [in] msbFirst Is the MSB first in pData memory? - */ -BLEUUID::BLEUUID(uint8_t* pData, size_t size, bool msbFirst) { - if (size != 16) { - log_e("ERROR: UUID length not 16 bytes"); - return; - } - m_uuid.len = ESP_UUID_LEN_128; - if (msbFirst) { - memrcpy(m_uuid.uuid.uuid128, pData, 16); - } else { - memcpy(m_uuid.uuid.uuid128, pData, 16); - } - m_valueSet = true; -} // BLEUUID - - -/** - * @brief Create a UUID from the 16bit value. - * - * @param [in] uuid The 16bit short form UUID. - */ -BLEUUID::BLEUUID(uint16_t uuid) { - m_uuid.len = ESP_UUID_LEN_16; - m_uuid.uuid.uuid16 = uuid; - m_valueSet = true; -} // BLEUUID - - -/** - * @brief Create a UUID from the 32bit value. - * - * @param [in] uuid The 32bit short form UUID. - */ -BLEUUID::BLEUUID(uint32_t uuid) { - m_uuid.len = ESP_UUID_LEN_32; - m_uuid.uuid.uuid32 = uuid; - m_valueSet = true; -} // BLEUUID - - -/** - * @brief Create a UUID from the native UUID. - * - * @param [in] uuid The native UUID. - */ -BLEUUID::BLEUUID(esp_bt_uuid_t uuid) { - m_uuid = uuid; - m_valueSet = true; -} // BLEUUID - - -/** - * @brief Create a UUID from the ESP32 esp_gat_id_t. - * - * @param [in] gattId The data to create the UUID from. - */ -BLEUUID::BLEUUID(esp_gatt_id_t gattId) : BLEUUID(gattId.uuid) { -} // BLEUUID - - -BLEUUID::BLEUUID() { - m_valueSet = false; -} // BLEUUID - - -/** - * @brief Get the number of bits in this uuid. - * @return The number of bits in the UUID. One of 16, 32 or 128. - */ -uint8_t BLEUUID::bitSize() { - if (!m_valueSet) return 0; - switch (m_uuid.len) { - case ESP_UUID_LEN_16: - return 16; - case ESP_UUID_LEN_32: - return 32; - case ESP_UUID_LEN_128: - return 128; - default: - log_e("Unknown UUID length: %d", m_uuid.len); - return 0; - } // End of switch -} // bitSize - - -/** - * @brief Compare a UUID against this UUID. - * - * @param [in] uuid The UUID to compare against. - * @return True if the UUIDs are equal and false otherwise. - */ -bool BLEUUID::equals(BLEUUID uuid) { - //log_d("Comparing: %s to %s", toString().c_str(), uuid.toString().c_str()); - if (!m_valueSet || !uuid.m_valueSet) return false; - - if (uuid.m_uuid.len != m_uuid.len) { - return uuid.toString() == toString(); - } - - if (uuid.m_uuid.len == ESP_UUID_LEN_16) { - return uuid.m_uuid.uuid.uuid16 == m_uuid.uuid.uuid16; - } - - if (uuid.m_uuid.len == ESP_UUID_LEN_32) { - return uuid.m_uuid.uuid.uuid32 == m_uuid.uuid.uuid32; - } - - return memcmp(uuid.m_uuid.uuid.uuid128, m_uuid.uuid.uuid128, 16) == 0; -} // equals - - -/** - * Create a BLEUUID from a string of the form: - * 0xNNNN - * 0xNNNNNNNN - * 0x - * NNNN - * NNNNNNNN - * - */ -BLEUUID BLEUUID::fromString(std::string _uuid) { - uint8_t start = 0; - if (strstr(_uuid.c_str(), "0x") != nullptr) { // If the string starts with 0x, skip those characters. - start = 2; - } - uint8_t len = _uuid.length() - start; // Calculate the length of the string we are going to use. - - if(len == 4) { - uint16_t x = strtoul(_uuid.substr(start, len).c_str(), NULL, 16); - return BLEUUID(x); - } else if (len == 8) { - uint32_t x = strtoul(_uuid.substr(start, len).c_str(), NULL, 16); - return BLEUUID(x); - } else if (len == 36) { - return BLEUUID(_uuid); - } - return BLEUUID(); -} // fromString - - -/** - * @brief Get the native UUID value. - * - * @return The native UUID value or NULL if not set. - */ -esp_bt_uuid_t* BLEUUID::getNative() { - //log_d(">> getNative()") - if (m_valueSet == false) { - log_v("<< Return of un-initialized UUID!"); - return nullptr; - } - //log_d("<< getNative()"); - return &m_uuid; -} // getNative - - -/** - * @brief Convert a UUID to its 128 bit representation. - * - * A UUID can be internally represented as 16bit, 32bit or the full 128bit. This method - * will convert 16 or 32 bit representations to the full 128bit. - */ -BLEUUID BLEUUID::to128() { - //log_v(">> toFull() - %s", toString().c_str()); - - // If we either don't have a value or are already a 128 bit UUID, nothing further to do. - if (!m_valueSet || m_uuid.len == ESP_UUID_LEN_128) { - return *this; - } - - // If we are 16 bit or 32 bit, then set the 4 bytes of the variable part of the UUID. - if (m_uuid.len == ESP_UUID_LEN_16) { - uint16_t temp = m_uuid.uuid.uuid16; - m_uuid.uuid.uuid128[15] = 0; - m_uuid.uuid.uuid128[14] = 0; - m_uuid.uuid.uuid128[13] = (temp >> 8) & 0xff; - m_uuid.uuid.uuid128[12] = temp & 0xff; - - } - else if (m_uuid.len == ESP_UUID_LEN_32) { - uint32_t temp = m_uuid.uuid.uuid32; - m_uuid.uuid.uuid128[15] = (temp >> 24) & 0xff; - m_uuid.uuid.uuid128[14] = (temp >> 16) & 0xff; - m_uuid.uuid.uuid128[13] = (temp >> 8) & 0xff; - m_uuid.uuid.uuid128[12] = temp & 0xff; - } - - // Set the fixed parts of the UUID. - m_uuid.uuid.uuid128[11] = 0x00; - m_uuid.uuid.uuid128[10] = 0x00; - - m_uuid.uuid.uuid128[9] = 0x10; - m_uuid.uuid.uuid128[8] = 0x00; - - m_uuid.uuid.uuid128[7] = 0x80; - m_uuid.uuid.uuid128[6] = 0x00; - - m_uuid.uuid.uuid128[5] = 0x00; - m_uuid.uuid.uuid128[4] = 0x80; - m_uuid.uuid.uuid128[3] = 0x5f; - m_uuid.uuid.uuid128[2] = 0x9b; - m_uuid.uuid.uuid128[1] = 0x34; - m_uuid.uuid.uuid128[0] = 0xfb; - - m_uuid.len = ESP_UUID_LEN_128; - //log_d("<< toFull <- %s", toString().c_str()); - return *this; -} // to128 - - - - -/** - * @brief Get a string representation of the UUID. - * - * The format of a string is: - * 01234567 8901 2345 6789 012345678901 - * 0000180d-0000-1000-8000-00805f9b34fb - * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 - * - * @return A string representation of the UUID. - */ -std::string BLEUUID::toString() { - if (!m_valueSet) return ""; // If we have no value, nothing to format. - // If the UUIDs are 16 or 32 bit, pad correctly. - - if (m_uuid.len == ESP_UUID_LEN_16) { // If the UUID is 16bit, pad correctly. - char hex[9]; - snprintf(hex, sizeof(hex), "%08x", m_uuid.uuid.uuid16); - return std::string(hex) + "-0000-1000-8000-00805f9b34fb"; - } // End 16bit UUID - - if (m_uuid.len == ESP_UUID_LEN_32) { // If the UUID is 32bit, pad correctly. - char hex[9]; - snprintf(hex, sizeof(hex), "%08x", m_uuid.uuid.uuid32); - return std::string(hex) + "-0000-1000-8000-00805f9b34fb"; - } // End 32bit UUID - - // The UUID is not 16bit or 32bit which means that it is 128bit. - // - // UUID string format: - // AABBCCDD-EEFF-GGHH-IIJJ-KKLLMMNNOOPP - auto size = 37; // 32 for UUID data, 4 for '-' delimiters and one for a terminator == 37 chars - char *hex = (char *)malloc(size); - snprintf(hex, size, "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", - m_uuid.uuid.uuid128[15], m_uuid.uuid.uuid128[14], - m_uuid.uuid.uuid128[13], m_uuid.uuid.uuid128[12], - m_uuid.uuid.uuid128[11], m_uuid.uuid.uuid128[10], - m_uuid.uuid.uuid128[9], m_uuid.uuid.uuid128[8], - m_uuid.uuid.uuid128[7], m_uuid.uuid.uuid128[6], - m_uuid.uuid.uuid128[5], m_uuid.uuid.uuid128[4], - m_uuid.uuid.uuid128[3], m_uuid.uuid.uuid128[2], - m_uuid.uuid.uuid128[1], m_uuid.uuid.uuid128[0]); - std::string res(hex); - free(hex); - return res; -} // toString - -#endif /* CONFIG_BT_ENABLED */ diff --git a/libraries/BLE/src/BLEUUID.h b/libraries/BLE/src/BLEUUID.h deleted file mode 100644 index 700739bec81..00000000000 --- a/libraries/BLE/src/BLEUUID.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * BLEUUID.h - * - * Created on: Jun 21, 2017 - * Author: kolban - */ - -#ifndef COMPONENTS_CPP_UTILS_BLEUUID_H_ -#define COMPONENTS_CPP_UTILS_BLEUUID_H_ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include -#include - -/** - * @brief A model of a %BLE UUID. - */ -class BLEUUID { -public: - BLEUUID(std::string uuid); - BLEUUID(uint16_t uuid); - BLEUUID(uint32_t uuid); - BLEUUID(esp_bt_uuid_t uuid); - BLEUUID(uint8_t* pData, size_t size, bool msbFirst); - BLEUUID(esp_gatt_id_t gattId); - BLEUUID(); - uint8_t bitSize(); // Get the number of bits in this uuid. - bool equals(BLEUUID uuid); - esp_bt_uuid_t* getNative(); - BLEUUID to128(); - std::string toString(); - static BLEUUID fromString(std::string uuid); // Create a BLEUUID from a string - -private: - esp_bt_uuid_t m_uuid; // The underlying UUID structure that this class wraps. - bool m_valueSet = false; // Is there a value set for this instance. -}; // BLEUUID -#endif /* CONFIG_BT_ENABLED */ -#endif /* COMPONENTS_CPP_UTILS_BLEUUID_H_ */ diff --git a/libraries/BLE/src/BLEUtils.cpp b/libraries/BLE/src/BLEUtils.cpp deleted file mode 100644 index b9cf591f426..00000000000 --- a/libraries/BLE/src/BLEUtils.cpp +++ /dev/null @@ -1,2040 +0,0 @@ -/* - * BLEUtils.cpp - * - * Created on: Mar 25, 2017 - * Author: kolban - */ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include "BLEAddress.h" -#include "BLEClient.h" -#include "BLEUtils.h" -#include "BLEUUID.h" -#include "GeneralUtils.h" - -#include -#include -#include // ESP32 BLE -#include // ESP32 BLE -#include // ESP32 BLE -#include // ESP32 BLE -#include // ESP32 ESP-IDF -#include // Part of C++ STL -#include -#include - -#include "esp32-hal-log.h" - -/* -static std::map g_addressMap; -static std::map g_connIdMap; -*/ - -typedef struct { - uint32_t assignedNumber; - const char* name; -} member_t; - -static const member_t members_ids[] = { -#if CONFIG_LOG_DEFAULT_LEVEL > 4 - {0xFE08, "Microsoft"}, - {0xFE09, "Pillsy, Inc."}, - {0xFE0A, "ruwido austria gmbh"}, - {0xFE0B, "ruwido austria gmbh"}, - {0xFE0C, "Procter & Gamble"}, - {0xFE0D, "Procter & Gamble"}, - {0xFE0E, "Setec Pty Ltd"}, - {0xFE0F, "Philips Lighting B.V."}, - {0xFE10, "Lapis Semiconductor Co., Ltd."}, - {0xFE11, "GMC-I Messtechnik GmbH"}, - {0xFE12, "M-Way Solutions GmbH"}, - {0xFE13, "Apple Inc."}, - {0xFE14, "Flextronics International USA Inc."}, - {0xFE15, "Amazon Fulfillment Services, Inc."}, - {0xFE16, "Footmarks, Inc."}, - {0xFE17, "Telit Wireless Solutions GmbH"}, - {0xFE18, "Runtime, Inc."}, - {0xFE19, "Google Inc."}, - {0xFE1A, "Tyto Life LLC"}, - {0xFE1B, "Tyto Life LLC"}, - {0xFE1C, "NetMedia, Inc."}, - {0xFE1D, "Illuminati Instrument Corporation"}, - {0xFE1E, "Smart Innovations Co., Ltd"}, - {0xFE1F, "Garmin International, Inc."}, - {0xFE20, "Emerson"}, - {0xFE21, "Bose Corporation"}, - {0xFE22, "Zoll Medical Corporation"}, - {0xFE23, "Zoll Medical Corporation"}, - {0xFE24, "August Home Inc"}, - {0xFE25, "Apple, Inc. "}, - {0xFE26, "Google Inc."}, - {0xFE27, "Google Inc."}, - {0xFE28, "Ayla Networks"}, - {0xFE29, "Gibson Innovations"}, - {0xFE2A, "DaisyWorks, Inc."}, - {0xFE2B, "ITT Industries"}, - {0xFE2C, "Google Inc."}, - {0xFE2D, "SMART INNOVATION Co.,Ltd"}, - {0xFE2E, "ERi,Inc."}, - {0xFE2F, "CRESCO Wireless, Inc"}, - {0xFE30, "Volkswagen AG"}, - {0xFE31, "Volkswagen AG"}, - {0xFE32, "Pro-Mark, Inc."}, - {0xFE33, "CHIPOLO d.o.o."}, - {0xFE34, "SmallLoop LLC"}, - {0xFE35, "HUAWEI Technologies Co., Ltd"}, - {0xFE36, "HUAWEI Technologies Co., Ltd"}, - {0xFE37, "Spaceek LTD"}, - {0xFE38, "Spaceek LTD"}, - {0xFE39, "TTS Tooltechnic Systems AG & Co. KG"}, - {0xFE3A, "TTS Tooltechnic Systems AG & Co. KG"}, - {0xFE3B, "Dolby Laboratories"}, - {0xFE3C, "Alibaba"}, - {0xFE3D, "BD Medical"}, - {0xFE3E, "BD Medical"}, - {0xFE3F, "Friday Labs Limited"}, - {0xFE40, "Inugo Systems Limited"}, - {0xFE41, "Inugo Systems Limited"}, - {0xFE42, "Nets A/S "}, - {0xFE43, "Andreas Stihl AG & Co. KG"}, - {0xFE44, "SK Telecom "}, - {0xFE45, "Snapchat Inc"}, - {0xFE46, "B&O Play A/S "}, - {0xFE47, "General Motors"}, - {0xFE48, "General Motors"}, - {0xFE49, "SenionLab AB"}, - {0xFE4A, "OMRON HEALTHCARE Co., Ltd."}, - {0xFE4B, "Philips Lighting B.V."}, - {0xFE4C, "Volkswagen AG"}, - {0xFE4D, "Casambi Technologies Oy"}, - {0xFE4E, "NTT docomo"}, - {0xFE4F, "Molekule, Inc."}, - {0xFE50, "Google Inc."}, - {0xFE51, "SRAM"}, - {0xFE52, "SetPoint Medical"}, - {0xFE53, "3M"}, - {0xFE54, "Motiv, Inc."}, - {0xFE55, "Google Inc."}, - {0xFE56, "Google Inc."}, - {0xFE57, "Dotted Labs"}, - {0xFE58, "Nordic Semiconductor ASA"}, - {0xFE59, "Nordic Semiconductor ASA"}, - {0xFE5A, "Chronologics Corporation"}, - {0xFE5B, "GT-tronics HK Ltd"}, - {0xFE5C, "million hunters GmbH"}, - {0xFE5D, "Grundfos A/S"}, - {0xFE5E, "Plastc Corporation"}, - {0xFE5F, "Eyefi, Inc."}, - {0xFE60, "Lierda Science & Technology Group Co., Ltd."}, - {0xFE61, "Logitech International SA"}, - {0xFE62, "Indagem Tech LLC"}, - {0xFE63, "Connected Yard, Inc."}, - {0xFE64, "Siemens AG"}, - {0xFE65, "CHIPOLO d.o.o."}, - {0xFE66, "Intel Corporation"}, - {0xFE67, "Lab Sensor Solutions"}, - {0xFE68, "Qualcomm Life Inc"}, - {0xFE69, "Qualcomm Life Inc"}, - {0xFE6A, "Kontakt Micro-Location Sp. z o.o."}, - {0xFE6B, "TASER International, Inc."}, - {0xFE6C, "TASER International, Inc."}, - {0xFE6D, "The University of Tokyo"}, - {0xFE6E, "The University of Tokyo"}, - {0xFE6F, "LINE Corporation"}, - {0xFE70, "Beijing Jingdong Century Trading Co., Ltd."}, - {0xFE71, "Plume Design Inc"}, - {0xFE72, "St. Jude Medical, Inc."}, - {0xFE73, "St. Jude Medical, Inc."}, - {0xFE74, "unwire"}, - {0xFE75, "TangoMe"}, - {0xFE76, "TangoMe"}, - {0xFE77, "Hewlett-Packard Company"}, - {0xFE78, "Hewlett-Packard Company"}, - {0xFE79, "Zebra Technologies"}, - {0xFE7A, "Bragi GmbH"}, - {0xFE7B, "Orion Labs, Inc."}, - {0xFE7C, "Telit Wireless Solutions (Formerly Stollmann E+V GmbH)"}, - {0xFE7D, "Aterica Health Inc."}, - {0xFE7E, "Awear Solutions Ltd"}, - {0xFE7F, "Doppler Lab"}, - {0xFE80, "Doppler Lab"}, - {0xFE81, "Medtronic Inc."}, - {0xFE82, "Medtronic Inc."}, - {0xFE83, "Blue Bite"}, - {0xFE84, "RF Digital Corp"}, - {0xFE85, "RF Digital Corp"}, - {0xFE86, "HUAWEI Technologies Co., Ltd. ( )"}, - {0xFE87, "Qingdao Yeelink Information Technology Co., Ltd. ( )"}, - {0xFE88, "SALTO SYSTEMS S.L."}, - {0xFE89, "B&O Play A/S"}, - {0xFE8A, "Apple, Inc."}, - {0xFE8B, "Apple, Inc."}, - {0xFE8C, "TRON Forum"}, - {0xFE8D, "Interaxon Inc."}, - {0xFE8E, "ARM Ltd"}, - {0xFE8F, "CSR"}, - {0xFE90, "JUMA"}, - {0xFE91, "Shanghai Imilab Technology Co.,Ltd"}, - {0xFE92, "Jarden Safety & Security"}, - {0xFE93, "OttoQ Inc."}, - {0xFE94, "OttoQ Inc."}, - {0xFE95, "Xiaomi Inc."}, - {0xFE96, "Tesla Motor Inc."}, - {0xFE97, "Tesla Motor Inc."}, - {0xFE98, "Currant, Inc."}, - {0xFE99, "Currant, Inc."}, - {0xFE9A, "Estimote"}, - {0xFE9B, "Samsara Networks, Inc"}, - {0xFE9C, "GSI Laboratories, Inc."}, - {0xFE9D, "Mobiquity Networks Inc"}, - {0xFE9E, "Dialog Semiconductor B.V."}, - {0xFE9F, "Google Inc."}, - {0xFEA0, "Google Inc."}, - {0xFEA1, "Intrepid Control Systems, Inc."}, - {0xFEA2, "Intrepid Control Systems, Inc."}, - {0xFEA3, "ITT Industries"}, - {0xFEA4, "Paxton Access Ltd"}, - {0xFEA5, "GoPro, Inc."}, - {0xFEA6, "GoPro, Inc."}, - {0xFEA7, "UTC Fire and Security"}, - {0xFEA8, "Savant Systems LLC"}, - {0xFEA9, "Savant Systems LLC"}, - {0xFEAA, "Google Inc."}, - {0xFEAB, "Nokia Corporation"}, - {0xFEAC, "Nokia Corporation"}, - {0xFEAD, "Nokia Corporation"}, - {0xFEAE, "Nokia Corporation"}, - {0xFEAF, "Nest Labs Inc."}, - {0xFEB0, "Nest Labs Inc."}, - {0xFEB1, "Electronics Tomorrow Limited"}, - {0xFEB2, "Microsoft Corporation"}, - {0xFEB3, "Taobao"}, - {0xFEB4, "WiSilica Inc."}, - {0xFEB5, "WiSilica Inc."}, - {0xFEB6, "Vencer Co, Ltd"}, - {0xFEB7, "Facebook, Inc."}, - {0xFEB8, "Facebook, Inc."}, - {0xFEB9, "LG Electronics"}, - {0xFEBA, "Tencent Holdings Limited"}, - {0xFEBB, "adafruit industries"}, - {0xFEBC, "Dexcom, Inc. "}, - {0xFEBD, "Clover Network, Inc."}, - {0xFEBE, "Bose Corporation"}, - {0xFEBF, "Nod, Inc."}, - {0xFEC0, "KDDI Corporation"}, - {0xFEC1, "KDDI Corporation"}, - {0xFEC2, "Blue Spark Technologies, Inc."}, - {0xFEC3, "360fly, Inc."}, - {0xFEC4, "PLUS Location Systems"}, - {0xFEC5, "Realtek Semiconductor Corp."}, - {0xFEC6, "Kocomojo, LLC"}, - {0xFEC7, "Apple, Inc."}, - {0xFEC8, "Apple, Inc."}, - {0xFEC9, "Apple, Inc."}, - {0xFECA, "Apple, Inc."}, - {0xFECB, "Apple, Inc."}, - {0xFECC, "Apple, Inc."}, - {0xFECD, "Apple, Inc."}, - {0xFECE, "Apple, Inc."}, - {0xFECF, "Apple, Inc."}, - {0xFED0, "Apple, Inc."}, - {0xFED1, "Apple, Inc."}, - {0xFED2, "Apple, Inc."}, - {0xFED3, "Apple, Inc."}, - {0xFED4, "Apple, Inc."}, - {0xFED5, "Plantronics Inc."}, - {0xFED6, "Broadcom Corporation"}, - {0xFED7, "Broadcom Corporation"}, - {0xFED8, "Google Inc."}, - {0xFED9, "Pebble Technology Corporation"}, - {0xFEDA, "ISSC Technologies Corporation"}, - {0xFEDB, "Perka, Inc."}, - {0xFEDC, "Jawbone"}, - {0xFEDD, "Jawbone"}, - {0xFEDE, "Coin, Inc."}, - {0xFEDF, "Design SHIFT"}, - {0xFEE0, "Anhui Huami Information Technology Co."}, - {0xFEE1, "Anhui Huami Information Technology Co."}, - {0xFEE2, "Anki, Inc."}, - {0xFEE3, "Anki, Inc."}, - {0xFEE4, "Nordic Semiconductor ASA"}, - {0xFEE5, "Nordic Semiconductor ASA"}, - {0xFEE6, "Silvair, Inc."}, - {0xFEE7, "Tencent Holdings Limited"}, - {0xFEE8, "Quintic Corp."}, - {0xFEE9, "Quintic Corp."}, - {0xFEEA, "Swirl Networks, Inc."}, - {0xFEEB, "Swirl Networks, Inc."}, - {0xFEEC, "Tile, Inc."}, - {0xFEED, "Tile, Inc."}, - {0xFEEE, "Polar Electro Oy"}, - {0xFEEF, "Polar Electro Oy"}, - {0xFEF0, "Intel"}, - {0xFEF1, "CSR"}, - {0xFEF2, "CSR"}, - {0xFEF3, "Google Inc."}, - {0xFEF4, "Google Inc."}, - {0xFEF5, "Dialog Semiconductor GmbH"}, - {0xFEF6, "Wicentric, Inc."}, - {0xFEF7, "Aplix Corporation"}, - {0xFEF8, "Aplix Corporation"}, - {0xFEF9, "PayPal, Inc."}, - {0xFEFA, "PayPal, Inc."}, - {0xFEFB, "Telit Wireless Solutions (Formerly Stollmann E+V GmbH)"}, - {0xFEFC, "Gimbal, Inc."}, - {0xFEFD, "Gimbal, Inc."}, - {0xFEFE, "GN ReSound A/S"}, - {0xFEFF, "GN Netcom"}, - {0xFFFF, "Reserved"}, /*for testing purposes only*/ -#endif - {0, "" } -}; - -typedef struct { - uint32_t assignedNumber; - const char* name; -} gattdescriptor_t; - -static const gattdescriptor_t g_descriptor_ids[] = { -#if CONFIG_LOG_DEFAULT_LEVEL > 4 - {0x2905,"Characteristic Aggregate Format"}, - {0x2900,"Characteristic Extended Properties"}, - {0x2904,"Characteristic Presentation Format"}, - {0x2901,"Characteristic User Description"}, - {0x2902,"Client Characteristic Configuration"}, - {0x290B,"Environmental Sensing Configuration"}, - {0x290C,"Environmental Sensing Measurement"}, - {0x290D,"Environmental Sensing Trigger Setting"}, - {0x2907,"External Report Reference"}, - {0x2909,"Number of Digitals"}, - {0x2908,"Report Reference"}, - {0x2903,"Server Characteristic Configuration"}, - {0x290E,"Time Trigger Setting"}, - {0x2906,"Valid Range"}, - {0x290A,"Value Trigger Setting"}, -#endif - { 0, "" } -}; - -typedef struct { - uint32_t assignedNumber; - const char* name; -} characteristicMap_t; - -static const characteristicMap_t g_characteristicsMappings[] = { -#if CONFIG_LOG_DEFAULT_LEVEL > 4 - {0x2A7E,"Aerobic Heart Rate Lower Limit"}, - {0x2A84,"Aerobic Heart Rate Upper Limit"}, - {0x2A7F,"Aerobic Threshold"}, - {0x2A80,"Age"}, - {0x2A5A,"Aggregate"}, - {0x2A43,"Alert Category ID"}, - {0x2A42,"Alert Category ID Bit Mask"}, - {0x2A06,"Alert Level"}, - {0x2A44,"Alert Notification Control Point"}, - {0x2A3F,"Alert Status"}, - {0x2AB3,"Altitude"}, - {0x2A81,"Anaerobic Heart Rate Lower Limit"}, - {0x2A82,"Anaerobic Heart Rate Upper Limit"}, - {0x2A83,"Anaerobic Threshold"}, - {0x2A58,"Analog"}, - {0x2A59,"Analog Output"}, - {0x2A73,"Apparent Wind Direction"}, - {0x2A72,"Apparent Wind Speed"}, - {0x2A01,"Appearance"}, - {0x2AA3,"Barometric Pressure Trend"}, - {0x2A19,"Battery Level"}, - {0x2A1B,"Battery Level State"}, - {0x2A1A,"Battery Power State"}, - {0x2A49,"Blood Pressure Feature"}, - {0x2A35,"Blood Pressure Measurement"}, - {0x2A9B,"Body Composition Feature"}, - {0x2A9C,"Body Composition Measurement"}, - {0x2A38,"Body Sensor Location"}, - {0x2AA4,"Bond Management Control Point"}, - {0x2AA5,"Bond Management Features"}, - {0x2A22,"Boot Keyboard Input Report"}, - {0x2A32,"Boot Keyboard Output Report"}, - {0x2A33,"Boot Mouse Input Report"}, - {0x2AA6,"Central Address Resolution"}, - {0x2AA8,"CGM Feature"}, - {0x2AA7,"CGM Measurement"}, - {0x2AAB,"CGM Session Run Time"}, - {0x2AAA,"CGM Session Start Time"}, - {0x2AAC,"CGM Specific Ops Control Point"}, - {0x2AA9,"CGM Status"}, - {0x2ACE,"Cross Trainer Data"}, - {0x2A5C,"CSC Feature"}, - {0x2A5B,"CSC Measurement"}, - {0x2A2B,"Current Time"}, - {0x2A66,"Cycling Power Control Point"}, - {0x2A66,"Cycling Power Control Point"}, - {0x2A65,"Cycling Power Feature"}, - {0x2A65,"Cycling Power Feature"}, - {0x2A63,"Cycling Power Measurement"}, - {0x2A64,"Cycling Power Vector"}, - {0x2A99,"Database Change Increment"}, - {0x2A85,"Date of Birth"}, - {0x2A86,"Date of Threshold Assessment"}, - {0x2A08,"Date Time"}, - {0x2A0A,"Day Date Time"}, - {0x2A09,"Day of Week"}, - {0x2A7D,"Descriptor Value Changed"}, - {0x2A00,"Device Name"}, - {0x2A7B,"Dew Point"}, - {0x2A56,"Digital"}, - {0x2A57,"Digital Output"}, - {0x2A0D,"DST Offset"}, - {0x2A6C,"Elevation"}, - {0x2A87,"Email Address"}, - {0x2A0B,"Exact Time 100"}, - {0x2A0C,"Exact Time 256"}, - {0x2A88,"Fat Burn Heart Rate Lower Limit"}, - {0x2A89,"Fat Burn Heart Rate Upper Limit"}, - {0x2A26,"Firmware Revision String"}, - {0x2A8A,"First Name"}, - {0x2AD9,"Fitness Machine Control Point"}, - {0x2ACC,"Fitness Machine Feature"}, - {0x2ADA,"Fitness Machine Status"}, - {0x2A8B,"Five Zone Heart Rate Limits"}, - {0x2AB2,"Floor Number"}, - {0x2A8C,"Gender"}, - {0x2A51,"Glucose Feature"}, - {0x2A18,"Glucose Measurement"}, - {0x2A34,"Glucose Measurement Context"}, - {0x2A74,"Gust Factor"}, - {0x2A27,"Hardware Revision String"}, - {0x2A39,"Heart Rate Control Point"}, - {0x2A8D,"Heart Rate Max"}, - {0x2A37,"Heart Rate Measurement"}, - {0x2A7A,"Heat Index"}, - {0x2A8E,"Height"}, - {0x2A4C,"HID Control Point"}, - {0x2A4A,"HID Information"}, - {0x2A8F,"Hip Circumference"}, - {0x2ABA,"HTTP Control Point"}, - {0x2AB9,"HTTP Entity Body"}, - {0x2AB7,"HTTP Headers"}, - {0x2AB8,"HTTP Status Code"}, - {0x2ABB,"HTTPS Security"}, - {0x2A6F,"Humidity"}, - {0x2A2A,"IEEE 11073-20601 Regulatory Certification Data List"}, - {0x2AD2,"Indoor Bike Data"}, - {0x2AAD,"Indoor Positioning Configuration"}, - {0x2A36,"Intermediate Cuff Pressure"}, - {0x2A1E,"Intermediate Temperature"}, - {0x2A77,"Irradiance"}, - {0x2AA2,"Language"}, - {0x2A90,"Last Name"}, - {0x2AAE,"Latitude"}, - {0x2A6B,"LN Control Point"}, - {0x2A6A,"LN Feature"}, - {0x2AB1,"Local East Coordinate"}, - {0x2AB0,"Local North Coordinate"}, - {0x2A0F,"Local Time Information"}, - {0x2A67,"Location and Speed Characteristic"}, - {0x2AB5,"Location Name"}, - {0x2AAF,"Longitude"}, - {0x2A2C,"Magnetic Declination"}, - {0x2AA0,"Magnetic Flux Density - 2D"}, - {0x2AA1,"Magnetic Flux Density - 3D"}, - {0x2A29,"Manufacturer Name String"}, - {0x2A91,"Maximum Recommended Heart Rate"}, - {0x2A21,"Measurement Interval"}, - {0x2A24,"Model Number String"}, - {0x2A68,"Navigation"}, - {0x2A3E,"Network Availability"}, - {0x2A46,"New Alert"}, - {0x2AC5,"Object Action Control Point"}, - {0x2AC8,"Object Changed"}, - {0x2AC1,"Object First-Created"}, - {0x2AC3,"Object ID"}, - {0x2AC2,"Object Last-Modified"}, - {0x2AC6,"Object List Control Point"}, - {0x2AC7,"Object List Filter"}, - {0x2ABE,"Object Name"}, - {0x2AC4,"Object Properties"}, - {0x2AC0,"Object Size"}, - {0x2ABF,"Object Type"}, - {0x2ABD,"OTS Feature"}, - {0x2A04,"Peripheral Preferred Connection Parameters"}, - {0x2A02,"Peripheral Privacy Flag"}, - {0x2A5F,"PLX Continuous Measurement Characteristic"}, - {0x2A60,"PLX Features"}, - {0x2A5E,"PLX Spot-Check Measurement"}, - {0x2A50,"PnP ID"}, - {0x2A75,"Pollen Concentration"}, - {0x2A2F,"Position 2D"}, - {0x2A30,"Position 3D"}, - {0x2A69,"Position Quality"}, - {0x2A6D,"Pressure"}, - {0x2A4E,"Protocol Mode"}, - {0x2A62,"Pulse Oximetry Control Point"}, - {0x2A60,"Pulse Oximetry Pulsatile Event Characteristic"}, - {0x2A78,"Rainfall"}, - {0x2A03,"Reconnection Address"}, - {0x2A52,"Record Access Control Point"}, - {0x2A14,"Reference Time Information"}, - {0x2A3A,"Removable"}, - {0x2A4D,"Report"}, - {0x2A4B,"Report Map"}, - {0x2AC9,"Resolvable Private Address Only"}, - {0x2A92,"Resting Heart Rate"}, - {0x2A40,"Ringer Control point"}, - {0x2A41,"Ringer Setting"}, - {0x2AD1,"Rower Data"}, - {0x2A54,"RSC Feature"}, - {0x2A53,"RSC Measurement"}, - {0x2A55,"SC Control Point"}, - {0x2A4F,"Scan Interval Window"}, - {0x2A31,"Scan Refresh"}, - {0x2A3C,"Scientific Temperature Celsius"}, - {0x2A10,"Secondary Time Zone"}, - {0x2A5D,"Sensor Location"}, - {0x2A25,"Serial Number String"}, - {0x2A05,"Service Changed"}, - {0x2A3B,"Service Required"}, - {0x2A28,"Software Revision String"}, - {0x2A93,"Sport Type for Aerobic and Anaerobic Thresholds"}, - {0x2AD0,"Stair Climber Data"}, - {0x2ACF,"Step Climber Data"}, - {0x2A3D,"String"}, - {0x2AD7,"Supported Heart Rate Range"}, - {0x2AD5,"Supported Inclination Range"}, - {0x2A47,"Supported New Alert Category"}, - {0x2AD8,"Supported Power Range"}, - {0x2AD6,"Supported Resistance Level Range"}, - {0x2AD4,"Supported Speed Range"}, - {0x2A48,"Supported Unread Alert Category"}, - {0x2A23,"System ID"}, - {0x2ABC,"TDS Control Point"}, - {0x2A6E,"Temperature"}, - {0x2A1F,"Temperature Celsius"}, - {0x2A20,"Temperature Fahrenheit"}, - {0x2A1C,"Temperature Measurement"}, - {0x2A1D,"Temperature Type"}, - {0x2A94,"Three Zone Heart Rate Limits"}, - {0x2A12,"Time Accuracy"}, - {0x2A15,"Time Broadcast"}, - {0x2A13,"Time Source"}, - {0x2A16,"Time Update Control Point"}, - {0x2A17,"Time Update State"}, - {0x2A11,"Time with DST"}, - {0x2A0E,"Time Zone"}, - {0x2AD3,"Training Status"}, - {0x2ACD,"Treadmill Data"}, - {0x2A71,"True Wind Direction"}, - {0x2A70,"True Wind Speed"}, - {0x2A95,"Two Zone Heart Rate Limit"}, - {0x2A07,"Tx Power Level"}, - {0x2AB4,"Uncertainty"}, - {0x2A45,"Unread Alert Status"}, - {0x2AB6,"URI"}, - {0x2A9F,"User Control Point"}, - {0x2A9A,"User Index"}, - {0x2A76,"UV Index"}, - {0x2A96,"VO2 Max"}, - {0x2A97,"Waist Circumference"}, - {0x2A98,"Weight"}, - {0x2A9D,"Weight Measurement"}, - {0x2A9E,"Weight Scale Feature"}, - {0x2A79,"Wind Chill"}, -#endif - {0, ""} -}; - -/** - * @brief Mapping from service ids to names - */ -typedef struct { - const char* name; - const char* type; - uint32_t assignedNumber; -} gattService_t; - - -/** - * Definition of the service ids to names that we know about. - */ -static const gattService_t g_gattServices[] = { -#if CONFIG_LOG_DEFAULT_LEVEL > 4 - {"Alert Notification Service", "org.bluetooth.service.alert_notification", 0x1811}, - {"Automation IO", "org.bluetooth.service.automation_io", 0x1815 }, - {"Battery Service","org.bluetooth.service.battery_service", 0x180F}, - {"Blood Pressure", "org.bluetooth.service.blood_pressure", 0x1810}, - {"Body Composition", "org.bluetooth.service.body_composition", 0x181B}, - {"Bond Management", "org.bluetooth.service.bond_management", 0x181E}, - {"Continuous Glucose Monitoring", "org.bluetooth.service.continuous_glucose_monitoring", 0x181F}, - {"Current Time Service", "org.bluetooth.service.current_time", 0x1805}, - {"Cycling Power", "org.bluetooth.service.cycling_power", 0x1818}, - {"Cycling Speed and Cadence", "org.bluetooth.service.cycling_speed_and_cadence", 0x1816}, - {"Device Information", "org.bluetooth.service.device_information", 0x180A}, - {"Environmental Sensing", "org.bluetooth.service.environmental_sensing", 0x181A}, - {"Generic Access", "org.bluetooth.service.generic_access", 0x1800}, - {"Generic Attribute", "org.bluetooth.service.generic_attribute", 0x1801}, - {"Glucose", "org.bluetooth.service.glucose", 0x1808}, - {"Health Thermometer", "org.bluetooth.service.health_thermometer", 0x1809}, - {"Heart Rate", "org.bluetooth.service.heart_rate", 0x180D}, - {"HTTP Proxy", "org.bluetooth.service.http_proxy", 0x1823}, - {"Human Interface Device", "org.bluetooth.service.human_interface_device", 0x1812}, - {"Immediate Alert", "org.bluetooth.service.immediate_alert", 0x1802}, - {"Indoor Positioning", "org.bluetooth.service.indoor_positioning", 0x1821}, - {"Internet Protocol Support", "org.bluetooth.service.internet_protocol_support", 0x1820}, - {"Link Loss", "org.bluetooth.service.link_loss", 0x1803}, - {"Location and Navigation", "org.bluetooth.service.location_and_navigation", 0x1819}, - {"Next DST Change Service", "org.bluetooth.service.next_dst_change", 0x1807}, - {"Object Transfer", "org.bluetooth.service.object_transfer", 0x1825}, - {"Phone Alert Status Service", "org.bluetooth.service.phone_alert_status", 0x180E}, - {"Pulse Oximeter", "org.bluetooth.service.pulse_oximeter", 0x1822}, - {"Reference Time Update Service", "org.bluetooth.service.reference_time_update", 0x1806}, - {"Running Speed and Cadence", "org.bluetooth.service.running_speed_and_cadence", 0x1814}, - {"Scan Parameters", "org.bluetooth.service.scan_parameters", 0x1813}, - {"Transport Discovery", "org.bluetooth.service.transport_discovery", 0x1824}, - {"Tx Power", "org.bluetooth.service.tx_power", 0x1804}, - {"User Data", "org.bluetooth.service.user_data", 0x181C}, - {"Weight Scale", "org.bluetooth.service.weight_scale", 0x181D}, -#endif - {"", "", 0 } -}; - - -/** - * @brief Convert characteristic properties into a string representation. - * @param [in] prop Characteristic properties. - * @return A string representation of characteristic properties. - */ -std::string BLEUtils::characteristicPropertiesToString(esp_gatt_char_prop_t prop) { - std::string res = "broadcast: "; - res += ((prop & ESP_GATT_CHAR_PROP_BIT_BROADCAST)?"1":"0"); - res += ", read: "; - res += ((prop & ESP_GATT_CHAR_PROP_BIT_READ)?"1":"0"); - res += ", write_nr: "; - res += ((prop & ESP_GATT_CHAR_PROP_BIT_WRITE_NR)?"1":"0"); - res += ", write: "; - res += ((prop & ESP_GATT_CHAR_PROP_BIT_WRITE)?"1":"0"); - res += ", notify: "; - res += ((prop & ESP_GATT_CHAR_PROP_BIT_NOTIFY)?"1":"0"); - res += ", indicate: "; - res += ((prop & ESP_GATT_CHAR_PROP_BIT_INDICATE)?"1":"0"); - res += ", auth: "; - res += ((prop & ESP_GATT_CHAR_PROP_BIT_AUTH)?"1":"0"); - return res; -} // characteristicPropertiesToString - -/** - * @brief Convert an esp_gatt_id_t to a string. - */ -static std::string gattIdToString(esp_gatt_id_t gattId) { - std::string res = "uuid: " + BLEUUID(gattId.uuid).toString() + ", inst_id: "; - char val[8]; - snprintf(val, sizeof(val), "%d", (int)gattId.inst_id); - res += val; - return res; -} // gattIdToString - - -/** - * @brief Convert an esp_ble_addr_type_t to a string representation. - */ -const char* BLEUtils::addressTypeToString(esp_ble_addr_type_t type) { - switch (type) { -#if CONFIG_LOG_DEFAULT_LEVEL > 4 - case BLE_ADDR_TYPE_PUBLIC: - return "BLE_ADDR_TYPE_PUBLIC"; - case BLE_ADDR_TYPE_RANDOM: - return "BLE_ADDR_TYPE_RANDOM"; - case BLE_ADDR_TYPE_RPA_PUBLIC: - return "BLE_ADDR_TYPE_RPA_PUBLIC"; - case BLE_ADDR_TYPE_RPA_RANDOM: - return "BLE_ADDR_TYPE_RPA_RANDOM"; -#endif - default: - return " esp_ble_addr_type_t"; - } -} // addressTypeToString - - -/** - * @brief Convert the BLE Advertising Data flags to a string. - * @param adFlags The flags to convert - * @return std::string A string representation of the advertising flags. - */ -std::string BLEUtils::adFlagsToString(uint8_t adFlags) { - std::string res; - if (adFlags & (1 << 0)) { - res += "[LE Limited Discoverable Mode] "; - } - if (adFlags & (1 << 1)) { - res += "[LE General Discoverable Mode] "; - } - if (adFlags & (1 << 2)) { - res += "[BR/EDR Not Supported] "; - } - if (adFlags & (1 << 3)) { - res += "[Simultaneous LE and BR/EDR to Same Device Capable (Controller)] "; - } - if (adFlags & (1 << 4)) { - res += "[Simultaneous LE and BR/EDR to Same Device Capable (Host)] "; - } - return res; -} // adFlagsToString - - -/** - * @brief Given an advertising type, return a string representation of the type. - * - * For details see ... - * https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile - * - * @return A string representation of the type. - */ -const char* BLEUtils::advTypeToString(uint8_t advType) { - switch (advType) { -#if CONFIG_LOG_DEFAULT_LEVEL > 4 - case ESP_BLE_AD_TYPE_FLAG: // 0x01 - return "ESP_BLE_AD_TYPE_FLAG"; - case ESP_BLE_AD_TYPE_16SRV_PART: // 0x02 - return "ESP_BLE_AD_TYPE_16SRV_PART"; - case ESP_BLE_AD_TYPE_16SRV_CMPL: // 0x03 - return "ESP_BLE_AD_TYPE_16SRV_CMPL"; - case ESP_BLE_AD_TYPE_32SRV_PART: // 0x04 - return "ESP_BLE_AD_TYPE_32SRV_PART"; - case ESP_BLE_AD_TYPE_32SRV_CMPL: // 0x05 - return "ESP_BLE_AD_TYPE_32SRV_CMPL"; - case ESP_BLE_AD_TYPE_128SRV_PART: // 0x06 - return "ESP_BLE_AD_TYPE_128SRV_PART"; - case ESP_BLE_AD_TYPE_128SRV_CMPL: // 0x07 - return "ESP_BLE_AD_TYPE_128SRV_CMPL"; - case ESP_BLE_AD_TYPE_NAME_SHORT: // 0x08 - return "ESP_BLE_AD_TYPE_NAME_SHORT"; - case ESP_BLE_AD_TYPE_NAME_CMPL: // 0x09 - return "ESP_BLE_AD_TYPE_NAME_CMPL"; - case ESP_BLE_AD_TYPE_TX_PWR: // 0x0a - return "ESP_BLE_AD_TYPE_TX_PWR"; - case ESP_BLE_AD_TYPE_DEV_CLASS: // 0x0b - return "ESP_BLE_AD_TYPE_DEV_CLASS"; - case ESP_BLE_AD_TYPE_SM_TK: // 0x10 - return "ESP_BLE_AD_TYPE_SM_TK"; - case ESP_BLE_AD_TYPE_SM_OOB_FLAG: // 0x11 - return "ESP_BLE_AD_TYPE_SM_OOB_FLAG"; - case ESP_BLE_AD_TYPE_INT_RANGE: // 0x12 - return "ESP_BLE_AD_TYPE_INT_RANGE"; - case ESP_BLE_AD_TYPE_SOL_SRV_UUID: // 0x14 - return "ESP_BLE_AD_TYPE_SOL_SRV_UUID"; - case ESP_BLE_AD_TYPE_128SOL_SRV_UUID: // 0x15 - return "ESP_BLE_AD_TYPE_128SOL_SRV_UUID"; - case ESP_BLE_AD_TYPE_SERVICE_DATA: // 0x16 - return "ESP_BLE_AD_TYPE_SERVICE_DATA"; - case ESP_BLE_AD_TYPE_PUBLIC_TARGET: // 0x17 - return "ESP_BLE_AD_TYPE_PUBLIC_TARGET"; - case ESP_BLE_AD_TYPE_RANDOM_TARGET: // 0x18 - return "ESP_BLE_AD_TYPE_RANDOM_TARGET"; - case ESP_BLE_AD_TYPE_APPEARANCE: // 0x19 - return "ESP_BLE_AD_TYPE_APPEARANCE"; - case ESP_BLE_AD_TYPE_ADV_INT: // 0x1a - return "ESP_BLE_AD_TYPE_ADV_INT"; - case ESP_BLE_AD_TYPE_32SOL_SRV_UUID: - return "ESP_BLE_AD_TYPE_32SOL_SRV_UUID"; - case ESP_BLE_AD_TYPE_32SERVICE_DATA: // 0x20 - return "ESP_BLE_AD_TYPE_32SERVICE_DATA"; - case ESP_BLE_AD_TYPE_128SERVICE_DATA: // 0x21 - return "ESP_BLE_AD_TYPE_128SERVICE_DATA"; - case ESP_BLE_AD_MANUFACTURER_SPECIFIC_TYPE: // 0xff - return "ESP_BLE_AD_MANUFACTURER_SPECIFIC_TYPE"; -#endif - default: - log_v(" adv data type: 0x%x", advType); - return ""; - } // End switch -} // advTypeToString - - -esp_gatt_id_t BLEUtils::buildGattId(esp_bt_uuid_t uuid, uint8_t inst_id) { - esp_gatt_id_t retGattId; - retGattId.uuid = uuid; - retGattId.inst_id = inst_id; - return retGattId; -} - -esp_gatt_srvc_id_t BLEUtils::buildGattSrvcId(esp_gatt_id_t gattId, bool is_primary) { - esp_gatt_srvc_id_t retSrvcId; - retSrvcId.id = gattId; - retSrvcId.is_primary = is_primary; - return retSrvcId; -} - -/** - * @brief Create a hex representation of data. - * - * @param [in] target Where to write the hex string. If this is null, we malloc storage. - * @param [in] source The start of the binary data. - * @param [in] length The length of the data to convert. - * @return A pointer to the formatted buffer. - */ -char* BLEUtils::buildHexData(uint8_t* target, uint8_t* source, uint8_t length) { - // Guard against too much data. - if (length > 100) length = 100; - - if (target == nullptr) { - target = (uint8_t*) malloc(length * 2 + 1); - if (target == nullptr) { - log_e("buildHexData: malloc failed"); - return nullptr; - } - } - char* startOfData = (char*) target; - - for (int i = 0; i < length; i++) { - sprintf((char*) target, "%.2x", (char) *source); - source++; - target += 2; - } - - // Handle the special case where there was no data. - if (length == 0) { - *startOfData = 0; - } - - return startOfData; -} // buildHexData - - -/** - * @brief Build a printable string of memory range. - * Create a string representation of a piece of memory. Only printable characters will be included - * while those that are not printable will be replaced with '.'. - * @param [in] source Start of memory. - * @param [in] length Length of memory. - * @return A string representation of a piece of memory. - */ -std::string BLEUtils::buildPrintData(uint8_t* source, size_t length) { - std::string res; - for (int i = 0; i < length; i++) { - char c = *source; - res += (isprint(c) ? c : '.'); - source++; - } - return res; -} // buildPrintData - - -/** - * @brief Convert a close/disconnect reason to a string. - * @param [in] reason The close reason. - * @return A string representation of the reason. - */ -std::string BLEUtils::gattCloseReasonToString(esp_gatt_conn_reason_t reason) { - switch (reason) { -#if CONFIG_LOG_DEFAULT_LEVEL > 4 - case ESP_GATT_CONN_UNKNOWN: { - return "ESP_GATT_CONN_UNKNOWN"; - } - case ESP_GATT_CONN_L2C_FAILURE: { - return "ESP_GATT_CONN_L2C_FAILURE"; - } - case ESP_GATT_CONN_TIMEOUT: { - return "ESP_GATT_CONN_TIMEOUT"; - } - case ESP_GATT_CONN_TERMINATE_PEER_USER: { - return "ESP_GATT_CONN_TERMINATE_PEER_USER"; - } - case ESP_GATT_CONN_TERMINATE_LOCAL_HOST: { - return "ESP_GATT_CONN_TERMINATE_LOCAL_HOST"; - } - case ESP_GATT_CONN_FAIL_ESTABLISH: { - return "ESP_GATT_CONN_FAIL_ESTABLISH"; - } - case ESP_GATT_CONN_LMP_TIMEOUT: { - return "ESP_GATT_CONN_LMP_TIMEOUT"; - } - case ESP_GATT_CONN_CONN_CANCEL: { - return "ESP_GATT_CONN_CONN_CANCEL"; - } - case ESP_GATT_CONN_NONE: { - return "ESP_GATT_CONN_NONE"; - } -#endif - default: { - return "Unknown"; - } - } -} // gattCloseReasonToString - - -std::string BLEUtils::gattClientEventTypeToString(esp_gattc_cb_event_t eventType) { - switch (eventType) { -#if CONFIG_LOG_DEFAULT_LEVEL > 4 - case ESP_GATTC_ACL_EVT: - return "ESP_GATTC_ACL_EVT"; - case ESP_GATTC_ADV_DATA_EVT: - return "ESP_GATTC_ADV_DATA_EVT"; - case ESP_GATTC_ADV_VSC_EVT: - return "ESP_GATTC_ADV_VSC_EVT"; - case ESP_GATTC_BTH_SCAN_CFG_EVT: - return "ESP_GATTC_BTH_SCAN_CFG_EVT"; - case ESP_GATTC_BTH_SCAN_DIS_EVT: - return "ESP_GATTC_BTH_SCAN_DIS_EVT"; - case ESP_GATTC_BTH_SCAN_ENB_EVT: - return "ESP_GATTC_BTH_SCAN_ENB_EVT"; - case ESP_GATTC_BTH_SCAN_PARAM_EVT: - return "ESP_GATTC_BTH_SCAN_PARAM_EVT"; - case ESP_GATTC_BTH_SCAN_RD_EVT: - return "ESP_GATTC_BTH_SCAN_RD_EVT"; - case ESP_GATTC_BTH_SCAN_THR_EVT: - return "ESP_GATTC_BTH_SCAN_THR_EVT"; - case ESP_GATTC_CANCEL_OPEN_EVT: - return "ESP_GATTC_CANCEL_OPEN_EVT"; - case ESP_GATTC_CFG_MTU_EVT: - return "ESP_GATTC_CFG_MTU_EVT"; - case ESP_GATTC_CLOSE_EVT: - return "ESP_GATTC_CLOSE_EVT"; - case ESP_GATTC_CONGEST_EVT: - return "ESP_GATTC_CONGEST_EVT"; - case ESP_GATTC_CONNECT_EVT: - return "ESP_GATTC_CONNECT_EVT"; - case ESP_GATTC_DISCONNECT_EVT: - return "ESP_GATTC_DISCONNECT_EVT"; - case ESP_GATTC_ENC_CMPL_CB_EVT: - return "ESP_GATTC_ENC_CMPL_CB_EVT"; - case ESP_GATTC_EXEC_EVT: - return "ESP_GATTC_EXEC_EVT"; - //case ESP_GATTC_GET_CHAR_EVT: -// return "ESP_GATTC_GET_CHAR_EVT"; - //case ESP_GATTC_GET_DESCR_EVT: -// return "ESP_GATTC_GET_DESCR_EVT"; - //case ESP_GATTC_GET_INCL_SRVC_EVT: -// return "ESP_GATTC_GET_INCL_SRVC_EVT"; - case ESP_GATTC_MULT_ADV_DATA_EVT: - return "ESP_GATTC_MULT_ADV_DATA_EVT"; - case ESP_GATTC_MULT_ADV_DIS_EVT: - return "ESP_GATTC_MULT_ADV_DIS_EVT"; - case ESP_GATTC_MULT_ADV_ENB_EVT: - return "ESP_GATTC_MULT_ADV_ENB_EVT"; - case ESP_GATTC_MULT_ADV_UPD_EVT: - return "ESP_GATTC_MULT_ADV_UPD_EVT"; - case ESP_GATTC_NOTIFY_EVT: - return "ESP_GATTC_NOTIFY_EVT"; - case ESP_GATTC_OPEN_EVT: - return "ESP_GATTC_OPEN_EVT"; - case ESP_GATTC_PREP_WRITE_EVT: - return "ESP_GATTC_PREP_WRITE_EVT"; - case ESP_GATTC_READ_CHAR_EVT: - return "ESP_GATTC_READ_CHAR_EVT"; - case ESP_GATTC_REG_EVT: - return "ESP_GATTC_REG_EVT"; - case ESP_GATTC_REG_FOR_NOTIFY_EVT: - return "ESP_GATTC_REG_FOR_NOTIFY_EVT"; - case ESP_GATTC_SCAN_FLT_CFG_EVT: - return "ESP_GATTC_SCAN_FLT_CFG_EVT"; - case ESP_GATTC_SCAN_FLT_PARAM_EVT: - return "ESP_GATTC_SCAN_FLT_PARAM_EVT"; - case ESP_GATTC_SCAN_FLT_STATUS_EVT: - return "ESP_GATTC_SCAN_FLT_STATUS_EVT"; - case ESP_GATTC_SEARCH_CMPL_EVT: - return "ESP_GATTC_SEARCH_CMPL_EVT"; - case ESP_GATTC_SEARCH_RES_EVT: - return "ESP_GATTC_SEARCH_RES_EVT"; - case ESP_GATTC_SRVC_CHG_EVT: - return "ESP_GATTC_SRVC_CHG_EVT"; - case ESP_GATTC_READ_DESCR_EVT: - return "ESP_GATTC_READ_DESCR_EVT"; - case ESP_GATTC_UNREG_EVT: - return "ESP_GATTC_UNREG_EVT"; - case ESP_GATTC_UNREG_FOR_NOTIFY_EVT: - return "ESP_GATTC_UNREG_FOR_NOTIFY_EVT"; - case ESP_GATTC_WRITE_CHAR_EVT: - return "ESP_GATTC_WRITE_CHAR_EVT"; - case ESP_GATTC_WRITE_DESCR_EVT: - return "ESP_GATTC_WRITE_DESCR_EVT"; -#endif - default: - log_v("Unknown GATT Client event type: %d", eventType); - return "Unknown"; - } -} // gattClientEventTypeToString - - -/** - * @brief Return a string representation of a GATT server event code. - * @param [in] eventType A GATT server event code. - * @return A string representation of the GATT server event code. - */ -std::string BLEUtils::gattServerEventTypeToString(esp_gatts_cb_event_t eventType) { - switch (eventType) { -#if CONFIG_LOG_DEFAULT_LEVEL > 4 - case ESP_GATTS_REG_EVT: - return "ESP_GATTS_REG_EVT"; - case ESP_GATTS_READ_EVT: - return "ESP_GATTS_READ_EVT"; - case ESP_GATTS_WRITE_EVT: - return "ESP_GATTS_WRITE_EVT"; - case ESP_GATTS_EXEC_WRITE_EVT: - return "ESP_GATTS_EXEC_WRITE_EVT"; - case ESP_GATTS_MTU_EVT: - return "ESP_GATTS_MTU_EVT"; - case ESP_GATTS_CONF_EVT: - return "ESP_GATTS_CONF_EVT"; - case ESP_GATTS_UNREG_EVT: - return "ESP_GATTS_UNREG_EVT"; - case ESP_GATTS_CREATE_EVT: - return "ESP_GATTS_CREATE_EVT"; - case ESP_GATTS_ADD_INCL_SRVC_EVT: - return "ESP_GATTS_ADD_INCL_SRVC_EVT"; - case ESP_GATTS_ADD_CHAR_EVT: - return "ESP_GATTS_ADD_CHAR_EVT"; - case ESP_GATTS_ADD_CHAR_DESCR_EVT: - return "ESP_GATTS_ADD_CHAR_DESCR_EVT"; - case ESP_GATTS_DELETE_EVT: - return "ESP_GATTS_DELETE_EVT"; - case ESP_GATTS_START_EVT: - return "ESP_GATTS_START_EVT"; - case ESP_GATTS_STOP_EVT: - return "ESP_GATTS_STOP_EVT"; - case ESP_GATTS_CONNECT_EVT: - return "ESP_GATTS_CONNECT_EVT"; - case ESP_GATTS_DISCONNECT_EVT: - return "ESP_GATTS_DISCONNECT_EVT"; - case ESP_GATTS_OPEN_EVT: - return "ESP_GATTS_OPEN_EVT"; - case ESP_GATTS_CANCEL_OPEN_EVT: - return "ESP_GATTS_CANCEL_OPEN_EVT"; - case ESP_GATTS_CLOSE_EVT: - return "ESP_GATTS_CLOSE_EVT"; - case ESP_GATTS_LISTEN_EVT: - return "ESP_GATTS_LISTEN_EVT"; - case ESP_GATTS_CONGEST_EVT: - return "ESP_GATTS_CONGEST_EVT"; - case ESP_GATTS_RESPONSE_EVT: - return "ESP_GATTS_RESPONSE_EVT"; - case ESP_GATTS_CREAT_ATTR_TAB_EVT: - return "ESP_GATTS_CREAT_ATTR_TAB_EVT"; - case ESP_GATTS_SET_ATTR_VAL_EVT: - return "ESP_GATTS_SET_ATTR_VAL_EVT"; - case ESP_GATTS_SEND_SERVICE_CHANGE_EVT: - return "ESP_GATTS_SEND_SERVICE_CHANGE_EVT"; -#endif - default: - return "Unknown"; - } -} // gattServerEventTypeToString - - - -/** - * @brief Convert a BLE device type to a string. - * @param [in] type The device type. - */ -const char* BLEUtils::devTypeToString(esp_bt_dev_type_t type) { - switch (type) { -#if CONFIG_LOG_DEFAULT_LEVEL > 4 - case ESP_BT_DEVICE_TYPE_BREDR: - return "ESP_BT_DEVICE_TYPE_BREDR"; - case ESP_BT_DEVICE_TYPE_BLE: - return "ESP_BT_DEVICE_TYPE_BLE"; - case ESP_BT_DEVICE_TYPE_DUMO: - return "ESP_BT_DEVICE_TYPE_DUMO"; -#endif - default: - return "Unknown"; - } -} // devTypeToString - - -/** - * @brief Dump the GAP event to the log. - */ -void BLEUtils::dumpGapEvent( - esp_gap_ble_cb_event_t event, - esp_ble_gap_cb_param_t* param) { - log_v("Received a GAP event: %s", gapEventToString(event)); - switch (event) { -#if CONFIG_LOG_DEFAULT_LEVEL > 4 - // ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT - // adv_data_cmpl - // - esp_bt_status_t - case ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT: { - log_v("[status: %d]", param->adv_data_cmpl.status); - break; - } // ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT - - // ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT - // - // adv_data_raw_cmpl - // - esp_bt_status_t status - case ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT: { - log_v("[status: %d]", param->adv_data_raw_cmpl.status); - break; - } // ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT - - // ESP_GAP_BLE_ADV_START_COMPLETE_EVT - // - // adv_start_cmpl - // - esp_bt_status_t status - case ESP_GAP_BLE_ADV_START_COMPLETE_EVT: { - log_v("[status: %d]", param->adv_start_cmpl.status); - break; - } // ESP_GAP_BLE_ADV_START_COMPLETE_EVT - - // ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT - // - // adv_stop_cmpl - // - esp_bt_status_t status - case ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT: { - log_v("[status: %d]", param->adv_stop_cmpl.status); - break; - } // ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT - - // ESP_GAP_BLE_AUTH_CMPL_EVT - // - // auth_cmpl - // - esp_bd_addr_t bd_addr - // - bool key_present - // - esp_link_key key - // - bool success - // - uint8_t fail_reason - // - esp_bd_addr_type_t addr_type - // - esp_bt_dev_type_t dev_type - case ESP_GAP_BLE_AUTH_CMPL_EVT: { - log_v("[bd_addr: %s, key_present: %d, key: ***, key_type: %d, success: %d, fail_reason: %d, addr_type: ***, dev_type: %s]", - BLEAddress(param->ble_security.auth_cmpl.bd_addr).toString().c_str(), - param->ble_security.auth_cmpl.key_present, - param->ble_security.auth_cmpl.key_type, - param->ble_security.auth_cmpl.success, - param->ble_security.auth_cmpl.fail_reason, - BLEUtils::devTypeToString(param->ble_security.auth_cmpl.dev_type) - ); - break; - } // ESP_GAP_BLE_AUTH_CMPL_EVT - - // ESP_GAP_BLE_CLEAR_BOND_DEV_COMPLETE_EVT - // - // clear_bond_dev_cmpl - // - esp_bt_status_t status - case ESP_GAP_BLE_CLEAR_BOND_DEV_COMPLETE_EVT: { - log_v("[status: %d]", param->clear_bond_dev_cmpl.status); - break; - } // ESP_GAP_BLE_CLEAR_BOND_DEV_COMPLETE_EVT - - // ESP_GAP_BLE_LOCAL_IR_EVT - case ESP_GAP_BLE_LOCAL_IR_EVT: { - break; - } // ESP_GAP_BLE_LOCAL_IR_EVT - - // ESP_GAP_BLE_LOCAL_ER_EVT - case ESP_GAP_BLE_LOCAL_ER_EVT: { - break; - } // ESP_GAP_BLE_LOCAL_ER_EVT - - // ESP_GAP_BLE_NC_REQ_EVT - case ESP_GAP_BLE_NC_REQ_EVT: { - log_v("[bd_addr: %s, passkey: %d]", - BLEAddress(param->ble_security.key_notif.bd_addr).toString().c_str(), - param->ble_security.key_notif.passkey); - break; - } // ESP_GAP_BLE_NC_REQ_EVT - - // ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT - // - // read_rssi_cmpl - // - esp_bt_status_t status - // - int8_t rssi - // - esp_bd_addr_t remote_addr - case ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT: { - log_v("[status: %d, rssi: %d, remote_addr: %s]", - param->read_rssi_cmpl.status, - param->read_rssi_cmpl.rssi, - BLEAddress(param->read_rssi_cmpl.remote_addr).toString().c_str() - ); - break; - } // ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT - - // ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT - // - // scan_param_cmpl. - // - esp_bt_status_t status - case ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT: { - log_v("[status: %d]", param->scan_param_cmpl.status); - break; - } // ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT - - // ESP_GAP_BLE_SCAN_RESULT_EVT - // - // scan_rst: - // - search_evt - // - bda - // - dev_type - // - ble_addr_type - // - ble_evt_type - // - rssi - // - ble_adv - // - flag - // - num_resps - // - adv_data_len - // - scan_rsp_len - case ESP_GAP_BLE_SCAN_RESULT_EVT: { - switch (param->scan_rst.search_evt) { - case ESP_GAP_SEARCH_INQ_RES_EVT: { - log_v("search_evt: %s, bda: %s, dev_type: %s, ble_addr_type: %s, ble_evt_type: %s, rssi: %d, ble_adv: ??, flag: %d (%s), num_resps: %d, adv_data_len: %d, scan_rsp_len: %d", - searchEventTypeToString(param->scan_rst.search_evt), - BLEAddress(param->scan_rst.bda).toString().c_str(), - devTypeToString(param->scan_rst.dev_type), - addressTypeToString(param->scan_rst.ble_addr_type), - eventTypeToString(param->scan_rst.ble_evt_type), - param->scan_rst.rssi, - param->scan_rst.flag, - adFlagsToString(param->scan_rst.flag).c_str(), - param->scan_rst.num_resps, - param->scan_rst.adv_data_len, - param->scan_rst.scan_rsp_len - ); - break; - } // ESP_GAP_SEARCH_INQ_RES_EVT - - default: { - log_v("search_evt: %s",searchEventTypeToString(param->scan_rst.search_evt)); - break; - } - } - break; - } // ESP_GAP_BLE_SCAN_RESULT_EVT - - // ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT - // - // scan_rsp_data_cmpl - // - esp_bt_status_t status - case ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT: { - log_v("[status: %d]", param->scan_rsp_data_cmpl.status); - break; - } // ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT - - // ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT - case ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT: { - log_v("[status: %d]", param->scan_rsp_data_raw_cmpl.status); - break; - } // ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT - - // ESP_GAP_BLE_SCAN_START_COMPLETE_EVT - // - // scan_start_cmpl - // - esp_bt_status_t status - case ESP_GAP_BLE_SCAN_START_COMPLETE_EVT: { - log_v("[status: %d]", param->scan_start_cmpl.status); - break; - } // ESP_GAP_BLE_SCAN_START_COMPLETE_EVT - - // ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT - // - // scan_stop_cmpl - // - esp_bt_status_t status - case ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT: { - log_v("[status: %d]", param->scan_stop_cmpl.status); - break; - } // ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT - - // ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT - // - // update_conn_params - // - esp_bt_status_t status - // - esp_bd_addr_t bda - // - uint16_t min_int - // - uint16_t max_int - // - uint16_t latency - // - uint16_t conn_int - // - uint16_t timeout - case ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT: { - log_v("[status: %d, bd_addr: %s, min_int: %d, max_int: %d, latency: %d, conn_int: %d, timeout: %d]", - param->update_conn_params.status, - BLEAddress(param->update_conn_params.bda).toString().c_str(), - param->update_conn_params.min_int, - param->update_conn_params.max_int, - param->update_conn_params.latency, - param->update_conn_params.conn_int, - param->update_conn_params.timeout - ); - break; - } // ESP_GAP_BLE_SCAN_UPDATE_CONN_PARAMS_EVT - - // ESP_GAP_BLE_SEC_REQ_EVT - case ESP_GAP_BLE_SEC_REQ_EVT: { - log_v("[bd_addr: %s]", BLEAddress(param->ble_security.ble_req.bd_addr).toString().c_str()); - break; - } // ESP_GAP_BLE_SEC_REQ_EVT -#endif - default: { - log_v("*** dumpGapEvent: Logger not coded ***"); - break; - } // default - } // switch -} // dumpGapEvent - - -/** - * @brief Decode and dump a GATT client event - * - * @param [in] event The type of event received. - * @param [in] evtParam The data associated with the event. - */ -void BLEUtils::dumpGattClientEvent( - esp_gattc_cb_event_t event, - esp_gatt_if_t gattc_if, - esp_ble_gattc_cb_param_t* evtParam) { - - //esp_ble_gattc_cb_param_t* evtParam = (esp_ble_gattc_cb_param_t*) param; - log_v("GATT Event: %s", BLEUtils::gattClientEventTypeToString(event).c_str()); - switch (event) { -#if CONFIG_LOG_DEFAULT_LEVEL > 4 - // ESP_GATTC_CLOSE_EVT - // - // close: - // - esp_gatt_status_t status - // - uint16_t conn_id - // - esp_bd_addr_t remote_bda - // - esp_gatt_conn_reason_t reason - case ESP_GATTC_CLOSE_EVT: { - log_v("[status: %s, reason:%s, conn_id: %d]", - BLEUtils::gattStatusToString(evtParam->close.status).c_str(), - BLEUtils::gattCloseReasonToString(evtParam->close.reason).c_str(), - evtParam->close.conn_id); - break; - } - - // ESP_GATTC_CONNECT_EVT - // - // connect: - // - esp_gatt_status_t status - // - uint16_t conn_id - // - esp_bd_addr_t remote_bda - case ESP_GATTC_CONNECT_EVT: { - log_v("[conn_id: %d, remote_bda: %s]", - evtParam->connect.conn_id, - BLEAddress(evtParam->connect.remote_bda).toString().c_str() - ); - break; - } - - // ESP_GATTC_DISCONNECT_EVT - // - // disconnect: - // - esp_gatt_conn_reason_t reason - // - uint16_t conn_id - // - esp_bd_addr_t remote_bda - case ESP_GATTC_DISCONNECT_EVT: { - log_v("[reason: %s, conn_id: %d, remote_bda: %s]", - BLEUtils::gattCloseReasonToString(evtParam->disconnect.reason).c_str(), - evtParam->disconnect.conn_id, - BLEAddress(evtParam->disconnect.remote_bda).toString().c_str() - ); - break; - } // ESP_GATTC_DISCONNECT_EVT - - // ESP_GATTC_GET_CHAR_EVT - // - // get_char: - // - esp_gatt_status_t status - // - uin1t6_t conn_id - // - esp_gatt_srvc_id_t srvc_id - // - esp_gatt_id_t char_id - // - esp_gatt_char_prop_t char_prop - /* - case ESP_GATTC_GET_CHAR_EVT: { - - // If the status of the event shows that we have a value other than ESP_GATT_OK then the - // characteristic fields are not set to a usable value .. so don't try and log them. - if (evtParam->get_char.status == ESP_GATT_OK) { - std::string description = "Unknown"; - if (evtParam->get_char.char_id.uuid.len == ESP_UUID_LEN_16) { - description = BLEUtils::gattCharacteristicUUIDToString(evtParam->get_char.char_id.uuid.uuid.uuid16); - } - log_v("[status: %s, conn_id: %d, srvc_id: %s, char_id: %s [description: %s]\nchar_prop: %s]", - BLEUtils::gattStatusToString(evtParam->get_char.status).c_str(), - evtParam->get_char.conn_id, - BLEUtils::gattServiceIdToString(evtParam->get_char.srvc_id).c_str(), - gattIdToString(evtParam->get_char.char_id).c_str(), - description.c_str(), - BLEUtils::characteristicPropertiesToString(evtParam->get_char.char_prop).c_str() - ); - } else { - log_v("[status: %s, conn_id: %d, srvc_id: %s]", - BLEUtils::gattStatusToString(evtParam->get_char.status).c_str(), - evtParam->get_char.conn_id, - BLEUtils::gattServiceIdToString(evtParam->get_char.srvc_id).c_str() - ); - } - break; - } // ESP_GATTC_GET_CHAR_EVT - */ - - // ESP_GATTC_NOTIFY_EVT - // - // notify - // uint16_t conn_id - // esp_bd_addr_t remote_bda - // handle handle - // uint16_t value_len - // uint8_t* value - // bool is_notify - // - case ESP_GATTC_NOTIFY_EVT: { - log_v("[conn_id: %d, remote_bda: %s, handle: %d 0x%.2x, value_len: %d, is_notify: %d]", - evtParam->notify.conn_id, - BLEAddress(evtParam->notify.remote_bda).toString().c_str(), - evtParam->notify.handle, - evtParam->notify.handle, - evtParam->notify.value_len, - evtParam->notify.is_notify - ); - break; - } - - // ESP_GATTC_OPEN_EVT - // - // open: - // - esp_gatt_status_t status - // - uint16_t conn_id - // - esp_bd_addr_t remote_bda - // - uint16_t mtu - // - case ESP_GATTC_OPEN_EVT: { - log_v("[status: %s, conn_id: %d, remote_bda: %s, mtu: %d]", - BLEUtils::gattStatusToString(evtParam->open.status).c_str(), - evtParam->open.conn_id, - BLEAddress(evtParam->open.remote_bda).toString().c_str(), - evtParam->open.mtu); - break; - } // ESP_GATTC_OPEN_EVT - - // ESP_GATTC_READ_CHAR_EVT - // - // Callback to indicate that requested data that we wanted to read is now available. - // - // read: - // esp_gatt_status_t status - // uint16_t conn_id - // uint16_t handle - // uint8_t* value - // uint16_t value_type - // uint16_t value_len - case ESP_GATTC_READ_CHAR_EVT: { - log_v("[status: %s, conn_id: %d, handle: %d 0x%.2x, value_len: %d]", - BLEUtils::gattStatusToString(evtParam->read.status).c_str(), - evtParam->read.conn_id, - evtParam->read.handle, - evtParam->read.handle, - evtParam->read.value_len - ); - if (evtParam->read.status == ESP_GATT_OK) { - GeneralUtils::hexDump(evtParam->read.value, evtParam->read.value_len); - /* - char* pHexData = BLEUtils::buildHexData(nullptr, evtParam->read.value, evtParam->read.value_len); - log_v("value: %s \"%s\"", pHexData, BLEUtils::buildPrintData(evtParam->read.value, evtParam->read.value_len).c_str()); - free(pHexData); - */ - } - break; - } // ESP_GATTC_READ_CHAR_EVT - - // ESP_GATTC_REG_EVT - // - // reg: - // - esp_gatt_status_t status - // - uint16_t app_id - case ESP_GATTC_REG_EVT: { - log_v("[status: %s, app_id: 0x%x]", - BLEUtils::gattStatusToString(evtParam->reg.status).c_str(), - evtParam->reg.app_id); - break; - } // ESP_GATTC_REG_EVT - - // ESP_GATTC_REG_FOR_NOTIFY_EVT - // - // reg_for_notify: - // - esp_gatt_status_t status - // - uint16_t handle - case ESP_GATTC_REG_FOR_NOTIFY_EVT: { - log_v("[status: %s, handle: %d 0x%.2x]", - BLEUtils::gattStatusToString(evtParam->reg_for_notify.status).c_str(), - evtParam->reg_for_notify.handle, - evtParam->reg_for_notify.handle - ); - break; - } // ESP_GATTC_REG_FOR_NOTIFY_EVT - - // ESP_GATTC_SEARCH_CMPL_EVT - // - // search_cmpl: - // - esp_gatt_status_t status - // - uint16_t conn_id - case ESP_GATTC_SEARCH_CMPL_EVT: { - log_v("[status: %s, conn_id: %d]", - BLEUtils::gattStatusToString(evtParam->search_cmpl.status).c_str(), - evtParam->search_cmpl.conn_id); - break; - } // ESP_GATTC_SEARCH_CMPL_EVT - - // ESP_GATTC_SEARCH_RES_EVT - // - // search_res: - // - uint16_t conn_id - // - uint16_t start_handle - // - uint16_t end_handle - // - esp_gatt_id_t srvc_id - case ESP_GATTC_SEARCH_RES_EVT: { - log_v("[conn_id: %d, start_handle: %d 0x%.2x, end_handle: %d 0x%.2x, srvc_id: %s", - evtParam->search_res.conn_id, - evtParam->search_res.start_handle, - evtParam->search_res.start_handle, - evtParam->search_res.end_handle, - evtParam->search_res.end_handle, - gattIdToString(evtParam->search_res.srvc_id).c_str()); - break; - } // ESP_GATTC_SEARCH_RES_EVT - - // ESP_GATTC_WRITE_CHAR_EVT - // - // write: - // - esp_gatt_status_t status - // - uint16_t conn_id - // - uint16_t handle - // - uint16_t offset - case ESP_GATTC_WRITE_CHAR_EVT: { - log_v("[status: %s, conn_id: %d, handle: %d 0x%.2x, offset: %d]", - BLEUtils::gattStatusToString(evtParam->write.status).c_str(), - evtParam->write.conn_id, - evtParam->write.handle, - evtParam->write.handle, - evtParam->write.offset - ); - break; - } // ESP_GATTC_WRITE_CHAR_EVT -#endif - default: - break; - } -} // dumpGattClientEvent - - -/** - * @brief Dump the details of a GATT server event. - * A GATT Server event is a callback received from the BLE subsystem when we are acting as a BLE - * server. The callback indicates the type of event in the `event` field. The `evtParam` is a - * union of structures where we can use the `event` to indicate which of the structures has been - * populated and hence is valid. - * - * @param [in] event The event type that was posted. - * @param [in] evtParam A union of structures only one of which is populated. - */ -void BLEUtils::dumpGattServerEvent( - esp_gatts_cb_event_t event, - esp_gatt_if_t gatts_if, - esp_ble_gatts_cb_param_t* evtParam) { - log_v("GATT ServerEvent: %s", BLEUtils::gattServerEventTypeToString(event).c_str()); - switch (event) { -#if CONFIG_LOG_DEFAULT_LEVEL > 4 - - case ESP_GATTS_ADD_CHAR_DESCR_EVT: { - log_v("[status: %s, attr_handle: %d 0x%.2x, service_handle: %d 0x%.2x, char_uuid: %s]", - gattStatusToString(evtParam->add_char_descr.status).c_str(), - evtParam->add_char_descr.attr_handle, - evtParam->add_char_descr.attr_handle, - evtParam->add_char_descr.service_handle, - evtParam->add_char_descr.service_handle, - BLEUUID(evtParam->add_char_descr.descr_uuid).toString().c_str()); - break; - } // ESP_GATTS_ADD_CHAR_DESCR_EVT - - case ESP_GATTS_ADD_CHAR_EVT: { - if (evtParam->add_char.status == ESP_GATT_OK) { - log_v("[status: %s, attr_handle: %d 0x%.2x, service_handle: %d 0x%.2x, char_uuid: %s]", - gattStatusToString(evtParam->add_char.status).c_str(), - evtParam->add_char.attr_handle, - evtParam->add_char.attr_handle, - evtParam->add_char.service_handle, - evtParam->add_char.service_handle, - BLEUUID(evtParam->add_char.char_uuid).toString().c_str()); - } else { - log_e("[status: %s, attr_handle: %d 0x%.2x, service_handle: %d 0x%.2x, char_uuid: %s]", - gattStatusToString(evtParam->add_char.status).c_str(), - evtParam->add_char.attr_handle, - evtParam->add_char.attr_handle, - evtParam->add_char.service_handle, - evtParam->add_char.service_handle, - BLEUUID(evtParam->add_char.char_uuid).toString().c_str()); - } - break; - } // ESP_GATTS_ADD_CHAR_EVT - - - // ESP_GATTS_CONF_EVT - // - // conf: - // - esp_gatt_status_t status – The status code. - // - uint16_t conn_id – The connection used. - case ESP_GATTS_CONF_EVT: { - log_v("[status: %s, conn_id: 0x%.2x]", - gattStatusToString(evtParam->conf.status).c_str(), - evtParam->conf.conn_id); - break; - } // ESP_GATTS_CONF_EVT - - - case ESP_GATTS_CONGEST_EVT: { - log_v("[conn_id: %d, congested: %d]", - evtParam->congest.conn_id, - evtParam->congest.congested); - break; - } // ESP_GATTS_CONGEST_EVT - - case ESP_GATTS_CONNECT_EVT: { - log_v("[conn_id: %d, remote_bda: %s]", - evtParam->connect.conn_id, - BLEAddress(evtParam->connect.remote_bda).toString().c_str()); - break; - } // ESP_GATTS_CONNECT_EVT - - case ESP_GATTS_CREATE_EVT: { - log_v("[status: %s, service_handle: %d 0x%.2x, service_id: [%s]]", - gattStatusToString(evtParam->create.status).c_str(), - evtParam->create.service_handle, - evtParam->create.service_handle, - gattServiceIdToString(evtParam->create.service_id).c_str()); - break; - } // ESP_GATTS_CREATE_EVT - - case ESP_GATTS_DISCONNECT_EVT: { - log_v("[conn_id: %d, remote_bda: %s]", - evtParam->connect.conn_id, - BLEAddress(evtParam->connect.remote_bda).toString().c_str()); - break; - } // ESP_GATTS_DISCONNECT_EVT - - - // ESP_GATTS_EXEC_WRITE_EVT - // exec_write: - // - uint16_t conn_id - // - uint32_t trans_id - // - esp_bd_addr_t bda - // - uint8_t exec_write_flag - case ESP_GATTS_EXEC_WRITE_EVT: { - char* pWriteFlagText; - switch (evtParam->exec_write.exec_write_flag) { - case ESP_GATT_PREP_WRITE_EXEC: { - pWriteFlagText = (char*) "WRITE"; - break; - } - - case ESP_GATT_PREP_WRITE_CANCEL: { - pWriteFlagText = (char*) "CANCEL"; - break; - } - - default: - pWriteFlagText = (char*) ""; - break; - } - - log_v("[conn_id: %d, trans_id: %d, bda: %s, exec_write_flag: 0x%.2x=%s]", - evtParam->exec_write.conn_id, - evtParam->exec_write.trans_id, - BLEAddress(evtParam->exec_write.bda).toString().c_str(), - evtParam->exec_write.exec_write_flag, - pWriteFlagText); - break; - } // ESP_GATTS_DISCONNECT_EVT - - - case ESP_GATTS_MTU_EVT: { - log_v("[conn_id: %d, mtu: %d]", - evtParam->mtu.conn_id, - evtParam->mtu.mtu); - break; - } // ESP_GATTS_MTU_EVT - - case ESP_GATTS_READ_EVT: { - log_v("[conn_id: %d, trans_id: %d, bda: %s, handle: 0x%.2x, is_long: %d, need_rsp:%d]", - evtParam->read.conn_id, - evtParam->read.trans_id, - BLEAddress(evtParam->read.bda).toString().c_str(), - evtParam->read.handle, - evtParam->read.is_long, - evtParam->read.need_rsp); - break; - } // ESP_GATTS_READ_EVT - - case ESP_GATTS_RESPONSE_EVT: { - log_v("[status: %s, handle: 0x%.2x]", - gattStatusToString(evtParam->rsp.status).c_str(), - evtParam->rsp.handle); - break; - } // ESP_GATTS_RESPONSE_EVT - - case ESP_GATTS_REG_EVT: { - log_v("[status: %s, app_id: %d]", - gattStatusToString(evtParam->reg.status).c_str(), - evtParam->reg.app_id); - break; - } // ESP_GATTS_REG_EVT - - - // ESP_GATTS_START_EVT - // - // start: - // - esp_gatt_status_t status - // - uint16_t service_handle - case ESP_GATTS_START_EVT: { - log_v("[status: %s, service_handle: 0x%.2x]", - gattStatusToString(evtParam->start.status).c_str(), - evtParam->start.service_handle); - break; - } // ESP_GATTS_START_EVT - - - // ESP_GATTS_WRITE_EVT - // - // write: - // - uint16_t conn_id – The connection id. - // - uint16_t trans_id – The transfer id. - // - esp_bd_addr_t bda – The address of the partner. - // - uint16_t handle – The attribute handle. - // - uint16_t offset – The offset of the currently received within the whole value. - // - bool need_rsp – Do we need a response? - // - bool is_prep – Is this a write prepare? If set, then this is to be considered part of the received value and not the whole value. A subsequent ESP_GATTS_EXEC_WRITE will mark the total. - // - uint16_t len – The length of the incoming value part. - // - uint8_t* value – The data for this value part. - case ESP_GATTS_WRITE_EVT: { - log_v("[conn_id: %d, trans_id: %d, bda: %s, handle: 0x%.2x, offset: %d, need_rsp: %d, is_prep: %d, len: %d]", - evtParam->write.conn_id, - evtParam->write.trans_id, - BLEAddress(evtParam->write.bda).toString().c_str(), - evtParam->write.handle, - evtParam->write.offset, - evtParam->write.need_rsp, - evtParam->write.is_prep, - evtParam->write.len); - char* pHex = buildHexData(nullptr, evtParam->write.value, evtParam->write.len); - log_v("[Data: %s]", pHex); - free(pHex); - break; - } // ESP_GATTS_WRITE_EVT -#endif - default: - log_v("dumpGattServerEvent: *** NOT CODED ***"); - break; - } -} // dumpGattServerEvent - - -/** - * @brief Convert a BLE event type to a string. - * @param [in] eventType The event type. - * @return The event type as a string. - */ -const char* BLEUtils::eventTypeToString(esp_ble_evt_type_t eventType) { - switch (eventType) { -#if CONFIG_LOG_DEFAULT_LEVEL > 4 - case ESP_BLE_EVT_CONN_ADV: - return "ESP_BLE_EVT_CONN_ADV"; - case ESP_BLE_EVT_CONN_DIR_ADV: - return "ESP_BLE_EVT_CONN_DIR_ADV"; - case ESP_BLE_EVT_DISC_ADV: - return "ESP_BLE_EVT_DISC_ADV"; - case ESP_BLE_EVT_NON_CONN_ADV: - return "ESP_BLE_EVT_NON_CONN_ADV"; - case ESP_BLE_EVT_SCAN_RSP: - return "ESP_BLE_EVT_SCAN_RSP"; -#endif - default: - log_v("Unknown esp_ble_evt_type_t: %d (0x%.2x)", eventType, eventType); - return "*** Unknown ***"; - } -} // eventTypeToString - - - -/** - * @brief Convert a BT GAP event type to a string representation. - * @param [in] eventType The type of event. - * @return A string representation of the event type. - */ -const char* BLEUtils::gapEventToString(uint32_t eventType) { - switch (eventType) { -#if CONFIG_LOG_DEFAULT_LEVEL > 4 - case ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT: - return "ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT"; - case ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT: - return "ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT"; - case ESP_GAP_BLE_ADV_START_COMPLETE_EVT: - return "ESP_GAP_BLE_ADV_START_COMPLETE_EVT"; - case ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT: /* !< When stop adv complete, the event comes */ - return "ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT"; - case ESP_GAP_BLE_AUTH_CMPL_EVT: /* Authentication complete indication. */ - return "ESP_GAP_BLE_AUTH_CMPL_EVT"; - case ESP_GAP_BLE_CLEAR_BOND_DEV_COMPLETE_EVT: - return "ESP_GAP_BLE_CLEAR_BOND_DEV_COMPLETE_EVT"; - case ESP_GAP_BLE_GET_BOND_DEV_COMPLETE_EVT: - return "ESP_GAP_BLE_GET_BOND_DEV_COMPLETE_EVT"; - case ESP_GAP_BLE_KEY_EVT: /* BLE key event for peer device keys */ - return "ESP_GAP_BLE_KEY_EVT"; - case ESP_GAP_BLE_LOCAL_IR_EVT: /* BLE local IR event */ - return "ESP_GAP_BLE_LOCAL_IR_EVT"; - case ESP_GAP_BLE_LOCAL_ER_EVT: /* BLE local ER event */ - return "ESP_GAP_BLE_LOCAL_ER_EVT"; - case ESP_GAP_BLE_NC_REQ_EVT: /* Numeric Comparison request event */ - return "ESP_GAP_BLE_NC_REQ_EVT"; - case ESP_GAP_BLE_OOB_REQ_EVT: /* OOB request event */ - return "ESP_GAP_BLE_OOB_REQ_EVT"; - case ESP_GAP_BLE_PASSKEY_NOTIF_EVT: /* passkey notification event */ - return "ESP_GAP_BLE_PASSKEY_NOTIF_EVT"; - case ESP_GAP_BLE_PASSKEY_REQ_EVT: /* passkey request event */ - return "ESP_GAP_BLE_PASSKEY_REQ_EVT"; - case ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT: - return "ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT"; - case ESP_GAP_BLE_REMOVE_BOND_DEV_COMPLETE_EVT: - return "ESP_GAP_BLE_REMOVE_BOND_DEV_COMPLETE_EVT"; - case ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT: - return "ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT"; - case ESP_GAP_BLE_SCAN_RESULT_EVT: - return "ESP_GAP_BLE_SCAN_RESULT_EVT"; - case ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT: - return "ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT"; - case ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT: - return "ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT"; - case ESP_GAP_BLE_SCAN_START_COMPLETE_EVT: - return "ESP_GAP_BLE_SCAN_START_COMPLETE_EVT"; - case ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT: - return "ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT"; - case ESP_GAP_BLE_SEC_REQ_EVT: /* BLE security request */ - return "ESP_GAP_BLE_SEC_REQ_EVT"; - case ESP_GAP_BLE_SET_LOCAL_PRIVACY_COMPLETE_EVT: - return "ESP_GAP_BLE_SET_LOCAL_PRIVACY_COMPLETE_EVT"; - case ESP_GAP_BLE_SET_PKT_LENGTH_COMPLETE_EVT: - return "ESP_GAP_BLE_SET_PKT_LENGTH_COMPLETE_EVT"; - case ESP_GAP_BLE_SET_STATIC_RAND_ADDR_EVT: - return "ESP_GAP_BLE_SET_STATIC_RAND_ADDR_EVT"; - case ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT: - return "ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT"; -#endif - default: - log_v("gapEventToString: Unknown event type %d 0x%.2x", eventType, eventType); - return "Unknown event type"; - } -} // gapEventToString - - -std::string BLEUtils::gattCharacteristicUUIDToString(uint32_t characteristicUUID) { - const characteristicMap_t* p = g_characteristicsMappings; - while (strlen(p->name) > 0) { - if (p->assignedNumber == characteristicUUID) { - return std::string(p->name); - } - p++; - } - return "Unknown"; -} // gattCharacteristicUUIDToString - - -/** - * @brief Given the UUID for a BLE defined descriptor, return its string representation. - * @param [in] descriptorUUID UUID of the descriptor to be returned as a string. - * @return The string representation of a descriptor UUID. - */ -std::string BLEUtils::gattDescriptorUUIDToString(uint32_t descriptorUUID) { - gattdescriptor_t* p = (gattdescriptor_t*) g_descriptor_ids; - while (strlen(p->name) > 0) { - if (p->assignedNumber == descriptorUUID) { - return std::string(p->name); - } - p++; - } - return ""; -} // gattDescriptorUUIDToString - - -/** - * @brief Return a string representation of an esp_gattc_service_elem_t. - * @return A string representation of an esp_gattc_service_elem_t. - */ -std::string BLEUtils::gattcServiceElementToString(esp_gattc_service_elem_t* pGATTCServiceElement) { - std::string res; - char val[6]; - res += "[uuid: " + BLEUUID(pGATTCServiceElement->uuid).toString() + ", start_handle: "; - snprintf(val, sizeof(val), "%d", pGATTCServiceElement->start_handle); - res += val; - res += " 0x"; - snprintf(val, sizeof(val), "%04x", pGATTCServiceElement->start_handle); - res += val; - res += ", end_handle: "; - snprintf(val, sizeof(val), "%d", pGATTCServiceElement->end_handle); - res += val; - res += " 0x"; - snprintf(val, sizeof(val), "%04x", pGATTCServiceElement->end_handle); - res += val; - res += "]"; - return res; -} // gattcServiceElementToString - - -/** - * @brief Convert an esp_gatt_srvc_id_t to a string. - */ -std::string BLEUtils::gattServiceIdToString(esp_gatt_srvc_id_t srvcId) { - return gattIdToString(srvcId.id); -} // gattServiceIdToString - - -std::string BLEUtils::gattServiceToString(uint32_t serviceId) { - gattService_t* p = (gattService_t*) g_gattServices; - while (strlen(p->name) > 0) { - if (p->assignedNumber == serviceId) { - return std::string(p->name); - } - p++; - } - return "Unknown"; -} // gattServiceToString - - -/** - * @brief Convert a GATT status to a string. - * - * @param [in] status The status to convert. - * @return A string representation of the status. - */ -std::string BLEUtils::gattStatusToString(esp_gatt_status_t status) { - switch (status) { -#if CONFIG_LOG_DEFAULT_LEVEL > 4 - case ESP_GATT_OK: - return "ESP_GATT_OK"; - case ESP_GATT_INVALID_HANDLE: - return "ESP_GATT_INVALID_HANDLE"; - case ESP_GATT_READ_NOT_PERMIT: - return "ESP_GATT_READ_NOT_PERMIT"; - case ESP_GATT_WRITE_NOT_PERMIT: - return "ESP_GATT_WRITE_NOT_PERMIT"; - case ESP_GATT_INVALID_PDU: - return "ESP_GATT_INVALID_PDU"; - case ESP_GATT_INSUF_AUTHENTICATION: - return "ESP_GATT_INSUF_AUTHENTICATION"; - case ESP_GATT_REQ_NOT_SUPPORTED: - return "ESP_GATT_REQ_NOT_SUPPORTED"; - case ESP_GATT_INVALID_OFFSET: - return "ESP_GATT_INVALID_OFFSET"; - case ESP_GATT_INSUF_AUTHORIZATION: - return "ESP_GATT_INSUF_AUTHORIZATION"; - case ESP_GATT_PREPARE_Q_FULL: - return "ESP_GATT_PREPARE_Q_FULL"; - case ESP_GATT_NOT_FOUND: - return "ESP_GATT_NOT_FOUND"; - case ESP_GATT_NOT_LONG: - return "ESP_GATT_NOT_LONG"; - case ESP_GATT_INSUF_KEY_SIZE: - return "ESP_GATT_INSUF_KEY_SIZE"; - case ESP_GATT_INVALID_ATTR_LEN: - return "ESP_GATT_INVALID_ATTR_LEN"; - case ESP_GATT_ERR_UNLIKELY: - return "ESP_GATT_ERR_UNLIKELY"; - case ESP_GATT_INSUF_ENCRYPTION: - return "ESP_GATT_INSUF_ENCRYPTION"; - case ESP_GATT_UNSUPPORT_GRP_TYPE: - return "ESP_GATT_UNSUPPORT_GRP_TYPE"; - case ESP_GATT_INSUF_RESOURCE: - return "ESP_GATT_INSUF_RESOURCE"; - case ESP_GATT_NO_RESOURCES: - return "ESP_GATT_NO_RESOURCES"; - case ESP_GATT_INTERNAL_ERROR: - return "ESP_GATT_INTERNAL_ERROR"; - case ESP_GATT_WRONG_STATE: - return "ESP_GATT_WRONG_STATE"; - case ESP_GATT_DB_FULL: - return "ESP_GATT_DB_FULL"; - case ESP_GATT_BUSY: - return "ESP_GATT_BUSY"; - case ESP_GATT_ERROR: - return "ESP_GATT_ERROR"; - case ESP_GATT_CMD_STARTED: - return "ESP_GATT_CMD_STARTED"; - case ESP_GATT_ILLEGAL_PARAMETER: - return "ESP_GATT_ILLEGAL_PARAMETER"; - case ESP_GATT_PENDING: - return "ESP_GATT_PENDING"; - case ESP_GATT_AUTH_FAIL: - return "ESP_GATT_AUTH_FAIL"; - case ESP_GATT_MORE: - return "ESP_GATT_MORE"; - case ESP_GATT_INVALID_CFG: - return "ESP_GATT_INVALID_CFG"; - case ESP_GATT_SERVICE_STARTED: - return "ESP_GATT_SERVICE_STARTED"; - case ESP_GATT_ENCRYPED_NO_MITM: - return "ESP_GATT_ENCRYPED_NO_MITM"; - case ESP_GATT_NOT_ENCRYPTED: - return "ESP_GATT_NOT_ENCRYPTED"; - case ESP_GATT_CONGESTED: - return "ESP_GATT_CONGESTED"; - case ESP_GATT_DUP_REG: - return "ESP_GATT_DUP_REG"; - case ESP_GATT_ALREADY_OPEN: - return "ESP_GATT_ALREADY_OPEN"; - case ESP_GATT_CANCEL: - return "ESP_GATT_CANCEL"; - case ESP_GATT_STACK_RSP: - return "ESP_GATT_STACK_RSP"; - case ESP_GATT_APP_RSP: - return "ESP_GATT_APP_RSP"; - case ESP_GATT_UNKNOWN_ERROR: - return "ESP_GATT_UNKNOWN_ERROR"; - case ESP_GATT_CCC_CFG_ERR: - return "ESP_GATT_CCC_CFG_ERR"; - case ESP_GATT_PRC_IN_PROGRESS: - return "ESP_GATT_PRC_IN_PROGRESS"; - case ESP_GATT_OUT_OF_RANGE: - return "ESP_GATT_OUT_OF_RANGE"; -#endif - default: - return "Unknown"; - } -} // gattStatusToString - - - -std::string BLEUtils::getMember(uint32_t memberId) { - member_t* p = (member_t*) members_ids; - - while (strlen(p->name) > 0) { - if (p->assignedNumber == memberId) { - return std::string(p->name); - } - p++; - } - return "Unknown"; -} - -/** - * @brief convert a GAP search event to a string. - * @param [in] searchEvt - * @return The search event type as a string. - */ -const char* BLEUtils::searchEventTypeToString(esp_gap_search_evt_t searchEvt) { - switch (searchEvt) { -#if CONFIG_LOG_DEFAULT_LEVEL > 4 - case ESP_GAP_SEARCH_INQ_RES_EVT: - return "ESP_GAP_SEARCH_INQ_RES_EVT"; - case ESP_GAP_SEARCH_INQ_CMPL_EVT: - return "ESP_GAP_SEARCH_INQ_CMPL_EVT"; - case ESP_GAP_SEARCH_DISC_RES_EVT: - return "ESP_GAP_SEARCH_DISC_RES_EVT"; - case ESP_GAP_SEARCH_DISC_BLE_RES_EVT: - return "ESP_GAP_SEARCH_DISC_BLE_RES_EVT"; - case ESP_GAP_SEARCH_DISC_CMPL_EVT: - return "ESP_GAP_SEARCH_DISC_CMPL_EVT"; - case ESP_GAP_SEARCH_DI_DISC_CMPL_EVT: - return "ESP_GAP_SEARCH_DI_DISC_CMPL_EVT"; - case ESP_GAP_SEARCH_SEARCH_CANCEL_CMPL_EVT: - return "ESP_GAP_SEARCH_SEARCH_CANCEL_CMPL_EVT"; -#endif - default: - log_v("Unknown event type: 0x%x", searchEvt); - return "Unknown event type"; - } -} // searchEventTypeToString - -#endif // CONFIG_BT_ENABLED diff --git a/libraries/BLE/src/BLEUtils.h b/libraries/BLE/src/BLEUtils.h deleted file mode 100644 index 7981691cc84..00000000000 --- a/libraries/BLE/src/BLEUtils.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * BLEUtils.h - * - * Created on: Mar 25, 2017 - * Author: kolban - */ - -#ifndef COMPONENTS_CPP_UTILS_BLEUTILS_H_ -#define COMPONENTS_CPP_UTILS_BLEUTILS_H_ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include // ESP32 BLE -#include // ESP32 BLE -#include // ESP32 BLE -#include -#include "BLEClient.h" - -/** - * @brief A set of general %BLE utilities. - */ -class BLEUtils { -public: - static const char* addressTypeToString(esp_ble_addr_type_t type); - static std::string adFlagsToString(uint8_t adFlags); - static const char* advTypeToString(uint8_t advType); - static char* buildHexData(uint8_t* target, uint8_t* source, uint8_t length); - static std::string buildPrintData(uint8_t* source, size_t length); - static std::string characteristicPropertiesToString(esp_gatt_char_prop_t prop); - static const char* devTypeToString(esp_bt_dev_type_t type); - static esp_gatt_id_t buildGattId(esp_bt_uuid_t uuid, uint8_t inst_id = 0); - static esp_gatt_srvc_id_t buildGattSrvcId(esp_gatt_id_t gattId, bool is_primary = true); - static void dumpGapEvent( - esp_gap_ble_cb_event_t event, - esp_ble_gap_cb_param_t* param); - static void dumpGattClientEvent( - esp_gattc_cb_event_t event, - esp_gatt_if_t gattc_if, - esp_ble_gattc_cb_param_t* evtParam); - static void dumpGattServerEvent( - esp_gatts_cb_event_t event, - esp_gatt_if_t gatts_if, - esp_ble_gatts_cb_param_t* evtParam); - static const char* eventTypeToString(esp_ble_evt_type_t eventType); - static BLEClient* findByAddress(BLEAddress address); - static BLEClient* findByConnId(uint16_t conn_id); - static const char* gapEventToString(uint32_t eventType); - static std::string gattCharacteristicUUIDToString(uint32_t characteristicUUID); - static std::string gattClientEventTypeToString(esp_gattc_cb_event_t eventType); - static std::string gattCloseReasonToString(esp_gatt_conn_reason_t reason); - static std::string gattcServiceElementToString(esp_gattc_service_elem_t* pGATTCServiceElement); - static std::string gattDescriptorUUIDToString(uint32_t descriptorUUID); - static std::string gattServerEventTypeToString(esp_gatts_cb_event_t eventType); - static std::string gattServiceIdToString(esp_gatt_srvc_id_t srvcId); - static std::string gattServiceToString(uint32_t serviceId); - static std::string gattStatusToString(esp_gatt_status_t status); - static std::string getMember(uint32_t memberId); - static void registerByAddress(BLEAddress address, BLEClient* pDevice); - static void registerByConnId(uint16_t conn_id, BLEClient* pDevice); - static const char* searchEventTypeToString(esp_gap_search_evt_t searchEvt); -}; - -#endif // CONFIG_BT_ENABLED -#endif /* COMPONENTS_CPP_UTILS_BLEUTILS_H_ */ diff --git a/libraries/BLE/src/BLEValue.cpp b/libraries/BLE/src/BLEValue.cpp deleted file mode 100644 index 40f6a20a656..00000000000 --- a/libraries/BLE/src/BLEValue.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/* - * BLEValue.cpp - * - * Created on: Jul 17, 2017 - * Author: kolban - */ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include "BLEValue.h" -#include "esp32-hal-log.h" - -BLEValue::BLEValue() { - m_accumulation = ""; - m_value = ""; - m_readOffset = 0; -} // BLEValue - - -/** - * @brief Add a message part to the accumulation. - * The accumulation is a growing set of data that is added to until a commit or cancel. - * @param [in] part A message part being added. - */ -void BLEValue::addPart(std::string part) { - log_v(">> addPart: length=%d", part.length()); - m_accumulation += part; -} // addPart - - -/** - * @brief Add a message part to the accumulation. - * The accumulation is a growing set of data that is added to until a commit or cancel. - * @param [in] pData A message part being added. - * @param [in] length The number of bytes being added. - */ -void BLEValue::addPart(uint8_t* pData, size_t length) { - log_v(">> addPart: length=%d", length); - m_accumulation += std::string((char*) pData, length); -} // addPart - - -/** - * @brief Cancel the current accumulation. - */ -void BLEValue::cancel() { - log_v(">> cancel"); - m_accumulation = ""; - m_readOffset = 0; -} // cancel - - -/** - * @brief Commit the current accumulation. - * When writing a value, we may find that we write it in "parts" meaning that the writes come in in pieces - * of the overall message. After the last part has been received, we may perform a commit which means that - * we now have the complete message and commit the change as a unit. - */ -void BLEValue::commit() { - log_v(">> commit"); - // If there is nothing to commit, do nothing. - if (m_accumulation.length() == 0) return; - setValue(m_accumulation); - m_accumulation = ""; - m_readOffset = 0; -} // commit - - -/** - * @brief Get a pointer to the data. - * @return A pointer to the data. - */ -uint8_t* BLEValue::getData() { - return (uint8_t*) m_value.data(); -} - - -/** - * @brief Get the length of the data in bytes. - * @return The length of the data in bytes. - */ -size_t BLEValue::getLength() { - return m_value.length(); -} // getLength - - -/** - * @brief Get the read offset. - * @return The read offset into the read. - */ -uint16_t BLEValue::getReadOffset() { - return m_readOffset; -} // getReadOffset - - -/** - * @brief Get the current value. - */ -std::string BLEValue::getValue() { - return m_value; -} // getValue - - -/** - * @brief Set the read offset - * @param [in] readOffset The offset into the read. - */ -void BLEValue::setReadOffset(uint16_t readOffset) { - m_readOffset = readOffset; -} // setReadOffset - - -/** - * @brief Set the current value. - */ -void BLEValue::setValue(std::string value) { - m_value = value; -} // setValue - - -/** - * @brief Set the current value. - * @param [in] pData The data for the current value. - * @param [in] The length of the new current value. - */ -void BLEValue::setValue(uint8_t* pData, size_t length) { - m_value = std::string((char*) pData, length); -} // setValue - - -#endif // CONFIG_BT_ENABLED diff --git a/libraries/BLE/src/BLEValue.h b/libraries/BLE/src/BLEValue.h deleted file mode 100644 index 5df904c10bf..00000000000 --- a/libraries/BLE/src/BLEValue.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * BLEValue.h - * - * Created on: Jul 17, 2017 - * Author: kolban - */ - -#ifndef COMPONENTS_CPP_UTILS_BLEVALUE_H_ -#define COMPONENTS_CPP_UTILS_BLEVALUE_H_ -#include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) -#include - -/** - * @brief The model of a %BLE value. - */ -class BLEValue { -public: - BLEValue(); - void addPart(std::string part); - void addPart(uint8_t* pData, size_t length); - void cancel(); - void commit(); - uint8_t* getData(); - size_t getLength(); - uint16_t getReadOffset(); - std::string getValue(); - void setReadOffset(uint16_t readOffset); - void setValue(std::string value); - void setValue(uint8_t* pData, size_t length); - -private: - std::string m_accumulation; - uint16_t m_readOffset; - std::string m_value; - -}; -#endif // CONFIG_BT_ENABLED -#endif /* COMPONENTS_CPP_UTILS_BLEVALUE_H_ */ diff --git a/libraries/BLE/src/FreeRTOS.cpp b/libraries/BLE/src/FreeRTOS.cpp deleted file mode 100644 index 895ba267f81..00000000000 --- a/libraries/BLE/src/FreeRTOS.cpp +++ /dev/null @@ -1,301 +0,0 @@ -/* - * FreeRTOS.cpp - * - * Created on: Feb 24, 2017 - * Author: kolban - */ -#include // Include the base FreeRTOS definitions -#include // Include the task definitions -#include // Include the semaphore definitions -#include -#include -#include -#include "FreeRTOS.h" -#include "sdkconfig.h" -#include "esp32-hal-log.h" - -/** - * Sleep for the specified number of milliseconds. - * @param[in] ms The period in milliseconds for which to sleep. - */ -void FreeRTOS::sleep(uint32_t ms) { - ::vTaskDelay(ms / portTICK_PERIOD_MS); -} // sleep - - -/** - * Start a new task. - * @param[in] task The function pointer to the function to be run in the task. - * @param[in] taskName A string identifier for the task. - * @param[in] param An optional parameter to be passed to the started task. - * @param[in] stackSize An optional paremeter supplying the size of the stack in which to run the task. - */ -void FreeRTOS::startTask(void task(void*), std::string taskName, void* param, uint32_t stackSize) { - ::xTaskCreate(task, taskName.data(), stackSize, param, 5, NULL); -} // startTask - - -/** - * Delete the task. - * @param[in] pTask An optional handle to the task to be deleted. If not supplied the calling task will be deleted. - */ -void FreeRTOS::deleteTask(TaskHandle_t pTask) { - ::vTaskDelete(pTask); -} // deleteTask - - -/** - * Get the time in milliseconds since the %FreeRTOS scheduler started. - * @return The time in milliseconds since the %FreeRTOS scheduler started. - */ -uint32_t FreeRTOS::getTimeSinceStart() { - return (uint32_t) (xTaskGetTickCount() * portTICK_PERIOD_MS); -} // getTimeSinceStart - - -/** - * @brief Wait for a semaphore to be released by trying to take it and - * then releasing it again. - * @param [in] owner A debug tag. - * @return The value associated with the semaphore. - */ -uint32_t FreeRTOS::Semaphore::wait(std::string owner) { - log_v(">> wait: Semaphore waiting: %s for %s", toString().c_str(), owner.c_str()); - - if (m_usePthreads) { - pthread_mutex_lock(&m_pthread_mutex); - } else { - xSemaphoreTake(m_semaphore, portMAX_DELAY); - } - - if (m_usePthreads) { - pthread_mutex_unlock(&m_pthread_mutex); - } else { - xSemaphoreGive(m_semaphore); - } - - log_v("<< wait: Semaphore released: %s", toString().c_str()); - return m_value; -} // wait - -/** - * @brief Wait for a semaphore to be released in a given period of time by trying to take it and - * then releasing it again. The value associated with the semaphore can be taken by value() call after return - * @param [in] owner A debug tag. - * @param [in] timeoutMs timeout to wait in ms. - * @return True if we took the semaphore within timeframe. - */ -bool FreeRTOS::Semaphore::timedWait(std::string owner, uint32_t timeoutMs) { - log_v(">> wait: Semaphore waiting: %s for %s", toString().c_str(), owner.c_str()); - - if (m_usePthreads && timeoutMs != portMAX_DELAY) { - assert(false); // We apparently don't have a timed wait for pthreads. - } - - auto ret = pdTRUE; - - if (m_usePthreads) { - pthread_mutex_lock(&m_pthread_mutex); - } else { - ret = xSemaphoreTake(m_semaphore, timeoutMs); - } - - if (m_usePthreads) { - pthread_mutex_unlock(&m_pthread_mutex); - } else { - xSemaphoreGive(m_semaphore); - } - - log_v("<< wait: Semaphore %s released: %d", toString().c_str(), ret); - return ret; -} // wait - - -FreeRTOS::Semaphore::Semaphore(std::string name) { - m_usePthreads = false; // Are we using pThreads or FreeRTOS? - if (m_usePthreads) { - pthread_mutex_init(&m_pthread_mutex, nullptr); - } else { - m_semaphore = xSemaphoreCreateBinary(); - xSemaphoreGive(m_semaphore); - } - - m_name = name; - m_owner = std::string(""); - m_value = 0; -} - - -FreeRTOS::Semaphore::~Semaphore() { - if (m_usePthreads) { - pthread_mutex_destroy(&m_pthread_mutex); - } else { - vSemaphoreDelete(m_semaphore); - } -} - - -/** - * @brief Give a semaphore. - * The Semaphore is given. - */ -void FreeRTOS::Semaphore::give() { - log_v("Semaphore giving: %s", toString().c_str()); - m_owner = std::string(""); - - if (m_usePthreads) { - pthread_mutex_unlock(&m_pthread_mutex); - } else { - xSemaphoreGive(m_semaphore); - } -// #ifdef ARDUINO_ARCH_ESP32 -// FreeRTOS::sleep(10); -// #endif - -} // Semaphore::give - - -/** - * @brief Give a semaphore. - * The Semaphore is given with an associated value. - * @param [in] value The value to associate with the semaphore. - */ -void FreeRTOS::Semaphore::give(uint32_t value) { - m_value = value; - give(); -} // give - - -/** - * @brief Give a semaphore from an ISR. - */ -void FreeRTOS::Semaphore::giveFromISR() { - BaseType_t higherPriorityTaskWoken; - if (m_usePthreads) { - assert(false); - } else { - xSemaphoreGiveFromISR(m_semaphore, &higherPriorityTaskWoken); - } -} // giveFromISR - - -/** - * @brief Take a semaphore. - * Take a semaphore and wait indefinitely. - * @param [in] owner The new owner (for debugging) - * @return True if we took the semaphore. - */ -bool FreeRTOS::Semaphore::take(std::string owner) { - log_d("Semaphore taking: %s for %s", toString().c_str(), owner.c_str()); - bool rc = false; - if (m_usePthreads) { - pthread_mutex_lock(&m_pthread_mutex); - } else { - rc = ::xSemaphoreTake(m_semaphore, portMAX_DELAY) == pdTRUE; - } - m_owner = owner; - if (rc) { - log_d("Semaphore taken: %s", toString().c_str()); - } else { - log_e("Semaphore NOT taken: %s", toString().c_str()); - } - return rc; -} // Semaphore::take - - -/** - * @brief Take a semaphore. - * Take a semaphore but return if we haven't obtained it in the given period of milliseconds. - * @param [in] timeoutMs Timeout in milliseconds. - * @param [in] owner The new owner (for debugging) - * @return True if we took the semaphore. - */ -bool FreeRTOS::Semaphore::take(uint32_t timeoutMs, std::string owner) { - log_v("Semaphore taking: %s for %s", toString().c_str(), owner.c_str()); - bool rc = false; - if (m_usePthreads) { - assert(false); // We apparently don't have a timed wait for pthreads. - } else { - rc = ::xSemaphoreTake(m_semaphore, timeoutMs / portTICK_PERIOD_MS) == pdTRUE; - } - m_owner = owner; - if (rc) { - log_v("Semaphore taken: %s", toString().c_str()); - } else { - log_e("Semaphore NOT taken: %s", toString().c_str()); - } - return rc; -} // Semaphore::take - - - -/** - * @brief Create a string representation of the semaphore. - * @return A string representation of the semaphore. - */ -std::string FreeRTOS::Semaphore::toString() { - char hex[9]; - std::string res = "name: " + m_name + " (0x"; - snprintf(hex, sizeof(hex), "%08x", (uint32_t)m_semaphore); - res += hex; - res += "), owner: " + m_owner; - return res; -} // toString - - -/** - * @brief Set the name of the semaphore. - * @param [in] name The name of the semaphore. - */ -void FreeRTOS::Semaphore::setName(std::string name) { - m_name = name; -} // setName - - -/** - * @brief Create a ring buffer. - * @param [in] length The amount of storage to allocate for the ring buffer. - * @param [in] type The type of buffer. One of RINGBUF_TYPE_NOSPLIT, RINGBUF_TYPE_ALLOWSPLIT, RINGBUF_TYPE_BYTEBUF. - */ -Ringbuffer::Ringbuffer(size_t length, ringbuf_type_t type) { - m_handle = ::xRingbufferCreate(length, type); -} // Ringbuffer - - -Ringbuffer::~Ringbuffer() { - ::vRingbufferDelete(m_handle); -} // ~Ringbuffer - - -/** - * @brief Receive data from the buffer. - * @param [out] size On return, the size of data returned. - * @param [in] wait How long to wait. - * @return A pointer to the storage retrieved. - */ -void* Ringbuffer::receive(size_t* size, TickType_t wait) { - return ::xRingbufferReceive(m_handle, size, wait); -} // receive - - -/** - * @brief Return an item. - * @param [in] item The item to be returned/released. - */ -void Ringbuffer::returnItem(void* item) { - ::vRingbufferReturnItem(m_handle, item); -} // returnItem - - -/** - * @brief Send data to the buffer. - * @param [in] data The data to place into the buffer. - * @param [in] length The length of data to place into the buffer. - * @param [in] wait How long to wait before giving up. The default is to wait indefinitely. - * @return - */ -bool Ringbuffer::send(void* data, size_t length, TickType_t wait) { - return ::xRingbufferSend(m_handle, data, length, wait) == pdTRUE; -} // send - - diff --git a/libraries/BLE/src/FreeRTOS.h b/libraries/BLE/src/FreeRTOS.h deleted file mode 100644 index 4d089c81db6..00000000000 --- a/libraries/BLE/src/FreeRTOS.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * FreeRTOS.h - * - * Created on: Feb 24, 2017 - * Author: kolban - */ - -#ifndef MAIN_FREERTOS_H_ -#define MAIN_FREERTOS_H_ -#include -#include -#include - -#include // Include the base FreeRTOS definitions. -#include // Include the task definitions. -#include // Include the semaphore definitions. -#include // Include the ringbuffer definitions. - - -/** - * @brief Interface to %FreeRTOS functions. - */ -class FreeRTOS { -public: - static void sleep(uint32_t ms); - static void startTask(void task(void*), std::string taskName, void* param = nullptr, uint32_t stackSize = 2048); - static void deleteTask(TaskHandle_t pTask = nullptr); - - static uint32_t getTimeSinceStart(); - - class Semaphore { - public: - Semaphore(std::string owner = ""); - ~Semaphore(); - void give(); - void give(uint32_t value); - void giveFromISR(); - void setName(std::string name); - bool take(std::string owner = ""); - bool take(uint32_t timeoutMs, std::string owner = ""); - std::string toString(); - uint32_t wait(std::string owner = ""); - bool timedWait(std::string owner = "", uint32_t timeoutMs = portMAX_DELAY); - uint32_t value(){ return m_value; }; - - private: - SemaphoreHandle_t m_semaphore; - pthread_mutex_t m_pthread_mutex; - std::string m_name; - std::string m_owner; - uint32_t m_value; - bool m_usePthreads; - - }; -}; - - -/** - * @brief Ringbuffer. - */ -class Ringbuffer { -public: - Ringbuffer(size_t length, ringbuf_type_t type = RINGBUF_TYPE_NOSPLIT); - ~Ringbuffer(); - - void* receive(size_t* size, TickType_t wait = portMAX_DELAY); - void returnItem(void* item); - bool send(void* data, size_t length, TickType_t wait = portMAX_DELAY); -private: - RingbufHandle_t m_handle; -}; - -#endif /* MAIN_FREERTOS_H_ */ diff --git a/libraries/BLE/src/GeneralUtils.cpp b/libraries/BLE/src/GeneralUtils.cpp deleted file mode 100644 index 02736b81b1a..00000000000 --- a/libraries/BLE/src/GeneralUtils.cpp +++ /dev/null @@ -1,541 +0,0 @@ -/* - * GeneralUtils.cpp - * - * Created on: May 20, 2017 - * Author: kolban - */ - -#include "GeneralUtils.h" -#include -#include -#include -#include -#include -#include -#include "FreeRTOS.h" -#include -#include -#include -#include -#include -#include "esp32-hal-log.h" - -static const char kBase64Alphabet[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "abcdefghijklmnopqrstuvwxyz" - "0123456789+/"; - -static int base64EncodedLength(size_t length) { - return (length + 2 - ((length + 2) % 3)) / 3 * 4; -} // base64EncodedLength - - -static int base64EncodedLength(const std::string& in) { - return base64EncodedLength(in.length()); -} // base64EncodedLength - - -static void a3_to_a4(unsigned char* a4, unsigned char* a3) { - a4[0] = (a3[0] & 0xfc) >> 2; - a4[1] = ((a3[0] & 0x03) << 4) + ((a3[1] & 0xf0) >> 4); - a4[2] = ((a3[1] & 0x0f) << 2) + ((a3[2] & 0xc0) >> 6); - a4[3] = (a3[2] & 0x3f); -} // a3_to_a4 - - -static void a4_to_a3(unsigned char* a3, unsigned char* a4) { - a3[0] = (a4[0] << 2) + ((a4[1] & 0x30) >> 4); - a3[1] = ((a4[1] & 0xf) << 4) + ((a4[2] & 0x3c) >> 2); - a3[2] = ((a4[2] & 0x3) << 6) + a4[3]; -} // a4_to_a3 - - -/** - * @brief Encode a string into base 64. - * @param [in] in - * @param [out] out - */ -bool GeneralUtils::base64Encode(const std::string& in, std::string* out) { - int i = 0, j = 0; - size_t enc_len = 0; - unsigned char a3[3]; - unsigned char a4[4]; - - out->resize(base64EncodedLength(in)); - - int input_len = in.size(); - std::string::const_iterator input = in.begin(); - - while (input_len--) { - a3[i++] = *(input++); - if (i == 3) { - a3_to_a4(a4, a3); - - for (i = 0; i < 4; i++) { - (*out)[enc_len++] = kBase64Alphabet[a4[i]]; - } - - i = 0; - } - } - - if (i) { - for (j = i; j < 3; j++) { - a3[j] = '\0'; - } - - a3_to_a4(a4, a3); - - for (j = 0; j < i + 1; j++) { - (*out)[enc_len++] = kBase64Alphabet[a4[j]]; - } - - while ((i++ < 3)) { - (*out)[enc_len++] = '='; - } - } - - return (enc_len == out->size()); -} // base64Encode - - -/** - * @brief Dump general info to the log. - * Data includes: - * * Amount of free RAM - */ -void GeneralUtils::dumpInfo() { - esp_chip_info_t chipInfo; - esp_chip_info(&chipInfo); - log_v("--- dumpInfo ---"); - log_v("Free heap: %d", heap_caps_get_free_size(MALLOC_CAP_8BIT)); - log_v("Chip Info: Model: %d, cores: %d, revision: %d", chipInfo.model, chipInfo.cores, chipInfo.revision); - log_v("ESP-IDF version: %s", esp_get_idf_version()); - log_v("---"); -} // dumpInfo - - -/** - * @brief Does the string end with a specific character? - * @param [in] str The string to examine. - * @param [in] c The character to look form. - * @return True if the string ends with the given character. - */ -bool GeneralUtils::endsWith(std::string str, char c) { - if (str.empty()) { - return false; - } - if (str.at(str.length() - 1) == c) { - return true; - } - return false; -} // endsWidth - - -static int DecodedLength(const std::string& in) { - int numEq = 0; - int n = (int) in.size(); - - for (std::string::const_reverse_iterator it = in.rbegin(); *it == '='; ++it) { - ++numEq; - } - return ((6 * n) / 8) - numEq; -} // DecodedLength - - -static unsigned char b64_lookup(unsigned char c) { - if(c >='A' && c <='Z') return c - 'A'; - if(c >='a' && c <='z') return c - 71; - if(c >='0' && c <='9') return c + 4; - if(c == '+') return 62; - if(c == '/') return 63; - return 255; -}; // b64_lookup - - -/** - * @brief Decode a chunk of data that is base64 encoded. - * @param [in] in The string to be decoded. - * @param [out] out The resulting data. - */ -bool GeneralUtils::base64Decode(const std::string& in, std::string* out) { - int i = 0, j = 0; - size_t dec_len = 0; - unsigned char a3[3]; - unsigned char a4[4]; - - int input_len = in.size(); - std::string::const_iterator input = in.begin(); - - out->resize(DecodedLength(in)); - - while (input_len--) { - if (*input == '=') { - break; - } - - a4[i++] = *(input++); - if (i == 4) { - for (i = 0; i <4; i++) { - a4[i] = b64_lookup(a4[i]); - } - - a4_to_a3(a3,a4); - - for (i = 0; i < 3; i++) { - (*out)[dec_len++] = a3[i]; - } - - i = 0; - } - } - - if (i) { - for (j = i; j < 4; j++) { - a4[j] = '\0'; - } - - for (j = 0; j < 4; j++) { - a4[j] = b64_lookup(a4[j]); - } - - a4_to_a3(a3,a4); - - for (j = 0; j < i - 1; j++) { - (*out)[dec_len++] = a3[j]; - } - } - - return (dec_len == out->size()); - } // base64Decode - -/* -void GeneralUtils::hexDump(uint8_t* pData, uint32_t length) { - uint32_t index=0; - std::stringstream ascii; - std::stringstream hex; - char asciiBuf[80]; - char hexBuf[80]; - hex.str(""); - ascii.str(""); - while(index < length) { - hex << std::setfill('0') << std::setw(2) << std::hex << (int)pData[index] << ' '; - if (std::isprint(pData[index])) { - ascii << pData[index]; - } else { - ascii << '.'; - } - index++; - if (index % 16 == 0) { - strcpy(hexBuf, hex.str().c_str()); - strcpy(asciiBuf, ascii.str().c_str()); - log_v("%s %s", hexBuf, asciiBuf); - hex.str(""); - ascii.str(""); - } - } - if (index %16 != 0) { - while(index % 16 != 0) { - hex << " "; - index++; - } - strcpy(hexBuf, hex.str().c_str()); - strcpy(asciiBuf, ascii.str().c_str()); - log_v("%s %s", hexBuf, asciiBuf); - //log_v("%s %s", hex.str().c_str(), ascii.str().c_str()); - } - FreeRTOS::sleep(1000); -} -*/ - -/* -void GeneralUtils::hexDump(uint8_t* pData, uint32_t length) { - uint32_t index=0; - static std::stringstream ascii; - static std::stringstream hex; - hex.str(""); - ascii.str(""); - while(index < length) { - hex << std::setfill('0') << std::setw(2) << std::hex << (int)pData[index] << ' '; - if (std::isprint(pData[index])) { - ascii << pData[index]; - } else { - ascii << '.'; - } - index++; - if (index % 16 == 0) { - log_v("%s %s", hex.str().c_str(), ascii.str().c_str()); - hex.str(""); - ascii.str(""); - } - } - if (index %16 != 0) { - while(index % 16 != 0) { - hex << " "; - index++; - } - log_v("%s %s", hex.str().c_str(), ascii.str().c_str()); - } - FreeRTOS::sleep(1000); -} -*/ - - -/** - * @brief Dump a representation of binary data to the console. - * - * @param [in] pData Pointer to the start of data to be logged. - * @param [in] length Length of the data (in bytes) to be logged. - * @return N/A. - */ -void GeneralUtils::hexDump(const uint8_t* pData, uint32_t length) { - char ascii[80]; - char hex[80]; - char tempBuf[80]; - uint32_t lineNumber = 0; - - log_v(" 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f"); - log_v(" -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --"); - strcpy(ascii, ""); - strcpy(hex, ""); - uint32_t index = 0; - while (index < length) { - sprintf(tempBuf, "%.2x ", pData[index]); - strcat(hex, tempBuf); - if (isprint(pData[index])) { - sprintf(tempBuf, "%c", pData[index]); - } else { - sprintf(tempBuf, "."); - } - strcat(ascii, tempBuf); - index++; - if (index % 16 == 0) { - log_v("%.4x %s %s", lineNumber * 16, hex, ascii); - strcpy(ascii, ""); - strcpy(hex, ""); - lineNumber++; - } - } - if (index %16 != 0) { - while (index % 16 != 0) { - strcat(hex, " "); - index++; - } - log_v("%.4x %s %s", lineNumber * 16, hex, ascii); - } -} // hexDump - - -/** - * @brief Convert an IP address to string. - * @param ip The 4 byte IP address. - * @return A string representation of the IP address. - */ -std::string GeneralUtils::ipToString(uint8_t *ip) { - auto size = 16; - char *val = (char*)malloc(size); - snprintf(val, size, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]); - std::string res(val); - free(val); - return res; -} // ipToString - - -/** - * @brief Split a string into parts based on a delimiter. - * @param [in] source The source string to split. - * @param [in] delimiter The delimiter characters. - * @return A vector of strings that are the split of the input. - */ -std::vector GeneralUtils::split(std::string source, char delimiter) { - // See also: https://stackoverflow.com/questions/5167625/splitting-a-c-stdstring-using-tokens-e-g - std::vector strings; - std::size_t current, previous = 0; - current = source.find(delimiter); - while (current != std::string::npos) { - strings.push_back(trim(source.substr(previous, current - previous))); - previous = current + 1; - current = source.find(delimiter, previous); - } - strings.push_back(trim(source.substr(previous, current - previous))); - return strings; -} // split - - -/** - * @brief Convert an ESP error code to a string. - * @param [in] errCode The errCode to be converted. - * @return A string representation of the error code. - */ -const char* GeneralUtils::errorToString(esp_err_t errCode) { - switch (errCode) { -#if CONFIG_LOG_DEFAULT_LEVEL > 4 - case ESP_OK: - return "ESP_OK"; - case ESP_FAIL: - return "ESP_FAIL"; - case ESP_ERR_NO_MEM: - return "ESP_ERR_NO_MEM"; - case ESP_ERR_INVALID_ARG: - return "ESP_ERR_INVALID_ARG"; - case ESP_ERR_INVALID_SIZE: - return "ESP_ERR_INVALID_SIZE"; - case ESP_ERR_INVALID_STATE: - return "ESP_ERR_INVALID_STATE"; - case ESP_ERR_NOT_FOUND: - return "ESP_ERR_NOT_FOUND"; - case ESP_ERR_NOT_SUPPORTED: - return "ESP_ERR_NOT_SUPPORTED"; - case ESP_ERR_TIMEOUT: - return "ESP_ERR_TIMEOUT"; - case ESP_ERR_NVS_NOT_INITIALIZED: - return "ESP_ERR_NVS_NOT_INITIALIZED"; - case ESP_ERR_NVS_NOT_FOUND: - return "ESP_ERR_NVS_NOT_FOUND"; - case ESP_ERR_NVS_TYPE_MISMATCH: - return "ESP_ERR_NVS_TYPE_MISMATCH"; - case ESP_ERR_NVS_READ_ONLY: - return "ESP_ERR_NVS_READ_ONLY"; - case ESP_ERR_NVS_NOT_ENOUGH_SPACE: - return "ESP_ERR_NVS_NOT_ENOUGH_SPACE"; - case ESP_ERR_NVS_INVALID_NAME: - return "ESP_ERR_NVS_INVALID_NAME"; - case ESP_ERR_NVS_INVALID_HANDLE: - return "ESP_ERR_NVS_INVALID_HANDLE"; - case ESP_ERR_NVS_REMOVE_FAILED: - return "ESP_ERR_NVS_REMOVE_FAILED"; - case ESP_ERR_NVS_KEY_TOO_LONG: - return "ESP_ERR_NVS_KEY_TOO_LONG"; - case ESP_ERR_NVS_PAGE_FULL: - return "ESP_ERR_NVS_PAGE_FULL"; - case ESP_ERR_NVS_INVALID_STATE: - return "ESP_ERR_NVS_INVALID_STATE"; - case ESP_ERR_NVS_INVALID_LENGTH: - return "ESP_ERR_NVS_INVALID_LENGTH"; - case ESP_ERR_WIFI_NOT_INIT: - return "ESP_ERR_WIFI_NOT_INIT"; - //case ESP_ERR_WIFI_NOT_START: - // return "ESP_ERR_WIFI_NOT_START"; - case ESP_ERR_WIFI_IF: - return "ESP_ERR_WIFI_IF"; - case ESP_ERR_WIFI_MODE: - return "ESP_ERR_WIFI_MODE"; - case ESP_ERR_WIFI_STATE: - return "ESP_ERR_WIFI_STATE"; - case ESP_ERR_WIFI_CONN: - return "ESP_ERR_WIFI_CONN"; - case ESP_ERR_WIFI_NVS: - return "ESP_ERR_WIFI_NVS"; - case ESP_ERR_WIFI_MAC: - return "ESP_ERR_WIFI_MAC"; - case ESP_ERR_WIFI_SSID: - return "ESP_ERR_WIFI_SSID"; - case ESP_ERR_WIFI_PASSWORD: - return "ESP_ERR_WIFI_PASSWORD"; - case ESP_ERR_WIFI_TIMEOUT: - return "ESP_ERR_WIFI_TIMEOUT"; - case ESP_ERR_WIFI_WAKE_FAIL: - return "ESP_ERR_WIFI_WAKE_FAIL"; -#endif - default: - return "Unknown ESP_ERR error"; - } -} // errorToString - -/** - * @brief Convert a wifi_err_reason_t code to a string. - * @param [in] errCode The errCode to be converted. - * @return A string representation of the error code. - * - * @note: wifi_err_reason_t values as of April 2018 are: (1-24, 200-204) and are defined in ~/esp-idf/components/esp32/include/esp_wifi_types.h. - */ -const char* GeneralUtils::wifiErrorToString(uint8_t errCode) { - if (errCode == ESP_OK) return "ESP_OK (received SYSTEM_EVENT_STA_GOT_IP event)"; - if (errCode == UINT8_MAX) return "Not Connected (default value)"; - - switch ((wifi_err_reason_t) errCode) { -#if CONFIG_LOG_DEFAULT_LEVEL > 4 - case WIFI_REASON_UNSPECIFIED: - return "WIFI_REASON_UNSPECIFIED"; - case WIFI_REASON_AUTH_EXPIRE: - return "WIFI_REASON_AUTH_EXPIRE"; - case WIFI_REASON_AUTH_LEAVE: - return "WIFI_REASON_AUTH_LEAVE"; - case WIFI_REASON_ASSOC_EXPIRE: - return "WIFI_REASON_ASSOC_EXPIRE"; - case WIFI_REASON_ASSOC_TOOMANY: - return "WIFI_REASON_ASSOC_TOOMANY"; - case WIFI_REASON_NOT_AUTHED: - return "WIFI_REASON_NOT_AUTHED"; - case WIFI_REASON_NOT_ASSOCED: - return "WIFI_REASON_NOT_ASSOCED"; - case WIFI_REASON_ASSOC_LEAVE: - return "WIFI_REASON_ASSOC_LEAVE"; - case WIFI_REASON_ASSOC_NOT_AUTHED: - return "WIFI_REASON_ASSOC_NOT_AUTHED"; - case WIFI_REASON_DISASSOC_PWRCAP_BAD: - return "WIFI_REASON_DISASSOC_PWRCAP_BAD"; - case WIFI_REASON_DISASSOC_SUPCHAN_BAD: - return "WIFI_REASON_DISASSOC_SUPCHAN_BAD"; - case WIFI_REASON_IE_INVALID: - return "WIFI_REASON_IE_INVALID"; - case WIFI_REASON_MIC_FAILURE: - return "WIFI_REASON_MIC_FAILURE"; - case WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT: - return "WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT"; - case WIFI_REASON_GROUP_KEY_UPDATE_TIMEOUT: - return "WIFI_REASON_GROUP_KEY_UPDATE_TIMEOUT"; - case WIFI_REASON_IE_IN_4WAY_DIFFERS: - return "WIFI_REASON_IE_IN_4WAY_DIFFERS"; - case WIFI_REASON_GROUP_CIPHER_INVALID: - return "WIFI_REASON_GROUP_CIPHER_INVALID"; - case WIFI_REASON_PAIRWISE_CIPHER_INVALID: - return "WIFI_REASON_PAIRWISE_CIPHER_INVALID"; - case WIFI_REASON_AKMP_INVALID: - return "WIFI_REASON_AKMP_INVALID"; - case WIFI_REASON_UNSUPP_RSN_IE_VERSION: - return "WIFI_REASON_UNSUPP_RSN_IE_VERSION"; - case WIFI_REASON_INVALID_RSN_IE_CAP: - return "WIFI_REASON_INVALID_RSN_IE_CAP"; - case WIFI_REASON_802_1X_AUTH_FAILED: - return "WIFI_REASON_802_1X_AUTH_FAILED"; - case WIFI_REASON_CIPHER_SUITE_REJECTED: - return "WIFI_REASON_CIPHER_SUITE_REJECTED"; - case WIFI_REASON_BEACON_TIMEOUT: - return "WIFI_REASON_BEACON_TIMEOUT"; - case WIFI_REASON_NO_AP_FOUND: - return "WIFI_REASON_NO_AP_FOUND"; - case WIFI_REASON_AUTH_FAIL: - return "WIFI_REASON_AUTH_FAIL"; - case WIFI_REASON_ASSOC_FAIL: - return "WIFI_REASON_ASSOC_FAIL"; - case WIFI_REASON_HANDSHAKE_TIMEOUT: - return "WIFI_REASON_HANDSHAKE_TIMEOUT"; -#endif - default: - return "Unknown ESP_ERR error"; - } -} // wifiErrorToString - - -/** - * @brief Convert a string to lower case. - * @param [in] value The string to convert to lower case. - * @return A lower case representation of the string. - */ -std::string GeneralUtils::toLower(std::string& value) { - // Question: Could this be improved with a signature of: - // std::string& GeneralUtils::toLower(std::string& value) - std::transform(value.begin(), value.end(), value.begin(), ::tolower); - return value; -} // toLower - - -/** - * @brief Remove white space from a string. - */ -std::string GeneralUtils::trim(const std::string& str) { - size_t first = str.find_first_not_of(' '); - if (std::string::npos == first) return str; - size_t last = str.find_last_not_of(' '); - return str.substr(first, (last - first + 1)); -} // trim diff --git a/libraries/BLE/src/GeneralUtils.h b/libraries/BLE/src/GeneralUtils.h deleted file mode 100644 index 8eecbd4d029..00000000000 --- a/libraries/BLE/src/GeneralUtils.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * GeneralUtils.h - * - * Created on: May 20, 2017 - * Author: kolban - */ - -#ifndef COMPONENTS_CPP_UTILS_GENERALUTILS_H_ -#define COMPONENTS_CPP_UTILS_GENERALUTILS_H_ -#include -#include -#include -#include -#include - -/** - * @brief General utilities. - */ -class GeneralUtils { -public: - static bool base64Decode(const std::string& in, std::string* out); - static bool base64Encode(const std::string& in, std::string* out); - static void dumpInfo(); - static bool endsWith(std::string str, char c); - static const char* errorToString(esp_err_t errCode); - static const char* wifiErrorToString(uint8_t value); - static void hexDump(const uint8_t* pData, uint32_t length); - static std::string ipToString(uint8_t* ip); - static std::vector split(std::string source, char delimiter); - static std::string toLower(std::string& value); - static std::string trim(const std::string& str); - -}; - -#endif /* COMPONENTS_CPP_UTILS_GENERALUTILS_H_ */ diff --git a/libraries/BLE/src/HIDKeyboardTypes.h b/libraries/BLE/src/HIDKeyboardTypes.h deleted file mode 100644 index 4e221d57f8d..00000000000 --- a/libraries/BLE/src/HIDKeyboardTypes.h +++ /dev/null @@ -1,402 +0,0 @@ -/* Copyright (c) 2015 mbed.org, MIT License - * - * 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. - * - * Note: this file was pulled from different parts of the USBHID library, in mbed SDK - */ - -#ifndef KEYBOARD_DEFS_H -#define KEYBOARD_DEFS_H - -#define REPORT_ID_KEYBOARD 1 -#define REPORT_ID_VOLUME 3 - -/* Modifiers */ -enum MODIFIER_KEY { - KEY_CTRL = 1, - KEY_SHIFT = 2, - KEY_ALT = 4, -}; - - -enum MEDIA_KEY { - KEY_NEXT_TRACK, /*!< next Track Button */ - KEY_PREVIOUS_TRACK, /*!< Previous track Button */ - KEY_STOP, /*!< Stop Button */ - KEY_PLAY_PAUSE, /*!< Play/Pause Button */ - KEY_MUTE, /*!< Mute Button */ - KEY_VOLUME_UP, /*!< Volume Up Button */ - KEY_VOLUME_DOWN, /*!< Volume Down Button */ -}; - -enum FUNCTION_KEY { - KEY_F1 = 128, /* F1 key */ - KEY_F2, /* F2 key */ - KEY_F3, /* F3 key */ - KEY_F4, /* F4 key */ - KEY_F5, /* F5 key */ - KEY_F6, /* F6 key */ - KEY_F7, /* F7 key */ - KEY_F8, /* F8 key */ - KEY_F9, /* F9 key */ - KEY_F10, /* F10 key */ - KEY_F11, /* F11 key */ - KEY_F12, /* F12 key */ - - KEY_PRINT_SCREEN, /* Print Screen key */ - KEY_SCROLL_LOCK, /* Scroll lock */ - KEY_CAPS_LOCK, /* caps lock */ - KEY_NUM_LOCK, /* num lock */ - KEY_INSERT, /* Insert key */ - KEY_HOME, /* Home key */ - KEY_PAGE_UP, /* Page Up key */ - KEY_PAGE_DOWN, /* Page Down key */ - - RIGHT_ARROW, /* Right arrow */ - LEFT_ARROW, /* Left arrow */ - DOWN_ARROW, /* Down arrow */ - UP_ARROW, /* Up arrow */ -}; - -typedef struct { - unsigned char usage; - unsigned char modifier; -} KEYMAP; - -#ifdef US_KEYBOARD -/* US keyboard (as HID standard) */ -#define KEYMAP_SIZE (152) -const KEYMAP keymap[KEYMAP_SIZE] = { - {0, 0}, /* NUL */ - {0, 0}, /* SOH */ - {0, 0}, /* STX */ - {0, 0}, /* ETX */ - {0, 0}, /* EOT */ - {0, 0}, /* ENQ */ - {0, 0}, /* ACK */ - {0, 0}, /* BEL */ - {0x2a, 0}, /* BS */ /* Keyboard Delete (Backspace) */ - {0x2b, 0}, /* TAB */ /* Keyboard Tab */ - {0x28, 0}, /* LF */ /* Keyboard Return (Enter) */ - {0, 0}, /* VT */ - {0, 0}, /* FF */ - {0, 0}, /* CR */ - {0, 0}, /* SO */ - {0, 0}, /* SI */ - {0, 0}, /* DEL */ - {0, 0}, /* DC1 */ - {0, 0}, /* DC2 */ - {0, 0}, /* DC3 */ - {0, 0}, /* DC4 */ - {0, 0}, /* NAK */ - {0, 0}, /* SYN */ - {0, 0}, /* ETB */ - {0, 0}, /* CAN */ - {0, 0}, /* EM */ - {0, 0}, /* SUB */ - {0, 0}, /* ESC */ - {0, 0}, /* FS */ - {0, 0}, /* GS */ - {0, 0}, /* RS */ - {0, 0}, /* US */ - {0x2c, 0}, /* */ - {0x1e, KEY_SHIFT}, /* ! */ - {0x34, KEY_SHIFT}, /* " */ - {0x20, KEY_SHIFT}, /* # */ - {0x21, KEY_SHIFT}, /* $ */ - {0x22, KEY_SHIFT}, /* % */ - {0x24, KEY_SHIFT}, /* & */ - {0x34, 0}, /* ' */ - {0x26, KEY_SHIFT}, /* ( */ - {0x27, KEY_SHIFT}, /* ) */ - {0x25, KEY_SHIFT}, /* * */ - {0x2e, KEY_SHIFT}, /* + */ - {0x36, 0}, /* , */ - {0x2d, 0}, /* - */ - {0x37, 0}, /* . */ - {0x38, 0}, /* / */ - {0x27, 0}, /* 0 */ - {0x1e, 0}, /* 1 */ - {0x1f, 0}, /* 2 */ - {0x20, 0}, /* 3 */ - {0x21, 0}, /* 4 */ - {0x22, 0}, /* 5 */ - {0x23, 0}, /* 6 */ - {0x24, 0}, /* 7 */ - {0x25, 0}, /* 8 */ - {0x26, 0}, /* 9 */ - {0x33, KEY_SHIFT}, /* : */ - {0x33, 0}, /* ; */ - {0x36, KEY_SHIFT}, /* < */ - {0x2e, 0}, /* = */ - {0x37, KEY_SHIFT}, /* > */ - {0x38, KEY_SHIFT}, /* ? */ - {0x1f, KEY_SHIFT}, /* @ */ - {0x04, KEY_SHIFT}, /* A */ - {0x05, KEY_SHIFT}, /* B */ - {0x06, KEY_SHIFT}, /* C */ - {0x07, KEY_SHIFT}, /* D */ - {0x08, KEY_SHIFT}, /* E */ - {0x09, KEY_SHIFT}, /* F */ - {0x0a, KEY_SHIFT}, /* G */ - {0x0b, KEY_SHIFT}, /* H */ - {0x0c, KEY_SHIFT}, /* I */ - {0x0d, KEY_SHIFT}, /* J */ - {0x0e, KEY_SHIFT}, /* K */ - {0x0f, KEY_SHIFT}, /* L */ - {0x10, KEY_SHIFT}, /* M */ - {0x11, KEY_SHIFT}, /* N */ - {0x12, KEY_SHIFT}, /* O */ - {0x13, KEY_SHIFT}, /* P */ - {0x14, KEY_SHIFT}, /* Q */ - {0x15, KEY_SHIFT}, /* R */ - {0x16, KEY_SHIFT}, /* S */ - {0x17, KEY_SHIFT}, /* T */ - {0x18, KEY_SHIFT}, /* U */ - {0x19, KEY_SHIFT}, /* V */ - {0x1a, KEY_SHIFT}, /* W */ - {0x1b, KEY_SHIFT}, /* X */ - {0x1c, KEY_SHIFT}, /* Y */ - {0x1d, KEY_SHIFT}, /* Z */ - {0x2f, 0}, /* [ */ - {0x31, 0}, /* \ */ - {0x30, 0}, /* ] */ - {0x23, KEY_SHIFT}, /* ^ */ - {0x2d, KEY_SHIFT}, /* _ */ - {0x35, 0}, /* ` */ - {0x04, 0}, /* a */ - {0x05, 0}, /* b */ - {0x06, 0}, /* c */ - {0x07, 0}, /* d */ - {0x08, 0}, /* e */ - {0x09, 0}, /* f */ - {0x0a, 0}, /* g */ - {0x0b, 0}, /* h */ - {0x0c, 0}, /* i */ - {0x0d, 0}, /* j */ - {0x0e, 0}, /* k */ - {0x0f, 0}, /* l */ - {0x10, 0}, /* m */ - {0x11, 0}, /* n */ - {0x12, 0}, /* o */ - {0x13, 0}, /* p */ - {0x14, 0}, /* q */ - {0x15, 0}, /* r */ - {0x16, 0}, /* s */ - {0x17, 0}, /* t */ - {0x18, 0}, /* u */ - {0x19, 0}, /* v */ - {0x1a, 0}, /* w */ - {0x1b, 0}, /* x */ - {0x1c, 0}, /* y */ - {0x1d, 0}, /* z */ - {0x2f, KEY_SHIFT}, /* { */ - {0x31, KEY_SHIFT}, /* | */ - {0x30, KEY_SHIFT}, /* } */ - {0x35, KEY_SHIFT}, /* ~ */ - {0,0}, /* DEL */ - - {0x3a, 0}, /* F1 */ - {0x3b, 0}, /* F2 */ - {0x3c, 0}, /* F3 */ - {0x3d, 0}, /* F4 */ - {0x3e, 0}, /* F5 */ - {0x3f, 0}, /* F6 */ - {0x40, 0}, /* F7 */ - {0x41, 0}, /* F8 */ - {0x42, 0}, /* F9 */ - {0x43, 0}, /* F10 */ - {0x44, 0}, /* F11 */ - {0x45, 0}, /* F12 */ - - {0x46, 0}, /* PRINT_SCREEN */ - {0x47, 0}, /* SCROLL_LOCK */ - {0x39, 0}, /* CAPS_LOCK */ - {0x53, 0}, /* NUM_LOCK */ - {0x49, 0}, /* INSERT */ - {0x4a, 0}, /* HOME */ - {0x4b, 0}, /* PAGE_UP */ - {0x4e, 0}, /* PAGE_DOWN */ - - {0x4f, 0}, /* RIGHT_ARROW */ - {0x50, 0}, /* LEFT_ARROW */ - {0x51, 0}, /* DOWN_ARROW */ - {0x52, 0}, /* UP_ARROW */ -}; - -#else -/* UK keyboard */ -#define KEYMAP_SIZE (152) -const KEYMAP keymap[KEYMAP_SIZE] = { - {0, 0}, /* NUL */ - {0, 0}, /* SOH */ - {0, 0}, /* STX */ - {0, 0}, /* ETX */ - {0, 0}, /* EOT */ - {0, 0}, /* ENQ */ - {0, 0}, /* ACK */ - {0, 0}, /* BEL */ - {0x2a, 0}, /* BS */ /* Keyboard Delete (Backspace) */ - {0x2b, 0}, /* TAB */ /* Keyboard Tab */ - {0x28, 0}, /* LF */ /* Keyboard Return (Enter) */ - {0, 0}, /* VT */ - {0, 0}, /* FF */ - {0, 0}, /* CR */ - {0, 0}, /* SO */ - {0, 0}, /* SI */ - {0, 0}, /* DEL */ - {0, 0}, /* DC1 */ - {0, 0}, /* DC2 */ - {0, 0}, /* DC3 */ - {0, 0}, /* DC4 */ - {0, 0}, /* NAK */ - {0, 0}, /* SYN */ - {0, 0}, /* ETB */ - {0, 0}, /* CAN */ - {0, 0}, /* EM */ - {0, 0}, /* SUB */ - {0, 0}, /* ESC */ - {0, 0}, /* FS */ - {0, 0}, /* GS */ - {0, 0}, /* RS */ - {0, 0}, /* US */ - {0x2c, 0}, /* */ - {0x1e, KEY_SHIFT}, /* ! */ - {0x1f, KEY_SHIFT}, /* " */ - {0x32, 0}, /* # */ - {0x21, KEY_SHIFT}, /* $ */ - {0x22, KEY_SHIFT}, /* % */ - {0x24, KEY_SHIFT}, /* & */ - {0x34, 0}, /* ' */ - {0x26, KEY_SHIFT}, /* ( */ - {0x27, KEY_SHIFT}, /* ) */ - {0x25, KEY_SHIFT}, /* * */ - {0x2e, KEY_SHIFT}, /* + */ - {0x36, 0}, /* , */ - {0x2d, 0}, /* - */ - {0x37, 0}, /* . */ - {0x38, 0}, /* / */ - {0x27, 0}, /* 0 */ - {0x1e, 0}, /* 1 */ - {0x1f, 0}, /* 2 */ - {0x20, 0}, /* 3 */ - {0x21, 0}, /* 4 */ - {0x22, 0}, /* 5 */ - {0x23, 0}, /* 6 */ - {0x24, 0}, /* 7 */ - {0x25, 0}, /* 8 */ - {0x26, 0}, /* 9 */ - {0x33, KEY_SHIFT}, /* : */ - {0x33, 0}, /* ; */ - {0x36, KEY_SHIFT}, /* < */ - {0x2e, 0}, /* = */ - {0x37, KEY_SHIFT}, /* > */ - {0x38, KEY_SHIFT}, /* ? */ - {0x34, KEY_SHIFT}, /* @ */ - {0x04, KEY_SHIFT}, /* A */ - {0x05, KEY_SHIFT}, /* B */ - {0x06, KEY_SHIFT}, /* C */ - {0x07, KEY_SHIFT}, /* D */ - {0x08, KEY_SHIFT}, /* E */ - {0x09, KEY_SHIFT}, /* F */ - {0x0a, KEY_SHIFT}, /* G */ - {0x0b, KEY_SHIFT}, /* H */ - {0x0c, KEY_SHIFT}, /* I */ - {0x0d, KEY_SHIFT}, /* J */ - {0x0e, KEY_SHIFT}, /* K */ - {0x0f, KEY_SHIFT}, /* L */ - {0x10, KEY_SHIFT}, /* M */ - {0x11, KEY_SHIFT}, /* N */ - {0x12, KEY_SHIFT}, /* O */ - {0x13, KEY_SHIFT}, /* P */ - {0x14, KEY_SHIFT}, /* Q */ - {0x15, KEY_SHIFT}, /* R */ - {0x16, KEY_SHIFT}, /* S */ - {0x17, KEY_SHIFT}, /* T */ - {0x18, KEY_SHIFT}, /* U */ - {0x19, KEY_SHIFT}, /* V */ - {0x1a, KEY_SHIFT}, /* W */ - {0x1b, KEY_SHIFT}, /* X */ - {0x1c, KEY_SHIFT}, /* Y */ - {0x1d, KEY_SHIFT}, /* Z */ - {0x2f, 0}, /* [ */ - {0x64, 0}, /* \ */ - {0x30, 0}, /* ] */ - {0x23, KEY_SHIFT}, /* ^ */ - {0x2d, KEY_SHIFT}, /* _ */ - {0x35, 0}, /* ` */ - {0x04, 0}, /* a */ - {0x05, 0}, /* b */ - {0x06, 0}, /* c */ - {0x07, 0}, /* d */ - {0x08, 0}, /* e */ - {0x09, 0}, /* f */ - {0x0a, 0}, /* g */ - {0x0b, 0}, /* h */ - {0x0c, 0}, /* i */ - {0x0d, 0}, /* j */ - {0x0e, 0}, /* k */ - {0x0f, 0}, /* l */ - {0x10, 0}, /* m */ - {0x11, 0}, /* n */ - {0x12, 0}, /* o */ - {0x13, 0}, /* p */ - {0x14, 0}, /* q */ - {0x15, 0}, /* r */ - {0x16, 0}, /* s */ - {0x17, 0}, /* t */ - {0x18, 0}, /* u */ - {0x19, 0}, /* v */ - {0x1a, 0}, /* w */ - {0x1b, 0}, /* x */ - {0x1c, 0}, /* y */ - {0x1d, 0}, /* z */ - {0x2f, KEY_SHIFT}, /* { */ - {0x64, KEY_SHIFT}, /* | */ - {0x30, KEY_SHIFT}, /* } */ - {0x32, KEY_SHIFT}, /* ~ */ - {0,0}, /* DEL */ - - {0x3a, 0}, /* F1 */ - {0x3b, 0}, /* F2 */ - {0x3c, 0}, /* F3 */ - {0x3d, 0}, /* F4 */ - {0x3e, 0}, /* F5 */ - {0x3f, 0}, /* F6 */ - {0x40, 0}, /* F7 */ - {0x41, 0}, /* F8 */ - {0x42, 0}, /* F9 */ - {0x43, 0}, /* F10 */ - {0x44, 0}, /* F11 */ - {0x45, 0}, /* F12 */ - - {0x46, 0}, /* PRINT_SCREEN */ - {0x47, 0}, /* SCROLL_LOCK */ - {0x39, 0}, /* CAPS_LOCK */ - {0x53, 0}, /* NUM_LOCK */ - {0x49, 0}, /* INSERT */ - {0x4a, 0}, /* HOME */ - {0x4b, 0}, /* PAGE_UP */ - {0x4e, 0}, /* PAGE_DOWN */ - - {0x4f, 0}, /* RIGHT_ARROW */ - {0x50, 0}, /* LEFT_ARROW */ - {0x51, 0}, /* DOWN_ARROW */ - {0x52, 0}, /* UP_ARROW */ -}; -#endif - -#endif diff --git a/libraries/BLE/src/HIDTypes.h b/libraries/BLE/src/HIDTypes.h deleted file mode 100644 index 64850ef8a75..00000000000 --- a/libraries/BLE/src/HIDTypes.h +++ /dev/null @@ -1,96 +0,0 @@ -/* Copyright (c) 2010-2011 mbed.org, MIT License -* -* 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. -*/ - -#ifndef USBCLASS_HID_TYPES -#define USBCLASS_HID_TYPES - -#include - -/* */ -#define HID_VERSION_1_11 (0x0111) - -/* HID Class */ -#define HID_CLASS (3) -#define HID_SUBCLASS_NONE (0) -#define HID_PROTOCOL_NONE (0) - -/* Descriptors */ -#define HID_DESCRIPTOR (33) -#define HID_DESCRIPTOR_LENGTH (0x09) -#define REPORT_DESCRIPTOR (34) - -/* Class requests */ -#define GET_REPORT (0x1) -#define GET_IDLE (0x2) -#define SET_REPORT (0x9) -#define SET_IDLE (0xa) - -/* HID Class Report Descriptor */ -/* Short items: size is 0, 1, 2 or 3 specifying 0, 1, 2 or 4 (four) bytes */ -/* of data as per HID Class standard */ - -/* Main items */ -#ifdef ARDUINO_ARCH_ESP32 -#define HIDINPUT(size) (0x80 | size) -#define HIDOUTPUT(size) (0x90 | size) -#else -#define INPUT(size) (0x80 | size) -#define OUTPUT(size) (0x90 | size) -#endif -#define FEATURE(size) (0xb0 | size) -#define COLLECTION(size) (0xa0 | size) -#define END_COLLECTION(size) (0xc0 | size) - -/* Global items */ -#define USAGE_PAGE(size) (0x04 | size) -#define LOGICAL_MINIMUM(size) (0x14 | size) -#define LOGICAL_MAXIMUM(size) (0x24 | size) -#define PHYSICAL_MINIMUM(size) (0x34 | size) -#define PHYSICAL_MAXIMUM(size) (0x44 | size) -#define UNIT_EXPONENT(size) (0x54 | size) -#define UNIT(size) (0x64 | size) -#define REPORT_SIZE(size) (0x74 | size) //bits -#define REPORT_ID(size) (0x84 | size) -#define REPORT_COUNT(size) (0x94 | size) //bytes -#define PUSH(size) (0xa4 | size) -#define POP(size) (0xb4 | size) - -/* Local items */ -#define USAGE(size) (0x08 | size) -#define USAGE_MINIMUM(size) (0x18 | size) -#define USAGE_MAXIMUM(size) (0x28 | size) -#define DESIGNATOR_INDEX(size) (0x38 | size) -#define DESIGNATOR_MINIMUM(size) (0x48 | size) -#define DESIGNATOR_MAXIMUM(size) (0x58 | size) -#define STRING_INDEX(size) (0x78 | size) -#define STRING_MINIMUM(size) (0x88 | size) -#define STRING_MAXIMUM(size) (0x98 | size) -#define DELIMITER(size) (0xa8 | size) - -/* HID Report */ -/* Where report IDs are used the first byte of 'data' will be the */ -/* report ID and 'length' will include this report ID byte. */ - -#define MAX_HID_REPORT_SIZE (64) - -typedef struct { - uint32_t length; - uint8_t data[MAX_HID_REPORT_SIZE]; -} HID_REPORT; - -#endif diff --git a/libraries/BluetoothSerial/README.md b/libraries/BluetoothSerial/README.md deleted file mode 100644 index 9d25dbca0a9..00000000000 --- a/libraries/BluetoothSerial/README.md +++ /dev/null @@ -1,19 +0,0 @@ -### Bluetooth Serial Library - -A simple Serial compatible library using ESP32 classical bluetooth (SPP) - - - -#### How to use it? - -- Download one bluetooth terminal app in your smartphone
-For Android: https://play.google.com/store/apps/details?id=de.kai_morich.serial_bluetooth_terminal
-For iOS: https://itunes.apple.com/us/app/hm10-bluetooth-serial-lite/id1030454675 - -- Flash an example sketch to your ESP32 - -- Scan and pair the device in your smartphone - -- Open the bluetooth terminal app - -- Enjoy diff --git a/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino b/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino deleted file mode 100644 index 9a5fa0877bc..00000000000 --- a/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino +++ /dev/null @@ -1,29 +0,0 @@ -//This example code is in the Public Domain (or CC0 licensed, at your option.) -//By Evandro Copercini - 2018 -// -//This example creates a bridge between Serial and Classical Bluetooth (SPP) -//and also demonstrate that SerialBT have the same functionalities of a normal Serial - -#include "BluetoothSerial.h" - -#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED) -#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it -#endif - -BluetoothSerial SerialBT; - -void setup() { - Serial.begin(115200); - SerialBT.begin("ESP32test"); //Bluetooth device name - Serial.println("The device started, now you can pair it with bluetooth!"); -} - -void loop() { - if (Serial.available()) { - SerialBT.write(Serial.read()); - } - if (SerialBT.available()) { - Serial.write(SerialBT.read()); - } - delay(20); -} \ No newline at end of file diff --git a/libraries/BluetoothSerial/keywords.txt b/libraries/BluetoothSerial/keywords.txt deleted file mode 100644 index 563e35d7933..00000000000 --- a/libraries/BluetoothSerial/keywords.txt +++ /dev/null @@ -1,26 +0,0 @@ -####################################### -# Syntax Coloring Map For BluetoothSerial -####################################### - -####################################### -# Library (KEYWORD3) -####################################### - -BluetoothSerial KEYWORD3 - -####################################### -# Datatypes (KEYWORD1) -####################################### - -BluetoothSerial KEYWORD1 - -####################################### -# Methods and Functions (KEYWORD2) -####################################### - -SerialBT KEYWORD2 -hasClient KEYWORD2 - -####################################### -# Constants (LITERAL1) -####################################### diff --git a/libraries/BluetoothSerial/library.properties b/libraries/BluetoothSerial/library.properties deleted file mode 100644 index 20adb66c796..00000000000 --- a/libraries/BluetoothSerial/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=BluetoothSerial -version=1.0 -author=Evandro Copercini -maintainer=Evandro Copercini -sentence=Simple UART to Classical Bluetooth bridge for ESP32 -paragraph= -category=Communication -url= -architectures=esp32 diff --git a/libraries/BluetoothSerial/src/BluetoothSerial.cpp b/libraries/BluetoothSerial/src/BluetoothSerial.cpp deleted file mode 100644 index d3d09216303..00000000000 --- a/libraries/BluetoothSerial/src/BluetoothSerial.cpp +++ /dev/null @@ -1,448 +0,0 @@ -// Copyright 2018 Evandro Luis Copercini -// -// 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. - -#include "sdkconfig.h" -#include -#include -#include -#include -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" - - -#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) - -#ifdef ARDUINO_ARCH_ESP32 -#include "esp32-hal-log.h" -#endif - -#include "BluetoothSerial.h" - -#include "esp_bt.h" -#include "esp_bt_main.h" -#include "esp_gap_bt_api.h" -#include "esp_bt_device.h" -#include "esp_spp_api.h" -#include - -#ifdef ARDUINO_ARCH_ESP32 -#include "esp32-hal-log.h" -#endif - -const char * _spp_server_name = "ESP32SPP"; - -#define RX_QUEUE_SIZE 512 -#define TX_QUEUE_SIZE 32 -static uint32_t _spp_client = 0; -static xQueueHandle _spp_rx_queue = NULL; -static xQueueHandle _spp_tx_queue = NULL; -static SemaphoreHandle_t _spp_tx_done = NULL; -static TaskHandle_t _spp_task_handle = NULL; -static EventGroupHandle_t _spp_event_group = NULL; -static boolean secondConnectionAttempt; -static esp_spp_cb_t * custom_spp_callback = NULL; - -#define SPP_RUNNING 0x01 -#define SPP_CONNECTED 0x02 -#define SPP_CONGESTED 0x04 - -typedef struct { - size_t len; - uint8_t data[]; -} spp_packet_t; - -static esp_err_t _spp_queue_packet(uint8_t *data, size_t len){ - if(!data || !len){ - log_w("No data provided"); - return ESP_OK; - } - spp_packet_t * packet = (spp_packet_t*)malloc(sizeof(spp_packet_t) + len); - if(!packet){ - log_e("SPP TX Packet Malloc Failed!"); - return ESP_FAIL; - } - packet->len = len; - memcpy(packet->data, data, len); - if (xQueueSend(_spp_tx_queue, &packet, portMAX_DELAY) != pdPASS) { - log_e("SPP TX Queue Send Failed!"); - free(packet); - return ESP_FAIL; - } - return ESP_OK; -} - -const uint16_t SPP_TX_MAX = 330; -static uint8_t _spp_tx_buffer[SPP_TX_MAX]; -static uint16_t _spp_tx_buffer_len = 0; - -static bool _spp_send_buffer(){ - if((xEventGroupWaitBits(_spp_event_group, SPP_CONGESTED, pdFALSE, pdTRUE, portMAX_DELAY) & SPP_CONGESTED)){ - esp_err_t err = esp_spp_write(_spp_client, _spp_tx_buffer_len, _spp_tx_buffer); - if(err != ESP_OK){ - log_e("SPP Write Failed! [0x%X]", err); - return false; - } - _spp_tx_buffer_len = 0; - if(xSemaphoreTake(_spp_tx_done, portMAX_DELAY) != pdTRUE){ - log_e("SPP Ack Failed!"); - return false; - } - return true; - } - return false; -} - -static void _spp_tx_task(void * arg){ - spp_packet_t *packet = NULL; - size_t len = 0, to_send = 0; - uint8_t * data = NULL; - for (;;) { - if(_spp_tx_queue && xQueueReceive(_spp_tx_queue, &packet, portMAX_DELAY) == pdTRUE && packet){ - if(packet->len <= (SPP_TX_MAX - _spp_tx_buffer_len)){ - memcpy(_spp_tx_buffer+_spp_tx_buffer_len, packet->data, packet->len); - _spp_tx_buffer_len+=packet->len; - free(packet); - packet = NULL; - if(SPP_TX_MAX == _spp_tx_buffer_len || uxQueueMessagesWaiting(_spp_tx_queue) == 0){ - _spp_send_buffer(); - } - } else { - len = packet->len; - data = packet->data; - to_send = SPP_TX_MAX - _spp_tx_buffer_len; - memcpy(_spp_tx_buffer+_spp_tx_buffer_len, data, to_send); - _spp_tx_buffer_len = SPP_TX_MAX; - data += to_send; - len -= to_send; - _spp_send_buffer(); - while(len >= SPP_TX_MAX){ - memcpy(_spp_tx_buffer, data, SPP_TX_MAX); - _spp_tx_buffer_len = SPP_TX_MAX; - data += SPP_TX_MAX; - len -= SPP_TX_MAX; - _spp_send_buffer(); - } - if(len){ - memcpy(_spp_tx_buffer, data, len); - _spp_tx_buffer_len += len; - if(uxQueueMessagesWaiting(_spp_tx_queue) == 0){ - _spp_send_buffer(); - } - } - free(packet); - packet = NULL; - } - } else { - log_e("Something went horribly wrong"); - } - } - vTaskDelete(NULL); - _spp_task_handle = NULL; -} - - -static void esp_spp_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t *param) -{ - switch (event) - { - case ESP_SPP_INIT_EVT: - log_i("ESP_SPP_INIT_EVT"); - esp_bt_gap_set_scan_mode(ESP_BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE); - esp_spp_start_srv(ESP_SPP_SEC_NONE, ESP_SPP_ROLE_SLAVE, 0, _spp_server_name); - xEventGroupSetBits(_spp_event_group, SPP_RUNNING); - break; - - case ESP_SPP_SRV_OPEN_EVT://Server connection open - if (!_spp_client){ - _spp_client = param->open.handle; - } else { - secondConnectionAttempt = true; - esp_spp_disconnect(param->open.handle); - } - xEventGroupSetBits(_spp_event_group, SPP_CONNECTED); - log_i("ESP_SPP_SRV_OPEN_EVT"); - break; - - case ESP_SPP_CLOSE_EVT://Client connection closed - if(secondConnectionAttempt) { - secondConnectionAttempt = false; - } else { - _spp_client = 0; - } - xEventGroupClearBits(_spp_event_group, SPP_CONNECTED); - log_i("ESP_SPP_CLOSE_EVT"); - break; - - case ESP_SPP_CONG_EVT://connection congestion status changed - if(param->cong.cong){ - xEventGroupClearBits(_spp_event_group, SPP_CONGESTED); - } else { - xEventGroupSetBits(_spp_event_group, SPP_CONGESTED); - } - log_v("ESP_SPP_CONG_EVT: %s", param->cong.cong?"CONGESTED":"FREE"); - break; - - case ESP_SPP_WRITE_EVT://write operation completed - if(param->write.cong){ - xEventGroupClearBits(_spp_event_group, SPP_CONGESTED); - } - xSemaphoreGive(_spp_tx_done);//we can try to send another packet - log_v("ESP_SPP_WRITE_EVT: %u %s", param->write.len, param->write.cong?"CONGESTED":"FREE"); - break; - - case ESP_SPP_DATA_IND_EVT://connection received data - log_v("ESP_SPP_DATA_IND_EVT len=%d handle=%d", param->data_ind.len, param->data_ind.handle); - //esp_log_buffer_hex("",param->data_ind.data,param->data_ind.len); //for low level debug - //ets_printf("r:%u\n", param->data_ind.len); - - if (_spp_rx_queue != NULL){ - for (int i = 0; i < param->data_ind.len; i++){ - if(xQueueSend(_spp_rx_queue, param->data_ind.data + i, (TickType_t)0) != pdTRUE){ - log_e("RX Full! Discarding %u bytes", param->data_ind.len - i); - break; - } - } - } - break; - - //should maybe delete those. - case ESP_SPP_DISCOVERY_COMP_EVT://discovery complete - log_i("ESP_SPP_DISCOVERY_COMP_EVT"); - break; - case ESP_SPP_OPEN_EVT://Client connection open - log_i("ESP_SPP_OPEN_EVT"); - break; - case ESP_SPP_START_EVT://server started - log_i("ESP_SPP_START_EVT"); - break; - case ESP_SPP_CL_INIT_EVT://client initiated a connection - log_i("ESP_SPP_CL_INIT_EVT"); - break; - default: - break; - } - if(custom_spp_callback)(*custom_spp_callback)(event, param); -} - -static bool _init_bt(const char *deviceName) -{ - if(!_spp_event_group){ - _spp_event_group = xEventGroupCreate(); - if(!_spp_event_group){ - log_e("SPP Event Group Create Failed!"); - return false; - } - xEventGroupClearBits(_spp_event_group, 0xFFFFFF); - xEventGroupSetBits(_spp_event_group, SPP_CONGESTED); - } - if (_spp_rx_queue == NULL){ - _spp_rx_queue = xQueueCreate(RX_QUEUE_SIZE, sizeof(uint8_t)); //initialize the queue - if (_spp_rx_queue == NULL){ - log_e("RX Queue Create Failed"); - return false; - } - } - if (_spp_tx_queue == NULL){ - _spp_tx_queue = xQueueCreate(TX_QUEUE_SIZE, sizeof(spp_packet_t*)); //initialize the queue - if (_spp_tx_queue == NULL){ - log_e("TX Queue Create Failed"); - return false; - } - } - if(_spp_tx_done == NULL){ - _spp_tx_done = xSemaphoreCreateBinary(); - if (_spp_tx_done == NULL){ - log_e("TX Semaphore Create Failed"); - return false; - } - xSemaphoreTake(_spp_tx_done, 0); - } - - if(!_spp_task_handle){ - xTaskCreate(_spp_tx_task, "spp_tx", 4096, NULL, 2, &_spp_task_handle); - if(!_spp_task_handle){ - log_e("Network Event Task Start Failed!"); - return false; - } - } - - if (!btStarted() && !btStart()){ - log_e("initialize controller failed"); - return false; - } - - esp_bluedroid_status_t bt_state = esp_bluedroid_get_status(); - if (bt_state == ESP_BLUEDROID_STATUS_UNINITIALIZED){ - if (esp_bluedroid_init()) { - log_e("initialize bluedroid failed"); - return false; - } - } - - if (bt_state != ESP_BLUEDROID_STATUS_ENABLED){ - if (esp_bluedroid_enable()) { - log_e("enable bluedroid failed"); - return false; - } - } - - if (esp_spp_register_callback(esp_spp_cb) != ESP_OK){ - log_e("spp register failed"); - return false; - } - - if (esp_spp_init(ESP_SPP_MODE_CB) != ESP_OK){ - log_e("spp init failed"); - return false; - } - - esp_bt_dev_set_device_name(deviceName); - - // the default BTA_DM_COD_LOUDSPEAKER does not work with the macOS BT stack - esp_bt_cod_t cod; - cod.major = 0b00001; - cod.minor = 0b000100; - cod.service = 0b00000010110; - if (esp_bt_gap_set_cod(cod, ESP_BT_INIT_COD) != ESP_OK) { - log_e("set cod failed"); - return false; - } - - return true; -} - -static bool _stop_bt() -{ - if (btStarted()){ - if(_spp_client) - esp_spp_disconnect(_spp_client); - esp_spp_deinit(); - esp_bluedroid_disable(); - esp_bluedroid_deinit(); - btStop(); - } - _spp_client = 0; - if(_spp_task_handle){ - vTaskDelete(_spp_task_handle); - _spp_task_handle = NULL; - } - if(_spp_event_group){ - vEventGroupDelete(_spp_event_group); - _spp_event_group = NULL; - } - if(_spp_rx_queue){ - vQueueDelete(_spp_rx_queue); - //ToDo: clear RX queue when in packet mode - _spp_rx_queue = NULL; - } - if(_spp_tx_queue){ - spp_packet_t *packet = NULL; - while(xQueueReceive(_spp_tx_queue, &packet, 0) == pdTRUE){ - free(packet); - } - vQueueDelete(_spp_tx_queue); - _spp_tx_queue = NULL; - } - if (_spp_tx_done) { - vSemaphoreDelete(_spp_tx_done); - _spp_tx_done = NULL; - } - return true; -} - -/* - * Serial Bluetooth Arduino - * - * */ - -BluetoothSerial::BluetoothSerial() -{ - local_name = "ESP32"; //default bluetooth name -} - -BluetoothSerial::~BluetoothSerial(void) -{ - _stop_bt(); -} - -bool BluetoothSerial::begin(String localName) -{ - if (localName.length()){ - local_name = localName; - } - return _init_bt(local_name.c_str()); -} - -int BluetoothSerial::available(void) -{ - if (_spp_rx_queue == NULL){ - return 0; - } - return uxQueueMessagesWaiting(_spp_rx_queue); -} - -int BluetoothSerial::peek(void) -{ - uint8_t c; - if (_spp_rx_queue && xQueuePeek(_spp_rx_queue, &c, 0)){ - return c; - } - return -1; -} - -bool BluetoothSerial::hasClient(void) -{ - return _spp_client > 0; -} - -int BluetoothSerial::read(void) -{ - - uint8_t c = 0; - if (_spp_rx_queue && xQueueReceive(_spp_rx_queue, &c, 0)){ - return c; - } - return -1; -} - -size_t BluetoothSerial::write(uint8_t c) -{ - return write(&c, 1); -} - -size_t BluetoothSerial::write(const uint8_t *buffer, size_t size) -{ - if (!_spp_client){ - return 0; - } - return (_spp_queue_packet((uint8_t *)buffer, size) == ESP_OK) ? size : 0; -} - -void BluetoothSerial::flush() -{ - while(read() >= 0){} -} - -void BluetoothSerial::end() -{ - _stop_bt(); -} - -esp_err_t BluetoothSerial::register_callback(esp_spp_cb_t * callback) -{ - custom_spp_callback = callback; - return ESP_OK; -} - -#endif diff --git a/libraries/BluetoothSerial/src/BluetoothSerial.h b/libraries/BluetoothSerial/src/BluetoothSerial.h deleted file mode 100644 index 3f4372e55d2..00000000000 --- a/libraries/BluetoothSerial/src/BluetoothSerial.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2018 Evandro Luis Copercini -// -// 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. - -#ifndef _BLUETOOTH_SERIAL_H_ -#define _BLUETOOTH_SERIAL_H_ - -#include "sdkconfig.h" - -#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) - -#include "Arduino.h" -#include "Stream.h" -#include - -class BluetoothSerial: public Stream -{ - public: - - BluetoothSerial(void); - ~BluetoothSerial(void); - - bool begin(String localName=String()); - int available(void); - int peek(void); - bool hasClient(void); - int read(void); - size_t write(uint8_t c); - size_t write(const uint8_t *buffer, size_t size); - void flush(); - void end(void); - esp_err_t register_callback(esp_spp_cb_t * callback); - - private: - String local_name; - -}; - -#endif - -#endif diff --git a/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino b/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino deleted file mode 100644 index ceab0da984f..00000000000 --- a/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino +++ /dev/null @@ -1,52 +0,0 @@ -#include -#include - -const byte DNS_PORT = 53; -IPAddress apIP(192, 168, 1, 1); -DNSServer dnsServer; -WiFiServer server(80); - -String responseHTML = "" - "CaptivePortal" - "

Hello World!

This is a captive portal example. All requests will " - "be redirected here.

"; - -void setup() { - WiFi.mode(WIFI_AP); - WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0)); - WiFi.softAP("DNSServer CaptivePortal example"); - - // if DNSServer is started with "*" for domain name, it will reply with - // provided IP to all DNS request - dnsServer.start(DNS_PORT, "*", apIP); - - server.begin(); -} - -void loop() { - dnsServer.processNextRequest(); - WiFiClient client = server.available(); // listen for incoming clients - - if (client) { - String currentLine = ""; - while (client.connected()) { - if (client.available()) { - char c = client.read(); - if (c == '\n') { - if (currentLine.length() == 0) { - client.println("HTTP/1.1 200 OK"); - client.println("Content-type:text/html"); - client.println(); - client.print(responseHTML); - break; - } else { - currentLine = ""; - } - } else if (c != '\r') { - currentLine += c; - } - } - } - client.stop(); - } -} diff --git a/libraries/DNSServer/library.properties b/libraries/DNSServer/library.properties deleted file mode 100644 index 8da8e6b3300..00000000000 --- a/libraries/DNSServer/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=DNSServer -version=1.1.0 -author=Kristijan Novoselić -maintainer=Kristijan Novoselić, -sentence=A simple DNS server for ESP32. -paragraph=This library implements a simple DNS server. -category=Communication -url= -architectures=esp32 diff --git a/libraries/DNSServer/src/DNSServer.cpp b/libraries/DNSServer/src/DNSServer.cpp deleted file mode 100644 index eafa97cfdf9..00000000000 --- a/libraries/DNSServer/src/DNSServer.cpp +++ /dev/null @@ -1,199 +0,0 @@ -#include "DNSServer.h" -#include -#include - - -DNSServer::DNSServer() -{ - _ttl = htonl(DNS_DEFAULT_TTL); - _errorReplyCode = DNSReplyCode::NonExistentDomain; - _dnsHeader = (DNSHeader*) malloc( sizeof(DNSHeader) ) ; - _dnsQuestion = (DNSQuestion*) malloc( sizeof(DNSQuestion) ) ; - _buffer = NULL; - _currentPacketSize = 0; - _port = 0; -} - -bool DNSServer::start(const uint16_t &port, const String &domainName, - const IPAddress &resolvedIP) -{ - _port = port; - _buffer = NULL; - _domainName = domainName; - _resolvedIP[0] = resolvedIP[0]; - _resolvedIP[1] = resolvedIP[1]; - _resolvedIP[2] = resolvedIP[2]; - _resolvedIP[3] = resolvedIP[3]; - downcaseAndRemoveWwwPrefix(_domainName); - return _udp.begin(_port) == 1; -} - -void DNSServer::setErrorReplyCode(const DNSReplyCode &replyCode) -{ - _errorReplyCode = replyCode; -} - -void DNSServer::setTTL(const uint32_t &ttl) -{ - _ttl = htonl(ttl); -} - -void DNSServer::stop() -{ - _udp.stop(); - free(_buffer); - _buffer = NULL; -} - -void DNSServer::downcaseAndRemoveWwwPrefix(String &domainName) -{ - domainName.toLowerCase(); - domainName.replace("www.", ""); -} - -void DNSServer::processNextRequest() -{ - _currentPacketSize = _udp.parsePacket(); - if (_currentPacketSize) - { - // Allocate buffer for the DNS query - if (_buffer != NULL) - free(_buffer); - _buffer = (unsigned char*)malloc(_currentPacketSize * sizeof(char)); - if (_buffer == NULL) - return; - - // Put the packet received in the buffer and get DNS header (beginning of message) - // and the question - _udp.read(_buffer, _currentPacketSize); - memcpy( _dnsHeader, _buffer, DNS_HEADER_SIZE ) ; - if ( requestIncludesOnlyOneQuestion() ) - { - // The QName has a variable length, maximum 255 bytes and is comprised of multiple labels. - // Each label contains a byte to describe its length and the label itself. The list of - // labels terminates with a zero-valued byte. In "github.com", we have two labels "github" & "com" - // Iterate through the labels and copy them as they come into a single buffer (for simplicity's sake) - _dnsQuestion->QNameLength = 0 ; - while ( _buffer[ DNS_HEADER_SIZE + _dnsQuestion->QNameLength ] != 0 ) - { - memcpy( (void*) &_dnsQuestion->QName[_dnsQuestion->QNameLength], (void*) &_buffer[DNS_HEADER_SIZE + _dnsQuestion->QNameLength], _buffer[DNS_HEADER_SIZE + _dnsQuestion->QNameLength] + 1 ) ; - _dnsQuestion->QNameLength += _buffer[DNS_HEADER_SIZE + _dnsQuestion->QNameLength] + 1 ; - } - _dnsQuestion->QName[_dnsQuestion->QNameLength] = 0 ; - _dnsQuestion->QNameLength++ ; - - // Copy the QType and QClass - memcpy( &_dnsQuestion->QType, (void*) &_buffer[DNS_HEADER_SIZE + _dnsQuestion->QNameLength], sizeof(_dnsQuestion->QType) ) ; - memcpy( &_dnsQuestion->QClass, (void*) &_buffer[DNS_HEADER_SIZE + _dnsQuestion->QNameLength + sizeof(_dnsQuestion->QType)], sizeof(_dnsQuestion->QClass) ) ; - } - - - if (_dnsHeader->QR == DNS_QR_QUERY && - _dnsHeader->OPCode == DNS_OPCODE_QUERY && - requestIncludesOnlyOneQuestion() && - (_domainName == "*" || getDomainNameWithoutWwwPrefix() == _domainName) - ) - { - replyWithIP(); - } - else if (_dnsHeader->QR == DNS_QR_QUERY) - { - replyWithCustomCode(); - } - - free(_buffer); - _buffer = NULL; - } -} - -bool DNSServer::requestIncludesOnlyOneQuestion() -{ - return ntohs(_dnsHeader->QDCount) == 1 && - _dnsHeader->ANCount == 0 && - _dnsHeader->NSCount == 0 && - _dnsHeader->ARCount == 0; -} - - -String DNSServer::getDomainNameWithoutWwwPrefix() -{ - // Error checking : if the buffer containing the DNS request is a null pointer, return an empty domain - String parsedDomainName = ""; - if (_buffer == NULL) - return parsedDomainName; - - // Set the start of the domain just after the header (12 bytes). If equal to null character, return an empty domain - unsigned char *start = _buffer + DNS_OFFSET_DOMAIN_NAME; - if (*start == 0) - { - return parsedDomainName; - } - - int pos = 0; - while(true) - { - unsigned char labelLength = *(start + pos); - for(int i = 0; i < labelLength; i++) - { - pos++; - parsedDomainName += (char)*(start + pos); - } - pos++; - if (*(start + pos) == 0) - { - downcaseAndRemoveWwwPrefix(parsedDomainName); - return parsedDomainName; - } - else - { - parsedDomainName += "."; - } - } -} - -void DNSServer::replyWithIP() -{ - if (_buffer == NULL) return; - - _udp.beginPacket(_udp.remoteIP(), _udp.remotePort()); - - // Change the type of message to a response and set the number of answers equal to - // the number of questions in the header - _dnsHeader->QR = DNS_QR_RESPONSE; - _dnsHeader->ANCount = _dnsHeader->QDCount; - _udp.write( (unsigned char*) _dnsHeader, DNS_HEADER_SIZE ) ; - - // Write the question - _udp.write(_dnsQuestion->QName, _dnsQuestion->QNameLength) ; - _udp.write( (unsigned char*) &_dnsQuestion->QType, 2 ) ; - _udp.write( (unsigned char*) &_dnsQuestion->QClass, 2 ) ; - - // Write the answer - // Use DNS name compression : instead of repeating the name in this RNAME occurence, - // set the two MSB of the byte corresponding normally to the length to 1. The following - // 14 bits must be used to specify the offset of the domain name in the message - // (<255 here so the first byte has the 6 LSB at 0) - _udp.write((uint8_t) 0xC0); - _udp.write((uint8_t) DNS_OFFSET_DOMAIN_NAME); - - // DNS type A : host address, DNS class IN for INternet, returning an IPv4 address - uint16_t answerType = htons(DNS_TYPE_A), answerClass = htons(DNS_CLASS_IN), answerIPv4 = htons(DNS_RDLENGTH_IPV4) ; - _udp.write((unsigned char*) &answerType, 2 ); - _udp.write((unsigned char*) &answerClass, 2 ); - _udp.write((unsigned char*) &_ttl, 4); // DNS Time To Live - _udp.write((unsigned char*) &answerIPv4, 2 ); - _udp.write(_resolvedIP, sizeof(_resolvedIP)); // The IP address to return - _udp.endPacket(); -} - -void DNSServer::replyWithCustomCode() -{ - if (_buffer == NULL) return; - _dnsHeader->QR = DNS_QR_RESPONSE; - _dnsHeader->RCode = (unsigned char)_errorReplyCode; - _dnsHeader->QDCount = 0; - - _udp.beginPacket(_udp.remoteIP(), _udp.remotePort()); - _udp.write(_buffer, sizeof(DNSHeader)); - _udp.endPacket(); -} diff --git a/libraries/DNSServer/src/DNSServer.h b/libraries/DNSServer/src/DNSServer.h deleted file mode 100644 index a10ef9eaaf1..00000000000 --- a/libraries/DNSServer/src/DNSServer.h +++ /dev/null @@ -1,109 +0,0 @@ -#ifndef DNSServer_h -#define DNSServer_h -#include - -#define DNS_QR_QUERY 0 -#define DNS_QR_RESPONSE 1 -#define DNS_OPCODE_QUERY 0 -#define DNS_DEFAULT_TTL 60 // Default Time To Live : time interval in seconds that the resource record should be cached before being discarded -#define DNS_OFFSET_DOMAIN_NAME 12 // Offset in bytes to reach the domain name in the DNS message -#define DNS_HEADER_SIZE 12 - -enum class DNSReplyCode -{ - NoError = 0, - FormError = 1, - ServerFailure = 2, - NonExistentDomain = 3, - NotImplemented = 4, - Refused = 5, - YXDomain = 6, - YXRRSet = 7, - NXRRSet = 8 -}; - -enum DNSType -{ - DNS_TYPE_A = 1, // Host Address - DNS_TYPE_AAAA = 28, // IPv6 Address - DNS_TYPE_SOA = 6, // Start Of a zone of Authority - DNS_TYPE_PTR = 12, // Domain name PoinTeR - DNS_TYPE_DNAME = 39 // Delegation Name -} ; - -enum DNSClass -{ - DNS_CLASS_IN = 1, // INternet - DNS_CLASS_CH = 3 // CHaos -} ; - -enum DNSRDLength -{ - DNS_RDLENGTH_IPV4 = 4 // 4 bytes for an IPv4 address -} ; - -struct DNSHeader -{ - uint16_t ID; // identification number - union { - struct { - uint16_t RD : 1; // recursion desired - uint16_t TC : 1; // truncated message - uint16_t AA : 1; // authoritive answer - uint16_t OPCode : 4; // message_type - uint16_t QR : 1; // query/response flag - uint16_t RCode : 4; // response code - uint16_t Z : 3; // its z! reserved - uint16_t RA : 1; // recursion available - }; - uint16_t Flags; - }; - uint16_t QDCount; // number of question entries - uint16_t ANCount; // number of answer entries - uint16_t NSCount; // number of authority entries - uint16_t ARCount; // number of resource entries -}; - -struct DNSQuestion -{ - uint8_t QName[255] ; - int8_t QNameLength ; - uint16_t QType ; - uint16_t QClass ; -} ; - -class DNSServer -{ - public: - DNSServer(); - void processNextRequest(); - void setErrorReplyCode(const DNSReplyCode &replyCode); - void setTTL(const uint32_t &ttl); - - // Returns true if successful, false if there are no sockets available - bool start(const uint16_t &port, - const String &domainName, - const IPAddress &resolvedIP); - // stops the DNS server - void stop(); - - private: - WiFiUDP _udp; - uint16_t _port; - String _domainName; - unsigned char _resolvedIP[4]; - int _currentPacketSize; - unsigned char* _buffer; - DNSHeader* _dnsHeader; - uint32_t _ttl; - DNSReplyCode _errorReplyCode; - DNSQuestion* _dnsQuestion ; - - - void downcaseAndRemoveWwwPrefix(String &domainName); - String getDomainNameWithoutWwwPrefix(); - bool requestIncludesOnlyOneQuestion(); - void replyWithIP(); - void replyWithCustomCode(); -}; -#endif \ No newline at end of file diff --git a/libraries/EEPROM/README.md b/libraries/EEPROM/README.md deleted file mode 100644 index 896ca5b3019..00000000000 --- a/libraries/EEPROM/README.md +++ /dev/null @@ -1,4 +0,0 @@ -## EEPROM - -EEPROM is deprecated. For new applications on ESP32, use Preferences. EEPROM is provided for backwards compatibility with existing Arduino applications. -EEPROM is implemented using a single blob within NVS, so it is a container within a container. As such, it is not going to be a high performance storage method. Preferences will directly use nvs, and store each entry as a single object therein. diff --git a/libraries/EEPROM/examples/eeprom_class/eeprom_class.ino b/libraries/EEPROM/examples/eeprom_class/eeprom_class.ino deleted file mode 100644 index f5301f4ef1d..00000000000 --- a/libraries/EEPROM/examples/eeprom_class/eeprom_class.ino +++ /dev/null @@ -1,76 +0,0 @@ -/* - ESP32 eeprom_class example with EEPROM library - This simple example demonstrates using EEPROM library to store different data in - ESP32 Flash memory in a multiple user-defined EEPROM class objects. - - Created for arduino-esp32 on 25 Dec, 2017 - by Elochukwu Ifediora (fedy0) - converted to nvs by lbernstone - 06/22/2019 -*/ - -#include "EEPROM.h" - -// Instantiate eeprom objects with parameter/argument names and sizes -EEPROMClass NAMES("eeprom0", 0x500); -EEPROMClass HEIGHT("eeprom1", 0x200); -EEPROMClass AGE("eeprom2", 0x100); - -void setup() { - Serial.begin(115200); - Serial.println("Testing EEPROMClass\n"); - if (!NAMES.begin(NAMES.length())) { - Serial.println("Failed to initialise NAMES"); - Serial.println("Restarting..."); - delay(1000); - ESP.restart(); - } - if (!HEIGHT.begin(HEIGHT.length())) { - Serial.println("Failed to initialise HEIGHT"); - Serial.println("Restarting..."); - delay(1000); - ESP.restart(); - } - if (!AGE.begin(AGE.length())) { - Serial.println("Failed to initialise AGE"); - Serial.println("Restarting..."); - delay(1000); - ESP.restart(); - } - - const char* name = "Teo Swee Ann"; - char rname[32]; - double height = 5.8; - uint32_t age = 47; - - // Write: Variables ---> EEPROM stores - NAMES.put(0, name); - HEIGHT.put(0, height); - AGE.put(0, age); - Serial.print("name: "); Serial.println(name); - Serial.print("height: "); Serial.println(height); - Serial.print("age: "); Serial.println(age); - Serial.println("------------------------------------\n"); - - // Clear variables - name = '\0'; - height = 0; - age = 0; - Serial.print("name: "); Serial.println(name); - Serial.print("height: "); Serial.println(height); - Serial.print("age: "); Serial.println(age); - Serial.println("------------------------------------\n"); - - // Read: Variables <--- EEPROM stores - NAMES.get(0, rname); - HEIGHT.get(0, height); - AGE.get(0, age); - Serial.print("name: "); Serial.println(rname); - Serial.print("height: "); Serial.println(height); - Serial.print("age: "); Serial.println(age); - - Serial.println("Done!"); -} - -void loop() { - delay(0xFFFFFFFF); -} diff --git a/libraries/EEPROM/examples/eeprom_extra/eeprom_extra.ino b/libraries/EEPROM/examples/eeprom_extra/eeprom_extra.ino deleted file mode 100644 index 5ae01fb2268..00000000000 --- a/libraries/EEPROM/examples/eeprom_extra/eeprom_extra.ino +++ /dev/null @@ -1,139 +0,0 @@ -/* - ESP32 eeprom_extra example with EEPROM library - - This simple example demonstrates using other EEPROM library resources - - Created for arduino-esp32 on 25 Dec, 2017 - by Elochukwu Ifediora (fedy0) -*/ - -#include "EEPROM.h" - -void setup() { - // put your setup code here, to run once: - Serial.begin(115200); - Serial.println("\nTesting EEPROM Library\n"); - if (!EEPROM.begin(1000)) { - Serial.println("Failed to initialise EEPROM"); - Serial.println("Restarting..."); - delay(1000); - ESP.restart(); - } - - int address = 0; - - EEPROM.writeByte(address, -128); // -2^7 - address += sizeof(byte); - - EEPROM.writeChar(address, 'A'); // Same as writyByte and readByte - address += sizeof(char); - - EEPROM.writeUChar(address, 255); // 2^8 - 1 - address += sizeof(unsigned char); - - EEPROM.writeShort(address, -32768); // -2^15 - address += sizeof(short); - - EEPROM.writeUShort(address, 65535); // 2^16 - 1 - address += sizeof(unsigned short); - - EEPROM.writeInt(address, -2147483648); // -2^31 - address += sizeof(int); - - EEPROM.writeUInt(address, 4294967295); // 2^32 - 1 - address += sizeof(unsigned int); - - EEPROM.writeLong(address, -2147483648); // Same as writeInt and readInt - address += sizeof(long); - - EEPROM.writeULong(address, 4294967295); // Same as writeUInt and readUInt - address += sizeof(unsigned long); - - int64_t value = -1223372036854775808LL; // -2^63 - EEPROM.writeLong64(address, value); - address += sizeof(int64_t); - - uint64_t Value = 18446744073709551615ULL; // 2^64 - 1 - EEPROM.writeULong64(address, Value); - address += sizeof(uint64_t); - - EEPROM.writeFloat(address, 1234.1234); - address += sizeof(float); - - EEPROM.writeDouble(address, 123456789.123456789); - address += sizeof(double); - - EEPROM.writeBool(address, true); - address += sizeof(bool); - - String sentence = "I love ESP32."; - EEPROM.writeString(address, sentence); - address += sentence.length() + 1; - - char gratitude[21] = "Thank You Espressif!"; - EEPROM.writeString(address, gratitude); - address += 21; - - // See also the general purpose writeBytes() and readBytes() for BLOB in EEPROM library - EEPROM.commit(); - address = 0; - - Serial.println(EEPROM.readByte(address)); - address += sizeof(byte); - - Serial.println((char)EEPROM.readChar(address)); - address += sizeof(char); - - Serial.println(EEPROM.readUChar(address)); - address += sizeof(unsigned char); - - Serial.println(EEPROM.readShort(address)); - address += sizeof(short); - - Serial.println(EEPROM.readUShort(address)); - address += sizeof(unsigned short); - - Serial.println(EEPROM.readInt(address)); - address += sizeof(int); - - Serial.println(EEPROM.readUInt(address)); - address += sizeof(unsigned int); - - Serial.println(EEPROM.readLong(address)); - address += sizeof(long); - - Serial.println(EEPROM.readULong(address)); - address += sizeof(unsigned long); - - value = 0; - value = EEPROM.readLong64(value); - Serial.printf("0x%08X", (uint32_t)(value >> 32)); // Print High 4 bytes in HEX - Serial.printf("%08X\n", (uint32_t)value); // Print Low 4 bytes in HEX - address += sizeof(int64_t); - - Value = 0; // Clear Value - Value = EEPROM.readULong64(Value); - Serial.printf("0x%08X", (uint32_t)(Value >> 32)); // Print High 4 bytes in HEX - Serial.printf("%08X\n", (uint32_t)Value); // Print Low 4 bytes in HEX - address += sizeof(uint64_t); - - Serial.println(EEPROM.readFloat(address), 4); - address += sizeof(float); - - Serial.println(EEPROM.readDouble(address), 8); - address += sizeof(double); - - Serial.println(EEPROM.readBool(address)); - address += sizeof(bool); - - Serial.println(EEPROM.readString(address)); - address += sentence.length() + 1; - - Serial.println(EEPROM.readString(address)); - address += 21; -} - -void loop() { - // put your main code here, to run repeatedly: - -} diff --git a/libraries/EEPROM/examples/eeprom_write/eeprom_write.ino b/libraries/EEPROM/examples/eeprom_write/eeprom_write.ino deleted file mode 100644 index a4dbb8c3867..00000000000 --- a/libraries/EEPROM/examples/eeprom_write/eeprom_write.ino +++ /dev/null @@ -1,63 +0,0 @@ -/* - EEPROM Write - - Stores random values into the EEPROM. - These values will stay in the EEPROM when the board is - turned off and may be retrieved later by another sketch. -*/ - -#include "EEPROM.h" - -// the current address in the EEPROM (i.e. which byte -// we're going to write to next) -int addr = 0; -#define EEPROM_SIZE 64 -void setup() -{ - Serial.begin(115200); - Serial.println("start..."); - if (!EEPROM.begin(EEPROM_SIZE)) - { - Serial.println("failed to initialise EEPROM"); delay(1000000); - } - Serial.println(" bytes read from Flash . Values are:"); - for (int i = 0; i < EEPROM_SIZE; i++) - { - Serial.print(byte(EEPROM.read(i))); Serial.print(" "); - } - Serial.println(); - Serial.println("writing random n. in memory"); -} - -void loop() -{ - // need to divide by 4 because analog inputs range from - // 0 to 1023 and each byte of the EEPROM can only hold a - // value from 0 to 255. - // int val = analogRead(10) / 4; - int val = byte(random(10020)); - // write the value to the appropriate byte of the EEPROM. - // these values will remain there when the board is - // turned off. - EEPROM.write(addr, val); - Serial.print(val); Serial.print(" "); - // advance to the next address. there are 512 bytes in - // the EEPROM, so go back to 0 when we hit 512. - // save all changes to the flash. - addr = addr + 1; - if (addr == EEPROM_SIZE) - { - Serial.println(); - addr = 0; - EEPROM.commit(); - Serial.print(EEPROM_SIZE); - Serial.println(" bytes written on Flash . Values are:"); - for (int i = 0; i < EEPROM_SIZE; i++) - { - Serial.print(byte(EEPROM.read(i))); Serial.print(" "); - } - Serial.println(); Serial.println("----------------------------------"); - } - - delay(100); -} diff --git a/libraries/EEPROM/keywords.txt b/libraries/EEPROM/keywords.txt deleted file mode 100644 index 0e2552e12c4..00000000000 --- a/libraries/EEPROM/keywords.txt +++ /dev/null @@ -1,19 +0,0 @@ -####################################### -# Syntax Coloring Map For Ultrasound -####################################### - -####################################### -# Datatypes (KEYWORD1) -####################################### - -EEPROM KEYWORD1 -EEPROMClass KEYWORD1 - -####################################### -# Methods and Functions (KEYWORD2) -####################################### - -####################################### -# Constants (LITERAL1) -####################################### - diff --git a/libraries/EEPROM/library.properties b/libraries/EEPROM/library.properties deleted file mode 100644 index e65520588de..00000000000 --- a/libraries/EEPROM/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=EEPROM -version=1.0.3 -author=Ivan Grokhotkov -maintainer=Paolo Becchi -sentence=Enables reading and writing data a sequential, addressable FLASH storage -paragraph= -category=Data Storage -url=http://arduino.cc/en/Reference/EEPROM -architectures=esp32 diff --git a/libraries/EEPROM/src/EEPROM.cpp b/libraries/EEPROM/src/EEPROM.cpp deleted file mode 100644 index 7f4ab090f1f..00000000000 --- a/libraries/EEPROM/src/EEPROM.cpp +++ /dev/null @@ -1,557 +0,0 @@ -/* - EEPROM.h -ported by Paolo Becchi to Esp32 from esp8266 EEPROM - -Modified by Elochukwu Ifediora - -Converted to nvs lbernstone@gmail.com - - Uses a nvs byte array to emulate EEPROM - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "EEPROM.h" -#include -#include -#include - -EEPROMClass::EEPROMClass(void) - : _handle(0) - , _data(0) - , _size(0) - , _dirty(false) - , _name("eeprom") - , _user_defined_size(0) -{ -} - -EEPROMClass::EEPROMClass(uint32_t sector) -// Only for compatiility, no sectors in nvs! - : _handle(0) - , _data(0) - , _size(0) - , _dirty(false) - , _name("eeprom") - , _user_defined_size(0) -{ -} - -EEPROMClass::EEPROMClass(const char* name, uint32_t user_defined_size) - : _handle(0) - , _data(0) - , _size(0) - , _dirty(false) - , _name(name) - , _user_defined_size(user_defined_size) -{ -} - -EEPROMClass::~EEPROMClass() { - end(); -} - -bool EEPROMClass::begin(size_t size) { - if (!size) { - return false; - } - - esp_err_t res = nvs_open(_name, NVS_READWRITE, &_handle); - if (res != ESP_OK) { - log_e("Unable to open NVS namespace: %d", res); - return false; - } - - size_t key_size = 0; - res = nvs_get_blob(_handle, _name, NULL, &key_size); - if(res != ESP_OK && res != ESP_ERR_NVS_NOT_FOUND) { - log_e("Unable to read NVS key: %d", res); - return false; - } - if (size < key_size) { // truncate - log_w("truncating EEPROM from %d to %d", key_size, size); - uint8_t* key_data = (uint8_t*) malloc(key_size); - if(!key_data) { - log_e("Not enough memory to truncate EEPROM!"); - return false; - } - nvs_get_blob(_handle, _name, key_data, &key_size); - nvs_set_blob(_handle, _name, key_data, size); - nvs_commit(_handle); - free(key_data); - } - else if (size > key_size) { // expand or new - size_t expand_size = size - key_size; - uint8_t* expand_key = (uint8_t*) malloc(expand_size); - if(!expand_key) { - log_e("Not enough memory to expand EEPROM!"); - return false; - } - // check for adequate free space - if(nvs_set_blob(_handle, "expand", expand_key, expand_size)) { - log_e("Not enough space to expand EEPROM from %d to %d", key_size, size); - free(expand_key); - return false; - } - free(expand_key); - nvs_erase_key(_handle, "expand"); - uint8_t* key_data = (uint8_t*) malloc(size); - if(!key_data) { - log_e("Not enough memory to expand EEPROM!"); - return false; - } - memset(key_data, 0xFF, size); - if(key_size) { - log_i("Expanding EEPROM from %d to %d", key_size, size); - // hold data while key is deleted - nvs_get_blob(_handle, _name, key_data, &key_size); - nvs_erase_key(_handle, _name); - } else { - log_i("New EEPROM of %d bytes", size); - } - nvs_commit(_handle); - nvs_set_blob(_handle, _name, key_data, size); - free(key_data); - nvs_commit(_handle); - } - - if (_data) { - delete[] _data; - } - - _data = (uint8_t*) malloc(size); - if(!_data) { - log_e("Not enough memory for %d bytes in EEPROM"); - return false; - } - _size = size; - nvs_get_blob(_handle, _name, _data, &_size); - return true; -} - -void EEPROMClass::end() { - if (!_size) { - return; - } - - commit(); - if (_data) { - delete[] _data; - } - _data = 0; - _size = 0; - - nvs_close(_handle); - _handle = 0; -} - -uint8_t EEPROMClass::read(int address) { - if (address < 0 || (size_t)address >= _size) { - return 0; - } - if (!_data) { - return 0; - } - - return _data[address]; -} - -void EEPROMClass::write(int address, uint8_t value) { - if (address < 0 || (size_t)address >= _size) - return; - if (!_data) - return; - - // Optimise _dirty. Only flagged if data written is different. - uint8_t* pData = &_data[address]; - if (*pData != value) - { - *pData = value; - _dirty = true; - } -} - -bool EEPROMClass::commit() { - bool ret = false; - if (!_size) { - return false; - } - if (!_data) { - return false; - } - if (!_dirty) { - return true; - } - - if (ESP_OK != nvs_set_blob(_handle, _name, _data, _size)) { - log_e( "error in write"); - } else { - _dirty = false; - ret = true; - } - - return ret; -} - -uint8_t * EEPROMClass::getDataPtr() { - _dirty = true; - return &_data[0]; -} - -/* - Get EEPROM total size in byte defined by the user -*/ -uint16_t EEPROMClass::length () -{ - return _user_defined_size; -} - -/* - Convert EEPROM partition into nvs blob - Call convert before you call begin -*/ -uint16_t EEPROMClass::convert (bool clear, const char* EEPROMname, const char* nvsname) -{ - uint16_t result = 0; - const esp_partition_t* mypart = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_ANY, EEPROMname); - if (mypart == NULL) { - log_i("EEPROM partition not found for conversion"); - return result; - } - - size_t size = mypart->size; - uint8_t* data = (uint8_t*) malloc(size); - if (!data) { - log_e("Not enough memory to convert EEPROM!"); - goto exit; - } - - if (esp_partition_read (mypart, 0, (void *) data, size) != ESP_OK) { - log_e("Unable to read EEPROM partition"); - goto exit; - } - - bool empty; - empty = true; - for (int x=0; x _size) - return 0; - - uint16_t len; - for (len = 0; len <= _size; len++) - if (_data[address + len] == 0) - break; - - if (address + len > _size) - return 0; - - memcpy((uint8_t*) value, _data + address, len); - value[len] = 0; - return len; -} - -String EEPROMClass::readString (int address) -{ - if (address < 0 || address > _size) - return String(); - - uint16_t len; - for (len = 0; len <= _size; len++) - if (_data[address + len] == 0) - break; - - if (address + len > _size) - return String(); - - char value[len]; - memcpy((uint8_t*) value, _data + address, len); - value[len] = 0; - return String(value); -} - -size_t EEPROMClass::readBytes (int address, void* value, size_t maxLen) -{ - if (!value || !maxLen) - return 0; - - if (address < 0 || address + maxLen > _size) - return 0; - - memcpy((void*) value, _data + address, maxLen); - return maxLen; -} - -template T EEPROMClass::readAll (int address, T &value) -{ - if (address < 0 || address + sizeof(T) > _size) - return value; - - memcpy((uint8_t*) &value, _data + address, sizeof(T)); - return value; -} - -/* - Write 'value' to 'address' -*/ -size_t EEPROMClass::writeByte (int address, uint8_t value) -{ - return EEPROMClass::writeAll (address, value); -} - -size_t EEPROMClass::writeChar (int address, int8_t value) -{ - return EEPROMClass::writeAll (address, value); -} - -size_t EEPROMClass::writeUChar (int address, uint8_t value) -{ - return EEPROMClass::writeAll (address, value); -} - -size_t EEPROMClass::writeShort (int address, int16_t value) -{ - return EEPROMClass::writeAll (address, value); -} - -size_t EEPROMClass::writeUShort (int address, uint16_t value) -{ - return EEPROMClass::writeAll (address, value); -} - -size_t EEPROMClass::writeInt (int address, int32_t value) -{ - return EEPROMClass::writeAll (address, value); -} - -size_t EEPROMClass::writeUInt (int address, uint32_t value) -{ - return EEPROMClass::writeAll (address, value); -} - -size_t EEPROMClass::writeLong (int address, int32_t value) -{ - return EEPROMClass::writeAll (address, value); -} - -size_t EEPROMClass::writeULong (int address, uint32_t value) -{ - return EEPROMClass::writeAll (address, value); -} - -size_t EEPROMClass::writeLong64 (int address, int64_t value) -{ - return EEPROMClass::writeAll (address, value); -} - -size_t EEPROMClass::writeULong64 (int address, uint64_t value) -{ - return EEPROMClass::writeAll (address, value); -} - -size_t EEPROMClass::writeFloat (int address, float_t value) -{ - return EEPROMClass::writeAll (address, value); -} - -size_t EEPROMClass::writeDouble (int address, double_t value) -{ - return EEPROMClass::writeAll (address, value); -} - -size_t EEPROMClass::writeBool (int address, bool value) -{ - int8_t Bool; - value ? Bool = 1 : Bool = 0; - return EEPROMClass::writeAll (address, Bool); -} - -size_t EEPROMClass::writeString (int address, const char* value) -{ - if (!value) - return 0; - - if (address < 0 || address > _size) - return 0; - - uint16_t len; - for (len = 0; len <= _size; len++) - if (value[len] == 0) - break; - - if (address + len > _size) - return 0; - - memcpy(_data + address, (const uint8_t*) value, len + 1); - _dirty = true; - return strlen(value); -} - -size_t EEPROMClass::writeString (int address, String value) -{ - return EEPROMClass::writeString (address, value.c_str()); -} - -size_t EEPROMClass::writeBytes (int address, const void* value, size_t len) -{ - if (!value || !len) - return 0; - - if (address < 0 || address + len > _size) - return 0; - - memcpy(_data + address, (const void*) value, len); - _dirty = true; - return len; -} - -template T EEPROMClass::writeAll (int address, const T &value) -{ - if (address < 0 || address + sizeof(T) > _size) - return value; - - memcpy(_data + address, (const uint8_t*) &value, sizeof(T)); - _dirty = true; - - return sizeof (value); -} - -#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_EEPROM) -EEPROMClass EEPROM; -#endif diff --git a/libraries/EEPROM/src/EEPROM.h b/libraries/EEPROM/src/EEPROM.h deleted file mode 100644 index 032e1f65f86..00000000000 --- a/libraries/EEPROM/src/EEPROM.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - EEPROM.h -ported by Paolo Becchi to Esp32 from esp8266 EEPROM - -Modified by Elochukwu Ifediora - -Converted to nvs lbernstone@gmail.com - - Uses a nvs byte array to emulate EEPROM - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef EEPROM_h -#define EEPROM_h -#ifndef EEPROM_FLASH_PARTITION_NAME -#define EEPROM_FLASH_PARTITION_NAME "eeprom" -#endif -#include - -typedef uint32_t nvs_handle; - -class EEPROMClass { - public: - EEPROMClass(uint32_t sector); - EEPROMClass(const char* name, uint32_t user_defined_size); - EEPROMClass(void); - ~EEPROMClass(void); - - bool begin(size_t size); - uint8_t read(int address); - void write(int address, uint8_t val); - uint16_t length(); - bool commit(); - void end(); - - uint8_t * getDataPtr(); - uint16_t convert(bool clear, const char* EEPROMname = "eeprom", const char* nvsname = "eeprom"); - - template - T &get(int address, T &t) { - if (address < 0 || address + sizeof(T) > _size) - return t; - - memcpy((uint8_t*) &t, _data + address, sizeof(T)); - return t; - } - - template - const T &put(int address, const T &t) { - if (address < 0 || address + sizeof(T) > _size) - return t; - - memcpy(_data + address, (const uint8_t*) &t, sizeof(T)); - _dirty = true; - return t; - } - - uint8_t readByte(int address); - int8_t readChar(int address); - uint8_t readUChar(int address); - int16_t readShort(int address); - uint16_t readUShort(int address); - int32_t readInt(int address); - uint32_t readUInt(int address); - int32_t readLong(int address); - uint32_t readULong(int address); - int64_t readLong64(int address); - uint64_t readULong64(int address); - float_t readFloat(int address); - double_t readDouble(int address); - bool readBool(int address); - size_t readString(int address, char* value, size_t maxLen); - String readString(int address); - size_t readBytes(int address, void * value, size_t maxLen); - template T readAll (int address, T &); - - size_t writeByte(int address, uint8_t value); - size_t writeChar(int address, int8_t value); - size_t writeUChar(int address, uint8_t value); - size_t writeShort(int address, int16_t value); - size_t writeUShort(int address, uint16_t value); - size_t writeInt(int address, int32_t value); - size_t writeUInt(int address, uint32_t value); - size_t writeLong(int address, int32_t value); - size_t writeULong(int address, uint32_t value); - size_t writeLong64(int address, int64_t value); - size_t writeULong64(int address, uint64_t value); - size_t writeFloat(int address, float_t value); - size_t writeDouble(int address, double_t value); - size_t writeBool(int address, bool value); - size_t writeString(int address, const char* value); - size_t writeString(int address, String value); - size_t writeBytes(int address, const void* value, size_t len); - template T writeAll (int address, const T &); - - protected: - nvs_handle _handle; - uint8_t* _data; - size_t _size; - bool _dirty; - const char* _name; - uint32_t _user_defined_size; -}; - -#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_EEPROM) -extern EEPROMClass EEPROM; -#endif - -#endif diff --git a/libraries/ESP32/examples/AnalogOut/LEDCSoftwareFade/LEDCSoftwareFade.ino b/libraries/ESP32/examples/AnalogOut/LEDCSoftwareFade/LEDCSoftwareFade.ino deleted file mode 100644 index a4f2e5b41ba..00000000000 --- a/libraries/ESP32/examples/AnalogOut/LEDCSoftwareFade/LEDCSoftwareFade.ino +++ /dev/null @@ -1,57 +0,0 @@ -/* - LEDC Software Fade - - This example shows how to software fade LED - using the ledcWrite function. - - Code adapted from original Arduino Fade example: - https://www.arduino.cc/en/Tutorial/Fade - - This example code is in the public domain. - */ - -// use first channel of 16 channels (started from zero) -#define LEDC_CHANNEL_0 0 - -// use 13 bit precission for LEDC timer -#define LEDC_TIMER_13_BIT 13 - -// use 5000 Hz as a LEDC base frequency -#define LEDC_BASE_FREQ 5000 - -// fade LED PIN (replace with LED_BUILTIN constant for built-in LED) -#define LED_PIN 5 - -int brightness = 0; // how bright the LED is -int fadeAmount = 5; // how many points to fade the LED by - -// Arduino like analogWrite -// value has to be between 0 and valueMax -void ledcAnalogWrite(uint8_t channel, uint32_t value, uint32_t valueMax = 255) { - // calculate duty, 8191 from 2 ^ 13 - 1 - uint32_t duty = (8191 / valueMax) * min(value, valueMax); - - // write duty to LEDC - ledcWrite(channel, duty); -} - -void setup() { - // Setup timer and attach timer to a led pin - ledcSetup(LEDC_CHANNEL_0, LEDC_BASE_FREQ, LEDC_TIMER_13_BIT); - ledcAttachPin(LED_PIN, LEDC_CHANNEL_0); -} - -void loop() { - // set the brightness on LEDC channel 0 - ledcAnalogWrite(LEDC_CHANNEL_0, brightness); - - // change the brightness for next time through the loop: - brightness = brightness + fadeAmount; - - // reverse the direction of the fading at the ends of the fade: - if (brightness <= 0 || brightness >= 255) { - fadeAmount = -fadeAmount; - } - // wait for 30 milliseconds to see the dimming effect - delay(30); -} diff --git a/libraries/ESP32/examples/AnalogOut/SigmaDelta/SigmaDelta.ino b/libraries/ESP32/examples/AnalogOut/SigmaDelta/SigmaDelta.ino deleted file mode 100644 index 4a5c012bb86..00000000000 --- a/libraries/ESP32/examples/AnalogOut/SigmaDelta/SigmaDelta.ino +++ /dev/null @@ -1,18 +0,0 @@ -void setup() -{ - //setup channel 0 with frequency 312500 Hz - sigmaDeltaSetup(0, 312500); - //attach pin 18 to channel 0 - sigmaDeltaAttachPin(18,0); - //initialize channel 0 to off - sigmaDeltaWrite(0, 0); -} - -void loop() -{ - //slowly ramp-up the value - //will overflow at 256 - static uint8_t i = 0; - sigmaDeltaWrite(0, i++); - delay(100); -} diff --git a/libraries/ESP32/examples/AnalogOut/ledcWrite_RGB/ledcWrite_RGB.ino b/libraries/ESP32/examples/AnalogOut/ledcWrite_RGB/ledcWrite_RGB.ino deleted file mode 100644 index 633d1c0896d..00000000000 --- a/libraries/ESP32/examples/AnalogOut/ledcWrite_RGB/ledcWrite_RGB.ino +++ /dev/null @@ -1,130 +0,0 @@ -/* - ledcWrite_RGB.ino - Runs through the full 255 color spectrum for an rgb led - Demonstrate ledcWrite functionality for driving leds with PWM on ESP32 - - This example code is in the public domain. - - Some basic modifications were made by vseven, mostly commenting. - */ - -// Set up the rgb led names -uint8_t ledR = A4; -uint8_t ledG = A5; -uint8_t ledB = A18; - -uint8_t ledArray[3] = {1, 2, 3}; // three led channels - -const boolean invert = true; // set true if common anode, false if common cathode - -uint8_t color = 0; // a value from 0 to 255 representing the hue -uint32_t R, G, B; // the Red Green and Blue color components -uint8_t brightness = 255; // 255 is maximum brightness, but can be changed. Might need 256 for common anode to fully turn off. - -// the setup routine runs once when you press reset: -void setup() -{ - Serial.begin(115200); - delay(10); - - ledcAttachPin(ledR, 1); // assign RGB led pins to channels - ledcAttachPin(ledG, 2); - ledcAttachPin(ledB, 3); - - // Initialize channels - // channels 0-15, resolution 1-16 bits, freq limits depend on resolution - // ledcSetup(uint8_t channel, uint32_t freq, uint8_t resolution_bits); - ledcSetup(1, 12000, 8); // 12 kHz PWM, 8-bit resolution - ledcSetup(2, 12000, 8); - ledcSetup(3, 12000, 8); -} - -// void loop runs over and over again -void loop() -{ - Serial.println("Send all LEDs a 255 and wait 2 seconds."); - // If your RGB LED turns off instead of on here you should check if the LED is common anode or cathode. - // If it doesn't fully turn off and is common anode try using 256. - ledcWrite(1, 255); - ledcWrite(2, 255); - ledcWrite(3, 255); - delay(2000); - Serial.println("Send all LEDs a 0 and wait 2 seconds."); - ledcWrite(1, 0); - ledcWrite(2, 0); - ledcWrite(3, 0); - delay(2000); - - Serial.println("Starting color fade loop."); - - for (color = 0; color < 255; color++) { // Slew through the color spectrum - - hueToRGB(color, brightness); // call function to convert hue to RGB - - // write the RGB values to the pins - ledcWrite(1, R); // write red component to channel 1, etc. - ledcWrite(2, G); - ledcWrite(3, B); - - delay(100); // full cycle of rgb over 256 colors takes 26 seconds - } - -} - -// Courtesy http://www.instructables.com/id/How-to-Use-an-RGB-LED/?ALLSTEPS -// function to convert a color to its Red, Green, and Blue components. - -void hueToRGB(uint8_t hue, uint8_t brightness) -{ - uint16_t scaledHue = (hue * 6); - uint8_t segment = scaledHue / 256; // segment 0 to 5 around the - // color wheel - uint16_t segmentOffset = - scaledHue - (segment * 256); // position within the segment - - uint8_t complement = 0; - uint16_t prev = (brightness * ( 255 - segmentOffset)) / 256; - uint16_t next = (brightness * segmentOffset) / 256; - - if(invert) - { - brightness = 255 - brightness; - complement = 255; - prev = 255 - prev; - next = 255 - next; - } - - switch(segment ) { - case 0: // red - R = brightness; - G = next; - B = complement; - break; - case 1: // yellow - R = prev; - G = brightness; - B = complement; - break; - case 2: // green - R = complement; - G = brightness; - B = next; - break; - case 3: // cyan - R = complement; - G = prev; - B = brightness; - break; - case 4: // blue - R = next; - G = complement; - B = brightness; - break; - case 5: // magenta - default: - R = brightness; - G = complement; - B = prev; - break; - } -} diff --git a/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino b/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino deleted file mode 100644 index 445797d5e85..00000000000 --- a/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino +++ /dev/null @@ -1,106 +0,0 @@ -#include "esp_camera.h" -#include - -// -// WARNING!!! Make sure that you have either selected ESP32 Wrover Module, -// or another board which has PSRAM enabled -// - -// Select camera model -#define CAMERA_MODEL_WROVER_KIT -//#define CAMERA_MODEL_ESP_EYE -//#define CAMERA_MODEL_M5STACK_PSRAM -//#define CAMERA_MODEL_M5STACK_WIDE -//#define CAMERA_MODEL_AI_THINKER - -#include "camera_pins.h" - -const char* ssid = "*********"; -const char* password = "*********"; - -void startCameraServer(); - -void setup() { - Serial.begin(115200); - Serial.setDebugOutput(true); - Serial.println(); - - camera_config_t config; - config.ledc_channel = LEDC_CHANNEL_0; - config.ledc_timer = LEDC_TIMER_0; - config.pin_d0 = Y2_GPIO_NUM; - config.pin_d1 = Y3_GPIO_NUM; - config.pin_d2 = Y4_GPIO_NUM; - config.pin_d3 = Y5_GPIO_NUM; - config.pin_d4 = Y6_GPIO_NUM; - config.pin_d5 = Y7_GPIO_NUM; - config.pin_d6 = Y8_GPIO_NUM; - config.pin_d7 = Y9_GPIO_NUM; - config.pin_xclk = XCLK_GPIO_NUM; - config.pin_pclk = PCLK_GPIO_NUM; - config.pin_vsync = VSYNC_GPIO_NUM; - config.pin_href = HREF_GPIO_NUM; - config.pin_sscb_sda = SIOD_GPIO_NUM; - config.pin_sscb_scl = SIOC_GPIO_NUM; - config.pin_pwdn = PWDN_GPIO_NUM; - config.pin_reset = RESET_GPIO_NUM; - config.xclk_freq_hz = 20000000; - config.pixel_format = PIXFORMAT_JPEG; - //init with high specs to pre-allocate larger buffers - if(psramFound()){ - config.frame_size = FRAMESIZE_UXGA; - config.jpeg_quality = 10; - config.fb_count = 2; - } else { - config.frame_size = FRAMESIZE_SVGA; - config.jpeg_quality = 12; - config.fb_count = 1; - } - -#if defined(CAMERA_MODEL_ESP_EYE) - pinMode(13, INPUT_PULLUP); - pinMode(14, INPUT_PULLUP); -#endif - - // camera init - esp_err_t err = esp_camera_init(&config); - if (err != ESP_OK) { - Serial.printf("Camera init failed with error 0x%x", err); - return; - } - - sensor_t * s = esp_camera_sensor_get(); - //initial sensors are flipped vertically and colors are a bit saturated - if (s->id.PID == OV3660_PID) { - s->set_vflip(s, 1);//flip it back - s->set_brightness(s, 1);//up the blightness just a bit - s->set_saturation(s, -2);//lower the saturation - } - //drop down frame size for higher initial frame rate - s->set_framesize(s, FRAMESIZE_QVGA); - -#if defined(CAMERA_MODEL_M5STACK_WIDE) - s->set_vflip(s, 1); - s->set_hmirror(s, 1); -#endif - - WiFi.begin(ssid, password); - - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - } - Serial.println(""); - Serial.println("WiFi connected"); - - startCameraServer(); - - Serial.print("Camera Ready! Use 'http://"); - Serial.print(WiFi.localIP()); - Serial.println("' to connect"); -} - -void loop() { - // put your main code here, to run repeatedly: - delay(10000); -} diff --git a/libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp b/libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp deleted file mode 100644 index 07d29ee7175..00000000000 --- a/libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp +++ /dev/null @@ -1,662 +0,0 @@ -// 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. -#include "esp_http_server.h" -#include "esp_timer.h" -#include "esp_camera.h" -#include "img_converters.h" -#include "camera_index.h" -#include "Arduino.h" - -#include "fb_gfx.h" -#include "fd_forward.h" -#include "fr_forward.h" - -#define ENROLL_CONFIRM_TIMES 5 -#define FACE_ID_SAVE_NUMBER 7 - -#define FACE_COLOR_WHITE 0x00FFFFFF -#define FACE_COLOR_BLACK 0x00000000 -#define FACE_COLOR_RED 0x000000FF -#define FACE_COLOR_GREEN 0x0000FF00 -#define FACE_COLOR_BLUE 0x00FF0000 -#define FACE_COLOR_YELLOW (FACE_COLOR_RED | FACE_COLOR_GREEN) -#define FACE_COLOR_CYAN (FACE_COLOR_BLUE | FACE_COLOR_GREEN) -#define FACE_COLOR_PURPLE (FACE_COLOR_BLUE | FACE_COLOR_RED) - -typedef struct { - size_t size; //number of values used for filtering - size_t index; //current value index - size_t count; //value count - int sum; - int * values; //array to be filled with values -} ra_filter_t; - -typedef struct { - httpd_req_t *req; - size_t len; -} jpg_chunking_t; - -#define PART_BOUNDARY "123456789000000000000987654321" -static const char* _STREAM_CONTENT_TYPE = "multipart/x-mixed-replace;boundary=" PART_BOUNDARY; -static const char* _STREAM_BOUNDARY = "\r\n--" PART_BOUNDARY "\r\n"; -static const char* _STREAM_PART = "Content-Type: image/jpeg\r\nContent-Length: %u\r\n\r\n"; - -static ra_filter_t ra_filter; -httpd_handle_t stream_httpd = NULL; -httpd_handle_t camera_httpd = NULL; - -static mtmn_config_t mtmn_config = {0}; -static int8_t detection_enabled = 0; -static int8_t recognition_enabled = 0; -static int8_t is_enrolling = 0; -static face_id_list id_list = {0}; - -static ra_filter_t * ra_filter_init(ra_filter_t * filter, size_t sample_size){ - memset(filter, 0, sizeof(ra_filter_t)); - - filter->values = (int *)malloc(sample_size * sizeof(int)); - if(!filter->values){ - return NULL; - } - memset(filter->values, 0, sample_size * sizeof(int)); - - filter->size = sample_size; - return filter; -} - -static int ra_filter_run(ra_filter_t * filter, int value){ - if(!filter->values){ - return value; - } - filter->sum -= filter->values[filter->index]; - filter->values[filter->index] = value; - filter->sum += filter->values[filter->index]; - filter->index++; - filter->index = filter->index % filter->size; - if (filter->count < filter->size) { - filter->count++; - } - return filter->sum / filter->count; -} - -static void rgb_print(dl_matrix3du_t *image_matrix, uint32_t color, const char * str){ - fb_data_t fb; - fb.width = image_matrix->w; - fb.height = image_matrix->h; - fb.data = image_matrix->item; - fb.bytes_per_pixel = 3; - fb.format = FB_BGR888; - fb_gfx_print(&fb, (fb.width - (strlen(str) * 14)) / 2, 10, color, str); -} - -static int rgb_printf(dl_matrix3du_t *image_matrix, uint32_t color, const char *format, ...){ - char loc_buf[64]; - char * temp = loc_buf; - int len; - va_list arg; - va_list copy; - va_start(arg, format); - va_copy(copy, arg); - len = vsnprintf(loc_buf, sizeof(loc_buf), format, arg); - va_end(copy); - if(len >= sizeof(loc_buf)){ - temp = (char*)malloc(len+1); - if(temp == NULL) { - return 0; - } - } - vsnprintf(temp, len+1, format, arg); - va_end(arg); - rgb_print(image_matrix, color, temp); - if(len > 64){ - free(temp); - } - return len; -} - -static void draw_face_boxes(dl_matrix3du_t *image_matrix, box_array_t *boxes, int face_id){ - int x, y, w, h, i; - uint32_t color = FACE_COLOR_YELLOW; - if(face_id < 0){ - color = FACE_COLOR_RED; - } else if(face_id > 0){ - color = FACE_COLOR_GREEN; - } - fb_data_t fb; - fb.width = image_matrix->w; - fb.height = image_matrix->h; - fb.data = image_matrix->item; - fb.bytes_per_pixel = 3; - fb.format = FB_BGR888; - for (i = 0; i < boxes->len; i++){ - // rectangle box - x = (int)boxes->box[i].box_p[0]; - y = (int)boxes->box[i].box_p[1]; - w = (int)boxes->box[i].box_p[2] - x + 1; - h = (int)boxes->box[i].box_p[3] - y + 1; - fb_gfx_drawFastHLine(&fb, x, y, w, color); - fb_gfx_drawFastHLine(&fb, x, y+h-1, w, color); - fb_gfx_drawFastVLine(&fb, x, y, h, color); - fb_gfx_drawFastVLine(&fb, x+w-1, y, h, color); -#if 0 - // landmark - int x0, y0, j; - for (j = 0; j < 10; j+=2) { - x0 = (int)boxes->landmark[i].landmark_p[j]; - y0 = (int)boxes->landmark[i].landmark_p[j+1]; - fb_gfx_fillRect(&fb, x0, y0, 3, 3, color); - } -#endif - } -} - -static int run_face_recognition(dl_matrix3du_t *image_matrix, box_array_t *net_boxes){ - dl_matrix3du_t *aligned_face = NULL; - int matched_id = 0; - - aligned_face = dl_matrix3du_alloc(1, FACE_WIDTH, FACE_HEIGHT, 3); - if(!aligned_face){ - Serial.println("Could not allocate face recognition buffer"); - return matched_id; - } - if (align_face(net_boxes, image_matrix, aligned_face) == ESP_OK){ - if (is_enrolling == 1){ - int8_t left_sample_face = enroll_face(&id_list, aligned_face); - - if(left_sample_face == (ENROLL_CONFIRM_TIMES - 1)){ - Serial.printf("Enrolling Face ID: %d\n", id_list.tail); - } - Serial.printf("Enrolling Face ID: %d sample %d\n", id_list.tail, ENROLL_CONFIRM_TIMES - left_sample_face); - rgb_printf(image_matrix, FACE_COLOR_CYAN, "ID[%u] Sample[%u]", id_list.tail, ENROLL_CONFIRM_TIMES - left_sample_face); - if (left_sample_face == 0){ - is_enrolling = 0; - Serial.printf("Enrolled Face ID: %d\n", id_list.tail); - } - } else { - matched_id = recognize_face(&id_list, aligned_face); - if (matched_id >= 0) { - Serial.printf("Match Face ID: %u\n", matched_id); - rgb_printf(image_matrix, FACE_COLOR_GREEN, "Hello Subject %u", matched_id); - } else { - Serial.println("No Match Found"); - rgb_print(image_matrix, FACE_COLOR_RED, "Intruder Alert!"); - matched_id = -1; - } - } - } else { - Serial.println("Face Not Aligned"); - //rgb_print(image_matrix, FACE_COLOR_YELLOW, "Human Detected"); - } - - dl_matrix3du_free(aligned_face); - return matched_id; -} - -static size_t jpg_encode_stream(void * arg, size_t index, const void* data, size_t len){ - jpg_chunking_t *j = (jpg_chunking_t *)arg; - if(!index){ - j->len = 0; - } - if(httpd_resp_send_chunk(j->req, (const char *)data, len) != ESP_OK){ - return 0; - } - j->len += len; - return len; -} - -static esp_err_t capture_handler(httpd_req_t *req){ - camera_fb_t * fb = NULL; - esp_err_t res = ESP_OK; - int64_t fr_start = esp_timer_get_time(); - - fb = esp_camera_fb_get(); - if (!fb) { - Serial.println("Camera capture failed"); - httpd_resp_send_500(req); - return ESP_FAIL; - } - - httpd_resp_set_type(req, "image/jpeg"); - httpd_resp_set_hdr(req, "Content-Disposition", "inline; filename=capture.jpg"); - httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*"); - - size_t out_len, out_width, out_height; - uint8_t * out_buf; - bool s; - bool detected = false; - int face_id = 0; - if(!detection_enabled || fb->width > 400){ - size_t fb_len = 0; - if(fb->format == PIXFORMAT_JPEG){ - fb_len = fb->len; - res = httpd_resp_send(req, (const char *)fb->buf, fb->len); - } else { - jpg_chunking_t jchunk = {req, 0}; - res = frame2jpg_cb(fb, 80, jpg_encode_stream, &jchunk)?ESP_OK:ESP_FAIL; - httpd_resp_send_chunk(req, NULL, 0); - fb_len = jchunk.len; - } - esp_camera_fb_return(fb); - int64_t fr_end = esp_timer_get_time(); - Serial.printf("JPG: %uB %ums\n", (uint32_t)(fb_len), (uint32_t)((fr_end - fr_start)/1000)); - return res; - } - - dl_matrix3du_t *image_matrix = dl_matrix3du_alloc(1, fb->width, fb->height, 3); - if (!image_matrix) { - esp_camera_fb_return(fb); - Serial.println("dl_matrix3du_alloc failed"); - httpd_resp_send_500(req); - return ESP_FAIL; - } - - out_buf = image_matrix->item; - out_len = fb->width * fb->height * 3; - out_width = fb->width; - out_height = fb->height; - - s = fmt2rgb888(fb->buf, fb->len, fb->format, out_buf); - esp_camera_fb_return(fb); - if(!s){ - dl_matrix3du_free(image_matrix); - Serial.println("to rgb888 failed"); - httpd_resp_send_500(req); - return ESP_FAIL; - } - - box_array_t *net_boxes = face_detect(image_matrix, &mtmn_config); - - if (net_boxes){ - detected = true; - if(recognition_enabled){ - face_id = run_face_recognition(image_matrix, net_boxes); - } - draw_face_boxes(image_matrix, net_boxes, face_id); - free(net_boxes->score); - free(net_boxes->box); - free(net_boxes->landmark); - free(net_boxes); - } - - jpg_chunking_t jchunk = {req, 0}; - s = fmt2jpg_cb(out_buf, out_len, out_width, out_height, PIXFORMAT_RGB888, 90, jpg_encode_stream, &jchunk); - dl_matrix3du_free(image_matrix); - if(!s){ - Serial.println("JPEG compression failed"); - return ESP_FAIL; - } - - int64_t fr_end = esp_timer_get_time(); - Serial.printf("FACE: %uB %ums %s%d\n", (uint32_t)(jchunk.len), (uint32_t)((fr_end - fr_start)/1000), detected?"DETECTED ":"", face_id); - return res; -} - -static esp_err_t stream_handler(httpd_req_t *req){ - camera_fb_t * fb = NULL; - esp_err_t res = ESP_OK; - size_t _jpg_buf_len = 0; - uint8_t * _jpg_buf = NULL; - char * part_buf[64]; - dl_matrix3du_t *image_matrix = NULL; - bool detected = false; - int face_id = 0; - int64_t fr_start = 0; - int64_t fr_ready = 0; - int64_t fr_face = 0; - int64_t fr_recognize = 0; - int64_t fr_encode = 0; - - static int64_t last_frame = 0; - if(!last_frame) { - last_frame = esp_timer_get_time(); - } - - res = httpd_resp_set_type(req, _STREAM_CONTENT_TYPE); - if(res != ESP_OK){ - return res; - } - - httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*"); - - while(true){ - detected = false; - face_id = 0; - fb = esp_camera_fb_get(); - if (!fb) { - Serial.println("Camera capture failed"); - res = ESP_FAIL; - } else { - fr_start = esp_timer_get_time(); - fr_ready = fr_start; - fr_face = fr_start; - fr_encode = fr_start; - fr_recognize = fr_start; - if(!detection_enabled || fb->width > 400){ - if(fb->format != PIXFORMAT_JPEG){ - bool jpeg_converted = frame2jpg(fb, 80, &_jpg_buf, &_jpg_buf_len); - esp_camera_fb_return(fb); - fb = NULL; - if(!jpeg_converted){ - Serial.println("JPEG compression failed"); - res = ESP_FAIL; - } - } else { - _jpg_buf_len = fb->len; - _jpg_buf = fb->buf; - } - } else { - - image_matrix = dl_matrix3du_alloc(1, fb->width, fb->height, 3); - - if (!image_matrix) { - Serial.println("dl_matrix3du_alloc failed"); - res = ESP_FAIL; - } else { - if(!fmt2rgb888(fb->buf, fb->len, fb->format, image_matrix->item)){ - Serial.println("fmt2rgb888 failed"); - res = ESP_FAIL; - } else { - fr_ready = esp_timer_get_time(); - box_array_t *net_boxes = NULL; - if(detection_enabled){ - net_boxes = face_detect(image_matrix, &mtmn_config); - } - fr_face = esp_timer_get_time(); - fr_recognize = fr_face; - if (net_boxes || fb->format != PIXFORMAT_JPEG){ - if(net_boxes){ - detected = true; - if(recognition_enabled){ - face_id = run_face_recognition(image_matrix, net_boxes); - } - fr_recognize = esp_timer_get_time(); - draw_face_boxes(image_matrix, net_boxes, face_id); - free(net_boxes->score); - free(net_boxes->box); - free(net_boxes->landmark); - free(net_boxes); - } - if(!fmt2jpg(image_matrix->item, fb->width*fb->height*3, fb->width, fb->height, PIXFORMAT_RGB888, 90, &_jpg_buf, &_jpg_buf_len)){ - Serial.println("fmt2jpg failed"); - res = ESP_FAIL; - } - esp_camera_fb_return(fb); - fb = NULL; - } else { - _jpg_buf = fb->buf; - _jpg_buf_len = fb->len; - } - fr_encode = esp_timer_get_time(); - } - dl_matrix3du_free(image_matrix); - } - } - } - if(res == ESP_OK){ - size_t hlen = snprintf((char *)part_buf, 64, _STREAM_PART, _jpg_buf_len); - res = httpd_resp_send_chunk(req, (const char *)part_buf, hlen); - } - if(res == ESP_OK){ - res = httpd_resp_send_chunk(req, (const char *)_jpg_buf, _jpg_buf_len); - } - if(res == ESP_OK){ - res = httpd_resp_send_chunk(req, _STREAM_BOUNDARY, strlen(_STREAM_BOUNDARY)); - } - if(fb){ - esp_camera_fb_return(fb); - fb = NULL; - _jpg_buf = NULL; - } else if(_jpg_buf){ - free(_jpg_buf); - _jpg_buf = NULL; - } - if(res != ESP_OK){ - break; - } - int64_t fr_end = esp_timer_get_time(); - - int64_t ready_time = (fr_ready - fr_start)/1000; - int64_t face_time = (fr_face - fr_ready)/1000; - int64_t recognize_time = (fr_recognize - fr_face)/1000; - int64_t encode_time = (fr_encode - fr_recognize)/1000; - int64_t process_time = (fr_encode - fr_start)/1000; - - int64_t frame_time = fr_end - last_frame; - last_frame = fr_end; - frame_time /= 1000; - uint32_t avg_frame_time = ra_filter_run(&ra_filter, frame_time); - Serial.printf("MJPG: %uB %ums (%.1ffps), AVG: %ums (%.1ffps), %u+%u+%u+%u=%u %s%d\n", - (uint32_t)(_jpg_buf_len), - (uint32_t)frame_time, 1000.0 / (uint32_t)frame_time, - avg_frame_time, 1000.0 / avg_frame_time, - (uint32_t)ready_time, (uint32_t)face_time, (uint32_t)recognize_time, (uint32_t)encode_time, (uint32_t)process_time, - (detected)?"DETECTED ":"", face_id - ); - } - - last_frame = 0; - return res; -} - -static esp_err_t cmd_handler(httpd_req_t *req){ - char* buf; - size_t buf_len; - char variable[32] = {0,}; - char value[32] = {0,}; - - buf_len = httpd_req_get_url_query_len(req) + 1; - if (buf_len > 1) { - buf = (char*)malloc(buf_len); - if(!buf){ - httpd_resp_send_500(req); - return ESP_FAIL; - } - if (httpd_req_get_url_query_str(req, buf, buf_len) == ESP_OK) { - if (httpd_query_key_value(buf, "var", variable, sizeof(variable)) == ESP_OK && - httpd_query_key_value(buf, "val", value, sizeof(value)) == ESP_OK) { - } else { - free(buf); - httpd_resp_send_404(req); - return ESP_FAIL; - } - } else { - free(buf); - httpd_resp_send_404(req); - return ESP_FAIL; - } - free(buf); - } else { - httpd_resp_send_404(req); - return ESP_FAIL; - } - - int val = atoi(value); - sensor_t * s = esp_camera_sensor_get(); - int res = 0; - - if(!strcmp(variable, "framesize")) { - if(s->pixformat == PIXFORMAT_JPEG) res = s->set_framesize(s, (framesize_t)val); - } - else if(!strcmp(variable, "quality")) res = s->set_quality(s, val); - else if(!strcmp(variable, "contrast")) res = s->set_contrast(s, val); - else if(!strcmp(variable, "brightness")) res = s->set_brightness(s, val); - else if(!strcmp(variable, "saturation")) res = s->set_saturation(s, val); - else if(!strcmp(variable, "gainceiling")) res = s->set_gainceiling(s, (gainceiling_t)val); - else if(!strcmp(variable, "colorbar")) res = s->set_colorbar(s, val); - else if(!strcmp(variable, "awb")) res = s->set_whitebal(s, val); - else if(!strcmp(variable, "agc")) res = s->set_gain_ctrl(s, val); - else if(!strcmp(variable, "aec")) res = s->set_exposure_ctrl(s, val); - else if(!strcmp(variable, "hmirror")) res = s->set_hmirror(s, val); - else if(!strcmp(variable, "vflip")) res = s->set_vflip(s, val); - else if(!strcmp(variable, "awb_gain")) res = s->set_awb_gain(s, val); - else if(!strcmp(variable, "agc_gain")) res = s->set_agc_gain(s, val); - else if(!strcmp(variable, "aec_value")) res = s->set_aec_value(s, val); - else if(!strcmp(variable, "aec2")) res = s->set_aec2(s, val); - else if(!strcmp(variable, "dcw")) res = s->set_dcw(s, val); - else if(!strcmp(variable, "bpc")) res = s->set_bpc(s, val); - else if(!strcmp(variable, "wpc")) res = s->set_wpc(s, val); - else if(!strcmp(variable, "raw_gma")) res = s->set_raw_gma(s, val); - else if(!strcmp(variable, "lenc")) res = s->set_lenc(s, val); - else if(!strcmp(variable, "special_effect")) res = s->set_special_effect(s, val); - else if(!strcmp(variable, "wb_mode")) res = s->set_wb_mode(s, val); - else if(!strcmp(variable, "ae_level")) res = s->set_ae_level(s, val); - else if(!strcmp(variable, "face_detect")) { - detection_enabled = val; - if(!detection_enabled) { - recognition_enabled = 0; - } - } - else if(!strcmp(variable, "face_enroll")) is_enrolling = val; - else if(!strcmp(variable, "face_recognize")) { - recognition_enabled = val; - if(recognition_enabled){ - detection_enabled = val; - } - } - else { - res = -1; - } - - if(res){ - return httpd_resp_send_500(req); - } - - httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*"); - return httpd_resp_send(req, NULL, 0); -} - -static esp_err_t status_handler(httpd_req_t *req){ - static char json_response[1024]; - - sensor_t * s = esp_camera_sensor_get(); - char * p = json_response; - *p++ = '{'; - - p+=sprintf(p, "\"framesize\":%u,", s->status.framesize); - p+=sprintf(p, "\"quality\":%u,", s->status.quality); - p+=sprintf(p, "\"brightness\":%d,", s->status.brightness); - p+=sprintf(p, "\"contrast\":%d,", s->status.contrast); - p+=sprintf(p, "\"saturation\":%d,", s->status.saturation); - p+=sprintf(p, "\"sharpness\":%d,", s->status.sharpness); - p+=sprintf(p, "\"special_effect\":%u,", s->status.special_effect); - p+=sprintf(p, "\"wb_mode\":%u,", s->status.wb_mode); - p+=sprintf(p, "\"awb\":%u,", s->status.awb); - p+=sprintf(p, "\"awb_gain\":%u,", s->status.awb_gain); - p+=sprintf(p, "\"aec\":%u,", s->status.aec); - p+=sprintf(p, "\"aec2\":%u,", s->status.aec2); - p+=sprintf(p, "\"ae_level\":%d,", s->status.ae_level); - p+=sprintf(p, "\"aec_value\":%u,", s->status.aec_value); - p+=sprintf(p, "\"agc\":%u,", s->status.agc); - p+=sprintf(p, "\"agc_gain\":%u,", s->status.agc_gain); - p+=sprintf(p, "\"gainceiling\":%u,", s->status.gainceiling); - p+=sprintf(p, "\"bpc\":%u,", s->status.bpc); - p+=sprintf(p, "\"wpc\":%u,", s->status.wpc); - p+=sprintf(p, "\"raw_gma\":%u,", s->status.raw_gma); - p+=sprintf(p, "\"lenc\":%u,", s->status.lenc); - p+=sprintf(p, "\"vflip\":%u,", s->status.vflip); - p+=sprintf(p, "\"hmirror\":%u,", s->status.hmirror); - p+=sprintf(p, "\"dcw\":%u,", s->status.dcw); - p+=sprintf(p, "\"colorbar\":%u,", s->status.colorbar); - p+=sprintf(p, "\"face_detect\":%u,", detection_enabled); - p+=sprintf(p, "\"face_enroll\":%u,", is_enrolling); - p+=sprintf(p, "\"face_recognize\":%u", recognition_enabled); - *p++ = '}'; - *p++ = 0; - httpd_resp_set_type(req, "application/json"); - httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*"); - return httpd_resp_send(req, json_response, strlen(json_response)); -} - -static esp_err_t index_handler(httpd_req_t *req){ - httpd_resp_set_type(req, "text/html"); - httpd_resp_set_hdr(req, "Content-Encoding", "gzip"); - sensor_t * s = esp_camera_sensor_get(); - if (s->id.PID == OV3660_PID) { - return httpd_resp_send(req, (const char *)index_ov3660_html_gz, index_ov3660_html_gz_len); - } - return httpd_resp_send(req, (const char *)index_ov2640_html_gz, index_ov2640_html_gz_len); -} - -void startCameraServer(){ - httpd_config_t config = HTTPD_DEFAULT_CONFIG(); - - httpd_uri_t index_uri = { - .uri = "/", - .method = HTTP_GET, - .handler = index_handler, - .user_ctx = NULL - }; - - httpd_uri_t status_uri = { - .uri = "/status", - .method = HTTP_GET, - .handler = status_handler, - .user_ctx = NULL - }; - - httpd_uri_t cmd_uri = { - .uri = "/control", - .method = HTTP_GET, - .handler = cmd_handler, - .user_ctx = NULL - }; - - httpd_uri_t capture_uri = { - .uri = "/capture", - .method = HTTP_GET, - .handler = capture_handler, - .user_ctx = NULL - }; - - httpd_uri_t stream_uri = { - .uri = "/stream", - .method = HTTP_GET, - .handler = stream_handler, - .user_ctx = NULL - }; - - - ra_filter_init(&ra_filter, 20); - - mtmn_config.type = FAST; - mtmn_config.min_face = 80; - mtmn_config.pyramid = 0.707; - mtmn_config.pyramid_times = 4; - mtmn_config.p_threshold.score = 0.6; - mtmn_config.p_threshold.nms = 0.7; - mtmn_config.p_threshold.candidate_number = 20; - mtmn_config.r_threshold.score = 0.7; - mtmn_config.r_threshold.nms = 0.7; - mtmn_config.r_threshold.candidate_number = 10; - mtmn_config.o_threshold.score = 0.7; - mtmn_config.o_threshold.nms = 0.7; - mtmn_config.o_threshold.candidate_number = 1; - - face_id_init(&id_list, FACE_ID_SAVE_NUMBER, ENROLL_CONFIRM_TIMES); - - Serial.printf("Starting web server on port: '%d'\n", config.server_port); - if (httpd_start(&camera_httpd, &config) == ESP_OK) { - httpd_register_uri_handler(camera_httpd, &index_uri); - httpd_register_uri_handler(camera_httpd, &cmd_uri); - httpd_register_uri_handler(camera_httpd, &status_uri); - httpd_register_uri_handler(camera_httpd, &capture_uri); - } - - config.server_port += 1; - config.ctrl_port += 1; - Serial.printf("Starting stream server on port: '%d'\n", config.server_port); - if (httpd_start(&stream_httpd, &config) == ESP_OK) { - httpd_register_uri_handler(stream_httpd, &stream_uri); - } -} diff --git a/libraries/ESP32/examples/Camera/CameraWebServer/camera_index.h b/libraries/ESP32/examples/Camera/CameraWebServer/camera_index.h deleted file mode 100644 index 9e6e09bf13d..00000000000 --- a/libraries/ESP32/examples/Camera/CameraWebServer/camera_index.h +++ /dev/null @@ -1,558 +0,0 @@ - -//File: index_ov2640.html.gz, Size: 4316 -#define index_ov2640_html_gz_len 4316 -const uint8_t index_ov2640_html_gz[] = { - 0x1F, 0x8B, 0x08, 0x08, 0x50, 0x5C, 0xAE, 0x5C, 0x00, 0x03, 0x69, 0x6E, 0x64, 0x65, 0x78, 0x5F, - 0x6F, 0x76, 0x32, 0x36, 0x34, 0x30, 0x2E, 0x68, 0x74, 0x6D, 0x6C, 0x00, 0xE5, 0x5D, 0x7B, 0x73, - 0xD3, 0xC6, 0x16, 0xFF, 0x9F, 0x4F, 0x21, 0x04, 0x25, 0xF6, 0x34, 0x76, 0x6C, 0xC7, 0x84, 0xE0, - 0xDA, 0xE2, 0x42, 0x08, 0xD0, 0x19, 0x5E, 0x25, 0x2D, 0x74, 0xA6, 0xD3, 0x81, 0xB5, 0xB4, 0xB2, - 0x55, 0x64, 0xC9, 0x95, 0x56, 0x76, 0x52, 0x26, 0x9F, 0xE3, 0x7E, 0xA0, 0xFB, 0xC5, 0xEE, 0xD9, - 0x87, 0xA4, 0x95, 0xBC, 0x7A, 0xD8, 0x26, 0x36, 0x97, 0xEB, 0xCC, 0x14, 0xD9, 0xDA, 0x73, 0xF6, - 0x9C, 0xF3, 0x3B, 0xAF, 0x5D, 0x3D, 0x3A, 0xBC, 0x6D, 0xF9, 0x26, 0xB9, 0x9A, 0x63, 0x6D, 0x4A, - 0x66, 0xAE, 0x71, 0x6B, 0xC8, 0xFF, 0xD1, 0xE0, 0x33, 0x9C, 0x62, 0x64, 0xF1, 0x43, 0xF6, 0x75, - 0x86, 0x09, 0xD2, 0xCC, 0x29, 0x0A, 0x42, 0x4C, 0x46, 0x7A, 0x44, 0xEC, 0xD6, 0xA9, 0x9E, 0x3F, - 0xED, 0xA1, 0x19, 0x1E, 0xE9, 0x0B, 0x07, 0x2F, 0xE7, 0x7E, 0x40, 0x74, 0xCD, 0xF4, 0x3D, 0x82, - 0x3D, 0x18, 0xBE, 0x74, 0x2C, 0x32, 0x1D, 0x59, 0x78, 0xE1, 0x98, 0xB8, 0xC5, 0xBE, 0x1C, 0x3A, - 0x9E, 0x43, 0x1C, 0xE4, 0xB6, 0x42, 0x13, 0xB9, 0x78, 0xD4, 0x95, 0x79, 0x11, 0x87, 0xB8, 0xD8, - 0x38, 0xBF, 0x78, 0x7B, 0xDC, 0xD3, 0xDE, 0xBC, 0xEF, 0xF5, 0x4F, 0x3A, 0xC3, 0x23, 0xFE, 0x5B, - 0x3A, 0x26, 0x24, 0x57, 0xF2, 0x77, 0xFA, 0x19, 0xFB, 0xD6, 0x95, 0xF6, 0x25, 0xF3, 0x13, 0xFD, - 0xD8, 0x20, 0x44, 0xCB, 0x46, 0x33, 0xC7, 0xBD, 0x1A, 0x68, 0x8F, 0x03, 0x98, 0xF3, 0xF0, 0x05, - 0x76, 0x17, 0x98, 0x38, 0x26, 0x3A, 0x0C, 0x91, 0x17, 0xB6, 0x42, 0x1C, 0x38, 0xF6, 0x4F, 0x2B, - 0x84, 0x63, 0x64, 0x7E, 0x9E, 0x04, 0x7E, 0xE4, 0x59, 0x03, 0xED, 0x4E, 0xF7, 0x94, 0xFE, 0xAD, - 0x0E, 0x32, 0x7D, 0xD7, 0x0F, 0xE0, 0xFC, 0xF9, 0x33, 0xFA, 0xB7, 0x7A, 0x9E, 0xCD, 0x1E, 0x3A, - 0xFF, 0xE0, 0x81, 0xD6, 0x3D, 0x99, 0x5F, 0x66, 0xCE, 0x5F, 0xDF, 0xCA, 0x7C, 0x9D, 0xF6, 0x8A, - 0xA4, 0x17, 0xF4, 0xA7, 0xE5, 0xF4, 0x21, 0x36, 0x89, 0xE3, 0x7B, 0xED, 0x19, 0x72, 0x3C, 0x05, - 0x27, 0xCB, 0x09, 0xE7, 0x2E, 0x02, 0x1B, 0xD8, 0x2E, 0x2E, 0xE5, 0x73, 0x67, 0x86, 0xBD, 0xE8, - 0xB0, 0x82, 0x1B, 0x65, 0xD2, 0xB2, 0x9C, 0x80, 0x8F, 0x1A, 0x50, 0x3B, 0x44, 0x33, 0xAF, 0x92, - 0x6D, 0x99, 0x5C, 0x9E, 0xEF, 0x61, 0x85, 0x01, 0xE9, 0x44, 0xCB, 0x00, 0xCD, 0xE9, 0x00, 0xFA, - 0xEF, 0xEA, 0x90, 0x99, 0xE3, 0x71, 0xA7, 0x1A, 0x68, 0xC7, 0xFD, 0xCE, 0xFC, 0xB2, 0x02, 0xCA, - 0xE3, 0x13, 0xFA, 0xB7, 0x3A, 0x68, 0x8E, 0x2C, 0xCB, 0xF1, 0x26, 0x03, 0xED, 0x54, 0xC9, 0xC2, - 0x0F, 0x2C, 0x1C, 0xB4, 0x02, 0x64, 0x39, 0x51, 0x38, 0xD0, 0xFA, 0xAA, 0x31, 0x33, 0x14, 0x4C, - 0x40, 0x16, 0xE2, 0x83, 0xB0, 0xAD, 0xAE, 0x52, 0x12, 0x31, 0x24, 0x70, 0x26, 0x53, 0x02, 0x90, - 0xAE, 0x8C, 0xC9, 0x1B, 0x4D, 0x84, 0x50, 0x15, 0x9E, 0xA5, 0x76, 0x53, 0x5B, 0x0D, 0xB9, 0xCE, - 0xC4, 0x6B, 0x39, 0x04, 0xCF, 0x40, 0x9D, 0x90, 0x04, 0x98, 0x98, 0xD3, 0x32, 0x51, 0x6C, 0x67, - 0x12, 0x05, 0x58, 0x21, 0x48, 0x62, 0xB7, 0x12, 0x85, 0xE1, 0xE4, 0xEA, 0xA9, 0xD6, 0x12, 0x8F, - 0x3F, 0x3B, 0xA4, 0x25, 0x6C, 0x32, 0xC6, 0xB6, 0x1F, 0x60, 0xE5, 0xC8, 0x78, 0x84, 0xEB, 0x9B, - 0x9F, 0x5B, 0x21, 0x41, 0x01, 0xA9, 0xC3, 0x10, 0xD9, 0x04, 0x07, 0xD5, 0xFC, 0x30, 0xF5, 0x8A, - 0x6A, 0x6E, 0xC5, 0xD3, 0x8A, 0x01, 0x8E, 0xE7, 0x3A, 0x1E, 0xAE, 0x2F, 0x5E, 0xD1, 0xBC, 0x59, - 0x76, 0x7C, 0x54, 0x0D, 0x60, 0x9C, 0xD9, 0xA4, 0xCC, 0x4B, 0x98, 0xAE, 0xAB, 0x93, 0x89, 0xB8, - 0xE9, 0x76, 0x3A, 0x3F, 0xAC, 0x9E, 0x9C, 0x62, 0xEE, 0xA6, 0x28, 0x22, 0xFE, 0xF6, 0x11, 0xB1, - 0x12, 0x56, 0x39, 0x3D, 0xFE, 0x35, 0xC3, 0x96, 0x83, 0xB4, 0x86, 0x14, 0xCE, 0xA7, 0x1D, 0xF0, - 0xA9, 0xA6, 0x86, 0x3C, 0x4B, 0x6B, 0xF8, 0x81, 0x03, 0x81, 0x80, 0x58, 0xBA, 0x71, 0xE1, 0x17, - 0x28, 0x1C, 0x73, 0xDC, 0x54, 0xA8, 0x5C, 0x12, 0x33, 0xB2, 0x45, 0xD4, 0x61, 0x43, 0x3F, 0x35, - 0x52, 0x0E, 0xFD, 0x54, 0x06, 0x90, 0x42, 0x47, 0xC6, 0xBE, 0x0C, 0x2F, 0x59, 0xC2, 0x22, 0xCC, - 0xE8, 0x67, 0x86, 0x2E, 0x5B, 0xA5, 0xD8, 0xC5, 0x83, 0x62, 0x0C, 0xA1, 0xCC, 0x9A, 0x0D, 0x18, - 0xBA, 0x98, 0x6A, 0x2D, 0x8D, 0x66, 0xC9, 0xA6, 0x9A, 0x46, 0x30, 0x55, 0x43, 0x4E, 0x3F, 0xB2, - 0x53, 0xAC, 0xA1, 0xAE, 0x5A, 0xD5, 0x34, 0x77, 0xF0, 0x3F, 0x95, 0x0F, 0x71, 0x4D, 0x0A, 0xB3, - 0x08, 0xFD, 0xD4, 0xCF, 0x24, 0x29, 0xB3, 0xCA, 0x6C, 0xA2, 0x60, 0x5C, 0x9C, 0x51, 0x56, 0xF8, - 0x16, 0x45, 0xB7, 0x82, 0x6B, 0xB9, 0x08, 0x75, 0xB3, 0x8B, 0x82, 0x71, 0x99, 0x0C, 0x95, 0x59, - 0x86, 0x7E, 0xAE, 0x6B, 0xF4, 0x1B, 0x77, 0xC6, 0x11, 0x21, 0xBE, 0x17, 0x6E, 0x55, 0xA2, 0x8A, - 0xE2, 0xEC, 0xAF, 0x28, 0x24, 0x8E, 0x7D, 0xD5, 0x12, 0x21, 0x0D, 0x71, 0x36, 0x47, 0xD0, 0x42, - 0x8E, 0x31, 0x59, 0x62, 0x5C, 0xDE, 0x6E, 0x78, 0x68, 0x01, 0x79, 0x67, 0x32, 0x71, 0x55, 0xBE, - 0x67, 0x46, 0x41, 0x48, 0xFB, 0xB6, 0xB9, 0xEF, 0x00, 0xE3, 0x60, 0x75, 0xE2, 0x6C, 0x0C, 0xD6, - 0x9C, 0xA8, 0x65, 0x8E, 0x15, 0x73, 0xF9, 0x11, 0xA1, 0x36, 0x56, 0x22, 0xE1, 0x83, 0x3A, 0x0E, - 0xB9, 0x52, 0x9E, 0x13, 0x91, 0xA8, 0x38, 0x13, 0x87, 0x60, 0x69, 0x59, 0xC8, 0xCA, 0x35, 0x30, - 0xA7, 0xD8, 0xFC, 0x8C, 0xAD, 0x1F, 0x2B, 0xDB, 0xB0, 0xAA, 0xF6, 0xB0, 0xED, 0x78, 0xF3, 0x88, - 0xB4, 0x68, 0x3B, 0x35, 0xBF, 0x11, 0xCC, 0x99, 0x43, 0xC6, 0x2A, 0xF6, 0x7A, 0x65, 0x4D, 0xC5, - 0xFD, 0xF9, 0x65, 0xB9, 0x11, 0x64, 0x61, 0x0D, 0x17, 0x8D, 0xB1, 0x5B, 0x26, 0xB2, 0x08, 0x86, - 0x82, 0xB4, 0x2B, 0x72, 0x55, 0x71, 0xEF, 0xC6, 0x24, 0x4B, 0x8B, 0x57, 0xFF, 0xC1, 0x0F, 0xB5, - 0xED, 0xC8, 0x8E, 0x0F, 0x33, 0x3F, 0x85, 0xD8, 0x85, 0x00, 0x2B, 0x6A, 0xBD, 0x61, 0xCC, 0x12, - 0x64, 0x28, 0x9D, 0x20, 0x40, 0xDE, 0x04, 0x43, 0x2E, 0xB8, 0x3C, 0x8C, 0x0F, 0xCB, 0x17, 0x06, - 0xB5, 0xD4, 0xA7, 0xA9, 0xFA, 0x7E, 0xF9, 0x42, 0x84, 0x27, 0x84, 0x0D, 0x9A, 0x11, 0x09, 0xD6, - 0xD2, 0xF9, 0xBB, 0x4A, 0xA7, 0xE0, 0xFD, 0x88, 0x32, 0x60, 0xB2, 0x2E, 0xA5, 0xEC, 0xEF, 0x2B, - 0x33, 0x42, 0xBC, 0xD2, 0xB3, 0xED, 0xAA, 0xB5, 0xA2, 0x6D, 0x1F, 0x77, 0x8E, 0xFB, 0x95, 0x0D, - 0x93, 0x52, 0xCB, 0xDC, 0x7A, 0x51, 0x91, 0x31, 0x92, 0x6C, 0x52, 0x0D, 0xC1, 0x60, 0xEA, 0x2F, - 0x70, 0xA0, 0x00, 0x22, 0x27, 0x6E, 0xFF, 0x61, 0xDF, 0xAA, 0xC1, 0x0D, 0x41, 0xBE, 0x5F, 0xA8, - 0xB2, 0x69, 0x96, 0x5D, 0xAF, 0x6B, 0xF6, 0x4A, 0x1D, 0x93, 0xB3, 0x6B, 0x83, 0x37, 0xA0, 0xB1, - 0x8B, 0xAD, 0x92, 0xF4, 0x6C, 0x61, 0x1B, 0x45, 0x2E, 0xA9, 0xB0, 0x37, 0xEA, 0xD0, 0xBF, 0xB2, - 0x19, 0x59, 0x5C, 0xFD, 0x41, 0x37, 0x3A, 0x46, 0x2C, 0x12, 0xFE, 0x54, 0xCC, 0x19, 0xD7, 0x4E, - 0x34, 0x9F, 0x63, 0x04, 0xA3, 0x4C, 0x5C, 0xB4, 0x24, 0xAD, 0xD5, 0x33, 0xAB, 0x13, 0x57, 0xAD, - 0x85, 0x68, 0xA5, 0x2B, 0x26, 0xDD, 0xD0, 0x5A, 0x3A, 0x0F, 0x6C, 0xDF, 0x8C, 0x54, 0x65, 0xBA, - 0x9E, 0x4B, 0xAD, 0xF2, 0x1B, 0xC4, 0x26, 0x0B, 0x5D, 0x87, 0x39, 0x76, 0xE4, 0x79, 0x14, 0xD1, - 0x16, 0x09, 0x40, 0x4D, 0xC5, 0x44, 0xF5, 0x0C, 0xB7, 0x51, 0x74, 0x66, 0x0C, 0x5B, 0xB4, 0x19, - 0x93, 0x0B, 0x40, 0x45, 0xA2, 0x48, 0x72, 0x88, 0x16, 0xFA, 0xA0, 0x54, 0xCC, 0x6A, 0x3B, 0xBB, - 0x90, 0x69, 0x34, 0x53, 0x35, 0x06, 0xF1, 0x64, 0x5D, 0xA8, 0x62, 0x7C, 0xBA, 0x60, 0x32, 0x46, - 0x8D, 0xCE, 0x61, 0xE7, 0xF0, 0x18, 0xFE, 0xA3, 0x68, 0xD0, 0xCB, 0x9D, 0x4B, 0x98, 0xB7, 0xC0, - 0xF3, 0x72, 0xC9, 0xA7, 0x7A, 0x9F, 0xA4, 0x28, 0x8D, 0x55, 0x62, 0x51, 0x3F, 0x92, 0xB2, 0x1B, - 0x26, 0xDD, 0x76, 0x45, 0x61, 0x29, 0x70, 0xE9, 0xF5, 0x1D, 0x51, 0xE1, 0x2D, 0xEB, 0x42, 0x3C, - 0xF3, 0xFF, 0x69, 0xF1, 0xAA, 0xFA, 0x7F, 0xEF, 0xED, 0x92, 0x29, 0xBE, 0x6B, 0x4F, 0x5F, 0xDB, - 0x2E, 0xE1, 0xBE, 0x7D, 0xA3, 0x53, 0x8C, 0x7A, 0x4B, 0xF4, 0x33, 0x20, 0xA1, 0x07, 0x8B, 0xAA, - 0x00, 0x56, 0x57, 0x85, 0x3D, 0x8F, 0x34, 0x66, 0x03, 0x1B, 0xD8, 0x8E, 0xEB, 0xB6, 0x5C, 0x7F, - 0x59, 0xDD, 0x89, 0x94, 0x7B, 0xF2, 0x8A, 0x9F, 0x56, 0xBB, 0xFC, 0xA6, 0xD2, 0x46, 0x90, 0xB9, - 0xFE, 0x27, 0xA4, 0xFD, 0xBE, 0x03, 0xAE, 0x34, 0x34, 0x36, 0x2B, 0x14, 0x1B, 0xF8, 0xE3, 0x76, - 0x13, 0xD5, 0x72, 0x25, 0xDE, 0x09, 0x96, 0x2E, 0xE6, 0xC2, 0xA5, 0x43, 0xCC, 0xE9, 0x06, 0x8B, - 0xAA, 0xB9, 0x1F, 0x3A, 0xFC, 0x1A, 0x4D, 0x80, 0x5D, 0x44, 0x3B, 0xF8, 0x8D, 0x96, 0xDC, 0x95, - 0x0B, 0x13, 0x99, 0xBC, 0x8E, 0x26, 0xCC, 0x74, 0xDF, 0xCE, 0x76, 0x49, 0x9B, 0xF7, 0x0E, 0xC5, - 0xB9, 0x5A, 0xED, 0xD6, 0x15, 0xED, 0x7E, 0x36, 0x32, 0xD4, 0x83, 0xD6, 0xC8, 0xE8, 0x71, 0xD2, - 0x9E, 0x04, 0xF8, 0xAA, 0x86, 0x32, 0x87, 0xE2, 0xDF, 0x01, 0xDF, 0x10, 0xDD, 0x7C, 0xED, 0xCF, - 0x0A, 0x80, 0xF0, 0xA2, 0x76, 0x3F, 0xAC, 0x31, 0x75, 0xF1, 0x94, 0x75, 0xFC, 0x31, 0xD9, 0xEE, - 0xD3, 0xF5, 0x1A, 0xE9, 0xA6, 0xA4, 0x84, 0xAA, 0x5D, 0x35, 0xAE, 0xBE, 0xCA, 0x93, 0x2E, 0xB6, - 0x49, 0xC1, 0xD5, 0x0C, 0xD6, 0xA7, 0x1E, 0x97, 0x67, 0xB7, 0x96, 0xB4, 0x4F, 0x50, 0x99, 0x39, - 0x92, 0x5D, 0xB9, 0x62, 0xEF, 0x53, 0x72, 0xA6, 0xD9, 0x73, 0x6D, 0xE6, 0xC5, 0x90, 0xC4, 0xED, - 0x33, 0x83, 0x19, 0xC6, 0xCC, 0x44, 0xC9, 0x07, 0x78, 0xF0, 0xEF, 0x8D, 0xDE, 0x89, 0xF2, 0x62, - 0x41, 0xC9, 0xE0, 0x32, 0xD1, 0x0A, 0xB7, 0xB5, 0x56, 0x4B, 0x56, 0xE1, 0x02, 0x59, 0xCE, 0x45, - 0x4A, 0xA0, 0xCA, 0xA3, 0xB2, 0x2C, 0xC3, 0xAC, 0xEE, 0xD1, 0x94, 0x3A, 0xBB, 0x33, 0x43, 0xD0, - 0xF6, 0x52, 0x77, 0x45, 0xC0, 0x51, 0x85, 0x5F, 0x1D, 0x77, 0x97, 0x36, 0x0D, 0xBB, 0x27, 0x9D, - 0x8A, 0x29, 0x4D, 0xD7, 0x0F, 0xCB, 0xE3, 0x0A, 0x8D, 0xC1, 0x7E, 0x11, 0x51, 0x4C, 0x24, 0xB6, - 0x2E, 0x95, 0x3B, 0x4F, 0xCC, 0xB9, 0x95, 0x67, 0x6A, 0x95, 0xEE, 0xD2, 0x98, 0x2A, 0x0F, 0xC7, - 0x9C, 0xCD, 0xBB, 0x1D, 0x65, 0xA6, 0x2D, 0xDD, 0x7F, 0x23, 0xF8, 0x12, 0xD6, 0x9B, 0xF4, 0x82, - 0xDC, 0x40, 0x33, 0xB1, 0x3A, 0x8D, 0x66, 0x8A, 0x5C, 0xB7, 0xCE, 0x26, 0x60, 0x29, 0x0E, 0x53, - 0xC7, 0xB2, 0x70, 0xE9, 0x2E, 0x27, 0x5D, 0xF3, 0xE6, 0x58, 0xC4, 0x47, 0xC3, 0x23, 0xE9, 0x06, - 0x96, 0xE1, 0x51, 0x7A, 0xAF, 0xCD, 0x90, 0xDE, 0xC5, 0x22, 0xDF, 0xE7, 0xC2, 0x2F, 0xB2, 0x68, - 0xA6, 0x8B, 0xC2, 0x70, 0xA4, 0xD3, 0xBB, 0x31, 0xF4, 0xEC, 0x6D, 0x2F, 0x43, 0xCB, 0x59, 0x68, - 0x8E, 0x35, 0xD2, 0x5D, 0x7F, 0xE2, 0xE7, 0xCE, 0xB1, 0xF3, 0x7C, 0xDB, 0x1B, 0x22, 0x75, 0xA4, - 0x67, 0x2E, 0x09, 0xE8, 0x8C, 0x2A, 0xFD, 0x49, 0x37, 0xEE, 0xDD, 0x79, 0xF8, 0xE0, 0xC1, 0xC9, - 0x4F, 0xF7, 0xBC, 0x71, 0x38, 0x17, 0xFF, 0xFD, 0x95, 0x5F, 0x41, 0x79, 0xF3, 0xBE, 0x77, 0xD2, - 0x87, 0x86, 0x16, 0x13, 0xE2, 0x78, 0x93, 0x70, 0x78, 0xC4, 0x98, 0xE6, 0x04, 0x39, 0x02, 0x49, - 0x0A, 0x64, 0x13, 0x09, 0x5D, 0x25, 0x5E, 0x3C, 0x24, 0x84, 0x1C, 0x35, 0x46, 0x81, 0x62, 0x08, - 0x1B, 0xC6, 0xDB, 0x05, 0xD6, 0x69, 0xE9, 0x2C, 0xB1, 0x8D, 0xFD, 0xCB, 0xBC, 0x06, 0x4C, 0x29, - 0x91, 0xF5, 0xC4, 0x28, 0x6C, 0x15, 0x31, 0x04, 0x32, 0x46, 0x4E, 0xAF, 0x87, 0x14, 0x8C, 0x49, - 0xE4, 0x13, 0xD6, 0x97, 0xB6, 0xE7, 0xF9, 0xD4, 0x76, 0x80, 0x66, 0x98, 0x26, 0x22, 0xF1, 0x63, - 0x31, 0x9B, 0x3C, 0x12, 0x09, 0xA5, 0x6E, 0xBC, 0xC3, 0x2C, 0x5C, 0x01, 0x65, 0xA5, 0x59, 0x57, - 0xB8, 0x88, 0x0C, 0x9A, 0x99, 0x5F, 0x8F, 0x45, 0x14, 0x3B, 0xA6, 0x2D, 0xC4, 0xDC, 0xA6, 0x42, - 0x20, 0xC6, 0xCE, 0x9F, 0x33, 0x07, 0x5B, 0x20, 0x37, 0x02, 0xD3, 0x76, 0x3B, 0xBA, 0xF1, 0xDB, - 0xEF, 0xCF, 0x1F, 0x37, 0x20, 0x11, 0x75, 0x2E, 0xBB, 0xBD, 0x4E, 0xA7, 0x39, 0x3C, 0xE2, 0x43, - 0xD6, 0xE6, 0xF5, 0x50, 0x37, 0x2E, 0x18, 0xAB, 0xDE, 0x29, 0xB0, 0xEA, 0xF4, 0xFA, 0x9B, 0xB3, - 0x3A, 0xD5, 0x0D, 0xC6, 0x09, 0x98, 0x5C, 0x3E, 0x38, 0x39, 0xDD, 0x9C, 0xD1, 0x03, 0x90, 0xE9, - 0x3D, 0x70, 0x3A, 0x05, 0xED, 0x4E, 0xB6, 0x51, 0xEE, 0x44, 0x37, 0x28, 0x1F, 0x88, 0x8A, 0xCB, - 0xFE, 0xE9, 0x16, 0x7C, 0xEE, 0xEB, 0xA2, 0x24, 0x52, 0x97, 0x8D, 0x8F, 0x74, 0xE3, 0xEC, 0xE7, - 0x67, 0x8D, 0x3E, 0xC8, 0xD8, 0x7B, 0x78, 0xB2, 0x39, 0xEF, 0xBE, 0x6E, 0xFC, 0x42, 0x85, 0x3C, - 0xEE, 0x01, 0xA3, 0xFE, 0x16, 0x42, 0x1E, 0xEB, 0xC6, 0x0B, 0xC6, 0x09, 0xB8, 0x5C, 0x76, 0x1F, - 0x6C, 0x21, 0x12, 0xB8, 0xD7, 0x2F, 0x8C, 0x13, 0xF8, 0x17, 0x75, 0xAF, 0x9A, 0x9C, 0x20, 0x5F, - 0x32, 0xD3, 0x94, 0xC4, 0xE9, 0x6A, 0xF6, 0xC9, 0x9C, 0x2E, 0x0B, 0xE3, 0xBF, 0x23, 0x28, 0x1D, - 0xE4, 0x6A, 0xED, 0x20, 0x16, 0x74, 0xA0, 0x12, 0x3F, 0xA8, 0x17, 0xBF, 0x92, 0x24, 0xC9, 0x65, - 0x39, 0xDD, 0xE8, 0x76, 0x2A, 0x34, 0x60, 0xB4, 0x72, 0x16, 0x64, 0xC4, 0x19, 0x05, 0x74, 0xDA, - 0x49, 0xB0, 0x18, 0xA6, 0xB7, 0x7E, 0x80, 0x8F, 0x1E, 0xEB, 0x52, 0x5C, 0x6F, 0x94, 0x22, 0x14, - 0xD2, 0xA2, 0x4B, 0xDD, 0x38, 0x39, 0xAE, 0xB2, 0xF7, 0x16, 0x70, 0x8C, 0x59, 0x9B, 0xE2, 0xE1, - 0x30, 0x5C, 0x1B, 0x91, 0x94, 0x54, 0x37, 0x9E, 0x24, 0xC7, 0xDB, 0xE0, 0xD2, 0xEA, 0x6D, 0x81, - 0x8B, 0x24, 0x0E, 0x87, 0xA6, 0xD5, 0x13, 0xD0, 0xF4, 0xF4, 0x34, 0x22, 0xBE, 0x26, 0x30, 0x55, - 0xD2, 0x6E, 0x83, 0x0B, 0x2D, 0xE2, 0x01, 0x0A, 0xC9, 0xDA, 0xA8, 0xC4, 0x84, 0x90, 0xD6, 0xC4, - 0xD1, 0xDE, 0x10, 0x49, 0x44, 0xF9, 0x0E, 0xF0, 0x08, 0x11, 0x89, 0x02, 0x76, 0x43, 0xDC, 0xDA, - 0x88, 0xA4, 0xA4, 0x50, 0x0F, 0x93, 0xE3, 0xBD, 0xA1, 0x22, 0x89, 0xF3, 0x3D, 0xE0, 0x32, 0xC7, - 0xA6, 0x83, 0xDC, 0x8F, 0xD8, 0xB6, 0xA1, 0x64, 0xAD, 0x8F, 0x4D, 0x86, 0x1C, 0xF0, 0xE1, 0xDF, - 0xB5, 0x73, 0xF6, 0x7D, 0xED, 0x1E, 0x31, 0xC7, 0xEE, 0x6B, 0x35, 0x8A, 0x1D, 0x75, 0xDF, 0xF2, - 0xDA, 0x4F, 0xE4, 0xDC, 0xB0, 0x43, 0xE8, 0x02, 0x13, 0x3C, 0x61, 0x2B, 0xE5, 0x8D, 0x79, 0xF4, - 0x74, 0xE3, 0x79, 0x80, 0xAE, 0xD8, 0xB3, 0x05, 0xDB, 0x34, 0x3D, 0xEF, 0xB0, 0xA5, 0xFD, 0x0A, - 0x4B, 0xC1, 0x6D, 0x3A, 0xB0, 0xE7, 0x01, 0x86, 0x65, 0xE2, 0x56, 0x5C, 0xEE, 0x43, 0x31, 0x83, - 0x83, 0xED, 0x98, 0x40, 0xC3, 0x7A, 0x81, 0xE7, 0x0E, 0xFA, 0x16, 0x1A, 0x2E, 0xB4, 0x1C, 0xAF, - 0x1D, 0x16, 0x40, 0xA3, 0x1B, 0x8F, 0x3F, 0x3C, 0x59, 0x3B, 0x49, 0xF1, 0xFD, 0xE6, 0x3A, 0x1E, - 0xCE, 0xB3, 0x93, 0x10, 0x50, 0x5F, 0x59, 0x6C, 0xAA, 0x23, 0xA7, 0xEE, 0x82, 0x53, 0xA1, 0x57, - 0x2C, 0x20, 0xDB, 0x9E, 0xD3, 0x25, 0x35, 0xEB, 0xE9, 0x78, 0x73, 0x19, 0x0C, 0x84, 0xF8, 0x38, - 0x41, 0xCE, 0xFA, 0x75, 0x25, 0x26, 0x64, 0x48, 0x69, 0xCF, 0xE1, 0x68, 0x57, 0x70, 0xF1, 0x69, - 0xF7, 0x86, 0x99, 0xD0, 0x7A, 0xDF, 0xC0, 0x81, 0x20, 0x33, 0xDF, 0x5A, 0x7F, 0x3B, 0x42, 0xD0, - 0xE9, 0x06, 0xA0, 0xF6, 0x0A, 0x0E, 0xD6, 0xAE, 0x32, 0x31, 0x83, 0x1B, 0x2E, 0x2F, 0x8F, 0x23, - 0xE2, 0x6F, 0x53, 0x59, 0x2E, 0x22, 0xCF, 0xBB, 0xDA, 0xA6, 0xAC, 0x9C, 0xB9, 0x7E, 0x64, 0x6D, - 0xCE, 0x01, 0x6A, 0xCA, 0x1B, 0xDB, 0x76, 0xCC, 0xCD, 0xAB, 0x12, 0x54, 0x94, 0x17, 0xFE, 0xAC, - 0x26, 0xFD, 0x0D, 0x67, 0x71, 0x6C, 0xAE, 0x9F, 0x20, 0xB0, 0x09, 0x28, 0x9E, 0x9F, 0x69, 0x17, - 0xE7, 0xAF, 0x2F, 0xDE, 0xBC, 0xDB, 0x4D, 0x76, 0x80, 0x39, 0xF7, 0x94, 0x18, 0xA8, 0xB6, 0xFB, - 0xCE, 0x09, 0x20, 0x44, 0x6F, 0x13, 0x9C, 0x7A, 0x1C, 0xA8, 0xA7, 0x17, 0x6F, 0x77, 0x85, 0x52, - 0x6F, 0x7F, 0x30, 0xF5, 0xBE, 0x05, 0x9C, 0x3E, 0xBA, 0x78, 0x81, 0xDD, 0x0D, 0xB0, 0xE2, 0x84, - 0x14, 0x2F, 0xED, 0x25, 0x3D, 0xDA, 0xDB, 0x42, 0x2E, 0x11, 0xE5, 0x3B, 0x58, 0xC6, 0x81, 0x57, - 0x7C, 0x64, 0x42, 0x6F, 0x12, 0x3C, 0x9C, 0x52, 0x37, 0xCE, 0x2F, 0xE7, 0x7E, 0x18, 0x05, 0x35, - 0x0B, 0xAA, 0x1A, 0x91, 0x6D, 0x76, 0x06, 0x53, 0x51, 0x38, 0x22, 0xF1, 0xD6, 0x20, 0xDD, 0xD9, - 0x4F, 0x30, 0xE9, 0x75, 0xFA, 0x5F, 0x15, 0x15, 0xCA, 0xFC, 0x26, 0x81, 0x99, 0x6C, 0x50, 0x77, - 0x26, 0xB4, 0xEE, 0x3C, 0x3F, 0xDB, 0x4D, 0x2A, 0x9B, 0xEC, 0xAD, 0xE0, 0x4C, 0xF6, 0x5A, 0x70, - 0x34, 0x7E, 0x51, 0x34, 0x81, 0x69, 0xC3, 0x45, 0x84, 0x20, 0x84, 0xB5, 0xF3, 0x26, 0x0B, 0x08, - 0x79, 0x53, 0xFD, 0x72, 0x9B, 0xD0, 0x89, 0xC5, 0xC8, 0x46, 0xCE, 0x71, 0x1A, 0x37, 0xF7, 0xBF, - 0x6A, 0xD4, 0x1C, 0x57, 0x4A, 0xBB, 0x4D, 0xD0, 0x50, 0x4D, 0x4C, 0xEC, 0xB8, 0xF4, 0x09, 0xA6, - 0x75, 0x01, 0x91, 0x68, 0x39, 0x26, 0xDA, 0x19, 0xFF, 0xB6, 0x0D, 0x36, 0xBD, 0x6D, 0xB0, 0x91, - 0x25, 0xCA, 0xC2, 0x73, 0x72, 0x43, 0x95, 0xA6, 0xDB, 0x3B, 0xBD, 0x49, 0x78, 0xC6, 0xF3, 0xF5, - 0x73, 0x1A, 0xD0, 0xE8, 0xC6, 0x93, 0xB7, 0xBB, 0xC9, 0x69, 0x74, 0xB2, 0x9A, 0x39, 0x6D, 0xAB, - 0x0C, 0xC6, 0x94, 0xDA, 0x77, 0x2B, 0xB6, 0xDC, 0x00, 0x8D, 0x25, 0x15, 0xFC, 0xC3, 0x8E, 0xD0, - 0x58, 0xD6, 0x47, 0xE3, 0x2B, 0x57, 0x98, 0xE5, 0xB7, 0x80, 0x4F, 0x80, 0x96, 0x1F, 0x27, 0x33, - 0xB4, 0x36, 0x46, 0x82, 0x4E, 0x37, 0xDE, 0xA1, 0xA5, 0xF6, 0xFC, 0xD5, 0xE3, 0x9D, 0x60, 0x15, - 0x4F, 0xBA, 0x1F, 0xBC, 0x12, 0x95, 0xF7, 0x8D, 0x99, 0x8B, 0xBD, 0xF5, 0x83, 0x8A, 0x12, 0xE9, - 0xC6, 0x4B, 0xEC, 0x85, 0xDA, 0x99, 0x1F, 0x88, 0xB7, 0xCD, 0xEC, 0x04, 0x35, 0x36, 0xF3, 0x7E, - 0x20, 0xE3, 0x4A, 0xEF, 0x1B, 0xAF, 0xE9, 0xCC, 0x09, 0x02, 0x3F, 0x58, 0x1B, 0x32, 0x41, 0xA7, - 0x1B, 0x2F, 0x5A, 0xAF, 0xD8, 0xD1, 0x4E, 0xE0, 0x8A, 0x67, 0xDD, 0x0F, 0x62, 0x89, 0xCE, 0xFB, - 0x06, 0x6D, 0x61, 0xBB, 0xCE, 0x7C, 0x6D, 0xC8, 0x18, 0x95, 0x6E, 0xBC, 0x6F, 0x3D, 0x83, 0x7F, - 0x77, 0x02, 0x17, 0x9F, 0x71, 0x3F, 0x60, 0x09, 0x6D, 0xF7, 0x0D, 0x95, 0x65, 0x2E, 0xD7, 0x06, - 0x0A, 0x68, 0x74, 0xE3, 0xE9, 0xD9, 0x07, 0xAD, 0xF1, 0xD4, 0x5F, 0x7A, 0xF4, 0xC6, 0x3F, 0xED, - 0xFC, 0x75, 0x73, 0x27, 0x88, 0xD1, 0xA9, 0xF7, 0x83, 0x17, 0x53, 0x7A, 0xDF, 0x68, 0xB1, 0xBB, - 0x8F, 0xC7, 0x68, 0xFD, 0x74, 0x18, 0x13, 0xD2, 0x7B, 0x5F, 0xE0, 0x48, 0x7B, 0x82, 0x76, 0x93, - 0x10, 0x93, 0x79, 0x77, 0xD1, 0xB4, 0xA7, 0x4A, 0xEE, 0x1B, 0x27, 0x1B, 0x99, 0xF8, 0xA3, 0x85, - 0xC9, 0x26, 0x37, 0x5E, 0x48, 0xB4, 0xBA, 0xF1, 0x0C, 0xBE, 0x68, 0x4F, 0xD9, 0x97, 0x5D, 0xB5, - 0x1C, 0xF2, 0xFC, 0xBB, 0x40, 0x2D, 0xA3, 0xEF, 0x37, 0x01, 0x1C, 0x34, 0x78, 0xFE, 0xC4, 0xDB, - 0xE8, 0x7E, 0xEA, 0x0C, 0xB9, 0x80, 0xEF, 0x1D, 0xFF, 0xBE, 0x5B, 0x00, 0x53, 0x21, 0x76, 0x86, - 0xA1, 0xA4, 0xF7, 0x2E, 0x60, 0x8C, 0x9F, 0x49, 0x60, 0xDB, 0x02, 0xFC, 0xE5, 0x4F, 0x55, 0x48, - 0x89, 0x57, 0xC2, 0xB0, 0xAD, 0x1B, 0x4C, 0x5A, 0x21, 0x71, 0x5C, 0x57, 0x37, 0x9E, 0x63, 0xA2, - 0x5D, 0xD0, 0xC3, 0xE1, 0x11, 0x1F, 0x50, 0x9F, 0x8B, 0xB8, 0xE1, 0x9F, 0xBE, 0x76, 0x0D, 0xCD, - 0x74, 0xE3, 0x82, 0xBE, 0x16, 0x0B, 0x78, 0xD1, 0x6F, 0xEB, 0x33, 0x63, 0x46, 0xC4, 0x5E, 0xE0, - 0x83, 0x50, 0x09, 0x48, 0xE2, 0xED, 0x24, 0xBA, 0x16, 0x1F, 0x49, 0xBF, 0x19, 0xE7, 0x6C, 0xB0, - 0x46, 0xBD, 0xAC, 0x7A, 0x3A, 0x7A, 0x15, 0xD6, 0x2C, 0xBE, 0x58, 0x3B, 0x3C, 0xF2, 0x90, 0xC2, - 0xDC, 0x05, 0x28, 0x0C, 0xF9, 0xFB, 0xD4, 0x0A, 0x58, 0x25, 0x0F, 0x53, 0x30, 0x4B, 0xA4, 0x0F, - 0x26, 0x25, 0x6A, 0xE5, 0x1F, 0x58, 0x12, 0x1B, 0xB6, 0xF5, 0x82, 0x96, 0x3D, 0x7A, 0x24, 0xEA, - 0x21, 0x3D, 0x4C, 0xCC, 0xFF, 0x9F, 0x7F, 0x57, 0xF9, 0x0C, 0x7D, 0xDB, 0x5D, 0x2A, 0x98, 0xAE, - 0x85, 0x81, 0x39, 0xD2, 0x8B, 0x1E, 0xCD, 0x28, 0xD0, 0xFC, 0x48, 0xA5, 0x7A, 0x6E, 0xB0, 0xC2, - 0xD6, 0xC3, 0xD0, 0x0C, 0x9C, 0x39, 0x31, 0x6E, 0x59, 0xBE, 0x19, 0xCD, 0xB0, 0x47, 0xDA, 0xC8, - 0xB2, 0xCE, 0x17, 0x70, 0xF0, 0xD2, 0x09, 0x09, 0x06, 0x2B, 0x34, 0x0E, 0x9E, 0xBE, 0x79, 0x75, - 0xC6, 0x1F, 0x51, 0x79, 0xE9, 0x23, 0x0B, 0x5B, 0x07, 0x87, 0x9A, 0x1D, 0x79, 0xDC, 0xCD, 0x1B, - 0x98, 0x8E, 0xE5, 0x6F, 0x1A, 0x5C, 0xA0, 0x40, 0x1B, 0xA3, 0x10, 0xBF, 0xF0, 0x43, 0xA2, 0x8D, - 0xB4, 0x84, 0xA3, 0xEB, 0x9B, 0xEC, 0xF6, 0xC5, 0xB6, 0x1F, 0x38, 0x13, 0xC7, 0x13, 0x23, 0xB9, - 0xB2, 0xBF, 0x05, 0x2E, 0x0C, 0x4D, 0xA8, 0x7E, 0xD4, 0x0E, 0x06, 0xA7, 0xDD, 0x03, 0xFA, 0x34, - 0x11, 0xC0, 0x00, 0x3F, 0x00, 0x04, 0x18, 0x06, 0x40, 0x80, 0x8F, 0x0C, 0xF1, 0x38, 0x11, 0x76, - 0xDB, 0xCC, 0xE4, 0x54, 0x40, 0x2A, 0x6D, 0xE3, 0x80, 0xE3, 0x74, 0x40, 0x1F, 0xAD, 0xBB, 0x4E, - 0x28, 0xC3, 0xA9, 0xBF, 0x2C, 0xA3, 0x0C, 0xF0, 0xCC, 0x5F, 0xE0, 0x1C, 0x71, 0x42, 0x2D, 0xBC, - 0xB9, 0x72, 0xEA, 0xD8, 0xEB, 0x0F, 0x9A, 0xF1, 0x80, 0xE4, 0xCD, 0x3D, 0x23, 0x8D, 0x04, 0x11, - 0xCE, 0xB2, 0xC5, 0x5E, 0x15, 0xD7, 0x58, 0xAC, 0x52, 0xC6, 0x36, 0x72, 0xC3, 0x1C, 0xE7, 0x68, - 0x6E, 0x21, 0x82, 0xDF, 0xD3, 0xDD, 0x5D, 0x18, 0xD0, 0xC0, 0xEE, 0x21, 0xDF, 0xEA, 0x3D, 0x14, - 0x67, 0xDE, 0x01, 0x5F, 0x82, 0x9B, 0xE9, 0xAC, 0xF2, 0xCF, 0x40, 0x91, 0xFD, 0x3A, 0xD2, 0xBC, - 0x08, 0x42, 0xF8, 0x11, 0x53, 0x41, 0x1B, 0x64, 0xCE, 0x32, 0x6A, 0x17, 0xB2, 0x93, 0x78, 0x4B, - 0x31, 0x9B, 0x93, 0xFD, 0xE8, 0xD8, 0x74, 0xE2, 0x36, 0x7B, 0x67, 0xF2, 0x08, 0x78, 0x1C, 0xC4, - 0xD9, 0xFD, 0x20, 0x7D, 0x15, 0xA5, 0x4C, 0xC4, 0xEC, 0xD0, 0x16, 0x7D, 0xB0, 0x38, 0xBF, 0x10, - 0x27, 0x6E, 0xDF, 0x5E, 0x24, 0x7C, 0x35, 0x69, 0x18, 0x9C, 0x4A, 0x4F, 0x5C, 0xC3, 0x09, 0xE9, - 0x79, 0xBF, 0x55, 0xDE, 0x39, 0x1E, 0x31, 0x73, 0x89, 0xC3, 0xAD, 0x44, 0xF2, 0x8C, 0x05, 0xEE, - 0xDD, 0xCB, 0x72, 0xBB, 0x3D, 0x12, 0x54, 0xA9, 0x26, 0x7C, 0x3C, 0x44, 0x06, 0x44, 0x1E, 0xA8, - 0x2D, 0x9E, 0x02, 0x15, 0x22, 0x39, 0x76, 0xE3, 0x76, 0xC6, 0xF0, 0x89, 0x8C, 0x36, 0x35, 0x91, - 0x63, 0x31, 0x03, 0xB1, 0x7B, 0x20, 0x9A, 0xE9, 0x53, 0x72, 0x5C, 0xBE, 0x47, 0xCC, 0xEB, 0x1B, - 0x58, 0x5C, 0x1D, 0x6D, 0x82, 0xFD, 0xA9, 0x33, 0xA7, 0x3F, 0x88, 0xF1, 0xE9, 0x54, 0x32, 0xC7, - 0x49, 0x86, 0x23, 0x55, 0x2C, 0x27, 0x37, 0xFD, 0x30, 0x7E, 0xF4, 0x3A, 0x81, 0xB8, 0x56, 0x21, - 0x3F, 0x95, 0xCA, 0x26, 0x07, 0x36, 0xF4, 0x5A, 0x46, 0xFA, 0x7B, 0xCE, 0xD4, 0xC9, 0xC0, 0x02, - 0x26, 0x6C, 0x82, 0x55, 0x26, 0xA5, 0x92, 0xC7, 0x37, 0x8A, 0x29, 0x0C, 0xC2, 0xD8, 0x2D, 0xC7, - 0xD4, 0x14, 0x6C, 0x56, 0x38, 0x2C, 0x63, 0x95, 0x2B, 0xFC, 0x0A, 0x86, 0x3C, 0x10, 0x1B, 0xBC, - 0xAE, 0x3D, 0x61, 0x35, 0x8A, 0x32, 0x17, 0x31, 0x96, 0xFD, 0xFD, 0x96, 0x2C, 0xFC, 0x75, 0x1C, - 0x76, 0x49, 0x0A, 0x94, 0xFD, 0x80, 0xFA, 0x7F, 0x6C, 0x69, 0x1A, 0x22, 0xA9, 0xA3, 0x89, 0x07, - 0xFB, 0xE3, 0xF8, 0x48, 0xE1, 0x30, 0x21, 0xF7, 0x49, 0x91, 0x32, 0xC8, 0x89, 0x2A, 0x87, 0x08, - 0xC8, 0xDD, 0xD5, 0xE4, 0x47, 0xF5, 0xC7, 0x90, 0x42, 0x3F, 0x67, 0xF8, 0xB0, 0x8B, 0x32, 0x09, - 0x13, 0xFE, 0x1B, 0xBF, 0xCD, 0xA9, 0xE5, 0x7B, 0x58, 0xCD, 0x5D, 0x0E, 0x12, 0x15, 0x4F, 0x5E, - 0xC2, 0xF3, 0x4C, 0xA3, 0xF1, 0xCC, 0x21, 0x0A, 0x86, 0x07, 0x90, 0xBE, 0x55, 0xBC, 0x44, 0x63, - 0x97, 0x12, 0x04, 0x98, 0x44, 0x81, 0x27, 0x47, 0x21, 0xCF, 0x64, 0x7F, 0x47, 0x38, 0xB8, 0x02, - 0x46, 0x9F, 0xEE, 0x7E, 0x89, 0xEB, 0xC2, 0xF5, 0x11, 0x7B, 0x34, 0xC1, 0x77, 0x1F, 0x41, 0xE5, - 0x18, 0xDD, 0xFD, 0xC2, 0xA0, 0xBE, 0xBE, 0x07, 0x53, 0xC2, 0x17, 0x36, 0xF1, 0xF5, 0x27, 0xCE, - 0xC2, 0xA6, 0x2F, 0x9A, 0x6D, 0x30, 0x16, 0x31, 0x6E, 0x6D, 0x32, 0xC5, 0x5E, 0x23, 0xC0, 0xE1, - 0x1C, 0xD8, 0xE3, 0x34, 0x01, 0xC6, 0x33, 0xFA, 0x2E, 0x86, 0x12, 0x35, 0x69, 0x7C, 0x0A, 0x30, - 0xD0, 0x81, 0x00, 0xC4, 0xD7, 0xEE, 0x7E, 0x61, 0x2C, 0xAE, 0x35, 0x1B, 0xB2, 0x40, 0x38, 0xC5, - 0xD6, 0x21, 0xD4, 0x2B, 0x44, 0xE8, 0x13, 0xB8, 0x77, 0xBF, 0xC4, 0xAC, 0xDA, 0xFC, 0xA7, 0xEB, - 0x4F, 0x89, 0x87, 0x24, 0x45, 0x24, 0xAE, 0x7D, 0xEC, 0x44, 0x9B, 0xF1, 0xBA, 0x60, 0x28, 0xF8, - 0xC1, 0x63, 0xD7, 0x6D, 0x1C, 0xF0, 0x07, 0x95, 0x45, 0x6E, 0x6F, 0x43, 0xB3, 0x7A, 0x8E, 0x40, - 0x6C, 0xB9, 0x28, 0xB0, 0x7C, 0xE5, 0x7B, 0xA6, 0xEB, 0x98, 0x9F, 0x69, 0x42, 0x6F, 0x66, 0x05, - 0xE7, 0x19, 0xC2, 0x6D, 0xF3, 0x17, 0xCF, 0xBC, 0xF6, 0x2D, 0x9C, 0x73, 0xD3, 0x26, 0x15, 0xE3, - 0xE8, 0x08, 0xAC, 0x8C, 0xAC, 0x38, 0x95, 0x71, 0x8C, 0xE8, 0x1B, 0x0A, 0xB8, 0x99, 0x32, 0x16, - 0xE6, 0xCA, 0x08, 0x5D, 0xB8, 0xCD, 0xD2, 0x2A, 0x1F, 0xAB, 0x9C, 0xBA, 0x2D, 0x47, 0x4F, 0x4B, - 0x6C, 0xF1, 0x57, 0xE8, 0x7B, 0x8D, 0xE6, 0xAD, 0xC4, 0x0C, 0xAB, 0x3C, 0xE8, 0x04, 0x12, 0x83, - 0x8C, 0x89, 0x8A, 0xCC, 0x94, 0x5D, 0x0D, 0x1C, 0xA4, 0x99, 0xA4, 0xC0, 0x66, 0xF4, 0x23, 0x55, - 0x42, 0x56, 0x06, 0xD9, 0xBC, 0x7F, 0x30, 0x97, 0xF9, 0xF3, 0x90, 0x97, 0x4E, 0x29, 0x23, 0x35, - 0x25, 0x73, 0x71, 0xFF, 0xA3, 0xAF, 0xE8, 0x97, 0xDB, 0x17, 0xE8, 0xC9, 0xCF, 0x5D, 0x4C, 0x0F, - 0x9F, 0x5C, 0xFD, 0x0C, 0x25, 0x9F, 0x37, 0x2E, 0x4C, 0x96, 0x94, 0xE0, 0x2C, 0x69, 0x1A, 0x2B, - 0x29, 0xD3, 0x06, 0x53, 0xE2, 0xC1, 0x9A, 0x7E, 0x9E, 0x6F, 0xCA, 0x38, 0x24, 0xEB, 0x83, 0x0C, - 0x29, 0xE5, 0x5A, 0x4D, 0x9B, 0x59, 0x15, 0x48, 0xF4, 0x72, 0xAE, 0x2B, 0xA3, 0x97, 0x16, 0x02, - 0x12, 0x35, 0x73, 0xE4, 0x6A, 0x62, 0xB9, 0x25, 0x3E, 0x90, 0x8C, 0x1D, 0x12, 0x7F, 0xCE, 0x57, - 0x26, 0x39, 0x27, 0x5F, 0x3A, 0x9E, 0xE5, 0x2F, 0xDB, 0xF4, 0x7C, 0x43, 0x94, 0x56, 0x59, 0xD1, - 0xB6, 0xE3, 0x81, 0x01, 0x5F, 0xFC, 0xFA, 0xEA, 0x25, 0x4D, 0x39, 0xF2, 0x0A, 0xE7, 0x20, 0xDB, - 0x17, 0xB1, 0x77, 0x02, 0x2B, 0x67, 0xA0, 0xB0, 0xB5, 0xA1, 0xD5, 0xE6, 0xA9, 0x26, 0x69, 0x47, - 0x69, 0x24, 0xD0, 0xC3, 0x4F, 0x7C, 0x4E, 0x5A, 0x78, 0x32, 0x00, 0x37, 0x2B, 0x65, 0xF1, 0xE7, - 0x79, 0x51, 0x20, 0x0E, 0x1F, 0x13, 0x02, 0xEE, 0xAA, 0x71, 0x47, 0x0E, 0x69, 0x8E, 0x11, 0xAB, - 0xC3, 0x5B, 0x9A, 0x0C, 0x7E, 0x41, 0xC8, 0xA7, 0x66, 0x12, 0x31, 0x96, 0x15, 0x5E, 0xCA, 0x93, - 0x68, 0x0E, 0x71, 0x89, 0x1F, 0x7D, 0x34, 0xC7, 0x90, 0x1A, 0x9F, 0x82, 0xE7, 0xB7, 0x3D, 0xD0, - 0xA0, 0x79, 0x5D, 0xA6, 0x0E, 0x37, 0x57, 0x0A, 0x64, 0x5D, 0x21, 0x58, 0x12, 0x52, 0x73, 0xCB, - 0xD8, 0x47, 0xCD, 0x4E, 0xF6, 0xDE, 0x73, 0x2F, 0x6E, 0x6D, 0x8B, 0x0C, 0x3B, 0x5A, 0x35, 0x2D, - 0xEF, 0x6E, 0x32, 0x0C, 0xD2, 0xF4, 0xB2, 0x22, 0x6C, 0xAE, 0x81, 0x91, 0xFC, 0x22, 0x1E, 0x10, - 0xCB, 0x2E, 0x07, 0x44, 0x81, 0xEC, 0xD9, 0xDE, 0x2F, 0xD7, 0x2C, 0xE4, 0x20, 0x17, 0x39, 0x4C, - 0xA3, 0x2F, 0x2A, 0x98, 0xD2, 0xF2, 0x2C, 0x9C, 0xA0, 0x4E, 0x99, 0x50, 0xE6, 0xBF, 0xD2, 0x7A, - 0xC1, 0x67, 0x88, 0xA5, 0xCD, 0xF7, 0xA8, 0xD9, 0xDA, 0x70, 0x16, 0x81, 0x95, 0x66, 0xB1, 0x4F, - 0xF2, 0xDF, 0x68, 0xC3, 0x96, 0x04, 0x0F, 0x34, 0x70, 0x65, 0x41, 0x0D, 0xA7, 0xA5, 0x4C, 0x20, - 0xBA, 0xBD, 0x0A, 0x02, 0xE9, 0xAE, 0x27, 0x89, 0x56, 0xEA, 0x22, 0x4B, 0xD3, 0x5F, 0xFE, 0x3E, - 0x1D, 0xC6, 0x02, 0xB8, 0xAE, 0x6A, 0xAE, 0xC0, 0x09, 0xC6, 0x35, 0x13, 0xB7, 0xA1, 0x44, 0xA2, - 0xAD, 0x92, 0x9C, 0xA6, 0xA0, 0x2D, 0x5E, 0x6D, 0x89, 0x73, 0xDE, 0x54, 0xD4, 0x0A, 0xAF, 0xB6, - 0xC1, 0xD7, 0x92, 0x83, 0xC4, 0xF7, 0x3F, 0xA6, 0x26, 0xC4, 0xE5, 0xF6, 0xC6, 0xB2, 0xBD, 0xE3, - 0xE5, 0x40, 0x05, 0x85, 0x7C, 0x9B, 0x26, 0x37, 0x17, 0xAE, 0x69, 0x2E, 0x2C, 0xCC, 0x45, 0x09, - 0xD2, 0x0E, 0xB4, 0x7A, 0x6D, 0x92, 0xF8, 0xFF, 0x87, 0x27, 0xA9, 0x66, 0xCB, 0x71, 0xA9, 0x9C, - 0xA2, 0xF7, 0x97, 0xD4, 0x2B, 0x27, 0xC8, 0x3C, 0xCB, 0xC1, 0xD5, 0x5A, 0x8E, 0xEB, 0xA9, 0x15, - 0xAF, 0x1D, 0x28, 0x41, 0xAA, 0x96, 0x7A, 0x85, 0x11, 0xAB, 0x92, 0xEC, 0x75, 0xB3, 0xFF, 0xDD, - 0x42, 0xF2, 0x66, 0x89, 0x44, 0x58, 0xBE, 0x51, 0x5C, 0x59, 0x3D, 0xF9, 0x30, 0x49, 0xC9, 0x64, - 0x8D, 0x52, 0x49, 0x9A, 0x8C, 0x94, 0xA8, 0x13, 0x39, 0x4A, 0xA9, 0xE3, 0x41, 0xBC, 0xEC, 0x26, - 0x5F, 0x6B, 0x19, 0x2B, 0x19, 0x9D, 0x06, 0x4E, 0xCA, 0x80, 0x77, 0xFC, 0x86, 0x76, 0x3F, 0xBF, - 0x26, 0xE6, 0xBD, 0x17, 0x57, 0x36, 0xD7, 0x71, 0xC9, 0x03, 0x12, 0x95, 0x32, 0x63, 0x92, 0x00, - 0xE1, 0xF4, 0x45, 0x62, 0x56, 0x8A, 0x82, 0x5C, 0x1C, 0x90, 0x86, 0xFE, 0xD6, 0xC5, 0x74, 0xBD, - 0x22, 0x9E, 0xC6, 0x39, 0xFB, 0xF9, 0x99, 0xE6, 0x07, 0x1A, 0x7F, 0xC1, 0x5D, 0x90, 0xBC, 0x5B, - 0x44, 0x13, 0x6F, 0x7F, 0x62, 0xAB, 0x42, 0x9A, 0x83, 0xC8, 0xD4, 0x09, 0xA1, 0x49, 0xA6, 0x4F, - 0xDE, 0xE2, 0xDB, 0x7A, 0xF2, 0x82, 0xA7, 0x4A, 0xF5, 0x78, 0x57, 0xFC, 0x53, 0xA2, 0x48, 0xCE, - 0x9C, 0x9C, 0x26, 0xB5, 0xE5, 0x6D, 0xA1, 0xE3, 0x4A, 0x22, 0x2A, 0x5B, 0x87, 0xAE, 0x61, 0xC2, - 0xE4, 0xF4, 0x37, 0x6B, 0x45, 0xB5, 0x02, 0x95, 0x86, 0x4C, 0xC8, 0x52, 0x5B, 0xA6, 0xBA, 0xAE, - 0x58, 0x53, 0xB5, 0xD8, 0x2F, 0x41, 0x94, 0xEE, 0x79, 0x29, 0xB3, 0x7C, 0x31, 0x2A, 0xDC, 0xE2, - 0xBC, 0xB0, 0xF2, 0xCF, 0xF0, 0x28, 0xDE, 0x59, 0xE5, 0xDF, 0xF8, 0xAB, 0x8B, 0x86, 0x47, 0xFC, - 0x7F, 0x22, 0xF6, 0x5F, 0x04, 0x9C, 0x39, 0x76, 0x5C, 0x6C, 0x00, 0x00 -}; - - -//File: index_ov3660.html.gz, Size: 4408 -#define index_ov3660_html_gz_len 4408 -const uint8_t index_ov3660_html_gz[] = { - 0x1F, 0x8B, 0x08, 0x08, 0x28, 0x5C, 0xAE, 0x5C, 0x00, 0x03, 0x69, 0x6E, 0x64, 0x65, 0x78, 0x5F, - 0x6F, 0x76, 0x33, 0x36, 0x36, 0x30, 0x2E, 0x68, 0x74, 0x6D, 0x6C, 0x00, 0xE5, 0x5D, 0xEB, 0x92, - 0xD3, 0xC6, 0x12, 0xFE, 0xCF, 0x53, 0x08, 0x41, 0x58, 0x6F, 0x65, 0xED, 0xF5, 0x6D, 0xCD, 0xE2, - 0xD8, 0xE6, 0xC0, 0xB2, 0x84, 0x54, 0x01, 0x49, 0x20, 0x21, 0xA9, 0x4A, 0xA5, 0x60, 0x2C, 0x8D, - 0xED, 0x09, 0xB2, 0xE4, 0x48, 0x23, 0x7B, 0x37, 0xD4, 0x3E, 0xC7, 0x79, 0xA0, 0xF3, 0x62, 0xA7, - 0xE7, 0x22, 0x69, 0x24, 0x8F, 0x2E, 0xB6, 0x59, 0x9B, 0xC3, 0x31, 0x55, 0x20, 0x5B, 0xD3, 0x3D, - 0xDD, 0xFD, 0xF5, 0x6D, 0x46, 0x17, 0x06, 0x77, 0x6D, 0xCF, 0xA2, 0xD7, 0x0B, 0x6C, 0xCC, 0xE8, - 0xDC, 0x19, 0xDD, 0x19, 0x88, 0x7F, 0x0C, 0xF8, 0x0C, 0x66, 0x18, 0xD9, 0xE2, 0x90, 0x7F, 0x9D, - 0x63, 0x8A, 0x0C, 0x6B, 0x86, 0xFC, 0x00, 0xD3, 0xA1, 0x19, 0xD2, 0x49, 0xFD, 0xDC, 0xCC, 0x9E, - 0x76, 0xD1, 0x1C, 0x0F, 0xCD, 0x25, 0xC1, 0xAB, 0x85, 0xE7, 0x53, 0xD3, 0xB0, 0x3C, 0x97, 0x62, - 0x17, 0x86, 0xAF, 0x88, 0x4D, 0x67, 0x43, 0x1B, 0x2F, 0x89, 0x85, 0xEB, 0xFC, 0xCB, 0x09, 0x71, - 0x09, 0x25, 0xC8, 0xA9, 0x07, 0x16, 0x72, 0xF0, 0xB0, 0xA5, 0xF2, 0xA2, 0x84, 0x3A, 0x78, 0x74, - 0xF9, 0xF6, 0xA7, 0x4E, 0xDB, 0xF8, 0xF1, 0x5D, 0xA7, 0xD7, 0x6B, 0x0E, 0x4E, 0xC5, 0x6F, 0xC9, - 0x98, 0x80, 0x5E, 0xAB, 0xDF, 0xD9, 0x67, 0xEC, 0xD9, 0xD7, 0xC6, 0xA7, 0xD4, 0x4F, 0xEC, 0x33, - 0x01, 0x21, 0xEA, 0x13, 0x34, 0x27, 0xCE, 0x75, 0xDF, 0x78, 0xE2, 0xC3, 0x9C, 0x27, 0x2F, 0xB0, - 0xB3, 0xC4, 0x94, 0x58, 0xE8, 0x24, 0x40, 0x6E, 0x50, 0x0F, 0xB0, 0x4F, 0x26, 0xDF, 0xAD, 0x11, - 0x8E, 0x91, 0xF5, 0x71, 0xEA, 0x7B, 0xA1, 0x6B, 0xF7, 0x8D, 0x7B, 0xAD, 0x73, 0xF6, 0x67, 0x7D, - 0x90, 0xE5, 0x39, 0x9E, 0x0F, 0xE7, 0x2F, 0x9F, 0xB3, 0x3F, 0xEB, 0xE7, 0xF9, 0xEC, 0x01, 0xF9, - 0x07, 0xF7, 0x8D, 0x56, 0x6F, 0x71, 0x95, 0x3A, 0x7F, 0x73, 0x27, 0xF5, 0x75, 0xD6, 0xCE, 0x93, - 0x5E, 0xD2, 0x9F, 0x17, 0xD3, 0x07, 0xD8, 0xA2, 0xC4, 0x73, 0x1B, 0x73, 0x44, 0x5C, 0x0D, 0x27, - 0x9B, 0x04, 0x0B, 0x07, 0x81, 0x0D, 0x26, 0x0E, 0x2E, 0xE4, 0x73, 0x6F, 0x8E, 0xDD, 0xF0, 0xA4, - 0x84, 0x1B, 0x63, 0x52, 0xB7, 0x89, 0x2F, 0x46, 0xF5, 0x99, 0x1D, 0xC2, 0xB9, 0x5B, 0xCA, 0xB6, - 0x48, 0x2E, 0xD7, 0x73, 0xB1, 0xC6, 0x80, 0x6C, 0xA2, 0x95, 0x8F, 0x16, 0x6C, 0x00, 0xFB, 0x77, - 0x7D, 0xC8, 0x9C, 0xB8, 0xC2, 0xA9, 0xFA, 0x46, 0xA7, 0xDB, 0x5C, 0x5C, 0x95, 0x40, 0xD9, 0xE9, - 0xB1, 0x3F, 0xEB, 0x83, 0x16, 0xC8, 0xB6, 0x89, 0x3B, 0xED, 0x1B, 0xE7, 0x5A, 0x16, 0x9E, 0x6F, - 0x63, 0xBF, 0xEE, 0x23, 0x9B, 0x84, 0x41, 0xDF, 0xE8, 0xEA, 0xC6, 0xCC, 0x91, 0x3F, 0x05, 0x59, - 0xA8, 0x07, 0xC2, 0xD6, 0x5B, 0x5A, 0x49, 0xE4, 0x10, 0x9F, 0x4C, 0x67, 0x14, 0x20, 0x5D, 0x1B, - 0x93, 0x35, 0x9A, 0x0C, 0xA1, 0x32, 0x3C, 0x0B, 0xED, 0xA6, 0xB7, 0x1A, 0x72, 0xC8, 0xD4, 0xAD, - 0x13, 0x8A, 0xE7, 0xA0, 0x4E, 0x40, 0x7D, 0x4C, 0xAD, 0x59, 0x91, 0x28, 0x13, 0x32, 0x0D, 0x7D, - 0xAC, 0x11, 0x24, 0xB6, 0x5B, 0x81, 0xC2, 0x70, 0x72, 0xFD, 0x54, 0x7D, 0x85, 0xC7, 0x1F, 0x09, - 0xAD, 0x4B, 0x9B, 0x8C, 0xF1, 0xC4, 0xF3, 0xB1, 0x76, 0x64, 0x34, 0xC2, 0xF1, 0xAC, 0x8F, 0xF5, - 0x80, 0x22, 0x9F, 0x56, 0x61, 0x88, 0x26, 0x14, 0xFB, 0xE5, 0xFC, 0x30, 0xF3, 0x8A, 0x72, 0x6E, - 0xF9, 0xD3, 0xCA, 0x01, 0xC4, 0x75, 0x88, 0x8B, 0xAB, 0x8B, 0x97, 0x37, 0x6F, 0x9A, 0x9D, 0x18, - 0x55, 0x01, 0x18, 0x32, 0x9F, 0x16, 0x79, 0x09, 0xD7, 0x75, 0x7D, 0x32, 0x19, 0x37, 0xAD, 0x66, - 0xF3, 0x9B, 0xF5, 0x93, 0x33, 0x2C, 0xDC, 0x14, 0x85, 0xD4, 0xDB, 0x3D, 0x22, 0xD6, 0xC2, 0x2A, - 0xA3, 0xC7, 0xBF, 0xE6, 0xD8, 0x26, 0xC8, 0xA8, 0x29, 0xE1, 0x7C, 0xDE, 0x04, 0x9F, 0x3A, 0x36, - 0x90, 0x6B, 0x1B, 0x35, 0xCF, 0x27, 0x10, 0x08, 0x88, 0xA7, 0x1B, 0x07, 0x7E, 0x81, 0xC2, 0xB1, - 0xC0, 0xC7, 0x1A, 0x95, 0x0B, 0x62, 0x46, 0xB5, 0x88, 0x3E, 0x6C, 0xD8, 0xA7, 0x42, 0xCA, 0x61, - 0x9F, 0xD2, 0x00, 0xD2, 0xE8, 0xC8, 0xD9, 0x17, 0xE1, 0xA5, 0x4A, 0x98, 0x87, 0x19, 0xFB, 0xCC, - 0xD1, 0x55, 0xBD, 0x10, 0xBB, 0x68, 0x50, 0x84, 0x21, 0x94, 0x59, 0xAB, 0x06, 0x43, 0x97, 0x33, - 0xA3, 0x6E, 0xB0, 0x2C, 0x79, 0xAC, 0xA7, 0x91, 0x4C, 0xF5, 0x90, 0xB3, 0x8F, 0xEA, 0x14, 0x1B, - 0xA8, 0xAB, 0x57, 0x35, 0xC9, 0x1D, 0xE2, 0x8F, 0xCE, 0x87, 0x84, 0x26, 0xB9, 0x59, 0x84, 0x7D, - 0xAA, 0x67, 0x92, 0x84, 0x59, 0x69, 0x36, 0xD1, 0x30, 0xCE, 0xCF, 0x28, 0x6B, 0x7C, 0xF3, 0xA2, - 0x5B, 0xC3, 0xB5, 0x58, 0x84, 0xAA, 0xD9, 0x45, 0xC3, 0xB8, 0x48, 0x86, 0xD2, 0x2C, 0xC3, 0x3E, - 0x37, 0x15, 0xFA, 0x8D, 0x7B, 0xE3, 0x90, 0x52, 0xCF, 0x0D, 0x76, 0x2A, 0x51, 0x79, 0x71, 0xF6, - 0x57, 0x18, 0x50, 0x32, 0xB9, 0xAE, 0xCB, 0x90, 0x86, 0x38, 0x5B, 0x20, 0x68, 0x21, 0xC7, 0x98, - 0xAE, 0x30, 0x2E, 0x6E, 0x37, 0x5C, 0xB4, 0x84, 0xBC, 0x33, 0x9D, 0x3A, 0x3A, 0xDF, 0xB3, 0x42, - 0x3F, 0x60, 0x7D, 0xDB, 0xC2, 0x23, 0xC0, 0xD8, 0x5F, 0x9F, 0x38, 0x1D, 0x83, 0x15, 0x27, 0xAA, - 0x5B, 0x63, 0xCD, 0x5C, 0x5E, 0x48, 0x99, 0x8D, 0xB5, 0x48, 0x78, 0xA0, 0x0E, 0xA1, 0xD7, 0xDA, - 0x73, 0x32, 0x12, 0x35, 0x67, 0xA2, 0x10, 0x2C, 0x2C, 0x0B, 0x69, 0xB9, 0xFA, 0xD6, 0x0C, 0x5B, - 0x1F, 0xB1, 0xFD, 0x6D, 0x69, 0x1B, 0x56, 0xD6, 0x1E, 0x36, 0x88, 0xBB, 0x08, 0x69, 0x9D, 0xB5, - 0x53, 0x8B, 0x5B, 0xC1, 0x9C, 0x3B, 0x64, 0xA4, 0x62, 0xBB, 0x5D, 0xD4, 0x54, 0x9C, 0x2D, 0xAE, - 0x8A, 0x8D, 0xA0, 0x0A, 0x3B, 0x72, 0xD0, 0x18, 0x3B, 0x45, 0x22, 0xCB, 0x60, 0xC8, 0x49, 0xBB, - 0x32, 0x57, 0xE5, 0xF7, 0x6E, 0x5C, 0xB2, 0xA4, 0x78, 0x75, 0x1F, 0x7E, 0x53, 0xD9, 0x8E, 0xFC, - 0xF8, 0x24, 0xF5, 0x53, 0x80, 0x1D, 0x08, 0xB0, 0xBC, 0xD6, 0x1B, 0xC6, 0xAC, 0x40, 0x86, 0xC2, - 0x09, 0x7C, 0xE4, 0x4E, 0x31, 0xE4, 0x82, 0xAB, 0x93, 0xE8, 0xB0, 0x78, 0x61, 0x50, 0x49, 0x7D, - 0x96, 0xAA, 0xCF, 0x8A, 0x17, 0x22, 0x22, 0x21, 0x6C, 0xD1, 0x8C, 0x28, 0xB0, 0x16, 0xCE, 0xDF, - 0xD2, 0x3A, 0x85, 0xE8, 0x47, 0xB4, 0x01, 0x93, 0x76, 0x29, 0x6D, 0x7F, 0x5F, 0x9A, 0x11, 0xA2, - 0x95, 0xDE, 0x64, 0x52, 0xB6, 0x56, 0x9C, 0x4C, 0x3A, 0xCD, 0x4E, 0xB7, 0xB4, 0x61, 0xD2, 0x6A, - 0x99, 0x59, 0x2F, 0x6A, 0x32, 0x46, 0x9C, 0x4D, 0xCA, 0x21, 0xE8, 0xCF, 0xBC, 0x25, 0xF6, 0x35, - 0x40, 0x64, 0xC4, 0xED, 0x3E, 0xEA, 0xDA, 0x15, 0xB8, 0x21, 0xC8, 0xF7, 0x4B, 0x5D, 0x36, 0x4D, - 0xB3, 0x6B, 0xB7, 0xAC, 0x76, 0xA1, 0x63, 0x0A, 0x76, 0x0D, 0xF0, 0x06, 0x34, 0x76, 0xB0, 0x5D, - 0x90, 0x9E, 0x6D, 0x3C, 0x41, 0xA1, 0x43, 0x4B, 0xEC, 0x8D, 0x9A, 0xEC, 0x4F, 0xD1, 0x8C, 0x3C, - 0xAE, 0xFE, 0x60, 0x1B, 0x1D, 0x43, 0x1E, 0x09, 0x7F, 0x6A, 0xE6, 0x8C, 0x6A, 0x27, 0x5A, 0x2C, - 0x30, 0x82, 0x51, 0x16, 0xCE, 0x5B, 0x92, 0x56, 0xEA, 0x99, 0xF5, 0x89, 0xAB, 0xD2, 0x42, 0xB4, - 0xD4, 0x15, 0xE3, 0x6E, 0x68, 0x23, 0x9D, 0xFB, 0x13, 0xCF, 0x0A, 0x75, 0x65, 0xBA, 0x9A, 0x4B, - 0xAD, 0xF3, 0xEB, 0x47, 0x26, 0x0B, 0x1C, 0xC2, 0x1D, 0x3B, 0x74, 0x5D, 0x86, 0x68, 0x9D, 0xFA, - 0xA0, 0xA6, 0x66, 0xA2, 0x6A, 0x86, 0xDB, 0x2A, 0x3A, 0x53, 0x86, 0xCD, 0xDB, 0x8C, 0xC9, 0x04, - 0xA0, 0x26, 0x51, 0xC4, 0x39, 0xC4, 0x08, 0x3C, 0x50, 0x2A, 0x62, 0xB5, 0x9B, 0x5D, 0xE8, 0x2C, - 0x9C, 0xEB, 0x1A, 0x83, 0x68, 0xB2, 0x16, 0x54, 0x31, 0x31, 0x9D, 0x3F, 0x1D, 0xA3, 0x5A, 0xF3, - 0xA4, 0x79, 0xD2, 0x81, 0xBF, 0x34, 0x0D, 0x7A, 0xB1, 0x73, 0x49, 0xF3, 0xE6, 0x78, 0x5E, 0x26, - 0xF9, 0x94, 0xEF, 0x93, 0xE4, 0xA5, 0xB1, 0x52, 0x2C, 0xAA, 0x47, 0x52, 0x7A, 0xC3, 0xA4, 0xD5, - 0x28, 0x29, 0x2C, 0x39, 0x2E, 0xBD, 0xB9, 0x23, 0x6A, 0xBC, 0x65, 0x53, 0x88, 0xE7, 0xDE, 0x3F, - 0x75, 0x51, 0x55, 0xFF, 0xEF, 0xBD, 0x5D, 0x31, 0xC5, 0x57, 0xED, 0xE9, 0x1B, 0xDB, 0x25, 0x38, - 0xB4, 0x6F, 0x34, 0xF3, 0x51, 0xAF, 0xCB, 0x7E, 0x06, 0x24, 0x74, 0x61, 0x51, 0xE5, 0xC3, 0xEA, - 0x2A, 0xB7, 0xE7, 0x51, 0xC6, 0x6C, 0x61, 0x83, 0x09, 0x71, 0x9C, 0xBA, 0xE3, 0xAD, 0xCA, 0x3B, - 0x91, 0x62, 0x4F, 0x5E, 0xF3, 0xD3, 0x72, 0x97, 0xDF, 0x56, 0xDA, 0x10, 0x32, 0xD7, 0xFF, 0x84, - 0xB4, 0x5F, 0x77, 0xC0, 0x15, 0x86, 0xC6, 0x76, 0x85, 0x62, 0x0B, 0x7F, 0xDC, 0x6D, 0xA2, 0x4A, - 0xAE, 0x24, 0x3A, 0xC1, 0xC2, 0xC5, 0x5C, 0xB0, 0x22, 0xD4, 0x9A, 0x6D, 0xB1, 0xA8, 0x5A, 0x78, - 0x01, 0x11, 0xD7, 0x68, 0x7C, 0xEC, 0x20, 0xD6, 0xC1, 0x6F, 0xB5, 0xE4, 0x2E, 0x5D, 0x98, 0xA8, - 0xE4, 0x55, 0x34, 0xE1, 0xA6, 0xFB, 0x72, 0xB6, 0x4B, 0x1A, 0xA2, 0x77, 0xC8, 0xCF, 0xD5, 0x7A, - 0xB7, 0x2E, 0x69, 0xF7, 0xD3, 0x91, 0xA1, 0x1F, 0xB4, 0x41, 0x46, 0x8F, 0x92, 0xF6, 0xD4, 0xC7, - 0xD7, 0x15, 0x94, 0x39, 0x91, 0xFF, 0xF6, 0xC5, 0x86, 0xE8, 0xF6, 0x6B, 0x7F, 0x5E, 0x00, 0xA4, - 0x17, 0x35, 0xBA, 0x41, 0x85, 0xA9, 0xF3, 0xA7, 0xAC, 0xE2, 0x8F, 0xF1, 0x76, 0x9F, 0x69, 0x56, - 0x48, 0x37, 0x05, 0x25, 0x54, 0xEF, 0xAA, 0x51, 0xF5, 0xD5, 0x9E, 0x74, 0xF0, 0x84, 0xE6, 0x5C, - 0xCD, 0xE0, 0x7D, 0x6A, 0xA7, 0x38, 0xBB, 0xD5, 0x95, 0x7D, 0x82, 0xD2, 0xCC, 0x11, 0xEF, 0xCA, - 0xE5, 0x7B, 0x9F, 0x96, 0x33, 0xCB, 0x9E, 0x1B, 0x33, 0xCF, 0x87, 0x24, 0x6A, 0x9F, 0x39, 0xCC, - 0x30, 0x66, 0x2E, 0x4B, 0x3E, 0xC0, 0x83, 0x7F, 0xAF, 0xB5, 0x7B, 0xDA, 0x8B, 0x05, 0x05, 0x83, - 0x8B, 0x44, 0xCB, 0xDD, 0xD6, 0x5A, 0x2F, 0x59, 0xB9, 0x0B, 0x64, 0x35, 0x17, 0x69, 0x81, 0x2A, - 0x8E, 0xCA, 0xA2, 0x0C, 0xB3, 0xBE, 0x47, 0x53, 0xE8, 0xEC, 0x64, 0x8E, 0xA0, 0xED, 0x65, 0xEE, - 0x8A, 0x80, 0xA3, 0x0E, 0xBF, 0x2A, 0xEE, 0xAE, 0x6C, 0x1A, 0xB6, 0x7A, 0xCD, 0x92, 0x29, 0x2D, - 0xC7, 0x0B, 0x8A, 0xE3, 0x0A, 0x8D, 0xC1, 0x7E, 0x21, 0xD5, 0x4C, 0x24, 0xB7, 0x2E, 0xB5, 0x3B, - 0x4F, 0xDC, 0xB9, 0xB5, 0x67, 0x2A, 0x95, 0xEE, 0xC2, 0x98, 0x2A, 0x0E, 0xC7, 0x8C, 0xCD, 0x5B, - 0x4D, 0x6D, 0xA6, 0x2D, 0xDC, 0x7F, 0xA3, 0xF8, 0x0A, 0xD6, 0x9B, 0xEC, 0x82, 0x5C, 0xDF, 0xB0, - 0xB0, 0x3E, 0x8D, 0xA6, 0x8A, 0x5C, 0xAB, 0xCA, 0x26, 0x60, 0x21, 0x0E, 0x33, 0x62, 0xDB, 0xB8, - 0x70, 0x97, 0x93, 0xAD, 0x79, 0x2B, 0x36, 0x0F, 0x4C, 0x7E, 0xDD, 0xA6, 0xD4, 0xAD, 0x04, 0x45, - 0xE1, 0x75, 0xFA, 0xD6, 0x6D, 0x47, 0x8C, 0x2C, 0x34, 0x79, 0x7B, 0xC4, 0xE9, 0x56, 0xA4, 0x50, - 0x54, 0x6D, 0x70, 0xC7, 0xDB, 0xC4, 0xCC, 0x64, 0x60, 0x07, 0x36, 0x6A, 0x3D, 0x9B, 0x2B, 0x52, - 0x0D, 0x4E, 0x95, 0x7B, 0x89, 0x06, 0xA7, 0xC9, 0x6D, 0x4F, 0x03, 0x76, 0x43, 0x91, 0x7A, 0xCB, - 0x91, 0xB8, 0xDE, 0x65, 0x58, 0x0E, 0x0A, 0x82, 0xA1, 0xC9, 0x6E, 0x8C, 0x31, 0xD3, 0x77, 0x20, - 0x0D, 0x6C, 0xB2, 0x34, 0x88, 0x3D, 0x34, 0x1D, 0x6F, 0xEA, 0x65, 0xCE, 0xF1, 0xF3, 0xE2, 0x0A, - 0x04, 0x24, 0xCD, 0xA1, 0x99, 0xBA, 0x3A, 0x63, 0x72, 0xAA, 0xE4, 0x27, 0x73, 0xF4, 0xE0, 0xDE, - 0xA3, 0x87, 0x0F, 0x7B, 0xDF, 0x3D, 0x70, 0xC7, 0xC1, 0x42, 0xFE, 0xFD, 0x8B, 0xB8, 0x98, 0x25, - 0xEE, 0x88, 0x82, 0x3C, 0x4A, 0x29, 0xE8, 0x19, 0x0C, 0x4E, 0x39, 0xD3, 0x8C, 0x20, 0xA7, 0x20, - 0x49, 0x8E, 0x6C, 0xB2, 0xB6, 0xEA, 0xC4, 0x8B, 0x86, 0x04, 0x50, 0x2E, 0xC6, 0xC8, 0xD7, 0x0C, - 0xE1, 0xC3, 0x44, 0xE7, 0xC6, 0xFD, 0xD6, 0xE4, 0x35, 0x66, 0xEC, 0x5D, 0x65, 0x35, 0xE0, 0x4A, - 0xC9, 0x02, 0x24, 0x47, 0x61, 0x3B, 0x8F, 0x21, 0x90, 0x71, 0x72, 0x76, 0x69, 0x2A, 0x67, 0x4C, - 0x2C, 0x9F, 0xB4, 0xBE, 0x72, 0xA5, 0x44, 0x4C, 0x3D, 0xF1, 0xD1, 0x1C, 0x33, 0xF7, 0x97, 0x3F, - 0xE6, 0xB3, 0xC9, 0x22, 0x11, 0x53, 0x9A, 0xA3, 0x37, 0x98, 0x67, 0x4E, 0x40, 0x59, 0x6B, 0xD6, - 0x35, 0x2E, 0xB2, 0x98, 0xA5, 0xE6, 0x37, 0x23, 0x11, 0xE5, 0xE6, 0x75, 0x1D, 0x71, 0xB7, 0x29, - 0x11, 0x88, 0xB3, 0xF3, 0x16, 0xDC, 0xC1, 0x96, 0xC8, 0x09, 0xC1, 0xB4, 0xAD, 0x96, 0x39, 0xFA, - 0xF9, 0xF7, 0xEF, 0x9F, 0xD4, 0xDA, 0xCD, 0xEE, 0xF9, 0x55, 0xEB, 0xAC, 0xD7, 0x3D, 0x1E, 0x9C, - 0x8A, 0x21, 0x9B, 0xF3, 0x6A, 0x9A, 0xA3, 0x5F, 0x19, 0x2F, 0xA8, 0x2F, 0xCD, 0xAB, 0x56, 0xBB, - 0xD9, 0xDC, 0x9E, 0xD7, 0x23, 0x73, 0xF4, 0x96, 0xB3, 0x6A, 0x9F, 0x03, 0xAB, 0x66, 0x7B, 0x07, - 0xB1, 0xCE, 0xCD, 0x11, 0xE7, 0x04, 0x4C, 0xAE, 0x1E, 0xF6, 0xCE, 0xB7, 0x67, 0xF4, 0x10, 0x64, - 0x7A, 0x07, 0x9C, 0xCE, 0x41, 0xBB, 0xDE, 0x2E, 0xCA, 0xF5, 0xCC, 0x11, 0xE3, 0xD3, 0xEB, 0x36, - 0xAF, 0xBA, 0xE7, 0x3B, 0xF0, 0x39, 0x33, 0x65, 0xA7, 0xC3, 0xDC, 0x3F, 0x3A, 0x32, 0x47, 0x17, - 0x3F, 0x3C, 0xAF, 0x75, 0x41, 0xC6, 0xF6, 0xA3, 0xDE, 0xF6, 0xBC, 0xBB, 0xE0, 0x17, 0x4C, 0xC8, - 0x4E, 0x1B, 0x18, 0x75, 0x77, 0x10, 0xB2, 0x63, 0x8E, 0x5E, 0x70, 0x4E, 0xC0, 0xE5, 0xAA, 0xF5, - 0x70, 0x07, 0x91, 0xC0, 0xBD, 0x7E, 0xE6, 0x9C, 0xC0, 0xBF, 0x98, 0x7B, 0x55, 0xE4, 0x04, 0xB9, - 0x97, 0x9B, 0xA6, 0x20, 0xE6, 0xD7, 0x33, 0x59, 0xEA, 0x74, 0x51, 0x4A, 0xF8, 0x3B, 0x84, 0x8E, - 0x80, 0x5E, 0x6F, 0x9C, 0x10, 0x24, 0x1D, 0xA8, 0x24, 0x0E, 0xAA, 0xE5, 0x02, 0x45, 0x92, 0xF8, - 0x6A, 0xAB, 0x39, 0xEA, 0x96, 0x28, 0xC0, 0x49, 0xD5, 0x84, 0xCA, 0x69, 0x53, 0xF2, 0x9B, 0xAC, - 0x3F, 0x64, 0xA8, 0xB3, 0xFB, 0x79, 0xC0, 0x43, 0x3B, 0xA6, 0x12, 0xD5, 0x5B, 0x25, 0x1B, 0x8D, - 0xAC, 0xE8, 0xCA, 0x1C, 0xF5, 0x3A, 0x65, 0xD6, 0xDE, 0x01, 0x8C, 0x31, 0xEF, 0x3D, 0x5D, 0x1C, - 0x04, 0x1B, 0xE3, 0x91, 0x90, 0x9A, 0xA3, 0xA7, 0xF1, 0xF1, 0x2E, 0xA8, 0xD4, 0xCB, 0x34, 0xE5, - 0xB4, 0x39, 0xB0, 0x28, 0xE2, 0x08, 0x64, 0xEA, 0x1D, 0x09, 0x4D, 0x82, 0xCC, 0xE7, 0x05, 0xE6, - 0x36, 0x71, 0x61, 0xED, 0x80, 0x8F, 0x02, 0xBA, 0x31, 0x2A, 0x11, 0x21, 0x24, 0x35, 0x79, 0x74, - 0x30, 0x44, 0x62, 0x51, 0xBE, 0x02, 0x3C, 0x02, 0x44, 0x43, 0x9F, 0xDF, 0xE5, 0xB8, 0x31, 0x22, - 0x09, 0x29, 0x54, 0xC3, 0xF8, 0x78, 0x27, 0x54, 0x76, 0x49, 0x5F, 0x8A, 0x38, 0x12, 0x97, 0x28, - 0x85, 0x75, 0x6F, 0x09, 0x97, 0x32, 0x69, 0x77, 0xC2, 0x65, 0x86, 0xFC, 0xC5, 0x56, 0xE9, 0x2B, - 0xA6, 0x04, 0x54, 0xA2, 0xC3, 0x83, 0x85, 0x4A, 0x22, 0xCC, 0x57, 0x10, 0x2B, 0xB0, 0xFE, 0xF6, - 0x48, 0xB0, 0x79, 0xC7, 0x2F, 0xE9, 0xCC, 0xD1, 0x33, 0x5C, 0x7F, 0xCD, 0x8E, 0x76, 0x81, 0xE3, - 0x49, 0x48, 0xBD, 0x1D, 0x00, 0x89, 0x64, 0x11, 0x70, 0x34, 0x25, 0x1A, 0xE7, 0xB7, 0x84, 0xC6, - 0xF9, 0x2D, 0xA2, 0x81, 0xF0, 0x7B, 0x07, 0x2F, 0xB1, 0xB3, 0x31, 0x1C, 0x11, 0xA1, 0x39, 0xBA, - 0xBC, 0x5A, 0x78, 0x01, 0xBB, 0x5B, 0xF8, 0x25, 0xFB, 0xBE, 0x53, 0x90, 0x9C, 0xED, 0x80, 0x49, - 0x2C, 0x90, 0x8C, 0x91, 0x33, 0x89, 0xCA, 0xD9, 0x2D, 0xA1, 0x52, 0x26, 0xEB, 0x2E, 0xA8, 0x4C, - 0x11, 0x71, 0x2D, 0x4C, 0x1C, 0x76, 0xE7, 0xE2, 0xA6, 0xC0, 0x28, 0xB4, 0xE6, 0xE8, 0xFB, 0xE4, - 0xCB, 0x2E, 0xC0, 0x34, 0x77, 0xC0, 0x45, 0x95, 0x27, 0x1D, 0x2F, 0x67, 0xB0, 0x58, 0xBE, 0x25, - 0x6C, 0x5A, 0xAD, 0xDB, 0xAC, 0x2A, 0x0B, 0x6C, 0x11, 0xE4, 0xBC, 0xC7, 0x93, 0x09, 0x2C, 0x83, - 0x36, 0x2F, 0x2D, 0x29, 0x72, 0xA8, 0x2F, 0xE2, 0xBB, 0x71, 0xC9, 0xBF, 0x6F, 0xBC, 0x87, 0x91, - 0x61, 0xF7, 0xB9, 0x36, 0x32, 0x9A, 0xFA, 0xB5, 0xF0, 0x6B, 0x2F, 0x96, 0x73, 0xDB, 0x5D, 0x0D, - 0x60, 0x82, 0xA7, 0x7C, 0x53, 0x7D, 0x6B, 0x1E, 0x6D, 0xF0, 0x6C, 0x1F, 0x5D, 0xF3, 0xC7, 0x10, - 0x77, 0x59, 0x48, 0xBF, 0xC1, 0xB6, 0xF1, 0x0B, 0x71, 0xB7, 0x57, 0xA6, 0xCB, 0x04, 0xC1, 0xD8, - 0xDD, 0x8D, 0xCB, 0x19, 0x2C, 0x91, 0xE0, 0x60, 0x37, 0x26, 0x3D, 0xF0, 0x24, 0xBC, 0x20, 0xE8, - 0x4B, 0x58, 0xC4, 0xA3, 0xD5, 0x78, 0xF3, 0x82, 0xB2, 0x1A, 0x43, 0x5D, 0xFE, 0xED, 0xA9, 0x71, - 0xC9, 0x6F, 0x03, 0xDB, 0x38, 0x5D, 0x89, 0x2B, 0xD4, 0x55, 0x1C, 0x5D, 0x24, 0x2A, 0x29, 0xA7, - 0xB9, 0xB6, 0x27, 0xAA, 0x0F, 0xA0, 0xAA, 0xFB, 0xA2, 0x1A, 0xF5, 0x22, 0x01, 0xF9, 0x05, 0x3D, - 0x53, 0xD1, 0xB6, 0x9A, 0x8E, 0xB7, 0xD8, 0x8A, 0x59, 0xAB, 0xCD, 0xDB, 0x30, 0x6B, 0x05, 0x30, - 0xD9, 0x4B, 0x76, 0x87, 0xA0, 0x6D, 0x00, 0x5E, 0x7B, 0x01, 0x8A, 0xCD, 0x7A, 0x18, 0xA0, 0xB8, - 0xBE, 0x87, 0x06, 0x0A, 0xBC, 0xE5, 0x3D, 0xAB, 0xA3, 0xDB, 0x04, 0x15, 0x27, 0x34, 0x47, 0xAF, - 0x90, 0x1B, 0x42, 0x91, 0xD9, 0x17, 0x60, 0xF1, 0xC4, 0x07, 0x0B, 0x2F, 0xA9, 0xF7, 0xA1, 0xA1, - 0x03, 0x41, 0xE6, 0x9E, 0xBD, 0xF9, 0x72, 0x47, 0xD2, 0x89, 0x94, 0xF8, 0x0A, 0x8E, 0x36, 0x6E, - 0x0C, 0x22, 0x0E, 0xB7, 0xDC, 0x11, 0x88, 0xA5, 0xD4, 0xF6, 0xCD, 0xC0, 0xDB, 0xD0, 0x75, 0xAF, - 0x77, 0xE9, 0x04, 0x2E, 0x1C, 0x2F, 0xB4, 0xB7, 0xE7, 0x00, 0x6D, 0xC0, 0x8F, 0x93, 0x09, 0xB1, - 0xB6, 0x6F, 0x24, 0xA0, 0x09, 0x78, 0xE1, 0xCD, 0x2B, 0xD2, 0xDF, 0x72, 0xE1, 0xC5, 0xD6, 0x16, - 0x2B, 0x39, 0x0B, 0x50, 0xBC, 0xBC, 0xD8, 0x6B, 0xE1, 0x85, 0x39, 0x0F, 0x94, 0x19, 0x98, 0xB6, - 0x87, 0x4E, 0x0A, 0x20, 0xC4, 0x7B, 0xEE, 0x3C, 0xDB, 0x80, 0x25, 0x28, 0xE3, 0x8C, 0x1E, 0x2D, - 0xBF, 0x0F, 0xB5, 0xBE, 0x4B, 0x24, 0x4A, 0xAF, 0xEE, 0x5A, 0x67, 0x9D, 0x5E, 0xBC, 0xBC, 0xEB, - 0xB4, 0x3F, 0xEF, 0x02, 0x8F, 0x31, 0xBF, 0x5D, 0x7C, 0xDA, 0xDB, 0x40, 0x03, 0xD9, 0xE8, 0x35, - 0xBB, 0xCE, 0xB0, 0x41, 0xC2, 0xDE, 0x3D, 0x90, 0xDA, 0x87, 0x8B, 0xA4, 0xF6, 0x17, 0x10, 0x4A, - 0xD3, 0x2D, 0x32, 0xDE, 0x94, 0x65, 0xBC, 0xEF, 0x2F, 0xF6, 0x83, 0xD0, 0xF4, 0x60, 0xA9, 0x6E, - 0x7A, 0xD0, 0x54, 0x67, 0x88, 0x9B, 0xAD, 0x62, 0x98, 0xB6, 0xEC, 0x60, 0x25, 0xA1, 0xD8, 0xCB, - 0xDA, 0x25, 0xC9, 0xB5, 0xAE, 0x76, 0xC9, 0x72, 0x91, 0x18, 0xE9, 0x24, 0xD7, 0x4B, 0xAE, 0x8A, - 0x9C, 0x7D, 0xDE, 0xCB, 0xBA, 0xDD, 0x32, 0x69, 0x77, 0x09, 0x1A, 0x1F, 0xAD, 0xDE, 0x4F, 0xE7, - 0x68, 0x63, 0x30, 0x24, 0x1D, 0x60, 0xF1, 0xEA, 0xC9, 0x3E, 0xDB, 0x85, 0x68, 0xDE, 0xC3, 0xC4, - 0x51, 0xAC, 0xF5, 0xA1, 0x73, 0x9D, 0x83, 0xDD, 0xCD, 0x93, 0x1D, 0x23, 0x32, 0x47, 0x2F, 0xB1, - 0x1B, 0x18, 0x17, 0x9E, 0x2F, 0xDF, 0xFD, 0xB4, 0x17, 0xD4, 0xF8, 0xCC, 0x87, 0x81, 0x4C, 0x28, - 0x7D, 0x68, 0xBC, 0x66, 0x73, 0xE2, 0xFB, 0x9E, 0xBF, 0x31, 0x64, 0x92, 0x0E, 0x96, 0x15, 0xF5, - 0x57, 0xFC, 0x68, 0x2F, 0x70, 0x45, 0xB3, 0x1E, 0x06, 0xB1, 0x58, 0xE7, 0x43, 0x83, 0xB6, 0x9C, - 0x38, 0x64, 0xB1, 0x31, 0x64, 0x9C, 0xCA, 0x1C, 0xBD, 0xAB, 0x3F, 0x87, 0x7F, 0xF7, 0x02, 0x97, - 0x98, 0xF1, 0x30, 0x60, 0x49, 0x6D, 0x0F, 0x0D, 0xD5, 0x78, 0xB1, 0x79, 0x3A, 0x04, 0x1A, 0x73, - 0xF4, 0xF4, 0xA7, 0xFD, 0xF4, 0x7E, 0x6C, 0xB2, 0x8A, 0x08, 0xED, 0x84, 0x07, 0x57, 0xEA, 0xD0, - 0x68, 0xAC, 0xB6, 0x40, 0x63, 0xC5, 0x04, 0xFF, 0x6D, 0x4F, 0x68, 0xAC, 0xAA, 0xA3, 0xF1, 0x99, - 0xE3, 0x65, 0xF5, 0x25, 0xE0, 0xC3, 0x9F, 0xC5, 0x18, 0xA3, 0xCD, 0xCB, 0x51, 0x44, 0xC8, 0x6E, - 0x1A, 0x83, 0x23, 0xE3, 0x29, 0xDA, 0x4F, 0x41, 0x8A, 0xE7, 0xDD, 0x47, 0x08, 0x25, 0x4A, 0x1E, - 0x1A, 0xA7, 0x09, 0xB2, 0xF0, 0x7B, 0x1B, 0xD3, 0x6D, 0xAE, 0x2D, 0x2B, 0xB4, 0xE6, 0xE8, 0x39, - 0x7C, 0x31, 0x9E, 0xF1, 0x2F, 0xFB, 0x6A, 0xF9, 0xD4, 0xF9, 0xF7, 0x81, 0x5A, 0x4A, 0xDF, 0x2F, - 0x02, 0x38, 0x68, 0xB0, 0xBD, 0xA9, 0xBB, 0xD5, 0x23, 0x0D, 0x29, 0x72, 0x09, 0xDF, 0x1B, 0xF1, - 0x7D, 0xBF, 0x00, 0x26, 0x42, 0xEC, 0x0D, 0x43, 0x45, 0xEF, 0x7D, 0xC0, 0x18, 0x3D, 0x16, 0xC4, - 0x8B, 0xB4, 0x78, 0x15, 0x5E, 0x19, 0x52, 0xF2, 0xE1, 0x27, 0x7E, 0x4B, 0x0B, 0xA6, 0xF5, 0x80, - 0x12, 0xC7, 0x81, 0x85, 0x30, 0xA6, 0xC6, 0x5B, 0x76, 0x38, 0x38, 0x15, 0x03, 0xAA, 0x73, 0x91, - 0xCF, 0xDC, 0xB0, 0x97, 0x50, 0xA2, 0xB9, 0x39, 0x7A, 0xCB, 0x5E, 0x12, 0x08, 0xBC, 0xD8, 0xB7, - 0xCD, 0x99, 0x71, 0x23, 0x62, 0xD7, 0xF7, 0x40, 0xA8, 0x18, 0x24, 0xF9, 0xAE, 0x26, 0xD3, 0x88, - 0x8E, 0x94, 0xDF, 0x46, 0x97, 0x7C, 0xB0, 0xC1, 0xBC, 0xAC, 0x7C, 0x3A, 0x76, 0xD5, 0xC2, 0xCA, - 0xBF, 0xB8, 0x31, 0x38, 0x75, 0x91, 0xC6, 0xDC, 0x39, 0x28, 0x0C, 0xC4, 0xDB, 0x25, 0x73, 0x58, - 0xC5, 0xCF, 0x33, 0x71, 0x4B, 0x24, 0x8F, 0x69, 0xC6, 0x6A, 0x65, 0x1F, 0xDF, 0x94, 0xDB, 0x4C, - 0xD5, 0x82, 0x96, 0x3F, 0x88, 0x29, 0xEB, 0x21, 0x3B, 0x8C, 0xCD, 0xFF, 0x9F, 0x7F, 0x97, 0xF9, - 0x0C, 0x7B, 0xF7, 0x67, 0x22, 0x98, 0x69, 0x04, 0xBE, 0x35, 0x34, 0xF3, 0x9E, 0x8E, 0xCA, 0xD1, - 0xFC, 0x54, 0xA7, 0x7A, 0x66, 0xB0, 0xC6, 0xD6, 0x83, 0xC0, 0xF2, 0xC9, 0x82, 0x8E, 0xEE, 0xD8, - 0x9E, 0x15, 0xCE, 0xB1, 0x4B, 0x1B, 0xC8, 0xB6, 0x2F, 0x97, 0x70, 0xF0, 0x92, 0x04, 0x14, 0x83, - 0x15, 0x6A, 0x47, 0xCF, 0x7E, 0x7C, 0x75, 0x21, 0x9E, 0x12, 0x7B, 0xE9, 0x21, 0x1B, 0xDB, 0x47, - 0x27, 0xC6, 0x24, 0x74, 0x85, 0x9B, 0xD7, 0x30, 0x1B, 0x2B, 0xDE, 0xBB, 0xBA, 0x44, 0xBE, 0x31, - 0x46, 0x01, 0x7E, 0xE1, 0x05, 0xD4, 0x18, 0x1A, 0x31, 0x47, 0xC7, 0xB3, 0xF8, 0x7D, 0xBF, 0x0D, - 0xCF, 0x27, 0x53, 0xE2, 0xCA, 0x91, 0x42, 0xD9, 0x5F, 0x7D, 0x07, 0x86, 0xC6, 0x54, 0xDF, 0x1A, - 0x47, 0xFD, 0xF3, 0xD6, 0x11, 0x7B, 0x1C, 0x0F, 0x60, 0x80, 0x1F, 0x00, 0x02, 0x0C, 0x03, 0x20, - 0xC0, 0x87, 0x23, 0xF9, 0x78, 0x20, 0x76, 0x1A, 0xDC, 0xE4, 0x4C, 0x40, 0x26, 0x6D, 0xED, 0x48, - 0xE0, 0x74, 0xC4, 0x1E, 0x34, 0xBE, 0x89, 0x29, 0x83, 0x99, 0xB7, 0x2A, 0xA2, 0xF4, 0xF1, 0xDC, - 0x5B, 0xE2, 0x0C, 0x71, 0x4C, 0x2D, 0xBD, 0xB9, 0x74, 0xEA, 0xC8, 0xEB, 0x8F, 0x8E, 0xA3, 0x01, - 0xF1, 0x7B, 0xCC, 0x86, 0x06, 0xF5, 0x43, 0x9C, 0x66, 0x8B, 0xDD, 0x32, 0xAE, 0x91, 0x58, 0x85, - 0x8C, 0x27, 0xC8, 0x09, 0x32, 0x9C, 0xC3, 0x85, 0x8D, 0x28, 0x7E, 0xC7, 0x76, 0x0C, 0x61, 0x40, - 0x0D, 0x3B, 0x27, 0x62, 0xFB, 0xF0, 0x44, 0x9E, 0x79, 0x03, 0x7C, 0x29, 0x3E, 0x4E, 0x66, 0x55, - 0x7F, 0x06, 0x8A, 0xF4, 0xD7, 0xA1, 0xE1, 0x86, 0x10, 0xC2, 0x8F, 0xB9, 0x0A, 0x46, 0x3F, 0x75, - 0x96, 0x53, 0x3B, 0x90, 0x9D, 0xE4, 0x3B, 0xDB, 0xF9, 0x9C, 0xFC, 0x47, 0x32, 0x61, 0x13, 0x37, - 0xF8, 0x1B, 0xE4, 0x87, 0xC0, 0xE3, 0x28, 0xCA, 0xEE, 0x47, 0xC9, 0x8B, 0x79, 0x55, 0x22, 0x6E, - 0x87, 0x86, 0xEC, 0x83, 0xE5, 0xF9, 0xA5, 0x3C, 0x71, 0xF7, 0xEE, 0x32, 0xE6, 0x6B, 0x28, 0xC3, - 0xE0, 0x54, 0x72, 0xE2, 0x06, 0x4E, 0x28, 0x4F, 0x3F, 0xAF, 0xF3, 0xCE, 0xF0, 0x88, 0x98, 0x2B, - 0x1C, 0xEE, 0xC4, 0x92, 0xA7, 0x2C, 0xF0, 0xE0, 0x41, 0x9A, 0xDB, 0xDD, 0xA1, 0xA4, 0x4A, 0x34, - 0x11, 0xE3, 0x21, 0x32, 0x20, 0xF2, 0x40, 0x6D, 0xF9, 0x4C, 0xBC, 0x14, 0x89, 0x4C, 0x6A, 0x77, - 0x53, 0x86, 0x8F, 0x65, 0x9C, 0x30, 0x13, 0x11, 0x9B, 0x1B, 0x88, 0x5F, 0x33, 0x3C, 0x4E, 0x9E, - 0x7A, 0x15, 0xF2, 0x3D, 0xE6, 0x5E, 0x5F, 0xC3, 0xF2, 0xF2, 0xDB, 0x31, 0xD8, 0x9F, 0x39, 0x73, - 0xF2, 0x83, 0x1C, 0x9F, 0x4C, 0xA5, 0x72, 0x9C, 0xA6, 0x38, 0x32, 0xC5, 0x32, 0x72, 0xB3, 0x0F, - 0x9F, 0x00, 0x86, 0xB2, 0x9D, 0xEF, 0xE4, 0xF9, 0xFC, 0x8C, 0x39, 0xD9, 0x87, 0x4F, 0xBC, 0x3E, - 0xB0, 0x50, 0x82, 0xE8, 0x0E, 0x09, 0x8D, 0x62, 0x9C, 0xDD, 0x6A, 0xCC, 0x54, 0xE2, 0x22, 0xC0, - 0x61, 0x11, 0xAB, 0x4C, 0x01, 0xD7, 0x30, 0x14, 0x01, 0x55, 0x13, 0xF5, 0xE9, 0x29, 0xAF, 0x35, - 0x8C, 0xB9, 0x8C, 0x95, 0xF4, 0xEF, 0x77, 0x54, 0xE1, 0x6F, 0xA2, 0xF0, 0x89, 0x53, 0x99, 0x8A, - 0x27, 0xF3, 0xE3, 0xC8, 0x62, 0xCC, 0xD5, 0x13, 0x87, 0x91, 0xAF, 0x2B, 0x89, 0xFC, 0x3C, 0x31, - 0xAB, 0x05, 0x39, 0x4C, 0xF1, 0xF8, 0x7E, 0x46, 0x54, 0xD5, 0xD5, 0x41, 0xEE, 0x96, 0xA1, 0xBE, - 0x80, 0x64, 0x0C, 0xA9, 0xF0, 0x63, 0x8A, 0x0F, 0xDF, 0xB0, 0x8F, 0x99, 0x88, 0xDF, 0xC4, 0xE5, - 0xFD, 0xBA, 0xE7, 0x62, 0x3D, 0x77, 0xD5, 0xD9, 0x75, 0x3C, 0x45, 0x29, 0xCE, 0x32, 0x0D, 0xC7, - 0x73, 0x42, 0x35, 0x0C, 0x8F, 0x20, 0x0D, 0xEB, 0x78, 0xC9, 0x06, 0x2D, 0x21, 0xF0, 0x31, 0x0D, - 0x7D, 0x57, 0x8D, 0x26, 0x91, 0x91, 0xFE, 0x0E, 0xB1, 0x7F, 0x0D, 0x8C, 0x3E, 0xDC, 0xFF, 0x14, - 0xE5, 0xF7, 0x9B, 0x53, 0xFE, 0x6C, 0x8E, 0xE7, 0x3C, 0x86, 0x0A, 0x30, 0xBC, 0xFF, 0x89, 0x43, - 0x7D, 0xF3, 0x00, 0xA6, 0x84, 0x2F, 0x7C, 0xE2, 0x9B, 0x0F, 0x82, 0xC5, 0x84, 0xBD, 0x3E, 0xBB, - 0xC6, 0x59, 0x44, 0xB8, 0x35, 0xE8, 0x0C, 0xBB, 0x35, 0x1F, 0x07, 0x0B, 0x60, 0x8F, 0x93, 0x44, - 0x16, 0xCD, 0xE8, 0x39, 0x18, 0x4A, 0xCD, 0xB4, 0xF6, 0xC1, 0xC7, 0x40, 0x07, 0x02, 0x50, 0xCF, - 0xB8, 0xFF, 0x89, 0xB3, 0xB8, 0x31, 0x26, 0x10, 0xCD, 0xC1, 0x0C, 0xDB, 0x27, 0x50, 0x77, 0x10, - 0x65, 0x4F, 0xA6, 0xDF, 0xFF, 0x14, 0xB1, 0x6A, 0x88, 0x9F, 0x6E, 0x3E, 0xC4, 0x1E, 0x12, 0x17, - 0x83, 0xA8, 0x86, 0xF1, 0x13, 0x0D, 0xCE, 0xEB, 0x2D, 0x47, 0xC1, 0xF3, 0x9F, 0x38, 0x4E, 0xED, - 0x48, 0xBC, 0x7E, 0x41, 0xE6, 0xE8, 0x06, 0x34, 0x9D, 0x97, 0x08, 0xC4, 0x56, 0x93, 0x3B, 0xCF, - 0x3B, 0x9E, 0x6B, 0x39, 0xC4, 0xFA, 0xC8, 0x12, 0xF3, 0x71, 0x5A, 0x70, 0x11, 0xE9, 0x4E, 0x43, - 0xBC, 0x4E, 0xEB, 0xB5, 0x67, 0xE3, 0x8C, 0x9B, 0x1E, 0x33, 0x31, 0x4E, 0x4F, 0xC1, 0xCA, 0xC8, - 0x8E, 0x52, 0x92, 0xC0, 0x88, 0xBD, 0x77, 0x45, 0x98, 0x29, 0x65, 0x61, 0xA1, 0x8C, 0xD4, 0x45, - 0xD8, 0x2C, 0xA9, 0xD6, 0x91, 0xCA, 0x89, 0xDB, 0x0A, 0xF4, 0x8C, 0xD8, 0x16, 0x7F, 0x05, 0x9E, - 0x5B, 0x3B, 0xBE, 0x13, 0x9B, 0x61, 0x9D, 0x07, 0x9B, 0x40, 0x61, 0x90, 0x32, 0x51, 0x9E, 0x99, - 0xD2, 0x5D, 0xFD, 0x51, 0x92, 0x49, 0x72, 0x6C, 0x26, 0x3E, 0x4A, 0x4D, 0xE3, 0x05, 0x8D, 0xCF, - 0xFC, 0x07, 0x77, 0x9A, 0x3F, 0x4F, 0x44, 0x11, 0x54, 0x72, 0xD2, 0xB1, 0x62, 0x30, 0xE1, 0x81, - 0xEC, 0xBF, 0x1E, 0x51, 0x1B, 0x11, 0xE8, 0xAE, 0x2F, 0x1D, 0xCC, 0x0E, 0x9F, 0x5E, 0xFF, 0x00, - 0xC5, 0x5B, 0xB4, 0x20, 0x5C, 0x9A, 0x84, 0xE0, 0x22, 0x6E, 0xFF, 0x4A, 0x29, 0x93, 0x56, 0x51, - 0xE1, 0xC1, 0xDB, 0x77, 0x91, 0x71, 0x8A, 0x38, 0xC4, 0x9D, 0x7E, 0x8A, 0x94, 0x71, 0x2D, 0xA7, - 0x4D, 0xF5, 0xF7, 0x0A, 0xBD, 0x9A, 0xED, 0x8A, 0xE8, 0x95, 0x96, 0x5E, 0xA1, 0xE6, 0xAE, 0x5C, - 0x4E, 0xAC, 0x36, 0xB7, 0x47, 0x8A, 0xB1, 0x03, 0xEA, 0x2D, 0xC4, 0x1A, 0x23, 0xE3, 0xE6, 0x2B, - 0xE2, 0xDA, 0xDE, 0xAA, 0xC1, 0xCE, 0xD7, 0x64, 0x91, 0x54, 0x15, 0x6D, 0x10, 0x17, 0x0C, 0xF8, - 0xE2, 0x97, 0x57, 0x2F, 0x59, 0xD2, 0x51, 0xD7, 0x2A, 0x47, 0xE9, 0x0E, 0x87, 0xBF, 0xEB, 0x5C, - 0x3B, 0x03, 0x83, 0xAD, 0x01, 0x4D, 0xB3, 0x48, 0x36, 0x71, 0x63, 0xC9, 0x62, 0x81, 0x1D, 0x7E, - 0x10, 0x73, 0xB2, 0xD2, 0x93, 0x02, 0xF8, 0xB8, 0x54, 0x16, 0x6F, 0x91, 0x15, 0x05, 0x22, 0xF1, - 0x09, 0xA5, 0xE0, 0xB0, 0x86, 0x70, 0xE5, 0x80, 0x65, 0x19, 0xB9, 0xCE, 0xBB, 0x63, 0xA8, 0xE0, - 0xE7, 0x04, 0x7D, 0x62, 0x26, 0x19, 0x65, 0x69, 0xE1, 0x95, 0x4C, 0x89, 0x16, 0x10, 0x99, 0xF8, - 0xF1, 0x7B, 0x6B, 0x0C, 0xC9, 0xF1, 0x19, 0x78, 0x7E, 0xC3, 0x05, 0x0D, 0x8E, 0x6F, 0x8A, 0xD4, - 0x11, 0xE6, 0x4A, 0x80, 0xAC, 0x2A, 0x04, 0x4F, 0x43, 0x7A, 0x6E, 0x29, 0xFB, 0xE8, 0xD9, 0xA9, - 0xDE, 0x2B, 0xAE, 0xDD, 0xB2, 0x36, 0x2D, 0xCF, 0xB0, 0xC3, 0x75, 0xD3, 0x8A, 0x3E, 0x25, 0xC5, - 0x20, 0x49, 0x30, 0x6B, 0xC2, 0x66, 0xDA, 0x14, 0xC5, 0x2F, 0xA2, 0x01, 0x91, 0xEC, 0x6A, 0x40, - 0xE4, 0xC8, 0x9E, 0xEE, 0xE2, 0x32, 0xED, 0x42, 0x06, 0x72, 0x99, 0xC5, 0x0C, 0xF6, 0xD6, 0x8F, - 0x19, 0x2B, 0xD0, 0xD2, 0x09, 0xAA, 0x14, 0x0A, 0x6D, 0x06, 0x2C, 0xAC, 0x18, 0x62, 0x86, 0x48, - 0xDA, 0x6C, 0xB7, 0x99, 0xAE, 0x0E, 0x17, 0x21, 0x58, 0x69, 0x1E, 0xF9, 0xA4, 0xF8, 0x8D, 0xB5, - 0x6C, 0x71, 0xF0, 0x40, 0x0B, 0x57, 0x14, 0xD4, 0x70, 0x5A, 0xC9, 0x04, 0xB2, 0xDF, 0x2B, 0x21, - 0x50, 0xEE, 0xBA, 0xE0, 0xB4, 0xF0, 0xD3, 0xBA, 0xD8, 0x1A, 0x23, 0xC3, 0xB8, 0xE3, 0x18, 0x73, - 0x46, 0x24, 0xBB, 0xA2, 0x04, 0xF1, 0xF5, 0xEE, 0x34, 0x0B, 0xF9, 0x5A, 0x57, 0x7A, 0xA3, 0xA0, - 0x15, 0xDD, 0xB7, 0x96, 0xE8, 0x83, 0x8B, 0x95, 0xC7, 0xAA, 0xF2, 0x51, 0x97, 0x5D, 0x42, 0xA1, - 0xDE, 0x65, 0x27, 0xD4, 0xC7, 0x15, 0xD5, 0xC7, 0x52, 0x7D, 0x46, 0x90, 0x34, 0x84, 0xE5, 0x2D, - 0x7F, 0xEC, 0x8C, 0xBF, 0x3D, 0x4D, 0x34, 0x5B, 0x8D, 0x0B, 0xE5, 0x94, 0xAD, 0xB8, 0xA2, 0x5E, - 0x31, 0x41, 0xEA, 0x9E, 0x62, 0xA1, 0xD6, 0x6A, 0x5C, 0x4D, 0xAD, 0xA8, 0x95, 0x67, 0x04, 0x89, - 0x5A, 0xFA, 0x86, 0x3F, 0x52, 0x25, 0xDE, 0x42, 0xE6, 0xFF, 0xA7, 0x4B, 0xFC, 0xCE, 0x94, 0x58, - 0x58, 0xB1, 0xFF, 0x5A, 0x5A, 0xCA, 0xC4, 0x30, 0x45, 0xC9, 0x78, 0xC9, 0x50, 0x4A, 0x1A, 0x8F, - 0x54, 0xA8, 0x63, 0x39, 0x0A, 0xA9, 0xA3, 0x41, 0xA2, 0x06, 0xC6, 0x5F, 0x2B, 0x19, 0x2B, 0x1E, - 0x9D, 0x04, 0x42, 0xC2, 0x40, 0x34, 0xE0, 0x23, 0xE3, 0x2C, 0xBB, 0xD4, 0x14, 0x8D, 0x90, 0x50, - 0x36, 0xD3, 0xFE, 0xA8, 0x03, 0x62, 0x95, 0x52, 0x63, 0xE2, 0x00, 0x11, 0xF4, 0x79, 0x62, 0x96, - 0x8A, 0x82, 0x1C, 0xEC, 0xD3, 0x9A, 0xF9, 0x93, 0x83, 0xD9, 0xF2, 0x41, 0xDE, 0x14, 0x7E, 0xF1, - 0xC3, 0x73, 0xC3, 0xF3, 0x0D, 0xF1, 0x16, 0x4D, 0x3F, 0x7E, 0x6B, 0x8E, 0x21, 0x5F, 0x31, 0xC7, - 0x17, 0x69, 0xC4, 0x9D, 0x1A, 0x74, 0x46, 0x02, 0xE8, 0x59, 0xD9, 0x93, 0xE0, 0xF8, 0xAE, 0x19, - 0xBF, 0x45, 0xAE, 0x54, 0x3D, 0xD1, 0xA4, 0x7E, 0x17, 0x2B, 0x92, 0x31, 0xA7, 0xA0, 0x49, 0x6C, - 0x79, 0x57, 0xEA, 0xB8, 0x96, 0x58, 0x8A, 0x96, 0x85, 0x1B, 0x98, 0x30, 0x3E, 0xFD, 0xC5, 0x5A, - 0x51, 0xAF, 0x40, 0xA9, 0x21, 0x63, 0xB2, 0xC4, 0x96, 0x89, 0xAE, 0x6B, 0xD6, 0xD4, 0xAD, 0xBD, - 0x0B, 0x10, 0x65, 0x5B, 0x49, 0xDA, 0x6C, 0x9E, 0x8F, 0x8A, 0xB0, 0xB8, 0xA8, 0x72, 0xE2, 0x33, - 0x38, 0x8D, 0x36, 0x2C, 0xC5, 0x37, 0xF1, 0x52, 0xAE, 0xC1, 0xA9, 0xF8, 0x9F, 0x0A, 0xFF, 0x0B, - 0x9B, 0xFC, 0x8E, 0x51, 0xC1, 0x70, 0x00, 0x00 -}; - diff --git a/libraries/ESP32/examples/Camera/CameraWebServer/camera_pins.h b/libraries/ESP32/examples/Camera/CameraWebServer/camera_pins.h deleted file mode 100644 index 7855722a408..00000000000 --- a/libraries/ESP32/examples/Camera/CameraWebServer/camera_pins.h +++ /dev/null @@ -1,99 +0,0 @@ - -#if defined(CAMERA_MODEL_WROVER_KIT) -#define PWDN_GPIO_NUM -1 -#define RESET_GPIO_NUM -1 -#define XCLK_GPIO_NUM 21 -#define SIOD_GPIO_NUM 26 -#define SIOC_GPIO_NUM 27 - -#define Y9_GPIO_NUM 35 -#define Y8_GPIO_NUM 34 -#define Y7_GPIO_NUM 39 -#define Y6_GPIO_NUM 36 -#define Y5_GPIO_NUM 19 -#define Y4_GPIO_NUM 18 -#define Y3_GPIO_NUM 5 -#define Y2_GPIO_NUM 4 -#define VSYNC_GPIO_NUM 25 -#define HREF_GPIO_NUM 23 -#define PCLK_GPIO_NUM 22 - -#elif defined(CAMERA_MODEL_ESP_EYE) -#define PWDN_GPIO_NUM -1 -#define RESET_GPIO_NUM -1 -#define XCLK_GPIO_NUM 4 -#define SIOD_GPIO_NUM 18 -#define SIOC_GPIO_NUM 23 - -#define Y9_GPIO_NUM 36 -#define Y8_GPIO_NUM 37 -#define Y7_GPIO_NUM 38 -#define Y6_GPIO_NUM 39 -#define Y5_GPIO_NUM 35 -#define Y4_GPIO_NUM 14 -#define Y3_GPIO_NUM 13 -#define Y2_GPIO_NUM 34 -#define VSYNC_GPIO_NUM 5 -#define HREF_GPIO_NUM 27 -#define PCLK_GPIO_NUM 25 - -#elif defined(CAMERA_MODEL_M5STACK_PSRAM) -#define PWDN_GPIO_NUM -1 -#define RESET_GPIO_NUM 15 -#define XCLK_GPIO_NUM 27 -#define SIOD_GPIO_NUM 25 -#define SIOC_GPIO_NUM 23 - -#define Y9_GPIO_NUM 19 -#define Y8_GPIO_NUM 36 -#define Y7_GPIO_NUM 18 -#define Y6_GPIO_NUM 39 -#define Y5_GPIO_NUM 5 -#define Y4_GPIO_NUM 34 -#define Y3_GPIO_NUM 35 -#define Y2_GPIO_NUM 32 -#define VSYNC_GPIO_NUM 22 -#define HREF_GPIO_NUM 26 -#define PCLK_GPIO_NUM 21 - -#elif defined(CAMERA_MODEL_M5STACK_WIDE) -#define PWDN_GPIO_NUM -1 -#define RESET_GPIO_NUM 15 -#define XCLK_GPIO_NUM 27 -#define SIOD_GPIO_NUM 22 -#define SIOC_GPIO_NUM 23 - -#define Y9_GPIO_NUM 19 -#define Y8_GPIO_NUM 36 -#define Y7_GPIO_NUM 18 -#define Y6_GPIO_NUM 39 -#define Y5_GPIO_NUM 5 -#define Y4_GPIO_NUM 34 -#define Y3_GPIO_NUM 35 -#define Y2_GPIO_NUM 32 -#define VSYNC_GPIO_NUM 25 -#define HREF_GPIO_NUM 26 -#define PCLK_GPIO_NUM 21 - -#elif defined(CAMERA_MODEL_AI_THINKER) -#define PWDN_GPIO_NUM 32 -#define RESET_GPIO_NUM -1 -#define XCLK_GPIO_NUM 0 -#define SIOD_GPIO_NUM 26 -#define SIOC_GPIO_NUM 27 - -#define Y9_GPIO_NUM 35 -#define Y8_GPIO_NUM 34 -#define Y7_GPIO_NUM 39 -#define Y6_GPIO_NUM 36 -#define Y5_GPIO_NUM 21 -#define Y4_GPIO_NUM 19 -#define Y3_GPIO_NUM 18 -#define Y2_GPIO_NUM 5 -#define VSYNC_GPIO_NUM 25 -#define HREF_GPIO_NUM 23 -#define PCLK_GPIO_NUM 22 - -#else -#error "Camera model not selected" -#endif diff --git a/libraries/ESP32/examples/ChipID/GetChipID/GetChipID.ino b/libraries/ESP32/examples/ChipID/GetChipID/GetChipID.ino deleted file mode 100644 index de8a7386b93..00000000000 --- a/libraries/ESP32/examples/ChipID/GetChipID/GetChipID.ino +++ /dev/null @@ -1,14 +0,0 @@ -uint64_t chipid; - -void setup() { - Serial.begin(115200); -} - -void loop() { - chipid=ESP.getEfuseMac();//The chip ID is essentially its MAC address(length: 6 bytes). - Serial.printf("ESP32 Chip ID = %04X",(uint16_t)(chipid>>32));//print High 2 bytes - Serial.printf("%08X\n",(uint32_t)chipid);//print Low 4bytes. - - delay(3000); - -} diff --git a/libraries/ESP32/examples/DeepSleep/ExternalWakeUp/ExternalWakeUp.ino b/libraries/ESP32/examples/DeepSleep/ExternalWakeUp/ExternalWakeUp.ino deleted file mode 100644 index 8a13b77196d..00000000000 --- a/libraries/ESP32/examples/DeepSleep/ExternalWakeUp/ExternalWakeUp.ino +++ /dev/null @@ -1,82 +0,0 @@ -/* -Deep Sleep with External Wake Up -===================================== -This code displays how to use deep sleep with -an external trigger as a wake up source and how -to store data in RTC memory to use it over reboots - -This code is under Public Domain License. - -Hardware Connections -====================== -Push Button to GPIO 33 pulled down with a 10K Ohm -resistor - -NOTE: -====== -Only RTC IO can be used as a source for external wake -source. They are pins: 0,2,4,12-15,25-27,32-39. - -Author: -Pranav Cherukupalli -*/ - -#define BUTTON_PIN_BITMASK 0x200000000 // 2^33 in hex - -RTC_DATA_ATTR int bootCount = 0; - -/* -Method to print the reason by which ESP32 -has been awaken from sleep -*/ -void print_wakeup_reason(){ - esp_sleep_wakeup_cause_t wakeup_reason; - - wakeup_reason = esp_sleep_get_wakeup_cause(); - - switch(wakeup_reason) - { - case ESP_SLEEP_WAKEUP_EXT0 : Serial.println("Wakeup caused by external signal using RTC_IO"); break; - case ESP_SLEEP_WAKEUP_EXT1 : Serial.println("Wakeup caused by external signal using RTC_CNTL"); break; - case ESP_SLEEP_WAKEUP_TIMER : Serial.println("Wakeup caused by timer"); break; - case ESP_SLEEP_WAKEUP_TOUCHPAD : Serial.println("Wakeup caused by touchpad"); break; - case ESP_SLEEP_WAKEUP_ULP : Serial.println("Wakeup caused by ULP program"); break; - default : Serial.printf("Wakeup was not caused by deep sleep: %d\n",wakeup_reason); break; - } -} - -void setup(){ - Serial.begin(115200); - delay(1000); //Take some time to open up the Serial Monitor - - //Increment boot number and print it every reboot - ++bootCount; - Serial.println("Boot number: " + String(bootCount)); - - //Print the wakeup reason for ESP32 - print_wakeup_reason(); - - /* - First we configure the wake up source - We set our ESP32 to wake up for an external trigger. - There are two types for ESP32, ext0 and ext1 . - ext0 uses RTC_IO to wakeup thus requires RTC peripherals - to be on while ext1 uses RTC Controller so doesnt need - peripherals to be powered on. - Note that using internal pullups/pulldowns also requires - RTC peripherals to be turned on. - */ - esp_sleep_enable_ext0_wakeup(GPIO_NUM_33,1); //1 = High, 0 = Low - - //If you were to use ext1, you would use it like - //esp_sleep_enable_ext1_wakeup(BUTTON_PIN_BITMASK,ESP_EXT1_WAKEUP_ANY_HIGH); - - //Go to sleep now - Serial.println("Going to sleep now"); - esp_deep_sleep_start(); - Serial.println("This will never be printed"); -} - -void loop(){ - //This is not going to be called -} diff --git a/libraries/ESP32/examples/DeepSleep/TimerWakeUp/TimerWakeUp.ino b/libraries/ESP32/examples/DeepSleep/TimerWakeUp/TimerWakeUp.ino deleted file mode 100644 index ec43cf72ea7..00000000000 --- a/libraries/ESP32/examples/DeepSleep/TimerWakeUp/TimerWakeUp.ino +++ /dev/null @@ -1,94 +0,0 @@ -/* -Simple Deep Sleep with Timer Wake Up -===================================== -ESP32 offers a deep sleep mode for effective power -saving as power is an important factor for IoT -applications. In this mode CPUs, most of the RAM, -and all the digital peripherals which are clocked -from APB_CLK are powered off. The only parts of -the chip which can still be powered on are: -RTC controller, RTC peripherals ,and RTC memories - -This code displays the most basic deep sleep with -a timer to wake it up and how to store data in -RTC memory to use it over reboots - -This code is under Public Domain License. - -Author: -Pranav Cherukupalli -*/ - -#define uS_TO_S_FACTOR 1000000ULL /* Conversion factor for micro seconds to seconds */ -#define TIME_TO_SLEEP 5 /* Time ESP32 will go to sleep (in seconds) */ - -RTC_DATA_ATTR int bootCount = 0; - -/* -Method to print the reason by which ESP32 -has been awaken from sleep -*/ -void print_wakeup_reason(){ - esp_sleep_wakeup_cause_t wakeup_reason; - - wakeup_reason = esp_sleep_get_wakeup_cause(); - - switch(wakeup_reason) - { - case ESP_SLEEP_WAKEUP_EXT0 : Serial.println("Wakeup caused by external signal using RTC_IO"); break; - case ESP_SLEEP_WAKEUP_EXT1 : Serial.println("Wakeup caused by external signal using RTC_CNTL"); break; - case ESP_SLEEP_WAKEUP_TIMER : Serial.println("Wakeup caused by timer"); break; - case ESP_SLEEP_WAKEUP_TOUCHPAD : Serial.println("Wakeup caused by touchpad"); break; - case ESP_SLEEP_WAKEUP_ULP : Serial.println("Wakeup caused by ULP program"); break; - default : Serial.printf("Wakeup was not caused by deep sleep: %d\n",wakeup_reason); break; - } -} - -void setup(){ - Serial.begin(115200); - delay(1000); //Take some time to open up the Serial Monitor - - //Increment boot number and print it every reboot - ++bootCount; - Serial.println("Boot number: " + String(bootCount)); - - //Print the wakeup reason for ESP32 - print_wakeup_reason(); - - /* - First we configure the wake up source - We set our ESP32 to wake up every 5 seconds - */ - esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR); - Serial.println("Setup ESP32 to sleep for every " + String(TIME_TO_SLEEP) + - " Seconds"); - - /* - Next we decide what all peripherals to shut down/keep on - By default, ESP32 will automatically power down the peripherals - not needed by the wakeup source, but if you want to be a poweruser - this is for you. Read in detail at the API docs - http://esp-idf.readthedocs.io/en/latest/api-reference/system/deep_sleep.html - Left the line commented as an example of how to configure peripherals. - The line below turns off all RTC peripherals in deep sleep. - */ - //esp_deep_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_OFF); - //Serial.println("Configured all RTC Peripherals to be powered down in sleep"); - - /* - Now that we have setup a wake cause and if needed setup the - peripherals state in deep sleep, we can now start going to - deep sleep. - In the case that no wake up sources were provided but deep - sleep was started, it will sleep forever unless hardware - reset occurs. - */ - Serial.println("Going to sleep now"); - Serial.flush(); - esp_deep_sleep_start(); - Serial.println("This will never be printed"); -} - -void loop(){ - //This is not going to be called -} diff --git a/libraries/ESP32/examples/DeepSleep/TouchWakeUp/TouchWakeUp.ino b/libraries/ESP32/examples/DeepSleep/TouchWakeUp/TouchWakeUp.ino deleted file mode 100644 index 76f48b757a4..00000000000 --- a/libraries/ESP32/examples/DeepSleep/TouchWakeUp/TouchWakeUp.ino +++ /dev/null @@ -1,91 +0,0 @@ -/* -Deep Sleep with Touch Wake Up -===================================== -This code displays how to use deep sleep with -a touch as a wake up source and how to store data in -RTC memory to use it over reboots - -This code is under Public Domain License. - -Author: -Pranav Cherukupalli -*/ - -#define Threshold 40 /* Greater the value, more the sensitivity */ - -RTC_DATA_ATTR int bootCount = 0; -touch_pad_t touchPin; -/* -Method to print the reason by which ESP32 -has been awaken from sleep -*/ -void print_wakeup_reason(){ - esp_sleep_wakeup_cause_t wakeup_reason; - - wakeup_reason = esp_sleep_get_wakeup_cause(); - - switch(wakeup_reason) - { - case ESP_SLEEP_WAKEUP_EXT0 : Serial.println("Wakeup caused by external signal using RTC_IO"); break; - case ESP_SLEEP_WAKEUP_EXT1 : Serial.println("Wakeup caused by external signal using RTC_CNTL"); break; - case ESP_SLEEP_WAKEUP_TIMER : Serial.println("Wakeup caused by timer"); break; - case ESP_SLEEP_WAKEUP_TOUCHPAD : Serial.println("Wakeup caused by touchpad"); break; - case ESP_SLEEP_WAKEUP_ULP : Serial.println("Wakeup caused by ULP program"); break; - default : Serial.printf("Wakeup was not caused by deep sleep: %d\n",wakeup_reason); break; - } -} - -/* -Method to print the touchpad by which ESP32 -has been awaken from sleep -*/ -void print_wakeup_touchpad(){ - touchPin = esp_sleep_get_touchpad_wakeup_status(); - - switch(touchPin) - { - case 0 : Serial.println("Touch detected on GPIO 4"); break; - case 1 : Serial.println("Touch detected on GPIO 0"); break; - case 2 : Serial.println("Touch detected on GPIO 2"); break; - case 3 : Serial.println("Touch detected on GPIO 15"); break; - case 4 : Serial.println("Touch detected on GPIO 13"); break; - case 5 : Serial.println("Touch detected on GPIO 12"); break; - case 6 : Serial.println("Touch detected on GPIO 14"); break; - case 7 : Serial.println("Touch detected on GPIO 27"); break; - case 8 : Serial.println("Touch detected on GPIO 33"); break; - case 9 : Serial.println("Touch detected on GPIO 32"); break; - default : Serial.println("Wakeup not by touchpad"); break; - } -} - -void callback(){ - //placeholder callback function -} - -void setup(){ - Serial.begin(115200); - delay(1000); //Take some time to open up the Serial Monitor - - //Increment boot number and print it every reboot - ++bootCount; - Serial.println("Boot number: " + String(bootCount)); - - //Print the wakeup reason for ESP32 and touchpad too - print_wakeup_reason(); - print_wakeup_touchpad(); - - //Setup interrupt on Touch Pad 3 (GPIO15) - touchAttachInterrupt(T3, callback, Threshold); - - //Configure Touchpad as wakeup source - esp_sleep_enable_touchpad_wakeup(); - - //Go to sleep now - Serial.println("Going to sleep now"); - esp_deep_sleep_start(); - Serial.println("This will never be printed"); -} - -void loop(){ - //This will never be reached -} diff --git a/libraries/ESP32/examples/ESPNow/Basic/Master/Master.ino b/libraries/ESP32/examples/ESPNow/Basic/Master/Master.ino deleted file mode 100644 index 1cb9fb98845..00000000000 --- a/libraries/ESP32/examples/ESPNow/Basic/Master/Master.ino +++ /dev/null @@ -1,259 +0,0 @@ -/** - ESPNOW - Basic communication - Master - Date: 26th September 2017 - Author: Arvind Ravulavaru - Purpose: ESPNow Communication between a Master ESP32 and a Slave ESP32 - Description: This sketch consists of the code for the Master module. - Resources: (A bit outdated) - a. https://espressif.com/sites/default/files/documentation/esp-now_user_guide_en.pdf - b. http://www.esploradores.com/practica-6-conexion-esp-now/ - - << This Device Master >> - - Flow: Master - Step 1 : ESPNow Init on Master and set it in STA mode - Step 2 : Start scanning for Slave ESP32 (we have added a prefix of `slave` to the SSID of slave for an easy setup) - Step 3 : Once found, add Slave as peer - Step 4 : Register for send callback - Step 5 : Start Transmitting data from Master to Slave - - Flow: Slave - Step 1 : ESPNow Init on Slave - Step 2 : Update the SSID of Slave with a prefix of `slave` - Step 3 : Set Slave in AP mode - Step 4 : Register for receive callback and wait for data - Step 5 : Once data arrives, print it in the serial monitor - - Note: Master and Slave have been defined to easily understand the setup. - Based on the ESPNOW API, there is no concept of Master and Slave. - Any devices can act as master or salve. -*/ - -#include -#include - -// Global copy of slave -esp_now_peer_info_t slave; -#define CHANNEL 3 -#define PRINTSCANRESULTS 0 -#define DELETEBEFOREPAIR 0 - -// Init ESP Now with fallback -void InitESPNow() { - WiFi.disconnect(); - if (esp_now_init() == ESP_OK) { - Serial.println("ESPNow Init Success"); - } - else { - Serial.println("ESPNow Init Failed"); - // Retry InitESPNow, add a counte and then restart? - // InitESPNow(); - // or Simply Restart - ESP.restart(); - } -} - -// Scan for slaves in AP mode -void ScanForSlave() { - int8_t scanResults = WiFi.scanNetworks(); - // reset on each scan - bool slaveFound = 0; - memset(&slave, 0, sizeof(slave)); - - Serial.println(""); - if (scanResults == 0) { - Serial.println("No WiFi devices in AP Mode found"); - } else { - Serial.print("Found "); Serial.print(scanResults); Serial.println(" devices "); - for (int i = 0; i < scanResults; ++i) { - // Print SSID and RSSI for each device found - String SSID = WiFi.SSID(i); - int32_t RSSI = WiFi.RSSI(i); - String BSSIDstr = WiFi.BSSIDstr(i); - - if (PRINTSCANRESULTS) { - Serial.print(i + 1); - Serial.print(": "); - Serial.print(SSID); - Serial.print(" ("); - Serial.print(RSSI); - Serial.print(")"); - Serial.println(""); - } - delay(10); - // Check if the current device starts with `Slave` - if (SSID.indexOf("Slave") == 0) { - // SSID of interest - Serial.println("Found a Slave."); - Serial.print(i + 1); Serial.print(": "); Serial.print(SSID); Serial.print(" ["); Serial.print(BSSIDstr); Serial.print("]"); Serial.print(" ("); Serial.print(RSSI); Serial.print(")"); Serial.println(""); - // Get BSSID => Mac Address of the Slave - int mac[6]; - if ( 6 == sscanf(BSSIDstr.c_str(), "%x:%x:%x:%x:%x:%x", &mac[0], &mac[1], &mac[2], &mac[3], &mac[4], &mac[5] ) ) { - for (int ii = 0; ii < 6; ++ii ) { - slave.peer_addr[ii] = (uint8_t) mac[ii]; - } - } - - slave.channel = CHANNEL; // pick a channel - slave.encrypt = 0; // no encryption - - slaveFound = 1; - // we are planning to have only one slave in this example; - // Hence, break after we find one, to be a bit efficient - break; - } - } - } - - if (slaveFound) { - Serial.println("Slave Found, processing.."); - } else { - Serial.println("Slave Not Found, trying again."); - } - - // clean up ram - WiFi.scanDelete(); -} - -// Check if the slave is already paired with the master. -// If not, pair the slave with master -bool manageSlave() { - if (slave.channel == CHANNEL) { - if (DELETEBEFOREPAIR) { - deletePeer(); - } - - Serial.print("Slave Status: "); - // check if the peer exists - bool exists = esp_now_is_peer_exist(slave.peer_addr); - if ( exists) { - // Slave already paired. - Serial.println("Already Paired"); - return true; - } else { - // Slave not paired, attempt pair - esp_err_t addStatus = esp_now_add_peer(&slave); - if (addStatus == ESP_OK) { - // Pair success - Serial.println("Pair success"); - return true; - } else if (addStatus == ESP_ERR_ESPNOW_NOT_INIT) { - // How did we get so far!! - Serial.println("ESPNOW Not Init"); - return false; - } else if (addStatus == ESP_ERR_ESPNOW_ARG) { - Serial.println("Invalid Argument"); - return false; - } else if (addStatus == ESP_ERR_ESPNOW_FULL) { - Serial.println("Peer list full"); - return false; - } else if (addStatus == ESP_ERR_ESPNOW_NO_MEM) { - Serial.println("Out of memory"); - return false; - } else if (addStatus == ESP_ERR_ESPNOW_EXIST) { - Serial.println("Peer Exists"); - return true; - } else { - Serial.println("Not sure what happened"); - return false; - } - } - } else { - // No slave found to process - Serial.println("No Slave found to process"); - return false; - } -} - -void deletePeer() { - esp_err_t delStatus = esp_now_del_peer(slave.peer_addr); - Serial.print("Slave Delete Status: "); - if (delStatus == ESP_OK) { - // Delete success - Serial.println("Success"); - } else if (delStatus == ESP_ERR_ESPNOW_NOT_INIT) { - // How did we get so far!! - Serial.println("ESPNOW Not Init"); - } else if (delStatus == ESP_ERR_ESPNOW_ARG) { - Serial.println("Invalid Argument"); - } else if (delStatus == ESP_ERR_ESPNOW_NOT_FOUND) { - Serial.println("Peer not found."); - } else { - Serial.println("Not sure what happened"); - } -} - -uint8_t data = 0; -// send data -void sendData() { - data++; - const uint8_t *peer_addr = slave.peer_addr; - Serial.print("Sending: "); Serial.println(data); - esp_err_t result = esp_now_send(peer_addr, &data, sizeof(data)); - Serial.print("Send Status: "); - if (result == ESP_OK) { - Serial.println("Success"); - } else if (result == ESP_ERR_ESPNOW_NOT_INIT) { - // How did we get so far!! - Serial.println("ESPNOW not Init."); - } else if (result == ESP_ERR_ESPNOW_ARG) { - Serial.println("Invalid Argument"); - } else if (result == ESP_ERR_ESPNOW_INTERNAL) { - Serial.println("Internal Error"); - } else if (result == ESP_ERR_ESPNOW_NO_MEM) { - Serial.println("ESP_ERR_ESPNOW_NO_MEM"); - } else if (result == ESP_ERR_ESPNOW_NOT_FOUND) { - Serial.println("Peer not found."); - } else { - Serial.println("Not sure what happened"); - } -} - -// callback when data is sent from Master to Slave -void OnDataSent(const uint8_t *mac_addr, esp_now_send_status_t status) { - char macStr[18]; - snprintf(macStr, sizeof(macStr), "%02x:%02x:%02x:%02x:%02x:%02x", - mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]); - Serial.print("Last Packet Sent to: "); Serial.println(macStr); - Serial.print("Last Packet Send Status: "); Serial.println(status == ESP_NOW_SEND_SUCCESS ? "Delivery Success" : "Delivery Fail"); -} - -void setup() { - Serial.begin(115200); - //Set device in STA mode to begin with - WiFi.mode(WIFI_STA); - Serial.println("ESPNow/Basic/Master Example"); - // This is the mac address of the Master in Station Mode - Serial.print("STA MAC: "); Serial.println(WiFi.macAddress()); - // Init ESPNow with a fallback logic - InitESPNow(); - // Once ESPNow is successfully Init, we will register for Send CB to - // get the status of Trasnmitted packet - esp_now_register_send_cb(OnDataSent); -} - -void loop() { - // In the loop we scan for slave - ScanForSlave(); - // If Slave is found, it would be populate in `slave` variable - // We will check if `slave` is defined and then we proceed further - if (slave.channel == CHANNEL) { // check if slave channel is defined - // `slave` is defined - // Add slave as peer if it has not been added already - bool isPaired = manageSlave(); - if (isPaired) { - // pair success or already paired - // Send data to device - sendData(); - } else { - // slave pair failed - Serial.println("Slave pair failed!"); - } - } - else { - // No slave found to process - } - - // wait for 3seconds to run the logic again - delay(3000); -} diff --git a/libraries/ESP32/examples/ESPNow/Basic/Slave/Slave.ino b/libraries/ESP32/examples/ESPNow/Basic/Slave/Slave.ino deleted file mode 100644 index d9029e961e3..00000000000 --- a/libraries/ESP32/examples/ESPNow/Basic/Slave/Slave.ino +++ /dev/null @@ -1,91 +0,0 @@ -/** - ESPNOW - Basic communication - Slave - Date: 26th September 2017 - Author: Arvind Ravulavaru - Purpose: ESPNow Communication between a Master ESP32 and a Slave ESP32 - Description: This sketch consists of the code for the Slave module. - Resources: (A bit outdated) - a. https://espressif.com/sites/default/files/documentation/esp-now_user_guide_en.pdf - b. http://www.esploradores.com/practica-6-conexion-esp-now/ - - << This Device Slave >> - - Flow: Master - Step 1 : ESPNow Init on Master and set it in STA mode - Step 2 : Start scanning for Slave ESP32 (we have added a prefix of `slave` to the SSID of slave for an easy setup) - Step 3 : Once found, add Slave as peer - Step 4 : Register for send callback - Step 5 : Start Transmitting data from Master to Slave - - Flow: Slave - Step 1 : ESPNow Init on Slave - Step 2 : Update the SSID of Slave with a prefix of `slave` - Step 3 : Set Slave in AP mode - Step 4 : Register for receive callback and wait for data - Step 5 : Once data arrives, print it in the serial monitor - - Note: Master and Slave have been defined to easily understand the setup. - Based on the ESPNOW API, there is no concept of Master and Slave. - Any devices can act as master or salve. -*/ - -#include -#include - -#define CHANNEL 1 - -// Init ESP Now with fallback -void InitESPNow() { - WiFi.disconnect(); - if (esp_now_init() == ESP_OK) { - Serial.println("ESPNow Init Success"); - } - else { - Serial.println("ESPNow Init Failed"); - // Retry InitESPNow, add a counte and then restart? - // InitESPNow(); - // or Simply Restart - ESP.restart(); - } -} - -// config AP SSID -void configDeviceAP() { - const char *SSID = "Slave_1"; - bool result = WiFi.softAP(SSID, "Slave_1_Password", CHANNEL, 0); - if (!result) { - Serial.println("AP Config failed."); - } else { - Serial.println("AP Config Success. Broadcasting with AP: " + String(SSID)); - } -} - -void setup() { - Serial.begin(115200); - Serial.println("ESPNow/Basic/Slave Example"); - //Set device in AP mode to begin with - WiFi.mode(WIFI_AP); - // configure device AP mode - configDeviceAP(); - // This is the mac address of the Slave in AP Mode - Serial.print("AP MAC: "); Serial.println(WiFi.softAPmacAddress()); - // Init ESPNow with a fallback logic - InitESPNow(); - // Once ESPNow is successfully Init, we will register for recv CB to - // get recv packer info. - esp_now_register_recv_cb(OnDataRecv); -} - -// callback when data is recv from Master -void OnDataRecv(const uint8_t *mac_addr, const uint8_t *data, int data_len) { - char macStr[18]; - snprintf(macStr, sizeof(macStr), "%02x:%02x:%02x:%02x:%02x:%02x", - mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]); - Serial.print("Last Packet Recv from: "); Serial.println(macStr); - Serial.print("Last Packet Recv Data: "); Serial.println(*data); - Serial.println(""); -} - -void loop() { - // Chill -} diff --git a/libraries/ESP32/examples/ESPNow/Multi-Slave/Master/Master.ino b/libraries/ESP32/examples/ESPNow/Multi-Slave/Master/Master.ino deleted file mode 100644 index 6e212dd1121..00000000000 --- a/libraries/ESP32/examples/ESPNow/Multi-Slave/Master/Master.ino +++ /dev/null @@ -1,244 +0,0 @@ -/** - ESPNOW - Basic communication - Master - Date: 26th September 2017 - Author: Arvind Ravulavaru - Purpose: ESPNow Communication between a Master ESP32 and multiple ESP32 Slaves - Description: This sketch consists of the code for the Master module. - Resources: (A bit outdated) - a. https://espressif.com/sites/default/files/documentation/esp-now_user_guide_en.pdf - b. http://www.esploradores.com/practica-6-conexion-esp-now/ - - << This Device Master >> - - Flow: Master - Step 1 : ESPNow Init on Master and set it in STA mode - Step 2 : Start scanning for Slave ESP32 (we have added a prefix of `slave` to the SSID of slave for an easy setup) - Step 3 : Once found, add Slave as peer - Step 4 : Register for send callback - Step 5 : Start Transmitting data from Master to Slave(s) - - Flow: Slave - Step 1 : ESPNow Init on Slave - Step 2 : Update the SSID of Slave with a prefix of `slave` - Step 3 : Set Slave in AP mode - Step 4 : Register for receive callback and wait for data - Step 5 : Once data arrives, print it in the serial monitor - - Note: Master and Slave have been defined to easily understand the setup. - Based on the ESPNOW API, there is no concept of Master and Slave. - Any devices can act as master or salve. - - - // Sample Serial log with 1 master & 2 slaves - Found 12 devices - 1: Slave:24:0A:C4:81:CF:A4 [24:0A:C4:81:CF:A5] (-44) - 3: Slave:30:AE:A4:02:6D:CC [30:AE:A4:02:6D:CD] (-55) - 2 Slave(s) found, processing.. - Processing: 24:A:C4:81:CF:A5 Status: Already Paired - Processing: 30:AE:A4:2:6D:CD Status: Already Paired - Sending: 9 - Send Status: Success - Last Packet Sent to: 24:0a:c4:81:cf:a5 - Last Packet Send Status: Delivery Success - Send Status: Success - Last Packet Sent to: 30:ae:a4:02:6d:cd - Last Packet Send Status: Delivery Success - -*/ - -#include -#include - -// Global copy of slave -#define NUMSLAVES 20 -esp_now_peer_info_t slaves[NUMSLAVES] = {}; -int SlaveCnt = 0; - -#define CHANNEL 3 -#define PRINTSCANRESULTS 0 - -// Init ESP Now with fallback -void InitESPNow() { - WiFi.disconnect(); - if (esp_now_init() == ESP_OK) { - Serial.println("ESPNow Init Success"); - } - else { - Serial.println("ESPNow Init Failed"); - // Retry InitESPNow, add a counte and then restart? - // InitESPNow(); - // or Simply Restart - ESP.restart(); - } -} - -// Scan for slaves in AP mode -void ScanForSlave() { - int8_t scanResults = WiFi.scanNetworks(); - //reset slaves - memset(slaves, 0, sizeof(slaves)); - SlaveCnt = 0; - Serial.println(""); - if (scanResults == 0) { - Serial.println("No WiFi devices in AP Mode found"); - } else { - Serial.print("Found "); Serial.print(scanResults); Serial.println(" devices "); - for (int i = 0; i < scanResults; ++i) { - // Print SSID and RSSI for each device found - String SSID = WiFi.SSID(i); - int32_t RSSI = WiFi.RSSI(i); - String BSSIDstr = WiFi.BSSIDstr(i); - - if (PRINTSCANRESULTS) { - Serial.print(i + 1); Serial.print(": "); Serial.print(SSID); Serial.print(" ["); Serial.print(BSSIDstr); Serial.print("]"); Serial.print(" ("); Serial.print(RSSI); Serial.print(")"); Serial.println(""); - } - delay(10); - // Check if the current device starts with `Slave` - if (SSID.indexOf("Slave") == 0) { - // SSID of interest - Serial.print(i + 1); Serial.print(": "); Serial.print(SSID); Serial.print(" ["); Serial.print(BSSIDstr); Serial.print("]"); Serial.print(" ("); Serial.print(RSSI); Serial.print(")"); Serial.println(""); - // Get BSSID => Mac Address of the Slave - int mac[6]; - - if ( 6 == sscanf(BSSIDstr.c_str(), "%x:%x:%x:%x:%x:%x", &mac[0], &mac[1], &mac[2], &mac[3], &mac[4], &mac[5] ) ) { - for (int ii = 0; ii < 6; ++ii ) { - slaves[SlaveCnt].peer_addr[ii] = (uint8_t) mac[ii]; - } - } - slaves[SlaveCnt].channel = CHANNEL; // pick a channel - slaves[SlaveCnt].encrypt = 0; // no encryption - SlaveCnt++; - } - } - } - - if (SlaveCnt > 0) { - Serial.print(SlaveCnt); Serial.println(" Slave(s) found, processing.."); - } else { - Serial.println("No Slave Found, trying again."); - } - - // clean up ram - WiFi.scanDelete(); -} - -// Check if the slave is already paired with the master. -// If not, pair the slave with master -void manageSlave() { - if (SlaveCnt > 0) { - for (int i = 0; i < SlaveCnt; i++) { - Serial.print("Processing: "); - for (int ii = 0; ii < 6; ++ii ) { - Serial.print((uint8_t) slaves[i].peer_addr[ii], HEX); - if (ii != 5) Serial.print(":"); - } - Serial.print(" Status: "); - // check if the peer exists - bool exists = esp_now_is_peer_exist(slaves[i].peer_addr); - if (exists) { - // Slave already paired. - Serial.println("Already Paired"); - } else { - // Slave not paired, attempt pair - esp_err_t addStatus = esp_now_add_peer(&slaves[i]); - if (addStatus == ESP_OK) { - // Pair success - Serial.println("Pair success"); - } else if (addStatus == ESP_ERR_ESPNOW_NOT_INIT) { - // How did we get so far!! - Serial.println("ESPNOW Not Init"); - } else if (addStatus == ESP_ERR_ESPNOW_ARG) { - Serial.println("Add Peer - Invalid Argument"); - } else if (addStatus == ESP_ERR_ESPNOW_FULL) { - Serial.println("Peer list full"); - } else if (addStatus == ESP_ERR_ESPNOW_NO_MEM) { - Serial.println("Out of memory"); - } else if (addStatus == ESP_ERR_ESPNOW_EXIST) { - Serial.println("Peer Exists"); - } else { - Serial.println("Not sure what happened"); - } - delay(100); - } - } - } else { - // No slave found to process - Serial.println("No Slave found to process"); - } -} - - -uint8_t data = 0; -// send data -void sendData() { - data++; - for (int i = 0; i < SlaveCnt; i++) { - const uint8_t *peer_addr = slaves[i].peer_addr; - if (i == 0) { // print only for first slave - Serial.print("Sending: "); - Serial.println(data); - } - esp_err_t result = esp_now_send(peer_addr, &data, sizeof(data)); - Serial.print("Send Status: "); - if (result == ESP_OK) { - Serial.println("Success"); - } else if (result == ESP_ERR_ESPNOW_NOT_INIT) { - // How did we get so far!! - Serial.println("ESPNOW not Init."); - } else if (result == ESP_ERR_ESPNOW_ARG) { - Serial.println("Invalid Argument"); - } else if (result == ESP_ERR_ESPNOW_INTERNAL) { - Serial.println("Internal Error"); - } else if (result == ESP_ERR_ESPNOW_NO_MEM) { - Serial.println("ESP_ERR_ESPNOW_NO_MEM"); - } else if (result == ESP_ERR_ESPNOW_NOT_FOUND) { - Serial.println("Peer not found."); - } else { - Serial.println("Not sure what happened"); - } - delay(100); - } -} - -// callback when data is sent from Master to Slave -void OnDataSent(const uint8_t *mac_addr, esp_now_send_status_t status) { - char macStr[18]; - snprintf(macStr, sizeof(macStr), "%02x:%02x:%02x:%02x:%02x:%02x", - mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]); - Serial.print("Last Packet Sent to: "); Serial.println(macStr); - Serial.print("Last Packet Send Status: "); Serial.println(status == ESP_NOW_SEND_SUCCESS ? "Delivery Success" : "Delivery Fail"); -} - -void setup() { - Serial.begin(115200); - //Set device in STA mode to begin with - WiFi.mode(WIFI_STA); - Serial.println("ESPNow/Multi-Slave/Master Example"); - // This is the mac address of the Master in Station Mode - Serial.print("STA MAC: "); Serial.println(WiFi.macAddress()); - // Init ESPNow with a fallback logic - InitESPNow(); - // Once ESPNow is successfully Init, we will register for Send CB to - // get the status of Trasnmitted packet - esp_now_register_send_cb(OnDataSent); -} - -void loop() { - // In the loop we scan for slave - ScanForSlave(); - // If Slave is found, it would be populate in `slave` variable - // We will check if `slave` is defined and then we proceed further - if (SlaveCnt > 0) { // check if slave channel is defined - // `slave` is defined - // Add slave as peer if it has not been added already - manageSlave(); - // pair success or already paired - // Send data to device - sendData(); - } else { - // No slave found to process - } - - // wait for 3seconds to run the logic again - delay(1000); -} diff --git a/libraries/ESP32/examples/ESPNow/Multi-Slave/Slave/Slave.ino b/libraries/ESP32/examples/ESPNow/Multi-Slave/Slave/Slave.ino deleted file mode 100644 index 42ce40ba0d1..00000000000 --- a/libraries/ESP32/examples/ESPNow/Multi-Slave/Slave/Slave.ino +++ /dev/null @@ -1,94 +0,0 @@ -/** - ESPNOW - Basic communication - Slave - Date: 26th September 2017 - Author: Arvind Ravulavaru - Purpose: ESPNow Communication between a Master ESP32 and multiple ESP32 Slaves - Description: This sketch consists of the code for the Slave module. - Resources: (A bit outdated) - a. https://espressif.com/sites/default/files/documentation/esp-now_user_guide_en.pdf - b. http://www.esploradores.com/practica-6-conexion-esp-now/ - - << This Device Slave >> - - Flow: Master - Step 1 : ESPNow Init on Master and set it in STA mode - Step 2 : Start scanning for Slave ESP32 (we have added a prefix of `slave` to the SSID of slave for an easy setup) - Step 3 : Once found, add Slave as peer - Step 4 : Register for send callback - Step 5 : Start Transmitting data from Master to Slave(s) - - Flow: Slave - Step 1 : ESPNow Init on Slave - Step 2 : Update the SSID of Slave with a prefix of `slave` - Step 3 : Set Slave in AP mode - Step 4 : Register for receive callback and wait for data - Step 5 : Once data arrives, print it in the serial monitor - - Note: Master and Slave have been defined to easily understand the setup. - Based on the ESPNOW API, there is no concept of Master and Slave. - Any devices can act as master or salve. -*/ - -#include -#include - -#define CHANNEL 1 - -// Init ESP Now with fallback -void InitESPNow() { - WiFi.disconnect(); - if (esp_now_init() == ESP_OK) { - Serial.println("ESPNow Init Success"); - } - else { - Serial.println("ESPNow Init Failed"); - // Retry InitESPNow, add a counte and then restart? - // InitESPNow(); - // or Simply Restart - ESP.restart(); - } -} - -// config AP SSID -void configDeviceAP() { - String Prefix = "Slave:"; - String Mac = WiFi.macAddress(); - String SSID = Prefix + Mac; - String Password = "123456789"; - bool result = WiFi.softAP(SSID.c_str(), Password.c_str(), CHANNEL, 0); - if (!result) { - Serial.println("AP Config failed."); - } else { - Serial.println("AP Config Success. Broadcasting with AP: " + String(SSID)); - } -} - -void setup() { - Serial.begin(115200); - Serial.println("ESPNow/Basic/Slave Example"); - //Set device in AP mode to begin with - WiFi.mode(WIFI_AP); - // configure device AP mode - configDeviceAP(); - // This is the mac address of the Slave in AP Mode - Serial.print("AP MAC: "); Serial.println(WiFi.softAPmacAddress()); - // Init ESPNow with a fallback logic - InitESPNow(); - // Once ESPNow is successfully Init, we will register for recv CB to - // get recv packer info. - esp_now_register_recv_cb(OnDataRecv); -} - -// callback when data is recv from Master -void OnDataRecv(const uint8_t *mac_addr, const uint8_t *data, int data_len) { - char macStr[18]; - snprintf(macStr, sizeof(macStr), "%02x:%02x:%02x:%02x:%02x:%02x", - mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]); - Serial.print("Last Packet Recv from: "); Serial.println(macStr); - Serial.print("Last Packet Recv Data: "); Serial.println(*data); - Serial.println(""); -} - -void loop() { - // Chill -} diff --git a/libraries/ESP32/examples/FreeRTOS/FreeRTOS.ino b/libraries/ESP32/examples/FreeRTOS/FreeRTOS.ino deleted file mode 100644 index 9f9fcdca349..00000000000 --- a/libraries/ESP32/examples/FreeRTOS/FreeRTOS.ino +++ /dev/null @@ -1,97 +0,0 @@ -#if CONFIG_FREERTOS_UNICORE -#define ARDUINO_RUNNING_CORE 0 -#else -#define ARDUINO_RUNNING_CORE 1 -#endif - -#ifndef LED_BUILTIN -#define LED_BUILTIN 13 -#endif - -// define two tasks for Blink & AnalogRead -void TaskBlink( void *pvParameters ); -void TaskAnalogReadA3( void *pvParameters ); - -// the setup function runs once when you press reset or power the board -void setup() { - - // initialize serial communication at 115200 bits per second: - Serial.begin(115200); - - // Now set up two tasks to run independently. - xTaskCreatePinnedToCore( - TaskBlink - , "TaskBlink" // A name just for humans - , 1024 // This stack size can be checked & adjusted by reading the Stack Highwater - , NULL - , 2 // Priority, with 3 (configMAX_PRIORITIES - 1) being the highest, and 0 being the lowest. - , NULL - , ARDUINO_RUNNING_CORE); - - xTaskCreatePinnedToCore( - TaskAnalogReadA3 - , "AnalogReadA3" - , 1024 // Stack size - , NULL - , 1 // Priority - , NULL - , ARDUINO_RUNNING_CORE); - - // Now the task scheduler, which takes over control of scheduling individual tasks, is automatically started. -} - -void loop() -{ - // Empty. Things are done in Tasks. -} - -/*--------------------------------------------------*/ -/*---------------------- Tasks ---------------------*/ -/*--------------------------------------------------*/ - -void TaskBlink(void *pvParameters) // This is a task. -{ - (void) pvParameters; - -/* - Blink - Turns on an LED on for one second, then off for one second, repeatedly. - - If you want to know what pin the on-board LED is connected to on your ESP32 model, check - the Technical Specs of your board. -*/ - - // initialize digital LED_BUILTIN on pin 13 as an output. - pinMode(LED_BUILTIN, OUTPUT); - - for (;;) // A Task shall never return or exit. - { - digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) - vTaskDelay(100); // one tick delay (15ms) in between reads for stability - digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW - vTaskDelay(100); // one tick delay (15ms) in between reads for stability - } -} - -void TaskAnalogReadA3(void *pvParameters) // This is a task. -{ - (void) pvParameters; - -/* - AnalogReadSerial - Reads an analog input on pin A3, prints the result to the serial monitor. - Graphical representation is available using serial plotter (Tools > Serial Plotter menu) - Attach the center pin of a potentiometer to pin A3, and the outside pins to +5V and ground. - - This example code is in the public domain. -*/ - - for (;;) - { - // read the input on analog pin A3: - int sensorValueA3 = analogRead(A3); - // print out the value you read: - Serial.println(sensorValueA3); - vTaskDelay(10); // one tick delay (15ms) in between reads for stability - } -} diff --git a/libraries/ESP32/examples/GPIO/FunctionalInterrupt/FunctionalInterrupt.ino b/libraries/ESP32/examples/GPIO/FunctionalInterrupt/FunctionalInterrupt.ino deleted file mode 100644 index 0e9f97414bb..00000000000 --- a/libraries/ESP32/examples/GPIO/FunctionalInterrupt/FunctionalInterrupt.ino +++ /dev/null @@ -1,47 +0,0 @@ -#include -#include - -#define BUTTON1 16 -#define BUTTON2 17 - -class Button -{ -public: - Button(uint8_t reqPin) : PIN(reqPin){ - pinMode(PIN, INPUT_PULLUP); - attachInterrupt(PIN, std::bind(&Button::isr,this), FALLING); - }; - ~Button() { - detachInterrupt(PIN); - } - - void IRAM_ATTR isr() { - numberKeyPresses += 1; - pressed = true; - } - - void checkPressed() { - if (pressed) { - Serial.printf("Button on pin %u has been pressed %u times\n", PIN, numberKeyPresses); - pressed = false; - } - } - -private: - const uint8_t PIN; - volatile uint32_t numberKeyPresses; - volatile bool pressed; -}; - -Button button1(BUTTON1); -Button button2(BUTTON2); - - -void setup() { - Serial.begin(115200); -} - -void loop() { - button1.checkPressed(); - button2.checkPressed(); -} diff --git a/libraries/ESP32/examples/GPIO/GPIOInterrupt/GPIOInterrupt.ino b/libraries/ESP32/examples/GPIO/GPIOInterrupt/GPIOInterrupt.ino deleted file mode 100644 index c3d1245fa0c..00000000000 --- a/libraries/ESP32/examples/GPIO/GPIOInterrupt/GPIOInterrupt.ino +++ /dev/null @@ -1,45 +0,0 @@ -#include - -struct Button { - const uint8_t PIN; - uint32_t numberKeyPresses; - bool pressed; -}; - -Button button1 = {23, 0, false}; -Button button2 = {18, 0, false}; - -void IRAM_ATTR isr(void* arg) { - Button* s = static_cast(arg); - s->numberKeyPresses += 1; - s->pressed = true; -} - -void IRAM_ATTR isr() { - button2.numberKeyPresses += 1; - button2.pressed = true; -} - -void setup() { - Serial.begin(115200); - pinMode(button1.PIN, INPUT_PULLUP); - attachInterruptArg(button1.PIN, isr, &button1, FALLING); - pinMode(button2.PIN, INPUT_PULLUP); - attachInterrupt(button2.PIN, isr, FALLING); -} - -void loop() { - if (button1.pressed) { - Serial.printf("Button 1 has been pressed %u times\n", button1.numberKeyPresses); - button1.pressed = false; - } - if (button2.pressed) { - Serial.printf("Button 2 has been pressed %u times\n", button2.numberKeyPresses); - button2.pressed = false; - } - static uint32_t lastMillis = 0; - if (millis() - lastMillis > 10000) { - lastMillis = millis(); - detachInterrupt(button1.PIN); - } -} diff --git a/libraries/ESP32/examples/HallSensor/HallSensor.ino b/libraries/ESP32/examples/HallSensor/HallSensor.ino deleted file mode 100644 index 3db5951d4d8..00000000000 --- a/libraries/ESP32/examples/HallSensor/HallSensor.ino +++ /dev/null @@ -1,16 +0,0 @@ -//Simple sketch to access the internal hall effect detector on the esp32. -//values can be quite low. -//Brian Degger / @sctv - -int val = 0; -void setup() { - Serial.begin(9600); - } - -void loop() { - // put your main code here, to run repeatedly: - val = hallRead(); - // print the results to the serial monitor: - //Serial.print("sensor = "); - Serial.println(val);//to graph -} diff --git a/libraries/ESP32/examples/I2S/HiFreq_ADC/HiFreq_ADC.ino b/libraries/ESP32/examples/I2S/HiFreq_ADC/HiFreq_ADC.ino deleted file mode 100644 index df328d1d6b1..00000000000 --- a/libraries/ESP32/examples/I2S/HiFreq_ADC/HiFreq_ADC.ino +++ /dev/null @@ -1,83 +0,0 @@ -/* - * This is an example to read analog data at high frequency using the I2S peripheral - * Run a wire between pins 27 & 32 - * The readings from the device will be 12bit (0-4096) - */ -#include - -#define I2S_SAMPLE_RATE 78125 -#define ADC_INPUT ADC1_CHANNEL_4 //pin 32 -#define OUTPUT_PIN 27 -#define OUTPUT_VALUE 3800 -#define READ_DELAY 9000 //microseconds - -uint16_t adc_reading; - -void i2sInit() -{ - i2s_config_t i2s_config = { - .mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_RX | I2S_MODE_ADC_BUILT_IN), - .sample_rate = I2S_SAMPLE_RATE, // The format of the signal using ADC_BUILT_IN - .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT, // is fixed at 12bit, stereo, MSB - .channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT, - .communication_format = I2S_COMM_FORMAT_I2S_MSB, - .intr_alloc_flags = ESP_INTR_FLAG_LEVEL1, - .dma_buf_count = 4, - .dma_buf_len = 8, - .use_apll = false, - .tx_desc_auto_clear = false, - .fixed_mclk = 0 - }; - i2s_driver_install(I2S_NUM_0, &i2s_config, 0, NULL); - i2s_set_adc_mode(ADC_UNIT_1, ADC_INPUT); - i2s_adc_enable(I2S_NUM_0); -} - -void reader(void *pvParameters) { - uint32_t read_counter = 0; - uint64_t read_sum = 0; -// The 4 high bits are the channel, and the data is inverted - uint16_t offset = (int)ADC_INPUT * 0x1000 + 0xFFF; - size_t bytes_read; - while(1){ - uint16_t buffer[2] = {0}; - i2s_read(I2S_NUM_0, &buffer, sizeof(buffer), &bytes_read, 15); - //Serial.printf("%d %d\n", offset - buffer[0], offset - buffer[1]); - if (bytes_read == sizeof(buffer)) { - read_sum += offset - buffer[0]; - read_sum += offset - buffer[1]; - read_counter++; - } else { - Serial.println("buffer empty"); - } - if (read_counter == I2S_SAMPLE_RATE) { - adc_reading = read_sum / I2S_SAMPLE_RATE / 2; - //Serial.printf("avg: %d millis: ", adc_reading); - //Serial.println(millis()); - read_counter = 0; - read_sum = 0; - i2s_adc_disable(I2S_NUM_0); - delay(READ_DELAY); - i2s_adc_enable(I2S_NUM_0); - } - } -} - -void setup() { - Serial.begin(115200); - // Put a signal out on pin - uint32_t freq = ledcSetup(0, I2S_SAMPLE_RATE, 10); - Serial.printf("Output frequency: %d\n", freq); - ledcWrite(0, OUTPUT_VALUE/4); - ledcAttachPin(OUTPUT_PIN, 0); - // Initialize the I2S peripheral - i2sInit(); - // Create a task that will read the data - xTaskCreatePinnedToCore(reader, "ADC_reader", 2048, NULL, 1, NULL, 1); -} - -void loop() { - delay(1020); - Serial.printf("ADC reading: %d\n", adc_reading); - delay(READ_DELAY); -} diff --git a/libraries/ESP32/examples/RMT/RMTLoopback/RMTLoopback.ino b/libraries/ESP32/examples/RMT/RMTLoopback/RMTLoopback.ino deleted file mode 100644 index 54f2d2c983c..00000000000 --- a/libraries/ESP32/examples/RMT/RMTLoopback/RMTLoopback.ino +++ /dev/null @@ -1,61 +0,0 @@ -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "freertos/event_groups.h" -#include "Arduino.h" - -#include "esp32-hal.h" - -rmt_data_t my_data[256]; -rmt_data_t data[256]; - -rmt_obj_t* rmt_send = NULL; -rmt_obj_t* rmt_recv = NULL; - -static EventGroupHandle_t events; - -void setup() -{ - Serial.begin(115200); - - if ((rmt_send = rmtInit(18, true, RMT_MEM_64)) == NULL) - { - Serial.println("init sender failed\n"); - } - if ((rmt_recv = rmtInit(21, false, RMT_MEM_192)) == NULL) - { - Serial.println("init receiver failed\n"); - } - - float realTick = rmtSetTick(rmt_send, 100); - printf("real tick set to: %fns\n", realTick); - -} - -void loop() -{ - // Init data - int i; - for (i=0; i<255; i++) { - data[i].val = 0x80010001 + ((i%13)<<16) + 13-(i%13); - } - data[255].val = 0; - - // Start receiving - rmtReadAsync(rmt_recv, my_data, 100, events, false, 0); - - // Send in continous mode - rmtWrite(rmt_send, data, 100); - - // Wait for data - xEventGroupWaitBits(events, RMT_FLAG_RX_DONE, 1, 1, portMAX_DELAY); - - // Printout the received data plus the original values - for (i=0; i<60; i++) - { - Serial.printf("%08x=%08x ", my_data[i].val, data[i].val ); - if (!((i+1)%4)) Serial.println("\n"); - } - Serial.println("\n"); - - delay(2000); -} diff --git a/libraries/ESP32/examples/RMT/RMTReadXJT/RMTReadXJT.ino b/libraries/ESP32/examples/RMT/RMTReadXJT/RMTReadXJT.ino deleted file mode 100644 index 29ab824d79d..00000000000 --- a/libraries/ESP32/examples/RMT/RMTReadXJT/RMTReadXJT.ino +++ /dev/null @@ -1,203 +0,0 @@ -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "freertos/event_groups.h" -#include "Arduino.h" - -#include "esp32-hal.h" - -// -// Note: This example uses a FrSKY device communication -// using XJT D12 protocol -// -// ; 0 bit = 6us low/10us high -// ; 1 bit = 14us low/10us high -// ; -// ; --------+ +----------+ +----------+ -// ; | | | | | -// ; | 0 | | 1 | | -// ; | | | | | -// ; | | | | | -// ; +-------+ +-----------------+ +--------- -// ; -// ; | 6us 10us | 14us 10us | -// ; |-------|----------|-----------------|----------|-------- -// ; | 16us | 24us | - -// Typedef of received frame -// -// ; 0x00 - Sync, 0x7E (sync header ID) -// ; 0x01 - Rx ID, 0x?? (receiver ID number, 0x00-0x??) -// ; 0x02 - Flags 1, 0x?? (used for failsafe and binding) -// ; 0x03 - Flags 2, 0x00 (reserved) -// ; 0x04-0x06, Channels 1/9 and 2/10 -// ; 0x07-0x09, Channels 3/11 and 4/12 -// ; 0x0A-0x0C, Channels 5/13 and 6/14 -// ; 0x0D-0x0F, Channels 7/15 and 8/16 -// ; 0x10 - 0x00, always zero -// ; 0x11 - CRC-16 High -// ; 0x12 - CRC-16 Low -// ; 0x13 - Tail, 0x7E (tail ID) -typedef union { - struct { - uint8_t head;//0x7E - uint8_t rxid;//Receiver Number - uint8_t flags;//Range:0x20, Bind:0x01 - uint8_t reserved0;//0x00 - union { - struct { - uint8_t ch0_l; - uint8_t ch0_h:4; - uint8_t ch1_l:4; - uint8_t ch1_h; - }; - uint8_t bytes[3]; - } channels[4]; - uint8_t reserved1;//0x00 - uint8_t crc_h; - uint8_t crc_l; - uint8_t tail;//0x7E - }; - uint8_t buffer[20]; -} xjt_packet_t; - -#define XJT_VALID(i) (i->level0 && !i->level1 && i->duration0 >= 8 && i->duration0 <= 11) - -rmt_obj_t* rmt_recv = NULL; - -static uint32_t *s_channels; -static uint32_t channels[16]; -static uint8_t xjt_flags = 0x0; -static uint8_t xjt_rxid = 0x0; - -static bool xjtReceiveBit(size_t index, bool bit){ - static xjt_packet_t xjt; - static uint8_t xjt_bit_index = 8; - static uint8_t xht_byte_index = 0; - static uint8_t xht_ones = 0; - - if(!index){ - xjt_bit_index = 8; - xht_byte_index = 0; - xht_ones = 0; - } - - if(xht_byte_index > 19){ - //fail! - return false; - } - if(bit){ - xht_ones++; - if(xht_ones > 5 && xht_byte_index && xht_byte_index < 19){ - //fail! - return false; - } - //add bit - xjt.buffer[xht_byte_index] |= (1 << --xjt_bit_index); - } else if(xht_ones == 5 && xht_byte_index && xht_byte_index < 19){ - xht_ones = 0; - //skip bit - return true; - } else { - xht_ones = 0; - //add bit - xjt.buffer[xht_byte_index] &= ~(1 << --xjt_bit_index); - } - if ((!xjt_bit_index) || (xjt_bit_index==1 && xht_byte_index==19) ) { - xjt_bit_index = 8; - if(!xht_byte_index && xjt.buffer[0] != 0x7E){ - //fail! - return false; - } - xht_byte_index++; - if(xht_byte_index == 20){ - //done - if(xjt.buffer[19] != 0x7E){ - //fail! - return false; - } - //check crc? - - xjt_flags = xjt.flags; - xjt_rxid = xjt.rxid; - for(int i=0; i<4; i++){ - uint16_t ch0 = xjt.channels[i].ch0_l | ((uint16_t)(xjt.channels[i].ch0_h & 0x7) << 8); - ch0 = ((ch0 * 2) + 2452) / 3; - uint16_t ch1 = xjt.channels[i].ch1_l | ((uint16_t)(xjt.channels[i].ch1_h & 0x7F) << 4); - ch1 = ((ch1 * 2) + 2452) / 3; - uint8_t c0n = i*2; - if(xjt.channels[i].ch0_h & 0x8){ - c0n += 8; - } - uint8_t c1n = i*2+1; - if(xjt.channels[i].ch1_h & 0x80){ - c1n += 8; - } - s_channels[c0n] = ch0; - s_channels[c1n] = ch1; - } - } - } - return true; -} - -void parseRmt(rmt_data_t* items, size_t len, uint32_t* channels){ - bool valid = true; - rmt_data_t* it = NULL; - - if (!channels) { - log_e("Please provide data block for storing channel info"); - return; - } - s_channels = channels; - - it = &items[0]; - for(size_t i = 0; iduration1 >= 5 && it->duration1 <= 8){ - valid = xjtReceiveBit(i, false); - } else if(it->duration1 >= 13 && it->duration1 <= 16){ - valid = xjtReceiveBit(i, true); - } else { - valid = false; - } - } else if(!it->duration1 && !it->level1 && it->duration0 >= 5 && it->duration0 <= 8) { - valid = xjtReceiveBit(i, false); - - } - } -} - -extern "C" void receive_data(uint32_t *data, size_t len) -{ - parseRmt((rmt_data_t*) data, len, channels); -} - -void setup() -{ - Serial.begin(115200); - - // Initialize the channel to capture up to 192 items - if ((rmt_recv = rmtInit(21, false, RMT_MEM_192)) == NULL) - { - Serial.println("init receiver failed\n"); - } - - // Setup 1us tick - float realTick = rmtSetTick(rmt_recv, 1000); - Serial.printf("real tick set to: %fns\n", realTick); - - // Ask to start reading - rmtRead(rmt_recv, receive_data); -} - -void loop() -{ - // printout some of the channels - Serial.printf("%04x %04x %04x %04x\n", channels[0], channels[1], channels[2], channels[3]); - delay(500); -} diff --git a/libraries/ESP32/examples/RMT/RMTWriteNeoPixel/RMTWriteNeoPixel.ino b/libraries/ESP32/examples/RMT/RMTWriteNeoPixel/RMTWriteNeoPixel.ino deleted file mode 100644 index 5067140fbd6..00000000000 --- a/libraries/ESP32/examples/RMT/RMTWriteNeoPixel/RMTWriteNeoPixel.ino +++ /dev/null @@ -1,89 +0,0 @@ -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "freertos/event_groups.h" -#include "Arduino.h" - -#include "esp32-hal.h" - -#define NR_OF_LEDS 8*4 -#define NR_OF_ALL_BITS 24*NR_OF_LEDS - -// -// Note: This example uses Neopixel LED board, 32 LEDs chained one -// after another, each RGB LED has its 24 bit value -// for color configuration (8b for each color) -// -// Bits encoded as pulses as follows: -// -// "0": -// +-------+ +-- -// | | | -// | | | -// | | | -// ---| |--------------| -// + + + -// | 0.4us | 0.85 0us | -// -// "1": -// +-------------+ +-- -// | | | -// | | | -// | | | -// | | | -// ---+ +-------+ -// | 0.8us | 0.4us | - -rmt_data_t led_data[NR_OF_ALL_BITS]; - -rmt_obj_t* rmt_send = NULL; - -void setup() -{ - Serial.begin(115200); - - if ((rmt_send = rmtInit(18, true, RMT_MEM_64)) == NULL) - { - Serial.println("init sender failed\n"); - } - - float realTick = rmtSetTick(rmt_send, 100); - Serial.printf("real tick set to: %fns\n", realTick); - -} - -int color[] = { 0x55, 0x11, 0x77 }; // RGB value -int led_index = 0; - -void loop() -{ - // Init data with only one led ON - int led, col, bit; - int i=0; - for (led=0; led=NR_OF_LEDS) { - led_index = 0; - } - - // Send the data - rmtWrite(rmt_send, led_data, NR_OF_ALL_BITS); - - delay(100); -} diff --git a/libraries/ESP32/examples/ResetReason/ResetReason.ino b/libraries/ESP32/examples/ResetReason/ResetReason.ino deleted file mode 100644 index 3fc457d1f4a..00000000000 --- a/libraries/ESP32/examples/ResetReason/ResetReason.ino +++ /dev/null @@ -1,147 +0,0 @@ -/* -* Print last reset reason of ESP32 -* ================================= -* -* Use either of the methods print_reset_reason -* or verbose_print_reset_reason to display the -* cause for the last reset of this device. -* -* Public Domain License. -* -* Author: -* Evandro Luis Copercini - 2017 -*/ - -#include - -#define uS_TO_S_FACTOR 1000000 /* Conversion factor for micro seconds to seconds */ - -void print_reset_reason(RESET_REASON reason) -{ - switch ( reason) - { - case 1 : Serial.println ("POWERON_RESET");break; /**<1, Vbat power on reset*/ - case 3 : Serial.println ("SW_RESET");break; /**<3, Software reset digital core*/ - case 4 : Serial.println ("OWDT_RESET");break; /**<4, Legacy watch dog reset digital core*/ - case 5 : Serial.println ("DEEPSLEEP_RESET");break; /**<5, Deep Sleep reset digital core*/ - case 6 : Serial.println ("SDIO_RESET");break; /**<6, Reset by SLC module, reset digital core*/ - case 7 : Serial.println ("TG0WDT_SYS_RESET");break; /**<7, Timer Group0 Watch dog reset digital core*/ - case 8 : Serial.println ("TG1WDT_SYS_RESET");break; /**<8, Timer Group1 Watch dog reset digital core*/ - case 9 : Serial.println ("RTCWDT_SYS_RESET");break; /**<9, RTC Watch dog Reset digital core*/ - case 10 : Serial.println ("INTRUSION_RESET");break; /**<10, Instrusion tested to reset CPU*/ - case 11 : Serial.println ("TGWDT_CPU_RESET");break; /**<11, Time Group reset CPU*/ - case 12 : Serial.println ("SW_CPU_RESET");break; /**<12, Software reset CPU*/ - case 13 : Serial.println ("RTCWDT_CPU_RESET");break; /**<13, RTC Watch dog Reset CPU*/ - case 14 : Serial.println ("EXT_CPU_RESET");break; /**<14, for APP CPU, reseted by PRO CPU*/ - case 15 : Serial.println ("RTCWDT_BROWN_OUT_RESET");break;/**<15, Reset when the vdd voltage is not stable*/ - case 16 : Serial.println ("RTCWDT_RTC_RESET");break; /**<16, RTC Watch dog reset digital core and rtc module*/ - default : Serial.println ("NO_MEAN"); - } -} - -void verbose_print_reset_reason(RESET_REASON reason) -{ - switch ( reason) - { - case 1 : Serial.println ("Vbat power on reset");break; - case 3 : Serial.println ("Software reset digital core");break; - case 4 : Serial.println ("Legacy watch dog reset digital core");break; - case 5 : Serial.println ("Deep Sleep reset digital core");break; - case 6 : Serial.println ("Reset by SLC module, reset digital core");break; - case 7 : Serial.println ("Timer Group0 Watch dog reset digital core");break; - case 8 : Serial.println ("Timer Group1 Watch dog reset digital core");break; - case 9 : Serial.println ("RTC Watch dog Reset digital core");break; - case 10 : Serial.println ("Instrusion tested to reset CPU");break; - case 11 : Serial.println ("Time Group reset CPU");break; - case 12 : Serial.println ("Software reset CPU");break; - case 13 : Serial.println ("RTC Watch dog Reset CPU");break; - case 14 : Serial.println ("for APP CPU, reseted by PRO CPU");break; - case 15 : Serial.println ("Reset when the vdd voltage is not stable");break; - case 16 : Serial.println ("RTC Watch dog reset digital core and rtc module");break; - default : Serial.println ("NO_MEAN"); - } -} - -void setup() { - // put your setup code here, to run once: - Serial.begin(115200); - delay(2000); - - Serial.println("CPU0 reset reason:"); - print_reset_reason(rtc_get_reset_reason(0)); - verbose_print_reset_reason(rtc_get_reset_reason(0)); - - Serial.println("CPU1 reset reason:"); - print_reset_reason(rtc_get_reset_reason(1)); - verbose_print_reset_reason(rtc_get_reset_reason(1)); - - // Set ESP32 to go to deep sleep to see a variation - // in the reset reason. Device will sleep for 5 seconds. - esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_OFF); - Serial.println("Going to sleep"); - esp_deep_sleep(5 * uS_TO_S_FACTOR); -} - -void loop() { - // put your main code here, to run repeatedly: - -} - -/* - Example Serial Log: - ==================== - -rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) -configsip: 0, SPIWP:0x00 -clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 -mode:DIO, clock div:1 -load:0x3fff0008,len:8 -load:0x3fff0010,len:160 -load:0x40078000,len:10632 -load:0x40080000,len:252 -entry 0x40080034 -CPU0 reset reason: -RTCWDT_RTC_RESET -RTC Watch dog reset digital core and rtc module -CPU1 reset reason: -EXT_CPU_RESET -for APP CPU, reseted by PRO CPU -Going to sleep -ets Jun 8 2016 00:22:57 - -rst:0x5 (DEEPSLEEP_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) -configsip: 0, SPIWP:0x00 -clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 -mode:DIO, clock div:1 -load:0x3fff0008,len:8 -load:0x3fff0010,len:160 -load:0x40078000,len:10632 -load:0x40080000,len:252 -entry 0x40080034 -CPU0 reset reason: -DEEPSLEEP_RESET -Deep Sleep reset digital core -CPU1 reset reason: -EXT_CPU_RESET -for APP CPU, reseted by PRO CPU -Going to sleep -ets Jun 8 2016 00:22:57 - -rst:0x5 (DEEPSLEEP_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) -configsip: 0, SPIWP:0x00 -clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 -mode:DIO, clock div:1 -load:0x3fff0008,len:8 -load:0x3fff0010,len:160 -load:0x40078000,len:10632 -load:0x40080000,len:252 -entry 0x40080034 -CPU0 reset reason: -DEEPSLEEP_RESET -Deep Sleep reset digital core -CPU1 reset reason: -EXT_CPU_RESET -for APP CPU, reseted by PRO CPU -Going to sleep - -*/ diff --git a/libraries/ESP32/examples/Time/SimpleTime/SimpleTime.ino b/libraries/ESP32/examples/Time/SimpleTime/SimpleTime.ino deleted file mode 100644 index 988c2a4d83b..00000000000 --- a/libraries/ESP32/examples/Time/SimpleTime/SimpleTime.ino +++ /dev/null @@ -1,47 +0,0 @@ -#include -#include "time.h" - -const char* ssid = "YOUR_SSID"; -const char* password = "YOUR_PASS"; - -const char* ntpServer = "pool.ntp.org"; -const long gmtOffset_sec = 3600; -const int daylightOffset_sec = 3600; - -void printLocalTime() -{ - struct tm timeinfo; - if(!getLocalTime(&timeinfo)){ - Serial.println("Failed to obtain time"); - return; - } - Serial.println(&timeinfo, "%A, %B %d %Y %H:%M:%S"); -} - -void setup() -{ - Serial.begin(115200); - - //connect to WiFi - Serial.printf("Connecting to %s ", ssid); - WiFi.begin(ssid, password); - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - } - Serial.println(" CONNECTED"); - - //init and get the time - configTime(gmtOffset_sec, daylightOffset_sec, ntpServer); - printLocalTime(); - - //disconnect WiFi as it's no longer needed - WiFi.disconnect(true); - WiFi.mode(WIFI_OFF); -} - -void loop() -{ - delay(1000); - printLocalTime(); -} diff --git a/libraries/ESP32/examples/Timer/RepeatTimer/RepeatTimer.ino b/libraries/ESP32/examples/Timer/RepeatTimer/RepeatTimer.ino deleted file mode 100644 index 5efef9cec4f..00000000000 --- a/libraries/ESP32/examples/Timer/RepeatTimer/RepeatTimer.ino +++ /dev/null @@ -1,82 +0,0 @@ -/* - Repeat timer example - - This example shows how to use hardware timer in ESP32. The timer calls onTimer - function every second. The timer can be stopped with button attached to PIN 0 - (IO0). - - This example code is in the public domain. - */ - -// Stop button is attached to PIN 0 (IO0) -#define BTN_STOP_ALARM 0 - -hw_timer_t * timer = NULL; -volatile SemaphoreHandle_t timerSemaphore; -portMUX_TYPE timerMux = portMUX_INITIALIZER_UNLOCKED; - -volatile uint32_t isrCounter = 0; -volatile uint32_t lastIsrAt = 0; - -void IRAM_ATTR onTimer(){ - // Increment the counter and set the time of ISR - portENTER_CRITICAL_ISR(&timerMux); - isrCounter++; - lastIsrAt = millis(); - portEXIT_CRITICAL_ISR(&timerMux); - // Give a semaphore that we can check in the loop - xSemaphoreGiveFromISR(timerSemaphore, NULL); - // It is safe to use digitalRead/Write here if you want to toggle an output -} - -void setup() { - Serial.begin(115200); - - // Set BTN_STOP_ALARM to input mode - pinMode(BTN_STOP_ALARM, INPUT); - - // Create semaphore to inform us when the timer has fired - timerSemaphore = xSemaphoreCreateBinary(); - - // Use 1st timer of 4 (counted from zero). - // Set 80 divider for prescaler (see ESP32 Technical Reference Manual for more - // info). - timer = timerBegin(0, 80, true); - - // Attach onTimer function to our timer. - timerAttachInterrupt(timer, &onTimer, true); - - // Set alarm to call onTimer function every second (value in microseconds). - // Repeat the alarm (third parameter) - timerAlarmWrite(timer, 1000000, true); - - // Start an alarm - timerAlarmEnable(timer); -} - -void loop() { - // If Timer has fired - if (xSemaphoreTake(timerSemaphore, 0) == pdTRUE){ - uint32_t isrCount = 0, isrTime = 0; - // Read the interrupt count and time - portENTER_CRITICAL(&timerMux); - isrCount = isrCounter; - isrTime = lastIsrAt; - portEXIT_CRITICAL(&timerMux); - // Print it - Serial.print("onTimer no. "); - Serial.print(isrCount); - Serial.print(" at "); - Serial.print(isrTime); - Serial.println(" ms"); - } - // If button is pressed - if (digitalRead(BTN_STOP_ALARM) == LOW) { - // If timer is still running - if (timer) { - // Stop and free timer - timerEnd(timer); - timer = NULL; - } - } -} diff --git a/libraries/ESP32/examples/Timer/WatchdogTimer/WatchdogTimer.ino b/libraries/ESP32/examples/Timer/WatchdogTimer/WatchdogTimer.ino deleted file mode 100644 index 056cab9640c..00000000000 --- a/libraries/ESP32/examples/Timer/WatchdogTimer/WatchdogTimer.ino +++ /dev/null @@ -1,39 +0,0 @@ -#include "esp_system.h" - -const int button = 0; //gpio to use to trigger delay -const int wdtTimeout = 3000; //time in ms to trigger the watchdog -hw_timer_t *timer = NULL; - -void IRAM_ATTR resetModule() { - ets_printf("reboot\n"); - esp_restart(); -} - -void setup() { - Serial.begin(115200); - Serial.println(); - Serial.println("running setup"); - - pinMode(button, INPUT_PULLUP); //init control pin - timer = timerBegin(0, 80, true); //timer 0, div 80 - timerAttachInterrupt(timer, &resetModule, true); //attach callback - timerAlarmWrite(timer, wdtTimeout * 1000, false); //set time in us - timerAlarmEnable(timer); //enable interrupt -} - -void loop() { - Serial.println("running main loop"); - - timerWrite(timer, 0); //reset timer (feed watchdog) - long loopTime = millis(); - //while button is pressed, delay up to 3 seconds to trigger the timer - while (!digitalRead(button)) { - Serial.println("button pressed"); - delay(500); - } - delay(1000); //simulate work - loopTime = millis() - loopTime; - - Serial.print("loop time is = "); - Serial.println(loopTime); //should be under 3000 -} diff --git a/libraries/ESP32/examples/Touch/TouchInterrupt/TouchInterrupt.ino b/libraries/ESP32/examples/Touch/TouchInterrupt/TouchInterrupt.ino deleted file mode 100644 index 8f40382ca56..00000000000 --- a/libraries/ESP32/examples/Touch/TouchInterrupt/TouchInterrupt.ino +++ /dev/null @@ -1,35 +0,0 @@ -/* -This is un example howto use Touch Intrrerupts -The bigger the threshold, the more sensible is the touch -*/ - -int threshold = 40; -bool touch1detected = false; -bool touch2detected = false; - -void gotTouch1(){ - touch1detected = true; -} - -void gotTouch2(){ - touch2detected = true; -} - -void setup() { - Serial.begin(115200); - delay(1000); // give me time to bring up serial monitor - Serial.println("ESP32 Touch Interrupt Test"); - touchAttachInterrupt(T2, gotTouch1, threshold); - touchAttachInterrupt(T3, gotTouch2, threshold); -} - -void loop(){ - if(touch1detected){ - touch1detected = false; - Serial.println("Touch 1 detected"); - } - if(touch2detected){ - touch2detected = false; - Serial.println("Touch 2 detected"); - } -} diff --git a/libraries/ESP32/examples/Touch/TouchRead/TouchRead.ino b/libraries/ESP32/examples/Touch/TouchRead/TouchRead.ino deleted file mode 100644 index e217fc196d5..00000000000 --- a/libraries/ESP32/examples/Touch/TouchRead/TouchRead.ino +++ /dev/null @@ -1,15 +0,0 @@ -// ESP32 Touch Test -// Just test touch pin - Touch0 is T0 which is on GPIO 4. - -void setup() -{ - Serial.begin(115200); - delay(1000); // give me time to bring up serial monitor - Serial.println("ESP32 Touch Test"); -} - -void loop() -{ - Serial.println(touchRead(T0)); // get value using T0 - delay(1000); -} diff --git a/libraries/ESP32/library.properties b/libraries/ESP32/library.properties deleted file mode 100644 index 8e78c3f3b3d..00000000000 --- a/libraries/ESP32/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=ESP32 -version=1.0 -author=Hristo Gochkov, Ivan Grokhtkov -maintainer=Hristo Gochkov -sentence=ESP32 sketches examples -paragraph= -category=Other -url= -architectures=esp32 diff --git a/libraries/ESP32/src/dummy.h b/libraries/ESP32/src/dummy.h deleted file mode 100644 index d8a140eda61..00000000000 --- a/libraries/ESP32/src/dummy.h +++ /dev/null @@ -1,2 +0,0 @@ -// This file is here only to silence warnings from Arduino IDE -// Currently IDE doesn't support no-code libraries, like this collection of example sketches. diff --git a/libraries/ESPmDNS/examples/mDNS-SD_Extended/mDNS-SD_Extended.ino b/libraries/ESPmDNS/examples/mDNS-SD_Extended/mDNS-SD_Extended.ino deleted file mode 100644 index 6f2dfddfb3b..00000000000 --- a/libraries/ESPmDNS/examples/mDNS-SD_Extended/mDNS-SD_Extended.ino +++ /dev/null @@ -1,80 +0,0 @@ -/* - ESP8266 mDNS-SD responder and query sample - - This is an example of announcing and finding services. - - Instructions: - - Update WiFi SSID and password as necessary. - - Flash the sketch to two ESP8266 boards - - The last one powered on should now find the other. - */ - -#include -#include - -const char* ssid = "..."; -const char* password = "..."; - -void setup() { - Serial.begin(115200); - WiFi.begin(ssid, password); - while (WiFi.status() != WL_CONNECTED) { - delay(250); - Serial.print("."); - } - Serial.println(""); - Serial.print("Connected to "); - Serial.println(ssid); - Serial.print("IP address: "); - Serial.println(WiFi.localIP()); - - if (!MDNS.begin("ESP32_Browser")) { - Serial.println("Error setting up MDNS responder!"); - while(1){ - delay(1000); - } - } -} - -void loop() { - browseService("http", "tcp"); - delay(1000); - browseService("arduino", "tcp"); - delay(1000); - browseService("workstation", "tcp"); - delay(1000); - browseService("smb", "tcp"); - delay(1000); - browseService("afpovertcp", "tcp"); - delay(1000); - browseService("ftp", "tcp"); - delay(1000); - browseService("ipp", "tcp"); - delay(1000); - browseService("printer", "tcp"); - delay(10000); -} - -void browseService(const char * service, const char * proto){ - Serial.printf("Browsing for service _%s._%s.local. ... ", service, proto); - int n = MDNS.queryService(service, proto); - if (n == 0) { - Serial.println("no services found"); - } else { - Serial.print(n); - Serial.println(" service(s) found"); - for (int i = 0; i < n; ++i) { - // Print details for each service found - Serial.print(" "); - Serial.print(i + 1); - Serial.print(": "); - Serial.print(MDNS.hostname(i)); - Serial.print(" ("); - Serial.print(MDNS.IP(i)); - Serial.print(":"); - Serial.print(MDNS.port(i)); - Serial.println(")"); - } - } - Serial.println(); -} diff --git a/libraries/ESPmDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino b/libraries/ESPmDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino deleted file mode 100644 index 8763d8d6108..00000000000 --- a/libraries/ESPmDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino +++ /dev/null @@ -1,120 +0,0 @@ -/* - ESP32 mDNS responder sample - - This is an example of an HTTP server that is accessible - via http://esp32.local URL thanks to mDNS responder. - - Instructions: - - Update WiFi SSID and password as necessary. - - Flash the sketch to the ESP32 board - - Install host software: - - For Linux, install Avahi (http://avahi.org/). - - For Windows, install Bonjour (http://www.apple.com/support/bonjour/). - - For Mac OSX and iOS support is built in through Bonjour already. - - Point your browser to http://esp32.local, you should see a response. - - */ - - -#include -#include -#include - -const char* ssid = "............"; -const char* password = ".............."; - -// TCP server at port 80 will respond to HTTP requests -WiFiServer server(80); - -void setup(void) -{ - Serial.begin(115200); - - // Connect to WiFi network - WiFi.begin(ssid, password); - Serial.println(""); - - // Wait for connection - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - } - Serial.println(""); - Serial.print("Connected to "); - Serial.println(ssid); - Serial.print("IP address: "); - Serial.println(WiFi.localIP()); - - // Set up mDNS responder: - // - first argument is the domain name, in this example - // the fully-qualified domain name is "esp8266.local" - // - second argument is the IP address to advertise - // we send our IP address on the WiFi network - if (!MDNS.begin("esp32")) { - Serial.println("Error setting up MDNS responder!"); - while(1) { - delay(1000); - } - } - Serial.println("mDNS responder started"); - - // Start TCP (HTTP) server - server.begin(); - Serial.println("TCP server started"); - - // Add service to MDNS-SD - MDNS.addService("http", "tcp", 80); -} - -void loop(void) -{ - // Check if a client has connected - WiFiClient client = server.available(); - if (!client) { - return; - } - Serial.println(""); - Serial.println("New client"); - - // Wait for data from client to become available - while(client.connected() && !client.available()){ - delay(1); - } - - // Read the first line of HTTP request - String req = client.readStringUntil('\r'); - - // First line of HTTP request looks like "GET /path HTTP/1.1" - // Retrieve the "/path" part by finding the spaces - int addr_start = req.indexOf(' '); - int addr_end = req.indexOf(' ', addr_start + 1); - if (addr_start == -1 || addr_end == -1) { - Serial.print("Invalid request: "); - Serial.println(req); - return; - } - req = req.substring(addr_start + 1, addr_end); - Serial.print("Request: "); - Serial.println(req); - - String s; - if (req == "/") - { - IPAddress ip = WiFi.localIP(); - String ipStr = String(ip[0]) + '.' + String(ip[1]) + '.' + String(ip[2]) + '.' + String(ip[3]); - s = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n\r\nHello from ESP32 at "; - s += ipStr; - s += "\r\n\r\n"; - Serial.println("Sending 200"); - } - else - { - s = "HTTP/1.1 404 Not Found\r\n\r\n"; - Serial.println("Sending 404"); - } - client.print(s); - - client.stop(); - Serial.println("Done with client"); -} - diff --git a/libraries/ESPmDNS/keywords.txt b/libraries/ESPmDNS/keywords.txt deleted file mode 100644 index c012cb59bd7..00000000000 --- a/libraries/ESPmDNS/keywords.txt +++ /dev/null @@ -1,25 +0,0 @@ -####################################### -# Syntax Coloring Map For Ultrasound -####################################### - -####################################### -# Datatypes (KEYWORD1) -####################################### - -ESPmDNS KEYWORD1 -MDNS KEYWORD1 - -####################################### -# Methods and Functions (KEYWORD2) -####################################### - -begin KEYWORD2 -end KEYWORD2 -addService KEYWORD2 -enableArduino KEYWORD2 -disableArduino KEYWORD2 - -####################################### -# Constants (LITERAL1) -####################################### - diff --git a/libraries/ESPmDNS/library.properties b/libraries/ESPmDNS/library.properties deleted file mode 100644 index 4f9561961b9..00000000000 --- a/libraries/ESPmDNS/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=ESPmDNS -version=1.0 -author=Hristo Gochkov, Ivan Grokhtkov -maintainer=Hristo Gochkov -sentence=ESP32 mDNS Library -paragraph= -category=Communication -url= -architectures=esp32 diff --git a/libraries/ESPmDNS/src/ESPmDNS.cpp b/libraries/ESPmDNS/src/ESPmDNS.cpp deleted file mode 100644 index 2211f67b9c7..00000000000 --- a/libraries/ESPmDNS/src/ESPmDNS.cpp +++ /dev/null @@ -1,343 +0,0 @@ -/* - -ESP8266 Multicast DNS (port of CC3000 Multicast DNS library) -Version 1.1 -Copyright (c) 2013 Tony DiCola (tony@tonydicola.com) -ESP8266 port (c) 2015 Ivan Grokhotkov (ivan@esp8266.com) -MDNS-SD Suport 2015 Hristo Gochkov (hristo@espressif.com) -Extended MDNS-SD support 2016 Lars Englund (lars.englund@gmail.com) - - -License (MIT license): - 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. - - */ - -// Important RFC's for reference: -// - DNS request and response: http://www.ietf.org/rfc/rfc1035.txt -// - Multicast DNS: http://www.ietf.org/rfc/rfc6762.txt -// - MDNS-SD: https://tools.ietf.org/html/rfc6763 - -#ifndef LWIP_OPEN_SRC -#define LWIP_OPEN_SRC -#endif - -#include "ESPmDNS.h" -#include "WiFi.h" -#include -#include "esp_wifi.h" - -// Add quotes around defined value -#ifdef __IN_ECLIPSE__ -#define STR_EXPAND(tok) #tok -#define STR(tok) STR_EXPAND(tok) -#else -#define STR(tok) tok -#endif - -static void _on_sys_event(system_event_t *event){ - mdns_handle_system_event(NULL, event); -} - -MDNSResponder::MDNSResponder() :results(NULL) {} -MDNSResponder::~MDNSResponder() { - end(); -} - -bool MDNSResponder::begin(const char* hostName){ - if(mdns_init()){ - log_e("Failed starting MDNS"); - return false; - } - WiFi.onEvent(_on_sys_event); - _hostname = hostName; - _hostname.toLowerCase(); - if(mdns_hostname_set(hostName)) { - log_e("Failed setting MDNS hostname"); - return false; - } - return true; -} - -void MDNSResponder::end() { - mdns_free(); -} - -void MDNSResponder::setInstanceName(String name) { - if (name.length() > 63) return; - if(mdns_instance_name_set(name.c_str())){ - log_e("Failed setting MDNS instance"); - return; - } -} - - -void MDNSResponder::enableArduino(uint16_t port, bool auth){ - mdns_txt_item_t arduTxtData[4] = { - {(char*)"board" ,(char*)STR(ARDUINO_VARIANT)}, - {(char*)"tcp_check" ,(char*)"no"}, - {(char*)"ssh_upload" ,(char*)"no"}, - {(char*)"auth_upload" ,(char*)"no"} - }; - - if(mdns_service_add(NULL, "_arduino", "_tcp", port, arduTxtData, 4)) { - log_e("Failed adding Arduino service"); - } - - if(auth && mdns_service_txt_item_set("_arduino", "_tcp", "auth_upload", "yes")){ - log_e("Failed setting Arduino txt item"); - } -} - -void MDNSResponder::disableArduino(){ - if(mdns_service_remove("_arduino", "_tcp")) { - log_w("Failed removing Arduino service"); - } -} - -void MDNSResponder::enableWorkstation(wifi_interface_t interface){ - char winstance[21+_hostname.length()]; - uint8_t mac[6]; - esp_wifi_get_mac(interface, mac); - sprintf(winstance, "%s [%02x:%02x:%02x:%02x:%02x:%02x]", _hostname.c_str(), mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - - if(mdns_service_add(NULL, "_workstation", "_tcp", 9, NULL, 0)) { - log_e("Failed adding Workstation service"); - } else if(mdns_service_instance_name_set("_workstation", "_tcp", winstance)) { - log_e("Failed setting Workstation service instance name"); - } -} - -void MDNSResponder::disableWorkstation(){ - if(mdns_service_remove("_workstation", "_tcp")) { - log_w("Failed removing Workstation service"); - } -} - -void MDNSResponder::addService(char *name, char *proto, uint16_t port){ - char _name[strlen(name)+2]; - char _proto[strlen(proto)+2]; - if (name[0] == '_') { - sprintf(_name, "%s", name); - } else { - sprintf(_name, "_%s", name); - } - if (proto[0] == '_') { - sprintf(_proto, "%s", proto); - } else { - sprintf(_proto, "_%s", proto); - } - - if(mdns_service_add(NULL, _name, _proto, port, NULL, 0)) { - log_e("Failed adding service %s.%s.\n", name, proto); - } -} - -bool MDNSResponder::addServiceTxt(char *name, char *proto, char *key, char *value){ - char _name[strlen(name)+2]; - char _proto[strlen(proto)+2]; - if (name[0] == '_') { - sprintf(_name, "%s", name); - } else { - sprintf(_name, "_%s", name); - } - if (proto[0] == '_') { - sprintf(_proto, "%s", proto); - } else { - sprintf(_proto, "_%s", proto); - } - - if(mdns_service_txt_item_set(_name, _proto, key, value)) { - log_e("Failed setting service TXT"); - return false; - } - return true; -} - -IPAddress MDNSResponder::queryHost(char *host, uint32_t timeout){ - struct ip4_addr addr; - addr.addr = 0; - - esp_err_t err = mdns_query_a(host, timeout, &addr); - if(err){ - if(err == ESP_ERR_NOT_FOUND){ - log_w("Host was not found!"); - return IPAddress(); - } - log_e("Query Failed"); - return IPAddress(); - } - return IPAddress(addr.addr); -} - - -int MDNSResponder::queryService(char *service, char *proto) { - if(!service || !service[0] || !proto || !proto[0]){ - log_e("Bad Parameters"); - return 0; - } - - if(results){ - mdns_query_results_free(results); - results = NULL; - } - - char srv[strlen(service)+2]; - char prt[strlen(proto)+2]; - if (service[0] == '_') { - sprintf(srv, "%s", service); - } else { - sprintf(srv, "_%s", service); - } - if (proto[0] == '_') { - sprintf(prt, "%s", proto); - } else { - sprintf(prt, "_%s", proto); - } - - esp_err_t err = mdns_query_ptr(srv, prt, 3000, 20, &results); - if(err){ - log_e("Query Failed"); - return 0; - } - if(!results){ - log_w("No results found!"); - return 0; - } - - mdns_result_t * r = results; - int i = 0; - while(r){ - i++; - r = r->next; - } - return i; -} - -mdns_result_t * MDNSResponder::_getResult(int idx){ - mdns_result_t * result = results; - int i = 0; - while(result){ - if(i == idx){ - break; - } - i++; - result = result->next; - } - return result; -} - -String MDNSResponder::hostname(int idx) { - mdns_result_t * result = _getResult(idx); - if(!result){ - log_e("Result %d not found", idx); - return String(); - } - return String(result->hostname); -} - -IPAddress MDNSResponder::IP(int idx) { - mdns_result_t * result = _getResult(idx); - if(!result){ - log_e("Result %d not found", idx); - return IPAddress(); - } - mdns_ip_addr_t * addr = result->addr; - while(addr){ - if(addr->addr.type == MDNS_IP_PROTOCOL_V4){ - return IPAddress(addr->addr.u_addr.ip4.addr); - } - addr = addr->next; - } - return IPAddress(); -} - -IPv6Address MDNSResponder::IPv6(int idx) { - mdns_result_t * result = _getResult(idx); - if(!result){ - log_e("Result %d not found", idx); - return IPv6Address(); - } - mdns_ip_addr_t * addr = result->addr; - while(addr){ - if(addr->addr.type == MDNS_IP_PROTOCOL_V6){ - return IPv6Address(addr->addr.u_addr.ip6.addr); - } - addr = addr->next; - } - return IPv6Address(); -} - -uint16_t MDNSResponder::port(int idx) { - mdns_result_t * result = _getResult(idx); - if(!result){ - log_e("Result %d not found", idx); - return 0; - } - return result->port; -} - -int MDNSResponder::numTxt(int idx) { - mdns_result_t * result = _getResult(idx); - if(!result){ - log_e("Result %d not found", idx); - return 0; - } - return result->txt_count; -} - -bool MDNSResponder::hasTxt(int idx, const char * key) { - mdns_result_t * result = _getResult(idx); - if(!result){ - log_e("Result %d not found", idx); - return false; - } - int i = 0; - while(i < result->txt_count) { - if (strcmp(result->txt[i].key, key) == 0) return true; - i++; - } - return false; -} - -String MDNSResponder::txt(int idx, const char * key) { - mdns_result_t * result = _getResult(idx); - if(!result){ - log_e("Result %d not found", idx); - return ""; - } - int i = 0; - while(i < result->txt_count) { - if (strcmp(result->txt[i].key, key) == 0) return result->txt[i].value; - i++; - } - return ""; -} - -String MDNSResponder::txt(int idx, int txtIdx) { - mdns_result_t * result = _getResult(idx); - if(!result){ - log_e("Result %d not found", idx); - return ""; - } - if (txtIdx >= result->txt_count) return ""; - return result->txt[txtIdx].value; -} - -MDNSResponder MDNS; diff --git a/libraries/ESPmDNS/src/ESPmDNS.h b/libraries/ESPmDNS/src/ESPmDNS.h deleted file mode 100644 index e66fbdb7e62..00000000000 --- a/libraries/ESPmDNS/src/ESPmDNS.h +++ /dev/null @@ -1,123 +0,0 @@ -/* -ESP8266 Multicast DNS (port of CC3000 Multicast DNS library) -Version 1.1 -Copyright (c) 2013 Tony DiCola (tony@tonydicola.com) -ESP8266 port (c) 2015 Ivan Grokhotkov (ivan@esp8266.com) -MDNS-SD Suport 2015 Hristo Gochkov (hristo@espressif.com) -Extended MDNS-SD support 2016 Lars Englund (lars.englund@gmail.com) -Rewritten for ESP32 by Hristo Gochkov (hristo@espressif.com) - -This is a simple implementation of multicast DNS query support for an Arduino -running on ESP32 chip. - -Usage: -- Include the ESP32 Multicast DNS library in the sketch. -- Call the begin method in the sketch's setup and provide a domain name (without - the '.local' suffix, i.e. just provide 'foo' to resolve 'foo.local'), and the - Adafruit CC3000 class instance. Optionally provide a time to live (in seconds) - for the DNS record--the default is 1 hour. -- Call the update method in each iteration of the sketch's loop function. - -License (MIT license): - 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. - -*/ -#ifndef ESP32MDNS_H -#define ESP32MDNS_H - -#include "Arduino.h" -#include "IPv6Address.h" -#include "mdns.h" - -//this should be defined at build time -#ifndef ARDUINO_VARIANT -#define ARDUINO_VARIANT "esp32" -#endif - -class MDNSResponder { -public: - MDNSResponder(); - ~MDNSResponder(); - bool begin(const char* hostName); - void end(); - - void setInstanceName(String name); - void setInstanceName(const char * name){ - setInstanceName(String(name)); - } - void setInstanceName(char * name){ - setInstanceName(String(name)); - } - - void addService(char *service, char *proto, uint16_t port); - void addService(const char *service, const char *proto, uint16_t port){ - addService((char *)service, (char *)proto, port); - } - void addService(String service, String proto, uint16_t port){ - addService(service.c_str(), proto.c_str(), port); - } - - bool addServiceTxt(char *name, char *proto, char * key, char * value); - void addServiceTxt(const char *name, const char *proto, const char *key,const char * value){ - addServiceTxt((char *)name, (char *)proto, (char *)key, (char *)value); - } - void addServiceTxt(String name, String proto, String key, String value){ - addServiceTxt(name.c_str(), proto.c_str(), key.c_str(), value.c_str()); - } - - void enableArduino(uint16_t port=3232, bool auth=false); - void disableArduino(); - - void enableWorkstation(wifi_interface_t interface=ESP_IF_WIFI_STA); - void disableWorkstation(); - - IPAddress queryHost(char *host, uint32_t timeout=2000); - IPAddress queryHost(const char *host, uint32_t timeout=2000){ - return queryHost((char *)host, timeout); - } - IPAddress queryHost(String host, uint32_t timeout=2000){ - return queryHost(host.c_str(), timeout); - } - - int queryService(char *service, char *proto); - int queryService(const char *service, const char *proto){ - return queryService((char *)service, (char *)proto); - } - int queryService(String service, String proto){ - return queryService(service.c_str(), proto.c_str()); - } - - String hostname(int idx); - IPAddress IP(int idx); - IPv6Address IPv6(int idx); - uint16_t port(int idx); - int numTxt(int idx); - bool hasTxt(int idx, const char * key); - String txt(int idx, const char * key); - String txt(int idx, int txtIdx); - -private: - String _hostname; - mdns_result_t * results; - mdns_result_t * _getResult(int idx); -}; - -extern MDNSResponder MDNS; - -#endif //ESP32MDNS_H diff --git a/libraries/FFat/examples/FFat_Test/FFat_Test.ino b/libraries/FFat/examples/FFat_Test/FFat_Test.ino deleted file mode 100644 index 952ab6d11ac..00000000000 --- a/libraries/FFat/examples/FFat_Test/FFat_Test.ino +++ /dev/null @@ -1,185 +0,0 @@ -#include "FS.h" -#include "FFat.h" - -// This file should be compiled with 'Partition Scheme' (in Tools menu) -// set to 'Default with ffat' if you have a 4MB ESP32 dev module or -// set to '16M Fat' if you have a 16MB ESP32 dev module. - -// You only need to format FFat the first time you run a test -#define FORMAT_FFAT true - -void listDir(fs::FS &fs, const char * dirname, uint8_t levels){ - Serial.printf("Listing directory: %s\r\n", dirname); - - File root = fs.open(dirname); - if(!root){ - Serial.println("- failed to open directory"); - return; - } - if(!root.isDirectory()){ - Serial.println(" - not a directory"); - return; - } - - File file = root.openNextFile(); - while(file){ - if(file.isDirectory()){ - Serial.print(" DIR : "); - Serial.println(file.name()); - if(levels){ - listDir(fs, file.name(), levels -1); - } - } else { - Serial.print(" FILE: "); - Serial.print(file.name()); - Serial.print("\tSIZE: "); - Serial.println(file.size()); - } - file = root.openNextFile(); - } -} - -void readFile(fs::FS &fs, const char * path){ - Serial.printf("Reading file: %s\r\n", path); - - File file = fs.open(path); - if(!file || file.isDirectory()){ - Serial.println("- failed to open file for reading"); - return; - } - - Serial.println("- read from file:"); - while(file.available()){ - Serial.write(file.read()); - } -} - -void writeFile(fs::FS &fs, const char * path, const char * message){ - Serial.printf("Writing file: %s\r\n", path); - - File file = fs.open(path, FILE_WRITE); - if(!file){ - Serial.println("- failed to open file for writing"); - return; - } - if(file.print(message)){ - Serial.println("- file written"); - } else { - Serial.println("- frite failed"); - } -} - -void appendFile(fs::FS &fs, const char * path, const char * message){ - Serial.printf("Appending to file: %s\r\n", path); - - File file = fs.open(path, FILE_APPEND); - if(!file){ - Serial.println("- failed to open file for appending"); - return; - } - if(file.print(message)){ - Serial.println("- message appended"); - } else { - Serial.println("- append failed"); - } -} - -void renameFile(fs::FS &fs, const char * path1, const char * path2){ - Serial.printf("Renaming file %s to %s\r\n", path1, path2); - if (fs.rename(path1, path2)) { - Serial.println("- file renamed"); - } else { - Serial.println("- rename failed"); - } -} - -void deleteFile(fs::FS &fs, const char * path){ - Serial.printf("Deleting file: %s\r\n", path); - if(fs.remove(path)){ - Serial.println("- file deleted"); - } else { - Serial.println("- delete failed"); - } -} - -void testFileIO(fs::FS &fs, const char * path){ - Serial.printf("Testing file I/O with %s\r\n", path); - - static uint8_t buf[512]; - size_t len = 0; - File file = fs.open(path, FILE_WRITE); - if(!file){ - Serial.println("- failed to open file for writing"); - return; - } - - size_t i; - Serial.print("- writing" ); - uint32_t start = millis(); - for(i=0; i<2048; i++){ - if ((i & 0x001F) == 0x001F){ - Serial.print("."); - } - file.write(buf, 512); - } - Serial.println(""); - uint32_t end = millis() - start; - Serial.printf(" - %u bytes written in %u ms\r\n", 2048 * 512, end); - file.close(); - - file = fs.open(path); - start = millis(); - end = start; - i = 0; - if(file && !file.isDirectory()){ - len = file.size(); - size_t flen = len; - start = millis(); - Serial.print("- reading" ); - while(len){ - size_t toRead = len; - if(toRead > 512){ - toRead = 512; - } - file.read(buf, toRead); - if ((i++ & 0x001F) == 0x001F){ - Serial.print("."); - } - len -= toRead; - } - Serial.println(""); - end = millis() - start; - Serial.printf("- %u bytes read in %u ms\r\n", flen, end); - file.close(); - } else { - Serial.println("- failed to open file for reading"); - } -} - -void setup(){ - Serial.begin(115200); - Serial.setDebugOutput(true); - if (FORMAT_FFAT) FFat.format(); - if(!FFat.begin()){ - Serial.println("FFat Mount Failed"); - return; - } - - Serial.printf("Total space: %10u\n", FFat.totalBytes()); - Serial.printf("Free space: %10u\n", FFat.freeBytes()); - listDir(FFat, "/", 0); - writeFile(FFat, "/hello.txt", "Hello "); - appendFile(FFat, "/hello.txt", "World!\r\n"); - readFile(FFat, "/hello.txt"); - renameFile(FFat, "/hello.txt", "/foo.txt"); - readFile(FFat, "/foo.txt"); - deleteFile(FFat, "/foo.txt"); - testFileIO(FFat, "/test.txt"); - Serial.printf("Free space: %10u\n", FFat.freeBytes()); - deleteFile(FFat, "/test.txt"); - Serial.println( "Test complete" ); -} - -void loop(){ - -} diff --git a/libraries/FFat/examples/FFat_time/FFat_time.ino b/libraries/FFat/examples/FFat_time/FFat_time.ino deleted file mode 100644 index 1e3794514c5..00000000000 --- a/libraries/FFat/examples/FFat_time/FFat_time.ino +++ /dev/null @@ -1,177 +0,0 @@ -#include "FS.h" -#include "FFat.h" -#include -#include - -const char* ssid = "your-ssid"; -const char* password = "your-password"; - -long timezone = 1; -byte daysavetime = 1; - -void listDir(fs::FS &fs, const char * dirname, uint8_t levels){ - Serial.printf("Listing directory: %s\n", dirname); - - File root = fs.open(dirname); - if(!root){ - Serial.println("Failed to open directory"); - return; - } - if(!root.isDirectory()){ - Serial.println("Not a directory"); - return; - } - - File file = root.openNextFile(); - while(file){ - if(file.isDirectory()){ - Serial.print(" DIR : "); - Serial.print (file.name()); - time_t t= file.getLastWrite(); - struct tm * tmstruct = localtime(&t); - Serial.printf(" LAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n",(tmstruct->tm_year)+1900,( tmstruct->tm_mon)+1, tmstruct->tm_mday,tmstruct->tm_hour , tmstruct->tm_min, tmstruct->tm_sec); - if(levels){ - listDir(fs, file.name(), levels -1); - } - } else { - Serial.print(" FILE: "); - Serial.print(file.name()); - Serial.print(" SIZE: "); - Serial.print(file.size()); - time_t t= file.getLastWrite(); - struct tm * tmstruct = localtime(&t); - Serial.printf(" LAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n",(tmstruct->tm_year)+1900,( tmstruct->tm_mon)+1, tmstruct->tm_mday,tmstruct->tm_hour , tmstruct->tm_min, tmstruct->tm_sec); - } - file = root.openNextFile(); - } -} - -void createDir(fs::FS &fs, const char * path){ - Serial.printf("Creating Dir: %s\n", path); - if(fs.mkdir(path)){ - Serial.println("Dir created"); - } else { - Serial.println("mkdir failed"); - } -} - -void removeDir(fs::FS &fs, const char * path){ - Serial.printf("Removing Dir: %s\n", path); - if(fs.rmdir(path)){ - Serial.println("Dir removed"); - } else { - Serial.println("rmdir failed"); - } -} - -void readFile(fs::FS &fs, const char * path){ - Serial.printf("Reading file: %s\n", path); - - File file = fs.open(path); - if(!file){ - Serial.println("Failed to open file for reading"); - return; - } - - Serial.print("Read from file: "); - while(file.available()){ - Serial.write(file.read()); - } - file.close(); -} - -void writeFile(fs::FS &fs, const char * path, const char * message){ - Serial.printf("Writing file: %s\n", path); - - File file = fs.open(path, FILE_WRITE); - if(!file){ - Serial.println("Failed to open file for writing"); - return; - } - if(file.print(message)){ - Serial.println("File written"); - } else { - Serial.println("Write failed"); - } - file.close(); -} - -void appendFile(fs::FS &fs, const char * path, const char * message){ - Serial.printf("Appending to file: %s\n", path); - - File file = fs.open(path, FILE_APPEND); - if(!file){ - Serial.println("Failed to open file for appending"); - return; - } - if(file.print(message)){ - Serial.println("Message appended"); - } else { - Serial.println("Append failed"); - } - file.close(); -} - -void renameFile(fs::FS &fs, const char * path1, const char * path2){ - Serial.printf("Renaming file %s to %s\n", path1, path2); - if (fs.rename(path1, path2)) { - Serial.println("File renamed"); - } else { - Serial.println("Rename failed"); - } -} - -void deleteFile(fs::FS &fs, const char * path){ - Serial.printf("Deleting file: %s\n", path); - if(fs.remove(path)){ - Serial.println("File deleted"); - } else { - Serial.println("Delete failed"); - } -} - -void setup(){ - Serial.begin(115200); - // We start by connecting to a WiFi network - Serial.println(); - Serial.println(); - Serial.print("Connecting to "); - Serial.println(ssid); - - WiFi.begin(ssid, password); - - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - } - Serial.println("WiFi connected"); - Serial.println("IP address: "); - Serial.println(WiFi.localIP()); - Serial.println("Contacting Time Server"); - configTime(3600*timezone, daysavetime*3600, "time.nist.gov", "0.pool.ntp.org", "1.pool.ntp.org"); - struct tm tmstruct ; - delay(2000); - tmstruct.tm_year = 0; - getLocalTime(&tmstruct, 5000); - Serial.printf("\nNow is : %d-%02d-%02d %02d:%02d:%02d\n",(tmstruct.tm_year)+1900,( tmstruct.tm_mon)+1, tmstruct.tm_mday,tmstruct.tm_hour , tmstruct.tm_min, tmstruct.tm_sec); - Serial.println(""); - - if(!FFat.begin(true)){ - Serial.println("FFat Mount Failed"); - return; - } - - listDir(FFat, "/", 0); - removeDir(FFat, "/mydir"); - createDir(FFat, "/mydir"); - deleteFile(FFat, "/hello.txt"); - writeFile(FFat, "/hello.txt", "Hello "); - appendFile(FFat, "/hello.txt", "World!\n"); - listDir(FFat, "/", 0); -} - -void loop(){ - -} - - diff --git a/libraries/FFat/library.properties b/libraries/FFat/library.properties deleted file mode 100644 index aebca39d950..00000000000 --- a/libraries/FFat/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=FFat -version=1.0 -author=Hristo Gochkov, Ivan Grokhtkov, Larry Bernstone -maintainer=Hristo Gochkov -sentence=ESP32 FAT on Flash File System -paragraph= -category=Data Storage -url= -architectures=esp32 diff --git a/libraries/FFat/src/FFat.cpp b/libraries/FFat/src/FFat.cpp deleted file mode 100644 index 0d2b2cb26ab..00000000000 --- a/libraries/FFat/src/FFat.cpp +++ /dev/null @@ -1,166 +0,0 @@ -// 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. - -#include "vfs_api.h" -extern "C" { -#include "esp_vfs_fat.h" -#include "diskio.h" -#include "diskio_wl.h" -#include "vfs_fat_internal.h" -} -#include "FFat.h" - -using namespace fs; - -F_Fat::F_Fat(FSImplPtr impl) - : FS(impl) -{} - -const esp_partition_t *check_ffat_partition(const char* label) -{ - const esp_partition_t* ck_part = esp_partition_find_first( - ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_FAT, label); - if (!ck_part) { - log_e("No FAT partition found with label %s", label); - return NULL; - } - return ck_part; -} - -bool F_Fat::begin(bool formatOnFail, const char * basePath, uint8_t maxOpenFiles, const char * partitionLabel) -{ - if(_wl_handle != WL_INVALID_HANDLE){ - log_w("Already Mounted!"); - return true; - } - - if (!check_ffat_partition(partitionLabel)){ - log_e("No fat partition found on flash"); - return false; - } - - esp_vfs_fat_mount_config_t conf = { - .format_if_mount_failed = formatOnFail, - .max_files = maxOpenFiles, - .allocation_unit_size = CONFIG_WL_SECTOR_SIZE - }; - esp_err_t err = esp_vfs_fat_spiflash_mount(basePath, partitionLabel, &conf, &_wl_handle); - if(err){ - log_e("Mounting FFat partition failed! Error: %d", err); - esp_vfs_fat_spiflash_unmount(basePath, _wl_handle); - _wl_handle = WL_INVALID_HANDLE; - return false; - } - _impl->mountpoint(basePath); - return true; -} - -void F_Fat::end() -{ - if(_wl_handle != WL_INVALID_HANDLE){ - esp_err_t err = esp_vfs_fat_spiflash_unmount(_impl->mountpoint(), _wl_handle); - if(err){ - log_e("Unmounting FFat partition failed! Error: %d", err); - return; - } - _wl_handle = WL_INVALID_HANDLE; - _impl->mountpoint(NULL); - } -} - -bool F_Fat::format(bool full_wipe, char* partitionLabel) -{ - esp_err_t result; - bool res = true; - if(_wl_handle != WL_INVALID_HANDLE){ - log_w("Already Mounted!"); - return false; - } - wl_handle_t temp_handle; -// Attempt to mount to see if there is already data - const esp_partition_t *ffat_partition = check_ffat_partition(partitionLabel); - if (!ffat_partition){ - log_w("No partition!"); - return false; - } - result = wl_mount(ffat_partition, &temp_handle); - - if (result == ESP_OK) { -// Wipe disk- quick just wipes the FAT. Full zeroes the whole disk - uint32_t wipe_size = full_wipe ? wl_size(temp_handle) : 16384; - wl_erase_range(temp_handle, 0, wipe_size); - wl_unmount(temp_handle); - } else { - res = false; - log_w("wl_mount failed!"); - } -// Now do a mount with format_if_fail (which it will) - esp_vfs_fat_mount_config_t conf = { - .format_if_mount_failed = true, - .max_files = 1, - .allocation_unit_size = CONFIG_WL_SECTOR_SIZE - }; - result = esp_vfs_fat_spiflash_mount("/format_ffat", partitionLabel, &conf, &temp_handle); - esp_vfs_fat_spiflash_unmount("/format_ffat", temp_handle); - if (result != ESP_OK){ - res = false; - log_w("esp_vfs_fat_spiflash_mount failed!"); - } - return res; -} - -size_t F_Fat::totalBytes() -{ - FATFS *fs; - DWORD free_clust, tot_sect, sect_size; - - BYTE pdrv = ff_diskio_get_pdrv_wl(_wl_handle); - char drv[3] = {(char)(48+pdrv), ':', 0}; - if ( f_getfree(drv, &free_clust, &fs) != FR_OK){ - return 0; - } - tot_sect = (fs->n_fatent - 2) * fs->csize; - sect_size = CONFIG_WL_SECTOR_SIZE; - return tot_sect * sect_size; -} - -size_t F_Fat::freeBytes() -{ - - FATFS *fs; - DWORD free_clust, free_sect, sect_size; - - BYTE pdrv = ff_diskio_get_pdrv_wl(_wl_handle); - char drv[3] = {(char)(48+pdrv), ':', 0}; - if ( f_getfree(drv, &free_clust, &fs) != FR_OK){ - return 0; - } - free_sect = free_clust * fs->csize; - sect_size = CONFIG_WL_SECTOR_SIZE; - return free_sect * sect_size; -} - -bool F_Fat::exists(const char* path) -{ - File f = open(path, "r"); - return (f == true) && !f.isDirectory(); -} - -bool F_Fat::exists(const String& path) -{ - return exists(path.c_str()); -} - - -F_Fat FFat = F_Fat(FSImplPtr(new VFSImpl())); diff --git a/libraries/FFat/src/FFat.h b/libraries/FFat/src/FFat.h deleted file mode 100644 index a32c950bb6e..00000000000 --- a/libraries/FFat/src/FFat.h +++ /dev/null @@ -1,47 +0,0 @@ -// 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. -#ifndef _FFAT_H_ -#define _FFAT_H_ - -#include "FS.h" -#include "wear_levelling.h" - -#define FFAT_WIPE_QUICK 0 -#define FFAT_WIPE_FULL 1 -#define FFAT_PARTITION_LABEL "ffat" - -namespace fs -{ - -class F_Fat : public FS -{ -public: - F_Fat(FSImplPtr impl); - bool begin(bool formatOnFail=false, const char * basePath="/ffat", uint8_t maxOpenFiles=10, const char * partitionLabel = (char*)FFAT_PARTITION_LABEL); - bool format(bool full_wipe = FFAT_WIPE_QUICK, char* partitionLabel = (char*)FFAT_PARTITION_LABEL); - size_t totalBytes(); - size_t freeBytes(); - void end(); - bool exists(const char* path); - bool exists(const String& path); - -private: - wl_handle_t _wl_handle = WL_INVALID_HANDLE; -}; - -} - -extern fs::F_Fat FFat; - -#endif /* _FFAT_H_ */ diff --git a/libraries/FS/library.properties b/libraries/FS/library.properties deleted file mode 100644 index fb35385ba24..00000000000 --- a/libraries/FS/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=FS -version=1.0 -author=Hristo Gochkov, Ivan Grokhtkov -maintainer=Hristo Gochkov -sentence=ESP32 File System -paragraph= -category=Data Storage -url= -architectures=esp32 diff --git a/libraries/FS/src/FS.cpp b/libraries/FS/src/FS.cpp deleted file mode 100644 index ab4f5d5289a..00000000000 --- a/libraries/FS/src/FS.cpp +++ /dev/null @@ -1,269 +0,0 @@ -/* - FS.cpp - file system wrapper - Copyright (c) 2015 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "FS.h" -#include "FSImpl.h" - -using namespace fs; - -size_t File::write(uint8_t c) -{ - if (!_p) { - return 0; - } - - return _p->write(&c, 1); -} - -time_t File::getLastWrite() -{ - if (!_p) { - return 0; - } - - return _p->getLastWrite(); -} - -size_t File::write(const uint8_t *buf, size_t size) -{ - if (!_p) { - return 0; - } - - return _p->write(buf, size); -} - -int File::available() -{ - if (!_p) { - return false; - } - - return _p->size() - _p->position(); -} - -int File::read() -{ - if (!_p) { - return -1; - } - - uint8_t result; - if (_p->read(&result, 1) != 1) { - return -1; - } - - return result; -} - -size_t File::read(uint8_t* buf, size_t size) -{ - if (!_p) { - return -1; - } - - return _p->read(buf, size); -} - -int File::peek() -{ - if (!_p) { - return -1; - } - - size_t curPos = _p->position(); - int result = read(); - seek(curPos, SeekSet); - return result; -} - -void File::flush() -{ - if (!_p) { - return; - } - - _p->flush(); -} - -bool File::seek(uint32_t pos, SeekMode mode) -{ - if (!_p) { - return false; - } - - return _p->seek(pos, mode); -} - -size_t File::position() const -{ - if (!_p) { - return 0; - } - - return _p->position(); -} - -size_t File::size() const -{ - if (!_p) { - return 0; - } - - return _p->size(); -} - -void File::close() -{ - if (_p) { - _p->close(); - _p = nullptr; - } -} - -File::operator bool() const -{ - return !!_p; -} - -const char* File::name() const -{ - if (!_p) { - return nullptr; - } - - return _p->name(); -} - -//to implement -boolean File::isDirectory(void) -{ - if (!_p) { - return false; - } - return _p->isDirectory(); -} - -File File::openNextFile(const char* mode) -{ - if (!_p) { - return File(); - } - return _p->openNextFile(mode); -} - -void File::rewindDirectory(void) -{ - if (!_p) { - return; - } - _p->rewindDirectory(); -} - -File FS::open(const String& path, const char* mode) -{ - return open(path.c_str(), mode); -} - -File FS::open(const char* path, const char* mode) -{ - if (!_impl) { - return File(); - } - - return File(_impl->open(path, mode)); -} - -bool FS::exists(const char* path) -{ - if (!_impl) { - return false; - } - return _impl->exists(path); -} - -bool FS::exists(const String& path) -{ - return exists(path.c_str()); -} - -bool FS::remove(const char* path) -{ - if (!_impl) { - return false; - } - return _impl->remove(path); -} - -bool FS::remove(const String& path) -{ - return remove(path.c_str()); -} - -bool FS::rename(const char* pathFrom, const char* pathTo) -{ - if (!_impl) { - return false; - } - return _impl->rename(pathFrom, pathTo); -} - -bool FS::rename(const String& pathFrom, const String& pathTo) -{ - return rename(pathFrom.c_str(), pathTo.c_str()); -} - - -bool FS::mkdir(const char *path) -{ - if (!_impl) { - return false; - } - return _impl->mkdir(path); -} - -bool FS::mkdir(const String &path) -{ - return mkdir(path.c_str()); -} - -bool FS::rmdir(const char *path) -{ - if (!_impl) { - return false; - } - return _impl->rmdir(path); -} - -bool FS::rmdir(const String &path) -{ - return rmdir(path.c_str()); -} - - -void FSImpl::mountpoint(const char * mp) -{ - _mountpoint = mp; -} - -const char * FSImpl::mountpoint() -{ - return _mountpoint; -} diff --git a/libraries/FS/src/FS.h b/libraries/FS/src/FS.h deleted file mode 100644 index d63fc5da305..00000000000 --- a/libraries/FS/src/FS.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - FS.h - file system wrapper - Copyright (c) 2015 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef FS_H -#define FS_H - -#include -#include - -namespace fs -{ - -#define FILE_READ "r" -#define FILE_WRITE "w" -#define FILE_APPEND "a" - -class File; - -class FileImpl; -typedef std::shared_ptr FileImplPtr; -class FSImpl; -typedef std::shared_ptr FSImplPtr; - -enum SeekMode { - SeekSet = 0, - SeekCur = 1, - SeekEnd = 2 -}; - -class File : public Stream -{ -public: - File(FileImplPtr p = FileImplPtr()) : _p(p) { - _timeout = 0; - } - - size_t write(uint8_t) override; - size_t write(const uint8_t *buf, size_t size) override; - int available() override; - int read() override; - int peek() override; - void flush() override; - size_t read(uint8_t* buf, size_t size); - size_t readBytes(char *buffer, size_t length) - { - return read((uint8_t*)buffer, length); - } - - bool seek(uint32_t pos, SeekMode mode); - bool seek(uint32_t pos) - { - return seek(pos, SeekSet); - } - size_t position() const; - size_t size() const; - void close(); - operator bool() const; - time_t getLastWrite(); - const char* name() const; - - boolean isDirectory(void); - File openNextFile(const char* mode = FILE_READ); - void rewindDirectory(void); - -protected: - FileImplPtr _p; -}; - -class FS -{ -public: - FS(FSImplPtr impl) : _impl(impl) { } - - File open(const char* path, const char* mode = FILE_READ); - File open(const String& path, const char* mode = FILE_READ); - - bool exists(const char* path); - bool exists(const String& path); - - bool remove(const char* path); - bool remove(const String& path); - - bool rename(const char* pathFrom, const char* pathTo); - bool rename(const String& pathFrom, const String& pathTo); - - bool mkdir(const char *path); - bool mkdir(const String &path); - - bool rmdir(const char *path); - bool rmdir(const String &path); - - -protected: - FSImplPtr _impl; -}; - -} // namespace fs - -#ifndef FS_NO_GLOBALS -using fs::FS; -using fs::File; -using fs::SeekMode; -using fs::SeekSet; -using fs::SeekCur; -using fs::SeekEnd; -#endif //FS_NO_GLOBALS - -#endif //FS_H diff --git a/libraries/FS/src/FSImpl.h b/libraries/FS/src/FSImpl.h deleted file mode 100644 index 70e5cb1e3cb..00000000000 --- a/libraries/FS/src/FSImpl.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - FSImpl.h - base file system interface - Copyright (c) 2015 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -#ifndef FSIMPL_H -#define FSIMPL_H - -#include -#include - -namespace fs -{ - -class FileImpl -{ -public: - virtual ~FileImpl() { } - virtual size_t write(const uint8_t *buf, size_t size) = 0; - virtual size_t read(uint8_t* buf, size_t size) = 0; - virtual void flush() = 0; - virtual bool seek(uint32_t pos, SeekMode mode) = 0; - virtual size_t position() const = 0; - virtual size_t size() const = 0; - virtual void close() = 0; - virtual time_t getLastWrite() = 0; - virtual const char* name() const = 0; - virtual boolean isDirectory(void) = 0; - virtual FileImplPtr openNextFile(const char* mode) = 0; - virtual void rewindDirectory(void) = 0; - virtual operator bool() = 0; -}; - -class FSImpl -{ -protected: - const char * _mountpoint; -public: - FSImpl() : _mountpoint(NULL) { } - virtual ~FSImpl() { } - virtual FileImplPtr open(const char* path, const char* mode) = 0; - virtual bool exists(const char* path) = 0; - virtual bool rename(const char* pathFrom, const char* pathTo) = 0; - virtual bool remove(const char* path) = 0; - virtual bool mkdir(const char *path) = 0; - virtual bool rmdir(const char *path) = 0; - void mountpoint(const char *); - const char * mountpoint(); -}; - -} // namespace fs - -#endif //FSIMPL_H diff --git a/libraries/FS/src/vfs_api.cpp b/libraries/FS/src/vfs_api.cpp deleted file mode 100644 index 6502f760560..00000000000 --- a/libraries/FS/src/vfs_api.cpp +++ /dev/null @@ -1,414 +0,0 @@ -// 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. - -#include "vfs_api.h" - -using namespace fs; - -FileImplPtr VFSImpl::open(const char* path, const char* mode) -{ - if(!_mountpoint) { - log_e("File system is not mounted"); - return FileImplPtr(); - } - - if(!path || path[0] != '/') { - log_e("%s does not start with /", path); - return FileImplPtr(); - } - - char * temp = (char *)malloc(strlen(path)+strlen(_mountpoint)+2); - if(!temp) { - log_e("malloc failed"); - return FileImplPtr(); - } - - sprintf(temp,"%s%s", _mountpoint, path); - - struct stat st; - //file lound - if(!stat(temp, &st)) { - free(temp); - if (S_ISREG(st.st_mode) || S_ISDIR(st.st_mode)) { - return std::make_shared(this, path, mode); - } - log_e("%s has wrong mode 0x%08X", path, st.st_mode); - return FileImplPtr(); - } - - //file not found but mode permits creation - if(mode && mode[0] != 'r') { - free(temp); - return std::make_shared(this, path, mode); - } - - //try to open this as directory (might be mount point) - DIR * d = opendir(temp); - if(d) { - closedir(d); - free(temp); - return std::make_shared(this, path, mode); - } - - log_e("%s does not exist", temp); - free(temp); - return FileImplPtr(); -} - -bool VFSImpl::exists(const char* path) -{ - if(!_mountpoint) { - log_e("File system is not mounted"); - return false; - } - - VFSFileImpl f(this, path, "r"); - if(f) { - f.close(); - return true; - } - return false; -} - -bool VFSImpl::rename(const char* pathFrom, const char* pathTo) -{ - if(!_mountpoint) { - log_e("File system is not mounted"); - return false; - } - - if(!pathFrom || pathFrom[0] != '/' || !pathTo || pathTo[0] != '/') { - log_e("bad arguments"); - return false; - } - if(!exists(pathFrom)) { - log_e("%s does not exists", pathFrom); - return false; - } - char * temp1 = (char *)malloc(strlen(pathFrom)+strlen(_mountpoint)+1); - if(!temp1) { - log_e("malloc failed"); - return false; - } - char * temp2 = (char *)malloc(strlen(pathTo)+strlen(_mountpoint)+1); - if(!temp2) { - free(temp1); - log_e("malloc failed"); - return false; - } - sprintf(temp1,"%s%s", _mountpoint, pathFrom); - sprintf(temp2,"%s%s", _mountpoint, pathTo); - auto rc = ::rename(temp1, temp2); - free(temp1); - free(temp2); - return rc == 0; -} - -bool VFSImpl::remove(const char* path) -{ - if(!_mountpoint) { - log_e("File system is not mounted"); - return false; - } - - if(!path || path[0] != '/') { - log_e("bad arguments"); - return false; - } - - VFSFileImpl f(this, path, "r"); - if(!f || f.isDirectory()) { - if(f) { - f.close(); - } - log_e("%s does not exists or is directory", path); - return false; - } - f.close(); - - char * temp = (char *)malloc(strlen(path)+strlen(_mountpoint)+1); - if(!temp) { - log_e("malloc failed"); - return false; - } - sprintf(temp,"%s%s", _mountpoint, path); - auto rc = unlink(temp); - free(temp); - return rc == 0; -} - -bool VFSImpl::mkdir(const char *path) -{ - if(!_mountpoint) { - log_e("File system is not mounted"); - return false; - } - - VFSFileImpl f(this, path, "r"); - if(f && f.isDirectory()) { - f.close(); - //log_w("%s already exists", path); - return true; - } else if(f) { - f.close(); - log_e("%s is a file", path); - return false; - } - - char * temp = (char *)malloc(strlen(path)+strlen(_mountpoint)+1); - if(!temp) { - log_e("malloc failed"); - return false; - } - sprintf(temp,"%s%s", _mountpoint, path); - auto rc = ::mkdir(temp, ACCESSPERMS); - free(temp); - return rc == 0; -} - -bool VFSImpl::rmdir(const char *path) -{ - if(!_mountpoint) { - log_e("File system is not mounted"); - return false; - } - - VFSFileImpl f(this, path, "r"); - if(!f || !f.isDirectory()) { - if(f) { - f.close(); - } - log_e("%s does not exists or is a file", path); - return false; - } - f.close(); - - char * temp = (char *)malloc(strlen(path)+strlen(_mountpoint)+1); - if(!temp) { - log_e("malloc failed"); - return false; - } - sprintf(temp,"%s%s", _mountpoint, path); - auto rc = unlink(temp); - free(temp); - return rc == 0; -} - - - - -VFSFileImpl::VFSFileImpl(VFSImpl* fs, const char* path, const char* mode) - : _fs(fs) - , _f(NULL) - , _d(NULL) - , _path(NULL) - , _isDirectory(false) - , _written(false) -{ - char * temp = (char *)malloc(strlen(path)+strlen(_fs->_mountpoint)+1); - if(!temp) { - return; - } - sprintf(temp,"%s%s", _fs->_mountpoint, path); - - _path = strdup(path); - if(!_path) { - log_e("strdup(%s) failed", path); - free(temp); - return; - } - - if(!stat(temp, &_stat)) { - //file found - if (S_ISREG(_stat.st_mode)) { - _isDirectory = false; - _f = fopen(temp, mode); - if(!_f) { - log_e("fopen(%s) failed", temp); - } - } else if(S_ISDIR(_stat.st_mode)) { - _isDirectory = true; - _d = opendir(temp); - if(!_d) { - log_e("opendir(%s) failed", temp); - } - } else { - log_e("Unknown type 0x%08X for file %s", ((_stat.st_mode)&_IFMT), temp); - } - } else { - //file not found - if(!mode || mode[0] == 'r') { - //try to open as directory - _d = opendir(temp); - if(_d) { - _isDirectory = true; - } else { - _isDirectory = false; - //log_w("stat(%s) failed", temp); - } - } else { - //lets create this new file - _isDirectory = false; - _f = fopen(temp, mode); - if(!_f) { - log_e("fopen(%s) failed", temp); - } - } - } - free(temp); -} - -VFSFileImpl::~VFSFileImpl() -{ - close(); -} - -void VFSFileImpl::close() -{ - if(_path) { - free(_path); - _path = NULL; - } - if(_isDirectory && _d) { - closedir(_d); - _d = NULL; - _isDirectory = false; - } else if(_f) { - fclose(_f); - _f = NULL; - } -} - -VFSFileImpl::operator bool() -{ - return (_isDirectory && _d != NULL) || _f != NULL; -} - -time_t VFSFileImpl::getLastWrite() { - _getStat() ; - return _stat.st_mtime; -} - -void VFSFileImpl::_getStat() const -{ - if(!_path) { - return; - } - char * temp = (char *)malloc(strlen(_path)+strlen(_fs->_mountpoint)+1); - if(!temp) { - return; - } - sprintf(temp,"%s%s", _fs->_mountpoint, _path); - if(!stat(temp, &_stat)) { - _written = false; - } - free(temp); -} - -size_t VFSFileImpl::write(const uint8_t *buf, size_t size) -{ - if(_isDirectory || !_f || !buf || !size) { - return 0; - } - _written = true; - return fwrite(buf, 1, size, _f); -} - -size_t VFSFileImpl::read(uint8_t* buf, size_t size) -{ - if(_isDirectory || !_f || !buf || !size) { - return 0; - } - - return fread(buf, 1, size, _f); -} - -void VFSFileImpl::flush() -{ - if(_isDirectory || !_f) { - return; - } - fflush(_f); - // workaround for https://github.com/espressif/arduino-esp32/issues/1293 - fsync(fileno(_f)); -} - -bool VFSFileImpl::seek(uint32_t pos, SeekMode mode) -{ - if(_isDirectory || !_f) { - return false; - } - auto rc = fseek(_f, pos, mode); - return rc == 0; -} - -size_t VFSFileImpl::position() const -{ - if(_isDirectory || !_f) { - return 0; - } - return ftell(_f); -} - -size_t VFSFileImpl::size() const -{ - if(_isDirectory || !_f) { - return 0; - } - if (_written) { - _getStat(); - } - return _stat.st_size; -} - -const char* VFSFileImpl::name() const -{ - return (const char*) _path; -} - -//to implement -boolean VFSFileImpl::isDirectory(void) -{ - return _isDirectory; -} - -FileImplPtr VFSFileImpl::openNextFile(const char* mode) -{ - if(!_isDirectory || !_d) { - return FileImplPtr(); - } - struct dirent *file = readdir(_d); - if(file == NULL) { - return FileImplPtr(); - } - if(file->d_type != DT_REG && file->d_type != DT_DIR) { - return openNextFile(mode); - } - String fname = String(file->d_name); - String name = String(_path); - if(!fname.startsWith("/") && !name.endsWith("/")) { - name += "/"; - } - name += fname; - - return std::make_shared(_fs, name.c_str(), mode); -} - -void VFSFileImpl::rewindDirectory(void) -{ - if(!_isDirectory || !_d) { - return; - } - rewinddir(_d); -} diff --git a/libraries/FS/src/vfs_api.h b/libraries/FS/src/vfs_api.h deleted file mode 100644 index c5649130f60..00000000000 --- a/libraries/FS/src/vfs_api.h +++ /dev/null @@ -1,77 +0,0 @@ -// 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. - -#ifndef vfs_api_h -#define vfs_api_h - -#include "FS.h" -#include "FSImpl.h" - -extern "C" { -#include -#include -#include -} - -using namespace fs; - -class VFSFileImpl; - -class VFSImpl : public FSImpl -{ - -protected: - friend class VFSFileImpl; - -public: - FileImplPtr open(const char* path, const char* mode) override; - bool exists(const char* path) override; - bool rename(const char* pathFrom, const char* pathTo) override; - bool remove(const char* path) override; - bool mkdir(const char *path) override; - bool rmdir(const char *path) override; -}; - -class VFSFileImpl : public FileImpl -{ -protected: - VFSImpl* _fs; - FILE * _f; - DIR * _d; - char * _path; - bool _isDirectory; - mutable struct stat _stat; - mutable bool _written; - - void _getStat() const; - -public: - VFSFileImpl(VFSImpl* fs, const char* path, const char* mode); - ~VFSFileImpl() override; - size_t write(const uint8_t *buf, size_t size) override; - size_t read(uint8_t* buf, size_t size) override; - void flush() override; - bool seek(uint32_t pos, SeekMode mode) override; - size_t position() const override; - size_t size() const override; - void close() override; - const char* name() const override; - time_t getLastWrite() override; - boolean isDirectory(void) override; - FileImplPtr openNextFile(const char* mode) override; - void rewindDirectory(void) override; - operator bool(); -}; - -#endif diff --git a/libraries/HTTPClient/examples/Authorization/Authorization.ino b/libraries/HTTPClient/examples/Authorization/Authorization.ino deleted file mode 100644 index 400f93cc8e1..00000000000 --- a/libraries/HTTPClient/examples/Authorization/Authorization.ino +++ /dev/null @@ -1,83 +0,0 @@ -/** - * Authorization.ino - * - * Created on: 09.12.2015 - * - */ - -#include - -#include -#include - -#include - -#define USE_SERIAL Serial - -WiFiMulti wifiMulti; - -void setup() { - - USE_SERIAL.begin(115200); - - USE_SERIAL.println(); - USE_SERIAL.println(); - USE_SERIAL.println(); - - for(uint8_t t = 4; t > 0; t--) { - USE_SERIAL.printf("[SETUP] WAIT %d...\n", t); - USE_SERIAL.flush(); - delay(1000); - } - - wifiMulti.addAP("SSID", "PASSWORD"); - -} - -void loop() { - // wait for WiFi connection - if((wifiMulti.run() == WL_CONNECTED)) { - - HTTPClient http; - - USE_SERIAL.print("[HTTP] begin...\n"); - // configure traged server and url - - - http.begin("http://user:password@192.168.1.12/test.html"); - - /* - // or - http.begin("http://192.168.1.12/test.html"); - http.setAuthorization("user", "password"); - - // or - http.begin("http://192.168.1.12/test.html"); - http.setAuthorization("dXNlcjpwYXN3b3Jk"); - */ - - - USE_SERIAL.print("[HTTP] GET...\n"); - // start connection and send HTTP header - int httpCode = http.GET(); - - // httpCode will be negative on error - if(httpCode > 0) { - // HTTP header has been send and Server response header has been handled - USE_SERIAL.printf("[HTTP] GET... code: %d\n", httpCode); - - // file found at server - if(httpCode == HTTP_CODE_OK) { - String payload = http.getString(); - USE_SERIAL.println(payload); - } - } else { - USE_SERIAL.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str()); - } - - http.end(); - } - - delay(10000); -} - diff --git a/libraries/HTTPClient/examples/BasicHttpClient/BasicHttpClient.ino b/libraries/HTTPClient/examples/BasicHttpClient/BasicHttpClient.ino deleted file mode 100644 index 9ee620ab5a5..00000000000 --- a/libraries/HTTPClient/examples/BasicHttpClient/BasicHttpClient.ino +++ /dev/null @@ -1,101 +0,0 @@ -/** - * BasicHTTPClient.ino - * - * Created on: 24.05.2015 - * - */ - -#include - -#include -#include - -#include - -#define USE_SERIAL Serial - -WiFiMulti wifiMulti; - -/* -const char* ca = \ -"-----BEGIN CERTIFICATE-----\n" \ -"MIIEkjCCA3qgAwIBAgIQCgFBQgAAAVOFc2oLheynCDANBgkqhkiG9w0BAQsFADA/\n" \ -"MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT\n" \ -"DkRTVCBSb290IENBIFgzMB4XDTE2MDMxNzE2NDA0NloXDTIxMDMxNzE2NDA0Nlow\n" \ -"SjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUxldCdzIEVuY3J5cHQxIzAhBgNVBAMT\n" \ -"GkxldCdzIEVuY3J5cHQgQXV0aG9yaXR5IFgzMIIBIjANBgkqhkiG9w0BAQEFAAOC\n" \ -"AQ8AMIIBCgKCAQEAnNMM8FrlLke3cl03g7NoYzDq1zUmGSXhvb418XCSL7e4S0EF\n" \ -"q6meNQhY7LEqxGiHC6PjdeTm86dicbp5gWAf15Gan/PQeGdxyGkOlZHP/uaZ6WA8\n" \ -"SMx+yk13EiSdRxta67nsHjcAHJyse6cF6s5K671B5TaYucv9bTyWaN8jKkKQDIZ0\n" \ -"Z8h/pZq4UmEUEz9l6YKHy9v6Dlb2honzhT+Xhq+w3Brvaw2VFn3EK6BlspkENnWA\n" \ -"a6xK8xuQSXgvopZPKiAlKQTGdMDQMc2PMTiVFrqoM7hD8bEfwzB/onkxEz0tNvjj\n" \ -"/PIzark5McWvxI0NHWQWM6r6hCm21AvA2H3DkwIDAQABo4IBfTCCAXkwEgYDVR0T\n" \ -"AQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAYYwfwYIKwYBBQUHAQEEczBxMDIG\n" \ -"CCsGAQUFBzABhiZodHRwOi8vaXNyZy50cnVzdGlkLm9jc3AuaWRlbnRydXN0LmNv\n" \ -"bTA7BggrBgEFBQcwAoYvaHR0cDovL2FwcHMuaWRlbnRydXN0LmNvbS9yb290cy9k\n" \ -"c3Ryb290Y2F4My5wN2MwHwYDVR0jBBgwFoAUxKexpHsscfrb4UuQdf/EFWCFiRAw\n" \ -"VAYDVR0gBE0wSzAIBgZngQwBAgEwPwYLKwYBBAGC3xMBAQEwMDAuBggrBgEFBQcC\n" \ -"ARYiaHR0cDovL2Nwcy5yb290LXgxLmxldHNlbmNyeXB0Lm9yZzA8BgNVHR8ENTAz\n" \ -"MDGgL6AthitodHRwOi8vY3JsLmlkZW50cnVzdC5jb20vRFNUUk9PVENBWDNDUkwu\n" \ -"Y3JsMB0GA1UdDgQWBBSoSmpjBH3duubRObemRWXv86jsoTANBgkqhkiG9w0BAQsF\n" \ -"AAOCAQEA3TPXEfNjWDjdGBX7CVW+dla5cEilaUcne8IkCJLxWh9KEik3JHRRHGJo\n" \ -"uM2VcGfl96S8TihRzZvoroed6ti6WqEBmtzw3Wodatg+VyOeph4EYpr/1wXKtx8/\n" \ -"wApIvJSwtmVi4MFU5aMqrSDE6ea73Mj2tcMyo5jMd6jmeWUHK8so/joWUoHOUgwu\n" \ -"X4Po1QYz+3dszkDqMp4fklxBwXRsW10KXzPMTZ+sOPAveyxindmjkW8lGy+QsRlG\n" \ -"PfZ+G6Z6h7mjem0Y+iWlkYcV4PIWL1iwBi8saCbGS5jN2p8M+X+Q7UNKEkROb3N6\n" \ -"KOqkqm57TH2H3eDJAkSnh6/DNFu0Qg==\n" \ -"-----END CERTIFICATE-----\n"; -*/ - -void setup() { - - USE_SERIAL.begin(115200); - - USE_SERIAL.println(); - USE_SERIAL.println(); - USE_SERIAL.println(); - - for(uint8_t t = 4; t > 0; t--) { - USE_SERIAL.printf("[SETUP] WAIT %d...\n", t); - USE_SERIAL.flush(); - delay(1000); - } - - wifiMulti.addAP("SSID", "PASSWORD"); - -} - -void loop() { - // wait for WiFi connection - if((wifiMulti.run() == WL_CONNECTED)) { - - HTTPClient http; - - USE_SERIAL.print("[HTTP] begin...\n"); - // configure traged server and url - //http.begin("https://www.howsmyssl.com/a/check", ca); //HTTPS - http.begin("http://example.com/index.html"); //HTTP - - USE_SERIAL.print("[HTTP] GET...\n"); - // start connection and send HTTP header - int httpCode = http.GET(); - - // httpCode will be negative on error - if(httpCode > 0) { - // HTTP header has been send and Server response header has been handled - USE_SERIAL.printf("[HTTP] GET... code: %d\n", httpCode); - - // file found at server - if(httpCode == HTTP_CODE_OK) { - String payload = http.getString(); - USE_SERIAL.println(payload); - } - } else { - USE_SERIAL.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str()); - } - - http.end(); - } - - delay(5000); -} diff --git a/libraries/HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino b/libraries/HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino deleted file mode 100644 index 9ef2b44eadf..00000000000 --- a/libraries/HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino +++ /dev/null @@ -1,147 +0,0 @@ -/** - BasicHTTPSClient.ino - - Created on: 14.10.2018 - -*/ - -#include - -#include -#include - -#include - -#include - -// This is GandiStandardSSLCA2.pem, the root Certificate Authority that signed -// the server certifcate for the demo server https://jigsaw.w3.org in this -// example. This certificate is valid until Sep 11 23:59:59 2024 GMT -const char* rootCACertificate = \ -"-----BEGIN CERTIFICATE-----\n" \ -"MIIF6TCCA9GgAwIBAgIQBeTcO5Q4qzuFl8umoZhQ4zANBgkqhkiG9w0BAQwFADCB\n" \ -"iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl\n" \ -"cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV\n" \ -"BAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTQw\n" \ -"OTEyMDAwMDAwWhcNMjQwOTExMjM1OTU5WjBfMQswCQYDVQQGEwJGUjEOMAwGA1UE\n" \ -"CBMFUGFyaXMxDjAMBgNVBAcTBVBhcmlzMQ4wDAYDVQQKEwVHYW5kaTEgMB4GA1UE\n" \ -"AxMXR2FuZGkgU3RhbmRhcmQgU1NMIENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IB\n" \ -"DwAwggEKAoIBAQCUBC2meZV0/9UAPPWu2JSxKXzAjwsLibmCg5duNyj1ohrP0pIL\n" \ -"m6jTh5RzhBCf3DXLwi2SrCG5yzv8QMHBgyHwv/j2nPqcghDA0I5O5Q1MsJFckLSk\n" \ -"QFEW2uSEEi0FXKEfFxkkUap66uEHG4aNAXLy59SDIzme4OFMH2sio7QQZrDtgpbX\n" \ -"bmq08j+1QvzdirWrui0dOnWbMdw+naxb00ENbLAb9Tr1eeohovj0M1JLJC0epJmx\n" \ -"bUi8uBL+cnB89/sCdfSN3tbawKAyGlLfOGsuRTg/PwSWAP2h9KK71RfWJ3wbWFmV\n" \ -"XooS/ZyrgT5SKEhRhWvzkbKGPym1bgNi7tYFAgMBAAGjggF1MIIBcTAfBgNVHSME\n" \ -"GDAWgBRTeb9aqitKz1SA4dibwJ3ysgNmyzAdBgNVHQ4EFgQUs5Cn2MmvTs1hPJ98\n" \ -"rV1/Qf1pMOowDgYDVR0PAQH/BAQDAgGGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYD\n" \ -"VR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMCIGA1UdIAQbMBkwDQYLKwYBBAGy\n" \ -"MQECAhowCAYGZ4EMAQIBMFAGA1UdHwRJMEcwRaBDoEGGP2h0dHA6Ly9jcmwudXNl\n" \ -"cnRydXN0LmNvbS9VU0VSVHJ1c3RSU0FDZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNy\n" \ -"bDB2BggrBgEFBQcBAQRqMGgwPwYIKwYBBQUHMAKGM2h0dHA6Ly9jcnQudXNlcnRy\n" \ -"dXN0LmNvbS9VU0VSVHJ1c3RSU0FBZGRUcnVzdENBLmNydDAlBggrBgEFBQcwAYYZ\n" \ -"aHR0cDovL29jc3AudXNlcnRydXN0LmNvbTANBgkqhkiG9w0BAQwFAAOCAgEAWGf9\n" \ -"crJq13xhlhl+2UNG0SZ9yFP6ZrBrLafTqlb3OojQO3LJUP33WbKqaPWMcwO7lWUX\n" \ -"zi8c3ZgTopHJ7qFAbjyY1lzzsiI8Le4bpOHeICQW8owRc5E69vrOJAKHypPstLbI\n" \ -"FhfFcvwnQPYT/pOmnVHvPCvYd1ebjGU6NSU2t7WKY28HJ5OxYI2A25bUeo8tqxyI\n" \ -"yW5+1mUfr13KFj8oRtygNeX56eXVlogMT8a3d2dIhCe2H7Bo26y/d7CQuKLJHDJd\n" \ -"ArolQ4FCR7vY4Y8MDEZf7kYzawMUgtN+zY+vkNaOJH1AQrRqahfGlZfh8jjNp+20\n" \ -"J0CT33KpuMZmYzc4ZCIwojvxuch7yPspOqsactIGEk72gtQjbz7Dk+XYtsDe3CMW\n" \ -"1hMwt6CaDixVBgBwAc/qOR2A24j3pSC4W/0xJmmPLQphgzpHphNULB7j7UTKvGof\n" \ -"KA5R2d4On3XNDgOVyvnFqSot/kGkoUeuDcL5OWYzSlvhhChZbH2UF3bkRYKtcCD9\n" \ -"0m9jqNf6oDP6N8v3smWe2lBvP+Sn845dWDKXcCMu5/3EFZucJ48y7RetWIExKREa\n" \ -"m9T8bJUox04FB6b9HbwZ4ui3uRGKLXASUoWNjDNKD/yZkuBjcNqllEdjB+dYxzFf\n" \ -"BT02Vf6Dsuimrdfp5gJ0iHRc2jTbkNJtUQoj1iM=\n" \ -"-----END CERTIFICATE-----\n"; - -// Not sure if WiFiClientSecure checks the validity date of the certificate. -// Setting clock just to be sure... -void setClock() { - configTime(0, 0, "pool.ntp.org", "time.nist.gov"); - - Serial.print(F("Waiting for NTP time sync: ")); - time_t nowSecs = time(nullptr); - while (nowSecs < 8 * 3600 * 2) { - delay(500); - Serial.print(F(".")); - yield(); - nowSecs = time(nullptr); - } - - Serial.println(); - struct tm timeinfo; - gmtime_r(&nowSecs, &timeinfo); - Serial.print(F("Current time: ")); - Serial.print(asctime(&timeinfo)); -} - - -WiFiMulti WiFiMulti; - -void setup() { - - Serial.begin(115200); - // Serial.setDebugOutput(true); - - Serial.println(); - Serial.println(); - Serial.println(); - - WiFi.mode(WIFI_STA); - WiFiMulti.addAP("SSID", "PASSWORD"); - - // wait for WiFi connection - Serial.print("Waiting for WiFi to connect..."); - while ((WiFiMulti.run() != WL_CONNECTED)) { - Serial.print("."); - } - Serial.println(" connected"); - - setClock(); -} - -void loop() { - WiFiClientSecure *client = new WiFiClientSecure; - if(client) { - client -> setCACert(rootCACertificate); - - { - // Add a scoping block for HTTPClient https to make sure it is destroyed before WiFiClientSecure *client is - HTTPClient https; - - Serial.print("[HTTPS] begin...\n"); - if (https.begin(*client, "https://jigsaw.w3.org/HTTP/connection.html")) { // HTTPS - Serial.print("[HTTPS] GET...\n"); - // start connection and send HTTP header - int httpCode = https.GET(); - - // httpCode will be negative on error - if (httpCode > 0) { - // HTTP header has been send and Server response header has been handled - Serial.printf("[HTTPS] GET... code: %d\n", httpCode); - - // file found at server - if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) { - String payload = https.getString(); - Serial.println(payload); - } - } else { - Serial.printf("[HTTPS] GET... failed, error: %s\n", https.errorToString(httpCode).c_str()); - } - - https.end(); - } else { - Serial.printf("[HTTPS] Unable to connect\n"); - } - - // End extra scoping block - } - - delete client; - } else { - Serial.println("Unable to create client"); - } - - Serial.println(); - Serial.println("Waiting 10s before the next round..."); - delay(10000); -} diff --git a/libraries/HTTPClient/examples/HTTPClientEnterprise/HTTPClientEnterprise.ino b/libraries/HTTPClient/examples/HTTPClientEnterprise/HTTPClientEnterprise.ino deleted file mode 100644 index b28501bb3ea..00000000000 --- a/libraries/HTTPClient/examples/HTTPClientEnterprise/HTTPClientEnterprise.ino +++ /dev/null @@ -1,98 +0,0 @@ -/*|----------------------------------------------------------|*/ -/*|WORKING EXAMPLE FOR HTTP/HTTPS CONNECTION |*/ -/*|TESTED BOARDS: Devkit v1 DOIT, Devkitc v4 |*/ -/*|CORE: June 2018 |*/ -/*|----------------------------------------------------------|*/ -#include -#include -#include "esp_wpa2.h" -#include -#define EAP_IDENTITY "identity" //if connecting from another corporation, use identity@organisation.domain in Eduroam -#define EAP_PASSWORD "password" //your Eduroam password -const char* ssid = "eduroam"; // Eduroam SSID -int counter = 0; -const char* test_root_ca= \ -"-----BEGIN CERTIFICATE-----\n" \ -"MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh\n" \ -"MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\n" \ -"d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD\n" \ -"QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT\n" \ -"MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j\n" \ -"b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG\n" \ -"9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB\n" \ -"CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97\n" \ -"nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt\n" \ -"43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P\n" \ -"T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4\n" \ -"gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO\n" \ -"BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR\n" \ -"TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw\n" \ -"DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr\n" \ -"hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg\n" \ -"06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF\n" \ -"PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls\n" \ -"YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk\n" \ -"CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=\n" \ -"-----END CERTIFICATE-----\n"; -void setup() { - Serial.begin(115200); - delay(10); - Serial.println(); - Serial.print("Connecting to network: "); - Serial.println(ssid); - WiFi.disconnect(true); //disconnect form wifi to set new wifi connection - WiFi.mode(WIFI_STA); //init wifi mode - esp_wifi_sta_wpa2_ent_set_identity((uint8_t *)EAP_IDENTITY, strlen(EAP_IDENTITY)); //provide identity - esp_wifi_sta_wpa2_ent_set_username((uint8_t *)EAP_IDENTITY, strlen(EAP_IDENTITY)); //provide username --> identity and username is same - esp_wifi_sta_wpa2_ent_set_password((uint8_t *)EAP_PASSWORD, strlen(EAP_PASSWORD)); //provide password - esp_wpa2_config_t config = WPA2_CONFIG_INIT_DEFAULT(); //set config settings to default - esp_wifi_sta_wpa2_ent_enable(&config); //set config settings to enable function - WiFi.begin(ssid); //connect to wifi - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - counter++; - if(counter>=60){ //after 30 seconds timeout - reset board - ESP.restart(); - } - } - Serial.println(""); - Serial.println("WiFi connected"); - Serial.println("IP address set: "); - Serial.println(WiFi.localIP()); //print LAN IP -} -void loop() { - if (WiFi.status() == WL_CONNECTED) { //if we are connected to Eduroam network - counter = 0; //reset counter - Serial.println("Wifi is still connected with IP: "); - Serial.println(WiFi.localIP()); //inform user about his IP address - }else if (WiFi.status() != WL_CONNECTED) { //if we lost connection, retry - WiFi.begin(ssid); - } - while (WiFi.status() != WL_CONNECTED) { //during lost connection, print dots - delay(500); - Serial.print("."); - counter++; - if(counter>=60){ //30 seconds timeout - reset board - ESP.restart(); - } - } - Serial.print("Connecting to website: "); - HTTPClient http; - http.begin("https://arduino.php5.sk/rele/rele1.txt", test_root_ca); //HTTPS example connection - //http.begin("http://www.arduino.php5.sk/rele/rele1.txt"); //HTTP example connection - //if uncomment HTTP example, you can comment root CA certificate too! - int httpCode = http.GET(); - if(httpCode > 0) { - Serial.printf("[HTTP] GET... code: %d\n", httpCode); - //file found at server --> on unsucessful connection code will be -1 - if(httpCode == HTTP_CODE_OK) { - String payload = http.getString(); - Serial.println(payload); - } - }else{ - Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str()); - } - http.end(); - delay(2000); -} diff --git a/libraries/HTTPClient/examples/ReuseConnection/ReuseConnection.ino b/libraries/HTTPClient/examples/ReuseConnection/ReuseConnection.ino deleted file mode 100644 index d3bcefbeb17..00000000000 --- a/libraries/HTTPClient/examples/ReuseConnection/ReuseConnection.ino +++ /dev/null @@ -1,68 +0,0 @@ -/** - * reuseConnection.ino - * - * Created on: 22.11.2015 - * - */ - - -#include - -#include -#include - -#include - -#define USE_SERIAL Serial - -WiFiMulti wifiMulti; - -HTTPClient http; - -void setup() { - - USE_SERIAL.begin(115200); - - USE_SERIAL.println(); - USE_SERIAL.println(); - USE_SERIAL.println(); - - for(uint8_t t = 4; t > 0; t--) { - USE_SERIAL.printf("[SETUP] WAIT %d...\n", t); - USE_SERIAL.flush(); - delay(1000); - } - - wifiMulti.addAP("SSID", "PASSWORD"); - - // allow reuse (if server supports it) - http.setReuse(true); -} - -void loop() { - // wait for WiFi connection - if((wifiMulti.run() == WL_CONNECTED)) { - - http.begin("http://192.168.1.12/test.html"); - //http.begin("192.168.1.12", 80, "/test.html"); - - int httpCode = http.GET(); - if(httpCode > 0) { - USE_SERIAL.printf("[HTTP] GET... code: %d\n", httpCode); - - // file found at server - if(httpCode == HTTP_CODE_OK) { - http.writeToStream(&USE_SERIAL); - } - } else { - USE_SERIAL.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str()); - } - - http.end(); - } - - delay(1000); -} - - - diff --git a/libraries/HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino b/libraries/HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino deleted file mode 100644 index 6ea07f660c1..00000000000 --- a/libraries/HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino +++ /dev/null @@ -1,100 +0,0 @@ -/** - * StreamHTTPClient.ino - * - * Created on: 24.05.2015 - * - */ - -#include - -#include -#include - -#include - -#define USE_SERIAL Serial - -WiFiMulti wifiMulti; - -void setup() { - - USE_SERIAL.begin(115200); - - USE_SERIAL.println(); - USE_SERIAL.println(); - USE_SERIAL.println(); - - for(uint8_t t = 4; t > 0; t--) { - USE_SERIAL.printf("[SETUP] WAIT %d...\n", t); - USE_SERIAL.flush(); - delay(1000); - } - - wifiMulti.addAP("SSID", "PASSWORD"); - -} - -void loop() { - // wait for WiFi connection - if((wifiMulti.run() == WL_CONNECTED)) { - - HTTPClient http; - - USE_SERIAL.print("[HTTP] begin...\n"); - - // configure server and url - http.begin("http://192.168.1.12/test.html"); - //http.begin("192.168.1.12", 80, "/test.html"); - - USE_SERIAL.print("[HTTP] GET...\n"); - // start connection and send HTTP header - int httpCode = http.GET(); - if(httpCode > 0) { - // HTTP header has been send and Server response header has been handled - USE_SERIAL.printf("[HTTP] GET... code: %d\n", httpCode); - - // file found at server - if(httpCode == HTTP_CODE_OK) { - - // get lenght of document (is -1 when Server sends no Content-Length header) - int len = http.getSize(); - - // create buffer for read - uint8_t buff[128] = { 0 }; - - // get tcp stream - WiFiClient * stream = http.getStreamPtr(); - - // read all data from server - while(http.connected() && (len > 0 || len == -1)) { - // get available data size - size_t size = stream->available(); - - if(size) { - // read up to 128 byte - int c = stream->readBytes(buff, ((size > sizeof(buff)) ? sizeof(buff) : size)); - - // write it to Serial - USE_SERIAL.write(buff, c); - - if(len > 0) { - len -= c; - } - } - delay(1); - } - - USE_SERIAL.println(); - USE_SERIAL.print("[HTTP] connection closed or file end.\n"); - - } - } else { - USE_SERIAL.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str()); - } - - http.end(); - } - - delay(10000); -} - diff --git a/libraries/HTTPClient/library.properties b/libraries/HTTPClient/library.properties deleted file mode 100644 index 153a2e2575d..00000000000 --- a/libraries/HTTPClient/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=HTTPClient -version=1.2 -author=Markus Sattler -maintainer=Markus Sattler -sentence=HTTP Client for ESP32 -paragraph= -category=Communication -url=https://github.com/espressif/arduino-esp32/tree/master/libraries/HTTPClient -architectures=esp32 diff --git a/libraries/HTTPClient/src/HTTPClient.cpp b/libraries/HTTPClient/src/HTTPClient.cpp deleted file mode 100644 index f4b0ae54654..00000000000 --- a/libraries/HTTPClient/src/HTTPClient.cpp +++ /dev/null @@ -1,1325 +0,0 @@ -#include -/** - * HTTPClient.cpp - * - * Created on: 02.11.2015 - * - * Copyright (c) 2015 Markus Sattler. All rights reserved. - * This file is part of the HTTPClient for Arduino. - * Port to ESP32 by Evandro Luis Copercini (2017), - * changed fingerprints to CA verification. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Adapted in October 2018 - */ - -#include -#include - -#ifdef HTTPCLIENT_1_1_COMPATIBLE -#include -#include -#endif - -#include -#include - -#include "HTTPClient.h" - -#ifdef HTTPCLIENT_1_1_COMPATIBLE -class TransportTraits -{ -public: - virtual ~TransportTraits() - { - } - - virtual std::unique_ptr create() - { - return std::unique_ptr(new WiFiClient()); - } - - virtual bool verify(WiFiClient& client, const char* host) - { - return true; - } -}; - -class TLSTraits : public TransportTraits -{ -public: - TLSTraits(const char* CAcert, const char* clicert = nullptr, const char* clikey = nullptr) : - _cacert(CAcert), _clicert(clicert), _clikey(clikey) - { - } - - std::unique_ptr create() override - { - return std::unique_ptr(new WiFiClientSecure()); - } - - bool verify(WiFiClient& client, const char* host) override - { - WiFiClientSecure& wcs = static_cast(client); - wcs.setCACert(_cacert); - wcs.setCertificate(_clicert); - wcs.setPrivateKey(_clikey); - return true; - } - -protected: - const char* _cacert; - const char* _clicert; - const char* _clikey; -}; -#endif // HTTPCLIENT_1_1_COMPATIBLE - -/** - * constructor - */ -HTTPClient::HTTPClient() -{ -} - -/** - * destructor - */ -HTTPClient::~HTTPClient() -{ - if(_client) { - _client->stop(); - } - if(_currentHeaders) { - delete[] _currentHeaders; - } -} - -void HTTPClient::clear() -{ - _returnCode = 0; - _size = -1; - _headers = ""; -} - - -/** - * parsing the url for all needed parameters - * @param client Client& - * @param url String - * @param https bool - * @return success bool - */ -bool HTTPClient::begin(WiFiClient &client, String url) { -#ifdef HTTPCLIENT_1_1_COMPATIBLE - if(_tcpDeprecated) { - log_d("mix up of new and deprecated api"); - _canReuse = false; - end(); - } -#endif - - _client = &client; - - // check for : (http: or https:) - int index = url.indexOf(':'); - if(index < 0) { - log_d("failed to parse protocol"); - return false; - } - - String protocol = url.substring(0, index); - if(protocol != "http" && protocol != "https") { - log_d("unknown protocol '%s'", protocol.c_str()); - return false; - } - - _port = (protocol == "https" ? 443 : 80); - return beginInternal(url, protocol.c_str()); -} - - -/** - * directly supply all needed parameters - * @param client Client& - * @param host String - * @param port uint16_t - * @param uri String - * @param https bool - * @return success bool - */ -bool HTTPClient::begin(WiFiClient &client, String host, uint16_t port, String uri, bool https) -{ -#ifdef HTTPCLIENT_1_1_COMPATIBLE - if(_tcpDeprecated) { - log_d("mix up of new and deprecated api"); - _canReuse = false; - end(); - } -#endif - - _client = &client; - - clear(); - _host = host; - _port = port; - _uri = uri; - _protocol = (https ? "https" : "http"); - return true; -} - - -#ifdef HTTPCLIENT_1_1_COMPATIBLE -bool HTTPClient::begin(String url, const char* CAcert) -{ - if(_client && !_tcpDeprecated) { - log_d("mix up of new and deprecated api"); - _canReuse = false; - end(); - } - - _port = 443; - if (!beginInternal(url, "https")) { - return false; - } - _secure = true; - _transportTraits = TransportTraitsPtr(new TLSTraits(CAcert)); - if(!_transportTraits) { - log_e("could not create transport traits"); - return false; - } - - return true; -} - -/** - * parsing the url for all needed parameters - * @param url String - */ -bool HTTPClient::begin(String url) -{ - if(_client && !_tcpDeprecated) { - log_d("mix up of new and deprecated api"); - _canReuse = false; - end(); - } - - _port = 80; - if (!beginInternal(url, "http")) { - return begin(url, (const char*)NULL); - } - _transportTraits = TransportTraitsPtr(new TransportTraits()); - if(!_transportTraits) { - log_e("could not create transport traits"); - return false; - } - - return true; -} -#endif // HTTPCLIENT_1_1_COMPATIBLE - -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(':'); - if(index < 0) { - log_e("failed to parse protocol"); - return false; - } - - _protocol = url.substring(0, index); - if (_protocol != expectedProtocol) { - log_w("unexpected protocol: %s, expected %s", _protocol.c_str(), expectedProtocol); - return false; - } - - url.remove(0, (index + 3)); // remove http:// or https:// - - index = url.indexOf('/'); - String host = url.substring(0, index); - url.remove(0, index); // remove host part - - // get Authorization - index = host.indexOf('@'); - if(index >= 0) { - // auth info - String auth = host.substring(0, index); - host.remove(0, index + 1); // remove auth part including @ - _base64Authorization = base64::encode(auth); - } - - // get port - index = host.indexOf(':'); - if(index >= 0) { - _host = host.substring(0, index); // hostname - host.remove(0, (index + 1)); // remove hostname + : - _port = host.toInt(); // get port - } else { - _host = host; - } - _uri = url; - log_d("host: %s port: %d url: %s", _host.c_str(), _port, _uri.c_str()); - return true; -} - -#ifdef HTTPCLIENT_1_1_COMPATIBLE -bool HTTPClient::begin(String host, uint16_t port, String uri) -{ - if(_client && !_tcpDeprecated) { - log_d("mix up of new and deprecated api"); - _canReuse = false; - end(); - } - - clear(); - _host = host; - _port = port; - _uri = uri; - _transportTraits = TransportTraitsPtr(new TransportTraits()); - log_d("host: %s port: %d uri: %s", host.c_str(), port, uri.c_str()); - return true; -} - -bool HTTPClient::begin(String host, uint16_t port, String uri, const char* CAcert) -{ - if(_client && !_tcpDeprecated) { - log_d("mix up of new and deprecated api"); - _canReuse = false; - end(); - } - - clear(); - _host = host; - _port = port; - _uri = uri; - - if (strlen(CAcert) == 0) { - return false; - } - _secure = true; - _transportTraits = TransportTraitsPtr(new TLSTraits(CAcert)); - return true; -} - -bool HTTPClient::begin(String host, uint16_t port, String uri, const char* CAcert, const char* cli_cert, const char* cli_key) -{ - if(_client && !_tcpDeprecated) { - log_d("mix up of new and deprecated api"); - _canReuse = false; - end(); - } - - clear(); - _host = host; - _port = port; - _uri = uri; - - if (strlen(CAcert) == 0) { - return false; - } - _secure = true; - _transportTraits = TransportTraitsPtr(new TLSTraits(CAcert, cli_cert, cli_key)); - return true; -} -#endif // HTTPCLIENT_1_1_COMPATIBLE - -/** - * end - * called after the payload is handled - */ -void HTTPClient::end(void) -{ - disconnect(false); - clear(); -} - - - -/** - * disconnect - * close the TCP socket - */ -void HTTPClient::disconnect(bool preserveClient) -{ - if(connected()) { - if(_client->available() > 0) { - log_d("still data in buffer (%d), clean up.\n", _client->available()); - while(_client->available() > 0) { - _client->read(); - } - } - - if(_reuse && _canReuse) { - log_d("tcp keep open for reuse\n"); - } else { - log_d("tcp stop\n"); - _client->stop(); - if(!preserveClient) { - _client = nullptr; - } -#ifdef HTTPCLIENT_1_1_COMPATIBLE - if(_tcpDeprecated) { - _transportTraits.reset(nullptr); - _tcpDeprecated.reset(nullptr); - } -#endif - } - } else { - log_d("tcp is closed\n"); - } -} - - -/** - * connected - * @return connected status - */ -bool HTTPClient::connected() -{ - if(_client) { - return ((_client->available() > 0) || _client->connected()); - } - return false; -} - -/** - * try to reuse the connection to the server - * keep-alive - * @param reuse bool - */ -void HTTPClient::setReuse(bool reuse) -{ - _reuse = reuse; -} - -/** - * set User Agent - * @param userAgent const char * - */ -void HTTPClient::setUserAgent(const String& userAgent) -{ - _userAgent = userAgent; -} - -/** - * set the Authorizatio for the http request - * @param user const char * - * @param password const char * - */ -void HTTPClient::setAuthorization(const char * user, const char * password) -{ - if(user && password) { - String auth = user; - auth += ":"; - auth += password; - _base64Authorization = base64::encode(auth); - } -} - -/** - * set the Authorizatio for the http request - * @param auth const char * base64 - */ -void HTTPClient::setAuthorization(const char * auth) -{ - if(auth) { - _base64Authorization = auth; - } -} - -/** - * set the timeout (ms) for establishing a connection to the server - * @param connectTimeout int32_t - */ -void HTTPClient::setConnectTimeout(int32_t connectTimeout) -{ - _connectTimeout = connectTimeout; -} - -/** - * set the timeout for the TCP connection - * @param timeout unsigned int - */ -void HTTPClient::setTimeout(uint16_t timeout) -{ - _tcpTimeout = timeout; - if(connected()) { - _client->setTimeout((timeout + 500) / 1000); - } -} - -/** - * use HTTP1.0 - * @param use - */ -void HTTPClient::useHTTP10(bool useHTTP10) -{ - _useHTTP10 = useHTTP10; - _reuse = !useHTTP10; -} - -/** - * send a GET request - * @return http code - */ -int HTTPClient::GET() -{ - return sendRequest("GET"); -} - -/** - * sends a post request to the server - * @param payload uint8_t * - * @param size size_t - * @return http code - */ -int HTTPClient::POST(uint8_t * payload, size_t size) -{ - return sendRequest("POST", payload, size); -} - -int HTTPClient::POST(String payload) -{ - return POST((uint8_t *) payload.c_str(), payload.length()); -} - -/** - * sends a patch request to the server - * @param payload uint8_t * - * @param size size_t - * @return http code - */ -int HTTPClient::PATCH(uint8_t * payload, size_t size) -{ - return sendRequest("PATCH", payload, size); -} - -int HTTPClient::PATCH(String payload) -{ - return PATCH((uint8_t *) payload.c_str(), payload.length()); -} - -/** - * sends a put request to the server - * @param payload uint8_t * - * @param size size_t - * @return http code - */ -int HTTPClient::PUT(uint8_t * payload, size_t size) { - return sendRequest("PUT", payload, size); -} - -int HTTPClient::PUT(String payload) { - return PUT((uint8_t *) payload.c_str(), payload.length()); -} - -/** - * sendRequest - * @param type const char * "GET", "POST", .... - * @param payload String data for the message body - * @return - */ -int HTTPClient::sendRequest(const char * type, String payload) -{ - return sendRequest(type, (uint8_t *) payload.c_str(), payload.length()); -} - -/** - * sendRequest - * @param type const char * "GET", "POST", .... - * @param payload uint8_t * data for the message body if null not send - * @param size size_t size for the message body if 0 not send - * @return -1 if no info or > 0 when Content-Length is set by server - */ -int HTTPClient::sendRequest(const char * type, uint8_t * payload, size_t size) -{ - // connect to server - if(!connect()) { - return returnError(HTTPC_ERROR_CONNECTION_REFUSED); - } - - if(payload && size > 0) { - addHeader(F("Content-Length"), String(size)); - } - - // send Header - if(!sendHeader(type)) { - return returnError(HTTPC_ERROR_SEND_HEADER_FAILED); - } - - // send Payload if needed - if(payload && size > 0) { - if(_client->write(&payload[0], size) != size) { - return returnError(HTTPC_ERROR_SEND_PAYLOAD_FAILED); - } - } - - // handle Server Response (Header) - return returnError(handleHeaderResponse()); -} - -/** - * sendRequest - * @param type const char * "GET", "POST", .... - * @param stream Stream * data stream for the message body - * @param size size_t size for the message body if 0 not Content-Length is send - * @return -1 if no info or > 0 when Content-Length is set by server - */ -int HTTPClient::sendRequest(const char * type, Stream * stream, size_t size) -{ - - if(!stream) { - return returnError(HTTPC_ERROR_NO_STREAM); - } - - // connect to server - if(!connect()) { - return returnError(HTTPC_ERROR_CONNECTION_REFUSED); - } - - if(size > 0) { - addHeader("Content-Length", String(size)); - } - - // send Header - if(!sendHeader(type)) { - return returnError(HTTPC_ERROR_SEND_HEADER_FAILED); - } - - int buff_size = HTTP_TCP_BUFFER_SIZE; - - int len = size; - int bytesWritten = 0; - - if(len == 0) { - len = -1; - } - - // if possible create smaller buffer then HTTP_TCP_BUFFER_SIZE - if((len > 0) && (len < HTTP_TCP_BUFFER_SIZE)) { - buff_size = len; - } - - // create buffer for read - uint8_t * buff = (uint8_t *) malloc(buff_size); - - if(buff) { - // read all data from stream and send it to server - while(connected() && (stream->available() > -1) && (len > 0 || len == -1)) { - - // get available data size - int sizeAvailable = stream->available(); - - if(sizeAvailable) { - - int readBytes = sizeAvailable; - - // read only the asked bytes - if(len > 0 && readBytes > len) { - readBytes = len; - } - - // not read more the buffer can handle - if(readBytes > buff_size) { - readBytes = buff_size; - } - - // read data - int bytesRead = stream->readBytes(buff, readBytes); - - // write it to Stream - int bytesWrite = _client->write((const uint8_t *) buff, bytesRead); - bytesWritten += bytesWrite; - - // are all Bytes a writen to stream ? - if(bytesWrite != bytesRead) { - log_d("short write, asked for %d but got %d retry...", bytesRead, bytesWrite); - - // check for write error - if(_client->getWriteError()) { - log_d("stream write error %d", _client->getWriteError()); - - //reset write error for retry - _client->clearWriteError(); - } - - // some time for the stream - delay(1); - - int leftBytes = (readBytes - bytesWrite); - - // retry to send the missed bytes - bytesWrite = _client->write((const uint8_t *) (buff + bytesWrite), leftBytes); - bytesWritten += bytesWrite; - - if(bytesWrite != leftBytes) { - // failed again - log_d("short write, asked for %d but got %d failed.", leftBytes, bytesWrite); - free(buff); - return returnError(HTTPC_ERROR_SEND_PAYLOAD_FAILED); - } - } - - // check for write error - if(_client->getWriteError()) { - log_d("stream write error %d", _client->getWriteError()); - free(buff); - return returnError(HTTPC_ERROR_SEND_PAYLOAD_FAILED); - } - - // count bytes to read left - if(len > 0) { - len -= readBytes; - } - - delay(0); - } else { - delay(1); - } - } - - free(buff); - - if(size && (int) size != bytesWritten) { - log_d("Stream payload bytesWritten %d and size %d mismatch!.", bytesWritten, size); - log_d("ERROR SEND PAYLOAD FAILED!"); - return returnError(HTTPC_ERROR_SEND_PAYLOAD_FAILED); - } else { - log_d("Stream payload written: %d", bytesWritten); - } - - } else { - log_d("too less ram! need %d", HTTP_TCP_BUFFER_SIZE); - return returnError(HTTPC_ERROR_TOO_LESS_RAM); - } - - // handle Server Response (Header) - return returnError(handleHeaderResponse()); -} - -/** - * size of message body / payload - * @return -1 if no info or > 0 when Content-Length is set by server - */ -int HTTPClient::getSize(void) -{ - return _size; -} - -/** - * returns the stream of the tcp connection - * @return WiFiClient - */ -WiFiClient& HTTPClient::getStream(void) -{ - if (connected()) { - return *_client; - } - - log_w("getStream: not connected"); - static WiFiClient empty; - return empty; -} - -/** - * returns a pointer to the stream of the tcp connection - * @return WiFiClient* - */ -WiFiClient* HTTPClient::getStreamPtr(void) -{ - if(connected()) { - return _client; - } - - log_w("getStreamPtr: not connected"); - return nullptr; -} - -/** - * write all message body / payload to Stream - * @param stream Stream * - * @return bytes written ( negative values are error codes ) - */ -int HTTPClient::writeToStream(Stream * stream) -{ - - if(!stream) { - return returnError(HTTPC_ERROR_NO_STREAM); - } - - if(!connected()) { - return returnError(HTTPC_ERROR_NOT_CONNECTED); - } - - // get length of document (is -1 when Server sends no Content-Length header) - int len = _size; - int ret = 0; - - if(_transferEncoding == HTTPC_TE_IDENTITY) { - ret = writeToStreamDataBlock(stream, len); - - // have we an error? - if(ret < 0) { - return returnError(ret); - } - } else if(_transferEncoding == HTTPC_TE_CHUNKED) { - int size = 0; - while(1) { - if(!connected()) { - return returnError(HTTPC_ERROR_CONNECTION_LOST); - } - String chunkHeader = _client->readStringUntil('\n'); - - if(chunkHeader.length() <= 0) { - return returnError(HTTPC_ERROR_READ_TIMEOUT); - } - - chunkHeader.trim(); // remove \r - - // read size of chunk - len = (uint32_t) strtol((const char *) chunkHeader.c_str(), NULL, 16); - size += len; - log_d(" read chunk len: %d", len); - - // data left? - if(len > 0) { - int r = writeToStreamDataBlock(stream, len); - if(r < 0) { - // error in writeToStreamDataBlock - return returnError(r); - } - ret += r; - } else { - - // if no length Header use global chunk size - if(_size <= 0) { - _size = size; - } - - // check if we have write all data out - if(ret != _size) { - return returnError(HTTPC_ERROR_STREAM_WRITE); - } - break; - } - - // read trailing \r\n at the end of the chunk - char buf[2]; - auto trailing_seq_len = _client->readBytes((uint8_t*)buf, 2); - if (trailing_seq_len != 2 || buf[0] != '\r' || buf[1] != '\n') { - return returnError(HTTPC_ERROR_READ_TIMEOUT); - } - - delay(0); - } - } else { - return returnError(HTTPC_ERROR_ENCODING); - } - -// end(); - disconnect(true); - return ret; -} - -/** - * return all payload as String (may need lot of ram or trigger out of memory!) - * @return String - */ -String HTTPClient::getString(void) -{ - StreamString sstring; - - if(_size) { - // try to reserve needed memmory - if(!sstring.reserve((_size + 1))) { - log_d("not enough memory to reserve a string! need: %d", (_size + 1)); - return ""; - } - } - - writeToStream(&sstring); - return sstring; -} - -/** - * converts error code to String - * @param error int - * @return String - */ -String HTTPClient::errorToString(int error) -{ - switch(error) { - case HTTPC_ERROR_CONNECTION_REFUSED: - return F("connection refused"); - case HTTPC_ERROR_SEND_HEADER_FAILED: - return F("send header failed"); - case HTTPC_ERROR_SEND_PAYLOAD_FAILED: - return F("send payload failed"); - case HTTPC_ERROR_NOT_CONNECTED: - return F("not connected"); - case HTTPC_ERROR_CONNECTION_LOST: - return F("connection lost"); - case HTTPC_ERROR_NO_STREAM: - return F("no stream"); - case HTTPC_ERROR_NO_HTTP_SERVER: - return F("no HTTP server"); - case HTTPC_ERROR_TOO_LESS_RAM: - return F("too less ram"); - case HTTPC_ERROR_ENCODING: - return F("Transfer-Encoding not supported"); - case HTTPC_ERROR_STREAM_WRITE: - return F("Stream write error"); - case HTTPC_ERROR_READ_TIMEOUT: - return F("read Timeout"); - default: - return String(); - } -} - -/** - * adds Header to the request - * @param name - * @param value - * @param first - */ -void HTTPClient::addHeader(const String& name, const String& value, bool first, bool replace) -{ - // not allow set of Header handled by code - if(!name.equalsIgnoreCase(F("Connection")) && - !name.equalsIgnoreCase(F("User-Agent")) && - !name.equalsIgnoreCase(F("Host")) && - !(name.equalsIgnoreCase(F("Authorization")) && _base64Authorization.length())){ - - String headerLine = name; - headerLine += ": "; - - if (replace) { - int headerStart = _headers.indexOf(headerLine); - if (headerStart != -1) { - int headerEnd = _headers.indexOf('\n', headerStart); - _headers = _headers.substring(0, headerStart) + _headers.substring(headerEnd + 1); - } - } - - headerLine += value; - headerLine += "\r\n"; - if(first) { - _headers = headerLine + _headers; - } else { - _headers += headerLine; - } - } - -} - -void HTTPClient::collectHeaders(const char* headerKeys[], const size_t headerKeysCount) -{ - _headerKeysCount = headerKeysCount; - if(_currentHeaders) { - delete[] _currentHeaders; - } - _currentHeaders = new RequestArgument[_headerKeysCount]; - for(size_t i = 0; i < _headerKeysCount; i++) { - _currentHeaders[i].key = headerKeys[i]; - } -} - -String HTTPClient::header(const char* name) -{ - for(size_t i = 0; i < _headerKeysCount; ++i) { - if(_currentHeaders[i].key == name) { - return _currentHeaders[i].value; - } - } - return String(); -} - -String HTTPClient::header(size_t i) -{ - if(i < _headerKeysCount) { - return _currentHeaders[i].value; - } - return String(); -} - -String HTTPClient::headerName(size_t i) -{ - if(i < _headerKeysCount) { - return _currentHeaders[i].key; - } - return String(); -} - -int HTTPClient::headers() -{ - return _headerKeysCount; -} - -bool HTTPClient::hasHeader(const char* name) -{ - for(size_t i = 0; i < _headerKeysCount; ++i) { - if((_currentHeaders[i].key == name) && (_currentHeaders[i].value.length() > 0)) { - return true; - } - } - return false; -} - -/** - * init TCP connection and handle ssl verify if needed - * @return true if connection is ok - */ -bool HTTPClient::connect(void) -{ - if(connected()) { - if(_reuse) { - log_d("already connected, reusing connection"); - } else { - log_d("already connected, try reuse!"); - } - while(_client->available() > 0) { - _client->read(); - } - return true; - } - -#ifdef HTTPCLIENT_1_1_COMPATIBLE - if(_transportTraits && !_client) { - _tcpDeprecated = _transportTraits->create(); - if(!_tcpDeprecated) { - log_e("failed to create client"); - return false; - } - _client = _tcpDeprecated.get(); - } -#endif - - if (!_client) { - log_d("HTTPClient::begin was not called or returned error"); - return false; - } - - if(!_client->connect(_host.c_str(), _port, _connectTimeout)) { - log_d("failed connect to %s:%u", _host.c_str(), _port); - return false; - } - - // set Timeout for WiFiClient and for Stream::readBytesUntil() and Stream::readStringUntil() - _client->setTimeout((_tcpTimeout + 500) / 1000); - - log_d(" connected to %s:%u", _host.c_str(), _port); - -#ifdef HTTPCLIENT_1_1_COMPATIBLE - if (_tcpDeprecated && !_transportTraits->verify(*_client, _host.c_str())) { - log_d("transport level verify failed"); - _client->stop(); - return false; - } -#endif - - -/* -#ifdef ESP8266 - _client->setNoDelay(true); -#endif - */ - return connected(); -} - -/** - * sends HTTP request header - * @param type (GET, POST, ...) - * @return status - */ -bool HTTPClient::sendHeader(const char * type) -{ - if(!connected()) { - return false; - } - - String header = String(type) + " " + _uri + F(" HTTP/1."); - - if(_useHTTP10) { - header += "0"; - } else { - header += "1"; - } - - header += String(F("\r\nHost: ")) + _host; - if (_port != 80 && _port != 443) - { - header += ':'; - header += String(_port); - } - header += String(F("\r\nUser-Agent: ")) + _userAgent + - F("\r\nConnection: "); - - if(_reuse) { - header += F("keep-alive"); - } else { - header += F("close"); - } - header += "\r\n"; - - if(!_useHTTP10) { - header += F("Accept-Encoding: identity;q=1,chunked;q=0.1,*;q=0\r\n"); - } - - if(_base64Authorization.length()) { - _base64Authorization.replace("\n", ""); - header += F("Authorization: Basic "); - header += _base64Authorization; - header += "\r\n"; - } - - header += _headers + "\r\n"; - - return (_client->write((const uint8_t *) header.c_str(), header.length()) == header.length()); -} - -/** - * reads the response from the server - * @return int http code - */ -int HTTPClient::handleHeaderResponse() -{ - - if(!connected()) { - return HTTPC_ERROR_NOT_CONNECTED; - } - - clear(); - - _canReuse = _reuse; - - String transferEncoding; - - _transferEncoding = HTTPC_TE_IDENTITY; - unsigned long lastDataTime = millis(); - - while(connected()) { - size_t len = _client->available(); - if(len > 0) { - String headerLine = _client->readStringUntil('\n'); - headerLine.trim(); // remove \r - - lastDataTime = millis(); - - log_v("RX: '%s'", headerLine.c_str()); - - if(headerLine.startsWith("HTTP/1.")) { - if(_canReuse) { - _canReuse = (headerLine[sizeof "HTTP/1." - 1] != '0'); - } - _returnCode = headerLine.substring(9, headerLine.indexOf(' ', 9)).toInt(); - } else if(headerLine.indexOf(':')) { - String headerName = headerLine.substring(0, headerLine.indexOf(':')); - String headerValue = headerLine.substring(headerLine.indexOf(':') + 1); - headerValue.trim(); - - if(headerName.equalsIgnoreCase("Content-Length")) { - _size = headerValue.toInt(); - } - - if(_canReuse && headerName.equalsIgnoreCase("Connection")) { - if(headerValue.indexOf("close") >= 0 && headerValue.indexOf("keep-alive") < 0) { - _canReuse = false; - } - } - - if(headerName.equalsIgnoreCase("Transfer-Encoding")) { - transferEncoding = headerValue; - } - - for(size_t i = 0; i < _headerKeysCount; i++) { - if(_currentHeaders[i].key.equalsIgnoreCase(headerName)) { - _currentHeaders[i].value = headerValue; - break; - } - } - } - - if(headerLine == "") { - log_d("code: %d", _returnCode); - - if(_size > 0) { - log_d("size: %d", _size); - } - - if(transferEncoding.length() > 0) { - log_d("Transfer-Encoding: %s", transferEncoding.c_str()); - if(transferEncoding.equalsIgnoreCase("chunked")) { - _transferEncoding = HTTPC_TE_CHUNKED; - } else { - return HTTPC_ERROR_ENCODING; - } - } else { - _transferEncoding = HTTPC_TE_IDENTITY; - } - - if(_returnCode) { - return _returnCode; - } else { - log_d("Remote host is not an HTTP Server!"); - return HTTPC_ERROR_NO_HTTP_SERVER; - } - } - - } else { - if((millis() - lastDataTime) > _tcpTimeout) { - return HTTPC_ERROR_READ_TIMEOUT; - } - delay(10); - } - } - - return HTTPC_ERROR_CONNECTION_LOST; -} - -/** - * write one Data Block to Stream - * @param stream Stream * - * @param size int - * @return < 0 = error >= 0 = size written - */ -int HTTPClient::writeToStreamDataBlock(Stream * stream, int size) -{ - int buff_size = HTTP_TCP_BUFFER_SIZE; - int len = size; - int bytesWritten = 0; - - // if possible create smaller buffer then HTTP_TCP_BUFFER_SIZE - if((len > 0) && (len < HTTP_TCP_BUFFER_SIZE)) { - buff_size = len; - } - - // create buffer for read - uint8_t * buff = (uint8_t *) malloc(buff_size); - - if(buff) { - // read all data from server - while(connected() && (len > 0 || len == -1)) { - - // get available data size - size_t sizeAvailable = _client->available(); - - if(sizeAvailable) { - - int readBytes = sizeAvailable; - - // read only the asked bytes - if(len > 0 && readBytes > len) { - readBytes = len; - } - - // not read more the buffer can handle - if(readBytes > buff_size) { - readBytes = buff_size; - } - - // stop if no more reading - if (readBytes == 0) - break; - - // read data - int bytesRead = _client->readBytes(buff, readBytes); - - // write it to Stream - int bytesWrite = stream->write(buff, bytesRead); - bytesWritten += bytesWrite; - - // are all Bytes a writen to stream ? - if(bytesWrite != bytesRead) { - log_d("short write asked for %d but got %d retry...", bytesRead, bytesWrite); - - // check for write error - if(stream->getWriteError()) { - log_d("stream write error %d", stream->getWriteError()); - - //reset write error for retry - stream->clearWriteError(); - } - - // some time for the stream - delay(1); - - int leftBytes = (readBytes - bytesWrite); - - // retry to send the missed bytes - bytesWrite = stream->write((buff + bytesWrite), leftBytes); - bytesWritten += bytesWrite; - - if(bytesWrite != leftBytes) { - // failed again - log_w("short write asked for %d but got %d failed.", leftBytes, bytesWrite); - free(buff); - return HTTPC_ERROR_STREAM_WRITE; - } - } - - // check for write error - if(stream->getWriteError()) { - log_w("stream write error %d", stream->getWriteError()); - free(buff); - return HTTPC_ERROR_STREAM_WRITE; - } - - // count bytes to read left - if(len > 0) { - len -= readBytes; - } - - delay(0); - } else { - delay(1); - } - } - - free(buff); - - log_d("connection closed or file end (written: %d).", bytesWritten); - - if((size > 0) && (size != bytesWritten)) { - log_d("bytesWritten %d and size %d mismatch!.", bytesWritten, size); - return HTTPC_ERROR_STREAM_WRITE; - } - - } else { - log_w("too less ram! need %d", HTTP_TCP_BUFFER_SIZE); - return HTTPC_ERROR_TOO_LESS_RAM; - } - - return bytesWritten; -} - -/** - * called to handle error return, may disconnect the connection if still exists - * @param error - * @return error - */ -int HTTPClient::returnError(int error) -{ - if(error < 0) { - log_w("error(%d): %s", error, errorToString(error).c_str()); - if(connected()) { - log_d("tcp stop"); - _client->stop(); - } - } - return error; -} diff --git a/libraries/HTTPClient/src/HTTPClient.h b/libraries/HTTPClient/src/HTTPClient.h deleted file mode 100644 index e089bb54973..00000000000 --- a/libraries/HTTPClient/src/HTTPClient.h +++ /dev/null @@ -1,243 +0,0 @@ -/** - * HTTPClient.h - * - * Created on: 02.11.2015 - * - * Copyright (c) 2015 Markus Sattler. All rights reserved. - * This file is part of the HTTPClient for Arduino. - * Port to ESP32 by Evandro Luis Copercini (2017), - * changed fingerprints to CA verification. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifndef HTTPClient_H_ -#define HTTPClient_H_ - -#define HTTPCLIENT_1_1_COMPATIBLE - -#include -#include -#include -#include - -#define HTTPCLIENT_DEFAULT_TCP_TIMEOUT (5000) - -/// HTTP client errors -#define HTTPC_ERROR_CONNECTION_REFUSED (-1) -#define HTTPC_ERROR_SEND_HEADER_FAILED (-2) -#define HTTPC_ERROR_SEND_PAYLOAD_FAILED (-3) -#define HTTPC_ERROR_NOT_CONNECTED (-4) -#define HTTPC_ERROR_CONNECTION_LOST (-5) -#define HTTPC_ERROR_NO_STREAM (-6) -#define HTTPC_ERROR_NO_HTTP_SERVER (-7) -#define HTTPC_ERROR_TOO_LESS_RAM (-8) -#define HTTPC_ERROR_ENCODING (-9) -#define HTTPC_ERROR_STREAM_WRITE (-10) -#define HTTPC_ERROR_READ_TIMEOUT (-11) - -/// size for the stream handling -#define HTTP_TCP_BUFFER_SIZE (1460) - -/// HTTP codes see RFC7231 -typedef enum { - HTTP_CODE_CONTINUE = 100, - HTTP_CODE_SWITCHING_PROTOCOLS = 101, - HTTP_CODE_PROCESSING = 102, - HTTP_CODE_OK = 200, - HTTP_CODE_CREATED = 201, - HTTP_CODE_ACCEPTED = 202, - HTTP_CODE_NON_AUTHORITATIVE_INFORMATION = 203, - HTTP_CODE_NO_CONTENT = 204, - HTTP_CODE_RESET_CONTENT = 205, - HTTP_CODE_PARTIAL_CONTENT = 206, - HTTP_CODE_MULTI_STATUS = 207, - HTTP_CODE_ALREADY_REPORTED = 208, - HTTP_CODE_IM_USED = 226, - HTTP_CODE_MULTIPLE_CHOICES = 300, - HTTP_CODE_MOVED_PERMANENTLY = 301, - HTTP_CODE_FOUND = 302, - HTTP_CODE_SEE_OTHER = 303, - HTTP_CODE_NOT_MODIFIED = 304, - HTTP_CODE_USE_PROXY = 305, - HTTP_CODE_TEMPORARY_REDIRECT = 307, - HTTP_CODE_PERMANENT_REDIRECT = 308, - HTTP_CODE_BAD_REQUEST = 400, - HTTP_CODE_UNAUTHORIZED = 401, - HTTP_CODE_PAYMENT_REQUIRED = 402, - HTTP_CODE_FORBIDDEN = 403, - HTTP_CODE_NOT_FOUND = 404, - HTTP_CODE_METHOD_NOT_ALLOWED = 405, - HTTP_CODE_NOT_ACCEPTABLE = 406, - HTTP_CODE_PROXY_AUTHENTICATION_REQUIRED = 407, - HTTP_CODE_REQUEST_TIMEOUT = 408, - HTTP_CODE_CONFLICT = 409, - HTTP_CODE_GONE = 410, - HTTP_CODE_LENGTH_REQUIRED = 411, - HTTP_CODE_PRECONDITION_FAILED = 412, - HTTP_CODE_PAYLOAD_TOO_LARGE = 413, - HTTP_CODE_URI_TOO_LONG = 414, - HTTP_CODE_UNSUPPORTED_MEDIA_TYPE = 415, - HTTP_CODE_RANGE_NOT_SATISFIABLE = 416, - HTTP_CODE_EXPECTATION_FAILED = 417, - HTTP_CODE_MISDIRECTED_REQUEST = 421, - HTTP_CODE_UNPROCESSABLE_ENTITY = 422, - HTTP_CODE_LOCKED = 423, - HTTP_CODE_FAILED_DEPENDENCY = 424, - HTTP_CODE_UPGRADE_REQUIRED = 426, - HTTP_CODE_PRECONDITION_REQUIRED = 428, - HTTP_CODE_TOO_MANY_REQUESTS = 429, - HTTP_CODE_REQUEST_HEADER_FIELDS_TOO_LARGE = 431, - HTTP_CODE_INTERNAL_SERVER_ERROR = 500, - HTTP_CODE_NOT_IMPLEMENTED = 501, - HTTP_CODE_BAD_GATEWAY = 502, - HTTP_CODE_SERVICE_UNAVAILABLE = 503, - HTTP_CODE_GATEWAY_TIMEOUT = 504, - HTTP_CODE_HTTP_VERSION_NOT_SUPPORTED = 505, - HTTP_CODE_VARIANT_ALSO_NEGOTIATES = 506, - HTTP_CODE_INSUFFICIENT_STORAGE = 507, - HTTP_CODE_LOOP_DETECTED = 508, - HTTP_CODE_NOT_EXTENDED = 510, - HTTP_CODE_NETWORK_AUTHENTICATION_REQUIRED = 511 -} t_http_codes; - -typedef enum { - HTTPC_TE_IDENTITY, - HTTPC_TE_CHUNKED -} transferEncoding_t; - -#ifdef HTTPCLIENT_1_1_COMPATIBLE -class TransportTraits; -typedef std::unique_ptr TransportTraitsPtr; -#endif - -class HTTPClient -{ -public: - HTTPClient(); - ~HTTPClient(); - -/* - * Since both begin() functions take a reference to client as a parameter, you need to - * ensure the client object lives the entire time of the HTTPClient - */ - bool begin(WiFiClient &client, String url); - bool begin(WiFiClient &client, String host, uint16_t port, String uri = "/", bool https = false); - -#ifdef HTTPCLIENT_1_1_COMPATIBLE - bool begin(String url); - bool begin(String url, const char* CAcert); - bool begin(String host, uint16_t port, String uri = "/"); - bool begin(String host, uint16_t port, String uri, const char* CAcert); - bool begin(String host, uint16_t port, String uri, const char* CAcert, const char* cli_cert, const char* cli_key); -#endif - - void end(void); - - bool connected(void); - - void setReuse(bool reuse); /// keep-alive - void setUserAgent(const String& userAgent); - void setAuthorization(const char * user, const char * password); - void setAuthorization(const char * auth); - void setConnectTimeout(int32_t connectTimeout); - void setTimeout(uint16_t timeout); - - void useHTTP10(bool usehttp10 = true); - - /// request handling - int GET(); - int PATCH(uint8_t * payload, size_t size); - int PATCH(String payload); - int POST(uint8_t * payload, size_t size); - int POST(String payload); - int PUT(uint8_t * payload, size_t size); - int PUT(String payload); - int sendRequest(const char * type, String payload); - int sendRequest(const char * type, uint8_t * payload = NULL, size_t size = 0); - int sendRequest(const char * type, Stream * stream, size_t size = 0); - - void addHeader(const String& name, const String& value, bool first = false, bool replace = true); - - /// Response handling - void collectHeaders(const char* headerKeys[], const size_t headerKeysCount); - String header(const char* name); // get request header value by name - String header(size_t i); // get request header value by number - String headerName(size_t i); // get request header name by number - int headers(); // get header count - bool hasHeader(const char* name); // check if header exists - - - int getSize(void); - - WiFiClient& getStream(void); - WiFiClient* getStreamPtr(void); - int writeToStream(Stream* stream); - String getString(void); - - static String errorToString(int error); - -protected: - struct RequestArgument { - String key; - String value; - }; - - bool beginInternal(String url, const char* expectedProtocol); - void disconnect(bool preserveClient = false); - void clear(); - int returnError(int error); - bool connect(void); - bool sendHeader(const char * type); - int handleHeaderResponse(); - int writeToStreamDataBlock(Stream * stream, int len); - - -#ifdef HTTPCLIENT_1_1_COMPATIBLE - TransportTraitsPtr _transportTraits; - std::unique_ptr _tcpDeprecated; -#endif - - WiFiClient* _client = nullptr; - - /// request handling - String _host; - uint16_t _port = 0; - int32_t _connectTimeout = -1; - bool _reuse = true; - uint16_t _tcpTimeout = HTTPCLIENT_DEFAULT_TCP_TIMEOUT; - bool _useHTTP10 = false; - bool _secure = false; - - String _uri; - String _protocol; - String _headers; - String _userAgent = "ESP32HTTPClient"; - String _base64Authorization; - - /// Response handling - RequestArgument* _currentHeaders = nullptr; - size_t _headerKeysCount = 0; - - int _returnCode = 0; - int _size = -1; - bool _canReuse = false; - transferEncoding_t _transferEncoding = HTTPC_TE_IDENTITY; -}; - - - -#endif /* HTTPClient_H_ */ diff --git a/libraries/HTTPUpdate/examples/httpUpdate/httpUpdate.ino b/libraries/HTTPUpdate/examples/httpUpdate/httpUpdate.ino deleted file mode 100644 index f646be04583..00000000000 --- a/libraries/HTTPUpdate/examples/httpUpdate/httpUpdate.ino +++ /dev/null @@ -1,72 +0,0 @@ -/** - httpUpdate.ino - - Created on: 27.11.2015 - -*/ - -#include - -#include -#include - -#include -#include - -WiFiMulti WiFiMulti; - -void setup() { - - Serial.begin(115200); - // Serial.setDebugOutput(true); - - Serial.println(); - Serial.println(); - Serial.println(); - - for (uint8_t t = 4; t > 0; t--) { - Serial.printf("[SETUP] WAIT %d...\n", t); - Serial.flush(); - delay(1000); - } - - WiFi.mode(WIFI_STA); - WiFiMulti.addAP("SSID", "PASSWORD"); - - -} - -void loop() { - // wait for WiFi connection - if ((WiFiMulti.run() == WL_CONNECTED)) { - - WiFiClient client; - - // The line below is optional. It can be used to blink the LED on the board during flashing - // The LED will be on during download of one buffer of data from the network. The LED will - // be off during writing that buffer to flash - // On a good connection the LED should flash regularly. On a bad connection the LED will be - // on much longer than it will be off. Other pins than LED_BUILTIN may be used. The second - // value is used to put the LED on. If the LED is on with HIGH, that value should be passed - // httpUpdate.setLedPin(LED_BUILTIN, LOW); - - t_httpUpdate_return ret = httpUpdate.update(client, "http://server/file.bin"); - // Or: - //t_httpUpdate_return ret = httpUpdate.update(client, "server", 80, "file.bin"); - - switch (ret) { - case HTTP_UPDATE_FAILED: - Serial.printf("HTTP_UPDATE_FAILED Error (%d): %s\n", httpUpdate.getLastError(), httpUpdate.getLastErrorString().c_str()); - break; - - case HTTP_UPDATE_NO_UPDATES: - Serial.println("HTTP_UPDATE_NO_UPDATES"); - break; - - case HTTP_UPDATE_OK: - Serial.println("HTTP_UPDATE_OK"); - break; - } - } -} - diff --git a/libraries/HTTPUpdate/examples/httpUpdateSPIFFS/httpUpdateSPIFFS.ino b/libraries/HTTPUpdate/examples/httpUpdateSPIFFS/httpUpdateSPIFFS.ino deleted file mode 100644 index a07e6d2f4aa..00000000000 --- a/libraries/HTTPUpdate/examples/httpUpdateSPIFFS/httpUpdateSPIFFS.ino +++ /dev/null @@ -1,75 +0,0 @@ -/** - httpUpdateSPIFFS.ino - - Created on: 05.12.2015 - -*/ - -#include - -#include -#include - -#include -#include - -WiFiMulti WiFiMulti; - -void setup() { - - Serial.begin(115200); - // Serial.setDebugOutput(true); - - Serial.println(); - Serial.println(); - Serial.println(); - - for (uint8_t t = 4; t > 0; t--) { - Serial.printf("[SETUP] WAIT %d...\n", t); - Serial.flush(); - delay(1000); - } - - WiFi.mode(WIFI_STA); - WiFiMulti.addAP("SSID", "PASSWORD"); - -} - -void loop() { - // wait for WiFi connection - if ((WiFiMulti.run() == WL_CONNECTED)) { - - Serial.println("Update SPIFFS..."); - - WiFiClient client; - - // The line below is optional. It can be used to blink the LED on the board during flashing - // The LED will be on during download of one buffer of data from the network. The LED will - // be off during writing that buffer to flash - // On a good connection the LED should flash regularly. On a bad connection the LED will be - // on much longer than it will be off. Other pins than LED_BUILTIN may be used. The second - // value is used to put the LED on. If the LED is on with HIGH, that value should be passed - // httpUpdate.setLedPin(LED_BUILTIN, LOW); - - t_httpUpdate_return ret = httpUpdate.updateSpiffs(client, "http://server/spiffs.bin"); - if (ret == HTTP_UPDATE_OK) { - Serial.println("Update sketch..."); - ret = httpUpdate.update(client, "http://server/file.bin"); - - switch (ret) { - case HTTP_UPDATE_FAILED: - Serial.printf("HTTP_UPDATE_FAILED Error (%d): %s", httpUpdate.getLastError(), httpUpdate.getLastErrorString().c_str()); - break; - - case HTTP_UPDATE_NO_UPDATES: - Serial.println("HTTP_UPDATE_NO_UPDATES"); - break; - - case HTTP_UPDATE_OK: - Serial.println("HTTP_UPDATE_OK"); - break; - } - } - } -} - diff --git a/libraries/HTTPUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino b/libraries/HTTPUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino deleted file mode 100644 index 5daa2a4f2a1..00000000000 --- a/libraries/HTTPUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino +++ /dev/null @@ -1,128 +0,0 @@ -/** - httpUpdateSecure.ino - - Created on: 16.10.2018 as an adaptation of the ESP8266 version of httpUpdate.ino - -*/ - -#include -#include - -#include -#include - -#include - -WiFiMulti WiFiMulti; - -// Set time via NTP, as required for x.509 validation -void setClock() { - configTime(0, 0, "pool.ntp.org", "time.nist.gov"); // UTC - - Serial.print(F("Waiting for NTP time sync: ")); - time_t now = time(nullptr); - while (now < 8 * 3600 * 2) { - yield(); - delay(500); - Serial.print(F(".")); - now = time(nullptr); - } - - Serial.println(F("")); - struct tm timeinfo; - gmtime_r(&now, &timeinfo); - Serial.print(F("Current time: ")); - Serial.print(asctime(&timeinfo)); -} - -/** - * This is lets-encrypt-x3-cross-signed.pem - */ -const char* rootCACertificate = \ -"-----BEGIN CERTIFICATE-----\n" \ -"MIIEkjCCA3qgAwIBAgIQCgFBQgAAAVOFc2oLheynCDANBgkqhkiG9w0BAQsFADA/\n" \ -"MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT\n" \ -"DkRTVCBSb290IENBIFgzMB4XDTE2MDMxNzE2NDA0NloXDTIxMDMxNzE2NDA0Nlow\n" \ -"SjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUxldCdzIEVuY3J5cHQxIzAhBgNVBAMT\n" \ -"GkxldCdzIEVuY3J5cHQgQXV0aG9yaXR5IFgzMIIBIjANBgkqhkiG9w0BAQEFAAOC\n" \ -"AQ8AMIIBCgKCAQEAnNMM8FrlLke3cl03g7NoYzDq1zUmGSXhvb418XCSL7e4S0EF\n" \ -"q6meNQhY7LEqxGiHC6PjdeTm86dicbp5gWAf15Gan/PQeGdxyGkOlZHP/uaZ6WA8\n" \ -"SMx+yk13EiSdRxta67nsHjcAHJyse6cF6s5K671B5TaYucv9bTyWaN8jKkKQDIZ0\n" \ -"Z8h/pZq4UmEUEz9l6YKHy9v6Dlb2honzhT+Xhq+w3Brvaw2VFn3EK6BlspkENnWA\n" \ -"a6xK8xuQSXgvopZPKiAlKQTGdMDQMc2PMTiVFrqoM7hD8bEfwzB/onkxEz0tNvjj\n" \ -"/PIzark5McWvxI0NHWQWM6r6hCm21AvA2H3DkwIDAQABo4IBfTCCAXkwEgYDVR0T\n" \ -"AQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAYYwfwYIKwYBBQUHAQEEczBxMDIG\n" \ -"CCsGAQUFBzABhiZodHRwOi8vaXNyZy50cnVzdGlkLm9jc3AuaWRlbnRydXN0LmNv\n" \ -"bTA7BggrBgEFBQcwAoYvaHR0cDovL2FwcHMuaWRlbnRydXN0LmNvbS9yb290cy9k\n" \ -"c3Ryb290Y2F4My5wN2MwHwYDVR0jBBgwFoAUxKexpHsscfrb4UuQdf/EFWCFiRAw\n" \ -"VAYDVR0gBE0wSzAIBgZngQwBAgEwPwYLKwYBBAGC3xMBAQEwMDAuBggrBgEFBQcC\n" \ -"ARYiaHR0cDovL2Nwcy5yb290LXgxLmxldHNlbmNyeXB0Lm9yZzA8BgNVHR8ENTAz\n" \ -"MDGgL6AthitodHRwOi8vY3JsLmlkZW50cnVzdC5jb20vRFNUUk9PVENBWDNDUkwu\n" \ -"Y3JsMB0GA1UdDgQWBBSoSmpjBH3duubRObemRWXv86jsoTANBgkqhkiG9w0BAQsF\n" \ -"AAOCAQEA3TPXEfNjWDjdGBX7CVW+dla5cEilaUcne8IkCJLxWh9KEik3JHRRHGJo\n" \ -"uM2VcGfl96S8TihRzZvoroed6ti6WqEBmtzw3Wodatg+VyOeph4EYpr/1wXKtx8/\n" \ -"wApIvJSwtmVi4MFU5aMqrSDE6ea73Mj2tcMyo5jMd6jmeWUHK8so/joWUoHOUgwu\n" \ -"X4Po1QYz+3dszkDqMp4fklxBwXRsW10KXzPMTZ+sOPAveyxindmjkW8lGy+QsRlG\n" \ -"PfZ+G6Z6h7mjem0Y+iWlkYcV4PIWL1iwBi8saCbGS5jN2p8M+X+Q7UNKEkROb3N6\n" \ -"KOqkqm57TH2H3eDJAkSnh6/DNFu0Qg==\n" \ -"-----END CERTIFICATE-----\n"; - -void setup() { - - Serial.begin(115200); - // Serial.setDebugOutput(true); - - Serial.println(); - Serial.println(); - Serial.println(); - - for (uint8_t t = 4; t > 0; t--) { - Serial.printf("[SETUP] WAIT %d...\n", t); - Serial.flush(); - delay(1000); - } - - WiFi.mode(WIFI_STA); - WiFiMulti.addAP("SSID", "PASSWORD"); -} - -void loop() { - // wait for WiFi connection - if ((WiFiMulti.run() == WL_CONNECTED)) { - - setClock(); - - WiFiClientSecure client; - client.setCACert(rootCACertificate); - - // Reading data over SSL may be slow, use an adequate timeout - client.setTimeout(12000 / 1000); // timeout argument is defined in seconds for setTimeout - - // The line below is optional. It can be used to blink the LED on the board during flashing - // The LED will be on during download of one buffer of data from the network. The LED will - // be off during writing that buffer to flash - // On a good connection the LED should flash regularly. On a bad connection the LED will be - // on much longer than it will be off. Other pins than LED_BUILTIN may be used. The second - // value is used to put the LED on. If the LED is on with HIGH, that value should be passed - // httpUpdate.setLedPin(LED_BUILTIN, HIGH); - - t_httpUpdate_return ret = httpUpdate.update(client, "https://server/file.bin"); - // Or: - //t_httpUpdate_return ret = httpUpdate.update(client, "server", 443, "file.bin"); - - - switch (ret) { - case HTTP_UPDATE_FAILED: - Serial.printf("HTTP_UPDATE_FAILED Error (%d): %s\n", httpUpdate.getLastError(), httpUpdate.getLastErrorString().c_str()); - break; - - case HTTP_UPDATE_NO_UPDATES: - Serial.println("HTTP_UPDATE_NO_UPDATES"); - break; - - case HTTP_UPDATE_OK: - Serial.println("HTTP_UPDATE_OK"); - break; - } - } -} diff --git a/libraries/HTTPUpdate/keywords.txt b/libraries/HTTPUpdate/keywords.txt deleted file mode 100644 index 78be600d420..00000000000 --- a/libraries/HTTPUpdate/keywords.txt +++ /dev/null @@ -1,42 +0,0 @@ -####################################### -# Syntax Coloring Map For ESP8266httpUpdate -####################################### - -####################################### -# Library (KEYWORD3) -####################################### - -ESP8266httpUpdate KEYWORD3 RESERVED_WORD - -####################################### -# Datatypes (KEYWORD1) -####################################### - -HTTPUpdateResult KEYWORD1 DATA_TYPE -ESPhttpUpdate KEYWORD1 DATA_TYPE - -####################################### -# Methods and Functions (KEYWORD2) -####################################### - -rebootOnUpdate KEYWORD2 -update KEYWORD2 -updateSpiffs KEYWORD2 -getLastError KEYWORD2 -getLastErrorString KEYWORD2 - -####################################### -# Constants (LITERAL1) -####################################### - -HTTP_UE_TOO_LESS_SPACE LITERAL1 RESERVED_WORD_2 -HTTP_UE_SERVER_NOT_REPORT_SIZE LITERAL1 RESERVED_WORD_2 -HTTP_UE_SERVER_FILE_NOT_FOUND LITERAL1 RESERVED_WORD_2 -HTTP_UE_SERVER_FORBIDDEN LITERAL1 RESERVED_WORD_2 -HTTP_UE_SERVER_WRONG_HTTP_CODE LITERAL1 RESERVED_WORD_2 -HTTP_UE_SERVER_FAULTY_MD5 LITERAL1 RESERVED_WORD_2 -HTTP_UE_BIN_VERIFY_HEADER_FAILED LITERAL1 RESERVED_WORD_2 -HTTP_UE_BIN_FOR_WRONG_FLASH LITERAL1 RESERVED_WORD_2 -HTTP_UPDATE_FAILED LITERAL1 RESERVED_WORD_2 -HTTP_UPDATE_NO_UPDATES LITERAL1 RESERVED_WORD_2 -HTTP_UPDATE_OK LITERAL1 RESERVED_WORD_2 diff --git a/libraries/HTTPUpdate/library.properties b/libraries/HTTPUpdate/library.properties deleted file mode 100644 index 5147ddec2c9..00000000000 --- a/libraries/HTTPUpdate/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=HTTPUpdate -version=1.3 -author=Markus Sattler -maintainer=Markus Sattler -sentence=Http Update for ESP32 -paragraph= -category=Data Processing -url=https://github.com/Links2004/Arduino/tree/esp8266/hardware/esp8266com/esp8266/libraries/ESP8266httpUpdate -architectures=esp32 diff --git a/libraries/HTTPUpdate/src/HTTPUpdate.cpp b/libraries/HTTPUpdate/src/HTTPUpdate.cpp deleted file mode 100644 index f4c3d250fa7..00000000000 --- a/libraries/HTTPUpdate/src/HTTPUpdate.cpp +++ /dev/null @@ -1,417 +0,0 @@ -/** - * - * @file HTTPUpdate.cpp based om ESP8266HTTPUpdate.cpp - * @date 16.10.2018 - * @author Markus Sattler - * - * Copyright (c) 2015 Markus Sattler. All rights reserved. - * This file is part of the ESP32 Http Updater. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#include "HTTPUpdate.h" -#include - -#include -#include // get running partition - -// To do extern "C" uint32_t _SPIFFS_start; -// To do extern "C" uint32_t _SPIFFS_end; - -HTTPUpdate::HTTPUpdate(void) - : _httpClientTimeout(8000), _ledPin(-1) -{ -} - -HTTPUpdate::HTTPUpdate(int httpClientTimeout) - : _httpClientTimeout(httpClientTimeout), _ledPin(-1) -{ -} - -HTTPUpdate::~HTTPUpdate(void) -{ -} - -HTTPUpdateResult HTTPUpdate::update(WiFiClient& client, const String& url, const String& currentVersion) -{ - HTTPClient http; - if(!http.begin(client, url)) - { - return HTTP_UPDATE_FAILED; - } - return handleUpdate(http, currentVersion, false); -} - -HTTPUpdateResult HTTPUpdate::updateSpiffs(WiFiClient& client, const String& url, const String& currentVersion) -{ - HTTPClient http; - if(!http.begin(client, url)) - { - return HTTP_UPDATE_FAILED; - } - return handleUpdate(http, currentVersion, true); -} - -HTTPUpdateResult HTTPUpdate::update(WiFiClient& client, const String& host, uint16_t port, const String& uri, - const String& currentVersion) -{ - HTTPClient http; - if(!http.begin(client, host, port, uri)) - { - return HTTP_UPDATE_FAILED; - } - return handleUpdate(http, currentVersion, false); -} - -/** - * return error code as int - * @return int error code - */ -int HTTPUpdate::getLastError(void) -{ - return _lastError; -} - -/** - * return error code as String - * @return String error - */ -String HTTPUpdate::getLastErrorString(void) -{ - - if(_lastError == 0) { - return String(); // no error - } - - // error from Update class - if(_lastError > 0) { - StreamString error; - Update.printError(error); - error.trim(); // remove line ending - return String("Update error: ") + error; - } - - // error from http client - if(_lastError > -100) { - return String("HTTP error: ") + HTTPClient::errorToString(_lastError); - } - - switch(_lastError) { - case HTTP_UE_TOO_LESS_SPACE: - return "Not Enough space"; - case HTTP_UE_SERVER_NOT_REPORT_SIZE: - return "Server Did Not Report Size"; - case HTTP_UE_SERVER_FILE_NOT_FOUND: - return "File Not Found (404)"; - case HTTP_UE_SERVER_FORBIDDEN: - return "Forbidden (403)"; - case HTTP_UE_SERVER_WRONG_HTTP_CODE: - return "Wrong HTTP Code"; - case HTTP_UE_SERVER_FAULTY_MD5: - return "Wrong MD5"; - case HTTP_UE_BIN_VERIFY_HEADER_FAILED: - return "Verify Bin Header Failed"; - case HTTP_UE_BIN_FOR_WRONG_FLASH: - return "New Binary Does Not Fit Flash Size"; - case HTTP_UE_NO_PARTITION: - return "Partition Could Not be Found"; - } - - return String(); -} - - -String getSketchSHA256() { - const size_t HASH_LEN = 32; // SHA-256 digest length - - uint8_t sha_256[HASH_LEN] = { 0 }; - -// get sha256 digest for running partition - if(esp_partition_get_sha256(esp_ota_get_running_partition(), sha_256) == 0) { - char buffer[2 * HASH_LEN + 1]; - - for(size_t index = 0; index < HASH_LEN; index++) { - uint8_t nibble = (sha_256[index] & 0xf0) >> 4; - buffer[2 * index] = nibble < 10 ? char(nibble + '0') : char(nibble - 10 + 'A'); - - nibble = sha_256[index] & 0x0f; - buffer[2 * index + 1] = nibble < 10 ? char(nibble + '0') : char(nibble - 10 + 'A'); - } - - buffer[2 * HASH_LEN] = '\0'; - - return String(buffer); - } else { - - return String(); - } -} - -/** - * - * @param http HTTPClient * - * @param currentVersion const char * - * @return HTTPUpdateResult - */ -HTTPUpdateResult HTTPUpdate::handleUpdate(HTTPClient& http, const String& currentVersion, bool spiffs) -{ - - HTTPUpdateResult ret = HTTP_UPDATE_FAILED; - - // use HTTP/1.0 for update since the update handler not support any transfer Encoding - http.useHTTP10(true); - http.setTimeout(_httpClientTimeout); - http.setUserAgent("ESP32-http-Update"); - http.addHeader("Cache-Control", "no-cache"); - http.addHeader("x-ESP32-STA-MAC", WiFi.macAddress()); - http.addHeader("x-ESP32-AP-MAC", WiFi.softAPmacAddress()); - http.addHeader("x-ESP32-free-space", String(ESP.getFreeSketchSpace())); - http.addHeader("x-ESP32-sketch-size", String(ESP.getSketchSize())); - String sketchMD5 = ESP.getSketchMD5(); - if(sketchMD5.length() != 0) { - http.addHeader("x-ESP32-sketch-md5", sketchMD5); - } - // Add also a SHA256 - String sketchSHA256 = getSketchSHA256(); - if(sketchSHA256.length() != 0) { - http.addHeader("x-ESP32-sketch-sha256", sketchSHA256); - } - http.addHeader("x-ESP32-chip-size", String(ESP.getFlashChipSize())); - http.addHeader("x-ESP32-sdk-version", ESP.getSdkVersion()); - - if(spiffs) { - http.addHeader("x-ESP32-mode", "spiffs"); - } else { - http.addHeader("x-ESP32-mode", "sketch"); - } - - if(currentVersion && currentVersion[0] != 0x00) { - http.addHeader("x-ESP32-version", currentVersion); - } - - const char * headerkeys[] = { "x-MD5" }; - size_t headerkeyssize = sizeof(headerkeys) / sizeof(char*); - - // track these headers - http.collectHeaders(headerkeys, headerkeyssize); - - - int code = http.GET(); - int len = http.getSize(); - - if(code <= 0) { - log_e("HTTP error: %s\n", http.errorToString(code).c_str()); - _lastError = code; - http.end(); - return HTTP_UPDATE_FAILED; - } - - - log_d("Header read fin.\n"); - log_d("Server header:\n"); - log_d(" - code: %d\n", code); - log_d(" - len: %d\n", len); - - if(http.hasHeader("x-MD5")) { - log_d(" - MD5: %s\n", http.header("x-MD5").c_str()); - } - - log_d("ESP32 info:\n"); - log_d(" - free Space: %d\n", ESP.getFreeSketchSpace()); - log_d(" - current Sketch Size: %d\n", ESP.getSketchSize()); - - if(currentVersion && currentVersion[0] != 0x00) { - log_d(" - current version: %s\n", currentVersion.c_str() ); - } - - switch(code) { - case HTTP_CODE_OK: ///< OK (Start Update) - if(len > 0) { - bool startUpdate = true; - if(spiffs) { - const esp_partition_t* _partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_SPIFFS, NULL); - if(!_partition){ - _lastError = HTTP_UE_NO_PARTITION; - return HTTP_UPDATE_FAILED; - } - - if(len > _partition->size) { - log_e("spiffsSize to low (%d) needed: %d\n", _partition->size, len); - startUpdate = false; - } - } else { - int sketchFreeSpace = ESP.getFreeSketchSpace(); - if(!sketchFreeSpace){ - _lastError = HTTP_UE_NO_PARTITION; - return HTTP_UPDATE_FAILED; - } - - if(len > sketchFreeSpace) { - log_e("FreeSketchSpace to low (%d) needed: %d\n", sketchFreeSpace, len); - startUpdate = false; - } - } - - if(!startUpdate) { - _lastError = HTTP_UE_TOO_LESS_SPACE; - ret = HTTP_UPDATE_FAILED; - } else { - - WiFiClient * tcp = http.getStreamPtr(); - -// To do? WiFiUDP::stopAll(); -// To do? WiFiClient::stopAllExcept(tcp); - - delay(100); - - int command; - - if(spiffs) { - command = U_SPIFFS; - log_d("runUpdate spiffs...\n"); - } else { - command = U_FLASH; - log_d("runUpdate flash...\n"); - } - - if(!spiffs) { -/* To do - uint8_t buf[4]; - if(tcp->peekBytes(&buf[0], 4) != 4) { - log_e("peekBytes magic header failed\n"); - _lastError = HTTP_UE_BIN_VERIFY_HEADER_FAILED; - http.end(); - return HTTP_UPDATE_FAILED; - } -*/ - - // check for valid first magic byte -// if(buf[0] != 0xE9) { - if(tcp->peek() != 0xE9) { - log_e("Magic header does not start with 0xE9\n"); - _lastError = HTTP_UE_BIN_VERIFY_HEADER_FAILED; - http.end(); - return HTTP_UPDATE_FAILED; - - } -/* To do - uint32_t bin_flash_size = ESP.magicFlashChipSize((buf[3] & 0xf0) >> 4); - - // check if new bin fits to SPI flash - if(bin_flash_size > ESP.getFlashChipRealSize()) { - log_e("New binary does not fit SPI Flash size\n"); - _lastError = HTTP_UE_BIN_FOR_WRONG_FLASH; - http.end(); - return HTTP_UPDATE_FAILED; - } -*/ - } - if(runUpdate(*tcp, len, http.header("x-MD5"), command)) { - ret = HTTP_UPDATE_OK; - log_d("Update ok\n"); - http.end(); - - if(_rebootOnUpdate && !spiffs) { - ESP.restart(); - } - - } else { - ret = HTTP_UPDATE_FAILED; - log_e("Update failed\n"); - } - } - } else { - _lastError = HTTP_UE_SERVER_NOT_REPORT_SIZE; - ret = HTTP_UPDATE_FAILED; - log_e("Content-Length was 0 or wasn't set by Server?!\n"); - } - break; - case HTTP_CODE_NOT_MODIFIED: - ///< Not Modified (No updates) - ret = HTTP_UPDATE_NO_UPDATES; - break; - case HTTP_CODE_NOT_FOUND: - _lastError = HTTP_UE_SERVER_FILE_NOT_FOUND; - ret = HTTP_UPDATE_FAILED; - break; - case HTTP_CODE_FORBIDDEN: - _lastError = HTTP_UE_SERVER_FORBIDDEN; - ret = HTTP_UPDATE_FAILED; - break; - default: - _lastError = HTTP_UE_SERVER_WRONG_HTTP_CODE; - ret = HTTP_UPDATE_FAILED; - log_e("HTTP Code is (%d)\n", code); - break; - } - - http.end(); - return ret; -} - -/** - * write Update to flash - * @param in Stream& - * @param size uint32_t - * @param md5 String - * @return true if Update ok - */ -bool HTTPUpdate::runUpdate(Stream& in, uint32_t size, String md5, int command) -{ - - StreamString error; - - if(!Update.begin(size, command, _ledPin, _ledOn)) { - _lastError = Update.getError(); - Update.printError(error); - error.trim(); // remove line ending - log_e("Update.begin failed! (%s)\n", error.c_str()); - return false; - } - - if(md5.length()) { - if(!Update.setMD5(md5.c_str())) { - _lastError = HTTP_UE_SERVER_FAULTY_MD5; - log_e("Update.setMD5 failed! (%s)\n", md5.c_str()); - return false; - } - } - -// To do: the SHA256 could be checked if the server sends it - - if(Update.writeStream(in) != size) { - _lastError = Update.getError(); - Update.printError(error); - error.trim(); // remove line ending - log_e("Update.writeStream failed! (%s)\n", error.c_str()); - return false; - } - - if(!Update.end()) { - _lastError = Update.getError(); - Update.printError(error); - error.trim(); // remove line ending - log_e("Update.end failed! (%s)\n", error.c_str()); - return false; - } - - return true; -} - -#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_HTTPUPDATE) -HTTPUpdate httpUpdate; -#endif diff --git a/libraries/HTTPUpdate/src/HTTPUpdate.h b/libraries/HTTPUpdate/src/HTTPUpdate.h deleted file mode 100644 index f126cba0639..00000000000 --- a/libraries/HTTPUpdate/src/HTTPUpdate.h +++ /dev/null @@ -1,101 +0,0 @@ -/** - * - * @file HTTPUpdate.h based on ESP8266HTTPUpdate.h - * @date 16.10.2018 - * @author Markus Sattler - * - * Copyright (c) 2015 Markus Sattler. All rights reserved. - * This file is part of the ESP32 Http Updater. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifndef ___HTTP_UPDATE_H___ -#define ___HTTP_UPDATE_H___ - -#include -#include -#include -#include -#include -#include - -/// note we use HTTP client errors too so we start at 100 -#define HTTP_UE_TOO_LESS_SPACE (-100) -#define HTTP_UE_SERVER_NOT_REPORT_SIZE (-101) -#define HTTP_UE_SERVER_FILE_NOT_FOUND (-102) -#define HTTP_UE_SERVER_FORBIDDEN (-103) -#define HTTP_UE_SERVER_WRONG_HTTP_CODE (-104) -#define HTTP_UE_SERVER_FAULTY_MD5 (-105) -#define HTTP_UE_BIN_VERIFY_HEADER_FAILED (-106) -#define HTTP_UE_BIN_FOR_WRONG_FLASH (-107) -#define HTTP_UE_NO_PARTITION (-108) - -enum HTTPUpdateResult { - HTTP_UPDATE_FAILED, - HTTP_UPDATE_NO_UPDATES, - HTTP_UPDATE_OK -}; - -typedef HTTPUpdateResult t_httpUpdate_return; // backward compatibility - -class HTTPUpdate -{ -public: - HTTPUpdate(void); - HTTPUpdate(int httpClientTimeout); - ~HTTPUpdate(void); - - void rebootOnUpdate(bool reboot) - { - _rebootOnUpdate = reboot; - } - - void setLedPin(int ledPin = -1, uint8_t ledOn = HIGH) - { - _ledPin = ledPin; - _ledOn = ledOn; - } - - t_httpUpdate_return update(WiFiClient& client, const String& url, const String& currentVersion = ""); - - t_httpUpdate_return update(WiFiClient& client, const String& host, uint16_t port, const String& uri = "/", - const String& currentVersion = ""); - - t_httpUpdate_return updateSpiffs(WiFiClient& client, const String& url, const String& currentVersion = ""); - - - int getLastError(void); - String getLastErrorString(void); - -protected: - t_httpUpdate_return handleUpdate(HTTPClient& http, const String& currentVersion, bool spiffs = false); - bool runUpdate(Stream& in, uint32_t size, String md5, int command = U_FLASH); - - int _lastError; - bool _rebootOnUpdate = true; -private: - int _httpClientTimeout; - - int _ledPin; - uint8_t _ledOn; -}; - -#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_HTTPUPDATE) -extern HTTPUpdate httpUpdate; -#endif - -#endif /* ___HTTP_UPDATE_H___ */ diff --git a/libraries/NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino b/libraries/NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino deleted file mode 100755 index 0f49e5aad6c..00000000000 --- a/libraries/NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino +++ /dev/null @@ -1,31 +0,0 @@ -#include -#include - -const char* ssid = "............"; -const char* password = ".............."; - -void setup() { - Serial.begin(115200); - - // Connect to WiFi network - WiFi.mode(WIFI_STA); - WiFi.begin(ssid, password); - Serial.println(""); - - // Wait for connection - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - } - Serial.println(""); - Serial.print("Connected to "); - Serial.println(ssid); - Serial.print("IP address: "); - Serial.println(WiFi.localIP()); - - NBNS.begin("ESP"); -} - -void loop() { - -} diff --git a/libraries/NetBIOS/keywords.txt b/libraries/NetBIOS/keywords.txt deleted file mode 100755 index 68bcbeee1a5..00000000000 --- a/libraries/NetBIOS/keywords.txt +++ /dev/null @@ -1,25 +0,0 @@ -####################################### -# Syntax Coloring Map For ESPNBNS -####################################### - -####################################### -# Datatypes (KEYWORD1) -####################################### - -NetBIOS KEYWORD1 - -####################################### -# Methods and Functions (KEYWORD2) -####################################### - -begin KEYWORD2 - -####################################### -# Instances (KEYWORD2) -####################################### - -NBNS KEYWORD2 - -####################################### -# Constants (LITERAL1) -####################################### diff --git a/libraries/NetBIOS/library.properties b/libraries/NetBIOS/library.properties deleted file mode 100644 index 50e6e79c099..00000000000 --- a/libraries/NetBIOS/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=NetBIOS -version=1.0 -author=Pablo@xpablo.cz -maintainer=Hristo Gochkov -sentence=Enables NBNS (NetBIOS) name resolution. -paragraph=With this library you can connect to your ESP from Windows using a short name -category=Communication -url=http://www.xpablo.cz/?p=751#more-751 -architectures=esp32 diff --git a/libraries/NetBIOS/src/NetBIOS.cpp b/libraries/NetBIOS/src/NetBIOS.cpp deleted file mode 100755 index 22d3deca43b..00000000000 --- a/libraries/NetBIOS/src/NetBIOS.cpp +++ /dev/null @@ -1,131 +0,0 @@ -#include "NetBIOS.h" - -#include - -#define NBNS_PORT 137 -#define NBNS_MAX_HOSTNAME_LEN 32 - -typedef struct { - uint16_t id; - uint8_t flags1; - uint8_t flags2; - uint16_t qcount; - uint16_t acount; - uint16_t nscount; - uint16_t adcount; - uint8_t name_len; - char name[NBNS_MAX_HOSTNAME_LEN + 1]; - uint16_t type; - uint16_t clas; -} __attribute__((packed)) nbns_question_t; - -typedef struct { - uint16_t id; - uint8_t flags1; - uint8_t flags2; - uint16_t qcount; - uint16_t acount; - uint16_t nscount; - uint16_t adcount; - uint8_t name_len; - char name[NBNS_MAX_HOSTNAME_LEN + 1]; - uint16_t type; - uint16_t clas; - uint32_t ttl; - uint16_t data_len; - uint16_t flags; - uint32_t addr; -} __attribute__((packed)) nbns_answer_t; - -static void _getnbname(const char *nbname, char *name, uint8_t maxlen){ - uint8_t b; - uint8_t c = 0; - - while ((*nbname) && (c < maxlen)) { - b = (*nbname++ - 'A') << 4; - c++; - if (*nbname) { - b |= *nbname++ - 'A'; - c++; - } - if(!b || b == ' '){ - break; - } - *name++ = b; - } - *name = 0; -} - -static void append_16(void * dst, uint16_t value){ - uint8_t * d = (uint8_t *)dst; - *d++ = (value >> 8) & 0xFF; - *d++ = value & 0xFF; -} - -static void append_32(void * dst, uint32_t value){ - uint8_t * d = (uint8_t *)dst; - *d++ = (value >> 24) & 0xFF; - *d++ = (value >> 16) & 0xFF; - *d++ = (value >> 8) & 0xFF; - *d++ = value & 0xFF; -} - -void NetBIOS::_onPacket(AsyncUDPPacket& packet){ - if (packet.length() >= sizeof(nbns_question_t)) { - nbns_question_t * question = (nbns_question_t *)packet.data(); - if (0 == (question->flags1 & 0x80)) { - char name[ NBNS_MAX_HOSTNAME_LEN + 1 ]; - _getnbname(&question->name[0], (char *)&name, question->name_len); - if (_name.equals(name)) { - nbns_answer_t nbnsa; - nbnsa.id = question->id; - nbnsa.flags1 = 0x85; - nbnsa.flags2 = 0; - append_16((void *)&nbnsa.qcount, 0); - append_16((void *)&nbnsa.acount, 1); - append_16((void *)&nbnsa.nscount, 0); - append_16((void *)&nbnsa.adcount, 0); - nbnsa.name_len = question->name_len; - memcpy(&nbnsa.name[0], &question->name[0], question->name_len + 1); - append_16((void *)&nbnsa.type, 0x20); - append_16((void *)&nbnsa.clas, 1); - append_32((void *)&nbnsa.ttl, 300000); - append_16((void *)&nbnsa.data_len, 6); - append_16((void *)&nbnsa.flags, 0); - nbnsa.addr = WiFi.localIP(); - _udp.writeTo((uint8_t *)&nbnsa, sizeof(nbnsa), packet.remoteIP(), NBNS_PORT); - } - } - } -} - -NetBIOS::NetBIOS(){ - -} -NetBIOS::~NetBIOS(){ - end(); -} - -bool NetBIOS::begin(const char *name){ - _name = name; - _name.toUpperCase(); - - if(_udp.connected()){ - return true; - } - - _udp.onPacket([](void * arg, AsyncUDPPacket& packet){ ((NetBIOS*)(arg))->_onPacket(packet); }, this); - return _udp.listen(NBNS_PORT); -} - -void NetBIOS::end(){ - if(_udp.connected()){ - _udp.close(); - } -} - -#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_NETBIOS) -NetBIOS NBNS; -#endif - -// EOF diff --git a/libraries/NetBIOS/src/NetBIOS.h b/libraries/NetBIOS/src/NetBIOS.h deleted file mode 100755 index 0321f6b8b91..00000000000 --- a/libraries/NetBIOS/src/NetBIOS.h +++ /dev/null @@ -1,26 +0,0 @@ -// -#ifndef __ESPNBNS_h__ -#define __ESPNBNS_h__ - -#include -#include "AsyncUDP.h" - -class NetBIOS -{ -protected: - AsyncUDP _udp; - String _name; - void _onPacket(AsyncUDPPacket& packet); - -public: - NetBIOS(); - ~NetBIOS(); - bool begin(const char *name); - void end(); -}; - -#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_NETBIOS) -extern NetBIOS NBNS; -#endif - -#endif diff --git a/libraries/Preferences/examples/Prefs2Struct/Prefs2Struct.ino b/libraries/Preferences/examples/Prefs2Struct/Prefs2Struct.ino deleted file mode 100644 index 7ed2a73bcbe..00000000000 --- a/libraries/Preferences/examples/Prefs2Struct/Prefs2Struct.ino +++ /dev/null @@ -1,43 +0,0 @@ -/* -This example shows how to use Preferences (nvs) to store a -structure. Note that the maximum size of a putBytes is 496K -or 97% of the nvs partition size. nvs has signifcant overhead, -so should not be used for data that will change often. -*/ -#include -Preferences prefs; - -typedef struct { - uint8_t hour; - uint8_t minute; - uint8_t setting1; - uint8_t setting2; -} schedule_t; - -void setup() { - Serial.begin(115200); - prefs.begin("schedule"); // use "schedule" namespace - uint8_t content[] = {9, 30, 235, 255, 20, 15, 0, 1}; // two entries - prefs.putBytes("schedule", content, sizeof(content)); - size_t schLen = prefs.getBytesLength("schedule"); - char buffer[schLen]; // prepare a buffer for the data - prefs.getBytes("schedule", buffer, schLen); - if (schLen % sizeof(schedule_t)) { // simple check that data fits - log_e("Data is not correct size!"); - return; - } - schedule_t *schedule = (schedule_t *) buffer; // cast the bytes into a struct ptr - Serial.printf("%02d:%02d %d/%d\n", - schedule[1].hour, schedule[1].minute, - schedule[1].setting1, schedule[1].setting2); - schedule[2] = {8, 30, 20, 21}; // add a third entry (unsafely) -// force the struct array into a byte array - prefs.putBytes("schedule", schedule, 3*sizeof(schedule_t)); - schLen = prefs.getBytesLength("schedule"); - char buffer2[schLen]; - prefs.getBytes("schedule", buffer2, schLen); - for (int x=0; x - -Preferences preferences; - -void setup() { - Serial.begin(115200); - Serial.println(); - - // Open Preferences with my-app namespace. Each application module, library, etc - // has to use a namespace name to prevent key name collisions. We will open storage in - // RW-mode (second parameter has to be false). - // Note: Namespace name is limited to 15 chars. - preferences.begin("my-app", false); - - // Remove all preferences under the opened namespace - //preferences.clear(); - - // Or remove the counter key only - //preferences.remove("counter"); - - // Get the counter value, if the key does not exist, return a default value of 0 - // Note: Key name is limited to 15 chars. - unsigned int counter = preferences.getUInt("counter", 0); - - // Increase counter by 1 - counter++; - - // Print the counter to Serial Monitor - Serial.printf("Current counter value: %u\n", counter); - - // Store the counter to the Preferences - preferences.putUInt("counter", counter); - - // Close the Preferences - preferences.end(); - - // Wait 10 seconds - Serial.println("Restarting in 10 seconds..."); - delay(10000); - - // Restart ESP - ESP.restart(); -} - -void loop() {} diff --git a/libraries/Preferences/keywords.txt b/libraries/Preferences/keywords.txt deleted file mode 100644 index fe2d4333e6e..00000000000 --- a/libraries/Preferences/keywords.txt +++ /dev/null @@ -1,54 +0,0 @@ -####################################### -# Syntax Coloring Map NVS -####################################### - -####################################### -# Datatypes (KEYWORD1) -####################################### - -Preferences KEYWORD1 - -####################################### -# Methods and Functions (KEYWORD2) -####################################### -begin KEYWORD2 -end KEYWORD2 - -clear KEYWORD2 -remove KEYWORD2 - -putChar KEYWORD2 -putUChar KEYWORD2 -putShort KEYWORD2 -putUShort KEYWORD2 -putInt KEYWORD2 -putUInt KEYWORD2 -putLong KEYWORD2 -putULong KEYWORD2 -putLong64 KEYWORD2 -putULong64 KEYWORD2 -putFloat KEYWORD2 -putDouble KEYWORD2 -putBool KEYWORD2 -putString KEYWORD2 -putBytes KEYWORD2 - -getChar KEYWORD2 -getUChar KEYWORD2 -getShort KEYWORD2 -getUShort KEYWORD2 -getInt KEYWORD2 -getUInt KEYWORD2 -getLong KEYWORD2 -getULong KEYWORD2 -getLong64 KEYWORD2 -getULong64 KEYWORD2 -getFloat KEYWORD2 -getDouble KEYWORD2 -getBool KEYWORD2 -getString KEYWORD2 -getBytes KEYWORD2 - -####################################### -# Constants (LITERAL1) -####################################### diff --git a/libraries/Preferences/library.properties b/libraries/Preferences/library.properties deleted file mode 100644 index 11675a58cac..00000000000 --- a/libraries/Preferences/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=Preferences -version=1.0 -author=Hristo Gochkov -maintainer=Hristo Gochkov -sentence=Provides friendly access to ESP32's Non-Volatile Storage -paragraph= -category=Data Storage -url= -architectures=esp32 diff --git a/libraries/Preferences/src/Preferences.cpp b/libraries/Preferences/src/Preferences.cpp deleted file mode 100644 index f06e9d0862a..00000000000 --- a/libraries/Preferences/src/Preferences.cpp +++ /dev/null @@ -1,488 +0,0 @@ -// 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. - -#include "Preferences.h" - -#include "nvs.h" - -const char * nvs_errors[] = { "OTHER", "NOT_INITIALIZED", "NOT_FOUND", "TYPE_MISMATCH", "READ_ONLY", "NOT_ENOUGH_SPACE", "INVALID_NAME", "INVALID_HANDLE", "REMOVE_FAILED", "KEY_TOO_LONG", "PAGE_FULL", "INVALID_STATE", "INVALID_LENGHT"}; -#define nvs_error(e) (((e)>ESP_ERR_NVS_BASE)?nvs_errors[(e)&~(ESP_ERR_NVS_BASE)]:nvs_errors[0]) - -Preferences::Preferences() - :_handle(0) - ,_started(false) - ,_readOnly(false) -{} - -Preferences::~Preferences(){ - end(); -} - -bool Preferences::begin(const char * name, bool readOnly){ - if(_started){ - return false; - } - _readOnly = readOnly; - esp_err_t err = nvs_open(name, readOnly?NVS_READONLY:NVS_READWRITE, &_handle); - if(err){ - log_e("nvs_open failed: %s", nvs_error(err)); - return false; - } - _started = true; - return true; -} - -void Preferences::end(){ - if(!_started){ - return; - } - nvs_close(_handle); - _started = false; -} - -/* - * Clear all keys in opened preferences - * */ - -bool Preferences::clear(){ - if(!_started || _readOnly){ - return false; - } - esp_err_t err = nvs_erase_all(_handle); - if(err){ - log_e("nvs_erase_all fail: %s", nvs_error(err)); - return false; - } - return true; -} - -/* - * Remove a key - * */ - -bool Preferences::remove(const char * key){ - if(!_started || !key || _readOnly){ - return false; - } - esp_err_t err = nvs_erase_key(_handle, key); - if(err){ - log_e("nvs_erase_key fail: %s %s", key, nvs_error(err)); - return false; - } - return true; -} - -/* - * Put a key value - * */ - -size_t Preferences::putChar(const char* key, int8_t value){ - if(!_started || !key || _readOnly){ - return 0; - } - esp_err_t err = nvs_set_i8(_handle, key, value); - if(err){ - log_e("nvs_set_i8 fail: %s %s", key, nvs_error(err)); - return 0; - } - err = nvs_commit(_handle); - if(err){ - log_e("nvs_commit fail: %s %s", key, nvs_error(err)); - return 0; - } - return 1; -} - -size_t Preferences::putUChar(const char* key, uint8_t value){ - if(!_started || !key || _readOnly){ - return 0; - } - esp_err_t err = nvs_set_u8(_handle, key, value); - if(err){ - log_e("nvs_set_u8 fail: %s %s", key, nvs_error(err)); - return 0; - } - err = nvs_commit(_handle); - if(err){ - log_e("nvs_commit fail: %s %s", key, nvs_error(err)); - return 0; - } - return 1; -} - -size_t Preferences::putShort(const char* key, int16_t value){ - if(!_started || !key || _readOnly){ - return 0; - } - esp_err_t err = nvs_set_i16(_handle, key, value); - if(err){ - log_e("nvs_set_i16 fail: %s %s", key, nvs_error(err)); - return 0; - } - err = nvs_commit(_handle); - if(err){ - log_e("nvs_commit fail: %s %s", key, nvs_error(err)); - return 0; - } - return 2; -} - -size_t Preferences::putUShort(const char* key, uint16_t value){ - if(!_started || !key || _readOnly){ - return 0; - } - esp_err_t err = nvs_set_u16(_handle, key, value); - if(err){ - log_e("nvs_set_u16 fail: %s %s", key, nvs_error(err)); - return 0; - } - err = nvs_commit(_handle); - if(err){ - log_e("nvs_commit fail: %s %s", key, nvs_error(err)); - return 0; - } - return 2; -} - -size_t Preferences::putInt(const char* key, int32_t value){ - if(!_started || !key || _readOnly){ - return 0; - } - esp_err_t err = nvs_set_i32(_handle, key, value); - if(err){ - log_e("nvs_set_i32 fail: %s %s", key, nvs_error(err)); - return 0; - } - err = nvs_commit(_handle); - if(err){ - log_e("nvs_commit fail: %s %s", key, nvs_error(err)); - return 0; - } - return 4; -} - -size_t Preferences::putUInt(const char* key, uint32_t value){ - if(!_started || !key || _readOnly){ - return 0; - } - esp_err_t err = nvs_set_u32(_handle, key, value); - if(err){ - log_e("nvs_set_u32 fail: %s %s", key, nvs_error(err)); - return 0; - } - err = nvs_commit(_handle); - if(err){ - log_e("nvs_commit fail: %s %s", key, nvs_error(err)); - return 0; - } - return 4; -} - -size_t Preferences::putLong(const char* key, int32_t value){ - return putInt(key, value); -} - -size_t Preferences::putULong(const char* key, uint32_t value){ - return putUInt(key, value); -} - -size_t Preferences::putLong64(const char* key, int64_t value){ - if(!_started || !key || _readOnly){ - return 0; - } - esp_err_t err = nvs_set_i64(_handle, key, value); - if(err){ - log_e("nvs_set_i64 fail: %s %s", key, nvs_error(err)); - return 0; - } - err = nvs_commit(_handle); - if(err){ - log_e("nvs_commit fail: %s %s", key, nvs_error(err)); - return 0; - } - return 8; -} - -size_t Preferences::putULong64(const char* key, uint64_t value){ - if(!_started || !key || _readOnly){ - return 0; - } - esp_err_t err = nvs_set_u64(_handle, key, value); - if(err){ - log_e("nvs_set_u64 fail: %s %s", key, nvs_error(err)); - return 0; - } - err = nvs_commit(_handle); - if(err){ - log_e("nvs_commit fail: %s %s", key, nvs_error(err)); - return 0; - } - return 8; -} - -size_t Preferences::putFloat(const char* key, const float_t value){ - return putBytes(key, (void*)&value, sizeof(float_t)); -} - -size_t Preferences::putDouble(const char* key, const double_t value){ - return putBytes(key, (void*)&value, sizeof(double_t)); -} - -size_t Preferences::putBool(const char* key, const bool value){ - return putUChar(key, (uint8_t) (value ? 1 : 0)); -} - -size_t Preferences::putString(const char* key, const char* value){ - if(!_started || !key || !value || _readOnly){ - return 0; - } - esp_err_t err = nvs_set_str(_handle, key, value); - if(err){ - log_e("nvs_set_str fail: %s %s", key, nvs_error(err)); - return 0; - } - err = nvs_commit(_handle); - if(err){ - log_e("nvs_commit fail: %s %s", key, nvs_error(err)); - return 0; - } - return strlen(value); -} - -size_t Preferences::putString(const char* key, const String value){ - return putString(key, value.c_str()); -} - -size_t Preferences::putBytes(const char* key, const void* value, size_t len){ - if(!_started || !key || !value || !len || _readOnly){ - return 0; - } - esp_err_t err = nvs_set_blob(_handle, key, value, len); - if(err){ - log_e("nvs_set_blob fail: %s %s", key, nvs_error(err)); - return 0; - } - err = nvs_commit(_handle); - if(err){ - log_e("nvs_commit fail: %s %s", key, nvs_error(err)); - return 0; - } - return len; -} - -/* - * Get a key value - * */ - -int8_t Preferences::getChar(const char* key, const int8_t defaultValue){ - int8_t value = defaultValue; - if(!_started || !key){ - return value; - } - esp_err_t err = nvs_get_i8(_handle, key, &value); - if(err){ - log_v("nvs_get_i8 fail: %s %s", key, nvs_error(err)); - } - return value; -} - -uint8_t Preferences::getUChar(const char* key, const uint8_t defaultValue){ - uint8_t value = defaultValue; - if(!_started || !key){ - return value; - } - esp_err_t err = nvs_get_u8(_handle, key, &value); - if(err){ - log_v("nvs_get_u8 fail: %s %s", key, nvs_error(err)); - } - return value; -} - -int16_t Preferences::getShort(const char* key, const int16_t defaultValue){ - int16_t value = defaultValue; - if(!_started || !key){ - return value; - } - esp_err_t err = nvs_get_i16(_handle, key, &value); - if(err){ - log_v("nvs_get_i16 fail: %s %s", key, nvs_error(err)); - } - return value; -} - -uint16_t Preferences::getUShort(const char* key, const uint16_t defaultValue){ - uint16_t value = defaultValue; - if(!_started || !key){ - return value; - } - esp_err_t err = nvs_get_u16(_handle, key, &value); - if(err){ - log_v("nvs_get_u16 fail: %s %s", key, nvs_error(err)); - } - return value; -} - -int32_t Preferences::getInt(const char* key, const int32_t defaultValue){ - int32_t value = defaultValue; - if(!_started || !key){ - return value; - } - esp_err_t err = nvs_get_i32(_handle, key, &value); - if(err){ - log_v("nvs_get_i32 fail: %s %s", key, nvs_error(err)); - } - return value; -} - -uint32_t Preferences::getUInt(const char* key, const uint32_t defaultValue){ - uint32_t value = defaultValue; - if(!_started || !key){ - return value; - } - esp_err_t err = nvs_get_u32(_handle, key, &value); - if(err){ - log_v("nvs_get_u32 fail: %s %s", key, nvs_error(err)); - } - return value; -} - -int32_t Preferences::getLong(const char* key, const int32_t defaultValue){ - return getInt(key, defaultValue); -} - -uint32_t Preferences::getULong(const char* key, const uint32_t defaultValue){ - return getUInt(key, defaultValue); -} - -int64_t Preferences::getLong64(const char* key, const int64_t defaultValue){ - int64_t value = defaultValue; - if(!_started || !key){ - return value; - } - esp_err_t err = nvs_get_i64(_handle, key, &value); - if(err){ - log_v("nvs_get_i64 fail: %s %s", key, nvs_error(err)); - } - return value; -} - -uint64_t Preferences::getULong64(const char* key, const uint64_t defaultValue){ - uint64_t value = defaultValue; - if(!_started || !key){ - return value; - } - esp_err_t err = nvs_get_u64(_handle, key, &value); - if(err){ - log_v("nvs_get_u64 fail: %s %s", key, nvs_error(err)); - } - return value; -} - -float_t Preferences::getFloat(const char* key, const float_t defaultValue) { - float_t value = defaultValue; - getBytes(key, (void*) &value, sizeof(float_t)); - return value; -} - -double_t Preferences::getDouble(const char* key, const double_t defaultValue) { - double_t value = defaultValue; - getBytes(key, (void*) &value, sizeof(double_t)); - return value; -} - -bool Preferences::getBool(const char* key, const bool defaultValue) { - return getUChar(key, defaultValue ? 1 : 0) == 1; -} - -size_t Preferences::getString(const char* key, char* value, const size_t maxLen){ - size_t len = 0; - if(!_started || !key || !value || !maxLen){ - return 0; - } - esp_err_t err = nvs_get_str(_handle, key, NULL, &len); - if(err){ - log_e("nvs_get_str len fail: %s %s", key, nvs_error(err)); - return 0; - } - if(len > maxLen){ - log_e("not enough space in value: %u < %u", maxLen, len); - return 0; - } - err = nvs_get_str(_handle, key, value, &len); - if(err){ - log_e("nvs_get_str fail: %s %s", key, nvs_error(err)); - return 0; - } - return len; -} - -String Preferences::getString(const char* key, const String defaultValue){ - char * value = NULL; - size_t len = 0; - if(!_started || !key){ - return String(defaultValue); - } - esp_err_t err = nvs_get_str(_handle, key, value, &len); - if(err){ - log_e("nvs_get_str len fail: %s %s", key, nvs_error(err)); - return String(defaultValue); - } - char buf[len]; - value = buf; - err = nvs_get_str(_handle, key, value, &len); - if(err){ - log_e("nvs_get_str fail: %s %s", key, nvs_error(err)); - return String(defaultValue); - } - return String(buf); -} - -size_t Preferences::getBytesLength(const char* key){ - size_t len = 0; - if(!_started || !key){ - return 0; - } - esp_err_t err = nvs_get_blob(_handle, key, NULL, &len); - if(err){ - log_e("nvs_get_blob len fail: %s %s", key, nvs_error(err)); - return 0; - } - return len; -} - -size_t Preferences::getBytes(const char* key, void * buf, size_t maxLen){ - size_t len = getBytesLength(key); - if(!len || !buf || !maxLen){ - return len; - } - if(len > maxLen){ - log_e("not enough space in buffer: %u < %u", maxLen, len); - return 0; - } - esp_err_t err = nvs_get_blob(_handle, key, buf, &len); - if(err){ - log_e("nvs_get_blob fail: %s %s", key, nvs_error(err)); - return 0; - } - return len; -} - -size_t Preferences::freeEntries() { - nvs_stats_t nvs_stats; - esp_err_t err = nvs_get_stats(NULL, &nvs_stats); - if(err){ - log_e("Failed to get nvs statistics"); - return 0; - } - return nvs_stats.free_entries; -} diff --git a/libraries/Preferences/src/Preferences.h b/libraries/Preferences/src/Preferences.h deleted file mode 100644 index 0ad94afbbad..00000000000 --- a/libraries/Preferences/src/Preferences.h +++ /dev/null @@ -1,71 +0,0 @@ -// 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. - -#ifndef _PREFERENCES_H_ -#define _PREFERENCES_H_ - -#include "Arduino.h" - -class Preferences { - protected: - uint32_t _handle; - bool _started; - bool _readOnly; - public: - Preferences(); - ~Preferences(); - - bool begin(const char * name, bool readOnly=false); - void end(); - - bool clear(); - bool remove(const char * key); - - size_t putChar(const char* key, int8_t value); - size_t putUChar(const char* key, uint8_t value); - size_t putShort(const char* key, int16_t value); - size_t putUShort(const char* key, uint16_t value); - size_t putInt(const char* key, int32_t value); - size_t putUInt(const char* key, uint32_t value); - size_t putLong(const char* key, int32_t value); - size_t putULong(const char* key, uint32_t value); - size_t putLong64(const char* key, int64_t value); - size_t putULong64(const char* key, uint64_t value); - size_t putFloat(const char* key, float_t value); - size_t putDouble(const char* key, double_t value); - size_t putBool(const char* key, bool value); - size_t putString(const char* key, const char* value); - size_t putString(const char* key, String value); - size_t putBytes(const char* key, const void* value, size_t len); - - int8_t getChar(const char* key, int8_t defaultValue = 0); - uint8_t getUChar(const char* key, uint8_t defaultValue = 0); - int16_t getShort(const char* key, int16_t defaultValue = 0); - uint16_t getUShort(const char* key, uint16_t defaultValue = 0); - int32_t getInt(const char* key, int32_t defaultValue = 0); - uint32_t getUInt(const char* key, uint32_t defaultValue = 0); - int32_t getLong(const char* key, int32_t defaultValue = 0); - uint32_t getULong(const char* key, uint32_t defaultValue = 0); - int64_t getLong64(const char* key, int64_t defaultValue = 0); - uint64_t getULong64(const char* key, uint64_t defaultValue = 0); - float_t getFloat(const char* key, float_t defaultValue = NAN); - double_t getDouble(const char* key, double_t defaultValue = NAN); - bool getBool(const char* key, bool defaultValue = false); - size_t getString(const char* key, char* value, size_t maxLen); - String getString(const char* key, String defaultValue = String()); - size_t getBytesLength(const char* key); - size_t getBytes(const char* key, void * buf, size_t maxLen); - size_t freeEntries(); -}; - -#endif diff --git a/libraries/SD/README.md b/libraries/SD/README.md deleted file mode 100644 index 2cc472dc809..00000000000 --- a/libraries/SD/README.md +++ /dev/null @@ -1,42 +0,0 @@ - -# SD library - -This library provides the integration of ESP32 and SD (Secure Digital) cards without additional modules. - - -## Sample wiring diagram: - - -![SD card pins](http://i.imgur.com/4CoXOuR.png) - -For others SD formats: - - -![Other SD card formats](https://upload.wikimedia.org/wikipedia/commons/thumb/a/ab/MMC-SD-miniSD-microSD-Color-Numbers-Names.gif/330px-MMC-SD-miniSD-microSD-Color-Numbers-Names.gif) - - -Image source: [Wikipedia](https://upload.wikimedia.org/wikipedia/commons/thumb/a/ab/MMC-SD-miniSD-microSD-Color-Numbers-Names.gif/330px-MMC-SD-miniSD-microSD-Color-Numbers-Names.gif) - -```diff -- Warning: Some ESP32 modules have different pinouts! -``` - - - -## FAQ: - -**Do I need any additional modules, like Arduino SD module?** - -No, just wire your SD card directly to ESP32. - - - -**What is the difference between SD and SD_MMC libraries?** - -SD runs on SPI, and SD_MMC uses the SDMMC hardware bus on the ESP32. - - - -**Can I change the CS pin?** - -Yes, just use: `SD.begin(CSpin)` diff --git a/libraries/SD/examples/SD_Test/SD_Test.ino b/libraries/SD/examples/SD_Test/SD_Test.ino deleted file mode 100644 index 6059446e600..00000000000 --- a/libraries/SD/examples/SD_Test/SD_Test.ino +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Connect the SD card to the following pins: - * - * SD Card | ESP32 - * D2 - - * D3 SS - * CMD MOSI - * VSS GND - * VDD 3.3V - * CLK SCK - * VSS GND - * D0 MISO - * D1 - - */ -#include "FS.h" -#include "SD.h" -#include "SPI.h" - -void listDir(fs::FS &fs, const char * dirname, uint8_t levels){ - Serial.printf("Listing directory: %s\n", dirname); - - File root = fs.open(dirname); - if(!root){ - Serial.println("Failed to open directory"); - return; - } - if(!root.isDirectory()){ - Serial.println("Not a directory"); - return; - } - - File file = root.openNextFile(); - while(file){ - if(file.isDirectory()){ - Serial.print(" DIR : "); - Serial.println(file.name()); - if(levels){ - listDir(fs, file.name(), levels -1); - } - } else { - Serial.print(" FILE: "); - Serial.print(file.name()); - Serial.print(" SIZE: "); - Serial.println(file.size()); - } - file = root.openNextFile(); - } -} - -void createDir(fs::FS &fs, const char * path){ - Serial.printf("Creating Dir: %s\n", path); - if(fs.mkdir(path)){ - Serial.println("Dir created"); - } else { - Serial.println("mkdir failed"); - } -} - -void removeDir(fs::FS &fs, const char * path){ - Serial.printf("Removing Dir: %s\n", path); - if(fs.rmdir(path)){ - Serial.println("Dir removed"); - } else { - Serial.println("rmdir failed"); - } -} - -void readFile(fs::FS &fs, const char * path){ - Serial.printf("Reading file: %s\n", path); - - File file = fs.open(path); - if(!file){ - Serial.println("Failed to open file for reading"); - return; - } - - Serial.print("Read from file: "); - while(file.available()){ - Serial.write(file.read()); - } - file.close(); -} - -void writeFile(fs::FS &fs, const char * path, const char * message){ - Serial.printf("Writing file: %s\n", path); - - File file = fs.open(path, FILE_WRITE); - if(!file){ - Serial.println("Failed to open file for writing"); - return; - } - if(file.print(message)){ - Serial.println("File written"); - } else { - Serial.println("Write failed"); - } - file.close(); -} - -void appendFile(fs::FS &fs, const char * path, const char * message){ - Serial.printf("Appending to file: %s\n", path); - - File file = fs.open(path, FILE_APPEND); - if(!file){ - Serial.println("Failed to open file for appending"); - return; - } - if(file.print(message)){ - Serial.println("Message appended"); - } else { - Serial.println("Append failed"); - } - file.close(); -} - -void renameFile(fs::FS &fs, const char * path1, const char * path2){ - Serial.printf("Renaming file %s to %s\n", path1, path2); - if (fs.rename(path1, path2)) { - Serial.println("File renamed"); - } else { - Serial.println("Rename failed"); - } -} - -void deleteFile(fs::FS &fs, const char * path){ - Serial.printf("Deleting file: %s\n", path); - if(fs.remove(path)){ - Serial.println("File deleted"); - } else { - Serial.println("Delete failed"); - } -} - -void testFileIO(fs::FS &fs, const char * path){ - File file = fs.open(path); - static uint8_t buf[512]; - size_t len = 0; - uint32_t start = millis(); - uint32_t end = start; - if(file){ - len = file.size(); - size_t flen = len; - start = millis(); - while(len){ - size_t toRead = len; - if(toRead > 512){ - toRead = 512; - } - file.read(buf, toRead); - len -= toRead; - } - end = millis() - start; - Serial.printf("%u bytes read for %u ms\n", flen, end); - file.close(); - } else { - Serial.println("Failed to open file for reading"); - } - - - file = fs.open(path, FILE_WRITE); - if(!file){ - Serial.println("Failed to open file for writing"); - return; - } - - size_t i; - start = millis(); - for(i=0; i<2048; i++){ - file.write(buf, 512); - } - end = millis() - start; - Serial.printf("%u bytes written for %u ms\n", 2048 * 512, end); - file.close(); -} - -void setup(){ - Serial.begin(115200); - if(!SD.begin()){ - Serial.println("Card Mount Failed"); - return; - } - uint8_t cardType = SD.cardType(); - - if(cardType == CARD_NONE){ - Serial.println("No SD card attached"); - return; - } - - Serial.print("SD Card Type: "); - if(cardType == CARD_MMC){ - Serial.println("MMC"); - } else if(cardType == CARD_SD){ - Serial.println("SDSC"); - } else if(cardType == CARD_SDHC){ - Serial.println("SDHC"); - } else { - Serial.println("UNKNOWN"); - } - - uint64_t cardSize = SD.cardSize() / (1024 * 1024); - Serial.printf("SD Card Size: %lluMB\n", cardSize); - - listDir(SD, "/", 0); - createDir(SD, "/mydir"); - listDir(SD, "/", 0); - removeDir(SD, "/mydir"); - listDir(SD, "/", 2); - writeFile(SD, "/hello.txt", "Hello "); - appendFile(SD, "/hello.txt", "World!\n"); - readFile(SD, "/hello.txt"); - deleteFile(SD, "/foo.txt"); - renameFile(SD, "/hello.txt", "/foo.txt"); - readFile(SD, "/foo.txt"); - testFileIO(SD, "/test.txt"); - Serial.printf("Total space: %lluMB\n", SD.totalBytes() / (1024 * 1024)); - Serial.printf("Used space: %lluMB\n", SD.usedBytes() / (1024 * 1024)); -} - -void loop(){ - -} diff --git a/libraries/SD/examples/SD_time/SD_time.ino b/libraries/SD/examples/SD_time/SD_time.ino deleted file mode 100644 index 5fc871627b5..00000000000 --- a/libraries/SD/examples/SD_time/SD_time.ino +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Connect the SD card to the following pins: - * - * SD Card | ESP32 - * D2 - - * D3 SS - * CMD MOSI - * VSS GND - * VDD 3.3V - * CLK SCK - * VSS GND - * D0 MISO - * D1 - - */ - -#include "FS.h" -#include "SD.h" -#include "SPI.h" -#include -#include - -const char* ssid = "your-ssid"; -const char* password = "your-password"; - -long timezone = 1; -byte daysavetime = 1; - -void listDir(fs::FS &fs, const char * dirname, uint8_t levels){ - Serial.printf("Listing directory: %s\n", dirname); - - File root = fs.open(dirname); - if(!root){ - Serial.println("Failed to open directory"); - return; - } - if(!root.isDirectory()){ - Serial.println("Not a directory"); - return; - } - - File file = root.openNextFile(); - while(file){ - if(file.isDirectory()){ - Serial.print(" DIR : "); - Serial.print (file.name()); - time_t t= file.getLastWrite(); - struct tm * tmstruct = localtime(&t); - Serial.printf(" LAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n",(tmstruct->tm_year)+1900,( tmstruct->tm_mon)+1, tmstruct->tm_mday,tmstruct->tm_hour , tmstruct->tm_min, tmstruct->tm_sec); - if(levels){ - listDir(fs, file.name(), levels -1); - } - } else { - Serial.print(" FILE: "); - Serial.print(file.name()); - Serial.print(" SIZE: "); - Serial.print(file.size()); - time_t t= file.getLastWrite(); - struct tm * tmstruct = localtime(&t); - Serial.printf(" LAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n",(tmstruct->tm_year)+1900,( tmstruct->tm_mon)+1, tmstruct->tm_mday,tmstruct->tm_hour , tmstruct->tm_min, tmstruct->tm_sec); - } - file = root.openNextFile(); - } -} - -void createDir(fs::FS &fs, const char * path){ - Serial.printf("Creating Dir: %s\n", path); - if(fs.mkdir(path)){ - Serial.println("Dir created"); - } else { - Serial.println("mkdir failed"); - } -} - -void removeDir(fs::FS &fs, const char * path){ - Serial.printf("Removing Dir: %s\n", path); - if(fs.rmdir(path)){ - Serial.println("Dir removed"); - } else { - Serial.println("rmdir failed"); - } -} - -void readFile(fs::FS &fs, const char * path){ - Serial.printf("Reading file: %s\n", path); - - File file = fs.open(path); - if(!file){ - Serial.println("Failed to open file for reading"); - return; - } - - Serial.print("Read from file: "); - while(file.available()){ - Serial.write(file.read()); - } - file.close(); -} - -void writeFile(fs::FS &fs, const char * path, const char * message){ - Serial.printf("Writing file: %s\n", path); - - File file = fs.open(path, FILE_WRITE); - if(!file){ - Serial.println("Failed to open file for writing"); - return; - } - if(file.print(message)){ - Serial.println("File written"); - } else { - Serial.println("Write failed"); - } - file.close(); -} - -void appendFile(fs::FS &fs, const char * path, const char * message){ - Serial.printf("Appending to file: %s\n", path); - - File file = fs.open(path, FILE_APPEND); - if(!file){ - Serial.println("Failed to open file for appending"); - return; - } - if(file.print(message)){ - Serial.println("Message appended"); - } else { - Serial.println("Append failed"); - } - file.close(); -} - -void renameFile(fs::FS &fs, const char * path1, const char * path2){ - Serial.printf("Renaming file %s to %s\n", path1, path2); - if (fs.rename(path1, path2)) { - Serial.println("File renamed"); - } else { - Serial.println("Rename failed"); - } -} - -void deleteFile(fs::FS &fs, const char * path){ - Serial.printf("Deleting file: %s\n", path); - if(fs.remove(path)){ - Serial.println("File deleted"); - } else { - Serial.println("Delete failed"); - } -} - -void setup(){ - Serial.begin(115200); - // We start by connecting to a WiFi network - Serial.println(); - Serial.println(); - Serial.print("Connecting to "); - Serial.println(ssid); - - WiFi.begin(ssid, password); - - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - } - Serial.println("WiFi connected"); - Serial.println("IP address: "); - Serial.println(WiFi.localIP()); - Serial.println("Contacting Time Server"); - configTime(3600*timezone, daysavetime*3600, "time.nist.gov", "0.pool.ntp.org", "1.pool.ntp.org"); - struct tm tmstruct ; - delay(2000); - tmstruct.tm_year = 0; - getLocalTime(&tmstruct, 5000); - Serial.printf("\nNow is : %d-%02d-%02d %02d:%02d:%02d\n",(tmstruct.tm_year)+1900,( tmstruct.tm_mon)+1, tmstruct.tm_mday,tmstruct.tm_hour , tmstruct.tm_min, tmstruct.tm_sec); - Serial.println(""); - - if(!SD.begin()){ - Serial.println("Card Mount Failed"); - return; - } - uint8_t cardType = SD.cardType(); - - if(cardType == CARD_NONE){ - Serial.println("No SD card attached"); - return; - } - - Serial.print("SD Card Type: "); - if(cardType == CARD_MMC){ - Serial.println("MMC"); - } else if(cardType == CARD_SD){ - Serial.println("SDSC"); - } else if(cardType == CARD_SDHC){ - Serial.println("SDHC"); - } else { - Serial.println("UNKNOWN"); - } - - uint64_t cardSize = SD.cardSize() / (1024 * 1024); - Serial.printf("SD Card Size: %lluMB\n", cardSize); - - listDir(SD, "/", 0); - removeDir(SD, "/mydir"); - createDir(SD, "/mydir"); - deleteFile(SD, "/hello.txt"); - writeFile(SD, "/hello.txt", "Hello "); - appendFile(SD, "/hello.txt", "World!\n"); - listDir(SD, "/", 0); -} - -void loop(){ - -} - - diff --git a/libraries/SD/library.properties b/libraries/SD/library.properties deleted file mode 100644 index 63183b735f9..00000000000 --- a/libraries/SD/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=SD(esp32) -version=1.0.5 -author=Arduino, SparkFun -maintainer=Arduino -sentence=Enables reading and writing on SD cards. For all Arduino boards. -paragraph=Once an SD memory card is connected to the SPI interfare of the Arduino board you are enabled to create files and read/write on them. You can also move through directories on the SD card. -category=Data Storage -url=http://www.arduino.cc/en/Reference/SD -architectures=esp32 diff --git a/libraries/SD/src/SD.cpp b/libraries/SD/src/SD.cpp deleted file mode 100644 index d268aa0fb97..00000000000 --- a/libraries/SD/src/SD.cpp +++ /dev/null @@ -1,106 +0,0 @@ -// 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. - -#include "vfs_api.h" -#include "sd_diskio.h" -#include "ff.h" -#include "FS.h" -#include "SD.h" - -using namespace fs; - -SDFS::SDFS(FSImplPtr impl): FS(impl), _pdrv(0xFF) {} - -bool SDFS::begin(uint8_t ssPin, SPIClass &spi, uint32_t frequency, const char * mountpoint, uint8_t max_files) -{ - if(_pdrv != 0xFF) { - return true; - } - - spi.begin(); - - _pdrv = sdcard_init(ssPin, &spi, frequency); - if(_pdrv == 0xFF) { - return false; - } - - if(!sdcard_mount(_pdrv, mountpoint, max_files)){ - sdcard_unmount(_pdrv); - sdcard_uninit(_pdrv); - _pdrv = 0xFF; - return false; - } - - _impl->mountpoint(mountpoint); - return true; -} - -void SDFS::end() -{ - if(_pdrv != 0xFF) { - _impl->mountpoint(NULL); - sdcard_unmount(_pdrv); - - sdcard_uninit(_pdrv); - _pdrv = 0xFF; - } -} - -sdcard_type_t SDFS::cardType() -{ - if(_pdrv == 0xFF) { - return CARD_NONE; - } - return sdcard_type(_pdrv); -} - -uint64_t SDFS::cardSize() -{ - if(_pdrv == 0xFF) { - return 0; - } - size_t sectors = sdcard_num_sectors(_pdrv); - size_t sectorSize = sdcard_sector_size(_pdrv); - return (uint64_t)sectors * sectorSize; -} - -uint64_t SDFS::totalBytes() -{ - FATFS* fsinfo; - DWORD fre_clust; - if(f_getfree("0:",&fre_clust,&fsinfo)!= 0) return 0; - uint64_t size = ((uint64_t)(fsinfo->csize))*(fsinfo->n_fatent - 2) -#if _MAX_SS != 512 - *(fsinfo->ssize); -#else - *512; -#endif - return size; -} - -uint64_t SDFS::usedBytes() -{ - FATFS* fsinfo; - DWORD fre_clust; - if(f_getfree("0:",&fre_clust,&fsinfo)!= 0) return 0; - uint64_t size = ((uint64_t)(fsinfo->csize))*((fsinfo->n_fatent - 2) - (fsinfo->free_clst)) -#if _MAX_SS != 512 - *(fsinfo->ssize); -#else - *512; -#endif - return size; -} - -SDFS SD = SDFS(FSImplPtr(new VFSImpl())); diff --git a/libraries/SD/src/SD.h b/libraries/SD/src/SD.h deleted file mode 100644 index da66c386c88..00000000000 --- a/libraries/SD/src/SD.h +++ /dev/null @@ -1,48 +0,0 @@ -// 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. -#ifndef _SD_H_ -#define _SD_H_ - -#include "FS.h" -#include "SPI.h" -#include "sd_defines.h" - -namespace fs -{ - -class SDFS : public FS -{ -protected: - uint8_t _pdrv; - -public: - SDFS(FSImplPtr impl); - bool begin(uint8_t ssPin=SS, SPIClass &spi=SPI, uint32_t frequency=4000000, const char * mountpoint="/sd", uint8_t max_files=5); - void end(); - sdcard_type_t cardType(); - uint64_t cardSize(); - uint64_t totalBytes(); - uint64_t usedBytes(); -}; - -} - -extern fs::SDFS SD; - -using namespace fs; -typedef fs::File SDFile; -typedef fs::SDFS SDFileSystemClass; -#define SDFileSystem SD - -#endif /* _SD_H_ */ diff --git a/libraries/SD/src/sd_defines.h b/libraries/SD/src/sd_defines.h deleted file mode 100644 index 6e42855ac61..00000000000 --- a/libraries/SD/src/sd_defines.h +++ /dev/null @@ -1,25 +0,0 @@ -// 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. -#ifndef _SD_DEFINES_H_ -#define _SD_DEFINES_H_ - -typedef enum { - CARD_NONE, - CARD_MMC, - CARD_SD, - CARD_SDHC, - CARD_UNKNOWN -} sdcard_type_t; - -#endif /* _SD_DISKIO_H_ */ diff --git a/libraries/SD/src/sd_diskio.cpp b/libraries/SD/src/sd_diskio.cpp deleted file mode 100644 index 0a9c86cc5f0..00000000000 --- a/libraries/SD/src/sd_diskio.cpp +++ /dev/null @@ -1,772 +0,0 @@ -// 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. -#include "sd_diskio.h" -extern "C" { - #include "diskio.h" - #include "ffconf.h" - #include "ff.h" - //#include "esp_vfs.h" - #include "esp_vfs_fat.h" - char CRC7(const char* data, int length); - unsigned short CRC16(const char* data, int length); -} - -typedef enum { - GO_IDLE_STATE = 0, - SEND_OP_COND = 1, - SEND_CID = 2, - SEND_RELATIVE_ADDR = 3, - SEND_SWITCH_FUNC = 6, - SEND_IF_COND = 8, - SEND_CSD = 9, - STOP_TRANSMISSION = 12, - SEND_STATUS = 13, - SET_BLOCKLEN = 16, - READ_BLOCK_SINGLE = 17, - READ_BLOCK_MULTIPLE = 18, - SEND_NUM_WR_BLOCKS = 22, - SET_WR_BLK_ERASE_COUNT = 23, - WRITE_BLOCK_SINGLE = 24, - WRITE_BLOCK_MULTIPLE = 25, - APP_OP_COND = 41, - APP_CLR_CARD_DETECT = 42, - APP_CMD = 55, - READ_OCR = 58, - CRC_ON_OFF = 59 -} ardu_sdcard_command_t; - -typedef struct { - uint8_t ssPin; - SPIClass * spi; - int frequency; - char * base_path; - sdcard_type_t type; - unsigned long sectors; - bool supports_crc; - int status; -} ardu_sdcard_t; - -static ardu_sdcard_t* s_cards[FF_VOLUMES] = { NULL }; - -/* - * SD SPI - * */ - -bool sdWait(uint8_t pdrv, int timeout) -{ - char resp; - uint32_t start = millis(); - - do { - resp = s_cards[pdrv]->spi->transfer(0xFF); - } while (resp == 0x00 && (millis() - start) < (unsigned int)timeout); - - return (resp > 0x00); -} - -void sdStop(uint8_t pdrv) -{ - s_cards[pdrv]->spi->write(0xFD); -} - -void sdDeselectCard(uint8_t pdrv) -{ - ardu_sdcard_t * card = s_cards[pdrv]; - digitalWrite(card->ssPin, HIGH); -} - -bool sdSelectCard(uint8_t pdrv) -{ - ardu_sdcard_t * card = s_cards[pdrv]; - digitalWrite(card->ssPin, LOW); - sdWait(pdrv, 300); - return true; -} - -char sdCommand(uint8_t pdrv, char cmd, unsigned int arg, unsigned int* resp) -{ - char token; - ardu_sdcard_t * card = s_cards[pdrv]; - - for (int f = 0; f < 3; f++) { - if (cmd == SEND_NUM_WR_BLOCKS || cmd == SET_WR_BLK_ERASE_COUNT || cmd == APP_OP_COND || cmd == APP_CLR_CARD_DETECT) { - token = sdCommand(pdrv, APP_CMD, 0, NULL); - sdDeselectCard(pdrv); - if (token > 1) { - return token; - } - if(!sdSelectCard(pdrv)) { - return 0xFF; - } - } - - char cmdPacket[7]; - cmdPacket[0] = cmd | 0x40; - cmdPacket[1] = arg >> 24; - cmdPacket[2] = arg >> 16; - cmdPacket[3] = arg >> 8; - cmdPacket[4] = arg; - if(card->supports_crc || cmd == GO_IDLE_STATE || cmd == SEND_IF_COND) { - cmdPacket[5] = (CRC7(cmdPacket, 5) << 1) | 0x01; - } else { - cmdPacket[5] = 0x01; - } - cmdPacket[6] = 0xFF; - - card->spi->writeBytes((uint8_t*)cmdPacket, (cmd == STOP_TRANSMISSION)?7:6); - - for (int i = 0; i < 9; i++) { - token = card->spi->transfer(0xFF); - if (!(token & 0x80)) { - break; - } - } - - if (token == 0xFF) { - log_w("no token received"); - sdDeselectCard(pdrv); - delay(100); - sdSelectCard(pdrv); - continue; - } else if (token & 0x08) { - log_w("crc error"); - sdDeselectCard(pdrv); - delay(100); - sdSelectCard(pdrv); - continue; - } else if (token > 1) { - log_w("token error [%u] 0x%x", cmd, token); - break; - } - - if (cmd == SEND_STATUS && resp) { - *resp = card->spi->transfer(0xFF); - } else if ((cmd == SEND_IF_COND || cmd == READ_OCR) && resp) { - *resp = card->spi->transfer32(0xFFFFFFFF); - } - - break; - } - - return token; -} - -bool sdReadBytes(uint8_t pdrv, char* buffer, int length) -{ - char token; - unsigned short crc; - ardu_sdcard_t * card = s_cards[pdrv]; - - uint32_t start = millis(); - do { - token = card->spi->transfer(0xFF); - } while (token == 0xFF && (millis() - start) < 500); - - if (token != 0xFE) { - return false; - } - - card->spi->transferBytes(NULL, (uint8_t*)buffer, length); - crc = card->spi->transfer16(0xFFFF); - return (!card->supports_crc || crc == CRC16(buffer, length)); -} - -char sdWriteBytes(uint8_t pdrv, const char* buffer, char token) -{ - ardu_sdcard_t * card = s_cards[pdrv]; - unsigned short crc = (card->supports_crc)?CRC16(buffer, 512):0xFFFF; - if (!sdWait(pdrv, 500)) { - return false; - } - - card->spi->write(token); - card->spi->writeBytes((uint8_t*)buffer, 512); - card->spi->write16(crc); - return (card->spi->transfer(0xFF) & 0x1F); -} - -/* - * SPI SDCARD Communication - * */ - -char sdTransaction(uint8_t pdrv, char cmd, unsigned int arg, unsigned int* resp) -{ - if(!sdSelectCard(pdrv)) { - return 0xFF; - } - char token = sdCommand(pdrv, cmd, arg, resp); - sdDeselectCard(pdrv); - return token; -} - -bool sdReadSector(uint8_t pdrv, char* buffer, unsigned long long sector) -{ - for (int f = 0; f < 3; f++) { - if(!sdSelectCard(pdrv)) { - break; - } - if (!sdCommand(pdrv, READ_BLOCK_SINGLE, (s_cards[pdrv]->type == CARD_SDHC) ? sector : sector << 9, NULL)) { - bool success = sdReadBytes(pdrv, buffer, 512); - sdDeselectCard(pdrv); - if (success) { - return true; - } - } else { - break; - } - } - sdDeselectCard(pdrv); - return false; -} - -bool sdReadSectors(uint8_t pdrv, char* buffer, unsigned long long sector, int count) -{ - for (int f = 0; f < 3;) { - if(!sdSelectCard(pdrv)) { - break; - } - - if (!sdCommand(pdrv, READ_BLOCK_MULTIPLE, (s_cards[pdrv]->type == CARD_SDHC) ? sector : sector << 9, NULL)) { - do { - if (!sdReadBytes(pdrv, buffer, 512)) { - f++; - break; - } - - sector++; - buffer += 512; - f = 0; - } while (--count); - - if (sdCommand(pdrv, STOP_TRANSMISSION, 0, NULL)) { - log_e("command failed"); - break; - } - - sdDeselectCard(pdrv); - if (count == 0) { - return true; - } - } else { - break; - } - } - sdDeselectCard(pdrv); - return false; -} - -bool sdWriteSector(uint8_t pdrv, const char* buffer, unsigned long long sector) -{ - for (int f = 0; f < 3; f++) { - if(!sdSelectCard(pdrv)) { - break; - } - if (!sdCommand(pdrv, WRITE_BLOCK_SINGLE, (s_cards[pdrv]->type == CARD_SDHC) ? sector : sector << 9, NULL)) { - char token = sdWriteBytes(pdrv, buffer, 0xFE); - sdDeselectCard(pdrv); - - if (token == 0x0A) { - continue; - } else if (token == 0x0C) { - return false; - } - - unsigned int resp; - if (sdTransaction(pdrv, SEND_STATUS, 0, &resp) || resp) { - return false; - } - return true; - } else { - break; - } - } - sdDeselectCard(pdrv); - return false; -} - -bool sdWriteSectors(uint8_t pdrv, const char* buffer, unsigned long long sector, int count) -{ - char token; - const char* currentBuffer = buffer; - unsigned long long currentSector = sector; - int currentCount = count; - ardu_sdcard_t * card = s_cards[pdrv]; - - for (int f = 0; f < 3;) { - if (card->type != CARD_MMC) { - if (sdTransaction(pdrv, SET_WR_BLK_ERASE_COUNT, currentCount, NULL)) { - break; - } - } - - if(!sdSelectCard(pdrv)) { - break; - } - - if (!sdCommand(pdrv, WRITE_BLOCK_MULTIPLE, (card->type == CARD_SDHC) ? currentSector : currentSector << 9, NULL)) { - do { - token = sdWriteBytes(pdrv, currentBuffer, 0xFC); - if (token != 0x05) { - f++; - break; - } - currentBuffer += 512; - f = 0; - } while (--currentCount); - - if (!sdWait(pdrv, 500)) { - break; - } - - if (currentCount == 0) { - sdStop(pdrv); - sdDeselectCard(pdrv); - - unsigned int resp; - if (sdTransaction(pdrv, SEND_STATUS, 0, &resp) || resp) { - return false; - } - return true; - } else { - if (sdCommand(pdrv, STOP_TRANSMISSION, 0, NULL)) { - break; - } - - sdDeselectCard(pdrv); - - if (token == 0x0A) { - unsigned int writtenBlocks = 0; - if (card->type != CARD_MMC && sdSelectCard(pdrv)) { - if (!sdCommand(pdrv, SEND_NUM_WR_BLOCKS, 0, NULL)) { - char acmdData[4]; - if (sdReadBytes(pdrv, acmdData, 4)) { - writtenBlocks = acmdData[0] << 24; - writtenBlocks |= acmdData[1] << 16; - writtenBlocks |= acmdData[2] << 8; - writtenBlocks |= acmdData[3]; - } - } - sdDeselectCard(pdrv); - } - currentBuffer = buffer + (writtenBlocks << 9); - currentSector = sector + writtenBlocks; - currentCount = count - writtenBlocks; - continue; - } else { - return false; - } - } - } else { - break; - } - } - sdDeselectCard(pdrv); - return false; -} - -unsigned long sdGetSectorsCount(uint8_t pdrv) -{ - for (int f = 0; f < 3; f++) { - if(!sdSelectCard(pdrv)) { - break; - } - - if (!sdCommand(pdrv, SEND_CSD, 0, NULL)) { - char csd[16]; - bool success = sdReadBytes(pdrv, csd, 16); - sdDeselectCard(pdrv); - if (success) { - if ((csd[0] >> 6) == 0x01) { - unsigned long size = ( - ((unsigned long)(csd[7] & 0x3F) << 16) - | ((unsigned long)csd[8] << 8) - | csd[9] - ) + 1; - return size << 10; - } - unsigned long size = ( - ((unsigned long)(csd[6] & 0x03) << 10) - | ((unsigned long)csd[7] << 2) - | ((csd[8] & 0xC0) >> 6) - ) + 1; - size <<= (( - ((csd[9] & 0x03) << 1) - | ((csd[10] & 0x80) >> 7) - ) + 2); - size <<= (csd[5] & 0x0F); - return size >> 9; - } - } else { - break; - } - } - - sdDeselectCard(pdrv); - return 0; -} - - -namespace -{ - -struct AcquireSPI -{ - ardu_sdcard_t *card; - explicit AcquireSPI(ardu_sdcard_t* card) - : card(card) - { - card->spi->beginTransaction(SPISettings(card->frequency, MSBFIRST, SPI_MODE0)); - } - AcquireSPI(ardu_sdcard_t* card, int frequency) - : card(card) - { - card->spi->beginTransaction(SPISettings(frequency, MSBFIRST, SPI_MODE0)); - } - ~AcquireSPI() - { - card->spi->endTransaction(); - } -private: - AcquireSPI(AcquireSPI const&); - AcquireSPI& operator=(AcquireSPI const&); -}; - -} - - -/* - * FATFS API - * */ - -DSTATUS ff_sd_initialize(uint8_t pdrv) -{ - char token; - unsigned int resp; - unsigned int start; - ardu_sdcard_t * card = s_cards[pdrv]; - - if (!(card->status & STA_NOINIT)) { - return card->status; - } - - AcquireSPI card_locked(card, 400000); - - digitalWrite(card->ssPin, HIGH); - for (uint8_t i = 0; i < 20; i++) { - card->spi->transfer(0XFF); - } - - if (sdTransaction(pdrv, GO_IDLE_STATE, 0, NULL) != 1) { - log_w("GO_IDLE_STATE failed"); - goto unknown_card; - } - - token = sdTransaction(pdrv, CRC_ON_OFF, 1, NULL); - if (token == 0x5) { - //old card maybe - card->supports_crc = false; - } else if (token != 1) { - log_w("CRC_ON_OFF failed: %u", token); - goto unknown_card; - } - - if (sdTransaction(pdrv, SEND_IF_COND, 0x1AA, &resp) == 1) { - if ((resp & 0xFFF) != 0x1AA) { - log_w("SEND_IF_COND failed: %03X", resp & 0xFFF); - goto unknown_card; - } - - if (sdTransaction(pdrv, READ_OCR, 0, &resp) != 1 || !(resp & (1 << 20))) { - log_w("READ_OCR failed: %X", resp); - goto unknown_card; - } - - start = millis(); - do { - token = sdTransaction(pdrv, APP_OP_COND, 0x40100000, NULL); - } while (token == 1 && (millis() - start) < 1000); - - if (token) { - log_w("APP_OP_COND failed: %u", token); - goto unknown_card; - } - - if (!sdTransaction(pdrv, READ_OCR, 0, &resp)) { - if (resp & (1 << 30)) { - card->type = CARD_SDHC; - } else { - card->type = CARD_SD; - } - } else { - log_w("READ_OCR failed: %X", resp); - goto unknown_card; - } - } else { - if (sdTransaction(pdrv, READ_OCR, 0, &resp) != 1 || !(resp & (1 << 20))) { - log_w("READ_OCR failed: %X", resp); - goto unknown_card; - } - - start = millis(); - do { - token = sdTransaction(pdrv, APP_OP_COND, 0x100000, NULL); - } while (token == 0x01 && (millis() - start) < 1000); - - if (!token) { - card->type = CARD_SD; - } else { - start = millis(); - do { - token = sdTransaction(pdrv, SEND_OP_COND, 0x100000, NULL); - } while (token != 0x00 && (millis() - start) < 1000); - - if (token == 0x00) { - card->type = CARD_MMC; - } else { - log_w("SEND_OP_COND failed: %u", token); - goto unknown_card; - } - } - } - - if (card->type != CARD_MMC) { - if (sdTransaction(pdrv, APP_CLR_CARD_DETECT, 0, NULL)) { - log_w("APP_CLR_CARD_DETECT failed"); - goto unknown_card; - } - } - - if (card->type != CARD_SDHC) { - if (sdTransaction(pdrv, SET_BLOCKLEN, 512, NULL) != 0x00) { - log_w("SET_BLOCKLEN failed"); - goto unknown_card; - } - } - - card->sectors = sdGetSectorsCount(pdrv); - - if (card->frequency > 25000000) { - card->frequency = 25000000; - } - - card->status &= ~STA_NOINIT; - return card->status; - -unknown_card: - card->type = CARD_UNKNOWN; - return card->status; -} - -DSTATUS ff_sd_status(uint8_t pdrv) -{ - return s_cards[pdrv]->status; -} - -DRESULT ff_sd_read(uint8_t pdrv, uint8_t* buffer, DWORD sector, UINT count) -{ - ardu_sdcard_t * card = s_cards[pdrv]; - if (card->status & STA_NOINIT) { - return RES_NOTRDY; - } - DRESULT res = RES_OK; - - AcquireSPI lock(card); - - if (count > 1) { - res = sdReadSectors(pdrv, (char*)buffer, sector, count) ? RES_OK : RES_ERROR; - } else { - res = sdReadSector(pdrv, (char*)buffer, sector) ? RES_OK : RES_ERROR; - } - return res; -} - -DRESULT ff_sd_write(uint8_t pdrv, const uint8_t* buffer, DWORD sector, UINT count) -{ - ardu_sdcard_t * card = s_cards[pdrv]; - if (card->status & STA_NOINIT) { - return RES_NOTRDY; - } - - if (card->status & STA_PROTECT) { - return RES_WRPRT; - } - DRESULT res = RES_OK; - - AcquireSPI lock(card); - - if (count > 1) { - res = sdWriteSectors(pdrv, (const char*)buffer, sector, count) ? RES_OK : RES_ERROR; - } - res = sdWriteSector(pdrv, (const char*)buffer, sector) ? RES_OK : RES_ERROR; - return res; -} - -DRESULT ff_sd_ioctl(uint8_t pdrv, uint8_t cmd, void* buff) -{ - switch(cmd) { - case CTRL_SYNC: - { - AcquireSPI lock(s_cards[pdrv]); - if (sdSelectCard(pdrv)) { - sdDeselectCard(pdrv); - return RES_OK; - } - } - return RES_ERROR; - case GET_SECTOR_COUNT: - *((unsigned long*) buff) = s_cards[pdrv]->sectors; - return RES_OK; - case GET_SECTOR_SIZE: - *((WORD*) buff) = 512; - return RES_OK; - case GET_BLOCK_SIZE: - *((uint32_t*)buff) = 1; - return RES_OK; - } - return RES_PARERR; -} - - -/* - * Public methods - * */ - -uint8_t sdcard_uninit(uint8_t pdrv) -{ - ardu_sdcard_t * card = s_cards[pdrv]; - if (pdrv >= FF_VOLUMES || card == NULL) { - return 1; - } - ff_diskio_register(pdrv, NULL); - s_cards[pdrv] = NULL; - esp_err_t err = ESP_OK; - if (card->base_path) { - err = esp_vfs_fat_unregister_path(card->base_path); - } - free(card); - return err; -} - -uint8_t sdcard_init(uint8_t cs, SPIClass * spi, int hz) -{ - - uint8_t pdrv = 0xFF; - if (ff_diskio_get_drive(&pdrv) != ESP_OK || pdrv == 0xFF) { - return pdrv; - } - - ardu_sdcard_t * card = (ardu_sdcard_t *)malloc(sizeof(ardu_sdcard_t)); - if (!card) { - return 0xFF; - } - - card->base_path = NULL; - card->frequency = hz; - card->spi = spi; - card->ssPin = cs; - - card->supports_crc = true; - card->type = CARD_NONE; - card->status = STA_NOINIT; - - pinMode(card->ssPin, OUTPUT); - digitalWrite(card->ssPin, HIGH); - - s_cards[pdrv] = card; - - static const ff_diskio_impl_t sd_impl = { - .init = &ff_sd_initialize, - .status = &ff_sd_status, - .read = &ff_sd_read, - .write = &ff_sd_write, - .ioctl = &ff_sd_ioctl - }; - ff_diskio_register(pdrv, &sd_impl); - - return pdrv; -} - -uint8_t sdcard_unmount(uint8_t pdrv) -{ - ardu_sdcard_t * card = s_cards[pdrv]; - if (pdrv >= FF_VOLUMES || card == NULL) { - return 1; - } - card->status |= STA_NOINIT; - card->type = CARD_NONE; - - char drv[3] = {(char)('0' + pdrv), ':', 0}; - f_mount(NULL, drv, 0); - return 0; -} - -bool sdcard_mount(uint8_t pdrv, const char* path, uint8_t max_files) -{ - ardu_sdcard_t * card = s_cards[pdrv]; - if(pdrv >= FF_VOLUMES || card == NULL){ - return false; - } - - if(card->base_path){ - free(card->base_path); - } - card->base_path = strdup(path); - - FATFS* fs; - char drv[3] = {(char)('0' + pdrv), ':', 0}; - esp_err_t err = esp_vfs_fat_register(path, drv, max_files, &fs); - if (err == ESP_ERR_INVALID_STATE) { - log_e("esp_vfs_fat_register failed 0x(%x): SD is registered.", err); - return false; - } else if (err != ESP_OK) { - log_e("esp_vfs_fat_register failed 0x(%x)", err); - return false; - } - - FRESULT res = f_mount(fs, drv, 1); - if (res != FR_OK) { - log_e("f_mount failed 0x(%x)", res); - esp_vfs_fat_unregister_path(path); - return false; - } - AcquireSPI lock(card); - card->sectors = sdGetSectorsCount(pdrv); - return true; -} - -uint32_t sdcard_num_sectors(uint8_t pdrv) -{ - ardu_sdcard_t * card = s_cards[pdrv]; - if(pdrv >= FF_VOLUMES || card == NULL){ - return 0; - } - return card->sectors; -} - -uint32_t sdcard_sector_size(uint8_t pdrv) -{ - if(pdrv >= FF_VOLUMES || s_cards[pdrv] == NULL){ - return 0; - } - return 512; -} - -sdcard_type_t sdcard_type(uint8_t pdrv) -{ - ardu_sdcard_t * card = s_cards[pdrv]; - if(pdrv >= FF_VOLUMES || card == NULL){ - return CARD_NONE; - } - return card->type; -} diff --git a/libraries/SD/src/sd_diskio.h b/libraries/SD/src/sd_diskio.h deleted file mode 100644 index 143be683e63..00000000000 --- a/libraries/SD/src/sd_diskio.h +++ /dev/null @@ -1,31 +0,0 @@ -// 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. -#ifndef _SD_DISKIO_H_ -#define _SD_DISKIO_H_ - -#include "Arduino.h" -#include "SPI.h" -#include "sd_defines.h" - -uint8_t sdcard_init(uint8_t cs, SPIClass * spi, int hz); -uint8_t sdcard_uninit(uint8_t pdrv); - -bool sdcard_mount(uint8_t pdrv, const char* path, uint8_t max_files); -uint8_t sdcard_unmount(uint8_t pdrv); - -sdcard_type_t sdcard_type(uint8_t pdrv); -uint32_t sdcard_num_sectors(uint8_t pdrv); -uint32_t sdcard_sector_size(uint8_t pdrv); - -#endif /* _SD_DISKIO_H_ */ diff --git a/libraries/SD/src/sd_diskio_crc.c b/libraries/SD/src/sd_diskio_crc.c deleted file mode 100644 index 0372df82d09..00000000000 --- a/libraries/SD/src/sd_diskio_crc.c +++ /dev/null @@ -1,103 +0,0 @@ -/* SD/MMC File System Library - * Copyright (c) 2014 Neil Thiessen - * - * 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. - */ - -const char m_CRC7Table[] = { - 0x00, 0x09, 0x12, 0x1B, 0x24, 0x2D, 0x36, 0x3F, - 0x48, 0x41, 0x5A, 0x53, 0x6C, 0x65, 0x7E, 0x77, - 0x19, 0x10, 0x0B, 0x02, 0x3D, 0x34, 0x2F, 0x26, - 0x51, 0x58, 0x43, 0x4A, 0x75, 0x7C, 0x67, 0x6E, - 0x32, 0x3B, 0x20, 0x29, 0x16, 0x1F, 0x04, 0x0D, - 0x7A, 0x73, 0x68, 0x61, 0x5E, 0x57, 0x4C, 0x45, - 0x2B, 0x22, 0x39, 0x30, 0x0F, 0x06, 0x1D, 0x14, - 0x63, 0x6A, 0x71, 0x78, 0x47, 0x4E, 0x55, 0x5C, - 0x64, 0x6D, 0x76, 0x7F, 0x40, 0x49, 0x52, 0x5B, - 0x2C, 0x25, 0x3E, 0x37, 0x08, 0x01, 0x1A, 0x13, - 0x7D, 0x74, 0x6F, 0x66, 0x59, 0x50, 0x4B, 0x42, - 0x35, 0x3C, 0x27, 0x2E, 0x11, 0x18, 0x03, 0x0A, - 0x56, 0x5F, 0x44, 0x4D, 0x72, 0x7B, 0x60, 0x69, - 0x1E, 0x17, 0x0C, 0x05, 0x3A, 0x33, 0x28, 0x21, - 0x4F, 0x46, 0x5D, 0x54, 0x6B, 0x62, 0x79, 0x70, - 0x07, 0x0E, 0x15, 0x1C, 0x23, 0x2A, 0x31, 0x38, - 0x41, 0x48, 0x53, 0x5A, 0x65, 0x6C, 0x77, 0x7E, - 0x09, 0x00, 0x1B, 0x12, 0x2D, 0x24, 0x3F, 0x36, - 0x58, 0x51, 0x4A, 0x43, 0x7C, 0x75, 0x6E, 0x67, - 0x10, 0x19, 0x02, 0x0B, 0x34, 0x3D, 0x26, 0x2F, - 0x73, 0x7A, 0x61, 0x68, 0x57, 0x5E, 0x45, 0x4C, - 0x3B, 0x32, 0x29, 0x20, 0x1F, 0x16, 0x0D, 0x04, - 0x6A, 0x63, 0x78, 0x71, 0x4E, 0x47, 0x5C, 0x55, - 0x22, 0x2B, 0x30, 0x39, 0x06, 0x0F, 0x14, 0x1D, - 0x25, 0x2C, 0x37, 0x3E, 0x01, 0x08, 0x13, 0x1A, - 0x6D, 0x64, 0x7F, 0x76, 0x49, 0x40, 0x5B, 0x52, - 0x3C, 0x35, 0x2E, 0x27, 0x18, 0x11, 0x0A, 0x03, - 0x74, 0x7D, 0x66, 0x6F, 0x50, 0x59, 0x42, 0x4B, - 0x17, 0x1E, 0x05, 0x0C, 0x33, 0x3A, 0x21, 0x28, - 0x5F, 0x56, 0x4D, 0x44, 0x7B, 0x72, 0x69, 0x60, - 0x0E, 0x07, 0x1C, 0x15, 0x2A, 0x23, 0x38, 0x31, - 0x46, 0x4F, 0x54, 0x5D, 0x62, 0x6B, 0x70, 0x79 -}; - -char CRC7(const char* data, int length) -{ - char crc = 0; - for (int i = 0; i < length; i++) { - crc = m_CRC7Table[(crc << 1) ^ data[i]]; - } - return crc; -} - -const unsigned short m_CRC16Table[256] = { - 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, - 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF, - 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6, - 0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE, - 0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485, - 0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D, - 0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4, - 0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC, - 0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823, - 0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B, - 0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12, - 0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A, - 0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41, - 0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49, - 0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70, - 0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78, - 0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F, - 0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067, - 0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E, - 0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256, - 0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D, - 0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, - 0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C, - 0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634, - 0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB, - 0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3, - 0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A, - 0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92, - 0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9, - 0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1, - 0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8, - 0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0 -}; - -unsigned short CRC16(const char* data, int length) -{ - unsigned short crc = 0; - for (int i = 0; i < length; i++) { - crc = (crc << 8) ^ m_CRC16Table[((crc >> 8) ^ data[i]) & 0x00FF]; - } - return crc; -} diff --git a/libraries/SD_MMC/examples/SDMMC_Test/SDMMC_Test.ino b/libraries/SD_MMC/examples/SDMMC_Test/SDMMC_Test.ino deleted file mode 100644 index b9e872850a0..00000000000 --- a/libraries/SD_MMC/examples/SDMMC_Test/SDMMC_Test.ino +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Connect the SD card to the following pins: - * - * SD Card | ESP32 - * D2 12 - * D3 13 - * CMD 15 - * VSS GND - * VDD 3.3V - * CLK 14 - * VSS GND - * D0 2 (add 1K pull up after flashing) - * D1 4 - */ - -#include "FS.h" -#include "SD_MMC.h" - -void listDir(fs::FS &fs, const char * dirname, uint8_t levels){ - Serial.printf("Listing directory: %s\n", dirname); - - File root = fs.open(dirname); - if(!root){ - Serial.println("Failed to open directory"); - return; - } - if(!root.isDirectory()){ - Serial.println("Not a directory"); - return; - } - - File file = root.openNextFile(); - while(file){ - if(file.isDirectory()){ - Serial.print(" DIR : "); - Serial.println(file.name()); - if(levels){ - listDir(fs, file.name(), levels -1); - } - } else { - Serial.print(" FILE: "); - Serial.print(file.name()); - Serial.print(" SIZE: "); - Serial.println(file.size()); - } - file = root.openNextFile(); - } -} - -void createDir(fs::FS &fs, const char * path){ - Serial.printf("Creating Dir: %s\n", path); - if(fs.mkdir(path)){ - Serial.println("Dir created"); - } else { - Serial.println("mkdir failed"); - } -} - -void removeDir(fs::FS &fs, const char * path){ - Serial.printf("Removing Dir: %s\n", path); - if(fs.rmdir(path)){ - Serial.println("Dir removed"); - } else { - Serial.println("rmdir failed"); - } -} - -void readFile(fs::FS &fs, const char * path){ - Serial.printf("Reading file: %s\n", path); - - File file = fs.open(path); - if(!file){ - Serial.println("Failed to open file for reading"); - return; - } - - Serial.print("Read from file: "); - while(file.available()){ - Serial.write(file.read()); - } -} - -void writeFile(fs::FS &fs, const char * path, const char * message){ - Serial.printf("Writing file: %s\n", path); - - File file = fs.open(path, FILE_WRITE); - if(!file){ - Serial.println("Failed to open file for writing"); - return; - } - if(file.print(message)){ - Serial.println("File written"); - } else { - Serial.println("Write failed"); - } -} - -void appendFile(fs::FS &fs, const char * path, const char * message){ - Serial.printf("Appending to file: %s\n", path); - - File file = fs.open(path, FILE_APPEND); - if(!file){ - Serial.println("Failed to open file for appending"); - return; - } - if(file.print(message)){ - Serial.println("Message appended"); - } else { - Serial.println("Append failed"); - } -} - -void renameFile(fs::FS &fs, const char * path1, const char * path2){ - Serial.printf("Renaming file %s to %s\n", path1, path2); - if (fs.rename(path1, path2)) { - Serial.println("File renamed"); - } else { - Serial.println("Rename failed"); - } -} - -void deleteFile(fs::FS &fs, const char * path){ - Serial.printf("Deleting file: %s\n", path); - if(fs.remove(path)){ - Serial.println("File deleted"); - } else { - Serial.println("Delete failed"); - } -} - -void testFileIO(fs::FS &fs, const char * path){ - File file = fs.open(path); - static uint8_t buf[512]; - size_t len = 0; - uint32_t start = millis(); - uint32_t end = start; - if(file){ - len = file.size(); - size_t flen = len; - start = millis(); - while(len){ - size_t toRead = len; - if(toRead > 512){ - toRead = 512; - } - file.read(buf, toRead); - len -= toRead; - } - end = millis() - start; - Serial.printf("%u bytes read for %u ms\n", flen, end); - file.close(); - } else { - Serial.println("Failed to open file for reading"); - } - - - file = fs.open(path, FILE_WRITE); - if(!file){ - Serial.println("Failed to open file for writing"); - return; - } - - size_t i; - start = millis(); - for(i=0; i<2048; i++){ - file.write(buf, 512); - } - end = millis() - start; - Serial.printf("%u bytes written for %u ms\n", 2048 * 512, end); - file.close(); -} - -void setup(){ - Serial.begin(115200); - if(!SD_MMC.begin()){ - Serial.println("Card Mount Failed"); - return; - } - uint8_t cardType = SD_MMC.cardType(); - - if(cardType == CARD_NONE){ - Serial.println("No SD_MMC card attached"); - return; - } - - Serial.print("SD_MMC Card Type: "); - if(cardType == CARD_MMC){ - Serial.println("MMC"); - } else if(cardType == CARD_SD){ - Serial.println("SDSC"); - } else if(cardType == CARD_SDHC){ - Serial.println("SDHC"); - } else { - Serial.println("UNKNOWN"); - } - - uint64_t cardSize = SD_MMC.cardSize() / (1024 * 1024); - Serial.printf("SD_MMC Card Size: %lluMB\n", cardSize); - - listDir(SD_MMC, "/", 0); - createDir(SD_MMC, "/mydir"); - listDir(SD_MMC, "/", 0); - removeDir(SD_MMC, "/mydir"); - listDir(SD_MMC, "/", 2); - writeFile(SD_MMC, "/hello.txt", "Hello "); - appendFile(SD_MMC, "/hello.txt", "World!\n"); - readFile(SD_MMC, "/hello.txt"); - deleteFile(SD_MMC, "/foo.txt"); - renameFile(SD_MMC, "/hello.txt", "/foo.txt"); - readFile(SD_MMC, "/foo.txt"); - testFileIO(SD_MMC, "/test.txt"); - Serial.printf("Total space: %lluMB\n", SD_MMC.totalBytes() / (1024 * 1024)); - Serial.printf("Used space: %lluMB\n", SD_MMC.usedBytes() / (1024 * 1024)); -} - -void loop(){ - -} diff --git a/libraries/SD_MMC/examples/SDMMC_time/SDMMC_time.ino b/libraries/SD_MMC/examples/SDMMC_time/SDMMC_time.ino deleted file mode 100644 index 43dad45427f..00000000000 --- a/libraries/SD_MMC/examples/SDMMC_time/SDMMC_time.ino +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Connect the SD card to the following pins: - * - * SD Card | ESP32 - * D2 - - * D3 SS - * CMD MOSI - * VSS GND - * VDD 3.3V - * CLK SCK - * VSS GND - * D0 MISO - * D1 - - */ - -#include "FS.h" -#include "SD_MMC.h" -#include "SPI.h" -#include -#include - -const char* ssid = "your-ssid"; -const char* password = "your-password"; - -long timezone = 1; -byte daysavetime = 1; - -void listDir(fs::FS &fs, const char * dirname, uint8_t levels){ - Serial.printf("Listing directory: %s\n", dirname); - - File root = fs.open(dirname); - if(!root){ - Serial.println("Failed to open directory"); - return; - } - if(!root.isDirectory()){ - Serial.println("Not a directory"); - return; - } - - File file = root.openNextFile(); - while(file){ - if(file.isDirectory()){ - Serial.print(" DIR : "); - Serial.print (file.name()); - time_t t= file.getLastWrite(); - struct tm * tmstruct = localtime(&t); - Serial.printf(" LAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n",(tmstruct->tm_year)+1900,( tmstruct->tm_mon)+1, tmstruct->tm_mday,tmstruct->tm_hour , tmstruct->tm_min, tmstruct->tm_sec); - if(levels){ - listDir(fs, file.name(), levels -1); - } - } else { - Serial.print(" FILE: "); - Serial.print(file.name()); - Serial.print(" SIZE: "); - Serial.print(file.size()); - time_t t= file.getLastWrite(); - struct tm * tmstruct = localtime(&t); - Serial.printf(" LAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n",(tmstruct->tm_year)+1900,( tmstruct->tm_mon)+1, tmstruct->tm_mday,tmstruct->tm_hour , tmstruct->tm_min, tmstruct->tm_sec); - } - file = root.openNextFile(); - } -} - -void createDir(fs::FS &fs, const char * path){ - Serial.printf("Creating Dir: %s\n", path); - if(fs.mkdir(path)){ - Serial.println("Dir created"); - } else { - Serial.println("mkdir failed"); - } -} - -void removeDir(fs::FS &fs, const char * path){ - Serial.printf("Removing Dir: %s\n", path); - if(fs.rmdir(path)){ - Serial.println("Dir removed"); - } else { - Serial.println("rmdir failed"); - } -} - -void readFile(fs::FS &fs, const char * path){ - Serial.printf("Reading file: %s\n", path); - - File file = fs.open(path); - if(!file){ - Serial.println("Failed to open file for reading"); - return; - } - - Serial.print("Read from file: "); - while(file.available()){ - Serial.write(file.read()); - } - file.close(); -} - -void writeFile(fs::FS &fs, const char * path, const char * message){ - Serial.printf("Writing file: %s\n", path); - - File file = fs.open(path, FILE_WRITE); - if(!file){ - Serial.println("Failed to open file for writing"); - return; - } - if(file.print(message)){ - Serial.println("File written"); - } else { - Serial.println("Write failed"); - } - file.close(); -} - -void appendFile(fs::FS &fs, const char * path, const char * message){ - Serial.printf("Appending to file: %s\n", path); - - File file = fs.open(path, FILE_APPEND); - if(!file){ - Serial.println("Failed to open file for appending"); - return; - } - if(file.print(message)){ - Serial.println("Message appended"); - } else { - Serial.println("Append failed"); - } - file.close(); -} - -void renameFile(fs::FS &fs, const char * path1, const char * path2){ - Serial.printf("Renaming file %s to %s\n", path1, path2); - if (fs.rename(path1, path2)) { - Serial.println("File renamed"); - } else { - Serial.println("Rename failed"); - } -} - -void deleteFile(fs::FS &fs, const char * path){ - Serial.printf("Deleting file: %s\n", path); - if(fs.remove(path)){ - Serial.println("File deleted"); - } else { - Serial.println("Delete failed"); - } -} - -void setup(){ - Serial.begin(115200); - // We start by connecting to a WiFi network - Serial.println(); - Serial.println(); - Serial.print("Connecting to "); - Serial.println(ssid); - - WiFi.begin(ssid, password); - - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - } - Serial.println("WiFi connected"); - Serial.println("IP address: "); - Serial.println(WiFi.localIP()); - Serial.println("Contacting Time Server"); - configTime(3600*timezone, daysavetime*3600, "time.nist.gov", "0.pool.ntp.org", "1.pool.ntp.org"); - struct tm tmstruct ; - delay(2000); - tmstruct.tm_year = 0; - getLocalTime(&tmstruct, 5000); - Serial.printf("\nNow is : %d-%02d-%02d %02d:%02d:%02d\n",(tmstruct.tm_year)+1900,( tmstruct.tm_mon)+1, tmstruct.tm_mday,tmstruct.tm_hour , tmstruct.tm_min, tmstruct.tm_sec); - Serial.println(""); - - if(!SD_MMC.begin()){ - Serial.println("Card Mount Failed"); - return; - } - uint8_t cardType = SD_MMC.cardType(); - - if(cardType == CARD_NONE){ - Serial.println("No SD card attached"); - return; - } - - Serial.print("SD Card Type: "); - if(cardType == CARD_MMC){ - Serial.println("MMC"); - } else if(cardType == CARD_SD){ - Serial.println("SDSC"); - } else if(cardType == CARD_SDHC){ - Serial.println("SDHC"); - } else { - Serial.println("UNKNOWN"); - } - - uint64_t cardSize = SD_MMC.cardSize() / (1024 * 1024); - Serial.printf("SD Card Size: %lluMB\n", cardSize); - - listDir(SD_MMC, "/", 0); - removeDir(SD_MMC, "/mydir"); - createDir(SD_MMC, "/mydir"); - deleteFile(SD_MMC, "/hello.txt"); - writeFile(SD_MMC, "/hello.txt", "Hello "); - appendFile(SD_MMC, "/hello.txt", "World!\n"); - listDir(SD_MMC, "/", 0); -} - -void loop(){ - -} - - diff --git a/libraries/SD_MMC/library.properties b/libraries/SD_MMC/library.properties deleted file mode 100644 index 9e47a6ee4be..00000000000 --- a/libraries/SD_MMC/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=SD_MMC -version=1.0 -author=Hristo Gochkov, Ivan Grokhtkov -maintainer=Hristo Gochkov -sentence=ESP32 SDMMC File System -paragraph= -category=Data Storage -url= -architectures=esp32 diff --git a/libraries/SD_MMC/src/SD_MMC.cpp b/libraries/SD_MMC/src/SD_MMC.cpp deleted file mode 100644 index 4de467304e5..00000000000 --- a/libraries/SD_MMC/src/SD_MMC.cpp +++ /dev/null @@ -1,146 +0,0 @@ -// 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. - -#include "vfs_api.h" - -extern "C" { -#include -#include -#include -#include "esp_vfs_fat.h" -#include "driver/sdmmc_host.h" -#include "driver/sdmmc_defs.h" -#include "sdmmc_cmd.h" -} -#include "ff.h" -#include "SD_MMC.h" - -using namespace fs; -/* - -*/ - -SDMMCFS::SDMMCFS(FSImplPtr impl) - : FS(impl), _card(NULL) -{} - -bool SDMMCFS::begin(const char * mountpoint, bool mode1bit) -{ - if(_card) { - return true; - } - //mount - sdmmc_slot_config_t slot_config = SDMMC_SLOT_CONFIG_DEFAULT(); - sdmmc_host_t host = { - .flags = SDMMC_HOST_FLAG_4BIT, - .slot = SDMMC_HOST_SLOT_1, - .max_freq_khz = SDMMC_FREQ_DEFAULT, - .io_voltage = 3.3f, - .init = &sdmmc_host_init, - .set_bus_width = &sdmmc_host_set_bus_width, - .get_bus_width = &sdmmc_host_get_slot_width, - .set_bus_ddr_mode = &sdmmc_host_set_bus_ddr_mode, - .set_card_clk = &sdmmc_host_set_card_clk, - .do_transaction = &sdmmc_host_do_transaction, - .deinit = &sdmmc_host_deinit, - .io_int_enable = &sdmmc_host_io_int_enable, - .io_int_wait = &sdmmc_host_io_int_wait, - .command_timeout_ms = 0 - }; - host.max_freq_khz = SDMMC_FREQ_HIGHSPEED; -#ifdef BOARD_HAS_1BIT_SDMMC - mode1bit = true; -#endif - if(mode1bit) { - host.flags = SDMMC_HOST_FLAG_1BIT; //use 1-line SD mode - } - - esp_vfs_fat_sdmmc_mount_config_t mount_config = { - .format_if_mount_failed = false, - .max_files = 5, - .allocation_unit_size = 0 - }; - - esp_err_t ret = esp_vfs_fat_sdmmc_mount(mountpoint, &host, &slot_config, &mount_config, &_card); - if (ret != ESP_OK) { - if (ret == ESP_FAIL) { - log_e("Failed to mount filesystem. If you want the card to be formatted, set format_if_mount_failed = true."); - } else if (ret == ESP_ERR_INVALID_STATE) { - _impl->mountpoint(mountpoint); - log_w("SD Already mounted"); - return true; - } else { - log_e("Failed to initialize the card (%d). Make sure SD card lines have pull-up resistors in place.", ret); - } - _card = NULL; - return false; - } - _impl->mountpoint(mountpoint); - return true; -} - -void SDMMCFS::end() -{ - if(_card) { - esp_vfs_fat_sdmmc_unmount(); - _impl->mountpoint(NULL); - _card = NULL; - } -} - -sdcard_type_t SDMMCFS::cardType() -{ - if(!_card) { - return CARD_NONE; - } - return (_card->ocr & SD_OCR_SDHC_CAP)?CARD_SDHC:CARD_SD; -} - -uint64_t SDMMCFS::cardSize() -{ - if(!_card) { - return 0; - } - return (uint64_t)_card->csd.capacity * _card->csd.sector_size; -} - -uint64_t SDMMCFS::totalBytes() -{ - FATFS* fsinfo; - DWORD fre_clust; - if(f_getfree("0:",&fre_clust,&fsinfo)!= 0) return 0; - uint64_t size = ((uint64_t)(fsinfo->csize))*(fsinfo->n_fatent - 2) -#if _MAX_SS != 512 - *(fsinfo->ssize); -#else - *512; -#endif - return size; -} - -uint64_t SDMMCFS::usedBytes() -{ - FATFS* fsinfo; - DWORD fre_clust; - if(f_getfree("0:",&fre_clust,&fsinfo)!= 0) return 0; - uint64_t size = ((uint64_t)(fsinfo->csize))*((fsinfo->n_fatent - 2) - (fsinfo->free_clst)) -#if _MAX_SS != 512 - *(fsinfo->ssize); -#else - *512; -#endif - return size; -} - -SDMMCFS SD_MMC = SDMMCFS(FSImplPtr(new VFSImpl())); diff --git a/libraries/SD_MMC/src/SD_MMC.h b/libraries/SD_MMC/src/SD_MMC.h deleted file mode 100644 index e3dc15432a5..00000000000 --- a/libraries/SD_MMC/src/SD_MMC.h +++ /dev/null @@ -1,43 +0,0 @@ -// 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. -#ifndef _SDMMC_H_ -#define _SDMMC_H_ - -#include "FS.h" -#include "driver/sdmmc_types.h" -#include "sd_defines.h" - -namespace fs -{ - -class SDMMCFS : public FS -{ -protected: - sdmmc_card_t* _card; - -public: - SDMMCFS(FSImplPtr impl); - bool begin(const char * mountpoint="/sdcard", bool mode1bit=false); - void end(); - sdcard_type_t cardType(); - uint64_t cardSize(); - uint64_t totalBytes(); - uint64_t usedBytes(); -}; - -} - -extern fs::SDMMCFS SD_MMC; - -#endif /* _SDMMC_H_ */ diff --git a/libraries/SD_MMC/src/sd_defines.h b/libraries/SD_MMC/src/sd_defines.h deleted file mode 100644 index 6e42855ac61..00000000000 --- a/libraries/SD_MMC/src/sd_defines.h +++ /dev/null @@ -1,25 +0,0 @@ -// 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. -#ifndef _SD_DEFINES_H_ -#define _SD_DEFINES_H_ - -typedef enum { - CARD_NONE, - CARD_MMC, - CARD_SD, - CARD_SDHC, - CARD_UNKNOWN -} sdcard_type_t; - -#endif /* _SD_DISKIO_H_ */ diff --git a/libraries/SPI/examples/SPI_Multiple_Buses/SPI_Multiple_Buses.ino b/libraries/SPI/examples/SPI_Multiple_Buses/SPI_Multiple_Buses.ino deleted file mode 100644 index 76ead2d0a2e..00000000000 --- a/libraries/SPI/examples/SPI_Multiple_Buses/SPI_Multiple_Buses.ino +++ /dev/null @@ -1,77 +0,0 @@ - - -/* The ESP32 has four SPi buses, however as of right now only two of - * them are available to use, HSPI and VSPI. Simply using the SPI API - * as illustrated in Arduino examples will use VSPI, leaving HSPI unused. - * - * However if we simply intialise two instance of the SPI class for both - * of these buses both can be used. However when just using these the Arduino - * way only will actually be outputting at a time. - * - * Logic analyser capture is in the same folder as this example as - * "multiple_bus_output.png" - * - * created 30/04/2018 by Alistair Symonds - */ -#include - -static const int spiClk = 1000000; // 1 MHz - -//uninitalised pointers to SPI objects -SPIClass * vspi = NULL; -SPIClass * hspi = NULL; - -void setup() { - //initialise two instances of the SPIClass attached to VSPI and HSPI respectively - vspi = new SPIClass(VSPI); - hspi = new SPIClass(HSPI); - - //clock miso mosi ss - - //initialise vspi with default pins - //SCLK = 18, MISO = 19, MOSI = 23, SS = 5 - vspi->begin(); - //alternatively route through GPIO pins of your choice - //hspi->begin(0, 2, 4, 33); //SCLK, MISO, MOSI, SS - - //initialise hspi with default pins - //SCLK = 14, MISO = 12, MOSI = 13, SS = 15 - hspi->begin(); - //alternatively route through GPIO pins - //hspi->begin(25, 26, 27, 32); //SCLK, MISO, MOSI, SS - - //set up slave select pins as outputs as the Arduino API - //doesn't handle automatically pulling SS low - pinMode(5, OUTPUT); //VSPI SS - pinMode(15, OUTPUT); //HSPI SS - -} - -// the loop function runs over and over again until power down or reset -void loop() { - //use the SPI buses - vspiCommand(); - hspiCommand(); - delay(100); -} - -void vspiCommand() { - byte data = 0b01010101; // junk data to illustrate usage - - //use it as you would the regular arduino SPI API - vspi->beginTransaction(SPISettings(spiClk, MSBFIRST, SPI_MODE0)); - digitalWrite(5, LOW); //pull SS slow to prep other end for transfer - vspi->transfer(data); - digitalWrite(5, HIGH); //pull ss high to signify end of data transfer - vspi->endTransaction(); -} - -void hspiCommand() { - byte stuff = 0b11001100; - - hspi->beginTransaction(SPISettings(spiClk, MSBFIRST, SPI_MODE0)); - digitalWrite(15, LOW); - hspi->transfer(stuff); - digitalWrite(15, HIGH); - hspi->endTransaction(); -} diff --git a/libraries/SPI/examples/SPI_Multiple_Buses/multiple_bus_output.PNG b/libraries/SPI/examples/SPI_Multiple_Buses/multiple_bus_output.PNG deleted file mode 100644 index 02b89f6a001..00000000000 Binary files a/libraries/SPI/examples/SPI_Multiple_Buses/multiple_bus_output.PNG and /dev/null differ diff --git a/libraries/SPI/keywords.txt b/libraries/SPI/keywords.txt deleted file mode 100644 index fa7616581aa..00000000000 --- a/libraries/SPI/keywords.txt +++ /dev/null @@ -1,36 +0,0 @@ -####################################### -# Syntax Coloring Map SPI -####################################### - -####################################### -# Datatypes (KEYWORD1) -####################################### - -SPI KEYWORD1 - -####################################### -# Methods and Functions (KEYWORD2) -####################################### -begin KEYWORD2 -end KEYWORD2 -transfer KEYWORD2 -setBitOrder KEYWORD2 -setDataMode KEYWORD2 -setClockDivider KEYWORD2 - - -####################################### -# Constants (LITERAL1) -####################################### -SPI_CLOCK_DIV4 LITERAL1 -SPI_CLOCK_DIV16 LITERAL1 -SPI_CLOCK_DIV64 LITERAL1 -SPI_CLOCK_DIV128 LITERAL1 -SPI_CLOCK_DIV2 LITERAL1 -SPI_CLOCK_DIV8 LITERAL1 -SPI_CLOCK_DIV32 LITERAL1 -SPI_CLOCK_DIV64 LITERAL1 -SPI_MODE0 LITERAL1 -SPI_MODE1 LITERAL1 -SPI_MODE2 LITERAL1 -SPI_MODE3 LITERAL1 \ No newline at end of file diff --git a/libraries/SPI/library.properties b/libraries/SPI/library.properties deleted file mode 100644 index 9e8f805da75..00000000000 --- a/libraries/SPI/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=SPI -version=1.0 -author=Hristo Gochkov -maintainer=Hristo Gochkov -sentence=Enables the communication with devices that use the Serial Peripheral Interface (SPI) Bus. For all Arduino boards, BUT Arduino DUE. -paragraph= -category=Signal Input/Output -url=http://arduino.cc/en/Reference/SPI -architectures=esp32 diff --git a/libraries/SPI/src/SPI.cpp b/libraries/SPI/src/SPI.cpp deleted file mode 100644 index 7f2977572ec..00000000000 --- a/libraries/SPI/src/SPI.cpp +++ /dev/null @@ -1,295 +0,0 @@ -/* - SPI.cpp - SPI library for esp8266 - - Copyright (c) 2015 Hristo Gochkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "SPI.h" - -SPIClass::SPIClass(uint8_t spi_bus) - :_spi_num(spi_bus) - ,_spi(NULL) - ,_use_hw_ss(false) - ,_sck(-1) - ,_miso(-1) - ,_mosi(-1) - ,_ss(-1) - ,_div(0) - ,_freq(1000000) - ,_inTransaction(false) -{} - -void SPIClass::begin(int8_t sck, int8_t miso, int8_t mosi, int8_t ss) -{ - if(_spi) { - return; - } - - if(!_div) { - _div = spiFrequencyToClockDiv(_freq); - } - - _spi = spiStartBus(_spi_num, _div, SPI_MODE0, SPI_MSBFIRST); - if(!_spi) { - return; - } - - if(sck == -1 && miso == -1 && mosi == -1 && ss == -1) { - _sck = (_spi_num == VSPI) ? SCK : 14; - _miso = (_spi_num == VSPI) ? MISO : 12; - _mosi = (_spi_num == VSPI) ? MOSI : 13; - _ss = (_spi_num == VSPI) ? SS : 15; - } else { - _sck = sck; - _miso = miso; - _mosi = mosi; - _ss = ss; - } - - spiAttachSCK(_spi, _sck); - spiAttachMISO(_spi, _miso); - spiAttachMOSI(_spi, _mosi); - -} - -void SPIClass::end() -{ - if(!_spi) { - return; - } - spiDetachSCK(_spi, _sck); - spiDetachMISO(_spi, _miso); - spiDetachMOSI(_spi, _mosi); - setHwCs(false); - spiStopBus(_spi); - _spi = NULL; -} - -void SPIClass::setHwCs(bool use) -{ - if(use && !_use_hw_ss) { - spiAttachSS(_spi, 0, _ss); - spiSSEnable(_spi); - } else if(_use_hw_ss) { - spiSSDisable(_spi); - spiDetachSS(_spi, _ss); - } - _use_hw_ss = use; -} - -void SPIClass::setFrequency(uint32_t freq) -{ - //check if last freq changed - uint32_t cdiv = spiGetClockDiv(_spi); - if(_freq != freq || _div != cdiv) { - _freq = freq; - _div = spiFrequencyToClockDiv(_freq); - spiSetClockDiv(_spi, _div); - } -} - -void SPIClass::setClockDivider(uint32_t clockDiv) -{ - _div = clockDiv; - spiSetClockDiv(_spi, _div); -} - -uint32_t SPIClass::getClockDivider() -{ - return spiGetClockDiv(_spi); -} - -void SPIClass::setDataMode(uint8_t dataMode) -{ - spiSetDataMode(_spi, dataMode); -} - -void SPIClass::setBitOrder(uint8_t bitOrder) -{ - spiSetBitOrder(_spi, bitOrder); -} - -void SPIClass::beginTransaction(SPISettings settings) -{ - //check if last freq changed - uint32_t cdiv = spiGetClockDiv(_spi); - if(_freq != settings._clock || _div != cdiv) { - _freq = settings._clock; - _div = spiFrequencyToClockDiv(_freq); - } - spiTransaction(_spi, _div, settings._dataMode, settings._bitOrder); - _inTransaction = true; -} - -void SPIClass::endTransaction() -{ - if(_inTransaction){ - _inTransaction = false; - spiEndTransaction(_spi); - } -} - -void SPIClass::write(uint8_t data) -{ - if(_inTransaction){ - return spiWriteByteNL(_spi, data); - } - spiWriteByte(_spi, data); -} - -uint8_t SPIClass::transfer(uint8_t data) -{ - if(_inTransaction){ - return spiTransferByteNL(_spi, data); - } - return spiTransferByte(_spi, data); -} - -void SPIClass::write16(uint16_t data) -{ - if(_inTransaction){ - return spiWriteShortNL(_spi, data); - } - spiWriteWord(_spi, data); -} - -uint16_t SPIClass::transfer16(uint16_t data) -{ - if(_inTransaction){ - return spiTransferShortNL(_spi, data); - } - return spiTransferWord(_spi, data); -} - -void SPIClass::write32(uint32_t data) -{ - if(_inTransaction){ - return spiWriteLongNL(_spi, data); - } - spiWriteLong(_spi, data); -} - -uint32_t SPIClass::transfer32(uint32_t data) -{ - if(_inTransaction){ - return spiTransferLongNL(_spi, data); - } - return spiTransferLong(_spi, data); -} - -void SPIClass::transferBits(uint32_t data, uint32_t * out, uint8_t bits) -{ - if(_inTransaction){ - return spiTransferBitsNL(_spi, data, out, bits); - } - spiTransferBits(_spi, data, out, bits); -} - -/** - * @param data uint8_t * - * @param size uint32_t - */ -void SPIClass::writeBytes(const uint8_t * data, uint32_t size) -{ - if(_inTransaction){ - return spiWriteNL(_spi, data, size); - } - spiSimpleTransaction(_spi); - spiWriteNL(_spi, data, size); - spiEndTransaction(_spi); -} - -void SPIClass::transfer(uint8_t * data, uint32_t size) -{ - transferBytes(data, data, size); -} - -/** - * @param data void * - * @param size uint32_t - */ -void SPIClass::writePixels(const void * data, uint32_t size) -{ - if(_inTransaction){ - return spiWritePixelsNL(_spi, data, size); - } - spiSimpleTransaction(_spi); - spiWritePixelsNL(_spi, data, size); - spiEndTransaction(_spi); -} - -/** - * @param data uint8_t * data buffer. can be NULL for Read Only operation - * @param out uint8_t * output buffer. can be NULL for Write Only operation - * @param size uint32_t - */ -void SPIClass::transferBytes(uint8_t * data, uint8_t * out, uint32_t size) -{ - if(_inTransaction){ - return spiTransferBytesNL(_spi, data, out, size); - } - spiTransferBytes(_spi, data, out, size); -} - -/** - * @param data uint8_t * - * @param size uint8_t max for size is 64Byte - * @param repeat uint32_t - */ -void SPIClass::writePattern(uint8_t * data, uint8_t size, uint32_t repeat) -{ - if(size > 64) { - return; //max Hardware FIFO - } - - uint32_t byte = (size * repeat); - uint8_t r = (64 / size); - const uint8_t max_bytes_FIFO = r * size; // Max number of whole patterns (in bytes) that can fit into the hardware FIFO - - while(byte) { - if(byte > max_bytes_FIFO) { - writePattern_(data, size, r); - byte -= max_bytes_FIFO; - } else { - writePattern_(data, size, (byte / size)); - byte = 0; - } - } -} - -void SPIClass::writePattern_(uint8_t * data, uint8_t size, uint8_t repeat) -{ - uint8_t bytes = (size * repeat); - uint8_t buffer[64]; - uint8_t * bufferPtr = &buffer[0]; - uint8_t * dataPtr; - uint8_t dataSize = bytes; - for(uint8_t i = 0; i < repeat; i++) { - dataSize = size; - dataPtr = data; - while(dataSize--) { - *bufferPtr = *dataPtr; - dataPtr++; - bufferPtr++; - } - } - - writeBytes(&buffer[0], bytes); -} - -SPIClass SPI(VSPI); diff --git a/libraries/SPI/src/SPI.h b/libraries/SPI/src/SPI.h deleted file mode 100644 index e34833bd435..00000000000 --- a/libraries/SPI/src/SPI.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - SPI.h - SPI library for esp8266 - - Copyright (c) 2015 Hristo Gochkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#ifndef _SPI_H_INCLUDED -#define _SPI_H_INCLUDED - -#include -#include "pins_arduino.h" -#include "esp32-hal-spi.h" - -class SPISettings -{ -public: - SPISettings() :_clock(1000000), _bitOrder(SPI_MSBFIRST), _dataMode(SPI_MODE0) {} - SPISettings(uint32_t clock, uint8_t bitOrder, uint8_t dataMode) :_clock(clock), _bitOrder(bitOrder), _dataMode(dataMode) {} - uint32_t _clock; - uint8_t _bitOrder; - uint8_t _dataMode; -}; - -class SPIClass -{ -private: - int8_t _spi_num; - spi_t * _spi; - bool _use_hw_ss; - int8_t _sck; - int8_t _miso; - int8_t _mosi; - int8_t _ss; - uint32_t _div; - uint32_t _freq; - bool _inTransaction; - void writePattern_(uint8_t * data, uint8_t size, uint8_t repeat); - -public: - SPIClass(uint8_t spi_bus=HSPI); - void begin(int8_t sck=-1, int8_t miso=-1, int8_t mosi=-1, int8_t ss=-1); - void end(); - - void setHwCs(bool use); - void setBitOrder(uint8_t bitOrder); - void setDataMode(uint8_t dataMode); - void setFrequency(uint32_t freq); - void setClockDivider(uint32_t clockDiv); - - uint32_t getClockDivider(); - - void beginTransaction(SPISettings settings); - void endTransaction(void); - void transfer(uint8_t * data, uint32_t size); - uint8_t transfer(uint8_t data); - uint16_t transfer16(uint16_t data); - uint32_t transfer32(uint32_t data); - - void transferBytes(uint8_t * data, uint8_t * out, uint32_t size); - void transferBits(uint32_t data, uint32_t * out, uint8_t bits); - - void write(uint8_t data); - void write16(uint16_t data); - void write32(uint32_t data); - void writeBytes(const uint8_t * data, uint32_t size); - void writePixels(const void * data, uint32_t size);//ili9341 compatible - void writePattern(uint8_t * data, uint8_t size, uint32_t repeat); - - spi_t * bus(){ return _spi; } -}; - -extern SPIClass SPI; - -#endif diff --git a/libraries/SPIFFS/examples/SPIFFS_Test/SPIFFS_Test.ino b/libraries/SPIFFS/examples/SPIFFS_Test/SPIFFS_Test.ino deleted file mode 100644 index cfc111dc22a..00000000000 --- a/libraries/SPIFFS/examples/SPIFFS_Test/SPIFFS_Test.ino +++ /dev/null @@ -1,178 +0,0 @@ -#include "FS.h" -#include "SPIFFS.h" - -/* You only need to format SPIFFS the first time you run a - test or else use the SPIFFS plugin to create a partition - https://github.com/me-no-dev/arduino-esp32fs-plugin */ -#define FORMAT_SPIFFS_IF_FAILED true - -void listDir(fs::FS &fs, const char * dirname, uint8_t levels){ - Serial.printf("Listing directory: %s\r\n", dirname); - - File root = fs.open(dirname); - if(!root){ - Serial.println("- failed to open directory"); - return; - } - if(!root.isDirectory()){ - Serial.println(" - not a directory"); - return; - } - - File file = root.openNextFile(); - while(file){ - if(file.isDirectory()){ - Serial.print(" DIR : "); - Serial.println(file.name()); - if(levels){ - listDir(fs, file.name(), levels -1); - } - } else { - Serial.print(" FILE: "); - Serial.print(file.name()); - Serial.print("\tSIZE: "); - Serial.println(file.size()); - } - file = root.openNextFile(); - } -} - -void readFile(fs::FS &fs, const char * path){ - Serial.printf("Reading file: %s\r\n", path); - - File file = fs.open(path); - if(!file || file.isDirectory()){ - Serial.println("- failed to open file for reading"); - return; - } - - Serial.println("- read from file:"); - while(file.available()){ - Serial.write(file.read()); - } -} - -void writeFile(fs::FS &fs, const char * path, const char * message){ - Serial.printf("Writing file: %s\r\n", path); - - File file = fs.open(path, FILE_WRITE); - if(!file){ - Serial.println("- failed to open file for writing"); - return; - } - if(file.print(message)){ - Serial.println("- file written"); - } else { - Serial.println("- frite failed"); - } -} - -void appendFile(fs::FS &fs, const char * path, const char * message){ - Serial.printf("Appending to file: %s\r\n", path); - - File file = fs.open(path, FILE_APPEND); - if(!file){ - Serial.println("- failed to open file for appending"); - return; - } - if(file.print(message)){ - Serial.println("- message appended"); - } else { - Serial.println("- append failed"); - } -} - -void renameFile(fs::FS &fs, const char * path1, const char * path2){ - Serial.printf("Renaming file %s to %s\r\n", path1, path2); - if (fs.rename(path1, path2)) { - Serial.println("- file renamed"); - } else { - Serial.println("- rename failed"); - } -} - -void deleteFile(fs::FS &fs, const char * path){ - Serial.printf("Deleting file: %s\r\n", path); - if(fs.remove(path)){ - Serial.println("- file deleted"); - } else { - Serial.println("- delete failed"); - } -} - -void testFileIO(fs::FS &fs, const char * path){ - Serial.printf("Testing file I/O with %s\r\n", path); - - static uint8_t buf[512]; - size_t len = 0; - File file = fs.open(path, FILE_WRITE); - if(!file){ - Serial.println("- failed to open file for writing"); - return; - } - - size_t i; - Serial.print("- writing" ); - uint32_t start = millis(); - for(i=0; i<2048; i++){ - if ((i & 0x001F) == 0x001F){ - Serial.print("."); - } - file.write(buf, 512); - } - Serial.println(""); - uint32_t end = millis() - start; - Serial.printf(" - %u bytes written in %u ms\r\n", 2048 * 512, end); - file.close(); - - file = fs.open(path); - start = millis(); - end = start; - i = 0; - if(file && !file.isDirectory()){ - len = file.size(); - size_t flen = len; - start = millis(); - Serial.print("- reading" ); - while(len){ - size_t toRead = len; - if(toRead > 512){ - toRead = 512; - } - file.read(buf, toRead); - if ((i++ & 0x001F) == 0x001F){ - Serial.print("."); - } - len -= toRead; - } - Serial.println(""); - end = millis() - start; - Serial.printf("- %u bytes read in %u ms\r\n", flen, end); - file.close(); - } else { - Serial.println("- failed to open file for reading"); - } -} - -void setup(){ - Serial.begin(115200); - if(!SPIFFS.begin(FORMAT_SPIFFS_IF_FAILED)){ - Serial.println("SPIFFS Mount Failed"); - return; - } - - listDir(SPIFFS, "/", 0); - writeFile(SPIFFS, "/hello.txt", "Hello "); - appendFile(SPIFFS, "/hello.txt", "World!\r\n"); - readFile(SPIFFS, "/hello.txt"); - renameFile(SPIFFS, "/hello.txt", "/foo.txt"); - readFile(SPIFFS, "/foo.txt"); - deleteFile(SPIFFS, "/foo.txt"); - testFileIO(SPIFFS, "/test.txt"); - deleteFile(SPIFFS, "/test.txt"); - Serial.println( "Test complete" ); -} - -void loop(){ - -} diff --git a/libraries/SPIFFS/examples/SPIFFS_time/SPIFFS_time.ino b/libraries/SPIFFS/examples/SPIFFS_time/SPIFFS_time.ino deleted file mode 100644 index 958e805ee95..00000000000 --- a/libraries/SPIFFS/examples/SPIFFS_time/SPIFFS_time.ino +++ /dev/null @@ -1,177 +0,0 @@ -#include "FS.h" -#include "SPIFFS.h" -#include -#include - -const char* ssid = "your-ssid"; -const char* password = "your-password"; - -long timezone = 1; -byte daysavetime = 1; - -void listDir(fs::FS &fs, const char * dirname, uint8_t levels){ - Serial.printf("Listing directory: %s\n", dirname); - - File root = fs.open(dirname); - if(!root){ - Serial.println("Failed to open directory"); - return; - } - if(!root.isDirectory()){ - Serial.println("Not a directory"); - return; - } - - File file = root.openNextFile(); - while(file){ - if(file.isDirectory()){ - Serial.print(" DIR : "); - Serial.print (file.name()); - time_t t= file.getLastWrite(); - struct tm * tmstruct = localtime(&t); - Serial.printf(" LAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n",(tmstruct->tm_year)+1900,( tmstruct->tm_mon)+1, tmstruct->tm_mday,tmstruct->tm_hour , tmstruct->tm_min, tmstruct->tm_sec); - if(levels){ - listDir(fs, file.name(), levels -1); - } - } else { - Serial.print(" FILE: "); - Serial.print(file.name()); - Serial.print(" SIZE: "); - Serial.print(file.size()); - time_t t= file.getLastWrite(); - struct tm * tmstruct = localtime(&t); - Serial.printf(" LAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n",(tmstruct->tm_year)+1900,( tmstruct->tm_mon)+1, tmstruct->tm_mday,tmstruct->tm_hour , tmstruct->tm_min, tmstruct->tm_sec); - } - file = root.openNextFile(); - } -} - -void createDir(fs::FS &fs, const char * path){ - Serial.printf("Creating Dir: %s\n", path); - if(fs.mkdir(path)){ - Serial.println("Dir created"); - } else { - Serial.println("mkdir failed"); - } -} - -void removeDir(fs::FS &fs, const char * path){ - Serial.printf("Removing Dir: %s\n", path); - if(fs.rmdir(path)){ - Serial.println("Dir removed"); - } else { - Serial.println("rmdir failed"); - } -} - -void readFile(fs::FS &fs, const char * path){ - Serial.printf("Reading file: %s\n", path); - - File file = fs.open(path); - if(!file){ - Serial.println("Failed to open file for reading"); - return; - } - - Serial.print("Read from file: "); - while(file.available()){ - Serial.write(file.read()); - } - file.close(); -} - -void writeFile(fs::FS &fs, const char * path, const char * message){ - Serial.printf("Writing file: %s\n", path); - - File file = fs.open(path, FILE_WRITE); - if(!file){ - Serial.println("Failed to open file for writing"); - return; - } - if(file.print(message)){ - Serial.println("File written"); - } else { - Serial.println("Write failed"); - } - file.close(); -} - -void appendFile(fs::FS &fs, const char * path, const char * message){ - Serial.printf("Appending to file: %s\n", path); - - File file = fs.open(path, FILE_APPEND); - if(!file){ - Serial.println("Failed to open file for appending"); - return; - } - if(file.print(message)){ - Serial.println("Message appended"); - } else { - Serial.println("Append failed"); - } - file.close(); -} - -void renameFile(fs::FS &fs, const char * path1, const char * path2){ - Serial.printf("Renaming file %s to %s\n", path1, path2); - if (fs.rename(path1, path2)) { - Serial.println("File renamed"); - } else { - Serial.println("Rename failed"); - } -} - -void deleteFile(fs::FS &fs, const char * path){ - Serial.printf("Deleting file: %s\n", path); - if(fs.remove(path)){ - Serial.println("File deleted"); - } else { - Serial.println("Delete failed"); - } -} - -void setup(){ - Serial.begin(115200); - // We start by connecting to a WiFi network - Serial.println(); - Serial.println(); - Serial.print("Connecting to "); - Serial.println(ssid); - - WiFi.begin(ssid, password); - - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - } - Serial.println("WiFi connected"); - Serial.println("IP address: "); - Serial.println(WiFi.localIP()); - Serial.println("Contacting Time Server"); - configTime(3600*timezone, daysavetime*3600, "time.nist.gov", "0.pool.ntp.org", "1.pool.ntp.org"); - struct tm tmstruct ; - delay(2000); - tmstruct.tm_year = 0; - getLocalTime(&tmstruct, 5000); - Serial.printf("\nNow is : %d-%02d-%02d %02d:%02d:%02d\n",(tmstruct.tm_year)+1900,( tmstruct.tm_mon)+1, tmstruct.tm_mday,tmstruct.tm_hour , tmstruct.tm_min, tmstruct.tm_sec); - Serial.println(""); - - if(!SPIFFS.begin()){ - Serial.println("Card Mount Failed"); - return; - } - - listDir(SPIFFS, "/", 0); - removeDir(SPIFFS, "/mydir"); - createDir(SPIFFS, "/mydir"); - deleteFile(SPIFFS, "/hello.txt"); - writeFile(SPIFFS, "/hello.txt", "Hello "); - appendFile(SPIFFS, "/hello.txt", "World!\n"); - listDir(SPIFFS, "/", 0); -} - -void loop(){ - -} - - diff --git a/libraries/SPIFFS/library.properties b/libraries/SPIFFS/library.properties deleted file mode 100644 index 9b011e50cc7..00000000000 --- a/libraries/SPIFFS/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=SPIFFS -version=1.0 -author=Hristo Gochkov, Ivan Grokhtkov -maintainer=Hristo Gochkov -sentence=ESP32 SPIFFS File System -paragraph= -category=Data Storage -url= -architectures=esp32 diff --git a/libraries/SPIFFS/src/SPIFFS.cpp b/libraries/SPIFFS/src/SPIFFS.cpp deleted file mode 100644 index db97fa2bf94..00000000000 --- a/libraries/SPIFFS/src/SPIFFS.cpp +++ /dev/null @@ -1,122 +0,0 @@ -// 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. - -#include "vfs_api.h" - -extern "C" { -#include -#include -#include -#include "esp_spiffs.h" -} - -#include "SPIFFS.h" - -using namespace fs; - -class SPIFFSImpl : public VFSImpl -{ -public: - SPIFFSImpl(); - virtual ~SPIFFSImpl() { } - virtual bool exists(const char* path); -}; - -SPIFFSImpl::SPIFFSImpl() -{ -} - -bool SPIFFSImpl::exists(const char* path) -{ - File f = open(path, "r"); - return (f == true) && !f.isDirectory(); -} - -SPIFFSFS::SPIFFSFS() : FS(FSImplPtr(new SPIFFSImpl())) -{ - -} - -bool SPIFFSFS::begin(bool formatOnFail, const char * basePath, uint8_t maxOpenFiles) -{ - if(esp_spiffs_mounted(NULL)){ - log_w("SPIFFS Already Mounted!"); - return true; - } - - esp_vfs_spiffs_conf_t conf = { - .base_path = basePath, - .partition_label = NULL, - .max_files = maxOpenFiles, - .format_if_mount_failed = false - }; - - esp_err_t err = esp_vfs_spiffs_register(&conf); - if(err == ESP_FAIL && formatOnFail){ - if(format()){ - err = esp_vfs_spiffs_register(&conf); - } - } - if(err != ESP_OK){ - log_e("Mounting SPIFFS failed! Error: %d", err); - return false; - } - _impl->mountpoint(basePath); - return true; -} - -void SPIFFSFS::end() -{ - if(esp_spiffs_mounted(NULL)){ - esp_err_t err = esp_vfs_spiffs_unregister(NULL); - if(err){ - log_e("Unmounting SPIFFS failed! Error: %d", err); - return; - } - _impl->mountpoint(NULL); - } -} - -bool SPIFFSFS::format() -{ - disableCore0WDT(); - esp_err_t err = esp_spiffs_format(NULL); - enableCore0WDT(); - if(err){ - log_e("Formatting SPIFFS failed! Error: %d", err); - return false; - } - return true; -} - -size_t SPIFFSFS::totalBytes() -{ - size_t total,used; - if(esp_spiffs_info(NULL, &total, &used)){ - return 0; - } - return total; -} - -size_t SPIFFSFS::usedBytes() -{ - size_t total,used; - if(esp_spiffs_info(NULL, &total, &used)){ - return 0; - } - return used; -} - -SPIFFSFS SPIFFS; - diff --git a/libraries/SPIFFS/src/SPIFFS.h b/libraries/SPIFFS/src/SPIFFS.h deleted file mode 100644 index 7d35da0439a..00000000000 --- a/libraries/SPIFFS/src/SPIFFS.h +++ /dev/null @@ -1,38 +0,0 @@ -// 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. -#ifndef _SPIFFS_H_ -#define _SPIFFS_H_ - -#include "FS.h" - -namespace fs -{ - -class SPIFFSFS : public FS -{ -public: - SPIFFSFS(); - bool begin(bool formatOnFail=false, const char * basePath="/spiffs", uint8_t maxOpenFiles=10); - bool format(); - size_t totalBytes(); - size_t usedBytes(); - void end(); -}; - -} - -extern fs::SPIFFSFS SPIFFS; - - -#endif diff --git a/libraries/SimpleBLE/examples/SimpleBleDevice/SimpleBleDevice.ino b/libraries/SimpleBLE/examples/SimpleBleDevice/SimpleBleDevice.ino deleted file mode 100644 index 3a9825a6b84..00000000000 --- a/libraries/SimpleBLE/examples/SimpleBleDevice/SimpleBleDevice.ino +++ /dev/null @@ -1,52 +0,0 @@ -// 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. - -// Sketch shows how to use SimpleBLE to advertise the name of the device and change it on the press of a button -// Useful if you want to advertise some sort of message -// Button is attached between GPIO 0 and GND, and the device name changes each time the button is pressed - -#include "SimpleBLE.h" - -#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED) -#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it -#endif - -SimpleBLE ble; - -void onButton(){ - String out = "BLE32 name: "; - out += String(millis() / 1000); - Serial.println(out); - ble.begin(out); -} - -void setup() { - Serial.begin(115200); - Serial.setDebugOutput(true); - pinMode(0, INPUT_PULLUP); - Serial.print("ESP32 SDK: "); - Serial.println(ESP.getSdkVersion()); - ble.begin("ESP32 SimpleBLE"); - Serial.println("Press the button to change the device's name"); -} - -void loop() { - static uint8_t lastPinState = 1; - uint8_t pinState = digitalRead(0); - if(!pinState && lastPinState){ - onButton(); - } - lastPinState = pinState; - while(Serial.available()) Serial.write(Serial.read()); -} diff --git a/libraries/SimpleBLE/library.properties b/libraries/SimpleBLE/library.properties deleted file mode 100644 index ec28494cdbb..00000000000 --- a/libraries/SimpleBLE/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=SimpleBLE -version=1.0 -author=Hristo Gochkov -maintainer=Hristo Gochkov -sentence=Provides really simple BLE advertizer with just on and off -paragraph= -category=Communication -url= -architectures=esp32 diff --git a/libraries/SimpleBLE/src/SimpleBLE.cpp b/libraries/SimpleBLE/src/SimpleBLE.cpp deleted file mode 100644 index d30a177fdf2..00000000000 --- a/libraries/SimpleBLE/src/SimpleBLE.cpp +++ /dev/null @@ -1,132 +0,0 @@ -// 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. - -#include "sdkconfig.h" - -#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) - -#include "SimpleBLE.h" -#include "esp32-hal-log.h" - -#include "esp_bt.h" -#include "esp_gap_ble_api.h" -#include "esp_gatts_api.h" -#include "esp_bt_defs.h" -#include "esp_bt_main.h" - -static esp_ble_adv_data_t _adv_config = { - .set_scan_rsp = false, - .include_name = true, - .include_txpower = true, - .min_interval = 512, - .max_interval = 1024, - .appearance = 0, - .manufacturer_len = 0, - .p_manufacturer_data = NULL, - .service_data_len = 0, - .p_service_data = NULL, - .service_uuid_len = 0, - .p_service_uuid = NULL, - .flag = (ESP_BLE_ADV_FLAG_GEN_DISC|ESP_BLE_ADV_FLAG_BREDR_NOT_SPT) -}; - -static esp_ble_adv_params_t _adv_params = { - .adv_int_min = 512, - .adv_int_max = 1024, - .adv_type = ADV_TYPE_NONCONN_IND, - .own_addr_type = BLE_ADDR_TYPE_PUBLIC, - .peer_addr = {0x00, }, - .peer_addr_type = BLE_ADDR_TYPE_PUBLIC, - .channel_map = ADV_CHNL_ALL, - .adv_filter_policy = ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY, -}; - -static void _on_gap(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param){ - if(event == ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT){ - esp_ble_gap_start_advertising(&_adv_params); - } -} - -static bool _init_gap(const char * name){ - if(!btStarted() && !btStart()){ - log_e("btStart failed"); - return false; - } - esp_bluedroid_status_t bt_state = esp_bluedroid_get_status(); - if(bt_state == ESP_BLUEDROID_STATUS_UNINITIALIZED){ - if (esp_bluedroid_init()) { - log_e("esp_bluedroid_init failed"); - return false; - } - } - if(bt_state != ESP_BLUEDROID_STATUS_ENABLED){ - if (esp_bluedroid_enable()) { - log_e("esp_bluedroid_enable failed"); - return false; - } - } - if(esp_ble_gap_set_device_name(name)){ - log_e("gap_set_device_name failed"); - return false; - } - if(esp_ble_gap_config_adv_data(&_adv_config)){ - log_e("gap_config_adv_data failed"); - return false; - } - if(esp_ble_gap_register_callback(_on_gap)){ - log_e("gap_register_callback failed"); - return false; - } - return true; -} - -static bool _stop_gap() -{ - if(btStarted()){ - esp_bluedroid_disable(); - esp_bluedroid_deinit(); - btStop(); - } - return true; -} - -/* - * BLE Arduino - * - * */ - -SimpleBLE::SimpleBLE() -{ - local_name = "esp32"; -} - -SimpleBLE::~SimpleBLE(void) -{ - _stop_gap(); -} - -bool SimpleBLE::begin(String localName) -{ - if(localName.length()){ - local_name = localName; - } - return _init_gap(local_name.c_str()); -} - -void SimpleBLE::end() -{ - _stop_gap(); -} - -#endif diff --git a/libraries/SimpleBLE/src/SimpleBLE.h b/libraries/SimpleBLE/src/SimpleBLE.h deleted file mode 100644 index 6e7b702da5a..00000000000 --- a/libraries/SimpleBLE/src/SimpleBLE.h +++ /dev/null @@ -1,65 +0,0 @@ -// 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. - -#ifndef _SIMPLE_BLE_H_ -#define _SIMPLE_BLE_H_ - -#include "sdkconfig.h" - -#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) - -#include -#include -#include -#include -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "esp_bt.h" - -#include "Arduino.h" - -struct ble_gap_adv_params_s; - -class SimpleBLE { - public: - - SimpleBLE(void); - ~SimpleBLE(void); - - /** - * Start BLE Advertising - * - * @param[in] localName local name to advertise - * - * @return true on success - * - */ - bool begin(String localName=String()); - - /** - * Stop BLE Advertising - * - * @return none - */ - void end(void); - - private: - String local_name; - private: - -}; - -#endif - -#endif diff --git a/libraries/Ticker/examples/Arguments/Arguments.ino b/libraries/Ticker/examples/Arguments/Arguments.ino deleted file mode 100644 index cde8acbfa09..00000000000 --- a/libraries/Ticker/examples/Arguments/Arguments.ino +++ /dev/null @@ -1,27 +0,0 @@ -#include -#include - -// attach a LED to GPIO 21 -#define LED_PIN 21 - -Ticker tickerSetHigh; -Ticker tickerSetLow; - -void setPin(int state) { - digitalWrite(LED_PIN, state); -} - -void setup() { - pinMode(LED_PIN, OUTPUT); - digitalWrite(1, LOW); - - // every 25 ms, call setPin(0) - tickerSetLow.attach_ms(25, setPin, 0); - - // every 26 ms, call setPin(1) - tickerSetHigh.attach_ms(26, setPin, 1); -} - -void loop() { - -} diff --git a/libraries/Ticker/examples/Blinker/Blinker.ino b/libraries/Ticker/examples/Blinker/Blinker.ino deleted file mode 100644 index aca1f450cca..00000000000 --- a/libraries/Ticker/examples/Blinker/Blinker.ino +++ /dev/null @@ -1,42 +0,0 @@ -#include -#include - -// attach a LED to pPIO 21 -#define LED_PIN 21 - -Ticker blinker; -Ticker toggler; -Ticker changer; -float blinkerPace = 0.1; //seconds -const float togglePeriod = 5; //seconds - -void change() { - blinkerPace = 0.5; -} - -void blink() { - digitalWrite(LED_PIN, !digitalRead(LED_PIN)); -} - -void toggle() { - static bool isBlinking = false; - if (isBlinking) { - blinker.detach(); - isBlinking = false; - } - else { - blinker.attach(blinkerPace, blink); - isBlinking = true; - } - digitalWrite(LED_PIN, LOW); //make sure LED on on after toggling (pin LOW = led ON) -} - -void setup() { - pinMode(LED_PIN, OUTPUT); - toggler.attach(togglePeriod, toggle); - changer.once(30, change); -} - -void loop() { - -} diff --git a/libraries/Ticker/keywords.txt b/libraries/Ticker/keywords.txt deleted file mode 100644 index 81cce2c8ea5..00000000000 --- a/libraries/Ticker/keywords.txt +++ /dev/null @@ -1,14 +0,0 @@ -####################################### -# Datatypes (KEYWORD1) -####################################### - -Ticker KEYWORD1 - -####################################### -# Methods and Functions (KEYWORD2) -####################################### - -attach KEYWORD2 -attach_ms KEYWORD2 -once KEYWORD2 -detach KEYWORD2 diff --git a/libraries/Ticker/library.properties b/libraries/Ticker/library.properties deleted file mode 100644 index 0f399447d4d..00000000000 --- a/libraries/Ticker/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=Ticker -version=1.1 -author=Bert Melis -maintainer=Hristo Gochkov -sentence=Allows to call functions with a given interval. -paragraph= -category=Timing -url= -architectures=esp32 diff --git a/libraries/Ticker/src/Ticker.cpp b/libraries/Ticker/src/Ticker.cpp deleted file mode 100644 index 1deeb7fb69f..00000000000 --- a/libraries/Ticker/src/Ticker.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - Ticker.cpp - esp32 library that calls functions periodically - - Copyright (c) 2017 Bert Melis. All rights reserved. - - Based on the original work of: - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - The original version is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "Ticker.h" - -Ticker::Ticker() : - _timer(nullptr) {} - -Ticker::~Ticker() { - detach(); -} - -void Ticker::_attach_ms(uint32_t milliseconds, bool repeat, callback_with_arg_t callback, uint32_t arg) { - esp_timer_create_args_t _timerConfig; - _timerConfig.arg = reinterpret_cast(arg); - _timerConfig.callback = callback; - _timerConfig.dispatch_method = ESP_TIMER_TASK; - _timerConfig.name = "Ticker"; - if (_timer) { - esp_timer_stop(_timer); - esp_timer_delete(_timer); - } - esp_timer_create(&_timerConfig, &_timer); - if (repeat) { - esp_timer_start_periodic(_timer, milliseconds * 1000ULL); - } else { - esp_timer_start_once(_timer, milliseconds * 1000ULL); - } -} - -void Ticker::detach() { - if (_timer) { - esp_timer_stop(_timer); - esp_timer_delete(_timer); - _timer = nullptr; - } -} diff --git a/libraries/Ticker/src/Ticker.h b/libraries/Ticker/src/Ticker.h deleted file mode 100644 index 82804e0f37d..00000000000 --- a/libraries/Ticker/src/Ticker.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - Ticker.h - esp32 library that calls functions periodically - - Copyright (c) 2017 Bert Melis. All rights reserved. - - Based on the original work of: - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - The original version is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef TICKER_H -#define TICKER_H - -extern "C" { - #include "esp_timer.h" -} - -class Ticker -{ -public: - Ticker(); - ~Ticker(); - typedef void (*callback_t)(void); - typedef void (*callback_with_arg_t)(void*); - - void attach(float seconds, callback_t callback) - { - _attach_ms(seconds * 1000, true, reinterpret_cast(callback), 0); - } - - void attach_ms(uint32_t milliseconds, callback_t callback) - { - _attach_ms(milliseconds, true, reinterpret_cast(callback), 0); - } - - template - void attach(float seconds, void (*callback)(TArg), TArg arg) - { - static_assert(sizeof(TArg) <= sizeof(uint32_t), "attach() callback argument size must be <= 4 bytes"); - // C-cast serves two purposes: - // static_cast for smaller integer types, - // reinterpret_cast + const_cast for pointer types - uint32_t arg32 = (uint32_t)arg; - _attach_ms(seconds * 1000, true, reinterpret_cast(callback), arg32); - } - - template - void attach_ms(uint32_t milliseconds, void (*callback)(TArg), TArg arg) - { - static_assert(sizeof(TArg) <= sizeof(uint32_t), "attach_ms() callback argument size must be <= 4 bytes"); - uint32_t arg32 = (uint32_t)arg; - _attach_ms(milliseconds, true, reinterpret_cast(callback), arg32); - } - - void once(float seconds, callback_t callback) - { - _attach_ms(seconds * 1000, false, reinterpret_cast(callback), 0); - } - - void once_ms(uint32_t milliseconds, callback_t callback) - { - _attach_ms(milliseconds, false, reinterpret_cast(callback), 0); - } - - template - void once(float seconds, void (*callback)(TArg), TArg arg) - { - static_assert(sizeof(TArg) <= sizeof(uint32_t), "attach() callback argument size must be <= 4 bytes"); - uint32_t arg32 = (uint32_t)(arg); - _attach_ms(seconds * 1000, false, reinterpret_cast(callback), arg32); - } - - template - void once_ms(uint32_t milliseconds, void (*callback)(TArg), TArg arg) - { - static_assert(sizeof(TArg) <= sizeof(uint32_t), "attach_ms() callback argument size must be <= 4 bytes"); - uint32_t arg32 = (uint32_t)(arg); - _attach_ms(milliseconds, false, reinterpret_cast(callback), arg32); - } - - void detach(); - bool active(); - -protected: - void _attach_ms(uint32_t milliseconds, bool repeat, callback_with_arg_t callback, uint32_t arg); - - -protected: - esp_timer_handle_t _timer; -}; - - -#endif // TICKER_H diff --git a/libraries/Update/examples/AWS_S3_OTA_Update/AWS_S3_OTA_Update.ino b/libraries/Update/examples/AWS_S3_OTA_Update/AWS_S3_OTA_Update.ino deleted file mode 100644 index 8582874f129..00000000000 --- a/libraries/Update/examples/AWS_S3_OTA_Update/AWS_S3_OTA_Update.ino +++ /dev/null @@ -1,283 +0,0 @@ -/** - AWS S3 OTA Update - Date: 14th June 2017 - Author: Arvind Ravulavaru - Purpose: Perform an OTA update from a bin located in Amazon S3 (HTTP Only) - - Upload: - Step 1 : Download the sample bin file from the examples folder - Step 2 : Upload it to your Amazon S3 account, in a bucket of your choice - Step 3 : Once uploaded, inside S3, select the bin file >> More (button on top of the file list) >> Make Public - Step 4 : You S3 URL => http://bucket-name.s3.ap-south-1.amazonaws.com/sketch-name.ino.bin - Step 5 : Build the above URL and fire it either in your browser or curl it `curl -I -v http://bucket-name.ap-south-1.amazonaws.com/sketch-name.ino.bin` to validate the same - Step 6: Plug in your SSID, Password, S3 Host and Bin file below - - Build & upload - Step 1 : Menu > Sketch > Export Compiled Library. The bin file will be saved in the sketch folder (Menu > Sketch > Show Sketch folder) - Step 2 : Upload bin to S3 and continue the above process - - // Check the bottom of this sketch for sample serial monitor log, during and after successful OTA Update -*/ - -#include -#include - -WiFiClient client; - -// Variables to validate -// response from S3 -long contentLength = 0; -bool isValidContentType = false; - -// Your SSID and PSWD that the chip needs -// to connect to -const char* SSID = "YOUR-SSID"; -const char* PSWD = "YOUR-SSID-PSWD"; - -// S3 Bucket Config -String host = "bucket-name.s3.ap-south-1.amazonaws.com"; // Host => bucket-name.s3.region.amazonaws.com -int port = 80; // Non https. For HTTPS 443. As of today, HTTPS doesn't work. -String bin = "/sketch-name.ino.bin"; // bin file name with a slash in front. - -// Utility to extract header value from headers -String getHeaderValue(String header, String headerName) { - return header.substring(strlen(headerName.c_str())); -} - -// OTA Logic -void execOTA() { - Serial.println("Connecting to: " + String(host)); - // Connect to S3 - if (client.connect(host.c_str(), port)) { - // Connection Succeed. - // Fecthing the bin - Serial.println("Fetching Bin: " + String(bin)); - - // Get the contents of the bin file - client.print(String("GET ") + bin + " HTTP/1.1\r\n" + - "Host: " + host + "\r\n" + - "Cache-Control: no-cache\r\n" + - "Connection: close\r\n\r\n"); - - // Check what is being sent - // Serial.print(String("GET ") + bin + " HTTP/1.1\r\n" + - // "Host: " + host + "\r\n" + - // "Cache-Control: no-cache\r\n" + - // "Connection: close\r\n\r\n"); - - unsigned long timeout = millis(); - while (client.available() == 0) { - if (millis() - timeout > 5000) { - Serial.println("Client Timeout !"); - client.stop(); - return; - } - } - // Once the response is available, - // check stuff - - /* - Response Structure - HTTP/1.1 200 OK - x-amz-id-2: NVKxnU1aIQMmpGKhSwpCBh8y2JPbak18QLIfE+OiUDOos+7UftZKjtCFqrwsGOZRN5Zee0jpTd0= - x-amz-request-id: 2D56B47560B764EC - Date: Wed, 14 Jun 2017 03:33:59 GMT - Last-Modified: Fri, 02 Jun 2017 14:50:11 GMT - ETag: "d2afebbaaebc38cd669ce36727152af9" - Accept-Ranges: bytes - Content-Type: application/octet-stream - Content-Length: 357280 - Server: AmazonS3 - - {{BIN FILE CONTENTS}} - - */ - while (client.available()) { - // read line till /n - String line = client.readStringUntil('\n'); - // remove space, to check if the line is end of headers - line.trim(); - - // if the the line is empty, - // this is end of headers - // break the while and feed the - // remaining `client` to the - // Update.writeStream(); - if (!line.length()) { - //headers ended - break; // and get the OTA started - } - - // Check if the HTTP Response is 200 - // else break and Exit Update - if (line.startsWith("HTTP/1.1")) { - if (line.indexOf("200") < 0) { - Serial.println("Got a non 200 status code from server. Exiting OTA Update."); - break; - } - } - - // extract headers here - // Start with content length - if (line.startsWith("Content-Length: ")) { - contentLength = atol((getHeaderValue(line, "Content-Length: ")).c_str()); - Serial.println("Got " + String(contentLength) + " bytes from server"); - } - - // Next, the content type - if (line.startsWith("Content-Type: ")) { - String contentType = getHeaderValue(line, "Content-Type: "); - Serial.println("Got " + contentType + " payload."); - if (contentType == "application/octet-stream") { - isValidContentType = true; - } - } - } - } else { - // Connect to S3 failed - // May be try? - // Probably a choppy network? - Serial.println("Connection to " + String(host) + " failed. Please check your setup"); - // retry?? - // execOTA(); - } - - // Check what is the contentLength and if content type is `application/octet-stream` - Serial.println("contentLength : " + String(contentLength) + ", isValidContentType : " + String(isValidContentType)); - - // check contentLength and content type - if (contentLength && isValidContentType) { - // Check if there is enough to OTA Update - bool canBegin = Update.begin(contentLength); - - // If yes, begin - if (canBegin) { - Serial.println("Begin OTA. This may take 2 - 5 mins to complete. Things might be quite for a while.. Patience!"); - // No activity would appear on the Serial monitor - // So be patient. This may take 2 - 5mins to complete - size_t written = Update.writeStream(client); - - if (written == contentLength) { - Serial.println("Written : " + String(written) + " successfully"); - } else { - Serial.println("Written only : " + String(written) + "/" + String(contentLength) + ". Retry?" ); - // retry?? - // execOTA(); - } - - if (Update.end()) { - Serial.println("OTA done!"); - if (Update.isFinished()) { - Serial.println("Update successfully completed. Rebooting."); - ESP.restart(); - } else { - Serial.println("Update not finished? Something went wrong!"); - } - } else { - Serial.println("Error Occurred. Error #: " + String(Update.getError())); - } - } else { - // not enough space to begin OTA - // Understand the partitions and - // space availability - Serial.println("Not enough space to begin OTA"); - client.flush(); - } - } else { - Serial.println("There was no content in the response"); - client.flush(); - } -} - -void setup() { - //Begin Serial - Serial.begin(115200); - delay(10); - - Serial.println("Connecting to " + String(SSID)); - - // Connect to provided SSID and PSWD - WiFi.begin(SSID, PSWD); - - // Wait for connection to establish - while (WiFi.status() != WL_CONNECTED) { - Serial.print("."); // Keep the serial monitor lit! - delay(500); - } - - // Connection Succeed - Serial.println(""); - Serial.println("Connected to " + String(SSID)); - - // Execute OTA Update - execOTA(); -} - -void loop() { - // chill -} - -/* - * Serial Monitor log for this sketch - * - * If the OTA succeeded, it would load the preference sketch, with a small modification. i.e. - * Print `OTA Update succeeded!! This is an example sketch : Preferences > StartCounter` - * And then keeps on restarting every 10 seconds, updating the preferences - * - * - rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) - configsip: 0, SPIWP:0x00 - clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 - mode:DIO, clock div:1 - load:0x3fff0008,len:8 - load:0x3fff0010,len:160 - load:0x40078000,len:10632 - load:0x40080000,len:252 - entry 0x40080034 - Connecting to SSID - ...... - Connected to SSID - Connecting to: bucket-name.s3.ap-south-1.amazonaws.com - Fetching Bin: /StartCounter.ino.bin - Got application/octet-stream payload. - Got 357280 bytes from server - contentLength : 357280, isValidContentType : 1 - Begin OTA. This may take 2 - 5 mins to complete. Things might be quite for a while.. Patience! - Written : 357280 successfully - OTA done! - Update successfully completed. Rebooting. - ets Jun 8 2016 00:22:57 - - rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) - configsip: 0, SPIWP:0x00 - clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 - mode:DIO, clock div:1 - load:0x3fff0008,len:8 - load:0x3fff0010,len:160 - load:0x40078000,len:10632 - load:0x40080000,len:252 - entry 0x40080034 - - OTA Update succeeded!! This is an example sketch : Preferences > StartCounter - Current counter value: 1 - Restarting in 10 seconds... - E (102534) wifi: esp_wifi_stop 802 wifi is not init - ets Jun 8 2016 00:22:57 - - rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) - configsip: 0, SPIWP:0x00 - clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 - mode:DIO, clock div:1 - load:0x3fff0008,len:8 - load:0x3fff0010,len:160 - load:0x40078000,len:10632 - load:0x40080000,len:252 - entry 0x40080034 - - OTA Update succeeded!! This is an example sketch : Preferences > StartCounter - Current counter value: 2 - Restarting in 10 seconds... - - .... - * - */ diff --git a/libraries/Update/examples/AWS_S3_OTA_Update/StartCounter.ino.bin b/libraries/Update/examples/AWS_S3_OTA_Update/StartCounter.ino.bin deleted file mode 100644 index 14732a0adb1..00000000000 Binary files a/libraries/Update/examples/AWS_S3_OTA_Update/StartCounter.ino.bin and /dev/null differ diff --git a/libraries/Update/examples/SD_Update/SD_Update.ino b/libraries/Update/examples/SD_Update/SD_Update.ino deleted file mode 100644 index 9f3f494aba8..00000000000 --- a/libraries/Update/examples/SD_Update/SD_Update.ino +++ /dev/null @@ -1,112 +0,0 @@ -/* - Name: SD_Update.ino - Created: 12.09.2017 15:07:17 - Author: Frederik Merz - Purpose: Update firmware from SD card - - Steps: - 1. Flash this image to the ESP32 an run it - 2. Copy update.bin to a SD-Card, you can basically - compile this or any other example - then copy and rename the app binary to the sd card root - 3. Connect SD-Card as shown in SD_MMC example, - this can also be adapted for SPI - 3. After successfull update and reboot, ESP32 shall start the new app -*/ - -#include -#include -#include - -// perform the actual update from a given stream -void performUpdate(Stream &updateSource, size_t updateSize) { - if (Update.begin(updateSize)) { - size_t written = Update.writeStream(updateSource); - if (written == updateSize) { - Serial.println("Written : " + String(written) + " successfully"); - } - else { - Serial.println("Written only : " + String(written) + "/" + String(updateSize) + ". Retry?"); - } - if (Update.end()) { - Serial.println("OTA done!"); - if (Update.isFinished()) { - Serial.println("Update successfully completed. Rebooting."); - } - else { - Serial.println("Update not finished? Something went wrong!"); - } - } - else { - Serial.println("Error Occurred. Error #: " + String(Update.getError())); - } - - } - else - { - Serial.println("Not enough space to begin OTA"); - } -} - -// check given FS for valid update.bin and perform update if available -void updateFromFS(fs::FS &fs) { - File updateBin = fs.open("/update.bin"); - if (updateBin) { - if(updateBin.isDirectory()){ - Serial.println("Error, update.bin is not a file"); - updateBin.close(); - return; - } - - size_t updateSize = updateBin.size(); - - if (updateSize > 0) { - Serial.println("Try to start update"); - performUpdate(updateBin, updateSize); - } - else { - Serial.println("Error, file is empty"); - } - - updateBin.close(); - - // whe finished remove the binary from sd card to indicate end of the process - fs.remove("/update.bin"); - } - else { - Serial.println("Could not load update.bin from sd root"); - } -} - -void setup() { - uint8_t cardType; - Serial.begin(115200); - Serial.println("Welcome to the SD-Update example!"); - - // You can uncomment this and build again - // Serial.println("Update successfull"); - - //first init and check SD card - if (!SD_MMC.begin()) { - rebootEspWithReason("Card Mount Failed"); - } - - cardType = SD_MMC.cardType(); - - if (cardType == CARD_NONE) { - rebootEspWithReason("No SD_MMC card attached"); - }else{ - updateFromFS(SD_MMC); - } -} - -void rebootEspWithReason(String reason){ - Serial.println(reason); - delay(1000); - ESP.restart(); -} - -//will not be reached -void loop() { - -} \ No newline at end of file diff --git a/libraries/Update/keywords.txt b/libraries/Update/keywords.txt deleted file mode 100644 index 95dd92591c8..00000000000 --- a/libraries/Update/keywords.txt +++ /dev/null @@ -1,24 +0,0 @@ -####################################### -# Syntax Coloring Map For Ultrasound -####################################### - -####################################### -# Datatypes (KEYWORD1) -####################################### - -Update KEYWORD1 - -####################################### -# Methods and Functions (KEYWORD2) -####################################### - -begin KEYWORD2 -end KEYWORD2 -write KEYWORD2 -writeStream KEYWORD2 -printError KEYWORD2 - -####################################### -# Constants (LITERAL1) -####################################### - diff --git a/libraries/Update/library.properties b/libraries/Update/library.properties deleted file mode 100644 index 666b1e425b6..00000000000 --- a/libraries/Update/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=Update -version=1.0 -author=Hristo Gochkov -maintainer=Hristo Gochkov -sentence=ESP32 Sketch Update Library -paragraph= -category=Other -url= -architectures=esp32 diff --git a/libraries/Update/src/Update.h b/libraries/Update/src/Update.h deleted file mode 100644 index 9a46a784870..00000000000 --- a/libraries/Update/src/Update.h +++ /dev/null @@ -1,186 +0,0 @@ -#ifndef ESP8266UPDATER_H -#define ESP8266UPDATER_H - -#include -#include -#include -#include "esp_partition.h" - -#define UPDATE_ERROR_OK (0) -#define UPDATE_ERROR_WRITE (1) -#define UPDATE_ERROR_ERASE (2) -#define UPDATE_ERROR_READ (3) -#define UPDATE_ERROR_SPACE (4) -#define UPDATE_ERROR_SIZE (5) -#define UPDATE_ERROR_STREAM (6) -#define UPDATE_ERROR_MD5 (7) -#define UPDATE_ERROR_MAGIC_BYTE (8) -#define UPDATE_ERROR_ACTIVATE (9) -#define UPDATE_ERROR_NO_PARTITION (10) -#define UPDATE_ERROR_BAD_ARGUMENT (11) -#define UPDATE_ERROR_ABORT (12) - -#define UPDATE_SIZE_UNKNOWN 0xFFFFFFFF - -#define U_FLASH 0 -#define U_SPIFFS 100 -#define U_AUTH 200 - -class UpdateClass { - public: - typedef std::function THandlerFunction_Progress; - - UpdateClass(); - - /* - This callback will be called when Update is receiving data - */ - UpdateClass& onProgress(THandlerFunction_Progress fn); - - /* - Call this to check the space needed for the update - Will return false if there is not enough space - */ - bool begin(size_t size=UPDATE_SIZE_UNKNOWN, int command = U_FLASH, int ledPin = -1, uint8_t ledOn = LOW); - - /* - Writes a buffer to the flash and increments the address - Returns the amount written - */ - size_t write(uint8_t *data, size_t len); - - /* - Writes the remaining bytes from the Stream to the flash - Uses readBytes() and sets UPDATE_ERROR_STREAM on timeout - Returns the bytes written - Should be equal to the remaining bytes when called - Usable for slow streams like Serial - */ - size_t writeStream(Stream &data); - - /* - If all bytes are written - this call will write the config to eboot - and return true - If there is already an update running but is not finished and !evenIfRemaining - or there is an error - this will clear everything and return false - the last error is available through getError() - evenIfRemaining is helpfull when you update without knowing the final size first - */ - bool end(bool evenIfRemaining = false); - - /* - Aborts the running update - */ - void abort(); - - /* - Prints the last error to an output stream - */ - void printError(Stream &out); - - const char * errorString(); - - /* - sets the expected MD5 for the firmware (hexString) - */ - bool setMD5(const char * expected_md5); - - /* - returns the MD5 String of the sucessfully ended firmware - */ - String md5String(void){ return _md5.toString(); } - - /* - populated the result with the md5 bytes of the sucessfully ended firmware - */ - void md5(uint8_t * result){ return _md5.getBytes(result); } - - //Helpers - uint8_t getError(){ return _error; } - void clearError(){ _error = UPDATE_ERROR_OK; } - bool hasError(){ return _error != UPDATE_ERROR_OK; } - bool isRunning(){ return _size > 0; } - bool isFinished(){ return _progress == _size; } - size_t size(){ return _size; } - size_t progress(){ return _progress; } - size_t remaining(){ return _size - _progress; } - - /* - Template to write from objects that expose - available() and read(uint8_t*, size_t) methods - faster than the writeStream method - writes only what is available - */ - template - size_t write(T &data){ - size_t written = 0; - if (hasError() || !isRunning()) - return 0; - - size_t available = data.available(); - while(available) { - if(_bufferLen + available > remaining()){ - available = remaining() - _bufferLen; - } - if(_bufferLen + available > 4096) { - size_t toBuff = 4096 - _bufferLen; - data.read(_buffer + _bufferLen, toBuff); - _bufferLen += toBuff; - if(!_writeBuffer()) - return written; - written += toBuff; - } else { - data.read(_buffer + _bufferLen, available); - _bufferLen += available; - written += available; - if(_bufferLen == remaining()) { - if(!_writeBuffer()) { - return written; - } - } - } - if(remaining() == 0) - return written; - available = data.available(); - } - return written; - } - - /* - check if there is a firmware on the other OTA partition that you can bootinto - */ - bool canRollBack(); - /* - set the other OTA partition as bootable (reboot to enable) - */ - bool rollBack(); - - private: - void _reset(); - void _abort(uint8_t err); - bool _writeBuffer(); - bool _verifyHeader(uint8_t data); - bool _verifyEnd(); - - - uint8_t _error; - uint8_t *_buffer; - size_t _bufferLen; - size_t _size; - THandlerFunction_Progress _progress_callback; - uint32_t _progress; - uint32_t _command; - const esp_partition_t* _partition; - - String _target_md5; - MD5Builder _md5; - - int _ledPin; - uint8_t _ledOn; -}; - -extern UpdateClass Update; - -#endif diff --git a/libraries/Update/src/Updater.cpp b/libraries/Update/src/Updater.cpp deleted file mode 100644 index cfa28827e96..00000000000 --- a/libraries/Update/src/Updater.cpp +++ /dev/null @@ -1,370 +0,0 @@ -#include "Update.h" -#include "Arduino.h" -#include "esp_spi_flash.h" -#include "esp_ota_ops.h" -#include "esp_image_format.h" - -static const char * _err2str(uint8_t _error){ - if(_error == UPDATE_ERROR_OK){ - return ("No Error"); - } else if(_error == UPDATE_ERROR_WRITE){ - return ("Flash Write Failed"); - } else if(_error == UPDATE_ERROR_ERASE){ - return ("Flash Erase Failed"); - } else if(_error == UPDATE_ERROR_READ){ - return ("Flash Read Failed"); - } else if(_error == UPDATE_ERROR_SPACE){ - return ("Not Enough Space"); - } else if(_error == UPDATE_ERROR_SIZE){ - return ("Bad Size Given"); - } else if(_error == UPDATE_ERROR_STREAM){ - return ("Stream Read Timeout"); - } else if(_error == UPDATE_ERROR_MD5){ - return ("MD5 Check Failed"); - } else if(_error == UPDATE_ERROR_MAGIC_BYTE){ - return ("Wrong Magic Byte"); - } else if(_error == UPDATE_ERROR_ACTIVATE){ - return ("Could Not Activate The Firmware"); - } else if(_error == UPDATE_ERROR_NO_PARTITION){ - return ("Partition Could Not be Found"); - } else if(_error == UPDATE_ERROR_BAD_ARGUMENT){ - return ("Bad Argument"); - } else if(_error == UPDATE_ERROR_ABORT){ - return ("Aborted"); - } - return ("UNKNOWN"); -} - -static bool _partitionIsBootable(const esp_partition_t* partition){ - uint8_t buf[4]; - if(!partition){ - return false; - } - if(!ESP.flashRead(partition->address, (uint32_t*)buf, 4)) { - return false; - } - - if(buf[0] != ESP_IMAGE_HEADER_MAGIC) { - return false; - } - return true; -} - -static bool _enablePartition(const esp_partition_t* partition){ - uint8_t buf[4]; - if(!partition){ - return false; - } - if(!ESP.flashRead(partition->address, (uint32_t*)buf, 4)) { - return false; - } - buf[0] = ESP_IMAGE_HEADER_MAGIC; - - return ESP.flashWrite(partition->address, (uint32_t*)buf, 4); -} - -UpdateClass::UpdateClass() -: _error(0) -, _buffer(0) -, _bufferLen(0) -, _size(0) -, _progress_callback(NULL) -, _progress(0) -, _command(U_FLASH) -, _partition(NULL) -{ -} - -UpdateClass& UpdateClass::onProgress(THandlerFunction_Progress fn) { - _progress_callback = fn; - return *this; -} - -void UpdateClass::_reset() { - if (_buffer) - delete[] _buffer; - _buffer = 0; - _bufferLen = 0; - _progress = 0; - _size = 0; - _command = U_FLASH; - - if(_ledPin != -1) { - digitalWrite(_ledPin, !_ledOn); // off - } -} - -bool UpdateClass::canRollBack(){ - if(_buffer){ //Update is running - return false; - } - const esp_partition_t* partition = esp_ota_get_next_update_partition(NULL); - return _partitionIsBootable(partition); -} - -bool UpdateClass::rollBack(){ - if(_buffer){ //Update is running - return false; - } - const esp_partition_t* partition = esp_ota_get_next_update_partition(NULL); - return _partitionIsBootable(partition) && !esp_ota_set_boot_partition(partition); -} - -bool UpdateClass::begin(size_t size, int command, int ledPin, uint8_t ledOn) { - if(_size > 0){ - log_w("already running"); - return false; - } - - _ledPin = ledPin; - _ledOn = !!ledOn; // 0(LOW) or 1(HIGH) - - _reset(); - _error = 0; - - if(size == 0) { - _error = UPDATE_ERROR_SIZE; - return false; - } - - if (command == U_FLASH) { - _partition = esp_ota_get_next_update_partition(NULL); - if(!_partition){ - _error = UPDATE_ERROR_NO_PARTITION; - return false; - } - log_d("OTA Partition: %s", _partition->label); - } - else if (command == U_SPIFFS) { - _partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_SPIFFS, NULL); - if(!_partition){ - _error = UPDATE_ERROR_NO_PARTITION; - return false; - } - } - else { - _error = UPDATE_ERROR_BAD_ARGUMENT; - log_e("bad command %u", command); - return false; - } - - if(size == UPDATE_SIZE_UNKNOWN){ - size = _partition->size; - } else if(size > _partition->size){ - _error = UPDATE_ERROR_SIZE; - log_e("too large %u > %u", size, _partition->size); - return false; - } - - //initialize - _buffer = (uint8_t*)malloc(SPI_FLASH_SEC_SIZE); - if(!_buffer){ - log_e("malloc failed"); - return false; - } - _size = size; - _command = command; - _md5.begin(); - return true; -} - -void UpdateClass::_abort(uint8_t err){ - _reset(); - _error = err; -} - -void UpdateClass::abort(){ - _abort(UPDATE_ERROR_ABORT); -} - -bool UpdateClass::_writeBuffer(){ - //first bytes of new firmware - if(!_progress && _command == U_FLASH){ - //check magic - if(_buffer[0] != ESP_IMAGE_HEADER_MAGIC){ - _abort(UPDATE_ERROR_MAGIC_BYTE); - return false; - } - //remove magic byte from the firmware now and write it upon success - //this ensures that partially written firmware will not be bootable - _buffer[0] = 0xFF; - } - if (!_progress && _progress_callback) { - _progress_callback(0, _size); - } - if(!ESP.flashEraseSector((_partition->address + _progress)/SPI_FLASH_SEC_SIZE)){ - _abort(UPDATE_ERROR_ERASE); - return false; - } - if (!ESP.flashWrite(_partition->address + _progress, (uint32_t*)_buffer, _bufferLen)) { - _abort(UPDATE_ERROR_WRITE); - return false; - } - //restore magic or md5 will fail - if(!_progress && _command == U_FLASH){ - _buffer[0] = ESP_IMAGE_HEADER_MAGIC; - } - _md5.add(_buffer, _bufferLen); - _progress += _bufferLen; - _bufferLen = 0; - if (_progress_callback) { - _progress_callback(_progress, _size); - } - return true; -} - -bool UpdateClass::_verifyHeader(uint8_t data) { - if(_command == U_FLASH) { - if(data != ESP_IMAGE_HEADER_MAGIC) { - _abort(UPDATE_ERROR_MAGIC_BYTE); - return false; - } - return true; - } else if(_command == U_SPIFFS) { - return true; - } - return false; -} - -bool UpdateClass::_verifyEnd() { - if(_command == U_FLASH) { - if(!_enablePartition(_partition) || !_partitionIsBootable(_partition)) { - _abort(UPDATE_ERROR_READ); - return false; - } - - if(esp_ota_set_boot_partition(_partition)){ - _abort(UPDATE_ERROR_ACTIVATE); - return false; - } - _reset(); - return true; - } else if(_command == U_SPIFFS) { - _reset(); - return true; - } - return false; -} - -bool UpdateClass::setMD5(const char * expected_md5){ - if(strlen(expected_md5) != 32) - { - return false; - } - _target_md5 = expected_md5; - return true; -} - -bool UpdateClass::end(bool evenIfRemaining){ - if(hasError() || _size == 0){ - return false; - } - - if(!isFinished() && !evenIfRemaining){ - log_e("premature end: res:%u, pos:%u/%u\n", getError(), progress(), _size); - _abort(UPDATE_ERROR_ABORT); - return false; - } - - if(evenIfRemaining) { - if(_bufferLen > 0) { - _writeBuffer(); - } - _size = progress(); - } - - _md5.calculate(); - if(_target_md5.length()) { - if(_target_md5 != _md5.toString()){ - _abort(UPDATE_ERROR_MD5); - return false; - } - } - - return _verifyEnd(); -} - -size_t UpdateClass::write(uint8_t *data, size_t len) { - if(hasError() || !isRunning()){ - return 0; - } - - if(len > remaining()){ - _abort(UPDATE_ERROR_SPACE); - return 0; - } - - size_t left = len; - - while((_bufferLen + left) > SPI_FLASH_SEC_SIZE) { - size_t toBuff = SPI_FLASH_SEC_SIZE - _bufferLen; - memcpy(_buffer + _bufferLen, data + (len - left), toBuff); - _bufferLen += toBuff; - if(!_writeBuffer()){ - return len - left; - } - left -= toBuff; - } - memcpy(_buffer + _bufferLen, data + (len - left), left); - _bufferLen += left; - if(_bufferLen == remaining()){ - if(!_writeBuffer()){ - return len - left; - } - } - return len; -} - -size_t UpdateClass::writeStream(Stream &data) { - size_t written = 0; - size_t toRead = 0; - if(hasError() || !isRunning()) - return 0; - - if(!_verifyHeader(data.peek())) { - _reset(); - return 0; - } - - if(_ledPin != -1) { - pinMode(_ledPin, OUTPUT); - } - - while(remaining()) { - if(_ledPin != -1) { - digitalWrite(_ledPin, _ledOn); // Switch LED on - } - size_t bytesToRead = SPI_FLASH_SEC_SIZE - _bufferLen; - if(bytesToRead > remaining()) { - bytesToRead = remaining(); - } - - toRead = data.readBytes(_buffer + _bufferLen, bytesToRead); - if(toRead == 0) { //Timeout - delay(100); - toRead = data.readBytes(_buffer + _bufferLen, bytesToRead); - if(toRead == 0) { //Timeout - _abort(UPDATE_ERROR_STREAM); - return written; - } - } - if(_ledPin != -1) { - digitalWrite(_ledPin, !_ledOn); // Switch LED off - } - _bufferLen += toRead; - if((_bufferLen == remaining() || _bufferLen == SPI_FLASH_SEC_SIZE) && !_writeBuffer()) - return written; - written += toRead; - } - return written; -} - -void UpdateClass::printError(Stream &out){ - out.println(_err2str(_error)); -} - -const char * UpdateClass::errorString(){ - return _err2str(_error); -} - -UpdateClass Update; diff --git a/libraries/WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino b/libraries/WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino deleted file mode 100644 index 88ad6c8a08d..00000000000 --- a/libraries/WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino +++ /dev/null @@ -1,146 +0,0 @@ -/* - Copyright (c) 2015, Majenko Technologies - All rights reserved. - - 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 Majenko Technologies 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 HOLDER 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. -*/ - -#include -#include -#include -#include - -const char *ssid = "YourSSIDHere"; -const char *password = "YourPSKHere"; - -WebServer server(80); - -const int led = 13; - -void handleRoot() { - digitalWrite(led, 1); - char temp[400]; - int sec = millis() / 1000; - int min = sec / 60; - int hr = min / 60; - - snprintf(temp, 400, - - "\ - \ - \ - ESP32 Demo\ - \ - \ - \ -

Hello from ESP32!

\ -

Uptime: %02d:%02d:%02d

\ - \ - \ -", - - hr, min % 60, sec % 60 - ); - server.send(200, "text/html", temp); - digitalWrite(led, 0); -} - -void handleNotFound() { - digitalWrite(led, 1); - String message = "File Not Found\n\n"; - message += "URI: "; - message += server.uri(); - message += "\nMethod: "; - message += (server.method() == HTTP_GET) ? "GET" : "POST"; - message += "\nArguments: "; - message += server.args(); - message += "\n"; - - for (uint8_t i = 0; i < server.args(); i++) { - message += " " + server.argName(i) + ": " + server.arg(i) + "\n"; - } - - server.send(404, "text/plain", message); - digitalWrite(led, 0); -} - -void setup(void) { - pinMode(led, OUTPUT); - digitalWrite(led, 0); - Serial.begin(115200); - WiFi.mode(WIFI_STA); - WiFi.begin(ssid, password); - Serial.println(""); - - // Wait for connection - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - } - - Serial.println(""); - Serial.print("Connected to "); - Serial.println(ssid); - Serial.print("IP address: "); - Serial.println(WiFi.localIP()); - - if (MDNS.begin("esp32")) { - Serial.println("MDNS responder started"); - } - - server.on("/", handleRoot); - server.on("/test.svg", drawGraph); - server.on("/inline", []() { - server.send(200, "text/plain", "this works as well"); - }); - server.onNotFound(handleNotFound); - server.begin(); - Serial.println("HTTP server started"); -} - -void loop(void) { - server.handleClient(); -} - -void drawGraph() { - String out = ""; - char temp[100]; - out += "\n"; - out += "\n"; - out += "\n"; - int y = rand() % 130; - for (int x = 10; x < 390; x += 10) { - int y2 = rand() % 130; - sprintf(temp, "\n", x, 140 - y, x + 10, 140 - y2); - out += temp; - y = y2; - } - out += "\n\n"; - - server.send(200, "image/svg+xml", out); -} diff --git a/libraries/WebServer/examples/FSBrowser/FSBrowser.ino b/libraries/WebServer/examples/FSBrowser/FSBrowser.ino deleted file mode 100644 index f49ae81c158..00000000000 --- a/libraries/WebServer/examples/FSBrowser/FSBrowser.ino +++ /dev/null @@ -1,303 +0,0 @@ -/* - FSWebServer - Example WebServer with FS backend for esp8266/esp32 - Copyright (c) 2015 Hristo Gochkov. All rights reserved. - This file is part of the WebServer library for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - upload the contents of the data folder with MkSPIFFS Tool ("ESP32 Sketch Data Upload" in Tools menu in Arduino IDE) - or you can upload the contents of a folder if you CD in that folder and run the following command: - for file in `ls -A1`; do curl -F "file=@$PWD/$file" esp32fs.local/edit; done - - access the sample web page at http://esp32fs.local - edit the page by going to http://esp32fs.local/edit -*/ -#include -#include -#include -#include - -#define FILESYSTEM SPIFFS -// You only need to format the filesystem once -#define FORMAT_FILESYSTEM false -#define DBG_OUTPUT_PORT Serial - -#if FILESYSTEM == FFat -#include -#endif -#if FILESYSTEM == SPIFFS -#include -#endif - -const char* ssid = "wifi-ssid"; -const char* password = "wifi-password"; -const char* host = "esp32fs"; -WebServer server(80); -//holds the current upload -File fsUploadFile; - -//format bytes -String formatBytes(size_t bytes) { - if (bytes < 1024) { - return String(bytes) + "B"; - } else if (bytes < (1024 * 1024)) { - return String(bytes / 1024.0) + "KB"; - } else if (bytes < (1024 * 1024 * 1024)) { - return String(bytes / 1024.0 / 1024.0) + "MB"; - } else { - return String(bytes / 1024.0 / 1024.0 / 1024.0) + "GB"; - } -} - -String getContentType(String filename) { - if (server.hasArg("download")) { - return "application/octet-stream"; - } else if (filename.endsWith(".htm")) { - return "text/html"; - } else if (filename.endsWith(".html")) { - return "text/html"; - } else if (filename.endsWith(".css")) { - return "text/css"; - } else if (filename.endsWith(".js")) { - return "application/javascript"; - } else if (filename.endsWith(".png")) { - return "image/png"; - } else if (filename.endsWith(".gif")) { - return "image/gif"; - } else if (filename.endsWith(".jpg")) { - return "image/jpeg"; - } else if (filename.endsWith(".ico")) { - return "image/x-icon"; - } else if (filename.endsWith(".xml")) { - return "text/xml"; - } else if (filename.endsWith(".pdf")) { - return "application/x-pdf"; - } else if (filename.endsWith(".zip")) { - return "application/x-zip"; - } else if (filename.endsWith(".gz")) { - return "application/x-gzip"; - } - return "text/plain"; -} - -bool exists(String path){ - bool yes = false; - File file = FILESYSTEM.open(path, "r"); - if(!file.isDirectory()){ - yes = true; - } - file.close(); - return yes; -} - -bool handleFileRead(String path) { - DBG_OUTPUT_PORT.println("handleFileRead: " + path); - if (path.endsWith("/")) { - path += "index.htm"; - } - String contentType = getContentType(path); - String pathWithGz = path + ".gz"; - if (exists(pathWithGz) || exists(path)) { - if (exists(pathWithGz)) { - path += ".gz"; - } - File file = FILESYSTEM.open(path, "r"); - server.streamFile(file, contentType); - file.close(); - return true; - } - return false; -} - -void handleFileUpload() { - if (server.uri() != "/edit") { - return; - } - HTTPUpload& upload = server.upload(); - if (upload.status == UPLOAD_FILE_START) { - String filename = upload.filename; - if (!filename.startsWith("/")) { - filename = "/" + filename; - } - DBG_OUTPUT_PORT.print("handleFileUpload Name: "); DBG_OUTPUT_PORT.println(filename); - fsUploadFile = FILESYSTEM.open(filename, "w"); - filename = String(); - } else if (upload.status == UPLOAD_FILE_WRITE) { - //DBG_OUTPUT_PORT.print("handleFileUpload Data: "); DBG_OUTPUT_PORT.println(upload.currentSize); - if (fsUploadFile) { - fsUploadFile.write(upload.buf, upload.currentSize); - } - } else if (upload.status == UPLOAD_FILE_END) { - if (fsUploadFile) { - fsUploadFile.close(); - } - DBG_OUTPUT_PORT.print("handleFileUpload Size: "); DBG_OUTPUT_PORT.println(upload.totalSize); - } -} - -void handleFileDelete() { - if (server.args() == 0) { - return server.send(500, "text/plain", "BAD ARGS"); - } - String path = server.arg(0); - DBG_OUTPUT_PORT.println("handleFileDelete: " + path); - if (path == "/") { - return server.send(500, "text/plain", "BAD PATH"); - } - if (!exists(path)) { - return server.send(404, "text/plain", "FileNotFound"); - } - FILESYSTEM.remove(path); - server.send(200, "text/plain", ""); - path = String(); -} - -void handleFileCreate() { - if (server.args() == 0) { - return server.send(500, "text/plain", "BAD ARGS"); - } - String path = server.arg(0); - DBG_OUTPUT_PORT.println("handleFileCreate: " + path); - if (path == "/") { - return server.send(500, "text/plain", "BAD PATH"); - } - if (exists(path)) { - return server.send(500, "text/plain", "FILE EXISTS"); - } - File file = FILESYSTEM.open(path, "w"); - if (file) { - file.close(); - } else { - return server.send(500, "text/plain", "CREATE FAILED"); - } - server.send(200, "text/plain", ""); - path = String(); -} - -void handleFileList() { - if (!server.hasArg("dir")) { - server.send(500, "text/plain", "BAD ARGS"); - return; - } - - String path = server.arg("dir"); - DBG_OUTPUT_PORT.println("handleFileList: " + path); - - - File root = FILESYSTEM.open(path); - path = String(); - - String output = "["; - if(root.isDirectory()){ - File file = root.openNextFile(); - while(file){ - if (output != "[") { - output += ','; - } - output += "{\"type\":\""; - output += (file.isDirectory()) ? "dir" : "file"; - output += "\",\"name\":\""; - output += String(file.name()).substring(1); - output += "\"}"; - file = root.openNextFile(); - } - } - output += "]"; - server.send(200, "text/json", output); -} - -void setup(void) { - DBG_OUTPUT_PORT.begin(115200); - DBG_OUTPUT_PORT.print("\n"); - DBG_OUTPUT_PORT.setDebugOutput(true); - if (FORMAT_FILESYSTEM) FILESYSTEM.format(); - FILESYSTEM.begin(); - { - File root = FILESYSTEM.open("/"); - File file = root.openNextFile(); - while(file){ - String fileName = file.name(); - size_t fileSize = file.size(); - DBG_OUTPUT_PORT.printf("FS File: %s, size: %s\n", fileName.c_str(), formatBytes(fileSize).c_str()); - file = root.openNextFile(); - } - DBG_OUTPUT_PORT.printf("\n"); - } - - - //WIFI INIT - DBG_OUTPUT_PORT.printf("Connecting to %s\n", ssid); - if (String(WiFi.SSID()) != String(ssid)) { - WiFi.mode(WIFI_STA); - WiFi.begin(ssid, password); - } - - while (WiFi.status() != WL_CONNECTED) { - delay(500); - DBG_OUTPUT_PORT.print("."); - } - DBG_OUTPUT_PORT.println(""); - DBG_OUTPUT_PORT.print("Connected! IP address: "); - DBG_OUTPUT_PORT.println(WiFi.localIP()); - - MDNS.begin(host); - DBG_OUTPUT_PORT.print("Open http://"); - DBG_OUTPUT_PORT.print(host); - DBG_OUTPUT_PORT.println(".local/edit to see the file browser"); - - - //SERVER INIT - //list directory - server.on("/list", HTTP_GET, handleFileList); - //load editor - server.on("/edit", HTTP_GET, []() { - if (!handleFileRead("/edit.htm")) { - server.send(404, "text/plain", "FileNotFound"); - } - }); - //create file - server.on("/edit", HTTP_PUT, handleFileCreate); - //delete file - server.on("/edit", HTTP_DELETE, handleFileDelete); - //first callback is called after the request has ended with all parsed arguments - //second callback handles file uploads at that location - server.on("/edit", HTTP_POST, []() { - server.send(200, "text/plain", ""); - }, handleFileUpload); - - //called when the url is not defined here - //use it to load content from FILESYSTEM - server.onNotFound([]() { - if (!handleFileRead(server.uri())) { - server.send(404, "text/plain", "FileNotFound"); - } - }); - - //get heap status, analog input value and all GPIO statuses in one json call - server.on("/all", HTTP_GET, []() { - String json = "{"; - json += "\"heap\":" + String(ESP.getFreeHeap()); - json += ", \"analog\":" + String(analogRead(A0)); - json += ", \"gpio\":" + String((uint32_t)(0)); - json += "}"; - server.send(200, "text/json", json); - json = String(); - }); - server.begin(); - DBG_OUTPUT_PORT.println("HTTP server started"); - -} - -void loop(void) { - server.handleClient(); -} diff --git a/libraries/WebServer/examples/FSBrowser/data/edit.htm.gz b/libraries/WebServer/examples/FSBrowser/data/edit.htm.gz deleted file mode 100644 index 69ce414f47f..00000000000 Binary files a/libraries/WebServer/examples/FSBrowser/data/edit.htm.gz and /dev/null differ diff --git a/libraries/WebServer/examples/FSBrowser/data/favicon.ico b/libraries/WebServer/examples/FSBrowser/data/favicon.ico deleted file mode 100644 index 71b25fe6ee6..00000000000 Binary files a/libraries/WebServer/examples/FSBrowser/data/favicon.ico and /dev/null differ diff --git a/libraries/WebServer/examples/FSBrowser/data/graphs.js.gz b/libraries/WebServer/examples/FSBrowser/data/graphs.js.gz deleted file mode 100644 index 72435445a7e..00000000000 Binary files a/libraries/WebServer/examples/FSBrowser/data/graphs.js.gz and /dev/null differ diff --git a/libraries/WebServer/examples/FSBrowser/data/index.htm b/libraries/WebServer/examples/FSBrowser/data/index.htm deleted file mode 100644 index 9cb560cb0b0..00000000000 --- a/libraries/WebServer/examples/FSBrowser/data/index.htm +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - ESP Monitor - - - - -
- - - - -
-
-
-
- - \ No newline at end of file diff --git a/libraries/WebServer/examples/HelloServer/HelloServer.ino b/libraries/WebServer/examples/HelloServer/HelloServer.ino deleted file mode 100644 index f67b049c3ce..00000000000 --- a/libraries/WebServer/examples/HelloServer/HelloServer.ino +++ /dev/null @@ -1,73 +0,0 @@ -#include -#include -#include -#include - -const char* ssid = "........"; -const char* password = "........"; - -WebServer server(80); - -const int led = 13; - -void handleRoot() { - digitalWrite(led, 1); - server.send(200, "text/plain", "hello from esp8266!"); - digitalWrite(led, 0); -} - -void handleNotFound() { - digitalWrite(led, 1); - String message = "File Not Found\n\n"; - message += "URI: "; - message += server.uri(); - message += "\nMethod: "; - message += (server.method() == HTTP_GET) ? "GET" : "POST"; - message += "\nArguments: "; - message += server.args(); - message += "\n"; - for (uint8_t i = 0; i < server.args(); i++) { - message += " " + server.argName(i) + ": " + server.arg(i) + "\n"; - } - server.send(404, "text/plain", message); - digitalWrite(led, 0); -} - -void setup(void) { - pinMode(led, OUTPUT); - digitalWrite(led, 0); - Serial.begin(115200); - WiFi.mode(WIFI_STA); - WiFi.begin(ssid, password); - Serial.println(""); - - // Wait for connection - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - } - Serial.println(""); - Serial.print("Connected to "); - Serial.println(ssid); - Serial.print("IP address: "); - Serial.println(WiFi.localIP()); - - if (MDNS.begin("esp32")) { - Serial.println("MDNS responder started"); - } - - server.on("/", handleRoot); - - server.on("/inline", []() { - server.send(200, "text/plain", "this works as well"); - }); - - server.onNotFound(handleNotFound); - - server.begin(); - Serial.println("HTTP server started"); -} - -void loop(void) { - server.handleClient(); -} diff --git a/libraries/WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino b/libraries/WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino deleted file mode 100644 index 567fd487863..00000000000 --- a/libraries/WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino +++ /dev/null @@ -1,59 +0,0 @@ -/* - HTTP Advanced Authentication example - Created Mar 16, 2017 by Ahmed El-Sharnoby. - This example code is in the public domain. -*/ - -#include -#include -#include -#include - -const char* ssid = "........"; -const char* password = "........"; - -WebServer server(80); - -const char* www_username = "admin"; -const char* www_password = "esp32"; -// allows you to set the realm of authentication Default:"Login Required" -const char* www_realm = "Custom Auth Realm"; -// the Content of the HTML response in case of Unautherized Access Default:empty -String authFailResponse = "Authentication Failed"; - -void setup() { - Serial.begin(115200); - WiFi.mode(WIFI_STA); - WiFi.begin(ssid, password); - if (WiFi.waitForConnectResult() != WL_CONNECTED) { - Serial.println("WiFi Connect Failed! Rebooting..."); - delay(1000); - ESP.restart(); - } - ArduinoOTA.begin(); - - server.on("/", []() { - if (!server.authenticate(www_username, www_password)) - //Basic Auth Method with Custom realm and Failure Response - //return server.requestAuthentication(BASIC_AUTH, www_realm, authFailResponse); - //Digest Auth Method with realm="Login Required" and empty Failure Response - //return server.requestAuthentication(DIGEST_AUTH); - //Digest Auth Method with Custom realm and empty Failure Response - //return server.requestAuthentication(DIGEST_AUTH, www_realm); - //Digest Auth Method with Custom realm and Failure Response - { - return server.requestAuthentication(DIGEST_AUTH, www_realm, authFailResponse); - } - server.send(200, "text/plain", "Login OK"); - }); - server.begin(); - - Serial.print("Open http://"); - Serial.print(WiFi.localIP()); - Serial.println("/ in your browser to see it working"); -} - -void loop() { - ArduinoOTA.handle(); - server.handleClient(); -} diff --git a/libraries/WebServer/examples/HttpBasicAuth/HttpBasicAuth.ino b/libraries/WebServer/examples/HttpBasicAuth/HttpBasicAuth.ino deleted file mode 100644 index 7a7dcc9a5e3..00000000000 --- a/libraries/WebServer/examples/HttpBasicAuth/HttpBasicAuth.ino +++ /dev/null @@ -1,41 +0,0 @@ -#include -#include -#include -#include - -const char* ssid = "........"; -const char* password = "........"; - -WebServer server(80); - -const char* www_username = "admin"; -const char* www_password = "esp32"; - -void setup() { - Serial.begin(115200); - WiFi.mode(WIFI_STA); - WiFi.begin(ssid, password); - if (WiFi.waitForConnectResult() != WL_CONNECTED) { - Serial.println("WiFi Connect Failed! Rebooting..."); - delay(1000); - ESP.restart(); - } - ArduinoOTA.begin(); - - server.on("/", []() { - if (!server.authenticate(www_username, www_password)) { - return server.requestAuthentication(); - } - server.send(200, "text/plain", "Login OK"); - }); - server.begin(); - - Serial.print("Open http://"); - Serial.print(WiFi.localIP()); - Serial.println("/ in your browser to see it working"); -} - -void loop() { - ArduinoOTA.handle(); - server.handleClient(); -} diff --git a/libraries/WebServer/examples/PathArgServer/PathArgServer.ino b/libraries/WebServer/examples/PathArgServer/PathArgServer.ino deleted file mode 100644 index 8f22f1bea92..00000000000 --- a/libraries/WebServer/examples/PathArgServer/PathArgServer.ino +++ /dev/null @@ -1,53 +0,0 @@ -#include -#include -#include -#include - -const char *ssid = "........"; -const char *password = "........"; - -WebServer server(80); - -void setup(void) { - Serial.begin(9600); - WiFi.mode(WIFI_STA); - WiFi.begin(ssid, password); - Serial.println(""); - - // Wait for connection - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - } - Serial.println(""); - Serial.print("Connected to "); - Serial.println(ssid); - Serial.print("IP address: "); - Serial.println(WiFi.localIP()); - - if (MDNS.begin("esp32")) { - Serial.println("MDNS responder started"); - } - - server.on("/", []() { - server.send(200, "text/plain", "hello from esp32!"); - }); - - server.on("/users/{}", []() { - String user = server.pathArg(0); - server.send(200, "text/plain", "User: '" + user + "'"); - }); - - server.on("/users/{}/devices/{}", []() { - String user = server.pathArg(0); - String device = server.pathArg(1); - server.send(200, "text/plain", "User: '" + user + "' and Device: '" + device + "'"); - }); - - server.begin(); - Serial.println("HTTP server started"); -} - -void loop(void) { - server.handleClient(); -} diff --git a/libraries/WebServer/examples/SDWebServer/SDWebServer.ino b/libraries/WebServer/examples/SDWebServer/SDWebServer.ino deleted file mode 100644 index a3271a03740..00000000000 --- a/libraries/WebServer/examples/SDWebServer/SDWebServer.ino +++ /dev/null @@ -1,313 +0,0 @@ -/* - SDWebServer - Example WebServer with SD Card backend for esp8266 - - Copyright (c) 2015 Hristo Gochkov. All rights reserved. - This file is part of the WebServer library for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Have a FAT Formatted SD Card connected to the SPI port of the ESP8266 - The web root is the SD Card root folder - File extensions with more than 3 charecters are not supported by the SD Library - File Names longer than 8 charecters will be truncated by the SD library, so keep filenames shorter - index.htm is the default index (works on subfolders as well) - - upload the contents of SdRoot to the root of the SDcard and access the editor by going to http://esp8266sd.local/edit - -*/ -#include -#include -#include -#include -#include -#include - -#define DBG_OUTPUT_PORT Serial - -const char* ssid = "**********"; -const char* password = "**********"; -const char* host = "esp32sd"; - -WebServer server(80); - -static bool hasSD = false; -File uploadFile; - - -void returnOK() { - server.send(200, "text/plain", ""); -} - -void returnFail(String msg) { - server.send(500, "text/plain", msg + "\r\n"); -} - -bool loadFromSdCard(String path) { - String dataType = "text/plain"; - if (path.endsWith("/")) { - path += "index.htm"; - } - - if (path.endsWith(".src")) { - path = path.substring(0, path.lastIndexOf(".")); - } else if (path.endsWith(".htm")) { - dataType = "text/html"; - } else if (path.endsWith(".css")) { - dataType = "text/css"; - } else if (path.endsWith(".js")) { - dataType = "application/javascript"; - } else if (path.endsWith(".png")) { - dataType = "image/png"; - } else if (path.endsWith(".gif")) { - dataType = "image/gif"; - } else if (path.endsWith(".jpg")) { - dataType = "image/jpeg"; - } else if (path.endsWith(".ico")) { - dataType = "image/x-icon"; - } else if (path.endsWith(".xml")) { - dataType = "text/xml"; - } else if (path.endsWith(".pdf")) { - dataType = "application/pdf"; - } else if (path.endsWith(".zip")) { - dataType = "application/zip"; - } - - File dataFile = SD.open(path.c_str()); - if (dataFile.isDirectory()) { - path += "/index.htm"; - dataType = "text/html"; - dataFile = SD.open(path.c_str()); - } - - if (!dataFile) { - return false; - } - - if (server.hasArg("download")) { - dataType = "application/octet-stream"; - } - - if (server.streamFile(dataFile, dataType) != dataFile.size()) { - DBG_OUTPUT_PORT.println("Sent less data than expected!"); - } - - dataFile.close(); - return true; -} - -void handleFileUpload() { - if (server.uri() != "/edit") { - return; - } - HTTPUpload& upload = server.upload(); - if (upload.status == UPLOAD_FILE_START) { - if (SD.exists((char *)upload.filename.c_str())) { - SD.remove((char *)upload.filename.c_str()); - } - uploadFile = SD.open(upload.filename.c_str(), FILE_WRITE); - DBG_OUTPUT_PORT.print("Upload: START, filename: "); DBG_OUTPUT_PORT.println(upload.filename); - } else if (upload.status == UPLOAD_FILE_WRITE) { - if (uploadFile) { - uploadFile.write(upload.buf, upload.currentSize); - } - DBG_OUTPUT_PORT.print("Upload: WRITE, Bytes: "); DBG_OUTPUT_PORT.println(upload.currentSize); - } else if (upload.status == UPLOAD_FILE_END) { - if (uploadFile) { - uploadFile.close(); - } - DBG_OUTPUT_PORT.print("Upload: END, Size: "); DBG_OUTPUT_PORT.println(upload.totalSize); - } -} - -void deleteRecursive(String path) { - File file = SD.open((char *)path.c_str()); - if (!file.isDirectory()) { - file.close(); - SD.remove((char *)path.c_str()); - return; - } - - file.rewindDirectory(); - while (true) { - File entry = file.openNextFile(); - if (!entry) { - break; - } - String entryPath = path + "/" + entry.name(); - if (entry.isDirectory()) { - entry.close(); - deleteRecursive(entryPath); - } else { - entry.close(); - SD.remove((char *)entryPath.c_str()); - } - yield(); - } - - SD.rmdir((char *)path.c_str()); - file.close(); -} - -void handleDelete() { - if (server.args() == 0) { - return returnFail("BAD ARGS"); - } - String path = server.arg(0); - if (path == "/" || !SD.exists((char *)path.c_str())) { - returnFail("BAD PATH"); - return; - } - deleteRecursive(path); - returnOK(); -} - -void handleCreate() { - if (server.args() == 0) { - return returnFail("BAD ARGS"); - } - String path = server.arg(0); - if (path == "/" || SD.exists((char *)path.c_str())) { - returnFail("BAD PATH"); - return; - } - - if (path.indexOf('.') > 0) { - File file = SD.open((char *)path.c_str(), FILE_WRITE); - if (file) { - file.write(0); - file.close(); - } - } else { - SD.mkdir((char *)path.c_str()); - } - returnOK(); -} - -void printDirectory() { - if (!server.hasArg("dir")) { - return returnFail("BAD ARGS"); - } - String path = server.arg("dir"); - if (path != "/" && !SD.exists((char *)path.c_str())) { - return returnFail("BAD PATH"); - } - File dir = SD.open((char *)path.c_str()); - path = String(); - if (!dir.isDirectory()) { - dir.close(); - return returnFail("NOT DIR"); - } - dir.rewindDirectory(); - server.setContentLength(CONTENT_LENGTH_UNKNOWN); - server.send(200, "text/json", ""); - WiFiClient client = server.client(); - - server.sendContent("["); - for (int cnt = 0; true; ++cnt) { - File entry = dir.openNextFile(); - if (!entry) { - break; - } - - String output; - if (cnt > 0) { - output = ','; - } - - output += "{\"type\":\""; - output += (entry.isDirectory()) ? "dir" : "file"; - output += "\",\"name\":\""; - output += entry.name(); - output += "\""; - output += "}"; - server.sendContent(output); - entry.close(); - } - server.sendContent("]"); - dir.close(); -} - -void handleNotFound() { - if (hasSD && loadFromSdCard(server.uri())) { - return; - } - String message = "SDCARD Not Detected\n\n"; - message += "URI: "; - message += server.uri(); - message += "\nMethod: "; - message += (server.method() == HTTP_GET) ? "GET" : "POST"; - message += "\nArguments: "; - message += server.args(); - message += "\n"; - for (uint8_t i = 0; i < server.args(); i++) { - message += " NAME:" + server.argName(i) + "\n VALUE:" + server.arg(i) + "\n"; - } - server.send(404, "text/plain", message); - DBG_OUTPUT_PORT.print(message); -} - -void setup(void) { - DBG_OUTPUT_PORT.begin(115200); - DBG_OUTPUT_PORT.setDebugOutput(true); - DBG_OUTPUT_PORT.print("\n"); - WiFi.mode(WIFI_STA); - WiFi.begin(ssid, password); - DBG_OUTPUT_PORT.print("Connecting to "); - DBG_OUTPUT_PORT.println(ssid); - - // Wait for connection - uint8_t i = 0; - while (WiFi.status() != WL_CONNECTED && i++ < 20) {//wait 10 seconds - delay(500); - } - if (i == 21) { - DBG_OUTPUT_PORT.print("Could not connect to"); - DBG_OUTPUT_PORT.println(ssid); - while (1) { - delay(500); - } - } - DBG_OUTPUT_PORT.print("Connected! IP address: "); - DBG_OUTPUT_PORT.println(WiFi.localIP()); - - if (MDNS.begin(host)) { - MDNS.addService("http", "tcp", 80); - DBG_OUTPUT_PORT.println("MDNS responder started"); - DBG_OUTPUT_PORT.print("You can now connect to http://"); - DBG_OUTPUT_PORT.print(host); - DBG_OUTPUT_PORT.println(".local"); - } - - - server.on("/list", HTTP_GET, printDirectory); - server.on("/edit", HTTP_DELETE, handleDelete); - server.on("/edit", HTTP_PUT, handleCreate); - server.on("/edit", HTTP_POST, []() { - returnOK(); - }, handleFileUpload); - server.onNotFound(handleNotFound); - - server.begin(); - DBG_OUTPUT_PORT.println("HTTP server started"); - - if (SD.begin(SS)) { - DBG_OUTPUT_PORT.println("SD Card initialized."); - hasSD = true; - } -} - -void loop(void) { - server.handleClient(); -} diff --git a/libraries/WebServer/examples/SDWebServer/SdRoot/edit/index.htm b/libraries/WebServer/examples/SDWebServer/SdRoot/edit/index.htm deleted file mode 100644 index f535601e7d7..00000000000 --- a/libraries/WebServer/examples/SDWebServer/SdRoot/edit/index.htm +++ /dev/null @@ -1,674 +0,0 @@ - - - - SD Editor - - - - - -
-
-
- - - - diff --git a/libraries/WebServer/examples/SDWebServer/SdRoot/index.htm b/libraries/WebServer/examples/SDWebServer/SdRoot/index.htm deleted file mode 100644 index 55fe5a66c45..00000000000 --- a/libraries/WebServer/examples/SDWebServer/SdRoot/index.htm +++ /dev/null @@ -1,22 +0,0 @@ - - - - - ESP Index - - - - -

ESP8266 Pin Functions

- - - diff --git a/libraries/WebServer/examples/SDWebServer/SdRoot/pins.png b/libraries/WebServer/examples/SDWebServer/SdRoot/pins.png deleted file mode 100644 index ac7fc0f9cb6..00000000000 Binary files a/libraries/WebServer/examples/SDWebServer/SdRoot/pins.png and /dev/null differ diff --git a/libraries/WebServer/examples/SimpleAuthentification/SimpleAuthentification.ino b/libraries/WebServer/examples/SimpleAuthentification/SimpleAuthentification.ino deleted file mode 100644 index 1adf20613ad..00000000000 --- a/libraries/WebServer/examples/SimpleAuthentification/SimpleAuthentification.ino +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include -#include - -const char* ssid = "........"; -const char* password = "........"; - -WebServer server(80); - -//Check if header is present and correct -bool is_authentified() { - Serial.println("Enter is_authentified"); - if (server.hasHeader("Cookie")) { - Serial.print("Found cookie: "); - String cookie = server.header("Cookie"); - Serial.println(cookie); - if (cookie.indexOf("ESPSESSIONID=1") != -1) { - Serial.println("Authentification Successful"); - return true; - } - } - Serial.println("Authentification Failed"); - return false; -} - -//login page, also called for disconnect -void handleLogin() { - String msg; - if (server.hasHeader("Cookie")) { - Serial.print("Found cookie: "); - String cookie = server.header("Cookie"); - Serial.println(cookie); - } - if (server.hasArg("DISCONNECT")) { - Serial.println("Disconnection"); - server.sendHeader("Location", "/login"); - server.sendHeader("Cache-Control", "no-cache"); - server.sendHeader("Set-Cookie", "ESPSESSIONID=0"); - server.send(301); - return; - } - if (server.hasArg("USERNAME") && server.hasArg("PASSWORD")) { - if (server.arg("USERNAME") == "admin" && server.arg("PASSWORD") == "admin") { - server.sendHeader("Location", "/"); - server.sendHeader("Cache-Control", "no-cache"); - server.sendHeader("Set-Cookie", "ESPSESSIONID=1"); - server.send(301); - Serial.println("Log in Successful"); - return; - } - msg = "Wrong username/password! try again."; - Serial.println("Log in Failed"); - } - String content = "
To log in, please use : admin/admin
"; - content += "User:
"; - content += "Password:
"; - content += "
" + msg + "
"; - content += "You also can go here"; - server.send(200, "text/html", content); -} - -//root page can be accessed only if authentification is ok -void handleRoot() { - Serial.println("Enter handleRoot"); - String header; - if (!is_authentified()) { - server.sendHeader("Location", "/login"); - server.sendHeader("Cache-Control", "no-cache"); - server.send(301); - return; - } - String content = "

hello, you successfully connected to esp8266!


"; - if (server.hasHeader("User-Agent")) { - content += "the user agent used is : " + server.header("User-Agent") + "

"; - } - content += "You can access this page until you disconnect"; - server.send(200, "text/html", content); -} - -//no need authentification -void handleNotFound() { - String message = "File Not Found\n\n"; - message += "URI: "; - message += server.uri(); - message += "\nMethod: "; - message += (server.method() == HTTP_GET) ? "GET" : "POST"; - message += "\nArguments: "; - message += server.args(); - message += "\n"; - for (uint8_t i = 0; i < server.args(); i++) { - message += " " + server.argName(i) + ": " + server.arg(i) + "\n"; - } - server.send(404, "text/plain", message); -} - -void setup(void) { - Serial.begin(115200); - WiFi.mode(WIFI_STA); - WiFi.begin(ssid, password); - Serial.println(""); - - // Wait for connection - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - } - Serial.println(""); - Serial.print("Connected to "); - Serial.println(ssid); - Serial.print("IP address: "); - Serial.println(WiFi.localIP()); - - - server.on("/", handleRoot); - server.on("/login", handleLogin); - server.on("/inline", []() { - server.send(200, "text/plain", "this works without need of authentification"); - }); - - server.onNotFound(handleNotFound); - //here the list of headers to be recorded - const char * headerkeys[] = {"User-Agent", "Cookie"} ; - size_t headerkeyssize = sizeof(headerkeys) / sizeof(char*); - //ask server to track these headers - server.collectHeaders(headerkeys, headerkeyssize); - server.begin(); - Serial.println("HTTP server started"); -} - -void loop(void) { - server.handleClient(); -} diff --git a/libraries/WebServer/examples/WebUpdate/WebUpdate.ino b/libraries/WebServer/examples/WebUpdate/WebUpdate.ino deleted file mode 100644 index 843867d5f3b..00000000000 --- a/libraries/WebServer/examples/WebUpdate/WebUpdate.ino +++ /dev/null @@ -1,69 +0,0 @@ -/* - To upload through terminal you can use: curl -F "image=@firmware.bin" esp8266-webupdate.local/update -*/ - -#include -#include -#include -#include -#include - -const char* host = "esp32-webupdate"; -const char* ssid = "........"; -const char* password = "........"; - -WebServer server(80); -const char* serverIndex = "
"; - -void setup(void) { - Serial.begin(115200); - Serial.println(); - Serial.println("Booting Sketch..."); - WiFi.mode(WIFI_AP_STA); - WiFi.begin(ssid, password); - if (WiFi.waitForConnectResult() == WL_CONNECTED) { - MDNS.begin(host); - server.on("/", HTTP_GET, []() { - server.sendHeader("Connection", "close"); - server.send(200, "text/html", serverIndex); - }); - server.on("/update", HTTP_POST, []() { - server.sendHeader("Connection", "close"); - server.send(200, "text/plain", (Update.hasError()) ? "FAIL" : "OK"); - ESP.restart(); - }, []() { - HTTPUpload& upload = server.upload(); - if (upload.status == UPLOAD_FILE_START) { - Serial.setDebugOutput(true); - Serial.printf("Update: %s\n", upload.filename.c_str()); - if (!Update.begin()) { //start with max available size - Update.printError(Serial); - } - } else if (upload.status == UPLOAD_FILE_WRITE) { - if (Update.write(upload.buf, upload.currentSize) != upload.currentSize) { - Update.printError(Serial); - } - } else if (upload.status == UPLOAD_FILE_END) { - if (Update.end(true)) { //true to set the size to the current progress - Serial.printf("Update Success: %u\nRebooting...\n", upload.totalSize); - } else { - Update.printError(Serial); - } - Serial.setDebugOutput(false); - } else { - Serial.printf("Update Failed Unexpectedly (likely broken connection): status=%d\n", upload.status); - } - }); - server.begin(); - MDNS.addService("http", "tcp", 80); - - Serial.printf("Ready! Open http://%s.local in your browser\n", host); - } else { - Serial.println("WiFi Failed"); - } -} - -void loop(void) { - server.handleClient(); - delay(1); -} diff --git a/libraries/WebServer/keywords.txt b/libraries/WebServer/keywords.txt deleted file mode 100644 index df20ff7b414..00000000000 --- a/libraries/WebServer/keywords.txt +++ /dev/null @@ -1,38 +0,0 @@ -####################################### -# Syntax Coloring Map For Ultrasound -####################################### - -####################################### -# Datatypes (KEYWORD1) -####################################### - -WebServer KEYWORD1 -WebServerSecure KEYWORD1 -HTTPMethod KEYWORD1 - -####################################### -# Methods and Functions (KEYWORD2) -####################################### - -begin KEYWORD2 -handleClient KEYWORD2 -on KEYWORD2 -addHandler KEYWORD2 -uri KEYWORD2 -method KEYWORD2 -client KEYWORD2 -send KEYWORD2 -arg KEYWORD2 -argName KEYWORD2 -args KEYWORD2 -hasArg KEYWORD2 -onNotFound KEYWORD2 - -####################################### -# Constants (LITERAL1) -####################################### - -HTTP_GET LITERAL1 -HTTP_POST LITERAL1 -HTTP_ANY LITERAL1 -CONTENT_LENGTH_UNKNOWN LITERAL1 diff --git a/libraries/WebServer/library.properties b/libraries/WebServer/library.properties deleted file mode 100644 index a2ac5f5317c..00000000000 --- a/libraries/WebServer/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=WebServer -version=1.0 -author=Ivan Grokhotkov -maintainer=Ivan Grokhtkov -sentence=Simple web server library -paragraph=The library supports HTTP GET and POST requests, provides argument parsing, handles one client at a time. -category=Communication -url= -architectures=esp32 diff --git a/libraries/WebServer/src/HTTP_Method.h b/libraries/WebServer/src/HTTP_Method.h deleted file mode 100644 index 4532332bc88..00000000000 --- a/libraries/WebServer/src/HTTP_Method.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef _HTTP_Method_H_ -#define _HTTP_Method_H_ - -typedef enum { - HTTP_GET = 0b00000001, - HTTP_POST = 0b00000010, - HTTP_DELETE = 0b00000100, - HTTP_PUT = 0b00001000, - HTTP_PATCH = 0b00010000, - HTTP_HEAD = 0b00100000, - HTTP_OPTIONS = 0b01000000, - HTTP_ANY = 0b01111111, -} HTTPMethod; - -#endif /* _HTTP_Method_H_ */ diff --git a/libraries/WebServer/src/Parsing.cpp b/libraries/WebServer/src/Parsing.cpp deleted file mode 100644 index e2e9cc43b7e..00000000000 --- a/libraries/WebServer/src/Parsing.cpp +++ /dev/null @@ -1,562 +0,0 @@ -/* - Parsing.cpp - HTTP request parsing. - - Copyright (c) 2015 Ivan Grokhotkov. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Modified 8 May 2015 by Hristo Gochkov (proper post and file upload handling) -*/ - -#include -#include -#include "WiFiServer.h" -#include "WiFiClient.h" -#include "WebServer.h" -#include "detail/mimetable.h" - -#ifndef WEBSERVER_MAX_POST_ARGS -#define WEBSERVER_MAX_POST_ARGS 32 -#endif - -static const char Content_Type[] PROGMEM = "Content-Type"; -static const char filename[] PROGMEM = "filename"; - -static char* readBytesWithTimeout(WiFiClient& client, size_t maxLength, size_t& dataLength, int timeout_ms) -{ - char *buf = nullptr; - dataLength = 0; - while (dataLength < maxLength) { - int tries = timeout_ms; - size_t newLength; - while (!(newLength = client.available()) && tries--) delay(1); - if (!newLength) { - break; - } - if (!buf) { - buf = (char *) malloc(newLength + 1); - if (!buf) { - return nullptr; - } - } - else { - char* newBuf = (char *) realloc(buf, dataLength + newLength + 1); - if (!newBuf) { - free(buf); - return nullptr; - } - buf = newBuf; - } - client.readBytes(buf + dataLength, newLength); - dataLength += newLength; - buf[dataLength] = '\0'; - } - return buf; -} - -bool WebServer::_parseRequest(WiFiClient& client) { - // Read the first line of HTTP request - String req = client.readStringUntil('\r'); - client.readStringUntil('\n'); - //reset header value - for (int i = 0; i < _headerKeysCount; ++i) { - _currentHeaders[i].value =String(); - } - - // First line of HTTP request looks like "GET /path HTTP/1.1" - // Retrieve the "/path" part by finding the spaces - int addr_start = req.indexOf(' '); - int addr_end = req.indexOf(' ', addr_start + 1); - if (addr_start == -1 || addr_end == -1) { - log_e("Invalid request: %s", req.c_str()); - return false; - } - - String methodStr = req.substring(0, addr_start); - String url = req.substring(addr_start + 1, addr_end); - String versionEnd = req.substring(addr_end + 8); - _currentVersion = atoi(versionEnd.c_str()); - String searchStr = ""; - int hasSearch = url.indexOf('?'); - if (hasSearch != -1){ - searchStr = url.substring(hasSearch + 1); - url = url.substring(0, hasSearch); - } - _currentUri = url; - _chunked = false; - - HTTPMethod method = HTTP_GET; - if (methodStr == F("POST")) { - method = HTTP_POST; - } else if (methodStr == F("DELETE")) { - method = HTTP_DELETE; - } else if (methodStr == F("OPTIONS")) { - method = HTTP_OPTIONS; - } else if (methodStr == F("PUT")) { - method = HTTP_PUT; - } else if (methodStr == F("PATCH")) { - method = HTTP_PATCH; - } - _currentMethod = method; - - log_v("method: %s url: %s search: %s", methodStr.c_str(), url.c_str(), searchStr.c_str()); - - //attach handler - RequestHandler* handler; - for (handler = _firstHandler; handler; handler = handler->next()) { - if (handler->canHandle(_currentMethod, _currentUri)) - break; - } - _currentHandler = handler; - - String formData; - // below is needed only when POST type request - if (method == HTTP_POST || method == HTTP_PUT || method == HTTP_PATCH || method == HTTP_DELETE){ - String boundaryStr; - String headerName; - String headerValue; - bool isForm = false; - bool isEncoded = false; - uint32_t contentLength = 0; - //parse headers - while(1){ - req = client.readStringUntil('\r'); - client.readStringUntil('\n'); - if (req == "") break;//no moar headers - int headerDiv = req.indexOf(':'); - if (headerDiv == -1){ - break; - } - headerName = req.substring(0, headerDiv); - headerValue = req.substring(headerDiv + 1); - headerValue.trim(); - _collectHeader(headerName.c_str(),headerValue.c_str()); - - log_v("headerName: %s", headerName.c_str()); - log_v("headerValue: %s", headerValue.c_str()); - - if (headerName.equalsIgnoreCase(FPSTR(Content_Type))){ - using namespace mime; - if (headerValue.startsWith(FPSTR(mimeTable[txt].mimeType))){ - isForm = false; - } else if (headerValue.startsWith(F("application/x-www-form-urlencoded"))){ - isForm = false; - isEncoded = true; - } else if (headerValue.startsWith(F("multipart/"))){ - boundaryStr = headerValue.substring(headerValue.indexOf('=') + 1); - boundaryStr.replace("\"",""); - isForm = true; - } - } else if (headerName.equalsIgnoreCase(F("Content-Length"))){ - contentLength = headerValue.toInt(); - } else if (headerName.equalsIgnoreCase(F("Host"))){ - _hostHeader = headerValue; - } - } - - if (!isForm){ - size_t plainLength; - char* plainBuf = readBytesWithTimeout(client, contentLength, plainLength, HTTP_MAX_POST_WAIT); - if (plainLength < contentLength) { - free(plainBuf); - return false; - } - if (contentLength > 0) { - if(isEncoded){ - //url encoded form - if (searchStr != "") searchStr += '&'; - searchStr += plainBuf; - } - _parseArguments(searchStr); - if(!isEncoded){ - //plain post json or other data - RequestArgument& arg = _currentArgs[_currentArgCount++]; - arg.key = F("plain"); - arg.value = String(plainBuf); - } - - log_v("Plain: %s", plainBuf); - free(plainBuf); - } else { - // No content - but we can still have arguments in the URL. - _parseArguments(searchStr); - } - } - - if (isForm){ - _parseArguments(searchStr); - if (!_parseForm(client, boundaryStr, contentLength)) { - return false; - } - } - } else { - String headerName; - String headerValue; - //parse headers - while(1){ - req = client.readStringUntil('\r'); - client.readStringUntil('\n'); - if (req == "") break;//no moar headers - int headerDiv = req.indexOf(':'); - if (headerDiv == -1){ - break; - } - headerName = req.substring(0, headerDiv); - headerValue = req.substring(headerDiv + 2); - _collectHeader(headerName.c_str(),headerValue.c_str()); - - log_v("headerName: %s", headerName.c_str()); - log_v("headerValue: %s", headerValue.c_str()); - - if (headerName.equalsIgnoreCase("Host")){ - _hostHeader = headerValue; - } - } - _parseArguments(searchStr); - } - client.flush(); - - log_v("Request: %s", url.c_str()); - log_v(" Arguments: %s", searchStr.c_str()); - - return true; -} - -bool WebServer::_collectHeader(const char* headerName, const char* headerValue) { - for (int i = 0; i < _headerKeysCount; i++) { - if (_currentHeaders[i].key.equalsIgnoreCase(headerName)) { - _currentHeaders[i].value=headerValue; - return true; - } - } - return false; -} - -void WebServer::_parseArguments(String data) { - log_v("args: %s", data.c_str()); - if (_currentArgs) - delete[] _currentArgs; - _currentArgs = 0; - if (data.length() == 0) { - _currentArgCount = 0; - _currentArgs = new RequestArgument[1]; - return; - } - _currentArgCount = 1; - - for (int i = 0; i < (int)data.length(); ) { - i = data.indexOf('&', i); - if (i == -1) - break; - ++i; - ++_currentArgCount; - } - log_v("args count: %d", _currentArgCount); - - _currentArgs = new RequestArgument[_currentArgCount+1]; - int pos = 0; - int iarg; - for (iarg = 0; iarg < _currentArgCount;) { - int equal_sign_index = data.indexOf('=', pos); - int next_arg_index = data.indexOf('&', pos); - log_v("pos %d =@%d &@%d", pos, equal_sign_index, next_arg_index); - if ((equal_sign_index == -1) || ((equal_sign_index > next_arg_index) && (next_arg_index != -1))) { - log_e("arg missing value: %d", iarg); - if (next_arg_index == -1) - break; - pos = next_arg_index + 1; - continue; - } - RequestArgument& arg = _currentArgs[iarg]; - arg.key = urlDecode(data.substring(pos, equal_sign_index)); - arg.value = urlDecode(data.substring(equal_sign_index + 1, next_arg_index)); - log_v("arg %d key: %s value: %s", iarg, arg.key.c_str(), arg.value.c_str()); - ++iarg; - if (next_arg_index == -1) - break; - pos = next_arg_index + 1; - } - _currentArgCount = iarg; - log_v("args count: %d", _currentArgCount); - -} - -void WebServer::_uploadWriteByte(uint8_t b){ - if (_currentUpload->currentSize == HTTP_UPLOAD_BUFLEN){ - if(_currentHandler && _currentHandler->canUpload(_currentUri)) - _currentHandler->upload(*this, _currentUri, *_currentUpload); - _currentUpload->totalSize += _currentUpload->currentSize; - _currentUpload->currentSize = 0; - } - _currentUpload->buf[_currentUpload->currentSize++] = b; -} - -int WebServer::_uploadReadByte(WiFiClient& client){ - if (!client.connected()) return -1; - int res = client.read(); - if(res < 0) { - // keep trying until you either read a valid byte or timeout - unsigned long startMillis = millis(); - long timeoutIntervalMillis = client.getTimeout(); - boolean timedOut = false; - for(;;) { - // loosely modeled after blinkWithoutDelay pattern - while(!timedOut && !client.available() && client.connected()){ - delay(2); - timedOut = millis() - startMillis >= timeoutIntervalMillis; - } - - res = client.read(); - if(res >= 0) { - return res; // exit on a valid read - } - // NOTE: it is possible to get here and have all of the following - // assertions hold true - // - // -- client.available() > 0 - // -- client.connected == true - // -- res == -1 - // - // a simple retry strategy overcomes this which is to say the - // assertion is not permanent, but the reason that this works - // is elusive, and possibly indicative of a more subtle underlying - // issue - - timedOut = millis() - startMillis >= timeoutIntervalMillis; - if(timedOut) { - return res; // exit on a timeout - } - } - } - - return res; -} - -bool WebServer::_parseForm(WiFiClient& client, String boundary, uint32_t len){ - (void) len; - log_v("Parse Form: Boundary: %s Length: %d", boundary.c_str(), len); - String line; - int retry = 0; - do { - line = client.readStringUntil('\r'); - ++retry; - } while (line.length() == 0 && retry < 3); - - client.readStringUntil('\n'); - //start reading the form - if (line == ("--"+boundary)){ - if(_postArgs) delete[] _postArgs; - _postArgs = new RequestArgument[WEBSERVER_MAX_POST_ARGS]; - _postArgsLen = 0; - while(1){ - String argName; - String argValue; - String argType; - String argFilename; - bool argIsFile = false; - - line = client.readStringUntil('\r'); - client.readStringUntil('\n'); - if (line.length() > 19 && line.substring(0, 19).equalsIgnoreCase(F("Content-Disposition"))){ - int nameStart = line.indexOf('='); - if (nameStart != -1){ - argName = line.substring(nameStart+2); - nameStart = argName.indexOf('='); - if (nameStart == -1){ - argName = argName.substring(0, argName.length() - 1); - } else { - argFilename = argName.substring(nameStart+2, argName.length() - 1); - argName = argName.substring(0, argName.indexOf('"')); - argIsFile = true; - log_v("PostArg FileName: %s",argFilename.c_str()); - //use GET to set the filename if uploading using blob - if (argFilename == F("blob") && hasArg(FPSTR(filename))) - argFilename = arg(FPSTR(filename)); - } - log_v("PostArg Name: %s", argName.c_str()); - using namespace mime; - argType = FPSTR(mimeTable[txt].mimeType); - line = client.readStringUntil('\r'); - client.readStringUntil('\n'); - if (line.length() > 12 && line.substring(0, 12).equalsIgnoreCase(FPSTR(Content_Type))){ - argType = line.substring(line.indexOf(':')+2); - //skip next line - client.readStringUntil('\r'); - client.readStringUntil('\n'); - } - log_v("PostArg Type: %s", argType.c_str()); - if (!argIsFile){ - while(1){ - line = client.readStringUntil('\r'); - client.readStringUntil('\n'); - if (line.startsWith("--"+boundary)) break; - if (argValue.length() > 0) argValue += "\n"; - argValue += line; - } - log_v("PostArg Value: %s", argValue.c_str()); - - RequestArgument& arg = _postArgs[_postArgsLen++]; - arg.key = argName; - arg.value = argValue; - - if (line == ("--"+boundary+"--")){ - log_v("Done Parsing POST"); - break; - } - } else { - _currentUpload.reset(new HTTPUpload()); - _currentUpload->status = UPLOAD_FILE_START; - _currentUpload->name = argName; - _currentUpload->filename = argFilename; - _currentUpload->type = argType; - _currentUpload->totalSize = 0; - _currentUpload->currentSize = 0; - log_v("Start File: %s Type: %s", _currentUpload->filename.c_str(), _currentUpload->type.c_str()); - if(_currentHandler && _currentHandler->canUpload(_currentUri)) - _currentHandler->upload(*this, _currentUri, *_currentUpload); - _currentUpload->status = UPLOAD_FILE_WRITE; - int argByte = _uploadReadByte(client); -readfile: - - while(argByte != 0x0D){ - if(argByte < 0) return _parseFormUploadAborted(); - _uploadWriteByte(argByte); - argByte = _uploadReadByte(client); - } - - argByte = _uploadReadByte(client); - if(argByte < 0) return _parseFormUploadAborted(); - if (argByte == 0x0A){ - argByte = _uploadReadByte(client); - if(argByte < 0) return _parseFormUploadAborted(); - if ((char)argByte != '-'){ - //continue reading the file - _uploadWriteByte(0x0D); - _uploadWriteByte(0x0A); - goto readfile; - } else { - argByte = _uploadReadByte(client); - if(argByte < 0) return _parseFormUploadAborted(); - if ((char)argByte != '-'){ - //continue reading the file - _uploadWriteByte(0x0D); - _uploadWriteByte(0x0A); - _uploadWriteByte((uint8_t)('-')); - goto readfile; - } - } - - uint8_t endBuf[boundary.length()]; - client.readBytes(endBuf, boundary.length()); - - if (strstr((const char*)endBuf, boundary.c_str()) != NULL){ - if(_currentHandler && _currentHandler->canUpload(_currentUri)) - _currentHandler->upload(*this, _currentUri, *_currentUpload); - _currentUpload->totalSize += _currentUpload->currentSize; - _currentUpload->status = UPLOAD_FILE_END; - if(_currentHandler && _currentHandler->canUpload(_currentUri)) - _currentHandler->upload(*this, _currentUri, *_currentUpload); - log_v("End File: %s Type: %s Size: %d", _currentUpload->filename.c_str(), _currentUpload->type.c_str(), _currentUpload->totalSize); - line = client.readStringUntil(0x0D); - client.readStringUntil(0x0A); - if (line == "--"){ - log_v("Done Parsing POST"); - break; - } - continue; - } else { - _uploadWriteByte(0x0D); - _uploadWriteByte(0x0A); - _uploadWriteByte((uint8_t)('-')); - _uploadWriteByte((uint8_t)('-')); - uint32_t i = 0; - while(i < boundary.length()){ - _uploadWriteByte(endBuf[i++]); - } - argByte = _uploadReadByte(client); - goto readfile; - } - } else { - _uploadWriteByte(0x0D); - goto readfile; - } - break; - } - } - } - } - - int iarg; - int totalArgs = ((WEBSERVER_MAX_POST_ARGS - _postArgsLen) < _currentArgCount)?(WEBSERVER_MAX_POST_ARGS - _postArgsLen):_currentArgCount; - for (iarg = 0; iarg < totalArgs; iarg++){ - RequestArgument& arg = _postArgs[_postArgsLen++]; - arg.key = _currentArgs[iarg].key; - arg.value = _currentArgs[iarg].value; - } - if (_currentArgs) delete[] _currentArgs; - _currentArgs = new RequestArgument[_postArgsLen]; - for (iarg = 0; iarg < _postArgsLen; iarg++){ - RequestArgument& arg = _currentArgs[iarg]; - arg.key = _postArgs[iarg].key; - arg.value = _postArgs[iarg].value; - } - _currentArgCount = iarg; - if (_postArgs) { - delete[] _postArgs; - _postArgs=nullptr; - _postArgsLen = 0; - } - return true; - } - log_e("Error: line: %s", line.c_str()); - return false; -} - -String WebServer::urlDecode(const String& text) -{ - String decoded = ""; - char temp[] = "0x00"; - unsigned int len = text.length(); - unsigned int i = 0; - while (i < len) - { - char decodedChar; - char encodedChar = text.charAt(i++); - if ((encodedChar == '%') && (i + 1 < len)) - { - temp[2] = text.charAt(i++); - temp[3] = text.charAt(i++); - - decodedChar = strtol(temp, NULL, 16); - } - else { - if (encodedChar == '+') - { - decodedChar = ' '; - } - else { - decodedChar = encodedChar; // normal ascii char - } - } - decoded += decodedChar; - } - return decoded; -} - -bool WebServer::_parseFormUploadAborted(){ - _currentUpload->status = UPLOAD_FILE_ABORTED; - if(_currentHandler && _currentHandler->canUpload(_currentUri)) - _currentHandler->upload(*this, _currentUri, *_currentUpload); - return false; -} diff --git a/libraries/WebServer/src/WebServer.cpp b/libraries/WebServer/src/WebServer.cpp deleted file mode 100644 index 90416f90b1a..00000000000 --- a/libraries/WebServer/src/WebServer.cpp +++ /dev/null @@ -1,691 +0,0 @@ -/* - WebServer.cpp - Dead simple web-server. - Supports only one simultaneous client, knows how to handle GET and POST. - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Modified 8 May 2015 by Hristo Gochkov (proper post and file upload handling) -*/ - - -#include -#include -#include -#include "WiFiServer.h" -#include "WiFiClient.h" -#include "WebServer.h" -#include "FS.h" -#include "detail/RequestHandlersImpl.h" -#include "mbedtls/md5.h" - - -static const char AUTHORIZATION_HEADER[] = "Authorization"; -static const char qop_auth[] = "qop=auth"; -static const char WWW_Authenticate[] = "WWW-Authenticate"; -static const char Content_Length[] = "Content-Length"; - - -WebServer::WebServer(IPAddress addr, int port) -: _corsEnabled(false) -, _server(addr, port) -, _currentMethod(HTTP_ANY) -, _currentVersion(0) -, _currentStatus(HC_NONE) -, _statusChange(0) -, _currentHandler(nullptr) -, _firstHandler(nullptr) -, _lastHandler(nullptr) -, _currentArgCount(0) -, _currentArgs(nullptr) -, _postArgsLen(0) -, _postArgs(nullptr) -, _headerKeysCount(0) -, _currentHeaders(nullptr) -, _contentLength(0) -, _chunked(false) -{ -} - -WebServer::WebServer(int port) -: _corsEnabled(false) -, _server(port) -, _currentMethod(HTTP_ANY) -, _currentVersion(0) -, _currentStatus(HC_NONE) -, _statusChange(0) -, _currentHandler(nullptr) -, _firstHandler(nullptr) -, _lastHandler(nullptr) -, _currentArgCount(0) -, _currentArgs(nullptr) -, _postArgsLen(0) -, _postArgs(nullptr) -, _headerKeysCount(0) -, _currentHeaders(nullptr) -, _contentLength(0) -, _chunked(false) -{ -} - -WebServer::~WebServer() { - _server.close(); - if (_currentHeaders) - delete[]_currentHeaders; - RequestHandler* handler = _firstHandler; - while (handler) { - RequestHandler* next = handler->next(); - delete handler; - handler = next; - } -} - -void WebServer::begin() { - close(); - _server.begin(); - _server.setNoDelay(true); -} - -void WebServer::begin(uint16_t port) { - close(); - _server.begin(port); - _server.setNoDelay(true); -} - -String WebServer::_extractParam(String& authReq,const String& param,const char delimit){ - int _begin = authReq.indexOf(param); - if (_begin == -1) - return ""; - return authReq.substring(_begin+param.length(),authReq.indexOf(delimit,_begin+param.length())); -} - -static String md5str(String &in){ - char out[33] = {0}; - mbedtls_md5_context _ctx; - uint8_t i; - uint8_t * _buf = (uint8_t*)malloc(16); - if(_buf == NULL) - return String(out); - memset(_buf, 0x00, 16); - mbedtls_md5_init(&_ctx); - mbedtls_md5_starts(&_ctx); - mbedtls_md5_update(&_ctx, (const uint8_t *)in.c_str(), in.length()); - mbedtls_md5_finish(&_ctx, _buf); - for(i = 0; i < 16; i++) { - sprintf(out + (i * 2), "%02x", _buf[i]); - } - out[32] = 0; - free(_buf); - return String(out); -} - -bool WebServer::authenticate(const char * username, const char * password){ - if(hasHeader(FPSTR(AUTHORIZATION_HEADER))) { - String authReq = header(FPSTR(AUTHORIZATION_HEADER)); - if(authReq.startsWith(F("Basic"))){ - authReq = authReq.substring(6); - authReq.trim(); - char toencodeLen = strlen(username)+strlen(password)+1; - char *toencode = new char[toencodeLen + 1]; - if(toencode == NULL){ - authReq = ""; - return false; - } - char *encoded = new char[base64_encode_expected_len(toencodeLen)+1]; - if(encoded == NULL){ - authReq = ""; - delete[] toencode; - return false; - } - sprintf(toencode, "%s:%s", username, password); - if(base64_encode_chars(toencode, toencodeLen, encoded) > 0 && authReq.equalsConstantTime(encoded)) { - authReq = ""; - delete[] toencode; - delete[] encoded; - return true; - } - delete[] toencode; - delete[] encoded; - } else if(authReq.startsWith(F("Digest"))) { - authReq = authReq.substring(7); - log_v("%s", authReq.c_str()); - String _username = _extractParam(authReq,F("username=\"")); - if(!_username.length() || _username != String(username)) { - authReq = ""; - return false; - } - // extracting required parameters for RFC 2069 simpler Digest - String _realm = _extractParam(authReq, F("realm=\"")); - String _nonce = _extractParam(authReq, F("nonce=\"")); - String _uri = _extractParam(authReq, F("uri=\"")); - String _response = _extractParam(authReq, F("response=\"")); - String _opaque = _extractParam(authReq, F("opaque=\"")); - - if((!_realm.length()) || (!_nonce.length()) || (!_uri.length()) || (!_response.length()) || (!_opaque.length())) { - authReq = ""; - return false; - } - if((_opaque != _sopaque) || (_nonce != _snonce) || (_realm != _srealm)) { - authReq = ""; - return false; - } - // parameters for the RFC 2617 newer Digest - String _nc,_cnonce; - if(authReq.indexOf(FPSTR(qop_auth)) != -1) { - _nc = _extractParam(authReq, F("nc="), ','); - _cnonce = _extractParam(authReq, F("cnonce=\"")); - } - String _H1 = md5str(String(username) + ':' + _realm + ':' + String(password)); - log_v("Hash of user:realm:pass=%s", _H1.c_str()); - String _H2 = ""; - if(_currentMethod == HTTP_GET){ - _H2 = md5str(String(F("GET:")) + _uri); - }else if(_currentMethod == HTTP_POST){ - _H2 = md5str(String(F("POST:")) + _uri); - }else if(_currentMethod == HTTP_PUT){ - _H2 = md5str(String(F("PUT:")) + _uri); - }else if(_currentMethod == HTTP_DELETE){ - _H2 = md5str(String(F("DELETE:")) + _uri); - }else{ - _H2 = md5str(String(F("GET:")) + _uri); - } - log_v("Hash of GET:uri=%s", _H2.c_str()); - String _responsecheck = ""; - if(authReq.indexOf(FPSTR(qop_auth)) != -1) { - _responsecheck = md5str(_H1 + ':' + _nonce + ':' + _nc + ':' + _cnonce + F(":auth:") + _H2); - } else { - _responsecheck = md5str(_H1 + ':' + _nonce + ':' + _H2); - } - log_v("The Proper response=%s", _responsecheck.c_str()); - if(_response == _responsecheck){ - authReq = ""; - return true; - } - } - authReq = ""; - } - return false; -} - -String WebServer::_getRandomHexString() { - char buffer[33]; // buffer to hold 32 Hex Digit + /0 - int i; - for(i = 0; i < 4; i++) { - sprintf (buffer + (i*8), "%08x", esp_random()); - } - return String(buffer); -} - -void WebServer::requestAuthentication(HTTPAuthMethod mode, const char* realm, const String& authFailMsg) { - if(realm == NULL) { - _srealm = String(F("Login Required")); - } else { - _srealm = String(realm); - } - if(mode == BASIC_AUTH) { - sendHeader(String(FPSTR(WWW_Authenticate)), String(F("Basic realm=\"")) + _srealm + String(F("\""))); - } else { - _snonce=_getRandomHexString(); - _sopaque=_getRandomHexString(); - sendHeader(String(FPSTR(WWW_Authenticate)), String(F("Digest realm=\"")) +_srealm + String(F("\", qop=\"auth\", nonce=\"")) + _snonce + String(F("\", opaque=\"")) + _sopaque + String(F("\""))); - } - using namespace mime; - send(401, String(FPSTR(mimeTable[html].mimeType)), authFailMsg); -} - -void WebServer::on(const String &uri, WebServer::THandlerFunction handler) { - on(uri, HTTP_ANY, handler); -} - -void WebServer::on(const String &uri, HTTPMethod method, WebServer::THandlerFunction fn) { - on(uri, method, fn, _fileUploadHandler); -} - -void WebServer::on(const String &uri, HTTPMethod method, WebServer::THandlerFunction fn, WebServer::THandlerFunction ufn) { - _addRequestHandler(new FunctionRequestHandler(fn, ufn, uri, method)); -} - -void WebServer::addHandler(RequestHandler* handler) { - _addRequestHandler(handler); -} - -void WebServer::_addRequestHandler(RequestHandler* handler) { - if (!_lastHandler) { - _firstHandler = handler; - _lastHandler = handler; - } - else { - _lastHandler->next(handler); - _lastHandler = handler; - } -} - -void WebServer::serveStatic(const char* uri, FS& fs, const char* path, const char* cache_header) { - _addRequestHandler(new StaticRequestHandler(fs, path, uri, cache_header)); -} - -void WebServer::handleClient() { - if (_currentStatus == HC_NONE) { - WiFiClient client = _server.available(); - if (!client) { - return; - } - - log_v("New client"); - - _currentClient = client; - _currentStatus = HC_WAIT_READ; - _statusChange = millis(); - } - - bool keepCurrentClient = false; - bool callYield = false; - - if (_currentClient.connected()) { - switch (_currentStatus) { - case HC_NONE: - // No-op to avoid C++ compiler warning - break; - case HC_WAIT_READ: - // Wait for data from client to become available - if (_currentClient.available()) { - if (_parseRequest(_currentClient)) { - // because HTTP_MAX_SEND_WAIT is expressed in milliseconds, - // it must be divided by 1000 - _currentClient.setTimeout(HTTP_MAX_SEND_WAIT / 1000); - _contentLength = CONTENT_LENGTH_NOT_SET; - _handleRequest(); - - if (_currentClient.connected()) { - _currentStatus = HC_WAIT_CLOSE; - _statusChange = millis(); - keepCurrentClient = true; - } - } - } else { // !_currentClient.available() - if (millis() - _statusChange <= HTTP_MAX_DATA_WAIT) { - keepCurrentClient = true; - } - callYield = true; - } - break; - case HC_WAIT_CLOSE: - // Wait for client to close the connection - if (millis() - _statusChange <= HTTP_MAX_CLOSE_WAIT) { - keepCurrentClient = true; - callYield = true; - } - } - } - - if (!keepCurrentClient) { - _currentClient = WiFiClient(); - _currentStatus = HC_NONE; - _currentUpload.reset(); - } - - if (callYield) { - yield(); - } -} - -void WebServer::close() { - _server.close(); - _currentStatus = HC_NONE; - if(!_headerKeysCount) - collectHeaders(0, 0); -} - -void WebServer::stop() { - close(); -} - -void WebServer::sendHeader(const String& name, const String& value, bool first) { - String headerLine = name; - headerLine += F(": "); - headerLine += value; - headerLine += "\r\n"; - - if (first) { - _responseHeaders = headerLine + _responseHeaders; - } - else { - _responseHeaders += headerLine; - } -} - -void WebServer::setContentLength(const size_t contentLength) { - _contentLength = contentLength; -} - -void WebServer::enableCORS(boolean value) { - _corsEnabled = value; -} - -void WebServer::enableCrossOrigin(boolean value) { - enableCORS(value); -} - -void WebServer::_prepareHeader(String& response, int code, const char* content_type, size_t contentLength) { - response = String(F("HTTP/1.")) + String(_currentVersion) + ' '; - response += String(code); - response += ' '; - response += _responseCodeToString(code); - response += "\r\n"; - - using namespace mime; - if (!content_type) - content_type = mimeTable[html].mimeType; - - sendHeader(String(F("Content-Type")), String(FPSTR(content_type)), true); - if (_contentLength == CONTENT_LENGTH_NOT_SET) { - sendHeader(String(FPSTR(Content_Length)), String(contentLength)); - } else if (_contentLength != CONTENT_LENGTH_UNKNOWN) { - sendHeader(String(FPSTR(Content_Length)), String(_contentLength)); - } else if(_contentLength == CONTENT_LENGTH_UNKNOWN && _currentVersion){ //HTTP/1.1 or above client - //let's do chunked - _chunked = true; - sendHeader(String(F("Accept-Ranges")),String(F("none"))); - sendHeader(String(F("Transfer-Encoding")),String(F("chunked"))); - } - if (_corsEnabled) { - sendHeader(String(FPSTR("Access-Control-Allow-Origin")), String("*")); - } - sendHeader(String(F("Connection")), String(F("close"))); - - response += _responseHeaders; - response += "\r\n"; - _responseHeaders = ""; -} - -void WebServer::send(int code, const char* content_type, const String& content) { - String header; - // Can we asume the following? - //if(code == 200 && content.length() == 0 && _contentLength == CONTENT_LENGTH_NOT_SET) - // _contentLength = CONTENT_LENGTH_UNKNOWN; - _prepareHeader(header, code, content_type, content.length()); - _currentClientWrite(header.c_str(), header.length()); - if(content.length()) - sendContent(content); -} - -void WebServer::send_P(int code, PGM_P content_type, PGM_P content) { - size_t contentLength = 0; - - if (content != NULL) { - contentLength = strlen_P(content); - } - - String header; - char type[64]; - memccpy_P((void*)type, (PGM_VOID_P)content_type, 0, sizeof(type)); - _prepareHeader(header, code, (const char* )type, contentLength); - _currentClientWrite(header.c_str(), header.length()); - sendContent_P(content); -} - -void WebServer::send_P(int code, PGM_P content_type, PGM_P content, size_t contentLength) { - String header; - char type[64]; - memccpy_P((void*)type, (PGM_VOID_P)content_type, 0, sizeof(type)); - _prepareHeader(header, code, (const char* )type, contentLength); - sendContent(header); - sendContent_P(content, contentLength); -} - -void WebServer::send(int code, char* content_type, const String& content) { - send(code, (const char*)content_type, content); -} - -void WebServer::send(int code, const String& content_type, const String& content) { - send(code, (const char*)content_type.c_str(), content); -} - -void WebServer::sendContent(const String& content) { - const char * footer = "\r\n"; - size_t len = content.length(); - if(_chunked) { - char * chunkSize = (char *)malloc(11); - if(chunkSize){ - sprintf(chunkSize, "%x%s", len, footer); - _currentClientWrite(chunkSize, strlen(chunkSize)); - free(chunkSize); - } - } - _currentClientWrite(content.c_str(), len); - if(_chunked){ - _currentClient.write(footer, 2); - if (len == 0) { - _chunked = false; - } - } -} - -void WebServer::sendContent_P(PGM_P content) { - sendContent_P(content, strlen_P(content)); -} - -void WebServer::sendContent_P(PGM_P content, size_t size) { - const char * footer = "\r\n"; - if(_chunked) { - char * chunkSize = (char *)malloc(11); - if(chunkSize){ - sprintf(chunkSize, "%x%s", size, footer); - _currentClientWrite(chunkSize, strlen(chunkSize)); - free(chunkSize); - } - } - _currentClientWrite_P(content, size); - if(_chunked){ - _currentClient.write(footer, 2); - if (size == 0) { - _chunked = false; - } - } -} - - -void WebServer::_streamFileCore(const size_t fileSize, const String & fileName, const String & contentType) -{ - using namespace mime; - setContentLength(fileSize); - if (fileName.endsWith(String(FPSTR(mimeTable[gz].endsWith))) && - contentType != String(FPSTR(mimeTable[gz].mimeType)) && - contentType != String(FPSTR(mimeTable[none].mimeType))) { - sendHeader(F("Content-Encoding"), F("gzip")); - } - send(200, contentType, ""); -} - -String WebServer::pathArg(unsigned int i) { - if (_currentHandler != nullptr) - return _currentHandler->pathArg(i); - return ""; -} - -String WebServer::arg(String name) { - for (int j = 0; j < _postArgsLen; ++j) { - if ( _postArgs[j].key == name ) - return _postArgs[j].value; - } - for (int i = 0; i < _currentArgCount; ++i) { - if ( _currentArgs[i].key == name ) - return _currentArgs[i].value; - } - return ""; -} - -String WebServer::arg(int i) { - if (i < _currentArgCount) - return _currentArgs[i].value; - return ""; -} - -String WebServer::argName(int i) { - if (i < _currentArgCount) - return _currentArgs[i].key; - return ""; -} - -int WebServer::args() { - return _currentArgCount; -} - -bool WebServer::hasArg(String name) { - for (int j = 0; j < _postArgsLen; ++j) { - if (_postArgs[j].key == name) - return true; - } - for (int i = 0; i < _currentArgCount; ++i) { - if (_currentArgs[i].key == name) - return true; - } - return false; -} - - -String WebServer::header(String name) { - for (int i = 0; i < _headerKeysCount; ++i) { - if (_currentHeaders[i].key.equalsIgnoreCase(name)) - return _currentHeaders[i].value; - } - return ""; -} - -void WebServer::collectHeaders(const char* headerKeys[], const size_t headerKeysCount) { - _headerKeysCount = headerKeysCount + 1; - if (_currentHeaders) - delete[]_currentHeaders; - _currentHeaders = new RequestArgument[_headerKeysCount]; - _currentHeaders[0].key = FPSTR(AUTHORIZATION_HEADER); - for (int i = 1; i < _headerKeysCount; i++){ - _currentHeaders[i].key = headerKeys[i-1]; - } -} - -String WebServer::header(int i) { - if (i < _headerKeysCount) - return _currentHeaders[i].value; - return ""; -} - -String WebServer::headerName(int i) { - if (i < _headerKeysCount) - return _currentHeaders[i].key; - return ""; -} - -int WebServer::headers() { - return _headerKeysCount; -} - -bool WebServer::hasHeader(String name) { - for (int i = 0; i < _headerKeysCount; ++i) { - if ((_currentHeaders[i].key.equalsIgnoreCase(name)) && (_currentHeaders[i].value.length() > 0)) - return true; - } - return false; -} - -String WebServer::hostHeader() { - return _hostHeader; -} - -void WebServer::onFileUpload(THandlerFunction fn) { - _fileUploadHandler = fn; -} - -void WebServer::onNotFound(THandlerFunction fn) { - _notFoundHandler = fn; -} - -void WebServer::_handleRequest() { - bool handled = false; - if (!_currentHandler){ - log_e("request handler not found"); - } - else { - handled = _currentHandler->handle(*this, _currentMethod, _currentUri); - if (!handled) { - log_e("request handler failed to handle request"); - } - } - if (!handled && _notFoundHandler) { - _notFoundHandler(); - handled = true; - } - if (!handled) { - using namespace mime; - send(404, String(FPSTR(mimeTable[html].mimeType)), String(F("Not found: ")) + _currentUri); - handled = true; - } - if (handled) { - _finalizeResponse(); - } - _currentUri = ""; -} - - -void WebServer::_finalizeResponse() { - if (_chunked) { - sendContent(""); - } -} - -String WebServer::_responseCodeToString(int code) { - switch (code) { - case 100: return F("Continue"); - case 101: return F("Switching Protocols"); - case 200: return F("OK"); - case 201: return F("Created"); - case 202: return F("Accepted"); - case 203: return F("Non-Authoritative Information"); - case 204: return F("No Content"); - case 205: return F("Reset Content"); - case 206: return F("Partial Content"); - case 300: return F("Multiple Choices"); - case 301: return F("Moved Permanently"); - case 302: return F("Found"); - case 303: return F("See Other"); - case 304: return F("Not Modified"); - case 305: return F("Use Proxy"); - case 307: return F("Temporary Redirect"); - case 400: return F("Bad Request"); - case 401: return F("Unauthorized"); - case 402: return F("Payment Required"); - case 403: return F("Forbidden"); - case 404: return F("Not Found"); - case 405: return F("Method Not Allowed"); - case 406: return F("Not Acceptable"); - case 407: return F("Proxy Authentication Required"); - case 408: return F("Request Time-out"); - case 409: return F("Conflict"); - case 410: return F("Gone"); - case 411: return F("Length Required"); - case 412: return F("Precondition Failed"); - case 413: return F("Request Entity Too Large"); - case 414: return F("Request-URI Too Large"); - case 415: return F("Unsupported Media Type"); - case 416: return F("Requested range not satisfiable"); - case 417: return F("Expectation Failed"); - case 500: return F("Internal Server Error"); - case 501: return F("Not Implemented"); - case 502: return F("Bad Gateway"); - case 503: return F("Service Unavailable"); - case 504: return F("Gateway Time-out"); - case 505: return F("HTTP Version not supported"); - default: return F(""); - } -} diff --git a/libraries/WebServer/src/WebServer.h b/libraries/WebServer/src/WebServer.h deleted file mode 100644 index 97aa032e1f4..00000000000 --- a/libraries/WebServer/src/WebServer.h +++ /dev/null @@ -1,207 +0,0 @@ -/* - WebServer.h - Dead simple web-server. - Supports only one simultaneous client, knows how to handle GET and POST. - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Modified 8 May 2015 by Hristo Gochkov (proper post and file upload handling) -*/ - - -#ifndef WEBSERVER_H -#define WEBSERVER_H - -#include -#include -#include -#include "HTTP_Method.h" - -enum HTTPUploadStatus { UPLOAD_FILE_START, UPLOAD_FILE_WRITE, UPLOAD_FILE_END, - UPLOAD_FILE_ABORTED }; -enum HTTPClientStatus { HC_NONE, HC_WAIT_READ, HC_WAIT_CLOSE }; -enum HTTPAuthMethod { BASIC_AUTH, DIGEST_AUTH }; - -#define HTTP_DOWNLOAD_UNIT_SIZE 1436 - -#ifndef HTTP_UPLOAD_BUFLEN -#define HTTP_UPLOAD_BUFLEN 1436 -#endif - -#define HTTP_MAX_DATA_WAIT 5000 //ms to wait for the client to send the request -#define HTTP_MAX_POST_WAIT 5000 //ms to wait for POST data to arrive -#define HTTP_MAX_SEND_WAIT 5000 //ms to wait for data chunk to be ACKed -#define HTTP_MAX_CLOSE_WAIT 2000 //ms to wait for the client to close the connection - -#define CONTENT_LENGTH_UNKNOWN ((size_t) -1) -#define CONTENT_LENGTH_NOT_SET ((size_t) -2) - -class WebServer; - -typedef struct { - HTTPUploadStatus status; - String filename; - String name; - String type; - size_t totalSize; // file size - size_t currentSize; // size of data currently in buf - uint8_t buf[HTTP_UPLOAD_BUFLEN]; -} HTTPUpload; - -#include "detail/RequestHandler.h" - -namespace fs { -class FS; -} - -class WebServer -{ -public: - WebServer(IPAddress addr, int port = 80); - WebServer(int port = 80); - virtual ~WebServer(); - - virtual void begin(); - virtual void begin(uint16_t port); - virtual void handleClient(); - - virtual void close(); - void stop(); - - bool authenticate(const char * username, const char * password); - void requestAuthentication(HTTPAuthMethod mode = BASIC_AUTH, const char* realm = NULL, const String& authFailMsg = String("") ); - - typedef std::function THandlerFunction; - void on(const String &uri, THandlerFunction handler); - void on(const String &uri, HTTPMethod method, THandlerFunction fn); - void on(const String &uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn); - void addHandler(RequestHandler* handler); - void serveStatic(const char* uri, fs::FS& fs, const char* path, const char* cache_header = NULL ); - void onNotFound(THandlerFunction fn); //called when handler is not assigned - void onFileUpload(THandlerFunction fn); //handle file uploads - - String uri() { return _currentUri; } - HTTPMethod method() { return _currentMethod; } - virtual WiFiClient client() { return _currentClient; } - HTTPUpload& upload() { return *_currentUpload; } - - String pathArg(unsigned int i); // get request path argument by number - String arg(String name); // get request argument value by name - String arg(int i); // get request argument value by number - String argName(int i); // get request argument name by number - int args(); // get arguments count - bool hasArg(String name); // check if argument exists - void collectHeaders(const char* headerKeys[], const size_t headerKeysCount); // set the request headers to collect - String header(String name); // get request header value by name - String header(int i); // get request header value by number - String headerName(int i); // get request header name by number - int headers(); // get header count - bool hasHeader(String name); // check if header exists - - String hostHeader(); // get request host header if available or empty String if not - - // send response to the client - // code - HTTP response code, can be 200 or 404 - // content_type - HTTP content type, like "text/plain" or "image/png" - // content - actual content body - void send(int code, const char* content_type = NULL, const String& content = String("")); - void send(int code, char* content_type, const String& content); - void send(int code, const String& content_type, const String& content); - void send_P(int code, PGM_P content_type, PGM_P content); - void send_P(int code, PGM_P content_type, PGM_P content, size_t contentLength); - - void enableCORS(boolean value = true); - void enableCrossOrigin(boolean value = true); - - void setContentLength(const size_t contentLength); - void sendHeader(const String& name, const String& value, bool first = false); - void sendContent(const String& content); - void sendContent_P(PGM_P content); - void sendContent_P(PGM_P content, size_t size); - - static String urlDecode(const String& text); - - template - size_t streamFile(T &file, const String& contentType) { - _streamFileCore(file.size(), file.name(), contentType); - return _currentClient.write(file); - } - -protected: - virtual size_t _currentClientWrite(const char* b, size_t l) { return _currentClient.write( b, l ); } - virtual size_t _currentClientWrite_P(PGM_P b, size_t l) { return _currentClient.write_P( b, l ); } - void _addRequestHandler(RequestHandler* handler); - void _handleRequest(); - void _finalizeResponse(); - bool _parseRequest(WiFiClient& client); - void _parseArguments(String data); - static String _responseCodeToString(int code); - bool _parseForm(WiFiClient& client, String boundary, uint32_t len); - bool _parseFormUploadAborted(); - void _uploadWriteByte(uint8_t b); - int _uploadReadByte(WiFiClient& client); - void _prepareHeader(String& response, int code, const char* content_type, size_t contentLength); - bool _collectHeader(const char* headerName, const char* headerValue); - - void _streamFileCore(const size_t fileSize, const String & fileName, const String & contentType); - - String _getRandomHexString(); - // for extracting Auth parameters - String _extractParam(String& authReq,const String& param,const char delimit = '"'); - - struct RequestArgument { - String key; - String value; - }; - - boolean _corsEnabled; - WiFiServer _server; - - WiFiClient _currentClient; - HTTPMethod _currentMethod; - String _currentUri; - uint8_t _currentVersion; - HTTPClientStatus _currentStatus; - unsigned long _statusChange; - - RequestHandler* _currentHandler; - RequestHandler* _firstHandler; - RequestHandler* _lastHandler; - THandlerFunction _notFoundHandler; - THandlerFunction _fileUploadHandler; - - int _currentArgCount; - RequestArgument* _currentArgs; - int _postArgsLen; - RequestArgument* _postArgs; - - std::unique_ptr _currentUpload; - - int _headerKeysCount; - RequestArgument* _currentHeaders; - size_t _contentLength; - String _responseHeaders; - - String _hostHeader; - bool _chunked; - - String _snonce; // Store noance and opaque for future comparison - String _sopaque; - String _srealm; // Store the Auth realm between Calls - -}; - - -#endif //ESP8266WEBSERVER_H diff --git a/libraries/WebServer/src/detail/RequestHandler.h b/libraries/WebServer/src/detail/RequestHandler.h deleted file mode 100644 index 871ae5c8b3d..00000000000 --- a/libraries/WebServer/src/detail/RequestHandler.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef REQUESTHANDLER_H -#define REQUESTHANDLER_H - -#include -#include - -class RequestHandler { -public: - virtual ~RequestHandler() { } - virtual bool canHandle(HTTPMethod method, String uri) { (void) method; (void) uri; return false; } - virtual bool canUpload(String uri) { (void) uri; return false; } - virtual bool handle(WebServer& server, HTTPMethod requestMethod, String requestUri) { (void) server; (void) requestMethod; (void) requestUri; return false; } - virtual void upload(WebServer& server, String requestUri, HTTPUpload& upload) { (void) server; (void) requestUri; (void) upload; } - - RequestHandler* next() { return _next; } - void next(RequestHandler* r) { _next = r; } - -private: - RequestHandler* _next = nullptr; - -protected: - std::vector pathArgs; - -public: - const String& pathArg(unsigned int i) { - assert(i < pathArgs.size()); - return pathArgs[i]; - } -}; - -#endif //REQUESTHANDLER_H diff --git a/libraries/WebServer/src/detail/RequestHandlersImpl.h b/libraries/WebServer/src/detail/RequestHandlersImpl.h deleted file mode 100644 index babca4e27e3..00000000000 --- a/libraries/WebServer/src/detail/RequestHandlersImpl.h +++ /dev/null @@ -1,187 +0,0 @@ -#ifndef REQUESTHANDLERSIMPL_H -#define REQUESTHANDLERSIMPL_H - -#include "RequestHandler.h" -#include "mimetable.h" -#include "WString.h" - -using namespace mime; - -class FunctionRequestHandler : public RequestHandler { -public: - FunctionRequestHandler(WebServer::THandlerFunction fn, WebServer::THandlerFunction ufn, const String &uri, HTTPMethod method) - : _fn(fn) - , _ufn(ufn) - , _uri(uri) - , _method(method) - { - int numParams = 0, start = 0; - do { - start = _uri.indexOf("{}", start); - if (start > 0) { - numParams++; - start += 2; - } - } while (start > 0); - pathArgs.resize(numParams); - } - - bool canHandle(HTTPMethod requestMethod, String requestUri) override { - if (_method != HTTP_ANY && _method != requestMethod) - return false; - - if (_uri == requestUri) - return true; - - size_t uriLength = _uri.length(); - unsigned int pathArgIndex = 0; - unsigned int requestUriIndex = 0; - for (unsigned int i = 0; i < uriLength; i++, requestUriIndex++) { - char uriChar = _uri[i]; - char requestUriChar = requestUri[requestUriIndex]; - - if (uriChar == requestUriChar) - continue; - if (uriChar != '{') - return false; - - i += 2; // index of char after '}' - if (i >= uriLength) { - // there is no char after '}' - pathArgs[pathArgIndex] = requestUri.substring(requestUriIndex); - return pathArgs[pathArgIndex].indexOf("/") == -1; // path argument may not contain a '/' - } - else - { - char charEnd = _uri[i]; - int uriIndex = requestUri.indexOf(charEnd, requestUriIndex); - if (uriIndex < 0) - return false; - pathArgs[pathArgIndex] = requestUri.substring(requestUriIndex, uriIndex); - requestUriIndex = (unsigned int) uriIndex; - } - pathArgIndex++; - } - - return requestUriIndex >= requestUri.length(); - } - - bool canUpload(String requestUri) override { - if (!_ufn || !canHandle(HTTP_POST, requestUri)) - return false; - - return true; - } - - bool handle(WebServer& server, HTTPMethod requestMethod, String requestUri) override { - (void) server; - if (!canHandle(requestMethod, requestUri)) - return false; - - _fn(); - return true; - } - - void upload(WebServer& server, String requestUri, HTTPUpload& upload) override { - (void) server; - (void) upload; - if (canUpload(requestUri)) - _ufn(); - } - -protected: - WebServer::THandlerFunction _fn; - WebServer::THandlerFunction _ufn; - String _uri; - HTTPMethod _method; -}; - -class StaticRequestHandler : public RequestHandler { -public: - StaticRequestHandler(FS& fs, const char* path, const char* uri, const char* cache_header) - : _fs(fs) - , _uri(uri) - , _path(path) - , _cache_header(cache_header) - { - _isFile = fs.exists(path); - log_v("StaticRequestHandler: path=%s uri=%s isFile=%d, cache_header=%s\r\n", path, uri, _isFile, cache_header); - _baseUriLength = _uri.length(); - } - - bool canHandle(HTTPMethod requestMethod, String requestUri) override { - if (requestMethod != HTTP_GET) - return false; - - if ((_isFile && requestUri != _uri) || !requestUri.startsWith(_uri)) - return false; - - return true; - } - - bool handle(WebServer& server, HTTPMethod requestMethod, String requestUri) override { - if (!canHandle(requestMethod, requestUri)) - return false; - - log_v("StaticRequestHandler::handle: request=%s _uri=%s\r\n", requestUri.c_str(), _uri.c_str()); - - String path(_path); - - if (!_isFile) { - // Base URI doesn't point to a file. - // If a directory is requested, look for index file. - if (requestUri.endsWith("/")) - requestUri += "index.htm"; - - // Append whatever follows this URI in request to get the file path. - path += requestUri.substring(_baseUriLength); - } - log_v("StaticRequestHandler::handle: path=%s, isFile=%d\r\n", path.c_str(), _isFile); - - String contentType = getContentType(path); - - // look for gz file, only if the original specified path is not a gz. So part only works to send gzip via content encoding when a non compressed is asked for - // if you point the the path to gzip you will serve the gzip as content type "application/x-gzip", not text or javascript etc... - if (!path.endsWith(FPSTR(mimeTable[gz].endsWith)) && !_fs.exists(path)) { - String pathWithGz = path + FPSTR(mimeTable[gz].endsWith); - if(_fs.exists(pathWithGz)) - path += FPSTR(mimeTable[gz].endsWith); - } - - File f = _fs.open(path, "r"); - if (!f) - return false; - - if (_cache_header.length() != 0) - server.sendHeader("Cache-Control", _cache_header); - - server.streamFile(f, contentType); - return true; - } - - static String getContentType(const String& path) { - char buff[sizeof(mimeTable[0].mimeType)]; - // Check all entries but last one for match, return if found - for (size_t i=0; i < sizeof(mimeTable)/sizeof(mimeTable[0])-1; i++) { - strcpy_P(buff, mimeTable[i].endsWith); - if (path.endsWith(buff)) { - strcpy_P(buff, mimeTable[i].mimeType); - return String(buff); - } - } - // Fall-through and just return default type - strcpy_P(buff, mimeTable[sizeof(mimeTable)/sizeof(mimeTable[0])-1].mimeType); - return String(buff); - } - -protected: - FS _fs; - String _uri; - String _path; - String _cache_header; - bool _isFile; - size_t _baseUriLength; -}; - - -#endif //REQUESTHANDLERSIMPL_H diff --git a/libraries/WebServer/src/detail/mimetable.cpp b/libraries/WebServer/src/detail/mimetable.cpp deleted file mode 100644 index 563556a6358..00000000000 --- a/libraries/WebServer/src/detail/mimetable.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "mimetable.h" -#include "pgmspace.h" - -namespace mime -{ - -// Table of extension->MIME strings stored in PROGMEM, needs to be global due to GCC section typing rules -const Entry mimeTable[maxType] = -{ - { ".html", "text/html" }, - { ".htm", "text/html" }, - { ".css", "text/css" }, - { ".txt", "text/plain" }, - { ".js", "application/javascript" }, - { ".json", "application/json" }, - { ".png", "image/png" }, - { ".gif", "image/gif" }, - { ".jpg", "image/jpeg" }, - { ".ico", "image/x-icon" }, - { ".svg", "image/svg+xml" }, - { ".ttf", "application/x-font-ttf" }, - { ".otf", "application/x-font-opentype" }, - { ".woff", "application/font-woff" }, - { ".woff2", "application/font-woff2" }, - { ".eot", "application/vnd.ms-fontobject" }, - { ".sfnt", "application/font-sfnt" }, - { ".xml", "text/xml" }, - { ".pdf", "application/pdf" }, - { ".zip", "application/zip" }, - { ".gz", "application/x-gzip" }, - { ".appcache", "text/cache-manifest" }, - { "", "application/octet-stream" } -}; - -} diff --git a/libraries/WebServer/src/detail/mimetable.h b/libraries/WebServer/src/detail/mimetable.h deleted file mode 100644 index 191356c489a..00000000000 --- a/libraries/WebServer/src/detail/mimetable.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef __MIMETABLE_H__ -#define __MIMETABLE_H__ - - -namespace mime -{ - -enum type -{ - html, - htm, - css, - txt, - js, - json, - png, - gif, - jpg, - ico, - svg, - ttf, - otf, - woff, - woff2, - eot, - sfnt, - xml, - pdf, - zip, - gz, - appcache, - none, - maxType -}; - -struct Entry -{ - const char endsWith[16]; - const char mimeType[32]; -}; - - -extern const Entry mimeTable[maxType]; -} - - -#endif diff --git a/libraries/WiFi/examples/ETH_LAN8720/ETH_LAN8720.ino b/libraries/WiFi/examples/ETH_LAN8720/ETH_LAN8720.ino deleted file mode 100644 index 44bd1f965a0..00000000000 --- a/libraries/WiFi/examples/ETH_LAN8720/ETH_LAN8720.ino +++ /dev/null @@ -1,81 +0,0 @@ -/* - This sketch shows the Ethernet event usage - -*/ - -#include - -static bool eth_connected = false; - -void WiFiEvent(WiFiEvent_t event) -{ - switch (event) { - case SYSTEM_EVENT_ETH_START: - Serial.println("ETH Started"); - //set eth hostname here - ETH.setHostname("esp32-ethernet"); - break; - case SYSTEM_EVENT_ETH_CONNECTED: - Serial.println("ETH Connected"); - break; - case SYSTEM_EVENT_ETH_GOT_IP: - Serial.print("ETH MAC: "); - Serial.print(ETH.macAddress()); - Serial.print(", IPv4: "); - Serial.print(ETH.localIP()); - if (ETH.fullDuplex()) { - Serial.print(", FULL_DUPLEX"); - } - Serial.print(", "); - Serial.print(ETH.linkSpeed()); - Serial.println("Mbps"); - eth_connected = true; - break; - case SYSTEM_EVENT_ETH_DISCONNECTED: - Serial.println("ETH Disconnected"); - eth_connected = false; - break; - case SYSTEM_EVENT_ETH_STOP: - Serial.println("ETH Stopped"); - eth_connected = false; - break; - default: - break; - } -} - -void testClient(const char * host, uint16_t port) -{ - Serial.print("\nconnecting to "); - Serial.println(host); - - WiFiClient client; - if (!client.connect(host, port)) { - Serial.println("connection failed"); - return; - } - client.printf("GET / HTTP/1.1\r\nHost: %s\r\n\r\n", host); - while (client.connected() && !client.available()); - while (client.available()) { - Serial.write(client.read()); - } - - Serial.println("closing connection\n"); - client.stop(); -} - -void setup() -{ - Serial.begin(115200); - WiFi.onEvent(WiFiEvent); - ETH.begin(); -} - - -void loop() -{ - if (eth_connected) { - testClient("google.com", 80); - } - delay(10000); -} diff --git a/libraries/WiFi/examples/ETH_LAN8720_internal_clock/ETH_LAN8720_internal_clock.ino b/libraries/WiFi/examples/ETH_LAN8720_internal_clock/ETH_LAN8720_internal_clock.ino deleted file mode 100644 index 6e726b7080e..00000000000 --- a/libraries/WiFi/examples/ETH_LAN8720_internal_clock/ETH_LAN8720_internal_clock.ino +++ /dev/null @@ -1,103 +0,0 @@ -/* - This sketch shows how to configure different external or internal clock sources for the Ethernet PHY -*/ - -#include - -/* - * ETH_CLOCK_GPIO0_IN - default: external clock from crystal oscillator - * ETH_CLOCK_GPIO0_OUT - 50MHz clock from internal APLL output on GPIO0 - possibly an inverter is needed for LAN8720 - * ETH_CLOCK_GPIO16_OUT - 50MHz clock from internal APLL output on GPIO16 - possibly an inverter is needed for LAN8720 - * ETH_CLOCK_GPIO17_OUT - 50MHz clock from internal APLL inverted output on GPIO17 - tested with LAN8720 -*/ -#ifdef ETH_CLK_MODE -#undef ETH_CLK_MODE -#endif -#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT - -// Pin# of the enable signal for the external crystal oscillator (-1 to disable for internal APLL source) -#define ETH_POWER_PIN -1 - -// Type of the Ethernet PHY (LAN8720 or TLK110) -#define ETH_TYPE ETH_PHY_LAN8720 - -// I²C-address of Ethernet PHY (0 or 1 for LAN8720, 31 for TLK110) -#define ETH_ADDR 0 - -// Pin# of the I²C clock signal for the Ethernet PHY -#define ETH_MDC_PIN 15 - -// Pin# of the I²C IO signal for the Ethernet PHY -#define ETH_MDIO_PIN 2 - - -static bool eth_connected = false; - -void WiFiEvent(WiFiEvent_t event) { - switch (event) { - case SYSTEM_EVENT_ETH_START: - Serial.println("ETH Started"); - //set eth hostname here - ETH.setHostname("esp32-ethernet"); - break; - case SYSTEM_EVENT_ETH_CONNECTED: - Serial.println("ETH Connected"); - break; - case SYSTEM_EVENT_ETH_GOT_IP: - Serial.print("ETH MAC: "); - Serial.print(ETH.macAddress()); - Serial.print(", IPv4: "); - Serial.print(ETH.localIP()); - if (ETH.fullDuplex()) { - Serial.print(", FULL_DUPLEX"); - } - Serial.print(", "); - Serial.print(ETH.linkSpeed()); - Serial.println("Mbps"); - eth_connected = true; - break; - case SYSTEM_EVENT_ETH_DISCONNECTED: - Serial.println("ETH Disconnected"); - eth_connected = false; - break; - case SYSTEM_EVENT_ETH_STOP: - Serial.println("ETH Stopped"); - eth_connected = false; - break; - default: - break; - } -} - -void testClient(const char * host, uint16_t port) { - Serial.print("\nconnecting to "); - Serial.println(host); - - WiFiClient client; - if (!client.connect(host, port)) { - Serial.println("connection failed"); - return; - } - client.printf("GET / HTTP/1.1\r\nHost: %s\r\n\r\n", host); - while (client.connected() && !client.available()); - while (client.available()) { - Serial.write(client.read()); - } - - Serial.println("closing connection\n"); - client.stop(); -} - -void setup() { - Serial.begin(115200); - WiFi.onEvent(WiFiEvent); - ETH.begin(ETH_ADDR, ETH_POWER_PIN, ETH_MDC_PIN, ETH_MDIO_PIN, ETH_TYPE, ETH_CLK_MODE); -} - - -void loop() { - if (eth_connected) { - testClient("google.com", 80); - } - delay(10000); -} diff --git a/libraries/WiFi/examples/ETH_TLK110/ETH_TLK110.ino b/libraries/WiFi/examples/ETH_TLK110/ETH_TLK110.ino deleted file mode 100644 index f2c127945ad..00000000000 --- a/libraries/WiFi/examples/ETH_TLK110/ETH_TLK110.ino +++ /dev/null @@ -1,87 +0,0 @@ -/* - This sketch shows the Ethernet event usage - -*/ - -#include - -#define ETH_ADDR 31 -#define ETH_POWER_PIN 17 -#define ETH_MDC_PIN 23 -#define ETH_MDIO_PIN 18 -#define ETH_TYPE ETH_PHY_TLK110 - -static bool eth_connected = false; - -void WiFiEvent(WiFiEvent_t event) -{ - switch (event) { - case SYSTEM_EVENT_ETH_START: - Serial.println("ETH Started"); - //set eth hostname here - ETH.setHostname("esp32-ethernet"); - break; - case SYSTEM_EVENT_ETH_CONNECTED: - Serial.println("ETH Connected"); - break; - case SYSTEM_EVENT_ETH_GOT_IP: - Serial.print("ETH MAC: "); - Serial.print(ETH.macAddress()); - Serial.print(", IPv4: "); - Serial.print(ETH.localIP()); - if (ETH.fullDuplex()) { - Serial.print(", FULL_DUPLEX"); - } - Serial.print(", "); - Serial.print(ETH.linkSpeed()); - Serial.println("Mbps"); - eth_connected = true; - break; - case SYSTEM_EVENT_ETH_DISCONNECTED: - Serial.println("ETH Disconnected"); - eth_connected = false; - break; - case SYSTEM_EVENT_ETH_STOP: - Serial.println("ETH Stopped"); - eth_connected = false; - break; - default: - break; - } -} - -void testClient(const char * host, uint16_t port) -{ - Serial.print("\nconnecting to "); - Serial.println(host); - - WiFiClient client; - if (!client.connect(host, port)) { - Serial.println("connection failed"); - return; - } - client.printf("GET / HTTP/1.1\r\nHost: %s\r\n\r\n", host); - while (client.connected() && !client.available()); - while (client.available()) { - Serial.write(client.read()); - } - - Serial.println("closing connection\n"); - client.stop(); -} - -void setup() -{ - Serial.begin(115200); - WiFi.onEvent(WiFiEvent); - ETH.begin(ETH_ADDR, ETH_POWER_PIN, ETH_MDC_PIN, ETH_MDIO_PIN, ETH_TYPE); -} - - -void loop() -{ - if (eth_connected) { - testClient("google.com", 80); - } - delay(10000); -} diff --git a/libraries/WiFi/examples/SimpleWiFiServer/SimpleWiFiServer.ino b/libraries/WiFi/examples/SimpleWiFiServer/SimpleWiFiServer.ino deleted file mode 100644 index 91ac9078613..00000000000 --- a/libraries/WiFi/examples/SimpleWiFiServer/SimpleWiFiServer.ino +++ /dev/null @@ -1,116 +0,0 @@ -/* - WiFi Web Server LED Blink - - A simple web server that lets you blink an LED via the web. - This sketch will print the IP address of your WiFi Shield (once connected) - to the Serial monitor. From there, you can open that address in a web browser - to turn on and off the LED on pin 5. - - If the IP address of your shield is yourAddress: - http://yourAddress/H turns the LED on - http://yourAddress/L turns it off - - This example is written for a network using WPA encryption. For - WEP or WPA, change the Wifi.begin() call accordingly. - - Circuit: - * WiFi shield attached - * LED attached to pin 5 - - created for arduino 25 Nov 2012 - by Tom Igoe - -ported for sparkfun esp32 -31.01.2017 by Jan Hendrik Berlin - - */ - -#include - -const char* ssid = "yourssid"; -const char* password = "yourpasswd"; - -WiFiServer server(80); - -void setup() -{ - Serial.begin(115200); - pinMode(5, OUTPUT); // set the LED pin mode - - delay(10); - - // We start by connecting to a WiFi network - - Serial.println(); - Serial.println(); - Serial.print("Connecting to "); - Serial.println(ssid); - - WiFi.begin(ssid, password); - - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - } - - Serial.println(""); - Serial.println("WiFi connected."); - Serial.println("IP address: "); - Serial.println(WiFi.localIP()); - - server.begin(); - -} - -int value = 0; - -void loop(){ - WiFiClient client = server.available(); // listen for incoming clients - - if (client) { // if you get a client, - Serial.println("New Client."); // print a message out the serial port - String currentLine = ""; // make a String to hold incoming data from the client - while (client.connected()) { // loop while the client's connected - if (client.available()) { // if there's bytes to read from the client, - char c = client.read(); // read a byte, then - Serial.write(c); // print it out the serial monitor - if (c == '\n') { // if the byte is a newline character - - // if the current line is blank, you got two newline characters in a row. - // that's the end of the client HTTP request, so send a response: - if (currentLine.length() == 0) { - // HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK) - // and a content-type so the client knows what's coming, then a blank line: - client.println("HTTP/1.1 200 OK"); - client.println("Content-type:text/html"); - client.println(); - - // the content of the HTTP response follows the header: - client.print("Click here to turn the LED on pin 5 on.
"); - client.print("Click here to turn the LED on pin 5 off.
"); - - // The HTTP response ends with another blank line: - client.println(); - // break out of the while loop: - break; - } else { // if you got a newline, then clear currentLine: - currentLine = ""; - } - } else if (c != '\r') { // if you got anything else but a carriage return character, - currentLine += c; // add it to the end of the currentLine - } - - // Check to see if the client request was "GET /H" or "GET /L": - if (currentLine.endsWith("GET /H")) { - digitalWrite(5, HIGH); // GET /H turns the LED on - } - if (currentLine.endsWith("GET /L")) { - digitalWrite(5, LOW); // GET /L turns the LED off - } - } - } - // close the connection: - client.stop(); - Serial.println("Client Disconnected."); - } -} diff --git a/libraries/WiFi/examples/WPS/README.md b/libraries/WiFi/examples/WPS/README.md deleted file mode 100644 index 69431423d5a..00000000000 --- a/libraries/WiFi/examples/WPS/README.md +++ /dev/null @@ -1,104 +0,0 @@ -Example Serial Logs For Various Cases -====================================== - -For WPS Push Button method,after the ESP32 boots up and prints that WPS has started, press the button that looks something like [this](https://www.verizon.com/supportresources/images/fqgrouter-frontview-wps-button.png) on your router. In case you dont find anything similar, check your router specs if it does really support WPS Push functionality. - -As for WPS Pin Mode, it will output a 8 digit Pin on the Serial Monitor that will change every 2 minutes if it hasn't connected. You need to log in to your router (generally reaching 192.168.0.1) and enter the pin shown in Serial Monitor in the WPS Settings of your router. - -#### WPS Push Button Failure - -``` -ets Jun 8 2016 00:22:57 - -rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) -configsip: 0, SPIWP:0xee -clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 -mode:DIO, clock div:1 -load:0x3fff0010,len:4 -load:0x3fff0014,len:732 -load:0x40078000,len:0 -load:0x40078000,len:11572 -entry 0x40078a14 - -Starting WPS -Station Mode Started -WPS Timedout, retrying -WPS Timedout, retrying -``` - -#### WPS Push Button Successfull - -``` -ets Jun 8 2016 00:22:57 - -rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) -ets Jun 8 2016 00:22:57 - -rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) -configsip: 0, SPIWP:0xee -clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 -mode:DIO, clock div:1 -load:0x3fff0010,len:4 -load:0x3fff0014,len:732 -load:0x40078000,len:0 -load:0x40078000,len:11572 -entry 0x40078a14 - -Starting WPS -Station Mode Started -WPS Successfull, stopping WPS and connecting to: < Your Router SSID > -Disconnected from station, attempting reconnection -Connected to : < Your Router SSID > -Got IP: 192.168.1.100 -``` - -#### WPS PIN Failure - -``` -ets Jun 8 2016 00:22:57 - -rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) -ets Jun 8 2016 00:22:57 - -rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) -configsip: 0, SPIWP:0xee -clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 -mode:DIO, clock div:1 -load:0x3fff0010,len:4 -load:0x3fff0014,len:732 -load:0x40078000,len:0 -load:0x40078000,len:11572 -entry 0x40078a14 - -Starting WPS -Station Mode Started -WPS_PIN = 94842104 -WPS Timedout, retrying -WPS_PIN = 55814171 -WPS Timedout, retrying -WPS_PIN = 71321622 -``` - -#### WPS PIN Successfull - -``` -ets Jun 8 2016 00:22:57 - -rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) -configsip: 0, SPIWP:0xee -clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 -mode:DIO, clock div:1 -load:0x3fff0010,len:4 -load:0x3fff0014,len:732 -load:0x40078000,len:0 -load:0x40078000,len:11572 -entry 0x40078a14 - -Starting WPS -Station Mode Started -WPS_PIN = 36807581 -WPS Successfull, stopping WPS and connecting to: -Disconnected from station, attempting reconnection -Connected to : -Got IP: 192.168.1.100 -``` diff --git a/libraries/WiFi/examples/WPS/WPS.ino b/libraries/WiFi/examples/WPS/WPS.ino deleted file mode 100644 index 06ccbb38438..00000000000 --- a/libraries/WiFi/examples/WPS/WPS.ino +++ /dev/null @@ -1,109 +0,0 @@ -/* -Example Code To Get ESP32 To Connect To A Router Using WPS -=========================================================== -This example code provides both Push Button method and Pin -based WPS entry to get your ESP connected to your WiFi router. - -Hardware Requirements -======================== -ESP32 and a Router having atleast one WPS functionality - -This code is under Public Domain License. - -Author: -Pranav Cherukupalli -*/ - -#include "WiFi.h" -#include "esp_wps.h" -/* -Change the definition of the WPS mode -from WPS_TYPE_PBC to WPS_TYPE_PIN in -the case that you are using pin type -WPS -*/ -#define ESP_WPS_MODE WPS_TYPE_PBC -#define ESP_MANUFACTURER "ESPRESSIF" -#define ESP_MODEL_NUMBER "ESP32" -#define ESP_MODEL_NAME "ESPRESSIF IOT" -#define ESP_DEVICE_NAME "ESP STATION" - -static esp_wps_config_t config; - -void wpsInitConfig(){ - config.crypto_funcs = &g_wifi_default_wps_crypto_funcs; - config.wps_type = ESP_WPS_MODE; - strcpy(config.factory_info.manufacturer, ESP_MANUFACTURER); - strcpy(config.factory_info.model_number, ESP_MODEL_NUMBER); - strcpy(config.factory_info.model_name, ESP_MODEL_NAME); - strcpy(config.factory_info.device_name, ESP_DEVICE_NAME); -} - -String wpspin2string(uint8_t a[]){ - char wps_pin[9]; - for(int i=0;i<8;i++){ - wps_pin[i] = a[i]; - } - wps_pin[8] = '\0'; - return (String)wps_pin; -} - -void WiFiEvent(WiFiEvent_t event, system_event_info_t info){ - switch(event){ - case SYSTEM_EVENT_STA_START: - Serial.println("Station Mode Started"); - break; - case SYSTEM_EVENT_STA_GOT_IP: - Serial.println("Connected to :" + String(WiFi.SSID())); - Serial.print("Got IP: "); - Serial.println(WiFi.localIP()); - break; - case SYSTEM_EVENT_STA_DISCONNECTED: - Serial.println("Disconnected from station, attempting reconnection"); - WiFi.reconnect(); - break; - case SYSTEM_EVENT_STA_WPS_ER_SUCCESS: - Serial.println("WPS Successfull, stopping WPS and connecting to: " + String(WiFi.SSID())); - esp_wifi_wps_disable(); - delay(10); - WiFi.begin(); - break; - case SYSTEM_EVENT_STA_WPS_ER_FAILED: - Serial.println("WPS Failed, retrying"); - esp_wifi_wps_disable(); - esp_wifi_wps_enable(&config); - esp_wifi_wps_start(0); - break; - case SYSTEM_EVENT_STA_WPS_ER_TIMEOUT: - Serial.println("WPS Timedout, retrying"); - esp_wifi_wps_disable(); - esp_wifi_wps_enable(&config); - esp_wifi_wps_start(0); - break; - case SYSTEM_EVENT_STA_WPS_ER_PIN: - Serial.println("WPS_PIN = " + wpspin2string(info.sta_er_pin.pin_code)); - break; - default: - break; - } -} - -void setup(){ - Serial.begin(115200); - delay(10); - - Serial.println(); - - WiFi.onEvent(WiFiEvent); - WiFi.mode(WIFI_MODE_STA); - - Serial.println("Starting WPS"); - - wpsInitConfig(); - esp_wifi_wps_enable(&config); - esp_wifi_wps_start(0); -} - -void loop(){ - //nothing to do here -} \ No newline at end of file diff --git a/libraries/WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino b/libraries/WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino deleted file mode 100644 index 4e654d12c79..00000000000 --- a/libraries/WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino +++ /dev/null @@ -1,93 +0,0 @@ -/* - WiFiAccessPoint.ino creates a WiFi access point and provides a web server on it. - - Steps: - 1. Connect to the access point "yourAp" - 2. Point your web browser to http://192.168.4.1/H to turn the LED on or http://192.168.4.1/L to turn it off - OR - Run raw TCP "GET /H" and "GET /L" on PuTTY terminal with 192.168.4.1 as IP address and 80 as port - - Created for arduino-esp32 on 04 July, 2018 - by Elochukwu Ifediora (fedy0) -*/ - -#include -#include -#include - -#define LED_BUILTIN 2 // Set the GPIO pin where you connected your test LED or comment this line out if your dev board has a built-in LED - -// Set these to your desired credentials. -const char *ssid = "yourAP"; -const char *password = "yourPassword"; - -WiFiServer server(80); - - -void setup() { - pinMode(LED_BUILTIN, OUTPUT); - - Serial.begin(115200); - Serial.println(); - Serial.println("Configuring access point..."); - - // You can remove the password parameter if you want the AP to be open. - WiFi.softAP(ssid, password); - IPAddress myIP = WiFi.softAPIP(); - Serial.print("AP IP address: "); - Serial.println(myIP); - server.begin(); - - Serial.println("Server started"); -} - -void loop() { - WiFiClient client = server.available(); // listen for incoming clients - - if (client) { // if you get a client, - Serial.println("New Client."); // print a message out the serial port - String currentLine = ""; // make a String to hold incoming data from the client - while (client.connected()) { // loop while the client's connected - if (client.available()) { // if there's bytes to read from the client, - char c = client.read(); // read a byte, then - Serial.write(c); // print it out the serial monitor - if (c == '\n') { // if the byte is a newline character - - // if the current line is blank, you got two newline characters in a row. - // that's the end of the client HTTP request, so send a response: - if (currentLine.length() == 0) { - // HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK) - // and a content-type so the client knows what's coming, then a blank line: - client.println("HTTP/1.1 200 OK"); - client.println("Content-type:text/html"); - client.println(); - - // the content of the HTTP response follows the header: - client.print("Click here to turn ON the LED.
"); - client.print("Click here to turn OFF the LED.
"); - - // The HTTP response ends with another blank line: - client.println(); - // break out of the while loop: - break; - } else { // if you got a newline, then clear currentLine: - currentLine = ""; - } - } else if (c != '\r') { // if you got anything else but a carriage return character, - currentLine += c; // add it to the end of the currentLine - } - - // Check to see if the client request was "GET /H" or "GET /L": - if (currentLine.endsWith("GET /H")) { - digitalWrite(LED_BUILTIN, HIGH); // GET /H turns the LED on - } - if (currentLine.endsWith("GET /L")) { - digitalWrite(LED_BUILTIN, LOW); // GET /L turns the LED off - } - } - } - // close the connection: - client.stop(); - Serial.println("Client Disconnected."); - } -} diff --git a/libraries/WiFi/examples/WiFiBlueToothSwitch/WiFiBlueToothSwitch.ino b/libraries/WiFi/examples/WiFiBlueToothSwitch/WiFiBlueToothSwitch.ino deleted file mode 100644 index e795bad83d6..00000000000 --- a/libraries/WiFi/examples/WiFiBlueToothSwitch/WiFiBlueToothSwitch.ino +++ /dev/null @@ -1,128 +0,0 @@ -// 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. - -// Sketch shows how to switch between WiFi and BlueTooth or use both -// Button is attached between GPIO 0 and GND and modes are switched with each press - -#include "WiFi.h" -#define STA_SSID "your-ssid" -#define STA_PASS "your-pass" -#define AP_SSID "esp32" - -enum { STEP_BTON, STEP_BTOFF, STEP_STA, STEP_AP, STEP_AP_STA, STEP_OFF, STEP_BT_STA, STEP_END }; - -void onButton(){ - static uint32_t step = STEP_BTON; - switch(step){ - case STEP_BTON://BT Only - Serial.println("** Starting BT"); - btStart(); - break; - case STEP_BTOFF://All Off - Serial.println("** Stopping BT"); - btStop(); - break; - case STEP_STA://STA Only - Serial.println("** Starting STA"); - WiFi.begin(STA_SSID, STA_PASS); - break; - case STEP_AP://AP Only - Serial.println("** Stopping STA"); - WiFi.mode(WIFI_AP); - Serial.println("** Starting AP"); - WiFi.softAP(AP_SSID); - break; - case STEP_AP_STA://AP+STA - Serial.println("** Starting STA"); - WiFi.begin(STA_SSID, STA_PASS); - break; - case STEP_OFF://All Off - Serial.println("** Stopping WiFi"); - WiFi.mode(WIFI_OFF); - break; - case STEP_BT_STA://BT+STA - Serial.println("** Starting STA+BT"); - WiFi.begin(STA_SSID, STA_PASS); - btStart(); - break; - case STEP_END://All Off - Serial.println("** Stopping WiFi+BT"); - WiFi.mode(WIFI_OFF); - btStop(); - break; - default: - break; - } - if(step == STEP_END){ - step = STEP_BTON; - } else { - step++; - } - //little debounce - delay(100); -} - -void WiFiEvent(WiFiEvent_t event){ - switch(event) { - case SYSTEM_EVENT_AP_START: - Serial.println("AP Started"); - WiFi.softAPsetHostname(AP_SSID); - break; - case SYSTEM_EVENT_AP_STOP: - Serial.println("AP Stopped"); - break; - case SYSTEM_EVENT_STA_START: - Serial.println("STA Started"); - WiFi.setHostname(AP_SSID); - break; - case SYSTEM_EVENT_STA_CONNECTED: - Serial.println("STA Connected"); - WiFi.enableIpV6(); - break; - case SYSTEM_EVENT_AP_STA_GOT_IP6: - Serial.print("STA IPv6: "); - Serial.println(WiFi.localIPv6()); - break; - case SYSTEM_EVENT_STA_GOT_IP: - Serial.print("STA IPv4: "); - Serial.println(WiFi.localIP()); - break; - case SYSTEM_EVENT_STA_DISCONNECTED: - Serial.println("STA Disconnected"); - break; - case SYSTEM_EVENT_STA_STOP: - Serial.println("STA Stopped"); - break; - default: - break; - } -} - -void setup() { - Serial.begin(115200); - pinMode(0, INPUT_PULLUP); - WiFi.onEvent(WiFiEvent); - Serial.print("ESP32 SDK: "); - Serial.println(ESP.getSdkVersion()); - Serial.println("Press the button to select the next mode"); -} - -void loop() { - static uint8_t lastPinState = 1; - uint8_t pinState = digitalRead(0); - if(!pinState && lastPinState){ - onButton(); - } - lastPinState = pinState; -} diff --git a/libraries/WiFi/examples/WiFiClient/WiFiClient.ino b/libraries/WiFi/examples/WiFiClient/WiFiClient.ino deleted file mode 100644 index 7dd9c8d0d35..00000000000 --- a/libraries/WiFi/examples/WiFiClient/WiFiClient.ino +++ /dev/null @@ -1,94 +0,0 @@ -/* - * This sketch sends data via HTTP GET requests to data.sparkfun.com service. - * - * You need to get streamId and privateKey at data.sparkfun.com and paste them - * below. Or just customize this script to talk to other HTTP servers. - * - */ - -#include - -const char* ssid = "your-ssid"; -const char* password = "your-password"; - -const char* host = "data.sparkfun.com"; -const char* streamId = "...................."; -const char* privateKey = "...................."; - -void setup() -{ - Serial.begin(115200); - delay(10); - - // We start by connecting to a WiFi network - - Serial.println(); - Serial.println(); - Serial.print("Connecting to "); - Serial.println(ssid); - - WiFi.begin(ssid, password); - - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - } - - Serial.println(""); - Serial.println("WiFi connected"); - Serial.println("IP address: "); - Serial.println(WiFi.localIP()); -} - -int value = 0; - -void loop() -{ - delay(5000); - ++value; - - Serial.print("connecting to "); - Serial.println(host); - - // Use WiFiClient class to create TCP connections - WiFiClient client; - const int httpPort = 80; - if (!client.connect(host, httpPort)) { - Serial.println("connection failed"); - return; - } - - // We now create a URI for the request - String url = "/input/"; - url += streamId; - url += "?private_key="; - url += privateKey; - url += "&value="; - url += value; - - Serial.print("Requesting URL: "); - Serial.println(url); - - // This will send the request to the server - client.print(String("GET ") + url + " HTTP/1.1\r\n" + - "Host: " + host + "\r\n" + - "Connection: close\r\n\r\n"); - unsigned long timeout = millis(); - while (client.available() == 0) { - if (millis() - timeout > 5000) { - Serial.println(">>> Client Timeout !"); - client.stop(); - return; - } - } - - // Read all the lines of the reply from server and print them to Serial - while(client.available()) { - String line = client.readStringUntil('\r'); - Serial.print(line); - } - - Serial.println(); - Serial.println("closing connection"); -} - diff --git a/libraries/WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino b/libraries/WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino deleted file mode 100644 index 647e846f68a..00000000000 --- a/libraries/WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino +++ /dev/null @@ -1,68 +0,0 @@ -/* - * This sketch sends a message to a TCP server - * - */ - -#include -#include - -WiFiMulti WiFiMulti; - -void setup() -{ - Serial.begin(115200); - delay(10); - - // We start by connecting to a WiFi network - WiFiMulti.addAP("SSID", "passpasspass"); - - Serial.println(); - Serial.println(); - Serial.print("Waiting for WiFi... "); - - while(WiFiMulti.run() != WL_CONNECTED) { - Serial.print("."); - delay(500); - } - - Serial.println(""); - Serial.println("WiFi connected"); - Serial.println("IP address: "); - Serial.println(WiFi.localIP()); - - delay(500); -} - - -void loop() -{ - const uint16_t port = 80; - const char * host = "192.168.1.1"; // ip or dns - - Serial.print("Connecting to "); - Serial.println(host); - - // Use WiFiClient class to create TCP connections - WiFiClient client; - - if (!client.connect(host, port)) { - Serial.println("Connection failed."); - Serial.println("Waiting 5 seconds before retrying..."); - delay(5000); - return; - } - - // This will send a request to the server - client.print("Send this data to the server"); - - //read back one line from the server - String line = client.readStringUntil('\r'); - client.println(line); - - Serial.println("Closing connection."); - client.stop(); - - Serial.println("Waiting 5 seconds before restarting..."); - delay(5000); -} - diff --git a/libraries/WiFi/examples/WiFiClientEnterprise/README.md b/libraries/WiFi/examples/WiFiClientEnterprise/README.md deleted file mode 100644 index 8160ddabccc..00000000000 --- a/libraries/WiFi/examples/WiFiClientEnterprise/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# ESP32-Eduroam -* Eduroam wifi connection with university login identity -* Working under Eduroam networks worldwide -* Methods: PEAP + MsCHAPv2 - -# Format -* IDENTITY = youridentity --> if connecting from different university, use youridentity@youruniversity.domain format -* PASSWORD = yourpassword - -# Usage -* Change IDENTITY -* Change password -* Upload sketch and enjoy! -* After sucessful assign of IP address, board will connect to HTTP page on internet to verify your authentification -* Board will auto reconnect to Eduroam if it lost connection - -# Tested locations -|University|Board|Method|Result| -|-------------|-------------| -----|------| -|Technical University in Košice (Slovakia)|ESP32 Devkit v1|PEAP + MsCHAPv2|Working| -|Technical University in Košice (Slovakia)|ESP32 Devmodule v4|PEAP + MsCHAPv2|Working on 6th attempt in loop| -|Slovak Technical University in Bratislava (Slovakia)|ESP32 Devkit v1|PEAP + MsCHAPv2|Working| -|University of Antwerp (Belgium)|Lolin32|PEAP + MsCHAPv2|Working| -|UPV Universitat Politècnica de València (Spain)|ESP32 Devmodule v4|PEAP + MsCHAPv2|Working| -|Local Zeroshell powered network|ESP32 Devkit v1|PEAP + MsCHAPv2|*Not working*| -|Hasselt University (Belgium)|xxx|PEAP + MsCHAPv2|Working with fix sketch| -|Universidad de Granada (Spain)|Lolin D32 Pro|PEAP + MsCHAPv2|Working| -|Universidad de Granada (Spain)|Lolin D32|PEAP + MsCHAPv2|Working| -|Universidade Federal de Santa Catarina (Brazil)|xxx|EAP-TTLS + MsCHAPv2|Working| -|University of Central Florida (Orlando, Florida)|ESP32 Built-in OLED – Heltec WiFi Kit 32|PEAP + MsCHAPv2|Working| -|Université de Montpellier (France)|NodeMCU-32S|PEAP + MsCHAPv2|Working| - -# Common errors - Switch to Debug mode for Serial monitor prints -|Error|Appearance|Solution| -|-------------|-------------|-------------| -|wifi: Set status to INIT|Frequent|Hold EN button for few seconds| -|HANDSHAKE_TIMEOUT|Rare|Bug was found under Zeroshell RADIUS authentization - Unsucessful connection| -|AUTH_EXPIRE|Common|In the case of weak wifi network signal, this error is quite common, bring your device closer to AP| -|ASSOC_EXPIRE|Rare|-| -# Sucessful connection example - ![alt text](https://i.nahraj.to/f/24Kc.png) -# Unsucessful connection example - ![alt text](https://camo.githubusercontent.com/87e47d1b27f4e8ace87423e40e8edbce7983bafa/68747470733a2f2f692e6e616872616a2e746f2f662f323435572e504e47) diff --git a/libraries/WiFi/examples/WiFiClientEnterprise/WiFiClientEnterprise.ino b/libraries/WiFi/examples/WiFiClientEnterprise/WiFiClientEnterprise.ino deleted file mode 100644 index 0c861cddcf0..00000000000 --- a/libraries/WiFi/examples/WiFiClientEnterprise/WiFiClientEnterprise.ino +++ /dev/null @@ -1,69 +0,0 @@ -#include //Wifi library -#include "esp_wpa2.h" //wpa2 library for connections to Enterprise networks -#define EAP_IDENTITY "login" //if connecting from another corporation, use identity@organisation.domain in Eduroam -#define EAP_PASSWORD "password" //your Eduroam password -const char* ssid = "eduroam"; // Eduroam SSID -const char* host = "arduino.php5.sk"; //external server domain for HTTP connection after authentification -int counter = 0; -void setup() { - Serial.begin(115200); - delay(10); - Serial.println(); - Serial.print("Connecting to network: "); - Serial.println(ssid); - WiFi.disconnect(true); //disconnect form wifi to set new wifi connection - WiFi.mode(WIFI_STA); //init wifi mode - esp_wifi_sta_wpa2_ent_set_identity((uint8_t *)EAP_IDENTITY, strlen(EAP_IDENTITY)); //provide identity - esp_wifi_sta_wpa2_ent_set_username((uint8_t *)EAP_IDENTITY, strlen(EAP_IDENTITY)); //provide username --> identity and username is same - esp_wifi_sta_wpa2_ent_set_password((uint8_t *)EAP_PASSWORD, strlen(EAP_PASSWORD)); //provide password - esp_wpa2_config_t config = WPA2_CONFIG_INIT_DEFAULT(); //set config settings to default - esp_wifi_sta_wpa2_ent_enable(&config); //set config settings to enable function - WiFi.begin(ssid); //connect to wifi - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - counter++; - if(counter>=60){ //after 30 seconds timeout - reset board - ESP.restart(); - } - } - Serial.println(""); - Serial.println("WiFi connected"); - Serial.println("IP address set: "); - Serial.println(WiFi.localIP()); //print LAN IP -} -void loop() { - if (WiFi.status() == WL_CONNECTED) { //if we are connected to Eduroam network - counter = 0; //reset counter - Serial.println("Wifi is still connected with IP: "); - Serial.println(WiFi.localIP()); //inform user about his IP address - }else if (WiFi.status() != WL_CONNECTED) { //if we lost connection, retry - WiFi.begin(ssid); - } - while (WiFi.status() != WL_CONNECTED) { //during lost connection, print dots - delay(500); - Serial.print("."); - counter++; - if(counter>=60){ //30 seconds timeout - reset board - ESP.restart(); - } - } - Serial.print("Connecting to website: "); - Serial.println(host); - WiFiClient client; - if (client.connect(host, 80)) { - String url = "/rele/rele1.txt"; - client.print(String("GET ") + url + " HTTP/1.1\r\n" + "Host: " + host + "\r\n" + "User-Agent: ESP32\r\n" + "Connection: close\r\n\r\n"); - - while (client.connected()) { - String line = client.readStringUntil('\n'); - if (line == "\r") { - break; - } - } - String line = client.readStringUntil('\n'); - Serial.println(line); - }else{ - Serial.println("Connection unsucessful"); - } -} diff --git a/libraries/WiFi/examples/WiFiClientEvents/WiFiClientEvents.ino b/libraries/WiFi/examples/WiFiClientEvents/WiFiClientEvents.ino deleted file mode 100644 index a7b029481e5..00000000000 --- a/libraries/WiFi/examples/WiFiClientEvents/WiFiClientEvents.ino +++ /dev/null @@ -1,166 +0,0 @@ -/* - * This sketch shows the WiFi event usage - * -*/ - -/* -* WiFi Events - -0 SYSTEM_EVENT_WIFI_READY < ESP32 WiFi ready -1 SYSTEM_EVENT_SCAN_DONE < ESP32 finish scanning AP -2 SYSTEM_EVENT_STA_START < ESP32 station start -3 SYSTEM_EVENT_STA_STOP < ESP32 station stop -4 SYSTEM_EVENT_STA_CONNECTED < ESP32 station connected to AP -5 SYSTEM_EVENT_STA_DISCONNECTED < ESP32 station disconnected from AP -6 SYSTEM_EVENT_STA_AUTHMODE_CHANGE < the auth mode of AP connected by ESP32 station changed -7 SYSTEM_EVENT_STA_GOT_IP < ESP32 station got IP from connected AP -8 SYSTEM_EVENT_STA_LOST_IP < ESP32 station lost IP and the IP is reset to 0 -9 SYSTEM_EVENT_STA_WPS_ER_SUCCESS < ESP32 station wps succeeds in enrollee mode -10 SYSTEM_EVENT_STA_WPS_ER_FAILED < ESP32 station wps fails in enrollee mode -11 SYSTEM_EVENT_STA_WPS_ER_TIMEOUT < ESP32 station wps timeout in enrollee mode -12 SYSTEM_EVENT_STA_WPS_ER_PIN < ESP32 station wps pin code in enrollee mode -13 SYSTEM_EVENT_AP_START < ESP32 soft-AP start -14 SYSTEM_EVENT_AP_STOP < ESP32 soft-AP stop -15 SYSTEM_EVENT_AP_STACONNECTED < a station connected to ESP32 soft-AP -16 SYSTEM_EVENT_AP_STADISCONNECTED < a station disconnected from ESP32 soft-AP -17 SYSTEM_EVENT_AP_STAIPASSIGNED < ESP32 soft-AP assign an IP to a connected station -18 SYSTEM_EVENT_AP_PROBEREQRECVED < Receive probe request packet in soft-AP interface -19 SYSTEM_EVENT_GOT_IP6 < ESP32 station or ap or ethernet interface v6IP addr is preferred -20 SYSTEM_EVENT_ETH_START < ESP32 ethernet start -21 SYSTEM_EVENT_ETH_STOP < ESP32 ethernet stop -22 SYSTEM_EVENT_ETH_CONNECTED < ESP32 ethernet phy link up -23 SYSTEM_EVENT_ETH_DISCONNECTED < ESP32 ethernet phy link down -24 SYSTEM_EVENT_ETH_GOT_IP < ESP32 ethernet got IP from connected AP -25 SYSTEM_EVENT_MAX -*/ - -#include - -const char* ssid = "your-ssid"; -const char* password = "your-password"; - - -void WiFiEvent(WiFiEvent_t event) -{ - Serial.printf("[WiFi-event] event: %d\n", event); - - switch (event) { - case SYSTEM_EVENT_WIFI_READY: - Serial.println("WiFi interface ready"); - break; - case SYSTEM_EVENT_SCAN_DONE: - Serial.println("Completed scan for access points"); - break; - case SYSTEM_EVENT_STA_START: - Serial.println("WiFi client started"); - break; - case SYSTEM_EVENT_STA_STOP: - Serial.println("WiFi clients stopped"); - break; - case SYSTEM_EVENT_STA_CONNECTED: - Serial.println("Connected to access point"); - break; - case SYSTEM_EVENT_STA_DISCONNECTED: - Serial.println("Disconnected from WiFi access point"); - break; - case SYSTEM_EVENT_STA_AUTHMODE_CHANGE: - Serial.println("Authentication mode of access point has changed"); - break; - case SYSTEM_EVENT_STA_GOT_IP: - Serial.print("Obtained IP address: "); - Serial.println(WiFi.localIP()); - break; - case SYSTEM_EVENT_STA_LOST_IP: - Serial.println("Lost IP address and IP address is reset to 0"); - break; - case SYSTEM_EVENT_STA_WPS_ER_SUCCESS: - Serial.println("WiFi Protected Setup (WPS): succeeded in enrollee mode"); - break; - case SYSTEM_EVENT_STA_WPS_ER_FAILED: - Serial.println("WiFi Protected Setup (WPS): failed in enrollee mode"); - break; - case SYSTEM_EVENT_STA_WPS_ER_TIMEOUT: - Serial.println("WiFi Protected Setup (WPS): timeout in enrollee mode"); - break; - case SYSTEM_EVENT_STA_WPS_ER_PIN: - Serial.println("WiFi Protected Setup (WPS): pin code in enrollee mode"); - break; - case SYSTEM_EVENT_AP_START: - Serial.println("WiFi access point started"); - break; - case SYSTEM_EVENT_AP_STOP: - Serial.println("WiFi access point stopped"); - break; - case SYSTEM_EVENT_AP_STACONNECTED: - Serial.println("Client connected"); - break; - case SYSTEM_EVENT_AP_STADISCONNECTED: - Serial.println("Client disconnected"); - break; - case SYSTEM_EVENT_AP_STAIPASSIGNED: - Serial.println("Assigned IP address to client"); - break; - case SYSTEM_EVENT_AP_PROBEREQRECVED: - Serial.println("Received probe request"); - break; - case SYSTEM_EVENT_GOT_IP6: - Serial.println("IPv6 is preferred"); - break; - case SYSTEM_EVENT_ETH_START: - Serial.println("Ethernet started"); - break; - case SYSTEM_EVENT_ETH_STOP: - Serial.println("Ethernet stopped"); - break; - case SYSTEM_EVENT_ETH_CONNECTED: - Serial.println("Ethernet connected"); - break; - case SYSTEM_EVENT_ETH_DISCONNECTED: - Serial.println("Ethernet disconnected"); - break; - case SYSTEM_EVENT_ETH_GOT_IP: - Serial.println("Obtained IP address"); - break; - default: break; - }} - -void WiFiGotIP(WiFiEvent_t event, WiFiEventInfo_t info) -{ - Serial.println("WiFi connected"); - Serial.println("IP address: "); - Serial.println(IPAddress(info.got_ip.ip_info.ip.addr)); -} - -void setup() -{ - Serial.begin(115200); - - // delete old config - WiFi.disconnect(true); - - delay(1000); - - // Examples of different ways to register wifi events - WiFi.onEvent(WiFiEvent); - WiFi.onEvent(WiFiGotIP, WiFiEvent_t::SYSTEM_EVENT_STA_GOT_IP); - WiFiEventId_t eventID = WiFi.onEvent([](WiFiEvent_t event, WiFiEventInfo_t info){ - Serial.print("WiFi lost connection. Reason: "); - Serial.println(info.disconnected.reason); - }, WiFiEvent_t::SYSTEM_EVENT_STA_DISCONNECTED); - - // Remove WiFi event - Serial.print("WiFi Event ID: "); - Serial.println(eventID); - // WiFi.removeEvent(eventID); - - WiFi.begin(ssid, password); - - Serial.println(); - Serial.println(); - Serial.println("Wait for WiFi... "); -} - -void loop() -{ - delay(1000); -} diff --git a/libraries/WiFi/examples/WiFiClientStaticIP/WiFiClientStaticIP.ino b/libraries/WiFi/examples/WiFiClientStaticIP/WiFiClientStaticIP.ino deleted file mode 100644 index 1f4032f0640..00000000000 --- a/libraries/WiFi/examples/WiFiClientStaticIP/WiFiClientStaticIP.ino +++ /dev/null @@ -1,92 +0,0 @@ -/* - Example of connection using Static IP - by Evandro Luis Copercini - Public domain - 2017 -*/ - -#include - -const char* ssid = "your_network_name"; -const char* password = "your_network_password"; -const char* host = "example.com"; -const char* url = "/index.html"; - -IPAddress local_IP(192, 168, 31, 115); -IPAddress gateway(192, 168, 31, 1); -IPAddress subnet(255, 255, 0, 0); -IPAddress primaryDNS(8, 8, 8, 8); //optional -IPAddress secondaryDNS(8, 8, 4, 4); //optional - -void setup() -{ - Serial.begin(115200); - - if (!WiFi.config(local_IP, gateway, subnet, primaryDNS, secondaryDNS)) { - Serial.println("STA Failed to configure"); - } - - Serial.print("Connecting to "); - Serial.println(ssid); - - WiFi.begin(ssid, password); - - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - } - - Serial.println(""); - Serial.println("WiFi connected!"); - Serial.print("IP address: "); - Serial.println(WiFi.localIP()); - Serial.print("ESP Mac Address: "); - Serial.println(WiFi.macAddress()); - Serial.print("Subnet Mask: "); - Serial.println(WiFi.subnetMask()); - Serial.print("Gateway IP: "); - Serial.println(WiFi.gatewayIP()); - Serial.print("DNS: "); - Serial.println(WiFi.dnsIP()); -} - -void loop() -{ - delay(5000); - - Serial.print("connecting to "); - Serial.println(host); - - // Use WiFiClient class to create TCP connections - WiFiClient client; - const int httpPort = 80; - if (!client.connect(host, httpPort)) { - Serial.println("connection failed"); - return; - } - - Serial.print("Requesting URL: "); - Serial.println(url); - - // This will send the request to the server - client.print(String("GET ") + url + " HTTP/1.1\r\n" + - "Host: " + host + "\r\n" + - "Connection: close\r\n\r\n"); - unsigned long timeout = millis(); - while (client.available() == 0) { - if (millis() - timeout > 5000) { - Serial.println(">>> Client Timeout !"); - client.stop(); - return; - } - } - - // Read all the lines of the reply from server and print them to Serial - while (client.available()) { - String line = client.readStringUntil('\r'); - Serial.print(line); - } - - Serial.println(); - Serial.println("closing connection"); -} - diff --git a/libraries/WiFi/examples/WiFiIPv6/WiFiIPv6.ino b/libraries/WiFi/examples/WiFiIPv6/WiFiIPv6.ino deleted file mode 100644 index 2d3b69789a4..00000000000 --- a/libraries/WiFi/examples/WiFiIPv6/WiFiIPv6.ino +++ /dev/null @@ -1,119 +0,0 @@ -#include "WiFi.h" - -#define STA_SSID "**********" -#define STA_PASS "**********" -#define AP_SSID "esp32-v6" - -static volatile bool wifi_connected = false; - -WiFiUDP ntpClient; - -void wifiOnConnect(){ - Serial.println("STA Connected"); - Serial.print("STA IPv4: "); - Serial.println(WiFi.localIP()); - - ntpClient.begin(2390); -} - -void wifiOnDisconnect(){ - Serial.println("STA Disconnected"); - delay(1000); - WiFi.begin(STA_SSID, STA_PASS); -} - -void wifiConnectedLoop(){ - //lets check the time - const int NTP_PACKET_SIZE = 48; - byte ntpPacketBuffer[NTP_PACKET_SIZE]; - - IPAddress address; - WiFi.hostByName("time.nist.gov", address); - memset(ntpPacketBuffer, 0, NTP_PACKET_SIZE); - ntpPacketBuffer[0] = 0b11100011; // LI, Version, Mode - ntpPacketBuffer[1] = 0; // Stratum, or type of clock - ntpPacketBuffer[2] = 6; // Polling Interval - ntpPacketBuffer[3] = 0xEC; // Peer Clock Precision - // 8 bytes of zero for Root Delay & Root Dispersion - ntpPacketBuffer[12] = 49; - ntpPacketBuffer[13] = 0x4E; - ntpPacketBuffer[14] = 49; - ntpPacketBuffer[15] = 52; - ntpClient.beginPacket(address, 123); //NTP requests are to port 123 - ntpClient.write(ntpPacketBuffer, NTP_PACKET_SIZE); - ntpClient.endPacket(); - - delay(1000); - - int packetLength = ntpClient.parsePacket(); - if (packetLength){ - if(packetLength >= NTP_PACKET_SIZE){ - ntpClient.read(ntpPacketBuffer, NTP_PACKET_SIZE); - } - ntpClient.flush(); - uint32_t secsSince1900 = (uint32_t)ntpPacketBuffer[40] << 24 | (uint32_t)ntpPacketBuffer[41] << 16 | (uint32_t)ntpPacketBuffer[42] << 8 | ntpPacketBuffer[43]; - //Serial.printf("Seconds since Jan 1 1900: %u\n", secsSince1900); - uint32_t epoch = secsSince1900 - 2208988800UL; - //Serial.printf("EPOCH: %u\n", epoch); - uint8_t h = (epoch % 86400L) / 3600; - uint8_t m = (epoch % 3600) / 60; - uint8_t s = (epoch % 60); - Serial.printf("UTC: %02u:%02u:%02u (GMT)\n", h, m, s); - } - - delay(9000); -} - -void WiFiEvent(WiFiEvent_t event){ - switch(event) { - - case SYSTEM_EVENT_AP_START: - //can set ap hostname here - WiFi.softAPsetHostname(AP_SSID); - //enable ap ipv6 here - WiFi.softAPenableIpV6(); - break; - - case SYSTEM_EVENT_STA_START: - //set sta hostname here - WiFi.setHostname(AP_SSID); - break; - case SYSTEM_EVENT_STA_CONNECTED: - //enable sta ipv6 here - WiFi.enableIpV6(); - break; - case SYSTEM_EVENT_AP_STA_GOT_IP6: - //both interfaces get the same event - Serial.print("STA IPv6: "); - Serial.println(WiFi.localIPv6()); - Serial.print("AP IPv6: "); - Serial.println(WiFi.softAPIPv6()); - break; - case SYSTEM_EVENT_STA_GOT_IP: - wifiOnConnect(); - wifi_connected = true; - break; - case SYSTEM_EVENT_STA_DISCONNECTED: - wifi_connected = false; - wifiOnDisconnect(); - break; - default: - break; - } -} - -void setup(){ - Serial.begin(115200); - WiFi.disconnect(true); - WiFi.onEvent(WiFiEvent); - WiFi.mode(WIFI_MODE_APSTA); - WiFi.softAP(AP_SSID); - WiFi.begin(STA_SSID, STA_PASS); -} - -void loop(){ - if(wifi_connected){ - wifiConnectedLoop(); - } - while(Serial.available()) Serial.write(Serial.read()); -} diff --git a/libraries/WiFi/examples/WiFiMulti/WiFiMulti.ino b/libraries/WiFi/examples/WiFiMulti/WiFiMulti.ino deleted file mode 100644 index 2e490d065a8..00000000000 --- a/libraries/WiFi/examples/WiFiMulti/WiFiMulti.ino +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This sketch trys to Connect to the best AP based on a given list - * - */ - -#include -#include - -WiFiMulti wifiMulti; - -void setup() -{ - Serial.begin(115200); - delay(10); - - wifiMulti.addAP("ssid_from_AP_1", "your_password_for_AP_1"); - wifiMulti.addAP("ssid_from_AP_2", "your_password_for_AP_2"); - wifiMulti.addAP("ssid_from_AP_3", "your_password_for_AP_3"); - - Serial.println("Connecting Wifi..."); - if(wifiMulti.run() == WL_CONNECTED) { - Serial.println(""); - Serial.println("WiFi connected"); - Serial.println("IP address: "); - Serial.println(WiFi.localIP()); - } -} - -void loop() -{ - if(wifiMulti.run() != WL_CONNECTED) { - Serial.println("WiFi not connected!"); - delay(1000); - } -} \ No newline at end of file diff --git a/libraries/WiFi/examples/WiFiScan/WiFiScan.ino b/libraries/WiFi/examples/WiFiScan/WiFiScan.ino deleted file mode 100644 index 5d11fbb6926..00000000000 --- a/libraries/WiFi/examples/WiFiScan/WiFiScan.ino +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This sketch demonstrates how to scan WiFi networks. - * The API is almost the same as with the WiFi Shield library, - * the most obvious difference being the different file you need to include: - */ -#include "WiFi.h" - -void setup() -{ - Serial.begin(115200); - - // Set WiFi to station mode and disconnect from an AP if it was previously connected - WiFi.mode(WIFI_STA); - WiFi.disconnect(); - delay(100); - - Serial.println("Setup done"); -} - -void loop() -{ - Serial.println("scan start"); - - // WiFi.scanNetworks will return the number of networks found - int n = WiFi.scanNetworks(); - Serial.println("scan done"); - if (n == 0) { - Serial.println("no networks found"); - } else { - Serial.print(n); - Serial.println(" networks found"); - for (int i = 0; i < n; ++i) { - // Print SSID and RSSI for each network found - Serial.print(i + 1); - Serial.print(": "); - Serial.print(WiFi.SSID(i)); - Serial.print(" ("); - Serial.print(WiFi.RSSI(i)); - Serial.print(")"); - Serial.println((WiFi.encryptionType(i) == WIFI_AUTH_OPEN)?" ":"*"); - delay(10); - } - } - Serial.println(""); - - // Wait a bit before scanning again - delay(5000); -} diff --git a/libraries/WiFi/examples/WiFiSmartConfig/WiFiSmartConfig.ino b/libraries/WiFi/examples/WiFiSmartConfig/WiFiSmartConfig.ino deleted file mode 100644 index 4c1f1a8ce6d..00000000000 --- a/libraries/WiFi/examples/WiFiSmartConfig/WiFiSmartConfig.ino +++ /dev/null @@ -1,36 +0,0 @@ -#include "WiFi.h" - -void setup() { - Serial.begin(115200); - - //Init WiFi as Station, start SmartConfig - WiFi.mode(WIFI_AP_STA); - WiFi.beginSmartConfig(); - - //Wait for SmartConfig packet from mobile - Serial.println("Waiting for SmartConfig."); - while (!WiFi.smartConfigDone()) { - delay(500); - Serial.print("."); - } - - Serial.println(""); - Serial.println("SmartConfig received."); - - //Wait for WiFi to connect to AP - Serial.println("Waiting for WiFi"); - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - } - - Serial.println("WiFi Connected."); - - Serial.print("IP Address: "); - Serial.println(WiFi.localIP()); -} - -void loop() { - // put your main code here, to run repeatedly: - -} diff --git a/libraries/WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino b/libraries/WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino deleted file mode 100644 index 63bdf6c13b6..00000000000 --- a/libraries/WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino +++ /dev/null @@ -1,129 +0,0 @@ -/* - WiFiTelnetToSerial - Example Transparent UART to Telnet Server for ESP32 - - Copyright (c) 2017 Hristo Gochkov. All rights reserved. - This file is part of the ESP32 WiFi library for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#include -#include - -WiFiMulti wifiMulti; - -//how many clients should be able to telnet to this ESP32 -#define MAX_SRV_CLIENTS 1 -const char* ssid = "**********"; -const char* password = "**********"; - -WiFiServer server(23); -WiFiClient serverClients[MAX_SRV_CLIENTS]; - -void setup() { - Serial.begin(115200); - Serial.println("\nConnecting"); - - wifiMulti.addAP(ssid, password); - wifiMulti.addAP("ssid_from_AP_2", "your_password_for_AP_2"); - wifiMulti.addAP("ssid_from_AP_3", "your_password_for_AP_3"); - - Serial.println("Connecting Wifi "); - for (int loops = 10; loops > 0; loops--) { - if (wifiMulti.run() == WL_CONNECTED) { - Serial.println(""); - Serial.print("WiFi connected "); - Serial.print("IP address: "); - Serial.println(WiFi.localIP()); - break; - } - else { - Serial.println(loops); - delay(1000); - } - } - if (wifiMulti.run() != WL_CONNECTED) { - Serial.println("WiFi connect failed"); - delay(1000); - ESP.restart(); - } - - //start UART and the server - Serial2.begin(9600); - server.begin(); - server.setNoDelay(true); - - Serial.print("Ready! Use 'telnet "); - Serial.print(WiFi.localIP()); - Serial.println(" 23' to connect"); -} - -void loop() { - uint8_t i; - if (wifiMulti.run() == WL_CONNECTED) { - //check if there are any new clients - if (server.hasClient()){ - for(i = 0; i < MAX_SRV_CLIENTS; i++){ - //find free/disconnected spot - if (!serverClients[i] || !serverClients[i].connected()){ - if(serverClients[i]) serverClients[i].stop(); - serverClients[i] = server.available(); - if (!serverClients[i]) Serial.println("available broken"); - Serial.print("New client: "); - Serial.print(i); Serial.print(' '); - Serial.println(serverClients[i].remoteIP()); - break; - } - } - if (i >= MAX_SRV_CLIENTS) { - //no free/disconnected spot so reject - server.available().stop(); - } - } - //check clients for data - for(i = 0; i < MAX_SRV_CLIENTS; i++){ - if (serverClients[i] && serverClients[i].connected()){ - if(serverClients[i].available()){ - //get data from the telnet client and push it to the UART - while(serverClients[i].available()) Serial2.write(serverClients[i].read()); - } - } - else { - if (serverClients[i]) { - serverClients[i].stop(); - } - } - } - //check UART for data - if(Serial2.available()){ - size_t len = Serial2.available(); - uint8_t sbuf[len]; - Serial2.readBytes(sbuf, len); - //push UART data to all connected telnet clients - for(i = 0; i < MAX_SRV_CLIENTS; i++){ - if (serverClients[i] && serverClients[i].connected()){ - serverClients[i].write(sbuf, len); - delay(1); - } - } - } - } - else { - Serial.println("WiFi not connected!"); - for(i = 0; i < MAX_SRV_CLIENTS; i++) { - if (serverClients[i]) serverClients[i].stop(); - } - delay(1000); - } -} diff --git a/libraries/WiFi/examples/WiFiUDPClient/WiFiUDPClient.ino b/libraries/WiFi/examples/WiFiUDPClient/WiFiUDPClient.ino deleted file mode 100644 index 310989f0c1f..00000000000 --- a/libraries/WiFi/examples/WiFiUDPClient/WiFiUDPClient.ino +++ /dev/null @@ -1,76 +0,0 @@ -/* - * This sketch sends random data over UDP on a ESP32 device - * - */ -#include -#include - -// WiFi network name and password: -const char * networkName = "your-ssid"; -const char * networkPswd = "your-password"; - -//IP address to send UDP data to: -// either use the ip address of the server or -// a network broadcast address -const char * udpAddress = "192.168.0.255"; -const int udpPort = 3333; - -//Are we currently connected? -boolean connected = false; - -//The udp library class -WiFiUDP udp; - -void setup(){ - // Initilize hardware serial: - Serial.begin(115200); - - //Connect to the WiFi network - connectToWiFi(networkName, networkPswd); -} - -void loop(){ - //only send data when connected - if(connected){ - //Send a packet - udp.beginPacket(udpAddress,udpPort); - udp.printf("Seconds since boot: %lu", millis()/1000); - udp.endPacket(); - } - //Wait for 1 second - delay(1000); -} - -void connectToWiFi(const char * ssid, const char * pwd){ - Serial.println("Connecting to WiFi network: " + String(ssid)); - - // delete old config - WiFi.disconnect(true); - //register event handler - WiFi.onEvent(WiFiEvent); - - //Initiate connection - WiFi.begin(ssid, pwd); - - Serial.println("Waiting for WIFI connection..."); -} - -//wifi event handler -void WiFiEvent(WiFiEvent_t event){ - switch(event) { - case SYSTEM_EVENT_STA_GOT_IP: - //When connected set - Serial.print("WiFi connected! IP address: "); - Serial.println(WiFi.localIP()); - //initializes the UDP state - //This initializes the transfer buffer - udp.begin(WiFi.localIP(),udpPort); - connected = true; - break; - case SYSTEM_EVENT_STA_DISCONNECTED: - Serial.println("WiFi lost connection"); - connected = false; - break; - default: break; - } -} diff --git a/libraries/WiFi/examples/WiFiUDPClient/udp_server.py b/libraries/WiFi/examples/WiFiUDPClient/udp_server.py deleted file mode 100644 index 90272353ac1..00000000000 --- a/libraries/WiFi/examples/WiFiUDPClient/udp_server.py +++ /dev/null @@ -1,30 +0,0 @@ -# This python script listens on UDP port 3333 -# for messages from the ESP32 board and prints them -import socket -import sys - -try : - s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) - s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) -except socket.error, msg : - print 'Failed to create socket. Error Code : ' + str(msg[0]) + ' Message ' + msg[1] - sys.exit() - -try: - s.bind(('', 3333)) -except socket.error , msg: - print 'Bind failed. Error: ' + str(msg[0]) + ': ' + msg[1] - sys.exit() - -print 'Server listening' - -while 1: - d = s.recvfrom(1024) - data = d[0] - - if not data: - break - - print data.strip() - -s.close() \ No newline at end of file diff --git a/libraries/WiFi/examples/WiFiUDPClient/udp_server.rb b/libraries/WiFi/examples/WiFiUDPClient/udp_server.rb deleted file mode 100644 index 50e241d4bcf..00000000000 --- a/libraries/WiFi/examples/WiFiUDPClient/udp_server.rb +++ /dev/null @@ -1,16 +0,0 @@ -# This ruby script listens on UDP port 3333 -# for messages from the ESP32 board and prints them - -require 'socket' -include Socket::Constants - -udp_socket = UDPSocket.new(AF_INET) - -#bind -udp_socket.bind("", 3333) -puts 'Server listening' - -while true do - message, sender = udp_socket.recvfrom(1024) - puts message -end \ No newline at end of file diff --git a/libraries/WiFi/keywords.txt b/libraries/WiFi/keywords.txt deleted file mode 100644 index 5720aaac81c..00000000000 --- a/libraries/WiFi/keywords.txt +++ /dev/null @@ -1,68 +0,0 @@ -####################################### -# Syntax Coloring Map For WiFi -####################################### - -####################################### -# Library (KEYWORD3) -####################################### - -WiFi KEYWORD3 - -####################################### -# Datatypes (KEYWORD1) -####################################### - -WiFi KEYWORD1 -WiFiClient KEYWORD1 -WiFiServer KEYWORD1 -WiFiUDP KEYWORD1 -WiFiClientSecure KEYWORD1 - -####################################### -# Methods and Functions (KEYWORD2) -####################################### - -status KEYWORD2 -mode KEYWORD2 -connect KEYWORD2 -write KEYWORD2 -available KEYWORD2 -config KEYWORD2 -setDNS KEYWORD2 -read KEYWORD2 -flush KEYWORD2 -stop KEYWORD2 -connected KEYWORD2 -begin KEYWORD2 -beginMulticast KEYWORD2 -disconnect KEYWORD2 -macAddress KEYWORD2 -localIP KEYWORD2 -subnetMask KEYWORD2 -gatewayIP KEYWORD2 -SSID KEYWORD2 -psk KEYWORD2 -BSSID KEYWORD2 -RSSI KEYWORD2 -encryptionType KEYWORD2 -beginPacket KEYWORD2 -beginPacketMulticast KEYWORD2 -endPacket KEYWORD2 -parsePacket KEYWORD2 -destinationIP KEYWORD2 -remoteIP KEYWORD2 -remotePort KEYWORD2 -softAP KEYWORD2 -softAPIP KEYWORD2 -softAPmacAddress KEYWORD2 -softAPConfig KEYWORD2 -printDiag KEYWORD2 -hostByName KEYWORD2 -scanNetworks KEYWORD2 - -####################################### -# Constants (LITERAL1) -####################################### -WIFI_AP LITERAL1 -WIFI_STA LITERAL1 -WIFI_AP_STA LITERAL1 diff --git a/libraries/WiFi/library.properties b/libraries/WiFi/library.properties deleted file mode 100644 index c98691df3a7..00000000000 --- a/libraries/WiFi/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=WiFi -version=1.0 -author=Hristo Gochkov -maintainer=Hristo Gochkov -sentence=Enables network connection (local and Internet) using the ESP32 built-in WiFi. -paragraph=With this library you can instantiate Servers, Clients and send/receive UDP packets through WiFi. The shield can connect either to open or encrypted networks (WEP, WPA). The IP address can be assigned statically or through a DHCP. The library can also manage DNS. -category=Communication -url= -architectures=esp32 diff --git a/libraries/WiFi/src/ETH.cpp b/libraries/WiFi/src/ETH.cpp deleted file mode 100644 index 2ffea758ded..00000000000 --- a/libraries/WiFi/src/ETH.cpp +++ /dev/null @@ -1,288 +0,0 @@ -/* - ETH.h - espre ETH PHY support. - Based on WiFi.h from Arduino WiFi shield library. - Copyright (c) 2011-2014 Arduino. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "ETH.h" -#include "eth_phy/phy.h" -#include "eth_phy/phy_tlk110.h" -#include "eth_phy/phy_lan8720.h" -#include "lwip/err.h" -#include "lwip/dns.h" - -extern void tcpipInit(); - -static int _eth_phy_mdc_pin = -1; -static int _eth_phy_mdio_pin = -1; -static int _eth_phy_power_pin = -1; -static eth_phy_power_enable_func _eth_phy_power_enable_orig = NULL; - -static void _eth_phy_config_gpio(void) -{ - if(_eth_phy_mdc_pin < 0 || _eth_phy_mdio_pin < 0){ - log_e("MDC and MDIO pins are not configured!"); - return; - } - phy_rmii_configure_data_interface_pins(); - phy_rmii_smi_configure_pins(_eth_phy_mdc_pin, _eth_phy_mdio_pin); -} - -static void _eth_phy_power_enable(bool enable) -{ - pinMode(_eth_phy_power_pin, OUTPUT); - digitalWrite(_eth_phy_power_pin, enable); - delay(1); -} - -ETHClass::ETHClass():initialized(false),started(false),staticIP(false) -{ -} - -ETHClass::~ETHClass() -{} - -bool ETHClass::begin(uint8_t phy_addr, int power, int mdc, int mdio, eth_phy_type_t type, eth_clock_mode_t clock_mode) -{ - esp_err_t err; - if(initialized){ - err = esp_eth_enable(); - if(err){ - log_e("esp_eth_enable error: %d", err); - return false; - } - started = true; - return true; - } - _eth_phy_mdc_pin = mdc; - _eth_phy_mdio_pin = mdio; - _eth_phy_power_pin = power; - - if(type == ETH_PHY_LAN8720){ - eth_config_t config = phy_lan8720_default_ethernet_config; - memcpy(ð_config, &config, sizeof(eth_config_t)); - } else if(type == ETH_PHY_TLK110){ - eth_config_t config = phy_tlk110_default_ethernet_config; - memcpy(ð_config, &config, sizeof(eth_config_t)); - } else { - log_e("Bad ETH_PHY type: %u", (uint8_t)type); - return false; - } - - eth_config.phy_addr = (eth_phy_base_t)phy_addr; - eth_config.clock_mode = clock_mode; - eth_config.gpio_config = _eth_phy_config_gpio; - eth_config.tcpip_input = tcpip_adapter_eth_input; - if(_eth_phy_power_pin >= 0){ - _eth_phy_power_enable_orig = eth_config.phy_power_enable; - eth_config.phy_power_enable = _eth_phy_power_enable; - } - - tcpipInit(); - err = esp_eth_init(ð_config); - if(!err){ - initialized = true; - err = esp_eth_enable(); - if(err){ - log_e("esp_eth_enable error: %d", err); - } else { - started = true; - return true; - } - } else { - log_e("esp_eth_init error: %d", err); - } - return false; -} - -bool ETHClass::config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1, IPAddress dns2) -{ - esp_err_t err = ESP_OK; - tcpip_adapter_ip_info_t info; - - if(local_ip != (uint32_t)0x00000000){ - info.ip.addr = static_cast(local_ip); - info.gw.addr = static_cast(gateway); - info.netmask.addr = static_cast(subnet); - } else { - info.ip.addr = 0; - info.gw.addr = 0; - info.netmask.addr = 0; - } - - err = tcpip_adapter_dhcpc_stop(TCPIP_ADAPTER_IF_ETH); - if(err != ESP_OK && err != ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STOPPED){ - log_e("DHCP could not be stopped! Error: %d", err); - return false; - } - - err = tcpip_adapter_set_ip_info(TCPIP_ADAPTER_IF_ETH, &info); - if(err != ERR_OK){ - log_e("STA IP could not be configured! Error: %d", err); - return false; -} - if(info.ip.addr){ - staticIP = true; - } else { - err = tcpip_adapter_dhcpc_start(TCPIP_ADAPTER_IF_ETH); - if(err != ESP_OK && err != ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STARTED){ - log_w("DHCP could not be started! Error: %d", err); - return false; - } - staticIP = false; - } - - ip_addr_t d; - d.type = IPADDR_TYPE_V4; - - if(dns1 != (uint32_t)0x00000000) { - // Set DNS1-Server - d.u_addr.ip4.addr = static_cast(dns1); - dns_setserver(0, &d); - } - - if(dns2 != (uint32_t)0x00000000) { - // Set DNS2-Server - d.u_addr.ip4.addr = static_cast(dns2); - dns_setserver(1, &d); - } - - return true; -} - -IPAddress ETHClass::localIP() -{ - tcpip_adapter_ip_info_t ip; - if(tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_ETH, &ip)){ - return IPAddress(); - } - return IPAddress(ip.ip.addr); -} - -IPAddress ETHClass::subnetMask() -{ - tcpip_adapter_ip_info_t ip; - if(tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_ETH, &ip)){ - return IPAddress(); - } - return IPAddress(ip.netmask.addr); -} - -IPAddress ETHClass::gatewayIP() -{ - tcpip_adapter_ip_info_t ip; - if(tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_ETH, &ip)){ - return IPAddress(); - } - return IPAddress(ip.gw.addr); -} - -IPAddress ETHClass::dnsIP(uint8_t dns_no) -{ - ip_addr_t dns_ip = dns_getserver(dns_no); - return IPAddress(dns_ip.u_addr.ip4.addr); -} - -IPAddress ETHClass::broadcastIP() -{ - tcpip_adapter_ip_info_t ip; - if(tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_ETH, &ip)){ - return IPAddress(); - } - return WiFiGenericClass::calculateBroadcast(IPAddress(ip.gw.addr), IPAddress(ip.netmask.addr)); -} - -IPAddress ETHClass::networkID() -{ - tcpip_adapter_ip_info_t ip; - if(tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_ETH, &ip)){ - return IPAddress(); - } - return WiFiGenericClass::calculateNetworkID(IPAddress(ip.gw.addr), IPAddress(ip.netmask.addr)); -} - -uint8_t ETHClass::subnetCIDR() -{ - tcpip_adapter_ip_info_t ip; - if(tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_ETH, &ip)){ - return (uint8_t)0; - } - return WiFiGenericClass::calculateSubnetCIDR(IPAddress(ip.netmask.addr)); -} - -const char * ETHClass::getHostname() -{ - const char * hostname; - if(tcpip_adapter_get_hostname(TCPIP_ADAPTER_IF_ETH, &hostname)){ - return NULL; - } - return hostname; -} - -bool ETHClass::setHostname(const char * hostname) -{ - return tcpip_adapter_set_hostname(TCPIP_ADAPTER_IF_ETH, hostname) == 0; -} - -bool ETHClass::fullDuplex() -{ - return eth_config.phy_get_duplex_mode(); -} - -bool ETHClass::linkUp() -{ - return eth_config.phy_check_link(); -} - -uint8_t ETHClass::linkSpeed() -{ - return eth_config.phy_get_speed_mode()?100:10; -} - -bool ETHClass::enableIpV6() -{ - return tcpip_adapter_create_ip6_linklocal(TCPIP_ADAPTER_IF_ETH) == 0; -} - -IPv6Address ETHClass::localIPv6() -{ - static ip6_addr_t addr; - if(tcpip_adapter_get_ip6_linklocal(TCPIP_ADAPTER_IF_ETH, &addr)){ - return IPv6Address(); - } - return IPv6Address(addr.addr); -} - -uint8_t * macAddress(uint8_t* mac) -{ - if(!mac){ - return NULL; - } - esp_eth_get_mac(mac); - return mac; -} - -String ETHClass::macAddress(void) -{ - uint8_t mac[6]; - char macStr[18] = { 0 }; - esp_eth_get_mac(mac); - sprintf(macStr, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - return String(macStr); -} - -ETHClass ETH; diff --git a/libraries/WiFi/src/ETH.h b/libraries/WiFi/src/ETH.h deleted file mode 100644 index f5441a9d0ed..00000000000 --- a/libraries/WiFi/src/ETH.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - ETH.h - espre ETH PHY support. - Based on WiFi.h from Ardiono WiFi shield library. - Copyright (c) 2011-2014 Arduino. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef _ETH_H_ -#define _ETH_H_ - -#include "WiFi.h" -#include "esp_eth.h" - -#ifndef ETH_PHY_ADDR -#define ETH_PHY_ADDR 0 -#endif - -#ifndef ETH_PHY_TYPE -#define ETH_PHY_TYPE ETH_PHY_LAN8720 -#endif - -#ifndef ETH_PHY_POWER -#define ETH_PHY_POWER -1 -#endif - -#ifndef ETH_PHY_MDC -#define ETH_PHY_MDC 23 -#endif - -#ifndef ETH_PHY_MDIO -#define ETH_PHY_MDIO 18 -#endif - -#ifndef ETH_CLK_MODE -#define ETH_CLK_MODE ETH_CLOCK_GPIO0_IN -#endif - -typedef enum { ETH_PHY_LAN8720, ETH_PHY_TLK110, ETH_PHY_MAX } eth_phy_type_t; - -class ETHClass { - private: - bool initialized; - bool started; - bool staticIP; - eth_config_t eth_config; - public: - ETHClass(); - ~ETHClass(); - - bool begin(uint8_t phy_addr=ETH_PHY_ADDR, int power=ETH_PHY_POWER, int mdc=ETH_PHY_MDC, int mdio=ETH_PHY_MDIO, eth_phy_type_t type=ETH_PHY_TYPE, eth_clock_mode_t clk_mode=ETH_CLK_MODE); - - bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = (uint32_t)0x00000000, IPAddress dns2 = (uint32_t)0x00000000); - - const char * getHostname(); - bool setHostname(const char * hostname); - - bool fullDuplex(); - bool linkUp(); - uint8_t linkSpeed(); - - bool enableIpV6(); - IPv6Address localIPv6(); - - IPAddress localIP(); - IPAddress subnetMask(); - IPAddress gatewayIP(); - IPAddress dnsIP(uint8_t dns_no = 0); - - IPAddress broadcastIP(); - IPAddress networkID(); - uint8_t subnetCIDR(); - - uint8_t * macAddress(uint8_t* mac); - String macAddress(); - - friend class WiFiClient; - friend class WiFiServer; -}; - -extern ETHClass ETH; - -#endif /* _ETH_H_ */ diff --git a/libraries/WiFi/src/WiFi.cpp b/libraries/WiFi/src/WiFi.cpp deleted file mode 100644 index a78e0c3ebc2..00000000000 --- a/libraries/WiFi/src/WiFi.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - ESP8266WiFi.cpp - WiFi library for esp8266 - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Reworked on 28 Dec 2015 by Markus Sattler - - */ -#include "WiFi.h" - -extern "C" { -#include -#include -#include -#include -#include -#include -#include -#include -#include -} - - -// ----------------------------------------------------------------------------------------------------------------------- -// ---------------------------------------------------------- Debug ------------------------------------------------------ -// ----------------------------------------------------------------------------------------------------------------------- - - -/** - * Output WiFi settings to an object derived from Print interface (like Serial). - * @param p Print interface - */ -void WiFiClass::printDiag(Print& p) -{ - const char* modes[] = { "NULL", "STA", "AP", "STA+AP" }; - - wifi_mode_t mode; - esp_wifi_get_mode(&mode); - - uint8_t primaryChan; - wifi_second_chan_t secondChan; - esp_wifi_get_channel(&primaryChan, &secondChan); - - p.print("Mode: "); - p.println(modes[mode]); - - p.print("Channel: "); - p.println(primaryChan); - /* - p.print("AP id: "); - p.println(wifi_station_get_current_ap_id()); - - p.print("Status: "); - p.println(wifi_station_get_connect_status()); - */ - - wifi_config_t conf; - esp_wifi_get_config(WIFI_IF_STA, &conf); - - const char* ssid = reinterpret_cast(conf.sta.ssid); - p.print("SSID ("); - p.print(strlen(ssid)); - p.print("): "); - p.println(ssid); - - const char* passphrase = reinterpret_cast(conf.sta.password); - p.print("Passphrase ("); - p.print(strlen(passphrase)); - p.print("): "); - p.println(passphrase); - - p.print("BSSID set: "); - p.println(conf.sta.bssid_set); -} - -WiFiClass WiFi; diff --git a/libraries/WiFi/src/WiFi.h b/libraries/WiFi/src/WiFi.h deleted file mode 100644 index ad6c327427c..00000000000 --- a/libraries/WiFi/src/WiFi.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - WiFi.h - esp32 Wifi support. - Based on WiFi.h from Arduino WiFi shield library. - Copyright (c) 2011-2014 Arduino. All right reserved. - Modified by Ivan Grokhotkov, December 2014 - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef WiFi_h -#define WiFi_h - -#include - -#include "Print.h" -#include "IPAddress.h" -#include "IPv6Address.h" - -#include "WiFiType.h" -#include "WiFiSTA.h" -#include "WiFiAP.h" -#include "WiFiScan.h" -#include "WiFiGeneric.h" - -#include "WiFiClient.h" -#include "WiFiServer.h" -#include "WiFiUdp.h" - -class WiFiClass : public WiFiGenericClass, public WiFiSTAClass, public WiFiScanClass, public WiFiAPClass -{ -public: - using WiFiGenericClass::channel; - - using WiFiSTAClass::SSID; - using WiFiSTAClass::RSSI; - using WiFiSTAClass::BSSID; - using WiFiSTAClass::BSSIDstr; - - using WiFiScanClass::SSID; - using WiFiScanClass::encryptionType; - using WiFiScanClass::RSSI; - using WiFiScanClass::BSSID; - using WiFiScanClass::BSSIDstr; - using WiFiScanClass::channel; - -public: - void printDiag(Print& dest); - friend class WiFiClient; - friend class WiFiServer; - friend class WiFiUDP; -}; - -extern WiFiClass WiFi; - -#endif diff --git a/libraries/WiFi/src/WiFiAP.cpp b/libraries/WiFi/src/WiFiAP.cpp deleted file mode 100644 index 1f8af5852ee..00000000000 --- a/libraries/WiFi/src/WiFiAP.cpp +++ /dev/null @@ -1,365 +0,0 @@ -/* - ESP8266WiFiSTA.cpp - WiFi library for esp8266 - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Reworked on 28 Dec 2015 by Markus Sattler - - */ - -#include "WiFi.h" -#include "WiFiGeneric.h" -#include "WiFiAP.h" - -extern "C" { -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "dhcpserver/dhcpserver_options.h" -} - - - -// ----------------------------------------------------------------------------------------------------------------------- -// ---------------------------------------------------- Private functions ------------------------------------------------ -// ----------------------------------------------------------------------------------------------------------------------- - -static bool softap_config_equal(const wifi_config_t& lhs, const wifi_config_t& rhs); - - - -/** - * compare two AP configurations - * @param lhs softap_config - * @param rhs softap_config - * @return equal - */ -static bool softap_config_equal(const wifi_config_t& lhs, const wifi_config_t& rhs) -{ - if(strcmp(reinterpret_cast(lhs.ap.ssid), reinterpret_cast(rhs.ap.ssid)) != 0) { - return false; - } - if(strcmp(reinterpret_cast(lhs.ap.password), reinterpret_cast(rhs.ap.password)) != 0) { - return false; - } - if(lhs.ap.channel != rhs.ap.channel) { - return false; - } - if(lhs.ap.ssid_hidden != rhs.ap.ssid_hidden) { - return false; - } - if(lhs.ap.max_connection != rhs.ap.max_connection) { - return false; - } - return true; -} - -// ----------------------------------------------------------------------------------------------------------------------- -// ----------------------------------------------------- AP function ----------------------------------------------------- -// ----------------------------------------------------------------------------------------------------------------------- - - -/** - * Set up an access point - * @param ssid Pointer to the SSID (max 63 char). - * @param passphrase (for WPA2 min 8 char, for open use NULL) - * @param channel WiFi channel number, 1 - 13. - * @param ssid_hidden Network cloaking (0 = broadcast SSID, 1 = hide SSID) - * @param max_connection Max simultaneous connected clients, 1 - 4. -*/ -bool WiFiAPClass::softAP(const char* ssid, const char* passphrase, int channel, int ssid_hidden, int max_connection) -{ - - if(!WiFi.enableAP(true)) { - // enable AP failed - log_e("enable AP first!"); - return false; - } - - if(!ssid || *ssid == 0) { - // fail SSID missing - log_e("SSID missing!"); - return false; - } - - if(passphrase && (strlen(passphrase) > 0 && strlen(passphrase) < 8)) { - // fail passphrase too short - log_e("passphrase too short!"); - return false; - } - - esp_wifi_start(); - - wifi_config_t conf; - strlcpy(reinterpret_cast(conf.ap.ssid), ssid, sizeof(conf.ap.ssid)); - conf.ap.channel = channel; - conf.ap.ssid_len = strlen(reinterpret_cast(conf.ap.ssid)); - conf.ap.ssid_hidden = ssid_hidden; - conf.ap.max_connection = max_connection; - conf.ap.beacon_interval = 100; - - if(!passphrase || strlen(passphrase) == 0) { - conf.ap.authmode = WIFI_AUTH_OPEN; - *conf.ap.password = 0; - } else { - conf.ap.authmode = WIFI_AUTH_WPA2_PSK; - strlcpy(reinterpret_cast(conf.ap.password), passphrase, sizeof(conf.ap.password)); - } - - wifi_config_t conf_current; - esp_wifi_get_config(WIFI_IF_AP, &conf_current); - if(!softap_config_equal(conf, conf_current) && esp_wifi_set_config(WIFI_IF_AP, &conf) != ESP_OK) { - return false; - } - - return true; -} - - -/** - * Configure access point - * @param local_ip access point IP - * @param gateway gateway IP - * @param subnet subnet mask - */ -bool WiFiAPClass::softAPConfig(IPAddress local_ip, IPAddress gateway, IPAddress subnet) -{ - - if(!WiFi.enableAP(true)) { - // enable AP failed - return false; - } - - esp_wifi_start(); - - tcpip_adapter_ip_info_t info; - info.ip.addr = static_cast(local_ip); - info.gw.addr = static_cast(gateway); - info.netmask.addr = static_cast(subnet); - tcpip_adapter_dhcps_stop(TCPIP_ADAPTER_IF_AP); - if(tcpip_adapter_set_ip_info(TCPIP_ADAPTER_IF_AP, &info) == ESP_OK) { - dhcps_lease_t lease; - lease.enable = true; - lease.start_ip.addr = static_cast(local_ip) + (1 << 24); - lease.end_ip.addr = static_cast(local_ip) + (11 << 24); - - tcpip_adapter_dhcps_option( - (tcpip_adapter_option_mode_t)TCPIP_ADAPTER_OP_SET, - (tcpip_adapter_option_id_t)REQUESTED_IP_ADDRESS, - (void*)&lease, sizeof(dhcps_lease_t) - ); - - return tcpip_adapter_dhcps_start(TCPIP_ADAPTER_IF_AP) == ESP_OK; - } - return false; -} - - - -/** - * Disconnect from the network (close AP) - * @param wifioff disable mode? - * @return one value of wl_status_t enum - */ -bool WiFiAPClass::softAPdisconnect(bool wifioff) -{ - bool ret; - wifi_config_t conf; - - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return ESP_ERR_INVALID_STATE; - } - - *conf.ap.ssid = 0; - *conf.ap.password = 0; - conf.ap.authmode = WIFI_AUTH_OPEN; // auth must be open if pass=0 - ret = esp_wifi_set_config(WIFI_IF_AP, &conf) == ESP_OK; - - if(wifioff) { - ret = WiFi.enableAP(false) == ESP_OK; - } - - return ret; -} - - -/** - * Get the count of the Station / client that are connected to the softAP interface - * @return Stations count - */ -uint8_t WiFiAPClass::softAPgetStationNum() -{ - wifi_sta_list_t clients; - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return 0; - } - if(esp_wifi_ap_get_sta_list(&clients) == ESP_OK) { - return clients.num; - } - return 0; -} - -/** - * Get the softAP interface IP address. - * @return IPAddress softAP IP - */ -IPAddress WiFiAPClass::softAPIP() -{ - tcpip_adapter_ip_info_t ip; - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return IPAddress(); - } - tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_AP, &ip); - return IPAddress(ip.ip.addr); -} - -/** - * Get the softAP broadcast IP address. - * @return IPAddress softAP broadcastIP - */ -IPAddress WiFiAPClass::softAPBroadcastIP() -{ - tcpip_adapter_ip_info_t ip; - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return IPAddress(); - } - tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_AP, &ip); - return WiFiGenericClass::calculateBroadcast(IPAddress(ip.gw.addr), IPAddress(ip.netmask.addr)); -} - -/** - * Get the softAP network ID. - * @return IPAddress softAP networkID - */ -IPAddress WiFiAPClass::softAPNetworkID() -{ - tcpip_adapter_ip_info_t ip; - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return IPAddress(); - } - tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_AP, &ip); - return WiFiGenericClass::calculateNetworkID(IPAddress(ip.gw.addr), IPAddress(ip.netmask.addr)); -} - -/** - * Get the softAP subnet CIDR. - * @return uint8_t softAP subnetCIDR - */ -uint8_t WiFiAPClass::softAPSubnetCIDR() -{ - tcpip_adapter_ip_info_t ip; - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return (uint8_t)0; - } - tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_AP, &ip); - return WiFiGenericClass::calculateSubnetCIDR(IPAddress(ip.netmask.addr)); -} - -/** - * Get the softAP interface MAC address. - * @param mac pointer to uint8_t array with length WL_MAC_ADDR_LENGTH - * @return pointer to uint8_t* - */ -uint8_t* WiFiAPClass::softAPmacAddress(uint8_t* mac) -{ - if(WiFiGenericClass::getMode() != WIFI_MODE_NULL){ - esp_wifi_get_mac(WIFI_IF_AP, mac); - } - return mac; -} - -/** - * Get the softAP interface MAC address. - * @return String mac - */ -String WiFiAPClass::softAPmacAddress(void) -{ - uint8_t mac[6]; - char macStr[18] = { 0 }; - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return String(); - } - esp_wifi_get_mac(WIFI_IF_AP, mac); - - sprintf(macStr, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - return String(macStr); -} - -/** - * Get the softAP interface Host name. - * @return char array hostname - */ -const char * WiFiAPClass::softAPgetHostname() -{ - const char * hostname = NULL; - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return hostname; - } - if(tcpip_adapter_get_hostname(TCPIP_ADAPTER_IF_AP, &hostname)) { - return hostname; - } - return hostname; -} - -/** - * Set the softAP interface Host name. - * @param hostname pointer to const string - * @return true on success - */ -bool WiFiAPClass::softAPsetHostname(const char * hostname) -{ - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return false; - } - return tcpip_adapter_set_hostname(TCPIP_ADAPTER_IF_AP, hostname) == ESP_OK; -} - -/** - * Enable IPv6 on the softAP interface. - * @return true on success - */ -bool WiFiAPClass::softAPenableIpV6() -{ - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return false; - } - return tcpip_adapter_create_ip6_linklocal(TCPIP_ADAPTER_IF_AP) == ESP_OK; -} - -/** - * Get the softAP interface IPv6 address. - * @return IPv6Address softAP IPv6 - */ -IPv6Address WiFiAPClass::softAPIPv6() -{ - static ip6_addr_t addr; - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return IPv6Address(); - } - if(tcpip_adapter_get_ip6_linklocal(TCPIP_ADAPTER_IF_AP, &addr)) { - return IPv6Address(); - } - return IPv6Address(addr.addr); -} diff --git a/libraries/WiFi/src/WiFiAP.h b/libraries/WiFi/src/WiFiAP.h deleted file mode 100644 index f1533cc3611..00000000000 --- a/libraries/WiFi/src/WiFiAP.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - ESP8266WiFiAP.h - esp8266 Wifi support. - Based on WiFi.h from Arduino WiFi shield library. - Copyright (c) 2011-2014 Arduino. All right reserved. - Modified by Ivan Grokhotkov, December 2014 - Reworked by Markus Sattler, December 2015 - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef ESP32WIFIAP_H_ -#define ESP32WIFIAP_H_ - - -#include "WiFiType.h" -#include "WiFiGeneric.h" - - -class WiFiAPClass -{ - - // ---------------------------------------------------------------------------------------------- - // ----------------------------------------- AP function ---------------------------------------- - // ---------------------------------------------------------------------------------------------- - -public: - - bool softAP(const char* ssid, const char* passphrase = NULL, int channel = 1, int ssid_hidden = 0, int max_connection = 4); - bool softAPConfig(IPAddress local_ip, IPAddress gateway, IPAddress subnet); - bool softAPdisconnect(bool wifioff = false); - - uint8_t softAPgetStationNum(); - - IPAddress softAPIP(); - - IPAddress softAPBroadcastIP(); - IPAddress softAPNetworkID(); - uint8_t softAPSubnetCIDR(); - - bool softAPenableIpV6(); - IPv6Address softAPIPv6(); - - const char * softAPgetHostname(); - bool softAPsetHostname(const char * hostname); - - uint8_t* softAPmacAddress(uint8_t* mac); - String softAPmacAddress(void); - -protected: - -}; - -#endif /* ESP32WIFIAP_H_*/ diff --git a/libraries/WiFi/src/WiFiClient.cpp b/libraries/WiFi/src/WiFiClient.cpp deleted file mode 100644 index 616b5de90f2..00000000000 --- a/libraries/WiFi/src/WiFiClient.cpp +++ /dev/null @@ -1,589 +0,0 @@ -/* - Client.h - Client class for Raspberry Pi - Copyright (c) 2016 Hristo Gochkov All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "WiFiClient.h" -#include "WiFi.h" -#include -#include -#include - -#define WIFI_CLIENT_MAX_WRITE_RETRY (10) -#define WIFI_CLIENT_SELECT_TIMEOUT_US (1000000) -#define WIFI_CLIENT_FLUSH_BUFFER_SIZE (1024) - -#undef connect -#undef write -#undef read - -class WiFiClientRxBuffer { -private: - size_t _size; - uint8_t *_buffer; - size_t _pos; - size_t _fill; - int _fd; - bool _failed; - - size_t r_available() - { - if(_fd < 0){ - return 0; - } - int count; - int res = lwip_ioctl_r(_fd, FIONREAD, &count); - if(res < 0) { - _failed = true; - return 0; - } - return count; - } - - size_t fillBuffer() - { - if(!_buffer){ - _buffer = (uint8_t *)malloc(_size); - if(!_buffer) { - log_e("Not enough memory to allocate buffer"); - _failed = true; - return 0; - } - } - if(_fill && _pos == _fill){ - _fill = 0; - _pos = 0; - } - if(!_buffer || _size <= _fill || !r_available()) { - return 0; - } - int res = recv(_fd, _buffer + _fill, _size - _fill, MSG_DONTWAIT); - if(res < 0) { - if(errno != EWOULDBLOCK) { - _failed = true; - } - return 0; - } - _fill += res; - return res; - } - -public: - WiFiClientRxBuffer(int fd, size_t size=1436) - :_size(size) - ,_buffer(NULL) - ,_pos(0) - ,_fill(0) - ,_fd(fd) - ,_failed(false) - { - //_buffer = (uint8_t *)malloc(_size); - } - - ~WiFiClientRxBuffer() - { - free(_buffer); - } - - bool failed(){ - return _failed; - } - - int read(uint8_t * dst, size_t len){ - if(!dst || !len || (_pos == _fill && !fillBuffer())){ - return -1; - } - size_t a = _fill - _pos; - if(len <= a || ((len - a) <= (_size - _fill) && fillBuffer() >= (len - a))){ - if(len == 1){ - *dst = _buffer[_pos]; - } else { - memcpy(dst, _buffer + _pos, len); - } - _pos += len; - return len; - } - size_t left = len; - size_t toRead = a; - uint8_t * buf = dst; - memcpy(buf, _buffer + _pos, toRead); - _pos += toRead; - left -= toRead; - buf += toRead; - while(left){ - if(!fillBuffer()){ - return len - left; - } - a = _fill - _pos; - toRead = (a > left)?left:a; - memcpy(buf, _buffer + _pos, toRead); - _pos += toRead; - left -= toRead; - buf += toRead; - } - return len; - } - - int peek(){ - if(_pos == _fill && !fillBuffer()){ - return -1; - } - return _buffer[_pos]; - } - - size_t available(){ - return _fill - _pos + r_available(); - } -}; - -class WiFiClientSocketHandle { -private: - int sockfd; - -public: - WiFiClientSocketHandle(int fd):sockfd(fd) - { - } - - ~WiFiClientSocketHandle() - { - close(sockfd); - } - - int fd() - { - return sockfd; - } -}; - -WiFiClient::WiFiClient():_connected(false),next(NULL) -{ -} - -WiFiClient::WiFiClient(int fd):_connected(true),next(NULL) -{ - clientSocketHandle.reset(new WiFiClientSocketHandle(fd)); - _rxBuffer.reset(new WiFiClientRxBuffer(fd)); -} - -WiFiClient::~WiFiClient() -{ - stop(); -} - -WiFiClient & WiFiClient::operator=(const WiFiClient &other) -{ - stop(); - clientSocketHandle = other.clientSocketHandle; - _rxBuffer = other._rxBuffer; - _connected = other._connected; - return *this; -} - -void WiFiClient::stop() -{ - clientSocketHandle = NULL; - _rxBuffer = NULL; - _connected = false; -} - -int WiFiClient::connect(IPAddress ip, uint16_t port) -{ - return connect(ip,port,-1); -} -int WiFiClient::connect(IPAddress ip, uint16_t port, int32_t timeout) -{ - int sockfd = socket(AF_INET, SOCK_STREAM, 0); - if (sockfd < 0) { - log_e("socket: %d", errno); - return 0; - } - fcntl( sockfd, F_SETFL, fcntl( sockfd, F_GETFL, 0 ) | O_NONBLOCK ); - - uint32_t ip_addr = ip; - struct sockaddr_in serveraddr; - bzero((char *) &serveraddr, sizeof(serveraddr)); - serveraddr.sin_family = AF_INET; - bcopy((const void *)(&ip_addr), (void *)&serveraddr.sin_addr.s_addr, 4); - serveraddr.sin_port = htons(port); - fd_set fdset; - struct timeval tv; - FD_ZERO(&fdset); - FD_SET(sockfd, &fdset); - tv.tv_sec = 0; - tv.tv_usec = timeout * 1000; - - int res = lwip_connect_r(sockfd, (struct sockaddr*)&serveraddr, sizeof(serveraddr)); - if (res < 0 && errno != EINPROGRESS) { - log_e("connect on fd %d, errno: %d, \"%s\"", sockfd, errno, strerror(errno)); - close(sockfd); - return 0; - } - - res = select(sockfd + 1, nullptr, &fdset, nullptr, timeout<0 ? nullptr : &tv); - if (res < 0) { - log_e("select on fd %d, errno: %d, \"%s\"", sockfd, errno, strerror(errno)); - close(sockfd); - return 0; - } else if (res == 0) { - log_i("select returned due to timeout %d ms for fd %d", timeout, sockfd); - close(sockfd); - return 0; - } else { - int sockerr; - socklen_t len = (socklen_t)sizeof(int); - res = getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &sockerr, &len); - - if (res < 0) { - log_e("getsockopt on fd %d, errno: %d, \"%s\"", sockfd, errno, strerror(errno)); - close(sockfd); - return 0; - } - - if (sockerr != 0) { - log_e("socket error on fd %d, errno: %d, \"%s\"", sockfd, sockerr, strerror(sockerr)); - close(sockfd); - return 0; - } - } - - fcntl( sockfd, F_SETFL, fcntl( sockfd, F_GETFL, 0 ) & (~O_NONBLOCK) ); - clientSocketHandle.reset(new WiFiClientSocketHandle(sockfd)); - _rxBuffer.reset(new WiFiClientRxBuffer(sockfd)); - _connected = true; - return 1; -} - -int WiFiClient::connect(const char *host, uint16_t port) -{ - return connect(host,port,-1); -} -int WiFiClient::connect(const char *host, uint16_t port, int32_t timeout) -{ - IPAddress srv((uint32_t)0); - if(!WiFiGenericClass::hostByName(host, srv)){ - return 0; - } - return connect(srv, port, timeout); -} - -int WiFiClient::setSocketOption(int option, char* value, size_t len) -{ - int res = setsockopt(fd(), SOL_SOCKET, option, value, len); - if(res < 0) { - log_e("%X : %d", option, errno); - } - return res; -} - -int WiFiClient::setTimeout(uint32_t seconds) -{ - Client::setTimeout(seconds * 1000); - struct timeval tv; - tv.tv_sec = seconds; - tv.tv_usec = 0; - if(setSocketOption(SO_RCVTIMEO, (char *)&tv, sizeof(struct timeval)) < 0) { - return -1; - } - return setSocketOption(SO_SNDTIMEO, (char *)&tv, sizeof(struct timeval)); -} - -int WiFiClient::setOption(int option, int *value) -{ - int res = setsockopt(fd(), IPPROTO_TCP, option, (char *) value, sizeof(int)); - if(res < 0) { - log_e("fail on fd %d, errno: %d, \"%s\"", fd(), errno, strerror(errno)); - } - return res; -} - -int WiFiClient::getOption(int option, int *value) -{ - size_t size = sizeof(int); - int res = getsockopt(fd(), IPPROTO_TCP, option, (char *)value, &size); - if(res < 0) { - log_e("fail on fd %d, errno: %d, \"%s\"", fd(), errno, strerror(errno)); - } - return res; -} - -int WiFiClient::setNoDelay(bool nodelay) -{ - int flag = nodelay; - return setOption(TCP_NODELAY, &flag); -} - -bool WiFiClient::getNoDelay() -{ - int flag = 0; - getOption(TCP_NODELAY, &flag); - return flag; -} - -size_t WiFiClient::write(uint8_t data) -{ - return write(&data, 1); -} - -int WiFiClient::read() -{ - uint8_t data = 0; - int res = read(&data, 1); - if(res < 0) { - return res; - } - return data; -} - -size_t WiFiClient::write(const uint8_t *buf, size_t size) -{ - int res =0; - int retry = WIFI_CLIENT_MAX_WRITE_RETRY; - int socketFileDescriptor = fd(); - size_t totalBytesSent = 0; - size_t bytesRemaining = size; - - if(!_connected || (socketFileDescriptor < 0)) { - return 0; - } - - while(retry) { - //use select to make sure the socket is ready for writing - fd_set set; - struct timeval tv; - FD_ZERO(&set); // empties the set - FD_SET(socketFileDescriptor, &set); // adds FD to the set - tv.tv_sec = 0; - tv.tv_usec = WIFI_CLIENT_SELECT_TIMEOUT_US; - retry--; - - if(select(socketFileDescriptor + 1, NULL, &set, NULL, &tv) < 0) { - return 0; - } - - if(FD_ISSET(socketFileDescriptor, &set)) { - res = send(socketFileDescriptor, (void*) buf, bytesRemaining, MSG_DONTWAIT); - if(res > 0) { - totalBytesSent += res; - if (totalBytesSent >= size) { - //completed successfully - retry = 0; - } else { - buf += res; - bytesRemaining -= res; - retry = WIFI_CLIENT_MAX_WRITE_RETRY; - } - } - else if(res < 0) { - log_e("fail on fd %d, errno: %d, \"%s\"", fd(), errno, strerror(errno)); - if(errno != EAGAIN) { - //if resource was busy, can try again, otherwise give up - stop(); - res = 0; - retry = 0; - } - } - else { - // Try again - } - } - } - return totalBytesSent; -} - -size_t WiFiClient::write_P(PGM_P buf, size_t size) -{ - return write(buf, size); -} - -size_t WiFiClient::write(Stream &stream) -{ - uint8_t * buf = (uint8_t *)malloc(1360); - if(!buf){ - return 0; - } - size_t toRead = 0, toWrite = 0, written = 0; - size_t available = stream.available(); - while(available){ - toRead = (available > 1360)?1360:available; - toWrite = stream.readBytes(buf, toRead); - written += write(buf, toWrite); - available = stream.available(); - } - free(buf); - return written; -} - -int WiFiClient::read(uint8_t *buf, size_t size) -{ - int res = -1; - res = _rxBuffer->read(buf, size); - if(_rxBuffer->failed()) { - log_e("fail on fd %d, errno: %d, \"%s\"", fd(), errno, strerror(errno)); - stop(); - } - return res; -} - -int WiFiClient::peek() -{ - int res = _rxBuffer->peek(); - if(_rxBuffer->failed()) { - log_e("fail on fd %d, errno: %d, \"%s\"", fd(), errno, strerror(errno)); - stop(); - } - return res; -} - -int WiFiClient::available() -{ - if(!_rxBuffer) - { - return 0; - } - int res = _rxBuffer->available(); - if(_rxBuffer->failed()) { - log_e("fail on fd %d, errno: %d, \"%s\"", fd(), errno, strerror(errno)); - stop(); - } - return res; -} - -// Though flushing means to send all pending data, -// seems that in Arduino it also means to clear RX -void WiFiClient::flush() { - int res; - size_t a = available(), toRead = 0; - if(!a){ - return;//nothing to flush - } - uint8_t * buf = (uint8_t *)malloc(WIFI_CLIENT_FLUSH_BUFFER_SIZE); - if(!buf){ - return;//memory error - } - while(a){ - toRead = (a>WIFI_CLIENT_FLUSH_BUFFER_SIZE)?WIFI_CLIENT_FLUSH_BUFFER_SIZE:a; - res = recv(fd(), buf, toRead, MSG_DONTWAIT); - if(res < 0) { - log_e("fail on fd %d, errno: %d, \"%s\"", fd(), errno, strerror(errno)); - stop(); - break; - } - a -= res; - } - free(buf); -} - -uint8_t WiFiClient::connected() -{ - if (_connected) { - uint8_t dummy; - int res = recv(fd(), &dummy, 0, MSG_DONTWAIT); - // avoid unused var warning by gcc - (void)res; - switch (errno) { - case EWOULDBLOCK: - case ENOENT: //caused by vfs - _connected = true; - break; - case ENOTCONN: - case EPIPE: - case ECONNRESET: - case ECONNREFUSED: - case ECONNABORTED: - _connected = false; - log_d("Disconnected: RES: %d, ERR: %d", res, errno); - break; - default: - log_i("Unexpected: RES: %d, ERR: %d", res, errno); - _connected = true; - break; - } - } - return _connected; -} - -IPAddress WiFiClient::remoteIP(int fd) const -{ - struct sockaddr_storage addr; - socklen_t len = sizeof addr; - getpeername(fd, (struct sockaddr*)&addr, &len); - struct sockaddr_in *s = (struct sockaddr_in *)&addr; - return IPAddress((uint32_t)(s->sin_addr.s_addr)); -} - -uint16_t WiFiClient::remotePort(int fd) const -{ - struct sockaddr_storage addr; - socklen_t len = sizeof addr; - getpeername(fd, (struct sockaddr*)&addr, &len); - struct sockaddr_in *s = (struct sockaddr_in *)&addr; - return ntohs(s->sin_port); -} - -IPAddress WiFiClient::remoteIP() const -{ - return remoteIP(fd()); -} - -uint16_t WiFiClient::remotePort() const -{ - return remotePort(fd()); -} - -IPAddress WiFiClient::localIP(int fd) const -{ - struct sockaddr_storage addr; - socklen_t len = sizeof addr; - getsockname(fd, (struct sockaddr*)&addr, &len); - struct sockaddr_in *s = (struct sockaddr_in *)&addr; - return IPAddress((uint32_t)(s->sin_addr.s_addr)); -} - -uint16_t WiFiClient::localPort(int fd) const -{ - struct sockaddr_storage addr; - socklen_t len = sizeof addr; - getsockname(fd, (struct sockaddr*)&addr, &len); - struct sockaddr_in *s = (struct sockaddr_in *)&addr; - return ntohs(s->sin_port); -} - -IPAddress WiFiClient::localIP() const -{ - return localIP(fd()); -} - -uint16_t WiFiClient::localPort() const -{ - return localPort(fd()); -} - -bool WiFiClient::operator==(const WiFiClient& rhs) -{ - return clientSocketHandle == rhs.clientSocketHandle && remotePort() == rhs.remotePort() && remoteIP() == rhs.remoteIP(); -} - -int WiFiClient::fd() const -{ - if (clientSocketHandle == NULL) { - return -1; - } else { - return clientSocketHandle->fd(); - } -} - diff --git a/libraries/WiFi/src/WiFiClient.h b/libraries/WiFi/src/WiFiClient.h deleted file mode 100644 index 4915cfd5203..00000000000 --- a/libraries/WiFi/src/WiFiClient.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - Client.h - Base class that provides Client - Copyright (c) 2011 Adrian McEwen. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef _WIFICLIENT_H_ -#define _WIFICLIENT_H_ - - -#include "Arduino.h" -#include "Client.h" -#include - -class WiFiClientSocketHandle; -class WiFiClientRxBuffer; - -class ESPLwIPClient : public Client -{ -public: - virtual int connect(IPAddress ip, uint16_t port, int32_t timeout) = 0; - virtual int connect(const char *host, uint16_t port, int32_t timeout) = 0; - virtual int setTimeout(uint32_t seconds) = 0; -}; - -class WiFiClient : public ESPLwIPClient -{ -protected: - std::shared_ptr clientSocketHandle; - std::shared_ptr _rxBuffer; - bool _connected; - -public: - WiFiClient *next; - WiFiClient(); - WiFiClient(int fd); - ~WiFiClient(); - int connect(IPAddress ip, uint16_t port); - int connect(IPAddress ip, uint16_t port, int32_t timeout); - int connect(const char *host, uint16_t port); - int connect(const char *host, uint16_t port, int32_t timeout); - size_t write(uint8_t data); - size_t write(const uint8_t *buf, size_t size); - size_t write_P(PGM_P buf, size_t size); - size_t write(Stream &stream); - int available(); - int read(); - int read(uint8_t *buf, size_t size); - int peek(); - void flush(); - void stop(); - uint8_t connected(); - - operator bool() - { - return connected(); - } - WiFiClient & operator=(const WiFiClient &other); - bool operator==(const bool value) - { - return bool() == value; - } - bool operator!=(const bool value) - { - return bool() != value; - } - bool operator==(const WiFiClient&); - bool operator!=(const WiFiClient& rhs) - { - return !this->operator==(rhs); - }; - - int fd() const; - - int setSocketOption(int option, char* value, size_t len); - int setOption(int option, int *value); - int getOption(int option, int *value); - int setTimeout(uint32_t seconds); - int setNoDelay(bool nodelay); - bool getNoDelay(); - - IPAddress remoteIP() const; - IPAddress remoteIP(int fd) const; - uint16_t remotePort() const; - uint16_t remotePort(int fd) const; - IPAddress localIP() const; - IPAddress localIP(int fd) const; - uint16_t localPort() const; - uint16_t localPort(int fd) const; - - //friend class WiFiServer; - using Print::write; -}; - -#endif /* _WIFICLIENT_H_ */ diff --git a/libraries/WiFi/src/WiFiGeneric.cpp b/libraries/WiFi/src/WiFiGeneric.cpp deleted file mode 100644 index c972fe6708b..00000000000 --- a/libraries/WiFi/src/WiFiGeneric.cpp +++ /dev/null @@ -1,700 +0,0 @@ -/* - ESP8266WiFiGeneric.cpp - WiFi library for esp8266 - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Reworked on 28 Dec 2015 by Markus Sattler - - */ - -#include "WiFi.h" -#include "WiFiGeneric.h" - -extern "C" { -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include "lwip/ip_addr.h" -#include "lwip/opt.h" -#include "lwip/err.h" -#include "lwip/dns.h" -#include "esp_ipc.h" - - -} //extern "C" - -#include "esp32-hal-log.h" -#include - -#include "sdkconfig.h" - -static xQueueHandle _network_event_queue; -static TaskHandle_t _network_event_task_handle = NULL; -static EventGroupHandle_t _network_event_group = NULL; - -static void _network_event_task(void * arg){ - system_event_t *event = NULL; - for (;;) { - if(xQueueReceive(_network_event_queue, &event, portMAX_DELAY) == pdTRUE){ - WiFiGenericClass::_eventCallback(arg, event); - } - } - vTaskDelete(NULL); - _network_event_task_handle = NULL; -} - -static esp_err_t _network_event_cb(void *arg, system_event_t *event){ - if (xQueueSend(_network_event_queue, &event, portMAX_DELAY) != pdPASS) { - log_w("Network Event Queue Send Failed!"); - return ESP_FAIL; - } - return ESP_OK; -} - -static bool _start_network_event_task(){ - if(!_network_event_group){ - _network_event_group = xEventGroupCreate(); - if(!_network_event_group){ - log_e("Network Event Group Create Failed!"); - return false; - } - xEventGroupSetBits(_network_event_group, WIFI_DNS_IDLE_BIT); - } - if(!_network_event_queue){ - _network_event_queue = xQueueCreate(32, sizeof(system_event_t *)); - if(!_network_event_queue){ - log_e("Network Event Queue Create Failed!"); - return false; - } - } - if(!_network_event_task_handle){ - xTaskCreateUniversal(_network_event_task, "network_event", 4096, NULL, ESP_TASKD_EVENT_PRIO - 1, &_network_event_task_handle, CONFIG_ARDUINO_EVENT_RUNNING_CORE); - if(!_network_event_task_handle){ - log_e("Network Event Task Start Failed!"); - return false; - } - } - return esp_event_loop_init(&_network_event_cb, NULL) == ESP_OK; -} - -void tcpipInit(){ - static bool initialized = false; - if(!initialized && _start_network_event_task()){ - initialized = true; - tcpip_adapter_init(); - } -} - -static bool lowLevelInitDone = false; -static bool wifiLowLevelInit(bool persistent){ - if(!lowLevelInitDone){ - tcpipInit(); - wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); - esp_err_t err = esp_wifi_init(&cfg); - if(err){ - log_e("esp_wifi_init %d", err); - return false; - } - if(!persistent){ - esp_wifi_set_storage(WIFI_STORAGE_RAM); - } - lowLevelInitDone = true; - } - return true; -} - -static bool wifiLowLevelDeinit(){ - //deinit not working yet! - //esp_wifi_deinit(); - return true; -} - -static bool _esp_wifi_started = false; - -static bool espWiFiStart(bool persistent){ - if(_esp_wifi_started){ - return true; - } - if(!wifiLowLevelInit(persistent)){ - return false; - } - esp_err_t err = esp_wifi_start(); - if (err != ESP_OK) { - log_e("esp_wifi_start %d", err); - wifiLowLevelDeinit(); - return false; - } - _esp_wifi_started = true; - system_event_t event; - event.event_id = SYSTEM_EVENT_WIFI_READY; - WiFiGenericClass::_eventCallback(nullptr, &event); - - return true; -} - -static bool espWiFiStop(){ - esp_err_t err; - if(!_esp_wifi_started){ - return true; - } - _esp_wifi_started = false; - err = esp_wifi_stop(); - if(err){ - log_e("Could not stop WiFi! %d", err); - _esp_wifi_started = true; - return false; - } - return wifiLowLevelDeinit(); -} - -// ----------------------------------------------------------------------------------------------------------------------- -// ------------------------------------------------- Generic WiFi function ----------------------------------------------- -// ----------------------------------------------------------------------------------------------------------------------- - -typedef struct WiFiEventCbList { - static wifi_event_id_t current_id; - wifi_event_id_t id; - WiFiEventCb cb; - WiFiEventFuncCb fcb; - WiFiEventSysCb scb; - system_event_id_t event; - - WiFiEventCbList() : id(current_id++), cb(NULL), fcb(NULL), scb(NULL), event(SYSTEM_EVENT_WIFI_READY) {} -} WiFiEventCbList_t; -wifi_event_id_t WiFiEventCbList::current_id = 1; - - -// arduino dont like std::vectors move static here -static std::vector cbEventList; - -bool WiFiGenericClass::_persistent = true; -wifi_mode_t WiFiGenericClass::_forceSleepLastMode = WIFI_MODE_NULL; - -WiFiGenericClass::WiFiGenericClass() -{ - -} - -int WiFiGenericClass::setStatusBits(int bits){ - if(!_network_event_group){ - return 0; - } - return xEventGroupSetBits(_network_event_group, bits); -} - -int WiFiGenericClass::clearStatusBits(int bits){ - if(!_network_event_group){ - return 0; - } - return xEventGroupClearBits(_network_event_group, bits); -} - -int WiFiGenericClass::getStatusBits(){ - if(!_network_event_group){ - return 0; - } - return xEventGroupGetBits(_network_event_group); -} - -int WiFiGenericClass::waitStatusBits(int bits, uint32_t timeout_ms){ - if(!_network_event_group){ - return 0; - } - return xEventGroupWaitBits( - _network_event_group, // The event group being tested. - bits, // The bits within the event group to wait for. - pdFALSE, // BIT_0 and BIT_4 should be cleared before returning. - pdTRUE, // Don't wait for both bits, either bit will do. - timeout_ms / portTICK_PERIOD_MS ) & bits; // Wait a maximum of 100ms for either bit to be set. -} - -/** - * set callback function - * @param cbEvent WiFiEventCb - * @param event optional filter (WIFI_EVENT_MAX is all events) - */ -wifi_event_id_t WiFiGenericClass::onEvent(WiFiEventCb cbEvent, system_event_id_t event) -{ - if(!cbEvent) { - return 0; - } - WiFiEventCbList_t newEventHandler; - newEventHandler.cb = cbEvent; - newEventHandler.fcb = NULL; - newEventHandler.scb = NULL; - newEventHandler.event = event; - cbEventList.push_back(newEventHandler); - return newEventHandler.id; -} - -wifi_event_id_t WiFiGenericClass::onEvent(WiFiEventFuncCb cbEvent, system_event_id_t event) -{ - if(!cbEvent) { - return 0; - } - WiFiEventCbList_t newEventHandler; - newEventHandler.cb = NULL; - newEventHandler.fcb = cbEvent; - newEventHandler.scb = NULL; - newEventHandler.event = event; - cbEventList.push_back(newEventHandler); - return newEventHandler.id; -} - -wifi_event_id_t WiFiGenericClass::onEvent(WiFiEventSysCb cbEvent, system_event_id_t event) -{ - if(!cbEvent) { - return 0; - } - WiFiEventCbList_t newEventHandler; - newEventHandler.cb = NULL; - newEventHandler.fcb = NULL; - newEventHandler.scb = cbEvent; - newEventHandler.event = event; - cbEventList.push_back(newEventHandler); - return newEventHandler.id; -} - -/** - * removes a callback form event handler - * @param cbEvent WiFiEventCb - * @param event optional filter (WIFI_EVENT_MAX is all events) - */ -void WiFiGenericClass::removeEvent(WiFiEventCb cbEvent, system_event_id_t event) -{ - if(!cbEvent) { - return; - } - - for(uint32_t i = 0; i < cbEventList.size(); i++) { - WiFiEventCbList_t entry = cbEventList[i]; - if(entry.cb == cbEvent && entry.event == event) { - cbEventList.erase(cbEventList.begin() + i); - } - } -} - -void WiFiGenericClass::removeEvent(WiFiEventSysCb cbEvent, system_event_id_t event) -{ - if(!cbEvent) { - return; - } - - for(uint32_t i = 0; i < cbEventList.size(); i++) { - WiFiEventCbList_t entry = cbEventList[i]; - if(entry.scb == cbEvent && entry.event == event) { - cbEventList.erase(cbEventList.begin() + i); - } - } -} - -void WiFiGenericClass::removeEvent(wifi_event_id_t id) -{ - for(uint32_t i = 0; i < cbEventList.size(); i++) { - WiFiEventCbList_t entry = cbEventList[i]; - if(entry.id == id) { - cbEventList.erase(cbEventList.begin() + i); - } - } -} - -/** - * callback for WiFi events - * @param arg - */ -#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG -const char * system_event_names[] = { "WIFI_READY", "SCAN_DONE", "STA_START", "STA_STOP", "STA_CONNECTED", "STA_DISCONNECTED", "STA_AUTHMODE_CHANGE", "STA_GOT_IP", "STA_LOST_IP", "STA_WPS_ER_SUCCESS", "STA_WPS_ER_FAILED", "STA_WPS_ER_TIMEOUT", "STA_WPS_ER_PIN", "AP_START", "AP_STOP", "AP_STACONNECTED", "AP_STADISCONNECTED", "AP_STAIPASSIGNED", "AP_PROBEREQRECVED", "GOT_IP6", "ETH_START", "ETH_STOP", "ETH_CONNECTED", "ETH_DISCONNECTED", "ETH_GOT_IP", "MAX"}; -#endif -#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_WARN -const char * system_event_reasons[] = { "UNSPECIFIED", "AUTH_EXPIRE", "AUTH_LEAVE", "ASSOC_EXPIRE", "ASSOC_TOOMANY", "NOT_AUTHED", "NOT_ASSOCED", "ASSOC_LEAVE", "ASSOC_NOT_AUTHED", "DISASSOC_PWRCAP_BAD", "DISASSOC_SUPCHAN_BAD", "UNSPECIFIED", "IE_INVALID", "MIC_FAILURE", "4WAY_HANDSHAKE_TIMEOUT", "GROUP_KEY_UPDATE_TIMEOUT", "IE_IN_4WAY_DIFFERS", "GROUP_CIPHER_INVALID", "PAIRWISE_CIPHER_INVALID", "AKMP_INVALID", "UNSUPP_RSN_IE_VERSION", "INVALID_RSN_IE_CAP", "802_1X_AUTH_FAILED", "CIPHER_SUITE_REJECTED", "BEACON_TIMEOUT", "NO_AP_FOUND", "AUTH_FAIL", "ASSOC_FAIL", "HANDSHAKE_TIMEOUT" }; -#define reason2str(r) ((r>176)?system_event_reasons[r-176]:system_event_reasons[r-1]) -#endif -esp_err_t WiFiGenericClass::_eventCallback(void *arg, system_event_t *event) -{ - if(event->event_id < 26) { - log_d("Event: %d - %s", event->event_id, system_event_names[event->event_id]); - } - if(event->event_id == SYSTEM_EVENT_SCAN_DONE) { - WiFiScanClass::_scanDone(); - - } else if(event->event_id == SYSTEM_EVENT_STA_START) { - WiFiSTAClass::_setStatus(WL_DISCONNECTED); - setStatusBits(STA_STARTED_BIT); - } else if(event->event_id == SYSTEM_EVENT_STA_STOP) { - WiFiSTAClass::_setStatus(WL_NO_SHIELD); - clearStatusBits(STA_STARTED_BIT | STA_CONNECTED_BIT | STA_HAS_IP_BIT | STA_HAS_IP6_BIT); - } else if(event->event_id == SYSTEM_EVENT_STA_CONNECTED) { - WiFiSTAClass::_setStatus(WL_IDLE_STATUS); - setStatusBits(STA_CONNECTED_BIT); - } else if(event->event_id == SYSTEM_EVENT_STA_DISCONNECTED) { - uint8_t reason = event->event_info.disconnected.reason; - log_w("Reason: %u - %s", reason, reason2str(reason)); - if(reason == WIFI_REASON_NO_AP_FOUND) { - WiFiSTAClass::_setStatus(WL_NO_SSID_AVAIL); - } else if(reason == WIFI_REASON_AUTH_FAIL || reason == WIFI_REASON_ASSOC_FAIL) { - WiFiSTAClass::_setStatus(WL_CONNECT_FAILED); - } else if(reason == WIFI_REASON_BEACON_TIMEOUT || reason == WIFI_REASON_HANDSHAKE_TIMEOUT) { - WiFiSTAClass::_setStatus(WL_CONNECTION_LOST); - } else if(reason == WIFI_REASON_AUTH_EXPIRE) { - - } else { - WiFiSTAClass::_setStatus(WL_DISCONNECTED); - } - clearStatusBits(STA_CONNECTED_BIT | STA_HAS_IP_BIT | STA_HAS_IP6_BIT); - if(((reason == WIFI_REASON_AUTH_EXPIRE) || - (reason >= WIFI_REASON_BEACON_TIMEOUT && reason != WIFI_REASON_AUTH_FAIL)) && - WiFi.getAutoReconnect()) - { - WiFi.disconnect(); - WiFi.begin(); - } - } else if(event->event_id == SYSTEM_EVENT_STA_GOT_IP) { -#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG - uint8_t * ip = (uint8_t *)&(event->event_info.got_ip.ip_info.ip.addr); - uint8_t * mask = (uint8_t *)&(event->event_info.got_ip.ip_info.netmask.addr); - uint8_t * gw = (uint8_t *)&(event->event_info.got_ip.ip_info.gw.addr); - log_d("STA IP: %u.%u.%u.%u, MASK: %u.%u.%u.%u, GW: %u.%u.%u.%u", - ip[0], ip[1], ip[2], ip[3], - mask[0], mask[1], mask[2], mask[3], - gw[0], gw[1], gw[2], gw[3]); -#endif - WiFiSTAClass::_setStatus(WL_CONNECTED); - setStatusBits(STA_HAS_IP_BIT | STA_CONNECTED_BIT); - } else if(event->event_id == SYSTEM_EVENT_STA_LOST_IP) { - WiFiSTAClass::_setStatus(WL_IDLE_STATUS); - clearStatusBits(STA_HAS_IP_BIT); - - } else if(event->event_id == SYSTEM_EVENT_AP_START) { - setStatusBits(AP_STARTED_BIT); - } else if(event->event_id == SYSTEM_EVENT_AP_STOP) { - clearStatusBits(AP_STARTED_BIT | AP_HAS_CLIENT_BIT); - } else if(event->event_id == SYSTEM_EVENT_AP_STACONNECTED) { - setStatusBits(AP_HAS_CLIENT_BIT); - } else if(event->event_id == SYSTEM_EVENT_AP_STADISCONNECTED) { - wifi_sta_list_t clients; - if(esp_wifi_ap_get_sta_list(&clients) != ESP_OK || !clients.num){ - clearStatusBits(AP_HAS_CLIENT_BIT); - } - - } else if(event->event_id == SYSTEM_EVENT_ETH_START) { - setStatusBits(ETH_STARTED_BIT); - } else if(event->event_id == SYSTEM_EVENT_ETH_STOP) { - clearStatusBits(ETH_STARTED_BIT | ETH_CONNECTED_BIT | ETH_HAS_IP_BIT | ETH_HAS_IP6_BIT); - } else if(event->event_id == SYSTEM_EVENT_ETH_CONNECTED) { - setStatusBits(ETH_CONNECTED_BIT); - } else if(event->event_id == SYSTEM_EVENT_ETH_DISCONNECTED) { - clearStatusBits(ETH_CONNECTED_BIT | ETH_HAS_IP_BIT | ETH_HAS_IP6_BIT); - } else if(event->event_id == SYSTEM_EVENT_ETH_GOT_IP) { -#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG - uint8_t * ip = (uint8_t *)&(event->event_info.got_ip.ip_info.ip.addr); - uint8_t * mask = (uint8_t *)&(event->event_info.got_ip.ip_info.netmask.addr); - uint8_t * gw = (uint8_t *)&(event->event_info.got_ip.ip_info.gw.addr); - log_d("ETH IP: %u.%u.%u.%u, MASK: %u.%u.%u.%u, GW: %u.%u.%u.%u", - ip[0], ip[1], ip[2], ip[3], - mask[0], mask[1], mask[2], mask[3], - gw[0], gw[1], gw[2], gw[3]); -#endif - setStatusBits(ETH_CONNECTED_BIT | ETH_HAS_IP_BIT); - - } else if(event->event_id == SYSTEM_EVENT_GOT_IP6) { - if(event->event_info.got_ip6.if_index == TCPIP_ADAPTER_IF_AP){ - setStatusBits(AP_HAS_IP6_BIT); - } else if(event->event_info.got_ip6.if_index == TCPIP_ADAPTER_IF_STA){ - setStatusBits(STA_CONNECTED_BIT | STA_HAS_IP6_BIT); - } else if(event->event_info.got_ip6.if_index == TCPIP_ADAPTER_IF_ETH){ - setStatusBits(ETH_CONNECTED_BIT | ETH_HAS_IP6_BIT); - } - } - - for(uint32_t i = 0; i < cbEventList.size(); i++) { - WiFiEventCbList_t entry = cbEventList[i]; - if(entry.cb || entry.fcb || entry.scb) { - if(entry.event == (system_event_id_t) event->event_id || entry.event == SYSTEM_EVENT_MAX) { - if(entry.cb) { - entry.cb((system_event_id_t) event->event_id); - } else if(entry.fcb) { - entry.fcb((system_event_id_t) event->event_id, (system_event_info_t) event->event_info); - } else { - entry.scb(event); - } - } - } - } - return ESP_OK; -} - -/** - * Return the current channel associated with the network - * @return channel (1-13) - */ -int32_t WiFiGenericClass::channel(void) -{ - uint8_t primaryChan = 0; - wifi_second_chan_t secondChan = WIFI_SECOND_CHAN_NONE; - if(!lowLevelInitDone){ - return primaryChan; - } - esp_wifi_get_channel(&primaryChan, &secondChan); - return primaryChan; -} - - -/** - * store WiFi config in SDK flash area - * @param persistent - */ -void WiFiGenericClass::persistent(bool persistent) -{ - _persistent = persistent; -} - - -/** - * set new mode - * @param m WiFiMode_t - */ -bool WiFiGenericClass::mode(wifi_mode_t m) -{ - wifi_mode_t cm = getMode(); - if(cm == m) { - return true; - } - if(!cm && m){ - if(!espWiFiStart(_persistent)){ - return false; - } - } else if(cm && !m){ - return espWiFiStop(); - } - - esp_err_t err; - err = esp_wifi_set_mode(m); - if(err){ - log_e("Could not set mode! %d", err); - return false; - } - return true; -} - -/** - * get WiFi mode - * @return WiFiMode - */ -wifi_mode_t WiFiGenericClass::getMode() -{ - if(!_esp_wifi_started){ - return WIFI_MODE_NULL; - } - wifi_mode_t mode; - if(esp_wifi_get_mode(&mode) == ESP_ERR_WIFI_NOT_INIT){ - log_w("WiFi not started"); - return WIFI_MODE_NULL; - } - return mode; -} - -/** - * control STA mode - * @param enable bool - * @return ok - */ -bool WiFiGenericClass::enableSTA(bool enable) -{ - - wifi_mode_t currentMode = getMode(); - bool isEnabled = ((currentMode & WIFI_MODE_STA) != 0); - - if(isEnabled != enable) { - if(enable) { - return mode((wifi_mode_t)(currentMode | WIFI_MODE_STA)); - } - return mode((wifi_mode_t)(currentMode & (~WIFI_MODE_STA))); - } - return true; -} - -/** - * control AP mode - * @param enable bool - * @return ok - */ -bool WiFiGenericClass::enableAP(bool enable) -{ - - wifi_mode_t currentMode = getMode(); - bool isEnabled = ((currentMode & WIFI_MODE_AP) != 0); - - if(isEnabled != enable) { - if(enable) { - return mode((wifi_mode_t)(currentMode | WIFI_MODE_AP)); - } - return mode((wifi_mode_t)(currentMode & (~WIFI_MODE_AP))); - } - return true; -} - -/** - * control modem sleep when only in STA mode - * @param enable bool - * @return ok - */ -bool WiFiGenericClass::setSleep(bool enable) -{ - if((getMode() & WIFI_MODE_STA) == 0){ - log_w("STA has not been started"); - return false; - } - return esp_wifi_set_ps(enable?WIFI_PS_MIN_MODEM:WIFI_PS_NONE) == ESP_OK; -} - -/** - * get modem sleep enabled - * @return true if modem sleep is enabled - */ -bool WiFiGenericClass::getSleep() -{ - wifi_ps_type_t ps; - if((getMode() & WIFI_MODE_STA) == 0){ - log_w("STA has not been started"); - return false; - } - if(esp_wifi_get_ps(&ps) == ESP_OK){ - return ps == WIFI_PS_MIN_MODEM; - } - return false; -} - -/** - * control wifi tx power - * @param power enum maximum wifi tx power - * @return ok - */ -bool WiFiGenericClass::setTxPower(wifi_power_t power){ - if((getStatusBits() & (STA_STARTED_BIT | AP_STARTED_BIT)) == 0){ - log_w("Neither AP or STA has been started"); - return false; - } - return esp_wifi_set_max_tx_power(power) == ESP_OK; -} - -wifi_power_t WiFiGenericClass::getTxPower(){ - int8_t power; - if((getStatusBits() & (STA_STARTED_BIT | AP_STARTED_BIT)) == 0){ - log_w("Neither AP or STA has been started"); - return WIFI_POWER_19_5dBm; - } - if(esp_wifi_get_max_tx_power(&power)){ - return WIFI_POWER_19_5dBm; - } - return (wifi_power_t)power; -} - -// ----------------------------------------------------------------------------------------------------------------------- -// ------------------------------------------------ Generic Network function --------------------------------------------- -// ----------------------------------------------------------------------------------------------------------------------- - -/** - * DNS callback - * @param name - * @param ipaddr - * @param callback_arg - */ -static void wifi_dns_found_callback(const char *name, const ip_addr_t *ipaddr, void *callback_arg) -{ - if(ipaddr) { - (*reinterpret_cast(callback_arg)) = ipaddr->u_addr.ip4.addr; - } - xEventGroupSetBits(_network_event_group, WIFI_DNS_DONE_BIT); -} - -/** - * Resolve the given hostname to an IP address. - * @param aHostname Name to be resolved - * @param aResult IPAddress structure to store the returned IP address - * @return 1 if aIPAddrString was successfully converted to an IP address, - * else error code - */ -int WiFiGenericClass::hostByName(const char* aHostname, IPAddress& aResult) -{ - ip_addr_t addr; - aResult = static_cast(0); - waitStatusBits(WIFI_DNS_IDLE_BIT, 5000); - clearStatusBits(WIFI_DNS_IDLE_BIT); - err_t err = dns_gethostbyname(aHostname, &addr, &wifi_dns_found_callback, &aResult); - if(err == ERR_OK && addr.u_addr.ip4.addr) { - aResult = addr.u_addr.ip4.addr; - } else if(err == ERR_INPROGRESS) { - waitStatusBits(WIFI_DNS_DONE_BIT, 4000); - clearStatusBits(WIFI_DNS_DONE_BIT); - } - setStatusBits(WIFI_DNS_IDLE_BIT); - if((uint32_t)aResult == 0){ - log_e("DNS Failed for %s", aHostname); - } - return (uint32_t)aResult != 0; -} - -IPAddress WiFiGenericClass::calculateNetworkID(IPAddress ip, IPAddress subnet) { - IPAddress networkID; - - for (size_t i = 0; i < 4; i++) - networkID[i] = subnet[i] & ip[i]; - - return networkID; -} - -IPAddress WiFiGenericClass::calculateBroadcast(IPAddress ip, IPAddress subnet) { - IPAddress broadcastIp; - - for (int i = 0; i < 4; i++) - broadcastIp[i] = ~subnet[i] | ip[i]; - - return broadcastIp; -} - -uint8_t WiFiGenericClass::calculateSubnetCIDR(IPAddress subnetMask) { - uint8_t CIDR = 0; - - for (uint8_t i = 0; i < 4; i++) { - if (subnetMask[i] == 0x80) // 128 - CIDR += 1; - else if (subnetMask[i] == 0xC0) // 192 - CIDR += 2; - else if (subnetMask[i] == 0xE0) // 224 - CIDR += 3; - else if (subnetMask[i] == 0xF0) // 242 - CIDR += 4; - else if (subnetMask[i] == 0xF8) // 248 - CIDR += 5; - else if (subnetMask[i] == 0xFC) // 252 - CIDR += 6; - else if (subnetMask[i] == 0xFE) // 254 - CIDR += 7; - else if (subnetMask[i] == 0xFF) // 255 - CIDR += 8; - } - - return CIDR; -} diff --git a/libraries/WiFi/src/WiFiGeneric.h b/libraries/WiFi/src/WiFiGeneric.h deleted file mode 100644 index ad0cd260767..00000000000 --- a/libraries/WiFi/src/WiFiGeneric.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - ESP8266WiFiGeneric.h - esp8266 Wifi support. - Based on WiFi.h from Ardiono WiFi shield library. - Copyright (c) 2011-2014 Arduino. All right reserved. - Modified by Ivan Grokhotkov, December 2014 - Reworked by Markus Sattler, December 2015 - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef ESP32WIFIGENERIC_H_ -#define ESP32WIFIGENERIC_H_ - -#include -#include -#include -#include "WiFiType.h" - -typedef void (*WiFiEventCb)(system_event_id_t event); -typedef std::function WiFiEventFuncCb; -typedef void (*WiFiEventSysCb)(system_event_t *event); - -typedef size_t wifi_event_id_t; - -typedef enum { - WIFI_POWER_19_5dBm = 78,// 19.5dBm - WIFI_POWER_19dBm = 76,// 19dBm - WIFI_POWER_18_5dBm = 74,// 18.5dBm - WIFI_POWER_17dBm = 68,// 17dBm - WIFI_POWER_15dBm = 60,// 15dBm - WIFI_POWER_13dBm = 52,// 13dBm - WIFI_POWER_11dBm = 44,// 11dBm - WIFI_POWER_8_5dBm = 34,// 8.5dBm - WIFI_POWER_7dBm = 28,// 7dBm - WIFI_POWER_5dBm = 20,// 5dBm - WIFI_POWER_2dBm = 8,// 2dBm - WIFI_POWER_MINUS_1dBm = -4// -1dBm -} wifi_power_t; - -static const int AP_STARTED_BIT = BIT0; -static const int AP_HAS_IP6_BIT = BIT1; -static const int AP_HAS_CLIENT_BIT = BIT2; -static const int STA_STARTED_BIT = BIT3; -static const int STA_CONNECTED_BIT = BIT4; -static const int STA_HAS_IP_BIT = BIT5; -static const int STA_HAS_IP6_BIT = BIT6; -static const int ETH_STARTED_BIT = BIT7; -static const int ETH_CONNECTED_BIT = BIT8; -static const int ETH_HAS_IP_BIT = BIT9; -static const int ETH_HAS_IP6_BIT = BIT10; -static const int WIFI_SCANNING_BIT = BIT11; -static const int WIFI_SCAN_DONE_BIT= BIT12; -static const int WIFI_DNS_IDLE_BIT = BIT13; -static const int WIFI_DNS_DONE_BIT = BIT14; - -class WiFiGenericClass -{ - public: - WiFiGenericClass(); - - wifi_event_id_t onEvent(WiFiEventCb cbEvent, system_event_id_t event = SYSTEM_EVENT_MAX); - wifi_event_id_t onEvent(WiFiEventFuncCb cbEvent, system_event_id_t event = SYSTEM_EVENT_MAX); - wifi_event_id_t onEvent(WiFiEventSysCb cbEvent, system_event_id_t event = SYSTEM_EVENT_MAX); - void removeEvent(WiFiEventCb cbEvent, system_event_id_t event = SYSTEM_EVENT_MAX); - void removeEvent(WiFiEventSysCb cbEvent, system_event_id_t event = SYSTEM_EVENT_MAX); - void removeEvent(wifi_event_id_t id); - - static int getStatusBits(); - static int waitStatusBits(int bits, uint32_t timeout_ms); - - int32_t channel(void); - - void persistent(bool persistent); - - static bool mode(wifi_mode_t); - static wifi_mode_t getMode(); - - bool enableSTA(bool enable); - bool enableAP(bool enable); - - bool setSleep(bool enable); - bool getSleep(); - - bool setTxPower(wifi_power_t power); - wifi_power_t getTxPower(); - - static esp_err_t _eventCallback(void *arg, system_event_t *event); - - protected: - static bool _persistent; - static wifi_mode_t _forceSleepLastMode; - - static int setStatusBits(int bits); - static int clearStatusBits(int bits); - - public: - static int hostByName(const char *aHostname, IPAddress &aResult); - - static IPAddress calculateNetworkID(IPAddress ip, IPAddress subnet); - static IPAddress calculateBroadcast(IPAddress ip, IPAddress subnet); - static uint8_t calculateSubnetCIDR(IPAddress subnetMask); - - protected: - friend class WiFiSTAClass; - friend class WiFiScanClass; - friend class WiFiAPClass; -}; - -#endif /* ESP32WIFIGENERIC_H_ */ diff --git a/libraries/WiFi/src/WiFiMulti.cpp b/libraries/WiFi/src/WiFiMulti.cpp deleted file mode 100644 index 730850333f1..00000000000 --- a/libraries/WiFi/src/WiFiMulti.cpp +++ /dev/null @@ -1,204 +0,0 @@ -/** - * - * @file WiFiMulti.cpp - * @date 16.05.2015 - * @author Markus Sattler - * - * Copyright (c) 2015 Markus Sattler. All rights reserved. - * This file is part of the esp8266 core for Arduino environment. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#include "WiFiMulti.h" -#include -#include -#include - -WiFiMulti::WiFiMulti() -{ -} - -WiFiMulti::~WiFiMulti() -{ - for(uint32_t i = 0; i < APlist.size(); i++) { - WifiAPlist_t entry = APlist[i]; - if(entry.ssid) { - free(entry.ssid); - } - if(entry.passphrase) { - free(entry.passphrase); - } - } - APlist.clear(); -} - -bool WiFiMulti::addAP(const char* ssid, const char *passphrase) -{ - WifiAPlist_t newAP; - - if(!ssid || *ssid == 0x00 || strlen(ssid) > 31) { - // fail SSID too long or missing! - log_e("[WIFI][APlistAdd] no ssid or ssid too long"); - return false; - } - - if(passphrase && strlen(passphrase) > 63) { - // fail passphrase too long! - log_e("[WIFI][APlistAdd] passphrase too long"); - return false; - } - - newAP.ssid = strdup(ssid); - - if(!newAP.ssid) { - log_e("[WIFI][APlistAdd] fail newAP.ssid == 0"); - return false; - } - - if(passphrase && *passphrase != 0x00) { - newAP.passphrase = strdup(passphrase); - if(!newAP.passphrase) { - log_e("[WIFI][APlistAdd] fail newAP.passphrase == 0"); - free(newAP.ssid); - return false; - } - } else { - newAP.passphrase = NULL; - } - - APlist.push_back(newAP); - log_i("[WIFI][APlistAdd] add SSID: %s", newAP.ssid); - return true; -} - -uint8_t WiFiMulti::run(uint32_t connectTimeout) -{ - int8_t scanResult; - uint8_t status = WiFi.status(); - if(status == WL_CONNECTED) { - for(uint32_t x = 0; x < APlist.size(); x++) { - if(WiFi.SSID()==APlist[x].ssid) { - return status; - } - } - WiFi.disconnect(false,false); - delay(10); - status = WiFi.status(); - } - - scanResult = WiFi.scanNetworks(); - if(scanResult == WIFI_SCAN_RUNNING) { - // scan is running - return WL_NO_SSID_AVAIL; - } else if(scanResult >= 0) { - // scan done analyze - WifiAPlist_t bestNetwork { NULL, NULL }; - int bestNetworkDb = INT_MIN; - uint8_t bestBSSID[6]; - int32_t bestChannel = 0; - - log_i("[WIFI] scan done"); - - if(scanResult == 0) { - log_e("[WIFI] no networks found"); - } else { - log_i("[WIFI] %d networks found", scanResult); - for(int8_t i = 0; i < scanResult; ++i) { - - String ssid_scan; - int32_t rssi_scan; - uint8_t sec_scan; - uint8_t* BSSID_scan; - int32_t chan_scan; - - WiFi.getNetworkInfo(i, ssid_scan, sec_scan, rssi_scan, BSSID_scan, chan_scan); - - bool known = false; - for(uint32_t x = 0; x < APlist.size(); x++) { - WifiAPlist_t entry = APlist[x]; - - if(ssid_scan == entry.ssid) { // SSID match - known = true; - if(rssi_scan > bestNetworkDb) { // best network - if(sec_scan == WIFI_AUTH_OPEN || entry.passphrase) { // check for passphrase if not open wlan - bestNetworkDb = rssi_scan; - bestChannel = chan_scan; - memcpy((void*) &bestNetwork, (void*) &entry, sizeof(bestNetwork)); - memcpy((void*) &bestBSSID, (void*) BSSID_scan, sizeof(bestBSSID)); - } - } - break; - } - } - - if(known) { - log_d(" ---> %d: [%d][%02X:%02X:%02X:%02X:%02X:%02X] %s (%d) %c", i, chan_scan, BSSID_scan[0], BSSID_scan[1], BSSID_scan[2], BSSID_scan[3], BSSID_scan[4], BSSID_scan[5], ssid_scan.c_str(), rssi_scan, (sec_scan == WIFI_AUTH_OPEN) ? ' ' : '*'); - } else { - log_d(" %d: [%d][%02X:%02X:%02X:%02X:%02X:%02X] %s (%d) %c", i, chan_scan, BSSID_scan[0], BSSID_scan[1], BSSID_scan[2], BSSID_scan[3], BSSID_scan[4], BSSID_scan[5], ssid_scan.c_str(), rssi_scan, (sec_scan == WIFI_AUTH_OPEN) ? ' ' : '*'); - } - } - } - - // clean up ram - WiFi.scanDelete(); - - if(bestNetwork.ssid) { - log_i("[WIFI] Connecting BSSID: %02X:%02X:%02X:%02X:%02X:%02X SSID: %s Channal: %d (%d)", bestBSSID[0], bestBSSID[1], bestBSSID[2], bestBSSID[3], bestBSSID[4], bestBSSID[5], bestNetwork.ssid, bestChannel, bestNetworkDb); - - WiFi.begin(bestNetwork.ssid, bestNetwork.passphrase, bestChannel, bestBSSID); - status = WiFi.status(); - - auto startTime = millis(); - // wait for connection, fail, or timeout - while(status != WL_CONNECTED && status != WL_NO_SSID_AVAIL && status != WL_CONNECT_FAILED && (millis() - startTime) <= connectTimeout) { - delay(10); - status = WiFi.status(); - } - - switch(status) { - case WL_CONNECTED: - log_i("[WIFI] Connecting done."); - log_d("[WIFI] SSID: %s", WiFi.SSID().c_str()); - log_d("[WIFI] IP: %s", WiFi.localIP().toString().c_str()); - log_d("[WIFI] MAC: %s", WiFi.BSSIDstr().c_str()); - log_d("[WIFI] Channel: %d", WiFi.channel()); - break; - case WL_NO_SSID_AVAIL: - log_e("[WIFI] Connecting Failed AP not found."); - break; - case WL_CONNECT_FAILED: - log_e("[WIFI] Connecting Failed."); - break; - default: - log_e("[WIFI] Connecting Failed (%d).", status); - break; - } - } else { - log_e("[WIFI] no matching wifi found!"); - } - } else { - // start scan - log_d("[WIFI] delete old wifi config..."); - WiFi.disconnect(); - - log_d("[WIFI] start scan"); - // scan wifi async mode - WiFi.scanNetworks(true); - } - - return status; -} diff --git a/libraries/WiFi/src/WiFiMulti.h b/libraries/WiFi/src/WiFiMulti.h deleted file mode 100644 index 38ddb5d9f95..00000000000 --- a/libraries/WiFi/src/WiFiMulti.h +++ /dev/null @@ -1,51 +0,0 @@ -/** - * - * @file ESP8266WiFiMulti.h - * @date 16.05.2015 - * @author Markus Sattler - * - * Copyright (c) 2015 Markus Sattler. All rights reserved. - * This file is part of the esp8266 core for Arduino environment. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifndef WIFICLIENTMULTI_H_ -#define WIFICLIENTMULTI_H_ - -#include "WiFi.h" -#include - -typedef struct { - char * ssid; - char * passphrase; -} WifiAPlist_t; - -class WiFiMulti -{ -public: - WiFiMulti(); - ~WiFiMulti(); - - bool addAP(const char* ssid, const char *passphrase = NULL); - - uint8_t run(uint32_t connectTimeout=5000); - -private: - std::vector APlist; -}; - -#endif /* WIFICLIENTMULTI_H_ */ diff --git a/libraries/WiFi/src/WiFiSTA.cpp b/libraries/WiFi/src/WiFiSTA.cpp deleted file mode 100644 index db5e019af31..00000000000 --- a/libraries/WiFi/src/WiFiSTA.cpp +++ /dev/null @@ -1,760 +0,0 @@ -/* - WiFiSTA.cpp - WiFi library for esp32 - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Reworked on 28 Dec 2015 by Markus Sattler - - */ - -#include "WiFi.h" -#include "WiFiGeneric.h" -#include "WiFiSTA.h" - -extern "C" { -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "lwip/err.h" -#include "lwip/dns.h" -#include -#include -} - -// ----------------------------------------------------------------------------------------------------------------------- -// ---------------------------------------------------- Private functions ------------------------------------------------ -// ----------------------------------------------------------------------------------------------------------------------- - -static bool sta_config_equal(const wifi_config_t& lhs, const wifi_config_t& rhs); - - -/** - * compare two STA configurations - * @param lhs station_config - * @param rhs station_config - * @return equal - */ -static bool sta_config_equal(const wifi_config_t& lhs, const wifi_config_t& rhs) -{ - if(memcmp(&lhs, &rhs, sizeof(wifi_config_t)) != 0) { - return false; - } - return true; -} - -// ----------------------------------------------------------------------------------------------------------------------- -// ---------------------------------------------------- STA function ----------------------------------------------------- -// ----------------------------------------------------------------------------------------------------------------------- - -bool WiFiSTAClass::_autoReconnect = true; -bool WiFiSTAClass::_useStaticIp = false; - -static wl_status_t _sta_status = WL_NO_SHIELD; -static EventGroupHandle_t _sta_status_group = NULL; - -void WiFiSTAClass::_setStatus(wl_status_t status) -{ - if(!_sta_status_group){ - _sta_status_group = xEventGroupCreate(); - if(!_sta_status_group){ - log_e("STA Status Group Create Failed!"); - _sta_status = status; - return; - } - } - xEventGroupClearBits(_sta_status_group, 0x00FFFFFF); - xEventGroupSetBits(_sta_status_group, status); -} - -/** - * Return Connection status. - * @return one of the value defined in wl_status_t - * - */ -wl_status_t WiFiSTAClass::status() -{ - if(!_sta_status_group){ - return _sta_status; - } - return (wl_status_t)xEventGroupClearBits(_sta_status_group, 0); -} - -/** - * Start Wifi connection - * if passphrase is set the most secure supported mode will be automatically selected - * @param ssid const char* Pointer to the SSID string. - * @param passphrase const char * Optional. Passphrase. Valid characters in a passphrase must be between ASCII 32-126 (decimal). - * @param bssid uint8_t[6] Optional. BSSID / MAC of AP - * @param channel Optional. Channel of AP - * @param connect Optional. call connect - * @return - */ -wl_status_t WiFiSTAClass::begin(const char* ssid, const char *passphrase, int32_t channel, const uint8_t* bssid, bool connect) -{ - - if(!WiFi.enableSTA(true)) { - log_e("STA enable failed!"); - return WL_CONNECT_FAILED; - } - - if(!ssid || *ssid == 0x00 || strlen(ssid) > 31) { - log_e("SSID too long or missing!"); - return WL_CONNECT_FAILED; - } - - if(passphrase && strlen(passphrase) > 64) { - log_e("passphrase too long!"); - return WL_CONNECT_FAILED; - } - - wifi_config_t conf; - memset(&conf, 0, sizeof(wifi_config_t)); - strcpy(reinterpret_cast(conf.sta.ssid), ssid); - - if(passphrase) { - if (strlen(passphrase) == 64){ // it's not a passphrase, is the PSK - memcpy(reinterpret_cast(conf.sta.password), passphrase, 64); - } else { - strcpy(reinterpret_cast(conf.sta.password), passphrase); - } - } - - if(bssid) { - conf.sta.bssid_set = 1; - memcpy((void *) &conf.sta.bssid[0], (void *) bssid, 6); - } - - if(channel > 0 && channel <= 13) { - conf.sta.channel = channel; - } - - wifi_config_t current_conf; - esp_wifi_get_config(WIFI_IF_STA, ¤t_conf); - if(!sta_config_equal(current_conf, conf)) { - if(esp_wifi_disconnect()){ - log_e("disconnect failed!"); - return WL_CONNECT_FAILED; - } - - esp_wifi_set_config(WIFI_IF_STA, &conf); - } else if(status() == WL_CONNECTED){ - return WL_CONNECTED; - } else { - esp_wifi_set_config(WIFI_IF_STA, &conf); - } - - if(!_useStaticIp) { - if(tcpip_adapter_dhcpc_start(TCPIP_ADAPTER_IF_STA) == ESP_ERR_TCPIP_ADAPTER_DHCPC_START_FAILED){ - log_e("dhcp client start failed!"); - return WL_CONNECT_FAILED; - } - } else { - tcpip_adapter_dhcpc_stop(TCPIP_ADAPTER_IF_STA); - } - - if(connect && esp_wifi_connect()) { - log_e("connect failed!"); - return WL_CONNECT_FAILED; - } - - return status(); -} - -wl_status_t WiFiSTAClass::begin(char* ssid, char *passphrase, int32_t channel, const uint8_t* bssid, bool connect) -{ - return begin((const char*) ssid, (const char*) passphrase, channel, bssid, connect); -} - -/** - * Use to connect to SDK config. - * @return wl_status_t - */ -wl_status_t WiFiSTAClass::begin() -{ - - if(!WiFi.enableSTA(true)) { - log_e("STA enable failed!"); - return WL_CONNECT_FAILED; - } - - wifi_config_t current_conf; - if(esp_wifi_get_config(WIFI_IF_STA, ¤t_conf) != ESP_OK || esp_wifi_set_config(WIFI_IF_STA, ¤t_conf) != ESP_OK) { - log_e("config failed"); - return WL_CONNECT_FAILED; - } - - if(!_useStaticIp) { - if(tcpip_adapter_dhcpc_start(TCPIP_ADAPTER_IF_STA) == ESP_ERR_TCPIP_ADAPTER_DHCPC_START_FAILED){ - log_e("dhcp client start failed!"); - return WL_CONNECT_FAILED; - } - } else { - tcpip_adapter_dhcpc_stop(TCPIP_ADAPTER_IF_STA); - } - - if(status() != WL_CONNECTED && esp_wifi_connect()){ - log_e("connect failed!"); - return WL_CONNECT_FAILED; - } - - return status(); -} - -/** - * will force a disconnect an then start reconnecting to AP - * @return ok - */ -bool WiFiSTAClass::reconnect() -{ - if(WiFi.getMode() & WIFI_MODE_STA) { - if(esp_wifi_disconnect() == ESP_OK) { - return esp_wifi_connect() == ESP_OK; - } - } - return false; -} - -/** - * Disconnect from the network - * @param wifioff - * @return one value of wl_status_t enum - */ -bool WiFiSTAClass::disconnect(bool wifioff, bool eraseap) -{ - wifi_config_t conf; - - if(WiFi.getMode() & WIFI_MODE_STA){ - if(eraseap){ - memset(&conf, 0, sizeof(wifi_config_t)); - if(esp_wifi_set_config(WIFI_IF_STA, &conf)){ - log_e("clear config failed!"); - } - } - if(esp_wifi_disconnect()){ - log_e("disconnect failed!"); - return false; - } - if(wifioff) { - return WiFi.enableSTA(false); - } - return true; - } - - return false; -} - -/** - * Change IP configuration settings disabling the dhcp client - * @param local_ip Static ip configuration - * @param gateway Static gateway configuration - * @param subnet Static Subnet mask - * @param dns1 Static DNS server 1 - * @param dns2 Static DNS server 2 - */ -bool WiFiSTAClass::config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1, IPAddress dns2) -{ - esp_err_t err = ESP_OK; - - if(!WiFi.enableSTA(true)) { - return false; - } - - tcpip_adapter_ip_info_t info; - - if(local_ip != (uint32_t)0x00000000){ - info.ip.addr = static_cast(local_ip); - info.gw.addr = static_cast(gateway); - info.netmask.addr = static_cast(subnet); - } else { - info.ip.addr = 0; - info.gw.addr = 0; - info.netmask.addr = 0; - } - - err = tcpip_adapter_dhcpc_stop(TCPIP_ADAPTER_IF_STA); - if(err != ESP_OK && err != ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STOPPED){ - log_e("DHCP could not be stopped! Error: %d", err); - return false; - } - - err = tcpip_adapter_set_ip_info(TCPIP_ADAPTER_IF_STA, &info); - if(err != ERR_OK){ - log_e("STA IP could not be configured! Error: %d", err); - return false; - } - - if(info.ip.addr){ - _useStaticIp = true; - } else { - err = tcpip_adapter_dhcpc_start(TCPIP_ADAPTER_IF_STA); - if(err == ESP_ERR_TCPIP_ADAPTER_DHCPC_START_FAILED){ - log_e("dhcp client start failed!"); - return false; - } - _useStaticIp = false; - } - - ip_addr_t d; - d.type = IPADDR_TYPE_V4; - - if(dns1 != (uint32_t)0x00000000) { - // Set DNS1-Server - d.u_addr.ip4.addr = static_cast(dns1); - dns_setserver(0, &d); - } - - if(dns2 != (uint32_t)0x00000000) { - // Set DNS2-Server - d.u_addr.ip4.addr = static_cast(dns2); - dns_setserver(1, &d); - } - - return true; -} - -/** - * is STA interface connected? - * @return true if STA is connected to an AD - */ -bool WiFiSTAClass::isConnected() -{ - return (status() == WL_CONNECTED); -} - - -/** - * Setting the ESP32 station to connect to the AP (which is recorded) - * automatically or not when powered on. Enable auto-connect by default. - * @param autoConnect bool - * @return if saved - */ -bool WiFiSTAClass::setAutoConnect(bool autoConnect) -{ - /*bool ret; - ret = esp_wifi_set_auto_connect(autoConnect); - return ret;*/ - return false;//now deprecated -} - -/** - * Checks if ESP32 station mode will connect to AP - * automatically or not when it is powered on. - * @return auto connect - */ -bool WiFiSTAClass::getAutoConnect() -{ - /*bool autoConnect; - esp_wifi_get_auto_connect(&autoConnect); - return autoConnect;*/ - return false;//now deprecated -} - -bool WiFiSTAClass::setAutoReconnect(bool autoReconnect) -{ - _autoReconnect = autoReconnect; - return true; -} - -bool WiFiSTAClass::getAutoReconnect() -{ - return _autoReconnect; -} - -/** - * Wait for WiFi connection to reach a result - * returns the status reached or disconnect if STA is off - * @return wl_status_t - */ -uint8_t WiFiSTAClass::waitForConnectResult() -{ - //1 and 3 have STA enabled - if((WiFiGenericClass::getMode() & WIFI_MODE_STA) == 0) { - return WL_DISCONNECTED; - } - int i = 0; - while((!status() || status() >= WL_DISCONNECTED) && i++ < 100) { - delay(100); - } - return status(); -} - -/** - * Get the station interface IP address. - * @return IPAddress station IP - */ -IPAddress WiFiSTAClass::localIP() -{ - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return IPAddress(); - } - tcpip_adapter_ip_info_t ip; - tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_STA, &ip); - return IPAddress(ip.ip.addr); -} - - -/** - * Get the station interface MAC address. - * @param mac pointer to uint8_t array with length WL_MAC_ADDR_LENGTH - * @return pointer to uint8_t * - */ -uint8_t* WiFiSTAClass::macAddress(uint8_t* mac) -{ - if(WiFiGenericClass::getMode() != WIFI_MODE_NULL){ - esp_wifi_get_mac(WIFI_IF_STA, mac); - } - else{ - esp_read_mac(mac, ESP_MAC_WIFI_STA); - } - return mac; -} - -/** - * Get the station interface MAC address. - * @return String mac - */ -String WiFiSTAClass::macAddress(void) -{ - uint8_t mac[6]; - char macStr[18] = { 0 }; - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - esp_read_mac(mac, ESP_MAC_WIFI_STA); - } - else{ - esp_wifi_get_mac(WIFI_IF_STA, mac); - } - sprintf(macStr, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - return String(macStr); -} - -/** - * Get the interface subnet mask address. - * @return IPAddress subnetMask - */ -IPAddress WiFiSTAClass::subnetMask() -{ - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return IPAddress(); - } - tcpip_adapter_ip_info_t ip; - tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_STA, &ip); - return IPAddress(ip.netmask.addr); -} - -/** - * Get the gateway ip address. - * @return IPAddress gatewayIP - */ -IPAddress WiFiSTAClass::gatewayIP() -{ - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return IPAddress(); - } - tcpip_adapter_ip_info_t ip; - tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_STA, &ip); - return IPAddress(ip.gw.addr); -} - -/** - * Get the DNS ip address. - * @param dns_no - * @return IPAddress DNS Server IP - */ -IPAddress WiFiSTAClass::dnsIP(uint8_t dns_no) -{ - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return IPAddress(); - } - ip_addr_t dns_ip = dns_getserver(dns_no); - return IPAddress(dns_ip.u_addr.ip4.addr); -} - -/** - * Get the broadcast ip address. - * @return IPAddress broadcastIP - */ -IPAddress WiFiSTAClass::broadcastIP() -{ - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return IPAddress(); - } - tcpip_adapter_ip_info_t ip; - tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_STA, &ip); - return WiFiGenericClass::calculateBroadcast(IPAddress(ip.gw.addr), IPAddress(ip.netmask.addr)); -} - -/** - * Get the network id. - * @return IPAddress networkID - */ -IPAddress WiFiSTAClass::networkID() -{ - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return IPAddress(); - } - tcpip_adapter_ip_info_t ip; - tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_STA, &ip); - return WiFiGenericClass::calculateNetworkID(IPAddress(ip.gw.addr), IPAddress(ip.netmask.addr)); -} - -/** - * Get the subnet CIDR. - * @return uint8_t subnetCIDR - */ -uint8_t WiFiSTAClass::subnetCIDR() -{ - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return (uint8_t)0; - } - tcpip_adapter_ip_info_t ip; - tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_STA, &ip); - return WiFiGenericClass::calculateSubnetCIDR(IPAddress(ip.netmask.addr)); -} - -/** - * Return the current SSID associated with the network - * @return SSID - */ -String WiFiSTAClass::SSID() const -{ - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return String(); - } - wifi_ap_record_t info; - if(!esp_wifi_sta_get_ap_info(&info)) { - return String(reinterpret_cast(info.ssid)); - } - return String(); -} - -/** - * Return the current pre shared key associated with the network - * @return psk string - */ -String WiFiSTAClass::psk() const -{ - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return String(); - } - wifi_config_t conf; - esp_wifi_get_config(WIFI_IF_STA, &conf); - return String(reinterpret_cast(conf.sta.password)); -} - -/** - * Return the current bssid / mac associated with the network if configured - * @return bssid uint8_t * - */ -uint8_t* WiFiSTAClass::BSSID(void) -{ - static uint8_t bssid[6]; - wifi_ap_record_t info; - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return NULL; - } - if(!esp_wifi_sta_get_ap_info(&info)) { - memcpy(bssid, info.bssid, 6); - return reinterpret_cast(bssid); - } - return NULL; -} - -/** - * Return the current bssid / mac associated with the network if configured - * @return String bssid mac - */ -String WiFiSTAClass::BSSIDstr(void) -{ - uint8_t* bssid = BSSID(); - if(!bssid){ - return String(); - } - char mac[18] = { 0 }; - sprintf(mac, "%02X:%02X:%02X:%02X:%02X:%02X", bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], bssid[5]); - return String(mac); -} - -/** - * Return the current network RSSI. - * @return RSSI value - */ -int8_t WiFiSTAClass::RSSI(void) -{ - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return 0; - } - wifi_ap_record_t info; - if(!esp_wifi_sta_get_ap_info(&info)) { - return info.rssi; - } - return 0; -} - -/** - * Get the station interface Host name. - * @return char array hostname - */ -const char * WiFiSTAClass::getHostname() -{ - const char * hostname = NULL; - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return hostname; - } - if(tcpip_adapter_get_hostname(TCPIP_ADAPTER_IF_STA, &hostname)){ - return NULL; - } - return hostname; -} - -/** - * Set the station interface Host name. - * @param hostname pointer to const string - * @return true on success - */ -bool WiFiSTAClass::setHostname(const char * hostname) -{ - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return false; - } - return tcpip_adapter_set_hostname(TCPIP_ADAPTER_IF_STA, hostname) == 0; -} - -/** - * Enable IPv6 on the station interface. - * @return true on success - */ -bool WiFiSTAClass::enableIpV6() -{ - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return false; - } - return tcpip_adapter_create_ip6_linklocal(TCPIP_ADAPTER_IF_STA) == 0; -} - -/** - * Get the station interface IPv6 address. - * @return IPv6Address - */ -IPv6Address WiFiSTAClass::localIPv6() -{ - static ip6_addr_t addr; - if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){ - return IPv6Address(); - } - if(tcpip_adapter_get_ip6_linklocal(TCPIP_ADAPTER_IF_STA, &addr)){ - return IPv6Address(); - } - return IPv6Address(addr.addr); -} - - -bool WiFiSTAClass::_smartConfigStarted = false; -bool WiFiSTAClass::_smartConfigDone = false; - - -bool WiFiSTAClass::beginSmartConfig() { - if (_smartConfigStarted) { - return false; - } - - if (!WiFi.mode(WIFI_STA)) { - return false; - } - - esp_wifi_disconnect(); - - esp_err_t err; - err = esp_smartconfig_start(reinterpret_cast(&WiFiSTAClass::_smartConfigCallback), 1); - if (err == ESP_OK) { - _smartConfigStarted = true; - _smartConfigDone = false; - return true; - } - return false; -} - -bool WiFiSTAClass::stopSmartConfig() { - if (!_smartConfigStarted) { - return true; - } - - if (esp_smartconfig_stop() == ESP_OK) { - _smartConfigStarted = false; - return true; - } - - return false; -} - -bool WiFiSTAClass::smartConfigDone() { - if (!_smartConfigStarted) { - return false; - } - - return _smartConfigDone; -} - -#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG -const char * sc_status_strings[] = { - "WAIT", - "FIND_CHANNEL", - "GETTING_SSID_PSWD", - "LINK", - "LINK_OVER" -}; - -const char * sc_type_strings[] = { - "ESPTOUCH", - "AIRKISS", - "ESPTOUCH_AIRKISS" -}; -#endif - -void WiFiSTAClass::_smartConfigCallback(uint32_t st, void* result) { - smartconfig_status_t status = (smartconfig_status_t) st; - log_d("Status: %s", sc_status_strings[st % 5]); - if (status == SC_STATUS_GETTING_SSID_PSWD) { -#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG - smartconfig_type_t * type = (smartconfig_type_t *)result; - log_d("Type: %s", sc_type_strings[*type % 3]); -#endif - } else if (status == SC_STATUS_LINK) { - wifi_sta_config_t *sta_conf = reinterpret_cast(result); - log_d("SSID: %s", (char *)(sta_conf->ssid)); - sta_conf->bssid_set = 0; - esp_wifi_set_config(WIFI_IF_STA, (wifi_config_t *)sta_conf); - esp_wifi_connect(); - _smartConfigDone = true; - } else if (status == SC_STATUS_LINK_OVER) { - if(result){ -#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG - ip4_addr_t * ip = (ip4_addr_t *)result; - log_d("Sender IP: " IPSTR, IP2STR(ip)); -#endif - } - WiFi.stopSmartConfig(); - } -} diff --git a/libraries/WiFi/src/WiFiSTA.h b/libraries/WiFi/src/WiFiSTA.h deleted file mode 100644 index d9140101593..00000000000 --- a/libraries/WiFi/src/WiFiSTA.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - ESP8266WiFiSTA.h - esp8266 Wifi support. - Based on WiFi.h from Ardiono WiFi shield library. - Copyright (c) 2011-2014 Arduino. All right reserved. - Modified by Ivan Grokhotkov, December 2014 - Reworked by Markus Sattler, December 2015 - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef ESP32WIFISTA_H_ -#define ESP32WIFISTA_H_ - - -#include "WiFiType.h" -#include "WiFiGeneric.h" - - -class WiFiSTAClass -{ - // ---------------------------------------------------------------------------------------------- - // ---------------------------------------- STA function ---------------------------------------- - // ---------------------------------------------------------------------------------------------- - -public: - - wl_status_t begin(const char* ssid, const char *passphrase = NULL, int32_t channel = 0, const uint8_t* bssid = NULL, bool connect = true); - wl_status_t begin(char* ssid, char *passphrase = NULL, int32_t channel = 0, const uint8_t* bssid = NULL, bool connect = true); - wl_status_t begin(); - - bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = (uint32_t)0x00000000, IPAddress dns2 = (uint32_t)0x00000000); - - bool reconnect(); - bool disconnect(bool wifioff = false, bool eraseap = false); - - bool isConnected(); - - bool setAutoConnect(bool autoConnect); - bool getAutoConnect(); - - bool setAutoReconnect(bool autoReconnect); - bool getAutoReconnect(); - - uint8_t waitForConnectResult(); - - // STA network info - IPAddress localIP(); - - uint8_t * macAddress(uint8_t* mac); - String macAddress(); - - IPAddress subnetMask(); - IPAddress gatewayIP(); - IPAddress dnsIP(uint8_t dns_no = 0); - - IPAddress broadcastIP(); - IPAddress networkID(); - uint8_t subnetCIDR(); - - bool enableIpV6(); - IPv6Address localIPv6(); - - const char * getHostname(); - bool setHostname(const char * hostname); - - // STA WiFi info - static wl_status_t status(); - String SSID() const; - String psk() const; - - uint8_t * BSSID(); - String BSSIDstr(); - - int8_t RSSI(); - - static void _setStatus(wl_status_t status); -protected: - static bool _useStaticIp; - static bool _autoReconnect; - -public: - bool beginSmartConfig(); - bool stopSmartConfig(); - bool smartConfigDone(); - -protected: - static bool _smartConfigStarted; - static bool _smartConfigDone; - static void _smartConfigCallback(uint32_t status, void* result); - -}; - - -#endif /* ESP32WIFISTA_H_ */ diff --git a/libraries/WiFi/src/WiFiScan.cpp b/libraries/WiFi/src/WiFiScan.cpp deleted file mode 100644 index cabedbb8661..00000000000 --- a/libraries/WiFi/src/WiFiScan.cpp +++ /dev/null @@ -1,281 +0,0 @@ -/* - ESP8266WiFiScan.cpp - WiFi library for esp8266 - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Reworked on 28 Dec 2015 by Markus Sattler - - */ - - -#include "WiFi.h" -#include "WiFiGeneric.h" -#include "WiFiScan.h" - -extern "C" { -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "lwip/err.h" -} - -bool WiFiScanClass::_scanAsync = false; -uint32_t WiFiScanClass::_scanStarted = 0; -uint32_t WiFiScanClass::_scanTimeout = 10000; -uint16_t WiFiScanClass::_scanCount = 0; -void* WiFiScanClass::_scanResult = 0; - -/** - * Start scan WiFi networks available - * @param async run in async mode - * @param show_hidden show hidden networks - * @return Number of discovered networks - */ -int16_t WiFiScanClass::scanNetworks(bool async, bool show_hidden, bool passive, uint32_t max_ms_per_chan) -{ - if(WiFiGenericClass::getStatusBits() & WIFI_SCANNING_BIT) { - return WIFI_SCAN_RUNNING; - } - - WiFiScanClass::_scanTimeout = max_ms_per_chan * 20; - WiFiScanClass::_scanAsync = async; - - WiFi.enableSTA(true); - - scanDelete(); - - wifi_scan_config_t config; - config.ssid = 0; - config.bssid = 0; - config.channel = 0; - config.show_hidden = show_hidden; - if(passive){ - config.scan_type = WIFI_SCAN_TYPE_PASSIVE; - config.scan_time.passive = max_ms_per_chan; - } else { - config.scan_type = WIFI_SCAN_TYPE_ACTIVE; - config.scan_time.active.min = 100; - config.scan_time.active.max = max_ms_per_chan; - } - if(esp_wifi_scan_start(&config, false) == ESP_OK) { - _scanStarted = millis(); - if (!_scanStarted) { //Prevent 0 from millis overflow - ++_scanStarted; - } - - WiFiGenericClass::clearStatusBits(WIFI_SCAN_DONE_BIT); - WiFiGenericClass::setStatusBits(WIFI_SCANNING_BIT); - - if(WiFiScanClass::_scanAsync) { - return WIFI_SCAN_RUNNING; - } - if(WiFiGenericClass::waitStatusBits(WIFI_SCAN_DONE_BIT, 10000)){ - return (int16_t) WiFiScanClass::_scanCount; - } - } - return WIFI_SCAN_FAILED; -} - - -/** - * private - * scan callback - * @param result void *arg - * @param status STATUS - */ -void WiFiScanClass::_scanDone() -{ - esp_wifi_scan_get_ap_num(&(WiFiScanClass::_scanCount)); - if(WiFiScanClass::_scanCount) { - WiFiScanClass::_scanResult = new wifi_ap_record_t[WiFiScanClass::_scanCount]; - if(!WiFiScanClass::_scanResult || esp_wifi_scan_get_ap_records(&(WiFiScanClass::_scanCount), (wifi_ap_record_t*)_scanResult) != ESP_OK) { - WiFiScanClass::_scanCount = 0; - } - } - WiFiScanClass::_scanStarted=0; //Reset after a scan is completed for normal behavior - WiFiGenericClass::setStatusBits(WIFI_SCAN_DONE_BIT); - WiFiGenericClass::clearStatusBits(WIFI_SCANNING_BIT); -} - -/** - * - * @param i specify from which network item want to get the information - * @return bss_info * - */ -void * WiFiScanClass::_getScanInfoByIndex(int i) -{ - if(!WiFiScanClass::_scanResult || (size_t) i >= WiFiScanClass::_scanCount) { - return 0; - } - return reinterpret_cast(WiFiScanClass::_scanResult) + i; -} - -/** - * called to get the scan state in Async mode - * @return scan result or status - * -1 if scan not fin - * -2 if scan not triggered - */ -int16_t WiFiScanClass::scanComplete() -{ - if (WiFiScanClass::_scanStarted && (millis()-WiFiScanClass::_scanStarted) > WiFiScanClass::_scanTimeout) { //Check is scan was started and if the delay expired, return WIFI_SCAN_FAILED in this case - WiFiGenericClass::clearStatusBits(WIFI_SCANNING_BIT); - return WIFI_SCAN_FAILED; - } - - if(WiFiGenericClass::getStatusBits() & WIFI_SCAN_DONE_BIT) { - return WiFiScanClass::_scanCount; - } - - if(WiFiGenericClass::getStatusBits() & WIFI_SCANNING_BIT) { - return WIFI_SCAN_RUNNING; - } - - return WIFI_SCAN_FAILED; -} - -/** - * delete last scan result from RAM - */ -void WiFiScanClass::scanDelete() -{ - WiFiGenericClass::clearStatusBits(WIFI_SCAN_DONE_BIT); - if(WiFiScanClass::_scanResult) { - delete[] reinterpret_cast(WiFiScanClass::_scanResult); - WiFiScanClass::_scanResult = 0; - WiFiScanClass::_scanCount = 0; - } -} - - -/** - * loads all infos from a scanned wifi in to the ptr parameters - * @param networkItem uint8_t - * @param ssid const char** - * @param encryptionType uint8_t * - * @param RSSI int32_t * - * @param BSSID uint8_t ** - * @param channel int32_t * - * @return (true if ok) - */ -bool WiFiScanClass::getNetworkInfo(uint8_t i, String &ssid, uint8_t &encType, int32_t &rssi, uint8_t* &bssid, int32_t &channel) -{ - wifi_ap_record_t* it = reinterpret_cast(_getScanInfoByIndex(i)); - if(!it) { - return false; - } - ssid = (const char*) it->ssid; - encType = it->authmode; - rssi = it->rssi; - bssid = it->bssid; - channel = it->primary; - return true; -} - - -/** - * Return the SSID discovered during the network scan. - * @param i specify from which network item want to get the information - * @return ssid string of the specified item on the networks scanned list - */ -String WiFiScanClass::SSID(uint8_t i) -{ - wifi_ap_record_t* it = reinterpret_cast(_getScanInfoByIndex(i)); - if(!it) { - return String(); - } - return String(reinterpret_cast(it->ssid)); -} - - -/** - * Return the encryption type of the networks discovered during the scanNetworks - * @param i specify from which network item want to get the information - * @return encryption type (enum wl_enc_type) of the specified item on the networks scanned list - */ -wifi_auth_mode_t WiFiScanClass::encryptionType(uint8_t i) -{ - wifi_ap_record_t* it = reinterpret_cast(_getScanInfoByIndex(i)); - if(!it) { - return WIFI_AUTH_OPEN; - } - return it->authmode; -} - -/** - * Return the RSSI of the networks discovered during the scanNetworks - * @param i specify from which network item want to get the information - * @return signed value of RSSI of the specified item on the networks scanned list - */ -int32_t WiFiScanClass::RSSI(uint8_t i) -{ - wifi_ap_record_t* it = reinterpret_cast(_getScanInfoByIndex(i)); - if(!it) { - return 0; - } - return it->rssi; -} - - -/** - * return MAC / BSSID of scanned wifi - * @param i specify from which network item want to get the information - * @return uint8_t * MAC / BSSID of scanned wifi - */ -uint8_t * WiFiScanClass::BSSID(uint8_t i) -{ - wifi_ap_record_t* it = reinterpret_cast(_getScanInfoByIndex(i)); - if(!it) { - return 0; - } - return it->bssid; -} - -/** - * return MAC / BSSID of scanned wifi - * @param i specify from which network item want to get the information - * @return String MAC / BSSID of scanned wifi - */ -String WiFiScanClass::BSSIDstr(uint8_t i) -{ - char mac[18] = { 0 }; - wifi_ap_record_t* it = reinterpret_cast(_getScanInfoByIndex(i)); - if(!it) { - return String(); - } - sprintf(mac, "%02X:%02X:%02X:%02X:%02X:%02X", it->bssid[0], it->bssid[1], it->bssid[2], it->bssid[3], it->bssid[4], it->bssid[5]); - return String(mac); -} - -int32_t WiFiScanClass::channel(uint8_t i) -{ - wifi_ap_record_t* it = reinterpret_cast(_getScanInfoByIndex(i)); - if(!it) { - return 0; - } - return it->primary; -} - diff --git a/libraries/WiFi/src/WiFiScan.h b/libraries/WiFi/src/WiFiScan.h deleted file mode 100644 index 3ddcbeac692..00000000000 --- a/libraries/WiFi/src/WiFiScan.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - ESP8266WiFiScan.h - esp8266 Wifi support. - Based on WiFi.h from Ardiono WiFi shield library. - Copyright (c) 2011-2014 Arduino. All right reserved. - Modified by Ivan Grokhotkov, December 2014 - Reworked by Markus Sattler, December 2015 - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef ESP32WIFISCAN_H_ -#define ESP32WIFISCAN_H_ - -#include "WiFiType.h" -#include "WiFiGeneric.h" - -class WiFiScanClass -{ - -public: - - int16_t scanNetworks(bool async = false, bool show_hidden = false, bool passive = false, uint32_t max_ms_per_chan = 300); - - int16_t scanComplete(); - void scanDelete(); - - // scan result - bool getNetworkInfo(uint8_t networkItem, String &ssid, uint8_t &encryptionType, int32_t &RSSI, uint8_t* &BSSID, int32_t &channel); - - String SSID(uint8_t networkItem); - wifi_auth_mode_t encryptionType(uint8_t networkItem); - int32_t RSSI(uint8_t networkItem); - uint8_t * BSSID(uint8_t networkItem); - String BSSIDstr(uint8_t networkItem); - int32_t channel(uint8_t networkItem); - static void * getScanInfoByIndex(int i) { return _getScanInfoByIndex(i); }; - - static void _scanDone(); -protected: - - static bool _scanAsync; - - static uint32_t _scanStarted; - static uint32_t _scanTimeout; - static uint16_t _scanCount; - - static void* _scanResult; - - static void * _getScanInfoByIndex(int i); - -}; - - -#endif /* ESP32WIFISCAN_H_ */ diff --git a/libraries/WiFi/src/WiFiServer.cpp b/libraries/WiFi/src/WiFiServer.cpp deleted file mode 100644 index 75c2872bb78..00000000000 --- a/libraries/WiFi/src/WiFiServer.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* - Server.cpp - Server class for Raspberry Pi - Copyright (c) 2016 Hristo Gochkov All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#include "WiFiServer.h" -#include -#include - -#undef write -#undef close - -int WiFiServer::setTimeout(uint32_t seconds){ - struct timeval tv; - tv.tv_sec = seconds; - tv.tv_usec = 0; - if(setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(struct timeval)) < 0) - return -1; - return setsockopt(sockfd, SOL_SOCKET, SO_SNDTIMEO, (char *)&tv, sizeof(struct timeval)); -} - -size_t WiFiServer::write(const uint8_t *data, size_t len){ - return 0; -} - -void WiFiServer::stopAll(){} - -WiFiClient WiFiServer::available(){ - if(!_listening) - return WiFiClient(); - int client_sock; - if (_accepted_sockfd >= 0) { - client_sock = _accepted_sockfd; - _accepted_sockfd = -1; - } - else { - struct sockaddr_in _client; - int cs = sizeof(struct sockaddr_in); - client_sock = lwip_accept_r(sockfd, (struct sockaddr *)&_client, (socklen_t*)&cs); - } - if(client_sock >= 0){ - int val = 1; - if(setsockopt(client_sock, SOL_SOCKET, SO_KEEPALIVE, (char*)&val, sizeof(int)) == ESP_OK) { - val = _noDelay; - if(setsockopt(client_sock, IPPROTO_TCP, TCP_NODELAY, (char*)&val, sizeof(int)) == ESP_OK) - return WiFiClient(client_sock); - } - } - return WiFiClient(); -} - -void WiFiServer::begin(uint16_t port){ - if(_listening) - return; - if(port){ - _port = port; - } - struct sockaddr_in server; - sockfd = socket(AF_INET , SOCK_STREAM, 0); - if (sockfd < 0) - return; - server.sin_family = AF_INET; - server.sin_addr.s_addr = INADDR_ANY; - server.sin_port = htons(_port); - if(bind(sockfd, (struct sockaddr *)&server, sizeof(server)) < 0) - return; - if(listen(sockfd , _max_clients) < 0) - return; - fcntl(sockfd, F_SETFL, O_NONBLOCK); - _listening = true; - _noDelay = false; - _accepted_sockfd = -1; -} - -void WiFiServer::setNoDelay(bool nodelay) { - _noDelay = nodelay; -} - -bool WiFiServer::getNoDelay() { - return _noDelay; -} - -bool WiFiServer::hasClient() { - if (_accepted_sockfd >= 0) { - return true; - } - struct sockaddr_in _client; - int cs = sizeof(struct sockaddr_in); - _accepted_sockfd = lwip_accept_r(sockfd, (struct sockaddr *)&_client, (socklen_t*)&cs); - if (_accepted_sockfd >= 0) { - return true; - } - return false; -} - -void WiFiServer::end(){ - lwip_close_r(sockfd); - sockfd = -1; - _listening = false; -} - -void WiFiServer::close(){ - end(); -} - -void WiFiServer::stop(){ - end(); -} - diff --git a/libraries/WiFi/src/WiFiServer.h b/libraries/WiFi/src/WiFiServer.h deleted file mode 100644 index 34952cc694b..00000000000 --- a/libraries/WiFi/src/WiFiServer.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - Server.h - Server class for Raspberry Pi - Copyright (c) 2016 Hristo Gochkov All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#ifndef _WIFISERVER_H_ -#define _WIFISERVER_H_ - -#include "Arduino.h" -#include "Server.h" -#include "WiFiClient.h" - -class WiFiServer : public Server { - private: - int sockfd; - int _accepted_sockfd = -1; - uint16_t _port; - uint8_t _max_clients; - bool _listening; - bool _noDelay = false; - - public: - void listenOnLocalhost(){} - - WiFiServer(uint16_t port=80, uint8_t max_clients=4):sockfd(-1),_accepted_sockfd(-1),_port(port),_max_clients(max_clients),_listening(false),_noDelay(false){} - ~WiFiServer(){ end();} - WiFiClient available(); - WiFiClient accept(){return available();} - void begin(uint16_t port=0); - void setNoDelay(bool nodelay); - bool getNoDelay(); - bool hasClient(); - size_t write(const uint8_t *data, size_t len); - size_t write(uint8_t data){ - return write(&data, 1); - } - using Print::write; - - void end(); - void close(); - void stop(); - operator bool(){return _listening;} - int setTimeout(uint32_t seconds); - void stopAll(); -}; - -#endif /* _WIFISERVER_H_ */ diff --git a/libraries/WiFi/src/WiFiType.h b/libraries/WiFi/src/WiFiType.h deleted file mode 100644 index cce29eea4a2..00000000000 --- a/libraries/WiFi/src/WiFiType.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - ESP8266WiFiType.h - esp8266 Wifi support. - Copyright (c) 2011-2014 Arduino. All right reserved. - Modified by Ivan Grokhotkov, December 2014 - Reworked by Markus Sattler, December 2015 - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - - -#ifndef ESP32WIFITYPE_H_ -#define ESP32WIFITYPE_H_ - -#define WIFI_SCAN_RUNNING (-1) -#define WIFI_SCAN_FAILED (-2) - -#define WiFiMode_t wifi_mode_t -#define WIFI_OFF WIFI_MODE_NULL -#define WIFI_STA WIFI_MODE_STA -#define WIFI_AP WIFI_MODE_AP -#define WIFI_AP_STA WIFI_MODE_APSTA - -#define WiFiEvent_t system_event_id_t -#define WiFiEventInfo_t system_event_info_t -#define WiFiEventId_t wifi_event_id_t - - -typedef enum { - WL_NO_SHIELD = 255, // for compatibility with WiFi Shield library - WL_IDLE_STATUS = 0, - WL_NO_SSID_AVAIL = 1, - WL_SCAN_COMPLETED = 2, - WL_CONNECTED = 3, - WL_CONNECT_FAILED = 4, - WL_CONNECTION_LOST = 5, - WL_DISCONNECTED = 6 -} wl_status_t; - -#endif /* ESP32WIFITYPE_H_ */ diff --git a/libraries/WiFi/src/WiFiUdp.cpp b/libraries/WiFi/src/WiFiUdp.cpp deleted file mode 100644 index 476b5a4a8b5..00000000000 --- a/libraries/WiFi/src/WiFiUdp.cpp +++ /dev/null @@ -1,281 +0,0 @@ -/* - Udp.cpp - UDP class for Raspberry Pi - Copyright (c) 2016 Hristo Gochkov All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#include "WiFiUdp.h" -#include -#include -#include - -#undef write -#undef read - -WiFiUDP::WiFiUDP() -: udp_server(-1) -, server_port(0) -, remote_port(0) -, tx_buffer(0) -, tx_buffer_len(0) -, rx_buffer(0) -{} - -WiFiUDP::~WiFiUDP(){ - stop(); -} - -uint8_t WiFiUDP::begin(IPAddress address, uint16_t port){ - stop(); - - server_port = port; - - tx_buffer = new char[1460]; - if(!tx_buffer){ - log_e("could not create tx buffer: %d", errno); - return 0; - } - - if ((udp_server=socket(AF_INET, SOCK_DGRAM, 0)) == -1){ - log_e("could not create socket: %d", errno); - return 0; - } - - int yes = 1; - if (setsockopt(udp_server,SOL_SOCKET,SO_REUSEADDR,&yes,sizeof(yes)) < 0) { - log_e("could not set socket option: %d", errno); - stop(); - return 0; - } - - struct sockaddr_in addr; - memset((char *) &addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(server_port); - addr.sin_addr.s_addr = (in_addr_t)address; - if(bind(udp_server , (struct sockaddr*)&addr, sizeof(addr)) == -1){ - log_e("could not bind socket: %d", errno); - stop(); - return 0; - } - fcntl(udp_server, F_SETFL, O_NONBLOCK); - return 1; -} - -uint8_t WiFiUDP::begin(uint16_t p){ - return begin(IPAddress(INADDR_ANY), p); -} - -uint8_t WiFiUDP::beginMulticast(IPAddress a, uint16_t p){ - if(begin(IPAddress(INADDR_ANY), p)){ - if(a != 0){ - struct ip_mreq mreq; - mreq.imr_multiaddr.s_addr = (in_addr_t)a; - mreq.imr_interface.s_addr = INADDR_ANY; - if (setsockopt(udp_server, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0) { - log_e("could not join igmp: %d", errno); - stop(); - return 0; - } - multicast_ip = a; - } - return 1; - } - return 0; -} - -void WiFiUDP::stop(){ - if(tx_buffer){ - delete[] tx_buffer; - tx_buffer = NULL; - } - tx_buffer_len = 0; - if(rx_buffer){ - cbuf *b = rx_buffer; - rx_buffer = NULL; - delete b; - } - if(udp_server == -1) - return; - if(multicast_ip != 0){ - struct ip_mreq mreq; - mreq.imr_multiaddr.s_addr = (in_addr_t)multicast_ip; - mreq.imr_interface.s_addr = (in_addr_t)0; - setsockopt(udp_server, IPPROTO_IP, IP_DROP_MEMBERSHIP, &mreq, sizeof(mreq)); - multicast_ip = IPAddress(INADDR_ANY); - } - close(udp_server); - udp_server = -1; -} - -int WiFiUDP::beginMulticastPacket(){ - if(!server_port || multicast_ip == IPAddress(INADDR_ANY)) - return 0; - remote_ip = multicast_ip; - remote_port = server_port; - return beginPacket(); -} - -int WiFiUDP::beginPacket(){ - if(!remote_port) - return 0; - - // allocate tx_buffer if is necessary - if(!tx_buffer){ - tx_buffer = new char[1460]; - if(!tx_buffer){ - log_e("could not create tx buffer: %d", errno); - return 0; - } - } - - tx_buffer_len = 0; - - // check whereas socket is already open - if (udp_server != -1) - return 1; - - if ((udp_server=socket(AF_INET, SOCK_DGRAM, 0)) == -1){ - log_e("could not create socket: %d", errno); - return 0; - } - - fcntl(udp_server, F_SETFL, O_NONBLOCK); - - return 1; -} - -int WiFiUDP::beginPacket(IPAddress ip, uint16_t port){ - remote_ip = ip; - remote_port = port; - return beginPacket(); -} - -int WiFiUDP::beginPacket(const char *host, uint16_t port){ - struct hostent *server; - server = gethostbyname(host); - if (server == NULL){ - log_e("could not get host from dns: %d", errno); - return 0; - } - return beginPacket(IPAddress((const uint8_t *)(server->h_addr_list[0])), port); -} - -int WiFiUDP::endPacket(){ - struct sockaddr_in recipient; - recipient.sin_addr.s_addr = (uint32_t)remote_ip; - recipient.sin_family = AF_INET; - recipient.sin_port = htons(remote_port); - int sent = sendto(udp_server, tx_buffer, tx_buffer_len, 0, (struct sockaddr*) &recipient, sizeof(recipient)); - if(sent < 0){ - log_e("could not send data: %d", errno); - return 0; - } - return 1; -} - -size_t WiFiUDP::write(uint8_t data){ - if(tx_buffer_len == 1460){ - endPacket(); - tx_buffer_len = 0; - } - tx_buffer[tx_buffer_len++] = data; - return 1; -} - -size_t WiFiUDP::write(const uint8_t *buffer, size_t size){ - size_t i; - for(i=0;i 0) { - rx_buffer = new cbuf(len); - rx_buffer->write(buf, len); - } - delete[] buf; - return len; -} - -int WiFiUDP::available(){ - if(!rx_buffer) return 0; - return rx_buffer->available(); -} - -int WiFiUDP::read(){ - if(!rx_buffer) return -1; - int out = rx_buffer->read(); - if(!rx_buffer->available()){ - cbuf *b = rx_buffer; - rx_buffer = 0; - delete b; - } - return out; -} - -int WiFiUDP::read(unsigned char* buffer, size_t len){ - return read((char *)buffer, len); -} - -int WiFiUDP::read(char* buffer, size_t len){ - if(!rx_buffer) return 0; - int out = rx_buffer->read(buffer, len); - if(!rx_buffer->available()){ - cbuf *b = rx_buffer; - rx_buffer = 0; - delete b; - } - return out; -} - -int WiFiUDP::peek(){ - if(!rx_buffer) return -1; - return rx_buffer->peek(); -} - -void WiFiUDP::flush(){ - if(!rx_buffer) return; - cbuf *b = rx_buffer; - rx_buffer = 0; - delete b; -} - -IPAddress WiFiUDP::remoteIP(){ - return remote_ip; -} - -uint16_t WiFiUDP::remotePort(){ - return remote_port; -} diff --git a/libraries/WiFi/src/WiFiUdp.h b/libraries/WiFi/src/WiFiUdp.h deleted file mode 100644 index b543d5f9646..00000000000 --- a/libraries/WiFi/src/WiFiUdp.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Udp.cpp: Library to send/receive UDP packets. - * - * NOTE: UDP is fast, but has some important limitations (thanks to Warren Gray for mentioning these) - * 1) UDP does not guarantee the order in which assembled UDP packets are received. This - * might not happen often in practice, but in larger network topologies, a UDP - * packet can be received out of sequence. - * 2) UDP does not guard against lost packets - so packets *can* disappear without the sender being - * aware of it. Again, this may not be a concern in practice on small local networks. - * For more information, see http://www.cafeaulait.org/course/week12/35.html - * - * MIT License: - * Copyright (c) 2008 Bjoern Hartmann - * 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. - * - * bjoern@cs.stanford.edu 12/30/2008 - */ - -#ifndef _WIFIUDP_H_ -#define _WIFIUDP_H_ - -#include -#include -#include - -class WiFiUDP : public UDP { -private: - int udp_server; - IPAddress multicast_ip; - IPAddress remote_ip; - uint16_t server_port; - uint16_t remote_port; - char * tx_buffer; - size_t tx_buffer_len; - cbuf * rx_buffer; -public: - WiFiUDP(); - ~WiFiUDP(); - uint8_t begin(IPAddress a, uint16_t p); - uint8_t begin(uint16_t p); - uint8_t beginMulticast(IPAddress a, uint16_t p); - void stop(); - int beginMulticastPacket(); - int beginPacket(); - int beginPacket(IPAddress ip, uint16_t port); - int beginPacket(const char *host, uint16_t port); - int endPacket(); - size_t write(uint8_t); - size_t write(const uint8_t *buffer, size_t size); - int parsePacket(); - int available(); - int read(); - int read(unsigned char* buffer, size_t len); - int read(char* buffer, size_t len); - int peek(); - void flush(); - IPAddress remoteIP(); - uint16_t remotePort(); -}; - -#endif /* _WIFIUDP_H_ */ diff --git a/libraries/WiFiClientSecure/README.md b/libraries/WiFiClientSecure/README.md deleted file mode 100644 index 10ac26ccaa5..00000000000 --- a/libraries/WiFiClientSecure/README.md +++ /dev/null @@ -1,67 +0,0 @@ -WiFiClientSecure -================ - -The WiFiClientSecure class implements support for secure connections using TLS (SSL). -It inherits from WiFiClient and thus implements a superset of that class' interface. -There are three ways to establish a secure connection using the WiFiClientSecure class: -using a root certificate authority (CA) cert, using a root CA cert plus a client cert and key, -and using a pre-shared key (PSK). - -Using a root certificate authority cert ---------------------------------------- -This method authenticates the server and negotiates an encrypted connection. -It is the same functionality as implemented in your web browser when you connect to HTTPS sites. - -If you are accessing your own server: -- Generate a root certificate for your own certificate authority -- Generate a cert & private key using your root certificate ("self-signed cert") for your server -If you are accessing a public server: -- Obtain the cert of the public CA that signed that server's cert -Then: -- In WiFiClientSecure use setCACert (or the appropriate connect method) to set the root cert of your - CA or of the public CA -- When WiFiClientSecure connects to the target server it uses the CA cert to verify the certificate - presented by the server, and then negotiates encryption for the connection - -Please see the WiFiClientSecure example. - -Using a root CA cert and client cert/keys ------------------------------------------ -This method authenticates the server and additionally also authenticates -the client to the server, then negotiates an encrypted connection. - -- Follow steps above -- Using your root CA generate cert/key for your client -- Register the keys with the server you will be accessing so the server can authenticate your client -- In WiFiClientSecure use setCACert (or the appropriate connect method) to set the root cert of your - CA or of the public CA, this is used to authenticate the server -- In WiFiClientSecure use setCertificate, and setPrivateKey (or the appropriate connect method) to - set your client's cert & key, this will be used to authenticate your client to the server -- When WiFiClientSecure connects to the target server it uses the CA cert to verify the certificate - presented by the server, it will use the cert/key to authenticate your client to the server, and - it will then negotiate encryption for the connection - -Using Pre-Shared Keys (PSK) ---------------------------- - -TLS supports authentication and encryption using a pre-shared key (i.e. a key that both client and -server know) as an alternative to the public key cryptography commonly used on the web for HTTPS. -PSK is starting to be used for MQTT, e.g. in mosquitto, to simplify the set-up and avoid having to -go through the whole CA, cert, and private key process. - -A pre-shared key is a binary string of up to 32 bytes and is commonly represented in hex form. In -addition to the key, clients can also present an id and typically the server allows a different key -to be associated with each client id. In effect this is very similar to username and password pairs, -except that unlike a password the key is not directly transmitted to the server, thus a connection to a -malicious server does not divulge the password. Plus the server is also authenticated to the client. - -To use PSK: -- Generate a random hex string (generating an MD5 or SHA for some file is one way to do this) -- Come up with a string id for your client and configure your server to accept the id/key pair -- In WiFiClientSecure use setPreSharedKey (or the appropriate connect method) to - set the id/key combo -- When WiFiClientSecure connects to the target server it uses the id/key combo to authenticate the - server (it must prove that it has the key too), authenticate the client and then negotiate - encryption for the connection - -Please see the WiFiClientPSK example. diff --git a/libraries/WiFiClientSecure/examples/WiFiClientPSK/WiFiClientPSK.ino b/libraries/WiFiClientSecure/examples/WiFiClientPSK/WiFiClientPSK.ino deleted file mode 100644 index bd3ffbeda05..00000000000 --- a/libraries/WiFiClientSecure/examples/WiFiClientPSK/WiFiClientPSK.ino +++ /dev/null @@ -1,85 +0,0 @@ -/* - Wifi secure connection example for ESP32 using a pre-shared key (PSK) - This is useful with MQTT servers instead of using a self-signed cert, tested with mosquitto. - Running on TLS 1.2 using mbedTLS - - To test run a test server using: openssl s_server -accept 8443 -psk 1a2b3c4d -nocert - It will show the http request made, but there's no easy way to send a reply back... - - 2017 - Evandro Copercini - Apache 2.0 License. - 2018 - Adapted for PSK by Thorsten von Eicken -*/ - -#include - -#if 0 -const char* ssid = "your-ssid"; // your network SSID (name of wifi network) -const char* password = "your-password"; // your network password -#else -const char* ssid = "test"; // your network SSID (name of wifi network) -const char* password = "securetest"; // your network password -#endif - -//const char* server = "server.local"; // Server hostname -const IPAddress server = IPAddress(192, 168, 0, 14); // Server IP address -const int port = 8443; // server's port (8883 for MQTT) - -const char* pskIdent = "Client_identity"; // PSK identity (sometimes called key hint) -const char* psKey = "1a2b3c4d"; // PSK Key (must be hex string without 0x) - -WiFiClientSecure client; - -void setup() { - //Initialize serial and wait for port to open: - Serial.begin(115200); - delay(100); - - Serial.print("Attempting to connect to SSID: "); - Serial.println(ssid); - WiFi.begin(ssid, password); - - // attempt to connect to Wifi network: - while (WiFi.status() != WL_CONNECTED) { - Serial.print("."); - // wait 1 second for re-trying - delay(1000); - } - - Serial.print("Connected to "); - Serial.println(ssid); - - client.setPreSharedKey(pskIdent, psKey); - - Serial.println("\nStarting connection to server..."); - if (!client.connect(server, port)) - Serial.println("Connection failed!"); - else { - Serial.println("Connected to server!"); - // Make a HTTP request: - client.println("GET /a/check HTTP/1.0"); - client.print("Host: "); - client.println(server); - client.println("Connection: close"); - client.println(); - - while (client.connected()) { - String line = client.readStringUntil('\n'); - if (line == "\r") { - Serial.println("headers received"); - break; - } - } - // if there are incoming bytes available - // from the server, read them and print them: - while (client.available()) { - char c = client.read(); - Serial.write(c); - } - - client.stop(); - } -} - -void loop() { - // do nothing -} diff --git a/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino b/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino deleted file mode 100644 index a49ec21e19f..00000000000 --- a/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino +++ /dev/null @@ -1,110 +0,0 @@ -/* - Wifi secure connection example for ESP32 - Running on TLS 1.2 using mbedTLS - Suporting the following chipersuites: - "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384","TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384","TLS_DHE_RSA_WITH_AES_256_GCM_SHA384","TLS_ECDHE_ECDSA_WITH_AES_256_CCM","TLS_DHE_RSA_WITH_AES_256_CCM","TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384","TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384","TLS_DHE_RSA_WITH_AES_256_CBC_SHA256","TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA","TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA","TLS_DHE_RSA_WITH_AES_256_CBC_SHA","TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8","TLS_DHE_RSA_WITH_AES_256_CCM_8","TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384","TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384","TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384","TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384","TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384","TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256","TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA","TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256","TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256","TLS_DHE_RSA_WITH_AES_128_GCM_SHA256","TLS_ECDHE_ECDSA_WITH_AES_128_CCM","TLS_DHE_RSA_WITH_AES_128_CCM","TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256","TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256","TLS_DHE_RSA_WITH_AES_128_CBC_SHA256","TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA","TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA","TLS_DHE_RSA_WITH_AES_128_CBC_SHA","TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8","TLS_DHE_RSA_WITH_AES_128_CCM_8","TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256","TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256","TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256","TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256","TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256","TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256","TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA","TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA","TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA","TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA","TLS_DHE_PSK_WITH_AES_256_GCM_SHA384","TLS_DHE_PSK_WITH_AES_256_CCM","TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384","TLS_DHE_PSK_WITH_AES_256_CBC_SHA384","TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA","TLS_DHE_PSK_WITH_AES_256_CBC_SHA","TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384","TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384","TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384","TLS_PSK_DHE_WITH_AES_256_CCM_8","TLS_DHE_PSK_WITH_AES_128_GCM_SHA256","TLS_DHE_PSK_WITH_AES_128_CCM","TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256","TLS_DHE_PSK_WITH_AES_128_CBC_SHA256","TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA","TLS_DHE_PSK_WITH_AES_128_CBC_SHA","TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256","TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256","TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256","TLS_PSK_DHE_WITH_AES_128_CCM_8","TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA","TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA","TLS_RSA_WITH_AES_256_GCM_SHA384","TLS_RSA_WITH_AES_256_CCM","TLS_RSA_WITH_AES_256_CBC_SHA256","TLS_RSA_WITH_AES_256_CBC_SHA","TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384","TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384","TLS_ECDH_RSA_WITH_AES_256_CBC_SHA","TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384","TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384","TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA","TLS_RSA_WITH_AES_256_CCM_8","TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384","TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256","TLS_RSA_WITH_CAMELLIA_256_CBC_SHA","TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384","TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384","TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384","TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384","TLS_RSA_WITH_AES_128_GCM_SHA256","TLS_RSA_WITH_AES_128_CCM","TLS_RSA_WITH_AES_128_CBC_SHA256","TLS_RSA_WITH_AES_128_CBC_SHA","TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256","TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256","TLS_ECDH_RSA_WITH_AES_128_CBC_SHA","TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256","TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256","TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA","TLS_RSA_WITH_AES_128_CCM_8","TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256","TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256","TLS_RSA_WITH_CAMELLIA_128_CBC_SHA","TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256","TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256","TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256","TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256","TLS_RSA_WITH_3DES_EDE_CBC_SHA","TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA","TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA","TLS_RSA_PSK_WITH_AES_256_GCM_SHA384","TLS_RSA_PSK_WITH_AES_256_CBC_SHA384","TLS_RSA_PSK_WITH_AES_256_CBC_SHA","TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384","TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384","TLS_RSA_PSK_WITH_AES_128_GCM_SHA256","TLS_RSA_PSK_WITH_AES_128_CBC_SHA256","TLS_RSA_PSK_WITH_AES_128_CBC_SHA","TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256","TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256","TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA","TLS_PSK_WITH_AES_256_GCM_SHA384","TLS_PSK_WITH_AES_256_CCM","TLS_PSK_WITH_AES_256_CBC_SHA384","TLS_PSK_WITH_AES_256_CBC_SHA","TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384","TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384","TLS_PSK_WITH_AES_256_CCM_8","TLS_PSK_WITH_AES_128_GCM_SHA256","TLS_PSK_WITH_AES_128_CCM","TLS_PSK_WITH_AES_128_CBC_SHA256","TLS_PSK_WITH_AES_128_CBC_SHA","TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256","TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256","TLS_PSK_WITH_AES_128_CCM_8","TLS_PSK_WITH_3DES_EDE_CBC_SHA","TLS_EMPTY_RENEGOTIATION_INFO_SCSV"] - 2017 - Evandro Copercini - Apache 2.0 License. -*/ - -#include - -const char* ssid = "your-ssid"; // your network SSID (name of wifi network) -const char* password = "your-password"; // your network password - -const char* server = "www.howsmyssl.com"; // Server URL - -// www.howsmyssl.com root certificate authority, to verify the server -// change it to your server root CA -// SHA1 fingerprint is broken now! - -const char* test_root_ca= \ - "-----BEGIN CERTIFICATE-----\n" \ - "MIIEkjCCA3qgAwIBAgIQCgFBQgAAAVOFc2oLheynCDANBgkqhkiG9w0BAQsFADA/\n" \ - "MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT\n" \ - "DkRTVCBSb290IENBIFgzMB4XDTE2MDMxNzE2NDA0NloXDTIxMDMxNzE2NDA0Nlow\n" \ - "SjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUxldCdzIEVuY3J5cHQxIzAhBgNVBAMT\n" \ - "GkxldCdzIEVuY3J5cHQgQXV0aG9yaXR5IFgzMIIBIjANBgkqhkiG9w0BAQEFAAOC\n" \ - "AQ8AMIIBCgKCAQEAnNMM8FrlLke3cl03g7NoYzDq1zUmGSXhvb418XCSL7e4S0EF\n" \ - "q6meNQhY7LEqxGiHC6PjdeTm86dicbp5gWAf15Gan/PQeGdxyGkOlZHP/uaZ6WA8\n" \ - "SMx+yk13EiSdRxta67nsHjcAHJyse6cF6s5K671B5TaYucv9bTyWaN8jKkKQDIZ0\n" \ - "Z8h/pZq4UmEUEz9l6YKHy9v6Dlb2honzhT+Xhq+w3Brvaw2VFn3EK6BlspkENnWA\n" \ - "a6xK8xuQSXgvopZPKiAlKQTGdMDQMc2PMTiVFrqoM7hD8bEfwzB/onkxEz0tNvjj\n" \ - "/PIzark5McWvxI0NHWQWM6r6hCm21AvA2H3DkwIDAQABo4IBfTCCAXkwEgYDVR0T\n" \ - "AQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAYYwfwYIKwYBBQUHAQEEczBxMDIG\n" \ - "CCsGAQUFBzABhiZodHRwOi8vaXNyZy50cnVzdGlkLm9jc3AuaWRlbnRydXN0LmNv\n" \ - "bTA7BggrBgEFBQcwAoYvaHR0cDovL2FwcHMuaWRlbnRydXN0LmNvbS9yb290cy9k\n" \ - "c3Ryb290Y2F4My5wN2MwHwYDVR0jBBgwFoAUxKexpHsscfrb4UuQdf/EFWCFiRAw\n" \ - "VAYDVR0gBE0wSzAIBgZngQwBAgEwPwYLKwYBBAGC3xMBAQEwMDAuBggrBgEFBQcC\n" \ - "ARYiaHR0cDovL2Nwcy5yb290LXgxLmxldHNlbmNyeXB0Lm9yZzA8BgNVHR8ENTAz\n" \ - "MDGgL6AthitodHRwOi8vY3JsLmlkZW50cnVzdC5jb20vRFNUUk9PVENBWDNDUkwu\n" \ - "Y3JsMB0GA1UdDgQWBBSoSmpjBH3duubRObemRWXv86jsoTANBgkqhkiG9w0BAQsF\n" \ - "AAOCAQEA3TPXEfNjWDjdGBX7CVW+dla5cEilaUcne8IkCJLxWh9KEik3JHRRHGJo\n" \ - "uM2VcGfl96S8TihRzZvoroed6ti6WqEBmtzw3Wodatg+VyOeph4EYpr/1wXKtx8/\n" \ - "wApIvJSwtmVi4MFU5aMqrSDE6ea73Mj2tcMyo5jMd6jmeWUHK8so/joWUoHOUgwu\n" \ - "X4Po1QYz+3dszkDqMp4fklxBwXRsW10KXzPMTZ+sOPAveyxindmjkW8lGy+QsRlG\n" \ - "PfZ+G6Z6h7mjem0Y+iWlkYcV4PIWL1iwBi8saCbGS5jN2p8M+X+Q7UNKEkROb3N6\n" \ - "KOqkqm57TH2H3eDJAkSnh6/DNFu0Qg==\n" \ - "-----END CERTIFICATE-----\n"; - -// You can use x.509 client certificates if you want -//const char* test_client_key = ""; //to verify the client -//const char* test_client_cert = ""; //to verify the client - - -WiFiClientSecure client; - -void setup() { - //Initialize serial and wait for port to open: - Serial.begin(115200); - delay(100); - - Serial.print("Attempting to connect to SSID: "); - Serial.println(ssid); - WiFi.begin(ssid, password); - - // attempt to connect to Wifi network: - while (WiFi.status() != WL_CONNECTED) { - Serial.print("."); - // wait 1 second for re-trying - delay(1000); - } - - Serial.print("Connected to "); - Serial.println(ssid); - - client.setCACert(test_root_ca); - //client.setCertificate(test_client_key); // for client verification - //client.setPrivateKey(test_client_cert); // for client verification - - Serial.println("\nStarting connection to server..."); - if (!client.connect(server, 443)) - Serial.println("Connection failed!"); - else { - Serial.println("Connected to server!"); - // Make a HTTP request: - client.println("GET https://www.howsmyssl.com/a/check HTTP/1.0"); - client.println("Host: www.howsmyssl.com"); - client.println("Connection: close"); - client.println(); - - while (client.connected()) { - String line = client.readStringUntil('\n'); - if (line == "\r") { - Serial.println("headers received"); - break; - } - } - // if there are incoming bytes available - // from the server, read them and print them: - while (client.available()) { - char c = client.read(); - Serial.write(c); - } - - client.stop(); - } -} - -void loop() { - // do nothing -} diff --git a/libraries/WiFiClientSecure/examples/WiFiClientSecureEnterprise/WiFiClientSecureEnterprise.ino b/libraries/WiFiClientSecure/examples/WiFiClientSecureEnterprise/WiFiClientSecureEnterprise.ino deleted file mode 100644 index 3451602c177..00000000000 --- a/libraries/WiFiClientSecure/examples/WiFiClientSecureEnterprise/WiFiClientSecureEnterprise.ino +++ /dev/null @@ -1,106 +0,0 @@ -/*|----------------------------------------------------------|*/ -/*|WORKING EXAMPLE FOR HTTPS CONNECTION |*/ -/*|TESTED BOARDS: Devkit v1 DOIT, Devkitc v4 |*/ -/*|CORE: June 2018 |*/ -/*|----------------------------------------------------------|*/ -#include -#include -#include "esp_wpa2.h" -#include -#define EAP_IDENTITY "identity" //if connecting from another corporation, use identity@organisation.domain in Eduroam -#define EAP_PASSWORD "password" //your Eduroam password -const char* ssid = "eduroam"; // Eduroam SSID -const char* host = "arduino.php5.sk"; //external server domain for HTTP connection after authentification -int counter = 0; -const char* test_root_ca= \ -"-----BEGIN CERTIFICATE-----\n" \ -"MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh\n" \ -"MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\n" \ -"d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD\n" \ -"QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT\n" \ -"MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j\n" \ -"b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG\n" \ -"9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB\n" \ -"CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97\n" \ -"nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt\n" \ -"43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P\n" \ -"T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4\n" \ -"gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO\n" \ -"BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR\n" \ -"TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw\n" \ -"DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr\n" \ -"hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg\n" \ -"06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF\n" \ -"PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls\n" \ -"YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk\n" \ -"CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=\n" \ -"-----END CERTIFICATE-----\n"; -// You can use x.509 client certificates if you want -//const char* test_client_key = ""; //to verify the client -//const char* test_client_cert = ""; //to verify the client -WiFiClientSecure client; -void setup() { - Serial.begin(115200); - delay(10); - Serial.println(); - Serial.print("Connecting to network: "); - Serial.println(ssid); - WiFi.disconnect(true); //disconnect form wifi to set new wifi connection - WiFi.mode(WIFI_STA); //init wifi mode - esp_wifi_sta_wpa2_ent_set_identity((uint8_t *)EAP_IDENTITY, strlen(EAP_IDENTITY)); //provide identity - esp_wifi_sta_wpa2_ent_set_username((uint8_t *)EAP_IDENTITY, strlen(EAP_IDENTITY)); //provide username --> identity and username is same - esp_wifi_sta_wpa2_ent_set_password((uint8_t *)EAP_PASSWORD, strlen(EAP_PASSWORD)); //provide password - esp_wpa2_config_t config = WPA2_CONFIG_INIT_DEFAULT(); //set config settings to default - esp_wifi_sta_wpa2_ent_enable(&config); //set config settings to enable function - WiFi.begin(ssid); //connect to wifi - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - counter++; - if(counter>=60){ //after 30 seconds timeout - reset board - ESP.restart(); - } - } - client.setCACert(test_root_ca); - //client.setCertificate(test_client_key); // for client verification - //client.setPrivateKey(test_client_cert); // for client verification - Serial.println(""); - Serial.println("WiFi connected"); - Serial.println("IP address set: "); - Serial.println(WiFi.localIP()); //print LAN IP -} -void loop() { - if (WiFi.status() == WL_CONNECTED) { //if we are connected to Eduroam network - counter = 0; //reset counter - Serial.println("Wifi is still connected with IP: "); - Serial.println(WiFi.localIP()); //inform user about his IP address - }else if (WiFi.status() != WL_CONNECTED) { //if we lost connection, retry - WiFi.begin(ssid); - } - while (WiFi.status() != WL_CONNECTED) { //during lost connection, print dots - delay(500); - Serial.print("."); - counter++; - if(counter>=60){ //30 seconds timeout - reset board - ESP.restart(); - } - } - Serial.print("Connecting to website: "); - Serial.println(host); - if (client.connect(host, 443)) { - String url = "/rele/rele1.txt"; - client.print(String("GET ") + url + " HTTP/1.1\r\n" + "Host: " + host + "\r\n" + "User-Agent: ESP32\r\n" + "Connection: close\r\n\r\n"); - while (client.connected()) { - String header = client.readStringUntil('\n'); - Serial.println(header); - if (header == "\r") { - break; - } - } - String line = client.readStringUntil('\n'); - Serial.println(line); - }else{ - Serial.println("Connection unsucessful"); - } - delay(5000); -} diff --git a/libraries/WiFiClientSecure/keywords.txt b/libraries/WiFiClientSecure/keywords.txt deleted file mode 100644 index b1bf2c7388a..00000000000 --- a/libraries/WiFiClientSecure/keywords.txt +++ /dev/null @@ -1,35 +0,0 @@ -####################################### -# Syntax Coloring Map For WiFi -####################################### - -####################################### -# Library (KEYWORD3) -####################################### - -WiFiClientSecure KEYWORD3 - -####################################### -# Datatypes (KEYWORD1) -####################################### - -WiFiClientSecure KEYWORD1 - -####################################### -# Methods and Functions (KEYWORD2) -####################################### - -connect KEYWORD2 -write KEYWORD2 -available KEYWORD2 -config KEYWORD2 -read KEYWORD2 -flush KEYWORD2 -stop KEYWORD2 -connected KEYWORD2 -setCACert KEYWORD2 -setCertificate KEYWORD2 -setPrivateKey KEYWORD2 - -####################################### -# Constants (LITERAL1) -####################################### diff --git a/libraries/WiFiClientSecure/library.properties b/libraries/WiFiClientSecure/library.properties deleted file mode 100644 index 7e932754b69..00000000000 --- a/libraries/WiFiClientSecure/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=WiFiClientSecure -version=1.0 -author=Evandro Luis Copercini -maintainer=Github Community -sentence=Enables secure network connection (local and Internet) using the ESP32 built-in WiFi. -paragraph=With this library you can make a TLS or SSL connection to a remote server. -category=Communication -url= -architectures=esp32 diff --git a/libraries/WiFiClientSecure/src/WiFiClientSecure.cpp b/libraries/WiFiClientSecure/src/WiFiClientSecure.cpp deleted file mode 100644 index 3f545c6723c..00000000000 --- a/libraries/WiFiClientSecure/src/WiFiClientSecure.cpp +++ /dev/null @@ -1,336 +0,0 @@ -/* - WiFiClientSecure.cpp - Client Secure class for ESP32 - Copyright (c) 2016 Hristo Gochkov All right reserved. - Additions Copyright (C) 2017 Evandro Luis Copercini. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "WiFiClientSecure.h" -#include -#include -#include - -#undef connect -#undef write -#undef read - - -WiFiClientSecure::WiFiClientSecure() -{ - _connected = false; - - sslclient = new sslclient_context; - ssl_init(sslclient); - sslclient->socket = -1; - sslclient->handshake_timeout = 120000; - _CA_cert = NULL; - _cert = NULL; - _private_key = NULL; - _pskIdent = NULL; - _psKey = NULL; - next = NULL; -} - - -WiFiClientSecure::WiFiClientSecure(int sock) -{ - _connected = false; - _timeout = 0; - - sslclient = new sslclient_context; - ssl_init(sslclient); - sslclient->socket = sock; - sslclient->handshake_timeout = 120000; - - if (sock >= 0) { - _connected = true; - } - - _CA_cert = NULL; - _cert = NULL; - _private_key = NULL; - _pskIdent = NULL; - _psKey = NULL; - next = NULL; -} - -WiFiClientSecure::~WiFiClientSecure() -{ - stop(); - delete sslclient; -} - -WiFiClientSecure &WiFiClientSecure::operator=(const WiFiClientSecure &other) -{ - stop(); - sslclient->socket = other.sslclient->socket; - _connected = other._connected; - return *this; -} - -void WiFiClientSecure::stop() -{ - if (sslclient->socket >= 0) { - close(sslclient->socket); - sslclient->socket = -1; - _connected = false; - _peek = -1; - } - stop_ssl_socket(sslclient, _CA_cert, _cert, _private_key); -} - -int WiFiClientSecure::connect(IPAddress ip, uint16_t port) -{ - if (_pskIdent && _psKey) - return connect(ip, port, _pskIdent, _psKey); - return connect(ip, port, _CA_cert, _cert, _private_key); -} - -int WiFiClientSecure::connect(IPAddress ip, uint16_t port, int32_t timeout){ - _timeout = timeout; - return connect(ip, port); -} - -int WiFiClientSecure::connect(const char *host, uint16_t port) -{ - if (_pskIdent && _psKey) - return connect(host, port, _pskIdent, _psKey); - return connect(host, port, _CA_cert, _cert, _private_key); -} - -int WiFiClientSecure::connect(const char *host, uint16_t port, int32_t timeout){ - _timeout = timeout; - return connect(host, port); -} - -int WiFiClientSecure::connect(IPAddress ip, uint16_t port, const char *_CA_cert, const char *_cert, const char *_private_key) -{ - return connect(ip.toString().c_str(), port, _CA_cert, _cert, _private_key); -} - -int WiFiClientSecure::connect(const char *host, uint16_t port, const char *_CA_cert, const char *_cert, const char *_private_key) -{ - if(_timeout > 0){ - sslclient->handshake_timeout = _timeout; - } - int ret = start_ssl_client(sslclient, host, port, _timeout, _CA_cert, _cert, _private_key, NULL, NULL); - _lastError = ret; - if (ret < 0) { - log_e("start_ssl_client: %d", ret); - stop(); - return 0; - } - _connected = true; - return 1; -} - -int WiFiClientSecure::connect(IPAddress ip, uint16_t port, const char *pskIdent, const char *psKey) { - return connect(ip.toString().c_str(), port,_pskIdent, _psKey); -} - -int WiFiClientSecure::connect(const char *host, uint16_t port, const char *pskIdent, const char *psKey) { - log_v("start_ssl_client with PSK"); - if(_timeout > 0){ - sslclient->handshake_timeout = _timeout; - } - int ret = start_ssl_client(sslclient, host, port, _timeout, NULL, NULL, NULL, _pskIdent, _psKey); - _lastError = ret; - if (ret < 0) { - log_e("start_ssl_client: %d", ret); - stop(); - return 0; - } - _connected = true; - return 1; -} - -int WiFiClientSecure::peek(){ - if(_peek >= 0){ - return _peek; - } - _peek = timedRead(); - return _peek; -} - -size_t WiFiClientSecure::write(uint8_t data) -{ - return write(&data, 1); -} - -int WiFiClientSecure::read() -{ - uint8_t data = -1; - int res = read(&data, 1); - if (res < 0) { - return res; - } - return data; -} - -size_t WiFiClientSecure::write(const uint8_t *buf, size_t size) -{ - if (!_connected) { - return 0; - } - int res = send_ssl_data(sslclient, buf, size); - if (res < 0) { - stop(); - res = 0; - } - return res; -} - -int WiFiClientSecure::read(uint8_t *buf, size_t size) -{ - int peeked = 0; - int avail = available(); - if ((!buf && size) || avail <= 0) { - return -1; - } - if(!size){ - return 0; - } - if(_peek >= 0){ - buf[0] = _peek; - _peek = -1; - size--; - avail--; - if(!size || !avail){ - return 1; - } - buf++; - peeked = 1; - } - - int res = get_ssl_receive(sslclient, buf, size); - if (res < 0) { - stop(); - return peeked?peeked:res; - } - return res + peeked; -} - -int WiFiClientSecure::available() -{ - int peeked = (_peek >= 0); - if (!_connected) { - return peeked; - } - int res = data_to_read(sslclient); - if (res < 0) { - stop(); - return peeked?peeked:res; - } - return res+peeked; -} - -uint8_t WiFiClientSecure::connected() -{ - uint8_t dummy = 0; - read(&dummy, 0); - - return _connected; -} - -void WiFiClientSecure::setCACert (const char *rootCA) -{ - _CA_cert = rootCA; -} - -void WiFiClientSecure::setCertificate (const char *client_ca) -{ - _cert = client_ca; -} - -void WiFiClientSecure::setPrivateKey (const char *private_key) -{ - _private_key = private_key; -} - -void WiFiClientSecure::setPreSharedKey(const char *pskIdent, const char *psKey) { - _pskIdent = pskIdent; - _psKey = psKey; -} - -bool WiFiClientSecure::verify(const char* fp, const char* domain_name) -{ - if (!sslclient) - return false; - - return verify_ssl_fingerprint(sslclient, fp, domain_name); -} - -char *WiFiClientSecure::_streamLoad(Stream& stream, size_t size) { - static char *dest = nullptr; - if(dest) { - free(dest); - } - dest = (char*)malloc(size); - if (!dest) { - return nullptr; - } - if (size != stream.readBytes(dest, size)) { - free(dest); - dest = nullptr; - } - return dest; -} - -bool WiFiClientSecure::loadCACert(Stream& stream, size_t size) { - char *dest = _streamLoad(stream, size); - bool ret = false; - if (dest) { - setCACert(dest); - ret = true; - } - return ret; -} - -bool WiFiClientSecure::loadCertificate(Stream& stream, size_t size) { - char *dest = _streamLoad(stream, size); - bool ret = false; - if (dest) { - setCertificate(dest); - ret = true; - } - return ret; -} - -bool WiFiClientSecure::loadPrivateKey(Stream& stream, size_t size) { - char *dest = _streamLoad(stream, size); - bool ret = false; - if (dest) { - setPrivateKey(dest); - ret = true; - } - return ret; -} - -int WiFiClientSecure::lastError(char *buf, const size_t size) -{ - if (!_lastError) { - return 0; - } - char error_buf[100]; - mbedtls_strerror(_lastError, error_buf, 100); - snprintf(buf, size, "%s", error_buf); - return _lastError; -} - -void WiFiClientSecure::setHandshakeTimeout(unsigned long handshake_timeout) -{ - sslclient->handshake_timeout = handshake_timeout * 1000; -} diff --git a/libraries/WiFiClientSecure/src/WiFiClientSecure.h b/libraries/WiFiClientSecure/src/WiFiClientSecure.h deleted file mode 100644 index cd4f20e0f1c..00000000000 --- a/libraries/WiFiClientSecure/src/WiFiClientSecure.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - WiFiClientSecure.h - Base class that provides Client SSL to ESP32 - Copyright (c) 2011 Adrian McEwen. All right reserved. - Additions Copyright (C) 2017 Evandro Luis Copercini. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef WiFiClientSecure_h -#define WiFiClientSecure_h -#include "Arduino.h" -#include "IPAddress.h" -#include -#include "ssl_client.h" - -class WiFiClientSecure : public WiFiClient -{ -protected: - sslclient_context *sslclient; - - int _lastError = 0; - int _peek = -1; - int _timeout = 0; - const char *_CA_cert; - const char *_cert; - const char *_private_key; - const char *_pskIdent; // identity for PSK cipher suites - const char *_psKey; // key in hex for PSK cipher suites - -public: - WiFiClientSecure *next; - WiFiClientSecure(); - WiFiClientSecure(int socket); - ~WiFiClientSecure(); - int connect(IPAddress ip, uint16_t port); - int connect(IPAddress ip, uint16_t port, int32_t timeout); - int connect(const char *host, uint16_t port); - int connect(const char *host, uint16_t port, int32_t timeout); - int connect(IPAddress ip, uint16_t port, const char *rootCABuff, const char *cli_cert, const char *cli_key); - int connect(const char *host, uint16_t port, const char *rootCABuff, const char *cli_cert, const char *cli_key); - int connect(IPAddress ip, uint16_t port, const char *pskIdent, const char *psKey); - int connect(const char *host, uint16_t port, const char *pskIdent, const char *psKey); - int peek(); - size_t write(uint8_t data); - size_t write(const uint8_t *buf, size_t size); - int available(); - int read(); - int read(uint8_t *buf, size_t size); - void flush() {} - void stop(); - uint8_t connected(); - int lastError(char *buf, const size_t size); - void setPreSharedKey(const char *pskIdent, const char *psKey); // psKey in Hex - void setCACert(const char *rootCA); - void setCertificate(const char *client_ca); - void setPrivateKey (const char *private_key); - bool loadCACert(Stream& stream, size_t size); - bool loadCertificate(Stream& stream, size_t size); - bool loadPrivateKey(Stream& stream, size_t size); - bool verify(const char* fingerprint, const char* domain_name); - void setHandshakeTimeout(unsigned long handshake_timeout); - - int setTimeout(uint32_t seconds){ return 0; } - - operator bool() - { - return connected(); - } - WiFiClientSecure &operator=(const WiFiClientSecure &other); - bool operator==(const bool value) - { - return bool() == value; - } - bool operator!=(const bool value) - { - return bool() != value; - } - bool operator==(const WiFiClientSecure &); - bool operator!=(const WiFiClientSecure &rhs) - { - return !this->operator==(rhs); - }; - - int socket() - { - return sslclient->socket = -1; - } - -private: - char *_streamLoad(Stream& stream, size_t size); - - //friend class WiFiServer; - using Print::write; -}; - -#endif /* _WIFICLIENT_H_ */ diff --git a/libraries/WiFiClientSecure/src/ssl_client.cpp b/libraries/WiFiClientSecure/src/ssl_client.cpp deleted file mode 100644 index ce8b31c727c..00000000000 --- a/libraries/WiFiClientSecure/src/ssl_client.cpp +++ /dev/null @@ -1,445 +0,0 @@ -/* Provide SSL/TLS functions to ESP32 with Arduino IDE -* -* Adapted from the ssl_client1 example of mbedtls. -* -* Original Copyright (C) 2006-2015, ARM Limited, All Rights Reserved, Apache 2.0 License. -* Additions Copyright (C) 2017 Evandro Luis Copercini, Apache 2.0 License. -*/ - -#include "Arduino.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "ssl_client.h" -#include "WiFi.h" - - -const char *pers = "esp32-tls"; - -static int _handle_error(int err, const char * file, int line) -{ - if(err == -30848){ - return err; - } -#ifdef MBEDTLS_ERROR_C - char error_buf[100]; - mbedtls_strerror(err, error_buf, 100); - log_e("[%s():%d]: (%d) %s", file, line, err, error_buf); -#else - log_e("[%s():%d]: code %d", file, line, err); -#endif - return err; -} - -#define handle_error(e) _handle_error(e, __FUNCTION__, __LINE__) - - -void ssl_init(sslclient_context *ssl_client) -{ - mbedtls_ssl_init(&ssl_client->ssl_ctx); - mbedtls_ssl_config_init(&ssl_client->ssl_conf); - mbedtls_ctr_drbg_init(&ssl_client->drbg_ctx); -} - - -int start_ssl_client(sslclient_context *ssl_client, const char *host, uint32_t port, int timeout, const char *rootCABuff, const char *cli_cert, const char *cli_key, const char *pskIdent, const char *psKey) -{ - char buf[512]; - int ret, flags; - int enable = 1; - log_v("Free internal heap before TLS %u", ESP.getFreeHeap()); - - log_v("Starting socket"); - ssl_client->socket = -1; - - ssl_client->socket = lwip_socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); - if (ssl_client->socket < 0) { - log_e("ERROR opening socket"); - return ssl_client->socket; - } - - IPAddress srv((uint32_t)0); - if(!WiFiGenericClass::hostByName(host, srv)){ - return -1; - } - - struct sockaddr_in serv_addr; - memset(&serv_addr, 0, sizeof(serv_addr)); - serv_addr.sin_family = AF_INET; - serv_addr.sin_addr.s_addr = srv; - serv_addr.sin_port = htons(port); - - if (lwip_connect(ssl_client->socket, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) == 0) { - if(timeout <= 0){ - timeout = 30000; - } - lwip_setsockopt(ssl_client->socket, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout)); - lwip_setsockopt(ssl_client->socket, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(timeout)); - lwip_setsockopt(ssl_client->socket, IPPROTO_TCP, TCP_NODELAY, &enable, sizeof(enable)); - lwip_setsockopt(ssl_client->socket, SOL_SOCKET, SO_KEEPALIVE, &enable, sizeof(enable)); - } else { - log_e("Connect to Server failed!"); - return -1; - } - - fcntl( ssl_client->socket, F_SETFL, fcntl( ssl_client->socket, F_GETFL, 0 ) | O_NONBLOCK ); - - log_v("Seeding the random number generator"); - mbedtls_entropy_init(&ssl_client->entropy_ctx); - - ret = mbedtls_ctr_drbg_seed(&ssl_client->drbg_ctx, mbedtls_entropy_func, - &ssl_client->entropy_ctx, (const unsigned char *) pers, strlen(pers)); - if (ret < 0) { - return handle_error(ret); - } - - log_v("Setting up the SSL/TLS structure..."); - - if ((ret = mbedtls_ssl_config_defaults(&ssl_client->ssl_conf, - MBEDTLS_SSL_IS_CLIENT, - MBEDTLS_SSL_TRANSPORT_STREAM, - MBEDTLS_SSL_PRESET_DEFAULT)) != 0) { - return handle_error(ret); - } - - // MBEDTLS_SSL_VERIFY_REQUIRED if a CA certificate is defined on Arduino IDE and - // MBEDTLS_SSL_VERIFY_NONE if not. - - if (rootCABuff != NULL) { - log_v("Loading CA cert"); - mbedtls_x509_crt_init(&ssl_client->ca_cert); - mbedtls_ssl_conf_authmode(&ssl_client->ssl_conf, MBEDTLS_SSL_VERIFY_REQUIRED); - ret = mbedtls_x509_crt_parse(&ssl_client->ca_cert, (const unsigned char *)rootCABuff, strlen(rootCABuff) + 1); - mbedtls_ssl_conf_ca_chain(&ssl_client->ssl_conf, &ssl_client->ca_cert, NULL); - //mbedtls_ssl_conf_verify(&ssl_client->ssl_ctx, my_verify, NULL ); - if (ret < 0) { - return handle_error(ret); - } - } else if (pskIdent != NULL && psKey != NULL) { - log_v("Setting up PSK"); - // convert PSK from hex to binary - if ((strlen(psKey) & 1) != 0 || strlen(psKey) > 2*MBEDTLS_PSK_MAX_LEN) { - log_e("pre-shared key not valid hex or too long"); - return -1; - } - unsigned char psk[MBEDTLS_PSK_MAX_LEN]; - size_t psk_len = strlen(psKey)/2; - for (int j=0; j= '0' && c <= '9') c -= '0'; - else if (c >= 'A' && c <= 'F') c -= 'A' - 10; - else if (c >= 'a' && c <= 'f') c -= 'a' - 10; - else return -1; - psk[j/2] = c<<4; - c = psKey[j+1]; - if (c >= '0' && c <= '9') c -= '0'; - else if (c >= 'A' && c <= 'F') c -= 'A' - 10; - else if (c >= 'a' && c <= 'f') c -= 'a' - 10; - else return -1; - psk[j/2] |= c; - } - // set mbedtls config - ret = mbedtls_ssl_conf_psk(&ssl_client->ssl_conf, psk, psk_len, - (const unsigned char *)pskIdent, strlen(pskIdent)); - if (ret != 0) { - log_e("mbedtls_ssl_conf_psk returned %d", ret); - return handle_error(ret); - } - } else { - mbedtls_ssl_conf_authmode(&ssl_client->ssl_conf, MBEDTLS_SSL_VERIFY_NONE); - log_i("WARNING: Use certificates for a more secure communication!"); - } - - if (cli_cert != NULL && cli_key != NULL) { - mbedtls_x509_crt_init(&ssl_client->client_cert); - mbedtls_pk_init(&ssl_client->client_key); - - log_v("Loading CRT cert"); - - ret = mbedtls_x509_crt_parse(&ssl_client->client_cert, (const unsigned char *)cli_cert, strlen(cli_cert) + 1); - if (ret < 0) { - return handle_error(ret); - } - - log_v("Loading private key"); - ret = mbedtls_pk_parse_key(&ssl_client->client_key, (const unsigned char *)cli_key, strlen(cli_key) + 1, NULL, 0); - - if (ret != 0) { - return handle_error(ret); - } - - mbedtls_ssl_conf_own_cert(&ssl_client->ssl_conf, &ssl_client->client_cert, &ssl_client->client_key); - } - - log_v("Setting hostname for TLS session..."); - - // 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); - - if ((ret = mbedtls_ssl_setup(&ssl_client->ssl_ctx, &ssl_client->ssl_conf)) != 0) { - return handle_error(ret); - } - - mbedtls_ssl_set_bio(&ssl_client->ssl_ctx, &ssl_client->socket, mbedtls_net_send, mbedtls_net_recv, NULL ); - - log_v("Performing the SSL/TLS handshake..."); - unsigned long handshake_start_time=millis(); - while ((ret = mbedtls_ssl_handshake(&ssl_client->ssl_ctx)) != 0) { - if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE) { - return handle_error(ret); - } - if((millis()-handshake_start_time)>ssl_client->handshake_timeout) - return -1; - vTaskDelay(10 / portTICK_PERIOD_MS); - } - - - if (cli_cert != NULL && cli_key != NULL) { - log_d("Protocol is %s Ciphersuite is %s", mbedtls_ssl_get_version(&ssl_client->ssl_ctx), mbedtls_ssl_get_ciphersuite(&ssl_client->ssl_ctx)); - if ((ret = mbedtls_ssl_get_record_expansion(&ssl_client->ssl_ctx)) >= 0) { - log_d("Record expansion is %d", ret); - } else { - log_w("Record expansion is unknown (compression)"); - } - } - - log_v("Verifying peer X.509 certificate..."); - - if ((flags = mbedtls_ssl_get_verify_result(&ssl_client->ssl_ctx)) != 0) { - bzero(buf, 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."); - } - - if (rootCABuff != NULL) { - mbedtls_x509_crt_free(&ssl_client->ca_cert); - } - - if (cli_cert != NULL) { - mbedtls_x509_crt_free(&ssl_client->client_cert); - } - - if (cli_key != NULL) { - mbedtls_pk_free(&ssl_client->client_key); - } - - log_v("Free internal heap after TLS %u", ESP.getFreeHeap()); - - return ssl_client->socket; -} - - -void stop_ssl_socket(sslclient_context *ssl_client, const char *rootCABuff, const char *cli_cert, const char *cli_key) -{ - log_v("Cleaning SSL connection."); - - if (ssl_client->socket >= 0) { - close(ssl_client->socket); - ssl_client->socket = -1; - } - - 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); -} - - -int data_to_read(sslclient_context *ssl_client) -{ - int ret, res; - ret = mbedtls_ssl_read(&ssl_client->ssl_ctx, NULL, 0); - //log_e("RET: %i",ret); //for low level debug - res = mbedtls_ssl_get_bytes_avail(&ssl_client->ssl_ctx); - //log_e("RES: %i",res); //for low level debug - if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE && ret < 0) { - return handle_error(ret); - } - - return res; -} - - -int send_ssl_data(sslclient_context *ssl_client, const uint8_t *data, uint16_t len) -{ - log_v("Writing HTTP request..."); //for low level debug - int ret = -1; - - while ((ret = mbedtls_ssl_write(&ssl_client->ssl_ctx, data, len)) <= 0) { - if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE) { - return handle_error(ret); - } - } - - len = ret; - //log_v("%d bytes written", len); //for low level debug - return ret; -} - - -int get_ssl_receive(sslclient_context *ssl_client, uint8_t *data, int length) -{ - //log_d( "Reading HTTP response..."); //for low level debug - int ret = -1; - - ret = mbedtls_ssl_read(&ssl_client->ssl_ctx, data, length); - - //log_v( "%d bytes read", ret); //for low level debug - return ret; -} - -static bool parseHexNibble(char pb, uint8_t* res) -{ - if (pb >= '0' && pb <= '9') { - *res = (uint8_t) (pb - '0'); return true; - } else if (pb >= 'a' && pb <= 'f') { - *res = (uint8_t) (pb - 'a' + 10); return true; - } else if (pb >= 'A' && pb <= 'F') { - *res = (uint8_t) (pb - 'A' + 10); return true; - } - return false; -} - -// Compare a name from certificate and domain name, return true if they match -static bool matchName(const std::string& name, const std::string& domainName) -{ - size_t wildcardPos = name.find('*'); - if (wildcardPos == std::string::npos) { - // Not a wildcard, expect an exact match - return name == domainName; - } - - size_t firstDotPos = name.find('.'); - if (wildcardPos > firstDotPos) { - // Wildcard is not part of leftmost component of domain name - // Do not attempt to match (rfc6125 6.4.3.1) - return false; - } - if (wildcardPos != 0 || firstDotPos != 1) { - // Matching of wildcards such as baz*.example.com and b*z.example.com - // is optional. Maybe implement this in the future? - return false; - } - size_t domainNameFirstDotPos = domainName.find('.'); - if (domainNameFirstDotPos == std::string::npos) { - return false; - } - return domainName.substr(domainNameFirstDotPos) == name.substr(firstDotPos); -} - -// Verifies certificate provided by the peer to match specified SHA256 fingerprint -bool verify_ssl_fingerprint(sslclient_context *ssl_client, const char* fp, const char* domain_name) -{ - // Convert hex string to byte array - uint8_t fingerprint_local[32]; - int len = strlen(fp); - int pos = 0; - for (size_t i = 0; i < sizeof(fingerprint_local); ++i) { - while (pos < len && ((fp[pos] == ' ') || (fp[pos] == ':'))) { - ++pos; - } - if (pos > len - 2) { - log_d("pos:%d len:%d fingerprint too short", pos, len); - return false; - } - uint8_t high, low; - if (!parseHexNibble(fp[pos], &high) || !parseHexNibble(fp[pos+1], &low)) { - log_d("pos:%d len:%d invalid hex sequence: %c%c", pos, len, fp[pos], fp[pos+1]); - return false; - } - pos += 2; - fingerprint_local[i] = low | (high << 4); - } - - // Get certificate provided by the peer - const mbedtls_x509_crt* crt = mbedtls_ssl_get_peer_cert(&ssl_client->ssl_ctx); - - if (!crt) - { - log_d("could not fetch peer certificate"); - return false; - } - - // Calculate certificate's SHA256 fingerprint - uint8_t fingerprint_remote[32]; - mbedtls_sha256_context sha256_ctx; - mbedtls_sha256_init(&sha256_ctx); - mbedtls_sha256_starts(&sha256_ctx, false); - mbedtls_sha256_update(&sha256_ctx, crt->raw.p, crt->raw.len); - mbedtls_sha256_finish(&sha256_ctx, fingerprint_remote); - - // Check if fingerprints match - if (memcmp(fingerprint_local, fingerprint_remote, 32)) - { - log_d("fingerprint doesn't match"); - return false; - } - - // Additionally check if certificate has domain name if provided - if (domain_name) - return verify_ssl_dn(ssl_client, domain_name); - else - return true; -} - -// Checks if peer certificate has specified domain in CN or SANs -bool verify_ssl_dn(sslclient_context *ssl_client, const char* domain_name) -{ - log_d("domain name: '%s'", (domain_name)?domain_name:"(null)"); - std::string domain_name_str(domain_name); - std::transform(domain_name_str.begin(), domain_name_str.end(), domain_name_str.begin(), ::tolower); - - // Get certificate provided by the peer - const mbedtls_x509_crt* crt = mbedtls_ssl_get_peer_cert(&ssl_client->ssl_ctx); - - // Check for domain name in SANs - const mbedtls_x509_sequence* san = &crt->subject_alt_names; - while (san != nullptr) - { - std::string san_str((const char*)san->buf.p, san->buf.len); - std::transform(san_str.begin(), san_str.end(), san_str.begin(), ::tolower); - - if (matchName(san_str, domain_name_str)) - return true; - - log_d("SAN '%s': no match", san_str.c_str()); - - // Fetch next SAN - san = san->next; - } - - // Check for domain name in CN - const mbedtls_asn1_named_data* common_name = &crt->subject; - while (common_name != nullptr) - { - // While iterating through DN objects, check for CN object - if (!MBEDTLS_OID_CMP(MBEDTLS_OID_AT_CN, &common_name->oid)) - { - std::string common_name_str((const char*)common_name->val.p, common_name->val.len); - - if (matchName(common_name_str, domain_name_str)) - return true; - - log_d("CN '%s': not match", common_name_str.c_str()); - } - - // Fetch next DN object - common_name = common_name->next; - } - - return false; -} diff --git a/libraries/WiFiClientSecure/src/ssl_client.h b/libraries/WiFiClientSecure/src/ssl_client.h deleted file mode 100644 index dd57a0ff45f..00000000000 --- a/libraries/WiFiClientSecure/src/ssl_client.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Provide SSL/TLS functions to ESP32 with Arduino IDE - * by Evandro Copercini - 2017 - Apache 2.0 License - */ - -#ifndef ARD_SSL_H -#define ARD_SSL_H -#include "mbedtls/platform.h" -#include "mbedtls/net.h" -#include "mbedtls/debug.h" -#include "mbedtls/ssl.h" -#include "mbedtls/entropy.h" -#include "mbedtls/ctr_drbg.h" -#include "mbedtls/error.h" - -typedef struct sslclient_context { - int socket; - mbedtls_ssl_context ssl_ctx; - mbedtls_ssl_config ssl_conf; - - mbedtls_ctr_drbg_context drbg_ctx; - mbedtls_entropy_context entropy_ctx; - - mbedtls_x509_crt ca_cert; - mbedtls_x509_crt client_cert; - mbedtls_pk_context client_key; - - unsigned long handshake_timeout; -} sslclient_context; - - -void ssl_init(sslclient_context *ssl_client); -int start_ssl_client(sslclient_context *ssl_client, const char *host, uint32_t port, int timeout, const char *rootCABuff, const char *cli_cert, const char *cli_key, const char *pskIdent, const char *psKey); -void stop_ssl_socket(sslclient_context *ssl_client, const char *rootCABuff, const char *cli_cert, const char *cli_key); -int data_to_read(sslclient_context *ssl_client); -int send_ssl_data(sslclient_context *ssl_client, const uint8_t *data, uint16_t len); -int get_ssl_receive(sslclient_context *ssl_client, uint8_t *data, int length); -bool verify_ssl_fingerprint(sslclient_context *ssl_client, const char* fp, const char* domain_name); -bool verify_ssl_dn(sslclient_context *ssl_client, const char* domain_name); - -#endif diff --git a/libraries/Wire/doc/i2c_debugging.md b/libraries/Wire/doc/i2c_debugging.md deleted file mode 100644 index 35c6e2e7f17..00000000000 --- a/libraries/Wire/doc/i2c_debugging.md +++ /dev/null @@ -1,276 +0,0 @@ -# Debugging I2C - -With the release of Arduino-ESP32 V1.0.1 the I2C subsystem contains code to exhaustively report communication errors. -* Basic debugging can be enable by setting the *CORE DEBUG LEVEL* at or above *ERROR*. All errors will be directed the the *DEBUG OUTPUT* normally connected to `Serial()`. -* Enhanced debugging can be used to generate specified information at specific positions during the i2c communication sequence. Increase *CORE DEBUG LEVEL* to ***DEBUG*** - -## Enable Debug Buffer -The Enhanced debug features are enabled by uncommenting the `\\#define ENABLE_I2C_DEBUG_BUFFER` at line 45 of `esp32-hal-i2c.c`. -* When Arduino-Esp32 is installed in Windows with Arduino Boards Manager, `esp32-hal-i2c.c` can be found in: -`C:\Users\{user}\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.1\cores\esp32\` -* When Arduino-Esp32 Development version is installed from GitHub, `esp32-hal-i2c.c` can be found in: -`{arduino Sketch}\hardware\espressif\esp32\cores\esp32\` - - -```c++ -//#define ENABLE_I2C_DEBUG_BUFFER -``` -Change it to: -```c++ -#define ENABLE_I2C_DEBUG_BUFFER -``` -and recompile/upload the resulting code to your ESP32. - -Enabling this `#define` will consume an additional 2570 bytes of RAM and include a commensurate amount of code FLASH. If you see the message `"Debug Buffer not Enabled"` in your console log I would suggest you un-comment the line and regenerate the error. Additional information will be supplied on the log console. - -## Manually controlled Debugging -Manual logging of the i2c control data buffers can be accomplished by using the debug control function of `Wire()`: -```c++ - uint32_t setDebugFlags( uint32_t setBits, uint32_t resetBits); -``` -`setBits`, and `resetBits` manually cause output of the control structures to the log console. They are bit fields that enable/disable the reporting of individual control structures during specific phases of the i2c communications sequence. The 32bit values are divided into four 8bit fields. Currently only five bits are defined. ***If an error is detected during normal operations, the relevant control structure will bit added to the log irrespective of the current debug flags.*** - -* **bit 0** causes DumpI2c to execute -header information about current communications event, -and the dataQueue elements showing the logical i2c transaction commands -* **bit 1** causes DumpInts to execute -Actual sequence of interrupts handled during last communications event, cleared on entry into `ProcQueue()`. -* **bit 2** causes DumpCmdqueue to execute -The last block of commands to the i2c peripheral. -* **bit 3** causes DumpStatus to execute -A descriptive display of the 32bit i2c peripheral status word. -* **bit 4** causes DumpFifo to execute -A buffer listing the sequence of data added to the txFifo of the i2c peripheral. - -Of the four division, only three are currently implemented: -* 0xXX - - - - - - : at entry of ProcQueue (`bitFlags << 24`) -* 0x - - XX - - - - : at exit of ProcQueue (`bitFlags << 16`) -* 0x - - - - - - XX : at entry of Flush (`bitFlags`) - -For example, to display the sequence of Interrupts processed during the i2c communication transaction, **bit 1** would be set, and, since this information on Interrupt usage would only be valid after the communications have completed, the locus would be *at exit of ProcQueue*. The following code would be necessary. -### code -```c++ -uint8_t flag = 1 << 1; // turn on bit 1 -uint32_t debugFlag = flag << 16; // correctly position the 8bits of flag as the second byte of setBits. -Wire.setDebugFlags(debugFlag,0);// resetBits=0 says leave all current setBits as is. - -Wire.requestFrom(id,byteCount); // read byteCount bytes from slave at id - -Wire.setDebugFlags(0,debugFlag); // don't add any new debug, remove debugFlag -``` -### output of log console -``` -[I][esp32-hal-i2c.c:437] i2cTriggerDumps(): after ProcQueue -[I][esp32-hal-i2c.c:346] i2cDumpInts(): 0 row count INTR TX RX Tick -[I][esp32-hal-i2c.c:350] i2cDumpInts(): [01] 0x0001 0x0002 0x0003 0x0000 0x005baac5 -[I][esp32-hal-i2c.c:350] i2cDumpInts(): [02] 0x0001 0x0200 0x0000 0x0000 0x005baac5 -[I][esp32-hal-i2c.c:350] i2cDumpInts(): [03] 0x0001 0x0080 0x0000 0x0008 0x005baac6 -``` -# Debug Log example -### Code -To read eight bytes of data from a DS1307 RTCC -``` - uint32_t debugFlag = 0x001F0000; - uint8_t ID = 0x68; - uint8_t block=8; - - if(debugFlag >0){ - Wire.setDebugFlags(debugFlag,0); - } - - Wire.beginTransmission(ID); - Wire.write(lowByte(addr)); - if((err=Wire.endTransmission(false))!=0) { - Serial.printf(" EndTransmission=%d(%s)",Wire.lastError(),Wire.getErrorText(Wire.lastError())); - - if(err!=2) { - Serial.printf(", resetting\n"); - if( !Wire.begin()) Serial.printf(" Reset Failed\n"); - if(debugFlag >0) Wire.setDebugFlags(0,debugFlag); - return; - } else { - Serial.printf(", No Device present, aborting\n"); - currentCommand= NO_COMMAND; - return; - } - } - err = Wire.requestFrom(ID,block,true); - if(debugFlag >0){ - Wire.setDebugFlags(0,debugFlag); - } -``` -### output of log console -``` -[I][esp32-hal-i2c.c:437] i2cTriggerDumps(): after ProcQueue -[E][esp32-hal-i2c.c:318] i2cDumpI2c(): i2c=0x3ffbdc78 -[I][esp32-hal-i2c.c:319] i2cDumpI2c(): dev=0x60013000 date=0x16042000 -[I][esp32-hal-i2c.c:321] i2cDumpI2c(): lock=0x3ffb843c -[I][esp32-hal-i2c.c:323] i2cDumpI2c(): num=0 -[I][esp32-hal-i2c.c:324] i2cDumpI2c(): mode=1 -[I][esp32-hal-i2c.c:325] i2cDumpI2c(): stage=3 -[I][esp32-hal-i2c.c:326] i2cDumpI2c(): error=1 -[I][esp32-hal-i2c.c:327] i2cDumpI2c(): event=0x3ffb85c4 bits=10 -[I][esp32-hal-i2c.c:328] i2cDumpI2c(): intr_handle=0x3ffb85f4 -[I][esp32-hal-i2c.c:329] i2cDumpI2c(): dq=0x3ffb858c -[I][esp32-hal-i2c.c:330] i2cDumpI2c(): queueCount=2 -[I][esp32-hal-i2c.c:331] i2cDumpI2c(): queuePos=1 -[I][esp32-hal-i2c.c:332] i2cDumpI2c(): errorByteCnt=0 -[I][esp32-hal-i2c.c:333] i2cDumpI2c(): errorQueue=0 -[I][esp32-hal-i2c.c:334] i2cDumpI2c(): debugFlags=0x001F0000 -[I][esp32-hal-i2c.c:288] i2cDumpDqData(): [0] 7bit 68 W buf@=0x3ffc04b2, len=1, pos=1, ctrl=11101 -[I][esp32-hal-i2c.c:306] i2cDumpDqData(): 0x0000: . 00 -[I][esp32-hal-i2c.c:288] i2cDumpDqData(): [1] 7bit 68 R STOP buf@=0x3ffc042c, len=8, pos=8, ctrl=11111 -[I][esp32-hal-i2c.c:306] i2cDumpDqData(): 0x0000: 5P...... 35 50 07 06 13 09 18 00 -[I][esp32-hal-i2c.c:346] i2cDumpInts(): 0 row count INTR TX RX Tick -[I][esp32-hal-i2c.c:350] i2cDumpInts(): [01] 0x0001 0x0002 0x0003 0x0000 0x000073d5 -[I][esp32-hal-i2c.c:350] i2cDumpInts(): [02] 0x0001 0x0200 0x0000 0x0000 0x000073d5 -[I][esp32-hal-i2c.c:350] i2cDumpInts(): [03] 0x0001 0x0080 0x0000 0x0008 0x000073d6 -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [ 0] Y RSTART val[0] exp[0] en[0] bytes[0] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [ 1] Y WRITE val[0] exp[0] en[1] bytes[1] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [ 2] Y WRITE val[0] exp[0] en[1] bytes[1] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [ 3] Y RSTART val[0] exp[0] en[0] bytes[0] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [ 4] Y WRITE val[0] exp[0] en[1] bytes[1] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [ 5] Y READ val[0] exp[0] en[0] bytes[7] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [ 6] Y READ val[1] exp[0] en[0] bytes[1] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [ 7] Y STOP val[0] exp[0] en[0] bytes[0] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [ 8] N RSTART val[0] exp[0] en[0] bytes[0] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [ 9] N RSTART val[0] exp[0] en[0] bytes[0] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [10] N RSTART val[0] exp[0] en[0] bytes[0] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [11] N RSTART val[0] exp[0] en[0] bytes[0] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [12] N RSTART val[0] exp[0] en[0] bytes[0] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [13] N RSTART val[0] exp[0] en[0] bytes[0] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [14] N RSTART val[0] exp[0] en[0] bytes[0] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [15] N RSTART val[0] exp[0] en[0] bytes[0] -[I][esp32-hal-i2c.c:385] i2cDumpStatus(): ack(0) sl_rw(0) to(0) arb(0) busy(0) sl(1) trans(0) rx(0) tx(0) sclMain(5) scl(6) -[I][esp32-hal-i2c.c:424] i2cDumpFifo(): WRITE 0x68 0 -[I][esp32-hal-i2c.c:424] i2cDumpFifo(): READ 0x68 -``` -## Explaination of log output -### DumpI2c -``` -[I][esp32-hal-i2c.c:437] i2cTriggerDumps(): after ProcQueue -[E][esp32-hal-i2c.c:318] i2cDumpI2c(): i2c=0x3ffbdc78 -[I][esp32-hal-i2c.c:319] i2cDumpI2c(): dev=0x60013000 date=0x16042000 -[I][esp32-hal-i2c.c:321] i2cDumpI2c(): lock=0x3ffb843c -[I][esp32-hal-i2c.c:323] i2cDumpI2c(): num=0 -[I][esp32-hal-i2c.c:324] i2cDumpI2c(): mode=1 -[I][esp32-hal-i2c.c:325] i2cDumpI2c(): stage=3 -[I][esp32-hal-i2c.c:326] i2cDumpI2c(): error=1 -[I][esp32-hal-i2c.c:327] i2cDumpI2c(): event=0x3ffb85c4 bits=10 -[I][esp32-hal-i2c.c:328] i2cDumpI2c(): intr_handle=0x3ffb85f4 -[I][esp32-hal-i2c.c:329] i2cDumpI2c(): dq=0x3ffb858c -[I][esp32-hal-i2c.c:330] i2cDumpI2c(): queueCount=2 -[I][esp32-hal-i2c.c:331] i2cDumpI2c(): queuePos=1 -[I][esp32-hal-i2c.c:332] i2cDumpI2c(): errorByteCnt=0 -[I][esp32-hal-i2c.c:333] i2cDumpI2c(): errorQueue=0 -[I][esp32-hal-i2c.c:334] i2cDumpI2c(): debugFlags=0x001F0000 -``` -variable | description ----- | ---- -**i2c** | *memory address for control block* -**dev** | *memory address for access to i2c peripheral registers* -**date** | *revision date of peripheral silicon 2016, 42 week* -**lock** | *hal lock handle* -**num** | *0,1 which peripheral is being controlled* -**mode** | *configuration of driver 0=none, 1=MASTER, 2=SLAVE, 3=MASTER and SLAVE* -**stage** | *internal STATE of driver 0=not configured, 1=startup, 2=running, 3=done* -**error** | *internal ERROR status 0=not configured, 1=ok, 2=error, 3=address NAK, 4=data NAK, 5=arbitration loss, 6=timeout* -**event** | *handle for interprocess FreeRTOS eventSemaphore for communication between ISR and APP* -**intr_handle** | *FreeRTOS handle for allocated interrupt* -**dq** | *memory address for data queue control block* -**queueCount** | *number of data operations in queue control block* -**queuePos** | *last executed data block* -**errorByteCnt** | *position in current data block when error occured -1=address byte* -**errorQueue** | *queue that was executing when error occurred* -**debugFlags** | *current specified error bits* - -### DQ data -``` -[I][esp32-hal-i2c.c:288] i2cDumpDqData(): [0] 7bit 68 W buf@=0x3ffc04b2, len=1, pos=1, ctrl=11101 -[I][esp32-hal-i2c.c:306] i2cDumpDqData(): 0x0000: . 00 -[I][esp32-hal-i2c.c:288] i2cDumpDqData(): [1] 7bit 68 R STOP buf@=0x3ffc042c, len=8, pos=8, ctrl=11111 -[I][esp32-hal-i2c.c:306] i2cDumpDqData(): 0x0000: 5P...... 35 50 07 06 13 09 18 00 -``` -variable | description ---- | --- -**[n]** | *index of data queue element* -**i2c address** | *7bit= 7bit i2c slave address, 10bit= 10bit i2c slave address* -**direction** | *W=Write, R=READ* -**STOP** | *command issued a I2C STOP, else if blank, a RESTART was issued by next dq element.* -**buf@** | *pointer to data buffer* -**len** | *length of data buffer* -**pos** | *last position used in buffer* -**ctrl** | *bit field for data queue control, this bits describe if all necessary commands have been added to peripheral command buffer. in order(START,ADDRESS_Write,DATA,STOP,ADDRESS_value* -**0xnnnn** | *data buffer content, displayable followed by HEX, 32 bytes on a line.* - -### DumpInts -``` -[I][esp32-hal-i2c.c:346] i2cDumpInts(): 0 row count INTR TX RX Tick -[I][esp32-hal-i2c.c:350] i2cDumpInts(): [01] 0x0001 0x0002 0x0003 0x0000 0x000073d5 -[I][esp32-hal-i2c.c:350] i2cDumpInts(): [02] 0x0001 0x0200 0x0000 0x0000 0x000073d5 -[I][esp32-hal-i2c.c:350] i2cDumpInts(): [03] 0x0001 0x0080 0x0000 0x0008 0x000073d6 -``` -variable | description ----- | ---- -**row** | *array index* -**count** | *number of consecutive, duplicate interrupts* -**INTR** | *bit value of active interrupt (from ..\esp32\tools\sdk\include\soc\soc\i2c_struct.h)* -**TX** | *number of bytes added to txFifo* -**RX** | *number of bytes read from rxFifo* -**Tick** | *current tick counter from xTaskGetTickCountFromISR()* - -### DumpCmdQueue -``` -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [ 0] Y RSTART val[0] exp[0] en[0] bytes[0] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [ 1] Y WRITE val[0] exp[0] en[1] bytes[1] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [ 2] Y WRITE val[0] exp[0] en[1] bytes[1] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [ 3] Y RSTART val[0] exp[0] en[0] bytes[0] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [ 4] Y WRITE val[0] exp[0] en[1] bytes[1] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [ 5] Y READ val[0] exp[0] en[0] bytes[7] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [ 6] Y READ val[1] exp[0] en[0] bytes[1] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [ 7] Y STOP val[0] exp[0] en[0] bytes[0] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [ 8] N RSTART val[0] exp[0] en[0] bytes[0] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [ 9] N RSTART val[0] exp[0] en[0] bytes[0] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [10] N RSTART val[0] exp[0] en[0] bytes[0] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [11] N RSTART val[0] exp[0] en[0] bytes[0] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [12] N RSTART val[0] exp[0] en[0] bytes[0] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [13] N RSTART val[0] exp[0] en[0] bytes[0] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [14] N RSTART val[0] exp[0] en[0] bytes[0] -[E][esp32-hal-i2c.c:243] i2cDumpCmdQueue(): [15] N RSTART val[0] exp[0] en[0] bytes[0] -``` -Column | description ----- | ---- -**command** | *RSTART= generate i2c START sequence, WRITE= output byte(s), READ= input byte(s), STOP= generate i2c STOP sequence, END= continuation flag for peripheral to pause execution waiting for a refilled command list* -**val** | *value for ACK bit, 0 = LOW, 1= HIGH* -**exp** | *test of ACK bit 0=no, 1=yes* -**en** | *output of val, 0=no, 1=yes* -**bytes** | *number of byte to send(WRITE) or receive(READ) 1..255* - -### DumpStatus -``` -[I][esp32-hal-i2c.c:385] i2cDumpStatus(): ack(0) sl_rw(0) to(0) arb(0) busy(0) sl(1) trans(0) rx(0) tx(0) sclMain(5) scl(6) -``` -variable | description ----- | ---- -**ack** | *last value for ACK bit* -**sl_rw** | *mode for SLAVE operation 0=write, 1=read* -**to** | *timeout* -**arb** | *arbitration loss* -**busy** | *bus is inuse by other Master, or SLAVE is holding SCL,SDA* -**sl** | *last address on bus was equal to slave_addr* -**trans** | *a byte has moved though peripheral* -**rx** | *count of bytes in rxFifo* -**tx** | *count of bytes in txFifo* -**sclMain** | *state machine for i2c module. 0: SCL_MAIN_IDLE, 1: SCL_ADDRESS_SHIFT, 2: SCL_ACK_ADDRESS, 3: SCL_RX_DATA, 4: SCL_TX_DATA, 5: SCL_SEND_ACK, 6 :SCL_WAIT_ACK* -**scl** | *SCL clock state. 0: SCL_IDLE, 1: SCL_START, 2: SCL_LOW_EDGE, 3: SCL_LOW, 4: SCL_HIGH_EDGE, 5: SCL_HIGH, 6:SCL_STOP* - -### DumpFifo -``` -[I][esp32-hal-i2c.c:424] i2cDumpFifo(): WRITE 0x68 0 -[I][esp32-hal-i2c.c:424] i2cDumpFifo(): READ 0x68 -``` -Mode | datavalues ---- | --- -**WRITE** | the following bytes added to the txFifo are in response to a WRITE command -**READ** | the following bytes added to the txFifo are in response to a READ command - diff --git a/libraries/Wire/keywords.txt b/libraries/Wire/keywords.txt deleted file mode 100644 index 3344011d406..00000000000 --- a/libraries/Wire/keywords.txt +++ /dev/null @@ -1,33 +0,0 @@ -####################################### -# Syntax Coloring Map For Wire -####################################### - -####################################### -# Datatypes (KEYWORD1) -####################################### - -####################################### -# Methods and Functions (KEYWORD2) -####################################### - -begin KEYWORD2 -setClock KEYWORD2 -setClockStretchLimit KEYWORD2 -beginTransmission KEYWORD2 -endTransmission KEYWORD2 -requestFrom KEYWORD2 -send KEYWORD2 -receive KEYWORD2 -onReceive KEYWORD2 -onRequest KEYWORD2 - -####################################### -# Instances (KEYWORD2) -####################################### - -Wire KEYWORD2 - -####################################### -# Constants (LITERAL1) -####################################### - diff --git a/libraries/Wire/library.properties b/libraries/Wire/library.properties deleted file mode 100644 index 099cf6f0bac..00000000000 --- a/libraries/Wire/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=Wire -version=1.0.1 -author=Hristo Gochkov -maintainer=Hristo Gochkov -sentence=Allows the communication between devices or sensors connected via Two Wire Interface Bus. For esp8266 boards. -paragraph= -category=Signal Input/Output -url=http://arduino.cc/en/Reference/Wire -architectures=esp32 diff --git a/libraries/Wire/src/Wire.cpp b/libraries/Wire/src/Wire.cpp deleted file mode 100644 index bc580147800..00000000000 --- a/libraries/Wire/src/Wire.cpp +++ /dev/null @@ -1,371 +0,0 @@ -/* - TwoWire.cpp - TWI/I2C library for Arduino & Wiring - Copyright (c) 2006 Nicholas Zambetti. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Modified 2012 by Todd Krein (todd@krein.org) to implement repeated starts - Modified December 2014 by Ivan Grokhotkov (ivan@esp8266.com) - esp8266 support - Modified April 2015 by Hrsto Gochkov (ficeto@ficeto.com) - alternative esp8266 support - Modified Nov 2017 by Chuck Todd (ctodd@cableone.net) - ESP32 ISR Support - */ - -extern "C" { -#include -#include -#include -} - -#include "esp32-hal-i2c.h" -#include "Wire.h" -#include "Arduino.h" - -TwoWire::TwoWire(uint8_t bus_num) - :num(bus_num & 1) - ,sda(-1) - ,scl(-1) - ,i2c(NULL) - ,rxIndex(0) - ,rxLength(0) - ,rxQueued(0) - ,txIndex(0) - ,txLength(0) - ,txAddress(0) - ,txQueued(0) - ,transmitting(0) - ,last_error(I2C_ERROR_OK) - ,_timeOutMillis(50) -{} - -TwoWire::~TwoWire() -{ - flush(); - if(i2c) { - i2cRelease(i2c); - i2c=NULL; - } -} - -bool TwoWire::begin(int sdaPin, int sclPin, uint32_t frequency) -{ - if(sdaPin < 0) { // default param passed - if(num == 0) { - if(sda==-1) { - sdaPin = SDA; //use Default Pin - } else { - sdaPin = sda; // reuse prior pin - } - } else { - if(sda==-1) { - log_e("no Default SDA Pin for Second Peripheral"); - return false; //no Default pin for Second Peripheral - } else { - sdaPin = sda; // reuse prior pin - } - } - } - - if(sclPin < 0) { // default param passed - if(num == 0) { - if(scl == -1) { - sclPin = SCL; // use Default pin - } else { - sclPin = scl; // reuse prior pin - } - } else { - if(scl == -1) { - log_e("no Default SCL Pin for Second Peripheral"); - return false; //no Default pin for Second Peripheral - } else { - sclPin = scl; // reuse prior pin - } - } - } - - sda = sdaPin; - scl = sclPin; - i2c = i2cInit(num, sdaPin, sclPin, frequency); - if(!i2c) { - return false; - } - - flush(); - return true; - -} - -void TwoWire::setTimeOut(uint16_t timeOutMillis) -{ - _timeOutMillis = timeOutMillis; -} - -uint16_t TwoWire::getTimeOut() -{ - return _timeOutMillis; -} - -void TwoWire::setClock(uint32_t frequency) -{ - i2cSetFrequency(i2c, frequency); -} - -size_t TwoWire::getClock() -{ - return i2cGetFrequency(i2c); -} - -/* stickBreaker Nov 2017 ISR, and bigblock 64k-1 - */ -i2c_err_t TwoWire::writeTransmission(uint16_t address, uint8_t *buff, uint16_t size, bool sendStop) -{ - last_error = i2cWrite(i2c, address, buff, size, sendStop, _timeOutMillis); - return last_error; -} - -i2c_err_t TwoWire::readTransmission(uint16_t address, uint8_t *buff, uint16_t size, bool sendStop, uint32_t *readCount) -{ - last_error = i2cRead(i2c, address, buff, size, sendStop, _timeOutMillis, readCount); - return last_error; -} - -void TwoWire::beginTransmission(uint16_t address) -{ - transmitting = 1; - txAddress = address; - txIndex = txQueued; // allow multiple beginTransmission(),write(),endTransmission(false) until endTransmission(true) - txLength = txQueued; - last_error = I2C_ERROR_OK; -} - -/*stickbreaker isr - */ -uint8_t TwoWire::endTransmission(bool sendStop) // Assumes Wire.beginTransaction(), Wire.write() -{ - if(transmitting == 1) { - // txlength is howmany bytes in txbuffer have been use - last_error = writeTransmission(txAddress, &txBuffer[txQueued], txLength - txQueued, sendStop); - if(last_error == I2C_ERROR_CONTINUE){ - txQueued = txLength; - } else if( last_error == I2C_ERROR_OK){ - rxIndex = 0; - rxLength = rxQueued; - rxQueued = 0; - txQueued = 0; // the SendStop=true will restart all Queueing - } - } else { - last_error = I2C_ERROR_NO_BEGIN; - flush(); - } - txIndex = 0; - txLength = 0; - transmitting = 0; - return (last_error == I2C_ERROR_CONTINUE)?I2C_ERROR_OK:last_error; // Don't return Continue for compatibility. -} - -/* @stickBreaker 11/2017 fix for ReSTART timeout, ISR - */ -uint8_t TwoWire::requestFrom(uint16_t address, uint8_t size, bool sendStop) -{ - //use internal Wire rxBuffer, multiple requestFrom()'s may be pending, try to share rxBuffer - uint32_t cnt = rxQueued; // currently queued reads, next available position in rxBuffer - if(cnt < (I2C_BUFFER_LENGTH-1) && (size + cnt) <= I2C_BUFFER_LENGTH) { // any room left in rxBuffer - rxQueued += size; - } else { // no room to receive more! - log_e("rxBuff overflow %d", cnt + size); - cnt = 0; - last_error = I2C_ERROR_MEMORY; - flush(); - return cnt; - } - - last_error = readTransmission(address, &rxBuffer[cnt], size, sendStop, &cnt); - rxIndex = 0; - - rxLength = cnt; - - if( last_error != I2C_ERROR_CONTINUE){ // not a buffered ReSTART operation - // so this operation actually moved data, queuing is done. - rxQueued = 0; - txQueued = 0; // the SendStop=true will restart all Queueing or error condition - } - - if(last_error != I2C_ERROR_OK){ // ReSTART on read does not return any data - cnt = 0; - } - - return cnt; -} - -size_t TwoWire::write(uint8_t data) -{ - if(transmitting) { - if(txLength >= I2C_BUFFER_LENGTH) { - last_error = I2C_ERROR_MEMORY; - return 0; - } - txBuffer[txIndex] = data; - ++txIndex; - txLength = txIndex; - return 1; - } - last_error = I2C_ERROR_NO_BEGIN; // no begin, not transmitting - return 0; -} - -size_t TwoWire::write(const uint8_t *data, size_t quantity) -{ - for(size_t i = 0; i < quantity; ++i) { - if(!write(data[i])) { - return i; - } - } - return quantity; - -} - -int TwoWire::available(void) -{ - int result = rxLength - rxIndex; - return result; -} - -int TwoWire::read(void) -{ - int value = -1; - if(rxIndex < rxLength) { - value = rxBuffer[rxIndex]; - ++rxIndex; - } - return value; -} - -int TwoWire::peek(void) -{ - int value = -1; - if(rxIndex < rxLength) { - value = rxBuffer[rxIndex]; - } - return value; -} - -void TwoWire::flush(void) -{ - rxIndex = 0; - rxLength = 0; - txIndex = 0; - txLength = 0; - rxQueued = 0; - txQueued = 0; - i2cFlush(i2c); // cleanup -} - -uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity, uint8_t sendStop) -{ - return requestFrom(static_cast(address), static_cast(quantity), static_cast(sendStop)); -} - -uint8_t TwoWire::requestFrom(uint16_t address, uint8_t quantity, uint8_t sendStop) -{ - return requestFrom(address, static_cast(quantity), static_cast(sendStop)); -} - -uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity) -{ - return requestFrom(static_cast(address), static_cast(quantity), true); -} - -uint8_t TwoWire::requestFrom(uint16_t address, uint8_t quantity) -{ - return requestFrom(address, static_cast(quantity), true); -} - -uint8_t TwoWire::requestFrom(int address, int quantity) -{ - return requestFrom(static_cast(address), static_cast(quantity), true); -} - -uint8_t TwoWire::requestFrom(int address, int quantity, int sendStop) -{ - return static_cast(requestFrom(static_cast(address), static_cast(quantity), static_cast(sendStop))); -} - -void TwoWire::beginTransmission(int address) -{ - beginTransmission(static_cast(address)); -} - -void TwoWire::beginTransmission(uint8_t address) -{ - beginTransmission(static_cast(address)); -} - -uint8_t TwoWire::endTransmission(void) -{ - return endTransmission(true); -} - -/* stickbreaker Nov2017 better error reporting - */ -uint8_t TwoWire::lastError() -{ - return (uint8_t)last_error; -} - -const char ERRORTEXT[] = - "OK\0" - "DEVICE\0" - "ACK\0" - "TIMEOUT\0" - "BUS\0" - "BUSY\0" - "MEMORY\0" - "CONTINUE\0" - "NO_BEGIN\0" - "\0"; - - -char * TwoWire::getErrorText(uint8_t err) -{ - uint8_t t = 0; - bool found = false; - char * message = (char*)&ERRORTEXT; - - while(!found && message[0]) { - found = t == err; - if(!found) { - message = message + strlen(message) + 1; - t++; - } - } - if(!found) { - return NULL; - } else { - return message; - } -} - -/*stickbreaker Dump i2c Interrupt buffer, i2c isr Debugging - */ - -uint32_t TwoWire::setDebugFlags( uint32_t setBits, uint32_t resetBits){ - return i2cDebug(i2c,setBits,resetBits); -} - -bool TwoWire::busy(void){ - return ((i2cGetStatus(i2c) & 16 )==16); -} - -TwoWire Wire = TwoWire(0); -TwoWire Wire1 = TwoWire(1); diff --git a/libraries/Wire/src/Wire.h b/libraries/Wire/src/Wire.h deleted file mode 100644 index 37288beb686..00000000000 --- a/libraries/Wire/src/Wire.h +++ /dev/null @@ -1,149 +0,0 @@ -/* - TwoWire.h - TWI/I2C library for Arduino & Wiring - Copyright (c) 2006 Nicholas Zambetti. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Modified 2012 by Todd Krein (todd@krein.org) to implement repeated starts - Modified December 2014 by Ivan Grokhotkov (ivan@esp8266.com) - esp8266 support - Modified April 2015 by Hrsto Gochkov (ficeto@ficeto.com) - alternative esp8266 support - Modified November 2017 by Chuck Todd to use ISR and increase stability. -*/ - -#ifndef TwoWire_h -#define TwoWire_h - -#include -#include "freertos/FreeRTOS.h" -#include "freertos/queue.h" -#include "Stream.h" - -#define STICKBREAKER 'V1.1.0' -#define I2C_BUFFER_LENGTH 128 -typedef void(*user_onRequest)(void); -typedef void(*user_onReceive)(uint8_t*, int); - -class TwoWire: public Stream -{ -protected: - uint8_t num; - int8_t sda; - int8_t scl; - i2c_t * i2c; - - uint8_t rxBuffer[I2C_BUFFER_LENGTH]; - uint16_t rxIndex; - uint16_t rxLength; - uint16_t rxQueued; //@stickBreaker - - uint8_t txBuffer[I2C_BUFFER_LENGTH]; - uint16_t txIndex; - uint16_t txLength; - uint16_t txAddress; - uint16_t txQueued; //@stickbreaker - - uint8_t transmitting; - /* slave Mode, not yet Stickbreaker - static user_onRequest uReq[2]; - static user_onReceive uRcv[2]; - void onRequestService(void); - void onReceiveService(uint8_t*, int); - */ - i2c_err_t last_error; // @stickBreaker from esp32-hal-i2c.h - uint16_t _timeOutMillis; - -public: - TwoWire(uint8_t bus_num); - ~TwoWire(); - bool begin(int sda=-1, int scl=-1, uint32_t frequency=0); // returns true, if successful init of i2c bus - // calling will attemp to recover hung bus - - void setClock(uint32_t frequency); // change bus clock without initing hardware - size_t getClock(); // current bus clock rate in hz - - void setTimeOut(uint16_t timeOutMillis); // default timeout of i2c transactions is 50ms - uint16_t getTimeOut(); - - uint8_t lastError(); - char * getErrorText(uint8_t err); - - //@stickBreaker for big blocks and ISR model - i2c_err_t writeTransmission(uint16_t address, uint8_t* buff, uint16_t size, bool sendStop=true); - i2c_err_t readTransmission(uint16_t address, uint8_t* buff, uint16_t size, bool sendStop=true, uint32_t *readCount=NULL); - - void beginTransmission(uint16_t address); - void beginTransmission(uint8_t address); - void beginTransmission(int address); - - uint8_t endTransmission(bool sendStop); - uint8_t endTransmission(void); - - uint8_t requestFrom(uint16_t address, uint8_t size, bool sendStop); - uint8_t requestFrom(uint16_t address, uint8_t size, uint8_t sendStop); - uint8_t requestFrom(uint16_t address, uint8_t size); - uint8_t requestFrom(uint8_t address, uint8_t size, uint8_t sendStop); - uint8_t requestFrom(uint8_t address, uint8_t size); - uint8_t requestFrom(int address, int size, int sendStop); - uint8_t requestFrom(int address, int size); - - size_t write(uint8_t); - size_t write(const uint8_t *, size_t); - int available(void); - int read(void); - int peek(void); - void flush(void); - - inline size_t write(const char * s) - { - return write((uint8_t*) s, strlen(s)); - } - inline size_t write(unsigned long n) - { - return write((uint8_t)n); - } - inline size_t write(long n) - { - return write((uint8_t)n); - } - inline size_t write(unsigned int n) - { - return write((uint8_t)n); - } - inline size_t write(int n) - { - return write((uint8_t)n); - } - - void onReceive( void (*)(int) ); - void onRequest( void (*)(void) ); - - uint32_t setDebugFlags( uint32_t setBits, uint32_t resetBits); - bool busy(); -}; - -extern TwoWire Wire; -extern TwoWire Wire1; - - -/* -V1.1.0 08JAN2019 Support CPU Clock frequency changes -V1.0.2 30NOV2018 stop returning I2C_ERROR_CONTINUE on ReSTART operations, regain compatibility with Arduino libs -V1.0.1 02AUG2018 First Fix after release, Correct ReSTART handling, change Debug control, change begin() - to a function, this allow reporting if bus cannot be initialized, Wire.begin() can be used to recover - a hung bus busy condition. -V0.2.2 13APR2018 preserve custom SCL,SDA,Frequency when no parameters passed to begin() -V0.2.1 15MAR2018 Hardware reset, Glitch prevention, adding destructor for second i2c testing -*/ -#endif diff --git a/master_cli_compile/cli_compile_0.json b/master_cli_compile/cli_compile_0.json new file mode 100644 index 00000000000..1b7383aa5f3 --- /dev/null +++ b/master_cli_compile/cli_compile_0.json @@ -0,0 +1,797 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32p4", + "target": "esp32p4", + "sketches": [ +{"name": "ArduinoOTA/examples/BasicOTA", + "sizes": [{ + "flash_bytes": 729019, + "flash_percentage": 55, + "ram_bytes": 33136, + "ram_percentage": 10 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPClient", + "sizes": [{ + "flash_bytes": 650753, + "flash_percentage": 49, + "ram_bytes": 27196, + "ram_percentage": 8 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPMulticastServer", + "sizes": [{ + "flash_bytes": 651011, + "flash_percentage": 49, + "ram_bytes": 27196, + "ram_percentage": 8 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPServer", + "sizes": [{ + "flash_bytes": 650683, + "flash_percentage": 49, + "ram_bytes": 27196, + "ram_percentage": 8 + }] + }, +{"name": "DNSServer/examples/CaptivePortal", + "sizes": [{ + "flash_bytes": 707991, + "flash_percentage": 54, + "ram_bytes": 28864, + "ram_percentage": 8 + }] + }, +{"name": "EEPROM/examples/eeprom_class", + "sizes": [{ + "flash_bytes": 332267, + "flash_percentage": 25, + "ram_bytes": 21596, + "ram_percentage": 6 + }] + }, +{"name": "EEPROM/examples/eeprom_extra", + "sizes": [{ + "flash_bytes": 335313, + "flash_percentage": 25, + "ram_bytes": 21548, + "ram_percentage": 6 + }] + }, +{"name": "EEPROM/examples/eeprom_write", + "sizes": [{ + "flash_bytes": 330821, + "flash_percentage": 25, + "ram_bytes": 21556, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogOut/LEDCFade", + "sizes": [{ + "flash_bytes": 334003, + "flash_percentage": 25, + "ram_bytes": 21660, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogOut/LEDCSingleChannel", + "sizes": [{ + "flash_bytes": 311759, + "flash_percentage": 23, + "ram_bytes": 21656, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogOut/LEDCSoftwareFade", + "sizes": [{ + "flash_bytes": 311817, + "flash_percentage": 23, + "ram_bytes": 21656, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogOut/SigmaDelta", + "sizes": [{ + "flash_bytes": 307281, + "flash_percentage": 23, + "ram_bytes": 21508, + "ram_percentage": 6 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s3", + "target": "esp32s3", + "sketches": [ +{"name": "ArduinoOTA/examples/BasicOTA", + "sizes": [{ + "flash_bytes": 930434, + "flash_percentage": 70, + "ram_bytes": 50356, + "ram_percentage": 15 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPClient", + "sizes": [{ + "flash_bytes": 854562, + "flash_percentage": 65, + "ram_bytes": 44212, + "ram_percentage": 13 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPMulticastServer", + "sizes": [{ + "flash_bytes": 854842, + "flash_percentage": 65, + "ram_bytes": 44212, + "ram_percentage": 13 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPServer", + "sizes": [{ + "flash_bytes": 854534, + "flash_percentage": 65, + "ram_bytes": 44212, + "ram_percentage": 13 + }] + }, +{"name": "BLE/examples/BLE5_extended_scan", + "sizes": [{ + "flash_bytes": 906374, + "flash_percentage": 28, + "ram_bytes": 48292, + "ram_percentage": 14 + }] + }, +{"name": "BLE/examples/BLE5_multi_advertising", + "sizes": [{ + "flash_bytes": 907242, + "flash_percentage": 28, + "ram_bytes": 48668, + "ram_percentage": 14 + }] + }, +{"name": "BLE/examples/BLE5_periodic_advertising", + "sizes": [{ + "flash_bytes": 907006, + "flash_percentage": 28, + "ram_bytes": 48412, + "ram_percentage": 14 + }] + }, +{"name": "BLE/examples/BLE5_periodic_sync", + "sizes": [{ + "flash_bytes": 906926, + "flash_percentage": 28, + "ram_bytes": 48308, + "ram_percentage": 14 + }] + }, +{"name": "BLE/examples/Beacon_Scanner", + "sizes": [{ + "flash_bytes": 912594, + "flash_percentage": 29, + "ram_bytes": 48292, + "ram_percentage": 14 + }] + }, +{"name": "BLE/examples/Client", + "sizes": [{ + "flash_bytes": 924714, + "flash_percentage": 29, + "ram_bytes": 48340, + "ram_percentage": 14 + }] + }, +{"name": "BLE/examples/EddystoneTLM_Beacon", + "sizes": [{ + "flash_bytes": 917410, + "flash_percentage": 29, + "ram_bytes": 48388, + "ram_percentage": 14 + }] + }, +{"name": "BLE/examples/EddystoneURL_Beacon", + "sizes": [{ + "flash_bytes": 917698, + "flash_percentage": 29, + "ram_bytes": 48476, + "ram_percentage": 14 + }] + }, +{"name": "BLE/examples/Notify", + "sizes": [{ + "flash_bytes": 918410, + "flash_percentage": 29, + "ram_bytes": 48308, + "ram_percentage": 14 + }] + }, +{"name": "BLE/examples/Scan", + "sizes": [{ + "flash_bytes": 908670, + "flash_percentage": 28, + "ram_bytes": 48292, + "ram_percentage": 14 + }] + }, +{"name": "BLE/examples/Server", + "sizes": [{ + "flash_bytes": 914654, + "flash_percentage": 29, + "ram_bytes": 48292, + "ram_percentage": 14 + }] + }, +{"name": "BLE/examples/Server_multiconnect", + "sizes": [{ + "flash_bytes": 917822, + "flash_percentage": 29, + "ram_bytes": 48308, + "ram_percentage": 14 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2", + "target": "esp32s2", + "sketches": [ +{"name": "ArduinoOTA/examples/BasicOTA", + "sizes": [{ + "flash_bytes": 895281, + "flash_percentage": 68, + "ram_bytes": 45492, + "ram_percentage": 13 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPClient", + "sizes": [{ + "flash_bytes": 825733, + "flash_percentage": 62, + "ram_bytes": 39408, + "ram_percentage": 12 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPMulticastServer", + "sizes": [{ + "flash_bytes": 826005, + "flash_percentage": 63, + "ram_bytes": 39408, + "ram_percentage": 12 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPServer", + "sizes": [{ + "flash_bytes": 825709, + "flash_percentage": 62, + "ram_bytes": 39408, + "ram_percentage": 12 + }] + }, +{"name": "DNSServer/examples/CaptivePortal", + "sizes": [{ + "flash_bytes": 872765, + "flash_percentage": 66, + "ram_bytes": 41088, + "ram_percentage": 12 + }] + }, +{"name": "EEPROM/examples/eeprom_class", + "sizes": [{ + "flash_bytes": 276685, + "flash_percentage": 21, + "ram_bytes": 15444, + "ram_percentage": 4 + }] + }, +{"name": "EEPROM/examples/eeprom_extra", + "sizes": [{ + "flash_bytes": 278797, + "flash_percentage": 21, + "ram_bytes": 15388, + "ram_percentage": 4 + }] + }, +{"name": "EEPROM/examples/eeprom_write", + "sizes": [{ + "flash_bytes": 275149, + "flash_percentage": 20, + "ram_bytes": 15388, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/AnalogOut/LEDCFade", + "sizes": [{ + "flash_bytes": 278269, + "flash_percentage": 21, + "ram_bytes": 15504, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/AnalogOut/LEDCSingleChannel", + "sizes": [{ + "flash_bytes": 260949, + "flash_percentage": 19, + "ram_bytes": 15488, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/AnalogOut/LEDCSoftwareFade", + "sizes": [{ + "flash_bytes": 261029, + "flash_percentage": 19, + "ram_bytes": 15488, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/AnalogOut/SigmaDelta", + "sizes": [{ + "flash_bytes": 257173, + "flash_percentage": 19, + "ram_bytes": 15356, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/AnalogOut/ledcFrequency", + "sizes": [{ + "flash_bytes": 262969, + "flash_percentage": 20, + "ram_bytes": 15480, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/AnalogOut/ledcWrite_RGB", + "sizes": [{ + "flash_bytes": 274785, + "flash_percentage": 20, + "ram_bytes": 15512, + "ram_percentage": 4 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3", + "target": "esp32c3", + "sketches": [ +{"name": "ArduinoOTA/examples/BasicOTA", + "sizes": [{ + "flash_bytes": 1003782, + "flash_percentage": 76, + "ram_bytes": 41728, + "ram_percentage": 12 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPClient", + "sizes": [{ + "flash_bytes": 920826, + "flash_percentage": 70, + "ram_bytes": 34968, + "ram_percentage": 10 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPMulticastServer", + "sizes": [{ + "flash_bytes": 921206, + "flash_percentage": 70, + "ram_bytes": 34968, + "ram_percentage": 10 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPServer", + "sizes": [{ + "flash_bytes": 920758, + "flash_percentage": 70, + "ram_bytes": 34968, + "ram_percentage": 10 + }] + }, +{"name": "BLE/examples/BLE5_extended_scan", + "sizes": [{ + "flash_bytes": 977006, + "flash_percentage": 31, + "ram_bytes": 38520, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE5_multi_advertising", + "sizes": [{ + "flash_bytes": 978162, + "flash_percentage": 31, + "ram_bytes": 38888, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE5_periodic_advertising", + "sizes": [{ + "flash_bytes": 977932, + "flash_percentage": 31, + "ram_bytes": 38624, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE5_periodic_sync", + "sizes": [{ + "flash_bytes": 977510, + "flash_percentage": 31, + "ram_bytes": 38536, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/Beacon_Scanner", + "sizes": [{ + "flash_bytes": 985226, + "flash_percentage": 31, + "ram_bytes": 38520, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/Client", + "sizes": [{ + "flash_bytes": 998048, + "flash_percentage": 31, + "ram_bytes": 38560, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/EddystoneTLM_Beacon", + "sizes": [{ + "flash_bytes": 987350, + "flash_percentage": 31, + "ram_bytes": 38656, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/EddystoneURL_Beacon", + "sizes": [{ + "flash_bytes": 987902, + "flash_percentage": 31, + "ram_bytes": 38728, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/Notify", + "sizes": [{ + "flash_bytes": 992210, + "flash_percentage": 31, + "ram_bytes": 38536, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/Scan", + "sizes": [{ + "flash_bytes": 979938, + "flash_percentage": 31, + "ram_bytes": 38520, + "ram_percentage": 11 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c6", + "target": "esp32c6", + "sketches": [ +{"name": "ArduinoOTA/examples/BasicOTA", + "sizes": [{ + "flash_bytes": 1011253, + "flash_percentage": 77, + "ram_bytes": 47820, + "ram_percentage": 14 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPClient", + "sizes": [{ + "flash_bytes": 928095, + "flash_percentage": 70, + "ram_bytes": 41052, + "ram_percentage": 12 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPMulticastServer", + "sizes": [{ + "flash_bytes": 928477, + "flash_percentage": 70, + "ram_bytes": 41052, + "ram_percentage": 12 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPServer", + "sizes": [{ + "flash_bytes": 928029, + "flash_percentage": 70, + "ram_bytes": 41052, + "ram_percentage": 12 + }] + }, +{"name": "BLE/examples/BLE5_extended_scan", + "sizes": [{ + "flash_bytes": 1061803, + "flash_percentage": 33, + "ram_bytes": 39224, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE5_multi_advertising", + "sizes": [{ + "flash_bytes": 1062989, + "flash_percentage": 33, + "ram_bytes": 39616, + "ram_percentage": 12 + }] + }, +{"name": "BLE/examples/BLE5_periodic_advertising", + "sizes": [{ + "flash_bytes": 1062773, + "flash_percentage": 33, + "ram_bytes": 39352, + "ram_percentage": 12 + }] + }, +{"name": "BLE/examples/BLE5_periodic_sync", + "sizes": [{ + "flash_bytes": 1062355, + "flash_percentage": 33, + "ram_bytes": 39248, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/Beacon_Scanner", + "sizes": [{ + "flash_bytes": 1070055, + "flash_percentage": 34, + "ram_bytes": 39224, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/Client", + "sizes": [{ + "flash_bytes": 1082845, + "flash_percentage": 34, + "ram_bytes": 39280, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/EddystoneTLM_Beacon", + "sizes": [{ + "flash_bytes": 1074831, + "flash_percentage": 34, + "ram_bytes": 39472, + "ram_percentage": 12 + }] + }, +{"name": "BLE/examples/EddystoneURL_Beacon", + "sizes": [{ + "flash_bytes": 1075375, + "flash_percentage": 34, + "ram_bytes": 39544, + "ram_percentage": 12 + }] + }, +{"name": "BLE/examples/Notify", + "sizes": [{ + "flash_bytes": 1077003, + "flash_percentage": 34, + "ram_bytes": 39240, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/Scan", + "sizes": [{ + "flash_bytes": 1064743, + "flash_percentage": 33, + "ram_bytes": 39224, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/Server", + "sizes": [{ + "flash_bytes": 1072157, + "flash_percentage": 34, + "ram_bytes": 39216, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/Server_multiconnect", + "sizes": [{ + "flash_bytes": 1076337, + "flash_percentage": 34, + "ram_bytes": 39232, + "ram_percentage": 11 + }] + } +] +}, +{ "board": "espressif:esp32:esp32h2", + "target": "esp32h2", + "sketches": [ +{"name": "BLE/examples/BLE5_extended_scan", + "sizes": [{ + "flash_bytes": 1110437, + "flash_percentage": 35, + "ram_bytes": 38184, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE5_multi_advertising", + "sizes": [{ + "flash_bytes": 1111581, + "flash_percentage": 35, + "ram_bytes": 38568, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE5_periodic_advertising", + "sizes": [{ + "flash_bytes": 1111371, + "flash_percentage": 35, + "ram_bytes": 38304, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE5_periodic_sync", + "sizes": [{ + "flash_bytes": 1110949, + "flash_percentage": 35, + "ram_bytes": 38200, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/Beacon_Scanner", + "sizes": [{ + "flash_bytes": 1118657, + "flash_percentage": 35, + "ram_bytes": 38184, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/Client", + "sizes": [{ + "flash_bytes": 1131661, + "flash_percentage": 35, + "ram_bytes": 38224, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/EddystoneTLM_Beacon", + "sizes": [{ + "flash_bytes": 1122663, + "flash_percentage": 35, + "ram_bytes": 38384, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/EddystoneURL_Beacon", + "sizes": [{ + "flash_bytes": 1123215, + "flash_percentage": 35, + "ram_bytes": 38472, + "ram_percentage": 11 + }] + } +] +}, +{ "board": "espressif:esp32:esp32", + "target": "esp32", + "sketches": [ +{"name": "ArduinoOTA/examples/BasicOTA", + "sizes": [{ + "flash_bytes": 955382, + "flash_percentage": 72, + "ram_bytes": 50932, + "ram_percentage": 15 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPClient", + "sizes": [{ + "flash_bytes": 899002, + "flash_percentage": 68, + "ram_bytes": 45124, + "ram_percentage": 13 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPMulticastServer", + "sizes": [{ + "flash_bytes": 899314, + "flash_percentage": 68, + "ram_bytes": 45124, + "ram_percentage": 13 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPServer", + "sizes": [{ + "flash_bytes": 898954, + "flash_percentage": 68, + "ram_bytes": 45124, + "ram_percentage": 13 + }] + }, +{"name": "BLE/examples/Beacon_Scanner", + "sizes": [{ + "flash_bytes": 1115570, + "flash_percentage": 35, + "ram_bytes": 40072, + "ram_percentage": 12 + }] + }, +{"name": "BLE/examples/Client", + "sizes": [{ + "flash_bytes": 1127350, + "flash_percentage": 35, + "ram_bytes": 40112, + "ram_percentage": 12 + }] + }, +{"name": "BLE/examples/EddystoneTLM_Beacon", + "sizes": [{ + "flash_bytes": 1118518, + "flash_percentage": 35, + "ram_bytes": 40220, + "ram_percentage": 12 + }] + }, +{"name": "BLE/examples/EddystoneURL_Beacon", + "sizes": [{ + "flash_bytes": 1118494, + "flash_percentage": 35, + "ram_bytes": 40184, + "ram_percentage": 12 + }] + }, +{"name": "BLE/examples/Notify", + "sizes": [{ + "flash_bytes": 1121302, + "flash_percentage": 35, + "ram_bytes": 40080, + "ram_percentage": 12 + }] + }, +{"name": "BLE/examples/Scan", + "sizes": [{ + "flash_bytes": 1111570, + "flash_percentage": 35, + "ram_bytes": 40072, + "ram_percentage": 12 + }] + }, +{"name": "BLE/examples/Server", + "sizes": [{ + "flash_bytes": 1117378, + "flash_percentage": 35, + "ram_bytes": 40056, + "ram_percentage": 12 + }] + }, +{"name": "BLE/examples/Server_multiconnect", + "sizes": [{ + "flash_bytes": 1120694, + "flash_percentage": 35, + "ram_bytes": 40072, + "ram_percentage": 12 + }] + }, +{"name": "BLE/examples/UART", + "sizes": [{ + "flash_bytes": 1121042, + "flash_percentage": 35, + "ram_bytes": 40072, + "ram_percentage": 12 + }] + }, +{"name": "BLE/examples/Write", + "sizes": [{ + "flash_bytes": 1117810, + "flash_percentage": 35, + "ram_bytes": 40064, + "ram_percentage": 12 + }] + }, +{"name": "BLE/examples/iBeacon", + "sizes": [{ + "flash_bytes": 1123174, + "flash_percentage": 35, + "ram_bytes": 40072, + "ram_percentage": 12 + }] + } +] +} +]} diff --git a/master_cli_compile/cli_compile_1.json b/master_cli_compile/cli_compile_1.json new file mode 100644 index 00000000000..dbd7cabe5a4 --- /dev/null +++ b/master_cli_compile/cli_compile_1.json @@ -0,0 +1,805 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32p4", + "target": "esp32p4", + "sketches": [ +{"name": "ESP32/examples/AnalogOut/ledcFrequency", + "sizes": [{ + "flash_bytes": 314055, + "flash_percentage": 23, + "ram_bytes": 21640, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogOut/ledcWrite_RGB", + "sizes": [{ + "flash_bytes": 329183, + "flash_percentage": 25, + "ram_bytes": 21668, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogRead", + "sizes": [{ + "flash_bytes": 329475, + "flash_percentage": 25, + "ram_bytes": 21616, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogReadContinuous", + "sizes": [{ + "flash_bytes": 336179, + "flash_percentage": 25, + "ram_bytes": 21620, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/ArduinoStackSize", + "sizes": [{ + "flash_bytes": 320361, + "flash_percentage": 24, + "ram_bytes": 21496, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/CI/CIBoardsTest", + "sizes": [{ + "flash_bytes": 355737, + "flash_percentage": 27, + "ram_bytes": 23464, + "ram_percentage": 7 + }] + }, +{"name": "ESP32/examples/ChipID/GetChipID", + "sizes": [{ + "flash_bytes": 322837, + "flash_percentage": 24, + "ram_bytes": 21536, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/DeepSleep/TimerWakeUp", + "sizes": [{ + "flash_bytes": 332113, + "flash_percentage": 25, + "ram_bytes": 21728, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/DeepSleep/TouchWakeUp", + "sizes": [{ + "flash_bytes": 347237, + "flash_percentage": 26, + "ram_bytes": 22076, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/FreeRTOS/BasicMultiThreading", + "sizes": [{ + "flash_bytes": 330157, + "flash_percentage": 25, + "ram_bytes": 21616, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Mutex", + "sizes": [{ + "flash_bytes": 321165, + "flash_percentage": 24, + "ram_bytes": 21512, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Queue", + "sizes": [{ + "flash_bytes": 321301, + "flash_percentage": 24, + "ram_bytes": 21496, + "ram_percentage": 6 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s3", + "target": "esp32s3", + "sketches": [ +{"name": "BLE/examples/UART", + "sizes": [{ + "flash_bytes": 918166, + "flash_percentage": 29, + "ram_bytes": 48308, + "ram_percentage": 14 + }] + }, +{"name": "BLE/examples/Write", + "sizes": [{ + "flash_bytes": 915094, + "flash_percentage": 29, + "ram_bytes": 48292, + "ram_percentage": 14 + }] + }, +{"name": "BLE/examples/iBeacon", + "sizes": [{ + "flash_bytes": 920242, + "flash_percentage": 29, + "ram_bytes": 48308, + "ram_percentage": 14 + }] + }, +{"name": "DNSServer/examples/CaptivePortal", + "sizes": [{ + "flash_bytes": 901290, + "flash_percentage": 68, + "ram_bytes": 45876, + "ram_percentage": 14 + }] + }, +{"name": "EEPROM/examples/eeprom_class", + "sizes": [{ + "flash_bytes": 311938, + "flash_percentage": 23, + "ram_bytes": 20400, + "ram_percentage": 6 + }] + }, +{"name": "EEPROM/examples/eeprom_extra", + "sizes": [{ + "flash_bytes": 314054, + "flash_percentage": 23, + "ram_bytes": 20344, + "ram_percentage": 6 + }] + }, +{"name": "EEPROM/examples/eeprom_write", + "sizes": [{ + "flash_bytes": 310094, + "flash_percentage": 23, + "ram_bytes": 20360, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogOut/LEDCFade", + "sizes": [{ + "flash_bytes": 313514, + "flash_percentage": 23, + "ram_bytes": 20464, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogOut/LEDCSingleChannel", + "sizes": [{ + "flash_bytes": 296330, + "flash_percentage": 22, + "ram_bytes": 20456, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogOut/LEDCSoftwareFade", + "sizes": [{ + "flash_bytes": 296410, + "flash_percentage": 22, + "ram_bytes": 20456, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogOut/SigmaDelta", + "sizes": [{ + "flash_bytes": 292566, + "flash_percentage": 22, + "ram_bytes": 20328, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogOut/ledcFrequency", + "sizes": [{ + "flash_bytes": 298166, + "flash_percentage": 22, + "ram_bytes": 20448, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogOut/ledcWrite_RGB", + "sizes": [{ + "flash_bytes": 309918, + "flash_percentage": 23, + "ram_bytes": 20480, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogRead", + "sizes": [{ + "flash_bytes": 315606, + "flash_percentage": 24, + "ram_bytes": 20648, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogReadContinuous", + "sizes": [{ + "flash_bytes": 323390, + "flash_percentage": 24, + "ram_bytes": 20648, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/ArduinoStackSize", + "sizes": [{ + "flash_bytes": 302754, + "flash_percentage": 23, + "ram_bytes": 20320, + "ram_percentage": 6 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2", + "target": "esp32s2", + "sketches": [ +{"name": "ESP32/examples/AnalogRead", + "sizes": [{ + "flash_bytes": 278997, + "flash_percentage": 21, + "ram_bytes": 15524, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/AnalogReadContinuous", + "sizes": [{ + "flash_bytes": 287121, + "flash_percentage": 21, + "ram_bytes": 15556, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/ArduinoStackSize", + "sizes": [{ + "flash_bytes": 267545, + "flash_percentage": 20, + "ram_bytes": 15348, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/CI/CIBoardsTest", + "sizes": [{ + "flash_bytes": 312785, + "flash_percentage": 23, + "ram_bytes": 17400, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/Camera/CameraWebServer", + "sizes": [{ + "flash_bytes": 971629, + "flash_percentage": 5, + "ram_bytes": 58112, + "ram_percentage": 17 + }] + }, +{"name": "ESP32/examples/Camera/CameraWebServer", + "sizes": [{ + "flash_bytes": 975333, + "flash_percentage": 5, + "ram_bytes": 58148, + "ram_percentage": 17 + }] + }, +{"name": "ESP32/examples/ChipID/GetChipID", + "sizes": [{ + "flash_bytes": 270501, + "flash_percentage": 20, + "ram_bytes": 15396, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/DeepSleep/ExternalWakeUp", + "sizes": [{ + "flash_bytes": 274593, + "flash_percentage": 20, + "ram_bytes": 15420, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/DeepSleep/TimerWakeUp", + "sizes": [{ + "flash_bytes": 274493, + "flash_percentage": 20, + "ram_bytes": 15420, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/DeepSleep/TouchWakeUp", + "sizes": [{ + "flash_bytes": 282133, + "flash_percentage": 21, + "ram_bytes": 16044, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/FreeRTOS/BasicMultiThreading", + "sizes": [{ + "flash_bytes": 298957, + "flash_percentage": 22, + "ram_bytes": 16128, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Mutex", + "sizes": [{ + "flash_bytes": 268561, + "flash_percentage": 20, + "ram_bytes": 15372, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Queue", + "sizes": [{ + "flash_bytes": 268293, + "flash_percentage": 20, + "ram_bytes": 15348, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Semaphore", + "sizes": [{ + "flash_bytes": 267649, + "flash_percentage": 20, + "ram_bytes": 15348, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/GPIO/BlinkRGB", + "sizes": [{ + "flash_bytes": 272773, + "flash_percentage": 20, + "ram_bytes": 15920, + "ram_percentage": 4 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3", + "target": "esp32c3", + "sketches": [ +{"name": "BLE/examples/Server", + "sizes": [{ + "flash_bytes": 987364, + "flash_percentage": 31, + "ram_bytes": 38512, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/Server_multiconnect", + "sizes": [{ + "flash_bytes": 991544, + "flash_percentage": 31, + "ram_bytes": 38528, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/UART", + "sizes": [{ + "flash_bytes": 992092, + "flash_percentage": 31, + "ram_bytes": 38528, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/Write", + "sizes": [{ + "flash_bytes": 987918, + "flash_percentage": 31, + "ram_bytes": 38520, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/iBeacon", + "sizes": [{ + "flash_bytes": 994508, + "flash_percentage": 31, + "ram_bytes": 38528, + "ram_percentage": 11 + }] + }, +{"name": "DNSServer/examples/CaptivePortal", + "sizes": [{ + "flash_bytes": 970756, + "flash_percentage": 74, + "ram_bytes": 36632, + "ram_percentage": 11 + }] + }, +{"name": "EEPROM/examples/eeprom_class", + "sizes": [{ + "flash_bytes": 293662, + "flash_percentage": 22, + "ram_bytes": 11716, + "ram_percentage": 3 + }] + }, +{"name": "EEPROM/examples/eeprom_extra", + "sizes": [{ + "flash_bytes": 296728, + "flash_percentage": 22, + "ram_bytes": 11668, + "ram_percentage": 3 + }] + }, +{"name": "EEPROM/examples/eeprom_write", + "sizes": [{ + "flash_bytes": 292204, + "flash_percentage": 22, + "ram_bytes": 11668, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/AnalogOut/LEDCFade", + "sizes": [{ + "flash_bytes": 294390, + "flash_percentage": 22, + "ram_bytes": 11744, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/AnalogOut/LEDCSingleChannel", + "sizes": [{ + "flash_bytes": 274716, + "flash_percentage": 20, + "ram_bytes": 11736, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/AnalogOut/LEDCSoftwareFade", + "sizes": [{ + "flash_bytes": 274772, + "flash_percentage": 20, + "ram_bytes": 11736, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/AnalogOut/SigmaDelta", + "sizes": [{ + "flash_bytes": 270358, + "flash_percentage": 20, + "ram_bytes": 11620, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/AnalogOut/ledcFrequency", + "sizes": [{ + "flash_bytes": 276646, + "flash_percentage": 21, + "ram_bytes": 11728, + "ram_percentage": 3 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c6", + "target": "esp32c6", + "sketches": [ +{"name": "BLE/examples/UART", + "sizes": [{ + "flash_bytes": 1076883, + "flash_percentage": 34, + "ram_bytes": 39232, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/Write", + "sizes": [{ + "flash_bytes": 1072709, + "flash_percentage": 34, + "ram_bytes": 39224, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/iBeacon", + "sizes": [{ + "flash_bytes": 1079309, + "flash_percentage": 34, + "ram_bytes": 39232, + "ram_percentage": 11 + }] + }, +{"name": "DNSServer/examples/CaptivePortal", + "sizes": [{ + "flash_bytes": 978417, + "flash_percentage": 74, + "ram_bytes": 42716, + "ram_percentage": 13 + }] + }, +{"name": "EEPROM/examples/eeprom_class", + "sizes": [{ + "flash_bytes": 251681, + "flash_percentage": 19, + "ram_bytes": 12880, + "ram_percentage": 3 + }] + }, +{"name": "EEPROM/examples/eeprom_extra", + "sizes": [{ + "flash_bytes": 254751, + "flash_percentage": 19, + "ram_bytes": 12816, + "ram_percentage": 3 + }] + }, +{"name": "EEPROM/examples/eeprom_write", + "sizes": [{ + "flash_bytes": 250177, + "flash_percentage": 19, + "ram_bytes": 12816, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/AnalogOut/LEDCFade", + "sizes": [{ + "flash_bytes": 252893, + "flash_percentage": 19, + "ram_bytes": 12940, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/AnalogOut/LEDCSingleChannel", + "sizes": [{ + "flash_bytes": 231815, + "flash_percentage": 17, + "ram_bytes": 12940, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/AnalogOut/LEDCSoftwareFade", + "sizes": [{ + "flash_bytes": 231873, + "flash_percentage": 17, + "ram_bytes": 12940, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/AnalogOut/SigmaDelta", + "sizes": [{ + "flash_bytes": 227493, + "flash_percentage": 17, + "ram_bytes": 12808, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/AnalogOut/ledcFrequency", + "sizes": [{ + "flash_bytes": 233979, + "flash_percentage": 17, + "ram_bytes": 12940, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/AnalogOut/ledcWrite_RGB", + "sizes": [{ + "flash_bytes": 248199, + "flash_percentage": 18, + "ram_bytes": 12956, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/AnalogRead", + "sizes": [{ + "flash_bytes": 255189, + "flash_percentage": 19, + "ram_bytes": 13120, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/AnalogReadContinuous", + "sizes": [{ + "flash_bytes": 260393, + "flash_percentage": 19, + "ram_bytes": 13120, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/ArduinoStackSize", + "sizes": [{ + "flash_bytes": 239705, + "flash_percentage": 18, + "ram_bytes": 12784, + "ram_percentage": 3 + }] + } +] +}, +{ "board": "espressif:esp32:esp32h2", + "target": "esp32h2", + "sketches": [ +{"name": "BLE/examples/Notify", + "sizes": [{ + "flash_bytes": 1126115, + "flash_percentage": 35, + "ram_bytes": 38200, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/Scan", + "sizes": [{ + "flash_bytes": 1113369, + "flash_percentage": 35, + "ram_bytes": 38184, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/Server", + "sizes": [{ + "flash_bytes": 1120807, + "flash_percentage": 35, + "ram_bytes": 38184, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/Server_multiconnect", + "sizes": [{ + "flash_bytes": 1125449, + "flash_percentage": 35, + "ram_bytes": 38200, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/UART", + "sizes": [{ + "flash_bytes": 1125997, + "flash_percentage": 35, + "ram_bytes": 38200, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/Write", + "sizes": [{ + "flash_bytes": 1121361, + "flash_percentage": 35, + "ram_bytes": 38184, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/iBeacon", + "sizes": [{ + "flash_bytes": 1128415, + "flash_percentage": 35, + "ram_bytes": 38200, + "ram_percentage": 11 + }] + }, +{"name": "EEPROM/examples/eeprom_class", + "sizes": [{ + "flash_bytes": 294813, + "flash_percentage": 9, + "ram_bytes": 12868, + "ram_percentage": 3 + }] + } +] +}, +{ "board": "espressif:esp32:esp32", + "target": "esp32", + "sketches": [ +{"name": "BluetoothSerial/examples/DiscoverConnect", + "sizes": [{ + "flash_bytes": 1094150, + "flash_percentage": 34, + "ram_bytes": 40824, + "ram_percentage": 12 + }] + }, +{"name": "BluetoothSerial/examples/GetLocalMAC", + "sizes": [{ + "flash_bytes": 1092414, + "flash_percentage": 34, + "ram_bytes": 40824, + "ram_percentage": 12 + }] + }, +{"name": "BluetoothSerial/examples/SerialToSerialBT", + "sizes": [{ + "flash_bytes": 1091146, + "flash_percentage": 34, + "ram_bytes": 40824, + "ram_percentage": 12 + }] + }, +{"name": "BluetoothSerial/examples/SerialToSerialBTM", + "sizes": [{ + "flash_bytes": 1092286, + "flash_percentage": 34, + "ram_bytes": 40840, + "ram_percentage": 12 + }] + }, +{"name": "BluetoothSerial/examples/SerialToSerialBT_Legacy", + "sizes": [{ + "flash_bytes": 1091926, + "flash_percentage": 34, + "ram_bytes": 40808, + "ram_percentage": 12 + }] + }, +{"name": "BluetoothSerial/examples/SerialToSerialBT_SSP", + "sizes": [{ + "flash_bytes": 1093938, + "flash_percentage": 34, + "ram_bytes": 40808, + "ram_percentage": 12 + }] + }, +{"name": "BluetoothSerial/examples/bt_classic_device_discovery", + "sizes": [{ + "flash_bytes": 1092474, + "flash_percentage": 34, + "ram_bytes": 40808, + "ram_percentage": 12 + }] + }, +{"name": "BluetoothSerial/examples/bt_remove_paired_devices", + "sizes": [{ + "flash_bytes": 1092402, + "flash_percentage": 34, + "ram_bytes": 40808, + "ram_percentage": 12 + }] + }, +{"name": "DNSServer/examples/CaptivePortal", + "sizes": [{ + "flash_bytes": 946826, + "flash_percentage": 72, + "ram_bytes": 46780, + "ram_percentage": 14 + }] + }, +{"name": "EEPROM/examples/eeprom_class", + "sizes": [{ + "flash_bytes": 313406, + "flash_percentage": 23, + "ram_bytes": 20704, + "ram_percentage": 6 + }] + }, +{"name": "EEPROM/examples/eeprom_extra", + "sizes": [{ + "flash_bytes": 315662, + "flash_percentage": 24, + "ram_bytes": 20640, + "ram_percentage": 6 + }] + }, +{"name": "EEPROM/examples/eeprom_write", + "sizes": [{ + "flash_bytes": 311886, + "flash_percentage": 23, + "ram_bytes": 20748, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogOut/LEDCFade", + "sizes": [{ + "flash_bytes": 315314, + "flash_percentage": 24, + "ram_bytes": 20800, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogOut/LEDCSingleChannel", + "sizes": [{ + "flash_bytes": 298130, + "flash_percentage": 22, + "ram_bytes": 20792, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogOut/LEDCSoftwareFade", + "sizes": [{ + "flash_bytes": 298210, + "flash_percentage": 22, + "ram_bytes": 20792, + "ram_percentage": 6 + }] + } +] +} +]} diff --git a/master_cli_compile/cli_compile_10.json b/master_cli_compile/cli_compile_10.json new file mode 100644 index 00000000000..9df77ede8f0 --- /dev/null +++ b/master_cli_compile/cli_compile_10.json @@ -0,0 +1,797 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32p4", + "target": "esp32p4", + "sketches": [ +{"name": "USB/examples/MIDI/ReceiveMidi", + "sizes": [{ + "flash_bytes": 363653, + "flash_percentage": 27, + "ram_bytes": 49264, + "ram_percentage": 15 + }] + }, +{"name": "USB/examples/Mouse/ButtonMouseControl", + "sizes": [{ + "flash_bytes": 350657, + "flash_percentage": 26, + "ram_bytes": 49292, + "ram_percentage": 15 + }] + }, +{"name": "USB/examples/SystemControl", + "sizes": [{ + "flash_bytes": 350171, + "flash_percentage": 26, + "ram_bytes": 49284, + "ram_percentage": 15 + }] + }, +{"name": "USB/examples/USBMSC", + "sizes": [{ + "flash_bytes": 370489, + "flash_percentage": 28, + "ram_bytes": 57424, + "ram_percentage": 17 + }] + }, +{"name": "USB/examples/USBSerial", + "sizes": [{ + "flash_bytes": 364781, + "flash_percentage": 27, + "ram_bytes": 49144, + "ram_percentage": 14 + }] + }, +{"name": "USB/examples/USBVendor", + "sizes": [{ + "flash_bytes": 370839, + "flash_percentage": 28, + "ram_bytes": 49296, + "ram_percentage": 15 + }] + }, +{"name": "Update/examples/AWS_S3_OTA_Update", + "sizes": [{ + "flash_bytes": 685325, + "flash_percentage": 52, + "ram_bytes": 28804, + "ram_percentage": 8 + }] + }, +{"name": "Update/examples/HTTPS_OTA_Update", + "sizes": [{ + "flash_bytes": 875611, + "flash_percentage": 66, + "ram_bytes": 29628, + "ram_percentage": 9 + }] + }, +{"name": "Update/examples/HTTP_Client_AES_OTA_Update", + "sizes": [{ + "flash_bytes": 729535, + "flash_percentage": 55, + "ram_bytes": 28880, + "ram_percentage": 8 + }] + }, +{"name": "Update/examples/HTTP_Server_AES_OTA_Update", + "sizes": [{ + "flash_bytes": 767959, + "flash_percentage": 58, + "ram_bytes": 31552, + "ram_percentage": 9 + }] + }, +{"name": "Update/examples/OTAWebUpdater", + "sizes": [{ + "flash_bytes": 751237, + "flash_percentage": 57, + "ram_bytes": 31456, + "ram_percentage": 9 + }] + }, +{"name": "Update/examples/SD_Update", + "sizes": [{ + "flash_bytes": 400983, + "flash_percentage": 30, + "ram_bytes": 22400, + "ram_percentage": 6 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s3", + "target": "esp32s3", + "sketches": [ +{"name": "USB/examples/HIDVendor", + "sizes": [{ + "flash_bytes": 377398, + "flash_percentage": 28, + "ram_bytes": 40516, + "ram_percentage": 12 + }] + }, +{"name": "USB/examples/Keyboard/KeyboardLogout", + "sizes": [{ + "flash_bytes": 363354, + "flash_percentage": 27, + "ram_bytes": 40452, + "ram_percentage": 12 + }] + }, +{"name": "USB/examples/Keyboard/KeyboardMessage", + "sizes": [{ + "flash_bytes": 363510, + "flash_percentage": 27, + "ram_bytes": 40452, + "ram_percentage": 12 + }] + }, +{"name": "USB/examples/Keyboard/KeyboardReprogram", + "sizes": [{ + "flash_bytes": 363706, + "flash_percentage": 27, + "ram_bytes": 40444, + "ram_percentage": 12 + }] + }, +{"name": "USB/examples/Keyboard/KeyboardSerial", + "sizes": [{ + "flash_bytes": 375486, + "flash_percentage": 28, + "ram_bytes": 40452, + "ram_percentage": 12 + }] + }, +{"name": "USB/examples/KeyboardAndMouseControl", + "sizes": [{ + "flash_bytes": 376234, + "flash_percentage": 28, + "ram_bytes": 40484, + "ram_percentage": 12 + }] + }, +{"name": "USB/examples/MIDI/MidiController", + "sizes": [{ + "flash_bytes": 383846, + "flash_percentage": 29, + "ram_bytes": 40708, + "ram_percentage": 12 + }] + }, +{"name": "USB/examples/MIDI/MidiInterface", + "sizes": [{ + "flash_bytes": 374306, + "flash_percentage": 28, + "ram_bytes": 40412, + "ram_percentage": 12 + }] + }, +{"name": "USB/examples/MIDI/MidiMusicBox", + "sizes": [{ + "flash_bytes": 374426, + "flash_percentage": 28, + "ram_bytes": 40428, + "ram_percentage": 12 + }] + }, +{"name": "USB/examples/MIDI/ReceiveMidi", + "sizes": [{ + "flash_bytes": 375302, + "flash_percentage": 28, + "ram_bytes": 40412, + "ram_percentage": 12 + }] + }, +{"name": "USB/examples/Mouse/ButtonMouseControl", + "sizes": [{ + "flash_bytes": 362574, + "flash_percentage": 27, + "ram_bytes": 40460, + "ram_percentage": 12 + }] + }, +{"name": "USB/examples/SystemControl", + "sizes": [{ + "flash_bytes": 362194, + "flash_percentage": 27, + "ram_bytes": 40420, + "ram_percentage": 12 + }] + }, +{"name": "USB/examples/USBMSC", + "sizes": [{ + "flash_bytes": 378582, + "flash_percentage": 28, + "ram_bytes": 48580, + "ram_percentage": 14 + }] + }, +{"name": "USB/examples/USBSerial", + "sizes": [{ + "flash_bytes": 373062, + "flash_percentage": 28, + "ram_bytes": 40308, + "ram_percentage": 12 + }] + }, +{"name": "USB/examples/USBVendor", + "sizes": [{ + "flash_bytes": 377506, + "flash_percentage": 28, + "ram_bytes": 40452, + "ram_percentage": 12 + }] + }, +{"name": "Update/examples/AWS_S3_OTA_Update", + "sizes": [{ + "flash_bytes": 897114, + "flash_percentage": 68, + "ram_bytes": 46068, + "ram_percentage": 14 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2", + "target": "esp32s2", + "sketches": [ +{"name": "USB/examples/Keyboard/KeyboardMessage", + "sizes": [{ + "flash_bytes": 304073, + "flash_percentage": 23, + "ram_bytes": 35164, + "ram_percentage": 10 + }] + }, +{"name": "USB/examples/Keyboard/KeyboardReprogram", + "sizes": [{ + "flash_bytes": 304261, + "flash_percentage": 23, + "ram_bytes": 35156, + "ram_percentage": 10 + }] + }, +{"name": "USB/examples/Keyboard/KeyboardSerial", + "sizes": [{ + "flash_bytes": 311897, + "flash_percentage": 23, + "ram_bytes": 34796, + "ram_percentage": 10 + }] + }, +{"name": "USB/examples/KeyboardAndMouseControl", + "sizes": [{ + "flash_bytes": 317025, + "flash_percentage": 24, + "ram_bytes": 35188, + "ram_percentage": 10 + }] + }, +{"name": "USB/examples/MIDI/MidiController", + "sizes": [{ + "flash_bytes": 324785, + "flash_percentage": 24, + "ram_bytes": 35268, + "ram_percentage": 10 + }] + }, +{"name": "USB/examples/MIDI/MidiInterface", + "sizes": [{ + "flash_bytes": 310733, + "flash_percentage": 23, + "ram_bytes": 34756, + "ram_percentage": 10 + }] + }, +{"name": "USB/examples/MIDI/MidiMusicBox", + "sizes": [{ + "flash_bytes": 315237, + "flash_percentage": 24, + "ram_bytes": 35132, + "ram_percentage": 10 + }] + }, +{"name": "USB/examples/MIDI/ReceiveMidi", + "sizes": [{ + "flash_bytes": 311741, + "flash_percentage": 23, + "ram_bytes": 34756, + "ram_percentage": 10 + }] + }, +{"name": "USB/examples/Mouse/ButtonMouseControl", + "sizes": [{ + "flash_bytes": 303137, + "flash_percentage": 23, + "ram_bytes": 35172, + "ram_percentage": 10 + }] + }, +{"name": "USB/examples/SystemControl", + "sizes": [{ + "flash_bytes": 302749, + "flash_percentage": 23, + "ram_bytes": 35132, + "ram_percentage": 10 + }] + }, +{"name": "USB/examples/USBMSC", + "sizes": [{ + "flash_bytes": 315113, + "flash_percentage": 24, + "ram_bytes": 42924, + "ram_percentage": 13 + }] + }, +{"name": "USB/examples/USBSerial", + "sizes": [{ + "flash_bytes": 309585, + "flash_percentage": 23, + "ram_bytes": 34636, + "ram_percentage": 10 + }] + }, +{"name": "USB/examples/USBVendor", + "sizes": [{ + "flash_bytes": 318433, + "flash_percentage": 24, + "ram_bytes": 35156, + "ram_percentage": 10 + }] + }, +{"name": "Update/examples/AWS_S3_OTA_Update", + "sizes": [{ + "flash_bytes": 861813, + "flash_percentage": 65, + "ram_bytes": 41220, + "ram_percentage": 12 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3", + "target": "esp32c3", + "sketches": [ +{"name": "SimpleBLE/examples/SimpleBleDevice", + "sizes": [{ + "flash_bytes": 953430, + "flash_percentage": 72, + "ram_bytes": 38512, + "ram_percentage": 11 + }] + }, +{"name": "TFLiteMicro/examples/hello_world", + "sizes": [{ + "flash_bytes": 305702, + "flash_percentage": 23, + "ram_bytes": 13916, + "ram_percentage": 4 + }] + }, +{"name": "Ticker/examples/Blinker", + "sizes": [{ + "flash_bytes": 292814, + "flash_percentage": 22, + "ram_bytes": 12912, + "ram_percentage": 3 + }] + }, +{"name": "Ticker/examples/TickerBasic", + "sizes": [{ + "flash_bytes": 292588, + "flash_percentage": 22, + "ram_bytes": 12880, + "ram_percentage": 3 + }] + }, +{"name": "Ticker/examples/TickerParameter", + "sizes": [{ + "flash_bytes": 292466, + "flash_percentage": 22, + "ram_bytes": 12904, + "ram_percentage": 3 + }] + }, +{"name": "Update/examples/AWS_S3_OTA_Update", + "sizes": [{ + "flash_bytes": 963850, + "flash_percentage": 73, + "ram_bytes": 37408, + "ram_percentage": 11 + }] + }, +{"name": "Update/examples/HTTPS_OTA_Update", + "sizes": [{ + "flash_bytes": 1056188, + "flash_percentage": 80, + "ram_bytes": 37096, + "ram_percentage": 11 + }] + }, +{"name": "Update/examples/HTTP_Client_AES_OTA_Update", + "sizes": [{ + "flash_bytes": 1008078, + "flash_percentage": 76, + "ram_bytes": 37472, + "ram_percentage": 11 + }] + }, +{"name": "Update/examples/HTTP_Server_AES_OTA_Update", + "sizes": [{ + "flash_bytes": 1043762, + "flash_percentage": 79, + "ram_bytes": 40152, + "ram_percentage": 12 + }] + }, +{"name": "Update/examples/OTAWebUpdater", + "sizes": [{ + "flash_bytes": 1026772, + "flash_percentage": 78, + "ram_bytes": 40048, + "ram_percentage": 12 + }] + }, +{"name": "Update/examples/SD_Update", + "sizes": [{ + "flash_bytes": 378418, + "flash_percentage": 28, + "ram_bytes": 13464, + "ram_percentage": 4 + }] + }, +{"name": "WebServer/examples/AdvancedWebServer", + "sizes": [{ + "flash_bytes": 1017994, + "flash_percentage": 77, + "ram_bytes": 39808, + "ram_percentage": 12 + }] + }, +{"name": "WebServer/examples/FSBrowser", + "sizes": [{ + "flash_bytes": 1052146, + "flash_percentage": 80, + "ram_bytes": 39032, + "ram_percentage": 11 + }] + }, +{"name": "WebServer/examples/Filters", + "sizes": [{ + "flash_bytes": 1019018, + "flash_percentage": 77, + "ram_bytes": 39816, + "ram_percentage": 12 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c6", + "target": "esp32c6", + "sketches": [ +{"name": "WebServer/examples/AdvancedWebServer", + "sizes": [{ + "flash_bytes": 1025645, + "flash_percentage": 78, + "ram_bytes": 45884, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/FSBrowser", + "sizes": [{ + "flash_bytes": 1062935, + "flash_percentage": 81, + "ram_bytes": 45308, + "ram_percentage": 13 + }] + }, +{"name": "WebServer/examples/Filters", + "sizes": [{ + "flash_bytes": 1026647, + "flash_percentage": 78, + "ram_bytes": 45892, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/HelloServer", + "sizes": [{ + "flash_bytes": 1024421, + "flash_percentage": 78, + "ram_bytes": 45884, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/HttpAdvancedAuth", + "sizes": [{ + "flash_bytes": 1044567, + "flash_percentage": 79, + "ram_bytes": 48212, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/HttpAuthCallback", + "sizes": [{ + "flash_bytes": 1045259, + "flash_percentage": 79, + "ram_bytes": 48348, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/HttpAuthCallbackInline", + "sizes": [{ + "flash_bytes": 1044573, + "flash_percentage": 79, + "ram_bytes": 48236, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/HttpBasicAuth", + "sizes": [{ + "flash_bytes": 1044625, + "flash_percentage": 79, + "ram_bytes": 48196, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/HttpBasicAuthSHA1", + "sizes": [{ + "flash_bytes": 1053885, + "flash_percentage": 80, + "ram_bytes": 48212, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/HttpBasicAuthSHA1orBearerToken", + "sizes": [{ + "flash_bytes": 1054427, + "flash_percentage": 80, + "ram_bytes": 48228, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/Middleware", + "sizes": [{ + "flash_bytes": 996773, + "flash_percentage": 76, + "ram_bytes": 42796, + "ram_percentage": 13 + }] + }, +{"name": "WebServer/examples/MultiHomedServers", + "sizes": [{ + "flash_bytes": 1027417, + "flash_percentage": 78, + "ram_bytes": 45548, + "ram_percentage": 13 + }] + }, +{"name": "WebServer/examples/PathArgServer", + "sizes": [{ + "flash_bytes": 1294189, + "flash_percentage": 41, + "ram_bytes": 50308, + "ram_percentage": 15 + }] + }, +{"name": "WebServer/examples/SDWebServer", + "sizes": [{ + "flash_bytes": 1082551, + "flash_percentage": 82, + "ram_bytes": 46164, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/SimpleAuthentification", + "sizes": [{ + "flash_bytes": 975411, + "flash_percentage": 74, + "ram_bytes": 42620, + "ram_percentage": 13 + }] + }, +{"name": "WebServer/examples/UploadHugeFile", + "sizes": [{ + "flash_bytes": 1328801, + "flash_percentage": 42, + "ram_bytes": 49020, + "ram_percentage": 14 + }] + } +] +}, +{ "board": "espressif:esp32:esp32h2", + "target": "esp32h2", + "sketches": [ +{"name": "OpenThread/examples/onReceive", + "sizes": [{ + "flash_bytes": 1086973, + "flash_percentage": 82, + "ram_bytes": 45588, + "ram_percentage": 13 + }] + }, +{"name": "PPP/examples/PPP_Basic", + "sizes": [{ + "flash_bytes": 548325, + "flash_percentage": 41, + "ram_bytes": 18704, + "ram_percentage": 5 + }] + }, +{"name": "Preferences/examples/Prefs2Struct", + "sizes": [{ + "flash_bytes": 292407, + "flash_percentage": 22, + "ram_bytes": 12796, + "ram_percentage": 3 + }] + }, +{"name": "Preferences/examples/StartCounter", + "sizes": [{ + "flash_bytes": 292141, + "flash_percentage": 22, + "ram_bytes": 12796, + "ram_percentage": 3 + }] + }, +{"name": "SD/examples/SD_Test", + "sizes": [{ + "flash_bytes": 374065, + "flash_percentage": 28, + "ram_bytes": 14784, + "ram_percentage": 4 + }] + }, +{"name": "SPI/examples/SPI_Multiple_Buses", + "sizes": [{ + "flash_bytes": 296949, + "flash_percentage": 22, + "ram_bytes": 14080, + "ram_percentage": 4 + }] + }, +{"name": "SPIFFS/examples/SPIFFS_Test", + "sizes": [{ + "flash_bytes": 325923, + "flash_percentage": 24, + "ram_bytes": 13308, + "ram_percentage": 4 + }] + }, +{"name": "SimpleBLE/examples/SimpleBleDevice", + "sizes": [{ + "flash_bytes": 1087139, + "flash_percentage": 82, + "ram_bytes": 38208, + "ram_percentage": 11 + }] + } +] +}, +{ "board": "espressif:esp32:esp32", + "target": "esp32", + "sketches": [ +{"name": "SimpleBLE/examples/SimpleBleDevice", + "sizes": [{ + "flash_bytes": 1083978, + "flash_percentage": 82, + "ram_bytes": 39768, + "ram_percentage": 12 + }] + }, +{"name": "TFLiteMicro/examples/hello_world", + "sizes": [{ + "flash_bytes": 326542, + "flash_percentage": 24, + "ram_bytes": 22912, + "ram_percentage": 6 + }] + }, +{"name": "Ticker/examples/Blinker", + "sizes": [{ + "flash_bytes": 295722, + "flash_percentage": 22, + "ram_bytes": 20656, + "ram_percentage": 6 + }] + }, +{"name": "Ticker/examples/TickerBasic", + "sizes": [{ + "flash_bytes": 295510, + "flash_percentage": 22, + "ram_bytes": 20600, + "ram_percentage": 6 + }] + }, +{"name": "Ticker/examples/TickerParameter", + "sizes": [{ + "flash_bytes": 295450, + "flash_percentage": 22, + "ram_bytes": 20640, + "ram_percentage": 6 + }] + }, +{"name": "Update/examples/AWS_S3_OTA_Update", + "sizes": [{ + "flash_bytes": 922006, + "flash_percentage": 70, + "ram_bytes": 46620, + "ram_percentage": 14 + }] + }, +{"name": "Update/examples/HTTPS_OTA_Update", + "sizes": [{ + "flash_bytes": 1020798, + "flash_percentage": 77, + "ram_bytes": 47212, + "ram_percentage": 14 + }] + }, +{"name": "Update/examples/HTTP_Client_AES_OTA_Update", + "sizes": [{ + "flash_bytes": 965466, + "flash_percentage": 73, + "ram_bytes": 48036, + "ram_percentage": 14 + }] + }, +{"name": "Update/examples/HTTP_Server_AES_OTA_Update", + "sizes": [{ + "flash_bytes": 994402, + "flash_percentage": 75, + "ram_bytes": 49364, + "ram_percentage": 15 + }] + }, +{"name": "Update/examples/OTAWebUpdater", + "sizes": [{ + "flash_bytes": 980878, + "flash_percentage": 74, + "ram_bytes": 49352, + "ram_percentage": 15 + }] + }, +{"name": "Update/examples/SD_Update", + "sizes": [{ + "flash_bytes": 372778, + "flash_percentage": 28, + "ram_bytes": 21348, + "ram_percentage": 6 + }] + }, +{"name": "WebServer/examples/AdvancedWebServer", + "sizes": [{ + "flash_bytes": 974794, + "flash_percentage": 74, + "ram_bytes": 49120, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/FSBrowser", + "sizes": [{ + "flash_bytes": 1018502, + "flash_percentage": 77, + "ram_bytes": 49180, + "ram_percentage": 15 + }] + }, +{"name": "WebServer/examples/Filters", + "sizes": [{ + "flash_bytes": 975070, + "flash_percentage": 74, + "ram_bytes": 49028, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/HelloServer", + "sizes": [{ + "flash_bytes": 973254, + "flash_percentage": 74, + "ram_bytes": 49012, + "ram_percentage": 14 + }] + } +] +} +]} diff --git a/master_cli_compile/cli_compile_11.json b/master_cli_compile/cli_compile_11.json new file mode 100644 index 00000000000..9bbfb6c7bca --- /dev/null +++ b/master_cli_compile/cli_compile_11.json @@ -0,0 +1,797 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32p4", + "target": "esp32p4", + "sketches": [ +{"name": "WebServer/examples/AdvancedWebServer", + "sizes": [{ + "flash_bytes": 736467, + "flash_percentage": 56, + "ram_bytes": 31132, + "ram_percentage": 9 + }] + }, +{"name": "WebServer/examples/FSBrowser", + "sizes": [{ + "flash_bytes": 788175, + "flash_percentage": 60, + "ram_bytes": 31276, + "ram_percentage": 9 + }] + }, +{"name": "WebServer/examples/Filters", + "sizes": [{ + "flash_bytes": 737481, + "flash_percentage": 56, + "ram_bytes": 31132, + "ram_percentage": 9 + }] + }, +{"name": "WebServer/examples/HelloServer", + "sizes": [{ + "flash_bytes": 735257, + "flash_percentage": 56, + "ram_bytes": 31132, + "ram_percentage": 9 + }] + }, +{"name": "WebServer/examples/HttpAdvancedAuth", + "sizes": [{ + "flash_bytes": 762473, + "flash_percentage": 58, + "ram_bytes": 33520, + "ram_percentage": 10 + }] + }, +{"name": "WebServer/examples/HttpAuthCallback", + "sizes": [{ + "flash_bytes": 763157, + "flash_percentage": 58, + "ram_bytes": 33664, + "ram_percentage": 10 + }] + }, +{"name": "WebServer/examples/HttpAuthCallbackInline", + "sizes": [{ + "flash_bytes": 762491, + "flash_percentage": 58, + "ram_bytes": 33568, + "ram_percentage": 10 + }] + }, +{"name": "WebServer/examples/HttpBasicAuth", + "sizes": [{ + "flash_bytes": 762515, + "flash_percentage": 58, + "ram_bytes": 33504, + "ram_percentage": 10 + }] + }, +{"name": "WebServer/examples/HttpBasicAuthSHA1", + "sizes": [{ + "flash_bytes": 771771, + "flash_percentage": 58, + "ram_bytes": 33504, + "ram_percentage": 10 + }] + }, +{"name": "WebServer/examples/HttpBasicAuthSHA1orBearerToken", + "sizes": [{ + "flash_bytes": 772325, + "flash_percentage": 58, + "ram_bytes": 33536, + "ram_percentage": 10 + }] + }, +{"name": "WebServer/examples/MultiHomedServers", + "sizes": [{ + "flash_bytes": 738231, + "flash_percentage": 56, + "ram_bytes": 30772, + "ram_percentage": 9 + }] + }, +{"name": "WebServer/examples/PathArgServer", + "sizes": [{ + "flash_bytes": 1028425, + "flash_percentage": 32, + "ram_bytes": 36480, + "ram_percentage": 11 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s3", + "target": "esp32s3", + "sketches": [ +{"name": "Update/examples/HTTPS_OTA_Update", + "sizes": [{ + "flash_bytes": 977546, + "flash_percentage": 74, + "ram_bytes": 46316, + "ram_percentage": 14 + }] + }, +{"name": "Update/examples/HTTP_Client_AES_OTA_Update", + "sizes": [{ + "flash_bytes": 940966, + "flash_percentage": 71, + "ram_bytes": 46156, + "ram_percentage": 14 + }] + }, +{"name": "Update/examples/HTTP_Server_AES_OTA_Update", + "sizes": [{ + "flash_bytes": 969250, + "flash_percentage": 73, + "ram_bytes": 48780, + "ram_percentage": 14 + }] + }, +{"name": "Update/examples/OTAWebUpdater", + "sizes": [{ + "flash_bytes": 955578, + "flash_percentage": 72, + "ram_bytes": 48676, + "ram_percentage": 14 + }] + }, +{"name": "Update/examples/SD_Update", + "sizes": [{ + "flash_bytes": 396694, + "flash_percentage": 30, + "ram_bytes": 21620, + "ram_percentage": 6 + }] + }, +{"name": "WebServer/examples/AdvancedWebServer", + "sizes": [{ + "flash_bytes": 948314, + "flash_percentage": 72, + "ram_bytes": 48476, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/FSBrowser", + "sizes": [{ + "flash_bytes": 973342, + "flash_percentage": 74, + "ram_bytes": 48468, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/Filters", + "sizes": [{ + "flash_bytes": 948910, + "flash_percentage": 72, + "ram_bytes": 48476, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/HelloServer", + "sizes": [{ + "flash_bytes": 947110, + "flash_percentage": 72, + "ram_bytes": 48476, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/HttpAdvancedAuth", + "sizes": [{ + "flash_bytes": 965846, + "flash_percentage": 73, + "ram_bytes": 50740, + "ram_percentage": 15 + }] + }, +{"name": "WebServer/examples/HttpAuthCallback", + "sizes": [{ + "flash_bytes": 966446, + "flash_percentage": 73, + "ram_bytes": 50884, + "ram_percentage": 15 + }] + }, +{"name": "WebServer/examples/HttpAuthCallbackInline", + "sizes": [{ + "flash_bytes": 965882, + "flash_percentage": 73, + "ram_bytes": 50772, + "ram_percentage": 15 + }] + }, +{"name": "WebServer/examples/HttpBasicAuth", + "sizes": [{ + "flash_bytes": 965878, + "flash_percentage": 73, + "ram_bytes": 50724, + "ram_percentage": 15 + }] + }, +{"name": "WebServer/examples/HttpBasicAuthSHA1", + "sizes": [{ + "flash_bytes": 973018, + "flash_percentage": 74, + "ram_bytes": 50740, + "ram_percentage": 15 + }] + }, +{"name": "WebServer/examples/HttpBasicAuthSHA1orBearerToken", + "sizes": [{ + "flash_bytes": 973574, + "flash_percentage": 74, + "ram_bytes": 50756, + "ram_percentage": 15 + }] + }, +{"name": "WebServer/examples/Middleware", + "sizes": [{ + "flash_bytes": 915958, + "flash_percentage": 69, + "ram_bytes": 45964, + "ram_percentage": 14 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2", + "target": "esp32s2", + "sketches": [ +{"name": "Update/examples/HTTPS_OTA_Update", + "sizes": [{ + "flash_bytes": 949209, + "flash_percentage": 72, + "ram_bytes": 41528, + "ram_percentage": 12 + }] + }, +{"name": "Update/examples/HTTP_Client_AES_OTA_Update", + "sizes": [{ + "flash_bytes": 905653, + "flash_percentage": 69, + "ram_bytes": 41300, + "ram_percentage": 12 + }] + }, +{"name": "Update/examples/HTTP_Server_AES_OTA_Update", + "sizes": [{ + "flash_bytes": 934861, + "flash_percentage": 71, + "ram_bytes": 43924, + "ram_percentage": 13 + }] + }, +{"name": "Update/examples/OTAWebUpdater", + "sizes": [{ + "flash_bytes": 921109, + "flash_percentage": 70, + "ram_bytes": 43812, + "ram_percentage": 13 + }] + }, +{"name": "Update/examples/SD_Update", + "sizes": [{ + "flash_bytes": 354045, + "flash_percentage": 27, + "ram_bytes": 16624, + "ram_percentage": 5 + }] + }, +{"name": "WebServer/examples/AdvancedWebServer", + "sizes": [{ + "flash_bytes": 914185, + "flash_percentage": 69, + "ram_bytes": 43620, + "ram_percentage": 13 + }] + }, +{"name": "WebServer/examples/FSBrowser", + "sizes": [{ + "flash_bytes": 942169, + "flash_percentage": 71, + "ram_bytes": 43504, + "ram_percentage": 13 + }] + }, +{"name": "WebServer/examples/Filters", + "sizes": [{ + "flash_bytes": 914361, + "flash_percentage": 69, + "ram_bytes": 43620, + "ram_percentage": 13 + }] + }, +{"name": "WebServer/examples/HelloServer", + "sizes": [{ + "flash_bytes": 912657, + "flash_percentage": 69, + "ram_bytes": 43620, + "ram_percentage": 13 + }] + }, +{"name": "WebServer/examples/HttpAdvancedAuth", + "sizes": [{ + "flash_bytes": 931473, + "flash_percentage": 71, + "ram_bytes": 45892, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/HttpAuthCallback", + "sizes": [{ + "flash_bytes": 932053, + "flash_percentage": 71, + "ram_bytes": 46020, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/HttpAuthCallbackInline", + "sizes": [{ + "flash_bytes": 931493, + "flash_percentage": 71, + "ram_bytes": 45908, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/HttpBasicAuth", + "sizes": [{ + "flash_bytes": 931517, + "flash_percentage": 71, + "ram_bytes": 45876, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/HttpBasicAuthSHA1", + "sizes": [{ + "flash_bytes": 938885, + "flash_percentage": 71, + "ram_bytes": 45892, + "ram_percentage": 14 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3", + "target": "esp32c3", + "sketches": [ +{"name": "WebServer/examples/HelloServer", + "sizes": [{ + "flash_bytes": 1016776, + "flash_percentage": 77, + "ram_bytes": 39808, + "ram_percentage": 12 + }] + }, +{"name": "WebServer/examples/HttpAdvancedAuth", + "sizes": [{ + "flash_bytes": 1037164, + "flash_percentage": 79, + "ram_bytes": 42120, + "ram_percentage": 12 + }] + }, +{"name": "WebServer/examples/HttpAuthCallback", + "sizes": [{ + "flash_bytes": 1037834, + "flash_percentage": 79, + "ram_bytes": 42256, + "ram_percentage": 12 + }] + }, +{"name": "WebServer/examples/HttpAuthCallbackInline", + "sizes": [{ + "flash_bytes": 1037206, + "flash_percentage": 79, + "ram_bytes": 42144, + "ram_percentage": 12 + }] + }, +{"name": "WebServer/examples/HttpBasicAuth", + "sizes": [{ + "flash_bytes": 1037216, + "flash_percentage": 79, + "ram_bytes": 42104, + "ram_percentage": 12 + }] + }, +{"name": "WebServer/examples/HttpBasicAuthSHA1", + "sizes": [{ + "flash_bytes": 1046494, + "flash_percentage": 79, + "ram_bytes": 42120, + "ram_percentage": 12 + }] + }, +{"name": "WebServer/examples/HttpBasicAuthSHA1orBearerToken", + "sizes": [{ + "flash_bytes": 1047020, + "flash_percentage": 79, + "ram_bytes": 42136, + "ram_percentage": 12 + }] + }, +{"name": "WebServer/examples/Middleware", + "sizes": [{ + "flash_bytes": 989082, + "flash_percentage": 75, + "ram_bytes": 36712, + "ram_percentage": 11 + }] + }, +{"name": "WebServer/examples/MultiHomedServers", + "sizes": [{ + "flash_bytes": 1019748, + "flash_percentage": 77, + "ram_bytes": 39456, + "ram_percentage": 12 + }] + }, +{"name": "WebServer/examples/PathArgServer", + "sizes": [{ + "flash_bytes": 1289670, + "flash_percentage": 40, + "ram_bytes": 44216, + "ram_percentage": 13 + }] + }, +{"name": "WebServer/examples/SDWebServer", + "sizes": [{ + "flash_bytes": 1085336, + "flash_percentage": 82, + "ram_bytes": 40080, + "ram_percentage": 12 + }] + }, +{"name": "WebServer/examples/SimpleAuthentification", + "sizes": [{ + "flash_bytes": 967744, + "flash_percentage": 73, + "ram_bytes": 36536, + "ram_percentage": 11 + }] + }, +{"name": "WebServer/examples/UploadHugeFile", + "sizes": [{ + "flash_bytes": 1324450, + "flash_percentage": 42, + "ram_bytes": 42952, + "ram_percentage": 13 + }] + }, +{"name": "WebServer/examples/WebServer", + "sizes": [{ + "flash_bytes": 1077492, + "flash_percentage": 82, + "ram_bytes": 36992, + "ram_percentage": 11 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c6", + "target": "esp32c6", + "sketches": [ +{"name": "WebServer/examples/WebServer", + "sizes": [{ + "flash_bytes": 1074743, + "flash_percentage": 81, + "ram_bytes": 43084, + "ram_percentage": 13 + }] + }, +{"name": "WebServer/examples/WebUpdate", + "sizes": [{ + "flash_bytes": 1029121, + "flash_percentage": 78, + "ram_bytes": 46116, + "ram_percentage": 14 + }] + }, +{"name": "WiFi/examples/FTM/FTM_Initiator", + "sizes": [{ + "flash_bytes": 925167, + "flash_percentage": 70, + "ram_bytes": 41004, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/FTM/FTM_Responder", + "sizes": [{ + "flash_bytes": 922815, + "flash_percentage": 70, + "ram_bytes": 40996, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/SimpleWiFiServer", + "sizes": [{ + "flash_bytes": 964517, + "flash_percentage": 73, + "ram_bytes": 43228, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WPS", + "sizes": [{ + "flash_bytes": 947417, + "flash_percentage": 72, + "ram_bytes": 41052, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiAccessPoint", + "sizes": [{ + "flash_bytes": 965137, + "flash_percentage": 73, + "ram_bytes": 43228, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiBlueToothSwitch", + "sizes": [{ + "flash_bytes": 1158387, + "flash_percentage": 88, + "ram_bytes": 41960, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiClient", + "sizes": [{ + "flash_bytes": 942187, + "flash_percentage": 71, + "ram_bytes": 42316, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiClientBasic", + "sizes": [{ + "flash_bytes": 944005, + "flash_percentage": 72, + "ram_bytes": 42308, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiClientConnect", + "sizes": [{ + "flash_bytes": 926439, + "flash_percentage": 70, + "ram_bytes": 41012, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiClientEnterprise", + "sizes": [{ + "flash_bytes": 1045835, + "flash_percentage": 79, + "ram_bytes": 42932, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiClientEvents", + "sizes": [{ + "flash_bytes": 926563, + "flash_percentage": 70, + "ram_bytes": 40996, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiClientStaticIP", + "sizes": [{ + "flash_bytes": 942227, + "flash_percentage": 71, + "ram_bytes": 42404, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiExtender", + "sizes": [{ + "flash_bytes": 925683, + "flash_percentage": 70, + "ram_bytes": 41108, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiIPv6", + "sizes": [{ + "flash_bytes": 940007, + "flash_percentage": 71, + "ram_bytes": 42676, + "ram_percentage": 13 + }] + } +] +}, +{ "board": "espressif:esp32:esp32h2", + "target": "esp32h2", + "sketches": [ +{"name": "TFLiteMicro/examples/hello_world", + "sizes": [{ + "flash_bytes": 307993, + "flash_percentage": 23, + "ram_bytes": 15084, + "ram_percentage": 4 + }] + }, +{"name": "Ticker/examples/Blinker", + "sizes": [{ + "flash_bytes": 293757, + "flash_percentage": 22, + "ram_bytes": 14088, + "ram_percentage": 4 + }] + }, +{"name": "Ticker/examples/TickerBasic", + "sizes": [{ + "flash_bytes": 293549, + "flash_percentage": 22, + "ram_bytes": 14056, + "ram_percentage": 4 + }] + }, +{"name": "Ticker/examples/TickerParameter", + "sizes": [{ + "flash_bytes": 293421, + "flash_percentage": 22, + "ram_bytes": 14088, + "ram_percentage": 4 + }] + }, +{"name": "Update/examples/SD_Update", + "sizes": [{ + "flash_bytes": 379819, + "flash_percentage": 28, + "ram_bytes": 14632, + "ram_percentage": 4 + }] + }, +{"name": "Wire/examples/WireMaster", + "sizes": [{ + "flash_bytes": 311079, + "flash_percentage": 23, + "ram_bytes": 14120, + "ram_percentage": 4 + }] + }, +{"name": "Wire/examples/WireScan", + "sizes": [{ + "flash_bytes": 310839, + "flash_percentage": 23, + "ram_bytes": 14120, + "ram_percentage": 4 + }] + }, +{"name": "Wire/examples/WireSlave", + "sizes": [{ + "flash_bytes": 311073, + "flash_percentage": 23, + "ram_bytes": 14120, + "ram_percentage": 4 + }] + } +] +}, +{ "board": "espressif:esp32:esp32", + "target": "esp32", + "sketches": [ +{"name": "WebServer/examples/HttpAdvancedAuth", + "sizes": [{ + "flash_bytes": 991086, + "flash_percentage": 75, + "ram_bytes": 51324, + "ram_percentage": 15 + }] + }, +{"name": "WebServer/examples/HttpAuthCallback", + "sizes": [{ + "flash_bytes": 991678, + "flash_percentage": 75, + "ram_bytes": 51452, + "ram_percentage": 15 + }] + }, +{"name": "WebServer/examples/HttpAuthCallbackInline", + "sizes": [{ + "flash_bytes": 991106, + "flash_percentage": 75, + "ram_bytes": 51340, + "ram_percentage": 15 + }] + }, +{"name": "WebServer/examples/HttpBasicAuth", + "sizes": [{ + "flash_bytes": 991138, + "flash_percentage": 75, + "ram_bytes": 51308, + "ram_percentage": 15 + }] + }, +{"name": "WebServer/examples/HttpBasicAuthSHA1", + "sizes": [{ + "flash_bytes": 998446, + "flash_percentage": 76, + "ram_bytes": 51324, + "ram_percentage": 15 + }] + }, +{"name": "WebServer/examples/HttpBasicAuthSHA1orBearerToken", + "sizes": [{ + "flash_bytes": 999006, + "flash_percentage": 76, + "ram_bytes": 51348, + "ram_percentage": 15 + }] + }, +{"name": "WebServer/examples/Middleware", + "sizes": [{ + "flash_bytes": 961670, + "flash_percentage": 73, + "ram_bytes": 46868, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/MultiHomedServers", + "sizes": [{ + "flash_bytes": 975926, + "flash_percentage": 74, + "ram_bytes": 48660, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/PathArgServer", + "sizes": [{ + "flash_bytes": 1257290, + "flash_percentage": 39, + "ram_bytes": 55360, + "ram_percentage": 16 + }] + }, +{"name": "WebServer/examples/SDWebServer", + "sizes": [{ + "flash_bytes": 1033990, + "flash_percentage": 78, + "ram_bytes": 49600, + "ram_percentage": 15 + }] + }, +{"name": "WebServer/examples/SimpleAuthentification", + "sizes": [{ + "flash_bytes": 944034, + "flash_percentage": 72, + "ram_bytes": 46700, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/UploadHugeFile", + "sizes": [{ + "flash_bytes": 1273606, + "flash_percentage": 40, + "ram_bytes": 53288, + "ram_percentage": 16 + }] + }, +{"name": "WebServer/examples/WebServer", + "sizes": [{ + "flash_bytes": 1039206, + "flash_percentage": 79, + "ram_bytes": 47416, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/WebUpdate", + "sizes": [{ + "flash_bytes": 976298, + "flash_percentage": 74, + "ram_bytes": 49236, + "ram_percentage": 15 + }] + }, +{"name": "WiFi/examples/FTM/FTM_Initiator", + "sizes": [{ + "flash_bytes": 894678, + "flash_percentage": 68, + "ram_bytes": 45084, + "ram_percentage": 13 + }] + } +] +} +]} diff --git a/master_cli_compile/cli_compile_12.json b/master_cli_compile/cli_compile_12.json new file mode 100644 index 00000000000..f4e619f871d --- /dev/null +++ b/master_cli_compile/cli_compile_12.json @@ -0,0 +1,797 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32p4", + "target": "esp32p4", + "sketches": [ +{"name": "WebServer/examples/SDWebServer", + "sizes": [{ + "flash_bytes": 804011, + "flash_percentage": 61, + "ram_bytes": 31412, + "ram_percentage": 9 + }] + }, +{"name": "WebServer/examples/SimpleAuthentification", + "sizes": [{ + "flash_bytes": 706077, + "flash_percentage": 53, + "ram_bytes": 28776, + "ram_percentage": 8 + }] + }, +{"name": "WebServer/examples/UploadHugeFile", + "sizes": [{ + "flash_bytes": 1043439, + "flash_percentage": 33, + "ram_bytes": 34304, + "ram_percentage": 10 + }] + }, +{"name": "WebServer/examples/WebServer", + "sizes": [{ + "flash_bytes": 816039, + "flash_percentage": 62, + "ram_bytes": 29248, + "ram_percentage": 8 + }] + }, +{"name": "WebServer/examples/WebUpdate", + "sizes": [{ + "flash_bytes": 747019, + "flash_percentage": 56, + "ram_bytes": 31440, + "ram_percentage": 9 + }] + }, +{"name": "WiFi/examples/FTM/FTM_Initiator", + "sizes": [{ + "flash_bytes": 646515, + "flash_percentage": 49, + "ram_bytes": 27156, + "ram_percentage": 8 + }] + }, +{"name": "WiFi/examples/FTM/FTM_Responder", + "sizes": [{ + "flash_bytes": 644831, + "flash_percentage": 49, + "ram_bytes": 27156, + "ram_percentage": 8 + }] + }, +{"name": "WiFi/examples/SimpleWiFiServer", + "sizes": [{ + "flash_bytes": 675081, + "flash_percentage": 51, + "ram_bytes": 28456, + "ram_percentage": 8 + }] + }, +{"name": "WiFi/examples/WiFiAccessPoint", + "sizes": [{ + "flash_bytes": 674897, + "flash_percentage": 51, + "ram_bytes": 28456, + "ram_percentage": 8 + }] + }, +{"name": "WiFi/examples/WiFiClient", + "sizes": [{ + "flash_bytes": 671423, + "flash_percentage": 51, + "ram_bytes": 28456, + "ram_percentage": 8 + }] + }, +{"name": "WiFi/examples/WiFiClientBasic", + "sizes": [{ + "flash_bytes": 673485, + "flash_percentage": 51, + "ram_bytes": 28448, + "ram_percentage": 8 + }] + }, +{"name": "WiFi/examples/WiFiClientConnect", + "sizes": [{ + "flash_bytes": 646427, + "flash_percentage": 49, + "ram_bytes": 27164, + "ram_percentage": 8 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s3", + "target": "esp32s3", + "sketches": [ +{"name": "WebServer/examples/MultiHomedServers", + "sizes": [{ + "flash_bytes": 949838, + "flash_percentage": 72, + "ram_bytes": 48124, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/PathArgServer", + "sizes": [{ + "flash_bytes": 1210634, + "flash_percentage": 38, + "ram_bytes": 53276, + "ram_percentage": 16 + }] + }, +{"name": "WebServer/examples/SDWebServer", + "sizes": [{ + "flash_bytes": 1008382, + "flash_percentage": 76, + "ram_bytes": 48780, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/SimpleAuthentification", + "sizes": [{ + "flash_bytes": 898670, + "flash_percentage": 68, + "ram_bytes": 45788, + "ram_percentage": 13 + }] + }, +{"name": "WebServer/examples/UploadHugeFile", + "sizes": [{ + "flash_bytes": 1247454, + "flash_percentage": 39, + "ram_bytes": 51460, + "ram_percentage": 15 + }] + }, +{"name": "WebServer/examples/WebServer", + "sizes": [{ + "flash_bytes": 992894, + "flash_percentage": 75, + "ram_bytes": 46244, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/WebUpdate", + "sizes": [{ + "flash_bytes": 951350, + "flash_percentage": 72, + "ram_bytes": 48652, + "ram_percentage": 14 + }] + }, +{"name": "WiFi/examples/FTM/FTM_Initiator", + "sizes": [{ + "flash_bytes": 851646, + "flash_percentage": 64, + "ram_bytes": 44172, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/FTM/FTM_Responder", + "sizes": [{ + "flash_bytes": 849502, + "flash_percentage": 64, + "ram_bytes": 44172, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/SimpleWiFiServer", + "sizes": [{ + "flash_bytes": 890558, + "flash_percentage": 67, + "ram_bytes": 45820, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WPS", + "sizes": [{ + "flash_bytes": 870802, + "flash_percentage": 66, + "ram_bytes": 44212, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiAccessPoint", + "sizes": [{ + "flash_bytes": 890978, + "flash_percentage": 67, + "ram_bytes": 45820, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiBlueToothSwitch", + "sizes": [{ + "flash_bytes": 950554, + "flash_percentage": 72, + "ram_bytes": 45480, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiClient", + "sizes": [{ + "flash_bytes": 864670, + "flash_percentage": 65, + "ram_bytes": 45492, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiClientBasic", + "sizes": [{ + "flash_bytes": 865962, + "flash_percentage": 66, + "ram_bytes": 45468, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiClientConnect", + "sizes": [{ + "flash_bytes": 852738, + "flash_percentage": 65, + "ram_bytes": 44204, + "ram_percentage": 13 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2", + "target": "esp32s2", + "sketches": [ +{"name": "WebServer/examples/HttpBasicAuthSHA1orBearerToken", + "sizes": [{ + "flash_bytes": 939449, + "flash_percentage": 71, + "ram_bytes": 45908, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/Middleware", + "sizes": [{ + "flash_bytes": 887513, + "flash_percentage": 67, + "ram_bytes": 41160, + "ram_percentage": 12 + }] + }, +{"name": "WebServer/examples/MultiHomedServers", + "sizes": [{ + "flash_bytes": 915289, + "flash_percentage": 69, + "ram_bytes": 43268, + "ram_percentage": 13 + }] + }, +{"name": "WebServer/examples/PathArgServer", + "sizes": [{ + "flash_bytes": 1181129, + "flash_percentage": 37, + "ram_bytes": 48472, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/SDWebServer", + "sizes": [{ + "flash_bytes": 972933, + "flash_percentage": 74, + "ram_bytes": 43924, + "ram_percentage": 13 + }] + }, +{"name": "WebServer/examples/SimpleAuthentification", + "sizes": [{ + "flash_bytes": 870053, + "flash_percentage": 66, + "ram_bytes": 40984, + "ram_percentage": 12 + }] + }, +{"name": "WebServer/examples/UploadHugeFile", + "sizes": [{ + "flash_bytes": 1211997, + "flash_percentage": 38, + "ram_bytes": 46604, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/WebServer", + "sizes": [{ + "flash_bytes": 963681, + "flash_percentage": 73, + "ram_bytes": 41456, + "ram_percentage": 12 + }] + }, +{"name": "WebServer/examples/WebUpdate", + "sizes": [{ + "flash_bytes": 916693, + "flash_percentage": 69, + "ram_bytes": 43804, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/FTM/FTM_Initiator", + "sizes": [{ + "flash_bytes": 822785, + "flash_percentage": 62, + "ram_bytes": 39368, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/FTM/FTM_Responder", + "sizes": [{ + "flash_bytes": 820589, + "flash_percentage": 62, + "ram_bytes": 39368, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/SimpleWiFiServer", + "sizes": [{ + "flash_bytes": 855193, + "flash_percentage": 65, + "ram_bytes": 40964, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WPS", + "sizes": [{ + "flash_bytes": 841917, + "flash_percentage": 64, + "ram_bytes": 39424, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiAccessPoint", + "sizes": [{ + "flash_bytes": 855609, + "flash_percentage": 65, + "ram_bytes": 40964, + "ram_percentage": 12 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3", + "target": "esp32c3", + "sketches": [ +{"name": "WebServer/examples/WebUpdate", + "sizes": [{ + "flash_bytes": 1021724, + "flash_percentage": 77, + "ram_bytes": 40024, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/FTM/FTM_Initiator", + "sizes": [{ + "flash_bytes": 917884, + "flash_percentage": 70, + "ram_bytes": 34936, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/FTM/FTM_Responder", + "sizes": [{ + "flash_bytes": 915550, + "flash_percentage": 69, + "ram_bytes": 34928, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/SimpleWiFiServer", + "sizes": [{ + "flash_bytes": 956824, + "flash_percentage": 72, + "ram_bytes": 37136, + "ram_percentage": 11 + }] + }, +{"name": "WiFi/examples/WPS", + "sizes": [{ + "flash_bytes": 939668, + "flash_percentage": 71, + "ram_bytes": 34984, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiAccessPoint", + "sizes": [{ + "flash_bytes": 957446, + "flash_percentage": 73, + "ram_bytes": 37136, + "ram_percentage": 11 + }] + }, +{"name": "WiFi/examples/WiFiBlueToothSwitch", + "sizes": [{ + "flash_bytes": 1027212, + "flash_percentage": 78, + "ram_bytes": 36240, + "ram_percentage": 11 + }] + }, +{"name": "WiFi/examples/WiFiClient", + "sizes": [{ + "flash_bytes": 934462, + "flash_percentage": 71, + "ram_bytes": 36248, + "ram_percentage": 11 + }] + }, +{"name": "WiFi/examples/WiFiClientBasic", + "sizes": [{ + "flash_bytes": 936286, + "flash_percentage": 71, + "ram_bytes": 36224, + "ram_percentage": 11 + }] + }, +{"name": "WiFi/examples/WiFiClientConnect", + "sizes": [{ + "flash_bytes": 918918, + "flash_percentage": 70, + "ram_bytes": 34936, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiClientEnterprise", + "sizes": [{ + "flash_bytes": 1037818, + "flash_percentage": 79, + "ram_bytes": 36864, + "ram_percentage": 11 + }] + }, +{"name": "WiFi/examples/WiFiClientEvents", + "sizes": [{ + "flash_bytes": 919292, + "flash_percentage": 70, + "ram_bytes": 34928, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiClientStaticIP", + "sizes": [{ + "flash_bytes": 934508, + "flash_percentage": 71, + "ram_bytes": 36320, + "ram_percentage": 11 + }] + }, +{"name": "WiFi/examples/WiFiExtender", + "sizes": [{ + "flash_bytes": 918412, + "flash_percentage": 70, + "ram_bytes": 35040, + "ram_percentage": 10 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c6", + "target": "esp32c6", + "sketches": [ +{"name": "WiFi/examples/WiFiMulti", + "sizes": [{ + "flash_bytes": 925997, + "flash_percentage": 70, + "ram_bytes": 41052, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiMultiAdvanced", + "sizes": [{ + "flash_bytes": 1065169, + "flash_percentage": 81, + "ram_bytes": 42980, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiScan", + "sizes": [{ + "flash_bytes": 924203, + "flash_percentage": 70, + "ram_bytes": 41004, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiScanAsync", + "sizes": [{ + "flash_bytes": 924565, + "flash_percentage": 70, + "ram_bytes": 41004, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiScanDualAntenna", + "sizes": [{ + "flash_bytes": 927487, + "flash_percentage": 70, + "ram_bytes": 41012, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiScanTime", + "sizes": [{ + "flash_bytes": 924293, + "flash_percentage": 70, + "ram_bytes": 41004, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiSmartConfig", + "sizes": [{ + "flash_bytes": 963421, + "flash_percentage": 73, + "ram_bytes": 41332, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiTelnetToSerial", + "sizes": [{ + "flash_bytes": 948825, + "flash_percentage": 72, + "ram_bytes": 42412, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiUDPClient", + "sizes": [{ + "flash_bytes": 936099, + "flash_percentage": 71, + "ram_bytes": 42676, + "ram_percentage": 13 + }] + }, +{"name": "WiFiProv/examples/WiFiProv", + "sizes": [{ + "flash_bytes": 1757705, + "flash_percentage": 55, + "ram_bytes": 63400, + "ram_percentage": 19 + }] + }, +{"name": "Wire/examples/WireMaster", + "sizes": [{ + "flash_bytes": 268889, + "flash_percentage": 20, + "ram_bytes": 14076, + "ram_percentage": 4 + }] + }, +{"name": "Wire/examples/WireScan", + "sizes": [{ + "flash_bytes": 268629, + "flash_percentage": 20, + "ram_bytes": 14076, + "ram_percentage": 4 + }] + }, +{"name": "Wire/examples/WireSlave", + "sizes": [{ + "flash_bytes": 268883, + "flash_percentage": 20, + "ram_bytes": 14076, + "ram_percentage": 4 + }] + }, +{"name": "Zigbee/examples/Zigbee_Analog_Input_Output", + "sizes": [{ + "flash_bytes": 566447, + "flash_percentage": 43, + "ram_bytes": 29272, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_CarbonDioxide_Sensor", + "sizes": [{ + "flash_bytes": 561101, + "flash_percentage": 42, + "ram_bytes": 28984, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_Color_Dimmable_Light", + "sizes": [{ + "flash_bytes": 604415, + "flash_percentage": 46, + "ram_bytes": 30188, + "ram_percentage": 9 + }] + } +] +}, +{ "board": "espressif:esp32:esp32h2", + "target": "esp32h2", + "sketches": [ +{"name": "Zigbee/examples/Zigbee_Analog_Input_Output", + "sizes": [{ + "flash_bytes": 581879, + "flash_percentage": 44, + "ram_bytes": 28228, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_CarbonDioxide_Sensor", + "sizes": [{ + "flash_bytes": 576779, + "flash_percentage": 44, + "ram_bytes": 27980, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_Color_Dimmable_Light", + "sizes": [{ + "flash_bytes": 620001, + "flash_percentage": 47, + "ram_bytes": 29180, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_Color_Dimmer_Switch", + "sizes": [{ + "flash_bytes": 710983, + "flash_percentage": 54, + "ram_bytes": 31476, + "ram_percentage": 9 + }] + }, +{"name": "Zigbee/examples/Zigbee_Contact_Switch", + "sizes": [{ + "flash_bytes": 573415, + "flash_percentage": 43, + "ram_bytes": 27988, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_Dimmable_Light", + "sizes": [{ + "flash_bytes": 599189, + "flash_percentage": 45, + "ram_bytes": 29164, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_Illuminance_Sensor", + "sizes": [{ + "flash_bytes": 594055, + "flash_percentage": 45, + "ram_bytes": 28236, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_OTA_Client", + "sizes": [{ + "flash_bytes": 613387, + "flash_percentage": 46, + "ram_bytes": 29228, + "ram_percentage": 8 + }] + } +] +}, +{ "board": "espressif:esp32:esp32", + "target": "esp32", + "sketches": [ +{"name": "WiFi/examples/FTM/FTM_Responder", + "sizes": [{ + "flash_bytes": 893810, + "flash_percentage": 68, + "ram_bytes": 45076, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/SimpleWiFiServer", + "sizes": [{ + "flash_bytes": 915594, + "flash_percentage": 69, + "ram_bytes": 46364, + "ram_percentage": 14 + }] + }, +{"name": "WiFi/examples/WPS", + "sizes": [{ + "flash_bytes": 915970, + "flash_percentage": 69, + "ram_bytes": 45116, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiAccessPoint", + "sizes": [{ + "flash_bytes": 915998, + "flash_percentage": 69, + "ram_bytes": 46364, + "ram_percentage": 14 + }] + }, +{"name": "WiFi/examples/WiFiBlueToothSwitch", + "sizes": [{ + "flash_bytes": 1043114, + "flash_percentage": 79, + "ram_bytes": 49292, + "ram_percentage": 15 + }] + }, +{"name": "WiFi/examples/WiFiClient", + "sizes": [{ + "flash_bytes": 909454, + "flash_percentage": 69, + "ram_bytes": 46404, + "ram_percentage": 14 + }] + }, +{"name": "WiFi/examples/WiFiClientBasic", + "sizes": [{ + "flash_bytes": 910826, + "flash_percentage": 69, + "ram_bytes": 46380, + "ram_percentage": 14 + }] + }, +{"name": "WiFi/examples/WiFiClientConnect", + "sizes": [{ + "flash_bytes": 897922, + "flash_percentage": 68, + "ram_bytes": 45068, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiClientEnterprise", + "sizes": [{ + "flash_bytes": 1005726, + "flash_percentage": 76, + "ram_bytes": 46996, + "ram_percentage": 14 + }] + }, +{"name": "WiFi/examples/WiFiClientEvents", + "sizes": [{ + "flash_bytes": 896646, + "flash_percentage": 68, + "ram_bytes": 45076, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiClientStaticIP", + "sizes": [{ + "flash_bytes": 909570, + "flash_percentage": 69, + "ram_bytes": 46476, + "ram_percentage": 14 + }] + }, +{"name": "WiFi/examples/WiFiExtender", + "sizes": [{ + "flash_bytes": 895946, + "flash_percentage": 68, + "ram_bytes": 45172, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiIPv6", + "sizes": [{ + "flash_bytes": 907218, + "flash_percentage": 69, + "ram_bytes": 46756, + "ram_percentage": 14 + }] + }, +{"name": "WiFi/examples/WiFiMulti", + "sizes": [{ + "flash_bytes": 896222, + "flash_percentage": 68, + "ram_bytes": 45124, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiMultiAdvanced", + "sizes": [{ + "flash_bytes": 1032426, + "flash_percentage": 78, + "ram_bytes": 48380, + "ram_percentage": 14 + }] + } +] +} +]} diff --git a/master_cli_compile/cli_compile_13.json b/master_cli_compile/cli_compile_13.json new file mode 100644 index 00000000000..6c6a51a287c --- /dev/null +++ b/master_cli_compile/cli_compile_13.json @@ -0,0 +1,797 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32p4", + "target": "esp32p4", + "sketches": [ +{"name": "WiFi/examples/WiFiClientEvents", + "sizes": [{ + "flash_bytes": 649423, + "flash_percentage": 49, + "ram_bytes": 27156, + "ram_percentage": 8 + }] + }, +{"name": "WiFi/examples/WiFiClientStaticIP", + "sizes": [{ + "flash_bytes": 671481, + "flash_percentage": 51, + "ram_bytes": 28552, + "ram_percentage": 8 + }] + }, +{"name": "WiFi/examples/WiFiExtender", + "sizes": [{ + "flash_bytes": 648543, + "flash_percentage": 49, + "ram_bytes": 27272, + "ram_percentage": 8 + }] + }, +{"name": "WiFi/examples/WiFiIPv6", + "sizes": [{ + "flash_bytes": 669307, + "flash_percentage": 51, + "ram_bytes": 28840, + "ram_percentage": 8 + }] + }, +{"name": "WiFi/examples/WiFiMulti", + "sizes": [{ + "flash_bytes": 649089, + "flash_percentage": 49, + "ram_bytes": 27196, + "ram_percentage": 8 + }] + }, +{"name": "WiFi/examples/WiFiMultiAdvanced", + "sizes": [{ + "flash_bytes": 885939, + "flash_percentage": 67, + "ram_bytes": 29440, + "ram_percentage": 8 + }] + }, +{"name": "WiFi/examples/WiFiScan", + "sizes": [{ + "flash_bytes": 646389, + "flash_percentage": 49, + "ram_bytes": 27164, + "ram_percentage": 8 + }] + }, +{"name": "WiFi/examples/WiFiScanAsync", + "sizes": [{ + "flash_bytes": 646747, + "flash_percentage": 49, + "ram_bytes": 27164, + "ram_percentage": 8 + }] + }, +{"name": "WiFi/examples/WiFiScanDualAntenna", + "sizes": [{ + "flash_bytes": 645803, + "flash_percentage": 49, + "ram_bytes": 27164, + "ram_percentage": 8 + }] + }, +{"name": "WiFi/examples/WiFiScanTime", + "sizes": [{ + "flash_bytes": 646481, + "flash_percentage": 49, + "ram_bytes": 27164, + "ram_percentage": 8 + }] + }, +{"name": "WiFi/examples/WiFiTelnetToSerial", + "sizes": [{ + "flash_bytes": 679479, + "flash_percentage": 51, + "ram_bytes": 28544, + "ram_percentage": 8 + }] + }, +{"name": "WiFi/examples/WiFiUDPClient", + "sizes": [{ + "flash_bytes": 665387, + "flash_percentage": 50, + "ram_bytes": 28824, + "ram_percentage": 8 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s3", + "target": "esp32s3", + "sketches": [ +{"name": "WiFi/examples/WiFiClientEnterprise", + "sizes": [{ + "flash_bytes": 958802, + "flash_percentage": 73, + "ram_bytes": 46092, + "ram_percentage": 14 + }] + }, +{"name": "WiFi/examples/WiFiClientEvents", + "sizes": [{ + "flash_bytes": 852258, + "flash_percentage": 65, + "ram_bytes": 44172, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiClientStaticIP", + "sizes": [{ + "flash_bytes": 864778, + "flash_percentage": 65, + "ram_bytes": 45564, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiExtender", + "sizes": [{ + "flash_bytes": 851570, + "flash_percentage": 64, + "ram_bytes": 44268, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiIPv6", + "sizes": [{ + "flash_bytes": 862414, + "flash_percentage": 65, + "ram_bytes": 45844, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiMulti", + "sizes": [{ + "flash_bytes": 851842, + "flash_percentage": 64, + "ram_bytes": 44212, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiMultiAdvanced", + "sizes": [{ + "flash_bytes": 986510, + "flash_percentage": 75, + "ram_bytes": 46132, + "ram_percentage": 14 + }] + }, +{"name": "WiFi/examples/WiFiScan", + "sizes": [{ + "flash_bytes": 850382, + "flash_percentage": 64, + "ram_bytes": 44180, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiScanAsync", + "sizes": [{ + "flash_bytes": 850634, + "flash_percentage": 64, + "ram_bytes": 44180, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiScanDualAntenna", + "sizes": [{ + "flash_bytes": 853426, + "flash_percentage": 65, + "ram_bytes": 44212, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiScanTime", + "sizes": [{ + "flash_bytes": 850478, + "flash_percentage": 64, + "ram_bytes": 44180, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiSmartConfig", + "sizes": [{ + "flash_bytes": 884546, + "flash_percentage": 67, + "ram_bytes": 44500, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiTelnetToSerial", + "sizes": [{ + "flash_bytes": 870934, + "flash_percentage": 66, + "ram_bytes": 45564, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiUDPClient", + "sizes": [{ + "flash_bytes": 859686, + "flash_percentage": 65, + "ram_bytes": 45844, + "ram_percentage": 13 + }] + }, +{"name": "WiFiProv/examples/WiFiProv", + "sizes": [{ + "flash_bytes": 1485862, + "flash_percentage": 47, + "ram_bytes": 66948, + "ram_percentage": 20 + }] + }, +{"name": "Wire/examples/WireMaster", + "sizes": [{ + "flash_bytes": 328650, + "flash_percentage": 25, + "ram_bytes": 21704, + "ram_percentage": 6 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2", + "target": "esp32s2", + "sketches": [ +{"name": "WiFi/examples/WiFiClient", + "sizes": [{ + "flash_bytes": 835885, + "flash_percentage": 63, + "ram_bytes": 40688, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiClientBasic", + "sizes": [{ + "flash_bytes": 837169, + "flash_percentage": 63, + "ram_bytes": 40664, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiClientConnect", + "sizes": [{ + "flash_bytes": 824009, + "flash_percentage": 62, + "ram_bytes": 39416, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiClientEnterprise", + "sizes": [{ + "flash_bytes": 931341, + "flash_percentage": 71, + "ram_bytes": 41288, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiClientEvents", + "sizes": [{ + "flash_bytes": 823401, + "flash_percentage": 62, + "ram_bytes": 39368, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiClientStaticIP", + "sizes": [{ + "flash_bytes": 836025, + "flash_percentage": 63, + "ram_bytes": 40776, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiExtender", + "sizes": [{ + "flash_bytes": 822697, + "flash_percentage": 62, + "ram_bytes": 39480, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiIPv6", + "sizes": [{ + "flash_bytes": 833705, + "flash_percentage": 63, + "ram_bytes": 41056, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiMulti", + "sizes": [{ + "flash_bytes": 822981, + "flash_percentage": 62, + "ram_bytes": 39408, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiMultiAdvanced", + "sizes": [{ + "flash_bytes": 958505, + "flash_percentage": 73, + "ram_bytes": 41328, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiScan", + "sizes": [{ + "flash_bytes": 821489, + "flash_percentage": 62, + "ram_bytes": 39376, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiScanAsync", + "sizes": [{ + "flash_bytes": 821753, + "flash_percentage": 62, + "ram_bytes": 39376, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiScanDualAntenna", + "sizes": [{ + "flash_bytes": 824697, + "flash_percentage": 62, + "ram_bytes": 39416, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiScanTime", + "sizes": [{ + "flash_bytes": 821597, + "flash_percentage": 62, + "ram_bytes": 39376, + "ram_percentage": 12 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3", + "target": "esp32c3", + "sketches": [ +{"name": "WiFi/examples/WiFiIPv6", + "sizes": [{ + "flash_bytes": 932472, + "flash_percentage": 71, + "ram_bytes": 36608, + "ram_percentage": 11 + }] + }, +{"name": "WiFi/examples/WiFiMulti", + "sizes": [{ + "flash_bytes": 918734, + "flash_percentage": 70, + "ram_bytes": 34968, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiMultiAdvanced", + "sizes": [{ + "flash_bytes": 1066402, + "flash_percentage": 81, + "ram_bytes": 36880, + "ram_percentage": 11 + }] + }, +{"name": "WiFi/examples/WiFiScan", + "sizes": [{ + "flash_bytes": 916930, + "flash_percentage": 69, + "ram_bytes": 34936, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiScanAsync", + "sizes": [{ + "flash_bytes": 917284, + "flash_percentage": 69, + "ram_bytes": 34936, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiScanDualAntenna", + "sizes": [{ + "flash_bytes": 919968, + "flash_percentage": 70, + "ram_bytes": 34944, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiScanTime", + "sizes": [{ + "flash_bytes": 917018, + "flash_percentage": 69, + "ram_bytes": 34936, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiSmartConfig", + "sizes": [{ + "flash_bytes": 956052, + "flash_percentage": 72, + "ram_bytes": 35264, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiTelnetToSerial", + "sizes": [{ + "flash_bytes": 941132, + "flash_percentage": 71, + "ram_bytes": 36328, + "ram_percentage": 11 + }] + }, +{"name": "WiFi/examples/WiFiUDPClient", + "sizes": [{ + "flash_bytes": 928564, + "flash_percentage": 70, + "ram_bytes": 36592, + "ram_percentage": 11 + }] + }, +{"name": "WiFiProv/examples/WiFiProv", + "sizes": [{ + "flash_bytes": 1653384, + "flash_percentage": 52, + "ram_bytes": 57720, + "ram_percentage": 17 + }] + }, +{"name": "Wire/examples/WireMaster", + "sizes": [{ + "flash_bytes": 309176, + "flash_percentage": 23, + "ram_bytes": 12288, + "ram_percentage": 3 + }] + }, +{"name": "Wire/examples/WireScan", + "sizes": [{ + "flash_bytes": 308926, + "flash_percentage": 23, + "ram_bytes": 12280, + "ram_percentage": 3 + }] + }, +{"name": "Wire/examples/WireSlave", + "sizes": [{ + "flash_bytes": 309174, + "flash_percentage": 23, + "ram_bytes": 12288, + "ram_percentage": 3 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c6", + "target": "esp32c6", + "sketches": [ +{"name": "Zigbee/examples/Zigbee_Color_Dimmer_Switch", + "sizes": [{ + "flash_bytes": 695429, + "flash_percentage": 53, + "ram_bytes": 32496, + "ram_percentage": 9 + }] + }, +{"name": "Zigbee/examples/Zigbee_Contact_Switch", + "sizes": [{ + "flash_bytes": 557969, + "flash_percentage": 42, + "ram_bytes": 28992, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_Dimmable_Light", + "sizes": [{ + "flash_bytes": 583577, + "flash_percentage": 44, + "ram_bytes": 30156, + "ram_percentage": 9 + }] + }, +{"name": "Zigbee/examples/Zigbee_Illuminance_Sensor", + "sizes": [{ + "flash_bytes": 578995, + "flash_percentage": 44, + "ram_bytes": 29288, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_OTA_Client", + "sizes": [{ + "flash_bytes": 597717, + "flash_percentage": 45, + "ram_bytes": 30228, + "ram_percentage": 9 + }] + }, +{"name": "Zigbee/examples/Zigbee_Occupancy_Sensor", + "sizes": [{ + "flash_bytes": 557055, + "flash_percentage": 42, + "ram_bytes": 28976, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_On_Off_Light", + "sizes": [{ + "flash_bytes": 582973, + "flash_percentage": 44, + "ram_bytes": 30140, + "ram_percentage": 9 + }] + }, +{"name": "Zigbee/examples/Zigbee_On_Off_Switch", + "sizes": [{ + "flash_bytes": 684843, + "flash_percentage": 52, + "ram_bytes": 33072, + "ram_percentage": 10 + }] + }, +{"name": "Zigbee/examples/Zigbee_PM25_Sensor", + "sizes": [{ + "flash_bytes": 561077, + "flash_percentage": 42, + "ram_bytes": 28984, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_Pressure_Flow_Sensor", + "sizes": [{ + "flash_bytes": 563311, + "flash_percentage": 42, + "ram_bytes": 29048, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_Range_Extender", + "sizes": [{ + "flash_bytes": 690009, + "flash_percentage": 52, + "ram_bytes": 33356, + "ram_percentage": 10 + }] + }, +{"name": "Zigbee/examples/Zigbee_Scan_Networks", + "sizes": [{ + "flash_bytes": 519373, + "flash_percentage": 39, + "ram_bytes": 28184, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy", + "sizes": [{ + "flash_bytes": 572811, + "flash_percentage": 43, + "ram_bytes": 29200, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_Temperature_Sensor", + "sizes": [{ + "flash_bytes": 573385, + "flash_percentage": 43, + "ram_bytes": 29152, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_Thermostat", + "sizes": [{ + "flash_bytes": 683015, + "flash_percentage": 52, + "ram_bytes": 32696, + "ram_percentage": 9 + }] + }, +{"name": "Zigbee/examples/Zigbee_Vibration_Sensor", + "sizes": [{ + "flash_bytes": 557865, + "flash_percentage": 42, + "ram_bytes": 28992, + "ram_percentage": 8 + }] + } +] +}, +{ "board": "espressif:esp32:esp32h2", + "target": "esp32h2", + "sketches": [ +{"name": "Zigbee/examples/Zigbee_Occupancy_Sensor", + "sizes": [{ + "flash_bytes": 572501, + "flash_percentage": 43, + "ram_bytes": 27956, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_On_Off_Light", + "sizes": [{ + "flash_bytes": 598583, + "flash_percentage": 45, + "ram_bytes": 29148, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_On_Off_Switch", + "sizes": [{ + "flash_bytes": 700199, + "flash_percentage": 53, + "ram_bytes": 32012, + "ram_percentage": 9 + }] + }, +{"name": "Zigbee/examples/Zigbee_PM25_Sensor", + "sizes": [{ + "flash_bytes": 576757, + "flash_percentage": 44, + "ram_bytes": 27980, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_Pressure_Flow_Sensor", + "sizes": [{ + "flash_bytes": 578991, + "flash_percentage": 44, + "ram_bytes": 28060, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_Range_Extender", + "sizes": [{ + "flash_bytes": 705755, + "flash_percentage": 53, + "ram_bytes": 32340, + "ram_percentage": 9 + }] + }, +{"name": "Zigbee/examples/Zigbee_Scan_Networks", + "sizes": [{ + "flash_bytes": 534643, + "flash_percentage": 40, + "ram_bytes": 27164, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy", + "sizes": [{ + "flash_bytes": 588013, + "flash_percentage": 44, + "ram_bytes": 28156, + "ram_percentage": 8 + }] + } +] +}, +{ "board": "espressif:esp32:esp32", + "target": "esp32", + "sketches": [ +{"name": "WiFi/examples/WiFiScan", + "sizes": [{ + "flash_bytes": 894750, + "flash_percentage": 68, + "ram_bytes": 45084, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiScanAsync", + "sizes": [{ + "flash_bytes": 894982, + "flash_percentage": 68, + "ram_bytes": 45084, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiScanDualAntenna", + "sizes": [{ + "flash_bytes": 898762, + "flash_percentage": 68, + "ram_bytes": 45084, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiScanTime", + "sizes": [{ + "flash_bytes": 894846, + "flash_percentage": 68, + "ram_bytes": 45084, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiSmartConfig", + "sizes": [{ + "flash_bytes": 931090, + "flash_percentage": 71, + "ram_bytes": 45388, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiTelnetToSerial", + "sizes": [{ + "flash_bytes": 916030, + "flash_percentage": 69, + "ram_bytes": 46476, + "ram_percentage": 14 + }] + }, +{"name": "WiFi/examples/WiFiUDPClient", + "sizes": [{ + "flash_bytes": 904442, + "flash_percentage": 69, + "ram_bytes": 46748, + "ram_percentage": 14 + }] + }, +{"name": "WiFiProv/examples/WiFiProv", + "sizes": [{ + "flash_bytes": 1717894, + "flash_percentage": 54, + "ram_bytes": 59512, + "ram_percentage": 18 + }] + }, +{"name": "Wire/examples/WireMaster", + "sizes": [{ + "flash_bytes": 329478, + "flash_percentage": 25, + "ram_bytes": 21928, + "ram_percentage": 6 + }] + }, +{"name": "Wire/examples/WireScan", + "sizes": [{ + "flash_bytes": 329234, + "flash_percentage": 25, + "ram_bytes": 21920, + "ram_percentage": 6 + }] + }, +{"name": "Wire/examples/WireSlave", + "sizes": [{ + "flash_bytes": 329742, + "flash_percentage": 25, + "ram_bytes": 21928, + "ram_percentage": 6 + }] + }, +{"name": "Zigbee/examples/Zigbee_Color_Dimmer_Switch", + "sizes": [{ + "flash_bytes": 656690, + "flash_percentage": 50, + "ram_bytes": 36568, + "ram_percentage": 11 + }] + }, +{"name": "Zigbee/examples/Zigbee_Gateway", + "sizes": [{ + "flash_bytes": 1253066, + "flash_percentage": 36, + "ram_bytes": 63704, + "ram_percentage": 19 + }] + }, +{"name": "Zigbee/examples/Zigbee_On_Off_Switch", + "sizes": [{ + "flash_bytes": 649826, + "flash_percentage": 49, + "ram_bytes": 37248, + "ram_percentage": 11 + }] + }, +{"name": "Zigbee/examples/Zigbee_Range_Extender", + "sizes": [{ + "flash_bytes": 637690, + "flash_percentage": 48, + "ram_bytes": 36504, + "ram_percentage": 11 + }] + } +] +} +]} diff --git a/master_cli_compile/cli_compile_14.json b/master_cli_compile/cli_compile_14.json new file mode 100644 index 00000000000..3d4c4ca6abd --- /dev/null +++ b/master_cli_compile/cli_compile_14.json @@ -0,0 +1,317 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32p4", + "target": "esp32p4", + "sketches": [ +{"name": "Wire/examples/WireMaster", + "sizes": [{ + "flash_bytes": 351623, + "flash_percentage": 26, + "ram_bytes": 23400, + "ram_percentage": 7 + }] + }, +{"name": "Wire/examples/WireScan", + "sizes": [{ + "flash_bytes": 351403, + "flash_percentage": 26, + "ram_bytes": 23400, + "ram_percentage": 7 + }] + }, +{"name": "Wire/examples/WireSlave", + "sizes": [{ + "flash_bytes": 351647, + "flash_percentage": 26, + "ram_bytes": 23400, + "ram_percentage": 7 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s3", + "target": "esp32s3", + "sketches": [ +{"name": "Wire/examples/WireScan", + "sizes": [{ + "flash_bytes": 328414, + "flash_percentage": 25, + "ram_bytes": 21704, + "ram_percentage": 6 + }] + }, +{"name": "Wire/examples/WireSlave", + "sizes": [{ + "flash_bytes": 328598, + "flash_percentage": 25, + "ram_bytes": 21704, + "ram_percentage": 6 + }] + }, +{"name": "Zigbee/examples/Zigbee_Color_Dimmer_Switch", + "sizes": [{ + "flash_bytes": 652270, + "flash_percentage": 49, + "ram_bytes": 36680, + "ram_percentage": 11 + }] + }, +{"name": "Zigbee/examples/Zigbee_Gateway", + "sizes": [{ + "flash_bytes": 1206614, + "flash_percentage": 35, + "ram_bytes": 61524, + "ram_percentage": 18 + }] + }, +{"name": "Zigbee/examples/Zigbee_On_Off_Switch", + "sizes": [{ + "flash_bytes": 645526, + "flash_percentage": 49, + "ram_bytes": 37480, + "ram_percentage": 11 + }] + }, +{"name": "Zigbee/examples/Zigbee_Range_Extender", + "sizes": [{ + "flash_bytes": 656206, + "flash_percentage": 50, + "ram_bytes": 36932, + "ram_percentage": 11 + }] + }, +{"name": "Zigbee/examples/Zigbee_Thermostat", + "sizes": [{ + "flash_bytes": 654022, + "flash_percentage": 49, + "ram_bytes": 36864, + "ram_percentage": 11 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2", + "target": "esp32s2", + "sketches": [ +{"name": "WiFi/examples/WiFiSmartConfig", + "sizes": [{ + "flash_bytes": 855297, + "flash_percentage": 65, + "ram_bytes": 39688, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiTelnetToSerial", + "sizes": [{ + "flash_bytes": 842049, + "flash_percentage": 64, + "ram_bytes": 40776, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiUDPClient", + "sizes": [{ + "flash_bytes": 830977, + "flash_percentage": 63, + "ram_bytes": 41040, + "ram_percentage": 12 + }] + }, +{"name": "WiFiProv/examples/WiFiProv", + "sizes": [{ + "flash_bytes": 954433, + "flash_percentage": 30, + "ram_bytes": 39440, + "ram_percentage": 12 + }] + }, +{"name": "Wire/examples/WireMaster", + "sizes": [{ + "flash_bytes": 291453, + "flash_percentage": 22, + "ram_bytes": 16740, + "ram_percentage": 5 + }] + }, +{"name": "Wire/examples/WireScan", + "sizes": [{ + "flash_bytes": 291221, + "flash_percentage": 22, + "ram_bytes": 16732, + "ram_percentage": 5 + }] + }, +{"name": "Wire/examples/WireSlave", + "sizes": [{ + "flash_bytes": 291413, + "flash_percentage": 22, + "ram_bytes": 16740, + "ram_percentage": 5 + }] + }, +{"name": "Zigbee/examples/Zigbee_Color_Dimmer_Switch", + "sizes": [{ + "flash_bytes": 619441, + "flash_percentage": 47, + "ram_bytes": 31700, + "ram_percentage": 9 + }] + }, +{"name": "Zigbee/examples/Zigbee_Gateway", + "sizes": [{ + "flash_bytes": 1179065, + "flash_percentage": 34, + "ram_bytes": 56736, + "ram_percentage": 17 + }] + }, +{"name": "Zigbee/examples/Zigbee_On_Off_Switch", + "sizes": [{ + "flash_bytes": 612513, + "flash_percentage": 46, + "ram_bytes": 32460, + "ram_percentage": 9 + }] + }, +{"name": "Zigbee/examples/Zigbee_Range_Extender", + "sizes": [{ + "flash_bytes": 617145, + "flash_percentage": 47, + "ram_bytes": 31896, + "ram_percentage": 9 + }] + }, +{"name": "Zigbee/examples/Zigbee_Thermostat", + "sizes": [{ + "flash_bytes": 620725, + "flash_percentage": 47, + "ram_bytes": 31884, + "ram_percentage": 9 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3", + "target": "esp32c3", + "sketches": [ +{"name": "Zigbee/examples/Zigbee_Color_Dimmer_Switch", + "sizes": [{ + "flash_bytes": 677572, + "flash_percentage": 51, + "ram_bytes": 27904, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_Gateway", + "sizes": [{ + "flash_bytes": 1313304, + "flash_percentage": 38, + "ram_bytes": 52288, + "ram_percentage": 15 + }] + }, +{"name": "Zigbee/examples/Zigbee_On_Off_Switch", + "sizes": [{ + "flash_bytes": 667390, + "flash_percentage": 50, + "ram_bytes": 28368, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_Range_Extender", + "sizes": [{ + "flash_bytes": 672642, + "flash_percentage": 51, + "ram_bytes": 28784, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_Thermostat", + "sizes": [{ + "flash_bytes": 675562, + "flash_percentage": 51, + "ram_bytes": 28104, + "ram_percentage": 8 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c6", + "target": "esp32c6", + "sketches": [ +{"name": "Zigbee/examples/Zigbee_Wind_Speed_Sensor", + "sizes": [{ + "flash_bytes": 561023, + "flash_percentage": 42, + "ram_bytes": 28976, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_Window_Covering", + "sizes": [{ + "flash_bytes": 568071, + "flash_percentage": 43, + "ram_bytes": 29256, + "ram_percentage": 8 + }] + } +] +}, +{ "board": "espressif:esp32:esp32h2", + "target": "esp32h2", + "sketches": [ +{"name": "Zigbee/examples/Zigbee_Temperature_Sensor", + "sizes": [{ + "flash_bytes": 599353, + "flash_percentage": 45, + "ram_bytes": 28172, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_Thermostat", + "sizes": [{ + "flash_bytes": 708941, + "flash_percentage": 54, + "ram_bytes": 31668, + "ram_percentage": 9 + }] + }, +{"name": "Zigbee/examples/Zigbee_Vibration_Sensor", + "sizes": [{ + "flash_bytes": 573319, + "flash_percentage": 43, + "ram_bytes": 27988, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_Wind_Speed_Sensor", + "sizes": [{ + "flash_bytes": 576699, + "flash_percentage": 43, + "ram_bytes": 27972, + "ram_percentage": 8 + }] + }, +{"name": "Zigbee/examples/Zigbee_Window_Covering", + "sizes": [{ + "flash_bytes": 583497, + "flash_percentage": 44, + "ram_bytes": 28244, + "ram_percentage": 8 + }] + } +] +}, +{ "board": "espressif:esp32:esp32", + "target": "esp32", + "sketches": [ +{"name": "Zigbee/examples/Zigbee_Thermostat", + "sizes": [{ + "flash_bytes": 658182, + "flash_percentage": 50, + "ram_bytes": 37012, + "ram_percentage": 11 + }] + } +] +} +]} diff --git a/master_cli_compile/cli_compile_2.json b/master_cli_compile/cli_compile_2.json new file mode 100644 index 00000000000..0910856d237 --- /dev/null +++ b/master_cli_compile/cli_compile_2.json @@ -0,0 +1,821 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32p4", + "target": "esp32p4", + "sketches": [ +{"name": "ESP32/examples/FreeRTOS/Semaphore", + "sizes": [{ + "flash_bytes": 320639, + "flash_percentage": 24, + "ram_bytes": 21496, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/GPIO/BlinkRGB", + "sizes": [{ + "flash_bytes": 302857, + "flash_percentage": 23, + "ram_bytes": 21492, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/GPIO/FunctionalInterrupt", + "sizes": [{ + "flash_bytes": 328211, + "flash_percentage": 25, + "ram_bytes": 22192, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/GPIO/FunctionalInterruptStruct", + "sizes": [{ + "flash_bytes": 326421, + "flash_percentage": 24, + "ram_bytes": 22200, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/GPIO/GPIOInterrupt", + "sizes": [{ + "flash_bytes": 327295, + "flash_percentage": 24, + "ram_bytes": 22208, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/HWCDC_Events", + "sizes": [{ + "flash_bytes": 302857, + "flash_percentage": 23, + "ram_bytes": 21492, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/MacAddress/GetMacAddress", + "sizes": [{ + "flash_bytes": 324323, + "flash_percentage": 24, + "ram_bytes": 21568, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/RMT/Legacy_RMT_Driver_Compatible", + "sizes": [{ + "flash_bytes": 324095, + "flash_percentage": 24, + "ram_bytes": 21656, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/RMT/RMTCallback", + "sizes": [{ + "flash_bytes": 348217, + "flash_percentage": 26, + "ram_bytes": 22776, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/RMT/RMTLoopback", + "sizes": [{ + "flash_bytes": 349899, + "flash_percentage": 26, + "ram_bytes": 24200, + "ram_percentage": 7 + }] + }, +{"name": "ESP32/examples/RMT/RMTReadXJT", + "sizes": [{ + "flash_bytes": 348815, + "flash_percentage": 26, + "ram_bytes": 22648, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/RMT/RMTWrite_RGB_LED", + "sizes": [{ + "flash_bytes": 346877, + "flash_percentage": 26, + "ram_bytes": 25248, + "ram_percentage": 7 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s3", + "target": "esp32s3", + "sketches": [ +{"name": "ESP32/examples/CI/CIBoardsTest", + "sizes": [{ + "flash_bytes": 356994, + "flash_percentage": 27, + "ram_bytes": 22428, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Camera/CameraWebServer", + "sizes": [{ + "flash_bytes": 994922, + "flash_percentage": 5, + "ram_bytes": 62456, + "ram_percentage": 19 + }] + }, +{"name": "ESP32/examples/Camera/CameraWebServer", + "sizes": [{ + "flash_bytes": 997602, + "flash_percentage": 5, + "ram_bytes": 62592, + "ram_percentage": 19 + }] + }, +{"name": "ESP32/examples/Camera/CameraWebServer", + "sizes": [{ + "flash_bytes": 999802, + "flash_percentage": 5, + "ram_bytes": 62908, + "ram_percentage": 19 + }] + }, +{"name": "ESP32/examples/ChipID/GetChipID", + "sizes": [{ + "flash_bytes": 305786, + "flash_percentage": 23, + "ram_bytes": 20344, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/DeepSleep/ExternalWakeUp", + "sizes": [{ + "flash_bytes": 311258, + "flash_percentage": 23, + "ram_bytes": 20424, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/DeepSleep/TimerWakeUp", + "sizes": [{ + "flash_bytes": 311086, + "flash_percentage": 23, + "ram_bytes": 20424, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/DeepSleep/TouchWakeUp", + "sizes": [{ + "flash_bytes": 319062, + "flash_percentage": 24, + "ram_bytes": 21056, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/FreeRTOS/BasicMultiThreading", + "sizes": [{ + "flash_bytes": 340710, + "flash_percentage": 25, + "ram_bytes": 21308, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Mutex", + "sizes": [{ + "flash_bytes": 303446, + "flash_percentage": 23, + "ram_bytes": 20328, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Queue", + "sizes": [{ + "flash_bytes": 303530, + "flash_percentage": 23, + "ram_bytes": 20320, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Semaphore", + "sizes": [{ + "flash_bytes": 302958, + "flash_percentage": 23, + "ram_bytes": 20320, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/GPIO/BlinkRGB", + "sizes": [{ + "flash_bytes": 314730, + "flash_percentage": 24, + "ram_bytes": 20972, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/GPIO/FunctionalInterrupt", + "sizes": [{ + "flash_bytes": 310562, + "flash_percentage": 23, + "ram_bytes": 21312, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/GPIO/FunctionalInterruptStruct", + "sizes": [{ + "flash_bytes": 309182, + "flash_percentage": 23, + "ram_bytes": 21304, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/GPIO/GPIOInterrupt", + "sizes": [{ + "flash_bytes": 309842, + "flash_percentage": 23, + "ram_bytes": 21304, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/HWCDC_Events", + "sizes": [{ + "flash_bytes": 333062, + "flash_percentage": 10, + "ram_bytes": 20684, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/MacAddress/GetMacAddress", + "sizes": [{ + "flash_bytes": 306486, + "flash_percentage": 23, + "ram_bytes": 20416, + "ram_percentage": 6 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2", + "target": "esp32s2", + "sketches": [ +{"name": "ESP32/examples/GPIO/FunctionalInterrupt", + "sizes": [{ + "flash_bytes": 275201, + "flash_percentage": 20, + "ram_bytes": 16300, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/GPIO/FunctionalInterruptStruct", + "sizes": [{ + "flash_bytes": 273857, + "flash_percentage": 20, + "ram_bytes": 16308, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/GPIO/GPIOInterrupt", + "sizes": [{ + "flash_bytes": 274485, + "flash_percentage": 20, + "ram_bytes": 16316, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/MacAddress/GetMacAddress", + "sizes": [{ + "flash_bytes": 271341, + "flash_percentage": 20, + "ram_bytes": 15436, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/RMT/Legacy_RMT_Driver_Compatible", + "sizes": [{ + "flash_bytes": 270525, + "flash_percentage": 20, + "ram_bytes": 15464, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/RMT/RMTCallback", + "sizes": [{ + "flash_bytes": 285817, + "flash_percentage": 21, + "ram_bytes": 16752, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/RMT/RMTLoopback", + "sizes": [{ + "flash_bytes": 287077, + "flash_percentage": 21, + "ram_bytes": 17984, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/RMT/RMTReadXJT", + "sizes": [{ + "flash_bytes": 286257, + "flash_percentage": 21, + "ram_bytes": 16536, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/RMT/RMTWrite_RGB_LED", + "sizes": [{ + "flash_bytes": 284961, + "flash_percentage": 21, + "ram_bytes": 19008, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/RMT/RMT_CPUFreq_Test", + "sizes": [{ + "flash_bytes": 285725, + "flash_percentage": 21, + "ram_bytes": 15944, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/RMT/RMT_EndOfTransmissionState", + "sizes": [{ + "flash_bytes": 285397, + "flash_percentage": 21, + "ram_bytes": 16000, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/RMT/RMT_LED_Blink", + "sizes": [{ + "flash_bytes": 287345, + "flash_percentage": 21, + "ram_bytes": 16048, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/ResetReason/ResetReason", + "sizes": [{ + "flash_bytes": 274633, + "flash_percentage": 20, + "ram_bytes": 15412, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/ResetReason/ResetReason2", + "sizes": [{ + "flash_bytes": 267725, + "flash_percentage": 20, + "ram_bytes": 15348, + "ram_percentage": 4 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3", + "target": "esp32c3", + "sketches": [ +{"name": "ESP32/examples/AnalogOut/ledcWrite_RGB", + "sizes": [{ + "flash_bytes": 290020, + "flash_percentage": 22, + "ram_bytes": 11752, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/AnalogRead", + "sizes": [{ + "flash_bytes": 296036, + "flash_percentage": 22, + "ram_bytes": 11828, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/AnalogReadContinuous", + "sizes": [{ + "flash_bytes": 302116, + "flash_percentage": 23, + "ram_bytes": 11828, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/ArduinoStackSize", + "sizes": [{ + "flash_bytes": 281738, + "flash_percentage": 21, + "ram_bytes": 11620, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/CI/CIBoardsTest", + "sizes": [{ + "flash_bytes": 333570, + "flash_percentage": 25, + "ram_bytes": 13568, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/ChipID/GetChipID", + "sizes": [{ + "flash_bytes": 284240, + "flash_percentage": 21, + "ram_bytes": 11660, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/DeepSleep/TimerWakeUp", + "sizes": [{ + "flash_bytes": 289034, + "flash_percentage": 22, + "ram_bytes": 11768, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/FreeRTOS/BasicMultiThreading", + "sizes": [{ + "flash_bytes": 315514, + "flash_percentage": 24, + "ram_bytes": 13048, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Mutex", + "sizes": [{ + "flash_bytes": 282570, + "flash_percentage": 21, + "ram_bytes": 11636, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Queue", + "sizes": [{ + "flash_bytes": 282698, + "flash_percentage": 21, + "ram_bytes": 11620, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Semaphore", + "sizes": [{ + "flash_bytes": 281954, + "flash_percentage": 21, + "ram_bytes": 11620, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/GPIO/BlinkRGB", + "sizes": [{ + "flash_bytes": 288828, + "flash_percentage": 22, + "ram_bytes": 12840, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/GPIO/FunctionalInterrupt", + "sizes": [{ + "flash_bytes": 289508, + "flash_percentage": 22, + "ram_bytes": 12216, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/GPIO/FunctionalInterruptStruct", + "sizes": [{ + "flash_bytes": 287952, + "flash_percentage": 21, + "ram_bytes": 12224, + "ram_percentage": 3 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c6", + "target": "esp32c6", + "sketches": [ +{"name": "ESP32/examples/CI/CIBoardsTest", + "sizes": [{ + "flash_bytes": 292869, + "flash_percentage": 22, + "ram_bytes": 15372, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/ChipID/GetChipID", + "sizes": [{ + "flash_bytes": 242489, + "flash_percentage": 18, + "ram_bytes": 12840, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/DeepSleep/TimerWakeUp", + "sizes": [{ + "flash_bytes": 249381, + "flash_percentage": 19, + "ram_bytes": 13024, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/FreeRTOS/BasicMultiThreading", + "sizes": [{ + "flash_bytes": 273817, + "flash_percentage": 20, + "ram_bytes": 14324, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Mutex", + "sizes": [{ + "flash_bytes": 240415, + "flash_percentage": 18, + "ram_bytes": 12808, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Queue", + "sizes": [{ + "flash_bytes": 240673, + "flash_percentage": 18, + "ram_bytes": 12792, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Semaphore", + "sizes": [{ + "flash_bytes": 239919, + "flash_percentage": 18, + "ram_bytes": 12792, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/GPIO/BlinkRGB", + "sizes": [{ + "flash_bytes": 245309, + "flash_percentage": 18, + "ram_bytes": 14028, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/GPIO/FunctionalInterrupt", + "sizes": [{ + "flash_bytes": 248133, + "flash_percentage": 18, + "ram_bytes": 13500, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/GPIO/FunctionalInterruptStruct", + "sizes": [{ + "flash_bytes": 246395, + "flash_percentage": 18, + "ram_bytes": 13492, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/GPIO/GPIOInterrupt", + "sizes": [{ + "flash_bytes": 247221, + "flash_percentage": 18, + "ram_bytes": 13500, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/HWCDC_Events", + "sizes": [{ + "flash_bytes": 273209, + "flash_percentage": 20, + "ram_bytes": 14164, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/MacAddress/GetMacAddress", + "sizes": [{ + "flash_bytes": 244049, + "flash_percentage": 18, + "ram_bytes": 12952, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/RMT/Legacy_RMT_Driver_Compatible", + "sizes": [{ + "flash_bytes": 243239, + "flash_percentage": 18, + "ram_bytes": 12932, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/RMT/RMTCallback", + "sizes": [{ + "flash_bytes": 260865, + "flash_percentage": 19, + "ram_bytes": 14656, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/RMT/RMTLoopback", + "sizes": [{ + "flash_bytes": 262531, + "flash_percentage": 20, + "ram_bytes": 16080, + "ram_percentage": 4 + }] + } +] +}, +{ "board": "espressif:esp32:esp32h2", + "target": "esp32h2", + "sketches": [ +{"name": "EEPROM/examples/eeprom_extra", + "sizes": [{ + "flash_bytes": 297841, + "flash_percentage": 22, + "ram_bytes": 12820, + "ram_percentage": 3 + }] + }, +{"name": "EEPROM/examples/eeprom_write", + "sizes": [{ + "flash_bytes": 293339, + "flash_percentage": 22, + "ram_bytes": 12828, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/AnalogOut/LEDCFade", + "sizes": [{ + "flash_bytes": 295957, + "flash_percentage": 22, + "ram_bytes": 12920, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/AnalogOut/LEDCSingleChannel", + "sizes": [{ + "flash_bytes": 275609, + "flash_percentage": 21, + "ram_bytes": 12920, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/AnalogOut/LEDCSoftwareFade", + "sizes": [{ + "flash_bytes": 275667, + "flash_percentage": 21, + "ram_bytes": 12920, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/AnalogOut/SigmaDelta", + "sizes": [{ + "flash_bytes": 271355, + "flash_percentage": 20, + "ram_bytes": 12780, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/AnalogOut/ledcFrequency", + "sizes": [{ + "flash_bytes": 277849, + "flash_percentage": 21, + "ram_bytes": 12912, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/AnalogOut/ledcWrite_RGB", + "sizes": [{ + "flash_bytes": 291263, + "flash_percentage": 22, + "ram_bytes": 12936, + "ram_percentage": 3 + }] + } +] +}, +{ "board": "espressif:esp32:esp32", + "target": "esp32", + "sketches": [ +{"name": "ESP32/examples/AnalogOut/SigmaDelta", + "sizes": [{ + "flash_bytes": 293722, + "flash_percentage": 22, + "ram_bytes": 20608, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogOut/ledcFrequency", + "sizes": [{ + "flash_bytes": 300018, + "flash_percentage": 22, + "ram_bytes": 20768, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogOut/ledcWrite_RGB", + "sizes": [{ + "flash_bytes": 312106, + "flash_percentage": 23, + "ram_bytes": 20816, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogRead", + "sizes": [{ + "flash_bytes": 313270, + "flash_percentage": 23, + "ram_bytes": 20680, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogReadContinuous", + "sizes": [{ + "flash_bytes": 319898, + "flash_percentage": 24, + "ram_bytes": 20712, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/ArduinoStackSize", + "sizes": [{ + "flash_bytes": 304134, + "flash_percentage": 23, + "ram_bytes": 20600, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/CI/CIBoardsTest", + "sizes": [{ + "flash_bytes": 334246, + "flash_percentage": 25, + "ram_bytes": 22016, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Camera/CameraWebServer", + "sizes": [{ + "flash_bytes": 1038170, + "flash_percentage": 6, + "ram_bytes": 63764, + "ram_percentage": 19 + }] + }, +{"name": "ESP32/examples/Camera/CameraWebServer", + "sizes": [{ + "flash_bytes": 1050514, + "flash_percentage": 6, + "ram_bytes": 63864, + "ram_percentage": 19 + }] + }, +{"name": "ESP32/examples/ChipID/GetChipID", + "sizes": [{ + "flash_bytes": 307986, + "flash_percentage": 23, + "ram_bytes": 20648, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/DeepSleep/ExternalWakeUp", + "sizes": [{ + "flash_bytes": 310698, + "flash_percentage": 23, + "ram_bytes": 20632, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/DeepSleep/SmoothBlink_ULP_Code", + "sizes": [{ + "flash_bytes": 313362, + "flash_percentage": 23, + "ram_bytes": 20632, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/DeepSleep/TimerWakeUp", + "sizes": [{ + "flash_bytes": 310214, + "flash_percentage": 23, + "ram_bytes": 20632, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/DeepSleep/TouchWakeUp", + "sizes": [{ + "flash_bytes": 318430, + "flash_percentage": 24, + "ram_bytes": 20792, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/FreeRTOS/BasicMultiThreading", + "sizes": [{ + "flash_bytes": 314950, + "flash_percentage": 24, + "ram_bytes": 20704, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Mutex", + "sizes": [{ + "flash_bytes": 305146, + "flash_percentage": 23, + "ram_bytes": 20724, + "ram_percentage": 6 + }] + } +] +} +]} diff --git a/master_cli_compile/cli_compile_3.json b/master_cli_compile/cli_compile_3.json new file mode 100644 index 00000000000..5194d3520b7 --- /dev/null +++ b/master_cli_compile/cli_compile_3.json @@ -0,0 +1,797 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32p4", + "target": "esp32p4", + "sketches": [ +{"name": "ESP32/examples/RMT/RMT_CPUFreq_Test", + "sizes": [{ + "flash_bytes": 347807, + "flash_percentage": 26, + "ram_bytes": 22152, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/RMT/RMT_EndOfTransmissionState", + "sizes": [{ + "flash_bytes": 347405, + "flash_percentage": 26, + "ram_bytes": 22224, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/RMT/RMT_LED_Blink", + "sizes": [{ + "flash_bytes": 349687, + "flash_percentage": 26, + "ram_bytes": 22280, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/ResetReason/ResetReason", + "sizes": [{ + "flash_bytes": 331961, + "flash_percentage": 25, + "ram_bytes": 21720, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/ResetReason/ResetReason2", + "sizes": [{ + "flash_bytes": 321037, + "flash_percentage": 24, + "ram_bytes": 21496, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/BaudRateDetect_Demo", + "sizes": [{ + "flash_bytes": 320539, + "flash_percentage": 24, + "ram_bytes": 21496, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/OnReceiveError_BREAK_Demo", + "sizes": [{ + "flash_bytes": 323865, + "flash_percentage": 24, + "ram_bytes": 21536, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/OnReceive_Demo", + "sizes": [{ + "flash_bytes": 322361, + "flash_percentage": 24, + "ram_bytes": 21512, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/RS485_Echo_Demo", + "sizes": [{ + "flash_bytes": 321319, + "flash_percentage": 24, + "ram_bytes": 21496, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/RxFIFOFull_Demo", + "sizes": [{ + "flash_bytes": 321771, + "flash_percentage": 24, + "ram_bytes": 21504, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/RxTimeout_Demo", + "sizes": [{ + "flash_bytes": 321613, + "flash_percentage": 24, + "ram_bytes": 21504, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/Serial_All_CPU_Freqs", + "sizes": [{ + "flash_bytes": 321345, + "flash_percentage": 24, + "ram_bytes": 21520, + "ram_percentage": 6 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s3", + "target": "esp32s3", + "sketches": [ +{"name": "ESP32/examples/RMT/Legacy_RMT_Driver_Compatible", + "sizes": [{ + "flash_bytes": 306374, + "flash_percentage": 23, + "ram_bytes": 20472, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/RMT/RMTCallback", + "sizes": [{ + "flash_bytes": 328038, + "flash_percentage": 25, + "ram_bytes": 21572, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/RMT/RMTLoopback", + "sizes": [{ + "flash_bytes": 329338, + "flash_percentage": 25, + "ram_bytes": 22996, + "ram_percentage": 7 + }] + }, +{"name": "ESP32/examples/RMT/RMTReadXJT", + "sizes": [{ + "flash_bytes": 328498, + "flash_percentage": 25, + "ram_bytes": 21444, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/RMT/RMTWrite_RGB_LED", + "sizes": [{ + "flash_bytes": 326830, + "flash_percentage": 24, + "ram_bytes": 24044, + "ram_percentage": 7 + }] + }, +{"name": "ESP32/examples/RMT/RMT_CPUFreq_Test", + "sizes": [{ + "flash_bytes": 327602, + "flash_percentage": 24, + "ram_bytes": 20956, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/RMT/RMT_EndOfTransmissionState", + "sizes": [{ + "flash_bytes": 327254, + "flash_percentage": 24, + "ram_bytes": 21028, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/RMT/RMT_LED_Blink", + "sizes": [{ + "flash_bytes": 329202, + "flash_percentage": 25, + "ram_bytes": 21076, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/ResetReason/ResetReason", + "sizes": [{ + "flash_bytes": 311234, + "flash_percentage": 23, + "ram_bytes": 20424, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/ResetReason/ResetReason2", + "sizes": [{ + "flash_bytes": 302930, + "flash_percentage": 23, + "ram_bytes": 20312, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/BaudRateDetect_Demo", + "sizes": [{ + "flash_bytes": 302806, + "flash_percentage": 23, + "ram_bytes": 20320, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/OnReceiveError_BREAK_Demo", + "sizes": [{ + "flash_bytes": 305674, + "flash_percentage": 23, + "ram_bytes": 20360, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/OnReceive_Demo", + "sizes": [{ + "flash_bytes": 304386, + "flash_percentage": 23, + "ram_bytes": 20328, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/RS485_Echo_Demo", + "sizes": [{ + "flash_bytes": 303478, + "flash_percentage": 23, + "ram_bytes": 20320, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/RxFIFOFull_Demo", + "sizes": [{ + "flash_bytes": 303738, + "flash_percentage": 23, + "ram_bytes": 20320, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/RxTimeout_Demo", + "sizes": [{ + "flash_bytes": 303558, + "flash_percentage": 23, + "ram_bytes": 20320, + "ram_percentage": 6 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2", + "target": "esp32s2", + "sketches": [ +{"name": "ESP32/examples/Serial/BaudRateDetect_Demo", + "sizes": [{ + "flash_bytes": 267601, + "flash_percentage": 20, + "ram_bytes": 15348, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Serial/OnReceiveError_BREAK_Demo", + "sizes": [{ + "flash_bytes": 270453, + "flash_percentage": 20, + "ram_bytes": 15388, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Serial/OnReceive_Demo", + "sizes": [{ + "flash_bytes": 269181, + "flash_percentage": 20, + "ram_bytes": 15356, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Serial/RS485_Echo_Demo", + "sizes": [{ + "flash_bytes": 268265, + "flash_percentage": 20, + "ram_bytes": 15348, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Serial/RxFIFOFull_Demo", + "sizes": [{ + "flash_bytes": 268517, + "flash_percentage": 20, + "ram_bytes": 15348, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Serial/RxTimeout_Demo", + "sizes": [{ + "flash_bytes": 268357, + "flash_percentage": 20, + "ram_bytes": 15364, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Serial/Serial_All_CPU_Freqs", + "sizes": [{ + "flash_bytes": 268185, + "flash_percentage": 20, + "ram_bytes": 15380, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Serial/Serial_STD_Func_OnReceive", + "sizes": [{ + "flash_bytes": 269241, + "flash_percentage": 20, + "ram_bytes": 15348, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Serial/onReceiveExample", + "sizes": [{ + "flash_bytes": 268573, + "flash_percentage": 20, + "ram_bytes": 15372, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/TWAI/TWAIreceive", + "sizes": [{ + "flash_bytes": 272545, + "flash_percentage": 20, + "ram_bytes": 15364, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/TWAI/TWAItransmit", + "sizes": [{ + "flash_bytes": 272937, + "flash_percentage": 20, + "ram_bytes": 15372, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Template/ExampleTemplate", + "sizes": [{ + "flash_bytes": 253797, + "flash_percentage": 19, + "ram_bytes": 15340, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Time/SimpleTime", + "sizes": [{ + "flash_bytes": 847205, + "flash_percentage": 64, + "ram_bytes": 40800, + "ram_percentage": 12 + }] + }, +{"name": "ESP32/examples/Timer/RepeatTimer", + "sizes": [{ + "flash_bytes": 278053, + "flash_percentage": 21, + "ram_bytes": 15764, + "ram_percentage": 4 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3", + "target": "esp32c3", + "sketches": [ +{"name": "ESP32/examples/GPIO/GPIOInterrupt", + "sizes": [{ + "flash_bytes": 288592, + "flash_percentage": 22, + "ram_bytes": 12224, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/HWCDC_Events", + "sizes": [{ + "flash_bytes": 315336, + "flash_percentage": 24, + "ram_bytes": 12992, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/MacAddress/GetMacAddress", + "sizes": [{ + "flash_bytes": 285782, + "flash_percentage": 21, + "ram_bytes": 11716, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/RMT/Legacy_RMT_Driver_Compatible", + "sizes": [{ + "flash_bytes": 285338, + "flash_percentage": 21, + "ram_bytes": 11760, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/RMT/RMTCallback", + "sizes": [{ + "flash_bytes": 303254, + "flash_percentage": 23, + "ram_bytes": 13476, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/RMT/RMTLoopback", + "sizes": [{ + "flash_bytes": 304922, + "flash_percentage": 23, + "ram_bytes": 14900, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/RMT/RMTReadXJT", + "sizes": [{ + "flash_bytes": 303868, + "flash_percentage": 23, + "ram_bytes": 13348, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/RMT/RMTWrite_RGB_LED", + "sizes": [{ + "flash_bytes": 302452, + "flash_percentage": 23, + "ram_bytes": 15948, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/RMT/RMT_CPUFreq_Test", + "sizes": [{ + "flash_bytes": 303374, + "flash_percentage": 23, + "ram_bytes": 12852, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/RMT/RMT_EndOfTransmissionState", + "sizes": [{ + "flash_bytes": 302980, + "flash_percentage": 23, + "ram_bytes": 12924, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/RMT/RMT_LED_Blink", + "sizes": [{ + "flash_bytes": 305254, + "flash_percentage": 23, + "ram_bytes": 12980, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/ResetReason/ResetReason", + "sizes": [{ + "flash_bytes": 289108, + "flash_percentage": 22, + "ram_bytes": 11768, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/ResetReason/ResetReason2", + "sizes": [{ + "flash_bytes": 281980, + "flash_percentage": 21, + "ram_bytes": 11612, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Serial/BaudRateDetect_Demo", + "sizes": [{ + "flash_bytes": 281936, + "flash_percentage": 21, + "ram_bytes": 11620, + "ram_percentage": 3 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c6", + "target": "esp32c6", + "sketches": [ +{"name": "ESP32/examples/RMT/RMTReadXJT", + "sizes": [{ + "flash_bytes": 261455, + "flash_percentage": 19, + "ram_bytes": 14512, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/RMT/RMTWrite_RGB_LED", + "sizes": [{ + "flash_bytes": 260037, + "flash_percentage": 19, + "ram_bytes": 17120, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/RMT/RMT_CPUFreq_Test", + "sizes": [{ + "flash_bytes": 260983, + "flash_percentage": 19, + "ram_bytes": 14032, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/RMT/RMT_EndOfTransmissionState", + "sizes": [{ + "flash_bytes": 260581, + "flash_percentage": 19, + "ram_bytes": 14104, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/RMT/RMT_LED_Blink", + "sizes": [{ + "flash_bytes": 262847, + "flash_percentage": 20, + "ram_bytes": 14160, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/ResetReason/ResetReason", + "sizes": [{ + "flash_bytes": 249225, + "flash_percentage": 19, + "ram_bytes": 13024, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/ResetReason/ResetReason2", + "sizes": [{ + "flash_bytes": 239963, + "flash_percentage": 18, + "ram_bytes": 12784, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Serial/BaudRateDetect_Demo", + "sizes": [{ + "flash_bytes": 239911, + "flash_percentage": 18, + "ram_bytes": 12784, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Serial/OnReceiveError_BREAK_Demo", + "sizes": [{ + "flash_bytes": 243205, + "flash_percentage": 18, + "ram_bytes": 12816, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Serial/OnReceive_Demo", + "sizes": [{ + "flash_bytes": 241701, + "flash_percentage": 18, + "ram_bytes": 12792, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Serial/RS485_Echo_Demo", + "sizes": [{ + "flash_bytes": 240649, + "flash_percentage": 18, + "ram_bytes": 12784, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Serial/RxFIFOFull_Demo", + "sizes": [{ + "flash_bytes": 241111, + "flash_percentage": 18, + "ram_bytes": 12784, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Serial/RxTimeout_Demo", + "sizes": [{ + "flash_bytes": 240951, + "flash_percentage": 18, + "ram_bytes": 12792, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Serial/Serial_All_CPU_Freqs", + "sizes": [{ + "flash_bytes": 240735, + "flash_percentage": 18, + "ram_bytes": 12816, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Serial/Serial_STD_Func_OnReceive", + "sizes": [{ + "flash_bytes": 241435, + "flash_percentage": 18, + "ram_bytes": 12784, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Serial/onReceiveExample", + "sizes": [{ + "flash_bytes": 241117, + "flash_percentage": 18, + "ram_bytes": 12808, + "ram_percentage": 3 + }] + } +] +}, +{ "board": "espressif:esp32:esp32h2", + "target": "esp32h2", + "sketches": [ +{"name": "ESP32/examples/AnalogRead", + "sizes": [{ + "flash_bytes": 296781, + "flash_percentage": 22, + "ram_bytes": 13060, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/AnalogReadContinuous", + "sizes": [{ + "flash_bytes": 301931, + "flash_percentage": 23, + "ram_bytes": 13060, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/ArduinoStackSize", + "sizes": [{ + "flash_bytes": 282847, + "flash_percentage": 21, + "ram_bytes": 12764, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/CI/CIBoardsTest", + "sizes": [{ + "flash_bytes": 335245, + "flash_percentage": 25, + "ram_bytes": 15416, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/ChipID/GetChipID", + "sizes": [{ + "flash_bytes": 284297, + "flash_percentage": 21, + "ram_bytes": 12812, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/FreeRTOS/BasicMultiThreading", + "sizes": [{ + "flash_bytes": 315921, + "flash_percentage": 24, + "ram_bytes": 14264, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Mutex", + "sizes": [{ + "flash_bytes": 283681, + "flash_percentage": 21, + "ram_bytes": 12788, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Queue", + "sizes": [{ + "flash_bytes": 283807, + "flash_percentage": 21, + "ram_bytes": 12772, + "ram_percentage": 3 + }] + } +] +}, +{ "board": "espressif:esp32:esp32", + "target": "esp32", + "sketches": [ +{"name": "ESP32/examples/FreeRTOS/Queue", + "sizes": [{ + "flash_bytes": 304894, + "flash_percentage": 23, + "ram_bytes": 20608, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Semaphore", + "sizes": [{ + "flash_bytes": 304310, + "flash_percentage": 23, + "ram_bytes": 20608, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/GPIO/BlinkRGB", + "sizes": [{ + "flash_bytes": 290258, + "flash_percentage": 22, + "ram_bytes": 20592, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/GPIO/FunctionalInterrupt", + "sizes": [{ + "flash_bytes": 311306, + "flash_percentage": 23, + "ram_bytes": 21096, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/GPIO/FunctionalInterruptStruct", + "sizes": [{ + "flash_bytes": 309934, + "flash_percentage": 23, + "ram_bytes": 21104, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/GPIO/GPIOInterrupt", + "sizes": [{ + "flash_bytes": 310582, + "flash_percentage": 23, + "ram_bytes": 21104, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/MacAddress/GetMacAddress", + "sizes": [{ + "flash_bytes": 308594, + "flash_percentage": 23, + "ram_bytes": 20720, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/RMT/Legacy_RMT_Driver_Compatible", + "sizes": [{ + "flash_bytes": 307102, + "flash_percentage": 23, + "ram_bytes": 20728, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/RMT/RMTCallback", + "sizes": [{ + "flash_bytes": 321574, + "flash_percentage": 24, + "ram_bytes": 22264, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/RMT/RMTLoopback", + "sizes": [{ + "flash_bytes": 322926, + "flash_percentage": 24, + "ram_bytes": 23496, + "ram_percentage": 7 + }] + }, +{"name": "ESP32/examples/RMT/RMTReadXJT", + "sizes": [{ + "flash_bytes": 322034, + "flash_percentage": 24, + "ram_bytes": 22056, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/RMT/RMTWrite_RGB_LED", + "sizes": [{ + "flash_bytes": 320818, + "flash_percentage": 24, + "ram_bytes": 24544, + "ram_percentage": 7 + }] + }, +{"name": "ESP32/examples/RMT/RMT_CPUFreq_Test", + "sizes": [{ + "flash_bytes": 321574, + "flash_percentage": 24, + "ram_bytes": 21456, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/RMT/RMT_EndOfTransmissionState", + "sizes": [{ + "flash_bytes": 321250, + "flash_percentage": 24, + "ram_bytes": 21512, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/RMT/RMT_LED_Blink", + "sizes": [{ + "flash_bytes": 323218, + "flash_percentage": 24, + "ram_bytes": 21576, + "ram_percentage": 6 + }] + } +] +} +]} diff --git a/master_cli_compile/cli_compile_4.json b/master_cli_compile/cli_compile_4.json new file mode 100644 index 00000000000..daf4ab9d693 --- /dev/null +++ b/master_cli_compile/cli_compile_4.json @@ -0,0 +1,797 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32p4", + "target": "esp32p4", + "sketches": [ +{"name": "ESP32/examples/Serial/Serial_STD_Func_OnReceive", + "sizes": [{ + "flash_bytes": 322111, + "flash_percentage": 24, + "ram_bytes": 21504, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/onReceiveExample", + "sizes": [{ + "flash_bytes": 321755, + "flash_percentage": 24, + "ram_bytes": 21520, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/TWAI/TWAIreceive", + "sizes": [{ + "flash_bytes": 326135, + "flash_percentage": 24, + "ram_bytes": 21520, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/TWAI/TWAItransmit", + "sizes": [{ + "flash_bytes": 326565, + "flash_percentage": 24, + "ram_bytes": 21520, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Template/ExampleTemplate", + "sizes": [{ + "flash_bytes": 302857, + "flash_percentage": 23, + "ram_bytes": 21492, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Time/SimpleTime", + "sizes": [{ + "flash_bytes": 673617, + "flash_percentage": 51, + "ram_bytes": 28596, + "ram_percentage": 8 + }] + }, +{"name": "ESP32/examples/Timer/RepeatTimer", + "sizes": [{ + "flash_bytes": 331167, + "flash_percentage": 25, + "ram_bytes": 21544, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Timer/WatchdogTimer", + "sizes": [{ + "flash_bytes": 330955, + "flash_percentage": 25, + "ram_bytes": 21528, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Touch/TouchInterrupt", + "sizes": [{ + "flash_bytes": 332665, + "flash_percentage": 25, + "ram_bytes": 21852, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Touch/TouchRead", + "sizes": [{ + "flash_bytes": 336457, + "flash_percentage": 25, + "ram_bytes": 21876, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Utilities/HEXBuilder", + "sizes": [{ + "flash_bytes": 322595, + "flash_percentage": 24, + "ram_bytes": 21496, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Utilities/MD5Builder", + "sizes": [{ + "flash_bytes": 322859, + "flash_percentage": 24, + "ram_bytes": 21496, + "ram_percentage": 6 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s3", + "target": "esp32s3", + "sketches": [ +{"name": "ESP32/examples/Serial/Serial_All_CPU_Freqs", + "sizes": [{ + "flash_bytes": 303402, + "flash_percentage": 23, + "ram_bytes": 20336, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/Serial_STD_Func_OnReceive", + "sizes": [{ + "flash_bytes": 304166, + "flash_percentage": 23, + "ram_bytes": 20320, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/onReceiveExample", + "sizes": [{ + "flash_bytes": 303778, + "flash_percentage": 23, + "ram_bytes": 20344, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/TWAI/TWAIreceive", + "sizes": [{ + "flash_bytes": 307766, + "flash_percentage": 23, + "ram_bytes": 20320, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/TWAI/TWAItransmit", + "sizes": [{ + "flash_bytes": 308050, + "flash_percentage": 23, + "ram_bytes": 20328, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Template/ExampleTemplate", + "sizes": [{ + "flash_bytes": 289130, + "flash_percentage": 22, + "ram_bytes": 20312, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Time/SimpleTime", + "sizes": [{ + "flash_bytes": 876854, + "flash_percentage": 66, + "ram_bytes": 45588, + "ram_percentage": 13 + }] + }, +{"name": "ESP32/examples/Timer/RepeatTimer", + "sizes": [{ + "flash_bytes": 313146, + "flash_percentage": 23, + "ram_bytes": 20728, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Timer/WatchdogTimer", + "sizes": [{ + "flash_bytes": 312990, + "flash_percentage": 23, + "ram_bytes": 20720, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Touch/TouchInterrupt", + "sizes": [{ + "flash_bytes": 309794, + "flash_percentage": 23, + "ram_bytes": 20952, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Touch/TouchRead", + "sizes": [{ + "flash_bytes": 310842, + "flash_percentage": 23, + "ram_bytes": 20952, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Utilities/HEXBuilder", + "sizes": [{ + "flash_bytes": 304550, + "flash_percentage": 23, + "ram_bytes": 20320, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Utilities/MD5Builder", + "sizes": [{ + "flash_bytes": 304886, + "flash_percentage": 23, + "ram_bytes": 20320, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Utilities/SHA1Builder", + "sizes": [{ + "flash_bytes": 309734, + "flash_percentage": 23, + "ram_bytes": 20320, + "ram_percentage": 6 + }] + }, +{"name": "ESP_I2S/examples/ES8388_loopback", + "sizes": [{ + "flash_bytes": 383534, + "flash_percentage": 29, + "ram_bytes": 22380, + "ram_percentage": 6 + }] + }, +{"name": "ESP_I2S/examples/Record_to_WAV", + "sizes": [{ + "flash_bytes": 410946, + "flash_percentage": 31, + "ram_bytes": 20864, + "ram_percentage": 6 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2", + "target": "esp32s2", + "sketches": [ +{"name": "ESP32/examples/Timer/WatchdogTimer", + "sizes": [{ + "flash_bytes": 277901, + "flash_percentage": 21, + "ram_bytes": 15732, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Touch/TouchInterrupt", + "sizes": [{ + "flash_bytes": 274309, + "flash_percentage": 20, + "ram_bytes": 15996, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Touch/TouchRead", + "sizes": [{ + "flash_bytes": 275305, + "flash_percentage": 21, + "ram_bytes": 15988, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Utilities/HEXBuilder", + "sizes": [{ + "flash_bytes": 269349, + "flash_percentage": 20, + "ram_bytes": 15348, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Utilities/MD5Builder", + "sizes": [{ + "flash_bytes": 269677, + "flash_percentage": 20, + "ram_bytes": 15348, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Utilities/SHA1Builder", + "sizes": [{ + "flash_bytes": 274517, + "flash_percentage": 20, + "ram_bytes": 15348, + "ram_percentage": 4 + }] + }, +{"name": "ESP_I2S/examples/ES8388_loopback", + "sizes": [{ + "flash_bytes": 330581, + "flash_percentage": 25, + "ram_bytes": 17360, + "ram_percentage": 5 + }] + }, +{"name": "ESP_I2S/examples/Simple_tone", + "sizes": [{ + "flash_bytes": 284065, + "flash_percentage": 21, + "ram_bytes": 15476, + "ram_percentage": 4 + }] + }, +{"name": "ESP_NOW/examples/ESP_NOW_Broadcast_Master", + "sizes": [{ + "flash_bytes": 832977, + "flash_percentage": 63, + "ram_bytes": 39584, + "ram_percentage": 12 + }] + }, +{"name": "ESP_NOW/examples/ESP_NOW_Broadcast_Slave", + "sizes": [{ + "flash_bytes": 833205, + "flash_percentage": 63, + "ram_bytes": 39560, + "ram_percentage": 12 + }] + }, +{"name": "ESP_NOW/examples/ESP_NOW_Network", + "sizes": [{ + "flash_bytes": 836685, + "flash_percentage": 63, + "ram_bytes": 39656, + "ram_percentage": 12 + }] + }, +{"name": "ESP_NOW/examples/ESP_NOW_Serial", + "sizes": [{ + "flash_bytes": 833829, + "flash_percentage": 63, + "ram_bytes": 39648, + "ram_percentage": 12 + }] + }, +{"name": "ESPmDNS/examples/mDNS-SD_Extended", + "sizes": [{ + "flash_bytes": 850497, + "flash_percentage": 64, + "ram_bytes": 41696, + "ram_percentage": 12 + }] + }, +{"name": "ESPmDNS/examples/mDNS_Web_Server", + "sizes": [{ + "flash_bytes": 868721, + "flash_percentage": 66, + "ram_bytes": 43000, + "ram_percentage": 13 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3", + "target": "esp32c3", + "sketches": [ +{"name": "ESP32/examples/Serial/OnReceiveError_BREAK_Demo", + "sizes": [{ + "flash_bytes": 285202, + "flash_percentage": 21, + "ram_bytes": 11652, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Serial/OnReceive_Demo", + "sizes": [{ + "flash_bytes": 283710, + "flash_percentage": 21, + "ram_bytes": 11628, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Serial/RS485_Echo_Demo", + "sizes": [{ + "flash_bytes": 282416, + "flash_percentage": 21, + "ram_bytes": 11620, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Serial/RxFIFOFull_Demo", + "sizes": [{ + "flash_bytes": 283124, + "flash_percentage": 21, + "ram_bytes": 11620, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Serial/RxTimeout_Demo", + "sizes": [{ + "flash_bytes": 282974, + "flash_percentage": 21, + "ram_bytes": 11628, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Serial/Serial_All_CPU_Freqs", + "sizes": [{ + "flash_bytes": 282736, + "flash_percentage": 21, + "ram_bytes": 11636, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Serial/Serial_STD_Func_OnReceive", + "sizes": [{ + "flash_bytes": 283464, + "flash_percentage": 21, + "ram_bytes": 11620, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Serial/onReceiveExample", + "sizes": [{ + "flash_bytes": 283154, + "flash_percentage": 21, + "ram_bytes": 11644, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/TWAI/TWAIreceive", + "sizes": [{ + "flash_bytes": 286788, + "flash_percentage": 21, + "ram_bytes": 11620, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/TWAI/TWAItransmit", + "sizes": [{ + "flash_bytes": 287022, + "flash_percentage": 21, + "ram_bytes": 11628, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Template/ExampleTemplate", + "sizes": [{ + "flash_bytes": 266506, + "flash_percentage": 20, + "ram_bytes": 11604, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Time/SimpleTime", + "sizes": [{ + "flash_bytes": 943656, + "flash_percentage": 71, + "ram_bytes": 36344, + "ram_percentage": 11 + }] + }, +{"name": "ESP32/examples/Timer/RepeatTimer", + "sizes": [{ + "flash_bytes": 292712, + "flash_percentage": 22, + "ram_bytes": 11960, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Timer/WatchdogTimer", + "sizes": [{ + "flash_bytes": 292646, + "flash_percentage": 22, + "ram_bytes": 11952, + "ram_percentage": 3 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c6", + "target": "esp32c6", + "sketches": [ +{"name": "ESP32/examples/TWAI/TWAIreceive", + "sizes": [{ + "flash_bytes": 244825, + "flash_percentage": 18, + "ram_bytes": 12800, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/TWAI/TWAItransmit", + "sizes": [{ + "flash_bytes": 245053, + "flash_percentage": 18, + "ram_bytes": 12800, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Template/ExampleTemplate", + "sizes": [{ + "flash_bytes": 223423, + "flash_percentage": 17, + "ram_bytes": 12784, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Time/SimpleTime", + "sizes": [{ + "flash_bytes": 940653, + "flash_percentage": 71, + "ram_bytes": 42420, + "ram_percentage": 12 + }] + }, +{"name": "ESP32/examples/Timer/RepeatTimer", + "sizes": [{ + "flash_bytes": 250925, + "flash_percentage": 19, + "ram_bytes": 13140, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Timer/WatchdogTimer", + "sizes": [{ + "flash_bytes": 250805, + "flash_percentage": 19, + "ram_bytes": 13124, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Utilities/HEXBuilder", + "sizes": [{ + "flash_bytes": 241829, + "flash_percentage": 18, + "ram_bytes": 12784, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Utilities/MD5Builder", + "sizes": [{ + "flash_bytes": 242081, + "flash_percentage": 18, + "ram_bytes": 12784, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Utilities/SHA1Builder", + "sizes": [{ + "flash_bytes": 248371, + "flash_percentage": 18, + "ram_bytes": 12784, + "ram_percentage": 3 + }] + }, +{"name": "ESP_I2S/examples/ES8388_loopback", + "sizes": [{ + "flash_bytes": 322391, + "flash_percentage": 24, + "ram_bytes": 15340, + "ram_percentage": 4 + }] + }, +{"name": "ESP_I2S/examples/Simple_tone", + "sizes": [{ + "flash_bytes": 266639, + "flash_percentage": 20, + "ram_bytes": 12896, + "ram_percentage": 3 + }] + }, +{"name": "ESP_NOW/examples/ESP_NOW_Broadcast_Master", + "sizes": [{ + "flash_bytes": 935229, + "flash_percentage": 71, + "ram_bytes": 41244, + "ram_percentage": 12 + }] + }, +{"name": "ESP_NOW/examples/ESP_NOW_Broadcast_Slave", + "sizes": [{ + "flash_bytes": 935435, + "flash_percentage": 71, + "ram_bytes": 41212, + "ram_percentage": 12 + }] + }, +{"name": "ESP_NOW/examples/ESP_NOW_Network", + "sizes": [{ + "flash_bytes": 938861, + "flash_percentage": 71, + "ram_bytes": 41308, + "ram_percentage": 12 + }] + }, +{"name": "ESP_NOW/examples/ESP_NOW_Serial", + "sizes": [{ + "flash_bytes": 938125, + "flash_percentage": 71, + "ram_bytes": 41300, + "ram_percentage": 12 + }] + }, +{"name": "ESPmDNS/examples/mDNS-SD_Extended", + "sizes": [{ + "flash_bytes": 957791, + "flash_percentage": 73, + "ram_bytes": 43356, + "ram_percentage": 13 + }] + } +] +}, +{ "board": "espressif:esp32:esp32h2", + "target": "esp32h2", + "sketches": [ +{"name": "ESP32/examples/FreeRTOS/Semaphore", + "sizes": [{ + "flash_bytes": 283059, + "flash_percentage": 21, + "ram_bytes": 12772, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/GPIO/BlinkRGB", + "sizes": [{ + "flash_bytes": 289329, + "flash_percentage": 22, + "ram_bytes": 14000, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/GPIO/FunctionalInterrupt", + "sizes": [{ + "flash_bytes": 291027, + "flash_percentage": 22, + "ram_bytes": 13464, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/GPIO/FunctionalInterruptStruct", + "sizes": [{ + "flash_bytes": 289481, + "flash_percentage": 22, + "ram_bytes": 13456, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/GPIO/GPIOInterrupt", + "sizes": [{ + "flash_bytes": 290117, + "flash_percentage": 22, + "ram_bytes": 13464, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/HWCDC_Events", + "sizes": [{ + "flash_bytes": 316659, + "flash_percentage": 24, + "ram_bytes": 14152, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/MacAddress/GetMacAddress", + "sizes": [{ + "flash_bytes": 285987, + "flash_percentage": 21, + "ram_bytes": 12892, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/RMT/Legacy_RMT_Driver_Compatible", + "sizes": [{ + "flash_bytes": 286373, + "flash_percentage": 21, + "ram_bytes": 12912, + "ram_percentage": 3 + }] + } +] +}, +{ "board": "espressif:esp32:esp32", + "target": "esp32", + "sketches": [ +{"name": "ESP32/examples/ResetReason/ResetReason", + "sizes": [{ + "flash_bytes": 310386, + "flash_percentage": 23, + "ram_bytes": 20632, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/ResetReason/ResetReason2", + "sizes": [{ + "flash_bytes": 304314, + "flash_percentage": 23, + "ram_bytes": 20600, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/BaudRateDetect_Demo", + "sizes": [{ + "flash_bytes": 304174, + "flash_percentage": 23, + "ram_bytes": 20600, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/OnReceiveError_BREAK_Demo", + "sizes": [{ + "flash_bytes": 307090, + "flash_percentage": 23, + "ram_bytes": 20640, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/OnReceive_Demo", + "sizes": [{ + "flash_bytes": 305802, + "flash_percentage": 23, + "ram_bytes": 20608, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/RS485_Echo_Demo", + "sizes": [{ + "flash_bytes": 304834, + "flash_percentage": 23, + "ram_bytes": 20600, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/RxFIFOFull_Demo", + "sizes": [{ + "flash_bytes": 305110, + "flash_percentage": 23, + "ram_bytes": 20600, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/RxTimeout_Demo", + "sizes": [{ + "flash_bytes": 304954, + "flash_percentage": 23, + "ram_bytes": 20600, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/Serial_All_CPU_Freqs", + "sizes": [{ + "flash_bytes": 304750, + "flash_percentage": 23, + "ram_bytes": 20616, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/Serial_STD_Func_OnReceive", + "sizes": [{ + "flash_bytes": 305890, + "flash_percentage": 23, + "ram_bytes": 20708, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/onReceiveExample", + "sizes": [{ + "flash_bytes": 305158, + "flash_percentage": 23, + "ram_bytes": 20624, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/TWAI/TWAIreceive", + "sizes": [{ + "flash_bytes": 309810, + "flash_percentage": 23, + "ram_bytes": 20608, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/TWAI/TWAItransmit", + "sizes": [{ + "flash_bytes": 309990, + "flash_percentage": 23, + "ram_bytes": 20608, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Template/ExampleTemplate", + "sizes": [{ + "flash_bytes": 290258, + "flash_percentage": 22, + "ram_bytes": 20592, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Time/SimpleTime", + "sizes": [{ + "flash_bytes": 920622, + "flash_percentage": 70, + "ram_bytes": 47664, + "ram_percentage": 14 + }] + } +] +} +]} diff --git a/master_cli_compile/cli_compile_5.json b/master_cli_compile/cli_compile_5.json new file mode 100644 index 00000000000..46b127e9a72 --- /dev/null +++ b/master_cli_compile/cli_compile_5.json @@ -0,0 +1,797 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32p4", + "target": "esp32p4", + "sketches": [ +{"name": "ESP32/examples/Utilities/SHA1Builder", + "sizes": [{ + "flash_bytes": 329151, + "flash_percentage": 25, + "ram_bytes": 21496, + "ram_percentage": 6 + }] + }, +{"name": "ESP_I2S/examples/ES8388_loopback", + "sizes": [{ + "flash_bytes": 393707, + "flash_percentage": 30, + "ram_bytes": 23616, + "ram_percentage": 7 + }] + }, +{"name": "ESP_I2S/examples/Record_to_WAV", + "sizes": [{ + "flash_bytes": 449389, + "flash_percentage": 34, + "ram_bytes": 22384, + "ram_percentage": 6 + }] + }, +{"name": "ESP_I2S/examples/Simple_tone", + "sizes": [{ + "flash_bytes": 356269, + "flash_percentage": 27, + "ram_bytes": 21832, + "ram_percentage": 6 + }] + }, +{"name": "ESPmDNS/examples/mDNS-SD_Extended", + "sizes": [{ + "flash_bytes": 680689, + "flash_percentage": 51, + "ram_bytes": 29512, + "ram_percentage": 9 + }] + }, +{"name": "ESPmDNS/examples/mDNS_Web_Server", + "sizes": [{ + "flash_bytes": 711131, + "flash_percentage": 54, + "ram_bytes": 30812, + "ram_percentage": 9 + }] + }, +{"name": "Ethernet/examples/ETH_TLK110", + "sizes": [{ + "flash_bytes": 560087, + "flash_percentage": 42, + "ram_bytes": 26732, + "ram_percentage": 8 + }] + }, +{"name": "Ethernet/examples/ETH_W5500_Arduino_SPI", + "sizes": [{ + "flash_bytes": 606163, + "flash_percentage": 46, + "ram_bytes": 26844, + "ram_percentage": 8 + }] + }, +{"name": "Ethernet/examples/ETH_W5500_IDF_SPI", + "sizes": [{ + "flash_bytes": 604453, + "flash_percentage": 46, + "ram_bytes": 26844, + "ram_percentage": 8 + }] + }, +{"name": "Ethernet/examples/ETH_WIFI_BRIDGE", + "sizes": [{ + "flash_bytes": 745125, + "flash_percentage": 56, + "ram_bytes": 27636, + "ram_percentage": 8 + }] + }, +{"name": "FFat/examples/FFat_Test", + "sizes": [{ + "flash_bytes": 386071, + "flash_percentage": 29, + "ram_bytes": 22284, + "ram_percentage": 6 + }] + }, +{"name": "FFat/examples/FFat_time", + "sizes": [{ + "flash_bytes": 719005, + "flash_percentage": 54, + "ram_bytes": 28724, + "ram_percentage": 8 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s3", + "target": "esp32s3", + "sketches": [ +{"name": "ESP_I2S/examples/Simple_tone", + "sizes": [{ + "flash_bytes": 331182, + "flash_percentage": 25, + "ram_bytes": 20448, + "ram_percentage": 6 + }] + }, +{"name": "ESP_NOW/examples/ESP_NOW_Broadcast_Master", + "sizes": [{ + "flash_bytes": 862062, + "flash_percentage": 65, + "ram_bytes": 44372, + "ram_percentage": 13 + }] + }, +{"name": "ESP_NOW/examples/ESP_NOW_Broadcast_Slave", + "sizes": [{ + "flash_bytes": 862242, + "flash_percentage": 65, + "ram_bytes": 44348, + "ram_percentage": 13 + }] + }, +{"name": "ESP_NOW/examples/ESP_NOW_Network", + "sizes": [{ + "flash_bytes": 865422, + "flash_percentage": 66, + "ram_bytes": 44444, + "ram_percentage": 13 + }] + }, +{"name": "ESP_NOW/examples/ESP_NOW_Serial", + "sizes": [{ + "flash_bytes": 862606, + "flash_percentage": 65, + "ram_bytes": 44436, + "ram_percentage": 13 + }] + }, +{"name": "ESP_SR/examples/Basic", + "sizes": [{ + "flash_bytes": 675382, + "flash_percentage": 21, + "ram_bytes": 31212, + "ram_percentage": 9 + }] + }, +{"name": "ESPmDNS/examples/mDNS-SD_Extended", + "sizes": [{ + "flash_bytes": 879482, + "flash_percentage": 67, + "ram_bytes": 46500, + "ram_percentage": 14 + }] + }, +{"name": "ESPmDNS/examples/mDNS_Web_Server", + "sizes": [{ + "flash_bytes": 897570, + "flash_percentage": 68, + "ram_bytes": 47804, + "ram_percentage": 14 + }] + }, +{"name": "Ethernet/examples/ETH_W5500_Arduino_SPI", + "sizes": [{ + "flash_bytes": 573614, + "flash_percentage": 43, + "ram_bytes": 25988, + "ram_percentage": 7 + }] + }, +{"name": "Ethernet/examples/ETH_W5500_IDF_SPI", + "sizes": [{ + "flash_bytes": 571958, + "flash_percentage": 43, + "ram_bytes": 25988, + "ram_percentage": 7 + }] + }, +{"name": "Ethernet/examples/ETH_WIFI_BRIDGE", + "sizes": [{ + "flash_bytes": 963702, + "flash_percentage": 73, + "ram_bytes": 44972, + "ram_percentage": 13 + }] + }, +{"name": "FFat/examples/FFat_Test", + "sizes": [{ + "flash_bytes": 359750, + "flash_percentage": 27, + "ram_bytes": 21088, + "ram_percentage": 6 + }] + }, +{"name": "FFat/examples/FFat_time", + "sizes": [{ + "flash_bytes": 914558, + "flash_percentage": 69, + "ram_bytes": 45724, + "ram_percentage": 13 + }] + }, +{"name": "HTTPClient/examples/Authorization", + "sizes": [{ + "flash_bytes": 987330, + "flash_percentage": 75, + "ram_bytes": 46132, + "ram_percentage": 14 + }] + }, +{"name": "HTTPClient/examples/BasicHttpClient", + "sizes": [{ + "flash_bytes": 987314, + "flash_percentage": 75, + "ram_bytes": 46132, + "ram_percentage": 14 + }] + }, +{"name": "HTTPClient/examples/BasicHttpsClient", + "sizes": [{ + "flash_bytes": 991998, + "flash_percentage": 75, + "ram_bytes": 46156, + "ram_percentage": 14 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2", + "target": "esp32s2", + "sketches": [ +{"name": "Ethernet/examples/ETH_W5500_Arduino_SPI", + "sizes": [{ + "flash_bytes": 535269, + "flash_percentage": 40, + "ram_bytes": 21016, + "ram_percentage": 6 + }] + }, +{"name": "Ethernet/examples/ETH_W5500_IDF_SPI", + "sizes": [{ + "flash_bytes": 533825, + "flash_percentage": 40, + "ram_bytes": 21016, + "ram_percentage": 6 + }] + }, +{"name": "Ethernet/examples/ETH_WIFI_BRIDGE", + "sizes": [{ + "flash_bytes": 928457, + "flash_percentage": 70, + "ram_bytes": 40124, + "ram_percentage": 12 + }] + }, +{"name": "FFat/examples/FFat_Test", + "sizes": [{ + "flash_bytes": 323725, + "flash_percentage": 24, + "ram_bytes": 16132, + "ram_percentage": 4 + }] + }, +{"name": "FFat/examples/FFat_time", + "sizes": [{ + "flash_bytes": 885041, + "flash_percentage": 67, + "ram_bytes": 40920, + "ram_percentage": 12 + }] + }, +{"name": "HTTPClient/examples/Authorization", + "sizes": [{ + "flash_bytes": 959337, + "flash_percentage": 73, + "ram_bytes": 41328, + "ram_percentage": 12 + }] + }, +{"name": "HTTPClient/examples/BasicHttpClient", + "sizes": [{ + "flash_bytes": 959317, + "flash_percentage": 73, + "ram_bytes": 41328, + "ram_percentage": 12 + }] + }, +{"name": "HTTPClient/examples/BasicHttpsClient", + "sizes": [{ + "flash_bytes": 964129, + "flash_percentage": 73, + "ram_bytes": 41352, + "ram_percentage": 12 + }] + }, +{"name": "HTTPClient/examples/HTTPClientEnterprise", + "sizes": [{ + "flash_bytes": 1013605, + "flash_percentage": 32, + "ram_bytes": 42808, + "ram_percentage": 13 + }] + }, +{"name": "HTTPClient/examples/ReuseConnection", + "sizes": [{ + "flash_bytes": 958957, + "flash_percentage": 73, + "ram_bytes": 41536, + "ram_percentage": 12 + }] + }, +{"name": "HTTPClient/examples/StreamHttpClient", + "sizes": [{ + "flash_bytes": 958677, + "flash_percentage": 73, + "ram_bytes": 41328, + "ram_percentage": 12 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdate", + "sizes": [{ + "flash_bytes": 905841, + "flash_percentage": 69, + "ram_bytes": 41484, + "ram_percentage": 12 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdateSPIFFS", + "sizes": [{ + "flash_bytes": 905117, + "flash_percentage": 69, + "ram_bytes": 41484, + "ram_percentage": 12 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdateSecure", + "sizes": [{ + "flash_bytes": 995701, + "flash_percentage": 31, + "ram_bytes": 42028, + "ram_percentage": 12 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3", + "target": "esp32c3", + "sketches": [ +{"name": "ESP32/examples/Utilities/HEXBuilder", + "sizes": [{ + "flash_bytes": 283992, + "flash_percentage": 21, + "ram_bytes": 11620, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Utilities/MD5Builder", + "sizes": [{ + "flash_bytes": 284248, + "flash_percentage": 21, + "ram_bytes": 11620, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Utilities/SHA1Builder", + "sizes": [{ + "flash_bytes": 290542, + "flash_percentage": 22, + "ram_bytes": 11620, + "ram_percentage": 3 + }] + }, +{"name": "ESP_I2S/examples/ES8388_loopback", + "sizes": [{ + "flash_bytes": 363122, + "flash_percentage": 27, + "ram_bytes": 13536, + "ram_percentage": 4 + }] + }, +{"name": "ESP_I2S/examples/Simple_tone", + "sizes": [{ + "flash_bytes": 308854, + "flash_percentage": 23, + "ram_bytes": 11748, + "ram_percentage": 3 + }] + }, +{"name": "ESP_NOW/examples/ESP_NOW_Broadcast_Master", + "sizes": [{ + "flash_bytes": 927928, + "flash_percentage": 70, + "ram_bytes": 35160, + "ram_percentage": 10 + }] + }, +{"name": "ESP_NOW/examples/ESP_NOW_Broadcast_Slave", + "sizes": [{ + "flash_bytes": 928128, + "flash_percentage": 70, + "ram_bytes": 35128, + "ram_percentage": 10 + }] + }, +{"name": "ESP_NOW/examples/ESP_NOW_Network", + "sizes": [{ + "flash_bytes": 931560, + "flash_percentage": 71, + "ram_bytes": 35224, + "ram_percentage": 10 + }] + }, +{"name": "ESP_NOW/examples/ESP_NOW_Serial", + "sizes": [{ + "flash_bytes": 930842, + "flash_percentage": 71, + "ram_bytes": 35216, + "ram_percentage": 10 + }] + }, +{"name": "ESPmDNS/examples/mDNS-SD_Extended", + "sizes": [{ + "flash_bytes": 950518, + "flash_percentage": 72, + "ram_bytes": 37272, + "ram_percentage": 11 + }] + }, +{"name": "ESPmDNS/examples/mDNS_Web_Server", + "sizes": [{ + "flash_bytes": 972884, + "flash_percentage": 74, + "ram_bytes": 38568, + "ram_percentage": 11 + }] + }, +{"name": "Ethernet/examples/ETH_W5500_Arduino_SPI", + "sizes": [{ + "flash_bytes": 578776, + "flash_percentage": 44, + "ram_bytes": 17780, + "ram_percentage": 5 + }] + }, +{"name": "Ethernet/examples/ETH_W5500_IDF_SPI", + "sizes": [{ + "flash_bytes": 577092, + "flash_percentage": 44, + "ram_bytes": 17780, + "ram_percentage": 5 + }] + }, +{"name": "Ethernet/examples/ETH_WIFI_BRIDGE", + "sizes": [{ + "flash_bytes": 1034232, + "flash_percentage": 78, + "ram_bytes": 36272, + "ram_percentage": 11 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c6", + "target": "esp32c6", + "sketches": [ +{"name": "ESPmDNS/examples/mDNS_Web_Server", + "sizes": [{ + "flash_bytes": 980609, + "flash_percentage": 74, + "ram_bytes": 44636, + "ram_percentage": 13 + }] + }, +{"name": "Ethernet/examples/ETH_W5500_Arduino_SPI", + "sizes": [{ + "flash_bytes": 536997, + "flash_percentage": 40, + "ram_bytes": 18976, + "ram_percentage": 5 + }] + }, +{"name": "Ethernet/examples/ETH_W5500_IDF_SPI", + "sizes": [{ + "flash_bytes": 535331, + "flash_percentage": 40, + "ram_bytes": 18976, + "ram_percentage": 5 + }] + }, +{"name": "Ethernet/examples/ETH_WIFI_BRIDGE", + "sizes": [{ + "flash_bytes": 1041255, + "flash_percentage": 79, + "ram_bytes": 42356, + "ram_percentage": 12 + }] + }, +{"name": "FFat/examples/FFat_Test", + "sizes": [{ + "flash_bytes": 294611, + "flash_percentage": 22, + "ram_bytes": 13572, + "ram_percentage": 4 + }] + }, +{"name": "FFat/examples/FFat_time", + "sizes": [{ + "flash_bytes": 985883, + "flash_percentage": 75, + "ram_bytes": 42564, + "ram_percentage": 12 + }] + }, +{"name": "HTTPClient/examples/Authorization", + "sizes": [{ + "flash_bytes": 1066467, + "flash_percentage": 81, + "ram_bytes": 42980, + "ram_percentage": 13 + }] + }, +{"name": "HTTPClient/examples/BasicHttpClient", + "sizes": [{ + "flash_bytes": 1066451, + "flash_percentage": 81, + "ram_bytes": 42980, + "ram_percentage": 13 + }] + }, +{"name": "HTTPClient/examples/BasicHttpsClient", + "sizes": [{ + "flash_bytes": 1071197, + "flash_percentage": 81, + "ram_bytes": 43012, + "ram_percentage": 13 + }] + }, +{"name": "HTTPClient/examples/HTTPClientEnterprise", + "sizes": [{ + "flash_bytes": 1126633, + "flash_percentage": 35, + "ram_bytes": 44372, + "ram_percentage": 13 + }] + }, +{"name": "HTTPClient/examples/ReuseConnection", + "sizes": [{ + "flash_bytes": 1066003, + "flash_percentage": 81, + "ram_bytes": 43188, + "ram_percentage": 13 + }] + }, +{"name": "HTTPClient/examples/StreamHttpClient", + "sizes": [{ + "flash_bytes": 1065441, + "flash_percentage": 81, + "ram_bytes": 42980, + "ram_percentage": 13 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdate", + "sizes": [{ + "flash_bytes": 1009083, + "flash_percentage": 76, + "ram_bytes": 43772, + "ram_percentage": 13 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdateSPIFFS", + "sizes": [{ + "flash_bytes": 1008465, + "flash_percentage": 76, + "ram_bytes": 43772, + "ram_percentage": 13 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdateSecure", + "sizes": [{ + "flash_bytes": 1107355, + "flash_percentage": 35, + "ram_bytes": 44316, + "ram_percentage": 13 + }] + }, +{"name": "HTTPUpdateServer/examples/WebUpdater", + "sizes": [{ + "flash_bytes": 1049121, + "flash_percentage": 80, + "ram_bytes": 46196, + "ram_percentage": 14 + }] + } +] +}, +{ "board": "espressif:esp32:esp32h2", + "target": "esp32h2", + "sketches": [ +{"name": "ESP32/examples/RMT/RMTCallback", + "sizes": [{ + "flash_bytes": 304161, + "flash_percentage": 23, + "ram_bytes": 14628, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/RMT/RMTLoopback", + "sizes": [{ + "flash_bytes": 305827, + "flash_percentage": 23, + "ram_bytes": 16052, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/RMT/RMTReadXJT", + "sizes": [{ + "flash_bytes": 304759, + "flash_percentage": 23, + "ram_bytes": 14500, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/RMT/RMTWrite_RGB_LED", + "sizes": [{ + "flash_bytes": 303325, + "flash_percentage": 23, + "ram_bytes": 17084, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/RMT/RMT_CPUFreq_Test", + "sizes": [{ + "flash_bytes": 304281, + "flash_percentage": 23, + "ram_bytes": 13996, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/RMT/RMT_EndOfTransmissionState", + "sizes": [{ + "flash_bytes": 303863, + "flash_percentage": 23, + "ram_bytes": 14068, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/RMT/RMT_LED_Blink", + "sizes": [{ + "flash_bytes": 306131, + "flash_percentage": 23, + "ram_bytes": 14124, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/ResetReason/ResetReason", + "sizes": [{ + "flash_bytes": 283953, + "flash_percentage": 21, + "ram_bytes": 12764, + "ram_percentage": 3 + }] + } +] +}, +{ "board": "espressif:esp32:esp32", + "target": "esp32", + "sketches": [ +{"name": "ESP32/examples/Timer/RepeatTimer", + "sizes": [{ + "flash_bytes": 313822, + "flash_percentage": 23, + "ram_bytes": 20632, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Timer/WatchdogTimer", + "sizes": [{ + "flash_bytes": 313646, + "flash_percentage": 23, + "ram_bytes": 20608, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Touch/TouchInterrupt", + "sizes": [{ + "flash_bytes": 311314, + "flash_percentage": 23, + "ram_bytes": 20760, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Touch/TouchRead", + "sizes": [{ + "flash_bytes": 312018, + "flash_percentage": 23, + "ram_bytes": 20752, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Utilities/HEXBuilder", + "sizes": [{ + "flash_bytes": 306022, + "flash_percentage": 23, + "ram_bytes": 20600, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Utilities/MD5Builder", + "sizes": [{ + "flash_bytes": 306266, + "flash_percentage": 23, + "ram_bytes": 20600, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Utilities/SHA1Builder", + "sizes": [{ + "flash_bytes": 311110, + "flash_percentage": 23, + "ram_bytes": 20600, + "ram_percentage": 6 + }] + }, +{"name": "ESP_I2S/examples/ES8388_loopback", + "sizes": [{ + "flash_bytes": 359214, + "flash_percentage": 27, + "ram_bytes": 22072, + "ram_percentage": 6 + }] + }, +{"name": "ESP_I2S/examples/Record_to_WAV", + "sizes": [{ + "flash_bytes": 408410, + "flash_percentage": 31, + "ram_bytes": 21476, + "ram_percentage": 6 + }] + }, +{"name": "ESP_I2S/examples/Simple_tone", + "sizes": [{ + "flash_bytes": 328094, + "flash_percentage": 25, + "ram_bytes": 20856, + "ram_percentage": 6 + }] + }, +{"name": "ESP_NOW/examples/ESP_NOW_Broadcast_Master", + "sizes": [{ + "flash_bytes": 906574, + "flash_percentage": 69, + "ram_bytes": 45292, + "ram_percentage": 13 + }] + }, +{"name": "ESP_NOW/examples/ESP_NOW_Broadcast_Slave", + "sizes": [{ + "flash_bytes": 906798, + "flash_percentage": 69, + "ram_bytes": 45260, + "ram_percentage": 13 + }] + }, +{"name": "ESP_NOW/examples/ESP_NOW_Network", + "sizes": [{ + "flash_bytes": 910350, + "flash_percentage": 69, + "ram_bytes": 45464, + "ram_percentage": 13 + }] + }, +{"name": "ESP_NOW/examples/ESP_NOW_Serial", + "sizes": [{ + "flash_bytes": 907378, + "flash_percentage": 69, + "ram_bytes": 45356, + "ram_percentage": 13 + }] + }, +{"name": "ESPmDNS/examples/mDNS-SD_Extended", + "sizes": [{ + "flash_bytes": 924582, + "flash_percentage": 70, + "ram_bytes": 47412, + "ram_percentage": 14 + }] + } +] +} +]} diff --git a/master_cli_compile/cli_compile_6.json b/master_cli_compile/cli_compile_6.json new file mode 100644 index 00000000000..b9b9534485d --- /dev/null +++ b/master_cli_compile/cli_compile_6.json @@ -0,0 +1,797 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32p4", + "target": "esp32p4", + "sketches": [ +{"name": "HTTPClient/examples/Authorization", + "sizes": [{ + "flash_bytes": 887221, + "flash_percentage": 67, + "ram_bytes": 29432, + "ram_percentage": 8 + }] + }, +{"name": "HTTPClient/examples/BasicHttpClient", + "sizes": [{ + "flash_bytes": 887213, + "flash_percentage": 67, + "ram_bytes": 29432, + "ram_percentage": 8 + }] + }, +{"name": "HTTPClient/examples/BasicHttpsClient", + "sizes": [{ + "flash_bytes": 891909, + "flash_percentage": 68, + "ram_bytes": 29456, + "ram_percentage": 8 + }] + }, +{"name": "HTTPClient/examples/ReuseConnection", + "sizes": [{ + "flash_bytes": 886753, + "flash_percentage": 67, + "ram_bytes": 29640, + "ram_percentage": 9 + }] + }, +{"name": "HTTPClient/examples/StreamHttpClient", + "sizes": [{ + "flash_bytes": 886207, + "flash_percentage": 67, + "ram_bytes": 29432, + "ram_percentage": 8 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdate", + "sizes": [{ + "flash_bytes": 731771, + "flash_percentage": 55, + "ram_bytes": 29104, + "ram_percentage": 8 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdateSPIFFS", + "sizes": [{ + "flash_bytes": 731157, + "flash_percentage": 55, + "ram_bytes": 29104, + "ram_percentage": 8 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdateSecure", + "sizes": [{ + "flash_bytes": 907679, + "flash_percentage": 28, + "ram_bytes": 29856, + "ram_percentage": 9 + }] + }, +{"name": "HTTPUpdateServer/examples/WebUpdater", + "sizes": [{ + "flash_bytes": 767015, + "flash_percentage": 58, + "ram_bytes": 31512, + "ram_percentage": 9 + }] + }, +{"name": "LittleFS/examples/LITTLEFS_test", + "sizes": [{ + "flash_bytes": 371357, + "flash_percentage": 28, + "ram_bytes": 22164, + "ram_percentage": 6 + }] + }, +{"name": "LittleFS/examples/LITTLEFS_time", + "sizes": [{ + "flash_bytes": 717999, + "flash_percentage": 54, + "ram_bytes": 28752, + "ram_percentage": 8 + }] + }, +{"name": "NetBIOS/examples/ESP_NBNST", + "sizes": [{ + "flash_bytes": 651143, + "flash_percentage": 49, + "ram_bytes": 27212, + "ram_percentage": 8 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s3", + "target": "esp32s3", + "sketches": [ +{"name": "HTTPClient/examples/HTTPClientEnterprise", + "sizes": [{ + "flash_bytes": 1042702, + "flash_percentage": 33, + "ram_bytes": 47604, + "ram_percentage": 14 + }] + }, +{"name": "HTTPClient/examples/ReuseConnection", + "sizes": [{ + "flash_bytes": 986950, + "flash_percentage": 75, + "ram_bytes": 46340, + "ram_percentage": 14 + }] + }, +{"name": "HTTPClient/examples/StreamHttpClient", + "sizes": [{ + "flash_bytes": 986694, + "flash_percentage": 75, + "ram_bytes": 46132, + "ram_percentage": 14 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdate", + "sizes": [{ + "flash_bytes": 942190, + "flash_percentage": 71, + "ram_bytes": 46380, + "ram_percentage": 14 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdateSPIFFS", + "sizes": [{ + "flash_bytes": 941478, + "flash_percentage": 71, + "ram_bytes": 46380, + "ram_percentage": 14 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdateSecure", + "sizes": [{ + "flash_bytes": 1030538, + "flash_percentage": 32, + "ram_bytes": 46916, + "ram_percentage": 14 + }] + }, +{"name": "HTTPUpdateServer/examples/WebUpdater", + "sizes": [{ + "flash_bytes": 968450, + "flash_percentage": 73, + "ram_bytes": 48740, + "ram_percentage": 14 + }] + }, +{"name": "Insights/examples/DiagnosticsSmokeTest", + "sizes": [{ + "flash_bytes": 989690, + "flash_percentage": 75, + "ram_bytes": 47676, + "ram_percentage": 14 + }] + }, +{"name": "Insights/examples/MinimalDiagnostics", + "sizes": [{ + "flash_bytes": 989154, + "flash_percentage": 75, + "ram_bytes": 47556, + "ram_percentage": 14 + }] + }, +{"name": "LittleFS/examples/LITTLEFS_test", + "sizes": [{ + "flash_bytes": 345134, + "flash_percentage": 26, + "ram_bytes": 20984, + "ram_percentage": 6 + }] + }, +{"name": "LittleFS/examples/LITTLEFS_time", + "sizes": [{ + "flash_bytes": 913870, + "flash_percentage": 69, + "ram_bytes": 45740, + "ram_percentage": 13 + }] + }, +{"name": "Matter/examples/MatterColorLight", + "sizes": [{ + "flash_bytes": 1711010, + "flash_percentage": 54, + "ram_bytes": 99796, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterCommissionTest", + "sizes": [{ + "flash_bytes": 1667150, + "flash_percentage": 52, + "ram_bytes": 99396, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterComposedLights", + "sizes": [{ + "flash_bytes": 1688926, + "flash_percentage": 53, + "ram_bytes": 99596, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterContactSensor", + "sizes": [{ + "flash_bytes": 1688350, + "flash_percentage": 53, + "ram_bytes": 99732, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterDimmableLight", + "sizes": [{ + "flash_bytes": 1696822, + "flash_percentage": 53, + "ram_bytes": 99796, + "ram_percentage": 30 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2", + "target": "esp32s2", + "sketches": [ +{"name": "HTTPUpdateServer/examples/WebUpdater", + "sizes": [{ + "flash_bytes": 934045, + "flash_percentage": 71, + "ram_bytes": 43868, + "ram_percentage": 13 + }] + }, +{"name": "Insights/examples/DiagnosticsSmokeTest", + "sizes": [{ + "flash_bytes": 961429, + "flash_percentage": 73, + "ram_bytes": 42848, + "ram_percentage": 13 + }] + }, +{"name": "Insights/examples/MinimalDiagnostics", + "sizes": [{ + "flash_bytes": 960913, + "flash_percentage": 73, + "ram_bytes": 42736, + "ram_percentage": 13 + }] + }, +{"name": "LittleFS/examples/LITTLEFS_test", + "sizes": [{ + "flash_bytes": 309641, + "flash_percentage": 23, + "ram_bytes": 16004, + "ram_percentage": 4 + }] + }, +{"name": "LittleFS/examples/LITTLEFS_time", + "sizes": [{ + "flash_bytes": 884373, + "flash_percentage": 67, + "ram_bytes": 40952, + "ram_percentage": 12 + }] + }, +{"name": "Matter/examples/MatterColorLight", + "sizes": [{ + "flash_bytes": 1675001, + "flash_percentage": 53, + "ram_bytes": 94908, + "ram_percentage": 28 + }] + }, +{"name": "Matter/examples/MatterCommissionTest", + "sizes": [{ + "flash_bytes": 1637429, + "flash_percentage": 52, + "ram_bytes": 94576, + "ram_percentage": 28 + }] + }, +{"name": "Matter/examples/MatterComposedLights", + "sizes": [{ + "flash_bytes": 1659381, + "flash_percentage": 52, + "ram_bytes": 94784, + "ram_percentage": 28 + }] + }, +{"name": "Matter/examples/MatterContactSensor", + "sizes": [{ + "flash_bytes": 1652249, + "flash_percentage": 52, + "ram_bytes": 94860, + "ram_percentage": 28 + }] + }, +{"name": "Matter/examples/MatterDimmableLight", + "sizes": [{ + "flash_bytes": 1660709, + "flash_percentage": 52, + "ram_bytes": 94908, + "ram_percentage": 28 + }] + }, +{"name": "Matter/examples/MatterEnhancedColorLight", + "sizes": [{ + "flash_bytes": 1682025, + "flash_percentage": 53, + "ram_bytes": 94948, + "ram_percentage": 28 + }] + }, +{"name": "Matter/examples/MatterFan", + "sizes": [{ + "flash_bytes": 1662653, + "flash_percentage": 52, + "ram_bytes": 95084, + "ram_percentage": 29 + }] + }, +{"name": "Matter/examples/MatterHumiditySensor", + "sizes": [{ + "flash_bytes": 1637741, + "flash_percentage": 52, + "ram_bytes": 94600, + "ram_percentage": 28 + }] + }, +{"name": "Matter/examples/MatterMinimum", + "sizes": [{ + "flash_bytes": 1655101, + "flash_percentage": 52, + "ram_bytes": 94884, + "ram_percentage": 28 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3", + "target": "esp32c3", + "sketches": [ +{"name": "FFat/examples/FFat_Test", + "sizes": [{ + "flash_bytes": 347064, + "flash_percentage": 26, + "ram_bytes": 12400, + "ram_percentage": 3 + }] + }, +{"name": "FFat/examples/FFat_time", + "sizes": [{ + "flash_bytes": 988504, + "flash_percentage": 75, + "ram_bytes": 36472, + "ram_percentage": 11 + }] + }, +{"name": "HTTPClient/examples/Authorization", + "sizes": [{ + "flash_bytes": 1067690, + "flash_percentage": 81, + "ram_bytes": 36880, + "ram_percentage": 11 + }] + }, +{"name": "HTTPClient/examples/BasicHttpClient", + "sizes": [{ + "flash_bytes": 1067674, + "flash_percentage": 81, + "ram_bytes": 36880, + "ram_percentage": 11 + }] + }, +{"name": "HTTPClient/examples/BasicHttpsClient", + "sizes": [{ + "flash_bytes": 1072520, + "flash_percentage": 81, + "ram_bytes": 36912, + "ram_percentage": 11 + }] + }, +{"name": "HTTPClient/examples/HTTPClientEnterprise", + "sizes": [{ + "flash_bytes": 1125908, + "flash_percentage": 35, + "ram_bytes": 37672, + "ram_percentage": 11 + }] + }, +{"name": "HTTPClient/examples/ReuseConnection", + "sizes": [{ + "flash_bytes": 1067226, + "flash_percentage": 81, + "ram_bytes": 37088, + "ram_percentage": 11 + }] + }, +{"name": "HTTPClient/examples/StreamHttpClient", + "sizes": [{ + "flash_bytes": 1066664, + "flash_percentage": 81, + "ram_bytes": 36880, + "ram_percentage": 11 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdate", + "sizes": [{ + "flash_bytes": 1008836, + "flash_percentage": 76, + "ram_bytes": 37664, + "ram_percentage": 11 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdateSPIFFS", + "sizes": [{ + "flash_bytes": 1008216, + "flash_percentage": 76, + "ram_bytes": 37664, + "ram_percentage": 11 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdateSecure", + "sizes": [{ + "flash_bytes": 1107206, + "flash_percentage": 35, + "ram_bytes": 38224, + "ram_percentage": 11 + }] + }, +{"name": "HTTPUpdateServer/examples/WebUpdater", + "sizes": [{ + "flash_bytes": 1041684, + "flash_percentage": 79, + "ram_bytes": 40104, + "ram_percentage": 12 + }] + }, +{"name": "Insights/examples/DiagnosticsSmokeTest", + "sizes": [{ + "flash_bytes": 1071092, + "flash_percentage": 81, + "ram_bytes": 38416, + "ram_percentage": 11 + }] + }, +{"name": "Insights/examples/MinimalDiagnostics", + "sizes": [{ + "flash_bytes": 1070466, + "flash_percentage": 81, + "ram_bytes": 38304, + "ram_percentage": 11 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c6", + "target": "esp32c6", + "sketches": [ +{"name": "Insights/examples/DiagnosticsSmokeTest", + "sizes": [{ + "flash_bytes": 1105577, + "flash_percentage": 84, + "ram_bytes": 44500, + "ram_percentage": 13 + }] + }, +{"name": "Insights/examples/MinimalDiagnostics", + "sizes": [{ + "flash_bytes": 1104939, + "flash_percentage": 84, + "ram_bytes": 44380, + "ram_percentage": 13 + }] + }, +{"name": "LittleFS/examples/LITTLEFS_test", + "sizes": [{ + "flash_bytes": 290529, + "flash_percentage": 22, + "ram_bytes": 13448, + "ram_percentage": 4 + }] + }, +{"name": "LittleFS/examples/LITTLEFS_time", + "sizes": [{ + "flash_bytes": 984889, + "flash_percentage": 75, + "ram_bytes": 42580, + "ram_percentage": 12 + }] + }, +{"name": "Matter/examples/MatterColorLight", + "sizes": [{ + "flash_bytes": 1707401, + "flash_percentage": 54, + "ram_bytes": 97212, + "ram_percentage": 29 + }] + }, +{"name": "Matter/examples/MatterCommissionTest", + "sizes": [{ + "flash_bytes": 1658009, + "flash_percentage": 52, + "ram_bytes": 96236, + "ram_percentage": 29 + }] + }, +{"name": "Matter/examples/MatterComposedLights", + "sizes": [{ + "flash_bytes": 1690523, + "flash_percentage": 53, + "ram_bytes": 96420, + "ram_percentage": 29 + }] + }, +{"name": "Matter/examples/MatterContactSensor", + "sizes": [{ + "flash_bytes": 1672947, + "flash_percentage": 53, + "ram_bytes": 97156, + "ram_percentage": 29 + }] + }, +{"name": "Matter/examples/MatterDimmableLight", + "sizes": [{ + "flash_bytes": 1684773, + "flash_percentage": 53, + "ram_bytes": 97212, + "ram_percentage": 29 + }] + }, +{"name": "Matter/examples/MatterEnhancedColorLight", + "sizes": [{ + "flash_bytes": 1718041, + "flash_percentage": 54, + "ram_bytes": 97260, + "ram_percentage": 29 + }] + }, +{"name": "Matter/examples/MatterFan", + "sizes": [{ + "flash_bytes": 1687801, + "flash_percentage": 53, + "ram_bytes": 97580, + "ram_percentage": 29 + }] + }, +{"name": "Matter/examples/MatterHumiditySensor", + "sizes": [{ + "flash_bytes": 1656013, + "flash_percentage": 52, + "ram_bytes": 96236, + "ram_percentage": 29 + }] + }, +{"name": "Matter/examples/MatterMinimum", + "sizes": [{ + "flash_bytes": 1678305, + "flash_percentage": 53, + "ram_bytes": 97180, + "ram_percentage": 29 + }] + }, +{"name": "Matter/examples/MatterOccupancySensor", + "sizes": [{ + "flash_bytes": 1657759, + "flash_percentage": 52, + "ram_bytes": 96236, + "ram_percentage": 29 + }] + }, +{"name": "Matter/examples/MatterOnIdentify", + "sizes": [{ + "flash_bytes": 1679855, + "flash_percentage": 53, + "ram_bytes": 97180, + "ram_percentage": 29 + }] + }, +{"name": "Matter/examples/MatterOnOffLight", + "sizes": [{ + "flash_bytes": 1680673, + "flash_percentage": 53, + "ram_bytes": 97188, + "ram_percentage": 29 + }] + } +] +}, +{ "board": "espressif:esp32:esp32h2", + "target": "esp32h2", + "sketches": [ +{"name": "ESP32/examples/ResetReason/ResetReason2", + "sizes": [{ + "flash_bytes": 283081, + "flash_percentage": 21, + "ram_bytes": 12764, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Serial/BaudRateDetect_Demo", + "sizes": [{ + "flash_bytes": 283045, + "flash_percentage": 21, + "ram_bytes": 12764, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Serial/OnReceiveError_BREAK_Demo", + "sizes": [{ + "flash_bytes": 286337, + "flash_percentage": 21, + "ram_bytes": 12804, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Serial/OnReceive_Demo", + "sizes": [{ + "flash_bytes": 284839, + "flash_percentage": 21, + "ram_bytes": 12780, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Serial/RS485_Echo_Demo", + "sizes": [{ + "flash_bytes": 283679, + "flash_percentage": 21, + "ram_bytes": 12764, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Serial/RxFIFOFull_Demo", + "sizes": [{ + "flash_bytes": 284243, + "flash_percentage": 21, + "ram_bytes": 12772, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Serial/RxTimeout_Demo", + "sizes": [{ + "flash_bytes": 284089, + "flash_percentage": 21, + "ram_bytes": 12772, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Serial/Serial_All_CPU_Freqs", + "sizes": [{ + "flash_bytes": 283867, + "flash_percentage": 21, + "ram_bytes": 12788, + "ram_percentage": 3 + }] + } +] +}, +{ "board": "espressif:esp32:esp32", + "target": "esp32", + "sketches": [ +{"name": "ESPmDNS/examples/mDNS_Web_Server", + "sizes": [{ + "flash_bytes": 943306, + "flash_percentage": 71, + "ram_bytes": 48708, + "ram_percentage": 14 + }] + }, +{"name": "Ethernet/examples/ETH_LAN8720", + "sizes": [{ + "flash_bytes": 522542, + "flash_percentage": 39, + "ram_bytes": 25648, + "ram_percentage": 7 + }] + }, +{"name": "Ethernet/examples/ETH_TLK110", + "sizes": [{ + "flash_bytes": 522542, + "flash_percentage": 39, + "ram_bytes": 25648, + "ram_percentage": 7 + }] + }, +{"name": "Ethernet/examples/ETH_W5500_Arduino_SPI", + "sizes": [{ + "flash_bytes": 559346, + "flash_percentage": 42, + "ram_bytes": 25664, + "ram_percentage": 7 + }] + }, +{"name": "Ethernet/examples/ETH_W5500_IDF_SPI", + "sizes": [{ + "flash_bytes": 557834, + "flash_percentage": 42, + "ram_bytes": 25664, + "ram_percentage": 7 + }] + }, +{"name": "Ethernet/examples/ETH_WIFI_BRIDGE", + "sizes": [{ + "flash_bytes": 987606, + "flash_percentage": 75, + "ram_bytes": 45564, + "ram_percentage": 13 + }] + }, +{"name": "FFat/examples/FFat_Test", + "sizes": [{ + "flash_bytes": 361530, + "flash_percentage": 27, + "ram_bytes": 21644, + "ram_percentage": 6 + }] + }, +{"name": "FFat/examples/FFat_time", + "sizes": [{ + "flash_bytes": 959062, + "flash_percentage": 73, + "ram_bytes": 46996, + "ram_percentage": 14 + }] + }, +{"name": "HTTPClient/examples/Authorization", + "sizes": [{ + "flash_bytes": 1033278, + "flash_percentage": 78, + "ram_bytes": 48372, + "ram_percentage": 14 + }] + }, +{"name": "HTTPClient/examples/BasicHttpClient", + "sizes": [{ + "flash_bytes": 1033258, + "flash_percentage": 78, + "ram_bytes": 48372, + "ram_percentage": 14 + }] + }, +{"name": "HTTPClient/examples/BasicHttpsClient", + "sizes": [{ + "flash_bytes": 1037898, + "flash_percentage": 79, + "ram_bytes": 48572, + "ram_percentage": 14 + }] + }, +{"name": "HTTPClient/examples/HTTPClientEnterprise", + "sizes": [{ + "flash_bytes": 1088738, + "flash_percentage": 34, + "ram_bytes": 49796, + "ram_percentage": 15 + }] + }, +{"name": "HTTPClient/examples/ReuseConnection", + "sizes": [{ + "flash_bytes": 1032886, + "flash_percentage": 78, + "ram_bytes": 48580, + "ram_percentage": 14 + }] + }, +{"name": "HTTPClient/examples/StreamHttpClient", + "sizes": [{ + "flash_bytes": 1032586, + "flash_percentage": 78, + "ram_bytes": 48372, + "ram_percentage": 14 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdate", + "sizes": [{ + "flash_bytes": 966878, + "flash_percentage": 73, + "ram_bytes": 48244, + "ram_percentage": 14 + }] + } +] +} +]} diff --git a/master_cli_compile/cli_compile_7.json b/master_cli_compile/cli_compile_7.json new file mode 100644 index 00000000000..d59b05591cd --- /dev/null +++ b/master_cli_compile/cli_compile_7.json @@ -0,0 +1,797 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32p4", + "target": "esp32p4", + "sketches": [ +{"name": "NetworkClientSecure/examples/WiFiClientInsecure", + "sizes": [{ + "flash_bytes": 847077, + "flash_percentage": 64, + "ram_bytes": 29388, + "ram_percentage": 8 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientPSK", + "sizes": [{ + "flash_bytes": 847109, + "flash_percentage": 64, + "ram_bytes": 29420, + "ram_percentage": 8 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientSecure", + "sizes": [{ + "flash_bytes": 848955, + "flash_percentage": 26, + "ram_bytes": 29388, + "ram_percentage": 8 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientSecureProtocolUpgrade", + "sizes": [{ + "flash_bytes": 848073, + "flash_percentage": 64, + "ram_bytes": 29388, + "ram_percentage": 8 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientShowPeerCredentials", + "sizes": [{ + "flash_bytes": 889171, + "flash_percentage": 67, + "ram_bytes": 29400, + "ram_percentage": 8 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientTrustOnFirstUse", + "sizes": [{ + "flash_bytes": 866697, + "flash_percentage": 66, + "ram_bytes": 29392, + "ram_percentage": 8 + }] + }, +{"name": "PPP/examples/PPP_Basic", + "sizes": [{ + "flash_bytes": 574475, + "flash_percentage": 43, + "ram_bytes": 26512, + "ram_percentage": 8 + }] + }, +{"name": "PPP/examples/PPP_WIFI_BRIDGE", + "sizes": [{ + "flash_bytes": 722321, + "flash_percentage": 55, + "ram_bytes": 27360, + "ram_percentage": 8 + }] + }, +{"name": "Preferences/examples/Prefs2Struct", + "sizes": [{ + "flash_bytes": 329889, + "flash_percentage": 25, + "ram_bytes": 21516, + "ram_percentage": 6 + }] + }, +{"name": "Preferences/examples/StartCounter", + "sizes": [{ + "flash_bytes": 329621, + "flash_percentage": 25, + "ram_bytes": 21524, + "ram_percentage": 6 + }] + }, +{"name": "SD/examples/SD_Test", + "sizes": [{ + "flash_bytes": 391635, + "flash_percentage": 29, + "ram_bytes": 22272, + "ram_percentage": 6 + }] + }, +{"name": "SD/examples/SD_time", + "sizes": [{ + "flash_bytes": 721081, + "flash_percentage": 55, + "ram_bytes": 28688, + "ram_percentage": 8 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s3", + "target": "esp32s3", + "sketches": [ +{"name": "Matter/examples/MatterEnhancedColorLight", + "sizes": [{ + "flash_bytes": 1718114, + "flash_percentage": 54, + "ram_bytes": 99836, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterFan", + "sizes": [{ + "flash_bytes": 1701566, + "flash_percentage": 54, + "ram_bytes": 100132, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterHumiditySensor", + "sizes": [{ + "flash_bytes": 1667374, + "flash_percentage": 53, + "ram_bytes": 99412, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterMinimum", + "sizes": [{ + "flash_bytes": 1691198, + "flash_percentage": 53, + "ram_bytes": 99756, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterOccupancySensor", + "sizes": [{ + "flash_bytes": 1668438, + "flash_percentage": 53, + "ram_bytes": 99412, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterOnIdentify", + "sizes": [{ + "flash_bytes": 1692426, + "flash_percentage": 53, + "ram_bytes": 99756, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterOnOffLight", + "sizes": [{ + "flash_bytes": 1694010, + "flash_percentage": 53, + "ram_bytes": 99764, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterOnOffPlugin", + "sizes": [{ + "flash_bytes": 1693930, + "flash_percentage": 53, + "ram_bytes": 99764, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterPressureSensor", + "sizes": [{ + "flash_bytes": 1667382, + "flash_percentage": 53, + "ram_bytes": 99412, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterSmartButon", + "sizes": [{ + "flash_bytes": 1668170, + "flash_percentage": 53, + "ram_bytes": 99436, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterTemperatureLight", + "sizes": [{ + "flash_bytes": 1716530, + "flash_percentage": 54, + "ram_bytes": 99812, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterTemperatureSensor", + "sizes": [{ + "flash_bytes": 1667414, + "flash_percentage": 53, + "ram_bytes": 99412, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterThermostat", + "sizes": [{ + "flash_bytes": 1681950, + "flash_percentage": 53, + "ram_bytes": 99548, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/WiFiProvWithinMatter", + "sizes": [{ + "flash_bytes": 2329462, + "flash_percentage": 74, + "ram_bytes": 122532, + "ram_percentage": 37 + }] + }, +{"name": "NetBIOS/examples/ESP_NBNST", + "sizes": [{ + "flash_bytes": 854846, + "flash_percentage": 65, + "ram_bytes": 44228, + "ram_percentage": 13 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientInsecure", + "sizes": [{ + "flash_bytes": 949570, + "flash_percentage": 72, + "ram_bytes": 46044, + "ram_percentage": 14 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2", + "target": "esp32s2", + "sketches": [ +{"name": "Matter/examples/MatterOccupancySensor", + "sizes": [{ + "flash_bytes": 1638825, + "flash_percentage": 52, + "ram_bytes": 94600, + "ram_percentage": 28 + }] + }, +{"name": "Matter/examples/MatterOnIdentify", + "sizes": [{ + "flash_bytes": 1656349, + "flash_percentage": 52, + "ram_bytes": 94884, + "ram_percentage": 28 + }] + }, +{"name": "Matter/examples/MatterOnOffLight", + "sizes": [{ + "flash_bytes": 1657897, + "flash_percentage": 52, + "ram_bytes": 94892, + "ram_percentage": 28 + }] + }, +{"name": "Matter/examples/MatterOnOffPlugin", + "sizes": [{ + "flash_bytes": 1657825, + "flash_percentage": 52, + "ram_bytes": 94892, + "ram_percentage": 28 + }] + }, +{"name": "Matter/examples/MatterPressureSensor", + "sizes": [{ + "flash_bytes": 1637757, + "flash_percentage": 52, + "ram_bytes": 94600, + "ram_percentage": 28 + }] + }, +{"name": "Matter/examples/MatterSmartButon", + "sizes": [{ + "flash_bytes": 1638585, + "flash_percentage": 52, + "ram_bytes": 94624, + "ram_percentage": 28 + }] + }, +{"name": "Matter/examples/MatterTemperatureLight", + "sizes": [{ + "flash_bytes": 1680529, + "flash_percentage": 53, + "ram_bytes": 94924, + "ram_percentage": 28 + }] + }, +{"name": "Matter/examples/MatterTemperatureSensor", + "sizes": [{ + "flash_bytes": 1637777, + "flash_percentage": 52, + "ram_bytes": 94600, + "ram_percentage": 28 + }] + }, +{"name": "Matter/examples/MatterThermostat", + "sizes": [{ + "flash_bytes": 1652269, + "flash_percentage": 52, + "ram_bytes": 94736, + "ram_percentage": 28 + }] + }, +{"name": "Matter/examples/WiFiProvWithinMatter", + "sizes": [{ + "flash_bytes": 1788929, + "flash_percentage": 56, + "ram_bytes": 94956, + "ram_percentage": 28 + }] + }, +{"name": "NetBIOS/examples/ESP_NBNST", + "sizes": [{ + "flash_bytes": 826017, + "flash_percentage": 63, + "ram_bytes": 39424, + "ram_percentage": 12 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientInsecure", + "sizes": [{ + "flash_bytes": 922209, + "flash_percentage": 70, + "ram_bytes": 41240, + "ram_percentage": 12 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientPSK", + "sizes": [{ + "flash_bytes": 922249, + "flash_percentage": 70, + "ram_bytes": 41272, + "ram_percentage": 12 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientSecure", + "sizes": [{ + "flash_bytes": 924049, + "flash_percentage": 29, + "ram_bytes": 41240, + "ram_percentage": 12 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3", + "target": "esp32c3", + "sketches": [ +{"name": "LittleFS/examples/LITTLEFS_test", + "sizes": [{ + "flash_bytes": 332376, + "flash_percentage": 25, + "ram_bytes": 12284, + "ram_percentage": 3 + }] + }, +{"name": "LittleFS/examples/LITTLEFS_time", + "sizes": [{ + "flash_bytes": 987616, + "flash_percentage": 75, + "ram_bytes": 36488, + "ram_percentage": 11 + }] + }, +{"name": "Matter/examples/MatterColorLight", + "sizes": [{ + "flash_bytes": 1698572, + "flash_percentage": 53, + "ram_bytes": 91128, + "ram_percentage": 27 + }] + }, +{"name": "Matter/examples/MatterCommissionTest", + "sizes": [{ + "flash_bytes": 1649504, + "flash_percentage": 52, + "ram_bytes": 90152, + "ram_percentage": 27 + }] + }, +{"name": "Matter/examples/MatterComposedLights", + "sizes": [{ + "flash_bytes": 1681564, + "flash_percentage": 53, + "ram_bytes": 90312, + "ram_percentage": 27 + }] + }, +{"name": "Matter/examples/MatterContactSensor", + "sizes": [{ + "flash_bytes": 1664402, + "flash_percentage": 52, + "ram_bytes": 91072, + "ram_percentage": 27 + }] + }, +{"name": "Matter/examples/MatterDimmableLight", + "sizes": [{ + "flash_bytes": 1676258, + "flash_percentage": 53, + "ram_bytes": 91128, + "ram_percentage": 27 + }] + }, +{"name": "Matter/examples/MatterEnhancedColorLight", + "sizes": [{ + "flash_bytes": 1709130, + "flash_percentage": 54, + "ram_bytes": 91160, + "ram_percentage": 27 + }] + }, +{"name": "Matter/examples/MatterFan", + "sizes": [{ + "flash_bytes": 1676436, + "flash_percentage": 53, + "ram_bytes": 91296, + "ram_percentage": 27 + }] + }, +{"name": "Matter/examples/MatterHumiditySensor", + "sizes": [{ + "flash_bytes": 1647232, + "flash_percentage": 52, + "ram_bytes": 90144, + "ram_percentage": 27 + }] + }, +{"name": "Matter/examples/MatterMinimum", + "sizes": [{ + "flash_bytes": 1669772, + "flash_percentage": 53, + "ram_bytes": 91096, + "ram_percentage": 27 + }] + }, +{"name": "Matter/examples/MatterOccupancySensor", + "sizes": [{ + "flash_bytes": 1648988, + "flash_percentage": 52, + "ram_bytes": 90144, + "ram_percentage": 27 + }] + }, +{"name": "Matter/examples/MatterOnIdentify", + "sizes": [{ + "flash_bytes": 1671324, + "flash_percentage": 53, + "ram_bytes": 91096, + "ram_percentage": 27 + }] + }, +{"name": "Matter/examples/MatterOnOffLight", + "sizes": [{ + "flash_bytes": 1672144, + "flash_percentage": 53, + "ram_bytes": 91104, + "ram_percentage": 27 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c6", + "target": "esp32c6", + "sketches": [ +{"name": "Matter/examples/MatterOnOffPlugin", + "sizes": [{ + "flash_bytes": 1680577, + "flash_percentage": 53, + "ram_bytes": 97188, + "ram_percentage": 29 + }] + }, +{"name": "Matter/examples/MatterPressureSensor", + "sizes": [{ + "flash_bytes": 1655989, + "flash_percentage": 52, + "ram_bytes": 96236, + "ram_percentage": 29 + }] + }, +{"name": "Matter/examples/MatterSmartButon", + "sizes": [{ + "flash_bytes": 1657709, + "flash_percentage": 52, + "ram_bytes": 96252, + "ram_percentage": 29 + }] + }, +{"name": "Matter/examples/MatterTemperatureLight", + "sizes": [{ + "flash_bytes": 1716011, + "flash_percentage": 54, + "ram_bytes": 97228, + "ram_percentage": 29 + }] + }, +{"name": "Matter/examples/MatterTemperatureSensor", + "sizes": [{ + "flash_bytes": 1656029, + "flash_percentage": 52, + "ram_bytes": 96236, + "ram_percentage": 29 + }] + }, +{"name": "Matter/examples/MatterThermostat", + "sizes": [{ + "flash_bytes": 1679077, + "flash_percentage": 53, + "ram_bytes": 96364, + "ram_percentage": 29 + }] + }, +{"name": "Matter/examples/WiFiProvWithinMatter", + "sizes": [{ + "flash_bytes": 2516589, + "flash_percentage": 80, + "ram_bytes": 119592, + "ram_percentage": 36 + }] + }, +{"name": "NetBIOS/examples/ESP_NBNST", + "sizes": [{ + "flash_bytes": 928485, + "flash_percentage": 70, + "ram_bytes": 41068, + "ram_percentage": 12 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientInsecure", + "sizes": [{ + "flash_bytes": 1035489, + "flash_percentage": 79, + "ram_bytes": 42892, + "ram_percentage": 13 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientPSK", + "sizes": [{ + "flash_bytes": 1035523, + "flash_percentage": 79, + "ram_bytes": 42916, + "ram_percentage": 13 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientSecure", + "sizes": [{ + "flash_bytes": 1037371, + "flash_percentage": 32, + "ram_bytes": 42900, + "ram_percentage": 13 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientSecureEnterprise", + "sizes": [{ + "flash_bytes": 1100121, + "flash_percentage": 34, + "ram_bytes": 44340, + "ram_percentage": 13 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientSecureProtocolUpgrade", + "sizes": [{ + "flash_bytes": 1036509, + "flash_percentage": 79, + "ram_bytes": 42892, + "ram_percentage": 13 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientShowPeerCredentials", + "sizes": [{ + "flash_bytes": 1068893, + "flash_percentage": 81, + "ram_bytes": 42916, + "ram_percentage": 13 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientTrustOnFirstUse", + "sizes": [{ + "flash_bytes": 1049577, + "flash_percentage": 80, + "ram_bytes": 42924, + "ram_percentage": 13 + }] + }, +{"name": "OpenThread/examples/COAP/coap_lamp", + "sizes": [{ + "flash_bytes": 1088613, + "flash_percentage": 83, + "ram_bytes": 47900, + "ram_percentage": 14 + }] + } +] +}, +{ "board": "espressif:esp32:esp32h2", + "target": "esp32h2", + "sketches": [ +{"name": "ESP32/examples/Serial/Serial_STD_Func_OnReceive", + "sizes": [{ + "flash_bytes": 284591, + "flash_percentage": 21, + "ram_bytes": 12772, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Serial/onReceiveExample", + "sizes": [{ + "flash_bytes": 284275, + "flash_percentage": 21, + "ram_bytes": 12788, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/TWAI/TWAIreceive", + "sizes": [{ + "flash_bytes": 287841, + "flash_percentage": 21, + "ram_bytes": 12780, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/TWAI/TWAItransmit", + "sizes": [{ + "flash_bytes": 288083, + "flash_percentage": 21, + "ram_bytes": 12780, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Template/ExampleTemplate", + "sizes": [{ + "flash_bytes": 267271, + "flash_percentage": 20, + "ram_bytes": 12764, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Timer/RepeatTimer", + "sizes": [{ + "flash_bytes": 294255, + "flash_percentage": 22, + "ram_bytes": 13136, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Timer/WatchdogTimer", + "sizes": [{ + "flash_bytes": 294131, + "flash_percentage": 22, + "ram_bytes": 13120, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Utilities/HEXBuilder", + "sizes": [{ + "flash_bytes": 285115, + "flash_percentage": 21, + "ram_bytes": 12764, + "ram_percentage": 3 + }] + } +] +}, +{ "board": "espressif:esp32:esp32", + "target": "esp32", + "sketches": [ +{"name": "HTTPUpdate/examples/httpUpdateSPIFFS", + "sizes": [{ + "flash_bytes": 966130, + "flash_percentage": 73, + "ram_bytes": 48244, + "ram_percentage": 14 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdateSecure", + "sizes": [{ + "flash_bytes": 1056634, + "flash_percentage": 33, + "ram_bytes": 48980, + "ram_percentage": 14 + }] + }, +{"name": "HTTPUpdateServer/examples/WebUpdater", + "sizes": [{ + "flash_bytes": 993434, + "flash_percentage": 75, + "ram_bytes": 49308, + "ram_percentage": 15 + }] + }, +{"name": "Insights/examples/DiagnosticsSmokeTest", + "sizes": [{ + "flash_bytes": 1033886, + "flash_percentage": 78, + "ram_bytes": 48540, + "ram_percentage": 14 + }] + }, +{"name": "Insights/examples/MinimalDiagnostics", + "sizes": [{ + "flash_bytes": 1033418, + "flash_percentage": 78, + "ram_bytes": 48428, + "ram_percentage": 14 + }] + }, +{"name": "LittleFS/examples/LITTLEFS_test", + "sizes": [{ + "flash_bytes": 347338, + "flash_percentage": 26, + "ram_bytes": 21272, + "ram_percentage": 6 + }] + }, +{"name": "LittleFS/examples/LITTLEFS_time", + "sizes": [{ + "flash_bytes": 958346, + "flash_percentage": 73, + "ram_bytes": 46932, + "ram_percentage": 14 + }] + }, +{"name": "Matter/examples/MatterColorLight", + "sizes": [{ + "flash_bytes": 1765478, + "flash_percentage": 56, + "ram_bytes": 100644, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterCommissionTest", + "sizes": [{ + "flash_bytes": 1732782, + "flash_percentage": 55, + "ram_bytes": 100408, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterComposedLights", + "sizes": [{ + "flash_bytes": 1756398, + "flash_percentage": 55, + "ram_bytes": 100560, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterContactSensor", + "sizes": [{ + "flash_bytes": 1733806, + "flash_percentage": 55, + "ram_bytes": 100376, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterDimmableLight", + "sizes": [{ + "flash_bytes": 1750546, + "flash_percentage": 55, + "ram_bytes": 100644, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterEnhancedColorLight", + "sizes": [{ + "flash_bytes": 1772694, + "flash_percentage": 56, + "ram_bytes": 100684, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterFan", + "sizes": [{ + "flash_bytes": 1754906, + "flash_percentage": 55, + "ram_bytes": 100804, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterHumiditySensor", + "sizes": [{ + "flash_bytes": 1733706, + "flash_percentage": 55, + "ram_bytes": 100376, + "ram_percentage": 30 + }] + } +] +} +]} diff --git a/master_cli_compile/cli_compile_8.json b/master_cli_compile/cli_compile_8.json new file mode 100644 index 00000000000..8ef994198ee --- /dev/null +++ b/master_cli_compile/cli_compile_8.json @@ -0,0 +1,797 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32p4", + "target": "esp32p4", + "sketches": [ +{"name": "SD_MMC/examples/SD2USBMSC", + "sizes": [{ + "flash_bytes": 454539, + "flash_percentage": 34, + "ram_bytes": 49984, + "ram_percentage": 15 + }] + }, +{"name": "SD_MMC/examples/SDMMC_Test", + "sizes": [{ + "flash_bytes": 418585, + "flash_percentage": 31, + "ram_bytes": 22728, + "ram_percentage": 6 + }] + }, +{"name": "SD_MMC/examples/SDMMC_time", + "sizes": [{ + "flash_bytes": 719209, + "flash_percentage": 54, + "ram_bytes": 28732, + "ram_percentage": 8 + }] + }, +{"name": "SPI/examples/SPI_Multiple_Buses", + "sizes": [{ + "flash_bytes": 311553, + "flash_percentage": 23, + "ram_bytes": 21564, + "ram_percentage": 6 + }] + }, +{"name": "SPIFFS/examples/SPIFFS_Test", + "sizes": [{ + "flash_bytes": 363527, + "flash_percentage": 27, + "ram_bytes": 22032, + "ram_percentage": 6 + }] + }, +{"name": "SPIFFS/examples/SPIFFS_time", + "sizes": [{ + "flash_bytes": 711225, + "flash_percentage": 54, + "ram_bytes": 28620, + "ram_percentage": 8 + }] + }, +{"name": "TFLiteMicro/examples/hello_world", + "sizes": [{ + "flash_bytes": 343265, + "flash_percentage": 26, + "ram_bytes": 23820, + "ram_percentage": 7 + }] + }, +{"name": "Ticker/examples/Blinker", + "sizes": [{ + "flash_bytes": 310857, + "flash_percentage": 23, + "ram_bytes": 21612, + "ram_percentage": 6 + }] + }, +{"name": "Ticker/examples/TickerBasic", + "sizes": [{ + "flash_bytes": 310647, + "flash_percentage": 23, + "ram_bytes": 21580, + "ram_percentage": 6 + }] + }, +{"name": "Ticker/examples/TickerParameter", + "sizes": [{ + "flash_bytes": 310527, + "flash_percentage": 23, + "ram_bytes": 21612, + "ram_percentage": 6 + }] + }, +{"name": "USB/examples/CompositeDevice", + "sizes": [{ + "flash_bytes": 414785, + "flash_percentage": 31, + "ram_bytes": 49720, + "ram_percentage": 15 + }] + }, +{"name": "USB/examples/ConsumerControl", + "sizes": [{ + "flash_bytes": 350155, + "flash_percentage": 26, + "ram_bytes": 49284, + "ram_percentage": 15 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s3", + "target": "esp32s3", + "sketches": [ +{"name": "NetworkClientSecure/examples/WiFiClientPSK", + "sizes": [{ + "flash_bytes": 949634, + "flash_percentage": 72, + "ram_bytes": 46092, + "ram_percentage": 14 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientSecure", + "sizes": [{ + "flash_bytes": 951438, + "flash_percentage": 30, + "ram_bytes": 46060, + "ram_percentage": 14 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientSecureEnterprise", + "sizes": [{ + "flash_bytes": 1008694, + "flash_percentage": 32, + "ram_bytes": 47564, + "ram_percentage": 14 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientSecureProtocolUpgrade", + "sizes": [{ + "flash_bytes": 950338, + "flash_percentage": 72, + "ram_bytes": 46044, + "ram_percentage": 14 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientShowPeerCredentials", + "sizes": [{ + "flash_bytes": 991554, + "flash_percentage": 75, + "ram_bytes": 46068, + "ram_percentage": 14 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientTrustOnFirstUse", + "sizes": [{ + "flash_bytes": 963090, + "flash_percentage": 73, + "ram_bytes": 46116, + "ram_percentage": 14 + }] + }, +{"name": "PPP/examples/PPP_Basic", + "sizes": [{ + "flash_bytes": 548190, + "flash_percentage": 41, + "ram_bytes": 25692, + "ram_percentage": 7 + }] + }, +{"name": "PPP/examples/PPP_WIFI_BRIDGE", + "sizes": [{ + "flash_bytes": 942890, + "flash_percentage": 71, + "ram_bytes": 44716, + "ram_percentage": 13 + }] + }, +{"name": "Preferences/examples/Prefs2Struct", + "sizes": [{ + "flash_bytes": 310446, + "flash_percentage": 23, + "ram_bytes": 20344, + "ram_percentage": 6 + }] + }, +{"name": "Preferences/examples/StartCounter", + "sizes": [{ + "flash_bytes": 311262, + "flash_percentage": 23, + "ram_bytes": 20328, + "ram_percentage": 6 + }] + }, +{"name": "RainMaker/examples/RMakerCustom", + "sizes": [{ + "flash_bytes": 1817062, + "flash_percentage": 44, + "ram_bytes": 71252, + "ram_percentage": 21 + }] + }, +{"name": "RainMaker/examples/RMakerCustomAirCooler", + "sizes": [{ + "flash_bytes": 1804934, + "flash_percentage": 44, + "ram_bytes": 71368, + "ram_percentage": 21 + }] + }, +{"name": "RainMaker/examples/RMakerSonoffDualR3", + "sizes": [{ + "flash_bytes": 1820454, + "flash_percentage": 45, + "ram_bytes": 71828, + "ram_percentage": 21 + }] + }, +{"name": "RainMaker/examples/RMakerSwitch", + "sizes": [{ + "flash_bytes": 1828530, + "flash_percentage": 45, + "ram_bytes": 71332, + "ram_percentage": 21 + }] + }, +{"name": "SD/examples/SD_Test", + "sizes": [{ + "flash_bytes": 390054, + "flash_percentage": 9, + "ram_bytes": 21788, + "ram_percentage": 6 + }] + }, +{"name": "SD/examples/SD_time", + "sizes": [{ + "flash_bytes": 941638, + "flash_percentage": 71, + "ram_bytes": 46076, + "ram_percentage": 14 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2", + "target": "esp32s2", + "sketches": [ +{"name": "NetworkClientSecure/examples/WiFiClientSecureEnterprise", + "sizes": [{ + "flash_bytes": 979733, + "flash_percentage": 31, + "ram_bytes": 42784, + "ram_percentage": 13 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientSecureProtocolUpgrade", + "sizes": [{ + "flash_bytes": 922937, + "flash_percentage": 70, + "ram_bytes": 41240, + "ram_percentage": 12 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientShowPeerCredentials", + "sizes": [{ + "flash_bytes": 963549, + "flash_percentage": 73, + "ram_bytes": 41264, + "ram_percentage": 12 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientTrustOnFirstUse", + "sizes": [{ + "flash_bytes": 935705, + "flash_percentage": 71, + "ram_bytes": 41328, + "ram_percentage": 12 + }] + }, +{"name": "PPP/examples/PPP_Basic", + "sizes": [{ + "flash_bytes": 507781, + "flash_percentage": 38, + "ram_bytes": 20656, + "ram_percentage": 6 + }] + }, +{"name": "PPP/examples/PPP_WIFI_BRIDGE", + "sizes": [{ + "flash_bytes": 908201, + "flash_percentage": 69, + "ram_bytes": 39844, + "ram_percentage": 12 + }] + }, +{"name": "Preferences/examples/Prefs2Struct", + "sizes": [{ + "flash_bytes": 275217, + "flash_percentage": 20, + "ram_bytes": 15372, + "ram_percentage": 4 + }] + }, +{"name": "Preferences/examples/StartCounter", + "sizes": [{ + "flash_bytes": 276033, + "flash_percentage": 21, + "ram_bytes": 15372, + "ram_percentage": 4 + }] + }, +{"name": "RainMaker/examples/RMakerCustom", + "sizes": [{ + "flash_bytes": 1277481, + "flash_percentage": 31, + "ram_bytes": 43692, + "ram_percentage": 13 + }] + }, +{"name": "RainMaker/examples/RMakerCustomAirCooler", + "sizes": [{ + "flash_bytes": 1265725, + "flash_percentage": 31, + "ram_bytes": 43820, + "ram_percentage": 13 + }] + }, +{"name": "RainMaker/examples/RMakerSonoffDualR3", + "sizes": [{ + "flash_bytes": 1280633, + "flash_percentage": 31, + "ram_bytes": 44260, + "ram_percentage": 13 + }] + }, +{"name": "RainMaker/examples/RMakerSwitch", + "sizes": [{ + "flash_bytes": 1288637, + "flash_percentage": 31, + "ram_bytes": 43788, + "ram_percentage": 13 + }] + }, +{"name": "SD/examples/SD_Test", + "sizes": [{ + "flash_bytes": 347085, + "flash_percentage": 8, + "ram_bytes": 16776, + "ram_percentage": 5 + }] + }, +{"name": "SD/examples/SD_time", + "sizes": [{ + "flash_bytes": 905389, + "flash_percentage": 69, + "ram_bytes": 41220, + "ram_percentage": 12 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3", + "target": "esp32c3", + "sketches": [ +{"name": "Matter/examples/MatterOnOffPlugin", + "sizes": [{ + "flash_bytes": 1672048, + "flash_percentage": 53, + "ram_bytes": 91104, + "ram_percentage": 27 + }] + }, +{"name": "Matter/examples/MatterPressureSensor", + "sizes": [{ + "flash_bytes": 1647208, + "flash_percentage": 52, + "ram_bytes": 90144, + "ram_percentage": 27 + }] + }, +{"name": "Matter/examples/MatterSmartButon", + "sizes": [{ + "flash_bytes": 1648922, + "flash_percentage": 52, + "ram_bytes": 90160, + "ram_percentage": 27 + }] + }, +{"name": "Matter/examples/MatterTemperatureLight", + "sizes": [{ + "flash_bytes": 1707096, + "flash_percentage": 54, + "ram_bytes": 91144, + "ram_percentage": 27 + }] + }, +{"name": "Matter/examples/MatterTemperatureSensor", + "sizes": [{ + "flash_bytes": 1647246, + "flash_percentage": 52, + "ram_bytes": 90144, + "ram_percentage": 27 + }] + }, +{"name": "Matter/examples/MatterThermostat", + "sizes": [{ + "flash_bytes": 1666346, + "flash_percentage": 52, + "ram_bytes": 90280, + "ram_percentage": 27 + }] + }, +{"name": "Matter/examples/WiFiProvWithinMatter", + "sizes": [{ + "flash_bytes": 2409776, + "flash_percentage": 76, + "ram_bytes": 113896, + "ram_percentage": 34 + }] + }, +{"name": "NetBIOS/examples/ESP_NBNST", + "sizes": [{ + "flash_bytes": 921210, + "flash_percentage": 70, + "ram_bytes": 34984, + "ram_percentage": 10 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientInsecure", + "sizes": [{ + "flash_bytes": 1027748, + "flash_percentage": 78, + "ram_bytes": 36808, + "ram_percentage": 11 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientPSK", + "sizes": [{ + "flash_bytes": 1027782, + "flash_percentage": 78, + "ram_bytes": 36848, + "ram_percentage": 11 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientSecure", + "sizes": [{ + "flash_bytes": 1029630, + "flash_percentage": 32, + "ram_bytes": 36816, + "ram_percentage": 11 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientSecureEnterprise", + "sizes": [{ + "flash_bytes": 1090442, + "flash_percentage": 34, + "ram_bytes": 37648, + "ram_percentage": 11 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientSecureProtocolUpgrade", + "sizes": [{ + "flash_bytes": 1028762, + "flash_percentage": 78, + "ram_bytes": 36808, + "ram_percentage": 11 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientShowPeerCredentials", + "sizes": [{ + "flash_bytes": 1069860, + "flash_percentage": 81, + "ram_bytes": 36832, + "ram_percentage": 11 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c6", + "target": "esp32c6", + "sketches": [ +{"name": "OpenThread/examples/COAP/coap_switch", + "sizes": [{ + "flash_bytes": 1088649, + "flash_percentage": 83, + "ram_bytes": 47880, + "ram_percentage": 14 + }] + }, +{"name": "OpenThread/examples/SimpleCLI", + "sizes": [{ + "flash_bytes": 1066069, + "flash_percentage": 81, + "ram_bytes": 46560, + "ram_percentage": 14 + }] + }, +{"name": "OpenThread/examples/SimpleNode", + "sizes": [{ + "flash_bytes": 1068035, + "flash_percentage": 81, + "ram_bytes": 46560, + "ram_percentage": 14 + }] + }, +{"name": "OpenThread/examples/SimpleThreadNetwork/ExtendedRouterNode", + "sizes": [{ + "flash_bytes": 1069363, + "flash_percentage": 81, + "ram_bytes": 46560, + "ram_percentage": 14 + }] + }, +{"name": "OpenThread/examples/SimpleThreadNetwork/LeaderNode", + "sizes": [{ + "flash_bytes": 1066665, + "flash_percentage": 81, + "ram_bytes": 46560, + "ram_percentage": 14 + }] + }, +{"name": "OpenThread/examples/SimpleThreadNetwork/RouterNode", + "sizes": [{ + "flash_bytes": 1066731, + "flash_percentage": 81, + "ram_bytes": 46560, + "ram_percentage": 14 + }] + }, +{"name": "OpenThread/examples/ThreadScan", + "sizes": [{ + "flash_bytes": 1066407, + "flash_percentage": 81, + "ram_bytes": 46560, + "ram_percentage": 14 + }] + }, +{"name": "OpenThread/examples/onReceive", + "sizes": [{ + "flash_bytes": 1065951, + "flash_percentage": 81, + "ram_bytes": 46560, + "ram_percentage": 14 + }] + }, +{"name": "PPP/examples/PPP_Basic", + "sizes": [{ + "flash_bytes": 510533, + "flash_percentage": 38, + "ram_bytes": 18700, + "ram_percentage": 5 + }] + }, +{"name": "PPP/examples/PPP_WIFI_BRIDGE", + "sizes": [{ + "flash_bytes": 1020261, + "flash_percentage": 77, + "ram_bytes": 42132, + "ram_percentage": 12 + }] + }, +{"name": "Preferences/examples/Prefs2Struct", + "sizes": [{ + "flash_bytes": 249261, + "flash_percentage": 19, + "ram_bytes": 12808, + "ram_percentage": 3 + }] + }, +{"name": "Preferences/examples/StartCounter", + "sizes": [{ + "flash_bytes": 249021, + "flash_percentage": 18, + "ram_bytes": 12808, + "ram_percentage": 3 + }] + }, +{"name": "RainMaker/examples/RMakerCustom", + "sizes": [{ + "flash_bytes": 2145855, + "flash_percentage": 53, + "ram_bytes": 68288, + "ram_percentage": 20 + }] + }, +{"name": "RainMaker/examples/RMakerCustomAirCooler", + "sizes": [{ + "flash_bytes": 2132555, + "flash_percentage": 52, + "ram_bytes": 68432, + "ram_percentage": 20 + }] + }, +{"name": "RainMaker/examples/RMakerSonoffDualR3", + "sizes": [{ + "flash_bytes": 2148357, + "flash_percentage": 53, + "ram_bytes": 68688, + "ram_percentage": 20 + }] + }, +{"name": "RainMaker/examples/RMakerSwitch", + "sizes": [{ + "flash_bytes": 2159037, + "flash_percentage": 53, + "ram_bytes": 68376, + "ram_percentage": 20 + }] + } +] +}, +{ "board": "espressif:esp32:esp32h2", + "target": "esp32h2", + "sketches": [ +{"name": "ESP32/examples/Utilities/MD5Builder", + "sizes": [{ + "flash_bytes": 285377, + "flash_percentage": 21, + "ram_bytes": 12764, + "ram_percentage": 3 + }] + }, +{"name": "ESP32/examples/Utilities/SHA1Builder", + "sizes": [{ + "flash_bytes": 291665, + "flash_percentage": 22, + "ram_bytes": 12764, + "ram_percentage": 3 + }] + }, +{"name": "ESP_I2S/examples/ES8388_loopback", + "sizes": [{ + "flash_bytes": 364805, + "flash_percentage": 27, + "ram_bytes": 15384, + "ram_percentage": 4 + }] + }, +{"name": "ESP_I2S/examples/Simple_tone", + "sizes": [{ + "flash_bytes": 309815, + "flash_percentage": 23, + "ram_bytes": 12900, + "ram_percentage": 3 + }] + }, +{"name": "Ethernet/examples/ETH_W5500_Arduino_SPI", + "sizes": [{ + "flash_bytes": 573755, + "flash_percentage": 43, + "ram_bytes": 18980, + "ram_percentage": 5 + }] + }, +{"name": "Ethernet/examples/ETH_W5500_IDF_SPI", + "sizes": [{ + "flash_bytes": 572089, + "flash_percentage": 43, + "ram_bytes": 18980, + "ram_percentage": 5 + }] + }, +{"name": "FFat/examples/FFat_Test", + "sizes": [{ + "flash_bytes": 348307, + "flash_percentage": 26, + "ram_bytes": 13560, + "ram_percentage": 4 + }] + }, +{"name": "LittleFS/examples/LITTLEFS_test", + "sizes": [{ + "flash_bytes": 333655, + "flash_percentage": 25, + "ram_bytes": 13436, + "ram_percentage": 4 + }] + } +] +}, +{ "board": "espressif:esp32:esp32", + "target": "esp32", + "sketches": [ +{"name": "Matter/examples/MatterMinimum", + "sizes": [{ + "flash_bytes": 1736942, + "flash_percentage": 55, + "ram_bytes": 100400, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterOccupancySensor", + "sizes": [{ + "flash_bytes": 1734818, + "flash_percentage": 55, + "ram_bytes": 100376, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterOnIdentify", + "sizes": [{ + "flash_bytes": 1738214, + "flash_percentage": 55, + "ram_bytes": 100400, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterOnOffLight", + "sizes": [{ + "flash_bytes": 1739806, + "flash_percentage": 55, + "ram_bytes": 100408, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterOnOffPlugin", + "sizes": [{ + "flash_bytes": 1739738, + "flash_percentage": 55, + "ram_bytes": 100408, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterPressureSensor", + "sizes": [{ + "flash_bytes": 1733710, + "flash_percentage": 55, + "ram_bytes": 100376, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterSmartButon", + "sizes": [{ + "flash_bytes": 1734574, + "flash_percentage": 55, + "ram_bytes": 100400, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterTemperatureLight", + "sizes": [{ + "flash_bytes": 1764674, + "flash_percentage": 56, + "ram_bytes": 100660, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterTemperatureSensor", + "sizes": [{ + "flash_bytes": 1733726, + "flash_percentage": 55, + "ram_bytes": 100376, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/MatterThermostat", + "sizes": [{ + "flash_bytes": 1748586, + "flash_percentage": 55, + "ram_bytes": 100512, + "ram_percentage": 30 + }] + }, +{"name": "Matter/examples/WiFiProvWithinMatter", + "sizes": [{ + "flash_bytes": 2561638, + "flash_percentage": 81, + "ram_bytes": 114828, + "ram_percentage": 35 + }] + }, +{"name": "NetBIOS/examples/ESP_NBNST", + "sizes": [{ + "flash_bytes": 899326, + "flash_percentage": 68, + "ram_bytes": 45140, + "ram_percentage": 13 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientInsecure", + "sizes": [{ + "flash_bytes": 996042, + "flash_percentage": 75, + "ram_bytes": 46956, + "ram_percentage": 14 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientPSK", + "sizes": [{ + "flash_bytes": 996078, + "flash_percentage": 75, + "ram_bytes": 46996, + "ram_percentage": 14 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientSecure", + "sizes": [{ + "flash_bytes": 997906, + "flash_percentage": 31, + "ram_bytes": 46972, + "ram_percentage": 14 + }] + } +] +} +]} diff --git a/master_cli_compile/cli_compile_9.json b/master_cli_compile/cli_compile_9.json new file mode 100644 index 00000000000..28fb73bdad4 --- /dev/null +++ b/master_cli_compile/cli_compile_9.json @@ -0,0 +1,797 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32p4", + "target": "esp32p4", + "sketches": [ +{"name": "USB/examples/CustomHIDDevice", + "sizes": [{ + "flash_bytes": 367215, + "flash_percentage": 28, + "ram_bytes": 49304, + "ram_percentage": 15 + }] + }, +{"name": "USB/examples/FirmwareMSC", + "sizes": [{ + "flash_bytes": 392957, + "flash_percentage": 29, + "ram_bytes": 49280, + "ram_percentage": 15 + }] + }, +{"name": "USB/examples/Gamepad", + "sizes": [{ + "flash_bytes": 367553, + "flash_percentage": 28, + "ram_bytes": 49304, + "ram_percentage": 15 + }] + }, +{"name": "USB/examples/HIDVendor", + "sizes": [{ + "flash_bytes": 371025, + "flash_percentage": 28, + "ram_bytes": 49368, + "ram_percentage": 15 + }] + }, +{"name": "USB/examples/Keyboard/KeyboardLogout", + "sizes": [{ + "flash_bytes": 351911, + "flash_percentage": 26, + "ram_bytes": 49308, + "ram_percentage": 15 + }] + }, +{"name": "USB/examples/Keyboard/KeyboardMessage", + "sizes": [{ + "flash_bytes": 352263, + "flash_percentage": 26, + "ram_bytes": 49316, + "ram_percentage": 15 + }] + }, +{"name": "USB/examples/Keyboard/KeyboardReprogram", + "sizes": [{ + "flash_bytes": 352455, + "flash_percentage": 26, + "ram_bytes": 49308, + "ram_percentage": 15 + }] + }, +{"name": "USB/examples/Keyboard/KeyboardSerial", + "sizes": [{ + "flash_bytes": 364369, + "flash_percentage": 27, + "ram_bytes": 49304, + "ram_percentage": 15 + }] + }, +{"name": "USB/examples/KeyboardAndMouseControl", + "sizes": [{ + "flash_bytes": 368963, + "flash_percentage": 28, + "ram_bytes": 49320, + "ram_percentage": 15 + }] + }, +{"name": "USB/examples/MIDI/MidiController", + "sizes": [{ + "flash_bytes": 371841, + "flash_percentage": 28, + "ram_bytes": 49392, + "ram_percentage": 15 + }] + }, +{"name": "USB/examples/MIDI/MidiInterface", + "sizes": [{ + "flash_bytes": 362255, + "flash_percentage": 27, + "ram_bytes": 49264, + "ram_percentage": 15 + }] + }, +{"name": "USB/examples/MIDI/MidiMusicBox", + "sizes": [{ + "flash_bytes": 366017, + "flash_percentage": 27, + "ram_bytes": 49288, + "ram_percentage": 15 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s3", + "target": "esp32s3", + "sketches": [ +{"name": "SD_MMC/examples/SD2USBMSC", + "sizes": [{ + "flash_bytes": 447526, + "flash_percentage": 34, + "ram_bytes": 40884, + "ram_percentage": 12 + }] + }, +{"name": "SD_MMC/examples/SDMMC_Test", + "sizes": [{ + "flash_bytes": 386190, + "flash_percentage": 29, + "ram_bytes": 21344, + "ram_percentage": 6 + }] + }, +{"name": "SD_MMC/examples/SDMMC_time", + "sizes": [{ + "flash_bytes": 944418, + "flash_percentage": 72, + "ram_bytes": 46068, + "ram_percentage": 14 + }] + }, +{"name": "SPI/examples/SPI_Multiple_Buses", + "sizes": [{ + "flash_bytes": 322206, + "flash_percentage": 24, + "ram_bytes": 21092, + "ram_percentage": 6 + }] + }, +{"name": "SPIFFS/examples/SPIFFS_Test", + "sizes": [{ + "flash_bytes": 339070, + "flash_percentage": 25, + "ram_bytes": 20848, + "ram_percentage": 6 + }] + }, +{"name": "SPIFFS/examples/SPIFFS_time", + "sizes": [{ + "flash_bytes": 908502, + "flash_percentage": 69, + "ram_bytes": 45604, + "ram_percentage": 13 + }] + }, +{"name": "SimpleBLE/examples/SimpleBleDevice", + "sizes": [{ + "flash_bytes": 881402, + "flash_percentage": 67, + "ram_bytes": 48324, + "ram_percentage": 14 + }] + }, +{"name": "TFLiteMicro/examples/hello_world", + "sizes": [{ + "flash_bytes": 324994, + "flash_percentage": 24, + "ram_bytes": 22632, + "ram_percentage": 6 + }] + }, +{"name": "Ticker/examples/Blinker", + "sizes": [{ + "flash_bytes": 318566, + "flash_percentage": 24, + "ram_bytes": 21084, + "ram_percentage": 6 + }] + }, +{"name": "Ticker/examples/TickerBasic", + "sizes": [{ + "flash_bytes": 318374, + "flash_percentage": 24, + "ram_bytes": 21028, + "ram_percentage": 6 + }] + }, +{"name": "Ticker/examples/TickerParameter", + "sizes": [{ + "flash_bytes": 318302, + "flash_percentage": 24, + "ram_bytes": 21060, + "ram_percentage": 6 + }] + }, +{"name": "USB/examples/CompositeDevice", + "sizes": [{ + "flash_bytes": 416638, + "flash_percentage": 31, + "ram_bytes": 40884, + "ram_percentage": 12 + }] + }, +{"name": "USB/examples/ConsumerControl", + "sizes": [{ + "flash_bytes": 362194, + "flash_percentage": 27, + "ram_bytes": 40420, + "ram_percentage": 12 + }] + }, +{"name": "USB/examples/CustomHIDDevice", + "sizes": [{ + "flash_bytes": 375110, + "flash_percentage": 28, + "ram_bytes": 40436, + "ram_percentage": 12 + }] + }, +{"name": "USB/examples/FirmwareMSC", + "sizes": [{ + "flash_bytes": 400406, + "flash_percentage": 30, + "ram_bytes": 40436, + "ram_percentage": 12 + }] + }, +{"name": "USB/examples/Gamepad", + "sizes": [{ + "flash_bytes": 375454, + "flash_percentage": 28, + "ram_bytes": 40444, + "ram_percentage": 12 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2", + "target": "esp32s2", + "sketches": [ +{"name": "SPI/examples/SPI_Multiple_Buses", + "sizes": [{ + "flash_bytes": 280041, + "flash_percentage": 21, + "ram_bytes": 16056, + "ram_percentage": 4 + }] + }, +{"name": "SPIFFS/examples/SPIFFS_Test", + "sizes": [{ + "flash_bytes": 303717, + "flash_percentage": 23, + "ram_bytes": 15876, + "ram_percentage": 4 + }] + }, +{"name": "SPIFFS/examples/SPIFFS_time", + "sizes": [{ + "flash_bytes": 878925, + "flash_percentage": 67, + "ram_bytes": 40816, + "ram_percentage": 12 + }] + }, +{"name": "TFLiteMicro/examples/hello_world", + "sizes": [{ + "flash_bytes": 288373, + "flash_percentage": 22, + "ram_bytes": 17636, + "ram_percentage": 5 + }] + }, +{"name": "Ticker/examples/Blinker", + "sizes": [{ + "flash_bytes": 279741, + "flash_percentage": 21, + "ram_bytes": 16096, + "ram_percentage": 4 + }] + }, +{"name": "Ticker/examples/TickerBasic", + "sizes": [{ + "flash_bytes": 279545, + "flash_percentage": 21, + "ram_bytes": 16040, + "ram_percentage": 4 + }] + }, +{"name": "Ticker/examples/TickerParameter", + "sizes": [{ + "flash_bytes": 279489, + "flash_percentage": 21, + "ram_bytes": 16080, + "ram_percentage": 4 + }] + }, +{"name": "USB/examples/CompositeDevice", + "sizes": [{ + "flash_bytes": 356909, + "flash_percentage": 27, + "ram_bytes": 35588, + "ram_percentage": 10 + }] + }, +{"name": "USB/examples/ConsumerControl", + "sizes": [{ + "flash_bytes": 302749, + "flash_percentage": 23, + "ram_bytes": 35132, + "ram_percentage": 10 + }] + }, +{"name": "USB/examples/CustomHIDDevice", + "sizes": [{ + "flash_bytes": 315901, + "flash_percentage": 24, + "ram_bytes": 35140, + "ram_percentage": 10 + }] + }, +{"name": "USB/examples/FirmwareMSC", + "sizes": [{ + "flash_bytes": 336473, + "flash_percentage": 25, + "ram_bytes": 34780, + "ram_percentage": 10 + }] + }, +{"name": "USB/examples/Gamepad", + "sizes": [{ + "flash_bytes": 316237, + "flash_percentage": 24, + "ram_bytes": 35148, + "ram_percentage": 10 + }] + }, +{"name": "USB/examples/HIDVendor", + "sizes": [{ + "flash_bytes": 318277, + "flash_percentage": 24, + "ram_bytes": 35220, + "ram_percentage": 10 + }] + }, +{"name": "USB/examples/Keyboard/KeyboardLogout", + "sizes": [{ + "flash_bytes": 303917, + "flash_percentage": 23, + "ram_bytes": 35164, + "ram_percentage": 10 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3", + "target": "esp32c3", + "sketches": [ +{"name": "NetworkClientSecure/examples/WiFiClientTrustOnFirstUse", + "sizes": [{ + "flash_bytes": 1041306, + "flash_percentage": 79, + "ram_bytes": 36832, + "ram_percentage": 11 + }] + }, +{"name": "PPP/examples/PPP_Basic", + "sizes": [{ + "flash_bytes": 552200, + "flash_percentage": 42, + "ram_bytes": 17536, + "ram_percentage": 5 + }] + }, +{"name": "PPP/examples/PPP_WIFI_BRIDGE", + "sizes": [{ + "flash_bytes": 1012688, + "flash_percentage": 77, + "ram_bytes": 36048, + "ram_percentage": 11 + }] + }, +{"name": "Preferences/examples/Prefs2Struct", + "sizes": [{ + "flash_bytes": 291294, + "flash_percentage": 22, + "ram_bytes": 11636, + "ram_percentage": 3 + }] + }, +{"name": "Preferences/examples/StartCounter", + "sizes": [{ + "flash_bytes": 291028, + "flash_percentage": 22, + "ram_bytes": 11644, + "ram_percentage": 3 + }] + }, +{"name": "RainMaker/examples/RMakerCustom", + "sizes": [{ + "flash_bytes": 2007930, + "flash_percentage": 49, + "ram_bytes": 62616, + "ram_percentage": 19 + }] + }, +{"name": "RainMaker/examples/RMakerCustomAirCooler", + "sizes": [{ + "flash_bytes": 1994592, + "flash_percentage": 49, + "ram_bytes": 62728, + "ram_percentage": 19 + }] + }, +{"name": "RainMaker/examples/RMakerSonoffDualR3", + "sizes": [{ + "flash_bytes": 2010182, + "flash_percentage": 49, + "ram_bytes": 62880, + "ram_percentage": 19 + }] + }, +{"name": "RainMaker/examples/RMakerSwitch", + "sizes": [{ + "flash_bytes": 2021054, + "flash_percentage": 50, + "ram_bytes": 62704, + "ram_percentage": 19 + }] + }, +{"name": "SD/examples/SD_Test", + "sizes": [{ + "flash_bytes": 372652, + "flash_percentage": 9, + "ram_bytes": 13608, + "ram_percentage": 4 + }] + }, +{"name": "SD/examples/SD_time", + "sizes": [{ + "flash_bytes": 1010604, + "flash_percentage": 77, + "ram_bytes": 37384, + "ram_percentage": 11 + }] + }, +{"name": "SPI/examples/SPI_Multiple_Buses", + "sizes": [{ + "flash_bytes": 296024, + "flash_percentage": 22, + "ram_bytes": 12896, + "ram_percentage": 3 + }] + }, +{"name": "SPIFFS/examples/SPIFFS_Test", + "sizes": [{ + "flash_bytes": 324666, + "flash_percentage": 24, + "ram_bytes": 12156, + "ram_percentage": 3 + }] + }, +{"name": "SPIFFS/examples/SPIFFS_time", + "sizes": [{ + "flash_bytes": 980842, + "flash_percentage": 74, + "ram_bytes": 36360, + "ram_percentage": 11 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c6", + "target": "esp32c6", + "sketches": [ +{"name": "SD/examples/SD_Test", + "sizes": [{ + "flash_bytes": 320013, + "flash_percentage": 24, + "ram_bytes": 14788, + "ram_percentage": 4 + }] + }, +{"name": "SD/examples/SD_time", + "sizes": [{ + "flash_bytes": 1007903, + "flash_percentage": 76, + "ram_bytes": 43460, + "ram_percentage": 13 + }] + }, +{"name": "SPI/examples/SPI_Multiple_Buses", + "sizes": [{ + "flash_bytes": 252755, + "flash_percentage": 19, + "ram_bytes": 14084, + "ram_percentage": 4 + }] + }, +{"name": "SPIFFS/examples/SPIFFS_Test", + "sizes": [{ + "flash_bytes": 282789, + "flash_percentage": 21, + "ram_bytes": 13328, + "ram_percentage": 4 + }] + }, +{"name": "SPIFFS/examples/SPIFFS_time", + "sizes": [{ + "flash_bytes": 978231, + "flash_percentage": 74, + "ram_bytes": 42452, + "ram_percentage": 12 + }] + }, +{"name": "SimpleBLE/examples/SimpleBleDevice", + "sizes": [{ + "flash_bytes": 1038379, + "flash_percentage": 79, + "ram_bytes": 39256, + "ram_percentage": 11 + }] + }, +{"name": "TFLiteMicro/examples/hello_world", + "sizes": [{ + "flash_bytes": 264323, + "flash_percentage": 20, + "ram_bytes": 15104, + "ram_percentage": 4 + }] + }, +{"name": "Ticker/examples/Blinker", + "sizes": [{ + "flash_bytes": 249567, + "flash_percentage": 19, + "ram_bytes": 14100, + "ram_percentage": 4 + }] + }, +{"name": "Ticker/examples/TickerBasic", + "sizes": [{ + "flash_bytes": 249349, + "flash_percentage": 19, + "ram_bytes": 14044, + "ram_percentage": 4 + }] + }, +{"name": "Ticker/examples/TickerParameter", + "sizes": [{ + "flash_bytes": 249219, + "flash_percentage": 19, + "ram_bytes": 14092, + "ram_percentage": 4 + }] + }, +{"name": "Update/examples/AWS_S3_OTA_Update", + "sizes": [{ + "flash_bytes": 971581, + "flash_percentage": 74, + "ram_bytes": 43484, + "ram_percentage": 13 + }] + }, +{"name": "Update/examples/HTTPS_OTA_Update", + "sizes": [{ + "flash_bytes": 1090651, + "flash_percentage": 83, + "ram_bytes": 43172, + "ram_percentage": 13 + }] + }, +{"name": "Update/examples/HTTP_Client_AES_OTA_Update", + "sizes": [{ + "flash_bytes": 1010329, + "flash_percentage": 77, + "ram_bytes": 43572, + "ram_percentage": 13 + }] + }, +{"name": "Update/examples/HTTP_Server_AES_OTA_Update", + "sizes": [{ + "flash_bytes": 1051165, + "flash_percentage": 80, + "ram_bytes": 46244, + "ram_percentage": 14 + }] + }, +{"name": "Update/examples/OTAWebUpdater", + "sizes": [{ + "flash_bytes": 1034185, + "flash_percentage": 78, + "ram_bytes": 46124, + "ram_percentage": 14 + }] + }, +{"name": "Update/examples/SD_Update", + "sizes": [{ + "flash_bytes": 325641, + "flash_percentage": 24, + "ram_bytes": 14636, + "ram_percentage": 4 + }] + } +] +}, +{ "board": "espressif:esp32:esp32h2", + "target": "esp32h2", + "sketches": [ +{"name": "OpenThread/examples/COAP/coap_lamp", + "sizes": [{ + "flash_bytes": 1109859, + "flash_percentage": 84, + "ram_bytes": 46948, + "ram_percentage": 14 + }] + }, +{"name": "OpenThread/examples/COAP/coap_switch", + "sizes": [{ + "flash_bytes": 1109899, + "flash_percentage": 84, + "ram_bytes": 46912, + "ram_percentage": 14 + }] + }, +{"name": "OpenThread/examples/SimpleCLI", + "sizes": [{ + "flash_bytes": 1087081, + "flash_percentage": 82, + "ram_bytes": 45588, + "ram_percentage": 13 + }] + }, +{"name": "OpenThread/examples/SimpleNode", + "sizes": [{ + "flash_bytes": 1089041, + "flash_percentage": 83, + "ram_bytes": 45588, + "ram_percentage": 13 + }] + }, +{"name": "OpenThread/examples/SimpleThreadNetwork/ExtendedRouterNode", + "sizes": [{ + "flash_bytes": 1090377, + "flash_percentage": 83, + "ram_bytes": 45596, + "ram_percentage": 13 + }] + }, +{"name": "OpenThread/examples/SimpleThreadNetwork/LeaderNode", + "sizes": [{ + "flash_bytes": 1087755, + "flash_percentage": 82, + "ram_bytes": 45596, + "ram_percentage": 13 + }] + }, +{"name": "OpenThread/examples/SimpleThreadNetwork/RouterNode", + "sizes": [{ + "flash_bytes": 1087819, + "flash_percentage": 82, + "ram_bytes": 45596, + "ram_percentage": 13 + }] + }, +{"name": "OpenThread/examples/ThreadScan", + "sizes": [{ + "flash_bytes": 1087431, + "flash_percentage": 82, + "ram_bytes": 45588, + "ram_percentage": 13 + }] + } +] +}, +{ "board": "espressif:esp32:esp32", + "target": "esp32", + "sketches": [ +{"name": "NetworkClientSecure/examples/WiFiClientSecureEnterprise", + "sizes": [{ + "flash_bytes": 1055250, + "flash_percentage": 33, + "ram_bytes": 48436, + "ram_percentage": 14 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientSecureProtocolUpgrade", + "sizes": [{ + "flash_bytes": 996762, + "flash_percentage": 76, + "ram_bytes": 46956, + "ram_percentage": 14 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientShowPeerCredentials", + "sizes": [{ + "flash_bytes": 1037014, + "flash_percentage": 79, + "ram_bytes": 48332, + "ram_percentage": 14 + }] + }, +{"name": "NetworkClientSecure/examples/WiFiClientTrustOnFirstUse", + "sizes": [{ + "flash_bytes": 1009986, + "flash_percentage": 77, + "ram_bytes": 46996, + "ram_percentage": 14 + }] + }, +{"name": "PPP/examples/PPP_Basic", + "sizes": [{ + "flash_bytes": 538390, + "flash_percentage": 41, + "ram_bytes": 25352, + "ram_percentage": 7 + }] + }, +{"name": "PPP/examples/PPP_WIFI_BRIDGE", + "sizes": [{ + "flash_bytes": 968826, + "flash_percentage": 73, + "ram_bytes": 45260, + "ram_percentage": 13 + }] + }, +{"name": "Preferences/examples/Prefs2Struct", + "sizes": [{ + "flash_bytes": 311930, + "flash_percentage": 23, + "ram_bytes": 20624, + "ram_percentage": 6 + }] + }, +{"name": "Preferences/examples/StartCounter", + "sizes": [{ + "flash_bytes": 312766, + "flash_percentage": 23, + "ram_bytes": 20632, + "ram_percentage": 6 + }] + }, +{"name": "SD/examples/SD_Test", + "sizes": [{ + "flash_bytes": 368286, + "flash_percentage": 28, + "ram_bytes": 21652, + "ram_percentage": 6 + }] + }, +{"name": "SD/examples/SD_time", + "sizes": [{ + "flash_bytes": 965834, + "flash_percentage": 73, + "ram_bytes": 47028, + "ram_percentage": 14 + }] + }, +{"name": "SD_MMC/examples/SDMMC_Test", + "sizes": [{ + "flash_bytes": 388310, + "flash_percentage": 29, + "ram_bytes": 21836, + "ram_percentage": 6 + }] + }, +{"name": "SD_MMC/examples/SDMMC_time", + "sizes": [{ + "flash_bytes": 989578, + "flash_percentage": 75, + "ram_bytes": 47300, + "ram_percentage": 14 + }] + }, +{"name": "SPI/examples/SPI_Multiple_Buses", + "sizes": [{ + "flash_bytes": 299202, + "flash_percentage": 22, + "ram_bytes": 20680, + "ram_percentage": 6 + }] + }, +{"name": "SPIFFS/examples/SPIFFS_Test", + "sizes": [{ + "flash_bytes": 341614, + "flash_percentage": 26, + "ram_bytes": 21136, + "ram_percentage": 6 + }] + }, +{"name": "SPIFFS/examples/SPIFFS_time", + "sizes": [{ + "flash_bytes": 953170, + "flash_percentage": 72, + "ram_bytes": 46796, + "ram_percentage": 14 + }] + } +] +} +]} diff --git a/package.json b/package.json deleted file mode 100755 index 1a7f443f58a..00000000000 --- a/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "framework-arduinoespressif32", - "description": "Arduino Wiring-based Framework (ESP32 Core)", - "version": "0.0.0", - "url": "https://github.com/espressif/arduino-esp32" -} \ No newline at end of file diff --git a/package/package_esp32_index.template.json b/package/package_esp32_index.template.json deleted file mode 100644 index 9baa377f8ad..00000000000 --- a/package/package_esp32_index.template.json +++ /dev/null @@ -1,181 +0,0 @@ -{ - "packages": [ - { - "name": "esp32", - "maintainer": "Espressif Systems", - "websiteURL": "https://github.com/espressif/arduino-esp32", - "email": "hristo@espressif.com", - "help": { - "online": "http://esp32.com" - }, - "platforms": [ - { - "name": "esp32", - "architecture": "esp32", - "version": "", - "category": "ESP32", - "url": "", - "archiveFileName": "", - "checksum": "", - "size": "", - "help": { - "online": "" - }, - "boards": [ - { - "name": "ESP32 Dev Module" - }, - { - "name": "WEMOS LoLin32" - }, - { - "name": "WEMOS D1 MINI ESP32" - } - ], - "toolsDependencies": [ - { - "packager": "esp32", - "name": "xtensa-esp32-elf-gcc", - "version": "1.22.0-80-g6c4433a-5.2.0" - }, - { - "packager": "esp32", - "name": "esptool_py", - "version": "2.6.1" - }, - { - "packager": "esp32", - "name": "mkspiffs", - "version": "0.2.3" - } - ] - } - ], - "tools": [ - { - "name": "xtensa-esp32-elf-gcc", - "version": "1.22.0-80-g6c4433a-5.2.0", - "systems": [ - { - "host": "i686-mingw32", - "url": "https://dl.espressif.com/dl/xtensa-esp32-elf-win32-1.22.0-80-g6c4433a-5.2.0.zip", - "archiveFileName": "xtensa-esp32-elf-win32-1.22.0-80-g6c4433a-5.2.0.zip", - "checksum": "SHA-256:f217fccbeaaa8c92db239036e0d6202458de4488b954a3a38f35ac2ec48058a4", - "size": "125719261" - }, - { - "host": "x86_64-apple-darwin", - "url": "https://dl.espressif.com/dl/xtensa-esp32-elf-osx-1.22.0-80-g6c4433a-5.2.0.tar.gz", - "archiveFileName": "xtensa-esp32-elf-osx-1.22.0-80-g6c4433a-5.2.0.tar.gz", - "checksum": "SHA-256:a4307a97945d2f2f2745f415fbe80d727750e19f91f9a1e7e2f8a6065652f9da", - "size": "46517409" - }, - { - "host": "x86_64-pc-linux-gnu", - "url": "https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz", - "archiveFileName": "xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz", - "checksum": "SHA-256:3fe96c151d46c1d4e5edc6ed690851b8e53634041114bad04729bc16b0445156", - "size": "44219107" - }, - { - "host": "i686-pc-linux-gnu", - "url": "https://dl.espressif.com/dl/xtensa-esp32-elf-linux32-1.22.0-80-g6c4433a-5.2.0.tar.gz", - "archiveFileName": "xtensa-esp32-elf-linux32-1.22.0-80-g6c4433a-5.2.0.tar.gz", - "checksum": "SHA-256:b4055695ffc2dfc0bcb6dafdc2572a6e01151c4179ef5fa972b3fcb2183eb155", - "size": "45566336" - } - ] - }, - { - "name": "esptool_py", - "version": "2.6.1", - "systems": [ - { - "host": "i686-mingw32", - "url": "https://dl.espressif.com/dl/esptool-2.6.1-windows.zip", - "archiveFileName": "esptool-2.6.1-windows.zip", - "checksum": "SHA-256:84cf0b369a7707fe566434faba148852fc464992111d5baa95b658b374802f96", - "size": "3422445" - }, - { - "host": "x86_64-apple-darwin", - "url": "https://dl.espressif.com/dl/esptool-2.6.1-macos.tar.gz", - "archiveFileName": "esptool-2.6.1-macos.tar.gz", - "checksum": "SHA-256:f4eb758a301d6902cc9dfcd49d36345d2f075ad123da7cf8132d15cfb7533457", - "size": "3837085" - }, - { - "host": "x86_64-pc-linux-gnu", - "url": "https://dl.espressif.com/dl/esptool-2.6.1-linux.tar.gz", - "archiveFileName": "esptool-2.6.1-linux.tar.gz", - "checksum": "SHA-256:eaf82ff4070d9792f6a42ae1e485375de5a87bec59ef01dfb95de901519ec7fb", - "size": "44762" - }, - { - "host": "i686-pc-linux-gnu", - "url": "https://dl.espressif.com/dl/esptool-2.6.1-linux.tar.gz", - "archiveFileName": "esptool-2.6.1-linux.tar.gz", - "checksum": "SHA-256:eaf82ff4070d9792f6a42ae1e485375de5a87bec59ef01dfb95de901519ec7fb", - "size": "44762" - }, - { - "host": "arm-linux-gnueabihf", - "url": "https://dl.espressif.com/dl/esptool-2.6.1-linux.tar.gz", - "archiveFileName": "esptool-2.6.1-linux.tar.gz", - "checksum": "SHA-256:eaf82ff4070d9792f6a42ae1e485375de5a87bec59ef01dfb95de901519ec7fb", - "size": "44762" - } - ] - }, - { - "name": "mkspiffs", - "version": "0.2.3", - "systems": [ - { - "host": "i686-mingw32", - "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-win32.zip", - "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-win32.zip", - "checksum": "SHA-256:b647f2c2efe6949819c85ea9404271b55c7c9c25bcb98d3b98a1d0ba771adf56", - "size": "249809" - }, - { - "host": "x86_64-apple-darwin", - "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-osx.tar.gz", - "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-osx.tar.gz", - "checksum": "SHA-256:9f43fc74a858cf564966b5035322c3e5e61c31a647c5a1d71b388ed6efc48423", - "size": "130270" - }, - { - "host": "i386-apple-darwin", - "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-osx.tar.gz", - "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-osx.tar.gz", - "checksum": "SHA-256:9f43fc74a858cf564966b5035322c3e5e61c31a647c5a1d71b388ed6efc48423", - "size": "130270" - }, - { - "host": "x86_64-pc-linux-gnu", - "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-linux64.tar.gz", - "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-linux64.tar.gz", - "checksum": "SHA-256:5e1a4ff41385e842f389f6b5254102a547e566a06b49babeffa93ef37115cb5d", - "size": "50646" - }, - { - "host": "i686-pc-linux-gnu", - "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-linux32.tar.gz", - "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-linux32.tar.gz", - "checksum": "SHA-256:464463a93e8833209cdc29ba65e1a12fec31718dc10075c195a2445b2c3f6cb0", - "size": "48751" - }, - { - "host": "arm-linux-gnueabihf", - "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-linux-armhf.tar.gz", - "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-linux-armhf.tar.gz", - "checksum": "SHA-256:ade3dc00117912ac08a1bdbfbfe76b12d21a34bc5fa1de0cfc45fe7a8d0a0185", - "size": "40665" - } - ] - } - ] - } - ] -} diff --git a/package_esp32_dev_index.json b/package_esp32_dev_index.json new file mode 100644 index 00000000000..5cad06190bc --- /dev/null +++ b/package_esp32_dev_index.json @@ -0,0 +1,7948 @@ +{ + "packages": [ + { + "name": "esp32", + "maintainer": "Espressif Systems", + "websiteURL": "https://github.com/espressif/arduino-esp32", + "email": "hristo@espressif.com", + "help": { + "online": "http://esp32.com" + }, + "platforms": [ + { + "name": "esp32", + "architecture": "esp32", + "version": "3.2.0", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.2.0/esp32-3.2.0.zip", + "archiveFileName": "esp32-3.2.0.zip", + "checksum": "SHA-256:d38b16fef6e519fc0d19bc5af0b39cdbed7dfc2ce69214c1971ded0e61ecd911", + "size": "25447136", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "ESP32-C6 Dev Board" + }, + { + "name": "ESP32-H2 Dev Board" + }, + { + "name": "ESP32-P4 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.4-2f7dcd86-v1" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2411" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2411" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20241016" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.9.dev3" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.2.0-RC2", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.2.0-RC2/esp32-3.2.0-RC2.zip", + "archiveFileName": "esp32-3.2.0-RC2.zip", + "checksum": "SHA-256:fe6aacce1704f0782062d7d3fde24b40bf2591903de3351c86a55fa254a19e64", + "size": "25450856", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.4-d4aa25a3-v1" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2411" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2411" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20241016" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.9.dev3" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.2.0-RC1", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.2.0-RC1/esp32-3.2.0-RC1.zip", + "archiveFileName": "esp32-3.2.0-RC1.zip", + "checksum": "SHA-256:dc70818eaeb8a596c6857953fbc59ed10fbedd28a5d3e5405e6bbd050e49e46b", + "size": "25443000", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.4-bcb3c32d-v1" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2411" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2411" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20241016" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.9.dev3" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.1.3", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.3/esp32-3.1.3.zip", + "archiveFileName": "esp32-3.1.3.zip", + "checksum": "SHA-256:747160dbc81c6634c7bff9e8a57213e9982d52fe90d2a8f75a93a9f7b527defb", + "size": "25396700", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-489d7a2b-v1" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20241016" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.9.dev3" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.1.2", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.2/esp32-3.1.2.zip", + "archiveFileName": "esp32-3.1.2.zip", + "checksum": "SHA-256:17214f51a7b9de547baa777419d2b041e1f09cfb17adb33c18617a756190f9f6", + "size": "25396684", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-489d7a2b-v1" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20241016" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.9.dev3" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.1.1", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.1/esp32-3.1.1.zip", + "archiveFileName": "esp32-3.1.1.zip", + "checksum": "SHA-256:e20982b2860eab4900ce16a0f2b7f9fc3ffb205e490dc933f625d53a5c9e8129", + "size": "25253828", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-cfea4f7c-v1" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20241016" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.9.dev3" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.1.0", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0/esp32-3.1.0.zip", + "archiveFileName": "esp32-3.1.0.zip", + "checksum": "SHA-256:0db044159e3fc737435b3f1d547bf85c60a33a175342c317d2a5c08c42977f80", + "size": "25225607", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-083aad99-v2" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20241016" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.9.dev3" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.1.0-RC3", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC3/esp32-3.1.0-RC3.zip", + "archiveFileName": "esp32-3.1.0-RC3.zip", + "checksum": "SHA-256:60c8a9a0a4fba8533ce278ca1315425a55e2abf0c83c94d9fc0b8cafb50f6d3f", + "size": "24652789", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-a0f798cf" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20241016" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.9.dev1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.1.0-RC2", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC2/esp32-3.1.0-RC2.zip", + "archiveFileName": "esp32-3.1.0-RC2.zip", + "checksum": "SHA-256:374c3cd330d0dad1e1c39c00951c51c51cb5dd6964d9e92c84a2fe732061390d", + "size": "24606170", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-a0f798cf" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20241016" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.8.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.1.0-RC1", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC1/esp32-3.1.0-RC1.zip", + "archiveFileName": "esp32-3.1.0-RC1.zip", + "checksum": "SHA-256:2b386cbd6e761b728864aa4c36fc435f6c5d3e52a5c12bfaeb0132e0dc354a6c", + "size": "24118034", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-466a392a" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20240318" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.7", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.7/esp32-3.0.7.zip", + "archiveFileName": "esp32-3.0.7.zip", + "checksum": "SHA-256:6b48f5bd889e55d7b93b95849dff77c6a5e4b9ee58c7298d7872d558a4d04931", + "size": "24546342", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-632e0c2a" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs2", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs3", + "version": "2302" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20240821" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.6", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.6/esp32-3.0.6.zip", + "archiveFileName": "esp32-3.0.6.zip", + "checksum": "SHA-256:7b4d87d0a18e69cba81e7aa7e69f088dc7c4f6cc89a20adc256bf77c86992dc5", + "size": "24546256", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-632e0c2a" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs2", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs3", + "version": "2302" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20240821" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.5", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.5/esp32-3.0.5.zip", + "archiveFileName": "esp32-3.0.5.zip", + "checksum": "SHA-256:6ead4c452e69146b8eb08bee5a77898acc75a0637e9fccb5bbf665385ddc28db", + "size": "24481707", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-33fbade6" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs2", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs3", + "version": "2302" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20240821" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.4", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.4/esp32-3.0.4.zip", + "archiveFileName": "esp32-3.0.4.zip", + "checksum": "SHA-256:58fcd9b033be0358afbcbcf9a1d8eb216217f65f6b28f2e2cd739c7d016dda4f", + "size": "23937821", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-b6b4727c58" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs2", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs3", + "version": "2302" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20240318" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.3", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.3/esp32-3.0.3.zip", + "archiveFileName": "esp32-3.0.3.zip", + "checksum": "SHA-256:b4aa70711293955a9835ad641279dc7cd524aeb405f7d294afa05c2ece7ded45", + "size": "23920341", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-dc859c1e67" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs2", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs3", + "version": "2302" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20240318" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.2", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.2/esp32-3.0.2.zip", + "archiveFileName": "esp32-3.0.2.zip", + "checksum": "SHA-256:bd90630fbe9e99f3bb3340c25a87574d5551dd2823849adbf285f8430b6884cf", + "size": "23893902", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-bd2b9390ef" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs2", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs3", + "version": "2302" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20240318" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.1", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-3.0.1.zip", + "archiveFileName": "esp32-3.0.1.zip", + "checksum": "SHA-256:b7169d0dd51b64e450a7c09fafb7a4782820a9bc745f7b1e4618316440db0930", + "size": "23895257", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-442a798083" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs2", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs3", + "version": "2302" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230921" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.0", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.0/esp32-3.0.0.zip", + "archiveFileName": "esp32-3.0.0.zip", + "checksum": "SHA-256:0960cf786992e0e3770d8c1e1979eaf01bd0ac9209b24fb00948cf93d43cf95c", + "size": "23891610", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-442a798083" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-12.2.0_20230208" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-12.2.0_20230208" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-12.2.0_20230208" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230921" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.0-rc3", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.0-rc3/esp32-3.0.0-rc3.zip", + "archiveFileName": "esp32-3.0.0-rc3.zip", + "checksum": "SHA-256:87ff8e3499c8c2112c3d6faf0017998e64135c0f3553088d76be6f8b6a5af1ef", + "size": "23906520", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-442a798083" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-12.2.0_20230208" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-12.2.0_20230208" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-12.2.0_20230208" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230921" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.0-rc2", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.0-rc2/esp32-3.0.0-rc2.zip", + "archiveFileName": "esp32-3.0.0-rc2.zip", + "checksum": "SHA-256:a5953dbc8ce425ce44fde6d66d23b056bc2569d96e177e2fa8d5c3161f87eb40", + "size": "23887041", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-442a798083" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-12.2.0_20230208" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-12.2.0_20230208" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-12.2.0_20230208" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230921" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.0-rc1", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.0-rc1/esp32-3.0.0-rc1.zip", + "archiveFileName": "esp32-3.0.0-rc1.zip", + "checksum": "SHA-256:d4d96e1dc0ca687d2bcdde9836bcc3664cfa868cb324b7b737005efe0b050f3a", + "size": "23944015", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-3662303f312" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-12.2.0_20230208" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-12.2.0_20230208" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-12.2.0_20230208" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230921" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.0-alpha3", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.0-alpha3/esp32-3.0.0-alpha3.zip", + "archiveFileName": "esp32-3.0.0-alpha3.zip", + "checksum": "SHA-256:02b94c17f065ed5dfef765af7ed7e11f2c7fafa2bd82b00fb7d07cdb2ad78509", + "size": "21114660", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-3662303f31" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-12.2.0_20230208" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-12.2.0_20230208" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-12.2.0_20230208" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20221002" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20221002" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230921" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.17", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.17/esp32-2.0.17.zip", + "archiveFileName": "esp32-2.0.17.zip", + "checksum": "SHA-256:1f8658d4b18a8001ce782142ad08164af2991d70b83a147c3437a6ee30a9b225", + "size": "254658377", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230921" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.16", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.16/esp32-2.0.16.zip", + "archiveFileName": "esp32-2.0.16.zip", + "checksum": "SHA-256:6615fd16fd6d3ee2fa7ca2dd40a4f65220eddf094a88b7cee2141a0c077987bc", + "size": "254657760", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230921" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.15", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.15/esp32-2.0.15.zip", + "archiveFileName": "esp32-2.0.15.zip", + "checksum": "SHA-256:2219c1636264f55e19b2a5e7f41c81b669b1355017b15ee31773c85674b3e9bb", + "size": "254657764", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230921" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.14", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.14/esp32-2.0.14.zip", + "archiveFileName": "esp32-2.0.14.zip", + "checksum": "SHA-256:77c71eba520c97ab30161eb2f9c6a46b019e48d13936244b18f6ad4dbecf0a58", + "size": "252506057", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230419" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.13", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.13/esp32-2.0.13.zip", + "archiveFileName": "esp32-2.0.13.zip", + "checksum": "SHA-256:ee4c277bac0eecb7ca8853780da9d49b4e260926059cf6a9f9bac1923059de0c", + "size": "250665913", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20221026" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.12", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.12/esp32-2.0.12.zip", + "archiveFileName": "esp32-2.0.12.zip", + "checksum": "SHA-256:9a4f844ca67812c547a9635cdb0dd2c347cae7a3e855f95f9d490b2f8d340dbe", + "size": "250664387", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20221026" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.11", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.11/esp32-2.0.11.zip", + "archiveFileName": "esp32-2.0.11.zip", + "checksum": "SHA-256:d15386308dc72f94816ce80b5508af999f2fd0d88eb5e1ffba48316ab0b9c5d6", + "size": "250401265", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20221026" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.10", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.10/esp32-2.0.10.zip", + "archiveFileName": "esp32-2.0.10.zip", + "checksum": "SHA-256:6028cb623c838723c41000869963d95f7cb811d58643133068eed31c03c2d7c0", + "size": "250401273", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20221026" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.9", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.9/esp32-2.0.9.zip", + "archiveFileName": "esp32-2.0.9.zip", + "checksum": "SHA-256:37072185026db3cdc0ed4b6fb12840d7f41571a16c60eec97bec2a4abec8dcee", + "size": "278964028", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20221026" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.8", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.8/esp32-2.0.8.zip", + "archiveFileName": "esp32-2.0.8.zip", + "checksum": "SHA-256:2c5daa3ce7456e752fb8d8a35b0b6b2eb8e494032cba57569ba12dd53eb235f2", + "size": "278963636", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20221026" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.7", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esp32-2.0.7.zip", + "archiveFileName": "esp32-2.0.7.zip", + "checksum": "SHA-256:b5a7a54fca36501d1108413310ec50ae2df655c14c3881325903cde2c7ae5f80", + "size": "278966011", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20221026" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.6", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.6/esp32-2.0.6.zip", + "archiveFileName": "esp32-2.0.6.zip", + "checksum": "SHA-256:ea56d300404cc1b5bc15295f29790246b02025c493e0664a6d271164a602a351", + "size": "264579419", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch5" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch5" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch5" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch5" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.2.1" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20220706" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.5", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.5/esp32-2.0.5.zip", + "archiveFileName": "esp32-2.0.5.zip", + "checksum": "SHA-256:c7a1040c5f007a799ef9eb249508e3544c3cf5246f67cdfdc1e80f7d0ca7b41d", + "size": "260916106", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.2.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.4", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esp32-2.0.4.zip", + "archiveFileName": "esp32-2.0.4.zip", + "checksum": "SHA-256:832609d6f4cd0edf4e471f02e30b7f0e1c86fdd1b950990ef40431e656237214", + "size": "259715595", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "3.3.0" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.3", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.3/esp32-2.0.3.zip", + "archiveFileName": "esp32-2.0.3.zip", + "checksum": "SHA-256:7a44ab32a2bfe18a84fd1f75aa1921dae92c6b4a74a2eb4d0c7d479b34996f3b", + "size": "246542267", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "3.3.0" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.2", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.2/esp32-2.0.2.zip", + "archiveFileName": "esp32-2.0.2.zip", + "checksum": "SHA-256:e139f22aab9cbe8109815de0be110e58a8f1d6c90a2e263eb0b0d646b53a5a33", + "size": "151846438", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "3.1.0" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.1", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.1/esp32-2.0.1.zip", + "archiveFileName": "esp32-2.0.1.zip", + "checksum": "SHA-256:3a7cd46ba47990dd37fbe02b7f0a910dd5cc7af1d190350b69d320ed36cd6b41", + "size": "148976301", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "3.1.0" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.0", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.0/esp32-2.0.0.zip", + "archiveFileName": "esp32-2.0.0.zip", + "checksum": "SHA-256:10e1c42dbf11d2359259a80008f13f37d2f9bb8f49a25d34d387cf4531052cbc", + "size": "139313137", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Module" + }, + { + "name": "WEMOS LoLin32" + }, + { + "name": "WEMOS D1 MINI ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r1" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r1" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r1" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "3.1.0" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "1.0.6", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.6/esp32-1.0.6.zip", + "archiveFileName": "esp32-1.0.6.zip", + "checksum": "SHA-256:982da9aaa181b6cb9c692dd4c9622b022ecc0d1e3aa0c5b70428ccc3c1b4556b", + "size": "51126662", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Module" + }, + { + "name": "WEMOS LoLin32" + }, + { + "name": "WEMOS D1 MINI ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "1.22.0-97-gc752ad5-5.2.0" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "3.0.0" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "1.0.5", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5/esp32-1.0.5.zip", + "archiveFileName": "esp32-1.0.5.zip", + "checksum": "SHA-256:dc5c6c72a127b3171c654f3c3476911d3c2b0ab21affdb7b0f0756c105ca71a7", + "size": "49552769", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Module" + }, + { + "name": "WEMOS LoLin32" + }, + { + "name": "WEMOS D1 MINI ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "1.22.0-97-gc752ad5-5.2.0" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "3.0.0" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + } + ] + }, + { + "category": "ESP32", + "name": "esp32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.4/esp32-1.0.4.zip", + "checksum": "SHA-256:d9108bf873933c4e48a3ca401fb51e41b2cc3f98d7c9b9be9881e7ca34bf0efe", + "help": { + "online": "" + }, + "version": "1.0.4", + "architecture": "esp32", + "archiveFileName": "esp32-1.0.4.zip", + "boards": [ + { + "name": "ESP32 Dev Module" + }, + { + "name": "WEMOS LoLin32" + }, + { + "name": "WEMOS D1 MINI ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "version": "1.22.0-80-g6c4433a-5.2.0", + "name": "xtensa-esp32-elf-gcc" + }, + { + "packager": "esp32", + "version": "2.6.1", + "name": "esptool_py" + }, + { + "packager": "esp32", + "version": "0.2.3", + "name": "mkspiffs" + } + ], + "size": "36853332" + }, + { + "category": "ESP32", + "name": "esp32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.3/esp32-1.0.3.zip", + "checksum": "SHA-256:19a30ece8a3ab26ab420c3d5531a9a1c51cb04e421a4f1d86dc072c209060436", + "help": { + "online": "" + }, + "version": "1.0.3", + "architecture": "esp32", + "archiveFileName": "esp32-1.0.3.zip", + "boards": [ + { + "name": "ESP32 Dev Module" + }, + { + "name": "WEMOS LoLin32" + }, + { + "name": "WEMOS D1 MINI ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "version": "1.22.0-80-g6c4433a-5.2.0", + "name": "xtensa-esp32-elf-gcc" + }, + { + "packager": "esp32", + "version": "2.6.1", + "name": "esptool_py" + }, + { + "packager": "esp32", + "version": "0.2.3", + "name": "mkspiffs" + } + ], + "size": "36811826" + }, + { + "category": "ESP32", + "help": { + "online": "" + }, + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.2/esp32-1.0.2.zip", + "checksum": "SHA-256:c3a5a5050705d41ab205d25a7399e921057b754ef8f883419f58c0c7f08df11c", + "version": "1.0.2", + "architecture": "esp32", + "archiveFileName": "esp32-1.0.2.zip", + "boards": [ + { + "name": "ESP32 Dev Module" + }, + { + "name": "WEMOS LoLin32" + } + ], + "size": "31174160", + "toolsDependencies": [ + { + "packager": "esp32", + "version": "1.22.0-80-g6c4433a-5.2.0", + "name": "xtensa-esp32-elf-gcc" + }, + { + "packager": "esp32", + "version": "2.6.1", + "name": "esptool_py" + }, + { + "packager": "esp32", + "version": "0.2.3", + "name": "mkspiffs" + } + ], + "name": "esp32" + }, + { + "category": "ESP32", + "help": { + "online": "" + }, + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.1/esp32-1.0.1.zip", + "checksum": "SHA-256:1a7fa2f9bb0b6b5a20dfea227497f4851dc8b886caf7ecb998f745589c97ed34", + "name": "esp32", + "version": "1.0.1", + "architecture": "esp32", + "archiveFileName": "esp32-1.0.1.zip", + "size": "31273425", + "toolsDependencies": [ + { + "packager": "esp32", + "version": "1.22.0-80-g6c4433a-5.2.0", + "name": "xtensa-esp32-elf-gcc" + }, + { + "packager": "esp32", + "version": "2.6.0", + "name": "esptool_py" + }, + { + "packager": "esp32", + "version": "0.2.3", + "name": "mkspiffs" + } + ], + "boards": [ + { + "name": "ESP32 Dev Module" + }, + { + "name": "WEMOS LoLin32" + } + ] + }, + { + "category": "ESP32", + "help": { + "online": "" + }, + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.0/esp32-1.0.0.zip", + "checksum": "SHA-256:94d586174f103e2014be590ab307c5cdda6fa2ec70204c7f121882ace5e05c80", + "name": "esp32", + "version": "1.0.0", + "architecture": "esp32", + "archiveFileName": "esp32-1.0.0.zip", + "size": "26381887", + "toolsDependencies": [ + { + "packager": "esp32", + "version": "1.22.0-80-g6c4433a-5.2.0", + "name": "xtensa-esp32-elf-gcc" + }, + { + "packager": "esp32", + "version": "2.3.1", + "name": "esptool" + }, + { + "packager": "esp32", + "version": "0.2.3", + "name": "mkspiffs" + } + ], + "boards": [ + { + "name": "ESP32 Dev Module" + }, + { + "name": "WEMOS LoLin32" + } + ] + } + ], + "tools": [ + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.4-2f7dcd86-v1", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.4-d4aa25a3-v1", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", + "checksum": "SHA-256:81101d580ebafb78f71bd494f4f5162fd829279d18634282c0f8f95c9e928335", + "size": "350941396" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", + "checksum": "SHA-256:81101d580ebafb78f71bd494f4f5162fd829279d18634282c0f8f95c9e928335", + "size": "350941396" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", + "checksum": "SHA-256:81101d580ebafb78f71bd494f4f5162fd829279d18634282c0f8f95c9e928335", + "size": "350941396" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", + "checksum": "SHA-256:81101d580ebafb78f71bd494f4f5162fd829279d18634282c0f8f95c9e928335", + "size": "350941396" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", + "checksum": "SHA-256:81101d580ebafb78f71bd494f4f5162fd829279d18634282c0f8f95c9e928335", + "size": "350941396" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", + "checksum": "SHA-256:81101d580ebafb78f71bd494f4f5162fd829279d18634282c0f8f95c9e928335", + "size": "350941396" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", + "checksum": "SHA-256:81101d580ebafb78f71bd494f4f5162fd829279d18634282c0f8f95c9e928335", + "size": "350941396" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", + "checksum": "SHA-256:81101d580ebafb78f71bd494f4f5162fd829279d18634282c0f8f95c9e928335", + "size": "350941396" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.4-bcb3c32d-v1", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-bcb3c32d-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-bcb3c32d-v1.zip", + "checksum": "SHA-256:2ab7a8565d4eadd805c1d00c9a1550292d3287dc43efa166d7ad3ba5322344bb", + "size": "345570903" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-bcb3c32d-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-bcb3c32d-v1.zip", + "checksum": "SHA-256:2ab7a8565d4eadd805c1d00c9a1550292d3287dc43efa166d7ad3ba5322344bb", + "size": "345570903" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-bcb3c32d-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-bcb3c32d-v1.zip", + "checksum": "SHA-256:2ab7a8565d4eadd805c1d00c9a1550292d3287dc43efa166d7ad3ba5322344bb", + "size": "345570903" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-bcb3c32d-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-bcb3c32d-v1.zip", + "checksum": "SHA-256:2ab7a8565d4eadd805c1d00c9a1550292d3287dc43efa166d7ad3ba5322344bb", + "size": "345570903" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-bcb3c32d-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-bcb3c32d-v1.zip", + "checksum": "SHA-256:2ab7a8565d4eadd805c1d00c9a1550292d3287dc43efa166d7ad3ba5322344bb", + "size": "345570903" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-bcb3c32d-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-bcb3c32d-v1.zip", + "checksum": "SHA-256:2ab7a8565d4eadd805c1d00c9a1550292d3287dc43efa166d7ad3ba5322344bb", + "size": "345570903" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-bcb3c32d-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-bcb3c32d-v1.zip", + "checksum": "SHA-256:2ab7a8565d4eadd805c1d00c9a1550292d3287dc43efa166d7ad3ba5322344bb", + "size": "345570903" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-bcb3c32d-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-bcb3c32d-v1.zip", + "checksum": "SHA-256:2ab7a8565d4eadd805c1d00c9a1550292d3287dc43efa166d7ad3ba5322344bb", + "size": "345570903" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-489d7a2b-v1", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "checksum": "SHA-256:489012502218a7d30f6c312764bc8d10830a51e1db29558f15181c68373d0095", + "size": "341414090" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "checksum": "SHA-256:489012502218a7d30f6c312764bc8d10830a51e1db29558f15181c68373d0095", + "size": "341414090" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "checksum": "SHA-256:489012502218a7d30f6c312764bc8d10830a51e1db29558f15181c68373d0095", + "size": "341414090" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "checksum": "SHA-256:489012502218a7d30f6c312764bc8d10830a51e1db29558f15181c68373d0095", + "size": "341414090" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "checksum": "SHA-256:489012502218a7d30f6c312764bc8d10830a51e1db29558f15181c68373d0095", + "size": "341414090" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "checksum": "SHA-256:489012502218a7d30f6c312764bc8d10830a51e1db29558f15181c68373d0095", + "size": "341414090" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "checksum": "SHA-256:489012502218a7d30f6c312764bc8d10830a51e1db29558f15181c68373d0095", + "size": "341414090" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "checksum": "SHA-256:489012502218a7d30f6c312764bc8d10830a51e1db29558f15181c68373d0095", + "size": "341414090" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-cfea4f7c-v1", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "checksum": "SHA-256:1099291229a9be453c771c5867b8487a0266db9246b672417337b8f511d7f820", + "size": "341118284" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "checksum": "SHA-256:1099291229a9be453c771c5867b8487a0266db9246b672417337b8f511d7f820", + "size": "341118284" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "checksum": "SHA-256:1099291229a9be453c771c5867b8487a0266db9246b672417337b8f511d7f820", + "size": "341118284" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "checksum": "SHA-256:1099291229a9be453c771c5867b8487a0266db9246b672417337b8f511d7f820", + "size": "341118284" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "checksum": "SHA-256:1099291229a9be453c771c5867b8487a0266db9246b672417337b8f511d7f820", + "size": "341118284" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "checksum": "SHA-256:1099291229a9be453c771c5867b8487a0266db9246b672417337b8f511d7f820", + "size": "341118284" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "checksum": "SHA-256:1099291229a9be453c771c5867b8487a0266db9246b672417337b8f511d7f820", + "size": "341118284" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "checksum": "SHA-256:1099291229a9be453c771c5867b8487a0266db9246b672417337b8f511d7f820", + "size": "341118284" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-083aad99-v2", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "checksum": "SHA-256:4c6cae2e34df7e85a149615a6c18169777faf9460f708fc51d93616a117973c2", + "size": "341175680" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "checksum": "SHA-256:4c6cae2e34df7e85a149615a6c18169777faf9460f708fc51d93616a117973c2", + "size": "341175680" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "checksum": "SHA-256:4c6cae2e34df7e85a149615a6c18169777faf9460f708fc51d93616a117973c2", + "size": "341175680" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "checksum": "SHA-256:4c6cae2e34df7e85a149615a6c18169777faf9460f708fc51d93616a117973c2", + "size": "341175680" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "checksum": "SHA-256:4c6cae2e34df7e85a149615a6c18169777faf9460f708fc51d93616a117973c2", + "size": "341175680" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "checksum": "SHA-256:4c6cae2e34df7e85a149615a6c18169777faf9460f708fc51d93616a117973c2", + "size": "341175680" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "checksum": "SHA-256:4c6cae2e34df7e85a149615a6c18169777faf9460f708fc51d93616a117973c2", + "size": "341175680" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "checksum": "SHA-256:4c6cae2e34df7e85a149615a6c18169777faf9460f708fc51d93616a117973c2", + "size": "341175680" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-a0f798cf", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-a0f798cf.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-a0f798cf.zip", + "checksum": "SHA-256:f552d02ecef616389f1d0c973cb270718a192e6258db426656cd5965db3c6ed0", + "size": "339750940" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-a0f798cf.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-a0f798cf.zip", + "checksum": "SHA-256:f552d02ecef616389f1d0c973cb270718a192e6258db426656cd5965db3c6ed0", + "size": "339750940" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-a0f798cf.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-a0f798cf.zip", + "checksum": "SHA-256:f552d02ecef616389f1d0c973cb270718a192e6258db426656cd5965db3c6ed0", + "size": "339750940" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-a0f798cf.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-a0f798cf.zip", + "checksum": "SHA-256:f552d02ecef616389f1d0c973cb270718a192e6258db426656cd5965db3c6ed0", + "size": "339750940" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-a0f798cf.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-a0f798cf.zip", + "checksum": "SHA-256:f552d02ecef616389f1d0c973cb270718a192e6258db426656cd5965db3c6ed0", + "size": "339750940" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-a0f798cf.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-a0f798cf.zip", + "checksum": "SHA-256:f552d02ecef616389f1d0c973cb270718a192e6258db426656cd5965db3c6ed0", + "size": "339750940" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-a0f798cf.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-a0f798cf.zip", + "checksum": "SHA-256:f552d02ecef616389f1d0c973cb270718a192e6258db426656cd5965db3c6ed0", + "size": "339750940" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-a0f798cf.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-a0f798cf.zip", + "checksum": "SHA-256:f552d02ecef616389f1d0c973cb270718a192e6258db426656cd5965db3c6ed0", + "size": "339750940" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-632e0c2a", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "checksum": "SHA-256:41f67e1c11f68b57d651955c93b63d6a8d35808ce6aff6ba3d1e1476178758f2", + "size": "309895581" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "checksum": "SHA-256:41f67e1c11f68b57d651955c93b63d6a8d35808ce6aff6ba3d1e1476178758f2", + "size": "309895581" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "checksum": "SHA-256:41f67e1c11f68b57d651955c93b63d6a8d35808ce6aff6ba3d1e1476178758f2", + "size": "309895581" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "checksum": "SHA-256:41f67e1c11f68b57d651955c93b63d6a8d35808ce6aff6ba3d1e1476178758f2", + "size": "309895581" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "checksum": "SHA-256:41f67e1c11f68b57d651955c93b63d6a8d35808ce6aff6ba3d1e1476178758f2", + "size": "309895581" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "checksum": "SHA-256:41f67e1c11f68b57d651955c93b63d6a8d35808ce6aff6ba3d1e1476178758f2", + "size": "309895581" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "checksum": "SHA-256:41f67e1c11f68b57d651955c93b63d6a8d35808ce6aff6ba3d1e1476178758f2", + "size": "309895581" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "checksum": "SHA-256:41f67e1c11f68b57d651955c93b63d6a8d35808ce6aff6ba3d1e1476178758f2", + "size": "309895581" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-33fbade6", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "checksum": "SHA-256:578f325fa9fca635d9c6c3b19726cb26077751e3155b677317bde2e0b371df7d", + "size": "309285463" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "checksum": "SHA-256:578f325fa9fca635d9c6c3b19726cb26077751e3155b677317bde2e0b371df7d", + "size": "309285463" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "checksum": "SHA-256:578f325fa9fca635d9c6c3b19726cb26077751e3155b677317bde2e0b371df7d", + "size": "309285463" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "checksum": "SHA-256:578f325fa9fca635d9c6c3b19726cb26077751e3155b677317bde2e0b371df7d", + "size": "309285463" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "checksum": "SHA-256:578f325fa9fca635d9c6c3b19726cb26077751e3155b677317bde2e0b371df7d", + "size": "309285463" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "checksum": "SHA-256:578f325fa9fca635d9c6c3b19726cb26077751e3155b677317bde2e0b371df7d", + "size": "309285463" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "checksum": "SHA-256:578f325fa9fca635d9c6c3b19726cb26077751e3155b677317bde2e0b371df7d", + "size": "309285463" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "checksum": "SHA-256:578f325fa9fca635d9c6c3b19726cb26077751e3155b677317bde2e0b371df7d", + "size": "309285463" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-466a392a", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-466a392a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-466a392a.zip", + "checksum": "SHA-256:8c2d36bd4be5b6a9446efd3c2b2f93f544f4b2a22dab23c4991aec5711c72884", + "size": "318864212" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-466a392a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-466a392a.zip", + "checksum": "SHA-256:8c2d36bd4be5b6a9446efd3c2b2f93f544f4b2a22dab23c4991aec5711c72884", + "size": "318864212" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-466a392a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-466a392a.zip", + "checksum": "SHA-256:8c2d36bd4be5b6a9446efd3c2b2f93f544f4b2a22dab23c4991aec5711c72884", + "size": "318864212" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-466a392a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-466a392a.zip", + "checksum": "SHA-256:8c2d36bd4be5b6a9446efd3c2b2f93f544f4b2a22dab23c4991aec5711c72884", + "size": "318864212" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-466a392a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-466a392a.zip", + "checksum": "SHA-256:8c2d36bd4be5b6a9446efd3c2b2f93f544f4b2a22dab23c4991aec5711c72884", + "size": "318864212" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-466a392a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-466a392a.zip", + "checksum": "SHA-256:8c2d36bd4be5b6a9446efd3c2b2f93f544f4b2a22dab23c4991aec5711c72884", + "size": "318864212" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-466a392a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-466a392a.zip", + "checksum": "SHA-256:8c2d36bd4be5b6a9446efd3c2b2f93f544f4b2a22dab23c4991aec5711c72884", + "size": "318864212" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-466a392a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-466a392a.zip", + "checksum": "SHA-256:8c2d36bd4be5b6a9446efd3c2b2f93f544f4b2a22dab23c4991aec5711c72884", + "size": "318864212" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-b6b4727c58", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip", + "archiveFileName": "esp32-arduino-libs-3.0.4.zip", + "checksum": "SHA-256:c5c495fc3e6e11418e87ca9f6bf89cdcb0bcc38244a618f8d457d7a77f70b778", + "size": "305857583" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip", + "archiveFileName": "esp32-arduino-libs-3.0.4.zip", + "checksum": "SHA-256:c5c495fc3e6e11418e87ca9f6bf89cdcb0bcc38244a618f8d457d7a77f70b778", + "size": "305857583" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip", + "archiveFileName": "esp32-arduino-libs-3.0.4.zip", + "checksum": "SHA-256:c5c495fc3e6e11418e87ca9f6bf89cdcb0bcc38244a618f8d457d7a77f70b778", + "size": "305857583" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip", + "archiveFileName": "esp32-arduino-libs-3.0.4.zip", + "checksum": "SHA-256:c5c495fc3e6e11418e87ca9f6bf89cdcb0bcc38244a618f8d457d7a77f70b778", + "size": "305857583" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip", + "archiveFileName": "esp32-arduino-libs-3.0.4.zip", + "checksum": "SHA-256:c5c495fc3e6e11418e87ca9f6bf89cdcb0bcc38244a618f8d457d7a77f70b778", + "size": "305857583" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip", + "archiveFileName": "esp32-arduino-libs-3.0.4.zip", + "checksum": "SHA-256:c5c495fc3e6e11418e87ca9f6bf89cdcb0bcc38244a618f8d457d7a77f70b778", + "size": "305857583" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip", + "archiveFileName": "esp32-arduino-libs-3.0.4.zip", + "checksum": "SHA-256:c5c495fc3e6e11418e87ca9f6bf89cdcb0bcc38244a618f8d457d7a77f70b778", + "size": "305857583" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip", + "archiveFileName": "esp32-arduino-libs-3.0.4.zip", + "checksum": "SHA-256:c5c495fc3e6e11418e87ca9f6bf89cdcb0bcc38244a618f8d457d7a77f70b778", + "size": "305857583" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-dc859c1e67", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.3/esp32-arduino-libs-3.0.3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.3.zip", + "checksum": "SHA-256:23618328d3cc3d2eabc269196be22af5b2353583d5f6ec14b3ef0cf11e7da7ba", + "size": "305530538" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.3/esp32-arduino-libs-3.0.3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.3.zip", + "checksum": "SHA-256:23618328d3cc3d2eabc269196be22af5b2353583d5f6ec14b3ef0cf11e7da7ba", + "size": "305530538" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.3/esp32-arduino-libs-3.0.3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.3.zip", + "checksum": "SHA-256:23618328d3cc3d2eabc269196be22af5b2353583d5f6ec14b3ef0cf11e7da7ba", + "size": "305530538" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.3/esp32-arduino-libs-3.0.3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.3.zip", + "checksum": "SHA-256:23618328d3cc3d2eabc269196be22af5b2353583d5f6ec14b3ef0cf11e7da7ba", + "size": "305530538" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.3/esp32-arduino-libs-3.0.3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.3.zip", + "checksum": "SHA-256:23618328d3cc3d2eabc269196be22af5b2353583d5f6ec14b3ef0cf11e7da7ba", + "size": "305530538" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.3/esp32-arduino-libs-3.0.3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.3.zip", + "checksum": "SHA-256:23618328d3cc3d2eabc269196be22af5b2353583d5f6ec14b3ef0cf11e7da7ba", + "size": "305530538" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.3/esp32-arduino-libs-3.0.3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.3.zip", + "checksum": "SHA-256:23618328d3cc3d2eabc269196be22af5b2353583d5f6ec14b3ef0cf11e7da7ba", + "size": "305530538" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.3/esp32-arduino-libs-3.0.3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.3.zip", + "checksum": "SHA-256:23618328d3cc3d2eabc269196be22af5b2353583d5f6ec14b3ef0cf11e7da7ba", + "size": "305530538" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-bd2b9390ef", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip", + "archiveFileName": "esp32-arduino-libs-3.0.2.zip", + "checksum": "SHA-256:6df0f2753ae3d43582e641e3b945666c2700cb18f62a1932ad535b79427aae0b", + "size": "305835047" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip", + "archiveFileName": "esp32-arduino-libs-3.0.2.zip", + "checksum": "SHA-256:6df0f2753ae3d43582e641e3b945666c2700cb18f62a1932ad535b79427aae0b", + "size": "305835047" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip", + "archiveFileName": "esp32-arduino-libs-3.0.2.zip", + "checksum": "SHA-256:6df0f2753ae3d43582e641e3b945666c2700cb18f62a1932ad535b79427aae0b", + "size": "305835047" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip", + "archiveFileName": "esp32-arduino-libs-3.0.2.zip", + "checksum": "SHA-256:6df0f2753ae3d43582e641e3b945666c2700cb18f62a1932ad535b79427aae0b", + "size": "305835047" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip", + "archiveFileName": "esp32-arduino-libs-3.0.2.zip", + "checksum": "SHA-256:6df0f2753ae3d43582e641e3b945666c2700cb18f62a1932ad535b79427aae0b", + "size": "305835047" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip", + "archiveFileName": "esp32-arduino-libs-3.0.2.zip", + "checksum": "SHA-256:6df0f2753ae3d43582e641e3b945666c2700cb18f62a1932ad535b79427aae0b", + "size": "305835047" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip", + "archiveFileName": "esp32-arduino-libs-3.0.2.zip", + "checksum": "SHA-256:6df0f2753ae3d43582e641e3b945666c2700cb18f62a1932ad535b79427aae0b", + "size": "305835047" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip", + "archiveFileName": "esp32-arduino-libs-3.0.2.zip", + "checksum": "SHA-256:6df0f2753ae3d43582e641e3b945666c2700cb18f62a1932ad535b79427aae0b", + "size": "305835047" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-442a798083", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.1.zip", + "checksum": "SHA-256:112f81fcaed22286f9ba19bbd01d12337aab7b64e997120c33f833816b343e20", + "size": "373411607" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.1.zip", + "checksum": "SHA-256:112f81fcaed22286f9ba19bbd01d12337aab7b64e997120c33f833816b343e20", + "size": "373411607" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.1.zip", + "checksum": "SHA-256:112f81fcaed22286f9ba19bbd01d12337aab7b64e997120c33f833816b343e20", + "size": "373411607" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.1.zip", + "checksum": "SHA-256:112f81fcaed22286f9ba19bbd01d12337aab7b64e997120c33f833816b343e20", + "size": "373411607" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.1.zip", + "checksum": "SHA-256:112f81fcaed22286f9ba19bbd01d12337aab7b64e997120c33f833816b343e20", + "size": "373411607" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.1.zip", + "checksum": "SHA-256:112f81fcaed22286f9ba19bbd01d12337aab7b64e997120c33f833816b343e20", + "size": "373411607" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.1.zip", + "checksum": "SHA-256:112f81fcaed22286f9ba19bbd01d12337aab7b64e997120c33f833816b343e20", + "size": "373411607" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.1.zip", + "checksum": "SHA-256:112f81fcaed22286f9ba19bbd01d12337aab7b64e997120c33f833816b343e20", + "size": "373411607" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-3662303f312", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.0-rc1/esp32-arduino-libs-3.0.0-rc1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.0-rc1.zip", + "checksum": "SHA-256:0fb5d5b794a6bbfba5ec5330537cde675a214356b4b3bb1371d7ddc3829128c7", + "size": "350651673" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.0-rc1/esp32-arduino-libs-3.0.0-rc1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.0-rc1.zip", + "checksum": "SHA-256:0fb5d5b794a6bbfba5ec5330537cde675a214356b4b3bb1371d7ddc3829128c7", + "size": "350651673" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.0-rc1/esp32-arduino-libs-3.0.0-rc1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.0-rc1.zip", + "checksum": "SHA-256:0fb5d5b794a6bbfba5ec5330537cde675a214356b4b3bb1371d7ddc3829128c7", + "size": "350651673" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.0-rc1/esp32-arduino-libs-3.0.0-rc1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.0-rc1.zip", + "checksum": "SHA-256:0fb5d5b794a6bbfba5ec5330537cde675a214356b4b3bb1371d7ddc3829128c7", + "size": "350651673" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.0-rc1/esp32-arduino-libs-3.0.0-rc1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.0-rc1.zip", + "checksum": "SHA-256:0fb5d5b794a6bbfba5ec5330537cde675a214356b4b3bb1371d7ddc3829128c7", + "size": "350651673" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.0-rc1/esp32-arduino-libs-3.0.0-rc1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.0-rc1.zip", + "checksum": "SHA-256:0fb5d5b794a6bbfba5ec5330537cde675a214356b4b3bb1371d7ddc3829128c7", + "size": "350651673" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.0-rc1/esp32-arduino-libs-3.0.0-rc1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.0-rc1.zip", + "checksum": "SHA-256:0fb5d5b794a6bbfba5ec5330537cde675a214356b4b3bb1371d7ddc3829128c7", + "size": "350651673" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.0-rc1/esp32-arduino-libs-3.0.0-rc1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.0-rc1.zip", + "checksum": "SHA-256:0fb5d5b794a6bbfba5ec5330537cde675a214356b4b3bb1371d7ddc3829128c7", + "size": "350651673" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-3662303f31", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.0-alpha3/esp32-arduino-libs-3.0.0-alpha3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.0-alpha3.zip", + "checksum": "SHA-256:18a278b74a37211d142d1f1d5795af5b6a9526c360c0feee07bb72c04e898c41", + "size": "350651673" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.0-alpha3/esp32-arduino-libs-3.0.0-alpha3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.0-alpha3.zip", + "checksum": "SHA-256:18a278b74a37211d142d1f1d5795af5b6a9526c360c0feee07bb72c04e898c41", + "size": "350651673" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.0-alpha3/esp32-arduino-libs-3.0.0-alpha3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.0-alpha3.zip", + "checksum": "SHA-256:18a278b74a37211d142d1f1d5795af5b6a9526c360c0feee07bb72c04e898c41", + "size": "350651673" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.0-alpha3/esp32-arduino-libs-3.0.0-alpha3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.0-alpha3.zip", + "checksum": "SHA-256:18a278b74a37211d142d1f1d5795af5b6a9526c360c0feee07bb72c04e898c41", + "size": "350651673" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.0-alpha3/esp32-arduino-libs-3.0.0-alpha3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.0-alpha3.zip", + "checksum": "SHA-256:18a278b74a37211d142d1f1d5795af5b6a9526c360c0feee07bb72c04e898c41", + "size": "350651673" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.0-alpha3/esp32-arduino-libs-3.0.0-alpha3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.0-alpha3.zip", + "checksum": "SHA-256:18a278b74a37211d142d1f1d5795af5b6a9526c360c0feee07bb72c04e898c41", + "size": "350651673" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.0-alpha3/esp32-arduino-libs-3.0.0-alpha3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.0-alpha3.zip", + "checksum": "SHA-256:18a278b74a37211d142d1f1d5795af5b6a9526c360c0feee07bb72c04e898c41", + "size": "350651673" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.0-alpha3/esp32-arduino-libs-3.0.0-alpha3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.0-alpha3.zip", + "checksum": "SHA-256:18a278b74a37211d142d1f1d5795af5b6a9526c360c0feee07bb72c04e898c41", + "size": "350651673" + } + ] + }, + { + "name": "esp-x32", + "version": "2411", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-14.2.0_20241119-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:b1859df334a85541ae746e1b86439f59180d87f8cf1cc04c2e770fadf9f006e9", + "size": "323678089" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-14.2.0_20241119-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:7ff023033a5c00e55b9fc0a0b26d18fb0e476c24e24c5b0459bcb2e05a3729f1", + "size": "320064691" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp-elf-14.2.0_20241119-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:bb11dbf3ed25d4e0cc9e938749519e8236cfa2609e85742d311f1d869111805a", + "size": "319454139" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-i586-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-14.2.0_20241119-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:5ac611dca62ec791d413d1f417d566c444b006d2a4f97bd749b15f782d87249b", + "size": "328335914" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-x86_64-apple-darwin_signed.tar.gz", + "archiveFileName": "xtensa-esp-elf-14.2.0_20241119-x86_64-apple-darwin_signed.tar.gz", + "checksum": "SHA-256:15b3e60362028eaeff9156dc82dac3f1436b4aeef3920b28d7650974d8c34751", + "size": "336215844" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-aarch64-apple-darwin_signed.tar.gz", + "archiveFileName": "xtensa-esp-elf-14.2.0_20241119-aarch64-apple-darwin_signed.tar.gz", + "checksum": "SHA-256:45c475518735133789bacccad31f872318b7ecc0b31cc9b7924aad880034f0bf", + "size": "318797396" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-14.2.0_20241119-i686-w64-mingw32.zip", + "checksum": "SHA-256:b30e450e0af279783c54a9ae77c3b367dd556b78eda930a92ec7b784a74c28c8", + "size": "382457717" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-14.2.0_20241119-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:62ae704777d73c30689efff6e81178632a1ca44d1a2d60f4621eb997e040e028", + "size": "386316009" + } + ] + }, + { + "name": "esp-x32", + "version": "2405", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-13.2.0_20240530-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:bce77e8480701d5a90545369d1b5848f6048eb39c0022d2446d1e33a8e127490", + "size": "208911713" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-13.2.0_20240530-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:7c9e3c1adc733d042ed87b92daa1d6396e1b441c1755f1fa14cb88855719ba88", + "size": "202519931" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp-elf-13.2.0_20240530-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:d6955e8ea6af91574bf9213b92f32ca09eb8640103446b7fa19a63cfeeec5421", + "size": "202206516" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-i586-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-13.2.0_20240530-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:3666ee74ecb693ee6488f11469802630a7b0d32608184045a4f35cb413f59e3d", + "size": "213304863" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-x86_64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp-elf-13.2.0_20240530-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:948cf57b6eecc898b5f70e06ad08ba88c08b627be570ec631dfcd72f6295194a", + "size": "221357024" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-aarch64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp-elf-13.2.0_20240530-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:6f03fdf0cc14a7f3900ee59977f62e8626d8b7c208506e52f1fd883ac223427a", + "size": "199689745" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-i686-w64-mingw32_hotfix.zip", + "archiveFileName": "xtensa-esp-elf-13.2.0_20240530-i686-w64-mingw32_hotfix.zip", + "checksum": "SHA-256:d6b227c50e3c8e21d62502b3140e5ab74a4cb502c2b4169c36238b9858a8fb88", + "size": "266042967" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-x86_64-w64-mingw32_hotfix.zip", + "archiveFileName": "xtensa-esp-elf-13.2.0_20240530-x86_64-w64-mingw32_hotfix.zip", + "checksum": "SHA-256:155ee97b531236e6a7c763395c68ca793e55e74d2cb4d38a23057a153e01e7d0", + "size": "269831985" + } + ] + }, + { + "name": "esp-x32", + "version": "2302", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:e8d35938385447cf9c34735fee2a3b2b61cca6be07db77a45856a1c2a347e423", + "size": "111766903" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:569988acfc2673369f222037c64bac96990cee08cebeebc4f8860e0d984f8bd9", + "size": "106473247" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:6a844f16021e936cc9b87b203978356f57ab2144554f6f2a0f73ffa3d3d316c5", + "size": "105576049" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "checksum": "SHA-256:743d6f03a89329bb09f9550d27fcab677f5cf06b4720793bbcef7883a932681d", + "size": "114870843" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:4d32d764e984f3a570aacfb2f4957619540fb4629534d969b2e83997901334c3", + "size": "119424029" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:dc8fa7f4933bf5cb08e83bacce6160cc9dfe93d7aad1e8f92599bb81ff5b2e28", + "size": "106136827" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "checksum": "SHA-256:62bb6428d107ed3f44c212c77ecf24804b74c97327b0f0ad2029c656c6dbd6ee", + "size": "130847086" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:8febfe4a6476efc69012390106c8c660a14418f025137b0513670c72124339cf", + "size": "134985117" + } + ] + }, + { + "name": "xtensa-esp-elf-gdb", + "version": "14.2_20240403", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/xtensa-esp-elf-gdb-14.2_20240403-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-14.2_20240403-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:9d68472d4cba5cf8c2b79d94f86f92c828e76a632bd1e6be5e7706e5b304d36e", + "size": "31010320" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/xtensa-esp-elf-gdb-14.2_20240403-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-14.2_20240403-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:bdabc3217994815fc311c4e16e588b78f6596b5ad4ffa46c80b40e982cfb1e66", + "size": "30954580" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/xtensa-esp-elf-gdb-14.2_20240403-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-14.2_20240403-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:d54b8d703ba897b28c627da3d27106a3906dd01ba298778a67064710bc33c76d", + "size": "28697281" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/xtensa-esp-elf-gdb-14.2_20240403-i586-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-14.2_20240403-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:64d3bc992ed8fdec383d49e8b803ac494605a38117c8293db8da055037de96b0", + "size": "29890994" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/xtensa-esp-elf-gdb-14.2_20240403-x86_64-apple-darwin14.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-14.2_20240403-x86_64-apple-darwin14.tar.gz", + "checksum": "SHA-256:023e74b3fda793da4bc0509b02de776ee0dad6efaaac17bef5916fb7dc9c26b9", + "size": "44446611" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/xtensa-esp-elf-gdb-14.2_20240403-aarch64-apple-darwin21.1.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-14.2_20240403-aarch64-apple-darwin21.1.tar.gz", + "checksum": "SHA-256:ea757c6bf8c25238f6d2fdcc6bbab25a1b00608a0f9e19b7ddd2f37ddbdc3fb1", + "size": "37021423" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/xtensa-esp-elf-gdb-14.2_20240403-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-gdb-14.2_20240403-i686-w64-mingw32.zip", + "checksum": "SHA-256:322e8d9b700dc32d8158e3dc55fb85ec55de48d0bb7789375ee39a28d5d655e2", + "size": "26302466" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/xtensa-esp-elf-gdb-14.2_20240403-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-gdb-14.2_20240403-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:a27a2fe20f192f8e0a51b8936428b4e1cf8935cfe008ee445cc49f6fc7f6db2e", + "size": "28366035" + } + ] + }, + { + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/xtensa-esp-elf-gdb-12.1_20231023-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20231023-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:d0743ec43cd92c35452a9097f7863281de4e72f04120d63cfbcf9d591a373529", + "size": "36942094" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/xtensa-esp-elf-gdb-12.1_20231023-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20231023-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:bc1fac0366c6a08e26c45896ca21c8c90efc2cdd431b8ba084e8772e15502d0e", + "size": "37134601" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/xtensa-esp-elf-gdb-12.1_20231023-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20231023-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:25efc51d52b71f097ccec763c5c885c8f5026b432fec4b5badd6a5f36fe34d04", + "size": "34579556" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/xtensa-esp-elf-gdb-12.1_20231023-i586-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20231023-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:e0af0b3b4a6b29a843cd5f47e331a966d9258f7d825b4656c6251490f71b05b2", + "size": "35676578" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/xtensa-esp-elf-gdb-12.1_20231023-x86_64-apple-darwin14.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20231023-x86_64-apple-darwin14.tar.gz", + "checksum": "SHA-256:bd146fd99a52b2d71c7ce0f62b9e18f3423d6cae7b2b2c954046b0dd7a23142f", + "size": "52863941" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/xtensa-esp-elf-gdb-12.1_20231023-aarch64-apple-darwin21.1.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20231023-aarch64-apple-darwin21.1.tar.gz", + "checksum": "SHA-256:5edc76565bf9d2fadf24e443ddf3df7567354f336a65d4af5b2ee805cdfcec24", + "size": "33504923" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/xtensa-esp-elf-gdb-12.1_20231023-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20231023-i686-w64-mingw32.zip", + "checksum": "SHA-256:ea4f3ee6b95ad1ad2e07108a21a50037a3e64a420cdeb34b2ba95d612faed898", + "size": "31068749" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/xtensa-esp-elf-gdb-12.1_20231023-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20231023-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:13bb97f39173948d1cfb6e651d9b335ea9d52f1fdd0dda1eda3a2d23d8c63644", + "size": "33514906" + } + ] + }, + { + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20221002", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20221002/xtensa-esp-elf-gdb-12.1_20221002-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20221002-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:d056f2435ef05cccadac5d8fcefa3efd8f8c456c3d853f5eba1edb501acfe4f7", + "size": "32006939" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20221002/xtensa-esp-elf-gdb-12.1_20221002-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20221002-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:7fc9674cc4f4c5e7bc94ca05bc5deaaa4c4bbcc972a9caee6fcd6a872c804c02", + "size": "32227425" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20221002/xtensa-esp-elf-gdb-12.1_20221002-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20221002-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:68118ff36e9dd2284d92a7a529d0e2a8d20f6426036a0736fa1147935614ece2", + "size": "29960020" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20221002/xtensa-esp-elf-gdb-12.1_20221002-i586-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20221002-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:cf6cac8ed70726d390d30713d537754544872715e1b70a8a4a28b5dc616193b9", + "size": "30877187" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20221002/xtensa-esp-elf-gdb-12.1_20221002-x86_64-apple-darwin14.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20221002-x86_64-apple-darwin14.tar.gz", + "checksum": "SHA-256:417fcf8d1b596b9481603d6987def1d6cfcebdb9739f53940887334a7de855fa", + "size": "45941853" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20221002/xtensa-esp-elf-gdb-12.1_20221002-aarch64-apple-darwin21.1.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20221002-aarch64-apple-darwin21.1.tar.gz", + "checksum": "SHA-256:95d6ed2311d6a72bf349e152d096aeeb151f9c5989bfa3120facb1c99e879196", + "size": "27596410" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20221002/xtensa-esp-elf-gdb-12.1_20221002-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20221002-i686-w64-mingw32.zip", + "checksum": "SHA-256:642b6a135c38ff1d5e54ad2c29469b769f8e1b101dab363d06101b02284bb979", + "size": "27387730" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20221002/xtensa-esp-elf-gdb-12.1_20221002-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20221002-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:2d958570ff6aa69ed32cbb076cbaf303349a26b3301a7c4628be8d7ad39cf9f1", + "size": "29561472" + } + ] + }, + { + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/xtensa-esp-elf-gdb-11.2_20220823-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-11.2_20220823-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:b5f7cc3e4b5a58db655754083ed9652e4953e71c3b4922fb624e7a034ec24a64", + "size": 26947336 + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/xtensa-esp-elf-gdb-11.2_20220823-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-11.2_20220823-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:816acfae38b6b443f4f1590395f68f079243539259d19c7772ae6416c6519444", + "size": 27134508 + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/xtensa-esp-elf-gdb-11.2_20220823-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-11.2_20220823-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:4dd1bace0633196fddfdcef3cebcc4bbfce22f5a0d2d1e3d618f3d8a6cbfcacc", + "size": 25205239 + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/xtensa-esp-elf-gdb-11.2_20220823-i586-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-11.2_20220823-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:27744d09d171be2f55ec15fa7f2d7f8ff94d33f7e130d24ebe082cb6c438618b", + "size": 25978028 + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/xtensa-esp-elf-gdb-11.2_20220823-x86_64-apple-darwin14.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-11.2_20220823-x86_64-apple-darwin14.tar.gz", + "checksum": "SHA-256:1432faa12d7301133f6ee654d60751b57adcc6cf323ee1ecc393f06f0225eff4", + "size": 38386785 + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/xtensa-esp-elf-gdb-11.2_20220823-aarch64-apple-darwin21.1.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-11.2_20220823-aarch64-apple-darwin21.1.tar.gz", + "checksum": "SHA-256:d0b542ef070ea72857f9cf554f176a0a9d868cd59e05ac293ad39402bcc5277d", + "size": 21671964 + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/xtensa-esp-elf-gdb-11.2_20220823-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-gdb-11.2_20220823-i686-w64-mingw32.zip", + "checksum": "SHA-256:1678b06aa80b1d689d05548056635efde5b73b98f2c3de5d555bcfc6f374c5d0", + "size": 23241302 + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/xtensa-esp-elf-gdb-11.2_20220823-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-gdb-11.2_20220823-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:7060df4b6aa133e282147c3651d50222d677d6a0fff92979c500353b099a3f41", + "size": 25135265 + } + ] + }, + { + "name": "esp-rv32", + "version": "2411", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-x86_64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-14.2.0_20241119-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:a16942465d33c7f0334c16e83bc6feb62e06eeb79cf19099293480bb8d48c0cd", + "size": "593721156" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-aarch64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-14.2.0_20241119-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:22486233d0e0fd58a54ae453b701f195f1432fc6f2e17085b9d6c8d5d9acefb7", + "size": "587879927" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-arm-linux-gnueabi.tar.gz", + "archiveFileName": "riscv32-esp-elf-14.2.0_20241119-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:27a72d5d96cdb56dae2a1da5dfde1717c18a8c1f9a1454c8e34a8bd34abe662d", + "size": "586531522" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-i586-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-14.2.0_20241119-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:b7bd6e4cd53a4c55831d48e96a3d500bfffb091bec84a30bc8c3ad687e3eb3a2", + "size": "597070471" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-x86_64-apple-darwin_signed.tar.gz", + "archiveFileName": "riscv32-esp-elf-14.2.0_20241119-x86_64-apple-darwin_signed.tar.gz", + "checksum": "SHA-256:5f8b571e1aedbe9f856f3bdeca6600cd5510ccff1ca102c4f001421eda560585", + "size": "602343061" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-aarch64-apple-darwin_signed.tar.gz", + "archiveFileName": "riscv32-esp-elf-14.2.0_20241119-aarch64-apple-darwin_signed.tar.gz", + "checksum": "SHA-256:a7276042a7eb2d33c2dff7167539e445c32c07d43a2c6827e86d035642503e0b", + "size": "578521565" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-i686-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-14.2.0_20241119-i686-w64-mingw32.zip", + "checksum": "SHA-256:54193a97bd75205678ead8d11f00b351cfa3c2a6e5ab5d966341358b9f9422d7", + "size": "672055172" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-x86_64-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-14.2.0_20241119-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:24c8407fa467448d394e0639436a5ede31caf1838e35e8435e19df58ebed438c", + "size": "677812937" + } + ] + }, + { + "name": "esp-rv32", + "version": "2405", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/riscv32-esp-elf-13.2.0_20240530-x86_64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-13.2.0_20240530-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:e7fbfffbb19dcd3764a9848a141bf44e19ad0b48e0bd1515912345c26fe52fba", + "size": "294346758" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/riscv32-esp-elf-13.2.0_20240530-aarch64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-13.2.0_20240530-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:a178a895b807ed2e87d5d62153c36a6aae048581f527c0eb152f0a02b8de9571", + "size": "288374597" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/riscv32-esp-elf-13.2.0_20240530-arm-linux-gnueabi.tar.gz", + "archiveFileName": "riscv32-esp-elf-13.2.0_20240530-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:4a2f176d0f5bc8a70645975e2a08ea94145fb69b7225c5cdcbd6024a4836aaf5", + "size": "287737495" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/riscv32-esp-elf-13.2.0_20240530-i586-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-13.2.0_20240530-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:7a6f02f1b2effafb18600bbf602818f6923fd320f000fb8659f34acbfda8812f", + "size": "299138540" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/riscv32-esp-elf-13.2.0_20240530-x86_64-apple-darwin.tar.gz", + "archiveFileName": "riscv32-esp-elf-13.2.0_20240530-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:a193b4f025d0d836b0a9d9cbe760af1c53e53af66fc332fe98952bc4c456dd9a", + "size": "305025700" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/riscv32-esp-elf-13.2.0_20240530-aarch64-apple-darwin.tar.gz", + "archiveFileName": "riscv32-esp-elf-13.2.0_20240530-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:7082dd2e2123dea5609a24092d19ac6612ae7e219df1d298de6b2f64cb4af0df", + "size": "285458443" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/riscv32-esp-elf-13.2.0_20240530-i686-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-13.2.0_20240530-i686-w64-mingw32.zip", + "checksum": "SHA-256:590bfb10576702639825581cc00c445da6e577012840a787137417e80d15f46d", + "size": "366573064" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/riscv32-esp-elf-13.2.0_20240530-x86_64-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-13.2.0_20240530-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:413eb9f6adf8fdaf25544d014c850fc09eb38bb93a2fc5ebd107ab1b0de1bb3a", + "size": "369820297" + } + ] + }, + { + "name": "esp-rv32", + "version": "2302", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/riscv32-esp-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:1eb0d65990547ee9706b90406600cbc3638814d5feb7c1f7b44bb5416478a5bd", + "size": "257615266" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/riscv32-esp-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:921fcdc170c7fe5d6a0a30470ed1875c8926d910c19739fc950c8d1836e4c1c5", + "size": "253094184" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/riscv32-esp-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "archiveFileName": "riscv32-esp-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:f66e06312b58251c2121c1b1df1102565708573b86b2a9fe0c03ea1b0e9a7511", + "size": "252558021" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/riscv32-esp-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "checksum": "SHA-256:8abcac0331ef8973d1c705e77523364ebec7e98b37640d4a1d036912f3cbe946", + "size": "261248375" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/riscv32-esp-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "archiveFileName": "riscv32-esp-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:76a334bc75a4e3891c222c84d7968817f2d0699d2976fc2a1658e56395283bec", + "size": "268987133" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/riscv32-esp-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "archiveFileName": "riscv32-esp-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:f30571945b257a10a26901bba3c5892e07c192aacf9ed6e8fcd11ca36ed827d2", + "size": "252159713" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/riscv32-esp-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "checksum": "SHA-256:a5dfbb6dbf6fc6c6ea9beb2723af059ba3c5b2c86c2f0dc3b21afdc7bb229bf5", + "size": "324863847" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/riscv32-esp-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:9deae9e0013b2f7bbf017f9c8135755bfa89522f337c7dca35872bf12ec08176", + "size": "328092732" + } + ] + }, + { + "name": "riscv32-esp-elf-gdb", + "version": "14.2_20240403", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/riscv32-esp-elf-gdb-14.2_20240403-x86_64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-14.2_20240403-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:ce004bc0bbd71b246800d2d13b239218b272a38bd528e316f21f1af2db8a4b13", + "size": "30707431" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/riscv32-esp-elf-gdb-14.2_20240403-aarch64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-14.2_20240403-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:ba10f2866c61410b88c65957274280b1a62e3bed05131654ed9b6758efe18e55", + "size": "30824065" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/riscv32-esp-elf-gdb-14.2_20240403-arm-linux-gnueabi.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-14.2_20240403-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:88539db5d987f28827efac7e26080a2803b9b539342ccd2963ccfdd56d7f08f7", + "size": "29000575" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/riscv32-esp-elf-gdb-14.2_20240403-i586-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-14.2_20240403-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:0e628ee37438ab6ba05eb889a76d09e50cb98e0020a16b8e2b935c5cf19b4ed2", + "size": "29947521" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/riscv32-esp-elf-gdb-14.2_20240403-x86_64-apple-darwin14.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-14.2_20240403-x86_64-apple-darwin14.tar.gz", + "checksum": "SHA-256:8f6bda832d70dad5860a639d55aba4237bd10cbac9f4822db1eece97357b34a9", + "size": "44196117" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/riscv32-esp-elf-gdb-14.2_20240403-aarch64-apple-darwin21.1.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-14.2_20240403-aarch64-apple-darwin21.1.tar.gz", + "checksum": "SHA-256:d88b6116e86456c8480ce9bc95aed375a35c0d091f1da0a53b86be0e6ef3d320", + "size": "36794404" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/riscv32-esp-elf-gdb-14.2_20240403-i686-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-gdb-14.2_20240403-i686-w64-mingw32.zip", + "checksum": "SHA-256:d6e7ce05805b0d8d4dd138ad239b98a1adf8da98941867d60760eb1ae5361730", + "size": "26486295" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/riscv32-esp-elf-gdb-14.2_20240403-x86_64-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-gdb-14.2_20240403-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:5c9f211dc46daf6b96fad09d709284a0f0186fef8947d9f6edd6bca5b5ad4317", + "size": "27942579" + } + ] + }, + { + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/riscv32-esp-elf-gdb-12.1_20231023-x86_64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20231023-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:2c78b806be176b1e449e07ff83429d38dfc39a13f89a127ac1ffa6c1230537a0", + "size": "36630145" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/riscv32-esp-elf-gdb-12.1_20231023-aarch64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20231023-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:33f80117c8777aaff9179e27953e41764c5c46b3c576dc96a37ecc7a368807ec", + "size": "36980143" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/riscv32-esp-elf-gdb-12.1_20231023-arm-linux-gnueabi.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20231023-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:292e6ec0a9381c1480bbadf5caae25e86428b68fb5d030c9be7deda5e7f070e0", + "size": "34950318" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/riscv32-esp-elf-gdb-12.1_20231023-i586-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20231023-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:68a25fbcfc6371ec4dbe503ec92211977eb2006f0c29e67dbce6b93c70c6b7ec", + "size": "35801607" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/riscv32-esp-elf-gdb-12.1_20231023-x86_64-apple-darwin14.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20231023-x86_64-apple-darwin14.tar.gz", + "checksum": "SHA-256:322c722e6c12225ed8cd97f95a0375105756dc5113d369958ce0858ad1a90257", + "size": "52618688" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/riscv32-esp-elf-gdb-12.1_20231023-aarch64-apple-darwin21.1.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20231023-aarch64-apple-darwin21.1.tar.gz", + "checksum": "SHA-256:c2224b3a8d02451c530cf004c29653292d963a1b4021b4b472b862b6dbe97e0b", + "size": "33149392" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/riscv32-esp-elf-gdb-12.1_20231023-i686-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20231023-i686-w64-mingw32.zip", + "checksum": "SHA-256:4b42149a99dd87ee7e6dde25c99bad966c7f964253fa8f771593d7cef69f5602", + "size": "31635103" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/riscv32-esp-elf-gdb-12.1_20231023-x86_64-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20231023-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:728231546ad5006d34463f972658b2a89e52f660a42abab08a29bedd4a8046ad", + "size": "33400816" + } + ] + }, + { + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20221002", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20221002/riscv32-esp-elf-gdb-12.1_20221002-x86_64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20221002-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:f0cf0821eaac7e8cf2c63b14f2b69d612f4f8c266b29d02d5547b7d7cbbd0e11", + "size": "32035173" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20221002/riscv32-esp-elf-gdb-12.1_20221002-aarch64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20221002-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:6812344dfb5c50a81d2fd8354463516f0aa5f582e8ab406cbaeca8722b45fa94", + "size": "32362642" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20221002/riscv32-esp-elf-gdb-12.1_20221002-arm-linux-gnueabi.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20221002-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:b73042b8e1df5a3fc8008ec3cd000ef579f155d72a66c6ade1d48906d843e738", + "size": "30580290" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20221002/riscv32-esp-elf-gdb-12.1_20221002-i586-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20221002-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:3f07a1b8dc87127a1a6bec6fbace4f8daca44755356f0692e9a5d4c8c4bfd81d", + "size": "31309798" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20221002/riscv32-esp-elf-gdb-12.1_20221002-x86_64-apple-darwin14.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20221002-x86_64-apple-darwin14.tar.gz", + "checksum": "SHA-256:bb139229f9a4998cab9cfb617d3ecb05b77cbfa9a3a59c54969035f1b4007487", + "size": "46120661" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20221002/riscv32-esp-elf-gdb-12.1_20221002-aarch64-apple-darwin21.1.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20221002-aarch64-apple-darwin21.1.tar.gz", + "checksum": "SHA-256:f6513b57f28245497f9c39a201f3f6444d4180e16b39765c629e01036286c0e6", + "size": "27662484" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20221002/riscv32-esp-elf-gdb-12.1_20221002-i686-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20221002-i686-w64-mingw32.zip", + "checksum": "SHA-256:8287fa2891e8d032e8283210048d653705791cda31504369418288d3e4753dd6", + "size": "27839143" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20221002/riscv32-esp-elf-gdb-12.1_20221002-x86_64-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20221002-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:9debae1135df8f5868a9d945468f0480cdaab25f77ead6a55cc85142c4487abd", + "size": "29404989" + } + ] + }, + { + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/riscv32-esp-elf-gdb-11.2_20220823-x86_64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-11.2_20220823-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:6bf5b5d2d407e074af2a74fc826764934ac1625a1751c52fbc0d4d7772061f8f", + "size": 26799809 + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/riscv32-esp-elf-gdb-11.2_20220823-aarch64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-11.2_20220823-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:e54ef67cdb5724fc2da8f0487f19b2c83c08b560fff317f5ffd98fbb230b397a", + "size": 27021672 + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/riscv32-esp-elf-gdb-11.2_20220823-arm-linux-gnueabi.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-11.2_20220823-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:86772c6aee8a05b2c75a6b04e9da630e35e8415b64da8ccde92a5fb2d3c7fcf4", + "size": 25532577 + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/riscv32-esp-elf-gdb-11.2_20220823-i586-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-11.2_20220823-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:3463be3e24182b7f1bd0fb232020534445b2d0ea0e7093c1b4f4da102b3baf52", + "size": 26188698 + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/riscv32-esp-elf-gdb-11.2_20220823-x86_64-apple-darwin14.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-11.2_20220823-x86_64-apple-darwin14.tar.gz", + "checksum": "SHA-256:a9db1811ebb9271134eba2f7c303fc2587bd4b2a1ae33cd05ff2605cd2fb30d2", + "size": 38397584 + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/riscv32-esp-elf-gdb-11.2_20220823-aarch64-apple-darwin21.1.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-11.2_20220823-aarch64-apple-darwin21.1.tar.gz", + "checksum": "SHA-256:c94fb6d726b8d97e65e23237f5126a41343bca8f22a0414df5f0e6777e36f51c", + "size": 21593613 + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/riscv32-esp-elf-gdb-11.2_20220823-i686-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-gdb-11.2_20220823-i686-w64-mingw32.zip", + "checksum": "SHA-256:20cdee8a1c01428363ef02f4cc8035c65508d6b43560c525733eae94b7c7bb50", + "size": 23436802 + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/riscv32-esp-elf-gdb-11.2_20220823-x86_64-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-gdb-11.2_20220823-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:add72366485b784b66837ce263548980f1df144d0954c42d75a81f6acbd43cac", + "size": 24802315 + } + ] + }, + { + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20241016", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-linux-amd64-0.12.0-esp32-20241016.tar.gz", + "archiveFileName": "openocd-esp32-linux-amd64-0.12.0-esp32-20241016.tar.gz", + "checksum": "SHA-256:e82b0f036dc99244bead5f09a86e91bb2365cbcd1122ac68261e5647942485df", + "size": "2398717" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-linux-arm64-0.12.0-esp32-20241016.tar.gz", + "archiveFileName": "openocd-esp32-linux-arm64-0.12.0-esp32-20241016.tar.gz", + "checksum": "SHA-256:8f8daf5bd22ec5d2fa9257b0862ec33da18ee677e023fb9a9eb17f74ce208c76", + "size": "2271584" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-linux-armel-0.12.0-esp32-20241016.tar.gz", + "archiveFileName": "openocd-esp32-linux-armel-0.12.0-esp32-20241016.tar.gz", + "checksum": "SHA-256:bc9c020ecf20e2000f76cffa44305fd5bc44d2e688ea78cce423399d33f19767", + "size": "2414206" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-macos-0.12.0-esp32-20241016.tar.gz", + "archiveFileName": "openocd-esp32-macos-0.12.0-esp32-20241016.tar.gz", + "checksum": "SHA-256:02a2dffe801a2d005fa9e614d80ff8173395b2cb0b5d3118d0229d094a9946a7", + "size": "2508089" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-macos-arm64-0.12.0-esp32-20241016.tar.gz", + "archiveFileName": "openocd-esp32-macos-arm64-0.12.0-esp32-20241016.tar.gz", + "checksum": "SHA-256:c382f9e884d6565cb6089bff5f200f4810994667d885f062c3d3c5625a0fa9d6", + "size": "2552569" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-win32-0.12.0-esp32-20241016.zip", + "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20241016.zip", + "checksum": "SHA-256:3b5d615e0a72cc771a45dd469031312d5881c01d7b6bc9edb29b8b6bda8c2e90", + "size": "2946244" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-win64-0.12.0-esp32-20241016.zip", + "archiveFileName": "openocd-esp32-win64-0.12.0-esp32-20241016.zip", + "checksum": "SHA-256:5e7b2fd1947d3a8625f6a11db7a2340cf2f41ff4c61284c022c7d7c32b18780a", + "size": "2946244" + } + ] + }, + { + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20240821", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240821/openocd-esp32-linux-amd64-0.12.0-esp32-20240821.tar.gz", + "archiveFileName": "openocd-esp32-linux-amd64-0.12.0-esp32-20240821.tar.gz", + "checksum": "SHA-256:f8c68541fa38307bc0c0763b7e1e3fe4e943d5d45da07d817a73b492e103b652", + "size": "2373094" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240821/openocd-esp32-linux-arm64-0.12.0-esp32-20240821.tar.gz", + "archiveFileName": "openocd-esp32-linux-arm64-0.12.0-esp32-20240821.tar.gz", + "checksum": "SHA-256:4d6e263d84e447354dc685848557d6c284dda7fe007ee451f729a7edfa7baad7", + "size": "2251272" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240821/openocd-esp32-linux-armel-0.12.0-esp32-20240821.tar.gz", + "archiveFileName": "openocd-esp32-linux-armel-0.12.0-esp32-20240821.tar.gz", + "checksum": "SHA-256:9d45679f2c4cf450d5e2350047cf57bb76dde2487d30cebce0a72c9173b5c45b", + "size": "2390074" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240821/openocd-esp32-macos-0.12.0-esp32-20240821.tar.gz", + "archiveFileName": "openocd-esp32-macos-0.12.0-esp32-20240821.tar.gz", + "checksum": "SHA-256:565c8fabc5f19a6e7a0864a294d74b307eec30b9291d16d3fc90e273f0330cb4", + "size": "2485320" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240821/openocd-esp32-macos-arm64-0.12.0-esp32-20240821.tar.gz", + "archiveFileName": "openocd-esp32-macos-arm64-0.12.0-esp32-20240821.tar.gz", + "checksum": "SHA-256:68c5c7cf3d15b9810939a5edabc6ff2c9f4fc32262de91fc292a180bc5cc0637", + "size": "2530336" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240821/openocd-esp32-win32-0.12.0-esp32-20240821.zip", + "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20240821.zip", + "checksum": "SHA-256:463fc2903ddaf03f86ff50836c5c63cc696550b0446140159eddfd2e85570c5d", + "size": "2916409" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240821/openocd-esp32-win64-0.12.0-esp32-20240821.zip", + "archiveFileName": "openocd-esp32-win64-0.12.0-esp32-20240821.zip", + "checksum": "SHA-256:550f57369f1f1f6cc600b5dffa3378fd6164d8ea8db7c567cf41091771f090cb", + "size": "2916408" + } + ] + }, + { + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20240318", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240318/openocd-esp32-linux-amd64-0.12.0-esp32-20240318.tar.gz", + "archiveFileName": "openocd-esp32-linux-amd64-0.12.0-esp32-20240318.tar.gz", + "checksum": "SHA-256:cf26c5cef4f6b04aa23cd2778675604e5a74a4ce4d8d17b854d05fbcb782d52c", + "size": "2252682" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240318/openocd-esp32-linux-arm64-0.12.0-esp32-20240318.tar.gz", + "archiveFileName": "openocd-esp32-linux-arm64-0.12.0-esp32-20240318.tar.gz", + "checksum": "SHA-256:9b97a37aa2cab94424a778c25c0b4aa0f90d6ef9cda764a1d9289d061305f4b7", + "size": "2132904" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240318/openocd-esp32-linux-armel-0.12.0-esp32-20240318.tar.gz", + "archiveFileName": "openocd-esp32-linux-armel-0.12.0-esp32-20240318.tar.gz", + "checksum": "SHA-256:b7e82776ec374983807d3389df09c632ad9bc8341f2075690b6b500319dfeaf4", + "size": "2271761" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240318/openocd-esp32-macos-0.12.0-esp32-20240318.tar.gz", + "archiveFileName": "openocd-esp32-macos-0.12.0-esp32-20240318.tar.gz", + "checksum": "SHA-256:b16c3082c94df1079367c44d99f7a8605534cd48aabc18898e46e94a2c8c57e7", + "size": "2365588" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240318/openocd-esp32-macos-arm64-0.12.0-esp32-20240318.tar.gz", + "archiveFileName": "openocd-esp32-macos-arm64-0.12.0-esp32-20240318.tar.gz", + "checksum": "SHA-256:534ec925ae6e35e869e4e4e6e4d2c4a1eb081f97ebcc2dd5efdc52d12f4c2f86", + "size": "2406377" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240318/openocd-esp32-win32-0.12.0-esp32-20240318.zip", + "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20240318.zip", + "checksum": "SHA-256:d379329eba052435173ab0d69c9b15bc164a6ce489e2a67cd11169d2dabff633", + "size": "2783915" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240318/openocd-esp32-win32-0.12.0-esp32-20240318.zip", + "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20240318.zip", + "checksum": "SHA-256:d379329eba052435173ab0d69c9b15bc164a6ce489e2a67cd11169d2dabff633", + "size": "2783915" + } + ] + }, + { + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230921", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-linux-amd64-0.12.0-esp32-20230921.tar.gz", + "archiveFileName": "openocd-esp32-linux-amd64-0.12.0-esp32-20230921.tar.gz", + "checksum": "SHA-256:61e38e0a13a5c1664624ec1c397d7f7d6868554b0d345d3fb1f7294cce38cc4b", + "size": "2193783" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-linux-arm64-0.12.0-esp32-20230921.tar.gz", + "archiveFileName": "openocd-esp32-linux-arm64-0.12.0-esp32-20230921.tar.gz", + "checksum": "SHA-256:6430315dc1b926541c93cef63d2b08982543ad3f9fe6e0d7107c8a518ef20432", + "size": "2062058" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-linux-armel-0.12.0-esp32-20230921.tar.gz", + "archiveFileName": "openocd-esp32-linux-armel-0.12.0-esp32-20230921.tar.gz", + "checksum": "SHA-256:5df16d8a91f013a547f6b3b914c655a9d267996a3b6503031b335ac04a4f8d15", + "size": "2206666" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-macos-0.12.0-esp32-20230921.tar.gz", + "archiveFileName": "openocd-esp32-macos-0.12.0-esp32-20230921.tar.gz", + "checksum": "SHA-256:0a4f764934f488af18cdac2a0d152dd36b4870f3bec1a2d4e25b6b3b7a5258a0", + "size": "2305832" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-macos-arm64-0.12.0-esp32-20230921.tar.gz", + "archiveFileName": "openocd-esp32-macos-arm64-0.12.0-esp32-20230921.tar.gz", + "checksum": "SHA-256:6dce89048f642eb0559a915b6e514f90feb2a95afe21b84f0b0ebf2b27824816", + "size": "2341406" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-win32-0.12.0-esp32-20230921.zip", + "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20230921.zip", + "checksum": "SHA-256:ac9d522a63b0816f64d921547bd55c031788035ced85c067d8e7c2862cb1bd0d", + "size": "2710475" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-win32-0.12.0-esp32-20230921.zip", + "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20230921.zip", + "checksum": "SHA-256:ac9d522a63b0816f64d921547bd55c031788035ced85c067d8e7c2862cb1bd0d", + "size": "2710475" + } + ] + }, + { + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230419", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-linux-amd64-0.12.0-esp32-20230419.tar.gz", + "archiveFileName": "openocd-esp32-linux-amd64-0.12.0-esp32-20230419.tar.gz", + "checksum": "SHA-256:5144e7516cd75a2152b35ecae0a400f7d3d4424c2488fbacc49433564f54c70d", + "size": 2126949 + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-linux-arm64-0.12.0-esp32-20230419.tar.gz", + "archiveFileName": "openocd-esp32-linux-arm64-0.12.0-esp32-20230419.tar.gz", + "checksum": "SHA-256:1c4d900c738fe00730c6033abb6cf1cc6587717dbeee291d5908272d153d329a", + "size": 1989161 + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-linux-armel-0.12.0-esp32-20230419.tar.gz", + "archiveFileName": "openocd-esp32-linux-armel-0.12.0-esp32-20230419.tar.gz", + "checksum": "SHA-256:293258fd67618dd352e1096137ad9f2b801926eaf74ffcd570540ae94ad8ee5c", + "size": 2129727 + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-macos-0.12.0-esp32-20230419.tar.gz", + "archiveFileName": "openocd-esp32-macos-0.12.0-esp32-20230419.tar.gz", + "checksum": "SHA-256:621aad7d011c6817cde9570dfea42c7bcc699458bf43c37706cb4c2f6475a247", + "size": 2237976 + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-macos-arm64-0.12.0-esp32-20230419.tar.gz", + "archiveFileName": "openocd-esp32-macos-arm64-0.12.0-esp32-20230419.tar.gz", + "checksum": "SHA-256:3af7eac3a7de3939731ec4c13fb5d72a8e6ce5e5d274bb9697f5d93039561e42", + "size": 2270699 + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-win32-0.12.0-esp32-20230419.zip", + "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20230419.zip", + "checksum": "SHA-256:f2cb3d9cacfe789c20d3272af846d726a062ce8f2e4ee142bddb27501d7dd7a7", + "size": 2619680 + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-win32-0.12.0-esp32-20230419.zip", + "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20230419.zip", + "checksum": "SHA-256:f2cb3d9cacfe789c20d3272af846d726a062ce8f2e4ee142bddb27501d7dd7a7", + "size": 2619680 + } + ] + }, + { + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20221026", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20221026/openocd-esp32-linux-amd64-0.11.0-esp32-20221026.tar.gz", + "archiveFileName": "openocd-esp32-linux-amd64-0.11.0-esp32-20221026.tar.gz", + "checksum": "SHA-256:ce63e9b1dfab60cc62da5dc2abcc22ba7036c42afe74671c787eb026744e7d0b", + "size": "2051435" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20221026/openocd-esp32-linux-arm64-0.11.0-esp32-20221026.tar.gz", + "archiveFileName": "openocd-esp32-linux-arm64-0.11.0-esp32-20221026.tar.gz", + "checksum": "SHA-256:fe60a3a603e8c6bee47367e40fcb8c0da3a38e01163e9674ebc919b067700506", + "size": "1993843" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20221026/openocd-esp32-linux-armel-0.11.0-esp32-20221026.tar.gz", + "archiveFileName": "openocd-esp32-linux-armel-0.11.0-esp32-20221026.tar.gz", + "checksum": "SHA-256:6ef76101cca196a4be30fc74f191eff34abb423e32930a383012b866c9b76135", + "size": "2092111" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20221026/openocd-esp32-macos-0.11.0-esp32-20221026.tar.gz", + "archiveFileName": "openocd-esp32-macos-0.11.0-esp32-20221026.tar.gz", + "checksum": "SHA-256:8edc666a0a230432554b73df7c62e0b5ec21fb018e7fda13b11a7ca8b6c1763b", + "size": "2199855" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20221026/openocd-esp32-macos-arm64-0.11.0-esp32-20221026.tar.gz", + "archiveFileName": "openocd-esp32-macos-arm64-0.11.0-esp32-20221026.tar.gz", + "checksum": "SHA-256:c426c0158ba6488e2f432f7c5b22e79155b5b0fae6d1ad5bbd7894723b43aa12", + "size": "2247179" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20221026/openocd-esp32-win32-0.11.0-esp32-20221026.zip", + "archiveFileName": "openocd-esp32-win32-0.11.0-esp32-20221026.zip", + "checksum": "SHA-256:e0e789d35308c029c6b53457cf4a42a5620cb1a3014740026c089c2ed4fd77b2", + "size": "2493214" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20221026/openocd-esp32-win32-0.11.0-esp32-20221026.zip", + "archiveFileName": "openocd-esp32-win32-0.11.0-esp32-20221026.zip", + "checksum": "SHA-256:e0e789d35308c029c6b53457cf4a42a5620cb1a3014740026c089c2ed4fd77b2", + "size": "2493214" + } + ] + }, + { + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20220706", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20220706/openocd-esp32-win32-0.11.0-esp32-20220706.zip", + "archiveFileName": "openocd-esp32-win32-0.11.0-esp32-20220706.zip", + "checksum": "SHA-256:c3d39eb4365a9947e71f1d3780ce031185bc6437f21186568a5c05f23f57a8d0", + "size": "2608736" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20220706/openocd-esp32-win32-0.11.0-esp32-20220706.zip", + "archiveFileName": "openocd-esp32-win32-0.11.0-esp32-20220706.zip", + "checksum": "SHA-256:c3d39eb4365a9947e71f1d3780ce031185bc6437f21186568a5c05f23f57a8d0", + "size": "2608736" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20220706/openocd-esp32-macos-0.11.0-esp32-20220706.tar.gz", + "archiveFileName": "openocd-esp32-macos-0.11.0-esp32-20220706.tar.gz", + "checksum": "SHA-256:333ee2ec3c9b5dc6ad4509faae55335cdea7f8bf83a56bfcf5327e4497c8538a", + "size": "2077882" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20220706/openocd-esp32-linux-amd64-0.11.0-esp32-20220706.tar.gz", + "archiveFileName": "openocd-esp32-linux-amd64-0.11.0-esp32-20220706.tar.gz", + "checksum": "SHA-256:26f1f18dd93eb70a13203848d3fb1cc2e0de1fd6749c7dd771b2de8709735aed", + "size": "2011201" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20220706/openocd-esp32-linux-amd64-0.11.0-esp32-20220706.tar.gz", + "archiveFileName": "openocd-esp32-linux-amd64-0.11.0-esp32-20220706.tar.gz", + "checksum": "SHA-256:26f1f18dd93eb70a13203848d3fb1cc2e0de1fd6749c7dd771b2de8709735aed", + "size": "2011201" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20220706/openocd-esp32-linux-armhf-0.11.0-esp32-20220706.tar.gz", + "archiveFileName": "openocd-esp32-linux-armhf-0.11.0-esp32-20220706.tar.gz", + "checksum": "SHA-256:7f3b57332104e8b8e6194553365a70a9d3754878cfc063d5dc5d839513a63de9", + "size": "1902964" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20220706/openocd-esp32-linux-arm64-0.11.0-esp32-20220706.tar.gz", + "archiveFileName": "openocd-esp32-linux-arm64-0.11.0-esp32-20220706.tar.gz", + "checksum": "SHA-256:f97792bc2852937ec0accb9f0eb2e49926c0f747a71f101a4e34aed75d2c6fcc", + "size": "1954685" + } + ] + }, + { + "name": "esptool_py", + "version": "4.9.dev3", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC3/esptool-v4.9.dev3-linux-amd64.tar.gz", + "archiveFileName": "esptool-v4.9.dev3-linux-amd64.tar.gz", + "checksum": "SHA-256:4ecaf51836cbf4ea3c19840018bfef3b0b8cd8fc3c95f6e1e043ca5bbeab9bf0", + "size": "64958202" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC3/esptool-v4.9.dev3-linux-armv7.tar.gz", + "archiveFileName": "esptool-v4.9.dev3-linux-armv7.tar.gz", + "checksum": "SHA-256:fff818573bce483ee793ac83c8211f6abf764aa3350f198228859f696a0a0b36", + "size": "31530030" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC3/esptool-v4.9.dev3-linux-aarch64.tar.gz", + "archiveFileName": "esptool-v4.9.dev3-linux-aarch64.tar.gz", + "checksum": "SHA-256:5b274bdff2f62e6a07c3c1dfa51b1128924621f661747eca3dbe0f77972f2f06", + "size": "33663882" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC3/esptool-v4.9.dev3-macos-amd64.tar.gz", + "archiveFileName": "esptool-v4.9.dev3-macos-amd64.tar.gz", + "checksum": "SHA-256:c733c83b58fcf5f642fbb2fddb8ff24640c2c785126cba0821fb70c4a5ceea7a", + "size": "32767836" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC3/esptool-v4.9.dev3-macos-arm64.tar.gz", + "archiveFileName": "esptool-v4.9.dev3-macos-arm64.tar.gz", + "checksum": "SHA-256:83c195a15981e6a5e7a130db2ccfb21e2d8093912e5b003681f9a5abadd71af7", + "size": "30121441" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC3/esptool-v4.9.dev3-win64.zip", + "archiveFileName": "esptool-v4.9.dev3-win64.zip", + "checksum": "SHA-256:890051a4fdc684ff6f4af18d0bb27d274ca940ee0eef716a9455f8c64b25b215", + "size": "36072564" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC3/esptool-v4.9.dev3-win64.zip", + "archiveFileName": "esptool-v4.9.dev3-win64.zip", + "checksum": "SHA-256:890051a4fdc684ff6f4af18d0bb27d274ca940ee0eef716a9455f8c64b25b215", + "size": "36072564" + } + ] + }, + { + "name": "esptool_py", + "version": "4.9.dev1", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC2/esptool-v4.9.dev1-linux-amd64.tar.gz", + "archiveFileName": "esptool-v4.9.dev1-linux-amd64.tar.gz", + "checksum": "SHA-256:21f6c2155f0ec9e5b475c8a4bf59803d8cfb4d74f4e488a80f97da3d77542bba", + "size": "64632960" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC2/esptool-v4.9.dev1-linux-arm32.tar.gz", + "archiveFileName": "esptool-v4.9.dev1-linux-arm32.tar.gz", + "checksum": "SHA-256:818477f10814b2bd82078fc6695663ac84220d3947722ce1880a6c867d5c2997", + "size": "46042432" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC2/esptool-v4.9.dev1-linux-arm64.tar.gz", + "archiveFileName": "esptool-v4.9.dev1-linux-arm64.tar.gz", + "checksum": "SHA-256:b377a130a4dca58f3a31c66ed0b9858cc057c998741222cccdb6e5a724651a1f", + "size": "54459357" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC2/esptool-v4.9.dev1-macos-amd64.tar.gz", + "archiveFileName": "esptool-v4.9.dev1-macos-amd64.tar.gz", + "checksum": "SHA-256:25cc246b20230afc287ffdfe95f57b3fab23cec88a6dde3b5092ec05926b5431", + "size": "32386336" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC2/esptool-v4.9.dev1-macos-arm64.tar.gz", + "archiveFileName": "esptool-v4.9.dev1-macos-arm64.tar.gz", + "checksum": "SHA-256:b845d678db1d1559d82894e68366683a7fc3809371a5f5def67c30c9dee15912", + "size": "29841092" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC2/esptool-v4.9.dev1-win64.zip", + "archiveFileName": "esptool-v4.9.dev1-win64.zip", + "checksum": "SHA-256:f649a212e086b06ca6ee595feffd7a4706696ea43a2cd1a4f49352829e8ac96e", + "size": "35812159" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC2/esptool-v4.9.dev1-win64.zip", + "archiveFileName": "esptool-v4.9.dev1-win64.zip", + "checksum": "SHA-256:f649a212e086b06ca6ee595feffd7a4706696ea43a2cd1a4f49352829e8ac96e", + "size": "35812159" + } + ] + }, + { + "name": "esptool_py", + "version": "4.8.1", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC1/esptool-v4.8.1-linux-amd64.tar.gz", + "archiveFileName": "esptool-v4.8.1-linux-amd64.tar.gz", + "checksum": "SHA-256:aaaaa25e1c64442ae93604812376783dbc50f34536221b5897456e12f01e1bfd", + "size": "64635657" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC1/esptool-v4.8.1-linux-arm64.tar.gz", + "archiveFileName": "esptool-v4.8.1-linux-arm64.tar.gz", + "checksum": "SHA-256:76170a9282bdc52fddd75e4498fd6bee55fe19088a34ab363b3aeff800d73f60", + "size": "54449306" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC1/esptool-v4.8.1-linux-arm32.tar.gz", + "archiveFileName": "esptool-v4.8.1-linux-arm32.tar.gz", + "checksum": "SHA-256:26b842e22a66b3d01e830a4784686a69cfb107d774a4093327ec6bba7bb17794", + "size": "45868720" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC1/esptool-v4.8.1-macos.tar.gz", + "archiveFileName": "esptool-v4.8.1-macos.tar.gz", + "checksum": "SHA-256:6e1fc5ea04490e849c925c48d5cee590164fcf9b9bd419a7b014c2fb48a13743", + "size": "29828542" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC1/esptool-v4.8.1-win64.zip", + "archiveFileName": "esptool-v4.8.1-win64.zip", + "checksum": "SHA-256:3e97fb990fdd721b923b478eaaa046967c7919dbc9cbd04c445307571177918a", + "size": "33612728" + } + ] + }, + { + "name": "esptool_py", + "version": "4.6", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.9/esptool-v4.6-src.tar.gz", + "archiveFileName": "esptool-v4.6-src.tar.gz", + "checksum": "SHA-256:22f9bad0cd1cea14e554ac1f4a6d8f67415ff7029a66ce9130756276e7264e5a", + "size": "99141" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.9/esptool-v4.6-src.tar.gz", + "archiveFileName": "esptool-v4.6-src.tar.gz", + "checksum": "SHA-256:22f9bad0cd1cea14e554ac1f4a6d8f67415ff7029a66ce9130756276e7264e5a", + "size": "99141" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.9/esptool-v4.6-src.tar.gz", + "archiveFileName": "esptool-v4.6-src.tar.gz", + "checksum": "SHA-256:22f9bad0cd1cea14e554ac1f4a6d8f67415ff7029a66ce9130756276e7264e5a", + "size": "99141" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.9/esptool-v4.6-src.tar.gz", + "archiveFileName": "esptool-v4.6-src.tar.gz", + "checksum": "SHA-256:22f9bad0cd1cea14e554ac1f4a6d8f67415ff7029a66ce9130756276e7264e5a", + "size": "99141" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.9/esptool-v4.6-macos.tar.gz", + "archiveFileName": "esptool-v4.6-macos.tar.gz", + "checksum": "SHA-256:885ec69fcffdcb9e7c6eacd2589f13a45ce6bcb6742bea368ec3a73bcca6dd59", + "size": "5851297" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.9/esptool-v4.6-win64.zip", + "archiveFileName": "esptool-v4.6-win64.zip", + "checksum": "SHA-256:c7c68cd1aa520cbfce488ff6a77818ece272272eb012831b9d9ab1280a7c393f", + "size": "6638480" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.9/esptool-v4.6-win64.zip", + "archiveFileName": "esptool-v4.6-win64.zip", + "checksum": "SHA-256:c7c68cd1aa520cbfce488ff6a77818ece272272eb012831b9d9ab1280a7c393f", + "size": "6638480" + } + ] + }, + { + "name": "esptool_py", + "version": "4.5.1", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-src.tar.gz", + "archiveFileName": "esptool-v4.5.1-src.tar.gz", + "checksum": "SHA-256:aa06831a7d88d8ccde4ea21241e983a08dbdae967290e181658b0d18bffc8f86", + "size": "96922" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-src.tar.gz", + "archiveFileName": "esptool-v4.5.1-src.tar.gz", + "checksum": "SHA-256:aa06831a7d88d8ccde4ea21241e983a08dbdae967290e181658b0d18bffc8f86", + "size": "96922" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-src.tar.gz", + "archiveFileName": "esptool-v4.5.1-src.tar.gz", + "checksum": "SHA-256:aa06831a7d88d8ccde4ea21241e983a08dbdae967290e181658b0d18bffc8f86", + "size": "96922" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-src.tar.gz", + "archiveFileName": "esptool-v4.5.1-src.tar.gz", + "checksum": "SHA-256:aa06831a7d88d8ccde4ea21241e983a08dbdae967290e181658b0d18bffc8f86", + "size": "96922" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-macos.tar.gz", + "archiveFileName": "esptool-v4.5.1-macos.tar.gz", + "checksum": "SHA-256:78b52acfd51541ceb97cee893b7d4d49b8ddc284602be8c73ea47e3d849e0956", + "size": "5850888" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-win64.zip", + "archiveFileName": "esptool-v4.5.1-win64.zip", + "checksum": "SHA-256:64d0c24499d46b80d6bd7a05c98bdacc3455ab6d503cc2a99e35711310216045", + "size": "6638448" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-win64.zip", + "archiveFileName": "esptool-v4.5.1-win64.zip", + "checksum": "SHA-256:64d0c24499d46b80d6bd7a05c98bdacc3455ab6d503cc2a99e35711310216045", + "size": "6638448" + } + ] + }, + { + "name": "esptool_py", + "version": "4.5", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.6/esptool-v4.5-src.tar.gz", + "archiveFileName": "esptool-v4.5-src.tar.gz", + "checksum": "SHA-256:0f5d20c4624d913c3c994db57da3c4e5a43bd8437351d9b789f79d3f1b057292", + "size": "96621" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.6/esptool-v4.5-src.tar.gz", + "archiveFileName": "esptool-v4.5-src.tar.gz", + "checksum": "SHA-256:0f5d20c4624d913c3c994db57da3c4e5a43bd8437351d9b789f79d3f1b057292", + "size": "96621" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.6/esptool-v4.5-src.tar.gz", + "archiveFileName": "esptool-v4.5-src.tar.gz", + "checksum": "SHA-256:0f5d20c4624d913c3c994db57da3c4e5a43bd8437351d9b789f79d3f1b057292", + "size": "96621" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.6/esptool-v4.5-src.tar.gz", + "archiveFileName": "esptool-v4.5-src.tar.gz", + "checksum": "SHA-256:0f5d20c4624d913c3c994db57da3c4e5a43bd8437351d9b789f79d3f1b057292", + "size": "96621" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.6/esptool-v4.5-macos.tar.gz", + "archiveFileName": "esptool-v4.5-macos.tar.gz", + "checksum": "SHA-256:adcce051f282a19f78da30717ff0e4334b0edaf16a7f14d185ba4cae464586e2", + "size": "5850835" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.6/esptool-v4.5-win64.zip", + "archiveFileName": "esptool-v4.5-win64.zip", + "checksum": "SHA-256:a55c5f7d490fbd2cd5fdf486d71f2ed13e3304482d54374b6aa23d42c9b98a96", + "size": "6639416" + } + ] + }, + { + "name": "esptool_py", + "version": "4.2.1", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-windows.zip", + "archiveFileName": "esptool-4.2.1-windows.zip", + "checksum": "SHA-256:582560067bfbd9895f4862eb5fdf87558ddee5d4d30e7575c9b8bcb0dd60fd94", + "size": "6368279" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-windows.zip", + "archiveFileName": "esptool-4.2.1-windows.zip", + "checksum": "SHA-256:582560067bfbd9895f4862eb5fdf87558ddee5d4d30e7575c9b8bcb0dd60fd94", + "size": "6368279" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-macos.tar.gz", + "archiveFileName": "esptool-4.2.1-macos.tar.gz", + "checksum": "SHA-256:a984f7ad8bdb40c42d0d368bf4bb21b69a9587aed46b7b6d7de23ca58a3f150d", + "size": "5816598" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-linux.tar.gz", + "archiveFileName": "esptool-4.2.1-linux.tar.gz", + "checksum": "SHA-256:5a45fb77eb6574554ec2f45230d0b350f26f9c24ab3b6c13c4031ebdf72a34ab", + "size": "90123" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-linux.tar.gz", + "archiveFileName": "esptool-4.2.1-linux.tar.gz", + "checksum": "SHA-256:5a45fb77eb6574554ec2f45230d0b350f26f9c24ab3b6c13c4031ebdf72a34ab", + "size": "90123" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-linux.tar.gz", + "archiveFileName": "esptool-4.2.1-linux.tar.gz", + "checksum": "SHA-256:5a45fb77eb6574554ec2f45230d0b350f26f9c24ab3b6c13c4031ebdf72a34ab", + "size": "90123" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-linux.tar.gz", + "archiveFileName": "esptool-4.2.1-linux.tar.gz", + "checksum": "SHA-256:5a45fb77eb6574554ec2f45230d0b350f26f9c24ab3b6c13c4031ebdf72a34ab", + "size": "90123" + } + ] + }, + { + "name": "esptool_py", + "version": "3.3.0", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-windows.zip", + "archiveFileName": "esptool-3.3-windows.zip", + "checksum": "SHA-256:55a1d7165414bf4dbd2bb16ca094e555d671958450f5d1536b457a518d2b15df", + "size": "7436864" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-windows.zip", + "archiveFileName": "esptool-3.3-windows.zip", + "checksum": "SHA-256:55a1d7165414bf4dbd2bb16ca094e555d671958450f5d1536b457a518d2b15df", + "size": "7436864" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-macos.tar.gz", + "archiveFileName": "esptool-3.3-macos.tar.gz", + "checksum": "SHA-256:3e5f7b521ae33c8c63f3b48efc909c08f37bef1a083c0eafa408312c09900afd", + "size": "6944975" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-linux.tar.gz", + "archiveFileName": "esptool-3.3-linux.tar.gz", + "checksum": "SHA-256:fbe91a49e5f5deca4881f5eed32e8903faf97bfd365fe2d0d1512b80bdb67f5e", + "size": "97026" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-linux.tar.gz", + "archiveFileName": "esptool-3.3-linux.tar.gz", + "checksum": "SHA-256:fbe91a49e5f5deca4881f5eed32e8903faf97bfd365fe2d0d1512b80bdb67f5e", + "size": "97026" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-linux.tar.gz", + "archiveFileName": "esptool-3.3-linux.tar.gz", + "checksum": "SHA-256:fbe91a49e5f5deca4881f5eed32e8903faf97bfd365fe2d0d1512b80bdb67f5e", + "size": "97026" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-linux.tar.gz", + "archiveFileName": "esptool-3.3-linux.tar.gz", + "checksum": "SHA-256:fbe91a49e5f5deca4881f5eed32e8903faf97bfd365fe2d0d1512b80bdb67f5e", + "size": "97026" + } + ] + }, + { + "name": "esptool_py", + "version": "3.1.0", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.0-alpha1/esptool-3.1.0-windows.zip", + "archiveFileName": "esptool-3.1.0-windows.zip", + "checksum": "SHA-256:c9b4f9bc6e94db136c2545c87c00c7ab1441644ca0bac50811bc3c014e22514b", + "size": "7411889" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.0-alpha1/esptool-3.1.0-macos.tar.gz", + "archiveFileName": "esptool-3.1.0-macos.tar.gz", + "checksum": "SHA-256:1dffcb884665fb616779aea62a68f517aac251ea6dfe95560906c364d6ef3065", + "size": "6776909" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.0-alpha1/esptool-3.1.0-linux.tar.gz", + "archiveFileName": "esptool-3.1.0-linux.tar.gz", + "checksum": "SHA-256:15eca9896a30e804aa24be6f7a06e39397541b8b09a7a4c48deb65f826e7baad", + "size": "80550" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.0-alpha1/esptool-3.1.0-linux.tar.gz", + "archiveFileName": "esptool-3.1.0-linux.tar.gz", + "checksum": "SHA-256:15eca9896a30e804aa24be6f7a06e39397541b8b09a7a4c48deb65f826e7baad", + "size": "80550" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.0-alpha1/esptool-3.1.0-linux.tar.gz", + "archiveFileName": "esptool-3.1.0-linux.tar.gz", + "checksum": "SHA-256:15eca9896a30e804aa24be6f7a06e39397541b8b09a7a4c48deb65f826e7baad", + "size": "80550" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.0-alpha1/esptool-3.1.0-linux.tar.gz", + "archiveFileName": "esptool-3.1.0-linux.tar.gz", + "checksum": "SHA-256:15eca9896a30e804aa24be6f7a06e39397541b8b09a7a4c48deb65f826e7baad", + "size": "80550" + } + ] + }, + { + "name": "esptool_py", + "version": "3.0.0", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5-rc5/esptool-3.0.0.2-windows.zip", + "archiveFileName": "esptool-3.0.0.2-windows.zip", + "checksum": "SHA-256:b192bfc1545a3c92658ce586b4edcc2aca3f0ad4b3fa8417d658bc8a48f1387e", + "size": "3434736" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5-rc5/esptool-3.0.0.2-macos.tar.gz", + "archiveFileName": "esptool-3.0.0.2-macos.tar.gz", + "checksum": "SHA-256:2cafab7f1ebce89475b84c115548eaace40b6366d7b3f9862cdb2fc64f806643", + "size": "3859642" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5-rc5/esptool-3.0.0.2-linux.tar.gz", + "archiveFileName": "esptool-3.0.0.2-linux.tar.gz", + "checksum": "SHA-256:d5cb51da1c74ff69f81b820470d2ecccb5c7c3a2dec7776483d4c89588b00020", + "size": "57526" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5-rc5/esptool-3.0.0.2-linux.tar.gz", + "archiveFileName": "esptool-3.0.0.2-linux.tar.gz", + "checksum": "SHA-256:d5cb51da1c74ff69f81b820470d2ecccb5c7c3a2dec7776483d4c89588b00020", + "size": "57526" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5-rc5/esptool-3.0.0.2-linux.tar.gz", + "archiveFileName": "esptool-3.0.0.2-linux.tar.gz", + "checksum": "SHA-256:d5cb51da1c74ff69f81b820470d2ecccb5c7c3a2dec7776483d4c89588b00020", + "size": "57526" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5-rc5/esptool-3.0.0.2-linux.tar.gz", + "archiveFileName": "esptool-3.0.0.2-linux.tar.gz", + "checksum": "SHA-256:d5cb51da1c74ff69f81b820470d2ecccb5c7c3a2dec7776483d4c89588b00020", + "size": "57526" + } + ] + }, + { + "version": "2.6.1", + "name": "esptool_py", + "systems": [ + { + "url": "https://dl.espressif.com/dl/esptool-2.6.1-windows.zip", + "checksum": "SHA-256:84cf0b369a7707fe566434faba148852fc464992111d5baa95b658b374802f96", + "host": "i686-mingw32", + "archiveFileName": "esptool-2.6.1-windows.zip", + "size": "3422445" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.6.1-macos.tar.gz", + "checksum": "SHA-256:f4eb758a301d6902cc9dfcd49d36345d2f075ad123da7cf8132d15cfb7533457", + "host": "x86_64-apple-darwin", + "archiveFileName": "esptool-2.6.1-macos.tar.gz", + "size": "3837085" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.6.1-linux.tar.gz", + "checksum": "SHA-256:eaf82ff4070d9792f6a42ae1e485375de5a87bec59ef01dfb95de901519ec7fb", + "host": "x86_64-pc-linux-gnu", + "archiveFileName": "esptool-2.6.1-linux.tar.gz", + "size": "44762" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.6.1-linux.tar.gz", + "checksum": "SHA-256:eaf82ff4070d9792f6a42ae1e485375de5a87bec59ef01dfb95de901519ec7fb", + "host": "i686-pc-linux-gnu", + "archiveFileName": "esptool-2.6.1-linux.tar.gz", + "size": "44762" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.6.1-linux.tar.gz", + "checksum": "SHA-256:eaf82ff4070d9792f6a42ae1e485375de5a87bec59ef01dfb95de901519ec7fb", + "host": "arm-linux-gnueabihf", + "archiveFileName": "esptool-2.6.1-linux.tar.gz", + "size": "44762" + } + ] + }, + { + "version": "2.6.0", + "name": "esptool_py", + "systems": [ + { + "url": "https://dl.espressif.com/dl/esptool-2.6.0-windows.zip", + "checksum": "SHA-256:a73f4cf68db240d7f1d250c5c7f2dfcb53c17a37483729f1bf71f8f43d79a799", + "host": "i686-mingw32", + "archiveFileName": "esptool-2.6.0-windows.zip", + "size": "3421208" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.6.0-macos.tar.gz", + "checksum": "SHA-256:0a881b91547c840fab8c72ae3d031069384278b8c2e5241647e8c8292c5e4a4b", + "host": "x86_64-apple-darwin", + "archiveFileName": "esptool-2.6.0-macos.tar.gz", + "size": "3835660" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.6.0-linux.tar.gz", + "checksum": "SHA-256:6d162f70f395ca31f5008829dd7e833e729f044a9c7355d5be8ce333a054e110", + "host": "x86_64-pc-linux-gnu", + "archiveFileName": "esptool-2.6.0-linux.tar.gz", + "size": "43535" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.6.0-linux.tar.gz", + "checksum": "SHA-256:6d162f70f395ca31f5008829dd7e833e729f044a9c7355d5be8ce333a054e110", + "host": "i686-pc-linux-gnu", + "archiveFileName": "esptool-2.6.0-linux.tar.gz", + "size": "43535" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.6.0-linux.tar.gz", + "checksum": "SHA-256:6d162f70f395ca31f5008829dd7e833e729f044a9c7355d5be8ce333a054e110", + "host": "arm-linux-gnueabihf", + "archiveFileName": "esptool-2.6.0-linux.tar.gz", + "size": "43535" + } + ] + }, + { + "version": "3.0.0-gnu12-dc7f933", + "name": "mklittlefs", + "systems": [ + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu12/aarch64-linux-gnu.mklittlefs-c41e51a.200706.tar.gz", + "archiveFileName": "aarch64-linux-gnu.mklittlefs-c41e51a.200706.tar.gz", + "checksum": "SHA-256:fc56e389383749e4cf4fab0fcf75cc0ebc41e59383caf6c2eff1c3d9794af200", + "size": "44651" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu12/arm-linux-gnueabihf.mklittlefs-c41e51a.200706.tar.gz", + "archiveFileName": "arm-linux-gnueabihf.mklittlefs-c41e51a.200706.tar.gz", + "checksum": "SHA-256:52b642dd0545eb3bd8dfb75dde6601df21700e4867763fd2696274be279294c5", + "size": "37211" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu12/i686-linux-gnu.mklittlefs-c41e51a.200706.tar.gz", + "archiveFileName": "i686-linux-gnu.mklittlefs-c41e51a.200706.tar.gz", + "checksum": "SHA-256:7886051d8ccc54aed0af2e7cdf6ff992bb51638df86f3b545955697720b6d062", + "size": "48033" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu12/i686-w64-mingw32.mklittlefs-c41e51a.200706.zip", + "archiveFileName": "i686-w64-mingw32.mklittlefs-c41e51a.200706.zip", + "checksum": "SHA-256:43740db30ce451454f2337331f10ab4ed41bd83dbf0fa0cb4387107388b59f42", + "size": "332655" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu12/x86_64-apple-darwin14.mklittlefs-c41e51a.200706.tar.gz", + "archiveFileName": "x86_64-apple-darwin14.mklittlefs-c41e51a.200706.tar.gz", + "checksum": "SHA-256:e3edd5e05b70db3c7df6b9d626558348ad04804022fe955c799aeb51808c7dc3", + "size": "362608" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu12/x86_64-linux-gnu.mklittlefs-c41e51a.200706.tar.gz", + "archiveFileName": "x86_64-linux-gnu.mklittlefs-c41e51a.200706.tar.gz", + "checksum": "SHA-256:66e84dda0aad747517da3785125e05738a540948aab2b7eaa02855167a1eea53", + "size": "46778" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu12/x86_64-w64-mingw32.mklittlefs-c41e51a.200706.zip", + "archiveFileName": "x86_64-w64-mingw32.mklittlefs-c41e51a.200706.zip", + "checksum": "SHA-256:2e319077491f8e832e96eb4f2f7a70dd919333cee4b388c394e0e848d031d542", + "size": "345132" + } + ] + }, + { + "name": "mkspiffs", + "version": "0.2.3", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-win32.zip", + "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-win32.zip", + "checksum": "SHA-256:b647f2c2efe6949819c85ea9404271b55c7c9c25bcb98d3b98a1d0ba771adf56", + "size": "249809" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-osx.tar.gz", + "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-osx.tar.gz", + "checksum": "SHA-256:9f43fc74a858cf564966b5035322c3e5e61c31a647c5a1d71b388ed6efc48423", + "size": "130270" + }, + { + "host": "i386-apple-darwin", + "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-osx.tar.gz", + "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-osx.tar.gz", + "checksum": "SHA-256:9f43fc74a858cf564966b5035322c3e5e61c31a647c5a1d71b388ed6efc48423", + "size": "130270" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-linux64.tar.gz", + "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-linux64.tar.gz", + "checksum": "SHA-256:5e1a4ff41385e842f389f6b5254102a547e566a06b49babeffa93ef37115cb5d", + "size": "50646" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-linux32.tar.gz", + "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-linux32.tar.gz", + "checksum": "SHA-256:464463a93e8833209cdc29ba65e1a12fec31718dc10075c195a2445b2c3f6cb0", + "size": "48751" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-linux-armhf.tar.gz", + "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-linux-armhf.tar.gz", + "checksum": "SHA-256:ade3dc00117912ac08a1bdbfbfe76b12d21a34bc5fa1de0cfc45fe7a8d0a0185", + "size": "40665" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-linux-armhf.tar.gz", + "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-linux-armhf.tar.gz", + "checksum": "SHA-256:ade3dc00117912ac08a1bdbfbfe76b12d21a34bc5fa1de0cfc45fe7a8d0a0185", + "size": "40665" + } + ] + }, + { + "name": "esp-xs2", + "version": "2302", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:2ff838520a5003d2768b275f5bb5ead69dd2388c3b7cd9043cb59891ba43147f", + "size": "112199211" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:6d79d5b14fc7129a9b8208d54e19b05dedb565f50f7a96264c9df84b06ad3be0", + "size": "106953064" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:e5bd03b6ad19179b015a93ada9992adc3610036ebf6aeb0835a09c9aadb50a14", + "size": "106026829" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "checksum": "SHA-256:fb45943557b2d201bbb1bdc7514a1872f9bb96c2dfb48b95abdba281cc792f75", + "size": "115288662" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:e965236cb80e45282d16f40184af183e013b63b177bd1884736c463eac636564", + "size": "119711811" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:78a55eec18650b21378d97494989ffe208748e0f49bb2b2d6756b264e1863919", + "size": "106540817" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "checksum": "SHA-256:1e6dac5162ab75f94b88c47ebeabb6600c652fb4f615ed07c1724d037c02fd19", + "size": "131273859" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:8a785cc4e0838cebe404f82c0ead7a0f9ac5fabc660a742e33a41ddac6326cc1", + "size": "135373049" + } + ] + }, + { + "name": "esp-xs3", + "version": "2302", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:61495ffe575e00c6998ae7274ff917658c04bded62ece0937c7042d6dcbf46de", + "size": "111971129" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:9008d395be46fcfe68c7de6edc850fc1595f28323a28e7922e5c085bd310cb90", + "size": "106616800" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:568857bdac7dea389dffc7fbc6871b4af299150a8ecf1bf965f224d2a1655edb", + "size": "105700326" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "checksum": "SHA-256:d122738bcc6c2f52d05fa89b2fb1afe6a7894cda8a07a1879aca867a31507ed0", + "size": "115098400" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:7defcddb98788b0991416ad2e0cb6a3b248b8030f22d5d76b8832117cc1494ca", + "size": "119883189" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:b59e076f8e4b9ca99535d449f9fc4cbb443188051dce4ad934e38f16b095f8d9", + "size": "106464677" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "checksum": "SHA-256:3ddf51774817e815e5d41c312a90c1159226978fb45fd0d4f7085c567f8b73ab", + "size": "131134034" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:1d15ca65e3508388a86d8bed3048c46d07538f5bc88d3e4296f9c03152087cd1", + "size": "135381926" + } + ] + }, + { + "name": "xtensa-esp32-elf-gcc", + "version": "esp-12.2.0_20230208", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:e8d35938385447cf9c34735fee2a3b2b61cca6be07db77a45856a1c2a347e423", + "size": "111766903" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:569988acfc2673369f222037c64bac96990cee08cebeebc4f8860e0d984f8bd9", + "size": "106473247" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:6a844f16021e936cc9b87b203978356f57ab2144554f6f2a0f73ffa3d3d316c5", + "size": "105576049" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "checksum": "SHA-256:743d6f03a89329bb09f9550d27fcab677f5cf06b4720793bbcef7883a932681d", + "size": "114870843" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:4d32d764e984f3a570aacfb2f4957619540fb4629534d969b2e83997901334c3", + "size": "119424029" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:dc8fa7f4933bf5cb08e83bacce6160cc9dfe93d7aad1e8f92599bb81ff5b2e28", + "size": "106136827" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "checksum": "SHA-256:62bb6428d107ed3f44c212c77ecf24804b74c97327b0f0ad2029c656c6dbd6ee", + "size": "130847086" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:8febfe4a6476efc69012390106c8c660a14418f025137b0513670c72124339cf", + "size": "134985117" + } + ] + }, + { + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "checksum": "SHA-256:8ef14e0409c2011b41e504a30f70d3e35287313a795d1f2462ad2cd0e2052d37", + "size": "94397702" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "checksum": "SHA-256:e7d217ac2ef52c746a41f8647840b2717edcd8afc15f081bc1c4505e10a189b7", + "size": "90684219" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "checksum": "SHA-256:ea6631f8a5105ae90d7fc462c10ed4f9049924ea8c2f9391d90b339d5f881dac", + "size": "89954866" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "checksum": "SHA-256:ecb90af9cede0982672234da0b1bd7b7f76eadde60aa5c82eefdf37d64ffe49f", + "size": "96354023" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "checksum": "SHA-256:19af109fda024a3a4c989f7ccaa104f9b1b74cfd6c9363e730bb8cb9b50d5dc4", + "size": "101712946" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-macos-arm64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-macos-arm64.tar.gz", + "checksum": "SHA-256:b14189772d70a96813895fff7731d0f2fec0c825cfc02e002d6d91a0cc4b6b1d", + "size": "93104016" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "checksum": "SHA-256:9851c2cfa355e1fad8abfb643a1c945d27385b1851f3ae468915ea78fcbec940", + "size": "118610020" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "checksum": "SHA-256:a328b3c55631846241bbe7999a309b20b797c8dc50b6e8dccf463e66a2da5fb4", + "size": "121846722" + } + ] + }, + { + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch5", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "checksum": "SHA-256:8ef14e0409c2011b41e504a30f70d3e35287313a795d1f2462ad2cd0e2052d37", + "size": "94397702" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "checksum": "SHA-256:e7d217ac2ef52c746a41f8647840b2717edcd8afc15f081bc1c4505e10a189b7", + "size": "90684219" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "checksum": "SHA-256:ea6631f8a5105ae90d7fc462c10ed4f9049924ea8c2f9391d90b339d5f881dac", + "size": "89954866" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "checksum": "SHA-256:ecb90af9cede0982672234da0b1bd7b7f76eadde60aa5c82eefdf37d64ffe49f", + "size": "96354023" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "checksum": "SHA-256:19af109fda024a3a4c989f7ccaa104f9b1b74cfd6c9363e730bb8cb9b50d5dc4", + "size": "101712946" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "checksum": "SHA-256:9851c2cfa355e1fad8abfb643a1c945d27385b1851f3ae468915ea78fcbec940", + "size": "118610020" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "checksum": "SHA-256:a328b3c55631846241bbe7999a309b20b797c8dc50b6e8dccf463e66a2da5fb4", + "size": "121846722" + } + ] + }, + { + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz", + "checksum": "SHA-256:9edd1e77627688f435561922d14299f6a0021ba1f6ff67e472e1108695a69e53", + "size": "90569312" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-linux-arm64.tar.gz", + "checksum": "SHA-256:3a21a3e310e6b1e7d7bed1f3e59698a5bd29ed3a5ca79fba9265d7dd2f1e0cd2", + "size": "86838362" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-linux-armel.tar.gz", + "checksum": "SHA-256:89313c4c1d8db1b01624f31b58bf3fbe527160569828ac4301e9daa75c52716d", + "size": "86187540" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-linux-i686.tar.gz", + "checksum": "SHA-256:a1f165a836f175daa6fbfde4ca99cb93b377f021fbfc41f79a700bd4df965a9a", + "size": "92580267" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz", + "checksum": "SHA-256:dda3d7a43efd995d9a51d5a5741626dbf915df46078aef0b5aea7163ac82398b", + "size": "97807647" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-win32.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-win32.zip", + "checksum": "SHA-256:fd147592928ef2d7092ba34b01ecd776fe26ba3d7e3f9b6b215a3b46e981ee2c", + "size": "116464819" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-win64.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-win64.zip", + "checksum": "SHA-256:9395315c07de0b9f05c9a6616ba1f05e76ab651053f2f40479163a8e03cfa830", + "size": "119511910" + } + ] + }, + { + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz", + "checksum": "SHA-256:3eb3d68b27fa6ba5af6f88da21cb8face9be0094daaa8960793cfe570ab785ff", + "size": "90565318" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-arm64.tar.gz", + "checksum": "SHA-256:aa534be24e45e06b7080a6a3bb8cd9e3cfb818f5f8bce2244d7cfb5e91336541", + "size": "86860292" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-armel.tar.gz", + "checksum": "SHA-256:f0e49ce06fe7833ff5d76961dc2dac5449d320f823bb8c05a302cf85a3a6eb04", + "size": "86183421" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-i686.tar.gz", + "checksum": "SHA-256:06de09b74652de43e5b22db3b7fc992623044baa75e9faaab68317a986715ba3", + "size": "92582250" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-macos.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-macos.tar.gz", + "checksum": "SHA-256:96443f69c8569417c780ee749d91ef33cffe22153fffa30a0fbf12107d87381b", + "size": "97808961" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-win32.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-win32.zip", + "checksum": "SHA-256:076a4171bdc33e5ced3952efffb233d70263dfa760e636704050597a9edf61db", + "size": "112578260" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-win64.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-win64.zip", + "checksum": "SHA-256:c35b7998f7f503e0cb22055d1e279ae14b6b0e09bb3ff3846b17d552ece9c247", + "size": "115278695" + } + ] + }, + { + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r1", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz", + "checksum": "SHA-256:44a0b467b9d2b759ab48b2f27aed684581f33c96e2842992781c4e045992c5b0", + "size": "86361217" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz", + "checksum": "SHA-256:fdacdb2a7bbf6293bcafda9b52463a4da8a2f3b7e1df9f83d35ff9d1efa22012", + "size": "84520407" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz", + "checksum": "SHA-256:e2024096492dfaa50fc6ac336cd8faa2e395e8cebb617753eab0b5f16d3dd0dc", + "size": "88375391" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-macos.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r1-macos.tar.gz", + "checksum": "SHA-256:7bbc6a2b94f009cd8a3351b9c7acf7a5caa1c4d3700500ead60f84965386a61b", + "size": "93357296" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-win32.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r1-win32.zip", + "checksum": "SHA-256:e4f9fdda192abfc9807e3e7fcd6e9fea30c1a0cf3f3c5a5c961b5114fc8c9b7e", + "size": "105603626" + } + ] + }, + { + "name": "xtensa-esp32-elf-gcc", + "version": "1.22.0-97-gc752ad5-5.2.0", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5-rc5/xtensa-esp32-elf-win32-1.22.0-97-gc752ad5-5.2.0.zip", + "archiveFileName": "xtensa-esp32-elf-win32-1.22.0-97-gc752ad5-5.2.0.zip", + "checksum": "SHA-256:80571e5d5a63494f4fa758bb9d8fb882ba4059853a8c412a84d232dc1c1400e6", + "size": "125747216" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5-rc5/xtensa-esp32-elf-macos-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "archiveFileName": "xtensa-esp32-elf-macos-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "checksum": "SHA-256:b1ce39a563ae359cf363fb7d8ee80cb1e5226fda83188203cff60f16f55e33ef", + "size": "50525386" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5-rc5/xtensa-esp32-elf-linux64-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "archiveFileName": "xtensa-esp32-elf-linux64-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "checksum": "SHA-256:96f5f6e7611a0ed1dc47048c54c3113fc5cebffbf0ba90d8bfcd497afc7ef9f3", + "size": "44225380" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5-rc5/xtensa-esp32-elf-linux32-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "archiveFileName": "xtensa-esp32-elf-linux32-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "checksum": "SHA-256:8094a2c30b474e99ce64dd0ba8f310c4614eb3b3cac884a3aea0fd5f565af119", + "size": "45575521" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5-rc5/xtensa-esp32-elf-linux-armel-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "archiveFileName": "xtensa-esp32-elf-linux-armel-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "checksum": "SHA-256:d70d550f88448fa476b29fa50ef5502ab497a16ac7fa9ca24c6d0a39bb1e681e", + "size": "50657803" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5-rc5/xtensa-esp32-elf-linux-armel-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "archiveFileName": "xtensa-esp32-elf-linux-armel-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "checksum": "SHA-256:d70d550f88448fa476b29fa50ef5502ab497a16ac7fa9ca24c6d0a39bb1e681e", + "size": "50657803" + } + ] + }, + { + "version": "1.22.0-80-g6c4433a-5.2.0", + "name": "xtensa-esp32-elf-gcc", + "systems": [ + { + "url": "https://dl.espressif.com/dl/xtensa-esp32-elf-win32-1.22.0-80-g6c4433a-5.2.0.zip", + "checksum": "SHA-256:f217fccbeaaa8c92db239036e0d6202458de4488b954a3a38f35ac2ec48058a4", + "host": "i686-mingw32", + "archiveFileName": "xtensa-esp32-elf-win32-1.22.0-80-g6c4433a-5.2.0.zip", + "size": "125719261" + }, + { + "url": "https://dl.espressif.com/dl/xtensa-esp32-elf-osx-1.22.0-80-g6c4433a-5.2.0.tar.gz", + "checksum": "SHA-256:a4307a97945d2f2f2745f415fbe80d727750e19f91f9a1e7e2f8a6065652f9da", + "host": "x86_64-apple-darwin", + "archiveFileName": "xtensa-esp32-elf-osx-1.22.0-80-g6c4433a-5.2.0.tar.gz", + "size": "46517409" + }, + { + "url": "https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz", + "checksum": "SHA-256:3fe96c151d46c1d4e5edc6ed690851b8e53634041114bad04729bc16b0445156", + "host": "x86_64-pc-linux-gnu", + "archiveFileName": "xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz", + "size": "44219107" + }, + { + "url": "https://dl.espressif.com/dl/xtensa-esp32-elf-linux32-1.22.0-80-g6c4433a-5.2.0.tar.gz", + "checksum": "SHA-256:b4055695ffc2dfc0bcb6dafdc2572a6e01151c4179ef5fa972b3fcb2183eb155", + "host": "i686-pc-linux-gnu", + "archiveFileName": "xtensa-esp32-elf-linux32-1.22.0-80-g6c4433a-5.2.0.tar.gz", + "size": "45566336" + }, + { + "url": "https://dl.espressif.com/dl/xtensa-esp32-elf-linux-armel-1.22.0-87-gb57bad3-5.2.0.tar.gz", + "checksum": "SHA-256:9c68c87bb23b1256dc0a1859b515946763e5292dcab4a4159a52fae5618ce861", + "host": "arm-linux-gnueabihf", + "archiveFileName": "xtensa-esp32-elf-linux-armel-1.22.0-87-gb57bad3-5.2.0.tar.gz", + "size": "50655584" + } + ] + }, + { + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-12.2.0_20230208", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:2ff838520a5003d2768b275f5bb5ead69dd2388c3b7cd9043cb59891ba43147f", + "size": "112199211" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:6d79d5b14fc7129a9b8208d54e19b05dedb565f50f7a96264c9df84b06ad3be0", + "size": "106953064" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:e5bd03b6ad19179b015a93ada9992adc3610036ebf6aeb0835a09c9aadb50a14", + "size": "106026829" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "checksum": "SHA-256:fb45943557b2d201bbb1bdc7514a1872f9bb96c2dfb48b95abdba281cc792f75", + "size": "115288662" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:e965236cb80e45282d16f40184af183e013b63b177bd1884736c463eac636564", + "size": "119711811" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:78a55eec18650b21378d97494989ffe208748e0f49bb2b2d6756b264e1863919", + "size": "106540817" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "checksum": "SHA-256:1e6dac5162ab75f94b88c47ebeabb6600c652fb4f615ed07c1724d037c02fd19", + "size": "131273859" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:8a785cc4e0838cebe404f82c0ead7a0f9ac5fabc660a742e33a41ddac6326cc1", + "size": "135373049" + } + ] + }, + { + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "checksum": "SHA-256:19c77bd91fefab7c8c40a6334f9b985e2d9a1c7fac6d424b692110930dd3682f", + "size": "67849099" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "checksum": "SHA-256:bdcd24676ef2a65b670ca9e0a01768ece47f4dfcfb545a3307f76a054c33b522", + "size": "64154532" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "checksum": "SHA-256:b26723b6ce1c35b90f204eb39e5ab06a6f80fb7895f000e16b6962e4c176ae32", + "size": "63448105" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "checksum": "SHA-256:da3b5c45e4997d14269df1814c92dd7004902bb810608341bc3819c3e506fa0b", + "size": "69656104" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "checksum": "SHA-256:8eb63745b44083edef7cc6fdf3b06999f576b75134bc5e8b0ef881ca439b72d7", + "size": "75154138" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-macos-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-macos-arm64.tar.gz", + "checksum": "SHA-256:4cd38d6ec31076c0aa083f62ab84ab5c33aa07fafd0af61366186e5f553aa008", + "size": "66457613" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "checksum": "SHA-256:c758062295804b082fbd77fcd59a356f62d4e76372aaa29589cc871603309cba", + "size": "82338511" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "checksum": "SHA-256:1c1e168ff8bc460a9719f3b216d3c1125d29040389786d738244838499362c74", + "size": "85579252" + } + ] + }, + { + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch5", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "checksum": "SHA-256:19c77bd91fefab7c8c40a6334f9b985e2d9a1c7fac6d424b692110930dd3682f", + "size": "67849099" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "checksum": "SHA-256:bdcd24676ef2a65b670ca9e0a01768ece47f4dfcfb545a3307f76a054c33b522", + "size": "64154532" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "checksum": "SHA-256:b26723b6ce1c35b90f204eb39e5ab06a6f80fb7895f000e16b6962e4c176ae32", + "size": "63448105" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "checksum": "SHA-256:da3b5c45e4997d14269df1814c92dd7004902bb810608341bc3819c3e506fa0b", + "size": "69656104" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "checksum": "SHA-256:8eb63745b44083edef7cc6fdf3b06999f576b75134bc5e8b0ef881ca439b72d7", + "size": "75154138" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "checksum": "SHA-256:c758062295804b082fbd77fcd59a356f62d4e76372aaa29589cc871603309cba", + "size": "82338511" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "checksum": "SHA-256:1c1e168ff8bc460a9719f3b216d3c1125d29040389786d738244838499362c74", + "size": "85579252" + } + ] + }, + { + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz", + "checksum": "SHA-256:a32451a8edc1104b83cd9971178e61826e957d7db9ad9f81798a8969fd5a954e", + "size": "90894048" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-linux-arm64.tar.gz", + "checksum": "SHA-256:2ac2c94a533a99a091d2159c678c611c712c494b5f68d97913254712047260f9", + "size": "87178224" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-linux-armel.tar.gz", + "checksum": "SHA-256:da49afee1e2e03eaab3f492718789442d33b562800e2a892679f95b50be24d14", + "size": "86569314" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-linux-i686.tar.gz", + "checksum": "SHA-256:36d3c4990a5feb68aa8534463bc9e8ee367fe23886f78e1d726f4411c7571462", + "size": "92884013" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz", + "checksum": "SHA-256:de9af641678c93775e932ee5ec4f478f8925cfc1ebc22e41adc4fb85430a0c35", + "size": "98224709" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-win32.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-win32.zip", + "checksum": "SHA-256:ccf08afe60046f87b0e81ca17dc5073eda68ab5e7522c163dd5b583d713b7b39", + "size": "116924759" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-win64.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-win64.zip", + "checksum": "SHA-256:37c91490b8fc75e638c23785e261eaf553be2dcd106cf6cff5b76981fa02955b", + "size": "119912142" + } + ] + }, + { + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz", + "checksum": "SHA-256:a6e0947c92b823ca04f062522249f0a428357e0b056f1ff4c6bcabef83cf63a7", + "size": "90901736" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-arm64.tar.gz", + "checksum": "SHA-256:d2e5600fc194b508bd393b236a09fd62ed70afb6c36619d4b106b696a56ca66d", + "size": "87176557" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-armel.tar.gz", + "checksum": "SHA-256:3fff4199e986dd74660f17ca27d9414cb98f1b911a7f13bb3b22e784cb1156cf", + "size": "86581102" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-i686.tar.gz", + "checksum": "SHA-256:7732f9fb371d36b6b324820e300beecc33c2719921a61cf1cdb5bc625016b346", + "size": "92875986" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-macos.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-macos.tar.gz", + "checksum": "SHA-256:e6dd32782fcff8f633299b97d1c671d6b6513390aca2ddbd7543c2cc62e72d7e", + "size": "98212907" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-win32.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-win32.zip", + "checksum": "SHA-256:41b917b35f6fbe7d30b7de91c32cf348c406acfa729a1eabc450d040dc46fbe2", + "size": "113022469" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-win64.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-win64.zip", + "checksum": "SHA-256:a764c1a0ee743d69f8cbfadbe4426a2c15c0e233b0894244c7cadf3b4d7dd32a", + "size": "115696999" + } + ] + }, + { + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r1", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz", + "checksum": "SHA-256:b127baccfe6949ee7eaf3d0782ea772750a9b8e2732b16ce6bcc9dcd91f7209a", + "size": "86687290" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz", + "checksum": "SHA-256:7ca0d240f11e1c53c01a56257b0c968f876ab405142d1068d8c9b456d939554c", + "size": "84916701" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz", + "checksum": "SHA-256:9941f993ff84d1c606b45ffbeeb7bcdc5a72cf24e787bb9230390510fe3511c6", + "size": "88699953" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-macos.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-macos.tar.gz", + "checksum": "SHA-256:4b55b1a9ca7fc945be6fc3513802b6cece9264bee4cbca76013569cec2695973", + "size": "93757895" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-win32.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-win32.zip", + "checksum": "SHA-256:c94ec1e45c81b7e4944d216bab4aa41d46849768d7761fd691661dab1a3df828", + "size": "106013515" + } + ] + }, + { + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-12.2.0_20230208", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:61495ffe575e00c6998ae7274ff917658c04bded62ece0937c7042d6dcbf46de", + "size": "111971129" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:9008d395be46fcfe68c7de6edc850fc1595f28323a28e7922e5c085bd310cb90", + "size": "106616800" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:568857bdac7dea389dffc7fbc6871b4af299150a8ecf1bf965f224d2a1655edb", + "size": "105700326" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "checksum": "SHA-256:d122738bcc6c2f52d05fa89b2fb1afe6a7894cda8a07a1879aca867a31507ed0", + "size": "115098400" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:7defcddb98788b0991416ad2e0cb6a3b248b8030f22d5d76b8832117cc1494ca", + "size": "119883189" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:b59e076f8e4b9ca99535d449f9fc4cbb443188051dce4ad934e38f16b095f8d9", + "size": "106464677" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "checksum": "SHA-256:3ddf51774817e815e5d41c312a90c1159226978fb45fd0d4f7085c567f8b73ab", + "size": "131134034" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:1d15ca65e3508388a86d8bed3048c46d07538f5bc88d3e4296f9c03152087cd1", + "size": "135381926" + } + ] + }, + { + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "checksum": "SHA-256:8aa17a6adf01efa5b1628c8ac578063a44d26ae9581d39486b92223a41ef262f", + "size": "68099473" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "checksum": "SHA-256:b218c11122e5565b6442376ebd21a652abdfcbf90981afa3e177ce978710225d", + "size": "64233211" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "checksum": "SHA-256:967477434ad5483718915936a77ce915a10c5972a6b3fd02688a5c4e14182bfb", + "size": "63530586" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "checksum": "SHA-256:07671d01a63ebd389912787efb2b263677c7b351c07fe430ded733cdae95e81d", + "size": "70025439" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "checksum": "SHA-256:99b6d44cea5aebbedc8b6965e7bf551aa4a40ed83ddbe1c0e9b7cb255564ded5", + "size": "75719772" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-macos-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-macos-arm64.tar.gz", + "checksum": "SHA-256:c64b05be25d26916c65dcfe11de9e60b96d58980b2df706d3074cb70b1ef6cb9", + "size": "66791095" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "checksum": "SHA-256:658d3036ffdf11ddad6f0a784c8829f6ffd4dbd7c252d7f61722256d0ad43975", + "size": "82665716" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "checksum": "SHA-256:9000be38d44bf79c39b93a2aeb99b42e956c593ccbc02fe31cb9c71ae1bbcb22", + "size": "86022563" + } + ] + }, + { + "name": "xtensa-esp32s3-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch5", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "checksum": "SHA-256:8aa17a6adf01efa5b1628c8ac578063a44d26ae9581d39486b92223a41ef262f", + "size": "68099473" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "checksum": "SHA-256:b218c11122e5565b6442376ebd21a652abdfcbf90981afa3e177ce978710225d", + "size": "64233211" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "checksum": "SHA-256:967477434ad5483718915936a77ce915a10c5972a6b3fd02688a5c4e14182bfb", + "size": "63530586" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "checksum": "SHA-256:07671d01a63ebd389912787efb2b263677c7b351c07fe430ded733cdae95e81d", + "size": "70025439" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "checksum": "SHA-256:99b6d44cea5aebbedc8b6965e7bf551aa4a40ed83ddbe1c0e9b7cb255564ded5", + "size": "75719772" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "checksum": "SHA-256:658d3036ffdf11ddad6f0a784c8829f6ffd4dbd7c252d7f61722256d0ad43975", + "size": "82665716" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "checksum": "SHA-256:9000be38d44bf79c39b93a2aeb99b42e956c593ccbc02fe31cb9c71ae1bbcb22", + "size": "86022563" + } + ] + }, + { + "name": "xtensa-esp32s3-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz", + "checksum": "SHA-256:59b271d014ff3915b6db1b43b610a45eea15fe5d6877d12cae8a191cc996ed37", + "size": "90903617" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-linux-arm64.tar.gz", + "checksum": "SHA-256:7051b32483e61f98606d71c98e372929428a5165df791dcd5830ed9517763152", + "size": "87065204" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-linux-armel.tar.gz", + "checksum": "SHA-256:48c8dbbf96eec691a812327dc580042d9718fe989e60c2111ebfd692ac710081", + "size": "86455731" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-linux-i686.tar.gz", + "checksum": "SHA-256:552dca3f4302ab7ca88a934b0391200198c9d10a4d8ac413fe604cbf8601f950", + "size": "92906274" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz", + "checksum": "SHA-256:e5af78f05d3af07617805d06ebb45ff2fe9b6aed6970a84c35eea28a5d8d5e53", + "size": "98553473" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-win32.zip", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-win32.zip", + "checksum": "SHA-256:1b70163acccc5655449de1d149427a54f384156bd35816ec60c422d76d033f05", + "size": "116847008" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-win64.zip", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-win64.zip", + "checksum": "SHA-256:58e58575d1938879fd51e822181e54bcb343aa846eb3fca8f616c2cde7bd0041", + "size": "120066269" + } + ] + }, + { + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "checksum": "SHA-256:f7d73e5f9e2df3ea6ca8e2c95d6ca6d23d6b38fd101ea5d3012f3cb3cd59f39f", + "size": "192388486" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "checksum": "SHA-256:cf520ae3a72f65b9758ea187524b105b8b7546566d738c32e60a0df9846ef1af", + "size": "188626914" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "checksum": "SHA-256:2dc3536214caa1697f6834bb4701d05894ca55b53589fc5b54064b050ef93799", + "size": "188624050" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "checksum": "SHA-256:165d6d53e76d79f5ade7e2b7ade54b2b495ecfda0d1184d84d6343659d0e3bdb", + "size": "194606113" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "checksum": "SHA-256:d6d4cef216cbf28d6fbb88f3e127d4f42a376d9497c260bf8c1ad9cef440f839", + "size": "199411930" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-macos-arm64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-macos-arm64.tar.gz", + "checksum": "SHA-256:6e03f2ab1f145be13f8890c6de77b53f52c7bffe3d9d5824549db20298f5ba91", + "size": "191209735" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "checksum": "SHA-256:1e0cfcfbc8f82c441261cadd21742f66d716ec18c18bf10ed7c7d5b0bee6752f", + "size": "257844437" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "checksum": "SHA-256:b08f568e8fe5069dd521b87da21b8e56117e5c2c3b492f73a51966a46d3379a4", + "size": "259712666" + } + ] + }, + { + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch5", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "checksum": "SHA-256:f7d73e5f9e2df3ea6ca8e2c95d6ca6d23d6b38fd101ea5d3012f3cb3cd59f39f", + "size": "192388486" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "checksum": "SHA-256:cf520ae3a72f65b9758ea187524b105b8b7546566d738c32e60a0df9846ef1af", + "size": "188626914" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "checksum": "SHA-256:2dc3536214caa1697f6834bb4701d05894ca55b53589fc5b54064b050ef93799", + "size": "188624050" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "checksum": "SHA-256:165d6d53e76d79f5ade7e2b7ade54b2b495ecfda0d1184d84d6343659d0e3bdb", + "size": "194606113" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "checksum": "SHA-256:d6d4cef216cbf28d6fbb88f3e127d4f42a376d9497c260bf8c1ad9cef440f839", + "size": "199411930" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "checksum": "SHA-256:1e0cfcfbc8f82c441261cadd21742f66d716ec18c18bf10ed7c7d5b0bee6752f", + "size": "257844437" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "checksum": "SHA-256:b08f568e8fe5069dd521b87da21b8e56117e5c2c3b492f73a51966a46d3379a4", + "size": "259712666" + } + ] + }, + { + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz", + "checksum": "SHA-256:179cbad579790ad35e0f414a18d90017c0f158c397022411a8e9867db2174f15", + "size": "106843321" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-arm64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-arm64.tar.gz", + "checksum": "SHA-256:fb339d476c79c76db8f903b265cab6bb6950d5ed954dec644445252d3378023c", + "size": "103277393" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-armel.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-armel.tar.gz", + "checksum": "SHA-256:51a6296d8334b7452dba44b2b62e87afd7fd1c74bafa1aa29b1f4ab72cb9e5e0", + "size": "103062256" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-i686.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-i686.tar.gz", + "checksum": "SHA-256:fef60f7ef37ffaa50416d8f244cdbd710d6729dae41ef06c4ec0e50a1f3b7dd7", + "size": "109460025" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz", + "checksum": "SHA-256:4aacc1742a76349d790b1ac8e9e9d963daefda5346dbd6741cfe8e7a35a44e4e", + "size": "113703959" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-win32.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-win32.zip", + "checksum": "SHA-256:eb2a442d7f551ebeb842995ec372ec4b364314ca2d7aae779399a74972f7d6bc", + "size": "144711970" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-win64.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-win64.zip", + "checksum": "SHA-256:f5607e5187317d521f0474cade83f8eb590f2d165d95c3779b6ce11fbac21d1f", + "size": "146606480" + } + ] + }, + { + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz", + "checksum": "SHA-256:812d735063da9d063b374b59f55832a96c41fbd27ddaef19000a75de8607ba21", + "size": "106837189" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-arm64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-arm64.tar.gz", + "checksum": "SHA-256:712f1fbc3e08304a6f32aa18b346b16bbcb413b507b3d4c7c3211bf0d7dc4813", + "size": "103273444" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-armel.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-armel.tar.gz", + "checksum": "SHA-256:80a3342cda2cd4b6b75ebb2b36d5d12fce7d375cfadadcff01ec3a907f0a16a2", + "size": "103058744" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-i686.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-i686.tar.gz", + "checksum": "SHA-256:7f0162a81558ab0ed09d6c5d356def25b5cb3d5c2d61358f20152fa260ccc8ae", + "size": "109447789" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-macos.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-macos.tar.gz", + "checksum": "SHA-256:3ff7e5427907cf8e271c1f959b70fb01e39625c3caf61a6567e7b38aa0c11578", + "size": "113672945" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-win32.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-win32.zip", + "checksum": "SHA-256:c8ff08883c1456c278fad85e1c43b7c6e251d525683214168655550e85c5b82e", + "size": "140809778" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-win64.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-win64.zip", + "checksum": "SHA-256:6c04cb4728db928ec6473e63146b695b6dec686a0d40dd73dd3353f05247b19e", + "size": "142365782" + } + ] + }, + { + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r1", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz", + "checksum": "SHA-256:3459618f33bbd5f54d7d7783e807cb6eef6472a220f2f1eb3faced735b9d13bb", + "size": "152812483" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz", + "checksum": "SHA-256:24b9e54b348bbd5fb816fc4c52abb47337c702beecdbba840750b7cfb9d38069", + "size": "151726623" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz", + "checksum": "SHA-256:954d340ebffef12a2ce9be1ea004e6f45a8863f1e6f41f46fd3f04f58499627c", + "size": "155430963" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-macos.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r1-macos.tar.gz", + "checksum": "SHA-256:612fb3a3f84f703222327bd16581df8f80fda8cdf137637fe5d611587d1b664e", + "size": "159836199" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-win32.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r1-win32.zip", + "checksum": "SHA-256:5711eb407ffe44adddbd1281b6b575a5645e7193ca78faefa27dc5bc5b662bec", + "size": "191266312" + } + ] + }, + { + "version": "2.3.1", + "name": "esptool", + "systems": [ + { + "url": "https://dl.espressif.com/dl/esptool-2.3.1-windows.zip", + "checksum": "SHA-256:c187763d0faac7da7c30a292a23c759bbc256fcd084dc8846ed284000cb0fe29", + "host": "i686-mingw32", + "archiveFileName": "esptool-2.3.1-windows.zip", + "size": "3396085" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.3.1-macos.tar.gz", + "checksum": "SHA-256:cd922418f02e0ca11dc066b36a22646a1b441da00d762b4464ca598c902c5ecb", + "host": "x86_64-apple-darwin", + "archiveFileName": "esptool-2.3.1-macos.tar.gz", + "size": "3810932" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.3.1-linux.tar.gz", + "checksum": "SHA-256:cff30841dad80ed5d7d2d58a31843b63afa57528979a9c839806568167691d8e", + "host": "x86_64-pc-linux-gnu", + "archiveFileName": "esptool-2.3.1-linux.tar.gz", + "size": "39563" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.3.1-linux.tar.gz", + "checksum": "SHA-256:cff30841dad80ed5d7d2d58a31843b63afa57528979a9c839806568167691d8e", + "host": "i686-pc-linux-gnu", + "archiveFileName": "esptool-2.3.1-linux.tar.gz", + "size": "39563" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.3.1-linux.tar.gz", + "checksum": "SHA-256:cff30841dad80ed5d7d2d58a31843b63afa57528979a9c839806568167691d8e", + "host": "arm-linux-gnueabihf", + "archiveFileName": "esptool-2.3.1-linux.tar.gz", + "size": "39563" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/package_esp32_index.json b/package_esp32_index.json new file mode 100644 index 00000000000..5ff8cbe1d01 --- /dev/null +++ b/package_esp32_index.json @@ -0,0 +1,6578 @@ +{ + "packages": [ + { + "name": "esp32", + "maintainer": "Espressif Systems", + "websiteURL": "https://github.com/espressif/arduino-esp32", + "email": "hristo@espressif.com", + "help": { + "online": "http://esp32.com" + }, + "platforms": [ + { + "name": "esp32", + "architecture": "esp32", + "version": "3.2.0", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.2.0/esp32-3.2.0.zip", + "archiveFileName": "esp32-3.2.0.zip", + "checksum": "SHA-256:d38b16fef6e519fc0d19bc5af0b39cdbed7dfc2ce69214c1971ded0e61ecd911", + "size": "25447136", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "ESP32-C6 Dev Board" + }, + { + "name": "ESP32-H2 Dev Board" + }, + { + "name": "ESP32-P4 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.4-2f7dcd86-v1" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2411" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2411" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20241016" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.9.dev3" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.1.3", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.3/esp32-3.1.3.zip", + "archiveFileName": "esp32-3.1.3.zip", + "checksum": "SHA-256:747160dbc81c6634c7bff9e8a57213e9982d52fe90d2a8f75a93a9f7b527defb", + "size": "25396700", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-489d7a2b-v1" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20241016" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.9.dev3" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.1.2", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.2/esp32-3.1.2.zip", + "archiveFileName": "esp32-3.1.2.zip", + "checksum": "SHA-256:17214f51a7b9de547baa777419d2b041e1f09cfb17adb33c18617a756190f9f6", + "size": "25396684", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-489d7a2b-v1" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20241016" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.9.dev3" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.1.1", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.1/esp32-3.1.1.zip", + "archiveFileName": "esp32-3.1.1.zip", + "checksum": "SHA-256:e20982b2860eab4900ce16a0f2b7f9fc3ffb205e490dc933f625d53a5c9e8129", + "size": "25253828", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-cfea4f7c-v1" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20241016" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.9.dev3" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.1.0", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0/esp32-3.1.0.zip", + "archiveFileName": "esp32-3.1.0.zip", + "checksum": "SHA-256:0db044159e3fc737435b3f1d547bf85c60a33a175342c317d2a5c08c42977f80", + "size": "25225607", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-083aad99-v2" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20241016" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.9.dev3" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.7", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.7/esp32-3.0.7.zip", + "archiveFileName": "esp32-3.0.7.zip", + "checksum": "SHA-256:6b48f5bd889e55d7b93b95849dff77c6a5e4b9ee58c7298d7872d558a4d04931", + "size": "24546342", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-632e0c2a" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs2", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs3", + "version": "2302" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20240821" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.6", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.6/esp32-3.0.6.zip", + "archiveFileName": "esp32-3.0.6.zip", + "checksum": "SHA-256:7b4d87d0a18e69cba81e7aa7e69f088dc7c4f6cc89a20adc256bf77c86992dc5", + "size": "24546256", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-632e0c2a" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs2", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs3", + "version": "2302" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20240821" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.5", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.5/esp32-3.0.5.zip", + "archiveFileName": "esp32-3.0.5.zip", + "checksum": "SHA-256:6ead4c452e69146b8eb08bee5a77898acc75a0637e9fccb5bbf665385ddc28db", + "size": "24481707", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-33fbade6" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs2", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs3", + "version": "2302" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20240821" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.4", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.4/esp32-3.0.4.zip", + "archiveFileName": "esp32-3.0.4.zip", + "checksum": "SHA-256:58fcd9b033be0358afbcbcf9a1d8eb216217f65f6b28f2e2cd739c7d016dda4f", + "size": "23937821", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-b6b4727c58" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs2", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs3", + "version": "2302" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20240318" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.3", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.3/esp32-3.0.3.zip", + "archiveFileName": "esp32-3.0.3.zip", + "checksum": "SHA-256:b4aa70711293955a9835ad641279dc7cd524aeb405f7d294afa05c2ece7ded45", + "size": "23920341", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-dc859c1e67" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs2", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs3", + "version": "2302" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20240318" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.2", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.2/esp32-3.0.2.zip", + "archiveFileName": "esp32-3.0.2.zip", + "checksum": "SHA-256:bd90630fbe9e99f3bb3340c25a87574d5551dd2823849adbf285f8430b6884cf", + "size": "23893902", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-bd2b9390ef" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs2", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs3", + "version": "2302" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20240318" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.1", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-3.0.1.zip", + "archiveFileName": "esp32-3.0.1.zip", + "checksum": "SHA-256:b7169d0dd51b64e450a7c09fafb7a4782820a9bc745f7b1e4618316440db0930", + "size": "23895257", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-442a798083" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs2", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs3", + "version": "2302" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230921" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.0", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.0/esp32-3.0.0.zip", + "archiveFileName": "esp32-3.0.0.zip", + "checksum": "SHA-256:0960cf786992e0e3770d8c1e1979eaf01bd0ac9209b24fb00948cf93d43cf95c", + "size": "23891610", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-442a798083" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-12.2.0_20230208" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-12.2.0_20230208" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-12.2.0_20230208" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230921" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.17", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.17/esp32-2.0.17.zip", + "archiveFileName": "esp32-2.0.17.zip", + "checksum": "SHA-256:1f8658d4b18a8001ce782142ad08164af2991d70b83a147c3437a6ee30a9b225", + "size": "254658377", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230921" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.16", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.16/esp32-2.0.16.zip", + "archiveFileName": "esp32-2.0.16.zip", + "checksum": "SHA-256:6615fd16fd6d3ee2fa7ca2dd40a4f65220eddf094a88b7cee2141a0c077987bc", + "size": "254657760", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230921" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.15", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.15/esp32-2.0.15.zip", + "archiveFileName": "esp32-2.0.15.zip", + "checksum": "SHA-256:2219c1636264f55e19b2a5e7f41c81b669b1355017b15ee31773c85674b3e9bb", + "size": "254657764", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230921" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.14", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.14/esp32-2.0.14.zip", + "archiveFileName": "esp32-2.0.14.zip", + "checksum": "SHA-256:77c71eba520c97ab30161eb2f9c6a46b019e48d13936244b18f6ad4dbecf0a58", + "size": "252506057", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230419" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.13", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.13/esp32-2.0.13.zip", + "archiveFileName": "esp32-2.0.13.zip", + "checksum": "SHA-256:ee4c277bac0eecb7ca8853780da9d49b4e260926059cf6a9f9bac1923059de0c", + "size": "250665913", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20221026" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.12", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.12/esp32-2.0.12.zip", + "archiveFileName": "esp32-2.0.12.zip", + "checksum": "SHA-256:9a4f844ca67812c547a9635cdb0dd2c347cae7a3e855f95f9d490b2f8d340dbe", + "size": "250664387", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20221026" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.11", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.11/esp32-2.0.11.zip", + "archiveFileName": "esp32-2.0.11.zip", + "checksum": "SHA-256:d15386308dc72f94816ce80b5508af999f2fd0d88eb5e1ffba48316ab0b9c5d6", + "size": "250401265", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20221026" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.10", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.10/esp32-2.0.10.zip", + "archiveFileName": "esp32-2.0.10.zip", + "checksum": "SHA-256:6028cb623c838723c41000869963d95f7cb811d58643133068eed31c03c2d7c0", + "size": "250401273", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20221026" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.9", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.9/esp32-2.0.9.zip", + "archiveFileName": "esp32-2.0.9.zip", + "checksum": "SHA-256:37072185026db3cdc0ed4b6fb12840d7f41571a16c60eec97bec2a4abec8dcee", + "size": "278964028", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20221026" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.8", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.8/esp32-2.0.8.zip", + "archiveFileName": "esp32-2.0.8.zip", + "checksum": "SHA-256:2c5daa3ce7456e752fb8d8a35b0b6b2eb8e494032cba57569ba12dd53eb235f2", + "size": "278963636", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20221026" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.7", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esp32-2.0.7.zip", + "archiveFileName": "esp32-2.0.7.zip", + "checksum": "SHA-256:b5a7a54fca36501d1108413310ec50ae2df655c14c3881325903cde2c7ae5f80", + "size": "278966011", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20221026" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.6", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.6/esp32-2.0.6.zip", + "archiveFileName": "esp32-2.0.6.zip", + "checksum": "SHA-256:ea56d300404cc1b5bc15295f29790246b02025c493e0664a6d271164a602a351", + "size": "264579419", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch5" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch5" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch5" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch5" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.2.1" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20220706" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.5", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.5/esp32-2.0.5.zip", + "archiveFileName": "esp32-2.0.5.zip", + "checksum": "SHA-256:c7a1040c5f007a799ef9eb249508e3544c3cf5246f67cdfdc1e80f7d0ca7b41d", + "size": "260916106", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.2.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.4", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esp32-2.0.4.zip", + "archiveFileName": "esp32-2.0.4.zip", + "checksum": "SHA-256:832609d6f4cd0edf4e471f02e30b7f0e1c86fdd1b950990ef40431e656237214", + "size": "259715595", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "3.3.0" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.3", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.3/esp32-2.0.3.zip", + "archiveFileName": "esp32-2.0.3.zip", + "checksum": "SHA-256:7a44ab32a2bfe18a84fd1f75aa1921dae92c6b4a74a2eb4d0c7d479b34996f3b", + "size": "246542267", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "3.3.0" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.2", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.2/esp32-2.0.2.zip", + "archiveFileName": "esp32-2.0.2.zip", + "checksum": "SHA-256:e139f22aab9cbe8109815de0be110e58a8f1d6c90a2e263eb0b0d646b53a5a33", + "size": "151846438", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "3.1.0" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.1", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.1/esp32-2.0.1.zip", + "archiveFileName": "esp32-2.0.1.zip", + "checksum": "SHA-256:3a7cd46ba47990dd37fbe02b7f0a910dd5cc7af1d190350b69d320ed36cd6b41", + "size": "148976301", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "3.1.0" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.0", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.0/esp32-2.0.0.zip", + "archiveFileName": "esp32-2.0.0.zip", + "checksum": "SHA-256:10e1c42dbf11d2359259a80008f13f37d2f9bb8f49a25d34d387cf4531052cbc", + "size": "139313137", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Module" + }, + { + "name": "WEMOS LoLin32" + }, + { + "name": "WEMOS D1 MINI ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r1" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r1" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r1" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "3.1.0" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "1.0.6", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.6/esp32-1.0.6.zip", + "archiveFileName": "esp32-1.0.6.zip", + "checksum": "SHA-256:982da9aaa181b6cb9c692dd4c9622b022ecc0d1e3aa0c5b70428ccc3c1b4556b", + "size": "51126662", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Module" + }, + { + "name": "WEMOS LoLin32" + }, + { + "name": "WEMOS D1 MINI ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "1.22.0-97-gc752ad5-5.2.0" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "3.0.0" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "1.0.5", + "category": "ESP32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5/esp32-1.0.5.zip", + "archiveFileName": "esp32-1.0.5.zip", + "checksum": "SHA-256:dc5c6c72a127b3171c654f3c3476911d3c2b0ab21affdb7b0f0756c105ca71a7", + "size": "49552769", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Module" + }, + { + "name": "WEMOS LoLin32" + }, + { + "name": "WEMOS D1 MINI ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "1.22.0-97-gc752ad5-5.2.0" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "3.0.0" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + } + ] + }, + { + "category": "ESP32", + "name": "esp32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.4/esp32-1.0.4.zip", + "checksum": "SHA-256:d9108bf873933c4e48a3ca401fb51e41b2cc3f98d7c9b9be9881e7ca34bf0efe", + "help": { + "online": "" + }, + "version": "1.0.4", + "architecture": "esp32", + "archiveFileName": "esp32-1.0.4.zip", + "boards": [ + { + "name": "ESP32 Dev Module" + }, + { + "name": "WEMOS LoLin32" + }, + { + "name": "WEMOS D1 MINI ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "version": "1.22.0-80-g6c4433a-5.2.0", + "name": "xtensa-esp32-elf-gcc" + }, + { + "packager": "esp32", + "version": "2.6.1", + "name": "esptool_py" + }, + { + "packager": "esp32", + "version": "0.2.3", + "name": "mkspiffs" + } + ], + "size": "36853332" + }, + { + "category": "ESP32", + "name": "esp32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.3/esp32-1.0.3.zip", + "checksum": "SHA-256:19a30ece8a3ab26ab420c3d5531a9a1c51cb04e421a4f1d86dc072c209060436", + "help": { + "online": "" + }, + "version": "1.0.3", + "architecture": "esp32", + "archiveFileName": "esp32-1.0.3.zip", + "boards": [ + { + "name": "ESP32 Dev Module" + }, + { + "name": "WEMOS LoLin32" + }, + { + "name": "WEMOS D1 MINI ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "version": "1.22.0-80-g6c4433a-5.2.0", + "name": "xtensa-esp32-elf-gcc" + }, + { + "packager": "esp32", + "version": "2.6.1", + "name": "esptool_py" + }, + { + "packager": "esp32", + "version": "0.2.3", + "name": "mkspiffs" + } + ], + "size": "36811826" + }, + { + "category": "ESP32", + "help": { + "online": "" + }, + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.2/esp32-1.0.2.zip", + "checksum": "SHA-256:c3a5a5050705d41ab205d25a7399e921057b754ef8f883419f58c0c7f08df11c", + "version": "1.0.2", + "architecture": "esp32", + "archiveFileName": "esp32-1.0.2.zip", + "boards": [ + { + "name": "ESP32 Dev Module" + }, + { + "name": "WEMOS LoLin32" + } + ], + "size": "31174160", + "toolsDependencies": [ + { + "packager": "esp32", + "version": "1.22.0-80-g6c4433a-5.2.0", + "name": "xtensa-esp32-elf-gcc" + }, + { + "packager": "esp32", + "version": "2.6.1", + "name": "esptool_py" + }, + { + "packager": "esp32", + "version": "0.2.3", + "name": "mkspiffs" + } + ], + "name": "esp32" + }, + { + "category": "ESP32", + "help": { + "online": "" + }, + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.1/esp32-1.0.1.zip", + "checksum": "SHA-256:1a7fa2f9bb0b6b5a20dfea227497f4851dc8b886caf7ecb998f745589c97ed34", + "name": "esp32", + "version": "1.0.1", + "architecture": "esp32", + "archiveFileName": "esp32-1.0.1.zip", + "size": "31273425", + "toolsDependencies": [ + { + "packager": "esp32", + "version": "1.22.0-80-g6c4433a-5.2.0", + "name": "xtensa-esp32-elf-gcc" + }, + { + "packager": "esp32", + "version": "2.6.0", + "name": "esptool_py" + }, + { + "packager": "esp32", + "version": "0.2.3", + "name": "mkspiffs" + } + ], + "boards": [ + { + "name": "ESP32 Dev Module" + }, + { + "name": "WEMOS LoLin32" + } + ] + }, + { + "category": "ESP32", + "help": { + "online": "" + }, + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.0/esp32-1.0.0.zip", + "checksum": "SHA-256:94d586174f103e2014be590ab307c5cdda6fa2ec70204c7f121882ace5e05c80", + "name": "esp32", + "version": "1.0.0", + "architecture": "esp32", + "archiveFileName": "esp32-1.0.0.zip", + "size": "26381887", + "toolsDependencies": [ + { + "packager": "esp32", + "version": "1.22.0-80-g6c4433a-5.2.0", + "name": "xtensa-esp32-elf-gcc" + }, + { + "packager": "esp32", + "version": "2.3.1", + "name": "esptool" + }, + { + "packager": "esp32", + "version": "0.2.3", + "name": "mkspiffs" + } + ], + "boards": [ + { + "name": "ESP32 Dev Module" + }, + { + "name": "WEMOS LoLin32" + } + ] + } + ], + "tools": [ + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.4-2f7dcd86-v1", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-489d7a2b-v1", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "checksum": "SHA-256:489012502218a7d30f6c312764bc8d10830a51e1db29558f15181c68373d0095", + "size": "341414090" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "checksum": "SHA-256:489012502218a7d30f6c312764bc8d10830a51e1db29558f15181c68373d0095", + "size": "341414090" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "checksum": "SHA-256:489012502218a7d30f6c312764bc8d10830a51e1db29558f15181c68373d0095", + "size": "341414090" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "checksum": "SHA-256:489012502218a7d30f6c312764bc8d10830a51e1db29558f15181c68373d0095", + "size": "341414090" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "checksum": "SHA-256:489012502218a7d30f6c312764bc8d10830a51e1db29558f15181c68373d0095", + "size": "341414090" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "checksum": "SHA-256:489012502218a7d30f6c312764bc8d10830a51e1db29558f15181c68373d0095", + "size": "341414090" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "checksum": "SHA-256:489012502218a7d30f6c312764bc8d10830a51e1db29558f15181c68373d0095", + "size": "341414090" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "checksum": "SHA-256:489012502218a7d30f6c312764bc8d10830a51e1db29558f15181c68373d0095", + "size": "341414090" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-cfea4f7c-v1", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "checksum": "SHA-256:1099291229a9be453c771c5867b8487a0266db9246b672417337b8f511d7f820", + "size": "341118284" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "checksum": "SHA-256:1099291229a9be453c771c5867b8487a0266db9246b672417337b8f511d7f820", + "size": "341118284" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "checksum": "SHA-256:1099291229a9be453c771c5867b8487a0266db9246b672417337b8f511d7f820", + "size": "341118284" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "checksum": "SHA-256:1099291229a9be453c771c5867b8487a0266db9246b672417337b8f511d7f820", + "size": "341118284" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "checksum": "SHA-256:1099291229a9be453c771c5867b8487a0266db9246b672417337b8f511d7f820", + "size": "341118284" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "checksum": "SHA-256:1099291229a9be453c771c5867b8487a0266db9246b672417337b8f511d7f820", + "size": "341118284" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "checksum": "SHA-256:1099291229a9be453c771c5867b8487a0266db9246b672417337b8f511d7f820", + "size": "341118284" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "checksum": "SHA-256:1099291229a9be453c771c5867b8487a0266db9246b672417337b8f511d7f820", + "size": "341118284" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-083aad99-v2", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "checksum": "SHA-256:4c6cae2e34df7e85a149615a6c18169777faf9460f708fc51d93616a117973c2", + "size": "341175680" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "checksum": "SHA-256:4c6cae2e34df7e85a149615a6c18169777faf9460f708fc51d93616a117973c2", + "size": "341175680" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "checksum": "SHA-256:4c6cae2e34df7e85a149615a6c18169777faf9460f708fc51d93616a117973c2", + "size": "341175680" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "checksum": "SHA-256:4c6cae2e34df7e85a149615a6c18169777faf9460f708fc51d93616a117973c2", + "size": "341175680" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "checksum": "SHA-256:4c6cae2e34df7e85a149615a6c18169777faf9460f708fc51d93616a117973c2", + "size": "341175680" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "checksum": "SHA-256:4c6cae2e34df7e85a149615a6c18169777faf9460f708fc51d93616a117973c2", + "size": "341175680" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "checksum": "SHA-256:4c6cae2e34df7e85a149615a6c18169777faf9460f708fc51d93616a117973c2", + "size": "341175680" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "checksum": "SHA-256:4c6cae2e34df7e85a149615a6c18169777faf9460f708fc51d93616a117973c2", + "size": "341175680" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-632e0c2a", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "checksum": "SHA-256:41f67e1c11f68b57d651955c93b63d6a8d35808ce6aff6ba3d1e1476178758f2", + "size": "309895581" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "checksum": "SHA-256:41f67e1c11f68b57d651955c93b63d6a8d35808ce6aff6ba3d1e1476178758f2", + "size": "309895581" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "checksum": "SHA-256:41f67e1c11f68b57d651955c93b63d6a8d35808ce6aff6ba3d1e1476178758f2", + "size": "309895581" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "checksum": "SHA-256:41f67e1c11f68b57d651955c93b63d6a8d35808ce6aff6ba3d1e1476178758f2", + "size": "309895581" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "checksum": "SHA-256:41f67e1c11f68b57d651955c93b63d6a8d35808ce6aff6ba3d1e1476178758f2", + "size": "309895581" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "checksum": "SHA-256:41f67e1c11f68b57d651955c93b63d6a8d35808ce6aff6ba3d1e1476178758f2", + "size": "309895581" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "checksum": "SHA-256:41f67e1c11f68b57d651955c93b63d6a8d35808ce6aff6ba3d1e1476178758f2", + "size": "309895581" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "checksum": "SHA-256:41f67e1c11f68b57d651955c93b63d6a8d35808ce6aff6ba3d1e1476178758f2", + "size": "309895581" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-33fbade6", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "checksum": "SHA-256:578f325fa9fca635d9c6c3b19726cb26077751e3155b677317bde2e0b371df7d", + "size": "309285463" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "checksum": "SHA-256:578f325fa9fca635d9c6c3b19726cb26077751e3155b677317bde2e0b371df7d", + "size": "309285463" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "checksum": "SHA-256:578f325fa9fca635d9c6c3b19726cb26077751e3155b677317bde2e0b371df7d", + "size": "309285463" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "checksum": "SHA-256:578f325fa9fca635d9c6c3b19726cb26077751e3155b677317bde2e0b371df7d", + "size": "309285463" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "checksum": "SHA-256:578f325fa9fca635d9c6c3b19726cb26077751e3155b677317bde2e0b371df7d", + "size": "309285463" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "checksum": "SHA-256:578f325fa9fca635d9c6c3b19726cb26077751e3155b677317bde2e0b371df7d", + "size": "309285463" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "checksum": "SHA-256:578f325fa9fca635d9c6c3b19726cb26077751e3155b677317bde2e0b371df7d", + "size": "309285463" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "checksum": "SHA-256:578f325fa9fca635d9c6c3b19726cb26077751e3155b677317bde2e0b371df7d", + "size": "309285463" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-b6b4727c58", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip", + "archiveFileName": "esp32-arduino-libs-3.0.4.zip", + "checksum": "SHA-256:c5c495fc3e6e11418e87ca9f6bf89cdcb0bcc38244a618f8d457d7a77f70b778", + "size": "305857583" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip", + "archiveFileName": "esp32-arduino-libs-3.0.4.zip", + "checksum": "SHA-256:c5c495fc3e6e11418e87ca9f6bf89cdcb0bcc38244a618f8d457d7a77f70b778", + "size": "305857583" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip", + "archiveFileName": "esp32-arduino-libs-3.0.4.zip", + "checksum": "SHA-256:c5c495fc3e6e11418e87ca9f6bf89cdcb0bcc38244a618f8d457d7a77f70b778", + "size": "305857583" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip", + "archiveFileName": "esp32-arduino-libs-3.0.4.zip", + "checksum": "SHA-256:c5c495fc3e6e11418e87ca9f6bf89cdcb0bcc38244a618f8d457d7a77f70b778", + "size": "305857583" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip", + "archiveFileName": "esp32-arduino-libs-3.0.4.zip", + "checksum": "SHA-256:c5c495fc3e6e11418e87ca9f6bf89cdcb0bcc38244a618f8d457d7a77f70b778", + "size": "305857583" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip", + "archiveFileName": "esp32-arduino-libs-3.0.4.zip", + "checksum": "SHA-256:c5c495fc3e6e11418e87ca9f6bf89cdcb0bcc38244a618f8d457d7a77f70b778", + "size": "305857583" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip", + "archiveFileName": "esp32-arduino-libs-3.0.4.zip", + "checksum": "SHA-256:c5c495fc3e6e11418e87ca9f6bf89cdcb0bcc38244a618f8d457d7a77f70b778", + "size": "305857583" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip", + "archiveFileName": "esp32-arduino-libs-3.0.4.zip", + "checksum": "SHA-256:c5c495fc3e6e11418e87ca9f6bf89cdcb0bcc38244a618f8d457d7a77f70b778", + "size": "305857583" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-dc859c1e67", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.3/esp32-arduino-libs-3.0.3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.3.zip", + "checksum": "SHA-256:23618328d3cc3d2eabc269196be22af5b2353583d5f6ec14b3ef0cf11e7da7ba", + "size": "305530538" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.3/esp32-arduino-libs-3.0.3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.3.zip", + "checksum": "SHA-256:23618328d3cc3d2eabc269196be22af5b2353583d5f6ec14b3ef0cf11e7da7ba", + "size": "305530538" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.3/esp32-arduino-libs-3.0.3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.3.zip", + "checksum": "SHA-256:23618328d3cc3d2eabc269196be22af5b2353583d5f6ec14b3ef0cf11e7da7ba", + "size": "305530538" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.3/esp32-arduino-libs-3.0.3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.3.zip", + "checksum": "SHA-256:23618328d3cc3d2eabc269196be22af5b2353583d5f6ec14b3ef0cf11e7da7ba", + "size": "305530538" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.3/esp32-arduino-libs-3.0.3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.3.zip", + "checksum": "SHA-256:23618328d3cc3d2eabc269196be22af5b2353583d5f6ec14b3ef0cf11e7da7ba", + "size": "305530538" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.3/esp32-arduino-libs-3.0.3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.3.zip", + "checksum": "SHA-256:23618328d3cc3d2eabc269196be22af5b2353583d5f6ec14b3ef0cf11e7da7ba", + "size": "305530538" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.3/esp32-arduino-libs-3.0.3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.3.zip", + "checksum": "SHA-256:23618328d3cc3d2eabc269196be22af5b2353583d5f6ec14b3ef0cf11e7da7ba", + "size": "305530538" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.3/esp32-arduino-libs-3.0.3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.3.zip", + "checksum": "SHA-256:23618328d3cc3d2eabc269196be22af5b2353583d5f6ec14b3ef0cf11e7da7ba", + "size": "305530538" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-bd2b9390ef", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip", + "archiveFileName": "esp32-arduino-libs-3.0.2.zip", + "checksum": "SHA-256:6df0f2753ae3d43582e641e3b945666c2700cb18f62a1932ad535b79427aae0b", + "size": "305835047" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip", + "archiveFileName": "esp32-arduino-libs-3.0.2.zip", + "checksum": "SHA-256:6df0f2753ae3d43582e641e3b945666c2700cb18f62a1932ad535b79427aae0b", + "size": "305835047" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip", + "archiveFileName": "esp32-arduino-libs-3.0.2.zip", + "checksum": "SHA-256:6df0f2753ae3d43582e641e3b945666c2700cb18f62a1932ad535b79427aae0b", + "size": "305835047" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip", + "archiveFileName": "esp32-arduino-libs-3.0.2.zip", + "checksum": "SHA-256:6df0f2753ae3d43582e641e3b945666c2700cb18f62a1932ad535b79427aae0b", + "size": "305835047" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip", + "archiveFileName": "esp32-arduino-libs-3.0.2.zip", + "checksum": "SHA-256:6df0f2753ae3d43582e641e3b945666c2700cb18f62a1932ad535b79427aae0b", + "size": "305835047" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip", + "archiveFileName": "esp32-arduino-libs-3.0.2.zip", + "checksum": "SHA-256:6df0f2753ae3d43582e641e3b945666c2700cb18f62a1932ad535b79427aae0b", + "size": "305835047" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip", + "archiveFileName": "esp32-arduino-libs-3.0.2.zip", + "checksum": "SHA-256:6df0f2753ae3d43582e641e3b945666c2700cb18f62a1932ad535b79427aae0b", + "size": "305835047" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip", + "archiveFileName": "esp32-arduino-libs-3.0.2.zip", + "checksum": "SHA-256:6df0f2753ae3d43582e641e3b945666c2700cb18f62a1932ad535b79427aae0b", + "size": "305835047" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-442a798083", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.1.zip", + "checksum": "SHA-256:112f81fcaed22286f9ba19bbd01d12337aab7b64e997120c33f833816b343e20", + "size": "373411607" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.1.zip", + "checksum": "SHA-256:112f81fcaed22286f9ba19bbd01d12337aab7b64e997120c33f833816b343e20", + "size": "373411607" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.1.zip", + "checksum": "SHA-256:112f81fcaed22286f9ba19bbd01d12337aab7b64e997120c33f833816b343e20", + "size": "373411607" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.1.zip", + "checksum": "SHA-256:112f81fcaed22286f9ba19bbd01d12337aab7b64e997120c33f833816b343e20", + "size": "373411607" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.1.zip", + "checksum": "SHA-256:112f81fcaed22286f9ba19bbd01d12337aab7b64e997120c33f833816b343e20", + "size": "373411607" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.1.zip", + "checksum": "SHA-256:112f81fcaed22286f9ba19bbd01d12337aab7b64e997120c33f833816b343e20", + "size": "373411607" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.1.zip", + "checksum": "SHA-256:112f81fcaed22286f9ba19bbd01d12337aab7b64e997120c33f833816b343e20", + "size": "373411607" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.1.zip", + "checksum": "SHA-256:112f81fcaed22286f9ba19bbd01d12337aab7b64e997120c33f833816b343e20", + "size": "373411607" + } + ] + }, + { + "name": "esp-x32", + "version": "2411", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-14.2.0_20241119-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:b1859df334a85541ae746e1b86439f59180d87f8cf1cc04c2e770fadf9f006e9", + "size": "323678089" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-14.2.0_20241119-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:7ff023033a5c00e55b9fc0a0b26d18fb0e476c24e24c5b0459bcb2e05a3729f1", + "size": "320064691" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp-elf-14.2.0_20241119-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:bb11dbf3ed25d4e0cc9e938749519e8236cfa2609e85742d311f1d869111805a", + "size": "319454139" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-i586-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-14.2.0_20241119-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:5ac611dca62ec791d413d1f417d566c444b006d2a4f97bd749b15f782d87249b", + "size": "328335914" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-x86_64-apple-darwin_signed.tar.gz", + "archiveFileName": "xtensa-esp-elf-14.2.0_20241119-x86_64-apple-darwin_signed.tar.gz", + "checksum": "SHA-256:15b3e60362028eaeff9156dc82dac3f1436b4aeef3920b28d7650974d8c34751", + "size": "336215844" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-aarch64-apple-darwin_signed.tar.gz", + "archiveFileName": "xtensa-esp-elf-14.2.0_20241119-aarch64-apple-darwin_signed.tar.gz", + "checksum": "SHA-256:45c475518735133789bacccad31f872318b7ecc0b31cc9b7924aad880034f0bf", + "size": "318797396" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-14.2.0_20241119-i686-w64-mingw32.zip", + "checksum": "SHA-256:b30e450e0af279783c54a9ae77c3b367dd556b78eda930a92ec7b784a74c28c8", + "size": "382457717" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-14.2.0_20241119-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:62ae704777d73c30689efff6e81178632a1ca44d1a2d60f4621eb997e040e028", + "size": "386316009" + } + ] + }, + { + "name": "esp-x32", + "version": "2405", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-13.2.0_20240530-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:bce77e8480701d5a90545369d1b5848f6048eb39c0022d2446d1e33a8e127490", + "size": "208911713" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-13.2.0_20240530-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:7c9e3c1adc733d042ed87b92daa1d6396e1b441c1755f1fa14cb88855719ba88", + "size": "202519931" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp-elf-13.2.0_20240530-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:d6955e8ea6af91574bf9213b92f32ca09eb8640103446b7fa19a63cfeeec5421", + "size": "202206516" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-i586-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-13.2.0_20240530-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:3666ee74ecb693ee6488f11469802630a7b0d32608184045a4f35cb413f59e3d", + "size": "213304863" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-x86_64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp-elf-13.2.0_20240530-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:948cf57b6eecc898b5f70e06ad08ba88c08b627be570ec631dfcd72f6295194a", + "size": "221357024" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-aarch64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp-elf-13.2.0_20240530-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:6f03fdf0cc14a7f3900ee59977f62e8626d8b7c208506e52f1fd883ac223427a", + "size": "199689745" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-i686-w64-mingw32_hotfix.zip", + "archiveFileName": "xtensa-esp-elf-13.2.0_20240530-i686-w64-mingw32_hotfix.zip", + "checksum": "SHA-256:d6b227c50e3c8e21d62502b3140e5ab74a4cb502c2b4169c36238b9858a8fb88", + "size": "266042967" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-x86_64-w64-mingw32_hotfix.zip", + "archiveFileName": "xtensa-esp-elf-13.2.0_20240530-x86_64-w64-mingw32_hotfix.zip", + "checksum": "SHA-256:155ee97b531236e6a7c763395c68ca793e55e74d2cb4d38a23057a153e01e7d0", + "size": "269831985" + } + ] + }, + { + "name": "esp-x32", + "version": "2302", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:e8d35938385447cf9c34735fee2a3b2b61cca6be07db77a45856a1c2a347e423", + "size": "111766903" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:569988acfc2673369f222037c64bac96990cee08cebeebc4f8860e0d984f8bd9", + "size": "106473247" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:6a844f16021e936cc9b87b203978356f57ab2144554f6f2a0f73ffa3d3d316c5", + "size": "105576049" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "checksum": "SHA-256:743d6f03a89329bb09f9550d27fcab677f5cf06b4720793bbcef7883a932681d", + "size": "114870843" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:4d32d764e984f3a570aacfb2f4957619540fb4629534d969b2e83997901334c3", + "size": "119424029" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:dc8fa7f4933bf5cb08e83bacce6160cc9dfe93d7aad1e8f92599bb81ff5b2e28", + "size": "106136827" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "checksum": "SHA-256:62bb6428d107ed3f44c212c77ecf24804b74c97327b0f0ad2029c656c6dbd6ee", + "size": "130847086" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:8febfe4a6476efc69012390106c8c660a14418f025137b0513670c72124339cf", + "size": "134985117" + } + ] + }, + { + "name": "xtensa-esp-elf-gdb", + "version": "14.2_20240403", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/xtensa-esp-elf-gdb-14.2_20240403-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-14.2_20240403-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:9d68472d4cba5cf8c2b79d94f86f92c828e76a632bd1e6be5e7706e5b304d36e", + "size": "31010320" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/xtensa-esp-elf-gdb-14.2_20240403-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-14.2_20240403-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:bdabc3217994815fc311c4e16e588b78f6596b5ad4ffa46c80b40e982cfb1e66", + "size": "30954580" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/xtensa-esp-elf-gdb-14.2_20240403-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-14.2_20240403-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:d54b8d703ba897b28c627da3d27106a3906dd01ba298778a67064710bc33c76d", + "size": "28697281" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/xtensa-esp-elf-gdb-14.2_20240403-i586-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-14.2_20240403-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:64d3bc992ed8fdec383d49e8b803ac494605a38117c8293db8da055037de96b0", + "size": "29890994" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/xtensa-esp-elf-gdb-14.2_20240403-x86_64-apple-darwin14.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-14.2_20240403-x86_64-apple-darwin14.tar.gz", + "checksum": "SHA-256:023e74b3fda793da4bc0509b02de776ee0dad6efaaac17bef5916fb7dc9c26b9", + "size": "44446611" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/xtensa-esp-elf-gdb-14.2_20240403-aarch64-apple-darwin21.1.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-14.2_20240403-aarch64-apple-darwin21.1.tar.gz", + "checksum": "SHA-256:ea757c6bf8c25238f6d2fdcc6bbab25a1b00608a0f9e19b7ddd2f37ddbdc3fb1", + "size": "37021423" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/xtensa-esp-elf-gdb-14.2_20240403-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-gdb-14.2_20240403-i686-w64-mingw32.zip", + "checksum": "SHA-256:322e8d9b700dc32d8158e3dc55fb85ec55de48d0bb7789375ee39a28d5d655e2", + "size": "26302466" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/xtensa-esp-elf-gdb-14.2_20240403-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-gdb-14.2_20240403-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:a27a2fe20f192f8e0a51b8936428b4e1cf8935cfe008ee445cc49f6fc7f6db2e", + "size": "28366035" + } + ] + }, + { + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/xtensa-esp-elf-gdb-12.1_20231023-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20231023-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:d0743ec43cd92c35452a9097f7863281de4e72f04120d63cfbcf9d591a373529", + "size": "36942094" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/xtensa-esp-elf-gdb-12.1_20231023-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20231023-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:bc1fac0366c6a08e26c45896ca21c8c90efc2cdd431b8ba084e8772e15502d0e", + "size": "37134601" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/xtensa-esp-elf-gdb-12.1_20231023-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20231023-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:25efc51d52b71f097ccec763c5c885c8f5026b432fec4b5badd6a5f36fe34d04", + "size": "34579556" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/xtensa-esp-elf-gdb-12.1_20231023-i586-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20231023-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:e0af0b3b4a6b29a843cd5f47e331a966d9258f7d825b4656c6251490f71b05b2", + "size": "35676578" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/xtensa-esp-elf-gdb-12.1_20231023-x86_64-apple-darwin14.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20231023-x86_64-apple-darwin14.tar.gz", + "checksum": "SHA-256:bd146fd99a52b2d71c7ce0f62b9e18f3423d6cae7b2b2c954046b0dd7a23142f", + "size": "52863941" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/xtensa-esp-elf-gdb-12.1_20231023-aarch64-apple-darwin21.1.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20231023-aarch64-apple-darwin21.1.tar.gz", + "checksum": "SHA-256:5edc76565bf9d2fadf24e443ddf3df7567354f336a65d4af5b2ee805cdfcec24", + "size": "33504923" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/xtensa-esp-elf-gdb-12.1_20231023-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20231023-i686-w64-mingw32.zip", + "checksum": "SHA-256:ea4f3ee6b95ad1ad2e07108a21a50037a3e64a420cdeb34b2ba95d612faed898", + "size": "31068749" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/xtensa-esp-elf-gdb-12.1_20231023-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20231023-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:13bb97f39173948d1cfb6e651d9b335ea9d52f1fdd0dda1eda3a2d23d8c63644", + "size": "33514906" + } + ] + }, + { + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/xtensa-esp-elf-gdb-11.2_20220823-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-11.2_20220823-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:b5f7cc3e4b5a58db655754083ed9652e4953e71c3b4922fb624e7a034ec24a64", + "size": 26947336 + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/xtensa-esp-elf-gdb-11.2_20220823-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-11.2_20220823-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:816acfae38b6b443f4f1590395f68f079243539259d19c7772ae6416c6519444", + "size": 27134508 + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/xtensa-esp-elf-gdb-11.2_20220823-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-11.2_20220823-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:4dd1bace0633196fddfdcef3cebcc4bbfce22f5a0d2d1e3d618f3d8a6cbfcacc", + "size": 25205239 + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/xtensa-esp-elf-gdb-11.2_20220823-i586-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-11.2_20220823-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:27744d09d171be2f55ec15fa7f2d7f8ff94d33f7e130d24ebe082cb6c438618b", + "size": 25978028 + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/xtensa-esp-elf-gdb-11.2_20220823-x86_64-apple-darwin14.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-11.2_20220823-x86_64-apple-darwin14.tar.gz", + "checksum": "SHA-256:1432faa12d7301133f6ee654d60751b57adcc6cf323ee1ecc393f06f0225eff4", + "size": 38386785 + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/xtensa-esp-elf-gdb-11.2_20220823-aarch64-apple-darwin21.1.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-11.2_20220823-aarch64-apple-darwin21.1.tar.gz", + "checksum": "SHA-256:d0b542ef070ea72857f9cf554f176a0a9d868cd59e05ac293ad39402bcc5277d", + "size": 21671964 + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/xtensa-esp-elf-gdb-11.2_20220823-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-gdb-11.2_20220823-i686-w64-mingw32.zip", + "checksum": "SHA-256:1678b06aa80b1d689d05548056635efde5b73b98f2c3de5d555bcfc6f374c5d0", + "size": 23241302 + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/xtensa-esp-elf-gdb-11.2_20220823-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-gdb-11.2_20220823-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:7060df4b6aa133e282147c3651d50222d677d6a0fff92979c500353b099a3f41", + "size": 25135265 + } + ] + }, + { + "name": "esp-rv32", + "version": "2411", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-x86_64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-14.2.0_20241119-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:a16942465d33c7f0334c16e83bc6feb62e06eeb79cf19099293480bb8d48c0cd", + "size": "593721156" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-aarch64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-14.2.0_20241119-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:22486233d0e0fd58a54ae453b701f195f1432fc6f2e17085b9d6c8d5d9acefb7", + "size": "587879927" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-arm-linux-gnueabi.tar.gz", + "archiveFileName": "riscv32-esp-elf-14.2.0_20241119-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:27a72d5d96cdb56dae2a1da5dfde1717c18a8c1f9a1454c8e34a8bd34abe662d", + "size": "586531522" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-i586-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-14.2.0_20241119-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:b7bd6e4cd53a4c55831d48e96a3d500bfffb091bec84a30bc8c3ad687e3eb3a2", + "size": "597070471" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-x86_64-apple-darwin_signed.tar.gz", + "archiveFileName": "riscv32-esp-elf-14.2.0_20241119-x86_64-apple-darwin_signed.tar.gz", + "checksum": "SHA-256:5f8b571e1aedbe9f856f3bdeca6600cd5510ccff1ca102c4f001421eda560585", + "size": "602343061" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-aarch64-apple-darwin_signed.tar.gz", + "archiveFileName": "riscv32-esp-elf-14.2.0_20241119-aarch64-apple-darwin_signed.tar.gz", + "checksum": "SHA-256:a7276042a7eb2d33c2dff7167539e445c32c07d43a2c6827e86d035642503e0b", + "size": "578521565" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-i686-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-14.2.0_20241119-i686-w64-mingw32.zip", + "checksum": "SHA-256:54193a97bd75205678ead8d11f00b351cfa3c2a6e5ab5d966341358b9f9422d7", + "size": "672055172" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-x86_64-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-14.2.0_20241119-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:24c8407fa467448d394e0639436a5ede31caf1838e35e8435e19df58ebed438c", + "size": "677812937" + } + ] + }, + { + "name": "esp-rv32", + "version": "2405", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/riscv32-esp-elf-13.2.0_20240530-x86_64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-13.2.0_20240530-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:e7fbfffbb19dcd3764a9848a141bf44e19ad0b48e0bd1515912345c26fe52fba", + "size": "294346758" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/riscv32-esp-elf-13.2.0_20240530-aarch64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-13.2.0_20240530-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:a178a895b807ed2e87d5d62153c36a6aae048581f527c0eb152f0a02b8de9571", + "size": "288374597" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/riscv32-esp-elf-13.2.0_20240530-arm-linux-gnueabi.tar.gz", + "archiveFileName": "riscv32-esp-elf-13.2.0_20240530-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:4a2f176d0f5bc8a70645975e2a08ea94145fb69b7225c5cdcbd6024a4836aaf5", + "size": "287737495" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/riscv32-esp-elf-13.2.0_20240530-i586-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-13.2.0_20240530-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:7a6f02f1b2effafb18600bbf602818f6923fd320f000fb8659f34acbfda8812f", + "size": "299138540" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/riscv32-esp-elf-13.2.0_20240530-x86_64-apple-darwin.tar.gz", + "archiveFileName": "riscv32-esp-elf-13.2.0_20240530-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:a193b4f025d0d836b0a9d9cbe760af1c53e53af66fc332fe98952bc4c456dd9a", + "size": "305025700" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/riscv32-esp-elf-13.2.0_20240530-aarch64-apple-darwin.tar.gz", + "archiveFileName": "riscv32-esp-elf-13.2.0_20240530-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:7082dd2e2123dea5609a24092d19ac6612ae7e219df1d298de6b2f64cb4af0df", + "size": "285458443" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/riscv32-esp-elf-13.2.0_20240530-i686-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-13.2.0_20240530-i686-w64-mingw32.zip", + "checksum": "SHA-256:590bfb10576702639825581cc00c445da6e577012840a787137417e80d15f46d", + "size": "366573064" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/riscv32-esp-elf-13.2.0_20240530-x86_64-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-13.2.0_20240530-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:413eb9f6adf8fdaf25544d014c850fc09eb38bb93a2fc5ebd107ab1b0de1bb3a", + "size": "369820297" + } + ] + }, + { + "name": "esp-rv32", + "version": "2302", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/riscv32-esp-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:1eb0d65990547ee9706b90406600cbc3638814d5feb7c1f7b44bb5416478a5bd", + "size": "257615266" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/riscv32-esp-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:921fcdc170c7fe5d6a0a30470ed1875c8926d910c19739fc950c8d1836e4c1c5", + "size": "253094184" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/riscv32-esp-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "archiveFileName": "riscv32-esp-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:f66e06312b58251c2121c1b1df1102565708573b86b2a9fe0c03ea1b0e9a7511", + "size": "252558021" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/riscv32-esp-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "checksum": "SHA-256:8abcac0331ef8973d1c705e77523364ebec7e98b37640d4a1d036912f3cbe946", + "size": "261248375" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/riscv32-esp-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "archiveFileName": "riscv32-esp-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:76a334bc75a4e3891c222c84d7968817f2d0699d2976fc2a1658e56395283bec", + "size": "268987133" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/riscv32-esp-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "archiveFileName": "riscv32-esp-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:f30571945b257a10a26901bba3c5892e07c192aacf9ed6e8fcd11ca36ed827d2", + "size": "252159713" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/riscv32-esp-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "checksum": "SHA-256:a5dfbb6dbf6fc6c6ea9beb2723af059ba3c5b2c86c2f0dc3b21afdc7bb229bf5", + "size": "324863847" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/riscv32-esp-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:9deae9e0013b2f7bbf017f9c8135755bfa89522f337c7dca35872bf12ec08176", + "size": "328092732" + } + ] + }, + { + "name": "riscv32-esp-elf-gdb", + "version": "14.2_20240403", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/riscv32-esp-elf-gdb-14.2_20240403-x86_64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-14.2_20240403-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:ce004bc0bbd71b246800d2d13b239218b272a38bd528e316f21f1af2db8a4b13", + "size": "30707431" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/riscv32-esp-elf-gdb-14.2_20240403-aarch64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-14.2_20240403-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:ba10f2866c61410b88c65957274280b1a62e3bed05131654ed9b6758efe18e55", + "size": "30824065" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/riscv32-esp-elf-gdb-14.2_20240403-arm-linux-gnueabi.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-14.2_20240403-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:88539db5d987f28827efac7e26080a2803b9b539342ccd2963ccfdd56d7f08f7", + "size": "29000575" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/riscv32-esp-elf-gdb-14.2_20240403-i586-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-14.2_20240403-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:0e628ee37438ab6ba05eb889a76d09e50cb98e0020a16b8e2b935c5cf19b4ed2", + "size": "29947521" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/riscv32-esp-elf-gdb-14.2_20240403-x86_64-apple-darwin14.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-14.2_20240403-x86_64-apple-darwin14.tar.gz", + "checksum": "SHA-256:8f6bda832d70dad5860a639d55aba4237bd10cbac9f4822db1eece97357b34a9", + "size": "44196117" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/riscv32-esp-elf-gdb-14.2_20240403-aarch64-apple-darwin21.1.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-14.2_20240403-aarch64-apple-darwin21.1.tar.gz", + "checksum": "SHA-256:d88b6116e86456c8480ce9bc95aed375a35c0d091f1da0a53b86be0e6ef3d320", + "size": "36794404" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/riscv32-esp-elf-gdb-14.2_20240403-i686-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-gdb-14.2_20240403-i686-w64-mingw32.zip", + "checksum": "SHA-256:d6e7ce05805b0d8d4dd138ad239b98a1adf8da98941867d60760eb1ae5361730", + "size": "26486295" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/riscv32-esp-elf-gdb-14.2_20240403-x86_64-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-gdb-14.2_20240403-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:5c9f211dc46daf6b96fad09d709284a0f0186fef8947d9f6edd6bca5b5ad4317", + "size": "27942579" + } + ] + }, + { + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/riscv32-esp-elf-gdb-12.1_20231023-x86_64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20231023-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:2c78b806be176b1e449e07ff83429d38dfc39a13f89a127ac1ffa6c1230537a0", + "size": "36630145" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/riscv32-esp-elf-gdb-12.1_20231023-aarch64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20231023-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:33f80117c8777aaff9179e27953e41764c5c46b3c576dc96a37ecc7a368807ec", + "size": "36980143" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/riscv32-esp-elf-gdb-12.1_20231023-arm-linux-gnueabi.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20231023-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:292e6ec0a9381c1480bbadf5caae25e86428b68fb5d030c9be7deda5e7f070e0", + "size": "34950318" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/riscv32-esp-elf-gdb-12.1_20231023-i586-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20231023-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:68a25fbcfc6371ec4dbe503ec92211977eb2006f0c29e67dbce6b93c70c6b7ec", + "size": "35801607" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/riscv32-esp-elf-gdb-12.1_20231023-x86_64-apple-darwin14.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20231023-x86_64-apple-darwin14.tar.gz", + "checksum": "SHA-256:322c722e6c12225ed8cd97f95a0375105756dc5113d369958ce0858ad1a90257", + "size": "52618688" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/riscv32-esp-elf-gdb-12.1_20231023-aarch64-apple-darwin21.1.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20231023-aarch64-apple-darwin21.1.tar.gz", + "checksum": "SHA-256:c2224b3a8d02451c530cf004c29653292d963a1b4021b4b472b862b6dbe97e0b", + "size": "33149392" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/riscv32-esp-elf-gdb-12.1_20231023-i686-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20231023-i686-w64-mingw32.zip", + "checksum": "SHA-256:4b42149a99dd87ee7e6dde25c99bad966c7f964253fa8f771593d7cef69f5602", + "size": "31635103" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/riscv32-esp-elf-gdb-12.1_20231023-x86_64-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20231023-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:728231546ad5006d34463f972658b2a89e52f660a42abab08a29bedd4a8046ad", + "size": "33400816" + } + ] + }, + { + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/riscv32-esp-elf-gdb-11.2_20220823-x86_64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-11.2_20220823-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:6bf5b5d2d407e074af2a74fc826764934ac1625a1751c52fbc0d4d7772061f8f", + "size": 26799809 + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/riscv32-esp-elf-gdb-11.2_20220823-aarch64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-11.2_20220823-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:e54ef67cdb5724fc2da8f0487f19b2c83c08b560fff317f5ffd98fbb230b397a", + "size": 27021672 + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/riscv32-esp-elf-gdb-11.2_20220823-arm-linux-gnueabi.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-11.2_20220823-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:86772c6aee8a05b2c75a6b04e9da630e35e8415b64da8ccde92a5fb2d3c7fcf4", + "size": 25532577 + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/riscv32-esp-elf-gdb-11.2_20220823-i586-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-11.2_20220823-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:3463be3e24182b7f1bd0fb232020534445b2d0ea0e7093c1b4f4da102b3baf52", + "size": 26188698 + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/riscv32-esp-elf-gdb-11.2_20220823-x86_64-apple-darwin14.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-11.2_20220823-x86_64-apple-darwin14.tar.gz", + "checksum": "SHA-256:a9db1811ebb9271134eba2f7c303fc2587bd4b2a1ae33cd05ff2605cd2fb30d2", + "size": 38397584 + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/riscv32-esp-elf-gdb-11.2_20220823-aarch64-apple-darwin21.1.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-11.2_20220823-aarch64-apple-darwin21.1.tar.gz", + "checksum": "SHA-256:c94fb6d726b8d97e65e23237f5126a41343bca8f22a0414df5f0e6777e36f51c", + "size": 21593613 + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/riscv32-esp-elf-gdb-11.2_20220823-i686-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-gdb-11.2_20220823-i686-w64-mingw32.zip", + "checksum": "SHA-256:20cdee8a1c01428363ef02f4cc8035c65508d6b43560c525733eae94b7c7bb50", + "size": 23436802 + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/riscv32-esp-elf-gdb-11.2_20220823-x86_64-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-gdb-11.2_20220823-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:add72366485b784b66837ce263548980f1df144d0954c42d75a81f6acbd43cac", + "size": 24802315 + } + ] + }, + { + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20241016", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-linux-amd64-0.12.0-esp32-20241016.tar.gz", + "archiveFileName": "openocd-esp32-linux-amd64-0.12.0-esp32-20241016.tar.gz", + "checksum": "SHA-256:e82b0f036dc99244bead5f09a86e91bb2365cbcd1122ac68261e5647942485df", + "size": "2398717" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-linux-arm64-0.12.0-esp32-20241016.tar.gz", + "archiveFileName": "openocd-esp32-linux-arm64-0.12.0-esp32-20241016.tar.gz", + "checksum": "SHA-256:8f8daf5bd22ec5d2fa9257b0862ec33da18ee677e023fb9a9eb17f74ce208c76", + "size": "2271584" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-linux-armel-0.12.0-esp32-20241016.tar.gz", + "archiveFileName": "openocd-esp32-linux-armel-0.12.0-esp32-20241016.tar.gz", + "checksum": "SHA-256:bc9c020ecf20e2000f76cffa44305fd5bc44d2e688ea78cce423399d33f19767", + "size": "2414206" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-macos-0.12.0-esp32-20241016.tar.gz", + "archiveFileName": "openocd-esp32-macos-0.12.0-esp32-20241016.tar.gz", + "checksum": "SHA-256:02a2dffe801a2d005fa9e614d80ff8173395b2cb0b5d3118d0229d094a9946a7", + "size": "2508089" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-macos-arm64-0.12.0-esp32-20241016.tar.gz", + "archiveFileName": "openocd-esp32-macos-arm64-0.12.0-esp32-20241016.tar.gz", + "checksum": "SHA-256:c382f9e884d6565cb6089bff5f200f4810994667d885f062c3d3c5625a0fa9d6", + "size": "2552569" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-win32-0.12.0-esp32-20241016.zip", + "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20241016.zip", + "checksum": "SHA-256:3b5d615e0a72cc771a45dd469031312d5881c01d7b6bc9edb29b8b6bda8c2e90", + "size": "2946244" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-win64-0.12.0-esp32-20241016.zip", + "archiveFileName": "openocd-esp32-win64-0.12.0-esp32-20241016.zip", + "checksum": "SHA-256:5e7b2fd1947d3a8625f6a11db7a2340cf2f41ff4c61284c022c7d7c32b18780a", + "size": "2946244" + } + ] + }, + { + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20240821", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240821/openocd-esp32-linux-amd64-0.12.0-esp32-20240821.tar.gz", + "archiveFileName": "openocd-esp32-linux-amd64-0.12.0-esp32-20240821.tar.gz", + "checksum": "SHA-256:f8c68541fa38307bc0c0763b7e1e3fe4e943d5d45da07d817a73b492e103b652", + "size": "2373094" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240821/openocd-esp32-linux-arm64-0.12.0-esp32-20240821.tar.gz", + "archiveFileName": "openocd-esp32-linux-arm64-0.12.0-esp32-20240821.tar.gz", + "checksum": "SHA-256:4d6e263d84e447354dc685848557d6c284dda7fe007ee451f729a7edfa7baad7", + "size": "2251272" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240821/openocd-esp32-linux-armel-0.12.0-esp32-20240821.tar.gz", + "archiveFileName": "openocd-esp32-linux-armel-0.12.0-esp32-20240821.tar.gz", + "checksum": "SHA-256:9d45679f2c4cf450d5e2350047cf57bb76dde2487d30cebce0a72c9173b5c45b", + "size": "2390074" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240821/openocd-esp32-macos-0.12.0-esp32-20240821.tar.gz", + "archiveFileName": "openocd-esp32-macos-0.12.0-esp32-20240821.tar.gz", + "checksum": "SHA-256:565c8fabc5f19a6e7a0864a294d74b307eec30b9291d16d3fc90e273f0330cb4", + "size": "2485320" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240821/openocd-esp32-macos-arm64-0.12.0-esp32-20240821.tar.gz", + "archiveFileName": "openocd-esp32-macos-arm64-0.12.0-esp32-20240821.tar.gz", + "checksum": "SHA-256:68c5c7cf3d15b9810939a5edabc6ff2c9f4fc32262de91fc292a180bc5cc0637", + "size": "2530336" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240821/openocd-esp32-win32-0.12.0-esp32-20240821.zip", + "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20240821.zip", + "checksum": "SHA-256:463fc2903ddaf03f86ff50836c5c63cc696550b0446140159eddfd2e85570c5d", + "size": "2916409" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240821/openocd-esp32-win64-0.12.0-esp32-20240821.zip", + "archiveFileName": "openocd-esp32-win64-0.12.0-esp32-20240821.zip", + "checksum": "SHA-256:550f57369f1f1f6cc600b5dffa3378fd6164d8ea8db7c567cf41091771f090cb", + "size": "2916408" + } + ] + }, + { + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20240318", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240318/openocd-esp32-linux-amd64-0.12.0-esp32-20240318.tar.gz", + "archiveFileName": "openocd-esp32-linux-amd64-0.12.0-esp32-20240318.tar.gz", + "checksum": "SHA-256:cf26c5cef4f6b04aa23cd2778675604e5a74a4ce4d8d17b854d05fbcb782d52c", + "size": "2252682" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240318/openocd-esp32-linux-arm64-0.12.0-esp32-20240318.tar.gz", + "archiveFileName": "openocd-esp32-linux-arm64-0.12.0-esp32-20240318.tar.gz", + "checksum": "SHA-256:9b97a37aa2cab94424a778c25c0b4aa0f90d6ef9cda764a1d9289d061305f4b7", + "size": "2132904" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240318/openocd-esp32-linux-armel-0.12.0-esp32-20240318.tar.gz", + "archiveFileName": "openocd-esp32-linux-armel-0.12.0-esp32-20240318.tar.gz", + "checksum": "SHA-256:b7e82776ec374983807d3389df09c632ad9bc8341f2075690b6b500319dfeaf4", + "size": "2271761" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240318/openocd-esp32-macos-0.12.0-esp32-20240318.tar.gz", + "archiveFileName": "openocd-esp32-macos-0.12.0-esp32-20240318.tar.gz", + "checksum": "SHA-256:b16c3082c94df1079367c44d99f7a8605534cd48aabc18898e46e94a2c8c57e7", + "size": "2365588" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240318/openocd-esp32-macos-arm64-0.12.0-esp32-20240318.tar.gz", + "archiveFileName": "openocd-esp32-macos-arm64-0.12.0-esp32-20240318.tar.gz", + "checksum": "SHA-256:534ec925ae6e35e869e4e4e6e4d2c4a1eb081f97ebcc2dd5efdc52d12f4c2f86", + "size": "2406377" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240318/openocd-esp32-win32-0.12.0-esp32-20240318.zip", + "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20240318.zip", + "checksum": "SHA-256:d379329eba052435173ab0d69c9b15bc164a6ce489e2a67cd11169d2dabff633", + "size": "2783915" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240318/openocd-esp32-win32-0.12.0-esp32-20240318.zip", + "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20240318.zip", + "checksum": "SHA-256:d379329eba052435173ab0d69c9b15bc164a6ce489e2a67cd11169d2dabff633", + "size": "2783915" + } + ] + }, + { + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230921", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-linux-amd64-0.12.0-esp32-20230921.tar.gz", + "archiveFileName": "openocd-esp32-linux-amd64-0.12.0-esp32-20230921.tar.gz", + "checksum": "SHA-256:61e38e0a13a5c1664624ec1c397d7f7d6868554b0d345d3fb1f7294cce38cc4b", + "size": "2193783" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-linux-arm64-0.12.0-esp32-20230921.tar.gz", + "archiveFileName": "openocd-esp32-linux-arm64-0.12.0-esp32-20230921.tar.gz", + "checksum": "SHA-256:6430315dc1b926541c93cef63d2b08982543ad3f9fe6e0d7107c8a518ef20432", + "size": "2062058" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-linux-armel-0.12.0-esp32-20230921.tar.gz", + "archiveFileName": "openocd-esp32-linux-armel-0.12.0-esp32-20230921.tar.gz", + "checksum": "SHA-256:5df16d8a91f013a547f6b3b914c655a9d267996a3b6503031b335ac04a4f8d15", + "size": "2206666" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-macos-0.12.0-esp32-20230921.tar.gz", + "archiveFileName": "openocd-esp32-macos-0.12.0-esp32-20230921.tar.gz", + "checksum": "SHA-256:0a4f764934f488af18cdac2a0d152dd36b4870f3bec1a2d4e25b6b3b7a5258a0", + "size": "2305832" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-macos-arm64-0.12.0-esp32-20230921.tar.gz", + "archiveFileName": "openocd-esp32-macos-arm64-0.12.0-esp32-20230921.tar.gz", + "checksum": "SHA-256:6dce89048f642eb0559a915b6e514f90feb2a95afe21b84f0b0ebf2b27824816", + "size": "2341406" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-win32-0.12.0-esp32-20230921.zip", + "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20230921.zip", + "checksum": "SHA-256:ac9d522a63b0816f64d921547bd55c031788035ced85c067d8e7c2862cb1bd0d", + "size": "2710475" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-win32-0.12.0-esp32-20230921.zip", + "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20230921.zip", + "checksum": "SHA-256:ac9d522a63b0816f64d921547bd55c031788035ced85c067d8e7c2862cb1bd0d", + "size": "2710475" + } + ] + }, + { + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230419", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-linux-amd64-0.12.0-esp32-20230419.tar.gz", + "archiveFileName": "openocd-esp32-linux-amd64-0.12.0-esp32-20230419.tar.gz", + "checksum": "SHA-256:5144e7516cd75a2152b35ecae0a400f7d3d4424c2488fbacc49433564f54c70d", + "size": 2126949 + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-linux-arm64-0.12.0-esp32-20230419.tar.gz", + "archiveFileName": "openocd-esp32-linux-arm64-0.12.0-esp32-20230419.tar.gz", + "checksum": "SHA-256:1c4d900c738fe00730c6033abb6cf1cc6587717dbeee291d5908272d153d329a", + "size": 1989161 + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-linux-armel-0.12.0-esp32-20230419.tar.gz", + "archiveFileName": "openocd-esp32-linux-armel-0.12.0-esp32-20230419.tar.gz", + "checksum": "SHA-256:293258fd67618dd352e1096137ad9f2b801926eaf74ffcd570540ae94ad8ee5c", + "size": 2129727 + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-macos-0.12.0-esp32-20230419.tar.gz", + "archiveFileName": "openocd-esp32-macos-0.12.0-esp32-20230419.tar.gz", + "checksum": "SHA-256:621aad7d011c6817cde9570dfea42c7bcc699458bf43c37706cb4c2f6475a247", + "size": 2237976 + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-macos-arm64-0.12.0-esp32-20230419.tar.gz", + "archiveFileName": "openocd-esp32-macos-arm64-0.12.0-esp32-20230419.tar.gz", + "checksum": "SHA-256:3af7eac3a7de3939731ec4c13fb5d72a8e6ce5e5d274bb9697f5d93039561e42", + "size": 2270699 + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-win32-0.12.0-esp32-20230419.zip", + "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20230419.zip", + "checksum": "SHA-256:f2cb3d9cacfe789c20d3272af846d726a062ce8f2e4ee142bddb27501d7dd7a7", + "size": 2619680 + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-win32-0.12.0-esp32-20230419.zip", + "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20230419.zip", + "checksum": "SHA-256:f2cb3d9cacfe789c20d3272af846d726a062ce8f2e4ee142bddb27501d7dd7a7", + "size": 2619680 + } + ] + }, + { + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20221026", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20221026/openocd-esp32-linux-amd64-0.11.0-esp32-20221026.tar.gz", + "archiveFileName": "openocd-esp32-linux-amd64-0.11.0-esp32-20221026.tar.gz", + "checksum": "SHA-256:ce63e9b1dfab60cc62da5dc2abcc22ba7036c42afe74671c787eb026744e7d0b", + "size": "2051435" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20221026/openocd-esp32-linux-arm64-0.11.0-esp32-20221026.tar.gz", + "archiveFileName": "openocd-esp32-linux-arm64-0.11.0-esp32-20221026.tar.gz", + "checksum": "SHA-256:fe60a3a603e8c6bee47367e40fcb8c0da3a38e01163e9674ebc919b067700506", + "size": "1993843" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20221026/openocd-esp32-linux-armel-0.11.0-esp32-20221026.tar.gz", + "archiveFileName": "openocd-esp32-linux-armel-0.11.0-esp32-20221026.tar.gz", + "checksum": "SHA-256:6ef76101cca196a4be30fc74f191eff34abb423e32930a383012b866c9b76135", + "size": "2092111" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20221026/openocd-esp32-macos-0.11.0-esp32-20221026.tar.gz", + "archiveFileName": "openocd-esp32-macos-0.11.0-esp32-20221026.tar.gz", + "checksum": "SHA-256:8edc666a0a230432554b73df7c62e0b5ec21fb018e7fda13b11a7ca8b6c1763b", + "size": "2199855" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20221026/openocd-esp32-macos-arm64-0.11.0-esp32-20221026.tar.gz", + "archiveFileName": "openocd-esp32-macos-arm64-0.11.0-esp32-20221026.tar.gz", + "checksum": "SHA-256:c426c0158ba6488e2f432f7c5b22e79155b5b0fae6d1ad5bbd7894723b43aa12", + "size": "2247179" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20221026/openocd-esp32-win32-0.11.0-esp32-20221026.zip", + "archiveFileName": "openocd-esp32-win32-0.11.0-esp32-20221026.zip", + "checksum": "SHA-256:e0e789d35308c029c6b53457cf4a42a5620cb1a3014740026c089c2ed4fd77b2", + "size": "2493214" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20221026/openocd-esp32-win32-0.11.0-esp32-20221026.zip", + "archiveFileName": "openocd-esp32-win32-0.11.0-esp32-20221026.zip", + "checksum": "SHA-256:e0e789d35308c029c6b53457cf4a42a5620cb1a3014740026c089c2ed4fd77b2", + "size": "2493214" + } + ] + }, + { + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20220706", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20220706/openocd-esp32-win32-0.11.0-esp32-20220706.zip", + "archiveFileName": "openocd-esp32-win32-0.11.0-esp32-20220706.zip", + "checksum": "SHA-256:c3d39eb4365a9947e71f1d3780ce031185bc6437f21186568a5c05f23f57a8d0", + "size": "2608736" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20220706/openocd-esp32-win32-0.11.0-esp32-20220706.zip", + "archiveFileName": "openocd-esp32-win32-0.11.0-esp32-20220706.zip", + "checksum": "SHA-256:c3d39eb4365a9947e71f1d3780ce031185bc6437f21186568a5c05f23f57a8d0", + "size": "2608736" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20220706/openocd-esp32-macos-0.11.0-esp32-20220706.tar.gz", + "archiveFileName": "openocd-esp32-macos-0.11.0-esp32-20220706.tar.gz", + "checksum": "SHA-256:333ee2ec3c9b5dc6ad4509faae55335cdea7f8bf83a56bfcf5327e4497c8538a", + "size": "2077882" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20220706/openocd-esp32-linux-amd64-0.11.0-esp32-20220706.tar.gz", + "archiveFileName": "openocd-esp32-linux-amd64-0.11.0-esp32-20220706.tar.gz", + "checksum": "SHA-256:26f1f18dd93eb70a13203848d3fb1cc2e0de1fd6749c7dd771b2de8709735aed", + "size": "2011201" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20220706/openocd-esp32-linux-amd64-0.11.0-esp32-20220706.tar.gz", + "archiveFileName": "openocd-esp32-linux-amd64-0.11.0-esp32-20220706.tar.gz", + "checksum": "SHA-256:26f1f18dd93eb70a13203848d3fb1cc2e0de1fd6749c7dd771b2de8709735aed", + "size": "2011201" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20220706/openocd-esp32-linux-armhf-0.11.0-esp32-20220706.tar.gz", + "archiveFileName": "openocd-esp32-linux-armhf-0.11.0-esp32-20220706.tar.gz", + "checksum": "SHA-256:7f3b57332104e8b8e6194553365a70a9d3754878cfc063d5dc5d839513a63de9", + "size": "1902964" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20220706/openocd-esp32-linux-arm64-0.11.0-esp32-20220706.tar.gz", + "archiveFileName": "openocd-esp32-linux-arm64-0.11.0-esp32-20220706.tar.gz", + "checksum": "SHA-256:f97792bc2852937ec0accb9f0eb2e49926c0f747a71f101a4e34aed75d2c6fcc", + "size": "1954685" + } + ] + }, + { + "name": "esptool_py", + "version": "4.9.dev3", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC3/esptool-v4.9.dev3-linux-amd64.tar.gz", + "archiveFileName": "esptool-v4.9.dev3-linux-amd64.tar.gz", + "checksum": "SHA-256:4ecaf51836cbf4ea3c19840018bfef3b0b8cd8fc3c95f6e1e043ca5bbeab9bf0", + "size": "64958202" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC3/esptool-v4.9.dev3-linux-armv7.tar.gz", + "archiveFileName": "esptool-v4.9.dev3-linux-armv7.tar.gz", + "checksum": "SHA-256:fff818573bce483ee793ac83c8211f6abf764aa3350f198228859f696a0a0b36", + "size": "31530030" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC3/esptool-v4.9.dev3-linux-aarch64.tar.gz", + "archiveFileName": "esptool-v4.9.dev3-linux-aarch64.tar.gz", + "checksum": "SHA-256:5b274bdff2f62e6a07c3c1dfa51b1128924621f661747eca3dbe0f77972f2f06", + "size": "33663882" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC3/esptool-v4.9.dev3-macos-amd64.tar.gz", + "archiveFileName": "esptool-v4.9.dev3-macos-amd64.tar.gz", + "checksum": "SHA-256:c733c83b58fcf5f642fbb2fddb8ff24640c2c785126cba0821fb70c4a5ceea7a", + "size": "32767836" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC3/esptool-v4.9.dev3-macos-arm64.tar.gz", + "archiveFileName": "esptool-v4.9.dev3-macos-arm64.tar.gz", + "checksum": "SHA-256:83c195a15981e6a5e7a130db2ccfb21e2d8093912e5b003681f9a5abadd71af7", + "size": "30121441" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC3/esptool-v4.9.dev3-win64.zip", + "archiveFileName": "esptool-v4.9.dev3-win64.zip", + "checksum": "SHA-256:890051a4fdc684ff6f4af18d0bb27d274ca940ee0eef716a9455f8c64b25b215", + "size": "36072564" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/3.1.0-RC3/esptool-v4.9.dev3-win64.zip", + "archiveFileName": "esptool-v4.9.dev3-win64.zip", + "checksum": "SHA-256:890051a4fdc684ff6f4af18d0bb27d274ca940ee0eef716a9455f8c64b25b215", + "size": "36072564" + } + ] + }, + { + "name": "esptool_py", + "version": "4.6", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.9/esptool-v4.6-src.tar.gz", + "archiveFileName": "esptool-v4.6-src.tar.gz", + "checksum": "SHA-256:22f9bad0cd1cea14e554ac1f4a6d8f67415ff7029a66ce9130756276e7264e5a", + "size": "99141" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.9/esptool-v4.6-src.tar.gz", + "archiveFileName": "esptool-v4.6-src.tar.gz", + "checksum": "SHA-256:22f9bad0cd1cea14e554ac1f4a6d8f67415ff7029a66ce9130756276e7264e5a", + "size": "99141" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.9/esptool-v4.6-src.tar.gz", + "archiveFileName": "esptool-v4.6-src.tar.gz", + "checksum": "SHA-256:22f9bad0cd1cea14e554ac1f4a6d8f67415ff7029a66ce9130756276e7264e5a", + "size": "99141" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.9/esptool-v4.6-src.tar.gz", + "archiveFileName": "esptool-v4.6-src.tar.gz", + "checksum": "SHA-256:22f9bad0cd1cea14e554ac1f4a6d8f67415ff7029a66ce9130756276e7264e5a", + "size": "99141" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.9/esptool-v4.6-macos.tar.gz", + "archiveFileName": "esptool-v4.6-macos.tar.gz", + "checksum": "SHA-256:885ec69fcffdcb9e7c6eacd2589f13a45ce6bcb6742bea368ec3a73bcca6dd59", + "size": "5851297" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.9/esptool-v4.6-win64.zip", + "archiveFileName": "esptool-v4.6-win64.zip", + "checksum": "SHA-256:c7c68cd1aa520cbfce488ff6a77818ece272272eb012831b9d9ab1280a7c393f", + "size": "6638480" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.9/esptool-v4.6-win64.zip", + "archiveFileName": "esptool-v4.6-win64.zip", + "checksum": "SHA-256:c7c68cd1aa520cbfce488ff6a77818ece272272eb012831b9d9ab1280a7c393f", + "size": "6638480" + } + ] + }, + { + "name": "esptool_py", + "version": "4.5.1", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-src.tar.gz", + "archiveFileName": "esptool-v4.5.1-src.tar.gz", + "checksum": "SHA-256:aa06831a7d88d8ccde4ea21241e983a08dbdae967290e181658b0d18bffc8f86", + "size": "96922" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-src.tar.gz", + "archiveFileName": "esptool-v4.5.1-src.tar.gz", + "checksum": "SHA-256:aa06831a7d88d8ccde4ea21241e983a08dbdae967290e181658b0d18bffc8f86", + "size": "96922" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-src.tar.gz", + "archiveFileName": "esptool-v4.5.1-src.tar.gz", + "checksum": "SHA-256:aa06831a7d88d8ccde4ea21241e983a08dbdae967290e181658b0d18bffc8f86", + "size": "96922" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-src.tar.gz", + "archiveFileName": "esptool-v4.5.1-src.tar.gz", + "checksum": "SHA-256:aa06831a7d88d8ccde4ea21241e983a08dbdae967290e181658b0d18bffc8f86", + "size": "96922" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-macos.tar.gz", + "archiveFileName": "esptool-v4.5.1-macos.tar.gz", + "checksum": "SHA-256:78b52acfd51541ceb97cee893b7d4d49b8ddc284602be8c73ea47e3d849e0956", + "size": "5850888" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-win64.zip", + "archiveFileName": "esptool-v4.5.1-win64.zip", + "checksum": "SHA-256:64d0c24499d46b80d6bd7a05c98bdacc3455ab6d503cc2a99e35711310216045", + "size": "6638448" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-win64.zip", + "archiveFileName": "esptool-v4.5.1-win64.zip", + "checksum": "SHA-256:64d0c24499d46b80d6bd7a05c98bdacc3455ab6d503cc2a99e35711310216045", + "size": "6638448" + } + ] + }, + { + "name": "esptool_py", + "version": "4.5", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.6/esptool-v4.5-src.tar.gz", + "archiveFileName": "esptool-v4.5-src.tar.gz", + "checksum": "SHA-256:0f5d20c4624d913c3c994db57da3c4e5a43bd8437351d9b789f79d3f1b057292", + "size": "96621" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.6/esptool-v4.5-src.tar.gz", + "archiveFileName": "esptool-v4.5-src.tar.gz", + "checksum": "SHA-256:0f5d20c4624d913c3c994db57da3c4e5a43bd8437351d9b789f79d3f1b057292", + "size": "96621" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.6/esptool-v4.5-src.tar.gz", + "archiveFileName": "esptool-v4.5-src.tar.gz", + "checksum": "SHA-256:0f5d20c4624d913c3c994db57da3c4e5a43bd8437351d9b789f79d3f1b057292", + "size": "96621" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.6/esptool-v4.5-src.tar.gz", + "archiveFileName": "esptool-v4.5-src.tar.gz", + "checksum": "SHA-256:0f5d20c4624d913c3c994db57da3c4e5a43bd8437351d9b789f79d3f1b057292", + "size": "96621" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.6/esptool-v4.5-macos.tar.gz", + "archiveFileName": "esptool-v4.5-macos.tar.gz", + "checksum": "SHA-256:adcce051f282a19f78da30717ff0e4334b0edaf16a7f14d185ba4cae464586e2", + "size": "5850835" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.6/esptool-v4.5-win64.zip", + "archiveFileName": "esptool-v4.5-win64.zip", + "checksum": "SHA-256:a55c5f7d490fbd2cd5fdf486d71f2ed13e3304482d54374b6aa23d42c9b98a96", + "size": "6639416" + } + ] + }, + { + "name": "esptool_py", + "version": "4.2.1", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-windows.zip", + "archiveFileName": "esptool-4.2.1-windows.zip", + "checksum": "SHA-256:582560067bfbd9895f4862eb5fdf87558ddee5d4d30e7575c9b8bcb0dd60fd94", + "size": "6368279" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-windows.zip", + "archiveFileName": "esptool-4.2.1-windows.zip", + "checksum": "SHA-256:582560067bfbd9895f4862eb5fdf87558ddee5d4d30e7575c9b8bcb0dd60fd94", + "size": "6368279" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-macos.tar.gz", + "archiveFileName": "esptool-4.2.1-macos.tar.gz", + "checksum": "SHA-256:a984f7ad8bdb40c42d0d368bf4bb21b69a9587aed46b7b6d7de23ca58a3f150d", + "size": "5816598" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-linux.tar.gz", + "archiveFileName": "esptool-4.2.1-linux.tar.gz", + "checksum": "SHA-256:5a45fb77eb6574554ec2f45230d0b350f26f9c24ab3b6c13c4031ebdf72a34ab", + "size": "90123" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-linux.tar.gz", + "archiveFileName": "esptool-4.2.1-linux.tar.gz", + "checksum": "SHA-256:5a45fb77eb6574554ec2f45230d0b350f26f9c24ab3b6c13c4031ebdf72a34ab", + "size": "90123" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-linux.tar.gz", + "archiveFileName": "esptool-4.2.1-linux.tar.gz", + "checksum": "SHA-256:5a45fb77eb6574554ec2f45230d0b350f26f9c24ab3b6c13c4031ebdf72a34ab", + "size": "90123" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-linux.tar.gz", + "archiveFileName": "esptool-4.2.1-linux.tar.gz", + "checksum": "SHA-256:5a45fb77eb6574554ec2f45230d0b350f26f9c24ab3b6c13c4031ebdf72a34ab", + "size": "90123" + } + ] + }, + { + "name": "esptool_py", + "version": "3.3.0", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-windows.zip", + "archiveFileName": "esptool-3.3-windows.zip", + "checksum": "SHA-256:55a1d7165414bf4dbd2bb16ca094e555d671958450f5d1536b457a518d2b15df", + "size": "7436864" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-windows.zip", + "archiveFileName": "esptool-3.3-windows.zip", + "checksum": "SHA-256:55a1d7165414bf4dbd2bb16ca094e555d671958450f5d1536b457a518d2b15df", + "size": "7436864" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-macos.tar.gz", + "archiveFileName": "esptool-3.3-macos.tar.gz", + "checksum": "SHA-256:3e5f7b521ae33c8c63f3b48efc909c08f37bef1a083c0eafa408312c09900afd", + "size": "6944975" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-linux.tar.gz", + "archiveFileName": "esptool-3.3-linux.tar.gz", + "checksum": "SHA-256:fbe91a49e5f5deca4881f5eed32e8903faf97bfd365fe2d0d1512b80bdb67f5e", + "size": "97026" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-linux.tar.gz", + "archiveFileName": "esptool-3.3-linux.tar.gz", + "checksum": "SHA-256:fbe91a49e5f5deca4881f5eed32e8903faf97bfd365fe2d0d1512b80bdb67f5e", + "size": "97026" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-linux.tar.gz", + "archiveFileName": "esptool-3.3-linux.tar.gz", + "checksum": "SHA-256:fbe91a49e5f5deca4881f5eed32e8903faf97bfd365fe2d0d1512b80bdb67f5e", + "size": "97026" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-linux.tar.gz", + "archiveFileName": "esptool-3.3-linux.tar.gz", + "checksum": "SHA-256:fbe91a49e5f5deca4881f5eed32e8903faf97bfd365fe2d0d1512b80bdb67f5e", + "size": "97026" + } + ] + }, + { + "name": "esptool_py", + "version": "3.1.0", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.0-alpha1/esptool-3.1.0-windows.zip", + "archiveFileName": "esptool-3.1.0-windows.zip", + "checksum": "SHA-256:c9b4f9bc6e94db136c2545c87c00c7ab1441644ca0bac50811bc3c014e22514b", + "size": "7411889" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.0-alpha1/esptool-3.1.0-macos.tar.gz", + "archiveFileName": "esptool-3.1.0-macos.tar.gz", + "checksum": "SHA-256:1dffcb884665fb616779aea62a68f517aac251ea6dfe95560906c364d6ef3065", + "size": "6776909" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.0-alpha1/esptool-3.1.0-linux.tar.gz", + "archiveFileName": "esptool-3.1.0-linux.tar.gz", + "checksum": "SHA-256:15eca9896a30e804aa24be6f7a06e39397541b8b09a7a4c48deb65f826e7baad", + "size": "80550" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.0-alpha1/esptool-3.1.0-linux.tar.gz", + "archiveFileName": "esptool-3.1.0-linux.tar.gz", + "checksum": "SHA-256:15eca9896a30e804aa24be6f7a06e39397541b8b09a7a4c48deb65f826e7baad", + "size": "80550" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.0-alpha1/esptool-3.1.0-linux.tar.gz", + "archiveFileName": "esptool-3.1.0-linux.tar.gz", + "checksum": "SHA-256:15eca9896a30e804aa24be6f7a06e39397541b8b09a7a4c48deb65f826e7baad", + "size": "80550" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.0-alpha1/esptool-3.1.0-linux.tar.gz", + "archiveFileName": "esptool-3.1.0-linux.tar.gz", + "checksum": "SHA-256:15eca9896a30e804aa24be6f7a06e39397541b8b09a7a4c48deb65f826e7baad", + "size": "80550" + } + ] + }, + { + "name": "esptool_py", + "version": "3.0.0", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5-rc5/esptool-3.0.0.2-windows.zip", + "archiveFileName": "esptool-3.0.0.2-windows.zip", + "checksum": "SHA-256:b192bfc1545a3c92658ce586b4edcc2aca3f0ad4b3fa8417d658bc8a48f1387e", + "size": "3434736" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5-rc5/esptool-3.0.0.2-macos.tar.gz", + "archiveFileName": "esptool-3.0.0.2-macos.tar.gz", + "checksum": "SHA-256:2cafab7f1ebce89475b84c115548eaace40b6366d7b3f9862cdb2fc64f806643", + "size": "3859642" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5-rc5/esptool-3.0.0.2-linux.tar.gz", + "archiveFileName": "esptool-3.0.0.2-linux.tar.gz", + "checksum": "SHA-256:d5cb51da1c74ff69f81b820470d2ecccb5c7c3a2dec7776483d4c89588b00020", + "size": "57526" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5-rc5/esptool-3.0.0.2-linux.tar.gz", + "archiveFileName": "esptool-3.0.0.2-linux.tar.gz", + "checksum": "SHA-256:d5cb51da1c74ff69f81b820470d2ecccb5c7c3a2dec7776483d4c89588b00020", + "size": "57526" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5-rc5/esptool-3.0.0.2-linux.tar.gz", + "archiveFileName": "esptool-3.0.0.2-linux.tar.gz", + "checksum": "SHA-256:d5cb51da1c74ff69f81b820470d2ecccb5c7c3a2dec7776483d4c89588b00020", + "size": "57526" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5-rc5/esptool-3.0.0.2-linux.tar.gz", + "archiveFileName": "esptool-3.0.0.2-linux.tar.gz", + "checksum": "SHA-256:d5cb51da1c74ff69f81b820470d2ecccb5c7c3a2dec7776483d4c89588b00020", + "size": "57526" + } + ] + }, + { + "version": "2.6.1", + "name": "esptool_py", + "systems": [ + { + "url": "https://dl.espressif.com/dl/esptool-2.6.1-windows.zip", + "checksum": "SHA-256:84cf0b369a7707fe566434faba148852fc464992111d5baa95b658b374802f96", + "host": "i686-mingw32", + "archiveFileName": "esptool-2.6.1-windows.zip", + "size": "3422445" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.6.1-macos.tar.gz", + "checksum": "SHA-256:f4eb758a301d6902cc9dfcd49d36345d2f075ad123da7cf8132d15cfb7533457", + "host": "x86_64-apple-darwin", + "archiveFileName": "esptool-2.6.1-macos.tar.gz", + "size": "3837085" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.6.1-linux.tar.gz", + "checksum": "SHA-256:eaf82ff4070d9792f6a42ae1e485375de5a87bec59ef01dfb95de901519ec7fb", + "host": "x86_64-pc-linux-gnu", + "archiveFileName": "esptool-2.6.1-linux.tar.gz", + "size": "44762" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.6.1-linux.tar.gz", + "checksum": "SHA-256:eaf82ff4070d9792f6a42ae1e485375de5a87bec59ef01dfb95de901519ec7fb", + "host": "i686-pc-linux-gnu", + "archiveFileName": "esptool-2.6.1-linux.tar.gz", + "size": "44762" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.6.1-linux.tar.gz", + "checksum": "SHA-256:eaf82ff4070d9792f6a42ae1e485375de5a87bec59ef01dfb95de901519ec7fb", + "host": "arm-linux-gnueabihf", + "archiveFileName": "esptool-2.6.1-linux.tar.gz", + "size": "44762" + } + ] + }, + { + "version": "2.6.0", + "name": "esptool_py", + "systems": [ + { + "url": "https://dl.espressif.com/dl/esptool-2.6.0-windows.zip", + "checksum": "SHA-256:a73f4cf68db240d7f1d250c5c7f2dfcb53c17a37483729f1bf71f8f43d79a799", + "host": "i686-mingw32", + "archiveFileName": "esptool-2.6.0-windows.zip", + "size": "3421208" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.6.0-macos.tar.gz", + "checksum": "SHA-256:0a881b91547c840fab8c72ae3d031069384278b8c2e5241647e8c8292c5e4a4b", + "host": "x86_64-apple-darwin", + "archiveFileName": "esptool-2.6.0-macos.tar.gz", + "size": "3835660" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.6.0-linux.tar.gz", + "checksum": "SHA-256:6d162f70f395ca31f5008829dd7e833e729f044a9c7355d5be8ce333a054e110", + "host": "x86_64-pc-linux-gnu", + "archiveFileName": "esptool-2.6.0-linux.tar.gz", + "size": "43535" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.6.0-linux.tar.gz", + "checksum": "SHA-256:6d162f70f395ca31f5008829dd7e833e729f044a9c7355d5be8ce333a054e110", + "host": "i686-pc-linux-gnu", + "archiveFileName": "esptool-2.6.0-linux.tar.gz", + "size": "43535" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.6.0-linux.tar.gz", + "checksum": "SHA-256:6d162f70f395ca31f5008829dd7e833e729f044a9c7355d5be8ce333a054e110", + "host": "arm-linux-gnueabihf", + "archiveFileName": "esptool-2.6.0-linux.tar.gz", + "size": "43535" + } + ] + }, + { + "version": "3.0.0-gnu12-dc7f933", + "name": "mklittlefs", + "systems": [ + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu12/aarch64-linux-gnu.mklittlefs-c41e51a.200706.tar.gz", + "archiveFileName": "aarch64-linux-gnu.mklittlefs-c41e51a.200706.tar.gz", + "checksum": "SHA-256:fc56e389383749e4cf4fab0fcf75cc0ebc41e59383caf6c2eff1c3d9794af200", + "size": "44651" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu12/arm-linux-gnueabihf.mklittlefs-c41e51a.200706.tar.gz", + "archiveFileName": "arm-linux-gnueabihf.mklittlefs-c41e51a.200706.tar.gz", + "checksum": "SHA-256:52b642dd0545eb3bd8dfb75dde6601df21700e4867763fd2696274be279294c5", + "size": "37211" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu12/i686-linux-gnu.mklittlefs-c41e51a.200706.tar.gz", + "archiveFileName": "i686-linux-gnu.mklittlefs-c41e51a.200706.tar.gz", + "checksum": "SHA-256:7886051d8ccc54aed0af2e7cdf6ff992bb51638df86f3b545955697720b6d062", + "size": "48033" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu12/i686-w64-mingw32.mklittlefs-c41e51a.200706.zip", + "archiveFileName": "i686-w64-mingw32.mklittlefs-c41e51a.200706.zip", + "checksum": "SHA-256:43740db30ce451454f2337331f10ab4ed41bd83dbf0fa0cb4387107388b59f42", + "size": "332655" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu12/x86_64-apple-darwin14.mklittlefs-c41e51a.200706.tar.gz", + "archiveFileName": "x86_64-apple-darwin14.mklittlefs-c41e51a.200706.tar.gz", + "checksum": "SHA-256:e3edd5e05b70db3c7df6b9d626558348ad04804022fe955c799aeb51808c7dc3", + "size": "362608" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu12/x86_64-linux-gnu.mklittlefs-c41e51a.200706.tar.gz", + "archiveFileName": "x86_64-linux-gnu.mklittlefs-c41e51a.200706.tar.gz", + "checksum": "SHA-256:66e84dda0aad747517da3785125e05738a540948aab2b7eaa02855167a1eea53", + "size": "46778" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu12/x86_64-w64-mingw32.mklittlefs-c41e51a.200706.zip", + "archiveFileName": "x86_64-w64-mingw32.mklittlefs-c41e51a.200706.zip", + "checksum": "SHA-256:2e319077491f8e832e96eb4f2f7a70dd919333cee4b388c394e0e848d031d542", + "size": "345132" + } + ] + }, + { + "name": "mkspiffs", + "version": "0.2.3", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-win32.zip", + "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-win32.zip", + "checksum": "SHA-256:b647f2c2efe6949819c85ea9404271b55c7c9c25bcb98d3b98a1d0ba771adf56", + "size": "249809" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-osx.tar.gz", + "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-osx.tar.gz", + "checksum": "SHA-256:9f43fc74a858cf564966b5035322c3e5e61c31a647c5a1d71b388ed6efc48423", + "size": "130270" + }, + { + "host": "i386-apple-darwin", + "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-osx.tar.gz", + "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-osx.tar.gz", + "checksum": "SHA-256:9f43fc74a858cf564966b5035322c3e5e61c31a647c5a1d71b388ed6efc48423", + "size": "130270" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-linux64.tar.gz", + "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-linux64.tar.gz", + "checksum": "SHA-256:5e1a4ff41385e842f389f6b5254102a547e566a06b49babeffa93ef37115cb5d", + "size": "50646" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-linux32.tar.gz", + "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-linux32.tar.gz", + "checksum": "SHA-256:464463a93e8833209cdc29ba65e1a12fec31718dc10075c195a2445b2c3f6cb0", + "size": "48751" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-linux-armhf.tar.gz", + "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-linux-armhf.tar.gz", + "checksum": "SHA-256:ade3dc00117912ac08a1bdbfbfe76b12d21a34bc5fa1de0cfc45fe7a8d0a0185", + "size": "40665" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-linux-armhf.tar.gz", + "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-linux-armhf.tar.gz", + "checksum": "SHA-256:ade3dc00117912ac08a1bdbfbfe76b12d21a34bc5fa1de0cfc45fe7a8d0a0185", + "size": "40665" + } + ] + }, + { + "name": "esp-xs2", + "version": "2302", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:2ff838520a5003d2768b275f5bb5ead69dd2388c3b7cd9043cb59891ba43147f", + "size": "112199211" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:6d79d5b14fc7129a9b8208d54e19b05dedb565f50f7a96264c9df84b06ad3be0", + "size": "106953064" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:e5bd03b6ad19179b015a93ada9992adc3610036ebf6aeb0835a09c9aadb50a14", + "size": "106026829" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "checksum": "SHA-256:fb45943557b2d201bbb1bdc7514a1872f9bb96c2dfb48b95abdba281cc792f75", + "size": "115288662" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:e965236cb80e45282d16f40184af183e013b63b177bd1884736c463eac636564", + "size": "119711811" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:78a55eec18650b21378d97494989ffe208748e0f49bb2b2d6756b264e1863919", + "size": "106540817" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "checksum": "SHA-256:1e6dac5162ab75f94b88c47ebeabb6600c652fb4f615ed07c1724d037c02fd19", + "size": "131273859" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:8a785cc4e0838cebe404f82c0ead7a0f9ac5fabc660a742e33a41ddac6326cc1", + "size": "135373049" + } + ] + }, + { + "name": "esp-xs3", + "version": "2302", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:61495ffe575e00c6998ae7274ff917658c04bded62ece0937c7042d6dcbf46de", + "size": "111971129" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:9008d395be46fcfe68c7de6edc850fc1595f28323a28e7922e5c085bd310cb90", + "size": "106616800" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:568857bdac7dea389dffc7fbc6871b4af299150a8ecf1bf965f224d2a1655edb", + "size": "105700326" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "checksum": "SHA-256:d122738bcc6c2f52d05fa89b2fb1afe6a7894cda8a07a1879aca867a31507ed0", + "size": "115098400" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:7defcddb98788b0991416ad2e0cb6a3b248b8030f22d5d76b8832117cc1494ca", + "size": "119883189" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:b59e076f8e4b9ca99535d449f9fc4cbb443188051dce4ad934e38f16b095f8d9", + "size": "106464677" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "checksum": "SHA-256:3ddf51774817e815e5d41c312a90c1159226978fb45fd0d4f7085c567f8b73ab", + "size": "131134034" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:1d15ca65e3508388a86d8bed3048c46d07538f5bc88d3e4296f9c03152087cd1", + "size": "135381926" + } + ] + }, + { + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "checksum": "SHA-256:8ef14e0409c2011b41e504a30f70d3e35287313a795d1f2462ad2cd0e2052d37", + "size": "94397702" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "checksum": "SHA-256:e7d217ac2ef52c746a41f8647840b2717edcd8afc15f081bc1c4505e10a189b7", + "size": "90684219" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "checksum": "SHA-256:ea6631f8a5105ae90d7fc462c10ed4f9049924ea8c2f9391d90b339d5f881dac", + "size": "89954866" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "checksum": "SHA-256:ecb90af9cede0982672234da0b1bd7b7f76eadde60aa5c82eefdf37d64ffe49f", + "size": "96354023" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "checksum": "SHA-256:19af109fda024a3a4c989f7ccaa104f9b1b74cfd6c9363e730bb8cb9b50d5dc4", + "size": "101712946" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-macos-arm64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-macos-arm64.tar.gz", + "checksum": "SHA-256:b14189772d70a96813895fff7731d0f2fec0c825cfc02e002d6d91a0cc4b6b1d", + "size": "93104016" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "checksum": "SHA-256:9851c2cfa355e1fad8abfb643a1c945d27385b1851f3ae468915ea78fcbec940", + "size": "118610020" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "checksum": "SHA-256:a328b3c55631846241bbe7999a309b20b797c8dc50b6e8dccf463e66a2da5fb4", + "size": "121846722" + } + ] + }, + { + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch5", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "checksum": "SHA-256:8ef14e0409c2011b41e504a30f70d3e35287313a795d1f2462ad2cd0e2052d37", + "size": "94397702" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "checksum": "SHA-256:e7d217ac2ef52c746a41f8647840b2717edcd8afc15f081bc1c4505e10a189b7", + "size": "90684219" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "checksum": "SHA-256:ea6631f8a5105ae90d7fc462c10ed4f9049924ea8c2f9391d90b339d5f881dac", + "size": "89954866" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "checksum": "SHA-256:ecb90af9cede0982672234da0b1bd7b7f76eadde60aa5c82eefdf37d64ffe49f", + "size": "96354023" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "checksum": "SHA-256:19af109fda024a3a4c989f7ccaa104f9b1b74cfd6c9363e730bb8cb9b50d5dc4", + "size": "101712946" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "checksum": "SHA-256:9851c2cfa355e1fad8abfb643a1c945d27385b1851f3ae468915ea78fcbec940", + "size": "118610020" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "checksum": "SHA-256:a328b3c55631846241bbe7999a309b20b797c8dc50b6e8dccf463e66a2da5fb4", + "size": "121846722" + } + ] + }, + { + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz", + "checksum": "SHA-256:9edd1e77627688f435561922d14299f6a0021ba1f6ff67e472e1108695a69e53", + "size": "90569312" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-linux-arm64.tar.gz", + "checksum": "SHA-256:3a21a3e310e6b1e7d7bed1f3e59698a5bd29ed3a5ca79fba9265d7dd2f1e0cd2", + "size": "86838362" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-linux-armel.tar.gz", + "checksum": "SHA-256:89313c4c1d8db1b01624f31b58bf3fbe527160569828ac4301e9daa75c52716d", + "size": "86187540" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-linux-i686.tar.gz", + "checksum": "SHA-256:a1f165a836f175daa6fbfde4ca99cb93b377f021fbfc41f79a700bd4df965a9a", + "size": "92580267" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz", + "checksum": "SHA-256:dda3d7a43efd995d9a51d5a5741626dbf915df46078aef0b5aea7163ac82398b", + "size": "97807647" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-win32.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-win32.zip", + "checksum": "SHA-256:fd147592928ef2d7092ba34b01ecd776fe26ba3d7e3f9b6b215a3b46e981ee2c", + "size": "116464819" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-win64.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-win64.zip", + "checksum": "SHA-256:9395315c07de0b9f05c9a6616ba1f05e76ab651053f2f40479163a8e03cfa830", + "size": "119511910" + } + ] + }, + { + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz", + "checksum": "SHA-256:3eb3d68b27fa6ba5af6f88da21cb8face9be0094daaa8960793cfe570ab785ff", + "size": "90565318" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-arm64.tar.gz", + "checksum": "SHA-256:aa534be24e45e06b7080a6a3bb8cd9e3cfb818f5f8bce2244d7cfb5e91336541", + "size": "86860292" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-armel.tar.gz", + "checksum": "SHA-256:f0e49ce06fe7833ff5d76961dc2dac5449d320f823bb8c05a302cf85a3a6eb04", + "size": "86183421" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-i686.tar.gz", + "checksum": "SHA-256:06de09b74652de43e5b22db3b7fc992623044baa75e9faaab68317a986715ba3", + "size": "92582250" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-macos.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-macos.tar.gz", + "checksum": "SHA-256:96443f69c8569417c780ee749d91ef33cffe22153fffa30a0fbf12107d87381b", + "size": "97808961" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-win32.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-win32.zip", + "checksum": "SHA-256:076a4171bdc33e5ced3952efffb233d70263dfa760e636704050597a9edf61db", + "size": "112578260" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-win64.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-win64.zip", + "checksum": "SHA-256:c35b7998f7f503e0cb22055d1e279ae14b6b0e09bb3ff3846b17d552ece9c247", + "size": "115278695" + } + ] + }, + { + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r1", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz", + "checksum": "SHA-256:44a0b467b9d2b759ab48b2f27aed684581f33c96e2842992781c4e045992c5b0", + "size": "86361217" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz", + "checksum": "SHA-256:fdacdb2a7bbf6293bcafda9b52463a4da8a2f3b7e1df9f83d35ff9d1efa22012", + "size": "84520407" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz", + "checksum": "SHA-256:e2024096492dfaa50fc6ac336cd8faa2e395e8cebb617753eab0b5f16d3dd0dc", + "size": "88375391" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-macos.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r1-macos.tar.gz", + "checksum": "SHA-256:7bbc6a2b94f009cd8a3351b9c7acf7a5caa1c4d3700500ead60f84965386a61b", + "size": "93357296" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-win32.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r1-win32.zip", + "checksum": "SHA-256:e4f9fdda192abfc9807e3e7fcd6e9fea30c1a0cf3f3c5a5c961b5114fc8c9b7e", + "size": "105603626" + } + ] + }, + { + "name": "xtensa-esp32-elf-gcc", + "version": "1.22.0-97-gc752ad5-5.2.0", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5-rc5/xtensa-esp32-elf-win32-1.22.0-97-gc752ad5-5.2.0.zip", + "archiveFileName": "xtensa-esp32-elf-win32-1.22.0-97-gc752ad5-5.2.0.zip", + "checksum": "SHA-256:80571e5d5a63494f4fa758bb9d8fb882ba4059853a8c412a84d232dc1c1400e6", + "size": "125747216" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5-rc5/xtensa-esp32-elf-macos-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "archiveFileName": "xtensa-esp32-elf-macos-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "checksum": "SHA-256:b1ce39a563ae359cf363fb7d8ee80cb1e5226fda83188203cff60f16f55e33ef", + "size": "50525386" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5-rc5/xtensa-esp32-elf-linux64-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "archiveFileName": "xtensa-esp32-elf-linux64-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "checksum": "SHA-256:96f5f6e7611a0ed1dc47048c54c3113fc5cebffbf0ba90d8bfcd497afc7ef9f3", + "size": "44225380" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5-rc5/xtensa-esp32-elf-linux32-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "archiveFileName": "xtensa-esp32-elf-linux32-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "checksum": "SHA-256:8094a2c30b474e99ce64dd0ba8f310c4614eb3b3cac884a3aea0fd5f565af119", + "size": "45575521" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5-rc5/xtensa-esp32-elf-linux-armel-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "archiveFileName": "xtensa-esp32-elf-linux-armel-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "checksum": "SHA-256:d70d550f88448fa476b29fa50ef5502ab497a16ac7fa9ca24c6d0a39bb1e681e", + "size": "50657803" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/1.0.5-rc5/xtensa-esp32-elf-linux-armel-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "archiveFileName": "xtensa-esp32-elf-linux-armel-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "checksum": "SHA-256:d70d550f88448fa476b29fa50ef5502ab497a16ac7fa9ca24c6d0a39bb1e681e", + "size": "50657803" + } + ] + }, + { + "version": "1.22.0-80-g6c4433a-5.2.0", + "name": "xtensa-esp32-elf-gcc", + "systems": [ + { + "url": "https://dl.espressif.com/dl/xtensa-esp32-elf-win32-1.22.0-80-g6c4433a-5.2.0.zip", + "checksum": "SHA-256:f217fccbeaaa8c92db239036e0d6202458de4488b954a3a38f35ac2ec48058a4", + "host": "i686-mingw32", + "archiveFileName": "xtensa-esp32-elf-win32-1.22.0-80-g6c4433a-5.2.0.zip", + "size": "125719261" + }, + { + "url": "https://dl.espressif.com/dl/xtensa-esp32-elf-osx-1.22.0-80-g6c4433a-5.2.0.tar.gz", + "checksum": "SHA-256:a4307a97945d2f2f2745f415fbe80d727750e19f91f9a1e7e2f8a6065652f9da", + "host": "x86_64-apple-darwin", + "archiveFileName": "xtensa-esp32-elf-osx-1.22.0-80-g6c4433a-5.2.0.tar.gz", + "size": "46517409" + }, + { + "url": "https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz", + "checksum": "SHA-256:3fe96c151d46c1d4e5edc6ed690851b8e53634041114bad04729bc16b0445156", + "host": "x86_64-pc-linux-gnu", + "archiveFileName": "xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz", + "size": "44219107" + }, + { + "url": "https://dl.espressif.com/dl/xtensa-esp32-elf-linux32-1.22.0-80-g6c4433a-5.2.0.tar.gz", + "checksum": "SHA-256:b4055695ffc2dfc0bcb6dafdc2572a6e01151c4179ef5fa972b3fcb2183eb155", + "host": "i686-pc-linux-gnu", + "archiveFileName": "xtensa-esp32-elf-linux32-1.22.0-80-g6c4433a-5.2.0.tar.gz", + "size": "45566336" + }, + { + "url": "https://dl.espressif.com/dl/xtensa-esp32-elf-linux-armel-1.22.0-87-gb57bad3-5.2.0.tar.gz", + "checksum": "SHA-256:9c68c87bb23b1256dc0a1859b515946763e5292dcab4a4159a52fae5618ce861", + "host": "arm-linux-gnueabihf", + "archiveFileName": "xtensa-esp32-elf-linux-armel-1.22.0-87-gb57bad3-5.2.0.tar.gz", + "size": "50655584" + } + ] + }, + { + "name": "xtensa-esp32-elf-gcc", + "version": "esp-12.2.0_20230208", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:e8d35938385447cf9c34735fee2a3b2b61cca6be07db77a45856a1c2a347e423", + "size": "111766903" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:569988acfc2673369f222037c64bac96990cee08cebeebc4f8860e0d984f8bd9", + "size": "106473247" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:6a844f16021e936cc9b87b203978356f57ab2144554f6f2a0f73ffa3d3d316c5", + "size": "105576049" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "checksum": "SHA-256:743d6f03a89329bb09f9550d27fcab677f5cf06b4720793bbcef7883a932681d", + "size": "114870843" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:4d32d764e984f3a570aacfb2f4957619540fb4629534d969b2e83997901334c3", + "size": "119424029" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:dc8fa7f4933bf5cb08e83bacce6160cc9dfe93d7aad1e8f92599bb81ff5b2e28", + "size": "106136827" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "checksum": "SHA-256:62bb6428d107ed3f44c212c77ecf24804b74c97327b0f0ad2029c656c6dbd6ee", + "size": "130847086" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:8febfe4a6476efc69012390106c8c660a14418f025137b0513670c72124339cf", + "size": "134985117" + } + ] + }, + { + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "checksum": "SHA-256:19c77bd91fefab7c8c40a6334f9b985e2d9a1c7fac6d424b692110930dd3682f", + "size": "67849099" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "checksum": "SHA-256:bdcd24676ef2a65b670ca9e0a01768ece47f4dfcfb545a3307f76a054c33b522", + "size": "64154532" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "checksum": "SHA-256:b26723b6ce1c35b90f204eb39e5ab06a6f80fb7895f000e16b6962e4c176ae32", + "size": "63448105" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "checksum": "SHA-256:da3b5c45e4997d14269df1814c92dd7004902bb810608341bc3819c3e506fa0b", + "size": "69656104" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "checksum": "SHA-256:8eb63745b44083edef7cc6fdf3b06999f576b75134bc5e8b0ef881ca439b72d7", + "size": "75154138" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-macos-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-macos-arm64.tar.gz", + "checksum": "SHA-256:4cd38d6ec31076c0aa083f62ab84ab5c33aa07fafd0af61366186e5f553aa008", + "size": "66457613" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "checksum": "SHA-256:c758062295804b082fbd77fcd59a356f62d4e76372aaa29589cc871603309cba", + "size": "82338511" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "checksum": "SHA-256:1c1e168ff8bc460a9719f3b216d3c1125d29040389786d738244838499362c74", + "size": "85579252" + } + ] + }, + { + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch5", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "checksum": "SHA-256:19c77bd91fefab7c8c40a6334f9b985e2d9a1c7fac6d424b692110930dd3682f", + "size": "67849099" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "checksum": "SHA-256:bdcd24676ef2a65b670ca9e0a01768ece47f4dfcfb545a3307f76a054c33b522", + "size": "64154532" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "checksum": "SHA-256:b26723b6ce1c35b90f204eb39e5ab06a6f80fb7895f000e16b6962e4c176ae32", + "size": "63448105" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "checksum": "SHA-256:da3b5c45e4997d14269df1814c92dd7004902bb810608341bc3819c3e506fa0b", + "size": "69656104" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "checksum": "SHA-256:8eb63745b44083edef7cc6fdf3b06999f576b75134bc5e8b0ef881ca439b72d7", + "size": "75154138" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "checksum": "SHA-256:c758062295804b082fbd77fcd59a356f62d4e76372aaa29589cc871603309cba", + "size": "82338511" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "checksum": "SHA-256:1c1e168ff8bc460a9719f3b216d3c1125d29040389786d738244838499362c74", + "size": "85579252" + } + ] + }, + { + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz", + "checksum": "SHA-256:a32451a8edc1104b83cd9971178e61826e957d7db9ad9f81798a8969fd5a954e", + "size": "90894048" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-linux-arm64.tar.gz", + "checksum": "SHA-256:2ac2c94a533a99a091d2159c678c611c712c494b5f68d97913254712047260f9", + "size": "87178224" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-linux-armel.tar.gz", + "checksum": "SHA-256:da49afee1e2e03eaab3f492718789442d33b562800e2a892679f95b50be24d14", + "size": "86569314" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-linux-i686.tar.gz", + "checksum": "SHA-256:36d3c4990a5feb68aa8534463bc9e8ee367fe23886f78e1d726f4411c7571462", + "size": "92884013" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz", + "checksum": "SHA-256:de9af641678c93775e932ee5ec4f478f8925cfc1ebc22e41adc4fb85430a0c35", + "size": "98224709" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-win32.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-win32.zip", + "checksum": "SHA-256:ccf08afe60046f87b0e81ca17dc5073eda68ab5e7522c163dd5b583d713b7b39", + "size": "116924759" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-win64.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-win64.zip", + "checksum": "SHA-256:37c91490b8fc75e638c23785e261eaf553be2dcd106cf6cff5b76981fa02955b", + "size": "119912142" + } + ] + }, + { + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz", + "checksum": "SHA-256:a6e0947c92b823ca04f062522249f0a428357e0b056f1ff4c6bcabef83cf63a7", + "size": "90901736" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-arm64.tar.gz", + "checksum": "SHA-256:d2e5600fc194b508bd393b236a09fd62ed70afb6c36619d4b106b696a56ca66d", + "size": "87176557" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-armel.tar.gz", + "checksum": "SHA-256:3fff4199e986dd74660f17ca27d9414cb98f1b911a7f13bb3b22e784cb1156cf", + "size": "86581102" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-i686.tar.gz", + "checksum": "SHA-256:7732f9fb371d36b6b324820e300beecc33c2719921a61cf1cdb5bc625016b346", + "size": "92875986" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-macos.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-macos.tar.gz", + "checksum": "SHA-256:e6dd32782fcff8f633299b97d1c671d6b6513390aca2ddbd7543c2cc62e72d7e", + "size": "98212907" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-win32.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-win32.zip", + "checksum": "SHA-256:41b917b35f6fbe7d30b7de91c32cf348c406acfa729a1eabc450d040dc46fbe2", + "size": "113022469" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-win64.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-win64.zip", + "checksum": "SHA-256:a764c1a0ee743d69f8cbfadbe4426a2c15c0e233b0894244c7cadf3b4d7dd32a", + "size": "115696999" + } + ] + }, + { + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r1", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz", + "checksum": "SHA-256:b127baccfe6949ee7eaf3d0782ea772750a9b8e2732b16ce6bcc9dcd91f7209a", + "size": "86687290" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz", + "checksum": "SHA-256:7ca0d240f11e1c53c01a56257b0c968f876ab405142d1068d8c9b456d939554c", + "size": "84916701" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz", + "checksum": "SHA-256:9941f993ff84d1c606b45ffbeeb7bcdc5a72cf24e787bb9230390510fe3511c6", + "size": "88699953" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-macos.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-macos.tar.gz", + "checksum": "SHA-256:4b55b1a9ca7fc945be6fc3513802b6cece9264bee4cbca76013569cec2695973", + "size": "93757895" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-win32.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-win32.zip", + "checksum": "SHA-256:c94ec1e45c81b7e4944d216bab4aa41d46849768d7761fd691661dab1a3df828", + "size": "106013515" + } + ] + }, + { + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-12.2.0_20230208", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:2ff838520a5003d2768b275f5bb5ead69dd2388c3b7cd9043cb59891ba43147f", + "size": "112199211" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:6d79d5b14fc7129a9b8208d54e19b05dedb565f50f7a96264c9df84b06ad3be0", + "size": "106953064" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:e5bd03b6ad19179b015a93ada9992adc3610036ebf6aeb0835a09c9aadb50a14", + "size": "106026829" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "checksum": "SHA-256:fb45943557b2d201bbb1bdc7514a1872f9bb96c2dfb48b95abdba281cc792f75", + "size": "115288662" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:e965236cb80e45282d16f40184af183e013b63b177bd1884736c463eac636564", + "size": "119711811" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:78a55eec18650b21378d97494989ffe208748e0f49bb2b2d6756b264e1863919", + "size": "106540817" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "checksum": "SHA-256:1e6dac5162ab75f94b88c47ebeabb6600c652fb4f615ed07c1724d037c02fd19", + "size": "131273859" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:8a785cc4e0838cebe404f82c0ead7a0f9ac5fabc660a742e33a41ddac6326cc1", + "size": "135373049" + } + ] + }, + { + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "checksum": "SHA-256:8aa17a6adf01efa5b1628c8ac578063a44d26ae9581d39486b92223a41ef262f", + "size": "68099473" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "checksum": "SHA-256:b218c11122e5565b6442376ebd21a652abdfcbf90981afa3e177ce978710225d", + "size": "64233211" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "checksum": "SHA-256:967477434ad5483718915936a77ce915a10c5972a6b3fd02688a5c4e14182bfb", + "size": "63530586" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "checksum": "SHA-256:07671d01a63ebd389912787efb2b263677c7b351c07fe430ded733cdae95e81d", + "size": "70025439" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "checksum": "SHA-256:99b6d44cea5aebbedc8b6965e7bf551aa4a40ed83ddbe1c0e9b7cb255564ded5", + "size": "75719772" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-macos-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-macos-arm64.tar.gz", + "checksum": "SHA-256:c64b05be25d26916c65dcfe11de9e60b96d58980b2df706d3074cb70b1ef6cb9", + "size": "66791095" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "checksum": "SHA-256:658d3036ffdf11ddad6f0a784c8829f6ffd4dbd7c252d7f61722256d0ad43975", + "size": "82665716" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "checksum": "SHA-256:9000be38d44bf79c39b93a2aeb99b42e956c593ccbc02fe31cb9c71ae1bbcb22", + "size": "86022563" + } + ] + }, + { + "name": "xtensa-esp32s3-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch5", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "checksum": "SHA-256:8aa17a6adf01efa5b1628c8ac578063a44d26ae9581d39486b92223a41ef262f", + "size": "68099473" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "checksum": "SHA-256:b218c11122e5565b6442376ebd21a652abdfcbf90981afa3e177ce978710225d", + "size": "64233211" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "checksum": "SHA-256:967477434ad5483718915936a77ce915a10c5972a6b3fd02688a5c4e14182bfb", + "size": "63530586" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "checksum": "SHA-256:07671d01a63ebd389912787efb2b263677c7b351c07fe430ded733cdae95e81d", + "size": "70025439" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "checksum": "SHA-256:99b6d44cea5aebbedc8b6965e7bf551aa4a40ed83ddbe1c0e9b7cb255564ded5", + "size": "75719772" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "checksum": "SHA-256:658d3036ffdf11ddad6f0a784c8829f6ffd4dbd7c252d7f61722256d0ad43975", + "size": "82665716" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "checksum": "SHA-256:9000be38d44bf79c39b93a2aeb99b42e956c593ccbc02fe31cb9c71ae1bbcb22", + "size": "86022563" + } + ] + }, + { + "name": "xtensa-esp32s3-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz", + "checksum": "SHA-256:59b271d014ff3915b6db1b43b610a45eea15fe5d6877d12cae8a191cc996ed37", + "size": "90903617" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-linux-arm64.tar.gz", + "checksum": "SHA-256:7051b32483e61f98606d71c98e372929428a5165df791dcd5830ed9517763152", + "size": "87065204" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-linux-armel.tar.gz", + "checksum": "SHA-256:48c8dbbf96eec691a812327dc580042d9718fe989e60c2111ebfd692ac710081", + "size": "86455731" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-linux-i686.tar.gz", + "checksum": "SHA-256:552dca3f4302ab7ca88a934b0391200198c9d10a4d8ac413fe604cbf8601f950", + "size": "92906274" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz", + "checksum": "SHA-256:e5af78f05d3af07617805d06ebb45ff2fe9b6aed6970a84c35eea28a5d8d5e53", + "size": "98553473" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-win32.zip", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-win32.zip", + "checksum": "SHA-256:1b70163acccc5655449de1d149427a54f384156bd35816ec60c422d76d033f05", + "size": "116847008" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-win64.zip", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-win64.zip", + "checksum": "SHA-256:58e58575d1938879fd51e822181e54bcb343aa846eb3fca8f616c2cde7bd0041", + "size": "120066269" + } + ] + }, + { + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-12.2.0_20230208", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:61495ffe575e00c6998ae7274ff917658c04bded62ece0937c7042d6dcbf46de", + "size": "111971129" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:9008d395be46fcfe68c7de6edc850fc1595f28323a28e7922e5c085bd310cb90", + "size": "106616800" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:568857bdac7dea389dffc7fbc6871b4af299150a8ecf1bf965f224d2a1655edb", + "size": "105700326" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "checksum": "SHA-256:d122738bcc6c2f52d05fa89b2fb1afe6a7894cda8a07a1879aca867a31507ed0", + "size": "115098400" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:7defcddb98788b0991416ad2e0cb6a3b248b8030f22d5d76b8832117cc1494ca", + "size": "119883189" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:b59e076f8e4b9ca99535d449f9fc4cbb443188051dce4ad934e38f16b095f8d9", + "size": "106464677" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "checksum": "SHA-256:3ddf51774817e815e5d41c312a90c1159226978fb45fd0d4f7085c567f8b73ab", + "size": "131134034" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:1d15ca65e3508388a86d8bed3048c46d07538f5bc88d3e4296f9c03152087cd1", + "size": "135381926" + } + ] + }, + { + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "checksum": "SHA-256:f7d73e5f9e2df3ea6ca8e2c95d6ca6d23d6b38fd101ea5d3012f3cb3cd59f39f", + "size": "192388486" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "checksum": "SHA-256:cf520ae3a72f65b9758ea187524b105b8b7546566d738c32e60a0df9846ef1af", + "size": "188626914" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "checksum": "SHA-256:2dc3536214caa1697f6834bb4701d05894ca55b53589fc5b54064b050ef93799", + "size": "188624050" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "checksum": "SHA-256:165d6d53e76d79f5ade7e2b7ade54b2b495ecfda0d1184d84d6343659d0e3bdb", + "size": "194606113" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "checksum": "SHA-256:d6d4cef216cbf28d6fbb88f3e127d4f42a376d9497c260bf8c1ad9cef440f839", + "size": "199411930" + }, + { + "host": "arm64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-macos-arm64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-macos-arm64.tar.gz", + "checksum": "SHA-256:6e03f2ab1f145be13f8890c6de77b53f52c7bffe3d9d5824549db20298f5ba91", + "size": "191209735" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "checksum": "SHA-256:1e0cfcfbc8f82c441261cadd21742f66d716ec18c18bf10ed7c7d5b0bee6752f", + "size": "257844437" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "checksum": "SHA-256:b08f568e8fe5069dd521b87da21b8e56117e5c2c3b492f73a51966a46d3379a4", + "size": "259712666" + } + ] + }, + { + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch5", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "checksum": "SHA-256:f7d73e5f9e2df3ea6ca8e2c95d6ca6d23d6b38fd101ea5d3012f3cb3cd59f39f", + "size": "192388486" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "checksum": "SHA-256:cf520ae3a72f65b9758ea187524b105b8b7546566d738c32e60a0df9846ef1af", + "size": "188626914" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "checksum": "SHA-256:2dc3536214caa1697f6834bb4701d05894ca55b53589fc5b54064b050ef93799", + "size": "188624050" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "checksum": "SHA-256:165d6d53e76d79f5ade7e2b7ade54b2b495ecfda0d1184d84d6343659d0e3bdb", + "size": "194606113" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "checksum": "SHA-256:d6d4cef216cbf28d6fbb88f3e127d4f42a376d9497c260bf8c1ad9cef440f839", + "size": "199411930" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "checksum": "SHA-256:1e0cfcfbc8f82c441261cadd21742f66d716ec18c18bf10ed7c7d5b0bee6752f", + "size": "257844437" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "checksum": "SHA-256:b08f568e8fe5069dd521b87da21b8e56117e5c2c3b492f73a51966a46d3379a4", + "size": "259712666" + } + ] + }, + { + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz", + "checksum": "SHA-256:179cbad579790ad35e0f414a18d90017c0f158c397022411a8e9867db2174f15", + "size": "106843321" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-arm64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-arm64.tar.gz", + "checksum": "SHA-256:fb339d476c79c76db8f903b265cab6bb6950d5ed954dec644445252d3378023c", + "size": "103277393" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-armel.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-armel.tar.gz", + "checksum": "SHA-256:51a6296d8334b7452dba44b2b62e87afd7fd1c74bafa1aa29b1f4ab72cb9e5e0", + "size": "103062256" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-i686.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-i686.tar.gz", + "checksum": "SHA-256:fef60f7ef37ffaa50416d8f244cdbd710d6729dae41ef06c4ec0e50a1f3b7dd7", + "size": "109460025" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz", + "checksum": "SHA-256:4aacc1742a76349d790b1ac8e9e9d963daefda5346dbd6741cfe8e7a35a44e4e", + "size": "113703959" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-win32.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-win32.zip", + "checksum": "SHA-256:eb2a442d7f551ebeb842995ec372ec4b364314ca2d7aae779399a74972f7d6bc", + "size": "144711970" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-win64.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-win64.zip", + "checksum": "SHA-256:f5607e5187317d521f0474cade83f8eb590f2d165d95c3779b6ce11fbac21d1f", + "size": "146606480" + } + ] + }, + { + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz", + "checksum": "SHA-256:812d735063da9d063b374b59f55832a96c41fbd27ddaef19000a75de8607ba21", + "size": "106837189" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-arm64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-arm64.tar.gz", + "checksum": "SHA-256:712f1fbc3e08304a6f32aa18b346b16bbcb413b507b3d4c7c3211bf0d7dc4813", + "size": "103273444" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-armel.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-armel.tar.gz", + "checksum": "SHA-256:80a3342cda2cd4b6b75ebb2b36d5d12fce7d375cfadadcff01ec3a907f0a16a2", + "size": "103058744" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-i686.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-i686.tar.gz", + "checksum": "SHA-256:7f0162a81558ab0ed09d6c5d356def25b5cb3d5c2d61358f20152fa260ccc8ae", + "size": "109447789" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-macos.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-macos.tar.gz", + "checksum": "SHA-256:3ff7e5427907cf8e271c1f959b70fb01e39625c3caf61a6567e7b38aa0c11578", + "size": "113672945" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-win32.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-win32.zip", + "checksum": "SHA-256:c8ff08883c1456c278fad85e1c43b7c6e251d525683214168655550e85c5b82e", + "size": "140809778" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-win64.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-win64.zip", + "checksum": "SHA-256:6c04cb4728db928ec6473e63146b695b6dec686a0d40dd73dd3353f05247b19e", + "size": "142365782" + } + ] + }, + { + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r1", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz", + "checksum": "SHA-256:3459618f33bbd5f54d7d7783e807cb6eef6472a220f2f1eb3faced735b9d13bb", + "size": "152812483" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz", + "checksum": "SHA-256:24b9e54b348bbd5fb816fc4c52abb47337c702beecdbba840750b7cfb9d38069", + "size": "151726623" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz", + "checksum": "SHA-256:954d340ebffef12a2ce9be1ea004e6f45a8863f1e6f41f46fd3f04f58499627c", + "size": "155430963" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-macos.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r1-macos.tar.gz", + "checksum": "SHA-256:612fb3a3f84f703222327bd16581df8f80fda8cdf137637fe5d611587d1b664e", + "size": "159836199" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-win32.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r1-win32.zip", + "checksum": "SHA-256:5711eb407ffe44adddbd1281b6b575a5645e7193ca78faefa27dc5bc5b662bec", + "size": "191266312" + } + ] + }, + { + "version": "2.3.1", + "name": "esptool", + "systems": [ + { + "url": "https://dl.espressif.com/dl/esptool-2.3.1-windows.zip", + "checksum": "SHA-256:c187763d0faac7da7c30a292a23c759bbc256fcd084dc8846ed284000cb0fe29", + "host": "i686-mingw32", + "archiveFileName": "esptool-2.3.1-windows.zip", + "size": "3396085" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.3.1-macos.tar.gz", + "checksum": "SHA-256:cd922418f02e0ca11dc066b36a22646a1b441da00d762b4464ca598c902c5ecb", + "host": "x86_64-apple-darwin", + "archiveFileName": "esptool-2.3.1-macos.tar.gz", + "size": "3810932" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.3.1-linux.tar.gz", + "checksum": "SHA-256:cff30841dad80ed5d7d2d58a31843b63afa57528979a9c839806568167691d8e", + "host": "x86_64-pc-linux-gnu", + "archiveFileName": "esptool-2.3.1-linux.tar.gz", + "size": "39563" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.3.1-linux.tar.gz", + "checksum": "SHA-256:cff30841dad80ed5d7d2d58a31843b63afa57528979a9c839806568167691d8e", + "host": "i686-pc-linux-gnu", + "archiveFileName": "esptool-2.3.1-linux.tar.gz", + "size": "39563" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.3.1-linux.tar.gz", + "checksum": "SHA-256:cff30841dad80ed5d7d2d58a31843b63afa57528979a9c839806568167691d8e", + "host": "arm-linux-gnueabihf", + "archiveFileName": "esptool-2.3.1-linux.tar.gz", + "size": "39563" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/package_esp32_index_cn.json b/package_esp32_index_cn.json new file mode 100644 index 00000000000..7cb95e644da --- /dev/null +++ b/package_esp32_index_cn.json @@ -0,0 +1,6578 @@ +{ + "packages": [ + { + "name": "esp32", + "maintainer": "Espressif Systems", + "websiteURL": "https://github.com/espressif/arduino-esp32", + "email": "hristo@espressif.com", + "help": { + "online": "http://esp32.com" + }, + "platforms": [ + { + "name": "esp32", + "architecture": "esp32", + "version": "3.2.0", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.2.0/esp32-3.2.0.zip", + "archiveFileName": "esp32-3.2.0.zip", + "checksum": "SHA-256:d38b16fef6e519fc0d19bc5af0b39cdbed7dfc2ce69214c1971ded0e61ecd911", + "size": "25447136", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "ESP32-C6 Dev Board" + }, + { + "name": "ESP32-H2 Dev Board" + }, + { + "name": "ESP32-P4 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.4-2f7dcd86-v1" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2411" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2411" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20241016" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.9.dev3" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.1.3", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.1.3/esp32-3.1.3.zip", + "archiveFileName": "esp32-3.1.3.zip", + "checksum": "SHA-256:747160dbc81c6634c7bff9e8a57213e9982d52fe90d2a8f75a93a9f7b527defb", + "size": "25396700", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-489d7a2b-v1" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20241016" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.9.dev3" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.1.2", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.1.2/esp32-3.1.2.zip", + "archiveFileName": "esp32-3.1.2.zip", + "checksum": "SHA-256:17214f51a7b9de547baa777419d2b041e1f09cfb17adb33c18617a756190f9f6", + "size": "25396684", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-489d7a2b-v1" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20241016" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.9.dev3" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.1.1", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.1.1/esp32-3.1.1.zip", + "archiveFileName": "esp32-3.1.1.zip", + "checksum": "SHA-256:e20982b2860eab4900ce16a0f2b7f9fc3ffb205e490dc933f625d53a5c9e8129", + "size": "25253828", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-cfea4f7c-v1" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20241016" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.9.dev3" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.1.0", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.1.0/esp32-3.1.0.zip", + "archiveFileName": "esp32-3.1.0.zip", + "checksum": "SHA-256:0db044159e3fc737435b3f1d547bf85c60a33a175342c317d2a5c08c42977f80", + "size": "25225607", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-083aad99-v2" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2405" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "14.2_20240403" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20241016" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.9.dev3" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.7", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.7/esp32-3.0.7.zip", + "archiveFileName": "esp32-3.0.7.zip", + "checksum": "SHA-256:6b48f5bd889e55d7b93b95849dff77c6a5e4b9ee58c7298d7872d558a4d04931", + "size": "24546342", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-632e0c2a" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs2", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs3", + "version": "2302" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20240821" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.6", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.6/esp32-3.0.6.zip", + "archiveFileName": "esp32-3.0.6.zip", + "checksum": "SHA-256:7b4d87d0a18e69cba81e7aa7e69f088dc7c4f6cc89a20adc256bf77c86992dc5", + "size": "24546256", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-632e0c2a" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs2", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs3", + "version": "2302" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20240821" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.5", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.5/esp32-3.0.5.zip", + "archiveFileName": "esp32-3.0.5.zip", + "checksum": "SHA-256:6ead4c452e69146b8eb08bee5a77898acc75a0637e9fccb5bbf665385ddc28db", + "size": "24481707", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-33fbade6" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs2", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs3", + "version": "2302" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20240821" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.4", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.4/esp32-3.0.4.zip", + "archiveFileName": "esp32-3.0.4.zip", + "checksum": "SHA-256:58fcd9b033be0358afbcbcf9a1d8eb216217f65f6b28f2e2cd739c7d016dda4f", + "size": "23937821", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-b6b4727c58" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs2", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs3", + "version": "2302" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20240318" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.3", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.3/esp32-3.0.3.zip", + "archiveFileName": "esp32-3.0.3.zip", + "checksum": "SHA-256:b4aa70711293955a9835ad641279dc7cd524aeb405f7d294afa05c2ece7ded45", + "size": "23920341", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-dc859c1e67" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs2", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs3", + "version": "2302" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20240318" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.2", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.2/esp32-3.0.2.zip", + "archiveFileName": "esp32-3.0.2.zip", + "checksum": "SHA-256:bd90630fbe9e99f3bb3340c25a87574d5551dd2823849adbf285f8430b6884cf", + "size": "23893902", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-bd2b9390ef" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs2", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs3", + "version": "2302" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20240318" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.1", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.1/esp32-3.0.1.zip", + "archiveFileName": "esp32-3.0.1.zip", + "checksum": "SHA-256:b7169d0dd51b64e450a7c09fafb7a4782820a9bc745f7b1e4618316440db0930", + "size": "23895257", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-442a798083" + }, + { + "packager": "esp32", + "name": "esp-x32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs2", + "version": "2302" + }, + { + "packager": "esp32", + "name": "esp-xs3", + "version": "2302" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230921" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "3.0.0", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.0/esp32-3.0.0.zip", + "archiveFileName": "esp32-3.0.0.zip", + "checksum": "SHA-256:0960cf786992e0e3770d8c1e1979eaf01bd0ac9209b24fb00948cf93d43cf95c", + "size": "23891610", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-442a798083" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-12.2.0_20230208" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-12.2.0_20230208" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-12.2.0_20230208" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "esp-rv32", + "version": "2302" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230921" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.6" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.17", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.17/esp32-2.0.17.zip", + "archiveFileName": "esp32-2.0.17.zip", + "checksum": "SHA-256:1f8658d4b18a8001ce782142ad08164af2991d70b83a147c3437a6ee30a9b225", + "size": "254658377", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230921" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.16", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.16/esp32-2.0.16.zip", + "archiveFileName": "esp32-2.0.16.zip", + "checksum": "SHA-256:6615fd16fd6d3ee2fa7ca2dd40a4f65220eddf094a88b7cee2141a0c077987bc", + "size": "254657760", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230921" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.15", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.15/esp32-2.0.15.zip", + "archiveFileName": "esp32-2.0.15.zip", + "checksum": "SHA-256:2219c1636264f55e19b2a5e7f41c81b669b1355017b15ee31773c85674b3e9bb", + "size": "254657764", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230921" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.14", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.14/esp32-2.0.14.zip", + "archiveFileName": "esp32-2.0.14.zip", + "checksum": "SHA-256:77c71eba520c97ab30161eb2f9c6a46b019e48d13936244b18f6ad4dbecf0a58", + "size": "252506057", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230419" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.13", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.13/esp32-2.0.13.zip", + "archiveFileName": "esp32-2.0.13.zip", + "checksum": "SHA-256:ee4c277bac0eecb7ca8853780da9d49b4e260926059cf6a9f9bac1923059de0c", + "size": "250665913", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20221026" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.12", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.12/esp32-2.0.12.zip", + "archiveFileName": "esp32-2.0.12.zip", + "checksum": "SHA-256:9a4f844ca67812c547a9635cdb0dd2c347cae7a3e855f95f9d490b2f8d340dbe", + "size": "250664387", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20221026" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.11", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.11/esp32-2.0.11.zip", + "archiveFileName": "esp32-2.0.11.zip", + "checksum": "SHA-256:d15386308dc72f94816ce80b5508af999f2fd0d88eb5e1ffba48316ab0b9c5d6", + "size": "250401265", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20221026" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.10", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.10/esp32-2.0.10.zip", + "archiveFileName": "esp32-2.0.10.zip", + "checksum": "SHA-256:6028cb623c838723c41000869963d95f7cb811d58643133068eed31c03c2d7c0", + "size": "250401273", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + }, + { + "name": "Arduino Nano ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20221026" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + }, + { + "packager": "arduino", + "name": "dfu-util", + "version": "0.11.0-arduino5" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.9", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.9/esp32-2.0.9.zip", + "archiveFileName": "esp32-2.0.9.zip", + "checksum": "SHA-256:37072185026db3cdc0ed4b6fb12840d7f41571a16c60eec97bec2a4abec8dcee", + "size": "278964028", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20221026" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.8", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.8/esp32-2.0.8.zip", + "archiveFileName": "esp32-2.0.8.zip", + "checksum": "SHA-256:2c5daa3ce7456e752fb8d8a35b0b6b2eb8e494032cba57569ba12dd53eb235f2", + "size": "278963636", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20221026" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.7", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.7/esp32-2.0.7.zip", + "archiveFileName": "esp32-2.0.7.zip", + "checksum": "SHA-256:b5a7a54fca36501d1108413310ec50ae2df655c14c3881325903cde2c7ae5f80", + "size": "278966011", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20221026" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.5" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.6", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.6/esp32-2.0.6.zip", + "archiveFileName": "esp32-2.0.6.zip", + "checksum": "SHA-256:ea56d300404cc1b5bc15295f29790246b02025c493e0664a6d271164a602a351", + "size": "264579419", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch5" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch5" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch5" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch5" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.2.1" + }, + { + "packager": "esp32", + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20220706" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.5", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.5/esp32-2.0.5.zip", + "archiveFileName": "esp32-2.0.5.zip", + "checksum": "SHA-256:c7a1040c5f007a799ef9eb249508e3544c3cf5246f67cdfdc1e80f7d0ca7b41d", + "size": "260916106", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "4.2.1" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.4", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.4/esp32-2.0.4.zip", + "archiveFileName": "esp32-2.0.4.zip", + "checksum": "SHA-256:832609d6f4cd0edf4e471f02e30b7f0e1c86fdd1b950990ef40431e656237214", + "size": "259715595", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "3.3.0" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.3", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.3/esp32-2.0.3.zip", + "archiveFileName": "esp32-2.0.3.zip", + "checksum": "SHA-256:7a44ab32a2bfe18a84fd1f75aa1921dae92c6b4a74a2eb4d0c7d479b34996f3b", + "size": "246542267", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-S3 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s3-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "3.3.0" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.2", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.2/esp32-2.0.2.zip", + "archiveFileName": "esp32-2.0.2.zip", + "checksum": "SHA-256:e139f22aab9cbe8109815de0be110e58a8f1d6c90a2e263eb0b0d646b53a5a33", + "size": "151846438", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "3.1.0" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.1", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.1/esp32-2.0.1.zip", + "archiveFileName": "esp32-2.0.1.zip", + "checksum": "SHA-256:3a7cd46ba47990dd37fbe02b7f0a910dd5cc7af1d190350b69d320ed36cd6b41", + "size": "148976301", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Board" + }, + { + "name": "ESP32-S2 Dev Board" + }, + { + "name": "ESP32-C3 Dev Board" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "3.1.0" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "2.0.0", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.0/esp32-2.0.0.zip", + "archiveFileName": "esp32-2.0.0.zip", + "checksum": "SHA-256:10e1c42dbf11d2359259a80008f13f37d2f9bb8f49a25d34d387cf4531052cbc", + "size": "139313137", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Module" + }, + { + "name": "WEMOS LoLin32" + }, + { + "name": "WEMOS D1 MINI ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r1" + }, + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r1" + }, + { + "packager": "esp32", + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r1" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "3.1.0" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + }, + { + "packager": "esp32", + "name": "mklittlefs", + "version": "3.0.0-gnu12-dc7f933" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "1.0.6", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/1.0.6/esp32-1.0.6.zip", + "archiveFileName": "esp32-1.0.6.zip", + "checksum": "SHA-256:982da9aaa181b6cb9c692dd4c9622b022ecc0d1e3aa0c5b70428ccc3c1b4556b", + "size": "51126662", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Module" + }, + { + "name": "WEMOS LoLin32" + }, + { + "name": "WEMOS D1 MINI ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "1.22.0-97-gc752ad5-5.2.0" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "3.0.0" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + } + ] + }, + { + "name": "esp32", + "architecture": "esp32", + "version": "1.0.5", + "category": "ESP32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/1.0.5/esp32-1.0.5.zip", + "archiveFileName": "esp32-1.0.5.zip", + "checksum": "SHA-256:dc5c6c72a127b3171c654f3c3476911d3c2b0ab21affdb7b0f0756c105ca71a7", + "size": "49552769", + "help": { + "online": "" + }, + "boards": [ + { + "name": "ESP32 Dev Module" + }, + { + "name": "WEMOS LoLin32" + }, + { + "name": "WEMOS D1 MINI ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "name": "xtensa-esp32-elf-gcc", + "version": "1.22.0-97-gc752ad5-5.2.0" + }, + { + "packager": "esp32", + "name": "esptool_py", + "version": "3.0.0" + }, + { + "packager": "esp32", + "name": "mkspiffs", + "version": "0.2.3" + } + ] + }, + { + "category": "ESP32", + "name": "esp32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/1.0.4/esp32-1.0.4.zip", + "checksum": "SHA-256:d9108bf873933c4e48a3ca401fb51e41b2cc3f98d7c9b9be9881e7ca34bf0efe", + "help": { + "online": "" + }, + "version": "1.0.4", + "architecture": "esp32", + "archiveFileName": "esp32-1.0.4.zip", + "boards": [ + { + "name": "ESP32 Dev Module" + }, + { + "name": "WEMOS LoLin32" + }, + { + "name": "WEMOS D1 MINI ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "version": "1.22.0-80-g6c4433a-5.2.0", + "name": "xtensa-esp32-elf-gcc" + }, + { + "packager": "esp32", + "version": "2.6.1", + "name": "esptool_py" + }, + { + "packager": "esp32", + "version": "0.2.3", + "name": "mkspiffs" + } + ], + "size": "36853332" + }, + { + "category": "ESP32", + "name": "esp32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/1.0.3/esp32-1.0.3.zip", + "checksum": "SHA-256:19a30ece8a3ab26ab420c3d5531a9a1c51cb04e421a4f1d86dc072c209060436", + "help": { + "online": "" + }, + "version": "1.0.3", + "architecture": "esp32", + "archiveFileName": "esp32-1.0.3.zip", + "boards": [ + { + "name": "ESP32 Dev Module" + }, + { + "name": "WEMOS LoLin32" + }, + { + "name": "WEMOS D1 MINI ESP32" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "version": "1.22.0-80-g6c4433a-5.2.0", + "name": "xtensa-esp32-elf-gcc" + }, + { + "packager": "esp32", + "version": "2.6.1", + "name": "esptool_py" + }, + { + "packager": "esp32", + "version": "0.2.3", + "name": "mkspiffs" + } + ], + "size": "36811826" + }, + { + "category": "ESP32", + "help": { + "online": "" + }, + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/1.0.2/esp32-1.0.2.zip", + "checksum": "SHA-256:c3a5a5050705d41ab205d25a7399e921057b754ef8f883419f58c0c7f08df11c", + "version": "1.0.2", + "architecture": "esp32", + "archiveFileName": "esp32-1.0.2.zip", + "boards": [ + { + "name": "ESP32 Dev Module" + }, + { + "name": "WEMOS LoLin32" + } + ], + "size": "31174160", + "toolsDependencies": [ + { + "packager": "esp32", + "version": "1.22.0-80-g6c4433a-5.2.0", + "name": "xtensa-esp32-elf-gcc" + }, + { + "packager": "esp32", + "version": "2.6.1", + "name": "esptool_py" + }, + { + "packager": "esp32", + "version": "0.2.3", + "name": "mkspiffs" + } + ], + "name": "esp32" + }, + { + "category": "ESP32", + "help": { + "online": "" + }, + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/1.0.1/esp32-1.0.1.zip", + "checksum": "SHA-256:1a7fa2f9bb0b6b5a20dfea227497f4851dc8b886caf7ecb998f745589c97ed34", + "name": "esp32", + "version": "1.0.1", + "architecture": "esp32", + "archiveFileName": "esp32-1.0.1.zip", + "size": "31273425", + "toolsDependencies": [ + { + "packager": "esp32", + "version": "1.22.0-80-g6c4433a-5.2.0", + "name": "xtensa-esp32-elf-gcc" + }, + { + "packager": "esp32", + "version": "2.6.0", + "name": "esptool_py" + }, + { + "packager": "esp32", + "version": "0.2.3", + "name": "mkspiffs" + } + ], + "boards": [ + { + "name": "ESP32 Dev Module" + }, + { + "name": "WEMOS LoLin32" + } + ] + }, + { + "category": "ESP32", + "help": { + "online": "" + }, + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/1.0.0/esp32-1.0.0.zip", + "checksum": "SHA-256:94d586174f103e2014be590ab307c5cdda6fa2ec70204c7f121882ace5e05c80", + "name": "esp32", + "version": "1.0.0", + "architecture": "esp32", + "archiveFileName": "esp32-1.0.0.zip", + "size": "26381887", + "toolsDependencies": [ + { + "packager": "esp32", + "version": "1.22.0-80-g6c4433a-5.2.0", + "name": "xtensa-esp32-elf-gcc" + }, + { + "packager": "esp32", + "version": "2.3.1", + "name": "esptool" + }, + { + "packager": "esp32", + "version": "0.2.3", + "name": "mkspiffs" + } + ], + "boards": [ + { + "name": "ESP32 Dev Module" + }, + { + "name": "WEMOS LoLin32" + } + ] + } + ], + "tools": [ + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.4-2f7dcd86-v1", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-489d7a2b-v1", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "checksum": "SHA-256:489012502218a7d30f6c312764bc8d10830a51e1db29558f15181c68373d0095", + "size": "341414090" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "checksum": "SHA-256:489012502218a7d30f6c312764bc8d10830a51e1db29558f15181c68373d0095", + "size": "341414090" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "checksum": "SHA-256:489012502218a7d30f6c312764bc8d10830a51e1db29558f15181c68373d0095", + "size": "341414090" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "checksum": "SHA-256:489012502218a7d30f6c312764bc8d10830a51e1db29558f15181c68373d0095", + "size": "341414090" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "checksum": "SHA-256:489012502218a7d30f6c312764bc8d10830a51e1db29558f15181c68373d0095", + "size": "341414090" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "checksum": "SHA-256:489012502218a7d30f6c312764bc8d10830a51e1db29558f15181c68373d0095", + "size": "341414090" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "checksum": "SHA-256:489012502218a7d30f6c312764bc8d10830a51e1db29558f15181c68373d0095", + "size": "341414090" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-489d7a2b-v1.zip", + "checksum": "SHA-256:489012502218a7d30f6c312764bc8d10830a51e1db29558f15181c68373d0095", + "size": "341414090" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-cfea4f7c-v1", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "checksum": "SHA-256:1099291229a9be453c771c5867b8487a0266db9246b672417337b8f511d7f820", + "size": "341118284" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "checksum": "SHA-256:1099291229a9be453c771c5867b8487a0266db9246b672417337b8f511d7f820", + "size": "341118284" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "checksum": "SHA-256:1099291229a9be453c771c5867b8487a0266db9246b672417337b8f511d7f820", + "size": "341118284" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "checksum": "SHA-256:1099291229a9be453c771c5867b8487a0266db9246b672417337b8f511d7f820", + "size": "341118284" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "checksum": "SHA-256:1099291229a9be453c771c5867b8487a0266db9246b672417337b8f511d7f820", + "size": "341118284" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "checksum": "SHA-256:1099291229a9be453c771c5867b8487a0266db9246b672417337b8f511d7f820", + "size": "341118284" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "checksum": "SHA-256:1099291229a9be453c771c5867b8487a0266db9246b672417337b8f511d7f820", + "size": "341118284" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-cfea4f7c-v1.zip", + "checksum": "SHA-256:1099291229a9be453c771c5867b8487a0266db9246b672417337b8f511d7f820", + "size": "341118284" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.3-083aad99-v2", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "checksum": "SHA-256:4c6cae2e34df7e85a149615a6c18169777faf9460f708fc51d93616a117973c2", + "size": "341175680" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "checksum": "SHA-256:4c6cae2e34df7e85a149615a6c18169777faf9460f708fc51d93616a117973c2", + "size": "341175680" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "checksum": "SHA-256:4c6cae2e34df7e85a149615a6c18169777faf9460f708fc51d93616a117973c2", + "size": "341175680" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "checksum": "SHA-256:4c6cae2e34df7e85a149615a6c18169777faf9460f708fc51d93616a117973c2", + "size": "341175680" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "checksum": "SHA-256:4c6cae2e34df7e85a149615a6c18169777faf9460f708fc51d93616a117973c2", + "size": "341175680" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "checksum": "SHA-256:4c6cae2e34df7e85a149615a6c18169777faf9460f708fc51d93616a117973c2", + "size": "341175680" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "checksum": "SHA-256:4c6cae2e34df7e85a149615a6c18169777faf9460f708fc51d93616a117973c2", + "size": "341175680" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-083aad99-v2.zip", + "checksum": "SHA-256:4c6cae2e34df7e85a149615a6c18169777faf9460f708fc51d93616a117973c2", + "size": "341175680" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-632e0c2a", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "checksum": "SHA-256:41f67e1c11f68b57d651955c93b63d6a8d35808ce6aff6ba3d1e1476178758f2", + "size": "309895581" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "checksum": "SHA-256:41f67e1c11f68b57d651955c93b63d6a8d35808ce6aff6ba3d1e1476178758f2", + "size": "309895581" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "checksum": "SHA-256:41f67e1c11f68b57d651955c93b63d6a8d35808ce6aff6ba3d1e1476178758f2", + "size": "309895581" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "checksum": "SHA-256:41f67e1c11f68b57d651955c93b63d6a8d35808ce6aff6ba3d1e1476178758f2", + "size": "309895581" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "checksum": "SHA-256:41f67e1c11f68b57d651955c93b63d6a8d35808ce6aff6ba3d1e1476178758f2", + "size": "309895581" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "checksum": "SHA-256:41f67e1c11f68b57d651955c93b63d6a8d35808ce6aff6ba3d1e1476178758f2", + "size": "309895581" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "checksum": "SHA-256:41f67e1c11f68b57d651955c93b63d6a8d35808ce6aff6ba3d1e1476178758f2", + "size": "309895581" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-632e0c2a.zip", + "checksum": "SHA-256:41f67e1c11f68b57d651955c93b63d6a8d35808ce6aff6ba3d1e1476178758f2", + "size": "309895581" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-33fbade6", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "checksum": "SHA-256:578f325fa9fca635d9c6c3b19726cb26077751e3155b677317bde2e0b371df7d", + "size": "309285463" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "checksum": "SHA-256:578f325fa9fca635d9c6c3b19726cb26077751e3155b677317bde2e0b371df7d", + "size": "309285463" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "checksum": "SHA-256:578f325fa9fca635d9c6c3b19726cb26077751e3155b677317bde2e0b371df7d", + "size": "309285463" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "checksum": "SHA-256:578f325fa9fca635d9c6c3b19726cb26077751e3155b677317bde2e0b371df7d", + "size": "309285463" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "checksum": "SHA-256:578f325fa9fca635d9c6c3b19726cb26077751e3155b677317bde2e0b371df7d", + "size": "309285463" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "checksum": "SHA-256:578f325fa9fca635d9c6c3b19726cb26077751e3155b677317bde2e0b371df7d", + "size": "309285463" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "checksum": "SHA-256:578f325fa9fca635d9c6c3b19726cb26077751e3155b677317bde2e0b371df7d", + "size": "309285463" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.1-33fbade6.zip", + "checksum": "SHA-256:578f325fa9fca635d9c6c3b19726cb26077751e3155b677317bde2e0b371df7d", + "size": "309285463" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-b6b4727c58", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip", + "archiveFileName": "esp32-arduino-libs-3.0.4.zip", + "checksum": "SHA-256:c5c495fc3e6e11418e87ca9f6bf89cdcb0bcc38244a618f8d457d7a77f70b778", + "size": "305857583" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip", + "archiveFileName": "esp32-arduino-libs-3.0.4.zip", + "checksum": "SHA-256:c5c495fc3e6e11418e87ca9f6bf89cdcb0bcc38244a618f8d457d7a77f70b778", + "size": "305857583" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip", + "archiveFileName": "esp32-arduino-libs-3.0.4.zip", + "checksum": "SHA-256:c5c495fc3e6e11418e87ca9f6bf89cdcb0bcc38244a618f8d457d7a77f70b778", + "size": "305857583" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip", + "archiveFileName": "esp32-arduino-libs-3.0.4.zip", + "checksum": "SHA-256:c5c495fc3e6e11418e87ca9f6bf89cdcb0bcc38244a618f8d457d7a77f70b778", + "size": "305857583" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip", + "archiveFileName": "esp32-arduino-libs-3.0.4.zip", + "checksum": "SHA-256:c5c495fc3e6e11418e87ca9f6bf89cdcb0bcc38244a618f8d457d7a77f70b778", + "size": "305857583" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip", + "archiveFileName": "esp32-arduino-libs-3.0.4.zip", + "checksum": "SHA-256:c5c495fc3e6e11418e87ca9f6bf89cdcb0bcc38244a618f8d457d7a77f70b778", + "size": "305857583" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip", + "archiveFileName": "esp32-arduino-libs-3.0.4.zip", + "checksum": "SHA-256:c5c495fc3e6e11418e87ca9f6bf89cdcb0bcc38244a618f8d457d7a77f70b778", + "size": "305857583" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip", + "archiveFileName": "esp32-arduino-libs-3.0.4.zip", + "checksum": "SHA-256:c5c495fc3e6e11418e87ca9f6bf89cdcb0bcc38244a618f8d457d7a77f70b778", + "size": "305857583" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-dc859c1e67", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.3/esp32-arduino-libs-3.0.3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.3.zip", + "checksum": "SHA-256:23618328d3cc3d2eabc269196be22af5b2353583d5f6ec14b3ef0cf11e7da7ba", + "size": "305530538" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.3/esp32-arduino-libs-3.0.3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.3.zip", + "checksum": "SHA-256:23618328d3cc3d2eabc269196be22af5b2353583d5f6ec14b3ef0cf11e7da7ba", + "size": "305530538" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.3/esp32-arduino-libs-3.0.3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.3.zip", + "checksum": "SHA-256:23618328d3cc3d2eabc269196be22af5b2353583d5f6ec14b3ef0cf11e7da7ba", + "size": "305530538" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.3/esp32-arduino-libs-3.0.3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.3.zip", + "checksum": "SHA-256:23618328d3cc3d2eabc269196be22af5b2353583d5f6ec14b3ef0cf11e7da7ba", + "size": "305530538" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.3/esp32-arduino-libs-3.0.3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.3.zip", + "checksum": "SHA-256:23618328d3cc3d2eabc269196be22af5b2353583d5f6ec14b3ef0cf11e7da7ba", + "size": "305530538" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.3/esp32-arduino-libs-3.0.3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.3.zip", + "checksum": "SHA-256:23618328d3cc3d2eabc269196be22af5b2353583d5f6ec14b3ef0cf11e7da7ba", + "size": "305530538" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.3/esp32-arduino-libs-3.0.3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.3.zip", + "checksum": "SHA-256:23618328d3cc3d2eabc269196be22af5b2353583d5f6ec14b3ef0cf11e7da7ba", + "size": "305530538" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.3/esp32-arduino-libs-3.0.3.zip", + "archiveFileName": "esp32-arduino-libs-3.0.3.zip", + "checksum": "SHA-256:23618328d3cc3d2eabc269196be22af5b2353583d5f6ec14b3ef0cf11e7da7ba", + "size": "305530538" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-bd2b9390ef", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip", + "archiveFileName": "esp32-arduino-libs-3.0.2.zip", + "checksum": "SHA-256:6df0f2753ae3d43582e641e3b945666c2700cb18f62a1932ad535b79427aae0b", + "size": "305835047" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip", + "archiveFileName": "esp32-arduino-libs-3.0.2.zip", + "checksum": "SHA-256:6df0f2753ae3d43582e641e3b945666c2700cb18f62a1932ad535b79427aae0b", + "size": "305835047" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip", + "archiveFileName": "esp32-arduino-libs-3.0.2.zip", + "checksum": "SHA-256:6df0f2753ae3d43582e641e3b945666c2700cb18f62a1932ad535b79427aae0b", + "size": "305835047" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip", + "archiveFileName": "esp32-arduino-libs-3.0.2.zip", + "checksum": "SHA-256:6df0f2753ae3d43582e641e3b945666c2700cb18f62a1932ad535b79427aae0b", + "size": "305835047" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip", + "archiveFileName": "esp32-arduino-libs-3.0.2.zip", + "checksum": "SHA-256:6df0f2753ae3d43582e641e3b945666c2700cb18f62a1932ad535b79427aae0b", + "size": "305835047" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip", + "archiveFileName": "esp32-arduino-libs-3.0.2.zip", + "checksum": "SHA-256:6df0f2753ae3d43582e641e3b945666c2700cb18f62a1932ad535b79427aae0b", + "size": "305835047" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip", + "archiveFileName": "esp32-arduino-libs-3.0.2.zip", + "checksum": "SHA-256:6df0f2753ae3d43582e641e3b945666c2700cb18f62a1932ad535b79427aae0b", + "size": "305835047" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip", + "archiveFileName": "esp32-arduino-libs-3.0.2.zip", + "checksum": "SHA-256:6df0f2753ae3d43582e641e3b945666c2700cb18f62a1932ad535b79427aae0b", + "size": "305835047" + } + ] + }, + { + "name": "esp32-arduino-libs", + "version": "idf-release_v5.1-442a798083", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.1.zip", + "checksum": "SHA-256:112f81fcaed22286f9ba19bbd01d12337aab7b64e997120c33f833816b343e20", + "size": "373411607" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.1.zip", + "checksum": "SHA-256:112f81fcaed22286f9ba19bbd01d12337aab7b64e997120c33f833816b343e20", + "size": "373411607" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.1.zip", + "checksum": "SHA-256:112f81fcaed22286f9ba19bbd01d12337aab7b64e997120c33f833816b343e20", + "size": "373411607" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.1.zip", + "checksum": "SHA-256:112f81fcaed22286f9ba19bbd01d12337aab7b64e997120c33f833816b343e20", + "size": "373411607" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.1.zip", + "checksum": "SHA-256:112f81fcaed22286f9ba19bbd01d12337aab7b64e997120c33f833816b343e20", + "size": "373411607" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.1.zip", + "checksum": "SHA-256:112f81fcaed22286f9ba19bbd01d12337aab7b64e997120c33f833816b343e20", + "size": "373411607" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.1.zip", + "checksum": "SHA-256:112f81fcaed22286f9ba19bbd01d12337aab7b64e997120c33f833816b343e20", + "size": "373411607" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip", + "archiveFileName": "esp32-arduino-libs-3.0.1.zip", + "checksum": "SHA-256:112f81fcaed22286f9ba19bbd01d12337aab7b64e997120c33f833816b343e20", + "size": "373411607" + } + ] + }, + { + "name": "esp-x32", + "version": "2411", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-14.2.0_20241119-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:b1859df334a85541ae746e1b86439f59180d87f8cf1cc04c2e770fadf9f006e9", + "size": "323678089" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-14.2.0_20241119-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:7ff023033a5c00e55b9fc0a0b26d18fb0e476c24e24c5b0459bcb2e05a3729f1", + "size": "320064691" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp-elf-14.2.0_20241119-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:bb11dbf3ed25d4e0cc9e938749519e8236cfa2609e85742d311f1d869111805a", + "size": "319454139" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-i586-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-14.2.0_20241119-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:5ac611dca62ec791d413d1f417d566c444b006d2a4f97bd749b15f782d87249b", + "size": "328335914" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-x86_64-apple-darwin_signed.tar.gz", + "archiveFileName": "xtensa-esp-elf-14.2.0_20241119-x86_64-apple-darwin_signed.tar.gz", + "checksum": "SHA-256:15b3e60362028eaeff9156dc82dac3f1436b4aeef3920b28d7650974d8c34751", + "size": "336215844" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-aarch64-apple-darwin_signed.tar.gz", + "archiveFileName": "xtensa-esp-elf-14.2.0_20241119-aarch64-apple-darwin_signed.tar.gz", + "checksum": "SHA-256:45c475518735133789bacccad31f872318b7ecc0b31cc9b7924aad880034f0bf", + "size": "318797396" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-14.2.0_20241119-i686-w64-mingw32.zip", + "checksum": "SHA-256:b30e450e0af279783c54a9ae77c3b367dd556b78eda930a92ec7b784a74c28c8", + "size": "382457717" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-14.2.0_20241119-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:62ae704777d73c30689efff6e81178632a1ca44d1a2d60f4621eb997e040e028", + "size": "386316009" + } + ] + }, + { + "name": "esp-x32", + "version": "2405", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-13.2.0_20240530-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:bce77e8480701d5a90545369d1b5848f6048eb39c0022d2446d1e33a8e127490", + "size": "208911713" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-13.2.0_20240530-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:7c9e3c1adc733d042ed87b92daa1d6396e1b441c1755f1fa14cb88855719ba88", + "size": "202519931" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp-elf-13.2.0_20240530-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:d6955e8ea6af91574bf9213b92f32ca09eb8640103446b7fa19a63cfeeec5421", + "size": "202206516" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-i586-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-13.2.0_20240530-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:3666ee74ecb693ee6488f11469802630a7b0d32608184045a4f35cb413f59e3d", + "size": "213304863" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-x86_64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp-elf-13.2.0_20240530-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:948cf57b6eecc898b5f70e06ad08ba88c08b627be570ec631dfcd72f6295194a", + "size": "221357024" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-aarch64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp-elf-13.2.0_20240530-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:6f03fdf0cc14a7f3900ee59977f62e8626d8b7c208506e52f1fd883ac223427a", + "size": "199689745" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-i686-w64-mingw32_hotfix.zip", + "archiveFileName": "xtensa-esp-elf-13.2.0_20240530-i686-w64-mingw32_hotfix.zip", + "checksum": "SHA-256:d6b227c50e3c8e21d62502b3140e5ab74a4cb502c2b4169c36238b9858a8fb88", + "size": "266042967" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-x86_64-w64-mingw32_hotfix.zip", + "archiveFileName": "xtensa-esp-elf-13.2.0_20240530-x86_64-w64-mingw32_hotfix.zip", + "checksum": "SHA-256:155ee97b531236e6a7c763395c68ca793e55e74d2cb4d38a23057a153e01e7d0", + "size": "269831985" + } + ] + }, + { + "name": "esp-x32", + "version": "2302", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:e8d35938385447cf9c34735fee2a3b2b61cca6be07db77a45856a1c2a347e423", + "size": "111766903" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:569988acfc2673369f222037c64bac96990cee08cebeebc4f8860e0d984f8bd9", + "size": "106473247" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:6a844f16021e936cc9b87b203978356f57ab2144554f6f2a0f73ffa3d3d316c5", + "size": "105576049" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "checksum": "SHA-256:743d6f03a89329bb09f9550d27fcab677f5cf06b4720793bbcef7883a932681d", + "size": "114870843" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:4d32d764e984f3a570aacfb2f4957619540fb4629534d969b2e83997901334c3", + "size": "119424029" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:dc8fa7f4933bf5cb08e83bacce6160cc9dfe93d7aad1e8f92599bb81ff5b2e28", + "size": "106136827" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "checksum": "SHA-256:62bb6428d107ed3f44c212c77ecf24804b74c97327b0f0ad2029c656c6dbd6ee", + "size": "130847086" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:8febfe4a6476efc69012390106c8c660a14418f025137b0513670c72124339cf", + "size": "134985117" + } + ] + }, + { + "name": "xtensa-esp-elf-gdb", + "version": "14.2_20240403", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/xtensa-esp-elf-gdb-14.2_20240403-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-14.2_20240403-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:9d68472d4cba5cf8c2b79d94f86f92c828e76a632bd1e6be5e7706e5b304d36e", + "size": "31010320" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/xtensa-esp-elf-gdb-14.2_20240403-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-14.2_20240403-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:bdabc3217994815fc311c4e16e588b78f6596b5ad4ffa46c80b40e982cfb1e66", + "size": "30954580" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/xtensa-esp-elf-gdb-14.2_20240403-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-14.2_20240403-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:d54b8d703ba897b28c627da3d27106a3906dd01ba298778a67064710bc33c76d", + "size": "28697281" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/xtensa-esp-elf-gdb-14.2_20240403-i586-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-14.2_20240403-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:64d3bc992ed8fdec383d49e8b803ac494605a38117c8293db8da055037de96b0", + "size": "29890994" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/xtensa-esp-elf-gdb-14.2_20240403-x86_64-apple-darwin14.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-14.2_20240403-x86_64-apple-darwin14.tar.gz", + "checksum": "SHA-256:023e74b3fda793da4bc0509b02de776ee0dad6efaaac17bef5916fb7dc9c26b9", + "size": "44446611" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/xtensa-esp-elf-gdb-14.2_20240403-aarch64-apple-darwin21.1.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-14.2_20240403-aarch64-apple-darwin21.1.tar.gz", + "checksum": "SHA-256:ea757c6bf8c25238f6d2fdcc6bbab25a1b00608a0f9e19b7ddd2f37ddbdc3fb1", + "size": "37021423" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/xtensa-esp-elf-gdb-14.2_20240403-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-gdb-14.2_20240403-i686-w64-mingw32.zip", + "checksum": "SHA-256:322e8d9b700dc32d8158e3dc55fb85ec55de48d0bb7789375ee39a28d5d655e2", + "size": "26302466" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/xtensa-esp-elf-gdb-14.2_20240403-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-gdb-14.2_20240403-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:a27a2fe20f192f8e0a51b8936428b4e1cf8935cfe008ee445cc49f6fc7f6db2e", + "size": "28366035" + } + ] + }, + { + "name": "xtensa-esp-elf-gdb", + "version": "12.1_20231023", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/xtensa-esp-elf-gdb-12.1_20231023-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20231023-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:d0743ec43cd92c35452a9097f7863281de4e72f04120d63cfbcf9d591a373529", + "size": "36942094" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/xtensa-esp-elf-gdb-12.1_20231023-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20231023-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:bc1fac0366c6a08e26c45896ca21c8c90efc2cdd431b8ba084e8772e15502d0e", + "size": "37134601" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/xtensa-esp-elf-gdb-12.1_20231023-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20231023-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:25efc51d52b71f097ccec763c5c885c8f5026b432fec4b5badd6a5f36fe34d04", + "size": "34579556" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/xtensa-esp-elf-gdb-12.1_20231023-i586-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20231023-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:e0af0b3b4a6b29a843cd5f47e331a966d9258f7d825b4656c6251490f71b05b2", + "size": "35676578" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/xtensa-esp-elf-gdb-12.1_20231023-x86_64-apple-darwin14.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20231023-x86_64-apple-darwin14.tar.gz", + "checksum": "SHA-256:bd146fd99a52b2d71c7ce0f62b9e18f3423d6cae7b2b2c954046b0dd7a23142f", + "size": "52863941" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/xtensa-esp-elf-gdb-12.1_20231023-aarch64-apple-darwin21.1.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20231023-aarch64-apple-darwin21.1.tar.gz", + "checksum": "SHA-256:5edc76565bf9d2fadf24e443ddf3df7567354f336a65d4af5b2ee805cdfcec24", + "size": "33504923" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/xtensa-esp-elf-gdb-12.1_20231023-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20231023-i686-w64-mingw32.zip", + "checksum": "SHA-256:ea4f3ee6b95ad1ad2e07108a21a50037a3e64a420cdeb34b2ba95d612faed898", + "size": "31068749" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/xtensa-esp-elf-gdb-12.1_20231023-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-gdb-12.1_20231023-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:13bb97f39173948d1cfb6e651d9b335ea9d52f1fdd0dda1eda3a2d23d8c63644", + "size": "33514906" + } + ] + }, + { + "name": "xtensa-esp-elf-gdb", + "version": "11.2_20220823", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/xtensa-esp-elf-gdb-11.2_20220823-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-11.2_20220823-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:b5f7cc3e4b5a58db655754083ed9652e4953e71c3b4922fb624e7a034ec24a64", + "size": 26947336 + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/xtensa-esp-elf-gdb-11.2_20220823-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-11.2_20220823-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:816acfae38b6b443f4f1590395f68f079243539259d19c7772ae6416c6519444", + "size": 27134508 + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/xtensa-esp-elf-gdb-11.2_20220823-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-11.2_20220823-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:4dd1bace0633196fddfdcef3cebcc4bbfce22f5a0d2d1e3d618f3d8a6cbfcacc", + "size": 25205239 + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/xtensa-esp-elf-gdb-11.2_20220823-i586-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-11.2_20220823-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:27744d09d171be2f55ec15fa7f2d7f8ff94d33f7e130d24ebe082cb6c438618b", + "size": 25978028 + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/xtensa-esp-elf-gdb-11.2_20220823-x86_64-apple-darwin14.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-11.2_20220823-x86_64-apple-darwin14.tar.gz", + "checksum": "SHA-256:1432faa12d7301133f6ee654d60751b57adcc6cf323ee1ecc393f06f0225eff4", + "size": 38386785 + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/xtensa-esp-elf-gdb-11.2_20220823-aarch64-apple-darwin21.1.tar.gz", + "archiveFileName": "xtensa-esp-elf-gdb-11.2_20220823-aarch64-apple-darwin21.1.tar.gz", + "checksum": "SHA-256:d0b542ef070ea72857f9cf554f176a0a9d868cd59e05ac293ad39402bcc5277d", + "size": 21671964 + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/xtensa-esp-elf-gdb-11.2_20220823-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-gdb-11.2_20220823-i686-w64-mingw32.zip", + "checksum": "SHA-256:1678b06aa80b1d689d05548056635efde5b73b98f2c3de5d555bcfc6f374c5d0", + "size": 23241302 + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/xtensa-esp-elf-gdb-11.2_20220823-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp-elf-gdb-11.2_20220823-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:7060df4b6aa133e282147c3651d50222d677d6a0fff92979c500353b099a3f41", + "size": 25135265 + } + ] + }, + { + "name": "esp-rv32", + "version": "2411", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-x86_64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-14.2.0_20241119-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:a16942465d33c7f0334c16e83bc6feb62e06eeb79cf19099293480bb8d48c0cd", + "size": "593721156" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-aarch64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-14.2.0_20241119-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:22486233d0e0fd58a54ae453b701f195f1432fc6f2e17085b9d6c8d5d9acefb7", + "size": "587879927" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-arm-linux-gnueabi.tar.gz", + "archiveFileName": "riscv32-esp-elf-14.2.0_20241119-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:27a72d5d96cdb56dae2a1da5dfde1717c18a8c1f9a1454c8e34a8bd34abe662d", + "size": "586531522" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-i586-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-14.2.0_20241119-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:b7bd6e4cd53a4c55831d48e96a3d500bfffb091bec84a30bc8c3ad687e3eb3a2", + "size": "597070471" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-x86_64-apple-darwin_signed.tar.gz", + "archiveFileName": "riscv32-esp-elf-14.2.0_20241119-x86_64-apple-darwin_signed.tar.gz", + "checksum": "SHA-256:5f8b571e1aedbe9f856f3bdeca6600cd5510ccff1ca102c4f001421eda560585", + "size": "602343061" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-aarch64-apple-darwin_signed.tar.gz", + "archiveFileName": "riscv32-esp-elf-14.2.0_20241119-aarch64-apple-darwin_signed.tar.gz", + "checksum": "SHA-256:a7276042a7eb2d33c2dff7167539e445c32c07d43a2c6827e86d035642503e0b", + "size": "578521565" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-i686-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-14.2.0_20241119-i686-w64-mingw32.zip", + "checksum": "SHA-256:54193a97bd75205678ead8d11f00b351cfa3c2a6e5ab5d966341358b9f9422d7", + "size": "672055172" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-x86_64-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-14.2.0_20241119-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:24c8407fa467448d394e0639436a5ede31caf1838e35e8435e19df58ebed438c", + "size": "677812937" + } + ] + }, + { + "name": "esp-rv32", + "version": "2405", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/riscv32-esp-elf-13.2.0_20240530-x86_64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-13.2.0_20240530-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:e7fbfffbb19dcd3764a9848a141bf44e19ad0b48e0bd1515912345c26fe52fba", + "size": "294346758" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/riscv32-esp-elf-13.2.0_20240530-aarch64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-13.2.0_20240530-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:a178a895b807ed2e87d5d62153c36a6aae048581f527c0eb152f0a02b8de9571", + "size": "288374597" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/riscv32-esp-elf-13.2.0_20240530-arm-linux-gnueabi.tar.gz", + "archiveFileName": "riscv32-esp-elf-13.2.0_20240530-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:4a2f176d0f5bc8a70645975e2a08ea94145fb69b7225c5cdcbd6024a4836aaf5", + "size": "287737495" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/riscv32-esp-elf-13.2.0_20240530-i586-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-13.2.0_20240530-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:7a6f02f1b2effafb18600bbf602818f6923fd320f000fb8659f34acbfda8812f", + "size": "299138540" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/riscv32-esp-elf-13.2.0_20240530-x86_64-apple-darwin.tar.gz", + "archiveFileName": "riscv32-esp-elf-13.2.0_20240530-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:a193b4f025d0d836b0a9d9cbe760af1c53e53af66fc332fe98952bc4c456dd9a", + "size": "305025700" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/riscv32-esp-elf-13.2.0_20240530-aarch64-apple-darwin.tar.gz", + "archiveFileName": "riscv32-esp-elf-13.2.0_20240530-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:7082dd2e2123dea5609a24092d19ac6612ae7e219df1d298de6b2f64cb4af0df", + "size": "285458443" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/riscv32-esp-elf-13.2.0_20240530-i686-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-13.2.0_20240530-i686-w64-mingw32.zip", + "checksum": "SHA-256:590bfb10576702639825581cc00c445da6e577012840a787137417e80d15f46d", + "size": "366573064" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/riscv32-esp-elf-13.2.0_20240530-x86_64-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-13.2.0_20240530-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:413eb9f6adf8fdaf25544d014c850fc09eb38bb93a2fc5ebd107ab1b0de1bb3a", + "size": "369820297" + } + ] + }, + { + "name": "esp-rv32", + "version": "2302", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/riscv32-esp-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:1eb0d65990547ee9706b90406600cbc3638814d5feb7c1f7b44bb5416478a5bd", + "size": "257615266" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/riscv32-esp-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:921fcdc170c7fe5d6a0a30470ed1875c8926d910c19739fc950c8d1836e4c1c5", + "size": "253094184" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/riscv32-esp-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "archiveFileName": "riscv32-esp-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:f66e06312b58251c2121c1b1df1102565708573b86b2a9fe0c03ea1b0e9a7511", + "size": "252558021" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/riscv32-esp-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "checksum": "SHA-256:8abcac0331ef8973d1c705e77523364ebec7e98b37640d4a1d036912f3cbe946", + "size": "261248375" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/riscv32-esp-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "archiveFileName": "riscv32-esp-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:76a334bc75a4e3891c222c84d7968817f2d0699d2976fc2a1658e56395283bec", + "size": "268987133" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/riscv32-esp-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "archiveFileName": "riscv32-esp-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:f30571945b257a10a26901bba3c5892e07c192aacf9ed6e8fcd11ca36ed827d2", + "size": "252159713" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/riscv32-esp-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "checksum": "SHA-256:a5dfbb6dbf6fc6c6ea9beb2723af059ba3c5b2c86c2f0dc3b21afdc7bb229bf5", + "size": "324863847" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/riscv32-esp-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:9deae9e0013b2f7bbf017f9c8135755bfa89522f337c7dca35872bf12ec08176", + "size": "328092732" + } + ] + }, + { + "name": "riscv32-esp-elf-gdb", + "version": "14.2_20240403", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/riscv32-esp-elf-gdb-14.2_20240403-x86_64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-14.2_20240403-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:ce004bc0bbd71b246800d2d13b239218b272a38bd528e316f21f1af2db8a4b13", + "size": "30707431" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/riscv32-esp-elf-gdb-14.2_20240403-aarch64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-14.2_20240403-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:ba10f2866c61410b88c65957274280b1a62e3bed05131654ed9b6758efe18e55", + "size": "30824065" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/riscv32-esp-elf-gdb-14.2_20240403-arm-linux-gnueabi.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-14.2_20240403-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:88539db5d987f28827efac7e26080a2803b9b539342ccd2963ccfdd56d7f08f7", + "size": "29000575" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/riscv32-esp-elf-gdb-14.2_20240403-i586-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-14.2_20240403-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:0e628ee37438ab6ba05eb889a76d09e50cb98e0020a16b8e2b935c5cf19b4ed2", + "size": "29947521" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/riscv32-esp-elf-gdb-14.2_20240403-x86_64-apple-darwin14.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-14.2_20240403-x86_64-apple-darwin14.tar.gz", + "checksum": "SHA-256:8f6bda832d70dad5860a639d55aba4237bd10cbac9f4822db1eece97357b34a9", + "size": "44196117" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/riscv32-esp-elf-gdb-14.2_20240403-aarch64-apple-darwin21.1.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-14.2_20240403-aarch64-apple-darwin21.1.tar.gz", + "checksum": "SHA-256:d88b6116e86456c8480ce9bc95aed375a35c0d091f1da0a53b86be0e6ef3d320", + "size": "36794404" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/riscv32-esp-elf-gdb-14.2_20240403-i686-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-gdb-14.2_20240403-i686-w64-mingw32.zip", + "checksum": "SHA-256:d6e7ce05805b0d8d4dd138ad239b98a1adf8da98941867d60760eb1ae5361730", + "size": "26486295" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v14.2_20240403/riscv32-esp-elf-gdb-14.2_20240403-x86_64-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-gdb-14.2_20240403-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:5c9f211dc46daf6b96fad09d709284a0f0186fef8947d9f6edd6bca5b5ad4317", + "size": "27942579" + } + ] + }, + { + "name": "riscv32-esp-elf-gdb", + "version": "12.1_20231023", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/riscv32-esp-elf-gdb-12.1_20231023-x86_64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20231023-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:2c78b806be176b1e449e07ff83429d38dfc39a13f89a127ac1ffa6c1230537a0", + "size": "36630145" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/riscv32-esp-elf-gdb-12.1_20231023-aarch64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20231023-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:33f80117c8777aaff9179e27953e41764c5c46b3c576dc96a37ecc7a368807ec", + "size": "36980143" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/riscv32-esp-elf-gdb-12.1_20231023-arm-linux-gnueabi.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20231023-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:292e6ec0a9381c1480bbadf5caae25e86428b68fb5d030c9be7deda5e7f070e0", + "size": "34950318" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/riscv32-esp-elf-gdb-12.1_20231023-i586-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20231023-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:68a25fbcfc6371ec4dbe503ec92211977eb2006f0c29e67dbce6b93c70c6b7ec", + "size": "35801607" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/riscv32-esp-elf-gdb-12.1_20231023-x86_64-apple-darwin14.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20231023-x86_64-apple-darwin14.tar.gz", + "checksum": "SHA-256:322c722e6c12225ed8cd97f95a0375105756dc5113d369958ce0858ad1a90257", + "size": "52618688" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/riscv32-esp-elf-gdb-12.1_20231023-aarch64-apple-darwin21.1.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20231023-aarch64-apple-darwin21.1.tar.gz", + "checksum": "SHA-256:c2224b3a8d02451c530cf004c29653292d963a1b4021b4b472b862b6dbe97e0b", + "size": "33149392" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/riscv32-esp-elf-gdb-12.1_20231023-i686-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20231023-i686-w64-mingw32.zip", + "checksum": "SHA-256:4b42149a99dd87ee7e6dde25c99bad966c7f964253fa8f771593d7cef69f5602", + "size": "31635103" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20231023/riscv32-esp-elf-gdb-12.1_20231023-x86_64-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-gdb-12.1_20231023-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:728231546ad5006d34463f972658b2a89e52f660a42abab08a29bedd4a8046ad", + "size": "33400816" + } + ] + }, + { + "name": "riscv32-esp-elf-gdb", + "version": "11.2_20220823", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/riscv32-esp-elf-gdb-11.2_20220823-x86_64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-11.2_20220823-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:6bf5b5d2d407e074af2a74fc826764934ac1625a1751c52fbc0d4d7772061f8f", + "size": 26799809 + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/riscv32-esp-elf-gdb-11.2_20220823-aarch64-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-11.2_20220823-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:e54ef67cdb5724fc2da8f0487f19b2c83c08b560fff317f5ffd98fbb230b397a", + "size": 27021672 + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/riscv32-esp-elf-gdb-11.2_20220823-arm-linux-gnueabi.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-11.2_20220823-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:86772c6aee8a05b2c75a6b04e9da630e35e8415b64da8ccde92a5fb2d3c7fcf4", + "size": 25532577 + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/riscv32-esp-elf-gdb-11.2_20220823-i586-linux-gnu.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-11.2_20220823-i586-linux-gnu.tar.gz", + "checksum": "SHA-256:3463be3e24182b7f1bd0fb232020534445b2d0ea0e7093c1b4f4da102b3baf52", + "size": 26188698 + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/riscv32-esp-elf-gdb-11.2_20220823-x86_64-apple-darwin14.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-11.2_20220823-x86_64-apple-darwin14.tar.gz", + "checksum": "SHA-256:a9db1811ebb9271134eba2f7c303fc2587bd4b2a1ae33cd05ff2605cd2fb30d2", + "size": 38397584 + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/riscv32-esp-elf-gdb-11.2_20220823-aarch64-apple-darwin21.1.tar.gz", + "archiveFileName": "riscv32-esp-elf-gdb-11.2_20220823-aarch64-apple-darwin21.1.tar.gz", + "checksum": "SHA-256:c94fb6d726b8d97e65e23237f5126a41343bca8f22a0414df5f0e6777e36f51c", + "size": 21593613 + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/riscv32-esp-elf-gdb-11.2_20220823-i686-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-gdb-11.2_20220823-i686-w64-mingw32.zip", + "checksum": "SHA-256:20cdee8a1c01428363ef02f4cc8035c65508d6b43560c525733eae94b7c7bb50", + "size": 23436802 + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/binutils-gdb/releases/download/esp-gdb-v11.2_20220823/riscv32-esp-elf-gdb-11.2_20220823-x86_64-w64-mingw32.zip", + "archiveFileName": "riscv32-esp-elf-gdb-11.2_20220823-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:add72366485b784b66837ce263548980f1df144d0954c42d75a81f6acbd43cac", + "size": 24802315 + } + ] + }, + { + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20241016", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-linux-amd64-0.12.0-esp32-20241016.tar.gz", + "archiveFileName": "openocd-esp32-linux-amd64-0.12.0-esp32-20241016.tar.gz", + "checksum": "SHA-256:e82b0f036dc99244bead5f09a86e91bb2365cbcd1122ac68261e5647942485df", + "size": "2398717" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-linux-arm64-0.12.0-esp32-20241016.tar.gz", + "archiveFileName": "openocd-esp32-linux-arm64-0.12.0-esp32-20241016.tar.gz", + "checksum": "SHA-256:8f8daf5bd22ec5d2fa9257b0862ec33da18ee677e023fb9a9eb17f74ce208c76", + "size": "2271584" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-linux-armel-0.12.0-esp32-20241016.tar.gz", + "archiveFileName": "openocd-esp32-linux-armel-0.12.0-esp32-20241016.tar.gz", + "checksum": "SHA-256:bc9c020ecf20e2000f76cffa44305fd5bc44d2e688ea78cce423399d33f19767", + "size": "2414206" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-macos-0.12.0-esp32-20241016.tar.gz", + "archiveFileName": "openocd-esp32-macos-0.12.0-esp32-20241016.tar.gz", + "checksum": "SHA-256:02a2dffe801a2d005fa9e614d80ff8173395b2cb0b5d3118d0229d094a9946a7", + "size": "2508089" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-macos-arm64-0.12.0-esp32-20241016.tar.gz", + "archiveFileName": "openocd-esp32-macos-arm64-0.12.0-esp32-20241016.tar.gz", + "checksum": "SHA-256:c382f9e884d6565cb6089bff5f200f4810994667d885f062c3d3c5625a0fa9d6", + "size": "2552569" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-win32-0.12.0-esp32-20241016.zip", + "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20241016.zip", + "checksum": "SHA-256:3b5d615e0a72cc771a45dd469031312d5881c01d7b6bc9edb29b8b6bda8c2e90", + "size": "2946244" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-win64-0.12.0-esp32-20241016.zip", + "archiveFileName": "openocd-esp32-win64-0.12.0-esp32-20241016.zip", + "checksum": "SHA-256:5e7b2fd1947d3a8625f6a11db7a2340cf2f41ff4c61284c022c7d7c32b18780a", + "size": "2946244" + } + ] + }, + { + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20240821", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240821/openocd-esp32-linux-amd64-0.12.0-esp32-20240821.tar.gz", + "archiveFileName": "openocd-esp32-linux-amd64-0.12.0-esp32-20240821.tar.gz", + "checksum": "SHA-256:f8c68541fa38307bc0c0763b7e1e3fe4e943d5d45da07d817a73b492e103b652", + "size": "2373094" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240821/openocd-esp32-linux-arm64-0.12.0-esp32-20240821.tar.gz", + "archiveFileName": "openocd-esp32-linux-arm64-0.12.0-esp32-20240821.tar.gz", + "checksum": "SHA-256:4d6e263d84e447354dc685848557d6c284dda7fe007ee451f729a7edfa7baad7", + "size": "2251272" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240821/openocd-esp32-linux-armel-0.12.0-esp32-20240821.tar.gz", + "archiveFileName": "openocd-esp32-linux-armel-0.12.0-esp32-20240821.tar.gz", + "checksum": "SHA-256:9d45679f2c4cf450d5e2350047cf57bb76dde2487d30cebce0a72c9173b5c45b", + "size": "2390074" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240821/openocd-esp32-macos-0.12.0-esp32-20240821.tar.gz", + "archiveFileName": "openocd-esp32-macos-0.12.0-esp32-20240821.tar.gz", + "checksum": "SHA-256:565c8fabc5f19a6e7a0864a294d74b307eec30b9291d16d3fc90e273f0330cb4", + "size": "2485320" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240821/openocd-esp32-macos-arm64-0.12.0-esp32-20240821.tar.gz", + "archiveFileName": "openocd-esp32-macos-arm64-0.12.0-esp32-20240821.tar.gz", + "checksum": "SHA-256:68c5c7cf3d15b9810939a5edabc6ff2c9f4fc32262de91fc292a180bc5cc0637", + "size": "2530336" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240821/openocd-esp32-win32-0.12.0-esp32-20240821.zip", + "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20240821.zip", + "checksum": "SHA-256:463fc2903ddaf03f86ff50836c5c63cc696550b0446140159eddfd2e85570c5d", + "size": "2916409" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240821/openocd-esp32-win64-0.12.0-esp32-20240821.zip", + "archiveFileName": "openocd-esp32-win64-0.12.0-esp32-20240821.zip", + "checksum": "SHA-256:550f57369f1f1f6cc600b5dffa3378fd6164d8ea8db7c567cf41091771f090cb", + "size": "2916408" + } + ] + }, + { + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20240318", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240318/openocd-esp32-linux-amd64-0.12.0-esp32-20240318.tar.gz", + "archiveFileName": "openocd-esp32-linux-amd64-0.12.0-esp32-20240318.tar.gz", + "checksum": "SHA-256:cf26c5cef4f6b04aa23cd2778675604e5a74a4ce4d8d17b854d05fbcb782d52c", + "size": "2252682" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240318/openocd-esp32-linux-arm64-0.12.0-esp32-20240318.tar.gz", + "archiveFileName": "openocd-esp32-linux-arm64-0.12.0-esp32-20240318.tar.gz", + "checksum": "SHA-256:9b97a37aa2cab94424a778c25c0b4aa0f90d6ef9cda764a1d9289d061305f4b7", + "size": "2132904" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240318/openocd-esp32-linux-armel-0.12.0-esp32-20240318.tar.gz", + "archiveFileName": "openocd-esp32-linux-armel-0.12.0-esp32-20240318.tar.gz", + "checksum": "SHA-256:b7e82776ec374983807d3389df09c632ad9bc8341f2075690b6b500319dfeaf4", + "size": "2271761" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240318/openocd-esp32-macos-0.12.0-esp32-20240318.tar.gz", + "archiveFileName": "openocd-esp32-macos-0.12.0-esp32-20240318.tar.gz", + "checksum": "SHA-256:b16c3082c94df1079367c44d99f7a8605534cd48aabc18898e46e94a2c8c57e7", + "size": "2365588" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240318/openocd-esp32-macos-arm64-0.12.0-esp32-20240318.tar.gz", + "archiveFileName": "openocd-esp32-macos-arm64-0.12.0-esp32-20240318.tar.gz", + "checksum": "SHA-256:534ec925ae6e35e869e4e4e6e4d2c4a1eb081f97ebcc2dd5efdc52d12f4c2f86", + "size": "2406377" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240318/openocd-esp32-win32-0.12.0-esp32-20240318.zip", + "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20240318.zip", + "checksum": "SHA-256:d379329eba052435173ab0d69c9b15bc164a6ce489e2a67cd11169d2dabff633", + "size": "2783915" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240318/openocd-esp32-win32-0.12.0-esp32-20240318.zip", + "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20240318.zip", + "checksum": "SHA-256:d379329eba052435173ab0d69c9b15bc164a6ce489e2a67cd11169d2dabff633", + "size": "2783915" + } + ] + }, + { + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230921", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-linux-amd64-0.12.0-esp32-20230921.tar.gz", + "archiveFileName": "openocd-esp32-linux-amd64-0.12.0-esp32-20230921.tar.gz", + "checksum": "SHA-256:61e38e0a13a5c1664624ec1c397d7f7d6868554b0d345d3fb1f7294cce38cc4b", + "size": "2193783" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-linux-arm64-0.12.0-esp32-20230921.tar.gz", + "archiveFileName": "openocd-esp32-linux-arm64-0.12.0-esp32-20230921.tar.gz", + "checksum": "SHA-256:6430315dc1b926541c93cef63d2b08982543ad3f9fe6e0d7107c8a518ef20432", + "size": "2062058" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-linux-armel-0.12.0-esp32-20230921.tar.gz", + "archiveFileName": "openocd-esp32-linux-armel-0.12.0-esp32-20230921.tar.gz", + "checksum": "SHA-256:5df16d8a91f013a547f6b3b914c655a9d267996a3b6503031b335ac04a4f8d15", + "size": "2206666" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-macos-0.12.0-esp32-20230921.tar.gz", + "archiveFileName": "openocd-esp32-macos-0.12.0-esp32-20230921.tar.gz", + "checksum": "SHA-256:0a4f764934f488af18cdac2a0d152dd36b4870f3bec1a2d4e25b6b3b7a5258a0", + "size": "2305832" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-macos-arm64-0.12.0-esp32-20230921.tar.gz", + "archiveFileName": "openocd-esp32-macos-arm64-0.12.0-esp32-20230921.tar.gz", + "checksum": "SHA-256:6dce89048f642eb0559a915b6e514f90feb2a95afe21b84f0b0ebf2b27824816", + "size": "2341406" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-win32-0.12.0-esp32-20230921.zip", + "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20230921.zip", + "checksum": "SHA-256:ac9d522a63b0816f64d921547bd55c031788035ced85c067d8e7c2862cb1bd0d", + "size": "2710475" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-win32-0.12.0-esp32-20230921.zip", + "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20230921.zip", + "checksum": "SHA-256:ac9d522a63b0816f64d921547bd55c031788035ced85c067d8e7c2862cb1bd0d", + "size": "2710475" + } + ] + }, + { + "name": "openocd-esp32", + "version": "v0.12.0-esp32-20230419", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-linux-amd64-0.12.0-esp32-20230419.tar.gz", + "archiveFileName": "openocd-esp32-linux-amd64-0.12.0-esp32-20230419.tar.gz", + "checksum": "SHA-256:5144e7516cd75a2152b35ecae0a400f7d3d4424c2488fbacc49433564f54c70d", + "size": 2126949 + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-linux-arm64-0.12.0-esp32-20230419.tar.gz", + "archiveFileName": "openocd-esp32-linux-arm64-0.12.0-esp32-20230419.tar.gz", + "checksum": "SHA-256:1c4d900c738fe00730c6033abb6cf1cc6587717dbeee291d5908272d153d329a", + "size": 1989161 + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-linux-armel-0.12.0-esp32-20230419.tar.gz", + "archiveFileName": "openocd-esp32-linux-armel-0.12.0-esp32-20230419.tar.gz", + "checksum": "SHA-256:293258fd67618dd352e1096137ad9f2b801926eaf74ffcd570540ae94ad8ee5c", + "size": 2129727 + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-macos-0.12.0-esp32-20230419.tar.gz", + "archiveFileName": "openocd-esp32-macos-0.12.0-esp32-20230419.tar.gz", + "checksum": "SHA-256:621aad7d011c6817cde9570dfea42c7bcc699458bf43c37706cb4c2f6475a247", + "size": 2237976 + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-macos-arm64-0.12.0-esp32-20230419.tar.gz", + "archiveFileName": "openocd-esp32-macos-arm64-0.12.0-esp32-20230419.tar.gz", + "checksum": "SHA-256:3af7eac3a7de3939731ec4c13fb5d72a8e6ce5e5d274bb9697f5d93039561e42", + "size": 2270699 + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-win32-0.12.0-esp32-20230419.zip", + "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20230419.zip", + "checksum": "SHA-256:f2cb3d9cacfe789c20d3272af846d726a062ce8f2e4ee142bddb27501d7dd7a7", + "size": 2619680 + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-win32-0.12.0-esp32-20230419.zip", + "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20230419.zip", + "checksum": "SHA-256:f2cb3d9cacfe789c20d3272af846d726a062ce8f2e4ee142bddb27501d7dd7a7", + "size": 2619680 + } + ] + }, + { + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20221026", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20221026/openocd-esp32-linux-amd64-0.11.0-esp32-20221026.tar.gz", + "archiveFileName": "openocd-esp32-linux-amd64-0.11.0-esp32-20221026.tar.gz", + "checksum": "SHA-256:ce63e9b1dfab60cc62da5dc2abcc22ba7036c42afe74671c787eb026744e7d0b", + "size": "2051435" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20221026/openocd-esp32-linux-arm64-0.11.0-esp32-20221026.tar.gz", + "archiveFileName": "openocd-esp32-linux-arm64-0.11.0-esp32-20221026.tar.gz", + "checksum": "SHA-256:fe60a3a603e8c6bee47367e40fcb8c0da3a38e01163e9674ebc919b067700506", + "size": "1993843" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20221026/openocd-esp32-linux-armel-0.11.0-esp32-20221026.tar.gz", + "archiveFileName": "openocd-esp32-linux-armel-0.11.0-esp32-20221026.tar.gz", + "checksum": "SHA-256:6ef76101cca196a4be30fc74f191eff34abb423e32930a383012b866c9b76135", + "size": "2092111" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20221026/openocd-esp32-macos-0.11.0-esp32-20221026.tar.gz", + "archiveFileName": "openocd-esp32-macos-0.11.0-esp32-20221026.tar.gz", + "checksum": "SHA-256:8edc666a0a230432554b73df7c62e0b5ec21fb018e7fda13b11a7ca8b6c1763b", + "size": "2199855" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20221026/openocd-esp32-macos-arm64-0.11.0-esp32-20221026.tar.gz", + "archiveFileName": "openocd-esp32-macos-arm64-0.11.0-esp32-20221026.tar.gz", + "checksum": "SHA-256:c426c0158ba6488e2f432f7c5b22e79155b5b0fae6d1ad5bbd7894723b43aa12", + "size": "2247179" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20221026/openocd-esp32-win32-0.11.0-esp32-20221026.zip", + "archiveFileName": "openocd-esp32-win32-0.11.0-esp32-20221026.zip", + "checksum": "SHA-256:e0e789d35308c029c6b53457cf4a42a5620cb1a3014740026c089c2ed4fd77b2", + "size": "2493214" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20221026/openocd-esp32-win32-0.11.0-esp32-20221026.zip", + "archiveFileName": "openocd-esp32-win32-0.11.0-esp32-20221026.zip", + "checksum": "SHA-256:e0e789d35308c029c6b53457cf4a42a5620cb1a3014740026c089c2ed4fd77b2", + "size": "2493214" + } + ] + }, + { + "name": "openocd-esp32", + "version": "v0.11.0-esp32-20220706", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20220706/openocd-esp32-win32-0.11.0-esp32-20220706.zip", + "archiveFileName": "openocd-esp32-win32-0.11.0-esp32-20220706.zip", + "checksum": "SHA-256:c3d39eb4365a9947e71f1d3780ce031185bc6437f21186568a5c05f23f57a8d0", + "size": "2608736" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20220706/openocd-esp32-win32-0.11.0-esp32-20220706.zip", + "archiveFileName": "openocd-esp32-win32-0.11.0-esp32-20220706.zip", + "checksum": "SHA-256:c3d39eb4365a9947e71f1d3780ce031185bc6437f21186568a5c05f23f57a8d0", + "size": "2608736" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20220706/openocd-esp32-macos-0.11.0-esp32-20220706.tar.gz", + "archiveFileName": "openocd-esp32-macos-0.11.0-esp32-20220706.tar.gz", + "checksum": "SHA-256:333ee2ec3c9b5dc6ad4509faae55335cdea7f8bf83a56bfcf5327e4497c8538a", + "size": "2077882" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20220706/openocd-esp32-linux-amd64-0.11.0-esp32-20220706.tar.gz", + "archiveFileName": "openocd-esp32-linux-amd64-0.11.0-esp32-20220706.tar.gz", + "checksum": "SHA-256:26f1f18dd93eb70a13203848d3fb1cc2e0de1fd6749c7dd771b2de8709735aed", + "size": "2011201" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20220706/openocd-esp32-linux-amd64-0.11.0-esp32-20220706.tar.gz", + "archiveFileName": "openocd-esp32-linux-amd64-0.11.0-esp32-20220706.tar.gz", + "checksum": "SHA-256:26f1f18dd93eb70a13203848d3fb1cc2e0de1fd6749c7dd771b2de8709735aed", + "size": "2011201" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20220706/openocd-esp32-linux-armhf-0.11.0-esp32-20220706.tar.gz", + "archiveFileName": "openocd-esp32-linux-armhf-0.11.0-esp32-20220706.tar.gz", + "checksum": "SHA-256:7f3b57332104e8b8e6194553365a70a9d3754878cfc063d5dc5d839513a63de9", + "size": "1902964" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/openocd-esp32/releases/download/v0.11.0-esp32-20220706/openocd-esp32-linux-arm64-0.11.0-esp32-20220706.tar.gz", + "archiveFileName": "openocd-esp32-linux-arm64-0.11.0-esp32-20220706.tar.gz", + "checksum": "SHA-256:f97792bc2852937ec0accb9f0eb2e49926c0f747a71f101a4e34aed75d2c6fcc", + "size": "1954685" + } + ] + }, + { + "name": "esptool_py", + "version": "4.9.dev3", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.1.0-RC3/esptool-v4.9.dev3-linux-amd64.tar.gz", + "archiveFileName": "esptool-v4.9.dev3-linux-amd64.tar.gz", + "checksum": "SHA-256:4ecaf51836cbf4ea3c19840018bfef3b0b8cd8fc3c95f6e1e043ca5bbeab9bf0", + "size": "64958202" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.1.0-RC3/esptool-v4.9.dev3-linux-armv7.tar.gz", + "archiveFileName": "esptool-v4.9.dev3-linux-armv7.tar.gz", + "checksum": "SHA-256:fff818573bce483ee793ac83c8211f6abf764aa3350f198228859f696a0a0b36", + "size": "31530030" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.1.0-RC3/esptool-v4.9.dev3-linux-aarch64.tar.gz", + "archiveFileName": "esptool-v4.9.dev3-linux-aarch64.tar.gz", + "checksum": "SHA-256:5b274bdff2f62e6a07c3c1dfa51b1128924621f661747eca3dbe0f77972f2f06", + "size": "33663882" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.1.0-RC3/esptool-v4.9.dev3-macos-amd64.tar.gz", + "archiveFileName": "esptool-v4.9.dev3-macos-amd64.tar.gz", + "checksum": "SHA-256:c733c83b58fcf5f642fbb2fddb8ff24640c2c785126cba0821fb70c4a5ceea7a", + "size": "32767836" + }, + { + "host": "arm64-apple-darwin", + "url": "e", + "archiveFileName": "esptool-v4.9.dev3-macos-arm64.tar.gz", + "checksum": "SHA-256:83c195a15981e6a5e7a130db2ccfb21e2d8093912e5b003681f9a5abadd71af7", + "size": "30121441" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.1.0-RC3/esptool-v4.9.dev3-win64.zip", + "archiveFileName": "esptool-v4.9.dev3-win64.zip", + "checksum": "SHA-256:890051a4fdc684ff6f4af18d0bb27d274ca940ee0eef716a9455f8c64b25b215", + "size": "36072564" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/3.1.0-RC3/esptool-v4.9.dev3-win64.zip", + "archiveFileName": "esptool-v4.9.dev3-win64.zip", + "checksum": "SHA-256:890051a4fdc684ff6f4af18d0bb27d274ca940ee0eef716a9455f8c64b25b215", + "size": "36072564" + } + ] + }, + { + "name": "esptool_py", + "version": "4.6", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.9/esptool-v4.6-src.tar.gz", + "archiveFileName": "esptool-v4.6-src.tar.gz", + "checksum": "SHA-256:22f9bad0cd1cea14e554ac1f4a6d8f67415ff7029a66ce9130756276e7264e5a", + "size": "99141" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.9/esptool-v4.6-src.tar.gz", + "archiveFileName": "esptool-v4.6-src.tar.gz", + "checksum": "SHA-256:22f9bad0cd1cea14e554ac1f4a6d8f67415ff7029a66ce9130756276e7264e5a", + "size": "99141" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.9/esptool-v4.6-src.tar.gz", + "archiveFileName": "esptool-v4.6-src.tar.gz", + "checksum": "SHA-256:22f9bad0cd1cea14e554ac1f4a6d8f67415ff7029a66ce9130756276e7264e5a", + "size": "99141" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.9/esptool-v4.6-src.tar.gz", + "archiveFileName": "esptool-v4.6-src.tar.gz", + "checksum": "SHA-256:22f9bad0cd1cea14e554ac1f4a6d8f67415ff7029a66ce9130756276e7264e5a", + "size": "99141" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.9/esptool-v4.6-macos.tar.gz", + "archiveFileName": "esptool-v4.6-macos.tar.gz", + "checksum": "SHA-256:885ec69fcffdcb9e7c6eacd2589f13a45ce6bcb6742bea368ec3a73bcca6dd59", + "size": "5851297" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.9/esptool-v4.6-win64.zip", + "archiveFileName": "esptool-v4.6-win64.zip", + "checksum": "SHA-256:c7c68cd1aa520cbfce488ff6a77818ece272272eb012831b9d9ab1280a7c393f", + "size": "6638480" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.9/esptool-v4.6-win64.zip", + "archiveFileName": "esptool-v4.6-win64.zip", + "checksum": "SHA-256:c7c68cd1aa520cbfce488ff6a77818ece272272eb012831b9d9ab1280a7c393f", + "size": "6638480" + } + ] + }, + { + "name": "esptool_py", + "version": "4.5.1", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-src.tar.gz", + "archiveFileName": "esptool-v4.5.1-src.tar.gz", + "checksum": "SHA-256:aa06831a7d88d8ccde4ea21241e983a08dbdae967290e181658b0d18bffc8f86", + "size": "96922" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-src.tar.gz", + "archiveFileName": "esptool-v4.5.1-src.tar.gz", + "checksum": "SHA-256:aa06831a7d88d8ccde4ea21241e983a08dbdae967290e181658b0d18bffc8f86", + "size": "96922" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-src.tar.gz", + "archiveFileName": "esptool-v4.5.1-src.tar.gz", + "checksum": "SHA-256:aa06831a7d88d8ccde4ea21241e983a08dbdae967290e181658b0d18bffc8f86", + "size": "96922" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-src.tar.gz", + "archiveFileName": "esptool-v4.5.1-src.tar.gz", + "checksum": "SHA-256:aa06831a7d88d8ccde4ea21241e983a08dbdae967290e181658b0d18bffc8f86", + "size": "96922" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-macos.tar.gz", + "archiveFileName": "esptool-v4.5.1-macos.tar.gz", + "checksum": "SHA-256:78b52acfd51541ceb97cee893b7d4d49b8ddc284602be8c73ea47e3d849e0956", + "size": "5850888" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-win64.zip", + "archiveFileName": "esptool-v4.5.1-win64.zip", + "checksum": "SHA-256:64d0c24499d46b80d6bd7a05c98bdacc3455ab6d503cc2a99e35711310216045", + "size": "6638448" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-win64.zip", + "archiveFileName": "esptool-v4.5.1-win64.zip", + "checksum": "SHA-256:64d0c24499d46b80d6bd7a05c98bdacc3455ab6d503cc2a99e35711310216045", + "size": "6638448" + } + ] + }, + { + "name": "esptool_py", + "version": "4.5", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.6/esptool-v4.5-src.tar.gz", + "archiveFileName": "esptool-v4.5-src.tar.gz", + "checksum": "SHA-256:0f5d20c4624d913c3c994db57da3c4e5a43bd8437351d9b789f79d3f1b057292", + "size": "96621" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.6/esptool-v4.5-src.tar.gz", + "archiveFileName": "esptool-v4.5-src.tar.gz", + "checksum": "SHA-256:0f5d20c4624d913c3c994db57da3c4e5a43bd8437351d9b789f79d3f1b057292", + "size": "96621" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.6/esptool-v4.5-src.tar.gz", + "archiveFileName": "esptool-v4.5-src.tar.gz", + "checksum": "SHA-256:0f5d20c4624d913c3c994db57da3c4e5a43bd8437351d9b789f79d3f1b057292", + "size": "96621" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.6/esptool-v4.5-src.tar.gz", + "archiveFileName": "esptool-v4.5-src.tar.gz", + "checksum": "SHA-256:0f5d20c4624d913c3c994db57da3c4e5a43bd8437351d9b789f79d3f1b057292", + "size": "96621" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.6/esptool-v4.5-macos.tar.gz", + "archiveFileName": "esptool-v4.5-macos.tar.gz", + "checksum": "SHA-256:adcce051f282a19f78da30717ff0e4334b0edaf16a7f14d185ba4cae464586e2", + "size": "5850835" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.6/esptool-v4.5-win64.zip", + "archiveFileName": "esptool-v4.5-win64.zip", + "checksum": "SHA-256:a55c5f7d490fbd2cd5fdf486d71f2ed13e3304482d54374b6aa23d42c9b98a96", + "size": "6639416" + } + ] + }, + { + "name": "esptool_py", + "version": "4.2.1", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-windows.zip", + "archiveFileName": "esptool-4.2.1-windows.zip", + "checksum": "SHA-256:582560067bfbd9895f4862eb5fdf87558ddee5d4d30e7575c9b8bcb0dd60fd94", + "size": "6368279" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-windows.zip", + "archiveFileName": "esptool-4.2.1-windows.zip", + "checksum": "SHA-256:582560067bfbd9895f4862eb5fdf87558ddee5d4d30e7575c9b8bcb0dd60fd94", + "size": "6368279" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-macos.tar.gz", + "archiveFileName": "esptool-4.2.1-macos.tar.gz", + "checksum": "SHA-256:a984f7ad8bdb40c42d0d368bf4bb21b69a9587aed46b7b6d7de23ca58a3f150d", + "size": "5816598" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-linux.tar.gz", + "archiveFileName": "esptool-4.2.1-linux.tar.gz", + "checksum": "SHA-256:5a45fb77eb6574554ec2f45230d0b350f26f9c24ab3b6c13c4031ebdf72a34ab", + "size": "90123" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-linux.tar.gz", + "archiveFileName": "esptool-4.2.1-linux.tar.gz", + "checksum": "SHA-256:5a45fb77eb6574554ec2f45230d0b350f26f9c24ab3b6c13c4031ebdf72a34ab", + "size": "90123" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-linux.tar.gz", + "archiveFileName": "esptool-4.2.1-linux.tar.gz", + "checksum": "SHA-256:5a45fb77eb6574554ec2f45230d0b350f26f9c24ab3b6c13c4031ebdf72a34ab", + "size": "90123" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-linux.tar.gz", + "archiveFileName": "esptool-4.2.1-linux.tar.gz", + "checksum": "SHA-256:5a45fb77eb6574554ec2f45230d0b350f26f9c24ab3b6c13c4031ebdf72a34ab", + "size": "90123" + } + ] + }, + { + "name": "esptool_py", + "version": "3.3.0", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-windows.zip", + "archiveFileName": "esptool-3.3-windows.zip", + "checksum": "SHA-256:55a1d7165414bf4dbd2bb16ca094e555d671958450f5d1536b457a518d2b15df", + "size": "7436864" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-windows.zip", + "archiveFileName": "esptool-3.3-windows.zip", + "checksum": "SHA-256:55a1d7165414bf4dbd2bb16ca094e555d671958450f5d1536b457a518d2b15df", + "size": "7436864" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-macos.tar.gz", + "archiveFileName": "esptool-3.3-macos.tar.gz", + "checksum": "SHA-256:3e5f7b521ae33c8c63f3b48efc909c08f37bef1a083c0eafa408312c09900afd", + "size": "6944975" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-linux.tar.gz", + "archiveFileName": "esptool-3.3-linux.tar.gz", + "checksum": "SHA-256:fbe91a49e5f5deca4881f5eed32e8903faf97bfd365fe2d0d1512b80bdb67f5e", + "size": "97026" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-linux.tar.gz", + "archiveFileName": "esptool-3.3-linux.tar.gz", + "checksum": "SHA-256:fbe91a49e5f5deca4881f5eed32e8903faf97bfd365fe2d0d1512b80bdb67f5e", + "size": "97026" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-linux.tar.gz", + "archiveFileName": "esptool-3.3-linux.tar.gz", + "checksum": "SHA-256:fbe91a49e5f5deca4881f5eed32e8903faf97bfd365fe2d0d1512b80bdb67f5e", + "size": "97026" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.2/esptool-3.3-linux.tar.gz", + "archiveFileName": "esptool-3.3-linux.tar.gz", + "checksum": "SHA-256:fbe91a49e5f5deca4881f5eed32e8903faf97bfd365fe2d0d1512b80bdb67f5e", + "size": "97026" + } + ] + }, + { + "name": "esptool_py", + "version": "3.1.0", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.0-alpha1/esptool-3.1.0-windows.zip", + "archiveFileName": "esptool-3.1.0-windows.zip", + "checksum": "SHA-256:c9b4f9bc6e94db136c2545c87c00c7ab1441644ca0bac50811bc3c014e22514b", + "size": "7411889" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.0-alpha1/esptool-3.1.0-macos.tar.gz", + "archiveFileName": "esptool-3.1.0-macos.tar.gz", + "checksum": "SHA-256:1dffcb884665fb616779aea62a68f517aac251ea6dfe95560906c364d6ef3065", + "size": "6776909" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.0-alpha1/esptool-3.1.0-linux.tar.gz", + "archiveFileName": "esptool-3.1.0-linux.tar.gz", + "checksum": "SHA-256:15eca9896a30e804aa24be6f7a06e39397541b8b09a7a4c48deb65f826e7baad", + "size": "80550" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.0-alpha1/esptool-3.1.0-linux.tar.gz", + "archiveFileName": "esptool-3.1.0-linux.tar.gz", + "checksum": "SHA-256:15eca9896a30e804aa24be6f7a06e39397541b8b09a7a4c48deb65f826e7baad", + "size": "80550" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.0-alpha1/esptool-3.1.0-linux.tar.gz", + "archiveFileName": "esptool-3.1.0-linux.tar.gz", + "checksum": "SHA-256:15eca9896a30e804aa24be6f7a06e39397541b8b09a7a4c48deb65f826e7baad", + "size": "80550" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/2.0.0-alpha1/esptool-3.1.0-linux.tar.gz", + "archiveFileName": "esptool-3.1.0-linux.tar.gz", + "checksum": "SHA-256:15eca9896a30e804aa24be6f7a06e39397541b8b09a7a4c48deb65f826e7baad", + "size": "80550" + } + ] + }, + { + "name": "esptool_py", + "version": "3.0.0", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/1.0.5-rc5/esptool-3.0.0.2-windows.zip", + "archiveFileName": "esptool-3.0.0.2-windows.zip", + "checksum": "SHA-256:b192bfc1545a3c92658ce586b4edcc2aca3f0ad4b3fa8417d658bc8a48f1387e", + "size": "3434736" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/1.0.5-rc5/esptool-3.0.0.2-macos.tar.gz", + "archiveFileName": "esptool-3.0.0.2-macos.tar.gz", + "checksum": "SHA-256:2cafab7f1ebce89475b84c115548eaace40b6366d7b3f9862cdb2fc64f806643", + "size": "3859642" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/1.0.5-rc5/esptool-3.0.0.2-linux.tar.gz", + "archiveFileName": "esptool-3.0.0.2-linux.tar.gz", + "checksum": "SHA-256:d5cb51da1c74ff69f81b820470d2ecccb5c7c3a2dec7776483d4c89588b00020", + "size": "57526" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/1.0.5-rc5/esptool-3.0.0.2-linux.tar.gz", + "archiveFileName": "esptool-3.0.0.2-linux.tar.gz", + "checksum": "SHA-256:d5cb51da1c74ff69f81b820470d2ecccb5c7c3a2dec7776483d4c89588b00020", + "size": "57526" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/1.0.5-rc5/esptool-3.0.0.2-linux.tar.gz", + "archiveFileName": "esptool-3.0.0.2-linux.tar.gz", + "checksum": "SHA-256:d5cb51da1c74ff69f81b820470d2ecccb5c7c3a2dec7776483d4c89588b00020", + "size": "57526" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/1.0.5-rc5/esptool-3.0.0.2-linux.tar.gz", + "archiveFileName": "esptool-3.0.0.2-linux.tar.gz", + "checksum": "SHA-256:d5cb51da1c74ff69f81b820470d2ecccb5c7c3a2dec7776483d4c89588b00020", + "size": "57526" + } + ] + }, + { + "version": "2.6.1", + "name": "esptool_py", + "systems": [ + { + "url": "https://dl.espressif.com/dl/esptool-2.6.1-windows.zip", + "checksum": "SHA-256:84cf0b369a7707fe566434faba148852fc464992111d5baa95b658b374802f96", + "host": "i686-mingw32", + "archiveFileName": "esptool-2.6.1-windows.zip", + "size": "3422445" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.6.1-macos.tar.gz", + "checksum": "SHA-256:f4eb758a301d6902cc9dfcd49d36345d2f075ad123da7cf8132d15cfb7533457", + "host": "x86_64-apple-darwin", + "archiveFileName": "esptool-2.6.1-macos.tar.gz", + "size": "3837085" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.6.1-linux.tar.gz", + "checksum": "SHA-256:eaf82ff4070d9792f6a42ae1e485375de5a87bec59ef01dfb95de901519ec7fb", + "host": "x86_64-pc-linux-gnu", + "archiveFileName": "esptool-2.6.1-linux.tar.gz", + "size": "44762" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.6.1-linux.tar.gz", + "checksum": "SHA-256:eaf82ff4070d9792f6a42ae1e485375de5a87bec59ef01dfb95de901519ec7fb", + "host": "i686-pc-linux-gnu", + "archiveFileName": "esptool-2.6.1-linux.tar.gz", + "size": "44762" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.6.1-linux.tar.gz", + "checksum": "SHA-256:eaf82ff4070d9792f6a42ae1e485375de5a87bec59ef01dfb95de901519ec7fb", + "host": "arm-linux-gnueabihf", + "archiveFileName": "esptool-2.6.1-linux.tar.gz", + "size": "44762" + } + ] + }, + { + "version": "2.6.0", + "name": "esptool_py", + "systems": [ + { + "url": "https://dl.espressif.com/dl/esptool-2.6.0-windows.zip", + "checksum": "SHA-256:a73f4cf68db240d7f1d250c5c7f2dfcb53c17a37483729f1bf71f8f43d79a799", + "host": "i686-mingw32", + "archiveFileName": "esptool-2.6.0-windows.zip", + "size": "3421208" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.6.0-macos.tar.gz", + "checksum": "SHA-256:0a881b91547c840fab8c72ae3d031069384278b8c2e5241647e8c8292c5e4a4b", + "host": "x86_64-apple-darwin", + "archiveFileName": "esptool-2.6.0-macos.tar.gz", + "size": "3835660" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.6.0-linux.tar.gz", + "checksum": "SHA-256:6d162f70f395ca31f5008829dd7e833e729f044a9c7355d5be8ce333a054e110", + "host": "x86_64-pc-linux-gnu", + "archiveFileName": "esptool-2.6.0-linux.tar.gz", + "size": "43535" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.6.0-linux.tar.gz", + "checksum": "SHA-256:6d162f70f395ca31f5008829dd7e833e729f044a9c7355d5be8ce333a054e110", + "host": "i686-pc-linux-gnu", + "archiveFileName": "esptool-2.6.0-linux.tar.gz", + "size": "43535" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.6.0-linux.tar.gz", + "checksum": "SHA-256:6d162f70f395ca31f5008829dd7e833e729f044a9c7355d5be8ce333a054e110", + "host": "arm-linux-gnueabihf", + "archiveFileName": "esptool-2.6.0-linux.tar.gz", + "size": "43535" + } + ] + }, + { + "version": "3.0.0-gnu12-dc7f933", + "name": "mklittlefs", + "systems": [ + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu12/aarch64-linux-gnu.mklittlefs-c41e51a.200706.tar.gz", + "archiveFileName": "aarch64-linux-gnu.mklittlefs-c41e51a.200706.tar.gz", + "checksum": "SHA-256:fc56e389383749e4cf4fab0fcf75cc0ebc41e59383caf6c2eff1c3d9794af200", + "size": "44651" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu12/arm-linux-gnueabihf.mklittlefs-c41e51a.200706.tar.gz", + "archiveFileName": "arm-linux-gnueabihf.mklittlefs-c41e51a.200706.tar.gz", + "checksum": "SHA-256:52b642dd0545eb3bd8dfb75dde6601df21700e4867763fd2696274be279294c5", + "size": "37211" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu12/i686-linux-gnu.mklittlefs-c41e51a.200706.tar.gz", + "archiveFileName": "i686-linux-gnu.mklittlefs-c41e51a.200706.tar.gz", + "checksum": "SHA-256:7886051d8ccc54aed0af2e7cdf6ff992bb51638df86f3b545955697720b6d062", + "size": "48033" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu12/i686-w64-mingw32.mklittlefs-c41e51a.200706.zip", + "archiveFileName": "i686-w64-mingw32.mklittlefs-c41e51a.200706.zip", + "checksum": "SHA-256:43740db30ce451454f2337331f10ab4ed41bd83dbf0fa0cb4387107388b59f42", + "size": "332655" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu12/x86_64-apple-darwin14.mklittlefs-c41e51a.200706.tar.gz", + "archiveFileName": "x86_64-apple-darwin14.mklittlefs-c41e51a.200706.tar.gz", + "checksum": "SHA-256:e3edd5e05b70db3c7df6b9d626558348ad04804022fe955c799aeb51808c7dc3", + "size": "362608" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu12/x86_64-linux-gnu.mklittlefs-c41e51a.200706.tar.gz", + "archiveFileName": "x86_64-linux-gnu.mklittlefs-c41e51a.200706.tar.gz", + "checksum": "SHA-256:66e84dda0aad747517da3785125e05738a540948aab2b7eaa02855167a1eea53", + "size": "46778" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu12/x86_64-w64-mingw32.mklittlefs-c41e51a.200706.zip", + "archiveFileName": "x86_64-w64-mingw32.mklittlefs-c41e51a.200706.zip", + "checksum": "SHA-256:2e319077491f8e832e96eb4f2f7a70dd919333cee4b388c394e0e848d031d542", + "size": "345132" + } + ] + }, + { + "name": "mkspiffs", + "version": "0.2.3", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-win32.zip", + "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-win32.zip", + "checksum": "SHA-256:b647f2c2efe6949819c85ea9404271b55c7c9c25bcb98d3b98a1d0ba771adf56", + "size": "249809" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-osx.tar.gz", + "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-osx.tar.gz", + "checksum": "SHA-256:9f43fc74a858cf564966b5035322c3e5e61c31a647c5a1d71b388ed6efc48423", + "size": "130270" + }, + { + "host": "i386-apple-darwin", + "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-osx.tar.gz", + "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-osx.tar.gz", + "checksum": "SHA-256:9f43fc74a858cf564966b5035322c3e5e61c31a647c5a1d71b388ed6efc48423", + "size": "130270" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-linux64.tar.gz", + "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-linux64.tar.gz", + "checksum": "SHA-256:5e1a4ff41385e842f389f6b5254102a547e566a06b49babeffa93ef37115cb5d", + "size": "50646" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-linux32.tar.gz", + "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-linux32.tar.gz", + "checksum": "SHA-256:464463a93e8833209cdc29ba65e1a12fec31718dc10075c195a2445b2c3f6cb0", + "size": "48751" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-linux-armhf.tar.gz", + "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-linux-armhf.tar.gz", + "checksum": "SHA-256:ade3dc00117912ac08a1bdbfbfe76b12d21a34bc5fa1de0cfc45fe7a8d0a0185", + "size": "40665" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/igrr/mkspiffs/releases/download/0.2.3/mkspiffs-0.2.3-arduino-esp32-linux-armhf.tar.gz", + "archiveFileName": "mkspiffs-0.2.3-arduino-esp32-linux-armhf.tar.gz", + "checksum": "SHA-256:ade3dc00117912ac08a1bdbfbfe76b12d21a34bc5fa1de0cfc45fe7a8d0a0185", + "size": "40665" + } + ] + }, + { + "name": "esp-xs2", + "version": "2302", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:2ff838520a5003d2768b275f5bb5ead69dd2388c3b7cd9043cb59891ba43147f", + "size": "112199211" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:6d79d5b14fc7129a9b8208d54e19b05dedb565f50f7a96264c9df84b06ad3be0", + "size": "106953064" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:e5bd03b6ad19179b015a93ada9992adc3610036ebf6aeb0835a09c9aadb50a14", + "size": "106026829" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "checksum": "SHA-256:fb45943557b2d201bbb1bdc7514a1872f9bb96c2dfb48b95abdba281cc792f75", + "size": "115288662" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:e965236cb80e45282d16f40184af183e013b63b177bd1884736c463eac636564", + "size": "119711811" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:78a55eec18650b21378d97494989ffe208748e0f49bb2b2d6756b264e1863919", + "size": "106540817" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "checksum": "SHA-256:1e6dac5162ab75f94b88c47ebeabb6600c652fb4f615ed07c1724d037c02fd19", + "size": "131273859" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:8a785cc4e0838cebe404f82c0ead7a0f9ac5fabc660a742e33a41ddac6326cc1", + "size": "135373049" + } + ] + }, + { + "name": "esp-xs3", + "version": "2302", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:61495ffe575e00c6998ae7274ff917658c04bded62ece0937c7042d6dcbf46de", + "size": "111971129" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:9008d395be46fcfe68c7de6edc850fc1595f28323a28e7922e5c085bd310cb90", + "size": "106616800" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:568857bdac7dea389dffc7fbc6871b4af299150a8ecf1bf965f224d2a1655edb", + "size": "105700326" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "checksum": "SHA-256:d122738bcc6c2f52d05fa89b2fb1afe6a7894cda8a07a1879aca867a31507ed0", + "size": "115098400" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:7defcddb98788b0991416ad2e0cb6a3b248b8030f22d5d76b8832117cc1494ca", + "size": "119883189" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:b59e076f8e4b9ca99535d449f9fc4cbb443188051dce4ad934e38f16b095f8d9", + "size": "106464677" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "checksum": "SHA-256:3ddf51774817e815e5d41c312a90c1159226978fb45fd0d4f7085c567f8b73ab", + "size": "131134034" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:1d15ca65e3508388a86d8bed3048c46d07538f5bc88d3e4296f9c03152087cd1", + "size": "135381926" + } + ] + }, + { + "name": "xtensa-esp32-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "checksum": "SHA-256:8ef14e0409c2011b41e504a30f70d3e35287313a795d1f2462ad2cd0e2052d37", + "size": "94397702" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "checksum": "SHA-256:e7d217ac2ef52c746a41f8647840b2717edcd8afc15f081bc1c4505e10a189b7", + "size": "90684219" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "checksum": "SHA-256:ea6631f8a5105ae90d7fc462c10ed4f9049924ea8c2f9391d90b339d5f881dac", + "size": "89954866" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "checksum": "SHA-256:ecb90af9cede0982672234da0b1bd7b7f76eadde60aa5c82eefdf37d64ffe49f", + "size": "96354023" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "checksum": "SHA-256:19af109fda024a3a4c989f7ccaa104f9b1b74cfd6c9363e730bb8cb9b50d5dc4", + "size": "101712946" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-macos-arm64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-macos-arm64.tar.gz", + "checksum": "SHA-256:b14189772d70a96813895fff7731d0f2fec0c825cfc02e002d6d91a0cc4b6b1d", + "size": "93104016" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "checksum": "SHA-256:9851c2cfa355e1fad8abfb643a1c945d27385b1851f3ae468915ea78fcbec940", + "size": "118610020" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "checksum": "SHA-256:a328b3c55631846241bbe7999a309b20b797c8dc50b6e8dccf463e66a2da5fb4", + "size": "121846722" + } + ] + }, + { + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch5", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "checksum": "SHA-256:8ef14e0409c2011b41e504a30f70d3e35287313a795d1f2462ad2cd0e2052d37", + "size": "94397702" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "checksum": "SHA-256:e7d217ac2ef52c746a41f8647840b2717edcd8afc15f081bc1c4505e10a189b7", + "size": "90684219" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "checksum": "SHA-256:ea6631f8a5105ae90d7fc462c10ed4f9049924ea8c2f9391d90b339d5f881dac", + "size": "89954866" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "checksum": "SHA-256:ecb90af9cede0982672234da0b1bd7b7f76eadde60aa5c82eefdf37d64ffe49f", + "size": "96354023" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "checksum": "SHA-256:19af109fda024a3a4c989f7ccaa104f9b1b74cfd6c9363e730bb8cb9b50d5dc4", + "size": "101712946" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "checksum": "SHA-256:9851c2cfa355e1fad8abfb643a1c945d27385b1851f3ae468915ea78fcbec940", + "size": "118610020" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "checksum": "SHA-256:a328b3c55631846241bbe7999a309b20b797c8dc50b6e8dccf463e66a2da5fb4", + "size": "121846722" + } + ] + }, + { + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz", + "checksum": "SHA-256:9edd1e77627688f435561922d14299f6a0021ba1f6ff67e472e1108695a69e53", + "size": "90569312" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-linux-arm64.tar.gz", + "checksum": "SHA-256:3a21a3e310e6b1e7d7bed1f3e59698a5bd29ed3a5ca79fba9265d7dd2f1e0cd2", + "size": "86838362" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-linux-armel.tar.gz", + "checksum": "SHA-256:89313c4c1d8db1b01624f31b58bf3fbe527160569828ac4301e9daa75c52716d", + "size": "86187540" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-linux-i686.tar.gz", + "checksum": "SHA-256:a1f165a836f175daa6fbfde4ca99cb93b377f021fbfc41f79a700bd4df965a9a", + "size": "92580267" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz", + "checksum": "SHA-256:dda3d7a43efd995d9a51d5a5741626dbf915df46078aef0b5aea7163ac82398b", + "size": "97807647" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-win32.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-win32.zip", + "checksum": "SHA-256:fd147592928ef2d7092ba34b01ecd776fe26ba3d7e3f9b6b215a3b46e981ee2c", + "size": "116464819" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-win64.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-win64.zip", + "checksum": "SHA-256:9395315c07de0b9f05c9a6616ba1f05e76ab651053f2f40479163a8e03cfa830", + "size": "119511910" + } + ] + }, + { + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r2", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz", + "checksum": "SHA-256:3eb3d68b27fa6ba5af6f88da21cb8face9be0094daaa8960793cfe570ab785ff", + "size": "90565318" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-arm64.tar.gz", + "checksum": "SHA-256:aa534be24e45e06b7080a6a3bb8cd9e3cfb818f5f8bce2244d7cfb5e91336541", + "size": "86860292" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-armel.tar.gz", + "checksum": "SHA-256:f0e49ce06fe7833ff5d76961dc2dac5449d320f823bb8c05a302cf85a3a6eb04", + "size": "86183421" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-i686.tar.gz", + "checksum": "SHA-256:06de09b74652de43e5b22db3b7fc992623044baa75e9faaab68317a986715ba3", + "size": "92582250" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-macos.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-macos.tar.gz", + "checksum": "SHA-256:96443f69c8569417c780ee749d91ef33cffe22153fffa30a0fbf12107d87381b", + "size": "97808961" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-win32.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-win32.zip", + "checksum": "SHA-256:076a4171bdc33e5ced3952efffb233d70263dfa760e636704050597a9edf61db", + "size": "112578260" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-win64.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-win64.zip", + "checksum": "SHA-256:c35b7998f7f503e0cb22055d1e279ae14b6b0e09bb3ff3846b17d552ece9c247", + "size": "115278695" + } + ] + }, + { + "name": "xtensa-esp32-elf-gcc", + "version": "gcc8_4_0-esp-2021r1", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz", + "checksum": "SHA-256:44a0b467b9d2b759ab48b2f27aed684581f33c96e2842992781c4e045992c5b0", + "size": "86361217" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz", + "checksum": "SHA-256:fdacdb2a7bbf6293bcafda9b52463a4da8a2f3b7e1df9f83d35ff9d1efa22012", + "size": "84520407" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz", + "checksum": "SHA-256:e2024096492dfaa50fc6ac336cd8faa2e395e8cebb617753eab0b5f16d3dd0dc", + "size": "88375391" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-macos.tar.gz", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r1-macos.tar.gz", + "checksum": "SHA-256:7bbc6a2b94f009cd8a3351b9c7acf7a5caa1c4d3700500ead60f84965386a61b", + "size": "93357296" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-win32.zip", + "archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r1-win32.zip", + "checksum": "SHA-256:e4f9fdda192abfc9807e3e7fcd6e9fea30c1a0cf3f3c5a5c961b5114fc8c9b7e", + "size": "105603626" + } + ] + }, + { + "name": "xtensa-esp32-elf-gcc", + "version": "1.22.0-97-gc752ad5-5.2.0", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/1.0.5-rc5/xtensa-esp32-elf-win32-1.22.0-97-gc752ad5-5.2.0.zip", + "archiveFileName": "xtensa-esp32-elf-win32-1.22.0-97-gc752ad5-5.2.0.zip", + "checksum": "SHA-256:80571e5d5a63494f4fa758bb9d8fb882ba4059853a8c412a84d232dc1c1400e6", + "size": "125747216" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/1.0.5-rc5/xtensa-esp32-elf-macos-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "archiveFileName": "xtensa-esp32-elf-macos-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "checksum": "SHA-256:b1ce39a563ae359cf363fb7d8ee80cb1e5226fda83188203cff60f16f55e33ef", + "size": "50525386" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/1.0.5-rc5/xtensa-esp32-elf-linux64-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "archiveFileName": "xtensa-esp32-elf-linux64-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "checksum": "SHA-256:96f5f6e7611a0ed1dc47048c54c3113fc5cebffbf0ba90d8bfcd497afc7ef9f3", + "size": "44225380" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/1.0.5-rc5/xtensa-esp32-elf-linux32-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "archiveFileName": "xtensa-esp32-elf-linux32-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "checksum": "SHA-256:8094a2c30b474e99ce64dd0ba8f310c4614eb3b3cac884a3aea0fd5f565af119", + "size": "45575521" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/1.0.5-rc5/xtensa-esp32-elf-linux-armel-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "archiveFileName": "xtensa-esp32-elf-linux-armel-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "checksum": "SHA-256:d70d550f88448fa476b29fa50ef5502ab497a16ac7fa9ca24c6d0a39bb1e681e", + "size": "50657803" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/arduino-esp32/releases/download/1.0.5-rc5/xtensa-esp32-elf-linux-armel-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "archiveFileName": "xtensa-esp32-elf-linux-armel-1.22.0-97-gc752ad5-5.2.0.tar.gz", + "checksum": "SHA-256:d70d550f88448fa476b29fa50ef5502ab497a16ac7fa9ca24c6d0a39bb1e681e", + "size": "50657803" + } + ] + }, + { + "version": "1.22.0-80-g6c4433a-5.2.0", + "name": "xtensa-esp32-elf-gcc", + "systems": [ + { + "url": "https://dl.espressif.com/dl/xtensa-esp32-elf-win32-1.22.0-80-g6c4433a-5.2.0.zip", + "checksum": "SHA-256:f217fccbeaaa8c92db239036e0d6202458de4488b954a3a38f35ac2ec48058a4", + "host": "i686-mingw32", + "archiveFileName": "xtensa-esp32-elf-win32-1.22.0-80-g6c4433a-5.2.0.zip", + "size": "125719261" + }, + { + "url": "https://dl.espressif.com/dl/xtensa-esp32-elf-osx-1.22.0-80-g6c4433a-5.2.0.tar.gz", + "checksum": "SHA-256:a4307a97945d2f2f2745f415fbe80d727750e19f91f9a1e7e2f8a6065652f9da", + "host": "x86_64-apple-darwin", + "archiveFileName": "xtensa-esp32-elf-osx-1.22.0-80-g6c4433a-5.2.0.tar.gz", + "size": "46517409" + }, + { + "url": "https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz", + "checksum": "SHA-256:3fe96c151d46c1d4e5edc6ed690851b8e53634041114bad04729bc16b0445156", + "host": "x86_64-pc-linux-gnu", + "archiveFileName": "xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz", + "size": "44219107" + }, + { + "url": "https://dl.espressif.com/dl/xtensa-esp32-elf-linux32-1.22.0-80-g6c4433a-5.2.0.tar.gz", + "checksum": "SHA-256:b4055695ffc2dfc0bcb6dafdc2572a6e01151c4179ef5fa972b3fcb2183eb155", + "host": "i686-pc-linux-gnu", + "archiveFileName": "xtensa-esp32-elf-linux32-1.22.0-80-g6c4433a-5.2.0.tar.gz", + "size": "45566336" + }, + { + "url": "https://dl.espressif.com/dl/xtensa-esp32-elf-linux-armel-1.22.0-87-gb57bad3-5.2.0.tar.gz", + "checksum": "SHA-256:9c68c87bb23b1256dc0a1859b515946763e5292dcab4a4159a52fae5618ce861", + "host": "arm-linux-gnueabihf", + "archiveFileName": "xtensa-esp32-elf-linux-armel-1.22.0-87-gb57bad3-5.2.0.tar.gz", + "size": "50655584" + } + ] + }, + { + "name": "xtensa-esp32-elf-gcc", + "version": "esp-12.2.0_20230208", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:e8d35938385447cf9c34735fee2a3b2b61cca6be07db77a45856a1c2a347e423", + "size": "111766903" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:569988acfc2673369f222037c64bac96990cee08cebeebc4f8860e0d984f8bd9", + "size": "106473247" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:6a844f16021e936cc9b87b203978356f57ab2144554f6f2a0f73ffa3d3d316c5", + "size": "105576049" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "checksum": "SHA-256:743d6f03a89329bb09f9550d27fcab677f5cf06b4720793bbcef7883a932681d", + "size": "114870843" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:4d32d764e984f3a570aacfb2f4957619540fb4629534d969b2e83997901334c3", + "size": "119424029" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:dc8fa7f4933bf5cb08e83bacce6160cc9dfe93d7aad1e8f92599bb81ff5b2e28", + "size": "106136827" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "checksum": "SHA-256:62bb6428d107ed3f44c212c77ecf24804b74c97327b0f0ad2029c656c6dbd6ee", + "size": "130847086" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:8febfe4a6476efc69012390106c8c660a14418f025137b0513670c72124339cf", + "size": "134985117" + } + ] + }, + { + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "checksum": "SHA-256:19c77bd91fefab7c8c40a6334f9b985e2d9a1c7fac6d424b692110930dd3682f", + "size": "67849099" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "checksum": "SHA-256:bdcd24676ef2a65b670ca9e0a01768ece47f4dfcfb545a3307f76a054c33b522", + "size": "64154532" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "checksum": "SHA-256:b26723b6ce1c35b90f204eb39e5ab06a6f80fb7895f000e16b6962e4c176ae32", + "size": "63448105" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "checksum": "SHA-256:da3b5c45e4997d14269df1814c92dd7004902bb810608341bc3819c3e506fa0b", + "size": "69656104" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "checksum": "SHA-256:8eb63745b44083edef7cc6fdf3b06999f576b75134bc5e8b0ef881ca439b72d7", + "size": "75154138" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-macos-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-macos-arm64.tar.gz", + "checksum": "SHA-256:4cd38d6ec31076c0aa083f62ab84ab5c33aa07fafd0af61366186e5f553aa008", + "size": "66457613" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "checksum": "SHA-256:c758062295804b082fbd77fcd59a356f62d4e76372aaa29589cc871603309cba", + "size": "82338511" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "checksum": "SHA-256:1c1e168ff8bc460a9719f3b216d3c1125d29040389786d738244838499362c74", + "size": "85579252" + } + ] + }, + { + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch5", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "checksum": "SHA-256:19c77bd91fefab7c8c40a6334f9b985e2d9a1c7fac6d424b692110930dd3682f", + "size": "67849099" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "checksum": "SHA-256:bdcd24676ef2a65b670ca9e0a01768ece47f4dfcfb545a3307f76a054c33b522", + "size": "64154532" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "checksum": "SHA-256:b26723b6ce1c35b90f204eb39e5ab06a6f80fb7895f000e16b6962e4c176ae32", + "size": "63448105" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "checksum": "SHA-256:da3b5c45e4997d14269df1814c92dd7004902bb810608341bc3819c3e506fa0b", + "size": "69656104" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "checksum": "SHA-256:8eb63745b44083edef7cc6fdf3b06999f576b75134bc5e8b0ef881ca439b72d7", + "size": "75154138" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "checksum": "SHA-256:c758062295804b082fbd77fcd59a356f62d4e76372aaa29589cc871603309cba", + "size": "82338511" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "checksum": "SHA-256:1c1e168ff8bc460a9719f3b216d3c1125d29040389786d738244838499362c74", + "size": "85579252" + } + ] + }, + { + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz", + "checksum": "SHA-256:a32451a8edc1104b83cd9971178e61826e957d7db9ad9f81798a8969fd5a954e", + "size": "90894048" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-linux-arm64.tar.gz", + "checksum": "SHA-256:2ac2c94a533a99a091d2159c678c611c712c494b5f68d97913254712047260f9", + "size": "87178224" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-linux-armel.tar.gz", + "checksum": "SHA-256:da49afee1e2e03eaab3f492718789442d33b562800e2a892679f95b50be24d14", + "size": "86569314" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-linux-i686.tar.gz", + "checksum": "SHA-256:36d3c4990a5feb68aa8534463bc9e8ee367fe23886f78e1d726f4411c7571462", + "size": "92884013" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz", + "checksum": "SHA-256:de9af641678c93775e932ee5ec4f478f8925cfc1ebc22e41adc4fb85430a0c35", + "size": "98224709" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-win32.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-win32.zip", + "checksum": "SHA-256:ccf08afe60046f87b0e81ca17dc5073eda68ab5e7522c163dd5b583d713b7b39", + "size": "116924759" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-win64.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-win64.zip", + "checksum": "SHA-256:37c91490b8fc75e638c23785e261eaf553be2dcd106cf6cff5b76981fa02955b", + "size": "119912142" + } + ] + }, + { + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r2", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz", + "checksum": "SHA-256:a6e0947c92b823ca04f062522249f0a428357e0b056f1ff4c6bcabef83cf63a7", + "size": "90901736" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-arm64.tar.gz", + "checksum": "SHA-256:d2e5600fc194b508bd393b236a09fd62ed70afb6c36619d4b106b696a56ca66d", + "size": "87176557" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-armel.tar.gz", + "checksum": "SHA-256:3fff4199e986dd74660f17ca27d9414cb98f1b911a7f13bb3b22e784cb1156cf", + "size": "86581102" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-i686.tar.gz", + "checksum": "SHA-256:7732f9fb371d36b6b324820e300beecc33c2719921a61cf1cdb5bc625016b346", + "size": "92875986" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-macos.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-macos.tar.gz", + "checksum": "SHA-256:e6dd32782fcff8f633299b97d1c671d6b6513390aca2ddbd7543c2cc62e72d7e", + "size": "98212907" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-win32.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-win32.zip", + "checksum": "SHA-256:41b917b35f6fbe7d30b7de91c32cf348c406acfa729a1eabc450d040dc46fbe2", + "size": "113022469" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-win64.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-win64.zip", + "checksum": "SHA-256:a764c1a0ee743d69f8cbfadbe4426a2c15c0e233b0894244c7cadf3b4d7dd32a", + "size": "115696999" + } + ] + }, + { + "name": "xtensa-esp32s2-elf-gcc", + "version": "gcc8_4_0-esp-2021r1", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz", + "checksum": "SHA-256:b127baccfe6949ee7eaf3d0782ea772750a9b8e2732b16ce6bcc9dcd91f7209a", + "size": "86687290" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz", + "checksum": "SHA-256:7ca0d240f11e1c53c01a56257b0c968f876ab405142d1068d8c9b456d939554c", + "size": "84916701" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz", + "checksum": "SHA-256:9941f993ff84d1c606b45ffbeeb7bcdc5a72cf24e787bb9230390510fe3511c6", + "size": "88699953" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-macos.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-macos.tar.gz", + "checksum": "SHA-256:4b55b1a9ca7fc945be6fc3513802b6cece9264bee4cbca76013569cec2695973", + "size": "93757895" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-win32.zip", + "archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-win32.zip", + "checksum": "SHA-256:c94ec1e45c81b7e4944d216bab4aa41d46849768d7761fd691661dab1a3df828", + "size": "106013515" + } + ] + }, + { + "name": "xtensa-esp32s2-elf-gcc", + "version": "esp-12.2.0_20230208", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:2ff838520a5003d2768b275f5bb5ead69dd2388c3b7cd9043cb59891ba43147f", + "size": "112199211" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:6d79d5b14fc7129a9b8208d54e19b05dedb565f50f7a96264c9df84b06ad3be0", + "size": "106953064" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:e5bd03b6ad19179b015a93ada9992adc3610036ebf6aeb0835a09c9aadb50a14", + "size": "106026829" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "checksum": "SHA-256:fb45943557b2d201bbb1bdc7514a1872f9bb96c2dfb48b95abdba281cc792f75", + "size": "115288662" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:e965236cb80e45282d16f40184af183e013b63b177bd1884736c463eac636564", + "size": "119711811" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:78a55eec18650b21378d97494989ffe208748e0f49bb2b2d6756b264e1863919", + "size": "106540817" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "checksum": "SHA-256:1e6dac5162ab75f94b88c47ebeabb6600c652fb4f615ed07c1724d037c02fd19", + "size": "131273859" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32s2-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:8a785cc4e0838cebe404f82c0ead7a0f9ac5fabc660a742e33a41ddac6326cc1", + "size": "135373049" + } + ] + }, + { + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "checksum": "SHA-256:8aa17a6adf01efa5b1628c8ac578063a44d26ae9581d39486b92223a41ef262f", + "size": "68099473" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "checksum": "SHA-256:b218c11122e5565b6442376ebd21a652abdfcbf90981afa3e177ce978710225d", + "size": "64233211" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "checksum": "SHA-256:967477434ad5483718915936a77ce915a10c5972a6b3fd02688a5c4e14182bfb", + "size": "63530586" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "checksum": "SHA-256:07671d01a63ebd389912787efb2b263677c7b351c07fe430ded733cdae95e81d", + "size": "70025439" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "checksum": "SHA-256:99b6d44cea5aebbedc8b6965e7bf551aa4a40ed83ddbe1c0e9b7cb255564ded5", + "size": "75719772" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-macos-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-macos-arm64.tar.gz", + "checksum": "SHA-256:c64b05be25d26916c65dcfe11de9e60b96d58980b2df706d3074cb70b1ef6cb9", + "size": "66791095" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "checksum": "SHA-256:658d3036ffdf11ddad6f0a784c8829f6ffd4dbd7c252d7f61722256d0ad43975", + "size": "82665716" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "checksum": "SHA-256:9000be38d44bf79c39b93a2aeb99b42e956c593ccbc02fe31cb9c71ae1bbcb22", + "size": "86022563" + } + ] + }, + { + "name": "xtensa-esp32s3-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch5", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "checksum": "SHA-256:8aa17a6adf01efa5b1628c8ac578063a44d26ae9581d39486b92223a41ef262f", + "size": "68099473" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "checksum": "SHA-256:b218c11122e5565b6442376ebd21a652abdfcbf90981afa3e177ce978710225d", + "size": "64233211" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "checksum": "SHA-256:967477434ad5483718915936a77ce915a10c5972a6b3fd02688a5c4e14182bfb", + "size": "63530586" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "checksum": "SHA-256:07671d01a63ebd389912787efb2b263677c7b351c07fe430ded733cdae95e81d", + "size": "70025439" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "checksum": "SHA-256:99b6d44cea5aebbedc8b6965e7bf551aa4a40ed83ddbe1c0e9b7cb255564ded5", + "size": "75719772" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "checksum": "SHA-256:658d3036ffdf11ddad6f0a784c8829f6ffd4dbd7c252d7f61722256d0ad43975", + "size": "82665716" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "checksum": "SHA-256:9000be38d44bf79c39b93a2aeb99b42e956c593ccbc02fe31cb9c71ae1bbcb22", + "size": "86022563" + } + ] + }, + { + "name": "xtensa-esp32s3-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz", + "checksum": "SHA-256:59b271d014ff3915b6db1b43b610a45eea15fe5d6877d12cae8a191cc996ed37", + "size": "90903617" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-linux-arm64.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-linux-arm64.tar.gz", + "checksum": "SHA-256:7051b32483e61f98606d71c98e372929428a5165df791dcd5830ed9517763152", + "size": "87065204" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-linux-armel.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-linux-armel.tar.gz", + "checksum": "SHA-256:48c8dbbf96eec691a812327dc580042d9718fe989e60c2111ebfd692ac710081", + "size": "86455731" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-linux-i686.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-linux-i686.tar.gz", + "checksum": "SHA-256:552dca3f4302ab7ca88a934b0391200198c9d10a4d8ac413fe604cbf8601f950", + "size": "92906274" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz", + "checksum": "SHA-256:e5af78f05d3af07617805d06ebb45ff2fe9b6aed6970a84c35eea28a5d8d5e53", + "size": "98553473" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-win32.zip", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-win32.zip", + "checksum": "SHA-256:1b70163acccc5655449de1d149427a54f384156bd35816ec60c422d76d033f05", + "size": "116847008" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-win64.zip", + "archiveFileName": "xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-win64.zip", + "checksum": "SHA-256:58e58575d1938879fd51e822181e54bcb343aa846eb3fca8f616c2cde7bd0041", + "size": "120066269" + } + ] + }, + { + "name": "xtensa-esp32s3-elf-gcc", + "version": "esp-12.2.0_20230208", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:61495ffe575e00c6998ae7274ff917658c04bded62ece0937c7042d6dcbf46de", + "size": "111971129" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-aarch64-linux-gnu.tar.gz", + "checksum": "SHA-256:9008d395be46fcfe68c7de6edc850fc1595f28323a28e7922e5c085bd310cb90", + "size": "106616800" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-arm-linux-gnueabi.tar.gz", + "checksum": "SHA-256:568857bdac7dea389dffc7fbc6871b4af299150a8ecf1bf965f224d2a1655edb", + "size": "105700326" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-i686-linux-gnu.tar.gz", + "checksum": "SHA-256:d122738bcc6c2f52d05fa89b2fb1afe6a7894cda8a07a1879aca867a31507ed0", + "size": "115098400" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-x86_64-apple-darwin.tar.gz", + "checksum": "SHA-256:7defcddb98788b0991416ad2e0cb6a3b248b8030f22d5d76b8832117cc1494ca", + "size": "119883189" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-aarch64-apple-darwin.tar.gz", + "checksum": "SHA-256:b59e076f8e4b9ca99535d449f9fc4cbb443188051dce4ad934e38f16b095f8d9", + "size": "106464677" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-i686-w64-mingw32.zip", + "checksum": "SHA-256:3ddf51774817e815e5d41c312a90c1159226978fb45fd0d4f7085c567f8b73ab", + "size": "131134034" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "archiveFileName": "xtensa-esp32s3-elf-12.2.0_20230208-x86_64-w64-mingw32.zip", + "checksum": "SHA-256:1d15ca65e3508388a86d8bed3048c46d07538f5bc88d3e4296f9c03152087cd1", + "size": "135381926" + } + ] + }, + { + "name": "riscv32-esp-elf-gcc", + "version": "esp-2021r2-patch5-8.4.0", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "checksum": "SHA-256:f7d73e5f9e2df3ea6ca8e2c95d6ca6d23d6b38fd101ea5d3012f3cb3cd59f39f", + "size": "192388486" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "checksum": "SHA-256:cf520ae3a72f65b9758ea187524b105b8b7546566d738c32e60a0df9846ef1af", + "size": "188626914" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "checksum": "SHA-256:2dc3536214caa1697f6834bb4701d05894ca55b53589fc5b54064b050ef93799", + "size": "188624050" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "checksum": "SHA-256:165d6d53e76d79f5ade7e2b7ade54b2b495ecfda0d1184d84d6343659d0e3bdb", + "size": "194606113" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "checksum": "SHA-256:d6d4cef216cbf28d6fbb88f3e127d4f42a376d9497c260bf8c1ad9cef440f839", + "size": "199411930" + }, + { + "host": "arm64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-macos-arm64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-macos-arm64.tar.gz", + "checksum": "SHA-256:6e03f2ab1f145be13f8890c6de77b53f52c7bffe3d9d5824549db20298f5ba91", + "size": "191209735" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "checksum": "SHA-256:1e0cfcfbc8f82c441261cadd21742f66d716ec18c18bf10ed7c7d5b0bee6752f", + "size": "257844437" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "checksum": "SHA-256:b08f568e8fe5069dd521b87da21b8e56117e5c2c3b492f73a51966a46d3379a4", + "size": "259712666" + } + ] + }, + { + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch5", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-amd64.tar.gz", + "checksum": "SHA-256:f7d73e5f9e2df3ea6ca8e2c95d6ca6d23d6b38fd101ea5d3012f3cb3cd59f39f", + "size": "192388486" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-arm64.tar.gz", + "checksum": "SHA-256:cf520ae3a72f65b9758ea187524b105b8b7546566d738c32e60a0df9846ef1af", + "size": "188626914" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-armel.tar.gz", + "checksum": "SHA-256:2dc3536214caa1697f6834bb4701d05894ca55b53589fc5b54064b050ef93799", + "size": "188624050" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-linux-i686.tar.gz", + "checksum": "SHA-256:165d6d53e76d79f5ade7e2b7ade54b2b495ecfda0d1184d84d6343659d0e3bdb", + "size": "194606113" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-macos.tar.gz", + "checksum": "SHA-256:d6d4cef216cbf28d6fbb88f3e127d4f42a376d9497c260bf8c1ad9cef440f839", + "size": "199411930" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win32.zip", + "checksum": "SHA-256:1e0cfcfbc8f82c441261cadd21742f66d716ec18c18bf10ed7c7d5b0bee6752f", + "size": "257844437" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip", + "checksum": "SHA-256:b08f568e8fe5069dd521b87da21b8e56117e5c2c3b492f73a51966a46d3379a4", + "size": "259712666" + } + ] + }, + { + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2-patch3", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz", + "checksum": "SHA-256:179cbad579790ad35e0f414a18d90017c0f158c397022411a8e9867db2174f15", + "size": "106843321" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-arm64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-arm64.tar.gz", + "checksum": "SHA-256:fb339d476c79c76db8f903b265cab6bb6950d5ed954dec644445252d3378023c", + "size": "103277393" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-armel.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-armel.tar.gz", + "checksum": "SHA-256:51a6296d8334b7452dba44b2b62e87afd7fd1c74bafa1aa29b1f4ab72cb9e5e0", + "size": "103062256" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-i686.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-i686.tar.gz", + "checksum": "SHA-256:fef60f7ef37ffaa50416d8f244cdbd710d6729dae41ef06c4ec0e50a1f3b7dd7", + "size": "109460025" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz", + "checksum": "SHA-256:4aacc1742a76349d790b1ac8e9e9d963daefda5346dbd6741cfe8e7a35a44e4e", + "size": "113703959" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-win32.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-win32.zip", + "checksum": "SHA-256:eb2a442d7f551ebeb842995ec372ec4b364314ca2d7aae779399a74972f7d6bc", + "size": "144711970" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-win64.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-win64.zip", + "checksum": "SHA-256:f5607e5187317d521f0474cade83f8eb590f2d165d95c3779b6ce11fbac21d1f", + "size": "146606480" + } + ] + }, + { + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r2", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz", + "checksum": "SHA-256:812d735063da9d063b374b59f55832a96c41fbd27ddaef19000a75de8607ba21", + "size": "106837189" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-arm64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-arm64.tar.gz", + "checksum": "SHA-256:712f1fbc3e08304a6f32aa18b346b16bbcb413b507b3d4c7c3211bf0d7dc4813", + "size": "103273444" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-armel.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-armel.tar.gz", + "checksum": "SHA-256:80a3342cda2cd4b6b75ebb2b36d5d12fce7d375cfadadcff01ec3a907f0a16a2", + "size": "103058744" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-i686.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-i686.tar.gz", + "checksum": "SHA-256:7f0162a81558ab0ed09d6c5d356def25b5cb3d5c2d61358f20152fa260ccc8ae", + "size": "109447789" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-macos.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-macos.tar.gz", + "checksum": "SHA-256:3ff7e5427907cf8e271c1f959b70fb01e39625c3caf61a6567e7b38aa0c11578", + "size": "113672945" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-win32.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-win32.zip", + "checksum": "SHA-256:c8ff08883c1456c278fad85e1c43b7c6e251d525683214168655550e85c5b82e", + "size": "140809778" + }, + { + "host": "x86_64-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-win64.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-win64.zip", + "checksum": "SHA-256:6c04cb4728db928ec6473e63146b695b6dec686a0d40dd73dd3353f05247b19e", + "size": "142365782" + } + ] + }, + { + "name": "riscv32-esp-elf-gcc", + "version": "gcc8_4_0-esp-2021r1", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz", + "checksum": "SHA-256:3459618f33bbd5f54d7d7783e807cb6eef6472a220f2f1eb3faced735b9d13bb", + "size": "152812483" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz", + "checksum": "SHA-256:24b9e54b348bbd5fb816fc4c52abb47337c702beecdbba840750b7cfb9d38069", + "size": "151726623" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz", + "checksum": "SHA-256:954d340ebffef12a2ce9be1ea004e6f45a8863f1e6f41f46fd3f04f58499627c", + "size": "155430963" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-macos.tar.gz", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r1-macos.tar.gz", + "checksum": "SHA-256:612fb3a3f84f703222327bd16581df8f80fda8cdf137637fe5d611587d1b664e", + "size": "159836199" + }, + { + "host": "i686-mingw32", + "url": "https://dl.espressif.cn/github_assets/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-win32.zip", + "archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r1-win32.zip", + "checksum": "SHA-256:5711eb407ffe44adddbd1281b6b575a5645e7193ca78faefa27dc5bc5b662bec", + "size": "191266312" + } + ] + }, + { + "version": "2.3.1", + "name": "esptool", + "systems": [ + { + "url": "https://dl.espressif.com/dl/esptool-2.3.1-windows.zip", + "checksum": "SHA-256:c187763d0faac7da7c30a292a23c759bbc256fcd084dc8846ed284000cb0fe29", + "host": "i686-mingw32", + "archiveFileName": "esptool-2.3.1-windows.zip", + "size": "3396085" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.3.1-macos.tar.gz", + "checksum": "SHA-256:cd922418f02e0ca11dc066b36a22646a1b441da00d762b4464ca598c902c5ecb", + "host": "x86_64-apple-darwin", + "archiveFileName": "esptool-2.3.1-macos.tar.gz", + "size": "3810932" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.3.1-linux.tar.gz", + "checksum": "SHA-256:cff30841dad80ed5d7d2d58a31843b63afa57528979a9c839806568167691d8e", + "host": "x86_64-pc-linux-gnu", + "archiveFileName": "esptool-2.3.1-linux.tar.gz", + "size": "39563" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.3.1-linux.tar.gz", + "checksum": "SHA-256:cff30841dad80ed5d7d2d58a31843b63afa57528979a9c839806568167691d8e", + "host": "i686-pc-linux-gnu", + "archiveFileName": "esptool-2.3.1-linux.tar.gz", + "size": "39563" + }, + { + "url": "https://dl.espressif.com/dl/esptool-2.3.1-linux.tar.gz", + "checksum": "SHA-256:cff30841dad80ed5d7d2d58a31843b63afa57528979a9c839806568167691d8e", + "host": "arm-linux-gnueabihf", + "archiveFileName": "esptool-2.3.1-linux.tar.gz", + "size": "39563" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/platform.txt b/platform.txt deleted file mode 100644 index a88a12cabab..00000000000 --- a/platform.txt +++ /dev/null @@ -1,102 +0,0 @@ -name=ESP32 Arduino -version=0.0.1 - -runtime.tools.xtensa-esp32-elf-gcc.path={runtime.platform.path}/tools/xtensa-esp32-elf - -tools.esptool_py.path={runtime.platform.path}/tools/esptool -tools.esptool_py.cmd=esptool -tools.esptool_py.cmd.linux=esptool.py -tools.esptool_py.cmd.windows=esptool.exe - -tools.esptool_py.network_cmd=python "{runtime.platform.path}/tools/espota.py" -tools.esptool_py.network_cmd.windows="{runtime.platform.path}/tools/espota.exe" - -tools.gen_esp32part.cmd=python "{runtime.platform.path}/tools/gen_esp32part.py" -tools.gen_esp32part.cmd.windows="{runtime.platform.path}/tools/gen_esp32part.exe" - -compiler.warning_flags=-w -compiler.warning_flags.none=-w -compiler.warning_flags.default= -compiler.warning_flags.more=-Wall -Werror=all -compiler.warning_flags.all=-Wall -Werror=all -Wextra - -compiler.path={runtime.tools.xtensa-esp32-elf-gcc.path}/bin/ -compiler.sdk.path={runtime.platform.path}/tools/sdk -compiler.cpreprocessor.flags=-DESP_PLATFORM -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DHAVE_CONFIG_H -DGCC_NOT_5_2_0=0 -DWITH_POSIX "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/app_trace" "-I{compiler.sdk.path}/include/app_update" "-I{compiler.sdk.path}/include/asio" "-I{compiler.sdk.path}/include/bootloader_support" "-I{compiler.sdk.path}/include/bt" "-I{compiler.sdk.path}/include/coap" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/driver" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp32" "-I{compiler.sdk.path}/include/esp_adc_cal" "-I{compiler.sdk.path}/include/esp_event" "-I{compiler.sdk.path}/include/esp_http_client" "-I{compiler.sdk.path}/include/esp_http_server" "-I{compiler.sdk.path}/include/esp_https_ota" "-I{compiler.sdk.path}/include/esp_ringbuf" "-I{compiler.sdk.path}/include/ethernet" "-I{compiler.sdk.path}/include/expat" "-I{compiler.sdk.path}/include/fatfs" "-I{compiler.sdk.path}/include/freemodbus" "-I{compiler.sdk.path}/include/freertos" "-I{compiler.sdk.path}/include/heap" "-I{compiler.sdk.path}/include/idf_test" "-I{compiler.sdk.path}/include/jsmn" "-I{compiler.sdk.path}/include/json" "-I{compiler.sdk.path}/include/libsodium" "-I{compiler.sdk.path}/include/log" "-I{compiler.sdk.path}/include/lwip" "-I{compiler.sdk.path}/include/mbedtls" "-I{compiler.sdk.path}/include/mdns" "-I{compiler.sdk.path}/include/micro-ecc" "-I{compiler.sdk.path}/include/mqtt" "-I{compiler.sdk.path}/include/newlib" "-I{compiler.sdk.path}/include/nghttp" "-I{compiler.sdk.path}/include/nvs_flash" "-I{compiler.sdk.path}/include/openssl" "-I{compiler.sdk.path}/include/protobuf-c" "-I{compiler.sdk.path}/include/protocomm" "-I{compiler.sdk.path}/include/pthread" "-I{compiler.sdk.path}/include/sdmmc" "-I{compiler.sdk.path}/include/smartconfig_ack" "-I{compiler.sdk.path}/include/soc" "-I{compiler.sdk.path}/include/spi_flash" "-I{compiler.sdk.path}/include/spiffs" "-I{compiler.sdk.path}/include/tcp_transport" "-I{compiler.sdk.path}/include/tcpip_adapter" "-I{compiler.sdk.path}/include/ulp" "-I{compiler.sdk.path}/include/vfs" "-I{compiler.sdk.path}/include/wear_levelling" "-I{compiler.sdk.path}/include/wifi_provisioning" "-I{compiler.sdk.path}/include/wpa_supplicant" "-I{compiler.sdk.path}/include/xtensa-debug-module" "-I{compiler.sdk.path}/include/esp-face" "-I{compiler.sdk.path}/include/esp32-camera" "-I{compiler.sdk.path}/include/esp-face" "-I{compiler.sdk.path}/include/fb_gfx" - -compiler.c.cmd=xtensa-esp32-elf-gcc -compiler.c.flags=-std=gnu99 -Os -g3 -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wpointer-arith {compiler.warning_flags} -Wno-maybe-uninitialized -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-variable -Wno-deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-old-style-declaration -MMD -c - -compiler.cpp.cmd=xtensa-esp32-elf-g++ -compiler.cpp.flags=-std=gnu++11 -Os -g3 -Wpointer-arith -fexceptions -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib {compiler.warning_flags} -Wno-error=maybe-uninitialized -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-missing-field-initializers -Wno-sign-compare -fno-rtti -MMD -c - -compiler.S.cmd=xtensa-esp32-elf-gcc -compiler.S.flags=-c -g3 -x assembler-with-cpp -MMD -mlongcalls - -compiler.c.elf.cmd=xtensa-esp32-elf-gcc -compiler.c.elf.flags=-nostdlib "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" -T esp32_out.ld -T esp32.common.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.libgcc.ld -T esp32.rom.spiram_incompatible_fns.ld -u ld_include_panic_highint_hdl -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static -Wl,--undefined=uxTopUsedPriority -u __cxa_guard_dummy -u __cxx_fatal_exception -compiler.c.elf.libs=-lgcc -lesp32 -lphy -lesp_http_client -lmbedtls -lrtc -lesp_http_server -lbtdm_app -lspiffs -lbootloader_support -lmdns -lnvs_flash -lfatfs -lpp -lnet80211 -ljsmn -lface_detection -llibsodium -lvfs -ldl_lib -llog -lfreertos -lcxx -lsmartconfig_ack -lxtensa-debug-module -lheap -ltcpip_adapter -lmqtt -lulp -lfd -lfb_gfx -lnghttp -lprotocomm -lsmartconfig -lm -lethernet -limage_util -lc_nano -lsoc -ltcp_transport -lc -lmicro-ecc -lface_recognition -ljson -lwpa_supplicant -lmesh -lesp_https_ota -lwpa2 -lexpat -llwip -lwear_levelling -lapp_update -ldriver -lbt -lespnow -lcoap -lasio -lnewlib -lconsole -lapp_trace -lesp32-camera -lhal -lprotobuf-c -lsdmmc -lcore -lpthread -lcoexist -lfreemodbus -lspi_flash -lesp-tls -lwpa -lwifi_provisioning -lwps -lesp_adc_cal -lesp_event -lopenssl -lesp_ringbuf -lfr -lstdc++ - -compiler.as.cmd=xtensa-esp32-elf-as - -compiler.ar.cmd=xtensa-esp32-elf-ar -compiler.ar.flags=cru - -compiler.size.cmd=xtensa-esp32-elf-size - -# This can be overriden in boards.txt -build.flash_size=4MB -build.flash_mode=dio -build.boot=bootloader -build.code_debug=0 -build.defines= -build.extra_flags=-DESP32 -DCORE_DEBUG_LEVEL={build.code_debug} {build.defines} - -# These can be overridden in platform.local.txt -compiler.c.extra_flags= -compiler.c.elf.extra_flags= -compiler.S.extra_flags= -compiler.cpp.extra_flags= -compiler.ar.extra_flags= -compiler.objcopy.eep.extra_flags= -compiler.elf2hex.extra_flags= - -## Compile c files -recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.c.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" -DARDUINO_VARIANT="{build.variant}" {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" - -## Compile c++ files -recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpreprocessor.flags} {compiler.cpp.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" -DARDUINO_VARIANT="{build.variant}" {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" - -## Compile S files -recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.S.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" -DARDUINO_VARIANT="{build.variant}" {compiler.S.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" - -## Create archives -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}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -Wl,--start-group {object_files} "{archive_file_path}" {compiler.c.elf.libs} -Wl,--end-group -Wl,-EL -o "{build.path}/{build.project_name}.elf" - -## Create eeprom -recipe.objcopy.eep.pattern={tools.gen_esp32part.cmd} -q "{runtime.platform.path}/tools/partitions/{build.partitions}.csv" "{build.path}/{build.project_name}.partitions.bin" - -## Create hex -recipe.objcopy.hex.pattern="{tools.esptool_py.path}/{tools.esptool_py.cmd}" --chip esp32 elf2image --flash_mode "{build.flash_mode}" --flash_freq "{build.flash_freq}" --flash_size "{build.flash_size}" -o "{build.path}/{build.project_name}.bin" "{build.path}/{build.project_name}.elf" -recipe.objcopy.hex.pattern.linux=python "{tools.esptool_py.path}/{tools.esptool_py.cmd}" --chip esp32 elf2image --flash_mode "{build.flash_mode}" --flash_freq "{build.flash_freq}" --flash_size "{build.flash_size}" -o "{build.path}/{build.project_name}.bin" "{build.path}/{build.project_name}.elf" - -## Save hex -recipe.output.tmp_file={build.project_name}.bin -recipe.output.save_file={build.project_name}.{build.variant}.bin - -## Compute size -recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf" -recipe.size.regex=^(?:\.iram0\.text|\.iram0\.vectors|\.dram0\.data|\.flash\.text|\.flash\.rodata|)\s+([0-9]+).* -recipe.size.regex.data=^(?:\.dram0\.data|\.dram0\.bss|\.noinit)\s+([0-9]+).* - -# ------------------------------ - -tools.esptool_py.upload.protocol=esp32 -tools.esptool_py.upload.params.verbose= -tools.esptool_py.upload.params.quiet= -tools.esptool_py.upload.pattern="{path}/{cmd}" --chip esp32 --port "{serial.port}" --baud {upload.speed} --before default_reset --after hard_reset write_flash -z --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size detect 0xe000 "{runtime.platform.path}/tools/partitions/boot_app0.bin" 0x1000 "{runtime.platform.path}/tools/sdk/bin/bootloader_{build.boot}_{build.flash_freq}.bin" 0x10000 "{build.path}/{build.project_name}.bin" 0x8000 "{build.path}/{build.project_name}.partitions.bin" -tools.esptool_py.upload.pattern.linux=python "{path}/{cmd}" --chip esp32 --port "{serial.port}" --baud {upload.speed} --before default_reset --after hard_reset write_flash -z --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size detect 0xe000 "{runtime.platform.path}/tools/partitions/boot_app0.bin" 0x1000 "{runtime.platform.path}/tools/sdk/bin/bootloader_{build.boot}_{build.flash_freq}.bin" 0x10000 "{build.path}/{build.project_name}.bin" 0x8000 "{build.path}/{build.project_name}.partitions.bin" -tools.esptool_py.upload.network_pattern={network_cmd} -i "{serial.port}" -p "{network.port}" "--auth={network.password}" -f "{build.path}/{build.project_name}.bin" diff --git a/programmers.txt b/programmers.txt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/runtime-tests-results/RUNTIME_TESTS_REPORT.md b/runtime-tests-results/RUNTIME_TESTS_REPORT.md new file mode 100644 index 00000000000..074455cff3d --- /dev/null +++ b/runtime-tests-results/RUNTIME_TESTS_REPORT.md @@ -0,0 +1,37 @@ +## Runtime Tests Report + +:white_check_mark: **The test workflows are passing.** :white_check_mark: + +### Validation Tests + +#### Hardware + +Test|ESP32|ESP32-C3|ESP32-C6|ESP32-H2|ESP32-P4|ESP32-S2|ESP32-S3 +-|:-:|:-:|:-:|:-:|:-:|:-:|:-: +democfg|2/2 :white_check_mark:|-|1/1 :white_check_mark:|-|-|1/1 :white_check_mark:|1/1 :white_check_mark: +hello_world|1/1 :white_check_mark:|1/1 :white_check_mark:|1/1 :white_check_mark:|1/1 :white_check_mark:|1/1 :white_check_mark:|1/1 :white_check_mark:|1/1 :white_check_mark: +nvs|2/2 :white_check_mark:|2/2 :white_check_mark:|4/4 :white_check_mark:|4/4 :white_check_mark:|4/4 :white_check_mark:|2/2 :white_check_mark:|3/3 :white_check_mark: +periman|1/1 :white_check_mark:|1/1 :white_check_mark:|1/1 :white_check_mark:|1/1 :white_check_mark:|-|1/1 :white_check_mark:|1/1 :white_check_mark: +psram|10/10 :white_check_mark:|-|-|-|8/8 :white_check_mark:|10/10 :white_check_mark:|10/10 :white_check_mark: +timer|3/3 :white_check_mark:|4/4 :white_check_mark:|4/4 :white_check_mark:|4/4 :white_check_mark:|4/4 :white_check_mark:|4/4 :white_check_mark:|4/4 :white_check_mark: +touch|3/3 :white_check_mark:|-|-|-|3/3 :white_check_mark:|3/3 :white_check_mark:|3/3 :white_check_mark: +uart|11/11 :white_check_mark:|10/10 :white_check_mark:|10/10 :white_check_mark:|10/10 :white_check_mark:|10/10 :white_check_mark:|11/11 :white_check_mark:|10/10 :white_check_mark: +unity|2/2 :white_check_mark:|2/2 :white_check_mark:|2/2 :white_check_mark:|2/2 :white_check_mark:|2/2 :white_check_mark:|2/2 :white_check_mark:|2/2 :white_check_mark: +#### Wokwi + +Test|ESP32|ESP32-C3|ESP32-C6|ESP32-H2|ESP32-P4|ESP32-S2|ESP32-S3 +-|:-:|:-:|:-:|:-:|:-:|:-:|:-: +gpio|1/1 :white_check_mark:|1/1 :white_check_mark:|1/1 :white_check_mark:|1/1 :white_check_mark:|1/1 :white_check_mark:|1/1 :white_check_mark:|1/1 :white_check_mark: +hello_world|1/1 :white_check_mark:|1/1 :white_check_mark:|1/1 :white_check_mark:|1/1 :white_check_mark:|1/1 :white_check_mark:|1/1 :white_check_mark:|1/1 :white_check_mark: +i2c_master|7/7 :white_check_mark:|7/7 :white_check_mark:|7/7 :white_check_mark:|6/6 :white_check_mark:|6/6 :white_check_mark:|7/7 :white_check_mark:|7/7 :white_check_mark: +nvs|2/2 :white_check_mark:|2/2 :white_check_mark:|4/4 :white_check_mark:|4/4 :white_check_mark:|4/4 :white_check_mark:|2/2 :white_check_mark:|3/3 :white_check_mark: +psram|10/10 :white_check_mark:|-|-|-|8/8 :white_check_mark:|10/10 :white_check_mark:|10/10 :white_check_mark: +timer|3/3 :white_check_mark:|4/4 :white_check_mark:|4/4 :white_check_mark:|4/4 :white_check_mark:|4/4 :white_check_mark:|4/4 :white_check_mark:|4/4 :white_check_mark: +uart|11/11 :white_check_mark:|10/10 :white_check_mark:|10/10 :white_check_mark:|10/10 :white_check_mark:|10/10 :white_check_mark:|10/10 :white_check_mark:|10/10 :white_check_mark: +unity|2/2 :white_check_mark:|2/2 :white_check_mark:|2/2 :white_check_mark:|2/2 :white_check_mark:|2/2 :white_check_mark:|2/2 :white_check_mark:|2/2 :white_check_mark: +wifi|2/2 :white_check_mark:|1/1 :white_check_mark:|1/1 :white_check_mark:|-|-|2/2 :white_check_mark:|3/3 :white_check_mark: + + +Generated on: 2025/04/23 03:11:00 + +[Build, Hardware and QEMU run](https://github.com/espressif/arduino-esp32/actions/runs/14608610574) / [Wokwi run](https://github.com/espressif/arduino-esp32/actions/runs/14609052367) diff --git a/runtime-tests-results/badge.svg b/runtime-tests-results/badge.svg new file mode 100644 index 00000000000..7e6be97fbf1 --- /dev/null +++ b/runtime-tests-results/badge.svg @@ -0,0 +1,14 @@ + + Runtime Tests: passing + + + + + + + \ No newline at end of file diff --git a/runtime-tests-results/table_generator.py b/runtime-tests-results/table_generator.py new file mode 100644 index 00000000000..af149ed544d --- /dev/null +++ b/runtime-tests-results/table_generator.py @@ -0,0 +1,104 @@ +import json +import sys +import os +from datetime import datetime + +SUCCESS_SYMBOL = ":white_check_mark:" +FAILURE_SYMBOL = ":x:" +ERROR_SYMBOL = ":fire:" + +# Load the JSON file passed as argument to the script +with open(sys.argv[1], "r") as f: + data = json.load(f) + tests = sorted(data["stats"]["suite_details"], key=lambda x: x["name"]) + +# Generate the table + +print("## Runtime Tests Report") +print("") + +try: + if os.environ["IS_FAILING"] == "true": + print(f"{FAILURE_SYMBOL} **The test workflows are failing. Please check the run logs.** {FAILURE_SYMBOL}") + print("") + else: + print(f"{SUCCESS_SYMBOL} **The test workflows are passing.** {SUCCESS_SYMBOL}") + print("") +except KeyError: + pass + +print("### Validation Tests") +print("") + +proc_test_data = {} +target_list = [] + +for test in tests: + if test["name"].startswith("performance_"): + continue + + _, platform, target, test_name = test["name"].split("_", 3) + test_name = test_name[:-1] + + if target not in target_list: + target_list.append(target) + + if platform not in proc_test_data: + proc_test_data[platform] = {} + + if test_name not in proc_test_data[platform]: + proc_test_data[platform][test_name] = {} + + if target not in proc_test_data[platform][test_name]: + proc_test_data[platform][test_name][target] = { + "failures": 0, + "total": 0, + "errors": 0 + } + + proc_test_data[platform][test_name][target]["total"] += test["tests"] + proc_test_data[platform][test_name][target]["failures"] += test["failures"] + proc_test_data[platform][test_name][target]["errors"] += test["errors"] + +target_list = sorted(target_list) + +for platform in proc_test_data: + print(f"#### {platform.capitalize()}") + print("") + print("Test", end="") + + for target in target_list: + # Make target name uppercase and add hyfen if not esp32 + if target != "esp32": + target = target.replace("esp32", "esp32-") + + print(f"|{target.upper()}", end="") + + print("") + print("-" + "|:-:" * len(target_list)) + + for test_name, targets in proc_test_data[platform].items(): + print(f"{test_name}", end="") + for target in target_list: + if target in targets: + test_data = targets[target] + if test_data["errors"] > 0: + print(f"|Error {ERROR_SYMBOL}", end="") + else: + print(f"|{test_data['total']-test_data['failures']}/{test_data['total']}", end="") + if test_data["failures"] > 0: + print(f" {FAILURE_SYMBOL}", end="") + else: + print(f" {SUCCESS_SYMBOL}", end="") + else: + print("|-", end="") + print("") + +print("\n") +print(f"Generated on: {datetime.now().strftime('%Y/%m/%d %H:%M:%S')}") +print("") + +try: + print(f"[Build, Hardware and QEMU run](https://github.com/{os.environ['GITHUB_REPOSITORY']}/actions/runs/{os.environ['BUILD_RUN_ID']}) / [Wokwi run](https://github.com/{os.environ['GITHUB_REPOSITORY']}/actions/runs/{os.environ['WOKWI_RUN_ID']})") +except KeyError: + pass diff --git a/runtime-tests-results/unity_results.json b/runtime-tests-results/unity_results.json new file mode 100644 index 00000000000..d8f83a479fa --- /dev/null +++ b/runtime-tests-results/unity_results.json @@ -0,0 +1,2717 @@ +{ + "title": "All 50 tests pass in 2h 13m 33s", + "summary": "190 files  190 suites   2h 13m 33s ⏱️\n 50 tests  50 ✅ 0 💤 0 ❌\n489 runs  489 ✅ 0 💤 0 ❌\n\nResults for commit c110ca82.\n", + "conclusion": "success", + "stats": { + "files": 190, + "errors": [], + "suites": 190, + "duration": 8013, + "suite_details": [ + { + "name": "validation_hardware_esp32h2_nvs2", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s2_psramspeed0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32p4_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32_democfg1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32h2_timer0", + "tests": 4, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32_wifi0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32p4_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32p4_fibonacci0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32h2_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c3_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32p4_linpack_float0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_gpio0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c6_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s3_ramspeed0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s2_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32c3_linpack_float0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s2_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32h2_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c3_wifi0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s3_nvs2", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32p4_ramspeed0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s3_coremark0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s2_touch0", + "tests": 3, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s2_fibonacci0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32h2_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c6_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c6_wifi0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32_linpack_float0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s2_linpack_float0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32h2_uart0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32h2_ramspeed0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s2_periman0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32p4_touch0", + "tests": 3, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c3_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c3_timer0", + "tests": 4, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s2_coremark0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c6_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s3_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32_democfg0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s3_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c6_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32h2_linpack_double0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32h2_timer0", + "tests": 4, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32h2_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32p4_nvs2", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32_periman0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c6_nvs2", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c3_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s3_psram0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32p4_uart0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32_timer0", + "tests": 3, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32c3_fibonacci0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s2_linpack_double0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s2_wifi1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32_uart0", + "tests": 11, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32_superpi0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c6_gpio0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32p4_gpio0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32c3_coremark0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32c6_coremark0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c3_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s2_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32_linpack_double0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32h2_nvs3", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32h2_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c3_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32h2_nvs2", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32c3_superpi0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c6_nvs3", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32p4_uart0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s3_democfg0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s2_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32c3_ramspeed0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s2_uart0", + "tests": 11, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s3_linpack_float0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s2_timer0", + "tests": 4, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s3_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c6_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32_wifi1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s2_psram0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32c6_linpack_float0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c6_timer0", + "tests": 4, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32p4_psram0", + "tests": 8, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32h2_uart0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32_touch0", + "tests": 3, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c6_nvs3", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c3_gpio0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32_psram0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c6_nvs2", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c3_uart0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s2_wifi0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32c6_fibonacci0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s2_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c3_periman0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c3_timer0", + "tests": 4, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32p4_superpi0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32p4_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s2_timer0", + "tests": 4, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_wifi1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c3_uart0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s3_psramspeed0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32p4_nvs3", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32_fibonacci0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s2_gpio0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32h2_i2c_master0", + "tests": 6, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32h2_fibonacci0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32c6_linpack_double0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s2_uart0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32_timer0", + "tests": 3, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c6_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s3_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32p4_linpack_double0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32p4_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32_i2c_master0", + "tests": 7, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32h2_gpio0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s3_touch0", + "tests": 3, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32p4_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32p4_coremark0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32_coremark0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32p4_nvs2", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32c3_linpack_double0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32h2_nvs3", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_i2c_master0", + "tests": 7, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s3_timer0", + "tests": 4, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32h2_superpi0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32p4_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32p4_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32_ramspeed0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32p4_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s3_periman0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s2_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32h2_periman0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c6_uart0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32h2_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32h2_linpack_float0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32c6_ramspeed0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s2_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32h2_coremark0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_uart0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c6_i2c_master0", + "tests": 7, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c6_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s2_i2c_master0", + "tests": 7, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_psram0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_timer0", + "tests": 4, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c3_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_nvs2", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32p4_psramspeed0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32_gpio0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c3_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32h2_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32p4_i2c_master0", + "tests": 6, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32p4_nvs3", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32c6_superpi0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s3_linpack_double0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s3_superpi0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c6_uart0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c3_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s3_uart0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s2_psram0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32p4_psram0", + "tests": 8, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c6_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_wifi0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s2_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c6_democfg0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32_uart0", + "tests": 11, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c6_timer0", + "tests": 4, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32_psram0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c6_periman0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s3_fibonacci0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_wifi2", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32_psramspeed0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s2_democfg0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32h2_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32p4_timer0", + "tests": 4, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s2_ramspeed0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32p4_timer0", + "tests": 4, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s2_superpi0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c3_i2c_master0", + "tests": 7, + "skipped": 0, + "failures": 0, + "errors": 0 + } + ], + "tests": 50, + "tests_succ": 50, + "tests_skip": 0, + "tests_fail": 0, + "tests_error": 0, + "runs": 489, + "runs_succ": 489, + "runs_skip": 0, + "runs_fail": 0, + "runs_error": 0, + "commit": "c110ca8295fbc38c6e48a404b69aed9739fdf952" + }, + "annotations": [ + { + "path": ".github", + "start_line": 0, + "end_line": 0, + "annotation_level": "notice", + "message": "There are 50 tests, see \"Raw output\" for the full list of tests.", + "title": "50 tests found", + "raw_details": "auto_baudrate_test\nbasic_transmission_test\nbegin_when_running_test\nchange_baudrate_test\nchange_clock\nchange_cpu_frequency_test\nchange_pins_test\ndisabled_uart_calls_test\nenabled_uart_calls_test\nend_when_stopped_test\nperformance.coremark.test_coremark ‑ test_coremark\nperformance.fibonacci.test_fibonacci ‑ test_fibonacci\nperformance.linpack_double.test_linpack_double ‑ test_linpack_double\nperformance.linpack_float.test_linpack_float ‑ test_linpack_float\nperformance.psramspeed.test_psramspeed ‑ test_psramspeed\nperformance.ramspeed.test_ramspeed ‑ test_ramspeed\nperformance.superpi.test_superpi ‑ test_superpi\nperiman_test\npsram_found\nresize_buffers_test\nrtc_run_clock\nrtc_set_time\nscan_bus\nscan_bus_with_wifi\nswap_pins\ntest_api\ntest_calloc_success\ntest_fail\ntest_malloc_fail\ntest_malloc_success\ntest_memcpy\ntest_memset_all_ones\ntest_memset_all_zeroes\ntest_memset_alternating\ntest_memset_random\ntest_pass\ntest_realloc_success\ntest_touch_errors\ntest_touch_interrtupt\ntest_touch_read\ntimer_clock_select_test\ntimer_divider_test\ntimer_interrupt_test\ntimer_read_test\nvalidation.democfg.test_democfg ‑ test_cfg\nvalidation.gpio.test_gpio ‑ test_gpio\nvalidation.hello_world.test_hello_world ‑ test_hello_world\nvalidation.nvs.test_nvs ‑ test_nvs\nvalidation.periman.test_periman ‑ test_periman\nvalidation.wifi.test_wifi ‑ test_wifi" + } + ], + "check_url": "https://github.com/espressif/arduino-esp32/runs/40983674295", + "formatted": { + "stats": { + "files": "190", + "errors": [], + "suites": "190", + "duration": "8 013", + "suite_details": [ + { + "name": "validation_hardware_esp32h2_nvs2", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s2_psramspeed0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32p4_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32_democfg1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32h2_timer0", + "tests": 4, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32_wifi0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32p4_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32p4_fibonacci0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32h2_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c3_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32p4_linpack_float0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_gpio0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c6_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s3_ramspeed0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s2_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32c3_linpack_float0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s2_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32h2_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c3_wifi0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s3_nvs2", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32p4_ramspeed0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s3_coremark0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s2_touch0", + "tests": 3, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s2_fibonacci0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32h2_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c6_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c6_wifi0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32_linpack_float0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s2_linpack_float0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32h2_uart0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32h2_ramspeed0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s2_periman0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32p4_touch0", + "tests": 3, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c3_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c3_timer0", + "tests": 4, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s2_coremark0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c6_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s3_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32_democfg0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s3_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c6_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32h2_linpack_double0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32h2_timer0", + "tests": 4, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32h2_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32p4_nvs2", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32_periman0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c6_nvs2", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c3_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s3_psram0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32p4_uart0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32_timer0", + "tests": 3, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32c3_fibonacci0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s2_linpack_double0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s2_wifi1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32_uart0", + "tests": 11, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32_superpi0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c6_gpio0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32p4_gpio0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32c3_coremark0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32c6_coremark0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c3_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s2_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32_linpack_double0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32h2_nvs3", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32h2_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c3_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32h2_nvs2", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32c3_superpi0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c6_nvs3", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32p4_uart0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s3_democfg0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s2_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32c3_ramspeed0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s2_uart0", + "tests": 11, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s3_linpack_float0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s2_timer0", + "tests": 4, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s3_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c6_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32_wifi1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s2_psram0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32c6_linpack_float0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c6_timer0", + "tests": 4, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32p4_psram0", + "tests": 8, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32h2_uart0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32_touch0", + "tests": 3, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c6_nvs3", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c3_gpio0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32_psram0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c6_nvs2", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c3_uart0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s2_wifi0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32c6_fibonacci0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s2_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c3_periman0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c3_timer0", + "tests": 4, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32p4_superpi0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32p4_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s2_timer0", + "tests": 4, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_wifi1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c3_uart0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s3_psramspeed0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32p4_nvs3", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32_fibonacci0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s2_gpio0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32h2_i2c_master0", + "tests": 6, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32h2_fibonacci0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32c6_linpack_double0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s2_uart0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32_timer0", + "tests": 3, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c6_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s3_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32p4_linpack_double0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32p4_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32_i2c_master0", + "tests": 7, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32h2_gpio0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s3_touch0", + "tests": 3, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32p4_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32p4_coremark0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32_coremark0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32p4_nvs2", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32c3_linpack_double0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32h2_nvs3", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_i2c_master0", + "tests": 7, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s3_timer0", + "tests": 4, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32h2_superpi0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32p4_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32p4_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32_ramspeed0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32p4_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s3_periman0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s2_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32h2_periman0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c6_uart0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32h2_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32h2_linpack_float0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32c6_ramspeed0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s2_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32h2_coremark0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_uart0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c6_i2c_master0", + "tests": 7, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c6_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s2_i2c_master0", + "tests": 7, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_psram0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_timer0", + "tests": 4, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c3_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32_nvs1", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_nvs2", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32p4_psramspeed0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32_gpio0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c3_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32h2_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32p4_i2c_master0", + "tests": 6, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32p4_nvs3", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32c6_superpi0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s3_linpack_double0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s3_superpi0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c6_uart0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c3_hello_world0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s3_uart0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s2_psram0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32p4_psram0", + "tests": 8, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c6_nvs0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_wifi0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s2_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c6_democfg0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32_uart0", + "tests": 11, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c6_timer0", + "tests": 4, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32_psram0", + "tests": 10, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32c6_periman0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s3_fibonacci0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32s3_wifi2", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32_psramspeed0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32s2_democfg0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32h2_unity0", + "tests": 2, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_hardware_esp32p4_timer0", + "tests": 4, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s2_ramspeed0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32p4_timer0", + "tests": 4, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "performance_hardware_esp32s2_superpi0", + "tests": 1, + "skipped": 0, + "failures": 0, + "errors": 0 + }, + { + "name": "validation_wokwi_esp32c3_i2c_master0", + "tests": 7, + "skipped": 0, + "failures": 0, + "errors": 0 + } + ], + "tests": "50", + "tests_succ": "50", + "tests_skip": "0", + "tests_fail": "0", + "tests_error": "0", + "runs": "489", + "runs_succ": "489", + "runs_skip": "0", + "runs_fail": "0", + "runs_error": "0", + "commit": "c110ca8295fbc38c6e48a404b69aed9739fdf952" + } + } +} \ No newline at end of file diff --git a/tools/espota.exe b/tools/espota.exe deleted file mode 100644 index 3de37913ce0..00000000000 Binary files a/tools/espota.exe and /dev/null differ diff --git a/tools/espota.py b/tools/espota.py deleted file mode 100755 index 77fcfd75c64..00000000000 --- a/tools/espota.py +++ /dev/null @@ -1,353 +0,0 @@ -#!/usr/bin/env python -# -# Original espota.py by Ivan Grokhotkov: -# https://gist.github.com/igrr/d35ab8446922179dc58c -# -# Modified since 2015-09-18 from Pascal Gollor (https://github.com/pgollor) -# Modified since 2015-11-09 from Hristo Gochkov (https://github.com/me-no-dev) -# Modified since 2016-01-03 from Matthew O'Gorman (https://githumb.com/mogorman) -# -# This script will push an OTA update to the ESP -# use it like: python espota.py -i -I -p -P [-a password] -f -# Or to upload SPIFFS image: -# python espota.py -i -I -p -P [-a password] -s -f -# -# Changes -# 2015-09-18: -# - Add option parser. -# - Add logging. -# - Send command to controller to differ between flashing and transmitting SPIFFS image. -# -# Changes -# 2015-11-09: -# - Added digest authentication -# - Enhanced error tracking and reporting -# -# Changes -# 2016-01-03: -# - Added more options to parser. -# - -from __future__ import print_function -import socket -import sys -import os -import optparse -import logging -import hashlib -import random - -# Commands -FLASH = 0 -SPIFFS = 100 -AUTH = 200 -PROGRESS = False -# update_progress() : Displays or updates a console progress bar -## Accepts a float between 0 and 1. Any int will be converted to a float. -## A value under 0 represents a 'halt'. -## A value at 1 or bigger represents 100% -def update_progress(progress): - if (PROGRESS): - barLength = 60 # Modify this to change the length of the progress bar - status = "" - if isinstance(progress, int): - progress = float(progress) - if not isinstance(progress, float): - progress = 0 - status = "error: progress var must be float\r\n" - if progress < 0: - progress = 0 - status = "Halt...\r\n" - if progress >= 1: - progress = 1 - status = "Done...\r\n" - block = int(round(barLength*progress)) - text = "\rUploading: [{0}] {1}% {2}".format( "="*block + " "*(barLength-block), int(progress*100), status) - sys.stderr.write(text) - sys.stderr.flush() - else: - sys.stderr.write('.') - sys.stderr.flush() - -def serve(remoteAddr, localAddr, remotePort, localPort, password, filename, command = FLASH): - # Create a TCP/IP socket - sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - server_address = (localAddr, localPort) - logging.info('Starting on %s:%s', str(server_address[0]), str(server_address[1])) - try: - sock.bind(server_address) - sock.listen(1) - except: - logging.error("Listen Failed") - return 1 - - content_size = os.path.getsize(filename) - f = open(filename,'rb') - file_md5 = hashlib.md5(f.read()).hexdigest() - f.close() - logging.info('Upload size: %d', content_size) - message = '%d %d %d %s\n' % (command, localPort, content_size, file_md5) - - # Wait for a connection - inv_trys = 0 - data = '' - msg = 'Sending invitation to %s ' % (remoteAddr) - sys.stderr.write(msg) - sys.stderr.flush() - while (inv_trys < 10): - inv_trys += 1 - sock2 = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) - remote_address = (remoteAddr, int(remotePort)) - try: - sent = sock2.sendto(message.encode(), remote_address) - except: - sys.stderr.write('failed\n') - sys.stderr.flush() - sock2.close() - logging.error('Host %s Not Found', remoteAddr) - return 1 - sock2.settimeout(TIMEOUT) - try: - data = sock2.recv(37).decode() - break; - except: - sys.stderr.write('.') - sys.stderr.flush() - sock2.close() - sys.stderr.write('\n') - sys.stderr.flush() - if (inv_trys == 10): - logging.error('No response from the ESP') - return 1 - if (data != "OK"): - if(data.startswith('AUTH')): - nonce = data.split()[1] - cnonce_text = '%s%u%s%s' % (filename, content_size, file_md5, remoteAddr) - cnonce = hashlib.md5(cnonce_text.encode()).hexdigest() - passmd5 = hashlib.md5(password.encode()).hexdigest() - result_text = '%s:%s:%s' % (passmd5 ,nonce, cnonce) - result = hashlib.md5(result_text.encode()).hexdigest() - sys.stderr.write('Authenticating...') - sys.stderr.flush() - message = '%d %s %s\n' % (AUTH, cnonce, result) - sock2.sendto(message.encode(), remote_address) - sock2.settimeout(10) - try: - data = sock2.recv(32).decode() - except: - sys.stderr.write('FAIL\n') - logging.error('No Answer to our Authentication') - sock2.close() - return 1 - if (data != "OK"): - sys.stderr.write('FAIL\n') - logging.error('%s', data) - sock2.close() - sys.exit(1); - return 1 - sys.stderr.write('OK\n') - else: - logging.error('Bad Answer: %s', data) - sock2.close() - return 1 - sock2.close() - - logging.info('Waiting for device...') - try: - sock.settimeout(10) - connection, client_address = sock.accept() - sock.settimeout(None) - connection.settimeout(None) - except: - logging.error('No response from device') - sock.close() - return 1 - try: - f = open(filename, "rb") - if (PROGRESS): - update_progress(0) - else: - sys.stderr.write('Uploading') - sys.stderr.flush() - offset = 0 - while True: - chunk = f.read(1024) - if not chunk: break - offset += len(chunk) - update_progress(offset/float(content_size)) - connection.settimeout(10) - try: - connection.sendall(chunk) - res = connection.recv(10) - lastResponseContainedOK = 'OK' in res.decode() - except: - sys.stderr.write('\n') - logging.error('Error Uploading') - connection.close() - f.close() - sock.close() - return 1 - - if lastResponseContainedOK: - logging.info('Success') - connection.close() - f.close() - sock.close() - return 0 - - sys.stderr.write('\n') - logging.info('Waiting for result...') - try: - count = 0 - while True: - count=count+1 - connection.settimeout(60) - data = connection.recv(32).decode() - logging.info('Result: %s' ,data) - - if "OK" in data: - logging.info('Success') - connection.close() - f.close() - sock.close() - return 0; - if count == 5: - logging.error('Error response from device') - connection.close() - f.close() - sock.close() - return 1 - except e: - logging.error('No Result!') - connection.close() - f.close() - sock.close() - return 1 - - finally: - connection.close() - f.close() - - sock.close() - return 1 -# end serve - - -def parser(unparsed_args): - parser = optparse.OptionParser( - usage = "%prog [options]", - description = "Transmit image over the air to the esp32 module with OTA support." - ) - - # destination ip and port - group = optparse.OptionGroup(parser, "Destination") - group.add_option("-i", "--ip", - dest = "esp_ip", - action = "store", - help = "ESP32 IP Address.", - default = False - ) - group.add_option("-I", "--host_ip", - dest = "host_ip", - action = "store", - help = "Host IP Address.", - default = "0.0.0.0" - ) - group.add_option("-p", "--port", - dest = "esp_port", - type = "int", - help = "ESP32 ota Port. Default 3232", - default = 3232 - ) - group.add_option("-P", "--host_port", - dest = "host_port", - type = "int", - help = "Host server ota Port. Default random 10000-60000", - default = random.randint(10000,60000) - ) - parser.add_option_group(group) - - # auth - group = optparse.OptionGroup(parser, "Authentication") - group.add_option("-a", "--auth", - dest = "auth", - help = "Set authentication password.", - action = "store", - default = "" - ) - parser.add_option_group(group) - - # image - group = optparse.OptionGroup(parser, "Image") - group.add_option("-f", "--file", - dest = "image", - help = "Image file.", - metavar="FILE", - default = None - ) - group.add_option("-s", "--spiffs", - dest = "spiffs", - action = "store_true", - help = "Use this option to transmit a SPIFFS image and do not flash the module.", - default = False - ) - parser.add_option_group(group) - - # output group - group = optparse.OptionGroup(parser, "Output") - group.add_option("-d", "--debug", - dest = "debug", - help = "Show debug output. And override loglevel with debug.", - action = "store_true", - default = False - ) - group.add_option("-r", "--progress", - dest = "progress", - help = "Show progress output. Does not work for ArduinoIDE", - action = "store_true", - default = False - ) - group.add_option("-t", "--timeout", - dest = "timeout", - type = "int", - help = "Timeout to wait for the ESP32 to accept invitation", - default = 10 - ) - parser.add_option_group(group) - - (options, args) = parser.parse_args(unparsed_args) - - return options -# end parser - - -def main(args): - options = parser(args) - loglevel = logging.WARNING - if (options.debug): - loglevel = logging.DEBUG - - logging.basicConfig(level = loglevel, format = '%(asctime)-8s [%(levelname)s]: %(message)s', datefmt = '%H:%M:%S') - logging.debug("Options: %s", str(options)) - - # check options - global PROGRESS - PROGRESS = options.progress - - global TIMEOUT - TIMEOUT = options.timeout - - if (not options.esp_ip or not options.image): - logging.critical("Not enough arguments.") - return 1 - - command = FLASH - if (options.spiffs): - command = SPIFFS - - return serve(options.esp_ip, options.host_ip, options.esp_port, options.host_port, options.auth, options.image, command) -# end main - - -if __name__ == '__main__': - sys.exit(main(sys.argv)) diff --git a/tools/esptool.py b/tools/esptool.py deleted file mode 100755 index d6ceb6f9b39..00000000000 --- a/tools/esptool.py +++ /dev/null @@ -1,3201 +0,0 @@ -#!/usr/bin/env python -# -# ESP8266 & ESP32 ROM Bootloader Utility -# Copyright (C) 2014-2016 Fredrik Ahlberg, Angus Gratton, Espressif Systems (Shanghai) PTE LTD, other contributors as noted. -# https://github.com/espressif/esptool -# -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 51 Franklin -# Street, Fifth Floor, Boston, MA 02110-1301 USA. - -from __future__ import division, print_function - -import argparse -import base64 -import binascii -import copy -import hashlib -import inspect -import io -import os -import shlex -import struct -import sys -import time -import zlib -import string - -try: - import serial -except ImportError: - print("Pyserial is not installed for %s. Check the README for installation instructions." % (sys.executable)) - raise - -# check 'serial' is 'pyserial' and not 'serial' https://github.com/espressif/esptool/issues/269 -try: - if "serialization" in serial.__doc__ and "deserialization" in serial.__doc__: - raise ImportError(""" -esptool.py depends on pyserial, but there is a conflict with a currently installed package named 'serial'. - -You may be able to work around this by 'pip uninstall serial; pip install pyserial' \ -but this may break other installed Python software that depends on 'serial'. - -There is no good fix for this right now, apart from configuring virtualenvs. \ -See https://github.com/espressif/esptool/issues/269#issuecomment-385298196 for discussion of the underlying issue(s).""") -except TypeError: - pass # __doc__ returns None for pyserial - -try: - import serial.tools.list_ports as list_ports -except ImportError: - print("The installed version (%s) of pyserial appears to be too old for esptool.py (Python interpreter %s). " - "Check the README for installation instructions." % (sys.VERSION, sys.executable)) - raise - -__version__ = "2.8-dev" - -MAX_UINT32 = 0xffffffff -MAX_UINT24 = 0xffffff - -DEFAULT_TIMEOUT = 3 # timeout for most flash operations -START_FLASH_TIMEOUT = 20 # timeout for starting flash (may perform erase) -CHIP_ERASE_TIMEOUT = 120 # timeout for full chip erase -MAX_TIMEOUT = CHIP_ERASE_TIMEOUT * 2 # longest any command can run -SYNC_TIMEOUT = 0.1 # timeout for syncing with bootloader -MD5_TIMEOUT_PER_MB = 8 # timeout (per megabyte) for calculating md5sum -ERASE_REGION_TIMEOUT_PER_MB = 30 # timeout (per megabyte) for erasing a region -MEM_END_ROM_TIMEOUT = 0.05 # special short timeout for ESP_MEM_END, as it may never respond -DEFAULT_SERIAL_WRITE_TIMEOUT = 10 # timeout for serial port write - - -def timeout_per_mb(seconds_per_mb, size_bytes): - """ Scales timeouts which are size-specific """ - result = seconds_per_mb * (size_bytes / 1e6) - if result < DEFAULT_TIMEOUT: - return DEFAULT_TIMEOUT - return result - - -DETECTED_FLASH_SIZES = {0x12: '256KB', 0x13: '512KB', 0x14: '1MB', - 0x15: '2MB', 0x16: '4MB', 0x17: '8MB', 0x18: '16MB'} - - -def check_supported_function(func, check_func): - """ - Decorator implementation that wraps a check around an ESPLoader - bootloader function to check if it's supported. - - This is used to capture the multidimensional differences in - functionality between the ESP8266 & ESP32 ROM loaders, and the - software stub that runs on both. Not possible to do this cleanly - via inheritance alone. - """ - def inner(*args, **kwargs): - obj = args[0] - if check_func(obj): - return func(*args, **kwargs) - else: - raise NotImplementedInROMError(obj, func) - return inner - - -def stub_function_only(func): - """ Attribute for a function only supported in the software stub loader """ - return check_supported_function(func, lambda o: o.IS_STUB) - - -def stub_and_esp32_function_only(func): - """ Attribute for a function only supported by software stubs or ESP32 ROM """ - return check_supported_function(func, lambda o: o.IS_STUB or o.CHIP_NAME == "ESP32") - - -PYTHON2 = sys.version_info[0] < 3 # True if on pre-Python 3 - -# Function to return nth byte of a bitstring -# Different behaviour on Python 2 vs 3 -if PYTHON2: - def byte(bitstr, index): - return ord(bitstr[index]) -else: - def byte(bitstr, index): - return bitstr[index] - -# Provide a 'basestring' class on Python 3 -try: - basestring -except NameError: - basestring = str - - -def _mask_to_shift(mask): - """ Return the index of the least significant bit in the mask """ - shift = 0 - while mask & 0x1 == 0: - shift += 1 - mask >>= 1 - return shift - - -def esp8266_function_only(func): - """ Attribute for a function only supported on ESP8266 """ - return check_supported_function(func, lambda o: o.CHIP_NAME == "ESP8266") - - -class ESPLoader(object): - """ Base class providing access to ESP ROM & software stub bootloaders. - Subclasses provide ESP8266 & ESP32 specific functionality. - - Don't instantiate this base class directly, either instantiate a subclass or - call ESPLoader.detect_chip() which will interrogate the chip and return the - appropriate subclass instance. - - """ - CHIP_NAME = "Espressif device" - IS_STUB = False - - DEFAULT_PORT = "/dev/ttyUSB0" - - # Commands supported by ESP8266 ROM bootloader - ESP_FLASH_BEGIN = 0x02 - ESP_FLASH_DATA = 0x03 - ESP_FLASH_END = 0x04 - ESP_MEM_BEGIN = 0x05 - ESP_MEM_END = 0x06 - ESP_MEM_DATA = 0x07 - ESP_SYNC = 0x08 - ESP_WRITE_REG = 0x09 - ESP_READ_REG = 0x0a - - # Some comands supported by ESP32 ROM bootloader (or -8266 w/ stub) - ESP_SPI_SET_PARAMS = 0x0B - ESP_SPI_ATTACH = 0x0D - ESP_CHANGE_BAUDRATE = 0x0F - ESP_FLASH_DEFL_BEGIN = 0x10 - ESP_FLASH_DEFL_DATA = 0x11 - ESP_FLASH_DEFL_END = 0x12 - ESP_SPI_FLASH_MD5 = 0x13 - - # Some commands supported by stub only - ESP_ERASE_FLASH = 0xD0 - ESP_ERASE_REGION = 0xD1 - ESP_READ_FLASH = 0xD2 - ESP_RUN_USER_CODE = 0xD3 - - # Flash encryption debug more command - ESP_FLASH_ENCRYPT_DATA = 0xD4 - - # Maximum block sized for RAM and Flash writes, respectively. - ESP_RAM_BLOCK = 0x1800 - - FLASH_WRITE_SIZE = 0x400 - - # Default baudrate. The ROM auto-bauds, so we can use more or less whatever we want. - ESP_ROM_BAUD = 115200 - - # First byte of the application image - ESP_IMAGE_MAGIC = 0xe9 - - # Initial state for the checksum routine - ESP_CHECKSUM_MAGIC = 0xef - - # Flash sector size, minimum unit of erase. - FLASH_SECTOR_SIZE = 0x1000 - - # This register happens to exist on both ESP8266 & ESP32 - UART_DATA_REG_ADDR = 0x60000078 - - UART_CLKDIV_MASK = 0xFFFFF - - # Memory addresses - IROM_MAP_START = 0x40200000 - IROM_MAP_END = 0x40300000 - - # The number of bytes in the UART response that signify command status - STATUS_BYTES_LENGTH = 2 - - def __init__(self, port=DEFAULT_PORT, baud=ESP_ROM_BAUD, trace_enabled=False): - """Base constructor for ESPLoader bootloader interaction - - Don't call this constructor, either instantiate ESP8266ROM - or ESP32ROM, or use ESPLoader.detect_chip(). - - This base class has all of the instance methods for bootloader - functionality supported across various chips & stub - loaders. Subclasses replace the functions they don't support - with ones which throw NotImplementedInROMError(). - - """ - if isinstance(port, basestring): - self._port = serial.serial_for_url(port) - else: - self._port = port - self._slip_reader = slip_reader(self._port, self.trace) - # setting baud rate in a separate step is a workaround for - # CH341 driver on some Linux versions (this opens at 9600 then - # sets), shouldn't matter for other platforms/drivers. See - # https://github.com/espressif/esptool/issues/44#issuecomment-107094446 - self._set_port_baudrate(baud) - self._trace_enabled = trace_enabled - # set write timeout, to prevent esptool blocked at write forever. - try: - self._port.write_timeout = DEFAULT_SERIAL_WRITE_TIMEOUT - except NotImplementedError: - # no write timeout for RFC2217 ports - # need to set the property back to None or it will continue to fail - self._port.write_timeout = None - - def _set_port_baudrate(self, baud): - try: - self._port.baudrate = baud - except IOError: - raise FatalError("Failed to set baud rate %d. The driver may not support this rate." % baud) - - @staticmethod - def detect_chip(port=DEFAULT_PORT, baud=ESP_ROM_BAUD, connect_mode='default_reset', trace_enabled=False): - """ Use serial access to detect the chip type. - - We use the UART's datecode register for this, it's mapped at - the same address on ESP8266 & ESP32 so we can use one - memory read and compare to the datecode register for each chip - type. - - This routine automatically performs ESPLoader.connect() (passing - connect_mode parameter) as part of querying the chip. - """ - detect_port = ESPLoader(port, baud, trace_enabled=trace_enabled) - detect_port.connect(connect_mode) - try: - print('Detecting chip type...', end='') - sys.stdout.flush() - date_reg = detect_port.read_reg(ESPLoader.UART_DATA_REG_ADDR) - - for cls in [ESP8266ROM, ESP32ROM]: - if date_reg == cls.DATE_REG_VALUE: - # don't connect a second time - inst = cls(detect_port._port, baud, trace_enabled=trace_enabled) - print(' %s' % inst.CHIP_NAME, end='') - return inst - finally: - print('') # end line - raise FatalError("Unexpected UART datecode value 0x%08x. Failed to autodetect chip type." % date_reg) - - """ Read a SLIP packet from the serial port """ - def read(self): - return next(self._slip_reader) - - """ Write bytes to the serial port while performing SLIP escaping """ - def write(self, packet): - buf = b'\xc0' \ - + (packet.replace(b'\xdb',b'\xdb\xdd').replace(b'\xc0',b'\xdb\xdc')) \ - + b'\xc0' - self.trace("Write %d bytes: %s", len(buf), HexFormatter(buf)) - self._port.write(buf) - - def trace(self, message, *format_args): - if self._trace_enabled: - now = time.time() - try: - - delta = now - self._last_trace - except AttributeError: - delta = 0.0 - self._last_trace = now - prefix = "TRACE +%.3f " % delta - print(prefix + (message % format_args)) - - """ Calculate checksum of a blob, as it is defined by the ROM """ - @staticmethod - def checksum(data, state=ESP_CHECKSUM_MAGIC): - for b in data: - if type(b) is int: # python 2/3 compat - state ^= b - else: - state ^= ord(b) - - return state - - """ Send a request and read the response """ - def command(self, op=None, data=b"", chk=0, wait_response=True, timeout=DEFAULT_TIMEOUT): - saved_timeout = self._port.timeout - new_timeout = min(timeout, MAX_TIMEOUT) - if new_timeout != saved_timeout: - self._port.timeout = new_timeout - - try: - if op is not None: - self.trace("command op=0x%02x data len=%s wait_response=%d timeout=%.3f data=%s", - op, len(data), 1 if wait_response else 0, timeout, HexFormatter(data)) - pkt = struct.pack(b' self.STATUS_BYTES_LENGTH: - return data[:-self.STATUS_BYTES_LENGTH] - else: # otherwise, just return the 'val' field which comes from the reply header (this is used by read_reg) - return val - - def flush_input(self): - self._port.flushInput() - self._slip_reader = slip_reader(self._port, self.trace) - - def sync(self): - self.command(self.ESP_SYNC, b'\x07\x07\x12\x20' + 32 * b'\x55', - timeout=SYNC_TIMEOUT) - for i in range(7): - self.command() - - def _setDTR(self, state): - self._port.setDTR(state) - - def _setRTS(self, state): - self._port.setRTS(state) - # Work-around for adapters on Windows using the usbser.sys driver: - # generate a dummy change to DTR so that the set-control-line-state - # request is sent with the updated RTS state and the same DTR state - self._port.setDTR(self._port.dtr) - - def _connect_attempt(self, mode='default_reset', esp32r0_delay=False): - """ A single connection attempt, with esp32r0 workaround options """ - # esp32r0_delay is a workaround for bugs with the most common auto reset - # circuit and Windows, if the EN pin on the dev board does not have - # enough capacitance. - # - # Newer dev boards shouldn't have this problem (higher value capacitor - # on the EN pin), and ESP32 revision 1 can't use this workaround as it - # relies on a silicon bug. - # - # Details: https://github.com/espressif/esptool/issues/136 - last_error = None - - # If we're doing no_sync, we're likely communicating as a pass through - # with an intermediate device to the ESP32 - if mode == "no_reset_no_sync": - return last_error - - # issue reset-to-bootloader: - # RTS = either CH_PD/EN or nRESET (both active low = chip in reset - # DTR = GPIO0 (active low = boot to flasher) - # - # DTR & RTS are active low signals, - # ie True = pin @ 0V, False = pin @ VCC. - if mode != 'no_reset': - self._setDTR(False) # IO0=HIGH - self._setRTS(True) # EN=LOW, chip in reset - time.sleep(0.1) - if esp32r0_delay: - # Some chips are more likely to trigger the esp32r0 - # watchdog reset silicon bug if they're held with EN=LOW - # for a longer period - time.sleep(1.2) - self._setDTR(True) # IO0=LOW - self._setRTS(False) # EN=HIGH, chip out of reset - if esp32r0_delay: - # Sleep longer after reset. - # This workaround only works on revision 0 ESP32 chips, - # it exploits a silicon bug spurious watchdog reset. - time.sleep(0.4) # allow watchdog reset to occur - time.sleep(0.05) - self._setDTR(False) # IO0=HIGH, done - - for _ in range(5): - try: - self.flush_input() - self._port.flushOutput() - self.sync() - return None - except FatalError as e: - if esp32r0_delay: - print('_', end='') - else: - print('.', end='') - sys.stdout.flush() - time.sleep(0.05) - last_error = e - return last_error - - def connect(self, mode='default_reset'): - """ Try connecting repeatedly until successful, or giving up """ - print('Connecting...', end='') - sys.stdout.flush() - last_error = None - - try: - for _ in range(7): - last_error = self._connect_attempt(mode=mode, esp32r0_delay=False) - if last_error is None: - return - last_error = self._connect_attempt(mode=mode, esp32r0_delay=True) - if last_error is None: - return - finally: - print('') # end 'Connecting...' line - raise FatalError('Failed to connect to %s: %s' % (self.CHIP_NAME, last_error)) - - def read_reg(self, addr): - """ Read memory address in target """ - # we don't call check_command here because read_reg() function is called - # when detecting chip type, and the way we check for success (STATUS_BYTES_LENGTH) is different - # for different chip types (!) - val, data = self.command(self.ESP_READ_REG, struct.pack(' start: - raise FatalError(("Software loader is resident at 0x%08x-0x%08x. " + - "Can't load binary at overlapping address range 0x%08x-0x%08x. " + - "Either change binary loading address, or use the --no-stub " + - "option to disable the software loader.") % (start, end, load_start, load_end)) - - return self.check_command("enter RAM download mode", self.ESP_MEM_BEGIN, - struct.pack(' length: - raise FatalError('Read more than expected') - - digest_frame = self.read() - if len(digest_frame) != 16: - raise FatalError('Expected digest, got: %s' % hexify(digest_frame)) - expected_digest = hexify(digest_frame).upper() - digest = hashlib.md5(data).hexdigest().upper() - if digest != expected_digest: - raise FatalError('Digest mismatch: expected %s, got %s' % (expected_digest, digest)) - return data - - def flash_spi_attach(self, hspi_arg): - """Send SPI attach command to enable the SPI flash pins - - ESP8266 ROM does this when you send flash_begin, ESP32 ROM - has it as a SPI command. - """ - # last 3 bytes in ESP_SPI_ATTACH argument are reserved values - arg = struct.pack(' 0: - self.write_reg(SPI_MOSI_DLEN_REG, mosi_bits - 1) - if miso_bits > 0: - self.write_reg(SPI_MISO_DLEN_REG, miso_bits - 1) - else: - - def set_data_lengths(mosi_bits, miso_bits): - SPI_DATA_LEN_REG = SPI_USR1_REG - SPI_MOSI_BITLEN_S = 17 - SPI_MISO_BITLEN_S = 8 - mosi_mask = 0 if (mosi_bits == 0) else (mosi_bits - 1) - miso_mask = 0 if (miso_bits == 0) else (miso_bits - 1) - self.write_reg(SPI_DATA_LEN_REG, - (miso_mask << SPI_MISO_BITLEN_S) | ( - mosi_mask << SPI_MOSI_BITLEN_S)) - - # SPI peripheral "command" bitmasks for SPI_CMD_REG - SPI_CMD_USR = (1 << 18) - - # shift values - SPI_USR2_DLEN_SHIFT = 28 - - if read_bits > 32: - raise FatalError("Reading more than 32 bits back from a SPI flash operation is unsupported") - if len(data) > 64: - raise FatalError("Writing more than 64 bytes of data with one SPI command is unsupported") - - data_bits = len(data) * 8 - old_spi_usr = self.read_reg(SPI_USR_REG) - old_spi_usr2 = self.read_reg(SPI_USR2_REG) - flags = SPI_USR_COMMAND - if read_bits > 0: - flags |= SPI_USR_MISO - if data_bits > 0: - flags |= SPI_USR_MOSI - set_data_lengths(data_bits, read_bits) - self.write_reg(SPI_USR_REG, flags) - self.write_reg(SPI_USR2_REG, - (7 << SPI_USR2_DLEN_SHIFT) | spiflash_command) - if data_bits == 0: - self.write_reg(SPI_W0_REG, 0) # clear data register before we read it - else: - data = pad_to(data, 4, b'\00') # pad to 32-bit multiple - words = struct.unpack("I" * (len(data) // 4), data) - next_reg = SPI_W0_REG - for word in words: - self.write_reg(next_reg, word) - next_reg += 4 - self.write_reg(SPI_CMD_REG, SPI_CMD_USR) - - def wait_done(): - for _ in range(10): - if (self.read_reg(SPI_CMD_REG) & SPI_CMD_USR) == 0: - return - raise FatalError("SPI command did not complete in time") - wait_done() - - status = self.read_reg(SPI_W0_REG) - # restore some SPI controller registers - self.write_reg(SPI_USR_REG, old_spi_usr) - self.write_reg(SPI_USR2_REG, old_spi_usr2) - return status - - def read_status(self, num_bytes=2): - """Read up to 24 bits (num_bytes) of SPI flash status register contents - via RDSR, RDSR2, RDSR3 commands - - Not all SPI flash supports all three commands. The upper 1 or 2 - bytes may be 0xFF. - """ - SPIFLASH_RDSR = 0x05 - SPIFLASH_RDSR2 = 0x35 - SPIFLASH_RDSR3 = 0x15 - - status = 0 - shift = 0 - for cmd in [SPIFLASH_RDSR, SPIFLASH_RDSR2, SPIFLASH_RDSR3][0:num_bytes]: - status += self.run_spiflash_command(cmd, read_bits=8) << shift - shift += 8 - return status - - def write_status(self, new_status, num_bytes=2, set_non_volatile=False): - """Write up to 24 bits (num_bytes) of new status register - - num_bytes can be 1, 2 or 3. - - Not all flash supports the additional commands to write the - second and third byte of the status register. When writing 2 - bytes, esptool also sends a 16-byte WRSR command (as some - flash types use this instead of WRSR2.) - - If the set_non_volatile flag is set, non-volatile bits will - be set as well as volatile ones (WREN used instead of WEVSR). - - """ - SPIFLASH_WRSR = 0x01 - SPIFLASH_WRSR2 = 0x31 - SPIFLASH_WRSR3 = 0x11 - SPIFLASH_WEVSR = 0x50 - SPIFLASH_WREN = 0x06 - SPIFLASH_WRDI = 0x04 - - enable_cmd = SPIFLASH_WREN if set_non_volatile else SPIFLASH_WEVSR - - # try using a 16-bit WRSR (not supported by all chips) - # this may be redundant, but shouldn't hurt - if num_bytes == 2: - self.run_spiflash_command(enable_cmd) - self.run_spiflash_command(SPIFLASH_WRSR, struct.pack(">= 8 - - self.run_spiflash_command(SPIFLASH_WRDI) - - def get_crystal_freq(self): - # Figure out the crystal frequency from the UART clock divider - # Returns a normalized value in integer MHz (40 or 26 are the only supported values) - # - # The logic here is: - # - We know that our baud rate and the ESP UART baud rate are roughly the same, or we couldn't communicate - # - We can read the UART clock divider register to know how the ESP derives this from the APB bus frequency - # - Multiplying these two together gives us the bus frequency which is either the crystal frequency (ESP32) - # or double the crystal frequency (ESP8266). See the self.XTAL_CLK_DIVIDER parameter for this factor. - uart_div = self.read_reg(self.UART_CLKDIV_REG) & self.UART_CLKDIV_MASK - est_xtal = (self._port.baudrate * uart_div) / 1e6 / self.XTAL_CLK_DIVIDER - norm_xtal = 40 if est_xtal > 33 else 26 - if abs(norm_xtal - est_xtal) > 1: - print("WARNING: Detected crystal freq %.2fMHz is quite different to normalized freq %dMHz. Unsupported crystal in use?" % (est_xtal, norm_xtal)) - return norm_xtal - - def hard_reset(self): - self._setRTS(True) # EN->LOW - time.sleep(0.1) - self._setRTS(False) - - def soft_reset(self, stay_in_bootloader): - if not self.IS_STUB: - if stay_in_bootloader: - return # ROM bootloader is already in bootloader! - else: - # 'run user code' is as close to a soft reset as we can do - self.flash_begin(0, 0) - self.flash_finish(False) - else: - if stay_in_bootloader: - # soft resetting from the stub loader - # will re-load the ROM bootloader - self.flash_begin(0, 0) - self.flash_finish(True) - elif self.CHIP_NAME != "ESP8266": - raise FatalError("Soft resetting is currently only supported on ESP8266") - else: - # running user code from stub loader requires some hacks - # in the stub loader - self.command(self.ESP_RUN_USER_CODE, wait_response=False) - - -class ESP8266ROM(ESPLoader): - """ Access class for ESP8266 ROM bootloader - """ - CHIP_NAME = "ESP8266" - IS_STUB = False - - DATE_REG_VALUE = 0x00062000 - - # OTP ROM addresses - ESP_OTP_MAC0 = 0x3ff00050 - ESP_OTP_MAC1 = 0x3ff00054 - ESP_OTP_MAC3 = 0x3ff0005c - - SPI_REG_BASE = 0x60000200 - SPI_W0_OFFS = 0x40 - SPI_HAS_MOSI_DLEN_REG = False - - UART_CLKDIV_REG = 0x60000014 - - XTAL_CLK_DIVIDER = 2 - - FLASH_SIZES = { - '512KB':0x00, - '256KB':0x10, - '1MB':0x20, - '2MB':0x30, - '4MB':0x40, - '2MB-c1': 0x50, - '4MB-c1':0x60, - '8MB':0x80, - '16MB':0x90, - } - - BOOTLOADER_FLASH_OFFSET = 0 - - MEMORY_MAP = [[0x3FF00000, 0x3FF00010, "DPORT"], - [0x3FFE8000, 0x40000000, "DRAM"], - [0x40100000, 0x40108000, "IRAM"], - [0x40201010, 0x402E1010, "IROM"]] - - def get_efuses(self): - # Return the 128 bits of ESP8266 efuse as a single Python integer - return (self.read_reg(0x3ff0005c) << 96 | - self.read_reg(0x3ff00058) << 64 | - self.read_reg(0x3ff00054) << 32 | - self.read_reg(0x3ff00050)) - - def get_chip_description(self): - efuses = self.get_efuses() - is_8285 = (efuses & ((1 << 4) | 1 << 80)) != 0 # One or the other efuse bit is set for ESP8285 - return "ESP8285" if is_8285 else "ESP8266EX" - - def get_chip_features(self): - features = ["WiFi"] - if self.get_chip_description() == "ESP8285": - features += ["Embedded Flash"] - return features - - def flash_spi_attach(self, hspi_arg): - if self.IS_STUB: - super(ESP8266ROM, self).flash_spi_attach(hspi_arg) - else: - # ESP8266 ROM has no flash_spi_attach command in serial protocol, - # but flash_begin will do it - self.flash_begin(0, 0) - - def flash_set_parameters(self, size): - # not implemented in ROM, but OK to silently skip for ROM - if self.IS_STUB: - super(ESP8266ROM, self).flash_set_parameters(size) - - def chip_id(self): - """ Read Chip ID from efuse - the equivalent of the SDK system_get_chip_id() function """ - id0 = self.read_reg(self.ESP_OTP_MAC0) - id1 = self.read_reg(self.ESP_OTP_MAC1) - return (id0 >> 24) | ((id1 & MAX_UINT24) << 8) - - def read_mac(self): - """ Read MAC from OTP ROM """ - mac0 = self.read_reg(self.ESP_OTP_MAC0) - mac1 = self.read_reg(self.ESP_OTP_MAC1) - mac3 = self.read_reg(self.ESP_OTP_MAC3) - if (mac3 != 0): - oui = ((mac3 >> 16) & 0xff, (mac3 >> 8) & 0xff, mac3 & 0xff) - elif ((mac1 >> 16) & 0xff) == 0: - oui = (0x18, 0xfe, 0x34) - elif ((mac1 >> 16) & 0xff) == 1: - oui = (0xac, 0xd0, 0x74) - else: - raise FatalError("Unknown OUI") - return oui + ((mac1 >> 8) & 0xff, mac1 & 0xff, (mac0 >> 24) & 0xff) - - def get_erase_size(self, offset, size): - """ Calculate an erase size given a specific size in bytes. - - Provides a workaround for the bootloader erase bug.""" - - sectors_per_block = 16 - sector_size = self.FLASH_SECTOR_SIZE - num_sectors = (size + sector_size - 1) // sector_size - start_sector = offset // sector_size - - head_sectors = sectors_per_block - (start_sector % sectors_per_block) - if num_sectors < head_sectors: - head_sectors = num_sectors - - if num_sectors < 2 * head_sectors: - return (num_sectors + 1) // 2 * sector_size - else: - return (num_sectors - head_sectors) * sector_size - - def override_vddsdio(self, new_voltage): - raise NotImplementedInROMError("Overriding VDDSDIO setting only applies to ESP32") - - -class ESP8266StubLoader(ESP8266ROM): - """ Access class for ESP8266 stub loader, runs on top of ROM. - """ - FLASH_WRITE_SIZE = 0x4000 # matches MAX_WRITE_BLOCK in stub_loader.c - IS_STUB = True - - def __init__(self, rom_loader): - self._port = rom_loader._port - self._trace_enabled = rom_loader._trace_enabled - self.flush_input() # resets _slip_reader - - def get_erase_size(self, offset, size): - return size # stub doesn't have same size bug as ROM loader - - -ESP8266ROM.STUB_CLASS = ESP8266StubLoader - - -class ESP32ROM(ESPLoader): - """Access class for ESP32 ROM bootloader - - """ - CHIP_NAME = "ESP32" - IMAGE_CHIP_ID = 0 - IS_STUB = False - - DATE_REG_VALUE = 0x15122500 - - IROM_MAP_START = 0x400d0000 - IROM_MAP_END = 0x40400000 - DROM_MAP_START = 0x3F400000 - DROM_MAP_END = 0x3F800000 - - # ESP32 uses a 4 byte status reply - STATUS_BYTES_LENGTH = 4 - - SPI_REG_BASE = 0x60002000 - EFUSE_REG_BASE = 0x6001a000 - - DR_REG_SYSCON_BASE = 0x3ff66000 - - SPI_W0_OFFS = 0x80 - SPI_HAS_MOSI_DLEN_REG = True - - UART_CLKDIV_REG = 0x3ff40014 - - XTAL_CLK_DIVIDER = 1 - - FLASH_SIZES = { - '1MB':0x00, - '2MB':0x10, - '4MB':0x20, - '8MB':0x30, - '16MB':0x40 - } - - BOOTLOADER_FLASH_OFFSET = 0x1000 - - OVERRIDE_VDDSDIO_CHOICES = ["1.8V", "1.9V", "OFF"] - - MEMORY_MAP = [[0x3F400000, 0x3F800000, "DROM"], - [0x3F800000, 0x3FC00000, "EXTRAM_DATA"], - [0x3FF80000, 0x3FF82000, "RTC_DRAM"], - [0x3FF90000, 0x40000000, "BYTE_ACCESSIBLE"], - [0x3FFAE000, 0x40000000, "DRAM"], - [0x3FFAE000, 0x40000000, "DMA"], - [0x3FFE0000, 0x3FFFFFFC, "DIRAM_DRAM"], - [0x40000000, 0x40070000, "IROM"], - [0x40070000, 0x40078000, "CACHE_PRO"], - [0x40078000, 0x40080000, "CACHE_APP"], - [0x40080000, 0x400A0000, "IRAM"], - [0x400A0000, 0x400BFFFC, "DIRAM_IRAM"], - [0x400C0000, 0x400C2000, "RTC_IRAM"], - [0x400D0000, 0x40400000, "IROM"], - [0x50000000, 0x50002000, "RTC_DATA"]] - - """ Try to read the BLOCK1 (encryption key) and check if it is valid """ - - def is_flash_encryption_key_valid(self): - - """ Bit 0 of efuse_rd_disable[3:0] is mapped to BLOCK1 - this bit is at position 16 in EFUSE_BLK0_RDATA0_REG """ - word0 = self.read_efuse(0) - rd_disable = (word0 >> 16) & 0x1 - - # reading of BLOCK1 is NOT ALLOWED so we assume valid key is programmed - if rd_disable: - return True - else: - """ reading of BLOCK1 is ALLOWED so we will read and verify for non-zero. - When ESP32 has not generated AES/encryption key in BLOCK1, the contents will be readable and 0. - If the flash encryption is enabled it is expected to have a valid non-zero key. We break out on - first occurance of non-zero value """ - key_word = [0] * 7 - for i in range(len(key_word)): - key_word[i] = self.read_efuse(14 + i) - # key is non-zero so break & return - if key_word[i] != 0: - return True - return False - - """ For flash encryption related commands we need to make sure - user has programmed all the relevant efuse correctly so at - the end of write_flash_encrypt esptool will verify the values - of flash_crypt_config to be non zero if they are not read - protected. If the values are zero a warning will be printed - """ - - def get_flash_crypt_config(self): - """ bit 3 in efuse_rd_disable[3:0] is mapped to flash_crypt_config - this bit is at position 19 in EFUSE_BLK0_RDATA0_REG """ - word0 = self.read_efuse(0) - rd_disable = (word0 >> 19) & 0x1 - - if rd_disable == 0: - """ we can read the flash_crypt_config efuse value - so go & read it (EFUSE_BLK0_RDATA5_REG[31:28]) """ - word5 = self.read_efuse(5) - word5 = (word5 >> 28) & 0xF - return word5 - else: - # if read of the efuse is disabled we assume it is set correctly - return 0xF - - def get_chip_description(self): - word3 = self.read_efuse(3) - word5 = self.read_efuse(5) - apb_ctl_date = self.read_reg(self.DR_REG_SYSCON_BASE + 0x7C) - rev_bit0 = (word3 >> 15) & 0x1 - rev_bit1 = (word5 >> 20) & 0x1 - rev_bit2 = (apb_ctl_date >> 31) & 0x1 - pkg_version = (word3 >> 9) & 0x07 - - chip_name = { - 0: "ESP32D0WDQ6", - 1: "ESP32D0WDQ5", - 2: "ESP32D2WDQ5", - 5: "ESP32-PICO-D4", - }.get(pkg_version, "unknown ESP32") - - chip_revision = 0 - if rev_bit0: - if rev_bit1: - if rev_bit2: - chip_revision = 3 - else: - chip_revision = 2 - else: - chip_revision = 1 - return "%s (revision %d)" % (chip_name, chip_revision) - - def get_chip_features(self): - features = ["WiFi"] - word3 = self.read_efuse(3) - - # names of variables in this section are lowercase - # versions of EFUSE names as documented in TRM and - # ESP-IDF efuse_reg.h - - chip_ver_dis_bt = word3 & (1 << 1) - if chip_ver_dis_bt == 0: - features += ["BT"] - - chip_ver_dis_app_cpu = word3 & (1 << 0) - if chip_ver_dis_app_cpu: - features += ["Single Core"] - else: - features += ["Dual Core"] - - chip_cpu_freq_rated = word3 & (1 << 13) - if chip_cpu_freq_rated: - chip_cpu_freq_low = word3 & (1 << 12) - if chip_cpu_freq_low: - features += ["160MHz"] - else: - features += ["240MHz"] - - pkg_version = (word3 >> 9) & 0x07 - if pkg_version in [2, 4, 5]: - features += ["Embedded Flash"] - - word4 = self.read_efuse(4) - adc_vref = (word4 >> 8) & 0x1F - if adc_vref: - features += ["VRef calibration in efuse"] - - blk3_part_res = word3 >> 14 & 0x1 - if blk3_part_res: - features += ["BLK3 partially reserved"] - - word6 = self.read_efuse(6) - coding_scheme = word6 & 0x3 - features += ["Coding Scheme %s" % { - 0: "None", - 1: "3/4", - 2: "Repeat (UNSUPPORTED)", - 3: "Invalid"}[coding_scheme]] - - return features - - def read_efuse(self, n): - """ Read the nth word of the ESP3x EFUSE region. """ - return self.read_reg(self.EFUSE_REG_BASE + (4 * n)) - - def chip_id(self): - raise NotSupportedError(self, "chip_id") - - def read_mac(self): - """ Read MAC from EFUSE region """ - words = [self.read_efuse(2), self.read_efuse(1)] - bitstring = struct.pack(">II", *words) - bitstring = bitstring[2:8] # trim the 2 byte CRC - try: - return tuple(ord(b) for b in bitstring) - except TypeError: # Python 3, bitstring elements are already bytes - return tuple(bitstring) - - def get_erase_size(self, offset, size): - return size - - def override_vddsdio(self, new_voltage): - new_voltage = new_voltage.upper() - if new_voltage not in self.OVERRIDE_VDDSDIO_CHOICES: - raise FatalError("The only accepted VDDSDIO overrides are '1.8V', '1.9V' and 'OFF'") - RTC_CNTL_SDIO_CONF_REG = 0x3ff48074 - RTC_CNTL_XPD_SDIO_REG = (1 << 31) - RTC_CNTL_DREFH_SDIO_M = (3 << 29) - RTC_CNTL_DREFM_SDIO_M = (3 << 27) - RTC_CNTL_DREFL_SDIO_M = (3 << 25) - # RTC_CNTL_SDIO_TIEH = (1 << 23) # not used here, setting TIEH=1 would set 3.3V output, not safe for esptool.py to do - RTC_CNTL_SDIO_FORCE = (1 << 22) - RTC_CNTL_SDIO_PD_EN = (1 << 21) - - reg_val = RTC_CNTL_SDIO_FORCE # override efuse setting - reg_val |= RTC_CNTL_SDIO_PD_EN - if new_voltage != "OFF": - reg_val |= RTC_CNTL_XPD_SDIO_REG # enable internal LDO - if new_voltage == "1.9V": - reg_val |= (RTC_CNTL_DREFH_SDIO_M | RTC_CNTL_DREFM_SDIO_M | RTC_CNTL_DREFL_SDIO_M) # boost voltage - self.write_reg(RTC_CNTL_SDIO_CONF_REG, reg_val) - print("VDDSDIO regulator set to %s" % new_voltage) - - -class ESP32StubLoader(ESP32ROM): - """ Access class for ESP32 stub loader, runs on top of ROM. - """ - FLASH_WRITE_SIZE = 0x4000 # matches MAX_WRITE_BLOCK in stub_loader.c - STATUS_BYTES_LENGTH = 2 # same as ESP8266, different to ESP32 ROM - IS_STUB = True - - def __init__(self, rom_loader): - self._port = rom_loader._port - self._trace_enabled = rom_loader._trace_enabled - self.flush_input() # resets _slip_reader - - -ESP32ROM.STUB_CLASS = ESP32StubLoader - - -class ESPBOOTLOADER(object): - """ These are constants related to software ESP bootloader, working with 'v2' image files """ - - # First byte of the "v2" application image - IMAGE_V2_MAGIC = 0xea - - # First 'segment' value in a "v2" application image, appears to be a constant version value? - IMAGE_V2_SEGMENT = 4 - - -def LoadFirmwareImage(chip, filename): - """ Load a firmware image. Can be for ESP8266 or ESP32. ESP8266 images will be examined to determine if they are - original ROM firmware images (ESP8266ROMFirmwareImage) or "v2" OTA bootloader images. - - Returns a BaseFirmwareImage subclass, either ESP8266ROMFirmwareImage (v1) or ESP8266V2FirmwareImage (v2). - """ - with open(filename, 'rb') as f: - if chip.lower() == 'esp32': - return ESP32FirmwareImage(f) - else: # Otherwise, ESP8266 so look at magic to determine the image type - magic = ord(f.read(1)) - f.seek(0) - if magic == ESPLoader.ESP_IMAGE_MAGIC: - return ESP8266ROMFirmwareImage(f) - elif magic == ESPBOOTLOADER.IMAGE_V2_MAGIC: - return ESP8266V2FirmwareImage(f) - else: - raise FatalError("Invalid image magic number: %d" % magic) - - -class ImageSegment(object): - """ Wrapper class for a segment in an ESP image - (very similar to a section in an ELFImage also) """ - def __init__(self, addr, data, file_offs=None): - self.addr = addr - self.data = data - self.file_offs = file_offs - self.include_in_checksum = True - if self.addr != 0: - self.pad_to_alignment(4) # pad all "real" ImageSegments 4 byte aligned length - - def copy_with_new_addr(self, new_addr): - """ Return a new ImageSegment with same data, but mapped at - a new address. """ - return ImageSegment(new_addr, self.data, 0) - - def split_image(self, split_len): - """ Return a new ImageSegment which splits "split_len" bytes - from the beginning of the data. Remaining bytes are kept in - this segment object (and the start address is adjusted to match.) """ - result = copy.copy(self) - result.data = self.data[:split_len] - self.data = self.data[split_len:] - self.addr += split_len - self.file_offs = None - result.file_offs = None - return result - - def __repr__(self): - r = "len 0x%05x load 0x%08x" % (len(self.data), self.addr) - if self.file_offs is not None: - r += " file_offs 0x%08x" % (self.file_offs) - return r - - def pad_to_alignment(self, alignment): - self.data = pad_to(self.data, alignment, b'\x00') - - -class ELFSection(ImageSegment): - """ Wrapper class for a section in an ELF image, has a section - name as well as the common properties of an ImageSegment. """ - def __init__(self, name, addr, data): - super(ELFSection, self).__init__(addr, data) - self.name = name.decode("utf-8") - - def __repr__(self): - return "%s %s" % (self.name, super(ELFSection, self).__repr__()) - - -class BaseFirmwareImage(object): - SEG_HEADER_LEN = 8 - SHA256_DIGEST_LEN = 32 - - """ Base class with common firmware image functions """ - def __init__(self): - self.segments = [] - self.entrypoint = 0 - self.elf_sha256 = None - self.elf_sha256_offset = 0 - - def load_common_header(self, load_file, expected_magic): - (magic, segments, self.flash_mode, self.flash_size_freq, self.entrypoint) = struct.unpack(' 16: - raise FatalError('Invalid segment count %d (max 16). Usually this indicates a linker script problem.' % len(self.segments)) - - def load_segment(self, f, is_irom_segment=False): - """ Load the next segment from the image file """ - file_offs = f.tell() - (offset, size) = struct.unpack(' 0x40200000 or offset < 0x3ffe0000 or size > 65536: - print('WARNING: Suspicious segment 0x%x, length %d' % (offset, size)) - - def maybe_patch_segment_data(self, f, segment_data): - """If SHA256 digest of the ELF file needs to be inserted into this segment, do so. Returns segment data.""" - segment_len = len(segment_data) - file_pos = f.tell() # file_pos is position in the .bin file - if self.elf_sha256_offset >= file_pos and self.elf_sha256_offset < file_pos + segment_len: - # SHA256 digest needs to be patched into this binary segment, - # calculate offset of the digest inside the binary segment. - patch_offset = self.elf_sha256_offset - file_pos - # Sanity checks - if patch_offset < self.SEG_HEADER_LEN or patch_offset + self.SHA256_DIGEST_LEN > segment_len: - raise FatalError('Cannot place SHA256 digest on segment boundary' + - '(elf_sha256_offset=%d, file_pos=%d, segment_size=%d)' % - (self.elf_sha256_offset, file_pos, segment_len)) - if segment_data[patch_offset:patch_offset + self.SHA256_DIGEST_LEN] != b'\x00' * self.SHA256_DIGEST_LEN: - raise FatalError('Contents of segment at SHA256 digest offset 0x%x are not all zero. Refusing to overwrite.' % - self.elf_sha256_offset) - assert(len(self.elf_sha256) == self.SHA256_DIGEST_LEN) - # offset relative to the data part - patch_offset -= self.SEG_HEADER_LEN - segment_data = segment_data[0:patch_offset] + self.elf_sha256 + \ - segment_data[patch_offset + self.SHA256_DIGEST_LEN:] - return segment_data - - def save_segment(self, f, segment, checksum=None): - """ Save the next segment to the image file, return next checksum value if provided """ - segment_data = self.maybe_patch_segment_data(f, segment.data) - f.write(struct.pack(' 0: - if len(irom_segments) != 1: - raise FatalError('Found %d segments that could be irom0. Bad ELF file?' % len(irom_segments)) - return irom_segments[0] - return None - - def get_non_irom_segments(self): - irom_segment = self.get_irom_segment() - return [s for s in self.segments if s != irom_segment] - - -class ESP8266ROMFirmwareImage(BaseFirmwareImage): - """ 'Version 1' firmware image, segments loaded directly by the ROM bootloader. """ - - ROM_LOADER = ESP8266ROM - - def __init__(self, load_file=None): - super(ESP8266ROMFirmwareImage, self).__init__() - self.flash_mode = 0 - self.flash_size_freq = 0 - self.version = 1 - - if load_file is not None: - segments = self.load_common_header(load_file, ESPLoader.ESP_IMAGE_MAGIC) - - for _ in range(segments): - self.load_segment(load_file) - self.checksum = self.read_checksum(load_file) - - self.verify() - - def default_output_name(self, input_file): - """ Derive a default output name from the ELF name. """ - return input_file + '-' - - def save(self, basename): - """ Save a set of V1 images for flashing. Parameter is a base filename. """ - # IROM data goes in its own plain binary file - irom_segment = self.get_irom_segment() - if irom_segment is not None: - with open("%s0x%05x.bin" % (basename, irom_segment.addr - ESP8266ROM.IROM_MAP_START), "wb") as f: - f.write(irom_segment.data) - - # everything but IROM goes at 0x00000 in an image file - normal_segments = self.get_non_irom_segments() - with open("%s0x00000.bin" % basename, 'wb') as f: - self.write_common_header(f, normal_segments) - checksum = ESPLoader.ESP_CHECKSUM_MAGIC - for segment in normal_segments: - checksum = self.save_segment(f, segment, checksum) - self.append_checksum(f, checksum) - - -ESP8266ROM.BOOTLOADER_IMAGE = ESP8266ROMFirmwareImage - - -class ESP8266V2FirmwareImage(BaseFirmwareImage): - """ 'Version 2' firmware image, segments loaded by software bootloader stub - (ie Espressif bootloader or rboot) - """ - - ROM_LOADER = ESP8266ROM - - def __init__(self, load_file=None): - super(ESP8266V2FirmwareImage, self).__init__() - self.version = 2 - if load_file is not None: - segments = self.load_common_header(load_file, ESPBOOTLOADER.IMAGE_V2_MAGIC) - if segments != ESPBOOTLOADER.IMAGE_V2_SEGMENT: - # segment count is not really segment count here, but we expect to see '4' - print('Warning: V2 header has unexpected "segment" count %d (usually 4)' % segments) - - # irom segment comes before the second header - # - # the file is saved in the image with a zero load address - # in the header, so we need to calculate a load address - irom_segment = self.load_segment(load_file, True) - irom_segment.addr = 0 # for actual mapped addr, add ESP8266ROM.IROM_MAP_START + flashing_addr + 8 - irom_segment.include_in_checksum = False - - first_flash_mode = self.flash_mode - first_flash_size_freq = self.flash_size_freq - first_entrypoint = self.entrypoint - # load the second header - - segments = self.load_common_header(load_file, ESPLoader.ESP_IMAGE_MAGIC) - - if first_flash_mode != self.flash_mode: - print('WARNING: Flash mode value in first header (0x%02x) disagrees with second (0x%02x). Using second value.' - % (first_flash_mode, self.flash_mode)) - if first_flash_size_freq != self.flash_size_freq: - print('WARNING: Flash size/freq value in first header (0x%02x) disagrees with second (0x%02x). Using second value.' - % (first_flash_size_freq, self.flash_size_freq)) - if first_entrypoint != self.entrypoint: - print('WARNING: Entrypoint address in first header (0x%08x) disagrees with second header (0x%08x). Using second value.' - % (first_entrypoint, self.entrypoint)) - - # load all the usual segments - for _ in range(segments): - self.load_segment(load_file) - self.checksum = self.read_checksum(load_file) - - self.verify() - - def default_output_name(self, input_file): - """ Derive a default output name from the ELF name. """ - irom_segment = self.get_irom_segment() - if irom_segment is not None: - irom_offs = irom_segment.addr - ESP8266ROM.IROM_MAP_START - else: - irom_offs = 0 - return "%s-0x%05x.bin" % (os.path.splitext(input_file)[0], - irom_offs & ~(ESPLoader.FLASH_SECTOR_SIZE - 1)) - - def save(self, filename): - with open(filename, 'wb') as f: - # Save first header for irom0 segment - f.write(struct.pack(b' 0: - last_addr = flash_segments[0].addr - for segment in flash_segments[1:]: - if segment.addr // self.IROM_ALIGN == last_addr // self.IROM_ALIGN: - raise FatalError(("Segment loaded at 0x%08x lands in same 64KB flash mapping as segment loaded at 0x%08x. " + - "Can't generate binary. Suggest changing linker script or ELF to merge sections.") % - (segment.addr, last_addr)) - last_addr = segment.addr - - def get_alignment_data_needed(segment): - # Actual alignment (in data bytes) required for a segment header: positioned so that - # after we write the next 8 byte header, file_offs % IROM_ALIGN == segment.addr % IROM_ALIGN - # - # (this is because the segment's vaddr may not be IROM_ALIGNed, more likely is aligned - # IROM_ALIGN+0x18 to account for the binary file header - align_past = (segment.addr % self.IROM_ALIGN) - self.SEG_HEADER_LEN - pad_len = (self.IROM_ALIGN - (f.tell() % self.IROM_ALIGN)) + align_past - if pad_len == 0 or pad_len == self.IROM_ALIGN: - return 0 # already aligned - - # subtract SEG_HEADER_LEN a second time, as the padding block has a header as well - pad_len -= self.SEG_HEADER_LEN - if pad_len < 0: - pad_len += self.IROM_ALIGN - return pad_len - - # try to fit each flash segment on a 64kB aligned boundary - # by padding with parts of the non-flash segments... - while len(flash_segments) > 0: - segment = flash_segments[0] - pad_len = get_alignment_data_needed(segment) - if pad_len > 0: # need to pad - if len(ram_segments) > 0 and pad_len > self.SEG_HEADER_LEN: - pad_segment = ram_segments[0].split_image(pad_len) - if len(ram_segments[0].data) == 0: - ram_segments.pop(0) - else: - pad_segment = ImageSegment(0, b'\x00' * pad_len, f.tell()) - checksum = self.save_segment(f, pad_segment, checksum) - total_segments += 1 - else: - # write the flash segment - assert (f.tell() + 8) % self.IROM_ALIGN == segment.addr % self.IROM_ALIGN - checksum = self.save_flash_segment(f, segment, checksum) - flash_segments.pop(0) - total_segments += 1 - - # flash segments all written, so write any remaining RAM segments - for segment in ram_segments: - checksum = self.save_segment(f, segment, checksum) - total_segments += 1 - - if self.secure_pad: - # pad the image so that after signing it will end on a a 64KB boundary. - # This ensures all mapped flash content will be verified. - if not self.append_digest: - raise FatalError("secure_pad only applies if a SHA-256 digest is also appended to the image") - align_past = (f.tell() + self.SEG_HEADER_LEN) % self.IROM_ALIGN - # 16 byte aligned checksum (force the alignment to simplify calculations) - checksum_space = 16 - # after checksum: SHA-256 digest + (to be added by signing process) version, signature + 12 trailing bytes due to alignment - space_after_checksum = 32 + 4 + 64 + 12 - pad_len = (self.IROM_ALIGN - align_past - checksum_space - space_after_checksum) % self.IROM_ALIGN - pad_segment = ImageSegment(0, b'\x00' * pad_len, f.tell()) - - checksum = self.save_segment(f, pad_segment, checksum) - total_segments += 1 - - # done writing segments - self.append_checksum(f, checksum) - image_length = f.tell() - - if self.secure_pad: - assert ((image_length + space_after_checksum) % self.IROM_ALIGN) == 0 - - # kinda hacky: go back to the initial header and write the new segment count - # that includes padding segments. This header is not checksummed - f.seek(1) - try: - f.write(chr(total_segments)) - except TypeError: # Python 3 - f.write(bytes([total_segments])) - - if self.append_digest: - # calculate the SHA256 of the whole file and append it - f.seek(0) - digest = hashlib.sha256() - digest.update(f.read(image_length)) - f.write(digest.digest()) - - with open(filename, 'wb') as real_file: - real_file.write(f.getvalue()) - - def save_flash_segment(self, f, segment, checksum=None): - """ Save the next segment to the image file, return next checksum value if provided """ - segment_end_pos = f.tell() + len(segment.data) + self.SEG_HEADER_LEN - segment_len_remainder = segment_end_pos % self.IROM_ALIGN - if segment_len_remainder < 0x24: - # Work around a bug in ESP-IDF 2nd stage bootloader, that it didn't map the - # last MMU page, if an IROM/DROM segment was < 0x24 bytes over the page boundary. - segment.data += b'\x00' * (0x24 - segment_len_remainder) - return self.save_segment(f, segment, checksum) - - def load_extended_header(self, load_file): - def split_byte(n): - return (n & 0x0F, (n >> 4) & 0x0F) - - fields = list(struct.unpack(self.EXTENDED_HEADER_STRUCT_FMT, load_file.read(16))) - - self.wp_pin = fields[0] - - # SPI pin drive stengths are two per byte - self.clk_drv, self.q_drv = split_byte(fields[1]) - self.d_drv, self.cs_drv = split_byte(fields[2]) - self.hd_drv, self.wp_drv = split_byte(fields[3]) - - chip_id = fields[4] - if chip_id != self.ROM_LOADER.IMAGE_CHIP_ID: - print("Unexpected chip id in image. Expected %d but value was %d. Is this image for a different chip model?" % (self.ROM_LOADER.IMAGE_CHIP_ID, chip_id)) - - # reserved fields in the middle should all be zero - if any(f for f in fields[6:-1] if f != 0): - print("Warning: some reserved header fields have non-zero values. This image may be from a newer esptool.py?") - - append_digest = fields[-1] # last byte is append_digest - if append_digest in [0, 1]: - self.append_digest = (append_digest == 1) - else: - raise RuntimeError("Invalid value for append_digest field (0x%02x). Should be 0 or 1.", append_digest) - - - def save_extended_header(self, save_file): - def join_byte(ln,hn): - return (ln & 0x0F) + ((hn & 0x0F) << 4) - - append_digest = 1 if self.append_digest else 0 - - fields = [self.wp_pin, - join_byte(self.clk_drv, self.q_drv), - join_byte(self.d_drv, self.cs_drv), - join_byte(self.hd_drv, self.wp_drv), - self.ROM_LOADER.IMAGE_CHIP_ID, - self.min_rev] - fields += [0] * 8 # padding - fields += [append_digest] - - packed = struct.pack(self.EXTENDED_HEADER_STRUCT_FMT, *fields) - save_file.write(packed) - - -ESP32ROM.BOOTLOADER_IMAGE = ESP32FirmwareImage - - -class ELFFile(object): - SEC_TYPE_PROGBITS = 0x01 - SEC_TYPE_STRTAB = 0x03 - - LEN_SEC_HEADER = 0x28 - - def __init__(self, name): - # Load sections from the ELF file - self.name = name - with open(self.name, 'rb') as f: - self._read_elf_file(f) - - def get_section(self, section_name): - for s in self.sections: - if s.name == section_name: - return s - raise ValueError("No section %s in ELF file" % section_name) - - def _read_elf_file(self, f): - # read the ELF file header - LEN_FILE_HEADER = 0x34 - try: - (ident,_type,machine,_version, - self.entrypoint,_phoff,shoff,_flags, - _ehsize, _phentsize,_phnum, shentsize, - shnum,shstrndx) = struct.unpack("<16sHHLLLLLHHHHHH", f.read(LEN_FILE_HEADER)) - except struct.error as e: - raise FatalError("Failed to read a valid ELF header from %s: %s" % (self.name, e)) - - if byte(ident, 0) != 0x7f or ident[1:4] != b'ELF': - raise FatalError("%s has invalid ELF magic header" % self.name) - if machine != 0x5e: - raise FatalError("%s does not appear to be an Xtensa ELF file. e_machine=%04x" % (self.name, machine)) - if shentsize != self.LEN_SEC_HEADER: - raise FatalError("%s has unexpected section header entry size 0x%x (not 0x28)" % (self.name, shentsize, self.LEN_SEC_HEADER)) - if shnum == 0: - raise FatalError("%s has 0 section headers" % (self.name)) - self._read_sections(f, shoff, shnum, shstrndx) - - def _read_sections(self, f, section_header_offs, section_header_count, shstrndx): - f.seek(section_header_offs) - len_bytes = section_header_count * self.LEN_SEC_HEADER - section_header = f.read(len_bytes) - if len(section_header) == 0: - raise FatalError("No section header found at offset %04x in ELF file." % section_header_offs) - if len(section_header) != (len_bytes): - raise FatalError("Only read 0x%x bytes from section header (expected 0x%x.) Truncated ELF file?" % (len(section_header), len_bytes)) - - # walk through the section header and extract all sections - section_header_offsets = range(0, len(section_header), self.LEN_SEC_HEADER) - - def read_section_header(offs): - name_offs,sec_type,_flags,lma,sec_offs,size = struct.unpack_from(" 0] - self.sections = prog_sections - - def sha256(self): - # return SHA256 hash of the input ELF file - sha256 = hashlib.sha256() - with open(self.name, 'rb') as f: - sha256.update(f.read()) - return sha256.digest() - - -def slip_reader(port, trace_function): - """Generator to read SLIP packets from a serial port. - Yields one full SLIP packet at a time, raises exception on timeout or invalid data. - - Designed to avoid too many calls to serial.read(1), which can bog - down on slow systems. - """ - partial_packet = None - in_escape = False - while True: - waiting = port.inWaiting() - read_bytes = port.read(1 if waiting == 0 else waiting) - if read_bytes == b'': - waiting_for = "header" if partial_packet is None else "content" - trace_function("Timed out waiting for packet %s", waiting_for) - raise FatalError("Timed out waiting for packet %s" % waiting_for) - trace_function("Read %d bytes: %s", len(read_bytes), HexFormatter(read_bytes)) - for b in read_bytes: - if type(b) is int: - b = bytes([b]) # python 2/3 compat - - if partial_packet is None: # waiting for packet header - if b == b'\xc0': - partial_packet = b"" - else: - trace_function("Read invalid data: %s", HexFormatter(read_bytes)) - trace_function("Remaining data in serial buffer: %s", HexFormatter(port.read(port.inWaiting()))) - raise FatalError('Invalid head of packet (0x%s)' % hexify(b)) - elif in_escape: # part-way through escape sequence - in_escape = False - if b == b'\xdc': - partial_packet += b'\xc0' - elif b == b'\xdd': - partial_packet += b'\xdb' - else: - trace_function("Read invalid data: %s", HexFormatter(read_bytes)) - trace_function("Remaining data in serial buffer: %s", HexFormatter(port.read(port.inWaiting()))) - raise FatalError('Invalid SLIP escape (0xdb, 0x%s)' % (hexify(b))) - elif b == b'\xdb': # start of escape sequence - in_escape = True - elif b == b'\xc0': # end of packet - trace_function("Received full packet: %s", HexFormatter(partial_packet)) - yield partial_packet - partial_packet = None - else: # normal byte in packet - partial_packet += b - - -def arg_auto_int(x): - return int(x, 0) - - -def div_roundup(a, b): - """ Return a/b rounded up to nearest integer, - equivalent result to int(math.ceil(float(int(a)) / float(int(b))), only - without possible floating point accuracy errors. - """ - return (int(a) + int(b) - 1) // int(b) - - -def align_file_position(f, size): - """ Align the position in the file to the next block of specified size """ - align = (size - 1) - (f.tell() % size) - f.seek(align, 1) - - -def flash_size_bytes(size): - """ Given a flash size of the type passed in args.flash_size - (ie 512KB or 1MB) then return the size in bytes. - """ - if "MB" in size: - return int(size[:size.index("MB")]) * 1024 * 1024 - elif "KB" in size: - return int(size[:size.index("KB")]) * 1024 - else: - raise FatalError("Unknown size %s" % size) - - -def hexify(s, uppercase=True): - format_str = '%02X' if uppercase else '%02x' - if not PYTHON2: - return ''.join(format_str % c for c in s) - else: - return ''.join(format_str % ord(c) for c in s) - - -class HexFormatter(object): - """ - Wrapper class which takes binary data in its constructor - and returns a hex string as it's __str__ method. - - This is intended for "lazy formatting" of trace() output - in hex format. Avoids overhead (significant on slow computers) - of generating long hex strings even if tracing is disabled. - - Note that this doesn't save any overhead if passed as an - argument to "%", only when passed to trace() - - If auto_split is set (default), any long line (> 16 bytes) will be - printed as separately indented lines, with ASCII decoding at the end - of each line. - """ - def __init__(self, binary_string, auto_split=True): - self._s = binary_string - self._auto_split = auto_split - - def __str__(self): - if self._auto_split and len(self._s) > 16: - result = "" - s = self._s - while len(s) > 0: - line = s[:16] - ascii_line = "".join(c if (c == ' ' or (c in string.printable and c not in string.whitespace)) - else '.' for c in line.decode('ascii', 'replace')) - s = s[16:] - result += "\n %-16s %-16s | %s" % (hexify(line[:8], False), hexify(line[8:], False), ascii_line) - return result - else: - return hexify(self._s, False) - - -def pad_to(data, alignment, pad_character=b'\xFF'): - """ Pad to the next alignment boundary """ - pad_mod = len(data) % alignment - if pad_mod != 0: - data += pad_character * (alignment - pad_mod) - return data - - -class FatalError(RuntimeError): - """ - Wrapper class for runtime errors that aren't caused by internal bugs, but by - ESP8266 responses or input content. - """ - def __init__(self, message): - RuntimeError.__init__(self, message) - - @staticmethod - def WithResult(message, result): - """ - Return a fatal error object that appends the hex values of - 'result' as a string formatted argument. - """ - message += " (result was %s)" % hexify(result) - return FatalError(message) - - -class NotImplementedInROMError(FatalError): - """ - Wrapper class for the error thrown when a particular ESP bootloader function - is not implemented in the ROM bootloader. - """ - def __init__(self, bootloader, func): - FatalError.__init__(self, "%s ROM does not support function %s." % (bootloader.CHIP_NAME, func.__name__)) - - -class NotSupportedError(FatalError): - def __init__(self, esp, function_name): - FatalError.__init__(self, "Function %s is not supported for %s." % (function_name, esp.CHIP_NAME)) - -# "Operation" commands, executable at command line. One function each -# -# Each function takes either two args (, ) or a single -# argument. - - -def load_ram(esp, args): - image = LoadFirmwareImage(esp.CHIP_NAME, args.filename) - - print('RAM boot...') - for seg in image.segments: - size = len(seg.data) - print('Downloading %d bytes at %08x...' % (size, seg.addr), end=' ') - sys.stdout.flush() - esp.mem_begin(size, div_roundup(size, esp.ESP_RAM_BLOCK), esp.ESP_RAM_BLOCK, seg.addr) - - seq = 0 - while len(seg.data) > 0: - esp.mem_block(seg.data[0:esp.ESP_RAM_BLOCK], seq) - seg.data = seg.data[esp.ESP_RAM_BLOCK:] - seq += 1 - print('done!') - - print('All segments done, executing at %08x' % image.entrypoint) - esp.mem_finish(image.entrypoint) - - -def read_mem(esp, args): - print('0x%08x = 0x%08x' % (args.address, esp.read_reg(args.address))) - - -def write_mem(esp, args): - esp.write_reg(args.address, args.value, args.mask, 0) - print('Wrote %08x, mask %08x to %08x' % (args.value, args.mask, args.address)) - - -def dump_mem(esp, args): - with open(args.filename, 'wb') as f: - for i in range(args.size // 4): - d = esp.read_reg(args.address + (i * 4)) - f.write(struct.pack(b'> 16 - args.flash_size = DETECTED_FLASH_SIZES.get(size_id) - if args.flash_size is None: - print('Warning: Could not auto-detect Flash size (FlashID=0x%x, SizeID=0x%x), defaulting to 4MB' % (flash_id, size_id)) - args.flash_size = '4MB' - else: - print('Auto-detected Flash size:', args.flash_size) - - -def _update_image_flash_params(esp, address, args, image): - """ Modify the flash mode & size bytes if this looks like an executable bootloader image """ - if len(image) < 8: - return image # not long enough to be a bootloader image - - # unpack the (potential) image header - magic, _, flash_mode, flash_size_freq = struct.unpack("BBBB", image[:4]) - if address != esp.BOOTLOADER_FLASH_OFFSET: - return image # not flashing bootloader offset, so don't modify this - - if (args.flash_mode, args.flash_freq, args.flash_size) == ('keep',) * 3: - return image # all settings are 'keep', not modifying anything - - # easy check if this is an image: does it start with a magic byte? - if magic != esp.ESP_IMAGE_MAGIC: - print("Warning: Image file at 0x%x doesn't look like an image file, so not changing any flash settings." % address) - return image - - # make sure this really is an image, and not just data that - # starts with esp.ESP_IMAGE_MAGIC (mostly a problem for encrypted - # images that happen to start with a magic byte - try: - test_image = esp.BOOTLOADER_IMAGE(io.BytesIO(image)) - test_image.verify() - except Exception: - print("Warning: Image file at 0x%x is not a valid %s image, so not changing any flash settings." % (address,esp.CHIP_NAME)) - return image - - if args.flash_mode != 'keep': - flash_mode = {'qio':0, 'qout':1, 'dio':2, 'dout': 3}[args.flash_mode] - - flash_freq = flash_size_freq & 0x0F - if args.flash_freq != 'keep': - flash_freq = {'40m':0, '26m':1, '20m':2, '80m': 0xf}[args.flash_freq] - - flash_size = flash_size_freq & 0xF0 - if args.flash_size != 'keep': - flash_size = esp.parse_flash_size_arg(args.flash_size) - - flash_params = struct.pack(b'BB', flash_mode, flash_size + flash_freq) - if flash_params != image[2:4]: - print('Flash params set to 0x%04x' % struct.unpack(">H", flash_params)) - image = image[0:2] + flash_params + image[4:] - return image - - -def write_flash(esp, args): - # set args.compress based on default behaviour: - # -> if either --compress or --no-compress is set, honour that - # -> otherwise, set --compress unless --no-stub is set - if args.compress is None and not args.no_compress: - args.compress = not args.no_stub - - # For encrypt option we do few sanity checks before actual flash write - if args.encrypt: - do_write = True - crypt_cfg_efuse = esp.get_flash_crypt_config() - - if crypt_cfg_efuse != 0xF: - print('\nWARNING: Unexpected FLASH_CRYPT_CONFIG value', hex(crypt_cfg_efuse)) - print('\nMake sure flash encryption is enabled correctly, refer to Flash Encryption documentation') - do_write = False - - enc_key_valid = esp.is_flash_encryption_key_valid() - - if not enc_key_valid: - print('\nFlash encryption key is not programmed') - print('\nMake sure flash encryption is enabled correctly, refer to Flash Encryption documentation') - do_write = False - - if (esp.FLASH_WRITE_SIZE % 32) != 0: - print('\nWARNING - Flash write address is not aligned to the recommeded 32 bytes') - do_write = False - - if not do_write and not args.ignore_flash_encryption_efuse_setting: - raise FatalError("Incorrect efuse setting: aborting flash write") - - # verify file sizes fit in flash - if args.flash_size != 'keep': # TODO: check this even with 'keep' - flash_end = flash_size_bytes(args.flash_size) - for address, argfile in args.addr_filename: - argfile.seek(0,2) # seek to end - if address + argfile.tell() > flash_end: - raise FatalError(("File %s (length %d) at offset %d will not fit in %d bytes of flash. " + - "Use --flash-size argument, or change flashing address.") - % (argfile.name, argfile.tell(), address, flash_end)) - argfile.seek(0) - - if args.erase_all: - erase_flash(esp, args) - - if args.encrypt and args.compress: - print('\nWARNING: - compress and encrypt options are mutually exclusive ') - print('Will flash uncompressed') - args.compress = False - - for address, argfile in args.addr_filename: - if args.no_stub: - print('Erasing flash...') - image = pad_to(argfile.read(), 32 if args.encrypt else 4) - if len(image) == 0: - print('WARNING: File %s is empty' % argfile.name) - continue - image = _update_image_flash_params(esp, address, args, image) - calcmd5 = hashlib.md5(image).hexdigest() - uncsize = len(image) - if args.compress: - uncimage = image - image = zlib.compress(uncimage, 9) - ratio = uncsize / len(image) - blocks = esp.flash_defl_begin(uncsize, len(image), address) - else: - ratio = 1.0 - blocks = esp.flash_begin(uncsize, address) - argfile.seek(0) # in case we need it again - seq = 0 - written = 0 - t = time.time() - while len(image) > 0: - print('\rWriting at 0x%08x... (%d %%)' % (address + seq * esp.FLASH_WRITE_SIZE, 100 * (seq + 1) // blocks), end='') - sys.stdout.flush() - block = image[0:esp.FLASH_WRITE_SIZE] - if args.compress: - esp.flash_defl_block(block, seq, timeout=DEFAULT_TIMEOUT * ratio * 2) - else: - # Pad the last block - block = block + b'\xff' * (esp.FLASH_WRITE_SIZE - len(block)) - if args.encrypt: - esp.flash_encrypt_block(block, seq) - else: - esp.flash_block(block, seq) - image = image[esp.FLASH_WRITE_SIZE:] - seq += 1 - written += len(block) - t = time.time() - t - speed_msg = "" - if args.compress: - if t > 0.0: - speed_msg = " (effective %.1f kbit/s)" % (uncsize / t * 8 / 1000) - print('\rWrote %d bytes (%d compressed) at 0x%08x in %.1f seconds%s...' % (uncsize, written, address, t, speed_msg)) - else: - if t > 0.0: - speed_msg = " (%.1f kbit/s)" % (written / t * 8 / 1000) - print('\rWrote %d bytes at 0x%08x in %.1f seconds%s...' % (written, address, t, speed_msg)) - - if not args.encrypt: - try: - res = esp.flash_md5sum(address, uncsize) - if res != calcmd5: - print('File md5: %s' % calcmd5) - print('Flash md5: %s' % res) - print('MD5 of 0xFF is %s' % (hashlib.md5(b'\xFF' * uncsize).hexdigest())) - raise FatalError("MD5 of file does not match data in flash!") - else: - print('Hash of data verified.') - except NotImplementedInROMError: - pass - - print('\nLeaving...') - - if esp.IS_STUB: - # skip sending flash_finish to ROM loader here, - # as it causes the loader to exit and run user code - esp.flash_begin(0, 0) - if args.compress: - esp.flash_defl_finish(False) - else: - esp.flash_finish(False) - - if args.verify: - print('Verifying just-written flash...') - print('(This option is deprecated, flash contents are now always read back after flashing.)') - verify_flash(esp, args) - - -def image_info(args): - image = LoadFirmwareImage(args.chip, args.filename) - print('Image version: %d' % image.version) - print('Entry point: %08x' % image.entrypoint if image.entrypoint != 0 else 'Entry point not set') - print('%d segments' % len(image.segments)) - print() - idx = 0 - for seg in image.segments: - idx += 1 - seg_name = ", ".join([seg_range[2] for seg_range in image.ROM_LOADER.MEMORY_MAP if seg_range[0] <= seg.addr < seg_range[1]]) - print('Segment %d: %r [%s]' % (idx, seg, seg_name)) - calc_checksum = image.calculate_checksum() - print('Checksum: %02x (%s)' % (image.checksum, - 'valid' if image.checksum == calc_checksum else 'invalid - calculated %02x' % calc_checksum)) - try: - digest_msg = 'Not appended' - if image.append_digest: - is_valid = image.stored_digest == image.calc_digest - digest_msg = "%s (%s)" % (hexify(image.calc_digest).lower(), - "valid" if is_valid else "invalid") - print('Validation Hash: %s' % digest_msg) - except AttributeError: - pass # ESP8266 image has no append_digest field - - -def make_image(args): - image = ESP8266ROMFirmwareImage() - if len(args.segfile) == 0: - raise FatalError('No segments specified') - if len(args.segfile) != len(args.segaddr): - raise FatalError('Number of specified files does not match number of specified addresses') - for (seg, addr) in zip(args.segfile, args.segaddr): - with open(seg, 'rb') as f: - data = f.read() - image.segments.append(ImageSegment(addr, data)) - image.entrypoint = args.entrypoint - image.save(args.output) - - -def elf2image(args): - e = ELFFile(args.input) - if args.chip == 'auto': # Default to ESP8266 for backwards compatibility - print("Creating image for ESP8266...") - args.chip = 'esp8266' - - if args.chip == 'esp32': - image = ESP32FirmwareImage() - image.secure_pad = args.secure_pad - image.min_rev = int(args.min_rev) - elif args.version == '1': # ESP8266 - image = ESP8266ROMFirmwareImage() - else: - image = ESP8266V2FirmwareImage() - image.entrypoint = e.entrypoint - image.segments = e.sections # ELFSection is a subclass of ImageSegment - image.flash_mode = {'qio':0, 'qout':1, 'dio':2, 'dout': 3}[args.flash_mode] - image.flash_size_freq = image.ROM_LOADER.FLASH_SIZES[args.flash_size] - image.flash_size_freq += {'40m':0, '26m':1, '20m':2, '80m': 0xf}[args.flash_freq] - - if args.elf_sha256_offset: - image.elf_sha256 = e.sha256() - image.elf_sha256_offset = args.elf_sha256_offset - - image.verify() - - if args.output is None: - args.output = image.default_output_name(args.input) - image.save(args.output) - - -def read_mac(esp, args): - mac = esp.read_mac() - - def print_mac(label, mac): - print('%s: %s' % (label, ':'.join(map(lambda x: '%02x' % x, mac)))) - print_mac("MAC", mac) - - -def chip_id(esp, args): - try: - chipid = esp.chip_id() - print('Chip ID: 0x%08x' % chipid) - except NotSupportedError: - print('Warning: %s has no Chip ID. Reading MAC instead.' % esp.CHIP_NAME) - read_mac(esp, args) - - -def erase_flash(esp, args): - print('Erasing flash (this may take a while)...') - t = time.time() - esp.erase_flash() - print('Chip erase completed successfully in %.1fs' % (time.time() - t)) - - -def erase_region(esp, args): - print('Erasing region (may be slow depending on size)...') - t = time.time() - esp.erase_region(args.address, args.size) - print('Erase completed successfully in %.1f seconds.' % (time.time() - t)) - - -def run(esp, args): - esp.run() - - -def flash_id(esp, args): - flash_id = esp.flash_id() - print('Manufacturer: %02x' % (flash_id & 0xff)) - flid_lowbyte = (flash_id >> 16) & 0xFF - print('Device: %02x%02x' % ((flash_id >> 8) & 0xff, flid_lowbyte)) - print('Detected flash size: %s' % (DETECTED_FLASH_SIZES.get(flid_lowbyte, "Unknown"))) - - -def read_flash(esp, args): - if args.no_progress: - flash_progress = None - else: - def flash_progress(progress, length): - msg = '%d (%d %%)' % (progress, progress * 100.0 / length) - padding = '\b' * len(msg) - if progress == length: - padding = '\n' - sys.stdout.write(msg + padding) - sys.stdout.flush() - t = time.time() - data = esp.read_flash(args.address, args.size, flash_progress) - t = time.time() - t - print('\rRead %d bytes at 0x%x in %.1f seconds (%.1f kbit/s)...' - % (len(data), args.address, t, len(data) / t * 8 / 1000)) - with open(args.filename, 'wb') as f: - f.write(data) - - -def verify_flash(esp, args): - differences = False - - for address, argfile in args.addr_filename: - image = pad_to(argfile.read(), 4) - argfile.seek(0) # rewind in case we need it again - - image = _update_image_flash_params(esp, address, args, image) - - image_size = len(image) - print('Verifying 0x%x (%d) bytes @ 0x%08x in flash against %s...' % (image_size, image_size, address, argfile.name)) - # Try digest first, only read if there are differences. - digest = esp.flash_md5sum(address, image_size) - expected_digest = hashlib.md5(image).hexdigest() - if digest == expected_digest: - print('-- verify OK (digest matched)') - continue - else: - differences = True - if getattr(args, 'diff', 'no') != 'yes': - print('-- verify FAILED (digest mismatch)') - continue - - flash = esp.read_flash(address, image_size) - assert flash != image - diff = [i for i in range(image_size) if flash[i] != image[i]] - print('-- verify FAILED: %d differences, first @ 0x%08x' % (len(diff), address + diff[0])) - for d in diff: - flash_byte = flash[d] - image_byte = image[d] - if PYTHON2: - flash_byte = ord(flash_byte) - image_byte = ord(image_byte) - print(' %08x %02x %02x' % (address + d, flash_byte, image_byte)) - if differences: - raise FatalError("Verify failed.") - - -def read_flash_status(esp, args): - print('Status value: 0x%04x' % esp.read_status(args.bytes)) - - -def write_flash_status(esp, args): - fmt = "0x%%0%dx" % (args.bytes * 2) - args.value = args.value & ((1 << (args.bytes * 8)) - 1) - print(('Initial flash status: ' + fmt) % esp.read_status(args.bytes)) - print(('Setting flash status: ' + fmt) % args.value) - esp.write_status(args.value, args.bytes, args.non_volatile) - print(('After flash status: ' + fmt) % esp.read_status(args.bytes)) - - -def version(args): - print(__version__) - -# -# End of operations functions -# - - -def main(custom_commandline=None): - """ - Main function for esptool - - custom_commandline - Optional override for default arguments parsing (that uses sys.argv), can be a list of custom arguments - as strings. Arguments and their values need to be added as individual items to the list e.g. "-b 115200" thus - becomes ['-b', '115200']. - """ - parser = argparse.ArgumentParser(description='esptool.py v%s - ESP8266 ROM Bootloader Utility' % __version__, prog='esptool') - - parser.add_argument('--chip', '-c', - help='Target chip type', - choices=['auto', 'esp8266', 'esp32'], - default=os.environ.get('ESPTOOL_CHIP', 'auto')) - - parser.add_argument( - '--port', '-p', - help='Serial port device', - default=os.environ.get('ESPTOOL_PORT', None)) - - parser.add_argument( - '--baud', '-b', - help='Serial port baud rate used when flashing/reading', - type=arg_auto_int, - default=os.environ.get('ESPTOOL_BAUD', ESPLoader.ESP_ROM_BAUD)) - - parser.add_argument( - '--before', - help='What to do before connecting to the chip', - choices=['default_reset', 'no_reset', 'no_reset_no_sync'], - default=os.environ.get('ESPTOOL_BEFORE', 'default_reset')) - - parser.add_argument( - '--after', '-a', - help='What to do after esptool.py is finished', - choices=['hard_reset', 'soft_reset', 'no_reset'], - default=os.environ.get('ESPTOOL_AFTER', 'hard_reset')) - - parser.add_argument( - '--no-stub', - help="Disable launching the flasher stub, only talk to ROM bootloader. Some features will not be available.", - action='store_true') - - parser.add_argument( - '--trace', '-t', - help="Enable trace-level output of esptool.py interactions.", - action='store_true') - - parser.add_argument( - '--override-vddsdio', - help="Override ESP32 VDDSDIO internal voltage regulator (use with care)", - choices=ESP32ROM.OVERRIDE_VDDSDIO_CHOICES, - nargs='?') - - subparsers = parser.add_subparsers( - dest='operation', - help='Run esptool {command} -h for additional help') - - def add_spi_connection_arg(parent): - parent.add_argument('--spi-connection', '-sc', help='ESP32-only argument. Override default SPI Flash connection. ' + - 'Value can be SPI, HSPI or a comma-separated list of 5 I/O numbers to use for SPI flash (CLK,Q,D,HD,CS).', - action=SpiConnectionAction) - - parser_load_ram = subparsers.add_parser( - 'load_ram', - help='Download an image to RAM and execute') - parser_load_ram.add_argument('filename', help='Firmware image') - - parser_dump_mem = subparsers.add_parser( - 'dump_mem', - help='Dump arbitrary memory to disk') - parser_dump_mem.add_argument('address', help='Base address', type=arg_auto_int) - parser_dump_mem.add_argument('size', help='Size of region to dump', type=arg_auto_int) - parser_dump_mem.add_argument('filename', help='Name of binary dump') - - parser_read_mem = subparsers.add_parser( - 'read_mem', - help='Read arbitrary memory location') - parser_read_mem.add_argument('address', help='Address to read', type=arg_auto_int) - - parser_write_mem = subparsers.add_parser( - 'write_mem', - help='Read-modify-write to arbitrary memory location') - parser_write_mem.add_argument('address', help='Address to write', type=arg_auto_int) - parser_write_mem.add_argument('value', help='Value', type=arg_auto_int) - parser_write_mem.add_argument('mask', help='Mask of bits to write', type=arg_auto_int) - - def add_spi_flash_subparsers(parent, is_elf2image): - """ Add common parser arguments for SPI flash properties """ - extra_keep_args = [] if is_elf2image else ['keep'] - auto_detect = not is_elf2image - - if auto_detect: - extra_fs_message = ", detect, or keep" - else: - extra_fs_message = "" - - parent.add_argument('--flash_freq', '-ff', help='SPI Flash frequency', - choices=extra_keep_args + ['40m', '26m', '20m', '80m'], - default=os.environ.get('ESPTOOL_FF', '40m' if is_elf2image else 'keep')) - parent.add_argument('--flash_mode', '-fm', help='SPI Flash mode', - choices=extra_keep_args + ['qio', 'qout', 'dio', 'dout'], - default=os.environ.get('ESPTOOL_FM', 'qio' if is_elf2image else 'keep')) - parent.add_argument('--flash_size', '-fs', help='SPI Flash size in MegaBytes (1MB, 2MB, 4MB, 8MB, 16M)' - ' plus ESP8266-only (256KB, 512KB, 2MB-c1, 4MB-c1)' + extra_fs_message, - action=FlashSizeAction, auto_detect=auto_detect, - default=os.environ.get('ESPTOOL_FS', 'detect' if auto_detect else '1MB')) - add_spi_connection_arg(parent) - - parser_write_flash = subparsers.add_parser( - 'write_flash', - help='Write a binary blob to flash') - - parser_write_flash.add_argument('addr_filename', metavar='
', help='Address followed by binary filename, separated by space', - action=AddrFilenamePairAction) - parser_write_flash.add_argument('--erase-all', '-e', - help='Erase all regions of flash (not just write areas) before programming', - action="store_true") - - add_spi_flash_subparsers(parser_write_flash, is_elf2image=False) - parser_write_flash.add_argument('--no-progress', '-p', help='Suppress progress output', action="store_true") - parser_write_flash.add_argument('--verify', help='Verify just-written data on flash ' + - '(mostly superfluous, data is read back during flashing)', action='store_true') - parser_write_flash.add_argument('--encrypt', help='Encrypt before write ', - action='store_true') - parser_write_flash.add_argument('--ignore-flash-encryption-efuse-setting', help='Ignore flash encryption efuse settings ', - action='store_true') - - compress_args = parser_write_flash.add_mutually_exclusive_group(required=False) - compress_args.add_argument('--compress', '-z', help='Compress data in transfer (default unless --no-stub is specified)',action="store_true", default=None) - compress_args.add_argument('--no-compress', '-u', help='Disable data compression during transfer (default if --no-stub is specified)',action="store_true") - - subparsers.add_parser( - 'run', - help='Run application code in flash') - - parser_image_info = subparsers.add_parser( - 'image_info', - help='Dump headers from an application image') - parser_image_info.add_argument('filename', help='Image file to parse') - - parser_make_image = subparsers.add_parser( - 'make_image', - help='Create an application image from binary files') - parser_make_image.add_argument('output', help='Output image file') - parser_make_image.add_argument('--segfile', '-f', action='append', help='Segment input file') - parser_make_image.add_argument('--segaddr', '-a', action='append', help='Segment base address', type=arg_auto_int) - parser_make_image.add_argument('--entrypoint', '-e', help='Address of entry point', type=arg_auto_int, default=0) - - parser_elf2image = subparsers.add_parser( - 'elf2image', - help='Create an application image from ELF file') - parser_elf2image.add_argument('input', help='Input ELF file') - parser_elf2image.add_argument('--output', '-o', help='Output filename prefix (for version 1 image), or filename (for version 2 single image)', type=str) - parser_elf2image.add_argument('--version', '-e', help='Output image version', choices=['1','2'], default='1') - parser_elf2image.add_argument('--min-rev', '-r', help='Minimum chip revision', choices=['0','1','2','3'], default='0') - parser_elf2image.add_argument('--secure-pad', action='store_true', help='Pad image so once signed it will end on a 64KB boundary. For ESP32 images only.') - parser_elf2image.add_argument('--elf-sha256-offset', help='If set, insert SHA256 hash (32 bytes) of the input ELF file at specified offset in the binary.', - type=arg_auto_int, default=None) - - add_spi_flash_subparsers(parser_elf2image, is_elf2image=True) - - subparsers.add_parser( - 'read_mac', - help='Read MAC address from OTP ROM') - - subparsers.add_parser( - 'chip_id', - help='Read Chip ID from OTP ROM') - - parser_flash_id = subparsers.add_parser( - 'flash_id', - help='Read SPI flash manufacturer and device ID') - add_spi_connection_arg(parser_flash_id) - - parser_read_status = subparsers.add_parser( - 'read_flash_status', - help='Read SPI flash status register') - - add_spi_connection_arg(parser_read_status) - parser_read_status.add_argument('--bytes', help='Number of bytes to read (1-3)', type=int, choices=[1,2,3], default=2) - - parser_write_status = subparsers.add_parser( - 'write_flash_status', - help='Write SPI flash status register') - - add_spi_connection_arg(parser_write_status) - parser_write_status.add_argument('--non-volatile', help='Write non-volatile bits (use with caution)', action='store_true') - parser_write_status.add_argument('--bytes', help='Number of status bytes to write (1-3)', type=int, choices=[1,2,3], default=2) - parser_write_status.add_argument('value', help='New value', type=arg_auto_int) - - parser_read_flash = subparsers.add_parser( - 'read_flash', - help='Read SPI flash content') - add_spi_connection_arg(parser_read_flash) - parser_read_flash.add_argument('address', help='Start address', type=arg_auto_int) - parser_read_flash.add_argument('size', help='Size of region to dump', type=arg_auto_int) - parser_read_flash.add_argument('filename', help='Name of binary dump') - parser_read_flash.add_argument('--no-progress', '-p', help='Suppress progress output', action="store_true") - - parser_verify_flash = subparsers.add_parser( - 'verify_flash', - help='Verify a binary blob against flash') - parser_verify_flash.add_argument('addr_filename', help='Address and binary file to verify there, separated by space', - action=AddrFilenamePairAction) - parser_verify_flash.add_argument('--diff', '-d', help='Show differences', - choices=['no', 'yes'], default='no') - add_spi_flash_subparsers(parser_verify_flash, is_elf2image=False) - - parser_erase_flash = subparsers.add_parser( - 'erase_flash', - help='Perform Chip Erase on SPI flash') - add_spi_connection_arg(parser_erase_flash) - - parser_erase_region = subparsers.add_parser( - 'erase_region', - help='Erase a region of the flash') - add_spi_connection_arg(parser_erase_region) - parser_erase_region.add_argument('address', help='Start address (must be multiple of 4096)', type=arg_auto_int) - parser_erase_region.add_argument('size', help='Size of region to erase (must be multiple of 4096)', type=arg_auto_int) - - subparsers.add_parser( - 'version', help='Print esptool version') - - # internal sanity check - every operation matches a module function of the same name - for operation in subparsers.choices.keys(): - assert operation in globals(), "%s should be a module function" % operation - - expand_file_arguments() - - args = parser.parse_args(custom_commandline) - - print('esptool.py v%s' % __version__) - - # operation function can take 1 arg (args), 2 args (esp, arg) - # or be a member function of the ESPLoader class. - - if args.operation is None: - parser.print_help() - sys.exit(1) - - operation_func = globals()[args.operation] - - if PYTHON2: - # This function is depreciated in Python3 - operation_args = inspect.getargspec(operation_func).args - else: - operation_args = inspect.getfullargspec(operation_func).args - - if operation_args[0] == 'esp': # operation function takes an ESPLoader connection object - if args.before != "no_reset_no_sync": - initial_baud = min(ESPLoader.ESP_ROM_BAUD, args.baud) # don't sync faster than the default baud rate - else: - initial_baud = args.baud - - if args.port is None: - ser_list = sorted(ports.device for ports in list_ports.comports()) - print("Found %d serial ports" % len(ser_list)) - else: - ser_list = [args.port] - esp = None - for each_port in reversed(ser_list): - print("Serial port %s" % each_port) - try: - if args.chip == 'auto': - esp = ESPLoader.detect_chip(each_port, initial_baud, args.before, args.trace) - else: - chip_class = { - 'esp8266': ESP8266ROM, - 'esp32': ESP32ROM, - }[args.chip] - esp = chip_class(each_port, initial_baud, args.trace) - esp.connect(args.before) - break - except (FatalError, OSError) as err: - if args.port is not None: - raise - print("%s failed to connect: %s" % (each_port, err)) - esp = None - if esp is None: - raise FatalError("Could not connect to an Espressif device on any of the %d available serial ports." % len(ser_list)) - - print("Chip is %s" % (esp.get_chip_description())) - - print("Features: %s" % ", ".join(esp.get_chip_features())) - - print("Crystal is %dMHz" % esp.get_crystal_freq()) - - read_mac(esp, args) - - if not args.no_stub: - esp = esp.run_stub() - - if args.override_vddsdio: - esp.override_vddsdio(args.override_vddsdio) - - if args.baud > initial_baud: - try: - esp.change_baud(args.baud) - except NotImplementedInROMError: - print("WARNING: ROM doesn't support changing baud rate. Keeping initial baud rate %d" % initial_baud) - - # override common SPI flash parameter stuff if configured to do so - if hasattr(args, "spi_connection") and args.spi_connection is not None: - if esp.CHIP_NAME != "ESP32": - raise FatalError("Chip %s does not support --spi-connection option." % esp.CHIP_NAME) - print("Configuring SPI flash mode...") - esp.flash_spi_attach(args.spi_connection) - elif args.no_stub: - print("Enabling default SPI flash mode...") - # ROM loader doesn't enable flash unless we explicitly do it - esp.flash_spi_attach(0) - - if hasattr(args, "flash_size"): - print("Configuring flash size...") - detect_flash_size(esp, args) - if args.flash_size != 'keep': # TODO: should set this even with 'keep' - esp.flash_set_parameters(flash_size_bytes(args.flash_size)) - - try: - operation_func(esp, args) - finally: - try: # Clean up AddrFilenamePairAction files - for address, argfile in args.addr_filename: - argfile.close() - except AttributeError: - pass - - # Handle post-operation behaviour (reset or other) - if operation_func == load_ram: - # the ESP is now running the loaded image, so let it run - print('Exiting immediately.') - elif args.after == 'hard_reset': - print('Hard resetting via RTS pin...') - esp.hard_reset() - elif args.after == 'soft_reset': - print('Soft resetting...') - # flash_finish will trigger a soft reset - esp.soft_reset(False) - else: - print('Staying in bootloader.') - if esp.IS_STUB: - esp.soft_reset(True) # exit stub back to ROM loader - - esp._port.close() - - else: - operation_func(args) - - -def expand_file_arguments(): - """ Any argument starting with "@" gets replaced with all values read from a text file. - Text file arguments can be split by newline or by space. - Values are added "as-is", as if they were specified in this order on the command line. - """ - new_args = [] - expanded = False - for arg in sys.argv: - if arg.startswith("@"): - expanded = True - with open(arg[1:],"r") as f: - for line in f.readlines(): - new_args += shlex.split(line) - else: - new_args.append(arg) - if expanded: - print("esptool.py %s" % (" ".join(new_args[1:]))) - sys.argv = new_args - - -class FlashSizeAction(argparse.Action): - """ Custom flash size parser class to support backwards compatibility with megabit size arguments. - - (At next major relase, remove deprecated sizes and this can become a 'normal' choices= argument again.) - """ - def __init__(self, option_strings, dest, nargs=1, auto_detect=False, **kwargs): - super(FlashSizeAction, self).__init__(option_strings, dest, nargs, **kwargs) - self._auto_detect = auto_detect - - def __call__(self, parser, namespace, values, option_string=None): - try: - value = { - '2m': '256KB', - '4m': '512KB', - '8m': '1MB', - '16m': '2MB', - '32m': '4MB', - '16m-c1': '2MB-c1', - '32m-c1': '4MB-c1', - }[values[0]] - print("WARNING: Flash size arguments in megabits like '%s' are deprecated." % (values[0])) - print("Please use the equivalent size '%s'." % (value)) - print("Megabit arguments may be removed in a future release.") - except KeyError: - value = values[0] - - known_sizes = dict(ESP8266ROM.FLASH_SIZES) - known_sizes.update(ESP32ROM.FLASH_SIZES) - if self._auto_detect: - known_sizes['detect'] = 'detect' - known_sizes['keep'] = 'keep' - if value not in known_sizes: - raise argparse.ArgumentError(self, '%s is not a known flash size. Known sizes: %s' % (value, ", ".join(known_sizes.keys()))) - setattr(namespace, self.dest, value) - - -class SpiConnectionAction(argparse.Action): - """ Custom action to parse 'spi connection' override. Values are SPI, HSPI, or a sequence of 5 pin numbers separated by commas. - """ - def __call__(self, parser, namespace, value, option_string=None): - if value.upper() == "SPI": - value = 0 - elif value.upper() == "HSPI": - value = 1 - elif "," in value: - values = value.split(",") - if len(values) != 5: - raise argparse.ArgumentError(self, '%s is not a valid list of comma-separate pin numbers. Must be 5 numbers - CLK,Q,D,HD,CS.' % value) - try: - values = tuple(int(v,0) for v in values) - except ValueError: - raise argparse.ArgumentError(self, '%s is not a valid argument. All pins must be numeric values' % values) - if any([v for v in values if v > 33 or v < 0]): - raise argparse.ArgumentError(self, 'Pin numbers must be in the range 0-33.') - # encode the pin numbers as a 32-bit integer with packed 6-bit values, the same way ESP32 ROM takes them - # TODO: make this less ESP32 ROM specific somehow... - clk,q,d,hd,cs = values - value = (hd << 24) | (cs << 18) | (d << 12) | (q << 6) | clk - else: - raise argparse.ArgumentError(self, '%s is not a valid spi-connection value. ' + - 'Values are SPI, HSPI, or a sequence of 5 pin numbers CLK,Q,D,HD,CS).' % value) - setattr(namespace, self.dest, value) - - -class AddrFilenamePairAction(argparse.Action): - """ Custom parser class for the address/filename pairs passed as arguments """ - def __init__(self, option_strings, dest, nargs='+', **kwargs): - super(AddrFilenamePairAction, self).__init__(option_strings, dest, nargs, **kwargs) - - def __call__(self, parser, namespace, values, option_string=None): - # validate pair arguments - pairs = [] - for i in range(0,len(values),2): - try: - address = int(values[i],0) - except ValueError: - raise argparse.ArgumentError(self,'Address "%s" must be a number' % values[i]) - try: - argfile = open(values[i + 1], 'rb') - except IOError as e: - raise argparse.ArgumentError(self, e) - except IndexError: - raise argparse.ArgumentError(self,'Must be pairs of an address and the binary filename to write there') - pairs.append((address, argfile)) - - # Sort the addresses and check for overlapping - end = 0 - for address, argfile in sorted(pairs): - argfile.seek(0,2) # seek to end - size = argfile.tell() - argfile.seek(0) - sector_start = address & ~(ESPLoader.FLASH_SECTOR_SIZE - 1) - sector_end = ((address + size + ESPLoader.FLASH_SECTOR_SIZE - 1) & ~(ESPLoader.FLASH_SECTOR_SIZE - 1)) - 1 - if sector_start < end: - message = 'Detected overlap at address: 0x%x for file: %s' % (address, argfile.name) - raise argparse.ArgumentError(self, message) - end = sector_end - setattr(namespace, self.dest, pairs) - - -# Binary stub code (see flasher_stub dir for source & details) -ESP8266ROM.STUB_CODE = eval(zlib.decompress(base64.b64decode(b""" -eNrFPHl/2zaWX4WkHV+RE4CUKNC1G0s+ck/qpHHTXXdbEiQmnaPrKN5fMp10P/vyXSBIyXHSzmT/kE2QOB4e3o0H/HPzqnl/tbkXVZsX70tz8V6ri/dKHbZ/9MV75+B3evHeTOBt8DPy/FPbxAaFrlZbKNoHg/3c\ -4zZSMIp+Ut2Mw/LhoTw9mHED3et37PuN278TglSnF+8tvG2r1UVbbp+tiqhdDaOnF1fwroihFc/P17BUo30Bv6u2fd6+sBe/nK6H02qbNU2vabIm7y28j6K2rW1hanDCbY8loLFtU+SL9k121n4qoWY7t6aCB2hb\ -cFs1AUw8eum7fw1t5i04uAaHLRCunb6ujgBL8Mj15i/h717ewXWEf6UlDKJoEGg3beFJ91tE1AICPbRA1bjse2kfhDOpcbEJU2lfAQpyoRJfebv900H1PTQ9JcwilrvX416TDCDANdlLEO/tK18hfc7obwGwdoO/\ -pzR+XTCV1mMCRKl2WpYXSZkeGRTczsREE0AkQjgtjS2IfKBqiSVZ+MKEpCx03dx79mD2sK3bjlzi6t8zhGaNPBRyhqAp5COtBnyliEdWvTO2zzI0wqBiN8jgI4NLaPeFdvzNoMfxKnAZ5GCKxMu+k6r3pcfYZjvA\ -IHxxYQdZwNu+AELI9wZYL6kN9FCL9Bj711RHV9fLpyt5/Kb90wQFnUphPwATxvbjVyooAHmVyLj3vgoauKGQ85DBipVNIPFUCGbvIxTqYFAdCFyRVCEp9jFUSksr69WuvjFBoewKr3CVDo9P8d/oCf57/8DTzCN+\ -qsYP+cnaO/wEor5JuVCbAp9e+3cPSHbgV1juBkn58MmGgMRdtrxXMXsWIB+J97AJCe2kXEuQA2nSadmKMpuWrRSs0xLEZlqC8EvLe8QbzVREkKApJrpEwVaxgkB2BBrPQy4DkNLHybQFxAGWJrSCSjMEsDbKHu3E\ -pAYBWGw8ofVTOv6FB9d/4wFpdXZGoXZhweNhsM+pH5JeIeialsu5pBuN+4FVyqL1qC85EdCIu8uG3fH79FPfv2kXAin4jOaPKoEetDxUDJnqJDFCWa9YhgJXWp8jStY85Kxtdf52oIdZUw9VQIA/nSYzIKYEBTTA\ -YdfxzWR+dpSWyQaSFWhwm02hetuByUOpQIoRtXGK/1JgUFCVWiWRA22rt3b92FtQIymTPulomyRnR0wVaUgxoJ9L1mImO2nBmdDnBU3JDQclKeLSKBZZ0v5a0CvAUMbdIlYnxCZ+LLBFAADjeAkmtHxKg0K0oeRI\ -O3ThuoMazxirOXerpumfXKBbS27t8reRy+R9LS/BwjBuTd6j6DhlvlDuSDr/FYsveMptt4blMDyD9BJCKpagIssTmLMd6G0HmKmCHrCOk4anpE2kzyro8/S9QOjXsDeizQ0Nt9X2VlGTudSEUgvIL9StG4C6yyMC\ -Jouuie5VM4QipJ0AqoqhKsZsscHKtsbQJqz+qB3zSt4petf+DOPBdfRMVQYDroffsmBQppMJoCtYAgDawn8Hrd8QyeFK5DLSBg8rS5HJUkht/T/LwsaV1G/RzhybTXu2UDSaQcPFsOE56WmApsU4maaodEdsqXtQ\ -gcgmEZrH52tkcDdahGtOjMdjReQ0KP2XFcOBREQ9p7qPfjg3/Zqsd+N7ZMjtUlfPyS5ZAfa5+ASnf2WMWbJNbCqs7nGMVRC7UlcxtVdO1vhnWaX7S59e0ieb8xLLCEpvdNVUjp5bCjQ8jm/RTJq008AerlTojxb/\ -v1CS/wCi0kzesgTKnwaAwvKMEaI75mkr3XQd6OLm+p7Pu56tOZiX2QkQVyspr6D9PM4iXnv0naCXOrsNanYt+hORJCgjNHaJ52IWvX7sNHBKBIicTImOe9BeMQjEc1pK65cSdZOXzdxNAdIahtbmADqpWEwLEaLc\ -mXfUqKvs0KnoSMhrHew9ktST5/iP1RwwGjTSWrw6/c1RdJhG9HnaoRR1igJFFm1AtzI5DSjLAMTTcaCf0RdtPgMrNr+LWEmDKoaq6KE4bNK5eNdg7+S3O8lo0g5kFjybxMvUw1Yn4NG8JyH/DHkiFoKPBwSv8kQI\ -fuhJUVPoML6O6Xi0ptdMOj9l4FgcatQUZ8zbHn8Pur51FlLMLg3m1Bpg8vBr+IvLuArT6fOSLUOQYkDI6Xsa1leFj9PpCfQortuK+YB5TdQYLFCDXaFzu7eNts3jDL32x8diYAEqpkKTGcGA7AZoQDtq8pBmik6A\ -qId8IKKMl0OoNiedivHA5sse7yrJwyYiOHOTn9joVxRp+VEM8kt4OG8dGjtNQlvHkRXY6lPgnwmYdz52ADQzBntWTJMaOGm8kXZ1tLgP8FwE7rJdmxKGpaZF4z4VRYyjnrAdQDAwISkJrFF/MVl6SEVgkzf03Pdm\ -0N1+cNA3oGNyF10TrWFEIAG+QjnOJjlY0/2+UCzt8gpAjXxYA2RaJvErdhGavjb3cZ/m1Q8PnpqDBIc8+SsjHb5anhDbnVnS2bwoxqIsSkkgOZV0VGomj0SPcGiv+TSrPSFicRgjws6ScocJjqUvGmbjmOxx17wh\ -Gw8GqFKQG2p2REUjFJihmQYDFWm8Ax/KW4TyGsNXF5uF+HPtMNNFeasq0W4v85N9mkeVxjC0JpvVNVUMVKMeE0Lr8hh6hb5VdbUob5M1VubvuF8ky7dUKKDrSiTdgvWbochjkY6ABBbwd7L1N4QVPaFyfVFu778A\ -WvgAzDUicQHOrkOZW3mpDYQ11v8EMEmzbdEXxAWqhdiG0q4TdBC/BFaA/yYtgGoKcovKaX4PPfZ1tqmaCIsbVKyh2CLgFvSVRFswB/0fHDC1zF9oRTy0P3AEEARifsq6EKIygBeQnWP2Glo4v6UuQHXYvGB1k7Om\ -BL/Z2wi5dLDP/N6LqfkeB33RhFxNaKD51Fwqp/u7ocHMPMODFTLZFvfgpE7AVXMNTm4b0JoH8tBPbSrje4BO+8EklcUQE6GF8BFXUbIqPggQYrFSvM+vUEYSRZj0FeHcqLtoY4BEUa399bycIGmXKUQCgcCBvN8u\ -iwaiiNZCex5PkNbLNB4LG1j0nEYAXfQSUH3ebS60ZtBYmNhEE44JokE/Y+Zxop/efN0JBu0wbvUcvLrvpsH6OYyQK2I+xAKEidQCelbvIgg+fNdpCe1Oh2sVs+PRjI6KiolPiY7IwtXljy4/eMBEMeW142EVacCw\ -Mo2xEMpH64fjjbRsWcyc2hSVMEGgaLIBhWihEIlT+IG8jk26mDTRgZ/yb12kV9eHogXAZGyQQSuibrRQ2NWBQIVi9dLq4vWWpyoTxbNttgdBk2cz0h8YGarPWdDWbW0UPDDSErbEkDBLuFoSFPD44pzkjCv6BojH\ -i/kCeIF+ZVsIZ8eBy0PGAxLhB4A/ogZauBY2rvLfCGwHM6z3UYDcYvjUCix4CRJtS08W3E3H5KHGfcnjUZFfhwp1PSo+bfJOBXsvGHeqg5UHKilT2XWrIQzoPQPEj5mxfZUPId+fXYsIZp01hUwf8/5RTXoDo1X2\ -LYnhioVHhwjZIaoD+e7KOfhDGXVCiNpZJzhDPPXCiLJfBtMsk0cJVT+VRYBxxjKODcdB817GsTIOxwygx/wZW4u17hgO8Vx/ALM8IYMJPeqUn230Tl1eAiW84/gOcxM5NT30jd6edrtdFM8D8putEmCn4bQ/To37\ -GTNkk/8/MqQJGLLBPakrsYg8wfXIs/ZymjXn/hFTNhravTnHJTbY5K0F9LPiDaoxxU2NE4H9JdG0hq7NOe/ycOzOO5qWnGuE2S2NFqglgjL+Lhy+EcR5Jmn5YoTm6J/FrvtnEAZbXsIRKMRT+TxYXaEBUC9GPyUY\ -rPoV/nyzBX/fkfeiNCxN+o79ZSw5CAVNweOwuxjRQCNiAd5F345gV7MOTYkFmhBiOYAV0ZoTlySSjLp8iX8J4RhSs1M2YTwaBWHozeXeJhrMEHfiYP5lPbCo3Ib4bEKtTGzJa7CNRuxNgKfs6vlrrmxfBNNsSU4v\ -T7YshpNF1abDybbTb+fbYgDQZzjOVDBoZjw/egXTSDCEhMIf94sAI0RP6QN24agOOApUjQw+zKHAzbdXIJa/Z1zZfwSb9QgWbGQ4+FOQhNol00NX6X0iW6dj2PiqcfurFvhCnTL3oi1hj9khq73H7bOfvfRM/NBo\ -HPwuRQjuDMwTqCTUhTdLH7MUividulDkTiv9kVNn3/kZBuE1MmS5x6zr8fAZ+1uwbg2FiBRbXwJZ1rMrHqDXhtS+s65gD10lHBoVZVKBD2Z0/BgplQEnr2G1Yf+XZQIlllhl1RuRcKhEDr7CdVu/SW93Ji/03GTn\ -czL+zcCCWXaB/oXWy2nPdEEczjh0N6TJFttqfec4vjswbupOd3ubl/Aec/ypBqNXZ9N75MJrm0FcWGcoIk9lQ1k96UIJuKlr9fG1AnO+UoDg9o4mk9xZnC6nYWH+Sjpjc6He2Wam7gZjE6JIaS9zb3mAltvAhtNG\ -iAiTtq7vSqHz0utki8Kh0FNS7nLopyVX3gUtMJMhKe887UitlYN9alM9+oCB3auO0jX1mCbCAIRrncZ3Du8CKFMxTdDPArmht3FDtRwF4Qx1RO0xyq2PH4FqmZdbbA64eTxChMOL8njn7hwaO9nMNSWSAARVafMj\ -A3NPkxJ1FhKcjJ0n0IfLk1HMMTaOdtjiFS/mDoSsYDo5ehXiobMuqCSMmu3cTcs9XLoRWIZZgrvQ+ZMlzlsyJUbgY8KesbMFisD/9dEunKBkz7RqDJk15xRBDakIFB5CPQKYgRUo2mXF2EIdbDu2CiAuPHowuW+M\ -Q2wlpYnWI/wKQBbF4WyG89ial8U5R7lZpUC/Zlo8xpZ7lw+YYtQxRkOPqWs9RzjbGqrzmFECmEOuVrIVjbv0eoeigjQDU8N8C0nAsJy0ZOh/uIlYEK+1q3T3EarGV/79FpGxwaUq77KWzSRzrjKdZYz7CbCukBxU\ -QJQDkyUsxQCNpMcoijhSr4cC0JyYWuF+bY0A2KcUG6WoahNtzzoLJ/SqCknS4qxLg7HM3YurD+RG4zscAUWOCuDRLGDsow4xnwqPF1GobQ1TVQQ9zhL6YAlBhs0EzGbAcPc4OgYYEcDDh0hZCNqjZ61EJhw7C3UK\ -lcR7ybfQ1zzewyEh4FkdixE0L/EtMGy7Wnfa2kjZRRfGp8ShNN7dWJOd8iBfIcwtgJ2KmvM0KFIr8SO1Q2KvzBP5tCEJMRmtcaNo1cFdsztrELsvkEW8q5hiaDvSlG+JLqRS22Al2ucXmwdi3d8Sj7MKUssyhizb\ -4kUNDIdLQDm4iS1at1tIN99QFA6gQiRlvyYeHAnA1rz7hIFnKzukykRg8de00/BRtb8ieoM7QeAvwvoV6gvr/nANZWemLrvNnmG+kN8yMdVBz25DM9oPf/uasdciGV5MB63ipkcLb2ZEC5eI/DSkhaxHC4ZoodDQ\ -p5GwD8Nb6B+oVySE8QfSG7oSvI6RCCBHj4VxtKV21kHAJJf9VX9KEq8ArPt9mL7x6U3TpNyQ7baLTdiNGse7otTAOYYA0LOOxigZrBDLSeU5+XwboC+nJLhr3rtBMiF5sXE6NNIHNKZZg6v8PzHv7JQw6neHvD2X\ -lByD/Frotp8XeJOroe0aBzpMF+75FD/jIxS7iNeXCaejl5bZkILeHfBudRqv6zREMm1D9VTeO+qjAImgqnd+zw0XEA3wxSCabXoLvPMONqccZx/TWu/cFdMDVqu4WDDWcNOvPMLMJWdJvaTSO8YCrjVoC2o9dP9/\ -xXTDvsMx3PiQ0Bj8qjmIFr2Av+mvV+/87v27Lquu4DiPza+JCGj7AkTR2nLCNoyBm7c25rw9e4Cm6uppkfePyXr9yZG7H3PsqUoRaAQ93eOcVjTUB41WRAdkj7faYqlcJdu8xPAJpDprWzC82Y6rOa5VpV3ky2D2\ -EEZi9nhUlo4l5vk1M3bdq2/GotvWRAX9SfTjOr3plOLpXeaLrvIGx03Ruqtw8wCEX08BVisUoFutAO2yAlSrFOHGJyjChdgVKxQgaUZCHoWNb7/F2IwowBIFCdoxH5MkK7TgW0oz1pKKSfHF67Xh5EtoQ86Q+LIK\ -EYisuoks0I8Ad0iJOiRDelsC5GpZKRItoC5cdHatrtZ6BEEqjU1j7Mpw7qLLUBQdctq6InLEELtlQiwgMcqryf7eT+TVZJfP4qacOIyoPukSSENpjKlSHByu7fDERz8sfYKIk7gw7gt0gehT2h/qm67AYELfSgc0\ -I0kaa9F1dMOr2i1d4Krw0s0gD7TaS1aYtrSESuOa1XnWZXeXeLpp/QMHCVcaLGqq9sazvxCdtJrtMGN7CXPU0GxJ2WiWSE4doPWapSG/Q2VhKhkoR/RhG0AX2CVwCmEFutABxdT869gM7A/Lm7sd1uZLWHsDAdnq\ -Edti8xBr5OVG+vAhJ+4Q+RCMvwDe7vMUp0P5tmgFP+I0uthsdSsEFzbfPBEMDg2/39hHB1vf1UJFwWII8g4HyEuJ43DjA3GeDuLJLVKgN30bMlNzPjrhAFIzZp7wfthEcIgB1dYQcSIZ3gEifk04MX89rlnNtQbR\ -r4tEDjVpTCLMCbSqPhaQws3m02t2msXeW4OTB3g6hZWJ5t0aNBRYUH9CtsbSFld67RYXRNjd0BTMyIwjWa28GViVNOsudBWYftxGVRjRyvik1TCY3Df35PRd4/WmLIh3bfcG6t+SRn/DocHKuzOXwpbAhQqPVWR9\ -UhYBjru1Csm6st/e/zTNPmYIx6jZ3YA+DSd++KOmY3VP7eHBNTaKMGAFNmqZXfYFCCv5jFNWzfgpBIaIilglLhESr+30U2nJMC0BTVl2GMDe8zRU/GEaWiYgtUrl40pnQQokZ80bP5/59aoeI2rp9aqehh1HaknV\ -k9WO6celJxnWPJ9GNUaoRq1Q+K35u6B1RmKZsvX3ERGpCrUHW3m4b6f6FOEF4lqg4q8RhTNONa+E6/TeMe7RzMv1GR+Crlr+3hsbjI+B46xZSqkcrcn5Z1KY8RRmlimsYvOhyv4NFFakNwsqcLlAVoF/688fcKNp\ -rxFvo3fyisOL/kjptIfyy0D7ULajZreiXEBPuPMx8c7ybc4lceVlwS9plEcZRp238eTClDWPxujHm/+G+jvH96f3T0XAxnzmshy9KKpTPFmx/yImxAItK7teIBZ/vN5Wc1hVbDWMd8bbCDQAegk+HGWPUpeU56ow\ -kCHqFOVXkZxI6LncRsUrrI9nT/j8jPcm7GAHAPNeWWv4ZPWa+pRPmjS2FNOvMnyRfvUSQtn3SIKUHM/WvhkpeuXAAZwM+oJJveTwtoSY0+5Ylmh/18j2OoTn0aGc8mlTVA8/E0F3+WTz1flkJr9By3NUZ0RQii9m\ -8tccSFuVxpJ/qTSW+nfnlZG+Ql/mk1LLBjuzI85LYXTYHPIH7Kpg15dILJOM/zBth3N5AgvhhoyBgfM9Iv3bLfjhv3KG+hkxL8U7H/BY3lXY5n0hTPSCFKtaclwHsuIhypo1yQJVYx8E7dUDDTeOj2lMiAeiDdnO\ -eBt0+oL0n8Pc5YoCrLD11aSLitUxvobjFbXtEnIU86dFOeokLf0Uj5Hrn9k7NrAueKpgXmY+B17OApaDs4BMum78A6fp8EvI9zdslij7jzkGubp9Xz4SVPosCj4EAD+wI+DnP7JtUfIPkzL4qJM/5ZTx96kcoudy\ -WGf8kW+Tj3zLP/JtMB7A1nDZVMkezOI7tLK/WZsB9hNaAryOAG9ZycP8bq8OoGXX184es3/6HehTB3kirsRzSEE+N4UoaddfluxsuGRg27gS8/Yx7HI3Yv3Yr4bpWl0e0zccd+TUgTPMAm0XdB5nnXlj7OtdIuJK\ -Fd0hrCbr2B639bUc4ON1hgyvpuCdcybT2n5LpFgyTTUNbxo2nAaIG+jZkksaBJNtZxg7ubsFUkr1bR6bzMpyq1XWOyCUYWcBdUuzDXkEFSQZYNARnFSrgjzpMrobQfyxWZQ70V0inxoGMHSWkFPbYEukztjmAcE0\ -ObzFMSCJ20i4vWyXcPdicYKRCmQVvOCkkeMqcKsJ+hUFNy629vm2CcTQXS2nb8AppIAH2y1gvdb+mK4cc5xuX1xAhT0+LIuBtwY65dNhDzkZRE4Fdocg5GXBXZwgFnfDyCeKrrgDGcPg2bL8wPdm+b0BYwRfwuFL\ -K6eZ8wMBqjvVtFhuLSFvisLtsSmnOc7fqxxxNJ3DAHg2QQ7YwmlRB+M7NYogwgn7bv7snGF3x7Ix5iqUmlkiZ7YmIwmghucpLJ/dJNpFL/v9b6//ToevtnY72kXTKif0hZNr6vD+BGIGm3aRDLQRKm6vltv7/vm0\ -GE13a9ccrLqhAU/21f6oIedSxXw/U/HgB7P7UI6vAYMVRSc0EXq4fAJkF1IBqjy+mqM7caoos9pABksFiq046MDU9qGcUUx9xSA7rxxEuZWcccvxgDFSNJhPwG2OD6MpmXYaH/UvLrFpjFeTxHg1CR7DSeN7FMfX\ -OrxUSClJKJbLs1RQUEsFH6OJeXPN9c//KbV+fsSpZqjd4bIOV/YqIm41hdaC1w9712vgzSLnV70aWwHJZBFmYahEDadjlu4wOuxuD+qiMuGcg4u6bFryKmjOQUBwS+SJETXUeNQNz7ryzDClmhUp7qDg2eaJ4AAq\ -SAIeKRJNwe8hVvrIPMerSMwT5kw5rQpZc7i/CPuGeNdEZUbfcDTNWkj3E+VNl0SYUclbbO7wRe8eMhgm92umyax0Dghbw1niZrIEI27wqU9bOfMkwvfFEzPaWdseye1XQD2rLrl6Inf9yEeUCkC1Vv/IyMRsH7MP\ -umN2cfUGNMxZJ06cRAh1F2LXfDcYamRDSIGQWe1oJrWdDXfIWHRO+Bya23rCDiUaYFsjcEdKPucARCIZtjrnPUm3xcfY1DOwUtTXfB1Od1VbQLBWMujsuNVF2PLBPqsIpzDPaBtFCJzgNG8AgQC+OeNzA874S8Mi\ -QWZ4VZZSZyccbOoo/UqOmY3n6BarJ7OHtzyzQt3J9gT3eMePkp21aDTbPpEkxaSRizXerpDMRotMnERrJNFX32hGP/XVYNEROH9mnDOvtFwwU4tSqIaYlAqhu9Q7N0nN5Yy0CZTTyn5qrjBecVOR0R+f1ECoFLG/\ -AvCK7yVS6R6I6J7pFzhsfnOG79ARSQMBZn+cKGUb1OJDetMNckq9Ck+TXvaPlmKyrfEXaz3Gp3HwDoM6hVynFSzBErcCayKnev7srtISXk3IbNRyuFGYdrLiqhYxuwpRiJKAjsl9Uznhwe/c04sFqF7NVxx4E2LY\ -rU2fAnq00lEADbJpvVy9ZseoZrvYKjja7+pYxGTa9UG3LYmxO7yBqkkD6Zxh7ROZ+W5n1izl/pd4kEIO5Duvzz9ZKPTpsrvG6YpTvqvqd5D665CMrsLC+7DwoU9tZnDbYDEsdxfE1V+FNFcPaa7kCKtj4kN6E+JD\ -SgyJT5dum4/SOl6Gur9w3jzBU24jvhYMd0UCK5hcvOeeW/9Om2+raU2OIJruFi3a27hPgWu+G6IqV90al8vVnGgu7ZzBQMfMRfZ7uVPmq+GdoHKdaM2xtzIzRG2NWpOLNOSglEikM9naPGBHo3wJNtfkjDjL4fEp\ -i+/lih9/u9zgxjjZs2nHfd0FMf0dK2nyd9KWtu4sbTpsOeMsIeiRWa6d8M8s0yeybv4QFwvIhsU02myaWAkSQ9WTiFicqhZuCOwZZ3ggsC9fsVlf3jojIuT3QDSTmHxIepVUCc/VZn6uiOMpXSdYwqohq7mf7gj1\ -0cbLfZ+NFATZ8u7eQOxVr4C0snKqAI+bpbf420T2YWhZG07VdJhzD7qjGktDR8xny5wuZO3Cn/6GCwcRiowVZZ1uPLnYjKkV4H0RyDezpBxP5O7Y+MOSlKOVkgmbicjHUXBln+HziD03WqLdMRm8zlW7xG9tp+QV\ -bBKn2PLPXwe5QjVfaxIGbTGdfvx7BCgGB+ciNWHc7D7fpQeumg3c2e5mh+Bgh8rwvgvqTI7yTTcSin2apcT4uZgseFYRh7qNseJtucTWLNk+eNpggjoSQcGqeI9WX3JL33h0N5VpVL1mncW1EH1B3NPraXMU4aXN\ -P769KhdwdbNW07EZT6fjcful+eVq8Y/wpWlf1uVVyXc8925uxUWeBNab5GoKJjP+yWV7Kac24P2gJiiI7sWCrYKCCOG2sMVbjvB66oIC3KXiC0ED3hwrsbBHR12pTh0Wwga9AggfuK1gRb8VxQSxIPdM+Gn5wnVd\ -l2wkDV7/J5/EVnzExaGTePg9X9ksN6i6iTTVYeHaaVxXiK6r0/QKfIWUFpXOS/OabHFaAOfRfMc/kQ/LhXdBj6LMfifYv6fwKoAKHBxfMCqYxtLVycMgbzYoD72W4TXn0175qldaDPyPwdjhTVF0+1yornv3B3SF\ -cvnS5p6DrFdcFa0H9fXgezooZ4PyeFDOB2UzKNtBHHZFXLYrR2GhVzO8n1r/tCIY/+/66RvK6WfS0E00dRONDcv5DeXpDWXz0fLVR0q/fKS0nIG1IiPrI+XFx3jnxt/n8m3+WTi6+ox5DyF3N0iBAeR6AMnw4nLd\ -628tLNwOC71ue77IUVh4ERZ6C/J2IGkGcJaDsh2Um2wFl+gvyMX/binwR6XEH5Uif1TK/FEpdFP5M39adYEyz4FT5LzuasgqPP8uF/xJRMlz2iodd+1MN9n6DY3lbJqq1jb+7f8APK6wwQ==\ -"""))) -ESP32ROM.STUB_CODE = eval(zlib.decompress(base64.b64decode(b""" -eNqNWntX3DYW/yrGCQxQ6JFsj0dmT8uj6YQk3d2QbghJZ0/Hlm0I27ApnRPIabqffXVfkjwzbPcPQNbz6j5+9yF+Hy26+8XoIGlGs/veJO5XcQgtha3yeHavXLPS7rN1P/3s3qqEOo2ZLdxvaKnH56c0ijPr/2em\ -hv0UTZAfrYQCFbWiHyMUdWM3bGknA2c21FauT2X+7B1YE1O1sUJe+p525M/t2eL8dpV+3AY215ncxH0XybZafxOljojULtCpS0dJHWju2ohndunMqqIzQwcScf75Ye75Hx3aRoXVFoTaH9IG8qPoHpG4N4SaLIUh\ -oPs71xjDTUy4SVfTaD0W7l+cEIt6YVV+DNvC0Bs3D3qbixRoeg2idgTZMczIeFMQXQ7cTo8u3KfedP15JGLFbbjWGHY4C51BVsC3Ma1os8HgydVA0qfIzwVvak5OUxa1VQcFbHRSpUuMNvQX9RLJVUtKih+Vinit\ -zBG3TCQOpLSIv4+OpHVK3bhGD/Yt/L5BUshe4M4EGsfS8Le8AHt4/h2onR4MbLtfZZIsWJoZmKgtH8GQm9x1NLnRoe15XGdb3MCfhRNUI3rm9rKsGaDXXazvTbRnEwmzor+wR8Ntf5Zl26ucLHUzOJY4TVBFg6Dl\ -0FdxXzCe7CdmuqPH2MFdTnkkOgAp1xGFvF81gTO+jZcbuiveTwV7btG2J2TwupoSKin1xU1zS4wb0cBmN7IYWi9vvWL+0FH4fR5GiioQ1GoPigu+ej5gygUf26RbvDFApxNhW7HIoV0IUjh9s0NdeEtLhmj0ch9U\ -i/HP/apxg4tCjS0rWw6WDjZevPvx5Wzm5phSVnfEITLKJ261G9HCZfOYeIegk5EbELbH8Api0QVwKU8coU2WMIYwInSRNRt7kJJO2WLnH0jVweu38AdIhquC4Q1xYOic0HQ/ohE573J4+hjvD/NT4kQdnJZwtm4J\ -qE0E/oGqb2Y3wd10luwIPYAmTa2zgO9gP1qgTxNz2i7yLVkEovmyLQffXCcxjmbsF5tsg2eCivereBzzslaPSMmW/RMqkLgbJV681vcRmewO8XpKrvocZmbX8ImyOk6hnSNlYJE1OJRqd5eONTQnxAGmer7zjvUF\ -tWp/dsP72zHTWw3o3SOs8Q48EATYi2LLSAlxWkeygPG2GcYiA8bIHMu6ng/3xrWyp+F9Jv9jn5bnFKtzVmMDuskB7F0GBJH95Fs3KQdWjYBXxti6NlaT9kX84QCuBXUfO/1vzddsCZWNusFzwn3dR7mxQTQAVKGA\ -o/hxYKRlwElw+yW7ErSil98Borccj4iEdJgW7wTWBCfI/IYNcYWKfHnt8/QI4fPckrKiQbDpNtFqAPa6Zp/QrZEh9FdR0NPIms2gpaghxHdEJ7ssBW9DkXbCibb9M424iuX1Mf5YxB/38QeA1CVjHeA5mwgcccXG\ -sgFiqyJ8kCvWPd3PmGegDreBU2il5d7sBvyIaS553gOSw9shAD11DIfObMpuA4U+iafES/8Kp5wJeoHsGyHt9TUtkrBRlftRhOYFdWSJwXSNkBGQ8syvRP/KBATCzgYAZtXZMJZHEQZyYfwKbl9+IDKq+mw6uxVK\ -NoUfc3ciHsE6i+6PNRAhjk8kWojHjU6cjOsJE9WsGNd1ev1kQmhqLQcOeNrLdv2lzcQN1zkd0cV5BPOsLdYLT+IRzYE2Bn3ZNnr9P1jLJsgfyMDK6ewGLjymiXX2QmCqp6MJH79QMNlwrNVOtqazERkZsqT/CIPJ\ -0CzrFWjtwlVwqVpnn8zxceA42fceuGsUef6Q8b0CojScCxdq9RviuOkoyPJJ0BqkxZi/O/z76fEzMj4Kng8LjOkXR6xBlCZgulEcLiV4a7JD0EQzwPOjQfq6lgaCTP/hBDmKdiiiZMUfzyREdEu4yps0IV36csVH\ -dww2FxIZHv2yi67EZOxRrN3D1g/0p6CcEBeDFld0iXtyQIqE6xzOhYeuH8j54gpd0C6QvGiOdNveW+dNCq7LnHBcoh6C9g1ycpiPtVKQKIXlJ5hcvEgnIOrJJoeLeMILgnGrEw4S0Ql0AhHHTE0nZHWURLV5BCB2\ -F8JO+87HcM+CHxSkCaR6nExJ37EjZIy50+hkMxnUUXJGyvwB467XsMOaQbhpOMOwhENgXDZLHoEipdCMawcJYQwcp9gITXTn+Hjgt+UrtvqMj4w6gVmYhXTE9VoqJNYbbreGQ3B+372CQ7865t0AvBuU7fVjf68r\ -ToPKT4Pr3nNsZUkNuPd96NVZesyXB++FemK3sQ+D37PZ4v3ZVogKtS0vKSfQ/TTcX/kN8oYbWKWC8oWep0l/Ao1tsNUo+c92zqbDYpG2aeqO3IxyPgCJRrSTkBsU1NasO3Qqm9LwYI7Gs2SDGI5xwYRCJa3jwGWT\ -MbAPnWBceFCEteQ+ppJcNzHTsNgzovqD4ji3whj7Mvsb3oQz24bv25efkr6U/kvpRK72W9IPkYOaSnmjl/S7RG/Vn/N9S8EbatfWaxdIbokq9KKOKjzoUyDMtNEOE9w/LMQJ47BtE207/Z2JrHMR4+BQW/6FTtwG\ -S/Cd38tk6HDkcMLZLxEsPgDu2IQlejDNEKNQgyLCOiYMPxUn2bGcpnueF50Mo0uBXF630qWp6xExx/TxbvmQjiegEDJWDMcOmRxTB0aiLZUX30vesI+A4Lm9xfJiKRvmMIhDj2PjcSpcI57Op8k8JdXX5S5nseV/\ -oowLfiBFNfrfy5hzTjCquxM2QQy3M/KP1j4mKnQXTq7VHBzuObHModMbNrQox6z5p8ey6OWaQ7FIZedP4CB/4lMu8q5sRcTP1+wDUZJuVok/F/idckCgBRWl8hI4Pb0OduDnKraHJgjjVng7XR0jN4KCmkfKovRW\ -mKbKn6UMhkEM1syOGVhqFS2znO/rSmznn1waMVTXHhE+1VHRbG1tHvStQEr3YN1TONFELrxcPrBGhryWV4hJdGRC/NKcu1iollNUu0GRGPg6rGbr95DXt9lXMBNPABvI9/nO5bNQ81QcXIjHqjPKuoUuwMmqFjaf\ -kusbbb8l/EdnjzWpnjS28gg/3wE4doy1E6rmVZyhNIL3zDev15nk+1jXrWhW04C6A58x253sku/3zmfMBQ1oF+IfSnZEzK0aX0MSVhrowSpymcj8SUS45tsoaiRzcod4utphF4PMmubDHAgTtjawUlz4EjO9Sn0t\ -7zRGxs1lUDlIkt14gyzfhggNsYXB2BCkkvkQdUqFownnplvejk5lYiHgnizZEIYrJeMlyYRWxUMrNsxJZzfYbHAOl3KZtVj3jNXNSCzL72yRUonC1KxXVO0D1IBIsao4jIo4+4qcPQqi+wDq1OITlMyCl4bJN9+T\ -dnSSvwxvBBt1B15v96ngZ30RbZf8i2P94kWKZNy8oEQR71Al9MpH2prRhy7ffkVKDHOgvoCxLdytiQGjH/qeuh96LR9VlsMgTqll/Or7hN9LIKKqxlxJwJ7a93QSpZ1DKD5Ziq56ebQojy7BkMYhFvoNifUh1j36\ -zZJFr8chDSLFWBMowPAHHwnYdRGGKqvgelUXp7aDuEKXTwfeX5fkz2/CCrilZc3DjMJwYuA9Wc0BLk/AalE3CPYBuYAdhh2VlgIcgsy8BU8LAmsUF7Qb8hJcm8SXrpKBXlKxbk2lN+fnoojkeA5WQZg65XmAjxbe\ -qVGoCA48eCr/Cl2KfUitXyL6NA7nKePRkJ02TULTkClMpoB6Pf6dI3R8G+iWlHLNzojASQ8pAlRCesiaxX0a4FvV+qn4eLRFmSPyOeM3LQT4H46Hxe0qq2e38spYZRsQL9TZDteIS3au0DY75DmlQlGP3z3woJTN\ -gTphAF8ay0ndqmyMPbiVZ6XPr6CYml3ffYY/99n8EtTlPRgIltq65qFMqpdMqk9SOTPiEaHMNLatYzbo7tfwrNJlj1EGNW3dqTs4/xY+y/tN2Ka6K4Oxg9cBRG25/ml19xMz0kDvr5St9PxUB1AORmVYQxuWWcXv\ -Ub0kj4ZSNyDBSh9XHKtilYNO9jdgORDZmF8lAiBDayrolUCj4ffBGl6DasO1OpiLYMjRQw1w3PD7KHZgTehj2BUrRzVRhy8ywuI2vP7g61bJIB+Vnolhm7/EjPrMMRZkbOU9CNfeUbwx6THwuONAqbyjciZoA5ai\ -vS+b7PwIUvpWxHsO4Vq/jUS8khvLO/mKK/C+bufHKddDO//uNzqnl5AatfjTGgjSraDgxzUKrn9b7QTFrHDV1YTtFUvPXBS/+TOcu1qd0DHQSVJQRYBFoS8svF5DoOgmv7NBsIbSMo4XHe6yPRtdTeZYpQgv/U1B\ -EgaWgrrY8so/8giUUivbvJMaWhzjY5gCZZt8yo8xvbmDG16Ct3kDOz9lB0KY7AMeLF4NrvGBE/ObOT9xqnLuIWkU18ZerPEPVrznW/F/eON1tSh6+QA+lxeYRlSSQ7y5goNQLbMNSDG69yEUlIeaSo+jYM5czRZe\ -MefbQPkHXK550wpfnau4FEbTYNdnnlhU8xSi/Om/aOX6RzDvJnzGsc1oypaJYZvNAqsxjojDWPQN+RcqENIpWxxpjbdSbpWh1j54uVU7j+Qs2MamXDDFBXHU31qMaqr4H8pw7j5X+KLr+RPaLwSi/jLNYGkaCAnL\ -ecmQXaO9BP/h7+ffFvUt/NufVpMir3JljBvpbha3n31nUUwy19nWi5r/PzCq2o94JN4on+RlqbM//gt1kVkF\ -"""))) - - -def _main(): - try: - main() - except FatalError as e: - print('\nA fatal error occurred: %s' % e) - sys.exit(2) - - -if __name__ == '__main__': - _main() diff --git a/tools/gen_esp32part.exe b/tools/gen_esp32part.exe deleted file mode 100644 index f81ac71c56a..00000000000 Binary files a/tools/gen_esp32part.exe and /dev/null differ diff --git a/tools/gen_esp32part.py b/tools/gen_esp32part.py deleted file mode 100755 index e3c8a6dc433..00000000000 --- a/tools/gen_esp32part.py +++ /dev/null @@ -1,513 +0,0 @@ -#!/usr/bin/env python -# -# ESP32 partition table generation tool -# -# Converts partition tables to/from CSV and binary formats. -# -# See https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/partition-tables.html -# for explanation of partition table structure and uses. -# -# 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. -from __future__ import print_function, division -from __future__ import unicode_literals -import argparse -import os -import re -import struct -import sys -import hashlib -import binascii - -MAX_PARTITION_LENGTH = 0xC00 # 3K for partition data (96 entries) leaves 1K in a 4K sector for signature -MD5_PARTITION_BEGIN = b"\xEB\xEB" + b"\xFF" * 14 # The first 2 bytes are like magic numbers for MD5 sum -PARTITION_TABLE_SIZE = 0x1000 # Size of partition table - -__version__ = '1.2' - -APP_TYPE = 0x00 -DATA_TYPE = 0x01 - -TYPES = { - "app" : APP_TYPE, - "data" : DATA_TYPE, -} - -# Keep this map in sync with esp_partition_subtype_t enum in esp_partition.h -SUBTYPES = { - APP_TYPE : { - "factory" : 0x00, - "test" : 0x20, - }, - DATA_TYPE : { - "ota" : 0x00, - "phy" : 0x01, - "nvs" : 0x02, - "coredump" : 0x03, - "nvs_keys" : 0x04, - "esphttpd" : 0x80, - "fat" : 0x81, - "spiffs" : 0x82, - }, -} - -quiet = False -md5sum = True -secure = False -offset_part_table = 0 - -def status(msg): - """ Print status message to stderr """ - if not quiet: - critical(msg) - -def critical(msg): - """ Print critical message to stderr """ - sys.stderr.write(msg) - sys.stderr.write('\n') - -class PartitionTable(list): - def __init__(self): - super(PartitionTable, self).__init__(self) - - @classmethod - def from_csv(cls, csv_contents): - res = PartitionTable() - lines = csv_contents.splitlines() - - def expand_vars(f): - f = os.path.expandvars(f) - m = re.match(r'(? 1 ) - - # print sorted duplicate partitions by name - if len(duplicates) != 0: - print("A list of partitions that have the same name:") - for p in sorted(self, key=lambda x:x.name): - if len(duplicates.intersection([p.name])) != 0: - print("%s" % (p.to_csv())) - raise InputError("Partition names must be unique") - - # check for overlaps - last = None - for p in sorted(self, key=lambda x:x.offset): - if p.offset < offset_part_table + PARTITION_TABLE_SIZE: - raise InputError("Partition offset 0x%x is below 0x%x" % (p.offset, offset_part_table + PARTITION_TABLE_SIZE)) - if last is not None and p.offset < last.offset + last.size: - raise InputError("Partition at 0x%x overlaps 0x%x-0x%x" % (p.offset, last.offset, last.offset+last.size-1)) - last = p - - def flash_size(self): - """ Return the size that partitions will occupy in flash - (ie the offset the last partition ends at) - """ - try: - last = sorted(self, reverse=True)[0] - except IndexError: - return 0 # empty table! - return last.offset + last.size - - @classmethod - def from_binary(cls, b): - md5 = hashlib.md5(); - result = cls() - for o in range(0,len(b),32): - data = b[o:o+32] - if len(data) != 32: - raise InputError("Partition table length must be a multiple of 32 bytes") - if data == b'\xFF'*32: - return result # got end marker - if md5sum and data[:2] == MD5_PARTITION_BEGIN[:2]: #check only the magic number part - if data[16:] == md5.digest(): - continue # the next iteration will check for the end marker - else: - raise InputError("MD5 checksums don't match! (computed: 0x%s, parsed: 0x%s)" % (md5.hexdigest(), binascii.hexlify(data[16:]))) - else: - md5.update(data) - result.append(PartitionDefinition.from_binary(data)) - raise InputError("Partition table is missing an end-of-table marker") - - def to_binary(self): - result = b"".join(e.to_binary() for e in self) - if md5sum: - result += MD5_PARTITION_BEGIN + hashlib.md5(result).digest() - if len(result )>= MAX_PARTITION_LENGTH: - raise InputError("Binary partition table length (%d) longer than max" % len(result)) - result += b"\xFF" * (MAX_PARTITION_LENGTH - len(result)) # pad the sector, for signing - return result - - def to_csv(self, simple_formatting=False): - rows = [ "# Espressif ESP32 Partition Table", - "# Name, Type, SubType, Offset, Size, Flags" ] - rows += [ x.to_csv(simple_formatting) for x in self ] - return "\n".join(rows) + "\n" - -class PartitionDefinition(object): - MAGIC_BYTES = b"\xAA\x50" - - ALIGNMENT = { - APP_TYPE : 0x10000, - DATA_TYPE : 0x04, - } - - # dictionary maps flag name (as used in CSV flags list, property name) - # to bit set in flags words in binary format - FLAGS = { - "encrypted" : 0 - } - - # add subtypes for the 16 OTA slot values ("ota_XX, etc.") - for ota_slot in range(16): - SUBTYPES[TYPES["app"]]["ota_%d" % ota_slot] = 0x10 + ota_slot - - def __init__(self): - self.name = "" - self.type = None - self.subtype = None - self.offset = None - self.size = None - self.encrypted = False - - @classmethod - def from_csv(cls, line, line_no): - """ Parse a line from the CSV """ - line_w_defaults = line + ",,,," # lazy way to support default fields - fields = [ f.strip() for f in line_w_defaults.split(",") ] - - res = PartitionDefinition() - res.line_no = line_no - res.name = fields[0] - res.type = res.parse_type(fields[1]) - res.subtype = res.parse_subtype(fields[2]) - res.offset = res.parse_address(fields[3]) - res.size = res.parse_address(fields[4]) - if res.size is None: - raise InputError("Size field can't be empty") - - flags = fields[5].split(":") - for flag in flags: - if flag in cls.FLAGS: - setattr(res, flag, True) - elif len(flag) > 0: - raise InputError("CSV flag column contains unknown flag '%s'" % (flag)) - - return res - - def __eq__(self, other): - return self.name == other.name and self.type == other.type \ - and self.subtype == other.subtype and self.offset == other.offset \ - and self.size == other.size - - def __repr__(self): - def maybe_hex(x): - return "0x%x" % x if x is not None else "None" - return "PartitionDefinition('%s', 0x%x, 0x%x, %s, %s)" % (self.name, self.type, self.subtype or 0, - maybe_hex(self.offset), maybe_hex(self.size)) - - def __str__(self): - return "Part '%s' %d/%d @ 0x%x size 0x%x" % (self.name, self.type, self.subtype, self.offset or -1, self.size or -1) - - def __cmp__(self, other): - return self.offset - other.offset - - def __lt__(self, other): - return self.offset < other.offset - - def __gt__(self, other): - return self.offset > other.offset - - def __le__(self, other): - return self.offset <= other.offset - - def __ge__(self, other): - return self.offset >= other.offset - - def parse_type(self, strval): - if strval == "": - raise InputError("Field 'type' can't be left empty.") - return parse_int(strval, TYPES) - - def parse_subtype(self, strval): - if strval == "": - return 0 # default - return parse_int(strval, SUBTYPES.get(self.type, {})) - - def parse_address(self, strval): - if strval == "": - return None # PartitionTable will fill in default - return parse_int(strval) - - def verify(self): - if self.type is None: - raise ValidationError(self, "Type field is not set") - if self.subtype is None: - raise ValidationError(self, "Subtype field is not set") - if self.offset is None: - raise ValidationError(self, "Offset field is not set") - align = self.ALIGNMENT.get(self.type, 4) - if self.offset % align: - raise ValidationError(self, "Offset 0x%x is not aligned to 0x%x" % (self.offset, align)) - if self.size % align and secure: - raise ValidationError(self, "Size 0x%x is not aligned to 0x%x" % (self.size, align)) - if self.size is None: - raise ValidationError(self, "Size field is not set") - - if self.name in TYPES and TYPES.get(self.name, "") != self.type: - critical("WARNING: Partition has name '%s' which is a partition type, but does not match this partition's type (0x%x). Mistake in partition table?" % (self.name, self.type)) - all_subtype_names = [] - for names in (t.keys() for t in SUBTYPES.values()): - all_subtype_names += names - if self.name in all_subtype_names and SUBTYPES.get(self.type, {}).get(self.name, "") != self.subtype: - critical("WARNING: Partition has name '%s' which is a partition subtype, but this partition has non-matching type 0x%x and subtype 0x%x. Mistake in partition table?" % (self.name, self.type, self.subtype)) - - STRUCT_FORMAT = b"<2sBBLL16sL" - - @classmethod - def from_binary(cls, b): - if len(b) != 32: - raise InputError("Partition definition length must be exactly 32 bytes. Got %d bytes." % len(b)) - res = cls() - (magic, res.type, res.subtype, res.offset, - res.size, res.name, flags) = struct.unpack(cls.STRUCT_FORMAT, b) - if b"\x00" in res.name: # strip null byte padding from name string - res.name = res.name[:res.name.index(b"\x00")] - res.name = res.name.decode() - if magic != cls.MAGIC_BYTES: - raise InputError("Invalid magic bytes (%r) for partition definition" % magic) - for flag,bit in cls.FLAGS.items(): - if flags & (1< 2**32: - bits = 64 - sys_name = platform.system() - sys_platform = platform.platform() - print('System: %s, Info: %s' % (sys_name, sys_platform)) - if 'Linux' in sys_name and sys_platform.find('arm') > 0: - sys_name = 'LinuxARM' - if 'CYGWIN_NT' in sys_name: - sys_name = 'Windows' - return arduino_platform_names[sys_name][bits] - -if __name__ == '__main__': - identified_platform = identify_platform() - print('Platform: {0}'.format(identified_platform)) - tools_to_download = load_tools_list(current_dir + '/../package/package_esp32_index.template.json', identified_platform) - mkdir_p(dist_dir) - for tool in tools_to_download: - get_tool(tool) - print('Done') diff --git a/tools/partitions/app3M_fat9M_16MB.csv b/tools/partitions/app3M_fat9M_16MB.csv deleted file mode 100644 index 0f67e69fbfe..00000000000 --- a/tools/partitions/app3M_fat9M_16MB.csv +++ /dev/null @@ -1,7 +0,0 @@ -# Name, Type, SubType, Offset, Size, Flags -nvs, data, nvs, 0x9000, 0x5000, -otadata, data, ota, 0xe000, 0x2000, -app0, app, ota_0, 0x10000, 0x300000, -app1, app, ota_1, 0x310000,0x300000, -ffat, data, fat, 0x610000,0x9F0000, -# to create/use ffat, see https://github.com/marcmerlin/esp32_fatfsimage diff --git a/tools/partitions/default.csv b/tools/partitions/default.csv deleted file mode 100644 index e9772b6f891..00000000000 --- a/tools/partitions/default.csv +++ /dev/null @@ -1,6 +0,0 @@ -# Name, Type, SubType, Offset, Size, Flags -nvs, data, nvs, 0x9000, 0x5000, -otadata, data, ota, 0xe000, 0x2000, -app0, app, ota_0, 0x10000, 0x140000, -app1, app, ota_1, 0x150000,0x140000, -spiffs, data, spiffs, 0x290000,0x170000, diff --git a/tools/partitions/default_16MB.csv b/tools/partitions/default_16MB.csv deleted file mode 100644 index 7b89daee9f0..00000000000 --- a/tools/partitions/default_16MB.csv +++ /dev/null @@ -1,6 +0,0 @@ -# Name, Type, SubType, Offset, Size, Flags -nvs, data, nvs, 0x9000, 0x5000, -otadata, data, ota, 0xe000, 0x2000, -app0, app, ota_0, 0x10000, 0x640000, -app1, app, ota_1, 0x650000,0x640000, -spiffs, data, spiffs, 0xc90000,0x370000, diff --git a/tools/partitions/default_8MB.csv b/tools/partitions/default_8MB.csv deleted file mode 100644 index d21c7f6b177..00000000000 --- a/tools/partitions/default_8MB.csv +++ /dev/null @@ -1,6 +0,0 @@ -# Name, Type, SubType, Offset, Size, Flags -nvs, data, nvs, 0x9000, 0x5000, -otadata, data, ota, 0xe000, 0x2000, -app0, app, ota_0, 0x10000, 0x330000, -app1, app, ota_1, 0x340000,0x330000, -spiffs, data, spiffs, 0x670000,0x190000, diff --git a/tools/partitions/default_ffat.csv b/tools/partitions/default_ffat.csv deleted file mode 100644 index d921c9fe3d9..00000000000 --- a/tools/partitions/default_ffat.csv +++ /dev/null @@ -1,6 +0,0 @@ -# Name, Type, SubType, Offset, Size, Flags -nvs, data, nvs, 0x9000, 0x5000, -otadata, data, ota, 0xe000, 0x2000, -app0, app, ota_0, 0x10000, 0x140000, -app1, app, ota_1, 0x150000,0x140000, -ffat, data, fat, 0x290000,0x170000, diff --git a/tools/partitions/ffat.csv b/tools/partitions/ffat.csv deleted file mode 100644 index b98bf0c3034..00000000000 --- a/tools/partitions/ffat.csv +++ /dev/null @@ -1,7 +0,0 @@ -# Name, Type, SubType, Offset, Size, Flags -nvs, data, nvs, 0x9000, 0x5000, -otadata, data, ota, 0xe000, 0x2000, -app0, app, ota_0, 0x10000, 0x200000, -app1, app, ota_1, 0x210000,0x200000, -ffat, data, fat, 0x410000,0xBF0000, -# to create/use ffat, see https://github.com/marcmerlin/esp32_fatfsimage diff --git a/tools/partitions/huge_app.csv b/tools/partitions/huge_app.csv deleted file mode 100644 index 290a7cc738b..00000000000 --- a/tools/partitions/huge_app.csv +++ /dev/null @@ -1,5 +0,0 @@ -# Name, Type, SubType, Offset, Size, Flags -nvs, data, nvs, 0x9000, 0x5000, -otadata, data, ota, 0xe000, 0x2000, -app0, app, ota_0, 0x10000, 0x300000, -spiffs, data, spiffs, 0x310000,0xF0000, diff --git a/tools/partitions/large_spiffs_16MB.csv b/tools/partitions/large_spiffs_16MB.csv deleted file mode 100644 index 7974c9eb140..00000000000 --- a/tools/partitions/large_spiffs_16MB.csv +++ /dev/null @@ -1,6 +0,0 @@ -# Name, Type, SubType, Offset, Size, Flags -nvs, data, nvs, 0x9000, 0x5000, -otadata, data, ota, 0xe000, 0x2000, -app0, app, ota_0, 0x10000, 0x480000, -app1, app, ota_1, 0x490000,0x480000, -spiffs, data, spiffs, 0x910000,0x6F0000, diff --git a/tools/partitions/min_spiffs.csv b/tools/partitions/min_spiffs.csv deleted file mode 100644 index 0b6a9ffd01e..00000000000 --- a/tools/partitions/min_spiffs.csv +++ /dev/null @@ -1,6 +0,0 @@ -# Name, Type, SubType, Offset, Size, Flags -nvs, data, nvs, 0x9000, 0x5000, -otadata, data, ota, 0xe000, 0x2000, -app0, app, ota_0, 0x10000, 0x1E0000, -app1, app, ota_1, 0x1F0000,0x1E0000, -spiffs, data, spiffs, 0x3D0000,0x30000, diff --git a/tools/partitions/minimal.csv b/tools/partitions/minimal.csv deleted file mode 100644 index 6ebeeb32dc2..00000000000 --- a/tools/partitions/minimal.csv +++ /dev/null @@ -1,5 +0,0 @@ -# Name, Type, SubType, Offset, Size, Flags -nvs, data, nvs, 0x9000, 0x5000, -otadata, data, ota, 0xe000, 0x2000, -app0, app, ota_0, 0x10000, 0x140000, -spiffs, data, spiffs, 0x150000, 0xB0000, diff --git a/tools/partitions/no_ota.csv b/tools/partitions/no_ota.csv deleted file mode 100644 index 3314273b884..00000000000 --- a/tools/partitions/no_ota.csv +++ /dev/null @@ -1,5 +0,0 @@ -# Name, Type, SubType, Offset, Size, Flags -nvs, data, nvs, 0x9000, 0x5000, -otadata, data, ota, 0xe000, 0x2000, -app0, app, ota_0, 0x10000, 0x200000, -spiffs, data, spiffs, 0x210000,0x1F0000, diff --git a/tools/partitions/noota_3g.csv b/tools/partitions/noota_3g.csv deleted file mode 100644 index a684385bdc8..00000000000 --- a/tools/partitions/noota_3g.csv +++ /dev/null @@ -1,5 +0,0 @@ -# Name, Type, SubType, Offset, Size, Flags -nvs, data, nvs, 0x9000, 0x5000, -otadata, data, ota, 0xe000, 0x2000, -app0, app, ota_0, 0x10000, 0x100000, -spiffs, data, spiffs, 0x110000,0x2F0000, diff --git a/tools/partitions/noota_3gffat.csv b/tools/partitions/noota_3gffat.csv deleted file mode 100644 index f008c277897..00000000000 --- a/tools/partitions/noota_3gffat.csv +++ /dev/null @@ -1,6 +0,0 @@ -# Name, Type, SubType, Offset, Size, Flags -nvs, data, nvs, 0x9000, 0x5000, -otadata, data, ota, 0xe000, 0x2000, -app0, app, ota_0, 0x10000, 0x100000, -ffat, data, fat, 0x110000,0x2F0000, -# to create/use ffat, see https://github.com/marcmerlin/esp32_fatfsimage diff --git a/tools/partitions/noota_ffat.csv b/tools/partitions/noota_ffat.csv deleted file mode 100644 index 69d702f80b2..00000000000 --- a/tools/partitions/noota_ffat.csv +++ /dev/null @@ -1,6 +0,0 @@ -# Name, Type, SubType, Offset, Size, Flags -nvs, data, nvs, 0x9000, 0x5000, -otadata, data, ota, 0xe000, 0x2000, -app0, app, ota_0, 0x10000, 0x200000, -ffat, data, fat, 0x210000,0x1F0000, -# to create/use ffat, see https://github.com/marcmerlin/esp32_fatfsimage diff --git a/tools/platformio-build.py b/tools/platformio-build.py deleted file mode 100644 index 93c021a2bfb..00000000000 --- a/tools/platformio-build.py +++ /dev/null @@ -1,226 +0,0 @@ -# Copyright 2014-present PlatformIO -# -# 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. - -""" -Arduino - -Arduino Wiring-based Framework allows writing cross-platform software to -control devices attached to a wide range of Arduino boards to create all -kinds of creative coding, interactive objects, spaces or physical experiences. - -http://arduino.cc/en/Reference/HomePage -""" - -# Extends: https://github.com/platformio/platform-espressif32/blob/develop/builder/main.py - -from os.path import abspath, isdir, isfile, join - -from SCons.Script import DefaultEnvironment - -env = DefaultEnvironment() -platform = env.PioPlatform() - -FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32") -assert isdir(FRAMEWORK_DIR) - -env.Append( - ASFLAGS=["-x", "assembler-with-cpp"], - - CFLAGS=[ - "-std=gnu99", - "-Wno-old-style-declaration" - ], - - CCFLAGS=[ - "-Os", - "-g3", - "-Wall", - "-nostdlib", - "-Wpointer-arith", - "-Wno-error=unused-but-set-variable", - "-Wno-error=unused-variable", - "-mlongcalls", - "-ffunction-sections", - "-fdata-sections", - "-fstrict-volatile-bitfields", - "-Wno-error=deprecated-declarations", - "-Wno-error=unused-function", - "-Wno-unused-parameter", - "-Wno-sign-compare", - "-fstack-protector", - "-fexceptions", - "-Werror=reorder" - ], - - CXXFLAGS=[ - "-fno-rtti", - "-fno-exceptions", - "-std=gnu++11" - ], - - LINKFLAGS=[ - "-nostdlib", - "-Wl,-static", - "-u", "call_user_start_cpu0", - "-Wl,--undefined=uxTopUsedPriority", - "-Wl,--gc-sections", - "-Wl,-EL", - "-T", "esp32.common.ld", - "-T", "esp32.rom.ld", - "-T", "esp32.peripherals.ld", - "-T", "esp32.rom.libgcc.ld", - "-T", "esp32.rom.spiram_incompatible_fns.ld", - "-u", "ld_include_panic_highint_hdl", - "-u", "__cxa_guard_dummy", - "-u", "__cxx_fatal_exception" - ], - - CPPDEFINES=[ - "ESP32", - "ESP_PLATFORM", - ("F_CPU", "$BOARD_F_CPU"), - "HAVE_CONFIG_H", - ("MBEDTLS_CONFIG_FILE", '\\"mbedtls/esp_config.h\\"'), - ("ARDUINO", 10805), - "ARDUINO_ARCH_ESP32", - ("ARDUINO_VARIANT", '\\"%s\\"' % env.BoardConfig().get("build.variant").replace('"', "")), - ("ARDUINO_BOARD", '\\"%s\\"' % env.BoardConfig().get("name").replace('"', "")) - ], - - CPPPATH=[ - join(FRAMEWORK_DIR, "tools", "sdk", "include", "config"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "app_trace"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "app_update"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "asio"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "bootloader_support"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "bt"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "coap"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "console"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "driver"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "esp-tls"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "esp32"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "esp_adc_cal"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "esp_event"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "esp_http_client"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "esp_http_server"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "esp_https_ota"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "esp_ringbuf"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "ethernet"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "expat"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "fatfs"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "freemodbus"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "freertos"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "heap"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "idf_test"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "jsmn"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "json"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "libsodium"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "log"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "lwip"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "mbedtls"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "mdns"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "micro-ecc"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "mqtt"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "newlib"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "nghttp"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "nvs_flash"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "openssl"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "protobuf-c"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "protocomm"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "pthread"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "sdmmc"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "smartconfig_ack"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "soc"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "spi_flash"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "spiffs"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "tcp_transport"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "tcpip_adapter"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "ulp"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "vfs"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "wear_levelling"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "wifi_provisioning"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "wpa_supplicant"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "xtensa-debug-module"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "esp-face"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "esp32-camera"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "esp-face"), - join(FRAMEWORK_DIR, "tools", "sdk", "include", "fb_gfx"), - join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core")) - ], - - LIBPATH=[ - join(FRAMEWORK_DIR, "tools", "sdk", "lib"), - join(FRAMEWORK_DIR, "tools", "sdk", "ld") - ], - - LIBS=[ - "-lgcc", "-lesp32", "-lphy", "-lesp_http_client", "-lmbedtls", "-lrtc", "-lesp_http_server", "-lbtdm_app", "-lspiffs", "-lbootloader_support", "-lmdns", "-lnvs_flash", "-lfatfs", "-lpp", "-lnet80211", "-ljsmn", "-lface_detection", "-llibsodium", "-lvfs", "-ldl_lib", "-llog", "-lfreertos", "-lcxx", "-lsmartconfig_ack", "-lxtensa-debug-module", "-lheap", "-ltcpip_adapter", "-lmqtt", "-lulp", "-lfd", "-lfb_gfx", "-lnghttp", "-lprotocomm", "-lsmartconfig", "-lm", "-lethernet", "-limage_util", "-lc_nano", "-lsoc", "-ltcp_transport", "-lc", "-lmicro-ecc", "-lface_recognition", "-ljson", "-lwpa_supplicant", "-lmesh", "-lesp_https_ota", "-lwpa2", "-lexpat", "-llwip", "-lwear_levelling", "-lapp_update", "-ldriver", "-lbt", "-lespnow", "-lcoap", "-lasio", "-lnewlib", "-lconsole", "-lapp_trace", "-lesp32-camera", "-lhal", "-lprotobuf-c", "-lsdmmc", "-lcore", "-lpthread", "-lcoexist", "-lfreemodbus", "-lspi_flash", "-lesp-tls", "-lwpa", "-lwifi_provisioning", "-lwps", "-lesp_adc_cal", "-lesp_event", "-lopenssl", "-lesp_ringbuf", "-lfr", "-lstdc++" - ], - - LIBSOURCE_DIRS=[ - join(FRAMEWORK_DIR, "libraries") - ], - - FLASH_EXTRA_IMAGES=[ - ("0x1000", join(FRAMEWORK_DIR, "tools", "sdk", "bin", "bootloader_${BOARD_FLASH_MODE}_${__get_board_f_flash(__env__)}.bin")), - ("0x8000", join(env.subst("$BUILD_DIR"), "partitions.bin")), - ("0xe000", join(FRAMEWORK_DIR, "tools", "partitions", "boot_app0.bin")) - ] -) - -# -# Target: Build Core Library -# - -libs = [] - -if "build.variant" in env.BoardConfig(): - env.Append( - CPPPATH=[ - join(FRAMEWORK_DIR, "variants", - env.BoardConfig().get("build.variant")) - ] - ) - libs.append(env.BuildLibrary( - join("$BUILD_DIR", "FrameworkArduinoVariant"), - join(FRAMEWORK_DIR, "variants", env.BoardConfig().get("build.variant")) - )) - -envsafe = env.Clone() - -libs.append(envsafe.BuildLibrary( - join("$BUILD_DIR", "FrameworkArduino"), - join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core")) -)) - -env.Prepend(LIBS=libs) - -# -# Generate partition table -# - -fwpartitions_dir = join(FRAMEWORK_DIR, "tools", "partitions") -partitions_csv = env.BoardConfig().get("build.partitions", "default.csv") -env.Replace( - PARTITIONS_TABLE_CSV=abspath( - join(fwpartitions_dir, partitions_csv) if isfile( - join(fwpartitions_dir, partitions_csv)) else partitions_csv)) - -partition_table = env.Command( - join("$BUILD_DIR", "partitions.bin"), - "$PARTITIONS_TABLE_CSV", - env.VerboseAction('"$PYTHONEXE" "%s" -q $SOURCE $TARGET' % join( - FRAMEWORK_DIR, "tools", "gen_esp32part.py"), - "Generating partitions $TARGET")) -env.Depends("$BUILD_DIR/$PROGNAME$PROGSUFFIX", partition_table) diff --git a/tools/sdk/bin/bootloader_dio_40m.bin b/tools/sdk/bin/bootloader_dio_40m.bin deleted file mode 100644 index ac057886d98..00000000000 Binary files a/tools/sdk/bin/bootloader_dio_40m.bin and /dev/null differ diff --git a/tools/sdk/bin/bootloader_dio_80m.bin b/tools/sdk/bin/bootloader_dio_80m.bin deleted file mode 100644 index 726e1ca9145..00000000000 Binary files a/tools/sdk/bin/bootloader_dio_80m.bin and /dev/null differ diff --git a/tools/sdk/bin/bootloader_dout_40m.bin b/tools/sdk/bin/bootloader_dout_40m.bin deleted file mode 100644 index eab1e96d1f5..00000000000 Binary files a/tools/sdk/bin/bootloader_dout_40m.bin and /dev/null differ diff --git a/tools/sdk/bin/bootloader_dout_80m.bin b/tools/sdk/bin/bootloader_dout_80m.bin deleted file mode 100644 index 4d1f69f44c1..00000000000 Binary files a/tools/sdk/bin/bootloader_dout_80m.bin and /dev/null differ diff --git a/tools/sdk/bin/bootloader_qio_40m.bin b/tools/sdk/bin/bootloader_qio_40m.bin deleted file mode 100644 index 0c2e9fe279a..00000000000 Binary files a/tools/sdk/bin/bootloader_qio_40m.bin and /dev/null differ diff --git a/tools/sdk/bin/bootloader_qio_80m.bin b/tools/sdk/bin/bootloader_qio_80m.bin deleted file mode 100644 index 944f4947edf..00000000000 Binary files a/tools/sdk/bin/bootloader_qio_80m.bin and /dev/null differ diff --git a/tools/sdk/bin/bootloader_qout_40m.bin b/tools/sdk/bin/bootloader_qout_40m.bin deleted file mode 100644 index 07a6be715c0..00000000000 Binary files a/tools/sdk/bin/bootloader_qout_40m.bin and /dev/null differ diff --git a/tools/sdk/bin/bootloader_qout_80m.bin b/tools/sdk/bin/bootloader_qout_80m.bin deleted file mode 100644 index 8cfb0c2529e..00000000000 Binary files a/tools/sdk/bin/bootloader_qout_80m.bin and /dev/null differ diff --git a/tools/sdk/include/app_trace/esp_app_trace.h b/tools/sdk/include/app_trace/esp_app_trace.h deleted file mode 100644 index dbac4f475e3..00000000000 --- a/tools/sdk/include/app_trace/esp_app_trace.h +++ /dev/null @@ -1,265 +0,0 @@ -// 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. -#ifndef ESP_APP_TRACE_H_ -#define ESP_APP_TRACE_H_ - -#include -#include "esp_err.h" -#include "esp_app_trace_util.h" // ESP_APPTRACE_TMO_INFINITE - -/** - * Application trace data destinations bits. - */ -typedef enum { - ESP_APPTRACE_DEST_TRAX = 0x1, ///< JTAG destination - ESP_APPTRACE_DEST_UART0 = 0x2, ///< UART destination -} esp_apptrace_dest_t; - -/** - * @brief Initializes application tracing module. - * - * @note Should be called before any esp_apptrace_xxx call. - * - * @return ESP_OK on success, otherwise see esp_err_t - */ -esp_err_t esp_apptrace_init(); - -/** - * @brief Configures down buffer. - * @note Needs to be called before initiating any data transfer using esp_apptrace_buffer_get and esp_apptrace_write. - * This function does not protect internal data by lock. - * - * @param buf Address of buffer to use for down channel (host to target) data. - * @param size Size of the buffer. - */ -void esp_apptrace_down_buffer_config(uint8_t *buf, uint32_t size); - -/** - * @brief Allocates buffer for trace data. - * After data in buffer are ready to be sent off esp_apptrace_buffer_put must be called to indicate it. - * - * @param dest Indicates HW interface to send data. - * @param size Size of data to write to trace buffer. - * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinetly. - * - * @return non-NULL on success, otherwise NULL. - */ -uint8_t *esp_apptrace_buffer_get(esp_apptrace_dest_t dest, uint32_t size, uint32_t tmo); - -/** - * @brief Indicates that the data in buffer are ready to be sent off. - * This function is a counterpart of and must be preceeded by esp_apptrace_buffer_get. - * - * @param dest Indicates HW interface to send data. Should be identical to the same parameter in call to esp_apptrace_buffer_get. - * @param ptr Address of trace buffer to release. Should be the value returned by call to esp_apptrace_buffer_get. - * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinetly. - * - * @return ESP_OK on success, otherwise see esp_err_t - */ -esp_err_t esp_apptrace_buffer_put(esp_apptrace_dest_t dest, uint8_t *ptr, uint32_t tmo); - -/** - * @brief Writes data to trace buffer. - * - * @param dest Indicates HW interface to send data. - * @param data Address of data to write to trace buffer. - * @param size Size of data to write to trace buffer. - * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinetly. - * - * @return ESP_OK on success, otherwise see esp_err_t - */ -esp_err_t esp_apptrace_write(esp_apptrace_dest_t dest, const void *data, uint32_t size, uint32_t tmo); - -/** - * @brief vprintf-like function to sent log messages to host via specified HW interface. - * - * @param dest Indicates HW interface to send data. - * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinetly. - * @param fmt Address of format string. - * @param ap List of arguments. - * - * @return Number of bytes written. - */ -int esp_apptrace_vprintf_to(esp_apptrace_dest_t dest, uint32_t tmo, const char *fmt, va_list ap); - -/** - * @brief vprintf-like function to sent log messages to host. - * - * @param fmt Address of format string. - * @param ap List of arguments. - * - * @return Number of bytes written. - */ -int esp_apptrace_vprintf(const char *fmt, va_list ap); - -/** - * @brief Flushes remaining data in trace buffer to host. - * - * @param dest Indicates HW interface to flush data on. - * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinetly. - * - * @return ESP_OK on success, otherwise see esp_err_t - */ -esp_err_t esp_apptrace_flush(esp_apptrace_dest_t dest, uint32_t tmo); - -/** - * @brief Flushes remaining data in trace buffer to host without locking internal data. - * This is special version of esp_apptrace_flush which should be called from panic handler. - * - * @param dest Indicates HW interface to flush data on. - * @param min_sz Threshold for flushing data. If current filling level is above this value, data will be flushed. TRAX destinations only. - * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinetly. - * - * @return ESP_OK on success, otherwise see esp_err_t - */ -esp_err_t esp_apptrace_flush_nolock(esp_apptrace_dest_t dest, uint32_t min_sz, uint32_t tmo); - -/** - * @brief Reads host data from trace buffer. - * - * @param dest Indicates HW interface to read the data on. - * @param data Address of buffer to put data from trace buffer. - * @param size Pointer to store size of read data. Before call to this function pointed memory must hold requested size of data - * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinetly. - * - * @return ESP_OK on success, otherwise see esp_err_t - */ -esp_err_t esp_apptrace_read(esp_apptrace_dest_t dest, void *data, uint32_t *size, uint32_t tmo); - -/** - * @brief Rertrieves incoming data buffer if any. - * After data in buffer are processed esp_apptrace_down_buffer_put must be called to indicate it. - * - * @param dest Indicates HW interface to receive data. - * @param size Address to store size of available data in down buffer. Must be initializaed with requested value. - * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinetly. - * - * @return non-NULL on success, otherwise NULL. - */ -uint8_t *esp_apptrace_down_buffer_get(esp_apptrace_dest_t dest, uint32_t *size, uint32_t tmo); - -/** - * @brief Indicates that the data in down buffer are processesd. - * This function is a counterpart of and must be preceeded by esp_apptrace_down_buffer_get. - * - * @param dest Indicates HW interface to receive data. Should be identical to the same parameter in call to esp_apptrace_down_buffer_get. - * @param ptr Address of trace buffer to release. Should be the value returned by call to esp_apptrace_down_buffer_get. - * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinetly. - * - * @return ESP_OK on success, otherwise see esp_err_t - */ -esp_err_t esp_apptrace_down_buffer_put(esp_apptrace_dest_t dest, uint8_t *ptr, uint32_t tmo); - -/** - * @brief Checks whether host is connected. - * - * @param dest Indicates HW interface to use. - * - * @return true if host is connected, otherwise false - */ -bool esp_apptrace_host_is_connected(esp_apptrace_dest_t dest); - -/** - * @brief Opens file on host. - * This function has the same semantic as 'fopen' except for the first argument. - * - * @param dest Indicates HW interface to use. - * @param path Path to file. - * @param mode Mode string. See fopen for details. - * - * @return non zero file handle on success, otherwise 0 - */ -void *esp_apptrace_fopen(esp_apptrace_dest_t dest, const char *path, const char *mode); - -/** - * @brief Closes file on host. - * This function has the same semantic as 'fclose' except for the first argument. - * - * @param dest Indicates HW interface to use. - * @param stream File handle returned by esp_apptrace_fopen. - * - * @return Zero on success, otherwise non-zero. See fclose for details. - */ -int esp_apptrace_fclose(esp_apptrace_dest_t dest, void *stream); - -/** - * @brief Writes to file on host. - * This function has the same semantic as 'fwrite' except for the first argument. - * - * @param dest Indicates HW interface to use. - * @param ptr Address of data to write. - * @param size Size of an item. - * @param nmemb Number of items to write. - * @param stream File handle returned by esp_apptrace_fopen. - * - * @return Number of written items. See fwrite for details. - */ -size_t esp_apptrace_fwrite(esp_apptrace_dest_t dest, const void *ptr, size_t size, size_t nmemb, void *stream); - -/** - * @brief Read file on host. - * This function has the same semantic as 'fread' except for the first argument. - * - * @param dest Indicates HW interface to use. - * @param ptr Address to store read data. - * @param size Size of an item. - * @param nmemb Number of items to read. - * @param stream File handle returned by esp_apptrace_fopen. - * - * @return Number of read items. See fread for details. - */ -size_t esp_apptrace_fread(esp_apptrace_dest_t dest, void *ptr, size_t size, size_t nmemb, void *stream); - -/** - * @brief Set position indicator in file on host. - * This function has the same semantic as 'fseek' except for the first argument. - * - * @param dest Indicates HW interface to use. - * @param stream File handle returned by esp_apptrace_fopen. - * @param offset Offset. See fseek for details. - * @param whence Position in file. See fseek for details. - * - * @return Zero on success, otherwise non-zero. See fseek for details. - */ -int esp_apptrace_fseek(esp_apptrace_dest_t dest, void *stream, long offset, int whence); - -/** - * @brief Get current position indicator for file on host. - * This function has the same semantic as 'ftell' except for the first argument. - * - * @param dest Indicates HW interface to use. - * @param stream File handle returned by esp_apptrace_fopen. - * - * @return Current position in file. See ftell for details. - */ -int esp_apptrace_ftell(esp_apptrace_dest_t dest, void *stream); - -/** - * @brief Indicates to the host that all file operations are completed. - * This function should be called after all file operations are finished and - * indicate to the host that it can perform cleanup operations (close open files etc.). - * - * @param dest Indicates HW interface to use. - * - * @return ESP_OK on success, otherwise see esp_err_t - */ -int esp_apptrace_fstop(esp_apptrace_dest_t dest); - -/** - * @brief Triggers gcov info dump. - * This function waits for the host to connect to target before dumping data. - */ -void esp_gcov_dump(void); - -#endif diff --git a/tools/sdk/include/app_trace/esp_app_trace_util.h b/tools/sdk/include/app_trace/esp_app_trace_util.h deleted file mode 100644 index 6376008c2f6..00000000000 --- a/tools/sdk/include/app_trace/esp_app_trace_util.h +++ /dev/null @@ -1,167 +0,0 @@ -// 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. -#ifndef ESP_APP_TRACE_UTIL_H_ -#define ESP_APP_TRACE_UTIL_H_ - -#include "freertos/FreeRTOS.h" -#include "esp_err.h" - -/** Infinite waiting timeout */ -#define ESP_APPTRACE_TMO_INFINITE ((uint32_t)-1) - -/** Structure which holds data necessary for measuring time intervals. - * - * After initialization via esp_apptrace_tmo_init() user needs to call esp_apptrace_tmo_check() - * periodically to check timeout for expiration. - */ -typedef struct { - uint32_t start; ///< time interval start (in CPU ticks) - uint32_t tmo; ///< timeout value (in us) - uint32_t elapsed; ///< elapsed time (in us) -} esp_apptrace_tmo_t; - -/** - * @brief Initializes timeout structure. - * - * @param tmo Pointer to timeout structure to be initialized. - * @param user_tmo Timeout value (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinetly. -*/ -static inline void esp_apptrace_tmo_init(esp_apptrace_tmo_t *tmo, uint32_t user_tmo) -{ - tmo->start = portGET_RUN_TIME_COUNTER_VALUE(); - tmo->tmo = user_tmo; - tmo->elapsed = 0; -} - -/** - * @brief Checks timeout for expiration. - * - * @param tmo Pointer to timeout structure to be initialized. - * - * @return ESP_OK on success, otherwise \see esp_err_t - */ -esp_err_t esp_apptrace_tmo_check(esp_apptrace_tmo_t *tmo); - -static inline uint32_t esp_apptrace_tmo_remaining_us(esp_apptrace_tmo_t *tmo) -{ - return tmo->tmo != ESP_APPTRACE_TMO_INFINITE ? (tmo->elapsed - tmo->tmo) : ESP_APPTRACE_TMO_INFINITE; -} - -/** Tracing module synchronization lock */ -typedef struct { - portMUX_TYPE mux; - unsigned int_state; -} esp_apptrace_lock_t; - -/** - * @brief Initializes lock structure. - * - * @param lock Pointer to lock structure to be initialized. - */ -static inline void esp_apptrace_lock_init(esp_apptrace_lock_t *lock) -{ - vPortCPUInitializeMutex(&lock->mux); - lock->int_state = 0; -} - -/** - * @brief Tries to acquire lock in specified time period. - * - * @param lock Pointer to lock structure. - * @param tmo Pointer to timeout struct. - * - * @return ESP_OK on success, otherwise \see esp_err_t - */ -esp_err_t esp_apptrace_lock_take(esp_apptrace_lock_t *lock, esp_apptrace_tmo_t *tmo); - -/** - * @brief Releases lock. - * - * @param lock Pointer to lock structure. - * - * @return ESP_OK on success, otherwise \see esp_err_t - */ -esp_err_t esp_apptrace_lock_give(esp_apptrace_lock_t *lock); - -/** Ring buffer control structure. - * - * @note For purposes of application tracing module if there is no enough space for user data and write pointer can be wrapped - * current ring buffer size can be temporarily shrinked in order to provide buffer with requested size. - */ -typedef struct { - uint8_t *data; ///< pointer to data storage - volatile uint32_t size; ///< size of data storage - volatile uint32_t cur_size; ///< current size of data storage - volatile uint32_t rd; ///< read pointer - volatile uint32_t wr; ///< write pointer -} esp_apptrace_rb_t; - -/** - * @brief Initializes ring buffer control structure. - * - * @param rb Pointer to ring buffer structure to be initialized. - * @param data Pointer to buffer to be used as ring buffer's data storage. - * @param size Size of buffer to be used as ring buffer's data storage. - */ -static inline void esp_apptrace_rb_init(esp_apptrace_rb_t *rb, uint8_t *data, uint32_t size) -{ - rb->data = data; - rb->size = rb->cur_size = size; - rb->rd = 0; - rb->wr = 0; -} - -/** - * @brief Allocates memory chunk in ring buffer. - * - * @param rb Pointer to ring buffer structure. - * @param size Size of the memory to allocate. - * - * @return Pointer to the allocated memory or NULL in case of failure. - */ -uint8_t *esp_apptrace_rb_produce(esp_apptrace_rb_t *rb, uint32_t size); - -/** - * @brief Consumes memory chunk in ring buffer. - * - * @param rb Pointer to ring buffer structure. - * @param size Size of the memory to consume. - * - * @return Pointer to consumed memory chunk or NULL in case of failure. - */ -uint8_t *esp_apptrace_rb_consume(esp_apptrace_rb_t *rb, uint32_t size); - -/** - * @brief Gets size of memory which can consumed with single call to esp_apptrace_rb_consume(). - * - * @param rb Pointer to ring buffer structure. - * - * @return Size of memory which can consumed. - * - * @note Due to read pointer wrapping returned size can be less then the total size of available data. - */ -uint32_t esp_apptrace_rb_read_size_get(esp_apptrace_rb_t *rb); - -/** - * @brief Gets size of memory which can produced with single call to esp_apptrace_rb_produce(). - * - * @param rb Pointer to ring buffer structure. - * - * @return Size of memory which can produced. - * - * @note Due to write pointer wrapping returned size can be less then the total size of available data. - */ -uint32_t esp_apptrace_rb_write_size_get(esp_apptrace_rb_t *rb); - -#endif //ESP_APP_TRACE_UTIL_H_ diff --git a/tools/sdk/include/app_update/esp_ota_ops.h b/tools/sdk/include/app_update/esp_ota_ops.h deleted file mode 100644 index ca77b54226e..00000000000 --- a/tools/sdk/include/app_update/esp_ota_ops.h +++ /dev/null @@ -1,177 +0,0 @@ -// 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. - -#ifndef _OTA_OPS_H -#define _OTA_OPS_H - -#include -#include -#include -#include "esp_err.h" -#include "esp_partition.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -#define OTA_SIZE_UNKNOWN 0xffffffff /*!< Used for esp_ota_begin() if new image size is unknown */ - -#define ESP_ERR_OTA_BASE 0x1500 /*!< Base error code for ota_ops api */ -#define ESP_ERR_OTA_PARTITION_CONFLICT (ESP_ERR_OTA_BASE + 0x01) /*!< Error if request was to write or erase the current running partition */ -#define ESP_ERR_OTA_SELECT_INFO_INVALID (ESP_ERR_OTA_BASE + 0x02) /*!< Error if OTA data partition contains invalid content */ -#define ESP_ERR_OTA_VALIDATE_FAILED (ESP_ERR_OTA_BASE + 0x03) /*!< Error if OTA app image is invalid */ - -/** - * @brief Opaque handle for an application OTA update - * - * esp_ota_begin() returns a handle which is then used for subsequent - * calls to esp_ota_write() and esp_ota_end(). - */ -typedef uint32_t esp_ota_handle_t; - -/** - * @brief Commence an OTA update writing to the specified partition. - - * The specified partition is erased to the specified image size. - * - * If image size is not yet known, pass OTA_SIZE_UNKNOWN which will - * cause the entire partition to be erased. - * - * On success, this function allocates memory that remains in use - * until esp_ota_end() is called with the returned handle. - * - * @param partition Pointer to info for partition which will receive the OTA update. Required. - * @param image_size Size of new OTA app image. Partition will be erased in order to receive this size of image. If 0 or OTA_SIZE_UNKNOWN, the entire partition is erased. - * @param out_handle On success, returns a handle which should be used for subsequent esp_ota_write() and esp_ota_end() calls. - - * @return - * - ESP_OK: OTA operation commenced successfully. - * - ESP_ERR_INVALID_ARG: partition or out_handle arguments were NULL, or partition doesn't point to an OTA app partition. - * - ESP_ERR_NO_MEM: Cannot allocate memory for OTA operation. - * - ESP_ERR_OTA_PARTITION_CONFLICT: Partition holds the currently running firmware, cannot update in place. - * - ESP_ERR_NOT_FOUND: Partition argument not found in partition table. - * - ESP_ERR_OTA_SELECT_INFO_INVALID: The OTA data partition contains invalid data. - * - ESP_ERR_INVALID_SIZE: Partition doesn't fit in configured flash size. - * - ESP_ERR_FLASH_OP_TIMEOUT or ESP_ERR_FLASH_OP_FAIL: Flash write failed. - */ -esp_err_t esp_ota_begin(const esp_partition_t* partition, size_t image_size, esp_ota_handle_t* out_handle); - -/** - * @brief Write OTA update data to partition - * - * This function can be called multiple times as - * data is received during the OTA operation. Data is written - * sequentially to the partition. - * - * @param handle Handle obtained from esp_ota_begin - * @param data Data buffer to write - * @param size Size of data buffer in bytes. - * - * @return - * - ESP_OK: Data was written to flash successfully. - * - ESP_ERR_INVALID_ARG: handle is invalid. - * - ESP_ERR_OTA_VALIDATE_FAILED: First byte of image contains invalid app image magic byte. - * - ESP_ERR_FLASH_OP_TIMEOUT or ESP_ERR_FLASH_OP_FAIL: Flash write failed. - * - ESP_ERR_OTA_SELECT_INFO_INVALID: OTA data partition has invalid contents - */ -esp_err_t esp_ota_write(esp_ota_handle_t handle, const void* data, size_t size); - -/** - * @brief Finish OTA update and validate newly written app image. - * - * @param handle Handle obtained from esp_ota_begin(). - * - * @note After calling esp_ota_end(), the handle is no longer valid and any memory associated with it is freed (regardless of result). - * - * @return - * - ESP_OK: Newly written OTA app image is valid. - * - ESP_ERR_NOT_FOUND: OTA handle was not found. - * - ESP_ERR_INVALID_ARG: Handle was never written to. - * - ESP_ERR_OTA_VALIDATE_FAILED: OTA image is invalid (either not a valid app image, or - if secure boot is enabled - signature failed to verify.) - * - ESP_ERR_INVALID_STATE: If flash encryption is enabled, this result indicates an internal error writing the final encrypted bytes to flash. - */ -esp_err_t esp_ota_end(esp_ota_handle_t handle); - -/** - * @brief Configure OTA data for a new boot partition - * - * @note If this function returns ESP_OK, calling esp_restart() will boot the newly configured app partition. - * - * @param partition Pointer to info for partition containing app image to boot. - * - * @return - * - ESP_OK: OTA data updated, next reboot will use specified partition. - * - ESP_ERR_INVALID_ARG: partition argument was NULL or didn't point to a valid OTA partition of type "app". - * - ESP_ERR_OTA_VALIDATE_FAILED: Partition contained invalid app image. Also returned if secure boot is enabled and signature validation failed. - * - ESP_ERR_NOT_FOUND: OTA data partition not found. - * - ESP_ERR_FLASH_OP_TIMEOUT or ESP_ERR_FLASH_OP_FAIL: Flash erase or write failed. - */ -esp_err_t esp_ota_set_boot_partition(const esp_partition_t* partition); - -/** - * @brief Get partition info of currently configured boot app - * - * If esp_ota_set_boot_partition() has been called, the partition which was set by that function will be returned. - * - * If esp_ota_set_boot_partition() has not been called, the result is usually the same as esp_ota_get_running_partition(). - * The two results are not equal if the configured boot partition does not contain a valid app (meaning that the running partition - * will be an app that the bootloader chose via fallback). - * - * If the OTA data partition is not present or not valid then the result is the first app partition found in the - * partition table. In priority order, this means: the factory app, the first OTA app slot, or the test app partition. - * - * Note that there is no guarantee the returned partition is a valid app. Use esp_image_verify(ESP_IMAGE_VERIFY, ...) to verify if the - * returned partition contains a bootable image. - * - * @return Pointer to info for partition structure, or NULL if partition table is invalid or a flash read operation failed. Any returned pointer is valid for the lifetime of the application. - */ -const esp_partition_t* esp_ota_get_boot_partition(void); - - -/** - * @brief Get partition info of currently running app - * - * This function is different to esp_ota_get_boot_partition() in that - * it ignores any change of selected boot partition caused by - * esp_ota_set_boot_partition(). Only the app whose code is currently - * running will have its partition information returned. - * - * The partition returned by this function may also differ from esp_ota_get_boot_partition() if the configured boot - * partition is somehow invalid, and the bootloader fell back to a different app partition at boot. - * - * @return Pointer to info for partition structure, or NULL if no partition is found or flash read operation failed. Returned pointer is valid for the lifetime of the application. - */ -const esp_partition_t* esp_ota_get_running_partition(void); - - -/** - * @brief Return the next OTA app partition which should be written with a new firmware. - * - * Call this function to find an OTA app partition which can be passed to esp_ota_begin(). - * - * Finds next partition round-robin, starting from the current running partition. - * - * @param start_from If set, treat this partition info as describing the current running partition. Can be NULL, in which case esp_ota_get_running_partition() is used to find the currently running partition. The result of this function is never the same as this argument. - * - * @return Pointer to info for partition which should be updated next. NULL result indicates invalid OTA data partition, or that no eligible OTA app slot partition was found. - * - */ -const esp_partition_t* esp_ota_get_next_update_partition(const esp_partition_t *start_from); - -#ifdef __cplusplus -} -#endif - -#endif /* OTA_OPS_H */ diff --git a/tools/sdk/include/asio/asio.hpp b/tools/sdk/include/asio/asio.hpp deleted file mode 100644 index 6a58006b6ed..00000000000 --- a/tools/sdk/include/asio/asio.hpp +++ /dev/null @@ -1,156 +0,0 @@ -// -// asio.hpp -// ~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_HPP -#define ASIO_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#if defined(ESP_PLATFORM) -# include "esp_asio_config.h" -#endif // defined(ESP_PLATFORM) - -#include "asio/associated_allocator.hpp" -#include "asio/associated_executor.hpp" -#include "asio/async_result.hpp" -#include "asio/basic_datagram_socket.hpp" -#include "asio/basic_deadline_timer.hpp" -#include "asio/basic_io_object.hpp" -#include "asio/basic_raw_socket.hpp" -#include "asio/basic_seq_packet_socket.hpp" -#include "asio/basic_serial_port.hpp" -#include "asio/basic_signal_set.hpp" -#include "asio/basic_socket_acceptor.hpp" -#include "asio/basic_socket_iostream.hpp" -#include "asio/basic_socket_streambuf.hpp" -#include "asio/basic_stream_socket.hpp" -#include "asio/basic_streambuf.hpp" -#include "asio/basic_waitable_timer.hpp" -#include "asio/bind_executor.hpp" -#include "asio/buffer.hpp" -#include "asio/buffered_read_stream_fwd.hpp" -#include "asio/buffered_read_stream.hpp" -#include "asio/buffered_stream_fwd.hpp" -#include "asio/buffered_stream.hpp" -#include "asio/buffered_write_stream_fwd.hpp" -#include "asio/buffered_write_stream.hpp" -#include "asio/buffers_iterator.hpp" -#include "asio/completion_condition.hpp" -#include "asio/connect.hpp" -#include "asio/coroutine.hpp" -#include "asio/datagram_socket_service.hpp" -#include "asio/deadline_timer_service.hpp" -#include "asio/deadline_timer.hpp" -#include "asio/defer.hpp" -#include "asio/dispatch.hpp" -#include "asio/error.hpp" -#include "asio/error_code.hpp" -#include "asio/execution_context.hpp" -#include "asio/executor.hpp" -#include "asio/executor_work_guard.hpp" -#include "asio/generic/basic_endpoint.hpp" -#include "asio/generic/datagram_protocol.hpp" -#include "asio/generic/raw_protocol.hpp" -#include "asio/generic/seq_packet_protocol.hpp" -#include "asio/generic/stream_protocol.hpp" -#include "asio/handler_alloc_hook.hpp" -#include "asio/handler_continuation_hook.hpp" -#include "asio/handler_invoke_hook.hpp" -#include "asio/handler_type.hpp" -#include "asio/high_resolution_timer.hpp" -#include "asio/io_context.hpp" -#include "asio/io_context_strand.hpp" -#include "asio/io_service.hpp" -#include "asio/io_service_strand.hpp" -#include "asio/ip/address.hpp" -#include "asio/ip/address_v4.hpp" -#include "asio/ip/address_v4_iterator.hpp" -#include "asio/ip/address_v4_range.hpp" -#include "asio/ip/address_v6.hpp" -#include "asio/ip/address_v6_iterator.hpp" -#include "asio/ip/address_v6_range.hpp" -#include "asio/ip/bad_address_cast.hpp" -#include "asio/ip/basic_endpoint.hpp" -#include "asio/ip/basic_resolver.hpp" -#include "asio/ip/basic_resolver_entry.hpp" -#include "asio/ip/basic_resolver_iterator.hpp" -#include "asio/ip/basic_resolver_query.hpp" -#include "asio/ip/host_name.hpp" -#include "asio/ip/icmp.hpp" -#include "asio/ip/multicast.hpp" -#include "asio/ip/resolver_base.hpp" -#include "asio/ip/resolver_query_base.hpp" -#include "asio/ip/resolver_service.hpp" -#include "asio/ip/tcp.hpp" -#include "asio/ip/udp.hpp" -#include "asio/ip/unicast.hpp" -#include "asio/ip/v6_only.hpp" -#include "asio/is_executor.hpp" -#include "asio/is_read_buffered.hpp" -#include "asio/is_write_buffered.hpp" -#include "asio/local/basic_endpoint.hpp" -#include "asio/local/connect_pair.hpp" -#include "asio/local/datagram_protocol.hpp" -#include "asio/local/stream_protocol.hpp" -#include "asio/packaged_task.hpp" -#include "asio/placeholders.hpp" -#include "asio/posix/basic_descriptor.hpp" -#include "asio/posix/basic_stream_descriptor.hpp" -#include "asio/posix/descriptor.hpp" -#include "asio/posix/descriptor_base.hpp" -#include "asio/posix/stream_descriptor.hpp" -#include "asio/posix/stream_descriptor_service.hpp" -#include "asio/post.hpp" -#include "asio/raw_socket_service.hpp" -#include "asio/read.hpp" -#include "asio/read_at.hpp" -#include "asio/read_until.hpp" -#include "asio/seq_packet_socket_service.hpp" -#include "asio/serial_port.hpp" -#include "asio/serial_port_base.hpp" -#include "asio/serial_port_service.hpp" -#include "asio/signal_set.hpp" -#include "asio/signal_set_service.hpp" -#include "asio/socket_acceptor_service.hpp" -#include "asio/socket_base.hpp" -#include "asio/steady_timer.hpp" -#include "asio/strand.hpp" -#include "asio/stream_socket_service.hpp" -#include "asio/streambuf.hpp" -#include "asio/system_context.hpp" -#include "asio/system_error.hpp" -#include "asio/system_executor.hpp" -#include "asio/system_timer.hpp" -#include "asio/thread.hpp" -#include "asio/thread_pool.hpp" -#include "asio/time_traits.hpp" -#include "asio/use_future.hpp" -#include "asio/uses_executor.hpp" -#include "asio/version.hpp" -#include "asio/wait_traits.hpp" -#include "asio/waitable_timer_service.hpp" -#include "asio/windows/basic_handle.hpp" -#include "asio/windows/basic_object_handle.hpp" -#include "asio/windows/basic_random_access_handle.hpp" -#include "asio/windows/basic_stream_handle.hpp" -#include "asio/windows/object_handle.hpp" -#include "asio/windows/object_handle_service.hpp" -#include "asio/windows/overlapped_handle.hpp" -#include "asio/windows/overlapped_ptr.hpp" -#include "asio/windows/random_access_handle.hpp" -#include "asio/windows/random_access_handle_service.hpp" -#include "asio/windows/stream_handle.hpp" -#include "asio/windows/stream_handle_service.hpp" -#include "asio/write.hpp" -#include "asio/write_at.hpp" - -#endif // ASIO_HPP diff --git a/tools/sdk/include/asio/asio/associated_allocator.hpp b/tools/sdk/include/asio/asio/associated_allocator.hpp deleted file mode 100644 index 8b488bb344e..00000000000 --- a/tools/sdk/include/asio/asio/associated_allocator.hpp +++ /dev/null @@ -1,131 +0,0 @@ -// -// associated_allocator.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_ASSOCIATED_ALLOCATOR_HPP -#define ASIO_ASSOCIATED_ALLOCATOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/detail/type_traits.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -struct associated_allocator_check -{ - typedef void type; -}; - -template -struct associated_allocator_impl -{ - typedef E type; - - static type get(const T&, const E& e) ASIO_NOEXCEPT - { - return e; - } -}; - -template -struct associated_allocator_impl::type> -{ - typedef typename T::allocator_type type; - - static type get(const T& t, const E&) ASIO_NOEXCEPT - { - return t.get_allocator(); - } -}; - -} // namespace detail - -/// Traits type used to obtain the allocator associated with an object. -/** - * A program may specialise this traits type if the @c T template parameter in - * the specialisation is a user-defined type. The template parameter @c - * Allocator shall be a type meeting the Allocator requirements. - * - * Specialisations shall meet the following requirements, where @c t is a const - * reference to an object of type @c T, and @c a is an object of type @c - * Allocator. - * - * @li Provide a nested typedef @c type that identifies a type meeting the - * Allocator requirements. - * - * @li Provide a noexcept static member function named @c get, callable as @c - * get(t) and with return type @c type. - * - * @li Provide a noexcept static member function named @c get, callable as @c - * get(t,a) and with return type @c type. - */ -template > -struct associated_allocator -{ - /// If @c T has a nested type @c allocator_type, T::allocator_type. - /// Otherwise @c Allocator. -#if defined(GENERATING_DOCUMENTATION) - typedef see_below type; -#else // defined(GENERATING_DOCUMENTATION) - typedef typename detail::associated_allocator_impl::type type; -#endif // defined(GENERATING_DOCUMENTATION) - - /// If @c T has a nested type @c allocator_type, returns - /// t.get_allocator(). Otherwise returns @c a. - static type get(const T& t, - const Allocator& a = Allocator()) ASIO_NOEXCEPT - { - return detail::associated_allocator_impl::get(t, a); - } -}; - -/// Helper function to obtain an object's associated allocator. -/** - * @returns associated_allocator::get(t) - */ -template -inline typename associated_allocator::type -get_associated_allocator(const T& t) ASIO_NOEXCEPT -{ - return associated_allocator::get(t); -} - -/// Helper function to obtain an object's associated allocator. -/** - * @returns associated_allocator::get(t, a) - */ -template -inline typename associated_allocator::type -get_associated_allocator(const T& t, const Allocator& a) ASIO_NOEXCEPT -{ - return associated_allocator::get(t, a); -} - -#if defined(ASIO_HAS_ALIAS_TEMPLATES) - -template > -using associated_allocator_t - = typename associated_allocator::type; - -#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_ASSOCIATED_ALLOCATOR_HPP diff --git a/tools/sdk/include/asio/asio/associated_executor.hpp b/tools/sdk/include/asio/asio/associated_executor.hpp deleted file mode 100644 index 4c5c2078848..00000000000 --- a/tools/sdk/include/asio/asio/associated_executor.hpp +++ /dev/null @@ -1,149 +0,0 @@ -// -// associated_executor.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_ASSOCIATED_EXECUTOR_HPP -#define ASIO_ASSOCIATED_EXECUTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/is_executor.hpp" -#include "asio/system_executor.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -struct associated_executor_check -{ - typedef void type; -}; - -template -struct associated_executor_impl -{ - typedef E type; - - static type get(const T&, const E& e) ASIO_NOEXCEPT - { - return e; - } -}; - -template -struct associated_executor_impl::type> -{ - typedef typename T::executor_type type; - - static type get(const T& t, const E&) ASIO_NOEXCEPT - { - return t.get_executor(); - } -}; - -} // namespace detail - -/// Traits type used to obtain the executor associated with an object. -/** - * A program may specialise this traits type if the @c T template parameter in - * the specialisation is a user-defined type. The template parameter @c - * Executor shall be a type meeting the Executor requirements. - * - * Specialisations shall meet the following requirements, where @c t is a const - * reference to an object of type @c T, and @c e is an object of type @c - * Executor. - * - * @li Provide a nested typedef @c type that identifies a type meeting the - * Executor requirements. - * - * @li Provide a noexcept static member function named @c get, callable as @c - * get(t) and with return type @c type. - * - * @li Provide a noexcept static member function named @c get, callable as @c - * get(t,e) and with return type @c type. - */ -template -struct associated_executor -{ - /// If @c T has a nested type @c executor_type, T::executor_type. - /// Otherwise @c Executor. -#if defined(GENERATING_DOCUMENTATION) - typedef see_below type; -#else // defined(GENERATING_DOCUMENTATION) - typedef typename detail::associated_executor_impl::type type; -#endif // defined(GENERATING_DOCUMENTATION) - - /// If @c T has a nested type @c executor_type, returns - /// t.get_executor(). Otherwise returns @c ex. - static type get(const T& t, - const Executor& ex = Executor()) ASIO_NOEXCEPT - { - return detail::associated_executor_impl::get(t, ex); - } -}; - -/// Helper function to obtain an object's associated executor. -/** - * @returns associated_executor::get(t) - */ -template -inline typename associated_executor::type -get_associated_executor(const T& t) ASIO_NOEXCEPT -{ - return associated_executor::get(t); -} - -/// Helper function to obtain an object's associated executor. -/** - * @returns associated_executor::get(t, ex) - */ -template -inline typename associated_executor::type -get_associated_executor(const T& t, const Executor& ex, - typename enable_if::value>::type* = 0) ASIO_NOEXCEPT -{ - return associated_executor::get(t, ex); -} - -/// Helper function to obtain an object's associated executor. -/** - * @returns associated_executor::get(t, ctx.get_executor()) - */ -template -inline typename associated_executor::type -get_associated_executor(const T& t, ExecutionContext& ctx, - typename enable_if::value>::type* = 0) ASIO_NOEXCEPT -{ - return associated_executor::get(t, ctx.get_executor()); -} - -#if defined(ASIO_HAS_ALIAS_TEMPLATES) - -template -using associated_executor_t = typename associated_executor::type; - -#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_ASSOCIATED_EXECUTOR_HPP diff --git a/tools/sdk/include/asio/asio/async_result.hpp b/tools/sdk/include/asio/asio/async_result.hpp deleted file mode 100644 index 18acdf20a20..00000000000 --- a/tools/sdk/include/asio/asio/async_result.hpp +++ /dev/null @@ -1,221 +0,0 @@ -// -// async_result.hpp -// ~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_ASYNC_RESULT_HPP -#define ASIO_ASYNC_RESULT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/handler_type.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// An interface for customising the behaviour of an initiating function. -/** - * The async_result traits class is used for determining: - * - * @li the concrete completion handler type to be called at the end of the - * asynchronous operation; - * - * @li the initiating function return type; and - * - * @li how the return value of the initiating function is obtained. - * - * The trait allows the handler and return types to be determined at the point - * where the specific completion handler signature is known. - * - * This template may be specialised for user-defined completion token types. - * The primary template assumes that the CompletionToken is the completion - * handler. - */ -#if defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) -template -#else // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) -template -#endif // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) -class async_result -{ -public: -#if defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) - /// The concrete completion handler type for the specific signature. - typedef CompletionToken completion_handler_type; - - /// The return type of the initiating function. - typedef void return_type; -#else // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) - // For backward compatibility, determine the concrete completion handler type - // by using the legacy handler_type trait. - typedef typename handler_type::type - completion_handler_type; - - // For backward compatibility, determine the initiating function return type - // using the legacy single-parameter version of async_result. - typedef typename async_result::type return_type; -#endif // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) - - /// Construct an async result from a given handler. - /** - * When using a specalised async_result, the constructor has an opportunity - * to initialise some state associated with the completion handler, which is - * then returned from the initiating function. - */ - explicit async_result(completion_handler_type& h) -#if defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) - // No data members to initialise. -#else // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) - : legacy_result_(h) -#endif // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) - { - (void)h; - } - - /// Obtain the value to be returned from the initiating function. - return_type get() - { -#if defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) - // Nothing to do. -#else // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) - return legacy_result_.get(); -#endif // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) - } - -private: - async_result(const async_result&) ASIO_DELETED; - async_result& operator=(const async_result&) ASIO_DELETED; - -#if defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) - // No data members. -#else // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) - async_result legacy_result_; -#endif // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) -}; - -#if !defined(ASIO_NO_DEPRECATED) - -/// (Deprecated: Use two-parameter version of async_result.) An interface for -/// customising the behaviour of an initiating function. -/** - * This template may be specialised for user-defined handler types. - */ -template -class async_result -{ -public: - /// The return type of the initiating function. - typedef void type; - - /// Construct an async result from a given handler. - /** - * When using a specalised async_result, the constructor has an opportunity - * to initialise some state associated with the handler, which is then - * returned from the initiating function. - */ - explicit async_result(Handler&) - { - } - - /// Obtain the value to be returned from the initiating function. - type get() - { - } -}; - -#endif // !defined(ASIO_NO_DEPRECATED) - -/// Helper template to deduce the handler type from a CompletionToken, capture -/// a local copy of the handler, and then create an async_result for the -/// handler. -template -struct async_completion -{ - /// The real handler type to be used for the asynchronous operation. - typedef typename asio::async_result< - typename decay::type, - Signature>::completion_handler_type completion_handler_type; - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Constructor. - /** - * The constructor creates the concrete completion handler and makes the link - * between the handler and the asynchronous result. - */ - explicit async_completion(CompletionToken& token) - : completion_handler(static_cast::value, - completion_handler_type&, CompletionToken&&>::type>(token)), - result(completion_handler) - { - } -#else // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - explicit async_completion(typename decay::type& token) - : completion_handler(token), - result(completion_handler) - { - } - - explicit async_completion(const typename decay::type& token) - : completion_handler(token), - result(completion_handler) - { - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// A copy of, or reference to, a real handler object. -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - typename conditional< - is_same::value, - completion_handler_type&, completion_handler_type>::type completion_handler; -#else // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - completion_handler_type completion_handler; -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// The result of the asynchronous operation's initiating function. - async_result::type, Signature> result; -}; - -namespace detail { - -template -struct async_result_helper - : async_result::type, Signature> -{ -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(GENERATING_DOCUMENTATION) -# define ASIO_INITFN_RESULT_TYPE(ct, sig) \ - void_or_deduced -#elif defined(_MSC_VER) && (_MSC_VER < 1500) -# define ASIO_INITFN_RESULT_TYPE(ct, sig) \ - typename ::asio::detail::async_result_helper< \ - ct, sig>::return_type -#define ASIO_HANDLER_TYPE(ct, sig) \ - typename ::asio::detail::async_result_helper< \ - ct, sig>::completion_handler_type -#else -# define ASIO_INITFN_RESULT_TYPE(ct, sig) \ - typename ::asio::async_result< \ - typename ::asio::decay::type, sig>::return_type -#define ASIO_HANDLER_TYPE(ct, sig) \ - typename ::asio::async_result< \ - typename ::asio::decay::type, sig>::completion_handler_type -#endif - -#endif // ASIO_ASYNC_RESULT_HPP diff --git a/tools/sdk/include/asio/asio/basic_datagram_socket.hpp b/tools/sdk/include/asio/asio/basic_datagram_socket.hpp deleted file mode 100644 index 346cc353f5f..00000000000 --- a/tools/sdk/include/asio/asio/basic_datagram_socket.hpp +++ /dev/null @@ -1,1040 +0,0 @@ -// -// basic_datagram_socket.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_BASIC_DATAGRAM_SOCKET_HPP -#define ASIO_BASIC_DATAGRAM_SOCKET_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/basic_socket.hpp" -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/error.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) -# include "asio/datagram_socket_service.hpp" -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Provides datagram-oriented socket functionality. -/** - * The basic_datagram_socket class template provides asynchronous and blocking - * datagram-oriented socket functionality. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -template )> -class basic_datagram_socket - : public basic_socket -{ -public: - /// The native representation of a socket. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined native_handle_type; -#else - typedef typename basic_socket< - Protocol ASIO_SVC_TARG>::native_handle_type native_handle_type; -#endif - - /// The protocol type. - typedef Protocol protocol_type; - - /// The endpoint type. - typedef typename Protocol::endpoint endpoint_type; - - /// Construct a basic_datagram_socket without opening it. - /** - * This constructor creates a datagram socket without opening it. The open() - * function must be called before data can be sent or received on the socket. - * - * @param io_context The io_context object that the datagram socket will use - * to dispatch handlers for any asynchronous operations performed on the - * socket. - */ - explicit basic_datagram_socket(asio::io_context& io_context) - : basic_socket(io_context) - { - } - - /// Construct and open a basic_datagram_socket. - /** - * This constructor creates and opens a datagram socket. - * - * @param io_context The io_context object that the datagram socket will use - * to dispatch handlers for any asynchronous operations performed on the - * socket. - * - * @param protocol An object specifying protocol parameters to be used. - * - * @throws asio::system_error Thrown on failure. - */ - basic_datagram_socket(asio::io_context& io_context, - const protocol_type& protocol) - : basic_socket(io_context, protocol) - { - } - - /// Construct a basic_datagram_socket, opening it and binding it to the given - /// local endpoint. - /** - * This constructor creates a datagram socket and automatically opens it bound - * to the specified endpoint on the local machine. The protocol used is the - * protocol associated with the given endpoint. - * - * @param io_context The io_context object that the datagram socket will use - * to dispatch handlers for any asynchronous operations performed on the - * socket. - * - * @param endpoint An endpoint on the local machine to which the datagram - * socket will be bound. - * - * @throws asio::system_error Thrown on failure. - */ - basic_datagram_socket(asio::io_context& io_context, - const endpoint_type& endpoint) - : basic_socket(io_context, endpoint) - { - } - - /// Construct a basic_datagram_socket on an existing native socket. - /** - * This constructor creates a datagram socket object to hold an existing - * native socket. - * - * @param io_context The io_context object that the datagram socket will use - * to dispatch handlers for any asynchronous operations performed on the - * socket. - * - * @param protocol An object specifying protocol parameters to be used. - * - * @param native_socket The new underlying socket implementation. - * - * @throws asio::system_error Thrown on failure. - */ - basic_datagram_socket(asio::io_context& io_context, - const protocol_type& protocol, const native_handle_type& native_socket) - : basic_socket( - io_context, protocol, native_socket) - { - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a basic_datagram_socket from another. - /** - * This constructor moves a datagram socket from one object to another. - * - * @param other The other basic_datagram_socket object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_datagram_socket(io_context&) constructor. - */ - basic_datagram_socket(basic_datagram_socket&& other) - : basic_socket(std::move(other)) - { - } - - /// Move-assign a basic_datagram_socket from another. - /** - * This assignment operator moves a datagram socket from one object to - * another. - * - * @param other The other basic_datagram_socket object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_datagram_socket(io_context&) constructor. - */ - basic_datagram_socket& operator=(basic_datagram_socket&& other) - { - basic_socket::operator=(std::move(other)); - return *this; - } - - /// Move-construct a basic_datagram_socket from a socket of another protocol - /// type. - /** - * This constructor moves a datagram socket from one object to another. - * - * @param other The other basic_datagram_socket object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_datagram_socket(io_context&) constructor. - */ - template - basic_datagram_socket( - basic_datagram_socket&& other, - typename enable_if::value>::type* = 0) - : basic_socket(std::move(other)) - { - } - - /// Move-assign a basic_datagram_socket from a socket of another protocol - /// type. - /** - * This assignment operator moves a datagram socket from one object to - * another. - * - * @param other The other basic_datagram_socket object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_datagram_socket(io_context&) constructor. - */ - template - typename enable_if::value, - basic_datagram_socket>::type& operator=( - basic_datagram_socket&& other) - { - basic_socket::operator=(std::move(other)); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destroys the socket. - /** - * This function destroys the socket, cancelling any outstanding asynchronous - * operations associated with the socket as if by calling @c cancel. - */ - ~basic_datagram_socket() - { - } - - /// Send some data on a connected socket. - /** - * This function is used to send data on the datagram socket. The function - * call will block until the data has been sent successfully or an error - * occurs. - * - * @param buffers One ore more data buffers to be sent on the socket. - * - * @returns The number of bytes sent. - * - * @throws asio::system_error Thrown on failure. - * - * @note The send operation can only be used with a connected socket. Use - * the send_to function to send data on an unconnected datagram socket. - * - * @par Example - * To send a single data buffer use the @ref buffer function as follows: - * @code socket.send(asio::buffer(data, size)); @endcode - * See the @ref buffer documentation for information on sending multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t send(const ConstBufferSequence& buffers) - { - asio::error_code ec; - std::size_t s = this->get_service().send( - this->get_implementation(), buffers, 0, ec); - asio::detail::throw_error(ec, "send"); - return s; - } - - /// Send some data on a connected socket. - /** - * This function is used to send data on the datagram socket. The function - * call will block until the data has been sent successfully or an error - * occurs. - * - * @param buffers One ore more data buffers to be sent on the socket. - * - * @param flags Flags specifying how the send call is to be made. - * - * @returns The number of bytes sent. - * - * @throws asio::system_error Thrown on failure. - * - * @note The send operation can only be used with a connected socket. Use - * the send_to function to send data on an unconnected datagram socket. - */ - template - std::size_t send(const ConstBufferSequence& buffers, - socket_base::message_flags flags) - { - asio::error_code ec; - std::size_t s = this->get_service().send( - this->get_implementation(), buffers, flags, ec); - asio::detail::throw_error(ec, "send"); - return s; - } - - /// Send some data on a connected socket. - /** - * This function is used to send data on the datagram socket. The function - * call will block until the data has been sent successfully or an error - * occurs. - * - * @param buffers One or more data buffers to be sent on the socket. - * - * @param flags Flags specifying how the send call is to be made. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes sent. - * - * @note The send operation can only be used with a connected socket. Use - * the send_to function to send data on an unconnected datagram socket. - */ - template - std::size_t send(const ConstBufferSequence& buffers, - socket_base::message_flags flags, asio::error_code& ec) - { - return this->get_service().send( - this->get_implementation(), buffers, flags, ec); - } - - /// Start an asynchronous send on a connected socket. - /** - * This function is used to asynchronously send data on the datagram socket. - * The function call always returns immediately. - * - * @param buffers One or more data buffers to be sent on the socket. Although - * the buffers object may be copied as necessary, ownership of the underlying - * memory blocks is retained by the caller, which must guarantee that they - * remain valid until the handler is called. - * - * @param handler The handler to be called when the send operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes sent. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The async_send operation can only be used with a connected socket. - * Use the async_send_to function to send data on an unconnected datagram - * socket. - * - * @par Example - * To send a single data buffer use the @ref buffer function as follows: - * @code - * socket.async_send(asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on sending multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_send(const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_send(this->get_implementation(), - buffers, 0, ASIO_MOVE_CAST(WriteHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_send(this->get_implementation(), - buffers, 0, init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Start an asynchronous send on a connected socket. - /** - * This function is used to asynchronously send data on the datagram socket. - * The function call always returns immediately. - * - * @param buffers One or more data buffers to be sent on the socket. Although - * the buffers object may be copied as necessary, ownership of the underlying - * memory blocks is retained by the caller, which must guarantee that they - * remain valid until the handler is called. - * - * @param flags Flags specifying how the send call is to be made. - * - * @param handler The handler to be called when the send operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes sent. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The async_send operation can only be used with a connected socket. - * Use the async_send_to function to send data on an unconnected datagram - * socket. - */ - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_send(const ConstBufferSequence& buffers, - socket_base::message_flags flags, - ASIO_MOVE_ARG(WriteHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_send(this->get_implementation(), - buffers, flags, ASIO_MOVE_CAST(WriteHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_send(this->get_implementation(), - buffers, flags, init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Send a datagram to the specified endpoint. - /** - * This function is used to send a datagram to the specified remote endpoint. - * The function call will block until the data has been sent successfully or - * an error occurs. - * - * @param buffers One or more data buffers to be sent to the remote endpoint. - * - * @param destination The remote endpoint to which the data will be sent. - * - * @returns The number of bytes sent. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * To send a single data buffer use the @ref buffer function as follows: - * @code - * asio::ip::udp::endpoint destination( - * asio::ip::address::from_string("1.2.3.4"), 12345); - * socket.send_to(asio::buffer(data, size), destination); - * @endcode - * See the @ref buffer documentation for information on sending multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t send_to(const ConstBufferSequence& buffers, - const endpoint_type& destination) - { - asio::error_code ec; - std::size_t s = this->get_service().send_to( - this->get_implementation(), buffers, destination, 0, ec); - asio::detail::throw_error(ec, "send_to"); - return s; - } - - /// Send a datagram to the specified endpoint. - /** - * This function is used to send a datagram to the specified remote endpoint. - * The function call will block until the data has been sent successfully or - * an error occurs. - * - * @param buffers One or more data buffers to be sent to the remote endpoint. - * - * @param destination The remote endpoint to which the data will be sent. - * - * @param flags Flags specifying how the send call is to be made. - * - * @returns The number of bytes sent. - * - * @throws asio::system_error Thrown on failure. - */ - template - std::size_t send_to(const ConstBufferSequence& buffers, - const endpoint_type& destination, socket_base::message_flags flags) - { - asio::error_code ec; - std::size_t s = this->get_service().send_to( - this->get_implementation(), buffers, destination, flags, ec); - asio::detail::throw_error(ec, "send_to"); - return s; - } - - /// Send a datagram to the specified endpoint. - /** - * This function is used to send a datagram to the specified remote endpoint. - * The function call will block until the data has been sent successfully or - * an error occurs. - * - * @param buffers One or more data buffers to be sent to the remote endpoint. - * - * @param destination The remote endpoint to which the data will be sent. - * - * @param flags Flags specifying how the send call is to be made. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes sent. - */ - template - std::size_t send_to(const ConstBufferSequence& buffers, - const endpoint_type& destination, socket_base::message_flags flags, - asio::error_code& ec) - { - return this->get_service().send_to(this->get_implementation(), - buffers, destination, flags, ec); - } - - /// Start an asynchronous send. - /** - * This function is used to asynchronously send a datagram to the specified - * remote endpoint. The function call always returns immediately. - * - * @param buffers One or more data buffers to be sent to the remote endpoint. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param destination The remote endpoint to which the data will be sent. - * Copies will be made of the endpoint as required. - * - * @param handler The handler to be called when the send operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes sent. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * To send a single data buffer use the @ref buffer function as follows: - * @code - * asio::ip::udp::endpoint destination( - * asio::ip::address::from_string("1.2.3.4"), 12345); - * socket.async_send_to( - * asio::buffer(data, size), destination, handler); - * @endcode - * See the @ref buffer documentation for information on sending multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_send_to(const ConstBufferSequence& buffers, - const endpoint_type& destination, - ASIO_MOVE_ARG(WriteHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_send_to( - this->get_implementation(), buffers, destination, 0, - ASIO_MOVE_CAST(WriteHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_send_to( - this->get_implementation(), buffers, destination, 0, - init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Start an asynchronous send. - /** - * This function is used to asynchronously send a datagram to the specified - * remote endpoint. The function call always returns immediately. - * - * @param buffers One or more data buffers to be sent to the remote endpoint. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param flags Flags specifying how the send call is to be made. - * - * @param destination The remote endpoint to which the data will be sent. - * Copies will be made of the endpoint as required. - * - * @param handler The handler to be called when the send operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes sent. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - */ - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_send_to(const ConstBufferSequence& buffers, - const endpoint_type& destination, socket_base::message_flags flags, - ASIO_MOVE_ARG(WriteHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_send_to( - this->get_implementation(), buffers, destination, flags, - ASIO_MOVE_CAST(WriteHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_send_to( - this->get_implementation(), buffers, destination, flags, - init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Receive some data on a connected socket. - /** - * This function is used to receive data on the datagram socket. The function - * call will block until data has been received successfully or an error - * occurs. - * - * @param buffers One or more buffers into which the data will be received. - * - * @returns The number of bytes received. - * - * @throws asio::system_error Thrown on failure. - * - * @note The receive operation can only be used with a connected socket. Use - * the receive_from function to receive data on an unconnected datagram - * socket. - * - * @par Example - * To receive into a single data buffer use the @ref buffer function as - * follows: - * @code socket.receive(asio::buffer(data, size)); @endcode - * See the @ref buffer documentation for information on receiving into - * multiple buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t receive(const MutableBufferSequence& buffers) - { - asio::error_code ec; - std::size_t s = this->get_service().receive( - this->get_implementation(), buffers, 0, ec); - asio::detail::throw_error(ec, "receive"); - return s; - } - - /// Receive some data on a connected socket. - /** - * This function is used to receive data on the datagram socket. The function - * call will block until data has been received successfully or an error - * occurs. - * - * @param buffers One or more buffers into which the data will be received. - * - * @param flags Flags specifying how the receive call is to be made. - * - * @returns The number of bytes received. - * - * @throws asio::system_error Thrown on failure. - * - * @note The receive operation can only be used with a connected socket. Use - * the receive_from function to receive data on an unconnected datagram - * socket. - */ - template - std::size_t receive(const MutableBufferSequence& buffers, - socket_base::message_flags flags) - { - asio::error_code ec; - std::size_t s = this->get_service().receive( - this->get_implementation(), buffers, flags, ec); - asio::detail::throw_error(ec, "receive"); - return s; - } - - /// Receive some data on a connected socket. - /** - * This function is used to receive data on the datagram socket. The function - * call will block until data has been received successfully or an error - * occurs. - * - * @param buffers One or more buffers into which the data will be received. - * - * @param flags Flags specifying how the receive call is to be made. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes received. - * - * @note The receive operation can only be used with a connected socket. Use - * the receive_from function to receive data on an unconnected datagram - * socket. - */ - template - std::size_t receive(const MutableBufferSequence& buffers, - socket_base::message_flags flags, asio::error_code& ec) - { - return this->get_service().receive( - this->get_implementation(), buffers, flags, ec); - } - - /// Start an asynchronous receive on a connected socket. - /** - * This function is used to asynchronously receive data from the datagram - * socket. The function call always returns immediately. - * - * @param buffers One or more buffers into which the data will be received. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the receive operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes received. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The async_receive operation can only be used with a connected socket. - * Use the async_receive_from function to receive data on an unconnected - * datagram socket. - * - * @par Example - * To receive into a single data buffer use the @ref buffer function as - * follows: - * @code - * socket.async_receive(asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on receiving into - * multiple buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_receive(const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_receive(this->get_implementation(), - buffers, 0, ASIO_MOVE_CAST(ReadHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_receive(this->get_implementation(), - buffers, 0, init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Start an asynchronous receive on a connected socket. - /** - * This function is used to asynchronously receive data from the datagram - * socket. The function call always returns immediately. - * - * @param buffers One or more buffers into which the data will be received. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param flags Flags specifying how the receive call is to be made. - * - * @param handler The handler to be called when the receive operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes received. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The async_receive operation can only be used with a connected socket. - * Use the async_receive_from function to receive data on an unconnected - * datagram socket. - */ - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_receive(const MutableBufferSequence& buffers, - socket_base::message_flags flags, - ASIO_MOVE_ARG(ReadHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_receive(this->get_implementation(), - buffers, flags, ASIO_MOVE_CAST(ReadHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_receive(this->get_implementation(), - buffers, flags, init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Receive a datagram with the endpoint of the sender. - /** - * This function is used to receive a datagram. The function call will block - * until data has been received successfully or an error occurs. - * - * @param buffers One or more buffers into which the data will be received. - * - * @param sender_endpoint An endpoint object that receives the endpoint of - * the remote sender of the datagram. - * - * @returns The number of bytes received. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * To receive into a single data buffer use the @ref buffer function as - * follows: - * @code - * asio::ip::udp::endpoint sender_endpoint; - * socket.receive_from( - * asio::buffer(data, size), sender_endpoint); - * @endcode - * See the @ref buffer documentation for information on receiving into - * multiple buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t receive_from(const MutableBufferSequence& buffers, - endpoint_type& sender_endpoint) - { - asio::error_code ec; - std::size_t s = this->get_service().receive_from( - this->get_implementation(), buffers, sender_endpoint, 0, ec); - asio::detail::throw_error(ec, "receive_from"); - return s; - } - - /// Receive a datagram with the endpoint of the sender. - /** - * This function is used to receive a datagram. The function call will block - * until data has been received successfully or an error occurs. - * - * @param buffers One or more buffers into which the data will be received. - * - * @param sender_endpoint An endpoint object that receives the endpoint of - * the remote sender of the datagram. - * - * @param flags Flags specifying how the receive call is to be made. - * - * @returns The number of bytes received. - * - * @throws asio::system_error Thrown on failure. - */ - template - std::size_t receive_from(const MutableBufferSequence& buffers, - endpoint_type& sender_endpoint, socket_base::message_flags flags) - { - asio::error_code ec; - std::size_t s = this->get_service().receive_from( - this->get_implementation(), buffers, sender_endpoint, flags, ec); - asio::detail::throw_error(ec, "receive_from"); - return s; - } - - /// Receive a datagram with the endpoint of the sender. - /** - * This function is used to receive a datagram. The function call will block - * until data has been received successfully or an error occurs. - * - * @param buffers One or more buffers into which the data will be received. - * - * @param sender_endpoint An endpoint object that receives the endpoint of - * the remote sender of the datagram. - * - * @param flags Flags specifying how the receive call is to be made. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes received. - */ - template - std::size_t receive_from(const MutableBufferSequence& buffers, - endpoint_type& sender_endpoint, socket_base::message_flags flags, - asio::error_code& ec) - { - return this->get_service().receive_from(this->get_implementation(), - buffers, sender_endpoint, flags, ec); - } - - /// Start an asynchronous receive. - /** - * This function is used to asynchronously receive a datagram. The function - * call always returns immediately. - * - * @param buffers One or more buffers into which the data will be received. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param sender_endpoint An endpoint object that receives the endpoint of - * the remote sender of the datagram. Ownership of the sender_endpoint object - * is retained by the caller, which must guarantee that it is valid until the - * handler is called. - * - * @param handler The handler to be called when the receive operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes received. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * To receive into a single data buffer use the @ref buffer function as - * follows: - * @code socket.async_receive_from( - * asio::buffer(data, size), sender_endpoint, handler); @endcode - * See the @ref buffer documentation for information on receiving into - * multiple buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_receive_from(const MutableBufferSequence& buffers, - endpoint_type& sender_endpoint, - ASIO_MOVE_ARG(ReadHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_receive_from( - this->get_implementation(), buffers, sender_endpoint, 0, - ASIO_MOVE_CAST(ReadHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_receive_from( - this->get_implementation(), buffers, sender_endpoint, 0, - init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Start an asynchronous receive. - /** - * This function is used to asynchronously receive a datagram. The function - * call always returns immediately. - * - * @param buffers One or more buffers into which the data will be received. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param sender_endpoint An endpoint object that receives the endpoint of - * the remote sender of the datagram. Ownership of the sender_endpoint object - * is retained by the caller, which must guarantee that it is valid until the - * handler is called. - * - * @param flags Flags specifying how the receive call is to be made. - * - * @param handler The handler to be called when the receive operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes received. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - */ - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_receive_from(const MutableBufferSequence& buffers, - endpoint_type& sender_endpoint, socket_base::message_flags flags, - ASIO_MOVE_ARG(ReadHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_receive_from( - this->get_implementation(), buffers, sender_endpoint, flags, - ASIO_MOVE_CAST(ReadHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_receive_from( - this->get_implementation(), buffers, sender_endpoint, flags, - init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_BASIC_DATAGRAM_SOCKET_HPP diff --git a/tools/sdk/include/asio/asio/basic_deadline_timer.hpp b/tools/sdk/include/asio/asio/basic_deadline_timer.hpp deleted file mode 100644 index 5b20066dff7..00000000000 --- a/tools/sdk/include/asio/asio/basic_deadline_timer.hpp +++ /dev/null @@ -1,628 +0,0 @@ -// -// basic_deadline_timer.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_BASIC_DEADLINE_TIMER_HPP -#define ASIO_BASIC_DEADLINE_TIMER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_BOOST_DATE_TIME) \ - || defined(GENERATING_DOCUMENTATION) - -#include -#include "asio/basic_io_object.hpp" -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/error.hpp" -#include "asio/time_traits.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) -# include "asio/deadline_timer_service.hpp" -#else // defined(ASIO_ENABLE_OLD_SERVICES) -# include "asio/detail/deadline_timer_service.hpp" -# define ASIO_SVC_T detail::deadline_timer_service -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Provides waitable timer functionality. -/** - * The basic_deadline_timer class template provides the ability to perform a - * blocking or asynchronous wait for a timer to expire. - * - * A deadline timer is always in one of two states: "expired" or "not expired". - * If the wait() or async_wait() function is called on an expired timer, the - * wait operation will complete immediately. - * - * Most applications will use the asio::deadline_timer typedef. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - * - * @par Examples - * Performing a blocking wait: - * @code - * // Construct a timer without setting an expiry time. - * asio::deadline_timer timer(io_context); - * - * // Set an expiry time relative to now. - * timer.expires_from_now(boost::posix_time::seconds(5)); - * - * // Wait for the timer to expire. - * timer.wait(); - * @endcode - * - * @par - * Performing an asynchronous wait: - * @code - * void handler(const asio::error_code& error) - * { - * if (!error) - * { - * // Timer expired. - * } - * } - * - * ... - * - * // Construct a timer with an absolute expiry time. - * asio::deadline_timer timer(io_context, - * boost::posix_time::time_from_string("2005-12-07 23:59:59.000")); - * - * // Start an asynchronous wait. - * timer.async_wait(handler); - * @endcode - * - * @par Changing an active deadline_timer's expiry time - * - * Changing the expiry time of a timer while there are pending asynchronous - * waits causes those wait operations to be cancelled. To ensure that the action - * associated with the timer is performed only once, use something like this: - * used: - * - * @code - * void on_some_event() - * { - * if (my_timer.expires_from_now(seconds(5)) > 0) - * { - * // We managed to cancel the timer. Start new asynchronous wait. - * my_timer.async_wait(on_timeout); - * } - * else - * { - * // Too late, timer has already expired! - * } - * } - * - * void on_timeout(const asio::error_code& e) - * { - * if (e != asio::error::operation_aborted) - * { - * // Timer was not cancelled, take necessary action. - * } - * } - * @endcode - * - * @li The asio::basic_deadline_timer::expires_from_now() function - * cancels any pending asynchronous waits, and returns the number of - * asynchronous waits that were cancelled. If it returns 0 then you were too - * late and the wait handler has already been executed, or will soon be - * executed. If it returns 1 then the wait handler was successfully cancelled. - * - * @li If a wait handler is cancelled, the asio::error_code passed to - * it contains the value asio::error::operation_aborted. - */ -template - ASIO_SVC_TPARAM_DEF2(= deadline_timer_service)> -class basic_deadline_timer - : ASIO_SVC_ACCESS basic_io_object -{ -public: - /// The type of the executor associated with the object. - typedef io_context::executor_type executor_type; - - /// The time traits type. - typedef TimeTraits traits_type; - - /// The time type. - typedef typename traits_type::time_type time_type; - - /// The duration type. - typedef typename traits_type::duration_type duration_type; - - /// Constructor. - /** - * This constructor creates a timer without setting an expiry time. The - * expires_at() or expires_from_now() functions must be called to set an - * expiry time before the timer can be waited on. - * - * @param io_context The io_context object that the timer will use to dispatch - * handlers for any asynchronous operations performed on the timer. - */ - explicit basic_deadline_timer(asio::io_context& io_context) - : basic_io_object(io_context) - { - } - - /// Constructor to set a particular expiry time as an absolute time. - /** - * This constructor creates a timer and sets the expiry time. - * - * @param io_context The io_context object that the timer will use to dispatch - * handlers for any asynchronous operations performed on the timer. - * - * @param expiry_time The expiry time to be used for the timer, expressed - * as an absolute time. - */ - basic_deadline_timer(asio::io_context& io_context, - const time_type& expiry_time) - : basic_io_object(io_context) - { - asio::error_code ec; - this->get_service().expires_at(this->get_implementation(), expiry_time, ec); - asio::detail::throw_error(ec, "expires_at"); - } - - /// Constructor to set a particular expiry time relative to now. - /** - * This constructor creates a timer and sets the expiry time. - * - * @param io_context The io_context object that the timer will use to dispatch - * handlers for any asynchronous operations performed on the timer. - * - * @param expiry_time The expiry time to be used for the timer, relative to - * now. - */ - basic_deadline_timer(asio::io_context& io_context, - const duration_type& expiry_time) - : basic_io_object(io_context) - { - asio::error_code ec; - this->get_service().expires_from_now( - this->get_implementation(), expiry_time, ec); - asio::detail::throw_error(ec, "expires_from_now"); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a basic_deadline_timer from another. - /** - * This constructor moves a timer from one object to another. - * - * @param other The other basic_deadline_timer object from which the move will - * occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_deadline_timer(io_context&) constructor. - */ - basic_deadline_timer(basic_deadline_timer&& other) - : basic_io_object(std::move(other)) - { - } - - /// Move-assign a basic_deadline_timer from another. - /** - * This assignment operator moves a timer from one object to another. Cancels - * any outstanding asynchronous operations associated with the target object. - * - * @param other The other basic_deadline_timer object from which the move will - * occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_deadline_timer(io_context&) constructor. - */ - basic_deadline_timer& operator=(basic_deadline_timer&& other) - { - basic_io_object::operator=(std::move(other)); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destroys the timer. - /** - * This function destroys the timer, cancelling any outstanding asynchronous - * wait operations associated with the timer as if by calling @c cancel. - */ - ~basic_deadline_timer() - { - } - -#if defined(ASIO_ENABLE_OLD_SERVICES) - // These functions are provided by basic_io_object<>. -#else // defined(ASIO_ENABLE_OLD_SERVICES) -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - /** - * This function may be used to obtain the io_context object that the I/O - * object uses to dispatch handlers for asynchronous operations. - * - * @return A reference to the io_context object that the I/O object will use - * to dispatch handlers. Ownership is not transferred to the caller. - */ - asio::io_context& get_io_context() - { - return basic_io_object::get_io_context(); - } - - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - /** - * This function may be used to obtain the io_context object that the I/O - * object uses to dispatch handlers for asynchronous operations. - * - * @return A reference to the io_context object that the I/O object will use - * to dispatch handlers. Ownership is not transferred to the caller. - */ - asio::io_context& get_io_service() - { - return basic_io_object::get_io_service(); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Get the executor associated with the object. - executor_type get_executor() ASIO_NOEXCEPT - { - return basic_io_object::get_executor(); - } -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - - /// Cancel any asynchronous operations that are waiting on the timer. - /** - * This function forces the completion of any pending asynchronous wait - * operations against the timer. The handler for each cancelled operation will - * be invoked with the asio::error::operation_aborted error code. - * - * Cancelling the timer does not change the expiry time. - * - * @return The number of asynchronous operations that were cancelled. - * - * @throws asio::system_error Thrown on failure. - * - * @note If the timer has already expired when cancel() is called, then the - * handlers for asynchronous wait operations will: - * - * @li have already been invoked; or - * - * @li have been queued for invocation in the near future. - * - * These handlers can no longer be cancelled, and therefore are passed an - * error code that indicates the successful completion of the wait operation. - */ - std::size_t cancel() - { - asio::error_code ec; - std::size_t s = this->get_service().cancel(this->get_implementation(), ec); - asio::detail::throw_error(ec, "cancel"); - return s; - } - - /// Cancel any asynchronous operations that are waiting on the timer. - /** - * This function forces the completion of any pending asynchronous wait - * operations against the timer. The handler for each cancelled operation will - * be invoked with the asio::error::operation_aborted error code. - * - * Cancelling the timer does not change the expiry time. - * - * @param ec Set to indicate what error occurred, if any. - * - * @return The number of asynchronous operations that were cancelled. - * - * @note If the timer has already expired when cancel() is called, then the - * handlers for asynchronous wait operations will: - * - * @li have already been invoked; or - * - * @li have been queued for invocation in the near future. - * - * These handlers can no longer be cancelled, and therefore are passed an - * error code that indicates the successful completion of the wait operation. - */ - std::size_t cancel(asio::error_code& ec) - { - return this->get_service().cancel(this->get_implementation(), ec); - } - - /// Cancels one asynchronous operation that is waiting on the timer. - /** - * This function forces the completion of one pending asynchronous wait - * operation against the timer. Handlers are cancelled in FIFO order. The - * handler for the cancelled operation will be invoked with the - * asio::error::operation_aborted error code. - * - * Cancelling the timer does not change the expiry time. - * - * @return The number of asynchronous operations that were cancelled. That is, - * either 0 or 1. - * - * @throws asio::system_error Thrown on failure. - * - * @note If the timer has already expired when cancel_one() is called, then - * the handlers for asynchronous wait operations will: - * - * @li have already been invoked; or - * - * @li have been queued for invocation in the near future. - * - * These handlers can no longer be cancelled, and therefore are passed an - * error code that indicates the successful completion of the wait operation. - */ - std::size_t cancel_one() - { - asio::error_code ec; - std::size_t s = this->get_service().cancel_one( - this->get_implementation(), ec); - asio::detail::throw_error(ec, "cancel_one"); - return s; - } - - /// Cancels one asynchronous operation that is waiting on the timer. - /** - * This function forces the completion of one pending asynchronous wait - * operation against the timer. Handlers are cancelled in FIFO order. The - * handler for the cancelled operation will be invoked with the - * asio::error::operation_aborted error code. - * - * Cancelling the timer does not change the expiry time. - * - * @param ec Set to indicate what error occurred, if any. - * - * @return The number of asynchronous operations that were cancelled. That is, - * either 0 or 1. - * - * @note If the timer has already expired when cancel_one() is called, then - * the handlers for asynchronous wait operations will: - * - * @li have already been invoked; or - * - * @li have been queued for invocation in the near future. - * - * These handlers can no longer be cancelled, and therefore are passed an - * error code that indicates the successful completion of the wait operation. - */ - std::size_t cancel_one(asio::error_code& ec) - { - return this->get_service().cancel_one(this->get_implementation(), ec); - } - - /// Get the timer's expiry time as an absolute time. - /** - * This function may be used to obtain the timer's current expiry time. - * Whether the timer has expired or not does not affect this value. - */ - time_type expires_at() const - { - return this->get_service().expires_at(this->get_implementation()); - } - - /// Set the timer's expiry time as an absolute time. - /** - * This function sets the expiry time. Any pending asynchronous wait - * operations will be cancelled. The handler for each cancelled operation will - * be invoked with the asio::error::operation_aborted error code. - * - * @param expiry_time The expiry time to be used for the timer. - * - * @return The number of asynchronous operations that were cancelled. - * - * @throws asio::system_error Thrown on failure. - * - * @note If the timer has already expired when expires_at() is called, then - * the handlers for asynchronous wait operations will: - * - * @li have already been invoked; or - * - * @li have been queued for invocation in the near future. - * - * These handlers can no longer be cancelled, and therefore are passed an - * error code that indicates the successful completion of the wait operation. - */ - std::size_t expires_at(const time_type& expiry_time) - { - asio::error_code ec; - std::size_t s = this->get_service().expires_at( - this->get_implementation(), expiry_time, ec); - asio::detail::throw_error(ec, "expires_at"); - return s; - } - - /// Set the timer's expiry time as an absolute time. - /** - * This function sets the expiry time. Any pending asynchronous wait - * operations will be cancelled. The handler for each cancelled operation will - * be invoked with the asio::error::operation_aborted error code. - * - * @param expiry_time The expiry time to be used for the timer. - * - * @param ec Set to indicate what error occurred, if any. - * - * @return The number of asynchronous operations that were cancelled. - * - * @note If the timer has already expired when expires_at() is called, then - * the handlers for asynchronous wait operations will: - * - * @li have already been invoked; or - * - * @li have been queued for invocation in the near future. - * - * These handlers can no longer be cancelled, and therefore are passed an - * error code that indicates the successful completion of the wait operation. - */ - std::size_t expires_at(const time_type& expiry_time, - asio::error_code& ec) - { - return this->get_service().expires_at( - this->get_implementation(), expiry_time, ec); - } - - /// Get the timer's expiry time relative to now. - /** - * This function may be used to obtain the timer's current expiry time. - * Whether the timer has expired or not does not affect this value. - */ - duration_type expires_from_now() const - { - return this->get_service().expires_from_now(this->get_implementation()); - } - - /// Set the timer's expiry time relative to now. - /** - * This function sets the expiry time. Any pending asynchronous wait - * operations will be cancelled. The handler for each cancelled operation will - * be invoked with the asio::error::operation_aborted error code. - * - * @param expiry_time The expiry time to be used for the timer. - * - * @return The number of asynchronous operations that were cancelled. - * - * @throws asio::system_error Thrown on failure. - * - * @note If the timer has already expired when expires_from_now() is called, - * then the handlers for asynchronous wait operations will: - * - * @li have already been invoked; or - * - * @li have been queued for invocation in the near future. - * - * These handlers can no longer be cancelled, and therefore are passed an - * error code that indicates the successful completion of the wait operation. - */ - std::size_t expires_from_now(const duration_type& expiry_time) - { - asio::error_code ec; - std::size_t s = this->get_service().expires_from_now( - this->get_implementation(), expiry_time, ec); - asio::detail::throw_error(ec, "expires_from_now"); - return s; - } - - /// Set the timer's expiry time relative to now. - /** - * This function sets the expiry time. Any pending asynchronous wait - * operations will be cancelled. The handler for each cancelled operation will - * be invoked with the asio::error::operation_aborted error code. - * - * @param expiry_time The expiry time to be used for the timer. - * - * @param ec Set to indicate what error occurred, if any. - * - * @return The number of asynchronous operations that were cancelled. - * - * @note If the timer has already expired when expires_from_now() is called, - * then the handlers for asynchronous wait operations will: - * - * @li have already been invoked; or - * - * @li have been queued for invocation in the near future. - * - * These handlers can no longer be cancelled, and therefore are passed an - * error code that indicates the successful completion of the wait operation. - */ - std::size_t expires_from_now(const duration_type& expiry_time, - asio::error_code& ec) - { - return this->get_service().expires_from_now( - this->get_implementation(), expiry_time, ec); - } - - /// Perform a blocking wait on the timer. - /** - * This function is used to wait for the timer to expire. This function - * blocks and does not return until the timer has expired. - * - * @throws asio::system_error Thrown on failure. - */ - void wait() - { - asio::error_code ec; - this->get_service().wait(this->get_implementation(), ec); - asio::detail::throw_error(ec, "wait"); - } - - /// Perform a blocking wait on the timer. - /** - * This function is used to wait for the timer to expire. This function - * blocks and does not return until the timer has expired. - * - * @param ec Set to indicate what error occurred, if any. - */ - void wait(asio::error_code& ec) - { - this->get_service().wait(this->get_implementation(), ec); - } - - /// Start an asynchronous wait on the timer. - /** - * This function may be used to initiate an asynchronous wait against the - * timer. It always returns immediately. - * - * For each call to async_wait(), the supplied handler will be called exactly - * once. The handler will be called when: - * - * @li The timer has expired. - * - * @li The timer was cancelled, in which case the handler is passed the error - * code asio::error::operation_aborted. - * - * @param handler The handler to be called when the timer expires. Copies - * will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * const asio::error_code& error // Result of operation. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - */ - template - ASIO_INITFN_RESULT_TYPE(WaitHandler, - void (asio::error_code)) - async_wait(ASIO_MOVE_ARG(WaitHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WaitHandler. - ASIO_WAIT_HANDLER_CHECK(WaitHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_wait(this->get_implementation(), - ASIO_MOVE_CAST(WaitHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_wait(this->get_implementation(), - init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if !defined(ASIO_ENABLE_OLD_SERVICES) -# undef ASIO_SVC_T -#endif // !defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // defined(ASIO_HAS_BOOST_DATE_TIME) - // || defined(GENERATING_DOCUMENTATION) - -#endif // ASIO_BASIC_DEADLINE_TIMER_HPP diff --git a/tools/sdk/include/asio/asio/basic_io_object.hpp b/tools/sdk/include/asio/asio/basic_io_object.hpp deleted file mode 100644 index 442e85429dc..00000000000 --- a/tools/sdk/include/asio/asio/basic_io_object.hpp +++ /dev/null @@ -1,290 +0,0 @@ -// -// basic_io_object.hpp -// ~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_BASIC_IO_OBJECT_HPP -#define ASIO_BASIC_IO_OBJECT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/io_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -#if defined(ASIO_HAS_MOVE) -namespace detail -{ - // Type trait used to determine whether a service supports move. - template - class service_has_move - { - private: - typedef IoObjectService service_type; - typedef typename service_type::implementation_type implementation_type; - - template - static auto asio_service_has_move_eval(T* t, U* u) - -> decltype(t->move_construct(*u, *u), char()); - static char (&asio_service_has_move_eval(...))[2]; - - public: - static const bool value = - sizeof(asio_service_has_move_eval( - static_cast(0), - static_cast(0))) == 1; - }; -} -#endif // defined(ASIO_HAS_MOVE) - -/// Base class for all I/O objects. -/** - * @note All I/O objects are non-copyable. However, when using C++0x, certain - * I/O objects do support move construction and move assignment. - */ -#if !defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) -template -#else -template ::value> -#endif -class basic_io_object -{ -public: - /// The type of the service that will be used to provide I/O operations. - typedef IoObjectService service_type; - - /// The underlying implementation type of I/O object. - typedef typename service_type::implementation_type implementation_type; - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - /** - * This function may be used to obtain the io_context object that the I/O - * object uses to dispatch handlers for asynchronous operations. - * - * @return A reference to the io_context object that the I/O object will use - * to dispatch handlers. Ownership is not transferred to the caller. - */ - asio::io_context& get_io_context() - { - return service_.get_io_context(); - } - - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - /** - * This function may be used to obtain the io_context object that the I/O - * object uses to dispatch handlers for asynchronous operations. - * - * @return A reference to the io_context object that the I/O object will use - * to dispatch handlers. Ownership is not transferred to the caller. - */ - asio::io_context& get_io_service() - { - return service_.get_io_context(); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// The type of the executor associated with the object. - typedef asio::io_context::executor_type executor_type; - - /// Get the executor associated with the object. - executor_type get_executor() ASIO_NOEXCEPT - { - return service_.get_io_context().get_executor(); - } - -protected: - /// Construct a basic_io_object. - /** - * Performs: - * @code get_service().construct(get_implementation()); @endcode - */ - explicit basic_io_object(asio::io_context& io_context) - : service_(asio::use_service(io_context)) - { - service_.construct(implementation_); - } - -#if defined(GENERATING_DOCUMENTATION) - /// Move-construct a basic_io_object. - /** - * Performs: - * @code get_service().move_construct( - * get_implementation(), other.get_implementation()); @endcode - * - * @note Available only for services that support movability, - */ - basic_io_object(basic_io_object&& other); - - /// Move-assign a basic_io_object. - /** - * Performs: - * @code get_service().move_assign(get_implementation(), - * other.get_service(), other.get_implementation()); @endcode - * - * @note Available only for services that support movability, - */ - basic_io_object& operator=(basic_io_object&& other); - - /// Perform a converting move-construction of a basic_io_object. - template - basic_io_object(IoObjectService1& other_service, - typename IoObjectService1::implementation_type& other_implementation); -#endif // defined(GENERATING_DOCUMENTATION) - - /// Protected destructor to prevent deletion through this type. - /** - * Performs: - * @code get_service().destroy(get_implementation()); @endcode - */ - ~basic_io_object() - { - service_.destroy(implementation_); - } - - /// Get the service associated with the I/O object. - service_type& get_service() - { - return service_; - } - - /// Get the service associated with the I/O object. - const service_type& get_service() const - { - return service_; - } - - /// Get the underlying implementation of the I/O object. - implementation_type& get_implementation() - { - return implementation_; - } - - /// Get the underlying implementation of the I/O object. - const implementation_type& get_implementation() const - { - return implementation_; - } - -private: - basic_io_object(const basic_io_object&); - basic_io_object& operator=(const basic_io_object&); - - // The service associated with the I/O object. - service_type& service_; - - /// The underlying implementation of the I/O object. - implementation_type implementation_; -}; - -#if defined(ASIO_HAS_MOVE) -// Specialisation for movable objects. -template -class basic_io_object -{ -public: - typedef IoObjectService service_type; - typedef typename service_type::implementation_type implementation_type; - -#if !defined(ASIO_NO_DEPRECATED) - asio::io_context& get_io_context() - { - return service_->get_io_context(); - } - - asio::io_context& get_io_service() - { - return service_->get_io_context(); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - typedef asio::io_context::executor_type executor_type; - - executor_type get_executor() ASIO_NOEXCEPT - { - return service_->get_io_context().get_executor(); - } - -protected: - explicit basic_io_object(asio::io_context& io_context) - : service_(&asio::use_service(io_context)) - { - service_->construct(implementation_); - } - - basic_io_object(basic_io_object&& other) - : service_(&other.get_service()) - { - service_->move_construct(implementation_, other.implementation_); - } - - template - basic_io_object(IoObjectService1& other_service, - typename IoObjectService1::implementation_type& other_implementation) - : service_(&asio::use_service( - other_service.get_io_context())) - { - service_->converting_move_construct(implementation_, - other_service, other_implementation); - } - - ~basic_io_object() - { - service_->destroy(implementation_); - } - - basic_io_object& operator=(basic_io_object&& other) - { - service_->move_assign(implementation_, - *other.service_, other.implementation_); - service_ = other.service_; - return *this; - } - - service_type& get_service() - { - return *service_; - } - - const service_type& get_service() const - { - return *service_; - } - - implementation_type& get_implementation() - { - return implementation_; - } - - const implementation_type& get_implementation() const - { - return implementation_; - } - -private: - basic_io_object(const basic_io_object&); - void operator=(const basic_io_object&); - - IoObjectService* service_; - implementation_type implementation_; -}; -#endif // defined(ASIO_HAS_MOVE) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_BASIC_IO_OBJECT_HPP diff --git a/tools/sdk/include/asio/asio/basic_raw_socket.hpp b/tools/sdk/include/asio/asio/basic_raw_socket.hpp deleted file mode 100644 index 0de7c776618..00000000000 --- a/tools/sdk/include/asio/asio/basic_raw_socket.hpp +++ /dev/null @@ -1,1030 +0,0 @@ -// -// basic_raw_socket.hpp -// ~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_BASIC_RAW_SOCKET_HPP -#define ASIO_BASIC_RAW_SOCKET_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/basic_socket.hpp" -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/error.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) -# include "asio/raw_socket_service.hpp" -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Provides raw-oriented socket functionality. -/** - * The basic_raw_socket class template provides asynchronous and blocking - * raw-oriented socket functionality. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -template )> -class basic_raw_socket - : public basic_socket -{ -public: - /// The native representation of a socket. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined native_handle_type; -#else - typedef typename basic_socket< - Protocol ASIO_SVC_TARG>::native_handle_type native_handle_type; -#endif - - /// The protocol type. - typedef Protocol protocol_type; - - /// The endpoint type. - typedef typename Protocol::endpoint endpoint_type; - - /// Construct a basic_raw_socket without opening it. - /** - * This constructor creates a raw socket without opening it. The open() - * function must be called before data can be sent or received on the socket. - * - * @param io_context The io_context object that the raw socket will use - * to dispatch handlers for any asynchronous operations performed on the - * socket. - */ - explicit basic_raw_socket(asio::io_context& io_context) - : basic_socket(io_context) - { - } - - /// Construct and open a basic_raw_socket. - /** - * This constructor creates and opens a raw socket. - * - * @param io_context The io_context object that the raw socket will use - * to dispatch handlers for any asynchronous operations performed on the - * socket. - * - * @param protocol An object specifying protocol parameters to be used. - * - * @throws asio::system_error Thrown on failure. - */ - basic_raw_socket(asio::io_context& io_context, - const protocol_type& protocol) - : basic_socket(io_context, protocol) - { - } - - /// Construct a basic_raw_socket, opening it and binding it to the given - /// local endpoint. - /** - * This constructor creates a raw socket and automatically opens it bound - * to the specified endpoint on the local machine. The protocol used is the - * protocol associated with the given endpoint. - * - * @param io_context The io_context object that the raw socket will use - * to dispatch handlers for any asynchronous operations performed on the - * socket. - * - * @param endpoint An endpoint on the local machine to which the raw - * socket will be bound. - * - * @throws asio::system_error Thrown on failure. - */ - basic_raw_socket(asio::io_context& io_context, - const endpoint_type& endpoint) - : basic_socket(io_context, endpoint) - { - } - - /// Construct a basic_raw_socket on an existing native socket. - /** - * This constructor creates a raw socket object to hold an existing - * native socket. - * - * @param io_context The io_context object that the raw socket will use - * to dispatch handlers for any asynchronous operations performed on the - * socket. - * - * @param protocol An object specifying protocol parameters to be used. - * - * @param native_socket The new underlying socket implementation. - * - * @throws asio::system_error Thrown on failure. - */ - basic_raw_socket(asio::io_context& io_context, - const protocol_type& protocol, const native_handle_type& native_socket) - : basic_socket( - io_context, protocol, native_socket) - { - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a basic_raw_socket from another. - /** - * This constructor moves a raw socket from one object to another. - * - * @param other The other basic_raw_socket object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_raw_socket(io_context&) constructor. - */ - basic_raw_socket(basic_raw_socket&& other) - : basic_socket(std::move(other)) - { - } - - /// Move-assign a basic_raw_socket from another. - /** - * This assignment operator moves a raw socket from one object to another. - * - * @param other The other basic_raw_socket object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_raw_socket(io_context&) constructor. - */ - basic_raw_socket& operator=(basic_raw_socket&& other) - { - basic_socket::operator=(std::move(other)); - return *this; - } - - /// Move-construct a basic_raw_socket from a socket of another protocol type. - /** - * This constructor moves a raw socket from one object to another. - * - * @param other The other basic_raw_socket object from which the move will - * occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_raw_socket(io_context&) constructor. - */ - template - basic_raw_socket(basic_raw_socket&& other, - typename enable_if::value>::type* = 0) - : basic_socket(std::move(other)) - { - } - - /// Move-assign a basic_raw_socket from a socket of another protocol type. - /** - * This assignment operator moves a raw socket from one object to another. - * - * @param other The other basic_raw_socket object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_raw_socket(io_context&) constructor. - */ - template - typename enable_if::value, - basic_raw_socket>::type& operator=( - basic_raw_socket&& other) - { - basic_socket::operator=(std::move(other)); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destroys the socket. - /** - * This function destroys the socket, cancelling any outstanding asynchronous - * operations associated with the socket as if by calling @c cancel. - */ - ~basic_raw_socket() - { - } - - /// Send some data on a connected socket. - /** - * This function is used to send data on the raw socket. The function call - * will block until the data has been sent successfully or an error occurs. - * - * @param buffers One ore more data buffers to be sent on the socket. - * - * @returns The number of bytes sent. - * - * @throws asio::system_error Thrown on failure. - * - * @note The send operation can only be used with a connected socket. Use - * the send_to function to send data on an unconnected raw socket. - * - * @par Example - * To send a single data buffer use the @ref buffer function as follows: - * @code socket.send(asio::buffer(data, size)); @endcode - * See the @ref buffer documentation for information on sending multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t send(const ConstBufferSequence& buffers) - { - asio::error_code ec; - std::size_t s = this->get_service().send( - this->get_implementation(), buffers, 0, ec); - asio::detail::throw_error(ec, "send"); - return s; - } - - /// Send some data on a connected socket. - /** - * This function is used to send data on the raw socket. The function call - * will block until the data has been sent successfully or an error occurs. - * - * @param buffers One ore more data buffers to be sent on the socket. - * - * @param flags Flags specifying how the send call is to be made. - * - * @returns The number of bytes sent. - * - * @throws asio::system_error Thrown on failure. - * - * @note The send operation can only be used with a connected socket. Use - * the send_to function to send data on an unconnected raw socket. - */ - template - std::size_t send(const ConstBufferSequence& buffers, - socket_base::message_flags flags) - { - asio::error_code ec; - std::size_t s = this->get_service().send( - this->get_implementation(), buffers, flags, ec); - asio::detail::throw_error(ec, "send"); - return s; - } - - /// Send some data on a connected socket. - /** - * This function is used to send data on the raw socket. The function call - * will block until the data has been sent successfully or an error occurs. - * - * @param buffers One or more data buffers to be sent on the socket. - * - * @param flags Flags specifying how the send call is to be made. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes sent. - * - * @note The send operation can only be used with a connected socket. Use - * the send_to function to send data on an unconnected raw socket. - */ - template - std::size_t send(const ConstBufferSequence& buffers, - socket_base::message_flags flags, asio::error_code& ec) - { - return this->get_service().send( - this->get_implementation(), buffers, flags, ec); - } - - /// Start an asynchronous send on a connected socket. - /** - * This function is used to send data on the raw socket. The function call - * will block until the data has been sent successfully or an error occurs. - * - * @param buffers One or more data buffers to be sent on the socket. Although - * the buffers object may be copied as necessary, ownership of the underlying - * memory blocks is retained by the caller, which must guarantee that they - * remain valid until the handler is called. - * - * @param handler The handler to be called when the send operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes sent. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The async_send operation can only be used with a connected socket. - * Use the async_send_to function to send data on an unconnected raw - * socket. - * - * @par Example - * To send a single data buffer use the @ref buffer function as follows: - * @code - * socket.async_send(asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on sending multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_send(const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_send(this->get_implementation(), - buffers, 0, ASIO_MOVE_CAST(WriteHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_send(this->get_implementation(), - buffers, 0, init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Start an asynchronous send on a connected socket. - /** - * This function is used to send data on the raw socket. The function call - * will block until the data has been sent successfully or an error occurs. - * - * @param buffers One or more data buffers to be sent on the socket. Although - * the buffers object may be copied as necessary, ownership of the underlying - * memory blocks is retained by the caller, which must guarantee that they - * remain valid until the handler is called. - * - * @param flags Flags specifying how the send call is to be made. - * - * @param handler The handler to be called when the send operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes sent. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The async_send operation can only be used with a connected socket. - * Use the async_send_to function to send data on an unconnected raw - * socket. - */ - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_send(const ConstBufferSequence& buffers, - socket_base::message_flags flags, - ASIO_MOVE_ARG(WriteHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_send(this->get_implementation(), - buffers, flags, ASIO_MOVE_CAST(WriteHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_send(this->get_implementation(), - buffers, flags, init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Send raw data to the specified endpoint. - /** - * This function is used to send raw data to the specified remote endpoint. - * The function call will block until the data has been sent successfully or - * an error occurs. - * - * @param buffers One or more data buffers to be sent to the remote endpoint. - * - * @param destination The remote endpoint to which the data will be sent. - * - * @returns The number of bytes sent. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * To send a single data buffer use the @ref buffer function as follows: - * @code - * asio::ip::udp::endpoint destination( - * asio::ip::address::from_string("1.2.3.4"), 12345); - * socket.send_to(asio::buffer(data, size), destination); - * @endcode - * See the @ref buffer documentation for information on sending multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t send_to(const ConstBufferSequence& buffers, - const endpoint_type& destination) - { - asio::error_code ec; - std::size_t s = this->get_service().send_to( - this->get_implementation(), buffers, destination, 0, ec); - asio::detail::throw_error(ec, "send_to"); - return s; - } - - /// Send raw data to the specified endpoint. - /** - * This function is used to send raw data to the specified remote endpoint. - * The function call will block until the data has been sent successfully or - * an error occurs. - * - * @param buffers One or more data buffers to be sent to the remote endpoint. - * - * @param destination The remote endpoint to which the data will be sent. - * - * @param flags Flags specifying how the send call is to be made. - * - * @returns The number of bytes sent. - * - * @throws asio::system_error Thrown on failure. - */ - template - std::size_t send_to(const ConstBufferSequence& buffers, - const endpoint_type& destination, socket_base::message_flags flags) - { - asio::error_code ec; - std::size_t s = this->get_service().send_to( - this->get_implementation(), buffers, destination, flags, ec); - asio::detail::throw_error(ec, "send_to"); - return s; - } - - /// Send raw data to the specified endpoint. - /** - * This function is used to send raw data to the specified remote endpoint. - * The function call will block until the data has been sent successfully or - * an error occurs. - * - * @param buffers One or more data buffers to be sent to the remote endpoint. - * - * @param destination The remote endpoint to which the data will be sent. - * - * @param flags Flags specifying how the send call is to be made. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes sent. - */ - template - std::size_t send_to(const ConstBufferSequence& buffers, - const endpoint_type& destination, socket_base::message_flags flags, - asio::error_code& ec) - { - return this->get_service().send_to(this->get_implementation(), - buffers, destination, flags, ec); - } - - /// Start an asynchronous send. - /** - * This function is used to asynchronously send raw data to the specified - * remote endpoint. The function call always returns immediately. - * - * @param buffers One or more data buffers to be sent to the remote endpoint. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param destination The remote endpoint to which the data will be sent. - * Copies will be made of the endpoint as required. - * - * @param handler The handler to be called when the send operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes sent. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * To send a single data buffer use the @ref buffer function as follows: - * @code - * asio::ip::udp::endpoint destination( - * asio::ip::address::from_string("1.2.3.4"), 12345); - * socket.async_send_to( - * asio::buffer(data, size), destination, handler); - * @endcode - * See the @ref buffer documentation for information on sending multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_send_to(const ConstBufferSequence& buffers, - const endpoint_type& destination, - ASIO_MOVE_ARG(WriteHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_send_to(this->get_implementation(), - buffers, destination, 0, ASIO_MOVE_CAST(WriteHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_send_to(this->get_implementation(), - buffers, destination, 0, init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Start an asynchronous send. - /** - * This function is used to asynchronously send raw data to the specified - * remote endpoint. The function call always returns immediately. - * - * @param buffers One or more data buffers to be sent to the remote endpoint. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param flags Flags specifying how the send call is to be made. - * - * @param destination The remote endpoint to which the data will be sent. - * Copies will be made of the endpoint as required. - * - * @param handler The handler to be called when the send operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes sent. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - */ - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_send_to(const ConstBufferSequence& buffers, - const endpoint_type& destination, socket_base::message_flags flags, - ASIO_MOVE_ARG(WriteHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_send_to( - this->get_implementation(), buffers, destination, flags, - ASIO_MOVE_CAST(WriteHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_send_to( - this->get_implementation(), buffers, destination, flags, - init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Receive some data on a connected socket. - /** - * This function is used to receive data on the raw socket. The function - * call will block until data has been received successfully or an error - * occurs. - * - * @param buffers One or more buffers into which the data will be received. - * - * @returns The number of bytes received. - * - * @throws asio::system_error Thrown on failure. - * - * @note The receive operation can only be used with a connected socket. Use - * the receive_from function to receive data on an unconnected raw - * socket. - * - * @par Example - * To receive into a single data buffer use the @ref buffer function as - * follows: - * @code socket.receive(asio::buffer(data, size)); @endcode - * See the @ref buffer documentation for information on receiving into - * multiple buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t receive(const MutableBufferSequence& buffers) - { - asio::error_code ec; - std::size_t s = this->get_service().receive( - this->get_implementation(), buffers, 0, ec); - asio::detail::throw_error(ec, "receive"); - return s; - } - - /// Receive some data on a connected socket. - /** - * This function is used to receive data on the raw socket. The function - * call will block until data has been received successfully or an error - * occurs. - * - * @param buffers One or more buffers into which the data will be received. - * - * @param flags Flags specifying how the receive call is to be made. - * - * @returns The number of bytes received. - * - * @throws asio::system_error Thrown on failure. - * - * @note The receive operation can only be used with a connected socket. Use - * the receive_from function to receive data on an unconnected raw - * socket. - */ - template - std::size_t receive(const MutableBufferSequence& buffers, - socket_base::message_flags flags) - { - asio::error_code ec; - std::size_t s = this->get_service().receive( - this->get_implementation(), buffers, flags, ec); - asio::detail::throw_error(ec, "receive"); - return s; - } - - /// Receive some data on a connected socket. - /** - * This function is used to receive data on the raw socket. The function - * call will block until data has been received successfully or an error - * occurs. - * - * @param buffers One or more buffers into which the data will be received. - * - * @param flags Flags specifying how the receive call is to be made. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes received. - * - * @note The receive operation can only be used with a connected socket. Use - * the receive_from function to receive data on an unconnected raw - * socket. - */ - template - std::size_t receive(const MutableBufferSequence& buffers, - socket_base::message_flags flags, asio::error_code& ec) - { - return this->get_service().receive( - this->get_implementation(), buffers, flags, ec); - } - - /// Start an asynchronous receive on a connected socket. - /** - * This function is used to asynchronously receive data from the raw - * socket. The function call always returns immediately. - * - * @param buffers One or more buffers into which the data will be received. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the receive operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes received. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The async_receive operation can only be used with a connected socket. - * Use the async_receive_from function to receive data on an unconnected - * raw socket. - * - * @par Example - * To receive into a single data buffer use the @ref buffer function as - * follows: - * @code - * socket.async_receive(asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on receiving into - * multiple buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_receive(const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_receive(this->get_implementation(), - buffers, 0, ASIO_MOVE_CAST(ReadHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_receive(this->get_implementation(), - buffers, 0, init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Start an asynchronous receive on a connected socket. - /** - * This function is used to asynchronously receive data from the raw - * socket. The function call always returns immediately. - * - * @param buffers One or more buffers into which the data will be received. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param flags Flags specifying how the receive call is to be made. - * - * @param handler The handler to be called when the receive operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes received. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The async_receive operation can only be used with a connected socket. - * Use the async_receive_from function to receive data on an unconnected - * raw socket. - */ - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_receive(const MutableBufferSequence& buffers, - socket_base::message_flags flags, - ASIO_MOVE_ARG(ReadHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_receive(this->get_implementation(), - buffers, flags, ASIO_MOVE_CAST(ReadHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_receive(this->get_implementation(), - buffers, flags, init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Receive raw data with the endpoint of the sender. - /** - * This function is used to receive raw data. The function call will block - * until data has been received successfully or an error occurs. - * - * @param buffers One or more buffers into which the data will be received. - * - * @param sender_endpoint An endpoint object that receives the endpoint of - * the remote sender of the data. - * - * @returns The number of bytes received. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * To receive into a single data buffer use the @ref buffer function as - * follows: - * @code - * asio::ip::udp::endpoint sender_endpoint; - * socket.receive_from( - * asio::buffer(data, size), sender_endpoint); - * @endcode - * See the @ref buffer documentation for information on receiving into - * multiple buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t receive_from(const MutableBufferSequence& buffers, - endpoint_type& sender_endpoint) - { - asio::error_code ec; - std::size_t s = this->get_service().receive_from( - this->get_implementation(), buffers, sender_endpoint, 0, ec); - asio::detail::throw_error(ec, "receive_from"); - return s; - } - - /// Receive raw data with the endpoint of the sender. - /** - * This function is used to receive raw data. The function call will block - * until data has been received successfully or an error occurs. - * - * @param buffers One or more buffers into which the data will be received. - * - * @param sender_endpoint An endpoint object that receives the endpoint of - * the remote sender of the data. - * - * @param flags Flags specifying how the receive call is to be made. - * - * @returns The number of bytes received. - * - * @throws asio::system_error Thrown on failure. - */ - template - std::size_t receive_from(const MutableBufferSequence& buffers, - endpoint_type& sender_endpoint, socket_base::message_flags flags) - { - asio::error_code ec; - std::size_t s = this->get_service().receive_from( - this->get_implementation(), buffers, sender_endpoint, flags, ec); - asio::detail::throw_error(ec, "receive_from"); - return s; - } - - /// Receive raw data with the endpoint of the sender. - /** - * This function is used to receive raw data. The function call will block - * until data has been received successfully or an error occurs. - * - * @param buffers One or more buffers into which the data will be received. - * - * @param sender_endpoint An endpoint object that receives the endpoint of - * the remote sender of the data. - * - * @param flags Flags specifying how the receive call is to be made. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes received. - */ - template - std::size_t receive_from(const MutableBufferSequence& buffers, - endpoint_type& sender_endpoint, socket_base::message_flags flags, - asio::error_code& ec) - { - return this->get_service().receive_from(this->get_implementation(), - buffers, sender_endpoint, flags, ec); - } - - /// Start an asynchronous receive. - /** - * This function is used to asynchronously receive raw data. The function - * call always returns immediately. - * - * @param buffers One or more buffers into which the data will be received. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param sender_endpoint An endpoint object that receives the endpoint of - * the remote sender of the data. Ownership of the sender_endpoint object - * is retained by the caller, which must guarantee that it is valid until the - * handler is called. - * - * @param handler The handler to be called when the receive operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes received. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * To receive into a single data buffer use the @ref buffer function as - * follows: - * @code socket.async_receive_from( - * asio::buffer(data, size), 0, sender_endpoint, handler); @endcode - * See the @ref buffer documentation for information on receiving into - * multiple buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_receive_from(const MutableBufferSequence& buffers, - endpoint_type& sender_endpoint, - ASIO_MOVE_ARG(ReadHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_receive_from( - this->get_implementation(), buffers, sender_endpoint, 0, - ASIO_MOVE_CAST(ReadHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_receive_from( - this->get_implementation(), buffers, sender_endpoint, 0, - init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Start an asynchronous receive. - /** - * This function is used to asynchronously receive raw data. The function - * call always returns immediately. - * - * @param buffers One or more buffers into which the data will be received. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param sender_endpoint An endpoint object that receives the endpoint of - * the remote sender of the data. Ownership of the sender_endpoint object - * is retained by the caller, which must guarantee that it is valid until the - * handler is called. - * - * @param flags Flags specifying how the receive call is to be made. - * - * @param handler The handler to be called when the receive operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes received. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - */ - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_receive_from(const MutableBufferSequence& buffers, - endpoint_type& sender_endpoint, socket_base::message_flags flags, - ASIO_MOVE_ARG(ReadHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_receive_from( - this->get_implementation(), buffers, sender_endpoint, flags, - ASIO_MOVE_CAST(ReadHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_receive_from( - this->get_implementation(), buffers, sender_endpoint, flags, - init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_BASIC_RAW_SOCKET_HPP diff --git a/tools/sdk/include/asio/asio/basic_seq_packet_socket.hpp b/tools/sdk/include/asio/asio/basic_seq_packet_socket.hpp deleted file mode 100644 index 3655d881cc3..00000000000 --- a/tools/sdk/include/asio/asio/basic_seq_packet_socket.hpp +++ /dev/null @@ -1,618 +0,0 @@ -// -// basic_seq_packet_socket.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_BASIC_SEQ_PACKET_SOCKET_HPP -#define ASIO_BASIC_SEQ_PACKET_SOCKET_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/basic_socket.hpp" -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/error.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) -# include "asio/seq_packet_socket_service.hpp" -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Provides sequenced packet socket functionality. -/** - * The basic_seq_packet_socket class template provides asynchronous and blocking - * sequenced packet socket functionality. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -template )> -class basic_seq_packet_socket - : public basic_socket -{ -public: - /// The native representation of a socket. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined native_handle_type; -#else - typedef typename basic_socket< - Protocol ASIO_SVC_TARG>::native_handle_type native_handle_type; -#endif - - /// The protocol type. - typedef Protocol protocol_type; - - /// The endpoint type. - typedef typename Protocol::endpoint endpoint_type; - - /// Construct a basic_seq_packet_socket without opening it. - /** - * This constructor creates a sequenced packet socket without opening it. The - * socket needs to be opened and then connected or accepted before data can - * be sent or received on it. - * - * @param io_context The io_context object that the sequenced packet socket - * will use to dispatch handlers for any asynchronous operations performed on - * the socket. - */ - explicit basic_seq_packet_socket(asio::io_context& io_context) - : basic_socket(io_context) - { - } - - /// Construct and open a basic_seq_packet_socket. - /** - * This constructor creates and opens a sequenced_packet socket. The socket - * needs to be connected or accepted before data can be sent or received on - * it. - * - * @param io_context The io_context object that the sequenced packet socket - * will use to dispatch handlers for any asynchronous operations performed on - * the socket. - * - * @param protocol An object specifying protocol parameters to be used. - * - * @throws asio::system_error Thrown on failure. - */ - basic_seq_packet_socket(asio::io_context& io_context, - const protocol_type& protocol) - : basic_socket(io_context, protocol) - { - } - - /// Construct a basic_seq_packet_socket, opening it and binding it to the - /// given local endpoint. - /** - * This constructor creates a sequenced packet socket and automatically opens - * it bound to the specified endpoint on the local machine. The protocol used - * is the protocol associated with the given endpoint. - * - * @param io_context The io_context object that the sequenced packet socket - * will use to dispatch handlers for any asynchronous operations performed on - * the socket. - * - * @param endpoint An endpoint on the local machine to which the sequenced - * packet socket will be bound. - * - * @throws asio::system_error Thrown on failure. - */ - basic_seq_packet_socket(asio::io_context& io_context, - const endpoint_type& endpoint) - : basic_socket(io_context, endpoint) - { - } - - /// Construct a basic_seq_packet_socket on an existing native socket. - /** - * This constructor creates a sequenced packet socket object to hold an - * existing native socket. - * - * @param io_context The io_context object that the sequenced packet socket - * will use to dispatch handlers for any asynchronous operations performed on - * the socket. - * - * @param protocol An object specifying protocol parameters to be used. - * - * @param native_socket The new underlying socket implementation. - * - * @throws asio::system_error Thrown on failure. - */ - basic_seq_packet_socket(asio::io_context& io_context, - const protocol_type& protocol, const native_handle_type& native_socket) - : basic_socket( - io_context, protocol, native_socket) - { - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a basic_seq_packet_socket from another. - /** - * This constructor moves a sequenced packet socket from one object to - * another. - * - * @param other The other basic_seq_packet_socket object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_seq_packet_socket(io_context&) constructor. - */ - basic_seq_packet_socket(basic_seq_packet_socket&& other) - : basic_socket(std::move(other)) - { - } - - /// Move-assign a basic_seq_packet_socket from another. - /** - * This assignment operator moves a sequenced packet socket from one object to - * another. - * - * @param other The other basic_seq_packet_socket object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_seq_packet_socket(io_context&) constructor. - */ - basic_seq_packet_socket& operator=(basic_seq_packet_socket&& other) - { - basic_socket::operator=(std::move(other)); - return *this; - } - - /// Move-construct a basic_seq_packet_socket from a socket of another protocol - /// type. - /** - * This constructor moves a sequenced packet socket from one object to - * another. - * - * @param other The other basic_seq_packet_socket object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_seq_packet_socket(io_context&) constructor. - */ - template - basic_seq_packet_socket( - basic_seq_packet_socket&& other, - typename enable_if::value>::type* = 0) - : basic_socket(std::move(other)) - { - } - - /// Move-assign a basic_seq_packet_socket from a socket of another protocol - /// type. - /** - * This assignment operator moves a sequenced packet socket from one object to - * another. - * - * @param other The other basic_seq_packet_socket object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_seq_packet_socket(io_context&) constructor. - */ - template - typename enable_if::value, - basic_seq_packet_socket>::type& operator=( - basic_seq_packet_socket&& other) - { - basic_socket::operator=(std::move(other)); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destroys the socket. - /** - * This function destroys the socket, cancelling any outstanding asynchronous - * operations associated with the socket as if by calling @c cancel. - */ - ~basic_seq_packet_socket() - { - } - - /// Send some data on the socket. - /** - * This function is used to send data on the sequenced packet socket. The - * function call will block until the data has been sent successfully, or an - * until error occurs. - * - * @param buffers One or more data buffers to be sent on the socket. - * - * @param flags Flags specifying how the send call is to be made. - * - * @returns The number of bytes sent. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * To send a single data buffer use the @ref buffer function as follows: - * @code - * socket.send(asio::buffer(data, size), 0); - * @endcode - * See the @ref buffer documentation for information on sending multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t send(const ConstBufferSequence& buffers, - socket_base::message_flags flags) - { - asio::error_code ec; - std::size_t s = this->get_service().send( - this->get_implementation(), buffers, flags, ec); - asio::detail::throw_error(ec, "send"); - return s; - } - - /// Send some data on the socket. - /** - * This function is used to send data on the sequenced packet socket. The - * function call will block the data has been sent successfully, or an until - * error occurs. - * - * @param buffers One or more data buffers to be sent on the socket. - * - * @param flags Flags specifying how the send call is to be made. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes sent. Returns 0 if an error occurred. - * - * @note The send operation may not transmit all of the data to the peer. - * Consider using the @ref write function if you need to ensure that all data - * is written before the blocking operation completes. - */ - template - std::size_t send(const ConstBufferSequence& buffers, - socket_base::message_flags flags, asio::error_code& ec) - { - return this->get_service().send( - this->get_implementation(), buffers, flags, ec); - } - - /// Start an asynchronous send. - /** - * This function is used to asynchronously send data on the sequenced packet - * socket. The function call always returns immediately. - * - * @param buffers One or more data buffers to be sent on the socket. Although - * the buffers object may be copied as necessary, ownership of the underlying - * memory blocks is retained by the caller, which must guarantee that they - * remain valid until the handler is called. - * - * @param flags Flags specifying how the send call is to be made. - * - * @param handler The handler to be called when the send operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes sent. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * To send a single data buffer use the @ref buffer function as follows: - * @code - * socket.async_send(asio::buffer(data, size), 0, handler); - * @endcode - * See the @ref buffer documentation for information on sending multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_send(const ConstBufferSequence& buffers, - socket_base::message_flags flags, - ASIO_MOVE_ARG(WriteHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_send(this->get_implementation(), - buffers, flags, ASIO_MOVE_CAST(WriteHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_send(this->get_implementation(), - buffers, flags, init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Receive some data on the socket. - /** - * This function is used to receive data on the sequenced packet socket. The - * function call will block until data has been received successfully, or - * until an error occurs. - * - * @param buffers One or more buffers into which the data will be received. - * - * @param out_flags After the receive call completes, contains flags - * associated with the received data. For example, if the - * socket_base::message_end_of_record bit is set then the received data marks - * the end of a record. - * - * @returns The number of bytes received. - * - * @throws asio::system_error Thrown on failure. An error code of - * asio::error::eof indicates that the connection was closed by the - * peer. - * - * @par Example - * To receive into a single data buffer use the @ref buffer function as - * follows: - * @code - * socket.receive(asio::buffer(data, size), out_flags); - * @endcode - * See the @ref buffer documentation for information on receiving into - * multiple buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t receive(const MutableBufferSequence& buffers, - socket_base::message_flags& out_flags) - { - asio::error_code ec; -#if defined(ASIO_ENABLE_OLD_SERVICES) - std::size_t s = this->get_service().receive( - this->get_implementation(), buffers, 0, out_flags, ec); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - std::size_t s = this->get_service().receive_with_flags( - this->get_implementation(), buffers, 0, out_flags, ec); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - asio::detail::throw_error(ec, "receive"); - return s; - } - - /// Receive some data on the socket. - /** - * This function is used to receive data on the sequenced packet socket. The - * function call will block until data has been received successfully, or - * until an error occurs. - * - * @param buffers One or more buffers into which the data will be received. - * - * @param in_flags Flags specifying how the receive call is to be made. - * - * @param out_flags After the receive call completes, contains flags - * associated with the received data. For example, if the - * socket_base::message_end_of_record bit is set then the received data marks - * the end of a record. - * - * @returns The number of bytes received. - * - * @throws asio::system_error Thrown on failure. An error code of - * asio::error::eof indicates that the connection was closed by the - * peer. - * - * @note The receive operation may not receive all of the requested number of - * bytes. Consider using the @ref read function if you need to ensure that the - * requested amount of data is read before the blocking operation completes. - * - * @par Example - * To receive into a single data buffer use the @ref buffer function as - * follows: - * @code - * socket.receive(asio::buffer(data, size), 0, out_flags); - * @endcode - * See the @ref buffer documentation for information on receiving into - * multiple buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t receive(const MutableBufferSequence& buffers, - socket_base::message_flags in_flags, - socket_base::message_flags& out_flags) - { - asio::error_code ec; -#if defined(ASIO_ENABLE_OLD_SERVICES) - std::size_t s = this->get_service().receive( - this->get_implementation(), buffers, in_flags, out_flags, ec); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - std::size_t s = this->get_service().receive_with_flags( - this->get_implementation(), buffers, in_flags, out_flags, ec); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - asio::detail::throw_error(ec, "receive"); - return s; - } - - /// Receive some data on a connected socket. - /** - * This function is used to receive data on the sequenced packet socket. The - * function call will block until data has been received successfully, or - * until an error occurs. - * - * @param buffers One or more buffers into which the data will be received. - * - * @param in_flags Flags specifying how the receive call is to be made. - * - * @param out_flags After the receive call completes, contains flags - * associated with the received data. For example, if the - * socket_base::message_end_of_record bit is set then the received data marks - * the end of a record. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes received. Returns 0 if an error occurred. - * - * @note The receive operation may not receive all of the requested number of - * bytes. Consider using the @ref read function if you need to ensure that the - * requested amount of data is read before the blocking operation completes. - */ - template - std::size_t receive(const MutableBufferSequence& buffers, - socket_base::message_flags in_flags, - socket_base::message_flags& out_flags, asio::error_code& ec) - { -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().receive(this->get_implementation(), - buffers, in_flags, out_flags, ec); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().receive_with_flags(this->get_implementation(), - buffers, in_flags, out_flags, ec); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Start an asynchronous receive. - /** - * This function is used to asynchronously receive data from the sequenced - * packet socket. The function call always returns immediately. - * - * @param buffers One or more buffers into which the data will be received. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param out_flags Once the asynchronous operation completes, contains flags - * associated with the received data. For example, if the - * socket_base::message_end_of_record bit is set then the received data marks - * the end of a record. The caller must guarantee that the referenced - * variable remains valid until the handler is called. - * - * @param handler The handler to be called when the receive operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes received. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * To receive into a single data buffer use the @ref buffer function as - * follows: - * @code - * socket.async_receive(asio::buffer(data, size), out_flags, handler); - * @endcode - * See the @ref buffer documentation for information on receiving into - * multiple buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_receive(const MutableBufferSequence& buffers, - socket_base::message_flags& out_flags, - ASIO_MOVE_ARG(ReadHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_receive( - this->get_implementation(), buffers, 0, out_flags, - ASIO_MOVE_CAST(ReadHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_receive_with_flags( - this->get_implementation(), buffers, 0, out_flags, - init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Start an asynchronous receive. - /** - * This function is used to asynchronously receive data from the sequenced - * data socket. The function call always returns immediately. - * - * @param buffers One or more buffers into which the data will be received. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param in_flags Flags specifying how the receive call is to be made. - * - * @param out_flags Once the asynchronous operation completes, contains flags - * associated with the received data. For example, if the - * socket_base::message_end_of_record bit is set then the received data marks - * the end of a record. The caller must guarantee that the referenced - * variable remains valid until the handler is called. - * - * @param handler The handler to be called when the receive operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes received. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * To receive into a single data buffer use the @ref buffer function as - * follows: - * @code - * socket.async_receive( - * asio::buffer(data, size), - * 0, out_flags, handler); - * @endcode - * See the @ref buffer documentation for information on receiving into - * multiple buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_receive(const MutableBufferSequence& buffers, - socket_base::message_flags in_flags, - socket_base::message_flags& out_flags, - ASIO_MOVE_ARG(ReadHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_receive( - this->get_implementation(), buffers, in_flags, out_flags, - ASIO_MOVE_CAST(ReadHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_receive_with_flags( - this->get_implementation(), buffers, in_flags, out_flags, - init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_BASIC_SEQ_PACKET_SOCKET_HPP diff --git a/tools/sdk/include/asio/asio/basic_serial_port.hpp b/tools/sdk/include/asio/asio/basic_serial_port.hpp deleted file mode 100644 index 32262f84295..00000000000 --- a/tools/sdk/include/asio/asio/basic_serial_port.hpp +++ /dev/null @@ -1,688 +0,0 @@ -// -// basic_serial_port.hpp -// ~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_BASIC_SERIAL_PORT_HPP -#define ASIO_BASIC_SERIAL_PORT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) - -#if defined(ASIO_HAS_SERIAL_PORT) \ - || defined(GENERATING_DOCUMENTATION) - -#include -#include "asio/basic_io_object.hpp" -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/error.hpp" -#include "asio/serial_port_base.hpp" -#include "asio/serial_port_service.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Provides serial port functionality. -/** - * The basic_serial_port class template provides functionality that is common - * to all serial ports. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -template -class basic_serial_port - : public basic_io_object, - public serial_port_base -{ -public: - /// The native representation of a serial port. - typedef typename SerialPortService::native_handle_type native_handle_type; - - /// A basic_serial_port is always the lowest layer. - typedef basic_serial_port lowest_layer_type; - - /// Construct a basic_serial_port without opening it. - /** - * This constructor creates a serial port without opening it. - * - * @param io_context The io_context object that the serial port will use to - * dispatch handlers for any asynchronous operations performed on the port. - */ - explicit basic_serial_port(asio::io_context& io_context) - : basic_io_object(io_context) - { - } - - /// Construct and open a basic_serial_port. - /** - * This constructor creates and opens a serial port for the specified device - * name. - * - * @param io_context The io_context object that the serial port will use to - * dispatch handlers for any asynchronous operations performed on the port. - * - * @param device The platform-specific device name for this serial - * port. - */ - explicit basic_serial_port(asio::io_context& io_context, - const char* device) - : basic_io_object(io_context) - { - asio::error_code ec; - this->get_service().open(this->get_implementation(), device, ec); - asio::detail::throw_error(ec, "open"); - } - - /// Construct and open a basic_serial_port. - /** - * This constructor creates and opens a serial port for the specified device - * name. - * - * @param io_context The io_context object that the serial port will use to - * dispatch handlers for any asynchronous operations performed on the port. - * - * @param device The platform-specific device name for this serial - * port. - */ - explicit basic_serial_port(asio::io_context& io_context, - const std::string& device) - : basic_io_object(io_context) - { - asio::error_code ec; - this->get_service().open(this->get_implementation(), device, ec); - asio::detail::throw_error(ec, "open"); - } - - /// Construct a basic_serial_port on an existing native serial port. - /** - * This constructor creates a serial port object to hold an existing native - * serial port. - * - * @param io_context The io_context object that the serial port will use to - * dispatch handlers for any asynchronous operations performed on the port. - * - * @param native_serial_port A native serial port. - * - * @throws asio::system_error Thrown on failure. - */ - basic_serial_port(asio::io_context& io_context, - const native_handle_type& native_serial_port) - : basic_io_object(io_context) - { - asio::error_code ec; - this->get_service().assign(this->get_implementation(), - native_serial_port, ec); - asio::detail::throw_error(ec, "assign"); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a basic_serial_port from another. - /** - * This constructor moves a serial port from one object to another. - * - * @param other The other basic_serial_port object from which the move will - * occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_serial_port(io_context&) constructor. - */ - basic_serial_port(basic_serial_port&& other) - : basic_io_object( - ASIO_MOVE_CAST(basic_serial_port)(other)) - { - } - - /// Move-assign a basic_serial_port from another. - /** - * This assignment operator moves a serial port from one object to another. - * - * @param other The other basic_serial_port object from which the move will - * occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_serial_port(io_context&) constructor. - */ - basic_serial_port& operator=(basic_serial_port&& other) - { - basic_io_object::operator=( - ASIO_MOVE_CAST(basic_serial_port)(other)); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Get a reference to the lowest layer. - /** - * This function returns a reference to the lowest layer in a stack of - * layers. Since a basic_serial_port cannot contain any further layers, it - * simply returns a reference to itself. - * - * @return A reference to the lowest layer in the stack of layers. Ownership - * is not transferred to the caller. - */ - lowest_layer_type& lowest_layer() - { - return *this; - } - - /// Get a const reference to the lowest layer. - /** - * This function returns a const reference to the lowest layer in a stack of - * layers. Since a basic_serial_port cannot contain any further layers, it - * simply returns a reference to itself. - * - * @return A const reference to the lowest layer in the stack of layers. - * Ownership is not transferred to the caller. - */ - const lowest_layer_type& lowest_layer() const - { - return *this; - } - - /// Open the serial port using the specified device name. - /** - * This function opens the serial port for the specified device name. - * - * @param device The platform-specific device name. - * - * @throws asio::system_error Thrown on failure. - */ - void open(const std::string& device) - { - asio::error_code ec; - this->get_service().open(this->get_implementation(), device, ec); - asio::detail::throw_error(ec, "open"); - } - - /// Open the serial port using the specified device name. - /** - * This function opens the serial port using the given platform-specific - * device name. - * - * @param device The platform-specific device name. - * - * @param ec Set the indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID open(const std::string& device, - asio::error_code& ec) - { - this->get_service().open(this->get_implementation(), device, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Assign an existing native serial port to the serial port. - /* - * This function opens the serial port to hold an existing native serial port. - * - * @param native_serial_port A native serial port. - * - * @throws asio::system_error Thrown on failure. - */ - void assign(const native_handle_type& native_serial_port) - { - asio::error_code ec; - this->get_service().assign(this->get_implementation(), - native_serial_port, ec); - asio::detail::throw_error(ec, "assign"); - } - - /// Assign an existing native serial port to the serial port. - /* - * This function opens the serial port to hold an existing native serial port. - * - * @param native_serial_port A native serial port. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID assign(const native_handle_type& native_serial_port, - asio::error_code& ec) - { - this->get_service().assign(this->get_implementation(), - native_serial_port, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Determine whether the serial port is open. - bool is_open() const - { - return this->get_service().is_open(this->get_implementation()); - } - - /// Close the serial port. - /** - * This function is used to close the serial port. Any asynchronous read or - * write operations will be cancelled immediately, and will complete with the - * asio::error::operation_aborted error. - * - * @throws asio::system_error Thrown on failure. - */ - void close() - { - asio::error_code ec; - this->get_service().close(this->get_implementation(), ec); - asio::detail::throw_error(ec, "close"); - } - - /// Close the serial port. - /** - * This function is used to close the serial port. Any asynchronous read or - * write operations will be cancelled immediately, and will complete with the - * asio::error::operation_aborted error. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID close(asio::error_code& ec) - { - this->get_service().close(this->get_implementation(), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get the native serial port representation. - /** - * This function may be used to obtain the underlying representation of the - * serial port. This is intended to allow access to native serial port - * functionality that is not otherwise provided. - */ - native_handle_type native_handle() - { - return this->get_service().native_handle(this->get_implementation()); - } - - /// Cancel all asynchronous operations associated with the serial port. - /** - * This function causes all outstanding asynchronous read or write operations - * to finish immediately, and the handlers for cancelled operations will be - * passed the asio::error::operation_aborted error. - * - * @throws asio::system_error Thrown on failure. - */ - void cancel() - { - asio::error_code ec; - this->get_service().cancel(this->get_implementation(), ec); - asio::detail::throw_error(ec, "cancel"); - } - - /// Cancel all asynchronous operations associated with the serial port. - /** - * This function causes all outstanding asynchronous read or write operations - * to finish immediately, and the handlers for cancelled operations will be - * passed the asio::error::operation_aborted error. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID cancel(asio::error_code& ec) - { - this->get_service().cancel(this->get_implementation(), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Send a break sequence to the serial port. - /** - * This function causes a break sequence of platform-specific duration to be - * sent out the serial port. - * - * @throws asio::system_error Thrown on failure. - */ - void send_break() - { - asio::error_code ec; - this->get_service().send_break(this->get_implementation(), ec); - asio::detail::throw_error(ec, "send_break"); - } - - /// Send a break sequence to the serial port. - /** - * This function causes a break sequence of platform-specific duration to be - * sent out the serial port. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID send_break(asio::error_code& ec) - { - this->get_service().send_break(this->get_implementation(), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Set an option on the serial port. - /** - * This function is used to set an option on the serial port. - * - * @param option The option value to be set on the serial port. - * - * @throws asio::system_error Thrown on failure. - * - * @sa SettableSerialPortOption @n - * asio::serial_port_base::baud_rate @n - * asio::serial_port_base::flow_control @n - * asio::serial_port_base::parity @n - * asio::serial_port_base::stop_bits @n - * asio::serial_port_base::character_size - */ - template - void set_option(const SettableSerialPortOption& option) - { - asio::error_code ec; - this->get_service().set_option(this->get_implementation(), option, ec); - asio::detail::throw_error(ec, "set_option"); - } - - /// Set an option on the serial port. - /** - * This function is used to set an option on the serial port. - * - * @param option The option value to be set on the serial port. - * - * @param ec Set to indicate what error occurred, if any. - * - * @sa SettableSerialPortOption @n - * asio::serial_port_base::baud_rate @n - * asio::serial_port_base::flow_control @n - * asio::serial_port_base::parity @n - * asio::serial_port_base::stop_bits @n - * asio::serial_port_base::character_size - */ - template - ASIO_SYNC_OP_VOID set_option(const SettableSerialPortOption& option, - asio::error_code& ec) - { - this->get_service().set_option(this->get_implementation(), option, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get an option from the serial port. - /** - * This function is used to get the current value of an option on the serial - * port. - * - * @param option The option value to be obtained from the serial port. - * - * @throws asio::system_error Thrown on failure. - * - * @sa GettableSerialPortOption @n - * asio::serial_port_base::baud_rate @n - * asio::serial_port_base::flow_control @n - * asio::serial_port_base::parity @n - * asio::serial_port_base::stop_bits @n - * asio::serial_port_base::character_size - */ - template - void get_option(GettableSerialPortOption& option) - { - asio::error_code ec; - this->get_service().get_option(this->get_implementation(), option, ec); - asio::detail::throw_error(ec, "get_option"); - } - - /// Get an option from the serial port. - /** - * This function is used to get the current value of an option on the serial - * port. - * - * @param option The option value to be obtained from the serial port. - * - * @param ec Set to indicate what error occurred, if any. - * - * @sa GettableSerialPortOption @n - * asio::serial_port_base::baud_rate @n - * asio::serial_port_base::flow_control @n - * asio::serial_port_base::parity @n - * asio::serial_port_base::stop_bits @n - * asio::serial_port_base::character_size - */ - template - ASIO_SYNC_OP_VOID get_option(GettableSerialPortOption& option, - asio::error_code& ec) - { - this->get_service().get_option(this->get_implementation(), option, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Write some data to the serial port. - /** - * This function is used to write data to the serial port. The function call - * will block until one or more bytes of the data has been written - * successfully, or until an error occurs. - * - * @param buffers One or more data buffers to be written to the serial port. - * - * @returns The number of bytes written. - * - * @throws asio::system_error Thrown on failure. An error code of - * asio::error::eof indicates that the connection was closed by the - * peer. - * - * @note The write_some operation may not transmit all of the data to the - * peer. Consider using the @ref write function if you need to ensure that - * all data is written before the blocking operation completes. - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code - * serial_port.write_some(asio::buffer(data, size)); - * @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t write_some(const ConstBufferSequence& buffers) - { - asio::error_code ec; - std::size_t s = this->get_service().write_some( - this->get_implementation(), buffers, ec); - asio::detail::throw_error(ec, "write_some"); - return s; - } - - /// Write some data to the serial port. - /** - * This function is used to write data to the serial port. The function call - * will block until one or more bytes of the data has been written - * successfully, or until an error occurs. - * - * @param buffers One or more data buffers to be written to the serial port. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes written. Returns 0 if an error occurred. - * - * @note The write_some operation may not transmit all of the data to the - * peer. Consider using the @ref write function if you need to ensure that - * all data is written before the blocking operation completes. - */ - template - std::size_t write_some(const ConstBufferSequence& buffers, - asio::error_code& ec) - { - return this->get_service().write_some( - this->get_implementation(), buffers, ec); - } - - /// Start an asynchronous write. - /** - * This function is used to asynchronously write data to the serial port. - * The function call always returns immediately. - * - * @param buffers One or more data buffers to be written to the serial port. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the write operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes written. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The write operation may not transmit all of the data to the peer. - * Consider using the @ref async_write function if you need to ensure that all - * data is written before the asynchronous operation completes. - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code - * serial_port.async_write_some(asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_write_some(const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - - return this->get_service().async_write_some(this->get_implementation(), - buffers, ASIO_MOVE_CAST(WriteHandler)(handler)); - } - - /// Read some data from the serial port. - /** - * This function is used to read data from the serial port. The function - * call will block until one or more bytes of data has been read successfully, - * or until an error occurs. - * - * @param buffers One or more buffers into which the data will be read. - * - * @returns The number of bytes read. - * - * @throws asio::system_error Thrown on failure. An error code of - * asio::error::eof indicates that the connection was closed by the - * peer. - * - * @note The read_some operation may not read all of the requested number of - * bytes. Consider using the @ref read function if you need to ensure that - * the requested amount of data is read before the blocking operation - * completes. - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code - * serial_port.read_some(asio::buffer(data, size)); - * @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t read_some(const MutableBufferSequence& buffers) - { - asio::error_code ec; - std::size_t s = this->get_service().read_some( - this->get_implementation(), buffers, ec); - asio::detail::throw_error(ec, "read_some"); - return s; - } - - /// Read some data from the serial port. - /** - * This function is used to read data from the serial port. The function - * call will block until one or more bytes of data has been read successfully, - * or until an error occurs. - * - * @param buffers One or more buffers into which the data will be read. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes read. Returns 0 if an error occurred. - * - * @note The read_some operation may not read all of the requested number of - * bytes. Consider using the @ref read function if you need to ensure that - * the requested amount of data is read before the blocking operation - * completes. - */ - template - std::size_t read_some(const MutableBufferSequence& buffers, - asio::error_code& ec) - { - return this->get_service().read_some( - this->get_implementation(), buffers, ec); - } - - /// Start an asynchronous read. - /** - * This function is used to asynchronously read data from the serial port. - * The function call always returns immediately. - * - * @param buffers One or more buffers into which the data will be read. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes read. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The read operation may not read all of the requested number of bytes. - * Consider using the @ref async_read function if you need to ensure that the - * requested amount of data is read before the asynchronous operation - * completes. - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code - * serial_port.async_read_some(asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_read_some(const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - - return this->get_service().async_read_some(this->get_implementation(), - buffers, ASIO_MOVE_CAST(ReadHandler)(handler)); - } -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_SERIAL_PORT) - // || defined(GENERATING_DOCUMENTATION) - -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_BASIC_SERIAL_PORT_HPP diff --git a/tools/sdk/include/asio/asio/basic_signal_set.hpp b/tools/sdk/include/asio/asio/basic_signal_set.hpp deleted file mode 100644 index cf34643f8f3..00000000000 --- a/tools/sdk/include/asio/asio/basic_signal_set.hpp +++ /dev/null @@ -1,391 +0,0 @@ -// -// basic_signal_set.hpp -// ~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_BASIC_SIGNAL_SET_HPP -#define ASIO_BASIC_SIGNAL_SET_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) - -#include "asio/basic_io_object.hpp" -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/error.hpp" -#include "asio/signal_set_service.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Provides signal functionality. -/** - * The basic_signal_set class template provides the ability to perform an - * asynchronous wait for one or more signals to occur. - * - * Most applications will use the asio::signal_set typedef. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - * - * @par Example - * Performing an asynchronous wait: - * @code - * void handler( - * const asio::error_code& error, - * int signal_number) - * { - * if (!error) - * { - * // A signal occurred. - * } - * } - * - * ... - * - * // Construct a signal set registered for process termination. - * asio::signal_set signals(io_context, SIGINT, SIGTERM); - * - * // Start an asynchronous wait for one of the signals to occur. - * signals.async_wait(handler); - * @endcode - * - * @par Queueing of signal notifications - * - * If a signal is registered with a signal_set, and the signal occurs when - * there are no waiting handlers, then the signal notification is queued. The - * next async_wait operation on that signal_set will dequeue the notification. - * If multiple notifications are queued, subsequent async_wait operations - * dequeue them one at a time. Signal notifications are dequeued in order of - * ascending signal number. - * - * If a signal number is removed from a signal_set (using the @c remove or @c - * erase member functions) then any queued notifications for that signal are - * discarded. - * - * @par Multiple registration of signals - * - * The same signal number may be registered with different signal_set objects. - * When the signal occurs, one handler is called for each signal_set object. - * - * Note that multiple registration only works for signals that are registered - * using Asio. The application must not also register a signal handler using - * functions such as @c signal() or @c sigaction(). - * - * @par Signal masking on POSIX platforms - * - * POSIX allows signals to be blocked using functions such as @c sigprocmask() - * and @c pthread_sigmask(). For signals to be delivered, programs must ensure - * that any signals registered using signal_set objects are unblocked in at - * least one thread. - */ -template -class basic_signal_set - : public basic_io_object -{ -public: - /// Construct a signal set without adding any signals. - /** - * This constructor creates a signal set without registering for any signals. - * - * @param io_context The io_context object that the signal set will use to - * dispatch handlers for any asynchronous operations performed on the set. - */ - explicit basic_signal_set(asio::io_context& io_context) - : basic_io_object(io_context) - { - } - - /// Construct a signal set and add one signal. - /** - * This constructor creates a signal set and registers for one signal. - * - * @param io_context The io_context object that the signal set will use to - * dispatch handlers for any asynchronous operations performed on the set. - * - * @param signal_number_1 The signal number to be added. - * - * @note This constructor is equivalent to performing: - * @code asio::signal_set signals(io_context); - * signals.add(signal_number_1); @endcode - */ - basic_signal_set(asio::io_context& io_context, int signal_number_1) - : basic_io_object(io_context) - { - asio::error_code ec; - this->get_service().add(this->get_implementation(), signal_number_1, ec); - asio::detail::throw_error(ec, "add"); - } - - /// Construct a signal set and add two signals. - /** - * This constructor creates a signal set and registers for two signals. - * - * @param io_context The io_context object that the signal set will use to - * dispatch handlers for any asynchronous operations performed on the set. - * - * @param signal_number_1 The first signal number to be added. - * - * @param signal_number_2 The second signal number to be added. - * - * @note This constructor is equivalent to performing: - * @code asio::signal_set signals(io_context); - * signals.add(signal_number_1); - * signals.add(signal_number_2); @endcode - */ - basic_signal_set(asio::io_context& io_context, int signal_number_1, - int signal_number_2) - : basic_io_object(io_context) - { - asio::error_code ec; - this->get_service().add(this->get_implementation(), signal_number_1, ec); - asio::detail::throw_error(ec, "add"); - this->get_service().add(this->get_implementation(), signal_number_2, ec); - asio::detail::throw_error(ec, "add"); - } - - /// Construct a signal set and add three signals. - /** - * This constructor creates a signal set and registers for three signals. - * - * @param io_context The io_context object that the signal set will use to - * dispatch handlers for any asynchronous operations performed on the set. - * - * @param signal_number_1 The first signal number to be added. - * - * @param signal_number_2 The second signal number to be added. - * - * @param signal_number_3 The third signal number to be added. - * - * @note This constructor is equivalent to performing: - * @code asio::signal_set signals(io_context); - * signals.add(signal_number_1); - * signals.add(signal_number_2); - * signals.add(signal_number_3); @endcode - */ - basic_signal_set(asio::io_context& io_context, int signal_number_1, - int signal_number_2, int signal_number_3) - : basic_io_object(io_context) - { - asio::error_code ec; - this->get_service().add(this->get_implementation(), signal_number_1, ec); - asio::detail::throw_error(ec, "add"); - this->get_service().add(this->get_implementation(), signal_number_2, ec); - asio::detail::throw_error(ec, "add"); - this->get_service().add(this->get_implementation(), signal_number_3, ec); - asio::detail::throw_error(ec, "add"); - } - - /// Add a signal to a signal_set. - /** - * This function adds the specified signal to the set. It has no effect if the - * signal is already in the set. - * - * @param signal_number The signal to be added to the set. - * - * @throws asio::system_error Thrown on failure. - */ - void add(int signal_number) - { - asio::error_code ec; - this->get_service().add(this->get_implementation(), signal_number, ec); - asio::detail::throw_error(ec, "add"); - } - - /// Add a signal to a signal_set. - /** - * This function adds the specified signal to the set. It has no effect if the - * signal is already in the set. - * - * @param signal_number The signal to be added to the set. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID add(int signal_number, asio::error_code& ec) - { - this->get_service().add(this->get_implementation(), signal_number, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Remove a signal from a signal_set. - /** - * This function removes the specified signal from the set. It has no effect - * if the signal is not in the set. - * - * @param signal_number The signal to be removed from the set. - * - * @throws asio::system_error Thrown on failure. - * - * @note Removes any notifications that have been queued for the specified - * signal number. - */ - void remove(int signal_number) - { - asio::error_code ec; - this->get_service().remove(this->get_implementation(), signal_number, ec); - asio::detail::throw_error(ec, "remove"); - } - - /// Remove a signal from a signal_set. - /** - * This function removes the specified signal from the set. It has no effect - * if the signal is not in the set. - * - * @param signal_number The signal to be removed from the set. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Removes any notifications that have been queued for the specified - * signal number. - */ - ASIO_SYNC_OP_VOID remove(int signal_number, - asio::error_code& ec) - { - this->get_service().remove(this->get_implementation(), signal_number, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Remove all signals from a signal_set. - /** - * This function removes all signals from the set. It has no effect if the set - * is already empty. - * - * @throws asio::system_error Thrown on failure. - * - * @note Removes all queued notifications. - */ - void clear() - { - asio::error_code ec; - this->get_service().clear(this->get_implementation(), ec); - asio::detail::throw_error(ec, "clear"); - } - - /// Remove all signals from a signal_set. - /** - * This function removes all signals from the set. It has no effect if the set - * is already empty. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Removes all queued notifications. - */ - ASIO_SYNC_OP_VOID clear(asio::error_code& ec) - { - this->get_service().clear(this->get_implementation(), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Cancel all operations associated with the signal set. - /** - * This function forces the completion of any pending asynchronous wait - * operations against the signal set. The handler for each cancelled - * operation will be invoked with the asio::error::operation_aborted - * error code. - * - * Cancellation does not alter the set of registered signals. - * - * @throws asio::system_error Thrown on failure. - * - * @note If a registered signal occurred before cancel() is called, then the - * handlers for asynchronous wait operations will: - * - * @li have already been invoked; or - * - * @li have been queued for invocation in the near future. - * - * These handlers can no longer be cancelled, and therefore are passed an - * error code that indicates the successful completion of the wait operation. - */ - void cancel() - { - asio::error_code ec; - this->get_service().cancel(this->get_implementation(), ec); - asio::detail::throw_error(ec, "cancel"); - } - - /// Cancel all operations associated with the signal set. - /** - * This function forces the completion of any pending asynchronous wait - * operations against the signal set. The handler for each cancelled - * operation will be invoked with the asio::error::operation_aborted - * error code. - * - * Cancellation does not alter the set of registered signals. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note If a registered signal occurred before cancel() is called, then the - * handlers for asynchronous wait operations will: - * - * @li have already been invoked; or - * - * @li have been queued for invocation in the near future. - * - * These handlers can no longer be cancelled, and therefore are passed an - * error code that indicates the successful completion of the wait operation. - */ - ASIO_SYNC_OP_VOID cancel(asio::error_code& ec) - { - this->get_service().cancel(this->get_implementation(), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Start an asynchronous operation to wait for a signal to be delivered. - /** - * This function may be used to initiate an asynchronous wait against the - * signal set. It always returns immediately. - * - * For each call to async_wait(), the supplied handler will be called exactly - * once. The handler will be called when: - * - * @li One of the registered signals in the signal set occurs; or - * - * @li The signal set was cancelled, in which case the handler is passed the - * error code asio::error::operation_aborted. - * - * @param handler The handler to be called when the signal occurs. Copies - * will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * int signal_number // Indicates which signal occurred. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - */ - template - ASIO_INITFN_RESULT_TYPE(SignalHandler, - void (asio::error_code, int)) - async_wait(ASIO_MOVE_ARG(SignalHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a SignalHandler. - ASIO_SIGNAL_HANDLER_CHECK(SignalHandler, handler) type_check; - - return this->get_service().async_wait(this->get_implementation(), - ASIO_MOVE_CAST(SignalHandler)(handler)); - } -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_BASIC_SIGNAL_SET_HPP diff --git a/tools/sdk/include/asio/asio/basic_socket.hpp b/tools/sdk/include/asio/asio/basic_socket.hpp deleted file mode 100644 index 3dfacb42496..00000000000 --- a/tools/sdk/include/asio/asio/basic_socket.hpp +++ /dev/null @@ -1,1757 +0,0 @@ -// -// basic_socket.hpp -// ~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_BASIC_SOCKET_HPP -#define ASIO_BASIC_SOCKET_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/async_result.hpp" -#include "asio/basic_io_object.hpp" -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/error.hpp" -#include "asio/post.hpp" -#include "asio/socket_base.hpp" - -#if defined(ASIO_HAS_MOVE) -# include -#endif // defined(ASIO_HAS_MOVE) - -#if !defined(ASIO_ENABLE_OLD_SERVICES) -# if defined(ASIO_WINDOWS_RUNTIME) -# include "asio/detail/winrt_ssocket_service.hpp" -# define ASIO_SVC_T detail::winrt_ssocket_service -# elif defined(ASIO_HAS_IOCP) -# include "asio/detail/win_iocp_socket_service.hpp" -# define ASIO_SVC_T detail::win_iocp_socket_service -# else -# include "asio/detail/reactive_socket_service.hpp" -# define ASIO_SVC_T detail::reactive_socket_service -# endif -#endif // !defined(ASIO_ENABLE_OLD_SERVICES) - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Provides socket functionality. -/** - * The basic_socket class template provides functionality that is common to both - * stream-oriented and datagram-oriented sockets. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -template -class basic_socket - : ASIO_SVC_ACCESS basic_io_object, - public socket_base -{ -public: - /// The type of the executor associated with the object. - typedef io_context::executor_type executor_type; - - /// The native representation of a socket. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined native_handle_type; -#else - typedef typename ASIO_SVC_T::native_handle_type native_handle_type; -#endif - - /// The protocol type. - typedef Protocol protocol_type; - - /// The endpoint type. - typedef typename Protocol::endpoint endpoint_type; - -#if !defined(ASIO_NO_EXTENSIONS) - /// A basic_socket is always the lowest layer. - typedef basic_socket lowest_layer_type; -#endif // !defined(ASIO_NO_EXTENSIONS) - - /// Construct a basic_socket without opening it. - /** - * This constructor creates a socket without opening it. - * - * @param io_context The io_context object that the socket will use to - * dispatch handlers for any asynchronous operations performed on the socket. - */ - explicit basic_socket(asio::io_context& io_context) - : basic_io_object(io_context) - { - } - - /// Construct and open a basic_socket. - /** - * This constructor creates and opens a socket. - * - * @param io_context The io_context object that the socket will use to - * dispatch handlers for any asynchronous operations performed on the socket. - * - * @param protocol An object specifying protocol parameters to be used. - * - * @throws asio::system_error Thrown on failure. - */ - basic_socket(asio::io_context& io_context, - const protocol_type& protocol) - : basic_io_object(io_context) - { - asio::error_code ec; - this->get_service().open(this->get_implementation(), protocol, ec); - asio::detail::throw_error(ec, "open"); - } - - /// Construct a basic_socket, opening it and binding it to the given local - /// endpoint. - /** - * This constructor creates a socket and automatically opens it bound to the - * specified endpoint on the local machine. The protocol used is the protocol - * associated with the given endpoint. - * - * @param io_context The io_context object that the socket will use to - * dispatch handlers for any asynchronous operations performed on the socket. - * - * @param endpoint An endpoint on the local machine to which the socket will - * be bound. - * - * @throws asio::system_error Thrown on failure. - */ - basic_socket(asio::io_context& io_context, - const endpoint_type& endpoint) - : basic_io_object(io_context) - { - asio::error_code ec; - const protocol_type protocol = endpoint.protocol(); - this->get_service().open(this->get_implementation(), protocol, ec); - asio::detail::throw_error(ec, "open"); - this->get_service().bind(this->get_implementation(), endpoint, ec); - asio::detail::throw_error(ec, "bind"); - } - - /// Construct a basic_socket on an existing native socket. - /** - * This constructor creates a socket object to hold an existing native socket. - * - * @param io_context The io_context object that the socket will use to - * dispatch handlers for any asynchronous operations performed on the socket. - * - * @param protocol An object specifying protocol parameters to be used. - * - * @param native_socket A native socket. - * - * @throws asio::system_error Thrown on failure. - */ - basic_socket(asio::io_context& io_context, - const protocol_type& protocol, const native_handle_type& native_socket) - : basic_io_object(io_context) - { - asio::error_code ec; - this->get_service().assign(this->get_implementation(), - protocol, native_socket, ec); - asio::detail::throw_error(ec, "assign"); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a basic_socket from another. - /** - * This constructor moves a socket from one object to another. - * - * @param other The other basic_socket object from which the move will - * occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_socket(io_context&) constructor. - */ - basic_socket(basic_socket&& other) - : basic_io_object(std::move(other)) - { - } - - /// Move-assign a basic_socket from another. - /** - * This assignment operator moves a socket from one object to another. - * - * @param other The other basic_socket object from which the move will - * occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_socket(io_context&) constructor. - */ - basic_socket& operator=(basic_socket&& other) - { - basic_io_object::operator=(std::move(other)); - return *this; - } - - // All sockets have access to each other's implementations. - template - friend class basic_socket; - - /// Move-construct a basic_socket from a socket of another protocol type. - /** - * This constructor moves a socket from one object to another. - * - * @param other The other basic_socket object from which the move will - * occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_socket(io_context&) constructor. - */ - template - basic_socket(basic_socket&& other, - typename enable_if::value>::type* = 0) - : basic_io_object( - other.get_service(), other.get_implementation()) - { - } - - /// Move-assign a basic_socket from a socket of another protocol type. - /** - * This assignment operator moves a socket from one object to another. - * - * @param other The other basic_socket object from which the move will - * occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_socket(io_context&) constructor. - */ - template - typename enable_if::value, - basic_socket>::type& operator=( - basic_socket&& other) - { - basic_socket tmp(std::move(other)); - basic_io_object::operator=(std::move(tmp)); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - -#if defined(ASIO_ENABLE_OLD_SERVICES) - // These functions are provided by basic_io_object<>. -#else // defined(ASIO_ENABLE_OLD_SERVICES) -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - /** - * This function may be used to obtain the io_context object that the I/O - * object uses to dispatch handlers for asynchronous operations. - * - * @return A reference to the io_context object that the I/O object will use - * to dispatch handlers. Ownership is not transferred to the caller. - */ - asio::io_context& get_io_context() - { - return basic_io_object::get_io_context(); - } - - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - /** - * This function may be used to obtain the io_context object that the I/O - * object uses to dispatch handlers for asynchronous operations. - * - * @return A reference to the io_context object that the I/O object will use - * to dispatch handlers. Ownership is not transferred to the caller. - */ - asio::io_context& get_io_service() - { - return basic_io_object::get_io_service(); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Get the executor associated with the object. - executor_type get_executor() ASIO_NOEXCEPT - { - return basic_io_object::get_executor(); - } -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#if !defined(ASIO_NO_EXTENSIONS) - /// Get a reference to the lowest layer. - /** - * This function returns a reference to the lowest layer in a stack of - * layers. Since a basic_socket cannot contain any further layers, it simply - * returns a reference to itself. - * - * @return A reference to the lowest layer in the stack of layers. Ownership - * is not transferred to the caller. - */ - lowest_layer_type& lowest_layer() - { - return *this; - } - - /// Get a const reference to the lowest layer. - /** - * This function returns a const reference to the lowest layer in a stack of - * layers. Since a basic_socket cannot contain any further layers, it simply - * returns a reference to itself. - * - * @return A const reference to the lowest layer in the stack of layers. - * Ownership is not transferred to the caller. - */ - const lowest_layer_type& lowest_layer() const - { - return *this; - } -#endif // !defined(ASIO_NO_EXTENSIONS) - - /// Open the socket using the specified protocol. - /** - * This function opens the socket so that it will use the specified protocol. - * - * @param protocol An object specifying protocol parameters to be used. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * @code - * asio::ip::tcp::socket socket(io_context); - * socket.open(asio::ip::tcp::v4()); - * @endcode - */ - void open(const protocol_type& protocol = protocol_type()) - { - asio::error_code ec; - this->get_service().open(this->get_implementation(), protocol, ec); - asio::detail::throw_error(ec, "open"); - } - - /// Open the socket using the specified protocol. - /** - * This function opens the socket so that it will use the specified protocol. - * - * @param protocol An object specifying which protocol is to be used. - * - * @param ec Set to indicate what error occurred, if any. - * - * @par Example - * @code - * asio::ip::tcp::socket socket(io_context); - * asio::error_code ec; - * socket.open(asio::ip::tcp::v4(), ec); - * if (ec) - * { - * // An error occurred. - * } - * @endcode - */ - ASIO_SYNC_OP_VOID open(const protocol_type& protocol, - asio::error_code& ec) - { - this->get_service().open(this->get_implementation(), protocol, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Assign an existing native socket to the socket. - /* - * This function opens the socket to hold an existing native socket. - * - * @param protocol An object specifying which protocol is to be used. - * - * @param native_socket A native socket. - * - * @throws asio::system_error Thrown on failure. - */ - void assign(const protocol_type& protocol, - const native_handle_type& native_socket) - { - asio::error_code ec; - this->get_service().assign(this->get_implementation(), - protocol, native_socket, ec); - asio::detail::throw_error(ec, "assign"); - } - - /// Assign an existing native socket to the socket. - /* - * This function opens the socket to hold an existing native socket. - * - * @param protocol An object specifying which protocol is to be used. - * - * @param native_socket A native socket. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID assign(const protocol_type& protocol, - const native_handle_type& native_socket, asio::error_code& ec) - { - this->get_service().assign(this->get_implementation(), - protocol, native_socket, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Determine whether the socket is open. - bool is_open() const - { - return this->get_service().is_open(this->get_implementation()); - } - - /// Close the socket. - /** - * This function is used to close the socket. Any asynchronous send, receive - * or connect operations will be cancelled immediately, and will complete - * with the asio::error::operation_aborted error. - * - * @throws asio::system_error Thrown on failure. Note that, even if - * the function indicates an error, the underlying descriptor is closed. - * - * @note For portable behaviour with respect to graceful closure of a - * connected socket, call shutdown() before closing the socket. - */ - void close() - { - asio::error_code ec; - this->get_service().close(this->get_implementation(), ec); - asio::detail::throw_error(ec, "close"); - } - - /// Close the socket. - /** - * This function is used to close the socket. Any asynchronous send, receive - * or connect operations will be cancelled immediately, and will complete - * with the asio::error::operation_aborted error. - * - * @param ec Set to indicate what error occurred, if any. Note that, even if - * the function indicates an error, the underlying descriptor is closed. - * - * @par Example - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::error_code ec; - * socket.close(ec); - * if (ec) - * { - * // An error occurred. - * } - * @endcode - * - * @note For portable behaviour with respect to graceful closure of a - * connected socket, call shutdown() before closing the socket. - */ - ASIO_SYNC_OP_VOID close(asio::error_code& ec) - { - this->get_service().close(this->get_implementation(), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Release ownership of the underlying native socket. - /** - * This function causes all outstanding asynchronous connect, send and receive - * operations to finish immediately, and the handlers for cancelled operations - * will be passed the asio::error::operation_aborted error. Ownership - * of the native socket is then transferred to the caller. - * - * @throws asio::system_error Thrown on failure. - * - * @note This function is unsupported on Windows versions prior to Windows - * 8.1, and will fail with asio::error::operation_not_supported on - * these platforms. - */ -#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \ - && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0603) - __declspec(deprecated("This function always fails with " - "operation_not_supported when used on Windows versions " - "prior to Windows 8.1.")) -#endif - native_handle_type release() - { - asio::error_code ec; - native_handle_type s = this->get_service().release( - this->get_implementation(), ec); - asio::detail::throw_error(ec, "release"); - return s; - } - - /// Release ownership of the underlying native socket. - /** - * This function causes all outstanding asynchronous connect, send and receive - * operations to finish immediately, and the handlers for cancelled operations - * will be passed the asio::error::operation_aborted error. Ownership - * of the native socket is then transferred to the caller. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note This function is unsupported on Windows versions prior to Windows - * 8.1, and will fail with asio::error::operation_not_supported on - * these platforms. - */ -#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \ - && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0603) - __declspec(deprecated("This function always fails with " - "operation_not_supported when used on Windows versions " - "prior to Windows 8.1.")) -#endif - native_handle_type release(asio::error_code& ec) - { - return this->get_service().release(this->get_implementation(), ec); - } - - /// Get the native socket representation. - /** - * This function may be used to obtain the underlying representation of the - * socket. This is intended to allow access to native socket functionality - * that is not otherwise provided. - */ - native_handle_type native_handle() - { - return this->get_service().native_handle(this->get_implementation()); - } - - /// Cancel all asynchronous operations associated with the socket. - /** - * This function causes all outstanding asynchronous connect, send and receive - * operations to finish immediately, and the handlers for cancelled operations - * will be passed the asio::error::operation_aborted error. - * - * @throws asio::system_error Thrown on failure. - * - * @note Calls to cancel() will always fail with - * asio::error::operation_not_supported when run on Windows XP, Windows - * Server 2003, and earlier versions of Windows, unless - * ASIO_ENABLE_CANCELIO is defined. However, the CancelIo function has - * two issues that should be considered before enabling its use: - * - * @li It will only cancel asynchronous operations that were initiated in the - * current thread. - * - * @li It can appear to complete without error, but the request to cancel the - * unfinished operations may be silently ignored by the operating system. - * Whether it works or not seems to depend on the drivers that are installed. - * - * For portable cancellation, consider using one of the following - * alternatives: - * - * @li Disable asio's I/O completion port backend by defining - * ASIO_DISABLE_IOCP. - * - * @li Use the close() function to simultaneously cancel the outstanding - * operations and close the socket. - * - * When running on Windows Vista, Windows Server 2008, and later, the - * CancelIoEx function is always used. This function does not have the - * problems described above. - */ -#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \ - && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600) \ - && !defined(ASIO_ENABLE_CANCELIO) - __declspec(deprecated("By default, this function always fails with " - "operation_not_supported when used on Windows XP, Windows Server 2003, " - "or earlier. Consult documentation for details.")) -#endif - void cancel() - { - asio::error_code ec; - this->get_service().cancel(this->get_implementation(), ec); - asio::detail::throw_error(ec, "cancel"); - } - - /// Cancel all asynchronous operations associated with the socket. - /** - * This function causes all outstanding asynchronous connect, send and receive - * operations to finish immediately, and the handlers for cancelled operations - * will be passed the asio::error::operation_aborted error. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Calls to cancel() will always fail with - * asio::error::operation_not_supported when run on Windows XP, Windows - * Server 2003, and earlier versions of Windows, unless - * ASIO_ENABLE_CANCELIO is defined. However, the CancelIo function has - * two issues that should be considered before enabling its use: - * - * @li It will only cancel asynchronous operations that were initiated in the - * current thread. - * - * @li It can appear to complete without error, but the request to cancel the - * unfinished operations may be silently ignored by the operating system. - * Whether it works or not seems to depend on the drivers that are installed. - * - * For portable cancellation, consider using one of the following - * alternatives: - * - * @li Disable asio's I/O completion port backend by defining - * ASIO_DISABLE_IOCP. - * - * @li Use the close() function to simultaneously cancel the outstanding - * operations and close the socket. - * - * When running on Windows Vista, Windows Server 2008, and later, the - * CancelIoEx function is always used. This function does not have the - * problems described above. - */ -#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \ - && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600) \ - && !defined(ASIO_ENABLE_CANCELIO) - __declspec(deprecated("By default, this function always fails with " - "operation_not_supported when used on Windows XP, Windows Server 2003, " - "or earlier. Consult documentation for details.")) -#endif - ASIO_SYNC_OP_VOID cancel(asio::error_code& ec) - { - this->get_service().cancel(this->get_implementation(), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Determine whether the socket is at the out-of-band data mark. - /** - * This function is used to check whether the socket input is currently - * positioned at the out-of-band data mark. - * - * @return A bool indicating whether the socket is at the out-of-band data - * mark. - * - * @throws asio::system_error Thrown on failure. - */ - bool at_mark() const - { - asio::error_code ec; - bool b = this->get_service().at_mark(this->get_implementation(), ec); - asio::detail::throw_error(ec, "at_mark"); - return b; - } - - /// Determine whether the socket is at the out-of-band data mark. - /** - * This function is used to check whether the socket input is currently - * positioned at the out-of-band data mark. - * - * @param ec Set to indicate what error occurred, if any. - * - * @return A bool indicating whether the socket is at the out-of-band data - * mark. - */ - bool at_mark(asio::error_code& ec) const - { - return this->get_service().at_mark(this->get_implementation(), ec); - } - - /// Determine the number of bytes available for reading. - /** - * This function is used to determine the number of bytes that may be read - * without blocking. - * - * @return The number of bytes that may be read without blocking, or 0 if an - * error occurs. - * - * @throws asio::system_error Thrown on failure. - */ - std::size_t available() const - { - asio::error_code ec; - std::size_t s = this->get_service().available( - this->get_implementation(), ec); - asio::detail::throw_error(ec, "available"); - return s; - } - - /// Determine the number of bytes available for reading. - /** - * This function is used to determine the number of bytes that may be read - * without blocking. - * - * @param ec Set to indicate what error occurred, if any. - * - * @return The number of bytes that may be read without blocking, or 0 if an - * error occurs. - */ - std::size_t available(asio::error_code& ec) const - { - return this->get_service().available(this->get_implementation(), ec); - } - - /// Bind the socket to the given local endpoint. - /** - * This function binds the socket to the specified endpoint on the local - * machine. - * - * @param endpoint An endpoint on the local machine to which the socket will - * be bound. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * @code - * asio::ip::tcp::socket socket(io_context); - * socket.open(asio::ip::tcp::v4()); - * socket.bind(asio::ip::tcp::endpoint( - * asio::ip::tcp::v4(), 12345)); - * @endcode - */ - void bind(const endpoint_type& endpoint) - { - asio::error_code ec; - this->get_service().bind(this->get_implementation(), endpoint, ec); - asio::detail::throw_error(ec, "bind"); - } - - /// Bind the socket to the given local endpoint. - /** - * This function binds the socket to the specified endpoint on the local - * machine. - * - * @param endpoint An endpoint on the local machine to which the socket will - * be bound. - * - * @param ec Set to indicate what error occurred, if any. - * - * @par Example - * @code - * asio::ip::tcp::socket socket(io_context); - * socket.open(asio::ip::tcp::v4()); - * asio::error_code ec; - * socket.bind(asio::ip::tcp::endpoint( - * asio::ip::tcp::v4(), 12345), ec); - * if (ec) - * { - * // An error occurred. - * } - * @endcode - */ - ASIO_SYNC_OP_VOID bind(const endpoint_type& endpoint, - asio::error_code& ec) - { - this->get_service().bind(this->get_implementation(), endpoint, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Connect the socket to the specified endpoint. - /** - * This function is used to connect a socket to the specified remote endpoint. - * The function call will block until the connection is successfully made or - * an error occurs. - * - * The socket is automatically opened if it is not already open. If the - * connect fails, and the socket was automatically opened, the socket is - * not returned to the closed state. - * - * @param peer_endpoint The remote endpoint to which the socket will be - * connected. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * @code - * asio::ip::tcp::socket socket(io_context); - * asio::ip::tcp::endpoint endpoint( - * asio::ip::address::from_string("1.2.3.4"), 12345); - * socket.connect(endpoint); - * @endcode - */ - void connect(const endpoint_type& peer_endpoint) - { - asio::error_code ec; - if (!is_open()) - { - this->get_service().open(this->get_implementation(), - peer_endpoint.protocol(), ec); - asio::detail::throw_error(ec, "connect"); - } - this->get_service().connect(this->get_implementation(), peer_endpoint, ec); - asio::detail::throw_error(ec, "connect"); - } - - /// Connect the socket to the specified endpoint. - /** - * This function is used to connect a socket to the specified remote endpoint. - * The function call will block until the connection is successfully made or - * an error occurs. - * - * The socket is automatically opened if it is not already open. If the - * connect fails, and the socket was automatically opened, the socket is - * not returned to the closed state. - * - * @param peer_endpoint The remote endpoint to which the socket will be - * connected. - * - * @param ec Set to indicate what error occurred, if any. - * - * @par Example - * @code - * asio::ip::tcp::socket socket(io_context); - * asio::ip::tcp::endpoint endpoint( - * asio::ip::address::from_string("1.2.3.4"), 12345); - * asio::error_code ec; - * socket.connect(endpoint, ec); - * if (ec) - * { - * // An error occurred. - * } - * @endcode - */ - ASIO_SYNC_OP_VOID connect(const endpoint_type& peer_endpoint, - asio::error_code& ec) - { - if (!is_open()) - { - this->get_service().open(this->get_implementation(), - peer_endpoint.protocol(), ec); - if (ec) - { - ASIO_SYNC_OP_VOID_RETURN(ec); - } - } - - this->get_service().connect(this->get_implementation(), peer_endpoint, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Start an asynchronous connect. - /** - * This function is used to asynchronously connect a socket to the specified - * remote endpoint. The function call always returns immediately. - * - * The socket is automatically opened if it is not already open. If the - * connect fails, and the socket was automatically opened, the socket is - * not returned to the closed state. - * - * @param peer_endpoint The remote endpoint to which the socket will be - * connected. Copies will be made of the endpoint object as required. - * - * @param handler The handler to be called when the connection operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error // Result of operation - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * @code - * void connect_handler(const asio::error_code& error) - * { - * if (!error) - * { - * // Connect succeeded. - * } - * } - * - * ... - * - * asio::ip::tcp::socket socket(io_context); - * asio::ip::tcp::endpoint endpoint( - * asio::ip::address::from_string("1.2.3.4"), 12345); - * socket.async_connect(endpoint, connect_handler); - * @endcode - */ - template - ASIO_INITFN_RESULT_TYPE(ConnectHandler, - void (asio::error_code)) - async_connect(const endpoint_type& peer_endpoint, - ASIO_MOVE_ARG(ConnectHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ConnectHandler. - ASIO_CONNECT_HANDLER_CHECK(ConnectHandler, handler) type_check; - - if (!is_open()) - { - asio::error_code ec; - const protocol_type protocol = peer_endpoint.protocol(); - this->get_service().open(this->get_implementation(), protocol, ec); - if (ec) - { - async_completion init(handler); - - asio::post(this->get_executor(), - asio::detail::bind_handler( - ASIO_MOVE_CAST(ASIO_HANDLER_TYPE( - ConnectHandler, void (asio::error_code)))( - init.completion_handler), ec)); - - return init.result.get(); - } - } - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_connect(this->get_implementation(), - peer_endpoint, ASIO_MOVE_CAST(ConnectHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_connect( - this->get_implementation(), peer_endpoint, init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Set an option on the socket. - /** - * This function is used to set an option on the socket. - * - * @param option The new option value to be set on the socket. - * - * @throws asio::system_error Thrown on failure. - * - * @sa SettableSocketOption @n - * asio::socket_base::broadcast @n - * asio::socket_base::do_not_route @n - * asio::socket_base::keep_alive @n - * asio::socket_base::linger @n - * asio::socket_base::receive_buffer_size @n - * asio::socket_base::receive_low_watermark @n - * asio::socket_base::reuse_address @n - * asio::socket_base::send_buffer_size @n - * asio::socket_base::send_low_watermark @n - * asio::ip::multicast::join_group @n - * asio::ip::multicast::leave_group @n - * asio::ip::multicast::enable_loopback @n - * asio::ip::multicast::outbound_interface @n - * asio::ip::multicast::hops @n - * asio::ip::tcp::no_delay - * - * @par Example - * Setting the IPPROTO_TCP/TCP_NODELAY option: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::ip::tcp::no_delay option(true); - * socket.set_option(option); - * @endcode - */ - template - void set_option(const SettableSocketOption& option) - { - asio::error_code ec; - this->get_service().set_option(this->get_implementation(), option, ec); - asio::detail::throw_error(ec, "set_option"); - } - - /// Set an option on the socket. - /** - * This function is used to set an option on the socket. - * - * @param option The new option value to be set on the socket. - * - * @param ec Set to indicate what error occurred, if any. - * - * @sa SettableSocketOption @n - * asio::socket_base::broadcast @n - * asio::socket_base::do_not_route @n - * asio::socket_base::keep_alive @n - * asio::socket_base::linger @n - * asio::socket_base::receive_buffer_size @n - * asio::socket_base::receive_low_watermark @n - * asio::socket_base::reuse_address @n - * asio::socket_base::send_buffer_size @n - * asio::socket_base::send_low_watermark @n - * asio::ip::multicast::join_group @n - * asio::ip::multicast::leave_group @n - * asio::ip::multicast::enable_loopback @n - * asio::ip::multicast::outbound_interface @n - * asio::ip::multicast::hops @n - * asio::ip::tcp::no_delay - * - * @par Example - * Setting the IPPROTO_TCP/TCP_NODELAY option: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::ip::tcp::no_delay option(true); - * asio::error_code ec; - * socket.set_option(option, ec); - * if (ec) - * { - * // An error occurred. - * } - * @endcode - */ - template - ASIO_SYNC_OP_VOID set_option(const SettableSocketOption& option, - asio::error_code& ec) - { - this->get_service().set_option(this->get_implementation(), option, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get an option from the socket. - /** - * This function is used to get the current value of an option on the socket. - * - * @param option The option value to be obtained from the socket. - * - * @throws asio::system_error Thrown on failure. - * - * @sa GettableSocketOption @n - * asio::socket_base::broadcast @n - * asio::socket_base::do_not_route @n - * asio::socket_base::keep_alive @n - * asio::socket_base::linger @n - * asio::socket_base::receive_buffer_size @n - * asio::socket_base::receive_low_watermark @n - * asio::socket_base::reuse_address @n - * asio::socket_base::send_buffer_size @n - * asio::socket_base::send_low_watermark @n - * asio::ip::multicast::join_group @n - * asio::ip::multicast::leave_group @n - * asio::ip::multicast::enable_loopback @n - * asio::ip::multicast::outbound_interface @n - * asio::ip::multicast::hops @n - * asio::ip::tcp::no_delay - * - * @par Example - * Getting the value of the SOL_SOCKET/SO_KEEPALIVE option: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::ip::tcp::socket::keep_alive option; - * socket.get_option(option); - * bool is_set = option.value(); - * @endcode - */ - template - void get_option(GettableSocketOption& option) const - { - asio::error_code ec; - this->get_service().get_option(this->get_implementation(), option, ec); - asio::detail::throw_error(ec, "get_option"); - } - - /// Get an option from the socket. - /** - * This function is used to get the current value of an option on the socket. - * - * @param option The option value to be obtained from the socket. - * - * @param ec Set to indicate what error occurred, if any. - * - * @sa GettableSocketOption @n - * asio::socket_base::broadcast @n - * asio::socket_base::do_not_route @n - * asio::socket_base::keep_alive @n - * asio::socket_base::linger @n - * asio::socket_base::receive_buffer_size @n - * asio::socket_base::receive_low_watermark @n - * asio::socket_base::reuse_address @n - * asio::socket_base::send_buffer_size @n - * asio::socket_base::send_low_watermark @n - * asio::ip::multicast::join_group @n - * asio::ip::multicast::leave_group @n - * asio::ip::multicast::enable_loopback @n - * asio::ip::multicast::outbound_interface @n - * asio::ip::multicast::hops @n - * asio::ip::tcp::no_delay - * - * @par Example - * Getting the value of the SOL_SOCKET/SO_KEEPALIVE option: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::ip::tcp::socket::keep_alive option; - * asio::error_code ec; - * socket.get_option(option, ec); - * if (ec) - * { - * // An error occurred. - * } - * bool is_set = option.value(); - * @endcode - */ - template - ASIO_SYNC_OP_VOID get_option(GettableSocketOption& option, - asio::error_code& ec) const - { - this->get_service().get_option(this->get_implementation(), option, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Perform an IO control command on the socket. - /** - * This function is used to execute an IO control command on the socket. - * - * @param command The IO control command to be performed on the socket. - * - * @throws asio::system_error Thrown on failure. - * - * @sa IoControlCommand @n - * asio::socket_base::bytes_readable @n - * asio::socket_base::non_blocking_io - * - * @par Example - * Getting the number of bytes ready to read: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::ip::tcp::socket::bytes_readable command; - * socket.io_control(command); - * std::size_t bytes_readable = command.get(); - * @endcode - */ - template - void io_control(IoControlCommand& command) - { - asio::error_code ec; - this->get_service().io_control(this->get_implementation(), command, ec); - asio::detail::throw_error(ec, "io_control"); - } - - /// Perform an IO control command on the socket. - /** - * This function is used to execute an IO control command on the socket. - * - * @param command The IO control command to be performed on the socket. - * - * @param ec Set to indicate what error occurred, if any. - * - * @sa IoControlCommand @n - * asio::socket_base::bytes_readable @n - * asio::socket_base::non_blocking_io - * - * @par Example - * Getting the number of bytes ready to read: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::ip::tcp::socket::bytes_readable command; - * asio::error_code ec; - * socket.io_control(command, ec); - * if (ec) - * { - * // An error occurred. - * } - * std::size_t bytes_readable = command.get(); - * @endcode - */ - template - ASIO_SYNC_OP_VOID io_control(IoControlCommand& command, - asio::error_code& ec) - { - this->get_service().io_control(this->get_implementation(), command, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Gets the non-blocking mode of the socket. - /** - * @returns @c true if the socket's synchronous operations will fail with - * asio::error::would_block if they are unable to perform the requested - * operation immediately. If @c false, synchronous operations will block - * until complete. - * - * @note The non-blocking mode has no effect on the behaviour of asynchronous - * operations. Asynchronous operations will never fail with the error - * asio::error::would_block. - */ - bool non_blocking() const - { - return this->get_service().non_blocking(this->get_implementation()); - } - - /// Sets the non-blocking mode of the socket. - /** - * @param mode If @c true, the socket's synchronous operations will fail with - * asio::error::would_block if they are unable to perform the requested - * operation immediately. If @c false, synchronous operations will block - * until complete. - * - * @throws asio::system_error Thrown on failure. - * - * @note The non-blocking mode has no effect on the behaviour of asynchronous - * operations. Asynchronous operations will never fail with the error - * asio::error::would_block. - */ - void non_blocking(bool mode) - { - asio::error_code ec; - this->get_service().non_blocking(this->get_implementation(), mode, ec); - asio::detail::throw_error(ec, "non_blocking"); - } - - /// Sets the non-blocking mode of the socket. - /** - * @param mode If @c true, the socket's synchronous operations will fail with - * asio::error::would_block if they are unable to perform the requested - * operation immediately. If @c false, synchronous operations will block - * until complete. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note The non-blocking mode has no effect on the behaviour of asynchronous - * operations. Asynchronous operations will never fail with the error - * asio::error::would_block. - */ - ASIO_SYNC_OP_VOID non_blocking( - bool mode, asio::error_code& ec) - { - this->get_service().non_blocking(this->get_implementation(), mode, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Gets the non-blocking mode of the native socket implementation. - /** - * This function is used to retrieve the non-blocking mode of the underlying - * native socket. This mode has no effect on the behaviour of the socket - * object's synchronous operations. - * - * @returns @c true if the underlying socket is in non-blocking mode and - * direct system calls may fail with asio::error::would_block (or the - * equivalent system error). - * - * @note The current non-blocking mode is cached by the socket object. - * Consequently, the return value may be incorrect if the non-blocking mode - * was set directly on the native socket. - * - * @par Example - * This function is intended to allow the encapsulation of arbitrary - * non-blocking system calls as asynchronous operations, in a way that is - * transparent to the user of the socket object. The following example - * illustrates how Linux's @c sendfile system call might be encapsulated: - * @code template - * struct sendfile_op - * { - * tcp::socket& sock_; - * int fd_; - * Handler handler_; - * off_t offset_; - * std::size_t total_bytes_transferred_; - * - * // Function call operator meeting WriteHandler requirements. - * // Used as the handler for the async_write_some operation. - * void operator()(asio::error_code ec, std::size_t) - * { - * // Put the underlying socket into non-blocking mode. - * if (!ec) - * if (!sock_.native_non_blocking()) - * sock_.native_non_blocking(true, ec); - * - * if (!ec) - * { - * for (;;) - * { - * // Try the system call. - * errno = 0; - * int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536); - * ec = asio::error_code(n < 0 ? errno : 0, - * asio::error::get_system_category()); - * total_bytes_transferred_ += ec ? 0 : n; - * - * // Retry operation immediately if interrupted by signal. - * if (ec == asio::error::interrupted) - * continue; - * - * // Check if we need to run the operation again. - * if (ec == asio::error::would_block - * || ec == asio::error::try_again) - * { - * // We have to wait for the socket to become ready again. - * sock_.async_wait(tcp::socket::wait_write, *this); - * return; - * } - * - * if (ec || n == 0) - * { - * // An error occurred, or we have reached the end of the file. - * // Either way we must exit the loop so we can call the handler. - * break; - * } - * - * // Loop around to try calling sendfile again. - * } - * } - * - * // Pass result back to user's handler. - * handler_(ec, total_bytes_transferred_); - * } - * }; - * - * template - * void async_sendfile(tcp::socket& sock, int fd, Handler h) - * { - * sendfile_op op = { sock, fd, h, 0, 0 }; - * sock.async_wait(tcp::socket::wait_write, op); - * } @endcode - */ - bool native_non_blocking() const - { - return this->get_service().native_non_blocking(this->get_implementation()); - } - - /// Sets the non-blocking mode of the native socket implementation. - /** - * This function is used to modify the non-blocking mode of the underlying - * native socket. It has no effect on the behaviour of the socket object's - * synchronous operations. - * - * @param mode If @c true, the underlying socket is put into non-blocking - * mode and direct system calls may fail with asio::error::would_block - * (or the equivalent system error). - * - * @throws asio::system_error Thrown on failure. If the @c mode is - * @c false, but the current value of @c non_blocking() is @c true, this - * function fails with asio::error::invalid_argument, as the - * combination does not make sense. - * - * @par Example - * This function is intended to allow the encapsulation of arbitrary - * non-blocking system calls as asynchronous operations, in a way that is - * transparent to the user of the socket object. The following example - * illustrates how Linux's @c sendfile system call might be encapsulated: - * @code template - * struct sendfile_op - * { - * tcp::socket& sock_; - * int fd_; - * Handler handler_; - * off_t offset_; - * std::size_t total_bytes_transferred_; - * - * // Function call operator meeting WriteHandler requirements. - * // Used as the handler for the async_write_some operation. - * void operator()(asio::error_code ec, std::size_t) - * { - * // Put the underlying socket into non-blocking mode. - * if (!ec) - * if (!sock_.native_non_blocking()) - * sock_.native_non_blocking(true, ec); - * - * if (!ec) - * { - * for (;;) - * { - * // Try the system call. - * errno = 0; - * int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536); - * ec = asio::error_code(n < 0 ? errno : 0, - * asio::error::get_system_category()); - * total_bytes_transferred_ += ec ? 0 : n; - * - * // Retry operation immediately if interrupted by signal. - * if (ec == asio::error::interrupted) - * continue; - * - * // Check if we need to run the operation again. - * if (ec == asio::error::would_block - * || ec == asio::error::try_again) - * { - * // We have to wait for the socket to become ready again. - * sock_.async_wait(tcp::socket::wait_write, *this); - * return; - * } - * - * if (ec || n == 0) - * { - * // An error occurred, or we have reached the end of the file. - * // Either way we must exit the loop so we can call the handler. - * break; - * } - * - * // Loop around to try calling sendfile again. - * } - * } - * - * // Pass result back to user's handler. - * handler_(ec, total_bytes_transferred_); - * } - * }; - * - * template - * void async_sendfile(tcp::socket& sock, int fd, Handler h) - * { - * sendfile_op op = { sock, fd, h, 0, 0 }; - * sock.async_wait(tcp::socket::wait_write, op); - * } @endcode - */ - void native_non_blocking(bool mode) - { - asio::error_code ec; - this->get_service().native_non_blocking( - this->get_implementation(), mode, ec); - asio::detail::throw_error(ec, "native_non_blocking"); - } - - /// Sets the non-blocking mode of the native socket implementation. - /** - * This function is used to modify the non-blocking mode of the underlying - * native socket. It has no effect on the behaviour of the socket object's - * synchronous operations. - * - * @param mode If @c true, the underlying socket is put into non-blocking - * mode and direct system calls may fail with asio::error::would_block - * (or the equivalent system error). - * - * @param ec Set to indicate what error occurred, if any. If the @c mode is - * @c false, but the current value of @c non_blocking() is @c true, this - * function fails with asio::error::invalid_argument, as the - * combination does not make sense. - * - * @par Example - * This function is intended to allow the encapsulation of arbitrary - * non-blocking system calls as asynchronous operations, in a way that is - * transparent to the user of the socket object. The following example - * illustrates how Linux's @c sendfile system call might be encapsulated: - * @code template - * struct sendfile_op - * { - * tcp::socket& sock_; - * int fd_; - * Handler handler_; - * off_t offset_; - * std::size_t total_bytes_transferred_; - * - * // Function call operator meeting WriteHandler requirements. - * // Used as the handler for the async_write_some operation. - * void operator()(asio::error_code ec, std::size_t) - * { - * // Put the underlying socket into non-blocking mode. - * if (!ec) - * if (!sock_.native_non_blocking()) - * sock_.native_non_blocking(true, ec); - * - * if (!ec) - * { - * for (;;) - * { - * // Try the system call. - * errno = 0; - * int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536); - * ec = asio::error_code(n < 0 ? errno : 0, - * asio::error::get_system_category()); - * total_bytes_transferred_ += ec ? 0 : n; - * - * // Retry operation immediately if interrupted by signal. - * if (ec == asio::error::interrupted) - * continue; - * - * // Check if we need to run the operation again. - * if (ec == asio::error::would_block - * || ec == asio::error::try_again) - * { - * // We have to wait for the socket to become ready again. - * sock_.async_wait(tcp::socket::wait_write, *this); - * return; - * } - * - * if (ec || n == 0) - * { - * // An error occurred, or we have reached the end of the file. - * // Either way we must exit the loop so we can call the handler. - * break; - * } - * - * // Loop around to try calling sendfile again. - * } - * } - * - * // Pass result back to user's handler. - * handler_(ec, total_bytes_transferred_); - * } - * }; - * - * template - * void async_sendfile(tcp::socket& sock, int fd, Handler h) - * { - * sendfile_op op = { sock, fd, h, 0, 0 }; - * sock.async_wait(tcp::socket::wait_write, op); - * } @endcode - */ - ASIO_SYNC_OP_VOID native_non_blocking( - bool mode, asio::error_code& ec) - { - this->get_service().native_non_blocking( - this->get_implementation(), mode, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get the local endpoint of the socket. - /** - * This function is used to obtain the locally bound endpoint of the socket. - * - * @returns An object that represents the local endpoint of the socket. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::ip::tcp::endpoint endpoint = socket.local_endpoint(); - * @endcode - */ - endpoint_type local_endpoint() const - { - asio::error_code ec; - endpoint_type ep = this->get_service().local_endpoint( - this->get_implementation(), ec); - asio::detail::throw_error(ec, "local_endpoint"); - return ep; - } - - /// Get the local endpoint of the socket. - /** - * This function is used to obtain the locally bound endpoint of the socket. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns An object that represents the local endpoint of the socket. - * Returns a default-constructed endpoint object if an error occurred. - * - * @par Example - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::error_code ec; - * asio::ip::tcp::endpoint endpoint = socket.local_endpoint(ec); - * if (ec) - * { - * // An error occurred. - * } - * @endcode - */ - endpoint_type local_endpoint(asio::error_code& ec) const - { - return this->get_service().local_endpoint(this->get_implementation(), ec); - } - - /// Get the remote endpoint of the socket. - /** - * This function is used to obtain the remote endpoint of the socket. - * - * @returns An object that represents the remote endpoint of the socket. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(); - * @endcode - */ - endpoint_type remote_endpoint() const - { - asio::error_code ec; - endpoint_type ep = this->get_service().remote_endpoint( - this->get_implementation(), ec); - asio::detail::throw_error(ec, "remote_endpoint"); - return ep; - } - - /// Get the remote endpoint of the socket. - /** - * This function is used to obtain the remote endpoint of the socket. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns An object that represents the remote endpoint of the socket. - * Returns a default-constructed endpoint object if an error occurred. - * - * @par Example - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::error_code ec; - * asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec); - * if (ec) - * { - * // An error occurred. - * } - * @endcode - */ - endpoint_type remote_endpoint(asio::error_code& ec) const - { - return this->get_service().remote_endpoint(this->get_implementation(), ec); - } - - /// Disable sends or receives on the socket. - /** - * This function is used to disable send operations, receive operations, or - * both. - * - * @param what Determines what types of operation will no longer be allowed. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * Shutting down the send side of the socket: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * socket.shutdown(asio::ip::tcp::socket::shutdown_send); - * @endcode - */ - void shutdown(shutdown_type what) - { - asio::error_code ec; - this->get_service().shutdown(this->get_implementation(), what, ec); - asio::detail::throw_error(ec, "shutdown"); - } - - /// Disable sends or receives on the socket. - /** - * This function is used to disable send operations, receive operations, or - * both. - * - * @param what Determines what types of operation will no longer be allowed. - * - * @param ec Set to indicate what error occurred, if any. - * - * @par Example - * Shutting down the send side of the socket: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::error_code ec; - * socket.shutdown(asio::ip::tcp::socket::shutdown_send, ec); - * if (ec) - * { - * // An error occurred. - * } - * @endcode - */ - ASIO_SYNC_OP_VOID shutdown(shutdown_type what, - asio::error_code& ec) - { - this->get_service().shutdown(this->get_implementation(), what, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Wait for the socket to become ready to read, ready to write, or to have - /// pending error conditions. - /** - * This function is used to perform a blocking wait for a socket to enter - * a ready to read, write or error condition state. - * - * @param w Specifies the desired socket state. - * - * @par Example - * Waiting for a socket to become readable. - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * socket.wait(asio::ip::tcp::socket::wait_read); - * @endcode - */ - void wait(wait_type w) - { - asio::error_code ec; - this->get_service().wait(this->get_implementation(), w, ec); - asio::detail::throw_error(ec, "wait"); - } - - /// Wait for the socket to become ready to read, ready to write, or to have - /// pending error conditions. - /** - * This function is used to perform a blocking wait for a socket to enter - * a ready to read, write or error condition state. - * - * @param w Specifies the desired socket state. - * - * @param ec Set to indicate what error occurred, if any. - * - * @par Example - * Waiting for a socket to become readable. - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::error_code ec; - * socket.wait(asio::ip::tcp::socket::wait_read, ec); - * @endcode - */ - ASIO_SYNC_OP_VOID wait(wait_type w, asio::error_code& ec) - { - this->get_service().wait(this->get_implementation(), w, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Asynchronously wait for the socket to become ready to read, ready to - /// write, or to have pending error conditions. - /** - * This function is used to perform an asynchronous wait for a socket to enter - * a ready to read, write or error condition state. - * - * @param w Specifies the desired socket state. - * - * @param handler The handler to be called when the wait operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error // Result of operation - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * @code - * void wait_handler(const asio::error_code& error) - * { - * if (!error) - * { - * // Wait succeeded. - * } - * } - * - * ... - * - * asio::ip::tcp::socket socket(io_context); - * ... - * socket.async_wait(asio::ip::tcp::socket::wait_read, wait_handler); - * @endcode - */ - template - ASIO_INITFN_RESULT_TYPE(WaitHandler, - void (asio::error_code)) - async_wait(wait_type w, ASIO_MOVE_ARG(WaitHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WaitHandler. - ASIO_WAIT_HANDLER_CHECK(WaitHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_wait(this->get_implementation(), - w, ASIO_MOVE_CAST(WaitHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_wait(this->get_implementation(), - w, init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - -protected: - /// Protected destructor to prevent deletion through this type. - /** - * This function destroys the socket, cancelling any outstanding asynchronous - * operations associated with the socket as if by calling @c cancel. - */ - ~basic_socket() - { - } - -private: - // Disallow copying and assignment. - basic_socket(const basic_socket&) ASIO_DELETED; - basic_socket& operator=(const basic_socket&) ASIO_DELETED; -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if !defined(ASIO_ENABLE_OLD_SERVICES) -# undef ASIO_SVC_T -#endif // !defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_BASIC_SOCKET_HPP diff --git a/tools/sdk/include/asio/asio/basic_socket_acceptor.hpp b/tools/sdk/include/asio/asio/basic_socket_acceptor.hpp deleted file mode 100644 index ed201bbcaec..00000000000 --- a/tools/sdk/include/asio/asio/basic_socket_acceptor.hpp +++ /dev/null @@ -1,1986 +0,0 @@ -// -// basic_socket_acceptor.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_BASIC_SOCKET_ACCEPTOR_HPP -#define ASIO_BASIC_SOCKET_ACCEPTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/basic_io_object.hpp" -#include "asio/basic_socket.hpp" -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/error.hpp" -#include "asio/socket_base.hpp" - -#if defined(ASIO_HAS_MOVE) -# include -#endif // defined(ASIO_HAS_MOVE) - -#if defined(ASIO_ENABLE_OLD_SERVICES) -# include "asio/socket_acceptor_service.hpp" -#else // defined(ASIO_ENABLE_OLD_SERVICES) -# if defined(ASIO_WINDOWS_RUNTIME) -# include "asio/detail/null_socket_service.hpp" -# define ASIO_SVC_T detail::null_socket_service -# elif defined(ASIO_HAS_IOCP) -# include "asio/detail/win_iocp_socket_service.hpp" -# define ASIO_SVC_T detail::win_iocp_socket_service -# else -# include "asio/detail/reactive_socket_service.hpp" -# define ASIO_SVC_T detail::reactive_socket_service -# endif -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Provides the ability to accept new connections. -/** - * The basic_socket_acceptor class template is used for accepting new socket - * connections. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - * - * @par Example - * Opening a socket acceptor with the SO_REUSEADDR option enabled: - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * asio::ip::tcp::endpoint endpoint(asio::ip::tcp::v4(), port); - * acceptor.open(endpoint.protocol()); - * acceptor.set_option(asio::ip::tcp::acceptor::reuse_address(true)); - * acceptor.bind(endpoint); - * acceptor.listen(); - * @endcode - */ -template )> -class basic_socket_acceptor - : ASIO_SVC_ACCESS basic_io_object, - public socket_base -{ -public: - /// The type of the executor associated with the object. - typedef io_context::executor_type executor_type; - - /// The native representation of an acceptor. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined native_handle_type; -#else - typedef typename ASIO_SVC_T::native_handle_type native_handle_type; -#endif - - /// The protocol type. - typedef Protocol protocol_type; - - /// The endpoint type. - typedef typename Protocol::endpoint endpoint_type; - - /// Construct an acceptor without opening it. - /** - * This constructor creates an acceptor without opening it to listen for new - * connections. The open() function must be called before the acceptor can - * accept new socket connections. - * - * @param io_context The io_context object that the acceptor will use to - * dispatch handlers for any asynchronous operations performed on the - * acceptor. - */ - explicit basic_socket_acceptor(asio::io_context& io_context) - : basic_io_object(io_context) - { - } - - /// Construct an open acceptor. - /** - * This constructor creates an acceptor and automatically opens it. - * - * @param io_context The io_context object that the acceptor will use to - * dispatch handlers for any asynchronous operations performed on the - * acceptor. - * - * @param protocol An object specifying protocol parameters to be used. - * - * @throws asio::system_error Thrown on failure. - */ - basic_socket_acceptor(asio::io_context& io_context, - const protocol_type& protocol) - : basic_io_object(io_context) - { - asio::error_code ec; - this->get_service().open(this->get_implementation(), protocol, ec); - asio::detail::throw_error(ec, "open"); - } - - /// Construct an acceptor opened on the given endpoint. - /** - * This constructor creates an acceptor and automatically opens it to listen - * for new connections on the specified endpoint. - * - * @param io_context The io_context object that the acceptor will use to - * dispatch handlers for any asynchronous operations performed on the - * acceptor. - * - * @param endpoint An endpoint on the local machine on which the acceptor - * will listen for new connections. - * - * @param reuse_addr Whether the constructor should set the socket option - * socket_base::reuse_address. - * - * @throws asio::system_error Thrown on failure. - * - * @note This constructor is equivalent to the following code: - * @code - * basic_socket_acceptor acceptor(io_context); - * acceptor.open(endpoint.protocol()); - * if (reuse_addr) - * acceptor.set_option(socket_base::reuse_address(true)); - * acceptor.bind(endpoint); - * acceptor.listen(listen_backlog); - * @endcode - */ - basic_socket_acceptor(asio::io_context& io_context, - const endpoint_type& endpoint, bool reuse_addr = true) - : basic_io_object(io_context) - { - asio::error_code ec; - const protocol_type protocol = endpoint.protocol(); - this->get_service().open(this->get_implementation(), protocol, ec); - asio::detail::throw_error(ec, "open"); - if (reuse_addr) - { - this->get_service().set_option(this->get_implementation(), - socket_base::reuse_address(true), ec); - asio::detail::throw_error(ec, "set_option"); - } - this->get_service().bind(this->get_implementation(), endpoint, ec); - asio::detail::throw_error(ec, "bind"); - this->get_service().listen(this->get_implementation(), - socket_base::max_listen_connections, ec); - asio::detail::throw_error(ec, "listen"); - } - - /// Construct a basic_socket_acceptor on an existing native acceptor. - /** - * This constructor creates an acceptor object to hold an existing native - * acceptor. - * - * @param io_context The io_context object that the acceptor will use to - * dispatch handlers for any asynchronous operations performed on the - * acceptor. - * - * @param protocol An object specifying protocol parameters to be used. - * - * @param native_acceptor A native acceptor. - * - * @throws asio::system_error Thrown on failure. - */ - basic_socket_acceptor(asio::io_context& io_context, - const protocol_type& protocol, const native_handle_type& native_acceptor) - : basic_io_object(io_context) - { - asio::error_code ec; - this->get_service().assign(this->get_implementation(), - protocol, native_acceptor, ec); - asio::detail::throw_error(ec, "assign"); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a basic_socket_acceptor from another. - /** - * This constructor moves an acceptor from one object to another. - * - * @param other The other basic_socket_acceptor object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_socket_acceptor(io_context&) constructor. - */ - basic_socket_acceptor(basic_socket_acceptor&& other) - : basic_io_object(std::move(other)) - { - } - - /// Move-assign a basic_socket_acceptor from another. - /** - * This assignment operator moves an acceptor from one object to another. - * - * @param other The other basic_socket_acceptor object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_socket_acceptor(io_context&) constructor. - */ - basic_socket_acceptor& operator=(basic_socket_acceptor&& other) - { - basic_io_object::operator=(std::move(other)); - return *this; - } - - // All socket acceptors have access to each other's implementations. - template - friend class basic_socket_acceptor; - - /// Move-construct a basic_socket_acceptor from an acceptor of another - /// protocol type. - /** - * This constructor moves an acceptor from one object to another. - * - * @param other The other basic_socket_acceptor object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_socket(io_context&) constructor. - */ - template - basic_socket_acceptor( - basic_socket_acceptor&& other, - typename enable_if::value>::type* = 0) - : basic_io_object( - other.get_service(), other.get_implementation()) - { - } - - /// Move-assign a basic_socket_acceptor from an acceptor of another protocol - /// type. - /** - * This assignment operator moves an acceptor from one object to another. - * - * @param other The other basic_socket_acceptor object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_socket(io_context&) constructor. - */ - template - typename enable_if::value, - basic_socket_acceptor>::type& operator=( - basic_socket_acceptor&& other) - { - basic_socket_acceptor tmp(std::move(other)); - basic_io_object::operator=(std::move(tmp)); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destroys the acceptor. - /** - * This function destroys the acceptor, cancelling any outstanding - * asynchronous operations associated with the acceptor as if by calling - * @c cancel. - */ - ~basic_socket_acceptor() - { - } - -#if defined(ASIO_ENABLE_OLD_SERVICES) - // These functions are provided by basic_io_object<>. -#else // defined(ASIO_ENABLE_OLD_SERVICES) -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - /** - * This function may be used to obtain the io_context object that the I/O - * object uses to dispatch handlers for asynchronous operations. - * - * @return A reference to the io_context object that the I/O object will use - * to dispatch handlers. Ownership is not transferred to the caller. - */ - asio::io_context& get_io_context() - { - return basic_io_object::get_io_context(); - } - - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - /** - * This function may be used to obtain the io_context object that the I/O - * object uses to dispatch handlers for asynchronous operations. - * - * @return A reference to the io_context object that the I/O object will use - * to dispatch handlers. Ownership is not transferred to the caller. - */ - asio::io_context& get_io_service() - { - return basic_io_object::get_io_service(); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Get the executor associated with the object. - executor_type get_executor() ASIO_NOEXCEPT - { - return basic_io_object::get_executor(); - } -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - - /// Open the acceptor using the specified protocol. - /** - * This function opens the socket acceptor so that it will use the specified - * protocol. - * - * @param protocol An object specifying which protocol is to be used. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * acceptor.open(asio::ip::tcp::v4()); - * @endcode - */ - void open(const protocol_type& protocol = protocol_type()) - { - asio::error_code ec; - this->get_service().open(this->get_implementation(), protocol, ec); - asio::detail::throw_error(ec, "open"); - } - - /// Open the acceptor using the specified protocol. - /** - * This function opens the socket acceptor so that it will use the specified - * protocol. - * - * @param protocol An object specifying which protocol is to be used. - * - * @param ec Set to indicate what error occurred, if any. - * - * @par Example - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * asio::error_code ec; - * acceptor.open(asio::ip::tcp::v4(), ec); - * if (ec) - * { - * // An error occurred. - * } - * @endcode - */ - ASIO_SYNC_OP_VOID open(const protocol_type& protocol, - asio::error_code& ec) - { - this->get_service().open(this->get_implementation(), protocol, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Assigns an existing native acceptor to the acceptor. - /* - * This function opens the acceptor to hold an existing native acceptor. - * - * @param protocol An object specifying which protocol is to be used. - * - * @param native_acceptor A native acceptor. - * - * @throws asio::system_error Thrown on failure. - */ - void assign(const protocol_type& protocol, - const native_handle_type& native_acceptor) - { - asio::error_code ec; - this->get_service().assign(this->get_implementation(), - protocol, native_acceptor, ec); - asio::detail::throw_error(ec, "assign"); - } - - /// Assigns an existing native acceptor to the acceptor. - /* - * This function opens the acceptor to hold an existing native acceptor. - * - * @param protocol An object specifying which protocol is to be used. - * - * @param native_acceptor A native acceptor. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID assign(const protocol_type& protocol, - const native_handle_type& native_acceptor, asio::error_code& ec) - { - this->get_service().assign(this->get_implementation(), - protocol, native_acceptor, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Determine whether the acceptor is open. - bool is_open() const - { - return this->get_service().is_open(this->get_implementation()); - } - - /// Bind the acceptor to the given local endpoint. - /** - * This function binds the socket acceptor to the specified endpoint on the - * local machine. - * - * @param endpoint An endpoint on the local machine to which the socket - * acceptor will be bound. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * asio::ip::tcp::endpoint endpoint(asio::ip::tcp::v4(), 12345); - * acceptor.open(endpoint.protocol()); - * acceptor.bind(endpoint); - * @endcode - */ - void bind(const endpoint_type& endpoint) - { - asio::error_code ec; - this->get_service().bind(this->get_implementation(), endpoint, ec); - asio::detail::throw_error(ec, "bind"); - } - - /// Bind the acceptor to the given local endpoint. - /** - * This function binds the socket acceptor to the specified endpoint on the - * local machine. - * - * @param endpoint An endpoint on the local machine to which the socket - * acceptor will be bound. - * - * @param ec Set to indicate what error occurred, if any. - * - * @par Example - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * asio::ip::tcp::endpoint endpoint(asio::ip::tcp::v4(), 12345); - * acceptor.open(endpoint.protocol()); - * asio::error_code ec; - * acceptor.bind(endpoint, ec); - * if (ec) - * { - * // An error occurred. - * } - * @endcode - */ - ASIO_SYNC_OP_VOID bind(const endpoint_type& endpoint, - asio::error_code& ec) - { - this->get_service().bind(this->get_implementation(), endpoint, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Place the acceptor into the state where it will listen for new - /// connections. - /** - * This function puts the socket acceptor into the state where it may accept - * new connections. - * - * @param backlog The maximum length of the queue of pending connections. - * - * @throws asio::system_error Thrown on failure. - */ - void listen(int backlog = socket_base::max_listen_connections) - { - asio::error_code ec; - this->get_service().listen(this->get_implementation(), backlog, ec); - asio::detail::throw_error(ec, "listen"); - } - - /// Place the acceptor into the state where it will listen for new - /// connections. - /** - * This function puts the socket acceptor into the state where it may accept - * new connections. - * - * @param backlog The maximum length of the queue of pending connections. - * - * @param ec Set to indicate what error occurred, if any. - * - * @par Example - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::error_code ec; - * acceptor.listen(asio::socket_base::max_listen_connections, ec); - * if (ec) - * { - * // An error occurred. - * } - * @endcode - */ - ASIO_SYNC_OP_VOID listen(int backlog, asio::error_code& ec) - { - this->get_service().listen(this->get_implementation(), backlog, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Close the acceptor. - /** - * This function is used to close the acceptor. Any asynchronous accept - * operations will be cancelled immediately. - * - * A subsequent call to open() is required before the acceptor can again be - * used to again perform socket accept operations. - * - * @throws asio::system_error Thrown on failure. - */ - void close() - { - asio::error_code ec; - this->get_service().close(this->get_implementation(), ec); - asio::detail::throw_error(ec, "close"); - } - - /// Close the acceptor. - /** - * This function is used to close the acceptor. Any asynchronous accept - * operations will be cancelled immediately. - * - * A subsequent call to open() is required before the acceptor can again be - * used to again perform socket accept operations. - * - * @param ec Set to indicate what error occurred, if any. - * - * @par Example - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::error_code ec; - * acceptor.close(ec); - * if (ec) - * { - * // An error occurred. - * } - * @endcode - */ - ASIO_SYNC_OP_VOID close(asio::error_code& ec) - { - this->get_service().close(this->get_implementation(), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Release ownership of the underlying native acceptor. - /** - * This function causes all outstanding asynchronous accept operations to - * finish immediately, and the handlers for cancelled operations will be - * passed the asio::error::operation_aborted error. Ownership of the - * native acceptor is then transferred to the caller. - * - * @throws asio::system_error Thrown on failure. - * - * @note This function is unsupported on Windows versions prior to Windows - * 8.1, and will fail with asio::error::operation_not_supported on - * these platforms. - */ -#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \ - && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0603) - __declspec(deprecated("This function always fails with " - "operation_not_supported when used on Windows versions " - "prior to Windows 8.1.")) -#endif - native_handle_type release() - { - asio::error_code ec; - native_handle_type s = this->get_service().release( - this->get_implementation(), ec); - asio::detail::throw_error(ec, "release"); - return s; - } - - /// Release ownership of the underlying native acceptor. - /** - * This function causes all outstanding asynchronous accept operations to - * finish immediately, and the handlers for cancelled operations will be - * passed the asio::error::operation_aborted error. Ownership of the - * native acceptor is then transferred to the caller. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note This function is unsupported on Windows versions prior to Windows - * 8.1, and will fail with asio::error::operation_not_supported on - * these platforms. - */ -#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \ - && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0603) - __declspec(deprecated("This function always fails with " - "operation_not_supported when used on Windows versions " - "prior to Windows 8.1.")) -#endif - native_handle_type release(asio::error_code& ec) - { - return this->get_service().release(this->get_implementation(), ec); - } - - /// Get the native acceptor representation. - /** - * This function may be used to obtain the underlying representation of the - * acceptor. This is intended to allow access to native acceptor functionality - * that is not otherwise provided. - */ - native_handle_type native_handle() - { - return this->get_service().native_handle(this->get_implementation()); - } - - /// Cancel all asynchronous operations associated with the acceptor. - /** - * This function causes all outstanding asynchronous connect, send and receive - * operations to finish immediately, and the handlers for cancelled operations - * will be passed the asio::error::operation_aborted error. - * - * @throws asio::system_error Thrown on failure. - */ - void cancel() - { - asio::error_code ec; - this->get_service().cancel(this->get_implementation(), ec); - asio::detail::throw_error(ec, "cancel"); - } - - /// Cancel all asynchronous operations associated with the acceptor. - /** - * This function causes all outstanding asynchronous connect, send and receive - * operations to finish immediately, and the handlers for cancelled operations - * will be passed the asio::error::operation_aborted error. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID cancel(asio::error_code& ec) - { - this->get_service().cancel(this->get_implementation(), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Set an option on the acceptor. - /** - * This function is used to set an option on the acceptor. - * - * @param option The new option value to be set on the acceptor. - * - * @throws asio::system_error Thrown on failure. - * - * @sa SettableSocketOption @n - * asio::socket_base::reuse_address - * asio::socket_base::enable_connection_aborted - * - * @par Example - * Setting the SOL_SOCKET/SO_REUSEADDR option: - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::ip::tcp::acceptor::reuse_address option(true); - * acceptor.set_option(option); - * @endcode - */ - template - void set_option(const SettableSocketOption& option) - { - asio::error_code ec; - this->get_service().set_option(this->get_implementation(), option, ec); - asio::detail::throw_error(ec, "set_option"); - } - - /// Set an option on the acceptor. - /** - * This function is used to set an option on the acceptor. - * - * @param option The new option value to be set on the acceptor. - * - * @param ec Set to indicate what error occurred, if any. - * - * @sa SettableSocketOption @n - * asio::socket_base::reuse_address - * asio::socket_base::enable_connection_aborted - * - * @par Example - * Setting the SOL_SOCKET/SO_REUSEADDR option: - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::ip::tcp::acceptor::reuse_address option(true); - * asio::error_code ec; - * acceptor.set_option(option, ec); - * if (ec) - * { - * // An error occurred. - * } - * @endcode - */ - template - ASIO_SYNC_OP_VOID set_option(const SettableSocketOption& option, - asio::error_code& ec) - { - this->get_service().set_option(this->get_implementation(), option, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get an option from the acceptor. - /** - * This function is used to get the current value of an option on the - * acceptor. - * - * @param option The option value to be obtained from the acceptor. - * - * @throws asio::system_error Thrown on failure. - * - * @sa GettableSocketOption @n - * asio::socket_base::reuse_address - * - * @par Example - * Getting the value of the SOL_SOCKET/SO_REUSEADDR option: - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::ip::tcp::acceptor::reuse_address option; - * acceptor.get_option(option); - * bool is_set = option.get(); - * @endcode - */ - template - void get_option(GettableSocketOption& option) const - { - asio::error_code ec; - this->get_service().get_option(this->get_implementation(), option, ec); - asio::detail::throw_error(ec, "get_option"); - } - - /// Get an option from the acceptor. - /** - * This function is used to get the current value of an option on the - * acceptor. - * - * @param option The option value to be obtained from the acceptor. - * - * @param ec Set to indicate what error occurred, if any. - * - * @sa GettableSocketOption @n - * asio::socket_base::reuse_address - * - * @par Example - * Getting the value of the SOL_SOCKET/SO_REUSEADDR option: - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::ip::tcp::acceptor::reuse_address option; - * asio::error_code ec; - * acceptor.get_option(option, ec); - * if (ec) - * { - * // An error occurred. - * } - * bool is_set = option.get(); - * @endcode - */ - template - ASIO_SYNC_OP_VOID get_option(GettableSocketOption& option, - asio::error_code& ec) const - { - this->get_service().get_option(this->get_implementation(), option, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Perform an IO control command on the acceptor. - /** - * This function is used to execute an IO control command on the acceptor. - * - * @param command The IO control command to be performed on the acceptor. - * - * @throws asio::system_error Thrown on failure. - * - * @sa IoControlCommand @n - * asio::socket_base::non_blocking_io - * - * @par Example - * Getting the number of bytes ready to read: - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::ip::tcp::acceptor::non_blocking_io command(true); - * socket.io_control(command); - * @endcode - */ - template - void io_control(IoControlCommand& command) - { - asio::error_code ec; - this->get_service().io_control(this->get_implementation(), command, ec); - asio::detail::throw_error(ec, "io_control"); - } - - /// Perform an IO control command on the acceptor. - /** - * This function is used to execute an IO control command on the acceptor. - * - * @param command The IO control command to be performed on the acceptor. - * - * @param ec Set to indicate what error occurred, if any. - * - * @sa IoControlCommand @n - * asio::socket_base::non_blocking_io - * - * @par Example - * Getting the number of bytes ready to read: - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::ip::tcp::acceptor::non_blocking_io command(true); - * asio::error_code ec; - * socket.io_control(command, ec); - * if (ec) - * { - * // An error occurred. - * } - * @endcode - */ - template - ASIO_SYNC_OP_VOID io_control(IoControlCommand& command, - asio::error_code& ec) - { - this->get_service().io_control(this->get_implementation(), command, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Gets the non-blocking mode of the acceptor. - /** - * @returns @c true if the acceptor's synchronous operations will fail with - * asio::error::would_block if they are unable to perform the requested - * operation immediately. If @c false, synchronous operations will block - * until complete. - * - * @note The non-blocking mode has no effect on the behaviour of asynchronous - * operations. Asynchronous operations will never fail with the error - * asio::error::would_block. - */ - bool non_blocking() const - { - return this->get_service().non_blocking(this->get_implementation()); - } - - /// Sets the non-blocking mode of the acceptor. - /** - * @param mode If @c true, the acceptor's synchronous operations will fail - * with asio::error::would_block if they are unable to perform the - * requested operation immediately. If @c false, synchronous operations will - * block until complete. - * - * @throws asio::system_error Thrown on failure. - * - * @note The non-blocking mode has no effect on the behaviour of asynchronous - * operations. Asynchronous operations will never fail with the error - * asio::error::would_block. - */ - void non_blocking(bool mode) - { - asio::error_code ec; - this->get_service().non_blocking(this->get_implementation(), mode, ec); - asio::detail::throw_error(ec, "non_blocking"); - } - - /// Sets the non-blocking mode of the acceptor. - /** - * @param mode If @c true, the acceptor's synchronous operations will fail - * with asio::error::would_block if they are unable to perform the - * requested operation immediately. If @c false, synchronous operations will - * block until complete. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note The non-blocking mode has no effect on the behaviour of asynchronous - * operations. Asynchronous operations will never fail with the error - * asio::error::would_block. - */ - ASIO_SYNC_OP_VOID non_blocking( - bool mode, asio::error_code& ec) - { - this->get_service().non_blocking(this->get_implementation(), mode, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Gets the non-blocking mode of the native acceptor implementation. - /** - * This function is used to retrieve the non-blocking mode of the underlying - * native acceptor. This mode has no effect on the behaviour of the acceptor - * object's synchronous operations. - * - * @returns @c true if the underlying acceptor is in non-blocking mode and - * direct system calls may fail with asio::error::would_block (or the - * equivalent system error). - * - * @note The current non-blocking mode is cached by the acceptor object. - * Consequently, the return value may be incorrect if the non-blocking mode - * was set directly on the native acceptor. - */ - bool native_non_blocking() const - { - return this->get_service().native_non_blocking(this->get_implementation()); - } - - /// Sets the non-blocking mode of the native acceptor implementation. - /** - * This function is used to modify the non-blocking mode of the underlying - * native acceptor. It has no effect on the behaviour of the acceptor object's - * synchronous operations. - * - * @param mode If @c true, the underlying acceptor is put into non-blocking - * mode and direct system calls may fail with asio::error::would_block - * (or the equivalent system error). - * - * @throws asio::system_error Thrown on failure. If the @c mode is - * @c false, but the current value of @c non_blocking() is @c true, this - * function fails with asio::error::invalid_argument, as the - * combination does not make sense. - */ - void native_non_blocking(bool mode) - { - asio::error_code ec; - this->get_service().native_non_blocking( - this->get_implementation(), mode, ec); - asio::detail::throw_error(ec, "native_non_blocking"); - } - - /// Sets the non-blocking mode of the native acceptor implementation. - /** - * This function is used to modify the non-blocking mode of the underlying - * native acceptor. It has no effect on the behaviour of the acceptor object's - * synchronous operations. - * - * @param mode If @c true, the underlying acceptor is put into non-blocking - * mode and direct system calls may fail with asio::error::would_block - * (or the equivalent system error). - * - * @param ec Set to indicate what error occurred, if any. If the @c mode is - * @c false, but the current value of @c non_blocking() is @c true, this - * function fails with asio::error::invalid_argument, as the - * combination does not make sense. - */ - ASIO_SYNC_OP_VOID native_non_blocking( - bool mode, asio::error_code& ec) - { - this->get_service().native_non_blocking( - this->get_implementation(), mode, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get the local endpoint of the acceptor. - /** - * This function is used to obtain the locally bound endpoint of the acceptor. - * - * @returns An object that represents the local endpoint of the acceptor. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint(); - * @endcode - */ - endpoint_type local_endpoint() const - { - asio::error_code ec; - endpoint_type ep = this->get_service().local_endpoint( - this->get_implementation(), ec); - asio::detail::throw_error(ec, "local_endpoint"); - return ep; - } - - /// Get the local endpoint of the acceptor. - /** - * This function is used to obtain the locally bound endpoint of the acceptor. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns An object that represents the local endpoint of the acceptor. - * Returns a default-constructed endpoint object if an error occurred and the - * error handler did not throw an exception. - * - * @par Example - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::error_code ec; - * asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint(ec); - * if (ec) - * { - * // An error occurred. - * } - * @endcode - */ - endpoint_type local_endpoint(asio::error_code& ec) const - { - return this->get_service().local_endpoint(this->get_implementation(), ec); - } - - /// Wait for the acceptor to become ready to read, ready to write, or to have - /// pending error conditions. - /** - * This function is used to perform a blocking wait for an acceptor to enter - * a ready to read, write or error condition state. - * - * @param w Specifies the desired acceptor state. - * - * @par Example - * Waiting for an acceptor to become readable. - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * acceptor.wait(asio::ip::tcp::acceptor::wait_read); - * @endcode - */ - void wait(wait_type w) - { - asio::error_code ec; - this->get_service().wait(this->get_implementation(), w, ec); - asio::detail::throw_error(ec, "wait"); - } - - /// Wait for the acceptor to become ready to read, ready to write, or to have - /// pending error conditions. - /** - * This function is used to perform a blocking wait for an acceptor to enter - * a ready to read, write or error condition state. - * - * @param w Specifies the desired acceptor state. - * - * @param ec Set to indicate what error occurred, if any. - * - * @par Example - * Waiting for an acceptor to become readable. - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::error_code ec; - * acceptor.wait(asio::ip::tcp::acceptor::wait_read, ec); - * @endcode - */ - ASIO_SYNC_OP_VOID wait(wait_type w, asio::error_code& ec) - { - this->get_service().wait(this->get_implementation(), w, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Asynchronously wait for the acceptor to become ready to read, ready to - /// write, or to have pending error conditions. - /** - * This function is used to perform an asynchronous wait for an acceptor to - * enter a ready to read, write or error condition state. - * - * @param w Specifies the desired acceptor state. - * - * @param handler The handler to be called when the wait operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error // Result of operation - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * @code - * void wait_handler(const asio::error_code& error) - * { - * if (!error) - * { - * // Wait succeeded. - * } - * } - * - * ... - * - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * acceptor.async_wait( - * asio::ip::tcp::acceptor::wait_read, - * wait_handler); - * @endcode - */ - template - ASIO_INITFN_RESULT_TYPE(WaitHandler, - void (asio::error_code)) - async_wait(wait_type w, ASIO_MOVE_ARG(WaitHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WaitHandler. - ASIO_WAIT_HANDLER_CHECK(WaitHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_wait(this->get_implementation(), - w, ASIO_MOVE_CAST(WaitHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_wait(this->get_implementation(), - w, init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - -#if !defined(ASIO_NO_EXTENSIONS) - /// Accept a new connection. - /** - * This function is used to accept a new connection from a peer into the - * given socket. The function call will block until a new connection has been - * accepted successfully or an error occurs. - * - * @param peer The socket into which the new connection will be accepted. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::ip::tcp::socket socket(io_context); - * acceptor.accept(socket); - * @endcode - */ -#if defined(ASIO_ENABLE_OLD_SERVICES) - template - void accept(basic_socket& peer, - typename enable_if::value>::type* = 0) -#else // defined(ASIO_ENABLE_OLD_SERVICES) - template - void accept(basic_socket& peer, - typename enable_if::value>::type* = 0) -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - { - asio::error_code ec; - this->get_service().accept(this->get_implementation(), - peer, static_cast(0), ec); - asio::detail::throw_error(ec, "accept"); - } - - /// Accept a new connection. - /** - * This function is used to accept a new connection from a peer into the - * given socket. The function call will block until a new connection has been - * accepted successfully or an error occurs. - * - * @param peer The socket into which the new connection will be accepted. - * - * @param ec Set to indicate what error occurred, if any. - * - * @par Example - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::ip::tcp::socket socket(io_context); - * asio::error_code ec; - * acceptor.accept(socket, ec); - * if (ec) - * { - * // An error occurred. - * } - * @endcode - */ -#if defined(ASIO_ENABLE_OLD_SERVICES) - template - ASIO_SYNC_OP_VOID accept( - basic_socket& peer, - asio::error_code& ec, - typename enable_if::value>::type* = 0) -#else // defined(ASIO_ENABLE_OLD_SERVICES) - template - ASIO_SYNC_OP_VOID accept( - basic_socket& peer, asio::error_code& ec, - typename enable_if::value>::type* = 0) -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - { - this->get_service().accept(this->get_implementation(), - peer, static_cast(0), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Start an asynchronous accept. - /** - * This function is used to asynchronously accept a new connection into a - * socket. The function call always returns immediately. - * - * @param peer The socket into which the new connection will be accepted. - * Ownership of the peer object is retained by the caller, which must - * guarantee that it is valid until the handler is called. - * - * @param handler The handler to be called when the accept operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error // Result of operation. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * @code - * void accept_handler(const asio::error_code& error) - * { - * if (!error) - * { - * // Accept succeeded. - * } - * } - * - * ... - * - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::ip::tcp::socket socket(io_context); - * acceptor.async_accept(socket, accept_handler); - * @endcode - */ -#if defined(ASIO_ENABLE_OLD_SERVICES) - template - ASIO_INITFN_RESULT_TYPE(AcceptHandler, - void (asio::error_code)) - async_accept(basic_socket& peer, - ASIO_MOVE_ARG(AcceptHandler) handler, - typename enable_if::value>::type* = 0) -#else // defined(ASIO_ENABLE_OLD_SERVICES) - template - ASIO_INITFN_RESULT_TYPE(AcceptHandler, - void (asio::error_code)) - async_accept(basic_socket& peer, - ASIO_MOVE_ARG(AcceptHandler) handler, - typename enable_if::value>::type* = 0) -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a AcceptHandler. - ASIO_ACCEPT_HANDLER_CHECK(AcceptHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_accept(this->get_implementation(), - peer, static_cast(0), - ASIO_MOVE_CAST(AcceptHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_accept(this->get_implementation(), - peer, static_cast(0), init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Accept a new connection and obtain the endpoint of the peer - /** - * This function is used to accept a new connection from a peer into the - * given socket, and additionally provide the endpoint of the remote peer. - * The function call will block until a new connection has been accepted - * successfully or an error occurs. - * - * @param peer The socket into which the new connection will be accepted. - * - * @param peer_endpoint An endpoint object which will receive the endpoint of - * the remote peer. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::ip::tcp::socket socket(io_context); - * asio::ip::tcp::endpoint endpoint; - * acceptor.accept(socket, endpoint); - * @endcode - */ -#if defined(ASIO_ENABLE_OLD_SERVICES) - template - void accept(basic_socket& peer, - endpoint_type& peer_endpoint) -#else // defined(ASIO_ENABLE_OLD_SERVICES) - void accept(basic_socket& peer, endpoint_type& peer_endpoint) -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - { - asio::error_code ec; - this->get_service().accept(this->get_implementation(), - peer, &peer_endpoint, ec); - asio::detail::throw_error(ec, "accept"); - } - - /// Accept a new connection and obtain the endpoint of the peer - /** - * This function is used to accept a new connection from a peer into the - * given socket, and additionally provide the endpoint of the remote peer. - * The function call will block until a new connection has been accepted - * successfully or an error occurs. - * - * @param peer The socket into which the new connection will be accepted. - * - * @param peer_endpoint An endpoint object which will receive the endpoint of - * the remote peer. - * - * @param ec Set to indicate what error occurred, if any. - * - * @par Example - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::ip::tcp::socket socket(io_context); - * asio::ip::tcp::endpoint endpoint; - * asio::error_code ec; - * acceptor.accept(socket, endpoint, ec); - * if (ec) - * { - * // An error occurred. - * } - * @endcode - */ -#if defined(ASIO_ENABLE_OLD_SERVICES) - template - ASIO_SYNC_OP_VOID accept( - basic_socket& peer, - endpoint_type& peer_endpoint, asio::error_code& ec) -#else // defined(ASIO_ENABLE_OLD_SERVICES) - ASIO_SYNC_OP_VOID accept(basic_socket& peer, - endpoint_type& peer_endpoint, asio::error_code& ec) -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - { - this->get_service().accept( - this->get_implementation(), peer, &peer_endpoint, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Start an asynchronous accept. - /** - * This function is used to asynchronously accept a new connection into a - * socket, and additionally obtain the endpoint of the remote peer. The - * function call always returns immediately. - * - * @param peer The socket into which the new connection will be accepted. - * Ownership of the peer object is retained by the caller, which must - * guarantee that it is valid until the handler is called. - * - * @param peer_endpoint An endpoint object into which the endpoint of the - * remote peer will be written. Ownership of the peer_endpoint object is - * retained by the caller, which must guarantee that it is valid until the - * handler is called. - * - * @param handler The handler to be called when the accept operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error // Result of operation. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - */ -#if defined(ASIO_ENABLE_OLD_SERVICES) - template - ASIO_INITFN_RESULT_TYPE(AcceptHandler, - void (asio::error_code)) - async_accept(basic_socket& peer, - endpoint_type& peer_endpoint, ASIO_MOVE_ARG(AcceptHandler) handler) -#else // defined(ASIO_ENABLE_OLD_SERVICES) - template - ASIO_INITFN_RESULT_TYPE(AcceptHandler, - void (asio::error_code)) - async_accept(basic_socket& peer, - endpoint_type& peer_endpoint, ASIO_MOVE_ARG(AcceptHandler) handler) -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a AcceptHandler. - ASIO_ACCEPT_HANDLER_CHECK(AcceptHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_accept(this->get_implementation(), peer, - &peer_endpoint, ASIO_MOVE_CAST(AcceptHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_accept(this->get_implementation(), - peer, &peer_endpoint, init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } -#endif // !defined(ASIO_NO_EXTENSIONS) - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Accept a new connection. - /** - * This function is used to accept a new connection from a peer. The function - * call will block until a new connection has been accepted successfully or - * an error occurs. - * - * This overload requires that the Protocol template parameter satisfy the - * AcceptableProtocol type requirements. - * - * @returns A socket object representing the newly accepted connection. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::ip::tcp::socket socket(acceptor.accept()); - * @endcode - */ - typename Protocol::socket accept() - { - asio::error_code ec; - typename Protocol::socket peer( - this->get_service().accept( - this->get_implementation(), 0, 0, ec)); - asio::detail::throw_error(ec, "accept"); - return peer; - } - - /// Accept a new connection. - /** - * This function is used to accept a new connection from a peer. The function - * call will block until a new connection has been accepted successfully or - * an error occurs. - * - * This overload requires that the Protocol template parameter satisfy the - * AcceptableProtocol type requirements. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns On success, a socket object representing the newly accepted - * connection. On error, a socket object where is_open() is false. - * - * @par Example - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::ip::tcp::socket socket(acceptor.accept(ec)); - * if (ec) - * { - * // An error occurred. - * } - * @endcode - */ - typename Protocol::socket accept(asio::error_code& ec) - { - return this->get_service().accept(this->get_implementation(), 0, 0, ec); - } - - /// Start an asynchronous accept. - /** - * This function is used to asynchronously accept a new connection. The - * function call always returns immediately. - * - * This overload requires that the Protocol template parameter satisfy the - * AcceptableProtocol type requirements. - * - * @param handler The handler to be called when the accept operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * typename Protocol::socket peer // On success, the newly accepted socket. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * @code - * void accept_handler(const asio::error_code& error, - * asio::ip::tcp::socket peer) - * { - * if (!error) - * { - * // Accept succeeded. - * } - * } - * - * ... - * - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * acceptor.async_accept(accept_handler); - * @endcode - */ - template - ASIO_INITFN_RESULT_TYPE(MoveAcceptHandler, - void (asio::error_code, typename Protocol::socket)) - async_accept(ASIO_MOVE_ARG(MoveAcceptHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a MoveAcceptHandler. - ASIO_MOVE_ACCEPT_HANDLER_CHECK(MoveAcceptHandler, - handler, typename Protocol::socket) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_accept( - this->get_implementation(), static_cast(0), - static_cast(0), - ASIO_MOVE_CAST(MoveAcceptHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_accept( - this->get_implementation(), static_cast(0), - static_cast(0), init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Accept a new connection. - /** - * This function is used to accept a new connection from a peer. The function - * call will block until a new connection has been accepted successfully or - * an error occurs. - * - * This overload requires that the Protocol template parameter satisfy the - * AcceptableProtocol type requirements. - * - * @param io_context The io_context object to be used for the newly accepted - * socket. - * - * @returns A socket object representing the newly accepted connection. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::ip::tcp::socket socket(acceptor.accept()); - * @endcode - */ - typename Protocol::socket accept(asio::io_context& io_context) - { - asio::error_code ec; - typename Protocol::socket peer( - this->get_service().accept(this->get_implementation(), - &io_context, static_cast(0), ec)); - asio::detail::throw_error(ec, "accept"); - return peer; - } - - /// Accept a new connection. - /** - * This function is used to accept a new connection from a peer. The function - * call will block until a new connection has been accepted successfully or - * an error occurs. - * - * This overload requires that the Protocol template parameter satisfy the - * AcceptableProtocol type requirements. - * - * @param io_context The io_context object to be used for the newly accepted - * socket. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns On success, a socket object representing the newly accepted - * connection. On error, a socket object where is_open() is false. - * - * @par Example - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::ip::tcp::socket socket(acceptor.accept(io_context2, ec)); - * if (ec) - * { - * // An error occurred. - * } - * @endcode - */ - typename Protocol::socket accept( - asio::io_context& io_context, asio::error_code& ec) - { - return this->get_service().accept(this->get_implementation(), - &io_context, static_cast(0), ec); - } - - /// Start an asynchronous accept. - /** - * This function is used to asynchronously accept a new connection. The - * function call always returns immediately. - * - * This overload requires that the Protocol template parameter satisfy the - * AcceptableProtocol type requirements. - * - * @param io_context The io_context object to be used for the newly accepted - * socket. - * - * @param handler The handler to be called when the accept operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * typename Protocol::socket peer // On success, the newly accepted socket. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * @code - * void accept_handler(const asio::error_code& error, - * asio::ip::tcp::socket peer) - * { - * if (!error) - * { - * // Accept succeeded. - * } - * } - * - * ... - * - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * acceptor.async_accept(io_context2, accept_handler); - * @endcode - */ - template - ASIO_INITFN_RESULT_TYPE(MoveAcceptHandler, - void (asio::error_code, typename Protocol::socket)) - async_accept(asio::io_context& io_context, - ASIO_MOVE_ARG(MoveAcceptHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a MoveAcceptHandler. - ASIO_MOVE_ACCEPT_HANDLER_CHECK(MoveAcceptHandler, - handler, typename Protocol::socket) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_accept(this->get_implementation(), - &io_context, static_cast(0), - ASIO_MOVE_CAST(MoveAcceptHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_accept(this->get_implementation(), - &io_context, static_cast(0), init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Accept a new connection. - /** - * This function is used to accept a new connection from a peer. The function - * call will block until a new connection has been accepted successfully or - * an error occurs. - * - * This overload requires that the Protocol template parameter satisfy the - * AcceptableProtocol type requirements. - * - * @param peer_endpoint An endpoint object into which the endpoint of the - * remote peer will be written. - * - * @returns A socket object representing the newly accepted connection. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::ip::tcp::endpoint endpoint; - * asio::ip::tcp::socket socket(acceptor.accept(endpoint)); - * @endcode - */ - typename Protocol::socket accept(endpoint_type& peer_endpoint) - { - asio::error_code ec; - typename Protocol::socket peer( - this->get_service().accept(this->get_implementation(), - static_cast(0), &peer_endpoint, ec)); - asio::detail::throw_error(ec, "accept"); - return peer; - } - - /// Accept a new connection. - /** - * This function is used to accept a new connection from a peer. The function - * call will block until a new connection has been accepted successfully or - * an error occurs. - * - * This overload requires that the Protocol template parameter satisfy the - * AcceptableProtocol type requirements. - * - * @param peer_endpoint An endpoint object into which the endpoint of the - * remote peer will be written. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns On success, a socket object representing the newly accepted - * connection. On error, a socket object where is_open() is false. - * - * @par Example - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::ip::tcp::endpoint endpoint; - * asio::ip::tcp::socket socket(acceptor.accept(endpoint, ec)); - * if (ec) - * { - * // An error occurred. - * } - * @endcode - */ - typename Protocol::socket accept( - endpoint_type& peer_endpoint, asio::error_code& ec) - { - return this->get_service().accept(this->get_implementation(), - static_cast(0), &peer_endpoint, ec); - } - - /// Start an asynchronous accept. - /** - * This function is used to asynchronously accept a new connection. The - * function call always returns immediately. - * - * This overload requires that the Protocol template parameter satisfy the - * AcceptableProtocol type requirements. - * - * @param peer_endpoint An endpoint object into which the endpoint of the - * remote peer will be written. Ownership of the peer_endpoint object is - * retained by the caller, which must guarantee that it is valid until the - * handler is called. - * - * @param handler The handler to be called when the accept operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * typename Protocol::socket peer // On success, the newly accepted socket. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * @code - * void accept_handler(const asio::error_code& error, - * asio::ip::tcp::socket peer) - * { - * if (!error) - * { - * // Accept succeeded. - * } - * } - * - * ... - * - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::ip::tcp::endpoint endpoint; - * acceptor.async_accept(endpoint, accept_handler); - * @endcode - */ - template - ASIO_INITFN_RESULT_TYPE(MoveAcceptHandler, - void (asio::error_code, typename Protocol::socket)) - async_accept(endpoint_type& peer_endpoint, - ASIO_MOVE_ARG(MoveAcceptHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a MoveAcceptHandler. - ASIO_MOVE_ACCEPT_HANDLER_CHECK(MoveAcceptHandler, - handler, typename Protocol::socket) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_accept(this->get_implementation(), - static_cast(0), &peer_endpoint, - ASIO_MOVE_CAST(MoveAcceptHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_accept(this->get_implementation(), - static_cast(0), &peer_endpoint, - init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Accept a new connection. - /** - * This function is used to accept a new connection from a peer. The function - * call will block until a new connection has been accepted successfully or - * an error occurs. - * - * This overload requires that the Protocol template parameter satisfy the - * AcceptableProtocol type requirements. - * - * @param io_context The io_context object to be used for the newly accepted - * socket. - * - * @param peer_endpoint An endpoint object into which the endpoint of the - * remote peer will be written. - * - * @returns A socket object representing the newly accepted connection. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::ip::tcp::endpoint endpoint; - * asio::ip::tcp::socket socket( - * acceptor.accept(io_context2, endpoint)); - * @endcode - */ - typename Protocol::socket accept( - asio::io_context& io_context, endpoint_type& peer_endpoint) - { - asio::error_code ec; - typename Protocol::socket peer( - this->get_service().accept(this->get_implementation(), - &io_context, &peer_endpoint, ec)); - asio::detail::throw_error(ec, "accept"); - return peer; - } - - /// Accept a new connection. - /** - * This function is used to accept a new connection from a peer. The function - * call will block until a new connection has been accepted successfully or - * an error occurs. - * - * This overload requires that the Protocol template parameter satisfy the - * AcceptableProtocol type requirements. - * - * @param io_context The io_context object to be used for the newly accepted - * socket. - * - * @param peer_endpoint An endpoint object into which the endpoint of the - * remote peer will be written. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns On success, a socket object representing the newly accepted - * connection. On error, a socket object where is_open() is false. - * - * @par Example - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::ip::tcp::endpoint endpoint; - * asio::ip::tcp::socket socket( - * acceptor.accept(io_context2, endpoint, ec)); - * if (ec) - * { - * // An error occurred. - * } - * @endcode - */ - typename Protocol::socket accept(asio::io_context& io_context, - endpoint_type& peer_endpoint, asio::error_code& ec) - { - return this->get_service().accept(this->get_implementation(), - &io_context, &peer_endpoint, ec); - } - - /// Start an asynchronous accept. - /** - * This function is used to asynchronously accept a new connection. The - * function call always returns immediately. - * - * This overload requires that the Protocol template parameter satisfy the - * AcceptableProtocol type requirements. - * - * @param io_context The io_context object to be used for the newly accepted - * socket. - * - * @param peer_endpoint An endpoint object into which the endpoint of the - * remote peer will be written. Ownership of the peer_endpoint object is - * retained by the caller, which must guarantee that it is valid until the - * handler is called. - * - * @param handler The handler to be called when the accept operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * typename Protocol::socket peer // On success, the newly accepted socket. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * @code - * void accept_handler(const asio::error_code& error, - * asio::ip::tcp::socket peer) - * { - * if (!error) - * { - * // Accept succeeded. - * } - * } - * - * ... - * - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::ip::tcp::endpoint endpoint; - * acceptor.async_accept(io_context2, endpoint, accept_handler); - * @endcode - */ - template - ASIO_INITFN_RESULT_TYPE(MoveAcceptHandler, - void (asio::error_code, typename Protocol::socket)) - async_accept(asio::io_context& io_context, - endpoint_type& peer_endpoint, - ASIO_MOVE_ARG(MoveAcceptHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a MoveAcceptHandler. - ASIO_MOVE_ACCEPT_HANDLER_CHECK(MoveAcceptHandler, - handler, typename Protocol::socket) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_accept( - this->get_implementation(), &io_context, &peer_endpoint, - ASIO_MOVE_CAST(MoveAcceptHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_accept(this->get_implementation(), - &io_context, &peer_endpoint, init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if !defined(ASIO_ENABLE_OLD_SERVICES) -# undef ASIO_SVC_T -#endif // !defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_BASIC_SOCKET_ACCEPTOR_HPP diff --git a/tools/sdk/include/asio/asio/basic_socket_iostream.hpp b/tools/sdk/include/asio/asio/basic_socket_iostream.hpp deleted file mode 100644 index 6681367fdfa..00000000000 --- a/tools/sdk/include/asio/asio/basic_socket_iostream.hpp +++ /dev/null @@ -1,430 +0,0 @@ -// -// basic_socket_iostream.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_BASIC_SOCKET_IOSTREAM_HPP -#define ASIO_BASIC_SOCKET_IOSTREAM_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_NO_IOSTREAM) - -#include -#include -#include "asio/basic_socket_streambuf.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) -# include "asio/stream_socket_service.hpp" -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#if !defined(ASIO_HAS_VARIADIC_TEMPLATES) - -# include "asio/detail/variadic_templates.hpp" - -// A macro that should expand to: -// template -// explicit basic_socket_iostream(T1 x1, ..., Tn xn) -// : std::basic_iostream( -// &this->detail::socket_iostream_base< -// Protocol ASIO_SVC_TARG, Clock, -// WaitTraits ASIO_SVC_TARG1>::streambuf_) -// { -// if (rdbuf()->connect(x1, ..., xn) == 0) -// this->setstate(std::ios_base::failbit); -// } -// This macro should only persist within this file. - -# define ASIO_PRIVATE_CTR_DEF(n) \ - template \ - explicit basic_socket_iostream(ASIO_VARIADIC_BYVAL_PARAMS(n)) \ - : std::basic_iostream( \ - &this->detail::socket_iostream_base< \ - Protocol ASIO_SVC_TARG, Clock, \ - WaitTraits ASIO_SVC_TARG1>::streambuf_) \ - { \ - this->setf(std::ios_base::unitbuf); \ - if (rdbuf()->connect(ASIO_VARIADIC_BYVAL_ARGS(n)) == 0) \ - this->setstate(std::ios_base::failbit); \ - } \ - /**/ - -// A macro that should expand to: -// template -// void connect(T1 x1, ..., Tn xn) -// { -// if (rdbuf()->connect(x1, ..., xn) == 0) -// this->setstate(std::ios_base::failbit); -// } -// This macro should only persist within this file. - -# define ASIO_PRIVATE_CONNECT_DEF(n) \ - template \ - void connect(ASIO_VARIADIC_BYVAL_PARAMS(n)) \ - { \ - if (rdbuf()->connect(ASIO_VARIADIC_BYVAL_ARGS(n)) == 0) \ - this->setstate(std::ios_base::failbit); \ - } \ - /**/ - -#endif // !defined(ASIO_HAS_VARIADIC_TEMPLATES) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -// A separate base class is used to ensure that the streambuf is initialised -// prior to the basic_socket_iostream's basic_iostream base class. -template -class socket_iostream_base -{ -protected: - socket_iostream_base() - { - } - -#if defined(ASIO_HAS_MOVE) - socket_iostream_base(socket_iostream_base&& other) - : streambuf_(std::move(other.streambuf_)) - { - } - - socket_iostream_base(basic_stream_socket s) - : streambuf_(std::move(s)) - { - } - - socket_iostream_base& operator=(socket_iostream_base&& other) - { - streambuf_ = std::move(other.streambuf_); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) - - basic_socket_streambuf streambuf_; -}; - -} // namespace detail - -#if !defined(ASIO_BASIC_SOCKET_IOSTREAM_FWD_DECL) -#define ASIO_BASIC_SOCKET_IOSTREAM_FWD_DECL - -// Forward declaration with defaulted arguments. -template ), -#if defined(ASIO_HAS_BOOST_DATE_TIME) \ - && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) - typename Clock = boost::posix_time::ptime, - typename WaitTraits = time_traits - ASIO_SVC_TPARAM1_DEF2(= deadline_timer_service)> -#else // defined(ASIO_HAS_BOOST_DATE_TIME) - // && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) - typename Clock = chrono::steady_clock, - typename WaitTraits = wait_traits - ASIO_SVC_TPARAM1_DEF1(= steady_timer::service_type)> -#endif // defined(ASIO_HAS_BOOST_DATE_TIME) - // && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) -class basic_socket_iostream; - -#endif // !defined(ASIO_BASIC_SOCKET_IOSTREAM_FWD_DECL) - -/// Iostream interface for a socket. -#if defined(GENERATING_DOCUMENTATION) -template > -#else // defined(GENERATING_DOCUMENTATION) -template -#endif // defined(GENERATING_DOCUMENTATION) -class basic_socket_iostream - : private detail::socket_iostream_base, - public std::basic_iostream -{ -private: - // These typedefs are intended keep this class's implementation independent - // of whether it's using Boost.DateClock, Boost.Chrono or std::chrono. -#if defined(ASIO_HAS_BOOST_DATE_TIME) \ - && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) - typedef WaitTraits traits_helper; -#else // defined(ASIO_HAS_BOOST_DATE_TIME) - // && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) - typedef detail::chrono_time_traits traits_helper; -#endif // defined(ASIO_HAS_BOOST_DATE_TIME) - // && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) - -public: - /// The protocol type. - typedef Protocol protocol_type; - - /// The endpoint type. - typedef typename Protocol::endpoint endpoint_type; - - /// The clock type. - typedef Clock clock_type; - -#if defined(GENERATING_DOCUMENTATION) - /// (Deprecated: Use time_point.) The time type. - typedef typename WaitTraits::time_type time_type; - - /// The time type. - typedef typename WaitTraits::time_point time_point; - - /// (Deprecated: Use duration.) The duration type. - typedef typename WaitTraits::duration_type duration_type; - - /// The duration type. - typedef typename WaitTraits::duration duration; -#else -# if !defined(ASIO_NO_DEPRECATED) - typedef typename traits_helper::time_type time_type; - typedef typename traits_helper::duration_type duration_type; -# endif // !defined(ASIO_NO_DEPRECATED) - typedef typename traits_helper::time_type time_point; - typedef typename traits_helper::duration_type duration; -#endif - - /// Construct a basic_socket_iostream without establishing a connection. - basic_socket_iostream() - : std::basic_iostream( - &this->detail::socket_iostream_base< - Protocol ASIO_SVC_TARG, Clock, - WaitTraits ASIO_SVC_TARG1>::streambuf_) - { - this->setf(std::ios_base::unitbuf); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Construct a basic_socket_iostream from the supplied socket. - explicit basic_socket_iostream(basic_stream_socket s) - : detail::socket_iostream_base< - Protocol ASIO_SVC_TARG, Clock, - WaitTraits ASIO_SVC_TARG1>(std::move(s)), - std::basic_iostream( - &this->detail::socket_iostream_base< - Protocol ASIO_SVC_TARG, Clock, - WaitTraits ASIO_SVC_TARG1>::streambuf_) - { - this->setf(std::ios_base::unitbuf); - } - -#if defined(ASIO_HAS_STD_IOSTREAM_MOVE) \ - || defined(GENERATING_DOCUMENTATION) - /// Move-construct a basic_socket_iostream from another. - basic_socket_iostream(basic_socket_iostream&& other) - : detail::socket_iostream_base< - Protocol ASIO_SVC_TARG, Clock, - WaitTraits ASIO_SVC_TARG1>(std::move(other)), - std::basic_iostream(std::move(other)) - { - this->set_rdbuf(&this->detail::socket_iostream_base< - Protocol ASIO_SVC_TARG, Clock, - WaitTraits ASIO_SVC_TARG1>::streambuf_); - } - - /// Move-assign a basic_socket_iostream from another. - basic_socket_iostream& operator=(basic_socket_iostream&& other) - { - std::basic_iostream::operator=(std::move(other)); - detail::socket_iostream_base< - Protocol ASIO_SVC_TARG, Clock, - WaitTraits ASIO_SVC_TARG1>::operator=(std::move(other)); - return *this; - } -#endif // defined(ASIO_HAS_STD_IOSTREAM_MOVE) - // || defined(GENERATING_DOCUMENTATION) -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - -#if defined(GENERATING_DOCUMENTATION) - /// Establish a connection to an endpoint corresponding to a resolver query. - /** - * This constructor automatically establishes a connection based on the - * supplied resolver query parameters. The arguments are used to construct - * a resolver query object. - */ - template - explicit basic_socket_iostream(T1 t1, ..., TN tn); -#elif defined(ASIO_HAS_VARIADIC_TEMPLATES) - template - explicit basic_socket_iostream(T... x) - : std::basic_iostream( - &this->detail::socket_iostream_base< - Protocol ASIO_SVC_TARG, Clock, - WaitTraits ASIO_SVC_TARG1>::streambuf_) - { - this->setf(std::ios_base::unitbuf); - if (rdbuf()->connect(x...) == 0) - this->setstate(std::ios_base::failbit); - } -#else - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_CTR_DEF) -#endif - -#if defined(GENERATING_DOCUMENTATION) - /// Establish a connection to an endpoint corresponding to a resolver query. - /** - * This function automatically establishes a connection based on the supplied - * resolver query parameters. The arguments are used to construct a resolver - * query object. - */ - template - void connect(T1 t1, ..., TN tn); -#elif defined(ASIO_HAS_VARIADIC_TEMPLATES) - template - void connect(T... x) - { - if (rdbuf()->connect(x...) == 0) - this->setstate(std::ios_base::failbit); - } -#else - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_CONNECT_DEF) -#endif - - /// Close the connection. - void close() - { - if (rdbuf()->close() == 0) - this->setstate(std::ios_base::failbit); - } - - /// Return a pointer to the underlying streambuf. - basic_socket_streambuf* rdbuf() const - { - return const_cast*>( - &this->detail::socket_iostream_base< - Protocol ASIO_SVC_TARG, Clock, - WaitTraits ASIO_SVC_TARG1>::streambuf_); - } - - /// Get a reference to the underlying socket. - basic_socket& socket() - { - return rdbuf()->socket(); - } - - /// Get the last error associated with the stream. - /** - * @return An \c error_code corresponding to the last error from the stream. - * - * @par Example - * To print the error associated with a failure to establish a connection: - * @code tcp::iostream s("www.boost.org", "http"); - * if (!s) - * { - * std::cout << "Error: " << s.error().message() << std::endl; - * } @endcode - */ - const asio::error_code& error() const - { - return rdbuf()->error(); - } - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use expiry().) Get the stream's expiry time as an absolute - /// time. - /** - * @return An absolute time value representing the stream's expiry time. - */ - time_point expires_at() const - { - return rdbuf()->expires_at(); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Get the stream's expiry time as an absolute time. - /** - * @return An absolute time value representing the stream's expiry time. - */ - time_point expiry() const - { - return rdbuf()->expiry(); - } - - /// Set the stream's expiry time as an absolute time. - /** - * This function sets the expiry time associated with the stream. Stream - * operations performed after this time (where the operations cannot be - * completed using the internal buffers) will fail with the error - * asio::error::operation_aborted. - * - * @param expiry_time The expiry time to be used for the stream. - */ - void expires_at(const time_point& expiry_time) - { - rdbuf()->expires_at(expiry_time); - } - - /// Set the stream's expiry time relative to now. - /** - * This function sets the expiry time associated with the stream. Stream - * operations performed after this time (where the operations cannot be - * completed using the internal buffers) will fail with the error - * asio::error::operation_aborted. - * - * @param expiry_time The expiry time to be used for the timer. - */ - void expires_after(const duration& expiry_time) - { - rdbuf()->expires_after(expiry_time); - } - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use expiry().) Get the stream's expiry time relative to now. - /** - * @return A relative time value representing the stream's expiry time. - */ - duration expires_from_now() const - { - return rdbuf()->expires_from_now(); - } - - /// (Deprecated: Use expires_after().) Set the stream's expiry time relative - /// to now. - /** - * This function sets the expiry time associated with the stream. Stream - * operations performed after this time (where the operations cannot be - * completed using the internal buffers) will fail with the error - * asio::error::operation_aborted. - * - * @param expiry_time The expiry time to be used for the timer. - */ - void expires_from_now(const duration& expiry_time) - { - rdbuf()->expires_from_now(expiry_time); - } -#endif // !defined(ASIO_NO_DEPRECATED) - -private: - // Disallow copying and assignment. - basic_socket_iostream(const basic_socket_iostream&) ASIO_DELETED; - basic_socket_iostream& operator=( - const basic_socket_iostream&) ASIO_DELETED; -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if !defined(ASIO_HAS_VARIADIC_TEMPLATES) -# undef ASIO_PRIVATE_CTR_DEF -# undef ASIO_PRIVATE_CONNECT_DEF -#endif // !defined(ASIO_HAS_VARIADIC_TEMPLATES) - -#endif // !defined(ASIO_NO_IOSTREAM) - -#endif // ASIO_BASIC_SOCKET_IOSTREAM_HPP diff --git a/tools/sdk/include/asio/asio/basic_socket_streambuf.hpp b/tools/sdk/include/asio/asio/basic_socket_streambuf.hpp deleted file mode 100644 index 56a3637dccc..00000000000 --- a/tools/sdk/include/asio/asio/basic_socket_streambuf.hpp +++ /dev/null @@ -1,707 +0,0 @@ -// -// basic_socket_streambuf.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_BASIC_SOCKET_STREAMBUF_HPP -#define ASIO_BASIC_SOCKET_STREAMBUF_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_NO_IOSTREAM) - -#include -#include -#include "asio/basic_socket.hpp" -#include "asio/basic_stream_socket.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/io_context.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) -# include "asio/stream_socket_service.hpp" -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#if defined(ASIO_HAS_BOOST_DATE_TIME) \ - && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) -# if defined(ASIO_ENABLE_OLD_SERVICES) -# include "asio/deadline_timer_service.hpp" -# else // defined(ASIO_ENABLE_OLD_SERVICES) -# include "asio/detail/deadline_timer_service.hpp" -# endif // defined(ASIO_ENABLE_OLD_SERVICES) -#else // defined(ASIO_HAS_BOOST_DATE_TIME) - // && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) -# include "asio/steady_timer.hpp" -#endif // defined(ASIO_HAS_BOOST_DATE_TIME) - // && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) - -#if !defined(ASIO_HAS_VARIADIC_TEMPLATES) - -# include "asio/detail/variadic_templates.hpp" - -// A macro that should expand to: -// template -// basic_socket_streambuf* connect(T1 x1, ..., Tn xn) -// { -// init_buffers(); -// typedef typename Protocol::resolver resolver_type; -// resolver_type resolver(socket().get_executor().context()); -// connect_to_endpoints( -// resolver.resolve(x1, ..., xn, ec_)); -// return !ec_ ? this : 0; -// } -// This macro should only persist within this file. - -# define ASIO_PRIVATE_CONNECT_DEF(n) \ - template \ - basic_socket_streambuf* connect(ASIO_VARIADIC_BYVAL_PARAMS(n)) \ - { \ - init_buffers(); \ - typedef typename Protocol::resolver resolver_type; \ - resolver_type resolver(socket().get_executor().context()); \ - connect_to_endpoints( \ - resolver.resolve(ASIO_VARIADIC_BYVAL_ARGS(n), ec_)); \ - return !ec_ ? this : 0; \ - } \ - /**/ - -#endif // !defined(ASIO_HAS_VARIADIC_TEMPLATES) - -#if !defined(ASIO_ENABLE_OLD_SERVICES) -# define ASIO_SVC_T1 detail::deadline_timer_service -#endif // !defined(ASIO_ENABLE_OLD_SERVICES) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -// A separate base class is used to ensure that the io_context member is -// initialised prior to the basic_socket_streambuf's basic_socket base class. -class socket_streambuf_io_context -{ -protected: - socket_streambuf_io_context(io_context* ctx) - : default_io_context_(ctx) - { - } - - shared_ptr default_io_context_; -}; - -// A separate base class is used to ensure that the dynamically allocated -// buffers are constructed prior to the basic_socket_streambuf's basic_socket -// base class. This makes moving the socket is the last potentially throwing -// step in the streambuf's move constructor, giving the constructor a strong -// exception safety guarantee. -class socket_streambuf_buffers -{ -protected: - socket_streambuf_buffers() - : get_buffer_(buffer_size), - put_buffer_(buffer_size) - { - } - - enum { buffer_size = 512 }; - std::vector get_buffer_; - std::vector put_buffer_; -}; - -} // namespace detail - -#if !defined(ASIO_BASIC_SOCKET_STREAMBUF_FWD_DECL) -#define ASIO_BASIC_SOCKET_STREAMBUF_FWD_DECL - -// Forward declaration with defaulted arguments. -template ), -#if defined(ASIO_HAS_BOOST_DATE_TIME) \ - && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) - typename Clock = boost::posix_time::ptime, - typename WaitTraits = time_traits - ASIO_SVC_TPARAM1_DEF2(= deadline_timer_service)> -#else // defined(ASIO_HAS_BOOST_DATE_TIME) - // && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) - typename Clock = chrono::steady_clock, - typename WaitTraits = wait_traits - ASIO_SVC_TPARAM1_DEF1(= steady_timer::service_type)> -#endif // defined(ASIO_HAS_BOOST_DATE_TIME) - // && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) -class basic_socket_streambuf; - -#endif // !defined(ASIO_BASIC_SOCKET_STREAMBUF_FWD_DECL) - -/// Iostream streambuf for a socket. -#if defined(GENERATING_DOCUMENTATION) -template > -#else // defined(GENERATING_DOCUMENTATION) -template -#endif // defined(GENERATING_DOCUMENTATION) -class basic_socket_streambuf - : public std::streambuf, - private detail::socket_streambuf_io_context, - private detail::socket_streambuf_buffers, -#if defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) - private basic_socket -#else // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) - public basic_socket -#endif // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) -{ -private: - // These typedefs are intended keep this class's implementation independent - // of whether it's using Boost.DateClock, Boost.Chrono or std::chrono. -#if defined(ASIO_HAS_BOOST_DATE_TIME) \ - && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) - typedef WaitTraits traits_helper; -#else // defined(ASIO_HAS_BOOST_DATE_TIME) - // && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) - typedef detail::chrono_time_traits traits_helper; -#endif // defined(ASIO_HAS_BOOST_DATE_TIME) - // && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) - -public: - /// The protocol type. - typedef Protocol protocol_type; - - /// The endpoint type. - typedef typename Protocol::endpoint endpoint_type; - - /// The clock type. - typedef Clock clock_type; - -#if defined(GENERATING_DOCUMENTATION) - /// (Deprecated: Use time_point.) The time type. - typedef typename WaitTraits::time_type time_type; - - /// The time type. - typedef typename WaitTraits::time_point time_point; - - /// (Deprecated: Use duration.) The duration type. - typedef typename WaitTraits::duration_type duration_type; - - /// The duration type. - typedef typename WaitTraits::duration duration; -#else -# if !defined(ASIO_NO_DEPRECATED) - typedef typename traits_helper::time_type time_type; - typedef typename traits_helper::duration_type duration_type; -# endif // !defined(ASIO_NO_DEPRECATED) - typedef typename traits_helper::time_type time_point; - typedef typename traits_helper::duration_type duration; -#endif - - /// Construct a basic_socket_streambuf without establishing a connection. - basic_socket_streambuf() - : detail::socket_streambuf_io_context(new io_context), - basic_socket(*default_io_context_), - expiry_time_(max_expiry_time()) - { - init_buffers(); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Construct a basic_socket_streambuf from the supplied socket. - explicit basic_socket_streambuf(basic_stream_socket s) - : detail::socket_streambuf_io_context(0), - basic_socket(std::move(s)), - expiry_time_(max_expiry_time()) - { - init_buffers(); - } - - /// Move-construct a basic_socket_streambuf from another. - basic_socket_streambuf(basic_socket_streambuf&& other) - : detail::socket_streambuf_io_context(other), - basic_socket(std::move(other.socket())), - ec_(other.ec_), - expiry_time_(other.expiry_time_) - { - get_buffer_.swap(other.get_buffer_); - put_buffer_.swap(other.put_buffer_); - setg(other.eback(), other.gptr(), other.egptr()); - setp(other.pptr(), other.epptr()); - other.ec_ = asio::error_code(); - other.expiry_time_ = max_expiry_time(); - other.init_buffers(); - } - - /// Move-assign a basic_socket_streambuf from another. - basic_socket_streambuf& operator=(basic_socket_streambuf&& other) - { - this->close(); - socket() = std::move(other.socket()); - detail::socket_streambuf_io_context::operator=(other); - ec_ = other.ec_; - expiry_time_ = other.expiry_time_; - get_buffer_.swap(other.get_buffer_); - put_buffer_.swap(other.put_buffer_); - setg(other.eback(), other.gptr(), other.egptr()); - setp(other.pptr(), other.epptr()); - other.ec_ = asio::error_code(); - other.expiry_time_ = max_expiry_time(); - other.put_buffer_.resize(buffer_size); - other.init_buffers(); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destructor flushes buffered data. - virtual ~basic_socket_streambuf() - { - if (pptr() != pbase()) - overflow(traits_type::eof()); - } - - /// Establish a connection. - /** - * This function establishes a connection to the specified endpoint. - * - * @return \c this if a connection was successfully established, a null - * pointer otherwise. - */ - basic_socket_streambuf* connect(const endpoint_type& endpoint) - { - init_buffers(); - ec_ = asio::error_code(); - this->connect_to_endpoints(&endpoint, &endpoint + 1); - return !ec_ ? this : 0; - } - -#if defined(GENERATING_DOCUMENTATION) - /// Establish a connection. - /** - * This function automatically establishes a connection based on the supplied - * resolver query parameters. The arguments are used to construct a resolver - * query object. - * - * @return \c this if a connection was successfully established, a null - * pointer otherwise. - */ - template - basic_socket_streambuf* connect(T1 t1, ..., TN tn); -#elif defined(ASIO_HAS_VARIADIC_TEMPLATES) - template - basic_socket_streambuf* connect(T... x) - { - init_buffers(); - typedef typename Protocol::resolver resolver_type; - resolver_type resolver(socket().get_executor().context()); - connect_to_endpoints(resolver.resolve(x..., ec_)); - return !ec_ ? this : 0; - } -#else - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_CONNECT_DEF) -#endif - - /// Close the connection. - /** - * @return \c this if a connection was successfully established, a null - * pointer otherwise. - */ - basic_socket_streambuf* close() - { - sync(); - socket().close(ec_); - if (!ec_) - init_buffers(); - return !ec_ ? this : 0; - } - - /// Get a reference to the underlying socket. - basic_socket& socket() - { - return *this; - } - - /// Get the last error associated with the stream buffer. - /** - * @return An \c error_code corresponding to the last error from the stream - * buffer. - */ - const asio::error_code& error() const - { - return ec_; - } - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use error().) Get the last error associated with the stream - /// buffer. - /** - * @return An \c error_code corresponding to the last error from the stream - * buffer. - */ - const asio::error_code& puberror() const - { - return error(); - } - - /// (Deprecated: Use expiry().) Get the stream buffer's expiry time as an - /// absolute time. - /** - * @return An absolute time value representing the stream buffer's expiry - * time. - */ - time_point expires_at() const - { - return expiry_time_; - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Get the stream buffer's expiry time as an absolute time. - /** - * @return An absolute time value representing the stream buffer's expiry - * time. - */ - time_point expiry() const - { - return expiry_time_; - } - - /// Set the stream buffer's expiry time as an absolute time. - /** - * This function sets the expiry time associated with the stream. Stream - * operations performed after this time (where the operations cannot be - * completed using the internal buffers) will fail with the error - * asio::error::operation_aborted. - * - * @param expiry_time The expiry time to be used for the stream. - */ - void expires_at(const time_point& expiry_time) - { - expiry_time_ = expiry_time; - } - - /// Set the stream buffer's expiry time relative to now. - /** - * This function sets the expiry time associated with the stream. Stream - * operations performed after this time (where the operations cannot be - * completed using the internal buffers) will fail with the error - * asio::error::operation_aborted. - * - * @param expiry_time The expiry time to be used for the timer. - */ - void expires_after(const duration& expiry_time) - { - expiry_time_ = traits_helper::add(traits_helper::now(), expiry_time); - } - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use expiry().) Get the stream buffer's expiry time relative - /// to now. - /** - * @return A relative time value representing the stream buffer's expiry time. - */ - duration expires_from_now() const - { - return traits_helper::subtract(expires_at(), traits_helper::now()); - } - - /// (Deprecated: Use expires_after().) Set the stream buffer's expiry time - /// relative to now. - /** - * This function sets the expiry time associated with the stream. Stream - * operations performed after this time (where the operations cannot be - * completed using the internal buffers) will fail with the error - * asio::error::operation_aborted. - * - * @param expiry_time The expiry time to be used for the timer. - */ - void expires_from_now(const duration& expiry_time) - { - expiry_time_ = traits_helper::add(traits_helper::now(), expiry_time); - } -#endif // !defined(ASIO_NO_DEPRECATED) - -protected: - int_type underflow() - { -#if defined(ASIO_WINDOWS_RUNTIME) - ec_ = asio::error::operation_not_supported; - return traits_type::eof(); -#else // defined(ASIO_WINDOWS_RUNTIME) - if (gptr() != egptr()) - return traits_type::eof(); - - for (;;) - { - // Check if we are past the expiry time. - if (traits_helper::less_than(expiry_time_, traits_helper::now())) - { - ec_ = asio::error::timed_out; - return traits_type::eof(); - } - - // Try to complete the operation without blocking. - if (!socket().native_non_blocking()) - socket().native_non_blocking(true, ec_); - detail::buffer_sequence_adapter - bufs(asio::buffer(get_buffer_) + putback_max); - detail::signed_size_type bytes = detail::socket_ops::recv( - socket().native_handle(), bufs.buffers(), bufs.count(), 0, ec_); - - // Check if operation succeeded. - if (bytes > 0) - { - setg(&get_buffer_[0], &get_buffer_[0] + putback_max, - &get_buffer_[0] + putback_max + bytes); - return traits_type::to_int_type(*gptr()); - } - - // Check for EOF. - if (bytes == 0) - { - ec_ = asio::error::eof; - return traits_type::eof(); - } - - // Operation failed. - if (ec_ != asio::error::would_block - && ec_ != asio::error::try_again) - return traits_type::eof(); - - // Wait for socket to become ready. - if (detail::socket_ops::poll_read( - socket().native_handle(), 0, timeout(), ec_) < 0) - return traits_type::eof(); - } -#endif // defined(ASIO_WINDOWS_RUNTIME) - } - - int_type overflow(int_type c) - { -#if defined(ASIO_WINDOWS_RUNTIME) - ec_ = asio::error::operation_not_supported; - return traits_type::eof(); -#else // defined(ASIO_WINDOWS_RUNTIME) - char_type ch = traits_type::to_char_type(c); - - // Determine what needs to be sent. - const_buffer output_buffer; - if (put_buffer_.empty()) - { - if (traits_type::eq_int_type(c, traits_type::eof())) - return traits_type::not_eof(c); // Nothing to do. - output_buffer = asio::buffer(&ch, sizeof(char_type)); - } - else - { - output_buffer = asio::buffer(pbase(), - (pptr() - pbase()) * sizeof(char_type)); - } - - while (output_buffer.size() > 0) - { - // Check if we are past the expiry time. - if (traits_helper::less_than(expiry_time_, traits_helper::now())) - { - ec_ = asio::error::timed_out; - return traits_type::eof(); - } - - // Try to complete the operation without blocking. - if (!socket().native_non_blocking()) - socket().native_non_blocking(true, ec_); - detail::buffer_sequence_adapter< - const_buffer, const_buffer> bufs(output_buffer); - detail::signed_size_type bytes = detail::socket_ops::send( - socket().native_handle(), bufs.buffers(), bufs.count(), 0, ec_); - - // Check if operation succeeded. - if (bytes > 0) - { - output_buffer += static_cast(bytes); - continue; - } - - // Operation failed. - if (ec_ != asio::error::would_block - && ec_ != asio::error::try_again) - return traits_type::eof(); - - // Wait for socket to become ready. - if (detail::socket_ops::poll_write( - socket().native_handle(), 0, timeout(), ec_) < 0) - return traits_type::eof(); - } - - if (!put_buffer_.empty()) - { - setp(&put_buffer_[0], &put_buffer_[0] + put_buffer_.size()); - - // If the new character is eof then our work here is done. - if (traits_type::eq_int_type(c, traits_type::eof())) - return traits_type::not_eof(c); - - // Add the new character to the output buffer. - *pptr() = ch; - pbump(1); - } - - return c; -#endif // defined(ASIO_WINDOWS_RUNTIME) - } - - int sync() - { - return overflow(traits_type::eof()); - } - - std::streambuf* setbuf(char_type* s, std::streamsize n) - { - if (pptr() == pbase() && s == 0 && n == 0) - { - put_buffer_.clear(); - setp(0, 0); - sync(); - return this; - } - - return 0; - } - -private: - // Disallow copying and assignment. - basic_socket_streambuf(const basic_socket_streambuf&) ASIO_DELETED; - basic_socket_streambuf& operator=( - const basic_socket_streambuf&) ASIO_DELETED; - - void init_buffers() - { - setg(&get_buffer_[0], - &get_buffer_[0] + putback_max, - &get_buffer_[0] + putback_max); - - if (put_buffer_.empty()) - setp(0, 0); - else - setp(&put_buffer_[0], &put_buffer_[0] + put_buffer_.size()); - } - - int timeout() const - { - int64_t msec = traits_helper::to_posix_duration( - traits_helper::subtract(expiry_time_, - traits_helper::now())).total_milliseconds(); - if (msec > (std::numeric_limits::max)()) - msec = (std::numeric_limits::max)(); - else if (msec < 0) - msec = 0; - return static_cast(msec); - } - - template - void connect_to_endpoints(const EndpointSequence& endpoints) - { - this->connect_to_endpoints(endpoints.begin(), endpoints.end()); - } - - template - void connect_to_endpoints(EndpointIterator begin, EndpointIterator end) - { -#if defined(ASIO_WINDOWS_RUNTIME) - ec_ = asio::error::operation_not_supported; -#else // defined(ASIO_WINDOWS_RUNTIME) - if (ec_) - return; - - ec_ = asio::error::not_found; - for (EndpointIterator i = begin; i != end; ++i) - { - // Check if we are past the expiry time. - if (traits_helper::less_than(expiry_time_, traits_helper::now())) - { - ec_ = asio::error::timed_out; - return; - } - - // Close and reopen the socket. - typename Protocol::endpoint ep(*i); - socket().close(ec_); - socket().open(ep.protocol(), ec_); - if (ec_) - continue; - - // Try to complete the operation without blocking. - if (!socket().native_non_blocking()) - socket().native_non_blocking(true, ec_); - detail::socket_ops::connect(socket().native_handle(), - ep.data(), ep.size(), ec_); - - // Check if operation succeeded. - if (!ec_) - return; - - // Operation failed. - if (ec_ != asio::error::in_progress - && ec_ != asio::error::would_block) - continue; - - // Wait for socket to become ready. - if (detail::socket_ops::poll_connect( - socket().native_handle(), timeout(), ec_) < 0) - continue; - - // Get the error code from the connect operation. - int connect_error = 0; - size_t connect_error_len = sizeof(connect_error); - if (detail::socket_ops::getsockopt(socket().native_handle(), 0, - SOL_SOCKET, SO_ERROR, &connect_error, &connect_error_len, ec_) - == detail::socket_error_retval) - return; - - // Check the result of the connect operation. - ec_ = asio::error_code(connect_error, - asio::error::get_system_category()); - if (!ec_) - return; - } -#endif // defined(ASIO_WINDOWS_RUNTIME) - } - - // Helper function to get the maximum expiry time. - static time_point max_expiry_time() - { -#if defined(ASIO_HAS_BOOST_DATE_TIME) \ - && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) - return boost::posix_time::pos_infin; -#else // defined(ASIO_HAS_BOOST_DATE_TIME) - // && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) - return (time_point::max)(); -#endif // defined(ASIO_HAS_BOOST_DATE_TIME) - // && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) - } - - enum { putback_max = 8 }; - asio::error_code ec_; - time_point expiry_time_; -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if !defined(ASIO_ENABLE_OLD_SERVICES) -# undef ASIO_SVC_T1 -#endif // !defined(ASIO_ENABLE_OLD_SERVICES) - -#if !defined(ASIO_HAS_VARIADIC_TEMPLATES) -# undef ASIO_PRIVATE_CONNECT_DEF -#endif // !defined(ASIO_HAS_VARIADIC_TEMPLATES) - -#endif // !defined(ASIO_NO_IOSTREAM) - -#endif // ASIO_BASIC_SOCKET_STREAMBUF_HPP diff --git a/tools/sdk/include/asio/asio/basic_stream_socket.hpp b/tools/sdk/include/asio/asio/basic_stream_socket.hpp deleted file mode 100644 index eea88627462..00000000000 --- a/tools/sdk/include/asio/asio/basic_stream_socket.hpp +++ /dev/null @@ -1,921 +0,0 @@ -// -// basic_stream_socket.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_BASIC_STREAM_SOCKET_HPP -#define ASIO_BASIC_STREAM_SOCKET_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/async_result.hpp" -#include "asio/basic_socket.hpp" -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/error.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) -# include "asio/stream_socket_service.hpp" -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Provides stream-oriented socket functionality. -/** - * The basic_stream_socket class template provides asynchronous and blocking - * stream-oriented socket functionality. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - * - * @par Concepts: - * AsyncReadStream, AsyncWriteStream, Stream, SyncReadStream, SyncWriteStream. - */ -template )> -class basic_stream_socket - : public basic_socket -{ -public: - /// The native representation of a socket. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined native_handle_type; -#else - typedef typename basic_socket< - Protocol ASIO_SVC_TARG>::native_handle_type native_handle_type; -#endif - - /// The protocol type. - typedef Protocol protocol_type; - - /// The endpoint type. - typedef typename Protocol::endpoint endpoint_type; - - /// Construct a basic_stream_socket without opening it. - /** - * This constructor creates a stream socket without opening it. The socket - * needs to be opened and then connected or accepted before data can be sent - * or received on it. - * - * @param io_context The io_context object that the stream socket will use to - * dispatch handlers for any asynchronous operations performed on the socket. - */ - explicit basic_stream_socket(asio::io_context& io_context) - : basic_socket(io_context) - { - } - - /// Construct and open a basic_stream_socket. - /** - * This constructor creates and opens a stream socket. The socket needs to be - * connected or accepted before data can be sent or received on it. - * - * @param io_context The io_context object that the stream socket will use to - * dispatch handlers for any asynchronous operations performed on the socket. - * - * @param protocol An object specifying protocol parameters to be used. - * - * @throws asio::system_error Thrown on failure. - */ - basic_stream_socket(asio::io_context& io_context, - const protocol_type& protocol) - : basic_socket(io_context, protocol) - { - } - - /// Construct a basic_stream_socket, opening it and binding it to the given - /// local endpoint. - /** - * This constructor creates a stream socket and automatically opens it bound - * to the specified endpoint on the local machine. The protocol used is the - * protocol associated with the given endpoint. - * - * @param io_context The io_context object that the stream socket will use to - * dispatch handlers for any asynchronous operations performed on the socket. - * - * @param endpoint An endpoint on the local machine to which the stream - * socket will be bound. - * - * @throws asio::system_error Thrown on failure. - */ - basic_stream_socket(asio::io_context& io_context, - const endpoint_type& endpoint) - : basic_socket(io_context, endpoint) - { - } - - /// Construct a basic_stream_socket on an existing native socket. - /** - * This constructor creates a stream socket object to hold an existing native - * socket. - * - * @param io_context The io_context object that the stream socket will use to - * dispatch handlers for any asynchronous operations performed on the socket. - * - * @param protocol An object specifying protocol parameters to be used. - * - * @param native_socket The new underlying socket implementation. - * - * @throws asio::system_error Thrown on failure. - */ - basic_stream_socket(asio::io_context& io_context, - const protocol_type& protocol, const native_handle_type& native_socket) - : basic_socket( - io_context, protocol, native_socket) - { - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a basic_stream_socket from another. - /** - * This constructor moves a stream socket from one object to another. - * - * @param other The other basic_stream_socket object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_stream_socket(io_context&) constructor. - */ - basic_stream_socket(basic_stream_socket&& other) - : basic_socket(std::move(other)) - { - } - - /// Move-assign a basic_stream_socket from another. - /** - * This assignment operator moves a stream socket from one object to another. - * - * @param other The other basic_stream_socket object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_stream_socket(io_context&) constructor. - */ - basic_stream_socket& operator=(basic_stream_socket&& other) - { - basic_socket::operator=(std::move(other)); - return *this; - } - - /// Move-construct a basic_stream_socket from a socket of another protocol - /// type. - /** - * This constructor moves a stream socket from one object to another. - * - * @param other The other basic_stream_socket object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_stream_socket(io_context&) constructor. - */ - template - basic_stream_socket( - basic_stream_socket&& other, - typename enable_if::value>::type* = 0) - : basic_socket(std::move(other)) - { - } - - /// Move-assign a basic_stream_socket from a socket of another protocol type. - /** - * This assignment operator moves a stream socket from one object to another. - * - * @param other The other basic_stream_socket object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_stream_socket(io_context&) constructor. - */ - template - typename enable_if::value, - basic_stream_socket>::type& operator=( - basic_stream_socket&& other) - { - basic_socket::operator=(std::move(other)); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destroys the socket. - /** - * This function destroys the socket, cancelling any outstanding asynchronous - * operations associated with the socket as if by calling @c cancel. - */ - ~basic_stream_socket() - { - } - - /// Send some data on the socket. - /** - * This function is used to send data on the stream socket. The function - * call will block until one or more bytes of the data has been sent - * successfully, or an until error occurs. - * - * @param buffers One or more data buffers to be sent on the socket. - * - * @returns The number of bytes sent. - * - * @throws asio::system_error Thrown on failure. - * - * @note The send operation may not transmit all of the data to the peer. - * Consider using the @ref write function if you need to ensure that all data - * is written before the blocking operation completes. - * - * @par Example - * To send a single data buffer use the @ref buffer function as follows: - * @code - * socket.send(asio::buffer(data, size)); - * @endcode - * See the @ref buffer documentation for information on sending multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t send(const ConstBufferSequence& buffers) - { - asio::error_code ec; - std::size_t s = this->get_service().send( - this->get_implementation(), buffers, 0, ec); - asio::detail::throw_error(ec, "send"); - return s; - } - - /// Send some data on the socket. - /** - * This function is used to send data on the stream socket. The function - * call will block until one or more bytes of the data has been sent - * successfully, or an until error occurs. - * - * @param buffers One or more data buffers to be sent on the socket. - * - * @param flags Flags specifying how the send call is to be made. - * - * @returns The number of bytes sent. - * - * @throws asio::system_error Thrown on failure. - * - * @note The send operation may not transmit all of the data to the peer. - * Consider using the @ref write function if you need to ensure that all data - * is written before the blocking operation completes. - * - * @par Example - * To send a single data buffer use the @ref buffer function as follows: - * @code - * socket.send(asio::buffer(data, size), 0); - * @endcode - * See the @ref buffer documentation for information on sending multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t send(const ConstBufferSequence& buffers, - socket_base::message_flags flags) - { - asio::error_code ec; - std::size_t s = this->get_service().send( - this->get_implementation(), buffers, flags, ec); - asio::detail::throw_error(ec, "send"); - return s; - } - - /// Send some data on the socket. - /** - * This function is used to send data on the stream socket. The function - * call will block until one or more bytes of the data has been sent - * successfully, or an until error occurs. - * - * @param buffers One or more data buffers to be sent on the socket. - * - * @param flags Flags specifying how the send call is to be made. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes sent. Returns 0 if an error occurred. - * - * @note The send operation may not transmit all of the data to the peer. - * Consider using the @ref write function if you need to ensure that all data - * is written before the blocking operation completes. - */ - template - std::size_t send(const ConstBufferSequence& buffers, - socket_base::message_flags flags, asio::error_code& ec) - { - return this->get_service().send( - this->get_implementation(), buffers, flags, ec); - } - - /// Start an asynchronous send. - /** - * This function is used to asynchronously send data on the stream socket. - * The function call always returns immediately. - * - * @param buffers One or more data buffers to be sent on the socket. Although - * the buffers object may be copied as necessary, ownership of the underlying - * memory blocks is retained by the caller, which must guarantee that they - * remain valid until the handler is called. - * - * @param handler The handler to be called when the send operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes sent. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The send operation may not transmit all of the data to the peer. - * Consider using the @ref async_write function if you need to ensure that all - * data is written before the asynchronous operation completes. - * - * @par Example - * To send a single data buffer use the @ref buffer function as follows: - * @code - * socket.async_send(asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on sending multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_send(const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_send( - this->get_implementation(), buffers, 0, - ASIO_MOVE_CAST(WriteHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_send( - this->get_implementation(), buffers, 0, - init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Start an asynchronous send. - /** - * This function is used to asynchronously send data on the stream socket. - * The function call always returns immediately. - * - * @param buffers One or more data buffers to be sent on the socket. Although - * the buffers object may be copied as necessary, ownership of the underlying - * memory blocks is retained by the caller, which must guarantee that they - * remain valid until the handler is called. - * - * @param flags Flags specifying how the send call is to be made. - * - * @param handler The handler to be called when the send operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes sent. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The send operation may not transmit all of the data to the peer. - * Consider using the @ref async_write function if you need to ensure that all - * data is written before the asynchronous operation completes. - * - * @par Example - * To send a single data buffer use the @ref buffer function as follows: - * @code - * socket.async_send(asio::buffer(data, size), 0, handler); - * @endcode - * See the @ref buffer documentation for information on sending multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_send(const ConstBufferSequence& buffers, - socket_base::message_flags flags, - ASIO_MOVE_ARG(WriteHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_send( - this->get_implementation(), buffers, flags, - ASIO_MOVE_CAST(WriteHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_send( - this->get_implementation(), buffers, flags, - init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Receive some data on the socket. - /** - * This function is used to receive data on the stream socket. The function - * call will block until one or more bytes of data has been received - * successfully, or until an error occurs. - * - * @param buffers One or more buffers into which the data will be received. - * - * @returns The number of bytes received. - * - * @throws asio::system_error Thrown on failure. An error code of - * asio::error::eof indicates that the connection was closed by the - * peer. - * - * @note The receive operation may not receive all of the requested number of - * bytes. Consider using the @ref read function if you need to ensure that the - * requested amount of data is read before the blocking operation completes. - * - * @par Example - * To receive into a single data buffer use the @ref buffer function as - * follows: - * @code - * socket.receive(asio::buffer(data, size)); - * @endcode - * See the @ref buffer documentation for information on receiving into - * multiple buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t receive(const MutableBufferSequence& buffers) - { - asio::error_code ec; - std::size_t s = this->get_service().receive( - this->get_implementation(), buffers, 0, ec); - asio::detail::throw_error(ec, "receive"); - return s; - } - - /// Receive some data on the socket. - /** - * This function is used to receive data on the stream socket. The function - * call will block until one or more bytes of data has been received - * successfully, or until an error occurs. - * - * @param buffers One or more buffers into which the data will be received. - * - * @param flags Flags specifying how the receive call is to be made. - * - * @returns The number of bytes received. - * - * @throws asio::system_error Thrown on failure. An error code of - * asio::error::eof indicates that the connection was closed by the - * peer. - * - * @note The receive operation may not receive all of the requested number of - * bytes. Consider using the @ref read function if you need to ensure that the - * requested amount of data is read before the blocking operation completes. - * - * @par Example - * To receive into a single data buffer use the @ref buffer function as - * follows: - * @code - * socket.receive(asio::buffer(data, size), 0); - * @endcode - * See the @ref buffer documentation for information on receiving into - * multiple buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t receive(const MutableBufferSequence& buffers, - socket_base::message_flags flags) - { - asio::error_code ec; - std::size_t s = this->get_service().receive( - this->get_implementation(), buffers, flags, ec); - asio::detail::throw_error(ec, "receive"); - return s; - } - - /// Receive some data on a connected socket. - /** - * This function is used to receive data on the stream socket. The function - * call will block until one or more bytes of data has been received - * successfully, or until an error occurs. - * - * @param buffers One or more buffers into which the data will be received. - * - * @param flags Flags specifying how the receive call is to be made. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes received. Returns 0 if an error occurred. - * - * @note The receive operation may not receive all of the requested number of - * bytes. Consider using the @ref read function if you need to ensure that the - * requested amount of data is read before the blocking operation completes. - */ - template - std::size_t receive(const MutableBufferSequence& buffers, - socket_base::message_flags flags, asio::error_code& ec) - { - return this->get_service().receive( - this->get_implementation(), buffers, flags, ec); - } - - /// Start an asynchronous receive. - /** - * This function is used to asynchronously receive data from the stream - * socket. The function call always returns immediately. - * - * @param buffers One or more buffers into which the data will be received. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the receive operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes received. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The receive operation may not receive all of the requested number of - * bytes. Consider using the @ref async_read function if you need to ensure - * that the requested amount of data is received before the asynchronous - * operation completes. - * - * @par Example - * To receive into a single data buffer use the @ref buffer function as - * follows: - * @code - * socket.async_receive(asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on receiving into - * multiple buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_receive(const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_receive(this->get_implementation(), - buffers, 0, ASIO_MOVE_CAST(ReadHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_receive(this->get_implementation(), - buffers, 0, init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Start an asynchronous receive. - /** - * This function is used to asynchronously receive data from the stream - * socket. The function call always returns immediately. - * - * @param buffers One or more buffers into which the data will be received. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param flags Flags specifying how the receive call is to be made. - * - * @param handler The handler to be called when the receive operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes received. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The receive operation may not receive all of the requested number of - * bytes. Consider using the @ref async_read function if you need to ensure - * that the requested amount of data is received before the asynchronous - * operation completes. - * - * @par Example - * To receive into a single data buffer use the @ref buffer function as - * follows: - * @code - * socket.async_receive(asio::buffer(data, size), 0, handler); - * @endcode - * See the @ref buffer documentation for information on receiving into - * multiple buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_receive(const MutableBufferSequence& buffers, - socket_base::message_flags flags, - ASIO_MOVE_ARG(ReadHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_receive(this->get_implementation(), - buffers, flags, ASIO_MOVE_CAST(ReadHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_receive(this->get_implementation(), - buffers, flags, init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Write some data to the socket. - /** - * This function is used to write data to the stream socket. The function call - * will block until one or more bytes of the data has been written - * successfully, or until an error occurs. - * - * @param buffers One or more data buffers to be written to the socket. - * - * @returns The number of bytes written. - * - * @throws asio::system_error Thrown on failure. An error code of - * asio::error::eof indicates that the connection was closed by the - * peer. - * - * @note The write_some operation may not transmit all of the data to the - * peer. Consider using the @ref write function if you need to ensure that - * all data is written before the blocking operation completes. - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code - * socket.write_some(asio::buffer(data, size)); - * @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t write_some(const ConstBufferSequence& buffers) - { - asio::error_code ec; - std::size_t s = this->get_service().send( - this->get_implementation(), buffers, 0, ec); - asio::detail::throw_error(ec, "write_some"); - return s; - } - - /// Write some data to the socket. - /** - * This function is used to write data to the stream socket. The function call - * will block until one or more bytes of the data has been written - * successfully, or until an error occurs. - * - * @param buffers One or more data buffers to be written to the socket. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes written. Returns 0 if an error occurred. - * - * @note The write_some operation may not transmit all of the data to the - * peer. Consider using the @ref write function if you need to ensure that - * all data is written before the blocking operation completes. - */ - template - std::size_t write_some(const ConstBufferSequence& buffers, - asio::error_code& ec) - { - return this->get_service().send(this->get_implementation(), buffers, 0, ec); - } - - /// Start an asynchronous write. - /** - * This function is used to asynchronously write data to the stream socket. - * The function call always returns immediately. - * - * @param buffers One or more data buffers to be written to the socket. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the write operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes written. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The write operation may not transmit all of the data to the peer. - * Consider using the @ref async_write function if you need to ensure that all - * data is written before the asynchronous operation completes. - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code - * socket.async_write_some(asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_write_some(const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_send(this->get_implementation(), - buffers, 0, ASIO_MOVE_CAST(WriteHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_send(this->get_implementation(), - buffers, 0, init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Read some data from the socket. - /** - * This function is used to read data from the stream socket. The function - * call will block until one or more bytes of data has been read successfully, - * or until an error occurs. - * - * @param buffers One or more buffers into which the data will be read. - * - * @returns The number of bytes read. - * - * @throws asio::system_error Thrown on failure. An error code of - * asio::error::eof indicates that the connection was closed by the - * peer. - * - * @note The read_some operation may not read all of the requested number of - * bytes. Consider using the @ref read function if you need to ensure that - * the requested amount of data is read before the blocking operation - * completes. - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code - * socket.read_some(asio::buffer(data, size)); - * @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t read_some(const MutableBufferSequence& buffers) - { - asio::error_code ec; - std::size_t s = this->get_service().receive( - this->get_implementation(), buffers, 0, ec); - asio::detail::throw_error(ec, "read_some"); - return s; - } - - /// Read some data from the socket. - /** - * This function is used to read data from the stream socket. The function - * call will block until one or more bytes of data has been read successfully, - * or until an error occurs. - * - * @param buffers One or more buffers into which the data will be read. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes read. Returns 0 if an error occurred. - * - * @note The read_some operation may not read all of the requested number of - * bytes. Consider using the @ref read function if you need to ensure that - * the requested amount of data is read before the blocking operation - * completes. - */ - template - std::size_t read_some(const MutableBufferSequence& buffers, - asio::error_code& ec) - { - return this->get_service().receive( - this->get_implementation(), buffers, 0, ec); - } - - /// Start an asynchronous read. - /** - * This function is used to asynchronously read data from the stream socket. - * The function call always returns immediately. - * - * @param buffers One or more buffers into which the data will be read. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes read. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The read operation may not read all of the requested number of bytes. - * Consider using the @ref async_read function if you need to ensure that the - * requested amount of data is read before the asynchronous operation - * completes. - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code - * socket.async_read_some(asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_read_some(const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_receive(this->get_implementation(), - buffers, 0, ASIO_MOVE_CAST(ReadHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_receive(this->get_implementation(), - buffers, 0, init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_BASIC_STREAM_SOCKET_HPP diff --git a/tools/sdk/include/asio/asio/basic_streambuf.hpp b/tools/sdk/include/asio/asio/basic_streambuf.hpp deleted file mode 100644 index 14f85d22fcf..00000000000 --- a/tools/sdk/include/asio/asio/basic_streambuf.hpp +++ /dev/null @@ -1,452 +0,0 @@ -// -// basic_streambuf.hpp -// ~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_BASIC_STREAMBUF_HPP -#define ASIO_BASIC_STREAMBUF_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_NO_IOSTREAM) - -#include -#include -#include -#include -#include -#include "asio/basic_streambuf_fwd.hpp" -#include "asio/buffer.hpp" -#include "asio/detail/limits.hpp" -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/throw_exception.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Automatically resizable buffer class based on std::streambuf. -/** - * The @c basic_streambuf class is derived from @c std::streambuf to associate - * the streambuf's input and output sequences with one or more character - * arrays. These character arrays are internal to the @c basic_streambuf - * object, but direct access to the array elements is provided to permit them - * to be used efficiently with I/O operations. Characters written to the output - * sequence of a @c basic_streambuf object are appended to the input sequence - * of the same object. - * - * The @c basic_streambuf class's public interface is intended to permit the - * following implementation strategies: - * - * @li A single contiguous character array, which is reallocated as necessary - * to accommodate changes in the size of the character sequence. This is the - * implementation approach currently used in Asio. - * - * @li A sequence of one or more character arrays, where each array is of the - * same size. Additional character array objects are appended to the sequence - * to accommodate changes in the size of the character sequence. - * - * @li A sequence of one or more character arrays of varying sizes. Additional - * character array objects are appended to the sequence to accommodate changes - * in the size of the character sequence. - * - * The constructor for basic_streambuf accepts a @c size_t argument specifying - * the maximum of the sum of the sizes of the input sequence and output - * sequence. During the lifetime of the @c basic_streambuf object, the following - * invariant holds: - * @code size() <= max_size()@endcode - * Any member function that would, if successful, cause the invariant to be - * violated shall throw an exception of class @c std::length_error. - * - * The constructor for @c basic_streambuf takes an Allocator argument. A copy - * of this argument is used for any memory allocation performed, by the - * constructor and by all member functions, during the lifetime of each @c - * basic_streambuf object. - * - * @par Examples - * Writing directly from an streambuf to a socket: - * @code - * asio::streambuf b; - * std::ostream os(&b); - * os << "Hello, World!\n"; - * - * // try sending some data in input sequence - * size_t n = sock.send(b.data()); - * - * b.consume(n); // sent data is removed from input sequence - * @endcode - * - * Reading from a socket directly into a streambuf: - * @code - * asio::streambuf b; - * - * // reserve 512 bytes in output sequence - * asio::streambuf::mutable_buffers_type bufs = b.prepare(512); - * - * size_t n = sock.receive(bufs); - * - * // received data is "committed" from output sequence to input sequence - * b.commit(n); - * - * std::istream is(&b); - * std::string s; - * is >> s; - * @endcode - */ -#if defined(GENERATING_DOCUMENTATION) -template > -#else -template -#endif -class basic_streambuf - : public std::streambuf, - private noncopyable -{ -public: -#if defined(GENERATING_DOCUMENTATION) - /// The type used to represent the input sequence as a list of buffers. - typedef implementation_defined const_buffers_type; - - /// The type used to represent the output sequence as a list of buffers. - typedef implementation_defined mutable_buffers_type; -#else - typedef ASIO_CONST_BUFFER const_buffers_type; - typedef ASIO_MUTABLE_BUFFER mutable_buffers_type; -#endif - - /// Construct a basic_streambuf object. - /** - * Constructs a streambuf with the specified maximum size. The initial size - * of the streambuf's input sequence is 0. - */ - explicit basic_streambuf( - std::size_t maximum_size = (std::numeric_limits::max)(), - const Allocator& allocator = Allocator()) - : max_size_(maximum_size), - buffer_(allocator) - { - std::size_t pend = (std::min)(max_size_, buffer_delta); - buffer_.resize((std::max)(pend, 1)); - setg(&buffer_[0], &buffer_[0], &buffer_[0]); - setp(&buffer_[0], &buffer_[0] + pend); - } - - /// Get the size of the input sequence. - /** - * @returns The size of the input sequence. The value is equal to that - * calculated for @c s in the following code: - * @code - * size_t s = 0; - * const_buffers_type bufs = data(); - * const_buffers_type::const_iterator i = bufs.begin(); - * while (i != bufs.end()) - * { - * const_buffer buf(*i++); - * s += buf.size(); - * } - * @endcode - */ - std::size_t size() const ASIO_NOEXCEPT - { - return pptr() - gptr(); - } - - /// Get the maximum size of the basic_streambuf. - /** - * @returns The allowed maximum of the sum of the sizes of the input sequence - * and output sequence. - */ - std::size_t max_size() const ASIO_NOEXCEPT - { - return max_size_; - } - - /// Get the current capacity of the basic_streambuf. - /** - * @returns The current total capacity of the streambuf, i.e. for both the - * input sequence and output sequence. - */ - std::size_t capacity() const ASIO_NOEXCEPT - { - return buffer_.capacity(); - } - - /// Get a list of buffers that represents the input sequence. - /** - * @returns An object of type @c const_buffers_type that satisfies - * ConstBufferSequence requirements, representing all character arrays in the - * input sequence. - * - * @note The returned object is invalidated by any @c basic_streambuf member - * function that modifies the input sequence or output sequence. - */ - const_buffers_type data() const ASIO_NOEXCEPT - { - return asio::buffer(asio::const_buffer(gptr(), - (pptr() - gptr()) * sizeof(char_type))); - } - - /// Get a list of buffers that represents the output sequence, with the given - /// size. - /** - * Ensures that the output sequence can accommodate @c n characters, - * reallocating character array objects as necessary. - * - * @returns An object of type @c mutable_buffers_type that satisfies - * MutableBufferSequence requirements, representing character array objects - * at the start of the output sequence such that the sum of the buffer sizes - * is @c n. - * - * @throws std::length_error If size() + n > max_size(). - * - * @note The returned object is invalidated by any @c basic_streambuf member - * function that modifies the input sequence or output sequence. - */ - mutable_buffers_type prepare(std::size_t n) - { - reserve(n); - return asio::buffer(asio::mutable_buffer( - pptr(), n * sizeof(char_type))); - } - - /// Move characters from the output sequence to the input sequence. - /** - * Appends @c n characters from the start of the output sequence to the input - * sequence. The beginning of the output sequence is advanced by @c n - * characters. - * - * Requires a preceding call prepare(x) where x >= n, and - * no intervening operations that modify the input or output sequence. - * - * @note If @c n is greater than the size of the output sequence, the entire - * output sequence is moved to the input sequence and no error is issued. - */ - void commit(std::size_t n) - { - n = std::min(n, epptr() - pptr()); - pbump(static_cast(n)); - setg(eback(), gptr(), pptr()); - } - - /// Remove characters from the input sequence. - /** - * Removes @c n characters from the beginning of the input sequence. - * - * @note If @c n is greater than the size of the input sequence, the entire - * input sequence is consumed and no error is issued. - */ - void consume(std::size_t n) - { - if (egptr() < pptr()) - setg(&buffer_[0], gptr(), pptr()); - if (gptr() + n > pptr()) - n = pptr() - gptr(); - gbump(static_cast(n)); - } - -protected: - enum { buffer_delta = 128 }; - - /// Override std::streambuf behaviour. - /** - * Behaves according to the specification of @c std::streambuf::underflow(). - */ - int_type underflow() - { - if (gptr() < pptr()) - { - setg(&buffer_[0], gptr(), pptr()); - return traits_type::to_int_type(*gptr()); - } - else - { - return traits_type::eof(); - } - } - - /// Override std::streambuf behaviour. - /** - * Behaves according to the specification of @c std::streambuf::overflow(), - * with the specialisation that @c std::length_error is thrown if appending - * the character to the input sequence would require the condition - * size() > max_size() to be true. - */ - int_type overflow(int_type c) - { - if (!traits_type::eq_int_type(c, traits_type::eof())) - { - if (pptr() == epptr()) - { - std::size_t buffer_size = pptr() - gptr(); - if (buffer_size < max_size_ && max_size_ - buffer_size < buffer_delta) - { - reserve(max_size_ - buffer_size); - } - else - { - reserve(buffer_delta); - } - } - - *pptr() = traits_type::to_char_type(c); - pbump(1); - return c; - } - - return traits_type::not_eof(c); - } - - void reserve(std::size_t n) - { - // Get current stream positions as offsets. - std::size_t gnext = gptr() - &buffer_[0]; - std::size_t pnext = pptr() - &buffer_[0]; - std::size_t pend = epptr() - &buffer_[0]; - - // Check if there is already enough space in the put area. - if (n <= pend - pnext) - { - return; - } - - // Shift existing contents of get area to start of buffer. - if (gnext > 0) - { - pnext -= gnext; - std::memmove(&buffer_[0], &buffer_[0] + gnext, pnext); - } - - // Ensure buffer is large enough to hold at least the specified size. - if (n > pend - pnext) - { - if (n <= max_size_ && pnext <= max_size_ - n) - { - pend = pnext + n; - buffer_.resize((std::max)(pend, 1)); - } - else - { - std::length_error ex("asio::streambuf too long"); - asio::detail::throw_exception(ex); - } - } - - // Update stream positions. - setg(&buffer_[0], &buffer_[0], &buffer_[0] + pnext); - setp(&buffer_[0] + pnext, &buffer_[0] + pend); - } - -private: - std::size_t max_size_; - std::vector buffer_; - - // Helper function to get the preferred size for reading data. - friend std::size_t read_size_helper( - basic_streambuf& sb, std::size_t max_size) - { - return std::min( - std::max(512, sb.buffer_.capacity() - sb.size()), - std::min(max_size, sb.max_size() - sb.size())); - } -}; - -/// Adapts basic_streambuf to the dynamic buffer sequence type requirements. -#if defined(GENERATING_DOCUMENTATION) -template > -#else -template -#endif -class basic_streambuf_ref -{ -public: - /// The type used to represent the input sequence as a list of buffers. - typedef typename basic_streambuf::const_buffers_type - const_buffers_type; - - /// The type used to represent the output sequence as a list of buffers. - typedef typename basic_streambuf::mutable_buffers_type - mutable_buffers_type; - - /// Construct a basic_streambuf_ref for the given basic_streambuf object. - explicit basic_streambuf_ref(basic_streambuf& sb) - : sb_(sb) - { - } - - /// Copy construct a basic_streambuf_ref. - basic_streambuf_ref(const basic_streambuf_ref& other) ASIO_NOEXCEPT - : sb_(other.sb_) - { - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move construct a basic_streambuf_ref. - basic_streambuf_ref(basic_streambuf_ref&& other) ASIO_NOEXCEPT - : sb_(other.sb_) - { - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Get the size of the input sequence. - std::size_t size() const ASIO_NOEXCEPT - { - return sb_.size(); - } - - /// Get the maximum size of the dynamic buffer. - std::size_t max_size() const ASIO_NOEXCEPT - { - return sb_.max_size(); - } - - /// Get the current capacity of the dynamic buffer. - std::size_t capacity() const ASIO_NOEXCEPT - { - return sb_.capacity(); - } - - /// Get a list of buffers that represents the input sequence. - const_buffers_type data() const ASIO_NOEXCEPT - { - return sb_.data(); - } - - /// Get a list of buffers that represents the output sequence, with the given - /// size. - mutable_buffers_type prepare(std::size_t n) - { - return sb_.prepare(n); - } - - /// Move bytes from the output sequence to the input sequence. - void commit(std::size_t n) - { - return sb_.commit(n); - } - - /// Remove characters from the input sequence. - void consume(std::size_t n) - { - return sb_.consume(n); - } - -private: - basic_streambuf& sb_; -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // !defined(ASIO_NO_IOSTREAM) - -#endif // ASIO_BASIC_STREAMBUF_HPP diff --git a/tools/sdk/include/asio/asio/basic_streambuf_fwd.hpp b/tools/sdk/include/asio/asio/basic_streambuf_fwd.hpp deleted file mode 100644 index ed54fe95645..00000000000 --- a/tools/sdk/include/asio/asio/basic_streambuf_fwd.hpp +++ /dev/null @@ -1,36 +0,0 @@ -// -// basic_streambuf_fwd.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_BASIC_STREAMBUF_FWD_HPP -#define ASIO_BASIC_STREAMBUF_FWD_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_NO_IOSTREAM) - -#include - -namespace asio { - -template > -class basic_streambuf; - -template > -class basic_streambuf_ref; - -} // namespace asio - -#endif // !defined(ASIO_NO_IOSTREAM) - -#endif // ASIO_BASIC_STREAMBUF_FWD_HPP diff --git a/tools/sdk/include/asio/asio/basic_waitable_timer.hpp b/tools/sdk/include/asio/asio/basic_waitable_timer.hpp deleted file mode 100644 index 22b85a698ed..00000000000 --- a/tools/sdk/include/asio/asio/basic_waitable_timer.hpp +++ /dev/null @@ -1,705 +0,0 @@ -// -// basic_waitable_timer.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_BASIC_WAITABLE_TIMER_HPP -#define ASIO_BASIC_WAITABLE_TIMER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/basic_io_object.hpp" -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/error.hpp" -#include "asio/wait_traits.hpp" - -#if defined(ASIO_HAS_MOVE) -# include -#endif // defined(ASIO_HAS_MOVE) - -#if defined(ASIO_ENABLE_OLD_SERVICES) -# include "asio/waitable_timer_service.hpp" -#else // defined(ASIO_ENABLE_OLD_SERVICES) -# include "asio/detail/chrono_time_traits.hpp" -# include "asio/detail/deadline_timer_service.hpp" -# define ASIO_SVC_T \ - detail::deadline_timer_service< \ - detail::chrono_time_traits > -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#include "asio/detail/push_options.hpp" - -namespace asio { - -#if !defined(ASIO_BASIC_WAITABLE_TIMER_FWD_DECL) -#define ASIO_BASIC_WAITABLE_TIMER_FWD_DECL - -// Forward declaration with defaulted arguments. -template - ASIO_SVC_TPARAM_DEF2(= waitable_timer_service)> -class basic_waitable_timer; - -#endif // !defined(ASIO_BASIC_WAITABLE_TIMER_FWD_DECL) - -/// Provides waitable timer functionality. -/** - * The basic_waitable_timer class template provides the ability to perform a - * blocking or asynchronous wait for a timer to expire. - * - * A waitable timer is always in one of two states: "expired" or "not expired". - * If the wait() or async_wait() function is called on an expired timer, the - * wait operation will complete immediately. - * - * Most applications will use one of the asio::steady_timer, - * asio::system_timer or asio::high_resolution_timer typedefs. - * - * @note This waitable timer functionality is for use with the C++11 standard - * library's @c <chrono> facility, or with the Boost.Chrono library. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - * - * @par Examples - * Performing a blocking wait (C++11): - * @code - * // Construct a timer without setting an expiry time. - * asio::steady_timer timer(io_context); - * - * // Set an expiry time relative to now. - * timer.expires_after(std::chrono::seconds(5)); - * - * // Wait for the timer to expire. - * timer.wait(); - * @endcode - * - * @par - * Performing an asynchronous wait (C++11): - * @code - * void handler(const asio::error_code& error) - * { - * if (!error) - * { - * // Timer expired. - * } - * } - * - * ... - * - * // Construct a timer with an absolute expiry time. - * asio::steady_timer timer(io_context, - * std::chrono::steady_clock::now() + std::chrono::seconds(60)); - * - * // Start an asynchronous wait. - * timer.async_wait(handler); - * @endcode - * - * @par Changing an active waitable timer's expiry time - * - * Changing the expiry time of a timer while there are pending asynchronous - * waits causes those wait operations to be cancelled. To ensure that the action - * associated with the timer is performed only once, use something like this: - * used: - * - * @code - * void on_some_event() - * { - * if (my_timer.expires_after(seconds(5)) > 0) - * { - * // We managed to cancel the timer. Start new asynchronous wait. - * my_timer.async_wait(on_timeout); - * } - * else - * { - * // Too late, timer has already expired! - * } - * } - * - * void on_timeout(const asio::error_code& e) - * { - * if (e != asio::error::operation_aborted) - * { - * // Timer was not cancelled, take necessary action. - * } - * } - * @endcode - * - * @li The asio::basic_waitable_timer::expires_after() function - * cancels any pending asynchronous waits, and returns the number of - * asynchronous waits that were cancelled. If it returns 0 then you were too - * late and the wait handler has already been executed, or will soon be - * executed. If it returns 1 then the wait handler was successfully cancelled. - * - * @li If a wait handler is cancelled, the asio::error_code passed to - * it contains the value asio::error::operation_aborted. - */ -template -class basic_waitable_timer - : ASIO_SVC_ACCESS basic_io_object -{ -public: - /// The type of the executor associated with the object. - typedef io_context::executor_type executor_type; - - /// The clock type. - typedef Clock clock_type; - - /// The duration type of the clock. - typedef typename clock_type::duration duration; - - /// The time point type of the clock. - typedef typename clock_type::time_point time_point; - - /// The wait traits type. - typedef WaitTraits traits_type; - - /// Constructor. - /** - * This constructor creates a timer without setting an expiry time. The - * expires_at() or expires_after() functions must be called to set an expiry - * time before the timer can be waited on. - * - * @param io_context The io_context object that the timer will use to dispatch - * handlers for any asynchronous operations performed on the timer. - */ - explicit basic_waitable_timer(asio::io_context& io_context) - : basic_io_object(io_context) - { - } - - /// Constructor to set a particular expiry time as an absolute time. - /** - * This constructor creates a timer and sets the expiry time. - * - * @param io_context The io_context object that the timer will use to dispatch - * handlers for any asynchronous operations performed on the timer. - * - * @param expiry_time The expiry time to be used for the timer, expressed - * as an absolute time. - */ - basic_waitable_timer(asio::io_context& io_context, - const time_point& expiry_time) - : basic_io_object(io_context) - { - asio::error_code ec; - this->get_service().expires_at(this->get_implementation(), expiry_time, ec); - asio::detail::throw_error(ec, "expires_at"); - } - - /// Constructor to set a particular expiry time relative to now. - /** - * This constructor creates a timer and sets the expiry time. - * - * @param io_context The io_context object that the timer will use to dispatch - * handlers for any asynchronous operations performed on the timer. - * - * @param expiry_time The expiry time to be used for the timer, relative to - * now. - */ - basic_waitable_timer(asio::io_context& io_context, - const duration& expiry_time) - : basic_io_object(io_context) - { - asio::error_code ec; - this->get_service().expires_after( - this->get_implementation(), expiry_time, ec); - asio::detail::throw_error(ec, "expires_after"); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a basic_waitable_timer from another. - /** - * This constructor moves a timer from one object to another. - * - * @param other The other basic_waitable_timer object from which the move will - * occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_waitable_timer(io_context&) constructor. - */ - basic_waitable_timer(basic_waitable_timer&& other) - : basic_io_object(std::move(other)) - { - } - - /// Move-assign a basic_waitable_timer from another. - /** - * This assignment operator moves a timer from one object to another. Cancels - * any outstanding asynchronous operations associated with the target object. - * - * @param other The other basic_waitable_timer object from which the move will - * occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_waitable_timer(io_context&) constructor. - */ - basic_waitable_timer& operator=(basic_waitable_timer&& other) - { - basic_io_object::operator=(std::move(other)); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destroys the timer. - /** - * This function destroys the timer, cancelling any outstanding asynchronous - * wait operations associated with the timer as if by calling @c cancel. - */ - ~basic_waitable_timer() - { - } - -#if defined(ASIO_ENABLE_OLD_SERVICES) - // These functions are provided by basic_io_object<>. -#else // defined(ASIO_ENABLE_OLD_SERVICES) -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - /** - * This function may be used to obtain the io_context object that the I/O - * object uses to dispatch handlers for asynchronous operations. - * - * @return A reference to the io_context object that the I/O object will use - * to dispatch handlers. Ownership is not transferred to the caller. - */ - asio::io_context& get_io_context() - { - return basic_io_object::get_io_context(); - } - - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - /** - * This function may be used to obtain the io_context object that the I/O - * object uses to dispatch handlers for asynchronous operations. - * - * @return A reference to the io_context object that the I/O object will use - * to dispatch handlers. Ownership is not transferred to the caller. - */ - asio::io_context& get_io_service() - { - return basic_io_object::get_io_service(); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Get the executor associated with the object. - executor_type get_executor() ASIO_NOEXCEPT - { - return basic_io_object::get_executor(); - } -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - - /// Cancel any asynchronous operations that are waiting on the timer. - /** - * This function forces the completion of any pending asynchronous wait - * operations against the timer. The handler for each cancelled operation will - * be invoked with the asio::error::operation_aborted error code. - * - * Cancelling the timer does not change the expiry time. - * - * @return The number of asynchronous operations that were cancelled. - * - * @throws asio::system_error Thrown on failure. - * - * @note If the timer has already expired when cancel() is called, then the - * handlers for asynchronous wait operations will: - * - * @li have already been invoked; or - * - * @li have been queued for invocation in the near future. - * - * These handlers can no longer be cancelled, and therefore are passed an - * error code that indicates the successful completion of the wait operation. - */ - std::size_t cancel() - { - asio::error_code ec; - std::size_t s = this->get_service().cancel(this->get_implementation(), ec); - asio::detail::throw_error(ec, "cancel"); - return s; - } - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use non-error_code overload.) Cancel any asynchronous - /// operations that are waiting on the timer. - /** - * This function forces the completion of any pending asynchronous wait - * operations against the timer. The handler for each cancelled operation will - * be invoked with the asio::error::operation_aborted error code. - * - * Cancelling the timer does not change the expiry time. - * - * @param ec Set to indicate what error occurred, if any. - * - * @return The number of asynchronous operations that were cancelled. - * - * @note If the timer has already expired when cancel() is called, then the - * handlers for asynchronous wait operations will: - * - * @li have already been invoked; or - * - * @li have been queued for invocation in the near future. - * - * These handlers can no longer be cancelled, and therefore are passed an - * error code that indicates the successful completion of the wait operation. - */ - std::size_t cancel(asio::error_code& ec) - { - return this->get_service().cancel(this->get_implementation(), ec); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Cancels one asynchronous operation that is waiting on the timer. - /** - * This function forces the completion of one pending asynchronous wait - * operation against the timer. Handlers are cancelled in FIFO order. The - * handler for the cancelled operation will be invoked with the - * asio::error::operation_aborted error code. - * - * Cancelling the timer does not change the expiry time. - * - * @return The number of asynchronous operations that were cancelled. That is, - * either 0 or 1. - * - * @throws asio::system_error Thrown on failure. - * - * @note If the timer has already expired when cancel_one() is called, then - * the handlers for asynchronous wait operations will: - * - * @li have already been invoked; or - * - * @li have been queued for invocation in the near future. - * - * These handlers can no longer be cancelled, and therefore are passed an - * error code that indicates the successful completion of the wait operation. - */ - std::size_t cancel_one() - { - asio::error_code ec; - std::size_t s = this->get_service().cancel_one( - this->get_implementation(), ec); - asio::detail::throw_error(ec, "cancel_one"); - return s; - } - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use non-error_code overload.) Cancels one asynchronous - /// operation that is waiting on the timer. - /** - * This function forces the completion of one pending asynchronous wait - * operation against the timer. Handlers are cancelled in FIFO order. The - * handler for the cancelled operation will be invoked with the - * asio::error::operation_aborted error code. - * - * Cancelling the timer does not change the expiry time. - * - * @param ec Set to indicate what error occurred, if any. - * - * @return The number of asynchronous operations that were cancelled. That is, - * either 0 or 1. - * - * @note If the timer has already expired when cancel_one() is called, then - * the handlers for asynchronous wait operations will: - * - * @li have already been invoked; or - * - * @li have been queued for invocation in the near future. - * - * These handlers can no longer be cancelled, and therefore are passed an - * error code that indicates the successful completion of the wait operation. - */ - std::size_t cancel_one(asio::error_code& ec) - { - return this->get_service().cancel_one(this->get_implementation(), ec); - } - - /// (Deprecated: Use expiry().) Get the timer's expiry time as an absolute - /// time. - /** - * This function may be used to obtain the timer's current expiry time. - * Whether the timer has expired or not does not affect this value. - */ - time_point expires_at() const - { - return this->get_service().expires_at(this->get_implementation()); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Get the timer's expiry time as an absolute time. - /** - * This function may be used to obtain the timer's current expiry time. - * Whether the timer has expired or not does not affect this value. - */ - time_point expiry() const - { - return this->get_service().expiry(this->get_implementation()); - } - - /// Set the timer's expiry time as an absolute time. - /** - * This function sets the expiry time. Any pending asynchronous wait - * operations will be cancelled. The handler for each cancelled operation will - * be invoked with the asio::error::operation_aborted error code. - * - * @param expiry_time The expiry time to be used for the timer. - * - * @return The number of asynchronous operations that were cancelled. - * - * @throws asio::system_error Thrown on failure. - * - * @note If the timer has already expired when expires_at() is called, then - * the handlers for asynchronous wait operations will: - * - * @li have already been invoked; or - * - * @li have been queued for invocation in the near future. - * - * These handlers can no longer be cancelled, and therefore are passed an - * error code that indicates the successful completion of the wait operation. - */ - std::size_t expires_at(const time_point& expiry_time) - { - asio::error_code ec; - std::size_t s = this->get_service().expires_at( - this->get_implementation(), expiry_time, ec); - asio::detail::throw_error(ec, "expires_at"); - return s; - } - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use non-error_code overload.) Set the timer's expiry time as - /// an absolute time. - /** - * This function sets the expiry time. Any pending asynchronous wait - * operations will be cancelled. The handler for each cancelled operation will - * be invoked with the asio::error::operation_aborted error code. - * - * @param expiry_time The expiry time to be used for the timer. - * - * @param ec Set to indicate what error occurred, if any. - * - * @return The number of asynchronous operations that were cancelled. - * - * @note If the timer has already expired when expires_at() is called, then - * the handlers for asynchronous wait operations will: - * - * @li have already been invoked; or - * - * @li have been queued for invocation in the near future. - * - * These handlers can no longer be cancelled, and therefore are passed an - * error code that indicates the successful completion of the wait operation. - */ - std::size_t expires_at(const time_point& expiry_time, - asio::error_code& ec) - { - return this->get_service().expires_at( - this->get_implementation(), expiry_time, ec); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Set the timer's expiry time relative to now. - /** - * This function sets the expiry time. Any pending asynchronous wait - * operations will be cancelled. The handler for each cancelled operation will - * be invoked with the asio::error::operation_aborted error code. - * - * @param expiry_time The expiry time to be used for the timer. - * - * @return The number of asynchronous operations that were cancelled. - * - * @throws asio::system_error Thrown on failure. - * - * @note If the timer has already expired when expires_after() is called, - * then the handlers for asynchronous wait operations will: - * - * @li have already been invoked; or - * - * @li have been queued for invocation in the near future. - * - * These handlers can no longer be cancelled, and therefore are passed an - * error code that indicates the successful completion of the wait operation. - */ - std::size_t expires_after(const duration& expiry_time) - { - asio::error_code ec; - std::size_t s = this->get_service().expires_after( - this->get_implementation(), expiry_time, ec); - asio::detail::throw_error(ec, "expires_after"); - return s; - } - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use expiry().) Get the timer's expiry time relative to now. - /** - * This function may be used to obtain the timer's current expiry time. - * Whether the timer has expired or not does not affect this value. - */ - duration expires_from_now() const - { - return this->get_service().expires_from_now(this->get_implementation()); - } - - /// (Deprecated: Use expires_after().) Set the timer's expiry time relative - /// to now. - /** - * This function sets the expiry time. Any pending asynchronous wait - * operations will be cancelled. The handler for each cancelled operation will - * be invoked with the asio::error::operation_aborted error code. - * - * @param expiry_time The expiry time to be used for the timer. - * - * @return The number of asynchronous operations that were cancelled. - * - * @throws asio::system_error Thrown on failure. - * - * @note If the timer has already expired when expires_from_now() is called, - * then the handlers for asynchronous wait operations will: - * - * @li have already been invoked; or - * - * @li have been queued for invocation in the near future. - * - * These handlers can no longer be cancelled, and therefore are passed an - * error code that indicates the successful completion of the wait operation. - */ - std::size_t expires_from_now(const duration& expiry_time) - { - asio::error_code ec; - std::size_t s = this->get_service().expires_from_now( - this->get_implementation(), expiry_time, ec); - asio::detail::throw_error(ec, "expires_from_now"); - return s; - } - - /// (Deprecated: Use expires_after().) Set the timer's expiry time relative - /// to now. - /** - * This function sets the expiry time. Any pending asynchronous wait - * operations will be cancelled. The handler for each cancelled operation will - * be invoked with the asio::error::operation_aborted error code. - * - * @param expiry_time The expiry time to be used for the timer. - * - * @param ec Set to indicate what error occurred, if any. - * - * @return The number of asynchronous operations that were cancelled. - * - * @note If the timer has already expired when expires_from_now() is called, - * then the handlers for asynchronous wait operations will: - * - * @li have already been invoked; or - * - * @li have been queued for invocation in the near future. - * - * These handlers can no longer be cancelled, and therefore are passed an - * error code that indicates the successful completion of the wait operation. - */ - std::size_t expires_from_now(const duration& expiry_time, - asio::error_code& ec) - { - return this->get_service().expires_from_now( - this->get_implementation(), expiry_time, ec); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Perform a blocking wait on the timer. - /** - * This function is used to wait for the timer to expire. This function - * blocks and does not return until the timer has expired. - * - * @throws asio::system_error Thrown on failure. - */ - void wait() - { - asio::error_code ec; - this->get_service().wait(this->get_implementation(), ec); - asio::detail::throw_error(ec, "wait"); - } - - /// Perform a blocking wait on the timer. - /** - * This function is used to wait for the timer to expire. This function - * blocks and does not return until the timer has expired. - * - * @param ec Set to indicate what error occurred, if any. - */ - void wait(asio::error_code& ec) - { - this->get_service().wait(this->get_implementation(), ec); - } - - /// Start an asynchronous wait on the timer. - /** - * This function may be used to initiate an asynchronous wait against the - * timer. It always returns immediately. - * - * For each call to async_wait(), the supplied handler will be called exactly - * once. The handler will be called when: - * - * @li The timer has expired. - * - * @li The timer was cancelled, in which case the handler is passed the error - * code asio::error::operation_aborted. - * - * @param handler The handler to be called when the timer expires. Copies - * will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * const asio::error_code& error // Result of operation. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - */ - template - ASIO_INITFN_RESULT_TYPE(WaitHandler, - void (asio::error_code)) - async_wait(ASIO_MOVE_ARG(WaitHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WaitHandler. - ASIO_WAIT_HANDLER_CHECK(WaitHandler, handler) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_wait(this->get_implementation(), - ASIO_MOVE_CAST(WaitHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_wait(this->get_implementation(), - init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - -private: - // Disallow copying and assignment. - basic_waitable_timer(const basic_waitable_timer&) ASIO_DELETED; - basic_waitable_timer& operator=( - const basic_waitable_timer&) ASIO_DELETED; -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if !defined(ASIO_ENABLE_OLD_SERVICES) -# undef ASIO_SVC_T -#endif // !defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_BASIC_WAITABLE_TIMER_HPP diff --git a/tools/sdk/include/asio/asio/bind_executor.hpp b/tools/sdk/include/asio/asio/bind_executor.hpp deleted file mode 100644 index 9e2094b5443..00000000000 --- a/tools/sdk/include/asio/asio/bind_executor.hpp +++ /dev/null @@ -1,611 +0,0 @@ -// -// bind_executor.hpp -// ~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_BIND_EXECUTOR_HPP -#define ASIO_BIND_EXECUTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/detail/variadic_templates.hpp" -#include "asio/associated_executor.hpp" -#include "asio/associated_allocator.hpp" -#include "asio/async_result.hpp" -#include "asio/execution_context.hpp" -#include "asio/is_executor.hpp" -#include "asio/uses_executor.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -struct executor_binder_check -{ - typedef void type; -}; - -// Helper to automatically define nested typedef result_type. - -template -struct executor_binder_result_type -{ -protected: - typedef void result_type_or_void; -}; - -template -struct executor_binder_result_type::type> -{ - typedef typename T::result_type result_type; -protected: - typedef result_type result_type_or_void; -}; - -template -struct executor_binder_result_type -{ - typedef R result_type; -protected: - typedef result_type result_type_or_void; -}; - -template -struct executor_binder_result_type -{ - typedef R result_type; -protected: - typedef result_type result_type_or_void; -}; - -template -struct executor_binder_result_type -{ - typedef R result_type; -protected: - typedef result_type result_type_or_void; -}; - -template -struct executor_binder_result_type -{ - typedef R result_type; -protected: - typedef result_type result_type_or_void; -}; - -template -struct executor_binder_result_type -{ - typedef R result_type; -protected: - typedef result_type result_type_or_void; -}; - -template -struct executor_binder_result_type -{ - typedef R result_type; -protected: - typedef result_type result_type_or_void; -}; - -// Helper to automatically define nested typedef argument_type. - -template -struct executor_binder_argument_type {}; - -template -struct executor_binder_argument_type::type> -{ - typedef typename T::argument_type argument_type; -}; - -template -struct executor_binder_argument_type -{ - typedef A1 argument_type; -}; - -template -struct executor_binder_argument_type -{ - typedef A1 argument_type; -}; - -// Helper to automatically define nested typedefs first_argument_type and -// second_argument_type. - -template -struct executor_binder_argument_types {}; - -template -struct executor_binder_argument_types::type> -{ - typedef typename T::first_argument_type first_argument_type; - typedef typename T::second_argument_type second_argument_type; -}; - -template -struct executor_binder_argument_type -{ - typedef A1 first_argument_type; - typedef A2 second_argument_type; -}; - -template -struct executor_binder_argument_type -{ - typedef A1 first_argument_type; - typedef A2 second_argument_type; -}; - -// Helper to: -// - Apply the empty base optimisation to the executor. -// - Perform uses_executor construction of the target type, if required. - -template -class executor_binder_base; - -template -class executor_binder_base - : protected Executor -{ -protected: - template - executor_binder_base(ASIO_MOVE_ARG(E) e, ASIO_MOVE_ARG(U) u) - : executor_(ASIO_MOVE_CAST(E)(e)), - target_(executor_arg_t(), executor_, ASIO_MOVE_CAST(U)(u)) - { - } - - Executor executor_; - T target_; -}; - -template -class executor_binder_base -{ -protected: - template - executor_binder_base(ASIO_MOVE_ARG(E) e, ASIO_MOVE_ARG(U) u) - : executor_(ASIO_MOVE_CAST(E)(e)), - target_(ASIO_MOVE_CAST(U)(u)) - { - } - - Executor executor_; - T target_; -}; - -// Helper to enable SFINAE on zero-argument operator() below. - -template -struct executor_binder_result_of0 -{ - typedef void type; -}; - -template -struct executor_binder_result_of0::type>::type> -{ - typedef typename result_of::type type; -}; - -} // namespace detail - -/// A call wrapper type to bind an executor of type @c Executor to an object of -/// type @c T. -template -class executor_binder -#if !defined(GENERATING_DOCUMENTATION) - : public detail::executor_binder_result_type, - public detail::executor_binder_argument_type, - public detail::executor_binder_argument_types, - private detail::executor_binder_base< - T, Executor, uses_executor::value> -#endif // !defined(GENERATING_DOCUMENTATION) -{ -public: - /// The type of the target object. - typedef T target_type; - - /// The type of the associated executor. - typedef Executor executor_type; - -#if defined(GENERATING_DOCUMENTATION) - /// The return type if a function. - /** - * The type of @c result_type is based on the type @c T of the wrapper's - * target object: - * - * @li if @c T is a pointer to function type, @c result_type is a synonym for - * the return type of @c T; - * - * @li if @c T is a class type with a member type @c result_type, then @c - * result_type is a synonym for @c T::result_type; - * - * @li otherwise @c result_type is not defined. - */ - typedef see_below result_type; - - /// The type of the function's argument. - /** - * The type of @c argument_type is based on the type @c T of the wrapper's - * target object: - * - * @li if @c T is a pointer to a function type accepting a single argument, - * @c argument_type is a synonym for the return type of @c T; - * - * @li if @c T is a class type with a member type @c argument_type, then @c - * argument_type is a synonym for @c T::argument_type; - * - * @li otherwise @c argument_type is not defined. - */ - typedef see_below argument_type; - - /// The type of the function's first argument. - /** - * The type of @c first_argument_type is based on the type @c T of the - * wrapper's target object: - * - * @li if @c T is a pointer to a function type accepting two arguments, @c - * first_argument_type is a synonym for the return type of @c T; - * - * @li if @c T is a class type with a member type @c first_argument_type, - * then @c first_argument_type is a synonym for @c T::first_argument_type; - * - * @li otherwise @c first_argument_type is not defined. - */ - typedef see_below first_argument_type; - - /// The type of the function's second argument. - /** - * The type of @c second_argument_type is based on the type @c T of the - * wrapper's target object: - * - * @li if @c T is a pointer to a function type accepting two arguments, @c - * second_argument_type is a synonym for the return type of @c T; - * - * @li if @c T is a class type with a member type @c first_argument_type, - * then @c second_argument_type is a synonym for @c T::second_argument_type; - * - * @li otherwise @c second_argument_type is not defined. - */ - typedef see_below second_argument_type; -#endif // defined(GENERATING_DOCUMENTATION) - - /// Construct an executor wrapper for the specified object. - /** - * This constructor is only valid if the type @c T is constructible from type - * @c U. - */ - template - executor_binder(executor_arg_t, const executor_type& e, - ASIO_MOVE_ARG(U) u) - : base_type(e, ASIO_MOVE_CAST(U)(u)) - { - } - - /// Copy constructor. - executor_binder(const executor_binder& other) - : base_type(other.get_executor(), other.get()) - { - } - - /// Construct a copy, but specify a different executor. - executor_binder(executor_arg_t, const executor_type& e, - const executor_binder& other) - : base_type(e, other.get()) - { - } - - /// Construct a copy of a different executor wrapper type. - /** - * This constructor is only valid if the @c Executor type is constructible - * from type @c OtherExecutor, and the type @c T is constructible from type - * @c U. - */ - template - executor_binder(const executor_binder& other) - : base_type(other.get_executor(), other.get()) - { - } - - /// Construct a copy of a different executor wrapper type, but specify a - /// different executor. - /** - * This constructor is only valid if the type @c T is constructible from type - * @c U. - */ - template - executor_binder(executor_arg_t, const executor_type& e, - const executor_binder& other) - : base_type(e, other.get()) - { - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Move constructor. - executor_binder(executor_binder&& other) - : base_type(ASIO_MOVE_CAST(executor_type)(other.get_executor()), - ASIO_MOVE_CAST(T)(other.get())) - { - } - - /// Move construct the target object, but specify a different executor. - executor_binder(executor_arg_t, const executor_type& e, - executor_binder&& other) - : base_type(e, ASIO_MOVE_CAST(T)(other.get())) - { - } - - /// Move construct from a different executor wrapper type. - template - executor_binder(executor_binder&& other) - : base_type(ASIO_MOVE_CAST(OtherExecutor)(other.get_executor()), - ASIO_MOVE_CAST(U)(other.get())) - { - } - - /// Move construct from a different executor wrapper type, but specify a - /// different executor. - template - executor_binder(executor_arg_t, const executor_type& e, - executor_binder&& other) - : base_type(e, ASIO_MOVE_CAST(U)(other.get())) - { - } - -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destructor. - ~executor_binder() - { - } - - /// Obtain a reference to the target object. - target_type& get() ASIO_NOEXCEPT - { - return this->target_; - } - - /// Obtain a reference to the target object. - const target_type& get() const ASIO_NOEXCEPT - { - return this->target_; - } - - /// Obtain the associated executor. - executor_type get_executor() const ASIO_NOEXCEPT - { - return this->executor_; - } - -#if defined(GENERATING_DOCUMENTATION) - - template auto operator()(Args&& ...); - template auto operator()(Args&& ...) const; - -#elif defined(ASIO_HAS_VARIADIC_TEMPLATES) - - /// Forwarding function call operator. - template - typename result_of::type operator()( - ASIO_MOVE_ARG(Args)... args) - { - return this->target_(ASIO_MOVE_CAST(Args)(args)...); - } - - /// Forwarding function call operator. - template - typename result_of::type operator()( - ASIO_MOVE_ARG(Args)... args) const - { - return this->target_(ASIO_MOVE_CAST(Args)(args)...); - } - -#elif defined(ASIO_HAS_STD_TYPE_TRAITS) && !defined(_MSC_VER) - - typename detail::executor_binder_result_of0::type operator()() - { - return this->target_(); - } - - typename detail::executor_binder_result_of0::type operator()() const - { - return this->target_(); - } - -#define ASIO_PRIVATE_BIND_EXECUTOR_CALL_DEF(n) \ - template \ - typename result_of::type operator()( \ - ASIO_VARIADIC_MOVE_PARAMS(n)) \ - { \ - return this->target_(ASIO_VARIADIC_MOVE_ARGS(n)); \ - } \ - \ - template \ - typename result_of::type operator()( \ - ASIO_VARIADIC_MOVE_PARAMS(n)) const \ - { \ - return this->target_(ASIO_VARIADIC_MOVE_ARGS(n)); \ - } \ - /**/ - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_BIND_EXECUTOR_CALL_DEF) -#undef ASIO_PRIVATE_BIND_EXECUTOR_CALL_DEF - -#else // defined(ASIO_HAS_STD_TYPE_TRAITS) && !defined(_MSC_VER) - - typedef typename detail::executor_binder_result_type::result_type_or_void - result_type_or_void; - - result_type_or_void operator()() - { - return this->target_(); - } - - result_type_or_void operator()() const - { - return this->target_(); - } - -#define ASIO_PRIVATE_BIND_EXECUTOR_CALL_DEF(n) \ - template \ - result_type_or_void operator()( \ - ASIO_VARIADIC_MOVE_PARAMS(n)) \ - { \ - return this->target_(ASIO_VARIADIC_MOVE_ARGS(n)); \ - } \ - \ - template \ - result_type_or_void operator()( \ - ASIO_VARIADIC_MOVE_PARAMS(n)) const \ - { \ - return this->target_(ASIO_VARIADIC_MOVE_ARGS(n)); \ - } \ - /**/ - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_BIND_EXECUTOR_CALL_DEF) -#undef ASIO_PRIVATE_BIND_EXECUTOR_CALL_DEF - -#endif // defined(ASIO_HAS_STD_TYPE_TRAITS) && !defined(_MSC_VER) - -private: - typedef detail::executor_binder_base::value> base_type; -}; - -/// Associate an object of type @c T with an executor of type @c Executor. -template -inline executor_binder::type, Executor> -bind_executor(const Executor& ex, ASIO_MOVE_ARG(T) t, - typename enable_if::value>::type* = 0) -{ - return executor_binder::type, Executor>( - executor_arg_t(), ex, ASIO_MOVE_CAST(T)(t)); -} - -/// Associate an object of type @c T with an execution context's executor. -template -inline executor_binder::type, - typename ExecutionContext::executor_type> -bind_executor(ExecutionContext& ctx, ASIO_MOVE_ARG(T) t, - typename enable_if::value>::type* = 0) -{ - return executor_binder::type, - typename ExecutionContext::executor_type>( - executor_arg_t(), ctx.get_executor(), ASIO_MOVE_CAST(T)(t)); -} - -#if !defined(GENERATING_DOCUMENTATION) - -template -struct uses_executor, Executor> - : true_type {}; - -template -class async_result, Signature> -{ -public: - typedef executor_binder< - typename async_result::completion_handler_type, Executor> - completion_handler_type; - - typedef typename async_result::return_type return_type; - - explicit async_result(executor_binder& b) - : target_(b.get()) - { - } - - return_type get() - { - return target_.get(); - } - -private: - async_result(const async_result&) ASIO_DELETED; - async_result& operator=(const async_result&) ASIO_DELETED; - - async_result target_; -}; - -#if !defined(ASIO_NO_DEPRECATED) - -template -struct handler_type, Signature> -{ - typedef executor_binder< - typename handler_type::type, Executor> type; -}; - -template -class async_result > -{ -public: - typedef typename async_result::type type; - - explicit async_result(executor_binder& b) - : target_(b.get()) - { - } - - type get() - { - return target_.get(); - } - -private: - async_result target_; -}; - -#endif // !defined(ASIO_NO_DEPRECATED) - -template -struct associated_allocator, Allocator> -{ - typedef typename associated_allocator::type type; - - static type get(const executor_binder& b, - const Allocator& a = Allocator()) ASIO_NOEXCEPT - { - return associated_allocator::get(b.get(), a); - } -}; - -template -struct associated_executor, Executor1> -{ - typedef Executor type; - - static type get(const executor_binder& b, - const Executor1& = Executor1()) ASIO_NOEXCEPT - { - return b.get_executor(); - } -}; - -#endif // !defined(GENERATING_DOCUMENTATION) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_BIND_EXECUTOR_HPP diff --git a/tools/sdk/include/asio/asio/buffer.hpp b/tools/sdk/include/asio/asio/buffer.hpp deleted file mode 100644 index a9aa8aad272..00000000000 --- a/tools/sdk/include/asio/asio/buffer.hpp +++ /dev/null @@ -1,2162 +0,0 @@ -// -// buffer.hpp -// ~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_BUFFER_HPP -#define ASIO_BUFFER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include -#include -#include -#include -#include -#include "asio/detail/array_fwd.hpp" -#include "asio/detail/is_buffer_sequence.hpp" -#include "asio/detail/string_view.hpp" -#include "asio/detail/throw_exception.hpp" -#include "asio/detail/type_traits.hpp" - -#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1700) -# if defined(_HAS_ITERATOR_DEBUGGING) && (_HAS_ITERATOR_DEBUGGING != 0) -# if !defined(ASIO_DISABLE_BUFFER_DEBUGGING) -# define ASIO_ENABLE_BUFFER_DEBUGGING -# endif // !defined(ASIO_DISABLE_BUFFER_DEBUGGING) -# endif // defined(_HAS_ITERATOR_DEBUGGING) -#endif // defined(ASIO_MSVC) && (ASIO_MSVC >= 1700) - -#if defined(__GNUC__) -# if defined(_GLIBCXX_DEBUG) -# if !defined(ASIO_DISABLE_BUFFER_DEBUGGING) -# define ASIO_ENABLE_BUFFER_DEBUGGING -# endif // !defined(ASIO_DISABLE_BUFFER_DEBUGGING) -# endif // defined(_GLIBCXX_DEBUG) -#endif // defined(__GNUC__) - -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) -# include "asio/detail/functional.hpp" -#endif // ASIO_ENABLE_BUFFER_DEBUGGING - -#if defined(ASIO_HAS_BOOST_WORKAROUND) -# include -# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) \ - || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590)) -# define ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND -# endif // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) - // || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590)) -#endif // defined(ASIO_HAS_BOOST_WORKAROUND) - -#if defined(ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND) -# include "asio/detail/type_traits.hpp" -#endif // defined(ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND) - -#include "asio/detail/push_options.hpp" - -namespace asio { - -class mutable_buffer; -class const_buffer; - -/// Holds a buffer that can be modified. -/** - * The mutable_buffer class provides a safe representation of a buffer that can - * be modified. It does not own the underlying data, and so is cheap to copy or - * assign. - * - * @par Accessing Buffer Contents - * - * The contents of a buffer may be accessed using the @c data() and @c size() - * member functions: - * - * @code asio::mutable_buffer b1 = ...; - * std::size_t s1 = b1.size(); - * unsigned char* p1 = static_cast(b1.data()); - * @endcode - * - * The @c data() member function permits violations of type safety, so uses of - * it in application code should be carefully considered. - */ -class mutable_buffer -{ -public: - /// Construct an empty buffer. - mutable_buffer() ASIO_NOEXCEPT - : data_(0), - size_(0) - { - } - - /// Construct a buffer to represent a given memory range. - mutable_buffer(void* data, std::size_t size) ASIO_NOEXCEPT - : data_(data), - size_(size) - { - } - -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - mutable_buffer(void* data, std::size_t size, - asio::detail::function debug_check) - : data_(data), - size_(size), - debug_check_(debug_check) - { - } - - const asio::detail::function& get_debug_check() const - { - return debug_check_; - } -#endif // ASIO_ENABLE_BUFFER_DEBUGGING - - /// Get a pointer to the beginning of the memory range. - void* data() const ASIO_NOEXCEPT - { -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - if (size_ && debug_check_) - debug_check_(); -#endif // ASIO_ENABLE_BUFFER_DEBUGGING - return data_; - } - - /// Get the size of the memory range. - std::size_t size() const ASIO_NOEXCEPT - { - return size_; - } - - /// Move the start of the buffer by the specified number of bytes. - mutable_buffer& operator+=(std::size_t n) ASIO_NOEXCEPT - { - std::size_t offset = n < size_ ? n : size_; - data_ = static_cast(data_) + offset; - size_ -= offset; - return *this; - } - -private: - void* data_; - std::size_t size_; - -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - asio::detail::function debug_check_; -#endif // ASIO_ENABLE_BUFFER_DEBUGGING -}; - -#if !defined(ASIO_NO_DEPRECATED) - -/// (Deprecated: Use mutable_buffer.) Adapts a single modifiable buffer so that -/// it meets the requirements of the MutableBufferSequence concept. -class mutable_buffers_1 - : public mutable_buffer -{ -public: - /// The type for each element in the list of buffers. - typedef mutable_buffer value_type; - - /// A random-access iterator type that may be used to read elements. - typedef const mutable_buffer* const_iterator; - - /// Construct to represent a given memory range. - mutable_buffers_1(void* data, std::size_t size) ASIO_NOEXCEPT - : mutable_buffer(data, size) - { - } - -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - mutable_buffers_1(void* data, std::size_t size, - asio::detail::function debug_check) - : mutable_buffer(data, size, debug_check) - { - } -#endif // ASIO_ENABLE_BUFFER_DEBUGGING - - /// Construct to represent a single modifiable buffer. - explicit mutable_buffers_1(const mutable_buffer& b) ASIO_NOEXCEPT - : mutable_buffer(b) - { - } - - /// Get a random-access iterator to the first element. - const_iterator begin() const ASIO_NOEXCEPT - { - return this; - } - - /// Get a random-access iterator for one past the last element. - const_iterator end() const ASIO_NOEXCEPT - { - return begin() + 1; - } -}; - -#endif // !defined(ASIO_NO_DEPRECATED) - -/// Holds a buffer that cannot be modified. -/** - * The const_buffer class provides a safe representation of a buffer that cannot - * be modified. It does not own the underlying data, and so is cheap to copy or - * assign. - * - * @par Accessing Buffer Contents - * - * The contents of a buffer may be accessed using the @c data() and @c size() - * member functions: - * - * @code asio::const_buffer b1 = ...; - * std::size_t s1 = b1.size(); - * const unsigned char* p1 = static_cast(b1.data()); - * @endcode - * - * The @c data() member function permits violations of type safety, so uses of - * it in application code should be carefully considered. - */ -class const_buffer -{ -public: - /// Construct an empty buffer. - const_buffer() ASIO_NOEXCEPT - : data_(0), - size_(0) - { - } - - /// Construct a buffer to represent a given memory range. - const_buffer(const void* data, std::size_t size) ASIO_NOEXCEPT - : data_(data), - size_(size) - { - } - - /// Construct a non-modifiable buffer from a modifiable one. - const_buffer(const mutable_buffer& b) ASIO_NOEXCEPT - : data_(b.data()), - size_(b.size()) -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - , debug_check_(b.get_debug_check()) -#endif // ASIO_ENABLE_BUFFER_DEBUGGING - { - } - -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - const_buffer(const void* data, std::size_t size, - asio::detail::function debug_check) - : data_(data), - size_(size), - debug_check_(debug_check) - { - } - - const asio::detail::function& get_debug_check() const - { - return debug_check_; - } -#endif // ASIO_ENABLE_BUFFER_DEBUGGING - - /// Get a pointer to the beginning of the memory range. - const void* data() const ASIO_NOEXCEPT - { -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - if (size_ && debug_check_) - debug_check_(); -#endif // ASIO_ENABLE_BUFFER_DEBUGGING - return data_; - } - - /// Get the size of the memory range. - std::size_t size() const ASIO_NOEXCEPT - { - return size_; - } - - /// Move the start of the buffer by the specified number of bytes. - const_buffer& operator+=(std::size_t n) ASIO_NOEXCEPT - { - std::size_t offset = n < size_ ? n : size_; - data_ = static_cast(data_) + offset; - size_ -= offset; - return *this; - } - -private: - const void* data_; - std::size_t size_; - -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - asio::detail::function debug_check_; -#endif // ASIO_ENABLE_BUFFER_DEBUGGING -}; - -#if !defined(ASIO_NO_DEPRECATED) - -/// (Deprecated: Use const_buffer.) Adapts a single non-modifiable buffer so -/// that it meets the requirements of the ConstBufferSequence concept. -class const_buffers_1 - : public const_buffer -{ -public: - /// The type for each element in the list of buffers. - typedef const_buffer value_type; - - /// A random-access iterator type that may be used to read elements. - typedef const const_buffer* const_iterator; - - /// Construct to represent a given memory range. - const_buffers_1(const void* data, std::size_t size) ASIO_NOEXCEPT - : const_buffer(data, size) - { - } - -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - const_buffers_1(const void* data, std::size_t size, - asio::detail::function debug_check) - : const_buffer(data, size, debug_check) - { - } -#endif // ASIO_ENABLE_BUFFER_DEBUGGING - - /// Construct to represent a single non-modifiable buffer. - explicit const_buffers_1(const const_buffer& b) ASIO_NOEXCEPT - : const_buffer(b) - { - } - - /// Get a random-access iterator to the first element. - const_iterator begin() const ASIO_NOEXCEPT - { - return this; - } - - /// Get a random-access iterator for one past the last element. - const_iterator end() const ASIO_NOEXCEPT - { - return begin() + 1; - } -}; - -#endif // !defined(ASIO_NO_DEPRECATED) - -/// Trait to determine whether a type satisfies the MutableBufferSequence -/// requirements. -template -struct is_mutable_buffer_sequence -#if defined(GENERATING_DOCUMENTATION) - : integral_constant -#else // defined(GENERATING_DOCUMENTATION) - : asio::detail::is_buffer_sequence -#endif // defined(GENERATING_DOCUMENTATION) -{ -}; - -/// Trait to determine whether a type satisfies the ConstBufferSequence -/// requirements. -template -struct is_const_buffer_sequence -#if defined(GENERATING_DOCUMENTATION) - : integral_constant -#else // defined(GENERATING_DOCUMENTATION) - : asio::detail::is_buffer_sequence -#endif // defined(GENERATING_DOCUMENTATION) -{ -}; - -/// Trait to determine whether a type satisfies the DynamicBuffer requirements. -template -struct is_dynamic_buffer -#if defined(GENERATING_DOCUMENTATION) - : integral_constant -#else // defined(GENERATING_DOCUMENTATION) - : asio::detail::is_dynamic_buffer -#endif // defined(GENERATING_DOCUMENTATION) -{ -}; - -/// (Deprecated: Use the socket/descriptor wait() and async_wait() member -/// functions.) An implementation of both the ConstBufferSequence and -/// MutableBufferSequence concepts to represent a null buffer sequence. -class null_buffers -{ -public: - /// The type for each element in the list of buffers. - typedef mutable_buffer value_type; - - /// A random-access iterator type that may be used to read elements. - typedef const mutable_buffer* const_iterator; - - /// Get a random-access iterator to the first element. - const_iterator begin() const ASIO_NOEXCEPT - { - return &buf_; - } - - /// Get a random-access iterator for one past the last element. - const_iterator end() const ASIO_NOEXCEPT - { - return &buf_; - } - -private: - mutable_buffer buf_; -}; - -/** @defgroup buffer_sequence_begin asio::buffer_sequence_begin - * - * @brief The asio::buffer_sequence_begin function returns an iterator - * pointing to the first element in a buffer sequence. - */ -/*@{*/ - -/// Get an iterator to the first element in a buffer sequence. -inline const mutable_buffer* buffer_sequence_begin(const mutable_buffer& b) -{ - return &b; -} - -/// Get an iterator to the first element in a buffer sequence. -inline const const_buffer* buffer_sequence_begin(const const_buffer& b) -{ - return &b; -} - -#if defined(ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION) - -/// Get an iterator to the first element in a buffer sequence. -template -inline auto buffer_sequence_begin(C& c) -> decltype(c.begin()) -{ - return c.begin(); -} - -/// Get an iterator to the first element in a buffer sequence. -template -inline auto buffer_sequence_begin(const C& c) -> decltype(c.begin()) -{ - return c.begin(); -} - -#else // defined(ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION) - -template -inline typename C::iterator buffer_sequence_begin(C& c) -{ - return c.begin(); -} - -template -inline typename C::const_iterator buffer_sequence_begin(const C& c) -{ - return c.begin(); -} - -#endif // defined(ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION) - -/*@}*/ - -/** @defgroup buffer_sequence_end asio::buffer_sequence_end - * - * @brief The asio::buffer_sequence_end function returns an iterator - * pointing to one past the end element in a buffer sequence. - */ -/*@{*/ - -/// Get an iterator to one past the end element in a buffer sequence. -inline const mutable_buffer* buffer_sequence_end(const mutable_buffer& b) -{ - return &b + 1; -} - -/// Get an iterator to one past the end element in a buffer sequence. -inline const const_buffer* buffer_sequence_end(const const_buffer& b) -{ - return &b + 1; -} - -#if defined(ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION) - -/// Get an iterator to one past the end element in a buffer sequence. -template -inline auto buffer_sequence_end(C& c) -> decltype(c.end()) -{ - return c.end(); -} - -/// Get an iterator to one past the end element in a buffer sequence. -template -inline auto buffer_sequence_end(const C& c) -> decltype(c.end()) -{ - return c.end(); -} - -#else // defined(ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION) - -template -inline typename C::iterator buffer_sequence_end(C& c) -{ - return c.end(); -} - -template -inline typename C::const_iterator buffer_sequence_end(const C& c) -{ - return c.end(); -} - -#endif // defined(ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION) - -/*@}*/ - -namespace detail { - -// Tag types used to select appropriately optimised overloads. -struct one_buffer {}; -struct multiple_buffers {}; - -// Helper trait to detect single buffers. -template -struct buffer_sequence_cardinality : - conditional< - is_same::value -#if !defined(ASIO_NO_DEPRECATED) - || is_same::value - || is_same::value -#endif // !defined(ASIO_NO_DEPRECATED) - || is_same::value, - one_buffer, multiple_buffers>::type {}; - -template -inline std::size_t buffer_size(one_buffer, - Iterator begin, Iterator) ASIO_NOEXCEPT -{ - return const_buffer(*begin).size(); -} - -template -inline std::size_t buffer_size(multiple_buffers, - Iterator begin, Iterator end) ASIO_NOEXCEPT -{ - std::size_t total_buffer_size = 0; - - Iterator iter = begin; - for (; iter != end; ++iter) - { - const_buffer b(*iter); - total_buffer_size += b.size(); - } - - return total_buffer_size; -} - -} // namespace detail - -/// Get the total number of bytes in a buffer sequence. -/** - * The @c buffer_size function determines the total size of all buffers in the - * buffer sequence, as if computed as follows: - * - * @code size_t total_size = 0; - * auto i = asio::buffer_sequence_begin(buffers); - * auto end = asio::buffer_sequence_end(buffers); - * for (; i != end; ++i) - * { - * const_buffer b(*i); - * total_size += b.size(); - * } - * return total_size; @endcode - * - * The @c BufferSequence template parameter may meet either of the @c - * ConstBufferSequence or @c MutableBufferSequence type requirements. - */ -template -inline std::size_t buffer_size(const BufferSequence& b) ASIO_NOEXCEPT -{ - return detail::buffer_size( - detail::buffer_sequence_cardinality(), - asio::buffer_sequence_begin(b), - asio::buffer_sequence_end(b)); -} - -#if !defined(ASIO_NO_DEPRECATED) - -/** @defgroup buffer_cast asio::buffer_cast - * - * @brief (Deprecated: Use the @c data() member function.) The - * asio::buffer_cast function is used to obtain a pointer to the - * underlying memory region associated with a buffer. - * - * @par Examples: - * - * To access the memory of a non-modifiable buffer, use: - * @code asio::const_buffer b1 = ...; - * const unsigned char* p1 = asio::buffer_cast(b1); - * @endcode - * - * To access the memory of a modifiable buffer, use: - * @code asio::mutable_buffer b2 = ...; - * unsigned char* p2 = asio::buffer_cast(b2); - * @endcode - * - * The asio::buffer_cast function permits violations of type safety, so - * uses of it in application code should be carefully considered. - */ -/*@{*/ - -/// Cast a non-modifiable buffer to a specified pointer to POD type. -template -inline PointerToPodType buffer_cast(const mutable_buffer& b) ASIO_NOEXCEPT -{ - return static_cast(b.data()); -} - -/// Cast a non-modifiable buffer to a specified pointer to POD type. -template -inline PointerToPodType buffer_cast(const const_buffer& b) ASIO_NOEXCEPT -{ - return static_cast(b.data()); -} - -/*@}*/ - -#endif // !defined(ASIO_NO_DEPRECATED) - -/// Create a new modifiable buffer that is offset from the start of another. -/** - * @relates mutable_buffer - */ -inline mutable_buffer operator+(const mutable_buffer& b, - std::size_t n) ASIO_NOEXCEPT -{ - std::size_t offset = n < b.size() ? n : b.size(); - char* new_data = static_cast(b.data()) + offset; - std::size_t new_size = b.size() - offset; - return mutable_buffer(new_data, new_size -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - , b.get_debug_check() -#endif // ASIO_ENABLE_BUFFER_DEBUGGING - ); -} - -/// Create a new modifiable buffer that is offset from the start of another. -/** - * @relates mutable_buffer - */ -inline mutable_buffer operator+(std::size_t n, - const mutable_buffer& b) ASIO_NOEXCEPT -{ - return b + n; -} - -/// Create a new non-modifiable buffer that is offset from the start of another. -/** - * @relates const_buffer - */ -inline const_buffer operator+(const const_buffer& b, - std::size_t n) ASIO_NOEXCEPT -{ - std::size_t offset = n < b.size() ? n : b.size(); - const char* new_data = static_cast(b.data()) + offset; - std::size_t new_size = b.size() - offset; - return const_buffer(new_data, new_size -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - , b.get_debug_check() -#endif // ASIO_ENABLE_BUFFER_DEBUGGING - ); -} - -/// Create a new non-modifiable buffer that is offset from the start of another. -/** - * @relates const_buffer - */ -inline const_buffer operator+(std::size_t n, - const const_buffer& b) ASIO_NOEXCEPT -{ - return b + n; -} - -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) -namespace detail { - -template -class buffer_debug_check -{ -public: - buffer_debug_check(Iterator iter) - : iter_(iter) - { - } - - ~buffer_debug_check() - { -#if defined(ASIO_MSVC) && (ASIO_MSVC == 1400) - // MSVC 8's string iterator checking may crash in a std::string::iterator - // object's destructor when the iterator points to an already-destroyed - // std::string object, unless the iterator is cleared first. - iter_ = Iterator(); -#endif // defined(ASIO_MSVC) && (ASIO_MSVC == 1400) - } - - void operator()() - { - (void)*iter_; - } - -private: - Iterator iter_; -}; - -} // namespace detail -#endif // ASIO_ENABLE_BUFFER_DEBUGGING - -/** @defgroup buffer asio::buffer - * - * @brief The asio::buffer function is used to create a buffer object to - * represent raw memory, an array of POD elements, a vector of POD elements, - * or a std::string. - * - * A buffer object represents a contiguous region of memory as a 2-tuple - * consisting of a pointer and size in bytes. A tuple of the form {void*, - * size_t} specifies a mutable (modifiable) region of memory. Similarly, a - * tuple of the form {const void*, size_t} specifies a const - * (non-modifiable) region of memory. These two forms correspond to the classes - * mutable_buffer and const_buffer, respectively. To mirror C++'s conversion - * rules, a mutable_buffer is implicitly convertible to a const_buffer, and the - * opposite conversion is not permitted. - * - * The simplest use case involves reading or writing a single buffer of a - * specified size: - * - * @code sock.send(asio::buffer(data, size)); @endcode - * - * In the above example, the return value of asio::buffer meets the - * requirements of the ConstBufferSequence concept so that it may be directly - * passed to the socket's write function. A buffer created for modifiable - * memory also meets the requirements of the MutableBufferSequence concept. - * - * An individual buffer may be created from a builtin array, std::vector, - * std::array or boost::array of POD elements. This helps prevent buffer - * overruns by automatically determining the size of the buffer: - * - * @code char d1[128]; - * size_t bytes_transferred = sock.receive(asio::buffer(d1)); - * - * std::vector d2(128); - * bytes_transferred = sock.receive(asio::buffer(d2)); - * - * std::array d3; - * bytes_transferred = sock.receive(asio::buffer(d3)); - * - * boost::array d4; - * bytes_transferred = sock.receive(asio::buffer(d4)); @endcode - * - * In all three cases above, the buffers created are exactly 128 bytes long. - * Note that a vector is @e never automatically resized when creating or using - * a buffer. The buffer size is determined using the vector's size() - * member function, and not its capacity. - * - * @par Accessing Buffer Contents - * - * The contents of a buffer may be accessed using the @c data() and @c size() - * member functions: - * - * @code asio::mutable_buffer b1 = ...; - * std::size_t s1 = b1.size(); - * unsigned char* p1 = static_cast(b1.data()); - * - * asio::const_buffer b2 = ...; - * std::size_t s2 = b2.size(); - * const void* p2 = b2.data(); @endcode - * - * The @c data() member function permits violations of type safety, so - * uses of it in application code should be carefully considered. - * - * For convenience, a @ref buffer_size function is provided that works with - * both buffers and buffer sequences (that is, types meeting the - * ConstBufferSequence or MutableBufferSequence type requirements). In this - * case, the function returns the total size of all buffers in the sequence. - * - * @par Buffer Copying - * - * The @ref buffer_copy function may be used to copy raw bytes between - * individual buffers and buffer sequences. -* - * In particular, when used with the @ref buffer_size function, the @ref - * buffer_copy function can be used to linearise a sequence of buffers. For - * example: - * - * @code vector buffers = ...; - * - * vector data(asio::buffer_size(buffers)); - * asio::buffer_copy(asio::buffer(data), buffers); @endcode - * - * Note that @ref buffer_copy is implemented in terms of @c memcpy, and - * consequently it cannot be used to copy between overlapping memory regions. - * - * @par Buffer Invalidation - * - * A buffer object does not have any ownership of the memory it refers to. It - * is the responsibility of the application to ensure the memory region remains - * valid until it is no longer required for an I/O operation. When the memory - * is no longer available, the buffer is said to have been invalidated. - * - * For the asio::buffer overloads that accept an argument of type - * std::vector, the buffer objects returned are invalidated by any vector - * operation that also invalidates all references, pointers and iterators - * referring to the elements in the sequence (C++ Std, 23.2.4) - * - * For the asio::buffer overloads that accept an argument of type - * std::basic_string, the buffer objects returned are invalidated according to - * the rules defined for invalidation of references, pointers and iterators - * referring to elements of the sequence (C++ Std, 21.3). - * - * @par Buffer Arithmetic - * - * Buffer objects may be manipulated using simple arithmetic in a safe way - * which helps prevent buffer overruns. Consider an array initialised as - * follows: - * - * @code boost::array a = { 'a', 'b', 'c', 'd', 'e' }; @endcode - * - * A buffer object @c b1 created using: - * - * @code b1 = asio::buffer(a); @endcode - * - * represents the entire array, { 'a', 'b', 'c', 'd', 'e' }. An - * optional second argument to the asio::buffer function may be used to - * limit the size, in bytes, of the buffer: - * - * @code b2 = asio::buffer(a, 3); @endcode - * - * such that @c b2 represents the data { 'a', 'b', 'c' }. Even if the - * size argument exceeds the actual size of the array, the size of the buffer - * object created will be limited to the array size. - * - * An offset may be applied to an existing buffer to create a new one: - * - * @code b3 = b1 + 2; @endcode - * - * where @c b3 will set to represent { 'c', 'd', 'e' }. If the offset - * exceeds the size of the existing buffer, the newly created buffer will be - * empty. - * - * Both an offset and size may be specified to create a buffer that corresponds - * to a specific range of bytes within an existing buffer: - * - * @code b4 = asio::buffer(b1 + 1, 3); @endcode - * - * so that @c b4 will refer to the bytes { 'b', 'c', 'd' }. - * - * @par Buffers and Scatter-Gather I/O - * - * To read or write using multiple buffers (i.e. scatter-gather I/O), multiple - * buffer objects may be assigned into a container that supports the - * MutableBufferSequence (for read) or ConstBufferSequence (for write) concepts: - * - * @code - * char d1[128]; - * std::vector d2(128); - * boost::array d3; - * - * boost::array bufs1 = { - * asio::buffer(d1), - * asio::buffer(d2), - * asio::buffer(d3) }; - * bytes_transferred = sock.receive(bufs1); - * - * std::vector bufs2; - * bufs2.push_back(asio::buffer(d1)); - * bufs2.push_back(asio::buffer(d2)); - * bufs2.push_back(asio::buffer(d3)); - * bytes_transferred = sock.send(bufs2); @endcode - */ -/*@{*/ - -#if defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) -# define ASIO_MUTABLE_BUFFER mutable_buffer -# define ASIO_CONST_BUFFER const_buffer -#else // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) -# define ASIO_MUTABLE_BUFFER mutable_buffers_1 -# define ASIO_CONST_BUFFER const_buffers_1 -#endif // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) - -/// Create a new modifiable buffer from an existing buffer. -/** - * @returns mutable_buffer(b). - */ -inline ASIO_MUTABLE_BUFFER buffer( - const mutable_buffer& b) ASIO_NOEXCEPT -{ - return ASIO_MUTABLE_BUFFER(b); -} - -/// Create a new modifiable buffer from an existing buffer. -/** - * @returns A mutable_buffer value equivalent to: - * @code mutable_buffer( - * b.data(), - * min(b.size(), max_size_in_bytes)); @endcode - */ -inline ASIO_MUTABLE_BUFFER buffer(const mutable_buffer& b, - std::size_t max_size_in_bytes) ASIO_NOEXCEPT -{ - return ASIO_MUTABLE_BUFFER( - mutable_buffer(b.data(), - b.size() < max_size_in_bytes - ? b.size() : max_size_in_bytes -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - , b.get_debug_check() -#endif // ASIO_ENABLE_BUFFER_DEBUGGING - )); -} - -/// Create a new non-modifiable buffer from an existing buffer. -/** - * @returns const_buffer(b). - */ -inline ASIO_CONST_BUFFER buffer( - const const_buffer& b) ASIO_NOEXCEPT -{ - return ASIO_CONST_BUFFER(b); -} - -/// Create a new non-modifiable buffer from an existing buffer. -/** - * @returns A const_buffer value equivalent to: - * @code const_buffer( - * b.data(), - * min(b.size(), max_size_in_bytes)); @endcode - */ -inline ASIO_CONST_BUFFER buffer(const const_buffer& b, - std::size_t max_size_in_bytes) ASIO_NOEXCEPT -{ - return ASIO_CONST_BUFFER(b.data(), - b.size() < max_size_in_bytes - ? b.size() : max_size_in_bytes -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - , b.get_debug_check() -#endif // ASIO_ENABLE_BUFFER_DEBUGGING - ); -} - -/// Create a new modifiable buffer that represents the given memory range. -/** - * @returns mutable_buffer(data, size_in_bytes). - */ -inline ASIO_MUTABLE_BUFFER buffer(void* data, - std::size_t size_in_bytes) ASIO_NOEXCEPT -{ - return ASIO_MUTABLE_BUFFER(data, size_in_bytes); -} - -/// Create a new non-modifiable buffer that represents the given memory range. -/** - * @returns const_buffer(data, size_in_bytes). - */ -inline ASIO_CONST_BUFFER buffer(const void* data, - std::size_t size_in_bytes) ASIO_NOEXCEPT -{ - return ASIO_CONST_BUFFER(data, size_in_bytes); -} - -/// Create a new modifiable buffer that represents the given POD array. -/** - * @returns A mutable_buffer value equivalent to: - * @code mutable_buffer( - * static_cast(data), - * N * sizeof(PodType)); @endcode - */ -template -inline ASIO_MUTABLE_BUFFER buffer(PodType (&data)[N]) ASIO_NOEXCEPT -{ - return ASIO_MUTABLE_BUFFER(data, N * sizeof(PodType)); -} - -/// Create a new modifiable buffer that represents the given POD array. -/** - * @returns A mutable_buffer value equivalent to: - * @code mutable_buffer( - * static_cast(data), - * min(N * sizeof(PodType), max_size_in_bytes)); @endcode - */ -template -inline ASIO_MUTABLE_BUFFER buffer(PodType (&data)[N], - std::size_t max_size_in_bytes) ASIO_NOEXCEPT -{ - return ASIO_MUTABLE_BUFFER(data, - N * sizeof(PodType) < max_size_in_bytes - ? N * sizeof(PodType) : max_size_in_bytes); -} - -/// Create a new non-modifiable buffer that represents the given POD array. -/** - * @returns A const_buffer value equivalent to: - * @code const_buffer( - * static_cast(data), - * N * sizeof(PodType)); @endcode - */ -template -inline ASIO_CONST_BUFFER buffer( - const PodType (&data)[N]) ASIO_NOEXCEPT -{ - return ASIO_CONST_BUFFER(data, N * sizeof(PodType)); -} - -/// Create a new non-modifiable buffer that represents the given POD array. -/** - * @returns A const_buffer value equivalent to: - * @code const_buffer( - * static_cast(data), - * min(N * sizeof(PodType), max_size_in_bytes)); @endcode - */ -template -inline ASIO_CONST_BUFFER buffer(const PodType (&data)[N], - std::size_t max_size_in_bytes) ASIO_NOEXCEPT -{ - return ASIO_CONST_BUFFER(data, - N * sizeof(PodType) < max_size_in_bytes - ? N * sizeof(PodType) : max_size_in_bytes); -} - -#if defined(ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND) - -// Borland C++ and Sun Studio think the overloads: -// -// unspecified buffer(boost::array& array ...); -// -// and -// -// unspecified buffer(boost::array& array ...); -// -// are ambiguous. This will be worked around by using a buffer_types traits -// class that contains typedefs for the appropriate buffer and container -// classes, based on whether PodType is const or non-const. - -namespace detail { - -template -struct buffer_types_base; - -template <> -struct buffer_types_base -{ - typedef mutable_buffer buffer_type; - typedef ASIO_MUTABLE_BUFFER container_type; -}; - -template <> -struct buffer_types_base -{ - typedef const_buffer buffer_type; - typedef ASIO_CONST_BUFFER container_type; -}; - -template -struct buffer_types - : public buffer_types_base::value> -{ -}; - -} // namespace detail - -template -inline typename detail::buffer_types::container_type -buffer(boost::array& data) ASIO_NOEXCEPT -{ - typedef typename asio::detail::buffer_types::buffer_type - buffer_type; - typedef typename asio::detail::buffer_types::container_type - container_type; - return container_type( - buffer_type(data.c_array(), data.size() * sizeof(PodType))); -} - -template -inline typename detail::buffer_types::container_type -buffer(boost::array& data, - std::size_t max_size_in_bytes) ASIO_NOEXCEPT -{ - typedef typename asio::detail::buffer_types::buffer_type - buffer_type; - typedef typename asio::detail::buffer_types::container_type - container_type; - return container_type( - buffer_type(data.c_array(), - data.size() * sizeof(PodType) < max_size_in_bytes - ? data.size() * sizeof(PodType) : max_size_in_bytes)); -} - -#else // defined(ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND) - -/// Create a new modifiable buffer that represents the given POD array. -/** - * @returns A mutable_buffer value equivalent to: - * @code mutable_buffer( - * data.data(), - * data.size() * sizeof(PodType)); @endcode - */ -template -inline ASIO_MUTABLE_BUFFER buffer( - boost::array& data) ASIO_NOEXCEPT -{ - return ASIO_MUTABLE_BUFFER( - data.c_array(), data.size() * sizeof(PodType)); -} - -/// Create a new modifiable buffer that represents the given POD array. -/** - * @returns A mutable_buffer value equivalent to: - * @code mutable_buffer( - * data.data(), - * min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode - */ -template -inline ASIO_MUTABLE_BUFFER buffer(boost::array& data, - std::size_t max_size_in_bytes) ASIO_NOEXCEPT -{ - return ASIO_MUTABLE_BUFFER(data.c_array(), - data.size() * sizeof(PodType) < max_size_in_bytes - ? data.size() * sizeof(PodType) : max_size_in_bytes); -} - -/// Create a new non-modifiable buffer that represents the given POD array. -/** - * @returns A const_buffer value equivalent to: - * @code const_buffer( - * data.data(), - * data.size() * sizeof(PodType)); @endcode - */ -template -inline ASIO_CONST_BUFFER buffer( - boost::array& data) ASIO_NOEXCEPT -{ - return ASIO_CONST_BUFFER(data.data(), data.size() * sizeof(PodType)); -} - -/// Create a new non-modifiable buffer that represents the given POD array. -/** - * @returns A const_buffer value equivalent to: - * @code const_buffer( - * data.data(), - * min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode - */ -template -inline ASIO_CONST_BUFFER buffer(boost::array& data, - std::size_t max_size_in_bytes) ASIO_NOEXCEPT -{ - return ASIO_CONST_BUFFER(data.data(), - data.size() * sizeof(PodType) < max_size_in_bytes - ? data.size() * sizeof(PodType) : max_size_in_bytes); -} - -#endif // defined(ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND) - -/// Create a new non-modifiable buffer that represents the given POD array. -/** - * @returns A const_buffer value equivalent to: - * @code const_buffer( - * data.data(), - * data.size() * sizeof(PodType)); @endcode - */ -template -inline ASIO_CONST_BUFFER buffer( - const boost::array& data) ASIO_NOEXCEPT -{ - return ASIO_CONST_BUFFER(data.data(), data.size() * sizeof(PodType)); -} - -/// Create a new non-modifiable buffer that represents the given POD array. -/** - * @returns A const_buffer value equivalent to: - * @code const_buffer( - * data.data(), - * min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode - */ -template -inline ASIO_CONST_BUFFER buffer(const boost::array& data, - std::size_t max_size_in_bytes) ASIO_NOEXCEPT -{ - return ASIO_CONST_BUFFER(data.data(), - data.size() * sizeof(PodType) < max_size_in_bytes - ? data.size() * sizeof(PodType) : max_size_in_bytes); -} - -#if defined(ASIO_HAS_STD_ARRAY) || defined(GENERATING_DOCUMENTATION) - -/// Create a new modifiable buffer that represents the given POD array. -/** - * @returns A mutable_buffer value equivalent to: - * @code mutable_buffer( - * data.data(), - * data.size() * sizeof(PodType)); @endcode - */ -template -inline ASIO_MUTABLE_BUFFER buffer( - std::array& data) ASIO_NOEXCEPT -{ - return ASIO_MUTABLE_BUFFER(data.data(), data.size() * sizeof(PodType)); -} - -/// Create a new modifiable buffer that represents the given POD array. -/** - * @returns A mutable_buffer value equivalent to: - * @code mutable_buffer( - * data.data(), - * min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode - */ -template -inline ASIO_MUTABLE_BUFFER buffer(std::array& data, - std::size_t max_size_in_bytes) ASIO_NOEXCEPT -{ - return ASIO_MUTABLE_BUFFER(data.data(), - data.size() * sizeof(PodType) < max_size_in_bytes - ? data.size() * sizeof(PodType) : max_size_in_bytes); -} - -/// Create a new non-modifiable buffer that represents the given POD array. -/** - * @returns A const_buffer value equivalent to: - * @code const_buffer( - * data.data(), - * data.size() * sizeof(PodType)); @endcode - */ -template -inline ASIO_CONST_BUFFER buffer( - std::array& data) ASIO_NOEXCEPT -{ - return ASIO_CONST_BUFFER(data.data(), data.size() * sizeof(PodType)); -} - -/// Create a new non-modifiable buffer that represents the given POD array. -/** - * @returns A const_buffer value equivalent to: - * @code const_buffer( - * data.data(), - * min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode - */ -template -inline ASIO_CONST_BUFFER buffer(std::array& data, - std::size_t max_size_in_bytes) ASIO_NOEXCEPT -{ - return ASIO_CONST_BUFFER(data.data(), - data.size() * sizeof(PodType) < max_size_in_bytes - ? data.size() * sizeof(PodType) : max_size_in_bytes); -} - -/// Create a new non-modifiable buffer that represents the given POD array. -/** - * @returns A const_buffer value equivalent to: - * @code const_buffer( - * data.data(), - * data.size() * sizeof(PodType)); @endcode - */ -template -inline ASIO_CONST_BUFFER buffer( - const std::array& data) ASIO_NOEXCEPT -{ - return ASIO_CONST_BUFFER(data.data(), data.size() * sizeof(PodType)); -} - -/// Create a new non-modifiable buffer that represents the given POD array. -/** - * @returns A const_buffer value equivalent to: - * @code const_buffer( - * data.data(), - * min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode - */ -template -inline ASIO_CONST_BUFFER buffer(const std::array& data, - std::size_t max_size_in_bytes) ASIO_NOEXCEPT -{ - return ASIO_CONST_BUFFER(data.data(), - data.size() * sizeof(PodType) < max_size_in_bytes - ? data.size() * sizeof(PodType) : max_size_in_bytes); -} - -#endif // defined(ASIO_HAS_STD_ARRAY) || defined(GENERATING_DOCUMENTATION) - -/// Create a new modifiable buffer that represents the given POD vector. -/** - * @returns A mutable_buffer value equivalent to: - * @code mutable_buffer( - * data.size() ? &data[0] : 0, - * data.size() * sizeof(PodType)); @endcode - * - * @note The buffer is invalidated by any vector operation that would also - * invalidate iterators. - */ -template -inline ASIO_MUTABLE_BUFFER buffer( - std::vector& data) ASIO_NOEXCEPT -{ - return ASIO_MUTABLE_BUFFER( - data.size() ? &data[0] : 0, data.size() * sizeof(PodType) -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - , detail::buffer_debug_check< - typename std::vector::iterator - >(data.begin()) -#endif // ASIO_ENABLE_BUFFER_DEBUGGING - ); -} - -/// Create a new modifiable buffer that represents the given POD vector. -/** - * @returns A mutable_buffer value equivalent to: - * @code mutable_buffer( - * data.size() ? &data[0] : 0, - * min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode - * - * @note The buffer is invalidated by any vector operation that would also - * invalidate iterators. - */ -template -inline ASIO_MUTABLE_BUFFER buffer(std::vector& data, - std::size_t max_size_in_bytes) ASIO_NOEXCEPT -{ - return ASIO_MUTABLE_BUFFER(data.size() ? &data[0] : 0, - data.size() * sizeof(PodType) < max_size_in_bytes - ? data.size() * sizeof(PodType) : max_size_in_bytes -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - , detail::buffer_debug_check< - typename std::vector::iterator - >(data.begin()) -#endif // ASIO_ENABLE_BUFFER_DEBUGGING - ); -} - -/// Create a new non-modifiable buffer that represents the given POD vector. -/** - * @returns A const_buffer value equivalent to: - * @code const_buffer( - * data.size() ? &data[0] : 0, - * data.size() * sizeof(PodType)); @endcode - * - * @note The buffer is invalidated by any vector operation that would also - * invalidate iterators. - */ -template -inline ASIO_CONST_BUFFER buffer( - const std::vector& data) ASIO_NOEXCEPT -{ - return ASIO_CONST_BUFFER( - data.size() ? &data[0] : 0, data.size() * sizeof(PodType) -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - , detail::buffer_debug_check< - typename std::vector::const_iterator - >(data.begin()) -#endif // ASIO_ENABLE_BUFFER_DEBUGGING - ); -} - -/// Create a new non-modifiable buffer that represents the given POD vector. -/** - * @returns A const_buffer value equivalent to: - * @code const_buffer( - * data.size() ? &data[0] : 0, - * min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode - * - * @note The buffer is invalidated by any vector operation that would also - * invalidate iterators. - */ -template -inline ASIO_CONST_BUFFER buffer( - const std::vector& data, - std::size_t max_size_in_bytes) ASIO_NOEXCEPT -{ - return ASIO_CONST_BUFFER(data.size() ? &data[0] : 0, - data.size() * sizeof(PodType) < max_size_in_bytes - ? data.size() * sizeof(PodType) : max_size_in_bytes -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - , detail::buffer_debug_check< - typename std::vector::const_iterator - >(data.begin()) -#endif // ASIO_ENABLE_BUFFER_DEBUGGING - ); -} - -/// Create a new modifiable buffer that represents the given string. -/** - * @returns mutable_buffer(data.size() ? &data[0] : 0, - * data.size() * sizeof(Elem)). - * - * @note The buffer is invalidated by any non-const operation called on the - * given string object. - */ -template -inline ASIO_MUTABLE_BUFFER buffer( - std::basic_string& data) ASIO_NOEXCEPT -{ - return ASIO_MUTABLE_BUFFER(data.size() ? &data[0] : 0, - data.size() * sizeof(Elem) -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - , detail::buffer_debug_check< - typename std::basic_string::iterator - >(data.begin()) -#endif // ASIO_ENABLE_BUFFER_DEBUGGING - ); -} - -/// Create a new non-modifiable buffer that represents the given string. -/** - * @returns A mutable_buffer value equivalent to: - * @code mutable_buffer( - * data.size() ? &data[0] : 0, - * min(data.size() * sizeof(Elem), max_size_in_bytes)); @endcode - * - * @note The buffer is invalidated by any non-const operation called on the - * given string object. - */ -template -inline ASIO_MUTABLE_BUFFER buffer( - std::basic_string& data, - std::size_t max_size_in_bytes) ASIO_NOEXCEPT -{ - return ASIO_MUTABLE_BUFFER(data.size() ? &data[0] : 0, - data.size() * sizeof(Elem) < max_size_in_bytes - ? data.size() * sizeof(Elem) : max_size_in_bytes -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - , detail::buffer_debug_check< - typename std::basic_string::iterator - >(data.begin()) -#endif // ASIO_ENABLE_BUFFER_DEBUGGING - ); -} - -/// Create a new non-modifiable buffer that represents the given string. -/** - * @returns const_buffer(data.data(), data.size() * sizeof(Elem)). - * - * @note The buffer is invalidated by any non-const operation called on the - * given string object. - */ -template -inline ASIO_CONST_BUFFER buffer( - const std::basic_string& data) ASIO_NOEXCEPT -{ - return ASIO_CONST_BUFFER(data.data(), data.size() * sizeof(Elem) -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - , detail::buffer_debug_check< - typename std::basic_string::const_iterator - >(data.begin()) -#endif // ASIO_ENABLE_BUFFER_DEBUGGING - ); -} - -/// Create a new non-modifiable buffer that represents the given string. -/** - * @returns A const_buffer value equivalent to: - * @code const_buffer( - * data.data(), - * min(data.size() * sizeof(Elem), max_size_in_bytes)); @endcode - * - * @note The buffer is invalidated by any non-const operation called on the - * given string object. - */ -template -inline ASIO_CONST_BUFFER buffer( - const std::basic_string& data, - std::size_t max_size_in_bytes) ASIO_NOEXCEPT -{ - return ASIO_CONST_BUFFER(data.data(), - data.size() * sizeof(Elem) < max_size_in_bytes - ? data.size() * sizeof(Elem) : max_size_in_bytes -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - , detail::buffer_debug_check< - typename std::basic_string::const_iterator - >(data.begin()) -#endif // ASIO_ENABLE_BUFFER_DEBUGGING - ); -} - -#if defined(ASIO_HAS_STRING_VIEW) \ - || defined(GENERATING_DOCUMENTATION) - -/// Create a new modifiable buffer that represents the given string_view. -/** - * @returns mutable_buffer(data.size() ? &data[0] : 0, - * data.size() * sizeof(Elem)). - */ -template -inline ASIO_CONST_BUFFER buffer( - basic_string_view data) ASIO_NOEXCEPT -{ - return ASIO_CONST_BUFFER(data.size() ? &data[0] : 0, - data.size() * sizeof(Elem) -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - , detail::buffer_debug_check< - typename basic_string_view::iterator - >(data.begin()) -#endif // ASIO_ENABLE_BUFFER_DEBUGGING - ); -} - -/// Create a new non-modifiable buffer that represents the given string. -/** - * @returns A mutable_buffer value equivalent to: - * @code mutable_buffer( - * data.size() ? &data[0] : 0, - * min(data.size() * sizeof(Elem), max_size_in_bytes)); @endcode - */ -template -inline ASIO_CONST_BUFFER buffer( - basic_string_view data, - std::size_t max_size_in_bytes) ASIO_NOEXCEPT -{ - return ASIO_CONST_BUFFER(data.size() ? &data[0] : 0, - data.size() * sizeof(Elem) < max_size_in_bytes - ? data.size() * sizeof(Elem) : max_size_in_bytes -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - , detail::buffer_debug_check< - typename basic_string_view::iterator - >(data.begin()) -#endif // ASIO_ENABLE_BUFFER_DEBUGGING - ); -} - -#endif // defined(ASIO_HAS_STRING_VIEW) - // || defined(GENERATING_DOCUMENTATION) - -/*@}*/ - -/// Adapt a basic_string to the DynamicBuffer requirements. -/** - * Requires that sizeof(Elem) == 1. - */ -template -class dynamic_string_buffer -{ -public: - /// The type used to represent the input sequence as a list of buffers. - typedef ASIO_CONST_BUFFER const_buffers_type; - - /// The type used to represent the output sequence as a list of buffers. - typedef ASIO_MUTABLE_BUFFER mutable_buffers_type; - - /// Construct a dynamic buffer from a string. - /** - * @param s The string to be used as backing storage for the dynamic buffer. - * Any existing data in the string is treated as the dynamic buffer's input - * sequence. The object stores a reference to the string and the user is - * responsible for ensuring that the string object remains valid until the - * dynamic_string_buffer object is destroyed. - * - * @param maximum_size Specifies a maximum size for the buffer, in bytes. - */ - explicit dynamic_string_buffer(std::basic_string& s, - std::size_t maximum_size = - (std::numeric_limits::max)()) ASIO_NOEXCEPT - : string_(s), - size_(string_.size()), - max_size_(maximum_size) - { - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move construct a dynamic buffer. - dynamic_string_buffer(dynamic_string_buffer&& other) ASIO_NOEXCEPT - : string_(other.string_), - size_(other.size_), - max_size_(other.max_size_) - { - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Get the size of the input sequence. - std::size_t size() const ASIO_NOEXCEPT - { - return size_; - } - - /// Get the maximum size of the dynamic buffer. - /** - * @returns The allowed maximum of the sum of the sizes of the input sequence - * and output sequence. - */ - std::size_t max_size() const ASIO_NOEXCEPT - { - return max_size_; - } - - /// Get the current capacity of the dynamic buffer. - /** - * @returns The current total capacity of the buffer, i.e. for both the input - * sequence and output sequence. - */ - std::size_t capacity() const ASIO_NOEXCEPT - { - return string_.capacity(); - } - - /// Get a list of buffers that represents the input sequence. - /** - * @returns An object of type @c const_buffers_type that satisfies - * ConstBufferSequence requirements, representing the basic_string memory in - * input sequence. - * - * @note The returned object is invalidated by any @c dynamic_string_buffer - * or @c basic_string member function that modifies the input sequence or - * output sequence. - */ - const_buffers_type data() const ASIO_NOEXCEPT - { - return const_buffers_type(asio::buffer(string_, size_)); - } - - /// Get a list of buffers that represents the output sequence, with the given - /// size. - /** - * Ensures that the output sequence can accommodate @c n bytes, resizing the - * basic_string object as necessary. - * - * @returns An object of type @c mutable_buffers_type that satisfies - * MutableBufferSequence requirements, representing basic_string memory - * at the start of the output sequence of size @c n. - * - * @throws std::length_error If size() + n > max_size(). - * - * @note The returned object is invalidated by any @c dynamic_string_buffer - * or @c basic_string member function that modifies the input sequence or - * output sequence. - */ - mutable_buffers_type prepare(std::size_t n) - { - if (size () > max_size() || max_size() - size() < n) - { - std::length_error ex("dynamic_string_buffer too long"); - asio::detail::throw_exception(ex); - } - - string_.resize(size_ + n); - - return asio::buffer(asio::buffer(string_) + size_, n); - } - - /// Move bytes from the output sequence to the input sequence. - /** - * @param n The number of bytes to append from the start of the output - * sequence to the end of the input sequence. The remainder of the output - * sequence is discarded. - * - * Requires a preceding call prepare(x) where x >= n, and - * no intervening operations that modify the input or output sequence. - * - * @note If @c n is greater than the size of the output sequence, the entire - * output sequence is moved to the input sequence and no error is issued. - */ - void commit(std::size_t n) - { - size_ += (std::min)(n, string_.size() - size_); - string_.resize(size_); - } - - /// Remove characters from the input sequence. - /** - * Removes @c n characters from the beginning of the input sequence. - * - * @note If @c n is greater than the size of the input sequence, the entire - * input sequence is consumed and no error is issued. - */ - void consume(std::size_t n) - { - std::size_t consume_length = (std::min)(n, size_); - string_.erase(0, consume_length); - size_ -= consume_length; - } - -private: - std::basic_string& string_; - std::size_t size_; - const std::size_t max_size_; -}; - -/// Adapt a vector to the DynamicBuffer requirements. -/** - * Requires that sizeof(Elem) == 1. - */ -template -class dynamic_vector_buffer -{ -public: - /// The type used to represent the input sequence as a list of buffers. - typedef ASIO_CONST_BUFFER const_buffers_type; - - /// The type used to represent the output sequence as a list of buffers. - typedef ASIO_MUTABLE_BUFFER mutable_buffers_type; - - /// Construct a dynamic buffer from a string. - /** - * @param v The vector to be used as backing storage for the dynamic buffer. - * Any existing data in the vector is treated as the dynamic buffer's input - * sequence. The object stores a reference to the vector and the user is - * responsible for ensuring that the vector object remains valid until the - * dynamic_vector_buffer object is destroyed. - * - * @param maximum_size Specifies a maximum size for the buffer, in bytes. - */ - explicit dynamic_vector_buffer(std::vector& v, - std::size_t maximum_size = - (std::numeric_limits::max)()) ASIO_NOEXCEPT - : vector_(v), - size_(vector_.size()), - max_size_(maximum_size) - { - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move construct a dynamic buffer. - dynamic_vector_buffer(dynamic_vector_buffer&& other) ASIO_NOEXCEPT - : vector_(other.vector_), - size_(other.size_), - max_size_(other.max_size_) - { - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Get the size of the input sequence. - std::size_t size() const ASIO_NOEXCEPT - { - return size_; - } - - /// Get the maximum size of the dynamic buffer. - /** - * @returns The allowed maximum of the sum of the sizes of the input sequence - * and output sequence. - */ - std::size_t max_size() const ASIO_NOEXCEPT - { - return max_size_; - } - - /// Get the current capacity of the dynamic buffer. - /** - * @returns The current total capacity of the buffer, i.e. for both the input - * sequence and output sequence. - */ - std::size_t capacity() const ASIO_NOEXCEPT - { - return vector_.capacity(); - } - - /// Get a list of buffers that represents the input sequence. - /** - * @returns An object of type @c const_buffers_type that satisfies - * ConstBufferSequence requirements, representing the basic_string memory in - * input sequence. - * - * @note The returned object is invalidated by any @c dynamic_vector_buffer - * or @c basic_string member function that modifies the input sequence or - * output sequence. - */ - const_buffers_type data() const ASIO_NOEXCEPT - { - return const_buffers_type(asio::buffer(vector_, size_)); - } - - /// Get a list of buffers that represents the output sequence, with the given - /// size. - /** - * Ensures that the output sequence can accommodate @c n bytes, resizing the - * basic_string object as necessary. - * - * @returns An object of type @c mutable_buffers_type that satisfies - * MutableBufferSequence requirements, representing basic_string memory - * at the start of the output sequence of size @c n. - * - * @throws std::length_error If size() + n > max_size(). - * - * @note The returned object is invalidated by any @c dynamic_vector_buffer - * or @c basic_string member function that modifies the input sequence or - * output sequence. - */ - mutable_buffers_type prepare(std::size_t n) - { - if (size () > max_size() || max_size() - size() < n) - { - std::length_error ex("dynamic_vector_buffer too long"); - asio::detail::throw_exception(ex); - } - - vector_.resize(size_ + n); - - return asio::buffer(asio::buffer(vector_) + size_, n); - } - - /// Move bytes from the output sequence to the input sequence. - /** - * @param n The number of bytes to append from the start of the output - * sequence to the end of the input sequence. The remainder of the output - * sequence is discarded. - * - * Requires a preceding call prepare(x) where x >= n, and - * no intervening operations that modify the input or output sequence. - * - * @note If @c n is greater than the size of the output sequence, the entire - * output sequence is moved to the input sequence and no error is issued. - */ - void commit(std::size_t n) - { - size_ += (std::min)(n, vector_.size() - size_); - vector_.resize(size_); - } - - /// Remove characters from the input sequence. - /** - * Removes @c n characters from the beginning of the input sequence. - * - * @note If @c n is greater than the size of the input sequence, the entire - * input sequence is consumed and no error is issued. - */ - void consume(std::size_t n) - { - std::size_t consume_length = (std::min)(n, size_); - vector_.erase(vector_.begin(), vector_.begin() + consume_length); - size_ -= consume_length; - } - -private: - std::vector& vector_; - std::size_t size_; - const std::size_t max_size_; -}; - -/** @defgroup dynamic_buffer asio::dynamic_buffer - * - * @brief The asio::dynamic_buffer function is used to create a - * dynamically resized buffer from a @c std::basic_string or @c std::vector. - */ -/*@{*/ - -/// Create a new dynamic buffer that represents the given string. -/** - * @returns dynamic_string_buffer(data). - */ -template -inline dynamic_string_buffer dynamic_buffer( - std::basic_string& data) ASIO_NOEXCEPT -{ - return dynamic_string_buffer(data); -} - -/// Create a new dynamic buffer that represents the given string. -/** - * @returns dynamic_string_buffer(data, - * max_size). - */ -template -inline dynamic_string_buffer dynamic_buffer( - std::basic_string& data, - std::size_t max_size) ASIO_NOEXCEPT -{ - return dynamic_string_buffer(data, max_size); -} - -/// Create a new dynamic buffer that represents the given vector. -/** - * @returns dynamic_vector_buffer(data). - */ -template -inline dynamic_vector_buffer dynamic_buffer( - std::vector& data) ASIO_NOEXCEPT -{ - return dynamic_vector_buffer(data); -} - -/// Create a new dynamic buffer that represents the given vector. -/** - * @returns dynamic_vector_buffer(data, max_size). - */ -template -inline dynamic_vector_buffer dynamic_buffer( - std::vector& data, - std::size_t max_size) ASIO_NOEXCEPT -{ - return dynamic_vector_buffer(data, max_size); -} - -/*@}*/ - -/** @defgroup buffer_copy asio::buffer_copy - * - * @brief The asio::buffer_copy function is used to copy bytes from a - * source buffer (or buffer sequence) to a target buffer (or buffer sequence). - * - * The @c buffer_copy function is available in two forms: - * - * @li A 2-argument form: @c buffer_copy(target, source) - * - * @li A 3-argument form: @c buffer_copy(target, source, max_bytes_to_copy) - * - * Both forms return the number of bytes actually copied. The number of bytes - * copied is the lesser of: - * - * @li @c buffer_size(target) - * - * @li @c buffer_size(source) - * - * @li @c If specified, @c max_bytes_to_copy. - * - * This prevents buffer overflow, regardless of the buffer sizes used in the - * copy operation. - * - * Note that @ref buffer_copy is implemented in terms of @c memcpy, and - * consequently it cannot be used to copy between overlapping memory regions. - */ -/*@{*/ - -namespace detail { - -inline std::size_t buffer_copy_1(const mutable_buffer& target, - const const_buffer& source) -{ - using namespace std; // For memcpy. - std::size_t target_size = target.size(); - std::size_t source_size = source.size(); - std::size_t n = target_size < source_size ? target_size : source_size; - if (n > 0) - memcpy(target.data(), source.data(), n); - return n; -} - -template -inline std::size_t buffer_copy(one_buffer, one_buffer, - TargetIterator target_begin, TargetIterator, - SourceIterator source_begin, SourceIterator) ASIO_NOEXCEPT -{ - return (buffer_copy_1)(*target_begin, *source_begin); -} - -template -inline std::size_t buffer_copy(one_buffer, one_buffer, - TargetIterator target_begin, TargetIterator, - SourceIterator source_begin, SourceIterator, - std::size_t max_bytes_to_copy) ASIO_NOEXCEPT -{ - return (buffer_copy_1)(*target_begin, - asio::buffer(*source_begin, max_bytes_to_copy)); -} - -template -std::size_t buffer_copy(one_buffer, multiple_buffers, - TargetIterator target_begin, TargetIterator, - SourceIterator source_begin, SourceIterator source_end, - std::size_t max_bytes_to_copy - = (std::numeric_limits::max)()) ASIO_NOEXCEPT -{ - std::size_t total_bytes_copied = 0; - SourceIterator source_iter = source_begin; - - for (mutable_buffer target_buffer( - asio::buffer(*target_begin, max_bytes_to_copy)); - target_buffer.size() && source_iter != source_end; ++source_iter) - { - const_buffer source_buffer(*source_iter); - std::size_t bytes_copied = (buffer_copy_1)(target_buffer, source_buffer); - total_bytes_copied += bytes_copied; - target_buffer += bytes_copied; - } - - return total_bytes_copied; -} - -template -std::size_t buffer_copy(multiple_buffers, one_buffer, - TargetIterator target_begin, TargetIterator target_end, - SourceIterator source_begin, SourceIterator, - std::size_t max_bytes_to_copy - = (std::numeric_limits::max)()) ASIO_NOEXCEPT -{ - std::size_t total_bytes_copied = 0; - TargetIterator target_iter = target_begin; - - for (const_buffer source_buffer( - asio::buffer(*source_begin, max_bytes_to_copy)); - source_buffer.size() && target_iter != target_end; ++target_iter) - { - mutable_buffer target_buffer(*target_iter); - std::size_t bytes_copied = (buffer_copy_1)(target_buffer, source_buffer); - total_bytes_copied += bytes_copied; - source_buffer += bytes_copied; - } - - return total_bytes_copied; -} - -template -std::size_t buffer_copy(multiple_buffers, multiple_buffers, - TargetIterator target_begin, TargetIterator target_end, - SourceIterator source_begin, SourceIterator source_end) ASIO_NOEXCEPT -{ - std::size_t total_bytes_copied = 0; - - TargetIterator target_iter = target_begin; - std::size_t target_buffer_offset = 0; - - SourceIterator source_iter = source_begin; - std::size_t source_buffer_offset = 0; - - while (target_iter != target_end && source_iter != source_end) - { - mutable_buffer target_buffer = - mutable_buffer(*target_iter) + target_buffer_offset; - - const_buffer source_buffer = - const_buffer(*source_iter) + source_buffer_offset; - - std::size_t bytes_copied = (buffer_copy_1)(target_buffer, source_buffer); - total_bytes_copied += bytes_copied; - - if (bytes_copied == target_buffer.size()) - { - ++target_iter; - target_buffer_offset = 0; - } - else - target_buffer_offset += bytes_copied; - - if (bytes_copied == source_buffer.size()) - { - ++source_iter; - source_buffer_offset = 0; - } - else - source_buffer_offset += bytes_copied; - } - - return total_bytes_copied; -} - -template -std::size_t buffer_copy(multiple_buffers, multiple_buffers, - TargetIterator target_begin, TargetIterator target_end, - SourceIterator source_begin, SourceIterator source_end, - std::size_t max_bytes_to_copy) ASIO_NOEXCEPT -{ - std::size_t total_bytes_copied = 0; - - TargetIterator target_iter = target_begin; - std::size_t target_buffer_offset = 0; - - SourceIterator source_iter = source_begin; - std::size_t source_buffer_offset = 0; - - while (total_bytes_copied != max_bytes_to_copy - && target_iter != target_end && source_iter != source_end) - { - mutable_buffer target_buffer = - mutable_buffer(*target_iter) + target_buffer_offset; - - const_buffer source_buffer = - const_buffer(*source_iter) + source_buffer_offset; - - std::size_t bytes_copied = (buffer_copy_1)( - target_buffer, asio::buffer(source_buffer, - max_bytes_to_copy - total_bytes_copied)); - total_bytes_copied += bytes_copied; - - if (bytes_copied == target_buffer.size()) - { - ++target_iter; - target_buffer_offset = 0; - } - else - target_buffer_offset += bytes_copied; - - if (bytes_copied == source_buffer.size()) - { - ++source_iter; - source_buffer_offset = 0; - } - else - source_buffer_offset += bytes_copied; - } - - return total_bytes_copied; -} - -} // namespace detail - -/// Copies bytes from a source buffer sequence to a target buffer sequence. -/** - * @param target A modifiable buffer sequence representing the memory regions to - * which the bytes will be copied. - * - * @param source A non-modifiable buffer sequence representing the memory - * regions from which the bytes will be copied. - * - * @returns The number of bytes copied. - * - * @note The number of bytes copied is the lesser of: - * - * @li @c buffer_size(target) - * - * @li @c buffer_size(source) - * - * This function is implemented in terms of @c memcpy, and consequently it - * cannot be used to copy between overlapping memory regions. - */ -template -inline std::size_t buffer_copy(const MutableBufferSequence& target, - const ConstBufferSequence& source) ASIO_NOEXCEPT -{ - return detail::buffer_copy( - detail::buffer_sequence_cardinality(), - detail::buffer_sequence_cardinality(), - asio::buffer_sequence_begin(target), - asio::buffer_sequence_end(target), - asio::buffer_sequence_begin(source), - asio::buffer_sequence_end(source)); -} - -/// Copies a limited number of bytes from a source buffer sequence to a target -/// buffer sequence. -/** - * @param target A modifiable buffer sequence representing the memory regions to - * which the bytes will be copied. - * - * @param source A non-modifiable buffer sequence representing the memory - * regions from which the bytes will be copied. - * - * @param max_bytes_to_copy The maximum number of bytes to be copied. - * - * @returns The number of bytes copied. - * - * @note The number of bytes copied is the lesser of: - * - * @li @c buffer_size(target) - * - * @li @c buffer_size(source) - * - * @li @c max_bytes_to_copy - * - * This function is implemented in terms of @c memcpy, and consequently it - * cannot be used to copy between overlapping memory regions. - */ -template -inline std::size_t buffer_copy(const MutableBufferSequence& target, - const ConstBufferSequence& source, - std::size_t max_bytes_to_copy) ASIO_NOEXCEPT -{ - return detail::buffer_copy( - detail::buffer_sequence_cardinality(), - detail::buffer_sequence_cardinality(), - asio::buffer_sequence_begin(target), - asio::buffer_sequence_end(target), - asio::buffer_sequence_begin(source), - asio::buffer_sequence_end(source), max_bytes_to_copy); -} - -/*@}*/ - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_BUFFER_HPP diff --git a/tools/sdk/include/asio/asio/buffered_read_stream.hpp b/tools/sdk/include/asio/asio/buffered_read_stream.hpp deleted file mode 100644 index c3e7f0b57e2..00000000000 --- a/tools/sdk/include/asio/asio/buffered_read_stream.hpp +++ /dev/null @@ -1,257 +0,0 @@ -// -// buffered_read_stream.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_BUFFERED_READ_STREAM_HPP -#define ASIO_BUFFERED_READ_STREAM_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/async_result.hpp" -#include "asio/buffered_read_stream_fwd.hpp" -#include "asio/buffer.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffer_resize_guard.hpp" -#include "asio/detail/buffered_stream_storage.hpp" -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Adds buffering to the read-related operations of a stream. -/** - * The buffered_read_stream class template can be used to add buffering to the - * synchronous and asynchronous read operations of a stream. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - * - * @par Concepts: - * AsyncReadStream, AsyncWriteStream, Stream, SyncReadStream, SyncWriteStream. - */ -template -class buffered_read_stream - : private noncopyable -{ -public: - /// The type of the next layer. - typedef typename remove_reference::type next_layer_type; - - /// The type of the lowest layer. - typedef typename next_layer_type::lowest_layer_type lowest_layer_type; - - /// The type of the executor associated with the object. - typedef typename lowest_layer_type::executor_type executor_type; - -#if defined(GENERATING_DOCUMENTATION) - /// The default buffer size. - static const std::size_t default_buffer_size = implementation_defined; -#else - ASIO_STATIC_CONSTANT(std::size_t, default_buffer_size = 1024); -#endif - - /// Construct, passing the specified argument to initialise the next layer. - template - explicit buffered_read_stream(Arg& a) - : next_layer_(a), - storage_(default_buffer_size) - { - } - - /// Construct, passing the specified argument to initialise the next layer. - template - buffered_read_stream(Arg& a, std::size_t buffer_size) - : next_layer_(a), - storage_(buffer_size) - { - } - - /// Get a reference to the next layer. - next_layer_type& next_layer() - { - return next_layer_; - } - - /// Get a reference to the lowest layer. - lowest_layer_type& lowest_layer() - { - return next_layer_.lowest_layer(); - } - - /// Get a const reference to the lowest layer. - const lowest_layer_type& lowest_layer() const - { - return next_layer_.lowest_layer(); - } - - /// Get the executor associated with the object. - executor_type get_executor() ASIO_NOEXCEPT - { - return next_layer_.lowest_layer().get_executor(); - } - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - asio::io_context& get_io_context() - { - return next_layer_.get_io_context(); - } - - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - asio::io_context& get_io_service() - { - return next_layer_.get_io_service(); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Close the stream. - void close() - { - next_layer_.close(); - } - - /// Close the stream. - ASIO_SYNC_OP_VOID close(asio::error_code& ec) - { - next_layer_.close(ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Write the given data to the stream. Returns the number of bytes written. - /// Throws an exception on failure. - template - std::size_t write_some(const ConstBufferSequence& buffers) - { - return next_layer_.write_some(buffers); - } - - /// Write the given data to the stream. Returns the number of bytes written, - /// or 0 if an error occurred. - template - std::size_t write_some(const ConstBufferSequence& buffers, - asio::error_code& ec) - { - return next_layer_.write_some(buffers, ec); - } - - /// Start an asynchronous write. The data being written must be valid for the - /// lifetime of the asynchronous operation. - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_write_some(const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler) - { - return next_layer_.async_write_some(buffers, - ASIO_MOVE_CAST(WriteHandler)(handler)); - } - - /// Fill the buffer with some data. Returns the number of bytes placed in the - /// buffer as a result of the operation. Throws an exception on failure. - std::size_t fill(); - - /// Fill the buffer with some data. Returns the number of bytes placed in the - /// buffer as a result of the operation, or 0 if an error occurred. - std::size_t fill(asio::error_code& ec); - - /// Start an asynchronous fill. - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_fill(ASIO_MOVE_ARG(ReadHandler) handler); - - /// Read some data from the stream. Returns the number of bytes read. Throws - /// an exception on failure. - template - std::size_t read_some(const MutableBufferSequence& buffers); - - /// Read some data from the stream. Returns the number of bytes read or 0 if - /// an error occurred. - template - std::size_t read_some(const MutableBufferSequence& buffers, - asio::error_code& ec); - - /// Start an asynchronous read. The buffer into which the data will be read - /// must be valid for the lifetime of the asynchronous operation. - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_read_some(const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler); - - /// Peek at the incoming data on the stream. Returns the number of bytes read. - /// Throws an exception on failure. - template - std::size_t peek(const MutableBufferSequence& buffers); - - /// Peek at the incoming data on the stream. Returns the number of bytes read, - /// or 0 if an error occurred. - template - std::size_t peek(const MutableBufferSequence& buffers, - asio::error_code& ec); - - /// Determine the amount of data that may be read without blocking. - std::size_t in_avail() - { - return storage_.size(); - } - - /// Determine the amount of data that may be read without blocking. - std::size_t in_avail(asio::error_code& ec) - { - ec = asio::error_code(); - return storage_.size(); - } - -private: - /// Copy data out of the internal buffer to the specified target buffer. - /// Returns the number of bytes copied. - template - std::size_t copy(const MutableBufferSequence& buffers) - { - std::size_t bytes_copied = asio::buffer_copy( - buffers, storage_.data(), storage_.size()); - storage_.consume(bytes_copied); - return bytes_copied; - } - - /// Copy data from the internal buffer to the specified target buffer, without - /// removing the data from the internal buffer. Returns the number of bytes - /// copied. - template - std::size_t peek_copy(const MutableBufferSequence& buffers) - { - return asio::buffer_copy(buffers, storage_.data(), storage_.size()); - } - - /// The next layer. - Stream next_layer_; - - // The data in the buffer. - detail::buffered_stream_storage storage_; -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/impl/buffered_read_stream.hpp" - -#endif // ASIO_BUFFERED_READ_STREAM_HPP diff --git a/tools/sdk/include/asio/asio/buffered_read_stream_fwd.hpp b/tools/sdk/include/asio/asio/buffered_read_stream_fwd.hpp deleted file mode 100644 index 334b88a5c0a..00000000000 --- a/tools/sdk/include/asio/asio/buffered_read_stream_fwd.hpp +++ /dev/null @@ -1,25 +0,0 @@ -// -// buffered_read_stream_fwd.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_BUFFERED_READ_STREAM_FWD_HPP -#define ASIO_BUFFERED_READ_STREAM_FWD_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -namespace asio { - -template -class buffered_read_stream; - -} // namespace asio - -#endif // ASIO_BUFFERED_READ_STREAM_FWD_HPP diff --git a/tools/sdk/include/asio/asio/buffered_stream.hpp b/tools/sdk/include/asio/asio/buffered_stream.hpp deleted file mode 100644 index 8014fa4dd94..00000000000 --- a/tools/sdk/include/asio/asio/buffered_stream.hpp +++ /dev/null @@ -1,278 +0,0 @@ -// -// buffered_stream.hpp -// ~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_BUFFERED_STREAM_HPP -#define ASIO_BUFFERED_STREAM_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/async_result.hpp" -#include "asio/buffered_read_stream.hpp" -#include "asio/buffered_write_stream.hpp" -#include "asio/buffered_stream_fwd.hpp" -#include "asio/detail/noncopyable.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Adds buffering to the read- and write-related operations of a stream. -/** - * The buffered_stream class template can be used to add buffering to the - * synchronous and asynchronous read and write operations of a stream. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - * - * @par Concepts: - * AsyncReadStream, AsyncWriteStream, Stream, SyncReadStream, SyncWriteStream. - */ -template -class buffered_stream - : private noncopyable -{ -public: - /// The type of the next layer. - typedef typename remove_reference::type next_layer_type; - - /// The type of the lowest layer. - typedef typename next_layer_type::lowest_layer_type lowest_layer_type; - - /// The type of the executor associated with the object. - typedef typename lowest_layer_type::executor_type executor_type; - - /// Construct, passing the specified argument to initialise the next layer. - template - explicit buffered_stream(Arg& a) - : inner_stream_impl_(a), - stream_impl_(inner_stream_impl_) - { - } - - /// Construct, passing the specified argument to initialise the next layer. - template - explicit buffered_stream(Arg& a, std::size_t read_buffer_size, - std::size_t write_buffer_size) - : inner_stream_impl_(a, write_buffer_size), - stream_impl_(inner_stream_impl_, read_buffer_size) - { - } - - /// Get a reference to the next layer. - next_layer_type& next_layer() - { - return stream_impl_.next_layer().next_layer(); - } - - /// Get a reference to the lowest layer. - lowest_layer_type& lowest_layer() - { - return stream_impl_.lowest_layer(); - } - - /// Get a const reference to the lowest layer. - const lowest_layer_type& lowest_layer() const - { - return stream_impl_.lowest_layer(); - } - - /// Get the executor associated with the object. - executor_type get_executor() ASIO_NOEXCEPT - { - return stream_impl_.lowest_layer().get_executor(); - } - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - asio::io_context& get_io_context() - { - return stream_impl_.get_io_context(); - } - - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - asio::io_context& get_io_service() - { - return stream_impl_.get_io_service(); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Close the stream. - void close() - { - stream_impl_.close(); - } - - /// Close the stream. - ASIO_SYNC_OP_VOID close(asio::error_code& ec) - { - stream_impl_.close(ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Flush all data from the buffer to the next layer. Returns the number of - /// bytes written to the next layer on the last write operation. Throws an - /// exception on failure. - std::size_t flush() - { - return stream_impl_.next_layer().flush(); - } - - /// Flush all data from the buffer to the next layer. Returns the number of - /// bytes written to the next layer on the last write operation, or 0 if an - /// error occurred. - std::size_t flush(asio::error_code& ec) - { - return stream_impl_.next_layer().flush(ec); - } - - /// Start an asynchronous flush. - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_flush(ASIO_MOVE_ARG(WriteHandler) handler) - { - return stream_impl_.next_layer().async_flush( - ASIO_MOVE_CAST(WriteHandler)(handler)); - } - - /// Write the given data to the stream. Returns the number of bytes written. - /// Throws an exception on failure. - template - std::size_t write_some(const ConstBufferSequence& buffers) - { - return stream_impl_.write_some(buffers); - } - - /// Write the given data to the stream. Returns the number of bytes written, - /// or 0 if an error occurred. - template - std::size_t write_some(const ConstBufferSequence& buffers, - asio::error_code& ec) - { - return stream_impl_.write_some(buffers, ec); - } - - /// Start an asynchronous write. The data being written must be valid for the - /// lifetime of the asynchronous operation. - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_write_some(const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler) - { - return stream_impl_.async_write_some(buffers, - ASIO_MOVE_CAST(WriteHandler)(handler)); - } - - /// Fill the buffer with some data. Returns the number of bytes placed in the - /// buffer as a result of the operation. Throws an exception on failure. - std::size_t fill() - { - return stream_impl_.fill(); - } - - /// Fill the buffer with some data. Returns the number of bytes placed in the - /// buffer as a result of the operation, or 0 if an error occurred. - std::size_t fill(asio::error_code& ec) - { - return stream_impl_.fill(ec); - } - - /// Start an asynchronous fill. - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_fill(ASIO_MOVE_ARG(ReadHandler) handler) - { - return stream_impl_.async_fill(ASIO_MOVE_CAST(ReadHandler)(handler)); - } - - /// Read some data from the stream. Returns the number of bytes read. Throws - /// an exception on failure. - template - std::size_t read_some(const MutableBufferSequence& buffers) - { - return stream_impl_.read_some(buffers); - } - - /// Read some data from the stream. Returns the number of bytes read or 0 if - /// an error occurred. - template - std::size_t read_some(const MutableBufferSequence& buffers, - asio::error_code& ec) - { - return stream_impl_.read_some(buffers, ec); - } - - /// Start an asynchronous read. The buffer into which the data will be read - /// must be valid for the lifetime of the asynchronous operation. - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_read_some(const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler) - { - return stream_impl_.async_read_some(buffers, - ASIO_MOVE_CAST(ReadHandler)(handler)); - } - - /// Peek at the incoming data on the stream. Returns the number of bytes read. - /// Throws an exception on failure. - template - std::size_t peek(const MutableBufferSequence& buffers) - { - return stream_impl_.peek(buffers); - } - - /// Peek at the incoming data on the stream. Returns the number of bytes read, - /// or 0 if an error occurred. - template - std::size_t peek(const MutableBufferSequence& buffers, - asio::error_code& ec) - { - return stream_impl_.peek(buffers, ec); - } - - /// Determine the amount of data that may be read without blocking. - std::size_t in_avail() - { - return stream_impl_.in_avail(); - } - - /// Determine the amount of data that may be read without blocking. - std::size_t in_avail(asio::error_code& ec) - { - return stream_impl_.in_avail(ec); - } - -private: - // The buffered write stream. - typedef buffered_write_stream write_stream_type; - write_stream_type inner_stream_impl_; - - // The buffered read stream. - typedef buffered_read_stream read_stream_type; - read_stream_type stream_impl_; -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_BUFFERED_STREAM_HPP diff --git a/tools/sdk/include/asio/asio/buffered_stream_fwd.hpp b/tools/sdk/include/asio/asio/buffered_stream_fwd.hpp deleted file mode 100644 index 3492979d2b1..00000000000 --- a/tools/sdk/include/asio/asio/buffered_stream_fwd.hpp +++ /dev/null @@ -1,25 +0,0 @@ -// -// buffered_stream_fwd.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_BUFFERED_STREAM_FWD_HPP -#define ASIO_BUFFERED_STREAM_FWD_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -namespace asio { - -template -class buffered_stream; - -} // namespace asio - -#endif // ASIO_BUFFERED_STREAM_FWD_HPP diff --git a/tools/sdk/include/asio/asio/buffered_write_stream.hpp b/tools/sdk/include/asio/asio/buffered_write_stream.hpp deleted file mode 100644 index aac33d38f47..00000000000 --- a/tools/sdk/include/asio/asio/buffered_write_stream.hpp +++ /dev/null @@ -1,249 +0,0 @@ -// -// buffered_write_stream.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_BUFFERED_WRITE_STREAM_HPP -#define ASIO_BUFFERED_WRITE_STREAM_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/buffered_write_stream_fwd.hpp" -#include "asio/buffer.hpp" -#include "asio/completion_condition.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffered_stream_storage.hpp" -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" -#include "asio/write.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Adds buffering to the write-related operations of a stream. -/** - * The buffered_write_stream class template can be used to add buffering to the - * synchronous and asynchronous write operations of a stream. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - * - * @par Concepts: - * AsyncReadStream, AsyncWriteStream, Stream, SyncReadStream, SyncWriteStream. - */ -template -class buffered_write_stream - : private noncopyable -{ -public: - /// The type of the next layer. - typedef typename remove_reference::type next_layer_type; - - /// The type of the lowest layer. - typedef typename next_layer_type::lowest_layer_type lowest_layer_type; - - /// The type of the executor associated with the object. - typedef typename lowest_layer_type::executor_type executor_type; - -#if defined(GENERATING_DOCUMENTATION) - /// The default buffer size. - static const std::size_t default_buffer_size = implementation_defined; -#else - ASIO_STATIC_CONSTANT(std::size_t, default_buffer_size = 1024); -#endif - - /// Construct, passing the specified argument to initialise the next layer. - template - explicit buffered_write_stream(Arg& a) - : next_layer_(a), - storage_(default_buffer_size) - { - } - - /// Construct, passing the specified argument to initialise the next layer. - template - buffered_write_stream(Arg& a, std::size_t buffer_size) - : next_layer_(a), - storage_(buffer_size) - { - } - - /// Get a reference to the next layer. - next_layer_type& next_layer() - { - return next_layer_; - } - - /// Get a reference to the lowest layer. - lowest_layer_type& lowest_layer() - { - return next_layer_.lowest_layer(); - } - - /// Get a const reference to the lowest layer. - const lowest_layer_type& lowest_layer() const - { - return next_layer_.lowest_layer(); - } - - /// Get the executor associated with the object. - executor_type get_executor() ASIO_NOEXCEPT - { - return next_layer_.lowest_layer().get_executor(); - } - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - asio::io_context& get_io_context() - { - return next_layer_.get_io_context(); - } - - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - asio::io_context& get_io_service() - { - return next_layer_.get_io_service(); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Close the stream. - void close() - { - next_layer_.close(); - } - - /// Close the stream. - ASIO_SYNC_OP_VOID close(asio::error_code& ec) - { - next_layer_.close(ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Flush all data from the buffer to the next layer. Returns the number of - /// bytes written to the next layer on the last write operation. Throws an - /// exception on failure. - std::size_t flush(); - - /// Flush all data from the buffer to the next layer. Returns the number of - /// bytes written to the next layer on the last write operation, or 0 if an - /// error occurred. - std::size_t flush(asio::error_code& ec); - - /// Start an asynchronous flush. - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_flush(ASIO_MOVE_ARG(WriteHandler) handler); - - /// Write the given data to the stream. Returns the number of bytes written. - /// Throws an exception on failure. - template - std::size_t write_some(const ConstBufferSequence& buffers); - - /// Write the given data to the stream. Returns the number of bytes written, - /// or 0 if an error occurred and the error handler did not throw. - template - std::size_t write_some(const ConstBufferSequence& buffers, - asio::error_code& ec); - - /// Start an asynchronous write. The data being written must be valid for the - /// lifetime of the asynchronous operation. - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_write_some(const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler); - - /// Read some data from the stream. Returns the number of bytes read. Throws - /// an exception on failure. - template - std::size_t read_some(const MutableBufferSequence& buffers) - { - return next_layer_.read_some(buffers); - } - - /// Read some data from the stream. Returns the number of bytes read or 0 if - /// an error occurred. - template - std::size_t read_some(const MutableBufferSequence& buffers, - asio::error_code& ec) - { - return next_layer_.read_some(buffers, ec); - } - - /// Start an asynchronous read. The buffer into which the data will be read - /// must be valid for the lifetime of the asynchronous operation. - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_read_some(const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler) - { - return next_layer_.async_read_some(buffers, - ASIO_MOVE_CAST(ReadHandler)(handler)); - } - - /// Peek at the incoming data on the stream. Returns the number of bytes read. - /// Throws an exception on failure. - template - std::size_t peek(const MutableBufferSequence& buffers) - { - return next_layer_.peek(buffers); - } - - /// Peek at the incoming data on the stream. Returns the number of bytes read, - /// or 0 if an error occurred. - template - std::size_t peek(const MutableBufferSequence& buffers, - asio::error_code& ec) - { - return next_layer_.peek(buffers, ec); - } - - /// Determine the amount of data that may be read without blocking. - std::size_t in_avail() - { - return next_layer_.in_avail(); - } - - /// Determine the amount of data that may be read without blocking. - std::size_t in_avail(asio::error_code& ec) - { - return next_layer_.in_avail(ec); - } - -private: - /// Copy data into the internal buffer from the specified source buffer. - /// Returns the number of bytes copied. - template - std::size_t copy(const ConstBufferSequence& buffers); - - /// The next layer. - Stream next_layer_; - - // The data in the buffer. - detail::buffered_stream_storage storage_; -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/impl/buffered_write_stream.hpp" - -#endif // ASIO_BUFFERED_WRITE_STREAM_HPP diff --git a/tools/sdk/include/asio/asio/buffered_write_stream_fwd.hpp b/tools/sdk/include/asio/asio/buffered_write_stream_fwd.hpp deleted file mode 100644 index 6ef54ba0d6c..00000000000 --- a/tools/sdk/include/asio/asio/buffered_write_stream_fwd.hpp +++ /dev/null @@ -1,25 +0,0 @@ -// -// buffered_write_stream_fwd.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_BUFFERED_WRITE_STREAM_FWD_HPP -#define ASIO_BUFFERED_WRITE_STREAM_FWD_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -namespace asio { - -template -class buffered_write_stream; - -} // namespace asio - -#endif // ASIO_BUFFERED_WRITE_STREAM_FWD_HPP diff --git a/tools/sdk/include/asio/asio/buffers_iterator.hpp b/tools/sdk/include/asio/asio/buffers_iterator.hpp deleted file mode 100644 index f5c9d4c3548..00000000000 --- a/tools/sdk/include/asio/asio/buffers_iterator.hpp +++ /dev/null @@ -1,521 +0,0 @@ -// -// buffers_iterator.hpp -// ~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_BUFFERS_ITERATOR_HPP -#define ASIO_BUFFERS_ITERATOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include -#include "asio/buffer.hpp" -#include "asio/detail/assert.hpp" -#include "asio/detail/type_traits.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -namespace detail -{ - template - struct buffers_iterator_types_helper; - - template <> - struct buffers_iterator_types_helper - { - typedef const_buffer buffer_type; - template - struct byte_type - { - typedef typename add_const::type type; - }; - }; - - template <> - struct buffers_iterator_types_helper - { - typedef mutable_buffer buffer_type; - template - struct byte_type - { - typedef ByteType type; - }; - }; - - template - struct buffers_iterator_types - { - enum - { - is_mutable = is_convertible< - typename BufferSequence::value_type, - mutable_buffer>::value - }; - typedef buffers_iterator_types_helper helper; - typedef typename helper::buffer_type buffer_type; - typedef typename helper::template byte_type::type byte_type; - typedef typename BufferSequence::const_iterator const_iterator; - }; - - template - struct buffers_iterator_types - { - typedef mutable_buffer buffer_type; - typedef ByteType byte_type; - typedef const mutable_buffer* const_iterator; - }; - - template - struct buffers_iterator_types - { - typedef const_buffer buffer_type; - typedef typename add_const::type byte_type; - typedef const const_buffer* const_iterator; - }; - -#if !defined(ASIO_NO_DEPRECATED) - - template - struct buffers_iterator_types - { - typedef mutable_buffer buffer_type; - typedef ByteType byte_type; - typedef const mutable_buffer* const_iterator; - }; - - template - struct buffers_iterator_types - { - typedef const_buffer buffer_type; - typedef typename add_const::type byte_type; - typedef const const_buffer* const_iterator; - }; - -#endif // !defined(ASIO_NO_DEPRECATED) -} - -/// A random access iterator over the bytes in a buffer sequence. -template -class buffers_iterator -{ -private: - typedef typename detail::buffers_iterator_types< - BufferSequence, ByteType>::buffer_type buffer_type; - - typedef typename detail::buffers_iterator_types::const_iterator buffer_sequence_iterator_type; - -public: - /// The type used for the distance between two iterators. - typedef std::ptrdiff_t difference_type; - - /// The type of the value pointed to by the iterator. - typedef ByteType value_type; - -#if defined(GENERATING_DOCUMENTATION) - /// The type of the result of applying operator->() to the iterator. - /** - * If the buffer sequence stores buffer objects that are convertible to - * mutable_buffer, this is a pointer to a non-const ByteType. Otherwise, a - * pointer to a const ByteType. - */ - typedef const_or_non_const_ByteType* pointer; -#else // defined(GENERATING_DOCUMENTATION) - typedef typename detail::buffers_iterator_types< - BufferSequence, ByteType>::byte_type* pointer; -#endif // defined(GENERATING_DOCUMENTATION) - -#if defined(GENERATING_DOCUMENTATION) - /// The type of the result of applying operator*() to the iterator. - /** - * If the buffer sequence stores buffer objects that are convertible to - * mutable_buffer, this is a reference to a non-const ByteType. Otherwise, a - * reference to a const ByteType. - */ - typedef const_or_non_const_ByteType& reference; -#else // defined(GENERATING_DOCUMENTATION) - typedef typename detail::buffers_iterator_types< - BufferSequence, ByteType>::byte_type& reference; -#endif // defined(GENERATING_DOCUMENTATION) - - /// The iterator category. - typedef std::random_access_iterator_tag iterator_category; - - /// Default constructor. Creates an iterator in an undefined state. - buffers_iterator() - : current_buffer_(), - current_buffer_position_(0), - begin_(), - current_(), - end_(), - position_(0) - { - } - - /// Construct an iterator representing the beginning of the buffers' data. - static buffers_iterator begin(const BufferSequence& buffers) -#if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 3) - __attribute__ ((__noinline__)) -#endif // defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 3) - { - buffers_iterator new_iter; - new_iter.begin_ = asio::buffer_sequence_begin(buffers); - new_iter.current_ = asio::buffer_sequence_begin(buffers); - new_iter.end_ = asio::buffer_sequence_end(buffers); - while (new_iter.current_ != new_iter.end_) - { - new_iter.current_buffer_ = *new_iter.current_; - if (new_iter.current_buffer_.size() > 0) - break; - ++new_iter.current_; - } - return new_iter; - } - - /// Construct an iterator representing the end of the buffers' data. - static buffers_iterator end(const BufferSequence& buffers) -#if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 3) - __attribute__ ((__noinline__)) -#endif // defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 3) - { - buffers_iterator new_iter; - new_iter.begin_ = asio::buffer_sequence_begin(buffers); - new_iter.current_ = asio::buffer_sequence_begin(buffers); - new_iter.end_ = asio::buffer_sequence_end(buffers); - while (new_iter.current_ != new_iter.end_) - { - buffer_type buffer = *new_iter.current_; - new_iter.position_ += buffer.size(); - ++new_iter.current_; - } - return new_iter; - } - - /// Dereference an iterator. - reference operator*() const - { - return dereference(); - } - - /// Dereference an iterator. - pointer operator->() const - { - return &dereference(); - } - - /// Access an individual element. - reference operator[](std::ptrdiff_t difference) const - { - buffers_iterator tmp(*this); - tmp.advance(difference); - return *tmp; - } - - /// Increment operator (prefix). - buffers_iterator& operator++() - { - increment(); - return *this; - } - - /// Increment operator (postfix). - buffers_iterator operator++(int) - { - buffers_iterator tmp(*this); - ++*this; - return tmp; - } - - /// Decrement operator (prefix). - buffers_iterator& operator--() - { - decrement(); - return *this; - } - - /// Decrement operator (postfix). - buffers_iterator operator--(int) - { - buffers_iterator tmp(*this); - --*this; - return tmp; - } - - /// Addition operator. - buffers_iterator& operator+=(std::ptrdiff_t difference) - { - advance(difference); - return *this; - } - - /// Subtraction operator. - buffers_iterator& operator-=(std::ptrdiff_t difference) - { - advance(-difference); - return *this; - } - - /// Addition operator. - friend buffers_iterator operator+(const buffers_iterator& iter, - std::ptrdiff_t difference) - { - buffers_iterator tmp(iter); - tmp.advance(difference); - return tmp; - } - - /// Addition operator. - friend buffers_iterator operator+(std::ptrdiff_t difference, - const buffers_iterator& iter) - { - buffers_iterator tmp(iter); - tmp.advance(difference); - return tmp; - } - - /// Subtraction operator. - friend buffers_iterator operator-(const buffers_iterator& iter, - std::ptrdiff_t difference) - { - buffers_iterator tmp(iter); - tmp.advance(-difference); - return tmp; - } - - /// Subtraction operator. - friend std::ptrdiff_t operator-(const buffers_iterator& a, - const buffers_iterator& b) - { - return b.distance_to(a); - } - - /// Test two iterators for equality. - friend bool operator==(const buffers_iterator& a, const buffers_iterator& b) - { - return a.equal(b); - } - - /// Test two iterators for inequality. - friend bool operator!=(const buffers_iterator& a, const buffers_iterator& b) - { - return !a.equal(b); - } - - /// Compare two iterators. - friend bool operator<(const buffers_iterator& a, const buffers_iterator& b) - { - return a.distance_to(b) > 0; - } - - /// Compare two iterators. - friend bool operator<=(const buffers_iterator& a, const buffers_iterator& b) - { - return !(b < a); - } - - /// Compare two iterators. - friend bool operator>(const buffers_iterator& a, const buffers_iterator& b) - { - return b < a; - } - - /// Compare two iterators. - friend bool operator>=(const buffers_iterator& a, const buffers_iterator& b) - { - return !(a < b); - } - -private: - // Dereference the iterator. - reference dereference() const - { - return static_cast( - current_buffer_.data())[current_buffer_position_]; - } - - // Compare two iterators for equality. - bool equal(const buffers_iterator& other) const - { - return position_ == other.position_; - } - - // Increment the iterator. - void increment() - { - ASIO_ASSERT(current_ != end_ && "iterator out of bounds"); - ++position_; - - // Check if the increment can be satisfied by the current buffer. - ++current_buffer_position_; - if (current_buffer_position_ != current_buffer_.size()) - return; - - // Find the next non-empty buffer. - ++current_; - current_buffer_position_ = 0; - while (current_ != end_) - { - current_buffer_ = *current_; - if (current_buffer_.size() > 0) - return; - ++current_; - } - } - - // Decrement the iterator. - void decrement() - { - ASIO_ASSERT(position_ > 0 && "iterator out of bounds"); - --position_; - - // Check if the decrement can be satisfied by the current buffer. - if (current_buffer_position_ != 0) - { - --current_buffer_position_; - return; - } - - // Find the previous non-empty buffer. - buffer_sequence_iterator_type iter = current_; - while (iter != begin_) - { - --iter; - buffer_type buffer = *iter; - std::size_t buffer_size = buffer.size(); - if (buffer_size > 0) - { - current_ = iter; - current_buffer_ = buffer; - current_buffer_position_ = buffer_size - 1; - return; - } - } - } - - // Advance the iterator by the specified distance. - void advance(std::ptrdiff_t n) - { - if (n > 0) - { - ASIO_ASSERT(current_ != end_ && "iterator out of bounds"); - for (;;) - { - std::ptrdiff_t current_buffer_balance - = current_buffer_.size() - current_buffer_position_; - - // Check if the advance can be satisfied by the current buffer. - if (current_buffer_balance > n) - { - position_ += n; - current_buffer_position_ += n; - return; - } - - // Update position. - n -= current_buffer_balance; - position_ += current_buffer_balance; - - // Move to next buffer. If it is empty then it will be skipped on the - // next iteration of this loop. - if (++current_ == end_) - { - ASIO_ASSERT(n == 0 && "iterator out of bounds"); - current_buffer_ = buffer_type(); - current_buffer_position_ = 0; - return; - } - current_buffer_ = *current_; - current_buffer_position_ = 0; - } - } - else if (n < 0) - { - std::size_t abs_n = -n; - ASIO_ASSERT(position_ >= abs_n && "iterator out of bounds"); - for (;;) - { - // Check if the advance can be satisfied by the current buffer. - if (current_buffer_position_ >= abs_n) - { - position_ -= abs_n; - current_buffer_position_ -= abs_n; - return; - } - - // Update position. - abs_n -= current_buffer_position_; - position_ -= current_buffer_position_; - - // Check if we've reached the beginning of the buffers. - if (current_ == begin_) - { - ASIO_ASSERT(abs_n == 0 && "iterator out of bounds"); - current_buffer_position_ = 0; - return; - } - - // Find the previous non-empty buffer. - buffer_sequence_iterator_type iter = current_; - while (iter != begin_) - { - --iter; - buffer_type buffer = *iter; - std::size_t buffer_size = buffer.size(); - if (buffer_size > 0) - { - current_ = iter; - current_buffer_ = buffer; - current_buffer_position_ = buffer_size; - break; - } - } - } - } - } - - // Determine the distance between two iterators. - std::ptrdiff_t distance_to(const buffers_iterator& other) const - { - return other.position_ - position_; - } - - buffer_type current_buffer_; - std::size_t current_buffer_position_; - buffer_sequence_iterator_type begin_; - buffer_sequence_iterator_type current_; - buffer_sequence_iterator_type end_; - std::size_t position_; -}; - -/// Construct an iterator representing the beginning of the buffers' data. -template -inline buffers_iterator buffers_begin( - const BufferSequence& buffers) -{ - return buffers_iterator::begin(buffers); -} - -/// Construct an iterator representing the end of the buffers' data. -template -inline buffers_iterator buffers_end( - const BufferSequence& buffers) -{ - return buffers_iterator::end(buffers); -} - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_BUFFERS_ITERATOR_HPP diff --git a/tools/sdk/include/asio/asio/completion_condition.hpp b/tools/sdk/include/asio/asio/completion_condition.hpp deleted file mode 100644 index 563f417d1a5..00000000000 --- a/tools/sdk/include/asio/asio/completion_condition.hpp +++ /dev/null @@ -1,218 +0,0 @@ -// -// completion_condition.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_COMPLETION_CONDITION_HPP -#define ASIO_COMPLETION_CONDITION_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include - -#include "asio/detail/push_options.hpp" - -namespace asio { - -namespace detail { - -// The default maximum number of bytes to transfer in a single operation. -enum default_max_transfer_size_t { default_max_transfer_size = 65536 }; - -// Adapt result of old-style completion conditions (which had a bool result -// where true indicated that the operation was complete). -inline std::size_t adapt_completion_condition_result(bool result) -{ - return result ? 0 : default_max_transfer_size; -} - -// Adapt result of current completion conditions (which have a size_t result -// where 0 means the operation is complete, and otherwise the result is the -// maximum number of bytes to transfer on the next underlying operation). -inline std::size_t adapt_completion_condition_result(std::size_t result) -{ - return result; -} - -class transfer_all_t -{ -public: - typedef std::size_t result_type; - - template - std::size_t operator()(const Error& err, std::size_t) - { - return !!err ? 0 : default_max_transfer_size; - } -}; - -class transfer_at_least_t -{ -public: - typedef std::size_t result_type; - - explicit transfer_at_least_t(std::size_t minimum) - : minimum_(minimum) - { - } - - template - std::size_t operator()(const Error& err, std::size_t bytes_transferred) - { - return (!!err || bytes_transferred >= minimum_) - ? 0 : default_max_transfer_size; - } - -private: - std::size_t minimum_; -}; - -class transfer_exactly_t -{ -public: - typedef std::size_t result_type; - - explicit transfer_exactly_t(std::size_t size) - : size_(size) - { - } - - template - std::size_t operator()(const Error& err, std::size_t bytes_transferred) - { - return (!!err || bytes_transferred >= size_) ? 0 : - (size_ - bytes_transferred < default_max_transfer_size - ? size_ - bytes_transferred : std::size_t(default_max_transfer_size)); - } - -private: - std::size_t size_; -}; - -} // namespace detail - -/** - * @defgroup completion_condition Completion Condition Function Objects - * - * Function objects used for determining when a read or write operation should - * complete. - */ -/*@{*/ - -/// Return a completion condition function object that indicates that a read or -/// write operation should continue until all of the data has been transferred, -/// or until an error occurs. -/** - * This function is used to create an object, of unspecified type, that meets - * CompletionCondition requirements. - * - * @par Example - * Reading until a buffer is full: - * @code - * boost::array buf; - * asio::error_code ec; - * std::size_t n = asio::read( - * sock, asio::buffer(buf), - * asio::transfer_all(), ec); - * if (ec) - * { - * // An error occurred. - * } - * else - * { - * // n == 128 - * } - * @endcode - */ -#if defined(GENERATING_DOCUMENTATION) -unspecified transfer_all(); -#else -inline detail::transfer_all_t transfer_all() -{ - return detail::transfer_all_t(); -} -#endif - -/// Return a completion condition function object that indicates that a read or -/// write operation should continue until a minimum number of bytes has been -/// transferred, or until an error occurs. -/** - * This function is used to create an object, of unspecified type, that meets - * CompletionCondition requirements. - * - * @par Example - * Reading until a buffer is full or contains at least 64 bytes: - * @code - * boost::array buf; - * asio::error_code ec; - * std::size_t n = asio::read( - * sock, asio::buffer(buf), - * asio::transfer_at_least(64), ec); - * if (ec) - * { - * // An error occurred. - * } - * else - * { - * // n >= 64 && n <= 128 - * } - * @endcode - */ -#if defined(GENERATING_DOCUMENTATION) -unspecified transfer_at_least(std::size_t minimum); -#else -inline detail::transfer_at_least_t transfer_at_least(std::size_t minimum) -{ - return detail::transfer_at_least_t(minimum); -} -#endif - -/// Return a completion condition function object that indicates that a read or -/// write operation should continue until an exact number of bytes has been -/// transferred, or until an error occurs. -/** - * This function is used to create an object, of unspecified type, that meets - * CompletionCondition requirements. - * - * @par Example - * Reading until a buffer is full or contains exactly 64 bytes: - * @code - * boost::array buf; - * asio::error_code ec; - * std::size_t n = asio::read( - * sock, asio::buffer(buf), - * asio::transfer_exactly(64), ec); - * if (ec) - * { - * // An error occurred. - * } - * else - * { - * // n == 64 - * } - * @endcode - */ -#if defined(GENERATING_DOCUMENTATION) -unspecified transfer_exactly(std::size_t size); -#else -inline detail::transfer_exactly_t transfer_exactly(std::size_t size) -{ - return detail::transfer_exactly_t(size); -} -#endif - -/*@}*/ - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_COMPLETION_CONDITION_HPP diff --git a/tools/sdk/include/asio/asio/connect.hpp b/tools/sdk/include/asio/asio/connect.hpp deleted file mode 100644 index 487ce3e0856..00000000000 --- a/tools/sdk/include/asio/asio/connect.hpp +++ /dev/null @@ -1,1059 +0,0 @@ -// -// connect.hpp -// ~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_CONNECT_HPP -#define ASIO_CONNECT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/async_result.hpp" -#include "asio/basic_socket.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -namespace detail -{ - char (&has_iterator_helper(...))[2]; - - template - char has_iterator_helper(T*, typename T::iterator* = 0); - - template - struct has_iterator_typedef - { - enum { value = (sizeof((has_iterator_helper)((T*)(0))) == 1) }; - }; -} // namespace detail - -/// Type trait used to determine whether a type is an endpoint sequence that can -/// be used with with @c connect and @c async_connect. -template -struct is_endpoint_sequence -{ -#if defined(GENERATING_DOCUMENTATION) - /// The value member is true if the type may be used as an endpoint sequence. - static const bool value; -#else - enum - { - value = detail::has_iterator_typedef::value - }; -#endif -}; - -/** - * @defgroup connect asio::connect - * - * @brief Establishes a socket connection by trying each endpoint in a sequence. - */ -/*@{*/ - -/// Establishes a socket connection by trying each endpoint in a sequence. -/** - * This function attempts to connect a socket to one of a sequence of - * endpoints. It does this by repeated calls to the socket's @c connect member - * function, once for each endpoint in the sequence, until a connection is - * successfully established. - * - * @param s The socket to be connected. If the socket is already open, it will - * be closed. - * - * @param endpoints A sequence of endpoints. - * - * @returns The successfully connected endpoint. - * - * @throws asio::system_error Thrown on failure. If the sequence is - * empty, the associated @c error_code is asio::error::not_found. - * Otherwise, contains the error from the last connection attempt. - * - * @par Example - * @code tcp::resolver r(io_context); - * tcp::resolver::query q("host", "service"); - * tcp::socket s(io_context); - * asio::connect(s, r.resolve(q)); @endcode - */ -template -typename Protocol::endpoint connect( - basic_socket& s, - const EndpointSequence& endpoints, - typename enable_if::value>::type* = 0); - -/// Establishes a socket connection by trying each endpoint in a sequence. -/** - * This function attempts to connect a socket to one of a sequence of - * endpoints. It does this by repeated calls to the socket's @c connect member - * function, once for each endpoint in the sequence, until a connection is - * successfully established. - * - * @param s The socket to be connected. If the socket is already open, it will - * be closed. - * - * @param endpoints A sequence of endpoints. - * - * @param ec Set to indicate what error occurred, if any. If the sequence is - * empty, set to asio::error::not_found. Otherwise, contains the error - * from the last connection attempt. - * - * @returns On success, the successfully connected endpoint. Otherwise, a - * default-constructed endpoint. - * - * @par Example - * @code tcp::resolver r(io_context); - * tcp::resolver::query q("host", "service"); - * tcp::socket s(io_context); - * asio::error_code ec; - * asio::connect(s, r.resolve(q), ec); - * if (ec) - * { - * // An error occurred. - * } @endcode - */ -template -typename Protocol::endpoint connect( - basic_socket& s, - const EndpointSequence& endpoints, asio::error_code& ec, - typename enable_if::value>::type* = 0); - -#if !defined(ASIO_NO_DEPRECATED) -/// (Deprecated.) Establishes a socket connection by trying each endpoint in a -/// sequence. -/** - * This function attempts to connect a socket to one of a sequence of - * endpoints. It does this by repeated calls to the socket's @c connect member - * function, once for each endpoint in the sequence, until a connection is - * successfully established. - * - * @param s The socket to be connected. If the socket is already open, it will - * be closed. - * - * @param begin An iterator pointing to the start of a sequence of endpoints. - * - * @returns On success, an iterator denoting the successfully connected - * endpoint. Otherwise, the end iterator. - * - * @throws asio::system_error Thrown on failure. If the sequence is - * empty, the associated @c error_code is asio::error::not_found. - * Otherwise, contains the error from the last connection attempt. - * - * @note This overload assumes that a default constructed object of type @c - * Iterator represents the end of the sequence. This is a valid assumption for - * iterator types such as @c asio::ip::tcp::resolver::iterator. - */ -template -Iterator connect(basic_socket& s, Iterator begin, - typename enable_if::value>::type* = 0); - -/// (Deprecated.) Establishes a socket connection by trying each endpoint in a -/// sequence. -/** - * This function attempts to connect a socket to one of a sequence of - * endpoints. It does this by repeated calls to the socket's @c connect member - * function, once for each endpoint in the sequence, until a connection is - * successfully established. - * - * @param s The socket to be connected. If the socket is already open, it will - * be closed. - * - * @param begin An iterator pointing to the start of a sequence of endpoints. - * - * @param ec Set to indicate what error occurred, if any. If the sequence is - * empty, set to asio::error::not_found. Otherwise, contains the error - * from the last connection attempt. - * - * @returns On success, an iterator denoting the successfully connected - * endpoint. Otherwise, the end iterator. - * - * @note This overload assumes that a default constructed object of type @c - * Iterator represents the end of the sequence. This is a valid assumption for - * iterator types such as @c asio::ip::tcp::resolver::iterator. - */ -template -Iterator connect(basic_socket& s, - Iterator begin, asio::error_code& ec, - typename enable_if::value>::type* = 0); -#endif // !defined(ASIO_NO_DEPRECATED) - -/// Establishes a socket connection by trying each endpoint in a sequence. -/** - * This function attempts to connect a socket to one of a sequence of - * endpoints. It does this by repeated calls to the socket's @c connect member - * function, once for each endpoint in the sequence, until a connection is - * successfully established. - * - * @param s The socket to be connected. If the socket is already open, it will - * be closed. - * - * @param begin An iterator pointing to the start of a sequence of endpoints. - * - * @param end An iterator pointing to the end of a sequence of endpoints. - * - * @returns An iterator denoting the successfully connected endpoint. - * - * @throws asio::system_error Thrown on failure. If the sequence is - * empty, the associated @c error_code is asio::error::not_found. - * Otherwise, contains the error from the last connection attempt. - * - * @par Example - * @code tcp::resolver r(io_context); - * tcp::resolver::query q("host", "service"); - * tcp::resolver::results_type e = r.resolve(q); - * tcp::socket s(io_context); - * asio::connect(s, e.begin(), e.end()); @endcode - */ -template -Iterator connect(basic_socket& s, - Iterator begin, Iterator end); - -/// Establishes a socket connection by trying each endpoint in a sequence. -/** - * This function attempts to connect a socket to one of a sequence of - * endpoints. It does this by repeated calls to the socket's @c connect member - * function, once for each endpoint in the sequence, until a connection is - * successfully established. - * - * @param s The socket to be connected. If the socket is already open, it will - * be closed. - * - * @param begin An iterator pointing to the start of a sequence of endpoints. - * - * @param end An iterator pointing to the end of a sequence of endpoints. - * - * @param ec Set to indicate what error occurred, if any. If the sequence is - * empty, set to asio::error::not_found. Otherwise, contains the error - * from the last connection attempt. - * - * @returns On success, an iterator denoting the successfully connected - * endpoint. Otherwise, the end iterator. - * - * @par Example - * @code tcp::resolver r(io_context); - * tcp::resolver::query q("host", "service"); - * tcp::resolver::results_type e = r.resolve(q); - * tcp::socket s(io_context); - * asio::error_code ec; - * asio::connect(s, e.begin(), e.end(), ec); - * if (ec) - * { - * // An error occurred. - * } @endcode - */ -template -Iterator connect(basic_socket& s, - Iterator begin, Iterator end, asio::error_code& ec); - -/// Establishes a socket connection by trying each endpoint in a sequence. -/** - * This function attempts to connect a socket to one of a sequence of - * endpoints. It does this by repeated calls to the socket's @c connect member - * function, once for each endpoint in the sequence, until a connection is - * successfully established. - * - * @param s The socket to be connected. If the socket is already open, it will - * be closed. - * - * @param endpoints A sequence of endpoints. - * - * @param connect_condition A function object that is called prior to each - * connection attempt. The signature of the function object must be: - * @code bool connect_condition( - * const asio::error_code& ec, - * const typename Protocol::endpoint& next); @endcode - * The @c ec parameter contains the result from the most recent connect - * operation. Before the first connection attempt, @c ec is always set to - * indicate success. The @c next parameter is the next endpoint to be tried. - * The function object should return true if the next endpoint should be tried, - * and false if it should be skipped. - * - * @returns The successfully connected endpoint. - * - * @throws asio::system_error Thrown on failure. If the sequence is - * empty, the associated @c error_code is asio::error::not_found. - * Otherwise, contains the error from the last connection attempt. - * - * @par Example - * The following connect condition function object can be used to output - * information about the individual connection attempts: - * @code struct my_connect_condition - * { - * bool operator()( - * const asio::error_code& ec, - * const::tcp::endpoint& next) - * { - * if (ec) std::cout << "Error: " << ec.message() << std::endl; - * std::cout << "Trying: " << next << std::endl; - * return true; - * } - * }; @endcode - * It would be used with the asio::connect function as follows: - * @code tcp::resolver r(io_context); - * tcp::resolver::query q("host", "service"); - * tcp::socket s(io_context); - * tcp::endpoint e = asio::connect(s, - * r.resolve(q), my_connect_condition()); - * std::cout << "Connected to: " << e << std::endl; @endcode - */ -template -typename Protocol::endpoint connect( - basic_socket& s, - const EndpointSequence& endpoints, ConnectCondition connect_condition, - typename enable_if::value>::type* = 0); - -/// Establishes a socket connection by trying each endpoint in a sequence. -/** - * This function attempts to connect a socket to one of a sequence of - * endpoints. It does this by repeated calls to the socket's @c connect member - * function, once for each endpoint in the sequence, until a connection is - * successfully established. - * - * @param s The socket to be connected. If the socket is already open, it will - * be closed. - * - * @param endpoints A sequence of endpoints. - * - * @param connect_condition A function object that is called prior to each - * connection attempt. The signature of the function object must be: - * @code bool connect_condition( - * const asio::error_code& ec, - * const typename Protocol::endpoint& next); @endcode - * The @c ec parameter contains the result from the most recent connect - * operation. Before the first connection attempt, @c ec is always set to - * indicate success. The @c next parameter is the next endpoint to be tried. - * The function object should return true if the next endpoint should be tried, - * and false if it should be skipped. - * - * @param ec Set to indicate what error occurred, if any. If the sequence is - * empty, set to asio::error::not_found. Otherwise, contains the error - * from the last connection attempt. - * - * @returns On success, the successfully connected endpoint. Otherwise, a - * default-constructed endpoint. - * - * @par Example - * The following connect condition function object can be used to output - * information about the individual connection attempts: - * @code struct my_connect_condition - * { - * bool operator()( - * const asio::error_code& ec, - * const::tcp::endpoint& next) - * { - * if (ec) std::cout << "Error: " << ec.message() << std::endl; - * std::cout << "Trying: " << next << std::endl; - * return true; - * } - * }; @endcode - * It would be used with the asio::connect function as follows: - * @code tcp::resolver r(io_context); - * tcp::resolver::query q("host", "service"); - * tcp::socket s(io_context); - * asio::error_code ec; - * tcp::endpoint e = asio::connect(s, - * r.resolve(q), my_connect_condition(), ec); - * if (ec) - * { - * // An error occurred. - * } - * else - * { - * std::cout << "Connected to: " << e << std::endl; - * } @endcode - */ -template -typename Protocol::endpoint connect( - basic_socket& s, - const EndpointSequence& endpoints, ConnectCondition connect_condition, - asio::error_code& ec, - typename enable_if::value>::type* = 0); - -#if !defined(ASIO_NO_DEPRECATED) -/// (Deprecated.) Establishes a socket connection by trying each endpoint in a -/// sequence. -/** - * This function attempts to connect a socket to one of a sequence of - * endpoints. It does this by repeated calls to the socket's @c connect member - * function, once for each endpoint in the sequence, until a connection is - * successfully established. - * - * @param s The socket to be connected. If the socket is already open, it will - * be closed. - * - * @param begin An iterator pointing to the start of a sequence of endpoints. - * - * @param connect_condition A function object that is called prior to each - * connection attempt. The signature of the function object must be: - * @code bool connect_condition( - * const asio::error_code& ec, - * const typename Protocol::endpoint& next); @endcode - * The @c ec parameter contains the result from the most recent connect - * operation. Before the first connection attempt, @c ec is always set to - * indicate success. The @c next parameter is the next endpoint to be tried. - * The function object should return true if the next endpoint should be tried, - * and false if it should be skipped. - * - * @returns On success, an iterator denoting the successfully connected - * endpoint. Otherwise, the end iterator. - * - * @throws asio::system_error Thrown on failure. If the sequence is - * empty, the associated @c error_code is asio::error::not_found. - * Otherwise, contains the error from the last connection attempt. - * - * @note This overload assumes that a default constructed object of type @c - * Iterator represents the end of the sequence. This is a valid assumption for - * iterator types such as @c asio::ip::tcp::resolver::iterator. - */ -template -Iterator connect(basic_socket& s, - Iterator begin, ConnectCondition connect_condition, - typename enable_if::value>::type* = 0); - -/// (Deprecated.) Establishes a socket connection by trying each endpoint in a -/// sequence. -/** - * This function attempts to connect a socket to one of a sequence of - * endpoints. It does this by repeated calls to the socket's @c connect member - * function, once for each endpoint in the sequence, until a connection is - * successfully established. - * - * @param s The socket to be connected. If the socket is already open, it will - * be closed. - * - * @param begin An iterator pointing to the start of a sequence of endpoints. - * - * @param connect_condition A function object that is called prior to each - * connection attempt. The signature of the function object must be: - * @code bool connect_condition( - * const asio::error_code& ec, - * const typename Protocol::endpoint& next); @endcode - * The @c ec parameter contains the result from the most recent connect - * operation. Before the first connection attempt, @c ec is always set to - * indicate success. The @c next parameter is the next endpoint to be tried. - * The function object should return true if the next endpoint should be tried, - * and false if it should be skipped. - * - * @param ec Set to indicate what error occurred, if any. If the sequence is - * empty, set to asio::error::not_found. Otherwise, contains the error - * from the last connection attempt. - * - * @returns On success, an iterator denoting the successfully connected - * endpoint. Otherwise, the end iterator. - * - * @note This overload assumes that a default constructed object of type @c - * Iterator represents the end of the sequence. This is a valid assumption for - * iterator types such as @c asio::ip::tcp::resolver::iterator. - */ -template -Iterator connect(basic_socket& s, Iterator begin, - ConnectCondition connect_condition, asio::error_code& ec, - typename enable_if::value>::type* = 0); -#endif // !defined(ASIO_NO_DEPRECATED) - -/// Establishes a socket connection by trying each endpoint in a sequence. -/** - * This function attempts to connect a socket to one of a sequence of - * endpoints. It does this by repeated calls to the socket's @c connect member - * function, once for each endpoint in the sequence, until a connection is - * successfully established. - * - * @param s The socket to be connected. If the socket is already open, it will - * be closed. - * - * @param begin An iterator pointing to the start of a sequence of endpoints. - * - * @param end An iterator pointing to the end of a sequence of endpoints. - * - * @param connect_condition A function object that is called prior to each - * connection attempt. The signature of the function object must be: - * @code bool connect_condition( - * const asio::error_code& ec, - * const typename Protocol::endpoint& next); @endcode - * The @c ec parameter contains the result from the most recent connect - * operation. Before the first connection attempt, @c ec is always set to - * indicate success. The @c next parameter is the next endpoint to be tried. - * The function object should return true if the next endpoint should be tried, - * and false if it should be skipped. - * - * @returns An iterator denoting the successfully connected endpoint. - * - * @throws asio::system_error Thrown on failure. If the sequence is - * empty, the associated @c error_code is asio::error::not_found. - * Otherwise, contains the error from the last connection attempt. - * - * @par Example - * The following connect condition function object can be used to output - * information about the individual connection attempts: - * @code struct my_connect_condition - * { - * bool operator()( - * const asio::error_code& ec, - * const::tcp::endpoint& next) - * { - * if (ec) std::cout << "Error: " << ec.message() << std::endl; - * std::cout << "Trying: " << next << std::endl; - * return true; - * } - * }; @endcode - * It would be used with the asio::connect function as follows: - * @code tcp::resolver r(io_context); - * tcp::resolver::query q("host", "service"); - * tcp::resolver::results_type e = r.resolve(q); - * tcp::socket s(io_context); - * tcp::resolver::results_type::iterator i = asio::connect( - * s, e.begin(), e.end(), my_connect_condition()); - * std::cout << "Connected to: " << i->endpoint() << std::endl; @endcode - */ -template -Iterator connect(basic_socket& s, Iterator begin, - Iterator end, ConnectCondition connect_condition); - -/// Establishes a socket connection by trying each endpoint in a sequence. -/** - * This function attempts to connect a socket to one of a sequence of - * endpoints. It does this by repeated calls to the socket's @c connect member - * function, once for each endpoint in the sequence, until a connection is - * successfully established. - * - * @param s The socket to be connected. If the socket is already open, it will - * be closed. - * - * @param begin An iterator pointing to the start of a sequence of endpoints. - * - * @param end An iterator pointing to the end of a sequence of endpoints. - * - * @param connect_condition A function object that is called prior to each - * connection attempt. The signature of the function object must be: - * @code bool connect_condition( - * const asio::error_code& ec, - * const typename Protocol::endpoint& next); @endcode - * The @c ec parameter contains the result from the most recent connect - * operation. Before the first connection attempt, @c ec is always set to - * indicate success. The @c next parameter is the next endpoint to be tried. - * The function object should return true if the next endpoint should be tried, - * and false if it should be skipped. - * - * @param ec Set to indicate what error occurred, if any. If the sequence is - * empty, set to asio::error::not_found. Otherwise, contains the error - * from the last connection attempt. - * - * @returns On success, an iterator denoting the successfully connected - * endpoint. Otherwise, the end iterator. - * - * @par Example - * The following connect condition function object can be used to output - * information about the individual connection attempts: - * @code struct my_connect_condition - * { - * bool operator()( - * const asio::error_code& ec, - * const::tcp::endpoint& next) - * { - * if (ec) std::cout << "Error: " << ec.message() << std::endl; - * std::cout << "Trying: " << next << std::endl; - * return true; - * } - * }; @endcode - * It would be used with the asio::connect function as follows: - * @code tcp::resolver r(io_context); - * tcp::resolver::query q("host", "service"); - * tcp::resolver::results_type e = r.resolve(q); - * tcp::socket s(io_context); - * asio::error_code ec; - * tcp::resolver::results_type::iterator i = asio::connect( - * s, e.begin(), e.end(), my_connect_condition()); - * if (ec) - * { - * // An error occurred. - * } - * else - * { - * std::cout << "Connected to: " << i->endpoint() << std::endl; - * } @endcode - */ -template -Iterator connect(basic_socket& s, - Iterator begin, Iterator end, ConnectCondition connect_condition, - asio::error_code& ec); - -/*@}*/ - -/** - * @defgroup async_connect asio::async_connect - * - * @brief Asynchronously establishes a socket connection by trying each - * endpoint in a sequence. - */ -/*@{*/ - -/// Asynchronously establishes a socket connection by trying each endpoint in a -/// sequence. -/** - * This function attempts to connect a socket to one of a sequence of - * endpoints. It does this by repeated calls to the socket's @c async_connect - * member function, once for each endpoint in the sequence, until a connection - * is successfully established. - * - * @param s The socket to be connected. If the socket is already open, it will - * be closed. - * - * @param endpoints A sequence of endpoints. - * - * @param handler The handler to be called when the connect operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * // Result of operation. if the sequence is empty, set to - * // asio::error::not_found. Otherwise, contains the - * // error from the last connection attempt. - * const asio::error_code& error, - * - * // On success, the successfully connected endpoint. - * // Otherwise, a default-constructed endpoint. - * const typename Protocol::endpoint& endpoint - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * @code tcp::resolver r(io_context); - * tcp::resolver::query q("host", "service"); - * tcp::socket s(io_context); - * - * // ... - * - * r.async_resolve(q, resolve_handler); - * - * // ... - * - * void resolve_handler( - * const asio::error_code& ec, - * tcp::resolver::results_type results) - * { - * if (!ec) - * { - * asio::async_connect(s, results, connect_handler); - * } - * } - * - * // ... - * - * void connect_handler( - * const asio::error_code& ec, - * const tcp::endpoint& endpoint) - * { - * // ... - * } @endcode - */ -template -ASIO_INITFN_RESULT_TYPE(RangeConnectHandler, - void (asio::error_code, typename Protocol::endpoint)) -async_connect(basic_socket& s, - const EndpointSequence& endpoints, - ASIO_MOVE_ARG(RangeConnectHandler) handler, - typename enable_if::value>::type* = 0); - -#if !defined(ASIO_NO_DEPRECATED) -/// (Deprecated.) Asynchronously establishes a socket connection by trying each -/// endpoint in a sequence. -/** - * This function attempts to connect a socket to one of a sequence of - * endpoints. It does this by repeated calls to the socket's @c async_connect - * member function, once for each endpoint in the sequence, until a connection - * is successfully established. - * - * @param s The socket to be connected. If the socket is already open, it will - * be closed. - * - * @param begin An iterator pointing to the start of a sequence of endpoints. - * - * @param handler The handler to be called when the connect operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * // Result of operation. if the sequence is empty, set to - * // asio::error::not_found. Otherwise, contains the - * // error from the last connection attempt. - * const asio::error_code& error, - * - * // On success, an iterator denoting the successfully - * // connected endpoint. Otherwise, the end iterator. - * Iterator iterator - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note This overload assumes that a default constructed object of type @c - * Iterator represents the end of the sequence. This is a valid assumption for - * iterator types such as @c asio::ip::tcp::resolver::iterator. - */ -template -ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler, - void (asio::error_code, Iterator)) -async_connect(basic_socket& s, - Iterator begin, ASIO_MOVE_ARG(IteratorConnectHandler) handler, - typename enable_if::value>::type* = 0); -#endif // !defined(ASIO_NO_DEPRECATED) - -/// Asynchronously establishes a socket connection by trying each endpoint in a -/// sequence. -/** - * This function attempts to connect a socket to one of a sequence of - * endpoints. It does this by repeated calls to the socket's @c async_connect - * member function, once for each endpoint in the sequence, until a connection - * is successfully established. - * - * @param s The socket to be connected. If the socket is already open, it will - * be closed. - * - * @param begin An iterator pointing to the start of a sequence of endpoints. - * - * @param end An iterator pointing to the end of a sequence of endpoints. - * - * @param handler The handler to be called when the connect operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * // Result of operation. if the sequence is empty, set to - * // asio::error::not_found. Otherwise, contains the - * // error from the last connection attempt. - * const asio::error_code& error, - * - * // On success, an iterator denoting the successfully - * // connected endpoint. Otherwise, the end iterator. - * Iterator iterator - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * @code std::vector endpoints = ...; - * tcp::socket s(io_context); - * asio::async_connect(s, - * endpoints.begin(), endpoints.end(), - * connect_handler); - * - * // ... - * - * void connect_handler( - * const asio::error_code& ec, - * std::vector::iterator i) - * { - * // ... - * } @endcode - */ -template -ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler, - void (asio::error_code, Iterator)) -async_connect(basic_socket& s, - Iterator begin, Iterator end, - ASIO_MOVE_ARG(IteratorConnectHandler) handler); - -/// Asynchronously establishes a socket connection by trying each endpoint in a -/// sequence. -/** - * This function attempts to connect a socket to one of a sequence of - * endpoints. It does this by repeated calls to the socket's @c async_connect - * member function, once for each endpoint in the sequence, until a connection - * is successfully established. - * - * @param s The socket to be connected. If the socket is already open, it will - * be closed. - * - * @param endpoints A sequence of endpoints. - * - * @param connect_condition A function object that is called prior to each - * connection attempt. The signature of the function object must be: - * @code bool connect_condition( - * const asio::error_code& ec, - * const typename Protocol::endpoint& next); @endcode - * The @c ec parameter contains the result from the most recent connect - * operation. Before the first connection attempt, @c ec is always set to - * indicate success. The @c next parameter is the next endpoint to be tried. - * The function object should return true if the next endpoint should be tried, - * and false if it should be skipped. - * - * @param handler The handler to be called when the connect operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * // Result of operation. if the sequence is empty, set to - * // asio::error::not_found. Otherwise, contains the - * // error from the last connection attempt. - * const asio::error_code& error, - * - * // On success, an iterator denoting the successfully - * // connected endpoint. Otherwise, the end iterator. - * Iterator iterator - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * The following connect condition function object can be used to output - * information about the individual connection attempts: - * @code struct my_connect_condition - * { - * bool operator()( - * const asio::error_code& ec, - * const::tcp::endpoint& next) - * { - * if (ec) std::cout << "Error: " << ec.message() << std::endl; - * std::cout << "Trying: " << next << std::endl; - * return true; - * } - * }; @endcode - * It would be used with the asio::connect function as follows: - * @code tcp::resolver r(io_context); - * tcp::resolver::query q("host", "service"); - * tcp::socket s(io_context); - * - * // ... - * - * r.async_resolve(q, resolve_handler); - * - * // ... - * - * void resolve_handler( - * const asio::error_code& ec, - * tcp::resolver::results_type results) - * { - * if (!ec) - * { - * asio::async_connect(s, results, - * my_connect_condition(), - * connect_handler); - * } - * } - * - * // ... - * - * void connect_handler( - * const asio::error_code& ec, - * const tcp::endpoint& endpoint) - * { - * if (ec) - * { - * // An error occurred. - * } - * else - * { - * std::cout << "Connected to: " << endpoint << std::endl; - * } - * } @endcode - */ -template -ASIO_INITFN_RESULT_TYPE(RangeConnectHandler, - void (asio::error_code, typename Protocol::endpoint)) -async_connect(basic_socket& s, - const EndpointSequence& endpoints, ConnectCondition connect_condition, - ASIO_MOVE_ARG(RangeConnectHandler) handler, - typename enable_if::value>::type* = 0); - -#if !defined(ASIO_NO_DEPRECATED) -/// (Deprecated.) Asynchronously establishes a socket connection by trying each -/// endpoint in a sequence. -/** - * This function attempts to connect a socket to one of a sequence of - * endpoints. It does this by repeated calls to the socket's @c async_connect - * member function, once for each endpoint in the sequence, until a connection - * is successfully established. - * - * @param s The socket to be connected. If the socket is already open, it will - * be closed. - * - * @param begin An iterator pointing to the start of a sequence of endpoints. - * - * @param connect_condition A function object that is called prior to each - * connection attempt. The signature of the function object must be: - * @code bool connect_condition( - * const asio::error_code& ec, - * const typename Protocol::endpoint& next); @endcode - * The @c ec parameter contains the result from the most recent connect - * operation. Before the first connection attempt, @c ec is always set to - * indicate success. The @c next parameter is the next endpoint to be tried. - * The function object should return true if the next endpoint should be tried, - * and false if it should be skipped. - * - * @param handler The handler to be called when the connect operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * // Result of operation. if the sequence is empty, set to - * // asio::error::not_found. Otherwise, contains the - * // error from the last connection attempt. - * const asio::error_code& error, - * - * // On success, an iterator denoting the successfully - * // connected endpoint. Otherwise, the end iterator. - * Iterator iterator - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note This overload assumes that a default constructed object of type @c - * Iterator represents the end of the sequence. This is a valid assumption for - * iterator types such as @c asio::ip::tcp::resolver::iterator. - */ -template -ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler, - void (asio::error_code, Iterator)) -async_connect(basic_socket& s, Iterator begin, - ConnectCondition connect_condition, - ASIO_MOVE_ARG(IteratorConnectHandler) handler, - typename enable_if::value>::type* = 0); -#endif // !defined(ASIO_NO_DEPRECATED) - -/// Asynchronously establishes a socket connection by trying each endpoint in a -/// sequence. -/** - * This function attempts to connect a socket to one of a sequence of - * endpoints. It does this by repeated calls to the socket's @c async_connect - * member function, once for each endpoint in the sequence, until a connection - * is successfully established. - * - * @param s The socket to be connected. If the socket is already open, it will - * be closed. - * - * @param begin An iterator pointing to the start of a sequence of endpoints. - * - * @param end An iterator pointing to the end of a sequence of endpoints. - * - * @param connect_condition A function object that is called prior to each - * connection attempt. The signature of the function object must be: - * @code bool connect_condition( - * const asio::error_code& ec, - * const typename Protocol::endpoint& next); @endcode - * The @c ec parameter contains the result from the most recent connect - * operation. Before the first connection attempt, @c ec is always set to - * indicate success. The @c next parameter is the next endpoint to be tried. - * The function object should return true if the next endpoint should be tried, - * and false if it should be skipped. - * - * @param handler The handler to be called when the connect operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * // Result of operation. if the sequence is empty, set to - * // asio::error::not_found. Otherwise, contains the - * // error from the last connection attempt. - * const asio::error_code& error, - * - * // On success, an iterator denoting the successfully - * // connected endpoint. Otherwise, the end iterator. - * Iterator iterator - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * The following connect condition function object can be used to output - * information about the individual connection attempts: - * @code struct my_connect_condition - * { - * bool operator()( - * const asio::error_code& ec, - * const::tcp::endpoint& next) - * { - * if (ec) std::cout << "Error: " << ec.message() << std::endl; - * std::cout << "Trying: " << next << std::endl; - * return true; - * } - * }; @endcode - * It would be used with the asio::connect function as follows: - * @code tcp::resolver r(io_context); - * tcp::resolver::query q("host", "service"); - * tcp::socket s(io_context); - * - * // ... - * - * r.async_resolve(q, resolve_handler); - * - * // ... - * - * void resolve_handler( - * const asio::error_code& ec, - * tcp::resolver::iterator i) - * { - * if (!ec) - * { - * tcp::resolver::iterator end; - * asio::async_connect(s, i, end, - * my_connect_condition(), - * connect_handler); - * } - * } - * - * // ... - * - * void connect_handler( - * const asio::error_code& ec, - * tcp::resolver::iterator i) - * { - * if (ec) - * { - * // An error occurred. - * } - * else - * { - * std::cout << "Connected to: " << i->endpoint() << std::endl; - * } - * } @endcode - */ -template -ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler, - void (asio::error_code, Iterator)) -async_connect(basic_socket& s, - Iterator begin, Iterator end, ConnectCondition connect_condition, - ASIO_MOVE_ARG(IteratorConnectHandler) handler); - -/*@}*/ - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/impl/connect.hpp" - -#endif diff --git a/tools/sdk/include/asio/asio/coroutine.hpp b/tools/sdk/include/asio/asio/coroutine.hpp deleted file mode 100644 index cd2d99e536a..00000000000 --- a/tools/sdk/include/asio/asio/coroutine.hpp +++ /dev/null @@ -1,328 +0,0 @@ -// -// coroutine.hpp -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_COROUTINE_HPP -#define ASIO_COROUTINE_HPP - -namespace asio { -namespace detail { - -class coroutine_ref; - -} // namespace detail - -/// Provides support for implementing stackless coroutines. -/** - * The @c coroutine class may be used to implement stackless coroutines. The - * class itself is used to store the current state of the coroutine. - * - * Coroutines are copy-constructible and assignable, and the space overhead is - * a single int. They can be used as a base class: - * - * @code class session : coroutine - * { - * ... - * }; @endcode - * - * or as a data member: - * - * @code class session - * { - * ... - * coroutine coro_; - * }; @endcode - * - * or even bound in as a function argument using lambdas or @c bind(). The - * important thing is that as the application maintains a copy of the object - * for as long as the coroutine must be kept alive. - * - * @par Pseudo-keywords - * - * A coroutine is used in conjunction with certain "pseudo-keywords", which - * are implemented as macros. These macros are defined by a header file: - * - * @code #include @endcode - * - * and may conversely be undefined as follows: - * - * @code #include @endcode - * - * reenter - * - * The @c reenter macro is used to define the body of a coroutine. It takes a - * single argument: a pointer or reference to a coroutine object. For example, - * if the base class is a coroutine object you may write: - * - * @code reenter (this) - * { - * ... coroutine body ... - * } @endcode - * - * and if a data member or other variable you can write: - * - * @code reenter (coro_) - * { - * ... coroutine body ... - * } @endcode - * - * When @c reenter is executed at runtime, control jumps to the location of the - * last @c yield or @c fork. - * - * The coroutine body may also be a single statement, such as: - * - * @code reenter (this) for (;;) - * { - * ... - * } @endcode - * - * @b Limitation: The @c reenter macro is implemented using a switch. This - * means that you must take care when using local variables within the - * coroutine body. The local variable is not allowed in a position where - * reentering the coroutine could bypass the variable definition. - * - * yield statement - * - * This form of the @c yield keyword is often used with asynchronous operations: - * - * @code yield socket_->async_read_some(buffer(*buffer_), *this); @endcode - * - * This divides into four logical steps: - * - * @li @c yield saves the current state of the coroutine. - * @li The statement initiates the asynchronous operation. - * @li The resume point is defined immediately following the statement. - * @li Control is transferred to the end of the coroutine body. - * - * When the asynchronous operation completes, the function object is invoked - * and @c reenter causes control to transfer to the resume point. It is - * important to remember to carry the coroutine state forward with the - * asynchronous operation. In the above snippet, the current class is a - * function object object with a coroutine object as base class or data member. - * - * The statement may also be a compound statement, and this permits us to - * define local variables with limited scope: - * - * @code yield - * { - * mutable_buffers_1 b = buffer(*buffer_); - * socket_->async_read_some(b, *this); - * } @endcode - * - * yield return expression ; - * - * This form of @c yield is often used in generators or coroutine-based parsers. - * For example, the function object: - * - * @code struct interleave : coroutine - * { - * istream& is1; - * istream& is2; - * char operator()(char c) - * { - * reenter (this) for (;;) - * { - * yield return is1.get(); - * yield return is2.get(); - * } - * } - * }; @endcode - * - * defines a trivial coroutine that interleaves the characters from two input - * streams. - * - * This type of @c yield divides into three logical steps: - * - * @li @c yield saves the current state of the coroutine. - * @li The resume point is defined immediately following the semicolon. - * @li The value of the expression is returned from the function. - * - * yield ; - * - * This form of @c yield is equivalent to the following steps: - * - * @li @c yield saves the current state of the coroutine. - * @li The resume point is defined immediately following the semicolon. - * @li Control is transferred to the end of the coroutine body. - * - * This form might be applied when coroutines are used for cooperative - * threading and scheduling is explicitly managed. For example: - * - * @code struct task : coroutine - * { - * ... - * void operator()() - * { - * reenter (this) - * { - * while (... not finished ...) - * { - * ... do something ... - * yield; - * ... do some more ... - * yield; - * } - * } - * } - * ... - * }; - * ... - * task t1, t2; - * for (;;) - * { - * t1(); - * t2(); - * } @endcode - * - * yield break ; - * - * The final form of @c yield is used to explicitly terminate the coroutine. - * This form is comprised of two steps: - * - * @li @c yield sets the coroutine state to indicate termination. - * @li Control is transferred to the end of the coroutine body. - * - * Once terminated, calls to is_complete() return true and the coroutine cannot - * be reentered. - * - * Note that a coroutine may also be implicitly terminated if the coroutine - * body is exited without a yield, e.g. by return, throw or by running to the - * end of the body. - * - * fork statement - * - * The @c fork pseudo-keyword is used when "forking" a coroutine, i.e. splitting - * it into two (or more) copies. One use of @c fork is in a server, where a new - * coroutine is created to handle each client connection: - * - * @code reenter (this) - * { - * do - * { - * socket_.reset(new tcp::socket(io_context_)); - * yield acceptor->async_accept(*socket_, *this); - * fork server(*this)(); - * } while (is_parent()); - * ... client-specific handling follows ... - * } @endcode - * - * The logical steps involved in a @c fork are: - * - * @li @c fork saves the current state of the coroutine. - * @li The statement creates a copy of the coroutine and either executes it - * immediately or schedules it for later execution. - * @li The resume point is defined immediately following the semicolon. - * @li For the "parent", control immediately continues from the next line. - * - * The functions is_parent() and is_child() can be used to differentiate - * between parent and child. You would use these functions to alter subsequent - * control flow. - * - * Note that @c fork doesn't do the actual forking by itself. It is the - * application's responsibility to create a clone of the coroutine and call it. - * The clone can be called immediately, as above, or scheduled for delayed - * execution using something like io_context::post(). - * - * @par Alternate macro names - * - * If preferred, an application can use macro names that follow a more typical - * naming convention, rather than the pseudo-keywords. These are: - * - * @li @c ASIO_CORO_REENTER instead of @c reenter - * @li @c ASIO_CORO_YIELD instead of @c yield - * @li @c ASIO_CORO_FORK instead of @c fork - */ -class coroutine -{ -public: - /// Constructs a coroutine in its initial state. - coroutine() : value_(0) {} - - /// Returns true if the coroutine is the child of a fork. - bool is_child() const { return value_ < 0; } - - /// Returns true if the coroutine is the parent of a fork. - bool is_parent() const { return !is_child(); } - - /// Returns true if the coroutine has reached its terminal state. - bool is_complete() const { return value_ == -1; } - -private: - friend class detail::coroutine_ref; - int value_; -}; - - -namespace detail { - -class coroutine_ref -{ -public: - coroutine_ref(coroutine& c) : value_(c.value_), modified_(false) {} - coroutine_ref(coroutine* c) : value_(c->value_), modified_(false) {} - ~coroutine_ref() { if (!modified_) value_ = -1; } - operator int() const { return value_; } - int& operator=(int v) { modified_ = true; return value_ = v; } -private: - void operator=(const coroutine_ref&); - int& value_; - bool modified_; -}; - -} // namespace detail -} // namespace asio - -#define ASIO_CORO_REENTER(c) \ - switch (::asio::detail::coroutine_ref _coro_value = c) \ - case -1: if (_coro_value) \ - { \ - goto terminate_coroutine; \ - terminate_coroutine: \ - _coro_value = -1; \ - goto bail_out_of_coroutine; \ - bail_out_of_coroutine: \ - break; \ - } \ - else /* fall-through */ case 0: - -#define ASIO_CORO_YIELD_IMPL(n) \ - for (_coro_value = (n);;) \ - if (_coro_value == 0) \ - { \ - case (n): ; \ - break; \ - } \ - else \ - switch (_coro_value ? 0 : 1) \ - for (;;) \ - /* fall-through */ case -1: if (_coro_value) \ - goto terminate_coroutine; \ - else for (;;) \ - /* fall-through */ case 1: if (_coro_value) \ - goto bail_out_of_coroutine; \ - else /* fall-through */ case 0: - -#define ASIO_CORO_FORK_IMPL(n) \ - for (_coro_value = -(n);; _coro_value = (n)) \ - if (_coro_value == (n)) \ - { \ - case -(n): ; \ - break; \ - } \ - else - -#if defined(_MSC_VER) -# define ASIO_CORO_YIELD ASIO_CORO_YIELD_IMPL(__COUNTER__ + 1) -# define ASIO_CORO_FORK ASIO_CORO_FORK_IMPL(__COUNTER__ + 1) -#else // defined(_MSC_VER) -# define ASIO_CORO_YIELD ASIO_CORO_YIELD_IMPL(__LINE__) -# define ASIO_CORO_FORK ASIO_CORO_FORK_IMPL(__LINE__) -#endif // defined(_MSC_VER) - -#endif // ASIO_COROUTINE_HPP diff --git a/tools/sdk/include/asio/asio/datagram_socket_service.hpp b/tools/sdk/include/asio/asio/datagram_socket_service.hpp deleted file mode 100644 index 7dc1a3b34a7..00000000000 --- a/tools/sdk/include/asio/asio/datagram_socket_service.hpp +++ /dev/null @@ -1,466 +0,0 @@ -// -// datagram_socket_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DATAGRAM_SOCKET_SERVICE_HPP -#define ASIO_DATAGRAM_SOCKET_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) - -#include -#include "asio/async_result.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" - -#if defined(ASIO_WINDOWS_RUNTIME) -# include "asio/detail/null_socket_service.hpp" -#elif defined(ASIO_HAS_IOCP) -# include "asio/detail/win_iocp_socket_service.hpp" -#else -# include "asio/detail/reactive_socket_service.hpp" -#endif - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Default service implementation for a datagram socket. -template -class datagram_socket_service -#if defined(GENERATING_DOCUMENTATION) - : public asio::io_context::service -#else - : public asio::detail::service_base > -#endif -{ -public: -#if defined(GENERATING_DOCUMENTATION) - /// The unique service identifier. - static asio::io_context::id id; -#endif - - /// The protocol type. - typedef Protocol protocol_type; - - /// The endpoint type. - typedef typename Protocol::endpoint endpoint_type; - -private: - // The type of the platform-specific implementation. -#if defined(ASIO_WINDOWS_RUNTIME) - typedef detail::null_socket_service service_impl_type; -#elif defined(ASIO_HAS_IOCP) - typedef detail::win_iocp_socket_service service_impl_type; -#else - typedef detail::reactive_socket_service service_impl_type; -#endif - -public: - /// The type of a datagram socket. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined implementation_type; -#else - typedef typename service_impl_type::implementation_type implementation_type; -#endif - - /// The native socket type. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined native_handle_type; -#else - typedef typename service_impl_type::native_handle_type native_handle_type; -#endif - - /// Construct a new datagram socket service for the specified io_context. - explicit datagram_socket_service(asio::io_context& io_context) - : asio::detail::service_base< - datagram_socket_service >(io_context), - service_impl_(io_context) - { - } - - /// Construct a new datagram socket implementation. - void construct(implementation_type& impl) - { - service_impl_.construct(impl); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a new datagram socket implementation. - void move_construct(implementation_type& impl, - implementation_type& other_impl) - { - service_impl_.move_construct(impl, other_impl); - } - - /// Move-assign from another datagram socket implementation. - void move_assign(implementation_type& impl, - datagram_socket_service& other_service, - implementation_type& other_impl) - { - service_impl_.move_assign(impl, other_service.service_impl_, other_impl); - } - - // All socket services have access to each other's implementations. - template friend class datagram_socket_service; - - /// Move-construct a new datagram socket implementation from another protocol - /// type. - template - void converting_move_construct(implementation_type& impl, - datagram_socket_service& other_service, - typename datagram_socket_service< - Protocol1>::implementation_type& other_impl, - typename enable_if::value>::type* = 0) - { - service_impl_.template converting_move_construct( - impl, other_service.service_impl_, other_impl); - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destroy a datagram socket implementation. - void destroy(implementation_type& impl) - { - service_impl_.destroy(impl); - } - - // Open a new datagram socket implementation. - ASIO_SYNC_OP_VOID open(implementation_type& impl, - const protocol_type& protocol, asio::error_code& ec) - { - if (protocol.type() == ASIO_OS_DEF(SOCK_DGRAM)) - service_impl_.open(impl, protocol, ec); - else - ec = asio::error::invalid_argument; - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Assign an existing native socket to a datagram socket. - ASIO_SYNC_OP_VOID assign(implementation_type& impl, - const protocol_type& protocol, const native_handle_type& native_socket, - asio::error_code& ec) - { - service_impl_.assign(impl, protocol, native_socket, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Determine whether the socket is open. - bool is_open(const implementation_type& impl) const - { - return service_impl_.is_open(impl); - } - - /// Close a datagram socket implementation. - ASIO_SYNC_OP_VOID close(implementation_type& impl, - asio::error_code& ec) - { - service_impl_.close(impl, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Release ownership of the underlying socket. - native_handle_type release(implementation_type& impl, - asio::error_code& ec) - { - return service_impl_.release(impl, ec); - } - - /// Get the native socket implementation. - native_handle_type native_handle(implementation_type& impl) - { - return service_impl_.native_handle(impl); - } - - /// Cancel all asynchronous operations associated with the socket. - ASIO_SYNC_OP_VOID cancel(implementation_type& impl, - asio::error_code& ec) - { - service_impl_.cancel(impl, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Determine whether the socket is at the out-of-band data mark. - bool at_mark(const implementation_type& impl, - asio::error_code& ec) const - { - return service_impl_.at_mark(impl, ec); - } - - /// Determine the number of bytes available for reading. - std::size_t available(const implementation_type& impl, - asio::error_code& ec) const - { - return service_impl_.available(impl, ec); - } - - // Bind the datagram socket to the specified local endpoint. - ASIO_SYNC_OP_VOID bind(implementation_type& impl, - const endpoint_type& endpoint, asio::error_code& ec) - { - service_impl_.bind(impl, endpoint, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Connect the datagram socket to the specified endpoint. - ASIO_SYNC_OP_VOID connect(implementation_type& impl, - const endpoint_type& peer_endpoint, asio::error_code& ec) - { - service_impl_.connect(impl, peer_endpoint, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Start an asynchronous connect. - template - ASIO_INITFN_RESULT_TYPE(ConnectHandler, - void (asio::error_code)) - async_connect(implementation_type& impl, - const endpoint_type& peer_endpoint, - ASIO_MOVE_ARG(ConnectHandler) handler) - { - async_completion init(handler); - - service_impl_.async_connect(impl, peer_endpoint, init.completion_handler); - - return init.result.get(); - } - - /// Set a socket option. - template - ASIO_SYNC_OP_VOID set_option(implementation_type& impl, - const SettableSocketOption& option, asio::error_code& ec) - { - service_impl_.set_option(impl, option, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get a socket option. - template - ASIO_SYNC_OP_VOID get_option(const implementation_type& impl, - GettableSocketOption& option, asio::error_code& ec) const - { - service_impl_.get_option(impl, option, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Perform an IO control command on the socket. - template - ASIO_SYNC_OP_VOID io_control(implementation_type& impl, - IoControlCommand& command, asio::error_code& ec) - { - service_impl_.io_control(impl, command, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Gets the non-blocking mode of the socket. - bool non_blocking(const implementation_type& impl) const - { - return service_impl_.non_blocking(impl); - } - - /// Sets the non-blocking mode of the socket. - ASIO_SYNC_OP_VOID non_blocking(implementation_type& impl, - bool mode, asio::error_code& ec) - { - service_impl_.non_blocking(impl, mode, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Gets the non-blocking mode of the native socket implementation. - bool native_non_blocking(const implementation_type& impl) const - { - return service_impl_.native_non_blocking(impl); - } - - /// Sets the non-blocking mode of the native socket implementation. - ASIO_SYNC_OP_VOID native_non_blocking(implementation_type& impl, - bool mode, asio::error_code& ec) - { - service_impl_.native_non_blocking(impl, mode, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get the local endpoint. - endpoint_type local_endpoint(const implementation_type& impl, - asio::error_code& ec) const - { - return service_impl_.local_endpoint(impl, ec); - } - - /// Get the remote endpoint. - endpoint_type remote_endpoint(const implementation_type& impl, - asio::error_code& ec) const - { - return service_impl_.remote_endpoint(impl, ec); - } - - /// Disable sends or receives on the socket. - ASIO_SYNC_OP_VOID shutdown(implementation_type& impl, - socket_base::shutdown_type what, asio::error_code& ec) - { - service_impl_.shutdown(impl, what, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Wait for the socket to become ready to read, ready to write, or to have - /// pending error conditions. - ASIO_SYNC_OP_VOID wait(implementation_type& impl, - socket_base::wait_type w, asio::error_code& ec) - { - service_impl_.wait(impl, w, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Asynchronously wait for the socket to become ready to read, ready to - /// write, or to have pending error conditions. - template - ASIO_INITFN_RESULT_TYPE(WaitHandler, - void (asio::error_code)) - async_wait(implementation_type& impl, socket_base::wait_type w, - ASIO_MOVE_ARG(WaitHandler) handler) - { - async_completion init(handler); - - service_impl_.async_wait(impl, w, init.completion_handler); - - return init.result.get(); - } - - /// Send the given data to the peer. - template - std::size_t send(implementation_type& impl, - const ConstBufferSequence& buffers, - socket_base::message_flags flags, asio::error_code& ec) - { - return service_impl_.send(impl, buffers, flags, ec); - } - - /// Start an asynchronous send. - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_send(implementation_type& impl, const ConstBufferSequence& buffers, - socket_base::message_flags flags, - ASIO_MOVE_ARG(WriteHandler) handler) - { - async_completion init(handler); - - service_impl_.async_send(impl, buffers, flags, init.completion_handler); - - return init.result.get(); - } - - /// Send a datagram to the specified endpoint. - template - std::size_t send_to(implementation_type& impl, - const ConstBufferSequence& buffers, const endpoint_type& destination, - socket_base::message_flags flags, asio::error_code& ec) - { - return service_impl_.send_to(impl, buffers, destination, flags, ec); - } - - /// Start an asynchronous send. - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_send_to(implementation_type& impl, - const ConstBufferSequence& buffers, const endpoint_type& destination, - socket_base::message_flags flags, - ASIO_MOVE_ARG(WriteHandler) handler) - { - async_completion init(handler); - - service_impl_.async_send_to(impl, buffers, - destination, flags, init.completion_handler); - - return init.result.get(); - } - - /// Receive some data from the peer. - template - std::size_t receive(implementation_type& impl, - const MutableBufferSequence& buffers, - socket_base::message_flags flags, asio::error_code& ec) - { - return service_impl_.receive(impl, buffers, flags, ec); - } - - /// Start an asynchronous receive. - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_receive(implementation_type& impl, - const MutableBufferSequence& buffers, - socket_base::message_flags flags, - ASIO_MOVE_ARG(ReadHandler) handler) - { - async_completion init(handler); - - service_impl_.async_receive(impl, buffers, flags, init.completion_handler); - - return init.result.get(); - } - - /// Receive a datagram with the endpoint of the sender. - template - std::size_t receive_from(implementation_type& impl, - const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, - socket_base::message_flags flags, asio::error_code& ec) - { - return service_impl_.receive_from(impl, buffers, sender_endpoint, flags, - ec); - } - - /// Start an asynchronous receive that will get the endpoint of the sender. - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_receive_from(implementation_type& impl, - const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, - socket_base::message_flags flags, - ASIO_MOVE_ARG(ReadHandler) handler) - { - async_completion init(handler); - - service_impl_.async_receive_from(impl, buffers, - sender_endpoint, flags, init.completion_handler); - - return init.result.get(); - } - -private: - // Destroy all user-defined handler objects owned by the service. - void shutdown() - { - service_impl_.shutdown(); - } - - // The platform-specific implementation. - service_impl_type service_impl_; -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_DATAGRAM_SOCKET_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/deadline_timer.hpp b/tools/sdk/include/asio/asio/deadline_timer.hpp deleted file mode 100644 index 5a2155474a5..00000000000 --- a/tools/sdk/include/asio/asio/deadline_timer.hpp +++ /dev/null @@ -1,38 +0,0 @@ -// -// deadline_timer.hpp -// ~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DEADLINE_TIMER_HPP -#define ASIO_DEADLINE_TIMER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_BOOST_DATE_TIME) \ - || defined(GENERATING_DOCUMENTATION) - -#include "asio/detail/socket_types.hpp" // Must come before posix_time. -#include "asio/basic_deadline_timer.hpp" - -#include - -namespace asio { - -/// Typedef for the typical usage of timer. Uses a UTC clock. -typedef basic_deadline_timer deadline_timer; - -} // namespace asio - -#endif // defined(ASIO_HAS_BOOST_DATE_TIME) - // || defined(GENERATING_DOCUMENTATION) - -#endif // ASIO_DEADLINE_TIMER_HPP diff --git a/tools/sdk/include/asio/asio/deadline_timer_service.hpp b/tools/sdk/include/asio/asio/deadline_timer_service.hpp deleted file mode 100644 index 2dcc83e2f92..00000000000 --- a/tools/sdk/include/asio/asio/deadline_timer_service.hpp +++ /dev/null @@ -1,173 +0,0 @@ -// -// deadline_timer_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DEADLINE_TIMER_SERVICE_HPP -#define ASIO_DEADLINE_TIMER_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) - -#if defined(ASIO_HAS_BOOST_DATE_TIME) \ - || defined(GENERATING_DOCUMENTATION) - -#include -#include "asio/async_result.hpp" -#include "asio/detail/deadline_timer_service.hpp" -#include "asio/io_context.hpp" -#include "asio/time_traits.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Default service implementation for a timer. -template > -class deadline_timer_service -#if defined(GENERATING_DOCUMENTATION) - : public asio::io_context::service -#else - : public asio::detail::service_base< - deadline_timer_service > -#endif -{ -public: -#if defined(GENERATING_DOCUMENTATION) - /// The unique service identifier. - static asio::io_context::id id; -#endif - - /// The time traits type. - typedef TimeTraits traits_type; - - /// The time type. - typedef typename traits_type::time_type time_type; - - /// The duration type. - typedef typename traits_type::duration_type duration_type; - -private: - // The type of the platform-specific implementation. - typedef detail::deadline_timer_service service_impl_type; - -public: - /// The implementation type of the deadline timer. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined implementation_type; -#else - typedef typename service_impl_type::implementation_type implementation_type; -#endif - - /// Construct a new timer service for the specified io_context. - explicit deadline_timer_service(asio::io_context& io_context) - : asio::detail::service_base< - deadline_timer_service >(io_context), - service_impl_(io_context) - { - } - - /// Construct a new timer implementation. - void construct(implementation_type& impl) - { - service_impl_.construct(impl); - } - - /// Destroy a timer implementation. - void destroy(implementation_type& impl) - { - service_impl_.destroy(impl); - } - - /// Cancel any asynchronous wait operations associated with the timer. - std::size_t cancel(implementation_type& impl, asio::error_code& ec) - { - return service_impl_.cancel(impl, ec); - } - - /// Cancels one asynchronous wait operation associated with the timer. - std::size_t cancel_one(implementation_type& impl, - asio::error_code& ec) - { - return service_impl_.cancel_one(impl, ec); - } - - /// Get the expiry time for the timer as an absolute time. - time_type expires_at(const implementation_type& impl) const - { - return service_impl_.expiry(impl); - } - - /// Set the expiry time for the timer as an absolute time. - std::size_t expires_at(implementation_type& impl, - const time_type& expiry_time, asio::error_code& ec) - { - return service_impl_.expires_at(impl, expiry_time, ec); - } - - /// Get the expiry time for the timer relative to now. - duration_type expires_from_now(const implementation_type& impl) const - { - return TimeTraits::subtract(service_impl_.expiry(impl), TimeTraits::now()); - } - - /// Set the expiry time for the timer relative to now. - std::size_t expires_from_now(implementation_type& impl, - const duration_type& expiry_time, asio::error_code& ec) - { - return service_impl_.expires_after(impl, expiry_time, ec); - } - - // Perform a blocking wait on the timer. - void wait(implementation_type& impl, asio::error_code& ec) - { - service_impl_.wait(impl, ec); - } - - // Start an asynchronous wait on the timer. - template - ASIO_INITFN_RESULT_TYPE(WaitHandler, - void (asio::error_code)) - async_wait(implementation_type& impl, - ASIO_MOVE_ARG(WaitHandler) handler) - { - async_completion init(handler); - - service_impl_.async_wait(impl, init.completion_handler); - - return init.result.get(); - } - -private: - // Destroy all user-defined handler objects owned by the service. - void shutdown() - { - service_impl_.shutdown(); - } - - // The platform-specific implementation. - service_impl_type service_impl_; -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_BOOST_DATE_TIME) - // || defined(GENERATING_DOCUMENTATION) - -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_DEADLINE_TIMER_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/defer.hpp b/tools/sdk/include/asio/asio/defer.hpp deleted file mode 100644 index a0897f2f83f..00000000000 --- a/tools/sdk/include/asio/asio/defer.hpp +++ /dev/null @@ -1,107 +0,0 @@ -// -// defer.hpp -// ~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DEFER_HPP -#define ASIO_DEFER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/async_result.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/execution_context.hpp" -#include "asio/is_executor.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Submits a completion token or function object for execution. -/** - * This function submits an object for execution using the object's associated - * executor. The function object is queued for execution, and is never called - * from the current thread prior to returning from defer(). - * - * This function has the following effects: - * - * @li Constructs a function object handler of type @c Handler, initialized - * with handler(forward(token)). - * - * @li Constructs an object @c result of type async_result, - * initializing the object as result(handler). - * - * @li Obtains the handler's associated executor object @c ex by performing - * get_associated_executor(handler). - * - * @li Obtains the handler's associated allocator object @c alloc by performing - * get_associated_allocator(handler). - * - * @li Performs ex.defer(std::move(handler), alloc). - * - * @li Returns result.get(). - */ -template -ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) defer( - ASIO_MOVE_ARG(CompletionToken) token); - -/// Submits a completion token or function object for execution. -/** - * This function submits an object for execution using the specified executor. - * The function object is queued for execution, and is never called from the - * current thread prior to returning from defer(). - * - * This function has the following effects: - * - * @li Constructs a function object handler of type @c Handler, initialized - * with handler(forward(token)). - * - * @li Constructs an object @c result of type async_result, - * initializing the object as result(handler). - * - * @li Obtains the handler's associated executor object @c ex1 by performing - * get_associated_executor(handler). - * - * @li Creates a work object @c w by performing make_work(ex1). - * - * @li Obtains the handler's associated allocator object @c alloc by performing - * get_associated_allocator(handler). - * - * @li Constructs a function object @c f with a function call operator that - * performs ex1.dispatch(std::move(handler), alloc) followed by - * w.reset(). - * - * @li Performs Executor(ex).defer(std::move(f), alloc). - * - * @li Returns result.get(). - */ -template -ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) defer( - const Executor& ex, ASIO_MOVE_ARG(CompletionToken) token, - typename enable_if::value>::type* = 0); - -/// Submits a completion token or function object for execution. -/** - * @returns defer(ctx.get_executor(), forward(token)). - */ -template -ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) defer( - ExecutionContext& ctx, ASIO_MOVE_ARG(CompletionToken) token, - typename enable_if::value>::type* = 0); - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/impl/defer.hpp" - -#endif // ASIO_DEFER_HPP diff --git a/tools/sdk/include/asio/asio/detail/array.hpp b/tools/sdk/include/asio/asio/detail/array.hpp deleted file mode 100644 index ba4297462ca..00000000000 --- a/tools/sdk/include/asio/asio/detail/array.hpp +++ /dev/null @@ -1,38 +0,0 @@ -// -// detail/array.hpp -// ~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_ARRAY_HPP -#define ASIO_DETAIL_ARRAY_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_STD_ARRAY) -# include -#else // defined(ASIO_HAS_STD_ARRAY) -# include -#endif // defined(ASIO_HAS_STD_ARRAY) - -namespace asio { -namespace detail { - -#if defined(ASIO_HAS_STD_ARRAY) -using std::array; -#else // defined(ASIO_HAS_STD_ARRAY) -using boost::array; -#endif // defined(ASIO_HAS_STD_ARRAY) - -} // namespace detail -} // namespace asio - -#endif // ASIO_DETAIL_ARRAY_HPP diff --git a/tools/sdk/include/asio/asio/detail/array_fwd.hpp b/tools/sdk/include/asio/asio/detail/array_fwd.hpp deleted file mode 100644 index 4161db0dbde..00000000000 --- a/tools/sdk/include/asio/asio/detail/array_fwd.hpp +++ /dev/null @@ -1,34 +0,0 @@ -// -// detail/array_fwd.hpp -// ~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_ARRAY_FWD_HPP -#define ASIO_DETAIL_ARRAY_FWD_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -namespace boost { - -template -class array; - -} // namespace boost - -// Standard library components can't be forward declared, so we'll have to -// include the array header. Fortunately, it's fairly lightweight and doesn't -// add significantly to the compile time. -#if defined(ASIO_HAS_STD_ARRAY) -# include -#endif // defined(ASIO_HAS_STD_ARRAY) - -#endif // ASIO_DETAIL_ARRAY_FWD_HPP diff --git a/tools/sdk/include/asio/asio/detail/assert.hpp b/tools/sdk/include/asio/asio/detail/assert.hpp deleted file mode 100644 index a952a441f2c..00000000000 --- a/tools/sdk/include/asio/asio/detail/assert.hpp +++ /dev/null @@ -1,32 +0,0 @@ -// -// detail/assert.hpp -// ~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_ASSERT_HPP -#define ASIO_DETAIL_ASSERT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_BOOST_ASSERT) -# include -#else // defined(ASIO_HAS_BOOST_ASSERT) -# include -#endif // defined(ASIO_HAS_BOOST_ASSERT) - -#if defined(ASIO_HAS_BOOST_ASSERT) -# define ASIO_ASSERT(expr) BOOST_ASSERT(expr) -#else // defined(ASIO_HAS_BOOST_ASSERT) -# define ASIO_ASSERT(expr) assert(expr) -#endif // defined(ASIO_HAS_BOOST_ASSERT) - -#endif // ASIO_DETAIL_ASSERT_HPP diff --git a/tools/sdk/include/asio/asio/detail/atomic_count.hpp b/tools/sdk/include/asio/asio/detail/atomic_count.hpp deleted file mode 100644 index 2bf75a5355e..00000000000 --- a/tools/sdk/include/asio/asio/detail/atomic_count.hpp +++ /dev/null @@ -1,45 +0,0 @@ -// -// detail/atomic_count.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_ATOMIC_COUNT_HPP -#define ASIO_DETAIL_ATOMIC_COUNT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_HAS_THREADS) -// Nothing to include. -#elif defined(ASIO_HAS_STD_ATOMIC) -# include -#else // defined(ASIO_HAS_STD_ATOMIC) -# include -#endif // defined(ASIO_HAS_STD_ATOMIC) - -namespace asio { -namespace detail { - -#if !defined(ASIO_HAS_THREADS) -typedef long atomic_count; -inline void increment(atomic_count& a, long b) { a += b; } -#elif defined(ASIO_HAS_STD_ATOMIC) -typedef std::atomic atomic_count; -inline void increment(atomic_count& a, long b) { a += b; } -#else // defined(ASIO_HAS_STD_ATOMIC) -typedef boost::detail::atomic_count atomic_count; -inline void increment(atomic_count& a, long b) { while (b > 0) ++a, --b; } -#endif // defined(ASIO_HAS_STD_ATOMIC) - -} // namespace detail -} // namespace asio - -#endif // ASIO_DETAIL_ATOMIC_COUNT_HPP diff --git a/tools/sdk/include/asio/asio/detail/base_from_completion_cond.hpp b/tools/sdk/include/asio/asio/detail/base_from_completion_cond.hpp deleted file mode 100644 index 73b4a957f3a..00000000000 --- a/tools/sdk/include/asio/asio/detail/base_from_completion_cond.hpp +++ /dev/null @@ -1,68 +0,0 @@ -// -// detail/base_from_completion_cond.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_BASE_FROM_COMPLETION_COND_HPP -#define ASIO_DETAIL_BASE_FROM_COMPLETION_COND_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/completion_condition.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class base_from_completion_cond -{ -protected: - explicit base_from_completion_cond(CompletionCondition completion_condition) - : completion_condition_(completion_condition) - { - } - - std::size_t check_for_completion( - const asio::error_code& ec, - std::size_t total_transferred) - { - return detail::adapt_completion_condition_result( - completion_condition_(ec, total_transferred)); - } - -private: - CompletionCondition completion_condition_; -}; - -template <> -class base_from_completion_cond -{ -protected: - explicit base_from_completion_cond(transfer_all_t) - { - } - - static std::size_t check_for_completion( - const asio::error_code& ec, - std::size_t total_transferred) - { - return transfer_all_t()(ec, total_transferred); - } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_BASE_FROM_COMPLETION_COND_HPP diff --git a/tools/sdk/include/asio/asio/detail/bind_handler.hpp b/tools/sdk/include/asio/asio/detail/bind_handler.hpp deleted file mode 100644 index 0f4f066d837..00000000000 --- a/tools/sdk/include/asio/asio/detail/bind_handler.hpp +++ /dev/null @@ -1,816 +0,0 @@ -// -// detail/bind_handler.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_BIND_HANDLER_HPP -#define ASIO_DETAIL_BIND_HANDLER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/associated_allocator.hpp" -#include "asio/associated_executor.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_cont_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/type_traits.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class binder1 -{ -public: - template - binder1(int, ASIO_MOVE_ARG(T) handler, const Arg1& arg1) - : handler_(ASIO_MOVE_CAST(T)(handler)), - arg1_(arg1) - { - } - - binder1(Handler& handler, const Arg1& arg1) - : handler_(ASIO_MOVE_CAST(Handler)(handler)), - arg1_(arg1) - { - } - -#if defined(ASIO_HAS_MOVE) - binder1(const binder1& other) - : handler_(other.handler_), - arg1_(other.arg1_) - { - } - - binder1(binder1&& other) - : handler_(ASIO_MOVE_CAST(Handler)(other.handler_)), - arg1_(ASIO_MOVE_CAST(Arg1)(other.arg1_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()() - { - handler_(static_cast(arg1_)); - } - - void operator()() const - { - handler_(arg1_); - } - -//private: - Handler handler_; - Arg1 arg1_; -}; - -template -inline void* asio_handler_allocate(std::size_t size, - binder1* this_handler) -{ - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); -} - -template -inline void asio_handler_deallocate(void* pointer, std::size_t size, - binder1* this_handler) -{ - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); -} - -template -inline bool asio_handler_is_continuation( - binder1* this_handler) -{ - return asio_handler_cont_helpers::is_continuation( - this_handler->handler_); -} - -template -inline void asio_handler_invoke(Function& function, - binder1* this_handler) -{ - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); -} - -template -inline void asio_handler_invoke(const Function& function, - binder1* this_handler) -{ - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); -} - -template -inline binder1::type, Arg1> bind_handler( - ASIO_MOVE_ARG(Handler) handler, const Arg1& arg1) -{ - return binder1::type, Arg1>(0, - ASIO_MOVE_CAST(Handler)(handler), arg1); -} - -template -class binder2 -{ -public: - template - binder2(int, ASIO_MOVE_ARG(T) handler, - const Arg1& arg1, const Arg2& arg2) - : handler_(ASIO_MOVE_CAST(T)(handler)), - arg1_(arg1), - arg2_(arg2) - { - } - - binder2(Handler& handler, const Arg1& arg1, const Arg2& arg2) - : handler_(ASIO_MOVE_CAST(Handler)(handler)), - arg1_(arg1), - arg2_(arg2) - { - } - -#if defined(ASIO_HAS_MOVE) - binder2(const binder2& other) - : handler_(other.handler_), - arg1_(other.arg1_), - arg2_(other.arg2_) - { - } - - binder2(binder2&& other) - : handler_(ASIO_MOVE_CAST(Handler)(other.handler_)), - arg1_(ASIO_MOVE_CAST(Arg1)(other.arg1_)), - arg2_(ASIO_MOVE_CAST(Arg2)(other.arg2_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()() - { - handler_(static_cast(arg1_), - static_cast(arg2_)); - } - - void operator()() const - { - handler_(arg1_, arg2_); - } - -//private: - Handler handler_; - Arg1 arg1_; - Arg2 arg2_; -}; - -template -inline void* asio_handler_allocate(std::size_t size, - binder2* this_handler) -{ - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); -} - -template -inline void asio_handler_deallocate(void* pointer, std::size_t size, - binder2* this_handler) -{ - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); -} - -template -inline bool asio_handler_is_continuation( - binder2* this_handler) -{ - return asio_handler_cont_helpers::is_continuation( - this_handler->handler_); -} - -template -inline void asio_handler_invoke(Function& function, - binder2* this_handler) -{ - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); -} - -template -inline void asio_handler_invoke(const Function& function, - binder2* this_handler) -{ - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); -} - -template -inline binder2::type, Arg1, Arg2> bind_handler( - ASIO_MOVE_ARG(Handler) handler, const Arg1& arg1, const Arg2& arg2) -{ - return binder2::type, Arg1, Arg2>(0, - ASIO_MOVE_CAST(Handler)(handler), arg1, arg2); -} - -template -class binder3 -{ -public: - template - binder3(int, ASIO_MOVE_ARG(T) handler, const Arg1& arg1, - const Arg2& arg2, const Arg3& arg3) - : handler_(ASIO_MOVE_CAST(T)(handler)), - arg1_(arg1), - arg2_(arg2), - arg3_(arg3) - { - } - - binder3(Handler& handler, const Arg1& arg1, - const Arg2& arg2, const Arg3& arg3) - : handler_(ASIO_MOVE_CAST(Handler)(handler)), - arg1_(arg1), - arg2_(arg2), - arg3_(arg3) - { - } - -#if defined(ASIO_HAS_MOVE) - binder3(const binder3& other) - : handler_(other.handler_), - arg1_(other.arg1_), - arg2_(other.arg2_), - arg3_(other.arg3_) - { - } - - binder3(binder3&& other) - : handler_(ASIO_MOVE_CAST(Handler)(other.handler_)), - arg1_(ASIO_MOVE_CAST(Arg1)(other.arg1_)), - arg2_(ASIO_MOVE_CAST(Arg2)(other.arg2_)), - arg3_(ASIO_MOVE_CAST(Arg3)(other.arg3_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()() - { - handler_(static_cast(arg1_), - static_cast(arg2_), static_cast(arg3_)); - } - - void operator()() const - { - handler_(arg1_, arg2_, arg3_); - } - -//private: - Handler handler_; - Arg1 arg1_; - Arg2 arg2_; - Arg3 arg3_; -}; - -template -inline void* asio_handler_allocate(std::size_t size, - binder3* this_handler) -{ - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); -} - -template -inline void asio_handler_deallocate(void* pointer, std::size_t size, - binder3* this_handler) -{ - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); -} - -template -inline bool asio_handler_is_continuation( - binder3* this_handler) -{ - return asio_handler_cont_helpers::is_continuation( - this_handler->handler_); -} - -template -inline void asio_handler_invoke(Function& function, - binder3* this_handler) -{ - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); -} - -template -inline void asio_handler_invoke(const Function& function, - binder3* this_handler) -{ - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); -} - -template -inline binder3::type, Arg1, Arg2, Arg3> bind_handler( - ASIO_MOVE_ARG(Handler) handler, const Arg1& arg1, const Arg2& arg2, - const Arg3& arg3) -{ - return binder3::type, Arg1, Arg2, Arg3>(0, - ASIO_MOVE_CAST(Handler)(handler), arg1, arg2, arg3); -} - -template -class binder4 -{ -public: - template - binder4(int, ASIO_MOVE_ARG(T) handler, const Arg1& arg1, - const Arg2& arg2, const Arg3& arg3, const Arg4& arg4) - : handler_(ASIO_MOVE_CAST(T)(handler)), - arg1_(arg1), - arg2_(arg2), - arg3_(arg3), - arg4_(arg4) - { - } - - binder4(Handler& handler, const Arg1& arg1, - const Arg2& arg2, const Arg3& arg3, const Arg4& arg4) - : handler_(ASIO_MOVE_CAST(Handler)(handler)), - arg1_(arg1), - arg2_(arg2), - arg3_(arg3), - arg4_(arg4) - { - } - -#if defined(ASIO_HAS_MOVE) - binder4(const binder4& other) - : handler_(other.handler_), - arg1_(other.arg1_), - arg2_(other.arg2_), - arg3_(other.arg3_), - arg4_(other.arg4_) - { - } - - binder4(binder4&& other) - : handler_(ASIO_MOVE_CAST(Handler)(other.handler_)), - arg1_(ASIO_MOVE_CAST(Arg1)(other.arg1_)), - arg2_(ASIO_MOVE_CAST(Arg2)(other.arg2_)), - arg3_(ASIO_MOVE_CAST(Arg3)(other.arg3_)), - arg4_(ASIO_MOVE_CAST(Arg4)(other.arg4_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()() - { - handler_(static_cast(arg1_), - static_cast(arg2_), static_cast(arg3_), - static_cast(arg4_)); - } - - void operator()() const - { - handler_(arg1_, arg2_, arg3_, arg4_); - } - -//private: - Handler handler_; - Arg1 arg1_; - Arg2 arg2_; - Arg3 arg3_; - Arg4 arg4_; -}; - -template -inline void* asio_handler_allocate(std::size_t size, - binder4* this_handler) -{ - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); -} - -template -inline void asio_handler_deallocate(void* pointer, std::size_t size, - binder4* this_handler) -{ - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); -} - -template -inline bool asio_handler_is_continuation( - binder4* this_handler) -{ - return asio_handler_cont_helpers::is_continuation( - this_handler->handler_); -} - -template -inline void asio_handler_invoke(Function& function, - binder4* this_handler) -{ - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); -} - -template -inline void asio_handler_invoke(const Function& function, - binder4* this_handler) -{ - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); -} - -template -inline binder4::type, Arg1, Arg2, Arg3, Arg4> -bind_handler(ASIO_MOVE_ARG(Handler) handler, const Arg1& arg1, - const Arg2& arg2, const Arg3& arg3, const Arg4& arg4) -{ - return binder4::type, Arg1, Arg2, Arg3, Arg4>(0, - ASIO_MOVE_CAST(Handler)(handler), arg1, arg2, arg3, arg4); -} - -template -class binder5 -{ -public: - template - binder5(int, ASIO_MOVE_ARG(T) handler, const Arg1& arg1, - const Arg2& arg2, const Arg3& arg3, const Arg4& arg4, const Arg5& arg5) - : handler_(ASIO_MOVE_CAST(T)(handler)), - arg1_(arg1), - arg2_(arg2), - arg3_(arg3), - arg4_(arg4), - arg5_(arg5) - { - } - - binder5(Handler& handler, const Arg1& arg1, const Arg2& arg2, - const Arg3& arg3, const Arg4& arg4, const Arg5& arg5) - : handler_(ASIO_MOVE_CAST(Handler)(handler)), - arg1_(arg1), - arg2_(arg2), - arg3_(arg3), - arg4_(arg4), - arg5_(arg5) - { - } - -#if defined(ASIO_HAS_MOVE) - binder5(const binder5& other) - : handler_(other.handler_), - arg1_(other.arg1_), - arg2_(other.arg2_), - arg3_(other.arg3_), - arg4_(other.arg4_), - arg5_(other.arg5_) - { - } - - binder5(binder5&& other) - : handler_(ASIO_MOVE_CAST(Handler)(other.handler_)), - arg1_(ASIO_MOVE_CAST(Arg1)(other.arg1_)), - arg2_(ASIO_MOVE_CAST(Arg2)(other.arg2_)), - arg3_(ASIO_MOVE_CAST(Arg3)(other.arg3_)), - arg4_(ASIO_MOVE_CAST(Arg4)(other.arg4_)), - arg5_(ASIO_MOVE_CAST(Arg5)(other.arg5_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()() - { - handler_(static_cast(arg1_), - static_cast(arg2_), static_cast(arg3_), - static_cast(arg4_), static_cast(arg5_)); - } - - void operator()() const - { - handler_(arg1_, arg2_, arg3_, arg4_, arg5_); - } - -//private: - Handler handler_; - Arg1 arg1_; - Arg2 arg2_; - Arg3 arg3_; - Arg4 arg4_; - Arg5 arg5_; -}; - -template -inline void* asio_handler_allocate(std::size_t size, - binder5* this_handler) -{ - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); -} - -template -inline void asio_handler_deallocate(void* pointer, std::size_t size, - binder5* this_handler) -{ - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); -} - -template -inline bool asio_handler_is_continuation( - binder5* this_handler) -{ - return asio_handler_cont_helpers::is_continuation( - this_handler->handler_); -} - -template -inline void asio_handler_invoke(Function& function, - binder5* this_handler) -{ - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); -} - -template -inline void asio_handler_invoke(const Function& function, - binder5* this_handler) -{ - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); -} - -template -inline binder5::type, Arg1, Arg2, Arg3, Arg4, Arg5> -bind_handler(ASIO_MOVE_ARG(Handler) handler, const Arg1& arg1, - const Arg2& arg2, const Arg3& arg3, const Arg4& arg4, const Arg5& arg5) -{ - return binder5::type, Arg1, Arg2, Arg3, Arg4, Arg5>(0, - ASIO_MOVE_CAST(Handler)(handler), arg1, arg2, arg3, arg4, arg5); -} - -#if defined(ASIO_HAS_MOVE) - -template -class move_binder1 -{ -public: - move_binder1(int, ASIO_MOVE_ARG(Handler) handler, - ASIO_MOVE_ARG(Arg1) arg1) - : handler_(ASIO_MOVE_CAST(Handler)(handler)), - arg1_(ASIO_MOVE_CAST(Arg1)(arg1)) - { - } - - move_binder1(move_binder1&& other) - : handler_(ASIO_MOVE_CAST(Handler)(other.handler_)), - arg1_(ASIO_MOVE_CAST(Arg1)(other.arg1_)) - { - } - - void operator()() - { - handler_(ASIO_MOVE_CAST(Arg1)(arg1_)); - } - -//private: - Handler handler_; - Arg1 arg1_; -}; - -template -inline void* asio_handler_allocate(std::size_t size, - move_binder1* this_handler) -{ - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); -} - -template -inline void asio_handler_deallocate(void* pointer, std::size_t size, - move_binder1* this_handler) -{ - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); -} - -template -inline bool asio_handler_is_continuation( - move_binder1* this_handler) -{ - return asio_handler_cont_helpers::is_continuation( - this_handler->handler_); -} - -template -inline void asio_handler_invoke(ASIO_MOVE_ARG(Function) function, - move_binder1* this_handler) -{ - asio_handler_invoke_helpers::invoke( - ASIO_MOVE_CAST(Function)(function), this_handler->handler_); -} - -template -class move_binder2 -{ -public: - move_binder2(int, ASIO_MOVE_ARG(Handler) handler, - const Arg1& arg1, ASIO_MOVE_ARG(Arg2) arg2) - : handler_(ASIO_MOVE_CAST(Handler)(handler)), - arg1_(arg1), - arg2_(ASIO_MOVE_CAST(Arg2)(arg2)) - { - } - - move_binder2(move_binder2&& other) - : handler_(ASIO_MOVE_CAST(Handler)(other.handler_)), - arg1_(ASIO_MOVE_CAST(Arg1)(other.arg1_)), - arg2_(ASIO_MOVE_CAST(Arg2)(other.arg2_)) - { - } - - void operator()() - { - handler_(static_cast(arg1_), - ASIO_MOVE_CAST(Arg2)(arg2_)); - } - -//private: - Handler handler_; - Arg1 arg1_; - Arg2 arg2_; -}; - -template -inline void* asio_handler_allocate(std::size_t size, - move_binder2* this_handler) -{ - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); -} - -template -inline void asio_handler_deallocate(void* pointer, std::size_t size, - move_binder2* this_handler) -{ - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); -} - -template -inline bool asio_handler_is_continuation( - move_binder2* this_handler) -{ - return asio_handler_cont_helpers::is_continuation( - this_handler->handler_); -} - -template -inline void asio_handler_invoke(ASIO_MOVE_ARG(Function) function, - move_binder2* this_handler) -{ - asio_handler_invoke_helpers::invoke( - ASIO_MOVE_CAST(Function)(function), this_handler->handler_); -} - -#endif // defined(ASIO_HAS_MOVE) - -} // namespace detail - -template -struct associated_allocator, Allocator> -{ - typedef typename associated_allocator::type type; - - static type get(const detail::binder1& h, - const Allocator& a = Allocator()) ASIO_NOEXCEPT - { - return associated_allocator::get(h.handler_, a); - } -}; - -template -struct associated_allocator, Allocator> -{ - typedef typename associated_allocator::type type; - - static type get(const detail::binder2& h, - const Allocator& a = Allocator()) ASIO_NOEXCEPT - { - return associated_allocator::get(h.handler_, a); - } -}; - -template -struct associated_executor, Executor> -{ - typedef typename associated_executor::type type; - - static type get(const detail::binder1& h, - const Executor& ex = Executor()) ASIO_NOEXCEPT - { - return associated_executor::get(h.handler_, ex); - } -}; - -template -struct associated_executor, Executor> -{ - typedef typename associated_executor::type type; - - static type get(const detail::binder2& h, - const Executor& ex = Executor()) ASIO_NOEXCEPT - { - return associated_executor::get(h.handler_, ex); - } -}; - -#if defined(ASIO_HAS_MOVE) - -template -struct associated_allocator, Allocator> -{ - typedef typename associated_allocator::type type; - - static type get(const detail::move_binder1& h, - const Allocator& a = Allocator()) ASIO_NOEXCEPT - { - return associated_allocator::get(h.handler_, a); - } -}; - -template -struct associated_allocator< - detail::move_binder2, Allocator> -{ - typedef typename associated_allocator::type type; - - static type get(const detail::move_binder2& h, - const Allocator& a = Allocator()) ASIO_NOEXCEPT - { - return associated_allocator::get(h.handler_, a); - } -}; - -template -struct associated_executor, Executor> -{ - typedef typename associated_executor::type type; - - static type get(const detail::move_binder1& h, - const Executor& ex = Executor()) ASIO_NOEXCEPT - { - return associated_executor::get(h.handler_, ex); - } -}; - -template -struct associated_executor, Executor> -{ - typedef typename associated_executor::type type; - - static type get(const detail::move_binder2& h, - const Executor& ex = Executor()) ASIO_NOEXCEPT - { - return associated_executor::get(h.handler_, ex); - } -}; - -#endif // defined(ASIO_HAS_MOVE) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_BIND_HANDLER_HPP diff --git a/tools/sdk/include/asio/asio/detail/buffer_resize_guard.hpp b/tools/sdk/include/asio/asio/detail/buffer_resize_guard.hpp deleted file mode 100644 index 58ebc4cc79c..00000000000 --- a/tools/sdk/include/asio/asio/detail/buffer_resize_guard.hpp +++ /dev/null @@ -1,66 +0,0 @@ -// -// detail/buffer_resize_guard.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_BUFFER_RESIZE_GUARD_HPP -#define ASIO_DETAIL_BUFFER_RESIZE_GUARD_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/limits.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -// Helper class to manage buffer resizing in an exception safe way. -template -class buffer_resize_guard -{ -public: - // Constructor. - buffer_resize_guard(Buffer& buffer) - : buffer_(buffer), - old_size_(buffer.size()) - { - } - - // Destructor rolls back the buffer resize unless commit was called. - ~buffer_resize_guard() - { - if (old_size_ != (std::numeric_limits::max)()) - { - buffer_.resize(old_size_); - } - } - - // Commit the resize transaction. - void commit() - { - old_size_ = (std::numeric_limits::max)(); - } - -private: - // The buffer being managed. - Buffer& buffer_; - - // The size of the buffer at the time the guard was constructed. - size_t old_size_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_BUFFER_RESIZE_GUARD_HPP diff --git a/tools/sdk/include/asio/asio/detail/buffer_sequence_adapter.hpp b/tools/sdk/include/asio/asio/detail/buffer_sequence_adapter.hpp deleted file mode 100644 index 92a8e3d2faf..00000000000 --- a/tools/sdk/include/asio/asio/detail/buffer_sequence_adapter.hpp +++ /dev/null @@ -1,544 +0,0 @@ -// -// detail/buffer_sequence_adapter.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_BUFFER_SEQUENCE_ADAPTER_HPP -#define ASIO_DETAIL_BUFFER_SEQUENCE_ADAPTER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/buffer.hpp" -#include "asio/detail/array_fwd.hpp" -#include "asio/detail/socket_types.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class buffer_sequence_adapter_base -{ -#if defined(ASIO_WINDOWS_RUNTIME) -public: - // The maximum number of buffers to support in a single operation. - enum { max_buffers = 1 }; - -protected: - typedef Windows::Storage::Streams::IBuffer^ native_buffer_type; - - ASIO_DECL static void init_native_buffer( - native_buffer_type& buf, - const asio::mutable_buffer& buffer); - - ASIO_DECL static void init_native_buffer( - native_buffer_type& buf, - const asio::const_buffer& buffer); -#elif defined(ASIO_WINDOWS) || defined(__CYGWIN__) -public: - // The maximum number of buffers to support in a single operation. - enum { max_buffers = 64 < max_iov_len ? 64 : max_iov_len }; - -protected: - typedef WSABUF native_buffer_type; - - static void init_native_buffer(WSABUF& buf, - const asio::mutable_buffer& buffer) - { - buf.buf = static_cast(buffer.data()); - buf.len = static_cast(buffer.size()); - } - - static void init_native_buffer(WSABUF& buf, - const asio::const_buffer& buffer) - { - buf.buf = const_cast(static_cast(buffer.data())); - buf.len = static_cast(buffer.size()); - } -#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) -public: - // The maximum number of buffers to support in a single operation. - enum { max_buffers = 64 < max_iov_len ? 64 : max_iov_len }; - -protected: - typedef iovec native_buffer_type; - - static void init_iov_base(void*& base, void* addr) - { - base = addr; - } - - template - static void init_iov_base(T& base, void* addr) - { - base = static_cast(addr); - } - - static void init_native_buffer(iovec& iov, - const asio::mutable_buffer& buffer) - { - init_iov_base(iov.iov_base, buffer.data()); - iov.iov_len = buffer.size(); - } - - static void init_native_buffer(iovec& iov, - const asio::const_buffer& buffer) - { - init_iov_base(iov.iov_base, const_cast(buffer.data())); - iov.iov_len = buffer.size(); - } -#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) -}; - -// Helper class to translate buffers into the native buffer representation. -template -class buffer_sequence_adapter - : buffer_sequence_adapter_base -{ -public: - explicit buffer_sequence_adapter(const Buffers& buffer_sequence) - : count_(0), total_buffer_size_(0) - { - buffer_sequence_adapter::init( - asio::buffer_sequence_begin(buffer_sequence), - asio::buffer_sequence_end(buffer_sequence)); - } - - native_buffer_type* buffers() - { - return buffers_; - } - - std::size_t count() const - { - return count_; - } - - std::size_t total_size() const - { - return total_buffer_size_; - } - - bool all_empty() const - { - return total_buffer_size_ == 0; - } - - static bool all_empty(const Buffers& buffer_sequence) - { - return buffer_sequence_adapter::all_empty( - asio::buffer_sequence_begin(buffer_sequence), - asio::buffer_sequence_end(buffer_sequence)); - } - - static void validate(const Buffers& buffer_sequence) - { - buffer_sequence_adapter::validate( - asio::buffer_sequence_begin(buffer_sequence), - asio::buffer_sequence_end(buffer_sequence)); - } - - static Buffer first(const Buffers& buffer_sequence) - { - return buffer_sequence_adapter::first( - asio::buffer_sequence_begin(buffer_sequence), - asio::buffer_sequence_end(buffer_sequence)); - } - -private: - template - void init(Iterator begin, Iterator end) - { - Iterator iter = begin; - for (; iter != end && count_ < max_buffers; ++iter, ++count_) - { - Buffer buffer(*iter); - init_native_buffer(buffers_[count_], buffer); - total_buffer_size_ += buffer.size(); - } - } - - template - static bool all_empty(Iterator begin, Iterator end) - { - Iterator iter = begin; - std::size_t i = 0; - for (; iter != end && i < max_buffers; ++iter, ++i) - if (Buffer(*iter).size() > 0) - return false; - return true; - } - - template - static void validate(Iterator begin, Iterator end) - { - Iterator iter = begin; - for (; iter != end; ++iter) - { - Buffer buffer(*iter); - buffer.data(); - } - } - - template - static Buffer first(Iterator begin, Iterator end) - { - Iterator iter = begin; - for (; iter != end; ++iter) - { - Buffer buffer(*iter); - if (buffer.size() != 0) - return buffer; - } - return Buffer(); - } - - native_buffer_type buffers_[max_buffers]; - std::size_t count_; - std::size_t total_buffer_size_; -}; - -template -class buffer_sequence_adapter - : buffer_sequence_adapter_base -{ -public: - explicit buffer_sequence_adapter( - const asio::mutable_buffer& buffer_sequence) - { - init_native_buffer(buffer_, Buffer(buffer_sequence)); - total_buffer_size_ = buffer_sequence.size(); - } - - native_buffer_type* buffers() - { - return &buffer_; - } - - std::size_t count() const - { - return 1; - } - - std::size_t total_size() const - { - return total_buffer_size_; - } - - bool all_empty() const - { - return total_buffer_size_ == 0; - } - - static bool all_empty(const asio::mutable_buffer& buffer_sequence) - { - return buffer_sequence.size() == 0; - } - - static void validate(const asio::mutable_buffer& buffer_sequence) - { - buffer_sequence.data(); - } - - static Buffer first(const asio::mutable_buffer& buffer_sequence) - { - return Buffer(buffer_sequence); - } - -private: - native_buffer_type buffer_; - std::size_t total_buffer_size_; -}; - -template -class buffer_sequence_adapter - : buffer_sequence_adapter_base -{ -public: - explicit buffer_sequence_adapter( - const asio::const_buffer& buffer_sequence) - { - init_native_buffer(buffer_, Buffer(buffer_sequence)); - total_buffer_size_ = buffer_sequence.size(); - } - - native_buffer_type* buffers() - { - return &buffer_; - } - - std::size_t count() const - { - return 1; - } - - std::size_t total_size() const - { - return total_buffer_size_; - } - - bool all_empty() const - { - return total_buffer_size_ == 0; - } - - static bool all_empty(const asio::const_buffer& buffer_sequence) - { - return buffer_sequence.size() == 0; - } - - static void validate(const asio::const_buffer& buffer_sequence) - { - buffer_sequence.data(); - } - - static Buffer first(const asio::const_buffer& buffer_sequence) - { - return Buffer(buffer_sequence); - } - -private: - native_buffer_type buffer_; - std::size_t total_buffer_size_; -}; - -#if !defined(ASIO_NO_DEPRECATED) - -template -class buffer_sequence_adapter - : buffer_sequence_adapter_base -{ -public: - explicit buffer_sequence_adapter( - const asio::mutable_buffers_1& buffer_sequence) - { - init_native_buffer(buffer_, Buffer(buffer_sequence)); - total_buffer_size_ = buffer_sequence.size(); - } - - native_buffer_type* buffers() - { - return &buffer_; - } - - std::size_t count() const - { - return 1; - } - - std::size_t total_size() const - { - return total_buffer_size_; - } - - bool all_empty() const - { - return total_buffer_size_ == 0; - } - - static bool all_empty(const asio::mutable_buffers_1& buffer_sequence) - { - return buffer_sequence.size() == 0; - } - - static void validate(const asio::mutable_buffers_1& buffer_sequence) - { - buffer_sequence.data(); - } - - static Buffer first(const asio::mutable_buffers_1& buffer_sequence) - { - return Buffer(buffer_sequence); - } - -private: - native_buffer_type buffer_; - std::size_t total_buffer_size_; -}; - -template -class buffer_sequence_adapter - : buffer_sequence_adapter_base -{ -public: - explicit buffer_sequence_adapter( - const asio::const_buffers_1& buffer_sequence) - { - init_native_buffer(buffer_, Buffer(buffer_sequence)); - total_buffer_size_ = buffer_sequence.size(); - } - - native_buffer_type* buffers() - { - return &buffer_; - } - - std::size_t count() const - { - return 1; - } - - std::size_t total_size() const - { - return total_buffer_size_; - } - - bool all_empty() const - { - return total_buffer_size_ == 0; - } - - static bool all_empty(const asio::const_buffers_1& buffer_sequence) - { - return buffer_sequence.size() == 0; - } - - static void validate(const asio::const_buffers_1& buffer_sequence) - { - buffer_sequence.data(); - } - - static Buffer first(const asio::const_buffers_1& buffer_sequence) - { - return Buffer(buffer_sequence); - } - -private: - native_buffer_type buffer_; - std::size_t total_buffer_size_; -}; - -#endif // !defined(ASIO_NO_DEPRECATED) - -template -class buffer_sequence_adapter > - : buffer_sequence_adapter_base -{ -public: - explicit buffer_sequence_adapter( - const boost::array& buffer_sequence) - { - init_native_buffer(buffers_[0], Buffer(buffer_sequence[0])); - init_native_buffer(buffers_[1], Buffer(buffer_sequence[1])); - total_buffer_size_ = buffer_sequence[0].size() + buffer_sequence[1].size(); - } - - native_buffer_type* buffers() - { - return buffers_; - } - - std::size_t count() const - { - return 2; - } - - std::size_t total_size() const - { - return total_buffer_size_; - } - - bool all_empty() const - { - return total_buffer_size_ == 0; - } - - static bool all_empty(const boost::array& buffer_sequence) - { - return buffer_sequence[0].size() == 0 && buffer_sequence[1].size() == 0; - } - - static void validate(const boost::array& buffer_sequence) - { - buffer_sequence[0].data(); - buffer_sequence[1].data(); - } - - static Buffer first(const boost::array& buffer_sequence) - { - return Buffer(buffer_sequence[0].size() != 0 - ? buffer_sequence[0] : buffer_sequence[1]); - } - -private: - native_buffer_type buffers_[2]; - std::size_t total_buffer_size_; -}; - -#if defined(ASIO_HAS_STD_ARRAY) - -template -class buffer_sequence_adapter > - : buffer_sequence_adapter_base -{ -public: - explicit buffer_sequence_adapter( - const std::array& buffer_sequence) - { - init_native_buffer(buffers_[0], Buffer(buffer_sequence[0])); - init_native_buffer(buffers_[1], Buffer(buffer_sequence[1])); - total_buffer_size_ = buffer_sequence[0].size() + buffer_sequence[1].size(); - } - - native_buffer_type* buffers() - { - return buffers_; - } - - std::size_t count() const - { - return 2; - } - - std::size_t total_size() const - { - return total_buffer_size_; - } - - bool all_empty() const - { - return total_buffer_size_ == 0; - } - - static bool all_empty(const std::array& buffer_sequence) - { - return buffer_sequence[0].size() == 0 && buffer_sequence[1].size() == 0; - } - - static void validate(const std::array& buffer_sequence) - { - buffer_sequence[0].data(); - buffer_sequence[1].data(); - } - - static Buffer first(const std::array& buffer_sequence) - { - return Buffer(buffer_sequence[0].size() != 0 - ? buffer_sequence[0] : buffer_sequence[1]); - } - -private: - native_buffer_type buffers_[2]; - std::size_t total_buffer_size_; -}; - -#endif // defined(ASIO_HAS_STD_ARRAY) - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/buffer_sequence_adapter.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_DETAIL_BUFFER_SEQUENCE_ADAPTER_HPP diff --git a/tools/sdk/include/asio/asio/detail/buffered_stream_storage.hpp b/tools/sdk/include/asio/asio/detail/buffered_stream_storage.hpp deleted file mode 100644 index c5eb081d9a3..00000000000 --- a/tools/sdk/include/asio/asio/detail/buffered_stream_storage.hpp +++ /dev/null @@ -1,126 +0,0 @@ -// -// detail/buffered_stream_storage.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_BUFFERED_STREAM_STORAGE_HPP -#define ASIO_DETAIL_BUFFERED_STREAM_STORAGE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/buffer.hpp" -#include "asio/detail/assert.hpp" -#include -#include -#include - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class buffered_stream_storage -{ -public: - // The type of the bytes stored in the buffer. - typedef unsigned char byte_type; - - // The type used for offsets into the buffer. - typedef std::size_t size_type; - - // Constructor. - explicit buffered_stream_storage(std::size_t buffer_capacity) - : begin_offset_(0), - end_offset_(0), - buffer_(buffer_capacity) - { - } - - /// Clear the buffer. - void clear() - { - begin_offset_ = 0; - end_offset_ = 0; - } - - // Return a pointer to the beginning of the unread data. - mutable_buffer data() - { - return asio::buffer(buffer_) + begin_offset_; - } - - // Return a pointer to the beginning of the unread data. - const_buffer data() const - { - return asio::buffer(buffer_) + begin_offset_; - } - - // Is there no unread data in the buffer. - bool empty() const - { - return begin_offset_ == end_offset_; - } - - // Return the amount of unread data the is in the buffer. - size_type size() const - { - return end_offset_ - begin_offset_; - } - - // Resize the buffer to the specified length. - void resize(size_type length) - { - ASIO_ASSERT(length <= capacity()); - if (begin_offset_ + length <= capacity()) - { - end_offset_ = begin_offset_ + length; - } - else - { - using namespace std; // For memmove. - memmove(&buffer_[0], &buffer_[0] + begin_offset_, size()); - end_offset_ = length; - begin_offset_ = 0; - } - } - - // Return the maximum size for data in the buffer. - size_type capacity() const - { - return buffer_.size(); - } - - // Consume multiple bytes from the beginning of the buffer. - void consume(size_type count) - { - ASIO_ASSERT(begin_offset_ + count <= end_offset_); - begin_offset_ += count; - if (empty()) - clear(); - } - -private: - // The offset to the beginning of the unread data. - size_type begin_offset_; - - // The offset to the end of the unread data. - size_type end_offset_; - - // The data in the buffer. - std::vector buffer_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_BUFFERED_STREAM_STORAGE_HPP diff --git a/tools/sdk/include/asio/asio/detail/call_stack.hpp b/tools/sdk/include/asio/asio/detail/call_stack.hpp deleted file mode 100644 index 5725a10a22f..00000000000 --- a/tools/sdk/include/asio/asio/detail/call_stack.hpp +++ /dev/null @@ -1,125 +0,0 @@ -// -// detail/call_stack.hpp -// ~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_CALL_STACK_HPP -#define ASIO_DETAIL_CALL_STACK_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/tss_ptr.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -// Helper class to determine whether or not the current thread is inside an -// invocation of io_context::run() for a specified io_context object. -template -class call_stack -{ -public: - // Context class automatically pushes the key/value pair on to the stack. - class context - : private noncopyable - { - public: - // Push the key on to the stack. - explicit context(Key* k) - : key_(k), - next_(call_stack::top_) - { - value_ = reinterpret_cast(this); - call_stack::top_ = this; - } - - // Push the key/value pair on to the stack. - context(Key* k, Value& v) - : key_(k), - value_(&v), - next_(call_stack::top_) - { - call_stack::top_ = this; - } - - // Pop the key/value pair from the stack. - ~context() - { - call_stack::top_ = next_; - } - - // Find the next context with the same key. - Value* next_by_key() const - { - context* elem = next_; - while (elem) - { - if (elem->key_ == key_) - return elem->value_; - elem = elem->next_; - } - return 0; - } - - private: - friend class call_stack; - - // The key associated with the context. - Key* key_; - - // The value associated with the context. - Value* value_; - - // The next element in the stack. - context* next_; - }; - - friend class context; - - // Determine whether the specified owner is on the stack. Returns address of - // key if present, 0 otherwise. - static Value* contains(Key* k) - { - context* elem = top_; - while (elem) - { - if (elem->key_ == k) - return elem->value_; - elem = elem->next_; - } - return 0; - } - - // Obtain the value at the top of the stack. - static Value* top() - { - context* elem = top_; - return elem ? elem->value_ : 0; - } - -private: - // The top of the stack of calls for the current thread. - static tss_ptr top_; -}; - -template -tss_ptr::context> -call_stack::top_; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_CALL_STACK_HPP diff --git a/tools/sdk/include/asio/asio/detail/chrono.hpp b/tools/sdk/include/asio/asio/detail/chrono.hpp deleted file mode 100644 index 8f56beed5fa..00000000000 --- a/tools/sdk/include/asio/asio/detail/chrono.hpp +++ /dev/null @@ -1,66 +0,0 @@ -// -// detail/chrono.hpp -// ~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_CHRONO_HPP -#define ASIO_DETAIL_CHRONO_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_STD_CHRONO) -# include -#elif defined(ASIO_HAS_BOOST_CHRONO) -# include -#endif // defined(ASIO_HAS_BOOST_CHRONO) - -namespace asio { -namespace chrono { - -#if defined(ASIO_HAS_STD_CHRONO) -using std::chrono::duration; -using std::chrono::time_point; -using std::chrono::duration_cast; -using std::chrono::nanoseconds; -using std::chrono::microseconds; -using std::chrono::milliseconds; -using std::chrono::seconds; -using std::chrono::minutes; -using std::chrono::hours; -using std::chrono::time_point_cast; -#if defined(ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK) -typedef std::chrono::monotonic_clock steady_clock; -#else // defined(ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK) -using std::chrono::steady_clock; -#endif // defined(ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK) -using std::chrono::system_clock; -using std::chrono::high_resolution_clock; -#elif defined(ASIO_HAS_BOOST_CHRONO) -using boost::chrono::duration; -using boost::chrono::time_point; -using boost::chrono::duration_cast; -using boost::chrono::nanoseconds; -using boost::chrono::microseconds; -using boost::chrono::milliseconds; -using boost::chrono::seconds; -using boost::chrono::minutes; -using boost::chrono::hours; -using boost::chrono::time_point_cast; -using boost::chrono::system_clock; -using boost::chrono::steady_clock; -using boost::chrono::high_resolution_clock; -#endif // defined(ASIO_HAS_BOOST_CHRONO) - -} // namespace chrono -} // namespace asio - -#endif // ASIO_DETAIL_CHRONO_HPP diff --git a/tools/sdk/include/asio/asio/detail/chrono_time_traits.hpp b/tools/sdk/include/asio/asio/detail/chrono_time_traits.hpp deleted file mode 100644 index d1528f70db3..00000000000 --- a/tools/sdk/include/asio/asio/detail/chrono_time_traits.hpp +++ /dev/null @@ -1,190 +0,0 @@ -// -// detail/chrono_time_traits.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_CHRONO_TIME_TRAITS_HPP -#define ASIO_DETAIL_CHRONO_TIME_TRAITS_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/cstdint.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -// Helper template to compute the greatest common divisor. -template -struct gcd { enum { value = gcd::value }; }; - -template -struct gcd { enum { value = v1 }; }; - -// Adapts std::chrono clocks for use with a deadline timer. -template -struct chrono_time_traits -{ - // The clock type. - typedef Clock clock_type; - - // The duration type of the clock. - typedef typename clock_type::duration duration_type; - - // The time point type of the clock. - typedef typename clock_type::time_point time_type; - - // The period of the clock. - typedef typename duration_type::period period_type; - - // Get the current time. - static time_type now() - { - return clock_type::now(); - } - - // Add a duration to a time. - static time_type add(const time_type& t, const duration_type& d) - { - const time_type epoch; - if (t >= epoch) - { - if ((time_type::max)() - t < d) - return (time_type::max)(); - } - else // t < epoch - { - if (-(t - (time_type::min)()) > d) - return (time_type::min)(); - } - - return t + d; - } - - // Subtract one time from another. - static duration_type subtract(const time_type& t1, const time_type& t2) - { - const time_type epoch; - if (t1 >= epoch) - { - if (t2 >= epoch) - { - return t1 - t2; - } - else if (t2 == (time_type::min)()) - { - return (duration_type::max)(); - } - else if ((time_type::max)() - t1 < epoch - t2) - { - return (duration_type::max)(); - } - else - { - return t1 - t2; - } - } - else // t1 < epoch - { - if (t2 < epoch) - { - return t1 - t2; - } - else if (t1 == (time_type::min)()) - { - return (duration_type::min)(); - } - else if ((time_type::max)() - t2 < epoch - t1) - { - return (duration_type::min)(); - } - else - { - return -(t2 - t1); - } - } - } - - // Test whether one time is less than another. - static bool less_than(const time_type& t1, const time_type& t2) - { - return t1 < t2; - } - - // Implement just enough of the posix_time::time_duration interface to supply - // what the timer_queue requires. - class posix_time_duration - { - public: - explicit posix_time_duration(const duration_type& d) - : d_(d) - { - } - - int64_t ticks() const - { - return d_.count(); - } - - int64_t total_seconds() const - { - return duration_cast<1, 1>(); - } - - int64_t total_milliseconds() const - { - return duration_cast<1, 1000>(); - } - - int64_t total_microseconds() const - { - return duration_cast<1, 1000000>(); - } - - private: - template - int64_t duration_cast() const - { - const int64_t num1 = period_type::num / gcd::value; - const int64_t num2 = Num / gcd::value; - - const int64_t den1 = period_type::den / gcd::value; - const int64_t den2 = Den / gcd::value; - - const int64_t num = num1 * den2; - const int64_t den = num2 * den1; - - if (num == 1 && den == 1) - return ticks(); - else if (num != 1 && den == 1) - return ticks() * num; - else if (num == 1 && period_type::den != 1) - return ticks() / den; - else - return ticks() * num / den; - } - - duration_type d_; - }; - - // Convert to POSIX duration type. - static posix_time_duration to_posix_duration(const duration_type& d) - { - return posix_time_duration(WaitTraits::to_wait_duration(d)); - } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_CHRONO_TIME_TRAITS_HPP diff --git a/tools/sdk/include/asio/asio/detail/completion_handler.hpp b/tools/sdk/include/asio/asio/detail/completion_handler.hpp deleted file mode 100644 index 58a2e6db984..00000000000 --- a/tools/sdk/include/asio/asio/detail/completion_handler.hpp +++ /dev/null @@ -1,83 +0,0 @@ -// -// detail/completion_handler.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_COMPLETION_HANDLER_HPP -#define ASIO_DETAIL_COMPLETION_HANDLER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_work.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/operation.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class completion_handler : public operation -{ -public: - ASIO_DEFINE_HANDLER_PTR(completion_handler); - - completion_handler(Handler& h) - : operation(&completion_handler::do_complete), - handler_(ASIO_MOVE_CAST(Handler)(h)) - { - handler_work::start(handler_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& /*ec*/, - std::size_t /*bytes_transferred*/) - { - // Take ownership of the handler object. - completion_handler* h(static_cast(base)); - ptr p = { asio::detail::addressof(h->handler_), h, h }; - handler_work w(h->handler_); - - ASIO_HANDLER_COMPLETION((*h)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - Handler handler(ASIO_MOVE_CAST(Handler)(h->handler_)); - p.h = asio::detail::addressof(handler); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN(()); - w.complete(handler, handler); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_COMPLETION_HANDLER_HPP diff --git a/tools/sdk/include/asio/asio/detail/concurrency_hint.hpp b/tools/sdk/include/asio/asio/detail/concurrency_hint.hpp deleted file mode 100644 index 229124d3765..00000000000 --- a/tools/sdk/include/asio/asio/detail/concurrency_hint.hpp +++ /dev/null @@ -1,94 +0,0 @@ -// -// detail/concurrency_hint.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_CONCURRENCY_HINT_HPP -#define ASIO_DETAIL_CONCURRENCY_HINT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/noncopyable.hpp" - -// The concurrency hint ID and mask are used to identify when a "well-known" -// concurrency hint value has been passed to the io_context. -#define ASIO_CONCURRENCY_HINT_ID 0xA5100000u -#define ASIO_CONCURRENCY_HINT_ID_MASK 0xFFFF0000u - -// If set, this bit indicates that the scheduler should perform locking. -#define ASIO_CONCURRENCY_HINT_LOCKING_SCHEDULER 0x1u - -// If set, this bit indicates that the reactor should perform locking when -// managing descriptor registrations. -#define ASIO_CONCURRENCY_HINT_LOCKING_REACTOR_REGISTRATION 0x2u - -// If set, this bit indicates that the reactor should perform locking for I/O. -#define ASIO_CONCURRENCY_HINT_LOCKING_REACTOR_IO 0x4u - -// Helper macro to determine if we have a special concurrency hint. -#define ASIO_CONCURRENCY_HINT_IS_SPECIAL(hint) \ - ((static_cast(hint) \ - & ASIO_CONCURRENCY_HINT_ID_MASK) \ - == ASIO_CONCURRENCY_HINT_ID) - -// Helper macro to determine if locking is enabled for a given facility. -#define ASIO_CONCURRENCY_HINT_IS_LOCKING(facility, hint) \ - (((static_cast(hint) \ - & (ASIO_CONCURRENCY_HINT_ID_MASK \ - | ASIO_CONCURRENCY_HINT_LOCKING_ ## facility)) \ - ^ ASIO_CONCURRENCY_HINT_ID) != 0) - -// This special concurrency hint disables locking in both the scheduler and -// reactor I/O. This hint has the following restrictions: -// -// - Care must be taken to ensure that all operations on the io_context and any -// of its associated I/O objects (such as sockets and timers) occur in only -// one thread at a time. -// -// - Asynchronous resolve operations fail with operation_not_supported. -// -// - If a signal_set is used with the io_context, signal_set objects cannot be -// used with any other io_context in the program. -#define ASIO_CONCURRENCY_HINT_UNSAFE \ - static_cast(ASIO_CONCURRENCY_HINT_ID) - -// This special concurrency hint disables locking in the reactor I/O. This hint -// has the following restrictions: -// -// - Care must be taken to ensure that run functions on the io_context, and all -// operations on the io_context's associated I/O objects (such as sockets and -// timers), occur in only one thread at a time. -#define ASIO_CONCURRENCY_HINT_UNSAFE_IO \ - static_cast(ASIO_CONCURRENCY_HINT_ID \ - | ASIO_CONCURRENCY_HINT_LOCKING_SCHEDULER \ - | ASIO_CONCURRENCY_HINT_LOCKING_REACTOR_REGISTRATION) - -// The special concurrency hint provides full thread safety. -#define ASIO_CONCURRENCY_HINT_SAFE \ - static_cast(ASIO_CONCURRENCY_HINT_ID \ - | ASIO_CONCURRENCY_HINT_LOCKING_SCHEDULER \ - | ASIO_CONCURRENCY_HINT_LOCKING_REACTOR_REGISTRATION \ - | ASIO_CONCURRENCY_HINT_LOCKING_REACTOR_IO) - -// This #define may be overridden at compile time to specify a program-wide -// default concurrency hint, used by the zero-argument io_context constructor. -#if !defined(ASIO_CONCURRENCY_HINT_DEFAULT) -# define ASIO_CONCURRENCY_HINT_DEFAULT -1 -#endif // !defined(ASIO_CONCURRENCY_HINT_DEFAULT) - -// This #define may be overridden at compile time to specify a program-wide -// concurrency hint, used by the one-argument io_context constructor when -// passed a value of 1. -#if !defined(ASIO_CONCURRENCY_HINT_1) -# define ASIO_CONCURRENCY_HINT_1 1 -#endif // !defined(ASIO_CONCURRENCY_HINT_DEFAULT) - -#endif // ASIO_DETAIL_CONCURRENCY_HINT_HPP diff --git a/tools/sdk/include/asio/asio/detail/conditionally_enabled_event.hpp b/tools/sdk/include/asio/asio/detail/conditionally_enabled_event.hpp deleted file mode 100644 index 0fda401e3bb..00000000000 --- a/tools/sdk/include/asio/asio/detail/conditionally_enabled_event.hpp +++ /dev/null @@ -1,112 +0,0 @@ -// -// detail/conditionally_enabled_event.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_CONDITIONALLY_ENABLED_EVENT_HPP -#define ASIO_DETAIL_CONDITIONALLY_ENABLED_EVENT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/conditionally_enabled_mutex.hpp" -#include "asio/detail/event.hpp" -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/null_event.hpp" -#include "asio/detail/scoped_lock.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -// Mutex adapter used to conditionally enable or disable locking. -class conditionally_enabled_event - : private noncopyable -{ -public: - // Constructor. - conditionally_enabled_event() - { - } - - // Destructor. - ~conditionally_enabled_event() - { - } - - // Signal the event. (Retained for backward compatibility.) - void signal(conditionally_enabled_mutex::scoped_lock& lock) - { - if (lock.mutex_.enabled_) - event_.signal(lock); - } - - // Signal all waiters. - void signal_all(conditionally_enabled_mutex::scoped_lock& lock) - { - if (lock.mutex_.enabled_) - event_.signal_all(lock); - } - - // Unlock the mutex and signal one waiter. - void unlock_and_signal_one( - conditionally_enabled_mutex::scoped_lock& lock) - { - if (lock.mutex_.enabled_) - event_.unlock_and_signal_one(lock); - } - - // If there's a waiter, unlock the mutex and signal it. - bool maybe_unlock_and_signal_one( - conditionally_enabled_mutex::scoped_lock& lock) - { - if (lock.mutex_.enabled_) - return event_.maybe_unlock_and_signal_one(lock); - else - return false; - } - - // Reset the event. - void clear(conditionally_enabled_mutex::scoped_lock& lock) - { - if (lock.mutex_.enabled_) - event_.clear(lock); - } - - // Wait for the event to become signalled. - void wait(conditionally_enabled_mutex::scoped_lock& lock) - { - if (lock.mutex_.enabled_) - event_.wait(lock); - else - null_event().wait(lock); - } - - // Timed wait for the event to become signalled. - bool wait_for_usec( - conditionally_enabled_mutex::scoped_lock& lock, long usec) - { - if (lock.mutex_.enabled_) - return event_.wait_for_usec(lock, usec); - else - return null_event().wait_for_usec(lock, usec); - } - -private: - asio::detail::event event_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_CONDITIONALLY_ENABLED_EVENT_HPP diff --git a/tools/sdk/include/asio/asio/detail/conditionally_enabled_mutex.hpp b/tools/sdk/include/asio/asio/detail/conditionally_enabled_mutex.hpp deleted file mode 100644 index 2872db98be9..00000000000 --- a/tools/sdk/include/asio/asio/detail/conditionally_enabled_mutex.hpp +++ /dev/null @@ -1,149 +0,0 @@ -// -// detail/conditionally_enabled_mutex.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_CONDITIONALLY_ENABLED_MUTEX_HPP -#define ASIO_DETAIL_CONDITIONALLY_ENABLED_MUTEX_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/mutex.hpp" -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/scoped_lock.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -// Mutex adapter used to conditionally enable or disable locking. -class conditionally_enabled_mutex - : private noncopyable -{ -public: - // Helper class to lock and unlock a mutex automatically. - class scoped_lock - : private noncopyable - { - public: - // Tag type used to distinguish constructors. - enum adopt_lock_t { adopt_lock }; - - // Constructor adopts a lock that is already held. - scoped_lock(conditionally_enabled_mutex& m, adopt_lock_t) - : mutex_(m), - locked_(m.enabled_) - { - } - - // Constructor acquires the lock. - explicit scoped_lock(conditionally_enabled_mutex& m) - : mutex_(m) - { - if (m.enabled_) - { - mutex_.mutex_.lock(); - locked_ = true; - } - else - locked_ = false; - } - - // Destructor releases the lock. - ~scoped_lock() - { - if (locked_) - mutex_.mutex_.unlock(); - } - - // Explicitly acquire the lock. - void lock() - { - if (mutex_.enabled_ && !locked_) - { - mutex_.mutex_.lock(); - locked_ = true; - } - } - - // Explicitly release the lock. - void unlock() - { - if (locked_) - { - mutex_.unlock(); - locked_ = false; - } - } - - // Test whether the lock is held. - bool locked() const - { - return locked_; - } - - // Get the underlying mutex. - asio::detail::mutex& mutex() - { - return mutex_.mutex_; - } - - private: - friend class conditionally_enabled_event; - conditionally_enabled_mutex& mutex_; - bool locked_; - }; - - // Constructor. - explicit conditionally_enabled_mutex(bool enabled) - : enabled_(enabled) - { - } - - // Destructor. - ~conditionally_enabled_mutex() - { - } - - // Determine whether locking is enabled. - bool enabled() const - { - return enabled_; - } - - // Lock the mutex. - void lock() - { - if (enabled_) - mutex_.lock(); - } - - // Unlock the mutex. - void unlock() - { - if (enabled_) - mutex_.unlock(); - } - -private: - friend class scoped_lock; - friend class conditionally_enabled_event; - asio::detail::mutex mutex_; - const bool enabled_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_CONDITIONALLY_ENABLED_MUTEX_HPP diff --git a/tools/sdk/include/asio/asio/detail/config.hpp b/tools/sdk/include/asio/asio/detail/config.hpp deleted file mode 100644 index 949d67f2a87..00000000000 --- a/tools/sdk/include/asio/asio/detail/config.hpp +++ /dev/null @@ -1,1441 +0,0 @@ -// -// detail/config.hpp -// ~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_CONFIG_HPP -#define ASIO_DETAIL_CONFIG_HPP - -#if defined(ESP_PLATFORM) -# include "esp_asio_config.h" -#endif // defined(ESP_PLATFORM) - -#if defined(ASIO_STANDALONE) -# define ASIO_DISABLE_BOOST_ARRAY 1 -# define ASIO_DISABLE_BOOST_ASSERT 1 -# define ASIO_DISABLE_BOOST_BIND 1 -# define ASIO_DISABLE_BOOST_CHRONO 1 -# define ASIO_DISABLE_BOOST_DATE_TIME 1 -# define ASIO_DISABLE_BOOST_LIMITS 1 -# define ASIO_DISABLE_BOOST_REGEX 1 -# define ASIO_DISABLE_BOOST_STATIC_CONSTANT 1 -# define ASIO_DISABLE_BOOST_THROW_EXCEPTION 1 -# define ASIO_DISABLE_BOOST_WORKAROUND 1 -#else // defined(ASIO_STANDALONE) -# include -# include -# define ASIO_HAS_BOOST_CONFIG 1 -#endif // defined(ASIO_STANDALONE) - -// Default to a header-only implementation. The user must specifically request -// separate compilation by defining either ASIO_SEPARATE_COMPILATION or -// ASIO_DYN_LINK (as a DLL/shared library implies separate compilation). -#if !defined(ASIO_HEADER_ONLY) -# if !defined(ASIO_SEPARATE_COMPILATION) -# if !defined(ASIO_DYN_LINK) -# define ASIO_HEADER_ONLY 1 -# endif // !defined(ASIO_DYN_LINK) -# endif // !defined(ASIO_SEPARATE_COMPILATION) -#endif // !defined(ASIO_HEADER_ONLY) - -#if defined(ASIO_HEADER_ONLY) -# define ASIO_DECL inline -#else // defined(ASIO_HEADER_ONLY) -# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CODEGEARC__) -// We need to import/export our code only if the user has specifically asked -// for it by defining ASIO_DYN_LINK. -# if defined(ASIO_DYN_LINK) -// Export if this is our own source, otherwise import. -# if defined(ASIO_SOURCE) -# define ASIO_DECL __declspec(dllexport) -# else // defined(ASIO_SOURCE) -# define ASIO_DECL __declspec(dllimport) -# endif // defined(ASIO_SOURCE) -# endif // defined(ASIO_DYN_LINK) -# endif // defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CODEGEARC__) -#endif // defined(ASIO_HEADER_ONLY) - -// If ASIO_DECL isn't defined yet define it now. -#if !defined(ASIO_DECL) -# define ASIO_DECL -#endif // !defined(ASIO_DECL) - -// Microsoft Visual C++ detection. -#if !defined(ASIO_MSVC) -# if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_MSVC) -# define ASIO_MSVC BOOST_MSVC -# elif defined(_MSC_VER) && (defined(__INTELLISENSE__) \ - || (!defined(__MWERKS__) && !defined(__EDG_VERSION__))) -# define ASIO_MSVC _MSC_VER -# endif // defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_MSVC) -#endif // !defined(ASIO_MSVC) -#if defined(ASIO_MSVC) -# include // Needed for _HAS_CXX17. -#endif // defined(ASIO_MSVC) - -// Clang / libc++ detection. -#if defined(__clang__) -# if (__cplusplus >= 201103) -# if __has_include(<__config>) -# include <__config> -# if defined(_LIBCPP_VERSION) -# define ASIO_HAS_CLANG_LIBCXX 1 -# endif // defined(_LIBCPP_VERSION) -# endif // __has_include(<__config>) -# endif // (__cplusplus >= 201103) -#endif // defined(__clang__) - -// Android platform detection. -#if defined(__ANDROID__) -# include -#endif // defined(__ANDROID__) - -// Support move construction and assignment on compilers known to allow it. -#if !defined(ASIO_HAS_MOVE) -# if !defined(ASIO_DISABLE_MOVE) -# if defined(__clang__) -# if __has_feature(__cxx_rvalue_references__) -# define ASIO_HAS_MOVE 1 -# endif // __has_feature(__cxx_rvalue_references__) -# endif // defined(__clang__) -# if defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define ASIO_HAS_MOVE 1 -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1700) -# define ASIO_HAS_MOVE 1 -# endif // (_MSC_VER >= 1700) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_MOVE) -#endif // !defined(ASIO_HAS_MOVE) - -// If ASIO_MOVE_CAST isn't defined, and move support is available, define -// ASIO_MOVE_ARG and ASIO_MOVE_CAST to take advantage of rvalue -// references and perfect forwarding. -#if defined(ASIO_HAS_MOVE) && !defined(ASIO_MOVE_CAST) -# define ASIO_MOVE_ARG(type) type&& -# define ASIO_MOVE_ARG2(type1, type2) type1, type2&& -# define ASIO_MOVE_CAST(type) static_cast -# define ASIO_MOVE_CAST2(type1, type2) static_cast -#endif // defined(ASIO_HAS_MOVE) && !defined(ASIO_MOVE_CAST) - -// If ASIO_MOVE_CAST still isn't defined, default to a C++03-compatible -// implementation. Note that older g++ and MSVC versions don't like it when you -// pass a non-member function through a const reference, so for most compilers -// we'll play it safe and stick with the old approach of passing the handler by -// value. -#if !defined(ASIO_MOVE_CAST) -# if defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4) -# define ASIO_MOVE_ARG(type) const type& -# else // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4) -# define ASIO_MOVE_ARG(type) type -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4) -# elif defined(ASIO_MSVC) -# if (_MSC_VER >= 1400) -# define ASIO_MOVE_ARG(type) const type& -# else // (_MSC_VER >= 1400) -# define ASIO_MOVE_ARG(type) type -# endif // (_MSC_VER >= 1400) -# else -# define ASIO_MOVE_ARG(type) type -# endif -# define ASIO_MOVE_CAST(type) static_cast -# define ASIO_MOVE_CAST2(type1, type2) static_cast -#endif // !defined(ASIO_MOVE_CAST) - -// Support variadic templates on compilers known to allow it. -#if !defined(ASIO_HAS_VARIADIC_TEMPLATES) -# if !defined(ASIO_DISABLE_VARIADIC_TEMPLATES) -# if defined(__clang__) -# if __has_feature(__cxx_variadic_templates__) -# define ASIO_HAS_VARIADIC_TEMPLATES 1 -# endif // __has_feature(__cxx_variadic_templates__) -# endif // defined(__clang__) -# if defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define ASIO_HAS_VARIADIC_TEMPLATES 1 -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1900) -# define ASIO_HAS_VARIADIC_TEMPLATES 1 -# endif // (_MSC_VER >= 1900) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_VARIADIC_TEMPLATES) -#endif // !defined(ASIO_HAS_VARIADIC_TEMPLATES) - -// Support deleted functions on compilers known to allow it. -#if !defined(ASIO_DELETED) -# if defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define ASIO_DELETED = delete -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(__clang__) -# if __has_feature(__cxx_deleted_functions__) -# define ASIO_DELETED = delete -# endif // __has_feature(__cxx_deleted_functions__) -# endif // defined(__clang__) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1900) -# define ASIO_DELETED = delete -# endif // (_MSC_VER >= 1900) -# endif // defined(ASIO_MSVC) -# if !defined(ASIO_DELETED) -# define ASIO_DELETED -# endif // !defined(ASIO_DELETED) -#endif // !defined(ASIO_DELETED) - -// Support constexpr on compilers known to allow it. -#if !defined(ASIO_HAS_CONSTEXPR) -# if !defined(ASIO_DISABLE_CONSTEXPR) -# if defined(__clang__) -# if __has_feature(__cxx_constexpr__) -# define ASIO_HAS_CONSTEXPR 1 -# endif // __has_feature(__cxx_constexr__) -# endif // defined(__clang__) -# if defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define ASIO_HAS_CONSTEXPR 1 -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1900) -# define ASIO_HAS_CONSTEXPR 1 -# endif // (_MSC_VER >= 1900) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_CONSTEXPR) -#endif // !defined(ASIO_HAS_CONSTEXPR) -#if !defined(ASIO_CONSTEXPR) -# if defined(ASIO_HAS_CONSTEXPR) -# define ASIO_CONSTEXPR constexpr -# else // defined(ASIO_HAS_CONSTEXPR) -# define ASIO_CONSTEXPR -# endif // defined(ASIO_HAS_CONSTEXPR) -#endif // !defined(ASIO_CONSTEXPR) - -// Support noexcept on compilers known to allow it. -#if !defined(ASIO_NOEXCEPT) -# if !defined(ASIO_DISABLE_NOEXCEPT) -# if (BOOST_VERSION >= 105300) -# define ASIO_NOEXCEPT BOOST_NOEXCEPT -# define ASIO_NOEXCEPT_OR_NOTHROW BOOST_NOEXCEPT_OR_NOTHROW -# elif defined(__clang__) -# if __has_feature(__cxx_noexcept__) -# define ASIO_NOEXCEPT noexcept(true) -# define ASIO_NOEXCEPT_OR_NOTHROW noexcept(true) -# endif // __has_feature(__cxx_noexcept__) -# elif defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define ASIO_NOEXCEPT noexcept(true) -# define ASIO_NOEXCEPT_OR_NOTHROW noexcept(true) -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) -# elif defined(ASIO_MSVC) -# if (_MSC_VER >= 1900) -# define ASIO_NOEXCEPT noexcept(true) -# define ASIO_NOEXCEPT_OR_NOTHROW noexcept(true) -# endif // (_MSC_VER >= 1900) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_NOEXCEPT) -# if !defined(ASIO_NOEXCEPT) -# define ASIO_NOEXCEPT -# endif // !defined(ASIO_NOEXCEPT) -# if !defined(ASIO_NOEXCEPT_OR_NOTHROW) -# define ASIO_NOEXCEPT_OR_NOTHROW throw() -# endif // !defined(ASIO_NOEXCEPT_OR_NOTHROW) -#endif // !defined(ASIO_NOEXCEPT) - -// Support automatic type deduction on compilers known to support it. -#if !defined(ASIO_HAS_DECLTYPE) -# if !defined(ASIO_DISABLE_DECLTYPE) -# if defined(__clang__) -# if __has_feature(__cxx_decltype__) -# define ASIO_HAS_DECLTYPE 1 -# endif // __has_feature(__cxx_decltype__) -# endif // defined(__clang__) -# if defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define ASIO_HAS_DECLTYPE 1 -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1700) -# define ASIO_HAS_DECLTYPE 1 -# endif // (_MSC_VER >= 1700) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_DECLTYPE) -#endif // !defined(ASIO_HAS_DECLTYPE) - -// Support alias templates on compilers known to allow it. -#if !defined(ASIO_HAS_ALIAS_TEMPLATES) -# if !defined(ASIO_DISABLE_ALIAS_TEMPLATES) -# if defined(__clang__) -# if __has_feature(__cxx_alias_templates__) -# define ASIO_HAS_ALIAS_TEMPLATES 1 -# endif // __has_feature(__cxx_alias_templates__) -# endif // defined(__clang__) -# if defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define ASIO_HAS_ALIAS_TEMPLATES 1 -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1900) -# define ASIO_HAS_ALIAS_TEMPLATES 1 -# endif // (_MSC_VER >= 1900) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_ALIAS_TEMPLATES) -#endif // !defined(ASIO_HAS_ALIAS_TEMPLATES) - -// Standard library support for system errors. -#if !defined(ASIO_HAS_STD_SYSTEM_ERROR) -# if !defined(ASIO_DISABLE_STD_SYSTEM_ERROR) -# if defined(__clang__) -# if defined(ASIO_HAS_CLANG_LIBCXX) -# define ASIO_HAS_STD_SYSTEM_ERROR 1 -# elif (__cplusplus >= 201103) -# if __has_include() -# define ASIO_HAS_STD_SYSTEM_ERROR 1 -# endif // __has_include() -# endif // (__cplusplus >= 201103) -# endif // defined(__clang__) -# if defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define ASIO_HAS_STD_SYSTEM_ERROR 1 -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1700) -# define ASIO_HAS_STD_SYSTEM_ERROR 1 -# endif // (_MSC_VER >= 1700) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_STD_SYSTEM_ERROR) -#endif // !defined(ASIO_HAS_STD_SYSTEM_ERROR) - -// Compliant C++11 compilers put noexcept specifiers on error_category members. -#if !defined(ASIO_ERROR_CATEGORY_NOEXCEPT) -# if (BOOST_VERSION >= 105300) -# define ASIO_ERROR_CATEGORY_NOEXCEPT BOOST_NOEXCEPT -# elif defined(__clang__) -# if __has_feature(__cxx_noexcept__) -# define ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true) -# endif // __has_feature(__cxx_noexcept__) -# elif defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true) -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) -# elif defined(ASIO_MSVC) -# if (_MSC_VER >= 1900) -# define ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true) -# endif // (_MSC_VER >= 1900) -# endif // defined(ASIO_MSVC) -# if !defined(ASIO_ERROR_CATEGORY_NOEXCEPT) -# define ASIO_ERROR_CATEGORY_NOEXCEPT -# endif // !defined(ASIO_ERROR_CATEGORY_NOEXCEPT) -#endif // !defined(ASIO_ERROR_CATEGORY_NOEXCEPT) - -// Standard library support for arrays. -#if !defined(ASIO_HAS_STD_ARRAY) -# if !defined(ASIO_DISABLE_STD_ARRAY) -# if defined(__clang__) -# if defined(ASIO_HAS_CLANG_LIBCXX) -# define ASIO_HAS_STD_ARRAY 1 -# elif (__cplusplus >= 201103) -# if __has_include() -# define ASIO_HAS_STD_ARRAY 1 -# endif // __has_include() -# endif // (__cplusplus >= 201103) -# endif // defined(__clang__) -# if defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define ASIO_HAS_STD_ARRAY 1 -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1600) -# define ASIO_HAS_STD_ARRAY 1 -# endif // (_MSC_VER >= 1600) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_STD_ARRAY) -#endif // !defined(ASIO_HAS_STD_ARRAY) - -// Standard library support for shared_ptr and weak_ptr. -#if !defined(ASIO_HAS_STD_SHARED_PTR) -# if !defined(ASIO_DISABLE_STD_SHARED_PTR) -# if defined(__clang__) -# if defined(ASIO_HAS_CLANG_LIBCXX) -# define ASIO_HAS_STD_SHARED_PTR 1 -# elif (__cplusplus >= 201103) -# define ASIO_HAS_STD_SHARED_PTR 1 -# endif // (__cplusplus >= 201103) -# endif // defined(__clang__) -# if defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define ASIO_HAS_STD_SHARED_PTR 1 -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1600) -# define ASIO_HAS_STD_SHARED_PTR 1 -# endif // (_MSC_VER >= 1600) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_STD_SHARED_PTR) -#endif // !defined(ASIO_HAS_STD_SHARED_PTR) - -// Standard library support for allocator_arg_t. -#if !defined(ASIO_HAS_STD_ALLOCATOR_ARG) -# if !defined(ASIO_DISABLE_STD_ALLOCATOR_ARG) -# if defined(__clang__) -# if defined(ASIO_HAS_CLANG_LIBCXX) -# define ASIO_HAS_STD_ALLOCATOR_ARG 1 -# elif (__cplusplus >= 201103) -# define ASIO_HAS_STD_ALLOCATOR_ARG 1 -# endif // (__cplusplus >= 201103) -# endif // defined(__clang__) -# if defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define ASIO_HAS_STD_ALLOCATOR_ARG 1 -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1600) -# define ASIO_HAS_STD_ALLOCATOR_ARG 1 -# endif // (_MSC_VER >= 1600) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_STD_ALLOCATOR_ARG) -#endif // !defined(ASIO_HAS_STD_ALLOCATOR_ARG) - -// Standard library support for atomic operations. -#if !defined(ASIO_HAS_STD_ATOMIC) -# if !defined(ASIO_DISABLE_STD_ATOMIC) -# if defined(__clang__) -# if defined(ASIO_HAS_CLANG_LIBCXX) -# define ASIO_HAS_STD_ATOMIC 1 -# elif (__cplusplus >= 201103) -# if __has_include() -# define ASIO_HAS_STD_ATOMIC 1 -# endif // __has_include() -# endif // (__cplusplus >= 201103) -# endif // defined(__clang__) -# if defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define ASIO_HAS_STD_ATOMIC 1 -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1700) -# define ASIO_HAS_STD_ATOMIC 1 -# endif // (_MSC_VER >= 1700) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_STD_ATOMIC) -#endif // !defined(ASIO_HAS_STD_ATOMIC) - -// Standard library support for chrono. Some standard libraries (such as the -// libstdc++ shipped with gcc 4.6) provide monotonic_clock as per early C++0x -// drafts, rather than the eventually standardised name of steady_clock. -#if !defined(ASIO_HAS_STD_CHRONO) -# if !defined(ASIO_DISABLE_STD_CHRONO) -# if defined(__clang__) -# if defined(ASIO_HAS_CLANG_LIBCXX) -# define ASIO_HAS_STD_CHRONO 1 -# elif (__cplusplus >= 201103) -# if __has_include() -# define ASIO_HAS_STD_CHRONO 1 -# endif // __has_include() -# endif // (__cplusplus >= 201103) -# endif // defined(__clang__) -# if defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define ASIO_HAS_STD_CHRONO 1 -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6)) -# define ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK 1 -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6)) -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1700) -# define ASIO_HAS_STD_CHRONO 1 -# endif // (_MSC_VER >= 1700) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_STD_CHRONO) -#endif // !defined(ASIO_HAS_STD_CHRONO) - -// Boost support for chrono. -#if !defined(ASIO_HAS_BOOST_CHRONO) -# if !defined(ASIO_DISABLE_BOOST_CHRONO) -# if (BOOST_VERSION >= 104700) -# define ASIO_HAS_BOOST_CHRONO 1 -# endif // (BOOST_VERSION >= 104700) -# endif // !defined(ASIO_DISABLE_BOOST_CHRONO) -#endif // !defined(ASIO_HAS_BOOST_CHRONO) - -// Some form of chrono library is available. -#if !defined(ASIO_HAS_CHRONO) -# if defined(ASIO_HAS_STD_CHRONO) \ - || defined(ASIO_HAS_BOOST_CHRONO) -# define ASIO_HAS_CHRONO 1 -# endif // defined(ASIO_HAS_STD_CHRONO) - // || defined(ASIO_HAS_BOOST_CHRONO) -#endif // !defined(ASIO_HAS_CHRONO) - -// Boost support for the DateTime library. -#if !defined(ASIO_HAS_BOOST_DATE_TIME) -# if !defined(ASIO_DISABLE_BOOST_DATE_TIME) -# define ASIO_HAS_BOOST_DATE_TIME 1 -# endif // !defined(ASIO_DISABLE_BOOST_DATE_TIME) -#endif // !defined(ASIO_HAS_BOOST_DATE_TIME) - -// Standard library support for addressof. -#if !defined(ASIO_HAS_STD_ADDRESSOF) -# if !defined(ASIO_DISABLE_STD_ADDRESSOF) -# if defined(__clang__) -# if defined(ASIO_HAS_CLANG_LIBCXX) -# define ASIO_HAS_STD_ADDRESSOF 1 -# elif (__cplusplus >= 201103) -# define ASIO_HAS_STD_ADDRESSOF 1 -# endif // (__cplusplus >= 201103) -# endif // defined(__clang__) -# if defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define ASIO_HAS_STD_ADDRESSOF 1 -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1700) -# define ASIO_HAS_STD_ADDRESSOF 1 -# endif // (_MSC_VER >= 1700) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_STD_ADDRESSOF) -#endif // !defined(ASIO_HAS_STD_ADDRESSOF) - -// Standard library support for the function class. -#if !defined(ASIO_HAS_STD_FUNCTION) -# if !defined(ASIO_DISABLE_STD_FUNCTION) -# if defined(__clang__) -# if defined(ASIO_HAS_CLANG_LIBCXX) -# define ASIO_HAS_STD_FUNCTION 1 -# elif (__cplusplus >= 201103) -# define ASIO_HAS_STD_FUNCTION 1 -# endif // (__cplusplus >= 201103) -# endif // defined(__clang__) -# if defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define ASIO_HAS_STD_FUNCTION 1 -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1700) -# define ASIO_HAS_STD_FUNCTION 1 -# endif // (_MSC_VER >= 1700) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_STD_FUNCTION) -#endif // !defined(ASIO_HAS_STD_FUNCTION) - -// Standard library support for type traits. -#if !defined(ASIO_HAS_STD_TYPE_TRAITS) -# if !defined(ASIO_DISABLE_STD_TYPE_TRAITS) -# if defined(__clang__) -# if defined(ASIO_HAS_CLANG_LIBCXX) -# define ASIO_HAS_STD_TYPE_TRAITS 1 -# elif (__cplusplus >= 201103) -# if __has_include() -# define ASIO_HAS_STD_TYPE_TRAITS 1 -# endif // __has_include() -# endif // (__cplusplus >= 201103) -# endif // defined(__clang__) -# if defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define ASIO_HAS_STD_TYPE_TRAITS 1 -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1700) -# define ASIO_HAS_STD_TYPE_TRAITS 1 -# endif // (_MSC_VER >= 1700) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_STD_TYPE_TRAITS) -#endif // !defined(ASIO_HAS_STD_TYPE_TRAITS) - -// Standard library support for the nullptr_t type. -#if !defined(ASIO_HAS_NULLPTR) -# if !defined(ASIO_DISABLE_NULLPTR) -# if defined(__clang__) -# if __has_feature(__cxx_nullptr__) -# define ASIO_HAS_NULLPTR 1 -# endif // __has_feature(__cxx_rvalue_references__) -# elif defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define ASIO_HAS_NULLPTR 1 -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1700) -# define ASIO_HAS_NULLPTR 1 -# endif // (_MSC_VER >= 1700) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_NULLPTR) -#endif // !defined(ASIO_HAS_NULLPTR) - -// Standard library support for the C++11 allocator additions. -#if !defined(ASIO_HAS_CXX11_ALLOCATORS) -# if !defined(ASIO_DISABLE_CXX11_ALLOCATORS) -# if defined(__clang__) -# if defined(ASIO_HAS_CLANG_LIBCXX) -# define ASIO_HAS_CXX11_ALLOCATORS 1 -# elif (__cplusplus >= 201103) -# define ASIO_HAS_CXX11_ALLOCATORS 1 -# endif // (__cplusplus >= 201103) -# elif defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define ASIO_HAS_CXX11_ALLOCATORS 1 -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1800) -# define ASIO_HAS_CXX11_ALLOCATORS 1 -# endif // (_MSC_VER >= 1800) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_CXX11_ALLOCATORS) -#endif // !defined(ASIO_HAS_CXX11_ALLOCATORS) - -// Standard library support for the cstdint header. -#if !defined(ASIO_HAS_CSTDINT) -# if !defined(ASIO_DISABLE_CSTDINT) -# if defined(__clang__) -# if defined(ASIO_HAS_CLANG_LIBCXX) -# define ASIO_HAS_CSTDINT 1 -# elif (__cplusplus >= 201103) -# define ASIO_HAS_CSTDINT 1 -# endif // (__cplusplus >= 201103) -# endif // defined(__clang__) -# if defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define ASIO_HAS_CSTDINT 1 -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1700) -# define ASIO_HAS_CSTDINT 1 -# endif // (_MSC_VER >= 1700) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_CSTDINT) -#endif // !defined(ASIO_HAS_CSTDINT) - -// Standard library support for the thread class. -#if !defined(ASIO_HAS_STD_THREAD) -# if !defined(ASIO_DISABLE_STD_THREAD) -# if defined(__clang__) -# if defined(ASIO_HAS_CLANG_LIBCXX) -# define ASIO_HAS_STD_THREAD 1 -# elif (__cplusplus >= 201103) -# if __has_include() -# define ASIO_HAS_STD_THREAD 1 -# endif // __has_include() -# endif // (__cplusplus >= 201103) -# endif // defined(__clang__) -# if defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define ASIO_HAS_STD_THREAD 1 -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1700) -# define ASIO_HAS_STD_THREAD 1 -# endif // (_MSC_VER >= 1700) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_STD_THREAD) -#endif // !defined(ASIO_HAS_STD_THREAD) - -// Standard library support for the mutex and condition variable classes. -#if !defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) -# if !defined(ASIO_DISABLE_STD_MUTEX_AND_CONDVAR) -# if defined(__clang__) -# if defined(ASIO_HAS_CLANG_LIBCXX) -# define ASIO_HAS_STD_MUTEX_AND_CONDVAR 1 -# elif (__cplusplus >= 201103) -# if __has_include() -# define ASIO_HAS_STD_MUTEX_AND_CONDVAR 1 -# endif // __has_include() -# endif // (__cplusplus >= 201103) -# endif // defined(__clang__) -# if defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define ASIO_HAS_STD_MUTEX_AND_CONDVAR 1 -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1700) -# define ASIO_HAS_STD_MUTEX_AND_CONDVAR 1 -# endif // (_MSC_VER >= 1700) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_STD_MUTEX_AND_CONDVAR) -#endif // !defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) - -// Standard library support for the call_once function. -#if !defined(ASIO_HAS_STD_CALL_ONCE) -# if !defined(ASIO_DISABLE_STD_CALL_ONCE) -# if defined(__clang__) -# if defined(ASIO_HAS_CLANG_LIBCXX) -# define ASIO_HAS_STD_CALL_ONCE 1 -# elif (__cplusplus >= 201103) -# if __has_include() -# define ASIO_HAS_STD_CALL_ONCE 1 -# endif // __has_include() -# endif // (__cplusplus >= 201103) -# endif // defined(__clang__) -# if defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define ASIO_HAS_STD_CALL_ONCE 1 -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1700) -# define ASIO_HAS_STD_CALL_ONCE 1 -# endif // (_MSC_VER >= 1700) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_STD_CALL_ONCE) -#endif // !defined(ASIO_HAS_STD_CALL_ONCE) - -// Standard library support for futures. -#if !defined(ASIO_HAS_STD_FUTURE) -# if !defined(ASIO_DISABLE_STD_FUTURE) -# if defined(__clang__) -# if defined(ASIO_HAS_CLANG_LIBCXX) -# define ASIO_HAS_STD_FUTURE 1 -# elif (__cplusplus >= 201103) -# if __has_include() -# define ASIO_HAS_STD_FUTURE 1 -# endif // __has_include() -# endif // (__cplusplus >= 201103) -# endif // defined(__clang__) -# if defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# if defined(_GLIBCXX_HAS_GTHREADS) -# define ASIO_HAS_STD_FUTURE 1 -# endif // defined(_GLIBCXX_HAS_GTHREADS) -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1700) -# define ASIO_HAS_STD_FUTURE 1 -# endif // (_MSC_VER >= 1700) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_STD_FUTURE) -#endif // !defined(ASIO_HAS_STD_FUTURE) - -// Standard library support for std::string_view. -#if !defined(ASIO_HAS_STD_STRING_VIEW) -# if !defined(ASIO_DISABLE_STD_STRING_VIEW) -# if defined(__clang__) -# if (__cplusplus >= 201703) -# if __has_include() -# define ASIO_HAS_STD_STRING_VIEW 1 -# endif // __has_include() -# endif // (__cplusplus >= 201703) -# endif // defined(__clang__) -# if defined(__GNUC__) -# if (__GNUC__ >= 7) -# if (__cplusplus >= 201703) -# define ASIO_HAS_STD_STRING_VIEW 1 -# endif // (__cplusplus >= 201703) -# endif // (__GNUC__ >= 7) -# endif // defined(__GNUC__) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1910 && _HAS_CXX17) -# define ASIO_HAS_STD_STRING_VIEW -# endif // (_MSC_VER >= 1910 && _HAS_CXX17) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_STD_STRING_VIEW) -#endif // !defined(ASIO_HAS_STD_STRING_VIEW) - -// Standard library support for std::experimental::string_view. -#if !defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW) -# if !defined(ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW) -# if defined(__clang__) -# if (__cplusplus >= 201402) -# if __has_include() -# define ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1 -# endif // __has_include() -# endif // (__cplusplus >= 201402) -# endif // defined(__clang__) -# if defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4) -# if (__cplusplus >= 201402) -# define ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1 -# endif // (__cplusplus >= 201402) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# endif // !defined(ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW) -#endif // !defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW) - -// Standard library has a string_view that we can use. -#if !defined(ASIO_HAS_STRING_VIEW) -# if !defined(ASIO_DISABLE_STRING_VIEW) -# if defined(ASIO_HAS_STD_STRING_VIEW) -# define ASIO_HAS_STRING_VIEW 1 -# elif defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW) -# define ASIO_HAS_STRING_VIEW 1 -# endif // defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW) -# endif // !defined(ASIO_DISABLE_STRING_VIEW) -#endif // !defined(ASIO_HAS_STRING_VIEW) - -// Standard library support for iostream move construction and assignment. -#if !defined(ASIO_HAS_STD_IOSTREAM_MOVE) -# if !defined(ASIO_DISABLE_STD_IOSTREAM_MOVE) -# if defined(__GNUC__) -# if (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define ASIO_HAS_STD_IOSTREAM_MOVE 1 -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1700) -# define ASIO_HAS_STD_IOSTREAM_MOVE 1 -# endif // (_MSC_VER >= 1700) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_STD_IOSTREAM_MOVE) -#endif // !defined(ASIO_HAS_STD_IOSTREAM_MOVE) - -// Standard library has invoke_result (which supersedes result_of). -#if !defined(ASIO_HAS_STD_INVOKE_RESULT) -# if !defined(ASIO_DISABLE_STD_INVOKE_RESULT) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1910 && _HAS_CXX17) -# define ASIO_HAS_STD_INVOKE_RESULT 1 -# endif // (_MSC_VER >= 1910 && _HAS_CXX17) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_STD_INVOKE_RESULT) -#endif // !defined(ASIO_HAS_STD_INVOKE_RESULT) - -// Windows App target. Windows but with a limited API. -#if !defined(ASIO_WINDOWS_APP) -# if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0603) -# include -# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) \ - && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) -# define ASIO_WINDOWS_APP 1 -# endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) - // && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) -# endif // defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0603) -#endif // !defined(ASIO_WINDOWS_APP) - -// Legacy WinRT target. Windows App is preferred. -#if !defined(ASIO_WINDOWS_RUNTIME) -# if !defined(ASIO_WINDOWS_APP) -# if defined(__cplusplus_winrt) -# include -# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) \ - && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) -# define ASIO_WINDOWS_RUNTIME 1 -# endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) - // && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) -# endif // defined(__cplusplus_winrt) -# endif // !defined(ASIO_WINDOWS_APP) -#endif // !defined(ASIO_WINDOWS_RUNTIME) - -// Windows target. Excludes WinRT but includes Windows App targets. -#if !defined(ASIO_WINDOWS) -# if !defined(ASIO_WINDOWS_RUNTIME) -# if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS) -# define ASIO_WINDOWS 1 -# elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) -# define ASIO_WINDOWS 1 -# elif defined(ASIO_WINDOWS_APP) -# define ASIO_WINDOWS 1 -# endif // defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS) -# endif // !defined(ASIO_WINDOWS_RUNTIME) -#endif // !defined(ASIO_WINDOWS) - -// Windows: target OS version. -#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) -# if !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS) -# if defined(_MSC_VER) || defined(__BORLANDC__) -# pragma message( \ - "Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example:\n"\ - "- add -D_WIN32_WINNT=0x0501 to the compiler command line; or\n"\ - "- add _WIN32_WINNT=0x0501 to your project's Preprocessor Definitions.\n"\ - "Assuming _WIN32_WINNT=0x0501 (i.e. Windows XP target).") -# else // defined(_MSC_VER) || defined(__BORLANDC__) -# warning Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. -# warning For example, add -D_WIN32_WINNT=0x0501 to the compiler command line. -# warning Assuming _WIN32_WINNT=0x0501 (i.e. Windows XP target). -# endif // defined(_MSC_VER) || defined(__BORLANDC__) -# define _WIN32_WINNT 0x0501 -# endif // !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS) -# if defined(_MSC_VER) -# if defined(_WIN32) && !defined(WIN32) -# if !defined(_WINSOCK2API_) -# define WIN32 // Needed for correct types in winsock2.h -# else // !defined(_WINSOCK2API_) -# error Please define the macro WIN32 in your compiler options -# endif // !defined(_WINSOCK2API_) -# endif // defined(_WIN32) && !defined(WIN32) -# endif // defined(_MSC_VER) -# if defined(__BORLANDC__) -# if defined(__WIN32__) && !defined(WIN32) -# if !defined(_WINSOCK2API_) -# define WIN32 // Needed for correct types in winsock2.h -# else // !defined(_WINSOCK2API_) -# error Please define the macro WIN32 in your compiler options -# endif // !defined(_WINSOCK2API_) -# endif // defined(__WIN32__) && !defined(WIN32) -# endif // defined(__BORLANDC__) -# if defined(__CYGWIN__) -# if !defined(__USE_W32_SOCKETS) -# error You must add -D__USE_W32_SOCKETS to your compiler options. -# endif // !defined(__USE_W32_SOCKETS) -# endif // defined(__CYGWIN__) -#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) - -// Windows: minimise header inclusion. -#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) -# if !defined(ASIO_NO_WIN32_LEAN_AND_MEAN) -# if !defined(WIN32_LEAN_AND_MEAN) -# define WIN32_LEAN_AND_MEAN -# endif // !defined(WIN32_LEAN_AND_MEAN) -# endif // !defined(ASIO_NO_WIN32_LEAN_AND_MEAN) -#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) - -// Windows: suppress definition of "min" and "max" macros. -#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) -# if !defined(ASIO_NO_NOMINMAX) -# if !defined(NOMINMAX) -# define NOMINMAX 1 -# endif // !defined(NOMINMAX) -# endif // !defined(ASIO_NO_NOMINMAX) -#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) - -// Windows: IO Completion Ports. -#if !defined(ASIO_HAS_IOCP) -# if defined(ASIO_WINDOWS) || defined(__CYGWIN__) -# if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400) -# if !defined(UNDER_CE) && !defined(ASIO_WINDOWS_APP) -# if !defined(ASIO_DISABLE_IOCP) -# define ASIO_HAS_IOCP 1 -# endif // !defined(ASIO_DISABLE_IOCP) -# endif // !defined(UNDER_CE) && !defined(ASIO_WINDOWS_APP) -# endif // defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400) -# endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) -#endif // !defined(ASIO_HAS_IOCP) - -// On POSIX (and POSIX-like) platforms we need to include unistd.h in order to -// get access to the various platform feature macros, e.g. to be able to test -// for threads support. -#if !defined(ASIO_HAS_UNISTD_H) -# if !defined(ASIO_HAS_BOOST_CONFIG) -# if defined(unix) \ - || defined(__unix) \ - || defined(_XOPEN_SOURCE) \ - || defined(_POSIX_SOURCE) \ - || (defined(__MACH__) && defined(__APPLE__)) \ - || defined(__FreeBSD__) \ - || defined(__NetBSD__) \ - || defined(__OpenBSD__) \ - || defined(__linux__) -# define ASIO_HAS_UNISTD_H 1 -# endif -# endif // !defined(ASIO_HAS_BOOST_CONFIG) -#endif // !defined(ASIO_HAS_UNISTD_H) -#if defined(ASIO_HAS_UNISTD_H) -# include -#endif // defined(ASIO_HAS_UNISTD_H) - -// Linux: epoll, eventfd and timerfd. -#if defined(__linux__) -# include -# if !defined(ASIO_HAS_EPOLL) -# if !defined(ASIO_DISABLE_EPOLL) -# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45) -# define ASIO_HAS_EPOLL 1 -# endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45) -# endif // !defined(ASIO_DISABLE_EPOLL) -# endif // !defined(ASIO_HAS_EPOLL) -# if !defined(ASIO_HAS_EVENTFD) -# if !defined(ASIO_DISABLE_EVENTFD) -# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) -# define ASIO_HAS_EVENTFD 1 -# endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) -# endif // !defined(ASIO_DISABLE_EVENTFD) -# endif // !defined(ASIO_HAS_EVENTFD) -# if !defined(ASIO_HAS_TIMERFD) -# if defined(ASIO_HAS_EPOLL) -# if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) -# define ASIO_HAS_TIMERFD 1 -# endif // (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) -# endif // defined(ASIO_HAS_EPOLL) -# endif // !defined(ASIO_HAS_TIMERFD) -#endif // defined(__linux__) - -// Mac OS X, FreeBSD, NetBSD, OpenBSD: kqueue. -#if (defined(__MACH__) && defined(__APPLE__)) \ - || defined(__FreeBSD__) \ - || defined(__NetBSD__) \ - || defined(__OpenBSD__) -# if !defined(ASIO_HAS_KQUEUE) -# if !defined(ASIO_DISABLE_KQUEUE) -# define ASIO_HAS_KQUEUE 1 -# endif // !defined(ASIO_DISABLE_KQUEUE) -# endif // !defined(ASIO_HAS_KQUEUE) -#endif // (defined(__MACH__) && defined(__APPLE__)) - // || defined(__FreeBSD__) - // || defined(__NetBSD__) - // || defined(__OpenBSD__) - -// Solaris: /dev/poll. -#if defined(__sun) -# if !defined(ASIO_HAS_DEV_POLL) -# if !defined(ASIO_DISABLE_DEV_POLL) -# define ASIO_HAS_DEV_POLL 1 -# endif // !defined(ASIO_DISABLE_DEV_POLL) -# endif // !defined(ASIO_HAS_DEV_POLL) -#endif // defined(__sun) - -// Serial ports. -#if !defined(ASIO_HAS_SERIAL_PORT) -# if defined(ASIO_HAS_IOCP) \ - || !defined(ASIO_WINDOWS) \ - && !defined(ASIO_WINDOWS_RUNTIME) \ - && !defined(__CYGWIN__) -# if !defined(__SYMBIAN32__) -# if !defined(ASIO_DISABLE_SERIAL_PORT) -# define ASIO_HAS_SERIAL_PORT 1 -# endif // !defined(ASIO_DISABLE_SERIAL_PORT) -# endif // !defined(__SYMBIAN32__) -# endif // defined(ASIO_HAS_IOCP) - // || !defined(ASIO_WINDOWS) - // && !defined(ASIO_WINDOWS_RUNTIME) - // && !defined(__CYGWIN__) -#endif // !defined(ASIO_HAS_SERIAL_PORT) - -// Windows: stream handles. -#if !defined(ASIO_HAS_WINDOWS_STREAM_HANDLE) -# if !defined(ASIO_DISABLE_WINDOWS_STREAM_HANDLE) -# if defined(ASIO_HAS_IOCP) -# define ASIO_HAS_WINDOWS_STREAM_HANDLE 1 -# endif // defined(ASIO_HAS_IOCP) -# endif // !defined(ASIO_DISABLE_WINDOWS_STREAM_HANDLE) -#endif // !defined(ASIO_HAS_WINDOWS_STREAM_HANDLE) - -// Windows: random access handles. -#if !defined(ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE) -# if !defined(ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE) -# if defined(ASIO_HAS_IOCP) -# define ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE 1 -# endif // defined(ASIO_HAS_IOCP) -# endif // !defined(ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE) -#endif // !defined(ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE) - -// Windows: object handles. -#if !defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) -# if !defined(ASIO_DISABLE_WINDOWS_OBJECT_HANDLE) -# if defined(ASIO_WINDOWS) || defined(__CYGWIN__) -# if !defined(UNDER_CE) && !defined(ASIO_WINDOWS_APP) -# define ASIO_HAS_WINDOWS_OBJECT_HANDLE 1 -# endif // !defined(UNDER_CE) && !defined(ASIO_WINDOWS_APP) -# endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) -# endif // !defined(ASIO_DISABLE_WINDOWS_OBJECT_HANDLE) -#endif // !defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) - -// Windows: OVERLAPPED wrapper. -#if !defined(ASIO_HAS_WINDOWS_OVERLAPPED_PTR) -# if !defined(ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR) -# if defined(ASIO_HAS_IOCP) -# define ASIO_HAS_WINDOWS_OVERLAPPED_PTR 1 -# endif // defined(ASIO_HAS_IOCP) -# endif // !defined(ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR) -#endif // !defined(ASIO_HAS_WINDOWS_OVERLAPPED_PTR) - -// POSIX: stream-oriented file descriptors. -#if !defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) -# if !defined(ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR) -# if !defined(ASIO_WINDOWS) \ - && !defined(ASIO_WINDOWS_RUNTIME) \ - && !defined(__CYGWIN__) -# define ASIO_HAS_POSIX_STREAM_DESCRIPTOR 1 -# endif // !defined(ASIO_WINDOWS) - // && !defined(ASIO_WINDOWS_RUNTIME) - // && !defined(__CYGWIN__) -# endif // !defined(ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR) -#endif // !defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) - -// UNIX domain sockets. -#if !defined(ASIO_HAS_LOCAL_SOCKETS) -# if !defined(ASIO_DISABLE_LOCAL_SOCKETS) -# if !defined(ASIO_WINDOWS) \ - && !defined(ASIO_WINDOWS_RUNTIME) \ - && !defined(__CYGWIN__) -# define ASIO_HAS_LOCAL_SOCKETS 1 -# endif // !defined(ASIO_WINDOWS) - // && !defined(ASIO_WINDOWS_RUNTIME) - // && !defined(__CYGWIN__) -# endif // !defined(ASIO_DISABLE_LOCAL_SOCKETS) -#endif // !defined(ASIO_HAS_LOCAL_SOCKETS) - -// Can use sigaction() instead of signal(). -#if !defined(ASIO_HAS_SIGACTION) -# if !defined(ASIO_DISABLE_SIGACTION) -# if !defined(ASIO_WINDOWS) \ - && !defined(ASIO_WINDOWS_RUNTIME) \ - && !defined(__CYGWIN__) -# define ASIO_HAS_SIGACTION 1 -# endif // !defined(ASIO_WINDOWS) - // && !defined(ASIO_WINDOWS_RUNTIME) - // && !defined(__CYGWIN__) -# endif // !defined(ASIO_DISABLE_SIGACTION) -#endif // !defined(ASIO_HAS_SIGACTION) - -// Can use signal(). -#if !defined(ASIO_HAS_SIGNAL) -# if !defined(ASIO_DISABLE_SIGNAL) -# if !defined(UNDER_CE) -# define ASIO_HAS_SIGNAL 1 -# endif // !defined(UNDER_CE) -# endif // !defined(ASIO_DISABLE_SIGNAL) -#endif // !defined(ASIO_HAS_SIGNAL) - -// Can use getaddrinfo() and getnameinfo(). -#if !defined(ASIO_HAS_GETADDRINFO) -# if !defined(ASIO_DISABLE_GETADDRINFO) -# if defined(ASIO_WINDOWS) || defined(__CYGWIN__) -# if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501) -# define ASIO_HAS_GETADDRINFO 1 -# elif defined(UNDER_CE) -# define ASIO_HAS_GETADDRINFO 1 -# endif // defined(UNDER_CE) -# elif defined(__MACH__) && defined(__APPLE__) -# if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) -# if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) -# define ASIO_HAS_GETADDRINFO 1 -# endif // (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) -# else // defined(__MAC_OS_X_VERSION_MIN_REQUIRED) -# define ASIO_HAS_GETADDRINFO 1 -# endif // defined(__MAC_OS_X_VERSION_MIN_REQUIRED) -# else // defined(__MACH__) && defined(__APPLE__) -# define ASIO_HAS_GETADDRINFO 1 -# endif // defined(__MACH__) && defined(__APPLE__) -# endif // !defined(ASIO_DISABLE_GETADDRINFO) -#endif // !defined(ASIO_HAS_GETADDRINFO) - -// Whether standard iostreams are disabled. -#if !defined(ASIO_NO_IOSTREAM) -# if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_IOSTREAM) -# define ASIO_NO_IOSTREAM 1 -# endif // !defined(BOOST_NO_IOSTREAM) -#endif // !defined(ASIO_NO_IOSTREAM) - -// Whether exception handling is disabled. -#if !defined(ASIO_NO_EXCEPTIONS) -# if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_EXCEPTIONS) -# define ASIO_NO_EXCEPTIONS 1 -# endif // !defined(BOOST_NO_EXCEPTIONS) -#endif // !defined(ASIO_NO_EXCEPTIONS) - -// Whether the typeid operator is supported. -#if !defined(ASIO_NO_TYPEID) -# if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_TYPEID) -# define ASIO_NO_TYPEID 1 -# endif // !defined(BOOST_NO_TYPEID) -#endif // !defined(ASIO_NO_TYPEID) - -// Threads. -#if !defined(ASIO_HAS_THREADS) -# if !defined(ASIO_DISABLE_THREADS) -# if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS) -# define ASIO_HAS_THREADS 1 -# elif defined(__GNUC__) && !defined(__MINGW32__) \ - && !defined(linux) && !defined(__linux) && !defined(__linux__) -# define ASIO_HAS_THREADS 1 -# elif defined(_MT) || defined(__MT__) -# define ASIO_HAS_THREADS 1 -# elif defined(_REENTRANT) -# define ASIO_HAS_THREADS 1 -# elif defined(__APPLE__) -# define ASIO_HAS_THREADS 1 -# elif defined(_POSIX_THREADS) && (_POSIX_THREADS + 0 >= 0) -# define ASIO_HAS_THREADS 1 -# elif defined(_PTHREADS) -# define ASIO_HAS_THREADS 1 -# endif // defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS) -# endif // !defined(ASIO_DISABLE_THREADS) -#endif // !defined(ASIO_HAS_THREADS) - -// POSIX threads. -#if !defined(ASIO_HAS_PTHREADS) -# if defined(ASIO_HAS_THREADS) -# if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS) -# define ASIO_HAS_PTHREADS 1 -# elif defined(_POSIX_THREADS) && (_POSIX_THREADS + 0 >= 0) -# define ASIO_HAS_PTHREADS 1 -# endif // defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS) -# endif // defined(ASIO_HAS_THREADS) -#endif // !defined(ASIO_HAS_PTHREADS) - -// Helper to prevent macro expansion. -#define ASIO_PREVENT_MACRO_SUBSTITUTION - -// Helper to define in-class constants. -#if !defined(ASIO_STATIC_CONSTANT) -# if !defined(ASIO_DISABLE_BOOST_STATIC_CONSTANT) -# define ASIO_STATIC_CONSTANT(type, assignment) \ - BOOST_STATIC_CONSTANT(type, assignment) -# else // !defined(ASIO_DISABLE_BOOST_STATIC_CONSTANT) -# define ASIO_STATIC_CONSTANT(type, assignment) \ - static const type assignment -# endif // !defined(ASIO_DISABLE_BOOST_STATIC_CONSTANT) -#endif // !defined(ASIO_STATIC_CONSTANT) - -// Boost array library. -#if !defined(ASIO_HAS_BOOST_ARRAY) -# if !defined(ASIO_DISABLE_BOOST_ARRAY) -# define ASIO_HAS_BOOST_ARRAY 1 -# endif // !defined(ASIO_DISABLE_BOOST_ARRAY) -#endif // !defined(ASIO_HAS_BOOST_ARRAY) - -// Boost assert macro. -#if !defined(ASIO_HAS_BOOST_ASSERT) -# if !defined(ASIO_DISABLE_BOOST_ASSERT) -# define ASIO_HAS_BOOST_ASSERT 1 -# endif // !defined(ASIO_DISABLE_BOOST_ASSERT) -#endif // !defined(ASIO_HAS_BOOST_ASSERT) - -// Boost limits header. -#if !defined(ASIO_HAS_BOOST_LIMITS) -# if !defined(ASIO_DISABLE_BOOST_LIMITS) -# define ASIO_HAS_BOOST_LIMITS 1 -# endif // !defined(ASIO_DISABLE_BOOST_LIMITS) -#endif // !defined(ASIO_HAS_BOOST_LIMITS) - -// Boost throw_exception function. -#if !defined(ASIO_HAS_BOOST_THROW_EXCEPTION) -# if !defined(ASIO_DISABLE_BOOST_THROW_EXCEPTION) -# define ASIO_HAS_BOOST_THROW_EXCEPTION 1 -# endif // !defined(ASIO_DISABLE_BOOST_THROW_EXCEPTION) -#endif // !defined(ASIO_HAS_BOOST_THROW_EXCEPTION) - -// Boost regex library. -#if !defined(ASIO_HAS_BOOST_REGEX) -# if !defined(ASIO_DISABLE_BOOST_REGEX) -# define ASIO_HAS_BOOST_REGEX 1 -# endif // !defined(ASIO_DISABLE_BOOST_REGEX) -#endif // !defined(ASIO_HAS_BOOST_REGEX) - -// Boost bind function. -#if !defined(ASIO_HAS_BOOST_BIND) -# if !defined(ASIO_DISABLE_BOOST_BIND) -# define ASIO_HAS_BOOST_BIND 1 -# endif // !defined(ASIO_DISABLE_BOOST_BIND) -#endif // !defined(ASIO_HAS_BOOST_BIND) - -// Boost's BOOST_WORKAROUND macro. -#if !defined(ASIO_HAS_BOOST_WORKAROUND) -# if !defined(ASIO_DISABLE_BOOST_WORKAROUND) -# define ASIO_HAS_BOOST_WORKAROUND 1 -# endif // !defined(ASIO_DISABLE_BOOST_WORKAROUND) -#endif // !defined(ASIO_HAS_BOOST_WORKAROUND) - -// Microsoft Visual C++'s secure C runtime library. -#if !defined(ASIO_HAS_SECURE_RTL) -# if !defined(ASIO_DISABLE_SECURE_RTL) -# if defined(ASIO_MSVC) \ - && (ASIO_MSVC >= 1400) \ - && !defined(UNDER_CE) -# define ASIO_HAS_SECURE_RTL 1 -# endif // defined(ASIO_MSVC) - // && (ASIO_MSVC >= 1400) - // && !defined(UNDER_CE) -# endif // !defined(ASIO_DISABLE_SECURE_RTL) -#endif // !defined(ASIO_HAS_SECURE_RTL) - -// Handler hooking. Disabled for ancient Borland C++ and gcc compilers. -#if !defined(ASIO_HAS_HANDLER_HOOKS) -# if !defined(ASIO_DISABLE_HANDLER_HOOKS) -# if defined(__GNUC__) -# if (__GNUC__ >= 3) -# define ASIO_HAS_HANDLER_HOOKS 1 -# endif // (__GNUC__ >= 3) -# elif !defined(__BORLANDC__) -# define ASIO_HAS_HANDLER_HOOKS 1 -# endif // !defined(__BORLANDC__) -# endif // !defined(ASIO_DISABLE_HANDLER_HOOKS) -#endif // !defined(ASIO_HAS_HANDLER_HOOKS) - -// Support for the __thread keyword extension. -#if !defined(ASIO_DISABLE_THREAD_KEYWORD_EXTENSION) -# if defined(__linux__) -# if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) -# if ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3) -# if !defined(__INTEL_COMPILER) && !defined(__ICL) \ - && !(defined(__clang__) && defined(__ANDROID__)) -# define ASIO_HAS_THREAD_KEYWORD_EXTENSION 1 -# define ASIO_THREAD_KEYWORD __thread -# elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1100) -# define ASIO_HAS_THREAD_KEYWORD_EXTENSION 1 -# endif // defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1100) - // && !(defined(__clang__) && defined(__ANDROID__)) -# endif // ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3) -# endif // defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) -# endif // defined(__linux__) -# if defined(ASIO_MSVC) && defined(ASIO_WINDOWS_RUNTIME) -# if (_MSC_VER >= 1700) -# define ASIO_HAS_THREAD_KEYWORD_EXTENSION 1 -# define ASIO_THREAD_KEYWORD __declspec(thread) -# endif // (_MSC_VER >= 1700) -# endif // defined(ASIO_MSVC) && defined(ASIO_WINDOWS_RUNTIME) -#endif // !defined(ASIO_DISABLE_THREAD_KEYWORD_EXTENSION) -#if !defined(ASIO_THREAD_KEYWORD) -# define ASIO_THREAD_KEYWORD __thread -#endif // !defined(ASIO_THREAD_KEYWORD) - -// Support for POSIX ssize_t typedef. -#if !defined(ASIO_DISABLE_SSIZE_T) -# if defined(__linux__) \ - || (defined(__MACH__) && defined(__APPLE__)) -# define ASIO_HAS_SSIZE_T 1 -# endif // defined(__linux__) - // || (defined(__MACH__) && defined(__APPLE__)) -#endif // !defined(ASIO_DISABLE_SSIZE_T) - -// Helper macros to manage the transition away from the old services-based API. -#if defined(ASIO_ENABLE_OLD_SERVICES) -# define ASIO_SVC_TPARAM , typename Service -# define ASIO_SVC_TPARAM_DEF1(d1) , typename Service d1 -# define ASIO_SVC_TPARAM_DEF2(d1, d2) , typename Service d1, d2 -# define ASIO_SVC_TARG , Service -# define ASIO_SVC_T Service -# define ASIO_SVC_TPARAM1 , typename Service1 -# define ASIO_SVC_TPARAM1_DEF1(d1) , typename Service1 d1 -# define ASIO_SVC_TPARAM1_DEF2(d1, d2) , typename Service1 d1, d2 -# define ASIO_SVC_TARG1 , Service1 -# define ASIO_SVC_T1 Service1 -# define ASIO_SVC_ACCESS public -#else // defined(ASIO_ENABLE_OLD_SERVICES) -# define ASIO_SVC_TPARAM -# define ASIO_SVC_TPARAM_DEF1(d1) -# define ASIO_SVC_TPARAM_DEF2(d1, d2) -# define ASIO_SVC_TARG -// ASIO_SVC_T is defined at each point of use. -# define ASIO_SVC_TPARAM1 -# define ASIO_SVC_TPARAM1_DEF1(d1) -# define ASIO_SVC_TPARAM1_DEF2(d1, d2) -# define ASIO_SVC_TARG1 -// ASIO_SVC_T1 is defined at each point of use. -# define ASIO_SVC_ACCESS protected -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -// Helper macros to manage transition away from error_code return values. -#if defined(ASIO_NO_DEPRECATED) -# define ASIO_SYNC_OP_VOID void -# define ASIO_SYNC_OP_VOID_RETURN(e) return -#else // defined(ASIO_NO_DEPRECATED) -# define ASIO_SYNC_OP_VOID asio::error_code -# define ASIO_SYNC_OP_VOID_RETURN(e) return e -#endif // defined(ASIO_NO_DEPRECATED) - -// Newer gcc, clang need special treatment to suppress unused typedef warnings. -#if defined(__clang__) -# if defined(__apple_build_version__) -# if (__clang_major__ >= 7) -# define ASIO_UNUSED_TYPEDEF __attribute__((__unused__)) -# endif // (__clang_major__ >= 7) -# elif ((__clang_major__ == 3) && (__clang_minor__ >= 6)) \ - || (__clang_major__ > 3) -# define ASIO_UNUSED_TYPEDEF __attribute__((__unused__)) -# endif // ((__clang_major__ == 3) && (__clang_minor__ >= 6)) - // || (__clang_major__ > 3) -#elif defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4) -# define ASIO_UNUSED_TYPEDEF __attribute__((__unused__)) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4) -#endif // defined(__GNUC__) -#if !defined(ASIO_UNUSED_TYPEDEF) -# define ASIO_UNUSED_TYPEDEF -#endif // !defined(ASIO_UNUSED_TYPEDEF) - -// Some versions of gcc generate spurious warnings about unused variables. -#if defined(__GNUC__) -# if (__GNUC__ >= 4) -# define ASIO_UNUSED_VARIABLE __attribute__((__unused__)) -# endif // (__GNUC__ >= 4) -#endif // defined(__GNUC__) -#if !defined(ASIO_UNUSED_VARIABLE) -# define ASIO_UNUSED_VARIABLE -#endif // !defined(ASIO_UNUSED_VARIABLE) - -// Support co_await on compilers known to allow it. -#if !defined(ASIO_HAS_CO_AWAIT) -# if !defined(ASIO_DISABLE_CO_AWAIT) -# if defined(ASIO_MSVC) -# if (_MSC_FULL_VER >= 190023506) -# if defined(_RESUMABLE_FUNCTIONS_SUPPORTED) -# define ASIO_HAS_CO_AWAIT 1 -# endif // defined(_RESUMABLE_FUNCTIONS_SUPPORTED) -# endif // (_MSC_FULL_VER >= 190023506) -# endif // defined(ASIO_MSVC) -# endif // !defined(ASIO_DISABLE_CO_AWAIT) -# if defined(__clang__) -# if (__cpp_coroutines >= 201703) -# if __has_include() -# define ASIO_HAS_CO_AWAIT 1 -# endif // __has_include() -# endif // (__cpp_coroutines >= 201703) -# endif // defined(__clang__) -#endif // !defined(ASIO_HAS_CO_AWAIT) - -#endif // ASIO_DETAIL_CONFIG_HPP diff --git a/tools/sdk/include/asio/asio/detail/consuming_buffers.hpp b/tools/sdk/include/asio/asio/detail/consuming_buffers.hpp deleted file mode 100644 index 8127ae75ca2..00000000000 --- a/tools/sdk/include/asio/asio/detail/consuming_buffers.hpp +++ /dev/null @@ -1,414 +0,0 @@ -// -// detail/consuming_buffers.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_CONSUMING_BUFFERS_HPP -#define ASIO_DETAIL_CONSUMING_BUFFERS_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/buffer.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/limits.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -// Helper template to determine the maximum number of prepared buffers. -template -struct prepared_buffers_max -{ - enum { value = buffer_sequence_adapter_base::max_buffers }; -}; - -template -struct prepared_buffers_max > -{ - enum { value = N }; -}; - -#if defined(ASIO_HAS_STD_ARRAY) - -template -struct prepared_buffers_max > -{ - enum { value = N }; -}; - -#endif // defined(ASIO_HAS_STD_ARRAY) - -// A buffer sequence used to represent a subsequence of the buffers. -template -struct prepared_buffers -{ - typedef Buffer value_type; - typedef const Buffer* const_iterator; - - enum { max_buffers = MaxBuffers < 16 ? MaxBuffers : 16 }; - - prepared_buffers() : count(0) {} - const_iterator begin() const { return elems; } - const_iterator end() const { return elems + count; } - - Buffer elems[max_buffers]; - std::size_t count; -}; - -// A proxy for a sub-range in a list of buffers. -template -class consuming_buffers -{ -public: - typedef prepared_buffers::value> - prepared_buffers_type; - - // Construct to represent the entire list of buffers. - explicit consuming_buffers(const Buffers& buffers) - : buffers_(buffers), - total_consumed_(0), - next_elem_(0), - next_elem_offset_(0) - { - using asio::buffer_size; - total_size_ = buffer_size(buffers); - } - - // Determine if we are at the end of the buffers. - bool empty() const - { - return total_consumed_ >= total_size_; - } - - // Get the buffer for a single transfer, with a size. - prepared_buffers_type prepare(std::size_t max_size) - { - prepared_buffers_type result; - - Buffer_Iterator next = asio::buffer_sequence_begin(buffers_); - Buffer_Iterator end = asio::buffer_sequence_end(buffers_); - - std::advance(next, next_elem_); - std::size_t elem_offset = next_elem_offset_; - while (next != end && max_size > 0 && (result.count) < result.max_buffers) - { - Buffer next_buf = Buffer(*next) + elem_offset; - result.elems[result.count] = asio::buffer(next_buf, max_size); - max_size -= result.elems[result.count].size(); - elem_offset = 0; - if (result.elems[result.count].size() > 0) - ++result.count; - ++next; - } - - return result; - } - - // Consume the specified number of bytes from the buffers. - void consume(std::size_t size) - { - total_consumed_ += size; - - Buffer_Iterator next = asio::buffer_sequence_begin(buffers_); - Buffer_Iterator end = asio::buffer_sequence_end(buffers_); - - std::advance(next, next_elem_); - while (next != end && size > 0) - { - Buffer next_buf = Buffer(*next) + next_elem_offset_; - if (size < next_buf.size()) - { - next_elem_offset_ += size; - size = 0; - } - else - { - size -= next_buf.size(); - next_elem_offset_ = 0; - ++next_elem_; - ++next; - } - } - } - - // Get the total number of bytes consumed from the buffers. - std::size_t total_consumed() const - { - return total_consumed_; - } - -private: - Buffers buffers_; - std::size_t total_size_; - std::size_t total_consumed_; - std::size_t next_elem_; - std::size_t next_elem_offset_; -}; - -// Base class of all consuming_buffers specialisations for single buffers. -template -class consuming_single_buffer -{ -public: - // Construct to represent the entire list of buffers. - template - explicit consuming_single_buffer(const Buffer1& buffer) - : buffer_(buffer), - total_consumed_(0) - { - } - - // Determine if we are at the end of the buffers. - bool empty() const - { - return total_consumed_ >= buffer_.size(); - } - - // Get the buffer for a single transfer, with a size. - Buffer prepare(std::size_t max_size) - { - return asio::buffer(buffer_ + total_consumed_, max_size); - } - - // Consume the specified number of bytes from the buffers. - void consume(std::size_t size) - { - total_consumed_ += size; - } - - // Get the total number of bytes consumed from the buffers. - std::size_t total_consumed() const - { - return total_consumed_; - } - -private: - Buffer buffer_; - std::size_t total_consumed_; -}; - -template <> -class consuming_buffers - : public consuming_single_buffer -{ -public: - explicit consuming_buffers(const mutable_buffer& buffer) - : consuming_single_buffer(buffer) - { - } -}; - -template <> -class consuming_buffers - : public consuming_single_buffer -{ -public: - explicit consuming_buffers(const mutable_buffer& buffer) - : consuming_single_buffer(buffer) - { - } -}; - -template <> -class consuming_buffers - : public consuming_single_buffer -{ -public: - explicit consuming_buffers(const const_buffer& buffer) - : consuming_single_buffer(buffer) - { - } -}; - -#if !defined(ASIO_NO_DEPRECATED) - -template <> -class consuming_buffers - : public consuming_single_buffer -{ -public: - explicit consuming_buffers(const mutable_buffers_1& buffer) - : consuming_single_buffer(buffer) - { - } -}; - -template <> -class consuming_buffers - : public consuming_single_buffer -{ -public: - explicit consuming_buffers(const mutable_buffers_1& buffer) - : consuming_single_buffer(buffer) - { - } -}; - -template <> -class consuming_buffers - : public consuming_single_buffer -{ -public: - explicit consuming_buffers(const const_buffers_1& buffer) - : consuming_single_buffer(buffer) - { - } -}; - -#endif // !defined(ASIO_NO_DEPRECATED) - -template -class consuming_buffers, - typename boost::array::const_iterator> -{ -public: - // Construct to represent the entire list of buffers. - explicit consuming_buffers(const boost::array& buffers) - : buffers_(buffers), - total_consumed_(0) - { - } - - // Determine if we are at the end of the buffers. - bool empty() const - { - return total_consumed_ >= - Buffer(buffers_[0]).size() + Buffer(buffers_[1]).size(); - } - - // Get the buffer for a single transfer, with a size. - boost::array prepare(std::size_t max_size) - { - boost::array result = {{ - Buffer(buffers_[0]), Buffer(buffers_[1]) }}; - std::size_t buffer0_size = result[0].size(); - result[0] = asio::buffer(result[0] + total_consumed_, max_size); - result[1] = asio::buffer( - result[1] + (total_consumed_ < buffer0_size - ? 0 : total_consumed_ - buffer0_size), - max_size - result[0].size()); - return result; - } - - // Consume the specified number of bytes from the buffers. - void consume(std::size_t size) - { - total_consumed_ += size; - } - - // Get the total number of bytes consumed from the buffers. - std::size_t total_consumed() const - { - return total_consumed_; - } - -private: - boost::array buffers_; - std::size_t total_consumed_; -}; - -#if defined(ASIO_HAS_STD_ARRAY) - -template -class consuming_buffers, - typename std::array::const_iterator> -{ -public: - // Construct to represent the entire list of buffers. - explicit consuming_buffers(const std::array& buffers) - : buffers_(buffers), - total_consumed_(0) - { - } - - // Determine if we are at the end of the buffers. - bool empty() const - { - return total_consumed_ >= - Buffer(buffers_[0]).size() + Buffer(buffers_[1]).size(); - } - - // Get the buffer for a single transfer, with a size. - std::array prepare(std::size_t max_size) - { - std::array result = {{ - Buffer(buffers_[0]), Buffer(buffers_[1]) }}; - std::size_t buffer0_size = result[0].size(); - result[0] = asio::buffer(result[0] + total_consumed_, max_size); - result[1] = asio::buffer( - result[1] + (total_consumed_ < buffer0_size - ? 0 : total_consumed_ - buffer0_size), - max_size - result[0].size()); - return result; - } - - // Consume the specified number of bytes from the buffers. - void consume(std::size_t size) - { - total_consumed_ += size; - } - - // Get the total number of bytes consumed from the buffers. - std::size_t total_consumed() const - { - return total_consumed_; - } - -private: - std::array buffers_; - std::size_t total_consumed_; -}; - -#endif // defined(ASIO_HAS_STD_ARRAY) - -// Specialisation for null_buffers to ensure that the null_buffers type is -// always passed through to the underlying read or write operation. -template -class consuming_buffers - : public asio::null_buffers -{ -public: - consuming_buffers(const null_buffers&) - { - // No-op. - } - - bool empty() - { - return false; - } - - null_buffers prepare(std::size_t) - { - return null_buffers(); - } - - void consume(std::size_t) - { - // No-op. - } - - std::size_t total_consumed() const - { - return 0; - } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_CONSUMING_BUFFERS_HPP diff --git a/tools/sdk/include/asio/asio/detail/cstddef.hpp b/tools/sdk/include/asio/asio/detail/cstddef.hpp deleted file mode 100644 index 3912da40df2..00000000000 --- a/tools/sdk/include/asio/asio/detail/cstddef.hpp +++ /dev/null @@ -1,31 +0,0 @@ -// -// detail/cstddef.hpp -// ~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_CSTDDEF_HPP -#define ASIO_DETAIL_CSTDDEF_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include - -namespace asio { - -#if defined(ASIO_HAS_NULLPTR) -using std::nullptr_t; -#else // defined(ASIO_HAS_NULLPTR) -struct nullptr_t {}; -#endif // defined(ASIO_HAS_NULLPTR) - -} // namespace asio - -#endif // ASIO_DETAIL_CSTDDEF_HPP diff --git a/tools/sdk/include/asio/asio/detail/cstdint.hpp b/tools/sdk/include/asio/asio/detail/cstdint.hpp deleted file mode 100644 index 62342b2d2c1..00000000000 --- a/tools/sdk/include/asio/asio/detail/cstdint.hpp +++ /dev/null @@ -1,60 +0,0 @@ -// -// detail/cstdint.hpp -// ~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_CSTDINT_HPP -#define ASIO_DETAIL_CSTDINT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_CSTDINT) -# include -#else // defined(ASIO_HAS_CSTDINT) -# include -#endif // defined(ASIO_HAS_CSTDINT) - -namespace asio { - -#if defined(ASIO_HAS_CSTDINT) -using std::int16_t; -using std::int_least16_t; -using std::uint16_t; -using std::uint_least16_t; -using std::int32_t; -using std::int_least32_t; -using std::uint32_t; -using std::uint_least32_t; -using std::int64_t; -using std::int_least64_t; -using std::uint64_t; -using std::uint_least64_t; -using std::uintmax_t; -#else // defined(ASIO_HAS_CSTDINT) -using boost::int16_t; -using boost::int_least16_t; -using boost::uint16_t; -using boost::uint_least16_t; -using boost::int32_t; -using boost::int_least32_t; -using boost::uint32_t; -using boost::uint_least32_t; -using boost::int64_t; -using boost::int_least64_t; -using boost::uint64_t; -using boost::uint_least64_t; -using boost::uintmax_t; -#endif // defined(ASIO_HAS_CSTDINT) - -} // namespace asio - -#endif // ASIO_DETAIL_CSTDINT_HPP diff --git a/tools/sdk/include/asio/asio/detail/date_time_fwd.hpp b/tools/sdk/include/asio/asio/detail/date_time_fwd.hpp deleted file mode 100644 index a159562eb5c..00000000000 --- a/tools/sdk/include/asio/asio/detail/date_time_fwd.hpp +++ /dev/null @@ -1,34 +0,0 @@ -// -// detail/date_time_fwd.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_DATE_TIME_FWD_HPP -#define ASIO_DETAIL_DATE_TIME_FWD_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -namespace boost { -namespace date_time { - -template -class base_time; - -} // namespace date_time -namespace posix_time { - -class ptime; - -} // namespace posix_time -} // namespace boost - -#endif // ASIO_DETAIL_DATE_TIME_FWD_HPP diff --git a/tools/sdk/include/asio/asio/detail/deadline_timer_service.hpp b/tools/sdk/include/asio/asio/detail/deadline_timer_service.hpp deleted file mode 100644 index f58a6e0e764..00000000000 --- a/tools/sdk/include/asio/asio/detail/deadline_timer_service.hpp +++ /dev/null @@ -1,278 +0,0 @@ -// -// detail/deadline_timer_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_DEADLINE_TIMER_SERVICE_HPP -#define ASIO_DETAIL_DEADLINE_TIMER_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/error.hpp" -#include "asio/io_context.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/socket_ops.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/detail/timer_queue.hpp" -#include "asio/detail/timer_queue_ptime.hpp" -#include "asio/detail/timer_scheduler.hpp" -#include "asio/detail/wait_handler.hpp" -#include "asio/detail/wait_op.hpp" - -#if defined(ASIO_WINDOWS_RUNTIME) -# include -# include -#endif // defined(ASIO_WINDOWS_RUNTIME) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class deadline_timer_service - : public service_base > -{ -public: - // The time type. - typedef typename Time_Traits::time_type time_type; - - // The duration type. - typedef typename Time_Traits::duration_type duration_type; - - // The implementation type of the timer. This type is dependent on the - // underlying implementation of the timer service. - struct implementation_type - : private asio::detail::noncopyable - { - time_type expiry; - bool might_have_pending_waits; - typename timer_queue::per_timer_data timer_data; - }; - - // Constructor. - deadline_timer_service(asio::io_context& io_context) - : service_base >(io_context), - scheduler_(asio::use_service(io_context)) - { - scheduler_.init_task(); - scheduler_.add_timer_queue(timer_queue_); - } - - // Destructor. - ~deadline_timer_service() - { - scheduler_.remove_timer_queue(timer_queue_); - } - - // Destroy all user-defined handler objects owned by the service. - void shutdown() - { - } - - // Construct a new timer implementation. - void construct(implementation_type& impl) - { - impl.expiry = time_type(); - impl.might_have_pending_waits = false; - } - - // Destroy a timer implementation. - void destroy(implementation_type& impl) - { - asio::error_code ec; - cancel(impl, ec); - } - - // Move-construct a new serial port implementation. - void move_construct(implementation_type& impl, - implementation_type& other_impl) - { - scheduler_.move_timer(timer_queue_, impl.timer_data, other_impl.timer_data); - - impl.expiry = other_impl.expiry; - other_impl.expiry = time_type(); - - impl.might_have_pending_waits = other_impl.might_have_pending_waits; - other_impl.might_have_pending_waits = false; - } - - // Move-assign from another serial port implementation. - void move_assign(implementation_type& impl, - deadline_timer_service& other_service, - implementation_type& other_impl) - { - if (this != &other_service) - if (impl.might_have_pending_waits) - scheduler_.cancel_timer(timer_queue_, impl.timer_data); - - other_service.scheduler_.move_timer(other_service.timer_queue_, - impl.timer_data, other_impl.timer_data); - - impl.expiry = other_impl.expiry; - other_impl.expiry = time_type(); - - impl.might_have_pending_waits = other_impl.might_have_pending_waits; - other_impl.might_have_pending_waits = false; - } - - // Cancel any asynchronous wait operations associated with the timer. - std::size_t cancel(implementation_type& impl, asio::error_code& ec) - { - if (!impl.might_have_pending_waits) - { - ec = asio::error_code(); - return 0; - } - - ASIO_HANDLER_OPERATION((scheduler_.context(), - "deadline_timer", &impl, 0, "cancel")); - - std::size_t count = scheduler_.cancel_timer(timer_queue_, impl.timer_data); - impl.might_have_pending_waits = false; - ec = asio::error_code(); - return count; - } - - // Cancels one asynchronous wait operation associated with the timer. - std::size_t cancel_one(implementation_type& impl, - asio::error_code& ec) - { - if (!impl.might_have_pending_waits) - { - ec = asio::error_code(); - return 0; - } - - ASIO_HANDLER_OPERATION((scheduler_.context(), - "deadline_timer", &impl, 0, "cancel_one")); - - std::size_t count = scheduler_.cancel_timer( - timer_queue_, impl.timer_data, 1); - if (count == 0) - impl.might_have_pending_waits = false; - ec = asio::error_code(); - return count; - } - - // Get the expiry time for the timer as an absolute time. - time_type expiry(const implementation_type& impl) const - { - return impl.expiry; - } - - // Get the expiry time for the timer as an absolute time. - time_type expires_at(const implementation_type& impl) const - { - return impl.expiry; - } - - // Get the expiry time for the timer relative to now. - duration_type expires_from_now(const implementation_type& impl) const - { - return Time_Traits::subtract(this->expiry(impl), Time_Traits::now()); - } - - // Set the expiry time for the timer as an absolute time. - std::size_t expires_at(implementation_type& impl, - const time_type& expiry_time, asio::error_code& ec) - { - std::size_t count = cancel(impl, ec); - impl.expiry = expiry_time; - ec = asio::error_code(); - return count; - } - - // Set the expiry time for the timer relative to now. - std::size_t expires_after(implementation_type& impl, - const duration_type& expiry_time, asio::error_code& ec) - { - return expires_at(impl, - Time_Traits::add(Time_Traits::now(), expiry_time), ec); - } - - // Set the expiry time for the timer relative to now. - std::size_t expires_from_now(implementation_type& impl, - const duration_type& expiry_time, asio::error_code& ec) - { - return expires_at(impl, - Time_Traits::add(Time_Traits::now(), expiry_time), ec); - } - - // Perform a blocking wait on the timer. - void wait(implementation_type& impl, asio::error_code& ec) - { - time_type now = Time_Traits::now(); - ec = asio::error_code(); - while (Time_Traits::less_than(now, impl.expiry) && !ec) - { - this->do_wait(Time_Traits::to_posix_duration( - Time_Traits::subtract(impl.expiry, now)), ec); - now = Time_Traits::now(); - } - } - - // Start an asynchronous wait on the timer. - template - void async_wait(implementation_type& impl, Handler& handler) - { - // Allocate and construct an operation to wrap the handler. - typedef wait_handler op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(handler); - - impl.might_have_pending_waits = true; - - ASIO_HANDLER_CREATION((scheduler_.context(), - *p.p, "deadline_timer", &impl, 0, "async_wait")); - - scheduler_.schedule_timer(timer_queue_, impl.expiry, impl.timer_data, p.p); - p.v = p.p = 0; - } - -private: - // Helper function to wait given a duration type. The duration type should - // either be of type boost::posix_time::time_duration, or implement the - // required subset of its interface. - template - void do_wait(const Duration& timeout, asio::error_code& ec) - { -#if defined(ASIO_WINDOWS_RUNTIME) - std::this_thread::sleep_for( - std::chrono::seconds(timeout.total_seconds()) - + std::chrono::microseconds(timeout.total_microseconds())); - ec = asio::error_code(); -#else // defined(ASIO_WINDOWS_RUNTIME) - ::timeval tv; - tv.tv_sec = timeout.total_seconds(); - tv.tv_usec = timeout.total_microseconds() % 1000000; - socket_ops::select(0, 0, 0, 0, &tv, ec); -#endif // defined(ASIO_WINDOWS_RUNTIME) - } - - // The queue of timers. - timer_queue timer_queue_; - - // The object that schedules and executes timers. Usually a reactor. - timer_scheduler& scheduler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_DEADLINE_TIMER_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/detail/dependent_type.hpp b/tools/sdk/include/asio/asio/detail/dependent_type.hpp deleted file mode 100644 index 85b41c8935f..00000000000 --- a/tools/sdk/include/asio/asio/detail/dependent_type.hpp +++ /dev/null @@ -1,36 +0,0 @@ -// -// detail/dependent_type.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_DEPENDENT_TYPE_HPP -#define ASIO_DETAIL_DEPENDENT_TYPE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -struct dependent_type -{ - typedef T type; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_DEPENDENT_TYPE_HPP diff --git a/tools/sdk/include/asio/asio/detail/descriptor_ops.hpp b/tools/sdk/include/asio/asio/detail/descriptor_ops.hpp deleted file mode 100644 index 9c0560aa2c9..00000000000 --- a/tools/sdk/include/asio/asio/detail/descriptor_ops.hpp +++ /dev/null @@ -1,121 +0,0 @@ -// -// detail/descriptor_ops.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_DESCRIPTOR_OPS_HPP -#define ASIO_DETAIL_DESCRIPTOR_OPS_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_WINDOWS) \ - && !defined(ASIO_WINDOWS_RUNTIME) \ - && !defined(__CYGWIN__) - -#include -#include "asio/error.hpp" -#include "asio/error_code.hpp" -#include "asio/detail/socket_types.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { -namespace descriptor_ops { - -// Descriptor state bits. -enum -{ - // The user wants a non-blocking descriptor. - user_set_non_blocking = 1, - - // The descriptor has been set non-blocking. - internal_non_blocking = 2, - - // Helper "state" used to determine whether the descriptor is non-blocking. - non_blocking = user_set_non_blocking | internal_non_blocking, - - // The descriptor may have been dup()-ed. - possible_dup = 4 -}; - -typedef unsigned char state_type; - -template -inline ReturnType error_wrapper(ReturnType return_value, - asio::error_code& ec) -{ - ec = asio::error_code(errno, - asio::error::get_system_category()); - return return_value; -} - -ASIO_DECL int open(const char* path, int flags, - asio::error_code& ec); - -ASIO_DECL int close(int d, state_type& state, - asio::error_code& ec); - -ASIO_DECL bool set_user_non_blocking(int d, - state_type& state, bool value, asio::error_code& ec); - -ASIO_DECL bool set_internal_non_blocking(int d, - state_type& state, bool value, asio::error_code& ec); - -typedef iovec buf; - -ASIO_DECL std::size_t sync_read(int d, state_type state, buf* bufs, - std::size_t count, bool all_empty, asio::error_code& ec); - -ASIO_DECL bool non_blocking_read(int d, buf* bufs, std::size_t count, - asio::error_code& ec, std::size_t& bytes_transferred); - -ASIO_DECL std::size_t sync_write(int d, state_type state, - const buf* bufs, std::size_t count, bool all_empty, - asio::error_code& ec); - -ASIO_DECL bool non_blocking_write(int d, - const buf* bufs, std::size_t count, - asio::error_code& ec, std::size_t& bytes_transferred); - -ASIO_DECL int ioctl(int d, state_type& state, long cmd, - ioctl_arg_type* arg, asio::error_code& ec); - -ASIO_DECL int fcntl(int d, int cmd, asio::error_code& ec); - -ASIO_DECL int fcntl(int d, int cmd, - long arg, asio::error_code& ec); - -ASIO_DECL int poll_read(int d, - state_type state, asio::error_code& ec); - -ASIO_DECL int poll_write(int d, - state_type state, asio::error_code& ec); - -ASIO_DECL int poll_error(int d, - state_type state, asio::error_code& ec); - -} // namespace descriptor_ops -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/descriptor_ops.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // !defined(ASIO_WINDOWS) - // && !defined(ASIO_WINDOWS_RUNTIME) - // && !defined(__CYGWIN__) - -#endif // ASIO_DETAIL_DESCRIPTOR_OPS_HPP diff --git a/tools/sdk/include/asio/asio/detail/descriptor_read_op.hpp b/tools/sdk/include/asio/asio/detail/descriptor_read_op.hpp deleted file mode 100644 index 6db4bfb958e..00000000000 --- a/tools/sdk/include/asio/asio/detail/descriptor_read_op.hpp +++ /dev/null @@ -1,128 +0,0 @@ -// -// detail/descriptor_read_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_DESCRIPTOR_READ_OP_HPP -#define ASIO_DETAIL_DESCRIPTOR_READ_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) - -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/descriptor_ops.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_work.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/reactor_op.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class descriptor_read_op_base : public reactor_op -{ -public: - descriptor_read_op_base(int descriptor, - const MutableBufferSequence& buffers, func_type complete_func) - : reactor_op(&descriptor_read_op_base::do_perform, complete_func), - descriptor_(descriptor), - buffers_(buffers) - { - } - - static status do_perform(reactor_op* base) - { - descriptor_read_op_base* o(static_cast(base)); - - buffer_sequence_adapter bufs(o->buffers_); - - status result = descriptor_ops::non_blocking_read(o->descriptor_, - bufs.buffers(), bufs.count(), o->ec_, o->bytes_transferred_) - ? done : not_done; - - ASIO_HANDLER_REACTOR_OPERATION((*o, "non_blocking_read", - o->ec_, o->bytes_transferred_)); - - return result; - } - -private: - int descriptor_; - MutableBufferSequence buffers_; -}; - -template -class descriptor_read_op - : public descriptor_read_op_base -{ -public: - ASIO_DEFINE_HANDLER_PTR(descriptor_read_op); - - descriptor_read_op(int descriptor, - const MutableBufferSequence& buffers, Handler& handler) - : descriptor_read_op_base( - descriptor, buffers, &descriptor_read_op::do_complete), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& /*ec*/, - std::size_t /*bytes_transferred*/) - { - // Take ownership of the handler object. - descriptor_read_op* o(static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - ASIO_HANDLER_COMPLETION((*o)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder2 - handler(o->handler_, o->ec_, o->bytes_transferred_); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) - -#endif // ASIO_DETAIL_DESCRIPTOR_READ_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/descriptor_write_op.hpp b/tools/sdk/include/asio/asio/detail/descriptor_write_op.hpp deleted file mode 100644 index a9ec2a97624..00000000000 --- a/tools/sdk/include/asio/asio/detail/descriptor_write_op.hpp +++ /dev/null @@ -1,128 +0,0 @@ -// -// detail/descriptor_write_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_DESCRIPTOR_WRITE_OP_HPP -#define ASIO_DETAIL_DESCRIPTOR_WRITE_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) - -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/descriptor_ops.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_work.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/reactor_op.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class descriptor_write_op_base : public reactor_op -{ -public: - descriptor_write_op_base(int descriptor, - const ConstBufferSequence& buffers, func_type complete_func) - : reactor_op(&descriptor_write_op_base::do_perform, complete_func), - descriptor_(descriptor), - buffers_(buffers) - { - } - - static status do_perform(reactor_op* base) - { - descriptor_write_op_base* o(static_cast(base)); - - buffer_sequence_adapter bufs(o->buffers_); - - status result = descriptor_ops::non_blocking_write(o->descriptor_, - bufs.buffers(), bufs.count(), o->ec_, o->bytes_transferred_) - ? done : not_done; - - ASIO_HANDLER_REACTOR_OPERATION((*o, "non_blocking_write", - o->ec_, o->bytes_transferred_)); - - return result; - } - -private: - int descriptor_; - ConstBufferSequence buffers_; -}; - -template -class descriptor_write_op - : public descriptor_write_op_base -{ -public: - ASIO_DEFINE_HANDLER_PTR(descriptor_write_op); - - descriptor_write_op(int descriptor, - const ConstBufferSequence& buffers, Handler& handler) - : descriptor_write_op_base( - descriptor, buffers, &descriptor_write_op::do_complete), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& /*ec*/, - std::size_t /*bytes_transferred*/) - { - // Take ownership of the handler object. - descriptor_write_op* o(static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - ASIO_HANDLER_COMPLETION((*o)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder2 - handler(o->handler_, o->ec_, o->bytes_transferred_); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) - -#endif // ASIO_DETAIL_DESCRIPTOR_WRITE_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/dev_poll_reactor.hpp b/tools/sdk/include/asio/asio/detail/dev_poll_reactor.hpp deleted file mode 100644 index e9e4e29e04b..00000000000 --- a/tools/sdk/include/asio/asio/detail/dev_poll_reactor.hpp +++ /dev/null @@ -1,218 +0,0 @@ -// -// detail/dev_poll_reactor.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_DEV_POLL_REACTOR_HPP -#define ASIO_DETAIL_DEV_POLL_REACTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_DEV_POLL) - -#include -#include -#include -#include "asio/detail/hash_map.hpp" -#include "asio/detail/limits.hpp" -#include "asio/detail/mutex.hpp" -#include "asio/detail/op_queue.hpp" -#include "asio/detail/reactor_op.hpp" -#include "asio/detail/reactor_op_queue.hpp" -#include "asio/detail/select_interrupter.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/detail/timer_queue_base.hpp" -#include "asio/detail/timer_queue_set.hpp" -#include "asio/detail/wait_op.hpp" -#include "asio/execution_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class dev_poll_reactor - : public execution_context_service_base -{ -public: - enum op_types { read_op = 0, write_op = 1, - connect_op = 1, except_op = 2, max_ops = 3 }; - - // Per-descriptor data. - struct per_descriptor_data - { - }; - - // Constructor. - ASIO_DECL dev_poll_reactor(asio::execution_context& ctx); - - // Destructor. - ASIO_DECL ~dev_poll_reactor(); - - // Destroy all user-defined handler objects owned by the service. - ASIO_DECL void shutdown(); - - // Recreate internal descriptors following a fork. - ASIO_DECL void notify_fork( - asio::execution_context::fork_event fork_ev); - - // Initialise the task. - ASIO_DECL void init_task(); - - // Register a socket with the reactor. Returns 0 on success, system error - // code on failure. - ASIO_DECL int register_descriptor(socket_type, per_descriptor_data&); - - // Register a descriptor with an associated single operation. Returns 0 on - // success, system error code on failure. - ASIO_DECL int register_internal_descriptor( - int op_type, socket_type descriptor, - per_descriptor_data& descriptor_data, reactor_op* op); - - // Move descriptor registration from one descriptor_data object to another. - ASIO_DECL void move_descriptor(socket_type descriptor, - per_descriptor_data& target_descriptor_data, - per_descriptor_data& source_descriptor_data); - - // Post a reactor operation for immediate completion. - void post_immediate_completion(reactor_op* op, bool is_continuation) - { - scheduler_.post_immediate_completion(op, is_continuation); - } - - // Start a new operation. The reactor operation will be performed when the - // given descriptor is flagged as ready, or an error has occurred. - ASIO_DECL void start_op(int op_type, socket_type descriptor, - per_descriptor_data&, reactor_op* op, - bool is_continuation, bool allow_speculative); - - // Cancel all operations associated with the given descriptor. The - // handlers associated with the descriptor will be invoked with the - // operation_aborted error. - ASIO_DECL void cancel_ops(socket_type descriptor, per_descriptor_data&); - - // Cancel any operations that are running against the descriptor and remove - // its registration from the reactor. The reactor resources associated with - // the descriptor must be released by calling cleanup_descriptor_data. - ASIO_DECL void deregister_descriptor(socket_type descriptor, - per_descriptor_data&, bool closing); - - // Remove the descriptor's registration from the reactor. The reactor - // resources associated with the descriptor must be released by calling - // cleanup_descriptor_data. - ASIO_DECL void deregister_internal_descriptor( - socket_type descriptor, per_descriptor_data&); - - // Perform any post-deregistration cleanup tasks associated with the - // descriptor data. - ASIO_DECL void cleanup_descriptor_data(per_descriptor_data&); - - // Add a new timer queue to the reactor. - template - void add_timer_queue(timer_queue& queue); - - // Remove a timer queue from the reactor. - template - void remove_timer_queue(timer_queue& queue); - - // Schedule a new operation in the given timer queue to expire at the - // specified absolute time. - template - void schedule_timer(timer_queue& queue, - const typename Time_Traits::time_type& time, - typename timer_queue::per_timer_data& timer, wait_op* op); - - // Cancel the timer operations associated with the given token. Returns the - // number of operations that have been posted or dispatched. - template - std::size_t cancel_timer(timer_queue& queue, - typename timer_queue::per_timer_data& timer, - std::size_t max_cancelled = (std::numeric_limits::max)()); - - // Move the timer operations associated with the given timer. - template - void move_timer(timer_queue& queue, - typename timer_queue::per_timer_data& target, - typename timer_queue::per_timer_data& source); - - // Run /dev/poll once until interrupted or events are ready to be dispatched. - ASIO_DECL void run(long usec, op_queue& ops); - - // Interrupt the select loop. - ASIO_DECL void interrupt(); - -private: - // Create the /dev/poll file descriptor. Throws an exception if the descriptor - // cannot be created. - ASIO_DECL static int do_dev_poll_create(); - - // Helper function to add a new timer queue. - ASIO_DECL void do_add_timer_queue(timer_queue_base& queue); - - // Helper function to remove a timer queue. - ASIO_DECL void do_remove_timer_queue(timer_queue_base& queue); - - // Get the timeout value for the /dev/poll DP_POLL operation. The timeout - // value is returned as a number of milliseconds. A return value of -1 - // indicates that the poll should block indefinitely. - ASIO_DECL int get_timeout(int msec); - - // Cancel all operations associated with the given descriptor. The do_cancel - // function of the handler objects will be invoked. This function does not - // acquire the dev_poll_reactor's mutex. - ASIO_DECL void cancel_ops_unlocked(socket_type descriptor, - const asio::error_code& ec); - - // Add a pending event entry for the given descriptor. - ASIO_DECL ::pollfd& add_pending_event_change(int descriptor); - - // The scheduler implementation used to post completions. - scheduler& scheduler_; - - // Mutex to protect access to internal data. - asio::detail::mutex mutex_; - - // The /dev/poll file descriptor. - int dev_poll_fd_; - - // Vector of /dev/poll events waiting to be written to the descriptor. - std::vector< ::pollfd> pending_event_changes_; - - // Hash map to associate a descriptor with a pending event change index. - hash_map pending_event_change_index_; - - // The interrupter is used to break a blocking DP_POLL operation. - select_interrupter interrupter_; - - // The queues of read, write and except operations. - reactor_op_queue op_queue_[max_ops]; - - // The timer queues. - timer_queue_set timer_queues_; - - // Whether the service has been shut down. - bool shutdown_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/detail/impl/dev_poll_reactor.hpp" -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/dev_poll_reactor.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_HAS_DEV_POLL) - -#endif // ASIO_DETAIL_DEV_POLL_REACTOR_HPP diff --git a/tools/sdk/include/asio/asio/detail/epoll_reactor.hpp b/tools/sdk/include/asio/asio/detail/epoll_reactor.hpp deleted file mode 100644 index 5f58109930b..00000000000 --- a/tools/sdk/include/asio/asio/detail/epoll_reactor.hpp +++ /dev/null @@ -1,266 +0,0 @@ -// -// detail/epoll_reactor.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_EPOLL_REACTOR_HPP -#define ASIO_DETAIL_EPOLL_REACTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_EPOLL) - -#include "asio/detail/atomic_count.hpp" -#include "asio/detail/conditionally_enabled_mutex.hpp" -#include "asio/detail/limits.hpp" -#include "asio/detail/object_pool.hpp" -#include "asio/detail/op_queue.hpp" -#include "asio/detail/reactor_op.hpp" -#include "asio/detail/select_interrupter.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/detail/timer_queue_base.hpp" -#include "asio/detail/timer_queue_set.hpp" -#include "asio/detail/wait_op.hpp" -#include "asio/execution_context.hpp" - -#if defined(ASIO_HAS_TIMERFD) -# include -#endif // defined(ASIO_HAS_TIMERFD) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class epoll_reactor - : public execution_context_service_base -{ -private: - // The mutex type used by this reactor. - typedef conditionally_enabled_mutex mutex; - -public: - enum op_types { read_op = 0, write_op = 1, - connect_op = 1, except_op = 2, max_ops = 3 }; - - // Per-descriptor queues. - class descriptor_state : operation - { - friend class epoll_reactor; - friend class object_pool_access; - - descriptor_state* next_; - descriptor_state* prev_; - - mutex mutex_; - epoll_reactor* reactor_; - int descriptor_; - uint32_t registered_events_; - op_queue op_queue_[max_ops]; - bool try_speculative_[max_ops]; - bool shutdown_; - - ASIO_DECL descriptor_state(bool locking); - void set_ready_events(uint32_t events) { task_result_ = events; } - void add_ready_events(uint32_t events) { task_result_ |= events; } - ASIO_DECL operation* perform_io(uint32_t events); - ASIO_DECL static void do_complete( - void* owner, operation* base, - const asio::error_code& ec, std::size_t bytes_transferred); - }; - - // Per-descriptor data. - typedef descriptor_state* per_descriptor_data; - - // Constructor. - ASIO_DECL epoll_reactor(asio::execution_context& ctx); - - // Destructor. - ASIO_DECL ~epoll_reactor(); - - // Destroy all user-defined handler objects owned by the service. - ASIO_DECL void shutdown(); - - // Recreate internal descriptors following a fork. - ASIO_DECL void notify_fork( - asio::execution_context::fork_event fork_ev); - - // Initialise the task. - ASIO_DECL void init_task(); - - // Register a socket with the reactor. Returns 0 on success, system error - // code on failure. - ASIO_DECL int register_descriptor(socket_type descriptor, - per_descriptor_data& descriptor_data); - - // Register a descriptor with an associated single operation. Returns 0 on - // success, system error code on failure. - ASIO_DECL int register_internal_descriptor( - int op_type, socket_type descriptor, - per_descriptor_data& descriptor_data, reactor_op* op); - - // Move descriptor registration from one descriptor_data object to another. - ASIO_DECL void move_descriptor(socket_type descriptor, - per_descriptor_data& target_descriptor_data, - per_descriptor_data& source_descriptor_data); - - // Post a reactor operation for immediate completion. - void post_immediate_completion(reactor_op* op, bool is_continuation) - { - scheduler_.post_immediate_completion(op, is_continuation); - } - - // Start a new operation. The reactor operation will be performed when the - // given descriptor is flagged as ready, or an error has occurred. - ASIO_DECL void start_op(int op_type, socket_type descriptor, - per_descriptor_data& descriptor_data, reactor_op* op, - bool is_continuation, bool allow_speculative); - - // Cancel all operations associated with the given descriptor. The - // handlers associated with the descriptor will be invoked with the - // operation_aborted error. - ASIO_DECL void cancel_ops(socket_type descriptor, - per_descriptor_data& descriptor_data); - - // Cancel any operations that are running against the descriptor and remove - // its registration from the reactor. The reactor resources associated with - // the descriptor must be released by calling cleanup_descriptor_data. - ASIO_DECL void deregister_descriptor(socket_type descriptor, - per_descriptor_data& descriptor_data, bool closing); - - // Remove the descriptor's registration from the reactor. The reactor - // resources associated with the descriptor must be released by calling - // cleanup_descriptor_data. - ASIO_DECL void deregister_internal_descriptor( - socket_type descriptor, per_descriptor_data& descriptor_data); - - // Perform any post-deregistration cleanup tasks associated with the - // descriptor data. - ASIO_DECL void cleanup_descriptor_data( - per_descriptor_data& descriptor_data); - - // Add a new timer queue to the reactor. - template - void add_timer_queue(timer_queue& timer_queue); - - // Remove a timer queue from the reactor. - template - void remove_timer_queue(timer_queue& timer_queue); - - // Schedule a new operation in the given timer queue to expire at the - // specified absolute time. - template - void schedule_timer(timer_queue& queue, - const typename Time_Traits::time_type& time, - typename timer_queue::per_timer_data& timer, wait_op* op); - - // Cancel the timer operations associated with the given token. Returns the - // number of operations that have been posted or dispatched. - template - std::size_t cancel_timer(timer_queue& queue, - typename timer_queue::per_timer_data& timer, - std::size_t max_cancelled = (std::numeric_limits::max)()); - - // Move the timer operations associated with the given timer. - template - void move_timer(timer_queue& queue, - typename timer_queue::per_timer_data& target, - typename timer_queue::per_timer_data& source); - - // Run epoll once until interrupted or events are ready to be dispatched. - ASIO_DECL void run(long usec, op_queue& ops); - - // Interrupt the select loop. - ASIO_DECL void interrupt(); - -private: - // The hint to pass to epoll_create to size its data structures. - enum { epoll_size = 20000 }; - - // Create the epoll file descriptor. Throws an exception if the descriptor - // cannot be created. - ASIO_DECL static int do_epoll_create(); - - // Create the timerfd file descriptor. Does not throw. - ASIO_DECL static int do_timerfd_create(); - - // Allocate a new descriptor state object. - ASIO_DECL descriptor_state* allocate_descriptor_state(); - - // Free an existing descriptor state object. - ASIO_DECL void free_descriptor_state(descriptor_state* s); - - // Helper function to add a new timer queue. - ASIO_DECL void do_add_timer_queue(timer_queue_base& queue); - - // Helper function to remove a timer queue. - ASIO_DECL void do_remove_timer_queue(timer_queue_base& queue); - - // Called to recalculate and update the timeout. - ASIO_DECL void update_timeout(); - - // Get the timeout value for the epoll_wait call. The timeout value is - // returned as a number of milliseconds. A return value of -1 indicates - // that epoll_wait should block indefinitely. - ASIO_DECL int get_timeout(int msec); - -#if defined(ASIO_HAS_TIMERFD) - // Get the timeout value for the timer descriptor. The return value is the - // flag argument to be used when calling timerfd_settime. - ASIO_DECL int get_timeout(itimerspec& ts); -#endif // defined(ASIO_HAS_TIMERFD) - - // The scheduler implementation used to post completions. - scheduler& scheduler_; - - // Mutex to protect access to internal data. - mutex mutex_; - - // The interrupter is used to break a blocking epoll_wait call. - select_interrupter interrupter_; - - // The epoll file descriptor. - int epoll_fd_; - - // The timer file descriptor. - int timer_fd_; - - // The timer queues. - timer_queue_set timer_queues_; - - // Whether the service has been shut down. - bool shutdown_; - - // Mutex to protect access to the registered descriptors. - mutex registered_descriptors_mutex_; - - // Keep track of all registered descriptors. - object_pool registered_descriptors_; - - // Helper class to do post-perform_io cleanup. - struct perform_io_cleanup_on_block_exit; - friend struct perform_io_cleanup_on_block_exit; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/detail/impl/epoll_reactor.hpp" -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/epoll_reactor.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_HAS_EPOLL) - -#endif // ASIO_DETAIL_EPOLL_REACTOR_HPP diff --git a/tools/sdk/include/asio/asio/detail/event.hpp b/tools/sdk/include/asio/asio/detail/event.hpp deleted file mode 100644 index da8fa770b35..00000000000 --- a/tools/sdk/include/asio/asio/detail/event.hpp +++ /dev/null @@ -1,48 +0,0 @@ -// -// detail/event.hpp -// ~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_EVENT_HPP -#define ASIO_DETAIL_EVENT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_HAS_THREADS) -# include "asio/detail/null_event.hpp" -#elif defined(ASIO_WINDOWS) -# include "asio/detail/win_event.hpp" -#elif defined(ASIO_HAS_PTHREADS) -# include "asio/detail/posix_event.hpp" -#elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) -# include "asio/detail/std_event.hpp" -#else -# error Only Windows, POSIX and std::condition_variable are supported! -#endif - -namespace asio { -namespace detail { - -#if !defined(ASIO_HAS_THREADS) -typedef null_event event; -#elif defined(ASIO_WINDOWS) -typedef win_event event; -#elif defined(ASIO_HAS_PTHREADS) -typedef posix_event event; -#elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) -typedef std_event event; -#endif - -} // namespace detail -} // namespace asio - -#endif // ASIO_DETAIL_EVENT_HPP diff --git a/tools/sdk/include/asio/asio/detail/eventfd_select_interrupter.hpp b/tools/sdk/include/asio/asio/detail/eventfd_select_interrupter.hpp deleted file mode 100644 index f6e594b6112..00000000000 --- a/tools/sdk/include/asio/asio/detail/eventfd_select_interrupter.hpp +++ /dev/null @@ -1,83 +0,0 @@ -// -// detail/eventfd_select_interrupter.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2008 Roelof Naude (roelof.naude at gmail dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_EVENTFD_SELECT_INTERRUPTER_HPP -#define ASIO_DETAIL_EVENTFD_SELECT_INTERRUPTER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_EVENTFD) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class eventfd_select_interrupter -{ -public: - // Constructor. - ASIO_DECL eventfd_select_interrupter(); - - // Destructor. - ASIO_DECL ~eventfd_select_interrupter(); - - // Recreate the interrupter's descriptors. Used after a fork. - ASIO_DECL void recreate(); - - // Interrupt the select call. - ASIO_DECL void interrupt(); - - // Reset the select interrupt. Returns true if the call was interrupted. - ASIO_DECL bool reset(); - - // Get the read descriptor to be passed to select. - int read_descriptor() const - { - return read_descriptor_; - } - -private: - // Open the descriptors. Throws on error. - ASIO_DECL void open_descriptors(); - - // Close the descriptors. - ASIO_DECL void close_descriptors(); - - // The read end of a connection used to interrupt the select call. This file - // descriptor is passed to select such that when it is time to stop, a single - // 64bit value will be written on the other end of the connection and this - // descriptor will become readable. - int read_descriptor_; - - // The write end of a connection used to interrupt the select call. A single - // 64bit non-zero value may be written to this to wake up the select which is - // waiting for the other end to become readable. This descriptor will only - // differ from the read descriptor when a pipe is used. - int write_descriptor_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/eventfd_select_interrupter.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_HAS_EVENTFD) - -#endif // ASIO_DETAIL_EVENTFD_SELECT_INTERRUPTER_HPP diff --git a/tools/sdk/include/asio/asio/detail/executor_op.hpp b/tools/sdk/include/asio/asio/detail/executor_op.hpp deleted file mode 100644 index 2d5c7e8b89d..00000000000 --- a/tools/sdk/include/asio/asio/detail/executor_op.hpp +++ /dev/null @@ -1,84 +0,0 @@ -// -// detail/executor_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_EXECUTOR_OP_HPP -#define ASIO_DETAIL_EXECUTOR_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/scheduler_operation.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class executor_op : public Operation -{ -public: - ASIO_DEFINE_HANDLER_ALLOCATOR_PTR(executor_op); - - template - executor_op(ASIO_MOVE_ARG(H) h, const Alloc& allocator) - : Operation(&executor_op::do_complete), - handler_(ASIO_MOVE_CAST(H)(h)), - allocator_(allocator) - { - } - - static void do_complete(void* owner, Operation* base, - const asio::error_code& /*ec*/, - std::size_t /*bytes_transferred*/) - { - // Take ownership of the handler object. - executor_op* o(static_cast(base)); - Alloc allocator(o->allocator_); - ptr p = { detail::addressof(allocator), o, o }; - - ASIO_HANDLER_COMPLETION((*o)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - Handler handler(ASIO_MOVE_CAST(Handler)(o->handler_)); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN(()); - asio_handler_invoke_helpers::invoke(handler, handler); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Handler handler_; - Alloc allocator_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_EXECUTOR_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/fd_set_adapter.hpp b/tools/sdk/include/asio/asio/detail/fd_set_adapter.hpp deleted file mode 100644 index fd373dae1f3..00000000000 --- a/tools/sdk/include/asio/asio/detail/fd_set_adapter.hpp +++ /dev/null @@ -1,39 +0,0 @@ -// -// detail/fd_set_adapter.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_FD_SET_ADAPTER_HPP -#define ASIO_DETAIL_FD_SET_ADAPTER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_WINDOWS_RUNTIME) - -#include "asio/detail/posix_fd_set_adapter.hpp" -#include "asio/detail/win_fd_set_adapter.hpp" - -namespace asio { -namespace detail { - -#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) -typedef win_fd_set_adapter fd_set_adapter; -#else -typedef posix_fd_set_adapter fd_set_adapter; -#endif - -} // namespace detail -} // namespace asio - -#endif // !defined(ASIO_WINDOWS_RUNTIME) - -#endif // ASIO_DETAIL_FD_SET_ADAPTER_HPP diff --git a/tools/sdk/include/asio/asio/detail/fenced_block.hpp b/tools/sdk/include/asio/asio/detail/fenced_block.hpp deleted file mode 100644 index dc34bd9fb47..00000000000 --- a/tools/sdk/include/asio/asio/detail/fenced_block.hpp +++ /dev/null @@ -1,80 +0,0 @@ -// -// detail/fenced_block.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_FENCED_BLOCK_HPP -#define ASIO_DETAIL_FENCED_BLOCK_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_HAS_THREADS) \ - || defined(ASIO_DISABLE_FENCED_BLOCK) -# include "asio/detail/null_fenced_block.hpp" -#elif defined(ASIO_HAS_STD_ATOMIC) -# include "asio/detail/std_fenced_block.hpp" -#elif defined(__MACH__) && defined(__APPLE__) -# include "asio/detail/macos_fenced_block.hpp" -#elif defined(__sun) -# include "asio/detail/solaris_fenced_block.hpp" -#elif defined(__GNUC__) && defined(__arm__) \ - && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) -# include "asio/detail/gcc_arm_fenced_block.hpp" -#elif defined(__GNUC__) && (defined(__hppa) || defined(__hppa__)) -# include "asio/detail/gcc_hppa_fenced_block.hpp" -#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) -# include "asio/detail/gcc_x86_fenced_block.hpp" -#elif defined(__GNUC__) \ - && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)) \ - && !defined(__INTEL_COMPILER) && !defined(__ICL) \ - && !defined(__ICC) && !defined(__ECC) && !defined(__PATHSCALE__) -# include "asio/detail/gcc_sync_fenced_block.hpp" -#elif defined(ASIO_WINDOWS) && !defined(UNDER_CE) -# include "asio/detail/win_fenced_block.hpp" -#else -# include "asio/detail/null_fenced_block.hpp" -#endif - -namespace asio { -namespace detail { - -#if !defined(ASIO_HAS_THREADS) \ - || defined(ASIO_DISABLE_FENCED_BLOCK) -typedef null_fenced_block fenced_block; -#elif defined(ASIO_HAS_STD_ATOMIC) -typedef std_fenced_block fenced_block; -#elif defined(__MACH__) && defined(__APPLE__) -typedef macos_fenced_block fenced_block; -#elif defined(__sun) -typedef solaris_fenced_block fenced_block; -#elif defined(__GNUC__) && defined(__arm__) \ - && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) -typedef gcc_arm_fenced_block fenced_block; -#elif defined(__GNUC__) && (defined(__hppa) || defined(__hppa__)) -typedef gcc_hppa_fenced_block fenced_block; -#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) -typedef gcc_x86_fenced_block fenced_block; -#elif defined(__GNUC__) \ - && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)) \ - && !defined(__INTEL_COMPILER) && !defined(__ICL) \ - && !defined(__ICC) && !defined(__ECC) && !defined(__PATHSCALE__) -typedef gcc_sync_fenced_block fenced_block; -#elif defined(ASIO_WINDOWS) && !defined(UNDER_CE) -typedef win_fenced_block fenced_block; -#else -typedef null_fenced_block fenced_block; -#endif - -} // namespace detail -} // namespace asio - -#endif // ASIO_DETAIL_FENCED_BLOCK_HPP diff --git a/tools/sdk/include/asio/asio/detail/functional.hpp b/tools/sdk/include/asio/asio/detail/functional.hpp deleted file mode 100644 index a37e9e63186..00000000000 --- a/tools/sdk/include/asio/asio/detail/functional.hpp +++ /dev/null @@ -1,38 +0,0 @@ -// -// detail/functional.hpp -// ~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_FUNCTIONAL_HPP -#define ASIO_DETAIL_FUNCTIONAL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include - -#if !defined(ASIO_HAS_STD_FUNCTION) -# include -#endif // !defined(ASIO_HAS_STD_FUNCTION) - -namespace asio { -namespace detail { - -#if defined(ASIO_HAS_STD_FUNCTION) -using std::function; -#else // defined(ASIO_HAS_STD_FUNCTION) -using boost::function; -#endif // defined(ASIO_HAS_STD_FUNCTION) - -} // namespace detail -} // namespace asio - -#endif // ASIO_DETAIL_FUNCTIONAL_HPP diff --git a/tools/sdk/include/asio/asio/detail/gcc_arm_fenced_block.hpp b/tools/sdk/include/asio/asio/detail/gcc_arm_fenced_block.hpp deleted file mode 100644 index 7919a551c70..00000000000 --- a/tools/sdk/include/asio/asio/detail/gcc_arm_fenced_block.hpp +++ /dev/null @@ -1,91 +0,0 @@ -// -// detail/gcc_arm_fenced_block.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_GCC_ARM_FENCED_BLOCK_HPP -#define ASIO_DETAIL_GCC_ARM_FENCED_BLOCK_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(__GNUC__) && defined(__arm__) - -#include "asio/detail/noncopyable.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class gcc_arm_fenced_block - : private noncopyable -{ -public: - enum half_t { half }; - enum full_t { full }; - - // Constructor for a half fenced block. - explicit gcc_arm_fenced_block(half_t) - { - } - - // Constructor for a full fenced block. - explicit gcc_arm_fenced_block(full_t) - { - barrier(); - } - - // Destructor. - ~gcc_arm_fenced_block() - { - barrier(); - } - -private: - static void barrier() - { -#if defined(__ARM_ARCH_4__) \ - || defined(__ARM_ARCH_4T__) \ - || defined(__ARM_ARCH_5__) \ - || defined(__ARM_ARCH_5E__) \ - || defined(__ARM_ARCH_5T__) \ - || defined(__ARM_ARCH_5TE__) \ - || defined(__ARM_ARCH_5TEJ__) \ - || defined(__ARM_ARCH_6__) \ - || defined(__ARM_ARCH_6J__) \ - || defined(__ARM_ARCH_6K__) \ - || defined(__ARM_ARCH_6Z__) \ - || defined(__ARM_ARCH_6ZK__) \ - || defined(__ARM_ARCH_6T2__) -# if defined(__thumb__) - // This is just a placeholder and almost certainly not sufficient. - __asm__ __volatile__ ("" : : : "memory"); -# else // defined(__thumb__) - int a = 0, b = 0; - __asm__ __volatile__ ("swp %0, %1, [%2]" - : "=&r"(a) : "r"(1), "r"(&b) : "memory", "cc"); -# endif // defined(__thumb__) -#else - // ARMv7 and later. - __asm__ __volatile__ ("dmb" : : : "memory"); -#endif - } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(__GNUC__) && defined(__arm__) - -#endif // ASIO_DETAIL_GCC_ARM_FENCED_BLOCK_HPP diff --git a/tools/sdk/include/asio/asio/detail/gcc_hppa_fenced_block.hpp b/tools/sdk/include/asio/asio/detail/gcc_hppa_fenced_block.hpp deleted file mode 100644 index d3957ce33e6..00000000000 --- a/tools/sdk/include/asio/asio/detail/gcc_hppa_fenced_block.hpp +++ /dev/null @@ -1,68 +0,0 @@ -// -// detail/gcc_hppa_fenced_block.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_GCC_HPPA_FENCED_BLOCK_HPP -#define ASIO_DETAIL_GCC_HPPA_FENCED_BLOCK_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(__GNUC__) && (defined(__hppa) || defined(__hppa__)) - -#include "asio/detail/noncopyable.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class gcc_hppa_fenced_block - : private noncopyable -{ -public: - enum half_t { half }; - enum full_t { full }; - - // Constructor for a half fenced block. - explicit gcc_hppa_fenced_block(half_t) - { - } - - // Constructor for a full fenced block. - explicit gcc_hppa_fenced_block(full_t) - { - barrier(); - } - - // Destructor. - ~gcc_hppa_fenced_block() - { - barrier(); - } - -private: - static void barrier() - { - // This is just a placeholder and almost certainly not sufficient. - __asm__ __volatile__ ("" : : : "memory"); - } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(__GNUC__) && (defined(__hppa) || defined(__hppa__)) - -#endif // ASIO_DETAIL_GCC_HPPA_FENCED_BLOCK_HPP diff --git a/tools/sdk/include/asio/asio/detail/gcc_sync_fenced_block.hpp b/tools/sdk/include/asio/asio/detail/gcc_sync_fenced_block.hpp deleted file mode 100644 index 90d176f12ae..00000000000 --- a/tools/sdk/include/asio/asio/detail/gcc_sync_fenced_block.hpp +++ /dev/null @@ -1,65 +0,0 @@ -// -// detail/gcc_sync_fenced_block.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_GCC_SYNC_FENCED_BLOCK_HPP -#define ASIO_DETAIL_GCC_SYNC_FENCED_BLOCK_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(__GNUC__) \ - && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)) \ - && !defined(__INTEL_COMPILER) && !defined(__ICL) \ - && !defined(__ICC) && !defined(__ECC) && !defined(__PATHSCALE__) - -#include "asio/detail/noncopyable.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class gcc_sync_fenced_block - : private noncopyable -{ -public: - enum half_or_full_t { half, full }; - - // Constructor. - explicit gcc_sync_fenced_block(half_or_full_t) - : value_(0) - { - __sync_lock_test_and_set(&value_, 1); - } - - // Destructor. - ~gcc_sync_fenced_block() - { - __sync_lock_release(&value_); - } - -private: - int value_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(__GNUC__) - // && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)) - // && !defined(__INTEL_COMPILER) && !defined(__ICL) - // && !defined(__ICC) && !defined(__ECC) && !defined(__PATHSCALE__) - -#endif // ASIO_DETAIL_GCC_SYNC_FENCED_BLOCK_HPP diff --git a/tools/sdk/include/asio/asio/detail/gcc_x86_fenced_block.hpp b/tools/sdk/include/asio/asio/detail/gcc_x86_fenced_block.hpp deleted file mode 100644 index 1366def74e6..00000000000 --- a/tools/sdk/include/asio/asio/detail/gcc_x86_fenced_block.hpp +++ /dev/null @@ -1,99 +0,0 @@ -// -// detail/gcc_x86_fenced_block.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_GCC_X86_FENCED_BLOCK_HPP -#define ASIO_DETAIL_GCC_X86_FENCED_BLOCK_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) - -#include "asio/detail/noncopyable.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class gcc_x86_fenced_block - : private noncopyable -{ -public: - enum half_t { half }; - enum full_t { full }; - - // Constructor for a half fenced block. - explicit gcc_x86_fenced_block(half_t) - { - } - - // Constructor for a full fenced block. - explicit gcc_x86_fenced_block(full_t) - { - lbarrier(); - } - - // Destructor. - ~gcc_x86_fenced_block() - { - sbarrier(); - } - -private: - static int barrier() - { - int r = 0, m = 1; - __asm__ __volatile__ ( - "xchgl %0, %1" : - "=r"(r), "=m"(m) : - "0"(1), "m"(m) : - "memory", "cc"); - return r; - } - - static void lbarrier() - { -#if defined(__SSE2__) -# if (__GNUC__ >= 4) && !defined(__INTEL_COMPILER) && !defined(__ICL) - __builtin_ia32_lfence(); -# else // (__GNUC__ >= 4) && !defined(__INTEL_COMPILER) && !defined(__ICL) - __asm__ __volatile__ ("lfence" ::: "memory"); -# endif // (__GNUC__ >= 4) && !defined(__INTEL_COMPILER) && !defined(__ICL) -#else // defined(__SSE2__) - barrier(); -#endif // defined(__SSE2__) - } - - static void sbarrier() - { -#if defined(__SSE2__) -# if (__GNUC__ >= 4) && !defined(__INTEL_COMPILER) && !defined(__ICL) - __builtin_ia32_sfence(); -# else // (__GNUC__ >= 4) && !defined(__INTEL_COMPILER) && !defined(__ICL) - __asm__ __volatile__ ("sfence" ::: "memory"); -# endif // (__GNUC__ >= 4) && !defined(__INTEL_COMPILER) && !defined(__ICL) -#else // defined(__SSE2__) - barrier(); -#endif // defined(__SSE2__) - } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) - -#endif // ASIO_DETAIL_GCC_X86_FENCED_BLOCK_HPP diff --git a/tools/sdk/include/asio/asio/detail/global.hpp b/tools/sdk/include/asio/asio/detail/global.hpp deleted file mode 100644 index 085ac643d6c..00000000000 --- a/tools/sdk/include/asio/asio/detail/global.hpp +++ /dev/null @@ -1,52 +0,0 @@ -// -// detail/global.hpp -// ~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_GLOBAL_HPP -#define ASIO_DETAIL_GLOBAL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_HAS_THREADS) -# include "asio/detail/null_global.hpp" -#elif defined(ASIO_WINDOWS) -# include "asio/detail/win_global.hpp" -#elif defined(ASIO_HAS_PTHREADS) -# include "asio/detail/posix_global.hpp" -#elif defined(ASIO_HAS_STD_CALL_ONCE) -# include "asio/detail/std_global.hpp" -#else -# error Only Windows, POSIX and std::call_once are supported! -#endif - -namespace asio { -namespace detail { - -template -inline T& global() -{ -#if !defined(ASIO_HAS_THREADS) - return null_global(); -#elif defined(ASIO_WINDOWS) - return win_global(); -#elif defined(ASIO_HAS_PTHREADS) - return posix_global(); -#elif defined(ASIO_HAS_STD_CALL_ONCE) - return std_global(); -#endif -} - -} // namespace detail -} // namespace asio - -#endif // ASIO_DETAIL_GLOBAL_HPP diff --git a/tools/sdk/include/asio/asio/detail/handler_alloc_helpers.hpp b/tools/sdk/include/asio/asio/detail/handler_alloc_helpers.hpp deleted file mode 100644 index afefb4d12d6..00000000000 --- a/tools/sdk/include/asio/asio/detail/handler_alloc_helpers.hpp +++ /dev/null @@ -1,235 +0,0 @@ -// -// detail/handler_alloc_helpers.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_HANDLER_ALLOC_HELPERS_HPP -#define ASIO_DETAIL_HANDLER_ALLOC_HELPERS_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/recycling_allocator.hpp" -#include "asio/associated_allocator.hpp" -#include "asio/handler_alloc_hook.hpp" - -#include "asio/detail/push_options.hpp" - -// Calls to asio_handler_allocate and asio_handler_deallocate must be made from -// a namespace that does not contain any overloads of these functions. The -// asio_handler_alloc_helpers namespace is defined here for that purpose. -namespace asio_handler_alloc_helpers { - -template -inline void* allocate(std::size_t s, Handler& h) -{ -#if !defined(ASIO_HAS_HANDLER_HOOKS) - return ::operator new(s); -#else - using asio::asio_handler_allocate; - return asio_handler_allocate(s, asio::detail::addressof(h)); -#endif -} - -template -inline void deallocate(void* p, std::size_t s, Handler& h) -{ -#if !defined(ASIO_HAS_HANDLER_HOOKS) - ::operator delete(p); -#else - using asio::asio_handler_deallocate; - asio_handler_deallocate(p, s, asio::detail::addressof(h)); -#endif -} - -} // namespace asio_handler_alloc_helpers - -namespace asio { -namespace detail { - -template -class hook_allocator -{ -public: - typedef T value_type; - - template - struct rebind - { - typedef hook_allocator other; - }; - - explicit hook_allocator(Handler& h) - : handler_(h) - { - } - - template - hook_allocator(const hook_allocator& a) - : handler_(a.handler_) - { - } - - T* allocate(std::size_t n) - { - return static_cast( - asio_handler_alloc_helpers::allocate(sizeof(T) * n, handler_)); - } - - void deallocate(T* p, std::size_t n) - { - asio_handler_alloc_helpers::deallocate(p, sizeof(T) * n, handler_); - } - -//private: - Handler& handler_; -}; - -template -class hook_allocator -{ -public: - typedef void value_type; - - template - struct rebind - { - typedef hook_allocator other; - }; - - explicit hook_allocator(Handler& h) - : handler_(h) - { - } - - template - hook_allocator(const hook_allocator& a) - : handler_(a.handler_) - { - } - -//private: - Handler& handler_; -}; - -template -struct get_hook_allocator -{ - typedef Allocator type; - - static type get(Handler&, const Allocator& a) - { - return a; - } -}; - -template -struct get_hook_allocator > -{ - typedef hook_allocator type; - - static type get(Handler& handler, const std::allocator&) - { - return type(handler); - } -}; - -} // namespace detail -} // namespace asio - -#define ASIO_DEFINE_HANDLER_PTR(op) \ - struct ptr \ - { \ - Handler* h; \ - op* v; \ - op* p; \ - ~ptr() \ - { \ - reset(); \ - } \ - static op* allocate(Handler& handler) \ - { \ - typedef typename ::asio::associated_allocator< \ - Handler>::type associated_allocator_type; \ - typedef typename ::asio::detail::get_hook_allocator< \ - Handler, associated_allocator_type>::type hook_allocator_type; \ - ASIO_REBIND_ALLOC(hook_allocator_type, op) a( \ - ::asio::detail::get_hook_allocator< \ - Handler, associated_allocator_type>::get( \ - handler, ::asio::get_associated_allocator(handler))); \ - return a.allocate(1); \ - } \ - void reset() \ - { \ - if (p) \ - { \ - p->~op(); \ - p = 0; \ - } \ - if (v) \ - { \ - typedef typename ::asio::associated_allocator< \ - Handler>::type associated_allocator_type; \ - typedef typename ::asio::detail::get_hook_allocator< \ - Handler, associated_allocator_type>::type hook_allocator_type; \ - ASIO_REBIND_ALLOC(hook_allocator_type, op) a( \ - ::asio::detail::get_hook_allocator< \ - Handler, associated_allocator_type>::get( \ - *h, ::asio::get_associated_allocator(*h))); \ - a.deallocate(static_cast(v), 1); \ - v = 0; \ - } \ - } \ - } \ - /**/ - -#define ASIO_DEFINE_HANDLER_ALLOCATOR_PTR(op) \ - struct ptr \ - { \ - const Alloc* a; \ - void* v; \ - op* p; \ - ~ptr() \ - { \ - reset(); \ - } \ - static op* allocate(const Alloc& a) \ - { \ - typedef typename ::asio::detail::get_recycling_allocator< \ - Alloc>::type recycling_allocator_type; \ - ASIO_REBIND_ALLOC(recycling_allocator_type, op) a1( \ - ::asio::detail::get_recycling_allocator::get(a)); \ - return a1.allocate(1); \ - } \ - void reset() \ - { \ - if (p) \ - { \ - p->~op(); \ - p = 0; \ - } \ - if (v) \ - { \ - typedef typename ::asio::detail::get_recycling_allocator< \ - Alloc>::type recycling_allocator_type; \ - ASIO_REBIND_ALLOC(recycling_allocator_type, op) a1( \ - ::asio::detail::get_recycling_allocator::get(*a)); \ - a1.deallocate(static_cast(v), 1); \ - v = 0; \ - } \ - } \ - } \ - /**/ - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_HANDLER_ALLOC_HELPERS_HPP diff --git a/tools/sdk/include/asio/asio/detail/handler_cont_helpers.hpp b/tools/sdk/include/asio/asio/detail/handler_cont_helpers.hpp deleted file mode 100644 index 110ba944f9f..00000000000 --- a/tools/sdk/include/asio/asio/detail/handler_cont_helpers.hpp +++ /dev/null @@ -1,45 +0,0 @@ -// -// detail/handler_cont_helpers.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_HANDLER_CONT_HELPERS_HPP -#define ASIO_DETAIL_HANDLER_CONT_HELPERS_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/memory.hpp" -#include "asio/handler_continuation_hook.hpp" - -#include "asio/detail/push_options.hpp" - -// Calls to asio_handler_is_continuation must be made from a namespace that -// does not contain overloads of this function. This namespace is defined here -// for that purpose. -namespace asio_handler_cont_helpers { - -template -inline bool is_continuation(Context& context) -{ -#if !defined(ASIO_HAS_HANDLER_HOOKS) - return false; -#else - using asio::asio_handler_is_continuation; - return asio_handler_is_continuation( - asio::detail::addressof(context)); -#endif -} - -} // namespace asio_handler_cont_helpers - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_HANDLER_CONT_HELPERS_HPP diff --git a/tools/sdk/include/asio/asio/detail/handler_invoke_helpers.hpp b/tools/sdk/include/asio/asio/detail/handler_invoke_helpers.hpp deleted file mode 100644 index 4c65c4c530c..00000000000 --- a/tools/sdk/include/asio/asio/detail/handler_invoke_helpers.hpp +++ /dev/null @@ -1,57 +0,0 @@ -// -// detail/handler_invoke_helpers.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_HANDLER_INVOKE_HELPERS_HPP -#define ASIO_DETAIL_HANDLER_INVOKE_HELPERS_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/memory.hpp" -#include "asio/handler_invoke_hook.hpp" - -#include "asio/detail/push_options.hpp" - -// Calls to asio_handler_invoke must be made from a namespace that does not -// contain overloads of this function. The asio_handler_invoke_helpers -// namespace is defined here for that purpose. -namespace asio_handler_invoke_helpers { - -template -inline void invoke(Function& function, Context& context) -{ -#if !defined(ASIO_HAS_HANDLER_HOOKS) - Function tmp(function); - tmp(); -#else - using asio::asio_handler_invoke; - asio_handler_invoke(function, asio::detail::addressof(context)); -#endif -} - -template -inline void invoke(const Function& function, Context& context) -{ -#if !defined(ASIO_HAS_HANDLER_HOOKS) - Function tmp(function); - tmp(); -#else - using asio::asio_handler_invoke; - asio_handler_invoke(function, asio::detail::addressof(context)); -#endif -} - -} // namespace asio_handler_invoke_helpers - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_HANDLER_INVOKE_HELPERS_HPP diff --git a/tools/sdk/include/asio/asio/detail/handler_tracking.hpp b/tools/sdk/include/asio/asio/detail/handler_tracking.hpp deleted file mode 100644 index 83f820eca95..00000000000 --- a/tools/sdk/include/asio/asio/detail/handler_tracking.hpp +++ /dev/null @@ -1,238 +0,0 @@ -// -// detail/handler_tracking.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_HANDLER_TRACKING_HPP -#define ASIO_DETAIL_HANDLER_TRACKING_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -namespace asio { - -class execution_context; - -} // namespace asio - -#if defined(ASIO_CUSTOM_HANDLER_TRACKING) -# include ASIO_CUSTOM_HANDLER_TRACKING -#elif defined(ASIO_ENABLE_HANDLER_TRACKING) -# include "asio/error_code.hpp" -# include "asio/detail/cstdint.hpp" -# include "asio/detail/static_mutex.hpp" -# include "asio/detail/tss_ptr.hpp" -#endif // defined(ASIO_ENABLE_HANDLER_TRACKING) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -#if defined(ASIO_CUSTOM_HANDLER_TRACKING) - -// The user-specified header must define the following macros: -// - ASIO_INHERIT_TRACKED_HANDLER -// - ASIO_ALSO_INHERIT_TRACKED_HANDLER -// - ASIO_HANDLER_TRACKING_INIT -// - ASIO_HANDLER_CREATION(args) -// - ASIO_HANDLER_COMPLETION(args) -// - ASIO_HANDLER_INVOCATION_BEGIN(args) -// - ASIO_HANDLER_INVOCATION_END -// - ASIO_HANDLER_OPERATION(args) -// - ASIO_HANDLER_REACTOR_REGISTRATION(args) -// - ASIO_HANDLER_REACTOR_DEREGISTRATION(args) -// - ASIO_HANDLER_REACTOR_READ_EVENT -// - ASIO_HANDLER_REACTOR_WRITE_EVENT -// - ASIO_HANDLER_REACTOR_ERROR_EVENT -// - ASIO_HANDLER_REACTOR_EVENTS(args) -// - ASIO_HANDLER_REACTOR_OPERATION(args) - -# if !defined(ASIO_ENABLE_HANDLER_TRACKING) -# define ASIO_ENABLE_HANDLER_TRACKING 1 -# endif /// !defined(ASIO_ENABLE_HANDLER_TRACKING) - -#elif defined(ASIO_ENABLE_HANDLER_TRACKING) - -class handler_tracking -{ -public: - class completion; - - // Base class for objects containing tracked handlers. - class tracked_handler - { - private: - // Only the handler_tracking class will have access to the id. - friend class handler_tracking; - friend class completion; - uint64_t id_; - - protected: - // Constructor initialises with no id. - tracked_handler() : id_(0) {} - - // Prevent deletion through this type. - ~tracked_handler() {} - }; - - // Initialise the tracking system. - ASIO_DECL static void init(); - - // Record the creation of a tracked handler. - ASIO_DECL static void creation( - execution_context& context, tracked_handler& h, - const char* object_type, void* object, - uintmax_t native_handle, const char* op_name); - - class completion - { - public: - // Constructor records that handler is to be invoked with no arguments. - ASIO_DECL explicit completion(const tracked_handler& h); - - // Destructor records only when an exception is thrown from the handler, or - // if the memory is being freed without the handler having been invoked. - ASIO_DECL ~completion(); - - // Records that handler is to be invoked with no arguments. - ASIO_DECL void invocation_begin(); - - // Records that handler is to be invoked with one arguments. - ASIO_DECL void invocation_begin(const asio::error_code& ec); - - // Constructor records that handler is to be invoked with two arguments. - ASIO_DECL void invocation_begin( - const asio::error_code& ec, std::size_t bytes_transferred); - - // Constructor records that handler is to be invoked with two arguments. - ASIO_DECL void invocation_begin( - const asio::error_code& ec, int signal_number); - - // Constructor records that handler is to be invoked with two arguments. - ASIO_DECL void invocation_begin( - const asio::error_code& ec, const char* arg); - - // Record that handler invocation has ended. - ASIO_DECL void invocation_end(); - - private: - friend class handler_tracking; - uint64_t id_; - bool invoked_; - completion* next_; - }; - - // Record an operation that is not directly associated with a handler. - ASIO_DECL static void operation(execution_context& context, - const char* object_type, void* object, - uintmax_t native_handle, const char* op_name); - - // Record that a descriptor has been registered with the reactor. - ASIO_DECL static void reactor_registration(execution_context& context, - uintmax_t native_handle, uintmax_t registration); - - // Record that a descriptor has been deregistered from the reactor. - ASIO_DECL static void reactor_deregistration(execution_context& context, - uintmax_t native_handle, uintmax_t registration); - - // Record a reactor-based operation that is associated with a handler. - ASIO_DECL static void reactor_events(execution_context& context, - uintmax_t registration, unsigned events); - - // Record a reactor-based operation that is associated with a handler. - ASIO_DECL static void reactor_operation( - const tracked_handler& h, const char* op_name, - const asio::error_code& ec); - - // Record a reactor-based operation that is associated with a handler. - ASIO_DECL static void reactor_operation( - const tracked_handler& h, const char* op_name, - const asio::error_code& ec, std::size_t bytes_transferred); - - // Write a line of output. - ASIO_DECL static void write_line(const char* format, ...); - -private: - struct tracking_state; - ASIO_DECL static tracking_state* get_state(); -}; - -# define ASIO_INHERIT_TRACKED_HANDLER \ - : public asio::detail::handler_tracking::tracked_handler - -# define ASIO_ALSO_INHERIT_TRACKED_HANDLER \ - , public asio::detail::handler_tracking::tracked_handler - -# define ASIO_HANDLER_TRACKING_INIT \ - asio::detail::handler_tracking::init() - -# define ASIO_HANDLER_CREATION(args) \ - asio::detail::handler_tracking::creation args - -# define ASIO_HANDLER_COMPLETION(args) \ - asio::detail::handler_tracking::completion tracked_completion args - -# define ASIO_HANDLER_INVOCATION_BEGIN(args) \ - tracked_completion.invocation_begin args - -# define ASIO_HANDLER_INVOCATION_END \ - tracked_completion.invocation_end() - -# define ASIO_HANDLER_OPERATION(args) \ - asio::detail::handler_tracking::operation args - -# define ASIO_HANDLER_REACTOR_REGISTRATION(args) \ - asio::detail::handler_tracking::reactor_registration args - -# define ASIO_HANDLER_REACTOR_DEREGISTRATION(args) \ - asio::detail::handler_tracking::reactor_deregistration args - -# define ASIO_HANDLER_REACTOR_READ_EVENT 1 -# define ASIO_HANDLER_REACTOR_WRITE_EVENT 2 -# define ASIO_HANDLER_REACTOR_ERROR_EVENT 4 - -# define ASIO_HANDLER_REACTOR_EVENTS(args) \ - asio::detail::handler_tracking::reactor_events args - -# define ASIO_HANDLER_REACTOR_OPERATION(args) \ - asio::detail::handler_tracking::reactor_operation args - -#else // defined(ASIO_ENABLE_HANDLER_TRACKING) - -# define ASIO_INHERIT_TRACKED_HANDLER -# define ASIO_ALSO_INHERIT_TRACKED_HANDLER -# define ASIO_HANDLER_TRACKING_INIT (void)0 -# define ASIO_HANDLER_CREATION(args) (void)0 -# define ASIO_HANDLER_COMPLETION(args) (void)0 -# define ASIO_HANDLER_INVOCATION_BEGIN(args) (void)0 -# define ASIO_HANDLER_INVOCATION_END (void)0 -# define ASIO_HANDLER_OPERATION(args) (void)0 -# define ASIO_HANDLER_REACTOR_REGISTRATION(args) (void)0 -# define ASIO_HANDLER_REACTOR_DEREGISTRATION(args) (void)0 -# define ASIO_HANDLER_REACTOR_READ_EVENT 0 -# define ASIO_HANDLER_REACTOR_WRITE_EVENT 0 -# define ASIO_HANDLER_REACTOR_ERROR_EVENT 0 -# define ASIO_HANDLER_REACTOR_EVENTS(args) (void)0 -# define ASIO_HANDLER_REACTOR_OPERATION(args) (void)0 - -#endif // defined(ASIO_ENABLE_HANDLER_TRACKING) - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/handler_tracking.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_DETAIL_HANDLER_TRACKING_HPP diff --git a/tools/sdk/include/asio/asio/detail/handler_type_requirements.hpp b/tools/sdk/include/asio/asio/detail/handler_type_requirements.hpp deleted file mode 100644 index 9181bc515e2..00000000000 --- a/tools/sdk/include/asio/asio/detail/handler_type_requirements.hpp +++ /dev/null @@ -1,556 +0,0 @@ -// -// detail/handler_type_requirements.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_HANDLER_TYPE_REQUIREMENTS_HPP -#define ASIO_DETAIL_HANDLER_TYPE_REQUIREMENTS_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -// Older versions of gcc have difficulty compiling the sizeof expressions where -// we test the handler type requirements. We'll disable checking of handler type -// requirements for those compilers, but otherwise enable it by default. -#if !defined(ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS) -# if !defined(__GNUC__) || (__GNUC__ >= 4) -# define ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS 1 -# endif // !defined(__GNUC__) || (__GNUC__ >= 4) -#endif // !defined(ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS) - -// With C++0x we can use a combination of enhanced SFINAE and static_assert to -// generate better template error messages. As this technique is not yet widely -// portable, we'll only enable it for tested compilers. -#if !defined(ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT) -# if defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT 1 -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1600) -# define ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT 1 -# endif // (_MSC_VER >= 1600) -# endif // defined(ASIO_MSVC) -# if defined(__clang__) -# if __has_feature(__cxx_static_assert__) -# define ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT 1 -# endif // __has_feature(cxx_static_assert) -# endif // defined(__clang__) -#endif // !defined(ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS) - -#if defined(ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS) -# include "asio/async_result.hpp" -#endif // defined(ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS) - -namespace asio { -namespace detail { - -#if defined(ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS) - -# if defined(ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT) - -template -auto zero_arg_copyable_handler_test(Handler h, void*) - -> decltype( - sizeof(Handler(static_cast(h))), - ((h)()), - char(0)); - -template -char (&zero_arg_copyable_handler_test(Handler, ...))[2]; - -template -auto one_arg_handler_test(Handler h, Arg1* a1) - -> decltype( - sizeof(Handler(ASIO_MOVE_CAST(Handler)(h))), - ((h)(*a1)), - char(0)); - -template -char (&one_arg_handler_test(Handler h, ...))[2]; - -template -auto two_arg_handler_test(Handler h, Arg1* a1, Arg2* a2) - -> decltype( - sizeof(Handler(ASIO_MOVE_CAST(Handler)(h))), - ((h)(*a1, *a2)), - char(0)); - -template -char (&two_arg_handler_test(Handler, ...))[2]; - -template -auto two_arg_move_handler_test(Handler h, Arg1* a1, Arg2* a2) - -> decltype( - sizeof(Handler(ASIO_MOVE_CAST(Handler)(h))), - ((h)(*a1, ASIO_MOVE_CAST(Arg2)(*a2))), - char(0)); - -template -char (&two_arg_move_handler_test(Handler, ...))[2]; - -# define ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT(expr, msg) \ - static_assert(expr, msg); - -# else // defined(ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT) - -# define ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT(expr, msg) - -# endif // defined(ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT) - -template T& lvref(); -template T& lvref(T); -template const T& clvref(); -template const T& clvref(T); -#if defined(ASIO_HAS_MOVE) -template T rvref(); -template T rvref(T); -#else // defined(ASIO_HAS_MOVE) -template const T& rvref(); -template const T& rvref(T); -#endif // defined(ASIO_HAS_MOVE) -template char argbyv(T); - -template -struct handler_type_requirements -{ -}; - -#define ASIO_LEGACY_COMPLETION_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef ASIO_HANDLER_TYPE(handler_type, \ - void()) asio_true_handler_type; \ - \ - ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(asio::detail::zero_arg_copyable_handler_test( \ - asio::detail::clvref< \ - asio_true_handler_type>(), 0)) == 1, \ - "CompletionHandler type requirements not met") \ - \ - typedef asio::detail::handler_type_requirements< \ - sizeof( \ - asio::detail::argbyv( \ - asio::detail::clvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - asio::detail::lvref< \ - asio_true_handler_type>()(), \ - char(0))> ASIO_UNUSED_TYPEDEF - -#define ASIO_READ_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef ASIO_HANDLER_TYPE(handler_type, \ - void(asio::error_code, std::size_t)) \ - asio_true_handler_type; \ - \ - ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(asio::detail::two_arg_handler_test( \ - asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast(0), \ - static_cast(0))) == 1, \ - "ReadHandler type requirements not met") \ - \ - typedef asio::detail::handler_type_requirements< \ - sizeof( \ - asio::detail::argbyv( \ - asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - asio::detail::lvref< \ - asio_true_handler_type>()( \ - asio::detail::lvref(), \ - asio::detail::lvref()), \ - char(0))> ASIO_UNUSED_TYPEDEF - -#define ASIO_WRITE_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef ASIO_HANDLER_TYPE(handler_type, \ - void(asio::error_code, std::size_t)) \ - asio_true_handler_type; \ - \ - ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(asio::detail::two_arg_handler_test( \ - asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast(0), \ - static_cast(0))) == 1, \ - "WriteHandler type requirements not met") \ - \ - typedef asio::detail::handler_type_requirements< \ - sizeof( \ - asio::detail::argbyv( \ - asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - asio::detail::lvref< \ - asio_true_handler_type>()( \ - asio::detail::lvref(), \ - asio::detail::lvref()), \ - char(0))> ASIO_UNUSED_TYPEDEF - -#define ASIO_ACCEPT_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef ASIO_HANDLER_TYPE(handler_type, \ - void(asio::error_code)) \ - asio_true_handler_type; \ - \ - ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(asio::detail::one_arg_handler_test( \ - asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast(0))) == 1, \ - "AcceptHandler type requirements not met") \ - \ - typedef asio::detail::handler_type_requirements< \ - sizeof( \ - asio::detail::argbyv( \ - asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - asio::detail::lvref< \ - asio_true_handler_type>()( \ - asio::detail::lvref()), \ - char(0))> ASIO_UNUSED_TYPEDEF - -#define ASIO_MOVE_ACCEPT_HANDLER_CHECK( \ - handler_type, handler, socket_type) \ - \ - typedef ASIO_HANDLER_TYPE(handler_type, \ - void(asio::error_code, socket_type)) \ - asio_true_handler_type; \ - \ - ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(asio::detail::two_arg_move_handler_test( \ - asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast(0), \ - static_cast(0))) == 1, \ - "MoveAcceptHandler type requirements not met") \ - \ - typedef asio::detail::handler_type_requirements< \ - sizeof( \ - asio::detail::argbyv( \ - asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - asio::detail::lvref< \ - asio_true_handler_type>()( \ - asio::detail::lvref(), \ - asio::detail::rvref()), \ - char(0))> ASIO_UNUSED_TYPEDEF - -#define ASIO_CONNECT_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef ASIO_HANDLER_TYPE(handler_type, \ - void(asio::error_code)) \ - asio_true_handler_type; \ - \ - ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(asio::detail::one_arg_handler_test( \ - asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast(0))) == 1, \ - "ConnectHandler type requirements not met") \ - \ - typedef asio::detail::handler_type_requirements< \ - sizeof( \ - asio::detail::argbyv( \ - asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - asio::detail::lvref< \ - asio_true_handler_type>()( \ - asio::detail::lvref()), \ - char(0))> ASIO_UNUSED_TYPEDEF - -#define ASIO_RANGE_CONNECT_HANDLER_CHECK( \ - handler_type, handler, endpoint_type) \ - \ - typedef ASIO_HANDLER_TYPE(handler_type, \ - void(asio::error_code, endpoint_type)) \ - asio_true_handler_type; \ - \ - ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(asio::detail::two_arg_handler_test( \ - asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast(0), \ - static_cast(0))) == 1, \ - "RangeConnectHandler type requirements not met") \ - \ - typedef asio::detail::handler_type_requirements< \ - sizeof( \ - asio::detail::argbyv( \ - asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - asio::detail::lvref< \ - asio_true_handler_type>()( \ - asio::detail::lvref(), \ - asio::detail::lvref()), \ - char(0))> ASIO_UNUSED_TYPEDEF - -#define ASIO_ITERATOR_CONNECT_HANDLER_CHECK( \ - handler_type, handler, iter_type) \ - \ - typedef ASIO_HANDLER_TYPE(handler_type, \ - void(asio::error_code, iter_type)) \ - asio_true_handler_type; \ - \ - ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(asio::detail::two_arg_handler_test( \ - asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast(0), \ - static_cast(0))) == 1, \ - "IteratorConnectHandler type requirements not met") \ - \ - typedef asio::detail::handler_type_requirements< \ - sizeof( \ - asio::detail::argbyv( \ - asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - asio::detail::lvref< \ - asio_true_handler_type>()( \ - asio::detail::lvref(), \ - asio::detail::lvref()), \ - char(0))> ASIO_UNUSED_TYPEDEF - -#define ASIO_RESOLVE_HANDLER_CHECK( \ - handler_type, handler, range_type) \ - \ - typedef ASIO_HANDLER_TYPE(handler_type, \ - void(asio::error_code, range_type)) \ - asio_true_handler_type; \ - \ - ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(asio::detail::two_arg_handler_test( \ - asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast(0), \ - static_cast(0))) == 1, \ - "ResolveHandler type requirements not met") \ - \ - typedef asio::detail::handler_type_requirements< \ - sizeof( \ - asio::detail::argbyv( \ - asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - asio::detail::lvref< \ - asio_true_handler_type>()( \ - asio::detail::lvref(), \ - asio::detail::lvref()), \ - char(0))> ASIO_UNUSED_TYPEDEF - -#define ASIO_WAIT_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef ASIO_HANDLER_TYPE(handler_type, \ - void(asio::error_code)) \ - asio_true_handler_type; \ - \ - ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(asio::detail::one_arg_handler_test( \ - asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast(0))) == 1, \ - "WaitHandler type requirements not met") \ - \ - typedef asio::detail::handler_type_requirements< \ - sizeof( \ - asio::detail::argbyv( \ - asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - asio::detail::lvref< \ - asio_true_handler_type>()( \ - asio::detail::lvref()), \ - char(0))> ASIO_UNUSED_TYPEDEF - -#define ASIO_SIGNAL_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef ASIO_HANDLER_TYPE(handler_type, \ - void(asio::error_code, int)) \ - asio_true_handler_type; \ - \ - ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(asio::detail::two_arg_handler_test( \ - asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast(0), \ - static_cast(0))) == 1, \ - "SignalHandler type requirements not met") \ - \ - typedef asio::detail::handler_type_requirements< \ - sizeof( \ - asio::detail::argbyv( \ - asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - asio::detail::lvref< \ - asio_true_handler_type>()( \ - asio::detail::lvref(), \ - asio::detail::lvref()), \ - char(0))> ASIO_UNUSED_TYPEDEF - -#define ASIO_HANDSHAKE_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef ASIO_HANDLER_TYPE(handler_type, \ - void(asio::error_code)) \ - asio_true_handler_type; \ - \ - ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(asio::detail::one_arg_handler_test( \ - asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast(0))) == 1, \ - "HandshakeHandler type requirements not met") \ - \ - typedef asio::detail::handler_type_requirements< \ - sizeof( \ - asio::detail::argbyv( \ - asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - asio::detail::lvref< \ - asio_true_handler_type>()( \ - asio::detail::lvref()), \ - char(0))> ASIO_UNUSED_TYPEDEF - -#define ASIO_BUFFERED_HANDSHAKE_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef ASIO_HANDLER_TYPE(handler_type, \ - void(asio::error_code, std::size_t)) \ - asio_true_handler_type; \ - \ - ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(asio::detail::two_arg_handler_test( \ - asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast(0), \ - static_cast(0))) == 1, \ - "BufferedHandshakeHandler type requirements not met") \ - \ - typedef asio::detail::handler_type_requirements< \ - sizeof( \ - asio::detail::argbyv( \ - asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - asio::detail::lvref< \ - asio_true_handler_type>()( \ - asio::detail::lvref(), \ - asio::detail::lvref()), \ - char(0))> ASIO_UNUSED_TYPEDEF - -#define ASIO_SHUTDOWN_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef ASIO_HANDLER_TYPE(handler_type, \ - void(asio::error_code)) \ - asio_true_handler_type; \ - \ - ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(asio::detail::one_arg_handler_test( \ - asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast(0))) == 1, \ - "ShutdownHandler type requirements not met") \ - \ - typedef asio::detail::handler_type_requirements< \ - sizeof( \ - asio::detail::argbyv( \ - asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - asio::detail::lvref< \ - asio_true_handler_type>()( \ - asio::detail::lvref()), \ - char(0))> ASIO_UNUSED_TYPEDEF - -#else // !defined(ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS) - -#define ASIO_LEGACY_COMPLETION_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int ASIO_UNUSED_TYPEDEF - -#define ASIO_READ_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int ASIO_UNUSED_TYPEDEF - -#define ASIO_WRITE_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int ASIO_UNUSED_TYPEDEF - -#define ASIO_ACCEPT_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int ASIO_UNUSED_TYPEDEF - -#define ASIO_MOVE_ACCEPT_HANDLER_CHECK( \ - handler_type, handler, socket_type) \ - typedef int ASIO_UNUSED_TYPEDEF - -#define ASIO_CONNECT_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int ASIO_UNUSED_TYPEDEF - -#define ASIO_RANGE_CONNECT_HANDLER_CHECK( \ - handler_type, handler, iter_type) \ - typedef int ASIO_UNUSED_TYPEDEF - -#define ASIO_ITERATOR_CONNECT_HANDLER_CHECK( \ - handler_type, handler, iter_type) \ - typedef int ASIO_UNUSED_TYPEDEF - -#define ASIO_RESOLVE_HANDLER_CHECK( \ - handler_type, handler, iter_type) \ - typedef int ASIO_UNUSED_TYPEDEF - -#define ASIO_WAIT_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int ASIO_UNUSED_TYPEDEF - -#define ASIO_SIGNAL_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int ASIO_UNUSED_TYPEDEF - -#define ASIO_HANDSHAKE_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int ASIO_UNUSED_TYPEDEF - -#define ASIO_BUFFERED_HANDSHAKE_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int ASIO_UNUSED_TYPEDEF - -#define ASIO_SHUTDOWN_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int ASIO_UNUSED_TYPEDEF - -#endif // !defined(ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS) - -} // namespace detail -} // namespace asio - -#endif // ASIO_DETAIL_HANDLER_TYPE_REQUIREMENTS_HPP diff --git a/tools/sdk/include/asio/asio/detail/handler_work.hpp b/tools/sdk/include/asio/asio/detail/handler_work.hpp deleted file mode 100644 index cce5c4b6de2..00000000000 --- a/tools/sdk/include/asio/asio/detail/handler_work.hpp +++ /dev/null @@ -1,95 +0,0 @@ -// -// detail/handler_work.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_HANDLER_WORK_HPP -#define ASIO_DETAIL_HANDLER_WORK_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/associated_executor.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -// A helper class template to allow completion handlers to be dispatched -// through either the new executors framework or the old invocaton hook. The -// primary template uses the new executors framework. -template ::type> -class handler_work -{ -public: - explicit handler_work(Handler& handler) ASIO_NOEXCEPT - : executor_(associated_executor::get(handler)) - { - } - - static void start(Handler& handler) ASIO_NOEXCEPT - { - Executor ex(associated_executor::get(handler)); - ex.on_work_started(); - } - - ~handler_work() - { - executor_.on_work_finished(); - } - - template - void complete(Function& function, Handler& handler) - { - executor_.dispatch(ASIO_MOVE_CAST(Function)(function), - associated_allocator::get(handler)); - } - -private: - // Disallow copying and assignment. - handler_work(const handler_work&); - handler_work& operator=(const handler_work&); - - typename associated_executor::type executor_; -}; - -// This specialisation dispatches a handler through the old invocation hook. -// The specialisation is not strictly required for correctness, as the -// system_executor will dispatch through the hook anyway. However, by doing -// this we avoid an extra copy of the handler. -template -class handler_work -{ -public: - explicit handler_work(Handler&) ASIO_NOEXCEPT {} - static void start(Handler&) ASIO_NOEXCEPT {} - ~handler_work() {} - - template - void complete(Function& function, Handler& handler) - { - asio_handler_invoke_helpers::invoke(function, handler); - } - -private: - // Disallow copying and assignment. - handler_work(const handler_work&); - handler_work& operator=(const handler_work&); -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_HANDLER_WORK_HPP diff --git a/tools/sdk/include/asio/asio/detail/hash_map.hpp b/tools/sdk/include/asio/asio/detail/hash_map.hpp deleted file mode 100644 index e70970d6b14..00000000000 --- a/tools/sdk/include/asio/asio/detail/hash_map.hpp +++ /dev/null @@ -1,331 +0,0 @@ -// -// detail/hash_map.hpp -// ~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_HASH_MAP_HPP -#define ASIO_DETAIL_HASH_MAP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include -#include "asio/detail/assert.hpp" -#include "asio/detail/noncopyable.hpp" - -#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) -# include "asio/detail/socket_types.hpp" -#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -inline std::size_t calculate_hash_value(int i) -{ - return static_cast(i); -} - -inline std::size_t calculate_hash_value(void* p) -{ - return reinterpret_cast(p) - + (reinterpret_cast(p) >> 3); -} - -#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) -inline std::size_t calculate_hash_value(SOCKET s) -{ - return static_cast(s); -} -#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) - -// Note: assumes K and V are POD types. -template -class hash_map - : private noncopyable -{ -public: - // The type of a value in the map. - typedef std::pair value_type; - - // The type of a non-const iterator over the hash map. - typedef typename std::list::iterator iterator; - - // The type of a const iterator over the hash map. - typedef typename std::list::const_iterator const_iterator; - - // Constructor. - hash_map() - : size_(0), - buckets_(0), - num_buckets_(0) - { - } - - // Destructor. - ~hash_map() - { - delete[] buckets_; - } - - // Get an iterator for the beginning of the map. - iterator begin() - { - return values_.begin(); - } - - // Get an iterator for the beginning of the map. - const_iterator begin() const - { - return values_.begin(); - } - - // Get an iterator for the end of the map. - iterator end() - { - return values_.end(); - } - - // Get an iterator for the end of the map. - const_iterator end() const - { - return values_.end(); - } - - // Check whether the map is empty. - bool empty() const - { - return values_.empty(); - } - - // Find an entry in the map. - iterator find(const K& k) - { - if (num_buckets_) - { - size_t bucket = calculate_hash_value(k) % num_buckets_; - iterator it = buckets_[bucket].first; - if (it == values_.end()) - return values_.end(); - iterator end_it = buckets_[bucket].last; - ++end_it; - while (it != end_it) - { - if (it->first == k) - return it; - ++it; - } - } - return values_.end(); - } - - // Find an entry in the map. - const_iterator find(const K& k) const - { - if (num_buckets_) - { - size_t bucket = calculate_hash_value(k) % num_buckets_; - const_iterator it = buckets_[bucket].first; - if (it == values_.end()) - return it; - const_iterator end_it = buckets_[bucket].last; - ++end_it; - while (it != end_it) - { - if (it->first == k) - return it; - ++it; - } - } - return values_.end(); - } - - // Insert a new entry into the map. - std::pair insert(const value_type& v) - { - if (size_ + 1 >= num_buckets_) - rehash(hash_size(size_ + 1)); - size_t bucket = calculate_hash_value(v.first) % num_buckets_; - iterator it = buckets_[bucket].first; - if (it == values_.end()) - { - buckets_[bucket].first = buckets_[bucket].last = - values_insert(values_.end(), v); - ++size_; - return std::pair(buckets_[bucket].last, true); - } - iterator end_it = buckets_[bucket].last; - ++end_it; - while (it != end_it) - { - if (it->first == v.first) - return std::pair(it, false); - ++it; - } - buckets_[bucket].last = values_insert(end_it, v); - ++size_; - return std::pair(buckets_[bucket].last, true); - } - - // Erase an entry from the map. - void erase(iterator it) - { - ASIO_ASSERT(it != values_.end()); - ASIO_ASSERT(num_buckets_ != 0); - - size_t bucket = calculate_hash_value(it->first) % num_buckets_; - bool is_first = (it == buckets_[bucket].first); - bool is_last = (it == buckets_[bucket].last); - if (is_first && is_last) - buckets_[bucket].first = buckets_[bucket].last = values_.end(); - else if (is_first) - ++buckets_[bucket].first; - else if (is_last) - --buckets_[bucket].last; - - values_erase(it); - --size_; - } - - // Erase a key from the map. - void erase(const K& k) - { - iterator it = find(k); - if (it != values_.end()) - erase(it); - } - - // Remove all entries from the map. - void clear() - { - // Clear the values. - values_.clear(); - size_ = 0; - - // Initialise all buckets to empty. - iterator end_it = values_.end(); - for (size_t i = 0; i < num_buckets_; ++i) - buckets_[i].first = buckets_[i].last = end_it; - } - -private: - // Calculate the hash size for the specified number of elements. - static std::size_t hash_size(std::size_t num_elems) - { - static std::size_t sizes[] = - { -#if defined(ASIO_HASH_MAP_BUCKETS) - ASIO_HASH_MAP_BUCKETS -#else // ASIO_HASH_MAP_BUCKETS - 3, 13, 23, 53, 97, 193, 389, 769, 1543, 3079, 6151, 12289, 24593, - 49157, 98317, 196613, 393241, 786433, 1572869, 3145739, 6291469, - 12582917, 25165843 -#endif // ASIO_HASH_MAP_BUCKETS - }; - const std::size_t nth_size = sizeof(sizes) / sizeof(std::size_t) - 1; - for (std::size_t i = 0; i < nth_size; ++i) - if (num_elems < sizes[i]) - return sizes[i]; - return sizes[nth_size]; - } - - // Re-initialise the hash from the values already contained in the list. - void rehash(std::size_t num_buckets) - { - if (num_buckets == num_buckets_) - return; - ASIO_ASSERT(num_buckets != 0); - - iterator end_iter = values_.end(); - - // Update number of buckets and initialise all buckets to empty. - bucket_type* tmp = new bucket_type[num_buckets]; - delete[] buckets_; - buckets_ = tmp; - num_buckets_ = num_buckets; - for (std::size_t i = 0; i < num_buckets_; ++i) - buckets_[i].first = buckets_[i].last = end_iter; - - // Put all values back into the hash. - iterator iter = values_.begin(); - while (iter != end_iter) - { - std::size_t bucket = calculate_hash_value(iter->first) % num_buckets_; - if (buckets_[bucket].last == end_iter) - { - buckets_[bucket].first = buckets_[bucket].last = iter++; - } - else if (++buckets_[bucket].last == iter) - { - ++iter; - } - else - { - values_.splice(buckets_[bucket].last, values_, iter++); - --buckets_[bucket].last; - } - } - } - - // Insert an element into the values list by splicing from the spares list, - // if a spare is available, and otherwise by inserting a new element. - iterator values_insert(iterator it, const value_type& v) - { - if (spares_.empty()) - { - return values_.insert(it, v); - } - else - { - spares_.front() = v; - values_.splice(it, spares_, spares_.begin()); - return --it; - } - } - - // Erase an element from the values list by splicing it to the spares list. - void values_erase(iterator it) - { - *it = value_type(); - spares_.splice(spares_.begin(), values_, it); - } - - // The number of elements in the hash. - std::size_t size_; - - // The list of all values in the hash map. - std::list values_; - - // The list of spare nodes waiting to be recycled. Assumes that POD types only - // are stored in the hash map. - std::list spares_; - - // The type for a bucket in the hash table. - struct bucket_type - { - iterator first; - iterator last; - }; - - // The buckets in the hash. - bucket_type* buckets_; - - // The number of buckets in the hash. - std::size_t num_buckets_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_HASH_MAP_HPP diff --git a/tools/sdk/include/asio/asio/detail/impl/dev_poll_reactor.hpp b/tools/sdk/include/asio/asio/detail/impl/dev_poll_reactor.hpp deleted file mode 100644 index 4cd8aafec21..00000000000 --- a/tools/sdk/include/asio/asio/detail/impl/dev_poll_reactor.hpp +++ /dev/null @@ -1,91 +0,0 @@ -// -// detail/impl/dev_poll_reactor.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_IMPL_DEV_POLL_REACTOR_HPP -#define ASIO_DETAIL_IMPL_DEV_POLL_REACTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_DEV_POLL) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -void dev_poll_reactor::add_timer_queue(timer_queue& queue) -{ - do_add_timer_queue(queue); -} - -template -void dev_poll_reactor::remove_timer_queue(timer_queue& queue) -{ - do_remove_timer_queue(queue); -} - -template -void dev_poll_reactor::schedule_timer(timer_queue& queue, - const typename Time_Traits::time_type& time, - typename timer_queue::per_timer_data& timer, wait_op* op) -{ - asio::detail::mutex::scoped_lock lock(mutex_); - - if (shutdown_) - { - scheduler_.post_immediate_completion(op, false); - return; - } - - bool earliest = queue.enqueue_timer(time, timer, op); - scheduler_.work_started(); - if (earliest) - interrupter_.interrupt(); -} - -template -std::size_t dev_poll_reactor::cancel_timer(timer_queue& queue, - typename timer_queue::per_timer_data& timer, - std::size_t max_cancelled) -{ - asio::detail::mutex::scoped_lock lock(mutex_); - op_queue ops; - std::size_t n = queue.cancel_timer(timer, ops, max_cancelled); - lock.unlock(); - scheduler_.post_deferred_completions(ops); - return n; -} - -template -void dev_poll_reactor::move_timer(timer_queue& queue, - typename timer_queue::per_timer_data& target, - typename timer_queue::per_timer_data& source) -{ - asio::detail::mutex::scoped_lock lock(mutex_); - op_queue ops; - queue.cancel_timer(target, ops); - queue.move_timer(target, source); - lock.unlock(); - scheduler_.post_deferred_completions(ops); -} - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_DEV_POLL) - -#endif // ASIO_DETAIL_IMPL_DEV_POLL_REACTOR_HPP diff --git a/tools/sdk/include/asio/asio/detail/impl/epoll_reactor.hpp b/tools/sdk/include/asio/asio/detail/impl/epoll_reactor.hpp deleted file mode 100644 index f990059d828..00000000000 --- a/tools/sdk/include/asio/asio/detail/impl/epoll_reactor.hpp +++ /dev/null @@ -1,89 +0,0 @@ -// -// detail/impl/epoll_reactor.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_IMPL_EPOLL_REACTOR_HPP -#define ASIO_DETAIL_IMPL_EPOLL_REACTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#if defined(ASIO_HAS_EPOLL) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -void epoll_reactor::add_timer_queue(timer_queue& queue) -{ - do_add_timer_queue(queue); -} - -template -void epoll_reactor::remove_timer_queue(timer_queue& queue) -{ - do_remove_timer_queue(queue); -} - -template -void epoll_reactor::schedule_timer(timer_queue& queue, - const typename Time_Traits::time_type& time, - typename timer_queue::per_timer_data& timer, wait_op* op) -{ - mutex::scoped_lock lock(mutex_); - - if (shutdown_) - { - scheduler_.post_immediate_completion(op, false); - return; - } - - bool earliest = queue.enqueue_timer(time, timer, op); - scheduler_.work_started(); - if (earliest) - update_timeout(); -} - -template -std::size_t epoll_reactor::cancel_timer(timer_queue& queue, - typename timer_queue::per_timer_data& timer, - std::size_t max_cancelled) -{ - mutex::scoped_lock lock(mutex_); - op_queue ops; - std::size_t n = queue.cancel_timer(timer, ops, max_cancelled); - lock.unlock(); - scheduler_.post_deferred_completions(ops); - return n; -} - -template -void epoll_reactor::move_timer(timer_queue& queue, - typename timer_queue::per_timer_data& target, - typename timer_queue::per_timer_data& source) -{ - mutex::scoped_lock lock(mutex_); - op_queue ops; - queue.cancel_timer(target, ops); - queue.move_timer(target, source); - lock.unlock(); - scheduler_.post_deferred_completions(ops); -} - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_EPOLL) - -#endif // ASIO_DETAIL_IMPL_EPOLL_REACTOR_HPP diff --git a/tools/sdk/include/asio/asio/detail/impl/kqueue_reactor.hpp b/tools/sdk/include/asio/asio/detail/impl/kqueue_reactor.hpp deleted file mode 100644 index 136d1678d34..00000000000 --- a/tools/sdk/include/asio/asio/detail/impl/kqueue_reactor.hpp +++ /dev/null @@ -1,93 +0,0 @@ -// -// detail/impl/kqueue_reactor.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2005 Stefan Arentz (stefan at soze dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_IMPL_KQUEUE_REACTOR_HPP -#define ASIO_DETAIL_IMPL_KQUEUE_REACTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_KQUEUE) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -void kqueue_reactor::add_timer_queue(timer_queue& queue) -{ - do_add_timer_queue(queue); -} - -// Remove a timer queue from the reactor. -template -void kqueue_reactor::remove_timer_queue(timer_queue& queue) -{ - do_remove_timer_queue(queue); -} - -template -void kqueue_reactor::schedule_timer(timer_queue& queue, - const typename Time_Traits::time_type& time, - typename timer_queue::per_timer_data& timer, wait_op* op) -{ - mutex::scoped_lock lock(mutex_); - - if (shutdown_) - { - scheduler_.post_immediate_completion(op, false); - return; - } - - bool earliest = queue.enqueue_timer(time, timer, op); - scheduler_.work_started(); - if (earliest) - interrupt(); -} - -template -std::size_t kqueue_reactor::cancel_timer(timer_queue& queue, - typename timer_queue::per_timer_data& timer, - std::size_t max_cancelled) -{ - mutex::scoped_lock lock(mutex_); - op_queue ops; - std::size_t n = queue.cancel_timer(timer, ops, max_cancelled); - lock.unlock(); - scheduler_.post_deferred_completions(ops); - return n; -} - -template -void kqueue_reactor::move_timer(timer_queue& queue, - typename timer_queue::per_timer_data& target, - typename timer_queue::per_timer_data& source) -{ - mutex::scoped_lock lock(mutex_); - op_queue ops; - queue.cancel_timer(target, ops); - queue.move_timer(target, source); - lock.unlock(); - scheduler_.post_deferred_completions(ops); -} - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_KQUEUE) - -#endif // ASIO_DETAIL_IMPL_KQUEUE_REACTOR_HPP diff --git a/tools/sdk/include/asio/asio/detail/impl/select_reactor.hpp b/tools/sdk/include/asio/asio/detail/impl/select_reactor.hpp deleted file mode 100644 index 04a04d49f8c..00000000000 --- a/tools/sdk/include/asio/asio/detail/impl/select_reactor.hpp +++ /dev/null @@ -1,100 +0,0 @@ -// -// detail/impl/select_reactor.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_IMPL_SELECT_REACTOR_HPP -#define ASIO_DETAIL_IMPL_SELECT_REACTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_IOCP) \ - || (!defined(ASIO_HAS_DEV_POLL) \ - && !defined(ASIO_HAS_EPOLL) \ - && !defined(ASIO_HAS_KQUEUE) \ - && !defined(ASIO_WINDOWS_RUNTIME)) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -void select_reactor::add_timer_queue(timer_queue& queue) -{ - do_add_timer_queue(queue); -} - -// Remove a timer queue from the reactor. -template -void select_reactor::remove_timer_queue(timer_queue& queue) -{ - do_remove_timer_queue(queue); -} - -template -void select_reactor::schedule_timer(timer_queue& queue, - const typename Time_Traits::time_type& time, - typename timer_queue::per_timer_data& timer, wait_op* op) -{ - asio::detail::mutex::scoped_lock lock(mutex_); - - if (shutdown_) - { - scheduler_.post_immediate_completion(op, false); - return; - } - - bool earliest = queue.enqueue_timer(time, timer, op); - scheduler_.work_started(); - if (earliest) - interrupter_.interrupt(); -} - -template -std::size_t select_reactor::cancel_timer(timer_queue& queue, - typename timer_queue::per_timer_data& timer, - std::size_t max_cancelled) -{ - asio::detail::mutex::scoped_lock lock(mutex_); - op_queue ops; - std::size_t n = queue.cancel_timer(timer, ops, max_cancelled); - lock.unlock(); - scheduler_.post_deferred_completions(ops); - return n; -} - -template -void select_reactor::move_timer(timer_queue& queue, - typename timer_queue::per_timer_data& target, - typename timer_queue::per_timer_data& source) -{ - asio::detail::mutex::scoped_lock lock(mutex_); - op_queue ops; - queue.cancel_timer(target, ops); - queue.move_timer(target, source); - lock.unlock(); - scheduler_.post_deferred_completions(ops); -} - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_IOCP) - // || (!defined(ASIO_HAS_DEV_POLL) - // && !defined(ASIO_HAS_EPOLL) - // && !defined(ASIO_HAS_KQUEUE) - // && !defined(ASIO_WINDOWS_RUNTIME)) - -#endif // ASIO_DETAIL_IMPL_SELECT_REACTOR_HPP diff --git a/tools/sdk/include/asio/asio/detail/impl/service_registry.hpp b/tools/sdk/include/asio/asio/detail/impl/service_registry.hpp deleted file mode 100644 index d4db589947b..00000000000 --- a/tools/sdk/include/asio/asio/detail/impl/service_registry.hpp +++ /dev/null @@ -1,94 +0,0 @@ -// -// detail/impl/service_registry.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_IMPL_SERVICE_REGISTRY_HPP -#define ASIO_DETAIL_IMPL_SERVICE_REGISTRY_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -Service& service_registry::use_service() -{ - execution_context::service::key key; - init_key(key, 0); - factory_type factory = &service_registry::create; - return *static_cast(do_use_service(key, factory, &owner_)); -} - -template -Service& service_registry::use_service(io_context& owner) -{ - execution_context::service::key key; - init_key(key, 0); - factory_type factory = &service_registry::create; - return *static_cast(do_use_service(key, factory, &owner)); -} - -template -void service_registry::add_service(Service* new_service) -{ - execution_context::service::key key; - init_key(key, 0); - return do_add_service(key, new_service); -} - -template -bool service_registry::has_service() const -{ - execution_context::service::key key; - init_key(key, 0); - return do_has_service(key); -} - -template -inline void service_registry::init_key( - execution_context::service::key& key, ...) -{ - init_key_from_id(key, Service::id); -} - -#if !defined(ASIO_NO_TYPEID) -template -void service_registry::init_key(execution_context::service::key& key, - typename enable_if< - is_base_of::value>::type*) -{ - key.type_info_ = &typeid(typeid_wrapper); - key.id_ = 0; -} - -template -void service_registry::init_key_from_id(execution_context::service::key& key, - const service_id& /*id*/) -{ - key.type_info_ = &typeid(typeid_wrapper); - key.id_ = 0; -} -#endif // !defined(ASIO_NO_TYPEID) - -template -execution_context::service* service_registry::create(void* owner) -{ - return new Service(*static_cast(owner)); -} - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_IMPL_SERVICE_REGISTRY_HPP diff --git a/tools/sdk/include/asio/asio/detail/impl/strand_executor_service.hpp b/tools/sdk/include/asio/asio/detail/impl/strand_executor_service.hpp deleted file mode 100644 index 0e18ca05ec9..00000000000 --- a/tools/sdk/include/asio/asio/detail/impl/strand_executor_service.hpp +++ /dev/null @@ -1,179 +0,0 @@ -// -// detail/impl/strand_executor_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_IMPL_STRAND_EXECUTOR_SERVICE_HPP -#define ASIO_DETAIL_IMPL_STRAND_EXECUTOR_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/call_stack.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/recycling_allocator.hpp" -#include "asio/executor_work_guard.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class strand_executor_service::invoker -{ -public: - invoker(const implementation_type& impl, Executor& ex) - : impl_(impl), - work_(ex) - { - } - - invoker(const invoker& other) - : impl_(other.impl_), - work_(other.work_) - { - } - -#if defined(ASIO_HAS_MOVE) - invoker(invoker&& other) - : impl_(ASIO_MOVE_CAST(implementation_type)(other.impl_)), - work_(ASIO_MOVE_CAST(executor_work_guard)(other.work_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - struct on_invoker_exit - { - invoker* this_; - - ~on_invoker_exit() - { - this_->impl_->mutex_->lock(); - this_->impl_->ready_queue_.push(this_->impl_->waiting_queue_); - bool more_handlers = this_->impl_->locked_ = - !this_->impl_->ready_queue_.empty(); - this_->impl_->mutex_->unlock(); - - if (more_handlers) - { - Executor ex(this_->work_.get_executor()); - recycling_allocator allocator; - ex.post(ASIO_MOVE_CAST(invoker)(*this_), allocator); - } - } - }; - - void operator()() - { - // Indicate that this strand is executing on the current thread. - call_stack::context ctx(impl_.get()); - - // Ensure the next handler, if any, is scheduled on block exit. - on_invoker_exit on_exit = { this }; - (void)on_exit; - - // Run all ready handlers. No lock is required since the ready queue is - // accessed only within the strand. - asio::error_code ec; - while (scheduler_operation* o = impl_->ready_queue_.front()) - { - impl_->ready_queue_.pop(); - o->complete(impl_.get(), ec, 0); - } - } - -private: - implementation_type impl_; - executor_work_guard work_; -}; - -template -void strand_executor_service::dispatch(const implementation_type& impl, - Executor& ex, ASIO_MOVE_ARG(Function) function, const Allocator& a) -{ - typedef typename decay::type function_type; - - // If we are already in the strand then the function can run immediately. - if (call_stack::contains(impl.get())) - { - // Make a local, non-const copy of the function. - function_type tmp(ASIO_MOVE_CAST(Function)(function)); - - fenced_block b(fenced_block::full); - asio_handler_invoke_helpers::invoke(tmp, tmp); - return; - } - - // Allocate and construct an operation to wrap the function. - typedef executor_op op; - typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 }; - p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(function), a); - - ASIO_HANDLER_CREATION((impl->service_->context(), *p.p, - "strand_executor", impl.get(), 0, "dispatch")); - - // Add the function to the strand and schedule the strand if required. - bool first = enqueue(impl, p.p); - p.v = p.p = 0; - if (first) - ex.dispatch(invoker(impl, ex), a); -} - -// Request invocation of the given function and return immediately. -template -void strand_executor_service::post(const implementation_type& impl, - Executor& ex, ASIO_MOVE_ARG(Function) function, const Allocator& a) -{ - typedef typename decay::type function_type; - - // Allocate and construct an operation to wrap the function. - typedef executor_op op; - typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 }; - p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(function), a); - - ASIO_HANDLER_CREATION((impl->service_->context(), *p.p, - "strand_executor", impl.get(), 0, "post")); - - // Add the function to the strand and schedule the strand if required. - bool first = enqueue(impl, p.p); - p.v = p.p = 0; - if (first) - ex.post(invoker(impl, ex), a); -} - -// Request invocation of the given function and return immediately. -template -void strand_executor_service::defer(const implementation_type& impl, - Executor& ex, ASIO_MOVE_ARG(Function) function, const Allocator& a) -{ - typedef typename decay::type function_type; - - // Allocate and construct an operation to wrap the function. - typedef executor_op op; - typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 }; - p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(function), a); - - ASIO_HANDLER_CREATION((impl->service_->context(), *p.p, - "strand_executor", impl.get(), 0, "defer")); - - // Add the function to the strand and schedule the strand if required. - bool first = enqueue(impl, p.p); - p.v = p.p = 0; - if (first) - ex.defer(invoker(impl, ex), a); -} - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_IMPL_STRAND_EXECUTOR_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/detail/impl/strand_service.hpp b/tools/sdk/include/asio/asio/detail/impl/strand_service.hpp deleted file mode 100644 index da5b716946f..00000000000 --- a/tools/sdk/include/asio/asio/detail/impl/strand_service.hpp +++ /dev/null @@ -1,118 +0,0 @@ -// -// detail/impl/strand_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_IMPL_STRAND_SERVICE_HPP -#define ASIO_DETAIL_IMPL_STRAND_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/call_stack.hpp" -#include "asio/detail/completion_handler.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/memory.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -inline strand_service::strand_impl::strand_impl() - : operation(&strand_service::do_complete), - locked_(false) -{ -} - -struct strand_service::on_dispatch_exit -{ - io_context_impl* io_context_; - strand_impl* impl_; - - ~on_dispatch_exit() - { - impl_->mutex_.lock(); - impl_->ready_queue_.push(impl_->waiting_queue_); - bool more_handlers = impl_->locked_ = !impl_->ready_queue_.empty(); - impl_->mutex_.unlock(); - - if (more_handlers) - io_context_->post_immediate_completion(impl_, false); - } -}; - -template -void strand_service::dispatch(strand_service::implementation_type& impl, - Handler& handler) -{ - // If we are already in the strand then the handler can run immediately. - if (call_stack::contains(impl)) - { - fenced_block b(fenced_block::full); - asio_handler_invoke_helpers::invoke(handler, handler); - return; - } - - // Allocate and construct an operation to wrap the handler. - typedef completion_handler op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(handler); - - ASIO_HANDLER_CREATION((this->context(), - *p.p, "strand", impl, 0, "dispatch")); - - bool dispatch_immediately = do_dispatch(impl, p.p); - operation* o = p.p; - p.v = p.p = 0; - - if (dispatch_immediately) - { - // Indicate that this strand is executing on the current thread. - call_stack::context ctx(impl); - - // Ensure the next handler, if any, is scheduled on block exit. - on_dispatch_exit on_exit = { &io_context_, impl }; - (void)on_exit; - - completion_handler::do_complete( - &io_context_, o, asio::error_code(), 0); - } -} - -// Request the io_context to invoke the given handler and return immediately. -template -void strand_service::post(strand_service::implementation_type& impl, - Handler& handler) -{ - bool is_continuation = - asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef completion_handler op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(handler); - - ASIO_HANDLER_CREATION((this->context(), - *p.p, "strand", impl, 0, "post")); - - do_post(impl, p.p, is_continuation); - p.v = p.p = 0; -} - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_IMPL_STRAND_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/detail/impl/win_iocp_io_context.hpp b/tools/sdk/include/asio/asio/detail/impl/win_iocp_io_context.hpp deleted file mode 100644 index 44887d7c219..00000000000 --- a/tools/sdk/include/asio/asio/detail/impl/win_iocp_io_context.hpp +++ /dev/null @@ -1,103 +0,0 @@ -// -// detail/impl/win_iocp_io_context.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_IMPL_WIN_IOCP_IO_CONTEXT_HPP -#define ASIO_DETAIL_IMPL_WIN_IOCP_IO_CONTEXT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_IOCP) - -#include "asio/detail/completion_handler.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/memory.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -void win_iocp_io_context::add_timer_queue( - timer_queue& queue) -{ - do_add_timer_queue(queue); -} - -template -void win_iocp_io_context::remove_timer_queue( - timer_queue& queue) -{ - do_remove_timer_queue(queue); -} - -template -void win_iocp_io_context::schedule_timer(timer_queue& queue, - const typename Time_Traits::time_type& time, - typename timer_queue::per_timer_data& timer, wait_op* op) -{ - // If the service has been shut down we silently discard the timer. - if (::InterlockedExchangeAdd(&shutdown_, 0) != 0) - { - post_immediate_completion(op, false); - return; - } - - mutex::scoped_lock lock(dispatch_mutex_); - - bool earliest = queue.enqueue_timer(time, timer, op); - work_started(); - if (earliest) - update_timeout(); -} - -template -std::size_t win_iocp_io_context::cancel_timer(timer_queue& queue, - typename timer_queue::per_timer_data& timer, - std::size_t max_cancelled) -{ - // If the service has been shut down we silently ignore the cancellation. - if (::InterlockedExchangeAdd(&shutdown_, 0) != 0) - return 0; - - mutex::scoped_lock lock(dispatch_mutex_); - op_queue ops; - std::size_t n = queue.cancel_timer(timer, ops, max_cancelled); - post_deferred_completions(ops); - return n; -} - -template -void win_iocp_io_context::move_timer(timer_queue& queue, - typename timer_queue::per_timer_data& to, - typename timer_queue::per_timer_data& from) -{ - asio::detail::mutex::scoped_lock lock(dispatch_mutex_); - op_queue ops; - queue.cancel_timer(to, ops); - queue.move_timer(to, from); - lock.unlock(); - post_deferred_completions(ops); -} - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_IOCP) - -#endif // ASIO_DETAIL_IMPL_WIN_IOCP_IO_CONTEXT_HPP diff --git a/tools/sdk/include/asio/asio/detail/impl/winrt_timer_scheduler.hpp b/tools/sdk/include/asio/asio/detail/impl/winrt_timer_scheduler.hpp deleted file mode 100644 index 856378feb09..00000000000 --- a/tools/sdk/include/asio/asio/detail/impl/winrt_timer_scheduler.hpp +++ /dev/null @@ -1,92 +0,0 @@ -// -// detail/impl/winrt_timer_scheduler.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_IMPL_WINRT_TIMER_SCHEDULER_HPP -#define ASIO_DETAIL_IMPL_WINRT_TIMER_SCHEDULER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_WINDOWS_RUNTIME) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -void winrt_timer_scheduler::add_timer_queue(timer_queue& queue) -{ - do_add_timer_queue(queue); -} - -// Remove a timer queue from the reactor. -template -void winrt_timer_scheduler::remove_timer_queue(timer_queue& queue) -{ - do_remove_timer_queue(queue); -} - -template -void winrt_timer_scheduler::schedule_timer(timer_queue& queue, - const typename Time_Traits::time_type& time, - typename timer_queue::per_timer_data& timer, wait_op* op) -{ - asio::detail::mutex::scoped_lock lock(mutex_); - - if (shutdown_) - { - io_context_.post_immediate_completion(op, false); - return; - } - - bool earliest = queue.enqueue_timer(time, timer, op); - io_context_.work_started(); - if (earliest) - event_.signal(lock); -} - -template -std::size_t winrt_timer_scheduler::cancel_timer(timer_queue& queue, - typename timer_queue::per_timer_data& timer, - std::size_t max_cancelled) -{ - asio::detail::mutex::scoped_lock lock(mutex_); - op_queue ops; - std::size_t n = queue.cancel_timer(timer, ops, max_cancelled); - lock.unlock(); - io_context_.post_deferred_completions(ops); - return n; -} - -template -void winrt_timer_scheduler::move_timer(timer_queue& queue, - typename timer_queue::per_timer_data& to, - typename timer_queue::per_timer_data& from) -{ - asio::detail::mutex::scoped_lock lock(mutex_); - op_queue ops; - queue.cancel_timer(to, ops); - queue.move_timer(to, from); - lock.unlock(); - scheduler_.post_deferred_completions(ops); -} - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_WINDOWS_RUNTIME) - -#endif // ASIO_DETAIL_IMPL_WINRT_TIMER_SCHEDULER_HPP diff --git a/tools/sdk/include/asio/asio/detail/io_control.hpp b/tools/sdk/include/asio/asio/detail/io_control.hpp deleted file mode 100644 index 12f35e096fb..00000000000 --- a/tools/sdk/include/asio/asio/detail/io_control.hpp +++ /dev/null @@ -1,84 +0,0 @@ -// -// detail/io_control.hpp -// ~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_IO_CONTROL_HPP -#define ASIO_DETAIL_IO_CONTROL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/detail/socket_types.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { -namespace io_control { - -// I/O control command for getting number of bytes available. -class bytes_readable -{ -public: - // Default constructor. - bytes_readable() - : value_(0) - { - } - - // Construct with a specific command value. - bytes_readable(std::size_t value) - : value_(static_cast(value)) - { - } - - // Get the name of the IO control command. - int name() const - { - return static_cast(ASIO_OS_DEF(FIONREAD)); - } - - // Set the value of the I/O control command. - void set(std::size_t value) - { - value_ = static_cast(value); - } - - // Get the current value of the I/O control command. - std::size_t get() const - { - return static_cast(value_); - } - - // Get the address of the command data. - detail::ioctl_arg_type* data() - { - return &value_; - } - - // Get the address of the command data. - const detail::ioctl_arg_type* data() const - { - return &value_; - } - -private: - detail::ioctl_arg_type value_; -}; - -} // namespace io_control -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_IO_CONTROL_HPP diff --git a/tools/sdk/include/asio/asio/detail/is_buffer_sequence.hpp b/tools/sdk/include/asio/asio/detail/is_buffer_sequence.hpp deleted file mode 100644 index 42ad0ebe1a2..00000000000 --- a/tools/sdk/include/asio/asio/detail/is_buffer_sequence.hpp +++ /dev/null @@ -1,239 +0,0 @@ -// -// detail/is_buffer_sequence.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_IS_BUFFER_SEQUENCE_HPP -#define ASIO_DETAIL_IS_BUFFER_SEQUENCE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/type_traits.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -class mutable_buffer; -class const_buffer; - -namespace detail { - -struct buffer_sequence_memfns_base -{ - void begin(); - void end(); - void size(); - void max_size(); - void capacity(); - void data(); - void prepare(); - void commit(); - void consume(); -}; - -template -struct buffer_sequence_memfns_derived - : T, buffer_sequence_memfns_base -{ -}; - -template -struct buffer_sequence_memfns_check -{ -}; - -template -char (&begin_memfn_helper(...))[2]; - -template -char begin_memfn_helper( - buffer_sequence_memfns_check< - void (buffer_sequence_memfns_base::*)(), - &buffer_sequence_memfns_derived::begin>*); - -template -char (&end_memfn_helper(...))[2]; - -template -char end_memfn_helper( - buffer_sequence_memfns_check< - void (buffer_sequence_memfns_base::*)(), - &buffer_sequence_memfns_derived::end>*); - -template -char (&size_memfn_helper(...))[2]; - -template -char size_memfn_helper( - buffer_sequence_memfns_check< - void (buffer_sequence_memfns_base::*)(), - &buffer_sequence_memfns_derived::size>*); - -template -char (&max_size_memfn_helper(...))[2]; - -template -char max_size_memfn_helper( - buffer_sequence_memfns_check< - void (buffer_sequence_memfns_base::*)(), - &buffer_sequence_memfns_derived::max_size>*); - -template -char (&capacity_memfn_helper(...))[2]; - -template -char capacity_memfn_helper( - buffer_sequence_memfns_check< - void (buffer_sequence_memfns_base::*)(), - &buffer_sequence_memfns_derived::capacity>*); - -template -char (&data_memfn_helper(...))[2]; - -template -char data_memfn_helper( - buffer_sequence_memfns_check< - void (buffer_sequence_memfns_base::*)(), - &buffer_sequence_memfns_derived::data>*); - -template -char (&prepare_memfn_helper(...))[2]; - -template -char prepare_memfn_helper( - buffer_sequence_memfns_check< - void (buffer_sequence_memfns_base::*)(), - &buffer_sequence_memfns_derived::prepare>*); - -template -char (&commit_memfn_helper(...))[2]; - -template -char commit_memfn_helper( - buffer_sequence_memfns_check< - void (buffer_sequence_memfns_base::*)(), - &buffer_sequence_memfns_derived::commit>*); - -template -char (&consume_memfn_helper(...))[2]; - -template -char consume_memfn_helper( - buffer_sequence_memfns_check< - void (buffer_sequence_memfns_base::*)(), - &buffer_sequence_memfns_derived::consume>*); - -template -char (&buffer_element_type_helper(...))[2]; - -#if defined(ASIO_HAS_DECL_TYPE) - -template -char buffer_element_type_helper(T* t, - typename enable_if::value>::type*); - -#else // defined(ASIO_HAS_DECL_TYPE) - -template -char buffer_element_type_helper( - typename T::const_iterator*, - typename enable_if::value>::type*); - -#endif // defined(ASIO_HAS_DECL_TYPE) - -template -char (&const_buffers_type_typedef_helper(...))[2]; - -template -char const_buffers_type_typedef_helper( - typename T::const_buffers_type*); - -template -char (&mutable_buffers_type_typedef_helper(...))[2]; - -template -char mutable_buffers_type_typedef_helper( - typename T::mutable_buffers_type*); - -template -struct is_buffer_sequence_class - : integral_constant(0)) != 1 && - sizeof(end_memfn_helper(0)) != 1 && - sizeof(buffer_element_type_helper(0, 0)) == 1> -{ -}; - -template -struct is_buffer_sequence - : conditional::value, - is_buffer_sequence_class, - false_type>::type -{ -}; - -template <> -struct is_buffer_sequence - : true_type -{ -}; - -template <> -struct is_buffer_sequence - : true_type -{ -}; - -template <> -struct is_buffer_sequence - : true_type -{ -}; - -template <> -struct is_buffer_sequence - : false_type -{ -}; - -template -struct is_dynamic_buffer_class - : integral_constant(0)) != 1 && - sizeof(max_size_memfn_helper(0)) != 1 && - sizeof(capacity_memfn_helper(0)) != 1 && - sizeof(data_memfn_helper(0)) != 1 && - sizeof(consume_memfn_helper(0)) != 1 && - sizeof(prepare_memfn_helper(0)) != 1 && - sizeof(commit_memfn_helper(0)) != 1 && - sizeof(const_buffers_type_typedef_helper(0)) == 1 && - sizeof(mutable_buffers_type_typedef_helper(0)) == 1> -{ -}; - -template -struct is_dynamic_buffer - : conditional::value, - is_dynamic_buffer_class, - false_type>::type -{ -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_IS_BUFFER_SEQUENCE_HPP diff --git a/tools/sdk/include/asio/asio/detail/is_executor.hpp b/tools/sdk/include/asio/asio/detail/is_executor.hpp deleted file mode 100644 index 4584dd04bf6..00000000000 --- a/tools/sdk/include/asio/asio/detail/is_executor.hpp +++ /dev/null @@ -1,126 +0,0 @@ -// -// detail/is_executor.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_IS_EXECUTOR_HPP -#define ASIO_DETAIL_IS_EXECUTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/type_traits.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -struct executor_memfns_base -{ - void context(); - void on_work_started(); - void on_work_finished(); - void dispatch(); - void post(); - void defer(); -}; - -template -struct executor_memfns_derived - : T, executor_memfns_base -{ -}; - -template -struct executor_memfns_check -{ -}; - -template -char (&context_memfn_helper(...))[2]; - -template -char context_memfn_helper( - executor_memfns_check< - void (executor_memfns_base::*)(), - &executor_memfns_derived::context>*); - -template -char (&on_work_started_memfn_helper(...))[2]; - -template -char on_work_started_memfn_helper( - executor_memfns_check< - void (executor_memfns_base::*)(), - &executor_memfns_derived::on_work_started>*); - -template -char (&on_work_finished_memfn_helper(...))[2]; - -template -char on_work_finished_memfn_helper( - executor_memfns_check< - void (executor_memfns_base::*)(), - &executor_memfns_derived::on_work_finished>*); - -template -char (&dispatch_memfn_helper(...))[2]; - -template -char dispatch_memfn_helper( - executor_memfns_check< - void (executor_memfns_base::*)(), - &executor_memfns_derived::dispatch>*); - -template -char (&post_memfn_helper(...))[2]; - -template -char post_memfn_helper( - executor_memfns_check< - void (executor_memfns_base::*)(), - &executor_memfns_derived::post>*); - -template -char (&defer_memfn_helper(...))[2]; - -template -char defer_memfn_helper( - executor_memfns_check< - void (executor_memfns_base::*)(), - &executor_memfns_derived::defer>*); - -template -struct is_executor_class - : integral_constant(0)) != 1 && - sizeof(on_work_started_memfn_helper(0)) != 1 && - sizeof(on_work_finished_memfn_helper(0)) != 1 && - sizeof(dispatch_memfn_helper(0)) != 1 && - sizeof(post_memfn_helper(0)) != 1 && - sizeof(defer_memfn_helper(0)) != 1> -{ -}; - -template -struct is_executor - : conditional::value, - is_executor_class, - false_type>::type -{ -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_IS_EXECUTOR_HPP diff --git a/tools/sdk/include/asio/asio/detail/keyword_tss_ptr.hpp b/tools/sdk/include/asio/asio/detail/keyword_tss_ptr.hpp deleted file mode 100644 index 2ae651ab282..00000000000 --- a/tools/sdk/include/asio/asio/detail/keyword_tss_ptr.hpp +++ /dev/null @@ -1,70 +0,0 @@ -// -// detail/keyword_tss_ptr.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_KEYWORD_TSS_PTR_HPP -#define ASIO_DETAIL_KEYWORD_TSS_PTR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_THREAD_KEYWORD_EXTENSION) - -#include "asio/detail/noncopyable.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class keyword_tss_ptr - : private noncopyable -{ -public: - // Constructor. - keyword_tss_ptr() - { - } - - // Destructor. - ~keyword_tss_ptr() - { - } - - // Get the value. - operator T*() const - { - return value_; - } - - // Set the value. - void operator=(T* value) - { - value_ = value; - } - -private: - static ASIO_THREAD_KEYWORD T* value_; -}; - -template -ASIO_THREAD_KEYWORD T* keyword_tss_ptr::value_; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_THREAD_KEYWORD_EXTENSION) - -#endif // ASIO_DETAIL_KEYWORD_TSS_PTR_HPP diff --git a/tools/sdk/include/asio/asio/detail/kqueue_reactor.hpp b/tools/sdk/include/asio/asio/detail/kqueue_reactor.hpp deleted file mode 100644 index 43cb9f9351c..00000000000 --- a/tools/sdk/include/asio/asio/detail/kqueue_reactor.hpp +++ /dev/null @@ -1,242 +0,0 @@ -// -// detail/kqueue_reactor.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2005 Stefan Arentz (stefan at soze dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_KQUEUE_REACTOR_HPP -#define ASIO_DETAIL_KQUEUE_REACTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_KQUEUE) - -#include -#include -#include -#include -#include "asio/detail/limits.hpp" -#include "asio/detail/mutex.hpp" -#include "asio/detail/object_pool.hpp" -#include "asio/detail/op_queue.hpp" -#include "asio/detail/reactor_op.hpp" -#include "asio/detail/select_interrupter.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/detail/timer_queue_base.hpp" -#include "asio/detail/timer_queue_set.hpp" -#include "asio/detail/wait_op.hpp" -#include "asio/error.hpp" -#include "asio/execution_context.hpp" - -// Older versions of Mac OS X may not define EV_OOBAND. -#if !defined(EV_OOBAND) -# define EV_OOBAND EV_FLAG1 -#endif // !defined(EV_OOBAND) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class scheduler; - -class kqueue_reactor - : public execution_context_service_base -{ -private: - // The mutex type used by this reactor. - typedef conditionally_enabled_mutex mutex; - -public: - enum op_types { read_op = 0, write_op = 1, - connect_op = 1, except_op = 2, max_ops = 3 }; - - // Per-descriptor queues. - struct descriptor_state - { - descriptor_state(bool locking) : mutex_(locking) {} - - friend class kqueue_reactor; - friend class object_pool_access; - - descriptor_state* next_; - descriptor_state* prev_; - - mutex mutex_; - int descriptor_; - int num_kevents_; // 1 == read only, 2 == read and write - op_queue op_queue_[max_ops]; - bool shutdown_; - }; - - // Per-descriptor data. - typedef descriptor_state* per_descriptor_data; - - // Constructor. - ASIO_DECL kqueue_reactor(asio::execution_context& ctx); - - // Destructor. - ASIO_DECL ~kqueue_reactor(); - - // Destroy all user-defined handler objects owned by the service. - ASIO_DECL void shutdown(); - - // Recreate internal descriptors following a fork. - ASIO_DECL void notify_fork( - asio::execution_context::fork_event fork_ev); - - // Initialise the task. - ASIO_DECL void init_task(); - - // Register a socket with the reactor. Returns 0 on success, system error - // code on failure. - ASIO_DECL int register_descriptor(socket_type descriptor, - per_descriptor_data& descriptor_data); - - // Register a descriptor with an associated single operation. Returns 0 on - // success, system error code on failure. - ASIO_DECL int register_internal_descriptor( - int op_type, socket_type descriptor, - per_descriptor_data& descriptor_data, reactor_op* op); - - // Move descriptor registration from one descriptor_data object to another. - ASIO_DECL void move_descriptor(socket_type descriptor, - per_descriptor_data& target_descriptor_data, - per_descriptor_data& source_descriptor_data); - - // Post a reactor operation for immediate completion. - void post_immediate_completion(reactor_op* op, bool is_continuation) - { - scheduler_.post_immediate_completion(op, is_continuation); - } - - // Start a new operation. The reactor operation will be performed when the - // given descriptor is flagged as ready, or an error has occurred. - ASIO_DECL void start_op(int op_type, socket_type descriptor, - per_descriptor_data& descriptor_data, reactor_op* op, - bool is_continuation, bool allow_speculative); - - // Cancel all operations associated with the given descriptor. The - // handlers associated with the descriptor will be invoked with the - // operation_aborted error. - ASIO_DECL void cancel_ops(socket_type descriptor, - per_descriptor_data& descriptor_data); - - // Cancel any operations that are running against the descriptor and remove - // its registration from the reactor. The reactor resources associated with - // the descriptor must be released by calling cleanup_descriptor_data. - ASIO_DECL void deregister_descriptor(socket_type descriptor, - per_descriptor_data& descriptor_data, bool closing); - - // Remove the descriptor's registration from the reactor. The reactor - // resources associated with the descriptor must be released by calling - // cleanup_descriptor_data. - ASIO_DECL void deregister_internal_descriptor( - socket_type descriptor, per_descriptor_data& descriptor_data); - - // Perform any post-deregistration cleanup tasks associated with the - // descriptor data. - ASIO_DECL void cleanup_descriptor_data( - per_descriptor_data& descriptor_data); - - // Add a new timer queue to the reactor. - template - void add_timer_queue(timer_queue& queue); - - // Remove a timer queue from the reactor. - template - void remove_timer_queue(timer_queue& queue); - - // Schedule a new operation in the given timer queue to expire at the - // specified absolute time. - template - void schedule_timer(timer_queue& queue, - const typename Time_Traits::time_type& time, - typename timer_queue::per_timer_data& timer, wait_op* op); - - // Cancel the timer operations associated with the given token. Returns the - // number of operations that have been posted or dispatched. - template - std::size_t cancel_timer(timer_queue& queue, - typename timer_queue::per_timer_data& timer, - std::size_t max_cancelled = (std::numeric_limits::max)()); - - // Move the timer operations associated with the given timer. - template - void move_timer(timer_queue& queue, - typename timer_queue::per_timer_data& target, - typename timer_queue::per_timer_data& source); - - // Run the kqueue loop. - ASIO_DECL void run(long usec, op_queue& ops); - - // Interrupt the kqueue loop. - ASIO_DECL void interrupt(); - -private: - // Create the kqueue file descriptor. Throws an exception if the descriptor - // cannot be created. - ASIO_DECL static int do_kqueue_create(); - - // Allocate a new descriptor state object. - ASIO_DECL descriptor_state* allocate_descriptor_state(); - - // Free an existing descriptor state object. - ASIO_DECL void free_descriptor_state(descriptor_state* s); - - // Helper function to add a new timer queue. - ASIO_DECL void do_add_timer_queue(timer_queue_base& queue); - - // Helper function to remove a timer queue. - ASIO_DECL void do_remove_timer_queue(timer_queue_base& queue); - - // Get the timeout value for the kevent call. - ASIO_DECL timespec* get_timeout(long usec, timespec& ts); - - // The scheduler used to post completions. - scheduler& scheduler_; - - // Mutex to protect access to internal data. - mutex mutex_; - - // The kqueue file descriptor. - int kqueue_fd_; - - // The interrupter is used to break a blocking kevent call. - select_interrupter interrupter_; - - // The timer queues. - timer_queue_set timer_queues_; - - // Whether the service has been shut down. - bool shutdown_; - - // Mutex to protect access to the registered descriptors. - mutex registered_descriptors_mutex_; - - // Keep track of all registered descriptors. - object_pool registered_descriptors_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/detail/impl/kqueue_reactor.hpp" -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/kqueue_reactor.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_HAS_KQUEUE) - -#endif // ASIO_DETAIL_KQUEUE_REACTOR_HPP diff --git a/tools/sdk/include/asio/asio/detail/limits.hpp b/tools/sdk/include/asio/asio/detail/limits.hpp deleted file mode 100644 index d32470d2d35..00000000000 --- a/tools/sdk/include/asio/asio/detail/limits.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// -// detail/limits.hpp -// ~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_LIMITS_HPP -#define ASIO_DETAIL_LIMITS_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_BOOST_LIMITS) -# include -#else // defined(ASIO_HAS_BOOST_LIMITS) -# include -#endif // defined(ASIO_HAS_BOOST_LIMITS) - -#endif // ASIO_DETAIL_LIMITS_HPP diff --git a/tools/sdk/include/asio/asio/detail/local_free_on_block_exit.hpp b/tools/sdk/include/asio/asio/detail/local_free_on_block_exit.hpp deleted file mode 100644 index eba6b7771d0..00000000000 --- a/tools/sdk/include/asio/asio/detail/local_free_on_block_exit.hpp +++ /dev/null @@ -1,59 +0,0 @@ -// -// detail/local_free_on_block_exit.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_LOCAL_FREE_ON_BLOCK_EXIT_HPP -#define ASIO_DETAIL_LOCAL_FREE_ON_BLOCK_EXIT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) -#if !defined(ASIO_WINDOWS_APP) - -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/socket_types.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class local_free_on_block_exit - : private noncopyable -{ -public: - // Constructor blocks all signals for the calling thread. - explicit local_free_on_block_exit(void* p) - : p_(p) - { - } - - // Destructor restores the previous signal mask. - ~local_free_on_block_exit() - { - ::LocalFree(p_); - } - -private: - void* p_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // !defined(ASIO_WINDOWS_APP) -#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) - -#endif // ASIO_DETAIL_LOCAL_FREE_ON_BLOCK_EXIT_HPP diff --git a/tools/sdk/include/asio/asio/detail/macos_fenced_block.hpp b/tools/sdk/include/asio/asio/detail/macos_fenced_block.hpp deleted file mode 100644 index bbac270a46c..00000000000 --- a/tools/sdk/include/asio/asio/detail/macos_fenced_block.hpp +++ /dev/null @@ -1,62 +0,0 @@ -// -// detail/macos_fenced_block.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_MACOS_FENCED_BLOCK_HPP -#define ASIO_DETAIL_MACOS_FENCED_BLOCK_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(__MACH__) && defined(__APPLE__) - -#include -#include "asio/detail/noncopyable.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class macos_fenced_block - : private noncopyable -{ -public: - enum half_t { half }; - enum full_t { full }; - - // Constructor for a half fenced block. - explicit macos_fenced_block(half_t) - { - } - - // Constructor for a full fenced block. - explicit macos_fenced_block(full_t) - { - OSMemoryBarrier(); - } - - // Destructor. - ~macos_fenced_block() - { - OSMemoryBarrier(); - } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(__MACH__) && defined(__APPLE__) - -#endif // ASIO_DETAIL_MACOS_FENCED_BLOCK_HPP diff --git a/tools/sdk/include/asio/asio/detail/memory.hpp b/tools/sdk/include/asio/asio/detail/memory.hpp deleted file mode 100644 index b1ec4975faf..00000000000 --- a/tools/sdk/include/asio/asio/detail/memory.hpp +++ /dev/null @@ -1,70 +0,0 @@ -// -// detail/memory.hpp -// ~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_MEMORY_HPP -#define ASIO_DETAIL_MEMORY_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include - -#if !defined(ASIO_HAS_STD_SHARED_PTR) -# include -# include -#endif // !defined(ASIO_HAS_STD_SHARED_PTR) - -#if !defined(ASIO_HAS_STD_ADDRESSOF) -# include -#endif // !defined(ASIO_HAS_STD_ADDRESSOF) - -namespace asio { -namespace detail { - -#if defined(ASIO_HAS_STD_SHARED_PTR) -using std::shared_ptr; -using std::weak_ptr; -#else // defined(ASIO_HAS_STD_SHARED_PTR) -using boost::shared_ptr; -using boost::weak_ptr; -#endif // defined(ASIO_HAS_STD_SHARED_PTR) - -#if defined(ASIO_HAS_STD_ADDRESSOF) -using std::addressof; -#else // defined(ASIO_HAS_STD_ADDRESSOF) -using boost::addressof; -#endif // defined(ASIO_HAS_STD_ADDRESSOF) - -} // namespace detail - -#if defined(ASIO_HAS_CXX11_ALLOCATORS) -using std::allocator_arg_t; -# define ASIO_USES_ALLOCATOR(t) \ - namespace std { \ - template \ - struct uses_allocator : true_type {}; \ - } \ - /**/ -# define ASIO_REBIND_ALLOC(alloc, t) \ - typename std::allocator_traits::template rebind_alloc - /**/ -#else // defined(ASIO_HAS_CXX11_ALLOCATORS) -struct allocator_arg_t {}; -# define ASIO_USES_ALLOCATOR(t) -# define ASIO_REBIND_ALLOC(alloc, t) \ - typename alloc::template rebind::other - /**/ -#endif // defined(ASIO_HAS_CXX11_ALLOCATORS) - -} // namespace asio - -#endif // ASIO_DETAIL_MEMORY_HPP diff --git a/tools/sdk/include/asio/asio/detail/mutex.hpp b/tools/sdk/include/asio/asio/detail/mutex.hpp deleted file mode 100644 index 2f8f0b1329b..00000000000 --- a/tools/sdk/include/asio/asio/detail/mutex.hpp +++ /dev/null @@ -1,48 +0,0 @@ -// -// detail/mutex.hpp -// ~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_MUTEX_HPP -#define ASIO_DETAIL_MUTEX_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_HAS_THREADS) -# include "asio/detail/null_mutex.hpp" -#elif defined(ASIO_WINDOWS) -# include "asio/detail/win_mutex.hpp" -#elif defined(ASIO_HAS_PTHREADS) -# include "asio/detail/posix_mutex.hpp" -#elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) -# include "asio/detail/std_mutex.hpp" -#else -# error Only Windows, POSIX and std::mutex are supported! -#endif - -namespace asio { -namespace detail { - -#if !defined(ASIO_HAS_THREADS) -typedef null_mutex mutex; -#elif defined(ASIO_WINDOWS) -typedef win_mutex mutex; -#elif defined(ASIO_HAS_PTHREADS) -typedef posix_mutex mutex; -#elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) -typedef std_mutex mutex; -#endif - -} // namespace detail -} // namespace asio - -#endif // ASIO_DETAIL_MUTEX_HPP diff --git a/tools/sdk/include/asio/asio/detail/noncopyable.hpp b/tools/sdk/include/asio/asio/detail/noncopyable.hpp deleted file mode 100644 index 0c038e11ed0..00000000000 --- a/tools/sdk/include/asio/asio/detail/noncopyable.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// -// detail/noncopyable.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_NONCOPYABLE_HPP -#define ASIO_DETAIL_NONCOPYABLE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class noncopyable -{ -protected: - noncopyable() {} - ~noncopyable() {} -private: - noncopyable(const noncopyable&); - const noncopyable& operator=(const noncopyable&); -}; - -} // namespace detail - -using asio::detail::noncopyable; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_NONCOPYABLE_HPP diff --git a/tools/sdk/include/asio/asio/detail/null_event.hpp b/tools/sdk/include/asio/asio/detail/null_event.hpp deleted file mode 100644 index 5686a41e74a..00000000000 --- a/tools/sdk/include/asio/asio/detail/null_event.hpp +++ /dev/null @@ -1,100 +0,0 @@ -// -// detail/null_event.hpp -// ~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_NULL_EVENT_HPP -#define ASIO_DETAIL_NULL_EVENT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/noncopyable.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class null_event - : private noncopyable -{ -public: - // Constructor. - null_event() - { - } - - // Destructor. - ~null_event() - { - } - - // Signal the event. (Retained for backward compatibility.) - template - void signal(Lock&) - { - } - - // Signal all waiters. - template - void signal_all(Lock&) - { - } - - // Unlock the mutex and signal one waiter. - template - void unlock_and_signal_one(Lock&) - { - } - - // If there's a waiter, unlock the mutex and signal it. - template - bool maybe_unlock_and_signal_one(Lock&) - { - return false; - } - - // Reset the event. - template - void clear(Lock&) - { - } - - // Wait for the event to become signalled. - template - void wait(Lock&) - { - do_wait(); - } - - // Timed wait for the event to become signalled. - template - bool wait_for_usec(Lock&, long usec) - { - do_wait_for_usec(usec); - return true; - } - -private: - ASIO_DECL static void do_wait(); - ASIO_DECL static void do_wait_for_usec(long usec); -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/null_event.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_DETAIL_NULL_EVENT_HPP diff --git a/tools/sdk/include/asio/asio/detail/null_fenced_block.hpp b/tools/sdk/include/asio/asio/detail/null_fenced_block.hpp deleted file mode 100644 index 0275326b177..00000000000 --- a/tools/sdk/include/asio/asio/detail/null_fenced_block.hpp +++ /dev/null @@ -1,47 +0,0 @@ -// -// detail/null_fenced_block.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_NULL_FENCED_BLOCK_HPP -#define ASIO_DETAIL_NULL_FENCED_BLOCK_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/noncopyable.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class null_fenced_block - : private noncopyable -{ -public: - enum half_or_full_t { half, full }; - - // Constructor. - explicit null_fenced_block(half_or_full_t) - { - } - - // Destructor. - ~null_fenced_block() - { - } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_NULL_FENCED_BLOCK_HPP diff --git a/tools/sdk/include/asio/asio/detail/null_global.hpp b/tools/sdk/include/asio/asio/detail/null_global.hpp deleted file mode 100644 index 727dd3f4989..00000000000 --- a/tools/sdk/include/asio/asio/detail/null_global.hpp +++ /dev/null @@ -1,59 +0,0 @@ -// -// detail/null_global.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_NULL_GLOBAL_HPP -#define ASIO_DETAIL_NULL_GLOBAL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -struct null_global_impl -{ - null_global_impl() - : ptr_(0) - { - } - - // Destructor automatically cleans up the global. - ~null_global_impl() - { - delete ptr_; - } - - static null_global_impl instance_; - T* ptr_; -}; - -template -null_global_impl null_global_impl::instance_; - -template -T& null_global() -{ - if (null_global_impl::instance_.ptr_ == 0) - null_global_impl::instance_.ptr_ = new T; - return *null_global_impl::instance_.ptr_; -} - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_NULL_GLOBAL_HPP diff --git a/tools/sdk/include/asio/asio/detail/null_mutex.hpp b/tools/sdk/include/asio/asio/detail/null_mutex.hpp deleted file mode 100644 index afe3fc03251..00000000000 --- a/tools/sdk/include/asio/asio/detail/null_mutex.hpp +++ /dev/null @@ -1,64 +0,0 @@ -// -// detail/null_mutex.hpp -// ~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_NULL_MUTEX_HPP -#define ASIO_DETAIL_NULL_MUTEX_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_HAS_THREADS) - -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/scoped_lock.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class null_mutex - : private noncopyable -{ -public: - typedef asio::detail::scoped_lock scoped_lock; - - // Constructor. - null_mutex() - { - } - - // Destructor. - ~null_mutex() - { - } - - // Lock the mutex. - void lock() - { - } - - // Unlock the mutex. - void unlock() - { - } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // !defined(ASIO_HAS_THREADS) - -#endif // ASIO_DETAIL_NULL_MUTEX_HPP diff --git a/tools/sdk/include/asio/asio/detail/null_reactor.hpp b/tools/sdk/include/asio/asio/detail/null_reactor.hpp deleted file mode 100644 index ca3c5fde662..00000000000 --- a/tools/sdk/include/asio/asio/detail/null_reactor.hpp +++ /dev/null @@ -1,68 +0,0 @@ -// -// detail/null_reactor.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_NULL_REACTOR_HPP -#define ASIO_DETAIL_NULL_REACTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_IOCP) || defined(ASIO_WINDOWS_RUNTIME) - -#include "asio/detail/scheduler_operation.hpp" -#include "asio/execution_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class null_reactor - : public execution_context_service_base -{ -public: - // Constructor. - null_reactor(asio::execution_context& ctx) - : execution_context_service_base(ctx) - { - } - - // Destructor. - ~null_reactor() - { - } - - // Destroy all user-defined handler objects owned by the service. - void shutdown() - { - } - - // No-op because should never be called. - void run(long /*usec*/, op_queue& /*ops*/) - { - } - - // No-op. - void interrupt() - { - } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_IOCP) || defined(ASIO_WINDOWS_RUNTIME) - -#endif // ASIO_DETAIL_NULL_REACTOR_HPP diff --git a/tools/sdk/include/asio/asio/detail/null_signal_blocker.hpp b/tools/sdk/include/asio/asio/detail/null_signal_blocker.hpp deleted file mode 100644 index edfe820519e..00000000000 --- a/tools/sdk/include/asio/asio/detail/null_signal_blocker.hpp +++ /dev/null @@ -1,69 +0,0 @@ -// -// detail/null_signal_blocker.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_NULL_SIGNAL_BLOCKER_HPP -#define ASIO_DETAIL_NULL_SIGNAL_BLOCKER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_HAS_THREADS) \ - || defined(ASIO_WINDOWS) \ - || defined(ASIO_WINDOWS_RUNTIME) \ - || defined(__CYGWIN__) \ - || defined(__SYMBIAN32__) - -#include "asio/detail/noncopyable.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class null_signal_blocker - : private noncopyable -{ -public: - // Constructor blocks all signals for the calling thread. - null_signal_blocker() - { - } - - // Destructor restores the previous signal mask. - ~null_signal_blocker() - { - } - - // Block all signals for the calling thread. - void block() - { - } - - // Restore the previous signal mask. - void unblock() - { - } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // !defined(ASIO_HAS_THREADS) - // || defined(ASIO_WINDOWS) - // || defined(ASIO_WINDOWS_RUNTIME) - // || defined(__CYGWIN__) - // || defined(__SYMBIAN32__) - -#endif // ASIO_DETAIL_NULL_SIGNAL_BLOCKER_HPP diff --git a/tools/sdk/include/asio/asio/detail/null_socket_service.hpp b/tools/sdk/include/asio/asio/detail/null_socket_service.hpp deleted file mode 100644 index 109c6c7bd36..00000000000 --- a/tools/sdk/include/asio/asio/detail/null_socket_service.hpp +++ /dev/null @@ -1,508 +0,0 @@ -// -// detail/null_socket_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_NULL_SOCKET_SERVICE_HPP -#define ASIO_DETAIL_NULL_SOCKET_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_WINDOWS_RUNTIME) - -#include "asio/buffer.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" -#include "asio/socket_base.hpp" -#include "asio/detail/bind_handler.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class null_socket_service : - public service_base > -{ -public: - // The protocol type. - typedef Protocol protocol_type; - - // The endpoint type. - typedef typename Protocol::endpoint endpoint_type; - - // The native type of a socket. - typedef int native_handle_type; - - // The implementation type of the socket. - struct implementation_type - { - }; - - // Constructor. - null_socket_service(asio::io_context& io_context) - : service_base >(io_context), - io_context_(io_context) - { - } - - // Destroy all user-defined handler objects owned by the service. - void shutdown() - { - } - - // Construct a new socket implementation. - void construct(implementation_type&) - { - } - - // Move-construct a new socket implementation. - void move_construct(implementation_type&, implementation_type&) - { - } - - // Move-assign from another socket implementation. - void move_assign(implementation_type&, - null_socket_service&, implementation_type&) - { - } - - // Move-construct a new socket implementation from another protocol type. - template - void converting_move_construct(implementation_type&, - null_socket_service&, - typename null_socket_service::implementation_type&) - { - } - - // Destroy a socket implementation. - void destroy(implementation_type&) - { - } - - // Open a new socket implementation. - asio::error_code open(implementation_type&, - const protocol_type&, asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return ec; - } - - // Assign a native socket to a socket implementation. - asio::error_code assign(implementation_type&, const protocol_type&, - const native_handle_type&, asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return ec; - } - - // Determine whether the socket is open. - bool is_open(const implementation_type&) const - { - return false; - } - - // Destroy a socket implementation. - asio::error_code close(implementation_type&, - asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return ec; - } - - // Release ownership of the socket. - native_handle_type release(implementation_type&, - asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return 0; - } - - // Get the native socket representation. - native_handle_type native_handle(implementation_type&) - { - return 0; - } - - // Cancel all operations associated with the socket. - asio::error_code cancel(implementation_type&, - asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return ec; - } - - // Determine whether the socket is at the out-of-band data mark. - bool at_mark(const implementation_type&, - asio::error_code& ec) const - { - ec = asio::error::operation_not_supported; - return false; - } - - // Determine the number of bytes available for reading. - std::size_t available(const implementation_type&, - asio::error_code& ec) const - { - ec = asio::error::operation_not_supported; - return 0; - } - - // Place the socket into the state where it will listen for new connections. - asio::error_code listen(implementation_type&, - int, asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return ec; - } - - // Perform an IO control command on the socket. - template - asio::error_code io_control(implementation_type&, - IO_Control_Command&, asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return ec; - } - - // Gets the non-blocking mode of the socket. - bool non_blocking(const implementation_type&) const - { - return false; - } - - // Sets the non-blocking mode of the socket. - asio::error_code non_blocking(implementation_type&, - bool, asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return ec; - } - - // Gets the non-blocking mode of the native socket implementation. - bool native_non_blocking(const implementation_type&) const - { - return false; - } - - // Sets the non-blocking mode of the native socket implementation. - asio::error_code native_non_blocking(implementation_type&, - bool, asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return ec; - } - - // Disable sends or receives on the socket. - asio::error_code shutdown(implementation_type&, - socket_base::shutdown_type, asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return ec; - } - - // Bind the socket to the specified local endpoint. - asio::error_code bind(implementation_type&, - const endpoint_type&, asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return ec; - } - - // Set a socket option. - template - asio::error_code set_option(implementation_type&, - const Option&, asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return ec; - } - - // Set a socket option. - template - asio::error_code get_option(const implementation_type&, - Option&, asio::error_code& ec) const - { - ec = asio::error::operation_not_supported; - return ec; - } - - // Get the local endpoint. - endpoint_type local_endpoint(const implementation_type&, - asio::error_code& ec) const - { - ec = asio::error::operation_not_supported; - return endpoint_type(); - } - - // Get the remote endpoint. - endpoint_type remote_endpoint(const implementation_type&, - asio::error_code& ec) const - { - ec = asio::error::operation_not_supported; - return endpoint_type(); - } - - // Send the given data to the peer. - template - std::size_t send(implementation_type&, const ConstBufferSequence&, - socket_base::message_flags, asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return 0; - } - - // Wait until data can be sent without blocking. - std::size_t send(implementation_type&, const null_buffers&, - socket_base::message_flags, asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return 0; - } - - // Start an asynchronous send. The data being sent must be valid for the - // lifetime of the asynchronous operation. - template - void async_send(implementation_type&, const ConstBufferSequence&, - socket_base::message_flags, Handler& handler) - { - asio::error_code ec = asio::error::operation_not_supported; - const std::size_t bytes_transferred = 0; - io_context_.post(detail::bind_handler(handler, ec, bytes_transferred)); - } - - // Start an asynchronous wait until data can be sent without blocking. - template - void async_send(implementation_type&, const null_buffers&, - socket_base::message_flags, Handler& handler) - { - asio::error_code ec = asio::error::operation_not_supported; - const std::size_t bytes_transferred = 0; - io_context_.post(detail::bind_handler(handler, ec, bytes_transferred)); - } - - // Receive some data from the peer. Returns the number of bytes received. - template - std::size_t receive(implementation_type&, const MutableBufferSequence&, - socket_base::message_flags, asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return 0; - } - - // Wait until data can be received without blocking. - std::size_t receive(implementation_type&, const null_buffers&, - socket_base::message_flags, asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return 0; - } - - // Start an asynchronous receive. The buffer for the data being received - // must be valid for the lifetime of the asynchronous operation. - template - void async_receive(implementation_type&, const MutableBufferSequence&, - socket_base::message_flags, Handler& handler) - { - asio::error_code ec = asio::error::operation_not_supported; - const std::size_t bytes_transferred = 0; - io_context_.post(detail::bind_handler(handler, ec, bytes_transferred)); - } - - // Wait until data can be received without blocking. - template - void async_receive(implementation_type&, const null_buffers&, - socket_base::message_flags, Handler& handler) - { - asio::error_code ec = asio::error::operation_not_supported; - const std::size_t bytes_transferred = 0; - io_context_.post(detail::bind_handler(handler, ec, bytes_transferred)); - } - - // Receive some data with associated flags. Returns the number of bytes - // received. - template - std::size_t receive_with_flags(implementation_type&, - const MutableBufferSequence&, socket_base::message_flags, - socket_base::message_flags&, asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return 0; - } - - // Wait until data can be received without blocking. - std::size_t receive_with_flags(implementation_type&, - const null_buffers&, socket_base::message_flags, - socket_base::message_flags&, asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return 0; - } - - // Start an asynchronous receive. The buffer for the data being received - // must be valid for the lifetime of the asynchronous operation. - template - void async_receive_with_flags(implementation_type&, - const MutableBufferSequence&, socket_base::message_flags, - socket_base::message_flags&, Handler& handler) - { - asio::error_code ec = asio::error::operation_not_supported; - const std::size_t bytes_transferred = 0; - io_context_.post(detail::bind_handler(handler, ec, bytes_transferred)); - } - - // Wait until data can be received without blocking. - template - void async_receive_with_flags(implementation_type&, - const null_buffers&, socket_base::message_flags, - socket_base::message_flags&, Handler& handler) - { - asio::error_code ec = asio::error::operation_not_supported; - const std::size_t bytes_transferred = 0; - io_context_.post(detail::bind_handler(handler, ec, bytes_transferred)); - } - - // Send a datagram to the specified endpoint. Returns the number of bytes - // sent. - template - std::size_t send_to(implementation_type&, const ConstBufferSequence&, - const endpoint_type&, socket_base::message_flags, - asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return 0; - } - - // Wait until data can be sent without blocking. - std::size_t send_to(implementation_type&, const null_buffers&, - const endpoint_type&, socket_base::message_flags, - asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return 0; - } - - // Start an asynchronous send. The data being sent must be valid for the - // lifetime of the asynchronous operation. - template - void async_send_to(implementation_type&, const ConstBufferSequence&, - const endpoint_type&, socket_base::message_flags, - Handler& handler) - { - asio::error_code ec = asio::error::operation_not_supported; - const std::size_t bytes_transferred = 0; - io_context_.post(detail::bind_handler(handler, ec, bytes_transferred)); - } - - // Start an asynchronous wait until data can be sent without blocking. - template - void async_send_to(implementation_type&, const null_buffers&, - const endpoint_type&, socket_base::message_flags, Handler& handler) - { - asio::error_code ec = asio::error::operation_not_supported; - const std::size_t bytes_transferred = 0; - io_context_.post(detail::bind_handler(handler, ec, bytes_transferred)); - } - - // Receive a datagram with the endpoint of the sender. Returns the number of - // bytes received. - template - std::size_t receive_from(implementation_type&, const MutableBufferSequence&, - endpoint_type&, socket_base::message_flags, - asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return 0; - } - - // Wait until data can be received without blocking. - std::size_t receive_from(implementation_type&, const null_buffers&, - endpoint_type&, socket_base::message_flags, - asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return 0; - } - - // Start an asynchronous receive. The buffer for the data being received and - // the sender_endpoint object must both be valid for the lifetime of the - // asynchronous operation. - template - void async_receive_from(implementation_type&, - const MutableBufferSequence&, endpoint_type&, - socket_base::message_flags, Handler& handler) - { - asio::error_code ec = asio::error::operation_not_supported; - const std::size_t bytes_transferred = 0; - io_context_.post(detail::bind_handler(handler, ec, bytes_transferred)); - } - - // Wait until data can be received without blocking. - template - void async_receive_from(implementation_type&, - const null_buffers&, endpoint_type&, - socket_base::message_flags, Handler& handler) - { - asio::error_code ec = asio::error::operation_not_supported; - const std::size_t bytes_transferred = 0; - io_context_.post(detail::bind_handler(handler, ec, bytes_transferred)); - } - - // Accept a new connection. - template - asio::error_code accept(implementation_type&, - Socket&, endpoint_type*, asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return ec; - } - - // Start an asynchronous accept. The peer and peer_endpoint objects - // must be valid until the accept's handler is invoked. - template - void async_accept(implementation_type&, Socket&, - endpoint_type*, Handler& handler) - { - asio::error_code ec = asio::error::operation_not_supported; - io_context_.post(detail::bind_handler(handler, ec)); - } - - // Connect the socket to the specified endpoint. - asio::error_code connect(implementation_type&, - const endpoint_type&, asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return ec; - } - - // Start an asynchronous connect. - template - void async_connect(implementation_type&, - const endpoint_type&, Handler& handler) - { - asio::error_code ec = asio::error::operation_not_supported; - io_context_.post(detail::bind_handler(handler, ec)); - } - -private: - asio::io_context& io_context_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_WINDOWS_RUNTIME) - -#endif // ASIO_DETAIL_NULL_SOCKET_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/detail/null_static_mutex.hpp b/tools/sdk/include/asio/asio/detail/null_static_mutex.hpp deleted file mode 100644 index 36ec04f7e3d..00000000000 --- a/tools/sdk/include/asio/asio/detail/null_static_mutex.hpp +++ /dev/null @@ -1,60 +0,0 @@ -// -// detail/null_static_mutex.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_NULL_STATIC_MUTEX_HPP -#define ASIO_DETAIL_NULL_STATIC_MUTEX_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_HAS_THREADS) - -#include "asio/detail/scoped_lock.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -struct null_static_mutex -{ - typedef asio::detail::scoped_lock scoped_lock; - - // Initialise the mutex. - void init() - { - } - - // Lock the mutex. - void lock() - { - } - - // Unlock the mutex. - void unlock() - { - } - - int unused_; -}; - -#define ASIO_NULL_STATIC_MUTEX_INIT { 0 } - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // !defined(ASIO_HAS_THREADS) - -#endif // ASIO_DETAIL_NULL_STATIC_MUTEX_HPP diff --git a/tools/sdk/include/asio/asio/detail/null_thread.hpp b/tools/sdk/include/asio/asio/detail/null_thread.hpp deleted file mode 100644 index 7291ba3841d..00000000000 --- a/tools/sdk/include/asio/asio/detail/null_thread.hpp +++ /dev/null @@ -1,67 +0,0 @@ -// -// detail/null_thread.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_NULL_THREAD_HPP -#define ASIO_DETAIL_NULL_THREAD_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_HAS_THREADS) - -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class null_thread - : private noncopyable -{ -public: - // Constructor. - template - null_thread(Function, unsigned int = 0) - { - asio::detail::throw_error( - asio::error::operation_not_supported, "thread"); - } - - // Destructor. - ~null_thread() - { - } - - // Wait for the thread to exit. - void join() - { - } - - // Get number of CPUs. - static std::size_t hardware_concurrency() - { - return 1; - } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // !defined(ASIO_HAS_THREADS) - -#endif // ASIO_DETAIL_NULL_THREAD_HPP diff --git a/tools/sdk/include/asio/asio/detail/null_tss_ptr.hpp b/tools/sdk/include/asio/asio/detail/null_tss_ptr.hpp deleted file mode 100644 index 323967d6cf4..00000000000 --- a/tools/sdk/include/asio/asio/detail/null_tss_ptr.hpp +++ /dev/null @@ -1,68 +0,0 @@ -// -// detail/null_tss_ptr.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_NULL_TSS_PTR_HPP -#define ASIO_DETAIL_NULL_TSS_PTR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_HAS_THREADS) - -#include "asio/detail/noncopyable.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class null_tss_ptr - : private noncopyable -{ -public: - // Constructor. - null_tss_ptr() - : value_(0) - { - } - - // Destructor. - ~null_tss_ptr() - { - } - - // Get the value. - operator T*() const - { - return value_; - } - - // Set the value. - void operator=(T* value) - { - value_ = value; - } - -private: - T* value_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // !defined(ASIO_HAS_THREADS) - -#endif // ASIO_DETAIL_NULL_TSS_PTR_HPP diff --git a/tools/sdk/include/asio/asio/detail/object_pool.hpp b/tools/sdk/include/asio/asio/detail/object_pool.hpp deleted file mode 100644 index e1a3c5482a9..00000000000 --- a/tools/sdk/include/asio/asio/detail/object_pool.hpp +++ /dev/null @@ -1,171 +0,0 @@ -// -// detail/object_pool.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_OBJECT_POOL_HPP -#define ASIO_DETAIL_OBJECT_POOL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/noncopyable.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class object_pool; - -class object_pool_access -{ -public: - template - static Object* create() - { - return new Object; - } - - template - static Object* create(Arg arg) - { - return new Object(arg); - } - - template - static void destroy(Object* o) - { - delete o; - } - - template - static Object*& next(Object* o) - { - return o->next_; - } - - template - static Object*& prev(Object* o) - { - return o->prev_; - } -}; - -template -class object_pool - : private noncopyable -{ -public: - // Constructor. - object_pool() - : live_list_(0), - free_list_(0) - { - } - - // Destructor destroys all objects. - ~object_pool() - { - destroy_list(live_list_); - destroy_list(free_list_); - } - - // Get the object at the start of the live list. - Object* first() - { - return live_list_; - } - - // Allocate a new object. - Object* alloc() - { - Object* o = free_list_; - if (o) - free_list_ = object_pool_access::next(free_list_); - else - o = object_pool_access::create(); - - object_pool_access::next(o) = live_list_; - object_pool_access::prev(o) = 0; - if (live_list_) - object_pool_access::prev(live_list_) = o; - live_list_ = o; - - return o; - } - - // Allocate a new object with an argument. - template - Object* alloc(Arg arg) - { - Object* o = free_list_; - if (o) - free_list_ = object_pool_access::next(free_list_); - else - o = object_pool_access::create(arg); - - object_pool_access::next(o) = live_list_; - object_pool_access::prev(o) = 0; - if (live_list_) - object_pool_access::prev(live_list_) = o; - live_list_ = o; - - return o; - } - - // Free an object. Moves it to the free list. No destructors are run. - void free(Object* o) - { - if (live_list_ == o) - live_list_ = object_pool_access::next(o); - - if (object_pool_access::prev(o)) - { - object_pool_access::next(object_pool_access::prev(o)) - = object_pool_access::next(o); - } - - if (object_pool_access::next(o)) - { - object_pool_access::prev(object_pool_access::next(o)) - = object_pool_access::prev(o); - } - - object_pool_access::next(o) = free_list_; - object_pool_access::prev(o) = 0; - free_list_ = o; - } - -private: - // Helper function to destroy all elements in a list. - void destroy_list(Object* list) - { - while (list) - { - Object* o = list; - list = object_pool_access::next(o); - object_pool_access::destroy(o); - } - } - - // The list of live objects. - Object* live_list_; - - // The free list. - Object* free_list_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_OBJECT_POOL_HPP diff --git a/tools/sdk/include/asio/asio/detail/old_win_sdk_compat.hpp b/tools/sdk/include/asio/asio/detail/old_win_sdk_compat.hpp deleted file mode 100644 index bfb109e7f7b..00000000000 --- a/tools/sdk/include/asio/asio/detail/old_win_sdk_compat.hpp +++ /dev/null @@ -1,214 +0,0 @@ -// -// detail/old_win_sdk_compat.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_OLD_WIN_SDK_COMPAT_HPP -#define ASIO_DETAIL_OLD_WIN_SDK_COMPAT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) - -// Guess whether we are building against on old Platform SDK. -#if !defined(IN6ADDR_ANY_INIT) -#define ASIO_HAS_OLD_WIN_SDK 1 -#endif // !defined(IN6ADDR_ANY_INIT) - -#if defined(ASIO_HAS_OLD_WIN_SDK) - -// Emulation of types that are missing from old Platform SDKs. -// -// N.B. this emulation is also used if building for a Windows 2000 target with -// a recent (i.e. Vista or later) SDK, as the SDK does not provide IPv6 support -// in that case. - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -enum -{ - sockaddr_storage_maxsize = 128, // Maximum size. - sockaddr_storage_alignsize = (sizeof(__int64)), // Desired alignment. - sockaddr_storage_pad1size = (sockaddr_storage_alignsize - sizeof(short)), - sockaddr_storage_pad2size = (sockaddr_storage_maxsize - - (sizeof(short) + sockaddr_storage_pad1size + sockaddr_storage_alignsize)) -}; - -struct sockaddr_storage_emulation -{ - short ss_family; - char __ss_pad1[sockaddr_storage_pad1size]; - __int64 __ss_align; - char __ss_pad2[sockaddr_storage_pad2size]; -}; - -struct in6_addr_emulation -{ - union - { - u_char Byte[16]; - u_short Word[8]; - } u; -}; - -#if !defined(s6_addr) -# define _S6_un u -# define _S6_u8 Byte -# define s6_addr _S6_un._S6_u8 -#endif // !defined(s6_addr) - -struct sockaddr_in6_emulation -{ - short sin6_family; - u_short sin6_port; - u_long sin6_flowinfo; - in6_addr_emulation sin6_addr; - u_long sin6_scope_id; -}; - -struct ipv6_mreq_emulation -{ - in6_addr_emulation ipv6mr_multiaddr; - unsigned int ipv6mr_interface; -}; - -struct addrinfo_emulation -{ - int ai_flags; - int ai_family; - int ai_socktype; - int ai_protocol; - size_t ai_addrlen; - char* ai_canonname; - sockaddr* ai_addr; - addrinfo_emulation* ai_next; -}; - -#if !defined(AI_PASSIVE) -# define AI_PASSIVE 0x1 -#endif - -#if !defined(AI_CANONNAME) -# define AI_CANONNAME 0x2 -#endif - -#if !defined(AI_NUMERICHOST) -# define AI_NUMERICHOST 0x4 -#endif - -#if !defined(EAI_AGAIN) -# define EAI_AGAIN WSATRY_AGAIN -#endif - -#if !defined(EAI_BADFLAGS) -# define EAI_BADFLAGS WSAEINVAL -#endif - -#if !defined(EAI_FAIL) -# define EAI_FAIL WSANO_RECOVERY -#endif - -#if !defined(EAI_FAMILY) -# define EAI_FAMILY WSAEAFNOSUPPORT -#endif - -#if !defined(EAI_MEMORY) -# define EAI_MEMORY WSA_NOT_ENOUGH_MEMORY -#endif - -#if !defined(EAI_NODATA) -# define EAI_NODATA WSANO_DATA -#endif - -#if !defined(EAI_NONAME) -# define EAI_NONAME WSAHOST_NOT_FOUND -#endif - -#if !defined(EAI_SERVICE) -# define EAI_SERVICE WSATYPE_NOT_FOUND -#endif - -#if !defined(EAI_SOCKTYPE) -# define EAI_SOCKTYPE WSAESOCKTNOSUPPORT -#endif - -#if !defined(NI_NOFQDN) -# define NI_NOFQDN 0x01 -#endif - -#if !defined(NI_NUMERICHOST) -# define NI_NUMERICHOST 0x02 -#endif - -#if !defined(NI_NAMEREQD) -# define NI_NAMEREQD 0x04 -#endif - -#if !defined(NI_NUMERICSERV) -# define NI_NUMERICSERV 0x08 -#endif - -#if !defined(NI_DGRAM) -# define NI_DGRAM 0x10 -#endif - -#if !defined(IPPROTO_IPV6) -# define IPPROTO_IPV6 41 -#endif - -#if !defined(IPV6_UNICAST_HOPS) -# define IPV6_UNICAST_HOPS 4 -#endif - -#if !defined(IPV6_MULTICAST_IF) -# define IPV6_MULTICAST_IF 9 -#endif - -#if !defined(IPV6_MULTICAST_HOPS) -# define IPV6_MULTICAST_HOPS 10 -#endif - -#if !defined(IPV6_MULTICAST_LOOP) -# define IPV6_MULTICAST_LOOP 11 -#endif - -#if !defined(IPV6_JOIN_GROUP) -# define IPV6_JOIN_GROUP 12 -#endif - -#if !defined(IPV6_LEAVE_GROUP) -# define IPV6_LEAVE_GROUP 13 -#endif - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_OLD_WIN_SDK) - -// Even newer Platform SDKs that support IPv6 may not define IPV6_V6ONLY. -#if !defined(IPV6_V6ONLY) -# define IPV6_V6ONLY 27 -#endif - -// Some SDKs (e.g. Windows CE) don't define IPPROTO_ICMPV6. -#if !defined(IPPROTO_ICMPV6) -# define IPPROTO_ICMPV6 58 -#endif - -#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) - -#endif // ASIO_DETAIL_OLD_WIN_SDK_COMPAT_HPP diff --git a/tools/sdk/include/asio/asio/detail/op_queue.hpp b/tools/sdk/include/asio/asio/detail/op_queue.hpp deleted file mode 100644 index 6219f797d7f..00000000000 --- a/tools/sdk/include/asio/asio/detail/op_queue.hpp +++ /dev/null @@ -1,162 +0,0 @@ -// -// detail/op_queue.hpp -// ~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_OP_QUEUE_HPP -#define ASIO_DETAIL_OP_QUEUE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/noncopyable.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class op_queue; - -class op_queue_access -{ -public: - template - static Operation* next(Operation* o) - { - return static_cast(o->next_); - } - - template - static void next(Operation1*& o1, Operation2* o2) - { - o1->next_ = o2; - } - - template - static void destroy(Operation* o) - { - o->destroy(); - } - - template - static Operation*& front(op_queue& q) - { - return q.front_; - } - - template - static Operation*& back(op_queue& q) - { - return q.back_; - } -}; - -template -class op_queue - : private noncopyable -{ -public: - // Constructor. - op_queue() - : front_(0), - back_(0) - { - } - - // Destructor destroys all operations. - ~op_queue() - { - while (Operation* op = front_) - { - pop(); - op_queue_access::destroy(op); - } - } - - // Get the operation at the front of the queue. - Operation* front() - { - return front_; - } - - // Pop an operation from the front of the queue. - void pop() - { - if (front_) - { - Operation* tmp = front_; - front_ = op_queue_access::next(front_); - if (front_ == 0) - back_ = 0; - op_queue_access::next(tmp, static_cast(0)); - } - } - - // Push an operation on to the back of the queue. - void push(Operation* h) - { - op_queue_access::next(h, static_cast(0)); - if (back_) - { - op_queue_access::next(back_, h); - back_ = h; - } - else - { - front_ = back_ = h; - } - } - - // Push all operations from another queue on to the back of the queue. The - // source queue may contain operations of a derived type. - template - void push(op_queue& q) - { - if (Operation* other_front = op_queue_access::front(q)) - { - if (back_) - op_queue_access::next(back_, other_front); - else - front_ = other_front; - back_ = op_queue_access::back(q); - op_queue_access::front(q) = 0; - op_queue_access::back(q) = 0; - } - } - - // Whether the queue is empty. - bool empty() const - { - return front_ == 0; - } - - // Test whether an operation is already enqueued. - bool is_enqueued(Operation* o) const - { - return op_queue_access::next(o) != 0 || back_ == o; - } - -private: - friend class op_queue_access; - - // The front of the queue. - Operation* front_; - - // The back of the queue. - Operation* back_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_OP_QUEUE_HPP diff --git a/tools/sdk/include/asio/asio/detail/operation.hpp b/tools/sdk/include/asio/asio/detail/operation.hpp deleted file mode 100644 index 811e54d4aa7..00000000000 --- a/tools/sdk/include/asio/asio/detail/operation.hpp +++ /dev/null @@ -1,38 +0,0 @@ -// -// detail/operation.hpp -// ~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_OPERATION_HPP -#define ASIO_DETAIL_OPERATION_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_IOCP) -# include "asio/detail/win_iocp_operation.hpp" -#else -# include "asio/detail/scheduler_operation.hpp" -#endif - -namespace asio { -namespace detail { - -#if defined(ASIO_HAS_IOCP) -typedef win_iocp_operation operation; -#else -typedef scheduler_operation operation; -#endif - -} // namespace detail -} // namespace asio - -#endif // ASIO_DETAIL_OPERATION_HPP diff --git a/tools/sdk/include/asio/asio/detail/pipe_select_interrupter.hpp b/tools/sdk/include/asio/asio/detail/pipe_select_interrupter.hpp deleted file mode 100644 index 55d7db4916e..00000000000 --- a/tools/sdk/include/asio/asio/detail/pipe_select_interrupter.hpp +++ /dev/null @@ -1,89 +0,0 @@ -// -// detail/pipe_select_interrupter.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_PIPE_SELECT_INTERRUPTER_HPP -#define ASIO_DETAIL_PIPE_SELECT_INTERRUPTER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_WINDOWS) -#if !defined(ASIO_WINDOWS_RUNTIME) -#if !defined(__CYGWIN__) -#if !defined(__SYMBIAN32__) -#if !defined(ASIO_HAS_EVENTFD) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class pipe_select_interrupter -{ -public: - // Constructor. - ASIO_DECL pipe_select_interrupter(); - - // Destructor. - ASIO_DECL ~pipe_select_interrupter(); - - // Recreate the interrupter's descriptors. Used after a fork. - ASIO_DECL void recreate(); - - // Interrupt the select call. - ASIO_DECL void interrupt(); - - // Reset the select interrupt. Returns true if the call was interrupted. - ASIO_DECL bool reset(); - - // Get the read descriptor to be passed to select. - int read_descriptor() const - { - return read_descriptor_; - } - -private: - // Open the descriptors. Throws on error. - ASIO_DECL void open_descriptors(); - - // Close the descriptors. - ASIO_DECL void close_descriptors(); - - // The read end of a connection used to interrupt the select call. This file - // descriptor is passed to select such that when it is time to stop, a single - // byte will be written on the other end of the connection and this - // descriptor will become readable. - int read_descriptor_; - - // The write end of a connection used to interrupt the select call. A single - // byte may be written to this to wake up the select which is waiting for the - // other end to become readable. - int write_descriptor_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/pipe_select_interrupter.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // !defined(ASIO_HAS_EVENTFD) -#endif // !defined(__SYMBIAN32__) -#endif // !defined(__CYGWIN__) -#endif // !defined(ASIO_WINDOWS_RUNTIME) -#endif // !defined(ASIO_WINDOWS) - -#endif // ASIO_DETAIL_PIPE_SELECT_INTERRUPTER_HPP diff --git a/tools/sdk/include/asio/asio/detail/pop_options.hpp b/tools/sdk/include/asio/asio/detail/pop_options.hpp deleted file mode 100644 index 1045612bf40..00000000000 --- a/tools/sdk/include/asio/asio/detail/pop_options.hpp +++ /dev/null @@ -1,135 +0,0 @@ -// -// detail/pop_options.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -// No header guard - -#if defined(__COMO__) - -// Comeau C++ - -#elif defined(__DMC__) - -// Digital Mars C++ - -#elif defined(__INTEL_COMPILER) || defined(__ICL) \ - || defined(__ICC) || defined(__ECC) - -// Intel C++ - -# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) -# pragma GCC visibility pop -# endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) - -#elif defined(__clang__) - -// Clang - -# if defined(__OBJC__) -# if !defined(__APPLE_CC__) || (__APPLE_CC__ <= 1) -# if defined(ASIO_OBJC_WORKAROUND) -# undef Protocol -# undef id -# undef ASIO_OBJC_WORKAROUND -# endif -# endif -# endif - -# if !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32) -# pragma GCC visibility pop -# endif // !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32) - -#elif defined(__GNUC__) - -// GNU C++ - -# if defined(__MINGW32__) || defined(__CYGWIN__) -# pragma pack (pop) -# endif - -# if defined(__OBJC__) -# if !defined(__APPLE_CC__) || (__APPLE_CC__ <= 1) -# if defined(ASIO_OBJC_WORKAROUND) -# undef Protocol -# undef id -# undef ASIO_OBJC_WORKAROUND -# endif -# endif -# endif - -# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) -# pragma GCC visibility pop -# endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) - -# if (__GNUC__ >= 7) -# pragma GCC diagnostic pop -# endif // (__GNUC__ >= 7) - -#elif defined(__KCC) - -// Kai C++ - -#elif defined(__sgi) - -// SGI MIPSpro C++ - -#elif defined(__DECCXX) - -// Compaq Tru64 Unix cxx - -#elif defined(__ghs) - -// Greenhills C++ - -#elif defined(__BORLANDC__) - -// Borland C++ - -# pragma option pop -# pragma nopushoptwarn -# pragma nopackwarning - -#elif defined(__MWERKS__) - -// Metrowerks CodeWarrior - -#elif defined(__SUNPRO_CC) - -// Sun Workshop Compiler C++ - -#elif defined(__HP_aCC) - -// HP aCC - -#elif defined(__MRC__) || defined(__SC__) - -// MPW MrCpp or SCpp - -#elif defined(__IBMCPP__) - -// IBM Visual Age - -#elif defined(_MSC_VER) - -// Microsoft Visual C++ -// -// Must remain the last #elif since some other vendors (Metrowerks, for example) -// also #define _MSC_VER - -# pragma warning (pop) -# pragma pack (pop) - -# if defined(__cplusplus_cli) || defined(__cplusplus_winrt) -# if defined(ASIO_CLR_WORKAROUND) -# undef generic -# undef ASIO_CLR_WORKAROUND -# endif -# endif - -#endif diff --git a/tools/sdk/include/asio/asio/detail/posix_event.hpp b/tools/sdk/include/asio/asio/detail/posix_event.hpp deleted file mode 100644 index 121065efbbc..00000000000 --- a/tools/sdk/include/asio/asio/detail/posix_event.hpp +++ /dev/null @@ -1,162 +0,0 @@ -// -// detail/posix_event.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_POSIX_EVENT_HPP -#define ASIO_DETAIL_POSIX_EVENT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_PTHREADS) - -#include -#include "asio/detail/assert.hpp" -#include "asio/detail/noncopyable.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class posix_event - : private noncopyable -{ -public: - // Constructor. - ASIO_DECL posix_event(); - - // Destructor. - ~posix_event() - { - ::pthread_cond_destroy(&cond_); - } - - // Signal the event. (Retained for backward compatibility.) - template - void signal(Lock& lock) - { - this->signal_all(lock); - } - - // Signal all waiters. - template - void signal_all(Lock& lock) - { - ASIO_ASSERT(lock.locked()); - (void)lock; - state_ |= 1; - ::pthread_cond_broadcast(&cond_); // Ignore EINVAL. - } - - // Unlock the mutex and signal one waiter. - template - void unlock_and_signal_one(Lock& lock) - { - ASIO_ASSERT(lock.locked()); - state_ |= 1; - bool have_waiters = (state_ > 1); - lock.unlock(); - if (have_waiters) - ::pthread_cond_signal(&cond_); // Ignore EINVAL. - } - - // If there's a waiter, unlock the mutex and signal it. - template - bool maybe_unlock_and_signal_one(Lock& lock) - { - ASIO_ASSERT(lock.locked()); - state_ |= 1; - if (state_ > 1) - { - lock.unlock(); - ::pthread_cond_signal(&cond_); // Ignore EINVAL. - return true; - } - return false; - } - - // Reset the event. - template - void clear(Lock& lock) - { - ASIO_ASSERT(lock.locked()); - (void)lock; - state_ &= ~std::size_t(1); - } - - // Wait for the event to become signalled. - template - void wait(Lock& lock) - { - ASIO_ASSERT(lock.locked()); - while ((state_ & 1) == 0) - { - state_ += 2; - ::pthread_cond_wait(&cond_, &lock.mutex().mutex_); // Ignore EINVAL. - state_ -= 2; - } - } - - // Timed wait for the event to become signalled. - template - bool wait_for_usec(Lock& lock, long usec) - { - ASIO_ASSERT(lock.locked()); - if ((state_ & 1) == 0) - { - state_ += 2; - timespec ts; -#if (defined(__MACH__) && defined(__APPLE__)) \ - || (defined(__ANDROID__) && (__ANDROID_API__ < 21) \ - && defined(HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE)) - ts.tv_sec = usec / 1000000; - ts.tv_nsec = (usec % 1000000) * 1000; - ::pthread_cond_timedwait_relative_np( - &cond_, &lock.mutex().mutex_, &ts); // Ignore EINVAL. -#else // (defined(__MACH__) && defined(__APPLE__)) - // || (defined(__ANDROID__) && (__ANDROID_API__ < 21) - // && defined(HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE)) - if (::clock_gettime(CLOCK_MONOTONIC, &ts) == 0) - { - ts.tv_sec += usec / 1000000; - ts.tv_nsec = (usec % 1000000) * 1000; - ts.tv_sec += ts.tv_nsec / 1000000000; - ts.tv_nsec = ts.tv_nsec % 1000000000; - ::pthread_cond_timedwait(&cond_, - &lock.mutex().mutex_, &ts); // Ignore EINVAL. - } -#endif // (defined(__MACH__) && defined(__APPLE__)) - // || (defined(__ANDROID__) && (__ANDROID_API__ < 21) - // && defined(HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE)) - state_ -= 2; - } - return (state_ & 1) != 0; - } - -private: - ::pthread_cond_t cond_; - std::size_t state_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/posix_event.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_HAS_PTHREADS) - -#endif // ASIO_DETAIL_POSIX_EVENT_HPP diff --git a/tools/sdk/include/asio/asio/detail/posix_fd_set_adapter.hpp b/tools/sdk/include/asio/asio/detail/posix_fd_set_adapter.hpp deleted file mode 100644 index 95042d66314..00000000000 --- a/tools/sdk/include/asio/asio/detail/posix_fd_set_adapter.hpp +++ /dev/null @@ -1,118 +0,0 @@ -// -// detail/posix_fd_set_adapter.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_POSIX_FD_SET_ADAPTER_HPP -#define ASIO_DETAIL_POSIX_FD_SET_ADAPTER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_WINDOWS) \ - && !defined(__CYGWIN__) \ - && !defined(ASIO_WINDOWS_RUNTIME) - -#include -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/reactor_op_queue.hpp" -#include "asio/detail/socket_types.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -// Adapts the FD_SET type to meet the Descriptor_Set concept's requirements. -class posix_fd_set_adapter : noncopyable -{ -public: - posix_fd_set_adapter() - : max_descriptor_(invalid_socket) - { - using namespace std; // Needed for memset on Solaris. - FD_ZERO(&fd_set_); - } - - void reset() - { - using namespace std; // Needed for memset on Solaris. - FD_ZERO(&fd_set_); - } - - bool set(socket_type descriptor) - { - if (descriptor < (socket_type)FD_SETSIZE) - { - if (max_descriptor_ == invalid_socket || descriptor > max_descriptor_) - max_descriptor_ = descriptor; - FD_SET(descriptor, &fd_set_); - return true; - } - return false; - } - - void set(reactor_op_queue& operations, op_queue& ops) - { - reactor_op_queue::iterator i = operations.begin(); - while (i != operations.end()) - { - reactor_op_queue::iterator op_iter = i++; - if (!set(op_iter->first)) - { - asio::error_code ec(error::fd_set_failure); - operations.cancel_operations(op_iter, ops, ec); - } - } - } - - bool is_set(socket_type descriptor) const - { - return FD_ISSET(descriptor, &fd_set_) != 0; - } - - operator fd_set*() - { - return &fd_set_; - } - - socket_type max_descriptor() const - { - return max_descriptor_; - } - - void perform(reactor_op_queue& operations, - op_queue& ops) const - { - reactor_op_queue::iterator i = operations.begin(); - while (i != operations.end()) - { - reactor_op_queue::iterator op_iter = i++; - if (is_set(op_iter->first)) - operations.perform_operations(op_iter, ops); - } - } - -private: - mutable fd_set fd_set_; - socket_type max_descriptor_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // !defined(ASIO_WINDOWS) - // && !defined(__CYGWIN__) - // && !defined(ASIO_WINDOWS_RUNTIME) - -#endif // ASIO_DETAIL_POSIX_FD_SET_ADAPTER_HPP diff --git a/tools/sdk/include/asio/asio/detail/posix_global.hpp b/tools/sdk/include/asio/asio/detail/posix_global.hpp deleted file mode 100644 index 7ee0a715450..00000000000 --- a/tools/sdk/include/asio/asio/detail/posix_global.hpp +++ /dev/null @@ -1,80 +0,0 @@ -// -// detail/posix_global.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_POSIX_GLOBAL_HPP -#define ASIO_DETAIL_POSIX_GLOBAL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_PTHREADS) - -#include -#include - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -struct posix_global_impl -{ - // Helper function to perform initialisation. - static void do_init() - { - instance_.static_ptr_ = instance_.ptr_ = new T; - } - - // Destructor automatically cleans up the global. - ~posix_global_impl() - { - delete static_ptr_; - } - - static ::pthread_once_t init_once_; - static T* static_ptr_; - static posix_global_impl instance_; - T* ptr_; -}; - -template -::pthread_once_t posix_global_impl::init_once_ = PTHREAD_ONCE_INIT; - -template -T* posix_global_impl::static_ptr_ = 0; - -template -posix_global_impl posix_global_impl::instance_; - -template -T& posix_global() -{ - int result = ::pthread_once( - &posix_global_impl::init_once_, - &posix_global_impl::do_init); - - if (result != 0) - std::terminate(); - - return *posix_global_impl::instance_.ptr_; -} - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_PTHREADS) - -#endif // ASIO_DETAIL_POSIX_GLOBAL_HPP diff --git a/tools/sdk/include/asio/asio/detail/posix_mutex.hpp b/tools/sdk/include/asio/asio/detail/posix_mutex.hpp deleted file mode 100644 index c0d9fc9b777..00000000000 --- a/tools/sdk/include/asio/asio/detail/posix_mutex.hpp +++ /dev/null @@ -1,76 +0,0 @@ -// -// detail/posix_mutex.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_POSIX_MUTEX_HPP -#define ASIO_DETAIL_POSIX_MUTEX_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_PTHREADS) - -#include -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/scoped_lock.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class posix_event; - -class posix_mutex - : private noncopyable -{ -public: - typedef asio::detail::scoped_lock scoped_lock; - - // Constructor. - ASIO_DECL posix_mutex(); - - // Destructor. - ~posix_mutex() - { - ::pthread_mutex_destroy(&mutex_); // Ignore EBUSY. - } - - // Lock the mutex. - void lock() - { - (void)::pthread_mutex_lock(&mutex_); // Ignore EINVAL. - } - - // Unlock the mutex. - void unlock() - { - (void)::pthread_mutex_unlock(&mutex_); // Ignore EINVAL. - } - -private: - friend class posix_event; - ::pthread_mutex_t mutex_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/posix_mutex.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_HAS_PTHREADS) - -#endif // ASIO_DETAIL_POSIX_MUTEX_HPP diff --git a/tools/sdk/include/asio/asio/detail/posix_signal_blocker.hpp b/tools/sdk/include/asio/asio/detail/posix_signal_blocker.hpp deleted file mode 100644 index fab5eb1296c..00000000000 --- a/tools/sdk/include/asio/asio/detail/posix_signal_blocker.hpp +++ /dev/null @@ -1,85 +0,0 @@ -// -// detail/posix_signal_blocker.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_POSIX_SIGNAL_BLOCKER_HPP -#define ASIO_DETAIL_POSIX_SIGNAL_BLOCKER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_PTHREADS) - -#include -#include -#include -#include "asio/detail/noncopyable.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class posix_signal_blocker - : private noncopyable -{ -public: - // Constructor blocks all signals for the calling thread. - posix_signal_blocker() - : blocked_(false) - { - sigset_t new_mask; - sigfillset(&new_mask); - blocked_ = (pthread_sigmask(SIG_BLOCK, &new_mask, &old_mask_) == 0); - } - - // Destructor restores the previous signal mask. - ~posix_signal_blocker() - { - if (blocked_) - pthread_sigmask(SIG_SETMASK, &old_mask_, 0); - } - - // Block all signals for the calling thread. - void block() - { - if (!blocked_) - { - sigset_t new_mask; - sigfillset(&new_mask); - blocked_ = (pthread_sigmask(SIG_BLOCK, &new_mask, &old_mask_) == 0); - } - } - - // Restore the previous signal mask. - void unblock() - { - if (blocked_) - blocked_ = (pthread_sigmask(SIG_SETMASK, &old_mask_, 0) != 0); - } - -private: - // Have signals been blocked. - bool blocked_; - - // The previous signal mask. - sigset_t old_mask_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_PTHREADS) - -#endif // ASIO_DETAIL_POSIX_SIGNAL_BLOCKER_HPP diff --git a/tools/sdk/include/asio/asio/detail/posix_static_mutex.hpp b/tools/sdk/include/asio/asio/detail/posix_static_mutex.hpp deleted file mode 100644 index 59b86c1885c..00000000000 --- a/tools/sdk/include/asio/asio/detail/posix_static_mutex.hpp +++ /dev/null @@ -1,64 +0,0 @@ -// -// detail/posix_static_mutex.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_POSIX_STATIC_MUTEX_HPP -#define ASIO_DETAIL_POSIX_STATIC_MUTEX_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_PTHREADS) - -#include -#include "asio/detail/scoped_lock.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -struct posix_static_mutex -{ - typedef asio::detail::scoped_lock scoped_lock; - - // Initialise the mutex. - void init() - { - // Nothing to do. - } - - // Lock the mutex. - void lock() - { - (void)::pthread_mutex_lock(&mutex_); // Ignore EINVAL. - } - - // Unlock the mutex. - void unlock() - { - (void)::pthread_mutex_unlock(&mutex_); // Ignore EINVAL. - } - - ::pthread_mutex_t mutex_; -}; - -#define ASIO_POSIX_STATIC_MUTEX_INIT { PTHREAD_MUTEX_INITIALIZER } - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_PTHREADS) - -#endif // ASIO_DETAIL_POSIX_STATIC_MUTEX_HPP diff --git a/tools/sdk/include/asio/asio/detail/posix_thread.hpp b/tools/sdk/include/asio/asio/detail/posix_thread.hpp deleted file mode 100644 index 1817af28d40..00000000000 --- a/tools/sdk/include/asio/asio/detail/posix_thread.hpp +++ /dev/null @@ -1,109 +0,0 @@ -// -// detail/posix_thread.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_POSIX_THREAD_HPP -#define ASIO_DETAIL_POSIX_THREAD_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_PTHREADS) - -#include -#include -#include "asio/detail/noncopyable.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -extern "C" -{ - ASIO_DECL void* asio_detail_posix_thread_function(void* arg); -} - -class posix_thread - : private noncopyable -{ -public: - // Constructor. - template - posix_thread(Function f, unsigned int = 0) - : joined_(false) - { - start_thread(new func(f)); - } - - // Destructor. - ASIO_DECL ~posix_thread(); - - // Wait for the thread to exit. - ASIO_DECL void join(); - - // Get number of CPUs. - ASIO_DECL static std::size_t hardware_concurrency(); - -private: - friend void* asio_detail_posix_thread_function(void* arg); - - class func_base - { - public: - virtual ~func_base() {} - virtual void run() = 0; - }; - - struct auto_func_base_ptr - { - func_base* ptr; - ~auto_func_base_ptr() { delete ptr; } - }; - - template - class func - : public func_base - { - public: - func(Function f) - : f_(f) - { - } - - virtual void run() - { - f_(); - } - - private: - Function f_; - }; - - ASIO_DECL void start_thread(func_base* arg); - - ::pthread_t thread_; - bool joined_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/posix_thread.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_HAS_PTHREADS) - -#endif // ASIO_DETAIL_POSIX_THREAD_HPP diff --git a/tools/sdk/include/asio/asio/detail/posix_tss_ptr.hpp b/tools/sdk/include/asio/asio/detail/posix_tss_ptr.hpp deleted file mode 100644 index a3096b43e6c..00000000000 --- a/tools/sdk/include/asio/asio/detail/posix_tss_ptr.hpp +++ /dev/null @@ -1,79 +0,0 @@ -// -// detail/posix_tss_ptr.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_POSIX_TSS_PTR_HPP -#define ASIO_DETAIL_POSIX_TSS_PTR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_PTHREADS) - -#include -#include "asio/detail/noncopyable.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -// Helper function to create thread-specific storage. -ASIO_DECL void posix_tss_ptr_create(pthread_key_t& key); - -template -class posix_tss_ptr - : private noncopyable -{ -public: - // Constructor. - posix_tss_ptr() - { - posix_tss_ptr_create(tss_key_); - } - - // Destructor. - ~posix_tss_ptr() - { - ::pthread_key_delete(tss_key_); - } - - // Get the value. - operator T*() const - { - return static_cast(::pthread_getspecific(tss_key_)); - } - - // Set the value. - void operator=(T* value) - { - ::pthread_setspecific(tss_key_, value); - } - -private: - // Thread-specific storage to allow unlocked access to determine whether a - // thread is a member of the pool. - pthread_key_t tss_key_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/posix_tss_ptr.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_HAS_PTHREADS) - -#endif // ASIO_DETAIL_POSIX_TSS_PTR_HPP diff --git a/tools/sdk/include/asio/asio/detail/push_options.hpp b/tools/sdk/include/asio/asio/detail/push_options.hpp deleted file mode 100644 index 0a3e9798049..00000000000 --- a/tools/sdk/include/asio/asio/detail/push_options.hpp +++ /dev/null @@ -1,175 +0,0 @@ -// -// detail/push_options.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -// No header guard - -#if defined(__COMO__) - -// Comeau C++ - -#elif defined(__DMC__) - -// Digital Mars C++ - -#elif defined(__INTEL_COMPILER) || defined(__ICL) \ - || defined(__ICC) || defined(__ECC) - -// Intel C++ - -# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) -# pragma GCC visibility push (default) -# endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) - -#elif defined(__clang__) - -// Clang - -# if defined(__OBJC__) -# if !defined(__APPLE_CC__) || (__APPLE_CC__ <= 1) -# if !defined(ASIO_DISABLE_OBJC_WORKAROUND) -# if !defined(Protocol) && !defined(id) -# define Protocol cpp_Protocol -# define id cpp_id -# define ASIO_OBJC_WORKAROUND -# endif -# endif -# endif -# endif - -# if !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32) -# pragma GCC visibility push (default) -# endif // !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32) - -#elif defined(__GNUC__) - -// GNU C++ - -# if defined(__MINGW32__) || defined(__CYGWIN__) -# pragma pack (push, 8) -# endif - -# if defined(__OBJC__) -# if !defined(__APPLE_CC__) || (__APPLE_CC__ <= 1) -# if !defined(ASIO_DISABLE_OBJC_WORKAROUND) -# if !defined(Protocol) && !defined(id) -# define Protocol cpp_Protocol -# define id cpp_id -# define ASIO_OBJC_WORKAROUND -# endif -# endif -# endif -# endif - -# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) -# pragma GCC visibility push (default) -# endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) - -# if (__GNUC__ >= 7) -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wimplicit-fallthrough" -# endif // (__GNUC__ >= 7) - -#elif defined(__KCC) - -// Kai C++ - -#elif defined(__sgi) - -// SGI MIPSpro C++ - -#elif defined(__DECCXX) - -// Compaq Tru64 Unix cxx - -#elif defined(__ghs) - -// Greenhills C++ - -#elif defined(__BORLANDC__) - -// Borland C++ - -# pragma option push -a8 -b -Ve- -Vx- -w-inl -vi- -# pragma nopushoptwarn -# pragma nopackwarning -# if !defined(__MT__) -# error Multithreaded RTL must be selected. -# endif // !defined(__MT__) - -#elif defined(__MWERKS__) - -// Metrowerks CodeWarrior - -#elif defined(__SUNPRO_CC) - -// Sun Workshop Compiler C++ - -#elif defined(__HP_aCC) - -// HP aCC - -#elif defined(__MRC__) || defined(__SC__) - -// MPW MrCpp or SCpp - -#elif defined(__IBMCPP__) - -// IBM Visual Age - -#elif defined(_MSC_VER) - -// Microsoft Visual C++ -// -// Must remain the last #elif since some other vendors (Metrowerks, for example) -// also #define _MSC_VER - -# pragma warning (disable:4103) -# pragma warning (push) -# pragma warning (disable:4127) -# pragma warning (disable:4180) -# pragma warning (disable:4244) -# pragma warning (disable:4355) -# pragma warning (disable:4510) -# pragma warning (disable:4512) -# pragma warning (disable:4610) -# pragma warning (disable:4675) -# if (_MSC_VER < 1600) -// Visual Studio 2008 generates spurious warnings about unused parameters. -# pragma warning (disable:4100) -# endif // (_MSC_VER < 1600) -# if defined(_M_IX86) && defined(_Wp64) -// The /Wp64 option is broken. If you want to check 64 bit portability, use a -// 64 bit compiler! -# pragma warning (disable:4311) -# pragma warning (disable:4312) -# endif // defined(_M_IX86) && defined(_Wp64) -# pragma pack (push, 8) -// Note that if the /Og optimisation flag is enabled with MSVC6, the compiler -// has a tendency to incorrectly optimise away some calls to member template -// functions, even though those functions contain code that should not be -// optimised away! Therefore we will always disable this optimisation option -// for the MSVC6 compiler. -# if (_MSC_VER < 1300) -# pragma optimize ("g", off) -# endif -# if !defined(_MT) -# error Multithreaded RTL must be selected. -# endif // !defined(_MT) - -# if defined(__cplusplus_cli) || defined(__cplusplus_winrt) -# if !defined(ASIO_DISABLE_CLR_WORKAROUND) -# if !defined(generic) -# define generic cpp_generic -# define ASIO_CLR_WORKAROUND -# endif -# endif -# endif - -#endif diff --git a/tools/sdk/include/asio/asio/detail/reactive_descriptor_service.hpp b/tools/sdk/include/asio/asio/detail/reactive_descriptor_service.hpp deleted file mode 100644 index e8668639968..00000000000 --- a/tools/sdk/include/asio/asio/detail/reactive_descriptor_service.hpp +++ /dev/null @@ -1,388 +0,0 @@ -// -// detail/reactive_descriptor_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_REACTIVE_DESCRIPTOR_SERVICE_HPP -#define ASIO_DETAIL_REACTIVE_DESCRIPTOR_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_WINDOWS) \ - && !defined(ASIO_WINDOWS_RUNTIME) \ - && !defined(__CYGWIN__) - -#include "asio/buffer.hpp" -#include "asio/io_context.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/descriptor_ops.hpp" -#include "asio/detail/descriptor_read_op.hpp" -#include "asio/detail/descriptor_write_op.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/reactive_null_buffers_op.hpp" -#include "asio/detail/reactive_wait_op.hpp" -#include "asio/detail/reactor.hpp" -#include "asio/posix/descriptor_base.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class reactive_descriptor_service : - public service_base -{ -public: - // The native type of a descriptor. - typedef int native_handle_type; - - // The implementation type of the descriptor. - class implementation_type - : private asio::detail::noncopyable - { - public: - // Default constructor. - implementation_type() - : descriptor_(-1), - state_(0) - { - } - - private: - // Only this service will have access to the internal values. - friend class reactive_descriptor_service; - - // The native descriptor representation. - int descriptor_; - - // The current state of the descriptor. - descriptor_ops::state_type state_; - - // Per-descriptor data used by the reactor. - reactor::per_descriptor_data reactor_data_; - }; - - // Constructor. - ASIO_DECL reactive_descriptor_service( - asio::io_context& io_context); - - // Destroy all user-defined handler objects owned by the service. - ASIO_DECL void shutdown(); - - // Construct a new descriptor implementation. - ASIO_DECL void construct(implementation_type& impl); - - // Move-construct a new descriptor implementation. - ASIO_DECL void move_construct(implementation_type& impl, - implementation_type& other_impl); - - // Move-assign from another descriptor implementation. - ASIO_DECL void move_assign(implementation_type& impl, - reactive_descriptor_service& other_service, - implementation_type& other_impl); - - // Destroy a descriptor implementation. - ASIO_DECL void destroy(implementation_type& impl); - - // Assign a native descriptor to a descriptor implementation. - ASIO_DECL asio::error_code assign(implementation_type& impl, - const native_handle_type& native_descriptor, - asio::error_code& ec); - - // Determine whether the descriptor is open. - bool is_open(const implementation_type& impl) const - { - return impl.descriptor_ != -1; - } - - // Destroy a descriptor implementation. - ASIO_DECL asio::error_code close(implementation_type& impl, - asio::error_code& ec); - - // Get the native descriptor representation. - native_handle_type native_handle(const implementation_type& impl) const - { - return impl.descriptor_; - } - - // Release ownership of the native descriptor representation. - ASIO_DECL native_handle_type release(implementation_type& impl); - - // Cancel all operations associated with the descriptor. - ASIO_DECL asio::error_code cancel(implementation_type& impl, - asio::error_code& ec); - - // Perform an IO control command on the descriptor. - template - asio::error_code io_control(implementation_type& impl, - IO_Control_Command& command, asio::error_code& ec) - { - descriptor_ops::ioctl(impl.descriptor_, impl.state_, - command.name(), static_cast(command.data()), ec); - return ec; - } - - // Gets the non-blocking mode of the descriptor. - bool non_blocking(const implementation_type& impl) const - { - return (impl.state_ & descriptor_ops::user_set_non_blocking) != 0; - } - - // Sets the non-blocking mode of the descriptor. - asio::error_code non_blocking(implementation_type& impl, - bool mode, asio::error_code& ec) - { - descriptor_ops::set_user_non_blocking( - impl.descriptor_, impl.state_, mode, ec); - return ec; - } - - // Gets the non-blocking mode of the native descriptor implementation. - bool native_non_blocking(const implementation_type& impl) const - { - return (impl.state_ & descriptor_ops::internal_non_blocking) != 0; - } - - // Sets the non-blocking mode of the native descriptor implementation. - asio::error_code native_non_blocking(implementation_type& impl, - bool mode, asio::error_code& ec) - { - descriptor_ops::set_internal_non_blocking( - impl.descriptor_, impl.state_, mode, ec); - return ec; - } - - // Wait for the descriptor to become ready to read, ready to write, or to have - // pending error conditions. - asio::error_code wait(implementation_type& impl, - posix::descriptor_base::wait_type w, asio::error_code& ec) - { - switch (w) - { - case posix::descriptor_base::wait_read: - descriptor_ops::poll_read(impl.descriptor_, impl.state_, ec); - break; - case posix::descriptor_base::wait_write: - descriptor_ops::poll_write(impl.descriptor_, impl.state_, ec); - break; - case posix::descriptor_base::wait_error: - descriptor_ops::poll_error(impl.descriptor_, impl.state_, ec); - break; - default: - ec = asio::error::invalid_argument; - break; - } - - return ec; - } - - // Asynchronously wait for the descriptor to become ready to read, ready to - // write, or to have pending error conditions. - template - void async_wait(implementation_type& impl, - posix::descriptor_base::wait_type w, Handler& handler) - { - bool is_continuation = - asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_wait_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(handler); - - ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "descriptor", - &impl, impl.descriptor_, "async_wait")); - - int op_type; - switch (w) - { - case posix::descriptor_base::wait_read: - op_type = reactor::read_op; - break; - case posix::descriptor_base::wait_write: - op_type = reactor::write_op; - break; - case posix::descriptor_base::wait_error: - op_type = reactor::except_op; - break; - default: - p.p->ec_ = asio::error::invalid_argument; - reactor_.post_immediate_completion(p.p, is_continuation); - p.v = p.p = 0; - return; - } - - start_op(impl, op_type, p.p, is_continuation, false, false); - p.v = p.p = 0; - } - - // Write some data to the descriptor. - template - size_t write_some(implementation_type& impl, - const ConstBufferSequence& buffers, asio::error_code& ec) - { - buffer_sequence_adapter bufs(buffers); - - return descriptor_ops::sync_write(impl.descriptor_, impl.state_, - bufs.buffers(), bufs.count(), bufs.all_empty(), ec); - } - - // Wait until data can be written without blocking. - size_t write_some(implementation_type& impl, - const null_buffers&, asio::error_code& ec) - { - // Wait for descriptor to become ready. - descriptor_ops::poll_write(impl.descriptor_, impl.state_, ec); - - return 0; - } - - // Start an asynchronous write. The data being sent must be valid for the - // lifetime of the asynchronous operation. - template - void async_write_some(implementation_type& impl, - const ConstBufferSequence& buffers, Handler& handler) - { - bool is_continuation = - asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef descriptor_write_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(impl.descriptor_, buffers, handler); - - ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "descriptor", - &impl, impl.descriptor_, "async_write_some")); - - start_op(impl, reactor::write_op, p.p, is_continuation, true, - buffer_sequence_adapter::all_empty(buffers)); - p.v = p.p = 0; - } - - // Start an asynchronous wait until data can be written without blocking. - template - void async_write_some(implementation_type& impl, - const null_buffers&, Handler& handler) - { - bool is_continuation = - asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_null_buffers_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(handler); - - ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "descriptor", - &impl, impl.descriptor_, "async_write_some(null_buffers)")); - - start_op(impl, reactor::write_op, p.p, is_continuation, false, false); - p.v = p.p = 0; - } - - // Read some data from the stream. Returns the number of bytes read. - template - size_t read_some(implementation_type& impl, - const MutableBufferSequence& buffers, asio::error_code& ec) - { - buffer_sequence_adapter bufs(buffers); - - return descriptor_ops::sync_read(impl.descriptor_, impl.state_, - bufs.buffers(), bufs.count(), bufs.all_empty(), ec); - } - - // Wait until data can be read without blocking. - size_t read_some(implementation_type& impl, - const null_buffers&, asio::error_code& ec) - { - // Wait for descriptor to become ready. - descriptor_ops::poll_read(impl.descriptor_, impl.state_, ec); - - return 0; - } - - // Start an asynchronous read. The buffer for the data being read must be - // valid for the lifetime of the asynchronous operation. - template - void async_read_some(implementation_type& impl, - const MutableBufferSequence& buffers, Handler& handler) - { - bool is_continuation = - asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef descriptor_read_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(impl.descriptor_, buffers, handler); - - ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "descriptor", - &impl, impl.descriptor_, "async_read_some")); - - start_op(impl, reactor::read_op, p.p, is_continuation, true, - buffer_sequence_adapter::all_empty(buffers)); - p.v = p.p = 0; - } - - // Wait until data can be read without blocking. - template - void async_read_some(implementation_type& impl, - const null_buffers&, Handler& handler) - { - bool is_continuation = - asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_null_buffers_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(handler); - - ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "descriptor", - &impl, impl.descriptor_, "async_read_some(null_buffers)")); - - start_op(impl, reactor::read_op, p.p, is_continuation, false, false); - p.v = p.p = 0; - } - -private: - // Start the asynchronous operation. - ASIO_DECL void start_op(implementation_type& impl, int op_type, - reactor_op* op, bool is_continuation, bool is_non_blocking, bool noop); - - // The selector that performs event demultiplexing for the service. - reactor& reactor_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/reactive_descriptor_service.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // !defined(ASIO_WINDOWS) - // && !defined(ASIO_WINDOWS_RUNTIME) - // && !defined(__CYGWIN__) - -#endif // ASIO_DETAIL_REACTIVE_DESCRIPTOR_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/detail/reactive_null_buffers_op.hpp b/tools/sdk/include/asio/asio/detail/reactive_null_buffers_op.hpp deleted file mode 100644 index 740826928dd..00000000000 --- a/tools/sdk/include/asio/asio/detail/reactive_null_buffers_op.hpp +++ /dev/null @@ -1,90 +0,0 @@ -// -// detail/reactive_null_buffers_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_REACTIVE_NULL_BUFFERS_OP_HPP -#define ASIO_DETAIL_REACTIVE_NULL_BUFFERS_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/reactor_op.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class reactive_null_buffers_op : public reactor_op -{ -public: - ASIO_DEFINE_HANDLER_PTR(reactive_null_buffers_op); - - reactive_null_buffers_op(Handler& handler) - : reactor_op(&reactive_null_buffers_op::do_perform, - &reactive_null_buffers_op::do_complete), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static status do_perform(reactor_op*) - { - return done; - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& /*ec*/, - std::size_t /*bytes_transferred*/) - { - // Take ownership of the handler object. - reactive_null_buffers_op* o(static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - ASIO_HANDLER_COMPLETION((*o)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder2 - handler(o->handler_, o->ec_, o->bytes_transferred_); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_REACTIVE_NULL_BUFFERS_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/reactive_serial_port_service.hpp b/tools/sdk/include/asio/asio/detail/reactive_serial_port_service.hpp deleted file mode 100644 index 6fddd9f1aac..00000000000 --- a/tools/sdk/include/asio/asio/detail/reactive_serial_port_service.hpp +++ /dev/null @@ -1,236 +0,0 @@ -// -// detail/reactive_serial_port_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_REACTIVE_SERIAL_PORT_SERVICE_HPP -#define ASIO_DETAIL_REACTIVE_SERIAL_PORT_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_SERIAL_PORT) -#if !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) - -#include -#include "asio/error.hpp" -#include "asio/io_context.hpp" -#include "asio/serial_port_base.hpp" -#include "asio/detail/descriptor_ops.hpp" -#include "asio/detail/reactive_descriptor_service.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -// Extend reactive_descriptor_service to provide serial port support. -class reactive_serial_port_service : - public service_base -{ -public: - // The native type of a serial port. - typedef reactive_descriptor_service::native_handle_type native_handle_type; - - // The implementation type of the serial port. - typedef reactive_descriptor_service::implementation_type implementation_type; - - ASIO_DECL reactive_serial_port_service( - asio::io_context& io_context); - - // Destroy all user-defined handler objects owned by the service. - ASIO_DECL void shutdown(); - - // Construct a new serial port implementation. - void construct(implementation_type& impl) - { - descriptor_service_.construct(impl); - } - - // Move-construct a new serial port implementation. - void move_construct(implementation_type& impl, - implementation_type& other_impl) - { - descriptor_service_.move_construct(impl, other_impl); - } - - // Move-assign from another serial port implementation. - void move_assign(implementation_type& impl, - reactive_serial_port_service& other_service, - implementation_type& other_impl) - { - descriptor_service_.move_assign(impl, - other_service.descriptor_service_, other_impl); - } - - // Destroy a serial port implementation. - void destroy(implementation_type& impl) - { - descriptor_service_.destroy(impl); - } - - // Open the serial port using the specified device name. - ASIO_DECL asio::error_code open(implementation_type& impl, - const std::string& device, asio::error_code& ec); - - // Assign a native descriptor to a serial port implementation. - asio::error_code assign(implementation_type& impl, - const native_handle_type& native_descriptor, - asio::error_code& ec) - { - return descriptor_service_.assign(impl, native_descriptor, ec); - } - - // Determine whether the serial port is open. - bool is_open(const implementation_type& impl) const - { - return descriptor_service_.is_open(impl); - } - - // Destroy a serial port implementation. - asio::error_code close(implementation_type& impl, - asio::error_code& ec) - { - return descriptor_service_.close(impl, ec); - } - - // Get the native serial port representation. - native_handle_type native_handle(implementation_type& impl) - { - return descriptor_service_.native_handle(impl); - } - - // Cancel all operations associated with the serial port. - asio::error_code cancel(implementation_type& impl, - asio::error_code& ec) - { - return descriptor_service_.cancel(impl, ec); - } - - // Set an option on the serial port. - template - asio::error_code set_option(implementation_type& impl, - const SettableSerialPortOption& option, asio::error_code& ec) - { - return do_set_option(impl, - &reactive_serial_port_service::store_option, - &option, ec); - } - - // Get an option from the serial port. - template - asio::error_code get_option(const implementation_type& impl, - GettableSerialPortOption& option, asio::error_code& ec) const - { - return do_get_option(impl, - &reactive_serial_port_service::load_option, - &option, ec); - } - - // Send a break sequence to the serial port. - asio::error_code send_break(implementation_type& impl, - asio::error_code& ec) - { - errno = 0; - descriptor_ops::error_wrapper(::tcsendbreak( - descriptor_service_.native_handle(impl), 0), ec); - return ec; - } - - // Write the given data. Returns the number of bytes sent. - template - size_t write_some(implementation_type& impl, - const ConstBufferSequence& buffers, asio::error_code& ec) - { - return descriptor_service_.write_some(impl, buffers, ec); - } - - // Start an asynchronous write. The data being written must be valid for the - // lifetime of the asynchronous operation. - template - void async_write_some(implementation_type& impl, - const ConstBufferSequence& buffers, Handler& handler) - { - descriptor_service_.async_write_some(impl, buffers, handler); - } - - // Read some data. Returns the number of bytes received. - template - size_t read_some(implementation_type& impl, - const MutableBufferSequence& buffers, asio::error_code& ec) - { - return descriptor_service_.read_some(impl, buffers, ec); - } - - // Start an asynchronous read. The buffer for the data being received must be - // valid for the lifetime of the asynchronous operation. - template - void async_read_some(implementation_type& impl, - const MutableBufferSequence& buffers, Handler& handler) - { - descriptor_service_.async_read_some(impl, buffers, handler); - } - -private: - // Function pointer type for storing a serial port option. - typedef asio::error_code (*store_function_type)( - const void*, termios&, asio::error_code&); - - // Helper function template to store a serial port option. - template - static asio::error_code store_option(const void* option, - termios& storage, asio::error_code& ec) - { - static_cast(option)->store(storage, ec); - return ec; - } - - // Helper function to set a serial port option. - ASIO_DECL asio::error_code do_set_option( - implementation_type& impl, store_function_type store, - const void* option, asio::error_code& ec); - - // Function pointer type for loading a serial port option. - typedef asio::error_code (*load_function_type)( - void*, const termios&, asio::error_code&); - - // Helper function template to load a serial port option. - template - static asio::error_code load_option(void* option, - const termios& storage, asio::error_code& ec) - { - static_cast(option)->load(storage, ec); - return ec; - } - - // Helper function to get a serial port option. - ASIO_DECL asio::error_code do_get_option( - const implementation_type& impl, load_function_type load, - void* option, asio::error_code& ec) const; - - // The implementation used for initiating asynchronous operations. - reactive_descriptor_service descriptor_service_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/reactive_serial_port_service.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) -#endif // defined(ASIO_HAS_SERIAL_PORT) - -#endif // ASIO_DETAIL_REACTIVE_SERIAL_PORT_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/detail/reactive_socket_accept_op.hpp b/tools/sdk/include/asio/asio/detail/reactive_socket_accept_op.hpp deleted file mode 100644 index 4a98f047f78..00000000000 --- a/tools/sdk/include/asio/asio/detail/reactive_socket_accept_op.hpp +++ /dev/null @@ -1,217 +0,0 @@ -// -// detail/reactive_socket_accept_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_REACTIVE_SOCKET_ACCEPT_OP_HPP -#define ASIO_DETAIL_REACTIVE_SOCKET_ACCEPT_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/reactor_op.hpp" -#include "asio/detail/socket_holder.hpp" -#include "asio/detail/socket_ops.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class reactive_socket_accept_op_base : public reactor_op -{ -public: - reactive_socket_accept_op_base(socket_type socket, - socket_ops::state_type state, Socket& peer, const Protocol& protocol, - typename Protocol::endpoint* peer_endpoint, func_type complete_func) - : reactor_op(&reactive_socket_accept_op_base::do_perform, complete_func), - socket_(socket), - state_(state), - peer_(peer), - protocol_(protocol), - peer_endpoint_(peer_endpoint), - addrlen_(peer_endpoint ? peer_endpoint->capacity() : 0) - { - } - - static status do_perform(reactor_op* base) - { - reactive_socket_accept_op_base* o( - static_cast(base)); - - socket_type new_socket = invalid_socket; - status result = socket_ops::non_blocking_accept(o->socket_, - o->state_, o->peer_endpoint_ ? o->peer_endpoint_->data() : 0, - o->peer_endpoint_ ? &o->addrlen_ : 0, o->ec_, new_socket) - ? done : not_done; - o->new_socket_.reset(new_socket); - - ASIO_HANDLER_REACTOR_OPERATION((*o, "non_blocking_accept", o->ec_)); - - return result; - } - - void do_assign() - { - if (new_socket_.get() != invalid_socket) - { - if (peer_endpoint_) - peer_endpoint_->resize(addrlen_); - peer_.assign(protocol_, new_socket_.get(), ec_); - if (!ec_) - new_socket_.release(); - } - } - -private: - socket_type socket_; - socket_ops::state_type state_; - socket_holder new_socket_; - Socket& peer_; - Protocol protocol_; - typename Protocol::endpoint* peer_endpoint_; - std::size_t addrlen_; -}; - -template -class reactive_socket_accept_op : - public reactive_socket_accept_op_base -{ -public: - ASIO_DEFINE_HANDLER_PTR(reactive_socket_accept_op); - - reactive_socket_accept_op(socket_type socket, - socket_ops::state_type state, Socket& peer, const Protocol& protocol, - typename Protocol::endpoint* peer_endpoint, Handler& handler) - : reactive_socket_accept_op_base(socket, state, peer, - protocol, peer_endpoint, &reactive_socket_accept_op::do_complete), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& /*ec*/, - std::size_t /*bytes_transferred*/) - { - // Take ownership of the handler object. - reactive_socket_accept_op* o(static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - // On success, assign new connection to peer socket object. - if (owner) - o->do_assign(); - - ASIO_HANDLER_COMPLETION((*o)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder1 - handler(o->handler_, o->ec_); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Handler handler_; -}; - -#if defined(ASIO_HAS_MOVE) - -template -class reactive_socket_move_accept_op : - private Protocol::socket, - public reactive_socket_accept_op_base -{ -public: - ASIO_DEFINE_HANDLER_PTR(reactive_socket_move_accept_op); - - reactive_socket_move_accept_op(io_context& ioc, socket_type socket, - socket_ops::state_type state, const Protocol& protocol, - typename Protocol::endpoint* peer_endpoint, Handler& handler) - : Protocol::socket(ioc), - reactive_socket_accept_op_base( - socket, state, *this, protocol, peer_endpoint, - &reactive_socket_move_accept_op::do_complete), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& /*ec*/, - std::size_t /*bytes_transferred*/) - { - // Take ownership of the handler object. - reactive_socket_move_accept_op* o( - static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - // On success, assign new connection to peer socket object. - if (owner) - o->do_assign(); - - ASIO_HANDLER_COMPLETION((*o)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::move_binder2 - handler(0, ASIO_MOVE_CAST(Handler)(o->handler_), o->ec_, - ASIO_MOVE_CAST(typename Protocol::socket)(*o)); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, "...")); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Handler handler_; -}; - -#endif // defined(ASIO_HAS_MOVE) - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_REACTIVE_SOCKET_ACCEPT_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/reactive_socket_connect_op.hpp b/tools/sdk/include/asio/asio/detail/reactive_socket_connect_op.hpp deleted file mode 100644 index 76164b2a8ed..00000000000 --- a/tools/sdk/include/asio/asio/detail/reactive_socket_connect_op.hpp +++ /dev/null @@ -1,113 +0,0 @@ -// -// detail/reactive_socket_connect_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_REACTIVE_SOCKET_CONNECT_OP_HPP -#define ASIO_DETAIL_REACTIVE_SOCKET_CONNECT_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/reactor_op.hpp" -#include "asio/detail/socket_ops.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class reactive_socket_connect_op_base : public reactor_op -{ -public: - reactive_socket_connect_op_base(socket_type socket, func_type complete_func) - : reactor_op(&reactive_socket_connect_op_base::do_perform, complete_func), - socket_(socket) - { - } - - static status do_perform(reactor_op* base) - { - reactive_socket_connect_op_base* o( - static_cast(base)); - - status result = socket_ops::non_blocking_connect( - o->socket_, o->ec_) ? done : not_done; - - ASIO_HANDLER_REACTOR_OPERATION((*o, "non_blocking_connect", o->ec_)); - - return result; - } - -private: - socket_type socket_; -}; - -template -class reactive_socket_connect_op : public reactive_socket_connect_op_base -{ -public: - ASIO_DEFINE_HANDLER_PTR(reactive_socket_connect_op); - - reactive_socket_connect_op(socket_type socket, Handler& handler) - : reactive_socket_connect_op_base(socket, - &reactive_socket_connect_op::do_complete), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& /*ec*/, - std::size_t /*bytes_transferred*/) - { - // Take ownership of the handler object. - reactive_socket_connect_op* o - (static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - ASIO_HANDLER_COMPLETION((*o)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder1 - handler(o->handler_, o->ec_); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_REACTIVE_SOCKET_CONNECT_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/reactive_socket_recv_op.hpp b/tools/sdk/include/asio/asio/detail/reactive_socket_recv_op.hpp deleted file mode 100644 index 04bd266f9cf..00000000000 --- a/tools/sdk/include/asio/asio/detail/reactive_socket_recv_op.hpp +++ /dev/null @@ -1,135 +0,0 @@ -// -// detail/reactive_socket_recv_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_REACTIVE_SOCKET_RECV_OP_HPP -#define ASIO_DETAIL_REACTIVE_SOCKET_RECV_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/reactor_op.hpp" -#include "asio/detail/socket_ops.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class reactive_socket_recv_op_base : public reactor_op -{ -public: - reactive_socket_recv_op_base(socket_type socket, - socket_ops::state_type state, const MutableBufferSequence& buffers, - socket_base::message_flags flags, func_type complete_func) - : reactor_op(&reactive_socket_recv_op_base::do_perform, complete_func), - socket_(socket), - state_(state), - buffers_(buffers), - flags_(flags) - { - } - - static status do_perform(reactor_op* base) - { - reactive_socket_recv_op_base* o( - static_cast(base)); - - buffer_sequence_adapter bufs(o->buffers_); - - status result = socket_ops::non_blocking_recv(o->socket_, - bufs.buffers(), bufs.count(), o->flags_, - (o->state_ & socket_ops::stream_oriented) != 0, - o->ec_, o->bytes_transferred_) ? done : not_done; - - if (result == done) - if ((o->state_ & socket_ops::stream_oriented) != 0) - if (o->bytes_transferred_ == 0) - result = done_and_exhausted; - - ASIO_HANDLER_REACTOR_OPERATION((*o, "non_blocking_recv", - o->ec_, o->bytes_transferred_)); - - return result; - } - -private: - socket_type socket_; - socket_ops::state_type state_; - MutableBufferSequence buffers_; - socket_base::message_flags flags_; -}; - -template -class reactive_socket_recv_op : - public reactive_socket_recv_op_base -{ -public: - ASIO_DEFINE_HANDLER_PTR(reactive_socket_recv_op); - - reactive_socket_recv_op(socket_type socket, - socket_ops::state_type state, const MutableBufferSequence& buffers, - socket_base::message_flags flags, Handler& handler) - : reactive_socket_recv_op_base(socket, state, - buffers, flags, &reactive_socket_recv_op::do_complete), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& /*ec*/, - std::size_t /*bytes_transferred*/) - { - // Take ownership of the handler object. - reactive_socket_recv_op* o(static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - ASIO_HANDLER_COMPLETION((*o)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder2 - handler(o->handler_, o->ec_, o->bytes_transferred_); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_REACTIVE_SOCKET_RECV_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/reactive_socket_recvfrom_op.hpp b/tools/sdk/include/asio/asio/detail/reactive_socket_recvfrom_op.hpp deleted file mode 100644 index 3d4fa4cadf7..00000000000 --- a/tools/sdk/include/asio/asio/detail/reactive_socket_recvfrom_op.hpp +++ /dev/null @@ -1,138 +0,0 @@ -// -// detail/reactive_socket_recvfrom_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_REACTIVE_SOCKET_RECVFROM_OP_HPP -#define ASIO_DETAIL_REACTIVE_SOCKET_RECVFROM_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/reactor_op.hpp" -#include "asio/detail/socket_ops.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class reactive_socket_recvfrom_op_base : public reactor_op -{ -public: - reactive_socket_recvfrom_op_base(socket_type socket, int protocol_type, - const MutableBufferSequence& buffers, Endpoint& endpoint, - socket_base::message_flags flags, func_type complete_func) - : reactor_op(&reactive_socket_recvfrom_op_base::do_perform, complete_func), - socket_(socket), - protocol_type_(protocol_type), - buffers_(buffers), - sender_endpoint_(endpoint), - flags_(flags) - { - } - - static status do_perform(reactor_op* base) - { - reactive_socket_recvfrom_op_base* o( - static_cast(base)); - - buffer_sequence_adapter bufs(o->buffers_); - - std::size_t addr_len = o->sender_endpoint_.capacity(); - status result = socket_ops::non_blocking_recvfrom(o->socket_, - bufs.buffers(), bufs.count(), o->flags_, - o->sender_endpoint_.data(), &addr_len, - o->ec_, o->bytes_transferred_) ? done : not_done; - - if (result && !o->ec_) - o->sender_endpoint_.resize(addr_len); - - ASIO_HANDLER_REACTOR_OPERATION((*o, "non_blocking_recvfrom", - o->ec_, o->bytes_transferred_)); - - return result; - } - -private: - socket_type socket_; - int protocol_type_; - MutableBufferSequence buffers_; - Endpoint& sender_endpoint_; - socket_base::message_flags flags_; -}; - -template -class reactive_socket_recvfrom_op : - public reactive_socket_recvfrom_op_base -{ -public: - ASIO_DEFINE_HANDLER_PTR(reactive_socket_recvfrom_op); - - reactive_socket_recvfrom_op(socket_type socket, int protocol_type, - const MutableBufferSequence& buffers, Endpoint& endpoint, - socket_base::message_flags flags, Handler& handler) - : reactive_socket_recvfrom_op_base( - socket, protocol_type, buffers, endpoint, flags, - &reactive_socket_recvfrom_op::do_complete), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& /*ec*/, - std::size_t /*bytes_transferred*/) - { - // Take ownership of the handler object. - reactive_socket_recvfrom_op* o( - static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - ASIO_HANDLER_COMPLETION((*o)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder2 - handler(o->handler_, o->ec_, o->bytes_transferred_); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_REACTIVE_SOCKET_RECVFROM_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/reactive_socket_recvmsg_op.hpp b/tools/sdk/include/asio/asio/detail/reactive_socket_recvmsg_op.hpp deleted file mode 100644 index f473274724a..00000000000 --- a/tools/sdk/include/asio/asio/detail/reactive_socket_recvmsg_op.hpp +++ /dev/null @@ -1,132 +0,0 @@ -// -// detail/reactive_socket_recvmsg_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_REACTIVE_SOCKET_RECVMSG_OP_HPP -#define ASIO_DETAIL_REACTIVE_SOCKET_RECVMSG_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/reactor_op.hpp" -#include "asio/detail/socket_ops.hpp" -#include "asio/socket_base.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class reactive_socket_recvmsg_op_base : public reactor_op -{ -public: - reactive_socket_recvmsg_op_base(socket_type socket, - const MutableBufferSequence& buffers, socket_base::message_flags in_flags, - socket_base::message_flags& out_flags, func_type complete_func) - : reactor_op(&reactive_socket_recvmsg_op_base::do_perform, complete_func), - socket_(socket), - buffers_(buffers), - in_flags_(in_flags), - out_flags_(out_flags) - { - } - - static status do_perform(reactor_op* base) - { - reactive_socket_recvmsg_op_base* o( - static_cast(base)); - - buffer_sequence_adapter bufs(o->buffers_); - - status result = socket_ops::non_blocking_recvmsg(o->socket_, - bufs.buffers(), bufs.count(), - o->in_flags_, o->out_flags_, - o->ec_, o->bytes_transferred_) ? done : not_done; - - ASIO_HANDLER_REACTOR_OPERATION((*o, "non_blocking_recvmsg", - o->ec_, o->bytes_transferred_)); - - return result; - } - -private: - socket_type socket_; - MutableBufferSequence buffers_; - socket_base::message_flags in_flags_; - socket_base::message_flags& out_flags_; -}; - -template -class reactive_socket_recvmsg_op : - public reactive_socket_recvmsg_op_base -{ -public: - ASIO_DEFINE_HANDLER_PTR(reactive_socket_recvmsg_op); - - reactive_socket_recvmsg_op(socket_type socket, - const MutableBufferSequence& buffers, socket_base::message_flags in_flags, - socket_base::message_flags& out_flags, Handler& handler) - : reactive_socket_recvmsg_op_base(socket, buffers, - in_flags, out_flags, &reactive_socket_recvmsg_op::do_complete), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& /*ec*/, - std::size_t /*bytes_transferred*/) - { - // Take ownership of the handler object. - reactive_socket_recvmsg_op* o( - static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - ASIO_HANDLER_COMPLETION((*o)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder2 - handler(o->handler_, o->ec_, o->bytes_transferred_); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_REACTIVE_SOCKET_RECVMSG_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/reactive_socket_send_op.hpp b/tools/sdk/include/asio/asio/detail/reactive_socket_send_op.hpp deleted file mode 100644 index bd550d9c5ea..00000000000 --- a/tools/sdk/include/asio/asio/detail/reactive_socket_send_op.hpp +++ /dev/null @@ -1,134 +0,0 @@ -// -// detail/reactive_socket_send_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_REACTIVE_SOCKET_SEND_OP_HPP -#define ASIO_DETAIL_REACTIVE_SOCKET_SEND_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/reactor_op.hpp" -#include "asio/detail/socket_ops.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class reactive_socket_send_op_base : public reactor_op -{ -public: - reactive_socket_send_op_base(socket_type socket, - socket_ops::state_type state, const ConstBufferSequence& buffers, - socket_base::message_flags flags, func_type complete_func) - : reactor_op(&reactive_socket_send_op_base::do_perform, complete_func), - socket_(socket), - state_(state), - buffers_(buffers), - flags_(flags) - { - } - - static status do_perform(reactor_op* base) - { - reactive_socket_send_op_base* o( - static_cast(base)); - - buffer_sequence_adapter bufs(o->buffers_); - - status result = socket_ops::non_blocking_send(o->socket_, - bufs.buffers(), bufs.count(), o->flags_, - o->ec_, o->bytes_transferred_) ? done : not_done; - - if (result == done) - if ((o->state_ & socket_ops::stream_oriented) != 0) - if (o->bytes_transferred_ < bufs.total_size()) - result = done_and_exhausted; - - ASIO_HANDLER_REACTOR_OPERATION((*o, "non_blocking_send", - o->ec_, o->bytes_transferred_)); - - return result; - } - -private: - socket_type socket_; - socket_ops::state_type state_; - ConstBufferSequence buffers_; - socket_base::message_flags flags_; -}; - -template -class reactive_socket_send_op : - public reactive_socket_send_op_base -{ -public: - ASIO_DEFINE_HANDLER_PTR(reactive_socket_send_op); - - reactive_socket_send_op(socket_type socket, - socket_ops::state_type state, const ConstBufferSequence& buffers, - socket_base::message_flags flags, Handler& handler) - : reactive_socket_send_op_base(socket, - state, buffers, flags, &reactive_socket_send_op::do_complete), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& /*ec*/, - std::size_t /*bytes_transferred*/) - { - // Take ownership of the handler object. - reactive_socket_send_op* o(static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - ASIO_HANDLER_COMPLETION((*o)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder2 - handler(o->handler_, o->ec_, o->bytes_transferred_); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_REACTIVE_SOCKET_SEND_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/reactive_socket_sendto_op.hpp b/tools/sdk/include/asio/asio/detail/reactive_socket_sendto_op.hpp deleted file mode 100644 index c97554d7b68..00000000000 --- a/tools/sdk/include/asio/asio/detail/reactive_socket_sendto_op.hpp +++ /dev/null @@ -1,130 +0,0 @@ -// -// detail/reactive_socket_sendto_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_REACTIVE_SOCKET_SENDTO_OP_HPP -#define ASIO_DETAIL_REACTIVE_SOCKET_SENDTO_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/reactor_op.hpp" -#include "asio/detail/socket_ops.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class reactive_socket_sendto_op_base : public reactor_op -{ -public: - reactive_socket_sendto_op_base(socket_type socket, - const ConstBufferSequence& buffers, const Endpoint& endpoint, - socket_base::message_flags flags, func_type complete_func) - : reactor_op(&reactive_socket_sendto_op_base::do_perform, complete_func), - socket_(socket), - buffers_(buffers), - destination_(endpoint), - flags_(flags) - { - } - - static status do_perform(reactor_op* base) - { - reactive_socket_sendto_op_base* o( - static_cast(base)); - - buffer_sequence_adapter bufs(o->buffers_); - - status result = socket_ops::non_blocking_sendto(o->socket_, - bufs.buffers(), bufs.count(), o->flags_, - o->destination_.data(), o->destination_.size(), - o->ec_, o->bytes_transferred_) ? done : not_done; - - ASIO_HANDLER_REACTOR_OPERATION((*o, "non_blocking_sendto", - o->ec_, o->bytes_transferred_)); - - return result; - } - -private: - socket_type socket_; - ConstBufferSequence buffers_; - Endpoint destination_; - socket_base::message_flags flags_; -}; - -template -class reactive_socket_sendto_op : - public reactive_socket_sendto_op_base -{ -public: - ASIO_DEFINE_HANDLER_PTR(reactive_socket_sendto_op); - - reactive_socket_sendto_op(socket_type socket, - const ConstBufferSequence& buffers, const Endpoint& endpoint, - socket_base::message_flags flags, Handler& handler) - : reactive_socket_sendto_op_base(socket, - buffers, endpoint, flags, &reactive_socket_sendto_op::do_complete), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& /*ec*/, - std::size_t /*bytes_transferred*/) - { - // Take ownership of the handler object. - reactive_socket_sendto_op* o(static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - ASIO_HANDLER_COMPLETION((*o)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder2 - handler(o->handler_, o->ec_, o->bytes_transferred_); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_REACTIVE_SOCKET_SENDTO_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/reactive_socket_service.hpp b/tools/sdk/include/asio/asio/detail/reactive_socket_service.hpp deleted file mode 100644 index 15a4fdb588e..00000000000 --- a/tools/sdk/include/asio/asio/detail/reactive_socket_service.hpp +++ /dev/null @@ -1,526 +0,0 @@ -// -// detail/reactive_socket_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_HPP -#define ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_HAS_IOCP) - -#include "asio/buffer.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" -#include "asio/socket_base.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/reactive_null_buffers_op.hpp" -#include "asio/detail/reactive_socket_accept_op.hpp" -#include "asio/detail/reactive_socket_connect_op.hpp" -#include "asio/detail/reactive_socket_recvfrom_op.hpp" -#include "asio/detail/reactive_socket_sendto_op.hpp" -#include "asio/detail/reactive_socket_service_base.hpp" -#include "asio/detail/reactor.hpp" -#include "asio/detail/reactor_op.hpp" -#include "asio/detail/socket_holder.hpp" -#include "asio/detail/socket_ops.hpp" -#include "asio/detail/socket_types.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class reactive_socket_service : - public service_base >, - public reactive_socket_service_base -{ -public: - // The protocol type. - typedef Protocol protocol_type; - - // The endpoint type. - typedef typename Protocol::endpoint endpoint_type; - - // The native type of a socket. - typedef socket_type native_handle_type; - - // The implementation type of the socket. - struct implementation_type : - reactive_socket_service_base::base_implementation_type - { - // Default constructor. - implementation_type() - : protocol_(endpoint_type().protocol()) - { - } - - // The protocol associated with the socket. - protocol_type protocol_; - }; - - // Constructor. - reactive_socket_service(asio::io_context& io_context) - : service_base >(io_context), - reactive_socket_service_base(io_context) - { - } - - // Destroy all user-defined handler objects owned by the service. - void shutdown() - { - this->base_shutdown(); - } - - // Move-construct a new socket implementation. - void move_construct(implementation_type& impl, - implementation_type& other_impl) - { - this->base_move_construct(impl, other_impl); - - impl.protocol_ = other_impl.protocol_; - other_impl.protocol_ = endpoint_type().protocol(); - } - - // Move-assign from another socket implementation. - void move_assign(implementation_type& impl, - reactive_socket_service_base& other_service, - implementation_type& other_impl) - { - this->base_move_assign(impl, other_service, other_impl); - - impl.protocol_ = other_impl.protocol_; - other_impl.protocol_ = endpoint_type().protocol(); - } - - // Move-construct a new socket implementation from another protocol type. - template - void converting_move_construct(implementation_type& impl, - reactive_socket_service&, - typename reactive_socket_service< - Protocol1>::implementation_type& other_impl) - { - this->base_move_construct(impl, other_impl); - - impl.protocol_ = protocol_type(other_impl.protocol_); - other_impl.protocol_ = typename Protocol1::endpoint().protocol(); - } - - // Open a new socket implementation. - asio::error_code open(implementation_type& impl, - const protocol_type& protocol, asio::error_code& ec) - { - if (!do_open(impl, protocol.family(), - protocol.type(), protocol.protocol(), ec)) - impl.protocol_ = protocol; - return ec; - } - - // Assign a native socket to a socket implementation. - asio::error_code assign(implementation_type& impl, - const protocol_type& protocol, const native_handle_type& native_socket, - asio::error_code& ec) - { - if (!do_assign(impl, protocol.type(), native_socket, ec)) - impl.protocol_ = protocol; - return ec; - } - - // Get the native socket representation. - native_handle_type native_handle(implementation_type& impl) - { - return impl.socket_; - } - - // Bind the socket to the specified local endpoint. - asio::error_code bind(implementation_type& impl, - const endpoint_type& endpoint, asio::error_code& ec) - { - socket_ops::bind(impl.socket_, endpoint.data(), endpoint.size(), ec); - return ec; - } - - // Set a socket option. - template - asio::error_code set_option(implementation_type& impl, - const Option& option, asio::error_code& ec) - { - socket_ops::setsockopt(impl.socket_, impl.state_, - option.level(impl.protocol_), option.name(impl.protocol_), - option.data(impl.protocol_), option.size(impl.protocol_), ec); - return ec; - } - - // Set a socket option. - template - asio::error_code get_option(const implementation_type& impl, - Option& option, asio::error_code& ec) const - { - std::size_t size = option.size(impl.protocol_); - socket_ops::getsockopt(impl.socket_, impl.state_, - option.level(impl.protocol_), option.name(impl.protocol_), - option.data(impl.protocol_), &size, ec); - if (!ec) - option.resize(impl.protocol_, size); - return ec; - } - - // Get the local endpoint. - endpoint_type local_endpoint(const implementation_type& impl, - asio::error_code& ec) const - { - endpoint_type endpoint; - std::size_t addr_len = endpoint.capacity(); - if (socket_ops::getsockname(impl.socket_, endpoint.data(), &addr_len, ec)) - return endpoint_type(); - endpoint.resize(addr_len); - return endpoint; - } - - // Get the remote endpoint. - endpoint_type remote_endpoint(const implementation_type& impl, - asio::error_code& ec) const - { - endpoint_type endpoint; - std::size_t addr_len = endpoint.capacity(); - if (socket_ops::getpeername(impl.socket_, - endpoint.data(), &addr_len, false, ec)) - return endpoint_type(); - endpoint.resize(addr_len); - return endpoint; - } - - // Disable sends or receives on the socket. - asio::error_code shutdown(base_implementation_type& impl, - socket_base::shutdown_type what, asio::error_code& ec) - { - socket_ops::shutdown(impl.socket_, what, ec); - return ec; - } - - // Send a datagram to the specified endpoint. Returns the number of bytes - // sent. - template - size_t send_to(implementation_type& impl, const ConstBufferSequence& buffers, - const endpoint_type& destination, socket_base::message_flags flags, - asio::error_code& ec) - { - buffer_sequence_adapter bufs(buffers); - - return socket_ops::sync_sendto(impl.socket_, impl.state_, - bufs.buffers(), bufs.count(), flags, - destination.data(), destination.size(), ec); - } - - // Wait until data can be sent without blocking. - size_t send_to(implementation_type& impl, const null_buffers&, - const endpoint_type&, socket_base::message_flags, - asio::error_code& ec) - { - // Wait for socket to become ready. - socket_ops::poll_write(impl.socket_, impl.state_, -1, ec); - - return 0; - } - - // Start an asynchronous send. The data being sent must be valid for the - // lifetime of the asynchronous operation. - template - void async_send_to(implementation_type& impl, - const ConstBufferSequence& buffers, - const endpoint_type& destination, socket_base::message_flags flags, - Handler& handler) - { - bool is_continuation = - asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_socket_sendto_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(impl.socket_, buffers, destination, flags, handler); - - ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_send_to")); - - start_op(impl, reactor::write_op, p.p, is_continuation, true, false); - p.v = p.p = 0; - } - - // Start an asynchronous wait until data can be sent without blocking. - template - void async_send_to(implementation_type& impl, const null_buffers&, - const endpoint_type&, socket_base::message_flags, Handler& handler) - { - bool is_continuation = - asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_null_buffers_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(handler); - - ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_send_to(null_buffers)")); - - start_op(impl, reactor::write_op, p.p, is_continuation, false, false); - p.v = p.p = 0; - } - - // Receive a datagram with the endpoint of the sender. Returns the number of - // bytes received. - template - size_t receive_from(implementation_type& impl, - const MutableBufferSequence& buffers, - endpoint_type& sender_endpoint, socket_base::message_flags flags, - asio::error_code& ec) - { - buffer_sequence_adapter bufs(buffers); - - std::size_t addr_len = sender_endpoint.capacity(); - std::size_t bytes_recvd = socket_ops::sync_recvfrom( - impl.socket_, impl.state_, bufs.buffers(), bufs.count(), - flags, sender_endpoint.data(), &addr_len, ec); - - if (!ec) - sender_endpoint.resize(addr_len); - - return bytes_recvd; - } - - // Wait until data can be received without blocking. - size_t receive_from(implementation_type& impl, const null_buffers&, - endpoint_type& sender_endpoint, socket_base::message_flags, - asio::error_code& ec) - { - // Wait for socket to become ready. - socket_ops::poll_read(impl.socket_, impl.state_, -1, ec); - - // Reset endpoint since it can be given no sensible value at this time. - sender_endpoint = endpoint_type(); - - return 0; - } - - // Start an asynchronous receive. The buffer for the data being received and - // the sender_endpoint object must both be valid for the lifetime of the - // asynchronous operation. - template - void async_receive_from(implementation_type& impl, - const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, - socket_base::message_flags flags, Handler& handler) - { - bool is_continuation = - asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_socket_recvfrom_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - int protocol = impl.protocol_.type(); - p.p = new (p.v) op(impl.socket_, protocol, - buffers, sender_endpoint, flags, handler); - - ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_receive_from")); - - start_op(impl, - (flags & socket_base::message_out_of_band) - ? reactor::except_op : reactor::read_op, - p.p, is_continuation, true, false); - p.v = p.p = 0; - } - - // Wait until data can be received without blocking. - template - void async_receive_from(implementation_type& impl, - const null_buffers&, endpoint_type& sender_endpoint, - socket_base::message_flags flags, Handler& handler) - { - bool is_continuation = - asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_null_buffers_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(handler); - - ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_receive_from(null_buffers)")); - - // Reset endpoint since it can be given no sensible value at this time. - sender_endpoint = endpoint_type(); - - start_op(impl, - (flags & socket_base::message_out_of_band) - ? reactor::except_op : reactor::read_op, - p.p, is_continuation, false, false); - p.v = p.p = 0; - } - - // Accept a new connection. - template - asio::error_code accept(implementation_type& impl, - Socket& peer, endpoint_type* peer_endpoint, asio::error_code& ec) - { - // We cannot accept a socket that is already open. - if (peer.is_open()) - { - ec = asio::error::already_open; - return ec; - } - - std::size_t addr_len = peer_endpoint ? peer_endpoint->capacity() : 0; - socket_holder new_socket(socket_ops::sync_accept(impl.socket_, - impl.state_, peer_endpoint ? peer_endpoint->data() : 0, - peer_endpoint ? &addr_len : 0, ec)); - - // On success, assign new connection to peer socket object. - if (new_socket.get() != invalid_socket) - { - if (peer_endpoint) - peer_endpoint->resize(addr_len); - peer.assign(impl.protocol_, new_socket.get(), ec); - if (!ec) - new_socket.release(); - } - - return ec; - } - -#if defined(ASIO_HAS_MOVE) - // Accept a new connection. - typename Protocol::socket accept(implementation_type& impl, - io_context* peer_io_context, endpoint_type* peer_endpoint, - asio::error_code& ec) - { - typename Protocol::socket peer( - peer_io_context ? *peer_io_context : io_context_); - - std::size_t addr_len = peer_endpoint ? peer_endpoint->capacity() : 0; - socket_holder new_socket(socket_ops::sync_accept(impl.socket_, - impl.state_, peer_endpoint ? peer_endpoint->data() : 0, - peer_endpoint ? &addr_len : 0, ec)); - - // On success, assign new connection to peer socket object. - if (new_socket.get() != invalid_socket) - { - if (peer_endpoint) - peer_endpoint->resize(addr_len); - peer.assign(impl.protocol_, new_socket.get(), ec); - if (!ec) - new_socket.release(); - } - - return peer; - } -#endif // defined(ASIO_HAS_MOVE) - - // Start an asynchronous accept. The peer and peer_endpoint objects must be - // valid until the accept's handler is invoked. - template - void async_accept(implementation_type& impl, Socket& peer, - endpoint_type* peer_endpoint, Handler& handler) - { - bool is_continuation = - asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_socket_accept_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(impl.socket_, impl.state_, peer, - impl.protocol_, peer_endpoint, handler); - - ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_accept")); - - start_accept_op(impl, p.p, is_continuation, peer.is_open()); - p.v = p.p = 0; - } - -#if defined(ASIO_HAS_MOVE) - // Start an asynchronous accept. The peer_endpoint object must be valid until - // the accept's handler is invoked. - template - void async_accept(implementation_type& impl, - asio::io_context* peer_io_context, - endpoint_type* peer_endpoint, Handler& handler) - { - bool is_continuation = - asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_socket_move_accept_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(peer_io_context ? *peer_io_context : io_context_, - impl.socket_, impl.state_, impl.protocol_, peer_endpoint, handler); - - ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_accept")); - - start_accept_op(impl, p.p, is_continuation, false); - p.v = p.p = 0; - } -#endif // defined(ASIO_HAS_MOVE) - - // Connect the socket to the specified endpoint. - asio::error_code connect(implementation_type& impl, - const endpoint_type& peer_endpoint, asio::error_code& ec) - { - socket_ops::sync_connect(impl.socket_, - peer_endpoint.data(), peer_endpoint.size(), ec); - return ec; - } - - // Start an asynchronous connect. - template - void async_connect(implementation_type& impl, - const endpoint_type& peer_endpoint, Handler& handler) - { - bool is_continuation = - asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_socket_connect_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(impl.socket_, handler); - - ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_connect")); - - start_connect_op(impl, p.p, is_continuation, - peer_endpoint.data(), peer_endpoint.size()); - p.v = p.p = 0; - } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // !defined(ASIO_HAS_IOCP) - -#endif // ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/detail/reactive_socket_service_base.hpp b/tools/sdk/include/asio/asio/detail/reactive_socket_service_base.hpp deleted file mode 100644 index ccd497e8013..00000000000 --- a/tools/sdk/include/asio/asio/detail/reactive_socket_service_base.hpp +++ /dev/null @@ -1,511 +0,0 @@ -// -// detail/reactive_socket_service_base.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_BASE_HPP -#define ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_BASE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_HAS_IOCP) \ - && !defined(ASIO_WINDOWS_RUNTIME) - -#include "asio/buffer.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" -#include "asio/socket_base.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/reactive_null_buffers_op.hpp" -#include "asio/detail/reactive_socket_recv_op.hpp" -#include "asio/detail/reactive_socket_recvmsg_op.hpp" -#include "asio/detail/reactive_socket_send_op.hpp" -#include "asio/detail/reactive_wait_op.hpp" -#include "asio/detail/reactor.hpp" -#include "asio/detail/reactor_op.hpp" -#include "asio/detail/socket_holder.hpp" -#include "asio/detail/socket_ops.hpp" -#include "asio/detail/socket_types.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class reactive_socket_service_base -{ -public: - // The native type of a socket. - typedef socket_type native_handle_type; - - // The implementation type of the socket. - struct base_implementation_type - { - // The native socket representation. - socket_type socket_; - - // The current state of the socket. - socket_ops::state_type state_; - - // Per-descriptor data used by the reactor. - reactor::per_descriptor_data reactor_data_; - }; - - // Constructor. - ASIO_DECL reactive_socket_service_base( - asio::io_context& io_context); - - // Destroy all user-defined handler objects owned by the service. - ASIO_DECL void base_shutdown(); - - // Construct a new socket implementation. - ASIO_DECL void construct(base_implementation_type& impl); - - // Move-construct a new socket implementation. - ASIO_DECL void base_move_construct(base_implementation_type& impl, - base_implementation_type& other_impl); - - // Move-assign from another socket implementation. - ASIO_DECL void base_move_assign(base_implementation_type& impl, - reactive_socket_service_base& other_service, - base_implementation_type& other_impl); - - // Destroy a socket implementation. - ASIO_DECL void destroy(base_implementation_type& impl); - - // Determine whether the socket is open. - bool is_open(const base_implementation_type& impl) const - { - return impl.socket_ != invalid_socket; - } - - // Destroy a socket implementation. - ASIO_DECL asio::error_code close( - base_implementation_type& impl, asio::error_code& ec); - - // Release ownership of the socket. - ASIO_DECL socket_type release( - base_implementation_type& impl, asio::error_code& ec); - - // Get the native socket representation. - native_handle_type native_handle(base_implementation_type& impl) - { - return impl.socket_; - } - - // Cancel all operations associated with the socket. - ASIO_DECL asio::error_code cancel( - base_implementation_type& impl, asio::error_code& ec); - - // Determine whether the socket is at the out-of-band data mark. - bool at_mark(const base_implementation_type& impl, - asio::error_code& ec) const - { - return socket_ops::sockatmark(impl.socket_, ec); - } - - // Determine the number of bytes available for reading. - std::size_t available(const base_implementation_type& impl, - asio::error_code& ec) const - { - return socket_ops::available(impl.socket_, ec); - } - - // Place the socket into the state where it will listen for new connections. - asio::error_code listen(base_implementation_type& impl, - int backlog, asio::error_code& ec) - { - socket_ops::listen(impl.socket_, backlog, ec); - return ec; - } - - // Perform an IO control command on the socket. - template - asio::error_code io_control(base_implementation_type& impl, - IO_Control_Command& command, asio::error_code& ec) - { - socket_ops::ioctl(impl.socket_, impl.state_, command.name(), - static_cast(command.data()), ec); - return ec; - } - - // Gets the non-blocking mode of the socket. - bool non_blocking(const base_implementation_type& impl) const - { - return (impl.state_ & socket_ops::user_set_non_blocking) != 0; - } - - // Sets the non-blocking mode of the socket. - asio::error_code non_blocking(base_implementation_type& impl, - bool mode, asio::error_code& ec) - { - socket_ops::set_user_non_blocking(impl.socket_, impl.state_, mode, ec); - return ec; - } - - // Gets the non-blocking mode of the native socket implementation. - bool native_non_blocking(const base_implementation_type& impl) const - { - return (impl.state_ & socket_ops::internal_non_blocking) != 0; - } - - // Sets the non-blocking mode of the native socket implementation. - asio::error_code native_non_blocking(base_implementation_type& impl, - bool mode, asio::error_code& ec) - { - socket_ops::set_internal_non_blocking(impl.socket_, impl.state_, mode, ec); - return ec; - } - - // Wait for the socket to become ready to read, ready to write, or to have - // pending error conditions. - asio::error_code wait(base_implementation_type& impl, - socket_base::wait_type w, asio::error_code& ec) - { - switch (w) - { - case socket_base::wait_read: - socket_ops::poll_read(impl.socket_, impl.state_, -1, ec); - break; - case socket_base::wait_write: - socket_ops::poll_write(impl.socket_, impl.state_, -1, ec); - break; - case socket_base::wait_error: - socket_ops::poll_error(impl.socket_, impl.state_, -1, ec); - break; - default: - ec = asio::error::invalid_argument; - break; - } - - return ec; - } - - // Asynchronously wait for the socket to become ready to read, ready to - // write, or to have pending error conditions. - template - void async_wait(base_implementation_type& impl, - socket_base::wait_type w, Handler& handler) - { - bool is_continuation = - asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_wait_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(handler); - - ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_wait")); - - int op_type; - switch (w) - { - case socket_base::wait_read: - op_type = reactor::read_op; - break; - case socket_base::wait_write: - op_type = reactor::write_op; - break; - case socket_base::wait_error: - op_type = reactor::except_op; - break; - default: - p.p->ec_ = asio::error::invalid_argument; - reactor_.post_immediate_completion(p.p, is_continuation); - p.v = p.p = 0; - return; - } - - start_op(impl, op_type, p.p, is_continuation, false, false); - p.v = p.p = 0; - } - - // Send the given data to the peer. - template - size_t send(base_implementation_type& impl, - const ConstBufferSequence& buffers, - socket_base::message_flags flags, asio::error_code& ec) - { - buffer_sequence_adapter bufs(buffers); - - return socket_ops::sync_send(impl.socket_, impl.state_, - bufs.buffers(), bufs.count(), flags, bufs.all_empty(), ec); - } - - // Wait until data can be sent without blocking. - size_t send(base_implementation_type& impl, const null_buffers&, - socket_base::message_flags, asio::error_code& ec) - { - // Wait for socket to become ready. - socket_ops::poll_write(impl.socket_, impl.state_, -1, ec); - - return 0; - } - - // Start an asynchronous send. The data being sent must be valid for the - // lifetime of the asynchronous operation. - template - void async_send(base_implementation_type& impl, - const ConstBufferSequence& buffers, - socket_base::message_flags flags, Handler& handler) - { - bool is_continuation = - asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_socket_send_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(impl.socket_, impl.state_, buffers, flags, handler); - - ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_send")); - - start_op(impl, reactor::write_op, p.p, is_continuation, true, - ((impl.state_ & socket_ops::stream_oriented) - && buffer_sequence_adapter::all_empty(buffers))); - p.v = p.p = 0; - } - - // Start an asynchronous wait until data can be sent without blocking. - template - void async_send(base_implementation_type& impl, const null_buffers&, - socket_base::message_flags, Handler& handler) - { - bool is_continuation = - asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_null_buffers_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(handler); - - ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_send(null_buffers)")); - - start_op(impl, reactor::write_op, p.p, is_continuation, false, false); - p.v = p.p = 0; - } - - // Receive some data from the peer. Returns the number of bytes received. - template - size_t receive(base_implementation_type& impl, - const MutableBufferSequence& buffers, - socket_base::message_flags flags, asio::error_code& ec) - { - buffer_sequence_adapter bufs(buffers); - - return socket_ops::sync_recv(impl.socket_, impl.state_, - bufs.buffers(), bufs.count(), flags, bufs.all_empty(), ec); - } - - // Wait until data can be received without blocking. - size_t receive(base_implementation_type& impl, const null_buffers&, - socket_base::message_flags, asio::error_code& ec) - { - // Wait for socket to become ready. - socket_ops::poll_read(impl.socket_, impl.state_, -1, ec); - - return 0; - } - - // Start an asynchronous receive. The buffer for the data being received - // must be valid for the lifetime of the asynchronous operation. - template - void async_receive(base_implementation_type& impl, - const MutableBufferSequence& buffers, - socket_base::message_flags flags, Handler& handler) - { - bool is_continuation = - asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_socket_recv_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(impl.socket_, impl.state_, buffers, flags, handler); - - ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_receive")); - - start_op(impl, - (flags & socket_base::message_out_of_band) - ? reactor::except_op : reactor::read_op, - p.p, is_continuation, - (flags & socket_base::message_out_of_band) == 0, - ((impl.state_ & socket_ops::stream_oriented) - && buffer_sequence_adapter::all_empty(buffers))); - p.v = p.p = 0; - } - - // Wait until data can be received without blocking. - template - void async_receive(base_implementation_type& impl, const null_buffers&, - socket_base::message_flags flags, Handler& handler) - { - bool is_continuation = - asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_null_buffers_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(handler); - - ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_receive(null_buffers)")); - - start_op(impl, - (flags & socket_base::message_out_of_band) - ? reactor::except_op : reactor::read_op, - p.p, is_continuation, false, false); - p.v = p.p = 0; - } - - // Receive some data with associated flags. Returns the number of bytes - // received. - template - size_t receive_with_flags(base_implementation_type& impl, - const MutableBufferSequence& buffers, - socket_base::message_flags in_flags, - socket_base::message_flags& out_flags, asio::error_code& ec) - { - buffer_sequence_adapter bufs(buffers); - - return socket_ops::sync_recvmsg(impl.socket_, impl.state_, - bufs.buffers(), bufs.count(), in_flags, out_flags, ec); - } - - // Wait until data can be received without blocking. - size_t receive_with_flags(base_implementation_type& impl, - const null_buffers&, socket_base::message_flags, - socket_base::message_flags& out_flags, asio::error_code& ec) - { - // Wait for socket to become ready. - socket_ops::poll_read(impl.socket_, impl.state_, -1, ec); - - // Clear out_flags, since we cannot give it any other sensible value when - // performing a null_buffers operation. - out_flags = 0; - - return 0; - } - - // Start an asynchronous receive. The buffer for the data being received - // must be valid for the lifetime of the asynchronous operation. - template - void async_receive_with_flags(base_implementation_type& impl, - const MutableBufferSequence& buffers, socket_base::message_flags in_flags, - socket_base::message_flags& out_flags, Handler& handler) - { - bool is_continuation = - asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_socket_recvmsg_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(impl.socket_, buffers, in_flags, out_flags, handler); - - ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_receive_with_flags")); - - start_op(impl, - (in_flags & socket_base::message_out_of_band) - ? reactor::except_op : reactor::read_op, - p.p, is_continuation, - (in_flags & socket_base::message_out_of_band) == 0, false); - p.v = p.p = 0; - } - - // Wait until data can be received without blocking. - template - void async_receive_with_flags(base_implementation_type& impl, - const null_buffers&, socket_base::message_flags in_flags, - socket_base::message_flags& out_flags, Handler& handler) - { - bool is_continuation = - asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_null_buffers_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(handler); - - ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_receive_with_flags(null_buffers)")); - - // Clear out_flags, since we cannot give it any other sensible value when - // performing a null_buffers operation. - out_flags = 0; - - start_op(impl, - (in_flags & socket_base::message_out_of_band) - ? reactor::except_op : reactor::read_op, - p.p, is_continuation, false, false); - p.v = p.p = 0; - } - -protected: - // Open a new socket implementation. - ASIO_DECL asio::error_code do_open( - base_implementation_type& impl, int af, - int type, int protocol, asio::error_code& ec); - - // Assign a native socket to a socket implementation. - ASIO_DECL asio::error_code do_assign( - base_implementation_type& impl, int type, - const native_handle_type& native_socket, asio::error_code& ec); - - // Start the asynchronous read or write operation. - ASIO_DECL void start_op(base_implementation_type& impl, int op_type, - reactor_op* op, bool is_continuation, bool is_non_blocking, bool noop); - - // Start the asynchronous accept operation. - ASIO_DECL void start_accept_op(base_implementation_type& impl, - reactor_op* op, bool is_continuation, bool peer_is_open); - - // Start the asynchronous connect operation. - ASIO_DECL void start_connect_op(base_implementation_type& impl, - reactor_op* op, bool is_continuation, - const socket_addr_type* addr, size_t addrlen); - - // The io_context that owns this socket service. - io_context& io_context_; - - // The selector that performs event demultiplexing for the service. - reactor& reactor_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/reactive_socket_service_base.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // !defined(ASIO_HAS_IOCP) - // && !defined(ASIO_WINDOWS_RUNTIME) - -#endif // ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_BASE_HPP diff --git a/tools/sdk/include/asio/asio/detail/reactive_wait_op.hpp b/tools/sdk/include/asio/asio/detail/reactive_wait_op.hpp deleted file mode 100644 index 616d8b11504..00000000000 --- a/tools/sdk/include/asio/asio/detail/reactive_wait_op.hpp +++ /dev/null @@ -1,90 +0,0 @@ -// -// detail/reactive_wait_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_REACTIVE_WAIT_OP_HPP -#define ASIO_DETAIL_REACTIVE_WAIT_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/reactor_op.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class reactive_wait_op : public reactor_op -{ -public: - ASIO_DEFINE_HANDLER_PTR(reactive_wait_op); - - reactive_wait_op(Handler& handler) - : reactor_op(&reactive_wait_op::do_perform, - &reactive_wait_op::do_complete), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static status do_perform(reactor_op*) - { - return done; - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& /*ec*/, - std::size_t /*bytes_transferred*/) - { - // Take ownership of the handler object. - reactive_wait_op* o(static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - ASIO_HANDLER_COMPLETION((*o)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder1 - handler(o->handler_, o->ec_); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_REACTIVE_WAIT_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/reactor.hpp b/tools/sdk/include/asio/asio/detail/reactor.hpp deleted file mode 100644 index 47502764f05..00000000000 --- a/tools/sdk/include/asio/asio/detail/reactor.hpp +++ /dev/null @@ -1,32 +0,0 @@ -// -// detail/reactor.hpp -// ~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_REACTOR_HPP -#define ASIO_DETAIL_REACTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/reactor_fwd.hpp" - -#if defined(ASIO_HAS_EPOLL) -# include "asio/detail/epoll_reactor.hpp" -#elif defined(ASIO_HAS_KQUEUE) -# include "asio/detail/kqueue_reactor.hpp" -#elif defined(ASIO_HAS_DEV_POLL) -# include "asio/detail/dev_poll_reactor.hpp" -#elif defined(ASIO_HAS_IOCP) || defined(ASIO_WINDOWS_RUNTIME) -# include "asio/detail/null_reactor.hpp" -#else -# include "asio/detail/select_reactor.hpp" -#endif - -#endif // ASIO_DETAIL_REACTOR_HPP diff --git a/tools/sdk/include/asio/asio/detail/reactor_fwd.hpp b/tools/sdk/include/asio/asio/detail/reactor_fwd.hpp deleted file mode 100644 index a4555c3db00..00000000000 --- a/tools/sdk/include/asio/asio/detail/reactor_fwd.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// -// detail/reactor_fwd.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_REACTOR_FWD_HPP -#define ASIO_DETAIL_REACTOR_FWD_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -namespace asio { -namespace detail { - -#if defined(ASIO_HAS_IOCP) || defined(ASIO_WINDOWS_RUNTIME) -typedef class null_reactor reactor; -#elif defined(ASIO_HAS_IOCP) -typedef class select_reactor reactor; -#elif defined(ASIO_HAS_EPOLL) -typedef class epoll_reactor reactor; -#elif defined(ASIO_HAS_KQUEUE) -typedef class kqueue_reactor reactor; -#elif defined(ASIO_HAS_DEV_POLL) -typedef class dev_poll_reactor reactor; -#else -typedef class select_reactor reactor; -#endif - -} // namespace detail -} // namespace asio - -#endif // ASIO_DETAIL_REACTOR_FWD_HPP diff --git a/tools/sdk/include/asio/asio/detail/reactor_op.hpp b/tools/sdk/include/asio/asio/detail/reactor_op.hpp deleted file mode 100644 index faad1a775cc..00000000000 --- a/tools/sdk/include/asio/asio/detail/reactor_op.hpp +++ /dev/null @@ -1,65 +0,0 @@ -// -// detail/reactor_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_REACTOR_OP_HPP -#define ASIO_DETAIL_REACTOR_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/operation.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class reactor_op - : public operation -{ -public: - // The error code to be passed to the completion handler. - asio::error_code ec_; - - // The number of bytes transferred, to be passed to the completion handler. - std::size_t bytes_transferred_; - - // Status returned by perform function. May be used to decide whether it is - // worth performing more operations on the descriptor immediately. - enum status { not_done, done, done_and_exhausted }; - - // Perform the operation. Returns true if it is finished. - status perform() - { - return perform_func_(this); - } - -protected: - typedef status (*perform_func_type)(reactor_op*); - - reactor_op(perform_func_type perform_func, func_type complete_func) - : operation(complete_func), - bytes_transferred_(0), - perform_func_(perform_func) - { - } - -private: - perform_func_type perform_func_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_REACTOR_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/reactor_op_queue.hpp b/tools/sdk/include/asio/asio/detail/reactor_op_queue.hpp deleted file mode 100644 index 898f31d1c6c..00000000000 --- a/tools/sdk/include/asio/asio/detail/reactor_op_queue.hpp +++ /dev/null @@ -1,168 +0,0 @@ -// -// detail/reactor_op_queue.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_REACTOR_OP_QUEUE_HPP -#define ASIO_DETAIL_REACTOR_OP_QUEUE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/hash_map.hpp" -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/op_queue.hpp" -#include "asio/detail/reactor_op.hpp" -#include "asio/error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class reactor_op_queue - : private noncopyable -{ -public: - typedef Descriptor key_type; - - struct mapped_type : op_queue - { - mapped_type() {} - mapped_type(const mapped_type&) {} - void operator=(const mapped_type&) {} - }; - - typedef typename hash_map::value_type value_type; - typedef typename hash_map::iterator iterator; - - // Constructor. - reactor_op_queue() - : operations_() - { - } - - // Obtain iterators to all registered descriptors. - iterator begin() { return operations_.begin(); } - iterator end() { return operations_.end(); } - - // Add a new operation to the queue. Returns true if this is the only - // operation for the given descriptor, in which case the reactor's event - // demultiplexing function call may need to be interrupted and restarted. - bool enqueue_operation(Descriptor descriptor, reactor_op* op) - { - std::pair entry = - operations_.insert(value_type(descriptor, mapped_type())); - entry.first->second.push(op); - return entry.second; - } - - // Cancel all operations associated with the descriptor identified by the - // supplied iterator. Any operations pending for the descriptor will be - // cancelled. Returns true if any operations were cancelled, in which case - // the reactor's event demultiplexing function may need to be interrupted and - // restarted. - bool cancel_operations(iterator i, op_queue& ops, - const asio::error_code& ec = - asio::error::operation_aborted) - { - if (i != operations_.end()) - { - while (reactor_op* op = i->second.front()) - { - op->ec_ = ec; - i->second.pop(); - ops.push(op); - } - operations_.erase(i); - return true; - } - - return false; - } - - // Cancel all operations associated with the descriptor. Any operations - // pending for the descriptor will be cancelled. Returns true if any - // operations were cancelled, in which case the reactor's event - // demultiplexing function may need to be interrupted and restarted. - bool cancel_operations(Descriptor descriptor, op_queue& ops, - const asio::error_code& ec = - asio::error::operation_aborted) - { - return this->cancel_operations(operations_.find(descriptor), ops, ec); - } - - // Whether there are no operations in the queue. - bool empty() const - { - return operations_.empty(); - } - - // Determine whether there are any operations associated with the descriptor. - bool has_operation(Descriptor descriptor) const - { - return operations_.find(descriptor) != operations_.end(); - } - - // Perform the operations corresponding to the descriptor identified by the - // supplied iterator. Returns true if there are still unfinished operations - // queued for the descriptor. - bool perform_operations(iterator i, op_queue& ops) - { - if (i != operations_.end()) - { - while (reactor_op* op = i->second.front()) - { - if (op->perform()) - { - i->second.pop(); - ops.push(op); - } - else - { - return true; - } - } - operations_.erase(i); - } - return false; - } - - // Perform the operations corresponding to the descriptor. Returns true if - // there are still unfinished operations queued for the descriptor. - bool perform_operations(Descriptor descriptor, op_queue& ops) - { - return this->perform_operations(operations_.find(descriptor), ops); - } - - // Get all operations owned by the queue. - void get_all_operations(op_queue& ops) - { - iterator i = operations_.begin(); - while (i != operations_.end()) - { - iterator op_iter = i++; - ops.push(op_iter->second); - operations_.erase(op_iter); - } - } - -private: - // The operations that are currently executing asynchronously. - hash_map operations_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_REACTOR_OP_QUEUE_HPP diff --git a/tools/sdk/include/asio/asio/detail/recycling_allocator.hpp b/tools/sdk/include/asio/asio/detail/recycling_allocator.hpp deleted file mode 100644 index 964af1da6f1..00000000000 --- a/tools/sdk/include/asio/asio/detail/recycling_allocator.hpp +++ /dev/null @@ -1,104 +0,0 @@ -// -// detail/recycling_allocator.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_RECYCLING_ALLOCATOR_HPP -#define ASIO_DETAIL_RECYCLING_ALLOCATOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/thread_context.hpp" -#include "asio/detail/thread_info_base.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class recycling_allocator -{ -public: - typedef T value_type; - - template - struct rebind - { - typedef recycling_allocator other; - }; - - recycling_allocator() - { - } - - template - recycling_allocator(const recycling_allocator&) - { - } - - T* allocate(std::size_t n) - { - typedef thread_context::thread_call_stack call_stack; - void* p = thread_info_base::allocate(call_stack::top(), sizeof(T) * n); - return static_cast(p); - } - - void deallocate(T* p, std::size_t n) - { - typedef thread_context::thread_call_stack call_stack; - thread_info_base::deallocate(call_stack::top(), p, sizeof(T) * n); - } -}; - -template <> -class recycling_allocator -{ -public: - typedef void value_type; - - template - struct rebind - { - typedef recycling_allocator other; - }; - - recycling_allocator() - { - } - - template - recycling_allocator(const recycling_allocator&) - { - } -}; - -template -struct get_recycling_allocator -{ - typedef Allocator type; - static type get(const Allocator& a) { return a; } -}; - -template -struct get_recycling_allocator > -{ - typedef recycling_allocator type; - static type get(const std::allocator&) { return type(); } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_RECYCLING_ALLOCATOR_HPP diff --git a/tools/sdk/include/asio/asio/detail/regex_fwd.hpp b/tools/sdk/include/asio/asio/detail/regex_fwd.hpp deleted file mode 100644 index dcf7d06e3c7..00000000000 --- a/tools/sdk/include/asio/asio/detail/regex_fwd.hpp +++ /dev/null @@ -1,35 +0,0 @@ -// -// detail/regex_fwd.hpp -// ~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_REGEX_FWD_HPP -#define ASIO_DETAIL_REGEX_FWD_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#if defined(ASIO_HAS_BOOST_REGEX) - -#include -#include - -namespace boost { - -template -struct sub_match; - -template -class match_results; - -} // namespace boost - -#endif // defined(ASIO_HAS_BOOST_REGEX) - -#endif // ASIO_DETAIL_REGEX_FWD_HPP diff --git a/tools/sdk/include/asio/asio/detail/resolve_endpoint_op.hpp b/tools/sdk/include/asio/asio/detail/resolve_endpoint_op.hpp deleted file mode 100644 index 8eee2f98bf4..00000000000 --- a/tools/sdk/include/asio/asio/detail/resolve_endpoint_op.hpp +++ /dev/null @@ -1,122 +0,0 @@ -// -// detail/resolve_endpoint_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_RESOLVER_ENDPOINT_OP_HPP -#define ASIO_DETAIL_RESOLVER_ENDPOINT_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" -#include "asio/ip/basic_resolver_results.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/resolve_op.hpp" -#include "asio/detail/socket_ops.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class resolve_endpoint_op : public resolve_op -{ -public: - ASIO_DEFINE_HANDLER_PTR(resolve_endpoint_op); - - typedef typename Protocol::endpoint endpoint_type; - typedef asio::ip::basic_resolver_results results_type; - - resolve_endpoint_op(socket_ops::weak_cancel_token_type cancel_token, - const endpoint_type& endpoint, io_context_impl& ioc, Handler& handler) - : resolve_op(&resolve_endpoint_op::do_complete), - cancel_token_(cancel_token), - endpoint_(endpoint), - io_context_impl_(ioc), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& /*ec*/, - std::size_t /*bytes_transferred*/) - { - // Take ownership of the operation object. - resolve_endpoint_op* o(static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - if (owner && owner != &o->io_context_impl_) - { - // The operation is being run on the worker io_context. Time to perform - // the resolver operation. - - // Perform the blocking endpoint resolution operation. - char host_name[NI_MAXHOST]; - char service_name[NI_MAXSERV]; - socket_ops::background_getnameinfo(o->cancel_token_, o->endpoint_.data(), - o->endpoint_.size(), host_name, NI_MAXHOST, service_name, NI_MAXSERV, - o->endpoint_.protocol().type(), o->ec_); - o->results_ = results_type::create(o->endpoint_, host_name, service_name); - - // Pass operation back to main io_context for completion. - o->io_context_impl_.post_deferred_completion(o); - p.v = p.p = 0; - } - else - { - // The operation has been returned to the main io_context. The completion - // handler is ready to be delivered. - - ASIO_HANDLER_COMPLETION((*o)); - - // Make a copy of the handler so that the memory can be deallocated - // before the upcall is made. Even if we're not about to make an upcall, - // a sub-object of the handler may be the true owner of the memory - // associated with the handler. Consequently, a local copy of the handler - // is required to ensure that any owning sub-object remains valid until - // after we have deallocated the memory here. - detail::binder2 - handler(o->handler_, o->ec_, o->results_); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, "...")); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - } - -private: - socket_ops::weak_cancel_token_type cancel_token_; - endpoint_type endpoint_; - io_context_impl& io_context_impl_; - Handler handler_; - results_type results_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_RESOLVER_ENDPOINT_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/resolve_op.hpp b/tools/sdk/include/asio/asio/detail/resolve_op.hpp deleted file mode 100644 index a528aa825f3..00000000000 --- a/tools/sdk/include/asio/asio/detail/resolve_op.hpp +++ /dev/null @@ -1,45 +0,0 @@ -// -// detail/resolve_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_RESOLVE_OP_HPP -#define ASIO_DETAIL_RESOLVE_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/error.hpp" -#include "asio/detail/operation.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class resolve_op : public operation -{ -public: - // The error code to be passed to the completion handler. - asio::error_code ec_; - -protected: - resolve_op(func_type complete_func) - : operation(complete_func) - { - } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_RESOLVE_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/resolve_query_op.hpp b/tools/sdk/include/asio/asio/detail/resolve_query_op.hpp deleted file mode 100644 index 0ec5a32101c..00000000000 --- a/tools/sdk/include/asio/asio/detail/resolve_query_op.hpp +++ /dev/null @@ -1,134 +0,0 @@ -// -// detail/resolve_query_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_RESOLVE_QUERY_OP_HPP -#define ASIO_DETAIL_RESOLVE_QUERY_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" -#include "asio/ip/basic_resolver_query.hpp" -#include "asio/ip/basic_resolver_results.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/resolve_op.hpp" -#include "asio/detail/socket_ops.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class resolve_query_op : public resolve_op -{ -public: - ASIO_DEFINE_HANDLER_PTR(resolve_query_op); - - typedef asio::ip::basic_resolver_query query_type; - typedef asio::ip::basic_resolver_results results_type; - - resolve_query_op(socket_ops::weak_cancel_token_type cancel_token, - const query_type& query, io_context_impl& ioc, Handler& handler) - : resolve_op(&resolve_query_op::do_complete), - cancel_token_(cancel_token), - query_(query), - io_context_impl_(ioc), - handler_(ASIO_MOVE_CAST(Handler)(handler)), - addrinfo_(0) - { - handler_work::start(handler_); - } - - ~resolve_query_op() - { - if (addrinfo_) - socket_ops::freeaddrinfo(addrinfo_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& /*ec*/, - std::size_t /*bytes_transferred*/) - { - // Take ownership of the operation object. - resolve_query_op* o(static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - - if (owner && owner != &o->io_context_impl_) - { - // The operation is being run on the worker io_context. Time to perform - // the resolver operation. - - // Perform the blocking host resolution operation. - socket_ops::background_getaddrinfo(o->cancel_token_, - o->query_.host_name().c_str(), o->query_.service_name().c_str(), - o->query_.hints(), &o->addrinfo_, o->ec_); - - // Pass operation back to main io_context for completion. - o->io_context_impl_.post_deferred_completion(o); - p.v = p.p = 0; - } - else - { - // The operation has been returned to the main io_context. The completion - // handler is ready to be delivered. - - // Take ownership of the operation's outstanding work. - handler_work w(o->handler_); - - ASIO_HANDLER_COMPLETION((*o)); - - // Make a copy of the handler so that the memory can be deallocated - // before the upcall is made. Even if we're not about to make an upcall, - // a sub-object of the handler may be the true owner of the memory - // associated with the handler. Consequently, a local copy of the handler - // is required to ensure that any owning sub-object remains valid until - // after we have deallocated the memory here. - detail::binder2 - handler(o->handler_, o->ec_, results_type()); - p.h = asio::detail::addressof(handler.handler_); - if (o->addrinfo_) - { - handler.arg2_ = results_type::create(o->addrinfo_, - o->query_.host_name(), o->query_.service_name()); - } - p.reset(); - - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, "...")); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - } - -private: - socket_ops::weak_cancel_token_type cancel_token_; - query_type query_; - io_context_impl& io_context_impl_; - Handler handler_; - asio::detail::addrinfo_type* addrinfo_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_RESOLVE_QUERY_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/resolver_service.hpp b/tools/sdk/include/asio/asio/detail/resolver_service.hpp deleted file mode 100644 index 11a94d1353d..00000000000 --- a/tools/sdk/include/asio/asio/detail/resolver_service.hpp +++ /dev/null @@ -1,145 +0,0 @@ -// -// detail/resolver_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_RESOLVER_SERVICE_HPP -#define ASIO_DETAIL_RESOLVER_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_WINDOWS_RUNTIME) - -#include "asio/ip/basic_resolver_query.hpp" -#include "asio/ip/basic_resolver_results.hpp" -#include "asio/detail/concurrency_hint.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/resolve_endpoint_op.hpp" -#include "asio/detail/resolve_query_op.hpp" -#include "asio/detail/resolver_service_base.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class resolver_service : - public service_base >, - public resolver_service_base -{ -public: - // The implementation type of the resolver. A cancellation token is used to - // indicate to the background thread that the operation has been cancelled. - typedef socket_ops::shared_cancel_token_type implementation_type; - - // The endpoint type. - typedef typename Protocol::endpoint endpoint_type; - - // The query type. - typedef asio::ip::basic_resolver_query query_type; - - // The results type. - typedef asio::ip::basic_resolver_results results_type; - - // Constructor. - resolver_service(asio::io_context& io_context) - : service_base >(io_context), - resolver_service_base(io_context) - { - } - - // Destroy all user-defined handler objects owned by the service. - void shutdown() - { - this->base_shutdown(); - } - - // Perform any fork-related housekeeping. - void notify_fork(asio::io_context::fork_event fork_ev) - { - this->base_notify_fork(fork_ev); - } - - // Resolve a query to a list of entries. - results_type resolve(implementation_type&, const query_type& query, - asio::error_code& ec) - { - asio::detail::addrinfo_type* address_info = 0; - - socket_ops::getaddrinfo(query.host_name().c_str(), - query.service_name().c_str(), query.hints(), &address_info, ec); - auto_addrinfo auto_address_info(address_info); - - return ec ? results_type() : results_type::create( - address_info, query.host_name(), query.service_name()); - } - - // Asynchronously resolve a query to a list of entries. - template - void async_resolve(implementation_type& impl, - const query_type& query, Handler& handler) - { - // Allocate and construct an operation to wrap the handler. - typedef resolve_query_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(impl, query, io_context_impl_, handler); - - ASIO_HANDLER_CREATION((io_context_impl_.context(), - *p.p, "resolver", &impl, 0, "async_resolve")); - - start_resolve_op(p.p); - p.v = p.p = 0; - } - - // Resolve an endpoint to a list of entries. - results_type resolve(implementation_type&, - const endpoint_type& endpoint, asio::error_code& ec) - { - char host_name[NI_MAXHOST]; - char service_name[NI_MAXSERV]; - socket_ops::sync_getnameinfo(endpoint.data(), endpoint.size(), - host_name, NI_MAXHOST, service_name, NI_MAXSERV, - endpoint.protocol().type(), ec); - - return ec ? results_type() : results_type::create( - endpoint, host_name, service_name); - } - - // Asynchronously resolve an endpoint to a list of entries. - template - void async_resolve(implementation_type& impl, - const endpoint_type& endpoint, Handler& handler) - { - // Allocate and construct an operation to wrap the handler. - typedef resolve_endpoint_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(impl, endpoint, io_context_impl_, handler); - - ASIO_HANDLER_CREATION((io_context_impl_.context(), - *p.p, "resolver", &impl, 0, "async_resolve")); - - start_resolve_op(p.p); - p.v = p.p = 0; - } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // !defined(ASIO_WINDOWS_RUNTIME) - -#endif // ASIO_DETAIL_RESOLVER_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/detail/resolver_service_base.hpp b/tools/sdk/include/asio/asio/detail/resolver_service_base.hpp deleted file mode 100644 index 10a792241c5..00000000000 --- a/tools/sdk/include/asio/asio/detail/resolver_service_base.hpp +++ /dev/null @@ -1,140 +0,0 @@ -// -// detail/resolver_service_base.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_RESOLVER_SERVICE_BASE_HPP -#define ASIO_DETAIL_RESOLVER_SERVICE_BASE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/error.hpp" -#include "asio/executor_work_guard.hpp" -#include "asio/io_context.hpp" -#include "asio/detail/mutex.hpp" -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/resolve_op.hpp" -#include "asio/detail/socket_ops.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/detail/scoped_ptr.hpp" -#include "asio/detail/thread.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class resolver_service_base -{ -public: - // The implementation type of the resolver. A cancellation token is used to - // indicate to the background thread that the operation has been cancelled. - typedef socket_ops::shared_cancel_token_type implementation_type; - - // Constructor. - ASIO_DECL resolver_service_base(asio::io_context& io_context); - - // Destructor. - ASIO_DECL ~resolver_service_base(); - - // Destroy all user-defined handler objects owned by the service. - ASIO_DECL void base_shutdown(); - - // Perform any fork-related housekeeping. - ASIO_DECL void base_notify_fork( - asio::io_context::fork_event fork_ev); - - // Construct a new resolver implementation. - ASIO_DECL void construct(implementation_type& impl); - - // Destroy a resolver implementation. - ASIO_DECL void destroy(implementation_type&); - - // Move-construct a new resolver implementation. - ASIO_DECL void move_construct(implementation_type& impl, - implementation_type& other_impl); - - // Move-assign from another resolver implementation. - ASIO_DECL void move_assign(implementation_type& impl, - resolver_service_base& other_service, - implementation_type& other_impl); - - // Cancel pending asynchronous operations. - ASIO_DECL void cancel(implementation_type& impl); - -protected: - // Helper function to start an asynchronous resolve operation. - ASIO_DECL void start_resolve_op(resolve_op* op); - -#if !defined(ASIO_WINDOWS_RUNTIME) - // Helper class to perform exception-safe cleanup of addrinfo objects. - class auto_addrinfo - : private asio::detail::noncopyable - { - public: - explicit auto_addrinfo(asio::detail::addrinfo_type* ai) - : ai_(ai) - { - } - - ~auto_addrinfo() - { - if (ai_) - socket_ops::freeaddrinfo(ai_); - } - - operator asio::detail::addrinfo_type*() - { - return ai_; - } - - private: - asio::detail::addrinfo_type* ai_; - }; -#endif // !defined(ASIO_WINDOWS_RUNTIME) - - // Helper class to run the work io_context in a thread. - class work_io_context_runner; - - // Start the work thread if it's not already running. - ASIO_DECL void start_work_thread(); - - // The io_context implementation used to post completions. - io_context_impl& io_context_impl_; - -private: - // Mutex to protect access to internal data. - asio::detail::mutex mutex_; - - // Private io_context used for performing asynchronous host resolution. - asio::detail::scoped_ptr work_io_context_; - - // The work io_context implementation used to post completions. - io_context_impl& work_io_context_impl_; - - // Work for the private io_context to perform. - asio::executor_work_guard< - asio::io_context::executor_type> work_; - - // Thread used for running the work io_context's run loop. - asio::detail::scoped_ptr work_thread_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/resolver_service_base.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_DETAIL_RESOLVER_SERVICE_BASE_HPP diff --git a/tools/sdk/include/asio/asio/detail/scheduler.hpp b/tools/sdk/include/asio/asio/detail/scheduler.hpp deleted file mode 100644 index 10c29b7edf2..00000000000 --- a/tools/sdk/include/asio/asio/detail/scheduler.hpp +++ /dev/null @@ -1,213 +0,0 @@ -// -// detail/scheduler.hpp -// ~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_SCHEDULER_HPP -#define ASIO_DETAIL_SCHEDULER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include "asio/error_code.hpp" -#include "asio/execution_context.hpp" -#include "asio/detail/atomic_count.hpp" -#include "asio/detail/conditionally_enabled_event.hpp" -#include "asio/detail/conditionally_enabled_mutex.hpp" -#include "asio/detail/op_queue.hpp" -#include "asio/detail/reactor_fwd.hpp" -#include "asio/detail/scheduler_operation.hpp" -#include "asio/detail/thread_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -struct scheduler_thread_info; - -class scheduler - : public execution_context_service_base, - public thread_context -{ -public: - typedef scheduler_operation operation; - - // Constructor. Specifies the number of concurrent threads that are likely to - // run the scheduler. If set to 1 certain optimisation are performed. - ASIO_DECL scheduler(asio::execution_context& ctx, - int concurrency_hint = 0); - - // Destroy all user-defined handler objects owned by the service. - ASIO_DECL void shutdown(); - - // Initialise the task, if required. - ASIO_DECL void init_task(); - - // Run the event loop until interrupted or no more work. - ASIO_DECL std::size_t run(asio::error_code& ec); - - // Run until interrupted or one operation is performed. - ASIO_DECL std::size_t run_one(asio::error_code& ec); - - // Run until timeout, interrupted, or one operation is performed. - ASIO_DECL std::size_t wait_one( - long usec, asio::error_code& ec); - - // Poll for operations without blocking. - ASIO_DECL std::size_t poll(asio::error_code& ec); - - // Poll for one operation without blocking. - ASIO_DECL std::size_t poll_one(asio::error_code& ec); - - // Interrupt the event processing loop. - ASIO_DECL void stop(); - - // Determine whether the scheduler is stopped. - ASIO_DECL bool stopped() const; - - // Restart in preparation for a subsequent run invocation. - ASIO_DECL void restart(); - - // Notify that some work has started. - void work_started() - { - ++outstanding_work_; - } - - // Used to compensate for a forthcoming work_finished call. Must be called - // from within a scheduler-owned thread. - ASIO_DECL void compensating_work_started(); - - // Notify that some work has finished. - void work_finished() - { - if (--outstanding_work_ == 0) - stop(); - } - - // Return whether a handler can be dispatched immediately. - bool can_dispatch() - { - return thread_call_stack::contains(this) != 0; - } - - // Request invocation of the given operation and return immediately. Assumes - // that work_started() has not yet been called for the operation. - ASIO_DECL void post_immediate_completion( - operation* op, bool is_continuation); - - // Request invocation of the given operation and return immediately. Assumes - // that work_started() was previously called for the operation. - ASIO_DECL void post_deferred_completion(operation* op); - - // Request invocation of the given operations and return immediately. Assumes - // that work_started() was previously called for each operation. - ASIO_DECL void post_deferred_completions(op_queue& ops); - - // Enqueue the given operation following a failed attempt to dispatch the - // operation for immediate invocation. - ASIO_DECL void do_dispatch(operation* op); - - // Process unfinished operations as part of a shutdownoperation. Assumes that - // work_started() was previously called for the operations. - ASIO_DECL void abandon_operations(op_queue& ops); - - // Get the concurrency hint that was used to initialise the scheduler. - int concurrency_hint() const - { - return concurrency_hint_; - } - -private: - // The mutex type used by this scheduler. - typedef conditionally_enabled_mutex mutex; - - // The event type used by this scheduler. - typedef conditionally_enabled_event event; - - // Structure containing thread-specific data. - typedef scheduler_thread_info thread_info; - - // Run at most one operation. May block. - ASIO_DECL std::size_t do_run_one(mutex::scoped_lock& lock, - thread_info& this_thread, const asio::error_code& ec); - - // Run at most one operation with a timeout. May block. - ASIO_DECL std::size_t do_wait_one(mutex::scoped_lock& lock, - thread_info& this_thread, long usec, const asio::error_code& ec); - - // Poll for at most one operation. - ASIO_DECL std::size_t do_poll_one(mutex::scoped_lock& lock, - thread_info& this_thread, const asio::error_code& ec); - - // Stop the task and all idle threads. - ASIO_DECL void stop_all_threads(mutex::scoped_lock& lock); - - // Wake a single idle thread, or the task, and always unlock the mutex. - ASIO_DECL void wake_one_thread_and_unlock( - mutex::scoped_lock& lock); - - // Helper class to perform task-related operations on block exit. - struct task_cleanup; - friend struct task_cleanup; - - // Helper class to call work-related operations on block exit. - struct work_cleanup; - friend struct work_cleanup; - - // Whether to optimise for single-threaded use cases. - const bool one_thread_; - - // Mutex to protect access to internal data. - mutable mutex mutex_; - - // Event to wake up blocked threads. - event wakeup_event_; - - // The task to be run by this service. - reactor* task_; - - // Operation object to represent the position of the task in the queue. - struct task_operation : operation - { - task_operation() : operation(0) {} - } task_operation_; - - // Whether the task has been interrupted. - bool task_interrupted_; - - // The count of unfinished work. - atomic_count outstanding_work_; - - // The queue of handlers that are ready to be delivered. - op_queue op_queue_; - - // Flag to indicate that the dispatcher has been stopped. - bool stopped_; - - // Flag to indicate that the dispatcher has been shut down. - bool shutdown_; - - // The concurrency hint used to initialise the scheduler. - const int concurrency_hint_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/scheduler.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_DETAIL_SCHEDULER_HPP diff --git a/tools/sdk/include/asio/asio/detail/scheduler_operation.hpp b/tools/sdk/include/asio/asio/detail/scheduler_operation.hpp deleted file mode 100644 index 1c2ce02ecc7..00000000000 --- a/tools/sdk/include/asio/asio/detail/scheduler_operation.hpp +++ /dev/null @@ -1,78 +0,0 @@ -// -// detail/scheduler_operation.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_SCHEDULER_OPERATION_HPP -#define ASIO_DETAIL_SCHEDULER_OPERATION_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/error_code.hpp" -#include "asio/detail/handler_tracking.hpp" -#include "asio/detail/op_queue.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class scheduler; - -// Base class for all operations. A function pointer is used instead of virtual -// functions to avoid the associated overhead. -class scheduler_operation ASIO_INHERIT_TRACKED_HANDLER -{ -public: - typedef scheduler_operation operation_type; - - void complete(void* owner, const asio::error_code& ec, - std::size_t bytes_transferred) - { - func_(owner, this, ec, bytes_transferred); - } - - void destroy() - { - func_(0, this, asio::error_code(), 0); - } - -protected: - typedef void (*func_type)(void*, - scheduler_operation*, - const asio::error_code&, std::size_t); - - scheduler_operation(func_type func) - : next_(0), - func_(func), - task_result_(0) - { - } - - // Prevents deletion through this type. - ~scheduler_operation() - { - } - -private: - friend class op_queue_access; - scheduler_operation* next_; - func_type func_; -protected: - friend class scheduler; - unsigned int task_result_; // Passed into bytes transferred. -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_SCHEDULER_OPERATION_HPP diff --git a/tools/sdk/include/asio/asio/detail/scheduler_thread_info.hpp b/tools/sdk/include/asio/asio/detail/scheduler_thread_info.hpp deleted file mode 100644 index 2ffe013bcb1..00000000000 --- a/tools/sdk/include/asio/asio/detail/scheduler_thread_info.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// -// detail/scheduler_thread_info.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_SCHEDULER_THREAD_INFO_HPP -#define ASIO_DETAIL_SCHEDULER_THREAD_INFO_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/op_queue.hpp" -#include "asio/detail/thread_info_base.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class scheduler; -class scheduler_operation; - -struct scheduler_thread_info : public thread_info_base -{ - op_queue private_op_queue; - long private_outstanding_work; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_SCHEDULER_THREAD_INFO_HPP diff --git a/tools/sdk/include/asio/asio/detail/scoped_lock.hpp b/tools/sdk/include/asio/asio/detail/scoped_lock.hpp deleted file mode 100644 index 6cbce381402..00000000000 --- a/tools/sdk/include/asio/asio/detail/scoped_lock.hpp +++ /dev/null @@ -1,101 +0,0 @@ -// -// detail/scoped_lock.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_SCOPED_LOCK_HPP -#define ASIO_DETAIL_SCOPED_LOCK_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/noncopyable.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -// Helper class to lock and unlock a mutex automatically. -template -class scoped_lock - : private noncopyable -{ -public: - // Tag type used to distinguish constructors. - enum adopt_lock_t { adopt_lock }; - - // Constructor adopts a lock that is already held. - scoped_lock(Mutex& m, adopt_lock_t) - : mutex_(m), - locked_(true) - { - } - - // Constructor acquires the lock. - explicit scoped_lock(Mutex& m) - : mutex_(m) - { - mutex_.lock(); - locked_ = true; - } - - // Destructor releases the lock. - ~scoped_lock() - { - if (locked_) - mutex_.unlock(); - } - - // Explicitly acquire the lock. - void lock() - { - if (!locked_) - { - mutex_.lock(); - locked_ = true; - } - } - - // Explicitly release the lock. - void unlock() - { - if (locked_) - { - mutex_.unlock(); - locked_ = false; - } - } - - // Test whether the lock is held. - bool locked() const - { - return locked_; - } - - // Get the underlying mutex. - Mutex& mutex() - { - return mutex_; - } - -private: - // The underlying mutex. - Mutex& mutex_; - - // Whether the mutex is currently locked or unlocked. - bool locked_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_SCOPED_LOCK_HPP diff --git a/tools/sdk/include/asio/asio/detail/scoped_ptr.hpp b/tools/sdk/include/asio/asio/detail/scoped_ptr.hpp deleted file mode 100644 index 3449c53b72b..00000000000 --- a/tools/sdk/include/asio/asio/detail/scoped_ptr.hpp +++ /dev/null @@ -1,87 +0,0 @@ -// -// detail/scoped_ptr.hpp -// ~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_SCOPED_PTR_HPP -#define ASIO_DETAIL_SCOPED_PTR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class scoped_ptr -{ -public: - // Constructor. - explicit scoped_ptr(T* p = 0) - : p_(p) - { - } - - // Destructor. - ~scoped_ptr() - { - delete p_; - } - - // Access. - T* get() - { - return p_; - } - - // Access. - T* operator->() - { - return p_; - } - - // Dereference. - T& operator*() - { - return *p_; - } - - // Reset pointer. - void reset(T* p = 0) - { - delete p_; - p_ = p; - } - - // Release ownership of the pointer. - T* release() - { - T* tmp = p_; - p_ = 0; - return tmp; - } - -private: - // Disallow copying and assignment. - scoped_ptr(const scoped_ptr&); - scoped_ptr& operator=(const scoped_ptr&); - - T* p_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_SCOPED_PTR_HPP diff --git a/tools/sdk/include/asio/asio/detail/select_interrupter.hpp b/tools/sdk/include/asio/asio/detail/select_interrupter.hpp deleted file mode 100644 index c58327387b6..00000000000 --- a/tools/sdk/include/asio/asio/detail/select_interrupter.hpp +++ /dev/null @@ -1,46 +0,0 @@ -// -// detail/select_interrupter.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_SELECT_INTERRUPTER_HPP -#define ASIO_DETAIL_SELECT_INTERRUPTER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_WINDOWS_RUNTIME) - -#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__) || defined (ESP_PLATFORM) -# include "asio/detail/socket_select_interrupter.hpp" -#elif defined(ASIO_HAS_EVENTFD) -# include "asio/detail/eventfd_select_interrupter.hpp" -#else -# include "asio/detail/pipe_select_interrupter.hpp" -#endif - -namespace asio { -namespace detail { - -#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__) || defined (ESP_PLATFORM) -typedef socket_select_interrupter select_interrupter; -#elif defined(ASIO_HAS_EVENTFD) -typedef eventfd_select_interrupter select_interrupter; -#else -typedef pipe_select_interrupter select_interrupter; -#endif - -} // namespace detail -} // namespace asio - -#endif // !defined(ASIO_WINDOWS_RUNTIME) - -#endif // ASIO_DETAIL_SELECT_INTERRUPTER_HPP diff --git a/tools/sdk/include/asio/asio/detail/select_reactor.hpp b/tools/sdk/include/asio/asio/detail/select_reactor.hpp deleted file mode 100644 index 09965492785..00000000000 --- a/tools/sdk/include/asio/asio/detail/select_reactor.hpp +++ /dev/null @@ -1,238 +0,0 @@ -// -// detail/select_reactor.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_SELECT_REACTOR_HPP -#define ASIO_DETAIL_SELECT_REACTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_IOCP) \ - || (!defined(ASIO_HAS_DEV_POLL) \ - && !defined(ASIO_HAS_EPOLL) \ - && !defined(ASIO_HAS_KQUEUE) \ - && !defined(ASIO_WINDOWS_RUNTIME)) - -#include -#include "asio/detail/fd_set_adapter.hpp" -#include "asio/detail/limits.hpp" -#include "asio/detail/mutex.hpp" -#include "asio/detail/op_queue.hpp" -#include "asio/detail/reactor_op.hpp" -#include "asio/detail/reactor_op_queue.hpp" -#include "asio/detail/select_interrupter.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/detail/timer_queue_base.hpp" -#include "asio/detail/timer_queue_set.hpp" -#include "asio/detail/wait_op.hpp" -#include "asio/execution_context.hpp" - -#if defined(ASIO_HAS_IOCP) -# include "asio/detail/thread.hpp" -#endif // defined(ASIO_HAS_IOCP) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class select_reactor - : public execution_context_service_base -{ -public: -#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) - enum op_types { read_op = 0, write_op = 1, except_op = 2, - max_select_ops = 3, connect_op = 3, max_ops = 4 }; -#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) - enum op_types { read_op = 0, write_op = 1, except_op = 2, - max_select_ops = 3, connect_op = 1, max_ops = 3 }; -#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) - - // Per-descriptor data. - struct per_descriptor_data - { - }; - - // Constructor. - ASIO_DECL select_reactor(asio::execution_context& ctx); - - // Destructor. - ASIO_DECL ~select_reactor(); - - // Destroy all user-defined handler objects owned by the service. - ASIO_DECL void shutdown(); - - // Recreate internal descriptors following a fork. - ASIO_DECL void notify_fork( - asio::execution_context::fork_event fork_ev); - - // Initialise the task, but only if the reactor is not in its own thread. - ASIO_DECL void init_task(); - - // Register a socket with the reactor. Returns 0 on success, system error - // code on failure. - ASIO_DECL int register_descriptor(socket_type, per_descriptor_data&); - - // Register a descriptor with an associated single operation. Returns 0 on - // success, system error code on failure. - ASIO_DECL int register_internal_descriptor( - int op_type, socket_type descriptor, - per_descriptor_data& descriptor_data, reactor_op* op); - - // Post a reactor operation for immediate completion. - void post_immediate_completion(reactor_op* op, bool is_continuation) - { - scheduler_.post_immediate_completion(op, is_continuation); - } - - // Start a new operation. The reactor operation will be performed when the - // given descriptor is flagged as ready, or an error has occurred. - ASIO_DECL void start_op(int op_type, socket_type descriptor, - per_descriptor_data&, reactor_op* op, bool is_continuation, bool); - - // Cancel all operations associated with the given descriptor. The - // handlers associated with the descriptor will be invoked with the - // operation_aborted error. - ASIO_DECL void cancel_ops(socket_type descriptor, per_descriptor_data&); - - // Cancel any operations that are running against the descriptor and remove - // its registration from the reactor. The reactor resources associated with - // the descriptor must be released by calling cleanup_descriptor_data. - ASIO_DECL void deregister_descriptor(socket_type descriptor, - per_descriptor_data&, bool closing); - - // Remove the descriptor's registration from the reactor. The reactor - // resources associated with the descriptor must be released by calling - // cleanup_descriptor_data. - ASIO_DECL void deregister_internal_descriptor( - socket_type descriptor, per_descriptor_data&); - - // Perform any post-deregistration cleanup tasks associated with the - // descriptor data. - ASIO_DECL void cleanup_descriptor_data(per_descriptor_data&); - - // Move descriptor registration from one descriptor_data object to another. - ASIO_DECL void move_descriptor(socket_type descriptor, - per_descriptor_data& target_descriptor_data, - per_descriptor_data& source_descriptor_data); - - // Add a new timer queue to the reactor. - template - void add_timer_queue(timer_queue& queue); - - // Remove a timer queue from the reactor. - template - void remove_timer_queue(timer_queue& queue); - - // Schedule a new operation in the given timer queue to expire at the - // specified absolute time. - template - void schedule_timer(timer_queue& queue, - const typename Time_Traits::time_type& time, - typename timer_queue::per_timer_data& timer, wait_op* op); - - // Cancel the timer operations associated with the given token. Returns the - // number of operations that have been posted or dispatched. - template - std::size_t cancel_timer(timer_queue& queue, - typename timer_queue::per_timer_data& timer, - std::size_t max_cancelled = (std::numeric_limits::max)()); - - // Move the timer operations associated with the given timer. - template - void move_timer(timer_queue& queue, - typename timer_queue::per_timer_data& target, - typename timer_queue::per_timer_data& source); - - // Run select once until interrupted or events are ready to be dispatched. - ASIO_DECL void run(long usec, op_queue& ops); - - // Interrupt the select loop. - ASIO_DECL void interrupt(); - -private: -#if defined(ASIO_HAS_IOCP) - // Run the select loop in the thread. - ASIO_DECL void run_thread(); -#endif // defined(ASIO_HAS_IOCP) - - // Helper function to add a new timer queue. - ASIO_DECL void do_add_timer_queue(timer_queue_base& queue); - - // Helper function to remove a timer queue. - ASIO_DECL void do_remove_timer_queue(timer_queue_base& queue); - - // Get the timeout value for the select call. - ASIO_DECL timeval* get_timeout(long usec, timeval& tv); - - // Cancel all operations associated with the given descriptor. This function - // does not acquire the select_reactor's mutex. - ASIO_DECL void cancel_ops_unlocked(socket_type descriptor, - const asio::error_code& ec); - - // The scheduler implementation used to post completions. -# if defined(ASIO_HAS_IOCP) - typedef class win_iocp_io_context scheduler_type; -# else // defined(ASIO_HAS_IOCP) - typedef class scheduler scheduler_type; -# endif // defined(ASIO_HAS_IOCP) - scheduler_type& scheduler_; - - // Mutex to protect access to internal data. - asio::detail::mutex mutex_; - - // The interrupter is used to break a blocking select call. - select_interrupter interrupter_; - - // The queues of read, write and except operations. - reactor_op_queue op_queue_[max_ops]; - - // The file descriptor sets to be passed to the select system call. - fd_set_adapter fd_sets_[max_select_ops]; - - // The timer queues. - timer_queue_set timer_queues_; - -#if defined(ASIO_HAS_IOCP) - // Helper class to run the reactor loop in a thread. - class thread_function; - friend class thread_function; - - // Does the reactor loop thread need to stop. - bool stop_thread_; - - // The thread that is running the reactor loop. - asio::detail::thread* thread_; -#endif // defined(ASIO_HAS_IOCP) - - // Whether the service has been shut down. - bool shutdown_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/detail/impl/select_reactor.hpp" -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/select_reactor.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_HAS_IOCP) - // || (!defined(ASIO_HAS_DEV_POLL) - // && !defined(ASIO_HAS_EPOLL) - // && !defined(ASIO_HAS_KQUEUE) - // && !defined(ASIO_WINDOWS_RUNTIME)) - -#endif // ASIO_DETAIL_SELECT_REACTOR_HPP diff --git a/tools/sdk/include/asio/asio/detail/service_registry.hpp b/tools/sdk/include/asio/asio/detail/service_registry.hpp deleted file mode 100644 index cda63072f08..00000000000 --- a/tools/sdk/include/asio/asio/detail/service_registry.hpp +++ /dev/null @@ -1,164 +0,0 @@ -// -// detail/service_registry.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_SERVICE_REGISTRY_HPP -#define ASIO_DETAIL_SERVICE_REGISTRY_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/detail/mutex.hpp" -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/execution_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -class io_context; - -namespace detail { - -template -class typeid_wrapper {}; - -class service_registry - : private noncopyable -{ -public: - // Constructor. - ASIO_DECL service_registry(execution_context& owner); - - // Destructor. - ASIO_DECL ~service_registry(); - - // Shutdown all services. - ASIO_DECL void shutdown_services(); - - // Destroy all services. - ASIO_DECL void destroy_services(); - - // Notify all services of a fork event. - ASIO_DECL void notify_fork(execution_context::fork_event fork_ev); - - // Get the service object corresponding to the specified service type. Will - // create a new service object automatically if no such object already - // exists. Ownership of the service object is not transferred to the caller. - template - Service& use_service(); - - // Get the service object corresponding to the specified service type. Will - // create a new service object automatically if no such object already - // exists. Ownership of the service object is not transferred to the caller. - // This overload is used for backwards compatibility with services that - // inherit from io_context::service. - template - Service& use_service(io_context& owner); - - // Add a service object. Throws on error, in which case ownership of the - // object is retained by the caller. - template - void add_service(Service* new_service); - - // Check whether a service object of the specified type already exists. - template - bool has_service() const; - -private: - // Initalise a service's key when the key_type typedef is not available. - template - static void init_key(execution_context::service::key& key, ...); - -#if !defined(ASIO_NO_TYPEID) - // Initalise a service's key when the key_type typedef is available. - template - static void init_key(execution_context::service::key& key, - typename enable_if< - is_base_of::value>::type*); -#endif // !defined(ASIO_NO_TYPEID) - - // Initialise a service's key based on its id. - ASIO_DECL static void init_key_from_id( - execution_context::service::key& key, - const execution_context::id& id); - -#if !defined(ASIO_NO_TYPEID) - // Initialise a service's key based on its id. - template - static void init_key_from_id(execution_context::service::key& key, - const service_id& /*id*/); -#endif // !defined(ASIO_NO_TYPEID) - - // Check if a service matches the given id. - ASIO_DECL static bool keys_match( - const execution_context::service::key& key1, - const execution_context::service::key& key2); - - // The type of a factory function used for creating a service instance. - typedef execution_context::service*(*factory_type)(void*); - - // Factory function for creating a service instance. - template - static execution_context::service* create(void* owner); - - // Destroy a service instance. - ASIO_DECL static void destroy(execution_context::service* service); - - // Helper class to manage service pointers. - struct auto_service_ptr; - friend struct auto_service_ptr; - struct auto_service_ptr - { - execution_context::service* ptr_; - ~auto_service_ptr() { destroy(ptr_); } - }; - - // Get the service object corresponding to the specified service key. Will - // create a new service object automatically if no such object already - // exists. Ownership of the service object is not transferred to the caller. - ASIO_DECL execution_context::service* do_use_service( - const execution_context::service::key& key, - factory_type factory, void* owner); - - // Add a service object. Throws on error, in which case ownership of the - // object is retained by the caller. - ASIO_DECL void do_add_service( - const execution_context::service::key& key, - execution_context::service* new_service); - - // Check whether a service object with the specified key already exists. - ASIO_DECL bool do_has_service( - const execution_context::service::key& key) const; - - // Mutex to protect access to internal data. - mutable asio::detail::mutex mutex_; - - // The owner of this service registry and the services it contains. - execution_context& owner_; - - // The first service in the list of contained services. - execution_context::service* first_service_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/detail/impl/service_registry.hpp" -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/service_registry.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_DETAIL_SERVICE_REGISTRY_HPP diff --git a/tools/sdk/include/asio/asio/detail/signal_blocker.hpp b/tools/sdk/include/asio/asio/detail/signal_blocker.hpp deleted file mode 100644 index b684295775f..00000000000 --- a/tools/sdk/include/asio/asio/detail/signal_blocker.hpp +++ /dev/null @@ -1,44 +0,0 @@ -// -// detail/signal_blocker.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_SIGNAL_BLOCKER_HPP -#define ASIO_DETAIL_SIGNAL_BLOCKER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_HAS_THREADS) || defined(ASIO_WINDOWS) \ - || defined(ASIO_WINDOWS_RUNTIME) \ - || defined(__CYGWIN__) || defined(__SYMBIAN32__) -# include "asio/detail/null_signal_blocker.hpp" -#elif defined(ASIO_HAS_PTHREADS) -# include "asio/detail/posix_signal_blocker.hpp" -#else -# error Only Windows and POSIX are supported! -#endif - -namespace asio { -namespace detail { - -#if !defined(ASIO_HAS_THREADS) || defined(ASIO_WINDOWS) \ - || defined(ASIO_WINDOWS_RUNTIME) \ - || defined(__CYGWIN__) || defined(__SYMBIAN32__) -typedef null_signal_blocker signal_blocker; -#elif defined(ASIO_HAS_PTHREADS) -typedef posix_signal_blocker signal_blocker; -#endif - -} // namespace detail -} // namespace asio - -#endif // ASIO_DETAIL_SIGNAL_BLOCKER_HPP diff --git a/tools/sdk/include/asio/asio/detail/signal_handler.hpp b/tools/sdk/include/asio/asio/detail/signal_handler.hpp deleted file mode 100644 index d1c99105a7e..00000000000 --- a/tools/sdk/include/asio/asio/detail/signal_handler.hpp +++ /dev/null @@ -1,86 +0,0 @@ -// -// detail/signal_handler.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_SIGNAL_HANDLER_HPP -#define ASIO_DETAIL_SIGNAL_HANDLER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/handler_work.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/signal_op.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class signal_handler : public signal_op -{ -public: - ASIO_DEFINE_HANDLER_PTR(signal_handler); - - signal_handler(Handler& h) - : signal_op(&signal_handler::do_complete), - handler_(ASIO_MOVE_CAST(Handler)(h)) - { - handler_work::start(handler_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& /*ec*/, - std::size_t /*bytes_transferred*/) - { - // Take ownership of the handler object. - signal_handler* h(static_cast(base)); - ptr p = { asio::detail::addressof(h->handler_), h, h }; - handler_work w(h->handler_); - - ASIO_HANDLER_COMPLETION((*h)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder2 - handler(h->handler_, h->ec_, h->signal_number_); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_SIGNAL_HANDLER_HPP diff --git a/tools/sdk/include/asio/asio/detail/signal_init.hpp b/tools/sdk/include/asio/asio/detail/signal_init.hpp deleted file mode 100644 index 814ff519624..00000000000 --- a/tools/sdk/include/asio/asio/detail/signal_init.hpp +++ /dev/null @@ -1,47 +0,0 @@ -// -// detail/signal_init.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_SIGNAL_INIT_HPP -#define ASIO_DETAIL_SIGNAL_INIT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) - -#include - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class signal_init -{ -public: - // Constructor. - signal_init() - { - std::signal(Signal, SIG_IGN); - } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) - -#endif // ASIO_DETAIL_SIGNAL_INIT_HPP diff --git a/tools/sdk/include/asio/asio/detail/signal_op.hpp b/tools/sdk/include/asio/asio/detail/signal_op.hpp deleted file mode 100644 index c4e364c14e5..00000000000 --- a/tools/sdk/include/asio/asio/detail/signal_op.hpp +++ /dev/null @@ -1,49 +0,0 @@ -// -// detail/signal_op.hpp -// ~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_SIGNAL_OP_HPP -#define ASIO_DETAIL_SIGNAL_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/operation.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class signal_op - : public operation -{ -public: - // The error code to be passed to the completion handler. - asio::error_code ec_; - - // The signal number to be passed to the completion handler. - int signal_number_; - -protected: - signal_op(func_type func) - : operation(func), - signal_number_(0) - { - } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_SIGNAL_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/signal_set_service.hpp b/tools/sdk/include/asio/asio/detail/signal_set_service.hpp deleted file mode 100644 index a18ab709356..00000000000 --- a/tools/sdk/include/asio/asio/detail/signal_set_service.hpp +++ /dev/null @@ -1,217 +0,0 @@ -// -// detail/signal_set_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_SIGNAL_SET_SERVICE_HPP -#define ASIO_DETAIL_SIGNAL_SET_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include -#include -#include "asio/error.hpp" -#include "asio/io_context.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/op_queue.hpp" -#include "asio/detail/signal_handler.hpp" -#include "asio/detail/signal_op.hpp" -#include "asio/detail/socket_types.hpp" - -#if !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) -# include "asio/detail/reactor.hpp" -#endif // !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -#if defined(NSIG) && (NSIG > 0) -enum { max_signal_number = NSIG }; -#else -enum { max_signal_number = 128 }; -#endif - -extern ASIO_DECL struct signal_state* get_signal_state(); - -extern "C" ASIO_DECL void asio_signal_handler(int signal_number); - -class signal_set_service : - public service_base -{ -public: - // Type used for tracking an individual signal registration. - class registration - { - public: - // Default constructor. - registration() - : signal_number_(0), - queue_(0), - undelivered_(0), - next_in_table_(0), - prev_in_table_(0), - next_in_set_(0) - { - } - - private: - // Only this service will have access to the internal values. - friend class signal_set_service; - - // The signal number that is registered. - int signal_number_; - - // The waiting signal handlers. - op_queue* queue_; - - // The number of undelivered signals. - std::size_t undelivered_; - - // Pointers to adjacent registrations in the registrations_ table. - registration* next_in_table_; - registration* prev_in_table_; - - // Link to next registration in the signal set. - registration* next_in_set_; - }; - - // The implementation type of the signal_set. - class implementation_type - { - public: - // Default constructor. - implementation_type() - : signals_(0) - { - } - - private: - // Only this service will have access to the internal values. - friend class signal_set_service; - - // The pending signal handlers. - op_queue queue_; - - // Linked list of registered signals. - registration* signals_; - }; - - // Constructor. - ASIO_DECL signal_set_service(asio::io_context& io_context); - - // Destructor. - ASIO_DECL ~signal_set_service(); - - // Destroy all user-defined handler objects owned by the service. - ASIO_DECL void shutdown(); - - // Perform fork-related housekeeping. - ASIO_DECL void notify_fork( - asio::io_context::fork_event fork_ev); - - // Construct a new signal_set implementation. - ASIO_DECL void construct(implementation_type& impl); - - // Destroy a signal_set implementation. - ASIO_DECL void destroy(implementation_type& impl); - - // Add a signal to a signal_set. - ASIO_DECL asio::error_code add(implementation_type& impl, - int signal_number, asio::error_code& ec); - - // Remove a signal to a signal_set. - ASIO_DECL asio::error_code remove(implementation_type& impl, - int signal_number, asio::error_code& ec); - - // Remove all signals from a signal_set. - ASIO_DECL asio::error_code clear(implementation_type& impl, - asio::error_code& ec); - - // Cancel all operations associated with the signal set. - ASIO_DECL asio::error_code cancel(implementation_type& impl, - asio::error_code& ec); - - // Start an asynchronous operation to wait for a signal to be delivered. - template - void async_wait(implementation_type& impl, Handler& handler) - { - // Allocate and construct an operation to wrap the handler. - typedef signal_handler op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(handler); - - ASIO_HANDLER_CREATION((io_context_.context(), - *p.p, "signal_set", &impl, 0, "async_wait")); - - start_wait_op(impl, p.p); - p.v = p.p = 0; - } - - // Deliver notification that a particular signal occurred. - ASIO_DECL static void deliver_signal(int signal_number); - -private: - // Helper function to add a service to the global signal state. - ASIO_DECL static void add_service(signal_set_service* service); - - // Helper function to remove a service from the global signal state. - ASIO_DECL static void remove_service(signal_set_service* service); - - // Helper function to create the pipe descriptors. - ASIO_DECL static void open_descriptors(); - - // Helper function to close the pipe descriptors. - ASIO_DECL static void close_descriptors(); - - // Helper function to start a wait operation. - ASIO_DECL void start_wait_op(implementation_type& impl, signal_op* op); - - // The io_context instance used for dispatching handlers. - io_context_impl& io_context_; - -#if !defined(ASIO_WINDOWS) \ - && !defined(ASIO_WINDOWS_RUNTIME) \ - && !defined(__CYGWIN__) - // The type used for registering for pipe reactor notifications. - class pipe_read_op; - - // The reactor used for waiting for pipe readiness. - reactor& reactor_; - - // The per-descriptor reactor data used for the pipe. - reactor::per_descriptor_data reactor_data_; -#endif // !defined(ASIO_WINDOWS) - // && !defined(ASIO_WINDOWS_RUNTIME) - // && !defined(__CYGWIN__) - - // A mapping from signal number to the registered signal sets. - registration* registrations_[max_signal_number]; - - // Pointers to adjacent services in linked list. - signal_set_service* next_; - signal_set_service* prev_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/signal_set_service.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_DETAIL_SIGNAL_SET_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/detail/socket_holder.hpp b/tools/sdk/include/asio/asio/detail/socket_holder.hpp deleted file mode 100644 index 99b081f7129..00000000000 --- a/tools/sdk/include/asio/asio/detail/socket_holder.hpp +++ /dev/null @@ -1,98 +0,0 @@ -// -// detail/socket_holder.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_SOCKET_HOLDER_HPP -#define ASIO_DETAIL_SOCKET_HOLDER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/socket_ops.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -// Implement the resource acquisition is initialisation idiom for sockets. -class socket_holder - : private noncopyable -{ -public: - // Construct as an uninitialised socket. - socket_holder() - : socket_(invalid_socket) - { - } - - // Construct to take ownership of the specified socket. - explicit socket_holder(socket_type s) - : socket_(s) - { - } - - // Destructor. - ~socket_holder() - { - if (socket_ != invalid_socket) - { - asio::error_code ec; - socket_ops::state_type state = 0; - socket_ops::close(socket_, state, true, ec); - } - } - - // Get the underlying socket. - socket_type get() const - { - return socket_; - } - - // Reset to an uninitialised socket. - void reset() - { - if (socket_ != invalid_socket) - { - asio::error_code ec; - socket_ops::state_type state = 0; - socket_ops::close(socket_, state, true, ec); - socket_ = invalid_socket; - } - } - - // Reset to take ownership of the specified socket. - void reset(socket_type s) - { - reset(); - socket_ = s; - } - - // Release ownership of the socket. - socket_type release() - { - socket_type tmp = socket_; - socket_ = invalid_socket; - return tmp; - } - -private: - // The underlying socket. - socket_type socket_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_SOCKET_HOLDER_HPP diff --git a/tools/sdk/include/asio/asio/detail/socket_ops.hpp b/tools/sdk/include/asio/asio/detail/socket_ops.hpp deleted file mode 100644 index 815b0d1c8e0..00000000000 --- a/tools/sdk/include/asio/asio/detail/socket_ops.hpp +++ /dev/null @@ -1,337 +0,0 @@ -// -// detail/socket_ops.hpp -// ~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_SOCKET_OPS_HPP -#define ASIO_DETAIL_SOCKET_OPS_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include "asio/error_code.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/socket_types.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { -namespace socket_ops { - -// Socket state bits. -enum -{ - // The user wants a non-blocking socket. - user_set_non_blocking = 1, - - // The socket has been set non-blocking. - internal_non_blocking = 2, - - // Helper "state" used to determine whether the socket is non-blocking. - non_blocking = user_set_non_blocking | internal_non_blocking, - - // User wants connection_aborted errors, which are disabled by default. - enable_connection_aborted = 4, - - // The user set the linger option. Needs to be checked when closing. - user_set_linger = 8, - - // The socket is stream-oriented. - stream_oriented = 16, - - // The socket is datagram-oriented. - datagram_oriented = 32, - - // The socket may have been dup()-ed. - possible_dup = 64 -}; - -typedef unsigned char state_type; - -struct noop_deleter { void operator()(void*) {} }; -typedef shared_ptr shared_cancel_token_type; -typedef weak_ptr weak_cancel_token_type; - -#if !defined(ASIO_WINDOWS_RUNTIME) - -ASIO_DECL socket_type accept(socket_type s, socket_addr_type* addr, - std::size_t* addrlen, asio::error_code& ec); - -ASIO_DECL socket_type sync_accept(socket_type s, - state_type state, socket_addr_type* addr, - std::size_t* addrlen, asio::error_code& ec); - -#if defined(ASIO_HAS_IOCP) - -ASIO_DECL void complete_iocp_accept(socket_type s, - void* output_buffer, DWORD address_length, - socket_addr_type* addr, std::size_t* addrlen, - socket_type new_socket, asio::error_code& ec); - -#else // defined(ASIO_HAS_IOCP) - -ASIO_DECL bool non_blocking_accept(socket_type s, - state_type state, socket_addr_type* addr, std::size_t* addrlen, - asio::error_code& ec, socket_type& new_socket); - -#endif // defined(ASIO_HAS_IOCP) - -ASIO_DECL int bind(socket_type s, const socket_addr_type* addr, - std::size_t addrlen, asio::error_code& ec); - -ASIO_DECL int close(socket_type s, state_type& state, - bool destruction, asio::error_code& ec); - -ASIO_DECL bool set_user_non_blocking(socket_type s, - state_type& state, bool value, asio::error_code& ec); - -ASIO_DECL bool set_internal_non_blocking(socket_type s, - state_type& state, bool value, asio::error_code& ec); - -ASIO_DECL int shutdown(socket_type s, - int what, asio::error_code& ec); - -ASIO_DECL int connect(socket_type s, const socket_addr_type* addr, - std::size_t addrlen, asio::error_code& ec); - -ASIO_DECL void sync_connect(socket_type s, const socket_addr_type* addr, - std::size_t addrlen, asio::error_code& ec); - -#if defined(ASIO_HAS_IOCP) - -ASIO_DECL void complete_iocp_connect(socket_type s, - asio::error_code& ec); - -#endif // defined(ASIO_HAS_IOCP) - -ASIO_DECL bool non_blocking_connect(socket_type s, - asio::error_code& ec); - -ASIO_DECL int socketpair(int af, int type, int protocol, - socket_type sv[2], asio::error_code& ec); - -ASIO_DECL bool sockatmark(socket_type s, asio::error_code& ec); - -ASIO_DECL size_t available(socket_type s, asio::error_code& ec); - -ASIO_DECL int listen(socket_type s, - int backlog, asio::error_code& ec); - -#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) -typedef WSABUF buf; -#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) -typedef iovec buf; -#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) - -ASIO_DECL void init_buf(buf& b, void* data, size_t size); - -ASIO_DECL void init_buf(buf& b, const void* data, size_t size); - -ASIO_DECL signed_size_type recv(socket_type s, buf* bufs, - size_t count, int flags, asio::error_code& ec); - -ASIO_DECL size_t sync_recv(socket_type s, state_type state, buf* bufs, - size_t count, int flags, bool all_empty, asio::error_code& ec); - -#if defined(ASIO_HAS_IOCP) - -ASIO_DECL void complete_iocp_recv(state_type state, - const weak_cancel_token_type& cancel_token, bool all_empty, - asio::error_code& ec, size_t bytes_transferred); - -#else // defined(ASIO_HAS_IOCP) - -ASIO_DECL bool non_blocking_recv(socket_type s, - buf* bufs, size_t count, int flags, bool is_stream, - asio::error_code& ec, size_t& bytes_transferred); - -#endif // defined(ASIO_HAS_IOCP) - -ASIO_DECL signed_size_type recvfrom(socket_type s, buf* bufs, - size_t count, int flags, socket_addr_type* addr, - std::size_t* addrlen, asio::error_code& ec); - -ASIO_DECL size_t sync_recvfrom(socket_type s, state_type state, - buf* bufs, size_t count, int flags, socket_addr_type* addr, - std::size_t* addrlen, asio::error_code& ec); - -#if defined(ASIO_HAS_IOCP) - -ASIO_DECL void complete_iocp_recvfrom( - const weak_cancel_token_type& cancel_token, - asio::error_code& ec); - -#else // defined(ASIO_HAS_IOCP) - -ASIO_DECL bool non_blocking_recvfrom(socket_type s, - buf* bufs, size_t count, int flags, - socket_addr_type* addr, std::size_t* addrlen, - asio::error_code& ec, size_t& bytes_transferred); - -#endif // defined(ASIO_HAS_IOCP) - -ASIO_DECL signed_size_type recvmsg(socket_type s, buf* bufs, - size_t count, int in_flags, int& out_flags, - asio::error_code& ec); - -ASIO_DECL size_t sync_recvmsg(socket_type s, state_type state, - buf* bufs, size_t count, int in_flags, int& out_flags, - asio::error_code& ec); - -#if defined(ASIO_HAS_IOCP) - -ASIO_DECL void complete_iocp_recvmsg( - const weak_cancel_token_type& cancel_token, - asio::error_code& ec); - -#else // defined(ASIO_HAS_IOCP) - -ASIO_DECL bool non_blocking_recvmsg(socket_type s, - buf* bufs, size_t count, int in_flags, int& out_flags, - asio::error_code& ec, size_t& bytes_transferred); - -#endif // defined(ASIO_HAS_IOCP) - -ASIO_DECL signed_size_type send(socket_type s, const buf* bufs, - size_t count, int flags, asio::error_code& ec); - -ASIO_DECL size_t sync_send(socket_type s, state_type state, - const buf* bufs, size_t count, int flags, - bool all_empty, asio::error_code& ec); - -#if defined(ASIO_HAS_IOCP) - -ASIO_DECL void complete_iocp_send( - const weak_cancel_token_type& cancel_token, - asio::error_code& ec); - -#else // defined(ASIO_HAS_IOCP) - -ASIO_DECL bool non_blocking_send(socket_type s, - const buf* bufs, size_t count, int flags, - asio::error_code& ec, size_t& bytes_transferred); - -#endif // defined(ASIO_HAS_IOCP) - -ASIO_DECL signed_size_type sendto(socket_type s, const buf* bufs, - size_t count, int flags, const socket_addr_type* addr, - std::size_t addrlen, asio::error_code& ec); - -ASIO_DECL size_t sync_sendto(socket_type s, state_type state, - const buf* bufs, size_t count, int flags, const socket_addr_type* addr, - std::size_t addrlen, asio::error_code& ec); - -#if !defined(ASIO_HAS_IOCP) - -ASIO_DECL bool non_blocking_sendto(socket_type s, - const buf* bufs, size_t count, int flags, - const socket_addr_type* addr, std::size_t addrlen, - asio::error_code& ec, size_t& bytes_transferred); - -#endif // !defined(ASIO_HAS_IOCP) - -ASIO_DECL socket_type socket(int af, int type, int protocol, - asio::error_code& ec); - -ASIO_DECL int setsockopt(socket_type s, state_type& state, - int level, int optname, const void* optval, - std::size_t optlen, asio::error_code& ec); - -ASIO_DECL int getsockopt(socket_type s, state_type state, - int level, int optname, void* optval, - size_t* optlen, asio::error_code& ec); - -ASIO_DECL int getpeername(socket_type s, socket_addr_type* addr, - std::size_t* addrlen, bool cached, asio::error_code& ec); - -ASIO_DECL int getsockname(socket_type s, socket_addr_type* addr, - std::size_t* addrlen, asio::error_code& ec); - -ASIO_DECL int ioctl(socket_type s, state_type& state, - int cmd, ioctl_arg_type* arg, asio::error_code& ec); - -ASIO_DECL int select(int nfds, fd_set* readfds, fd_set* writefds, - fd_set* exceptfds, timeval* timeout, asio::error_code& ec); - -ASIO_DECL int poll_read(socket_type s, - state_type state, int msec, asio::error_code& ec); - -ASIO_DECL int poll_write(socket_type s, - state_type state, int msec, asio::error_code& ec); - -ASIO_DECL int poll_error(socket_type s, - state_type state, int msec, asio::error_code& ec); - -ASIO_DECL int poll_connect(socket_type s, - int msec, asio::error_code& ec); - -#endif // !defined(ASIO_WINDOWS_RUNTIME) - -ASIO_DECL const char* inet_ntop(int af, const void* src, char* dest, - size_t length, unsigned long scope_id, asio::error_code& ec); - -ASIO_DECL int inet_pton(int af, const char* src, void* dest, - unsigned long* scope_id, asio::error_code& ec); - -ASIO_DECL int gethostname(char* name, - int namelen, asio::error_code& ec); - -#if !defined(ASIO_WINDOWS_RUNTIME) - -ASIO_DECL asio::error_code getaddrinfo(const char* host, - const char* service, const addrinfo_type& hints, - addrinfo_type** result, asio::error_code& ec); - -ASIO_DECL asio::error_code background_getaddrinfo( - const weak_cancel_token_type& cancel_token, const char* host, - const char* service, const addrinfo_type& hints, - addrinfo_type** result, asio::error_code& ec); - -ASIO_DECL void freeaddrinfo(addrinfo_type* ai); - -ASIO_DECL asio::error_code getnameinfo( - const socket_addr_type* addr, std::size_t addrlen, - char* host, std::size_t hostlen, char* serv, - std::size_t servlen, int flags, asio::error_code& ec); - -ASIO_DECL asio::error_code sync_getnameinfo( - const socket_addr_type* addr, std::size_t addrlen, - char* host, std::size_t hostlen, char* serv, - std::size_t servlen, int sock_type, asio::error_code& ec); - -ASIO_DECL asio::error_code background_getnameinfo( - const weak_cancel_token_type& cancel_token, - const socket_addr_type* addr, std::size_t addrlen, - char* host, std::size_t hostlen, char* serv, - std::size_t servlen, int sock_type, asio::error_code& ec); - -#endif // !defined(ASIO_WINDOWS_RUNTIME) - -ASIO_DECL u_long_type network_to_host_long(u_long_type value); - -ASIO_DECL u_long_type host_to_network_long(u_long_type value); - -ASIO_DECL u_short_type network_to_host_short(u_short_type value); - -ASIO_DECL u_short_type host_to_network_short(u_short_type value); - -} // namespace socket_ops -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/socket_ops.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_DETAIL_SOCKET_OPS_HPP diff --git a/tools/sdk/include/asio/asio/detail/socket_option.hpp b/tools/sdk/include/asio/asio/detail/socket_option.hpp deleted file mode 100644 index 6852d56993e..00000000000 --- a/tools/sdk/include/asio/asio/detail/socket_option.hpp +++ /dev/null @@ -1,316 +0,0 @@ -// -// detail/socket_option.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_SOCKET_OPTION_HPP -#define ASIO_DETAIL_SOCKET_OPTION_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include -#include "asio/detail/socket_types.hpp" -#include "asio/detail/throw_exception.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { -namespace socket_option { - -// Helper template for implementing boolean-based options. -template -class boolean -{ -public: - // Default constructor. - boolean() - : value_(0) - { - } - - // Construct with a specific option value. - explicit boolean(bool v) - : value_(v ? 1 : 0) - { - } - - // Set the current value of the boolean. - boolean& operator=(bool v) - { - value_ = v ? 1 : 0; - return *this; - } - - // Get the current value of the boolean. - bool value() const - { - return !!value_; - } - - // Convert to bool. - operator bool() const - { - return !!value_; - } - - // Test for false. - bool operator!() const - { - return !value_; - } - - // Get the level of the socket option. - template - int level(const Protocol&) const - { - return Level; - } - - // Get the name of the socket option. - template - int name(const Protocol&) const - { - return Name; - } - - // Get the address of the boolean data. - template - int* data(const Protocol&) - { - return &value_; - } - - // Get the address of the boolean data. - template - const int* data(const Protocol&) const - { - return &value_; - } - - // Get the size of the boolean data. - template - std::size_t size(const Protocol&) const - { - return sizeof(value_); - } - - // Set the size of the boolean data. - template - void resize(const Protocol&, std::size_t s) - { - // On some platforms (e.g. Windows Vista), the getsockopt function will - // return the size of a boolean socket option as one byte, even though a - // four byte integer was passed in. - switch (s) - { - case sizeof(char): - value_ = *reinterpret_cast(&value_) ? 1 : 0; - break; - case sizeof(value_): - break; - default: - { - std::length_error ex("boolean socket option resize"); - asio::detail::throw_exception(ex); - } - } - } - -private: - int value_; -}; - -// Helper template for implementing integer options. -template -class integer -{ -public: - // Default constructor. - integer() - : value_(0) - { - } - - // Construct with a specific option value. - explicit integer(int v) - : value_(v) - { - } - - // Set the value of the int option. - integer& operator=(int v) - { - value_ = v; - return *this; - } - - // Get the current value of the int option. - int value() const - { - return value_; - } - - // Get the level of the socket option. - template - int level(const Protocol&) const - { - return Level; - } - - // Get the name of the socket option. - template - int name(const Protocol&) const - { - return Name; - } - - // Get the address of the int data. - template - int* data(const Protocol&) - { - return &value_; - } - - // Get the address of the int data. - template - const int* data(const Protocol&) const - { - return &value_; - } - - // Get the size of the int data. - template - std::size_t size(const Protocol&) const - { - return sizeof(value_); - } - - // Set the size of the int data. - template - void resize(const Protocol&, std::size_t s) - { - if (s != sizeof(value_)) - { - std::length_error ex("integer socket option resize"); - asio::detail::throw_exception(ex); - } - } - -private: - int value_; -}; - -// Helper template for implementing linger options. -template -class linger -{ -public: - // Default constructor. - linger() - { - value_.l_onoff = 0; - value_.l_linger = 0; - } - - // Construct with specific option values. - linger(bool e, int t) - { - enabled(e); - timeout ASIO_PREVENT_MACRO_SUBSTITUTION(t); - } - - // Set the value for whether linger is enabled. - void enabled(bool value) - { - value_.l_onoff = value ? 1 : 0; - } - - // Get the value for whether linger is enabled. - bool enabled() const - { - return value_.l_onoff != 0; - } - - // Set the value for the linger timeout. - void timeout ASIO_PREVENT_MACRO_SUBSTITUTION(int value) - { -#if defined(WIN32) - value_.l_linger = static_cast(value); -#else - value_.l_linger = value; -#endif - } - - // Get the value for the linger timeout. - int timeout ASIO_PREVENT_MACRO_SUBSTITUTION() const - { - return static_cast(value_.l_linger); - } - - // Get the level of the socket option. - template - int level(const Protocol&) const - { - return Level; - } - - // Get the name of the socket option. - template - int name(const Protocol&) const - { - return Name; - } - - // Get the address of the linger data. - template - detail::linger_type* data(const Protocol&) - { - return &value_; - } - - // Get the address of the linger data. - template - const detail::linger_type* data(const Protocol&) const - { - return &value_; - } - - // Get the size of the linger data. - template - std::size_t size(const Protocol&) const - { - return sizeof(value_); - } - - // Set the size of the int data. - template - void resize(const Protocol&, std::size_t s) - { - if (s != sizeof(value_)) - { - std::length_error ex("linger socket option resize"); - asio::detail::throw_exception(ex); - } - } - -private: - detail::linger_type value_; -}; - -} // namespace socket_option -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_SOCKET_OPTION_HPP diff --git a/tools/sdk/include/asio/asio/detail/socket_select_interrupter.hpp b/tools/sdk/include/asio/asio/detail/socket_select_interrupter.hpp deleted file mode 100644 index 540b2aebd40..00000000000 --- a/tools/sdk/include/asio/asio/detail/socket_select_interrupter.hpp +++ /dev/null @@ -1,92 +0,0 @@ -// -// detail/socket_select_interrupter.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_SOCKET_SELECT_INTERRUPTER_HPP -#define ASIO_DETAIL_SOCKET_SELECT_INTERRUPTER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_WINDOWS_RUNTIME) - -#if defined(ASIO_WINDOWS) \ - || defined(__CYGWIN__) \ - || defined(__SYMBIAN32__) \ - || defined(ESP_PLATFORM) - -#include "asio/detail/socket_types.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class socket_select_interrupter -{ -public: - // Constructor. - ASIO_DECL socket_select_interrupter(); - - // Destructor. - ASIO_DECL ~socket_select_interrupter(); - - // Recreate the interrupter's descriptors. Used after a fork. - ASIO_DECL void recreate(); - - // Interrupt the select call. - ASIO_DECL void interrupt(); - - // Reset the select interrupt. Returns true if the call was interrupted. - ASIO_DECL bool reset(); - - // Get the read descriptor to be passed to select. - socket_type read_descriptor() const - { - return read_descriptor_; - } - -private: - // Open the descriptors. Throws on error. - ASIO_DECL void open_descriptors(); - - // Close the descriptors. - ASIO_DECL void close_descriptors(); - - // The read end of a connection used to interrupt the select call. This file - // descriptor is passed to select such that when it is time to stop, a single - // byte will be written on the other end of the connection and this - // descriptor will become readable. - socket_type read_descriptor_; - - // The write end of a connection used to interrupt the select call. A single - // byte may be written to this to wake up the select which is waiting for the - // other end to become readable. - socket_type write_descriptor_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/socket_select_interrupter.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_WINDOWS) - // || defined(__CYGWIN__) - // || defined(__SYMBIAN32__) - -#endif // !defined(ASIO_WINDOWS_RUNTIME) - -#endif // ASIO_DETAIL_SOCKET_SELECT_INTERRUPTER_HPP diff --git a/tools/sdk/include/asio/asio/detail/socket_types.hpp b/tools/sdk/include/asio/asio/detail/socket_types.hpp deleted file mode 100644 index 6f1abb20536..00000000000 --- a/tools/sdk/include/asio/asio/detail/socket_types.hpp +++ /dev/null @@ -1,419 +0,0 @@ -// -// detail/socket_types.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_SOCKET_TYPES_HPP -#define ASIO_DETAIL_SOCKET_TYPES_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_WINDOWS_RUNTIME) -// Empty. -#elif defined(ASIO_WINDOWS) || defined(__CYGWIN__) -# if defined(_WINSOCKAPI_) && !defined(_WINSOCK2API_) -# error WinSock.h has already been included -# endif // defined(_WINSOCKAPI_) && !defined(_WINSOCK2API_) -# if defined(__BORLANDC__) -# include // Needed for __errno -# if !defined(_WSPIAPI_H_) -# define _WSPIAPI_H_ -# define ASIO_WSPIAPI_H_DEFINED -# endif // !defined(_WSPIAPI_H_) -# endif // defined(__BORLANDC__) -# include -# include -# if defined(WINAPI_FAMILY) -# if ((WINAPI_FAMILY & WINAPI_PARTITION_DESKTOP) != 0) -# include -# endif // ((WINAPI_FAMILY & WINAPI_PARTITION_DESKTOP) != 0) -# endif // defined(WINAPI_FAMILY) -# if !defined(ASIO_WINDOWS_APP) -# include -# endif // !defined(ASIO_WINDOWS_APP) -# if defined(ASIO_WSPIAPI_H_DEFINED) -# undef _WSPIAPI_H_ -# undef ASIO_WSPIAPI_H_DEFINED -# endif // defined(ASIO_WSPIAPI_H_DEFINED) -# if !defined(ASIO_NO_DEFAULT_LINKED_LIBS) -# if defined(UNDER_CE) -# pragma comment(lib, "ws2.lib") -# elif defined(_MSC_VER) || defined(__BORLANDC__) -# pragma comment(lib, "ws2_32.lib") -# if !defined(ASIO_WINDOWS_APP) -# pragma comment(lib, "mswsock.lib") -# endif // !defined(ASIO_WINDOWS_APP) -# endif // defined(_MSC_VER) || defined(__BORLANDC__) -# endif // !defined(ASIO_NO_DEFAULT_LINKED_LIBS) -# include "asio/detail/old_win_sdk_compat.hpp" -#else -# include -# if (defined(__MACH__) && defined(__APPLE__)) \ - || defined(__FreeBSD__) || defined(__NetBSD__) \ - || defined(__OpenBSD__) || defined(__linux__) \ - || defined(__EMSCRIPTEN__) -# include -# elif !defined(__SYMBIAN32__) -# include -# endif -# include -# include -# include -# if defined(__hpux) -# include -# endif -# if !defined(__hpux) || defined(__SELECT) -# include -# endif -# include -# include -# include -# include -# if !defined(__SYMBIAN32__) && !defined(ESP_PLATFORM) -# include -# endif -# include -# include -# include -# if defined(ESP_PLATFORM) -# include "esp_exception.h" -# endif -# include -# if defined(__sun) -# include -# include -# endif -#endif - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -#if defined(ASIO_WINDOWS_RUNTIME) -const int max_addr_v4_str_len = 256; -const int max_addr_v6_str_len = 256; -typedef unsigned __int32 u_long_type; -typedef unsigned __int16 u_short_type; -struct in4_addr_type { u_long_type s_addr; }; -struct in4_mreq_type { in4_addr_type imr_multiaddr, imr_interface; }; -struct in6_addr_type { unsigned char s6_addr[16]; }; -struct in6_mreq_type { in6_addr_type ipv6mr_multiaddr; - unsigned long ipv6mr_interface; }; -struct socket_addr_type { int sa_family; }; -struct sockaddr_in4_type { int sin_family; - in4_addr_type sin_addr; u_short_type sin_port; }; -struct sockaddr_in6_type { int sin6_family; - in6_addr_type sin6_addr; u_short_type sin6_port; - u_long_type sin6_flowinfo; u_long_type sin6_scope_id; }; -struct sockaddr_storage_type { int ss_family; - unsigned char ss_bytes[128 - sizeof(int)]; }; -struct addrinfo_type { int ai_flags; - int ai_family, ai_socktype, ai_protocol; - int ai_addrlen; const void* ai_addr; - const char* ai_canonname; addrinfo_type* ai_next; }; -struct linger_type { u_short_type l_onoff, l_linger; }; -typedef u_long_type ioctl_arg_type; -typedef int signed_size_type; -# define ASIO_OS_DEF(c) ASIO_OS_DEF_##c -# define ASIO_OS_DEF_AF_UNSPEC 0 -# define ASIO_OS_DEF_AF_INET 2 -# define ASIO_OS_DEF_AF_INET6 23 -# define ASIO_OS_DEF_SOCK_STREAM 1 -# define ASIO_OS_DEF_SOCK_DGRAM 2 -# define ASIO_OS_DEF_SOCK_RAW 3 -# define ASIO_OS_DEF_SOCK_SEQPACKET 5 -# define ASIO_OS_DEF_IPPROTO_IP 0 -# define ASIO_OS_DEF_IPPROTO_IPV6 41 -# define ASIO_OS_DEF_IPPROTO_TCP 6 -# define ASIO_OS_DEF_IPPROTO_UDP 17 -# define ASIO_OS_DEF_IPPROTO_ICMP 1 -# define ASIO_OS_DEF_IPPROTO_ICMPV6 58 -# define ASIO_OS_DEF_FIONBIO 1 -# define ASIO_OS_DEF_FIONREAD 2 -# define ASIO_OS_DEF_INADDR_ANY 0 -# define ASIO_OS_DEF_MSG_OOB 0x1 -# define ASIO_OS_DEF_MSG_PEEK 0x2 -# define ASIO_OS_DEF_MSG_DONTROUTE 0x4 -# define ASIO_OS_DEF_MSG_EOR 0 // Not supported. -# define ASIO_OS_DEF_SHUT_RD 0x0 -# define ASIO_OS_DEF_SHUT_WR 0x1 -# define ASIO_OS_DEF_SHUT_RDWR 0x2 -# define ASIO_OS_DEF_SOMAXCONN 0x7fffffff -# define ASIO_OS_DEF_SOL_SOCKET 0xffff -# define ASIO_OS_DEF_SO_BROADCAST 0x20 -# define ASIO_OS_DEF_SO_DEBUG 0x1 -# define ASIO_OS_DEF_SO_DONTROUTE 0x10 -# define ASIO_OS_DEF_SO_KEEPALIVE 0x8 -# define ASIO_OS_DEF_SO_LINGER 0x80 -# define ASIO_OS_DEF_SO_OOBINLINE 0x100 -# define ASIO_OS_DEF_SO_SNDBUF 0x1001 -# define ASIO_OS_DEF_SO_RCVBUF 0x1002 -# define ASIO_OS_DEF_SO_SNDLOWAT 0x1003 -# define ASIO_OS_DEF_SO_RCVLOWAT 0x1004 -# define ASIO_OS_DEF_SO_REUSEADDR 0x4 -# define ASIO_OS_DEF_TCP_NODELAY 0x1 -# define ASIO_OS_DEF_IP_MULTICAST_IF 2 -# define ASIO_OS_DEF_IP_MULTICAST_TTL 3 -# define ASIO_OS_DEF_IP_MULTICAST_LOOP 4 -# define ASIO_OS_DEF_IP_ADD_MEMBERSHIP 5 -# define ASIO_OS_DEF_IP_DROP_MEMBERSHIP 6 -# define ASIO_OS_DEF_IP_TTL 7 -# define ASIO_OS_DEF_IPV6_UNICAST_HOPS 4 -# define ASIO_OS_DEF_IPV6_MULTICAST_IF 9 -# define ASIO_OS_DEF_IPV6_MULTICAST_HOPS 10 -# define ASIO_OS_DEF_IPV6_MULTICAST_LOOP 11 -# define ASIO_OS_DEF_IPV6_JOIN_GROUP 12 -# define ASIO_OS_DEF_IPV6_LEAVE_GROUP 13 -# define ASIO_OS_DEF_AI_CANONNAME 0x2 -# define ASIO_OS_DEF_AI_PASSIVE 0x1 -# define ASIO_OS_DEF_AI_NUMERICHOST 0x4 -# define ASIO_OS_DEF_AI_NUMERICSERV 0x8 -# define ASIO_OS_DEF_AI_V4MAPPED 0x800 -# define ASIO_OS_DEF_AI_ALL 0x100 -# define ASIO_OS_DEF_AI_ADDRCONFIG 0x400 -#elif defined(ASIO_WINDOWS) || defined(__CYGWIN__) -typedef SOCKET socket_type; -const SOCKET invalid_socket = INVALID_SOCKET; -const int socket_error_retval = SOCKET_ERROR; -const int max_addr_v4_str_len = 256; -const int max_addr_v6_str_len = 256; -typedef sockaddr socket_addr_type; -typedef in_addr in4_addr_type; -typedef ip_mreq in4_mreq_type; -typedef sockaddr_in sockaddr_in4_type; -# if defined(ASIO_HAS_OLD_WIN_SDK) -typedef in6_addr_emulation in6_addr_type; -typedef ipv6_mreq_emulation in6_mreq_type; -typedef sockaddr_in6_emulation sockaddr_in6_type; -typedef sockaddr_storage_emulation sockaddr_storage_type; -typedef addrinfo_emulation addrinfo_type; -# else -typedef in6_addr in6_addr_type; -typedef ipv6_mreq in6_mreq_type; -typedef sockaddr_in6 sockaddr_in6_type; -typedef sockaddr_storage sockaddr_storage_type; -typedef addrinfo addrinfo_type; -# endif -typedef ::linger linger_type; -typedef unsigned long ioctl_arg_type; -typedef u_long u_long_type; -typedef u_short u_short_type; -typedef int signed_size_type; -# define ASIO_OS_DEF(c) ASIO_OS_DEF_##c -# define ASIO_OS_DEF_AF_UNSPEC AF_UNSPEC -# define ASIO_OS_DEF_AF_INET AF_INET -# define ASIO_OS_DEF_AF_INET6 AF_INET6 -# define ASIO_OS_DEF_SOCK_STREAM SOCK_STREAM -# define ASIO_OS_DEF_SOCK_DGRAM SOCK_DGRAM -# define ASIO_OS_DEF_SOCK_RAW SOCK_RAW -# define ASIO_OS_DEF_SOCK_SEQPACKET SOCK_SEQPACKET -# define ASIO_OS_DEF_IPPROTO_IP IPPROTO_IP -# define ASIO_OS_DEF_IPPROTO_IPV6 IPPROTO_IPV6 -# define ASIO_OS_DEF_IPPROTO_TCP IPPROTO_TCP -# define ASIO_OS_DEF_IPPROTO_UDP IPPROTO_UDP -# define ASIO_OS_DEF_IPPROTO_ICMP IPPROTO_ICMP -# define ASIO_OS_DEF_IPPROTO_ICMPV6 IPPROTO_ICMPV6 -# define ASIO_OS_DEF_FIONBIO FIONBIO -# define ASIO_OS_DEF_FIONREAD FIONREAD -# define ASIO_OS_DEF_INADDR_ANY INADDR_ANY -# define ASIO_OS_DEF_MSG_OOB MSG_OOB -# define ASIO_OS_DEF_MSG_PEEK MSG_PEEK -# define ASIO_OS_DEF_MSG_DONTROUTE MSG_DONTROUTE -# define ASIO_OS_DEF_MSG_EOR 0 // Not supported on Windows. -# define ASIO_OS_DEF_SHUT_RD SD_RECEIVE -# define ASIO_OS_DEF_SHUT_WR SD_SEND -# define ASIO_OS_DEF_SHUT_RDWR SD_BOTH -# define ASIO_OS_DEF_SOMAXCONN SOMAXCONN -# define ASIO_OS_DEF_SOL_SOCKET SOL_SOCKET -# define ASIO_OS_DEF_SO_BROADCAST SO_BROADCAST -# define ASIO_OS_DEF_SO_DEBUG SO_DEBUG -# define ASIO_OS_DEF_SO_DONTROUTE SO_DONTROUTE -# define ASIO_OS_DEF_SO_KEEPALIVE SO_KEEPALIVE -# define ASIO_OS_DEF_SO_LINGER SO_LINGER -# define ASIO_OS_DEF_SO_OOBINLINE SO_OOBINLINE -# define ASIO_OS_DEF_SO_SNDBUF SO_SNDBUF -# define ASIO_OS_DEF_SO_RCVBUF SO_RCVBUF -# define ASIO_OS_DEF_SO_SNDLOWAT SO_SNDLOWAT -# define ASIO_OS_DEF_SO_RCVLOWAT SO_RCVLOWAT -# define ASIO_OS_DEF_SO_REUSEADDR SO_REUSEADDR -# define ASIO_OS_DEF_TCP_NODELAY TCP_NODELAY -# define ASIO_OS_DEF_IP_MULTICAST_IF IP_MULTICAST_IF -# define ASIO_OS_DEF_IP_MULTICAST_TTL IP_MULTICAST_TTL -# define ASIO_OS_DEF_IP_MULTICAST_LOOP IP_MULTICAST_LOOP -# define ASIO_OS_DEF_IP_ADD_MEMBERSHIP IP_ADD_MEMBERSHIP -# define ASIO_OS_DEF_IP_DROP_MEMBERSHIP IP_DROP_MEMBERSHIP -# define ASIO_OS_DEF_IP_TTL IP_TTL -# define ASIO_OS_DEF_IPV6_UNICAST_HOPS IPV6_UNICAST_HOPS -# define ASIO_OS_DEF_IPV6_MULTICAST_IF IPV6_MULTICAST_IF -# define ASIO_OS_DEF_IPV6_MULTICAST_HOPS IPV6_MULTICAST_HOPS -# define ASIO_OS_DEF_IPV6_MULTICAST_LOOP IPV6_MULTICAST_LOOP -# define ASIO_OS_DEF_IPV6_JOIN_GROUP IPV6_JOIN_GROUP -# define ASIO_OS_DEF_IPV6_LEAVE_GROUP IPV6_LEAVE_GROUP -# define ASIO_OS_DEF_AI_CANONNAME AI_CANONNAME -# define ASIO_OS_DEF_AI_PASSIVE AI_PASSIVE -# define ASIO_OS_DEF_AI_NUMERICHOST AI_NUMERICHOST -# if defined(AI_NUMERICSERV) -# define ASIO_OS_DEF_AI_NUMERICSERV AI_NUMERICSERV -# else -# define ASIO_OS_DEF_AI_NUMERICSERV 0 -# endif -# if defined(AI_V4MAPPED) -# define ASIO_OS_DEF_AI_V4MAPPED AI_V4MAPPED -# else -# define ASIO_OS_DEF_AI_V4MAPPED 0 -# endif -# if defined(AI_ALL) -# define ASIO_OS_DEF_AI_ALL AI_ALL -# else -# define ASIO_OS_DEF_AI_ALL 0 -# endif -# if defined(AI_ADDRCONFIG) -# define ASIO_OS_DEF_AI_ADDRCONFIG AI_ADDRCONFIG -# else -# define ASIO_OS_DEF_AI_ADDRCONFIG 0 -# endif -# if defined (_WIN32_WINNT) -const int max_iov_len = 64; -# else -const int max_iov_len = 16; -# endif -#else -typedef int socket_type; -const int invalid_socket = -1; -const int socket_error_retval = -1; -const int max_addr_v4_str_len = INET_ADDRSTRLEN; -#if defined(INET6_ADDRSTRLEN) -const int max_addr_v6_str_len = INET6_ADDRSTRLEN + 1 + IF_NAMESIZE; -#else // defined(INET6_ADDRSTRLEN) -const int max_addr_v6_str_len = 256; -#endif // defined(INET6_ADDRSTRLEN) -typedef sockaddr socket_addr_type; -typedef in_addr in4_addr_type; -# if defined(__hpux) -// HP-UX doesn't provide ip_mreq when _XOPEN_SOURCE_EXTENDED is defined. -struct in4_mreq_type -{ - struct in_addr imr_multiaddr; - struct in_addr imr_interface; -}; -# else -typedef ip_mreq in4_mreq_type; -# endif -typedef sockaddr_in sockaddr_in4_type; -typedef in6_addr in6_addr_type; -typedef ipv6_mreq in6_mreq_type; -typedef sockaddr_in6 sockaddr_in6_type; -typedef sockaddr_storage sockaddr_storage_type; -typedef sockaddr_un sockaddr_un_type; -typedef addrinfo addrinfo_type; -typedef ::linger linger_type; -typedef int ioctl_arg_type; -typedef uint32_t u_long_type; -typedef uint16_t u_short_type; -#if defined(ASIO_HAS_SSIZE_T) -typedef ssize_t signed_size_type; -#else // defined(ASIO_HAS_SSIZE_T) -typedef int signed_size_type; -#endif // defined(ASIO_HAS_SSIZE_T) -# define ASIO_OS_DEF(c) ASIO_OS_DEF_##c -# define ASIO_OS_DEF_AF_UNSPEC AF_UNSPEC -# define ASIO_OS_DEF_AF_INET AF_INET -# define ASIO_OS_DEF_AF_INET6 AF_INET6 -# define ASIO_OS_DEF_SOCK_STREAM SOCK_STREAM -# define ASIO_OS_DEF_SOCK_DGRAM SOCK_DGRAM -# define ASIO_OS_DEF_SOCK_RAW SOCK_RAW -# define ASIO_OS_DEF_SOCK_SEQPACKET SOCK_SEQPACKET -# define ASIO_OS_DEF_IPPROTO_IP IPPROTO_IP -# define ASIO_OS_DEF_IPPROTO_IPV6 IPPROTO_IPV6 -# define ASIO_OS_DEF_IPPROTO_TCP IPPROTO_TCP -# define ASIO_OS_DEF_IPPROTO_UDP IPPROTO_UDP -# define ASIO_OS_DEF_IPPROTO_ICMP IPPROTO_ICMP -# define ASIO_OS_DEF_IPPROTO_ICMPV6 IPPROTO_ICMPV6 -# define ASIO_OS_DEF_FIONBIO FIONBIO -# define ASIO_OS_DEF_FIONREAD FIONREAD -# define ASIO_OS_DEF_INADDR_ANY INADDR_ANY -# define ASIO_OS_DEF_MSG_OOB MSG_OOB -# define ASIO_OS_DEF_MSG_PEEK MSG_PEEK -# define ASIO_OS_DEF_MSG_DONTROUTE MSG_DONTROUTE -# define ASIO_OS_DEF_MSG_EOR MSG_EOR -# define ASIO_OS_DEF_SHUT_RD SHUT_RD -# define ASIO_OS_DEF_SHUT_WR SHUT_WR -# define ASIO_OS_DEF_SHUT_RDWR SHUT_RDWR -# define ASIO_OS_DEF_SOMAXCONN SOMAXCONN -# define ASIO_OS_DEF_SOL_SOCKET SOL_SOCKET -# define ASIO_OS_DEF_SO_BROADCAST SO_BROADCAST -# define ASIO_OS_DEF_SO_DEBUG SO_DEBUG -# define ASIO_OS_DEF_SO_DONTROUTE SO_DONTROUTE -# define ASIO_OS_DEF_SO_KEEPALIVE SO_KEEPALIVE -# define ASIO_OS_DEF_SO_LINGER SO_LINGER -# define ASIO_OS_DEF_SO_OOBINLINE SO_OOBINLINE -# define ASIO_OS_DEF_SO_SNDBUF SO_SNDBUF -# define ASIO_OS_DEF_SO_RCVBUF SO_RCVBUF -# define ASIO_OS_DEF_SO_SNDLOWAT SO_SNDLOWAT -# define ASIO_OS_DEF_SO_RCVLOWAT SO_RCVLOWAT -# define ASIO_OS_DEF_SO_REUSEADDR SO_REUSEADDR -# define ASIO_OS_DEF_TCP_NODELAY TCP_NODELAY -# define ASIO_OS_DEF_IP_MULTICAST_IF IP_MULTICAST_IF -# define ASIO_OS_DEF_IP_MULTICAST_TTL IP_MULTICAST_TTL -# define ASIO_OS_DEF_IP_MULTICAST_LOOP IP_MULTICAST_LOOP -# define ASIO_OS_DEF_IP_ADD_MEMBERSHIP IP_ADD_MEMBERSHIP -# define ASIO_OS_DEF_IP_DROP_MEMBERSHIP IP_DROP_MEMBERSHIP -# define ASIO_OS_DEF_IP_TTL IP_TTL -# define ASIO_OS_DEF_IPV6_UNICAST_HOPS IPV6_UNICAST_HOPS -# define ASIO_OS_DEF_IPV6_MULTICAST_IF IPV6_MULTICAST_IF -# define ASIO_OS_DEF_IPV6_MULTICAST_HOPS IPV6_MULTICAST_HOPS -# define ASIO_OS_DEF_IPV6_MULTICAST_LOOP IPV6_MULTICAST_LOOP -# define ASIO_OS_DEF_IPV6_JOIN_GROUP IPV6_JOIN_GROUP -# define ASIO_OS_DEF_IPV6_LEAVE_GROUP IPV6_LEAVE_GROUP -# define ASIO_OS_DEF_AI_CANONNAME AI_CANONNAME -# define ASIO_OS_DEF_AI_PASSIVE AI_PASSIVE -# define ASIO_OS_DEF_AI_NUMERICHOST AI_NUMERICHOST -# if defined(AI_NUMERICSERV) -# define ASIO_OS_DEF_AI_NUMERICSERV AI_NUMERICSERV -# else -# define ASIO_OS_DEF_AI_NUMERICSERV 0 -# endif -// Note: QNX Neutrino 6.3 defines AI_V4MAPPED, AI_ALL and AI_ADDRCONFIG but -// does not implement them. Therefore they are specifically excluded here. -# if defined(AI_V4MAPPED) && !defined(__QNXNTO__) -# define ASIO_OS_DEF_AI_V4MAPPED AI_V4MAPPED -# else -# define ASIO_OS_DEF_AI_V4MAPPED 0 -# endif -# if defined(AI_ALL) && !defined(__QNXNTO__) -# define ASIO_OS_DEF_AI_ALL AI_ALL -# else -# define ASIO_OS_DEF_AI_ALL 0 -# endif -# if defined(AI_ADDRCONFIG) && !defined(__QNXNTO__) -# define ASIO_OS_DEF_AI_ADDRCONFIG AI_ADDRCONFIG -# else -# define ASIO_OS_DEF_AI_ADDRCONFIG 0 -# endif -# if defined(IOV_MAX) -const int max_iov_len = IOV_MAX; -# else -// POSIX platforms are not required to define IOV_MAX. -const int max_iov_len = 16; -# endif -#endif -const int custom_socket_option_level = 0xA5100000; -const int enable_connection_aborted_option = 1; -const int always_fail_option = 2; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_SOCKET_TYPES_HPP diff --git a/tools/sdk/include/asio/asio/detail/solaris_fenced_block.hpp b/tools/sdk/include/asio/asio/detail/solaris_fenced_block.hpp deleted file mode 100644 index d48f6a374cd..00000000000 --- a/tools/sdk/include/asio/asio/detail/solaris_fenced_block.hpp +++ /dev/null @@ -1,62 +0,0 @@ -// -// detail/solaris_fenced_block.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_SOLARIS_FENCED_BLOCK_HPP -#define ASIO_DETAIL_SOLARIS_FENCED_BLOCK_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(__sun) - -#include -#include "asio/detail/noncopyable.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class solaris_fenced_block - : private noncopyable -{ -public: - enum half_t { half }; - enum full_t { full }; - - // Constructor for a half fenced block. - explicit solaris_fenced_block(half_t) - { - } - - // Constructor for a full fenced block. - explicit solaris_fenced_block(full_t) - { - membar_consumer(); - } - - // Destructor. - ~solaris_fenced_block() - { - membar_producer(); - } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(__sun) - -#endif // ASIO_DETAIL_SOLARIS_FENCED_BLOCK_HPP diff --git a/tools/sdk/include/asio/asio/detail/static_mutex.hpp b/tools/sdk/include/asio/asio/detail/static_mutex.hpp deleted file mode 100644 index 8f2bc02a084..00000000000 --- a/tools/sdk/include/asio/asio/detail/static_mutex.hpp +++ /dev/null @@ -1,52 +0,0 @@ -// -// detail/static_mutex.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_STATIC_MUTEX_HPP -#define ASIO_DETAIL_STATIC_MUTEX_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_HAS_THREADS) -# include "asio/detail/null_static_mutex.hpp" -#elif defined(ASIO_WINDOWS) -# include "asio/detail/win_static_mutex.hpp" -#elif defined(ASIO_HAS_PTHREADS) -# include "asio/detail/posix_static_mutex.hpp" -#elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) -# include "asio/detail/std_static_mutex.hpp" -#else -# error Only Windows and POSIX are supported! -#endif - -namespace asio { -namespace detail { - -#if !defined(ASIO_HAS_THREADS) -typedef null_static_mutex static_mutex; -# define ASIO_STATIC_MUTEX_INIT ASIO_NULL_STATIC_MUTEX_INIT -#elif defined(ASIO_WINDOWS) -typedef win_static_mutex static_mutex; -# define ASIO_STATIC_MUTEX_INIT ASIO_WIN_STATIC_MUTEX_INIT -#elif defined(ASIO_HAS_PTHREADS) -typedef posix_static_mutex static_mutex; -# define ASIO_STATIC_MUTEX_INIT ASIO_POSIX_STATIC_MUTEX_INIT -#elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) -typedef std_static_mutex static_mutex; -# define ASIO_STATIC_MUTEX_INIT ASIO_STD_STATIC_MUTEX_INIT -#endif - -} // namespace detail -} // namespace asio - -#endif // ASIO_DETAIL_STATIC_MUTEX_HPP diff --git a/tools/sdk/include/asio/asio/detail/std_event.hpp b/tools/sdk/include/asio/asio/detail/std_event.hpp deleted file mode 100644 index 5639ecdd432..00000000000 --- a/tools/sdk/include/asio/asio/detail/std_event.hpp +++ /dev/null @@ -1,176 +0,0 @@ -// -// detail/std_event.hpp -// ~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_STD_EVENT_HPP -#define ASIO_DETAIL_STD_EVENT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) - -#include -#include -#include "asio/detail/assert.hpp" -#include "asio/detail/noncopyable.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class std_event - : private noncopyable -{ -public: - // Constructor. - std_event() - : state_(0) - { - } - - // Destructor. - ~std_event() - { - } - - // Signal the event. (Retained for backward compatibility.) - template - void signal(Lock& lock) - { - this->signal_all(lock); - } - - // Signal all waiters. - template - void signal_all(Lock& lock) - { - ASIO_ASSERT(lock.locked()); - (void)lock; - state_ |= 1; - cond_.notify_all(); - } - - // Unlock the mutex and signal one waiter. - template - void unlock_and_signal_one(Lock& lock) - { - ASIO_ASSERT(lock.locked()); - state_ |= 1; - bool have_waiters = (state_ > 1); - lock.unlock(); - if (have_waiters) - cond_.notify_one(); - } - - // If there's a waiter, unlock the mutex and signal it. - template - bool maybe_unlock_and_signal_one(Lock& lock) - { - ASIO_ASSERT(lock.locked()); - state_ |= 1; - if (state_ > 1) - { - lock.unlock(); - cond_.notify_one(); - return true; - } - return false; - } - - // Reset the event. - template - void clear(Lock& lock) - { - ASIO_ASSERT(lock.locked()); - (void)lock; - state_ &= ~std::size_t(1); - } - - // Wait for the event to become signalled. - template - void wait(Lock& lock) - { - ASIO_ASSERT(lock.locked()); - unique_lock_adapter u_lock(lock); - while ((state_ & 1) == 0) - { - waiter w(state_); - cond_.wait(u_lock.unique_lock_); - } - } - - // Timed wait for the event to become signalled. - template - bool wait_for_usec(Lock& lock, long usec) - { - ASIO_ASSERT(lock.locked()); - unique_lock_adapter u_lock(lock); - if ((state_ & 1) == 0) - { - waiter w(state_); - cond_.wait_for(u_lock.unique_lock_, std::chrono::microseconds(usec)); - } - return (state_ & 1) != 0; - } - -private: - // Helper class to temporarily adapt a scoped_lock into a unique_lock so that - // it can be passed to std::condition_variable::wait(). - struct unique_lock_adapter - { - template - explicit unique_lock_adapter(Lock& lock) - : unique_lock_(lock.mutex().mutex_, std::adopt_lock) - { - } - - ~unique_lock_adapter() - { - unique_lock_.release(); - } - - std::unique_lock unique_lock_; - }; - - // Helper to increment and decrement the state to track outstanding waiters. - class waiter - { - public: - explicit waiter(std::size_t& state) - : state_(state) - { - state_ += 2; - } - - ~waiter() - { - state_ -= 2; - } - - private: - std::size_t& state_; - }; - - std::condition_variable cond_; - std::size_t state_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) - -#endif // ASIO_DETAIL_STD_EVENT_HPP diff --git a/tools/sdk/include/asio/asio/detail/std_fenced_block.hpp b/tools/sdk/include/asio/asio/detail/std_fenced_block.hpp deleted file mode 100644 index 0d8ade028e6..00000000000 --- a/tools/sdk/include/asio/asio/detail/std_fenced_block.hpp +++ /dev/null @@ -1,62 +0,0 @@ -// -// detail/std_fenced_block.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_STD_FENCED_BLOCK_HPP -#define ASIO_DETAIL_STD_FENCED_BLOCK_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_STD_ATOMIC) - -#include -#include "asio/detail/noncopyable.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class std_fenced_block - : private noncopyable -{ -public: - enum half_t { half }; - enum full_t { full }; - - // Constructor for a half fenced block. - explicit std_fenced_block(half_t) - { - } - - // Constructor for a full fenced block. - explicit std_fenced_block(full_t) - { - std::atomic_thread_fence(std::memory_order_acquire); - } - - // Destructor. - ~std_fenced_block() - { - std::atomic_thread_fence(std::memory_order_release); - } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_STD_ATOMIC) - -#endif // ASIO_DETAIL_STD_FENCED_BLOCK_HPP diff --git a/tools/sdk/include/asio/asio/detail/std_global.hpp b/tools/sdk/include/asio/asio/detail/std_global.hpp deleted file mode 100644 index 0c5173e6bd7..00000000000 --- a/tools/sdk/include/asio/asio/detail/std_global.hpp +++ /dev/null @@ -1,70 +0,0 @@ -// -// detail/std_global.hpp -// ~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_STD_GLOBAL_HPP -#define ASIO_DETAIL_STD_GLOBAL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_STD_CALL_ONCE) - -#include -#include - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -struct std_global_impl -{ - // Helper function to perform initialisation. - static void do_init() - { - instance_.ptr_ = new T; - } - - // Destructor automatically cleans up the global. - ~std_global_impl() - { - delete ptr_; - } - - static std::once_flag init_once_; - static std_global_impl instance_; - T* ptr_; -}; - -template -std::once_flag std_global_impl::init_once_; - -template -std_global_impl std_global_impl::instance_; - -template -T& std_global() -{ - std::call_once(std_global_impl::init_once_, &std_global_impl::do_init); - return *std_global_impl::instance_.ptr_; -} - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_STD_CALL_ONCE) - -#endif // ASIO_DETAIL_STD_GLOBAL_HPP diff --git a/tools/sdk/include/asio/asio/detail/std_mutex.hpp b/tools/sdk/include/asio/asio/detail/std_mutex.hpp deleted file mode 100644 index 159049e8c29..00000000000 --- a/tools/sdk/include/asio/asio/detail/std_mutex.hpp +++ /dev/null @@ -1,73 +0,0 @@ -// -// detail/std_mutex.hpp -// ~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_STD_MUTEX_HPP -#define ASIO_DETAIL_STD_MUTEX_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) - -#include -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/scoped_lock.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class std_event; - -class std_mutex - : private noncopyable -{ -public: - typedef asio::detail::scoped_lock scoped_lock; - - // Constructor. - std_mutex() - { - } - - // Destructor. - ~std_mutex() - { - } - - // Lock the mutex. - void lock() - { - mutex_.lock(); - } - - // Unlock the mutex. - void unlock() - { - mutex_.unlock(); - } - -private: - friend class std_event; - std::mutex mutex_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) - -#endif // ASIO_DETAIL_STD_MUTEX_HPP diff --git a/tools/sdk/include/asio/asio/detail/std_static_mutex.hpp b/tools/sdk/include/asio/asio/detail/std_static_mutex.hpp deleted file mode 100644 index e9c9dc5ee3a..00000000000 --- a/tools/sdk/include/asio/asio/detail/std_static_mutex.hpp +++ /dev/null @@ -1,81 +0,0 @@ -// -// detail/std_static_mutex.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_STD_STATIC_MUTEX_HPP -#define ASIO_DETAIL_STD_STATIC_MUTEX_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) - -#include -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/scoped_lock.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class std_event; - -class std_static_mutex - : private noncopyable -{ -public: - typedef asio::detail::scoped_lock scoped_lock; - - // Constructor. - std_static_mutex(int) - { - } - - // Destructor. - ~std_static_mutex() - { - } - - // Initialise the mutex. - void init() - { - // Nothing to do. - } - - // Lock the mutex. - void lock() - { - mutex_.lock(); - } - - // Unlock the mutex. - void unlock() - { - mutex_.unlock(); - } - -private: - friend class std_event; - std::mutex mutex_; -}; - -#define ASIO_STD_STATIC_MUTEX_INIT 0 - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) - -#endif // ASIO_DETAIL_STD_STATIC_MUTEX_HPP diff --git a/tools/sdk/include/asio/asio/detail/std_thread.hpp b/tools/sdk/include/asio/asio/detail/std_thread.hpp deleted file mode 100644 index a240308d8a0..00000000000 --- a/tools/sdk/include/asio/asio/detail/std_thread.hpp +++ /dev/null @@ -1,71 +0,0 @@ -// -// detail/std_thread.hpp -// ~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_STD_THREAD_HPP -#define ASIO_DETAIL_STD_THREAD_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_STD_THREAD) - -#include -#include "asio/detail/noncopyable.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class std_thread - : private noncopyable -{ -public: - // Constructor. - template - std_thread(Function f, unsigned int = 0) - : thread_(f) - { - } - - // Destructor. - ~std_thread() - { - join(); - } - - // Wait for the thread to exit. - void join() - { - if (thread_.joinable()) - thread_.join(); - } - - // Get number of CPUs. - static std::size_t hardware_concurrency() - { - return std::thread::hardware_concurrency(); - } - -private: - std::thread thread_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_STD_THREAD) - -#endif // ASIO_DETAIL_STD_THREAD_HPP diff --git a/tools/sdk/include/asio/asio/detail/strand_executor_service.hpp b/tools/sdk/include/asio/asio/detail/strand_executor_service.hpp deleted file mode 100644 index 67e84274ba2..00000000000 --- a/tools/sdk/include/asio/asio/detail/strand_executor_service.hpp +++ /dev/null @@ -1,142 +0,0 @@ -// -// detail/strand_executor_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_STRAND_EXECUTOR_SERVICE_HPP -#define ASIO_DETAIL_STRAND_EXECUTOR_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/atomic_count.hpp" -#include "asio/detail/executor_op.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/mutex.hpp" -#include "asio/detail/op_queue.hpp" -#include "asio/detail/scheduler_operation.hpp" -#include "asio/detail/scoped_ptr.hpp" -#include "asio/execution_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -// Default service implementation for a strand. -class strand_executor_service - : public execution_context_service_base -{ -public: - // The underlying implementation of a strand. - class strand_impl - { - public: - ASIO_DECL ~strand_impl(); - - private: - friend class strand_executor_service; - - // Mutex to protect access to internal data. - mutex* mutex_; - - // Indicates whether the strand is currently "locked" by a handler. This - // means that there is a handler upcall in progress, or that the strand - // itself has been scheduled in order to invoke some pending handlers. - bool locked_; - - // Indicates that the strand has been shut down and will accept no further - // handlers. - bool shutdown_; - - // The handlers that are waiting on the strand but should not be run until - // after the next time the strand is scheduled. This queue must only be - // modified while the mutex is locked. - op_queue waiting_queue_; - - // The handlers that are ready to be run. Logically speaking, these are the - // handlers that hold the strand's lock. The ready queue is only modified - // from within the strand and so may be accessed without locking the mutex. - op_queue ready_queue_; - - // Pointers to adjacent handle implementations in linked list. - strand_impl* next_; - strand_impl* prev_; - - // The strand service in where the implementation is held. - strand_executor_service* service_; - }; - - typedef shared_ptr implementation_type; - - // Construct a new strand service for the specified context. - ASIO_DECL explicit strand_executor_service(execution_context& context); - - // Destroy all user-defined handler objects owned by the service. - ASIO_DECL void shutdown(); - - // Create a new strand_executor implementation. - ASIO_DECL implementation_type create_implementation(); - - // Request invocation of the given function. - template - static void dispatch(const implementation_type& impl, Executor& ex, - ASIO_MOVE_ARG(Function) function, const Allocator& a); - - // Request invocation of the given function and return immediately. - template - static void post(const implementation_type& impl, Executor& ex, - ASIO_MOVE_ARG(Function) function, const Allocator& a); - - // Request invocation of the given function and return immediately. - template - static void defer(const implementation_type& impl, Executor& ex, - ASIO_MOVE_ARG(Function) function, const Allocator& a); - - // Determine whether the strand is running in the current thread. - ASIO_DECL static bool running_in_this_thread( - const implementation_type& impl); - -private: - friend class strand_impl; - template class invoker; - - // Adds a function to the strand. Returns true if it acquires the lock. - ASIO_DECL static bool enqueue(const implementation_type& impl, - scheduler_operation* op); - - // Mutex to protect access to the service-wide state. - mutex mutex_; - - // Number of mutexes shared between all strand objects. - enum { num_mutexes = 193 }; - - // Pool of mutexes. - scoped_ptr mutexes_[num_mutexes]; - - // Extra value used when hashing to prevent recycled memory locations from - // getting the same mutex. - std::size_t salt_; - - // The head of a linked list of all implementations. - strand_impl* impl_list_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/detail/impl/strand_executor_service.hpp" -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/strand_executor_service.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_DETAIL_STRAND_EXECUTOR_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/detail/strand_service.hpp b/tools/sdk/include/asio/asio/detail/strand_service.hpp deleted file mode 100644 index edc14a0f7d5..00000000000 --- a/tools/sdk/include/asio/asio/detail/strand_service.hpp +++ /dev/null @@ -1,142 +0,0 @@ -// -// detail/strand_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_STRAND_SERVICE_HPP -#define ASIO_DETAIL_STRAND_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/io_context.hpp" -#include "asio/detail/mutex.hpp" -#include "asio/detail/op_queue.hpp" -#include "asio/detail/operation.hpp" -#include "asio/detail/scoped_ptr.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -// Default service implementation for a strand. -class strand_service - : public asio::detail::service_base -{ -private: - // Helper class to re-post the strand on exit. - struct on_do_complete_exit; - - // Helper class to re-post the strand on exit. - struct on_dispatch_exit; - -public: - - // The underlying implementation of a strand. - class strand_impl - : public operation - { - public: - strand_impl(); - - private: - // Only this service will have access to the internal values. - friend class strand_service; - friend struct on_do_complete_exit; - friend struct on_dispatch_exit; - - // Mutex to protect access to internal data. - asio::detail::mutex mutex_; - - // Indicates whether the strand is currently "locked" by a handler. This - // means that there is a handler upcall in progress, or that the strand - // itself has been scheduled in order to invoke some pending handlers. - bool locked_; - - // The handlers that are waiting on the strand but should not be run until - // after the next time the strand is scheduled. This queue must only be - // modified while the mutex is locked. - op_queue waiting_queue_; - - // The handlers that are ready to be run. Logically speaking, these are the - // handlers that hold the strand's lock. The ready queue is only modified - // from within the strand and so may be accessed without locking the mutex. - op_queue ready_queue_; - }; - - typedef strand_impl* implementation_type; - - // Construct a new strand service for the specified io_context. - ASIO_DECL explicit strand_service(asio::io_context& io_context); - - // Destroy all user-defined handler objects owned by the service. - ASIO_DECL void shutdown(); - - // Construct a new strand implementation. - ASIO_DECL void construct(implementation_type& impl); - - // Request the io_context to invoke the given handler. - template - void dispatch(implementation_type& impl, Handler& handler); - - // Request the io_context to invoke the given handler and return immediately. - template - void post(implementation_type& impl, Handler& handler); - - // Determine whether the strand is running in the current thread. - ASIO_DECL bool running_in_this_thread( - const implementation_type& impl) const; - -private: - // Helper function to dispatch a handler. Returns true if the handler should - // be dispatched immediately. - ASIO_DECL bool do_dispatch(implementation_type& impl, operation* op); - - // Helper fiunction to post a handler. - ASIO_DECL void do_post(implementation_type& impl, - operation* op, bool is_continuation); - - ASIO_DECL static void do_complete(void* owner, - operation* base, const asio::error_code& ec, - std::size_t bytes_transferred); - - // The io_context implementation used to post completions. - io_context_impl& io_context_; - - // Mutex to protect access to the array of implementations. - asio::detail::mutex mutex_; - - // Number of implementations shared between all strand objects. -#if defined(ASIO_STRAND_IMPLEMENTATIONS) - enum { num_implementations = ASIO_STRAND_IMPLEMENTATIONS }; -#else // defined(ASIO_STRAND_IMPLEMENTATIONS) - enum { num_implementations = 193 }; -#endif // defined(ASIO_STRAND_IMPLEMENTATIONS) - - // Pool of implementations. - scoped_ptr implementations_[num_implementations]; - - // Extra value used when hashing to prevent recycled memory locations from - // getting the same strand implementation. - std::size_t salt_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/detail/impl/strand_service.hpp" -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/strand_service.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_DETAIL_STRAND_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/detail/string_view.hpp b/tools/sdk/include/asio/asio/detail/string_view.hpp deleted file mode 100644 index f09cebc2b64..00000000000 --- a/tools/sdk/include/asio/asio/detail/string_view.hpp +++ /dev/null @@ -1,47 +0,0 @@ -// -// detail/string_view.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_STRING_VIEW_HPP -#define ASIO_DETAIL_STRING_VIEW_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_STRING_VIEW) - -#if defined(ASIO_HAS_STD_STRING_VIEW) -# include -#elif defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW) -# include -#else // defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW) -# error ASIO_HAS_STRING_VIEW is set but no string_view is available -#endif // defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW) - -namespace asio { - -#if defined(ASIO_HAS_STD_STRING_VIEW) -using std::basic_string_view; -using std::string_view; -#elif defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW) -using std::experimental::basic_string_view; -using std::experimental::string_view; -#endif // defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW) - -} // namespace asio - -# define ASIO_STRING_VIEW_PARAM asio::string_view -#else // defined(ASIO_HAS_STRING_VIEW) -# define ASIO_STRING_VIEW_PARAM const std::string& -#endif // defined(ASIO_HAS_STRING_VIEW) - -#endif // ASIO_DETAIL_STRING_VIEW_HPP diff --git a/tools/sdk/include/asio/asio/detail/thread.hpp b/tools/sdk/include/asio/asio/detail/thread.hpp deleted file mode 100644 index ea556dba65f..00000000000 --- a/tools/sdk/include/asio/asio/detail/thread.hpp +++ /dev/null @@ -1,60 +0,0 @@ -// -// detail/thread.hpp -// ~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_THREAD_HPP -#define ASIO_DETAIL_THREAD_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_HAS_THREADS) -# include "asio/detail/null_thread.hpp" -#elif defined(ASIO_WINDOWS) -# if defined(UNDER_CE) -# include "asio/detail/wince_thread.hpp" -# elif defined(ASIO_WINDOWS_APP) -# include "asio/detail/winapp_thread.hpp" -# else -# include "asio/detail/win_thread.hpp" -# endif -#elif defined(ASIO_HAS_PTHREADS) -# include "asio/detail/posix_thread.hpp" -#elif defined(ASIO_HAS_STD_THREAD) -# include "asio/detail/std_thread.hpp" -#else -# error Only Windows, POSIX and std::thread are supported! -#endif - -namespace asio { -namespace detail { - -#if !defined(ASIO_HAS_THREADS) -typedef null_thread thread; -#elif defined(ASIO_WINDOWS) -# if defined(UNDER_CE) -typedef wince_thread thread; -# elif defined(ASIO_WINDOWS_APP) -typedef winapp_thread thread; -# else -typedef win_thread thread; -# endif -#elif defined(ASIO_HAS_PTHREADS) -typedef posix_thread thread; -#elif defined(ASIO_HAS_STD_THREAD) -typedef std_thread thread; -#endif - -} // namespace detail -} // namespace asio - -#endif // ASIO_DETAIL_THREAD_HPP diff --git a/tools/sdk/include/asio/asio/detail/thread_context.hpp b/tools/sdk/include/asio/asio/detail/thread_context.hpp deleted file mode 100644 index 88b4f311571..00000000000 --- a/tools/sdk/include/asio/asio/detail/thread_context.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// -// detail/thread_context.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_THREAD_CONTEXT_HPP -#define ASIO_DETAIL_THREAD_CONTEXT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include -#include -#include "asio/detail/call_stack.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class thread_info_base; - -// Base class for things that manage threads (scheduler, win_iocp_io_context). -class thread_context -{ -public: - // Per-thread call stack to track the state of each thread in the context. - typedef call_stack thread_call_stack; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_THREAD_CONTEXT_HPP diff --git a/tools/sdk/include/asio/asio/detail/thread_group.hpp b/tools/sdk/include/asio/asio/detail/thread_group.hpp deleted file mode 100644 index 1e400b03737..00000000000 --- a/tools/sdk/include/asio/asio/detail/thread_group.hpp +++ /dev/null @@ -1,89 +0,0 @@ -// -// detail/thread_group.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_THREAD_GROUP_HPP -#define ASIO_DETAIL_THREAD_GROUP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/scoped_ptr.hpp" -#include "asio/detail/thread.hpp" - -namespace asio { -namespace detail { - -class thread_group -{ -public: - // Constructor initialises an empty thread group. - thread_group() - : first_(0) - { - } - - // Destructor joins any remaining threads in the group. - ~thread_group() - { - join(); - } - - // Create a new thread in the group. - template - void create_thread(Function f) - { - first_ = new item(f, first_); - } - - // Create new threads in the group. - template - void create_threads(Function f, std::size_t num_threads) - { - for (std::size_t i = 0; i < num_threads; ++i) - create_thread(f); - } - - // Wait for all threads in the group to exit. - void join() - { - while (first_) - { - first_->thread_.join(); - item* tmp = first_; - first_ = first_->next_; - delete tmp; - } - } - -private: - // Structure used to track a single thread in the group. - struct item - { - template - explicit item(Function f, item* next) - : thread_(f), - next_(next) - { - } - - asio::detail::thread thread_; - item* next_; - }; - - // The first thread in the group. - item* first_; -}; - -} // namespace detail -} // namespace asio - -#endif // ASIO_DETAIL_THREAD_GROUP_HPP diff --git a/tools/sdk/include/asio/asio/detail/thread_info_base.hpp b/tools/sdk/include/asio/asio/detail/thread_info_base.hpp deleted file mode 100644 index 1b2220745b2..00000000000 --- a/tools/sdk/include/asio/asio/detail/thread_info_base.hpp +++ /dev/null @@ -1,121 +0,0 @@ -// -// detail/thread_info_base.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_THREAD_INFO_BASE_HPP -#define ASIO_DETAIL_THREAD_INFO_BASE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include -#include -#include "asio/detail/noncopyable.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class thread_info_base - : private noncopyable -{ -public: - struct default_tag - { - enum { mem_index = 0 }; - }; - - struct awaitee_tag - { - enum { mem_index = 1 }; - }; - - thread_info_base() - { - for (int i = 0; i < max_mem_index; ++i) - reusable_memory_[i] = 0; - } - - ~thread_info_base() - { - for (int i = 0; i < max_mem_index; ++i) - if (reusable_memory_[i]) - ::operator delete(reusable_memory_[i]); - } - - static void* allocate(thread_info_base* this_thread, std::size_t size) - { - return allocate(default_tag(), this_thread, size); - } - - static void deallocate(thread_info_base* this_thread, - void* pointer, std::size_t size) - { - deallocate(default_tag(), this_thread, pointer, size); - } - - template - static void* allocate(Purpose, thread_info_base* this_thread, - std::size_t size) - { - std::size_t chunks = (size + chunk_size - 1) / chunk_size; - - if (this_thread && this_thread->reusable_memory_[Purpose::mem_index]) - { - void* const pointer = this_thread->reusable_memory_[Purpose::mem_index]; - this_thread->reusable_memory_[Purpose::mem_index] = 0; - - unsigned char* const mem = static_cast(pointer); - if (static_cast(mem[0]) >= chunks) - { - mem[size] = mem[0]; - return pointer; - } - - ::operator delete(pointer); - } - - void* const pointer = ::operator new(chunks * chunk_size + 1); - unsigned char* const mem = static_cast(pointer); - mem[size] = (chunks <= UCHAR_MAX) ? static_cast(chunks) : 0; - return pointer; - } - - template - static void deallocate(Purpose, thread_info_base* this_thread, - void* pointer, std::size_t size) - { - if (size <= chunk_size * UCHAR_MAX) - { - if (this_thread && this_thread->reusable_memory_[Purpose::mem_index] == 0) - { - unsigned char* const mem = static_cast(pointer); - mem[0] = mem[size]; - this_thread->reusable_memory_[Purpose::mem_index] = pointer; - return; - } - } - - ::operator delete(pointer); - } - -private: - enum { chunk_size = 4 }; - enum { max_mem_index = 2 }; - void* reusable_memory_[max_mem_index]; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_THREAD_INFO_BASE_HPP diff --git a/tools/sdk/include/asio/asio/detail/throw_error.hpp b/tools/sdk/include/asio/asio/detail/throw_error.hpp deleted file mode 100644 index 5dd87855aad..00000000000 --- a/tools/sdk/include/asio/asio/detail/throw_error.hpp +++ /dev/null @@ -1,53 +0,0 @@ -// -// detail/throw_error.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_THROW_ERROR_HPP -#define ASIO_DETAIL_THROW_ERROR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/error_code.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -ASIO_DECL void do_throw_error(const asio::error_code& err); - -ASIO_DECL void do_throw_error(const asio::error_code& err, - const char* location); - -inline void throw_error(const asio::error_code& err) -{ - if (err) - do_throw_error(err); -} - -inline void throw_error(const asio::error_code& err, - const char* location) -{ - if (err) - do_throw_error(err, location); -} - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/throw_error.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_DETAIL_THROW_ERROR_HPP diff --git a/tools/sdk/include/asio/asio/detail/throw_exception.hpp b/tools/sdk/include/asio/asio/detail/throw_exception.hpp deleted file mode 100644 index f9f7bfb9f17..00000000000 --- a/tools/sdk/include/asio/asio/detail/throw_exception.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// -// detail/throw_exception.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_THROW_EXCEPTION_HPP -#define ASIO_DETAIL_THROW_EXCEPTION_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_BOOST_THROW_EXCEPTION) -# include -#endif // defined(ASIO_BOOST_THROW_EXCEPTION) - -namespace asio { -namespace detail { - -#if defined(ASIO_HAS_BOOST_THROW_EXCEPTION) -using boost::throw_exception; -#else // defined(ASIO_HAS_BOOST_THROW_EXCEPTION) - -// Declare the throw_exception function for all targets. -template -void throw_exception(const Exception& e); - -// Only define the throw_exception function when exceptions are enabled. -// Otherwise, it is up to the application to provide a definition of this -// function. -# if !defined(ASIO_NO_EXCEPTIONS) -template -void throw_exception(const Exception& e) -{ - throw e; -} -# endif // !defined(ASIO_NO_EXCEPTIONS) - -#endif // defined(ASIO_HAS_BOOST_THROW_EXCEPTION) - -} // namespace detail -} // namespace asio - -#endif // ASIO_DETAIL_THROW_EXCEPTION_HPP diff --git a/tools/sdk/include/asio/asio/detail/timer_queue.hpp b/tools/sdk/include/asio/asio/detail/timer_queue.hpp deleted file mode 100644 index 380e7791eb9..00000000000 --- a/tools/sdk/include/asio/asio/detail/timer_queue.hpp +++ /dev/null @@ -1,358 +0,0 @@ -// -// detail/timer_queue.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_TIMER_QUEUE_HPP -#define ASIO_DETAIL_TIMER_QUEUE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include -#include "asio/detail/cstdint.hpp" -#include "asio/detail/date_time_fwd.hpp" -#include "asio/detail/limits.hpp" -#include "asio/detail/op_queue.hpp" -#include "asio/detail/timer_queue_base.hpp" -#include "asio/detail/wait_op.hpp" -#include "asio/error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class timer_queue - : public timer_queue_base -{ -public: - // The time type. - typedef typename Time_Traits::time_type time_type; - - // The duration type. - typedef typename Time_Traits::duration_type duration_type; - - // Per-timer data. - class per_timer_data - { - public: - per_timer_data() : - heap_index_((std::numeric_limits::max)()), - next_(0), prev_(0) - { - } - - private: - friend class timer_queue; - - // The operations waiting on the timer. - op_queue op_queue_; - - // The index of the timer in the heap. - std::size_t heap_index_; - - // Pointers to adjacent timers in a linked list. - per_timer_data* next_; - per_timer_data* prev_; - }; - - // Constructor. - timer_queue() - : timers_(), - heap_() - { - } - - // Add a new timer to the queue. Returns true if this is the timer that is - // earliest in the queue, in which case the reactor's event demultiplexing - // function call may need to be interrupted and restarted. - bool enqueue_timer(const time_type& time, per_timer_data& timer, wait_op* op) - { - // Enqueue the timer object. - if (timer.prev_ == 0 && &timer != timers_) - { - if (this->is_positive_infinity(time)) - { - // No heap entry is required for timers that never expire. - timer.heap_index_ = (std::numeric_limits::max)(); - } - else - { - // Put the new timer at the correct position in the heap. This is done - // first since push_back() can throw due to allocation failure. - timer.heap_index_ = heap_.size(); - heap_entry entry = { time, &timer }; - heap_.push_back(entry); - up_heap(heap_.size() - 1); - } - - // Insert the new timer into the linked list of active timers. - timer.next_ = timers_; - timer.prev_ = 0; - if (timers_) - timers_->prev_ = &timer; - timers_ = &timer; - } - - // Enqueue the individual timer operation. - timer.op_queue_.push(op); - - // Interrupt reactor only if newly added timer is first to expire. - return timer.heap_index_ == 0 && timer.op_queue_.front() == op; - } - - // Whether there are no timers in the queue. - virtual bool empty() const - { - return timers_ == 0; - } - - // Get the time for the timer that is earliest in the queue. - virtual long wait_duration_msec(long max_duration) const - { - if (heap_.empty()) - return max_duration; - - return this->to_msec( - Time_Traits::to_posix_duration( - Time_Traits::subtract(heap_[0].time_, Time_Traits::now())), - max_duration); - } - - // Get the time for the timer that is earliest in the queue. - virtual long wait_duration_usec(long max_duration) const - { - if (heap_.empty()) - return max_duration; - - return this->to_usec( - Time_Traits::to_posix_duration( - Time_Traits::subtract(heap_[0].time_, Time_Traits::now())), - max_duration); - } - - // Dequeue all timers not later than the current time. - virtual void get_ready_timers(op_queue& ops) - { - if (!heap_.empty()) - { - const time_type now = Time_Traits::now(); - while (!heap_.empty() && !Time_Traits::less_than(now, heap_[0].time_)) - { - per_timer_data* timer = heap_[0].timer_; - ops.push(timer->op_queue_); - remove_timer(*timer); - } - } - } - - // Dequeue all timers. - virtual void get_all_timers(op_queue& ops) - { - while (timers_) - { - per_timer_data* timer = timers_; - timers_ = timers_->next_; - ops.push(timer->op_queue_); - timer->next_ = 0; - timer->prev_ = 0; - } - - heap_.clear(); - } - - // Cancel and dequeue operations for the given timer. - std::size_t cancel_timer(per_timer_data& timer, op_queue& ops, - std::size_t max_cancelled = (std::numeric_limits::max)()) - { - std::size_t num_cancelled = 0; - if (timer.prev_ != 0 || &timer == timers_) - { - while (wait_op* op = (num_cancelled != max_cancelled) - ? timer.op_queue_.front() : 0) - { - op->ec_ = asio::error::operation_aborted; - timer.op_queue_.pop(); - ops.push(op); - ++num_cancelled; - } - if (timer.op_queue_.empty()) - remove_timer(timer); - } - return num_cancelled; - } - - // Move operations from one timer to another, empty timer. - void move_timer(per_timer_data& target, per_timer_data& source) - { - target.op_queue_.push(source.op_queue_); - - target.heap_index_ = source.heap_index_; - source.heap_index_ = (std::numeric_limits::max)(); - - if (target.heap_index_ < heap_.size()) - heap_[target.heap_index_].timer_ = ⌖ - - if (timers_ == &source) - timers_ = ⌖ - if (source.prev_) - source.prev_->next_ = ⌖ - if (source.next_) - source.next_->prev_= ⌖ - target.next_ = source.next_; - target.prev_ = source.prev_; - source.next_ = 0; - source.prev_ = 0; - } - -private: - // Move the item at the given index up the heap to its correct position. - void up_heap(std::size_t index) - { - while (index > 0) - { - std::size_t parent = (index - 1) / 2; - if (!Time_Traits::less_than(heap_[index].time_, heap_[parent].time_)) - break; - swap_heap(index, parent); - index = parent; - } - } - - // Move the item at the given index down the heap to its correct position. - void down_heap(std::size_t index) - { - std::size_t child = index * 2 + 1; - while (child < heap_.size()) - { - std::size_t min_child = (child + 1 == heap_.size() - || Time_Traits::less_than( - heap_[child].time_, heap_[child + 1].time_)) - ? child : child + 1; - if (Time_Traits::less_than(heap_[index].time_, heap_[min_child].time_)) - break; - swap_heap(index, min_child); - index = min_child; - child = index * 2 + 1; - } - } - - // Swap two entries in the heap. - void swap_heap(std::size_t index1, std::size_t index2) - { - heap_entry tmp = heap_[index1]; - heap_[index1] = heap_[index2]; - heap_[index2] = tmp; - heap_[index1].timer_->heap_index_ = index1; - heap_[index2].timer_->heap_index_ = index2; - } - - // Remove a timer from the heap and list of timers. - void remove_timer(per_timer_data& timer) - { - // Remove the timer from the heap. - std::size_t index = timer.heap_index_; - if (!heap_.empty() && index < heap_.size()) - { - if (index == heap_.size() - 1) - { - heap_.pop_back(); - } - else - { - swap_heap(index, heap_.size() - 1); - heap_.pop_back(); - if (index > 0 && Time_Traits::less_than( - heap_[index].time_, heap_[(index - 1) / 2].time_)) - up_heap(index); - else - down_heap(index); - } - } - - // Remove the timer from the linked list of active timers. - if (timers_ == &timer) - timers_ = timer.next_; - if (timer.prev_) - timer.prev_->next_ = timer.next_; - if (timer.next_) - timer.next_->prev_= timer.prev_; - timer.next_ = 0; - timer.prev_ = 0; - } - - // Determine if the specified absolute time is positive infinity. - template - static bool is_positive_infinity(const Time_Type&) - { - return false; - } - - // Determine if the specified absolute time is positive infinity. - template - static bool is_positive_infinity( - const boost::date_time::base_time& time) - { - return time.is_pos_infinity(); - } - - // Helper function to convert a duration into milliseconds. - template - long to_msec(const Duration& d, long max_duration) const - { - if (d.ticks() <= 0) - return 0; - int64_t msec = d.total_milliseconds(); - if (msec == 0) - return 1; - if (msec > max_duration) - return max_duration; - return static_cast(msec); - } - - // Helper function to convert a duration into microseconds. - template - long to_usec(const Duration& d, long max_duration) const - { - if (d.ticks() <= 0) - return 0; - int64_t usec = d.total_microseconds(); - if (usec == 0) - return 1; - if (usec > max_duration) - return max_duration; - return static_cast(usec); - } - - // The head of a linked list of all active timers. - per_timer_data* timers_; - - struct heap_entry - { - // The time when the timer should fire. - time_type time_; - - // The associated timer with enqueued operations. - per_timer_data* timer_; - }; - - // The heap of timers, with the earliest timer at the front. - std::vector heap_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_TIMER_QUEUE_HPP diff --git a/tools/sdk/include/asio/asio/detail/timer_queue_base.hpp b/tools/sdk/include/asio/asio/detail/timer_queue_base.hpp deleted file mode 100644 index 4af995f237c..00000000000 --- a/tools/sdk/include/asio/asio/detail/timer_queue_base.hpp +++ /dev/null @@ -1,68 +0,0 @@ -// -// detail/timer_queue_base.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_TIMER_QUEUE_BASE_HPP -#define ASIO_DETAIL_TIMER_QUEUE_BASE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/op_queue.hpp" -#include "asio/detail/operation.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class timer_queue_base - : private noncopyable -{ -public: - // Constructor. - timer_queue_base() : next_(0) {} - - // Destructor. - virtual ~timer_queue_base() {} - - // Whether there are no timers in the queue. - virtual bool empty() const = 0; - - // Get the time to wait until the next timer. - virtual long wait_duration_msec(long max_duration) const = 0; - - // Get the time to wait until the next timer. - virtual long wait_duration_usec(long max_duration) const = 0; - - // Dequeue all ready timers. - virtual void get_ready_timers(op_queue& ops) = 0; - - // Dequeue all timers. - virtual void get_all_timers(op_queue& ops) = 0; - -private: - friend class timer_queue_set; - - // Next timer queue in the set. - timer_queue_base* next_; -}; - -template -class timer_queue; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_TIMER_QUEUE_BASE_HPP diff --git a/tools/sdk/include/asio/asio/detail/timer_queue_ptime.hpp b/tools/sdk/include/asio/asio/detail/timer_queue_ptime.hpp deleted file mode 100644 index 84e83385e69..00000000000 --- a/tools/sdk/include/asio/asio/detail/timer_queue_ptime.hpp +++ /dev/null @@ -1,99 +0,0 @@ -// -// detail/timer_queue_ptime.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_TIMER_QUEUE_PTIME_HPP -#define ASIO_DETAIL_TIMER_QUEUE_PTIME_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_BOOST_DATE_TIME) - -#include "asio/time_traits.hpp" -#include "asio/detail/timer_queue.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -struct forwarding_posix_time_traits : time_traits {}; - -// Template specialisation for the commonly used instantation. -template <> -class timer_queue > - : public timer_queue_base -{ -public: - // The time type. - typedef boost::posix_time::ptime time_type; - - // The duration type. - typedef boost::posix_time::time_duration duration_type; - - // Per-timer data. - typedef timer_queue::per_timer_data - per_timer_data; - - // Constructor. - ASIO_DECL timer_queue(); - - // Destructor. - ASIO_DECL virtual ~timer_queue(); - - // Add a new timer to the queue. Returns true if this is the timer that is - // earliest in the queue, in which case the reactor's event demultiplexing - // function call may need to be interrupted and restarted. - ASIO_DECL bool enqueue_timer(const time_type& time, - per_timer_data& timer, wait_op* op); - - // Whether there are no timers in the queue. - ASIO_DECL virtual bool empty() const; - - // Get the time for the timer that is earliest in the queue. - ASIO_DECL virtual long wait_duration_msec(long max_duration) const; - - // Get the time for the timer that is earliest in the queue. - ASIO_DECL virtual long wait_duration_usec(long max_duration) const; - - // Dequeue all timers not later than the current time. - ASIO_DECL virtual void get_ready_timers(op_queue& ops); - - // Dequeue all timers. - ASIO_DECL virtual void get_all_timers(op_queue& ops); - - // Cancel and dequeue operations for the given timer. - ASIO_DECL std::size_t cancel_timer( - per_timer_data& timer, op_queue& ops, - std::size_t max_cancelled = (std::numeric_limits::max)()); - - // Move operations from one timer to another, empty timer. - ASIO_DECL void move_timer(per_timer_data& target, - per_timer_data& source); - -private: - timer_queue impl_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/timer_queue_ptime.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_HAS_BOOST_DATE_TIME) - -#endif // ASIO_DETAIL_TIMER_QUEUE_PTIME_HPP diff --git a/tools/sdk/include/asio/asio/detail/timer_queue_set.hpp b/tools/sdk/include/asio/asio/detail/timer_queue_set.hpp deleted file mode 100644 index 0ea372ae5ad..00000000000 --- a/tools/sdk/include/asio/asio/detail/timer_queue_set.hpp +++ /dev/null @@ -1,66 +0,0 @@ -// -// detail/timer_queue_set.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_TIMER_QUEUE_SET_HPP -#define ASIO_DETAIL_TIMER_QUEUE_SET_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/timer_queue_base.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class timer_queue_set -{ -public: - // Constructor. - ASIO_DECL timer_queue_set(); - - // Add a timer queue to the set. - ASIO_DECL void insert(timer_queue_base* q); - - // Remove a timer queue from the set. - ASIO_DECL void erase(timer_queue_base* q); - - // Determine whether all queues are empty. - ASIO_DECL bool all_empty() const; - - // Get the wait duration in milliseconds. - ASIO_DECL long wait_duration_msec(long max_duration) const; - - // Get the wait duration in microseconds. - ASIO_DECL long wait_duration_usec(long max_duration) const; - - // Dequeue all ready timers. - ASIO_DECL void get_ready_timers(op_queue& ops); - - // Dequeue all timers. - ASIO_DECL void get_all_timers(op_queue& ops); - -private: - timer_queue_base* first_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/timer_queue_set.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_DETAIL_TIMER_QUEUE_SET_HPP diff --git a/tools/sdk/include/asio/asio/detail/timer_scheduler.hpp b/tools/sdk/include/asio/asio/detail/timer_scheduler.hpp deleted file mode 100644 index b1f8df45d4f..00000000000 --- a/tools/sdk/include/asio/asio/detail/timer_scheduler.hpp +++ /dev/null @@ -1,35 +0,0 @@ -// -// detail/timer_scheduler.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_TIMER_SCHEDULER_HPP -#define ASIO_DETAIL_TIMER_SCHEDULER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/timer_scheduler_fwd.hpp" - -#if defined(ASIO_WINDOWS_RUNTIME) -# include "asio/detail/winrt_timer_scheduler.hpp" -#elif defined(ASIO_HAS_IOCP) -# include "asio/detail/win_iocp_io_context.hpp" -#elif defined(ASIO_HAS_EPOLL) -# include "asio/detail/epoll_reactor.hpp" -#elif defined(ASIO_HAS_KQUEUE) -# include "asio/detail/kqueue_reactor.hpp" -#elif defined(ASIO_HAS_DEV_POLL) -# include "asio/detail/dev_poll_reactor.hpp" -#else -# include "asio/detail/select_reactor.hpp" -#endif - -#endif // ASIO_DETAIL_TIMER_SCHEDULER_HPP diff --git a/tools/sdk/include/asio/asio/detail/timer_scheduler_fwd.hpp b/tools/sdk/include/asio/asio/detail/timer_scheduler_fwd.hpp deleted file mode 100644 index 80bae5034f8..00000000000 --- a/tools/sdk/include/asio/asio/detail/timer_scheduler_fwd.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// -// detail/timer_scheduler_fwd.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_TIMER_SCHEDULER_FWD_HPP -#define ASIO_DETAIL_TIMER_SCHEDULER_FWD_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -namespace asio { -namespace detail { - -#if defined(ASIO_WINDOWS_RUNTIME) -typedef class winrt_timer_scheduler timer_scheduler; -#elif defined(ASIO_HAS_IOCP) -typedef class win_iocp_io_context timer_scheduler; -#elif defined(ASIO_HAS_EPOLL) -typedef class epoll_reactor timer_scheduler; -#elif defined(ASIO_HAS_KQUEUE) -typedef class kqueue_reactor timer_scheduler; -#elif defined(ASIO_HAS_DEV_POLL) -typedef class dev_poll_reactor timer_scheduler; -#else -typedef class select_reactor timer_scheduler; -#endif - -} // namespace detail -} // namespace asio - -#endif // ASIO_DETAIL_TIMER_SCHEDULER_FWD_HPP diff --git a/tools/sdk/include/asio/asio/detail/tss_ptr.hpp b/tools/sdk/include/asio/asio/detail/tss_ptr.hpp deleted file mode 100644 index e628abe9dfa..00000000000 --- a/tools/sdk/include/asio/asio/detail/tss_ptr.hpp +++ /dev/null @@ -1,69 +0,0 @@ -// -// detail/tss_ptr.hpp -// ~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_TSS_PTR_HPP -#define ASIO_DETAIL_TSS_PTR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_HAS_THREADS) -# include "asio/detail/null_tss_ptr.hpp" -#elif defined(ASIO_HAS_THREAD_KEYWORD_EXTENSION) -# include "asio/detail/keyword_tss_ptr.hpp" -#elif defined(ASIO_WINDOWS) -# include "asio/detail/win_tss_ptr.hpp" -#elif defined(ASIO_HAS_PTHREADS) -# include "asio/detail/posix_tss_ptr.hpp" -#else -# error Only Windows and POSIX are supported! -#endif - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class tss_ptr -#if !defined(ASIO_HAS_THREADS) - : public null_tss_ptr -#elif defined(ASIO_HAS_THREAD_KEYWORD_EXTENSION) - : public keyword_tss_ptr -#elif defined(ASIO_WINDOWS) - : public win_tss_ptr -#elif defined(ASIO_HAS_PTHREADS) - : public posix_tss_ptr -#endif -{ -public: - void operator=(T* value) - { -#if !defined(ASIO_HAS_THREADS) - null_tss_ptr::operator=(value); -#elif defined(ASIO_HAS_THREAD_KEYWORD_EXTENSION) - keyword_tss_ptr::operator=(value); -#elif defined(ASIO_WINDOWS) - win_tss_ptr::operator=(value); -#elif defined(ASIO_HAS_PTHREADS) - posix_tss_ptr::operator=(value); -#endif - } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_TSS_PTR_HPP diff --git a/tools/sdk/include/asio/asio/detail/type_traits.hpp b/tools/sdk/include/asio/asio/detail/type_traits.hpp deleted file mode 100644 index edf09281a48..00000000000 --- a/tools/sdk/include/asio/asio/detail/type_traits.hpp +++ /dev/null @@ -1,86 +0,0 @@ -// -// detail/type_traits.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_TYPE_TRAITS_HPP -#define ASIO_DETAIL_TYPE_TRAITS_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_STD_TYPE_TRAITS) -# include -#else // defined(ASIO_HAS_TYPE_TRAITS) -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -#endif // defined(ASIO_HAS_TYPE_TRAITS) - -namespace asio { - -#if defined(ASIO_HAS_STD_TYPE_TRAITS) -using std::add_const; -using std::conditional; -using std::decay; -using std::enable_if; -using std::false_type; -using std::integral_constant; -using std::is_base_of; -using std::is_class; -using std::is_const; -using std::is_convertible; -using std::is_function; -using std::is_same; -using std::remove_pointer; -using std::remove_reference; -#if defined(ASIO_HAS_STD_INVOKE_RESULT) -template struct result_of; -template -struct result_of : std::invoke_result {}; -#else // defined(ASIO_HAS_STD_INVOKE_RESULT) -using std::result_of; -#endif // defined(ASIO_HAS_STD_INVOKE_RESULT) -using std::true_type; -#else // defined(ASIO_HAS_STD_TYPE_TRAITS) -using boost::add_const; -template -struct enable_if : boost::enable_if_c {}; -using boost::conditional; -using boost::decay; -using boost::false_type; -using boost::integral_constant; -using boost::is_base_of; -using boost::is_class; -using boost::is_const; -using boost::is_convertible; -using boost::is_function; -using boost::is_same; -using boost::remove_pointer; -using boost::remove_reference; -using boost::result_of; -using boost::true_type; -#endif // defined(ASIO_HAS_STD_TYPE_TRAITS) - -} // namespace asio - -#endif // ASIO_DETAIL_TYPE_TRAITS_HPP diff --git a/tools/sdk/include/asio/asio/detail/variadic_templates.hpp b/tools/sdk/include/asio/asio/detail/variadic_templates.hpp deleted file mode 100644 index d54eb4e4b10..00000000000 --- a/tools/sdk/include/asio/asio/detail/variadic_templates.hpp +++ /dev/null @@ -1,119 +0,0 @@ -// -// detail/variadic_templates.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_VARIADIC_TEMPLATES_HPP -#define ASIO_DETAIL_VARIADIC_TEMPLATES_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_HAS_VARIADIC_TEMPLATES) - -# define ASIO_VARIADIC_TPARAMS(n) ASIO_VARIADIC_TPARAMS_##n - -# define ASIO_VARIADIC_TPARAMS_1 \ - typename T1 -# define ASIO_VARIADIC_TPARAMS_2 \ - typename T1, typename T2 -# define ASIO_VARIADIC_TPARAMS_3 \ - typename T1, typename T2, typename T3 -# define ASIO_VARIADIC_TPARAMS_4 \ - typename T1, typename T2, typename T3, typename T4 -# define ASIO_VARIADIC_TPARAMS_5 \ - typename T1, typename T2, typename T3, typename T4, typename T5 - -# define ASIO_VARIADIC_TARGS(n) ASIO_VARIADIC_TARGS_##n - -# define ASIO_VARIADIC_TARGS_1 T1 -# define ASIO_VARIADIC_TARGS_2 T1, T2 -# define ASIO_VARIADIC_TARGS_3 T1, T2, T3 -# define ASIO_VARIADIC_TARGS_4 T1, T2, T3, T4 -# define ASIO_VARIADIC_TARGS_5 T1, T2, T3, T4, T5 - -# define ASIO_VARIADIC_BYVAL_PARAMS(n) \ - ASIO_VARIADIC_BYVAL_PARAMS_##n - -# define ASIO_VARIADIC_BYVAL_PARAMS_1 T1 x1 -# define ASIO_VARIADIC_BYVAL_PARAMS_2 T1 x1, T2 x2 -# define ASIO_VARIADIC_BYVAL_PARAMS_3 T1 x1, T2 x2, T3 x3 -# define ASIO_VARIADIC_BYVAL_PARAMS_4 T1 x1, T2 x2, T3 x3, T4 x4 -# define ASIO_VARIADIC_BYVAL_PARAMS_5 T1 x1, T2 x2, T3 x3, T4 x4, T5 x5 - -# define ASIO_VARIADIC_BYVAL_ARGS(n) \ - ASIO_VARIADIC_BYVAL_ARGS_##n - -# define ASIO_VARIADIC_BYVAL_ARGS_1 x1 -# define ASIO_VARIADIC_BYVAL_ARGS_2 x1, x2 -# define ASIO_VARIADIC_BYVAL_ARGS_3 x1, x2, x3 -# define ASIO_VARIADIC_BYVAL_ARGS_4 x1, x2, x3, x4 -# define ASIO_VARIADIC_BYVAL_ARGS_5 x1, x2, x3, x4, x5 - -# define ASIO_VARIADIC_MOVE_PARAMS(n) \ - ASIO_VARIADIC_MOVE_PARAMS_##n - -# define ASIO_VARIADIC_MOVE_PARAMS_1 \ - ASIO_MOVE_ARG(T1) x1 -# define ASIO_VARIADIC_MOVE_PARAMS_2 \ - ASIO_MOVE_ARG(T1) x1, ASIO_MOVE_ARG(T2) x2 -# define ASIO_VARIADIC_MOVE_PARAMS_3 \ - ASIO_MOVE_ARG(T1) x1, ASIO_MOVE_ARG(T2) x2, \ - ASIO_MOVE_ARG(T3) x3 -# define ASIO_VARIADIC_MOVE_PARAMS_4 \ - ASIO_MOVE_ARG(T1) x1, ASIO_MOVE_ARG(T2) x2, \ - ASIO_MOVE_ARG(T3) x3, ASIO_MOVE_ARG(T4) x4 -# define ASIO_VARIADIC_MOVE_PARAMS_5 \ - ASIO_MOVE_ARG(T1) x1, ASIO_MOVE_ARG(T2) x2, \ - ASIO_MOVE_ARG(T3) x3, ASIO_MOVE_ARG(T4) x4, \ - ASIO_MOVE_ARG(T5) x5 - -# define ASIO_VARIADIC_MOVE_ARGS(n) \ - ASIO_VARIADIC_MOVE_ARGS_##n - -# define ASIO_VARIADIC_MOVE_ARGS_1 \ - ASIO_MOVE_CAST(T1)(x1) -# define ASIO_VARIADIC_MOVE_ARGS_2 \ - ASIO_MOVE_CAST(T1)(x1), ASIO_MOVE_CAST(T2)(x2) -# define ASIO_VARIADIC_MOVE_ARGS_3 \ - ASIO_MOVE_CAST(T1)(x1), ASIO_MOVE_CAST(T2)(x2), \ - ASIO_MOVE_CAST(T3)(x3) -# define ASIO_VARIADIC_MOVE_ARGS_4 \ - ASIO_MOVE_CAST(T1)(x1), ASIO_MOVE_CAST(T2)(x2), \ - ASIO_MOVE_CAST(T3)(x3), ASIO_MOVE_CAST(T4)(x4) -# define ASIO_VARIADIC_MOVE_ARGS_5 \ - ASIO_MOVE_CAST(T1)(x1), ASIO_MOVE_CAST(T2)(x2), \ - ASIO_MOVE_CAST(T3)(x3), ASIO_MOVE_CAST(T4)(x4), \ - ASIO_MOVE_CAST(T5)(x5) - -# define ASIO_VARIADIC_DECAY(n) \ - ASIO_VARIADIC_DECAY_##n - -# define ASIO_VARIADIC_DECAY_1 \ - typename decay::type -# define ASIO_VARIADIC_DECAY_2 \ - typename decay::type, typename decay::type -# define ASIO_VARIADIC_DECAY_3 \ - typename decay::type, typename decay::type, \ - typename decay::type -# define ASIO_VARIADIC_DECAY_4 \ - typename decay::type, typename decay::type, \ - typename decay::type, typename decay::type -# define ASIO_VARIADIC_DECAY_5 \ - typename decay::type, typename decay::type, \ - typename decay::type, typename decay::type, \ - typename decay::type - -# define ASIO_VARIADIC_GENERATE(m) m(1) m(2) m(3) m(4) m(5) - -#endif // !defined(ASIO_HAS_VARIADIC_TEMPLATES) - -#endif // ASIO_DETAIL_VARIADIC_TEMPLATES_HPP diff --git a/tools/sdk/include/asio/asio/detail/wait_handler.hpp b/tools/sdk/include/asio/asio/detail/wait_handler.hpp deleted file mode 100644 index bd3dc24419f..00000000000 --- a/tools/sdk/include/asio/asio/detail/wait_handler.hpp +++ /dev/null @@ -1,85 +0,0 @@ -// -// detail/wait_handler.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WAIT_HANDLER_HPP -#define ASIO_DETAIL_WAIT_HANDLER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/wait_op.hpp" -#include "asio/io_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class wait_handler : public wait_op -{ -public: - ASIO_DEFINE_HANDLER_PTR(wait_handler); - - wait_handler(Handler& h) - : wait_op(&wait_handler::do_complete), - handler_(ASIO_MOVE_CAST(Handler)(h)) - { - handler_work::start(handler_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& /*ec*/, - std::size_t /*bytes_transferred*/) - { - // Take ownership of the handler object. - wait_handler* h(static_cast(base)); - ptr p = { asio::detail::addressof(h->handler_), h, h }; - handler_work w(h->handler_); - - ASIO_HANDLER_COMPLETION((*h)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder1 - handler(h->handler_, h->ec_); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_WAIT_HANDLER_HPP diff --git a/tools/sdk/include/asio/asio/detail/wait_op.hpp b/tools/sdk/include/asio/asio/detail/wait_op.hpp deleted file mode 100644 index 1a3017baeef..00000000000 --- a/tools/sdk/include/asio/asio/detail/wait_op.hpp +++ /dev/null @@ -1,45 +0,0 @@ -// -// detail/wait_op.hpp -// ~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WAIT_OP_HPP -#define ASIO_DETAIL_WAIT_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/operation.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class wait_op - : public operation -{ -public: - // The error code to be passed to the completion handler. - asio::error_code ec_; - -protected: - wait_op(func_type func) - : operation(func) - { - } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_WAIT_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_event.hpp b/tools/sdk/include/asio/asio/detail/win_event.hpp deleted file mode 100644 index 859cdee7b92..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_event.hpp +++ /dev/null @@ -1,151 +0,0 @@ -// -// detail/win_event.hpp -// ~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_EVENT_HPP -#define ASIO_DETAIL_WIN_EVENT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_WINDOWS) - -#include "asio/detail/assert.hpp" -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/socket_types.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class win_event - : private noncopyable -{ -public: - // Constructor. - ASIO_DECL win_event(); - - // Destructor. - ASIO_DECL ~win_event(); - - // Signal the event. (Retained for backward compatibility.) - template - void signal(Lock& lock) - { - this->signal_all(lock); - } - - // Signal all waiters. - template - void signal_all(Lock& lock) - { - ASIO_ASSERT(lock.locked()); - (void)lock; - state_ |= 1; - ::SetEvent(events_[0]); - } - - // Unlock the mutex and signal one waiter. - template - void unlock_and_signal_one(Lock& lock) - { - ASIO_ASSERT(lock.locked()); - state_ |= 1; - bool have_waiters = (state_ > 1); - lock.unlock(); - if (have_waiters) - ::SetEvent(events_[1]); - } - - // If there's a waiter, unlock the mutex and signal it. - template - bool maybe_unlock_and_signal_one(Lock& lock) - { - ASIO_ASSERT(lock.locked()); - state_ |= 1; - if (state_ > 1) - { - lock.unlock(); - ::SetEvent(events_[1]); - return true; - } - return false; - } - - // Reset the event. - template - void clear(Lock& lock) - { - ASIO_ASSERT(lock.locked()); - (void)lock; - ::ResetEvent(events_[0]); - state_ &= ~std::size_t(1); - } - - // Wait for the event to become signalled. - template - void wait(Lock& lock) - { - ASIO_ASSERT(lock.locked()); - while ((state_ & 1) == 0) - { - state_ += 2; - lock.unlock(); -#if defined(ASIO_WINDOWS_APP) - ::WaitForMultipleObjectsEx(2, events_, false, INFINITE, false); -#else // defined(ASIO_WINDOWS_APP) - ::WaitForMultipleObjects(2, events_, false, INFINITE); -#endif // defined(ASIO_WINDOWS_APP) - lock.lock(); - state_ -= 2; - } - } - - // Timed wait for the event to become signalled. - template - bool wait_for_usec(Lock& lock, long usec) - { - ASIO_ASSERT(lock.locked()); - if ((state_ & 1) == 0) - { - state_ += 2; - lock.unlock(); - DWORD msec = usec > 0 ? (usec < 1000 ? 1 : usec / 1000) : 0; -#if defined(ASIO_WINDOWS_APP) - ::WaitForMultipleObjectsEx(2, events_, false, msec, false); -#else // defined(ASIO_WINDOWS_APP) - ::WaitForMultipleObjects(2, events_, false, msec); -#endif // defined(ASIO_WINDOWS_APP) - lock.lock(); - state_ -= 2; - } - return (state_ & 1) != 0; - } - -private: - HANDLE events_[2]; - std::size_t state_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/win_event.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_WINDOWS) - -#endif // ASIO_DETAIL_WIN_EVENT_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_fd_set_adapter.hpp b/tools/sdk/include/asio/asio/detail/win_fd_set_adapter.hpp deleted file mode 100644 index 8d5e700e226..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_fd_set_adapter.hpp +++ /dev/null @@ -1,149 +0,0 @@ -// -// detail/win_fd_set_adapter.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_FD_SET_ADAPTER_HPP -#define ASIO_DETAIL_WIN_FD_SET_ADAPTER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) - -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/reactor_op_queue.hpp" -#include "asio/detail/socket_types.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -// Adapts the FD_SET type to meet the Descriptor_Set concept's requirements. -class win_fd_set_adapter : noncopyable -{ -public: - enum { default_fd_set_size = 1024 }; - - win_fd_set_adapter() - : capacity_(default_fd_set_size), - max_descriptor_(invalid_socket) - { - fd_set_ = static_cast(::operator new( - sizeof(win_fd_set) - sizeof(SOCKET) - + sizeof(SOCKET) * (capacity_))); - fd_set_->fd_count = 0; - } - - ~win_fd_set_adapter() - { - ::operator delete(fd_set_); - } - - void reset() - { - fd_set_->fd_count = 0; - max_descriptor_ = invalid_socket; - } - - bool set(socket_type descriptor) - { - for (u_int i = 0; i < fd_set_->fd_count; ++i) - if (fd_set_->fd_array[i] == descriptor) - return true; - - reserve(fd_set_->fd_count + 1); - fd_set_->fd_array[fd_set_->fd_count++] = descriptor; - return true; - } - - void set(reactor_op_queue& operations, op_queue&) - { - reactor_op_queue::iterator i = operations.begin(); - while (i != operations.end()) - { - reactor_op_queue::iterator op_iter = i++; - reserve(fd_set_->fd_count + 1); - fd_set_->fd_array[fd_set_->fd_count++] = op_iter->first; - } - } - - bool is_set(socket_type descriptor) const - { - return !!__WSAFDIsSet(descriptor, - const_cast(reinterpret_cast(fd_set_))); - } - - operator fd_set*() - { - return reinterpret_cast(fd_set_); - } - - socket_type max_descriptor() const - { - return max_descriptor_; - } - - void perform(reactor_op_queue& operations, - op_queue& ops) const - { - for (u_int i = 0; i < fd_set_->fd_count; ++i) - operations.perform_operations(fd_set_->fd_array[i], ops); - } - -private: - // This structure is defined to be compatible with the Windows API fd_set - // structure, but without being dependent on the value of FD_SETSIZE. We use - // the "struct hack" to allow the number of descriptors to be varied at - // runtime. - struct win_fd_set - { - u_int fd_count; - SOCKET fd_array[1]; - }; - - // Increase the fd_set_ capacity to at least the specified number of elements. - void reserve(u_int n) - { - if (n <= capacity_) - return; - - u_int new_capacity = capacity_ + capacity_ / 2; - if (new_capacity < n) - new_capacity = n; - - win_fd_set* new_fd_set = static_cast(::operator new( - sizeof(win_fd_set) - sizeof(SOCKET) - + sizeof(SOCKET) * (new_capacity))); - - new_fd_set->fd_count = fd_set_->fd_count; - for (u_int i = 0; i < fd_set_->fd_count; ++i) - new_fd_set->fd_array[i] = fd_set_->fd_array[i]; - - ::operator delete(fd_set_); - fd_set_ = new_fd_set; - capacity_ = new_capacity; - } - - win_fd_set* fd_set_; - u_int capacity_; - socket_type max_descriptor_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) - -#endif // ASIO_DETAIL_WIN_FD_SET_ADAPTER_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_fenced_block.hpp b/tools/sdk/include/asio/asio/detail/win_fenced_block.hpp deleted file mode 100644 index 1ce6e13b9c1..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_fenced_block.hpp +++ /dev/null @@ -1,90 +0,0 @@ -// -// detail/win_fenced_block.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_FENCED_BLOCK_HPP -#define ASIO_DETAIL_WIN_FENCED_BLOCK_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_WINDOWS) && !defined(UNDER_CE) - -#include "asio/detail/socket_types.hpp" -#include "asio/detail/noncopyable.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class win_fenced_block - : private noncopyable -{ -public: - enum half_t { half }; - enum full_t { full }; - - // Constructor for a half fenced block. - explicit win_fenced_block(half_t) - { - } - - // Constructor for a full fenced block. - explicit win_fenced_block(full_t) - { -#if defined(__BORLANDC__) - LONG barrier = 0; - ::InterlockedExchange(&barrier, 1); -#elif defined(ASIO_MSVC) \ - && ((ASIO_MSVC < 1400) || !defined(MemoryBarrier)) -# if defined(_M_IX86) -# pragma warning(push) -# pragma warning(disable:4793) - LONG barrier; - __asm { xchg barrier, eax } -# pragma warning(pop) -# endif // defined(_M_IX86) -#else - MemoryBarrier(); -#endif - } - - // Destructor. - ~win_fenced_block() - { -#if defined(__BORLANDC__) - LONG barrier = 0; - ::InterlockedExchange(&barrier, 1); -#elif defined(ASIO_MSVC) \ - && ((ASIO_MSVC < 1400) || !defined(MemoryBarrier)) -# if defined(_M_IX86) -# pragma warning(push) -# pragma warning(disable:4793) - LONG barrier; - __asm { xchg barrier, eax } -# pragma warning(pop) -# endif // defined(_M_IX86) -#else - MemoryBarrier(); -#endif - } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_WINDOWS) && !defined(UNDER_CE) - -#endif // ASIO_DETAIL_WIN_FENCED_BLOCK_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_global.hpp b/tools/sdk/include/asio/asio/detail/win_global.hpp deleted file mode 100644 index 3b15a32d301..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_global.hpp +++ /dev/null @@ -1,73 +0,0 @@ -// -// detail/win_global.hpp -// ~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_GLOBAL_HPP -#define ASIO_DETAIL_WIN_GLOBAL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/static_mutex.hpp" -#include "asio/detail/tss_ptr.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -struct win_global_impl -{ - // Destructor automatically cleans up the global. - ~win_global_impl() - { - delete ptr_; - } - - static win_global_impl instance_; - static static_mutex mutex_; - static T* ptr_; - static tss_ptr tss_ptr_; -}; - -template -win_global_impl win_global_impl::instance_ = { 0 }; - -template -static_mutex win_global_impl::mutex_ = ASIO_STATIC_MUTEX_INIT; - -template -T* win_global_impl::ptr_ = 0; - -template -tss_ptr win_global_impl::tss_ptr_; - -template -T& win_global() -{ - if (static_cast(win_global_impl::tss_ptr_) == 0) - { - win_global_impl::mutex_.init(); - static_mutex::scoped_lock lock(win_global_impl::mutex_); - win_global_impl::ptr_ = new T; - win_global_impl::tss_ptr_ = win_global_impl::ptr_; - } - - return *win_global_impl::tss_ptr_; -} - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_WIN_GLOBAL_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_iocp_handle_read_op.hpp b/tools/sdk/include/asio/asio/detail/win_iocp_handle_read_op.hpp deleted file mode 100644 index 88e3f6c7b50..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_iocp_handle_read_op.hpp +++ /dev/null @@ -1,111 +0,0 @@ -// -// detail/win_iocp_handle_read_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_IOCP_HANDLE_READ_OP_HPP -#define ASIO_DETAIL_WIN_IOCP_HANDLE_READ_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_IOCP) - -#include "asio/error.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/operation.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class win_iocp_handle_read_op : public operation -{ -public: - ASIO_DEFINE_HANDLER_PTR(win_iocp_handle_read_op); - - win_iocp_handle_read_op( - const MutableBufferSequence& buffers, Handler& handler) - : operation(&win_iocp_handle_read_op::do_complete), - buffers_(buffers), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& result_ec, - std::size_t bytes_transferred) - { - asio::error_code ec(result_ec); - - // Take ownership of the operation object. - win_iocp_handle_read_op* o(static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - ASIO_HANDLER_COMPLETION((*o)); - -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - if (owner) - { - // Check whether buffers are still valid. - buffer_sequence_adapter::validate(o->buffers_); - } -#endif // defined(ASIO_ENABLE_BUFFER_DEBUGGING) - - // Map non-portable errors to their portable counterparts. - if (ec.value() == ERROR_HANDLE_EOF) - ec = asio::error::eof; - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder2 - handler(o->handler_, ec, bytes_transferred); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - MutableBufferSequence buffers_; - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_IOCP) - -#endif // ASIO_DETAIL_WIN_IOCP_HANDLE_READ_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_iocp_handle_service.hpp b/tools/sdk/include/asio/asio/detail/win_iocp_handle_service.hpp deleted file mode 100644 index 849fe8f1883..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_iocp_handle_service.hpp +++ /dev/null @@ -1,323 +0,0 @@ -// -// detail/win_iocp_handle_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_IOCP_HANDLE_SERVICE_HPP -#define ASIO_DETAIL_WIN_IOCP_HANDLE_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_IOCP) - -#include "asio/error.hpp" -#include "asio/io_context.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/cstdint.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/mutex.hpp" -#include "asio/detail/operation.hpp" -#include "asio/detail/win_iocp_handle_read_op.hpp" -#include "asio/detail/win_iocp_handle_write_op.hpp" -#include "asio/detail/win_iocp_io_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class win_iocp_handle_service : - public service_base -{ -public: - // The native type of a stream handle. - typedef HANDLE native_handle_type; - - // The implementation type of the stream handle. - class implementation_type - { - public: - // Default constructor. - implementation_type() - : handle_(INVALID_HANDLE_VALUE), - safe_cancellation_thread_id_(0), - next_(0), - prev_(0) - { - } - - private: - // Only this service will have access to the internal values. - friend class win_iocp_handle_service; - - // The native stream handle representation. - native_handle_type handle_; - - // The ID of the thread from which it is safe to cancel asynchronous - // operations. 0 means no asynchronous operations have been started yet. - // ~0 means asynchronous operations have been started from more than one - // thread, and cancellation is not supported for the handle. - DWORD safe_cancellation_thread_id_; - - // Pointers to adjacent handle implementations in linked list. - implementation_type* next_; - implementation_type* prev_; - }; - - ASIO_DECL win_iocp_handle_service(asio::io_context& io_context); - - // Destroy all user-defined handler objects owned by the service. - ASIO_DECL void shutdown(); - - // Construct a new handle implementation. - ASIO_DECL void construct(implementation_type& impl); - - // Move-construct a new handle implementation. - ASIO_DECL void move_construct(implementation_type& impl, - implementation_type& other_impl); - - // Move-assign from another handle implementation. - ASIO_DECL void move_assign(implementation_type& impl, - win_iocp_handle_service& other_service, - implementation_type& other_impl); - - // Destroy a handle implementation. - ASIO_DECL void destroy(implementation_type& impl); - - // Assign a native handle to a handle implementation. - ASIO_DECL asio::error_code assign(implementation_type& impl, - const native_handle_type& handle, asio::error_code& ec); - - // Determine whether the handle is open. - bool is_open(const implementation_type& impl) const - { - return impl.handle_ != INVALID_HANDLE_VALUE; - } - - // Destroy a handle implementation. - ASIO_DECL asio::error_code close(implementation_type& impl, - asio::error_code& ec); - - // Get the native handle representation. - native_handle_type native_handle(const implementation_type& impl) const - { - return impl.handle_; - } - - // Cancel all operations associated with the handle. - ASIO_DECL asio::error_code cancel(implementation_type& impl, - asio::error_code& ec); - - // Write the given data. Returns the number of bytes written. - template - size_t write_some(implementation_type& impl, - const ConstBufferSequence& buffers, asio::error_code& ec) - { - return write_some_at(impl, 0, buffers, ec); - } - - // Write the given data at the specified offset. Returns the number of bytes - // written. - template - size_t write_some_at(implementation_type& impl, uint64_t offset, - const ConstBufferSequence& buffers, asio::error_code& ec) - { - asio::const_buffer buffer = - buffer_sequence_adapter::first(buffers); - - return do_write(impl, offset, buffer, ec); - } - - // Start an asynchronous write. The data being written must be valid for the - // lifetime of the asynchronous operation. - template - void async_write_some(implementation_type& impl, - const ConstBufferSequence& buffers, Handler& handler) - { - // Allocate and construct an operation to wrap the handler. - typedef win_iocp_handle_write_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(buffers, handler); - - ASIO_HANDLER_CREATION((iocp_service_.context(), *p.p, "handle", &impl, - reinterpret_cast(impl.handle_), "async_write_some")); - - start_write_op(impl, 0, - buffer_sequence_adapter::first(buffers), p.p); - p.v = p.p = 0; - } - - // Start an asynchronous write at a specified offset. The data being written - // must be valid for the lifetime of the asynchronous operation. - template - void async_write_some_at(implementation_type& impl, uint64_t offset, - const ConstBufferSequence& buffers, Handler& handler) - { - // Allocate and construct an operation to wrap the handler. - typedef win_iocp_handle_write_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(buffers, handler); - - ASIO_HANDLER_CREATION((iocp_service_.context(), *p.p, "handle", &impl, - reinterpret_cast(impl.handle_), "async_write_some_at")); - - start_write_op(impl, offset, - buffer_sequence_adapter::first(buffers), p.p); - p.v = p.p = 0; - } - - // Read some data. Returns the number of bytes received. - template - size_t read_some(implementation_type& impl, - const MutableBufferSequence& buffers, asio::error_code& ec) - { - return read_some_at(impl, 0, buffers, ec); - } - - // Read some data at a specified offset. Returns the number of bytes received. - template - size_t read_some_at(implementation_type& impl, uint64_t offset, - const MutableBufferSequence& buffers, asio::error_code& ec) - { - asio::mutable_buffer buffer = - buffer_sequence_adapter::first(buffers); - - return do_read(impl, offset, buffer, ec); - } - - // Start an asynchronous read. The buffer for the data being received must be - // valid for the lifetime of the asynchronous operation. - template - void async_read_some(implementation_type& impl, - const MutableBufferSequence& buffers, Handler& handler) - { - // Allocate and construct an operation to wrap the handler. - typedef win_iocp_handle_read_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(buffers, handler); - - ASIO_HANDLER_CREATION((iocp_service_.context(), *p.p, "handle", &impl, - reinterpret_cast(impl.handle_), "async_read_some")); - - start_read_op(impl, 0, - buffer_sequence_adapter::first(buffers), p.p); - p.v = p.p = 0; - } - - // Start an asynchronous read at a specified offset. The buffer for the data - // being received must be valid for the lifetime of the asynchronous - // operation. - template - void async_read_some_at(implementation_type& impl, uint64_t offset, - const MutableBufferSequence& buffers, Handler& handler) - { - // Allocate and construct an operation to wrap the handler. - typedef win_iocp_handle_read_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(buffers, handler); - - ASIO_HANDLER_CREATION((iocp_service_.context(), *p.p, "handle", &impl, - reinterpret_cast(impl.handle_), "async_read_some_at")); - - start_read_op(impl, offset, - buffer_sequence_adapter::first(buffers), p.p); - p.v = p.p = 0; - } - -private: - // Prevent the use of the null_buffers type with this service. - size_t write_some(implementation_type& impl, - const null_buffers& buffers, asio::error_code& ec); - size_t write_some_at(implementation_type& impl, uint64_t offset, - const null_buffers& buffers, asio::error_code& ec); - template - void async_write_some(implementation_type& impl, - const null_buffers& buffers, Handler& handler); - template - void async_write_some_at(implementation_type& impl, uint64_t offset, - const null_buffers& buffers, Handler& handler); - size_t read_some(implementation_type& impl, - const null_buffers& buffers, asio::error_code& ec); - size_t read_some_at(implementation_type& impl, uint64_t offset, - const null_buffers& buffers, asio::error_code& ec); - template - void async_read_some(implementation_type& impl, - const null_buffers& buffers, Handler& handler); - template - void async_read_some_at(implementation_type& impl, uint64_t offset, - const null_buffers& buffers, Handler& handler); - - // Helper class for waiting for synchronous operations to complete. - class overlapped_wrapper; - - // Helper function to perform a synchronous write operation. - ASIO_DECL size_t do_write(implementation_type& impl, - uint64_t offset, const asio::const_buffer& buffer, - asio::error_code& ec); - - // Helper function to start a write operation. - ASIO_DECL void start_write_op(implementation_type& impl, - uint64_t offset, const asio::const_buffer& buffer, - operation* op); - - // Helper function to perform a synchronous write operation. - ASIO_DECL size_t do_read(implementation_type& impl, - uint64_t offset, const asio::mutable_buffer& buffer, - asio::error_code& ec); - - // Helper function to start a read operation. - ASIO_DECL void start_read_op(implementation_type& impl, - uint64_t offset, const asio::mutable_buffer& buffer, - operation* op); - - // Update the ID of the thread from which cancellation is safe. - ASIO_DECL void update_cancellation_thread_id(implementation_type& impl); - - // Helper function to close a handle when the associated object is being - // destroyed. - ASIO_DECL void close_for_destruction(implementation_type& impl); - - // The IOCP service used for running asynchronous operations and dispatching - // handlers. - win_iocp_io_context& iocp_service_; - - // Mutex to protect access to the linked list of implementations. - mutex mutex_; - - // The head of a linked list of all implementations. - implementation_type* impl_list_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/win_iocp_handle_service.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_HAS_IOCP) - -#endif // ASIO_DETAIL_WIN_IOCP_HANDLE_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_iocp_handle_write_op.hpp b/tools/sdk/include/asio/asio/detail/win_iocp_handle_write_op.hpp deleted file mode 100644 index d7bb9443a7c..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_iocp_handle_write_op.hpp +++ /dev/null @@ -1,103 +0,0 @@ -// -// detail/win_iocp_handle_write_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_IOCP_HANDLE_WRITE_OP_HPP -#define ASIO_DETAIL_WIN_IOCP_HANDLE_WRITE_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_IOCP) - -#include "asio/error.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/operation.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class win_iocp_handle_write_op : public operation -{ -public: - ASIO_DEFINE_HANDLER_PTR(win_iocp_handle_write_op); - - win_iocp_handle_write_op(const ConstBufferSequence& buffers, Handler& handler) - : operation(&win_iocp_handle_write_op::do_complete), - buffers_(buffers), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& ec, std::size_t bytes_transferred) - { - // Take ownership of the operation object. - win_iocp_handle_write_op* o(static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - ASIO_HANDLER_COMPLETION((*o)); - -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - if (owner) - { - // Check whether buffers are still valid. - buffer_sequence_adapter::validate(o->buffers_); - } -#endif // defined(ASIO_ENABLE_BUFFER_DEBUGGING) - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder2 - handler(o->handler_, ec, bytes_transferred); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - ConstBufferSequence buffers_; - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_IOCP) - -#endif // ASIO_DETAIL_WIN_IOCP_HANDLE_WRITE_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_iocp_io_context.hpp b/tools/sdk/include/asio/asio/detail/win_iocp_io_context.hpp deleted file mode 100644 index 11bf58b7d1a..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_iocp_io_context.hpp +++ /dev/null @@ -1,328 +0,0 @@ -// -// detail/win_iocp_io_context.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_IOCP_IO_CONTEXT_HPP -#define ASIO_DETAIL_WIN_IOCP_IO_CONTEXT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_IOCP) - -#include "asio/detail/limits.hpp" -#include "asio/detail/mutex.hpp" -#include "asio/detail/op_queue.hpp" -#include "asio/detail/scoped_ptr.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/detail/thread.hpp" -#include "asio/detail/thread_context.hpp" -#include "asio/detail/timer_queue_base.hpp" -#include "asio/detail/timer_queue_set.hpp" -#include "asio/detail/wait_op.hpp" -#include "asio/detail/win_iocp_operation.hpp" -#include "asio/detail/win_iocp_thread_info.hpp" -#include "asio/execution_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class wait_op; - -class win_iocp_io_context - : public execution_context_service_base, - public thread_context -{ -public: - // Constructor. Specifies a concurrency hint that is passed through to the - // underlying I/O completion port. - ASIO_DECL win_iocp_io_context(asio::execution_context& ctx, - int concurrency_hint = -1); - - // Destroy all user-defined handler objects owned by the service. - ASIO_DECL void shutdown(); - - // Initialise the task. Nothing to do here. - void init_task() - { - } - - // Register a handle with the IO completion port. - ASIO_DECL asio::error_code register_handle( - HANDLE handle, asio::error_code& ec); - - // Run the event loop until stopped or no more work. - ASIO_DECL size_t run(asio::error_code& ec); - - // Run until stopped or one operation is performed. - ASIO_DECL size_t run_one(asio::error_code& ec); - - // Run until timeout, interrupted, or one operation is performed. - ASIO_DECL size_t wait_one(long usec, asio::error_code& ec); - - // Poll for operations without blocking. - ASIO_DECL size_t poll(asio::error_code& ec); - - // Poll for one operation without blocking. - ASIO_DECL size_t poll_one(asio::error_code& ec); - - // Stop the event processing loop. - ASIO_DECL void stop(); - - // Determine whether the io_context is stopped. - bool stopped() const - { - return ::InterlockedExchangeAdd(&stopped_, 0) != 0; - } - - // Restart in preparation for a subsequent run invocation. - void restart() - { - ::InterlockedExchange(&stopped_, 0); - } - - // Notify that some work has started. - void work_started() - { - ::InterlockedIncrement(&outstanding_work_); - } - - // Notify that some work has finished. - void work_finished() - { - if (::InterlockedDecrement(&outstanding_work_) == 0) - stop(); - } - - // Return whether a handler can be dispatched immediately. - bool can_dispatch() - { - return thread_call_stack::contains(this) != 0; - } - - // Request invocation of the given operation and return immediately. Assumes - // that work_started() has not yet been called for the operation. - void post_immediate_completion(win_iocp_operation* op, bool) - { - work_started(); - post_deferred_completion(op); - } - - // Request invocation of the given operation and return immediately. Assumes - // that work_started() was previously called for the operation. - ASIO_DECL void post_deferred_completion(win_iocp_operation* op); - - // Request invocation of the given operation and return immediately. Assumes - // that work_started() was previously called for the operations. - ASIO_DECL void post_deferred_completions( - op_queue& ops); - - // Request invocation of the given operation using the thread-private queue - // and return immediately. Assumes that work_started() has not yet been - // called for the operation. - void post_private_immediate_completion(win_iocp_operation* op) - { - post_immediate_completion(op, false); - } - - // Request invocation of the given operation using the thread-private queue - // and return immediately. Assumes that work_started() was previously called - // for the operation. - void post_private_deferred_completion(win_iocp_operation* op) - { - post_deferred_completion(op); - } - - // Enqueue the given operation following a failed attempt to dispatch the - // operation for immediate invocation. - void do_dispatch(operation* op) - { - post_immediate_completion(op, false); - } - - // Process unfinished operations as part of a shutdown operation. Assumes - // that work_started() was previously called for the operations. - ASIO_DECL void abandon_operations(op_queue& ops); - - // Called after starting an overlapped I/O operation that did not complete - // immediately. The caller must have already called work_started() prior to - // starting the operation. - ASIO_DECL void on_pending(win_iocp_operation* op); - - // Called after starting an overlapped I/O operation that completed - // immediately. The caller must have already called work_started() prior to - // starting the operation. - ASIO_DECL void on_completion(win_iocp_operation* op, - DWORD last_error = 0, DWORD bytes_transferred = 0); - - // Called after starting an overlapped I/O operation that completed - // immediately. The caller must have already called work_started() prior to - // starting the operation. - ASIO_DECL void on_completion(win_iocp_operation* op, - const asio::error_code& ec, DWORD bytes_transferred = 0); - - // Add a new timer queue to the service. - template - void add_timer_queue(timer_queue& timer_queue); - - // Remove a timer queue from the service. - template - void remove_timer_queue(timer_queue& timer_queue); - - // Schedule a new operation in the given timer queue to expire at the - // specified absolute time. - template - void schedule_timer(timer_queue& queue, - const typename Time_Traits::time_type& time, - typename timer_queue::per_timer_data& timer, wait_op* op); - - // Cancel the timer associated with the given token. Returns the number of - // handlers that have been posted or dispatched. - template - std::size_t cancel_timer(timer_queue& queue, - typename timer_queue::per_timer_data& timer, - std::size_t max_cancelled = (std::numeric_limits::max)()); - - // Move the timer operations associated with the given timer. - template - void move_timer(timer_queue& queue, - typename timer_queue::per_timer_data& to, - typename timer_queue::per_timer_data& from); - - // Get the concurrency hint that was used to initialise the io_context. - int concurrency_hint() const - { - return concurrency_hint_; - } - -private: -#if defined(WINVER) && (WINVER < 0x0500) - typedef DWORD dword_ptr_t; - typedef ULONG ulong_ptr_t; -#else // defined(WINVER) && (WINVER < 0x0500) - typedef DWORD_PTR dword_ptr_t; - typedef ULONG_PTR ulong_ptr_t; -#endif // defined(WINVER) && (WINVER < 0x0500) - - // Dequeues at most one operation from the I/O completion port, and then - // executes it. Returns the number of operations that were dequeued (i.e. - // either 0 or 1). - ASIO_DECL size_t do_one(DWORD msec, asio::error_code& ec); - - // Helper to calculate the GetQueuedCompletionStatus timeout. - ASIO_DECL static DWORD get_gqcs_timeout(); - - // Helper function to add a new timer queue. - ASIO_DECL void do_add_timer_queue(timer_queue_base& queue); - - // Helper function to remove a timer queue. - ASIO_DECL void do_remove_timer_queue(timer_queue_base& queue); - - // Called to recalculate and update the timeout. - ASIO_DECL void update_timeout(); - - // Helper class to call work_finished() on block exit. - struct work_finished_on_block_exit; - - // Helper class for managing a HANDLE. - struct auto_handle - { - HANDLE handle; - auto_handle() : handle(0) {} - ~auto_handle() { if (handle) ::CloseHandle(handle); } - }; - - // The IO completion port used for queueing operations. - auto_handle iocp_; - - // The count of unfinished work. - long outstanding_work_; - - // Flag to indicate whether the event loop has been stopped. - mutable long stopped_; - - // Flag to indicate whether there is an in-flight stop event. Every event - // posted using PostQueuedCompletionStatus consumes non-paged pool, so to - // avoid exhausting this resouce we limit the number of outstanding events. - long stop_event_posted_; - - // Flag to indicate whether the service has been shut down. - long shutdown_; - - enum - { - // Timeout to use with GetQueuedCompletionStatus on older versions of - // Windows. Some versions of windows have a "bug" where a call to - // GetQueuedCompletionStatus can appear stuck even though there are events - // waiting on the queue. Using a timeout helps to work around the issue. - default_gqcs_timeout = 500, - - // Maximum waitable timer timeout, in milliseconds. - max_timeout_msec = 5 * 60 * 1000, - - // Maximum waitable timer timeout, in microseconds. - max_timeout_usec = max_timeout_msec * 1000, - - // Completion key value used to wake up a thread to dispatch timers or - // completed operations. - wake_for_dispatch = 1, - - // Completion key value to indicate that an operation has posted with the - // original last_error and bytes_transferred values stored in the fields of - // the OVERLAPPED structure. - overlapped_contains_result = 2 - }; - - // Timeout to use with GetQueuedCompletionStatus. - const DWORD gqcs_timeout_; - - // Function object for processing timeouts in a background thread. - struct timer_thread_function; - friend struct timer_thread_function; - - // Background thread used for processing timeouts. - scoped_ptr timer_thread_; - - // A waitable timer object used for waiting for timeouts. - auto_handle waitable_timer_; - - // Non-zero if timers or completed operations need to be dispatched. - long dispatch_required_; - - // Mutex for protecting access to the timer queues and completed operations. - mutex dispatch_mutex_; - - // The timer queues. - timer_queue_set timer_queues_; - - // The operations that are ready to dispatch. - op_queue completed_ops_; - - // The concurrency hint used to initialise the io_context. - const int concurrency_hint_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/detail/impl/win_iocp_io_context.hpp" -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/win_iocp_io_context.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_HAS_IOCP) - -#endif // ASIO_DETAIL_WIN_IOCP_IO_CONTEXT_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_iocp_null_buffers_op.hpp b/tools/sdk/include/asio/asio/detail/win_iocp_null_buffers_op.hpp deleted file mode 100644 index db70cb28a14..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_iocp_null_buffers_op.hpp +++ /dev/null @@ -1,121 +0,0 @@ -// -// detail/win_iocp_null_buffers_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_IOCP_NULL_BUFFERS_OP_HPP -#define ASIO_DETAIL_WIN_IOCP_NULL_BUFFERS_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_IOCP) - -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/reactor_op.hpp" -#include "asio/detail/socket_ops.hpp" -#include "asio/error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class win_iocp_null_buffers_op : public reactor_op -{ -public: - ASIO_DEFINE_HANDLER_PTR(win_iocp_null_buffers_op); - - win_iocp_null_buffers_op(socket_ops::weak_cancel_token_type cancel_token, - Handler& handler) - : reactor_op(&win_iocp_null_buffers_op::do_perform, - &win_iocp_null_buffers_op::do_complete), - cancel_token_(cancel_token), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static status do_perform(reactor_op*) - { - return done; - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& result_ec, - std::size_t bytes_transferred) - { - asio::error_code ec(result_ec); - - // Take ownership of the operation object. - win_iocp_null_buffers_op* o(static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - ASIO_HANDLER_COMPLETION((*o)); - - // The reactor may have stored a result in the operation object. - if (o->ec_) - ec = o->ec_; - - // Map non-portable errors to their portable counterparts. - if (ec.value() == ERROR_NETNAME_DELETED) - { - if (o->cancel_token_.expired()) - ec = asio::error::operation_aborted; - else - ec = asio::error::connection_reset; - } - else if (ec.value() == ERROR_PORT_UNREACHABLE) - { - ec = asio::error::connection_refused; - } - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder2 - handler(o->handler_, ec, bytes_transferred); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - socket_ops::weak_cancel_token_type cancel_token_; - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_IOCP) - -#endif // ASIO_DETAIL_WIN_IOCP_NULL_BUFFERS_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_iocp_operation.hpp b/tools/sdk/include/asio/asio/detail/win_iocp_operation.hpp deleted file mode 100644 index 81d43f07f64..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_iocp_operation.hpp +++ /dev/null @@ -1,96 +0,0 @@ -// -// detail/win_iocp_operation.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_IOCP_OPERATION_HPP -#define ASIO_DETAIL_WIN_IOCP_OPERATION_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_IOCP) - -#include "asio/detail/handler_tracking.hpp" -#include "asio/detail/op_queue.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/error_code.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class win_iocp_io_context; - -// Base class for all operations. A function pointer is used instead of virtual -// functions to avoid the associated overhead. -class win_iocp_operation - : public OVERLAPPED - ASIO_ALSO_INHERIT_TRACKED_HANDLER -{ -public: - typedef win_iocp_operation operation_type; - - void complete(void* owner, const asio::error_code& ec, - std::size_t bytes_transferred) - { - func_(owner, this, ec, bytes_transferred); - } - - void destroy() - { - func_(0, this, asio::error_code(), 0); - } - -protected: - typedef void (*func_type)( - void*, win_iocp_operation*, - const asio::error_code&, std::size_t); - - win_iocp_operation(func_type func) - : next_(0), - func_(func) - { - reset(); - } - - // Prevents deletion through this type. - ~win_iocp_operation() - { - } - - void reset() - { - Internal = 0; - InternalHigh = 0; - Offset = 0; - OffsetHigh = 0; - hEvent = 0; - ready_ = 0; - } - -private: - friend class op_queue_access; - friend class win_iocp_io_context; - win_iocp_operation* next_; - func_type func_; - long ready_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_IOCP) - -#endif // ASIO_DETAIL_WIN_IOCP_OPERATION_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_iocp_overlapped_op.hpp b/tools/sdk/include/asio/asio/detail/win_iocp_overlapped_op.hpp deleted file mode 100644 index 2b2cc319b22..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_iocp_overlapped_op.hpp +++ /dev/null @@ -1,90 +0,0 @@ -// -// detail/win_iocp_overlapped_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_IOCP_OVERLAPPED_OP_HPP -#define ASIO_DETAIL_WIN_IOCP_OVERLAPPED_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_IOCP) - -#include "asio/error.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/operation.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class win_iocp_overlapped_op : public operation -{ -public: - ASIO_DEFINE_HANDLER_PTR(win_iocp_overlapped_op); - - win_iocp_overlapped_op(Handler& handler) - : operation(&win_iocp_overlapped_op::do_complete), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& ec, std::size_t bytes_transferred) - { - // Take ownership of the operation object. - win_iocp_overlapped_op* o(static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - ASIO_HANDLER_COMPLETION((*o)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder2 - handler(o->handler_, ec, bytes_transferred); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_IOCP) - -#endif // ASIO_DETAIL_WIN_IOCP_OVERLAPPED_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_iocp_overlapped_ptr.hpp b/tools/sdk/include/asio/asio/detail/win_iocp_overlapped_ptr.hpp deleted file mode 100644 index 7a191143484..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_iocp_overlapped_ptr.hpp +++ /dev/null @@ -1,143 +0,0 @@ -// -// detail/win_iocp_overlapped_ptr.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_IOCP_OVERLAPPED_PTR_HPP -#define ASIO_DETAIL_WIN_IOCP_OVERLAPPED_PTR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_IOCP) - -#include "asio/io_context.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/win_iocp_overlapped_op.hpp" -#include "asio/detail/win_iocp_io_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -// Wraps a handler to create an OVERLAPPED object for use with overlapped I/O. -class win_iocp_overlapped_ptr - : private noncopyable -{ -public: - // Construct an empty win_iocp_overlapped_ptr. - win_iocp_overlapped_ptr() - : ptr_(0), - iocp_service_(0) - { - } - - // Construct an win_iocp_overlapped_ptr to contain the specified handler. - template - explicit win_iocp_overlapped_ptr( - asio::io_context& io_context, ASIO_MOVE_ARG(Handler) handler) - : ptr_(0), - iocp_service_(0) - { - this->reset(io_context, ASIO_MOVE_CAST(Handler)(handler)); - } - - // Destructor automatically frees the OVERLAPPED object unless released. - ~win_iocp_overlapped_ptr() - { - reset(); - } - - // Reset to empty. - void reset() - { - if (ptr_) - { - ptr_->destroy(); - ptr_ = 0; - iocp_service_->work_finished(); - iocp_service_ = 0; - } - } - - // Reset to contain the specified handler, freeing any current OVERLAPPED - // object. - template - void reset(asio::io_context& io_context, Handler handler) - { - typedef win_iocp_overlapped_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(handler); - - ASIO_HANDLER_CREATION((io_context, *p.p, - "io_context", &io_context.impl_, 0, "overlapped")); - - io_context.impl_.work_started(); - reset(); - ptr_ = p.p; - p.v = p.p = 0; - iocp_service_ = &io_context.impl_; - } - - // Get the contained OVERLAPPED object. - OVERLAPPED* get() - { - return ptr_; - } - - // Get the contained OVERLAPPED object. - const OVERLAPPED* get() const - { - return ptr_; - } - - // Release ownership of the OVERLAPPED object. - OVERLAPPED* release() - { - if (ptr_) - iocp_service_->on_pending(ptr_); - - OVERLAPPED* tmp = ptr_; - ptr_ = 0; - iocp_service_ = 0; - return tmp; - } - - // Post completion notification for overlapped operation. Releases ownership. - void complete(const asio::error_code& ec, - std::size_t bytes_transferred) - { - if (ptr_) - { - iocp_service_->on_completion(ptr_, ec, - static_cast(bytes_transferred)); - ptr_ = 0; - iocp_service_ = 0; - } - } - -private: - win_iocp_operation* ptr_; - win_iocp_io_context* iocp_service_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_IOCP) - -#endif // ASIO_DETAIL_WIN_IOCP_OVERLAPPED_PTR_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_iocp_serial_port_service.hpp b/tools/sdk/include/asio/asio/detail/win_iocp_serial_port_service.hpp deleted file mode 100644 index ac06348ecfd..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_iocp_serial_port_service.hpp +++ /dev/null @@ -1,230 +0,0 @@ -// -// detail/win_iocp_serial_port_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_IOCP_SERIAL_PORT_SERVICE_HPP -#define ASIO_DETAIL_WIN_IOCP_SERIAL_PORT_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_IOCP) && defined(ASIO_HAS_SERIAL_PORT) - -#include -#include "asio/error.hpp" -#include "asio/io_context.hpp" -#include "asio/detail/win_iocp_handle_service.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -// Extend win_iocp_handle_service to provide serial port support. -class win_iocp_serial_port_service : - public service_base -{ -public: - // The native type of a serial port. - typedef win_iocp_handle_service::native_handle_type native_handle_type; - - // The implementation type of the serial port. - typedef win_iocp_handle_service::implementation_type implementation_type; - - // Constructor. - ASIO_DECL win_iocp_serial_port_service( - asio::io_context& io_context); - - // Destroy all user-defined handler objects owned by the service. - ASIO_DECL void shutdown(); - - // Construct a new serial port implementation. - void construct(implementation_type& impl) - { - handle_service_.construct(impl); - } - - // Move-construct a new serial port implementation. - void move_construct(implementation_type& impl, - implementation_type& other_impl) - { - handle_service_.move_construct(impl, other_impl); - } - - // Move-assign from another serial port implementation. - void move_assign(implementation_type& impl, - win_iocp_serial_port_service& other_service, - implementation_type& other_impl) - { - handle_service_.move_assign(impl, - other_service.handle_service_, other_impl); - } - - // Destroy a serial port implementation. - void destroy(implementation_type& impl) - { - handle_service_.destroy(impl); - } - - // Open the serial port using the specified device name. - ASIO_DECL asio::error_code open(implementation_type& impl, - const std::string& device, asio::error_code& ec); - - // Assign a native handle to a serial port implementation. - asio::error_code assign(implementation_type& impl, - const native_handle_type& handle, asio::error_code& ec) - { - return handle_service_.assign(impl, handle, ec); - } - - // Determine whether the serial port is open. - bool is_open(const implementation_type& impl) const - { - return handle_service_.is_open(impl); - } - - // Destroy a serial port implementation. - asio::error_code close(implementation_type& impl, - asio::error_code& ec) - { - return handle_service_.close(impl, ec); - } - - // Get the native serial port representation. - native_handle_type native_handle(implementation_type& impl) - { - return handle_service_.native_handle(impl); - } - - // Cancel all operations associated with the handle. - asio::error_code cancel(implementation_type& impl, - asio::error_code& ec) - { - return handle_service_.cancel(impl, ec); - } - - // Set an option on the serial port. - template - asio::error_code set_option(implementation_type& impl, - const SettableSerialPortOption& option, asio::error_code& ec) - { - return do_set_option(impl, - &win_iocp_serial_port_service::store_option, - &option, ec); - } - - // Get an option from the serial port. - template - asio::error_code get_option(const implementation_type& impl, - GettableSerialPortOption& option, asio::error_code& ec) const - { - return do_get_option(impl, - &win_iocp_serial_port_service::load_option, - &option, ec); - } - - // Send a break sequence to the serial port. - asio::error_code send_break(implementation_type&, - asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return ec; - } - - // Write the given data. Returns the number of bytes sent. - template - size_t write_some(implementation_type& impl, - const ConstBufferSequence& buffers, asio::error_code& ec) - { - return handle_service_.write_some(impl, buffers, ec); - } - - // Start an asynchronous write. The data being written must be valid for the - // lifetime of the asynchronous operation. - template - void async_write_some(implementation_type& impl, - const ConstBufferSequence& buffers, Handler& handler) - { - handle_service_.async_write_some(impl, buffers, handler); - } - - // Read some data. Returns the number of bytes received. - template - size_t read_some(implementation_type& impl, - const MutableBufferSequence& buffers, asio::error_code& ec) - { - return handle_service_.read_some(impl, buffers, ec); - } - - // Start an asynchronous read. The buffer for the data being received must be - // valid for the lifetime of the asynchronous operation. - template - void async_read_some(implementation_type& impl, - const MutableBufferSequence& buffers, Handler& handler) - { - handle_service_.async_read_some(impl, buffers, handler); - } - -private: - // Function pointer type for storing a serial port option. - typedef asio::error_code (*store_function_type)( - const void*, ::DCB&, asio::error_code&); - - // Helper function template to store a serial port option. - template - static asio::error_code store_option(const void* option, - ::DCB& storage, asio::error_code& ec) - { - static_cast(option)->store(storage, ec); - return ec; - } - - // Helper function to set a serial port option. - ASIO_DECL asio::error_code do_set_option( - implementation_type& impl, store_function_type store, - const void* option, asio::error_code& ec); - - // Function pointer type for loading a serial port option. - typedef asio::error_code (*load_function_type)( - void*, const ::DCB&, asio::error_code&); - - // Helper function template to load a serial port option. - template - static asio::error_code load_option(void* option, - const ::DCB& storage, asio::error_code& ec) - { - static_cast(option)->load(storage, ec); - return ec; - } - - // Helper function to get a serial port option. - ASIO_DECL asio::error_code do_get_option( - const implementation_type& impl, load_function_type load, - void* option, asio::error_code& ec) const; - - // The implementation used for initiating asynchronous operations. - win_iocp_handle_service handle_service_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/win_iocp_serial_port_service.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_HAS_IOCP) && defined(ASIO_HAS_SERIAL_PORT) - -#endif // ASIO_DETAIL_WIN_IOCP_SERIAL_PORT_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_iocp_socket_accept_op.hpp b/tools/sdk/include/asio/asio/detail/win_iocp_socket_accept_op.hpp deleted file mode 100644 index 18e73356ca5..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_iocp_socket_accept_op.hpp +++ /dev/null @@ -1,297 +0,0 @@ -// -// detail/win_iocp_socket_accept_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_IOCP_SOCKET_ACCEPT_OP_HPP -#define ASIO_DETAIL_WIN_IOCP_SOCKET_ACCEPT_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_IOCP) - -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/operation.hpp" -#include "asio/detail/socket_ops.hpp" -#include "asio/detail/win_iocp_socket_service_base.hpp" -#include "asio/error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class win_iocp_socket_accept_op : public operation -{ -public: - ASIO_DEFINE_HANDLER_PTR(win_iocp_socket_accept_op); - - win_iocp_socket_accept_op(win_iocp_socket_service_base& socket_service, - socket_type socket, Socket& peer, const Protocol& protocol, - typename Protocol::endpoint* peer_endpoint, - bool enable_connection_aborted, Handler& handler) - : operation(&win_iocp_socket_accept_op::do_complete), - socket_service_(socket_service), - socket_(socket), - peer_(peer), - protocol_(protocol), - peer_endpoint_(peer_endpoint), - enable_connection_aborted_(enable_connection_aborted), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - socket_holder& new_socket() - { - return new_socket_; - } - - void* output_buffer() - { - return output_buffer_; - } - - DWORD address_length() - { - return sizeof(sockaddr_storage_type) + 16; - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& result_ec, - std::size_t /*bytes_transferred*/) - { - asio::error_code ec(result_ec); - - // Take ownership of the operation object. - win_iocp_socket_accept_op* o(static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - if (owner) - { - typename Protocol::endpoint peer_endpoint; - std::size_t addr_len = peer_endpoint.capacity(); - socket_ops::complete_iocp_accept(o->socket_, - o->output_buffer(), o->address_length(), - peer_endpoint.data(), &addr_len, - o->new_socket_.get(), ec); - - // Restart the accept operation if we got the connection_aborted error - // and the enable_connection_aborted socket option is not set. - if (ec == asio::error::connection_aborted - && !o->enable_connection_aborted_) - { - o->reset(); - o->socket_service_.restart_accept_op(o->socket_, - o->new_socket_, o->protocol_.family(), - o->protocol_.type(), o->protocol_.protocol(), - o->output_buffer(), o->address_length(), o); - p.v = p.p = 0; - return; - } - - // If the socket was successfully accepted, transfer ownership of the - // socket to the peer object. - if (!ec) - { - o->peer_.assign(o->protocol_, - typename Socket::native_handle_type( - o->new_socket_.get(), peer_endpoint), ec); - if (!ec) - o->new_socket_.release(); - } - - // Pass endpoint back to caller. - if (o->peer_endpoint_) - *o->peer_endpoint_ = peer_endpoint; - } - - ASIO_HANDLER_COMPLETION((*o)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder1 - handler(o->handler_, ec); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - win_iocp_socket_service_base& socket_service_; - socket_type socket_; - socket_holder new_socket_; - Socket& peer_; - Protocol protocol_; - typename Protocol::endpoint* peer_endpoint_; - unsigned char output_buffer_[(sizeof(sockaddr_storage_type) + 16) * 2]; - bool enable_connection_aborted_; - Handler handler_; -}; - -#if defined(ASIO_HAS_MOVE) - -template -class win_iocp_socket_move_accept_op : public operation -{ -public: - ASIO_DEFINE_HANDLER_PTR(win_iocp_socket_move_accept_op); - - win_iocp_socket_move_accept_op( - win_iocp_socket_service_base& socket_service, socket_type socket, - const Protocol& protocol, asio::io_context& peer_io_context, - typename Protocol::endpoint* peer_endpoint, - bool enable_connection_aborted, Handler& handler) - : operation(&win_iocp_socket_move_accept_op::do_complete), - socket_service_(socket_service), - socket_(socket), - peer_(peer_io_context), - protocol_(protocol), - peer_endpoint_(peer_endpoint), - enable_connection_aborted_(enable_connection_aborted), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - socket_holder& new_socket() - { - return new_socket_; - } - - void* output_buffer() - { - return output_buffer_; - } - - DWORD address_length() - { - return sizeof(sockaddr_storage_type) + 16; - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& result_ec, - std::size_t /*bytes_transferred*/) - { - asio::error_code ec(result_ec); - - // Take ownership of the operation object. - win_iocp_socket_move_accept_op* o( - static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - if (owner) - { - typename Protocol::endpoint peer_endpoint; - std::size_t addr_len = peer_endpoint.capacity(); - socket_ops::complete_iocp_accept(o->socket_, - o->output_buffer(), o->address_length(), - peer_endpoint.data(), &addr_len, - o->new_socket_.get(), ec); - - // Restart the accept operation if we got the connection_aborted error - // and the enable_connection_aborted socket option is not set. - if (ec == asio::error::connection_aborted - && !o->enable_connection_aborted_) - { - o->reset(); - o->socket_service_.restart_accept_op(o->socket_, - o->new_socket_, o->protocol_.family(), - o->protocol_.type(), o->protocol_.protocol(), - o->output_buffer(), o->address_length(), o); - p.v = p.p = 0; - return; - } - - // If the socket was successfully accepted, transfer ownership of the - // socket to the peer object. - if (!ec) - { - o->peer_.assign(o->protocol_, - typename Protocol::socket::native_handle_type( - o->new_socket_.get(), peer_endpoint), ec); - if (!ec) - o->new_socket_.release(); - } - - // Pass endpoint back to caller. - if (o->peer_endpoint_) - *o->peer_endpoint_ = peer_endpoint; - } - - ASIO_HANDLER_COMPLETION((*o)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::move_binder2 - handler(0, ASIO_MOVE_CAST(Handler)(o->handler_), ec, - ASIO_MOVE_CAST(typename Protocol::socket)(o->peer_)); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, "...")); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - win_iocp_socket_service_base& socket_service_; - socket_type socket_; - socket_holder new_socket_; - typename Protocol::socket peer_; - Protocol protocol_; - typename Protocol::endpoint* peer_endpoint_; - unsigned char output_buffer_[(sizeof(sockaddr_storage_type) + 16) * 2]; - bool enable_connection_aborted_; - Handler handler_; -}; - -#endif // defined(ASIO_HAS_MOVE) - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_IOCP) - -#endif // ASIO_DETAIL_WIN_IOCP_SOCKET_ACCEPT_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_iocp_socket_connect_op.hpp b/tools/sdk/include/asio/asio/detail/win_iocp_socket_connect_op.hpp deleted file mode 100644 index e0c52dc9758..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_iocp_socket_connect_op.hpp +++ /dev/null @@ -1,127 +0,0 @@ -// -// detail/win_iocp_socket_connect_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_IOCP_SOCKET_CONNECT_OP_HPP -#define ASIO_DETAIL_WIN_IOCP_SOCKET_CONNECT_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_IOCP) - -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/reactor_op.hpp" -#include "asio/detail/socket_ops.hpp" -#include "asio/error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class win_iocp_socket_connect_op_base : public reactor_op -{ -public: - win_iocp_socket_connect_op_base(socket_type socket, func_type complete_func) - : reactor_op(&win_iocp_socket_connect_op_base::do_perform, complete_func), - socket_(socket), - connect_ex_(false) - { - } - - static status do_perform(reactor_op* base) - { - win_iocp_socket_connect_op_base* o( - static_cast(base)); - - return socket_ops::non_blocking_connect( - o->socket_, o->ec_) ? done : not_done; - } - - socket_type socket_; - bool connect_ex_; -}; - -template -class win_iocp_socket_connect_op : public win_iocp_socket_connect_op_base -{ -public: - ASIO_DEFINE_HANDLER_PTR(win_iocp_socket_connect_op); - - win_iocp_socket_connect_op(socket_type socket, Handler& handler) - : win_iocp_socket_connect_op_base(socket, - &win_iocp_socket_connect_op::do_complete), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& result_ec, - std::size_t /*bytes_transferred*/) - { - asio::error_code ec(result_ec); - - // Take ownership of the operation object. - win_iocp_socket_connect_op* o( - static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - if (owner) - { - if (o->connect_ex_) - socket_ops::complete_iocp_connect(o->socket_, ec); - else - ec = o->ec_; - } - - ASIO_HANDLER_COMPLETION((*o)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder1 - handler(o->handler_, ec); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_IOCP) - -#endif // ASIO_DETAIL_WIN_IOCP_SOCKET_CONNECT_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_iocp_socket_recv_op.hpp b/tools/sdk/include/asio/asio/detail/win_iocp_socket_recv_op.hpp deleted file mode 100644 index 41595405db3..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_iocp_socket_recv_op.hpp +++ /dev/null @@ -1,117 +0,0 @@ -// -// detail/win_iocp_socket_recv_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_IOCP_SOCKET_RECV_OP_HPP -#define ASIO_DETAIL_WIN_IOCP_SOCKET_RECV_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_IOCP) - -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/operation.hpp" -#include "asio/detail/socket_ops.hpp" -#include "asio/error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class win_iocp_socket_recv_op : public operation -{ -public: - ASIO_DEFINE_HANDLER_PTR(win_iocp_socket_recv_op); - - win_iocp_socket_recv_op(socket_ops::state_type state, - socket_ops::weak_cancel_token_type cancel_token, - const MutableBufferSequence& buffers, Handler& handler) - : operation(&win_iocp_socket_recv_op::do_complete), - state_(state), - cancel_token_(cancel_token), - buffers_(buffers), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& result_ec, - std::size_t bytes_transferred) - { - asio::error_code ec(result_ec); - - // Take ownership of the operation object. - win_iocp_socket_recv_op* o(static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - ASIO_HANDLER_COMPLETION((*o)); - -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - // Check whether buffers are still valid. - if (owner) - { - buffer_sequence_adapter::validate(o->buffers_); - } -#endif // defined(ASIO_ENABLE_BUFFER_DEBUGGING) - - socket_ops::complete_iocp_recv(o->state_, o->cancel_token_, - buffer_sequence_adapter::all_empty(o->buffers_), - ec, bytes_transferred); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder2 - handler(o->handler_, ec, bytes_transferred); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - socket_ops::state_type state_; - socket_ops::weak_cancel_token_type cancel_token_; - MutableBufferSequence buffers_; - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_IOCP) - -#endif // ASIO_DETAIL_WIN_IOCP_SOCKET_RECV_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_iocp_socket_recvfrom_op.hpp b/tools/sdk/include/asio/asio/detail/win_iocp_socket_recvfrom_op.hpp deleted file mode 100644 index 843ce5bba5f..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_iocp_socket_recvfrom_op.hpp +++ /dev/null @@ -1,125 +0,0 @@ -// -// detail/win_iocp_socket_recvfrom_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_IOCP_SOCKET_RECVFROM_OP_HPP -#define ASIO_DETAIL_WIN_IOCP_SOCKET_RECVFROM_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_IOCP) - -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/operation.hpp" -#include "asio/detail/socket_ops.hpp" -#include "asio/error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class win_iocp_socket_recvfrom_op : public operation -{ -public: - ASIO_DEFINE_HANDLER_PTR(win_iocp_socket_recvfrom_op); - - win_iocp_socket_recvfrom_op(Endpoint& endpoint, - socket_ops::weak_cancel_token_type cancel_token, - const MutableBufferSequence& buffers, Handler& handler) - : operation(&win_iocp_socket_recvfrom_op::do_complete), - endpoint_(endpoint), - endpoint_size_(static_cast(endpoint.capacity())), - cancel_token_(cancel_token), - buffers_(buffers), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - int& endpoint_size() - { - return endpoint_size_; - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& result_ec, - std::size_t bytes_transferred) - { - asio::error_code ec(result_ec); - - // Take ownership of the operation object. - win_iocp_socket_recvfrom_op* o( - static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - ASIO_HANDLER_COMPLETION((*o)); - -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - // Check whether buffers are still valid. - if (owner) - { - buffer_sequence_adapter::validate(o->buffers_); - } -#endif // defined(ASIO_ENABLE_BUFFER_DEBUGGING) - - socket_ops::complete_iocp_recvfrom(o->cancel_token_, ec); - - // Record the size of the endpoint returned by the operation. - o->endpoint_.resize(o->endpoint_size_); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder2 - handler(o->handler_, ec, bytes_transferred); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Endpoint& endpoint_; - int endpoint_size_; - socket_ops::weak_cancel_token_type cancel_token_; - MutableBufferSequence buffers_; - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_IOCP) - -#endif // ASIO_DETAIL_WIN_IOCP_SOCKET_RECVFROM_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_iocp_socket_recvmsg_op.hpp b/tools/sdk/include/asio/asio/detail/win_iocp_socket_recvmsg_op.hpp deleted file mode 100644 index 78f36b7f343..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_iocp_socket_recvmsg_op.hpp +++ /dev/null @@ -1,118 +0,0 @@ -// -// detail/win_iocp_socket_recvmsg_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_IOCP_SOCKET_RECVMSG_OP_HPP -#define ASIO_DETAIL_WIN_IOCP_SOCKET_RECVMSG_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_IOCP) - -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/operation.hpp" -#include "asio/detail/socket_ops.hpp" -#include "asio/error.hpp" -#include "asio/socket_base.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class win_iocp_socket_recvmsg_op : public operation -{ -public: - ASIO_DEFINE_HANDLER_PTR(win_iocp_socket_recvmsg_op); - - win_iocp_socket_recvmsg_op( - socket_ops::weak_cancel_token_type cancel_token, - const MutableBufferSequence& buffers, - socket_base::message_flags& out_flags, Handler& handler) - : operation(&win_iocp_socket_recvmsg_op::do_complete), - cancel_token_(cancel_token), - buffers_(buffers), - out_flags_(out_flags), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& result_ec, - std::size_t bytes_transferred) - { - asio::error_code ec(result_ec); - - // Take ownership of the operation object. - win_iocp_socket_recvmsg_op* o( - static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - ASIO_HANDLER_COMPLETION((*o)); - -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - // Check whether buffers are still valid. - if (owner) - { - buffer_sequence_adapter::validate(o->buffers_); - } -#endif // defined(ASIO_ENABLE_BUFFER_DEBUGGING) - - socket_ops::complete_iocp_recvmsg(o->cancel_token_, ec); - o->out_flags_ = 0; - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder2 - handler(o->handler_, ec, bytes_transferred); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - socket_ops::weak_cancel_token_type cancel_token_; - MutableBufferSequence buffers_; - socket_base::message_flags& out_flags_; - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_IOCP) - -#endif // ASIO_DETAIL_WIN_IOCP_SOCKET_RECVMSG_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_iocp_socket_send_op.hpp b/tools/sdk/include/asio/asio/detail/win_iocp_socket_send_op.hpp deleted file mode 100644 index e1c7ab93c5c..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_iocp_socket_send_op.hpp +++ /dev/null @@ -1,111 +0,0 @@ -// -// detail/win_iocp_socket_send_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_IOCP_SOCKET_SEND_OP_HPP -#define ASIO_DETAIL_WIN_IOCP_SOCKET_SEND_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_IOCP) - -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/operation.hpp" -#include "asio/detail/socket_ops.hpp" -#include "asio/error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class win_iocp_socket_send_op : public operation -{ -public: - ASIO_DEFINE_HANDLER_PTR(win_iocp_socket_send_op); - - win_iocp_socket_send_op(socket_ops::weak_cancel_token_type cancel_token, - const ConstBufferSequence& buffers, Handler& handler) - : operation(&win_iocp_socket_send_op::do_complete), - cancel_token_(cancel_token), - buffers_(buffers), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& result_ec, - std::size_t bytes_transferred) - { - asio::error_code ec(result_ec); - - // Take ownership of the operation object. - win_iocp_socket_send_op* o(static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - ASIO_HANDLER_COMPLETION((*o)); - -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - // Check whether buffers are still valid. - if (owner) - { - buffer_sequence_adapter::validate(o->buffers_); - } -#endif // defined(ASIO_ENABLE_BUFFER_DEBUGGING) - - socket_ops::complete_iocp_send(o->cancel_token_, ec); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder2 - handler(o->handler_, ec, bytes_transferred); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - socket_ops::weak_cancel_token_type cancel_token_; - ConstBufferSequence buffers_; - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_IOCP) - -#endif // ASIO_DETAIL_WIN_IOCP_SOCKET_SEND_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_iocp_socket_service.hpp b/tools/sdk/include/asio/asio/detail/win_iocp_socket_service.hpp deleted file mode 100644 index 3f01b4d3e77..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_iocp_socket_service.hpp +++ /dev/null @@ -1,599 +0,0 @@ -// -// detail/win_iocp_socket_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_IOCP_SOCKET_SERVICE_HPP -#define ASIO_DETAIL_WIN_IOCP_SOCKET_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_IOCP) - -#include -#include "asio/error.hpp" -#include "asio/io_context.hpp" -#include "asio/socket_base.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/mutex.hpp" -#include "asio/detail/operation.hpp" -#include "asio/detail/reactor_op.hpp" -#include "asio/detail/select_reactor.hpp" -#include "asio/detail/socket_holder.hpp" -#include "asio/detail/socket_ops.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/detail/win_iocp_io_context.hpp" -#include "asio/detail/win_iocp_null_buffers_op.hpp" -#include "asio/detail/win_iocp_socket_accept_op.hpp" -#include "asio/detail/win_iocp_socket_connect_op.hpp" -#include "asio/detail/win_iocp_socket_recvfrom_op.hpp" -#include "asio/detail/win_iocp_socket_send_op.hpp" -#include "asio/detail/win_iocp_socket_service_base.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class win_iocp_socket_service : - public service_base >, - public win_iocp_socket_service_base -{ -public: - // The protocol type. - typedef Protocol protocol_type; - - // The endpoint type. - typedef typename Protocol::endpoint endpoint_type; - - // The native type of a socket. - class native_handle_type - { - public: - native_handle_type(socket_type s) - : socket_(s), - have_remote_endpoint_(false) - { - } - - native_handle_type(socket_type s, const endpoint_type& ep) - : socket_(s), - have_remote_endpoint_(true), - remote_endpoint_(ep) - { - } - - void operator=(socket_type s) - { - socket_ = s; - have_remote_endpoint_ = false; - remote_endpoint_ = endpoint_type(); - } - - operator socket_type() const - { - return socket_; - } - - bool have_remote_endpoint() const - { - return have_remote_endpoint_; - } - - endpoint_type remote_endpoint() const - { - return remote_endpoint_; - } - - private: - socket_type socket_; - bool have_remote_endpoint_; - endpoint_type remote_endpoint_; - }; - - // The implementation type of the socket. - struct implementation_type : - win_iocp_socket_service_base::base_implementation_type - { - // Default constructor. - implementation_type() - : protocol_(endpoint_type().protocol()), - have_remote_endpoint_(false), - remote_endpoint_() - { - } - - // The protocol associated with the socket. - protocol_type protocol_; - - // Whether we have a cached remote endpoint. - bool have_remote_endpoint_; - - // A cached remote endpoint. - endpoint_type remote_endpoint_; - }; - - // Constructor. - win_iocp_socket_service(asio::io_context& io_context) - : service_base >(io_context), - win_iocp_socket_service_base(io_context) - { - } - - // Destroy all user-defined handler objects owned by the service. - void shutdown() - { - this->base_shutdown(); - } - - // Move-construct a new socket implementation. - void move_construct(implementation_type& impl, - implementation_type& other_impl) - { - this->base_move_construct(impl, other_impl); - - impl.protocol_ = other_impl.protocol_; - other_impl.protocol_ = endpoint_type().protocol(); - - impl.have_remote_endpoint_ = other_impl.have_remote_endpoint_; - other_impl.have_remote_endpoint_ = false; - - impl.remote_endpoint_ = other_impl.remote_endpoint_; - other_impl.remote_endpoint_ = endpoint_type(); - } - - // Move-assign from another socket implementation. - void move_assign(implementation_type& impl, - win_iocp_socket_service_base& other_service, - implementation_type& other_impl) - { - this->base_move_assign(impl, other_service, other_impl); - - impl.protocol_ = other_impl.protocol_; - other_impl.protocol_ = endpoint_type().protocol(); - - impl.have_remote_endpoint_ = other_impl.have_remote_endpoint_; - other_impl.have_remote_endpoint_ = false; - - impl.remote_endpoint_ = other_impl.remote_endpoint_; - other_impl.remote_endpoint_ = endpoint_type(); - } - - // Move-construct a new socket implementation from another protocol type. - template - void converting_move_construct(implementation_type& impl, - win_iocp_socket_service&, - typename win_iocp_socket_service< - Protocol1>::implementation_type& other_impl) - { - this->base_move_construct(impl, other_impl); - - impl.protocol_ = protocol_type(other_impl.protocol_); - other_impl.protocol_ = typename Protocol1::endpoint().protocol(); - - impl.have_remote_endpoint_ = other_impl.have_remote_endpoint_; - other_impl.have_remote_endpoint_ = false; - - impl.remote_endpoint_ = other_impl.remote_endpoint_; - other_impl.remote_endpoint_ = typename Protocol1::endpoint(); - } - - // Open a new socket implementation. - asio::error_code open(implementation_type& impl, - const protocol_type& protocol, asio::error_code& ec) - { - if (!do_open(impl, protocol.family(), - protocol.type(), protocol.protocol(), ec)) - { - impl.protocol_ = protocol; - impl.have_remote_endpoint_ = false; - impl.remote_endpoint_ = endpoint_type(); - } - return ec; - } - - // Assign a native socket to a socket implementation. - asio::error_code assign(implementation_type& impl, - const protocol_type& protocol, const native_handle_type& native_socket, - asio::error_code& ec) - { - if (!do_assign(impl, protocol.type(), native_socket, ec)) - { - impl.protocol_ = protocol; - impl.have_remote_endpoint_ = native_socket.have_remote_endpoint(); - impl.remote_endpoint_ = native_socket.remote_endpoint(); - } - return ec; - } - - // Get the native socket representation. - native_handle_type native_handle(implementation_type& impl) - { - if (impl.have_remote_endpoint_) - return native_handle_type(impl.socket_, impl.remote_endpoint_); - return native_handle_type(impl.socket_); - } - - // Bind the socket to the specified local endpoint. - asio::error_code bind(implementation_type& impl, - const endpoint_type& endpoint, asio::error_code& ec) - { - socket_ops::bind(impl.socket_, endpoint.data(), endpoint.size(), ec); - return ec; - } - - // Set a socket option. - template - asio::error_code set_option(implementation_type& impl, - const Option& option, asio::error_code& ec) - { - socket_ops::setsockopt(impl.socket_, impl.state_, - option.level(impl.protocol_), option.name(impl.protocol_), - option.data(impl.protocol_), option.size(impl.protocol_), ec); - return ec; - } - - // Set a socket option. - template - asio::error_code get_option(const implementation_type& impl, - Option& option, asio::error_code& ec) const - { - std::size_t size = option.size(impl.protocol_); - socket_ops::getsockopt(impl.socket_, impl.state_, - option.level(impl.protocol_), option.name(impl.protocol_), - option.data(impl.protocol_), &size, ec); - if (!ec) - option.resize(impl.protocol_, size); - return ec; - } - - // Get the local endpoint. - endpoint_type local_endpoint(const implementation_type& impl, - asio::error_code& ec) const - { - endpoint_type endpoint; - std::size_t addr_len = endpoint.capacity(); - if (socket_ops::getsockname(impl.socket_, endpoint.data(), &addr_len, ec)) - return endpoint_type(); - endpoint.resize(addr_len); - return endpoint; - } - - // Get the remote endpoint. - endpoint_type remote_endpoint(const implementation_type& impl, - asio::error_code& ec) const - { - endpoint_type endpoint = impl.remote_endpoint_; - std::size_t addr_len = endpoint.capacity(); - if (socket_ops::getpeername(impl.socket_, endpoint.data(), - &addr_len, impl.have_remote_endpoint_, ec)) - return endpoint_type(); - endpoint.resize(addr_len); - return endpoint; - } - - // Disable sends or receives on the socket. - asio::error_code shutdown(base_implementation_type& impl, - socket_base::shutdown_type what, asio::error_code& ec) - { - socket_ops::shutdown(impl.socket_, what, ec); - return ec; - } - - // Send a datagram to the specified endpoint. Returns the number of bytes - // sent. - template - size_t send_to(implementation_type& impl, const ConstBufferSequence& buffers, - const endpoint_type& destination, socket_base::message_flags flags, - asio::error_code& ec) - { - buffer_sequence_adapter bufs(buffers); - - return socket_ops::sync_sendto(impl.socket_, impl.state_, - bufs.buffers(), bufs.count(), flags, - destination.data(), destination.size(), ec); - } - - // Wait until data can be sent without blocking. - size_t send_to(implementation_type& impl, const null_buffers&, - const endpoint_type&, socket_base::message_flags, - asio::error_code& ec) - { - // Wait for socket to become ready. - socket_ops::poll_write(impl.socket_, impl.state_, -1, ec); - - return 0; - } - - // Start an asynchronous send. The data being sent must be valid for the - // lifetime of the asynchronous operation. - template - void async_send_to(implementation_type& impl, - const ConstBufferSequence& buffers, const endpoint_type& destination, - socket_base::message_flags flags, Handler& handler) - { - // Allocate and construct an operation to wrap the handler. - typedef win_iocp_socket_send_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(impl.cancel_token_, buffers, handler); - - ASIO_HANDLER_CREATION((io_context_, *p.p, "socket", - &impl, impl.socket_, "async_send_to")); - - buffer_sequence_adapter bufs(buffers); - - start_send_to_op(impl, bufs.buffers(), bufs.count(), - destination.data(), static_cast(destination.size()), - flags, p.p); - p.v = p.p = 0; - } - - // Start an asynchronous wait until data can be sent without blocking. - template - void async_send_to(implementation_type& impl, const null_buffers&, - const endpoint_type&, socket_base::message_flags, Handler& handler) - { - // Allocate and construct an operation to wrap the handler. - typedef win_iocp_null_buffers_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(impl.cancel_token_, handler); - - ASIO_HANDLER_CREATION((io_context_, *p.p, "socket", - &impl, impl.socket_, "async_send_to(null_buffers)")); - - start_reactor_op(impl, select_reactor::write_op, p.p); - p.v = p.p = 0; - } - - // Receive a datagram with the endpoint of the sender. Returns the number of - // bytes received. - template - size_t receive_from(implementation_type& impl, - const MutableBufferSequence& buffers, - endpoint_type& sender_endpoint, socket_base::message_flags flags, - asio::error_code& ec) - { - buffer_sequence_adapter bufs(buffers); - - std::size_t addr_len = sender_endpoint.capacity(); - std::size_t bytes_recvd = socket_ops::sync_recvfrom( - impl.socket_, impl.state_, bufs.buffers(), bufs.count(), - flags, sender_endpoint.data(), &addr_len, ec); - - if (!ec) - sender_endpoint.resize(addr_len); - - return bytes_recvd; - } - - // Wait until data can be received without blocking. - size_t receive_from(implementation_type& impl, - const null_buffers&, endpoint_type& sender_endpoint, - socket_base::message_flags, asio::error_code& ec) - { - // Wait for socket to become ready. - socket_ops::poll_read(impl.socket_, impl.state_, -1, ec); - - // Reset endpoint since it can be given no sensible value at this time. - sender_endpoint = endpoint_type(); - - return 0; - } - - // Start an asynchronous receive. The buffer for the data being received and - // the sender_endpoint object must both be valid for the lifetime of the - // asynchronous operation. - template - void async_receive_from(implementation_type& impl, - const MutableBufferSequence& buffers, endpoint_type& sender_endp, - socket_base::message_flags flags, Handler& handler) - { - // Allocate and construct an operation to wrap the handler. - typedef win_iocp_socket_recvfrom_op< - MutableBufferSequence, endpoint_type, Handler> op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(sender_endp, impl.cancel_token_, buffers, handler); - - ASIO_HANDLER_CREATION((io_context_, *p.p, "socket", - &impl, impl.socket_, "async_receive_from")); - - buffer_sequence_adapter bufs(buffers); - - start_receive_from_op(impl, bufs.buffers(), bufs.count(), - sender_endp.data(), flags, &p.p->endpoint_size(), p.p); - p.v = p.p = 0; - } - - // Wait until data can be received without blocking. - template - void async_receive_from(implementation_type& impl, - const null_buffers&, endpoint_type& sender_endpoint, - socket_base::message_flags flags, Handler& handler) - { - // Allocate and construct an operation to wrap the handler. - typedef win_iocp_null_buffers_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(impl.cancel_token_, handler); - - ASIO_HANDLER_CREATION((io_context_, *p.p, "socket", - &impl, impl.socket_, "async_receive_from(null_buffers)")); - - // Reset endpoint since it can be given no sensible value at this time. - sender_endpoint = endpoint_type(); - - start_null_buffers_receive_op(impl, flags, p.p); - p.v = p.p = 0; - } - - // Accept a new connection. - template - asio::error_code accept(implementation_type& impl, Socket& peer, - endpoint_type* peer_endpoint, asio::error_code& ec) - { - // We cannot accept a socket that is already open. - if (peer.is_open()) - { - ec = asio::error::already_open; - return ec; - } - - std::size_t addr_len = peer_endpoint ? peer_endpoint->capacity() : 0; - socket_holder new_socket(socket_ops::sync_accept(impl.socket_, - impl.state_, peer_endpoint ? peer_endpoint->data() : 0, - peer_endpoint ? &addr_len : 0, ec)); - - // On success, assign new connection to peer socket object. - if (new_socket.get() != invalid_socket) - { - if (peer_endpoint) - peer_endpoint->resize(addr_len); - peer.assign(impl.protocol_, new_socket.get(), ec); - if (!ec) - new_socket.release(); - } - - return ec; - } - -#if defined(ASIO_HAS_MOVE) - // Accept a new connection. - typename Protocol::socket accept(implementation_type& impl, - io_context* peer_io_context, endpoint_type* peer_endpoint, - asio::error_code& ec) - { - typename Protocol::socket peer( - peer_io_context ? *peer_io_context : io_context_); - - std::size_t addr_len = peer_endpoint ? peer_endpoint->capacity() : 0; - socket_holder new_socket(socket_ops::sync_accept(impl.socket_, - impl.state_, peer_endpoint ? peer_endpoint->data() : 0, - peer_endpoint ? &addr_len : 0, ec)); - - // On success, assign new connection to peer socket object. - if (new_socket.get() != invalid_socket) - { - if (peer_endpoint) - peer_endpoint->resize(addr_len); - peer.assign(impl.protocol_, new_socket.get(), ec); - if (!ec) - new_socket.release(); - } - - return peer; - } -#endif // defined(ASIO_HAS_MOVE) - - // Start an asynchronous accept. The peer and peer_endpoint objects - // must be valid until the accept's handler is invoked. - template - void async_accept(implementation_type& impl, Socket& peer, - endpoint_type* peer_endpoint, Handler& handler) - { - // Allocate and construct an operation to wrap the handler. - typedef win_iocp_socket_accept_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - bool enable_connection_aborted = - (impl.state_ & socket_ops::enable_connection_aborted) != 0; - p.p = new (p.v) op(*this, impl.socket_, peer, impl.protocol_, - peer_endpoint, enable_connection_aborted, handler); - - ASIO_HANDLER_CREATION((io_context_, *p.p, "socket", - &impl, impl.socket_, "async_accept")); - - start_accept_op(impl, peer.is_open(), p.p->new_socket(), - impl.protocol_.family(), impl.protocol_.type(), - impl.protocol_.protocol(), p.p->output_buffer(), - p.p->address_length(), p.p); - p.v = p.p = 0; - } - -#if defined(ASIO_HAS_MOVE) - // Start an asynchronous accept. The peer and peer_endpoint objects - // must be valid until the accept's handler is invoked. - template - void async_accept(implementation_type& impl, - asio::io_context* peer_io_context, - endpoint_type* peer_endpoint, Handler& handler) - { - // Allocate and construct an operation to wrap the handler. - typedef win_iocp_socket_move_accept_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - bool enable_connection_aborted = - (impl.state_ & socket_ops::enable_connection_aborted) != 0; - p.p = new (p.v) op(*this, impl.socket_, impl.protocol_, - peer_io_context ? *peer_io_context : io_context_, - peer_endpoint, enable_connection_aborted, handler); - - ASIO_HANDLER_CREATION((io_context_, *p.p, "socket", - &impl, impl.socket_, "async_accept")); - - start_accept_op(impl, false, p.p->new_socket(), - impl.protocol_.family(), impl.protocol_.type(), - impl.protocol_.protocol(), p.p->output_buffer(), - p.p->address_length(), p.p); - p.v = p.p = 0; - } -#endif // defined(ASIO_HAS_MOVE) - - // Connect the socket to the specified endpoint. - asio::error_code connect(implementation_type& impl, - const endpoint_type& peer_endpoint, asio::error_code& ec) - { - socket_ops::sync_connect(impl.socket_, - peer_endpoint.data(), peer_endpoint.size(), ec); - return ec; - } - - // Start an asynchronous connect. - template - void async_connect(implementation_type& impl, - const endpoint_type& peer_endpoint, Handler& handler) - { - // Allocate and construct an operation to wrap the handler. - typedef win_iocp_socket_connect_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(impl.socket_, handler); - - ASIO_HANDLER_CREATION((io_context_, *p.p, "socket", - &impl, impl.socket_, "async_connect")); - - start_connect_op(impl, impl.protocol_.family(), impl.protocol_.type(), - peer_endpoint.data(), static_cast(peer_endpoint.size()), p.p); - p.v = p.p = 0; - } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_IOCP) - -#endif // ASIO_DETAIL_WIN_IOCP_SOCKET_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_iocp_socket_service_base.hpp b/tools/sdk/include/asio/asio/detail/win_iocp_socket_service_base.hpp deleted file mode 100644 index ef1d7180e36..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_iocp_socket_service_base.hpp +++ /dev/null @@ -1,591 +0,0 @@ -// -// detail/win_iocp_socket_service_base.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_IOCP_SOCKET_SERVICE_BASE_HPP -#define ASIO_DETAIL_WIN_IOCP_SOCKET_SERVICE_BASE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_IOCP) - -#include "asio/error.hpp" -#include "asio/io_context.hpp" -#include "asio/socket_base.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/mutex.hpp" -#include "asio/detail/operation.hpp" -#include "asio/detail/reactor_op.hpp" -#include "asio/detail/select_reactor.hpp" -#include "asio/detail/socket_holder.hpp" -#include "asio/detail/socket_ops.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/detail/win_iocp_io_context.hpp" -#include "asio/detail/win_iocp_null_buffers_op.hpp" -#include "asio/detail/win_iocp_socket_connect_op.hpp" -#include "asio/detail/win_iocp_socket_send_op.hpp" -#include "asio/detail/win_iocp_socket_recv_op.hpp" -#include "asio/detail/win_iocp_socket_recvmsg_op.hpp" -#include "asio/detail/win_iocp_wait_op.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class win_iocp_socket_service_base -{ -public: - // The implementation type of the socket. - struct base_implementation_type - { - // The native socket representation. - socket_type socket_; - - // The current state of the socket. - socket_ops::state_type state_; - - // We use a shared pointer as a cancellation token here to work around the - // broken Windows support for cancellation. MSDN says that when you call - // closesocket any outstanding WSARecv or WSASend operations will complete - // with the error ERROR_OPERATION_ABORTED. In practice they complete with - // ERROR_NETNAME_DELETED, which means you can't tell the difference between - // a local cancellation and the socket being hard-closed by the peer. - socket_ops::shared_cancel_token_type cancel_token_; - - // Per-descriptor data used by the reactor. - select_reactor::per_descriptor_data reactor_data_; - -#if defined(ASIO_ENABLE_CANCELIO) - // The ID of the thread from which it is safe to cancel asynchronous - // operations. 0 means no asynchronous operations have been started yet. - // ~0 means asynchronous operations have been started from more than one - // thread, and cancellation is not supported for the socket. - DWORD safe_cancellation_thread_id_; -#endif // defined(ASIO_ENABLE_CANCELIO) - - // Pointers to adjacent socket implementations in linked list. - base_implementation_type* next_; - base_implementation_type* prev_; - }; - - // Constructor. - ASIO_DECL win_iocp_socket_service_base( - asio::io_context& io_context); - - // Destroy all user-defined handler objects owned by the service. - ASIO_DECL void base_shutdown(); - - // Construct a new socket implementation. - ASIO_DECL void construct(base_implementation_type& impl); - - // Move-construct a new socket implementation. - ASIO_DECL void base_move_construct(base_implementation_type& impl, - base_implementation_type& other_impl); - - // Move-assign from another socket implementation. - ASIO_DECL void base_move_assign(base_implementation_type& impl, - win_iocp_socket_service_base& other_service, - base_implementation_type& other_impl); - - // Destroy a socket implementation. - ASIO_DECL void destroy(base_implementation_type& impl); - - // Determine whether the socket is open. - bool is_open(const base_implementation_type& impl) const - { - return impl.socket_ != invalid_socket; - } - - // Destroy a socket implementation. - ASIO_DECL asio::error_code close( - base_implementation_type& impl, asio::error_code& ec); - - // Release ownership of the socket. - ASIO_DECL socket_type release( - base_implementation_type& impl, asio::error_code& ec); - - // Cancel all operations associated with the socket. - ASIO_DECL asio::error_code cancel( - base_implementation_type& impl, asio::error_code& ec); - - // Determine whether the socket is at the out-of-band data mark. - bool at_mark(const base_implementation_type& impl, - asio::error_code& ec) const - { - return socket_ops::sockatmark(impl.socket_, ec); - } - - // Determine the number of bytes available for reading. - std::size_t available(const base_implementation_type& impl, - asio::error_code& ec) const - { - return socket_ops::available(impl.socket_, ec); - } - - // Place the socket into the state where it will listen for new connections. - asio::error_code listen(base_implementation_type& impl, - int backlog, asio::error_code& ec) - { - socket_ops::listen(impl.socket_, backlog, ec); - return ec; - } - - // Perform an IO control command on the socket. - template - asio::error_code io_control(base_implementation_type& impl, - IO_Control_Command& command, asio::error_code& ec) - { - socket_ops::ioctl(impl.socket_, impl.state_, command.name(), - static_cast(command.data()), ec); - return ec; - } - - // Gets the non-blocking mode of the socket. - bool non_blocking(const base_implementation_type& impl) const - { - return (impl.state_ & socket_ops::user_set_non_blocking) != 0; - } - - // Sets the non-blocking mode of the socket. - asio::error_code non_blocking(base_implementation_type& impl, - bool mode, asio::error_code& ec) - { - socket_ops::set_user_non_blocking(impl.socket_, impl.state_, mode, ec); - return ec; - } - - // Gets the non-blocking mode of the native socket implementation. - bool native_non_blocking(const base_implementation_type& impl) const - { - return (impl.state_ & socket_ops::internal_non_blocking) != 0; - } - - // Sets the non-blocking mode of the native socket implementation. - asio::error_code native_non_blocking(base_implementation_type& impl, - bool mode, asio::error_code& ec) - { - socket_ops::set_internal_non_blocking(impl.socket_, impl.state_, mode, ec); - return ec; - } - - // Wait for the socket to become ready to read, ready to write, or to have - // pending error conditions. - asio::error_code wait(base_implementation_type& impl, - socket_base::wait_type w, asio::error_code& ec) - { - switch (w) - { - case socket_base::wait_read: - socket_ops::poll_read(impl.socket_, impl.state_, -1, ec); - break; - case socket_base::wait_write: - socket_ops::poll_write(impl.socket_, impl.state_, -1, ec); - break; - case socket_base::wait_error: - socket_ops::poll_error(impl.socket_, impl.state_, -1, ec); - break; - default: - ec = asio::error::invalid_argument; - break; - } - - return ec; - } - - // Asynchronously wait for the socket to become ready to read, ready to - // write, or to have pending error conditions. - template - void async_wait(base_implementation_type& impl, - socket_base::wait_type w, Handler& handler) - { - bool is_continuation = - asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef win_iocp_wait_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(impl.cancel_token_, handler); - - ASIO_HANDLER_CREATION((io_context_, *p.p, "socket", - &impl, impl.socket_, "async_wait")); - - switch (w) - { - case socket_base::wait_read: - start_null_buffers_receive_op(impl, 0, p.p); - break; - case socket_base::wait_write: - start_reactor_op(impl, select_reactor::write_op, p.p); - break; - case socket_base::wait_error: - start_reactor_op(impl, select_reactor::except_op, p.p); - break; - default: - p.p->ec_ = asio::error::invalid_argument; - iocp_service_.post_immediate_completion(p.p, is_continuation); - break; - } - - p.v = p.p = 0; - } - - // Send the given data to the peer. Returns the number of bytes sent. - template - size_t send(base_implementation_type& impl, - const ConstBufferSequence& buffers, - socket_base::message_flags flags, asio::error_code& ec) - { - buffer_sequence_adapter bufs(buffers); - - return socket_ops::sync_send(impl.socket_, impl.state_, - bufs.buffers(), bufs.count(), flags, bufs.all_empty(), ec); - } - - // Wait until data can be sent without blocking. - size_t send(base_implementation_type& impl, const null_buffers&, - socket_base::message_flags, asio::error_code& ec) - { - // Wait for socket to become ready. - socket_ops::poll_write(impl.socket_, impl.state_, -1, ec); - - return 0; - } - - // Start an asynchronous send. The data being sent must be valid for the - // lifetime of the asynchronous operation. - template - void async_send(base_implementation_type& impl, - const ConstBufferSequence& buffers, - socket_base::message_flags flags, Handler& handler) - { - // Allocate and construct an operation to wrap the handler. - typedef win_iocp_socket_send_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(impl.cancel_token_, buffers, handler); - - ASIO_HANDLER_CREATION((io_context_, *p.p, "socket", - &impl, impl.socket_, "async_send")); - - buffer_sequence_adapter bufs(buffers); - - start_send_op(impl, bufs.buffers(), bufs.count(), flags, - (impl.state_ & socket_ops::stream_oriented) != 0 && bufs.all_empty(), - p.p); - p.v = p.p = 0; - } - - // Start an asynchronous wait until data can be sent without blocking. - template - void async_send(base_implementation_type& impl, const null_buffers&, - socket_base::message_flags, Handler& handler) - { - // Allocate and construct an operation to wrap the handler. - typedef win_iocp_null_buffers_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(impl.cancel_token_, handler); - - ASIO_HANDLER_CREATION((io_context_, *p.p, "socket", - &impl, impl.socket_, "async_send(null_buffers)")); - - start_reactor_op(impl, select_reactor::write_op, p.p); - p.v = p.p = 0; - } - - // Receive some data from the peer. Returns the number of bytes received. - template - size_t receive(base_implementation_type& impl, - const MutableBufferSequence& buffers, - socket_base::message_flags flags, asio::error_code& ec) - { - buffer_sequence_adapter bufs(buffers); - - return socket_ops::sync_recv(impl.socket_, impl.state_, - bufs.buffers(), bufs.count(), flags, bufs.all_empty(), ec); - } - - // Wait until data can be received without blocking. - size_t receive(base_implementation_type& impl, const null_buffers&, - socket_base::message_flags, asio::error_code& ec) - { - // Wait for socket to become ready. - socket_ops::poll_read(impl.socket_, impl.state_, -1, ec); - - return 0; - } - - // Start an asynchronous receive. The buffer for the data being received - // must be valid for the lifetime of the asynchronous operation. - template - void async_receive(base_implementation_type& impl, - const MutableBufferSequence& buffers, - socket_base::message_flags flags, Handler& handler) - { - // Allocate and construct an operation to wrap the handler. - typedef win_iocp_socket_recv_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(impl.state_, impl.cancel_token_, buffers, handler); - - ASIO_HANDLER_CREATION((io_context_, *p.p, "socket", - &impl, impl.socket_, "async_receive")); - - buffer_sequence_adapter bufs(buffers); - - start_receive_op(impl, bufs.buffers(), bufs.count(), flags, - (impl.state_ & socket_ops::stream_oriented) != 0 && bufs.all_empty(), - p.p); - p.v = p.p = 0; - } - - // Wait until data can be received without blocking. - template - void async_receive(base_implementation_type& impl, const null_buffers&, - socket_base::message_flags flags, Handler& handler) - { - // Allocate and construct an operation to wrap the handler. - typedef win_iocp_null_buffers_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(impl.cancel_token_, handler); - - ASIO_HANDLER_CREATION((io_context_, *p.p, "socket", - &impl, impl.socket_, "async_receive(null_buffers)")); - - start_null_buffers_receive_op(impl, flags, p.p); - p.v = p.p = 0; - } - - // Receive some data with associated flags. Returns the number of bytes - // received. - template - size_t receive_with_flags(base_implementation_type& impl, - const MutableBufferSequence& buffers, - socket_base::message_flags in_flags, - socket_base::message_flags& out_flags, asio::error_code& ec) - { - buffer_sequence_adapter bufs(buffers); - - return socket_ops::sync_recvmsg(impl.socket_, impl.state_, - bufs.buffers(), bufs.count(), in_flags, out_flags, ec); - } - - // Wait until data can be received without blocking. - size_t receive_with_flags(base_implementation_type& impl, - const null_buffers&, socket_base::message_flags, - socket_base::message_flags& out_flags, asio::error_code& ec) - { - // Wait for socket to become ready. - socket_ops::poll_read(impl.socket_, impl.state_, -1, ec); - - // Clear out_flags, since we cannot give it any other sensible value when - // performing a null_buffers operation. - out_flags = 0; - - return 0; - } - - // Start an asynchronous receive. The buffer for the data being received - // must be valid for the lifetime of the asynchronous operation. - template - void async_receive_with_flags(base_implementation_type& impl, - const MutableBufferSequence& buffers, socket_base::message_flags in_flags, - socket_base::message_flags& out_flags, Handler& handler) - { - // Allocate and construct an operation to wrap the handler. - typedef win_iocp_socket_recvmsg_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(impl.cancel_token_, buffers, out_flags, handler); - - ASIO_HANDLER_CREATION((io_context_, *p.p, "socket", - &impl, impl.socket_, "async_receive_with_flags")); - - buffer_sequence_adapter bufs(buffers); - - start_receive_op(impl, bufs.buffers(), bufs.count(), in_flags, false, p.p); - p.v = p.p = 0; - } - - // Wait until data can be received without blocking. - template - void async_receive_with_flags(base_implementation_type& impl, - const null_buffers&, socket_base::message_flags in_flags, - socket_base::message_flags& out_flags, Handler& handler) - { - // Allocate and construct an operation to wrap the handler. - typedef win_iocp_null_buffers_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(impl.cancel_token_, handler); - - ASIO_HANDLER_CREATION((io_context_, *p.p, "socket", - &impl, impl.socket_, "async_receive_with_flags(null_buffers)")); - - // Reset out_flags since it can be given no sensible value at this time. - out_flags = 0; - - start_null_buffers_receive_op(impl, in_flags, p.p); - p.v = p.p = 0; - } - - // Helper function to restart an asynchronous accept operation. - ASIO_DECL void restart_accept_op(socket_type s, - socket_holder& new_socket, int family, int type, int protocol, - void* output_buffer, DWORD address_length, operation* op); - -protected: - // Open a new socket implementation. - ASIO_DECL asio::error_code do_open( - base_implementation_type& impl, int family, int type, - int protocol, asio::error_code& ec); - - // Assign a native socket to a socket implementation. - ASIO_DECL asio::error_code do_assign( - base_implementation_type& impl, int type, - socket_type native_socket, asio::error_code& ec); - - // Helper function to start an asynchronous send operation. - ASIO_DECL void start_send_op(base_implementation_type& impl, - WSABUF* buffers, std::size_t buffer_count, - socket_base::message_flags flags, bool noop, operation* op); - - // Helper function to start an asynchronous send_to operation. - ASIO_DECL void start_send_to_op(base_implementation_type& impl, - WSABUF* buffers, std::size_t buffer_count, - const socket_addr_type* addr, int addrlen, - socket_base::message_flags flags, operation* op); - - // Helper function to start an asynchronous receive operation. - ASIO_DECL void start_receive_op(base_implementation_type& impl, - WSABUF* buffers, std::size_t buffer_count, - socket_base::message_flags flags, bool noop, operation* op); - - // Helper function to start an asynchronous null_buffers receive operation. - ASIO_DECL void start_null_buffers_receive_op( - base_implementation_type& impl, - socket_base::message_flags flags, reactor_op* op); - - // Helper function to start an asynchronous receive_from operation. - ASIO_DECL void start_receive_from_op(base_implementation_type& impl, - WSABUF* buffers, std::size_t buffer_count, socket_addr_type* addr, - socket_base::message_flags flags, int* addrlen, operation* op); - - // Helper function to start an asynchronous accept operation. - ASIO_DECL void start_accept_op(base_implementation_type& impl, - bool peer_is_open, socket_holder& new_socket, int family, int type, - int protocol, void* output_buffer, DWORD address_length, operation* op); - - // Start an asynchronous read or write operation using the reactor. - ASIO_DECL void start_reactor_op(base_implementation_type& impl, - int op_type, reactor_op* op); - - // Start the asynchronous connect operation using the reactor. - ASIO_DECL void start_connect_op(base_implementation_type& impl, - int family, int type, const socket_addr_type* remote_addr, - std::size_t remote_addrlen, win_iocp_socket_connect_op_base* op); - - // Helper function to close a socket when the associated object is being - // destroyed. - ASIO_DECL void close_for_destruction(base_implementation_type& impl); - - // Update the ID of the thread from which cancellation is safe. - ASIO_DECL void update_cancellation_thread_id( - base_implementation_type& impl); - - // Helper function to get the reactor. If no reactor has been created yet, a - // new one is obtained from the io_context and a pointer to it is cached in - // this service. - ASIO_DECL select_reactor& get_reactor(); - - // The type of a ConnectEx function pointer, as old SDKs may not provide it. - typedef BOOL (PASCAL *connect_ex_fn)(SOCKET, - const socket_addr_type*, int, void*, DWORD, DWORD*, OVERLAPPED*); - - // Helper function to get the ConnectEx pointer. If no ConnectEx pointer has - // been obtained yet, one is obtained using WSAIoctl and the pointer is - // cached. Returns a null pointer if ConnectEx is not available. - ASIO_DECL connect_ex_fn get_connect_ex( - base_implementation_type& impl, int type); - - // The type of a NtSetInformationFile function pointer. - typedef LONG (NTAPI *nt_set_info_fn)(HANDLE, ULONG_PTR*, void*, ULONG, ULONG); - - // Helper function to get the NtSetInformationFile function pointer. If no - // NtSetInformationFile pointer has been obtained yet, one is obtained using - // GetProcAddress and the pointer is cached. Returns a null pointer if - // NtSetInformationFile is not available. - ASIO_DECL nt_set_info_fn get_nt_set_info(); - - // Helper function to emulate InterlockedCompareExchangePointer functionality - // for: - // - very old Platform SDKs; and - // - platform SDKs where MSVC's /Wp64 option causes spurious warnings. - ASIO_DECL void* interlocked_compare_exchange_pointer( - void** dest, void* exch, void* cmp); - - // Helper function to emulate InterlockedExchangePointer functionality for: - // - very old Platform SDKs; and - // - platform SDKs where MSVC's /Wp64 option causes spurious warnings. - ASIO_DECL void* interlocked_exchange_pointer(void** dest, void* val); - - // The io_context used to obtain the reactor, if required. - asio::io_context& io_context_; - - // The IOCP service used for running asynchronous operations and dispatching - // handlers. - win_iocp_io_context& iocp_service_; - - // The reactor used for performing connect operations. This object is created - // only if needed. - select_reactor* reactor_; - - // Pointer to ConnectEx implementation. - void* connect_ex_; - - // Pointer to NtSetInformationFile implementation. - void* nt_set_info_; - - // Mutex to protect access to the linked list of implementations. - asio::detail::mutex mutex_; - - // The head of a linked list of all implementations. - base_implementation_type* impl_list_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/win_iocp_socket_service_base.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_HAS_IOCP) - -#endif // ASIO_DETAIL_WIN_IOCP_SOCKET_SERVICE_BASE_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_iocp_thread_info.hpp b/tools/sdk/include/asio/asio/detail/win_iocp_thread_info.hpp deleted file mode 100644 index 13181e2ec6d..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_iocp_thread_info.hpp +++ /dev/null @@ -1,34 +0,0 @@ -// -// detail/win_iocp_thread_info.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_IOCP_THREAD_INFO_HPP -#define ASIO_DETAIL_WIN_IOCP_THREAD_INFO_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/thread_info_base.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -struct win_iocp_thread_info : public thread_info_base -{ -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_WIN_IOCP_THREAD_INFO_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_iocp_wait_op.hpp b/tools/sdk/include/asio/asio/detail/win_iocp_wait_op.hpp deleted file mode 100644 index 472eea38a32..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_iocp_wait_op.hpp +++ /dev/null @@ -1,121 +0,0 @@ -// -// detail/win_iocp_wait_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_IOCP_WAIT_OP_HPP -#define ASIO_DETAIL_WIN_IOCP_WAIT_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_IOCP) - -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/reactor_op.hpp" -#include "asio/detail/socket_ops.hpp" -#include "asio/error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class win_iocp_wait_op : public reactor_op -{ -public: - ASIO_DEFINE_HANDLER_PTR(win_iocp_wait_op); - - win_iocp_wait_op(socket_ops::weak_cancel_token_type cancel_token, - Handler& handler) - : reactor_op(&win_iocp_wait_op::do_perform, - &win_iocp_wait_op::do_complete), - cancel_token_(cancel_token), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static status do_perform(reactor_op*) - { - return done; - } - - static void do_complete(void* owner, operation* base, - const asio::error_code& result_ec, - std::size_t /*bytes_transferred*/) - { - asio::error_code ec(result_ec); - - // Take ownership of the operation object. - win_iocp_wait_op* o(static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - ASIO_HANDLER_COMPLETION((*o)); - - // The reactor may have stored a result in the operation object. - if (o->ec_) - ec = o->ec_; - - // Map non-portable errors to their portable counterparts. - if (ec.value() == ERROR_NETNAME_DELETED) - { - if (o->cancel_token_.expired()) - ec = asio::error::operation_aborted; - else - ec = asio::error::connection_reset; - } - else if (ec.value() == ERROR_PORT_UNREACHABLE) - { - ec = asio::error::connection_refused; - } - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder1 - handler(o->handler_, ec); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - socket_ops::weak_cancel_token_type cancel_token_; - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_IOCP) - -#endif // ASIO_DETAIL_WIN_IOCP_WAIT_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_mutex.hpp b/tools/sdk/include/asio/asio/detail/win_mutex.hpp deleted file mode 100644 index ce52a2f7968..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_mutex.hpp +++ /dev/null @@ -1,78 +0,0 @@ -// -// detail/win_mutex.hpp -// ~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_MUTEX_HPP -#define ASIO_DETAIL_WIN_MUTEX_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_WINDOWS) - -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/scoped_lock.hpp" -#include "asio/detail/socket_types.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class win_mutex - : private noncopyable -{ -public: - typedef asio::detail::scoped_lock scoped_lock; - - // Constructor. - ASIO_DECL win_mutex(); - - // Destructor. - ~win_mutex() - { - ::DeleteCriticalSection(&crit_section_); - } - - // Lock the mutex. - void lock() - { - ::EnterCriticalSection(&crit_section_); - } - - // Unlock the mutex. - void unlock() - { - ::LeaveCriticalSection(&crit_section_); - } - -private: - // Initialisation must be performed in a separate function to the constructor - // since the compiler does not support the use of structured exceptions and - // C++ exceptions in the same function. - ASIO_DECL int do_init(); - - ::CRITICAL_SECTION crit_section_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/win_mutex.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_WINDOWS) - -#endif // ASIO_DETAIL_WIN_MUTEX_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_object_handle_service.hpp b/tools/sdk/include/asio/asio/detail/win_object_handle_service.hpp deleted file mode 100644 index 1d8abc9c74a..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_object_handle_service.hpp +++ /dev/null @@ -1,184 +0,0 @@ -// -// detail/win_object_handle_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2011 Boris Schaeling (boris@highscore.de) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_OBJECT_HANDLE_SERVICE_HPP -#define ASIO_DETAIL_WIN_OBJECT_HANDLE_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) - -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/wait_handler.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class win_object_handle_service : - public service_base -{ -public: - // The native type of an object handle. - typedef HANDLE native_handle_type; - - // The implementation type of the object handle. - class implementation_type - { - public: - // Default constructor. - implementation_type() - : handle_(INVALID_HANDLE_VALUE), - wait_handle_(INVALID_HANDLE_VALUE), - owner_(0), - next_(0), - prev_(0) - { - } - - private: - // Only this service will have access to the internal values. - friend class win_object_handle_service; - - // The native object handle representation. May be accessed or modified - // without locking the mutex. - native_handle_type handle_; - - // The handle used to unregister the wait operation. The mutex must be - // locked when accessing or modifying this member. - HANDLE wait_handle_; - - // The operations waiting on the object handle. If there is a registered - // wait then the mutex must be locked when accessing or modifying this - // member - op_queue op_queue_; - - // The service instance that owns the object handle implementation. - win_object_handle_service* owner_; - - // Pointers to adjacent handle implementations in linked list. The mutex - // must be locked when accessing or modifying these members. - implementation_type* next_; - implementation_type* prev_; - }; - - // Constructor. - ASIO_DECL win_object_handle_service( - asio::io_context& io_context); - - // Destroy all user-defined handler objects owned by the service. - ASIO_DECL void shutdown(); - - // Construct a new handle implementation. - ASIO_DECL void construct(implementation_type& impl); - - // Move-construct a new handle implementation. - ASIO_DECL void move_construct(implementation_type& impl, - implementation_type& other_impl); - - // Move-assign from another handle implementation. - ASIO_DECL void move_assign(implementation_type& impl, - win_object_handle_service& other_service, - implementation_type& other_impl); - - // Destroy a handle implementation. - ASIO_DECL void destroy(implementation_type& impl); - - // Assign a native handle to a handle implementation. - ASIO_DECL asio::error_code assign(implementation_type& impl, - const native_handle_type& handle, asio::error_code& ec); - - // Determine whether the handle is open. - bool is_open(const implementation_type& impl) const - { - return impl.handle_ != INVALID_HANDLE_VALUE && impl.handle_ != 0; - } - - // Destroy a handle implementation. - ASIO_DECL asio::error_code close(implementation_type& impl, - asio::error_code& ec); - - // Get the native handle representation. - native_handle_type native_handle(const implementation_type& impl) const - { - return impl.handle_; - } - - // Cancel all operations associated with the handle. - ASIO_DECL asio::error_code cancel(implementation_type& impl, - asio::error_code& ec); - - // Perform a synchronous wait for the object to enter a signalled state. - ASIO_DECL void wait(implementation_type& impl, - asio::error_code& ec); - - /// Start an asynchronous wait. - template - void async_wait(implementation_type& impl, Handler& handler) - { - // Allocate and construct an operation to wrap the handler. - typedef wait_handler op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(handler); - - ASIO_HANDLER_CREATION((io_context_.context(), *p.p, "object_handle", - &impl, reinterpret_cast(impl.wait_handle_), "async_wait")); - - start_wait_op(impl, p.p); - p.v = p.p = 0; - } - -private: - // Helper function to start an asynchronous wait operation. - ASIO_DECL void start_wait_op(implementation_type& impl, wait_op* op); - - // Helper function to register a wait operation. - ASIO_DECL void register_wait_callback( - implementation_type& impl, mutex::scoped_lock& lock); - - // Callback function invoked when the registered wait completes. - static ASIO_DECL VOID CALLBACK wait_callback( - PVOID param, BOOLEAN timeout); - - // The io_context implementation used to post completions. - io_context_impl& io_context_; - - // Mutex to protect access to internal state. - mutex mutex_; - - // The head of a linked list of all implementations. - implementation_type* impl_list_; - - // Flag to indicate that the dispatcher has been shut down. - bool shutdown_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/win_object_handle_service.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) - -#endif // ASIO_DETAIL_WIN_OBJECT_HANDLE_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_static_mutex.hpp b/tools/sdk/include/asio/asio/detail/win_static_mutex.hpp deleted file mode 100644 index b16968862cc..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_static_mutex.hpp +++ /dev/null @@ -1,74 +0,0 @@ -// -// detail/win_static_mutex.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_STATIC_MUTEX_HPP -#define ASIO_DETAIL_WIN_STATIC_MUTEX_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_WINDOWS) - -#include "asio/detail/scoped_lock.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -struct win_static_mutex -{ - typedef asio::detail::scoped_lock scoped_lock; - - // Initialise the mutex. - ASIO_DECL void init(); - - // Initialisation must be performed in a separate function to the "public" - // init() function since the compiler does not support the use of structured - // exceptions and C++ exceptions in the same function. - ASIO_DECL int do_init(); - - // Lock the mutex. - void lock() - { - ::EnterCriticalSection(&crit_section_); - } - - // Unlock the mutex. - void unlock() - { - ::LeaveCriticalSection(&crit_section_); - } - - bool initialised_; - ::CRITICAL_SECTION crit_section_; -}; - -#if defined(UNDER_CE) -# define ASIO_WIN_STATIC_MUTEX_INIT { false, { 0, 0, 0, 0, 0 } } -#else // defined(UNDER_CE) -# define ASIO_WIN_STATIC_MUTEX_INIT { false, { 0, 0, 0, 0, 0, 0 } } -#endif // defined(UNDER_CE) - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/win_static_mutex.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_WINDOWS) - -#endif // ASIO_DETAIL_WIN_STATIC_MUTEX_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_thread.hpp b/tools/sdk/include/asio/asio/detail/win_thread.hpp deleted file mode 100644 index 8b28a90b679..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_thread.hpp +++ /dev/null @@ -1,147 +0,0 @@ -// -// detail/win_thread.hpp -// ~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_THREAD_HPP -#define ASIO_DETAIL_WIN_THREAD_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_WINDOWS) \ - && !defined(ASIO_WINDOWS_APP) \ - && !defined(UNDER_CE) - -#include -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/socket_types.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -ASIO_DECL unsigned int __stdcall win_thread_function(void* arg); - -#if defined(WINVER) && (WINVER < 0x0500) -ASIO_DECL void __stdcall apc_function(ULONG data); -#else -ASIO_DECL void __stdcall apc_function(ULONG_PTR data); -#endif - -template -class win_thread_base -{ -public: - static bool terminate_threads() - { - return ::InterlockedExchangeAdd(&terminate_threads_, 0) != 0; - } - - static void set_terminate_threads(bool b) - { - ::InterlockedExchange(&terminate_threads_, b ? 1 : 0); - } - -private: - static long terminate_threads_; -}; - -template -long win_thread_base::terminate_threads_ = 0; - -class win_thread - : private noncopyable, - public win_thread_base -{ -public: - // Constructor. - template - win_thread(Function f, unsigned int stack_size = 0) - : thread_(0), - exit_event_(0) - { - start_thread(new func(f), stack_size); - } - - // Destructor. - ASIO_DECL ~win_thread(); - - // Wait for the thread to exit. - ASIO_DECL void join(); - - // Get number of CPUs. - ASIO_DECL static std::size_t hardware_concurrency(); - -private: - friend ASIO_DECL unsigned int __stdcall win_thread_function(void* arg); - -#if defined(WINVER) && (WINVER < 0x0500) - friend ASIO_DECL void __stdcall apc_function(ULONG); -#else - friend ASIO_DECL void __stdcall apc_function(ULONG_PTR); -#endif - - class func_base - { - public: - virtual ~func_base() {} - virtual void run() = 0; - ::HANDLE entry_event_; - ::HANDLE exit_event_; - }; - - struct auto_func_base_ptr - { - func_base* ptr; - ~auto_func_base_ptr() { delete ptr; } - }; - - template - class func - : public func_base - { - public: - func(Function f) - : f_(f) - { - } - - virtual void run() - { - f_(); - } - - private: - Function f_; - }; - - ASIO_DECL void start_thread(func_base* arg, unsigned int stack_size); - - ::HANDLE thread_; - ::HANDLE exit_event_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/win_thread.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_WINDOWS) - // && !defined(ASIO_WINDOWS_APP) - // && !defined(UNDER_CE) - -#endif // ASIO_DETAIL_WIN_THREAD_HPP diff --git a/tools/sdk/include/asio/asio/detail/win_tss_ptr.hpp b/tools/sdk/include/asio/asio/detail/win_tss_ptr.hpp deleted file mode 100644 index 4207108a30e..00000000000 --- a/tools/sdk/include/asio/asio/detail/win_tss_ptr.hpp +++ /dev/null @@ -1,79 +0,0 @@ -// -// detail/win_tss_ptr.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WIN_TSS_PTR_HPP -#define ASIO_DETAIL_WIN_TSS_PTR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_WINDOWS) - -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/socket_types.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -// Helper function to create thread-specific storage. -ASIO_DECL DWORD win_tss_ptr_create(); - -template -class win_tss_ptr - : private noncopyable -{ -public: - // Constructor. - win_tss_ptr() - : tss_key_(win_tss_ptr_create()) - { - } - - // Destructor. - ~win_tss_ptr() - { - ::TlsFree(tss_key_); - } - - // Get the value. - operator T*() const - { - return static_cast(::TlsGetValue(tss_key_)); - } - - // Set the value. - void operator=(T* value) - { - ::TlsSetValue(tss_key_, value); - } - -private: - // Thread-specific storage to allow unlocked access to determine whether a - // thread is a member of the pool. - DWORD tss_key_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/win_tss_ptr.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_WINDOWS) - -#endif // ASIO_DETAIL_WIN_TSS_PTR_HPP diff --git a/tools/sdk/include/asio/asio/detail/winapp_thread.hpp b/tools/sdk/include/asio/asio/detail/winapp_thread.hpp deleted file mode 100644 index 69dcf08d4e1..00000000000 --- a/tools/sdk/include/asio/asio/detail/winapp_thread.hpp +++ /dev/null @@ -1,124 +0,0 @@ -// -// detail/winapp_thread.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WINAPP_THREAD_HPP -#define ASIO_DETAIL_WINAPP_THREAD_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_WINDOWS) && defined(ASIO_WINDOWS_APP) - -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/scoped_ptr.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -DWORD WINAPI winapp_thread_function(LPVOID arg); - -class winapp_thread - : private noncopyable -{ -public: - // Constructor. - template - winapp_thread(Function f, unsigned int = 0) - { - scoped_ptr arg(new func(f)); - DWORD thread_id = 0; - thread_ = ::CreateThread(0, 0, winapp_thread_function, - arg.get(), 0, &thread_id); - if (!thread_) - { - DWORD last_error = ::GetLastError(); - asio::error_code ec(last_error, - asio::error::get_system_category()); - asio::detail::throw_error(ec, "thread"); - } - arg.release(); - } - - // Destructor. - ~winapp_thread() - { - ::CloseHandle(thread_); - } - - // Wait for the thread to exit. - void join() - { - ::WaitForSingleObjectEx(thread_, INFINITE, false); - } - - // Get number of CPUs. - static std::size_t hardware_concurrency() - { - SYSTEM_INFO system_info; - ::GetNativeSystemInfo(&system_info); - return system_info.dwNumberOfProcessors; - } - -private: - friend DWORD WINAPI winapp_thread_function(LPVOID arg); - - class func_base - { - public: - virtual ~func_base() {} - virtual void run() = 0; - }; - - template - class func - : public func_base - { - public: - func(Function f) - : f_(f) - { - } - - virtual void run() - { - f_(); - } - - private: - Function f_; - }; - - ::HANDLE thread_; -}; - -inline DWORD WINAPI winapp_thread_function(LPVOID arg) -{ - scoped_ptr func( - static_cast(arg)); - func->run(); - return 0; -} - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_WINDOWS) && defined(ASIO_WINDOWS_APP) - -#endif // ASIO_DETAIL_WINAPP_THREAD_HPP diff --git a/tools/sdk/include/asio/asio/detail/wince_thread.hpp b/tools/sdk/include/asio/asio/detail/wince_thread.hpp deleted file mode 100644 index a2863f625da..00000000000 --- a/tools/sdk/include/asio/asio/detail/wince_thread.hpp +++ /dev/null @@ -1,124 +0,0 @@ -// -// detail/wince_thread.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WINCE_THREAD_HPP -#define ASIO_DETAIL_WINCE_THREAD_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_WINDOWS) && defined(UNDER_CE) - -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/scoped_ptr.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -DWORD WINAPI wince_thread_function(LPVOID arg); - -class wince_thread - : private noncopyable -{ -public: - // Constructor. - template - wince_thread(Function f, unsigned int = 0) - { - scoped_ptr arg(new func(f)); - DWORD thread_id = 0; - thread_ = ::CreateThread(0, 0, wince_thread_function, - arg.get(), 0, &thread_id); - if (!thread_) - { - DWORD last_error = ::GetLastError(); - asio::error_code ec(last_error, - asio::error::get_system_category()); - asio::detail::throw_error(ec, "thread"); - } - arg.release(); - } - - // Destructor. - ~wince_thread() - { - ::CloseHandle(thread_); - } - - // Wait for the thread to exit. - void join() - { - ::WaitForSingleObject(thread_, INFINITE); - } - - // Get number of CPUs. - static std::size_t hardware_concurrency() - { - SYSTEM_INFO system_info; - ::GetSystemInfo(&system_info); - return system_info.dwNumberOfProcessors; - } - -private: - friend DWORD WINAPI wince_thread_function(LPVOID arg); - - class func_base - { - public: - virtual ~func_base() {} - virtual void run() = 0; - }; - - template - class func - : public func_base - { - public: - func(Function f) - : f_(f) - { - } - - virtual void run() - { - f_(); - } - - private: - Function f_; - }; - - ::HANDLE thread_; -}; - -inline DWORD WINAPI wince_thread_function(LPVOID arg) -{ - scoped_ptr func( - static_cast(arg)); - func->run(); - return 0; -} - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_WINDOWS) && defined(UNDER_CE) - -#endif // ASIO_DETAIL_WINCE_THREAD_HPP diff --git a/tools/sdk/include/asio/asio/detail/winrt_async_manager.hpp b/tools/sdk/include/asio/asio/detail/winrt_async_manager.hpp deleted file mode 100644 index e22ad52e2e7..00000000000 --- a/tools/sdk/include/asio/asio/detail/winrt_async_manager.hpp +++ /dev/null @@ -1,294 +0,0 @@ -// -// detail/winrt_async_manager.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WINRT_ASYNC_MANAGER_HPP -#define ASIO_DETAIL_WINRT_ASYNC_MANAGER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_WINDOWS_RUNTIME) - -#include -#include "asio/detail/atomic_count.hpp" -#include "asio/detail/winrt_async_op.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class winrt_async_manager - : public asio::detail::service_base -{ -public: - // Constructor. - winrt_async_manager(asio::io_context& io_context) - : asio::detail::service_base(io_context), - io_context_(use_service(io_context)), - outstanding_ops_(1) - { - } - - // Destructor. - ~winrt_async_manager() - { - } - - // Destroy all user-defined handler objects owned by the service. - void shutdown() - { - if (--outstanding_ops_ > 0) - { - // Block until last operation is complete. - std::future f = promise_.get_future(); - f.wait(); - } - } - - void sync(Windows::Foundation::IAsyncAction^ action, - asio::error_code& ec) - { - using namespace Windows::Foundation; - using Windows::Foundation::AsyncStatus; - - auto promise = std::make_shared>(); - auto future = promise->get_future(); - - action->Completed = ref new AsyncActionCompletedHandler( - [promise](IAsyncAction^ action, AsyncStatus status) - { - switch (status) - { - case AsyncStatus::Canceled: - promise->set_value(asio::error::operation_aborted); - break; - case AsyncStatus::Error: - case AsyncStatus::Completed: - default: - asio::error_code ec( - action->ErrorCode.Value, - asio::system_category()); - promise->set_value(ec); - break; - } - }); - - ec = future.get(); - } - - template - TResult sync(Windows::Foundation::IAsyncOperation^ operation, - asio::error_code& ec) - { - using namespace Windows::Foundation; - using Windows::Foundation::AsyncStatus; - - auto promise = std::make_shared>(); - auto future = promise->get_future(); - - operation->Completed = ref new AsyncOperationCompletedHandler( - [promise](IAsyncOperation^ operation, AsyncStatus status) - { - switch (status) - { - case AsyncStatus::Canceled: - promise->set_value(asio::error::operation_aborted); - break; - case AsyncStatus::Error: - case AsyncStatus::Completed: - default: - asio::error_code ec( - operation->ErrorCode.Value, - asio::system_category()); - promise->set_value(ec); - break; - } - }); - - ec = future.get(); - return operation->GetResults(); - } - - template - TResult sync( - Windows::Foundation::IAsyncOperationWithProgress< - TResult, TProgress>^ operation, - asio::error_code& ec) - { - using namespace Windows::Foundation; - using Windows::Foundation::AsyncStatus; - - auto promise = std::make_shared>(); - auto future = promise->get_future(); - - operation->Completed - = ref new AsyncOperationWithProgressCompletedHandler( - [promise](IAsyncOperationWithProgress^ operation, - AsyncStatus status) - { - switch (status) - { - case AsyncStatus::Canceled: - promise->set_value(asio::error::operation_aborted); - break; - case AsyncStatus::Started: - break; - case AsyncStatus::Error: - case AsyncStatus::Completed: - default: - asio::error_code ec( - operation->ErrorCode.Value, - asio::system_category()); - promise->set_value(ec); - break; - } - }); - - ec = future.get(); - return operation->GetResults(); - } - - void async(Windows::Foundation::IAsyncAction^ action, - winrt_async_op* handler) - { - using namespace Windows::Foundation; - using Windows::Foundation::AsyncStatus; - - auto on_completed = ref new AsyncActionCompletedHandler( - [this, handler](IAsyncAction^ action, AsyncStatus status) - { - switch (status) - { - case AsyncStatus::Canceled: - handler->ec_ = asio::error::operation_aborted; - break; - case AsyncStatus::Started: - return; - case AsyncStatus::Completed: - case AsyncStatus::Error: - default: - handler->ec_ = asio::error_code( - action->ErrorCode.Value, - asio::system_category()); - break; - } - io_context_.post_deferred_completion(handler); - if (--outstanding_ops_ == 0) - promise_.set_value(); - }); - - io_context_.work_started(); - ++outstanding_ops_; - action->Completed = on_completed; - } - - template - void async(Windows::Foundation::IAsyncOperation^ operation, - winrt_async_op* handler) - { - using namespace Windows::Foundation; - using Windows::Foundation::AsyncStatus; - - auto on_completed = ref new AsyncOperationCompletedHandler( - [this, handler](IAsyncOperation^ operation, AsyncStatus status) - { - switch (status) - { - case AsyncStatus::Canceled: - handler->ec_ = asio::error::operation_aborted; - break; - case AsyncStatus::Started: - return; - case AsyncStatus::Completed: - handler->result_ = operation->GetResults(); - // Fall through. - case AsyncStatus::Error: - default: - handler->ec_ = asio::error_code( - operation->ErrorCode.Value, - asio::system_category()); - break; - } - io_context_.post_deferred_completion(handler); - if (--outstanding_ops_ == 0) - promise_.set_value(); - }); - - io_context_.work_started(); - ++outstanding_ops_; - operation->Completed = on_completed; - } - - template - void async( - Windows::Foundation::IAsyncOperationWithProgress< - TResult, TProgress>^ operation, - winrt_async_op* handler) - { - using namespace Windows::Foundation; - using Windows::Foundation::AsyncStatus; - - auto on_completed - = ref new AsyncOperationWithProgressCompletedHandler( - [this, handler](IAsyncOperationWithProgress< - TResult, TProgress>^ operation, AsyncStatus status) - { - switch (status) - { - case AsyncStatus::Canceled: - handler->ec_ = asio::error::operation_aborted; - break; - case AsyncStatus::Started: - return; - case AsyncStatus::Completed: - handler->result_ = operation->GetResults(); - // Fall through. - case AsyncStatus::Error: - default: - handler->ec_ = asio::error_code( - operation->ErrorCode.Value, - asio::system_category()); - break; - } - io_context_.post_deferred_completion(handler); - if (--outstanding_ops_ == 0) - promise_.set_value(); - }); - - io_context_.work_started(); - ++outstanding_ops_; - operation->Completed = on_completed; - } - -private: - // The io_context implementation used to post completed handlers. - io_context_impl& io_context_; - - // Count of outstanding operations. - atomic_count outstanding_ops_; - - // Used to keep wait for outstanding operations to complete. - std::promise promise_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_WINDOWS_RUNTIME) - -#endif // ASIO_DETAIL_WINRT_ASYNC_MANAGER_HPP diff --git a/tools/sdk/include/asio/asio/detail/winrt_async_op.hpp b/tools/sdk/include/asio/asio/detail/winrt_async_op.hpp deleted file mode 100644 index 75891a4ad1a..00000000000 --- a/tools/sdk/include/asio/asio/detail/winrt_async_op.hpp +++ /dev/null @@ -1,65 +0,0 @@ -// -// detail/winrt_async_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WINRT_ASYNC_OP_HPP -#define ASIO_DETAIL_WINRT_ASYNC_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/operation.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class winrt_async_op - : public operation -{ -public: - // The error code to be passed to the completion handler. - asio::error_code ec_; - - // The result of the operation, to be passed to the completion handler. - TResult result_; - -protected: - winrt_async_op(func_type complete_func) - : operation(complete_func), - result_() - { - } -}; - -template <> -class winrt_async_op - : public operation -{ -public: - // The error code to be passed to the completion handler. - asio::error_code ec_; - -protected: - winrt_async_op(func_type complete_func) - : operation(complete_func) - { - } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_WINRT_ASYNC_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/winrt_resolve_op.hpp b/tools/sdk/include/asio/asio/detail/winrt_resolve_op.hpp deleted file mode 100644 index 07efd29d20d..00000000000 --- a/tools/sdk/include/asio/asio/detail/winrt_resolve_op.hpp +++ /dev/null @@ -1,118 +0,0 @@ -// -// detail/winrt_resolve_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WINRT_RESOLVE_OP_HPP -#define ASIO_DETAIL_WINRT_RESOLVE_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_WINDOWS_RUNTIME) - -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/winrt_async_op.hpp" -#include "asio/ip/basic_resolver_results.hpp" -#include "asio/error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class winrt_resolve_op : - public winrt_async_op< - Windows::Foundation::Collections::IVectorView< - Windows::Networking::EndpointPair^>^> -{ -public: - ASIO_DEFINE_HANDLER_PTR(winrt_resolve_op); - - typedef typename Protocol::endpoint endpoint_type; - typedef asio::ip::basic_resolver_query query_type; - typedef asio::ip::basic_resolver_results results_type; - - winrt_resolve_op(const query_type& query, Handler& handler) - : winrt_async_op< - Windows::Foundation::Collections::IVectorView< - Windows::Networking::EndpointPair^>^>( - &winrt_resolve_op::do_complete), - query_(query), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code&, std::size_t) - { - // Take ownership of the operation object. - winrt_resolve_op* o(static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - ASIO_HANDLER_COMPLETION((*o)); - - results_type results = results_type(); - if (!o->ec_) - { - try - { - results = results_type::create(o->result_, o->query_.hints(), - o->query_.host_name(), o->query_.service_name()); - } - catch (Platform::Exception^ e) - { - o->ec_ = asio::error_code(e->HResult, - asio::system_category()); - } - } - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder2 - handler(o->handler_, o->ec_, results); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, "...")); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - query_type query_; - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_WINDOWS_RUNTIME) - -#endif // ASIO_DETAIL_WINRT_RESOLVE_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/winrt_resolver_service.hpp b/tools/sdk/include/asio/asio/detail/winrt_resolver_service.hpp deleted file mode 100644 index aeb44485e57..00000000000 --- a/tools/sdk/include/asio/asio/detail/winrt_resolver_service.hpp +++ /dev/null @@ -1,198 +0,0 @@ -// -// detail/winrt_resolver_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WINRT_RESOLVER_SERVICE_HPP -#define ASIO_DETAIL_WINRT_RESOLVER_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_WINDOWS_RUNTIME) - -#include "asio/ip/basic_resolver_query.hpp" -#include "asio/ip/basic_resolver_results.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/socket_ops.hpp" -#include "asio/detail/winrt_async_manager.hpp" -#include "asio/detail/winrt_resolve_op.hpp" -#include "asio/detail/winrt_utils.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class winrt_resolver_service : - public service_base > -{ -public: - // The implementation type of the resolver. A cancellation token is used to - // indicate to the asynchronous operation that the operation has been - // cancelled. - typedef socket_ops::shared_cancel_token_type implementation_type; - - // The endpoint type. - typedef typename Protocol::endpoint endpoint_type; - - // The query type. - typedef asio::ip::basic_resolver_query query_type; - - // The results type. - typedef asio::ip::basic_resolver_results results_type; - - // Constructor. - winrt_resolver_service(asio::io_context& io_context) - : service_base >(io_context), - io_context_(use_service(io_context)), - async_manager_(use_service(io_context)) - { - } - - // Destructor. - ~winrt_resolver_service() - { - } - - // Destroy all user-defined handler objects owned by the service. - void shutdown() - { - } - - // Perform any fork-related housekeeping. - void notify_fork(asio::io_context::fork_event) - { - } - - // Construct a new resolver implementation. - void construct(implementation_type&) - { - } - - // Move-construct a new resolver implementation. - void move_construct(implementation_type&, - implementation_type&) - { - } - - // Move-assign from another resolver implementation. - void move_assign(implementation_type&, - winrt_resolver_service&, implementation_type&) - { - } - - // Destroy a resolver implementation. - void destroy(implementation_type&) - { - } - - // Cancel pending asynchronous operations. - void cancel(implementation_type&) - { - } - - // Resolve a query to a list of entries. - results_type resolve(implementation_type&, - const query_type& query, asio::error_code& ec) - { - try - { - using namespace Windows::Networking::Sockets; - auto endpoint_pairs = async_manager_.sync( - DatagramSocket::GetEndpointPairsAsync( - winrt_utils::host_name(query.host_name()), - winrt_utils::string(query.service_name())), ec); - - if (ec) - return results_type(); - - return results_type::create( - endpoint_pairs, query.hints(), - query.host_name(), query.service_name()); - } - catch (Platform::Exception^ e) - { - ec = asio::error_code(e->HResult, - asio::system_category()); - return results_type(); - } - } - - // Asynchronously resolve a query to a list of entries. - template - void async_resolve(implementation_type& impl, - const query_type& query, Handler& handler) - { - bool is_continuation = - asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef winrt_resolve_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(query, handler); - - ASIO_HANDLER_CREATION((io_context_.context(), - *p.p, "resolver", &impl, 0, "async_resolve")); - (void)impl; - - try - { - using namespace Windows::Networking::Sockets; - async_manager_.async(DatagramSocket::GetEndpointPairsAsync( - winrt_utils::host_name(query.host_name()), - winrt_utils::string(query.service_name())), p.p); - p.v = p.p = 0; - } - catch (Platform::Exception^ e) - { - p.p->ec_ = asio::error_code( - e->HResult, asio::system_category()); - io_context_.post_immediate_completion(p.p, is_continuation); - p.v = p.p = 0; - } - } - - // Resolve an endpoint to a list of entries. - results_type resolve(implementation_type&, - const endpoint_type&, asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return results_type(); - } - - // Asynchronously resolve an endpoint to a list of entries. - template - void async_resolve(implementation_type&, - const endpoint_type&, Handler& handler) - { - asio::error_code ec = asio::error::operation_not_supported; - const results_type results; - io_context_.get_io_context().post( - detail::bind_handler(handler, ec, results)); - } - -private: - io_context_impl& io_context_; - winrt_async_manager& async_manager_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_WINDOWS_RUNTIME) - -#endif // ASIO_DETAIL_WINRT_RESOLVER_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/detail/winrt_socket_connect_op.hpp b/tools/sdk/include/asio/asio/detail/winrt_socket_connect_op.hpp deleted file mode 100644 index f18b445f880..00000000000 --- a/tools/sdk/include/asio/asio/detail/winrt_socket_connect_op.hpp +++ /dev/null @@ -1,92 +0,0 @@ -// -// detail/winrt_socket_connect_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WINRT_SOCKET_CONNECT_OP_HPP -#define ASIO_DETAIL_WINRT_SOCKET_CONNECT_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_WINDOWS_RUNTIME) - -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/winrt_async_op.hpp" -#include "asio/error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class winrt_socket_connect_op : - public winrt_async_op -{ -public: - ASIO_DEFINE_HANDLER_PTR(winrt_socket_connect_op); - - winrt_socket_connect_op(Handler& handler) - : winrt_async_op(&winrt_socket_connect_op::do_complete), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code&, std::size_t) - { - // Take ownership of the operation object. - winrt_socket_connect_op* o(static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - ASIO_HANDLER_COMPLETION((*o)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder1 - handler(o->handler_, o->ec_); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_WINDOWS_RUNTIME) - -#endif // ASIO_DETAIL_WINRT_SOCKET_CONNECT_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/winrt_socket_recv_op.hpp b/tools/sdk/include/asio/asio/detail/winrt_socket_recv_op.hpp deleted file mode 100644 index 8f1fcf576f8..00000000000 --- a/tools/sdk/include/asio/asio/detail/winrt_socket_recv_op.hpp +++ /dev/null @@ -1,112 +0,0 @@ -// -// detail/winrt_socket_recv_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WINRT_SOCKET_RECV_OP_HPP -#define ASIO_DETAIL_WINRT_SOCKET_RECV_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_WINDOWS_RUNTIME) - -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/winrt_async_op.hpp" -#include "asio/error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class winrt_socket_recv_op : - public winrt_async_op -{ -public: - ASIO_DEFINE_HANDLER_PTR(winrt_socket_recv_op); - - winrt_socket_recv_op(const MutableBufferSequence& buffers, Handler& handler) - : winrt_async_op( - &winrt_socket_recv_op::do_complete), - buffers_(buffers), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code&, std::size_t) - { - // Take ownership of the operation object. - winrt_socket_recv_op* o(static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - ASIO_HANDLER_COMPLETION((*o)); - -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - // Check whether buffers are still valid. - if (owner) - { - buffer_sequence_adapter::validate(o->buffers_); - } -#endif // defined(ASIO_ENABLE_BUFFER_DEBUGGING) - - std::size_t bytes_transferred = o->result_ ? o->result_->Length : 0; - if (bytes_transferred == 0 && !o->ec_ && - !buffer_sequence_adapter::all_empty(o->buffers_)) - { - o->ec_ = asio::error::eof; - } - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder2 - handler(o->handler_, o->ec_, bytes_transferred); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - MutableBufferSequence buffers_; - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_WINDOWS_RUNTIME) - -#endif // ASIO_DETAIL_WINRT_SOCKET_RECV_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/winrt_socket_send_op.hpp b/tools/sdk/include/asio/asio/detail/winrt_socket_send_op.hpp deleted file mode 100644 index 1148c24e4cf..00000000000 --- a/tools/sdk/include/asio/asio/detail/winrt_socket_send_op.hpp +++ /dev/null @@ -1,103 +0,0 @@ -// -// detail/winrt_socket_send_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WINRT_SOCKET_SEND_OP_HPP -#define ASIO_DETAIL_WINRT_SOCKET_SEND_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_WINDOWS_RUNTIME) - -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/winrt_async_op.hpp" -#include "asio/error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class winrt_socket_send_op : - public winrt_async_op -{ -public: - ASIO_DEFINE_HANDLER_PTR(winrt_socket_send_op); - - winrt_socket_send_op(const ConstBufferSequence& buffers, Handler& handler) - : winrt_async_op(&winrt_socket_send_op::do_complete), - buffers_(buffers), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - handler_work::start(handler_); - } - - static void do_complete(void* owner, operation* base, - const asio::error_code&, std::size_t) - { - // Take ownership of the operation object. - winrt_socket_send_op* o(static_cast(base)); - ptr p = { asio::detail::addressof(o->handler_), o, o }; - handler_work w(o->handler_); - - ASIO_HANDLER_COMPLETION((*o)); - -#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) - // Check whether buffers are still valid. - if (owner) - { - buffer_sequence_adapter::validate(o->buffers_); - } -#endif // defined(ASIO_ENABLE_BUFFER_DEBUGGING) - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder2 - handler(o->handler_, o->ec_, o->result_); - p.h = asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); - w.complete(handler, handler.handler_); - ASIO_HANDLER_INVOCATION_END; - } - } - -private: - ConstBufferSequence buffers_; - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_WINDOWS_RUNTIME) - -#endif // ASIO_DETAIL_WINRT_SOCKET_SEND_OP_HPP diff --git a/tools/sdk/include/asio/asio/detail/winrt_ssocket_service.hpp b/tools/sdk/include/asio/asio/detail/winrt_ssocket_service.hpp deleted file mode 100644 index 603724a30e6..00000000000 --- a/tools/sdk/include/asio/asio/detail/winrt_ssocket_service.hpp +++ /dev/null @@ -1,241 +0,0 @@ -// -// detail/winrt_ssocket_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WINRT_SSOCKET_SERVICE_HPP -#define ASIO_DETAIL_WINRT_SSOCKET_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_WINDOWS_RUNTIME) - -#include "asio/error.hpp" -#include "asio/io_context.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/winrt_socket_connect_op.hpp" -#include "asio/detail/winrt_ssocket_service_base.hpp" -#include "asio/detail/winrt_utils.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class winrt_ssocket_service : - public service_base >, - public winrt_ssocket_service_base -{ -public: - // The protocol type. - typedef Protocol protocol_type; - - // The endpoint type. - typedef typename Protocol::endpoint endpoint_type; - - // The native type of a socket. - typedef Windows::Networking::Sockets::StreamSocket^ native_handle_type; - - // The implementation type of the socket. - struct implementation_type : base_implementation_type - { - // Default constructor. - implementation_type() - : base_implementation_type(), - protocol_(endpoint_type().protocol()) - { - } - - // The protocol associated with the socket. - protocol_type protocol_; - }; - - // Constructor. - winrt_ssocket_service(asio::io_context& io_context) - : service_base >(io_context), - winrt_ssocket_service_base(io_context) - { - } - - // Destroy all user-defined handler objects owned by the service. - void shutdown() - { - this->base_shutdown(); - } - - // Move-construct a new socket implementation. - void move_construct(implementation_type& impl, - implementation_type& other_impl) - { - this->base_move_construct(impl, other_impl); - - impl.protocol_ = other_impl.protocol_; - other_impl.protocol_ = endpoint_type().protocol(); - } - - // Move-assign from another socket implementation. - void move_assign(implementation_type& impl, - winrt_ssocket_service& other_service, - implementation_type& other_impl) - { - this->base_move_assign(impl, other_service, other_impl); - - impl.protocol_ = other_impl.protocol_; - other_impl.protocol_ = endpoint_type().protocol(); - } - - // Move-construct a new socket implementation from another protocol type. - template - void converting_move_construct(implementation_type& impl, - winrt_ssocket_service&, - typename winrt_ssocket_service< - Protocol1>::implementation_type& other_impl) - { - this->base_move_construct(impl, other_impl); - - impl.protocol_ = protocol_type(other_impl.protocol_); - other_impl.protocol_ = typename Protocol1::endpoint().protocol(); - } - - // Open a new socket implementation. - asio::error_code open(implementation_type& impl, - const protocol_type& protocol, asio::error_code& ec) - { - if (is_open(impl)) - { - ec = asio::error::already_open; - return ec; - } - - try - { - impl.socket_ = ref new Windows::Networking::Sockets::StreamSocket; - impl.protocol_ = protocol; - ec = asio::error_code(); - } - catch (Platform::Exception^ e) - { - ec = asio::error_code(e->HResult, - asio::system_category()); - } - - return ec; - } - - // Assign a native socket to a socket implementation. - asio::error_code assign(implementation_type& impl, - const protocol_type& protocol, const native_handle_type& native_socket, - asio::error_code& ec) - { - if (is_open(impl)) - { - ec = asio::error::already_open; - return ec; - } - - impl.socket_ = native_socket; - impl.protocol_ = protocol; - ec = asio::error_code(); - - return ec; - } - - // Bind the socket to the specified local endpoint. - asio::error_code bind(implementation_type&, - const endpoint_type&, asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return ec; - } - - // Get the local endpoint. - endpoint_type local_endpoint(const implementation_type& impl, - asio::error_code& ec) const - { - endpoint_type endpoint; - endpoint.resize(do_get_endpoint(impl, true, - endpoint.data(), endpoint.size(), ec)); - return endpoint; - } - - // Get the remote endpoint. - endpoint_type remote_endpoint(const implementation_type& impl, - asio::error_code& ec) const - { - endpoint_type endpoint; - endpoint.resize(do_get_endpoint(impl, false, - endpoint.data(), endpoint.size(), ec)); - return endpoint; - } - - // Set a socket option. - template - asio::error_code set_option(implementation_type& impl, - const Option& option, asio::error_code& ec) - { - return do_set_option(impl, option.level(impl.protocol_), - option.name(impl.protocol_), option.data(impl.protocol_), - option.size(impl.protocol_), ec); - } - - // Get a socket option. - template - asio::error_code get_option(const implementation_type& impl, - Option& option, asio::error_code& ec) const - { - std::size_t size = option.size(impl.protocol_); - do_get_option(impl, option.level(impl.protocol_), - option.name(impl.protocol_), - option.data(impl.protocol_), &size, ec); - if (!ec) - option.resize(impl.protocol_, size); - return ec; - } - - // Connect the socket to the specified endpoint. - asio::error_code connect(implementation_type& impl, - const endpoint_type& peer_endpoint, asio::error_code& ec) - { - return do_connect(impl, peer_endpoint.data(), ec); - } - - // Start an asynchronous connect. - template - void async_connect(implementation_type& impl, - const endpoint_type& peer_endpoint, Handler& handler) - { - bool is_continuation = - asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef winrt_socket_connect_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(handler); - - ASIO_HANDLER_CREATION((io_context_.context(), - *p.p, "socket", &impl, 0, "async_connect")); - - start_connect_op(impl, peer_endpoint.data(), p.p, is_continuation); - p.v = p.p = 0; - } -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_WINDOWS_RUNTIME) - -#endif // ASIO_DETAIL_WINRT_SSOCKET_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/detail/winrt_ssocket_service_base.hpp b/tools/sdk/include/asio/asio/detail/winrt_ssocket_service_base.hpp deleted file mode 100644 index 61328d0a034..00000000000 --- a/tools/sdk/include/asio/asio/detail/winrt_ssocket_service_base.hpp +++ /dev/null @@ -1,359 +0,0 @@ -// -// detail/winrt_ssocket_service_base.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WINRT_SSOCKET_SERVICE_BASE_HPP -#define ASIO_DETAIL_WINRT_SSOCKET_SERVICE_BASE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_WINDOWS_RUNTIME) - -#include "asio/buffer.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" -#include "asio/socket_base.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/detail/winrt_async_manager.hpp" -#include "asio/detail/winrt_socket_recv_op.hpp" -#include "asio/detail/winrt_socket_send_op.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class winrt_ssocket_service_base -{ -public: - // The native type of a socket. - typedef Windows::Networking::Sockets::StreamSocket^ native_handle_type; - - // The implementation type of the socket. - struct base_implementation_type - { - // Default constructor. - base_implementation_type() - : socket_(nullptr), - next_(0), - prev_(0) - { - } - - // The underlying native socket. - native_handle_type socket_; - - // Pointers to adjacent socket implementations in linked list. - base_implementation_type* next_; - base_implementation_type* prev_; - }; - - // Constructor. - ASIO_DECL winrt_ssocket_service_base( - asio::io_context& io_context); - - // Destroy all user-defined handler objects owned by the service. - ASIO_DECL void base_shutdown(); - - // Construct a new socket implementation. - ASIO_DECL void construct(base_implementation_type&); - - // Move-construct a new socket implementation. - ASIO_DECL void base_move_construct(base_implementation_type& impl, - base_implementation_type& other_impl); - - // Move-assign from another socket implementation. - ASIO_DECL void base_move_assign(base_implementation_type& impl, - winrt_ssocket_service_base& other_service, - base_implementation_type& other_impl); - - // Destroy a socket implementation. - ASIO_DECL void destroy(base_implementation_type& impl); - - // Determine whether the socket is open. - bool is_open(const base_implementation_type& impl) const - { - return impl.socket_ != nullptr; - } - - // Destroy a socket implementation. - ASIO_DECL asio::error_code close( - base_implementation_type& impl, asio::error_code& ec); - - // Release ownership of the socket. - ASIO_DECL native_handle_type release( - base_implementation_type& impl, asio::error_code& ec); - - // Get the native socket representation. - native_handle_type native_handle(base_implementation_type& impl) - { - return impl.socket_; - } - - // Cancel all operations associated with the socket. - asio::error_code cancel(base_implementation_type&, - asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return ec; - } - - // Determine whether the socket is at the out-of-band data mark. - bool at_mark(const base_implementation_type&, - asio::error_code& ec) const - { - ec = asio::error::operation_not_supported; - return false; - } - - // Determine the number of bytes available for reading. - std::size_t available(const base_implementation_type&, - asio::error_code& ec) const - { - ec = asio::error::operation_not_supported; - return 0; - } - - // Perform an IO control command on the socket. - template - asio::error_code io_control(base_implementation_type&, - IO_Control_Command&, asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return ec; - } - - // Gets the non-blocking mode of the socket. - bool non_blocking(const base_implementation_type&) const - { - return false; - } - - // Sets the non-blocking mode of the socket. - asio::error_code non_blocking(base_implementation_type&, - bool, asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return ec; - } - - // Gets the non-blocking mode of the native socket implementation. - bool native_non_blocking(const base_implementation_type&) const - { - return false; - } - - // Sets the non-blocking mode of the native socket implementation. - asio::error_code native_non_blocking(base_implementation_type&, - bool, asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return ec; - } - - // Disable sends or receives on the socket. - asio::error_code shutdown(base_implementation_type&, - socket_base::shutdown_type, asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return ec; - } - - // Send the given data to the peer. - template - std::size_t send(base_implementation_type& impl, - const ConstBufferSequence& buffers, - socket_base::message_flags flags, asio::error_code& ec) - { - return do_send(impl, - buffer_sequence_adapter::first(buffers), flags, ec); - } - - // Wait until data can be sent without blocking. - std::size_t send(base_implementation_type&, const null_buffers&, - socket_base::message_flags, asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return 0; - } - - // Start an asynchronous send. The data being sent must be valid for the - // lifetime of the asynchronous operation. - template - void async_send(base_implementation_type& impl, - const ConstBufferSequence& buffers, - socket_base::message_flags flags, Handler& handler) - { - bool is_continuation = - asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef winrt_socket_send_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(buffers, handler); - - ASIO_HANDLER_CREATION((io_context_.context(), - *p.p, "socket", &impl, 0, "async_send")); - - start_send_op(impl, - buffer_sequence_adapter::first(buffers), - flags, p.p, is_continuation); - p.v = p.p = 0; - } - - // Start an asynchronous wait until data can be sent without blocking. - template - void async_send(base_implementation_type&, const null_buffers&, - socket_base::message_flags, Handler& handler) - { - asio::error_code ec = asio::error::operation_not_supported; - const std::size_t bytes_transferred = 0; - io_context_.get_io_context().post( - detail::bind_handler(handler, ec, bytes_transferred)); - } - - // Receive some data from the peer. Returns the number of bytes received. - template - std::size_t receive(base_implementation_type& impl, - const MutableBufferSequence& buffers, - socket_base::message_flags flags, asio::error_code& ec) - { - return do_receive(impl, - buffer_sequence_adapter::first(buffers), flags, ec); - } - - // Wait until data can be received without blocking. - std::size_t receive(base_implementation_type&, const null_buffers&, - socket_base::message_flags, asio::error_code& ec) - { - ec = asio::error::operation_not_supported; - return 0; - } - - // Start an asynchronous receive. The buffer for the data being received - // must be valid for the lifetime of the asynchronous operation. - template - void async_receive(base_implementation_type& impl, - const MutableBufferSequence& buffers, - socket_base::message_flags flags, Handler& handler) - { - bool is_continuation = - asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef winrt_socket_recv_op op; - typename op::ptr p = { asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(buffers, handler); - - ASIO_HANDLER_CREATION((io_context_.context(), - *p.p, "socket", &impl, 0, "async_receive")); - - start_receive_op(impl, - buffer_sequence_adapter::first(buffers), - flags, p.p, is_continuation); - p.v = p.p = 0; - } - - // Wait until data can be received without blocking. - template - void async_receive(base_implementation_type&, const null_buffers&, - socket_base::message_flags, Handler& handler) - { - asio::error_code ec = asio::error::operation_not_supported; - const std::size_t bytes_transferred = 0; - io_context_.get_io_context().post( - detail::bind_handler(handler, ec, bytes_transferred)); - } - -protected: - // Helper function to obtain endpoints associated with the connection. - ASIO_DECL std::size_t do_get_endpoint( - const base_implementation_type& impl, bool local, - void* addr, std::size_t addr_len, asio::error_code& ec) const; - - // Helper function to set a socket option. - ASIO_DECL asio::error_code do_set_option( - base_implementation_type& impl, - int level, int optname, const void* optval, - std::size_t optlen, asio::error_code& ec); - - // Helper function to get a socket option. - ASIO_DECL void do_get_option( - const base_implementation_type& impl, - int level, int optname, void* optval, - std::size_t* optlen, asio::error_code& ec) const; - - // Helper function to perform a synchronous connect. - ASIO_DECL asio::error_code do_connect( - base_implementation_type& impl, - const void* addr, asio::error_code& ec); - - // Helper function to start an asynchronous connect. - ASIO_DECL void start_connect_op( - base_implementation_type& impl, const void* addr, - winrt_async_op* op, bool is_continuation); - - // Helper function to perform a synchronous send. - ASIO_DECL std::size_t do_send( - base_implementation_type& impl, const asio::const_buffer& data, - socket_base::message_flags flags, asio::error_code& ec); - - // Helper function to start an asynchronous send. - ASIO_DECL void start_send_op(base_implementation_type& impl, - const asio::const_buffer& data, socket_base::message_flags flags, - winrt_async_op* op, bool is_continuation); - - // Helper function to perform a synchronous receive. - ASIO_DECL std::size_t do_receive( - base_implementation_type& impl, const asio::mutable_buffer& data, - socket_base::message_flags flags, asio::error_code& ec); - - // Helper function to start an asynchronous receive. - ASIO_DECL void start_receive_op(base_implementation_type& impl, - const asio::mutable_buffer& data, socket_base::message_flags flags, - winrt_async_op* op, - bool is_continuation); - - // The io_context implementation used for delivering completions. - io_context_impl& io_context_; - - // The manager that keeps track of outstanding operations. - winrt_async_manager& async_manager_; - - // Mutex to protect access to the linked list of implementations. - asio::detail::mutex mutex_; - - // The head of a linked list of all implementations. - base_implementation_type* impl_list_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/winrt_ssocket_service_base.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_WINDOWS_RUNTIME) - -#endif // ASIO_DETAIL_WINRT_SSOCKET_SERVICE_BASE_HPP diff --git a/tools/sdk/include/asio/asio/detail/winrt_timer_scheduler.hpp b/tools/sdk/include/asio/asio/detail/winrt_timer_scheduler.hpp deleted file mode 100644 index 5dec7c0b696..00000000000 --- a/tools/sdk/include/asio/asio/detail/winrt_timer_scheduler.hpp +++ /dev/null @@ -1,137 +0,0 @@ -// -// detail/winrt_timer_scheduler.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WINRT_TIMER_SCHEDULER_HPP -#define ASIO_DETAIL_WINRT_TIMER_SCHEDULER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_WINDOWS_RUNTIME) - -#include -#include "asio/detail/event.hpp" -#include "asio/detail/limits.hpp" -#include "asio/detail/mutex.hpp" -#include "asio/detail/op_queue.hpp" -#include "asio/detail/thread.hpp" -#include "asio/detail/timer_queue_base.hpp" -#include "asio/detail/timer_queue_set.hpp" -#include "asio/detail/wait_op.hpp" -#include "asio/io_context.hpp" - -#if defined(ASIO_HAS_IOCP) -# include "asio/detail/thread.hpp" -#endif // defined(ASIO_HAS_IOCP) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class winrt_timer_scheduler - : public asio::detail::service_base -{ -public: - // Constructor. - ASIO_DECL winrt_timer_scheduler(asio::io_context& io_context); - - // Destructor. - ASIO_DECL ~winrt_timer_scheduler(); - - // Destroy all user-defined handler objects owned by the service. - ASIO_DECL void shutdown(); - - // Recreate internal descriptors following a fork. - ASIO_DECL void notify_fork( - asio::io_context::fork_event fork_ev); - - // Initialise the task. No effect as this class uses its own thread. - ASIO_DECL void init_task(); - - // Add a new timer queue to the reactor. - template - void add_timer_queue(timer_queue& queue); - - // Remove a timer queue from the reactor. - template - void remove_timer_queue(timer_queue& queue); - - // Schedule a new operation in the given timer queue to expire at the - // specified absolute time. - template - void schedule_timer(timer_queue& queue, - const typename Time_Traits::time_type& time, - typename timer_queue::per_timer_data& timer, wait_op* op); - - // Cancel the timer operations associated with the given token. Returns the - // number of operations that have been posted or dispatched. - template - std::size_t cancel_timer(timer_queue& queue, - typename timer_queue::per_timer_data& timer, - std::size_t max_cancelled = (std::numeric_limits::max)()); - - // Move the timer operations associated with the given timer. - template - void move_timer(timer_queue& queue, - typename timer_queue::per_timer_data& to, - typename timer_queue::per_timer_data& from); - -private: - // Run the select loop in the thread. - ASIO_DECL void run_thread(); - - // Entry point for the select loop thread. - ASIO_DECL static void call_run_thread(winrt_timer_scheduler* reactor); - - // Helper function to add a new timer queue. - ASIO_DECL void do_add_timer_queue(timer_queue_base& queue); - - // Helper function to remove a timer queue. - ASIO_DECL void do_remove_timer_queue(timer_queue_base& queue); - - // The io_context implementation used to post completions. - io_context_impl& io_context_; - - // Mutex used to protect internal variables. - asio::detail::mutex mutex_; - - // Event used to wake up background thread. - asio::detail::event event_; - - // The timer queues. - timer_queue_set timer_queues_; - - // The background thread that is waiting for timers to expire. - asio::detail::thread* thread_; - - // Does the background thread need to stop. - bool stop_thread_; - - // Whether the service has been shut down. - bool shutdown_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/detail/impl/winrt_timer_scheduler.hpp" -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/winrt_timer_scheduler.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_WINDOWS_RUNTIME) - -#endif // ASIO_DETAIL_WINRT_TIMER_SCHEDULER_HPP diff --git a/tools/sdk/include/asio/asio/detail/winrt_utils.hpp b/tools/sdk/include/asio/asio/detail/winrt_utils.hpp deleted file mode 100644 index 22a24895834..00000000000 --- a/tools/sdk/include/asio/asio/detail/winrt_utils.hpp +++ /dev/null @@ -1,106 +0,0 @@ -// -// detail/winrt_utils.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WINRT_UTILS_HPP -#define ASIO_DETAIL_WINRT_UTILS_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_WINDOWS_RUNTIME) - -#include -#include -#include -#include -#include -#include -#include -#include "asio/buffer.hpp" -#include "asio/error_code.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/socket_ops.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { -namespace winrt_utils { - -inline Platform::String^ string(const char* from) -{ - std::wstring tmp(from, from + std::strlen(from)); - return ref new Platform::String(tmp.c_str()); -} - -inline Platform::String^ string(const std::string& from) -{ - std::wstring tmp(from.begin(), from.end()); - return ref new Platform::String(tmp.c_str()); -} - -inline std::string string(Platform::String^ from) -{ - std::wstring_convert> converter; - return converter.to_bytes(from->Data()); -} - -inline Platform::String^ string(unsigned short from) -{ - return string(std::to_string(from)); -} - -template -inline Platform::String^ string(const T& from) -{ - return string(from.to_string()); -} - -inline int integer(Platform::String^ from) -{ - return _wtoi(from->Data()); -} - -template -inline Windows::Networking::HostName^ host_name(const T& from) -{ - return ref new Windows::Networking::HostName((string)(from)); -} - -template -inline Windows::Storage::Streams::IBuffer^ buffer_dup( - const ConstBufferSequence& buffers) -{ - using Microsoft::WRL::ComPtr; - using asio::buffer_size; - std::size_t size = buffer_size(buffers); - auto b = ref new Windows::Storage::Streams::Buffer(size); - ComPtr insp = reinterpret_cast(b); - ComPtr bacc; - insp.As(&bacc); - byte* bytes = nullptr; - bacc->Buffer(&bytes); - asio::buffer_copy(asio::buffer(bytes, size), buffers); - b->Length = size; - return b; -} - -} // namespace winrt_utils -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_WINDOWS_RUNTIME) - -#endif // ASIO_DETAIL_WINRT_UTILS_HPP diff --git a/tools/sdk/include/asio/asio/detail/winsock_init.hpp b/tools/sdk/include/asio/asio/detail/winsock_init.hpp deleted file mode 100644 index 9094363abd7..00000000000 --- a/tools/sdk/include/asio/asio/detail/winsock_init.hpp +++ /dev/null @@ -1,128 +0,0 @@ -// -// detail/winsock_init.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WINSOCK_INIT_HPP -#define ASIO_DETAIL_WINSOCK_INIT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class winsock_init_base -{ -protected: - // Structure to track result of initialisation and number of uses. POD is used - // to ensure that the values are zero-initialised prior to any code being run. - struct data - { - long init_count_; - long result_; - }; - - ASIO_DECL static void startup(data& d, - unsigned char major, unsigned char minor); - - ASIO_DECL static void manual_startup(data& d); - - ASIO_DECL static void cleanup(data& d); - - ASIO_DECL static void manual_cleanup(data& d); - - ASIO_DECL static void throw_on_error(data& d); -}; - -template -class winsock_init : private winsock_init_base -{ -public: - winsock_init(bool allow_throw = true) - { - startup(data_, Major, Minor); - if (allow_throw) - throw_on_error(data_); - } - - winsock_init(const winsock_init&) - { - startup(data_, Major, Minor); - throw_on_error(data_); - } - - ~winsock_init() - { - cleanup(data_); - } - - // This class may be used to indicate that user code will manage Winsock - // initialisation and cleanup. This may be required in the case of a DLL, for - // example, where it is not safe to initialise Winsock from global object - // constructors. - // - // To prevent asio from initialising Winsock, the object must be constructed - // before any Asio's own global objects. With MSVC, this may be accomplished - // by adding the following code to the DLL: - // - // #pragma warning(push) - // #pragma warning(disable:4073) - // #pragma init_seg(lib) - // asio::detail::winsock_init<>::manual manual_winsock_init; - // #pragma warning(pop) - class manual - { - public: - manual() - { - manual_startup(data_); - } - - manual(const manual&) - { - manual_startup(data_); - } - - ~manual() - { - manual_cleanup(data_); - } - }; - -private: - friend class manual; - static data data_; -}; - -template -winsock_init_base::data winsock_init::data_; - -// Static variable to ensure that winsock is initialised before main, and -// therefore before any other threads can get started. -static const winsock_init<>& winsock_init_instance = winsock_init<>(false); - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/detail/impl/winsock_init.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) - -#endif // ASIO_DETAIL_WINSOCK_INIT_HPP diff --git a/tools/sdk/include/asio/asio/detail/work_dispatcher.hpp b/tools/sdk/include/asio/asio/detail/work_dispatcher.hpp deleted file mode 100644 index 7abce497ba0..00000000000 --- a/tools/sdk/include/asio/asio/detail/work_dispatcher.hpp +++ /dev/null @@ -1,72 +0,0 @@ -// -// detail/work_dispatcher.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WORK_DISPATCHER_HPP -#define ASIO_DETAIL_WORK_DISPATCHER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/associated_executor.hpp" -#include "asio/associated_allocator.hpp" -#include "asio/executor_work_guard.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class work_dispatcher -{ -public: - work_dispatcher(Handler& handler) - : work_((get_associated_executor)(handler)), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - } - -#if defined(ASIO_HAS_MOVE) - work_dispatcher(const work_dispatcher& other) - : work_(other.work_), - handler_(other.handler_) - { - } - - work_dispatcher(work_dispatcher&& other) - : work_(ASIO_MOVE_CAST(executor_work_guard< - typename associated_executor::type>)(other.work_)), - handler_(ASIO_MOVE_CAST(Handler)(other.handler_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()() - { - typename associated_allocator::type alloc( - (get_associated_allocator)(handler_)); - work_.get_executor().dispatch( - ASIO_MOVE_CAST(Handler)(handler_), alloc); - work_.reset(); - } - -private: - executor_work_guard::type> work_; - Handler handler_; -}; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_WORK_DISPATCHER_HPP diff --git a/tools/sdk/include/asio/asio/detail/wrapped_handler.hpp b/tools/sdk/include/asio/asio/detail/wrapped_handler.hpp deleted file mode 100644 index 751f0ea830a..00000000000 --- a/tools/sdk/include/asio/asio/detail/wrapped_handler.hpp +++ /dev/null @@ -1,291 +0,0 @@ -// -// detail/wrapped_handler.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DETAIL_WRAPPED_HANDLER_HPP -#define ASIO_DETAIL_WRAPPED_HANDLER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_cont_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -struct is_continuation_delegated -{ - template - bool operator()(Dispatcher&, Handler& handler) const - { - return asio_handler_cont_helpers::is_continuation(handler); - } -}; - -struct is_continuation_if_running -{ - template - bool operator()(Dispatcher& dispatcher, Handler&) const - { - return dispatcher.running_in_this_thread(); - } -}; - -template -class wrapped_handler -{ -public: - typedef void result_type; - - wrapped_handler(Dispatcher dispatcher, Handler& handler) - : dispatcher_(dispatcher), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - } - -#if defined(ASIO_HAS_MOVE) - wrapped_handler(const wrapped_handler& other) - : dispatcher_(other.dispatcher_), - handler_(other.handler_) - { - } - - wrapped_handler(wrapped_handler&& other) - : dispatcher_(other.dispatcher_), - handler_(ASIO_MOVE_CAST(Handler)(other.handler_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()() - { - dispatcher_.dispatch(ASIO_MOVE_CAST(Handler)(handler_)); - } - - void operator()() const - { - dispatcher_.dispatch(handler_); - } - - template - void operator()(const Arg1& arg1) - { - dispatcher_.dispatch(detail::bind_handler(handler_, arg1)); - } - - template - void operator()(const Arg1& arg1) const - { - dispatcher_.dispatch(detail::bind_handler(handler_, arg1)); - } - - template - void operator()(const Arg1& arg1, const Arg2& arg2) - { - dispatcher_.dispatch(detail::bind_handler(handler_, arg1, arg2)); - } - - template - void operator()(const Arg1& arg1, const Arg2& arg2) const - { - dispatcher_.dispatch(detail::bind_handler(handler_, arg1, arg2)); - } - - template - void operator()(const Arg1& arg1, const Arg2& arg2, const Arg3& arg3) - { - dispatcher_.dispatch(detail::bind_handler(handler_, arg1, arg2, arg3)); - } - - template - void operator()(const Arg1& arg1, const Arg2& arg2, const Arg3& arg3) const - { - dispatcher_.dispatch(detail::bind_handler(handler_, arg1, arg2, arg3)); - } - - template - void operator()(const Arg1& arg1, const Arg2& arg2, const Arg3& arg3, - const Arg4& arg4) - { - dispatcher_.dispatch( - detail::bind_handler(handler_, arg1, arg2, arg3, arg4)); - } - - template - void operator()(const Arg1& arg1, const Arg2& arg2, const Arg3& arg3, - const Arg4& arg4) const - { - dispatcher_.dispatch( - detail::bind_handler(handler_, arg1, arg2, arg3, arg4)); - } - - template - void operator()(const Arg1& arg1, const Arg2& arg2, const Arg3& arg3, - const Arg4& arg4, const Arg5& arg5) - { - dispatcher_.dispatch( - detail::bind_handler(handler_, arg1, arg2, arg3, arg4, arg5)); - } - - template - void operator()(const Arg1& arg1, const Arg2& arg2, const Arg3& arg3, - const Arg4& arg4, const Arg5& arg5) const - { - dispatcher_.dispatch( - detail::bind_handler(handler_, arg1, arg2, arg3, arg4, arg5)); - } - -//private: - Dispatcher dispatcher_; - Handler handler_; -}; - -template -class rewrapped_handler -{ -public: - explicit rewrapped_handler(Handler& handler, const Context& context) - : context_(context), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - } - - explicit rewrapped_handler(const Handler& handler, const Context& context) - : context_(context), - handler_(handler) - { - } - -#if defined(ASIO_HAS_MOVE) - rewrapped_handler(const rewrapped_handler& other) - : context_(other.context_), - handler_(other.handler_) - { - } - - rewrapped_handler(rewrapped_handler&& other) - : context_(ASIO_MOVE_CAST(Context)(other.context_)), - handler_(ASIO_MOVE_CAST(Handler)(other.handler_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()() - { - handler_(); - } - - void operator()() const - { - handler_(); - } - -//private: - Context context_; - Handler handler_; -}; - -template -inline void* asio_handler_allocate(std::size_t size, - wrapped_handler* this_handler) -{ - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); -} - -template -inline void asio_handler_deallocate(void* pointer, std::size_t size, - wrapped_handler* this_handler) -{ - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); -} - -template -inline bool asio_handler_is_continuation( - wrapped_handler* this_handler) -{ - return IsContinuation()(this_handler->dispatcher_, this_handler->handler_); -} - -template -inline void asio_handler_invoke(Function& function, - wrapped_handler* this_handler) -{ - this_handler->dispatcher_.dispatch( - rewrapped_handler( - function, this_handler->handler_)); -} - -template -inline void asio_handler_invoke(const Function& function, - wrapped_handler* this_handler) -{ - this_handler->dispatcher_.dispatch( - rewrapped_handler( - function, this_handler->handler_)); -} - -template -inline void* asio_handler_allocate(std::size_t size, - rewrapped_handler* this_handler) -{ - return asio_handler_alloc_helpers::allocate( - size, this_handler->context_); -} - -template -inline void asio_handler_deallocate(void* pointer, std::size_t size, - rewrapped_handler* this_handler) -{ - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->context_); -} - -template -inline bool asio_handler_is_continuation( - rewrapped_handler* this_handler) -{ - return asio_handler_cont_helpers::is_continuation( - this_handler->context_); -} - -template -inline void asio_handler_invoke(Function& function, - rewrapped_handler* this_handler) -{ - asio_handler_invoke_helpers::invoke( - function, this_handler->context_); -} - -template -inline void asio_handler_invoke(const Function& function, - rewrapped_handler* this_handler) -{ - asio_handler_invoke_helpers::invoke( - function, this_handler->context_); -} - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_DETAIL_WRAPPED_HANDLER_HPP diff --git a/tools/sdk/include/asio/asio/dispatch.hpp b/tools/sdk/include/asio/asio/dispatch.hpp deleted file mode 100644 index b8dfd69102b..00000000000 --- a/tools/sdk/include/asio/asio/dispatch.hpp +++ /dev/null @@ -1,108 +0,0 @@ -// -// dispatch.hpp -// ~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_DISPATCH_HPP -#define ASIO_DISPATCH_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/async_result.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/execution_context.hpp" -#include "asio/is_executor.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Submits a completion token or function object for execution. -/** - * This function submits an object for execution using the object's associated - * executor. The function object is queued for execution, and is never called - * from the current thread prior to returning from dispatch(). - * - * This function has the following effects: - * - * @li Constructs a function object handler of type @c Handler, initialized - * with handler(forward(token)). - * - * @li Constructs an object @c result of type async_result, - * initializing the object as result(handler). - * - * @li Obtains the handler's associated executor object @c ex by performing - * get_associated_executor(handler). - * - * @li Obtains the handler's associated allocator object @c alloc by performing - * get_associated_allocator(handler). - * - * @li Performs ex.dispatch(std::move(handler), alloc). - * - * @li Returns result.get(). - */ -template -ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) dispatch( - ASIO_MOVE_ARG(CompletionToken) token); - -/// Submits a completion token or function object for execution. -/** - * This function submits an object for execution using the specified executor. - * The function object is queued for execution, and is never called from the - * current thread prior to returning from dispatch(). - * - * This function has the following effects: - * - * @li Constructs a function object handler of type @c Handler, initialized - * with handler(forward(token)). - * - * @li Constructs an object @c result of type async_result, - * initializing the object as result(handler). - * - * @li Obtains the handler's associated executor object @c ex1 by performing - * get_associated_executor(handler). - * - * @li Creates a work object @c w by performing make_work(ex1). - * - * @li Obtains the handler's associated allocator object @c alloc by performing - * get_associated_allocator(handler). - * - * @li Constructs a function object @c f with a function call operator that - * performs ex1.dispatch(std::move(handler), alloc) followed by - * w.reset(). - * - * @li Performs Executor(ex).dispatch(std::move(f), alloc). - * - * @li Returns result.get(). - */ -template -ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) dispatch( - const Executor& ex, ASIO_MOVE_ARG(CompletionToken) token, - typename enable_if::value>::type* = 0); - -/// Submits a completion token or function object for execution. -/** - * @returns dispatch(ctx.get_executor(), - * forward(token)). - */ -template -ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) dispatch( - ExecutionContext& ctx, ASIO_MOVE_ARG(CompletionToken) token, - typename enable_if::value>::type* = 0); - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/impl/dispatch.hpp" - -#endif // ASIO_DISPATCH_HPP diff --git a/tools/sdk/include/asio/asio/error.hpp b/tools/sdk/include/asio/asio/error.hpp deleted file mode 100644 index 2be9bdeed82..00000000000 --- a/tools/sdk/include/asio/asio/error.hpp +++ /dev/null @@ -1,356 +0,0 @@ -// -// error.hpp -// ~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_ERROR_HPP -#define ASIO_ERROR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/error_code.hpp" -#include "asio/system_error.hpp" -#if defined(ASIO_WINDOWS) \ - || defined(__CYGWIN__) \ - || defined(ASIO_WINDOWS_RUNTIME) -# include -#else -# include -# include -#endif - -#if defined(GENERATING_DOCUMENTATION) -/// INTERNAL ONLY. -# define ASIO_NATIVE_ERROR(e) implementation_defined -/// INTERNAL ONLY. -# define ASIO_SOCKET_ERROR(e) implementation_defined -/// INTERNAL ONLY. -# define ASIO_NETDB_ERROR(e) implementation_defined -/// INTERNAL ONLY. -# define ASIO_GETADDRINFO_ERROR(e) implementation_defined -/// INTERNAL ONLY. -# define ASIO_WIN_OR_POSIX(e_win, e_posix) implementation_defined -#elif defined(ASIO_WINDOWS_RUNTIME) -# define ASIO_NATIVE_ERROR(e) __HRESULT_FROM_WIN32(e) -# define ASIO_SOCKET_ERROR(e) __HRESULT_FROM_WIN32(WSA ## e) -# define ASIO_NETDB_ERROR(e) __HRESULT_FROM_WIN32(WSA ## e) -# define ASIO_GETADDRINFO_ERROR(e) __HRESULT_FROM_WIN32(WSA ## e) -# define ASIO_WIN_OR_POSIX(e_win, e_posix) e_win -#elif defined(ASIO_WINDOWS) || defined(__CYGWIN__) -# define ASIO_NATIVE_ERROR(e) e -# define ASIO_SOCKET_ERROR(e) WSA ## e -# define ASIO_NETDB_ERROR(e) WSA ## e -# define ASIO_GETADDRINFO_ERROR(e) WSA ## e -# define ASIO_WIN_OR_POSIX(e_win, e_posix) e_win -#else -# define ASIO_NATIVE_ERROR(e) e -# define ASIO_SOCKET_ERROR(e) e -# define ASIO_NETDB_ERROR(e) e -# define ASIO_GETADDRINFO_ERROR(e) e -# define ASIO_WIN_OR_POSIX(e_win, e_posix) e_posix -#endif - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace error { - -enum basic_errors -{ - /// Permission denied. - access_denied = ASIO_SOCKET_ERROR(EACCES), - - /// Address family not supported by protocol. - address_family_not_supported = ASIO_SOCKET_ERROR(EAFNOSUPPORT), - - /// Address already in use. - address_in_use = ASIO_SOCKET_ERROR(EADDRINUSE), - - /// Transport endpoint is already connected. - already_connected = ASIO_SOCKET_ERROR(EISCONN), - - /// Operation already in progress. - already_started = ASIO_SOCKET_ERROR(EALREADY), - - /// Broken pipe. - broken_pipe = ASIO_WIN_OR_POSIX( - ASIO_NATIVE_ERROR(ERROR_BROKEN_PIPE), - ASIO_NATIVE_ERROR(EPIPE)), - - /// A connection has been aborted. - connection_aborted = ASIO_SOCKET_ERROR(ECONNABORTED), - - /// Connection refused. - connection_refused = ASIO_SOCKET_ERROR(ECONNREFUSED), - - /// Connection reset by peer. - connection_reset = ASIO_SOCKET_ERROR(ECONNRESET), - - /// Bad file descriptor. - bad_descriptor = ASIO_SOCKET_ERROR(EBADF), - - /// Bad address. - fault = ASIO_SOCKET_ERROR(EFAULT), - - /// No route to host. - host_unreachable = ASIO_SOCKET_ERROR(EHOSTUNREACH), - - /// Operation now in progress. - in_progress = ASIO_SOCKET_ERROR(EINPROGRESS), - - /// Interrupted system call. - interrupted = ASIO_SOCKET_ERROR(EINTR), - - /// Invalid argument. - invalid_argument = ASIO_SOCKET_ERROR(EINVAL), - - /// Message too long. - message_size = ASIO_SOCKET_ERROR(EMSGSIZE), - - /// The name was too long. - name_too_long = ASIO_SOCKET_ERROR(ENAMETOOLONG), - - /// Network is down. - network_down = ASIO_SOCKET_ERROR(ENETDOWN), - - /// Network dropped connection on reset. - network_reset = ASIO_SOCKET_ERROR(ENETRESET), - - /// Network is unreachable. - network_unreachable = ASIO_SOCKET_ERROR(ENETUNREACH), - - /// Too many open files. - no_descriptors = ASIO_SOCKET_ERROR(EMFILE), - - /// No buffer space available. - no_buffer_space = ASIO_SOCKET_ERROR(ENOBUFS), - - /// Cannot allocate memory. - no_memory = ASIO_WIN_OR_POSIX( - ASIO_NATIVE_ERROR(ERROR_OUTOFMEMORY), - ASIO_NATIVE_ERROR(ENOMEM)), - - /// Operation not permitted. - no_permission = ASIO_WIN_OR_POSIX( - ASIO_NATIVE_ERROR(ERROR_ACCESS_DENIED), - ASIO_NATIVE_ERROR(EPERM)), - - /// Protocol not available. - no_protocol_option = ASIO_SOCKET_ERROR(ENOPROTOOPT), - - /// No such device. - no_such_device = ASIO_WIN_OR_POSIX( - ASIO_NATIVE_ERROR(ERROR_BAD_UNIT), - ASIO_NATIVE_ERROR(ENODEV)), - - /// Transport endpoint is not connected. - not_connected = ASIO_SOCKET_ERROR(ENOTCONN), - - /// Socket operation on non-socket. - not_socket = ASIO_SOCKET_ERROR(ENOTSOCK), - - /// Operation cancelled. - operation_aborted = ASIO_WIN_OR_POSIX( - ASIO_NATIVE_ERROR(ERROR_OPERATION_ABORTED), - ASIO_NATIVE_ERROR(ECANCELED)), - - /// Operation not supported. - operation_not_supported = ASIO_SOCKET_ERROR(EOPNOTSUPP), - - /// Cannot send after transport endpoint shutdown. - shut_down = ASIO_SOCKET_ERROR(ESHUTDOWN), - - /// Connection timed out. - timed_out = ASIO_SOCKET_ERROR(ETIMEDOUT), - - /// Resource temporarily unavailable. - try_again = ASIO_WIN_OR_POSIX( - ASIO_NATIVE_ERROR(ERROR_RETRY), - ASIO_NATIVE_ERROR(EAGAIN)), - - /// The socket is marked non-blocking and the requested operation would block. - would_block = ASIO_SOCKET_ERROR(EWOULDBLOCK) -}; - -enum netdb_errors -{ - /// Host not found (authoritative). - host_not_found = ASIO_NETDB_ERROR(HOST_NOT_FOUND), - - /// Host not found (non-authoritative). - host_not_found_try_again = ASIO_NETDB_ERROR(TRY_AGAIN), - - /// The query is valid but does not have associated address data. - no_data = ASIO_NETDB_ERROR(NO_DATA), - - /// A non-recoverable error occurred. - no_recovery = ASIO_NETDB_ERROR(NO_RECOVERY) -}; - -enum addrinfo_errors -{ - /// The service is not supported for the given socket type. - service_not_found = ASIO_WIN_OR_POSIX( - ASIO_NATIVE_ERROR(WSATYPE_NOT_FOUND), - ASIO_GETADDRINFO_ERROR(EAI_SERVICE)), - - /// The socket type is not supported. - socket_type_not_supported = ASIO_WIN_OR_POSIX( - ASIO_NATIVE_ERROR(WSAESOCKTNOSUPPORT), - ASIO_GETADDRINFO_ERROR(EAI_SOCKTYPE)) -}; - -enum misc_errors -{ - /// Already open. - already_open = 1, - - /// End of file or stream. - eof, - - /// Element not found. - not_found, - - /// The descriptor cannot fit into the select system call's fd_set. - fd_set_failure -}; - -inline const asio::error_category& get_system_category() -{ - return asio::system_category(); -} - -#if !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) - -extern ASIO_DECL -const asio::error_category& get_netdb_category(); - -extern ASIO_DECL -const asio::error_category& get_addrinfo_category(); - -#else // !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) - -inline const asio::error_category& get_netdb_category() -{ - return get_system_category(); -} - -inline const asio::error_category& get_addrinfo_category() -{ - return get_system_category(); -} - -#endif // !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) - -extern ASIO_DECL -const asio::error_category& get_misc_category(); - -static const asio::error_category& - system_category ASIO_UNUSED_VARIABLE - = asio::error::get_system_category(); -static const asio::error_category& - netdb_category ASIO_UNUSED_VARIABLE - = asio::error::get_netdb_category(); -static const asio::error_category& - addrinfo_category ASIO_UNUSED_VARIABLE - = asio::error::get_addrinfo_category(); -static const asio::error_category& - misc_category ASIO_UNUSED_VARIABLE - = asio::error::get_misc_category(); - -} // namespace error -} // namespace asio - -#if defined(ASIO_HAS_STD_SYSTEM_ERROR) -namespace std { - -template<> struct is_error_code_enum -{ - static const bool value = true; -}; - -template<> struct is_error_code_enum -{ - static const bool value = true; -}; - -template<> struct is_error_code_enum -{ - static const bool value = true; -}; - -template<> struct is_error_code_enum -{ - static const bool value = true; -}; - -} // namespace std -#endif // defined(ASIO_HAS_STD_SYSTEM_ERROR) - -namespace asio { -namespace error { - -inline asio::error_code make_error_code(basic_errors e) -{ - return asio::error_code( - static_cast(e), get_system_category()); -} - -inline asio::error_code make_error_code(netdb_errors e) -{ - return asio::error_code( - static_cast(e), get_netdb_category()); -} - -inline asio::error_code make_error_code(addrinfo_errors e) -{ - return asio::error_code( - static_cast(e), get_addrinfo_category()); -} - -inline asio::error_code make_error_code(misc_errors e) -{ - return asio::error_code( - static_cast(e), get_misc_category()); -} - -} // namespace error -namespace stream_errc { - // Simulates the proposed stream_errc scoped enum. - using error::eof; - using error::not_found; -} // namespace stream_errc -namespace socket_errc { - // Simulates the proposed socket_errc scoped enum. - using error::already_open; - using error::not_found; -} // namespace socket_errc -namespace resolver_errc { - // Simulates the proposed resolver_errc scoped enum. - using error::host_not_found; - const error::netdb_errors try_again = error::host_not_found_try_again; - using error::service_not_found; -} // namespace resolver_errc -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#undef ASIO_NATIVE_ERROR -#undef ASIO_SOCKET_ERROR -#undef ASIO_NETDB_ERROR -#undef ASIO_GETADDRINFO_ERROR -#undef ASIO_WIN_OR_POSIX - -#if defined(ASIO_HEADER_ONLY) -# include "asio/impl/error.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_ERROR_HPP diff --git a/tools/sdk/include/asio/asio/error_code.hpp b/tools/sdk/include/asio/asio/error_code.hpp deleted file mode 100644 index 042ab85388b..00000000000 --- a/tools/sdk/include/asio/asio/error_code.hpp +++ /dev/null @@ -1,206 +0,0 @@ -// -// error_code.hpp -// ~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_ERROR_CODE_HPP -#define ASIO_ERROR_CODE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#ifdef ESP_PLATFORM -# include "lwip/sockets.h" -#endif - -#if defined(ASIO_HAS_STD_SYSTEM_ERROR) -# include -#else // defined(ASIO_HAS_STD_SYSTEM_ERROR) -# include -# include "asio/detail/noncopyable.hpp" -# if !defined(ASIO_NO_IOSTREAM) -# include -# endif // !defined(ASIO_NO_IOSTREAM) -#endif // defined(ASIO_HAS_STD_SYSTEM_ERROR) - -#include "asio/detail/push_options.hpp" - -namespace asio { - -#if defined(ASIO_HAS_STD_SYSTEM_ERROR) - -typedef std::error_category error_category; - -#else // defined(ASIO_HAS_STD_SYSTEM_ERROR) - -/// Base class for all error categories. -class error_category : private noncopyable -{ -public: - /// Destructor. - virtual ~error_category() - { - } - - /// Returns a string naming the error gategory. - virtual const char* name() const = 0; - - /// Returns a string describing the error denoted by @c value. - virtual std::string message(int value) const = 0; - - /// Equality operator to compare two error categories. - bool operator==(const error_category& rhs) const - { - return this == &rhs; - } - - /// Inequality operator to compare two error categories. - bool operator!=(const error_category& rhs) const - { - return !(*this == rhs); - } -}; - -#endif // defined(ASIO_HAS_STD_SYSTEM_ERROR) - -/// Returns the error category used for the system errors produced by asio. -extern ASIO_DECL const error_category& system_category(); - -#if defined(ASIO_HAS_STD_SYSTEM_ERROR) - -typedef std::error_code error_code; - -#else // defined(ASIO_HAS_STD_SYSTEM_ERROR) - -/// Class to represent an error code value. -class error_code -{ -public: - /// Default constructor. - error_code() - : value_(0), - category_(&system_category()) - { - } - - /// Construct with specific error code and category. - error_code(int v, const error_category& c) - : value_(v), - category_(&c) - { - } - - /// Construct from an error code enum. - template - error_code(ErrorEnum e) - { - *this = make_error_code(e); - } - - /// Clear the error value to the default. - void clear() - { - value_ = 0; - category_ = &system_category(); - } - - /// Assign a new error value. - void assign(int v, const error_category& c) - { - value_ = v; - category_ = &c; - } - - /// Get the error value. - int value() const - { - return value_; - } - - /// Get the error category. - const error_category& category() const - { - return *category_; - } - - /// Get the message associated with the error. - std::string message() const - { - return category_->message(value_); - } - - struct unspecified_bool_type_t - { - }; - - typedef void (*unspecified_bool_type)(unspecified_bool_type_t); - - static void unspecified_bool_true(unspecified_bool_type_t) {} - - /// Operator returns non-null if there is a non-success error code. - operator unspecified_bool_type() const - { - if (value_ == 0) - return 0; - else - return &error_code::unspecified_bool_true; - } - - /// Operator to test if the error represents success. - bool operator!() const - { - return value_ == 0; - } - - /// Equality operator to compare two error objects. - friend bool operator==(const error_code& e1, const error_code& e2) - { - return e1.value_ == e2.value_ && e1.category_ == e2.category_; - } - - /// Inequality operator to compare two error objects. - friend bool operator!=(const error_code& e1, const error_code& e2) - { - return e1.value_ != e2.value_ || e1.category_ != e2.category_; - } - -private: - // The value associated with the error code. - int value_; - - // The category associated with the error code. - const error_category* category_; -}; - -# if !defined(ASIO_NO_IOSTREAM) - -/// Output an error code. -template -std::basic_ostream& operator<<( - std::basic_ostream& os, const error_code& ec) -{ - os << ec.category().name() << ':' << ec.value(); - return os; -} - -# endif // !defined(ASIO_NO_IOSTREAM) - -#endif // defined(ASIO_HAS_STD_SYSTEM_ERROR) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/impl/error_code.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_ERROR_CODE_HPP diff --git a/tools/sdk/include/asio/asio/execution_context.hpp b/tools/sdk/include/asio/asio/execution_context.hpp deleted file mode 100644 index 1476d19b5b4..00000000000 --- a/tools/sdk/include/asio/asio/execution_context.hpp +++ /dev/null @@ -1,411 +0,0 @@ -// -// execution_context.hpp -// ~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_EXECUTION_CONTEXT_HPP -#define ASIO_EXECUTION_CONTEXT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include -#include -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/variadic_templates.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -class execution_context; -class io_context; - -#if !defined(GENERATING_DOCUMENTATION) -template Service& use_service(execution_context&); -template Service& use_service(io_context&); -template void add_service(execution_context&, Service*); -template bool has_service(execution_context&); -#endif // !defined(GENERATING_DOCUMENTATION) - -namespace detail { class service_registry; } - -/// A context for function object execution. -/** - * An execution context represents a place where function objects will be - * executed. An @c io_context is an example of an execution context. - * - * @par The execution_context class and services - * - * Class execution_context implements an extensible, type-safe, polymorphic set - * of services, indexed by service type. - * - * Services exist to manage the resources that are shared across an execution - * context. For example, timers may be implemented in terms of a single timer - * queue, and this queue would be stored in a service. - * - * Access to the services of an execution_context is via three function - * templates, use_service(), add_service() and has_service(). - * - * In a call to @c use_service(), the type argument chooses a service, - * making available all members of the named type. If @c Service is not present - * in an execution_context, an object of type @c Service is created and added - * to the execution_context. A C++ program can check if an execution_context - * implements a particular service with the function template @c - * has_service(). - * - * Service objects may be explicitly added to an execution_context using the - * function template @c add_service(). If the @c Service is already - * present, the service_already_exists exception is thrown. If the owner of the - * service is not the same object as the execution_context parameter, the - * invalid_service_owner exception is thrown. - * - * Once a service reference is obtained from an execution_context object by - * calling use_service(), that reference remains usable as long as the owning - * execution_context object exists. - * - * All service implementations have execution_context::service as a public base - * class. Custom services may be implemented by deriving from this class and - * then added to an execution_context using the facilities described above. - * - * @par The execution_context as a base class - * - * Class execution_context may be used only as a base class for concrete - * execution context types. The @c io_context is an example of such a derived - * type. - * - * On destruction, a class that is derived from execution_context must perform - * execution_context::shutdown() followed by - * execution_context::destroy(). - * - * This destruction sequence permits programs to simplify their resource - * management by using @c shared_ptr<>. Where an object's lifetime is tied to - * the lifetime of a connection (or some other sequence of asynchronous - * operations), a @c shared_ptr to the object would be bound into the handlers - * for all asynchronous operations associated with it. This works as follows: - * - * @li When a single connection ends, all associated asynchronous operations - * complete. The corresponding handler objects are destroyed, and all @c - * shared_ptr references to the objects are destroyed. - * - * @li To shut down the whole program, the io_context function stop() is called - * to terminate any run() calls as soon as possible. The io_context destructor - * calls @c shutdown() and @c destroy() to destroy all pending handlers, - * causing all @c shared_ptr references to all connection objects to be - * destroyed. - */ -class execution_context - : private noncopyable -{ -public: - class id; - class service; - -protected: - /// Constructor. - ASIO_DECL execution_context(); - - /// Destructor. - ASIO_DECL ~execution_context(); - - /// Shuts down all services in the context. - /** - * This function is implemented as follows: - * - * @li For each service object @c svc in the execution_context set, in - * reverse order of the beginning of service object lifetime, performs @c - * svc->shutdown(). - */ - ASIO_DECL void shutdown(); - - /// Destroys all services in the context. - /** - * This function is implemented as follows: - * - * @li For each service object @c svc in the execution_context set, in - * reverse order * of the beginning of service object lifetime, performs - * delete static_cast(svc). - */ - ASIO_DECL void destroy(); - -public: - /// Fork-related event notifications. - enum fork_event - { - /// Notify the context that the process is about to fork. - fork_prepare, - - /// Notify the context that the process has forked and is the parent. - fork_parent, - - /// Notify the context that the process has forked and is the child. - fork_child - }; - - /// Notify the execution_context of a fork-related event. - /** - * This function is used to inform the execution_context that the process is - * about to fork, or has just forked. This allows the execution_context, and - * the services it contains, to perform any necessary housekeeping to ensure - * correct operation following a fork. - * - * This function must not be called while any other execution_context - * function, or any function associated with the execution_context's derived - * class, is being called in another thread. It is, however, safe to call - * this function from within a completion handler, provided no other thread - * is accessing the execution_context or its derived class. - * - * @param event A fork-related event. - * - * @throws asio::system_error Thrown on failure. If the notification - * fails the execution_context object should no longer be used and should be - * destroyed. - * - * @par Example - * The following code illustrates how to incorporate the notify_fork() - * function: - * @code my_execution_context.notify_fork(execution_context::fork_prepare); - * if (fork() == 0) - * { - * // This is the child process. - * my_execution_context.notify_fork(execution_context::fork_child); - * } - * else - * { - * // This is the parent process. - * my_execution_context.notify_fork(execution_context::fork_parent); - * } @endcode - * - * @note For each service object @c svc in the execution_context set, - * performs svc->notify_fork();. When processing the fork_prepare - * event, services are visited in reverse order of the beginning of service - * object lifetime. Otherwise, services are visited in order of the beginning - * of service object lifetime. - */ - ASIO_DECL void notify_fork(fork_event event); - - /// Obtain the service object corresponding to the given type. - /** - * This function is used to locate a service object that corresponds to the - * given service type. If there is no existing implementation of the service, - * then the execution_context will create a new instance of the service. - * - * @param e The execution_context object that owns the service. - * - * @return The service interface implementing the specified service type. - * Ownership of the service interface is not transferred to the caller. - */ - template - friend Service& use_service(execution_context& e); - - /// Obtain the service object corresponding to the given type. - /** - * This function is used to locate a service object that corresponds to the - * given service type. If there is no existing implementation of the service, - * then the io_context will create a new instance of the service. - * - * @param ioc The io_context object that owns the service. - * - * @return The service interface implementing the specified service type. - * Ownership of the service interface is not transferred to the caller. - * - * @note This overload is preserved for backwards compatibility with services - * that inherit from io_context::service. - */ - template - friend Service& use_service(io_context& ioc); - -#if defined(GENERATING_DOCUMENTATION) - - /// Creates a service object and adds it to the execution_context. - /** - * This function is used to add a service to the execution_context. - * - * @param e The execution_context object that owns the service. - * - * @param args Zero or more arguments to be passed to the service - * constructor. - * - * @throws asio::service_already_exists Thrown if a service of the - * given type is already present in the execution_context. - */ - template - friend Service& make_service(execution_context& e, Args&&... args); - -#elif defined(ASIO_HAS_VARIADIC_TEMPLATES) - - template - friend Service& make_service(execution_context& e, - ASIO_MOVE_ARG(Args)... args); - -#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) - - template - friend Service& make_service(execution_context& e); - -#define ASIO_PRIVATE_MAKE_SERVICE_DEF(n) \ - template \ - friend Service& make_service(execution_context& e, \ - ASIO_VARIADIC_MOVE_PARAMS(n)); \ - /**/ - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_MAKE_SERVICE_DEF) -#undef ASIO_PRIVATE_MAKE_SERVICE_DEF - -#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) - - /// (Deprecated: Use make_service().) Add a service object to the - /// execution_context. - /** - * This function is used to add a service to the execution_context. - * - * @param e The execution_context object that owns the service. - * - * @param svc The service object. On success, ownership of the service object - * is transferred to the execution_context. When the execution_context object - * is destroyed, it will destroy the service object by performing: @code - * delete static_cast(svc) @endcode - * - * @throws asio::service_already_exists Thrown if a service of the - * given type is already present in the execution_context. - * - * @throws asio::invalid_service_owner Thrown if the service's owning - * execution_context is not the execution_context object specified by the - * @c e parameter. - */ - template - friend void add_service(execution_context& e, Service* svc); - - /// Determine if an execution_context contains a specified service type. - /** - * This function is used to determine whether the execution_context contains a - * service object corresponding to the given service type. - * - * @param e The execution_context object that owns the service. - * - * @return A boolean indicating whether the execution_context contains the - * service. - */ - template - friend bool has_service(execution_context& e); - -private: - // The service registry. - asio::detail::service_registry* service_registry_; -}; - -/// Class used to uniquely identify a service. -class execution_context::id - : private noncopyable -{ -public: - /// Constructor. - id() {} -}; - -/// Base class for all io_context services. -class execution_context::service - : private noncopyable -{ -public: - /// Get the context object that owns the service. - execution_context& context(); - -protected: - /// Constructor. - /** - * @param owner The execution_context object that owns the service. - */ - ASIO_DECL service(execution_context& owner); - - /// Destructor. - ASIO_DECL virtual ~service(); - -private: - /// Destroy all user-defined handler objects owned by the service. - virtual void shutdown() = 0; - - /// Handle notification of a fork-related event to perform any necessary - /// housekeeping. - /** - * This function is not a pure virtual so that services only have to - * implement it if necessary. The default implementation does nothing. - */ - ASIO_DECL virtual void notify_fork( - execution_context::fork_event event); - - friend class asio::detail::service_registry; - struct key - { - key() : type_info_(0), id_(0) {} - const std::type_info* type_info_; - const execution_context::id* id_; - } key_; - - execution_context& owner_; - service* next_; -}; - -/// Exception thrown when trying to add a duplicate service to an -/// execution_context. -class service_already_exists - : public std::logic_error -{ -public: - ASIO_DECL service_already_exists(); -}; - -/// Exception thrown when trying to add a service object to an -/// execution_context where the service has a different owner. -class invalid_service_owner - : public std::logic_error -{ -public: - ASIO_DECL invalid_service_owner(); -}; - -namespace detail { - -// Special derived service id type to keep classes header-file only. -template -class service_id - : public execution_context::id -{ -}; - -// Special service base class to keep classes header-file only. -template -class execution_context_service_base - : public execution_context::service -{ -public: - static service_id id; - - // Constructor. - execution_context_service_base(execution_context& e) - : execution_context::service(e) - { - } -}; - -template -service_id execution_context_service_base::id; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/impl/execution_context.hpp" -#if defined(ASIO_HEADER_ONLY) -# include "asio/impl/execution_context.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_EXECUTION_CONTEXT_HPP diff --git a/tools/sdk/include/asio/asio/executor.hpp b/tools/sdk/include/asio/asio/executor.hpp deleted file mode 100644 index e552cfbf2e3..00000000000 --- a/tools/sdk/include/asio/asio/executor.hpp +++ /dev/null @@ -1,341 +0,0 @@ -// -// executor.hpp -// ~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_EXECUTOR_HPP -#define ASIO_EXECUTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/detail/cstddef.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/throw_exception.hpp" -#include "asio/execution_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Exception thrown when trying to access an empty polymorphic executor. -class bad_executor - : public std::exception -{ -public: - /// Constructor. - ASIO_DECL bad_executor() ASIO_NOEXCEPT; - - /// Obtain message associated with exception. - ASIO_DECL virtual const char* what() const - ASIO_NOEXCEPT_OR_NOTHROW; -}; - -/// Polymorphic wrapper for executors. -class executor -{ -public: - /// Default constructor. - executor() ASIO_NOEXCEPT - : impl_(0) - { - } - - /// Construct from nullptr. - executor(nullptr_t) ASIO_NOEXCEPT - : impl_(0) - { - } - - /// Copy constructor. - executor(const executor& other) ASIO_NOEXCEPT - : impl_(other.clone()) - { - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move constructor. - executor(executor&& other) ASIO_NOEXCEPT - : impl_(other.impl_) - { - other.impl_ = 0; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Construct a polymorphic wrapper for the specified executor. - template - executor(Executor e); - - /// Allocator-aware constructor to create a polymorphic wrapper for the - /// specified executor. - template - executor(allocator_arg_t, const Allocator& a, Executor e); - - /// Destructor. - ~executor() - { - destroy(); - } - - /// Assignment operator. - executor& operator=(const executor& other) ASIO_NOEXCEPT - { - destroy(); - impl_ = other.clone(); - return *this; - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - // Move assignment operator. - executor& operator=(executor&& other) ASIO_NOEXCEPT - { - destroy(); - impl_ = other.impl_; - other.impl_ = 0; - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Assignment operator for nullptr_t. - executor& operator=(nullptr_t) ASIO_NOEXCEPT - { - destroy(); - impl_ = 0; - return *this; - } - - /// Assignment operator to create a polymorphic wrapper for the specified - /// executor. - template - executor& operator=(ASIO_MOVE_ARG(Executor) e) ASIO_NOEXCEPT - { - executor tmp(ASIO_MOVE_CAST(Executor)(e)); - destroy(); - impl_ = tmp.impl_; - tmp.impl_ = 0; - return *this; - } - - /// Obtain the underlying execution context. - execution_context& context() const ASIO_NOEXCEPT - { - return get_impl()->context(); - } - - /// Inform the executor that it has some outstanding work to do. - void on_work_started() const ASIO_NOEXCEPT - { - get_impl()->on_work_started(); - } - - /// Inform the executor that some work is no longer outstanding. - void on_work_finished() const ASIO_NOEXCEPT - { - get_impl()->on_work_finished(); - } - - /// Request the executor to invoke the given function object. - /** - * This function is used to ask the executor to execute the given function - * object. The function object is executed according to the rules of the - * target executor object. - * - * @param f The function object to be called. The executor will make a copy - * of the handler object as required. The function signature of the function - * object must be: @code void function(); @endcode - * - * @param a An allocator that may be used by the executor to allocate the - * internal storage needed for function invocation. - */ - template - void dispatch(ASIO_MOVE_ARG(Function) f, const Allocator& a) const; - - /// Request the executor to invoke the given function object. - /** - * This function is used to ask the executor to execute the given function - * object. The function object is executed according to the rules of the - * target executor object. - * - * @param f The function object to be called. The executor will make - * a copy of the handler object as required. The function signature of the - * function object must be: @code void function(); @endcode - * - * @param a An allocator that may be used by the executor to allocate the - * internal storage needed for function invocation. - */ - template - void post(ASIO_MOVE_ARG(Function) f, const Allocator& a) const; - - /// Request the executor to invoke the given function object. - /** - * This function is used to ask the executor to execute the given function - * object. The function object is executed according to the rules of the - * target executor object. - * - * @param f The function object to be called. The executor will make - * a copy of the handler object as required. The function signature of the - * function object must be: @code void function(); @endcode - * - * @param a An allocator that may be used by the executor to allocate the - * internal storage needed for function invocation. - */ - template - void defer(ASIO_MOVE_ARG(Function) f, const Allocator& a) const; - - struct unspecified_bool_type_t {}; - typedef void (*unspecified_bool_type)(unspecified_bool_type_t); - static void unspecified_bool_true(unspecified_bool_type_t) {} - - /// Operator to test if the executor contains a valid target. - operator unspecified_bool_type() const ASIO_NOEXCEPT - { - return impl_ ? &executor::unspecified_bool_true : 0; - } - - /// Obtain type information for the target executor object. - /** - * @returns If @c *this has a target type of type @c T, typeid(T); - * otherwise, typeid(void). - */ -#if !defined(ASIO_NO_TYPEID) || defined(GENERATING_DOCUMENTATION) - const std::type_info& target_type() const ASIO_NOEXCEPT - { - return impl_ ? impl_->target_type() : typeid(void); - } -#else // !defined(ASIO_NO_TYPEID) || defined(GENERATING_DOCUMENTATION) - const void* target_type() const ASIO_NOEXCEPT - { - return impl_ ? impl_->target_type() : 0; - } -#endif // !defined(ASIO_NO_TYPEID) || defined(GENERATING_DOCUMENTATION) - - /// Obtain a pointer to the target executor object. - /** - * @returns If target_type() == typeid(T), a pointer to the stored - * executor target; otherwise, a null pointer. - */ - template - Executor* target() ASIO_NOEXCEPT; - - /// Obtain a pointer to the target executor object. - /** - * @returns If target_type() == typeid(T), a pointer to the stored - * executor target; otherwise, a null pointer. - */ - template - const Executor* target() const ASIO_NOEXCEPT; - - /// Compare two executors for equality. - friend bool operator==(const executor& a, - const executor& b) ASIO_NOEXCEPT - { - if (a.impl_ == b.impl_) - return true; - if (!a.impl_ || !b.impl_) - return false; - return a.impl_->equals(b.impl_); - } - - /// Compare two executors for inequality. - friend bool operator!=(const executor& a, - const executor& b) ASIO_NOEXCEPT - { - return !(a == b); - } - -private: -#if !defined(GENERATING_DOCUMENTATION) - class function; - template class impl; - -#if !defined(ASIO_NO_TYPEID) - typedef const std::type_info& type_id_result_type; -#else // !defined(ASIO_NO_TYPEID) - typedef const void* type_id_result_type; -#endif // !defined(ASIO_NO_TYPEID) - - template - static type_id_result_type type_id() - { -#if !defined(ASIO_NO_TYPEID) - return typeid(T); -#else // !defined(ASIO_NO_TYPEID) - static int unique_id; - return &unique_id; -#endif // !defined(ASIO_NO_TYPEID) - } - - // Base class for all polymorphic executor implementations. - class impl_base - { - public: - virtual impl_base* clone() const ASIO_NOEXCEPT = 0; - virtual void destroy() ASIO_NOEXCEPT = 0; - virtual execution_context& context() ASIO_NOEXCEPT = 0; - virtual void on_work_started() ASIO_NOEXCEPT = 0; - virtual void on_work_finished() ASIO_NOEXCEPT = 0; - virtual void dispatch(ASIO_MOVE_ARG(function)) = 0; - virtual void post(ASIO_MOVE_ARG(function)) = 0; - virtual void defer(ASIO_MOVE_ARG(function)) = 0; - virtual type_id_result_type target_type() const ASIO_NOEXCEPT = 0; - virtual void* target() ASIO_NOEXCEPT = 0; - virtual const void* target() const ASIO_NOEXCEPT = 0; - virtual bool equals(const impl_base* e) const ASIO_NOEXCEPT = 0; - - protected: - impl_base(bool fast_dispatch) : fast_dispatch_(fast_dispatch) {} - virtual ~impl_base() {} - - private: - friend class executor; - const bool fast_dispatch_; - }; - - // Helper function to check and return the implementation pointer. - impl_base* get_impl() const - { - if (!impl_) - { - bad_executor ex; - asio::detail::throw_exception(ex); - } - return impl_; - } - - // Helper function to clone another implementation. - impl_base* clone() const ASIO_NOEXCEPT - { - return impl_ ? impl_->clone() : 0; - } - - // Helper function to destroy an implementation. - void destroy() ASIO_NOEXCEPT - { - if (impl_) - impl_->destroy(); - } - - impl_base* impl_; -#endif // !defined(GENERATING_DOCUMENTATION) -}; - -} // namespace asio - -ASIO_USES_ALLOCATOR(asio::executor) - -#include "asio/detail/pop_options.hpp" - -#include "asio/impl/executor.hpp" -#if defined(ASIO_HEADER_ONLY) -# include "asio/impl/executor.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_EXECUTOR_HPP diff --git a/tools/sdk/include/asio/asio/executor_work_guard.hpp b/tools/sdk/include/asio/asio/executor_work_guard.hpp deleted file mode 100644 index 1875f542b21..00000000000 --- a/tools/sdk/include/asio/asio/executor_work_guard.hpp +++ /dev/null @@ -1,170 +0,0 @@ -// -// executor_work_guard.hpp -// ~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_EXECUTOR_WORK_GUARD_HPP -#define ASIO_EXECUTOR_WORK_GUARD_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/associated_executor.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/is_executor.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// An object of type @c executor_work_guard controls ownership of executor work -/// within a scope. -template -class executor_work_guard -{ -public: - /// The underlying executor type. - typedef Executor executor_type; - - /// Constructs a @c executor_work_guard object for the specified executor. - /** - * Stores a copy of @c e and calls on_work_started() on it. - */ - explicit executor_work_guard(const executor_type& e) ASIO_NOEXCEPT - : executor_(e), - owns_(true) - { - executor_.on_work_started(); - } - - /// Copy constructor. - executor_work_guard(const executor_work_guard& other) ASIO_NOEXCEPT - : executor_(other.executor_), - owns_(other.owns_) - { - if (owns_) - executor_.on_work_started(); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move constructor. - executor_work_guard(executor_work_guard&& other) - : executor_(ASIO_MOVE_CAST(Executor)(other.executor_)), - owns_(other.owns_) - { - other.owns_ = false; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destructor. - /** - * Unless the object has already been reset, or is in a moved-from state, - * calls on_work_finished() on the stored executor. - */ - ~executor_work_guard() - { - if (owns_) - executor_.on_work_finished(); - } - - /// Obtain the associated executor. - executor_type get_executor() const ASIO_NOEXCEPT - { - return executor_; - } - - /// Whether the executor_work_guard object owns some outstanding work. - bool owns_work() const ASIO_NOEXCEPT - { - return owns_; - } - - /// Indicate that the work is no longer outstanding. - /* - * Unless the object has already been reset, or is in a moved-from state, - * calls on_work_finished() on the stored executor. - */ - void reset() ASIO_NOEXCEPT - { - if (owns_) - { - executor_.on_work_finished(); - owns_ = false; - } - } - -private: - // Disallow assignment. - executor_work_guard& operator=(const executor_work_guard&); - - executor_type executor_; - bool owns_; -}; - -/// Create an @ref executor_work_guard object. -template -inline executor_work_guard make_work_guard(const Executor& ex, - typename enable_if::value>::type* = 0) -{ - return executor_work_guard(ex); -} - -/// Create an @ref executor_work_guard object. -template -inline executor_work_guard -make_work_guard(ExecutionContext& ctx, - typename enable_if< - is_convertible::value>::type* = 0) -{ - return executor_work_guard( - ctx.get_executor()); -} - -/// Create an @ref executor_work_guard object. -template -inline executor_work_guard::type> -make_work_guard(const T& t, - typename enable_if::value && - !is_convertible::value>::type* = 0) -{ - return executor_work_guard::type>( - associated_executor::get(t)); -} - -/// Create an @ref executor_work_guard object. -template -inline executor_work_guard::type> -make_work_guard(const T& t, const Executor& ex, - typename enable_if::value>::type* = 0) -{ - return executor_work_guard::type>( - associated_executor::get(t, ex)); -} - -/// Create an @ref executor_work_guard object. -template -inline executor_work_guard::type> -make_work_guard(const T& t, ExecutionContext& ctx, - typename enable_if::value && - !is_convertible::value && - is_convertible::value>::type* = 0) -{ - return executor_work_guard::type>( - associated_executor::get( - t, ctx.get_executor())); -} - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_EXECUTOR_WORK_GUARD_HPP diff --git a/tools/sdk/include/asio/asio/experimental.hpp b/tools/sdk/include/asio/asio/experimental.hpp deleted file mode 100644 index 5765c37d0ee..00000000000 --- a/tools/sdk/include/asio/asio/experimental.hpp +++ /dev/null @@ -1,22 +0,0 @@ -// -// experimental.hpp -// ~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_EXPERIMENTAL_HPP -#define ASIO_EXPERIMENTAL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/experimental/co_spawn.hpp" -#include "asio/experimental/detached.hpp" -#include "asio/experimental/redirect_error.hpp" - -#endif // ASIO_EXPERIMENTAL_HPP diff --git a/tools/sdk/include/asio/asio/experimental/co_spawn.hpp b/tools/sdk/include/asio/asio/experimental/co_spawn.hpp deleted file mode 100644 index cbf5bc525e1..00000000000 --- a/tools/sdk/include/asio/asio/experimental/co_spawn.hpp +++ /dev/null @@ -1,226 +0,0 @@ -// -// experimental/co_spawn.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_EXPERIMENTAL_CO_SPAWN_HPP -#define ASIO_EXPERIMENTAL_CO_SPAWN_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_CO_AWAIT) || defined(GENERATING_DOCUMENTATION) - -#include -#include "asio/executor.hpp" -#include "asio/strand.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace experimental { -namespace detail { - -using std::experimental::coroutine_handle; - -template class awaiter; -template class awaitee_base; -template class awaitee; -template class await_handler_base; -template -auto co_spawn(const Executor& ex, F&& f, CompletionToken&& token); - -} // namespace detail - -namespace this_coro { - -/// Awaitable type that returns a completion token for the current coroutine. -struct token_t {}; - -/// Awaitable object that returns a completion token for the current coroutine. -constexpr inline token_t token() { return {}; } - -/// Awaitable type that returns the executor of the current coroutine. -struct executor_t {}; - -/// Awaitable object that returns the executor of the current coroutine. -constexpr inline executor_t executor() { return {}; } - -} // namespace this_coro - -/// A completion token that represents the currently executing coroutine. -/** - * The await_token class is used to represent the currently executing - * coroutine. An await_token may be passed as a handler to an asynchronous - * operation. For example: - * - * @code awaitable my_coroutine() - * { - * await_token token = co_await this_coro::token(); - * ... - * std::size_t n = co_await my_socket.async_read_some(buffer, token); - * ... - * } @endcode - * - * The initiating function (async_read_some in the above example) suspends the - * current coroutine. The coroutine is resumed when the asynchronous operation - * completes, and the result of the operation is returned. - */ -template -class await_token -{ -public: - /// The associated executor type. - typedef Executor executor_type; - - /// Copy constructor. - await_token(const await_token& other) noexcept - : awaiter_(other.awaiter_) - { - } - - /// Move constructor. - await_token(await_token&& other) noexcept - : awaiter_(std::exchange(other.awaiter_, nullptr)) - { - } - - /// Get the associated executor. - executor_type get_executor() const noexcept - { - return awaiter_->get_executor(); - } - -private: - // No assignment allowed. - await_token& operator=(const await_token&) = delete; - - template friend class detail::awaitee_base; - template friend class detail::await_handler_base; - - // Private constructor used by awaitee_base. - explicit await_token(detail::awaiter* a) - : awaiter_(a) - { - } - - detail::awaiter* awaiter_; -}; - -/// The return type of a coroutine or asynchronous operation. -template > -class awaitable -{ -public: - /// The type of the awaited value. - typedef T value_type; - - /// The executor type that will be used for the coroutine. - typedef Executor executor_type; - - /// Move constructor. - awaitable(awaitable&& other) noexcept - : awaitee_(std::exchange(other.awaitee_, nullptr)) - { - } - - /// Destructor - ~awaitable() - { - if (awaitee_) - { - detail::coroutine_handle< - detail::awaitee>::from_promise( - *awaitee_).destroy(); - } - } - -#if !defined(GENERATING_DOCUMENTATION) - - // Support for co_await keyword. - bool await_ready() const noexcept - { - return awaitee_->ready(); - } - - // Support for co_await keyword. - void await_suspend(detail::coroutine_handle> h) - { - awaitee_->attach_caller(h); - } - - // Support for co_await keyword. - template - void await_suspend(detail::coroutine_handle> h) - { - awaitee_->attach_caller(h); - } - - // Support for co_await keyword. - T await_resume() - { - return awaitee_->get(); - } - -#endif // !defined(GENERATING_DOCUMENTATION) - -private: - template friend class detail::awaitee; - template friend class detail::await_handler_base; - - // Not copy constructible or copy assignable. - awaitable(const awaitable&) = delete; - awaitable& operator=(const awaitable&) = delete; - - // Construct the awaitable from a coroutine's promise object. - explicit awaitable(detail::awaitee* a) : awaitee_(a) {} - - detail::awaitee* awaitee_; -}; - -/// Spawn a new thread of execution. -template ::value>::type> -inline auto co_spawn(const Executor& ex, F&& f, CompletionToken&& token) -{ - return detail::co_spawn(ex, std::forward(f), - std::forward(token)); -} - -/// Spawn a new thread of execution. -template ::value>::type> -inline auto co_spawn(ExecutionContext& ctx, F&& f, CompletionToken&& token) -{ - return detail::co_spawn(ctx.get_executor(), std::forward(f), - std::forward(token)); -} - -/// Spawn a new thread of execution. -template -inline auto co_spawn(const await_token& parent, - F&& f, CompletionToken&& token) -{ - return detail::co_spawn(parent.get_executor(), std::forward(f), - std::forward(token)); -} - -} // namespace experimental -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/experimental/impl/co_spawn.hpp" - -#endif // defined(ASIO_HAS_CO_AWAIT) || defined(GENERATING_DOCUMENTATION) - -#endif // ASIO_EXPERIMENTAL_CO_SPAWN_HPP diff --git a/tools/sdk/include/asio/asio/experimental/detached.hpp b/tools/sdk/include/asio/asio/experimental/detached.hpp deleted file mode 100644 index d484f18fbaf..00000000000 --- a/tools/sdk/include/asio/asio/experimental/detached.hpp +++ /dev/null @@ -1,65 +0,0 @@ -// -// experimental/detached.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_EXPERIMENTAL_DETACHED_HPP -#define ASIO_EXPERIMENTAL_DETACHED_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace experimental { - -/// Class used to specify that an asynchronous operation is detached. -/** - - * The detached_t class is used to indicate that an asynchronous operation is - * detached. That is, there is no completion handler waiting for the - * operation's result. A detached_t object may be passed as a handler to an - * asynchronous operation, typically using the special value - * @c asio::experimental::detached. For example: - - * @code my_socket.async_send(my_buffer, asio::experimental::detached); - * @endcode - */ -class detached_t -{ -public: - /// Constructor. - ASIO_CONSTEXPR detached_t() - { - } -}; - -/// A special value, similar to std::nothrow. -/** - * See the documentation for asio::experimental::detached_t for a usage - * example. - */ -#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) -constexpr detached_t detached; -#elif defined(ASIO_MSVC) -__declspec(selectany) detached_t detached; -#endif - -} // namespace experimental -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/experimental/impl/detached.hpp" - -#endif // ASIO_EXPERIMENTAL_DETACHED_HPP diff --git a/tools/sdk/include/asio/asio/experimental/impl/co_spawn.hpp b/tools/sdk/include/asio/asio/experimental/impl/co_spawn.hpp deleted file mode 100644 index 8263eff96a5..00000000000 --- a/tools/sdk/include/asio/asio/experimental/impl/co_spawn.hpp +++ /dev/null @@ -1,876 +0,0 @@ -// -// experimental/impl/co_spawn.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_EXPERIMENTAL_IMPL_CO_SPAWN_HPP -#define ASIO_EXPERIMENTAL_IMPL_CO_SPAWN_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include -#include -#include -#include -#include -#include "asio/async_result.hpp" -#include "asio/detail/thread_context.hpp" -#include "asio/detail/thread_info_base.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/dispatch.hpp" -#include "asio/post.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace experimental { -namespace detail { - -// Promise object for coroutine at top of thread-of-execution "stack". -template -class awaiter -{ -public: - struct deleter - { - void operator()(awaiter* a) - { - if (a) - a->release(); - } - }; - - typedef std::unique_ptr ptr; - - typedef Executor executor_type; - - ~awaiter() - { - if (has_executor_) - static_cast(static_cast(executor_))->~Executor(); - } - - void set_executor(const Executor& ex) - { - new (&executor_) Executor(ex); - has_executor_ = true; - } - - executor_type get_executor() const noexcept - { - return *static_cast(static_cast(executor_)); - } - - awaiter* get_return_object() - { - return this; - } - - auto initial_suspend() - { - return std::experimental::suspend_always(); - } - - auto final_suspend() - { - return std::experimental::suspend_always(); - } - - void return_void() - { - } - - awaiter* add_ref() - { - ++ref_count_; - return this; - } - - void release() - { - if (--ref_count_ == 0) - coroutine_handle::from_promise(*this).destroy(); - } - - void unhandled_exception() - { - pending_exception_ = std::current_exception(); - } - - void rethrow_unhandled_exception() - { - if (pending_exception_) - { - std::exception_ptr ex = std::exchange(pending_exception_, nullptr); - std::rethrow_exception(ex); - } - } - -private: - std::size_t ref_count_ = 0; - std::exception_ptr pending_exception_ = nullptr; - alignas(Executor) unsigned char executor_[sizeof(Executor)]; - bool has_executor_ = false; -}; - -// Base promise for coroutines further down the thread-of-execution "stack". -template -class awaitee_base -{ -public: -#if !defined(ASIO_DISABLE_AWAITEE_RECYCLING) - void* operator new(std::size_t size) - { - return asio::detail::thread_info_base::allocate( - asio::detail::thread_info_base::awaitee_tag(), - asio::detail::thread_context::thread_call_stack::top(), - size); - } - - void operator delete(void* pointer, std::size_t size) - { - asio::detail::thread_info_base::deallocate( - asio::detail::thread_info_base::awaitee_tag(), - asio::detail::thread_context::thread_call_stack::top(), - pointer, size); - } -#endif // !defined(ASIO_DISABLE_AWAITEE_RECYCLING) - - auto initial_suspend() - { - return std::experimental::suspend_never(); - } - - struct final_suspender - { - awaitee_base* this_; - - bool await_ready() const noexcept - { - return false; - } - - void await_suspend(coroutine_handle) - { - this_->wake_caller(); - } - - void await_resume() const noexcept - { - } - }; - - auto final_suspend() - { - return final_suspender{this}; - } - - void set_except(std::exception_ptr e) - { - pending_exception_ = e; - } - - void unhandled_exception() - { - set_except(std::current_exception()); - } - - void rethrow_exception() - { - if (pending_exception_) - { - std::exception_ptr ex = std::exchange(pending_exception_, nullptr); - std::rethrow_exception(ex); - } - } - - awaiter* top() - { - return awaiter_; - } - - coroutine_handle caller() - { - return caller_; - } - - bool ready() const - { - return ready_; - } - - void wake_caller() - { - if (caller_) - caller_.resume(); - else - ready_ = true; - } - - class awaitable_executor - { - public: - explicit awaitable_executor(awaitee_base* a) - : this_(a) - { - } - - bool await_ready() const noexcept - { - return this_->awaiter_ != nullptr; - } - - template - void await_suspend(coroutine_handle> h) noexcept - { - this_->resume_on_attach_ = h; - } - - Executor await_resume() - { - return this_->awaiter_->get_executor(); - } - - private: - awaitee_base* this_; - }; - - awaitable_executor await_transform(this_coro::executor_t) noexcept - { - return awaitable_executor(this); - } - - class awaitable_token - { - public: - explicit awaitable_token(awaitee_base* a) - : this_(a) - { - } - - bool await_ready() const noexcept - { - return this_->awaiter_ != nullptr; - } - - template - void await_suspend(coroutine_handle> h) noexcept - { - this_->resume_on_attach_ = h; - } - - await_token await_resume() - { - return await_token(this_->awaiter_); - } - - private: - awaitee_base* this_; - }; - - awaitable_token await_transform(this_coro::token_t) noexcept - { - return awaitable_token(this); - } - - template - awaitable await_transform(awaitable& t) const - { - return std::move(t); - } - - template - awaitable await_transform(awaitable&& t) const - { - return std::move(t); - } - - std::experimental::suspend_always await_transform( - std::experimental::suspend_always) const - { - return std::experimental::suspend_always(); - } - - void attach_caller(coroutine_handle> h) - { - this->caller_ = h; - this->attach_callees(&h.promise()); - } - - template - void attach_caller(coroutine_handle> h) - { - this->caller_ = h; - if (h.promise().awaiter_) - this->attach_callees(h.promise().awaiter_); - else - h.promise().unattached_callee_ = this; - } - - void attach_callees(awaiter* a) - { - for (awaitee_base* curr = this; curr != nullptr; - curr = std::exchange(curr->unattached_callee_, nullptr)) - { - curr->awaiter_ = a; - if (curr->resume_on_attach_) - return std::exchange(curr->resume_on_attach_, nullptr).resume(); - } - } - -protected: - awaiter* awaiter_ = nullptr; - coroutine_handle caller_ = nullptr; - awaitee_base* unattached_callee_ = nullptr; - std::exception_ptr pending_exception_ = nullptr; - coroutine_handle resume_on_attach_ = nullptr; - bool ready_ = false; -}; - -// Promise object for coroutines further down the thread-of-execution "stack". -template -class awaitee - : public awaitee_base -{ -public: - awaitee() - { - } - - awaitee(awaitee&& other) noexcept - : awaitee_base(std::move(other)) - { - } - - ~awaitee() - { - if (has_result_) - static_cast(static_cast(result_))->~T(); - } - - awaitable get_return_object() - { - return awaitable(this); - }; - - template - void return_value(U&& u) - { - new (&result_) T(std::forward(u)); - has_result_ = true; - } - - T get() - { - this->caller_ = nullptr; - this->rethrow_exception(); - return std::move(*static_cast(static_cast(result_))); - } - -private: - alignas(T) unsigned char result_[sizeof(T)]; - bool has_result_ = false; -}; - -// Promise object for coroutines further down the thread-of-execution "stack". -template -class awaitee - : public awaitee_base -{ -public: - awaitable get_return_object() - { - return awaitable(this); - }; - - void return_void() - { - } - - void get() - { - this->caller_ = nullptr; - this->rethrow_exception(); - } -}; - -template -class awaiter_task -{ -public: - typedef Executor executor_type; - - awaiter_task(awaiter* a) - : awaiter_(a->add_ref()) - { - } - - awaiter_task(awaiter_task&& other) noexcept - : awaiter_(std::exchange(other.awaiter_, nullptr)) - { - } - - ~awaiter_task() - { - if (awaiter_) - { - // Coroutine "stack unwinding" must be performed through the executor. - executor_type ex(awaiter_->get_executor()); - (post)(ex, - [a = std::move(awaiter_)]() mutable - { - typename awaiter::ptr(std::move(a)); - }); - } - } - - executor_type get_executor() const noexcept - { - return awaiter_->get_executor(); - } - -protected: - typename awaiter::ptr awaiter_; -}; - -template -class co_spawn_handler : public awaiter_task -{ -public: - using awaiter_task::awaiter_task; - - void operator()() - { - typename awaiter::ptr ptr(std::move(this->awaiter_)); - coroutine_handle>::from_promise(*ptr.get()).resume(); - } -}; - -template -class await_handler_base : public awaiter_task -{ -public: - typedef awaitable awaitable_type; - - await_handler_base(await_token token) - : awaiter_task(token.awaiter_), - awaitee_(nullptr) - { - } - - await_handler_base(await_handler_base&& other) noexcept - : awaiter_task(std::move(other)), - awaitee_(std::exchange(other.awaitee_, nullptr)) - { - } - - void attach_awaitee(const awaitable& a) - { - awaitee_ = a.awaitee_; - } - -protected: - awaitee* awaitee_; -}; - -template class await_handler; - -template -class await_handler - : public await_handler_base -{ -public: - using await_handler_base::await_handler_base; - - void operator()() - { - typename awaiter::ptr ptr(std::move(this->awaiter_)); - this->awaitee_->return_void(); - this->awaitee_->wake_caller(); - ptr->rethrow_unhandled_exception(); - } -}; - -template -class await_handler - : public await_handler_base -{ -public: - typedef void return_type; - - using await_handler_base::await_handler_base; - - void operator()(const asio::error_code& ec) - { - typename awaiter::ptr ptr(std::move(this->awaiter_)); - if (ec) - { - this->awaitee_->set_except( - std::make_exception_ptr(asio::system_error(ec))); - } - else - this->awaitee_->return_void(); - this->awaitee_->wake_caller(); - ptr->rethrow_unhandled_exception(); - } -}; - -template -class await_handler - : public await_handler_base -{ -public: - using await_handler_base::await_handler_base; - - void operator()(std::exception_ptr ex) - { - typename awaiter::ptr ptr(std::move(this->awaiter_)); - if (ex) - this->awaitee_->set_except(ex); - else - this->awaitee_->return_void(); - this->awaitee_->wake_caller(); - ptr->rethrow_unhandled_exception(); - } -}; - -template -class await_handler - : public await_handler_base -{ -public: - using await_handler_base::await_handler_base; - - template - void operator()(Arg&& arg) - { - typename awaiter::ptr ptr(std::move(this->awaiter_)); - this->awaitee_->return_value(std::forward(arg)); - this->awaitee_->wake_caller(); - ptr->rethrow_unhandled_exception(); - } -}; - -template -class await_handler - : public await_handler_base -{ -public: - using await_handler_base::await_handler_base; - - template - void operator()(const asio::error_code& ec, Arg&& arg) - { - typename awaiter::ptr ptr(std::move(this->awaiter_)); - if (ec) - { - this->awaitee_->set_except( - std::make_exception_ptr(asio::system_error(ec))); - } - else - this->awaitee_->return_value(std::forward(arg)); - this->awaitee_->wake_caller(); - ptr->rethrow_unhandled_exception(); - } -}; - -template -class await_handler - : public await_handler_base -{ -public: - using await_handler_base::await_handler_base; - - template - void operator()(std::exception_ptr ex, Arg&& arg) - { - typename awaiter::ptr ptr(std::move(this->awaiter_)); - if (ex) - this->awaitee_->set_except(ex); - else - this->awaitee_->return_value(std::forward(arg)); - this->awaitee_->wake_caller(); - ptr->rethrow_unhandled_exception(); - } -}; - -template -class await_handler - : public await_handler_base> -{ -public: - using await_handler_base>::await_handler_base; - - template - void operator()(Args&&... args) - { - typename awaiter::ptr ptr(std::move(this->awaiter_)); - this->awaitee_->return_value( - std::forward_as_tuple(std::forward(args)...)); - this->awaitee_->wake_caller(); - ptr->rethrow_unhandled_exception(); - } -}; - -template -class await_handler - : public await_handler_base> -{ -public: - using await_handler_base>::await_handler_base; - - template - void operator()(const asio::error_code& ec, Args&&... args) - { - typename awaiter::ptr ptr(std::move(this->awaiter_)); - if (ec) - { - this->awaitee_->set_except( - std::make_exception_ptr(asio::system_error(ec))); - } - else - { - this->awaitee_->return_value( - std::forward_as_tuple(std::forward(args)...)); - } - this->awaitee_->wake_caller(); - ptr->rethrow_unhandled_exception(); - } -}; - -template -class await_handler - : public await_handler_base> -{ -public: - using await_handler_base>::await_handler_base; - - template - void operator()(std::exception_ptr ex, Args&&... args) - { - typename awaiter::ptr ptr(std::move(this->awaiter_)); - if (ex) - this->awaitee_->set_except(ex); - else - { - this->awaitee_->return_value( - std::forward_as_tuple(std::forward(args)...)); - } - this->awaitee_->wake_caller(); - ptr->rethrow_unhandled_exception(); - } -}; - -template -struct awaitable_signature; - -template -struct awaitable_signature> -{ - typedef void type(std::exception_ptr, T); -}; - -template -struct awaitable_signature> -{ - typedef void type(std::exception_ptr); -}; - -template -awaiter* co_spawn_entry_point(awaitable*, - executor_work_guard work_guard, F f, Handler handler) -{ - bool done = false; - - try - { - T t = co_await f(); - - done = true; - - (dispatch)(work_guard.get_executor(), - [handler = std::move(handler), t = std::move(t)]() mutable - { - handler(std::exception_ptr(), std::move(t)); - }); - } - catch (...) - { - if (done) - throw; - - (dispatch)(work_guard.get_executor(), - [handler = std::move(handler), e = std::current_exception()]() mutable - { - handler(e, T()); - }); - } -} - -template -awaiter* co_spawn_entry_point(awaitable*, - executor_work_guard work_guard, F f, Handler handler) -{ - std::exception_ptr e = nullptr; - - try - { - co_await f(); - } - catch (...) - { - e = std::current_exception(); - } - - (dispatch)(work_guard.get_executor(), - [handler = std::move(handler), e]() mutable - { - handler(e); - }); -} - -template -auto co_spawn(const Executor& ex, F&& f, CompletionToken&& token) -{ - typedef typename result_of::type awaitable_type; - typedef typename awaitable_type::executor_type executor_type; - typedef typename awaitable_signature::type signature_type; - - async_completion completion(token); - - executor_type ex2(ex); - auto work_guard = make_work_guard(completion.completion_handler, ex2); - - auto* a = (co_spawn_entry_point)( - static_cast(nullptr), std::move(work_guard), - std::forward(f), std::move(completion.completion_handler)); - - a->set_executor(ex2); - (post)(co_spawn_handler(a)); - - return completion.result.get(); -} - -#if defined(_MSC_VER) -# pragma warning(push) -# pragma warning(disable:4033) -#endif // defined(_MSC_VER) - -#if defined(_MSC_VER) -template T dummy_return() -{ - return std::move(*static_cast(nullptr)); -} - -template <> -inline void dummy_return() -{ -} -#endif // defined(_MSC_VER) - -template -inline Awaitable make_dummy_awaitable() -{ - for (;;) co_await std::experimental::suspend_always(); -#if defined(_MSC_VER) - co_return dummy_return(); -#endif // defined(_MSC_VER) -} - -#if defined(_MSC_VER) -# pragma warning(pop) -#endif // defined(_MSC_VER) - -} // namespace detail -} // namespace experimental - -template -class async_result, R(Args...)> -{ -public: - typedef experimental::detail::await_handler< - Executor, typename decay::type...> completion_handler_type; - - typedef typename experimental::detail::await_handler< - Executor, Args...>::awaitable_type return_type; - - async_result(completion_handler_type& h) - : awaitable_(experimental::detail::make_dummy_awaitable()) - { - h.attach_awaitee(awaitable_); - } - - return_type get() - { - return std::move(awaitable_); - } - -private: - return_type awaitable_; -}; - -#if !defined(ASIO_NO_DEPRECATED) - -template -struct handler_type, R(Args...)> -{ - typedef experimental::detail::await_handler< - Executor, typename decay::type...> type; -}; - -template -class async_result> -{ -public: - typedef typename experimental::detail::await_handler< - Executor, Args...>::awaitable_type type; - - async_result(experimental::detail::await_handler& h) - : awaitable_(experimental::detail::make_dummy_awaitable()) - { - h.attach_awaitee(awaitable_); - } - - type get() - { - return std::move(awaitable_); - } - -private: - type awaitable_; -}; - -#endif // !defined(ASIO_NO_DEPRECATED) - -} // namespace asio - -namespace std { namespace experimental { - -template -struct coroutine_traits< - asio::experimental::detail::awaiter*, Args...> -{ - typedef asio::experimental::detail::awaiter promise_type; -}; - -template -struct coroutine_traits< - asio::experimental::awaitable, Args...> -{ - typedef asio::experimental::detail::awaitee promise_type; -}; - -}} // namespace std::experimental - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_EXPERIMENTAL_IMPL_CO_SPAWN_HPP diff --git a/tools/sdk/include/asio/asio/experimental/impl/detached.hpp b/tools/sdk/include/asio/asio/experimental/impl/detached.hpp deleted file mode 100644 index 6ce88872e22..00000000000 --- a/tools/sdk/include/asio/asio/experimental/impl/detached.hpp +++ /dev/null @@ -1,91 +0,0 @@ -// -// experimental/impl/detached.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_EXPERIMENTAL_IMPL_DETACHED_HPP -#define ASIO_EXPERIMENTAL_IMPL_DETACHED_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/async_result.hpp" -#include "asio/detail/variadic_templates.hpp" -#include "asio/handler_type.hpp" -#include "asio/system_error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace experimental { -namespace detail { - - // Class to adapt a detached_t as a completion handler. - class detached_handler - { - public: - detached_handler(detached_t) - { - } - -#if defined(ASIO_HAS_VARIADIC_TEMPLATES) - - template - void operator()(Args...) - { - } - -#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) - - void operator()() - { - } - -#define ASIO_PRIVATE_DETACHED_DEF(n) \ - template \ - void operator()(ASIO_VARIADIC_BYVAL_PARAMS(n)) \ - { \ - } \ - /**/ - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_DETACHED_DEF) -#undef ASIO_PRIVATE_DETACHED_DEF - -#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) - }; - -} // namespace detail -} // namespace experimental - -#if !defined(GENERATING_DOCUMENTATION) - -template -struct async_result -{ - typedef asio::experimental::detail::detached_handler - completion_handler_type; - - typedef void return_type; - - explicit async_result(completion_handler_type&) - { - } - - void get() - { - } -}; - -#endif // !defined(GENERATING_DOCUMENTATION) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_EXPERIMENTAL_IMPL_DETACHED_HPP diff --git a/tools/sdk/include/asio/asio/experimental/impl/redirect_error.hpp b/tools/sdk/include/asio/asio/experimental/impl/redirect_error.hpp deleted file mode 100644 index d3b97facc91..00000000000 --- a/tools/sdk/include/asio/asio/experimental/impl/redirect_error.hpp +++ /dev/null @@ -1,294 +0,0 @@ -// -// experimental/impl/redirect_error.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_EXPERIMENTAL_IMPL_REDIRECT_ERROR_HPP -#define ASIO_EXPERIMENTAL_IMPL_REDIRECT_ERROR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/associated_executor.hpp" -#include "asio/associated_allocator.hpp" -#include "asio/async_result.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_cont_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/detail/variadic_templates.hpp" -#include "asio/handler_type.hpp" -#include "asio/system_error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace experimental { -namespace detail { - -// Class to adapt a redirect_error_t as a completion handler. -template -class redirect_error_handler -{ -public: - template - redirect_error_handler(redirect_error_t e) - : ec_(e.ec_), - handler_(ASIO_MOVE_CAST(CompletionToken)(e.token_)) - { - } - - void operator()() - { - handler_(); - } - -#if defined(ASIO_HAS_VARIADIC_TEMPLATES) - - template - typename enable_if< - !is_same::type, asio::error_code>::value - >::type - operator()(ASIO_MOVE_ARG(Arg) arg, ASIO_MOVE_ARG(Args)... args) - { - handler_(ASIO_MOVE_CAST(Arg)(arg), - ASIO_MOVE_CAST(Args)(args)...); - } - - template - void operator()(const asio::error_code& ec, - ASIO_MOVE_ARG(Args)... args) - { - ec_ = ec; - handler_(ASIO_MOVE_CAST(Args)(args)...); - } - -#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) - - template - typename enable_if< - !is_same::type, asio::error_code>::value - >::type - operator()(ASIO_MOVE_ARG(Arg) arg) - { - handler_(ASIO_MOVE_CAST(Arg)(arg)); - } - - void operator()(const asio::error_code& ec) - { - ec_ = ec; - handler_(); - } - -#define ASIO_PRIVATE_REDIRECT_ERROR_DEF(n) \ - template \ - typename enable_if< \ - !is_same::type, asio::error_code>::value \ - >::type \ - operator()(ASIO_MOVE_ARG(Arg) arg, ASIO_VARIADIC_MOVE_PARAMS(n)) \ - { \ - handler_(ASIO_MOVE_CAST(Arg)(arg), \ - ASIO_VARIADIC_MOVE_ARGS(n)); \ - } \ - \ - template \ - void operator()(const asio::error_code& ec, \ - ASIO_VARIADIC_MOVE_PARAMS(n)) \ - { \ - ec_ = ec; \ - handler_(ASIO_VARIADIC_MOVE_ARGS(n)); \ - } \ - /**/ - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_REDIRECT_ERROR_DEF) -#undef ASIO_PRIVATE_REDIRECT_ERROR_DEF - -#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) - -//private: - asio::error_code& ec_; - Handler handler_; -}; - -template -inline void* asio_handler_allocate(std::size_t size, - redirect_error_handler* this_handler) -{ - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); -} - -template -inline void asio_handler_deallocate(void* pointer, std::size_t size, - redirect_error_handler* this_handler) -{ - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); -} - -template -inline bool asio_handler_is_continuation( - redirect_error_handler* this_handler) -{ - return asio_handler_cont_helpers::is_continuation( - this_handler->handler_); -} - -template -inline void asio_handler_invoke(Function& function, - redirect_error_handler* this_handler) -{ - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); -} - -template -inline void asio_handler_invoke(const Function& function, - redirect_error_handler* this_handler) -{ - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); -} - -template -struct redirect_error_signature -{ - typedef Signature type; -}; - -#if defined(ASIO_HAS_VARIADIC_TEMPLATES) - -template -struct redirect_error_signature -{ - typedef R type(Args...); -}; - -template -struct redirect_error_signature -{ - typedef R type(Args...); -}; - -#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) - -template -struct redirect_error_signature -{ - typedef R type(); -}; - -template -struct redirect_error_signature -{ - typedef R type(); -}; - -#define ASIO_PRIVATE_REDIRECT_ERROR_DEF(n) \ - template \ - struct redirect_error_signature< \ - R(asio::error_code, ASIO_VARIADIC_TARGS(n))> \ - { \ - typedef R type(ASIO_VARIADIC_TARGS(n)); \ - }; \ - \ - template \ - struct redirect_error_signature< \ - R(const asio::error_code&, ASIO_VARIADIC_TARGS(n))> \ - { \ - typedef R type(ASIO_VARIADIC_TARGS(n)); \ - }; \ - /**/ - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_REDIRECT_ERROR_DEF) -#undef ASIO_PRIVATE_REDIRECT_ERROR_DEF - -#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) - -} // namespace detail -} // namespace experimental - -#if !defined(GENERATING_DOCUMENTATION) - -template -struct async_result, Signature> - : async_result::type> -{ - typedef experimental::detail::redirect_error_handler< - typename async_result::type> - ::completion_handler_type> completion_handler_type; - - explicit async_result(completion_handler_type& h) - : async_result::type>(h.handler_) - { - } -}; - -#if !defined(ASIO_NO_DEPRECATED) - -template -struct handler_type, Signature> -{ - typedef experimental::detail::redirect_error_handler< - typename async_result::type> - ::completion_handler_type> type; -}; - -template -struct async_result > - : async_result -{ - explicit async_result( - experimental::detail::redirect_error_handler& h) - : async_result(h.handler_) - { - } -}; - -#endif // !defined(ASIO_NO_DEPRECATED) - -template -struct associated_executor< - experimental::detail::redirect_error_handler, Executor> -{ - typedef typename associated_executor::type type; - - static type get( - const experimental::detail::redirect_error_handler& h, - const Executor& ex = Executor()) ASIO_NOEXCEPT - { - return associated_executor::get(h.handler_, ex); - } -}; - -template -struct associated_allocator< - experimental::detail::redirect_error_handler, Allocator> -{ - typedef typename associated_allocator::type type; - - static type get( - const experimental::detail::redirect_error_handler& h, - const Allocator& a = Allocator()) ASIO_NOEXCEPT - { - return associated_allocator::get(h.handler_, a); - } -}; - -#endif // !defined(GENERATING_DOCUMENTATION) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_EXPERIMENTAL_IMPL_REDIRECT_ERROR_HPP diff --git a/tools/sdk/include/asio/asio/experimental/redirect_error.hpp b/tools/sdk/include/asio/asio/experimental/redirect_error.hpp deleted file mode 100644 index 30e81cf5a28..00000000000 --- a/tools/sdk/include/asio/asio/experimental/redirect_error.hpp +++ /dev/null @@ -1,67 +0,0 @@ -// -// experimental/redirect_error.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_EXPERIMENTAL_REDIRECT_ERROR_HPP -#define ASIO_EXPERIMENTAL_REDIRECT_ERROR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/error_code.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace experimental { - -/// Completion token type used to specify that an error produced by an -/// asynchronous operation is captured to an error_code variable. -/** - * The redirect_error_t class is used to indicate that any error_code produced - * by an asynchronous operation is captured to a specified variable. - */ -template -class redirect_error_t -{ -public: - /// Constructor. - template - redirect_error_t(ASIO_MOVE_ARG(T) completion_token, - asio::error_code& ec) - : token_(ASIO_MOVE_CAST(T)(completion_token)), - ec_(ec) - { - } - -//private: - CompletionToken token_; - asio::error_code& ec_; -}; - -/// Create a completion token to capture error_code values to a variable. -template -inline redirect_error_t::type> redirect_error( - CompletionToken&& completion_token, asio::error_code& ec) -{ - return redirect_error_t::type>( - ASIO_MOVE_CAST(CompletionToken)(completion_token), ec); -} - -} // namespace experimental -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/experimental/impl/redirect_error.hpp" - -#endif // ASIO_EXPERIMENTAL_REDIRECT_ERROR_HPP diff --git a/tools/sdk/include/asio/asio/generic/basic_endpoint.hpp b/tools/sdk/include/asio/asio/generic/basic_endpoint.hpp deleted file mode 100644 index 73aa151d627..00000000000 --- a/tools/sdk/include/asio/asio/generic/basic_endpoint.hpp +++ /dev/null @@ -1,193 +0,0 @@ -// -// generic/basic_endpoint.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_GENERIC_BASIC_ENDPOINT_HPP -#define ASIO_GENERIC_BASIC_ENDPOINT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/generic/detail/endpoint.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace generic { - -/// Describes an endpoint for any socket type. -/** - * The asio::generic::basic_endpoint class template describes an endpoint - * that may be associated with any socket type. - * - * @note The socket types sockaddr type must be able to fit into a - * @c sockaddr_storage structure. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - * - * @par Concepts: - * Endpoint. - */ -template -class basic_endpoint -{ -public: - /// The protocol type associated with the endpoint. - typedef Protocol protocol_type; - - /// The type of the endpoint structure. This type is dependent on the - /// underlying implementation of the socket layer. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined data_type; -#else - typedef asio::detail::socket_addr_type data_type; -#endif - - /// Default constructor. - basic_endpoint() - { - } - - /// Construct an endpoint from the specified socket address. - basic_endpoint(const void* socket_address, - std::size_t socket_address_size, int socket_protocol = 0) - : impl_(socket_address, socket_address_size, socket_protocol) - { - } - - /// Construct an endpoint from the specific endpoint type. - template - basic_endpoint(const Endpoint& endpoint) - : impl_(endpoint.data(), endpoint.size(), endpoint.protocol().protocol()) - { - } - - /// Copy constructor. - basic_endpoint(const basic_endpoint& other) - : impl_(other.impl_) - { - } - -#if defined(ASIO_HAS_MOVE) - /// Move constructor. - basic_endpoint(basic_endpoint&& other) - : impl_(other.impl_) - { - } -#endif // defined(ASIO_HAS_MOVE) - - /// Assign from another endpoint. - basic_endpoint& operator=(const basic_endpoint& other) - { - impl_ = other.impl_; - return *this; - } - -#if defined(ASIO_HAS_MOVE) - /// Move-assign from another endpoint. - basic_endpoint& operator=(basic_endpoint&& other) - { - impl_ = other.impl_; - return *this; - } -#endif // defined(ASIO_HAS_MOVE) - - /// The protocol associated with the endpoint. - protocol_type protocol() const - { - return protocol_type(impl_.family(), impl_.protocol()); - } - - /// Get the underlying endpoint in the native type. - data_type* data() - { - return impl_.data(); - } - - /// Get the underlying endpoint in the native type. - const data_type* data() const - { - return impl_.data(); - } - - /// Get the underlying size of the endpoint in the native type. - std::size_t size() const - { - return impl_.size(); - } - - /// Set the underlying size of the endpoint in the native type. - void resize(std::size_t new_size) - { - impl_.resize(new_size); - } - - /// Get the capacity of the endpoint in the native type. - std::size_t capacity() const - { - return impl_.capacity(); - } - - /// Compare two endpoints for equality. - friend bool operator==(const basic_endpoint& e1, - const basic_endpoint& e2) - { - return e1.impl_ == e2.impl_; - } - - /// Compare two endpoints for inequality. - friend bool operator!=(const basic_endpoint& e1, - const basic_endpoint& e2) - { - return !(e1.impl_ == e2.impl_); - } - - /// Compare endpoints for ordering. - friend bool operator<(const basic_endpoint& e1, - const basic_endpoint& e2) - { - return e1.impl_ < e2.impl_; - } - - /// Compare endpoints for ordering. - friend bool operator>(const basic_endpoint& e1, - const basic_endpoint& e2) - { - return e2.impl_ < e1.impl_; - } - - /// Compare endpoints for ordering. - friend bool operator<=(const basic_endpoint& e1, - const basic_endpoint& e2) - { - return !(e2 < e1); - } - - /// Compare endpoints for ordering. - friend bool operator>=(const basic_endpoint& e1, - const basic_endpoint& e2) - { - return !(e1 < e2); - } - -private: - // The underlying generic endpoint. - asio::generic::detail::endpoint impl_; -}; - -} // namespace generic -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_GENERIC_BASIC_ENDPOINT_HPP diff --git a/tools/sdk/include/asio/asio/generic/datagram_protocol.hpp b/tools/sdk/include/asio/asio/generic/datagram_protocol.hpp deleted file mode 100644 index 8678ad85bcc..00000000000 --- a/tools/sdk/include/asio/asio/generic/datagram_protocol.hpp +++ /dev/null @@ -1,123 +0,0 @@ -// -// generic/datagram_protocol.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_GENERIC_DATAGRAM_PROTOCOL_HPP -#define ASIO_GENERIC_DATAGRAM_PROTOCOL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include -#include "asio/basic_datagram_socket.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/detail/throw_exception.hpp" -#include "asio/generic/basic_endpoint.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace generic { - -/// Encapsulates the flags needed for a generic datagram-oriented socket. -/** - * The asio::generic::datagram_protocol class contains flags necessary - * for datagram-oriented sockets of any address family and protocol. - * - * @par Examples - * Constructing using a native address family and socket protocol: - * @code datagram_protocol p(AF_INET, IPPROTO_UDP); @endcode - * Constructing from a specific protocol type: - * @code datagram_protocol p(asio::ip::udp::v4()); @endcode - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Safe. - * - * @par Concepts: - * Protocol. - */ -class datagram_protocol -{ -public: - /// Construct a protocol object for a specific address family and protocol. - datagram_protocol(int address_family, int socket_protocol) - : family_(address_family), - protocol_(socket_protocol) - { - } - - /// Construct a generic protocol object from a specific protocol. - /** - * @throws @c bad_cast Thrown if the source protocol is not datagram-oriented. - */ - template - datagram_protocol(const Protocol& source_protocol) - : family_(source_protocol.family()), - protocol_(source_protocol.protocol()) - { - if (source_protocol.type() != type()) - { - std::bad_cast ex; - asio::detail::throw_exception(ex); - } - } - - /// Obtain an identifier for the type of the protocol. - int type() const - { - return ASIO_OS_DEF(SOCK_DGRAM); - } - - /// Obtain an identifier for the protocol. - int protocol() const - { - return protocol_; - } - - /// Obtain an identifier for the protocol family. - int family() const - { - return family_; - } - - /// Compare two protocols for equality. - friend bool operator==(const datagram_protocol& p1, - const datagram_protocol& p2) - { - return p1.family_ == p2.family_ && p1.protocol_ == p2.protocol_; - } - - /// Compare two protocols for inequality. - friend bool operator!=(const datagram_protocol& p1, - const datagram_protocol& p2) - { - return !(p1 == p2); - } - - /// The type of an endpoint. - typedef basic_endpoint endpoint; - - /// The generic socket type. - typedef basic_datagram_socket socket; - -private: - int family_; - int protocol_; -}; - -} // namespace generic -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_GENERIC_DATAGRAM_PROTOCOL_HPP diff --git a/tools/sdk/include/asio/asio/generic/detail/endpoint.hpp b/tools/sdk/include/asio/asio/generic/detail/endpoint.hpp deleted file mode 100644 index 190beb14c64..00000000000 --- a/tools/sdk/include/asio/asio/generic/detail/endpoint.hpp +++ /dev/null @@ -1,133 +0,0 @@ -// -// generic/detail/endpoint.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_GENERIC_DETAIL_ENDPOINT_HPP -#define ASIO_GENERIC_DETAIL_ENDPOINT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include -#include "asio/detail/socket_types.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace generic { -namespace detail { - -// Helper class for implementing a generic socket endpoint. -class endpoint -{ -public: - // Default constructor. - ASIO_DECL endpoint(); - - // Construct an endpoint from the specified raw bytes. - ASIO_DECL endpoint(const void* sock_addr, - std::size_t sock_addr_size, int sock_protocol); - - // Copy constructor. - endpoint(const endpoint& other) - : data_(other.data_), - size_(other.size_), - protocol_(other.protocol_) - { - } - - // Assign from another endpoint. - endpoint& operator=(const endpoint& other) - { - data_ = other.data_; - size_ = other.size_; - protocol_ = other.protocol_; - return *this; - } - - // Get the address family associated with the endpoint. - int family() const - { - return data_.base.sa_family; - } - - // Get the socket protocol associated with the endpoint. - int protocol() const - { - return protocol_; - } - - // Get the underlying endpoint in the native type. - asio::detail::socket_addr_type* data() - { - return &data_.base; - } - - // Get the underlying endpoint in the native type. - const asio::detail::socket_addr_type* data() const - { - return &data_.base; - } - - // Get the underlying size of the endpoint in the native type. - std::size_t size() const - { - return size_; - } - - // Set the underlying size of the endpoint in the native type. - ASIO_DECL void resize(std::size_t size); - - // Get the capacity of the endpoint in the native type. - std::size_t capacity() const - { - return sizeof(asio::detail::sockaddr_storage_type); - } - - // Compare two endpoints for equality. - ASIO_DECL friend bool operator==( - const endpoint& e1, const endpoint& e2); - - // Compare endpoints for ordering. - ASIO_DECL friend bool operator<( - const endpoint& e1, const endpoint& e2); - -private: - // The underlying socket address. - union data_union - { - asio::detail::socket_addr_type base; - asio::detail::sockaddr_storage_type generic; - } data_; - - // The length of the socket address stored in the endpoint. - std::size_t size_; - - // The socket protocol associated with the endpoint. - int protocol_; - - // Initialise with a specified memory. - ASIO_DECL void init(const void* sock_addr, - std::size_t sock_addr_size, int sock_protocol); -}; - -} // namespace detail -} // namespace generic -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/generic/detail/impl/endpoint.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_GENERIC_DETAIL_ENDPOINT_HPP diff --git a/tools/sdk/include/asio/asio/generic/raw_protocol.hpp b/tools/sdk/include/asio/asio/generic/raw_protocol.hpp deleted file mode 100644 index b83dca6e32c..00000000000 --- a/tools/sdk/include/asio/asio/generic/raw_protocol.hpp +++ /dev/null @@ -1,121 +0,0 @@ -// -// generic/raw_protocol.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_GENERIC_RAW_PROTOCOL_HPP -#define ASIO_GENERIC_RAW_PROTOCOL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include -#include "asio/basic_raw_socket.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/detail/throw_exception.hpp" -#include "asio/generic/basic_endpoint.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace generic { - -/// Encapsulates the flags needed for a generic raw socket. -/** - * The asio::generic::raw_protocol class contains flags necessary for - * raw sockets of any address family and protocol. - * - * @par Examples - * Constructing using a native address family and socket protocol: - * @code raw_protocol p(AF_INET, IPPROTO_ICMP); @endcode - * Constructing from a specific protocol type: - * @code raw_protocol p(asio::ip::icmp::v4()); @endcode - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Safe. - * - * @par Concepts: - * Protocol. - */ -class raw_protocol -{ -public: - /// Construct a protocol object for a specific address family and protocol. - raw_protocol(int address_family, int socket_protocol) - : family_(address_family), - protocol_(socket_protocol) - { - } - - /// Construct a generic protocol object from a specific protocol. - /** - * @throws @c bad_cast Thrown if the source protocol is not raw-oriented. - */ - template - raw_protocol(const Protocol& source_protocol) - : family_(source_protocol.family()), - protocol_(source_protocol.protocol()) - { - if (source_protocol.type() != type()) - { - std::bad_cast ex; - asio::detail::throw_exception(ex); - } - } - - /// Obtain an identifier for the type of the protocol. - int type() const - { - return ASIO_OS_DEF(SOCK_RAW); - } - - /// Obtain an identifier for the protocol. - int protocol() const - { - return protocol_; - } - - /// Obtain an identifier for the protocol family. - int family() const - { - return family_; - } - - /// Compare two protocols for equality. - friend bool operator==(const raw_protocol& p1, const raw_protocol& p2) - { - return p1.family_ == p2.family_ && p1.protocol_ == p2.protocol_; - } - - /// Compare two protocols for inequality. - friend bool operator!=(const raw_protocol& p1, const raw_protocol& p2) - { - return !(p1 == p2); - } - - /// The type of an endpoint. - typedef basic_endpoint endpoint; - - /// The generic socket type. - typedef basic_raw_socket socket; - -private: - int family_; - int protocol_; -}; - -} // namespace generic -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_GENERIC_RAW_PROTOCOL_HPP diff --git a/tools/sdk/include/asio/asio/generic/seq_packet_protocol.hpp b/tools/sdk/include/asio/asio/generic/seq_packet_protocol.hpp deleted file mode 100644 index f92a4c8f89f..00000000000 --- a/tools/sdk/include/asio/asio/generic/seq_packet_protocol.hpp +++ /dev/null @@ -1,122 +0,0 @@ -// -// generic/seq_packet_protocol.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_GENERIC_SEQ_PACKET_PROTOCOL_HPP -#define ASIO_GENERIC_SEQ_PACKET_PROTOCOL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include -#include "asio/basic_seq_packet_socket.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/detail/throw_exception.hpp" -#include "asio/generic/basic_endpoint.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace generic { - -/// Encapsulates the flags needed for a generic sequenced packet socket. -/** - * The asio::generic::seq_packet_protocol class contains flags necessary - * for seq_packet-oriented sockets of any address family and protocol. - * - * @par Examples - * Constructing using a native address family and socket protocol: - * @code seq_packet_protocol p(AF_INET, IPPROTO_SCTP); @endcode - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Safe. - * - * @par Concepts: - * Protocol. - */ -class seq_packet_protocol -{ -public: - /// Construct a protocol object for a specific address family and protocol. - seq_packet_protocol(int address_family, int socket_protocol) - : family_(address_family), - protocol_(socket_protocol) - { - } - - /// Construct a generic protocol object from a specific protocol. - /** - * @throws @c bad_cast Thrown if the source protocol is not based around - * sequenced packets. - */ - template - seq_packet_protocol(const Protocol& source_protocol) - : family_(source_protocol.family()), - protocol_(source_protocol.protocol()) - { - if (source_protocol.type() != type()) - { - std::bad_cast ex; - asio::detail::throw_exception(ex); - } - } - - /// Obtain an identifier for the type of the protocol. - int type() const - { - return ASIO_OS_DEF(SOCK_SEQPACKET); - } - - /// Obtain an identifier for the protocol. - int protocol() const - { - return protocol_; - } - - /// Obtain an identifier for the protocol family. - int family() const - { - return family_; - } - - /// Compare two protocols for equality. - friend bool operator==(const seq_packet_protocol& p1, - const seq_packet_protocol& p2) - { - return p1.family_ == p2.family_ && p1.protocol_ == p2.protocol_; - } - - /// Compare two protocols for inequality. - friend bool operator!=(const seq_packet_protocol& p1, - const seq_packet_protocol& p2) - { - return !(p1 == p2); - } - - /// The type of an endpoint. - typedef basic_endpoint endpoint; - - /// The generic socket type. - typedef basic_seq_packet_socket socket; - -private: - int family_; - int protocol_; -}; - -} // namespace generic -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_GENERIC_SEQ_PACKET_PROTOCOL_HPP diff --git a/tools/sdk/include/asio/asio/generic/stream_protocol.hpp b/tools/sdk/include/asio/asio/generic/stream_protocol.hpp deleted file mode 100644 index 8349f25bc71..00000000000 --- a/tools/sdk/include/asio/asio/generic/stream_protocol.hpp +++ /dev/null @@ -1,127 +0,0 @@ -// -// generic/stream_protocol.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_GENERIC_STREAM_PROTOCOL_HPP -#define ASIO_GENERIC_STREAM_PROTOCOL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include -#include "asio/basic_socket_iostream.hpp" -#include "asio/basic_stream_socket.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/detail/throw_exception.hpp" -#include "asio/generic/basic_endpoint.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace generic { - -/// Encapsulates the flags needed for a generic stream-oriented socket. -/** - * The asio::generic::stream_protocol class contains flags necessary for - * stream-oriented sockets of any address family and protocol. - * - * @par Examples - * Constructing using a native address family and socket protocol: - * @code stream_protocol p(AF_INET, IPPROTO_TCP); @endcode - * Constructing from a specific protocol type: - * @code stream_protocol p(asio::ip::tcp::v4()); @endcode - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Safe. - * - * @par Concepts: - * Protocol. - */ -class stream_protocol -{ -public: - /// Construct a protocol object for a specific address family and protocol. - stream_protocol(int address_family, int socket_protocol) - : family_(address_family), - protocol_(socket_protocol) - { - } - - /// Construct a generic protocol object from a specific protocol. - /** - * @throws @c bad_cast Thrown if the source protocol is not stream-oriented. - */ - template - stream_protocol(const Protocol& source_protocol) - : family_(source_protocol.family()), - protocol_(source_protocol.protocol()) - { - if (source_protocol.type() != type()) - { - std::bad_cast ex; - asio::detail::throw_exception(ex); - } - } - - /// Obtain an identifier for the type of the protocol. - int type() const - { - return ASIO_OS_DEF(SOCK_STREAM); - } - - /// Obtain an identifier for the protocol. - int protocol() const - { - return protocol_; - } - - /// Obtain an identifier for the protocol family. - int family() const - { - return family_; - } - - /// Compare two protocols for equality. - friend bool operator==(const stream_protocol& p1, const stream_protocol& p2) - { - return p1.family_ == p2.family_ && p1.protocol_ == p2.protocol_; - } - - /// Compare two protocols for inequality. - friend bool operator!=(const stream_protocol& p1, const stream_protocol& p2) - { - return !(p1 == p2); - } - - /// The type of an endpoint. - typedef basic_endpoint endpoint; - - /// The generic socket type. - typedef basic_stream_socket socket; - -#if !defined(ASIO_NO_IOSTREAM) - /// The generic socket iostream type. - typedef basic_socket_iostream iostream; -#endif // !defined(ASIO_NO_IOSTREAM) - -private: - int family_; - int protocol_; -}; - -} // namespace generic -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_GENERIC_STREAM_PROTOCOL_HPP diff --git a/tools/sdk/include/asio/asio/handler_alloc_hook.hpp b/tools/sdk/include/asio/asio/handler_alloc_hook.hpp deleted file mode 100644 index d7fe2b01fa5..00000000000 --- a/tools/sdk/include/asio/asio/handler_alloc_hook.hpp +++ /dev/null @@ -1,81 +0,0 @@ -// -// handler_alloc_hook.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_HANDLER_ALLOC_HOOK_HPP -#define ASIO_HANDLER_ALLOC_HOOK_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Default allocation function for handlers. -/** - * Asynchronous operations may need to allocate temporary objects. Since - * asynchronous operations have a handler function object, these temporary - * objects can be said to be associated with the handler. - * - * Implement asio_handler_allocate and asio_handler_deallocate for your own - * handlers to provide custom allocation for these temporary objects. - * - * The default implementation of these allocation hooks uses ::operator - * new and ::operator delete. - * - * @note All temporary objects associated with a handler will be deallocated - * before the upcall to the handler is performed. This allows the same memory to - * be reused for a subsequent asynchronous operation initiated by the handler. - * - * @par Example - * @code - * class my_handler; - * - * void* asio_handler_allocate(std::size_t size, my_handler* context) - * { - * return ::operator new(size); - * } - * - * void asio_handler_deallocate(void* pointer, std::size_t size, - * my_handler* context) - * { - * ::operator delete(pointer); - * } - * @endcode - */ -ASIO_DECL void* asio_handler_allocate( - std::size_t size, ...); - -/// Default deallocation function for handlers. -/** - * Implement asio_handler_allocate and asio_handler_deallocate for your own - * handlers to provide custom allocation for the associated temporary objects. - * - * The default implementation of these allocation hooks uses ::operator - * new and ::operator delete. - * - * @sa asio_handler_allocate. - */ -ASIO_DECL void asio_handler_deallocate( - void* pointer, std::size_t size, ...); - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/impl/handler_alloc_hook.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_HANDLER_ALLOC_HOOK_HPP diff --git a/tools/sdk/include/asio/asio/handler_continuation_hook.hpp b/tools/sdk/include/asio/asio/handler_continuation_hook.hpp deleted file mode 100644 index d41d10595f3..00000000000 --- a/tools/sdk/include/asio/asio/handler_continuation_hook.hpp +++ /dev/null @@ -1,54 +0,0 @@ -// -// handler_continuation_hook.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_HANDLER_CONTINUATION_HOOK_HPP -#define ASIO_HANDLER_CONTINUATION_HOOK_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Default continuation function for handlers. -/** - * Asynchronous operations may represent a continuation of the asynchronous - * control flow associated with the current handler. The implementation can use - * this knowledge to optimise scheduling of the handler. - * - * Implement asio_handler_is_continuation for your own handlers to indicate - * when a handler represents a continuation. - * - * The default implementation of the continuation hook returns false. - * - * @par Example - * @code - * class my_handler; - * - * bool asio_handler_is_continuation(my_handler* context) - * { - * return true; - * } - * @endcode - */ -inline bool asio_handler_is_continuation(...) -{ - return false; -} - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_HANDLER_CONTINUATION_HOOK_HPP diff --git a/tools/sdk/include/asio/asio/handler_invoke_hook.hpp b/tools/sdk/include/asio/asio/handler_invoke_hook.hpp deleted file mode 100644 index ee618e5ef63..00000000000 --- a/tools/sdk/include/asio/asio/handler_invoke_hook.hpp +++ /dev/null @@ -1,85 +0,0 @@ -// -// handler_invoke_hook.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_HANDLER_INVOKE_HOOK_HPP -#define ASIO_HANDLER_INVOKE_HOOK_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/** @defgroup asio_handler_invoke asio::asio_handler_invoke - * - * @brief Default invoke function for handlers. - * - * Completion handlers for asynchronous operations are invoked by the - * io_context associated with the corresponding object (e.g. a socket or - * deadline_timer). Certain guarantees are made on when the handler may be - * invoked, in particular that a handler can only be invoked from a thread that - * is currently calling @c run() on the corresponding io_context object. - * Handlers may subsequently be invoked through other objects (such as - * io_context::strand objects) that provide additional guarantees. - * - * When asynchronous operations are composed from other asynchronous - * operations, all intermediate handlers should be invoked using the same - * method as the final handler. This is required to ensure that user-defined - * objects are not accessed in a way that may violate the guarantees. This - * hooking function ensures that the invoked method used for the final handler - * is accessible at each intermediate step. - * - * Implement asio_handler_invoke for your own handlers to specify a custom - * invocation strategy. - * - * This default implementation invokes the function object like so: - * @code function(); @endcode - * If necessary, the default implementation makes a copy of the function object - * so that the non-const operator() can be used. - * - * @par Example - * @code - * class my_handler; - * - * template - * void asio_handler_invoke(Function function, my_handler* context) - * { - * context->strand_.dispatch(function); - * } - * @endcode - */ -/*@{*/ - -/// Default handler invocation hook used for non-const function objects. -template -inline void asio_handler_invoke(Function& function, ...) -{ - function(); -} - -/// Default handler invocation hook used for const function objects. -template -inline void asio_handler_invoke(const Function& function, ...) -{ - Function tmp(function); - tmp(); -} - -/*@}*/ - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_HANDLER_INVOKE_HOOK_HPP diff --git a/tools/sdk/include/asio/asio/handler_type.hpp b/tools/sdk/include/asio/asio/handler_type.hpp deleted file mode 100644 index bc0d3051405..00000000000 --- a/tools/sdk/include/asio/asio/handler_type.hpp +++ /dev/null @@ -1,50 +0,0 @@ -// -// handler_type.hpp -// ~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_HANDLER_TYPE_HPP -#define ASIO_HANDLER_TYPE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/type_traits.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// (Deprecated: Use two-parameter version of async_result.) Default handler -/// type traits provided for all completion token types. -/** - * The handler_type traits class is used for determining the concrete handler - * type to be used for an asynchronous operation. It allows the handler type to - * be determined at the point where the specific completion handler signature - * is known. - * - * This template may be specialised for user-defined completion token types. - */ -template -struct handler_type -{ - /// The handler type for the specific signature. - typedef typename conditional< - is_same::type>::value, - decay, - handler_type::type, Signature> - >::type::type type; -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_HANDLER_TYPE_HPP diff --git a/tools/sdk/include/asio/asio/high_resolution_timer.hpp b/tools/sdk/include/asio/asio/high_resolution_timer.hpp deleted file mode 100644 index 0549cc2569c..00000000000 --- a/tools/sdk/include/asio/asio/high_resolution_timer.hpp +++ /dev/null @@ -1,44 +0,0 @@ -// -// high_resolution_timer.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_HIGH_RESOLUTION_TIMER_HPP -#define ASIO_HIGH_RESOLUTION_TIMER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION) - -#include "asio/basic_waitable_timer.hpp" -#include "asio/detail/chrono.hpp" - -namespace asio { - -/// Typedef for a timer based on the high resolution clock. -/** - * This typedef uses the C++11 @c <chrono> standard library facility, if - * available. Otherwise, it may use the Boost.Chrono library. To explicitly - * utilise Boost.Chrono, use the basic_waitable_timer template directly: - * @code - * typedef basic_waitable_timer timer; - * @endcode - */ -typedef basic_waitable_timer< - chrono::high_resolution_clock> - high_resolution_timer; - -} // namespace asio - -#endif // defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION) - -#endif // ASIO_HIGH_RESOLUTION_TIMER_HPP diff --git a/tools/sdk/include/asio/asio/impl/buffered_read_stream.hpp b/tools/sdk/include/asio/asio/impl/buffered_read_stream.hpp deleted file mode 100644 index e0ed20e4c20..00000000000 --- a/tools/sdk/include/asio/asio/impl/buffered_read_stream.hpp +++ /dev/null @@ -1,429 +0,0 @@ -// -// impl/buffered_read_stream.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IMPL_BUFFERED_READ_STREAM_HPP -#define ASIO_IMPL_BUFFERED_READ_STREAM_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/associated_allocator.hpp" -#include "asio/associated_executor.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_cont_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/handler_type_requirements.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -template -std::size_t buffered_read_stream::fill() -{ - detail::buffer_resize_guard - resize_guard(storage_); - std::size_t previous_size = storage_.size(); - storage_.resize(storage_.capacity()); - storage_.resize(previous_size + next_layer_.read_some(buffer( - storage_.data() + previous_size, - storage_.size() - previous_size))); - resize_guard.commit(); - return storage_.size() - previous_size; -} - -template -std::size_t buffered_read_stream::fill(asio::error_code& ec) -{ - detail::buffer_resize_guard - resize_guard(storage_); - std::size_t previous_size = storage_.size(); - storage_.resize(storage_.capacity()); - storage_.resize(previous_size + next_layer_.read_some(buffer( - storage_.data() + previous_size, - storage_.size() - previous_size), - ec)); - resize_guard.commit(); - return storage_.size() - previous_size; -} - -namespace detail -{ - template - class buffered_fill_handler - { - public: - buffered_fill_handler(detail::buffered_stream_storage& storage, - std::size_t previous_size, ReadHandler& handler) - : storage_(storage), - previous_size_(previous_size), - handler_(ASIO_MOVE_CAST(ReadHandler)(handler)) - { - } - -#if defined(ASIO_HAS_MOVE) - buffered_fill_handler(const buffered_fill_handler& other) - : storage_(other.storage_), - previous_size_(other.previous_size_), - handler_(other.handler_) - { - } - - buffered_fill_handler(buffered_fill_handler&& other) - : storage_(other.storage_), - previous_size_(other.previous_size_), - handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()(const asio::error_code& ec, - const std::size_t bytes_transferred) - { - storage_.resize(previous_size_ + bytes_transferred); - handler_(ec, bytes_transferred); - } - - //private: - detail::buffered_stream_storage& storage_; - std::size_t previous_size_; - ReadHandler handler_; - }; - - template - inline void* asio_handler_allocate(std::size_t size, - buffered_fill_handler* this_handler) - { - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); - } - - template - inline void asio_handler_deallocate(void* pointer, std::size_t size, - buffered_fill_handler* this_handler) - { - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); - } - - template - inline bool asio_handler_is_continuation( - buffered_fill_handler* this_handler) - { - return asio_handler_cont_helpers::is_continuation( - this_handler->handler_); - } - - template - inline void asio_handler_invoke(Function& function, - buffered_fill_handler* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - inline void asio_handler_invoke(const Function& function, - buffered_fill_handler* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } -} // namespace detail - -#if !defined(GENERATING_DOCUMENTATION) - -template -struct associated_allocator< - detail::buffered_fill_handler, Allocator> -{ - typedef typename associated_allocator::type type; - - static type get(const detail::buffered_fill_handler& h, - const Allocator& a = Allocator()) ASIO_NOEXCEPT - { - return associated_allocator::get(h.handler_, a); - } -}; - -template -struct associated_executor< - detail::buffered_fill_handler, Executor> -{ - typedef typename associated_executor::type type; - - static type get(const detail::buffered_fill_handler& h, - const Executor& ex = Executor()) ASIO_NOEXCEPT - { - return associated_executor::get(h.handler_, ex); - } -}; - -#endif // !defined(GENERATING_DOCUMENTATION) - -template -template -ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -buffered_read_stream::async_fill( - ASIO_MOVE_ARG(ReadHandler) handler) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - - async_completion init(handler); - - std::size_t previous_size = storage_.size(); - storage_.resize(storage_.capacity()); - next_layer_.async_read_some( - buffer( - storage_.data() + previous_size, - storage_.size() - previous_size), - detail::buffered_fill_handler( - storage_, previous_size, init.completion_handler)); - - return init.result.get(); -} - -template -template -std::size_t buffered_read_stream::read_some( - const MutableBufferSequence& buffers) -{ - using asio::buffer_size; - if (buffer_size(buffers) == 0) - return 0; - - if (storage_.empty()) - this->fill(); - - return this->copy(buffers); -} - -template -template -std::size_t buffered_read_stream::read_some( - const MutableBufferSequence& buffers, asio::error_code& ec) -{ - ec = asio::error_code(); - - using asio::buffer_size; - if (buffer_size(buffers) == 0) - return 0; - - if (storage_.empty() && !this->fill(ec)) - return 0; - - return this->copy(buffers); -} - -namespace detail -{ - template - class buffered_read_some_handler - { - public: - buffered_read_some_handler(detail::buffered_stream_storage& storage, - const MutableBufferSequence& buffers, ReadHandler& handler) - : storage_(storage), - buffers_(buffers), - handler_(ASIO_MOVE_CAST(ReadHandler)(handler)) - { - } - -#if defined(ASIO_HAS_MOVE) - buffered_read_some_handler(const buffered_read_some_handler& other) - : storage_(other.storage_), - buffers_(other.buffers_), - handler_(other.handler_) - { - } - - buffered_read_some_handler(buffered_read_some_handler&& other) - : storage_(other.storage_), - buffers_(other.buffers_), - handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()(const asio::error_code& ec, std::size_t) - { - if (ec || storage_.empty()) - { - const std::size_t length = 0; - handler_(ec, length); - } - else - { - const std::size_t bytes_copied = asio::buffer_copy( - buffers_, storage_.data(), storage_.size()); - storage_.consume(bytes_copied); - handler_(ec, bytes_copied); - } - } - - //private: - detail::buffered_stream_storage& storage_; - MutableBufferSequence buffers_; - ReadHandler handler_; - }; - - template - inline void* asio_handler_allocate(std::size_t size, - buffered_read_some_handler< - MutableBufferSequence, ReadHandler>* this_handler) - { - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); - } - - template - inline void asio_handler_deallocate(void* pointer, std::size_t size, - buffered_read_some_handler< - MutableBufferSequence, ReadHandler>* this_handler) - { - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); - } - - template - inline bool asio_handler_is_continuation( - buffered_read_some_handler< - MutableBufferSequence, ReadHandler>* this_handler) - { - return asio_handler_cont_helpers::is_continuation( - this_handler->handler_); - } - - template - inline void asio_handler_invoke(Function& function, - buffered_read_some_handler< - MutableBufferSequence, ReadHandler>* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - inline void asio_handler_invoke(const Function& function, - buffered_read_some_handler< - MutableBufferSequence, ReadHandler>* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } -} // namespace detail - -#if !defined(GENERATING_DOCUMENTATION) - -template -struct associated_allocator< - detail::buffered_read_some_handler, - Allocator> -{ - typedef typename associated_allocator::type type; - - static type get( - const detail::buffered_read_some_handler< - MutableBufferSequence, ReadHandler>& h, - const Allocator& a = Allocator()) ASIO_NOEXCEPT - { - return associated_allocator::get(h.handler_, a); - } -}; - -template -struct associated_executor< - detail::buffered_read_some_handler, - Executor> -{ - typedef typename associated_executor::type type; - - static type get( - const detail::buffered_read_some_handler< - MutableBufferSequence, ReadHandler>& h, - const Executor& ex = Executor()) ASIO_NOEXCEPT - { - return associated_executor::get(h.handler_, ex); - } -}; - -#endif // !defined(GENERATING_DOCUMENTATION) - -template -template -ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -buffered_read_stream::async_read_some( - const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - - async_completion init(handler); - - using asio::buffer_size; - if (buffer_size(buffers) == 0 || !storage_.empty()) - { - next_layer_.async_read_some(ASIO_MUTABLE_BUFFER(0, 0), - detail::buffered_read_some_handler< - MutableBufferSequence, ASIO_HANDLER_TYPE( - ReadHandler, void (asio::error_code, std::size_t))>( - storage_, buffers, init.completion_handler)); - } - else - { - this->async_fill(detail::buffered_read_some_handler< - MutableBufferSequence, ASIO_HANDLER_TYPE( - ReadHandler, void (asio::error_code, std::size_t))>( - storage_, buffers, init.completion_handler)); - } - - return init.result.get(); -} - -template -template -std::size_t buffered_read_stream::peek( - const MutableBufferSequence& buffers) -{ - if (storage_.empty()) - this->fill(); - return this->peek_copy(buffers); -} - -template -template -std::size_t buffered_read_stream::peek( - const MutableBufferSequence& buffers, asio::error_code& ec) -{ - ec = asio::error_code(); - if (storage_.empty() && !this->fill(ec)) - return 0; - return this->peek_copy(buffers); -} - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IMPL_BUFFERED_READ_STREAM_HPP diff --git a/tools/sdk/include/asio/asio/impl/buffered_write_stream.hpp b/tools/sdk/include/asio/asio/impl/buffered_write_stream.hpp deleted file mode 100644 index bc2d823ab7b..00000000000 --- a/tools/sdk/include/asio/asio/impl/buffered_write_stream.hpp +++ /dev/null @@ -1,411 +0,0 @@ -// -// impl/buffered_write_stream.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IMPL_BUFFERED_WRITE_STREAM_HPP -#define ASIO_IMPL_BUFFERED_WRITE_STREAM_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/associated_allocator.hpp" -#include "asio/associated_executor.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_cont_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/handler_type_requirements.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -template -std::size_t buffered_write_stream::flush() -{ - std::size_t bytes_written = write(next_layer_, - buffer(storage_.data(), storage_.size())); - storage_.consume(bytes_written); - return bytes_written; -} - -template -std::size_t buffered_write_stream::flush(asio::error_code& ec) -{ - std::size_t bytes_written = write(next_layer_, - buffer(storage_.data(), storage_.size()), - transfer_all(), ec); - storage_.consume(bytes_written); - return bytes_written; -} - -namespace detail -{ - template - class buffered_flush_handler - { - public: - buffered_flush_handler(detail::buffered_stream_storage& storage, - WriteHandler& handler) - : storage_(storage), - handler_(ASIO_MOVE_CAST(WriteHandler)(handler)) - { - } - -#if defined(ASIO_HAS_MOVE) - buffered_flush_handler(const buffered_flush_handler& other) - : storage_(other.storage_), - handler_(other.handler_) - { - } - - buffered_flush_handler(buffered_flush_handler&& other) - : storage_(other.storage_), - handler_(ASIO_MOVE_CAST(WriteHandler)(other.handler_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()(const asio::error_code& ec, - const std::size_t bytes_written) - { - storage_.consume(bytes_written); - handler_(ec, bytes_written); - } - - //private: - detail::buffered_stream_storage& storage_; - WriteHandler handler_; - }; - - template - inline void* asio_handler_allocate(std::size_t size, - buffered_flush_handler* this_handler) - { - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); - } - - template - inline void asio_handler_deallocate(void* pointer, std::size_t size, - buffered_flush_handler* this_handler) - { - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); - } - - template - inline bool asio_handler_is_continuation( - buffered_flush_handler* this_handler) - { - return asio_handler_cont_helpers::is_continuation( - this_handler->handler_); - } - - template - inline void asio_handler_invoke(Function& function, - buffered_flush_handler* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - inline void asio_handler_invoke(const Function& function, - buffered_flush_handler* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } -} // namespace detail - -#if !defined(GENERATING_DOCUMENTATION) - -template -struct associated_allocator< - detail::buffered_flush_handler, Allocator> -{ - typedef typename associated_allocator::type type; - - static type get(const detail::buffered_flush_handler& h, - const Allocator& a = Allocator()) ASIO_NOEXCEPT - { - return associated_allocator::get(h.handler_, a); - } -}; - -template -struct associated_executor< - detail::buffered_flush_handler, Executor> -{ - typedef typename associated_executor::type type; - - static type get(const detail::buffered_flush_handler& h, - const Executor& ex = Executor()) ASIO_NOEXCEPT - { - return associated_executor::get(h.handler_, ex); - } -}; - -#endif // !defined(GENERATING_DOCUMENTATION) - -template -template -ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) -buffered_write_stream::async_flush( - ASIO_MOVE_ARG(WriteHandler) handler) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - - async_completion init(handler); - - async_write(next_layer_, buffer(storage_.data(), storage_.size()), - detail::buffered_flush_handler( - storage_, init.completion_handler)); - - return init.result.get(); -} - -template -template -std::size_t buffered_write_stream::write_some( - const ConstBufferSequence& buffers) -{ - using asio::buffer_size; - if (buffer_size(buffers) == 0) - return 0; - - if (storage_.size() == storage_.capacity()) - this->flush(); - - return this->copy(buffers); -} - -template -template -std::size_t buffered_write_stream::write_some( - const ConstBufferSequence& buffers, asio::error_code& ec) -{ - ec = asio::error_code(); - - using asio::buffer_size; - if (buffer_size(buffers) == 0) - return 0; - - if (storage_.size() == storage_.capacity() && !flush(ec)) - return 0; - - return this->copy(buffers); -} - -namespace detail -{ - template - class buffered_write_some_handler - { - public: - buffered_write_some_handler(detail::buffered_stream_storage& storage, - const ConstBufferSequence& buffers, WriteHandler& handler) - : storage_(storage), - buffers_(buffers), - handler_(ASIO_MOVE_CAST(WriteHandler)(handler)) - { - } - -#if defined(ASIO_HAS_MOVE) - buffered_write_some_handler(const buffered_write_some_handler& other) - : storage_(other.storage_), - buffers_(other.buffers_), - handler_(other.handler_) - { - } - - buffered_write_some_handler(buffered_write_some_handler&& other) - : storage_(other.storage_), - buffers_(other.buffers_), - handler_(ASIO_MOVE_CAST(WriteHandler)(other.handler_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()(const asio::error_code& ec, std::size_t) - { - if (ec) - { - const std::size_t length = 0; - handler_(ec, length); - } - else - { - using asio::buffer_size; - std::size_t orig_size = storage_.size(); - std::size_t space_avail = storage_.capacity() - orig_size; - std::size_t bytes_avail = buffer_size(buffers_); - std::size_t length = bytes_avail < space_avail - ? bytes_avail : space_avail; - storage_.resize(orig_size + length); - const std::size_t bytes_copied = asio::buffer_copy( - storage_.data() + orig_size, buffers_, length); - handler_(ec, bytes_copied); - } - } - - //private: - detail::buffered_stream_storage& storage_; - ConstBufferSequence buffers_; - WriteHandler handler_; - }; - - template - inline void* asio_handler_allocate(std::size_t size, - buffered_write_some_handler< - ConstBufferSequence, WriteHandler>* this_handler) - { - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); - } - - template - inline void asio_handler_deallocate(void* pointer, std::size_t size, - buffered_write_some_handler< - ConstBufferSequence, WriteHandler>* this_handler) - { - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); - } - - template - inline bool asio_handler_is_continuation( - buffered_write_some_handler< - ConstBufferSequence, WriteHandler>* this_handler) - { - return asio_handler_cont_helpers::is_continuation( - this_handler->handler_); - } - - template - inline void asio_handler_invoke(Function& function, - buffered_write_some_handler< - ConstBufferSequence, WriteHandler>* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - inline void asio_handler_invoke(const Function& function, - buffered_write_some_handler< - ConstBufferSequence, WriteHandler>* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } -} // namespace detail - -#if !defined(GENERATING_DOCUMENTATION) - -template -struct associated_allocator< - detail::buffered_write_some_handler, - Allocator> -{ - typedef typename associated_allocator::type type; - - static type get( - const detail::buffered_write_some_handler< - ConstBufferSequence, WriteHandler>& h, - const Allocator& a = Allocator()) ASIO_NOEXCEPT - { - return associated_allocator::get(h.handler_, a); - } -}; - -template -struct associated_executor< - detail::buffered_write_some_handler, - Executor> -{ - typedef typename associated_executor::type type; - - static type get( - const detail::buffered_write_some_handler< - ConstBufferSequence, WriteHandler>& h, - const Executor& ex = Executor()) ASIO_NOEXCEPT - { - return associated_executor::get(h.handler_, ex); - } -}; - -#endif // !defined(GENERATING_DOCUMENTATION) - -template -template -ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) -buffered_write_stream::async_write_some( - const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - - async_completion init(handler); - - using asio::buffer_size; - if (buffer_size(buffers) == 0 - || storage_.size() < storage_.capacity()) - { - next_layer_.async_write_some(ASIO_CONST_BUFFER(0, 0), - detail::buffered_write_some_handler< - ConstBufferSequence, ASIO_HANDLER_TYPE( - WriteHandler, void (asio::error_code, std::size_t))>( - storage_, buffers, init.completion_handler)); - } - else - { - this->async_flush(detail::buffered_write_some_handler< - ConstBufferSequence, ASIO_HANDLER_TYPE( - WriteHandler, void (asio::error_code, std::size_t))>( - storage_, buffers, init.completion_handler)); - } - - return init.result.get(); -} - -template -template -std::size_t buffered_write_stream::copy( - const ConstBufferSequence& buffers) -{ - using asio::buffer_size; - std::size_t orig_size = storage_.size(); - std::size_t space_avail = storage_.capacity() - orig_size; - std::size_t bytes_avail = buffer_size(buffers); - std::size_t length = bytes_avail < space_avail ? bytes_avail : space_avail; - storage_.resize(orig_size + length); - return asio::buffer_copy( - storage_.data() + orig_size, buffers, length); -} - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IMPL_BUFFERED_WRITE_STREAM_HPP diff --git a/tools/sdk/include/asio/asio/impl/connect.hpp b/tools/sdk/include/asio/asio/impl/connect.hpp deleted file mode 100644 index bff1913b1fb..00000000000 --- a/tools/sdk/include/asio/asio/impl/connect.hpp +++ /dev/null @@ -1,860 +0,0 @@ -// -// impl/connect.hpp -// ~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IMPL_CONNECT_HPP -#define ASIO_IMPL_CONNECT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include -#include "asio/associated_allocator.hpp" -#include "asio/associated_executor.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_cont_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/error.hpp" -#include "asio/post.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -namespace detail -{ - struct default_connect_condition - { - template - bool operator()(const asio::error_code&, const Endpoint&) - { - return true; - } - }; - - template - inline typename Protocol::endpoint deref_connect_result( - Iterator iter, asio::error_code& ec) - { - return ec ? typename Protocol::endpoint() : *iter; - } - - template - struct legacy_connect_condition_helper : T - { - typedef char (*fallback_func_type)(...); - operator fallback_func_type() const; - }; - - template - struct legacy_connect_condition_helper - { - R operator()(Arg1, Arg2) const; - char operator()(...) const; - }; - - template - struct is_legacy_connect_condition - { - static char asio_connect_condition_check(char); - static char (&asio_connect_condition_check(Iterator))[2]; - - static const bool value = - sizeof(asio_connect_condition_check( - (*static_cast*>(0))( - *static_cast(0), - *static_cast(0)))) != 1; - }; - - template - inline Iterator call_connect_condition(ConnectCondition& connect_condition, - const asio::error_code& ec, Iterator next, Iterator end, - typename enable_if::value>::type* = 0) - { - if (next != end) - return connect_condition(ec, next); - return end; - } - - template - inline Iterator call_connect_condition(ConnectCondition& connect_condition, - const asio::error_code& ec, Iterator next, Iterator end, - typename enable_if::value>::type* = 0) - { - for (;next != end; ++next) - if (connect_condition(ec, *next)) - return next; - return end; - } -} - -template -typename Protocol::endpoint connect( - basic_socket& s, - const EndpointSequence& endpoints, - typename enable_if::value>::type*) -{ - asio::error_code ec; - typename Protocol::endpoint result = connect(s, endpoints, ec); - asio::detail::throw_error(ec, "connect"); - return result; -} - -template -typename Protocol::endpoint connect( - basic_socket& s, - const EndpointSequence& endpoints, asio::error_code& ec, - typename enable_if::value>::type*) -{ - return detail::deref_connect_result( - connect(s, endpoints.begin(), endpoints.end(), - detail::default_connect_condition(), ec), ec); -} - -#if !defined(ASIO_NO_DEPRECATED) -template -Iterator connect(basic_socket& s, Iterator begin, - typename enable_if::value>::type*) -{ - asio::error_code ec; - Iterator result = connect(s, begin, ec); - asio::detail::throw_error(ec, "connect"); - return result; -} - -template -inline Iterator connect(basic_socket& s, - Iterator begin, asio::error_code& ec, - typename enable_if::value>::type*) -{ - return connect(s, begin, Iterator(), detail::default_connect_condition(), ec); -} -#endif // !defined(ASIO_NO_DEPRECATED) - -template -Iterator connect(basic_socket& s, - Iterator begin, Iterator end) -{ - asio::error_code ec; - Iterator result = connect(s, begin, end, ec); - asio::detail::throw_error(ec, "connect"); - return result; -} - -template -inline Iterator connect(basic_socket& s, - Iterator begin, Iterator end, asio::error_code& ec) -{ - return connect(s, begin, end, detail::default_connect_condition(), ec); -} - -template -typename Protocol::endpoint connect( - basic_socket& s, - const EndpointSequence& endpoints, ConnectCondition connect_condition, - typename enable_if::value>::type*) -{ - asio::error_code ec; - typename Protocol::endpoint result = connect( - s, endpoints, connect_condition, ec); - asio::detail::throw_error(ec, "connect"); - return result; -} - -template -typename Protocol::endpoint connect( - basic_socket& s, - const EndpointSequence& endpoints, ConnectCondition connect_condition, - asio::error_code& ec, - typename enable_if::value>::type*) -{ - return detail::deref_connect_result( - connect(s, endpoints.begin(), endpoints.end(), - connect_condition, ec), ec); -} - -#if !defined(ASIO_NO_DEPRECATED) -template -Iterator connect(basic_socket& s, - Iterator begin, ConnectCondition connect_condition, - typename enable_if::value>::type*) -{ - asio::error_code ec; - Iterator result = connect(s, begin, connect_condition, ec); - asio::detail::throw_error(ec, "connect"); - return result; -} - -template -inline Iterator connect(basic_socket& s, - Iterator begin, ConnectCondition connect_condition, - asio::error_code& ec, - typename enable_if::value>::type*) -{ - return connect(s, begin, Iterator(), connect_condition, ec); -} -#endif // !defined(ASIO_NO_DEPRECATED) - -template -Iterator connect(basic_socket& s, - Iterator begin, Iterator end, ConnectCondition connect_condition) -{ - asio::error_code ec; - Iterator result = connect(s, begin, end, connect_condition, ec); - asio::detail::throw_error(ec, "connect"); - return result; -} - -template -Iterator connect(basic_socket& s, - Iterator begin, Iterator end, ConnectCondition connect_condition, - asio::error_code& ec) -{ - ec = asio::error_code(); - - for (Iterator iter = begin; iter != end; ++iter) - { - iter = (detail::call_connect_condition(connect_condition, ec, iter, end)); - if (iter != end) - { - s.close(ec); - s.connect(*iter, ec); - if (!ec) - return iter; - } - else - break; - } - - if (!ec) - ec = asio::error::not_found; - - return end; -} - -namespace detail -{ - // Enable the empty base class optimisation for the connect condition. - template - class base_from_connect_condition - { - protected: - explicit base_from_connect_condition( - const ConnectCondition& connect_condition) - : connect_condition_(connect_condition) - { - } - - template - void check_condition(const asio::error_code& ec, - Iterator& iter, Iterator& end) - { - iter = detail::call_connect_condition(connect_condition_, ec, iter, end); - } - - private: - ConnectCondition connect_condition_; - }; - - // The default_connect_condition implementation is essentially a no-op. This - // template specialisation lets us eliminate all costs associated with it. - template <> - class base_from_connect_condition - { - protected: - explicit base_from_connect_condition(const default_connect_condition&) - { - } - - template - void check_condition(const asio::error_code&, Iterator&, Iterator&) - { - } - }; - - template - class range_connect_op : base_from_connect_condition - { - public: - range_connect_op(basic_socket& sock, - const EndpointSequence& endpoints, - const ConnectCondition& connect_condition, - RangeConnectHandler& handler) - : base_from_connect_condition(connect_condition), - socket_(sock), - endpoints_(endpoints), - index_(0), - start_(0), - handler_(ASIO_MOVE_CAST(RangeConnectHandler)(handler)) - { - } - -#if defined(ASIO_HAS_MOVE) - range_connect_op(const range_connect_op& other) - : base_from_connect_condition(other), - socket_(other.socket_), - endpoints_(other.endpoints_), - index_(other.index_), - start_(other.start_), - handler_(other.handler_) - { - } - - range_connect_op(range_connect_op&& other) - : base_from_connect_condition(other), - socket_(other.socket_), - endpoints_(other.endpoints_), - index_(other.index_), - start_(other.start_), - handler_(ASIO_MOVE_CAST(RangeConnectHandler)(other.handler_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()(asio::error_code ec, int start = 0) - { - typename EndpointSequence::const_iterator begin = endpoints_.begin(); - typename EndpointSequence::const_iterator iter = begin; - std::advance(iter, index_); - typename EndpointSequence::const_iterator end = endpoints_.end(); - - switch (start_ = start) - { - case 1: - for (;;) - { - this->check_condition(ec, iter, end); - index_ = std::distance(begin, iter); - - if (iter != end) - { - socket_.close(ec); - socket_.async_connect(*iter, - ASIO_MOVE_CAST(range_connect_op)(*this)); - return; - } - - if (start) - { - ec = asio::error::not_found; - asio::post(socket_.get_executor(), - detail::bind_handler( - ASIO_MOVE_CAST(range_connect_op)(*this), ec)); - return; - } - - default: - - if (iter == end) - break; - - if (!socket_.is_open()) - { - ec = asio::error::operation_aborted; - break; - } - - if (!ec) - break; - - ++iter; - ++index_; - } - - handler_(static_cast(ec), - static_cast( - ec || iter == end ? typename Protocol::endpoint() : *iter)); - } - } - - //private: - basic_socket& socket_; - EndpointSequence endpoints_; - std::size_t index_; - int start_; - RangeConnectHandler handler_; - }; - - template - inline void* asio_handler_allocate(std::size_t size, - range_connect_op* this_handler) - { - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); - } - - template - inline void asio_handler_deallocate(void* pointer, std::size_t size, - range_connect_op* this_handler) - { - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); - } - - template - inline bool asio_handler_is_continuation( - range_connect_op* this_handler) - { - return asio_handler_cont_helpers::is_continuation( - this_handler->handler_); - } - - template - inline void asio_handler_invoke(Function& function, - range_connect_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - inline void asio_handler_invoke(const Function& function, - range_connect_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - class iterator_connect_op : base_from_connect_condition - { - public: - iterator_connect_op(basic_socket& sock, - const Iterator& begin, const Iterator& end, - const ConnectCondition& connect_condition, - IteratorConnectHandler& handler) - : base_from_connect_condition(connect_condition), - socket_(sock), - iter_(begin), - end_(end), - start_(0), - handler_(ASIO_MOVE_CAST(IteratorConnectHandler)(handler)) - { - } - -#if defined(ASIO_HAS_MOVE) - iterator_connect_op(const iterator_connect_op& other) - : base_from_connect_condition(other), - socket_(other.socket_), - iter_(other.iter_), - end_(other.end_), - start_(other.start_), - handler_(other.handler_) - { - } - - iterator_connect_op(iterator_connect_op&& other) - : base_from_connect_condition(other), - socket_(other.socket_), - iter_(other.iter_), - end_(other.end_), - start_(other.start_), - handler_(ASIO_MOVE_CAST(IteratorConnectHandler)(other.handler_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()(asio::error_code ec, int start = 0) - { - switch (start_ = start) - { - case 1: - for (;;) - { - this->check_condition(ec, iter_, end_); - - if (iter_ != end_) - { - socket_.close(ec); - socket_.async_connect(*iter_, - ASIO_MOVE_CAST(iterator_connect_op)(*this)); - return; - } - - if (start) - { - ec = asio::error::not_found; - asio::post(socket_.get_executor(), - detail::bind_handler( - ASIO_MOVE_CAST(iterator_connect_op)(*this), ec)); - return; - } - - default: - - if (iter_ == end_) - break; - - if (!socket_.is_open()) - { - ec = asio::error::operation_aborted; - break; - } - - if (!ec) - break; - - ++iter_; - } - - handler_(static_cast(ec), - static_cast(iter_)); - } - } - - //private: - basic_socket& socket_; - Iterator iter_; - Iterator end_; - int start_; - IteratorConnectHandler handler_; - }; - - template - inline void* asio_handler_allocate(std::size_t size, - iterator_connect_op* this_handler) - { - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); - } - - template - inline void asio_handler_deallocate(void* pointer, std::size_t size, - iterator_connect_op* this_handler) - { - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); - } - - template - inline bool asio_handler_is_continuation( - iterator_connect_op* this_handler) - { - return asio_handler_cont_helpers::is_continuation( - this_handler->handler_); - } - - template - inline void asio_handler_invoke(Function& function, - iterator_connect_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - inline void asio_handler_invoke(const Function& function, - iterator_connect_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } -} // namespace detail - -#if !defined(GENERATING_DOCUMENTATION) - -template -struct associated_allocator< - detail::range_connect_op, - Allocator> -{ - typedef typename associated_allocator< - RangeConnectHandler, Allocator>::type type; - - static type get( - const detail::range_connect_op& h, - const Allocator& a = Allocator()) ASIO_NOEXCEPT - { - return associated_allocator::get(h.handler_, a); - } -}; - -template -struct associated_executor< - detail::range_connect_op, - Executor> -{ - typedef typename associated_executor< - RangeConnectHandler, Executor>::type type; - - static type get( - const detail::range_connect_op& h, - const Executor& ex = Executor()) ASIO_NOEXCEPT - { - return associated_executor::get(h.handler_, ex); - } -}; - -template -struct associated_allocator< - detail::iterator_connect_op, - Allocator> -{ - typedef typename associated_allocator< - IteratorConnectHandler, Allocator>::type type; - - static type get( - const detail::iterator_connect_op& h, - const Allocator& a = Allocator()) ASIO_NOEXCEPT - { - return associated_allocator::get(h.handler_, a); - } -}; - -template -struct associated_executor< - detail::iterator_connect_op, - Executor> -{ - typedef typename associated_executor< - IteratorConnectHandler, Executor>::type type; - - static type get( - const detail::iterator_connect_op& h, - const Executor& ex = Executor()) ASIO_NOEXCEPT - { - return associated_executor::get(h.handler_, ex); - } -}; - -#endif // !defined(GENERATING_DOCUMENTATION) - -template -inline ASIO_INITFN_RESULT_TYPE(RangeConnectHandler, - void (asio::error_code, typename Protocol::endpoint)) -async_connect(basic_socket& s, - const EndpointSequence& endpoints, - ASIO_MOVE_ARG(RangeConnectHandler) handler, - typename enable_if::value>::type*) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a RangeConnectHandler. - ASIO_RANGE_CONNECT_HANDLER_CHECK( - RangeConnectHandler, handler, typename Protocol::endpoint) type_check; - - async_completion - init(handler); - - detail::range_connect_op(s, - endpoints, detail::default_connect_condition(), - init.completion_handler)(asio::error_code(), 1); - - return init.result.get(); -} - -#if !defined(ASIO_NO_DEPRECATED) -template -inline ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler, - void (asio::error_code, Iterator)) -async_connect(basic_socket& s, - Iterator begin, ASIO_MOVE_ARG(IteratorConnectHandler) handler, - typename enable_if::value>::type*) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a IteratorConnectHandler. - ASIO_ITERATOR_CONNECT_HANDLER_CHECK( - IteratorConnectHandler, handler, Iterator) type_check; - - async_completion init(handler); - - detail::iterator_connect_op(s, - begin, Iterator(), detail::default_connect_condition(), - init.completion_handler)(asio::error_code(), 1); - - return init.result.get(); -} -#endif // !defined(ASIO_NO_DEPRECATED) - -template -inline ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler, - void (asio::error_code, Iterator)) -async_connect(basic_socket& s, - Iterator begin, Iterator end, - ASIO_MOVE_ARG(IteratorConnectHandler) handler) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a IteratorConnectHandler. - ASIO_ITERATOR_CONNECT_HANDLER_CHECK( - IteratorConnectHandler, handler, Iterator) type_check; - - async_completion init(handler); - - detail::iterator_connect_op(s, - begin, end, detail::default_connect_condition(), - init.completion_handler)(asio::error_code(), 1); - - return init.result.get(); -} - -template -inline ASIO_INITFN_RESULT_TYPE(RangeConnectHandler, - void (asio::error_code, typename Protocol::endpoint)) -async_connect(basic_socket& s, - const EndpointSequence& endpoints, ConnectCondition connect_condition, - ASIO_MOVE_ARG(RangeConnectHandler) handler, - typename enable_if::value>::type*) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a RangeConnectHandler. - ASIO_RANGE_CONNECT_HANDLER_CHECK( - RangeConnectHandler, handler, typename Protocol::endpoint) type_check; - - async_completion - init(handler); - - detail::range_connect_op(s, - endpoints, connect_condition, init.completion_handler)( - asio::error_code(), 1); - - return init.result.get(); -} - -#if !defined(ASIO_NO_DEPRECATED) -template -inline ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler, - void (asio::error_code, Iterator)) -async_connect(basic_socket& s, - Iterator begin, ConnectCondition connect_condition, - ASIO_MOVE_ARG(IteratorConnectHandler) handler, - typename enable_if::value>::type*) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a IteratorConnectHandler. - ASIO_ITERATOR_CONNECT_HANDLER_CHECK( - IteratorConnectHandler, handler, Iterator) type_check; - - async_completion init(handler); - - detail::iterator_connect_op(s, - begin, Iterator(), connect_condition, init.completion_handler)( - asio::error_code(), 1); - - return init.result.get(); -} -#endif // !defined(ASIO_NO_DEPRECATED) - -template -inline ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler, - void (asio::error_code, Iterator)) -async_connect(basic_socket& s, - Iterator begin, Iterator end, ConnectCondition connect_condition, - ASIO_MOVE_ARG(IteratorConnectHandler) handler) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a IteratorConnectHandler. - ASIO_ITERATOR_CONNECT_HANDLER_CHECK( - IteratorConnectHandler, handler, Iterator) type_check; - - async_completion init(handler); - - detail::iterator_connect_op(s, - begin, end, connect_condition, init.completion_handler)( - asio::error_code(), 1); - - return init.result.get(); -} - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IMPL_CONNECT_HPP diff --git a/tools/sdk/include/asio/asio/impl/defer.hpp b/tools/sdk/include/asio/asio/impl/defer.hpp deleted file mode 100644 index a27df0f134b..00000000000 --- a/tools/sdk/include/asio/asio/impl/defer.hpp +++ /dev/null @@ -1,77 +0,0 @@ -// -// impl/defer.hpp -// ~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IMPL_DEFER_HPP -#define ASIO_IMPL_DEFER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/associated_allocator.hpp" -#include "asio/associated_executor.hpp" -#include "asio/detail/work_dispatcher.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -template -ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) defer( - ASIO_MOVE_ARG(CompletionToken) token) -{ - typedef ASIO_HANDLER_TYPE(CompletionToken, void()) handler; - - async_completion init(token); - - typename associated_executor::type ex( - (get_associated_executor)(init.completion_handler)); - - typename associated_allocator::type alloc( - (get_associated_allocator)(init.completion_handler)); - - ex.defer(ASIO_MOVE_CAST(handler)(init.completion_handler), alloc); - - return init.result.get(); -} - -template -ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) defer( - const Executor& ex, ASIO_MOVE_ARG(CompletionToken) token, - typename enable_if::value>::type*) -{ - typedef ASIO_HANDLER_TYPE(CompletionToken, void()) handler; - - async_completion init(token); - - typename associated_allocator::type alloc( - (get_associated_allocator)(init.completion_handler)); - - ex.defer(detail::work_dispatcher(init.completion_handler), alloc); - - return init.result.get(); -} - -template -inline ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) defer( - ExecutionContext& ctx, ASIO_MOVE_ARG(CompletionToken) token, - typename enable_if::value>::type*) -{ - return (defer)(ctx.get_executor(), - ASIO_MOVE_CAST(CompletionToken)(token)); -} - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IMPL_DEFER_HPP diff --git a/tools/sdk/include/asio/asio/impl/dispatch.hpp b/tools/sdk/include/asio/asio/impl/dispatch.hpp deleted file mode 100644 index 4e11c6b2eba..00000000000 --- a/tools/sdk/include/asio/asio/impl/dispatch.hpp +++ /dev/null @@ -1,78 +0,0 @@ -// -// impl/dispatch.hpp -// ~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IMPL_DISPATCH_HPP -#define ASIO_IMPL_DISPATCH_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/associated_allocator.hpp" -#include "asio/associated_executor.hpp" -#include "asio/detail/work_dispatcher.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -template -ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) dispatch( - ASIO_MOVE_ARG(CompletionToken) token) -{ - typedef ASIO_HANDLER_TYPE(CompletionToken, void()) handler; - - async_completion init(token); - - typename associated_executor::type ex( - (get_associated_executor)(init.completion_handler)); - - typename associated_allocator::type alloc( - (get_associated_allocator)(init.completion_handler)); - - ex.dispatch(ASIO_MOVE_CAST(handler)(init.completion_handler), alloc); - - return init.result.get(); -} - -template -ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) dispatch( - const Executor& ex, ASIO_MOVE_ARG(CompletionToken) token, - typename enable_if::value>::type*) -{ - typedef ASIO_HANDLER_TYPE(CompletionToken, void()) handler; - - async_completion init(token); - - typename associated_allocator::type alloc( - (get_associated_allocator)(init.completion_handler)); - - ex.dispatch(detail::work_dispatcher( - init.completion_handler), alloc); - - return init.result.get(); -} - -template -inline ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) dispatch( - ExecutionContext& ctx, ASIO_MOVE_ARG(CompletionToken) token, - typename enable_if::value>::type*) -{ - return (dispatch)(ctx.get_executor(), - ASIO_MOVE_CAST(CompletionToken)(token)); -} - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IMPL_DISPATCH_HPP diff --git a/tools/sdk/include/asio/asio/impl/execution_context.hpp b/tools/sdk/include/asio/asio/impl/execution_context.hpp deleted file mode 100644 index 3d1e457e74e..00000000000 --- a/tools/sdk/include/asio/asio/impl/execution_context.hpp +++ /dev/null @@ -1,107 +0,0 @@ -// -// impl/execution_context.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IMPL_EXECUTION_CONTEXT_HPP -#define ASIO_IMPL_EXECUTION_CONTEXT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/scoped_ptr.hpp" -#include "asio/detail/service_registry.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -template -inline Service& use_service(execution_context& e) -{ - // Check that Service meets the necessary type requirements. - (void)static_cast(static_cast(0)); - - return e.service_registry_->template use_service(); -} - -#if !defined(GENERATING_DOCUMENTATION) -# if defined(ASIO_HAS_VARIADIC_TEMPLATES) - -template -Service& make_service(execution_context& e, ASIO_MOVE_ARG(Args)... args) -{ - detail::scoped_ptr svc( - new Service(e, ASIO_MOVE_CAST(Args)(args)...)); - e.service_registry_->template add_service(svc.get()); - Service& result = *svc; - svc.release(); - return result; -} - -# else // defined(ASIO_HAS_VARIADIC_TEMPLATES) - -template -Service& make_service(execution_context& e) -{ - detail::scoped_ptr svc(new Service(e)); - e.service_registry_->template add_service(svc.get()); - Service& result = *svc; - svc.release(); - return result; -} - -#define ASIO_PRIVATE_MAKE_SERVICE_DEF(n) \ - template \ - Service& make_service(execution_context& e, \ - ASIO_VARIADIC_MOVE_PARAMS(n)) \ - { \ - detail::scoped_ptr svc( \ - new Service(e, ASIO_VARIADIC_MOVE_ARGS(n))); \ - e.service_registry_->template add_service(svc.get()); \ - Service& result = *svc; \ - svc.release(); \ - return result; \ - } \ - /**/ - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_MAKE_SERVICE_DEF) -#undef ASIO_PRIVATE_MAKE_SERVICE_DEF - -# endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) -#endif // !defined(GENERATING_DOCUMENTATION) - -template -inline void add_service(execution_context& e, Service* svc) -{ - // Check that Service meets the necessary type requirements. - (void)static_cast(static_cast(0)); - - e.service_registry_->template add_service(svc); -} - -template -inline bool has_service(execution_context& e) -{ - // Check that Service meets the necessary type requirements. - (void)static_cast(static_cast(0)); - - return e.service_registry_->template has_service(); -} - -inline execution_context& execution_context::service::context() -{ - return owner_; -} - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IMPL_EXECUTION_CONTEXT_HPP diff --git a/tools/sdk/include/asio/asio/impl/executor.hpp b/tools/sdk/include/asio/asio/impl/executor.hpp deleted file mode 100644 index 0fcf5f54a0e..00000000000 --- a/tools/sdk/include/asio/asio/impl/executor.hpp +++ /dev/null @@ -1,386 +0,0 @@ -// -// impl/executor.hpp -// ~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IMPL_EXECUTOR_HPP -#define ASIO_IMPL_EXECUTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/atomic_count.hpp" -#include "asio/detail/executor_op.hpp" -#include "asio/detail/global.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/recycling_allocator.hpp" -#include "asio/executor.hpp" -#include "asio/system_executor.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -#if !defined(GENERATING_DOCUMENTATION) - -#if defined(ASIO_HAS_MOVE) - -// Lightweight, move-only function object wrapper. -class executor::function -{ -public: - template - explicit function(F f, const Alloc& a) - { - // Allocate and construct an operation to wrap the function. - typedef detail::executor_op op; - typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 }; - op_ = new (p.v) op(ASIO_MOVE_CAST(F)(f), a); - p.v = 0; - } - - function(function&& other) - : op_(other.op_) - { - other.op_ = 0; - } - - ~function() - { - if (op_) - op_->destroy(); - } - - void operator()() - { - if (op_) - { - detail::scheduler_operation* op = op_; - op_ = 0; - op->complete(this, asio::error_code(), 0); - } - } - -private: - detail::scheduler_operation* op_; -}; - -#else // defined(ASIO_HAS_MOVE) - -// Not so lightweight, copyable function object wrapper. -class executor::function -{ -public: - template - explicit function(const F& f, const Alloc&) - : impl_(new impl(f)) - { - } - - void operator()() - { - impl_->invoke_(impl_.get()); - } - -private: - // Base class for polymorphic function implementations. - struct impl_base - { - void (*invoke_)(impl_base*); - }; - - // Polymorphic function implementation. - template - struct impl : impl_base - { - impl(const F& f) - : function_(f) - { - invoke_ = &function::invoke; - } - - F function_; - }; - - // Helper to invoke a function. - template - static void invoke(impl_base* i) - { - static_cast*>(i)->function_(); - } - - detail::shared_ptr impl_; -}; - -#endif // defined(ASIO_HAS_MOVE) - -// Default polymorphic allocator implementation. -template -class executor::impl - : public executor::impl_base -{ -public: - typedef ASIO_REBIND_ALLOC(Allocator, impl) allocator_type; - - static impl_base* create(const Executor& e, Allocator a = Allocator()) - { - raw_mem mem(a); - impl* p = new (mem.ptr_) impl(e, a); - mem.ptr_ = 0; - return p; - } - - impl(const Executor& e, const Allocator& a) ASIO_NOEXCEPT - : impl_base(false), - ref_count_(1), - executor_(e), - allocator_(a) - { - } - - impl_base* clone() const ASIO_NOEXCEPT - { - ++ref_count_; - return const_cast(static_cast(this)); - } - - void destroy() ASIO_NOEXCEPT - { - if (--ref_count_ == 0) - { - allocator_type alloc(allocator_); - impl* p = this; - p->~impl(); - alloc.deallocate(p, 1); - } - } - - void on_work_started() ASIO_NOEXCEPT - { - executor_.on_work_started(); - } - - void on_work_finished() ASIO_NOEXCEPT - { - executor_.on_work_finished(); - } - - execution_context& context() ASIO_NOEXCEPT - { - return executor_.context(); - } - - void dispatch(ASIO_MOVE_ARG(function) f) - { - executor_.dispatch(ASIO_MOVE_CAST(function)(f), allocator_); - } - - void post(ASIO_MOVE_ARG(function) f) - { - executor_.post(ASIO_MOVE_CAST(function)(f), allocator_); - } - - void defer(ASIO_MOVE_ARG(function) f) - { - executor_.defer(ASIO_MOVE_CAST(function)(f), allocator_); - } - - type_id_result_type target_type() const ASIO_NOEXCEPT - { - return type_id(); - } - - void* target() ASIO_NOEXCEPT - { - return &executor_; - } - - const void* target() const ASIO_NOEXCEPT - { - return &executor_; - } - - bool equals(const impl_base* e) const ASIO_NOEXCEPT - { - if (this == e) - return true; - if (target_type() != e->target_type()) - return false; - return executor_ == *static_cast(e->target()); - } - -private: - mutable detail::atomic_count ref_count_; - Executor executor_; - Allocator allocator_; - - struct raw_mem - { - allocator_type allocator_; - impl* ptr_; - - explicit raw_mem(const Allocator& a) - : allocator_(a), - ptr_(allocator_.allocate(1)) - { - } - - ~raw_mem() - { - if (ptr_) - allocator_.deallocate(ptr_, 1); - } - - private: - // Disallow copying and assignment. - raw_mem(const raw_mem&); - raw_mem operator=(const raw_mem&); - }; -}; - -// Polymorphic allocator specialisation for system_executor. -template -class executor::impl - : public executor::impl_base -{ -public: - static impl_base* create(const system_executor&, - const Allocator& = Allocator()) - { - return &detail::global > >(); - } - - impl() - : impl_base(true) - { - } - - impl_base* clone() const ASIO_NOEXCEPT - { - return const_cast(static_cast(this)); - } - - void destroy() ASIO_NOEXCEPT - { - } - - void on_work_started() ASIO_NOEXCEPT - { - executor_.on_work_started(); - } - - void on_work_finished() ASIO_NOEXCEPT - { - executor_.on_work_finished(); - } - - execution_context& context() ASIO_NOEXCEPT - { - return executor_.context(); - } - - void dispatch(ASIO_MOVE_ARG(function) f) - { - executor_.dispatch(ASIO_MOVE_CAST(function)(f), allocator_); - } - - void post(ASIO_MOVE_ARG(function) f) - { - executor_.post(ASIO_MOVE_CAST(function)(f), allocator_); - } - - void defer(ASIO_MOVE_ARG(function) f) - { - executor_.defer(ASIO_MOVE_CAST(function)(f), allocator_); - } - - type_id_result_type target_type() const ASIO_NOEXCEPT - { - return type_id(); - } - - void* target() ASIO_NOEXCEPT - { - return &executor_; - } - - const void* target() const ASIO_NOEXCEPT - { - return &executor_; - } - - bool equals(const impl_base* e) const ASIO_NOEXCEPT - { - return this == e; - } - -private: - system_executor executor_; - Allocator allocator_; -}; - -template -executor::executor(Executor e) - : impl_(impl >::create(e)) -{ -} - -template -executor::executor(allocator_arg_t, const Allocator& a, Executor e) - : impl_(impl::create(e, a)) -{ -} - -template -void executor::dispatch(ASIO_MOVE_ARG(Function) f, - const Allocator& a) const -{ - impl_base* i = get_impl(); - if (i->fast_dispatch_) - system_executor().dispatch(ASIO_MOVE_CAST(Function)(f), a); - else - i->dispatch(function(ASIO_MOVE_CAST(Function)(f), a)); -} - -template -void executor::post(ASIO_MOVE_ARG(Function) f, - const Allocator& a) const -{ - get_impl()->post(function(ASIO_MOVE_CAST(Function)(f), a)); -} - -template -void executor::defer(ASIO_MOVE_ARG(Function) f, - const Allocator& a) const -{ - get_impl()->defer(function(ASIO_MOVE_CAST(Function)(f), a)); -} - -template -Executor* executor::target() ASIO_NOEXCEPT -{ - return impl_ && impl_->target_type() == type_id() - ? static_cast(impl_->target()) : 0; -} - -template -const Executor* executor::target() const ASIO_NOEXCEPT -{ - return impl_ && impl_->target_type() == type_id() - ? static_cast(impl_->target()) : 0; -} - -#endif // !defined(GENERATING_DOCUMENTATION) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IMPL_EXECUTOR_HPP diff --git a/tools/sdk/include/asio/asio/impl/io_context.hpp b/tools/sdk/include/asio/asio/impl/io_context.hpp deleted file mode 100644 index eaf580da7fd..00000000000 --- a/tools/sdk/include/asio/asio/impl/io_context.hpp +++ /dev/null @@ -1,343 +0,0 @@ -// -// impl/io_context.hpp -// ~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IMPL_IO_CONTEXT_HPP -#define ASIO_IMPL_IO_CONTEXT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/completion_handler.hpp" -#include "asio/detail/executor_op.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/recycling_allocator.hpp" -#include "asio/detail/service_registry.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/detail/type_traits.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -template -inline Service& use_service(io_context& ioc) -{ - // Check that Service meets the necessary type requirements. - (void)static_cast(static_cast(0)); - (void)static_cast(&Service::id); - - return ioc.service_registry_->template use_service(ioc); -} - -template <> -inline detail::io_context_impl& use_service( - io_context& ioc) -{ - return ioc.impl_; -} - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HAS_IOCP) -# include "asio/detail/win_iocp_io_context.hpp" -#else -# include "asio/detail/scheduler.hpp" -#endif - -#include "asio/detail/push_options.hpp" - -namespace asio { - -inline io_context::executor_type -io_context::get_executor() ASIO_NOEXCEPT -{ - return executor_type(*this); -} - -#if defined(ASIO_HAS_CHRONO) - -template -std::size_t io_context::run_for( - const chrono::duration& rel_time) -{ - return this->run_until(chrono::steady_clock::now() + rel_time); -} - -template -std::size_t io_context::run_until( - const chrono::time_point& abs_time) -{ - std::size_t n = 0; - while (this->run_one_until(abs_time)) - if (n != (std::numeric_limits::max)()) - ++n; - return n; -} - -template -std::size_t io_context::run_one_for( - const chrono::duration& rel_time) -{ - return this->run_one_until(chrono::steady_clock::now() + rel_time); -} - -template -std::size_t io_context::run_one_until( - const chrono::time_point& abs_time) -{ - typename Clock::time_point now = Clock::now(); - while (now < abs_time) - { - typename Clock::duration rel_time = abs_time - now; - if (rel_time > chrono::seconds(1)) - rel_time = chrono::seconds(1); - - asio::error_code ec; - std::size_t s = impl_.wait_one( - static_cast(chrono::duration_cast< - chrono::microseconds>(rel_time).count()), ec); - asio::detail::throw_error(ec); - - if (s || impl_.stopped()) - return s; - - now = Clock::now(); - } - - return 0; -} - -#endif // defined(ASIO_HAS_CHRONO) - -#if !defined(ASIO_NO_DEPRECATED) - -inline void io_context::reset() -{ - restart(); -} - -template -ASIO_INITFN_RESULT_TYPE(LegacyCompletionHandler, void ()) -io_context::dispatch(ASIO_MOVE_ARG(LegacyCompletionHandler) handler) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a LegacyCompletionHandler. - ASIO_LEGACY_COMPLETION_HANDLER_CHECK( - LegacyCompletionHandler, handler) type_check; - - async_completion init(handler); - - if (impl_.can_dispatch()) - { - detail::fenced_block b(detail::fenced_block::full); - asio_handler_invoke_helpers::invoke( - init.completion_handler, init.completion_handler); - } - else - { - // Allocate and construct an operation to wrap the handler. - typedef detail::completion_handler< - typename handler_type::type> op; - typename op::ptr p = { detail::addressof(init.completion_handler), - op::ptr::allocate(init.completion_handler), 0 }; - p.p = new (p.v) op(init.completion_handler); - - ASIO_HANDLER_CREATION((*this, *p.p, - "io_context", this, 0, "dispatch")); - - impl_.do_dispatch(p.p); - p.v = p.p = 0; - } - - return init.result.get(); -} - -template -ASIO_INITFN_RESULT_TYPE(LegacyCompletionHandler, void ()) -io_context::post(ASIO_MOVE_ARG(LegacyCompletionHandler) handler) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a LegacyCompletionHandler. - ASIO_LEGACY_COMPLETION_HANDLER_CHECK( - LegacyCompletionHandler, handler) type_check; - - async_completion init(handler); - - bool is_continuation = - asio_handler_cont_helpers::is_continuation(init.completion_handler); - - // Allocate and construct an operation to wrap the handler. - typedef detail::completion_handler< - typename handler_type::type> op; - typename op::ptr p = { detail::addressof(init.completion_handler), - op::ptr::allocate(init.completion_handler), 0 }; - p.p = new (p.v) op(init.completion_handler); - - ASIO_HANDLER_CREATION((*this, *p.p, - "io_context", this, 0, "post")); - - impl_.post_immediate_completion(p.p, is_continuation); - p.v = p.p = 0; - - return init.result.get(); -} - -template -#if defined(GENERATING_DOCUMENTATION) -unspecified -#else -inline detail::wrapped_handler -#endif -io_context::wrap(Handler handler) -{ - return detail::wrapped_handler(*this, handler); -} - -#endif // !defined(ASIO_NO_DEPRECATED) - -inline io_context& -io_context::executor_type::context() const ASIO_NOEXCEPT -{ - return io_context_; -} - -inline void -io_context::executor_type::on_work_started() const ASIO_NOEXCEPT -{ - io_context_.impl_.work_started(); -} - -inline void -io_context::executor_type::on_work_finished() const ASIO_NOEXCEPT -{ - io_context_.impl_.work_finished(); -} - -template -void io_context::executor_type::dispatch( - ASIO_MOVE_ARG(Function) f, const Allocator& a) const -{ - typedef typename decay::type function_type; - - // Invoke immediately if we are already inside the thread pool. - if (io_context_.impl_.can_dispatch()) - { - // Make a local, non-const copy of the function. - function_type tmp(ASIO_MOVE_CAST(Function)(f)); - - detail::fenced_block b(detail::fenced_block::full); - asio_handler_invoke_helpers::invoke(tmp, tmp); - return; - } - - // Allocate and construct an operation to wrap the function. - typedef detail::executor_op op; - typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 }; - p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(f), a); - - ASIO_HANDLER_CREATION((this->context(), *p.p, - "io_context", &this->context(), 0, "post")); - - io_context_.impl_.post_immediate_completion(p.p, false); - p.v = p.p = 0; -} - -template -void io_context::executor_type::post( - ASIO_MOVE_ARG(Function) f, const Allocator& a) const -{ - typedef typename decay::type function_type; - - // Allocate and construct an operation to wrap the function. - typedef detail::executor_op op; - typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 }; - p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(f), a); - - ASIO_HANDLER_CREATION((this->context(), *p.p, - "io_context", &this->context(), 0, "post")); - - io_context_.impl_.post_immediate_completion(p.p, false); - p.v = p.p = 0; -} - -template -void io_context::executor_type::defer( - ASIO_MOVE_ARG(Function) f, const Allocator& a) const -{ - typedef typename decay::type function_type; - - // Allocate and construct an operation to wrap the function. - typedef detail::executor_op op; - typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 }; - p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(f), a); - - ASIO_HANDLER_CREATION((this->context(), *p.p, - "io_context", &this->context(), 0, "defer")); - - io_context_.impl_.post_immediate_completion(p.p, true); - p.v = p.p = 0; -} - -inline bool -io_context::executor_type::running_in_this_thread() const ASIO_NOEXCEPT -{ - return io_context_.impl_.can_dispatch(); -} - -#if !defined(ASIO_NO_DEPRECATED) -inline io_context::work::work(asio::io_context& io_context) - : io_context_impl_(io_context.impl_) -{ - io_context_impl_.work_started(); -} - -inline io_context::work::work(const work& other) - : io_context_impl_(other.io_context_impl_) -{ - io_context_impl_.work_started(); -} - -inline io_context::work::~work() -{ - io_context_impl_.work_finished(); -} - -inline asio::io_context& io_context::work::get_io_context() -{ - return static_cast(io_context_impl_.context()); -} - -inline asio::io_context& io_context::work::get_io_service() -{ - return static_cast(io_context_impl_.context()); -} -#endif // !defined(ASIO_NO_DEPRECATED) - -inline asio::io_context& io_context::service::get_io_context() -{ - return static_cast(context()); -} - -#if !defined(ASIO_NO_DEPRECATED) -inline asio::io_context& io_context::service::get_io_service() -{ - return static_cast(context()); -} -#endif // !defined(ASIO_NO_DEPRECATED) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IMPL_IO_CONTEXT_HPP diff --git a/tools/sdk/include/asio/asio/impl/post.hpp b/tools/sdk/include/asio/asio/impl/post.hpp deleted file mode 100644 index 55389532b48..00000000000 --- a/tools/sdk/include/asio/asio/impl/post.hpp +++ /dev/null @@ -1,77 +0,0 @@ -// -// impl/post.hpp -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IMPL_POST_HPP -#define ASIO_IMPL_POST_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/associated_allocator.hpp" -#include "asio/associated_executor.hpp" -#include "asio/detail/work_dispatcher.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -template -ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) post( - ASIO_MOVE_ARG(CompletionToken) token) -{ - typedef ASIO_HANDLER_TYPE(CompletionToken, void()) handler; - - async_completion init(token); - - typename associated_executor::type ex( - (get_associated_executor)(init.completion_handler)); - - typename associated_allocator::type alloc( - (get_associated_allocator)(init.completion_handler)); - - ex.post(ASIO_MOVE_CAST(handler)(init.completion_handler), alloc); - - return init.result.get(); -} - -template -ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) post( - const Executor& ex, ASIO_MOVE_ARG(CompletionToken) token, - typename enable_if::value>::type*) -{ - typedef ASIO_HANDLER_TYPE(CompletionToken, void()) handler; - - async_completion init(token); - - typename associated_allocator::type alloc( - (get_associated_allocator)(init.completion_handler)); - - ex.post(detail::work_dispatcher(init.completion_handler), alloc); - - return init.result.get(); -} - -template -inline ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) post( - ExecutionContext& ctx, ASIO_MOVE_ARG(CompletionToken) token, - typename enable_if::value>::type*) -{ - return (post)(ctx.get_executor(), - ASIO_MOVE_CAST(CompletionToken)(token)); -} - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IMPL_POST_HPP diff --git a/tools/sdk/include/asio/asio/impl/read.hpp b/tools/sdk/include/asio/asio/impl/read.hpp deleted file mode 100644 index 603a7a9b19a..00000000000 --- a/tools/sdk/include/asio/asio/impl/read.hpp +++ /dev/null @@ -1,715 +0,0 @@ -// -// impl/read.hpp -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IMPL_READ_HPP -#define ASIO_IMPL_READ_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include -#include "asio/associated_allocator.hpp" -#include "asio/associated_executor.hpp" -#include "asio/buffer.hpp" -#include "asio/completion_condition.hpp" -#include "asio/detail/array_fwd.hpp" -#include "asio/detail/base_from_completion_cond.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/consuming_buffers.hpp" -#include "asio/detail/dependent_type.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_cont_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -namespace detail -{ - template - std::size_t read_buffer_sequence(SyncReadStream& s, - const MutableBufferSequence& buffers, const MutableBufferIterator&, - CompletionCondition completion_condition, asio::error_code& ec) - { - ec = asio::error_code(); - asio::detail::consuming_buffers tmp(buffers); - while (!tmp.empty()) - { - if (std::size_t max_size = detail::adapt_completion_condition_result( - completion_condition(ec, tmp.total_consumed()))) - tmp.consume(s.read_some(tmp.prepare(max_size), ec)); - else - break; - } - return tmp.total_consumed();; - } -} // namespace detail - -template -std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers, - CompletionCondition completion_condition, asio::error_code& ec, - typename enable_if< - is_mutable_buffer_sequence::value - >::type*) -{ - return detail::read_buffer_sequence(s, buffers, - asio::buffer_sequence_begin(buffers), completion_condition, ec); -} - -template -inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers, - typename enable_if< - is_mutable_buffer_sequence::value - >::type*) -{ - asio::error_code ec; - std::size_t bytes_transferred = read(s, buffers, transfer_all(), ec); - asio::detail::throw_error(ec, "read"); - return bytes_transferred; -} - -template -inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers, - asio::error_code& ec, - typename enable_if< - is_mutable_buffer_sequence::value - >::type*) -{ - return read(s, buffers, transfer_all(), ec); -} - -template -inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers, - CompletionCondition completion_condition, - typename enable_if< - is_mutable_buffer_sequence::value - >::type*) -{ - asio::error_code ec; - std::size_t bytes_transferred = read(s, buffers, completion_condition, ec); - asio::detail::throw_error(ec, "read"); - return bytes_transferred; -} - -template -std::size_t read(SyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - CompletionCondition completion_condition, asio::error_code& ec, - typename enable_if< - is_dynamic_buffer::type>::value - >::type*) -{ - typename decay::type b( - ASIO_MOVE_CAST(DynamicBuffer)(buffers)); - - ec = asio::error_code(); - std::size_t total_transferred = 0; - std::size_t max_size = detail::adapt_completion_condition_result( - completion_condition(ec, total_transferred)); - std::size_t bytes_available = std::min( - std::max(512, b.capacity() - b.size()), - std::min(max_size, b.max_size() - b.size())); - while (bytes_available > 0) - { - std::size_t bytes_transferred = s.read_some(b.prepare(bytes_available), ec); - b.commit(bytes_transferred); - total_transferred += bytes_transferred; - max_size = detail::adapt_completion_condition_result( - completion_condition(ec, total_transferred)); - bytes_available = std::min( - std::max(512, b.capacity() - b.size()), - std::min(max_size, b.max_size() - b.size())); - } - return total_transferred; -} - -template -inline std::size_t read(SyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - typename enable_if< - is_dynamic_buffer::type>::value - >::type*) -{ - asio::error_code ec; - std::size_t bytes_transferred = read(s, - ASIO_MOVE_CAST(DynamicBuffer)(buffers), transfer_all(), ec); - asio::detail::throw_error(ec, "read"); - return bytes_transferred; -} - -template -inline std::size_t read(SyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - asio::error_code& ec, - typename enable_if< - is_dynamic_buffer::type>::value - >::type*) -{ - return read(s, ASIO_MOVE_CAST(DynamicBuffer)(buffers), - transfer_all(), ec); -} - -template -inline std::size_t read(SyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - CompletionCondition completion_condition, - typename enable_if< - is_dynamic_buffer::type>::value - >::type*) -{ - asio::error_code ec; - std::size_t bytes_transferred = read(s, - ASIO_MOVE_CAST(DynamicBuffer)(buffers), - completion_condition, ec); - asio::detail::throw_error(ec, "read"); - return bytes_transferred; -} - -#if !defined(ASIO_NO_EXTENSIONS) -#if !defined(ASIO_NO_IOSTREAM) - -template -inline std::size_t read(SyncReadStream& s, - asio::basic_streambuf& b, - CompletionCondition completion_condition, asio::error_code& ec) -{ - return read(s, basic_streambuf_ref(b), completion_condition, ec); -} - -template -inline std::size_t read(SyncReadStream& s, - asio::basic_streambuf& b) -{ - return read(s, basic_streambuf_ref(b)); -} - -template -inline std::size_t read(SyncReadStream& s, - asio::basic_streambuf& b, - asio::error_code& ec) -{ - return read(s, basic_streambuf_ref(b), ec); -} - -template -inline std::size_t read(SyncReadStream& s, - asio::basic_streambuf& b, - CompletionCondition completion_condition) -{ - return read(s, basic_streambuf_ref(b), completion_condition); -} - -#endif // !defined(ASIO_NO_IOSTREAM) -#endif // !defined(ASIO_NO_EXTENSIONS) - -namespace detail -{ - template - class read_op - : detail::base_from_completion_cond - { - public: - read_op(AsyncReadStream& stream, const MutableBufferSequence& buffers, - CompletionCondition completion_condition, ReadHandler& handler) - : detail::base_from_completion_cond< - CompletionCondition>(completion_condition), - stream_(stream), - buffers_(buffers), - start_(0), - handler_(ASIO_MOVE_CAST(ReadHandler)(handler)) - { - } - -#if defined(ASIO_HAS_MOVE) - read_op(const read_op& other) - : detail::base_from_completion_cond(other), - stream_(other.stream_), - buffers_(other.buffers_), - start_(other.start_), - handler_(other.handler_) - { - } - - read_op(read_op&& other) - : detail::base_from_completion_cond(other), - stream_(other.stream_), - buffers_(other.buffers_), - start_(other.start_), - handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()(const asio::error_code& ec, - std::size_t bytes_transferred, int start = 0) - { - std::size_t max_size; - switch (start_ = start) - { - case 1: - max_size = this->check_for_completion(ec, buffers_.total_consumed()); - do - { - stream_.async_read_some(buffers_.prepare(max_size), - ASIO_MOVE_CAST(read_op)(*this)); - return; default: - buffers_.consume(bytes_transferred); - if ((!ec && bytes_transferred == 0) || buffers_.empty()) - break; - max_size = this->check_for_completion(ec, buffers_.total_consumed()); - } while (max_size > 0); - - handler_(ec, buffers_.total_consumed()); - } - } - - //private: - AsyncReadStream& stream_; - asio::detail::consuming_buffers buffers_; - int start_; - ReadHandler handler_; - }; - - template - inline void* asio_handler_allocate(std::size_t size, - read_op* this_handler) - { - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); - } - - template - inline void asio_handler_deallocate(void* pointer, std::size_t size, - read_op* this_handler) - { - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); - } - - template - inline bool asio_handler_is_continuation( - read_op* this_handler) - { - return this_handler->start_ == 0 ? true - : asio_handler_cont_helpers::is_continuation( - this_handler->handler_); - } - - template - inline void asio_handler_invoke(Function& function, - read_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - inline void asio_handler_invoke(const Function& function, - read_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - inline void start_read_buffer_sequence_op(AsyncReadStream& stream, - const MutableBufferSequence& buffers, const MutableBufferIterator&, - CompletionCondition completion_condition, ReadHandler& handler) - { - detail::read_op( - stream, buffers, completion_condition, handler)( - asio::error_code(), 0, 1); - } -} // namespace detail - -#if !defined(GENERATING_DOCUMENTATION) - -template -struct associated_allocator< - detail::read_op, - Allocator> -{ - typedef typename associated_allocator::type type; - - static type get( - const detail::read_op& h, - const Allocator& a = Allocator()) ASIO_NOEXCEPT - { - return associated_allocator::get(h.handler_, a); - } -}; - -template -struct associated_executor< - detail::read_op, - Executor> -{ - typedef typename associated_executor::type type; - - static type get( - const detail::read_op& h, - const Executor& ex = Executor()) ASIO_NOEXCEPT - { - return associated_executor::get(h.handler_, ex); - } -}; - -#endif // !defined(GENERATING_DOCUMENTATION) - -template -inline ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read(AsyncReadStream& s, const MutableBufferSequence& buffers, - CompletionCondition completion_condition, - ASIO_MOVE_ARG(ReadHandler) handler, - typename enable_if< - is_mutable_buffer_sequence::value - >::type*) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - - async_completion init(handler); - - detail::start_read_buffer_sequence_op(s, buffers, - asio::buffer_sequence_begin(buffers), completion_condition, - init.completion_handler); - - return init.result.get(); -} - -template -inline ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read(AsyncReadStream& s, const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler, - typename enable_if< - is_mutable_buffer_sequence::value - >::type*) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - - async_completion init(handler); - - detail::start_read_buffer_sequence_op(s, buffers, - asio::buffer_sequence_begin(buffers), transfer_all(), - init.completion_handler); - - return init.result.get(); -} - -namespace detail -{ - template - class read_dynbuf_op - : detail::base_from_completion_cond - { - public: - template - read_dynbuf_op(AsyncReadStream& stream, - ASIO_MOVE_ARG(BufferSequence) buffers, - CompletionCondition completion_condition, ReadHandler& handler) - : detail::base_from_completion_cond< - CompletionCondition>(completion_condition), - stream_(stream), - buffers_(ASIO_MOVE_CAST(BufferSequence)(buffers)), - start_(0), - total_transferred_(0), - handler_(ASIO_MOVE_CAST(ReadHandler)(handler)) - { - } - -#if defined(ASIO_HAS_MOVE) - read_dynbuf_op(const read_dynbuf_op& other) - : detail::base_from_completion_cond(other), - stream_(other.stream_), - buffers_(other.buffers_), - start_(other.start_), - total_transferred_(other.total_transferred_), - handler_(other.handler_) - { - } - - read_dynbuf_op(read_dynbuf_op&& other) - : detail::base_from_completion_cond(other), - stream_(other.stream_), - buffers_(ASIO_MOVE_CAST(DynamicBuffer)(other.buffers_)), - start_(other.start_), - total_transferred_(other.total_transferred_), - handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()(const asio::error_code& ec, - std::size_t bytes_transferred, int start = 0) - { - std::size_t max_size, bytes_available; - switch (start_ = start) - { - case 1: - max_size = this->check_for_completion(ec, total_transferred_); - bytes_available = std::min( - std::max(512, - buffers_.capacity() - buffers_.size()), - std::min(max_size, - buffers_.max_size() - buffers_.size())); - for (;;) - { - stream_.async_read_some(buffers_.prepare(bytes_available), - ASIO_MOVE_CAST(read_dynbuf_op)(*this)); - return; default: - total_transferred_ += bytes_transferred; - buffers_.commit(bytes_transferred); - max_size = this->check_for_completion(ec, total_transferred_); - bytes_available = std::min( - std::max(512, - buffers_.capacity() - buffers_.size()), - std::min(max_size, - buffers_.max_size() - buffers_.size())); - if ((!ec && bytes_transferred == 0) || bytes_available == 0) - break; - } - - handler_(ec, static_cast(total_transferred_)); - } - } - - //private: - AsyncReadStream& stream_; - DynamicBuffer buffers_; - int start_; - std::size_t total_transferred_; - ReadHandler handler_; - }; - - template - inline void* asio_handler_allocate(std::size_t size, - read_dynbuf_op* this_handler) - { - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); - } - - template - inline void asio_handler_deallocate(void* pointer, std::size_t size, - read_dynbuf_op* this_handler) - { - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); - } - - template - inline bool asio_handler_is_continuation( - read_dynbuf_op* this_handler) - { - return this_handler->start_ == 0 ? true - : asio_handler_cont_helpers::is_continuation( - this_handler->handler_); - } - - template - inline void asio_handler_invoke(Function& function, - read_dynbuf_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - inline void asio_handler_invoke(const Function& function, - read_dynbuf_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } -} // namespace detail - -#if !defined(GENERATING_DOCUMENTATION) - -template -struct associated_allocator< - detail::read_dynbuf_op, - Allocator> -{ - typedef typename associated_allocator::type type; - - static type get( - const detail::read_dynbuf_op& h, - const Allocator& a = Allocator()) ASIO_NOEXCEPT - { - return associated_allocator::get(h.handler_, a); - } -}; - -template -struct associated_executor< - detail::read_dynbuf_op, - Executor> -{ - typedef typename associated_executor::type type; - - static type get( - const detail::read_dynbuf_op& h, - const Executor& ex = Executor()) ASIO_NOEXCEPT - { - return associated_executor::get(h.handler_, ex); - } -}; - -#endif // !defined(GENERATING_DOCUMENTATION) - -template -inline ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read(AsyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - ASIO_MOVE_ARG(ReadHandler) handler, - typename enable_if< - is_dynamic_buffer::type>::value - >::type*) -{ - return async_read(s, - ASIO_MOVE_CAST(DynamicBuffer)(buffers), - transfer_all(), ASIO_MOVE_CAST(ReadHandler)(handler)); -} - -template -inline ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read(AsyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - CompletionCondition completion_condition, - ASIO_MOVE_ARG(ReadHandler) handler, - typename enable_if< - is_dynamic_buffer::type>::value - >::type*) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - - async_completion init(handler); - - detail::read_dynbuf_op::type, - CompletionCondition, ASIO_HANDLER_TYPE( - ReadHandler, void (asio::error_code, std::size_t))>( - s, ASIO_MOVE_CAST(DynamicBuffer)(buffers), - completion_condition, init.completion_handler)( - asio::error_code(), 0, 1); - - return init.result.get(); -} - -#if !defined(ASIO_NO_EXTENSIONS) -#if !defined(ASIO_NO_IOSTREAM) - -template -inline ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read(AsyncReadStream& s, basic_streambuf& b, - ASIO_MOVE_ARG(ReadHandler) handler) -{ - return async_read(s, basic_streambuf_ref(b), - ASIO_MOVE_CAST(ReadHandler)(handler)); -} - -template -inline ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read(AsyncReadStream& s, basic_streambuf& b, - CompletionCondition completion_condition, - ASIO_MOVE_ARG(ReadHandler) handler) -{ - return async_read(s, basic_streambuf_ref(b), - completion_condition, ASIO_MOVE_CAST(ReadHandler)(handler)); -} - -#endif // !defined(ASIO_NO_IOSTREAM) -#endif // !defined(ASIO_NO_EXTENSIONS) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IMPL_READ_HPP diff --git a/tools/sdk/include/asio/asio/impl/read_at.hpp b/tools/sdk/include/asio/asio/impl/read_at.hpp deleted file mode 100644 index d736d4d3156..00000000000 --- a/tools/sdk/include/asio/asio/impl/read_at.hpp +++ /dev/null @@ -1,640 +0,0 @@ -// -// impl/read_at.hpp -// ~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IMPL_READ_AT_HPP -#define ASIO_IMPL_READ_AT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include -#include "asio/associated_allocator.hpp" -#include "asio/associated_executor.hpp" -#include "asio/buffer.hpp" -#include "asio/completion_condition.hpp" -#include "asio/detail/array_fwd.hpp" -#include "asio/detail/base_from_completion_cond.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/consuming_buffers.hpp" -#include "asio/detail/dependent_type.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_cont_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -namespace detail -{ - template - std::size_t read_at_buffer_sequence(SyncRandomAccessReadDevice& d, - uint64_t offset, const MutableBufferSequence& buffers, - const MutableBufferIterator&, CompletionCondition completion_condition, - asio::error_code& ec) - { - ec = asio::error_code(); - asio::detail::consuming_buffers tmp(buffers); - while (!tmp.empty()) - { - if (std::size_t max_size = detail::adapt_completion_condition_result( - completion_condition(ec, tmp.total_consumed()))) - { - tmp.consume(d.read_some_at(offset + tmp.total_consumed(), - tmp.prepare(max_size), ec)); - } - else - break; - } - return tmp.total_consumed();; - } -} // namespace detail - -template -std::size_t read_at(SyncRandomAccessReadDevice& d, - uint64_t offset, const MutableBufferSequence& buffers, - CompletionCondition completion_condition, asio::error_code& ec) -{ - return detail::read_at_buffer_sequence(d, offset, buffers, - asio::buffer_sequence_begin(buffers), completion_condition, ec); -} - -template -inline std::size_t read_at(SyncRandomAccessReadDevice& d, - uint64_t offset, const MutableBufferSequence& buffers) -{ - asio::error_code ec; - std::size_t bytes_transferred = read_at( - d, offset, buffers, transfer_all(), ec); - asio::detail::throw_error(ec, "read_at"); - return bytes_transferred; -} - -template -inline std::size_t read_at(SyncRandomAccessReadDevice& d, - uint64_t offset, const MutableBufferSequence& buffers, - asio::error_code& ec) -{ - return read_at(d, offset, buffers, transfer_all(), ec); -} - -template -inline std::size_t read_at(SyncRandomAccessReadDevice& d, - uint64_t offset, const MutableBufferSequence& buffers, - CompletionCondition completion_condition) -{ - asio::error_code ec; - std::size_t bytes_transferred = read_at( - d, offset, buffers, completion_condition, ec); - asio::detail::throw_error(ec, "read_at"); - return bytes_transferred; -} - -#if !defined(ASIO_NO_EXTENSIONS) -#if !defined(ASIO_NO_IOSTREAM) - -template -std::size_t read_at(SyncRandomAccessReadDevice& d, - uint64_t offset, asio::basic_streambuf& b, - CompletionCondition completion_condition, asio::error_code& ec) -{ - ec = asio::error_code(); - std::size_t total_transferred = 0; - std::size_t max_size = detail::adapt_completion_condition_result( - completion_condition(ec, total_transferred)); - std::size_t bytes_available = read_size_helper(b, max_size); - while (bytes_available > 0) - { - std::size_t bytes_transferred = d.read_some_at( - offset + total_transferred, b.prepare(bytes_available), ec); - b.commit(bytes_transferred); - total_transferred += bytes_transferred; - max_size = detail::adapt_completion_condition_result( - completion_condition(ec, total_transferred)); - bytes_available = read_size_helper(b, max_size); - } - return total_transferred; -} - -template -inline std::size_t read_at(SyncRandomAccessReadDevice& d, - uint64_t offset, asio::basic_streambuf& b) -{ - asio::error_code ec; - std::size_t bytes_transferred = read_at( - d, offset, b, transfer_all(), ec); - asio::detail::throw_error(ec, "read_at"); - return bytes_transferred; -} - -template -inline std::size_t read_at(SyncRandomAccessReadDevice& d, - uint64_t offset, asio::basic_streambuf& b, - asio::error_code& ec) -{ - return read_at(d, offset, b, transfer_all(), ec); -} - -template -inline std::size_t read_at(SyncRandomAccessReadDevice& d, - uint64_t offset, asio::basic_streambuf& b, - CompletionCondition completion_condition) -{ - asio::error_code ec; - std::size_t bytes_transferred = read_at( - d, offset, b, completion_condition, ec); - asio::detail::throw_error(ec, "read_at"); - return bytes_transferred; -} - -#endif // !defined(ASIO_NO_IOSTREAM) -#endif // !defined(ASIO_NO_EXTENSIONS) - -namespace detail -{ - template - class read_at_op - : detail::base_from_completion_cond - { - public: - read_at_op(AsyncRandomAccessReadDevice& device, - uint64_t offset, const MutableBufferSequence& buffers, - CompletionCondition completion_condition, ReadHandler& handler) - : detail::base_from_completion_cond< - CompletionCondition>(completion_condition), - device_(device), - offset_(offset), - buffers_(buffers), - start_(0), - handler_(ASIO_MOVE_CAST(ReadHandler)(handler)) - { - } - -#if defined(ASIO_HAS_MOVE) - read_at_op(const read_at_op& other) - : detail::base_from_completion_cond(other), - device_(other.device_), - offset_(other.offset_), - buffers_(other.buffers_), - start_(other.start_), - handler_(other.handler_) - { - } - - read_at_op(read_at_op&& other) - : detail::base_from_completion_cond(other), - device_(other.device_), - offset_(other.offset_), - buffers_(other.buffers_), - start_(other.start_), - handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()(const asio::error_code& ec, - std::size_t bytes_transferred, int start = 0) - { - std::size_t max_size; - switch (start_ = start) - { - case 1: - max_size = this->check_for_completion(ec, buffers_.total_consumed()); - do - { - device_.async_read_some_at( - offset_ + buffers_.total_consumed(), buffers_.prepare(max_size), - ASIO_MOVE_CAST(read_at_op)(*this)); - return; default: - buffers_.consume(bytes_transferred); - if ((!ec && bytes_transferred == 0) || buffers_.empty()) - break; - max_size = this->check_for_completion(ec, buffers_.total_consumed()); - } while (max_size > 0); - - handler_(ec, buffers_.total_consumed()); - } - } - - //private: - AsyncRandomAccessReadDevice& device_; - uint64_t offset_; - asio::detail::consuming_buffers buffers_; - int start_; - ReadHandler handler_; - }; - - template - inline void* asio_handler_allocate(std::size_t size, - read_at_op* this_handler) - { - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); - } - - template - inline void asio_handler_deallocate(void* pointer, std::size_t size, - read_at_op* this_handler) - { - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); - } - - template - inline bool asio_handler_is_continuation( - read_at_op* this_handler) - { - return this_handler->start_ == 0 ? true - : asio_handler_cont_helpers::is_continuation( - this_handler->handler_); - } - - template - inline void asio_handler_invoke(Function& function, - read_at_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - inline void asio_handler_invoke(const Function& function, - read_at_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - inline void start_read_at_buffer_sequence_op(AsyncRandomAccessReadDevice& d, - uint64_t offset, const MutableBufferSequence& buffers, - const MutableBufferIterator&, CompletionCondition completion_condition, - ReadHandler& handler) - { - detail::read_at_op( - d, offset, buffers, completion_condition, handler)( - asio::error_code(), 0, 1); - } -} // namespace detail - -#if !defined(GENERATING_DOCUMENTATION) - -template -struct associated_allocator< - detail::read_at_op, - Allocator> -{ - typedef typename associated_allocator::type type; - - static type get( - const detail::read_at_op& h, - const Allocator& a = Allocator()) ASIO_NOEXCEPT - { - return associated_allocator::get(h.handler_, a); - } -}; - -template -struct associated_executor< - detail::read_at_op, - Executor> -{ - typedef typename associated_executor::type type; - - static type get( - const detail::read_at_op& h, - const Executor& ex = Executor()) ASIO_NOEXCEPT - { - return associated_executor::get(h.handler_, ex); - } -}; - -#endif // !defined(GENERATING_DOCUMENTATION) - -template -inline ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read_at(AsyncRandomAccessReadDevice& d, - uint64_t offset, const MutableBufferSequence& buffers, - CompletionCondition completion_condition, - ASIO_MOVE_ARG(ReadHandler) handler) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - - async_completion init(handler); - - detail::start_read_at_buffer_sequence_op(d, offset, buffers, - asio::buffer_sequence_begin(buffers), completion_condition, - init.completion_handler); - - return init.result.get(); -} - -template -inline ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read_at(AsyncRandomAccessReadDevice& d, - uint64_t offset, const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - - async_completion init(handler); - - detail::start_read_at_buffer_sequence_op(d, offset, buffers, - asio::buffer_sequence_begin(buffers), transfer_all(), - init.completion_handler); - - return init.result.get(); -} - -#if !defined(ASIO_NO_EXTENSIONS) -#if !defined(ASIO_NO_IOSTREAM) - -namespace detail -{ - template - class read_at_streambuf_op - : detail::base_from_completion_cond - { - public: - read_at_streambuf_op(AsyncRandomAccessReadDevice& device, - uint64_t offset, basic_streambuf& streambuf, - CompletionCondition completion_condition, ReadHandler& handler) - : detail::base_from_completion_cond< - CompletionCondition>(completion_condition), - device_(device), - offset_(offset), - streambuf_(streambuf), - start_(0), - total_transferred_(0), - handler_(ASIO_MOVE_CAST(ReadHandler)(handler)) - { - } - -#if defined(ASIO_HAS_MOVE) - read_at_streambuf_op(const read_at_streambuf_op& other) - : detail::base_from_completion_cond(other), - device_(other.device_), - offset_(other.offset_), - streambuf_(other.streambuf_), - start_(other.start_), - total_transferred_(other.total_transferred_), - handler_(other.handler_) - { - } - - read_at_streambuf_op(read_at_streambuf_op&& other) - : detail::base_from_completion_cond(other), - device_(other.device_), - offset_(other.offset_), - streambuf_(other.streambuf_), - start_(other.start_), - total_transferred_(other.total_transferred_), - handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()(const asio::error_code& ec, - std::size_t bytes_transferred, int start = 0) - { - std::size_t max_size, bytes_available; - switch (start_ = start) - { - case 1: - max_size = this->check_for_completion(ec, total_transferred_); - bytes_available = read_size_helper(streambuf_, max_size); - for (;;) - { - device_.async_read_some_at(offset_ + total_transferred_, - streambuf_.prepare(bytes_available), - ASIO_MOVE_CAST(read_at_streambuf_op)(*this)); - return; default: - total_transferred_ += bytes_transferred; - streambuf_.commit(bytes_transferred); - max_size = this->check_for_completion(ec, total_transferred_); - bytes_available = read_size_helper(streambuf_, max_size); - if ((!ec && bytes_transferred == 0) || bytes_available == 0) - break; - } - - handler_(ec, static_cast(total_transferred_)); - } - } - - //private: - AsyncRandomAccessReadDevice& device_; - uint64_t offset_; - asio::basic_streambuf& streambuf_; - int start_; - std::size_t total_transferred_; - ReadHandler handler_; - }; - - template - inline void* asio_handler_allocate(std::size_t size, - read_at_streambuf_op* this_handler) - { - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); - } - - template - inline void asio_handler_deallocate(void* pointer, std::size_t size, - read_at_streambuf_op* this_handler) - { - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); - } - - template - inline bool asio_handler_is_continuation( - read_at_streambuf_op* this_handler) - { - return this_handler->start_ == 0 ? true - : asio_handler_cont_helpers::is_continuation( - this_handler->handler_); - } - - template - inline void asio_handler_invoke(Function& function, - read_at_streambuf_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - inline void asio_handler_invoke(const Function& function, - read_at_streambuf_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } -} // namespace detail - -#if !defined(GENERATING_DOCUMENTATION) - -template -struct associated_allocator< - detail::read_at_streambuf_op, - Allocator1> -{ - typedef typename associated_allocator::type type; - - static type get( - const detail::read_at_streambuf_op& h, - const Allocator1& a = Allocator1()) ASIO_NOEXCEPT - { - return associated_allocator::get(h.handler_, a); - } -}; - -template -struct associated_executor< - detail::read_at_streambuf_op, - Executor1> -{ - typedef typename associated_executor::type type; - - static type get( - const detail::read_at_streambuf_op& h, - const Executor1& ex = Executor1()) ASIO_NOEXCEPT - { - return associated_executor::get(h.handler_, ex); - } -}; - -#endif // !defined(GENERATING_DOCUMENTATION) - -template -inline ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read_at(AsyncRandomAccessReadDevice& d, - uint64_t offset, asio::basic_streambuf& b, - CompletionCondition completion_condition, - ASIO_MOVE_ARG(ReadHandler) handler) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - - async_completion init(handler); - - detail::read_at_streambuf_op( - d, offset, b, completion_condition, init.completion_handler)( - asio::error_code(), 0, 1); - - return init.result.get(); -} - -template -inline ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read_at(AsyncRandomAccessReadDevice& d, - uint64_t offset, asio::basic_streambuf& b, - ASIO_MOVE_ARG(ReadHandler) handler) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - - async_completion init(handler); - - detail::read_at_streambuf_op( - d, offset, b, transfer_all(), init.completion_handler)( - asio::error_code(), 0, 1); - - return init.result.get(); -} - -#endif // !defined(ASIO_NO_IOSTREAM) -#endif // !defined(ASIO_NO_EXTENSIONS) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IMPL_READ_AT_HPP diff --git a/tools/sdk/include/asio/asio/impl/read_until.hpp b/tools/sdk/include/asio/asio/impl/read_until.hpp deleted file mode 100644 index 1f39e1933b5..00000000000 --- a/tools/sdk/include/asio/asio/impl/read_until.hpp +++ /dev/null @@ -1,1500 +0,0 @@ -// -// impl/read_until.hpp -// ~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IMPL_READ_UNTIL_HPP -#define ASIO_IMPL_READ_UNTIL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include -#include -#include -#include -#include "asio/associated_allocator.hpp" -#include "asio/associated_executor.hpp" -#include "asio/buffer.hpp" -#include "asio/buffers_iterator.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_cont_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/limits.hpp" -#include "asio/detail/throw_error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -template -inline std::size_t read_until(SyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, char delim) -{ - asio::error_code ec; - std::size_t bytes_transferred = read_until(s, - ASIO_MOVE_CAST(DynamicBuffer)(buffers), delim, ec); - asio::detail::throw_error(ec, "read_until"); - return bytes_transferred; -} - -template -std::size_t read_until(SyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - char delim, asio::error_code& ec) -{ - typename decay::type b( - ASIO_MOVE_CAST(DynamicBuffer)(buffers)); - - std::size_t search_position = 0; - for (;;) - { - // Determine the range of the data to be searched. - typedef typename DynamicBuffer::const_buffers_type buffers_type; - typedef buffers_iterator iterator; - buffers_type data_buffers = b.data(); - iterator begin = iterator::begin(data_buffers); - iterator start_pos = begin + search_position; - iterator end = iterator::end(data_buffers); - - // Look for a match. - iterator iter = std::find(start_pos, end, delim); - if (iter != end) - { - // Found a match. We're done. - ec = asio::error_code(); - return iter - begin + 1; - } - else - { - // No match. Next search can start with the new data. - search_position = end - begin; - } - - // Check if buffer is full. - if (b.size() == b.max_size()) - { - ec = error::not_found; - return 0; - } - - // Need more data. - std::size_t bytes_to_read = std::min( - std::max(512, b.capacity() - b.size()), - std::min(65536, b.max_size() - b.size())); - b.commit(s.read_some(b.prepare(bytes_to_read), ec)); - if (ec) - return 0; - } -} - -template -inline std::size_t read_until(SyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - ASIO_STRING_VIEW_PARAM delim) -{ - asio::error_code ec; - std::size_t bytes_transferred = read_until(s, - ASIO_MOVE_CAST(DynamicBuffer)(buffers), delim, ec); - asio::detail::throw_error(ec, "read_until"); - return bytes_transferred; -} - -namespace detail -{ - // Algorithm that finds a subsequence of equal values in a sequence. Returns - // (iterator,true) if a full match was found, in which case the iterator - // points to the beginning of the match. Returns (iterator,false) if a - // partial match was found at the end of the first sequence, in which case - // the iterator points to the beginning of the partial match. Returns - // (last1,false) if no full or partial match was found. - template - std::pair partial_search( - Iterator1 first1, Iterator1 last1, Iterator2 first2, Iterator2 last2) - { - for (Iterator1 iter1 = first1; iter1 != last1; ++iter1) - { - Iterator1 test_iter1 = iter1; - Iterator2 test_iter2 = first2; - for (;; ++test_iter1, ++test_iter2) - { - if (test_iter2 == last2) - return std::make_pair(iter1, true); - if (test_iter1 == last1) - { - if (test_iter2 != first2) - return std::make_pair(iter1, false); - else - break; - } - if (*test_iter1 != *test_iter2) - break; - } - } - return std::make_pair(last1, false); - } -} // namespace detail - -template -std::size_t read_until(SyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - ASIO_STRING_VIEW_PARAM delim, asio::error_code& ec) -{ - typename decay::type b( - ASIO_MOVE_CAST(DynamicBuffer)(buffers)); - - std::size_t search_position = 0; - for (;;) - { - // Determine the range of the data to be searched. - typedef typename DynamicBuffer::const_buffers_type buffers_type; - typedef buffers_iterator iterator; - buffers_type data_buffers = b.data(); - iterator begin = iterator::begin(data_buffers); - iterator start_pos = begin + search_position; - iterator end = iterator::end(data_buffers); - - // Look for a match. - std::pair result = detail::partial_search( - start_pos, end, delim.begin(), delim.end()); - if (result.first != end) - { - if (result.second) - { - // Full match. We're done. - ec = asio::error_code(); - return result.first - begin + delim.length(); - } - else - { - // Partial match. Next search needs to start from beginning of match. - search_position = result.first - begin; - } - } - else - { - // No match. Next search can start with the new data. - search_position = end - begin; - } - - // Check if buffer is full. - if (b.size() == b.max_size()) - { - ec = error::not_found; - return 0; - } - - // Need more data. - std::size_t bytes_to_read = std::min( - std::max(512, b.capacity() - b.size()), - std::min(65536, b.max_size() - b.size())); - b.commit(s.read_some(b.prepare(bytes_to_read), ec)); - if (ec) - return 0; - } -} - -#if !defined(ASIO_NO_EXTENSIONS) -#if defined(ASIO_HAS_BOOST_REGEX) - -template -inline std::size_t read_until(SyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - const boost::regex& expr) -{ - asio::error_code ec; - std::size_t bytes_transferred = read_until(s, - ASIO_MOVE_CAST(DynamicBuffer)(buffers), expr, ec); - asio::detail::throw_error(ec, "read_until"); - return bytes_transferred; -} - -template -std::size_t read_until(SyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - const boost::regex& expr, asio::error_code& ec) -{ - typename decay::type b( - ASIO_MOVE_CAST(DynamicBuffer)(buffers)); - - std::size_t search_position = 0; - for (;;) - { - // Determine the range of the data to be searched. - typedef typename DynamicBuffer::const_buffers_type buffers_type; - typedef buffers_iterator iterator; - buffers_type data_buffers = b.data(); - iterator begin = iterator::begin(data_buffers); - iterator start_pos = begin + search_position; - iterator end = iterator::end(data_buffers); - - // Look for a match. - boost::match_results >::allocator_type> - match_results; - if (regex_search(start_pos, end, match_results, expr, - boost::match_default | boost::match_partial)) - { - if (match_results[0].matched) - { - // Full match. We're done. - ec = asio::error_code(); - return match_results[0].second - begin; - } - else - { - // Partial match. Next search needs to start from beginning of match. - search_position = match_results[0].first - begin; - } - } - else - { - // No match. Next search can start with the new data. - search_position = end - begin; - } - - // Check if buffer is full. - if (b.size() == b.max_size()) - { - ec = error::not_found; - return 0; - } - - // Need more data. - std::size_t bytes_to_read = read_size_helper(b, 65536); - b.commit(s.read_some(b.prepare(bytes_to_read), ec)); - if (ec) - return 0; - } -} - -#endif // defined(ASIO_HAS_BOOST_REGEX) - -template -inline std::size_t read_until(SyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - MatchCondition match_condition, - typename enable_if::value>::type*) -{ - asio::error_code ec; - std::size_t bytes_transferred = read_until(s, - ASIO_MOVE_CAST(DynamicBuffer)(buffers), - match_condition, ec); - asio::detail::throw_error(ec, "read_until"); - return bytes_transferred; -} - -template -std::size_t read_until(SyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - MatchCondition match_condition, asio::error_code& ec, - typename enable_if::value>::type*) -{ - typename decay::type b( - ASIO_MOVE_CAST(DynamicBuffer)(buffers)); - - std::size_t search_position = 0; - for (;;) - { - // Determine the range of the data to be searched. - typedef typename DynamicBuffer::const_buffers_type buffers_type; - typedef buffers_iterator iterator; - buffers_type data_buffers = b.data(); - iterator begin = iterator::begin(data_buffers); - iterator start_pos = begin + search_position; - iterator end = iterator::end(data_buffers); - - // Look for a match. - std::pair result = match_condition(start_pos, end); - if (result.second) - { - // Full match. We're done. - ec = asio::error_code(); - return result.first - begin; - } - else if (result.first != end) - { - // Partial match. Next search needs to start from beginning of match. - search_position = result.first - begin; - } - else - { - // No match. Next search can start with the new data. - search_position = end - begin; - } - - // Check if buffer is full. - if (b.size() == b.max_size()) - { - ec = error::not_found; - return 0; - } - - // Need more data. - std::size_t bytes_to_read = std::min( - std::max(512, b.capacity() - b.size()), - std::min(65536, b.max_size() - b.size())); - b.commit(s.read_some(b.prepare(bytes_to_read), ec)); - if (ec) - return 0; - } -} - -#if !defined(ASIO_NO_IOSTREAM) - -template -inline std::size_t read_until(SyncReadStream& s, - asio::basic_streambuf& b, char delim) -{ - return read_until(s, basic_streambuf_ref(b), delim); -} - -template -inline std::size_t read_until(SyncReadStream& s, - asio::basic_streambuf& b, char delim, - asio::error_code& ec) -{ - return read_until(s, basic_streambuf_ref(b), delim, ec); -} - -template -inline std::size_t read_until(SyncReadStream& s, - asio::basic_streambuf& b, - ASIO_STRING_VIEW_PARAM delim) -{ - return read_until(s, basic_streambuf_ref(b), delim); -} - -template -inline std::size_t read_until(SyncReadStream& s, - asio::basic_streambuf& b, - ASIO_STRING_VIEW_PARAM delim, asio::error_code& ec) -{ - return read_until(s, basic_streambuf_ref(b), delim, ec); -} - -#if defined(ASIO_HAS_BOOST_REGEX) - -template -inline std::size_t read_until(SyncReadStream& s, - asio::basic_streambuf& b, const boost::regex& expr) -{ - return read_until(s, basic_streambuf_ref(b), expr); -} - -template -inline std::size_t read_until(SyncReadStream& s, - asio::basic_streambuf& b, const boost::regex& expr, - asio::error_code& ec) -{ - return read_until(s, basic_streambuf_ref(b), expr, ec); -} - -#endif // defined(ASIO_HAS_BOOST_REGEX) - -template -inline std::size_t read_until(SyncReadStream& s, - asio::basic_streambuf& b, MatchCondition match_condition, - typename enable_if::value>::type*) -{ - return read_until(s, basic_streambuf_ref(b), match_condition); -} - -template -inline std::size_t read_until(SyncReadStream& s, - asio::basic_streambuf& b, - MatchCondition match_condition, asio::error_code& ec, - typename enable_if::value>::type*) -{ - return read_until(s, basic_streambuf_ref(b), match_condition, ec); -} - -#endif // !defined(ASIO_NO_IOSTREAM) -#endif // !defined(ASIO_NO_EXTENSIONS) - -namespace detail -{ - template - class read_until_delim_op - { - public: - template - read_until_delim_op(AsyncReadStream& stream, - ASIO_MOVE_ARG(BufferSequence) buffers, - char delim, ReadHandler& handler) - : stream_(stream), - buffers_(ASIO_MOVE_CAST(BufferSequence)(buffers)), - delim_(delim), - start_(0), - search_position_(0), - handler_(ASIO_MOVE_CAST(ReadHandler)(handler)) - { - } - -#if defined(ASIO_HAS_MOVE) - read_until_delim_op(const read_until_delim_op& other) - : stream_(other.stream_), - buffers_(other.buffers_), - delim_(other.delim_), - start_(other.start_), - search_position_(other.search_position_), - handler_(other.handler_) - { - } - - read_until_delim_op(read_until_delim_op&& other) - : stream_(other.stream_), - buffers_(ASIO_MOVE_CAST(DynamicBuffer)(other.buffers_)), - delim_(other.delim_), - start_(other.start_), - search_position_(other.search_position_), - handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()(const asio::error_code& ec, - std::size_t bytes_transferred, int start = 0) - { - const std::size_t not_found = (std::numeric_limits::max)(); - std::size_t bytes_to_read; - switch (start_ = start) - { - case 1: - for (;;) - { - { - // Determine the range of the data to be searched. - typedef typename DynamicBuffer::const_buffers_type - buffers_type; - typedef buffers_iterator iterator; - buffers_type data_buffers = buffers_.data(); - iterator begin = iterator::begin(data_buffers); - iterator start_pos = begin + search_position_; - iterator end = iterator::end(data_buffers); - - // Look for a match. - iterator iter = std::find(start_pos, end, delim_); - if (iter != end) - { - // Found a match. We're done. - search_position_ = iter - begin + 1; - bytes_to_read = 0; - } - - // No match yet. Check if buffer is full. - else if (buffers_.size() == buffers_.max_size()) - { - search_position_ = not_found; - bytes_to_read = 0; - } - - // Need to read some more data. - else - { - // Next search can start with the new data. - search_position_ = end - begin; - bytes_to_read = std::min( - std::max(512, - buffers_.capacity() - buffers_.size()), - std::min(65536, - buffers_.max_size() - buffers_.size())); - } - } - - // Check if we're done. - if (!start && bytes_to_read == 0) - break; - - // Start a new asynchronous read operation to obtain more data. - stream_.async_read_some(buffers_.prepare(bytes_to_read), - ASIO_MOVE_CAST(read_until_delim_op)(*this)); - return; default: - buffers_.commit(bytes_transferred); - if (ec || bytes_transferred == 0) - break; - } - - const asio::error_code result_ec = - (search_position_ == not_found) - ? error::not_found : ec; - - const std::size_t result_n = - (ec || search_position_ == not_found) - ? 0 : search_position_; - - handler_(result_ec, result_n); - } - } - - //private: - AsyncReadStream& stream_; - DynamicBuffer buffers_; - char delim_; - int start_; - std::size_t search_position_; - ReadHandler handler_; - }; - - template - inline void* asio_handler_allocate(std::size_t size, - read_until_delim_op* this_handler) - { - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); - } - - template - inline void asio_handler_deallocate(void* pointer, std::size_t size, - read_until_delim_op* this_handler) - { - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); - } - - template - inline bool asio_handler_is_continuation( - read_until_delim_op* this_handler) - { - return this_handler->start_ == 0 ? true - : asio_handler_cont_helpers::is_continuation( - this_handler->handler_); - } - - template - inline void asio_handler_invoke(Function& function, - read_until_delim_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - inline void asio_handler_invoke(const Function& function, - read_until_delim_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } -} // namespace detail - -#if !defined(GENERATING_DOCUMENTATION) - -template -struct associated_allocator< - detail::read_until_delim_op, - Allocator> -{ - typedef typename associated_allocator::type type; - - static type get( - const detail::read_until_delim_op& h, - const Allocator& a = Allocator()) ASIO_NOEXCEPT - { - return associated_allocator::get(h.handler_, a); - } -}; - -template -struct associated_executor< - detail::read_until_delim_op, - Executor> -{ - typedef typename associated_executor::type type; - - static type get( - const detail::read_until_delim_op& h, - const Executor& ex = Executor()) ASIO_NOEXCEPT - { - return associated_executor::get(h.handler_, ex); - } -}; - -#endif // !defined(GENERATING_DOCUMENTATION) - -template -ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read_until(AsyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - char delim, ASIO_MOVE_ARG(ReadHandler) handler) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - - async_completion init(handler); - - detail::read_until_delim_op::type, - ASIO_HANDLER_TYPE(ReadHandler, - void (asio::error_code, std::size_t))>( - s, ASIO_MOVE_CAST(DynamicBuffer)(buffers), - delim, init.completion_handler)(asio::error_code(), 0, 1); - - return init.result.get(); -} - -namespace detail -{ - template - class read_until_delim_string_op - { - public: - template - read_until_delim_string_op(AsyncReadStream& stream, - ASIO_MOVE_ARG(BufferSequence) buffers, - const std::string& delim, ReadHandler& handler) - : stream_(stream), - buffers_(ASIO_MOVE_CAST(BufferSequence)(buffers)), - delim_(delim), - start_(0), - search_position_(0), - handler_(ASIO_MOVE_CAST(ReadHandler)(handler)) - { - } - -#if defined(ASIO_HAS_MOVE) - read_until_delim_string_op(const read_until_delim_string_op& other) - : stream_(other.stream_), - buffers_(other.buffers_), - delim_(other.delim_), - start_(other.start_), - search_position_(other.search_position_), - handler_(other.handler_) - { - } - - read_until_delim_string_op(read_until_delim_string_op&& other) - : stream_(other.stream_), - buffers_(ASIO_MOVE_CAST(DynamicBuffer)(other.buffers_)), - delim_(ASIO_MOVE_CAST(std::string)(other.delim_)), - start_(other.start_), - search_position_(other.search_position_), - handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()(const asio::error_code& ec, - std::size_t bytes_transferred, int start = 0) - { - const std::size_t not_found = (std::numeric_limits::max)(); - std::size_t bytes_to_read; - switch (start_ = start) - { - case 1: - for (;;) - { - { - // Determine the range of the data to be searched. - typedef typename DynamicBuffer::const_buffers_type - buffers_type; - typedef buffers_iterator iterator; - buffers_type data_buffers = buffers_.data(); - iterator begin = iterator::begin(data_buffers); - iterator start_pos = begin + search_position_; - iterator end = iterator::end(data_buffers); - - // Look for a match. - std::pair result = detail::partial_search( - start_pos, end, delim_.begin(), delim_.end()); - if (result.first != end && result.second) - { - // Full match. We're done. - search_position_ = result.first - begin + delim_.length(); - bytes_to_read = 0; - } - - // No match yet. Check if buffer is full. - else if (buffers_.size() == buffers_.max_size()) - { - search_position_ = not_found; - bytes_to_read = 0; - } - - // Need to read some more data. - else - { - if (result.first != end) - { - // Partial match. Next search needs to start from beginning of - // match. - search_position_ = result.first - begin; - } - else - { - // Next search can start with the new data. - search_position_ = end - begin; - } - - bytes_to_read = std::min( - std::max(512, - buffers_.capacity() - buffers_.size()), - std::min(65536, - buffers_.max_size() - buffers_.size())); - } - } - - // Check if we're done. - if (!start && bytes_to_read == 0) - break; - - // Start a new asynchronous read operation to obtain more data. - stream_.async_read_some(buffers_.prepare(bytes_to_read), - ASIO_MOVE_CAST(read_until_delim_string_op)(*this)); - return; default: - buffers_.commit(bytes_transferred); - if (ec || bytes_transferred == 0) - break; - } - - const asio::error_code result_ec = - (search_position_ == not_found) - ? error::not_found : ec; - - const std::size_t result_n = - (ec || search_position_ == not_found) - ? 0 : search_position_; - - handler_(result_ec, result_n); - } - } - - //private: - AsyncReadStream& stream_; - DynamicBuffer buffers_; - std::string delim_; - int start_; - std::size_t search_position_; - ReadHandler handler_; - }; - - template - inline void* asio_handler_allocate(std::size_t size, - read_until_delim_string_op* this_handler) - { - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); - } - - template - inline void asio_handler_deallocate(void* pointer, std::size_t size, - read_until_delim_string_op* this_handler) - { - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); - } - - template - inline bool asio_handler_is_continuation( - read_until_delim_string_op* this_handler) - { - return this_handler->start_ == 0 ? true - : asio_handler_cont_helpers::is_continuation( - this_handler->handler_); - } - - template - inline void asio_handler_invoke(Function& function, - read_until_delim_string_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - inline void asio_handler_invoke(const Function& function, - read_until_delim_string_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } -} // namespace detail - -#if !defined(GENERATING_DOCUMENTATION) - -template -struct associated_allocator< - detail::read_until_delim_string_op, - Allocator> -{ - typedef typename associated_allocator::type type; - - static type get( - const detail::read_until_delim_string_op& h, - const Allocator& a = Allocator()) ASIO_NOEXCEPT - { - return associated_allocator::get(h.handler_, a); - } -}; - -template -struct associated_executor< - detail::read_until_delim_string_op, - Executor> -{ - typedef typename associated_executor::type type; - - static type get( - const detail::read_until_delim_string_op& h, - const Executor& ex = Executor()) ASIO_NOEXCEPT - { - return associated_executor::get(h.handler_, ex); - } -}; - -#endif // !defined(GENERATING_DOCUMENTATION) - -template -ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read_until(AsyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - ASIO_STRING_VIEW_PARAM delim, - ASIO_MOVE_ARG(ReadHandler) handler) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - - async_completion init(handler); - - detail::read_until_delim_string_op::type, - ASIO_HANDLER_TYPE(ReadHandler, - void (asio::error_code, std::size_t))>( - s, ASIO_MOVE_CAST(DynamicBuffer)(buffers), - static_cast(delim), - init.completion_handler)(asio::error_code(), 0, 1); - - return init.result.get(); -} - -#if !defined(ASIO_NO_EXTENSIONS) -#if defined(ASIO_HAS_BOOST_REGEX) - -namespace detail -{ - template - class read_until_expr_op - { - public: - template - read_until_expr_op(AsyncReadStream& stream, - ASIO_MOVE_ARG(BufferSequence) buffers, - const boost::regex& expr, ReadHandler& handler) - : stream_(stream), - buffers_(ASIO_MOVE_CAST(BufferSequence)(buffers)), - expr_(expr), - start_(0), - search_position_(0), - handler_(ASIO_MOVE_CAST(ReadHandler)(handler)) - { - } - -#if defined(ASIO_HAS_MOVE) - read_until_expr_op(const read_until_expr_op& other) - : stream_(other.stream_), - buffers_(other.buffers_), - expr_(other.expr_), - start_(other.start_), - search_position_(other.search_position_), - handler_(other.handler_) - { - } - - read_until_expr_op(read_until_expr_op&& other) - : stream_(other.stream_), - buffers_(ASIO_MOVE_CAST(DynamicBuffer)(other.buffers_)), - expr_(other.expr_), - start_(other.start_), - search_position_(other.search_position_), - handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()(const asio::error_code& ec, - std::size_t bytes_transferred, int start = 0) - { - const std::size_t not_found = (std::numeric_limits::max)(); - std::size_t bytes_to_read; - switch (start_ = start) - { - case 1: - for (;;) - { - { - // Determine the range of the data to be searched. - typedef typename DynamicBuffer::const_buffers_type - buffers_type; - typedef buffers_iterator iterator; - buffers_type data_buffers = buffers_.data(); - iterator begin = iterator::begin(data_buffers); - iterator start_pos = begin + search_position_; - iterator end = iterator::end(data_buffers); - - // Look for a match. - boost::match_results >::allocator_type> - match_results; - bool match = regex_search(start_pos, end, match_results, expr_, - boost::match_default | boost::match_partial); - if (match && match_results[0].matched) - { - // Full match. We're done. - search_position_ = match_results[0].second - begin; - bytes_to_read = 0; - } - - // No match yet. Check if buffer is full. - else if (buffers_.size() == buffers_.max_size()) - { - search_position_ = not_found; - bytes_to_read = 0; - } - - // Need to read some more data. - else - { - if (match) - { - // Partial match. Next search needs to start from beginning of - // match. - search_position_ = match_results[0].first - begin; - } - else - { - // Next search can start with the new data. - search_position_ = end - begin; - } - - bytes_to_read = std::min( - std::max(512, - buffers_.capacity() - buffers_.size()), - std::min(65536, - buffers_.max_size() - buffers_.size())); - } - } - - // Check if we're done. - if (!start && bytes_to_read == 0) - break; - - // Start a new asynchronous read operation to obtain more data. - stream_.async_read_some(buffers_.prepare(bytes_to_read), - ASIO_MOVE_CAST(read_until_expr_op)(*this)); - return; default: - buffers_.commit(bytes_transferred); - if (ec || bytes_transferred == 0) - break; - } - - const asio::error_code result_ec = - (search_position_ == not_found) - ? error::not_found : ec; - - const std::size_t result_n = - (ec || search_position_ == not_found) - ? 0 : search_position_; - - handler_(result_ec, result_n); - } - } - - //private: - AsyncReadStream& stream_; - DynamicBuffer buffers_; - RegEx expr_; - int start_; - std::size_t search_position_; - ReadHandler handler_; - }; - - template - inline void* asio_handler_allocate(std::size_t size, - read_until_expr_op* this_handler) - { - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); - } - - template - inline void asio_handler_deallocate(void* pointer, std::size_t size, - read_until_expr_op* this_handler) - { - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); - } - - template - inline bool asio_handler_is_continuation( - read_until_expr_op* this_handler) - { - return this_handler->start_ == 0 ? true - : asio_handler_cont_helpers::is_continuation( - this_handler->handler_); - } - - template - inline void asio_handler_invoke(Function& function, - read_until_expr_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - inline void asio_handler_invoke(const Function& function, - read_until_expr_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } -} // namespace detail - -#if !defined(GENERATING_DOCUMENTATION) - -template -struct associated_allocator< - detail::read_until_expr_op, - Allocator> -{ - typedef typename associated_allocator::type type; - - static type get( - const detail::read_until_expr_op& h, - const Allocator& a = Allocator()) ASIO_NOEXCEPT - { - return associated_allocator::get(h.handler_, a); - } -}; - -template -struct associated_executor< - detail::read_until_expr_op, - Executor> -{ - typedef typename associated_executor::type type; - - static type get( - const detail::read_until_expr_op& h, - const Executor& ex = Executor()) ASIO_NOEXCEPT - { - return associated_executor::get(h.handler_, ex); - } -}; - -#endif // !defined(GENERATING_DOCUMENTATION) - -template -ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read_until(AsyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - const boost::regex& expr, - ASIO_MOVE_ARG(ReadHandler) handler) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - - async_completion init(handler); - - detail::read_until_expr_op::type, - boost::regex, ASIO_HANDLER_TYPE(ReadHandler, - void (asio::error_code, std::size_t))>( - s, ASIO_MOVE_CAST(DynamicBuffer)(buffers), - expr, init.completion_handler)(asio::error_code(), 0, 1); - - return init.result.get(); -} - -#endif // defined(ASIO_HAS_BOOST_REGEX) - -namespace detail -{ - template - class read_until_match_op - { - public: - template - read_until_match_op(AsyncReadStream& stream, - ASIO_MOVE_ARG(BufferSequence) buffers, - MatchCondition match_condition, ReadHandler& handler) - : stream_(stream), - buffers_(ASIO_MOVE_CAST(BufferSequence)(buffers)), - match_condition_(match_condition), - start_(0), - search_position_(0), - handler_(ASIO_MOVE_CAST(ReadHandler)(handler)) - { - } - -#if defined(ASIO_HAS_MOVE) - read_until_match_op(const read_until_match_op& other) - : stream_(other.stream_), - buffers_(other.buffers_), - match_condition_(other.match_condition_), - start_(other.start_), - search_position_(other.search_position_), - handler_(other.handler_) - { - } - - read_until_match_op(read_until_match_op&& other) - : stream_(other.stream_), - buffers_(ASIO_MOVE_CAST(DynamicBuffer)(other.buffers_)), - match_condition_(other.match_condition_), - start_(other.start_), - search_position_(other.search_position_), - handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()(const asio::error_code& ec, - std::size_t bytes_transferred, int start = 0) - { - const std::size_t not_found = (std::numeric_limits::max)(); - std::size_t bytes_to_read; - switch (start_ = start) - { - case 1: - for (;;) - { - { - // Determine the range of the data to be searched. - typedef typename DynamicBuffer::const_buffers_type - buffers_type; - typedef buffers_iterator iterator; - buffers_type data_buffers = buffers_.data(); - iterator begin = iterator::begin(data_buffers); - iterator start_pos = begin + search_position_; - iterator end = iterator::end(data_buffers); - - // Look for a match. - std::pair result = match_condition_(start_pos, end); - if (result.second) - { - // Full match. We're done. - search_position_ = result.first - begin; - bytes_to_read = 0; - } - - // No match yet. Check if buffer is full. - else if (buffers_.size() == buffers_.max_size()) - { - search_position_ = not_found; - bytes_to_read = 0; - } - - // Need to read some more data. - else - { - if (result.first != end) - { - // Partial match. Next search needs to start from beginning of - // match. - search_position_ = result.first - begin; - } - else - { - // Next search can start with the new data. - search_position_ = end - begin; - } - - bytes_to_read = std::min( - std::max(512, - buffers_.capacity() - buffers_.size()), - std::min(65536, - buffers_.max_size() - buffers_.size())); - } - } - - // Check if we're done. - if (!start && bytes_to_read == 0) - break; - - // Start a new asynchronous read operation to obtain more data. - stream_.async_read_some(buffers_.prepare(bytes_to_read), - ASIO_MOVE_CAST(read_until_match_op)(*this)); - return; default: - buffers_.commit(bytes_transferred); - if (ec || bytes_transferred == 0) - break; - } - - const asio::error_code result_ec = - (search_position_ == not_found) - ? error::not_found : ec; - - const std::size_t result_n = - (ec || search_position_ == not_found) - ? 0 : search_position_; - - handler_(result_ec, result_n); - } - } - - //private: - AsyncReadStream& stream_; - DynamicBuffer buffers_; - MatchCondition match_condition_; - int start_; - std::size_t search_position_; - ReadHandler handler_; - }; - - template - inline void* asio_handler_allocate(std::size_t size, - read_until_match_op* this_handler) - { - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); - } - - template - inline void asio_handler_deallocate(void* pointer, std::size_t size, - read_until_match_op* this_handler) - { - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); - } - - template - inline bool asio_handler_is_continuation( - read_until_match_op* this_handler) - { - return this_handler->start_ == 0 ? true - : asio_handler_cont_helpers::is_continuation( - this_handler->handler_); - } - - template - inline void asio_handler_invoke(Function& function, - read_until_match_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - inline void asio_handler_invoke(const Function& function, - read_until_match_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } -} // namespace detail - -#if !defined(GENERATING_DOCUMENTATION) - -template -struct associated_allocator< - detail::read_until_match_op, - Allocator> -{ - typedef typename associated_allocator::type type; - - static type get( - const detail::read_until_match_op& h, - const Allocator& a = Allocator()) ASIO_NOEXCEPT - { - return associated_allocator::get(h.handler_, a); - } -}; - -template -struct associated_executor< - detail::read_until_match_op, - Executor> -{ - typedef typename associated_executor::type type; - - static type get( - const detail::read_until_match_op& h, - const Executor& ex = Executor()) ASIO_NOEXCEPT - { - return associated_executor::get(h.handler_, ex); - } -}; - -#endif // !defined(GENERATING_DOCUMENTATION) - -template -ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read_until(AsyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - MatchCondition match_condition, ASIO_MOVE_ARG(ReadHandler) handler, - typename enable_if::value>::type*) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - - async_completion init(handler); - - detail::read_until_match_op::type, - MatchCondition, ASIO_HANDLER_TYPE(ReadHandler, - void (asio::error_code, std::size_t))>( - s, ASIO_MOVE_CAST(DynamicBuffer)(buffers), - match_condition, init.completion_handler)( - asio::error_code(), 0, 1); - - return init.result.get(); -} - -#if !defined(ASIO_NO_IOSTREAM) - -template -inline ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read_until(AsyncReadStream& s, - asio::basic_streambuf& b, - char delim, ASIO_MOVE_ARG(ReadHandler) handler) -{ - return async_read_until(s, basic_streambuf_ref(b), - delim, ASIO_MOVE_CAST(ReadHandler)(handler)); -} - -template -inline ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read_until(AsyncReadStream& s, - asio::basic_streambuf& b, - ASIO_STRING_VIEW_PARAM delim, - ASIO_MOVE_ARG(ReadHandler) handler) -{ - return async_read_until(s, basic_streambuf_ref(b), - delim, ASIO_MOVE_CAST(ReadHandler)(handler)); -} - -#if defined(ASIO_HAS_BOOST_REGEX) - -template -inline ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read_until(AsyncReadStream& s, - asio::basic_streambuf& b, const boost::regex& expr, - ASIO_MOVE_ARG(ReadHandler) handler) -{ - return async_read_until(s, basic_streambuf_ref(b), - expr, ASIO_MOVE_CAST(ReadHandler)(handler)); -} - -#endif // defined(ASIO_HAS_BOOST_REGEX) - -template -inline ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read_until(AsyncReadStream& s, - asio::basic_streambuf& b, - MatchCondition match_condition, ASIO_MOVE_ARG(ReadHandler) handler, - typename enable_if::value>::type*) -{ - return async_read_until(s, basic_streambuf_ref(b), - match_condition, ASIO_MOVE_CAST(ReadHandler)(handler)); -} - -#endif // !defined(ASIO_NO_IOSTREAM) -#endif // !defined(ASIO_NO_EXTENSIONS) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IMPL_READ_UNTIL_HPP diff --git a/tools/sdk/include/asio/asio/impl/serial_port_base.hpp b/tools/sdk/include/asio/asio/impl/serial_port_base.hpp deleted file mode 100644 index cdc201d8ab6..00000000000 --- a/tools/sdk/include/asio/asio/impl/serial_port_base.hpp +++ /dev/null @@ -1,59 +0,0 @@ -// -// impl/serial_port_base.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IMPL_SERIAL_PORT_BASE_HPP -#define ASIO_IMPL_SERIAL_PORT_BASE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/push_options.hpp" - -namespace asio { - -inline serial_port_base::baud_rate::baud_rate(unsigned int rate) - : value_(rate) -{ -} - -inline unsigned int serial_port_base::baud_rate::value() const -{ - return value_; -} - -inline serial_port_base::flow_control::type -serial_port_base::flow_control::value() const -{ - return value_; -} - -inline serial_port_base::parity::type serial_port_base::parity::value() const -{ - return value_; -} - -inline serial_port_base::stop_bits::type -serial_port_base::stop_bits::value() const -{ - return value_; -} - -inline unsigned int serial_port_base::character_size::value() const -{ - return value_; -} - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IMPL_SERIAL_PORT_BASE_HPP diff --git a/tools/sdk/include/asio/asio/impl/spawn.hpp b/tools/sdk/include/asio/asio/impl/spawn.hpp deleted file mode 100644 index 5594ad93d43..00000000000 --- a/tools/sdk/include/asio/asio/impl/spawn.hpp +++ /dev/null @@ -1,535 +0,0 @@ -// -// impl/spawn.hpp -// ~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IMPL_SPAWN_HPP -#define ASIO_IMPL_SPAWN_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/associated_allocator.hpp" -#include "asio/associated_executor.hpp" -#include "asio/async_result.hpp" -#include "asio/bind_executor.hpp" -#include "asio/detail/atomic_count.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_cont_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/system_error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - - template - class coro_handler - { - public: - coro_handler(basic_yield_context ctx) - : coro_(ctx.coro_.lock()), - ca_(ctx.ca_), - handler_(ctx.handler_), - ready_(0), - ec_(ctx.ec_), - value_(0) - { - } - - void operator()(T value) - { - *ec_ = asio::error_code(); - *value_ = ASIO_MOVE_CAST(T)(value); - if (--*ready_ == 0) - (*coro_)(); - } - - void operator()(asio::error_code ec, T value) - { - *ec_ = ec; - *value_ = ASIO_MOVE_CAST(T)(value); - if (--*ready_ == 0) - (*coro_)(); - } - - //private: - shared_ptr::callee_type> coro_; - typename basic_yield_context::caller_type& ca_; - Handler handler_; - atomic_count* ready_; - asio::error_code* ec_; - T* value_; - }; - - template - class coro_handler - { - public: - coro_handler(basic_yield_context ctx) - : coro_(ctx.coro_.lock()), - ca_(ctx.ca_), - handler_(ctx.handler_), - ready_(0), - ec_(ctx.ec_) - { - } - - void operator()() - { - *ec_ = asio::error_code(); - if (--*ready_ == 0) - (*coro_)(); - } - - void operator()(asio::error_code ec) - { - *ec_ = ec; - if (--*ready_ == 0) - (*coro_)(); - } - - //private: - shared_ptr::callee_type> coro_; - typename basic_yield_context::caller_type& ca_; - Handler handler_; - atomic_count* ready_; - asio::error_code* ec_; - }; - - template - inline void* asio_handler_allocate(std::size_t size, - coro_handler* this_handler) - { - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); - } - - template - inline void asio_handler_deallocate(void* pointer, std::size_t size, - coro_handler* this_handler) - { - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); - } - - template - inline bool asio_handler_is_continuation(coro_handler*) - { - return true; - } - - template - inline void asio_handler_invoke(Function& function, - coro_handler* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - inline void asio_handler_invoke(const Function& function, - coro_handler* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - class coro_async_result - { - public: - typedef coro_handler completion_handler_type; - typedef T return_type; - - explicit coro_async_result(completion_handler_type& h) - : handler_(h), - ca_(h.ca_), - ready_(2) - { - h.ready_ = &ready_; - out_ec_ = h.ec_; - if (!out_ec_) h.ec_ = &ec_; - h.value_ = &value_; - } - - return_type get() - { - // Must not hold shared_ptr to coro while suspended. - handler_.coro_.reset(); - - if (--ready_ != 0) - ca_(); - if (!out_ec_ && ec_) throw asio::system_error(ec_); - return ASIO_MOVE_CAST(return_type)(value_); - } - - private: - completion_handler_type& handler_; - typename basic_yield_context::caller_type& ca_; - atomic_count ready_; - asio::error_code* out_ec_; - asio::error_code ec_; - return_type value_; - }; - - template - class coro_async_result - { - public: - typedef coro_handler completion_handler_type; - typedef void return_type; - - explicit coro_async_result(completion_handler_type& h) - : handler_(h), - ca_(h.ca_), - ready_(2) - { - h.ready_ = &ready_; - out_ec_ = h.ec_; - if (!out_ec_) h.ec_ = &ec_; - } - - void get() - { - // Must not hold shared_ptr to coro while suspended. - handler_.coro_.reset(); - - if (--ready_ != 0) - ca_(); - if (!out_ec_ && ec_) throw asio::system_error(ec_); - } - - private: - completion_handler_type& handler_; - typename basic_yield_context::caller_type& ca_; - atomic_count ready_; - asio::error_code* out_ec_; - asio::error_code ec_; - }; - -} // namespace detail - -#if !defined(GENERATING_DOCUMENTATION) - -template -class async_result, ReturnType()> - : public detail::coro_async_result -{ -public: - explicit async_result( - typename detail::coro_async_result::completion_handler_type& h) - : detail::coro_async_result(h) - { - } -}; - -template -class async_result, ReturnType(Arg1)> - : public detail::coro_async_result::type> -{ -public: - explicit async_result( - typename detail::coro_async_result::type>::completion_handler_type& h) - : detail::coro_async_result::type>(h) - { - } -}; - -template -class async_result, - ReturnType(asio::error_code)> - : public detail::coro_async_result -{ -public: - explicit async_result( - typename detail::coro_async_result::completion_handler_type& h) - : detail::coro_async_result(h) - { - } -}; - -template -class async_result, - ReturnType(asio::error_code, Arg2)> - : public detail::coro_async_result::type> -{ -public: - explicit async_result( - typename detail::coro_async_result::type>::completion_handler_type& h) - : detail::coro_async_result::type>(h) - { - } -}; - -#if !defined(ASIO_NO_DEPRECATED) - -template -struct handler_type, ReturnType()> -{ - typedef detail::coro_handler type; -}; - -template -struct handler_type, ReturnType(Arg1)> -{ - typedef detail::coro_handler::type> type; -}; - -template -struct handler_type, - ReturnType(asio::error_code)> -{ - typedef detail::coro_handler type; -}; - -template -struct handler_type, - ReturnType(asio::error_code, Arg2)> -{ - typedef detail::coro_handler::type> type; -}; - -template -class async_result > - : public detail::coro_async_result -{ -public: - typedef typename detail::coro_async_result::return_type type; - - explicit async_result( - typename detail::coro_async_result::completion_handler_type& h) - : detail::coro_async_result(h) - { - } -}; - -#endif // !defined(ASIO_NO_DEPRECATED) - -template -struct associated_allocator, Allocator> -{ - typedef typename associated_allocator::type type; - - static type get(const detail::coro_handler& h, - const Allocator& a = Allocator()) ASIO_NOEXCEPT - { - return associated_allocator::get(h.handler_, a); - } -}; - -template -struct associated_executor, Executor> -{ - typedef typename associated_executor::type type; - - static type get(const detail::coro_handler& h, - const Executor& ex = Executor()) ASIO_NOEXCEPT - { - return associated_executor::get(h.handler_, ex); - } -}; - -namespace detail { - - template - struct spawn_data : private noncopyable - { - template - spawn_data(ASIO_MOVE_ARG(Hand) handler, - bool call_handler, ASIO_MOVE_ARG(Func) function) - : handler_(ASIO_MOVE_CAST(Hand)(handler)), - call_handler_(call_handler), - function_(ASIO_MOVE_CAST(Func)(function)) - { - } - - weak_ptr::callee_type> coro_; - Handler handler_; - bool call_handler_; - Function function_; - }; - - template - struct coro_entry_point - { - void operator()(typename basic_yield_context::caller_type& ca) - { - shared_ptr > data(data_); -#if !defined(BOOST_COROUTINES_UNIDIRECT) && !defined(BOOST_COROUTINES_V2) - ca(); // Yield until coroutine pointer has been initialised. -#endif // !defined(BOOST_COROUTINES_UNIDIRECT) && !defined(BOOST_COROUTINES_V2) - const basic_yield_context yield( - data->coro_, ca, data->handler_); - - (data->function_)(yield); - if (data->call_handler_) - (data->handler_)(); - } - - shared_ptr > data_; - }; - - template - struct spawn_helper - { - void operator()() - { - typedef typename basic_yield_context::callee_type callee_type; - coro_entry_point entry_point = { data_ }; - shared_ptr coro(new callee_type(entry_point, attributes_)); - data_->coro_ = coro; - (*coro)(); - } - - shared_ptr > data_; - boost::coroutines::attributes attributes_; - }; - - template - inline void asio_handler_invoke(Function& function, - spawn_helper* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->data_->handler_); - } - - template - inline void asio_handler_invoke(const Function& function, - spawn_helper* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->data_->handler_); - } - - inline void default_spawn_handler() {} - -} // namespace detail - -template -inline void spawn(ASIO_MOVE_ARG(Function) function, - const boost::coroutines::attributes& attributes) -{ - typedef typename decay::type function_type; - - typename associated_executor::type ex( - (get_associated_executor)(function)); - - asio::spawn(ex, ASIO_MOVE_CAST(Function)(function), attributes); -} - -template -void spawn(ASIO_MOVE_ARG(Handler) handler, - ASIO_MOVE_ARG(Function) function, - const boost::coroutines::attributes& attributes, - typename enable_if::type>::value && - !is_convertible::value>::type*) -{ - typedef typename decay::type handler_type; - typedef typename decay::type function_type; - - typename associated_executor::type ex( - (get_associated_executor)(handler)); - - typename associated_allocator::type a( - (get_associated_allocator)(handler)); - - detail::spawn_helper helper; - helper.data_.reset( - new detail::spawn_data( - ASIO_MOVE_CAST(Handler)(handler), true, - ASIO_MOVE_CAST(Function)(function))); - helper.attributes_ = attributes; - - ex.dispatch(helper, a); -} - -template -void spawn(basic_yield_context ctx, - ASIO_MOVE_ARG(Function) function, - const boost::coroutines::attributes& attributes) -{ - typedef typename decay::type function_type; - - Handler handler(ctx.handler_); // Explicit copy that might be moved from. - - typename associated_executor::type ex( - (get_associated_executor)(handler)); - - typename associated_allocator::type a( - (get_associated_allocator)(handler)); - - detail::spawn_helper helper; - helper.data_.reset( - new detail::spawn_data( - ASIO_MOVE_CAST(Handler)(handler), false, - ASIO_MOVE_CAST(Function)(function))); - helper.attributes_ = attributes; - - ex.dispatch(helper, a); -} - -template -inline void spawn(const Executor& ex, - ASIO_MOVE_ARG(Function) function, - const boost::coroutines::attributes& attributes, - typename enable_if::value>::type*) -{ - asio::spawn(asio::strand(ex), - ASIO_MOVE_CAST(Function)(function), attributes); -} - -template -inline void spawn(const strand& ex, - ASIO_MOVE_ARG(Function) function, - const boost::coroutines::attributes& attributes) -{ - asio::spawn(asio::bind_executor( - ex, &detail::default_spawn_handler), - ASIO_MOVE_CAST(Function)(function), attributes); -} - -template -inline void spawn(const asio::io_context::strand& s, - ASIO_MOVE_ARG(Function) function, - const boost::coroutines::attributes& attributes) -{ - asio::spawn(asio::bind_executor( - s, &detail::default_spawn_handler), - ASIO_MOVE_CAST(Function)(function), attributes); -} - -template -inline void spawn(ExecutionContext& ctx, - ASIO_MOVE_ARG(Function) function, - const boost::coroutines::attributes& attributes, - typename enable_if::value>::type*) -{ - asio::spawn(ctx.get_executor(), - ASIO_MOVE_CAST(Function)(function), attributes); -} - -#endif // !defined(GENERATING_DOCUMENTATION) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IMPL_SPAWN_HPP diff --git a/tools/sdk/include/asio/asio/impl/src.hpp b/tools/sdk/include/asio/asio/impl/src.hpp deleted file mode 100644 index a72637b94ed..00000000000 --- a/tools/sdk/include/asio/asio/impl/src.hpp +++ /dev/null @@ -1,82 +0,0 @@ -// -// impl/src.hpp -// ~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IMPL_SRC_HPP -#define ASIO_IMPL_SRC_HPP - -#define ASIO_SOURCE - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HEADER_ONLY) -# error Do not compile Asio library source with ASIO_HEADER_ONLY defined -#endif - -#include "asio/impl/error.ipp" -#include "asio/impl/error_code.ipp" -#include "asio/impl/execution_context.ipp" -#include "asio/impl/executor.ipp" -#include "asio/impl/handler_alloc_hook.ipp" -#include "asio/impl/io_context.ipp" -#include "asio/impl/serial_port_base.ipp" -#include "asio/impl/system_context.ipp" -#include "asio/impl/thread_pool.ipp" -#include "asio/detail/impl/buffer_sequence_adapter.ipp" -#include "asio/detail/impl/descriptor_ops.ipp" -#include "asio/detail/impl/dev_poll_reactor.ipp" -#include "asio/detail/impl/epoll_reactor.ipp" -#include "asio/detail/impl/eventfd_select_interrupter.ipp" -#include "asio/detail/impl/handler_tracking.ipp" -#include "asio/detail/impl/kqueue_reactor.ipp" -#include "asio/detail/impl/null_event.ipp" -#include "asio/detail/impl/pipe_select_interrupter.ipp" -#include "asio/detail/impl/posix_event.ipp" -#include "asio/detail/impl/posix_mutex.ipp" -#include "asio/detail/impl/posix_thread.ipp" -#include "asio/detail/impl/posix_tss_ptr.ipp" -#include "asio/detail/impl/reactive_descriptor_service.ipp" -#include "asio/detail/impl/reactive_serial_port_service.ipp" -#include "asio/detail/impl/reactive_socket_service_base.ipp" -#include "asio/detail/impl/resolver_service_base.ipp" -#include "asio/detail/impl/scheduler.ipp" -#include "asio/detail/impl/select_reactor.ipp" -#include "asio/detail/impl/service_registry.ipp" -#include "asio/detail/impl/signal_set_service.ipp" -#include "asio/detail/impl/socket_ops.ipp" -#include "asio/detail/impl/socket_select_interrupter.ipp" -#include "asio/detail/impl/strand_executor_service.ipp" -#include "asio/detail/impl/strand_service.ipp" -#include "asio/detail/impl/throw_error.ipp" -#include "asio/detail/impl/timer_queue_ptime.ipp" -#include "asio/detail/impl/timer_queue_set.ipp" -#include "asio/detail/impl/win_iocp_handle_service.ipp" -#include "asio/detail/impl/win_iocp_io_context.ipp" -#include "asio/detail/impl/win_iocp_serial_port_service.ipp" -#include "asio/detail/impl/win_iocp_socket_service_base.ipp" -#include "asio/detail/impl/win_event.ipp" -#include "asio/detail/impl/win_mutex.ipp" -#include "asio/detail/impl/win_object_handle_service.ipp" -#include "asio/detail/impl/win_static_mutex.ipp" -#include "asio/detail/impl/win_thread.ipp" -#include "asio/detail/impl/win_tss_ptr.ipp" -#include "asio/detail/impl/winrt_ssocket_service_base.ipp" -#include "asio/detail/impl/winrt_timer_scheduler.ipp" -#include "asio/detail/impl/winsock_init.ipp" -#include "asio/generic/detail/impl/endpoint.ipp" -#include "asio/ip/impl/address.ipp" -#include "asio/ip/impl/address_v4.ipp" -#include "asio/ip/impl/address_v6.ipp" -#include "asio/ip/impl/host_name.ipp" -#include "asio/ip/impl/network_v4.ipp" -#include "asio/ip/impl/network_v6.ipp" -#include "asio/ip/detail/impl/endpoint.ipp" -#include "asio/local/detail/impl/endpoint.ipp" - -#endif // ASIO_IMPL_SRC_HPP diff --git a/tools/sdk/include/asio/asio/impl/system_context.hpp b/tools/sdk/include/asio/asio/impl/system_context.hpp deleted file mode 100644 index 87ffe76a258..00000000000 --- a/tools/sdk/include/asio/asio/impl/system_context.hpp +++ /dev/null @@ -1,34 +0,0 @@ -// -// impl/system_context.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IMPL_SYSTEM_CONTEXT_HPP -#define ASIO_IMPL_SYSTEM_CONTEXT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/system_executor.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -inline system_context::executor_type -system_context::get_executor() ASIO_NOEXCEPT -{ - return system_executor(); -} - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IMPL_SYSTEM_CONTEXT_HPP diff --git a/tools/sdk/include/asio/asio/impl/system_executor.hpp b/tools/sdk/include/asio/asio/impl/system_executor.hpp deleted file mode 100644 index ac4861f56b8..00000000000 --- a/tools/sdk/include/asio/asio/impl/system_executor.hpp +++ /dev/null @@ -1,85 +0,0 @@ -// -// impl/system_executor.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IMPL_SYSTEM_EXECUTOR_HPP -#define ASIO_IMPL_SYSTEM_EXECUTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/executor_op.hpp" -#include "asio/detail/global.hpp" -#include "asio/detail/recycling_allocator.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/system_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -inline system_context& system_executor::context() const ASIO_NOEXCEPT -{ - return detail::global(); -} - -template -void system_executor::dispatch( - ASIO_MOVE_ARG(Function) f, const Allocator&) const -{ - typename decay::type tmp(ASIO_MOVE_CAST(Function)(f)); - asio_handler_invoke_helpers::invoke(tmp, tmp); -} - -template -void system_executor::post( - ASIO_MOVE_ARG(Function) f, const Allocator& a) const -{ - typedef typename decay::type function_type; - - system_context& ctx = detail::global(); - - // Allocate and construct an operation to wrap the function. - typedef detail::executor_op op; - typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 }; - p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(f), a); - - ASIO_HANDLER_CREATION((ctx, *p.p, - "system_executor", &this->context(), 0, "post")); - - ctx.scheduler_.post_immediate_completion(p.p, false); - p.v = p.p = 0; -} - -template -void system_executor::defer( - ASIO_MOVE_ARG(Function) f, const Allocator& a) const -{ - typedef typename decay::type function_type; - - system_context& ctx = detail::global(); - - // Allocate and construct an operation to wrap the function. - typedef detail::executor_op op; - typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 }; - p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(f), a); - - ASIO_HANDLER_CREATION((ctx, *p.p, - "system_executor", &this->context(), 0, "defer")); - - ctx.scheduler_.post_immediate_completion(p.p, true); - p.v = p.p = 0; -} - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IMPL_SYSTEM_EXECUTOR_HPP diff --git a/tools/sdk/include/asio/asio/impl/thread_pool.hpp b/tools/sdk/include/asio/asio/impl/thread_pool.hpp deleted file mode 100644 index 058e3771bba..00000000000 --- a/tools/sdk/include/asio/asio/impl/thread_pool.hpp +++ /dev/null @@ -1,127 +0,0 @@ -// -// impl/thread_pool.hpp -// ~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IMPL_THREAD_POOL_HPP -#define ASIO_IMPL_THREAD_POOL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/executor_op.hpp" -#include "asio/detail/fenced_block.hpp" -#include "asio/detail/recycling_allocator.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/execution_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -inline thread_pool::executor_type -thread_pool::get_executor() ASIO_NOEXCEPT -{ - return executor_type(*this); -} - -inline thread_pool& -thread_pool::executor_type::context() const ASIO_NOEXCEPT -{ - return pool_; -} - -inline void -thread_pool::executor_type::on_work_started() const ASIO_NOEXCEPT -{ - pool_.scheduler_.work_started(); -} - -inline void thread_pool::executor_type::on_work_finished() -const ASIO_NOEXCEPT -{ - pool_.scheduler_.work_finished(); -} - -template -void thread_pool::executor_type::dispatch( - ASIO_MOVE_ARG(Function) f, const Allocator& a) const -{ - typedef typename decay::type function_type; - - // Invoke immediately if we are already inside the thread pool. - if (pool_.scheduler_.can_dispatch()) - { - // Make a local, non-const copy of the function. - function_type tmp(ASIO_MOVE_CAST(Function)(f)); - - detail::fenced_block b(detail::fenced_block::full); - asio_handler_invoke_helpers::invoke(tmp, tmp); - return; - } - - // Allocate and construct an operation to wrap the function. - typedef detail::executor_op op; - typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 }; - p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(f), a); - - ASIO_HANDLER_CREATION((pool_, *p.p, - "thread_pool", &this->context(), 0, "dispatch")); - - pool_.scheduler_.post_immediate_completion(p.p, false); - p.v = p.p = 0; -} - -template -void thread_pool::executor_type::post( - ASIO_MOVE_ARG(Function) f, const Allocator& a) const -{ - typedef typename decay::type function_type; - - // Allocate and construct an operation to wrap the function. - typedef detail::executor_op op; - typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 }; - p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(f), a); - - ASIO_HANDLER_CREATION((pool_, *p.p, - "thread_pool", &this->context(), 0, "post")); - - pool_.scheduler_.post_immediate_completion(p.p, false); - p.v = p.p = 0; -} - -template -void thread_pool::executor_type::defer( - ASIO_MOVE_ARG(Function) f, const Allocator& a) const -{ - typedef typename decay::type function_type; - - // Allocate and construct an operation to wrap the function. - typedef detail::executor_op op; - typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 }; - p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(f), a); - - ASIO_HANDLER_CREATION((pool_, *p.p, - "thread_pool", &this->context(), 0, "defer")); - - pool_.scheduler_.post_immediate_completion(p.p, true); - p.v = p.p = 0; -} - -inline bool -thread_pool::executor_type::running_in_this_thread() const ASIO_NOEXCEPT -{ - return pool_.scheduler_.can_dispatch(); -} - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IMPL_THREAD_POOL_HPP diff --git a/tools/sdk/include/asio/asio/impl/use_future.hpp b/tools/sdk/include/asio/asio/impl/use_future.hpp deleted file mode 100644 index 51eb7e2ca41..00000000000 --- a/tools/sdk/include/asio/asio/impl/use_future.hpp +++ /dev/null @@ -1,938 +0,0 @@ -// -// impl/use_future.hpp -// ~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IMPL_USE_FUTURE_HPP -#define ASIO_IMPL_USE_FUTURE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include -#include "asio/async_result.hpp" -#include "asio/detail/memory.hpp" -#include "asio/error_code.hpp" -#include "asio/packaged_task.hpp" -#include "asio/system_error.hpp" -#include "asio/system_executor.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -#if defined(ASIO_HAS_VARIADIC_TEMPLATES) - -template -inline void promise_invoke_and_set(std::promise& p, - F& f, ASIO_MOVE_ARG(Args)... args) -{ -#if !defined(ASIO_NO_EXCEPTIONS) - try -#endif // !defined(ASIO_NO_EXCEPTIONS) - { - p.set_value(f(ASIO_MOVE_CAST(Args)(args)...)); - } -#if !defined(ASIO_NO_EXCEPTIONS) - catch (...) - { - p.set_exception(std::current_exception()); - } -#endif // !defined(ASIO_NO_EXCEPTIONS) -} - -template -inline void promise_invoke_and_set(std::promise& p, - F& f, ASIO_MOVE_ARG(Args)... args) -{ -#if !defined(ASIO_NO_EXCEPTIONS) - try -#endif // !defined(ASIO_NO_EXCEPTIONS) - { - f(ASIO_MOVE_CAST(Args)(args)...); - p.set_value(); - } -#if !defined(ASIO_NO_EXCEPTIONS) - catch (...) - { - p.set_exception(std::current_exception()); - } -#endif // !defined(ASIO_NO_EXCEPTIONS) -} - -#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) - -template -inline void promise_invoke_and_set(std::promise& p, F& f) -{ -#if !defined(ASIO_NO_EXCEPTIONS) - try -#endif // !defined(ASIO_NO_EXCEPTIONS) - { - p.set_value(f()); - } -#if !defined(ASIO_NO_EXCEPTIONS) - catch (...) - { - p.set_exception(std::current_exception()); - } -#endif // !defined(ASIO_NO_EXCEPTIONS) -} - -template -inline void promise_invoke_and_set(std::promise& p, F& f) -{ -#if !defined(ASIO_NO_EXCEPTIONS) - try -#endif // !defined(ASIO_NO_EXCEPTIONS) - { - f(); - p.set_value(); -#if !defined(ASIO_NO_EXCEPTIONS) - } - catch (...) - { - p.set_exception(std::current_exception()); - } -#endif // !defined(ASIO_NO_EXCEPTIONS) -} - -#if defined(ASIO_NO_EXCEPTIONS) - -#define ASIO_PRIVATE_PROMISE_INVOKE_DEF(n) \ - template \ - inline void promise_invoke_and_set(std::promise& p, \ - F& f, ASIO_VARIADIC_MOVE_PARAMS(n)) \ - { \ - p.set_value(f(ASIO_VARIADIC_MOVE_ARGS(n))); \ - } \ - \ - template \ - inline void promise_invoke_and_set(std::promise& p, \ - F& f, ASIO_VARIADIC_MOVE_PARAMS(n)) \ - { \ - f(ASIO_VARIADIC_MOVE_ARGS(n)); \ - p.set_value(); \ - } \ - /**/ - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_PROMISE_INVOKE_DEF) -#undef ASIO_PRIVATE_PROMISE_INVOKE_DEF - -#else // defined(ASIO_NO_EXCEPTIONS) - -#define ASIO_PRIVATE_PROMISE_INVOKE_DEF(n) \ - template \ - inline void promise_invoke_and_set(std::promise& p, \ - F& f, ASIO_VARIADIC_MOVE_PARAMS(n)) \ - { \ - try \ - { \ - p.set_value(f(ASIO_VARIADIC_MOVE_ARGS(n))); \ - } \ - catch (...) \ - { \ - p.set_exception(std::current_exception()); \ - } \ - } \ - \ - template \ - inline void promise_invoke_and_set(std::promise& p, \ - F& f, ASIO_VARIADIC_MOVE_PARAMS(n)) \ - { \ - try \ - { \ - f(ASIO_VARIADIC_MOVE_ARGS(n)); \ - p.set_value(); \ - } \ - catch (...) \ - { \ - p.set_exception(std::current_exception()); \ - } \ - } \ - /**/ - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_PROMISE_INVOKE_DEF) -#undef ASIO_PRIVATE_PROMISE_INVOKE_DEF - -#endif // defined(ASIO_NO_EXCEPTIONS) - -#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) - -// A function object adapter to invoke a nullary function object and capture -// any exception thrown into a promise. -template -class promise_invoker -{ -public: - promise_invoker(const shared_ptr >& p, - ASIO_MOVE_ARG(F) f) - : p_(p), f_(ASIO_MOVE_CAST(F)(f)) - { - } - - void operator()() - { -#if !defined(ASIO_NO_EXCEPTIONS) - try -#endif // !defined(ASIO_NO_EXCEPTIONS) - { - f_(); - } -#if !defined(ASIO_NO_EXCEPTIONS) - catch (...) - { - p_->set_exception(std::current_exception()); - } -#endif // !defined(ASIO_NO_EXCEPTIONS) - } - -private: - shared_ptr > p_; - typename decay::type f_; -}; - -// An executor that adapts the system_executor to capture any exeption thrown -// by a submitted function object and save it into a promise. -template -class promise_executor -{ -public: - explicit promise_executor(const shared_ptr >& p) - : p_(p) - { - } - - execution_context& context() const ASIO_NOEXCEPT - { - return system_executor().context(); - } - - void on_work_started() const ASIO_NOEXCEPT {} - void on_work_finished() const ASIO_NOEXCEPT {} - - template - void dispatch(ASIO_MOVE_ARG(F) f, const A&) const - { - promise_invoker(p_, ASIO_MOVE_CAST(F)(f))(); - } - - template - void post(ASIO_MOVE_ARG(F) f, const A& a) const - { - system_executor().post( - promise_invoker(p_, ASIO_MOVE_CAST(F)(f)), a); - } - - template - void defer(ASIO_MOVE_ARG(F) f, const A& a) const - { - system_executor().defer( - promise_invoker(p_, ASIO_MOVE_CAST(F)(f)), a); - } - - friend bool operator==(const promise_executor& a, - const promise_executor& b) ASIO_NOEXCEPT - { - return a.p_ == b.p_; - } - - friend bool operator!=(const promise_executor& a, - const promise_executor& b) ASIO_NOEXCEPT - { - return a.p_ != b.p_; - } - -private: - shared_ptr > p_; -}; - -// The base class for all completion handlers that create promises. -template -class promise_creator -{ -public: - typedef promise_executor executor_type; - - executor_type get_executor() const ASIO_NOEXCEPT - { - return executor_type(p_); - } - - typedef std::future future_type; - - future_type get_future() - { - return p_->get_future(); - } - -protected: - template - void create_promise(const Allocator& a) - { - ASIO_REBIND_ALLOC(Allocator, char) b(a); - p_ = std::allocate_shared>(b, std::allocator_arg, b); - } - - shared_ptr > p_; -}; - -// For completion signature void(). -class promise_handler_0 - : public promise_creator -{ -public: - void operator()() - { - this->p_->set_value(); - } -}; - -// For completion signature void(error_code). -class promise_handler_ec_0 - : public promise_creator -{ -public: - void operator()(const asio::error_code& ec) - { - if (ec) - { - this->p_->set_exception( - std::make_exception_ptr( - asio::system_error(ec))); - } - else - { - this->p_->set_value(); - } - } -}; - -// For completion signature void(exception_ptr). -class promise_handler_ex_0 - : public promise_creator -{ -public: - void operator()(const std::exception_ptr& ex) - { - if (ex) - { - this->p_->set_exception(ex); - } - else - { - this->p_->set_value(); - } - } -}; - -// For completion signature void(T). -template -class promise_handler_1 - : public promise_creator -{ -public: - template - void operator()(ASIO_MOVE_ARG(Arg) arg) - { - this->p_->set_value(ASIO_MOVE_CAST(Arg)(arg)); - } -}; - -// For completion signature void(error_code, T). -template -class promise_handler_ec_1 - : public promise_creator -{ -public: - template - void operator()(const asio::error_code& ec, - ASIO_MOVE_ARG(Arg) arg) - { - if (ec) - { - this->p_->set_exception( - std::make_exception_ptr( - asio::system_error(ec))); - } - else - this->p_->set_value(ASIO_MOVE_CAST(Arg)(arg)); - } -}; - -// For completion signature void(exception_ptr, T). -template -class promise_handler_ex_1 - : public promise_creator -{ -public: - template - void operator()(const std::exception_ptr& ex, - ASIO_MOVE_ARG(Arg) arg) - { - if (ex) - this->p_->set_exception(ex); - else - this->p_->set_value(ASIO_MOVE_CAST(Arg)(arg)); - } -}; - -// For completion signature void(T1, ..., Tn); -template -class promise_handler_n - : public promise_creator -{ -public: -#if defined(ASIO_HAS_VARIADIC_TEMPLATES) - - template - void operator()(ASIO_MOVE_ARG(Args)... args) - { - this->p_->set_value( - std::forward_as_tuple( - ASIO_MOVE_CAST(Args)(args)...)); - } - -#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) - -#define ASIO_PRIVATE_CALL_OP_DEF(n) \ - template \ - void operator()(ASIO_VARIADIC_MOVE_PARAMS(n)) \ - {\ - this->p_->set_value( \ - std::forward_as_tuple( \ - ASIO_VARIADIC_MOVE_ARGS(n))); \ - } \ - /**/ - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_CALL_OP_DEF) -#undef ASIO_PRIVATE_CALL_OP_DEF - -#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) -}; - -// For completion signature void(error_code, T1, ..., Tn); -template -class promise_handler_ec_n - : public promise_creator -{ -public: -#if defined(ASIO_HAS_VARIADIC_TEMPLATES) - - template - void operator()(const asio::error_code& ec, - ASIO_MOVE_ARG(Args)... args) - { - if (ec) - { - this->p_->set_exception( - std::make_exception_ptr( - asio::system_error(ec))); - } - else - { - this->p_->set_value( - std::forward_as_tuple( - ASIO_MOVE_CAST(Args)(args)...)); - } - } - -#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) - -#define ASIO_PRIVATE_CALL_OP_DEF(n) \ - template \ - void operator()(const asio::error_code& ec, \ - ASIO_VARIADIC_MOVE_PARAMS(n)) \ - {\ - if (ec) \ - { \ - this->p_->set_exception( \ - std::make_exception_ptr( \ - asio::system_error(ec))); \ - } \ - else \ - { \ - this->p_->set_value( \ - std::forward_as_tuple( \ - ASIO_VARIADIC_MOVE_ARGS(n))); \ - } \ - } \ - /**/ - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_CALL_OP_DEF) -#undef ASIO_PRIVATE_CALL_OP_DEF - -#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) -}; - -// For completion signature void(exception_ptr, T1, ..., Tn); -template -class promise_handler_ex_n - : public promise_creator -{ -public: -#if defined(ASIO_HAS_VARIADIC_TEMPLATES) - - template - void operator()(const std::exception_ptr& ex, - ASIO_MOVE_ARG(Args)... args) - { - if (ex) - this->p_->set_exception(ex); - else - { - this->p_->set_value( - std::forward_as_tuple( - ASIO_MOVE_CAST(Args)(args)...)); - } - } - -#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) - -#define ASIO_PRIVATE_CALL_OP_DEF(n) \ - template \ - void operator()(const std::exception_ptr& ex, \ - ASIO_VARIADIC_MOVE_PARAMS(n)) \ - {\ - if (ex) \ - this->p_->set_exception(ex); \ - else \ - { \ - this->p_->set_value( \ - std::forward_as_tuple( \ - ASIO_VARIADIC_MOVE_ARGS(n))); \ - } \ - } \ - /**/ - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_CALL_OP_DEF) -#undef ASIO_PRIVATE_CALL_OP_DEF - -#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) -}; - -// Helper template to choose the appropriate concrete promise handler -// implementation based on the supplied completion signature. -template class promise_handler_selector; - -template <> -class promise_handler_selector - : public promise_handler_0 {}; - -template <> -class promise_handler_selector - : public promise_handler_ec_0 {}; - -template <> -class promise_handler_selector - : public promise_handler_ex_0 {}; - -template -class promise_handler_selector - : public promise_handler_1 {}; - -template -class promise_handler_selector - : public promise_handler_ec_1 {}; - -template -class promise_handler_selector - : public promise_handler_ex_1 {}; - -#if defined(ASIO_HAS_VARIADIC_TEMPLATES) - -template -class promise_handler_selector - : public promise_handler_n > {}; - -template -class promise_handler_selector - : public promise_handler_ec_n > {}; - -template -class promise_handler_selector - : public promise_handler_ex_n > {}; - -#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) - -#define ASIO_PRIVATE_PROMISE_SELECTOR_DEF(n) \ - template \ - class promise_handler_selector< \ - void(Arg, ASIO_VARIADIC_TARGS(n))> \ - : public promise_handler_n< \ - std::tuple > {}; \ - \ - template \ - class promise_handler_selector< \ - void(asio::error_code, Arg, ASIO_VARIADIC_TARGS(n))> \ - : public promise_handler_ec_n< \ - std::tuple > {}; \ - \ - template \ - class promise_handler_selector< \ - void(std::exception_ptr, Arg, ASIO_VARIADIC_TARGS(n))> \ - : public promise_handler_ex_n< \ - std::tuple > {}; \ - /**/ - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_PROMISE_SELECTOR_DEF) -#undef ASIO_PRIVATE_PROMISE_SELECTOR_DEF - -#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) - -// Completion handlers produced from the use_future completion token, when not -// using use_future::operator(). -template -class promise_handler - : public promise_handler_selector -{ -public: - typedef Allocator allocator_type; - typedef void result_type; - - promise_handler(use_future_t u) - : allocator_(u.get_allocator()) - { - this->create_promise(allocator_); - } - - allocator_type get_allocator() const ASIO_NOEXCEPT - { - return allocator_; - } - -private: - Allocator allocator_; -}; - -template -inline void asio_handler_invoke(Function& f, - promise_handler* h) -{ - typename promise_handler::executor_type - ex(h->get_executor()); - ex.dispatch(ASIO_MOVE_CAST(Function)(f), std::allocator()); -} - -template -inline void asio_handler_invoke(const Function& f, - promise_handler* h) -{ - typename promise_handler::executor_type - ex(h->get_executor()); - ex.dispatch(f, std::allocator()); -} - -// Helper base class for async_result specialisation. -template -class promise_async_result -{ -public: - typedef promise_handler completion_handler_type; - typedef typename completion_handler_type::future_type return_type; - - explicit promise_async_result(completion_handler_type& h) - : future_(h.get_future()) - { - } - - return_type get() - { - return ASIO_MOVE_CAST(return_type)(future_); - } - -private: - return_type future_; -}; - -// Return value from use_future::operator(). -template -class packaged_token -{ -public: - packaged_token(Function f, const Allocator& a) - : function_(ASIO_MOVE_CAST(Function)(f)), - allocator_(a) - { - } - -//private: - Function function_; - Allocator allocator_; -}; - -// Completion handlers produced from the use_future completion token, when -// using use_future::operator(). -template -class packaged_handler - : public promise_creator -{ -public: - typedef Allocator allocator_type; - typedef void result_type; - - packaged_handler(packaged_token t) - : function_(ASIO_MOVE_CAST(Function)(t.function_)), - allocator_(t.allocator_) - { - this->create_promise(allocator_); - } - - allocator_type get_allocator() const ASIO_NOEXCEPT - { - return allocator_; - } - -#if defined(ASIO_HAS_VARIADIC_TEMPLATES) - - template - void operator()(ASIO_MOVE_ARG(Args)... args) - { - (promise_invoke_and_set)(*this->p_, - function_, ASIO_MOVE_CAST(Args)(args)...); - } - -#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) - - void operator()() - { - (promise_invoke_and_set)(*this->p_, function_); - } - -#define ASIO_PRIVATE_CALL_OP_DEF(n) \ - template \ - void operator()(ASIO_VARIADIC_MOVE_PARAMS(n)) \ - {\ - (promise_invoke_and_set)(*this->p_, \ - function_, ASIO_VARIADIC_MOVE_ARGS(n)); \ - } \ - /**/ - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_CALL_OP_DEF) -#undef ASIO_PRIVATE_CALL_OP_DEF - -#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) - -private: - Function function_; - Allocator allocator_; -}; - -template -inline void asio_handler_invoke(Function& f, - packaged_handler* h) -{ - typename packaged_handler::executor_type - ex(h->get_executor()); - ex.dispatch(ASIO_MOVE_CAST(Function)(f), std::allocator()); -} - -template -inline void asio_handler_invoke(const Function& f, - packaged_handler* h) -{ - typename packaged_handler::executor_type - ex(h->get_executor()); - ex.dispatch(f, std::allocator()); -} - -// Helper base class for async_result specialisation. -template -class packaged_async_result -{ -public: - typedef packaged_handler completion_handler_type; - typedef typename completion_handler_type::future_type return_type; - - explicit packaged_async_result(completion_handler_type& h) - : future_(h.get_future()) - { - } - - return_type get() - { - return ASIO_MOVE_CAST(return_type)(future_); - } - -private: - return_type future_; -}; - -} // namespace detail - -template template -inline detail::packaged_token::type, Allocator> -use_future_t::operator()(ASIO_MOVE_ARG(Function) f) const -{ - return detail::packaged_token::type, Allocator>( - ASIO_MOVE_CAST(Function)(f), allocator_); -} - -#if !defined(GENERATING_DOCUMENTATION) - -#if defined(ASIO_HAS_VARIADIC_TEMPLATES) - -template -class async_result, Result(Args...)> - : public detail::promise_async_result< - void(typename decay::type...), Allocator> -{ -public: - explicit async_result( - typename detail::promise_async_result::type...), - Allocator>::completion_handler_type& h) - : detail::promise_async_result< - void(typename decay::type...), Allocator>(h) - { - } -}; - -template -class async_result, Result(Args...)> - : public detail::packaged_async_result::type> -{ -public: - explicit async_result( - typename detail::packaged_async_result::type>::completion_handler_type& h) - : detail::packaged_async_result::type>(h) - { - } -}; - -#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) - -template -class async_result, Result()> - : public detail::promise_async_result -{ -public: - explicit async_result( - typename detail::promise_async_result< - void(), Allocator>::completion_handler_type& h) - : detail::promise_async_result(h) - { - } -}; - -template -class async_result, Result()> - : public detail::packaged_async_result::type> -{ -public: - explicit async_result( - typename detail::packaged_async_result::type>::completion_handler_type& h) - : detail::packaged_async_result::type>(h) - { - } -}; - -#define ASIO_PRIVATE_ASYNC_RESULT_DEF(n) \ - template \ - class async_result, \ - Result(ASIO_VARIADIC_TARGS(n))> \ - : public detail::promise_async_result< \ - void(ASIO_VARIADIC_DECAY(n)), Allocator> \ - { \ - public: \ - explicit async_result( \ - typename detail::promise_async_result< \ - void(ASIO_VARIADIC_DECAY(n)), \ - Allocator>::completion_handler_type& h) \ - : detail::promise_async_result< \ - void(ASIO_VARIADIC_DECAY(n)), Allocator>(h) \ - { \ - } \ - }; \ - \ - template \ - class async_result, \ - Result(ASIO_VARIADIC_TARGS(n))> \ - : public detail::packaged_async_result::type> \ - { \ - public: \ - explicit async_result( \ - typename detail::packaged_async_result::type \ - >::completion_handler_type& h) \ - : detail::packaged_async_result::type>(h) \ - { \ - } \ - }; \ - /**/ - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_ASYNC_RESULT_DEF) -#undef ASIO_PRIVATE_ASYNC_RESULT_DEF - -#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) - -#if !defined(ASIO_NO_DEPRECATED) - -template -struct handler_type, Signature> -{ - typedef typename async_result, - Signature>::completion_handler_type type; -}; - -template -class async_result > - : public detail::promise_async_result -{ -public: - typedef typename detail::promise_async_result< - Signature, Allocator>::return_type type; - - explicit async_result( - typename detail::promise_async_result< - Signature, Allocator>::completion_handler_type& h) - : detail::promise_async_result(h) - { - } -}; - -template -struct handler_type, Signature> -{ - typedef typename async_result, - Signature>::completion_handler_type type; -}; - -template -class async_result > - : public detail::packaged_async_result -{ -public: - typedef typename detail::packaged_async_result< - Function, Allocator, Result>::return_type type; - - explicit async_result( - typename detail::packaged_async_result< - Function, Allocator, Result>::completion_handler_type& h) - : detail::packaged_async_result(h) - { - } -}; - -#endif // !defined(ASIO_NO_DEPRECATED) - -#endif // !defined(GENERATING_DOCUMENTATION) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IMPL_USE_FUTURE_HPP diff --git a/tools/sdk/include/asio/asio/impl/write.hpp b/tools/sdk/include/asio/asio/impl/write.hpp deleted file mode 100644 index d07e8d3e077..00000000000 --- a/tools/sdk/include/asio/asio/impl/write.hpp +++ /dev/null @@ -1,674 +0,0 @@ -// -// impl/write.hpp -// ~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IMPL_WRITE_HPP -#define ASIO_IMPL_WRITE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/associated_allocator.hpp" -#include "asio/associated_executor.hpp" -#include "asio/buffer.hpp" -#include "asio/completion_condition.hpp" -#include "asio/detail/array_fwd.hpp" -#include "asio/detail/base_from_completion_cond.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/consuming_buffers.hpp" -#include "asio/detail/dependent_type.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_cont_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/throw_error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -namespace detail -{ - template - std::size_t write_buffer_sequence(SyncWriteStream& s, - const ConstBufferSequence& buffers, const ConstBufferIterator&, - CompletionCondition completion_condition, asio::error_code& ec) - { - ec = asio::error_code(); - asio::detail::consuming_buffers tmp(buffers); - while (!tmp.empty()) - { - if (std::size_t max_size = detail::adapt_completion_condition_result( - completion_condition(ec, tmp.total_consumed()))) - tmp.consume(s.write_some(tmp.prepare(max_size), ec)); - else - break; - } - return tmp.total_consumed();; - } -} // namespace detail - -template -inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers, - CompletionCondition completion_condition, asio::error_code& ec, - typename enable_if< - is_const_buffer_sequence::value - >::type*) -{ - return detail::write_buffer_sequence(s, buffers, - asio::buffer_sequence_begin(buffers), completion_condition, ec); -} - -template -inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers, - typename enable_if< - is_const_buffer_sequence::value - >::type*) -{ - asio::error_code ec; - std::size_t bytes_transferred = write(s, buffers, transfer_all(), ec); - asio::detail::throw_error(ec, "write"); - return bytes_transferred; -} - -template -inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers, - asio::error_code& ec, - typename enable_if< - is_const_buffer_sequence::value - >::type*) -{ - return write(s, buffers, transfer_all(), ec); -} - -template -inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers, - CompletionCondition completion_condition, - typename enable_if< - is_const_buffer_sequence::value - >::type*) -{ - asio::error_code ec; - std::size_t bytes_transferred = write(s, buffers, completion_condition, ec); - asio::detail::throw_error(ec, "write"); - return bytes_transferred; -} - -template -std::size_t write(SyncWriteStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - CompletionCondition completion_condition, asio::error_code& ec, - typename enable_if< - is_dynamic_buffer::type>::value - >::type*) -{ - typename decay::type b( - ASIO_MOVE_CAST(DynamicBuffer)(buffers)); - - std::size_t bytes_transferred = write(s, b.data(), completion_condition, ec); - b.consume(bytes_transferred); - return bytes_transferred; -} - -template -inline std::size_t write(SyncWriteStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - typename enable_if< - is_dynamic_buffer::type>::value - >::type*) -{ - asio::error_code ec; - std::size_t bytes_transferred = write(s, - ASIO_MOVE_CAST(DynamicBuffer)(buffers), - transfer_all(), ec); - asio::detail::throw_error(ec, "write"); - return bytes_transferred; -} - -template -inline std::size_t write(SyncWriteStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - asio::error_code& ec, - typename enable_if< - is_dynamic_buffer::type>::value - >::type*) -{ - return write(s, ASIO_MOVE_CAST(DynamicBuffer)(buffers), - transfer_all(), ec); -} - -template -inline std::size_t write(SyncWriteStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - CompletionCondition completion_condition, - typename enable_if< - is_dynamic_buffer::type>::value - >::type*) -{ - asio::error_code ec; - std::size_t bytes_transferred = write(s, - ASIO_MOVE_CAST(DynamicBuffer)(buffers), - completion_condition, ec); - asio::detail::throw_error(ec, "write"); - return bytes_transferred; -} - -#if !defined(ASIO_NO_EXTENSIONS) -#if !defined(ASIO_NO_IOSTREAM) - -template -inline std::size_t write(SyncWriteStream& s, - asio::basic_streambuf& b, - CompletionCondition completion_condition, asio::error_code& ec) -{ - return write(s, basic_streambuf_ref(b), completion_condition, ec); -} - -template -inline std::size_t write(SyncWriteStream& s, - asio::basic_streambuf& b) -{ - return write(s, basic_streambuf_ref(b)); -} - -template -inline std::size_t write(SyncWriteStream& s, - asio::basic_streambuf& b, - asio::error_code& ec) -{ - return write(s, basic_streambuf_ref(b), ec); -} - -template -inline std::size_t write(SyncWriteStream& s, - asio::basic_streambuf& b, - CompletionCondition completion_condition) -{ - return write(s, basic_streambuf_ref(b), completion_condition); -} - -#endif // !defined(ASIO_NO_IOSTREAM) -#endif // !defined(ASIO_NO_EXTENSIONS) - -namespace detail -{ - template - class write_op - : detail::base_from_completion_cond - { - public: - write_op(AsyncWriteStream& stream, const ConstBufferSequence& buffers, - CompletionCondition completion_condition, WriteHandler& handler) - : detail::base_from_completion_cond< - CompletionCondition>(completion_condition), - stream_(stream), - buffers_(buffers), - start_(0), - handler_(ASIO_MOVE_CAST(WriteHandler)(handler)) - { - } - -#if defined(ASIO_HAS_MOVE) - write_op(const write_op& other) - : detail::base_from_completion_cond(other), - stream_(other.stream_), - buffers_(other.buffers_), - start_(other.start_), - handler_(other.handler_) - { - } - - write_op(write_op&& other) - : detail::base_from_completion_cond(other), - stream_(other.stream_), - buffers_(other.buffers_), - start_(other.start_), - handler_(ASIO_MOVE_CAST(WriteHandler)(other.handler_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()(const asio::error_code& ec, - std::size_t bytes_transferred, int start = 0) - { - std::size_t max_size; - switch (start_ = start) - { - case 1: - max_size = this->check_for_completion(ec, buffers_.total_consumed()); - do - { - stream_.async_write_some(buffers_.prepare(max_size), - ASIO_MOVE_CAST(write_op)(*this)); - return; default: - buffers_.consume(bytes_transferred); - if ((!ec && bytes_transferred == 0) || buffers_.empty()) - break; - max_size = this->check_for_completion(ec, buffers_.total_consumed()); - } while (max_size > 0); - - handler_(ec, buffers_.total_consumed()); - } - } - - //private: - AsyncWriteStream& stream_; - asio::detail::consuming_buffers buffers_; - int start_; - WriteHandler handler_; - }; - - template - inline void* asio_handler_allocate(std::size_t size, - write_op* this_handler) - { - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); - } - - template - inline void asio_handler_deallocate(void* pointer, std::size_t size, - write_op* this_handler) - { - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); - } - - template - inline bool asio_handler_is_continuation( - write_op* this_handler) - { - return this_handler->start_ == 0 ? true - : asio_handler_cont_helpers::is_continuation( - this_handler->handler_); - } - - template - inline void asio_handler_invoke(Function& function, - write_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - inline void asio_handler_invoke(const Function& function, - write_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - inline void start_write_buffer_sequence_op(AsyncWriteStream& stream, - const ConstBufferSequence& buffers, const ConstBufferIterator&, - CompletionCondition completion_condition, WriteHandler& handler) - { - detail::write_op( - stream, buffers, completion_condition, handler)( - asio::error_code(), 0, 1); - } - -} // namespace detail - -#if !defined(GENERATING_DOCUMENTATION) - -template -struct associated_allocator< - detail::write_op, - Allocator> -{ - typedef typename associated_allocator::type type; - - static type get( - const detail::write_op& h, - const Allocator& a = Allocator()) ASIO_NOEXCEPT - { - return associated_allocator::get(h.handler_, a); - } -}; - -template -struct associated_executor< - detail::write_op, - Executor> -{ - typedef typename associated_executor::type type; - - static type get( - const detail::write_op& h, - const Executor& ex = Executor()) ASIO_NOEXCEPT - { - return associated_executor::get(h.handler_, ex); - } -}; - -#endif // !defined(GENERATING_DOCUMENTATION) - -template -inline ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) -async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers, - CompletionCondition completion_condition, - ASIO_MOVE_ARG(WriteHandler) handler, - typename enable_if< - is_const_buffer_sequence::value - >::type*) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - - async_completion init(handler); - - detail::start_write_buffer_sequence_op(s, buffers, - asio::buffer_sequence_begin(buffers), completion_condition, - init.completion_handler); - - return init.result.get(); -} - -template -inline ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) -async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler, - typename enable_if< - is_const_buffer_sequence::value - >::type*) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - - async_completion init(handler); - - detail::start_write_buffer_sequence_op(s, buffers, - asio::buffer_sequence_begin(buffers), transfer_all(), - init.completion_handler); - - return init.result.get(); -} - -namespace detail -{ - template - class write_dynbuf_op - { - public: - template - write_dynbuf_op(AsyncWriteStream& stream, - ASIO_MOVE_ARG(BufferSequence) buffers, - CompletionCondition completion_condition, WriteHandler& handler) - : stream_(stream), - buffers_(ASIO_MOVE_CAST(BufferSequence)(buffers)), - completion_condition_( - ASIO_MOVE_CAST(CompletionCondition)(completion_condition)), - handler_(ASIO_MOVE_CAST(WriteHandler)(handler)) - { - } - -#if defined(ASIO_HAS_MOVE) - write_dynbuf_op(const write_dynbuf_op& other) - : stream_(other.stream_), - buffers_(other.buffers_), - completion_condition_(other.completion_condition_), - handler_(other.handler_) - { - } - - write_dynbuf_op(write_dynbuf_op&& other) - : stream_(other.stream_), - buffers_(ASIO_MOVE_CAST(DynamicBuffer)(other.buffers_)), - completion_condition_( - ASIO_MOVE_CAST(CompletionCondition)( - other.completion_condition_)), - handler_(ASIO_MOVE_CAST(WriteHandler)(other.handler_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()(const asio::error_code& ec, - std::size_t bytes_transferred, int start = 0) - { - switch (start) - { - case 1: - async_write(stream_, buffers_.data(), completion_condition_, - ASIO_MOVE_CAST(write_dynbuf_op)(*this)); - return; default: - buffers_.consume(bytes_transferred); - handler_(ec, static_cast(bytes_transferred)); - } - } - - //private: - AsyncWriteStream& stream_; - DynamicBuffer buffers_; - CompletionCondition completion_condition_; - WriteHandler handler_; - }; - - template - inline void* asio_handler_allocate(std::size_t size, - write_dynbuf_op* this_handler) - { - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); - } - - template - inline void asio_handler_deallocate(void* pointer, std::size_t size, - write_dynbuf_op* this_handler) - { - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); - } - - template - inline bool asio_handler_is_continuation( - write_dynbuf_op* this_handler) - { - return asio_handler_cont_helpers::is_continuation( - this_handler->handler_); - } - - template - inline void asio_handler_invoke(Function& function, - write_dynbuf_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - inline void asio_handler_invoke(const Function& function, - write_dynbuf_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } -} // namespace detail - -#if !defined(GENERATING_DOCUMENTATION) - -template -struct associated_allocator< - detail::write_dynbuf_op, - Allocator> -{ - typedef typename associated_allocator::type type; - - static type get( - const detail::write_dynbuf_op& h, - const Allocator& a = Allocator()) ASIO_NOEXCEPT - { - return associated_allocator::get(h.handler_, a); - } -}; - -template -struct associated_executor< - detail::write_dynbuf_op, - Executor> -{ - typedef typename associated_executor::type type; - - static type get( - const detail::write_dynbuf_op& h, - const Executor& ex = Executor()) ASIO_NOEXCEPT - { - return associated_executor::get(h.handler_, ex); - } -}; - -#endif // !defined(GENERATING_DOCUMENTATION) - -template -inline ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) -async_write(AsyncWriteStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - ASIO_MOVE_ARG(WriteHandler) handler, - typename enable_if< - is_dynamic_buffer::type>::value - >::type*) -{ - return async_write(s, - ASIO_MOVE_CAST(DynamicBuffer)(buffers), - transfer_all(), ASIO_MOVE_CAST(WriteHandler)(handler)); -} - -template -inline ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) -async_write(AsyncWriteStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - CompletionCondition completion_condition, - ASIO_MOVE_ARG(WriteHandler) handler, - typename enable_if< - is_dynamic_buffer::type>::value - >::type*) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - - async_completion init(handler); - - detail::write_dynbuf_op::type, - CompletionCondition, ASIO_HANDLER_TYPE( - WriteHandler, void (asio::error_code, std::size_t))>( - s, ASIO_MOVE_CAST(DynamicBuffer)(buffers), - completion_condition, init.completion_handler)( - asio::error_code(), 0, 1); - - return init.result.get(); -} - -#if !defined(ASIO_NO_EXTENSIONS) -#if !defined(ASIO_NO_IOSTREAM) - -template -inline ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) -async_write(AsyncWriteStream& s, - asio::basic_streambuf& b, - ASIO_MOVE_ARG(WriteHandler) handler) -{ - return async_write(s, basic_streambuf_ref(b), - ASIO_MOVE_CAST(WriteHandler)(handler)); -} - -template -inline ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) -async_write(AsyncWriteStream& s, - asio::basic_streambuf& b, - CompletionCondition completion_condition, - ASIO_MOVE_ARG(WriteHandler) handler) -{ - return async_write(s, basic_streambuf_ref(b), - completion_condition, ASIO_MOVE_CAST(WriteHandler)(handler)); -} - -#endif // !defined(ASIO_NO_IOSTREAM) -#endif // !defined(ASIO_NO_EXTENSIONS) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IMPL_WRITE_HPP diff --git a/tools/sdk/include/asio/asio/impl/write_at.hpp b/tools/sdk/include/asio/asio/impl/write_at.hpp deleted file mode 100644 index cc6f336f1d1..00000000000 --- a/tools/sdk/include/asio/asio/impl/write_at.hpp +++ /dev/null @@ -1,572 +0,0 @@ -// -// impl/write_at.hpp -// ~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IMPL_WRITE_AT_HPP -#define ASIO_IMPL_WRITE_AT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/associated_allocator.hpp" -#include "asio/associated_executor.hpp" -#include "asio/buffer.hpp" -#include "asio/completion_condition.hpp" -#include "asio/detail/array_fwd.hpp" -#include "asio/detail/base_from_completion_cond.hpp" -#include "asio/detail/bind_handler.hpp" -#include "asio/detail/consuming_buffers.hpp" -#include "asio/detail/dependent_type.hpp" -#include "asio/detail/handler_alloc_helpers.hpp" -#include "asio/detail/handler_cont_helpers.hpp" -#include "asio/detail/handler_invoke_helpers.hpp" -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/throw_error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -namespace detail -{ - template - std::size_t write_at_buffer_sequence(SyncRandomAccessWriteDevice& d, - uint64_t offset, const ConstBufferSequence& buffers, - const ConstBufferIterator&, CompletionCondition completion_condition, - asio::error_code& ec) - { - ec = asio::error_code(); - asio::detail::consuming_buffers tmp(buffers); - while (!tmp.empty()) - { - if (std::size_t max_size = detail::adapt_completion_condition_result( - completion_condition(ec, tmp.total_consumed()))) - { - tmp.consume(d.write_some_at(offset + tmp.total_consumed(), - tmp.prepare(max_size), ec)); - } - else - break; - } - return tmp.total_consumed();; - } -} // namespace detail - -template -std::size_t write_at(SyncRandomAccessWriteDevice& d, - uint64_t offset, const ConstBufferSequence& buffers, - CompletionCondition completion_condition, asio::error_code& ec) -{ - return detail::write_at_buffer_sequence(d, offset, buffers, - asio::buffer_sequence_begin(buffers), completion_condition, ec); -} - -template -inline std::size_t write_at(SyncRandomAccessWriteDevice& d, - uint64_t offset, const ConstBufferSequence& buffers) -{ - asio::error_code ec; - std::size_t bytes_transferred = write_at( - d, offset, buffers, transfer_all(), ec); - asio::detail::throw_error(ec, "write_at"); - return bytes_transferred; -} - -template -inline std::size_t write_at(SyncRandomAccessWriteDevice& d, - uint64_t offset, const ConstBufferSequence& buffers, - asio::error_code& ec) -{ - return write_at(d, offset, buffers, transfer_all(), ec); -} - -template -inline std::size_t write_at(SyncRandomAccessWriteDevice& d, - uint64_t offset, const ConstBufferSequence& buffers, - CompletionCondition completion_condition) -{ - asio::error_code ec; - std::size_t bytes_transferred = write_at( - d, offset, buffers, completion_condition, ec); - asio::detail::throw_error(ec, "write_at"); - return bytes_transferred; -} - -#if !defined(ASIO_NO_EXTENSIONS) -#if !defined(ASIO_NO_IOSTREAM) - -template -std::size_t write_at(SyncRandomAccessWriteDevice& d, - uint64_t offset, asio::basic_streambuf& b, - CompletionCondition completion_condition, asio::error_code& ec) -{ - std::size_t bytes_transferred = write_at( - d, offset, b.data(), completion_condition, ec); - b.consume(bytes_transferred); - return bytes_transferred; -} - -template -inline std::size_t write_at(SyncRandomAccessWriteDevice& d, - uint64_t offset, asio::basic_streambuf& b) -{ - asio::error_code ec; - std::size_t bytes_transferred = write_at(d, offset, b, transfer_all(), ec); - asio::detail::throw_error(ec, "write_at"); - return bytes_transferred; -} - -template -inline std::size_t write_at(SyncRandomAccessWriteDevice& d, - uint64_t offset, asio::basic_streambuf& b, - asio::error_code& ec) -{ - return write_at(d, offset, b, transfer_all(), ec); -} - -template -inline std::size_t write_at(SyncRandomAccessWriteDevice& d, - uint64_t offset, asio::basic_streambuf& b, - CompletionCondition completion_condition) -{ - asio::error_code ec; - std::size_t bytes_transferred = write_at( - d, offset, b, completion_condition, ec); - asio::detail::throw_error(ec, "write_at"); - return bytes_transferred; -} - -#endif // !defined(ASIO_NO_IOSTREAM) -#endif // !defined(ASIO_NO_EXTENSIONS) - -namespace detail -{ - template - class write_at_op - : detail::base_from_completion_cond - { - public: - write_at_op(AsyncRandomAccessWriteDevice& device, - uint64_t offset, const ConstBufferSequence& buffers, - CompletionCondition completion_condition, WriteHandler& handler) - : detail::base_from_completion_cond< - CompletionCondition>(completion_condition), - device_(device), - offset_(offset), - buffers_(buffers), - start_(0), - handler_(ASIO_MOVE_CAST(WriteHandler)(handler)) - { - } - -#if defined(ASIO_HAS_MOVE) - write_at_op(const write_at_op& other) - : detail::base_from_completion_cond(other), - device_(other.device_), - offset_(other.offset_), - buffers_(other.buffers_), - start_(other.start_), - handler_(other.handler_) - { - } - - write_at_op(write_at_op&& other) - : detail::base_from_completion_cond(other), - device_(other.device_), - offset_(other.offset_), - buffers_(other.buffers_), - start_(other.start_), - handler_(ASIO_MOVE_CAST(WriteHandler)(other.handler_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()(const asio::error_code& ec, - std::size_t bytes_transferred, int start = 0) - { - std::size_t max_size; - switch (start_ = start) - { - case 1: - max_size = this->check_for_completion(ec, buffers_.total_consumed()); - do - { - device_.async_write_some_at( - offset_ + buffers_.total_consumed(), buffers_.prepare(max_size), - ASIO_MOVE_CAST(write_at_op)(*this)); - return; default: - buffers_.consume(bytes_transferred); - if ((!ec && bytes_transferred == 0) || buffers_.empty()) - break; - max_size = this->check_for_completion(ec, buffers_.total_consumed()); - } while (max_size > 0); - - handler_(ec, buffers_.total_consumed()); - } - } - - //private: - AsyncRandomAccessWriteDevice& device_; - uint64_t offset_; - asio::detail::consuming_buffers buffers_; - int start_; - WriteHandler handler_; - }; - - template - inline void* asio_handler_allocate(std::size_t size, - write_at_op* this_handler) - { - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); - } - - template - inline void asio_handler_deallocate(void* pointer, std::size_t size, - write_at_op* this_handler) - { - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); - } - - template - inline bool asio_handler_is_continuation( - write_at_op* this_handler) - { - return this_handler->start_ == 0 ? true - : asio_handler_cont_helpers::is_continuation( - this_handler->handler_); - } - - template - inline void asio_handler_invoke(Function& function, - write_at_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - inline void asio_handler_invoke(const Function& function, - write_at_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - inline void start_write_at_buffer_sequence_op(AsyncRandomAccessWriteDevice& d, - uint64_t offset, const ConstBufferSequence& buffers, - const ConstBufferIterator&, CompletionCondition completion_condition, - WriteHandler& handler) - { - detail::write_at_op( - d, offset, buffers, completion_condition, handler)( - asio::error_code(), 0, 1); - } -} // namespace detail - -#if !defined(GENERATING_DOCUMENTATION) - -template -struct associated_allocator< - detail::write_at_op, - Allocator> -{ - typedef typename associated_allocator::type type; - - static type get( - const detail::write_at_op& h, - const Allocator& a = Allocator()) ASIO_NOEXCEPT - { - return associated_allocator::get(h.handler_, a); - } -}; - -template -struct associated_executor< - detail::write_at_op, - Executor> -{ - typedef typename associated_executor::type type; - - static type get( - const detail::write_at_op& h, - const Executor& ex = Executor()) ASIO_NOEXCEPT - { - return associated_executor::get(h.handler_, ex); - } -}; - -#endif // !defined(GENERATING_DOCUMENTATION) - -template -inline ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) -async_write_at(AsyncRandomAccessWriteDevice& d, - uint64_t offset, const ConstBufferSequence& buffers, - CompletionCondition completion_condition, - ASIO_MOVE_ARG(WriteHandler) handler) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - - async_completion init(handler); - - detail::start_write_at_buffer_sequence_op(d, offset, buffers, - asio::buffer_sequence_begin(buffers), completion_condition, - init.completion_handler); - - return init.result.get(); -} - -template -inline ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) -async_write_at(AsyncRandomAccessWriteDevice& d, - uint64_t offset, const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - - async_completion init(handler); - - detail::start_write_at_buffer_sequence_op(d, offset, buffers, - asio::buffer_sequence_begin(buffers), transfer_all(), - init.completion_handler); - - return init.result.get(); -} - -#if !defined(ASIO_NO_EXTENSIONS) -#if !defined(ASIO_NO_IOSTREAM) - -namespace detail -{ - template - class write_at_streambuf_op - { - public: - write_at_streambuf_op( - asio::basic_streambuf& streambuf, - WriteHandler& handler) - : streambuf_(streambuf), - handler_(ASIO_MOVE_CAST(WriteHandler)(handler)) - { - } - -#if defined(ASIO_HAS_MOVE) - write_at_streambuf_op(const write_at_streambuf_op& other) - : streambuf_(other.streambuf_), - handler_(other.handler_) - { - } - - write_at_streambuf_op(write_at_streambuf_op&& other) - : streambuf_(other.streambuf_), - handler_(ASIO_MOVE_CAST(WriteHandler)(other.handler_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()(const asio::error_code& ec, - const std::size_t bytes_transferred) - { - streambuf_.consume(bytes_transferred); - handler_(ec, bytes_transferred); - } - - //private: - asio::basic_streambuf& streambuf_; - WriteHandler handler_; - }; - - template - inline void* asio_handler_allocate(std::size_t size, - write_at_streambuf_op* this_handler) - { - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); - } - - template - inline void asio_handler_deallocate(void* pointer, std::size_t size, - write_at_streambuf_op* this_handler) - { - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); - } - - template - inline bool asio_handler_is_continuation( - write_at_streambuf_op* this_handler) - { - return asio_handler_cont_helpers::is_continuation( - this_handler->handler_); - } - - template - inline void asio_handler_invoke(Function& function, - write_at_streambuf_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - inline void asio_handler_invoke(const Function& function, - write_at_streambuf_op* this_handler) - { - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); - } - - template - inline write_at_streambuf_op - make_write_at_streambuf_op( - asio::basic_streambuf& b, WriteHandler handler) - { - return write_at_streambuf_op(b, handler); - } -} // namespace detail - -#if !defined(GENERATING_DOCUMENTATION) - -template -struct associated_allocator< - detail::write_at_streambuf_op, - Allocator1> -{ - typedef typename associated_allocator::type type; - - static type get( - const detail::write_at_streambuf_op& h, - const Allocator1& a = Allocator1()) ASIO_NOEXCEPT - { - return associated_allocator::get(h.handler_, a); - } -}; - -template -struct associated_executor< - detail::write_at_streambuf_op, - Executor1> -{ - typedef typename associated_executor::type type; - - static type get( - const detail::write_at_streambuf_op& h, - const Executor1& ex = Executor1()) ASIO_NOEXCEPT - { - return associated_executor::get(h.handler_, ex); - } -}; - -#endif // !defined(GENERATING_DOCUMENTATION) - -template -inline ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) -async_write_at(AsyncRandomAccessWriteDevice& d, - uint64_t offset, asio::basic_streambuf& b, - CompletionCondition completion_condition, - ASIO_MOVE_ARG(WriteHandler) handler) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - - async_completion init(handler); - - async_write_at(d, offset, b.data(), completion_condition, - detail::write_at_streambuf_op( - b, init.completion_handler)); - - return init.result.get(); -} - -template -inline ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) -async_write_at(AsyncRandomAccessWriteDevice& d, - uint64_t offset, asio::basic_streambuf& b, - ASIO_MOVE_ARG(WriteHandler) handler) -{ - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - - async_completion init(handler); - - async_write_at(d, offset, b.data(), transfer_all(), - detail::write_at_streambuf_op( - b, init.completion_handler)); - - return init.result.get(); -} - -#endif // !defined(ASIO_NO_IOSTREAM) -#endif // !defined(ASIO_NO_EXTENSIONS) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IMPL_WRITE_AT_HPP diff --git a/tools/sdk/include/asio/asio/io_context.hpp b/tools/sdk/include/asio/asio/io_context.hpp deleted file mode 100644 index 4d93be44b2c..00000000000 --- a/tools/sdk/include/asio/asio/io_context.hpp +++ /dev/null @@ -1,876 +0,0 @@ -// -// io_context.hpp -// ~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IO_CONTEXT_HPP -#define ASIO_IO_CONTEXT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include -#include -#include "asio/async_result.hpp" -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/wrapped_handler.hpp" -#include "asio/error_code.hpp" -#include "asio/execution_context.hpp" - -#if defined(ASIO_HAS_CHRONO) -# include "asio/detail/chrono.hpp" -#endif // defined(ASIO_HAS_CHRONO) - -#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) -# include "asio/detail/winsock_init.hpp" -#elif defined(__sun) || defined(__QNX__) || defined(__hpux) || defined(_AIX) \ - || defined(__osf__) -# include "asio/detail/signal_init.hpp" -#endif - -#include "asio/detail/push_options.hpp" - -namespace asio { - -namespace detail { -#if defined(ASIO_HAS_IOCP) - typedef class win_iocp_io_context io_context_impl; - class win_iocp_overlapped_ptr; -#else - typedef class scheduler io_context_impl; -#endif -} // namespace detail - -/// Provides core I/O functionality. -/** - * The io_context class provides the core I/O functionality for users of the - * asynchronous I/O objects, including: - * - * @li asio::ip::tcp::socket - * @li asio::ip::tcp::acceptor - * @li asio::ip::udp::socket - * @li asio::deadline_timer. - * - * The io_context class also includes facilities intended for developers of - * custom asynchronous services. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Safe, with the specific exceptions of the restart() - * and notify_fork() functions. Calling restart() while there are unfinished - * run(), run_one(), run_for(), run_until(), poll() or poll_one() calls results - * in undefined behaviour. The notify_fork() function should not be called - * while any io_context function, or any function on an I/O object that is - * associated with the io_context, is being called in another thread. - * - * @par Concepts: - * Dispatcher. - * - * @par Synchronous and asynchronous operations - * - * Synchronous operations on I/O objects implicitly run the io_context object - * for an individual operation. The io_context functions run(), run_one(), - * run_for(), run_until(), poll() or poll_one() must be called for the - * io_context to perform asynchronous operations on behalf of a C++ program. - * Notification that an asynchronous operation has completed is delivered by - * invocation of the associated handler. Handlers are invoked only by a thread - * that is currently calling any overload of run(), run_one(), run_for(), - * run_until(), poll() or poll_one() for the io_context. - * - * @par Effect of exceptions thrown from handlers - * - * If an exception is thrown from a handler, the exception is allowed to - * propagate through the throwing thread's invocation of run(), run_one(), - * run_for(), run_until(), poll() or poll_one(). No other threads that are - * calling any of these functions are affected. It is then the responsibility - * of the application to catch the exception. - * - * After the exception has been caught, the run(), run_one(), run_for(), - * run_until(), poll() or poll_one() call may be restarted @em without the need - * for an intervening call to restart(). This allows the thread to rejoin the - * io_context object's thread pool without impacting any other threads in the - * pool. - * - * For example: - * - * @code - * asio::io_context io_context; - * ... - * for (;;) - * { - * try - * { - * io_context.run(); - * break; // run() exited normally - * } - * catch (my_exception& e) - * { - * // Deal with exception as appropriate. - * } - * } - * @endcode - * - * @par Submitting arbitrary tasks to the io_context - * - * To submit functions to the io_context, use the @ref asio::dispatch, - * @ref asio::post or @ref asio::defer free functions. - * - * For example: - * - * @code void my_task() - * { - * ... - * } - * - * ... - * - * asio::io_context io_context; - * - * // Submit a function to the io_context. - * asio::post(io_context, my_task); - * - * // Submit a lambda object to the io_context. - * asio::post(io_context, - * []() - * { - * ... - * }); - * - * // Run the io_context until it runs out of work. - * io_context.run(); @endcode - * - * @par Stopping the io_context from running out of work - * - * Some applications may need to prevent an io_context object's run() call from - * returning when there is no more work to do. For example, the io_context may - * be being run in a background thread that is launched prior to the - * application's asynchronous operations. The run() call may be kept running by - * creating an object of type - * asio::executor_work_guard: - * - * @code asio::io_context io_context; - * asio::executor_work_guard - * = asio::make_work_guard(io_context); - * ... @endcode - * - * To effect a shutdown, the application will then need to call the io_context - * object's stop() member function. This will cause the io_context run() call - * to return as soon as possible, abandoning unfinished operations and without - * permitting ready handlers to be dispatched. - * - * Alternatively, if the application requires that all operations and handlers - * be allowed to finish normally, the work object may be explicitly reset. - * - * @code asio::io_context io_context; - * asio::executor_work_guard - * = asio::make_work_guard(io_context); - * ... - * work.reset(); // Allow run() to exit. @endcode - */ -class io_context - : public execution_context -{ -private: - typedef detail::io_context_impl impl_type; -#if defined(ASIO_HAS_IOCP) - friend class detail::win_iocp_overlapped_ptr; -#endif - -public: - class executor_type; - friend class executor_type; - -#if !defined(ASIO_NO_DEPRECATED) - class work; - friend class work; -#endif // !defined(ASIO_NO_DEPRECATED) - - class service; - -#if !defined(ASIO_NO_EXTENSIONS) - class strand; -#endif // !defined(ASIO_NO_EXTENSIONS) - - /// The type used to count the number of handlers executed by the context. - typedef std::size_t count_type; - - /// Constructor. - ASIO_DECL io_context(); - - /// Constructor. - /** - * Construct with a hint about the required level of concurrency. - * - * @param concurrency_hint A suggestion to the implementation on how many - * threads it should allow to run simultaneously. - */ - ASIO_DECL explicit io_context(int concurrency_hint); - - /// Destructor. - /** - * On destruction, the io_context performs the following sequence of - * operations: - * - * @li For each service object @c svc in the io_context set, in reverse order - * of the beginning of service object lifetime, performs - * @c svc->shutdown(). - * - * @li Uninvoked handler objects that were scheduled for deferred invocation - * on the io_context, or any associated strand, are destroyed. - * - * @li For each service object @c svc in the io_context set, in reverse order - * of the beginning of service object lifetime, performs - * delete static_cast(svc). - * - * @note The destruction sequence described above permits programs to - * simplify their resource management by using @c shared_ptr<>. Where an - * object's lifetime is tied to the lifetime of a connection (or some other - * sequence of asynchronous operations), a @c shared_ptr to the object would - * be bound into the handlers for all asynchronous operations associated with - * it. This works as follows: - * - * @li When a single connection ends, all associated asynchronous operations - * complete. The corresponding handler objects are destroyed, and all - * @c shared_ptr references to the objects are destroyed. - * - * @li To shut down the whole program, the io_context function stop() is - * called to terminate any run() calls as soon as possible. The io_context - * destructor defined above destroys all handlers, causing all @c shared_ptr - * references to all connection objects to be destroyed. - */ - ASIO_DECL ~io_context(); - - /// Obtains the executor associated with the io_context. - executor_type get_executor() ASIO_NOEXCEPT; - - /// Run the io_context object's event processing loop. - /** - * The run() function blocks until all work has finished and there are no - * more handlers to be dispatched, or until the io_context has been stopped. - * - * Multiple threads may call the run() function to set up a pool of threads - * from which the io_context may execute handlers. All threads that are - * waiting in the pool are equivalent and the io_context may choose any one - * of them to invoke a handler. - * - * A normal exit from the run() function implies that the io_context object - * is stopped (the stopped() function returns @c true). Subsequent calls to - * run(), run_one(), poll() or poll_one() will return immediately unless there - * is a prior call to restart(). - * - * @return The number of handlers that were executed. - * - * @note Calling the run() function from a thread that is currently calling - * one of run(), run_one(), run_for(), run_until(), poll() or poll_one() on - * the same io_context object may introduce the potential for deadlock. It is - * the caller's reponsibility to avoid this. - * - * The poll() function may also be used to dispatch ready handlers, but - * without blocking. - */ - ASIO_DECL count_type run(); - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use non-error_code overload.) Run the io_context object's - /// event processing loop. - /** - * The run() function blocks until all work has finished and there are no - * more handlers to be dispatched, or until the io_context has been stopped. - * - * Multiple threads may call the run() function to set up a pool of threads - * from which the io_context may execute handlers. All threads that are - * waiting in the pool are equivalent and the io_context may choose any one - * of them to invoke a handler. - * - * A normal exit from the run() function implies that the io_context object - * is stopped (the stopped() function returns @c true). Subsequent calls to - * run(), run_one(), poll() or poll_one() will return immediately unless there - * is a prior call to restart(). - * - * @param ec Set to indicate what error occurred, if any. - * - * @return The number of handlers that were executed. - * - * @note Calling the run() function from a thread that is currently calling - * one of run(), run_one(), run_for(), run_until(), poll() or poll_one() on - * the same io_context object may introduce the potential for deadlock. It is - * the caller's reponsibility to avoid this. - * - * The poll() function may also be used to dispatch ready handlers, but - * without blocking. - */ - ASIO_DECL count_type run(asio::error_code& ec); -#endif // !defined(ASIO_NO_DEPRECATED) - -#if defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION) - /// Run the io_context object's event processing loop for a specified - /// duration. - /** - * The run_for() function blocks until all work has finished and there are no - * more handlers to be dispatched, until the io_context has been stopped, or - * until the specified duration has elapsed. - * - * @param rel_time The duration for which the call may block. - * - * @return The number of handlers that were executed. - */ - template - std::size_t run_for(const chrono::duration& rel_time); - - /// Run the io_context object's event processing loop until a specified time. - /** - * The run_until() function blocks until all work has finished and there are - * no more handlers to be dispatched, until the io_context has been stopped, - * or until the specified time has been reached. - * - * @param abs_time The time point until which the call may block. - * - * @return The number of handlers that were executed. - */ - template - std::size_t run_until(const chrono::time_point& abs_time); -#endif // defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION) - - /// Run the io_context object's event processing loop to execute at most one - /// handler. - /** - * The run_one() function blocks until one handler has been dispatched, or - * until the io_context has been stopped. - * - * @return The number of handlers that were executed. A zero return value - * implies that the io_context object is stopped (the stopped() function - * returns @c true). Subsequent calls to run(), run_one(), poll() or - * poll_one() will return immediately unless there is a prior call to - * restart(). - * - * @note Calling the run_one() function from a thread that is currently - * calling one of run(), run_one(), run_for(), run_until(), poll() or - * poll_one() on the same io_context object may introduce the potential for - * deadlock. It is the caller's reponsibility to avoid this. - */ - ASIO_DECL count_type run_one(); - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use non-error_code overlaod.) Run the io_context object's - /// event processing loop to execute at most one handler. - /** - * The run_one() function blocks until one handler has been dispatched, or - * until the io_context has been stopped. - * - * @return The number of handlers that were executed. A zero return value - * implies that the io_context object is stopped (the stopped() function - * returns @c true). Subsequent calls to run(), run_one(), poll() or - * poll_one() will return immediately unless there is a prior call to - * restart(). - * - * @return The number of handlers that were executed. - * - * @note Calling the run_one() function from a thread that is currently - * calling one of run(), run_one(), run_for(), run_until(), poll() or - * poll_one() on the same io_context object may introduce the potential for - * deadlock. It is the caller's reponsibility to avoid this. - */ - ASIO_DECL count_type run_one(asio::error_code& ec); -#endif // !defined(ASIO_NO_DEPRECATED) - -#if defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION) - /// Run the io_context object's event processing loop for a specified duration - /// to execute at most one handler. - /** - * The run_one_for() function blocks until one handler has been dispatched, - * until the io_context has been stopped, or until the specified duration has - * elapsed. - * - * @param rel_time The duration for which the call may block. - * - * @return The number of handlers that were executed. - */ - template - std::size_t run_one_for(const chrono::duration& rel_time); - - /// Run the io_context object's event processing loop until a specified time - /// to execute at most one handler. - /** - * The run_one_until() function blocks until one handler has been dispatched, - * until the io_context has been stopped, or until the specified time has - * been reached. - * - * @param abs_time The time point until which the call may block. - * - * @return The number of handlers that were executed. - */ - template - std::size_t run_one_until( - const chrono::time_point& abs_time); -#endif // defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION) - - /// Run the io_context object's event processing loop to execute ready - /// handlers. - /** - * The poll() function runs handlers that are ready to run, without blocking, - * until the io_context has been stopped or there are no more ready handlers. - * - * @return The number of handlers that were executed. - */ - ASIO_DECL count_type poll(); - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use non-error_code overload.) Run the io_context object's - /// event processing loop to execute ready handlers. - /** - * The poll() function runs handlers that are ready to run, without blocking, - * until the io_context has been stopped or there are no more ready handlers. - * - * @param ec Set to indicate what error occurred, if any. - * - * @return The number of handlers that were executed. - */ - ASIO_DECL count_type poll(asio::error_code& ec); -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Run the io_context object's event processing loop to execute one ready - /// handler. - /** - * The poll_one() function runs at most one handler that is ready to run, - * without blocking. - * - * @return The number of handlers that were executed. - */ - ASIO_DECL count_type poll_one(); - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use non-error_code overload.) Run the io_context object's - /// event processing loop to execute one ready handler. - /** - * The poll_one() function runs at most one handler that is ready to run, - * without blocking. - * - * @param ec Set to indicate what error occurred, if any. - * - * @return The number of handlers that were executed. - */ - ASIO_DECL count_type poll_one(asio::error_code& ec); -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Stop the io_context object's event processing loop. - /** - * This function does not block, but instead simply signals the io_context to - * stop. All invocations of its run() or run_one() member functions should - * return as soon as possible. Subsequent calls to run(), run_one(), poll() - * or poll_one() will return immediately until restart() is called. - */ - ASIO_DECL void stop(); - - /// Determine whether the io_context object has been stopped. - /** - * This function is used to determine whether an io_context object has been - * stopped, either through an explicit call to stop(), or due to running out - * of work. When an io_context object is stopped, calls to run(), run_one(), - * poll() or poll_one() will return immediately without invoking any - * handlers. - * - * @return @c true if the io_context object is stopped, otherwise @c false. - */ - ASIO_DECL bool stopped() const; - - /// Restart the io_context in preparation for a subsequent run() invocation. - /** - * This function must be called prior to any second or later set of - * invocations of the run(), run_one(), poll() or poll_one() functions when a - * previous invocation of these functions returned due to the io_context - * being stopped or running out of work. After a call to restart(), the - * io_context object's stopped() function will return @c false. - * - * This function must not be called while there are any unfinished calls to - * the run(), run_one(), poll() or poll_one() functions. - */ - ASIO_DECL void restart(); - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use restart().) Reset the io_context in preparation for a - /// subsequent run() invocation. - /** - * This function must be called prior to any second or later set of - * invocations of the run(), run_one(), poll() or poll_one() functions when a - * previous invocation of these functions returned due to the io_context - * being stopped or running out of work. After a call to restart(), the - * io_context object's stopped() function will return @c false. - * - * This function must not be called while there are any unfinished calls to - * the run(), run_one(), poll() or poll_one() functions. - */ - void reset(); - - /// (Deprecated: Use asio::dispatch().) Request the io_context to - /// invoke the given handler. - /** - * This function is used to ask the io_context to execute the given handler. - * - * The io_context guarantees that the handler will only be called in a thread - * in which the run(), run_one(), poll() or poll_one() member functions is - * currently being invoked. The handler may be executed inside this function - * if the guarantee can be met. - * - * @param handler The handler to be called. The io_context will make - * a copy of the handler object as required. The function signature of the - * handler must be: @code void handler(); @endcode - * - * @note This function throws an exception only if: - * - * @li the handler's @c asio_handler_allocate function; or - * - * @li the handler's copy constructor - * - * throws an exception. - */ - template - ASIO_INITFN_RESULT_TYPE(LegacyCompletionHandler, void ()) - dispatch(ASIO_MOVE_ARG(LegacyCompletionHandler) handler); - - /// (Deprecated: Use asio::post().) Request the io_context to invoke - /// the given handler and return immediately. - /** - * This function is used to ask the io_context to execute the given handler, - * but without allowing the io_context to call the handler from inside this - * function. - * - * The io_context guarantees that the handler will only be called in a thread - * in which the run(), run_one(), poll() or poll_one() member functions is - * currently being invoked. - * - * @param handler The handler to be called. The io_context will make - * a copy of the handler object as required. The function signature of the - * handler must be: @code void handler(); @endcode - * - * @note This function throws an exception only if: - * - * @li the handler's @c asio_handler_allocate function; or - * - * @li the handler's copy constructor - * - * throws an exception. - */ - template - ASIO_INITFN_RESULT_TYPE(LegacyCompletionHandler, void ()) - post(ASIO_MOVE_ARG(LegacyCompletionHandler) handler); - - /// (Deprecated: Use asio::bind_executor().) Create a new handler that - /// automatically dispatches the wrapped handler on the io_context. - /** - * This function is used to create a new handler function object that, when - * invoked, will automatically pass the wrapped handler to the io_context - * object's dispatch function. - * - * @param handler The handler to be wrapped. The io_context will make a copy - * of the handler object as required. The function signature of the handler - * must be: @code void handler(A1 a1, ... An an); @endcode - * - * @return A function object that, when invoked, passes the wrapped handler to - * the io_context object's dispatch function. Given a function object with the - * signature: - * @code R f(A1 a1, ... An an); @endcode - * If this function object is passed to the wrap function like so: - * @code io_context.wrap(f); @endcode - * then the return value is a function object with the signature - * @code void g(A1 a1, ... An an); @endcode - * that, when invoked, executes code equivalent to: - * @code io_context.dispatch(boost::bind(f, a1, ... an)); @endcode - */ - template -#if defined(GENERATING_DOCUMENTATION) - unspecified -#else - detail::wrapped_handler -#endif - wrap(Handler handler); -#endif // !defined(ASIO_NO_DEPRECATED) - -private: - // Helper function to add the implementation. - ASIO_DECL impl_type& add_impl(impl_type* impl); - - // Backwards compatible overload for use with services derived from - // io_context::service. - template - friend Service& use_service(io_context& ioc); - -#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) - detail::winsock_init<> init_; -#elif defined(__sun) || defined(__QNX__) || defined(__hpux) || defined(_AIX) \ - || defined(__osf__) - detail::signal_init<> init_; -#endif - - // The implementation. - impl_type& impl_; -}; - -/// Executor used to submit functions to an io_context. -class io_context::executor_type -{ -public: - /// Obtain the underlying execution context. - io_context& context() const ASIO_NOEXCEPT; - - /// Inform the io_context that it has some outstanding work to do. - /** - * This function is used to inform the io_context that some work has begun. - * This ensures that the io_context's run() and run_one() functions do not - * exit while the work is underway. - */ - void on_work_started() const ASIO_NOEXCEPT; - - /// Inform the io_context that some work is no longer outstanding. - /** - * This function is used to inform the io_context that some work has - * finished. Once the count of unfinished work reaches zero, the io_context - * is stopped and the run() and run_one() functions may exit. - */ - void on_work_finished() const ASIO_NOEXCEPT; - - /// Request the io_context to invoke the given function object. - /** - * This function is used to ask the io_context to execute the given function - * object. If the current thread is running the io_context, @c dispatch() - * executes the function before returning. Otherwise, the function will be - * scheduled to run on the io_context. - * - * @param f The function object to be called. The executor will make a copy - * of the handler object as required. The function signature of the function - * object must be: @code void function(); @endcode - * - * @param a An allocator that may be used by the executor to allocate the - * internal storage needed for function invocation. - */ - template - void dispatch(ASIO_MOVE_ARG(Function) f, const Allocator& a) const; - - /// Request the io_context to invoke the given function object. - /** - * This function is used to ask the io_context to execute the given function - * object. The function object will never be executed inside @c post(). - * Instead, it will be scheduled to run on the io_context. - * - * @param f The function object to be called. The executor will make a copy - * of the handler object as required. The function signature of the function - * object must be: @code void function(); @endcode - * - * @param a An allocator that may be used by the executor to allocate the - * internal storage needed for function invocation. - */ - template - void post(ASIO_MOVE_ARG(Function) f, const Allocator& a) const; - - /// Request the io_context to invoke the given function object. - /** - * This function is used to ask the io_context to execute the given function - * object. The function object will never be executed inside @c defer(). - * Instead, it will be scheduled to run on the io_context. - * - * If the current thread belongs to the io_context, @c defer() will delay - * scheduling the function object until the current thread returns control to - * the pool. - * - * @param f The function object to be called. The executor will make a copy - * of the handler object as required. The function signature of the function - * object must be: @code void function(); @endcode - * - * @param a An allocator that may be used by the executor to allocate the - * internal storage needed for function invocation. - */ - template - void defer(ASIO_MOVE_ARG(Function) f, const Allocator& a) const; - - /// Determine whether the io_context is running in the current thread. - /** - * @return @c true if the current thread is running the io_context. Otherwise - * returns @c false. - */ - bool running_in_this_thread() const ASIO_NOEXCEPT; - - /// Compare two executors for equality. - /** - * Two executors are equal if they refer to the same underlying io_context. - */ - friend bool operator==(const executor_type& a, - const executor_type& b) ASIO_NOEXCEPT - { - return &a.io_context_ == &b.io_context_; - } - - /// Compare two executors for inequality. - /** - * Two executors are equal if they refer to the same underlying io_context. - */ - friend bool operator!=(const executor_type& a, - const executor_type& b) ASIO_NOEXCEPT - { - return &a.io_context_ != &b.io_context_; - } - -private: - friend class io_context; - - // Constructor. - explicit executor_type(io_context& i) : io_context_(i) {} - - // The underlying io_context. - io_context& io_context_; -}; - -#if !defined(ASIO_NO_DEPRECATED) -/// (Deprecated: Use executor_work_guard.) Class to inform the io_context when -/// it has work to do. -/** - * The work class is used to inform the io_context when work starts and - * finishes. This ensures that the io_context object's run() function will not - * exit while work is underway, and that it does exit when there is no - * unfinished work remaining. - * - * The work class is copy-constructible so that it may be used as a data member - * in a handler class. It is not assignable. - */ -class io_context::work -{ -public: - /// Constructor notifies the io_context that work is starting. - /** - * The constructor is used to inform the io_context that some work has begun. - * This ensures that the io_context object's run() function will not exit - * while the work is underway. - */ - explicit work(asio::io_context& io_context); - - /// Copy constructor notifies the io_context that work is starting. - /** - * The constructor is used to inform the io_context that some work has begun. - * This ensures that the io_context object's run() function will not exit - * while the work is underway. - */ - work(const work& other); - - /// Destructor notifies the io_context that the work is complete. - /** - * The destructor is used to inform the io_context that some work has - * finished. Once the count of unfinished work reaches zero, the io_context - * object's run() function is permitted to exit. - */ - ~work(); - - /// Get the io_context associated with the work. - asio::io_context& get_io_context(); - - /// (Deprecated: Use get_io_context().) Get the io_context associated with the - /// work. - asio::io_context& get_io_service(); - -private: - // Prevent assignment. - void operator=(const work& other); - - // The io_context implementation. - detail::io_context_impl& io_context_impl_; -}; -#endif // !defined(ASIO_NO_DEPRECATED) - -/// Base class for all io_context services. -class io_context::service - : public execution_context::service -{ -public: - /// Get the io_context object that owns the service. - asio::io_context& get_io_context(); - -#if !defined(ASIO_NO_DEPRECATED) - /// Get the io_context object that owns the service. - asio::io_context& get_io_service(); -#endif // !defined(ASIO_NO_DEPRECATED) - -private: - /// Destroy all user-defined handler objects owned by the service. - ASIO_DECL virtual void shutdown(); - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use shutdown().) Destroy all user-defined handler objects - /// owned by the service. - ASIO_DECL virtual void shutdown_service(); -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Handle notification of a fork-related event to perform any necessary - /// housekeeping. - /** - * This function is not a pure virtual so that services only have to - * implement it if necessary. The default implementation does nothing. - */ - ASIO_DECL virtual void notify_fork( - execution_context::fork_event event); - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use notify_fork().) Handle notification of a fork-related - /// event to perform any necessary housekeeping. - /** - * This function is not a pure virtual so that services only have to - * implement it if necessary. The default implementation does nothing. - */ - ASIO_DECL virtual void fork_service( - execution_context::fork_event event); -#endif // !defined(ASIO_NO_DEPRECATED) - -protected: - /// Constructor. - /** - * @param owner The io_context object that owns the service. - */ - ASIO_DECL service(asio::io_context& owner); - - /// Destructor. - ASIO_DECL virtual ~service(); -}; - -namespace detail { - -// Special service base class to keep classes header-file only. -template -class service_base - : public asio::io_context::service -{ -public: - static asio::detail::service_id id; - - // Constructor. - service_base(asio::io_context& io_context) - : asio::io_context::service(io_context) - { - } -}; - -template -asio::detail::service_id service_base::id; - -} // namespace detail -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/impl/io_context.hpp" -#if defined(ASIO_HEADER_ONLY) -# include "asio/impl/io_context.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -// If both io_context.hpp and strand.hpp have been included, automatically -// include the header file needed for the io_context::strand class. -#if !defined(ASIO_NO_EXTENSIONS) -# if defined(ASIO_STRAND_HPP) -# include "asio/io_context_strand.hpp" -# endif // defined(ASIO_STRAND_HPP) -#endif // !defined(ASIO_NO_EXTENSIONS) - -#endif // ASIO_IO_CONTEXT_HPP diff --git a/tools/sdk/include/asio/asio/io_context_strand.hpp b/tools/sdk/include/asio/asio/io_context_strand.hpp deleted file mode 100644 index 3c596f125ea..00000000000 --- a/tools/sdk/include/asio/asio/io_context_strand.hpp +++ /dev/null @@ -1,384 +0,0 @@ -// -// io_context_strand.hpp -// ~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IO_CONTEXT_STRAND_HPP -#define ASIO_IO_CONTEXT_STRAND_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_NO_EXTENSIONS) - -#include "asio/async_result.hpp" -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/strand_service.hpp" -#include "asio/detail/wrapped_handler.hpp" -#include "asio/io_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Provides serialised handler execution. -/** - * The io_context::strand class provides the ability to post and dispatch - * handlers with the guarantee that none of those handlers will execute - * concurrently. - * - * @par Order of handler invocation - * Given: - * - * @li a strand object @c s - * - * @li an object @c a meeting completion handler requirements - * - * @li an object @c a1 which is an arbitrary copy of @c a made by the - * implementation - * - * @li an object @c b meeting completion handler requirements - * - * @li an object @c b1 which is an arbitrary copy of @c b made by the - * implementation - * - * if any of the following conditions are true: - * - * @li @c s.post(a) happens-before @c s.post(b) - * - * @li @c s.post(a) happens-before @c s.dispatch(b), where the latter is - * performed outside the strand - * - * @li @c s.dispatch(a) happens-before @c s.post(b), where the former is - * performed outside the strand - * - * @li @c s.dispatch(a) happens-before @c s.dispatch(b), where both are - * performed outside the strand - * - * then @c asio_handler_invoke(a1, &a1) happens-before - * @c asio_handler_invoke(b1, &b1). - * - * Note that in the following case: - * @code async_op_1(..., s.wrap(a)); - * async_op_2(..., s.wrap(b)); @endcode - * the completion of the first async operation will perform @c s.dispatch(a), - * and the second will perform @c s.dispatch(b), but the order in which those - * are performed is unspecified. That is, you cannot state whether one - * happens-before the other. Therefore none of the above conditions are met and - * no ordering guarantee is made. - * - * @note The implementation makes no guarantee that handlers posted or - * dispatched through different @c strand objects will be invoked concurrently. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Safe. - * - * @par Concepts: - * Dispatcher. - */ -class io_context::strand -{ -public: - /// Constructor. - /** - * Constructs the strand. - * - * @param io_context The io_context object that the strand will use to - * dispatch handlers that are ready to be run. - */ - explicit strand(asio::io_context& io_context) - : service_(asio::use_service< - asio::detail::strand_service>(io_context)) - { - service_.construct(impl_); - } - - /// Destructor. - /** - * Destroys a strand. - * - * Handlers posted through the strand that have not yet been invoked will - * still be dispatched in a way that meets the guarantee of non-concurrency. - */ - ~strand() - { - } - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use context().) Get the io_context associated with the - /// strand. - /** - * This function may be used to obtain the io_context object that the strand - * uses to dispatch handlers for asynchronous operations. - * - * @return A reference to the io_context object that the strand will use to - * dispatch handlers. Ownership is not transferred to the caller. - */ - asio::io_context& get_io_context() - { - return service_.get_io_context(); - } - - /// (Deprecated: Use context().) Get the io_context associated with the - /// strand. - /** - * This function may be used to obtain the io_context object that the strand - * uses to dispatch handlers for asynchronous operations. - * - * @return A reference to the io_context object that the strand will use to - * dispatch handlers. Ownership is not transferred to the caller. - */ - asio::io_context& get_io_service() - { - return service_.get_io_context(); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Obtain the underlying execution context. - asio::io_context& context() const ASIO_NOEXCEPT - { - return service_.get_io_context(); - } - - /// Inform the strand that it has some outstanding work to do. - /** - * The strand delegates this call to its underlying io_context. - */ - void on_work_started() const ASIO_NOEXCEPT - { - context().get_executor().on_work_started(); - } - - /// Inform the strand that some work is no longer outstanding. - /** - * The strand delegates this call to its underlying io_context. - */ - void on_work_finished() const ASIO_NOEXCEPT - { - context().get_executor().on_work_finished(); - } - - /// Request the strand to invoke the given function object. - /** - * This function is used to ask the strand to execute the given function - * object on its underlying io_context. The function object will be executed - * inside this function if the strand is not otherwise busy and if the - * underlying io_context's executor's @c dispatch() function is also able to - * execute the function before returning. - * - * @param f The function object to be called. The executor will make - * a copy of the handler object as required. The function signature of the - * function object must be: @code void function(); @endcode - * - * @param a An allocator that may be used by the executor to allocate the - * internal storage needed for function invocation. - */ - template - void dispatch(ASIO_MOVE_ARG(Function) f, const Allocator& a) const - { - typename decay::type tmp(ASIO_MOVE_CAST(Function)(f)); - service_.dispatch(impl_, tmp); - (void)a; - } - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use asio::dispatch().) Request the strand to invoke - /// the given handler. - /** - * This function is used to ask the strand to execute the given handler. - * - * The strand object guarantees that handlers posted or dispatched through - * the strand will not be executed concurrently. The handler may be executed - * inside this function if the guarantee can be met. If this function is - * called from within a handler that was posted or dispatched through the same - * strand, then the new handler will be executed immediately. - * - * The strand's guarantee is in addition to the guarantee provided by the - * underlying io_context. The io_context guarantees that the handler will only - * be called in a thread in which the io_context's run member function is - * currently being invoked. - * - * @param handler The handler to be called. The strand will make a copy of the - * handler object as required. The function signature of the handler must be: - * @code void handler(); @endcode - */ - template - ASIO_INITFN_RESULT_TYPE(LegacyCompletionHandler, void ()) - dispatch(ASIO_MOVE_ARG(LegacyCompletionHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a LegacyCompletionHandler. - ASIO_LEGACY_COMPLETION_HANDLER_CHECK( - LegacyCompletionHandler, handler) type_check; - - async_completion init(handler); - - service_.dispatch(impl_, init.completion_handler); - - return init.result.get(); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Request the strand to invoke the given function object. - /** - * This function is used to ask the executor to execute the given function - * object. The function object will never be executed inside this function. - * Instead, it will be scheduled to run by the underlying io_context. - * - * @param f The function object to be called. The executor will make - * a copy of the handler object as required. The function signature of the - * function object must be: @code void function(); @endcode - * - * @param a An allocator that may be used by the executor to allocate the - * internal storage needed for function invocation. - */ - template - void post(ASIO_MOVE_ARG(Function) f, const Allocator& a) const - { - typename decay::type tmp(ASIO_MOVE_CAST(Function)(f)); - service_.post(impl_, tmp); - (void)a; - } - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use asio::post().) Request the strand to invoke the - /// given handler and return immediately. - /** - * This function is used to ask the strand to execute the given handler, but - * without allowing the strand to call the handler from inside this function. - * - * The strand object guarantees that handlers posted or dispatched through - * the strand will not be executed concurrently. The strand's guarantee is in - * addition to the guarantee provided by the underlying io_context. The - * io_context guarantees that the handler will only be called in a thread in - * which the io_context's run member function is currently being invoked. - * - * @param handler The handler to be called. The strand will make a copy of the - * handler object as required. The function signature of the handler must be: - * @code void handler(); @endcode - */ - template - ASIO_INITFN_RESULT_TYPE(LegacyCompletionHandler, void ()) - post(ASIO_MOVE_ARG(LegacyCompletionHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a LegacyCompletionHandler. - ASIO_LEGACY_COMPLETION_HANDLER_CHECK( - LegacyCompletionHandler, handler) type_check; - - async_completion init(handler); - - service_.post(impl_, init.completion_handler); - - return init.result.get(); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Request the strand to invoke the given function object. - /** - * This function is used to ask the executor to execute the given function - * object. The function object will never be executed inside this function. - * Instead, it will be scheduled to run by the underlying io_context. - * - * @param f The function object to be called. The executor will make - * a copy of the handler object as required. The function signature of the - * function object must be: @code void function(); @endcode - * - * @param a An allocator that may be used by the executor to allocate the - * internal storage needed for function invocation. - */ - template - void defer(ASIO_MOVE_ARG(Function) f, const Allocator& a) const - { - typename decay::type tmp(ASIO_MOVE_CAST(Function)(f)); - service_.post(impl_, tmp); - (void)a; - } - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use asio::bind_executor().) Create a new handler that - /// automatically dispatches the wrapped handler on the strand. - /** - * This function is used to create a new handler function object that, when - * invoked, will automatically pass the wrapped handler to the strand's - * dispatch function. - * - * @param handler The handler to be wrapped. The strand will make a copy of - * the handler object as required. The function signature of the handler must - * be: @code void handler(A1 a1, ... An an); @endcode - * - * @return A function object that, when invoked, passes the wrapped handler to - * the strand's dispatch function. Given a function object with the signature: - * @code R f(A1 a1, ... An an); @endcode - * If this function object is passed to the wrap function like so: - * @code strand.wrap(f); @endcode - * then the return value is a function object with the signature - * @code void g(A1 a1, ... An an); @endcode - * that, when invoked, executes code equivalent to: - * @code strand.dispatch(boost::bind(f, a1, ... an)); @endcode - */ - template -#if defined(GENERATING_DOCUMENTATION) - unspecified -#else - detail::wrapped_handler -#endif - wrap(Handler handler) - { - return detail::wrapped_handler(*this, handler); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Determine whether the strand is running in the current thread. - /** - * @return @c true if the current thread is executing a handler that was - * submitted to the strand using post(), dispatch() or wrap(). Otherwise - * returns @c false. - */ - bool running_in_this_thread() const ASIO_NOEXCEPT - { - return service_.running_in_this_thread(impl_); - } - - /// Compare two strands for equality. - /** - * Two strands are equal if they refer to the same ordered, non-concurrent - * state. - */ - friend bool operator==(const strand& a, const strand& b) ASIO_NOEXCEPT - { - return a.impl_ == b.impl_; - } - - /// Compare two strands for inequality. - /** - * Two strands are equal if they refer to the same ordered, non-concurrent - * state. - */ - friend bool operator!=(const strand& a, const strand& b) ASIO_NOEXCEPT - { - return a.impl_ != b.impl_; - } - -private: - asio::detail::strand_service& service_; - mutable asio::detail::strand_service::implementation_type impl_; -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // !defined(ASIO_NO_EXTENSIONS) - -#endif // ASIO_IO_CONTEXT_STRAND_HPP diff --git a/tools/sdk/include/asio/asio/io_service.hpp b/tools/sdk/include/asio/asio/io_service.hpp deleted file mode 100644 index ed05c834101..00000000000 --- a/tools/sdk/include/asio/asio/io_service.hpp +++ /dev/null @@ -1,33 +0,0 @@ -// -// io_service.hpp -// ~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IO_SERVICE_HPP -#define ASIO_IO_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/io_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -#if !defined(ASIO_NO_DEPRECATED) -/// Typedef for backwards compatibility. -typedef io_context io_service; -#endif // !defined(ASIO_NO_DEPRECATED) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IO_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/io_service_strand.hpp b/tools/sdk/include/asio/asio/io_service_strand.hpp deleted file mode 100644 index 7093f0e9074..00000000000 --- a/tools/sdk/include/asio/asio/io_service_strand.hpp +++ /dev/null @@ -1,20 +0,0 @@ -// -// io_service_strand.hpp -// ~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IO_SERVICE_STRAND_HPP -#define ASIO_IO_SERVICE_STRAND_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/io_context_strand.hpp" - -#endif // ASIO_IO_SERVICE_STRAND_HPP diff --git a/tools/sdk/include/asio/asio/ip/address.hpp b/tools/sdk/include/asio/asio/ip/address.hpp deleted file mode 100644 index cf852a6d619..00000000000 --- a/tools/sdk/include/asio/asio/ip/address.hpp +++ /dev/null @@ -1,260 +0,0 @@ -// -// ip/address.hpp -// ~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_ADDRESS_HPP -#define ASIO_IP_ADDRESS_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/detail/throw_exception.hpp" -#include "asio/detail/string_view.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/error_code.hpp" -#include "asio/ip/address_v4.hpp" -#include "asio/ip/address_v6.hpp" -#include "asio/ip/bad_address_cast.hpp" - -#if !defined(ASIO_NO_IOSTREAM) -# include -#endif // !defined(ASIO_NO_IOSTREAM) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -/// Implements version-independent IP addresses. -/** - * The asio::ip::address class provides the ability to use either IP - * version 4 or version 6 addresses. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -class address -{ -public: - /// Default constructor. - ASIO_DECL address(); - - /// Construct an address from an IPv4 address. - ASIO_DECL address(const asio::ip::address_v4& ipv4_address); - - /// Construct an address from an IPv6 address. - ASIO_DECL address(const asio::ip::address_v6& ipv6_address); - - /// Copy constructor. - ASIO_DECL address(const address& other); - -#if defined(ASIO_HAS_MOVE) - /// Move constructor. - ASIO_DECL address(address&& other); -#endif // defined(ASIO_HAS_MOVE) - - /// Assign from another address. - ASIO_DECL address& operator=(const address& other); - -#if defined(ASIO_HAS_MOVE) - /// Move-assign from another address. - ASIO_DECL address& operator=(address&& other); -#endif // defined(ASIO_HAS_MOVE) - - /// Assign from an IPv4 address. - ASIO_DECL address& operator=( - const asio::ip::address_v4& ipv4_address); - - /// Assign from an IPv6 address. - ASIO_DECL address& operator=( - const asio::ip::address_v6& ipv6_address); - - /// Get whether the address is an IP version 4 address. - bool is_v4() const - { - return type_ == ipv4; - } - - /// Get whether the address is an IP version 6 address. - bool is_v6() const - { - return type_ == ipv6; - } - - /// Get the address as an IP version 4 address. - ASIO_DECL asio::ip::address_v4 to_v4() const; - - /// Get the address as an IP version 6 address. - ASIO_DECL asio::ip::address_v6 to_v6() const; - - /// Get the address as a string. - ASIO_DECL std::string to_string() const; - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use other overload.) Get the address as a string. - ASIO_DECL std::string to_string(asio::error_code& ec) const; - - /// (Deprecated: Use make_address().) Create an address from an IPv4 address - /// string in dotted decimal form, or from an IPv6 address in hexadecimal - /// notation. - static address from_string(const char* str); - - /// (Deprecated: Use make_address().) Create an address from an IPv4 address - /// string in dotted decimal form, or from an IPv6 address in hexadecimal - /// notation. - static address from_string(const char* str, asio::error_code& ec); - - /// (Deprecated: Use make_address().) Create an address from an IPv4 address - /// string in dotted decimal form, or from an IPv6 address in hexadecimal - /// notation. - static address from_string(const std::string& str); - - /// (Deprecated: Use make_address().) Create an address from an IPv4 address - /// string in dotted decimal form, or from an IPv6 address in hexadecimal - /// notation. - static address from_string( - const std::string& str, asio::error_code& ec); -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Determine whether the address is a loopback address. - ASIO_DECL bool is_loopback() const; - - /// Determine whether the address is unspecified. - ASIO_DECL bool is_unspecified() const; - - /// Determine whether the address is a multicast address. - ASIO_DECL bool is_multicast() const; - - /// Compare two addresses for equality. - ASIO_DECL friend bool operator==(const address& a1, const address& a2); - - /// Compare two addresses for inequality. - friend bool operator!=(const address& a1, const address& a2) - { - return !(a1 == a2); - } - - /// Compare addresses for ordering. - ASIO_DECL friend bool operator<(const address& a1, const address& a2); - - /// Compare addresses for ordering. - friend bool operator>(const address& a1, const address& a2) - { - return a2 < a1; - } - - /// Compare addresses for ordering. - friend bool operator<=(const address& a1, const address& a2) - { - return !(a2 < a1); - } - - /// Compare addresses for ordering. - friend bool operator>=(const address& a1, const address& a2) - { - return !(a1 < a2); - } - -private: - // The type of the address. - enum { ipv4, ipv6 } type_; - - // The underlying IPv4 address. - asio::ip::address_v4 ipv4_address_; - - // The underlying IPv6 address. - asio::ip::address_v6 ipv6_address_; -}; - -/// Create an address from an IPv4 address string in dotted decimal form, -/// or from an IPv6 address in hexadecimal notation. -/** - * @relates address - */ -ASIO_DECL address make_address(const char* str); - -/// Create an address from an IPv4 address string in dotted decimal form, -/// or from an IPv6 address in hexadecimal notation. -/** - * @relates address - */ -ASIO_DECL address make_address( - const char* str, asio::error_code& ec); - -/// Create an address from an IPv4 address string in dotted decimal form, -/// or from an IPv6 address in hexadecimal notation. -/** - * @relates address - */ -ASIO_DECL address make_address(const std::string& str); - -/// Create an address from an IPv4 address string in dotted decimal form, -/// or from an IPv6 address in hexadecimal notation. -/** - * @relates address - */ -ASIO_DECL address make_address( - const std::string& str, asio::error_code& ec); - -#if defined(ASIO_HAS_STRING_VIEW) \ - || defined(GENERATING_DOCUMENTATION) - -/// Create an address from an IPv4 address string in dotted decimal form, -/// or from an IPv6 address in hexadecimal notation. -/** - * @relates address - */ -ASIO_DECL address make_address(string_view str); - -/// Create an address from an IPv4 address string in dotted decimal form, -/// or from an IPv6 address in hexadecimal notation. -/** - * @relates address - */ -ASIO_DECL address make_address( - string_view str, asio::error_code& ec); - -#endif // defined(ASIO_HAS_STRING_VIEW) - // || defined(GENERATING_DOCUMENTATION) - -#if !defined(ASIO_NO_IOSTREAM) - -/// Output an address as a string. -/** - * Used to output a human-readable string for a specified address. - * - * @param os The output stream to which the string will be written. - * - * @param addr The address to be written. - * - * @return The output stream. - * - * @relates asio::ip::address - */ -template -std::basic_ostream& operator<<( - std::basic_ostream& os, const address& addr); - -#endif // !defined(ASIO_NO_IOSTREAM) - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/ip/impl/address.hpp" -#if defined(ASIO_HEADER_ONLY) -# include "asio/ip/impl/address.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_IP_ADDRESS_HPP diff --git a/tools/sdk/include/asio/asio/ip/address_v4.hpp b/tools/sdk/include/asio/asio/ip/address_v4.hpp deleted file mode 100644 index 4e1cc9a3348..00000000000 --- a/tools/sdk/include/asio/asio/ip/address_v4.hpp +++ /dev/null @@ -1,329 +0,0 @@ -// -// ip/address_v4.hpp -// ~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_ADDRESS_V4_HPP -#define ASIO_IP_ADDRESS_V4_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/detail/array.hpp" -#include "asio/detail/cstdint.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/detail/string_view.hpp" -#include "asio/detail/winsock_init.hpp" -#include "asio/error_code.hpp" - -#if !defined(ASIO_NO_IOSTREAM) -# include -#endif // !defined(ASIO_NO_IOSTREAM) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -/// Implements IP version 4 style addresses. -/** - * The asio::ip::address_v4 class provides the ability to use and - * manipulate IP version 4 addresses. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -class address_v4 -{ -public: - /// The type used to represent an address as an unsigned integer. - typedef uint_least32_t uint_type; - - /// The type used to represent an address as an array of bytes. - /** - * @note This type is defined in terms of the C++0x template @c std::array - * when it is available. Otherwise, it uses @c boost:array. - */ -#if defined(GENERATING_DOCUMENTATION) - typedef array bytes_type; -#else - typedef asio::detail::array bytes_type; -#endif - - /// Default constructor. - address_v4() - { - addr_.s_addr = 0; - } - - /// Construct an address from raw bytes. - ASIO_DECL explicit address_v4(const bytes_type& bytes); - - /// Construct an address from an unsigned integer in host byte order. - ASIO_DECL explicit address_v4(uint_type addr); - - /// Copy constructor. - address_v4(const address_v4& other) - : addr_(other.addr_) - { - } - -#if defined(ASIO_HAS_MOVE) - /// Move constructor. - address_v4(address_v4&& other) - : addr_(other.addr_) - { - } -#endif // defined(ASIO_HAS_MOVE) - - /// Assign from another address. - address_v4& operator=(const address_v4& other) - { - addr_ = other.addr_; - return *this; - } - -#if defined(ASIO_HAS_MOVE) - /// Move-assign from another address. - address_v4& operator=(address_v4&& other) - { - addr_ = other.addr_; - return *this; - } -#endif // defined(ASIO_HAS_MOVE) - - /// Get the address in bytes, in network byte order. - ASIO_DECL bytes_type to_bytes() const; - - /// Get the address as an unsigned integer in host byte order - ASIO_DECL uint_type to_uint() const; - -#if !defined(ASIO_NO_DEPRECATED) - /// Get the address as an unsigned long in host byte order - ASIO_DECL unsigned long to_ulong() const; -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Get the address as a string in dotted decimal format. - ASIO_DECL std::string to_string() const; - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use other overload.) Get the address as a string in dotted - /// decimal format. - ASIO_DECL std::string to_string(asio::error_code& ec) const; - - /// (Deprecated: Use make_address_v4().) Create an address from an IP address - /// string in dotted decimal form. - static address_v4 from_string(const char* str); - - /// (Deprecated: Use make_address_v4().) Create an address from an IP address - /// string in dotted decimal form. - static address_v4 from_string( - const char* str, asio::error_code& ec); - - /// (Deprecated: Use make_address_v4().) Create an address from an IP address - /// string in dotted decimal form. - static address_v4 from_string(const std::string& str); - - /// (Deprecated: Use make_address_v4().) Create an address from an IP address - /// string in dotted decimal form. - static address_v4 from_string( - const std::string& str, asio::error_code& ec); -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Determine whether the address is a loopback address. - ASIO_DECL bool is_loopback() const; - - /// Determine whether the address is unspecified. - ASIO_DECL bool is_unspecified() const; - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use network_v4 class.) Determine whether the address is a - /// class A address. - ASIO_DECL bool is_class_a() const; - - /// (Deprecated: Use network_v4 class.) Determine whether the address is a - /// class B address. - ASIO_DECL bool is_class_b() const; - - /// (Deprecated: Use network_v4 class.) Determine whether the address is a - /// class C address. - ASIO_DECL bool is_class_c() const; -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Determine whether the address is a multicast address. - ASIO_DECL bool is_multicast() const; - - /// Compare two addresses for equality. - friend bool operator==(const address_v4& a1, const address_v4& a2) - { - return a1.addr_.s_addr == a2.addr_.s_addr; - } - - /// Compare two addresses for inequality. - friend bool operator!=(const address_v4& a1, const address_v4& a2) - { - return a1.addr_.s_addr != a2.addr_.s_addr; - } - - /// Compare addresses for ordering. - friend bool operator<(const address_v4& a1, const address_v4& a2) - { - return a1.to_uint() < a2.to_uint(); - } - - /// Compare addresses for ordering. - friend bool operator>(const address_v4& a1, const address_v4& a2) - { - return a1.to_uint() > a2.to_uint(); - } - - /// Compare addresses for ordering. - friend bool operator<=(const address_v4& a1, const address_v4& a2) - { - return a1.to_uint() <= a2.to_uint(); - } - - /// Compare addresses for ordering. - friend bool operator>=(const address_v4& a1, const address_v4& a2) - { - return a1.to_uint() >= a2.to_uint(); - } - - /// Obtain an address object that represents any address. - static address_v4 any() - { - return address_v4(); - } - - /// Obtain an address object that represents the loopback address. - static address_v4 loopback() - { - return address_v4(0x7F000001); - } - - /// Obtain an address object that represents the broadcast address. - static address_v4 broadcast() - { - return address_v4(0xFFFFFFFF); - } - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use network_v4 class.) Obtain an address object that - /// represents the broadcast address that corresponds to the specified - /// address and netmask. - ASIO_DECL static address_v4 broadcast( - const address_v4& addr, const address_v4& mask); - - /// (Deprecated: Use network_v4 class.) Obtain the netmask that corresponds - /// to the address, based on its address class. - ASIO_DECL static address_v4 netmask(const address_v4& addr); -#endif // !defined(ASIO_NO_DEPRECATED) - -private: - // The underlying IPv4 address. - asio::detail::in4_addr_type addr_; -}; - -/// Create an IPv4 address from raw bytes in network order. -/** - * @relates address_v4 - */ -inline address_v4 make_address_v4(const address_v4::bytes_type& bytes) -{ - return address_v4(bytes); -} - -/// Create an IPv4 address from an unsigned integer in host byte order. -/** - * @relates address_v4 - */ -inline address_v4 make_address_v4(address_v4::uint_type addr) -{ - return address_v4(addr); -} - -/// Create an IPv4 address from an IP address string in dotted decimal form. -/** - * @relates address_v4 - */ -ASIO_DECL address_v4 make_address_v4(const char* str); - -/// Create an IPv4 address from an IP address string in dotted decimal form. -/** - * @relates address_v4 - */ -ASIO_DECL address_v4 make_address_v4( - const char* str, asio::error_code& ec); - -/// Create an IPv4 address from an IP address string in dotted decimal form. -/** - * @relates address_v4 - */ -ASIO_DECL address_v4 make_address_v4(const std::string& str); - -/// Create an IPv4 address from an IP address string in dotted decimal form. -/** - * @relates address_v4 - */ -ASIO_DECL address_v4 make_address_v4( - const std::string& str, asio::error_code& ec); - -#if defined(ASIO_HAS_STRING_VIEW) \ - || defined(GENERATING_DOCUMENTATION) - -/// Create an IPv4 address from an IP address string in dotted decimal form. -/** - * @relates address_v4 - */ -ASIO_DECL address_v4 make_address_v4(string_view str); - -/// Create an IPv4 address from an IP address string in dotted decimal form. -/** - * @relates address_v4 - */ -ASIO_DECL address_v4 make_address_v4( - string_view str, asio::error_code& ec); - -#endif // defined(ASIO_HAS_STRING_VIEW) - // || defined(GENERATING_DOCUMENTATION) - -#if !defined(ASIO_NO_IOSTREAM) - -/// Output an address as a string. -/** - * Used to output a human-readable string for a specified address. - * - * @param os The output stream to which the string will be written. - * - * @param addr The address to be written. - * - * @return The output stream. - * - * @relates asio::ip::address_v4 - */ -template -std::basic_ostream& operator<<( - std::basic_ostream& os, const address_v4& addr); - -#endif // !defined(ASIO_NO_IOSTREAM) - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/ip/impl/address_v4.hpp" -#if defined(ASIO_HEADER_ONLY) -# include "asio/ip/impl/address_v4.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_IP_ADDRESS_V4_HPP diff --git a/tools/sdk/include/asio/asio/ip/address_v4_iterator.hpp b/tools/sdk/include/asio/asio/ip/address_v4_iterator.hpp deleted file mode 100644 index e2ef3937e82..00000000000 --- a/tools/sdk/include/asio/asio/ip/address_v4_iterator.hpp +++ /dev/null @@ -1,162 +0,0 @@ -// -// ip/address_v4_iterator.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_ADDRESS_V4_ITERATOR_HPP -#define ASIO_IP_ADDRESS_V4_ITERATOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/ip/address_v4.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -template class basic_address_iterator; - -/// An input iterator that can be used for traversing IPv4 addresses. -/** - * In addition to satisfying the input iterator requirements, this iterator - * also supports decrement. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -template <> class basic_address_iterator -{ -public: - /// The type of the elements pointed to by the iterator. - typedef address_v4 value_type; - - /// Distance between two iterators. - typedef std::ptrdiff_t difference_type; - - /// The type of a pointer to an element pointed to by the iterator. - typedef const address_v4* pointer; - - /// The type of a reference to an element pointed to by the iterator. - typedef const address_v4& reference; - - /// Denotes that the iterator satisfies the input iterator requirements. - typedef std::input_iterator_tag iterator_category; - - /// Construct an iterator that points to the specified address. - basic_address_iterator(const address_v4& addr) ASIO_NOEXCEPT - : address_(addr) - { - } - - /// Copy constructor. - basic_address_iterator( - const basic_address_iterator& other) ASIO_NOEXCEPT - : address_(other.address_) - { - } - -#if defined(ASIO_HAS_MOVE) - /// Move constructor. - basic_address_iterator(basic_address_iterator&& other) ASIO_NOEXCEPT - : address_(ASIO_MOVE_CAST(address_v4)(other.address_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - /// Assignment operator. - basic_address_iterator& operator=( - const basic_address_iterator& other) ASIO_NOEXCEPT - { - address_ = other.address_; - return *this; - } - -#if defined(ASIO_HAS_MOVE) - /// Move assignment operator. - basic_address_iterator& operator=( - basic_address_iterator&& other) ASIO_NOEXCEPT - { - address_ = ASIO_MOVE_CAST(address_v4)(other.address_); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) - - /// Dereference the iterator. - const address_v4& operator*() const ASIO_NOEXCEPT - { - return address_; - } - - /// Dereference the iterator. - const address_v4* operator->() const ASIO_NOEXCEPT - { - return &address_; - } - - /// Pre-increment operator. - basic_address_iterator& operator++() ASIO_NOEXCEPT - { - address_ = address_v4((address_.to_uint() + 1) & 0xFFFFFFFF); - return *this; - } - - /// Post-increment operator. - basic_address_iterator operator++(int) ASIO_NOEXCEPT - { - basic_address_iterator tmp(*this); - ++*this; - return tmp; - } - - /// Pre-decrement operator. - basic_address_iterator& operator--() ASIO_NOEXCEPT - { - address_ = address_v4((address_.to_uint() - 1) & 0xFFFFFFFF); - return *this; - } - - /// Post-decrement operator. - basic_address_iterator operator--(int) - { - basic_address_iterator tmp(*this); - --*this; - return tmp; - } - - /// Compare two addresses for equality. - friend bool operator==(const basic_address_iterator& a, - const basic_address_iterator& b) - { - return a.address_ == b.address_; - } - - /// Compare two addresses for inequality. - friend bool operator!=(const basic_address_iterator& a, - const basic_address_iterator& b) - { - return a.address_ != b.address_; - } - -private: - address_v4 address_; -}; - -/// An input iterator that can be used for traversing IPv4 addresses. -typedef basic_address_iterator address_v4_iterator; - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IP_ADDRESS_V4_ITERATOR_HPP diff --git a/tools/sdk/include/asio/asio/ip/address_v4_range.hpp b/tools/sdk/include/asio/asio/ip/address_v4_range.hpp deleted file mode 100644 index a402842080b..00000000000 --- a/tools/sdk/include/asio/asio/ip/address_v4_range.hpp +++ /dev/null @@ -1,134 +0,0 @@ -// -// ip/address_v4_range.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_ADDRESS_V4_RANGE_HPP -#define ASIO_IP_ADDRESS_V4_RANGE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/ip/address_v4_iterator.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -template class basic_address_range; - -/// Represents a range of IPv4 addresses. -/** - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -template <> class basic_address_range -{ -public: - /// The type of an iterator that points into the range. - typedef basic_address_iterator iterator; - - /// Construct an empty range. - basic_address_range() ASIO_NOEXCEPT - : begin_(address_v4()), - end_(address_v4()) - { - } - - /// Construct an range that represents the given range of addresses. - explicit basic_address_range(const iterator& first, - const iterator& last) ASIO_NOEXCEPT - : begin_(first), - end_(last) - { - } - - /// Copy constructor. - basic_address_range(const basic_address_range& other) ASIO_NOEXCEPT - : begin_(other.begin_), - end_(other.end_) - { - } - -#if defined(ASIO_HAS_MOVE) - /// Move constructor. - basic_address_range(basic_address_range&& other) ASIO_NOEXCEPT - : begin_(ASIO_MOVE_CAST(iterator)(other.begin_)), - end_(ASIO_MOVE_CAST(iterator)(other.end_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - /// Assignment operator. - basic_address_range& operator=( - const basic_address_range& other) ASIO_NOEXCEPT - { - begin_ = other.begin_; - end_ = other.end_; - return *this; - } - -#if defined(ASIO_HAS_MOVE) - /// Move assignment operator. - basic_address_range& operator=( - basic_address_range&& other) ASIO_NOEXCEPT - { - begin_ = ASIO_MOVE_CAST(iterator)(other.begin_); - end_ = ASIO_MOVE_CAST(iterator)(other.end_); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) - - /// Obtain an iterator that points to the start of the range. - iterator begin() const ASIO_NOEXCEPT - { - return begin_; - } - - /// Obtain an iterator that points to the end of the range. - iterator end() const ASIO_NOEXCEPT - { - return end_; - } - - /// Determine whether the range is empty. - bool empty() const ASIO_NOEXCEPT - { - return size() == 0; - } - - /// Return the size of the range. - std::size_t size() const ASIO_NOEXCEPT - { - return end_->to_uint() - begin_->to_uint(); - } - - /// Find an address in the range. - iterator find(const address_v4& addr) const ASIO_NOEXCEPT - { - return addr >= *begin_ && addr < *end_ ? iterator(addr) : end_; - } - -private: - iterator begin_; - iterator end_; -}; - -/// Represents a range of IPv4 addresses. -typedef basic_address_range address_v4_range; - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IP_ADDRESS_V4_RANGE_HPP diff --git a/tools/sdk/include/asio/asio/ip/address_v6.hpp b/tools/sdk/include/asio/asio/ip/address_v6.hpp deleted file mode 100644 index fece3329756..00000000000 --- a/tools/sdk/include/asio/asio/ip/address_v6.hpp +++ /dev/null @@ -1,336 +0,0 @@ -// -// ip/address_v6.hpp -// ~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_ADDRESS_V6_HPP -#define ASIO_IP_ADDRESS_V6_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/detail/array.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/detail/string_view.hpp" -#include "asio/detail/winsock_init.hpp" -#include "asio/error_code.hpp" -#include "asio/ip/address_v4.hpp" - -#if !defined(ASIO_NO_IOSTREAM) -# include -#endif // !defined(ASIO_NO_IOSTREAM) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -template class basic_address_iterator; - -/// Implements IP version 6 style addresses. -/** - * The asio::ip::address_v6 class provides the ability to use and - * manipulate IP version 6 addresses. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -class address_v6 -{ -public: - /// The type used to represent an address as an array of bytes. - /** - * @note This type is defined in terms of the C++0x template @c std::array - * when it is available. Otherwise, it uses @c boost:array. - */ -#if defined(GENERATING_DOCUMENTATION) - typedef array bytes_type; -#else - typedef asio::detail::array bytes_type; -#endif - - /// Default constructor. - ASIO_DECL address_v6(); - - /// Construct an address from raw bytes and scope ID. - ASIO_DECL explicit address_v6(const bytes_type& bytes, - unsigned long scope_id = 0); - - /// Copy constructor. - ASIO_DECL address_v6(const address_v6& other); - -#if defined(ASIO_HAS_MOVE) - /// Move constructor. - ASIO_DECL address_v6(address_v6&& other); -#endif // defined(ASIO_HAS_MOVE) - - /// Assign from another address. - ASIO_DECL address_v6& operator=(const address_v6& other); - -#if defined(ASIO_HAS_MOVE) - /// Move-assign from another address. - ASIO_DECL address_v6& operator=(address_v6&& other); -#endif // defined(ASIO_HAS_MOVE) - - /// The scope ID of the address. - /** - * Returns the scope ID associated with the IPv6 address. - */ - unsigned long scope_id() const - { - return scope_id_; - } - - /// The scope ID of the address. - /** - * Modifies the scope ID associated with the IPv6 address. - */ - void scope_id(unsigned long id) - { - scope_id_ = id; - } - - /// Get the address in bytes, in network byte order. - ASIO_DECL bytes_type to_bytes() const; - - /// Get the address as a string. - ASIO_DECL std::string to_string() const; - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use other overload.) Get the address as a string. - ASIO_DECL std::string to_string(asio::error_code& ec) const; - - /// (Deprecated: Use make_address_v6().) Create an IPv6 address from an IP - /// address string. - static address_v6 from_string(const char* str); - - /// (Deprecated: Use make_address_v6().) Create an IPv6 address from an IP - /// address string. - static address_v6 from_string( - const char* str, asio::error_code& ec); - - /// (Deprecated: Use make_address_v6().) Create an IPv6 address from an IP - /// address string. - static address_v6 from_string(const std::string& str); - - /// (Deprecated: Use make_address_v6().) Create an IPv6 address from an IP - /// address string. - static address_v6 from_string( - const std::string& str, asio::error_code& ec); - - /// (Deprecated: Use make_address_v4().) Converts an IPv4-mapped or - /// IPv4-compatible address to an IPv4 address. - ASIO_DECL address_v4 to_v4() const; -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Determine whether the address is a loopback address. - ASIO_DECL bool is_loopback() const; - - /// Determine whether the address is unspecified. - ASIO_DECL bool is_unspecified() const; - - /// Determine whether the address is link local. - ASIO_DECL bool is_link_local() const; - - /// Determine whether the address is site local. - ASIO_DECL bool is_site_local() const; - - /// Determine whether the address is a mapped IPv4 address. - ASIO_DECL bool is_v4_mapped() const; - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: No replacement.) Determine whether the address is an - /// IPv4-compatible address. - ASIO_DECL bool is_v4_compatible() const; -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Determine whether the address is a multicast address. - ASIO_DECL bool is_multicast() const; - - /// Determine whether the address is a global multicast address. - ASIO_DECL bool is_multicast_global() const; - - /// Determine whether the address is a link-local multicast address. - ASIO_DECL bool is_multicast_link_local() const; - - /// Determine whether the address is a node-local multicast address. - ASIO_DECL bool is_multicast_node_local() const; - - /// Determine whether the address is a org-local multicast address. - ASIO_DECL bool is_multicast_org_local() const; - - /// Determine whether the address is a site-local multicast address. - ASIO_DECL bool is_multicast_site_local() const; - - /// Compare two addresses for equality. - ASIO_DECL friend bool operator==( - const address_v6& a1, const address_v6& a2); - - /// Compare two addresses for inequality. - friend bool operator!=(const address_v6& a1, const address_v6& a2) - { - return !(a1 == a2); - } - - /// Compare addresses for ordering. - ASIO_DECL friend bool operator<( - const address_v6& a1, const address_v6& a2); - - /// Compare addresses for ordering. - friend bool operator>(const address_v6& a1, const address_v6& a2) - { - return a2 < a1; - } - - /// Compare addresses for ordering. - friend bool operator<=(const address_v6& a1, const address_v6& a2) - { - return !(a2 < a1); - } - - /// Compare addresses for ordering. - friend bool operator>=(const address_v6& a1, const address_v6& a2) - { - return !(a1 < a2); - } - - /// Obtain an address object that represents any address. - static address_v6 any() - { - return address_v6(); - } - - /// Obtain an address object that represents the loopback address. - ASIO_DECL static address_v6 loopback(); - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use make_address_v6().) Create an IPv4-mapped IPv6 address. - ASIO_DECL static address_v6 v4_mapped(const address_v4& addr); - - /// (Deprecated: No replacement.) Create an IPv4-compatible IPv6 address. - ASIO_DECL static address_v6 v4_compatible(const address_v4& addr); -#endif // !defined(ASIO_NO_DEPRECATED) - -private: - friend class basic_address_iterator; - - // The underlying IPv6 address. - asio::detail::in6_addr_type addr_; - - // The scope ID associated with the address. - unsigned long scope_id_; -}; - -/// Create an IPv6 address from raw bytes and scope ID. -/** - * @relates address_v6 - */ -inline address_v6 make_address_v6(const address_v6::bytes_type& bytes, - unsigned long scope_id = 0) -{ - return address_v6(bytes, scope_id); -} - -/// Create an IPv6 address from an IP address string. -/** - * @relates address_v6 - */ -ASIO_DECL address_v6 make_address_v6(const char* str); - -/// Create an IPv6 address from an IP address string. -/** - * @relates address_v6 - */ -ASIO_DECL address_v6 make_address_v6( - const char* str, asio::error_code& ec); - -/// Createan IPv6 address from an IP address string. -/** - * @relates address_v6 - */ -ASIO_DECL address_v6 make_address_v6(const std::string& str); - -/// Create an IPv6 address from an IP address string. -/** - * @relates address_v6 - */ -ASIO_DECL address_v6 make_address_v6( - const std::string& str, asio::error_code& ec); - -#if defined(ASIO_HAS_STRING_VIEW) \ - || defined(GENERATING_DOCUMENTATION) - -/// Create an IPv6 address from an IP address string. -/** - * @relates address_v6 - */ -ASIO_DECL address_v6 make_address_v6(string_view str); - -/// Create an IPv6 address from an IP address string. -/** - * @relates address_v6 - */ -ASIO_DECL address_v6 make_address_v6( - string_view str, asio::error_code& ec); - -#endif // defined(ASIO_HAS_STRING_VIEW) - // || defined(GENERATING_DOCUMENTATION) - -/// Tag type used for distinguishing overloads that deal in IPv4-mapped IPv6 -/// addresses. -enum v4_mapped_t { v4_mapped }; - -/// Create an IPv4 address from a IPv4-mapped IPv6 address. -/** - * @relates address_v4 - */ -ASIO_DECL address_v4 make_address_v4( - v4_mapped_t, const address_v6& v6_addr); - -/// Create an IPv4-mapped IPv6 address from an IPv4 address. -/** - * @relates address_v6 - */ -ASIO_DECL address_v6 make_address_v6( - v4_mapped_t, const address_v4& v4_addr); - -#if !defined(ASIO_NO_IOSTREAM) - -/// Output an address as a string. -/** - * Used to output a human-readable string for a specified address. - * - * @param os The output stream to which the string will be written. - * - * @param addr The address to be written. - * - * @return The output stream. - * - * @relates asio::ip::address_v6 - */ -template -std::basic_ostream& operator<<( - std::basic_ostream& os, const address_v6& addr); - -#endif // !defined(ASIO_NO_IOSTREAM) - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/ip/impl/address_v6.hpp" -#if defined(ASIO_HEADER_ONLY) -# include "asio/ip/impl/address_v6.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_IP_ADDRESS_V6_HPP diff --git a/tools/sdk/include/asio/asio/ip/address_v6_iterator.hpp b/tools/sdk/include/asio/asio/ip/address_v6_iterator.hpp deleted file mode 100644 index 0a1fb3feabd..00000000000 --- a/tools/sdk/include/asio/asio/ip/address_v6_iterator.hpp +++ /dev/null @@ -1,183 +0,0 @@ -// -// ip/address_v6_iterator.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Oliver Kowalke (oliver dot kowalke at gmail dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_ADDRESS_V6_ITERATOR_HPP -#define ASIO_IP_ADDRESS_V6_ITERATOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/ip/address_v6.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -template class basic_address_iterator; - -/// An input iterator that can be used for traversing IPv6 addresses. -/** - * In addition to satisfying the input iterator requirements, this iterator - * also supports decrement. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -template <> class basic_address_iterator -{ -public: - /// The type of the elements pointed to by the iterator. - typedef address_v6 value_type; - - /// Distance between two iterators. - typedef std::ptrdiff_t difference_type; - - /// The type of a pointer to an element pointed to by the iterator. - typedef const address_v6* pointer; - - /// The type of a reference to an element pointed to by the iterator. - typedef const address_v6& reference; - - /// Denotes that the iterator satisfies the input iterator requirements. - typedef std::input_iterator_tag iterator_category; - - /// Construct an iterator that points to the specified address. - basic_address_iterator(const address_v6& addr) ASIO_NOEXCEPT - : address_(addr) - { - } - - /// Copy constructor. - basic_address_iterator( - const basic_address_iterator& other) ASIO_NOEXCEPT - : address_(other.address_) - { - } - -#if defined(ASIO_HAS_MOVE) - /// Move constructor. - basic_address_iterator(basic_address_iterator&& other) ASIO_NOEXCEPT - : address_(ASIO_MOVE_CAST(address_v6)(other.address_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - /// Assignment operator. - basic_address_iterator& operator=( - const basic_address_iterator& other) ASIO_NOEXCEPT - { - address_ = other.address_; - return *this; - } - -#if defined(ASIO_HAS_MOVE) - /// Move assignment operator. - basic_address_iterator& operator=( - basic_address_iterator&& other) ASIO_NOEXCEPT - { - address_ = ASIO_MOVE_CAST(address_v6)(other.address_); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) - - /// Dereference the iterator. - const address_v6& operator*() const ASIO_NOEXCEPT - { - return address_; - } - - /// Dereference the iterator. - const address_v6* operator->() const ASIO_NOEXCEPT - { - return &address_; - } - - /// Pre-increment operator. - basic_address_iterator& operator++() ASIO_NOEXCEPT - { - for (int i = 15; i >= 0; --i) - { - if (address_.addr_.s6_addr[i] < 0xFF) - { - ++address_.addr_.s6_addr[i]; - break; - } - - address_.addr_.s6_addr[i] = 0; - } - - return *this; - } - - /// Post-increment operator. - basic_address_iterator operator++(int) ASIO_NOEXCEPT - { - basic_address_iterator tmp(*this); - ++*this; - return tmp; - } - - /// Pre-decrement operator. - basic_address_iterator& operator--() ASIO_NOEXCEPT - { - for (int i = 15; i >= 0; --i) - { - if (address_.addr_.s6_addr[i] > 0) - { - --address_.addr_.s6_addr[i]; - break; - } - - address_.addr_.s6_addr[i] = 0xFF; - } - - return *this; - } - - /// Post-decrement operator. - basic_address_iterator operator--(int) - { - basic_address_iterator tmp(*this); - --*this; - return tmp; - } - - /// Compare two addresses for equality. - friend bool operator==(const basic_address_iterator& a, - const basic_address_iterator& b) - { - return a.address_ == b.address_; - } - - /// Compare two addresses for inequality. - friend bool operator!=(const basic_address_iterator& a, - const basic_address_iterator& b) - { - return a.address_ != b.address_; - } - -private: - address_v6 address_; -}; - -/// An input iterator that can be used for traversing IPv6 addresses. -typedef basic_address_iterator address_v6_iterator; - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IP_ADDRESS_V6_ITERATOR_HPP diff --git a/tools/sdk/include/asio/asio/ip/address_v6_range.hpp b/tools/sdk/include/asio/asio/ip/address_v6_range.hpp deleted file mode 100644 index 9d7062ef8eb..00000000000 --- a/tools/sdk/include/asio/asio/ip/address_v6_range.hpp +++ /dev/null @@ -1,129 +0,0 @@ -// -// ip/address_v6_range.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Oliver Kowalke (oliver dot kowalke at gmail dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_ADDRESS_V6_RANGE_HPP -#define ASIO_IP_ADDRESS_V6_RANGE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/ip/address_v6_iterator.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -template class basic_address_range; - -/// Represents a range of IPv6 addresses. -/** - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -template <> class basic_address_range -{ -public: - /// The type of an iterator that points into the range. - typedef basic_address_iterator iterator; - - /// Construct an empty range. - basic_address_range() ASIO_NOEXCEPT - : begin_(address_v6()), - end_(address_v6()) - { - } - - /// Construct an range that represents the given range of addresses. - explicit basic_address_range(const iterator& first, - const iterator& last) ASIO_NOEXCEPT - : begin_(first), - end_(last) - { - } - - /// Copy constructor. - basic_address_range(const basic_address_range& other) ASIO_NOEXCEPT - : begin_(other.begin_), - end_(other.end_) - { - } - -#if defined(ASIO_HAS_MOVE) - /// Move constructor. - basic_address_range(basic_address_range&& other) ASIO_NOEXCEPT - : begin_(ASIO_MOVE_CAST(iterator)(other.begin_)), - end_(ASIO_MOVE_CAST(iterator)(other.end_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - /// Assignment operator. - basic_address_range& operator=( - const basic_address_range& other) ASIO_NOEXCEPT - { - begin_ = other.begin_; - end_ = other.end_; - return *this; - } - -#if defined(ASIO_HAS_MOVE) - /// Move assignment operator. - basic_address_range& operator=( - basic_address_range&& other) ASIO_NOEXCEPT - { - begin_ = ASIO_MOVE_CAST(iterator)(other.begin_); - end_ = ASIO_MOVE_CAST(iterator)(other.end_); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) - - /// Obtain an iterator that points to the start of the range. - iterator begin() const ASIO_NOEXCEPT - { - return begin_; - } - - /// Obtain an iterator that points to the end of the range. - iterator end() const ASIO_NOEXCEPT - { - return end_; - } - - /// Determine whether the range is empty. - bool empty() const ASIO_NOEXCEPT - { - return begin_ == end_; - } - - /// Find an address in the range. - iterator find(const address_v6& addr) const ASIO_NOEXCEPT - { - return addr >= *begin_ && addr < *end_ ? iterator(addr) : end_; - } - -private: - iterator begin_; - iterator end_; -}; - -/// Represents a range of IPv6 addresses. -typedef basic_address_range address_v6_range; - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IP_ADDRESS_V6_RANGE_HPP diff --git a/tools/sdk/include/asio/asio/ip/bad_address_cast.hpp b/tools/sdk/include/asio/asio/ip/bad_address_cast.hpp deleted file mode 100644 index 8c71f704f83..00000000000 --- a/tools/sdk/include/asio/asio/ip/bad_address_cast.hpp +++ /dev/null @@ -1,48 +0,0 @@ -// -// ip/bad_address_cast.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_BAD_ADDRESS_CAST_HPP -#define ASIO_IP_BAD_ADDRESS_CAST_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -/// Thrown to indicate a failed address conversion. -class bad_address_cast : public std::bad_cast -{ -public: - /// Default constructor. - bad_address_cast() {} - - /// Destructor. - virtual ~bad_address_cast() ASIO_NOEXCEPT_OR_NOTHROW {} - - /// Get the message associated with the exception. - virtual const char* what() const ASIO_NOEXCEPT_OR_NOTHROW - { - return "bad address cast"; - } -}; - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IP_ADDRESS_HPP diff --git a/tools/sdk/include/asio/asio/ip/basic_endpoint.hpp b/tools/sdk/include/asio/asio/ip/basic_endpoint.hpp deleted file mode 100644 index 4418ee77636..00000000000 --- a/tools/sdk/include/asio/asio/ip/basic_endpoint.hpp +++ /dev/null @@ -1,263 +0,0 @@ -// -// ip/basic_endpoint.hpp -// ~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_BASIC_ENDPOINT_HPP -#define ASIO_IP_BASIC_ENDPOINT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/ip/address.hpp" -#include "asio/ip/detail/endpoint.hpp" - -#if !defined(ASIO_NO_IOSTREAM) -# include -#endif // !defined(ASIO_NO_IOSTREAM) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -/// Describes an endpoint for a version-independent IP socket. -/** - * The asio::ip::basic_endpoint class template describes an endpoint that - * may be associated with a particular socket. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - * - * @par Concepts: - * Endpoint. - */ -template -class basic_endpoint -{ -public: - /// The protocol type associated with the endpoint. - typedef InternetProtocol protocol_type; - - /// The type of the endpoint structure. This type is dependent on the - /// underlying implementation of the socket layer. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined data_type; -#else - typedef asio::detail::socket_addr_type data_type; -#endif - - /// Default constructor. - basic_endpoint() - : impl_() - { - } - - /// Construct an endpoint using a port number, specified in the host's byte - /// order. The IP address will be the any address (i.e. INADDR_ANY or - /// in6addr_any). This constructor would typically be used for accepting new - /// connections. - /** - * @par Examples - * To initialise an IPv4 TCP endpoint for port 1234, use: - * @code - * asio::ip::tcp::endpoint ep(asio::ip::tcp::v4(), 1234); - * @endcode - * - * To specify an IPv6 UDP endpoint for port 9876, use: - * @code - * asio::ip::udp::endpoint ep(asio::ip::udp::v6(), 9876); - * @endcode - */ - basic_endpoint(const InternetProtocol& internet_protocol, - unsigned short port_num) - : impl_(internet_protocol.family(), port_num) - { - } - - /// Construct an endpoint using a port number and an IP address. This - /// constructor may be used for accepting connections on a specific interface - /// or for making a connection to a remote endpoint. - basic_endpoint(const asio::ip::address& addr, unsigned short port_num) - : impl_(addr, port_num) - { - } - - /// Copy constructor. - basic_endpoint(const basic_endpoint& other) - : impl_(other.impl_) - { - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move constructor. - basic_endpoint(basic_endpoint&& other) - : impl_(other.impl_) - { - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Assign from another endpoint. - basic_endpoint& operator=(const basic_endpoint& other) - { - impl_ = other.impl_; - return *this; - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-assign from another endpoint. - basic_endpoint& operator=(basic_endpoint&& other) - { - impl_ = other.impl_; - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// The protocol associated with the endpoint. - protocol_type protocol() const - { - if (impl_.is_v4()) - return InternetProtocol::v4(); - return InternetProtocol::v6(); - } - - /// Get the underlying endpoint in the native type. - data_type* data() - { - return impl_.data(); - } - - /// Get the underlying endpoint in the native type. - const data_type* data() const - { - return impl_.data(); - } - - /// Get the underlying size of the endpoint in the native type. - std::size_t size() const - { - return impl_.size(); - } - - /// Set the underlying size of the endpoint in the native type. - void resize(std::size_t new_size) - { - impl_.resize(new_size); - } - - /// Get the capacity of the endpoint in the native type. - std::size_t capacity() const - { - return impl_.capacity(); - } - - /// Get the port associated with the endpoint. The port number is always in - /// the host's byte order. - unsigned short port() const - { - return impl_.port(); - } - - /// Set the port associated with the endpoint. The port number is always in - /// the host's byte order. - void port(unsigned short port_num) - { - impl_.port(port_num); - } - - /// Get the IP address associated with the endpoint. - asio::ip::address address() const - { - return impl_.address(); - } - - /// Set the IP address associated with the endpoint. - void address(const asio::ip::address& addr) - { - impl_.address(addr); - } - - /// Compare two endpoints for equality. - friend bool operator==(const basic_endpoint& e1, - const basic_endpoint& e2) - { - return e1.impl_ == e2.impl_; - } - - /// Compare two endpoints for inequality. - friend bool operator!=(const basic_endpoint& e1, - const basic_endpoint& e2) - { - return !(e1 == e2); - } - - /// Compare endpoints for ordering. - friend bool operator<(const basic_endpoint& e1, - const basic_endpoint& e2) - { - return e1.impl_ < e2.impl_; - } - - /// Compare endpoints for ordering. - friend bool operator>(const basic_endpoint& e1, - const basic_endpoint& e2) - { - return e2.impl_ < e1.impl_; - } - - /// Compare endpoints for ordering. - friend bool operator<=(const basic_endpoint& e1, - const basic_endpoint& e2) - { - return !(e2 < e1); - } - - /// Compare endpoints for ordering. - friend bool operator>=(const basic_endpoint& e1, - const basic_endpoint& e2) - { - return !(e1 < e2); - } - -private: - // The underlying IP endpoint. - asio::ip::detail::endpoint impl_; -}; - -#if !defined(ASIO_NO_IOSTREAM) - -/// Output an endpoint as a string. -/** - * Used to output a human-readable string for a specified endpoint. - * - * @param os The output stream to which the string will be written. - * - * @param endpoint The endpoint to be written. - * - * @return The output stream. - * - * @relates asio::ip::basic_endpoint - */ -template -std::basic_ostream& operator<<( - std::basic_ostream& os, - const basic_endpoint& endpoint); - -#endif // !defined(ASIO_NO_IOSTREAM) - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/ip/impl/basic_endpoint.hpp" - -#endif // ASIO_IP_BASIC_ENDPOINT_HPP diff --git a/tools/sdk/include/asio/asio/ip/basic_resolver.hpp b/tools/sdk/include/asio/asio/ip/basic_resolver.hpp deleted file mode 100644 index 812dbec541c..00000000000 --- a/tools/sdk/include/asio/asio/ip/basic_resolver.hpp +++ /dev/null @@ -1,1018 +0,0 @@ -// -// ip/basic_resolver.hpp -// ~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_BASIC_RESOLVER_HPP -#define ASIO_IP_BASIC_RESOLVER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/async_result.hpp" -#include "asio/basic_io_object.hpp" -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/string_view.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" -#include "asio/ip/basic_resolver_iterator.hpp" -#include "asio/ip/basic_resolver_query.hpp" -#include "asio/ip/basic_resolver_results.hpp" -#include "asio/ip/resolver_base.hpp" - -#if defined(ASIO_HAS_MOVE) -# include -#endif // defined(ASIO_HAS_MOVE) - -#if defined(ASIO_ENABLE_OLD_SERVICES) -# include "asio/ip/resolver_service.hpp" -#else // defined(ASIO_ENABLE_OLD_SERVICES) -# if defined(ASIO_WINDOWS_RUNTIME) -# include "asio/detail/winrt_resolver_service.hpp" -# define ASIO_SVC_T \ - asio::detail::winrt_resolver_service -# else -# include "asio/detail/resolver_service.hpp" -# define ASIO_SVC_T \ - asio::detail::resolver_service -# endif -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -/// Provides endpoint resolution functionality. -/** - * The basic_resolver class template provides the ability to resolve a query - * to a list of endpoints. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -template )> -class basic_resolver - : ASIO_SVC_ACCESS basic_io_object, - public resolver_base -{ -public: - /// The type of the executor associated with the object. - typedef io_context::executor_type executor_type; - - /// The protocol type. - typedef InternetProtocol protocol_type; - - /// The endpoint type. - typedef typename InternetProtocol::endpoint endpoint_type; - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated.) The query type. - typedef basic_resolver_query query; - - /// (Deprecated.) The iterator type. - typedef basic_resolver_iterator iterator; -#endif // !defined(ASIO_NO_DEPRECATED) - - /// The results type. - typedef basic_resolver_results results_type; - - /// Constructor. - /** - * This constructor creates a basic_resolver. - * - * @param io_context The io_context object that the resolver will use to - * dispatch handlers for any asynchronous operations performed on the - * resolver. - */ - explicit basic_resolver(asio::io_context& io_context) - : basic_io_object(io_context) - { - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a basic_resolver from another. - /** - * This constructor moves a resolver from one object to another. - * - * @param other The other basic_resolver object from which the move will - * occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_resolver(io_context&) constructor. - */ - basic_resolver(basic_resolver&& other) - : basic_io_object(std::move(other)) - { - } - - /// Move-assign a basic_resolver from another. - /** - * This assignment operator moves a resolver from one object to another. - * Cancels any outstanding asynchronous operations associated with the target - * object. - * - * @param other The other basic_resolver object from which the move will - * occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_resolver(io_context&) constructor. - */ - basic_resolver& operator=(basic_resolver&& other) - { - basic_io_object::operator=(std::move(other)); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destroys the resolver. - /** - * This function destroys the resolver, cancelling any outstanding - * asynchronous wait operations associated with the resolver as if by calling - * @c cancel. - */ - ~basic_resolver() - { - } - -#if defined(ASIO_ENABLE_OLD_SERVICES) - // These functions are provided by basic_io_object<>. -#else // defined(ASIO_ENABLE_OLD_SERVICES) -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - /** - * This function may be used to obtain the io_context object that the I/O - * object uses to dispatch handlers for asynchronous operations. - * - * @return A reference to the io_context object that the I/O object will use - * to dispatch handlers. Ownership is not transferred to the caller. - */ - asio::io_context& get_io_context() - { - return basic_io_object::get_io_context(); - } - - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - /** - * This function may be used to obtain the io_context object that the I/O - * object uses to dispatch handlers for asynchronous operations. - * - * @return A reference to the io_context object that the I/O object will use - * to dispatch handlers. Ownership is not transferred to the caller. - */ - asio::io_context& get_io_service() - { - return basic_io_object::get_io_service(); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Get the executor associated with the object. - executor_type get_executor() ASIO_NOEXCEPT - { - return basic_io_object::get_executor(); - } -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - - /// Cancel any asynchronous operations that are waiting on the resolver. - /** - * This function forces the completion of any pending asynchronous - * operations on the host resolver. The handler for each cancelled operation - * will be invoked with the asio::error::operation_aborted error code. - */ - void cancel() - { - return this->get_service().cancel(this->get_implementation()); - } - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated.) Perform forward resolution of a query to a list of entries. - /** - * This function is used to resolve a query into a list of endpoint entries. - * - * @param q A query object that determines what endpoints will be returned. - * - * @returns A range object representing the list of endpoint entries. A - * successful call to this function is guaranteed to return a non-empty - * range. - * - * @throws asio::system_error Thrown on failure. - */ - results_type resolve(const query& q) - { - asio::error_code ec; - results_type r = this->get_service().resolve( - this->get_implementation(), q, ec); - asio::detail::throw_error(ec, "resolve"); - return r; - } - - /// (Deprecated.) Perform forward resolution of a query to a list of entries. - /** - * This function is used to resolve a query into a list of endpoint entries. - * - * @param q A query object that determines what endpoints will be returned. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns A range object representing the list of endpoint entries. An - * empty range is returned if an error occurs. A successful call to this - * function is guaranteed to return a non-empty range. - */ - results_type resolve(const query& q, asio::error_code& ec) - { - return this->get_service().resolve(this->get_implementation(), q, ec); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Perform forward resolution of a query to a list of entries. - /** - * This function is used to resolve host and service names into a list of - * endpoint entries. - * - * @param host A string identifying a location. May be a descriptive name or - * a numeric address string. If an empty string and the passive flag has been - * specified, the resolved endpoints are suitable for local service binding. - * If an empty string and passive is not specified, the resolved endpoints - * will use the loopback address. - * - * @param service A string identifying the requested service. This may be a - * descriptive name or a numeric string corresponding to a port number. May - * be an empty string, in which case all resolved endpoints will have a port - * number of 0. - * - * @returns A range object representing the list of endpoint entries. A - * successful call to this function is guaranteed to return a non-empty - * range. - * - * @throws asio::system_error Thrown on failure. - * - * @note On POSIX systems, host names may be locally defined in the file - * /etc/hosts. On Windows, host names may be defined in the file - * c:\\windows\\system32\\drivers\\etc\\hosts. Remote host name - * resolution is performed using DNS. Operating systems may use additional - * locations when resolving host names (such as NETBIOS names on Windows). - * - * On POSIX systems, service names are typically defined in the file - * /etc/services. On Windows, service names may be found in the file - * c:\\windows\\system32\\drivers\\etc\\services. Operating systems - * may use additional locations when resolving service names. - */ - results_type resolve(ASIO_STRING_VIEW_PARAM host, - ASIO_STRING_VIEW_PARAM service) - { - return resolve(host, service, resolver_base::flags()); - } - - /// Perform forward resolution of a query to a list of entries. - /** - * This function is used to resolve host and service names into a list of - * endpoint entries. - * - * @param host A string identifying a location. May be a descriptive name or - * a numeric address string. If an empty string and the passive flag has been - * specified, the resolved endpoints are suitable for local service binding. - * If an empty string and passive is not specified, the resolved endpoints - * will use the loopback address. - * - * @param service A string identifying the requested service. This may be a - * descriptive name or a numeric string corresponding to a port number. May - * be an empty string, in which case all resolved endpoints will have a port - * number of 0. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns A range object representing the list of endpoint entries. An - * empty range is returned if an error occurs. A successful call to this - * function is guaranteed to return a non-empty range. - * - * @note On POSIX systems, host names may be locally defined in the file - * /etc/hosts. On Windows, host names may be defined in the file - * c:\\windows\\system32\\drivers\\etc\\hosts. Remote host name - * resolution is performed using DNS. Operating systems may use additional - * locations when resolving host names (such as NETBIOS names on Windows). - * - * On POSIX systems, service names are typically defined in the file - * /etc/services. On Windows, service names may be found in the file - * c:\\windows\\system32\\drivers\\etc\\services. Operating systems - * may use additional locations when resolving service names. - */ - results_type resolve(ASIO_STRING_VIEW_PARAM host, - ASIO_STRING_VIEW_PARAM service, asio::error_code& ec) - { - return resolve(host, service, resolver_base::flags(), ec); - } - - /// Perform forward resolution of a query to a list of entries. - /** - * This function is used to resolve host and service names into a list of - * endpoint entries. - * - * @param host A string identifying a location. May be a descriptive name or - * a numeric address string. If an empty string and the passive flag has been - * specified, the resolved endpoints are suitable for local service binding. - * If an empty string and passive is not specified, the resolved endpoints - * will use the loopback address. - * - * @param service A string identifying the requested service. This may be a - * descriptive name or a numeric string corresponding to a port number. May - * be an empty string, in which case all resolved endpoints will have a port - * number of 0. - * - * @param resolve_flags A set of flags that determine how name resolution - * should be performed. The default flags are suitable for communication with - * remote hosts. - * - * @returns A range object representing the list of endpoint entries. A - * successful call to this function is guaranteed to return a non-empty - * range. - * - * @throws asio::system_error Thrown on failure. - * - * @note On POSIX systems, host names may be locally defined in the file - * /etc/hosts. On Windows, host names may be defined in the file - * c:\\windows\\system32\\drivers\\etc\\hosts. Remote host name - * resolution is performed using DNS. Operating systems may use additional - * locations when resolving host names (such as NETBIOS names on Windows). - * - * On POSIX systems, service names are typically defined in the file - * /etc/services. On Windows, service names may be found in the file - * c:\\windows\\system32\\drivers\\etc\\services. Operating systems - * may use additional locations when resolving service names. - */ - results_type resolve(ASIO_STRING_VIEW_PARAM host, - ASIO_STRING_VIEW_PARAM service, resolver_base::flags resolve_flags) - { - asio::error_code ec; - basic_resolver_query q(static_cast(host), - static_cast(service), resolve_flags); - results_type r = this->get_service().resolve( - this->get_implementation(), q, ec); - asio::detail::throw_error(ec, "resolve"); - return r; - } - - /// Perform forward resolution of a query to a list of entries. - /** - * This function is used to resolve host and service names into a list of - * endpoint entries. - * - * @param host A string identifying a location. May be a descriptive name or - * a numeric address string. If an empty string and the passive flag has been - * specified, the resolved endpoints are suitable for local service binding. - * If an empty string and passive is not specified, the resolved endpoints - * will use the loopback address. - * - * @param service A string identifying the requested service. This may be a - * descriptive name or a numeric string corresponding to a port number. May - * be an empty string, in which case all resolved endpoints will have a port - * number of 0. - * - * @param resolve_flags A set of flags that determine how name resolution - * should be performed. The default flags are suitable for communication with - * remote hosts. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns A range object representing the list of endpoint entries. An - * empty range is returned if an error occurs. A successful call to this - * function is guaranteed to return a non-empty range. - * - * @note On POSIX systems, host names may be locally defined in the file - * /etc/hosts. On Windows, host names may be defined in the file - * c:\\windows\\system32\\drivers\\etc\\hosts. Remote host name - * resolution is performed using DNS. Operating systems may use additional - * locations when resolving host names (such as NETBIOS names on Windows). - * - * On POSIX systems, service names are typically defined in the file - * /etc/services. On Windows, service names may be found in the file - * c:\\windows\\system32\\drivers\\etc\\services. Operating systems - * may use additional locations when resolving service names. - */ - results_type resolve(ASIO_STRING_VIEW_PARAM host, - ASIO_STRING_VIEW_PARAM service, resolver_base::flags resolve_flags, - asio::error_code& ec) - { - basic_resolver_query q(static_cast(host), - static_cast(service), resolve_flags); - return this->get_service().resolve(this->get_implementation(), q, ec); - } - - /// Perform forward resolution of a query to a list of entries. - /** - * This function is used to resolve host and service names into a list of - * endpoint entries. - * - * @param protocol A protocol object, normally representing either the IPv4 or - * IPv6 version of an internet protocol. - * - * @param host A string identifying a location. May be a descriptive name or - * a numeric address string. If an empty string and the passive flag has been - * specified, the resolved endpoints are suitable for local service binding. - * If an empty string and passive is not specified, the resolved endpoints - * will use the loopback address. - * - * @param service A string identifying the requested service. This may be a - * descriptive name or a numeric string corresponding to a port number. May - * be an empty string, in which case all resolved endpoints will have a port - * number of 0. - * - * @returns A range object representing the list of endpoint entries. A - * successful call to this function is guaranteed to return a non-empty - * range. - * - * @throws asio::system_error Thrown on failure. - * - * @note On POSIX systems, host names may be locally defined in the file - * /etc/hosts. On Windows, host names may be defined in the file - * c:\\windows\\system32\\drivers\\etc\\hosts. Remote host name - * resolution is performed using DNS. Operating systems may use additional - * locations when resolving host names (such as NETBIOS names on Windows). - * - * On POSIX systems, service names are typically defined in the file - * /etc/services. On Windows, service names may be found in the file - * c:\\windows\\system32\\drivers\\etc\\services. Operating systems - * may use additional locations when resolving service names. - */ - results_type resolve(const protocol_type& protocol, - ASIO_STRING_VIEW_PARAM host, ASIO_STRING_VIEW_PARAM service) - { - return resolve(protocol, host, service, resolver_base::flags()); - } - - /// Perform forward resolution of a query to a list of entries. - /** - * This function is used to resolve host and service names into a list of - * endpoint entries. - * - * @param protocol A protocol object, normally representing either the IPv4 or - * IPv6 version of an internet protocol. - * - * @param host A string identifying a location. May be a descriptive name or - * a numeric address string. If an empty string and the passive flag has been - * specified, the resolved endpoints are suitable for local service binding. - * If an empty string and passive is not specified, the resolved endpoints - * will use the loopback address. - * - * @param service A string identifying the requested service. This may be a - * descriptive name or a numeric string corresponding to a port number. May - * be an empty string, in which case all resolved endpoints will have a port - * number of 0. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns A range object representing the list of endpoint entries. An - * empty range is returned if an error occurs. A successful call to this - * function is guaranteed to return a non-empty range. - * - * @note On POSIX systems, host names may be locally defined in the file - * /etc/hosts. On Windows, host names may be defined in the file - * c:\\windows\\system32\\drivers\\etc\\hosts. Remote host name - * resolution is performed using DNS. Operating systems may use additional - * locations when resolving host names (such as NETBIOS names on Windows). - * - * On POSIX systems, service names are typically defined in the file - * /etc/services. On Windows, service names may be found in the file - * c:\\windows\\system32\\drivers\\etc\\services. Operating systems - * may use additional locations when resolving service names. - */ - results_type resolve(const protocol_type& protocol, - ASIO_STRING_VIEW_PARAM host, ASIO_STRING_VIEW_PARAM service, - asio::error_code& ec) - { - return resolve(protocol, host, service, resolver_base::flags(), ec); - } - - /// Perform forward resolution of a query to a list of entries. - /** - * This function is used to resolve host and service names into a list of - * endpoint entries. - * - * @param protocol A protocol object, normally representing either the IPv4 or - * IPv6 version of an internet protocol. - * - * @param host A string identifying a location. May be a descriptive name or - * a numeric address string. If an empty string and the passive flag has been - * specified, the resolved endpoints are suitable for local service binding. - * If an empty string and passive is not specified, the resolved endpoints - * will use the loopback address. - * - * @param service A string identifying the requested service. This may be a - * descriptive name or a numeric string corresponding to a port number. May - * be an empty string, in which case all resolved endpoints will have a port - * number of 0. - * - * @param resolve_flags A set of flags that determine how name resolution - * should be performed. The default flags are suitable for communication with - * remote hosts. - * - * @returns A range object representing the list of endpoint entries. A - * successful call to this function is guaranteed to return a non-empty - * range. - * - * @throws asio::system_error Thrown on failure. - * - * @note On POSIX systems, host names may be locally defined in the file - * /etc/hosts. On Windows, host names may be defined in the file - * c:\\windows\\system32\\drivers\\etc\\hosts. Remote host name - * resolution is performed using DNS. Operating systems may use additional - * locations when resolving host names (such as NETBIOS names on Windows). - * - * On POSIX systems, service names are typically defined in the file - * /etc/services. On Windows, service names may be found in the file - * c:\\windows\\system32\\drivers\\etc\\services. Operating systems - * may use additional locations when resolving service names. - */ - results_type resolve(const protocol_type& protocol, - ASIO_STRING_VIEW_PARAM host, ASIO_STRING_VIEW_PARAM service, - resolver_base::flags resolve_flags) - { - asio::error_code ec; - basic_resolver_query q( - protocol, static_cast(host), - static_cast(service), resolve_flags); - results_type r = this->get_service().resolve( - this->get_implementation(), q, ec); - asio::detail::throw_error(ec, "resolve"); - return r; - } - - /// Perform forward resolution of a query to a list of entries. - /** - * This function is used to resolve host and service names into a list of - * endpoint entries. - * - * @param protocol A protocol object, normally representing either the IPv4 or - * IPv6 version of an internet protocol. - * - * @param host A string identifying a location. May be a descriptive name or - * a numeric address string. If an empty string and the passive flag has been - * specified, the resolved endpoints are suitable for local service binding. - * If an empty string and passive is not specified, the resolved endpoints - * will use the loopback address. - * - * @param service A string identifying the requested service. This may be a - * descriptive name or a numeric string corresponding to a port number. May - * be an empty string, in which case all resolved endpoints will have a port - * number of 0. - * - * @param resolve_flags A set of flags that determine how name resolution - * should be performed. The default flags are suitable for communication with - * remote hosts. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns A range object representing the list of endpoint entries. An - * empty range is returned if an error occurs. A successful call to this - * function is guaranteed to return a non-empty range. - * - * @note On POSIX systems, host names may be locally defined in the file - * /etc/hosts. On Windows, host names may be defined in the file - * c:\\windows\\system32\\drivers\\etc\\hosts. Remote host name - * resolution is performed using DNS. Operating systems may use additional - * locations when resolving host names (such as NETBIOS names on Windows). - * - * On POSIX systems, service names are typically defined in the file - * /etc/services. On Windows, service names may be found in the file - * c:\\windows\\system32\\drivers\\etc\\services. Operating systems - * may use additional locations when resolving service names. - */ - results_type resolve(const protocol_type& protocol, - ASIO_STRING_VIEW_PARAM host, ASIO_STRING_VIEW_PARAM service, - resolver_base::flags resolve_flags, asio::error_code& ec) - { - basic_resolver_query q( - protocol, static_cast(host), - static_cast(service), resolve_flags); - return this->get_service().resolve(this->get_implementation(), q, ec); - } - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated.) Asynchronously perform forward resolution of a query to a - /// list of entries. - /** - * This function is used to asynchronously resolve a query into a list of - * endpoint entries. - * - * @param q A query object that determines what endpoints will be returned. - * - * @param handler The handler to be called when the resolve operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * resolver::results_type results // Resolved endpoints as a range. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * A successful resolve operation is guaranteed to pass a non-empty range to - * the handler. - */ - template - ASIO_INITFN_RESULT_TYPE(ResolveHandler, - void (asio::error_code, results_type)) - async_resolve(const query& q, - ASIO_MOVE_ARG(ResolveHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ResolveHandler. - ASIO_RESOLVE_HANDLER_CHECK( - ResolveHandler, handler, results_type) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_resolve(this->get_implementation(), q, - ASIO_MOVE_CAST(ResolveHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - asio::async_completion init(handler); - - this->get_service().async_resolve( - this->get_implementation(), q, init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Asynchronously perform forward resolution of a query to a list of entries. - /** - * This function is used to resolve host and service names into a list of - * endpoint entries. - * - * @param host A string identifying a location. May be a descriptive name or - * a numeric address string. If an empty string and the passive flag has been - * specified, the resolved endpoints are suitable for local service binding. - * If an empty string and passive is not specified, the resolved endpoints - * will use the loopback address. - * - * @param service A string identifying the requested service. This may be a - * descriptive name or a numeric string corresponding to a port number. May - * be an empty string, in which case all resolved endpoints will have a port - * number of 0. - * - * @param handler The handler to be called when the resolve operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * resolver::results_type results // Resolved endpoints as a range. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * A successful resolve operation is guaranteed to pass a non-empty range to - * the handler. - * - * @note On POSIX systems, host names may be locally defined in the file - * /etc/hosts. On Windows, host names may be defined in the file - * c:\\windows\\system32\\drivers\\etc\\hosts. Remote host name - * resolution is performed using DNS. Operating systems may use additional - * locations when resolving host names (such as NETBIOS names on Windows). - * - * On POSIX systems, service names are typically defined in the file - * /etc/services. On Windows, service names may be found in the file - * c:\\windows\\system32\\drivers\\etc\\services. Operating systems - * may use additional locations when resolving service names. - */ - template - ASIO_INITFN_RESULT_TYPE(ResolveHandler, - void (asio::error_code, results_type)) - async_resolve(ASIO_STRING_VIEW_PARAM host, - ASIO_STRING_VIEW_PARAM service, - ASIO_MOVE_ARG(ResolveHandler) handler) - { - return async_resolve(host, service, resolver_base::flags(), - ASIO_MOVE_CAST(ResolveHandler)(handler)); - } - - /// Asynchronously perform forward resolution of a query to a list of entries. - /** - * This function is used to resolve host and service names into a list of - * endpoint entries. - * - * @param host A string identifying a location. May be a descriptive name or - * a numeric address string. If an empty string and the passive flag has been - * specified, the resolved endpoints are suitable for local service binding. - * If an empty string and passive is not specified, the resolved endpoints - * will use the loopback address. - * - * @param service A string identifying the requested service. This may be a - * descriptive name or a numeric string corresponding to a port number. May - * be an empty string, in which case all resolved endpoints will have a port - * number of 0. - * - * @param resolve_flags A set of flags that determine how name resolution - * should be performed. The default flags are suitable for communication with - * remote hosts. - * - * @param handler The handler to be called when the resolve operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * resolver::results_type results // Resolved endpoints as a range. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * A successful resolve operation is guaranteed to pass a non-empty range to - * the handler. - * - * @note On POSIX systems, host names may be locally defined in the file - * /etc/hosts. On Windows, host names may be defined in the file - * c:\\windows\\system32\\drivers\\etc\\hosts. Remote host name - * resolution is performed using DNS. Operating systems may use additional - * locations when resolving host names (such as NETBIOS names on Windows). - * - * On POSIX systems, service names are typically defined in the file - * /etc/services. On Windows, service names may be found in the file - * c:\\windows\\system32\\drivers\\etc\\services. Operating systems - * may use additional locations when resolving service names. - */ - template - ASIO_INITFN_RESULT_TYPE(ResolveHandler, - void (asio::error_code, results_type)) - async_resolve(ASIO_STRING_VIEW_PARAM host, - ASIO_STRING_VIEW_PARAM service, - resolver_base::flags resolve_flags, - ASIO_MOVE_ARG(ResolveHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ResolveHandler. - ASIO_RESOLVE_HANDLER_CHECK( - ResolveHandler, handler, results_type) type_check; - - basic_resolver_query q(static_cast(host), - static_cast(service), resolve_flags); - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_resolve(this->get_implementation(), q, - ASIO_MOVE_CAST(ResolveHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - asio::async_completion init(handler); - - this->get_service().async_resolve( - this->get_implementation(), q, init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Asynchronously perform forward resolution of a query to a list of entries. - /** - * This function is used to resolve host and service names into a list of - * endpoint entries. - * - * @param protocol A protocol object, normally representing either the IPv4 or - * IPv6 version of an internet protocol. - * - * @param host A string identifying a location. May be a descriptive name or - * a numeric address string. If an empty string and the passive flag has been - * specified, the resolved endpoints are suitable for local service binding. - * If an empty string and passive is not specified, the resolved endpoints - * will use the loopback address. - * - * @param service A string identifying the requested service. This may be a - * descriptive name or a numeric string corresponding to a port number. May - * be an empty string, in which case all resolved endpoints will have a port - * number of 0. - * - * @param handler The handler to be called when the resolve operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * resolver::results_type results // Resolved endpoints as a range. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * A successful resolve operation is guaranteed to pass a non-empty range to - * the handler. - * - * @note On POSIX systems, host names may be locally defined in the file - * /etc/hosts. On Windows, host names may be defined in the file - * c:\\windows\\system32\\drivers\\etc\\hosts. Remote host name - * resolution is performed using DNS. Operating systems may use additional - * locations when resolving host names (such as NETBIOS names on Windows). - * - * On POSIX systems, service names are typically defined in the file - * /etc/services. On Windows, service names may be found in the file - * c:\\windows\\system32\\drivers\\etc\\services. Operating systems - * may use additional locations when resolving service names. - */ - template - ASIO_INITFN_RESULT_TYPE(ResolveHandler, - void (asio::error_code, results_type)) - async_resolve(const protocol_type& protocol, - ASIO_STRING_VIEW_PARAM host, ASIO_STRING_VIEW_PARAM service, - ASIO_MOVE_ARG(ResolveHandler) handler) - { - return async_resolve(protocol, host, service, resolver_base::flags(), - ASIO_MOVE_CAST(ResolveHandler)(handler)); - } - - /// Asynchronously perform forward resolution of a query to a list of entries. - /** - * This function is used to resolve host and service names into a list of - * endpoint entries. - * - * @param protocol A protocol object, normally representing either the IPv4 or - * IPv6 version of an internet protocol. - * - * @param host A string identifying a location. May be a descriptive name or - * a numeric address string. If an empty string and the passive flag has been - * specified, the resolved endpoints are suitable for local service binding. - * If an empty string and passive is not specified, the resolved endpoints - * will use the loopback address. - * - * @param service A string identifying the requested service. This may be a - * descriptive name or a numeric string corresponding to a port number. May - * be an empty string, in which case all resolved endpoints will have a port - * number of 0. - * - * @param resolve_flags A set of flags that determine how name resolution - * should be performed. The default flags are suitable for communication with - * remote hosts. - * - * @param handler The handler to be called when the resolve operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * resolver::results_type results // Resolved endpoints as a range. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * A successful resolve operation is guaranteed to pass a non-empty range to - * the handler. - * - * @note On POSIX systems, host names may be locally defined in the file - * /etc/hosts. On Windows, host names may be defined in the file - * c:\\windows\\system32\\drivers\\etc\\hosts. Remote host name - * resolution is performed using DNS. Operating systems may use additional - * locations when resolving host names (such as NETBIOS names on Windows). - * - * On POSIX systems, service names are typically defined in the file - * /etc/services. On Windows, service names may be found in the file - * c:\\windows\\system32\\drivers\\etc\\services. Operating systems - * may use additional locations when resolving service names. - */ - template - ASIO_INITFN_RESULT_TYPE(ResolveHandler, - void (asio::error_code, results_type)) - async_resolve(const protocol_type& protocol, - ASIO_STRING_VIEW_PARAM host, ASIO_STRING_VIEW_PARAM service, - resolver_base::flags resolve_flags, - ASIO_MOVE_ARG(ResolveHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ResolveHandler. - ASIO_RESOLVE_HANDLER_CHECK( - ResolveHandler, handler, results_type) type_check; - - basic_resolver_query q( - protocol, static_cast(host), - static_cast(service), resolve_flags); - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_resolve(this->get_implementation(), q, - ASIO_MOVE_CAST(ResolveHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - asio::async_completion init(handler); - - this->get_service().async_resolve( - this->get_implementation(), q, init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } - - /// Perform reverse resolution of an endpoint to a list of entries. - /** - * This function is used to resolve an endpoint into a list of endpoint - * entries. - * - * @param e An endpoint object that determines what endpoints will be - * returned. - * - * @returns A range object representing the list of endpoint entries. A - * successful call to this function is guaranteed to return a non-empty - * range. - * - * @throws asio::system_error Thrown on failure. - */ - results_type resolve(const endpoint_type& e) - { - asio::error_code ec; - results_type i = this->get_service().resolve( - this->get_implementation(), e, ec); - asio::detail::throw_error(ec, "resolve"); - return i; - } - - /// Perform reverse resolution of an endpoint to a list of entries. - /** - * This function is used to resolve an endpoint into a list of endpoint - * entries. - * - * @param e An endpoint object that determines what endpoints will be - * returned. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns A range object representing the list of endpoint entries. An - * empty range is returned if an error occurs. A successful call to this - * function is guaranteed to return a non-empty range. - */ - results_type resolve(const endpoint_type& e, asio::error_code& ec) - { - return this->get_service().resolve(this->get_implementation(), e, ec); - } - - /// Asynchronously perform reverse resolution of an endpoint to a list of - /// entries. - /** - * This function is used to asynchronously resolve an endpoint into a list of - * endpoint entries. - * - * @param e An endpoint object that determines what endpoints will be - * returned. - * - * @param handler The handler to be called when the resolve operation - * completes. Copies will be made of the handler as required. The function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * resolver::results_type results // Resolved endpoints as a range. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * A successful resolve operation is guaranteed to pass a non-empty range to - * the handler. - */ - template - ASIO_INITFN_RESULT_TYPE(ResolveHandler, - void (asio::error_code, results_type)) - async_resolve(const endpoint_type& e, - ASIO_MOVE_ARG(ResolveHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ResolveHandler. - ASIO_RESOLVE_HANDLER_CHECK( - ResolveHandler, handler, results_type) type_check; - -#if defined(ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_resolve(this->get_implementation(), e, - ASIO_MOVE_CAST(ResolveHandler)(handler)); -#else // defined(ASIO_ENABLE_OLD_SERVICES) - asio::async_completion init(handler); - - this->get_service().async_resolve( - this->get_implementation(), e, init.completion_handler); - - return init.result.get(); -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - } -}; - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if !defined(ASIO_ENABLE_OLD_SERVICES) -# undef ASIO_SVC_T -#endif // !defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_IP_BASIC_RESOLVER_HPP diff --git a/tools/sdk/include/asio/asio/ip/basic_resolver_entry.hpp b/tools/sdk/include/asio/asio/ip/basic_resolver_entry.hpp deleted file mode 100644 index 99bcbd29e6f..00000000000 --- a/tools/sdk/include/asio/asio/ip/basic_resolver_entry.hpp +++ /dev/null @@ -1,113 +0,0 @@ -// -// ip/basic_resolver_entry.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_BASIC_RESOLVER_ENTRY_HPP -#define ASIO_IP_BASIC_RESOLVER_ENTRY_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/detail/string_view.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -/// An entry produced by a resolver. -/** - * The asio::ip::basic_resolver_entry class template describes an entry - * as returned by a resolver. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -template -class basic_resolver_entry -{ -public: - /// The protocol type associated with the endpoint entry. - typedef InternetProtocol protocol_type; - - /// The endpoint type associated with the endpoint entry. - typedef typename InternetProtocol::endpoint endpoint_type; - - /// Default constructor. - basic_resolver_entry() - { - } - - /// Construct with specified endpoint, host name and service name. - basic_resolver_entry(const endpoint_type& ep, - ASIO_STRING_VIEW_PARAM host, ASIO_STRING_VIEW_PARAM service) - : endpoint_(ep), - host_name_(static_cast(host)), - service_name_(static_cast(service)) - { - } - - /// Get the endpoint associated with the entry. - endpoint_type endpoint() const - { - return endpoint_; - } - - /// Convert to the endpoint associated with the entry. - operator endpoint_type() const - { - return endpoint_; - } - - /// Get the host name associated with the entry. - std::string host_name() const - { - return host_name_; - } - - /// Get the host name associated with the entry. - template - std::basic_string, Allocator> host_name( - const Allocator& alloc = Allocator()) const - { - return std::basic_string, Allocator>( - host_name_.c_str(), alloc); - } - - /// Get the service name associated with the entry. - std::string service_name() const - { - return service_name_; - } - - /// Get the service name associated with the entry. - template - std::basic_string, Allocator> service_name( - const Allocator& alloc = Allocator()) const - { - return std::basic_string, Allocator>( - service_name_.c_str(), alloc); - } - -private: - endpoint_type endpoint_; - std::string host_name_; - std::string service_name_; -}; - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IP_BASIC_RESOLVER_ENTRY_HPP diff --git a/tools/sdk/include/asio/asio/ip/basic_resolver_iterator.hpp b/tools/sdk/include/asio/asio/ip/basic_resolver_iterator.hpp deleted file mode 100644 index ec5412cf6f7..00000000000 --- a/tools/sdk/include/asio/asio/ip/basic_resolver_iterator.hpp +++ /dev/null @@ -1,192 +0,0 @@ -// -// ip/basic_resolver_iterator.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_BASIC_RESOLVER_ITERATOR_HPP -#define ASIO_IP_BASIC_RESOLVER_ITERATOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include -#include -#include -#include -#include "asio/detail/memory.hpp" -#include "asio/detail/socket_ops.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/ip/basic_resolver_entry.hpp" - -#if defined(ASIO_WINDOWS_RUNTIME) -# include "asio/detail/winrt_utils.hpp" -#endif // defined(ASIO_WINDOWS_RUNTIME) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -/// An iterator over the entries produced by a resolver. -/** - * The asio::ip::basic_resolver_iterator class template is used to define - * iterators over the results returned by a resolver. - * - * The iterator's value_type, obtained when the iterator is dereferenced, is: - * @code const basic_resolver_entry @endcode - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -template -class basic_resolver_iterator -{ -public: - /// The type used for the distance between two iterators. - typedef std::ptrdiff_t difference_type; - - /// The type of the value pointed to by the iterator. - typedef basic_resolver_entry value_type; - - /// The type of the result of applying operator->() to the iterator. - typedef const basic_resolver_entry* pointer; - - /// The type of the result of applying operator*() to the iterator. - typedef const basic_resolver_entry& reference; - - /// The iterator category. - typedef std::forward_iterator_tag iterator_category; - - /// Default constructor creates an end iterator. - basic_resolver_iterator() - : index_(0) - { - } - - /// Copy constructor. - basic_resolver_iterator(const basic_resolver_iterator& other) - : values_(other.values_), - index_(other.index_) - { - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move constructor. - basic_resolver_iterator(basic_resolver_iterator&& other) - : values_(ASIO_MOVE_CAST(values_ptr_type)(other.values_)), - index_(other.index_) - { - other.index_ = 0; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Assignment operator. - basic_resolver_iterator& operator=(const basic_resolver_iterator& other) - { - values_ = other.values_; - index_ = other.index_; - return *this; - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-assignment operator. - basic_resolver_iterator& operator=(basic_resolver_iterator&& other) - { - if (this != &other) - { - values_ = ASIO_MOVE_CAST(values_ptr_type)(other.values_); - index_ = other.index_; - other.index_ = 0; - } - - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Dereference an iterator. - const basic_resolver_entry& operator*() const - { - return dereference(); - } - - /// Dereference an iterator. - const basic_resolver_entry* operator->() const - { - return &dereference(); - } - - /// Increment operator (prefix). - basic_resolver_iterator& operator++() - { - increment(); - return *this; - } - - /// Increment operator (postfix). - basic_resolver_iterator operator++(int) - { - basic_resolver_iterator tmp(*this); - ++*this; - return tmp; - } - - /// Test two iterators for equality. - friend bool operator==(const basic_resolver_iterator& a, - const basic_resolver_iterator& b) - { - return a.equal(b); - } - - /// Test two iterators for inequality. - friend bool operator!=(const basic_resolver_iterator& a, - const basic_resolver_iterator& b) - { - return !a.equal(b); - } - -protected: - void increment() - { - if (++index_ == values_->size()) - { - // Reset state to match a default constructed end iterator. - values_.reset(); - index_ = 0; - } - } - - bool equal(const basic_resolver_iterator& other) const - { - if (!values_ && !other.values_) - return true; - if (values_ != other.values_) - return false; - return index_ == other.index_; - } - - const basic_resolver_entry& dereference() const - { - return (*values_)[index_]; - } - - typedef std::vector > values_type; - typedef asio::detail::shared_ptr values_ptr_type; - values_ptr_type values_; - std::size_t index_; -}; - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IP_BASIC_RESOLVER_ITERATOR_HPP diff --git a/tools/sdk/include/asio/asio/ip/basic_resolver_query.hpp b/tools/sdk/include/asio/asio/ip/basic_resolver_query.hpp deleted file mode 100644 index 84cd98d5582..00000000000 --- a/tools/sdk/include/asio/asio/ip/basic_resolver_query.hpp +++ /dev/null @@ -1,244 +0,0 @@ -// -// ip/basic_resolver_query.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_BASIC_RESOLVER_QUERY_HPP -#define ASIO_IP_BASIC_RESOLVER_QUERY_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/detail/socket_ops.hpp" -#include "asio/ip/resolver_query_base.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -/// An query to be passed to a resolver. -/** - * The asio::ip::basic_resolver_query class template describes a query - * that can be passed to a resolver. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -template -class basic_resolver_query - : public resolver_query_base -{ -public: - /// The protocol type associated with the endpoint query. - typedef InternetProtocol protocol_type; - - /// Construct with specified service name for any protocol. - /** - * This constructor is typically used to perform name resolution for local - * service binding. - * - * @param service A string identifying the requested service. This may be a - * descriptive name or a numeric string corresponding to a port number. - * - * @param resolve_flags A set of flags that determine how name resolution - * should be performed. The default flags are suitable for local service - * binding. - * - * @note On POSIX systems, service names are typically defined in the file - * /etc/services. On Windows, service names may be found in the file - * c:\\windows\\system32\\drivers\\etc\\services. Operating systems - * may use additional locations when resolving service names. - */ - basic_resolver_query(const std::string& service, - resolver_query_base::flags resolve_flags = passive | address_configured) - : hints_(), - host_name_(), - service_name_(service) - { - typename InternetProtocol::endpoint endpoint; - hints_.ai_flags = static_cast(resolve_flags); - hints_.ai_family = PF_UNSPEC; - hints_.ai_socktype = endpoint.protocol().type(); - hints_.ai_protocol = endpoint.protocol().protocol(); - hints_.ai_addrlen = 0; - hints_.ai_canonname = 0; - hints_.ai_addr = 0; - hints_.ai_next = 0; - } - - /// Construct with specified service name for a given protocol. - /** - * This constructor is typically used to perform name resolution for local - * service binding with a specific protocol version. - * - * @param protocol A protocol object, normally representing either the IPv4 or - * IPv6 version of an internet protocol. - * - * @param service A string identifying the requested service. This may be a - * descriptive name or a numeric string corresponding to a port number. - * - * @param resolve_flags A set of flags that determine how name resolution - * should be performed. The default flags are suitable for local service - * binding. - * - * @note On POSIX systems, service names are typically defined in the file - * /etc/services. On Windows, service names may be found in the file - * c:\\windows\\system32\\drivers\\etc\\services. Operating systems - * may use additional locations when resolving service names. - */ - basic_resolver_query(const protocol_type& protocol, - const std::string& service, - resolver_query_base::flags resolve_flags = passive | address_configured) - : hints_(), - host_name_(), - service_name_(service) - { - hints_.ai_flags = static_cast(resolve_flags); - hints_.ai_family = protocol.family(); - hints_.ai_socktype = protocol.type(); - hints_.ai_protocol = protocol.protocol(); - hints_.ai_addrlen = 0; - hints_.ai_canonname = 0; - hints_.ai_addr = 0; - hints_.ai_next = 0; - } - - /// Construct with specified host name and service name for any protocol. - /** - * This constructor is typically used to perform name resolution for - * communication with remote hosts. - * - * @param host A string identifying a location. May be a descriptive name or - * a numeric address string. If an empty string and the passive flag has been - * specified, the resolved endpoints are suitable for local service binding. - * If an empty string and passive is not specified, the resolved endpoints - * will use the loopback address. - * - * @param service A string identifying the requested service. This may be a - * descriptive name or a numeric string corresponding to a port number. May - * be an empty string, in which case all resolved endpoints will have a port - * number of 0. - * - * @param resolve_flags A set of flags that determine how name resolution - * should be performed. The default flags are suitable for communication with - * remote hosts. - * - * @note On POSIX systems, host names may be locally defined in the file - * /etc/hosts. On Windows, host names may be defined in the file - * c:\\windows\\system32\\drivers\\etc\\hosts. Remote host name - * resolution is performed using DNS. Operating systems may use additional - * locations when resolving host names (such as NETBIOS names on Windows). - * - * On POSIX systems, service names are typically defined in the file - * /etc/services. On Windows, service names may be found in the file - * c:\\windows\\system32\\drivers\\etc\\services. Operating systems - * may use additional locations when resolving service names. - */ - basic_resolver_query(const std::string& host, const std::string& service, - resolver_query_base::flags resolve_flags = address_configured) - : hints_(), - host_name_(host), - service_name_(service) - { - typename InternetProtocol::endpoint endpoint; - hints_.ai_flags = static_cast(resolve_flags); - hints_.ai_family = ASIO_OS_DEF(AF_UNSPEC); - hints_.ai_socktype = endpoint.protocol().type(); - hints_.ai_protocol = endpoint.protocol().protocol(); - hints_.ai_addrlen = 0; - hints_.ai_canonname = 0; - hints_.ai_addr = 0; - hints_.ai_next = 0; - } - - /// Construct with specified host name and service name for a given protocol. - /** - * This constructor is typically used to perform name resolution for - * communication with remote hosts. - * - * @param protocol A protocol object, normally representing either the IPv4 or - * IPv6 version of an internet protocol. - * - * @param host A string identifying a location. May be a descriptive name or - * a numeric address string. If an empty string and the passive flag has been - * specified, the resolved endpoints are suitable for local service binding. - * If an empty string and passive is not specified, the resolved endpoints - * will use the loopback address. - * - * @param service A string identifying the requested service. This may be a - * descriptive name or a numeric string corresponding to a port number. May - * be an empty string, in which case all resolved endpoints will have a port - * number of 0. - * - * @param resolve_flags A set of flags that determine how name resolution - * should be performed. The default flags are suitable for communication with - * remote hosts. - * - * @note On POSIX systems, host names may be locally defined in the file - * /etc/hosts. On Windows, host names may be defined in the file - * c:\\windows\\system32\\drivers\\etc\\hosts. Remote host name - * resolution is performed using DNS. Operating systems may use additional - * locations when resolving host names (such as NETBIOS names on Windows). - * - * On POSIX systems, service names are typically defined in the file - * /etc/services. On Windows, service names may be found in the file - * c:\\windows\\system32\\drivers\\etc\\services. Operating systems - * may use additional locations when resolving service names. - */ - basic_resolver_query(const protocol_type& protocol, - const std::string& host, const std::string& service, - resolver_query_base::flags resolve_flags = address_configured) - : hints_(), - host_name_(host), - service_name_(service) - { - hints_.ai_flags = static_cast(resolve_flags); - hints_.ai_family = protocol.family(); - hints_.ai_socktype = protocol.type(); - hints_.ai_protocol = protocol.protocol(); - hints_.ai_addrlen = 0; - hints_.ai_canonname = 0; - hints_.ai_addr = 0; - hints_.ai_next = 0; - } - - /// Get the hints associated with the query. - const asio::detail::addrinfo_type& hints() const - { - return hints_; - } - - /// Get the host name associated with the query. - std::string host_name() const - { - return host_name_; - } - - /// Get the service name associated with the query. - std::string service_name() const - { - return service_name_; - } - -private: - asio::detail::addrinfo_type hints_; - std::string host_name_; - std::string service_name_; -}; - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IP_BASIC_RESOLVER_QUERY_HPP diff --git a/tools/sdk/include/asio/asio/ip/basic_resolver_results.hpp b/tools/sdk/include/asio/asio/ip/basic_resolver_results.hpp deleted file mode 100644 index 185075f0bf9..00000000000 --- a/tools/sdk/include/asio/asio/ip/basic_resolver_results.hpp +++ /dev/null @@ -1,311 +0,0 @@ -// -// ip/basic_resolver_results.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_BASIC_RESOLVER_RESULTS_HPP -#define ASIO_IP_BASIC_RESOLVER_RESULTS_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include -#include "asio/detail/socket_ops.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/ip/basic_resolver_iterator.hpp" - -#if defined(ASIO_WINDOWS_RUNTIME) -# include "asio/detail/winrt_utils.hpp" -#endif // defined(ASIO_WINDOWS_RUNTIME) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -/// A range of entries produced by a resolver. -/** - * The asio::ip::basic_resolver_results class template is used to define - * a range over the results returned by a resolver. - * - * The iterator's value_type, obtained when a results iterator is dereferenced, - * is: @code const basic_resolver_entry @endcode - * - * @note For backward compatibility, basic_resolver_results is derived from - * basic_resolver_iterator. This derivation is deprecated. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -template -class basic_resolver_results -#if !defined(ASIO_NO_DEPRECATED) - : public basic_resolver_iterator -#else // !defined(ASIO_NO_DEPRECATED) - : private basic_resolver_iterator -#endif // !defined(ASIO_NO_DEPRECATED) -{ -public: - /// The protocol type associated with the results. - typedef InternetProtocol protocol_type; - - /// The endpoint type associated with the results. - typedef typename protocol_type::endpoint endpoint_type; - - /// The type of a value in the results range. - typedef basic_resolver_entry value_type; - - /// The type of a const reference to a value in the range. - typedef const value_type& const_reference; - - /// The type of a non-const reference to a value in the range. - typedef value_type& reference; - - /// The type of an iterator into the range. - typedef basic_resolver_iterator const_iterator; - - /// The type of an iterator into the range. - typedef const_iterator iterator; - - /// Type used to represent the distance between two iterators in the range. - typedef std::ptrdiff_t difference_type; - - /// Type used to represent a count of the elements in the range. - typedef std::size_t size_type; - - /// Default constructor creates an empty range. - basic_resolver_results() - { - } - - /// Copy constructor. - basic_resolver_results(const basic_resolver_results& other) - : basic_resolver_iterator(other) - { - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move constructor. - basic_resolver_results(basic_resolver_results&& other) - : basic_resolver_iterator( - ASIO_MOVE_CAST(basic_resolver_results)(other)) - { - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Assignment operator. - basic_resolver_results& operator=(const basic_resolver_results& other) - { - basic_resolver_iterator::operator=(other); - return *this; - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-assignment operator. - basic_resolver_results& operator=(basic_resolver_results&& other) - { - basic_resolver_iterator::operator=( - ASIO_MOVE_CAST(basic_resolver_results)(other)); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - -#if !defined(GENERATING_DOCUMENTATION) - // Create results from an addrinfo list returned by getaddrinfo. - static basic_resolver_results create( - asio::detail::addrinfo_type* address_info, - const std::string& host_name, const std::string& service_name) - { - basic_resolver_results results; - if (!address_info) - return results; - - std::string actual_host_name = host_name; - if (address_info->ai_canonname) - actual_host_name = address_info->ai_canonname; - - results.values_.reset(new values_type); - - while (address_info) - { - if (address_info->ai_family == ASIO_OS_DEF(AF_INET) - || address_info->ai_family == ASIO_OS_DEF(AF_INET6)) - { - using namespace std; // For memcpy. - typename InternetProtocol::endpoint endpoint; - endpoint.resize(static_cast(address_info->ai_addrlen)); - memcpy(endpoint.data(), address_info->ai_addr, - address_info->ai_addrlen); - results.values_->push_back( - basic_resolver_entry(endpoint, - actual_host_name, service_name)); - } - address_info = address_info->ai_next; - } - - return results; - } - - // Create results from an endpoint, host name and service name. - static basic_resolver_results create(const endpoint_type& endpoint, - const std::string& host_name, const std::string& service_name) - { - basic_resolver_results results; - results.values_.reset(new values_type); - results.values_->push_back( - basic_resolver_entry( - endpoint, host_name, service_name)); - return results; - } - - // Create results from a sequence of endpoints, host and service name. - template - static basic_resolver_results create( - EndpointIterator begin, EndpointIterator end, - const std::string& host_name, const std::string& service_name) - { - basic_resolver_results results; - if (begin != end) - { - results.values_.reset(new values_type); - for (EndpointIterator ep_iter = begin; ep_iter != end; ++ep_iter) - { - results.values_->push_back( - basic_resolver_entry( - *ep_iter, host_name, service_name)); - } - } - return results; - } - -# if defined(ASIO_WINDOWS_RUNTIME) - // Create results from a Windows Runtime list of EndpointPair objects. - static basic_resolver_results create( - Windows::Foundation::Collections::IVectorView< - Windows::Networking::EndpointPair^>^ endpoints, - const asio::detail::addrinfo_type& hints, - const std::string& host_name, const std::string& service_name) - { - basic_resolver_results results; - if (endpoints->Size) - { - results.values_.reset(new values_type); - for (unsigned int i = 0; i < endpoints->Size; ++i) - { - auto pair = endpoints->GetAt(i); - - if (hints.ai_family == ASIO_OS_DEF(AF_INET) - && pair->RemoteHostName->Type - != Windows::Networking::HostNameType::Ipv4) - continue; - - if (hints.ai_family == ASIO_OS_DEF(AF_INET6) - && pair->RemoteHostName->Type - != Windows::Networking::HostNameType::Ipv6) - continue; - - results.values_->push_back( - basic_resolver_entry( - typename InternetProtocol::endpoint( - ip::make_address( - asio::detail::winrt_utils::string( - pair->RemoteHostName->CanonicalName)), - asio::detail::winrt_utils::integer( - pair->RemoteServiceName)), - host_name, service_name)); - } - } - return results; - } -# endif // defined(ASIO_WINDOWS_RUNTIME) -#endif // !defined(GENERATING_DOCUMENTATION) - - /// Get the number of entries in the results range. - size_type size() const ASIO_NOEXCEPT - { - return this->values_->size(); - } - - /// Get the maximum number of entries permitted in a results range. - size_type max_size() const ASIO_NOEXCEPT - { - return this->values_->max_size(); - } - - /// Determine whether the results range is empty. - bool empty() const ASIO_NOEXCEPT - { - return this->values_->empty(); - } - - /// Obtain a begin iterator for the results range. - const_iterator begin() const - { - basic_resolver_results tmp(*this); - tmp.index_ = 0; - return tmp; - } - - /// Obtain an end iterator for the results range. - const_iterator end() const - { - return const_iterator(); - } - - /// Obtain a begin iterator for the results range. - const_iterator cbegin() const - { - return begin(); - } - - /// Obtain an end iterator for the results range. - const_iterator cend() const - { - return end(); - } - - /// Swap the results range with another. - void swap(basic_resolver_results& that) ASIO_NOEXCEPT - { - if (this != &that) - { - this->values_.swap(that.values_); - std::size_t index = this->index_; - this->index_ = that.index_; - that.index_ = index; - } - } - - /// Test two iterators for equality. - friend bool operator==(const basic_resolver_results& a, - const basic_resolver_results& b) - { - return a.equal(b); - } - - /// Test two iterators for inequality. - friend bool operator!=(const basic_resolver_results& a, - const basic_resolver_results& b) - { - return !a.equal(b); - } - -private: - typedef std::vector > values_type; -}; - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IP_BASIC_RESOLVER_RESULTS_HPP diff --git a/tools/sdk/include/asio/asio/ip/detail/endpoint.hpp b/tools/sdk/include/asio/asio/ip/detail/endpoint.hpp deleted file mode 100644 index 9acefe5fe29..00000000000 --- a/tools/sdk/include/asio/asio/ip/detail/endpoint.hpp +++ /dev/null @@ -1,139 +0,0 @@ -// -// ip/detail/endpoint.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_DETAIL_ENDPOINT_HPP -#define ASIO_IP_DETAIL_ENDPOINT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/detail/socket_types.hpp" -#include "asio/detail/winsock_init.hpp" -#include "asio/error_code.hpp" -#include "asio/ip/address.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { -namespace detail { - -// Helper class for implementating an IP endpoint. -class endpoint -{ -public: - // Default constructor. - ASIO_DECL endpoint(); - - // Construct an endpoint using a family and port number. - ASIO_DECL endpoint(int family, unsigned short port_num); - - // Construct an endpoint using an address and port number. - ASIO_DECL endpoint(const asio::ip::address& addr, - unsigned short port_num); - - // Copy constructor. - endpoint(const endpoint& other) - : data_(other.data_) - { - } - - // Assign from another endpoint. - endpoint& operator=(const endpoint& other) - { - data_ = other.data_; - return *this; - } - - // Get the underlying endpoint in the native type. - asio::detail::socket_addr_type* data() - { - return &data_.base; - } - - // Get the underlying endpoint in the native type. - const asio::detail::socket_addr_type* data() const - { - return &data_.base; - } - - // Get the underlying size of the endpoint in the native type. - std::size_t size() const - { - if (is_v4()) - return sizeof(asio::detail::sockaddr_in4_type); - else - return sizeof(asio::detail::sockaddr_in6_type); - } - - // Set the underlying size of the endpoint in the native type. - ASIO_DECL void resize(std::size_t new_size); - - // Get the capacity of the endpoint in the native type. - std::size_t capacity() const - { - return sizeof(data_); - } - - // Get the port associated with the endpoint. - ASIO_DECL unsigned short port() const; - - // Set the port associated with the endpoint. - ASIO_DECL void port(unsigned short port_num); - - // Get the IP address associated with the endpoint. - ASIO_DECL asio::ip::address address() const; - - // Set the IP address associated with the endpoint. - ASIO_DECL void address(const asio::ip::address& addr); - - // Compare two endpoints for equality. - ASIO_DECL friend bool operator==( - const endpoint& e1, const endpoint& e2); - - // Compare endpoints for ordering. - ASIO_DECL friend bool operator<( - const endpoint& e1, const endpoint& e2); - - // Determine whether the endpoint is IPv4. - bool is_v4() const - { - return data_.base.sa_family == ASIO_OS_DEF(AF_INET); - } - -#if !defined(ASIO_NO_IOSTREAM) - // Convert to a string. - ASIO_DECL std::string to_string() const; -#endif // !defined(ASIO_NO_IOSTREAM) - -private: - // The underlying IP socket address. - union data_union - { - asio::detail::socket_addr_type base; - asio::detail::sockaddr_in4_type v4; - asio::detail::sockaddr_in6_type v6; - } data_; -}; - -} // namespace detail -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/ip/detail/impl/endpoint.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_IP_DETAIL_ENDPOINT_HPP diff --git a/tools/sdk/include/asio/asio/ip/detail/socket_option.hpp b/tools/sdk/include/asio/asio/ip/detail/socket_option.hpp deleted file mode 100644 index 051ef30db95..00000000000 --- a/tools/sdk/include/asio/asio/ip/detail/socket_option.hpp +++ /dev/null @@ -1,566 +0,0 @@ -// -// detail/socket_option.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_DETAIL_SOCKET_OPTION_HPP -#define ASIO_IP_DETAIL_SOCKET_OPTION_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include -#include -#include "asio/detail/socket_ops.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/detail/throw_exception.hpp" -#include "asio/ip/address.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { -namespace detail { -namespace socket_option { - -// Helper template for implementing multicast enable loopback options. -template -class multicast_enable_loopback -{ -public: -#if defined(__sun) || defined(__osf__) - typedef unsigned char ipv4_value_type; - typedef unsigned char ipv6_value_type; -#elif defined(_AIX) || defined(__hpux) || defined(__QNXNTO__) - typedef unsigned char ipv4_value_type; - typedef unsigned int ipv6_value_type; -#else - typedef int ipv4_value_type; - typedef int ipv6_value_type; -#endif - - // Default constructor. - multicast_enable_loopback() - : ipv4_value_(0), - ipv6_value_(0) - { - } - - // Construct with a specific option value. - explicit multicast_enable_loopback(bool v) - : ipv4_value_(v ? 1 : 0), - ipv6_value_(v ? 1 : 0) - { - } - - // Set the value of the boolean. - multicast_enable_loopback& operator=(bool v) - { - ipv4_value_ = v ? 1 : 0; - ipv6_value_ = v ? 1 : 0; - return *this; - } - - // Get the current value of the boolean. - bool value() const - { - return !!ipv4_value_; - } - - // Convert to bool. - operator bool() const - { - return !!ipv4_value_; - } - - // Test for false. - bool operator!() const - { - return !ipv4_value_; - } - - // Get the level of the socket option. - template - int level(const Protocol& protocol) const - { - if (protocol.family() == PF_INET6) - return IPv6_Level; - return IPv4_Level; - } - - // Get the name of the socket option. - template - int name(const Protocol& protocol) const - { - if (protocol.family() == PF_INET6) - return IPv6_Name; - return IPv4_Name; - } - - // Get the address of the boolean data. - template - void* data(const Protocol& protocol) - { - if (protocol.family() == PF_INET6) - return &ipv6_value_; - return &ipv4_value_; - } - - // Get the address of the boolean data. - template - const void* data(const Protocol& protocol) const - { - if (protocol.family() == PF_INET6) - return &ipv6_value_; - return &ipv4_value_; - } - - // Get the size of the boolean data. - template - std::size_t size(const Protocol& protocol) const - { - if (protocol.family() == PF_INET6) - return sizeof(ipv6_value_); - return sizeof(ipv4_value_); - } - - // Set the size of the boolean data. - template - void resize(const Protocol& protocol, std::size_t s) - { - if (protocol.family() == PF_INET6) - { - if (s != sizeof(ipv6_value_)) - { - std::length_error ex("multicast_enable_loopback socket option resize"); - asio::detail::throw_exception(ex); - } - ipv4_value_ = ipv6_value_ ? 1 : 0; - } - else - { - if (s != sizeof(ipv4_value_)) - { - std::length_error ex("multicast_enable_loopback socket option resize"); - asio::detail::throw_exception(ex); - } - ipv6_value_ = ipv4_value_ ? 1 : 0; - } - } - -private: - ipv4_value_type ipv4_value_; - ipv6_value_type ipv6_value_; -}; - -// Helper template for implementing unicast hops options. -template -class unicast_hops -{ -public: - // Default constructor. - unicast_hops() - : value_(0) - { - } - - // Construct with a specific option value. - explicit unicast_hops(int v) - : value_(v) - { - } - - // Set the value of the option. - unicast_hops& operator=(int v) - { - value_ = v; - return *this; - } - - // Get the current value of the option. - int value() const - { - return value_; - } - - // Get the level of the socket option. - template - int level(const Protocol& protocol) const - { - if (protocol.family() == PF_INET6) - return IPv6_Level; - return IPv4_Level; - } - - // Get the name of the socket option. - template - int name(const Protocol& protocol) const - { - if (protocol.family() == PF_INET6) - return IPv6_Name; - return IPv4_Name; - } - - // Get the address of the data. - template - int* data(const Protocol&) - { - return &value_; - } - - // Get the address of the data. - template - const int* data(const Protocol&) const - { - return &value_; - } - - // Get the size of the data. - template - std::size_t size(const Protocol&) const - { - return sizeof(value_); - } - - // Set the size of the data. - template - void resize(const Protocol&, std::size_t s) - { - if (s != sizeof(value_)) - { - std::length_error ex("unicast hops socket option resize"); - asio::detail::throw_exception(ex); - } -#if defined(__hpux) - if (value_ < 0) - value_ = value_ & 0xFF; -#endif - } - -private: - int value_; -}; - -// Helper template for implementing multicast hops options. -template -class multicast_hops -{ -public: -#if defined(ASIO_WINDOWS) && defined(UNDER_CE) - typedef int ipv4_value_type; -#else - typedef unsigned char ipv4_value_type; -#endif - typedef int ipv6_value_type; - - // Default constructor. - multicast_hops() - : ipv4_value_(0), - ipv6_value_(0) - { - } - - // Construct with a specific option value. - explicit multicast_hops(int v) - { - if (v < 0 || v > 255) - { - std::out_of_range ex("multicast hops value out of range"); - asio::detail::throw_exception(ex); - } - ipv4_value_ = (ipv4_value_type)v; - ipv6_value_ = v; - } - - // Set the value of the option. - multicast_hops& operator=(int v) - { - if (v < 0 || v > 255) - { - std::out_of_range ex("multicast hops value out of range"); - asio::detail::throw_exception(ex); - } - ipv4_value_ = (ipv4_value_type)v; - ipv6_value_ = v; - return *this; - } - - // Get the current value of the option. - int value() const - { - return ipv6_value_; - } - - // Get the level of the socket option. - template - int level(const Protocol& protocol) const - { - if (protocol.family() == PF_INET6) - return IPv6_Level; - return IPv4_Level; - } - - // Get the name of the socket option. - template - int name(const Protocol& protocol) const - { - if (protocol.family() == PF_INET6) - return IPv6_Name; - return IPv4_Name; - } - - // Get the address of the data. - template - void* data(const Protocol& protocol) - { - if (protocol.family() == PF_INET6) - return &ipv6_value_; - return &ipv4_value_; - } - - // Get the address of the data. - template - const void* data(const Protocol& protocol) const - { - if (protocol.family() == PF_INET6) - return &ipv6_value_; - return &ipv4_value_; - } - - // Get the size of the data. - template - std::size_t size(const Protocol& protocol) const - { - if (protocol.family() == PF_INET6) - return sizeof(ipv6_value_); - return sizeof(ipv4_value_); - } - - // Set the size of the data. - template - void resize(const Protocol& protocol, std::size_t s) - { - if (protocol.family() == PF_INET6) - { - if (s != sizeof(ipv6_value_)) - { - std::length_error ex("multicast hops socket option resize"); - asio::detail::throw_exception(ex); - } - if (ipv6_value_ < 0) - ipv4_value_ = 0; - else if (ipv6_value_ > 255) - ipv4_value_ = 255; - else - ipv4_value_ = (ipv4_value_type)ipv6_value_; - } - else - { - if (s != sizeof(ipv4_value_)) - { - std::length_error ex("multicast hops socket option resize"); - asio::detail::throw_exception(ex); - } - ipv6_value_ = ipv4_value_; - } - } - -private: - ipv4_value_type ipv4_value_; - ipv6_value_type ipv6_value_; -}; - -// Helper template for implementing ip_mreq-based options. -template -class multicast_request -{ -public: - // Default constructor. - multicast_request() - : ipv4_value_(), // Zero-initialisation gives the "any" address. - ipv6_value_() // Zero-initialisation gives the "any" address. - { - } - - // Construct with multicast address only. - explicit multicast_request(const address& multicast_address) - : ipv4_value_(), // Zero-initialisation gives the "any" address. - ipv6_value_() // Zero-initialisation gives the "any" address. - { - if (multicast_address.is_v6()) - { - using namespace std; // For memcpy. - address_v6 ipv6_address = multicast_address.to_v6(); - address_v6::bytes_type bytes = ipv6_address.to_bytes(); - memcpy(ipv6_value_.ipv6mr_multiaddr.s6_addr, bytes.data(), 16); - ipv6_value_.ipv6mr_interface = ipv6_address.scope_id(); - } - else - { - ipv4_value_.imr_multiaddr.s_addr = - asio::detail::socket_ops::host_to_network_long( - multicast_address.to_v4().to_uint()); - ipv4_value_.imr_interface.s_addr = - asio::detail::socket_ops::host_to_network_long( - address_v4::any().to_uint()); - } - } - - // Construct with multicast address and IPv4 address specifying an interface. - explicit multicast_request(const address_v4& multicast_address, - const address_v4& network_interface = address_v4::any()) - : ipv6_value_() // Zero-initialisation gives the "any" address. - { - ipv4_value_.imr_multiaddr.s_addr = - asio::detail::socket_ops::host_to_network_long( - multicast_address.to_uint()); - ipv4_value_.imr_interface.s_addr = - asio::detail::socket_ops::host_to_network_long( - network_interface.to_uint()); - } - - // Construct with multicast address and IPv6 network interface index. - explicit multicast_request( - const address_v6& multicast_address, - unsigned long network_interface = 0) - : ipv4_value_() // Zero-initialisation gives the "any" address. - { - using namespace std; // For memcpy. - address_v6::bytes_type bytes = multicast_address.to_bytes(); - memcpy(ipv6_value_.ipv6mr_multiaddr.s6_addr, bytes.data(), 16); - if (network_interface) - ipv6_value_.ipv6mr_interface = network_interface; - else - ipv6_value_.ipv6mr_interface = multicast_address.scope_id(); - } - - // Get the level of the socket option. - template - int level(const Protocol& protocol) const - { - if (protocol.family() == PF_INET6) - return IPv6_Level; - return IPv4_Level; - } - - // Get the name of the socket option. - template - int name(const Protocol& protocol) const - { - if (protocol.family() == PF_INET6) - return IPv6_Name; - return IPv4_Name; - } - - // Get the address of the option data. - template - const void* data(const Protocol& protocol) const - { - if (protocol.family() == PF_INET6) - return &ipv6_value_; - return &ipv4_value_; - } - - // Get the size of the option data. - template - std::size_t size(const Protocol& protocol) const - { - if (protocol.family() == PF_INET6) - return sizeof(ipv6_value_); - return sizeof(ipv4_value_); - } - -private: - asio::detail::in4_mreq_type ipv4_value_; - asio::detail::in6_mreq_type ipv6_value_; -}; - -// Helper template for implementing options that specify a network interface. -template -class network_interface -{ -public: - // Default constructor. - network_interface() - { - ipv4_value_.s_addr = - asio::detail::socket_ops::host_to_network_long( - address_v4::any().to_uint()); - ipv6_value_ = 0; - } - - // Construct with IPv4 interface. - explicit network_interface(const address_v4& ipv4_interface) - { - ipv4_value_.s_addr = - asio::detail::socket_ops::host_to_network_long( - ipv4_interface.to_uint()); - ipv6_value_ = 0; - } - - // Construct with IPv6 interface. - explicit network_interface(unsigned int ipv6_interface) - { - ipv4_value_.s_addr = - asio::detail::socket_ops::host_to_network_long( - address_v4::any().to_uint()); - ipv6_value_ = ipv6_interface; - } - - // Get the level of the socket option. - template - int level(const Protocol& protocol) const - { - if (protocol.family() == PF_INET6) - return IPv6_Level; - return IPv4_Level; - } - - // Get the name of the socket option. - template - int name(const Protocol& protocol) const - { - if (protocol.family() == PF_INET6) - return IPv6_Name; - return IPv4_Name; - } - - // Get the address of the option data. - template - const void* data(const Protocol& protocol) const - { - if (protocol.family() == PF_INET6) - return &ipv6_value_; - return &ipv4_value_; - } - - // Get the size of the option data. - template - std::size_t size(const Protocol& protocol) const - { - if (protocol.family() == PF_INET6) - return sizeof(ipv6_value_); - return sizeof(ipv4_value_); - } - -private: - asio::detail::in4_addr_type ipv4_value_; - unsigned int ipv6_value_; -}; - -} // namespace socket_option -} // namespace detail -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IP_DETAIL_SOCKET_OPTION_HPP diff --git a/tools/sdk/include/asio/asio/ip/host_name.hpp b/tools/sdk/include/asio/asio/ip/host_name.hpp deleted file mode 100644 index d06de5089ab..00000000000 --- a/tools/sdk/include/asio/asio/ip/host_name.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// -// ip/host_name.hpp -// ~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_HOST_NAME_HPP -#define ASIO_IP_HOST_NAME_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/error_code.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -/// Get the current host name. -ASIO_DECL std::string host_name(); - -/// Get the current host name. -ASIO_DECL std::string host_name(asio::error_code& ec); - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/ip/impl/host_name.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_IP_HOST_NAME_HPP diff --git a/tools/sdk/include/asio/asio/ip/icmp.hpp b/tools/sdk/include/asio/asio/ip/icmp.hpp deleted file mode 100644 index 92e1953f301..00000000000 --- a/tools/sdk/include/asio/asio/ip/icmp.hpp +++ /dev/null @@ -1,115 +0,0 @@ -// -// ip/icmp.hpp -// ~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_ICMP_HPP -#define ASIO_IP_ICMP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/basic_raw_socket.hpp" -#include "asio/ip/basic_endpoint.hpp" -#include "asio/ip/basic_resolver.hpp" -#include "asio/ip/basic_resolver_iterator.hpp" -#include "asio/ip/basic_resolver_query.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -/// Encapsulates the flags needed for ICMP. -/** - * The asio::ip::icmp class contains flags necessary for ICMP sockets. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Safe. - * - * @par Concepts: - * Protocol, InternetProtocol. - */ -class icmp -{ -public: - /// The type of a ICMP endpoint. - typedef basic_endpoint endpoint; - - /// Construct to represent the IPv4 ICMP protocol. - static icmp v4() - { - return icmp(ASIO_OS_DEF(IPPROTO_ICMP), - ASIO_OS_DEF(AF_INET)); - } - - /// Construct to represent the IPv6 ICMP protocol. - static icmp v6() - { - return icmp(ASIO_OS_DEF(IPPROTO_ICMPV6), - ASIO_OS_DEF(AF_INET6)); - } - - /// Obtain an identifier for the type of the protocol. - int type() const - { - return ASIO_OS_DEF(SOCK_RAW); - } - - /// Obtain an identifier for the protocol. - int protocol() const - { - return protocol_; - } - - /// Obtain an identifier for the protocol family. - int family() const - { - return family_; - } - - /// The ICMP socket type. - typedef basic_raw_socket socket; - - /// The ICMP resolver type. - typedef basic_resolver resolver; - - /// Compare two protocols for equality. - friend bool operator==(const icmp& p1, const icmp& p2) - { - return p1.protocol_ == p2.protocol_ && p1.family_ == p2.family_; - } - - /// Compare two protocols for inequality. - friend bool operator!=(const icmp& p1, const icmp& p2) - { - return p1.protocol_ != p2.protocol_ || p1.family_ != p2.family_; - } - -private: - // Construct with a specific family. - explicit icmp(int protocol_id, int protocol_family) - : protocol_(protocol_id), - family_(protocol_family) - { - } - - int protocol_; - int family_; -}; - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IP_ICMP_HPP diff --git a/tools/sdk/include/asio/asio/ip/impl/address.hpp b/tools/sdk/include/asio/asio/ip/impl/address.hpp deleted file mode 100644 index 085b93f7b51..00000000000 --- a/tools/sdk/include/asio/asio/ip/impl/address.hpp +++ /dev/null @@ -1,67 +0,0 @@ -// -// ip/impl/address.hpp -// ~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_IMPL_ADDRESS_HPP -#define ASIO_IP_IMPL_ADDRESS_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#if !defined(ASIO_NO_IOSTREAM) - -#include "asio/detail/throw_error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -#if !defined(ASIO_NO_DEPRECATED) - -inline address address::from_string(const char* str) -{ - return asio::ip::make_address(str); -} - -inline address address::from_string( - const char* str, asio::error_code& ec) -{ - return asio::ip::make_address(str, ec); -} - -inline address address::from_string(const std::string& str) -{ - return asio::ip::make_address(str); -} - -inline address address::from_string( - const std::string& str, asio::error_code& ec) -{ - return asio::ip::make_address(str, ec); -} - -#endif // !defined(ASIO_NO_DEPRECATED) - -template -std::basic_ostream& operator<<( - std::basic_ostream& os, const address& addr) -{ - return os << addr.to_string().c_str(); -} - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // !defined(ASIO_NO_IOSTREAM) - -#endif // ASIO_IP_IMPL_ADDRESS_HPP diff --git a/tools/sdk/include/asio/asio/ip/impl/address_v4.hpp b/tools/sdk/include/asio/asio/ip/impl/address_v4.hpp deleted file mode 100644 index d1cf407c30c..00000000000 --- a/tools/sdk/include/asio/asio/ip/impl/address_v4.hpp +++ /dev/null @@ -1,67 +0,0 @@ -// -// ip/impl/address_v4.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_IMPL_ADDRESS_V4_HPP -#define ASIO_IP_IMPL_ADDRESS_V4_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#if !defined(ASIO_NO_IOSTREAM) - -#include "asio/detail/throw_error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -#if !defined(ASIO_NO_DEPRECATED) - -inline address_v4 address_v4::from_string(const char* str) -{ - return asio::ip::make_address_v4(str); -} - -inline address_v4 address_v4::from_string( - const char* str, asio::error_code& ec) -{ - return asio::ip::make_address_v4(str, ec); -} - -inline address_v4 address_v4::from_string(const std::string& str) -{ - return asio::ip::make_address_v4(str); -} - -inline address_v4 address_v4::from_string( - const std::string& str, asio::error_code& ec) -{ - return asio::ip::make_address_v4(str, ec); -} - -#endif // !defined(ASIO_NO_DEPRECATED) - -template -std::basic_ostream& operator<<( - std::basic_ostream& os, const address_v4& addr) -{ - return os << addr.to_string().c_str(); -} - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // !defined(ASIO_NO_IOSTREAM) - -#endif // ASIO_IP_IMPL_ADDRESS_V4_HPP diff --git a/tools/sdk/include/asio/asio/ip/impl/address_v6.hpp b/tools/sdk/include/asio/asio/ip/impl/address_v6.hpp deleted file mode 100644 index 330eafd1fed..00000000000 --- a/tools/sdk/include/asio/asio/ip/impl/address_v6.hpp +++ /dev/null @@ -1,67 +0,0 @@ -// -// ip/impl/address_v6.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_IMPL_ADDRESS_V6_HPP -#define ASIO_IP_IMPL_ADDRESS_V6_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#if !defined(ASIO_NO_IOSTREAM) - -#include "asio/detail/throw_error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -#if !defined(ASIO_NO_DEPRECATED) - -inline address_v6 address_v6::from_string(const char* str) -{ - return asio::ip::make_address_v6(str); -} - -inline address_v6 address_v6::from_string( - const char* str, asio::error_code& ec) -{ - return asio::ip::make_address_v6(str, ec); -} - -inline address_v6 address_v6::from_string(const std::string& str) -{ - return asio::ip::make_address_v6(str); -} - -inline address_v6 address_v6::from_string( - const std::string& str, asio::error_code& ec) -{ - return asio::ip::make_address_v6(str, ec); -} - -#endif // !defined(ASIO_NO_DEPRECATED) - -template -std::basic_ostream& operator<<( - std::basic_ostream& os, const address_v6& addr) -{ - return os << addr.to_string().c_str(); -} - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // !defined(ASIO_NO_IOSTREAM) - -#endif // ASIO_IP_IMPL_ADDRESS_V6_HPP diff --git a/tools/sdk/include/asio/asio/ip/impl/basic_endpoint.hpp b/tools/sdk/include/asio/asio/ip/impl/basic_endpoint.hpp deleted file mode 100644 index 5680a438176..00000000000 --- a/tools/sdk/include/asio/asio/ip/impl/basic_endpoint.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// -// ip/impl/basic_endpoint.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_IMPL_BASIC_ENDPOINT_HPP -#define ASIO_IP_IMPL_BASIC_ENDPOINT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#if !defined(ASIO_NO_IOSTREAM) - -#include "asio/detail/throw_error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -template -std::basic_ostream& operator<<( - std::basic_ostream& os, - const basic_endpoint& endpoint) -{ - asio::ip::detail::endpoint tmp_ep(endpoint.address(), endpoint.port()); - return os << tmp_ep.to_string().c_str(); -} - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // !defined(ASIO_NO_IOSTREAM) - -#endif // ASIO_IP_IMPL_BASIC_ENDPOINT_HPP diff --git a/tools/sdk/include/asio/asio/ip/impl/network_v4.hpp b/tools/sdk/include/asio/asio/ip/impl/network_v4.hpp deleted file mode 100644 index 911a45c3fbe..00000000000 --- a/tools/sdk/include/asio/asio/ip/impl/network_v4.hpp +++ /dev/null @@ -1,54 +0,0 @@ -// -// ip/impl/network_v4.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2014 Oliver Kowalke (oliver dot kowalke at gmail dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_IMPL_NETWORK_V4_HPP -#define ASIO_IP_IMPL_NETWORK_V4_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#if !defined(ASIO_NO_IOSTREAM) - -#include "asio/detail/throw_error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -template -std::basic_ostream& operator<<( - std::basic_ostream& os, const network_v4& addr) -{ - asio::error_code ec; - std::string s = addr.to_string(ec); - if (ec) - { - if (os.exceptions() & std::basic_ostream::failbit) - asio::detail::throw_error(ec); - else - os.setstate(std::basic_ostream::failbit); - } - else - for (std::string::iterator i = s.begin(); i != s.end(); ++i) - os << os.widen(*i); - return os; -} - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // !defined(ASIO_NO_IOSTREAM) - -#endif // ASIO_IP_IMPL_NETWORK_V4_HPP diff --git a/tools/sdk/include/asio/asio/ip/impl/network_v6.hpp b/tools/sdk/include/asio/asio/ip/impl/network_v6.hpp deleted file mode 100644 index b0eedaded2e..00000000000 --- a/tools/sdk/include/asio/asio/ip/impl/network_v6.hpp +++ /dev/null @@ -1,53 +0,0 @@ -// -// ip/impl/network_v6.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_IMPL_NETWORK_V6_HPP -#define ASIO_IP_IMPL_NETWORK_V6_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#if !defined(ASIO_NO_IOSTREAM) - -#include "asio/detail/throw_error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -template -std::basic_ostream& operator<<( - std::basic_ostream& os, const network_v6& addr) -{ - asio::error_code ec; - std::string s = addr.to_string(ec); - if (ec) - { - if (os.exceptions() & std::basic_ostream::failbit) - asio::detail::throw_error(ec); - else - os.setstate(std::basic_ostream::failbit); - } - else - for (std::string::iterator i = s.begin(); i != s.end(); ++i) - os << os.widen(*i); - return os; -} - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // !defined(ASIO_NO_IOSTREAM) - -#endif // ASIO_IP_IMPL_NETWORK_V6_HPP diff --git a/tools/sdk/include/asio/asio/ip/multicast.hpp b/tools/sdk/include/asio/asio/ip/multicast.hpp deleted file mode 100644 index ea624e147b7..00000000000 --- a/tools/sdk/include/asio/asio/ip/multicast.hpp +++ /dev/null @@ -1,191 +0,0 @@ -// -// ip/multicast.hpp -// ~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_MULTICAST_HPP -#define ASIO_IP_MULTICAST_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/ip/detail/socket_option.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { -namespace multicast { - -/// Socket option to join a multicast group on a specified interface. -/** - * Implements the IPPROTO_IP/IP_ADD_MEMBERSHIP socket option. - * - * @par Examples - * Setting the option to join a multicast group: - * @code - * asio::ip::udp::socket socket(io_context); - * ... - * asio::ip::address multicast_address = - * asio::ip::address::from_string("225.0.0.1"); - * asio::ip::multicast::join_group option(multicast_address); - * socket.set_option(option); - * @endcode - * - * @par Concepts: - * SettableSocketOption. - */ -#if defined(GENERATING_DOCUMENTATION) -typedef implementation_defined join_group; -#else -typedef asio::ip::detail::socket_option::multicast_request< - ASIO_OS_DEF(IPPROTO_IP), - ASIO_OS_DEF(IP_ADD_MEMBERSHIP), - ASIO_OS_DEF(IPPROTO_IPV6), - ASIO_OS_DEF(IPV6_JOIN_GROUP)> join_group; -#endif - -/// Socket option to leave a multicast group on a specified interface. -/** - * Implements the IPPROTO_IP/IP_DROP_MEMBERSHIP socket option. - * - * @par Examples - * Setting the option to leave a multicast group: - * @code - * asio::ip::udp::socket socket(io_context); - * ... - * asio::ip::address multicast_address = - * asio::ip::address::from_string("225.0.0.1"); - * asio::ip::multicast::leave_group option(multicast_address); - * socket.set_option(option); - * @endcode - * - * @par Concepts: - * SettableSocketOption. - */ -#if defined(GENERATING_DOCUMENTATION) -typedef implementation_defined leave_group; -#else -typedef asio::ip::detail::socket_option::multicast_request< - ASIO_OS_DEF(IPPROTO_IP), - ASIO_OS_DEF(IP_DROP_MEMBERSHIP), - ASIO_OS_DEF(IPPROTO_IPV6), - ASIO_OS_DEF(IPV6_LEAVE_GROUP)> leave_group; -#endif - -/// Socket option for local interface to use for outgoing multicast packets. -/** - * Implements the IPPROTO_IP/IP_MULTICAST_IF socket option. - * - * @par Examples - * Setting the option: - * @code - * asio::ip::udp::socket socket(io_context); - * ... - * asio::ip::address_v4 local_interface = - * asio::ip::address_v4::from_string("1.2.3.4"); - * asio::ip::multicast::outbound_interface option(local_interface); - * socket.set_option(option); - * @endcode - * - * @par Concepts: - * SettableSocketOption. - */ -#if defined(GENERATING_DOCUMENTATION) -typedef implementation_defined outbound_interface; -#else -typedef asio::ip::detail::socket_option::network_interface< - ASIO_OS_DEF(IPPROTO_IP), - ASIO_OS_DEF(IP_MULTICAST_IF), - ASIO_OS_DEF(IPPROTO_IPV6), - ASIO_OS_DEF(IPV6_MULTICAST_IF)> outbound_interface; -#endif - -/// Socket option for time-to-live associated with outgoing multicast packets. -/** - * Implements the IPPROTO_IP/IP_MULTICAST_TTL socket option. - * - * @par Examples - * Setting the option: - * @code - * asio::ip::udp::socket socket(io_context); - * ... - * asio::ip::multicast::hops option(4); - * socket.set_option(option); - * @endcode - * - * @par - * Getting the current option value: - * @code - * asio::ip::udp::socket socket(io_context); - * ... - * asio::ip::multicast::hops option; - * socket.get_option(option); - * int ttl = option.value(); - * @endcode - * - * @par Concepts: - * GettableSocketOption, SettableSocketOption. - */ -#if defined(GENERATING_DOCUMENTATION) -typedef implementation_defined hops; -#else -typedef asio::ip::detail::socket_option::multicast_hops< - ASIO_OS_DEF(IPPROTO_IP), - ASIO_OS_DEF(IP_MULTICAST_TTL), - ASIO_OS_DEF(IPPROTO_IPV6), - ASIO_OS_DEF(IPV6_MULTICAST_HOPS)> hops; -#endif - -/// Socket option determining whether outgoing multicast packets will be -/// received on the same socket if it is a member of the multicast group. -/** - * Implements the IPPROTO_IP/IP_MULTICAST_LOOP socket option. - * - * @par Examples - * Setting the option: - * @code - * asio::ip::udp::socket socket(io_context); - * ... - * asio::ip::multicast::enable_loopback option(true); - * socket.set_option(option); - * @endcode - * - * @par - * Getting the current option value: - * @code - * asio::ip::udp::socket socket(io_context); - * ... - * asio::ip::multicast::enable_loopback option; - * socket.get_option(option); - * bool is_set = option.value(); - * @endcode - * - * @par Concepts: - * GettableSocketOption, SettableSocketOption. - */ -#if defined(GENERATING_DOCUMENTATION) -typedef implementation_defined enable_loopback; -#else -typedef asio::ip::detail::socket_option::multicast_enable_loopback< - ASIO_OS_DEF(IPPROTO_IP), - ASIO_OS_DEF(IP_MULTICAST_LOOP), - ASIO_OS_DEF(IPPROTO_IPV6), - ASIO_OS_DEF(IPV6_MULTICAST_LOOP)> enable_loopback; -#endif - -} // namespace multicast -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IP_MULTICAST_HPP diff --git a/tools/sdk/include/asio/asio/ip/network_v4.hpp b/tools/sdk/include/asio/asio/ip/network_v4.hpp deleted file mode 100644 index e38f60fe9ae..00000000000 --- a/tools/sdk/include/asio/asio/ip/network_v4.hpp +++ /dev/null @@ -1,261 +0,0 @@ -// -// ip/network_v4.hpp -// ~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2014 Oliver Kowalke (oliver dot kowalke at gmail dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_NETWORK_V4_HPP -#define ASIO_IP_NETWORK_V4_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/detail/string_view.hpp" -#include "asio/error_code.hpp" -#include "asio/ip/address_v4_range.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -/// Represents an IPv4 network. -/** - * The asio::ip::network_v4 class provides the ability to use and - * manipulate IP version 4 networks. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -class network_v4 -{ -public: - /// Default constructor. - network_v4() ASIO_NOEXCEPT - : address_(), - prefix_length_(0) - { - } - - /// Construct a network based on the specified address and prefix length. - ASIO_DECL network_v4(const address_v4& addr, - unsigned short prefix_len); - - /// Construct network based on the specified address and netmask. - ASIO_DECL network_v4(const address_v4& addr, - const address_v4& mask); - - /// Copy constructor. - network_v4(const network_v4& other) ASIO_NOEXCEPT - : address_(other.address_), - prefix_length_(other.prefix_length_) - { - } - -#if defined(ASIO_HAS_MOVE) - /// Move constructor. - network_v4(network_v4&& other) ASIO_NOEXCEPT - : address_(ASIO_MOVE_CAST(address_v4)(other.address_)), - prefix_length_(other.prefix_length_) - { - } -#endif // defined(ASIO_HAS_MOVE) - - /// Assign from another network. - network_v4& operator=(const network_v4& other) ASIO_NOEXCEPT - { - address_ = other.address_; - prefix_length_ = other.prefix_length_; - return *this; - } - -#if defined(ASIO_HAS_MOVE) - /// Move-assign from another network. - network_v4& operator=(network_v4&& other) ASIO_NOEXCEPT - { - address_ = ASIO_MOVE_CAST(address_v4)(other.address_); - prefix_length_ = other.prefix_length_; - return *this; - } -#endif // defined(ASIO_HAS_MOVE) - - /// Obtain the address object specified when the network object was created. - address_v4 address() const ASIO_NOEXCEPT - { - return address_; - } - - /// Obtain the prefix length that was specified when the network object was - /// created. - unsigned short prefix_length() const ASIO_NOEXCEPT - { - return prefix_length_; - } - - /// Obtain the netmask that was specified when the network object was created. - ASIO_DECL address_v4 netmask() const ASIO_NOEXCEPT; - - /// Obtain an address object that represents the network address. - address_v4 network() const ASIO_NOEXCEPT - { - return address_v4(address_.to_uint() & netmask().to_uint()); - } - - /// Obtain an address object that represents the network's broadcast address. - address_v4 broadcast() const ASIO_NOEXCEPT - { - return address_v4(network().to_uint() | (netmask().to_uint() ^ 0xFFFFFFFF)); - } - - /// Obtain an address range corresponding to the hosts in the network. - ASIO_DECL address_v4_range hosts() const ASIO_NOEXCEPT; - - /// Obtain the true network address, omitting any host bits. - network_v4 canonical() const ASIO_NOEXCEPT - { - return network_v4(network(), netmask()); - } - - /// Test if network is a valid host address. - bool is_host() const ASIO_NOEXCEPT - { - return prefix_length_ == 32; - } - - /// Test if a network is a real subnet of another network. - ASIO_DECL bool is_subnet_of(const network_v4& other) const; - - /// Get the network as an address in dotted decimal format. - ASIO_DECL std::string to_string() const; - - /// Get the network as an address in dotted decimal format. - ASIO_DECL std::string to_string(asio::error_code& ec) const; - - /// Compare two networks for equality. - friend bool operator==(const network_v4& a, const network_v4& b) - { - return a.address_ == b.address_ && a.prefix_length_ == b.prefix_length_; - } - - /// Compare two networks for inequality. - friend bool operator!=(const network_v4& a, const network_v4& b) - { - return !(a == b); - } - -private: - address_v4 address_; - unsigned short prefix_length_; -}; - -/// Create an IPv4 network from an address and prefix length. -/** - * @relates address_v4 - */ -inline network_v4 make_network_v4( - const address_v4& addr, unsigned short prefix_len) -{ - return network_v4(addr, prefix_len); -} - -/// Create an IPv4 network from an address and netmask. -/** - * @relates address_v4 - */ -inline network_v4 make_network_v4( - const address_v4& addr, const address_v4& mask) -{ - return network_v4(addr, mask); -} - -/// Create an IPv4 network from a string containing IP address and prefix -/// length. -/** - * @relates network_v4 - */ -ASIO_DECL network_v4 make_network_v4(const char* str); - -/// Create an IPv4 network from a string containing IP address and prefix -/// length. -/** - * @relates network_v4 - */ -ASIO_DECL network_v4 make_network_v4( - const char* str, asio::error_code& ec); - -/// Create an IPv4 network from a string containing IP address and prefix -/// length. -/** - * @relates network_v4 - */ -ASIO_DECL network_v4 make_network_v4(const std::string& str); - -/// Create an IPv4 network from a string containing IP address and prefix -/// length. -/** - * @relates network_v4 - */ -ASIO_DECL network_v4 make_network_v4( - const std::string& str, asio::error_code& ec); - -#if defined(ASIO_HAS_STRING_VIEW) \ - || defined(GENERATING_DOCUMENTATION) - -/// Create an IPv4 network from a string containing IP address and prefix -/// length. -/** - * @relates network_v4 - */ -ASIO_DECL network_v4 make_network_v4(string_view str); - -/// Create an IPv4 network from a string containing IP address and prefix -/// length. -/** - * @relates network_v4 - */ -ASIO_DECL network_v4 make_network_v4( - string_view str, asio::error_code& ec); - -#endif // defined(ASIO_HAS_STRING_VIEW) - // || defined(GENERATING_DOCUMENTATION) - -#if !defined(ASIO_NO_IOSTREAM) - -/// Output a network as a string. -/** - * Used to output a human-readable string for a specified network. - * - * @param os The output stream to which the string will be written. - * - * @param net The network to be written. - * - * @return The output stream. - * - * @relates asio::ip::address_v4 - */ -template -std::basic_ostream& operator<<( - std::basic_ostream& os, const network_v4& net); - -#endif // !defined(ASIO_NO_IOSTREAM) - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/ip/impl/network_v4.hpp" -#if defined(ASIO_HEADER_ONLY) -# include "asio/ip/impl/network_v4.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_IP_NETWORK_V4_HPP diff --git a/tools/sdk/include/asio/asio/ip/network_v6.hpp b/tools/sdk/include/asio/asio/ip/network_v6.hpp deleted file mode 100644 index 7b6b7e61389..00000000000 --- a/tools/sdk/include/asio/asio/ip/network_v6.hpp +++ /dev/null @@ -1,235 +0,0 @@ -// -// ip/network_v6.hpp -// ~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2014 Oliver Kowalke (oliver dot kowalke at gmail dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_NETWORK_V6_HPP -#define ASIO_IP_NETWORK_V6_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/detail/string_view.hpp" -#include "asio/error_code.hpp" -#include "asio/ip/address_v6_range.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -/// Represents an IPv6 network. -/** - * The asio::ip::network_v6 class provides the ability to use and - * manipulate IP version 6 networks. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -class network_v6 -{ -public: - /// Default constructor. - network_v6() ASIO_NOEXCEPT - : address_(), - prefix_length_(0) - { - } - - /// Construct a network based on the specified address and prefix length. - ASIO_DECL network_v6(const address_v6& addr, - unsigned short prefix_len); - - /// Copy constructor. - network_v6(const network_v6& other) ASIO_NOEXCEPT - : address_(other.address_), - prefix_length_(other.prefix_length_) - { - } - -#if defined(ASIO_HAS_MOVE) - /// Move constructor. - network_v6(network_v6&& other) ASIO_NOEXCEPT - : address_(ASIO_MOVE_CAST(address_v6)(other.address_)), - prefix_length_(other.prefix_length_) - { - } -#endif // defined(ASIO_HAS_MOVE) - - /// Assign from another network. - network_v6& operator=(const network_v6& other) ASIO_NOEXCEPT - { - address_ = other.address_; - prefix_length_ = other.prefix_length_; - return *this; - } - -#if defined(ASIO_HAS_MOVE) - /// Move-assign from another network. - network_v6& operator=(network_v6&& other) ASIO_NOEXCEPT - { - address_ = ASIO_MOVE_CAST(address_v6)(other.address_); - prefix_length_ = other.prefix_length_; - return *this; - } -#endif // defined(ASIO_HAS_MOVE) - - /// Obtain the address object specified when the network object was created. - address_v6 address() const ASIO_NOEXCEPT - { - return address_; - } - - /// Obtain the prefix length that was specified when the network object was - /// created. - unsigned short prefix_length() const ASIO_NOEXCEPT - { - return prefix_length_; - } - - /// Obtain an address object that represents the network address. - ASIO_DECL address_v6 network() const ASIO_NOEXCEPT; - - /// Obtain an address range corresponding to the hosts in the network. - ASIO_DECL address_v6_range hosts() const ASIO_NOEXCEPT; - - /// Obtain the true network address, omitting any host bits. - network_v6 canonical() const ASIO_NOEXCEPT - { - return network_v6(network(), prefix_length()); - } - - /// Test if network is a valid host address. - bool is_host() const ASIO_NOEXCEPT - { - return prefix_length_ == 128; - } - - /// Test if a network is a real subnet of another network. - ASIO_DECL bool is_subnet_of(const network_v6& other) const; - - /// Get the network as an address in dotted decimal format. - ASIO_DECL std::string to_string() const; - - /// Get the network as an address in dotted decimal format. - ASIO_DECL std::string to_string(asio::error_code& ec) const; - - /// Compare two networks for equality. - friend bool operator==(const network_v6& a, const network_v6& b) - { - return a.address_ == b.address_ && a.prefix_length_ == b.prefix_length_; - } - - /// Compare two networks for inequality. - friend bool operator!=(const network_v6& a, const network_v6& b) - { - return !(a == b); - } - -private: - address_v6 address_; - unsigned short prefix_length_; -}; - -/// Create an IPv6 network from an address and prefix length. -/** - * @relates address_v6 - */ -inline network_v6 make_network_v6( - const address_v6& addr, unsigned short prefix_len) -{ - return network_v6(addr, prefix_len); -} - -/// Create an IPv6 network from a string containing IP address and prefix -/// length. -/** - * @relates network_v6 - */ -ASIO_DECL network_v6 make_network_v6(const char* str); - -/// Create an IPv6 network from a string containing IP address and prefix -/// length. -/** - * @relates network_v6 - */ -ASIO_DECL network_v6 make_network_v6( - const char* str, asio::error_code& ec); - -/// Create an IPv6 network from a string containing IP address and prefix -/// length. -/** - * @relates network_v6 - */ -ASIO_DECL network_v6 make_network_v6(const std::string& str); - -/// Create an IPv6 network from a string containing IP address and prefix -/// length. -/** - * @relates network_v6 - */ -ASIO_DECL network_v6 make_network_v6( - const std::string& str, asio::error_code& ec); - -#if defined(ASIO_HAS_STRING_VIEW) \ - || defined(GENERATING_DOCUMENTATION) - -/// Create an IPv6 network from a string containing IP address and prefix -/// length. -/** - * @relates network_v6 - */ -ASIO_DECL network_v6 make_network_v6(string_view str); - -/// Create an IPv6 network from a string containing IP address and prefix -/// length. -/** - * @relates network_v6 - */ -ASIO_DECL network_v6 make_network_v6( - string_view str, asio::error_code& ec); - -#endif // defined(ASIO_HAS_STRING_VIEW) - // || defined(GENERATING_DOCUMENTATION) - -#if !defined(ASIO_NO_IOSTREAM) - -/// Output a network as a string. -/** - * Used to output a human-readable string for a specified network. - * - * @param os The output stream to which the string will be written. - * - * @param net The network to be written. - * - * @return The output stream. - * - * @relates asio::ip::address_v6 - */ -template -std::basic_ostream& operator<<( - std::basic_ostream& os, const network_v6& net); - -#endif // !defined(ASIO_NO_IOSTREAM) - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/ip/impl/network_v6.hpp" -#if defined(ASIO_HEADER_ONLY) -# include "asio/ip/impl/network_v6.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_IP_NETWORK_V6_HPP diff --git a/tools/sdk/include/asio/asio/ip/resolver_base.hpp b/tools/sdk/include/asio/asio/ip/resolver_base.hpp deleted file mode 100644 index d32c9110d2b..00000000000 --- a/tools/sdk/include/asio/asio/ip/resolver_base.hpp +++ /dev/null @@ -1,129 +0,0 @@ -// -// ip/resolver_base.hpp -// ~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_RESOLVER_BASE_HPP -#define ASIO_IP_RESOLVER_BASE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/socket_types.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -/// The resolver_base class is used as a base for the basic_resolver class -/// templates to provide a common place to define the flag constants. -class resolver_base -{ -public: -#if defined(GENERATING_DOCUMENTATION) - /// A bitmask type (C++ Std [lib.bitmask.types]). - typedef unspecified flags; - - /// Determine the canonical name of the host specified in the query. - static const flags canonical_name = implementation_defined; - - /// Indicate that returned endpoint is intended for use as a locally bound - /// socket endpoint. - static const flags passive = implementation_defined; - - /// Host name should be treated as a numeric string defining an IPv4 or IPv6 - /// address and no name resolution should be attempted. - static const flags numeric_host = implementation_defined; - - /// Service name should be treated as a numeric string defining a port number - /// and no name resolution should be attempted. - static const flags numeric_service = implementation_defined; - - /// If the query protocol family is specified as IPv6, return IPv4-mapped - /// IPv6 addresses on finding no IPv6 addresses. - static const flags v4_mapped = implementation_defined; - - /// If used with v4_mapped, return all matching IPv6 and IPv4 addresses. - static const flags all_matching = implementation_defined; - - /// Only return IPv4 addresses if a non-loopback IPv4 address is configured - /// for the system. Only return IPv6 addresses if a non-loopback IPv6 address - /// is configured for the system. - static const flags address_configured = implementation_defined; -#else - enum flags - { - canonical_name = ASIO_OS_DEF(AI_CANONNAME), - passive = ASIO_OS_DEF(AI_PASSIVE), - numeric_host = ASIO_OS_DEF(AI_NUMERICHOST), - numeric_service = ASIO_OS_DEF(AI_NUMERICSERV), - v4_mapped = ASIO_OS_DEF(AI_V4MAPPED), - all_matching = ASIO_OS_DEF(AI_ALL), - address_configured = ASIO_OS_DEF(AI_ADDRCONFIG) - }; - - // Implement bitmask operations as shown in C++ Std [lib.bitmask.types]. - - friend flags operator&(flags x, flags y) - { - return static_cast( - static_cast(x) & static_cast(y)); - } - - friend flags operator|(flags x, flags y) - { - return static_cast( - static_cast(x) | static_cast(y)); - } - - friend flags operator^(flags x, flags y) - { - return static_cast( - static_cast(x) ^ static_cast(y)); - } - - friend flags operator~(flags x) - { - return static_cast(~static_cast(x)); - } - - friend flags& operator&=(flags& x, flags y) - { - x = x & y; - return x; - } - - friend flags& operator|=(flags& x, flags y) - { - x = x | y; - return x; - } - - friend flags& operator^=(flags& x, flags y) - { - x = x ^ y; - return x; - } -#endif - -protected: - /// Protected destructor to prevent deletion through this type. - ~resolver_base() - { - } -}; - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IP_RESOLVER_BASE_HPP diff --git a/tools/sdk/include/asio/asio/ip/resolver_query_base.hpp b/tools/sdk/include/asio/asio/ip/resolver_query_base.hpp deleted file mode 100644 index be368589ed7..00000000000 --- a/tools/sdk/include/asio/asio/ip/resolver_query_base.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// -// ip/resolver_query_base.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_RESOLVER_QUERY_BASE_HPP -#define ASIO_IP_RESOLVER_QUERY_BASE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/ip/resolver_base.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -/// The resolver_query_base class is used as a base for the -/// basic_resolver_query class templates to provide a common place to define -/// the flag constants. -class resolver_query_base : public resolver_base -{ -protected: - /// Protected destructor to prevent deletion through this type. - ~resolver_query_base() - { - } -}; - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IP_RESOLVER_QUERY_BASE_HPP diff --git a/tools/sdk/include/asio/asio/ip/resolver_service.hpp b/tools/sdk/include/asio/asio/ip/resolver_service.hpp deleted file mode 100644 index 519d72dbb11..00000000000 --- a/tools/sdk/include/asio/asio/ip/resolver_service.hpp +++ /dev/null @@ -1,200 +0,0 @@ -// -// ip/resolver_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_RESOLVER_SERVICE_HPP -#define ASIO_IP_RESOLVER_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) - -#include "asio/async_result.hpp" -#include "asio/error_code.hpp" -#include "asio/io_context.hpp" -#include "asio/ip/basic_resolver_iterator.hpp" -#include "asio/ip/basic_resolver_query.hpp" -#include "asio/ip/basic_resolver_results.hpp" - -#if defined(ASIO_WINDOWS_RUNTIME) -# include "asio/detail/winrt_resolver_service.hpp" -#else -# include "asio/detail/resolver_service.hpp" -#endif - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -/// Default service implementation for a resolver. -template -class resolver_service -#if defined(GENERATING_DOCUMENTATION) - : public asio::io_context::service -#else - : public asio::detail::service_base< - resolver_service > -#endif -{ -public: -#if defined(GENERATING_DOCUMENTATION) - /// The unique service identifier. - static asio::io_context::id id; -#endif - - /// The protocol type. - typedef InternetProtocol protocol_type; - - /// The endpoint type. - typedef typename InternetProtocol::endpoint endpoint_type; - - /// The query type. - typedef basic_resolver_query query_type; - - /// The iterator type. - typedef basic_resolver_iterator iterator_type; - - /// The results type. - typedef basic_resolver_results results_type; - -private: - // The type of the platform-specific implementation. -#if defined(ASIO_WINDOWS_RUNTIME) - typedef asio::detail::winrt_resolver_service - service_impl_type; -#else - typedef asio::detail::resolver_service - service_impl_type; -#endif - -public: - /// The type of a resolver implementation. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined implementation_type; -#else - typedef typename service_impl_type::implementation_type implementation_type; -#endif - - /// Construct a new resolver service for the specified io_context. - explicit resolver_service(asio::io_context& io_context) - : asio::detail::service_base< - resolver_service >(io_context), - service_impl_(io_context) - { - } - - /// Construct a new resolver implementation. - void construct(implementation_type& impl) - { - service_impl_.construct(impl); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a new resolver implementation. - void move_construct(implementation_type& impl, - implementation_type& other_impl) - { - service_impl_.move_construct(impl, other_impl); - } - - /// Move-assign from another resolver implementation. - void move_assign(implementation_type& impl, - resolver_service& other_service, - implementation_type& other_impl) - { - service_impl_.move_assign(impl, other_service.service_impl_, other_impl); - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destroy a resolver implementation. - void destroy(implementation_type& impl) - { - service_impl_.destroy(impl); - } - - /// Cancel pending asynchronous operations. - void cancel(implementation_type& impl) - { - service_impl_.cancel(impl); - } - - /// Resolve a query to a list of entries. - results_type resolve(implementation_type& impl, const query_type& query, - asio::error_code& ec) - { - return service_impl_.resolve(impl, query, ec); - } - - /// Asynchronously resolve a query to a list of entries. - template - ASIO_INITFN_RESULT_TYPE(ResolveHandler, - void (asio::error_code, results_type)) - async_resolve(implementation_type& impl, const query_type& query, - ASIO_MOVE_ARG(ResolveHandler) handler) - { - asio::async_completion init(handler); - - service_impl_.async_resolve(impl, query, init.completion_handler); - - return init.result.get(); - } - - /// Resolve an endpoint to a list of entries. - results_type resolve(implementation_type& impl, - const endpoint_type& endpoint, asio::error_code& ec) - { - return service_impl_.resolve(impl, endpoint, ec); - } - - /// Asynchronously resolve an endpoint to a list of entries. - template - ASIO_INITFN_RESULT_TYPE(ResolveHandler, - void (asio::error_code, results_type)) - async_resolve(implementation_type& impl, const endpoint_type& endpoint, - ASIO_MOVE_ARG(ResolveHandler) handler) - { - asio::async_completion init(handler); - - service_impl_.async_resolve(impl, endpoint, init.completion_handler); - - return init.result.get(); - } - -private: - // Destroy all user-defined handler objects owned by the service. - void shutdown() - { - service_impl_.shutdown(); - } - - // Perform any fork-related housekeeping. - void notify_fork(asio::io_context::fork_event event) - { - service_impl_.notify_fork(event); - } - - // The platform-specific implementation. - service_impl_type service_impl_; -}; - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_IP_RESOLVER_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/ip/tcp.hpp b/tools/sdk/include/asio/asio/ip/tcp.hpp deleted file mode 100644 index f1adeb02c80..00000000000 --- a/tools/sdk/include/asio/asio/ip/tcp.hpp +++ /dev/null @@ -1,155 +0,0 @@ -// -// ip/tcp.hpp -// ~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_TCP_HPP -#define ASIO_IP_TCP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/basic_socket_acceptor.hpp" -#include "asio/basic_socket_iostream.hpp" -#include "asio/basic_stream_socket.hpp" -#include "asio/detail/socket_option.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/ip/basic_endpoint.hpp" -#include "asio/ip/basic_resolver.hpp" -#include "asio/ip/basic_resolver_iterator.hpp" -#include "asio/ip/basic_resolver_query.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -/// Encapsulates the flags needed for TCP. -/** - * The asio::ip::tcp class contains flags necessary for TCP sockets. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Safe. - * - * @par Concepts: - * Protocol, InternetProtocol. - */ -class tcp -{ -public: - /// The type of a TCP endpoint. - typedef basic_endpoint endpoint; - - /// Construct to represent the IPv4 TCP protocol. - static tcp v4() - { - return tcp(ASIO_OS_DEF(AF_INET)); - } - - /// Construct to represent the IPv6 TCP protocol. - static tcp v6() - { - return tcp(ASIO_OS_DEF(AF_INET6)); - } - - /// Obtain an identifier for the type of the protocol. - int type() const - { - return ASIO_OS_DEF(SOCK_STREAM); - } - - /// Obtain an identifier for the protocol. - int protocol() const - { - return ASIO_OS_DEF(IPPROTO_TCP); - } - - /// Obtain an identifier for the protocol family. - int family() const - { - return family_; - } - - /// The TCP socket type. - typedef basic_stream_socket socket; - - /// The TCP acceptor type. - typedef basic_socket_acceptor acceptor; - - /// The TCP resolver type. - typedef basic_resolver resolver; - -#if !defined(ASIO_NO_IOSTREAM) - /// The TCP iostream type. - typedef basic_socket_iostream iostream; -#endif // !defined(ASIO_NO_IOSTREAM) - - /// Socket option for disabling the Nagle algorithm. - /** - * Implements the IPPROTO_TCP/TCP_NODELAY socket option. - * - * @par Examples - * Setting the option: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::ip::tcp::no_delay option(true); - * socket.set_option(option); - * @endcode - * - * @par - * Getting the current option value: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::ip::tcp::no_delay option; - * socket.get_option(option); - * bool is_set = option.value(); - * @endcode - * - * @par Concepts: - * Socket_Option, Boolean_Socket_Option. - */ -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined no_delay; -#else - typedef asio::detail::socket_option::boolean< - ASIO_OS_DEF(IPPROTO_TCP), ASIO_OS_DEF(TCP_NODELAY)> no_delay; -#endif - - /// Compare two protocols for equality. - friend bool operator==(const tcp& p1, const tcp& p2) - { - return p1.family_ == p2.family_; - } - - /// Compare two protocols for inequality. - friend bool operator!=(const tcp& p1, const tcp& p2) - { - return p1.family_ != p2.family_; - } - -private: - // Construct with a specific family. - explicit tcp(int protocol_family) - : family_(protocol_family) - { - } - - int family_; -}; - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IP_TCP_HPP diff --git a/tools/sdk/include/asio/asio/ip/udp.hpp b/tools/sdk/include/asio/asio/ip/udp.hpp deleted file mode 100644 index 1c93f9b0a5a..00000000000 --- a/tools/sdk/include/asio/asio/ip/udp.hpp +++ /dev/null @@ -1,111 +0,0 @@ -// -// ip/udp.hpp -// ~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_UDP_HPP -#define ASIO_IP_UDP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/basic_datagram_socket.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/ip/basic_endpoint.hpp" -#include "asio/ip/basic_resolver.hpp" -#include "asio/ip/basic_resolver_iterator.hpp" -#include "asio/ip/basic_resolver_query.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -/// Encapsulates the flags needed for UDP. -/** - * The asio::ip::udp class contains flags necessary for UDP sockets. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Safe. - * - * @par Concepts: - * Protocol, InternetProtocol. - */ -class udp -{ -public: - /// The type of a UDP endpoint. - typedef basic_endpoint endpoint; - - /// Construct to represent the IPv4 UDP protocol. - static udp v4() - { - return udp(ASIO_OS_DEF(AF_INET)); - } - - /// Construct to represent the IPv6 UDP protocol. - static udp v6() - { - return udp(ASIO_OS_DEF(AF_INET6)); - } - - /// Obtain an identifier for the type of the protocol. - int type() const - { - return ASIO_OS_DEF(SOCK_DGRAM); - } - - /// Obtain an identifier for the protocol. - int protocol() const - { - return ASIO_OS_DEF(IPPROTO_UDP); - } - - /// Obtain an identifier for the protocol family. - int family() const - { - return family_; - } - - /// The UDP socket type. - typedef basic_datagram_socket socket; - - /// The UDP resolver type. - typedef basic_resolver resolver; - - /// Compare two protocols for equality. - friend bool operator==(const udp& p1, const udp& p2) - { - return p1.family_ == p2.family_; - } - - /// Compare two protocols for inequality. - friend bool operator!=(const udp& p1, const udp& p2) - { - return p1.family_ != p2.family_; - } - -private: - // Construct with a specific family. - explicit udp(int protocol_family) - : family_(protocol_family) - { - } - - int family_; -}; - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IP_UDP_HPP diff --git a/tools/sdk/include/asio/asio/ip/unicast.hpp b/tools/sdk/include/asio/asio/ip/unicast.hpp deleted file mode 100644 index 14e3e489fd4..00000000000 --- a/tools/sdk/include/asio/asio/ip/unicast.hpp +++ /dev/null @@ -1,70 +0,0 @@ -// -// ip/unicast.hpp -// ~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_UNICAST_HPP -#define ASIO_IP_UNICAST_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/ip/detail/socket_option.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { -namespace unicast { - -/// Socket option for time-to-live associated with outgoing unicast packets. -/** - * Implements the IPPROTO_IP/IP_UNICAST_TTL socket option. - * - * @par Examples - * Setting the option: - * @code - * asio::ip::udp::socket socket(io_context); - * ... - * asio::ip::unicast::hops option(4); - * socket.set_option(option); - * @endcode - * - * @par - * Getting the current option value: - * @code - * asio::ip::udp::socket socket(io_context); - * ... - * asio::ip::unicast::hops option; - * socket.get_option(option); - * int ttl = option.value(); - * @endcode - * - * @par Concepts: - * GettableSocketOption, SettableSocketOption. - */ -#if defined(GENERATING_DOCUMENTATION) -typedef implementation_defined hops; -#else -typedef asio::ip::detail::socket_option::unicast_hops< - ASIO_OS_DEF(IPPROTO_IP), - ASIO_OS_DEF(IP_TTL), - ASIO_OS_DEF(IPPROTO_IPV6), - ASIO_OS_DEF(IPV6_UNICAST_HOPS)> hops; -#endif - -} // namespace unicast -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IP_UNICAST_HPP diff --git a/tools/sdk/include/asio/asio/ip/v6_only.hpp b/tools/sdk/include/asio/asio/ip/v6_only.hpp deleted file mode 100644 index ac7234edcba..00000000000 --- a/tools/sdk/include/asio/asio/ip/v6_only.hpp +++ /dev/null @@ -1,69 +0,0 @@ -// -// ip/v6_only.hpp -// ~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IP_V6_ONLY_HPP -#define ASIO_IP_V6_ONLY_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/socket_option.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ip { - -/// Socket option for determining whether an IPv6 socket supports IPv6 -/// communication only. -/** - * Implements the IPPROTO_IPV6/IP_V6ONLY socket option. - * - * @par Examples - * Setting the option: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::ip::v6_only option(true); - * socket.set_option(option); - * @endcode - * - * @par - * Getting the current option value: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::ip::v6_only option; - * socket.get_option(option); - * bool v6_only = option.value(); - * @endcode - * - * @par Concepts: - * GettableSocketOption, SettableSocketOption. - */ -#if defined(GENERATING_DOCUMENTATION) -typedef implementation_defined v6_only; -#elif defined(IPV6_V6ONLY) -typedef asio::detail::socket_option::boolean< - IPPROTO_IPV6, IPV6_V6ONLY> v6_only; -#else -typedef asio::detail::socket_option::boolean< - asio::detail::custom_socket_option_level, - asio::detail::always_fail_option> v6_only; -#endif - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IP_V6_ONLY_HPP diff --git a/tools/sdk/include/asio/asio/is_executor.hpp b/tools/sdk/include/asio/asio/is_executor.hpp deleted file mode 100644 index a1661ec46b6..00000000000 --- a/tools/sdk/include/asio/asio/is_executor.hpp +++ /dev/null @@ -1,46 +0,0 @@ -// -// is_executor.hpp -// ~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IS_EXECUTOR_HPP -#define ASIO_IS_EXECUTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/is_executor.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// The is_executor trait detects whether a type T meets the Executor type -/// requirements. -/** - * Class template @c is_executor is a UnaryTypeTrait that is derived from @c - * true_type if the type @c T meets the syntactic requirements for Executor, - * otherwise @c false_type. - */ -template -struct is_executor -#if defined(GENERATING_DOCUMENTATION) - : integral_constant -#else // defined(GENERATING_DOCUMENTATION) - : asio::detail::is_executor -#endif // defined(GENERATING_DOCUMENTATION) -{ -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IS_EXECUTOR_HPP diff --git a/tools/sdk/include/asio/asio/is_read_buffered.hpp b/tools/sdk/include/asio/asio/is_read_buffered.hpp deleted file mode 100644 index c5a67b2da77..00000000000 --- a/tools/sdk/include/asio/asio/is_read_buffered.hpp +++ /dev/null @@ -1,59 +0,0 @@ -// -// is_read_buffered.hpp -// ~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IS_READ_BUFFERED_HPP -#define ASIO_IS_READ_BUFFERED_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/buffered_read_stream_fwd.hpp" -#include "asio/buffered_stream_fwd.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -namespace detail { - -template -char is_read_buffered_helper(buffered_stream* s); - -template -char is_read_buffered_helper(buffered_read_stream* s); - -struct is_read_buffered_big_type { char data[10]; }; -is_read_buffered_big_type is_read_buffered_helper(...); - -} // namespace detail - -/// The is_read_buffered class is a traits class that may be used to determine -/// whether a stream type supports buffering of read data. -template -class is_read_buffered -{ -public: -#if defined(GENERATING_DOCUMENTATION) - /// The value member is true only if the Stream type supports buffering of - /// read data. - static const bool value; -#else - ASIO_STATIC_CONSTANT(bool, - value = sizeof(detail::is_read_buffered_helper((Stream*)0)) == 1); -#endif -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IS_READ_BUFFERED_HPP diff --git a/tools/sdk/include/asio/asio/is_write_buffered.hpp b/tools/sdk/include/asio/asio/is_write_buffered.hpp deleted file mode 100644 index e237dd6f461..00000000000 --- a/tools/sdk/include/asio/asio/is_write_buffered.hpp +++ /dev/null @@ -1,59 +0,0 @@ -// -// is_write_buffered.hpp -// ~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_IS_WRITE_BUFFERED_HPP -#define ASIO_IS_WRITE_BUFFERED_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/buffered_stream_fwd.hpp" -#include "asio/buffered_write_stream_fwd.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -namespace detail { - -template -char is_write_buffered_helper(buffered_stream* s); - -template -char is_write_buffered_helper(buffered_write_stream* s); - -struct is_write_buffered_big_type { char data[10]; }; -is_write_buffered_big_type is_write_buffered_helper(...); - -} // namespace detail - -/// The is_write_buffered class is a traits class that may be used to determine -/// whether a stream type supports buffering of written data. -template -class is_write_buffered -{ -public: -#if defined(GENERATING_DOCUMENTATION) - /// The value member is true only if the Stream type supports buffering of - /// written data. - static const bool value; -#else - ASIO_STATIC_CONSTANT(bool, - value = sizeof(detail::is_write_buffered_helper((Stream*)0)) == 1); -#endif -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_IS_WRITE_BUFFERED_HPP diff --git a/tools/sdk/include/asio/asio/local/basic_endpoint.hpp b/tools/sdk/include/asio/asio/local/basic_endpoint.hpp deleted file mode 100644 index 94e470a4b72..00000000000 --- a/tools/sdk/include/asio/asio/local/basic_endpoint.hpp +++ /dev/null @@ -1,239 +0,0 @@ -// -// local/basic_endpoint.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Derived from a public domain implementation written by Daniel Casimiro. -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_LOCAL_BASIC_ENDPOINT_HPP -#define ASIO_LOCAL_BASIC_ENDPOINT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_LOCAL_SOCKETS) \ - || defined(GENERATING_DOCUMENTATION) - -#include "asio/local/detail/endpoint.hpp" - -#if !defined(ASIO_NO_IOSTREAM) -# include -#endif // !defined(ASIO_NO_IOSTREAM) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace local { - -/// Describes an endpoint for a UNIX socket. -/** - * The asio::local::basic_endpoint class template describes an endpoint - * that may be associated with a particular UNIX socket. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - * - * @par Concepts: - * Endpoint. - */ -template -class basic_endpoint -{ -public: - /// The protocol type associated with the endpoint. - typedef Protocol protocol_type; - - /// The type of the endpoint structure. This type is dependent on the - /// underlying implementation of the socket layer. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined data_type; -#else - typedef asio::detail::socket_addr_type data_type; -#endif - - /// Default constructor. - basic_endpoint() - { - } - - /// Construct an endpoint using the specified path name. - basic_endpoint(const char* path_name) - : impl_(path_name) - { - } - - /// Construct an endpoint using the specified path name. - basic_endpoint(const std::string& path_name) - : impl_(path_name) - { - } - - /// Copy constructor. - basic_endpoint(const basic_endpoint& other) - : impl_(other.impl_) - { - } - -#if defined(ASIO_HAS_MOVE) - /// Move constructor. - basic_endpoint(basic_endpoint&& other) - : impl_(other.impl_) - { - } -#endif // defined(ASIO_HAS_MOVE) - - /// Assign from another endpoint. - basic_endpoint& operator=(const basic_endpoint& other) - { - impl_ = other.impl_; - return *this; - } - -#if defined(ASIO_HAS_MOVE) - /// Move-assign from another endpoint. - basic_endpoint& operator=(basic_endpoint&& other) - { - impl_ = other.impl_; - return *this; - } -#endif // defined(ASIO_HAS_MOVE) - - /// The protocol associated with the endpoint. - protocol_type protocol() const - { - return protocol_type(); - } - - /// Get the underlying endpoint in the native type. - data_type* data() - { - return impl_.data(); - } - - /// Get the underlying endpoint in the native type. - const data_type* data() const - { - return impl_.data(); - } - - /// Get the underlying size of the endpoint in the native type. - std::size_t size() const - { - return impl_.size(); - } - - /// Set the underlying size of the endpoint in the native type. - void resize(std::size_t new_size) - { - impl_.resize(new_size); - } - - /// Get the capacity of the endpoint in the native type. - std::size_t capacity() const - { - return impl_.capacity(); - } - - /// Get the path associated with the endpoint. - std::string path() const - { - return impl_.path(); - } - - /// Set the path associated with the endpoint. - void path(const char* p) - { - impl_.path(p); - } - - /// Set the path associated with the endpoint. - void path(const std::string& p) - { - impl_.path(p); - } - - /// Compare two endpoints for equality. - friend bool operator==(const basic_endpoint& e1, - const basic_endpoint& e2) - { - return e1.impl_ == e2.impl_; - } - - /// Compare two endpoints for inequality. - friend bool operator!=(const basic_endpoint& e1, - const basic_endpoint& e2) - { - return !(e1.impl_ == e2.impl_); - } - - /// Compare endpoints for ordering. - friend bool operator<(const basic_endpoint& e1, - const basic_endpoint& e2) - { - return e1.impl_ < e2.impl_; - } - - /// Compare endpoints for ordering. - friend bool operator>(const basic_endpoint& e1, - const basic_endpoint& e2) - { - return e2.impl_ < e1.impl_; - } - - /// Compare endpoints for ordering. - friend bool operator<=(const basic_endpoint& e1, - const basic_endpoint& e2) - { - return !(e2 < e1); - } - - /// Compare endpoints for ordering. - friend bool operator>=(const basic_endpoint& e1, - const basic_endpoint& e2) - { - return !(e1 < e2); - } - -private: - // The underlying UNIX domain endpoint. - asio::local::detail::endpoint impl_; -}; - -/// Output an endpoint as a string. -/** - * Used to output a human-readable string for a specified endpoint. - * - * @param os The output stream to which the string will be written. - * - * @param endpoint The endpoint to be written. - * - * @return The output stream. - * - * @relates asio::local::basic_endpoint - */ -template -std::basic_ostream& operator<<( - std::basic_ostream& os, - const basic_endpoint& endpoint) -{ - os << endpoint.path(); - return os; -} - -} // namespace local -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_LOCAL_SOCKETS) - // || defined(GENERATING_DOCUMENTATION) - -#endif // ASIO_LOCAL_BASIC_ENDPOINT_HPP diff --git a/tools/sdk/include/asio/asio/local/connect_pair.hpp b/tools/sdk/include/asio/asio/local/connect_pair.hpp deleted file mode 100644 index 2f7c090edb1..00000000000 --- a/tools/sdk/include/asio/asio/local/connect_pair.hpp +++ /dev/null @@ -1,106 +0,0 @@ -// -// local/connect_pair.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_LOCAL_CONNECT_PAIR_HPP -#define ASIO_LOCAL_CONNECT_PAIR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_LOCAL_SOCKETS) \ - || defined(GENERATING_DOCUMENTATION) - -#include "asio/basic_socket.hpp" -#include "asio/detail/socket_ops.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/error.hpp" -#include "asio/local/basic_endpoint.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace local { - -/// Create a pair of connected sockets. -template -void connect_pair( - basic_socket& socket1, - basic_socket& socket2); - -/// Create a pair of connected sockets. -template -ASIO_SYNC_OP_VOID connect_pair( - basic_socket& socket1, - basic_socket& socket2, - asio::error_code& ec); - -template -inline void connect_pair( - basic_socket& socket1, - basic_socket& socket2) -{ - asio::error_code ec; - connect_pair(socket1, socket2, ec); - asio::detail::throw_error(ec, "connect_pair"); -} - -template -inline ASIO_SYNC_OP_VOID connect_pair( - basic_socket& socket1, - basic_socket& socket2, - asio::error_code& ec) -{ - // Check that this function is only being used with a UNIX domain socket. - asio::local::basic_endpoint* tmp - = static_cast(0); - (void)tmp; - - Protocol protocol; - asio::detail::socket_type sv[2]; - if (asio::detail::socket_ops::socketpair(protocol.family(), - protocol.type(), protocol.protocol(), sv, ec) - == asio::detail::socket_error_retval) - ASIO_SYNC_OP_VOID_RETURN(ec); - - socket1.assign(protocol, sv[0], ec); - if (ec) - { - asio::error_code temp_ec; - asio::detail::socket_ops::state_type state[2] = { 0, 0 }; - asio::detail::socket_ops::close(sv[0], state[0], true, temp_ec); - asio::detail::socket_ops::close(sv[1], state[1], true, temp_ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - socket2.assign(protocol, sv[1], ec); - if (ec) - { - asio::error_code temp_ec; - socket1.close(temp_ec); - asio::detail::socket_ops::state_type state = 0; - asio::detail::socket_ops::close(sv[1], state, true, temp_ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - ASIO_SYNC_OP_VOID_RETURN(ec); -} - -} // namespace local -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_LOCAL_SOCKETS) - // || defined(GENERATING_DOCUMENTATION) - -#endif // ASIO_LOCAL_CONNECT_PAIR_HPP diff --git a/tools/sdk/include/asio/asio/local/datagram_protocol.hpp b/tools/sdk/include/asio/asio/local/datagram_protocol.hpp deleted file mode 100644 index b87df2e5643..00000000000 --- a/tools/sdk/include/asio/asio/local/datagram_protocol.hpp +++ /dev/null @@ -1,80 +0,0 @@ -// -// local/datagram_protocol.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_LOCAL_DATAGRAM_PROTOCOL_HPP -#define ASIO_LOCAL_DATAGRAM_PROTOCOL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_LOCAL_SOCKETS) \ - || defined(GENERATING_DOCUMENTATION) - -#include "asio/basic_datagram_socket.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/local/basic_endpoint.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace local { - -/// Encapsulates the flags needed for datagram-oriented UNIX sockets. -/** - * The asio::local::datagram_protocol class contains flags necessary for - * datagram-oriented UNIX domain sockets. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Safe. - * - * @par Concepts: - * Protocol. - */ -class datagram_protocol -{ -public: - /// Obtain an identifier for the type of the protocol. - int type() const - { - return SOCK_DGRAM; - } - - /// Obtain an identifier for the protocol. - int protocol() const - { - return 0; - } - - /// Obtain an identifier for the protocol family. - int family() const - { - return AF_UNIX; - } - - /// The type of a UNIX domain endpoint. - typedef basic_endpoint endpoint; - - /// The UNIX domain socket type. - typedef basic_datagram_socket socket; -}; - -} // namespace local -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_LOCAL_SOCKETS) - // || defined(GENERATING_DOCUMENTATION) - -#endif // ASIO_LOCAL_DATAGRAM_PROTOCOL_HPP diff --git a/tools/sdk/include/asio/asio/local/detail/endpoint.hpp b/tools/sdk/include/asio/asio/local/detail/endpoint.hpp deleted file mode 100644 index 4870f3b9aa7..00000000000 --- a/tools/sdk/include/asio/asio/local/detail/endpoint.hpp +++ /dev/null @@ -1,133 +0,0 @@ -// -// local/detail/endpoint.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Derived from a public domain implementation written by Daniel Casimiro. -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_LOCAL_DETAIL_ENDPOINT_HPP -#define ASIO_LOCAL_DETAIL_ENDPOINT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_LOCAL_SOCKETS) - -#include -#include -#include "asio/detail/socket_types.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace local { -namespace detail { - -// Helper class for implementing a UNIX domain endpoint. -class endpoint -{ -public: - // Default constructor. - ASIO_DECL endpoint(); - - // Construct an endpoint using the specified path name. - ASIO_DECL endpoint(const char* path_name); - - // Construct an endpoint using the specified path name. - ASIO_DECL endpoint(const std::string& path_name); - - // Copy constructor. - endpoint(const endpoint& other) - : data_(other.data_), - path_length_(other.path_length_) - { - } - - // Assign from another endpoint. - endpoint& operator=(const endpoint& other) - { - data_ = other.data_; - path_length_ = other.path_length_; - return *this; - } - - // Get the underlying endpoint in the native type. - asio::detail::socket_addr_type* data() - { - return &data_.base; - } - - // Get the underlying endpoint in the native type. - const asio::detail::socket_addr_type* data() const - { - return &data_.base; - } - - // Get the underlying size of the endpoint in the native type. - std::size_t size() const - { - return path_length_ - + offsetof(asio::detail::sockaddr_un_type, sun_path); - } - - // Set the underlying size of the endpoint in the native type. - ASIO_DECL void resize(std::size_t size); - - // Get the capacity of the endpoint in the native type. - std::size_t capacity() const - { - return sizeof(asio::detail::sockaddr_un_type); - } - - // Get the path associated with the endpoint. - ASIO_DECL std::string path() const; - - // Set the path associated with the endpoint. - ASIO_DECL void path(const char* p); - - // Set the path associated with the endpoint. - ASIO_DECL void path(const std::string& p); - - // Compare two endpoints for equality. - ASIO_DECL friend bool operator==( - const endpoint& e1, const endpoint& e2); - - // Compare endpoints for ordering. - ASIO_DECL friend bool operator<( - const endpoint& e1, const endpoint& e2); - -private: - // The underlying UNIX socket address. - union data_union - { - asio::detail::socket_addr_type base; - asio::detail::sockaddr_un_type local; - } data_; - - // The length of the path associated with the endpoint. - std::size_t path_length_; - - // Initialise with a specified path. - ASIO_DECL void init(const char* path, std::size_t path_length); -}; - -} // namespace detail -} // namespace local -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/local/detail/impl/endpoint.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_HAS_LOCAL_SOCKETS) - -#endif // ASIO_LOCAL_DETAIL_ENDPOINT_HPP diff --git a/tools/sdk/include/asio/asio/local/stream_protocol.hpp b/tools/sdk/include/asio/asio/local/stream_protocol.hpp deleted file mode 100644 index e2ef5f3b95f..00000000000 --- a/tools/sdk/include/asio/asio/local/stream_protocol.hpp +++ /dev/null @@ -1,90 +0,0 @@ -// -// local/stream_protocol.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_LOCAL_STREAM_PROTOCOL_HPP -#define ASIO_LOCAL_STREAM_PROTOCOL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_LOCAL_SOCKETS) \ - || defined(GENERATING_DOCUMENTATION) - -#include "asio/basic_socket_acceptor.hpp" -#include "asio/basic_socket_iostream.hpp" -#include "asio/basic_stream_socket.hpp" -#include "asio/detail/socket_types.hpp" -#include "asio/local/basic_endpoint.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace local { - -/// Encapsulates the flags needed for stream-oriented UNIX sockets. -/** - * The asio::local::stream_protocol class contains flags necessary for - * stream-oriented UNIX domain sockets. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Safe. - * - * @par Concepts: - * Protocol. - */ -class stream_protocol -{ -public: - /// Obtain an identifier for the type of the protocol. - int type() const - { - return SOCK_STREAM; - } - - /// Obtain an identifier for the protocol. - int protocol() const - { - return 0; - } - - /// Obtain an identifier for the protocol family. - int family() const - { - return AF_UNIX; - } - - /// The type of a UNIX domain endpoint. - typedef basic_endpoint endpoint; - - /// The UNIX domain socket type. - typedef basic_stream_socket socket; - - /// The UNIX domain acceptor type. - typedef basic_socket_acceptor acceptor; - -#if !defined(ASIO_NO_IOSTREAM) - /// The UNIX domain iostream type. - typedef basic_socket_iostream iostream; -#endif // !defined(ASIO_NO_IOSTREAM) -}; - -} // namespace local -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_LOCAL_SOCKETS) - // || defined(GENERATING_DOCUMENTATION) - -#endif // ASIO_LOCAL_STREAM_PROTOCOL_HPP diff --git a/tools/sdk/include/asio/asio/packaged_task.hpp b/tools/sdk/include/asio/asio/packaged_task.hpp deleted file mode 100644 index 1e20b42e4d2..00000000000 --- a/tools/sdk/include/asio/asio/packaged_task.hpp +++ /dev/null @@ -1,126 +0,0 @@ -// -// packaged_task.hpp -// ~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_PACKAGED_TASK_HPP -#define ASIO_PACKAGED_TASK_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_STD_FUTURE) \ - || defined(GENERATING_DOCUMENTATION) - -#include -#include "asio/async_result.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/detail/variadic_templates.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -#if defined(ASIO_HAS_VARIADIC_TEMPLATES) \ - || defined(GENERATING_DOCUMENTATION) - -/// Partial specialisation of @c async_result for @c std::packaged_task. -template -class async_result, Signature> -{ -public: - /// The packaged task is the concrete completion handler type. - typedef std::packaged_task completion_handler_type; - - /// The return type of the initiating function is the future obtained from - /// the packaged task. - typedef std::future return_type; - - /// The constructor extracts the future from the packaged task. - explicit async_result(completion_handler_type& h) - : future_(h.get_future()) - { - } - - /// Returns the packaged task's future. - return_type get() - { - return std::move(future_); - } - -private: - return_type future_; -}; - -#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) - // || defined(GENERATING_DOCUMENTATION) - -template -struct async_result, Signature> -{ - typedef std::packaged_task completion_handler_type; - typedef std::future return_type; - - explicit async_result(completion_handler_type& h) - : future_(h.get_future()) - { - } - - return_type get() - { - return std::move(future_); - } - -private: - return_type future_; -}; - -#define ASIO_PRIVATE_ASYNC_RESULT_DEF(n) \ - template \ - class async_result< \ - std::packaged_task, Signature> \ - { \ - public: \ - typedef std::packaged_task< \ - Result(ASIO_VARIADIC_TARGS(n))> \ - completion_handler_type; \ - \ - typedef std::future return_type; \ - \ - explicit async_result(completion_handler_type& h) \ - : future_(h.get_future()) \ - { \ - } \ - \ - return_type get() \ - { \ - return std::move(future_); \ - } \ - \ - private: \ - return_type future_; \ - }; \ - /**/ - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_ASYNC_RESULT_DEF) -#undef ASIO_PRIVATE_ASYNC_RESULT_DEF - -#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) - // || defined(GENERATING_DOCUMENTATION) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_STD_FUTURE) - // || defined(GENERATING_DOCUMENTATION) - -#endif // ASIO_PACKAGED_TASK_HPP diff --git a/tools/sdk/include/asio/asio/placeholders.hpp b/tools/sdk/include/asio/asio/placeholders.hpp deleted file mode 100644 index e71a21e7f10..00000000000 --- a/tools/sdk/include/asio/asio/placeholders.hpp +++ /dev/null @@ -1,151 +0,0 @@ -// -// placeholders.hpp -// ~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_PLACEHOLDERS_HPP -#define ASIO_PLACEHOLDERS_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_BOOST_BIND) -# include -#endif // defined(ASIO_HAS_BOOST_BIND) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace placeholders { - -#if defined(GENERATING_DOCUMENTATION) - -/// An argument placeholder, for use with boost::bind(), that corresponds to -/// the error argument of a handler for any of the asynchronous functions. -unspecified error; - -/// An argument placeholder, for use with boost::bind(), that corresponds to -/// the bytes_transferred argument of a handler for asynchronous functions such -/// as asio::basic_stream_socket::async_write_some or -/// asio::async_write. -unspecified bytes_transferred; - -/// An argument placeholder, for use with boost::bind(), that corresponds to -/// the iterator argument of a handler for asynchronous functions such as -/// asio::async_connect. -unspecified iterator; - -/// An argument placeholder, for use with boost::bind(), that corresponds to -/// the results argument of a handler for asynchronous functions such as -/// asio::basic_resolver::async_resolve. -unspecified results; - -/// An argument placeholder, for use with boost::bind(), that corresponds to -/// the results argument of a handler for asynchronous functions such as -/// asio::async_connect. -unspecified endpoint; - -/// An argument placeholder, for use with boost::bind(), that corresponds to -/// the signal_number argument of a handler for asynchronous functions such as -/// asio::signal_set::async_wait. -unspecified signal_number; - -#elif defined(ASIO_HAS_BOOST_BIND) -# if defined(__BORLANDC__) || defined(__GNUC__) - -inline boost::arg<1> error() -{ - return boost::arg<1>(); -} - -inline boost::arg<2> bytes_transferred() -{ - return boost::arg<2>(); -} - -inline boost::arg<2> iterator() -{ - return boost::arg<2>(); -} - -inline boost::arg<2> results() -{ - return boost::arg<2>(); -} - -inline boost::arg<2> endpoint() -{ - return boost::arg<2>(); -} - -inline boost::arg<2> signal_number() -{ - return boost::arg<2>(); -} - -# else - -namespace detail -{ - template - struct placeholder - { - static boost::arg& get() - { - static boost::arg result; - return result; - } - }; -} - -# if defined(ASIO_MSVC) && (ASIO_MSVC < 1400) - -static boost::arg<1>& error - = asio::placeholders::detail::placeholder<1>::get(); -static boost::arg<2>& bytes_transferred - = asio::placeholders::detail::placeholder<2>::get(); -static boost::arg<2>& iterator - = asio::placeholders::detail::placeholder<2>::get(); -static boost::arg<2>& results - = asio::placeholders::detail::placeholder<2>::get(); -static boost::arg<2>& endpoint - = asio::placeholders::detail::placeholder<2>::get(); -static boost::arg<2>& signal_number - = asio::placeholders::detail::placeholder<2>::get(); - -# else - -namespace -{ - boost::arg<1>& error - = asio::placeholders::detail::placeholder<1>::get(); - boost::arg<2>& bytes_transferred - = asio::placeholders::detail::placeholder<2>::get(); - boost::arg<2>& iterator - = asio::placeholders::detail::placeholder<2>::get(); - boost::arg<2>& results - = asio::placeholders::detail::placeholder<2>::get(); - boost::arg<2>& endpoint - = asio::placeholders::detail::placeholder<2>::get(); - boost::arg<2>& signal_number - = asio::placeholders::detail::placeholder<2>::get(); -} // namespace - -# endif -# endif -#endif - -} // namespace placeholders -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_PLACEHOLDERS_HPP diff --git a/tools/sdk/include/asio/asio/posix/basic_descriptor.hpp b/tools/sdk/include/asio/asio/posix/basic_descriptor.hpp deleted file mode 100644 index c15da632c95..00000000000 --- a/tools/sdk/include/asio/asio/posix/basic_descriptor.hpp +++ /dev/null @@ -1,582 +0,0 @@ -// -// posix/basic_descriptor.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_POSIX_BASIC_DESCRIPTOR_HPP -#define ASIO_POSIX_BASIC_DESCRIPTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) - -#if defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) \ - || defined(GENERATING_DOCUMENTATION) - -#include "asio/basic_io_object.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/error.hpp" -#include "asio/posix/descriptor_base.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace posix { - -/// Provides POSIX descriptor functionality. -/** - * The posix::basic_descriptor class template provides the ability to wrap a - * POSIX descriptor. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -template -class basic_descriptor - : public basic_io_object, - public descriptor_base -{ -public: - /// The native representation of a descriptor. - typedef typename DescriptorService::native_handle_type native_handle_type; - - /// A basic_descriptor is always the lowest layer. - typedef basic_descriptor lowest_layer_type; - - /// Construct a basic_descriptor without opening it. - /** - * This constructor creates a descriptor without opening it. - * - * @param io_context The io_context object that the descriptor will use to - * dispatch handlers for any asynchronous operations performed on the - * descriptor. - */ - explicit basic_descriptor(asio::io_context& io_context) - : basic_io_object(io_context) - { - } - - /// Construct a basic_descriptor on an existing native descriptor. - /** - * This constructor creates a descriptor object to hold an existing native - * descriptor. - * - * @param io_context The io_context object that the descriptor will use to - * dispatch handlers for any asynchronous operations performed on the - * descriptor. - * - * @param native_descriptor A native descriptor. - * - * @throws asio::system_error Thrown on failure. - */ - basic_descriptor(asio::io_context& io_context, - const native_handle_type& native_descriptor) - : basic_io_object(io_context) - { - asio::error_code ec; - this->get_service().assign(this->get_implementation(), - native_descriptor, ec); - asio::detail::throw_error(ec, "assign"); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a basic_descriptor from another. - /** - * This constructor moves a descriptor from one object to another. - * - * @param other The other basic_descriptor object from which the move will - * occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_descriptor(io_context&) constructor. - */ - basic_descriptor(basic_descriptor&& other) - : basic_io_object( - ASIO_MOVE_CAST(basic_descriptor)(other)) - { - } - - /// Move-assign a basic_descriptor from another. - /** - * This assignment operator moves a descriptor from one object to another. - * - * @param other The other basic_descriptor object from which the move will - * occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_descriptor(io_context&) constructor. - */ - basic_descriptor& operator=(basic_descriptor&& other) - { - basic_io_object::operator=( - ASIO_MOVE_CAST(basic_descriptor)(other)); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Get a reference to the lowest layer. - /** - * This function returns a reference to the lowest layer in a stack of - * layers. Since a basic_descriptor cannot contain any further layers, it - * simply returns a reference to itself. - * - * @return A reference to the lowest layer in the stack of layers. Ownership - * is not transferred to the caller. - */ - lowest_layer_type& lowest_layer() - { - return *this; - } - - /// Get a const reference to the lowest layer. - /** - * This function returns a const reference to the lowest layer in a stack of - * layers. Since a basic_descriptor cannot contain any further layers, it - * simply returns a reference to itself. - * - * @return A const reference to the lowest layer in the stack of layers. - * Ownership is not transferred to the caller. - */ - const lowest_layer_type& lowest_layer() const - { - return *this; - } - - /// Assign an existing native descriptor to the descriptor. - /* - * This function opens the descriptor to hold an existing native descriptor. - * - * @param native_descriptor A native descriptor. - * - * @throws asio::system_error Thrown on failure. - */ - void assign(const native_handle_type& native_descriptor) - { - asio::error_code ec; - this->get_service().assign(this->get_implementation(), - native_descriptor, ec); - asio::detail::throw_error(ec, "assign"); - } - - /// Assign an existing native descriptor to the descriptor. - /* - * This function opens the descriptor to hold an existing native descriptor. - * - * @param native_descriptor A native descriptor. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID assign(const native_handle_type& native_descriptor, - asio::error_code& ec) - { - this->get_service().assign( - this->get_implementation(), native_descriptor, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Determine whether the descriptor is open. - bool is_open() const - { - return this->get_service().is_open(this->get_implementation()); - } - - /// Close the descriptor. - /** - * This function is used to close the descriptor. Any asynchronous read or - * write operations will be cancelled immediately, and will complete with the - * asio::error::operation_aborted error. - * - * @throws asio::system_error Thrown on failure. Note that, even if - * the function indicates an error, the underlying descriptor is closed. - */ - void close() - { - asio::error_code ec; - this->get_service().close(this->get_implementation(), ec); - asio::detail::throw_error(ec, "close"); - } - - /// Close the descriptor. - /** - * This function is used to close the descriptor. Any asynchronous read or - * write operations will be cancelled immediately, and will complete with the - * asio::error::operation_aborted error. - * - * @param ec Set to indicate what error occurred, if any. Note that, even if - * the function indicates an error, the underlying descriptor is closed. - */ - ASIO_SYNC_OP_VOID close(asio::error_code& ec) - { - this->get_service().close(this->get_implementation(), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get the native descriptor representation. - /** - * This function may be used to obtain the underlying representation of the - * descriptor. This is intended to allow access to native descriptor - * functionality that is not otherwise provided. - */ - native_handle_type native_handle() - { - return this->get_service().native_handle(this->get_implementation()); - } - - /// Release ownership of the native descriptor implementation. - /** - * This function may be used to obtain the underlying representation of the - * descriptor. After calling this function, @c is_open() returns false. The - * caller is responsible for closing the descriptor. - * - * All outstanding asynchronous read or write operations will finish - * immediately, and the handlers for cancelled operations will be passed the - * asio::error::operation_aborted error. - */ - native_handle_type release() - { - return this->get_service().release(this->get_implementation()); - } - - /// Cancel all asynchronous operations associated with the descriptor. - /** - * This function causes all outstanding asynchronous read or write operations - * to finish immediately, and the handlers for cancelled operations will be - * passed the asio::error::operation_aborted error. - * - * @throws asio::system_error Thrown on failure. - */ - void cancel() - { - asio::error_code ec; - this->get_service().cancel(this->get_implementation(), ec); - asio::detail::throw_error(ec, "cancel"); - } - - /// Cancel all asynchronous operations associated with the descriptor. - /** - * This function causes all outstanding asynchronous read or write operations - * to finish immediately, and the handlers for cancelled operations will be - * passed the asio::error::operation_aborted error. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID cancel(asio::error_code& ec) - { - this->get_service().cancel(this->get_implementation(), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Perform an IO control command on the descriptor. - /** - * This function is used to execute an IO control command on the descriptor. - * - * @param command The IO control command to be performed on the descriptor. - * - * @throws asio::system_error Thrown on failure. - * - * @sa IoControlCommand @n - * asio::posix::descriptor_base::bytes_readable @n - * asio::posix::descriptor_base::non_blocking_io - * - * @par Example - * Getting the number of bytes ready to read: - * @code - * asio::posix::stream_descriptor descriptor(io_context); - * ... - * asio::posix::stream_descriptor::bytes_readable command; - * descriptor.io_control(command); - * std::size_t bytes_readable = command.get(); - * @endcode - */ - template - void io_control(IoControlCommand& command) - { - asio::error_code ec; - this->get_service().io_control(this->get_implementation(), command, ec); - asio::detail::throw_error(ec, "io_control"); - } - - /// Perform an IO control command on the descriptor. - /** - * This function is used to execute an IO control command on the descriptor. - * - * @param command The IO control command to be performed on the descriptor. - * - * @param ec Set to indicate what error occurred, if any. - * - * @sa IoControlCommand @n - * asio::posix::descriptor_base::bytes_readable @n - * asio::posix::descriptor_base::non_blocking_io - * - * @par Example - * Getting the number of bytes ready to read: - * @code - * asio::posix::stream_descriptor descriptor(io_context); - * ... - * asio::posix::stream_descriptor::bytes_readable command; - * asio::error_code ec; - * descriptor.io_control(command, ec); - * if (ec) - * { - * // An error occurred. - * } - * std::size_t bytes_readable = command.get(); - * @endcode - */ - template - ASIO_SYNC_OP_VOID io_control(IoControlCommand& command, - asio::error_code& ec) - { - this->get_service().io_control(this->get_implementation(), command, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Gets the non-blocking mode of the descriptor. - /** - * @returns @c true if the descriptor's synchronous operations will fail with - * asio::error::would_block if they are unable to perform the requested - * operation immediately. If @c false, synchronous operations will block - * until complete. - * - * @note The non-blocking mode has no effect on the behaviour of asynchronous - * operations. Asynchronous operations will never fail with the error - * asio::error::would_block. - */ - bool non_blocking() const - { - return this->get_service().non_blocking(this->get_implementation()); - } - - /// Sets the non-blocking mode of the descriptor. - /** - * @param mode If @c true, the descriptor's synchronous operations will fail - * with asio::error::would_block if they are unable to perform the - * requested operation immediately. If @c false, synchronous operations will - * block until complete. - * - * @throws asio::system_error Thrown on failure. - * - * @note The non-blocking mode has no effect on the behaviour of asynchronous - * operations. Asynchronous operations will never fail with the error - * asio::error::would_block. - */ - void non_blocking(bool mode) - { - asio::error_code ec; - this->get_service().non_blocking(this->get_implementation(), mode, ec); - asio::detail::throw_error(ec, "non_blocking"); - } - - /// Sets the non-blocking mode of the descriptor. - /** - * @param mode If @c true, the descriptor's synchronous operations will fail - * with asio::error::would_block if they are unable to perform the - * requested operation immediately. If @c false, synchronous operations will - * block until complete. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note The non-blocking mode has no effect on the behaviour of asynchronous - * operations. Asynchronous operations will never fail with the error - * asio::error::would_block. - */ - ASIO_SYNC_OP_VOID non_blocking( - bool mode, asio::error_code& ec) - { - this->get_service().non_blocking(this->get_implementation(), mode, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Gets the non-blocking mode of the native descriptor implementation. - /** - * This function is used to retrieve the non-blocking mode of the underlying - * native descriptor. This mode has no effect on the behaviour of the - * descriptor object's synchronous operations. - * - * @returns @c true if the underlying descriptor is in non-blocking mode and - * direct system calls may fail with asio::error::would_block (or the - * equivalent system error). - * - * @note The current non-blocking mode is cached by the descriptor object. - * Consequently, the return value may be incorrect if the non-blocking mode - * was set directly on the native descriptor. - */ - bool native_non_blocking() const - { - return this->get_service().native_non_blocking( - this->get_implementation()); - } - - /// Sets the non-blocking mode of the native descriptor implementation. - /** - * This function is used to modify the non-blocking mode of the underlying - * native descriptor. It has no effect on the behaviour of the descriptor - * object's synchronous operations. - * - * @param mode If @c true, the underlying descriptor is put into non-blocking - * mode and direct system calls may fail with asio::error::would_block - * (or the equivalent system error). - * - * @throws asio::system_error Thrown on failure. If the @c mode is - * @c false, but the current value of @c non_blocking() is @c true, this - * function fails with asio::error::invalid_argument, as the - * combination does not make sense. - */ - void native_non_blocking(bool mode) - { - asio::error_code ec; - this->get_service().native_non_blocking( - this->get_implementation(), mode, ec); - asio::detail::throw_error(ec, "native_non_blocking"); - } - - /// Sets the non-blocking mode of the native descriptor implementation. - /** - * This function is used to modify the non-blocking mode of the underlying - * native descriptor. It has no effect on the behaviour of the descriptor - * object's synchronous operations. - * - * @param mode If @c true, the underlying descriptor is put into non-blocking - * mode and direct system calls may fail with asio::error::would_block - * (or the equivalent system error). - * - * @param ec Set to indicate what error occurred, if any. If the @c mode is - * @c false, but the current value of @c non_blocking() is @c true, this - * function fails with asio::error::invalid_argument, as the - * combination does not make sense. - */ - ASIO_SYNC_OP_VOID native_non_blocking( - bool mode, asio::error_code& ec) - { - this->get_service().native_non_blocking( - this->get_implementation(), mode, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Wait for the descriptor to become ready to read, ready to write, or to - /// have pending error conditions. - /** - * This function is used to perform a blocking wait for a descriptor to enter - * a ready to read, write or error condition state. - * - * @param w Specifies the desired descriptor state. - * - * @par Example - * Waiting for a descriptor to become readable. - * @code - * asio::posix::stream_descriptor descriptor(io_context); - * ... - * descriptor.wait(asio::posix::stream_descriptor::wait_read); - * @endcode - */ - void wait(wait_type w) - { - asio::error_code ec; - this->get_service().wait(this->get_implementation(), w, ec); - asio::detail::throw_error(ec, "wait"); - } - - /// Wait for the descriptor to become ready to read, ready to write, or to - /// have pending error conditions. - /** - * This function is used to perform a blocking wait for a descriptor to enter - * a ready to read, write or error condition state. - * - * @param w Specifies the desired descriptor state. - * - * @param ec Set to indicate what error occurred, if any. - * - * @par Example - * Waiting for a descriptor to become readable. - * @code - * asio::posix::stream_descriptor descriptor(io_context); - * ... - * asio::error_code ec; - * descriptor.wait(asio::posix::stream_descriptor::wait_read, ec); - * @endcode - */ - ASIO_SYNC_OP_VOID wait(wait_type w, asio::error_code& ec) - { - this->get_service().wait(this->get_implementation(), w, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Asynchronously wait for the descriptor to become ready to read, ready to - /// write, or to have pending error conditions. - /** - * This function is used to perform an asynchronous wait for a descriptor to - * enter a ready to read, write or error condition state. - * - * @param w Specifies the desired descriptor state. - * - * @param handler The handler to be called when the wait operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error // Result of operation - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * @code - * void wait_handler(const asio::error_code& error) - * { - * if (!error) - * { - * // Wait succeeded. - * } - * } - * - * ... - * - * asio::posix::stream_descriptor descriptor(io_context); - * ... - * descriptor.async_wait( - * asio::posix::stream_descriptor::wait_read, - * wait_handler); - * @endcode - */ - template - ASIO_INITFN_RESULT_TYPE(WaitHandler, - void (asio::error_code)) - async_wait(wait_type w, ASIO_MOVE_ARG(WaitHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WaitHandler. - ASIO_WAIT_HANDLER_CHECK(WaitHandler, handler) type_check; - - return this->get_service().async_wait(this->get_implementation(), - w, ASIO_MOVE_CAST(WaitHandler)(handler)); - } - -protected: - /// Protected destructor to prevent deletion through this type. - ~basic_descriptor() - { - } -}; - -} // namespace posix -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) - // || defined(GENERATING_DOCUMENTATION) - -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_POSIX_BASIC_DESCRIPTOR_HPP diff --git a/tools/sdk/include/asio/asio/posix/basic_stream_descriptor.hpp b/tools/sdk/include/asio/asio/posix/basic_stream_descriptor.hpp deleted file mode 100644 index acd5cb6ae18..00000000000 --- a/tools/sdk/include/asio/asio/posix/basic_stream_descriptor.hpp +++ /dev/null @@ -1,362 +0,0 @@ -// -// posix/basic_stream_descriptor.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_POSIX_BASIC_STREAM_DESCRIPTOR_HPP -#define ASIO_POSIX_BASIC_STREAM_DESCRIPTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) - -#if defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) \ - || defined(GENERATING_DOCUMENTATION) - -#include -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/error.hpp" -#include "asio/posix/basic_descriptor.hpp" -#include "asio/posix/stream_descriptor_service.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace posix { - -/// Provides stream-oriented descriptor functionality. -/** - * The posix::basic_stream_descriptor class template provides asynchronous and - * blocking stream-oriented descriptor functionality. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - * - * @par Concepts: - * AsyncReadStream, AsyncWriteStream, Stream, SyncReadStream, SyncWriteStream. - */ -template -class basic_stream_descriptor - : public basic_descriptor -{ -public: - /// The native representation of a descriptor. - typedef typename StreamDescriptorService::native_handle_type - native_handle_type; - - /// Construct a basic_stream_descriptor without opening it. - /** - * This constructor creates a stream descriptor without opening it. The - * descriptor needs to be opened and then connected or accepted before data - * can be sent or received on it. - * - * @param io_context The io_context object that the stream descriptor will - * use to dispatch handlers for any asynchronous operations performed on the - * descriptor. - */ - explicit basic_stream_descriptor(asio::io_context& io_context) - : basic_descriptor(io_context) - { - } - - /// Construct a basic_stream_descriptor on an existing native descriptor. - /** - * This constructor creates a stream descriptor object to hold an existing - * native descriptor. - * - * @param io_context The io_context object that the stream descriptor will - * use to dispatch handlers for any asynchronous operations performed on the - * descriptor. - * - * @param native_descriptor The new underlying descriptor implementation. - * - * @throws asio::system_error Thrown on failure. - */ - basic_stream_descriptor(asio::io_context& io_context, - const native_handle_type& native_descriptor) - : basic_descriptor(io_context, native_descriptor) - { - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a basic_stream_descriptor from another. - /** - * This constructor moves a stream descriptor from one object to another. - * - * @param other The other basic_stream_descriptor object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_stream_descriptor(io_context&) constructor. - */ - basic_stream_descriptor(basic_stream_descriptor&& other) - : basic_descriptor( - ASIO_MOVE_CAST(basic_stream_descriptor)(other)) - { - } - - /// Move-assign a basic_stream_descriptor from another. - /** - * This assignment operator moves a stream descriptor from one object to - * another. - * - * @param other The other basic_stream_descriptor object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_stream_descriptor(io_context&) constructor. - */ - basic_stream_descriptor& operator=(basic_stream_descriptor&& other) - { - basic_descriptor::operator=( - ASIO_MOVE_CAST(basic_stream_descriptor)(other)); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Write some data to the descriptor. - /** - * This function is used to write data to the stream descriptor. The function - * call will block until one or more bytes of the data has been written - * successfully, or until an error occurs. - * - * @param buffers One or more data buffers to be written to the descriptor. - * - * @returns The number of bytes written. - * - * @throws asio::system_error Thrown on failure. An error code of - * asio::error::eof indicates that the connection was closed by the - * peer. - * - * @note The write_some operation may not transmit all of the data to the - * peer. Consider using the @ref write function if you need to ensure that - * all data is written before the blocking operation completes. - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code - * descriptor.write_some(asio::buffer(data, size)); - * @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t write_some(const ConstBufferSequence& buffers) - { - asio::error_code ec; - std::size_t s = this->get_service().write_some( - this->get_implementation(), buffers, ec); - asio::detail::throw_error(ec, "write_some"); - return s; - } - - /// Write some data to the descriptor. - /** - * This function is used to write data to the stream descriptor. The function - * call will block until one or more bytes of the data has been written - * successfully, or until an error occurs. - * - * @param buffers One or more data buffers to be written to the descriptor. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes written. Returns 0 if an error occurred. - * - * @note The write_some operation may not transmit all of the data to the - * peer. Consider using the @ref write function if you need to ensure that - * all data is written before the blocking operation completes. - */ - template - std::size_t write_some(const ConstBufferSequence& buffers, - asio::error_code& ec) - { - return this->get_service().write_some( - this->get_implementation(), buffers, ec); - } - - /// Start an asynchronous write. - /** - * This function is used to asynchronously write data to the stream - * descriptor. The function call always returns immediately. - * - * @param buffers One or more data buffers to be written to the descriptor. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the write operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes written. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The write operation may not transmit all of the data to the peer. - * Consider using the @ref async_write function if you need to ensure that all - * data is written before the asynchronous operation completes. - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code - * descriptor.async_write_some(asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_write_some(const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - - return this->get_service().async_write_some(this->get_implementation(), - buffers, ASIO_MOVE_CAST(WriteHandler)(handler)); - } - - /// Read some data from the descriptor. - /** - * This function is used to read data from the stream descriptor. The function - * call will block until one or more bytes of data has been read successfully, - * or until an error occurs. - * - * @param buffers One or more buffers into which the data will be read. - * - * @returns The number of bytes read. - * - * @throws asio::system_error Thrown on failure. An error code of - * asio::error::eof indicates that the connection was closed by the - * peer. - * - * @note The read_some operation may not read all of the requested number of - * bytes. Consider using the @ref read function if you need to ensure that - * the requested amount of data is read before the blocking operation - * completes. - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code - * descriptor.read_some(asio::buffer(data, size)); - * @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t read_some(const MutableBufferSequence& buffers) - { - asio::error_code ec; - std::size_t s = this->get_service().read_some( - this->get_implementation(), buffers, ec); - asio::detail::throw_error(ec, "read_some"); - return s; - } - - /// Read some data from the descriptor. - /** - * This function is used to read data from the stream descriptor. The function - * call will block until one or more bytes of data has been read successfully, - * or until an error occurs. - * - * @param buffers One or more buffers into which the data will be read. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes read. Returns 0 if an error occurred. - * - * @note The read_some operation may not read all of the requested number of - * bytes. Consider using the @ref read function if you need to ensure that - * the requested amount of data is read before the blocking operation - * completes. - */ - template - std::size_t read_some(const MutableBufferSequence& buffers, - asio::error_code& ec) - { - return this->get_service().read_some( - this->get_implementation(), buffers, ec); - } - - /// Start an asynchronous read. - /** - * This function is used to asynchronously read data from the stream - * descriptor. The function call always returns immediately. - * - * @param buffers One or more buffers into which the data will be read. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes read. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The read operation may not read all of the requested number of bytes. - * Consider using the @ref async_read function if you need to ensure that the - * requested amount of data is read before the asynchronous operation - * completes. - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code - * descriptor.async_read_some(asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_read_some(const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - - return this->get_service().async_read_some(this->get_implementation(), - buffers, ASIO_MOVE_CAST(ReadHandler)(handler)); - } -}; - -} // namespace posix -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) - // || defined(GENERATING_DOCUMENTATION) - -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_POSIX_BASIC_STREAM_DESCRIPTOR_HPP diff --git a/tools/sdk/include/asio/asio/posix/descriptor.hpp b/tools/sdk/include/asio/asio/posix/descriptor.hpp deleted file mode 100644 index d0cee1a2647..00000000000 --- a/tools/sdk/include/asio/asio/posix/descriptor.hpp +++ /dev/null @@ -1,644 +0,0 @@ -// -// posix/descriptor.hpp -// ~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_POSIX_DESCRIPTOR_HPP -#define ASIO_POSIX_DESCRIPTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_ENABLE_OLD_SERVICES) - -#if defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) \ - || defined(GENERATING_DOCUMENTATION) - -#include "asio/async_result.hpp" -#include "asio/basic_io_object.hpp" -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/reactive_descriptor_service.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" -#include "asio/posix/descriptor_base.hpp" - -#if defined(ASIO_HAS_MOVE) -# include -#endif // defined(ASIO_HAS_MOVE) - -#define ASIO_SVC_T asio::detail::reactive_descriptor_service - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace posix { - -/// Provides POSIX descriptor functionality. -/** - * The posix::descriptor class template provides the ability to wrap a - * POSIX descriptor. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -class descriptor - : ASIO_SVC_ACCESS basic_io_object, - public descriptor_base -{ -public: - /// The type of the executor associated with the object. - typedef io_context::executor_type executor_type; - - /// The native representation of a descriptor. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined native_handle_type; -#else - typedef ASIO_SVC_T::native_handle_type native_handle_type; -#endif - - /// A descriptor is always the lowest layer. - typedef descriptor lowest_layer_type; - - /// Construct a descriptor without opening it. - /** - * This constructor creates a descriptor without opening it. - * - * @param io_context The io_context object that the descriptor will use to - * dispatch handlers for any asynchronous operations performed on the - * descriptor. - */ - explicit descriptor(asio::io_context& io_context) - : basic_io_object(io_context) - { - } - - /// Construct a descriptor on an existing native descriptor. - /** - * This constructor creates a descriptor object to hold an existing native - * descriptor. - * - * @param io_context The io_context object that the descriptor will use to - * dispatch handlers for any asynchronous operations performed on the - * descriptor. - * - * @param native_descriptor A native descriptor. - * - * @throws asio::system_error Thrown on failure. - */ - descriptor(asio::io_context& io_context, - const native_handle_type& native_descriptor) - : basic_io_object(io_context) - { - asio::error_code ec; - this->get_service().assign(this->get_implementation(), - native_descriptor, ec); - asio::detail::throw_error(ec, "assign"); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a descriptor from another. - /** - * This constructor moves a descriptor from one object to another. - * - * @param other The other descriptor object from which the move will - * occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c descriptor(io_context&) constructor. - */ - descriptor(descriptor&& other) - : basic_io_object(std::move(other)) - { - } - - /// Move-assign a descriptor from another. - /** - * This assignment operator moves a descriptor from one object to another. - * - * @param other The other descriptor object from which the move will - * occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c descriptor(io_context&) constructor. - */ - descriptor& operator=(descriptor&& other) - { - basic_io_object::operator=(std::move(other)); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - /** - * This function may be used to obtain the io_context object that the I/O - * object uses to dispatch handlers for asynchronous operations. - * - * @return A reference to the io_context object that the I/O object will use - * to dispatch handlers. Ownership is not transferred to the caller. - */ - asio::io_context& get_io_context() - { - return basic_io_object::get_io_context(); - } - - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - /** - * This function may be used to obtain the io_context object that the I/O - * object uses to dispatch handlers for asynchronous operations. - * - * @return A reference to the io_context object that the I/O object will use - * to dispatch handlers. Ownership is not transferred to the caller. - */ - asio::io_context& get_io_service() - { - return basic_io_object::get_io_service(); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Get the executor associated with the object. - executor_type get_executor() ASIO_NOEXCEPT - { - return basic_io_object::get_executor(); - } - - /// Get a reference to the lowest layer. - /** - * This function returns a reference to the lowest layer in a stack of - * layers. Since a descriptor cannot contain any further layers, it - * simply returns a reference to itself. - * - * @return A reference to the lowest layer in the stack of layers. Ownership - * is not transferred to the caller. - */ - lowest_layer_type& lowest_layer() - { - return *this; - } - - /// Get a const reference to the lowest layer. - /** - * This function returns a const reference to the lowest layer in a stack of - * layers. Since a descriptor cannot contain any further layers, it - * simply returns a reference to itself. - * - * @return A const reference to the lowest layer in the stack of layers. - * Ownership is not transferred to the caller. - */ - const lowest_layer_type& lowest_layer() const - { - return *this; - } - - /// Assign an existing native descriptor to the descriptor. - /* - * This function opens the descriptor to hold an existing native descriptor. - * - * @param native_descriptor A native descriptor. - * - * @throws asio::system_error Thrown on failure. - */ - void assign(const native_handle_type& native_descriptor) - { - asio::error_code ec; - this->get_service().assign(this->get_implementation(), - native_descriptor, ec); - asio::detail::throw_error(ec, "assign"); - } - - /// Assign an existing native descriptor to the descriptor. - /* - * This function opens the descriptor to hold an existing native descriptor. - * - * @param native_descriptor A native descriptor. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID assign(const native_handle_type& native_descriptor, - asio::error_code& ec) - { - this->get_service().assign( - this->get_implementation(), native_descriptor, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Determine whether the descriptor is open. - bool is_open() const - { - return this->get_service().is_open(this->get_implementation()); - } - - /// Close the descriptor. - /** - * This function is used to close the descriptor. Any asynchronous read or - * write operations will be cancelled immediately, and will complete with the - * asio::error::operation_aborted error. - * - * @throws asio::system_error Thrown on failure. Note that, even if - * the function indicates an error, the underlying descriptor is closed. - */ - void close() - { - asio::error_code ec; - this->get_service().close(this->get_implementation(), ec); - asio::detail::throw_error(ec, "close"); - } - - /// Close the descriptor. - /** - * This function is used to close the descriptor. Any asynchronous read or - * write operations will be cancelled immediately, and will complete with the - * asio::error::operation_aborted error. - * - * @param ec Set to indicate what error occurred, if any. Note that, even if - * the function indicates an error, the underlying descriptor is closed. - */ - ASIO_SYNC_OP_VOID close(asio::error_code& ec) - { - this->get_service().close(this->get_implementation(), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get the native descriptor representation. - /** - * This function may be used to obtain the underlying representation of the - * descriptor. This is intended to allow access to native descriptor - * functionality that is not otherwise provided. - */ - native_handle_type native_handle() - { - return this->get_service().native_handle(this->get_implementation()); - } - - /// Release ownership of the native descriptor implementation. - /** - * This function may be used to obtain the underlying representation of the - * descriptor. After calling this function, @c is_open() returns false. The - * caller is responsible for closing the descriptor. - * - * All outstanding asynchronous read or write operations will finish - * immediately, and the handlers for cancelled operations will be passed the - * asio::error::operation_aborted error. - */ - native_handle_type release() - { - return this->get_service().release(this->get_implementation()); - } - - /// Cancel all asynchronous operations associated with the descriptor. - /** - * This function causes all outstanding asynchronous read or write operations - * to finish immediately, and the handlers for cancelled operations will be - * passed the asio::error::operation_aborted error. - * - * @throws asio::system_error Thrown on failure. - */ - void cancel() - { - asio::error_code ec; - this->get_service().cancel(this->get_implementation(), ec); - asio::detail::throw_error(ec, "cancel"); - } - - /// Cancel all asynchronous operations associated with the descriptor. - /** - * This function causes all outstanding asynchronous read or write operations - * to finish immediately, and the handlers for cancelled operations will be - * passed the asio::error::operation_aborted error. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID cancel(asio::error_code& ec) - { - this->get_service().cancel(this->get_implementation(), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Perform an IO control command on the descriptor. - /** - * This function is used to execute an IO control command on the descriptor. - * - * @param command The IO control command to be performed on the descriptor. - * - * @throws asio::system_error Thrown on failure. - * - * @sa IoControlCommand @n - * asio::posix::descriptor_base::bytes_readable @n - * asio::posix::descriptor_base::non_blocking_io - * - * @par Example - * Getting the number of bytes ready to read: - * @code - * asio::posix::stream_descriptor descriptor(io_context); - * ... - * asio::posix::stream_descriptor::bytes_readable command; - * descriptor.io_control(command); - * std::size_t bytes_readable = command.get(); - * @endcode - */ - template - void io_control(IoControlCommand& command) - { - asio::error_code ec; - this->get_service().io_control(this->get_implementation(), command, ec); - asio::detail::throw_error(ec, "io_control"); - } - - /// Perform an IO control command on the descriptor. - /** - * This function is used to execute an IO control command on the descriptor. - * - * @param command The IO control command to be performed on the descriptor. - * - * @param ec Set to indicate what error occurred, if any. - * - * @sa IoControlCommand @n - * asio::posix::descriptor_base::bytes_readable @n - * asio::posix::descriptor_base::non_blocking_io - * - * @par Example - * Getting the number of bytes ready to read: - * @code - * asio::posix::stream_descriptor descriptor(io_context); - * ... - * asio::posix::stream_descriptor::bytes_readable command; - * asio::error_code ec; - * descriptor.io_control(command, ec); - * if (ec) - * { - * // An error occurred. - * } - * std::size_t bytes_readable = command.get(); - * @endcode - */ - template - ASIO_SYNC_OP_VOID io_control(IoControlCommand& command, - asio::error_code& ec) - { - this->get_service().io_control(this->get_implementation(), command, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Gets the non-blocking mode of the descriptor. - /** - * @returns @c true if the descriptor's synchronous operations will fail with - * asio::error::would_block if they are unable to perform the requested - * operation immediately. If @c false, synchronous operations will block - * until complete. - * - * @note The non-blocking mode has no effect on the behaviour of asynchronous - * operations. Asynchronous operations will never fail with the error - * asio::error::would_block. - */ - bool non_blocking() const - { - return this->get_service().non_blocking(this->get_implementation()); - } - - /// Sets the non-blocking mode of the descriptor. - /** - * @param mode If @c true, the descriptor's synchronous operations will fail - * with asio::error::would_block if they are unable to perform the - * requested operation immediately. If @c false, synchronous operations will - * block until complete. - * - * @throws asio::system_error Thrown on failure. - * - * @note The non-blocking mode has no effect on the behaviour of asynchronous - * operations. Asynchronous operations will never fail with the error - * asio::error::would_block. - */ - void non_blocking(bool mode) - { - asio::error_code ec; - this->get_service().non_blocking(this->get_implementation(), mode, ec); - asio::detail::throw_error(ec, "non_blocking"); - } - - /// Sets the non-blocking mode of the descriptor. - /** - * @param mode If @c true, the descriptor's synchronous operations will fail - * with asio::error::would_block if they are unable to perform the - * requested operation immediately. If @c false, synchronous operations will - * block until complete. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note The non-blocking mode has no effect on the behaviour of asynchronous - * operations. Asynchronous operations will never fail with the error - * asio::error::would_block. - */ - ASIO_SYNC_OP_VOID non_blocking( - bool mode, asio::error_code& ec) - { - this->get_service().non_blocking(this->get_implementation(), mode, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Gets the non-blocking mode of the native descriptor implementation. - /** - * This function is used to retrieve the non-blocking mode of the underlying - * native descriptor. This mode has no effect on the behaviour of the - * descriptor object's synchronous operations. - * - * @returns @c true if the underlying descriptor is in non-blocking mode and - * direct system calls may fail with asio::error::would_block (or the - * equivalent system error). - * - * @note The current non-blocking mode is cached by the descriptor object. - * Consequently, the return value may be incorrect if the non-blocking mode - * was set directly on the native descriptor. - */ - bool native_non_blocking() const - { - return this->get_service().native_non_blocking( - this->get_implementation()); - } - - /// Sets the non-blocking mode of the native descriptor implementation. - /** - * This function is used to modify the non-blocking mode of the underlying - * native descriptor. It has no effect on the behaviour of the descriptor - * object's synchronous operations. - * - * @param mode If @c true, the underlying descriptor is put into non-blocking - * mode and direct system calls may fail with asio::error::would_block - * (or the equivalent system error). - * - * @throws asio::system_error Thrown on failure. If the @c mode is - * @c false, but the current value of @c non_blocking() is @c true, this - * function fails with asio::error::invalid_argument, as the - * combination does not make sense. - */ - void native_non_blocking(bool mode) - { - asio::error_code ec; - this->get_service().native_non_blocking( - this->get_implementation(), mode, ec); - asio::detail::throw_error(ec, "native_non_blocking"); - } - - /// Sets the non-blocking mode of the native descriptor implementation. - /** - * This function is used to modify the non-blocking mode of the underlying - * native descriptor. It has no effect on the behaviour of the descriptor - * object's synchronous operations. - * - * @param mode If @c true, the underlying descriptor is put into non-blocking - * mode and direct system calls may fail with asio::error::would_block - * (or the equivalent system error). - * - * @param ec Set to indicate what error occurred, if any. If the @c mode is - * @c false, but the current value of @c non_blocking() is @c true, this - * function fails with asio::error::invalid_argument, as the - * combination does not make sense. - */ - ASIO_SYNC_OP_VOID native_non_blocking( - bool mode, asio::error_code& ec) - { - this->get_service().native_non_blocking( - this->get_implementation(), mode, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Wait for the descriptor to become ready to read, ready to write, or to - /// have pending error conditions. - /** - * This function is used to perform a blocking wait for a descriptor to enter - * a ready to read, write or error condition state. - * - * @param w Specifies the desired descriptor state. - * - * @par Example - * Waiting for a descriptor to become readable. - * @code - * asio::posix::stream_descriptor descriptor(io_context); - * ... - * descriptor.wait(asio::posix::stream_descriptor::wait_read); - * @endcode - */ - void wait(wait_type w) - { - asio::error_code ec; - this->get_service().wait(this->get_implementation(), w, ec); - asio::detail::throw_error(ec, "wait"); - } - - /// Wait for the descriptor to become ready to read, ready to write, or to - /// have pending error conditions. - /** - * This function is used to perform a blocking wait for a descriptor to enter - * a ready to read, write or error condition state. - * - * @param w Specifies the desired descriptor state. - * - * @param ec Set to indicate what error occurred, if any. - * - * @par Example - * Waiting for a descriptor to become readable. - * @code - * asio::posix::stream_descriptor descriptor(io_context); - * ... - * asio::error_code ec; - * descriptor.wait(asio::posix::stream_descriptor::wait_read, ec); - * @endcode - */ - ASIO_SYNC_OP_VOID wait(wait_type w, asio::error_code& ec) - { - this->get_service().wait(this->get_implementation(), w, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Asynchronously wait for the descriptor to become ready to read, ready to - /// write, or to have pending error conditions. - /** - * This function is used to perform an asynchronous wait for a descriptor to - * enter a ready to read, write or error condition state. - * - * @param w Specifies the desired descriptor state. - * - * @param handler The handler to be called when the wait operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error // Result of operation - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * @code - * void wait_handler(const asio::error_code& error) - * { - * if (!error) - * { - * // Wait succeeded. - * } - * } - * - * ... - * - * asio::posix::stream_descriptor descriptor(io_context); - * ... - * descriptor.async_wait( - * asio::posix::stream_descriptor::wait_read, - * wait_handler); - * @endcode - */ - template - ASIO_INITFN_RESULT_TYPE(WaitHandler, - void (asio::error_code)) - async_wait(wait_type w, ASIO_MOVE_ARG(WaitHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WaitHandler. - ASIO_WAIT_HANDLER_CHECK(WaitHandler, handler) type_check; - - async_completion init(handler); - - this->get_service().async_wait( - this->get_implementation(), w, init.completion_handler); - - return init.result.get(); - } - -protected: - /// Protected destructor to prevent deletion through this type. - /** - * This function destroys the descriptor, cancelling any outstanding - * asynchronous wait operations associated with the descriptor as if by - * calling @c cancel. - */ - ~descriptor() - { - } -}; - -} // namespace posix -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#undef ASIO_SVC_T - -#endif // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) - // || defined(GENERATING_DOCUMENTATION) - -#endif // !defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_POSIX_DESCRIPTOR_HPP diff --git a/tools/sdk/include/asio/asio/posix/descriptor_base.hpp b/tools/sdk/include/asio/asio/posix/descriptor_base.hpp deleted file mode 100644 index 4aac04f1088..00000000000 --- a/tools/sdk/include/asio/asio/posix/descriptor_base.hpp +++ /dev/null @@ -1,90 +0,0 @@ -// -// posix/descriptor_base.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_POSIX_DESCRIPTOR_BASE_HPP -#define ASIO_POSIX_DESCRIPTOR_BASE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) \ - || defined(GENERATING_DOCUMENTATION) - -#include "asio/detail/io_control.hpp" -#include "asio/detail/socket_option.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace posix { - -/// The descriptor_base class is used as a base for the descriptor class as a -/// place to define the associated IO control commands. -class descriptor_base -{ -public: - /// Wait types. - /** - * For use with descriptor::wait() and descriptor::async_wait(). - */ - enum wait_type - { - /// Wait for a descriptor to become ready to read. - wait_read, - - /// Wait for a descriptor to become ready to write. - wait_write, - - /// Wait for a descriptor to have error conditions pending. - wait_error - }; - - /// IO control command to get the amount of data that can be read without - /// blocking. - /** - * Implements the FIONREAD IO control command. - * - * @par Example - * @code - * asio::posix::stream_descriptor descriptor(io_context); - * ... - * asio::descriptor_base::bytes_readable command(true); - * descriptor.io_control(command); - * std::size_t bytes_readable = command.get(); - * @endcode - * - * @par Concepts: - * IoControlCommand. - */ -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined bytes_readable; -#else - typedef asio::detail::io_control::bytes_readable bytes_readable; -#endif - -protected: - /// Protected destructor to prevent deletion through this type. - ~descriptor_base() - { - } -}; - -} // namespace posix -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) - // || defined(GENERATING_DOCUMENTATION) - -#endif // ASIO_POSIX_DESCRIPTOR_BASE_HPP diff --git a/tools/sdk/include/asio/asio/posix/stream_descriptor.hpp b/tools/sdk/include/asio/asio/posix/stream_descriptor.hpp deleted file mode 100644 index abb426a3904..00000000000 --- a/tools/sdk/include/asio/asio/posix/stream_descriptor.hpp +++ /dev/null @@ -1,360 +0,0 @@ -// -// posix/stream_descriptor.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_POSIX_STREAM_DESCRIPTOR_HPP -#define ASIO_POSIX_STREAM_DESCRIPTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/posix/descriptor.hpp" - -#if defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) \ - || defined(GENERATING_DOCUMENTATION) - -#if defined(ASIO_ENABLE_OLD_SERVICES) -# include "asio/posix/basic_stream_descriptor.hpp" -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -namespace asio { -namespace posix { - -#if defined(ASIO_ENABLE_OLD_SERVICES) -// Typedef for the typical usage of a stream-oriented descriptor. -typedef basic_stream_descriptor<> stream_descriptor; -#else // defined(ASIO_ENABLE_OLD_SERVICES) -/// Provides stream-oriented descriptor functionality. -/** - * The posix::stream_descriptor class template provides asynchronous and - * blocking stream-oriented descriptor functionality. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - * - * @par Concepts: - * AsyncReadStream, AsyncWriteStream, Stream, SyncReadStream, SyncWriteStream. - */ -class stream_descriptor - : public descriptor -{ -public: - /// Construct a stream_descriptor without opening it. - /** - * This constructor creates a stream descriptor without opening it. The - * descriptor needs to be opened and then connected or accepted before data - * can be sent or received on it. - * - * @param io_context The io_context object that the stream descriptor will - * use to dispatch handlers for any asynchronous operations performed on the - * descriptor. - */ - explicit stream_descriptor(asio::io_context& io_context) - : descriptor(io_context) - { - } - - /// Construct a stream_descriptor on an existing native descriptor. - /** - * This constructor creates a stream descriptor object to hold an existing - * native descriptor. - * - * @param io_context The io_context object that the stream descriptor will - * use to dispatch handlers for any asynchronous operations performed on the - * descriptor. - * - * @param native_descriptor The new underlying descriptor implementation. - * - * @throws asio::system_error Thrown on failure. - */ - stream_descriptor(asio::io_context& io_context, - const native_handle_type& native_descriptor) - : descriptor(io_context, native_descriptor) - { - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a stream_descriptor from another. - /** - * This constructor moves a stream descriptor from one object to another. - * - * @param other The other stream_descriptor object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c stream_descriptor(io_context&) constructor. - */ - stream_descriptor(stream_descriptor&& other) - : descriptor(std::move(other)) - { - } - - /// Move-assign a stream_descriptor from another. - /** - * This assignment operator moves a stream descriptor from one object to - * another. - * - * @param other The other stream_descriptor object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c stream_descriptor(io_context&) constructor. - */ - stream_descriptor& operator=(stream_descriptor&& other) - { - descriptor::operator=(std::move(other)); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Write some data to the descriptor. - /** - * This function is used to write data to the stream descriptor. The function - * call will block until one or more bytes of the data has been written - * successfully, or until an error occurs. - * - * @param buffers One or more data buffers to be written to the descriptor. - * - * @returns The number of bytes written. - * - * @throws asio::system_error Thrown on failure. An error code of - * asio::error::eof indicates that the connection was closed by the - * peer. - * - * @note The write_some operation may not transmit all of the data to the - * peer. Consider using the @ref write function if you need to ensure that - * all data is written before the blocking operation completes. - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code - * descriptor.write_some(asio::buffer(data, size)); - * @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t write_some(const ConstBufferSequence& buffers) - { - asio::error_code ec; - std::size_t s = this->get_service().write_some( - this->get_implementation(), buffers, ec); - asio::detail::throw_error(ec, "write_some"); - return s; - } - - /// Write some data to the descriptor. - /** - * This function is used to write data to the stream descriptor. The function - * call will block until one or more bytes of the data has been written - * successfully, or until an error occurs. - * - * @param buffers One or more data buffers to be written to the descriptor. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes written. Returns 0 if an error occurred. - * - * @note The write_some operation may not transmit all of the data to the - * peer. Consider using the @ref write function if you need to ensure that - * all data is written before the blocking operation completes. - */ - template - std::size_t write_some(const ConstBufferSequence& buffers, - asio::error_code& ec) - { - return this->get_service().write_some( - this->get_implementation(), buffers, ec); - } - - /// Start an asynchronous write. - /** - * This function is used to asynchronously write data to the stream - * descriptor. The function call always returns immediately. - * - * @param buffers One or more data buffers to be written to the descriptor. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the write operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes written. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The write operation may not transmit all of the data to the peer. - * Consider using the @ref async_write function if you need to ensure that all - * data is written before the asynchronous operation completes. - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code - * descriptor.async_write_some(asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_write_some(const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - - asio::async_completion init(handler); - - this->get_service().async_write_some( - this->get_implementation(), buffers, init.completion_handler); - - return init.result.get(); - } - - /// Read some data from the descriptor. - /** - * This function is used to read data from the stream descriptor. The function - * call will block until one or more bytes of data has been read successfully, - * or until an error occurs. - * - * @param buffers One or more buffers into which the data will be read. - * - * @returns The number of bytes read. - * - * @throws asio::system_error Thrown on failure. An error code of - * asio::error::eof indicates that the connection was closed by the - * peer. - * - * @note The read_some operation may not read all of the requested number of - * bytes. Consider using the @ref read function if you need to ensure that - * the requested amount of data is read before the blocking operation - * completes. - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code - * descriptor.read_some(asio::buffer(data, size)); - * @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t read_some(const MutableBufferSequence& buffers) - { - asio::error_code ec; - std::size_t s = this->get_service().read_some( - this->get_implementation(), buffers, ec); - asio::detail::throw_error(ec, "read_some"); - return s; - } - - /// Read some data from the descriptor. - /** - * This function is used to read data from the stream descriptor. The function - * call will block until one or more bytes of data has been read successfully, - * or until an error occurs. - * - * @param buffers One or more buffers into which the data will be read. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes read. Returns 0 if an error occurred. - * - * @note The read_some operation may not read all of the requested number of - * bytes. Consider using the @ref read function if you need to ensure that - * the requested amount of data is read before the blocking operation - * completes. - */ - template - std::size_t read_some(const MutableBufferSequence& buffers, - asio::error_code& ec) - { - return this->get_service().read_some( - this->get_implementation(), buffers, ec); - } - - /// Start an asynchronous read. - /** - * This function is used to asynchronously read data from the stream - * descriptor. The function call always returns immediately. - * - * @param buffers One or more buffers into which the data will be read. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes read. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The read operation may not read all of the requested number of bytes. - * Consider using the @ref async_read function if you need to ensure that the - * requested amount of data is read before the asynchronous operation - * completes. - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code - * descriptor.async_read_some(asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_read_some(const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - - asio::async_completion init(handler); - - this->get_service().async_read_some( - this->get_implementation(), buffers, init.completion_handler); - - return init.result.get(); - } -}; -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -} // namespace posix -} // namespace asio - -#endif // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) - // || defined(GENERATING_DOCUMENTATION) - -#endif // ASIO_POSIX_STREAM_DESCRIPTOR_HPP diff --git a/tools/sdk/include/asio/asio/posix/stream_descriptor_service.hpp b/tools/sdk/include/asio/asio/posix/stream_descriptor_service.hpp deleted file mode 100644 index 4ffbb9602d5..00000000000 --- a/tools/sdk/include/asio/asio/posix/stream_descriptor_service.hpp +++ /dev/null @@ -1,279 +0,0 @@ -// -// posix/stream_descriptor_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_POSIX_STREAM_DESCRIPTOR_SERVICE_HPP -#define ASIO_POSIX_STREAM_DESCRIPTOR_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) - -#if defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) \ - || defined(GENERATING_DOCUMENTATION) - -#include -#include "asio/async_result.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" -#include "asio/detail/reactive_descriptor_service.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace posix { - -/// Default service implementation for a stream descriptor. -class stream_descriptor_service -#if defined(GENERATING_DOCUMENTATION) - : public asio::io_context::service -#else - : public asio::detail::service_base -#endif -{ -public: -#if defined(GENERATING_DOCUMENTATION) - /// The unique service identifier. - static asio::io_context::id id; -#endif - -private: - // The type of the platform-specific implementation. - typedef detail::reactive_descriptor_service service_impl_type; - -public: - /// The type of a stream descriptor implementation. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined implementation_type; -#else - typedef service_impl_type::implementation_type implementation_type; -#endif - - /// The native descriptor type. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined native_handle_type; -#else - typedef service_impl_type::native_handle_type native_handle_type; -#endif - - /// Construct a new stream descriptor service for the specified io_context. - explicit stream_descriptor_service(asio::io_context& io_context) - : asio::detail::service_base(io_context), - service_impl_(io_context) - { - } - - /// Construct a new stream descriptor implementation. - void construct(implementation_type& impl) - { - service_impl_.construct(impl); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a new stream descriptor implementation. - void move_construct(implementation_type& impl, - implementation_type& other_impl) - { - service_impl_.move_construct(impl, other_impl); - } - - /// Move-assign from another stream descriptor implementation. - void move_assign(implementation_type& impl, - stream_descriptor_service& other_service, - implementation_type& other_impl) - { - service_impl_.move_assign(impl, other_service.service_impl_, other_impl); - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destroy a stream descriptor implementation. - void destroy(implementation_type& impl) - { - service_impl_.destroy(impl); - } - - /// Assign an existing native descriptor to a stream descriptor. - ASIO_SYNC_OP_VOID assign(implementation_type& impl, - const native_handle_type& native_descriptor, - asio::error_code& ec) - { - service_impl_.assign(impl, native_descriptor, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Determine whether the descriptor is open. - bool is_open(const implementation_type& impl) const - { - return service_impl_.is_open(impl); - } - - /// Close a stream descriptor implementation. - ASIO_SYNC_OP_VOID close(implementation_type& impl, - asio::error_code& ec) - { - service_impl_.close(impl, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get the native descriptor implementation. - native_handle_type native_handle(implementation_type& impl) - { - return service_impl_.native_handle(impl); - } - - /// Release ownership of the native descriptor implementation. - native_handle_type release(implementation_type& impl) - { - return service_impl_.release(impl); - } - - /// Cancel all asynchronous operations associated with the descriptor. - ASIO_SYNC_OP_VOID cancel(implementation_type& impl, - asio::error_code& ec) - { - service_impl_.cancel(impl, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Perform an IO control command on the descriptor. - template - ASIO_SYNC_OP_VOID io_control(implementation_type& impl, - IoControlCommand& command, asio::error_code& ec) - { - service_impl_.io_control(impl, command, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Gets the non-blocking mode of the descriptor. - bool non_blocking(const implementation_type& impl) const - { - return service_impl_.non_blocking(impl); - } - - /// Sets the non-blocking mode of the descriptor. - ASIO_SYNC_OP_VOID non_blocking(implementation_type& impl, - bool mode, asio::error_code& ec) - { - service_impl_.non_blocking(impl, mode, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Gets the non-blocking mode of the native descriptor implementation. - bool native_non_blocking(const implementation_type& impl) const - { - return service_impl_.native_non_blocking(impl); - } - - /// Sets the non-blocking mode of the native descriptor implementation. - ASIO_SYNC_OP_VOID native_non_blocking(implementation_type& impl, - bool mode, asio::error_code& ec) - { - service_impl_.native_non_blocking(impl, mode, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Wait for the descriptor to become ready to read, ready to write, or to - /// have pending error conditions. - ASIO_SYNC_OP_VOID wait(implementation_type& impl, - descriptor_base::wait_type w, asio::error_code& ec) - { - service_impl_.wait(impl, w, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Asynchronously wait for the descriptor to become ready to read, ready to - /// write, or to have pending error conditions. - template - ASIO_INITFN_RESULT_TYPE(WaitHandler, - void (asio::error_code)) - async_wait(implementation_type& impl, descriptor_base::wait_type w, - ASIO_MOVE_ARG(WaitHandler) handler) - { - async_completion init(handler); - - service_impl_.async_wait(impl, w, init.completion_handler); - - return init.result.get(); - } - - /// Write the given data to the stream. - template - std::size_t write_some(implementation_type& impl, - const ConstBufferSequence& buffers, asio::error_code& ec) - { - return service_impl_.write_some(impl, buffers, ec); - } - - /// Start an asynchronous write. - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_write_some(implementation_type& impl, - const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler) - { - asio::async_completion init(handler); - - service_impl_.async_write_some(impl, buffers, init.completion_handler); - - return init.result.get(); - } - - /// Read some data from the stream. - template - std::size_t read_some(implementation_type& impl, - const MutableBufferSequence& buffers, asio::error_code& ec) - { - return service_impl_.read_some(impl, buffers, ec); - } - - /// Start an asynchronous read. - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_read_some(implementation_type& impl, - const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler) - { - asio::async_completion init(handler); - - service_impl_.async_read_some(impl, buffers, init.completion_handler); - - return init.result.get(); - } - -private: - // Destroy all user-defined handler objects owned by the service. - void shutdown() - { - service_impl_.shutdown(); - } - - // The platform-specific implementation. - service_impl_type service_impl_; -}; - -} // namespace posix -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) - // || defined(GENERATING_DOCUMENTATION) - -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_POSIX_STREAM_DESCRIPTOR_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/post.hpp b/tools/sdk/include/asio/asio/post.hpp deleted file mode 100644 index 87d7b96d6be..00000000000 --- a/tools/sdk/include/asio/asio/post.hpp +++ /dev/null @@ -1,107 +0,0 @@ -// -// post.hpp -// ~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_POST_HPP -#define ASIO_POST_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/async_result.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/execution_context.hpp" -#include "asio/is_executor.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Submits a completion token or function object for execution. -/** - * This function submits an object for execution using the object's associated - * executor. The function object is queued for execution, and is never called - * from the current thread prior to returning from post(). - * - * This function has the following effects: - * - * @li Constructs a function object handler of type @c Handler, initialized - * with handler(forward(token)). - * - * @li Constructs an object @c result of type async_result, - * initializing the object as result(handler). - * - * @li Obtains the handler's associated executor object @c ex by performing - * get_associated_executor(handler). - * - * @li Obtains the handler's associated allocator object @c alloc by performing - * get_associated_allocator(handler). - * - * @li Performs ex.post(std::move(handler), alloc). - * - * @li Returns result.get(). - */ -template -ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) post( - ASIO_MOVE_ARG(CompletionToken) token); - -/// Submits a completion token or function object for execution. -/** - * This function submits an object for execution using the specified executor. - * The function object is queued for execution, and is never called from the - * current thread prior to returning from post(). - * - * This function has the following effects: - * - * @li Constructs a function object handler of type @c Handler, initialized - * with handler(forward(token)). - * - * @li Constructs an object @c result of type async_result, - * initializing the object as result(handler). - * - * @li Obtains the handler's associated executor object @c ex1 by performing - * get_associated_executor(handler). - * - * @li Creates a work object @c w by performing make_work(ex1). - * - * @li Obtains the handler's associated allocator object @c alloc by performing - * get_associated_allocator(handler). - * - * @li Constructs a function object @c f with a function call operator that - * performs ex1.dispatch(std::move(handler), alloc) followed by - * w.reset(). - * - * @li Performs Executor(ex).post(std::move(f), alloc). - * - * @li Returns result.get(). - */ -template -ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) post( - const Executor& ex, ASIO_MOVE_ARG(CompletionToken) token, - typename enable_if::value>::type* = 0); - -/// Submits a completion token or function object for execution. -/** - * @returns post(ctx.get_executor(), forward(token)). - */ -template -ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) post( - ExecutionContext& ctx, ASIO_MOVE_ARG(CompletionToken) token, - typename enable_if::value>::type* = 0); - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/impl/post.hpp" - -#endif // ASIO_POST_HPP diff --git a/tools/sdk/include/asio/asio/raw_socket_service.hpp b/tools/sdk/include/asio/asio/raw_socket_service.hpp deleted file mode 100644 index 2bccf032e3d..00000000000 --- a/tools/sdk/include/asio/asio/raw_socket_service.hpp +++ /dev/null @@ -1,466 +0,0 @@ -// -// raw_socket_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_RAW_SOCKET_SERVICE_HPP -#define ASIO_RAW_SOCKET_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) - -#include -#include "asio/async_result.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" - -#if defined(ASIO_WINDOWS_RUNTIME) -# include "asio/detail/null_socket_service.hpp" -#elif defined(ASIO_HAS_IOCP) -# include "asio/detail/win_iocp_socket_service.hpp" -#else -# include "asio/detail/reactive_socket_service.hpp" -#endif - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Default service implementation for a raw socket. -template -class raw_socket_service -#if defined(GENERATING_DOCUMENTATION) - : public asio::io_context::service -#else - : public asio::detail::service_base > -#endif -{ -public: -#if defined(GENERATING_DOCUMENTATION) - /// The unique service identifier. - static asio::io_context::id id; -#endif - - /// The protocol type. - typedef Protocol protocol_type; - - /// The endpoint type. - typedef typename Protocol::endpoint endpoint_type; - -private: - // The type of the platform-specific implementation. -#if defined(ASIO_WINDOWS_RUNTIME) - typedef detail::null_socket_service service_impl_type; -#elif defined(ASIO_HAS_IOCP) - typedef detail::win_iocp_socket_service service_impl_type; -#else - typedef detail::reactive_socket_service service_impl_type; -#endif - -public: - /// The type of a raw socket. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined implementation_type; -#else - typedef typename service_impl_type::implementation_type implementation_type; -#endif - - /// The native socket type. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined native_handle_type; -#else - typedef typename service_impl_type::native_handle_type native_handle_type; -#endif - - /// Construct a new raw socket service for the specified io_context. - explicit raw_socket_service(asio::io_context& io_context) - : asio::detail::service_base< - raw_socket_service >(io_context), - service_impl_(io_context) - { - } - - /// Construct a new raw socket implementation. - void construct(implementation_type& impl) - { - service_impl_.construct(impl); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a new raw socket implementation. - void move_construct(implementation_type& impl, - implementation_type& other_impl) - { - service_impl_.move_construct(impl, other_impl); - } - - /// Move-assign from another raw socket implementation. - void move_assign(implementation_type& impl, - raw_socket_service& other_service, - implementation_type& other_impl) - { - service_impl_.move_assign(impl, other_service.service_impl_, other_impl); - } - - // All socket services have access to each other's implementations. - template friend class raw_socket_service; - - /// Move-construct a new raw socket implementation from another protocol - /// type. - template - void converting_move_construct(implementation_type& impl, - raw_socket_service& other_service, - typename raw_socket_service< - Protocol1>::implementation_type& other_impl, - typename enable_if::value>::type* = 0) - { - service_impl_.template converting_move_construct( - impl, other_service.service_impl_, other_impl); - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destroy a raw socket implementation. - void destroy(implementation_type& impl) - { - service_impl_.destroy(impl); - } - - // Open a new raw socket implementation. - ASIO_SYNC_OP_VOID open(implementation_type& impl, - const protocol_type& protocol, asio::error_code& ec) - { - if (protocol.type() == ASIO_OS_DEF(SOCK_RAW)) - service_impl_.open(impl, protocol, ec); - else - ec = asio::error::invalid_argument; - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Assign an existing native socket to a raw socket. - ASIO_SYNC_OP_VOID assign(implementation_type& impl, - const protocol_type& protocol, const native_handle_type& native_socket, - asio::error_code& ec) - { - service_impl_.assign(impl, protocol, native_socket, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Determine whether the socket is open. - bool is_open(const implementation_type& impl) const - { - return service_impl_.is_open(impl); - } - - /// Close a raw socket implementation. - ASIO_SYNC_OP_VOID close(implementation_type& impl, - asio::error_code& ec) - { - service_impl_.close(impl, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Release ownership of the underlying socket. - native_handle_type release(implementation_type& impl, - asio::error_code& ec) - { - return service_impl_.release(impl, ec); - } - - /// Get the native socket implementation. - native_handle_type native_handle(implementation_type& impl) - { - return service_impl_.native_handle(impl); - } - - /// Cancel all asynchronous operations associated with the socket. - ASIO_SYNC_OP_VOID cancel(implementation_type& impl, - asio::error_code& ec) - { - service_impl_.cancel(impl, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Determine whether the socket is at the out-of-band data mark. - bool at_mark(const implementation_type& impl, - asio::error_code& ec) const - { - return service_impl_.at_mark(impl, ec); - } - - /// Determine the number of bytes available for reading. - std::size_t available(const implementation_type& impl, - asio::error_code& ec) const - { - return service_impl_.available(impl, ec); - } - - // Bind the raw socket to the specified local endpoint. - ASIO_SYNC_OP_VOID bind(implementation_type& impl, - const endpoint_type& endpoint, asio::error_code& ec) - { - service_impl_.bind(impl, endpoint, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Connect the raw socket to the specified endpoint. - ASIO_SYNC_OP_VOID connect(implementation_type& impl, - const endpoint_type& peer_endpoint, asio::error_code& ec) - { - service_impl_.connect(impl, peer_endpoint, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Start an asynchronous connect. - template - ASIO_INITFN_RESULT_TYPE(ConnectHandler, - void (asio::error_code)) - async_connect(implementation_type& impl, - const endpoint_type& peer_endpoint, - ASIO_MOVE_ARG(ConnectHandler) handler) - { - async_completion init(handler); - - service_impl_.async_connect(impl, peer_endpoint, init.completion_handler); - - return init.result.get(); - } - - /// Set a socket option. - template - ASIO_SYNC_OP_VOID set_option(implementation_type& impl, - const SettableSocketOption& option, asio::error_code& ec) - { - service_impl_.set_option(impl, option, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get a socket option. - template - ASIO_SYNC_OP_VOID get_option(const implementation_type& impl, - GettableSocketOption& option, asio::error_code& ec) const - { - service_impl_.get_option(impl, option, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Perform an IO control command on the socket. - template - ASIO_SYNC_OP_VOID io_control(implementation_type& impl, - IoControlCommand& command, asio::error_code& ec) - { - service_impl_.io_control(impl, command, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Gets the non-blocking mode of the socket. - bool non_blocking(const implementation_type& impl) const - { - return service_impl_.non_blocking(impl); - } - - /// Sets the non-blocking mode of the socket. - ASIO_SYNC_OP_VOID non_blocking(implementation_type& impl, - bool mode, asio::error_code& ec) - { - service_impl_.non_blocking(impl, mode, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Gets the non-blocking mode of the native socket implementation. - bool native_non_blocking(const implementation_type& impl) const - { - return service_impl_.native_non_blocking(impl); - } - - /// Sets the non-blocking mode of the native socket implementation. - ASIO_SYNC_OP_VOID native_non_blocking(implementation_type& impl, - bool mode, asio::error_code& ec) - { - service_impl_.native_non_blocking(impl, mode, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get the local endpoint. - endpoint_type local_endpoint(const implementation_type& impl, - asio::error_code& ec) const - { - return service_impl_.local_endpoint(impl, ec); - } - - /// Get the remote endpoint. - endpoint_type remote_endpoint(const implementation_type& impl, - asio::error_code& ec) const - { - return service_impl_.remote_endpoint(impl, ec); - } - - /// Disable sends or receives on the socket. - ASIO_SYNC_OP_VOID shutdown(implementation_type& impl, - socket_base::shutdown_type what, asio::error_code& ec) - { - service_impl_.shutdown(impl, what, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Wait for the socket to become ready to read, ready to write, or to have - /// pending error conditions. - ASIO_SYNC_OP_VOID wait(implementation_type& impl, - socket_base::wait_type w, asio::error_code& ec) - { - service_impl_.wait(impl, w, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Asynchronously wait for the socket to become ready to read, ready to - /// write, or to have pending error conditions. - template - ASIO_INITFN_RESULT_TYPE(WaitHandler, - void (asio::error_code)) - async_wait(implementation_type& impl, socket_base::wait_type w, - ASIO_MOVE_ARG(WaitHandler) handler) - { - async_completion init(handler); - - service_impl_.async_wait(impl, w, init.completion_handler); - - return init.result.get(); - } - - /// Send the given data to the peer. - template - std::size_t send(implementation_type& impl, - const ConstBufferSequence& buffers, - socket_base::message_flags flags, asio::error_code& ec) - { - return service_impl_.send(impl, buffers, flags, ec); - } - - /// Start an asynchronous send. - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_send(implementation_type& impl, const ConstBufferSequence& buffers, - socket_base::message_flags flags, - ASIO_MOVE_ARG(WriteHandler) handler) - { - async_completion init(handler); - - service_impl_.async_send(impl, buffers, flags, init.completion_handler); - - return init.result.get(); - } - - /// Send raw data to the specified endpoint. - template - std::size_t send_to(implementation_type& impl, - const ConstBufferSequence& buffers, const endpoint_type& destination, - socket_base::message_flags flags, asio::error_code& ec) - { - return service_impl_.send_to(impl, buffers, destination, flags, ec); - } - - /// Start an asynchronous send. - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_send_to(implementation_type& impl, - const ConstBufferSequence& buffers, const endpoint_type& destination, - socket_base::message_flags flags, - ASIO_MOVE_ARG(WriteHandler) handler) - { - async_completion init(handler); - - service_impl_.async_send_to(impl, buffers, - destination, flags, init.completion_handler); - - return init.result.get(); - } - - /// Receive some data from the peer. - template - std::size_t receive(implementation_type& impl, - const MutableBufferSequence& buffers, - socket_base::message_flags flags, asio::error_code& ec) - { - return service_impl_.receive(impl, buffers, flags, ec); - } - - /// Start an asynchronous receive. - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_receive(implementation_type& impl, - const MutableBufferSequence& buffers, - socket_base::message_flags flags, - ASIO_MOVE_ARG(ReadHandler) handler) - { - async_completion init(handler); - - service_impl_.async_receive(impl, buffers, flags, init.completion_handler); - - return init.result.get(); - } - - /// Receive raw data with the endpoint of the sender. - template - std::size_t receive_from(implementation_type& impl, - const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, - socket_base::message_flags flags, asio::error_code& ec) - { - return service_impl_.receive_from(impl, buffers, sender_endpoint, flags, - ec); - } - - /// Start an asynchronous receive that will get the endpoint of the sender. - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_receive_from(implementation_type& impl, - const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, - socket_base::message_flags flags, - ASIO_MOVE_ARG(ReadHandler) handler) - { - async_completion init(handler); - - service_impl_.async_receive_from(impl, buffers, - sender_endpoint, flags, init.completion_handler); - - return init.result.get(); - } - -private: - // Destroy all user-defined handler objects owned by the service. - void shutdown() - { - service_impl_.shutdown(); - } - - // The platform-specific implementation. - service_impl_type service_impl_; -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_RAW_SOCKET_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/read.hpp b/tools/sdk/include/asio/asio/read.hpp deleted file mode 100644 index e77206a88cf..00000000000 --- a/tools/sdk/include/asio/asio/read.hpp +++ /dev/null @@ -1,947 +0,0 @@ -// -// read.hpp -// ~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_READ_HPP -#define ASIO_READ_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/async_result.hpp" -#include "asio/buffer.hpp" -#include "asio/error.hpp" - -#if !defined(ASIO_NO_EXTENSIONS) -# include "asio/basic_streambuf_fwd.hpp" -#endif // !defined(ASIO_NO_EXTENSIONS) - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/** - * @defgroup read asio::read - * - * @brief Attempt to read a certain amount of data from a stream before - * returning. - */ -/*@{*/ - -/// Attempt to read a certain amount of data from a stream before returning. -/** - * This function is used to read a certain number of bytes of data from a - * stream. The call will block until one of the following conditions is true: - * - * @li The supplied buffers are full. That is, the bytes transferred is equal to - * the sum of the buffer sizes. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param buffers One or more buffers into which the data will be read. The sum - * of the buffer sizes indicates the maximum number of bytes to read from the - * stream. - * - * @returns The number of bytes transferred. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code asio::read(s, asio::buffer(data, size)); @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - * - * @note This overload is equivalent to calling: - * @code asio::read( - * s, buffers, - * asio::transfer_all()); @endcode - */ -template -std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers, - typename enable_if< - is_mutable_buffer_sequence::value - >::type* = 0); - -/// Attempt to read a certain amount of data from a stream before returning. -/** - * This function is used to read a certain number of bytes of data from a - * stream. The call will block until one of the following conditions is true: - * - * @li The supplied buffers are full. That is, the bytes transferred is equal to - * the sum of the buffer sizes. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param buffers One or more buffers into which the data will be read. The sum - * of the buffer sizes indicates the maximum number of bytes to read from the - * stream. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes transferred. - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code asio::read(s, asio::buffer(data, size), ec); @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - * - * @note This overload is equivalent to calling: - * @code asio::read( - * s, buffers, - * asio::transfer_all(), ec); @endcode - */ -template -std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers, - asio::error_code& ec, - typename enable_if< - is_mutable_buffer_sequence::value - >::type* = 0); - -/// Attempt to read a certain amount of data from a stream before returning. -/** - * This function is used to read a certain number of bytes of data from a - * stream. The call will block until one of the following conditions is true: - * - * @li The supplied buffers are full. That is, the bytes transferred is equal to - * the sum of the buffer sizes. - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param buffers One or more buffers into which the data will be read. The sum - * of the buffer sizes indicates the maximum number of bytes to read from the - * stream. - * - * @param completion_condition The function object to be called to determine - * whether the read operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest read_some operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the read operation is complete. A non-zero - * return value indicates the maximum number of bytes to be read on the next - * call to the stream's read_some function. - * - * @returns The number of bytes transferred. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code asio::read(s, asio::buffer(data, size), - * asio::transfer_at_least(32)); @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ -template -std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers, - CompletionCondition completion_condition, - typename enable_if< - is_mutable_buffer_sequence::value - >::type* = 0); - -/// Attempt to read a certain amount of data from a stream before returning. -/** - * This function is used to read a certain number of bytes of data from a - * stream. The call will block until one of the following conditions is true: - * - * @li The supplied buffers are full. That is, the bytes transferred is equal to - * the sum of the buffer sizes. - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param buffers One or more buffers into which the data will be read. The sum - * of the buffer sizes indicates the maximum number of bytes to read from the - * stream. - * - * @param completion_condition The function object to be called to determine - * whether the read operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest read_some operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the read operation is complete. A non-zero - * return value indicates the maximum number of bytes to be read on the next - * call to the stream's read_some function. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes read. If an error occurs, returns the total - * number of bytes successfully transferred prior to the error. - */ -template -std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers, - CompletionCondition completion_condition, asio::error_code& ec, - typename enable_if< - is_mutable_buffer_sequence::value - >::type* = 0); - -/// Attempt to read a certain amount of data from a stream before returning. -/** - * This function is used to read a certain number of bytes of data from a - * stream. The call will block until one of the following conditions is true: - * - * @li The specified dynamic buffer sequence is full (that is, it has reached - * maximum size). - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param buffers The dynamic buffer sequence into which the data will be read. - * - * @returns The number of bytes transferred. - * - * @throws asio::system_error Thrown on failure. - * - * @note This overload is equivalent to calling: - * @code asio::read( - * s, buffers, - * asio::transfer_all()); @endcode - */ -template -std::size_t read(SyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - typename enable_if< - is_dynamic_buffer::type>::value - >::type* = 0); - -/// Attempt to read a certain amount of data from a stream before returning. -/** - * This function is used to read a certain number of bytes of data from a - * stream. The call will block until one of the following conditions is true: - * - * @li The supplied buffer is full (that is, it has reached maximum size). - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param buffers The dynamic buffer sequence into which the data will be read. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes transferred. - * - * @note This overload is equivalent to calling: - * @code asio::read( - * s, buffers, - * asio::transfer_all(), ec); @endcode - */ -template -std::size_t read(SyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - asio::error_code& ec, - typename enable_if< - is_dynamic_buffer::type>::value - >::type* = 0); - -/// Attempt to read a certain amount of data from a stream before returning. -/** - * This function is used to read a certain number of bytes of data from a - * stream. The call will block until one of the following conditions is true: - * - * @li The specified dynamic buffer sequence is full (that is, it has reached - * maximum size). - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param buffers The dynamic buffer sequence into which the data will be read. - * - * @param completion_condition The function object to be called to determine - * whether the read operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest read_some operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the read operation is complete. A non-zero - * return value indicates the maximum number of bytes to be read on the next - * call to the stream's read_some function. - * - * @returns The number of bytes transferred. - * - * @throws asio::system_error Thrown on failure. - */ -template -std::size_t read(SyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - CompletionCondition completion_condition, - typename enable_if< - is_dynamic_buffer::type>::value - >::type* = 0); - -/// Attempt to read a certain amount of data from a stream before returning. -/** - * This function is used to read a certain number of bytes of data from a - * stream. The call will block until one of the following conditions is true: - * - * @li The specified dynamic buffer sequence is full (that is, it has reached - * maximum size). - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param buffers The dynamic buffer sequence into which the data will be read. - * - * @param completion_condition The function object to be called to determine - * whether the read operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest read_some operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the read operation is complete. A non-zero - * return value indicates the maximum number of bytes to be read on the next - * call to the stream's read_some function. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes read. If an error occurs, returns the total - * number of bytes successfully transferred prior to the error. - */ -template -std::size_t read(SyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - CompletionCondition completion_condition, asio::error_code& ec, - typename enable_if< - is_dynamic_buffer::type>::value - >::type* = 0); - -#if !defined(ASIO_NO_EXTENSIONS) -#if !defined(ASIO_NO_IOSTREAM) - -/// Attempt to read a certain amount of data from a stream before returning. -/** - * This function is used to read a certain number of bytes of data from a - * stream. The call will block until one of the following conditions is true: - * - * @li The supplied buffer is full (that is, it has reached maximum size). - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param b The basic_streambuf object into which the data will be read. - * - * @returns The number of bytes transferred. - * - * @throws asio::system_error Thrown on failure. - * - * @note This overload is equivalent to calling: - * @code asio::read( - * s, b, - * asio::transfer_all()); @endcode - */ -template -std::size_t read(SyncReadStream& s, basic_streambuf& b); - -/// Attempt to read a certain amount of data from a stream before returning. -/** - * This function is used to read a certain number of bytes of data from a - * stream. The call will block until one of the following conditions is true: - * - * @li The supplied buffer is full (that is, it has reached maximum size). - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param b The basic_streambuf object into which the data will be read. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes transferred. - * - * @note This overload is equivalent to calling: - * @code asio::read( - * s, b, - * asio::transfer_all(), ec); @endcode - */ -template -std::size_t read(SyncReadStream& s, basic_streambuf& b, - asio::error_code& ec); - -/// Attempt to read a certain amount of data from a stream before returning. -/** - * This function is used to read a certain number of bytes of data from a - * stream. The call will block until one of the following conditions is true: - * - * @li The supplied buffer is full (that is, it has reached maximum size). - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param b The basic_streambuf object into which the data will be read. - * - * @param completion_condition The function object to be called to determine - * whether the read operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest read_some operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the read operation is complete. A non-zero - * return value indicates the maximum number of bytes to be read on the next - * call to the stream's read_some function. - * - * @returns The number of bytes transferred. - * - * @throws asio::system_error Thrown on failure. - */ -template -std::size_t read(SyncReadStream& s, basic_streambuf& b, - CompletionCondition completion_condition); - -/// Attempt to read a certain amount of data from a stream before returning. -/** - * This function is used to read a certain number of bytes of data from a - * stream. The call will block until one of the following conditions is true: - * - * @li The supplied buffer is full (that is, it has reached maximum size). - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param b The basic_streambuf object into which the data will be read. - * - * @param completion_condition The function object to be called to determine - * whether the read operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest read_some operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the read operation is complete. A non-zero - * return value indicates the maximum number of bytes to be read on the next - * call to the stream's read_some function. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes read. If an error occurs, returns the total - * number of bytes successfully transferred prior to the error. - */ -template -std::size_t read(SyncReadStream& s, basic_streambuf& b, - CompletionCondition completion_condition, asio::error_code& ec); - -#endif // !defined(ASIO_NO_IOSTREAM) -#endif // !defined(ASIO_NO_EXTENSIONS) - -/*@}*/ -/** - * @defgroup async_read asio::async_read - * - * @brief Start an asynchronous operation to read a certain amount of data from - * a stream. - */ -/*@{*/ - -/// Start an asynchronous operation to read a certain amount of data from a -/// stream. -/** - * This function is used to asynchronously read a certain number of bytes of - * data from a stream. The function call always returns immediately. The - * asynchronous operation will continue until one of the following conditions is - * true: - * - * @li The supplied buffers are full. That is, the bytes transferred is equal to - * the sum of the buffer sizes. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * async_read_some function, and is known as a composed operation. The - * program must ensure that the stream performs no other read operations (such - * as async_read, the stream's async_read_some function, or any other composed - * operations that perform reads) until this operation completes. - * - * @param s The stream from which the data is to be read. The type must support - * the AsyncReadStream concept. - * - * @param buffers One or more buffers into which the data will be read. The sum - * of the buffer sizes indicates the maximum number of bytes to read from the - * stream. Although the buffers object may be copied as necessary, ownership of - * the underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * - * std::size_t bytes_transferred // Number of bytes copied into the - * // buffers. If an error occurred, - * // this will be the number of - * // bytes successfully transferred - * // prior to the error. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code - * asio::async_read(s, asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - * - * @note This overload is equivalent to calling: - * @code asio::async_read( - * s, buffers, - * asio::transfer_all(), - * handler); @endcode - */ -template -ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read(AsyncReadStream& s, const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler, - typename enable_if< - is_mutable_buffer_sequence::value - >::type* = 0); - -/// Start an asynchronous operation to read a certain amount of data from a -/// stream. -/** - * This function is used to asynchronously read a certain number of bytes of - * data from a stream. The function call always returns immediately. The - * asynchronous operation will continue until one of the following conditions is - * true: - * - * @li The supplied buffers are full. That is, the bytes transferred is equal to - * the sum of the buffer sizes. - * - * @li The completion_condition function object returns 0. - * - * @param s The stream from which the data is to be read. The type must support - * the AsyncReadStream concept. - * - * @param buffers One or more buffers into which the data will be read. The sum - * of the buffer sizes indicates the maximum number of bytes to read from the - * stream. Although the buffers object may be copied as necessary, ownership of - * the underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param completion_condition The function object to be called to determine - * whether the read operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest async_read_some operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the read operation is complete. A non-zero - * return value indicates the maximum number of bytes to be read on the next - * call to the stream's async_read_some function. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * - * std::size_t bytes_transferred // Number of bytes copied into the - * // buffers. If an error occurred, - * // this will be the number of - * // bytes successfully transferred - * // prior to the error. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code asio::async_read(s, - * asio::buffer(data, size), - * asio::transfer_at_least(32), - * handler); @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ -template -ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read(AsyncReadStream& s, const MutableBufferSequence& buffers, - CompletionCondition completion_condition, - ASIO_MOVE_ARG(ReadHandler) handler, - typename enable_if< - is_mutable_buffer_sequence::value - >::type* = 0); - -/// Start an asynchronous operation to read a certain amount of data from a -/// stream. -/** - * This function is used to asynchronously read a certain number of bytes of - * data from a stream. The function call always returns immediately. The - * asynchronous operation will continue until one of the following conditions is - * true: - * - * @li The specified dynamic buffer sequence is full (that is, it has reached - * maximum size). - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * async_read_some function, and is known as a composed operation. The - * program must ensure that the stream performs no other read operations (such - * as async_read, the stream's async_read_some function, or any other composed - * operations that perform reads) until this operation completes. - * - * @param s The stream from which the data is to be read. The type must support - * the AsyncReadStream concept. - * - * @param buffers The dynamic buffer sequence into which the data will be read. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * - * std::size_t bytes_transferred // Number of bytes copied into the - * // buffers. If an error occurred, - * // this will be the number of - * // bytes successfully transferred - * // prior to the error. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note This overload is equivalent to calling: - * @code asio::async_read( - * s, buffers, - * asio::transfer_all(), - * handler); @endcode - */ -template -ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read(AsyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - ASIO_MOVE_ARG(ReadHandler) handler, - typename enable_if< - is_dynamic_buffer::type>::value - >::type* = 0); - -/// Start an asynchronous operation to read a certain amount of data from a -/// stream. -/** - * This function is used to asynchronously read a certain number of bytes of - * data from a stream. The function call always returns immediately. The - * asynchronous operation will continue until one of the following conditions is - * true: - * - * @li The specified dynamic buffer sequence is full (that is, it has reached - * maximum size). - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the stream's - * async_read_some function, and is known as a composed operation. The - * program must ensure that the stream performs no other read operations (such - * as async_read, the stream's async_read_some function, or any other composed - * operations that perform reads) until this operation completes. - * - * @param s The stream from which the data is to be read. The type must support - * the AsyncReadStream concept. - * - * @param buffers The dynamic buffer sequence into which the data will be read. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param completion_condition The function object to be called to determine - * whether the read operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest async_read_some operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the read operation is complete. A non-zero - * return value indicates the maximum number of bytes to be read on the next - * call to the stream's async_read_some function. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * - * std::size_t bytes_transferred // Number of bytes copied into the - * // buffers. If an error occurred, - * // this will be the number of - * // bytes successfully transferred - * // prior to the error. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - */ -template -ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read(AsyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - CompletionCondition completion_condition, - ASIO_MOVE_ARG(ReadHandler) handler, - typename enable_if< - is_dynamic_buffer::type>::value - >::type* = 0); - -#if !defined(ASIO_NO_EXTENSIONS) -#if !defined(ASIO_NO_IOSTREAM) - -/// Start an asynchronous operation to read a certain amount of data from a -/// stream. -/** - * This function is used to asynchronously read a certain number of bytes of - * data from a stream. The function call always returns immediately. The - * asynchronous operation will continue until one of the following conditions is - * true: - * - * @li The supplied buffer is full (that is, it has reached maximum size). - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * async_read_some function, and is known as a composed operation. The - * program must ensure that the stream performs no other read operations (such - * as async_read, the stream's async_read_some function, or any other composed - * operations that perform reads) until this operation completes. - * - * @param s The stream from which the data is to be read. The type must support - * the AsyncReadStream concept. - * - * @param b A basic_streambuf object into which the data will be read. Ownership - * of the streambuf is retained by the caller, which must guarantee that it - * remains valid until the handler is called. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * - * std::size_t bytes_transferred // Number of bytes copied into the - * // buffers. If an error occurred, - * // this will be the number of - * // bytes successfully transferred - * // prior to the error. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note This overload is equivalent to calling: - * @code asio::async_read( - * s, b, - * asio::transfer_all(), - * handler); @endcode - */ -template -ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read(AsyncReadStream& s, basic_streambuf& b, - ASIO_MOVE_ARG(ReadHandler) handler); - -/// Start an asynchronous operation to read a certain amount of data from a -/// stream. -/** - * This function is used to asynchronously read a certain number of bytes of - * data from a stream. The function call always returns immediately. The - * asynchronous operation will continue until one of the following conditions is - * true: - * - * @li The supplied buffer is full (that is, it has reached maximum size). - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the stream's - * async_read_some function, and is known as a composed operation. The - * program must ensure that the stream performs no other read operations (such - * as async_read, the stream's async_read_some function, or any other composed - * operations that perform reads) until this operation completes. - * - * @param s The stream from which the data is to be read. The type must support - * the AsyncReadStream concept. - * - * @param b A basic_streambuf object into which the data will be read. Ownership - * of the streambuf is retained by the caller, which must guarantee that it - * remains valid until the handler is called. - * - * @param completion_condition The function object to be called to determine - * whether the read operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest async_read_some operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the read operation is complete. A non-zero - * return value indicates the maximum number of bytes to be read on the next - * call to the stream's async_read_some function. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * - * std::size_t bytes_transferred // Number of bytes copied into the - * // buffers. If an error occurred, - * // this will be the number of - * // bytes successfully transferred - * // prior to the error. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - */ -template -ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read(AsyncReadStream& s, basic_streambuf& b, - CompletionCondition completion_condition, - ASIO_MOVE_ARG(ReadHandler) handler); - -#endif // !defined(ASIO_NO_IOSTREAM) -#endif // !defined(ASIO_NO_EXTENSIONS) - -/*@}*/ - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/impl/read.hpp" - -#endif // ASIO_READ_HPP diff --git a/tools/sdk/include/asio/asio/read_at.hpp b/tools/sdk/include/asio/asio/read_at.hpp deleted file mode 100644 index df2c628782c..00000000000 --- a/tools/sdk/include/asio/asio/read_at.hpp +++ /dev/null @@ -1,671 +0,0 @@ -// -// read_at.hpp -// ~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_READ_AT_HPP -#define ASIO_READ_AT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/async_result.hpp" -#include "asio/detail/cstdint.hpp" -#include "asio/error.hpp" - -#if !defined(ASIO_NO_EXTENSIONS) -# include "asio/basic_streambuf_fwd.hpp" -#endif // !defined(ASIO_NO_EXTENSIONS) - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/** - * @defgroup read_at asio::read_at - * - * @brief Attempt to read a certain amount of data at the specified offset - * before returning. - */ -/*@{*/ - -/// Attempt to read a certain amount of data at the specified offset before -/// returning. -/** - * This function is used to read a certain number of bytes of data from a - * random access device at the specified offset. The call will block until one - * of the following conditions is true: - * - * @li The supplied buffers are full. That is, the bytes transferred is equal to - * the sum of the buffer sizes. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the device's - * read_some_at function. - * - * @param d The device from which the data is to be read. The type must support - * the SyncRandomAccessReadDevice concept. - * - * @param offset The offset at which the data will be read. - * - * @param buffers One or more buffers into which the data will be read. The sum - * of the buffer sizes indicates the maximum number of bytes to read from the - * device. - * - * @returns The number of bytes transferred. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code asio::read_at(d, 42, asio::buffer(data, size)); @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - * - * @note This overload is equivalent to calling: - * @code asio::read_at( - * d, 42, buffers, - * asio::transfer_all()); @endcode - */ -template -std::size_t read_at(SyncRandomAccessReadDevice& d, - uint64_t offset, const MutableBufferSequence& buffers); - -/// Attempt to read a certain amount of data at the specified offset before -/// returning. -/** - * This function is used to read a certain number of bytes of data from a - * random access device at the specified offset. The call will block until one - * of the following conditions is true: - * - * @li The supplied buffers are full. That is, the bytes transferred is equal to - * the sum of the buffer sizes. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the device's - * read_some_at function. - * - * @param d The device from which the data is to be read. The type must support - * the SyncRandomAccessReadDevice concept. - * - * @param offset The offset at which the data will be read. - * - * @param buffers One or more buffers into which the data will be read. The sum - * of the buffer sizes indicates the maximum number of bytes to read from the - * device. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes transferred. - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code asio::read_at(d, 42, - * asio::buffer(data, size), ec); @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - * - * @note This overload is equivalent to calling: - * @code asio::read_at( - * d, 42, buffers, - * asio::transfer_all(), ec); @endcode - */ -template -std::size_t read_at(SyncRandomAccessReadDevice& d, - uint64_t offset, const MutableBufferSequence& buffers, - asio::error_code& ec); - -/// Attempt to read a certain amount of data at the specified offset before -/// returning. -/** - * This function is used to read a certain number of bytes of data from a - * random access device at the specified offset. The call will block until one - * of the following conditions is true: - * - * @li The supplied buffers are full. That is, the bytes transferred is equal to - * the sum of the buffer sizes. - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the device's - * read_some_at function. - * - * @param d The device from which the data is to be read. The type must support - * the SyncRandomAccessReadDevice concept. - * - * @param offset The offset at which the data will be read. - * - * @param buffers One or more buffers into which the data will be read. The sum - * of the buffer sizes indicates the maximum number of bytes to read from the - * device. - * - * @param completion_condition The function object to be called to determine - * whether the read operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest read_some_at operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the read operation is complete. A non-zero - * return value indicates the maximum number of bytes to be read on the next - * call to the device's read_some_at function. - * - * @returns The number of bytes transferred. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code asio::read_at(d, 42, asio::buffer(data, size), - * asio::transfer_at_least(32)); @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ -template -std::size_t read_at(SyncRandomAccessReadDevice& d, - uint64_t offset, const MutableBufferSequence& buffers, - CompletionCondition completion_condition); - -/// Attempt to read a certain amount of data at the specified offset before -/// returning. -/** - * This function is used to read a certain number of bytes of data from a - * random access device at the specified offset. The call will block until one - * of the following conditions is true: - * - * @li The supplied buffers are full. That is, the bytes transferred is equal to - * the sum of the buffer sizes. - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the device's - * read_some_at function. - * - * @param d The device from which the data is to be read. The type must support - * the SyncRandomAccessReadDevice concept. - * - * @param offset The offset at which the data will be read. - * - * @param buffers One or more buffers into which the data will be read. The sum - * of the buffer sizes indicates the maximum number of bytes to read from the - * device. - * - * @param completion_condition The function object to be called to determine - * whether the read operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest read_some_at operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the read operation is complete. A non-zero - * return value indicates the maximum number of bytes to be read on the next - * call to the device's read_some_at function. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes read. If an error occurs, returns the total - * number of bytes successfully transferred prior to the error. - */ -template -std::size_t read_at(SyncRandomAccessReadDevice& d, - uint64_t offset, const MutableBufferSequence& buffers, - CompletionCondition completion_condition, asio::error_code& ec); - -#if !defined(ASIO_NO_EXTENSIONS) -#if !defined(ASIO_NO_IOSTREAM) - -/// Attempt to read a certain amount of data at the specified offset before -/// returning. -/** - * This function is used to read a certain number of bytes of data from a - * random access device at the specified offset. The call will block until one - * of the following conditions is true: - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the device's - * read_some_at function. - * - * @param d The device from which the data is to be read. The type must support - * the SyncRandomAccessReadDevice concept. - * - * @param offset The offset at which the data will be read. - * - * @param b The basic_streambuf object into which the data will be read. - * - * @returns The number of bytes transferred. - * - * @throws asio::system_error Thrown on failure. - * - * @note This overload is equivalent to calling: - * @code asio::read_at( - * d, 42, b, - * asio::transfer_all()); @endcode - */ -template -std::size_t read_at(SyncRandomAccessReadDevice& d, - uint64_t offset, basic_streambuf& b); - -/// Attempt to read a certain amount of data at the specified offset before -/// returning. -/** - * This function is used to read a certain number of bytes of data from a - * random access device at the specified offset. The call will block until one - * of the following conditions is true: - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the device's - * read_some_at function. - * - * @param d The device from which the data is to be read. The type must support - * the SyncRandomAccessReadDevice concept. - * - * @param offset The offset at which the data will be read. - * - * @param b The basic_streambuf object into which the data will be read. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes transferred. - * - * @note This overload is equivalent to calling: - * @code asio::read_at( - * d, 42, b, - * asio::transfer_all(), ec); @endcode - */ -template -std::size_t read_at(SyncRandomAccessReadDevice& d, - uint64_t offset, basic_streambuf& b, - asio::error_code& ec); - -/// Attempt to read a certain amount of data at the specified offset before -/// returning. -/** - * This function is used to read a certain number of bytes of data from a - * random access device at the specified offset. The call will block until one - * of the following conditions is true: - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the device's - * read_some_at function. - * - * @param d The device from which the data is to be read. The type must support - * the SyncRandomAccessReadDevice concept. - * - * @param offset The offset at which the data will be read. - * - * @param b The basic_streambuf object into which the data will be read. - * - * @param completion_condition The function object to be called to determine - * whether the read operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest read_some_at operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the read operation is complete. A non-zero - * return value indicates the maximum number of bytes to be read on the next - * call to the device's read_some_at function. - * - * @returns The number of bytes transferred. - * - * @throws asio::system_error Thrown on failure. - */ -template -std::size_t read_at(SyncRandomAccessReadDevice& d, - uint64_t offset, basic_streambuf& b, - CompletionCondition completion_condition); - -/// Attempt to read a certain amount of data at the specified offset before -/// returning. -/** - * This function is used to read a certain number of bytes of data from a - * random access device at the specified offset. The call will block until one - * of the following conditions is true: - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the device's - * read_some_at function. - * - * @param d The device from which the data is to be read. The type must support - * the SyncRandomAccessReadDevice concept. - * - * @param offset The offset at which the data will be read. - * - * @param b The basic_streambuf object into which the data will be read. - * - * @param completion_condition The function object to be called to determine - * whether the read operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest read_some_at operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the read operation is complete. A non-zero - * return value indicates the maximum number of bytes to be read on the next - * call to the device's read_some_at function. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes read. If an error occurs, returns the total - * number of bytes successfully transferred prior to the error. - */ -template -std::size_t read_at(SyncRandomAccessReadDevice& d, - uint64_t offset, basic_streambuf& b, - CompletionCondition completion_condition, asio::error_code& ec); - -#endif // !defined(ASIO_NO_IOSTREAM) -#endif // !defined(ASIO_NO_EXTENSIONS) - -/*@}*/ -/** - * @defgroup async_read_at asio::async_read_at - * - * @brief Start an asynchronous operation to read a certain amount of data at - * the specified offset. - */ -/*@{*/ - -/// Start an asynchronous operation to read a certain amount of data at the -/// specified offset. -/** - * This function is used to asynchronously read a certain number of bytes of - * data from a random access device at the specified offset. The function call - * always returns immediately. The asynchronous operation will continue until - * one of the following conditions is true: - * - * @li The supplied buffers are full. That is, the bytes transferred is equal to - * the sum of the buffer sizes. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the device's - * async_read_some_at function. - * - * @param d The device from which the data is to be read. The type must support - * the AsyncRandomAccessReadDevice concept. - * - * @param offset The offset at which the data will be read. - * - * @param buffers One or more buffers into which the data will be read. The sum - * of the buffer sizes indicates the maximum number of bytes to read from the - * device. Although the buffers object may be copied as necessary, ownership of - * the underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * // Result of operation. - * const asio::error_code& error, - * - * // Number of bytes copied into the buffers. If an error - * // occurred, this will be the number of bytes successfully - * // transferred prior to the error. - * std::size_t bytes_transferred - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code - * asio::async_read_at(d, 42, asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - * - * @note This overload is equivalent to calling: - * @code asio::async_read_at( - * d, 42, buffers, - * asio::transfer_all(), - * handler); @endcode - */ -template -ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read_at(AsyncRandomAccessReadDevice& d, uint64_t offset, - const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler); - -/// Start an asynchronous operation to read a certain amount of data at the -/// specified offset. -/** - * This function is used to asynchronously read a certain number of bytes of - * data from a random access device at the specified offset. The function call - * always returns immediately. The asynchronous operation will continue until - * one of the following conditions is true: - * - * @li The supplied buffers are full. That is, the bytes transferred is equal to - * the sum of the buffer sizes. - * - * @li The completion_condition function object returns 0. - * - * @param d The device from which the data is to be read. The type must support - * the AsyncRandomAccessReadDevice concept. - * - * @param offset The offset at which the data will be read. - * - * @param buffers One or more buffers into which the data will be read. The sum - * of the buffer sizes indicates the maximum number of bytes to read from the - * device. Although the buffers object may be copied as necessary, ownership of - * the underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param completion_condition The function object to be called to determine - * whether the read operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest async_read_some_at operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the read operation is complete. A non-zero - * return value indicates the maximum number of bytes to be read on the next - * call to the device's async_read_some_at function. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * // Result of operation. - * const asio::error_code& error, - * - * // Number of bytes copied into the buffers. If an error - * // occurred, this will be the number of bytes successfully - * // transferred prior to the error. - * std::size_t bytes_transferred - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code asio::async_read_at(d, 42, - * asio::buffer(data, size), - * asio::transfer_at_least(32), - * handler); @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ -template -ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read_at(AsyncRandomAccessReadDevice& d, - uint64_t offset, const MutableBufferSequence& buffers, - CompletionCondition completion_condition, - ASIO_MOVE_ARG(ReadHandler) handler); - -#if !defined(ASIO_NO_EXTENSIONS) -#if !defined(ASIO_NO_IOSTREAM) - -/// Start an asynchronous operation to read a certain amount of data at the -/// specified offset. -/** - * This function is used to asynchronously read a certain number of bytes of - * data from a random access device at the specified offset. The function call - * always returns immediately. The asynchronous operation will continue until - * one of the following conditions is true: - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the device's - * async_read_some_at function. - * - * @param d The device from which the data is to be read. The type must support - * the AsyncRandomAccessReadDevice concept. - * - * @param offset The offset at which the data will be read. - * - * @param b A basic_streambuf object into which the data will be read. Ownership - * of the streambuf is retained by the caller, which must guarantee that it - * remains valid until the handler is called. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * // Result of operation. - * const asio::error_code& error, - * - * // Number of bytes copied into the buffers. If an error - * // occurred, this will be the number of bytes successfully - * // transferred prior to the error. - * std::size_t bytes_transferred - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note This overload is equivalent to calling: - * @code asio::async_read_at( - * d, 42, b, - * asio::transfer_all(), - * handler); @endcode - */ -template -ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read_at(AsyncRandomAccessReadDevice& d, uint64_t offset, - basic_streambuf& b, ASIO_MOVE_ARG(ReadHandler) handler); - -/// Start an asynchronous operation to read a certain amount of data at the -/// specified offset. -/** - * This function is used to asynchronously read a certain number of bytes of - * data from a random access device at the specified offset. The function call - * always returns immediately. The asynchronous operation will continue until - * one of the following conditions is true: - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the device's - * async_read_some_at function. - * - * @param d The device from which the data is to be read. The type must support - * the AsyncRandomAccessReadDevice concept. - * - * @param offset The offset at which the data will be read. - * - * @param b A basic_streambuf object into which the data will be read. Ownership - * of the streambuf is retained by the caller, which must guarantee that it - * remains valid until the handler is called. - * - * @param completion_condition The function object to be called to determine - * whether the read operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest async_read_some_at operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the read operation is complete. A non-zero - * return value indicates the maximum number of bytes to be read on the next - * call to the device's async_read_some_at function. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * // Result of operation. - * const asio::error_code& error, - * - * // Number of bytes copied into the buffers. If an error - * // occurred, this will be the number of bytes successfully - * // transferred prior to the error. - * std::size_t bytes_transferred - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - */ -template -ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read_at(AsyncRandomAccessReadDevice& d, - uint64_t offset, basic_streambuf& b, - CompletionCondition completion_condition, - ASIO_MOVE_ARG(ReadHandler) handler); - -#endif // !defined(ASIO_NO_IOSTREAM) -#endif // !defined(ASIO_NO_EXTENSIONS) - -/*@}*/ - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/impl/read_at.hpp" - -#endif // ASIO_READ_AT_HPP diff --git a/tools/sdk/include/asio/asio/read_until.hpp b/tools/sdk/include/asio/asio/read_until.hpp deleted file mode 100644 index f413d987d0f..00000000000 --- a/tools/sdk/include/asio/asio/read_until.hpp +++ /dev/null @@ -1,1824 +0,0 @@ -// -// read_until.hpp -// ~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_READ_UNTIL_HPP -#define ASIO_READ_UNTIL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include -#include "asio/async_result.hpp" -#include "asio/detail/regex_fwd.hpp" -#include "asio/detail/string_view.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/error.hpp" - -#if !defined(ASIO_NO_EXTENSIONS) -# include "asio/basic_streambuf_fwd.hpp" -#endif // !defined(ASIO_NO_EXTENSIONS) - -#include "asio/detail/push_options.hpp" - -namespace asio { - -namespace detail -{ - char (&has_result_type_helper(...))[2]; - - template - char has_result_type_helper(T*, typename T::result_type* = 0); - - template - struct has_result_type - { - enum { value = (sizeof((has_result_type_helper)((T*)(0))) == 1) }; - }; -} // namespace detail - -/// Type trait used to determine whether a type can be used as a match condition -/// function with read_until and async_read_until. -template -struct is_match_condition -{ -#if defined(GENERATING_DOCUMENTATION) - /// The value member is true if the type may be used as a match condition. - static const bool value; -#else - enum - { - value = asio::is_function< - typename asio::remove_pointer::type>::value - || detail::has_result_type::value - }; -#endif -}; - -/** - * @defgroup read_until asio::read_until - * - * @brief Read data into a dynamic buffer sequence, or into a streambuf, until - * it contains a delimiter, matches a regular expression, or a function object - * indicates a match. - */ -/*@{*/ - -/// Read data into a dynamic buffer sequence until it contains a specified -/// delimiter. -/** - * This function is used to read data into the specified dynamic buffer - * sequence until the dynamic buffer sequence's get area contains the specified - * delimiter. The call will block until one of the following conditions is - * true: - * - * @li The get area of the dynamic buffer sequence contains the specified - * delimiter. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. If the dynamic buffer sequence's get area already - * contains the delimiter, the function returns immediately. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param buffers The dynamic buffer sequence into which the data will be read. - * - * @param delim The delimiter character. - * - * @returns The number of bytes in the dynamic buffer sequence's get area up to - * and including the delimiter. - * - * @throws asio::system_error Thrown on failure. - * - * @note After a successful read_until operation, the dynamic buffer sequence - * may contain additional data beyond the delimiter. An application will - * typically leave that data in the dynamic buffer sequence for a subsequent - * read_until operation to examine. - * - * @par Example - * To read data into a @c std::string until a newline is encountered: - * @code std::string data; - * std::string n = asio::read_until(s, - * asio::dynamic_buffer(data), '\n'); - * std::string line = data.substr(0, n); - * data.erase(0, n); @endcode - * After the @c read_until operation completes successfully, the string @c data - * contains the delimiter: - * @code { 'a', 'b', ..., 'c', '\n', 'd', 'e', ... } @endcode - * The call to @c substr then extracts the data up to and including the - * delimiter, so that the string @c line contains: - * @code { 'a', 'b', ..., 'c', '\n' } @endcode - * After the call to @c erase, the remaining data is left in the buffer @c b as - * follows: - * @code { 'd', 'e', ... } @endcode - * This data may be the start of a new line, to be extracted by a subsequent - * @c read_until operation. - */ -template -std::size_t read_until(SyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, char delim); - -/// Read data into a dynamic buffer sequence until it contains a specified -/// delimiter. -/** - * This function is used to read data into the specified dynamic buffer - * sequence until the dynamic buffer sequence's get area contains the specified - * delimiter. The call will block until one of the following conditions is - * true: - * - * @li The get area of the dynamic buffer sequence contains the specified - * delimiter. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. If the dynamic buffer sequence's get area already - * contains the delimiter, the function returns immediately. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param buffers The dynamic buffer sequence into which the data will be read. - * - * @param delim The delimiter character. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes in the dynamic buffer sequence's get area up to - * and including the delimiter. Returns 0 if an error occurred. - * - * @note After a successful read_until operation, the dynamic buffer sequence - * may contain additional data beyond the delimiter. An application will - * typically leave that data in the dynamic buffer sequence for a subsequent - * read_until operation to examine. - */ -template -std::size_t read_until(SyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - char delim, asio::error_code& ec); - -/// Read data into a dynamic buffer sequence until it contains a specified -/// delimiter. -/** - * This function is used to read data into the specified dynamic buffer - * sequence until the dynamic buffer sequence's get area contains the specified - * delimiter. The call will block until one of the following conditions is - * true: - * - * @li The get area of the dynamic buffer sequence contains the specified - * delimiter. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. If the dynamic buffer sequence's get area already - * contains the delimiter, the function returns immediately. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param buffers The dynamic buffer sequence into which the data will be read. - * - * @param delim The delimiter string. - * - * @returns The number of bytes in the dynamic buffer sequence's get area up to - * and including the delimiter. - * - * @note After a successful read_until operation, the dynamic buffer sequence - * may contain additional data beyond the delimiter. An application will - * typically leave that data in the dynamic buffer sequence for a subsequent - * read_until operation to examine. - * - * @par Example - * To read data into a @c std::string until a CR-LF sequence is encountered: - * @code std::string data; - * std::string n = asio::read_until(s, - * asio::dynamic_buffer(data), "\r\n"); - * std::string line = data.substr(0, n); - * data.erase(0, n); @endcode - * After the @c read_until operation completes successfully, the string @c data - * contains the delimiter: - * @code { 'a', 'b', ..., 'c', '\r', '\n', 'd', 'e', ... } @endcode - * The call to @c substr then extracts the data up to and including the - * delimiter, so that the string @c line contains: - * @code { 'a', 'b', ..., 'c', '\r', '\n' } @endcode - * After the call to @c erase, the remaining data is left in the buffer @c b as - * follows: - * @code { 'd', 'e', ... } @endcode - * This data may be the start of a new line, to be extracted by a subsequent - * @c read_until operation. - */ -template -std::size_t read_until(SyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - ASIO_STRING_VIEW_PARAM delim); - -/// Read data into a dynamic buffer sequence until it contains a specified -/// delimiter. -/** - * This function is used to read data into the specified dynamic buffer - * sequence until the dynamic buffer sequence's get area contains the specified - * delimiter. The call will block until one of the following conditions is - * true: - * - * @li The get area of the dynamic buffer sequence contains the specified - * delimiter. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. If the dynamic buffer sequence's get area already - * contains the delimiter, the function returns immediately. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param buffers The dynamic buffer sequence into which the data will be read. - * - * @param delim The delimiter string. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes in the dynamic buffer sequence's get area up to - * and including the delimiter. Returns 0 if an error occurred. - * - * @note After a successful read_until operation, the dynamic buffer sequence - * may contain additional data beyond the delimiter. An application will - * typically leave that data in the dynamic buffer sequence for a subsequent - * read_until operation to examine. - */ -template -std::size_t read_until(SyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - ASIO_STRING_VIEW_PARAM delim, - asio::error_code& ec); - -#if !defined(ASIO_NO_EXTENSIONS) -#if defined(ASIO_HAS_BOOST_REGEX) \ - || defined(GENERATING_DOCUMENTATION) - -/// Read data into a dynamic buffer sequence until some part of the data it -/// contains matches a regular expression. -/** - * This function is used to read data into the specified dynamic buffer - * sequence until the dynamic buffer sequence's get area contains some data - * that matches a regular expression. The call will block until one of the - * following conditions is true: - * - * @li A substring of the dynamic buffer sequence's get area matches the - * regular expression. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. If the dynamic buffer sequence's get area already - * contains data that matches the regular expression, the function returns - * immediately. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param buffers A dynamic buffer sequence into which the data will be read. - * - * @param expr The regular expression. - * - * @returns The number of bytes in the dynamic buffer sequence's get area up to - * and including the substring that matches the regular expression. - * - * @throws asio::system_error Thrown on failure. - * - * @note After a successful read_until operation, the dynamic buffer sequence - * may contain additional data beyond that which matched the regular - * expression. An application will typically leave that data in the dynamic - * buffer sequence for a subsequent read_until operation to examine. - * - * @par Example - * To read data into a @c std::string until a CR-LF sequence is encountered: - * @code std::string data; - * std::string n = asio::read_until(s, - * asio::dynamic_buffer(data), boost::regex("\r\n")); - * std::string line = data.substr(0, n); - * data.erase(0, n); @endcode - * After the @c read_until operation completes successfully, the string @c data - * contains the delimiter: - * @code { 'a', 'b', ..., 'c', '\r', '\n', 'd', 'e', ... } @endcode - * The call to @c substr then extracts the data up to and including the - * delimiter, so that the string @c line contains: - * @code { 'a', 'b', ..., 'c', '\r', '\n' } @endcode - * After the call to @c erase, the remaining data is left in the buffer @c b as - * follows: - * @code { 'd', 'e', ... } @endcode - * This data may be the start of a new line, to be extracted by a subsequent - * @c read_until operation. - */ -template -std::size_t read_until(SyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - const boost::regex& expr); - -/// Read data into a dynamic buffer sequence until some part of the data it -/// contains matches a regular expression. -/** - * This function is used to read data into the specified dynamic buffer - * sequence until the dynamic buffer sequence's get area contains some data - * that matches a regular expression. The call will block until one of the - * following conditions is true: - * - * @li A substring of the dynamic buffer sequence's get area matches the - * regular expression. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. If the dynamic buffer sequence's get area already - * contains data that matches the regular expression, the function returns - * immediately. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param buffers A dynamic buffer sequence into which the data will be read. - * - * @param expr The regular expression. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes in the dynamic buffer sequence's get area up to - * and including the substring that matches the regular expression. Returns 0 - * if an error occurred. - * - * @note After a successful read_until operation, the dynamic buffer sequence - * may contain additional data beyond that which matched the regular - * expression. An application will typically leave that data in the dynamic - * buffer sequence for a subsequent read_until operation to examine. - */ -template -std::size_t read_until(SyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - const boost::regex& expr, asio::error_code& ec); - -#endif // defined(ASIO_HAS_BOOST_REGEX) - // || defined(GENERATING_DOCUMENTATION) - -/// Read data into a dynamic buffer sequence until a function object indicates a -/// match. - -/** - * This function is used to read data into the specified dynamic buffer - * sequence until a user-defined match condition function object, when applied - * to the data contained in the dynamic buffer sequence, indicates a successful - * match. The call will block until one of the following conditions is true: - * - * @li The match condition function object returns a std::pair where the second - * element evaluates to true. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. If the match condition function object already indicates - * a match, the function returns immediately. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param buffers A dynamic buffer sequence into which the data will be read. - * - * @param match_condition The function object to be called to determine whether - * a match exists. The signature of the function object must be: - * @code pair match_condition(iterator begin, iterator end); - * @endcode - * where @c iterator represents the type: - * @code buffers_iterator - * @endcode - * The iterator parameters @c begin and @c end define the range of bytes to be - * scanned to determine whether there is a match. The @c first member of the - * return value is an iterator marking one-past-the-end of the bytes that have - * been consumed by the match function. This iterator is used to calculate the - * @c begin parameter for any subsequent invocation of the match condition. The - * @c second member of the return value is true if a match has been found, false - * otherwise. - * - * @returns The number of bytes in the dynamic_buffer's get area that - * have been fully consumed by the match function. - * - * @throws asio::system_error Thrown on failure. - * - * @note After a successful read_until operation, the dynamic buffer sequence - * may contain additional data beyond that which matched the function object. - * An application will typically leave that data in the dynamic buffer sequence - * for a subsequent read_until operation to examine. - - * @note The default implementation of the @c is_match_condition type trait - * evaluates to true for function pointers and function objects with a - * @c result_type typedef. It must be specialised for other user-defined - * function objects. - * - * @par Examples - * To read data into a dynamic buffer sequence until whitespace is encountered: - * @code typedef asio::buffers_iterator< - * asio::const_buffers_1> iterator; - * - * std::pair - * match_whitespace(iterator begin, iterator end) - * { - * iterator i = begin; - * while (i != end) - * if (std::isspace(*i++)) - * return std::make_pair(i, true); - * return std::make_pair(i, false); - * } - * ... - * std::string data; - * asio::read_until(s, data, match_whitespace); - * @endcode - * - * To read data into a @c std::string until a matching character is found: - * @code class match_char - * { - * public: - * explicit match_char(char c) : c_(c) {} - * - * template - * std::pair operator()( - * Iterator begin, Iterator end) const - * { - * Iterator i = begin; - * while (i != end) - * if (c_ == *i++) - * return std::make_pair(i, true); - * return std::make_pair(i, false); - * } - * - * private: - * char c_; - * }; - * - * namespace asio { - * template <> struct is_match_condition - * : public boost::true_type {}; - * } // namespace asio - * ... - * std::string data; - * asio::read_until(s, data, match_char('a')); - * @endcode - */ -template -std::size_t read_until(SyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - MatchCondition match_condition, - typename enable_if::value>::type* = 0); - -/// Read data into a dynamic buffer sequence until a function object indicates a -/// match. -/** - * This function is used to read data into the specified dynamic buffer - * sequence until a user-defined match condition function object, when applied - * to the data contained in the dynamic buffer sequence, indicates a successful - * match. The call will block until one of the following conditions is true: - * - * @li The match condition function object returns a std::pair where the second - * element evaluates to true. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. If the match condition function object already indicates - * a match, the function returns immediately. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param buffers A dynamic buffer sequence into which the data will be read. - * - * @param match_condition The function object to be called to determine whether - * a match exists. The signature of the function object must be: - * @code pair match_condition(iterator begin, iterator end); - * @endcode - * where @c iterator represents the type: - * @code buffers_iterator - * @endcode - * The iterator parameters @c begin and @c end define the range of bytes to be - * scanned to determine whether there is a match. The @c first member of the - * return value is an iterator marking one-past-the-end of the bytes that have - * been consumed by the match function. This iterator is used to calculate the - * @c begin parameter for any subsequent invocation of the match condition. The - * @c second member of the return value is true if a match has been found, false - * otherwise. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes in the dynamic buffer sequence's get area that - * have been fully consumed by the match function. Returns 0 if an error - * occurred. - * - * @note After a successful read_until operation, the dynamic buffer sequence - * may contain additional data beyond that which matched the function object. - * An application will typically leave that data in the dynamic buffer sequence - * for a subsequent read_until operation to examine. - * - * @note The default implementation of the @c is_match_condition type trait - * evaluates to true for function pointers and function objects with a - * @c result_type typedef. It must be specialised for other user-defined - * function objects. - */ -template -std::size_t read_until(SyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - MatchCondition match_condition, asio::error_code& ec, - typename enable_if::value>::type* = 0); - -#if !defined(ASIO_NO_IOSTREAM) - -/// Read data into a streambuf until it contains a specified delimiter. -/** - * This function is used to read data into the specified streambuf until the - * streambuf's get area contains the specified delimiter. The call will block - * until one of the following conditions is true: - * - * @li The get area of the streambuf contains the specified delimiter. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. If the streambuf's get area already contains the - * delimiter, the function returns immediately. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param b A streambuf object into which the data will be read. - * - * @param delim The delimiter character. - * - * @returns The number of bytes in the streambuf's get area up to and including - * the delimiter. - * - * @throws asio::system_error Thrown on failure. - * - * @note After a successful read_until operation, the streambuf may contain - * additional data beyond the delimiter. An application will typically leave - * that data in the streambuf for a subsequent read_until operation to examine. - * - * @par Example - * To read data into a streambuf until a newline is encountered: - * @code asio::streambuf b; - * asio::read_until(s, b, '\n'); - * std::istream is(&b); - * std::string line; - * std::getline(is, line); @endcode - * After the @c read_until operation completes successfully, the buffer @c b - * contains the delimiter: - * @code { 'a', 'b', ..., 'c', '\n', 'd', 'e', ... } @endcode - * The call to @c std::getline then extracts the data up to and including the - * newline (which is discarded), so that the string @c line contains: - * @code { 'a', 'b', ..., 'c' } @endcode - * The remaining data is left in the buffer @c b as follows: - * @code { 'd', 'e', ... } @endcode - * This data may be the start of a new line, to be extracted by a subsequent - * @c read_until operation. - */ -template -std::size_t read_until(SyncReadStream& s, - asio::basic_streambuf& b, char delim); - -/// Read data into a streambuf until it contains a specified delimiter. -/** - * This function is used to read data into the specified streambuf until the - * streambuf's get area contains the specified delimiter. The call will block - * until one of the following conditions is true: - * - * @li The get area of the streambuf contains the specified delimiter. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. If the streambuf's get area already contains the - * delimiter, the function returns immediately. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param b A streambuf object into which the data will be read. - * - * @param delim The delimiter character. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes in the streambuf's get area up to and including - * the delimiter. Returns 0 if an error occurred. - * - * @note After a successful read_until operation, the streambuf may contain - * additional data beyond the delimiter. An application will typically leave - * that data in the streambuf for a subsequent read_until operation to examine. - */ -template -std::size_t read_until(SyncReadStream& s, - asio::basic_streambuf& b, char delim, - asio::error_code& ec); - -/// Read data into a streambuf until it contains a specified delimiter. -/** - * This function is used to read data into the specified streambuf until the - * streambuf's get area contains the specified delimiter. The call will block - * until one of the following conditions is true: - * - * @li The get area of the streambuf contains the specified delimiter. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. If the streambuf's get area already contains the - * delimiter, the function returns immediately. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param b A streambuf object into which the data will be read. - * - * @param delim The delimiter string. - * - * @returns The number of bytes in the streambuf's get area up to and including - * the delimiter. - * - * @throws asio::system_error Thrown on failure. - * - * @note After a successful read_until operation, the streambuf may contain - * additional data beyond the delimiter. An application will typically leave - * that data in the streambuf for a subsequent read_until operation to examine. - * - * @par Example - * To read data into a streambuf until a newline is encountered: - * @code asio::streambuf b; - * asio::read_until(s, b, "\r\n"); - * std::istream is(&b); - * std::string line; - * std::getline(is, line); @endcode - * After the @c read_until operation completes successfully, the buffer @c b - * contains the delimiter: - * @code { 'a', 'b', ..., 'c', '\r', '\n', 'd', 'e', ... } @endcode - * The call to @c std::getline then extracts the data up to and including the - * newline (which is discarded), so that the string @c line contains: - * @code { 'a', 'b', ..., 'c', '\r' } @endcode - * The remaining data is left in the buffer @c b as follows: - * @code { 'd', 'e', ... } @endcode - * This data may be the start of a new line, to be extracted by a subsequent - * @c read_until operation. - */ -template -std::size_t read_until(SyncReadStream& s, - asio::basic_streambuf& b, - ASIO_STRING_VIEW_PARAM delim); - -/// Read data into a streambuf until it contains a specified delimiter. -/** - * This function is used to read data into the specified streambuf until the - * streambuf's get area contains the specified delimiter. The call will block - * until one of the following conditions is true: - * - * @li The get area of the streambuf contains the specified delimiter. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. If the streambuf's get area already contains the - * delimiter, the function returns immediately. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param b A streambuf object into which the data will be read. - * - * @param delim The delimiter string. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes in the streambuf's get area up to and including - * the delimiter. Returns 0 if an error occurred. - * - * @note After a successful read_until operation, the streambuf may contain - * additional data beyond the delimiter. An application will typically leave - * that data in the streambuf for a subsequent read_until operation to examine. - */ -template -std::size_t read_until(SyncReadStream& s, - asio::basic_streambuf& b, - ASIO_STRING_VIEW_PARAM delim, asio::error_code& ec); - -#if defined(ASIO_HAS_BOOST_REGEX) \ - || defined(GENERATING_DOCUMENTATION) - -/// Read data into a streambuf until some part of the data it contains matches -/// a regular expression. -/** - * This function is used to read data into the specified streambuf until the - * streambuf's get area contains some data that matches a regular expression. - * The call will block until one of the following conditions is true: - * - * @li A substring of the streambuf's get area matches the regular expression. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. If the streambuf's get area already contains data that - * matches the regular expression, the function returns immediately. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param b A streambuf object into which the data will be read. - * - * @param expr The regular expression. - * - * @returns The number of bytes in the streambuf's get area up to and including - * the substring that matches the regular expression. - * - * @throws asio::system_error Thrown on failure. - * - * @note After a successful read_until operation, the streambuf may contain - * additional data beyond that which matched the regular expression. An - * application will typically leave that data in the streambuf for a subsequent - * read_until operation to examine. - * - * @par Example - * To read data into a streambuf until a CR-LF sequence is encountered: - * @code asio::streambuf b; - * asio::read_until(s, b, boost::regex("\r\n")); - * std::istream is(&b); - * std::string line; - * std::getline(is, line); @endcode - * After the @c read_until operation completes successfully, the buffer @c b - * contains the data which matched the regular expression: - * @code { 'a', 'b', ..., 'c', '\r', '\n', 'd', 'e', ... } @endcode - * The call to @c std::getline then extracts the data up to and including the - * newline (which is discarded), so that the string @c line contains: - * @code { 'a', 'b', ..., 'c', '\r' } @endcode - * The remaining data is left in the buffer @c b as follows: - * @code { 'd', 'e', ... } @endcode - * This data may be the start of a new line, to be extracted by a subsequent - * @c read_until operation. - */ -template -std::size_t read_until(SyncReadStream& s, - asio::basic_streambuf& b, const boost::regex& expr); - -/// Read data into a streambuf until some part of the data it contains matches -/// a regular expression. -/** - * This function is used to read data into the specified streambuf until the - * streambuf's get area contains some data that matches a regular expression. - * The call will block until one of the following conditions is true: - * - * @li A substring of the streambuf's get area matches the regular expression. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. If the streambuf's get area already contains data that - * matches the regular expression, the function returns immediately. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param b A streambuf object into which the data will be read. - * - * @param expr The regular expression. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes in the streambuf's get area up to and including - * the substring that matches the regular expression. Returns 0 if an error - * occurred. - * - * @note After a successful read_until operation, the streambuf may contain - * additional data beyond that which matched the regular expression. An - * application will typically leave that data in the streambuf for a subsequent - * read_until operation to examine. - */ -template -std::size_t read_until(SyncReadStream& s, - asio::basic_streambuf& b, const boost::regex& expr, - asio::error_code& ec); - -#endif // defined(ASIO_HAS_BOOST_REGEX) - // || defined(GENERATING_DOCUMENTATION) - -/// Read data into a streambuf until a function object indicates a match. -/** - * This function is used to read data into the specified streambuf until a - * user-defined match condition function object, when applied to the data - * contained in the streambuf, indicates a successful match. The call will - * block until one of the following conditions is true: - * - * @li The match condition function object returns a std::pair where the second - * element evaluates to true. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. If the match condition function object already indicates - * a match, the function returns immediately. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param b A streambuf object into which the data will be read. - * - * @param match_condition The function object to be called to determine whether - * a match exists. The signature of the function object must be: - * @code pair match_condition(iterator begin, iterator end); - * @endcode - * where @c iterator represents the type: - * @code buffers_iterator::const_buffers_type> - * @endcode - * The iterator parameters @c begin and @c end define the range of bytes to be - * scanned to determine whether there is a match. The @c first member of the - * return value is an iterator marking one-past-the-end of the bytes that have - * been consumed by the match function. This iterator is used to calculate the - * @c begin parameter for any subsequent invocation of the match condition. The - * @c second member of the return value is true if a match has been found, false - * otherwise. - * - * @returns The number of bytes in the streambuf's get area that have been fully - * consumed by the match function. - * - * @throws asio::system_error Thrown on failure. - * - * @note After a successful read_until operation, the streambuf may contain - * additional data beyond that which matched the function object. An application - * will typically leave that data in the streambuf for a subsequent read_until - * operation to examine. - * - * @note The default implementation of the @c is_match_condition type trait - * evaluates to true for function pointers and function objects with a - * @c result_type typedef. It must be specialised for other user-defined - * function objects. - * - * @par Examples - * To read data into a streambuf until whitespace is encountered: - * @code typedef asio::buffers_iterator< - * asio::streambuf::const_buffers_type> iterator; - * - * std::pair - * match_whitespace(iterator begin, iterator end) - * { - * iterator i = begin; - * while (i != end) - * if (std::isspace(*i++)) - * return std::make_pair(i, true); - * return std::make_pair(i, false); - * } - * ... - * asio::streambuf b; - * asio::read_until(s, b, match_whitespace); - * @endcode - * - * To read data into a streambuf until a matching character is found: - * @code class match_char - * { - * public: - * explicit match_char(char c) : c_(c) {} - * - * template - * std::pair operator()( - * Iterator begin, Iterator end) const - * { - * Iterator i = begin; - * while (i != end) - * if (c_ == *i++) - * return std::make_pair(i, true); - * return std::make_pair(i, false); - * } - * - * private: - * char c_; - * }; - * - * namespace asio { - * template <> struct is_match_condition - * : public boost::true_type {}; - * } // namespace asio - * ... - * asio::streambuf b; - * asio::read_until(s, b, match_char('a')); - * @endcode - */ -template -std::size_t read_until(SyncReadStream& s, - asio::basic_streambuf& b, MatchCondition match_condition, - typename enable_if::value>::type* = 0); - -/// Read data into a streambuf until a function object indicates a match. -/** - * This function is used to read data into the specified streambuf until a - * user-defined match condition function object, when applied to the data - * contained in the streambuf, indicates a successful match. The call will - * block until one of the following conditions is true: - * - * @li The match condition function object returns a std::pair where the second - * element evaluates to true. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * read_some function. If the match condition function object already indicates - * a match, the function returns immediately. - * - * @param s The stream from which the data is to be read. The type must support - * the SyncReadStream concept. - * - * @param b A streambuf object into which the data will be read. - * - * @param match_condition The function object to be called to determine whether - * a match exists. The signature of the function object must be: - * @code pair match_condition(iterator begin, iterator end); - * @endcode - * where @c iterator represents the type: - * @code buffers_iterator::const_buffers_type> - * @endcode - * The iterator parameters @c begin and @c end define the range of bytes to be - * scanned to determine whether there is a match. The @c first member of the - * return value is an iterator marking one-past-the-end of the bytes that have - * been consumed by the match function. This iterator is used to calculate the - * @c begin parameter for any subsequent invocation of the match condition. The - * @c second member of the return value is true if a match has been found, false - * otherwise. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes in the streambuf's get area that have been fully - * consumed by the match function. Returns 0 if an error occurred. - * - * @note After a successful read_until operation, the streambuf may contain - * additional data beyond that which matched the function object. An application - * will typically leave that data in the streambuf for a subsequent read_until - * operation to examine. - * - * @note The default implementation of the @c is_match_condition type trait - * evaluates to true for function pointers and function objects with a - * @c result_type typedef. It must be specialised for other user-defined - * function objects. - */ -template -std::size_t read_until(SyncReadStream& s, - asio::basic_streambuf& b, - MatchCondition match_condition, asio::error_code& ec, - typename enable_if::value>::type* = 0); - -#endif // !defined(ASIO_NO_IOSTREAM) -#endif // !defined(ASIO_NO_EXTENSIONS) - -/*@}*/ -/** - * @defgroup async_read_until asio::async_read_until - * - * @brief Start an asynchronous operation to read data into a dynamic buffer - * sequence, or into a streambuf, until it contains a delimiter, matches a - * regular expression, or a function object indicates a match. - */ -/*@{*/ - -/// Start an asynchronous operation to read data into a dynamic buffer sequence -/// until it contains a specified delimiter. -/** - * This function is used to asynchronously read data into the specified dynamic - * buffer sequence until the dynamic buffer sequence's get area contains the - * specified delimiter. The function call always returns immediately. The - * asynchronous operation will continue until one of the following conditions - * is true: - * - * @li The get area of the dynamic buffer sequence contains the specified - * delimiter. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * async_read_some function, and is known as a composed operation. If - * the dynamic buffer sequence's get area already contains the delimiter, this - * asynchronous operation completes immediately. The program must ensure that - * the stream performs no other read operations (such as async_read, - * async_read_until, the stream's async_read_some function, or any other - * composed operations that perform reads) until this operation completes. - * - * @param s The stream from which the data is to be read. The type must support - * the AsyncReadStream concept. - * - * @param buffers The dynamic buffer sequence into which the data will be read. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param delim The delimiter character. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * // Result of operation. - * const asio::error_code& error, - * - * // The number of bytes in the dynamic buffer sequence's - * // get area up to and including the delimiter. - * // 0 if an error occurred. - * std::size_t bytes_transferred - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note After a successful async_read_until operation, the dynamic buffer - * sequence may contain additional data beyond the delimiter. An application - * will typically leave that data in the dynamic buffer sequence for a - * subsequent async_read_until operation to examine. - * - * @par Example - * To asynchronously read data into a @c std::string until a newline is - * encountered: - * @code std::string data; - * ... - * void handler(const asio::error_code& e, std::size_t size) - * { - * if (!e) - * { - * std::string line = data.substr(0, n); - * data.erase(0, n); - * ... - * } - * } - * ... - * asio::async_read_until(s, data, '\n', handler); @endcode - * After the @c async_read_until operation completes successfully, the buffer - * @c data contains the delimiter: - * @code { 'a', 'b', ..., 'c', '\n', 'd', 'e', ... } @endcode - * The call to @c substr then extracts the data up to and including the - * delimiter, so that the string @c line contains: - * @code { 'a', 'b', ..., 'c', '\n' } @endcode - * After the call to @c erase, the remaining data is left in the buffer @c data - * as follows: - * @code { 'd', 'e', ... } @endcode - * This data may be the start of a new line, to be extracted by a subsequent - * @c async_read_until operation. - */ -template -ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read_until(AsyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - char delim, ASIO_MOVE_ARG(ReadHandler) handler); - -/// Start an asynchronous operation to read data into a dynamic buffer sequence -/// until it contains a specified delimiter. -/** - * This function is used to asynchronously read data into the specified dynamic - * buffer sequence until the dynamic buffer sequence's get area contains the - * specified delimiter. The function call always returns immediately. The - * asynchronous operation will continue until one of the following conditions - * is true: - * - * @li The get area of the dynamic buffer sequence contains the specified - * delimiter. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * async_read_some function, and is known as a composed operation. If - * the dynamic buffer sequence's get area already contains the delimiter, this - * asynchronous operation completes immediately. The program must ensure that - * the stream performs no other read operations (such as async_read, - * async_read_until, the stream's async_read_some function, or any other - * composed operations that perform reads) until this operation completes. - * - * @param s The stream from which the data is to be read. The type must support - * the AsyncReadStream concept. - * - * @param buffers The dynamic buffer sequence into which the data will be read. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param delim The delimiter string. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * // Result of operation. - * const asio::error_code& error, - * - * // The number of bytes in the dynamic buffer sequence's - * // get area up to and including the delimiter. - * // 0 if an error occurred. - * std::size_t bytes_transferred - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note After a successful async_read_until operation, the dynamic buffer - * sequence may contain additional data beyond the delimiter. An application - * will typically leave that data in the dynamic buffer sequence for a - * subsequent async_read_until operation to examine. - * - * @par Example - * To asynchronously read data into a @c std::string until a CR-LF sequence is - * encountered: - * @code std::string data; - * ... - * void handler(const asio::error_code& e, std::size_t size) - * { - * if (!e) - * { - * std::string line = data.substr(0, n); - * data.erase(0, n); - * ... - * } - * } - * ... - * asio::async_read_until(s, data, "\r\n", handler); @endcode - * After the @c async_read_until operation completes successfully, the string - * @c data contains the delimiter: - * @code { 'a', 'b', ..., 'c', '\r', '\n', 'd', 'e', ... } @endcode - * The call to @c substr then extracts the data up to and including the - * delimiter, so that the string @c line contains: - * @code { 'a', 'b', ..., 'c', '\r', '\n' } @endcode - * After the call to @c erase, the remaining data is left in the string @c data - * as follows: - * @code { 'd', 'e', ... } @endcode - * This data may be the start of a new line, to be extracted by a subsequent - * @c async_read_until operation. - */ -template -ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read_until(AsyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - ASIO_STRING_VIEW_PARAM delim, - ASIO_MOVE_ARG(ReadHandler) handler); - -#if !defined(ASIO_NO_EXTENSIONS) -#if defined(ASIO_HAS_BOOST_REGEX) \ - || defined(GENERATING_DOCUMENTATION) - -/// Start an asynchronous operation to read data into a dynamic buffer sequence -/// until some part of its data matches a regular expression. -/** - * This function is used to asynchronously read data into the specified dynamic - * buffer sequence until the dynamic buffer sequence's get area contains some - * data that matches a regular expression. The function call always returns - * immediately. The asynchronous operation will continue until one of the - * following conditions is true: - * - * @li A substring of the dynamic buffer sequence's get area matches the regular - * expression. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * async_read_some function, and is known as a composed operation. If - * the dynamic buffer sequence's get area already contains data that matches - * the regular expression, this asynchronous operation completes immediately. - * The program must ensure that the stream performs no other read operations - * (such as async_read, async_read_until, the stream's async_read_some - * function, or any other composed operations that perform reads) until this - * operation completes. - * - * @param s The stream from which the data is to be read. The type must support - * the AsyncReadStream concept. - * - * @param buffers The dynamic buffer sequence into which the data will be read. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param expr The regular expression. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * // Result of operation. - * const asio::error_code& error, - * - * // The number of bytes in the dynamic buffer - * // sequence's get area up to and including the - * // substring that matches the regular expression. - * // 0 if an error occurred. - * std::size_t bytes_transferred - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note After a successful async_read_until operation, the dynamic buffer - * sequence may contain additional data beyond that which matched the regular - * expression. An application will typically leave that data in the dynamic - * buffer sequence for a subsequent async_read_until operation to examine. - * - * @par Example - * To asynchronously read data into a @c std::string until a CR-LF sequence is - * encountered: - * @code std::string data; - * ... - * void handler(const asio::error_code& e, std::size_t size) - * { - * if (!e) - * { - * std::string line = data.substr(0, n); - * data.erase(0, n); - * ... - * } - * } - * ... - * asio::async_read_until(s, data, - * boost::regex("\r\n"), handler); @endcode - * After the @c async_read_until operation completes successfully, the string - * @c data contains the data which matched the regular expression: - * @code { 'a', 'b', ..., 'c', '\r', '\n', 'd', 'e', ... } @endcode - * The call to @c substr then extracts the data up to and including the match, - * so that the string @c line contains: - * @code { 'a', 'b', ..., 'c', '\r', '\n' } @endcode - * After the call to @c erase, the remaining data is left in the string @c data - * as follows: - * @code { 'd', 'e', ... } @endcode - * This data may be the start of a new line, to be extracted by a subsequent - * @c async_read_until operation. - */ -template -ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read_until(AsyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - const boost::regex& expr, - ASIO_MOVE_ARG(ReadHandler) handler); - -#endif // defined(ASIO_HAS_BOOST_REGEX) - // || defined(GENERATING_DOCUMENTATION) - -/// Start an asynchronous operation to read data into a dynamic buffer sequence -/// until a function object indicates a match. -/** - * This function is used to asynchronously read data into the specified dynamic - * buffer sequence until a user-defined match condition function object, when - * applied to the data contained in the dynamic buffer sequence, indicates a - * successful match. The function call always returns immediately. The - * asynchronous operation will continue until one of the following conditions - * is true: - * - * @li The match condition function object returns a std::pair where the second - * element evaluates to true. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * async_read_some function, and is known as a composed operation. If - * the match condition function object already indicates a match, this - * asynchronous operation completes immediately. The program must ensure that - * the stream performs no other read operations (such as async_read, - * async_read_until, the stream's async_read_some function, or any other - * composed operations that perform reads) until this operation completes. - * - * @param s The stream from which the data is to be read. The type must support - * the AsyncReadStream concept. - * - * @param buffers The dynamic buffer sequence into which the data will be read. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param match_condition The function object to be called to determine whether - * a match exists. The signature of the function object must be: - * @code pair match_condition(iterator begin, iterator end); - * @endcode - * where @c iterator represents the type: - * @code buffers_iterator - * @endcode - * The iterator parameters @c begin and @c end define the range of bytes to be - * scanned to determine whether there is a match. The @c first member of the - * return value is an iterator marking one-past-the-end of the bytes that have - * been consumed by the match function. This iterator is used to calculate the - * @c begin parameter for any subsequent invocation of the match condition. The - * @c second member of the return value is true if a match has been found, false - * otherwise. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * // Result of operation. - * const asio::error_code& error, - * - * // The number of bytes in the dynamic buffer sequence's - * // get area that have been fully consumed by the match - * // function. O if an error occurred. - * std::size_t bytes_transferred - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note After a successful async_read_until operation, the dynamic buffer - * sequence may contain additional data beyond that which matched the function - * object. An application will typically leave that data in the dynamic buffer - * sequence for a subsequent async_read_until operation to examine. - * - * @note The default implementation of the @c is_match_condition type trait - * evaluates to true for function pointers and function objects with a - * @c result_type typedef. It must be specialised for other user-defined - * function objects. - * - * @par Examples - * To asynchronously read data into a @c std::string until whitespace is - * encountered: - * @code typedef asio::buffers_iterator< - * asio::const_buffers_1> iterator; - * - * std::pair - * match_whitespace(iterator begin, iterator end) - * { - * iterator i = begin; - * while (i != end) - * if (std::isspace(*i++)) - * return std::make_pair(i, true); - * return std::make_pair(i, false); - * } - * ... - * void handler(const asio::error_code& e, std::size_t size); - * ... - * std::string data; - * asio::async_read_until(s, data, match_whitespace, handler); - * @endcode - * - * To asynchronously read data into a @c std::string until a matching character - * is found: - * @code class match_char - * { - * public: - * explicit match_char(char c) : c_(c) {} - * - * template - * std::pair operator()( - * Iterator begin, Iterator end) const - * { - * Iterator i = begin; - * while (i != end) - * if (c_ == *i++) - * return std::make_pair(i, true); - * return std::make_pair(i, false); - * } - * - * private: - * char c_; - * }; - * - * namespace asio { - * template <> struct is_match_condition - * : public boost::true_type {}; - * } // namespace asio - * ... - * void handler(const asio::error_code& e, std::size_t size); - * ... - * std::string data; - * asio::async_read_until(s, data, match_char('a'), handler); - * @endcode - */ -template -ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read_until(AsyncReadStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - MatchCondition match_condition, ASIO_MOVE_ARG(ReadHandler) handler, - typename enable_if::value>::type* = 0); - -#if !defined(ASIO_NO_IOSTREAM) - -/// Start an asynchronous operation to read data into a streambuf until it -/// contains a specified delimiter. -/** - * This function is used to asynchronously read data into the specified - * streambuf until the streambuf's get area contains the specified delimiter. - * The function call always returns immediately. The asynchronous operation - * will continue until one of the following conditions is true: - * - * @li The get area of the streambuf contains the specified delimiter. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * async_read_some function, and is known as a composed operation. If - * the streambuf's get area already contains the delimiter, this asynchronous - * operation completes immediately. The program must ensure that the stream - * performs no other read operations (such as async_read, async_read_until, the - * stream's async_read_some function, or any other composed operations that - * perform reads) until this operation completes. - * - * @param s The stream from which the data is to be read. The type must support - * the AsyncReadStream concept. - * - * @param b A streambuf object into which the data will be read. Ownership of - * the streambuf is retained by the caller, which must guarantee that it remains - * valid until the handler is called. - * - * @param delim The delimiter character. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * // Result of operation. - * const asio::error_code& error, - * - * // The number of bytes in the streambuf's get - * // area up to and including the delimiter. - * // 0 if an error occurred. - * std::size_t bytes_transferred - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note After a successful async_read_until operation, the streambuf may - * contain additional data beyond the delimiter. An application will typically - * leave that data in the streambuf for a subsequent async_read_until operation - * to examine. - * - * @par Example - * To asynchronously read data into a streambuf until a newline is encountered: - * @code asio::streambuf b; - * ... - * void handler(const asio::error_code& e, std::size_t size) - * { - * if (!e) - * { - * std::istream is(&b); - * std::string line; - * std::getline(is, line); - * ... - * } - * } - * ... - * asio::async_read_until(s, b, '\n', handler); @endcode - * After the @c async_read_until operation completes successfully, the buffer - * @c b contains the delimiter: - * @code { 'a', 'b', ..., 'c', '\n', 'd', 'e', ... } @endcode - * The call to @c std::getline then extracts the data up to and including the - * newline (which is discarded), so that the string @c line contains: - * @code { 'a', 'b', ..., 'c' } @endcode - * The remaining data is left in the buffer @c b as follows: - * @code { 'd', 'e', ... } @endcode - * This data may be the start of a new line, to be extracted by a subsequent - * @c async_read_until operation. - */ -template -ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read_until(AsyncReadStream& s, - asio::basic_streambuf& b, - char delim, ASIO_MOVE_ARG(ReadHandler) handler); - -/// Start an asynchronous operation to read data into a streambuf until it -/// contains a specified delimiter. -/** - * This function is used to asynchronously read data into the specified - * streambuf until the streambuf's get area contains the specified delimiter. - * The function call always returns immediately. The asynchronous operation - * will continue until one of the following conditions is true: - * - * @li The get area of the streambuf contains the specified delimiter. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * async_read_some function, and is known as a composed operation. If - * the streambuf's get area already contains the delimiter, this asynchronous - * operation completes immediately. The program must ensure that the stream - * performs no other read operations (such as async_read, async_read_until, the - * stream's async_read_some function, or any other composed operations that - * perform reads) until this operation completes. - * - * @param s The stream from which the data is to be read. The type must support - * the AsyncReadStream concept. - * - * @param b A streambuf object into which the data will be read. Ownership of - * the streambuf is retained by the caller, which must guarantee that it remains - * valid until the handler is called. - * - * @param delim The delimiter string. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * // Result of operation. - * const asio::error_code& error, - * - * // The number of bytes in the streambuf's get - * // area up to and including the delimiter. - * // 0 if an error occurred. - * std::size_t bytes_transferred - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note After a successful async_read_until operation, the streambuf may - * contain additional data beyond the delimiter. An application will typically - * leave that data in the streambuf for a subsequent async_read_until operation - * to examine. - * - * @par Example - * To asynchronously read data into a streambuf until a newline is encountered: - * @code asio::streambuf b; - * ... - * void handler(const asio::error_code& e, std::size_t size) - * { - * if (!e) - * { - * std::istream is(&b); - * std::string line; - * std::getline(is, line); - * ... - * } - * } - * ... - * asio::async_read_until(s, b, "\r\n", handler); @endcode - * After the @c async_read_until operation completes successfully, the buffer - * @c b contains the delimiter: - * @code { 'a', 'b', ..., 'c', '\r', '\n', 'd', 'e', ... } @endcode - * The call to @c std::getline then extracts the data up to and including the - * newline (which is discarded), so that the string @c line contains: - * @code { 'a', 'b', ..., 'c', '\r' } @endcode - * The remaining data is left in the buffer @c b as follows: - * @code { 'd', 'e', ... } @endcode - * This data may be the start of a new line, to be extracted by a subsequent - * @c async_read_until operation. - */ -template -ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read_until(AsyncReadStream& s, - asio::basic_streambuf& b, - ASIO_STRING_VIEW_PARAM delim, - ASIO_MOVE_ARG(ReadHandler) handler); - -#if defined(ASIO_HAS_BOOST_REGEX) \ - || defined(GENERATING_DOCUMENTATION) - -/// Start an asynchronous operation to read data into a streambuf until some -/// part of its data matches a regular expression. -/** - * This function is used to asynchronously read data into the specified - * streambuf until the streambuf's get area contains some data that matches a - * regular expression. The function call always returns immediately. The - * asynchronous operation will continue until one of the following conditions - * is true: - * - * @li A substring of the streambuf's get area matches the regular expression. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * async_read_some function, and is known as a composed operation. If - * the streambuf's get area already contains data that matches the regular - * expression, this asynchronous operation completes immediately. The program - * must ensure that the stream performs no other read operations (such as - * async_read, async_read_until, the stream's async_read_some function, or any - * other composed operations that perform reads) until this operation - * completes. - * - * @param s The stream from which the data is to be read. The type must support - * the AsyncReadStream concept. - * - * @param b A streambuf object into which the data will be read. Ownership of - * the streambuf is retained by the caller, which must guarantee that it remains - * valid until the handler is called. - * - * @param expr The regular expression. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * // Result of operation. - * const asio::error_code& error, - * - * // The number of bytes in the streambuf's get - * // area up to and including the substring - * // that matches the regular. expression. - * // 0 if an error occurred. - * std::size_t bytes_transferred - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note After a successful async_read_until operation, the streambuf may - * contain additional data beyond that which matched the regular expression. An - * application will typically leave that data in the streambuf for a subsequent - * async_read_until operation to examine. - * - * @par Example - * To asynchronously read data into a streambuf until a CR-LF sequence is - * encountered: - * @code asio::streambuf b; - * ... - * void handler(const asio::error_code& e, std::size_t size) - * { - * if (!e) - * { - * std::istream is(&b); - * std::string line; - * std::getline(is, line); - * ... - * } - * } - * ... - * asio::async_read_until(s, b, boost::regex("\r\n"), handler); @endcode - * After the @c async_read_until operation completes successfully, the buffer - * @c b contains the data which matched the regular expression: - * @code { 'a', 'b', ..., 'c', '\r', '\n', 'd', 'e', ... } @endcode - * The call to @c std::getline then extracts the data up to and including the - * newline (which is discarded), so that the string @c line contains: - * @code { 'a', 'b', ..., 'c', '\r' } @endcode - * The remaining data is left in the buffer @c b as follows: - * @code { 'd', 'e', ... } @endcode - * This data may be the start of a new line, to be extracted by a subsequent - * @c async_read_until operation. - */ -template -ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read_until(AsyncReadStream& s, - asio::basic_streambuf& b, const boost::regex& expr, - ASIO_MOVE_ARG(ReadHandler) handler); - -#endif // defined(ASIO_HAS_BOOST_REGEX) - // || defined(GENERATING_DOCUMENTATION) - -/// Start an asynchronous operation to read data into a streambuf until a -/// function object indicates a match. -/** - * This function is used to asynchronously read data into the specified - * streambuf until a user-defined match condition function object, when applied - * to the data contained in the streambuf, indicates a successful match. The - * function call always returns immediately. The asynchronous operation will - * continue until one of the following conditions is true: - * - * @li The match condition function object returns a std::pair where the second - * element evaluates to true. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * async_read_some function, and is known as a composed operation. If - * the match condition function object already indicates a match, this - * asynchronous operation completes immediately. The program must ensure that - * the stream performs no other read operations (such as async_read, - * async_read_until, the stream's async_read_some function, or any other - * composed operations that perform reads) until this operation completes. - * - * @param s The stream from which the data is to be read. The type must support - * the AsyncReadStream concept. - * - * @param b A streambuf object into which the data will be read. - * - * @param match_condition The function object to be called to determine whether - * a match exists. The signature of the function object must be: - * @code pair match_condition(iterator begin, iterator end); - * @endcode - * where @c iterator represents the type: - * @code buffers_iterator::const_buffers_type> - * @endcode - * The iterator parameters @c begin and @c end define the range of bytes to be - * scanned to determine whether there is a match. The @c first member of the - * return value is an iterator marking one-past-the-end of the bytes that have - * been consumed by the match function. This iterator is used to calculate the - * @c begin parameter for any subsequent invocation of the match condition. The - * @c second member of the return value is true if a match has been found, false - * otherwise. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * // Result of operation. - * const asio::error_code& error, - * - * // The number of bytes in the streambuf's get - * // area that have been fully consumed by the - * // match function. O if an error occurred. - * std::size_t bytes_transferred - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note After a successful async_read_until operation, the streambuf may - * contain additional data beyond that which matched the function object. An - * application will typically leave that data in the streambuf for a subsequent - * async_read_until operation to examine. - * - * @note The default implementation of the @c is_match_condition type trait - * evaluates to true for function pointers and function objects with a - * @c result_type typedef. It must be specialised for other user-defined - * function objects. - * - * @par Examples - * To asynchronously read data into a streambuf until whitespace is encountered: - * @code typedef asio::buffers_iterator< - * asio::streambuf::const_buffers_type> iterator; - * - * std::pair - * match_whitespace(iterator begin, iterator end) - * { - * iterator i = begin; - * while (i != end) - * if (std::isspace(*i++)) - * return std::make_pair(i, true); - * return std::make_pair(i, false); - * } - * ... - * void handler(const asio::error_code& e, std::size_t size); - * ... - * asio::streambuf b; - * asio::async_read_until(s, b, match_whitespace, handler); - * @endcode - * - * To asynchronously read data into a streambuf until a matching character is - * found: - * @code class match_char - * { - * public: - * explicit match_char(char c) : c_(c) {} - * - * template - * std::pair operator()( - * Iterator begin, Iterator end) const - * { - * Iterator i = begin; - * while (i != end) - * if (c_ == *i++) - * return std::make_pair(i, true); - * return std::make_pair(i, false); - * } - * - * private: - * char c_; - * }; - * - * namespace asio { - * template <> struct is_match_condition - * : public boost::true_type {}; - * } // namespace asio - * ... - * void handler(const asio::error_code& e, std::size_t size); - * ... - * asio::streambuf b; - * asio::async_read_until(s, b, match_char('a'), handler); - * @endcode - */ -template -ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) -async_read_until(AsyncReadStream& s, - asio::basic_streambuf& b, - MatchCondition match_condition, ASIO_MOVE_ARG(ReadHandler) handler, - typename enable_if::value>::type* = 0); - -#endif // !defined(ASIO_NO_IOSTREAM) -#endif // !defined(ASIO_NO_EXTENSIONS) - -/*@}*/ - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/impl/read_until.hpp" - -#endif // ASIO_READ_UNTIL_HPP diff --git a/tools/sdk/include/asio/asio/seq_packet_socket_service.hpp b/tools/sdk/include/asio/asio/seq_packet_socket_service.hpp deleted file mode 100644 index 7e6824d41e0..00000000000 --- a/tools/sdk/include/asio/asio/seq_packet_socket_service.hpp +++ /dev/null @@ -1,416 +0,0 @@ -// -// seq_packet_socket_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SEQ_PACKET_SOCKET_SERVICE_HPP -#define ASIO_SEQ_PACKET_SOCKET_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) - -#include -#include "asio/async_result.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" - -#if defined(ASIO_WINDOWS_RUNTIME) -# include "asio/detail/null_socket_service.hpp" -#elif defined(ASIO_HAS_IOCP) -# include "asio/detail/win_iocp_socket_service.hpp" -#else -# include "asio/detail/reactive_socket_service.hpp" -#endif - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Default service implementation for a sequenced packet socket. -template -class seq_packet_socket_service -#if defined(GENERATING_DOCUMENTATION) - : public asio::io_context::service -#else - : public asio::detail::service_base< - seq_packet_socket_service > -#endif -{ -public: -#if defined(GENERATING_DOCUMENTATION) - /// The unique service identifier. - static asio::io_context::id id; -#endif - - /// The protocol type. - typedef Protocol protocol_type; - - /// The endpoint type. - typedef typename Protocol::endpoint endpoint_type; - -private: - // The type of the platform-specific implementation. -#if defined(ASIO_WINDOWS_RUNTIME) - typedef detail::null_socket_service service_impl_type; -#elif defined(ASIO_HAS_IOCP) - typedef detail::win_iocp_socket_service service_impl_type; -#else - typedef detail::reactive_socket_service service_impl_type; -#endif - -public: - /// The type of a sequenced packet socket implementation. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined implementation_type; -#else - typedef typename service_impl_type::implementation_type implementation_type; -#endif - - /// The native socket type. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined native_handle_type; -#else - typedef typename service_impl_type::native_handle_type native_handle_type; -#endif - - /// Construct a new sequenced packet socket service for the specified - /// io_context. - explicit seq_packet_socket_service(asio::io_context& io_context) - : asio::detail::service_base< - seq_packet_socket_service >(io_context), - service_impl_(io_context) - { - } - - /// Construct a new sequenced packet socket implementation. - void construct(implementation_type& impl) - { - service_impl_.construct(impl); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a new sequenced packet socket implementation. - void move_construct(implementation_type& impl, - implementation_type& other_impl) - { - service_impl_.move_construct(impl, other_impl); - } - - /// Move-assign from another sequenced packet socket implementation. - void move_assign(implementation_type& impl, - seq_packet_socket_service& other_service, - implementation_type& other_impl) - { - service_impl_.move_assign(impl, other_service.service_impl_, other_impl); - } - - // All socket services have access to each other's implementations. - template friend class seq_packet_socket_service; - - /// Move-construct a new sequenced packet socket implementation from another - /// protocol type. - template - void converting_move_construct(implementation_type& impl, - seq_packet_socket_service& other_service, - typename seq_packet_socket_service< - Protocol1>::implementation_type& other_impl, - typename enable_if::value>::type* = 0) - { - service_impl_.template converting_move_construct( - impl, other_service.service_impl_, other_impl); - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destroy a sequenced packet socket implementation. - void destroy(implementation_type& impl) - { - service_impl_.destroy(impl); - } - - /// Open a sequenced packet socket. - ASIO_SYNC_OP_VOID open(implementation_type& impl, - const protocol_type& protocol, asio::error_code& ec) - { - if (protocol.type() == ASIO_OS_DEF(SOCK_SEQPACKET)) - service_impl_.open(impl, protocol, ec); - else - ec = asio::error::invalid_argument; - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Assign an existing native socket to a sequenced packet socket. - ASIO_SYNC_OP_VOID assign(implementation_type& impl, - const protocol_type& protocol, const native_handle_type& native_socket, - asio::error_code& ec) - { - service_impl_.assign(impl, protocol, native_socket, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Determine whether the socket is open. - bool is_open(const implementation_type& impl) const - { - return service_impl_.is_open(impl); - } - - /// Close a sequenced packet socket implementation. - ASIO_SYNC_OP_VOID close(implementation_type& impl, - asio::error_code& ec) - { - service_impl_.close(impl, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Release ownership of the underlying socket. - native_handle_type release(implementation_type& impl, - asio::error_code& ec) - { - return service_impl_.release(impl, ec); - } - - /// Get the native socket implementation. - native_handle_type native_handle(implementation_type& impl) - { - return service_impl_.native_handle(impl); - } - - /// Cancel all asynchronous operations associated with the socket. - ASIO_SYNC_OP_VOID cancel(implementation_type& impl, - asio::error_code& ec) - { - service_impl_.cancel(impl, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Determine whether the socket is at the out-of-band data mark. - bool at_mark(const implementation_type& impl, - asio::error_code& ec) const - { - return service_impl_.at_mark(impl, ec); - } - - /// Determine the number of bytes available for reading. - std::size_t available(const implementation_type& impl, - asio::error_code& ec) const - { - return service_impl_.available(impl, ec); - } - - /// Bind the sequenced packet socket to the specified local endpoint. - ASIO_SYNC_OP_VOID bind(implementation_type& impl, - const endpoint_type& endpoint, asio::error_code& ec) - { - service_impl_.bind(impl, endpoint, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Connect the sequenced packet socket to the specified endpoint. - ASIO_SYNC_OP_VOID connect(implementation_type& impl, - const endpoint_type& peer_endpoint, asio::error_code& ec) - { - service_impl_.connect(impl, peer_endpoint, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Start an asynchronous connect. - template - ASIO_INITFN_RESULT_TYPE(ConnectHandler, - void (asio::error_code)) - async_connect(implementation_type& impl, - const endpoint_type& peer_endpoint, - ASIO_MOVE_ARG(ConnectHandler) handler) - { - async_completion init(handler); - - service_impl_.async_connect(impl, peer_endpoint, init.completion_handler); - - return init.result.get(); - } - - /// Set a socket option. - template - ASIO_SYNC_OP_VOID set_option(implementation_type& impl, - const SettableSocketOption& option, asio::error_code& ec) - { - service_impl_.set_option(impl, option, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get a socket option. - template - ASIO_SYNC_OP_VOID get_option(const implementation_type& impl, - GettableSocketOption& option, asio::error_code& ec) const - { - service_impl_.get_option(impl, option, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Perform an IO control command on the socket. - template - ASIO_SYNC_OP_VOID io_control(implementation_type& impl, - IoControlCommand& command, asio::error_code& ec) - { - service_impl_.io_control(impl, command, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Gets the non-blocking mode of the socket. - bool non_blocking(const implementation_type& impl) const - { - return service_impl_.non_blocking(impl); - } - - /// Sets the non-blocking mode of the socket. - ASIO_SYNC_OP_VOID non_blocking(implementation_type& impl, - bool mode, asio::error_code& ec) - { - service_impl_.non_blocking(impl, mode, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Gets the non-blocking mode of the native socket implementation. - bool native_non_blocking(const implementation_type& impl) const - { - return service_impl_.native_non_blocking(impl); - } - - /// Sets the non-blocking mode of the native socket implementation. - ASIO_SYNC_OP_VOID native_non_blocking(implementation_type& impl, - bool mode, asio::error_code& ec) - { - service_impl_.native_non_blocking(impl, mode, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get the local endpoint. - endpoint_type local_endpoint(const implementation_type& impl, - asio::error_code& ec) const - { - return service_impl_.local_endpoint(impl, ec); - } - - /// Get the remote endpoint. - endpoint_type remote_endpoint(const implementation_type& impl, - asio::error_code& ec) const - { - return service_impl_.remote_endpoint(impl, ec); - } - - /// Disable sends or receives on the socket. - ASIO_SYNC_OP_VOID shutdown(implementation_type& impl, - socket_base::shutdown_type what, asio::error_code& ec) - { - service_impl_.shutdown(impl, what, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Wait for the socket to become ready to read, ready to write, or to have - /// pending error conditions. - ASIO_SYNC_OP_VOID wait(implementation_type& impl, - socket_base::wait_type w, asio::error_code& ec) - { - service_impl_.wait(impl, w, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Asynchronously wait for the socket to become ready to read, ready to - /// write, or to have pending error conditions. - template - ASIO_INITFN_RESULT_TYPE(WaitHandler, - void (asio::error_code)) - async_wait(implementation_type& impl, socket_base::wait_type w, - ASIO_MOVE_ARG(WaitHandler) handler) - { - async_completion init(handler); - - service_impl_.async_wait(impl, w, init.completion_handler); - - return init.result.get(); - } - - /// Send the given data to the peer. - template - std::size_t send(implementation_type& impl, - const ConstBufferSequence& buffers, - socket_base::message_flags flags, asio::error_code& ec) - { - return service_impl_.send(impl, buffers, flags, ec); - } - - /// Start an asynchronous send. - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_send(implementation_type& impl, - const ConstBufferSequence& buffers, - socket_base::message_flags flags, - ASIO_MOVE_ARG(WriteHandler) handler) - { - async_completion init(handler); - - service_impl_.async_send(impl, buffers, flags, init.completion_handler); - - return init.result.get(); - } - - /// Receive some data from the peer. - template - std::size_t receive(implementation_type& impl, - const MutableBufferSequence& buffers, socket_base::message_flags in_flags, - socket_base::message_flags& out_flags, asio::error_code& ec) - { - return service_impl_.receive_with_flags(impl, - buffers, in_flags, out_flags, ec); - } - - /// Start an asynchronous receive. - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_receive(implementation_type& impl, - const MutableBufferSequence& buffers, socket_base::message_flags in_flags, - socket_base::message_flags& out_flags, - ASIO_MOVE_ARG(ReadHandler) handler) - { - async_completion init(handler); - - service_impl_.async_receive_with_flags(impl, - buffers, in_flags, out_flags, init.completion_handler); - - return init.result.get(); - } - -private: - // Destroy all user-defined handler objects owned by the service. - void shutdown() - { - service_impl_.shutdown(); - } - - // The platform-specific implementation. - service_impl_type service_impl_; -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_SEQ_PACKET_SOCKET_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/serial_port.hpp b/tools/sdk/include/asio/asio/serial_port.hpp deleted file mode 100644 index 27bb63ef739..00000000000 --- a/tools/sdk/include/asio/asio/serial_port.hpp +++ /dev/null @@ -1,769 +0,0 @@ -// -// serial_port.hpp -// ~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SERIAL_PORT_HPP -#define ASIO_SERIAL_PORT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_SERIAL_PORT) \ - || defined(GENERATING_DOCUMENTATION) - -#include -#include "asio/async_result.hpp" -#include "asio/basic_io_object.hpp" -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" -#include "asio/serial_port_base.hpp" - -#if defined(ASIO_HAS_MOVE) -# include -#endif // defined(ASIO_HAS_MOVE) - -#if defined(ASIO_ENABLE_OLD_SERVICES) -# include "asio/basic_serial_port.hpp" -#else // defined(ASIO_ENABLE_OLD_SERVICES) -# if defined(ASIO_HAS_IOCP) -# include "asio/detail/win_iocp_serial_port_service.hpp" -# define ASIO_SVC_T detail::win_iocp_serial_port_service -# else -# include "asio/detail/reactive_serial_port_service.hpp" -# define ASIO_SVC_T detail::reactive_serial_port_service -# endif -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#include "asio/detail/push_options.hpp" - -namespace asio { - -#if defined(ASIO_ENABLE_OLD_SERVICES) -// Typedef for the typical usage of a serial port. -typedef basic_serial_port<> serial_port; -#else // defined(ASIO_ENABLE_OLD_SERVICES) -/// Provides serial port functionality. -/** - * The serial_port class provides a wrapper over serial port functionality. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -class serial_port - : ASIO_SVC_ACCESS basic_io_object, - public serial_port_base -{ -public: - /// The type of the executor associated with the object. - typedef io_context::executor_type executor_type; - - /// The native representation of a serial port. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined native_handle_type; -#else - typedef ASIO_SVC_T::native_handle_type native_handle_type; -#endif - - /// A basic_serial_port is always the lowest layer. - typedef serial_port lowest_layer_type; - - /// Construct a serial_port without opening it. - /** - * This constructor creates a serial port without opening it. - * - * @param io_context The io_context object that the serial port will use to - * dispatch handlers for any asynchronous operations performed on the port. - */ - explicit serial_port(asio::io_context& io_context) - : basic_io_object(io_context) - { - } - - /// Construct and open a serial_port. - /** - * This constructor creates and opens a serial port for the specified device - * name. - * - * @param io_context The io_context object that the serial port will use to - * dispatch handlers for any asynchronous operations performed on the port. - * - * @param device The platform-specific device name for this serial - * port. - */ - explicit serial_port(asio::io_context& io_context, - const char* device) - : basic_io_object(io_context) - { - asio::error_code ec; - this->get_service().open(this->get_implementation(), device, ec); - asio::detail::throw_error(ec, "open"); - } - - /// Construct and open a serial_port. - /** - * This constructor creates and opens a serial port for the specified device - * name. - * - * @param io_context The io_context object that the serial port will use to - * dispatch handlers for any asynchronous operations performed on the port. - * - * @param device The platform-specific device name for this serial - * port. - */ - explicit serial_port(asio::io_context& io_context, - const std::string& device) - : basic_io_object(io_context) - { - asio::error_code ec; - this->get_service().open(this->get_implementation(), device, ec); - asio::detail::throw_error(ec, "open"); - } - - /// Construct a serial_port on an existing native serial port. - /** - * This constructor creates a serial port object to hold an existing native - * serial port. - * - * @param io_context The io_context object that the serial port will use to - * dispatch handlers for any asynchronous operations performed on the port. - * - * @param native_serial_port A native serial port. - * - * @throws asio::system_error Thrown on failure. - */ - serial_port(asio::io_context& io_context, - const native_handle_type& native_serial_port) - : basic_io_object(io_context) - { - asio::error_code ec; - this->get_service().assign(this->get_implementation(), - native_serial_port, ec); - asio::detail::throw_error(ec, "assign"); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a serial_port from another. - /** - * This constructor moves a serial port from one object to another. - * - * @param other The other serial_port object from which the move will - * occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c serial_port(io_context&) constructor. - */ - serial_port(serial_port&& other) - : basic_io_object(std::move(other)) - { - } - - /// Move-assign a serial_port from another. - /** - * This assignment operator moves a serial port from one object to another. - * - * @param other The other serial_port object from which the move will - * occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c serial_port(io_context&) constructor. - */ - serial_port& operator=(serial_port&& other) - { - basic_io_object::operator=(std::move(other)); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destroys the serial port. - /** - * This function destroys the serial port, cancelling any outstanding - * asynchronous wait operations associated with the serial port as if by - * calling @c cancel. - */ - ~serial_port() - { - } - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - /** - * This function may be used to obtain the io_context object that the I/O - * object uses to dispatch handlers for asynchronous operations. - * - * @return A reference to the io_context object that the I/O object will use - * to dispatch handlers. Ownership is not transferred to the caller. - */ - asio::io_context& get_io_context() - { - return basic_io_object::get_io_context(); - } - - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - /** - * This function may be used to obtain the io_context object that the I/O - * object uses to dispatch handlers for asynchronous operations. - * - * @return A reference to the io_context object that the I/O object will use - * to dispatch handlers. Ownership is not transferred to the caller. - */ - asio::io_context& get_io_service() - { - return basic_io_object::get_io_service(); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Get the executor associated with the object. - executor_type get_executor() ASIO_NOEXCEPT - { - return basic_io_object::get_executor(); - } - - /// Get a reference to the lowest layer. - /** - * This function returns a reference to the lowest layer in a stack of - * layers. Since a serial_port cannot contain any further layers, it simply - * returns a reference to itself. - * - * @return A reference to the lowest layer in the stack of layers. Ownership - * is not transferred to the caller. - */ - lowest_layer_type& lowest_layer() - { - return *this; - } - - /// Get a const reference to the lowest layer. - /** - * This function returns a const reference to the lowest layer in a stack of - * layers. Since a serial_port cannot contain any further layers, it simply - * returns a reference to itself. - * - * @return A const reference to the lowest layer in the stack of layers. - * Ownership is not transferred to the caller. - */ - const lowest_layer_type& lowest_layer() const - { - return *this; - } - - /// Open the serial port using the specified device name. - /** - * This function opens the serial port for the specified device name. - * - * @param device The platform-specific device name. - * - * @throws asio::system_error Thrown on failure. - */ - void open(const std::string& device) - { - asio::error_code ec; - this->get_service().open(this->get_implementation(), device, ec); - asio::detail::throw_error(ec, "open"); - } - - /// Open the serial port using the specified device name. - /** - * This function opens the serial port using the given platform-specific - * device name. - * - * @param device The platform-specific device name. - * - * @param ec Set the indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID open(const std::string& device, - asio::error_code& ec) - { - this->get_service().open(this->get_implementation(), device, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Assign an existing native serial port to the serial port. - /* - * This function opens the serial port to hold an existing native serial port. - * - * @param native_serial_port A native serial port. - * - * @throws asio::system_error Thrown on failure. - */ - void assign(const native_handle_type& native_serial_port) - { - asio::error_code ec; - this->get_service().assign(this->get_implementation(), - native_serial_port, ec); - asio::detail::throw_error(ec, "assign"); - } - - /// Assign an existing native serial port to the serial port. - /* - * This function opens the serial port to hold an existing native serial port. - * - * @param native_serial_port A native serial port. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID assign(const native_handle_type& native_serial_port, - asio::error_code& ec) - { - this->get_service().assign(this->get_implementation(), - native_serial_port, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Determine whether the serial port is open. - bool is_open() const - { - return this->get_service().is_open(this->get_implementation()); - } - - /// Close the serial port. - /** - * This function is used to close the serial port. Any asynchronous read or - * write operations will be cancelled immediately, and will complete with the - * asio::error::operation_aborted error. - * - * @throws asio::system_error Thrown on failure. - */ - void close() - { - asio::error_code ec; - this->get_service().close(this->get_implementation(), ec); - asio::detail::throw_error(ec, "close"); - } - - /// Close the serial port. - /** - * This function is used to close the serial port. Any asynchronous read or - * write operations will be cancelled immediately, and will complete with the - * asio::error::operation_aborted error. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID close(asio::error_code& ec) - { - this->get_service().close(this->get_implementation(), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get the native serial port representation. - /** - * This function may be used to obtain the underlying representation of the - * serial port. This is intended to allow access to native serial port - * functionality that is not otherwise provided. - */ - native_handle_type native_handle() - { - return this->get_service().native_handle(this->get_implementation()); - } - - /// Cancel all asynchronous operations associated with the serial port. - /** - * This function causes all outstanding asynchronous read or write operations - * to finish immediately, and the handlers for cancelled operations will be - * passed the asio::error::operation_aborted error. - * - * @throws asio::system_error Thrown on failure. - */ - void cancel() - { - asio::error_code ec; - this->get_service().cancel(this->get_implementation(), ec); - asio::detail::throw_error(ec, "cancel"); - } - - /// Cancel all asynchronous operations associated with the serial port. - /** - * This function causes all outstanding asynchronous read or write operations - * to finish immediately, and the handlers for cancelled operations will be - * passed the asio::error::operation_aborted error. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID cancel(asio::error_code& ec) - { - this->get_service().cancel(this->get_implementation(), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Send a break sequence to the serial port. - /** - * This function causes a break sequence of platform-specific duration to be - * sent out the serial port. - * - * @throws asio::system_error Thrown on failure. - */ - void send_break() - { - asio::error_code ec; - this->get_service().send_break(this->get_implementation(), ec); - asio::detail::throw_error(ec, "send_break"); - } - - /// Send a break sequence to the serial port. - /** - * This function causes a break sequence of platform-specific duration to be - * sent out the serial port. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID send_break(asio::error_code& ec) - { - this->get_service().send_break(this->get_implementation(), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Set an option on the serial port. - /** - * This function is used to set an option on the serial port. - * - * @param option The option value to be set on the serial port. - * - * @throws asio::system_error Thrown on failure. - * - * @sa SettableSerialPortOption @n - * asio::serial_port_base::baud_rate @n - * asio::serial_port_base::flow_control @n - * asio::serial_port_base::parity @n - * asio::serial_port_base::stop_bits @n - * asio::serial_port_base::character_size - */ - template - void set_option(const SettableSerialPortOption& option) - { - asio::error_code ec; - this->get_service().set_option(this->get_implementation(), option, ec); - asio::detail::throw_error(ec, "set_option"); - } - - /// Set an option on the serial port. - /** - * This function is used to set an option on the serial port. - * - * @param option The option value to be set on the serial port. - * - * @param ec Set to indicate what error occurred, if any. - * - * @sa SettableSerialPortOption @n - * asio::serial_port_base::baud_rate @n - * asio::serial_port_base::flow_control @n - * asio::serial_port_base::parity @n - * asio::serial_port_base::stop_bits @n - * asio::serial_port_base::character_size - */ - template - ASIO_SYNC_OP_VOID set_option(const SettableSerialPortOption& option, - asio::error_code& ec) - { - this->get_service().set_option(this->get_implementation(), option, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get an option from the serial port. - /** - * This function is used to get the current value of an option on the serial - * port. - * - * @param option The option value to be obtained from the serial port. - * - * @throws asio::system_error Thrown on failure. - * - * @sa GettableSerialPortOption @n - * asio::serial_port_base::baud_rate @n - * asio::serial_port_base::flow_control @n - * asio::serial_port_base::parity @n - * asio::serial_port_base::stop_bits @n - * asio::serial_port_base::character_size - */ - template - void get_option(GettableSerialPortOption& option) - { - asio::error_code ec; - this->get_service().get_option(this->get_implementation(), option, ec); - asio::detail::throw_error(ec, "get_option"); - } - - /// Get an option from the serial port. - /** - * This function is used to get the current value of an option on the serial - * port. - * - * @param option The option value to be obtained from the serial port. - * - * @param ec Set to indicate what error occurred, if any. - * - * @sa GettableSerialPortOption @n - * asio::serial_port_base::baud_rate @n - * asio::serial_port_base::flow_control @n - * asio::serial_port_base::parity @n - * asio::serial_port_base::stop_bits @n - * asio::serial_port_base::character_size - */ - template - ASIO_SYNC_OP_VOID get_option(GettableSerialPortOption& option, - asio::error_code& ec) - { - this->get_service().get_option(this->get_implementation(), option, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Write some data to the serial port. - /** - * This function is used to write data to the serial port. The function call - * will block until one or more bytes of the data has been written - * successfully, or until an error occurs. - * - * @param buffers One or more data buffers to be written to the serial port. - * - * @returns The number of bytes written. - * - * @throws asio::system_error Thrown on failure. An error code of - * asio::error::eof indicates that the connection was closed by the - * peer. - * - * @note The write_some operation may not transmit all of the data to the - * peer. Consider using the @ref write function if you need to ensure that - * all data is written before the blocking operation completes. - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code - * serial_port.write_some(asio::buffer(data, size)); - * @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t write_some(const ConstBufferSequence& buffers) - { - asio::error_code ec; - std::size_t s = this->get_service().write_some( - this->get_implementation(), buffers, ec); - asio::detail::throw_error(ec, "write_some"); - return s; - } - - /// Write some data to the serial port. - /** - * This function is used to write data to the serial port. The function call - * will block until one or more bytes of the data has been written - * successfully, or until an error occurs. - * - * @param buffers One or more data buffers to be written to the serial port. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes written. Returns 0 if an error occurred. - * - * @note The write_some operation may not transmit all of the data to the - * peer. Consider using the @ref write function if you need to ensure that - * all data is written before the blocking operation completes. - */ - template - std::size_t write_some(const ConstBufferSequence& buffers, - asio::error_code& ec) - { - return this->get_service().write_some( - this->get_implementation(), buffers, ec); - } - - /// Start an asynchronous write. - /** - * This function is used to asynchronously write data to the serial port. - * The function call always returns immediately. - * - * @param buffers One or more data buffers to be written to the serial port. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the write operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes written. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The write operation may not transmit all of the data to the peer. - * Consider using the @ref async_write function if you need to ensure that all - * data is written before the asynchronous operation completes. - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code - * serial_port.async_write_some(asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_write_some(const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - - async_completion init(handler); - - this->get_service().async_write_some( - this->get_implementation(), buffers, init.completion_handler); - - return init.result.get(); - } - - /// Read some data from the serial port. - /** - * This function is used to read data from the serial port. The function - * call will block until one or more bytes of data has been read successfully, - * or until an error occurs. - * - * @param buffers One or more buffers into which the data will be read. - * - * @returns The number of bytes read. - * - * @throws asio::system_error Thrown on failure. An error code of - * asio::error::eof indicates that the connection was closed by the - * peer. - * - * @note The read_some operation may not read all of the requested number of - * bytes. Consider using the @ref read function if you need to ensure that - * the requested amount of data is read before the blocking operation - * completes. - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code - * serial_port.read_some(asio::buffer(data, size)); - * @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t read_some(const MutableBufferSequence& buffers) - { - asio::error_code ec; - std::size_t s = this->get_service().read_some( - this->get_implementation(), buffers, ec); - asio::detail::throw_error(ec, "read_some"); - return s; - } - - /// Read some data from the serial port. - /** - * This function is used to read data from the serial port. The function - * call will block until one or more bytes of data has been read successfully, - * or until an error occurs. - * - * @param buffers One or more buffers into which the data will be read. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes read. Returns 0 if an error occurred. - * - * @note The read_some operation may not read all of the requested number of - * bytes. Consider using the @ref read function if you need to ensure that - * the requested amount of data is read before the blocking operation - * completes. - */ - template - std::size_t read_some(const MutableBufferSequence& buffers, - asio::error_code& ec) - { - return this->get_service().read_some( - this->get_implementation(), buffers, ec); - } - - /// Start an asynchronous read. - /** - * This function is used to asynchronously read data from the serial port. - * The function call always returns immediately. - * - * @param buffers One or more buffers into which the data will be read. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes read. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The read operation may not read all of the requested number of bytes. - * Consider using the @ref async_read function if you need to ensure that the - * requested amount of data is read before the asynchronous operation - * completes. - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code - * serial_port.async_read_some(asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_read_some(const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - - async_completion init(handler); - - this->get_service().async_read_some( - this->get_implementation(), buffers, init.completion_handler); - - return init.result.get(); - } -}; -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if !defined(ASIO_ENABLE_OLD_SERVICES) -# undef ASIO_SVC_T -#endif // !defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // defined(ASIO_HAS_SERIAL_PORT) - // || defined(GENERATING_DOCUMENTATION) - -#endif // ASIO_SERIAL_PORT_HPP diff --git a/tools/sdk/include/asio/asio/serial_port_base.hpp b/tools/sdk/include/asio/asio/serial_port_base.hpp deleted file mode 100644 index feb5b9df871..00000000000 --- a/tools/sdk/include/asio/asio/serial_port_base.hpp +++ /dev/null @@ -1,167 +0,0 @@ -// -// serial_port_base.hpp -// ~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SERIAL_PORT_BASE_HPP -#define ASIO_SERIAL_PORT_BASE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_SERIAL_PORT) \ - || defined(GENERATING_DOCUMENTATION) - -#if !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) -# include -#endif // !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) - -#include "asio/detail/socket_types.hpp" -#include "asio/error_code.hpp" - -#if defined(GENERATING_DOCUMENTATION) -# define ASIO_OPTION_STORAGE implementation_defined -#elif defined(ASIO_WINDOWS) || defined(__CYGWIN__) -# define ASIO_OPTION_STORAGE DCB -#else -# define ASIO_OPTION_STORAGE termios -#endif - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// The serial_port_base class is used as a base for the basic_serial_port class -/// template so that we have a common place to define the serial port options. -class serial_port_base -{ -public: - /// Serial port option to permit changing the baud rate. - /** - * Implements changing the baud rate for a given serial port. - */ - class baud_rate - { - public: - explicit baud_rate(unsigned int rate = 0); - unsigned int value() const; - ASIO_DECL ASIO_SYNC_OP_VOID store( - ASIO_OPTION_STORAGE& storage, - asio::error_code& ec) const; - ASIO_DECL ASIO_SYNC_OP_VOID load( - const ASIO_OPTION_STORAGE& storage, - asio::error_code& ec); - private: - unsigned int value_; - }; - - /// Serial port option to permit changing the flow control. - /** - * Implements changing the flow control for a given serial port. - */ - class flow_control - { - public: - enum type { none, software, hardware }; - ASIO_DECL explicit flow_control(type t = none); - type value() const; - ASIO_DECL ASIO_SYNC_OP_VOID store( - ASIO_OPTION_STORAGE& storage, - asio::error_code& ec) const; - ASIO_DECL ASIO_SYNC_OP_VOID load( - const ASIO_OPTION_STORAGE& storage, - asio::error_code& ec); - private: - type value_; - }; - - /// Serial port option to permit changing the parity. - /** - * Implements changing the parity for a given serial port. - */ - class parity - { - public: - enum type { none, odd, even }; - ASIO_DECL explicit parity(type t = none); - type value() const; - ASIO_DECL ASIO_SYNC_OP_VOID store( - ASIO_OPTION_STORAGE& storage, - asio::error_code& ec) const; - ASIO_DECL ASIO_SYNC_OP_VOID load( - const ASIO_OPTION_STORAGE& storage, - asio::error_code& ec); - private: - type value_; - }; - - /// Serial port option to permit changing the number of stop bits. - /** - * Implements changing the number of stop bits for a given serial port. - */ - class stop_bits - { - public: - enum type { one, onepointfive, two }; - ASIO_DECL explicit stop_bits(type t = one); - type value() const; - ASIO_DECL ASIO_SYNC_OP_VOID store( - ASIO_OPTION_STORAGE& storage, - asio::error_code& ec) const; - ASIO_DECL ASIO_SYNC_OP_VOID load( - const ASIO_OPTION_STORAGE& storage, - asio::error_code& ec); - private: - type value_; - }; - - /// Serial port option to permit changing the character size. - /** - * Implements changing the character size for a given serial port. - */ - class character_size - { - public: - ASIO_DECL explicit character_size(unsigned int t = 8); - unsigned int value() const; - ASIO_DECL ASIO_SYNC_OP_VOID store( - ASIO_OPTION_STORAGE& storage, - asio::error_code& ec) const; - ASIO_DECL ASIO_SYNC_OP_VOID load( - const ASIO_OPTION_STORAGE& storage, - asio::error_code& ec); - private: - unsigned int value_; - }; - -protected: - /// Protected destructor to prevent deletion through this type. - ~serial_port_base() - { - } -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#undef ASIO_OPTION_STORAGE - -#include "asio/impl/serial_port_base.hpp" -#if defined(ASIO_HEADER_ONLY) -# include "asio/impl/serial_port_base.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // defined(ASIO_HAS_SERIAL_PORT) - // || defined(GENERATING_DOCUMENTATION) - -#endif // ASIO_SERIAL_PORT_BASE_HPP diff --git a/tools/sdk/include/asio/asio/serial_port_service.hpp b/tools/sdk/include/asio/asio/serial_port_service.hpp deleted file mode 100644 index 0e20d96e3f2..00000000000 --- a/tools/sdk/include/asio/asio/serial_port_service.hpp +++ /dev/null @@ -1,249 +0,0 @@ -// -// serial_port_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SERIAL_PORT_SERVICE_HPP -#define ASIO_SERIAL_PORT_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) - -#if defined(ASIO_HAS_SERIAL_PORT) \ - || defined(GENERATING_DOCUMENTATION) - -#include -#include -#include "asio/async_result.hpp" -#include "asio/detail/reactive_serial_port_service.hpp" -#include "asio/detail/win_iocp_serial_port_service.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" -#include "asio/serial_port_base.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Default service implementation for a serial port. -class serial_port_service -#if defined(GENERATING_DOCUMENTATION) - : public asio::io_context::service -#else - : public asio::detail::service_base -#endif -{ -public: -#if defined(GENERATING_DOCUMENTATION) - /// The unique service identifier. - static asio::io_context::id id; -#endif - -private: - // The type of the platform-specific implementation. -#if defined(ASIO_HAS_IOCP) - typedef detail::win_iocp_serial_port_service service_impl_type; -#else - typedef detail::reactive_serial_port_service service_impl_type; -#endif - -public: - /// The type of a serial port implementation. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined implementation_type; -#else - typedef service_impl_type::implementation_type implementation_type; -#endif - - /// The native handle type. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined native_handle_type; -#else - typedef service_impl_type::native_handle_type native_handle_type; -#endif - - /// Construct a new serial port service for the specified io_context. - explicit serial_port_service(asio::io_context& io_context) - : asio::detail::service_base(io_context), - service_impl_(io_context) - { - } - - /// Construct a new serial port implementation. - void construct(implementation_type& impl) - { - service_impl_.construct(impl); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a new serial port implementation. - void move_construct(implementation_type& impl, - implementation_type& other_impl) - { - service_impl_.move_construct(impl, other_impl); - } - - /// Move-assign from another serial port implementation. - void move_assign(implementation_type& impl, - serial_port_service& other_service, - implementation_type& other_impl) - { - service_impl_.move_assign(impl, other_service.service_impl_, other_impl); - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destroy a serial port implementation. - void destroy(implementation_type& impl) - { - service_impl_.destroy(impl); - } - - /// Open a serial port. - ASIO_SYNC_OP_VOID open(implementation_type& impl, - const std::string& device, asio::error_code& ec) - { - service_impl_.open(impl, device, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Assign an existing native handle to a serial port. - ASIO_SYNC_OP_VOID assign(implementation_type& impl, - const native_handle_type& handle, asio::error_code& ec) - { - service_impl_.assign(impl, handle, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Determine whether the handle is open. - bool is_open(const implementation_type& impl) const - { - return service_impl_.is_open(impl); - } - - /// Close a serial port implementation. - ASIO_SYNC_OP_VOID close(implementation_type& impl, - asio::error_code& ec) - { - service_impl_.close(impl, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get the native handle implementation. - native_handle_type native_handle(implementation_type& impl) - { - return service_impl_.native_handle(impl); - } - - /// Cancel all asynchronous operations associated with the handle. - ASIO_SYNC_OP_VOID cancel(implementation_type& impl, - asio::error_code& ec) - { - service_impl_.cancel(impl, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Set a serial port option. - template - ASIO_SYNC_OP_VOID set_option(implementation_type& impl, - const SettableSerialPortOption& option, asio::error_code& ec) - { - service_impl_.set_option(impl, option, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get a serial port option. - template - ASIO_SYNC_OP_VOID get_option(const implementation_type& impl, - GettableSerialPortOption& option, asio::error_code& ec) const - { - service_impl_.get_option(impl, option, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Send a break sequence to the serial port. - ASIO_SYNC_OP_VOID send_break(implementation_type& impl, - asio::error_code& ec) - { - service_impl_.send_break(impl, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Write the given data to the stream. - template - std::size_t write_some(implementation_type& impl, - const ConstBufferSequence& buffers, asio::error_code& ec) - { - return service_impl_.write_some(impl, buffers, ec); - } - - /// Start an asynchronous write. - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_write_some(implementation_type& impl, - const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler) - { - async_completion init(handler); - - service_impl_.async_write_some(impl, buffers, init.completion_handler); - - return init.result.get(); - } - - /// Read some data from the stream. - template - std::size_t read_some(implementation_type& impl, - const MutableBufferSequence& buffers, asio::error_code& ec) - { - return service_impl_.read_some(impl, buffers, ec); - } - - /// Start an asynchronous read. - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_read_some(implementation_type& impl, - const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler) - { - async_completion init(handler); - - service_impl_.async_read_some(impl, buffers, init.completion_handler); - - return init.result.get(); - } - -private: - // Destroy all user-defined handler objects owned by the service. - void shutdown() - { - service_impl_.shutdown(); - } - - // The platform-specific implementation. - service_impl_type service_impl_; -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_SERIAL_PORT) - // || defined(GENERATING_DOCUMENTATION) - -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_SERIAL_PORT_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/signal_set.hpp b/tools/sdk/include/asio/asio/signal_set.hpp deleted file mode 100644 index 30e5c4e39b7..00000000000 --- a/tools/sdk/include/asio/asio/signal_set.hpp +++ /dev/null @@ -1,447 +0,0 @@ -// -// signal_set.hpp -// ~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SIGNAL_SET_HPP -#define ASIO_SIGNAL_SET_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include "asio/async_result.hpp" -#include "asio/basic_io_object.hpp" -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) -# include "asio/basic_signal_set.hpp" -#else // defined(ASIO_ENABLE_OLD_SERVICES) -# include "asio/detail/signal_set_service.hpp" -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -namespace asio { - -#if defined(ASIO_ENABLE_OLD_SERVICES) -// Typedef for the typical usage of a signal set. -typedef basic_signal_set<> signal_set; -#else // defined(ASIO_ENABLE_OLD_SERVICES) -/// Provides signal functionality. -/** - * The signal_set class provides the ability to perform an asynchronous wait - * for one or more signals to occur. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - * - * @par Example - * Performing an asynchronous wait: - * @code - * void handler( - * const asio::error_code& error, - * int signal_number) - * { - * if (!error) - * { - * // A signal occurred. - * } - * } - * - * ... - * - * // Construct a signal set registered for process termination. - * asio::signal_set signals(io_context, SIGINT, SIGTERM); - * - * // Start an asynchronous wait for one of the signals to occur. - * signals.async_wait(handler); - * @endcode - * - * @par Queueing of signal notifications - * - * If a signal is registered with a signal_set, and the signal occurs when - * there are no waiting handlers, then the signal notification is queued. The - * next async_wait operation on that signal_set will dequeue the notification. - * If multiple notifications are queued, subsequent async_wait operations - * dequeue them one at a time. Signal notifications are dequeued in order of - * ascending signal number. - * - * If a signal number is removed from a signal_set (using the @c remove or @c - * erase member functions) then any queued notifications for that signal are - * discarded. - * - * @par Multiple registration of signals - * - * The same signal number may be registered with different signal_set objects. - * When the signal occurs, one handler is called for each signal_set object. - * - * Note that multiple registration only works for signals that are registered - * using Asio. The application must not also register a signal handler using - * functions such as @c signal() or @c sigaction(). - * - * @par Signal masking on POSIX platforms - * - * POSIX allows signals to be blocked using functions such as @c sigprocmask() - * and @c pthread_sigmask(). For signals to be delivered, programs must ensure - * that any signals registered using signal_set objects are unblocked in at - * least one thread. - */ -class signal_set - : ASIO_SVC_ACCESS basic_io_object -{ -public: - /// The type of the executor associated with the object. - typedef io_context::executor_type executor_type; - - /// Construct a signal set without adding any signals. - /** - * This constructor creates a signal set without registering for any signals. - * - * @param io_context The io_context object that the signal set will use to - * dispatch handlers for any asynchronous operations performed on the set. - */ - explicit signal_set(asio::io_context& io_context) - : basic_io_object(io_context) - { - } - - /// Construct a signal set and add one signal. - /** - * This constructor creates a signal set and registers for one signal. - * - * @param io_context The io_context object that the signal set will use to - * dispatch handlers for any asynchronous operations performed on the set. - * - * @param signal_number_1 The signal number to be added. - * - * @note This constructor is equivalent to performing: - * @code asio::signal_set signals(io_context); - * signals.add(signal_number_1); @endcode - */ - signal_set(asio::io_context& io_context, int signal_number_1) - : basic_io_object(io_context) - { - asio::error_code ec; - this->get_service().add(this->get_implementation(), signal_number_1, ec); - asio::detail::throw_error(ec, "add"); - } - - /// Construct a signal set and add two signals. - /** - * This constructor creates a signal set and registers for two signals. - * - * @param io_context The io_context object that the signal set will use to - * dispatch handlers for any asynchronous operations performed on the set. - * - * @param signal_number_1 The first signal number to be added. - * - * @param signal_number_2 The second signal number to be added. - * - * @note This constructor is equivalent to performing: - * @code asio::signal_set signals(io_context); - * signals.add(signal_number_1); - * signals.add(signal_number_2); @endcode - */ - signal_set(asio::io_context& io_context, int signal_number_1, - int signal_number_2) - : basic_io_object(io_context) - { - asio::error_code ec; - this->get_service().add(this->get_implementation(), signal_number_1, ec); - asio::detail::throw_error(ec, "add"); - this->get_service().add(this->get_implementation(), signal_number_2, ec); - asio::detail::throw_error(ec, "add"); - } - - /// Construct a signal set and add three signals. - /** - * This constructor creates a signal set and registers for three signals. - * - * @param io_context The io_context object that the signal set will use to - * dispatch handlers for any asynchronous operations performed on the set. - * - * @param signal_number_1 The first signal number to be added. - * - * @param signal_number_2 The second signal number to be added. - * - * @param signal_number_3 The third signal number to be added. - * - * @note This constructor is equivalent to performing: - * @code asio::signal_set signals(io_context); - * signals.add(signal_number_1); - * signals.add(signal_number_2); - * signals.add(signal_number_3); @endcode - */ - signal_set(asio::io_context& io_context, int signal_number_1, - int signal_number_2, int signal_number_3) - : basic_io_object(io_context) - { - asio::error_code ec; - this->get_service().add(this->get_implementation(), signal_number_1, ec); - asio::detail::throw_error(ec, "add"); - this->get_service().add(this->get_implementation(), signal_number_2, ec); - asio::detail::throw_error(ec, "add"); - this->get_service().add(this->get_implementation(), signal_number_3, ec); - asio::detail::throw_error(ec, "add"); - } - - /// Destroys the signal set. - /** - * This function destroys the signal set, cancelling any outstanding - * asynchronous wait operations associated with the signal set as if by - * calling @c cancel. - */ - ~signal_set() - { - } - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - /** - * This function may be used to obtain the io_context object that the I/O - * object uses to dispatch handlers for asynchronous operations. - * - * @return A reference to the io_context object that the I/O object will use - * to dispatch handlers. Ownership is not transferred to the caller. - */ - asio::io_context& get_io_context() - { - return basic_io_object::get_io_context(); - } - - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - /** - * This function may be used to obtain the io_context object that the I/O - * object uses to dispatch handlers for asynchronous operations. - * - * @return A reference to the io_context object that the I/O object will use - * to dispatch handlers. Ownership is not transferred to the caller. - */ - asio::io_context& get_io_service() - { - return basic_io_object::get_io_service(); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Get the executor associated with the object. - executor_type get_executor() ASIO_NOEXCEPT - { - return basic_io_object::get_executor(); - } - - /// Add a signal to a signal_set. - /** - * This function adds the specified signal to the set. It has no effect if the - * signal is already in the set. - * - * @param signal_number The signal to be added to the set. - * - * @throws asio::system_error Thrown on failure. - */ - void add(int signal_number) - { - asio::error_code ec; - this->get_service().add(this->get_implementation(), signal_number, ec); - asio::detail::throw_error(ec, "add"); - } - - /// Add a signal to a signal_set. - /** - * This function adds the specified signal to the set. It has no effect if the - * signal is already in the set. - * - * @param signal_number The signal to be added to the set. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID add(int signal_number, - asio::error_code& ec) - { - this->get_service().add(this->get_implementation(), signal_number, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Remove a signal from a signal_set. - /** - * This function removes the specified signal from the set. It has no effect - * if the signal is not in the set. - * - * @param signal_number The signal to be removed from the set. - * - * @throws asio::system_error Thrown on failure. - * - * @note Removes any notifications that have been queued for the specified - * signal number. - */ - void remove(int signal_number) - { - asio::error_code ec; - this->get_service().remove(this->get_implementation(), signal_number, ec); - asio::detail::throw_error(ec, "remove"); - } - - /// Remove a signal from a signal_set. - /** - * This function removes the specified signal from the set. It has no effect - * if the signal is not in the set. - * - * @param signal_number The signal to be removed from the set. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Removes any notifications that have been queued for the specified - * signal number. - */ - ASIO_SYNC_OP_VOID remove(int signal_number, - asio::error_code& ec) - { - this->get_service().remove(this->get_implementation(), signal_number, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Remove all signals from a signal_set. - /** - * This function removes all signals from the set. It has no effect if the set - * is already empty. - * - * @throws asio::system_error Thrown on failure. - * - * @note Removes all queued notifications. - */ - void clear() - { - asio::error_code ec; - this->get_service().clear(this->get_implementation(), ec); - asio::detail::throw_error(ec, "clear"); - } - - /// Remove all signals from a signal_set. - /** - * This function removes all signals from the set. It has no effect if the set - * is already empty. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Removes all queued notifications. - */ - ASIO_SYNC_OP_VOID clear(asio::error_code& ec) - { - this->get_service().clear(this->get_implementation(), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Cancel all operations associated with the signal set. - /** - * This function forces the completion of any pending asynchronous wait - * operations against the signal set. The handler for each cancelled - * operation will be invoked with the asio::error::operation_aborted - * error code. - * - * Cancellation does not alter the set of registered signals. - * - * @throws asio::system_error Thrown on failure. - * - * @note If a registered signal occurred before cancel() is called, then the - * handlers for asynchronous wait operations will: - * - * @li have already been invoked; or - * - * @li have been queued for invocation in the near future. - * - * These handlers can no longer be cancelled, and therefore are passed an - * error code that indicates the successful completion of the wait operation. - */ - void cancel() - { - asio::error_code ec; - this->get_service().cancel(this->get_implementation(), ec); - asio::detail::throw_error(ec, "cancel"); - } - - /// Cancel all operations associated with the signal set. - /** - * This function forces the completion of any pending asynchronous wait - * operations against the signal set. The handler for each cancelled - * operation will be invoked with the asio::error::operation_aborted - * error code. - * - * Cancellation does not alter the set of registered signals. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note If a registered signal occurred before cancel() is called, then the - * handlers for asynchronous wait operations will: - * - * @li have already been invoked; or - * - * @li have been queued for invocation in the near future. - * - * These handlers can no longer be cancelled, and therefore are passed an - * error code that indicates the successful completion of the wait operation. - */ - ASIO_SYNC_OP_VOID cancel(asio::error_code& ec) - { - this->get_service().cancel(this->get_implementation(), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Start an asynchronous operation to wait for a signal to be delivered. - /** - * This function may be used to initiate an asynchronous wait against the - * signal set. It always returns immediately. - * - * For each call to async_wait(), the supplied handler will be called exactly - * once. The handler will be called when: - * - * @li One of the registered signals in the signal set occurs; or - * - * @li The signal set was cancelled, in which case the handler is passed the - * error code asio::error::operation_aborted. - * - * @param handler The handler to be called when the signal occurs. Copies - * will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * int signal_number // Indicates which signal occurred. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - */ - template - ASIO_INITFN_RESULT_TYPE(SignalHandler, - void (asio::error_code, int)) - async_wait(ASIO_MOVE_ARG(SignalHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a SignalHandler. - ASIO_SIGNAL_HANDLER_CHECK(SignalHandler, handler) type_check; - - async_completion init(handler); - - this->get_service().async_wait(this->get_implementation(), - init.completion_handler); - - return init.result.get(); - } -}; -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -} // namespace asio - -#endif // ASIO_SIGNAL_SET_HPP diff --git a/tools/sdk/include/asio/asio/signal_set_service.hpp b/tools/sdk/include/asio/asio/signal_set_service.hpp deleted file mode 100644 index 3285beb0035..00000000000 --- a/tools/sdk/include/asio/asio/signal_set_service.hpp +++ /dev/null @@ -1,142 +0,0 @@ -// -// signal_set_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SIGNAL_SET_SERVICE_HPP -#define ASIO_SIGNAL_SET_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) - -#include "asio/async_result.hpp" -#include "asio/detail/signal_set_service.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Default service implementation for a signal set. -class signal_set_service -#if defined(GENERATING_DOCUMENTATION) - : public asio::io_context::service -#else - : public asio::detail::service_base -#endif -{ -public: -#if defined(GENERATING_DOCUMENTATION) - /// The unique service identifier. - static asio::io_context::id id; -#endif - -public: - /// The type of a signal set implementation. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined implementation_type; -#else - typedef detail::signal_set_service::implementation_type implementation_type; -#endif - - /// Construct a new signal set service for the specified io_context. - explicit signal_set_service(asio::io_context& io_context) - : asio::detail::service_base(io_context), - service_impl_(io_context) - { - } - - /// Construct a new signal set implementation. - void construct(implementation_type& impl) - { - service_impl_.construct(impl); - } - - /// Destroy a signal set implementation. - void destroy(implementation_type& impl) - { - service_impl_.destroy(impl); - } - - /// Add a signal to a signal_set. - ASIO_SYNC_OP_VOID add(implementation_type& impl, - int signal_number, asio::error_code& ec) - { - service_impl_.add(impl, signal_number, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Remove a signal to a signal_set. - ASIO_SYNC_OP_VOID remove(implementation_type& impl, - int signal_number, asio::error_code& ec) - { - service_impl_.remove(impl, signal_number, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Remove all signals from a signal_set. - ASIO_SYNC_OP_VOID clear(implementation_type& impl, - asio::error_code& ec) - { - service_impl_.clear(impl, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Cancel all operations associated with the signal set. - ASIO_SYNC_OP_VOID cancel(implementation_type& impl, - asio::error_code& ec) - { - service_impl_.cancel(impl, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - // Start an asynchronous operation to wait for a signal to be delivered. - template - ASIO_INITFN_RESULT_TYPE(SignalHandler, - void (asio::error_code, int)) - async_wait(implementation_type& impl, - ASIO_MOVE_ARG(SignalHandler) handler) - { - async_completion init(handler); - - service_impl_.async_wait(impl, init.completion_handler); - - return init.result.get(); - } - -private: - // Destroy all user-defined handler objects owned by the service. - void shutdown() - { - service_impl_.shutdown(); - } - - // Perform any fork-related housekeeping. - void notify_fork(asio::io_context::fork_event event) - { - service_impl_.notify_fork(event); - } - - // The platform-specific implementation. - detail::signal_set_service service_impl_; -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_SIGNAL_SET_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/socket_acceptor_service.hpp b/tools/sdk/include/asio/asio/socket_acceptor_service.hpp deleted file mode 100644 index cd40fe14201..00000000000 --- a/tools/sdk/include/asio/asio/socket_acceptor_service.hpp +++ /dev/null @@ -1,372 +0,0 @@ -// -// socket_acceptor_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SOCKET_ACCEPTOR_SERVICE_HPP -#define ASIO_SOCKET_ACCEPTOR_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) - -#include "asio/basic_socket.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" - -#if defined(ASIO_WINDOWS_RUNTIME) -# include "asio/detail/null_socket_service.hpp" -#elif defined(ASIO_HAS_IOCP) -# include "asio/detail/win_iocp_socket_service.hpp" -#else -# include "asio/detail/reactive_socket_service.hpp" -#endif - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Default service implementation for a socket acceptor. -template -class socket_acceptor_service -#if defined(GENERATING_DOCUMENTATION) - : public asio::io_context::service -#else - : public asio::detail::service_base > -#endif -{ -public: -#if defined(GENERATING_DOCUMENTATION) - /// The unique service identifier. - static asio::io_context::id id; -#endif - - /// The protocol type. - typedef Protocol protocol_type; - - /// The endpoint type. - typedef typename protocol_type::endpoint endpoint_type; - -private: - // The type of the platform-specific implementation. -#if defined(ASIO_WINDOWS_RUNTIME) - typedef detail::null_socket_service service_impl_type; -#elif defined(ASIO_HAS_IOCP) - typedef detail::win_iocp_socket_service service_impl_type; -#else - typedef detail::reactive_socket_service service_impl_type; -#endif - -public: - /// The native type of the socket acceptor. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined implementation_type; -#else - typedef typename service_impl_type::implementation_type implementation_type; -#endif - - /// The native acceptor type. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined native_handle_type; -#else - typedef typename service_impl_type::native_handle_type native_handle_type; -#endif - - /// Construct a new socket acceptor service for the specified io_context. - explicit socket_acceptor_service(asio::io_context& io_context) - : asio::detail::service_base< - socket_acceptor_service >(io_context), - service_impl_(io_context) - { - } - - /// Construct a new socket acceptor implementation. - void construct(implementation_type& impl) - { - service_impl_.construct(impl); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a new socket acceptor implementation. - void move_construct(implementation_type& impl, - implementation_type& other_impl) - { - service_impl_.move_construct(impl, other_impl); - } - - /// Move-assign from another socket acceptor implementation. - void move_assign(implementation_type& impl, - socket_acceptor_service& other_service, - implementation_type& other_impl) - { - service_impl_.move_assign(impl, other_service.service_impl_, other_impl); - } - - // All acceptor services have access to each other's implementations. - template friend class socket_acceptor_service; - - /// Move-construct a new socket acceptor implementation from another protocol - /// type. - template - void converting_move_construct(implementation_type& impl, - socket_acceptor_service& other_service, - typename socket_acceptor_service< - Protocol1>::implementation_type& other_impl, - typename enable_if::value>::type* = 0) - { - service_impl_.template converting_move_construct( - impl, other_service.service_impl_, other_impl); - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destroy a socket acceptor implementation. - void destroy(implementation_type& impl) - { - service_impl_.destroy(impl); - } - - /// Open a new socket acceptor implementation. - ASIO_SYNC_OP_VOID open(implementation_type& impl, - const protocol_type& protocol, asio::error_code& ec) - { - service_impl_.open(impl, protocol, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Assign an existing native acceptor to a socket acceptor. - ASIO_SYNC_OP_VOID assign(implementation_type& impl, - const protocol_type& protocol, const native_handle_type& native_acceptor, - asio::error_code& ec) - { - service_impl_.assign(impl, protocol, native_acceptor, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Determine whether the acceptor is open. - bool is_open(const implementation_type& impl) const - { - return service_impl_.is_open(impl); - } - - /// Cancel all asynchronous operations associated with the acceptor. - ASIO_SYNC_OP_VOID cancel(implementation_type& impl, - asio::error_code& ec) - { - service_impl_.cancel(impl, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Bind the socket acceptor to the specified local endpoint. - ASIO_SYNC_OP_VOID bind(implementation_type& impl, - const endpoint_type& endpoint, asio::error_code& ec) - { - service_impl_.bind(impl, endpoint, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Place the socket acceptor into the state where it will listen for new - /// connections. - ASIO_SYNC_OP_VOID listen(implementation_type& impl, int backlog, - asio::error_code& ec) - { - service_impl_.listen(impl, backlog, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Close a socket acceptor implementation. - ASIO_SYNC_OP_VOID close(implementation_type& impl, - asio::error_code& ec) - { - service_impl_.close(impl, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Release ownership of the underlying acceptor. - native_handle_type release(implementation_type& impl, - asio::error_code& ec) - { - return service_impl_.release(impl, ec); - } - - /// Get the native acceptor implementation. - native_handle_type native_handle(implementation_type& impl) - { - return service_impl_.native_handle(impl); - } - - /// Set a socket option. - template - ASIO_SYNC_OP_VOID set_option(implementation_type& impl, - const SettableSocketOption& option, asio::error_code& ec) - { - service_impl_.set_option(impl, option, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get a socket option. - template - ASIO_SYNC_OP_VOID get_option(const implementation_type& impl, - GettableSocketOption& option, asio::error_code& ec) const - { - service_impl_.get_option(impl, option, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Perform an IO control command on the socket. - template - ASIO_SYNC_OP_VOID io_control(implementation_type& impl, - IoControlCommand& command, asio::error_code& ec) - { - service_impl_.io_control(impl, command, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Gets the non-blocking mode of the acceptor. - bool non_blocking(const implementation_type& impl) const - { - return service_impl_.non_blocking(impl); - } - - /// Sets the non-blocking mode of the acceptor. - ASIO_SYNC_OP_VOID non_blocking(implementation_type& impl, - bool mode, asio::error_code& ec) - { - service_impl_.non_blocking(impl, mode, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Gets the non-blocking mode of the native acceptor implementation. - bool native_non_blocking(const implementation_type& impl) const - { - return service_impl_.native_non_blocking(impl); - } - - /// Sets the non-blocking mode of the native acceptor implementation. - ASIO_SYNC_OP_VOID native_non_blocking(implementation_type& impl, - bool mode, asio::error_code& ec) - { - service_impl_.native_non_blocking(impl, mode, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get the local endpoint. - endpoint_type local_endpoint(const implementation_type& impl, - asio::error_code& ec) const - { - return service_impl_.local_endpoint(impl, ec); - } - - /// Wait for the acceptor to become ready to read, ready to write, or to have - /// pending error conditions. - ASIO_SYNC_OP_VOID wait(implementation_type& impl, - socket_base::wait_type w, asio::error_code& ec) - { - service_impl_.wait(impl, w, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Asynchronously wait for the acceptor to become ready to read, ready to - /// write, or to have pending error conditions. - template - ASIO_INITFN_RESULT_TYPE(WaitHandler, - void (asio::error_code)) - async_wait(implementation_type& impl, socket_base::wait_type w, - ASIO_MOVE_ARG(WaitHandler) handler) - { - async_completion init(handler); - - service_impl_.async_wait(impl, w, init.completion_handler); - - return init.result.get(); - } - - /// Accept a new connection. - template - ASIO_SYNC_OP_VOID accept(implementation_type& impl, - basic_socket& peer, - endpoint_type* peer_endpoint, asio::error_code& ec, - typename enable_if::value>::type* = 0) - { - service_impl_.accept(impl, peer, peer_endpoint, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - -#if defined(ASIO_HAS_MOVE) - /// Accept a new connection. - typename Protocol::socket accept(implementation_type& impl, - io_context* peer_io_context, endpoint_type* peer_endpoint, - asio::error_code& ec) - { - return service_impl_.accept(impl, peer_io_context, peer_endpoint, ec); - } -#endif // defined(ASIO_HAS_MOVE) - - /// Start an asynchronous accept. - template - ASIO_INITFN_RESULT_TYPE(AcceptHandler, - void (asio::error_code)) - async_accept(implementation_type& impl, - basic_socket& peer, - endpoint_type* peer_endpoint, - ASIO_MOVE_ARG(AcceptHandler) handler, - typename enable_if::value>::type* = 0) - { - async_completion init(handler); - - service_impl_.async_accept(impl, - peer, peer_endpoint, init.completion_handler); - - return init.result.get(); - } - -#if defined(ASIO_HAS_MOVE) - /// Start an asynchronous accept. - template - ASIO_INITFN_RESULT_TYPE(MoveAcceptHandler, - void (asio::error_code, typename Protocol::socket)) - async_accept(implementation_type& impl, - asio::io_context* peer_io_context, endpoint_type* peer_endpoint, - ASIO_MOVE_ARG(MoveAcceptHandler) handler) - { - async_completion init(handler); - - service_impl_.async_accept(impl, - peer_io_context, peer_endpoint, init.completion_handler); - - return init.result.get(); - } -#endif // defined(ASIO_HAS_MOVE) - -private: - // Destroy all user-defined handler objects owned by the service. - void shutdown() - { - service_impl_.shutdown(); - } - - // The platform-specific implementation. - service_impl_type service_impl_; -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_SOCKET_ACCEPTOR_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/socket_base.hpp b/tools/sdk/include/asio/asio/socket_base.hpp deleted file mode 100644 index 87ed8408bd0..00000000000 --- a/tools/sdk/include/asio/asio/socket_base.hpp +++ /dev/null @@ -1,559 +0,0 @@ -// -// socket_base.hpp -// ~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SOCKET_BASE_HPP -#define ASIO_SOCKET_BASE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/io_control.hpp" -#include "asio/detail/socket_option.hpp" -#include "asio/detail/socket_types.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// The socket_base class is used as a base for the basic_stream_socket and -/// basic_datagram_socket class templates so that we have a common place to -/// define the shutdown_type and enum. -class socket_base -{ -public: - /// Different ways a socket may be shutdown. - enum shutdown_type - { -#if defined(GENERATING_DOCUMENTATION) - /// Shutdown the receive side of the socket. - shutdown_receive = implementation_defined, - - /// Shutdown the send side of the socket. - shutdown_send = implementation_defined, - - /// Shutdown both send and receive on the socket. - shutdown_both = implementation_defined -#else - shutdown_receive = ASIO_OS_DEF(SHUT_RD), - shutdown_send = ASIO_OS_DEF(SHUT_WR), - shutdown_both = ASIO_OS_DEF(SHUT_RDWR) -#endif - }; - - /// Bitmask type for flags that can be passed to send and receive operations. - typedef int message_flags; - -#if defined(GENERATING_DOCUMENTATION) - /// Peek at incoming data without removing it from the input queue. - static const int message_peek = implementation_defined; - - /// Process out-of-band data. - static const int message_out_of_band = implementation_defined; - - /// Specify that the data should not be subject to routing. - static const int message_do_not_route = implementation_defined; - - /// Specifies that the data marks the end of a record. - static const int message_end_of_record = implementation_defined; -#else - ASIO_STATIC_CONSTANT(int, - message_peek = ASIO_OS_DEF(MSG_PEEK)); - ASIO_STATIC_CONSTANT(int, - message_out_of_band = ASIO_OS_DEF(MSG_OOB)); - ASIO_STATIC_CONSTANT(int, - message_do_not_route = ASIO_OS_DEF(MSG_DONTROUTE)); - ASIO_STATIC_CONSTANT(int, - message_end_of_record = ASIO_OS_DEF(MSG_EOR)); -#endif - - /// Wait types. - /** - * For use with basic_socket::wait() and basic_socket::async_wait(). - */ - enum wait_type - { - /// Wait for a socket to become ready to read. - wait_read, - - /// Wait for a socket to become ready to write. - wait_write, - - /// Wait for a socket to have error conditions pending. - wait_error - }; - - /// Socket option to permit sending of broadcast messages. - /** - * Implements the SOL_SOCKET/SO_BROADCAST socket option. - * - * @par Examples - * Setting the option: - * @code - * asio::ip::udp::socket socket(io_context); - * ... - * asio::socket_base::broadcast option(true); - * socket.set_option(option); - * @endcode - * - * @par - * Getting the current option value: - * @code - * asio::ip::udp::socket socket(io_context); - * ... - * asio::socket_base::broadcast option; - * socket.get_option(option); - * bool is_set = option.value(); - * @endcode - * - * @par Concepts: - * Socket_Option, Boolean_Socket_Option. - */ -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined broadcast; -#else - typedef asio::detail::socket_option::boolean< - ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_BROADCAST)> - broadcast; -#endif - - /// Socket option to enable socket-level debugging. - /** - * Implements the SOL_SOCKET/SO_DEBUG socket option. - * - * @par Examples - * Setting the option: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::socket_base::debug option(true); - * socket.set_option(option); - * @endcode - * - * @par - * Getting the current option value: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::socket_base::debug option; - * socket.get_option(option); - * bool is_set = option.value(); - * @endcode - * - * @par Concepts: - * Socket_Option, Boolean_Socket_Option. - */ -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined debug; -#else - typedef asio::detail::socket_option::boolean< - ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_DEBUG)> debug; -#endif - - /// Socket option to prevent routing, use local interfaces only. - /** - * Implements the SOL_SOCKET/SO_DONTROUTE socket option. - * - * @par Examples - * Setting the option: - * @code - * asio::ip::udp::socket socket(io_context); - * ... - * asio::socket_base::do_not_route option(true); - * socket.set_option(option); - * @endcode - * - * @par - * Getting the current option value: - * @code - * asio::ip::udp::socket socket(io_context); - * ... - * asio::socket_base::do_not_route option; - * socket.get_option(option); - * bool is_set = option.value(); - * @endcode - * - * @par Concepts: - * Socket_Option, Boolean_Socket_Option. - */ -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined do_not_route; -#else - typedef asio::detail::socket_option::boolean< - ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_DONTROUTE)> - do_not_route; -#endif - - /// Socket option to send keep-alives. - /** - * Implements the SOL_SOCKET/SO_KEEPALIVE socket option. - * - * @par Examples - * Setting the option: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::socket_base::keep_alive option(true); - * socket.set_option(option); - * @endcode - * - * @par - * Getting the current option value: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::socket_base::keep_alive option; - * socket.get_option(option); - * bool is_set = option.value(); - * @endcode - * - * @par Concepts: - * Socket_Option, Boolean_Socket_Option. - */ -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined keep_alive; -#else - typedef asio::detail::socket_option::boolean< - ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_KEEPALIVE)> keep_alive; -#endif - - /// Socket option for the send buffer size of a socket. - /** - * Implements the SOL_SOCKET/SO_SNDBUF socket option. - * - * @par Examples - * Setting the option: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::socket_base::send_buffer_size option(8192); - * socket.set_option(option); - * @endcode - * - * @par - * Getting the current option value: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::socket_base::send_buffer_size option; - * socket.get_option(option); - * int size = option.value(); - * @endcode - * - * @par Concepts: - * Socket_Option, Integer_Socket_Option. - */ -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined send_buffer_size; -#else - typedef asio::detail::socket_option::integer< - ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_SNDBUF)> - send_buffer_size; -#endif - - /// Socket option for the send low watermark. - /** - * Implements the SOL_SOCKET/SO_SNDLOWAT socket option. - * - * @par Examples - * Setting the option: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::socket_base::send_low_watermark option(1024); - * socket.set_option(option); - * @endcode - * - * @par - * Getting the current option value: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::socket_base::send_low_watermark option; - * socket.get_option(option); - * int size = option.value(); - * @endcode - * - * @par Concepts: - * Socket_Option, Integer_Socket_Option. - */ -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined send_low_watermark; -#else - typedef asio::detail::socket_option::integer< - ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_SNDLOWAT)> - send_low_watermark; -#endif - - /// Socket option for the receive buffer size of a socket. - /** - * Implements the SOL_SOCKET/SO_RCVBUF socket option. - * - * @par Examples - * Setting the option: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::socket_base::receive_buffer_size option(8192); - * socket.set_option(option); - * @endcode - * - * @par - * Getting the current option value: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::socket_base::receive_buffer_size option; - * socket.get_option(option); - * int size = option.value(); - * @endcode - * - * @par Concepts: - * Socket_Option, Integer_Socket_Option. - */ -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined receive_buffer_size; -#else - typedef asio::detail::socket_option::integer< - ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_RCVBUF)> - receive_buffer_size; -#endif - - /// Socket option for the receive low watermark. - /** - * Implements the SOL_SOCKET/SO_RCVLOWAT socket option. - * - * @par Examples - * Setting the option: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::socket_base::receive_low_watermark option(1024); - * socket.set_option(option); - * @endcode - * - * @par - * Getting the current option value: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::socket_base::receive_low_watermark option; - * socket.get_option(option); - * int size = option.value(); - * @endcode - * - * @par Concepts: - * Socket_Option, Integer_Socket_Option. - */ -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined receive_low_watermark; -#else - typedef asio::detail::socket_option::integer< - ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_RCVLOWAT)> - receive_low_watermark; -#endif - - /// Socket option to allow the socket to be bound to an address that is - /// already in use. - /** - * Implements the SOL_SOCKET/SO_REUSEADDR socket option. - * - * @par Examples - * Setting the option: - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::socket_base::reuse_address option(true); - * acceptor.set_option(option); - * @endcode - * - * @par - * Getting the current option value: - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::socket_base::reuse_address option; - * acceptor.get_option(option); - * bool is_set = option.value(); - * @endcode - * - * @par Concepts: - * Socket_Option, Boolean_Socket_Option. - */ -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined reuse_address; -#else - typedef asio::detail::socket_option::boolean< - ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_REUSEADDR)> - reuse_address; -#endif - - /// Socket option to specify whether the socket lingers on close if unsent - /// data is present. - /** - * Implements the SOL_SOCKET/SO_LINGER socket option. - * - * @par Examples - * Setting the option: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::socket_base::linger option(true, 30); - * socket.set_option(option); - * @endcode - * - * @par - * Getting the current option value: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::socket_base::linger option; - * socket.get_option(option); - * bool is_set = option.enabled(); - * unsigned short timeout = option.timeout(); - * @endcode - * - * @par Concepts: - * Socket_Option, Linger_Socket_Option. - */ -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined linger; -#else - typedef asio::detail::socket_option::linger< - ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_LINGER)> - linger; -#endif - - /// Socket option for putting received out-of-band data inline. - /** - * Implements the SOL_SOCKET/SO_OOBINLINE socket option. - * - * @par Examples - * Setting the option: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::socket_base::out_of_band_inline option(true); - * socket.set_option(option); - * @endcode - * - * @par - * Getting the current option value: - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::socket_base::out_of_band_inline option; - * socket.get_option(option); - * bool value = option.value(); - * @endcode - * - * @par Concepts: - * Socket_Option, Boolean_Socket_Option. - */ -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined out_of_band_inline; -#else - typedef asio::detail::socket_option::boolean< - ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_OOBINLINE)> - out_of_band_inline; -#endif - - /// Socket option to report aborted connections on accept. - /** - * Implements a custom socket option that determines whether or not an accept - * operation is permitted to fail with asio::error::connection_aborted. - * By default the option is false. - * - * @par Examples - * Setting the option: - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::socket_base::enable_connection_aborted option(true); - * acceptor.set_option(option); - * @endcode - * - * @par - * Getting the current option value: - * @code - * asio::ip::tcp::acceptor acceptor(io_context); - * ... - * asio::socket_base::enable_connection_aborted option; - * acceptor.get_option(option); - * bool is_set = option.value(); - * @endcode - * - * @par Concepts: - * Socket_Option, Boolean_Socket_Option. - */ -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined enable_connection_aborted; -#else - typedef asio::detail::socket_option::boolean< - asio::detail::custom_socket_option_level, - asio::detail::enable_connection_aborted_option> - enable_connection_aborted; -#endif - - /// IO control command to get the amount of data that can be read without - /// blocking. - /** - * Implements the FIONREAD IO control command. - * - * @par Example - * @code - * asio::ip::tcp::socket socket(io_context); - * ... - * asio::socket_base::bytes_readable command(true); - * socket.io_control(command); - * std::size_t bytes_readable = command.get(); - * @endcode - * - * @par Concepts: - * IO_Control_Command, Size_IO_Control_Command. - */ -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined bytes_readable; -#else - typedef asio::detail::io_control::bytes_readable bytes_readable; -#endif - - /// The maximum length of the queue of pending incoming connections. -#if defined(GENERATING_DOCUMENTATION) - static const int max_listen_connections = implementation_defined; -#else - ASIO_STATIC_CONSTANT(int, max_listen_connections - = ASIO_OS_DEF(SOMAXCONN)); -#endif - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use max_listen_connections.) The maximum length of the queue - /// of pending incoming connections. -#if defined(GENERATING_DOCUMENTATION) - static const int max_connections = implementation_defined; -#else - ASIO_STATIC_CONSTANT(int, max_connections - = ASIO_OS_DEF(SOMAXCONN)); -#endif -#endif // !defined(ASIO_NO_DEPRECATED) - -protected: - /// Protected destructor to prevent deletion through this type. - ~socket_base() - { - } -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_SOCKET_BASE_HPP diff --git a/tools/sdk/include/asio/asio/spawn.hpp b/tools/sdk/include/asio/asio/spawn.hpp deleted file mode 100644 index a91c5815fbd..00000000000 --- a/tools/sdk/include/asio/asio/spawn.hpp +++ /dev/null @@ -1,336 +0,0 @@ -// -// spawn.hpp -// ~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SPAWN_HPP -#define ASIO_SPAWN_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/bind_executor.hpp" -#include "asio/detail/memory.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/detail/wrapped_handler.hpp" -#include "asio/executor.hpp" -#include "asio/io_context.hpp" -#include "asio/is_executor.hpp" -#include "asio/strand.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Context object the represents the currently executing coroutine. -/** - * The basic_yield_context class is used to represent the currently executing - * stackful coroutine. A basic_yield_context may be passed as a handler to an - * asynchronous operation. For example: - * - * @code template - * void my_coroutine(basic_yield_context yield) - * { - * ... - * std::size_t n = my_socket.async_read_some(buffer, yield); - * ... - * } @endcode - * - * The initiating function (async_read_some in the above example) suspends the - * current coroutine. The coroutine is resumed when the asynchronous operation - * completes, and the result of the operation is returned. - */ -template -class basic_yield_context -{ -public: - /// The coroutine callee type, used by the implementation. - /** - * When using Boost.Coroutine v1, this type is: - * @code typename coroutine @endcode - * When using Boost.Coroutine v2 (unidirectional coroutines), this type is: - * @code push_coroutine @endcode - */ -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined callee_type; -#elif defined(BOOST_COROUTINES_UNIDIRECT) || defined(BOOST_COROUTINES_V2) - typedef boost::coroutines::push_coroutine callee_type; -#else - typedef boost::coroutines::coroutine callee_type; -#endif - - /// The coroutine caller type, used by the implementation. - /** - * When using Boost.Coroutine v1, this type is: - * @code typename coroutine::caller_type @endcode - * When using Boost.Coroutine v2 (unidirectional coroutines), this type is: - * @code pull_coroutine @endcode - */ -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined caller_type; -#elif defined(BOOST_COROUTINES_UNIDIRECT) || defined(BOOST_COROUTINES_V2) - typedef boost::coroutines::pull_coroutine caller_type; -#else - typedef boost::coroutines::coroutine::caller_type caller_type; -#endif - - /// Construct a yield context to represent the specified coroutine. - /** - * Most applications do not need to use this constructor. Instead, the - * spawn() function passes a yield context as an argument to the coroutine - * function. - */ - basic_yield_context( - const detail::weak_ptr& coro, - caller_type& ca, Handler& handler) - : coro_(coro), - ca_(ca), - handler_(handler), - ec_(0) - { - } - - /// Construct a yield context from another yield context type. - /** - * Requires that OtherHandler be convertible to Handler. - */ - template - basic_yield_context(const basic_yield_context& other) - : coro_(other.coro_), - ca_(other.ca_), - handler_(other.handler_), - ec_(other.ec_) - { - } - - /// Return a yield context that sets the specified error_code. - /** - * By default, when a yield context is used with an asynchronous operation, a - * non-success error_code is converted to system_error and thrown. This - * operator may be used to specify an error_code object that should instead be - * set with the asynchronous operation's result. For example: - * - * @code template - * void my_coroutine(basic_yield_context yield) - * { - * ... - * std::size_t n = my_socket.async_read_some(buffer, yield[ec]); - * if (ec) - * { - * // An error occurred. - * } - * ... - * } @endcode - */ - basic_yield_context operator[](asio::error_code& ec) const - { - basic_yield_context tmp(*this); - tmp.ec_ = &ec; - return tmp; - } - -#if defined(GENERATING_DOCUMENTATION) -private: -#endif // defined(GENERATING_DOCUMENTATION) - detail::weak_ptr coro_; - caller_type& ca_; - Handler handler_; - asio::error_code* ec_; -}; - -#if defined(GENERATING_DOCUMENTATION) -/// Context object that represents the currently executing coroutine. -typedef basic_yield_context yield_context; -#else // defined(GENERATING_DOCUMENTATION) -typedef basic_yield_context< - executor_binder > yield_context; -#endif // defined(GENERATING_DOCUMENTATION) - -/** - * @defgroup spawn asio::spawn - * - * @brief Start a new stackful coroutine. - * - * The spawn() function is a high-level wrapper over the Boost.Coroutine - * library. This function enables programs to implement asynchronous logic in a - * synchronous manner, as illustrated by the following example: - * - * @code asio::spawn(my_strand, do_echo); - * - * // ... - * - * void do_echo(asio::yield_context yield) - * { - * try - * { - * char data[128]; - * for (;;) - * { - * std::size_t length = - * my_socket.async_read_some( - * asio::buffer(data), yield); - * - * asio::async_write(my_socket, - * asio::buffer(data, length), yield); - * } - * } - * catch (std::exception& e) - * { - * // ... - * } - * } @endcode - */ -/*@{*/ - -/// Start a new stackful coroutine, calling the specified handler when it -/// completes. -/** - * This function is used to launch a new coroutine. - * - * @param function The coroutine function. The function must have the signature: - * @code void function(basic_yield_context yield); @endcode - * - * @param attributes Boost.Coroutine attributes used to customise the coroutine. - */ -template -void spawn(ASIO_MOVE_ARG(Function) function, - const boost::coroutines::attributes& attributes - = boost::coroutines::attributes()); - -/// Start a new stackful coroutine, calling the specified handler when it -/// completes. -/** - * This function is used to launch a new coroutine. - * - * @param handler A handler to be called when the coroutine exits. More - * importantly, the handler provides an execution context (via the the handler - * invocation hook) for the coroutine. The handler must have the signature: - * @code void handler(); @endcode - * - * @param function The coroutine function. The function must have the signature: - * @code void function(basic_yield_context yield); @endcode - * - * @param attributes Boost.Coroutine attributes used to customise the coroutine. - */ -template -void spawn(ASIO_MOVE_ARG(Handler) handler, - ASIO_MOVE_ARG(Function) function, - const boost::coroutines::attributes& attributes - = boost::coroutines::attributes(), - typename enable_if::type>::value && - !is_convertible::value>::type* = 0); - -/// Start a new stackful coroutine, inheriting the execution context of another. -/** - * This function is used to launch a new coroutine. - * - * @param ctx Identifies the current coroutine as a parent of the new - * coroutine. This specifies that the new coroutine should inherit the - * execution context of the parent. For example, if the parent coroutine is - * executing in a particular strand, then the new coroutine will execute in the - * same strand. - * - * @param function The coroutine function. The function must have the signature: - * @code void function(basic_yield_context yield); @endcode - * - * @param attributes Boost.Coroutine attributes used to customise the coroutine. - */ -template -void spawn(basic_yield_context ctx, - ASIO_MOVE_ARG(Function) function, - const boost::coroutines::attributes& attributes - = boost::coroutines::attributes()); - -/// Start a new stackful coroutine that executes on a given executor. -/** - * This function is used to launch a new coroutine. - * - * @param ex Identifies the executor that will run the coroutine. The new - * coroutine is implicitly given its own strand within this executor. - * - * @param function The coroutine function. The function must have the signature: - * @code void function(yield_context yield); @endcode - * - * @param attributes Boost.Coroutine attributes used to customise the coroutine. - */ -template -void spawn(const Executor& ex, - ASIO_MOVE_ARG(Function) function, - const boost::coroutines::attributes& attributes - = boost::coroutines::attributes(), - typename enable_if::value>::type* = 0); - -/// Start a new stackful coroutine that executes on a given strand. -/** - * This function is used to launch a new coroutine. - * - * @param ex Identifies the strand that will run the coroutine. - * - * @param function The coroutine function. The function must have the signature: - * @code void function(yield_context yield); @endcode - * - * @param attributes Boost.Coroutine attributes used to customise the coroutine. - */ -template -void spawn(const strand& ex, - ASIO_MOVE_ARG(Function) function, - const boost::coroutines::attributes& attributes - = boost::coroutines::attributes()); - -/// Start a new stackful coroutine that executes in the context of a strand. -/** - * This function is used to launch a new coroutine. - * - * @param s Identifies a strand. By starting multiple coroutines on the same - * strand, the implementation ensures that none of those coroutines can execute - * simultaneously. - * - * @param function The coroutine function. The function must have the signature: - * @code void function(yield_context yield); @endcode - * - * @param attributes Boost.Coroutine attributes used to customise the coroutine. - */ -template -void spawn(const asio::io_context::strand& s, - ASIO_MOVE_ARG(Function) function, - const boost::coroutines::attributes& attributes - = boost::coroutines::attributes()); - -/// Start a new stackful coroutine that executes on a given execution context. -/** - * This function is used to launch a new coroutine. - * - * @param ctx Identifies the execution context that will run the coroutine. The - * new coroutine is implicitly given its own strand within this execution - * context. - * - * @param function The coroutine function. The function must have the signature: - * @code void function(yield_context yield); @endcode - * - * @param attributes Boost.Coroutine attributes used to customise the coroutine. - */ -template -void spawn(ExecutionContext& ctx, - ASIO_MOVE_ARG(Function) function, - const boost::coroutines::attributes& attributes - = boost::coroutines::attributes(), - typename enable_if::value>::type* = 0); - -/*@}*/ - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/impl/spawn.hpp" - -#endif // ASIO_SPAWN_HPP diff --git a/tools/sdk/include/asio/asio/ssl.hpp b/tools/sdk/include/asio/asio/ssl.hpp deleted file mode 100644 index cbad19d81cc..00000000000 --- a/tools/sdk/include/asio/asio/ssl.hpp +++ /dev/null @@ -1,27 +0,0 @@ -// -// ssl.hpp -// ~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SSL_HPP -#define ASIO_SSL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/ssl/context.hpp" -#include "asio/ssl/context_base.hpp" -#include "asio/ssl/error.hpp" -#include "asio/ssl/rfc2818_verification.hpp" -#include "asio/ssl/stream.hpp" -#include "asio/ssl/stream_base.hpp" -#include "asio/ssl/verify_context.hpp" -#include "asio/ssl/verify_mode.hpp" - -#endif // ASIO_SSL_HPP diff --git a/tools/sdk/include/asio/asio/ssl/context.hpp b/tools/sdk/include/asio/asio/ssl/context.hpp deleted file mode 100644 index 9543aab68e5..00000000000 --- a/tools/sdk/include/asio/asio/ssl/context.hpp +++ /dev/null @@ -1,758 +0,0 @@ -// -// ssl/context.hpp -// ~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SSL_CONTEXT_HPP -#define ASIO_SSL_CONTEXT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include -#include "asio/buffer.hpp" -#include "asio/io_context.hpp" -#include "asio/ssl/context_base.hpp" -#include "asio/ssl/detail/openssl_types.hpp" -#include "asio/ssl/detail/openssl_init.hpp" -#include "asio/ssl/detail/password_callback.hpp" -#include "asio/ssl/detail/verify_callback.hpp" -#include "asio/ssl/verify_mode.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ssl { - -class context - : public context_base, - private noncopyable -{ -public: - /// The native handle type of the SSL context. - typedef SSL_CTX* native_handle_type; - - /// Constructor. - ASIO_DECL explicit context(method m); - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a context from another. - /** - * This constructor moves an SSL context from one object to another. - * - * @param other The other context object from which the move will occur. - * - * @note Following the move, the following operations only are valid for the - * moved-from object: - * @li Destruction. - * @li As a target for move-assignment. - */ - ASIO_DECL context(context&& other); - - /// Move-assign a context from another. - /** - * This assignment operator moves an SSL context from one object to another. - * - * @param other The other context object from which the move will occur. - * - * @note Following the move, the following operations only are valid for the - * moved-from object: - * @li Destruction. - * @li As a target for move-assignment. - */ - ASIO_DECL context& operator=(context&& other); -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destructor. - ASIO_DECL ~context(); - - /// Get the underlying implementation in the native type. - /** - * This function may be used to obtain the underlying implementation of the - * context. This is intended to allow access to context functionality that is - * not otherwise provided. - */ - ASIO_DECL native_handle_type native_handle(); - - /// Clear options on the context. - /** - * This function may be used to configure the SSL options used by the context. - * - * @param o A bitmask of options. The available option values are defined in - * the context_base class. The specified options, if currently enabled on the - * context, are cleared. - * - * @throws asio::system_error Thrown on failure. - * - * @note Calls @c SSL_CTX_clear_options. - */ - ASIO_DECL void clear_options(options o); - - /// Clear options on the context. - /** - * This function may be used to configure the SSL options used by the context. - * - * @param o A bitmask of options. The available option values are defined in - * the context_base class. The specified options, if currently enabled on the - * context, are cleared. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Calls @c SSL_CTX_clear_options. - */ - ASIO_DECL ASIO_SYNC_OP_VOID clear_options(options o, - asio::error_code& ec); - - /// Set options on the context. - /** - * This function may be used to configure the SSL options used by the context. - * - * @param o A bitmask of options. The available option values are defined in - * the context_base class. The options are bitwise-ored with any existing - * value for the options. - * - * @throws asio::system_error Thrown on failure. - * - * @note Calls @c SSL_CTX_set_options. - */ - ASIO_DECL void set_options(options o); - - /// Set options on the context. - /** - * This function may be used to configure the SSL options used by the context. - * - * @param o A bitmask of options. The available option values are defined in - * the context_base class. The options are bitwise-ored with any existing - * value for the options. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Calls @c SSL_CTX_set_options. - */ - ASIO_DECL ASIO_SYNC_OP_VOID set_options(options o, - asio::error_code& ec); - - /// Set the peer verification mode. - /** - * This function may be used to configure the peer verification mode used by - * the context. - * - * @param v A bitmask of peer verification modes. See @ref verify_mode for - * available values. - * - * @throws asio::system_error Thrown on failure. - * - * @note Calls @c SSL_CTX_set_verify. - */ - ASIO_DECL void set_verify_mode(verify_mode v); - - /// Set the peer verification mode. - /** - * This function may be used to configure the peer verification mode used by - * the context. - * - * @param v A bitmask of peer verification modes. See @ref verify_mode for - * available values. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Calls @c SSL_CTX_set_verify. - */ - ASIO_DECL ASIO_SYNC_OP_VOID set_verify_mode( - verify_mode v, asio::error_code& ec); - - /// Set the peer verification depth. - /** - * This function may be used to configure the maximum verification depth - * allowed by the context. - * - * @param depth Maximum depth for the certificate chain verification that - * shall be allowed. - * - * @throws asio::system_error Thrown on failure. - * - * @note Calls @c SSL_CTX_set_verify_depth. - */ - ASIO_DECL void set_verify_depth(int depth); - - /// Set the peer verification depth. - /** - * This function may be used to configure the maximum verification depth - * allowed by the context. - * - * @param depth Maximum depth for the certificate chain verification that - * shall be allowed. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Calls @c SSL_CTX_set_verify_depth. - */ - ASIO_DECL ASIO_SYNC_OP_VOID set_verify_depth( - int depth, asio::error_code& ec); - - /// Set the callback used to verify peer certificates. - /** - * This function is used to specify a callback function that will be called - * by the implementation when it needs to verify a peer certificate. - * - * @param callback The function object to be used for verifying a certificate. - * The function signature of the handler must be: - * @code bool verify_callback( - * bool preverified, // True if the certificate passed pre-verification. - * verify_context& ctx // The peer certificate and other context. - * ); @endcode - * The return value of the callback is true if the certificate has passed - * verification, false otherwise. - * - * @throws asio::system_error Thrown on failure. - * - * @note Calls @c SSL_CTX_set_verify. - */ - template - void set_verify_callback(VerifyCallback callback); - - /// Set the callback used to verify peer certificates. - /** - * This function is used to specify a callback function that will be called - * by the implementation when it needs to verify a peer certificate. - * - * @param callback The function object to be used for verifying a certificate. - * The function signature of the handler must be: - * @code bool verify_callback( - * bool preverified, // True if the certificate passed pre-verification. - * verify_context& ctx // The peer certificate and other context. - * ); @endcode - * The return value of the callback is true if the certificate has passed - * verification, false otherwise. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Calls @c SSL_CTX_set_verify. - */ - template - ASIO_SYNC_OP_VOID set_verify_callback(VerifyCallback callback, - asio::error_code& ec); - - /// Load a certification authority file for performing verification. - /** - * This function is used to load one or more trusted certification authorities - * from a file. - * - * @param filename The name of a file containing certification authority - * certificates in PEM format. - * - * @throws asio::system_error Thrown on failure. - * - * @note Calls @c SSL_CTX_load_verify_locations. - */ - ASIO_DECL void load_verify_file(const std::string& filename); - - /// Load a certification authority file for performing verification. - /** - * This function is used to load the certificates for one or more trusted - * certification authorities from a file. - * - * @param filename The name of a file containing certification authority - * certificates in PEM format. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Calls @c SSL_CTX_load_verify_locations. - */ - ASIO_DECL ASIO_SYNC_OP_VOID load_verify_file( - const std::string& filename, asio::error_code& ec); - - /// Add certification authority for performing verification. - /** - * This function is used to add one trusted certification authority - * from a memory buffer. - * - * @param ca The buffer containing the certification authority certificate. - * The certificate must use the PEM format. - * - * @throws asio::system_error Thrown on failure. - * - * @note Calls @c SSL_CTX_get_cert_store and @c X509_STORE_add_cert. - */ - ASIO_DECL void add_certificate_authority(const const_buffer& ca); - - /// Add certification authority for performing verification. - /** - * This function is used to add one trusted certification authority - * from a memory buffer. - * - * @param ca The buffer containing the certification authority certificate. - * The certificate must use the PEM format. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Calls @c SSL_CTX_get_cert_store and @c X509_STORE_add_cert. - */ - ASIO_DECL ASIO_SYNC_OP_VOID add_certificate_authority( - const const_buffer& ca, asio::error_code& ec); - - /// Configures the context to use the default directories for finding - /// certification authority certificates. - /** - * This function specifies that the context should use the default, - * system-dependent directories for locating certification authority - * certificates. - * - * @throws asio::system_error Thrown on failure. - * - * @note Calls @c SSL_CTX_set_default_verify_paths. - */ - ASIO_DECL void set_default_verify_paths(); - - /// Configures the context to use the default directories for finding - /// certification authority certificates. - /** - * This function specifies that the context should use the default, - * system-dependent directories for locating certification authority - * certificates. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Calls @c SSL_CTX_set_default_verify_paths. - */ - ASIO_DECL ASIO_SYNC_OP_VOID set_default_verify_paths( - asio::error_code& ec); - - /// Add a directory containing certificate authority files to be used for - /// performing verification. - /** - * This function is used to specify the name of a directory containing - * certification authority certificates. Each file in the directory must - * contain a single certificate. The files must be named using the subject - * name's hash and an extension of ".0". - * - * @param path The name of a directory containing the certificates. - * - * @throws asio::system_error Thrown on failure. - * - * @note Calls @c SSL_CTX_load_verify_locations. - */ - ASIO_DECL void add_verify_path(const std::string& path); - - /// Add a directory containing certificate authority files to be used for - /// performing verification. - /** - * This function is used to specify the name of a directory containing - * certification authority certificates. Each file in the directory must - * contain a single certificate. The files must be named using the subject - * name's hash and an extension of ".0". - * - * @param path The name of a directory containing the certificates. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Calls @c SSL_CTX_load_verify_locations. - */ - ASIO_DECL ASIO_SYNC_OP_VOID add_verify_path( - const std::string& path, asio::error_code& ec); - - /// Use a certificate from a memory buffer. - /** - * This function is used to load a certificate into the context from a buffer. - * - * @param certificate The buffer containing the certificate. - * - * @param format The certificate format (ASN.1 or PEM). - * - * @throws asio::system_error Thrown on failure. - * - * @note Calls @c SSL_CTX_use_certificate or SSL_CTX_use_certificate_ASN1. - */ - ASIO_DECL void use_certificate( - const const_buffer& certificate, file_format format); - - /// Use a certificate from a memory buffer. - /** - * This function is used to load a certificate into the context from a buffer. - * - * @param certificate The buffer containing the certificate. - * - * @param format The certificate format (ASN.1 or PEM). - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Calls @c SSL_CTX_use_certificate or SSL_CTX_use_certificate_ASN1. - */ - ASIO_DECL ASIO_SYNC_OP_VOID use_certificate( - const const_buffer& certificate, file_format format, - asio::error_code& ec); - - /// Use a certificate from a file. - /** - * This function is used to load a certificate into the context from a file. - * - * @param filename The name of the file containing the certificate. - * - * @param format The file format (ASN.1 or PEM). - * - * @throws asio::system_error Thrown on failure. - * - * @note Calls @c SSL_CTX_use_certificate_file. - */ - ASIO_DECL void use_certificate_file( - const std::string& filename, file_format format); - - /// Use a certificate from a file. - /** - * This function is used to load a certificate into the context from a file. - * - * @param filename The name of the file containing the certificate. - * - * @param format The file format (ASN.1 or PEM). - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Calls @c SSL_CTX_use_certificate_file. - */ - ASIO_DECL ASIO_SYNC_OP_VOID use_certificate_file( - const std::string& filename, file_format format, - asio::error_code& ec); - - /// Use a certificate chain from a memory buffer. - /** - * This function is used to load a certificate chain into the context from a - * buffer. - * - * @param chain The buffer containing the certificate chain. The certificate - * chain must use the PEM format. - * - * @throws asio::system_error Thrown on failure. - * - * @note Calls @c SSL_CTX_use_certificate and SSL_CTX_add_extra_chain_cert. - */ - ASIO_DECL void use_certificate_chain(const const_buffer& chain); - - /// Use a certificate chain from a memory buffer. - /** - * This function is used to load a certificate chain into the context from a - * buffer. - * - * @param chain The buffer containing the certificate chain. The certificate - * chain must use the PEM format. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Calls @c SSL_CTX_use_certificate and SSL_CTX_add_extra_chain_cert. - */ - ASIO_DECL ASIO_SYNC_OP_VOID use_certificate_chain( - const const_buffer& chain, asio::error_code& ec); - - /// Use a certificate chain from a file. - /** - * This function is used to load a certificate chain into the context from a - * file. - * - * @param filename The name of the file containing the certificate. The file - * must use the PEM format. - * - * @throws asio::system_error Thrown on failure. - * - * @note Calls @c SSL_CTX_use_certificate_chain_file. - */ - ASIO_DECL void use_certificate_chain_file(const std::string& filename); - - /// Use a certificate chain from a file. - /** - * This function is used to load a certificate chain into the context from a - * file. - * - * @param filename The name of the file containing the certificate. The file - * must use the PEM format. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Calls @c SSL_CTX_use_certificate_chain_file. - */ - ASIO_DECL ASIO_SYNC_OP_VOID use_certificate_chain_file( - const std::string& filename, asio::error_code& ec); - - /// Use a private key from a memory buffer. - /** - * This function is used to load a private key into the context from a buffer. - * - * @param private_key The buffer containing the private key. - * - * @param format The private key format (ASN.1 or PEM). - * - * @throws asio::system_error Thrown on failure. - * - * @note Calls @c SSL_CTX_use_PrivateKey or SSL_CTX_use_PrivateKey_ASN1. - */ - ASIO_DECL void use_private_key( - const const_buffer& private_key, file_format format); - - /// Use a private key from a memory buffer. - /** - * This function is used to load a private key into the context from a buffer. - * - * @param private_key The buffer containing the private key. - * - * @param format The private key format (ASN.1 or PEM). - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Calls @c SSL_CTX_use_PrivateKey or SSL_CTX_use_PrivateKey_ASN1. - */ - ASIO_DECL ASIO_SYNC_OP_VOID use_private_key( - const const_buffer& private_key, file_format format, - asio::error_code& ec); - - /// Use a private key from a file. - /** - * This function is used to load a private key into the context from a file. - * - * @param filename The name of the file containing the private key. - * - * @param format The file format (ASN.1 or PEM). - * - * @throws asio::system_error Thrown on failure. - * - * @note Calls @c SSL_CTX_use_PrivateKey_file. - */ - ASIO_DECL void use_private_key_file( - const std::string& filename, file_format format); - - /// Use a private key from a file. - /** - * This function is used to load a private key into the context from a file. - * - * @param filename The name of the file containing the private key. - * - * @param format The file format (ASN.1 or PEM). - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Calls @c SSL_CTX_use_PrivateKey_file. - */ - ASIO_DECL ASIO_SYNC_OP_VOID use_private_key_file( - const std::string& filename, file_format format, - asio::error_code& ec); - - /// Use an RSA private key from a memory buffer. - /** - * This function is used to load an RSA private key into the context from a - * buffer. - * - * @param private_key The buffer containing the RSA private key. - * - * @param format The private key format (ASN.1 or PEM). - * - * @throws asio::system_error Thrown on failure. - * - * @note Calls @c SSL_CTX_use_RSAPrivateKey or SSL_CTX_use_RSAPrivateKey_ASN1. - */ - ASIO_DECL void use_rsa_private_key( - const const_buffer& private_key, file_format format); - - /// Use an RSA private key from a memory buffer. - /** - * This function is used to load an RSA private key into the context from a - * buffer. - * - * @param private_key The buffer containing the RSA private key. - * - * @param format The private key format (ASN.1 or PEM). - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Calls @c SSL_CTX_use_RSAPrivateKey or SSL_CTX_use_RSAPrivateKey_ASN1. - */ - ASIO_DECL ASIO_SYNC_OP_VOID use_rsa_private_key( - const const_buffer& private_key, file_format format, - asio::error_code& ec); - - /// Use an RSA private key from a file. - /** - * This function is used to load an RSA private key into the context from a - * file. - * - * @param filename The name of the file containing the RSA private key. - * - * @param format The file format (ASN.1 or PEM). - * - * @throws asio::system_error Thrown on failure. - * - * @note Calls @c SSL_CTX_use_RSAPrivateKey_file. - */ - ASIO_DECL void use_rsa_private_key_file( - const std::string& filename, file_format format); - - /// Use an RSA private key from a file. - /** - * This function is used to load an RSA private key into the context from a - * file. - * - * @param filename The name of the file containing the RSA private key. - * - * @param format The file format (ASN.1 or PEM). - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Calls @c SSL_CTX_use_RSAPrivateKey_file. - */ - ASIO_DECL ASIO_SYNC_OP_VOID use_rsa_private_key_file( - const std::string& filename, file_format format, - asio::error_code& ec); - - /// Use the specified memory buffer to obtain the temporary Diffie-Hellman - /// parameters. - /** - * This function is used to load Diffie-Hellman parameters into the context - * from a buffer. - * - * @param dh The memory buffer containing the Diffie-Hellman parameters. The - * buffer must use the PEM format. - * - * @throws asio::system_error Thrown on failure. - * - * @note Calls @c SSL_CTX_set_tmp_dh. - */ - ASIO_DECL void use_tmp_dh(const const_buffer& dh); - - /// Use the specified memory buffer to obtain the temporary Diffie-Hellman - /// parameters. - /** - * This function is used to load Diffie-Hellman parameters into the context - * from a buffer. - * - * @param dh The memory buffer containing the Diffie-Hellman parameters. The - * buffer must use the PEM format. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Calls @c SSL_CTX_set_tmp_dh. - */ - ASIO_DECL ASIO_SYNC_OP_VOID use_tmp_dh( - const const_buffer& dh, asio::error_code& ec); - - /// Use the specified file to obtain the temporary Diffie-Hellman parameters. - /** - * This function is used to load Diffie-Hellman parameters into the context - * from a file. - * - * @param filename The name of the file containing the Diffie-Hellman - * parameters. The file must use the PEM format. - * - * @throws asio::system_error Thrown on failure. - * - * @note Calls @c SSL_CTX_set_tmp_dh. - */ - ASIO_DECL void use_tmp_dh_file(const std::string& filename); - - /// Use the specified file to obtain the temporary Diffie-Hellman parameters. - /** - * This function is used to load Diffie-Hellman parameters into the context - * from a file. - * - * @param filename The name of the file containing the Diffie-Hellman - * parameters. The file must use the PEM format. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Calls @c SSL_CTX_set_tmp_dh. - */ - ASIO_DECL ASIO_SYNC_OP_VOID use_tmp_dh_file( - const std::string& filename, asio::error_code& ec); - - /// Set the password callback. - /** - * This function is used to specify a callback function to obtain password - * information about an encrypted key in PEM format. - * - * @param callback The function object to be used for obtaining the password. - * The function signature of the handler must be: - * @code std::string password_callback( - * std::size_t max_length, // The maximum size for a password. - * password_purpose purpose // Whether password is for reading or writing. - * ); @endcode - * The return value of the callback is a string containing the password. - * - * @throws asio::system_error Thrown on failure. - * - * @note Calls @c SSL_CTX_set_default_passwd_cb. - */ - template - void set_password_callback(PasswordCallback callback); - - /// Set the password callback. - /** - * This function is used to specify a callback function to obtain password - * information about an encrypted key in PEM format. - * - * @param callback The function object to be used for obtaining the password. - * The function signature of the handler must be: - * @code std::string password_callback( - * std::size_t max_length, // The maximum size for a password. - * password_purpose purpose // Whether password is for reading or writing. - * ); @endcode - * The return value of the callback is a string containing the password. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Calls @c SSL_CTX_set_default_passwd_cb. - */ - template - ASIO_SYNC_OP_VOID set_password_callback(PasswordCallback callback, - asio::error_code& ec); - -private: - struct bio_cleanup; - struct x509_cleanup; - struct evp_pkey_cleanup; - struct rsa_cleanup; - struct dh_cleanup; - - // Helper function used to set a peer certificate verification callback. - ASIO_DECL ASIO_SYNC_OP_VOID do_set_verify_callback( - detail::verify_callback_base* callback, asio::error_code& ec); - - // Callback used when the SSL implementation wants to verify a certificate. - ASIO_DECL static int verify_callback_function( - int preverified, X509_STORE_CTX* ctx); - - // Helper function used to set a password callback. - ASIO_DECL ASIO_SYNC_OP_VOID do_set_password_callback( - detail::password_callback_base* callback, asio::error_code& ec); - - // Callback used when the SSL implementation wants a password. - ASIO_DECL static int password_callback_function( - char* buf, int size, int purpose, void* data); - - // Helper function to set the temporary Diffie-Hellman parameters from a BIO. - ASIO_DECL ASIO_SYNC_OP_VOID do_use_tmp_dh( - BIO* bio, asio::error_code& ec); - - // Helper function to make a BIO from a memory buffer. - ASIO_DECL BIO* make_buffer_bio(const const_buffer& b); - - // The underlying native implementation. - native_handle_type handle_; - - // Ensure openssl is initialised. - asio::ssl::detail::openssl_init<> init_; -}; - -} // namespace ssl -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/ssl/impl/context.hpp" -#if defined(ASIO_HEADER_ONLY) -# include "asio/ssl/impl/context.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_SSL_CONTEXT_HPP diff --git a/tools/sdk/include/asio/asio/ssl/context_base.hpp b/tools/sdk/include/asio/asio/ssl/context_base.hpp deleted file mode 100644 index 56c76936e0c..00000000000 --- a/tools/sdk/include/asio/asio/ssl/context_base.hpp +++ /dev/null @@ -1,192 +0,0 @@ -// -// ssl/context_base.hpp -// ~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SSL_CONTEXT_BASE_HPP -#define ASIO_SSL_CONTEXT_BASE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/ssl/detail/openssl_types.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ssl { - -/// The context_base class is used as a base for the basic_context class -/// template so that we have a common place to define various enums. -class context_base -{ -public: - /// Different methods supported by a context. - enum method - { - /// Generic SSL version 2. - sslv2, - - /// SSL version 2 client. - sslv2_client, - - /// SSL version 2 server. - sslv2_server, - - /// Generic SSL version 3. - sslv3, - - /// SSL version 3 client. - sslv3_client, - - /// SSL version 3 server. - sslv3_server, - - /// Generic TLS version 1. - tlsv1, - - /// TLS version 1 client. - tlsv1_client, - - /// TLS version 1 server. - tlsv1_server, - - /// Generic SSL/TLS. - sslv23, - - /// SSL/TLS client. - sslv23_client, - - /// SSL/TLS server. - sslv23_server, - - /// Generic TLS version 1.1. - tlsv11, - - /// TLS version 1.1 client. - tlsv11_client, - - /// TLS version 1.1 server. - tlsv11_server, - - /// Generic TLS version 1.2. - tlsv12, - - /// TLS version 1.2 client. - tlsv12_client, - - /// TLS version 1.2 server. - tlsv12_server, - - /// Generic TLS. - tls, - - /// TLS client. - tls_client, - - /// TLS server. - tls_server - }; - - /// Bitmask type for SSL options. - typedef long options; - -#if defined(GENERATING_DOCUMENTATION) - /// Implement various bug workarounds. - static const long default_workarounds = implementation_defined; - - /// Always create a new key when using tmp_dh parameters. - static const long single_dh_use = implementation_defined; - - /// Disable SSL v2. - static const long no_sslv2 = implementation_defined; - - /// Disable SSL v3. - static const long no_sslv3 = implementation_defined; - - /// Disable TLS v1. - static const long no_tlsv1 = implementation_defined; - - /// Disable TLS v1.1. - static const long no_tlsv1_1 = implementation_defined; - - /// Disable TLS v1.2. - static const long no_tlsv1_2 = implementation_defined; - - /// Disable compression. Compression is disabled by default. - static const long no_compression = implementation_defined; -#else - ASIO_STATIC_CONSTANT(long, default_workarounds = SSL_OP_ALL); - ASIO_STATIC_CONSTANT(long, single_dh_use = SSL_OP_SINGLE_DH_USE); - ASIO_STATIC_CONSTANT(long, no_sslv2 = SSL_OP_NO_SSLv2); - ASIO_STATIC_CONSTANT(long, no_sslv3 = SSL_OP_NO_SSLv3); - ASIO_STATIC_CONSTANT(long, no_tlsv1 = SSL_OP_NO_TLSv1); -# if defined(SSL_OP_NO_TLSv1_1) - ASIO_STATIC_CONSTANT(long, no_tlsv1_1 = SSL_OP_NO_TLSv1_1); -# else // defined(SSL_OP_NO_TLSv1_1) - ASIO_STATIC_CONSTANT(long, no_tlsv1_1 = 0x10000000L); -# endif // defined(SSL_OP_NO_TLSv1_1) -# if defined(SSL_OP_NO_TLSv1_2) - ASIO_STATIC_CONSTANT(long, no_tlsv1_2 = SSL_OP_NO_TLSv1_2); -# else // defined(SSL_OP_NO_TLSv1_2) - ASIO_STATIC_CONSTANT(long, no_tlsv1_2 = 0x08000000L); -# endif // defined(SSL_OP_NO_TLSv1_2) -# if defined(SSL_OP_NO_COMPRESSION) - ASIO_STATIC_CONSTANT(long, no_compression = SSL_OP_NO_COMPRESSION); -# else // defined(SSL_OP_NO_COMPRESSION) - ASIO_STATIC_CONSTANT(long, no_compression = 0x20000L); -# endif // defined(SSL_OP_NO_COMPRESSION) -#endif - - /// File format types. - enum file_format - { - /// ASN.1 file. - asn1, - - /// PEM file. - pem - }; - -#if !defined(GENERATING_DOCUMENTATION) - // The following types and constants are preserved for backward compatibility. - // New programs should use the equivalents of the same names that are defined - // in the asio::ssl namespace. - typedef int verify_mode; - ASIO_STATIC_CONSTANT(int, verify_none = SSL_VERIFY_NONE); - ASIO_STATIC_CONSTANT(int, verify_peer = SSL_VERIFY_PEER); - ASIO_STATIC_CONSTANT(int, - verify_fail_if_no_peer_cert = SSL_VERIFY_FAIL_IF_NO_PEER_CERT); - ASIO_STATIC_CONSTANT(int, verify_client_once = SSL_VERIFY_CLIENT_ONCE); -#endif - - /// Purpose of PEM password. - enum password_purpose - { - /// The password is needed for reading/decryption. - for_reading, - - /// The password is needed for writing/encryption. - for_writing - }; - -protected: - /// Protected destructor to prevent deletion through this type. - ~context_base() - { - } -}; - -} // namespace ssl -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_SSL_CONTEXT_BASE_HPP diff --git a/tools/sdk/include/asio/asio/ssl/detail/buffered_handshake_op.hpp b/tools/sdk/include/asio/asio/ssl/detail/buffered_handshake_op.hpp deleted file mode 100644 index 38a03fcce97..00000000000 --- a/tools/sdk/include/asio/asio/ssl/detail/buffered_handshake_op.hpp +++ /dev/null @@ -1,114 +0,0 @@ -// -// ssl/detail/buffered_handshake_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SSL_DETAIL_BUFFERED_HANDSHAKE_OP_HPP -#define ASIO_SSL_DETAIL_BUFFERED_HANDSHAKE_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include "asio/ssl/detail/engine.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ssl { -namespace detail { - -template -class buffered_handshake_op -{ -public: - buffered_handshake_op(stream_base::handshake_type type, - const ConstBufferSequence& buffers) - : type_(type), - buffers_(buffers), - total_buffer_size_(asio::buffer_size(buffers_)) - { - } - - engine::want operator()(engine& eng, - asio::error_code& ec, - std::size_t& bytes_transferred) const - { - return this->process(eng, ec, bytes_transferred, - asio::buffer_sequence_begin(buffers_), - asio::buffer_sequence_end(buffers_)); - } - - template - void call_handler(Handler& handler, - const asio::error_code& ec, - const std::size_t& bytes_transferred) const - { - handler(ec, bytes_transferred); - } - -private: - template - engine::want process(engine& eng, - asio::error_code& ec, - std::size_t& bytes_transferred, - Iterator begin, Iterator end) const - { - Iterator iter = begin; - std::size_t accumulated_size = 0; - - for (;;) - { - engine::want want = eng.handshake(type_, ec); - if (want != engine::want_input_and_retry - || bytes_transferred == total_buffer_size_) - return want; - - // Find the next buffer piece to be fed to the engine. - while (iter != end) - { - const_buffer buffer(*iter); - - // Skip over any buffers which have already been consumed by the engine. - if (bytes_transferred >= accumulated_size + buffer.size()) - { - accumulated_size += buffer.size(); - ++iter; - continue; - } - - // The current buffer may have been partially consumed by the engine on - // a previous iteration. If so, adjust the buffer to point to the - // unused portion. - if (bytes_transferred > accumulated_size) - buffer = buffer + (bytes_transferred - accumulated_size); - - // Pass the buffer to the engine, and update the bytes transferred to - // reflect the total number of bytes consumed so far. - bytes_transferred += buffer.size(); - buffer = eng.put_input(buffer); - bytes_transferred -= buffer.size(); - break; - } - } - } - - stream_base::handshake_type type_; - ConstBufferSequence buffers_; - std::size_t total_buffer_size_; -}; - -} // namespace detail -} // namespace ssl -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_SSL_DETAIL_BUFFERED_HANDSHAKE_OP_HPP diff --git a/tools/sdk/include/asio/asio/ssl/detail/engine.hpp b/tools/sdk/include/asio/asio/ssl/detail/engine.hpp deleted file mode 100644 index 2f033d66cf1..00000000000 --- a/tools/sdk/include/asio/asio/ssl/detail/engine.hpp +++ /dev/null @@ -1,160 +0,0 @@ -// -// ssl/detail/engine.hpp -// ~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SSL_DETAIL_ENGINE_HPP -#define ASIO_SSL_DETAIL_ENGINE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include "asio/buffer.hpp" -#include "asio/detail/static_mutex.hpp" -#include "asio/ssl/detail/openssl_types.hpp" -#include "asio/ssl/detail/verify_callback.hpp" -#include "asio/ssl/stream_base.hpp" -#include "asio/ssl/verify_mode.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ssl { -namespace detail { - -class engine -{ -public: - enum want - { - // Returned by functions to indicate that the engine wants input. The input - // buffer should be updated to point to the data. The engine then needs to - // be called again to retry the operation. - want_input_and_retry = -2, - - // Returned by functions to indicate that the engine wants to write output. - // The output buffer points to the data to be written. The engine then - // needs to be called again to retry the operation. - want_output_and_retry = -1, - - // Returned by functions to indicate that the engine doesn't need input or - // output. - want_nothing = 0, - - // Returned by functions to indicate that the engine wants to write output. - // The output buffer points to the data to be written. After that the - // operation is complete, and the engine does not need to be called again. - want_output = 1 - }; - - // Construct a new engine for the specified context. - ASIO_DECL explicit engine(SSL_CTX* context); - - // Destructor. - ASIO_DECL ~engine(); - - // Get the underlying implementation in the native type. - ASIO_DECL SSL* native_handle(); - - // Set the peer verification mode. - ASIO_DECL asio::error_code set_verify_mode( - verify_mode v, asio::error_code& ec); - - // Set the peer verification depth. - ASIO_DECL asio::error_code set_verify_depth( - int depth, asio::error_code& ec); - - // Set a peer certificate verification callback. - ASIO_DECL asio::error_code set_verify_callback( - verify_callback_base* callback, asio::error_code& ec); - - // Perform an SSL handshake using either SSL_connect (client-side) or - // SSL_accept (server-side). - ASIO_DECL want handshake( - stream_base::handshake_type type, asio::error_code& ec); - - // Perform a graceful shutdown of the SSL session. - ASIO_DECL want shutdown(asio::error_code& ec); - - // Write bytes to the SSL session. - ASIO_DECL want write(const asio::const_buffer& data, - asio::error_code& ec, std::size_t& bytes_transferred); - - // Read bytes from the SSL session. - ASIO_DECL want read(const asio::mutable_buffer& data, - asio::error_code& ec, std::size_t& bytes_transferred); - - // Get output data to be written to the transport. - ASIO_DECL asio::mutable_buffer get_output( - const asio::mutable_buffer& data); - - // Put input data that was read from the transport. - ASIO_DECL asio::const_buffer put_input( - const asio::const_buffer& data); - - // Map an error::eof code returned by the underlying transport according to - // the type and state of the SSL session. Returns a const reference to the - // error code object, suitable for passing to a completion handler. - ASIO_DECL const asio::error_code& map_error_code( - asio::error_code& ec) const; - -private: - // Disallow copying and assignment. - engine(const engine&); - engine& operator=(const engine&); - - // Callback used when the SSL implementation wants to verify a certificate. - ASIO_DECL static int verify_callback_function( - int preverified, X509_STORE_CTX* ctx); - -#if (OPENSSL_VERSION_NUMBER < 0x10000000L) - // The SSL_accept function may not be thread safe. This mutex is used to - // protect all calls to the SSL_accept function. - ASIO_DECL static asio::detail::static_mutex& accept_mutex(); -#endif // (OPENSSL_VERSION_NUMBER < 0x10000000L) - - // Perform one operation. Returns >= 0 on success or error, want_read if the - // operation needs more input, or want_write if it needs to write some output - // before the operation can complete. - ASIO_DECL want perform(int (engine::* op)(void*, std::size_t), - void* data, std::size_t length, asio::error_code& ec, - std::size_t* bytes_transferred); - - // Adapt the SSL_accept function to the signature needed for perform(). - ASIO_DECL int do_accept(void*, std::size_t); - - // Adapt the SSL_connect function to the signature needed for perform(). - ASIO_DECL int do_connect(void*, std::size_t); - - // Adapt the SSL_shutdown function to the signature needed for perform(). - ASIO_DECL int do_shutdown(void*, std::size_t); - - // Adapt the SSL_read function to the signature needed for perform(). - ASIO_DECL int do_read(void* data, std::size_t length); - - // Adapt the SSL_write function to the signature needed for perform(). - ASIO_DECL int do_write(void* data, std::size_t length); - - SSL* ssl_; - BIO* ext_bio_; -}; - -} // namespace detail -} // namespace ssl -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/ssl/detail/impl/engine.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_SSL_DETAIL_ENGINE_HPP diff --git a/tools/sdk/include/asio/asio/ssl/detail/handshake_op.hpp b/tools/sdk/include/asio/asio/ssl/detail/handshake_op.hpp deleted file mode 100644 index f782023a1b0..00000000000 --- a/tools/sdk/include/asio/asio/ssl/detail/handshake_op.hpp +++ /dev/null @@ -1,62 +0,0 @@ -// -// ssl/detail/handshake_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SSL_DETAIL_HANDSHAKE_OP_HPP -#define ASIO_SSL_DETAIL_HANDSHAKE_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include "asio/ssl/detail/engine.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ssl { -namespace detail { - -class handshake_op -{ -public: - handshake_op(stream_base::handshake_type type) - : type_(type) - { - } - - engine::want operator()(engine& eng, - asio::error_code& ec, - std::size_t& bytes_transferred) const - { - bytes_transferred = 0; - return eng.handshake(type_, ec); - } - - template - void call_handler(Handler& handler, - const asio::error_code& ec, - const std::size_t&) const - { - handler(ec); - } - -private: - stream_base::handshake_type type_; -}; - -} // namespace detail -} // namespace ssl -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_SSL_DETAIL_HANDSHAKE_OP_HPP diff --git a/tools/sdk/include/asio/asio/ssl/detail/io.hpp b/tools/sdk/include/asio/asio/ssl/detail/io.hpp deleted file mode 100644 index 0b0e51a2044..00000000000 --- a/tools/sdk/include/asio/asio/ssl/detail/io.hpp +++ /dev/null @@ -1,372 +0,0 @@ -// -// ssl/detail/io.hpp -// ~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SSL_DETAIL_IO_HPP -#define ASIO_SSL_DETAIL_IO_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include "asio/ssl/detail/engine.hpp" -#include "asio/ssl/detail/stream_core.hpp" -#include "asio/write.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ssl { -namespace detail { - -template -std::size_t io(Stream& next_layer, stream_core& core, - const Operation& op, asio::error_code& ec) -{ - std::size_t bytes_transferred = 0; - do switch (op(core.engine_, ec, bytes_transferred)) - { - case engine::want_input_and_retry: - - // If the input buffer is empty then we need to read some more data from - // the underlying transport. - if (core.input_.size() == 0) - core.input_ = asio::buffer(core.input_buffer_, - next_layer.read_some(core.input_buffer_, ec)); - - // Pass the new input data to the engine. - core.input_ = core.engine_.put_input(core.input_); - - // Try the operation again. - continue; - - case engine::want_output_and_retry: - - // Get output data from the engine and write it to the underlying - // transport. - asio::write(next_layer, - core.engine_.get_output(core.output_buffer_), ec); - - // Try the operation again. - continue; - - case engine::want_output: - - // Get output data from the engine and write it to the underlying - // transport. - asio::write(next_layer, - core.engine_.get_output(core.output_buffer_), ec); - - // Operation is complete. Return result to caller. - core.engine_.map_error_code(ec); - return bytes_transferred; - - default: - - // Operation is complete. Return result to caller. - core.engine_.map_error_code(ec); - return bytes_transferred; - - } while (!ec); - - // Operation failed. Return result to caller. - core.engine_.map_error_code(ec); - return 0; -} - -template -class io_op -{ -public: - io_op(Stream& next_layer, stream_core& core, - const Operation& op, Handler& handler) - : next_layer_(next_layer), - core_(core), - op_(op), - start_(0), - want_(engine::want_nothing), - bytes_transferred_(0), - handler_(ASIO_MOVE_CAST(Handler)(handler)) - { - } - -#if defined(ASIO_HAS_MOVE) - io_op(const io_op& other) - : next_layer_(other.next_layer_), - core_(other.core_), - op_(other.op_), - start_(other.start_), - want_(other.want_), - ec_(other.ec_), - bytes_transferred_(other.bytes_transferred_), - handler_(other.handler_) - { - } - - io_op(io_op&& other) - : next_layer_(other.next_layer_), - core_(other.core_), - op_(ASIO_MOVE_CAST(Operation)(other.op_)), - start_(other.start_), - want_(other.want_), - ec_(other.ec_), - bytes_transferred_(other.bytes_transferred_), - handler_(ASIO_MOVE_CAST(Handler)(other.handler_)) - { - } -#endif // defined(ASIO_HAS_MOVE) - - void operator()(asio::error_code ec, - std::size_t bytes_transferred = ~std::size_t(0), int start = 0) - { - switch (start_ = start) - { - case 1: // Called after at least one async operation. - do - { - switch (want_ = op_(core_.engine_, ec_, bytes_transferred_)) - { - case engine::want_input_and_retry: - - // If the input buffer already has data in it we can pass it to the - // engine and then retry the operation immediately. - if (core_.input_.size() != 0) - { - core_.input_ = core_.engine_.put_input(core_.input_); - continue; - } - - // The engine wants more data to be read from input. However, we - // cannot allow more than one read operation at a time on the - // underlying transport. The pending_read_ timer's expiry is set to - // pos_infin if a read is in progress, and neg_infin otherwise. - if (core_.expiry(core_.pending_read_) == core_.neg_infin()) - { - // Prevent other read operations from being started. - core_.pending_read_.expires_at(core_.pos_infin()); - - // Start reading some data from the underlying transport. - next_layer_.async_read_some( - asio::buffer(core_.input_buffer_), - ASIO_MOVE_CAST(io_op)(*this)); - } - else - { - // Wait until the current read operation completes. - core_.pending_read_.async_wait(ASIO_MOVE_CAST(io_op)(*this)); - } - - // Yield control until asynchronous operation completes. Control - // resumes at the "default:" label below. - return; - - case engine::want_output_and_retry: - case engine::want_output: - - // The engine wants some data to be written to the output. However, we - // cannot allow more than one write operation at a time on the - // underlying transport. The pending_write_ timer's expiry is set to - // pos_infin if a write is in progress, and neg_infin otherwise. - if (core_.expiry(core_.pending_write_) == core_.neg_infin()) - { - // Prevent other write operations from being started. - core_.pending_write_.expires_at(core_.pos_infin()); - - // Start writing all the data to the underlying transport. - asio::async_write(next_layer_, - core_.engine_.get_output(core_.output_buffer_), - ASIO_MOVE_CAST(io_op)(*this)); - } - else - { - // Wait until the current write operation completes. - core_.pending_write_.async_wait(ASIO_MOVE_CAST(io_op)(*this)); - } - - // Yield control until asynchronous operation completes. Control - // resumes at the "default:" label below. - return; - - default: - - // The SSL operation is done and we can invoke the handler, but we - // have to keep in mind that this function might be being called from - // the async operation's initiating function. In this case we're not - // allowed to call the handler directly. Instead, issue a zero-sized - // read so the handler runs "as-if" posted using io_context::post(). - if (start) - { - next_layer_.async_read_some( - asio::buffer(core_.input_buffer_, 0), - ASIO_MOVE_CAST(io_op)(*this)); - - // Yield control until asynchronous operation completes. Control - // resumes at the "default:" label below. - return; - } - else - { - // Continue on to run handler directly. - break; - } - } - - default: - if (bytes_transferred == ~std::size_t(0)) - bytes_transferred = 0; // Timer cancellation, no data transferred. - else if (!ec_) - ec_ = ec; - - switch (want_) - { - case engine::want_input_and_retry: - - // Add received data to the engine's input. - core_.input_ = asio::buffer( - core_.input_buffer_, bytes_transferred); - core_.input_ = core_.engine_.put_input(core_.input_); - - // Release any waiting read operations. - core_.pending_read_.expires_at(core_.neg_infin()); - - // Try the operation again. - continue; - - case engine::want_output_and_retry: - - // Release any waiting write operations. - core_.pending_write_.expires_at(core_.neg_infin()); - - // Try the operation again. - continue; - - case engine::want_output: - - // Release any waiting write operations. - core_.pending_write_.expires_at(core_.neg_infin()); - - // Fall through to call handler. - - default: - - // Pass the result to the handler. - op_.call_handler(handler_, - core_.engine_.map_error_code(ec_), - ec_ ? 0 : bytes_transferred_); - - // Our work here is done. - return; - } - } while (!ec_); - - // Operation failed. Pass the result to the handler. - op_.call_handler(handler_, core_.engine_.map_error_code(ec_), 0); - } - } - -//private: - Stream& next_layer_; - stream_core& core_; - Operation op_; - int start_; - engine::want want_; - asio::error_code ec_; - std::size_t bytes_transferred_; - Handler handler_; -}; - -template -inline void* asio_handler_allocate(std::size_t size, - io_op* this_handler) -{ - return asio_handler_alloc_helpers::allocate( - size, this_handler->handler_); -} - -template -inline void asio_handler_deallocate(void* pointer, std::size_t size, - io_op* this_handler) -{ - asio_handler_alloc_helpers::deallocate( - pointer, size, this_handler->handler_); -} - -template -inline bool asio_handler_is_continuation( - io_op* this_handler) -{ - return this_handler->start_ == 0 ? true - : asio_handler_cont_helpers::is_continuation(this_handler->handler_); -} - -template -inline void asio_handler_invoke(Function& function, - io_op* this_handler) -{ - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); -} - -template -inline void asio_handler_invoke(const Function& function, - io_op* this_handler) -{ - asio_handler_invoke_helpers::invoke( - function, this_handler->handler_); -} - -template -inline void async_io(Stream& next_layer, stream_core& core, - const Operation& op, Handler& handler) -{ - io_op( - next_layer, core, op, handler)( - asio::error_code(), 0, 1); -} - -} // namespace detail -} // namespace ssl - -template -struct associated_allocator< - ssl::detail::io_op, Allocator> -{ - typedef typename associated_allocator::type type; - - static type get(const ssl::detail::io_op& h, - const Allocator& a = Allocator()) ASIO_NOEXCEPT - { - return associated_allocator::get(h.handler_, a); - } -}; - -template -struct associated_executor< - ssl::detail::io_op, Executor> -{ - typedef typename associated_executor::type type; - - static type get(const ssl::detail::io_op& h, - const Executor& ex = Executor()) ASIO_NOEXCEPT - { - return associated_executor::get(h.handler_, ex); - } -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_SSL_DETAIL_IO_HPP diff --git a/tools/sdk/include/asio/asio/ssl/detail/openssl_init.hpp b/tools/sdk/include/asio/asio/ssl/detail/openssl_init.hpp deleted file mode 100644 index c3e47278fe7..00000000000 --- a/tools/sdk/include/asio/asio/ssl/detail/openssl_init.hpp +++ /dev/null @@ -1,101 +0,0 @@ -// -// ssl/detail/openssl_init.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SSL_DETAIL_OPENSSL_INIT_HPP -#define ASIO_SSL_DETAIL_OPENSSL_INIT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/detail/memory.hpp" -#include "asio/detail/noncopyable.hpp" -#include "asio/ssl/detail/openssl_types.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ssl { -namespace detail { - -class openssl_init_base - : private noncopyable -{ -protected: - // Class that performs the actual initialisation. - class do_init; - - // Helper function to manage a do_init singleton. The static instance of the - // openssl_init object ensures that this function is always called before - // main, and therefore before any other threads can get started. The do_init - // instance must be static in this function to ensure that it gets - // initialised before any other global objects try to use it. - ASIO_DECL static asio::detail::shared_ptr instance(); - -#if !defined(SSL_OP_NO_COMPRESSION) \ - && (OPENSSL_VERSION_NUMBER >= 0x00908000L) - // Get an empty stack of compression methods, to be used when disabling - // compression. - ASIO_DECL static STACK_OF(SSL_COMP)* get_null_compression_methods(); -#endif // !defined(SSL_OP_NO_COMPRESSION) - // && (OPENSSL_VERSION_NUMBER >= 0x00908000L) -}; - -template -class openssl_init : private openssl_init_base -{ -public: - // Constructor. - openssl_init() - : ref_(instance()) - { - using namespace std; // For memmove. - - // Ensure openssl_init::instance_ is linked in. - openssl_init* tmp = &instance_; - memmove(&tmp, &tmp, sizeof(openssl_init*)); - } - - // Destructor. - ~openssl_init() - { - } - -#if !defined(SSL_OP_NO_COMPRESSION) \ - && (OPENSSL_VERSION_NUMBER >= 0x00908000L) - using openssl_init_base::get_null_compression_methods; -#endif // !defined(SSL_OP_NO_COMPRESSION) - // && (OPENSSL_VERSION_NUMBER >= 0x00908000L) - -private: - // Instance to force initialisation of openssl at global scope. - static openssl_init instance_; - - // Reference to singleton do_init object to ensure that openssl does not get - // cleaned up until the last user has finished with it. - asio::detail::shared_ptr ref_; -}; - -template -openssl_init openssl_init::instance_; - -} // namespace detail -} // namespace ssl -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/ssl/detail/impl/openssl_init.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_SSL_DETAIL_OPENSSL_INIT_HPP diff --git a/tools/sdk/include/asio/asio/ssl/detail/openssl_types.hpp b/tools/sdk/include/asio/asio/ssl/detail/openssl_types.hpp deleted file mode 100644 index a044af30d40..00000000000 --- a/tools/sdk/include/asio/asio/ssl/detail/openssl_types.hpp +++ /dev/null @@ -1,30 +0,0 @@ -// -// ssl/detail/openssl_types.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SSL_DETAIL_OPENSSL_TYPES_HPP -#define ASIO_SSL_DETAIL_OPENSSL_TYPES_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/socket_types.hpp" -#include -#include -#if !defined(OPENSSL_NO_ENGINE) -# include -#endif // !defined(OPENSSL_NO_ENGINE) -#include -#include -#include -#include - -#endif // ASIO_SSL_DETAIL_OPENSSL_TYPES_HPP diff --git a/tools/sdk/include/asio/asio/ssl/detail/password_callback.hpp b/tools/sdk/include/asio/asio/ssl/detail/password_callback.hpp deleted file mode 100644 index 9b1dbeeb884..00000000000 --- a/tools/sdk/include/asio/asio/ssl/detail/password_callback.hpp +++ /dev/null @@ -1,66 +0,0 @@ -// -// ssl/detail/password_callback.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SSL_DETAIL_PASSWORD_CALLBACK_HPP -#define ASIO_SSL_DETAIL_PASSWORD_CALLBACK_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include -#include -#include "asio/ssl/context_base.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ssl { -namespace detail { - -class password_callback_base -{ -public: - virtual ~password_callback_base() - { - } - - virtual std::string call(std::size_t size, - context_base::password_purpose purpose) = 0; -}; - -template -class password_callback : public password_callback_base -{ -public: - explicit password_callback(PasswordCallback callback) - : callback_(callback) - { - } - - virtual std::string call(std::size_t size, - context_base::password_purpose purpose) - { - return callback_(size, purpose); - } - -private: - PasswordCallback callback_; -}; - -} // namespace detail -} // namespace ssl -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_SSL_DETAIL_PASSWORD_CALLBACK_HPP diff --git a/tools/sdk/include/asio/asio/ssl/detail/read_op.hpp b/tools/sdk/include/asio/asio/ssl/detail/read_op.hpp deleted file mode 100644 index b0d6de26657..00000000000 --- a/tools/sdk/include/asio/asio/ssl/detail/read_op.hpp +++ /dev/null @@ -1,67 +0,0 @@ -// -// ssl/detail/read_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SSL_DETAIL_READ_OP_HPP -#define ASIO_SSL_DETAIL_READ_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/ssl/detail/engine.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ssl { -namespace detail { - -template -class read_op -{ -public: - read_op(const MutableBufferSequence& buffers) - : buffers_(buffers) - { - } - - engine::want operator()(engine& eng, - asio::error_code& ec, - std::size_t& bytes_transferred) const - { - asio::mutable_buffer buffer = - asio::detail::buffer_sequence_adapter::first(buffers_); - - return eng.read(buffer, ec, bytes_transferred); - } - - template - void call_handler(Handler& handler, - const asio::error_code& ec, - const std::size_t& bytes_transferred) const - { - handler(ec, bytes_transferred); - } - -private: - MutableBufferSequence buffers_; -}; - -} // namespace detail -} // namespace ssl -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_SSL_DETAIL_READ_OP_HPP diff --git a/tools/sdk/include/asio/asio/ssl/detail/shutdown_op.hpp b/tools/sdk/include/asio/asio/ssl/detail/shutdown_op.hpp deleted file mode 100644 index d20b4309ea0..00000000000 --- a/tools/sdk/include/asio/asio/ssl/detail/shutdown_op.hpp +++ /dev/null @@ -1,54 +0,0 @@ -// -// ssl/detail/shutdown_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SSL_DETAIL_SHUTDOWN_OP_HPP -#define ASIO_SSL_DETAIL_SHUTDOWN_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include "asio/ssl/detail/engine.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ssl { -namespace detail { - -class shutdown_op -{ -public: - engine::want operator()(engine& eng, - asio::error_code& ec, - std::size_t& bytes_transferred) const - { - bytes_transferred = 0; - return eng.shutdown(ec); - } - - template - void call_handler(Handler& handler, - const asio::error_code& ec, - const std::size_t&) const - { - handler(ec); - } -}; - -} // namespace detail -} // namespace ssl -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_SSL_DETAIL_SHUTDOWN_OP_HPP diff --git a/tools/sdk/include/asio/asio/ssl/detail/stream_core.hpp b/tools/sdk/include/asio/asio/ssl/detail/stream_core.hpp deleted file mode 100644 index 13fde74bf98..00000000000 --- a/tools/sdk/include/asio/asio/ssl/detail/stream_core.hpp +++ /dev/null @@ -1,134 +0,0 @@ -// -// ssl/detail/stream_core.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SSL_DETAIL_STREAM_CORE_HPP -#define ASIO_SSL_DETAIL_STREAM_CORE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_BOOST_DATE_TIME) -# include "asio/deadline_timer.hpp" -#else // defined(ASIO_HAS_BOOST_DATE_TIME) -# include "asio/steady_timer.hpp" -#endif // defined(ASIO_HAS_BOOST_DATE_TIME) -#include "asio/ssl/detail/engine.hpp" -#include "asio/buffer.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ssl { -namespace detail { - -struct stream_core -{ - // According to the OpenSSL documentation, this is the buffer size that is - // sufficient to hold the largest possible TLS record. - enum { max_tls_record_size = 17 * 1024 }; - - stream_core(SSL_CTX* context, asio::io_context& io_context) - : engine_(context), - pending_read_(io_context), - pending_write_(io_context), - output_buffer_space_(max_tls_record_size), - output_buffer_(asio::buffer(output_buffer_space_)), - input_buffer_space_(max_tls_record_size), - input_buffer_(asio::buffer(input_buffer_space_)) - { - pending_read_.expires_at(neg_infin()); - pending_write_.expires_at(neg_infin()); - } - - ~stream_core() - { - } - - // The SSL engine. - engine engine_; - -#if defined(ASIO_HAS_BOOST_DATE_TIME) - // Timer used for storing queued read operations. - asio::deadline_timer pending_read_; - - // Timer used for storing queued write operations. - asio::deadline_timer pending_write_; - - // Helper function for obtaining a time value that always fires. - static asio::deadline_timer::time_type neg_infin() - { - return boost::posix_time::neg_infin; - } - - // Helper function for obtaining a time value that never fires. - static asio::deadline_timer::time_type pos_infin() - { - return boost::posix_time::pos_infin; - } - - // Helper function to get a timer's expiry time. - static asio::deadline_timer::time_type expiry( - const asio::deadline_timer& timer) - { - return timer.expires_at(); - } -#else // defined(ASIO_HAS_BOOST_DATE_TIME) - // Timer used for storing queued read operations. - asio::steady_timer pending_read_; - - // Timer used for storing queued write operations. - asio::steady_timer pending_write_; - - // Helper function for obtaining a time value that always fires. - static asio::steady_timer::time_point neg_infin() - { - return (asio::steady_timer::time_point::min)(); - } - - // Helper function for obtaining a time value that never fires. - static asio::steady_timer::time_point pos_infin() - { - return (asio::steady_timer::time_point::max)(); - } - - // Helper function to get a timer's expiry time. - static asio::steady_timer::time_point expiry( - const asio::steady_timer& timer) - { - return timer.expiry(); - } -#endif // defined(ASIO_HAS_BOOST_DATE_TIME) - - // Buffer space used to prepare output intended for the transport. - std::vector output_buffer_space_; - - // A buffer that may be used to prepare output intended for the transport. - const asio::mutable_buffer output_buffer_; - - // Buffer space used to read input intended for the engine. - std::vector input_buffer_space_; - - // A buffer that may be used to read input intended for the engine. - const asio::mutable_buffer input_buffer_; - - // The buffer pointing to the engine's unconsumed input. - asio::const_buffer input_; -}; - -} // namespace detail -} // namespace ssl -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_SSL_DETAIL_STREAM_CORE_HPP diff --git a/tools/sdk/include/asio/asio/ssl/detail/verify_callback.hpp b/tools/sdk/include/asio/asio/ssl/detail/verify_callback.hpp deleted file mode 100644 index 1c56a27d824..00000000000 --- a/tools/sdk/include/asio/asio/ssl/detail/verify_callback.hpp +++ /dev/null @@ -1,62 +0,0 @@ -// -// ssl/detail/verify_callback.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SSL_DETAIL_VERIFY_CALLBACK_HPP -#define ASIO_SSL_DETAIL_VERIFY_CALLBACK_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include "asio/ssl/verify_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ssl { -namespace detail { - -class verify_callback_base -{ -public: - virtual ~verify_callback_base() - { - } - - virtual bool call(bool preverified, verify_context& ctx) = 0; -}; - -template -class verify_callback : public verify_callback_base -{ -public: - explicit verify_callback(VerifyCallback callback) - : callback_(callback) - { - } - - virtual bool call(bool preverified, verify_context& ctx) - { - return callback_(preverified, ctx); - } - -private: - VerifyCallback callback_; -}; - -} // namespace detail -} // namespace ssl -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_SSL_DETAIL_VERIFY_CALLBACK_HPP diff --git a/tools/sdk/include/asio/asio/ssl/detail/write_op.hpp b/tools/sdk/include/asio/asio/ssl/detail/write_op.hpp deleted file mode 100644 index 1d341c09d21..00000000000 --- a/tools/sdk/include/asio/asio/ssl/detail/write_op.hpp +++ /dev/null @@ -1,67 +0,0 @@ -// -// ssl/detail/write_op.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SSL_DETAIL_WRITE_OP_HPP -#define ASIO_SSL_DETAIL_WRITE_OP_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/ssl/detail/engine.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ssl { -namespace detail { - -template -class write_op -{ -public: - write_op(const ConstBufferSequence& buffers) - : buffers_(buffers) - { - } - - engine::want operator()(engine& eng, - asio::error_code& ec, - std::size_t& bytes_transferred) const - { - asio::const_buffer buffer = - asio::detail::buffer_sequence_adapter::first(buffers_); - - return eng.write(buffer, ec, bytes_transferred); - } - - template - void call_handler(Handler& handler, - const asio::error_code& ec, - const std::size_t& bytes_transferred) const - { - handler(ec, bytes_transferred); - } - -private: - ConstBufferSequence buffers_; -}; - -} // namespace detail -} // namespace ssl -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_SSL_DETAIL_WRITE_OP_HPP diff --git a/tools/sdk/include/asio/asio/ssl/error.hpp b/tools/sdk/include/asio/asio/ssl/error.hpp deleted file mode 100644 index 6165c5cf764..00000000000 --- a/tools/sdk/include/asio/asio/ssl/error.hpp +++ /dev/null @@ -1,111 +0,0 @@ -// -// ssl/error.hpp -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SSL_ERROR_HPP -#define ASIO_SSL_ERROR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/error_code.hpp" -#include "asio/ssl/detail/openssl_types.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace error { - -enum ssl_errors -{ - // Error numbers are those produced by openssl. -}; - -extern ASIO_DECL -const asio::error_category& get_ssl_category(); - -static const asio::error_category& - ssl_category ASIO_UNUSED_VARIABLE - = asio::error::get_ssl_category(); - -} // namespace error -namespace ssl { -namespace error { - -enum stream_errors -{ -#if defined(GENERATING_DOCUMENTATION) - /// The underlying stream closed before the ssl stream gracefully shut down. - stream_truncated -#elif (OPENSSL_VERSION_NUMBER < 0x10100000L) && !defined(OPENSSL_IS_BORINGSSL) - stream_truncated = ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SHORT_READ) -#else - stream_truncated = 1 -#endif -}; - -extern ASIO_DECL -const asio::error_category& get_stream_category(); - -static const asio::error_category& - stream_category ASIO_UNUSED_VARIABLE - = asio::ssl::error::get_stream_category(); - -} // namespace error -} // namespace ssl -} // namespace asio - -#if defined(ASIO_HAS_STD_SYSTEM_ERROR) -namespace std { - -template<> struct is_error_code_enum -{ - static const bool value = true; -}; - -template<> struct is_error_code_enum -{ - static const bool value = true; -}; - -} // namespace std -#endif // defined(ASIO_HAS_STD_SYSTEM_ERROR) - -namespace asio { -namespace error { - -inline asio::error_code make_error_code(ssl_errors e) -{ - return asio::error_code( - static_cast(e), get_ssl_category()); -} - -} // namespace error -namespace ssl { -namespace error { - -inline asio::error_code make_error_code(stream_errors e) -{ - return asio::error_code( - static_cast(e), get_stream_category()); -} - -} // namespace error -} // namespace ssl -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/ssl/impl/error.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_SSL_ERROR_HPP diff --git a/tools/sdk/include/asio/asio/ssl/impl/context.hpp b/tools/sdk/include/asio/asio/ssl/impl/context.hpp deleted file mode 100644 index 40199c143cf..00000000000 --- a/tools/sdk/include/asio/asio/ssl/impl/context.hpp +++ /dev/null @@ -1,67 +0,0 @@ -// -// ssl/impl/context.hpp -// ~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com -// Copyright (c) 2005-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SSL_IMPL_CONTEXT_HPP -#define ASIO_SSL_IMPL_CONTEXT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include "asio/detail/throw_error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ssl { - -template -void context::set_verify_callback(VerifyCallback callback) -{ - asio::error_code ec; - this->set_verify_callback(callback, ec); - asio::detail::throw_error(ec, "set_verify_callback"); -} - -template -ASIO_SYNC_OP_VOID context::set_verify_callback( - VerifyCallback callback, asio::error_code& ec) -{ - do_set_verify_callback( - new detail::verify_callback(callback), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); -} - -template -void context::set_password_callback(PasswordCallback callback) -{ - asio::error_code ec; - this->set_password_callback(callback, ec); - asio::detail::throw_error(ec, "set_password_callback"); -} - -template -ASIO_SYNC_OP_VOID context::set_password_callback( - PasswordCallback callback, asio::error_code& ec) -{ - do_set_password_callback( - new detail::password_callback(callback), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); -} - -} // namespace ssl -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_SSL_IMPL_CONTEXT_HPP diff --git a/tools/sdk/include/asio/asio/ssl/impl/src.hpp b/tools/sdk/include/asio/asio/ssl/impl/src.hpp deleted file mode 100644 index 9a1b038a4c3..00000000000 --- a/tools/sdk/include/asio/asio/ssl/impl/src.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// -// impl/ssl/src.hpp -// ~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SSL_IMPL_SRC_HPP -#define ASIO_SSL_IMPL_SRC_HPP - -#define ASIO_SOURCE - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HEADER_ONLY) -# error Do not compile Asio library source with ASIO_HEADER_ONLY defined -#endif - -#include "asio/ssl/impl/context.ipp" -#include "asio/ssl/impl/error.ipp" -#include "asio/ssl/detail/impl/engine.ipp" -#include "asio/ssl/detail/impl/openssl_init.ipp" -#include "asio/ssl/impl/rfc2818_verification.ipp" - -#endif // ASIO_SSL_IMPL_SRC_HPP diff --git a/tools/sdk/include/asio/asio/ssl/rfc2818_verification.hpp b/tools/sdk/include/asio/asio/ssl/rfc2818_verification.hpp deleted file mode 100644 index 3589f5383eb..00000000000 --- a/tools/sdk/include/asio/asio/ssl/rfc2818_verification.hpp +++ /dev/null @@ -1,94 +0,0 @@ -// -// ssl/rfc2818_verification.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SSL_RFC2818_VERIFICATION_HPP -#define ASIO_SSL_RFC2818_VERIFICATION_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include -#include "asio/ssl/detail/openssl_types.hpp" -#include "asio/ssl/verify_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ssl { - -/// Verifies a certificate against a hostname according to the rules described -/// in RFC 2818. -/** - * @par Example - * The following example shows how to synchronously open a secure connection to - * a given host name: - * @code - * using asio::ip::tcp; - * namespace ssl = asio::ssl; - * typedef ssl::stream ssl_socket; - * - * // Create a context that uses the default paths for finding CA certificates. - * ssl::context ctx(ssl::context::sslv23); - * ctx.set_default_verify_paths(); - * - * // Open a socket and connect it to the remote host. - * asio::io_context io_context; - * ssl_socket sock(io_context, ctx); - * tcp::resolver resolver(io_context); - * tcp::resolver::query query("host.name", "https"); - * asio::connect(sock.lowest_layer(), resolver.resolve(query)); - * sock.lowest_layer().set_option(tcp::no_delay(true)); - * - * // Perform SSL handshake and verify the remote host's certificate. - * sock.set_verify_mode(ssl::verify_peer); - * sock.set_verify_callback(ssl::rfc2818_verification("host.name")); - * sock.handshake(ssl_socket::client); - * - * // ... read and write as normal ... - * @endcode - */ -class rfc2818_verification -{ -public: - /// The type of the function object's result. - typedef bool result_type; - - /// Constructor. - explicit rfc2818_verification(const std::string& host) - : host_(host) - { - } - - /// Perform certificate verification. - ASIO_DECL bool operator()(bool preverified, verify_context& ctx) const; - -private: - // Helper function to check a host name against a pattern. - ASIO_DECL static bool match_pattern(const char* pattern, - std::size_t pattern_length, const char* host); - - // Helper function to check a host name against an IPv4 address - // The host name to be checked. - std::string host_; -}; - -} // namespace ssl -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) -# include "asio/ssl/impl/rfc2818_verification.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_SSL_RFC2818_VERIFICATION_HPP diff --git a/tools/sdk/include/asio/asio/ssl/stream.hpp b/tools/sdk/include/asio/asio/ssl/stream.hpp deleted file mode 100644 index 2b221ed514f..00000000000 --- a/tools/sdk/include/asio/asio/ssl/stream.hpp +++ /dev/null @@ -1,761 +0,0 @@ -// -// ssl/stream.hpp -// ~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SSL_STREAM_HPP -#define ASIO_SSL_STREAM_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include "asio/async_result.hpp" -#include "asio/detail/buffer_sequence_adapter.hpp" -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/ssl/context.hpp" -#include "asio/ssl/detail/buffered_handshake_op.hpp" -#include "asio/ssl/detail/handshake_op.hpp" -#include "asio/ssl/detail/io.hpp" -#include "asio/ssl/detail/read_op.hpp" -#include "asio/ssl/detail/shutdown_op.hpp" -#include "asio/ssl/detail/stream_core.hpp" -#include "asio/ssl/detail/write_op.hpp" -#include "asio/ssl/stream_base.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ssl { - -/// Provides stream-oriented functionality using SSL. -/** - * The stream class template provides asynchronous and blocking stream-oriented - * functionality using SSL. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. The application must also ensure that all - * asynchronous operations are performed within the same implicit or explicit - * strand. - * - * @par Example - * To use the SSL stream template with an ip::tcp::socket, you would write: - * @code - * asio::io_context io_context; - * asio::ssl::context ctx(asio::ssl::context::sslv23); - * asio::ssl::stream sock(io_context, ctx); - * @endcode - * - * @par Concepts: - * AsyncReadStream, AsyncWriteStream, Stream, SyncReadStream, SyncWriteStream. - */ -template -class stream : - public stream_base, - private noncopyable -{ -public: - /// The native handle type of the SSL stream. - typedef SSL* native_handle_type; - - /// Structure for use with deprecated impl_type. - struct impl_struct - { - SSL* ssl; - }; - - /// The type of the next layer. - typedef typename remove_reference::type next_layer_type; - - /// The type of the lowest layer. - typedef typename next_layer_type::lowest_layer_type lowest_layer_type; - - /// The type of the executor associated with the object. - typedef typename lowest_layer_type::executor_type executor_type; - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Construct a stream. - /** - * This constructor creates a stream and initialises the underlying stream - * object. - * - * @param arg The argument to be passed to initialise the underlying stream. - * - * @param ctx The SSL context to be used for the stream. - */ - template - stream(Arg&& arg, context& ctx) - : next_layer_(ASIO_MOVE_CAST(Arg)(arg)), - core_(ctx.native_handle(), - next_layer_.lowest_layer().get_executor().context()) - { - } -#else // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - template - stream(Arg& arg, context& ctx) - : next_layer_(arg), - core_(ctx.native_handle(), - next_layer_.lowest_layer().get_executor().context()) - { - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destructor. - /** - * @note A @c stream object must not be destroyed while there are pending - * asynchronous operations associated with it. - */ - ~stream() - { - } - - /// Get the executor associated with the object. - /** - * This function may be used to obtain the executor object that the stream - * uses to dispatch handlers for asynchronous operations. - * - * @return A copy of the executor that stream will use to dispatch handlers. - */ - executor_type get_executor() ASIO_NOEXCEPT - { - return next_layer_.lowest_layer().get_executor(); - } - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - asio::io_context& get_io_context() - { - return next_layer_.lowest_layer().get_io_context(); - } - - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - asio::io_context& get_io_service() - { - return next_layer_.lowest_layer().get_io_service(); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Get the underlying implementation in the native type. - /** - * This function may be used to obtain the underlying implementation of the - * context. This is intended to allow access to context functionality that is - * not otherwise provided. - * - * @par Example - * The native_handle() function returns a pointer of type @c SSL* that is - * suitable for passing to functions such as @c SSL_get_verify_result and - * @c SSL_get_peer_certificate: - * @code - * asio::ssl::stream sock(io_context, ctx); - * - * // ... establish connection and perform handshake ... - * - * if (X509* cert = SSL_get_peer_certificate(sock.native_handle())) - * { - * if (SSL_get_verify_result(sock.native_handle()) == X509_V_OK) - * { - * // ... - * } - * } - * @endcode - */ - native_handle_type native_handle() - { - return core_.engine_.native_handle(); - } - - /// Get a reference to the next layer. - /** - * This function returns a reference to the next layer in a stack of stream - * layers. - * - * @return A reference to the next layer in the stack of stream layers. - * Ownership is not transferred to the caller. - */ - const next_layer_type& next_layer() const - { - return next_layer_; - } - - /// Get a reference to the next layer. - /** - * This function returns a reference to the next layer in a stack of stream - * layers. - * - * @return A reference to the next layer in the stack of stream layers. - * Ownership is not transferred to the caller. - */ - next_layer_type& next_layer() - { - return next_layer_; - } - - /// Get a reference to the lowest layer. - /** - * This function returns a reference to the lowest layer in a stack of - * stream layers. - * - * @return A reference to the lowest layer in the stack of stream layers. - * Ownership is not transferred to the caller. - */ - lowest_layer_type& lowest_layer() - { - return next_layer_.lowest_layer(); - } - - /// Get a reference to the lowest layer. - /** - * This function returns a reference to the lowest layer in a stack of - * stream layers. - * - * @return A reference to the lowest layer in the stack of stream layers. - * Ownership is not transferred to the caller. - */ - const lowest_layer_type& lowest_layer() const - { - return next_layer_.lowest_layer(); - } - - /// Set the peer verification mode. - /** - * This function may be used to configure the peer verification mode used by - * the stream. The new mode will override the mode inherited from the context. - * - * @param v A bitmask of peer verification modes. See @ref verify_mode for - * available values. - * - * @throws asio::system_error Thrown on failure. - * - * @note Calls @c SSL_set_verify. - */ - void set_verify_mode(verify_mode v) - { - asio::error_code ec; - set_verify_mode(v, ec); - asio::detail::throw_error(ec, "set_verify_mode"); - } - - /// Set the peer verification mode. - /** - * This function may be used to configure the peer verification mode used by - * the stream. The new mode will override the mode inherited from the context. - * - * @param v A bitmask of peer verification modes. See @ref verify_mode for - * available values. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Calls @c SSL_set_verify. - */ - ASIO_SYNC_OP_VOID set_verify_mode( - verify_mode v, asio::error_code& ec) - { - core_.engine_.set_verify_mode(v, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Set the peer verification depth. - /** - * This function may be used to configure the maximum verification depth - * allowed by the stream. - * - * @param depth Maximum depth for the certificate chain verification that - * shall be allowed. - * - * @throws asio::system_error Thrown on failure. - * - * @note Calls @c SSL_set_verify_depth. - */ - void set_verify_depth(int depth) - { - asio::error_code ec; - set_verify_depth(depth, ec); - asio::detail::throw_error(ec, "set_verify_depth"); - } - - /// Set the peer verification depth. - /** - * This function may be used to configure the maximum verification depth - * allowed by the stream. - * - * @param depth Maximum depth for the certificate chain verification that - * shall be allowed. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Calls @c SSL_set_verify_depth. - */ - ASIO_SYNC_OP_VOID set_verify_depth( - int depth, asio::error_code& ec) - { - core_.engine_.set_verify_depth(depth, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Set the callback used to verify peer certificates. - /** - * This function is used to specify a callback function that will be called - * by the implementation when it needs to verify a peer certificate. - * - * @param callback The function object to be used for verifying a certificate. - * The function signature of the handler must be: - * @code bool verify_callback( - * bool preverified, // True if the certificate passed pre-verification. - * verify_context& ctx // The peer certificate and other context. - * ); @endcode - * The return value of the callback is true if the certificate has passed - * verification, false otherwise. - * - * @throws asio::system_error Thrown on failure. - * - * @note Calls @c SSL_set_verify. - */ - template - void set_verify_callback(VerifyCallback callback) - { - asio::error_code ec; - this->set_verify_callback(callback, ec); - asio::detail::throw_error(ec, "set_verify_callback"); - } - - /// Set the callback used to verify peer certificates. - /** - * This function is used to specify a callback function that will be called - * by the implementation when it needs to verify a peer certificate. - * - * @param callback The function object to be used for verifying a certificate. - * The function signature of the handler must be: - * @code bool verify_callback( - * bool preverified, // True if the certificate passed pre-verification. - * verify_context& ctx // The peer certificate and other context. - * ); @endcode - * The return value of the callback is true if the certificate has passed - * verification, false otherwise. - * - * @param ec Set to indicate what error occurred, if any. - * - * @note Calls @c SSL_set_verify. - */ - template - ASIO_SYNC_OP_VOID set_verify_callback(VerifyCallback callback, - asio::error_code& ec) - { - core_.engine_.set_verify_callback( - new detail::verify_callback(callback), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Perform SSL handshaking. - /** - * This function is used to perform SSL handshaking on the stream. The - * function call will block until handshaking is complete or an error occurs. - * - * @param type The type of handshaking to be performed, i.e. as a client or as - * a server. - * - * @throws asio::system_error Thrown on failure. - */ - void handshake(handshake_type type) - { - asio::error_code ec; - handshake(type, ec); - asio::detail::throw_error(ec, "handshake"); - } - - /// Perform SSL handshaking. - /** - * This function is used to perform SSL handshaking on the stream. The - * function call will block until handshaking is complete or an error occurs. - * - * @param type The type of handshaking to be performed, i.e. as a client or as - * a server. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID handshake(handshake_type type, - asio::error_code& ec) - { - detail::io(next_layer_, core_, detail::handshake_op(type), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Perform SSL handshaking. - /** - * This function is used to perform SSL handshaking on the stream. The - * function call will block until handshaking is complete or an error occurs. - * - * @param type The type of handshaking to be performed, i.e. as a client or as - * a server. - * - * @param buffers The buffered data to be reused for the handshake. - * - * @throws asio::system_error Thrown on failure. - */ - template - void handshake(handshake_type type, const ConstBufferSequence& buffers) - { - asio::error_code ec; - handshake(type, buffers, ec); - asio::detail::throw_error(ec, "handshake"); - } - - /// Perform SSL handshaking. - /** - * This function is used to perform SSL handshaking on the stream. The - * function call will block until handshaking is complete or an error occurs. - * - * @param type The type of handshaking to be performed, i.e. as a client or as - * a server. - * - * @param buffers The buffered data to be reused for the handshake. - * - * @param ec Set to indicate what error occurred, if any. - */ - template - ASIO_SYNC_OP_VOID handshake(handshake_type type, - const ConstBufferSequence& buffers, asio::error_code& ec) - { - detail::io(next_layer_, core_, - detail::buffered_handshake_op(type, buffers), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Start an asynchronous SSL handshake. - /** - * This function is used to asynchronously perform an SSL handshake on the - * stream. This function call always returns immediately. - * - * @param type The type of handshaking to be performed, i.e. as a client or as - * a server. - * - * @param handler The handler to be called when the handshake operation - * completes. Copies will be made of the handler as required. The equivalent - * function signature of the handler must be: - * @code void handler( - * const asio::error_code& error // Result of operation. - * ); @endcode - */ - template - ASIO_INITFN_RESULT_TYPE(HandshakeHandler, - void (asio::error_code)) - async_handshake(handshake_type type, - ASIO_MOVE_ARG(HandshakeHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a HandshakeHandler. - ASIO_HANDSHAKE_HANDLER_CHECK(HandshakeHandler, handler) type_check; - - asio::async_completion init(handler); - - detail::async_io(next_layer_, core_, - detail::handshake_op(type), init.completion_handler); - - return init.result.get(); - } - - /// Start an asynchronous SSL handshake. - /** - * This function is used to asynchronously perform an SSL handshake on the - * stream. This function call always returns immediately. - * - * @param type The type of handshaking to be performed, i.e. as a client or as - * a server. - * - * @param buffers The buffered data to be reused for the handshake. Although - * the buffers object may be copied as necessary, ownership of the underlying - * buffers is retained by the caller, which must guarantee that they remain - * valid until the handler is called. - * - * @param handler The handler to be called when the handshake operation - * completes. Copies will be made of the handler as required. The equivalent - * function signature of the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Amount of buffers used in handshake. - * ); @endcode - */ - template - ASIO_INITFN_RESULT_TYPE(BufferedHandshakeHandler, - void (asio::error_code, std::size_t)) - async_handshake(handshake_type type, const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(BufferedHandshakeHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a BufferedHandshakeHandler. - ASIO_BUFFERED_HANDSHAKE_HANDLER_CHECK( - BufferedHandshakeHandler, handler) type_check; - - asio::async_completion init(handler); - - detail::async_io(next_layer_, core_, - detail::buffered_handshake_op(type, buffers), - init.completion_handler); - - return init.result.get(); - } - - /// Shut down SSL on the stream. - /** - * This function is used to shut down SSL on the stream. The function call - * will block until SSL has been shut down or an error occurs. - * - * @throws asio::system_error Thrown on failure. - */ - void shutdown() - { - asio::error_code ec; - shutdown(ec); - asio::detail::throw_error(ec, "shutdown"); - } - - /// Shut down SSL on the stream. - /** - * This function is used to shut down SSL on the stream. The function call - * will block until SSL has been shut down or an error occurs. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID shutdown(asio::error_code& ec) - { - detail::io(next_layer_, core_, detail::shutdown_op(), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Asynchronously shut down SSL on the stream. - /** - * This function is used to asynchronously shut down SSL on the stream. This - * function call always returns immediately. - * - * @param handler The handler to be called when the handshake operation - * completes. Copies will be made of the handler as required. The equivalent - * function signature of the handler must be: - * @code void handler( - * const asio::error_code& error // Result of operation. - * ); @endcode - */ - template - ASIO_INITFN_RESULT_TYPE(ShutdownHandler, - void (asio::error_code)) - async_shutdown(ASIO_MOVE_ARG(ShutdownHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ShutdownHandler. - ASIO_SHUTDOWN_HANDLER_CHECK(ShutdownHandler, handler) type_check; - - asio::async_completion init(handler); - - detail::async_io(next_layer_, core_, detail::shutdown_op(), - init.completion_handler); - - return init.result.get(); - } - - /// Write some data to the stream. - /** - * This function is used to write data on the stream. The function call will - * block until one or more bytes of data has been written successfully, or - * until an error occurs. - * - * @param buffers The data to be written. - * - * @returns The number of bytes written. - * - * @throws asio::system_error Thrown on failure. - * - * @note The write_some operation may not transmit all of the data to the - * peer. Consider using the @ref write function if you need to ensure that all - * data is written before the blocking operation completes. - */ - template - std::size_t write_some(const ConstBufferSequence& buffers) - { - asio::error_code ec; - std::size_t n = write_some(buffers, ec); - asio::detail::throw_error(ec, "write_some"); - return n; - } - - /// Write some data to the stream. - /** - * This function is used to write data on the stream. The function call will - * block until one or more bytes of data has been written successfully, or - * until an error occurs. - * - * @param buffers The data to be written to the stream. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes written. Returns 0 if an error occurred. - * - * @note The write_some operation may not transmit all of the data to the - * peer. Consider using the @ref write function if you need to ensure that all - * data is written before the blocking operation completes. - */ - template - std::size_t write_some(const ConstBufferSequence& buffers, - asio::error_code& ec) - { - return detail::io(next_layer_, core_, - detail::write_op(buffers), ec); - } - - /// Start an asynchronous write. - /** - * This function is used to asynchronously write one or more bytes of data to - * the stream. The function call always returns immediately. - * - * @param buffers The data to be written to the stream. Although the buffers - * object may be copied as necessary, ownership of the underlying buffers is - * retained by the caller, which must guarantee that they remain valid until - * the handler is called. - * - * @param handler The handler to be called when the write operation completes. - * Copies will be made of the handler as required. The equivalent function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes written. - * ); @endcode - * - * @note The async_write_some operation may not transmit all of the data to - * the peer. Consider using the @ref async_write function if you need to - * ensure that all data is written before the blocking operation completes. - */ - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_write_some(const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - - asio::async_completion init(handler); - - detail::async_io(next_layer_, core_, - detail::write_op(buffers), - init.completion_handler); - - return init.result.get(); - } - - /// Read some data from the stream. - /** - * This function is used to read data from the stream. The function call will - * block until one or more bytes of data has been read successfully, or until - * an error occurs. - * - * @param buffers The buffers into which the data will be read. - * - * @returns The number of bytes read. - * - * @throws asio::system_error Thrown on failure. - * - * @note The read_some operation may not read all of the requested number of - * bytes. Consider using the @ref read function if you need to ensure that the - * requested amount of data is read before the blocking operation completes. - */ - template - std::size_t read_some(const MutableBufferSequence& buffers) - { - asio::error_code ec; - std::size_t n = read_some(buffers, ec); - asio::detail::throw_error(ec, "read_some"); - return n; - } - - /// Read some data from the stream. - /** - * This function is used to read data from the stream. The function call will - * block until one or more bytes of data has been read successfully, or until - * an error occurs. - * - * @param buffers The buffers into which the data will be read. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes read. Returns 0 if an error occurred. - * - * @note The read_some operation may not read all of the requested number of - * bytes. Consider using the @ref read function if you need to ensure that the - * requested amount of data is read before the blocking operation completes. - */ - template - std::size_t read_some(const MutableBufferSequence& buffers, - asio::error_code& ec) - { - return detail::io(next_layer_, core_, - detail::read_op(buffers), ec); - } - - /// Start an asynchronous read. - /** - * This function is used to asynchronously read one or more bytes of data from - * the stream. The function call always returns immediately. - * - * @param buffers The buffers into which the data will be read. Although the - * buffers object may be copied as necessary, ownership of the underlying - * buffers is retained by the caller, which must guarantee that they remain - * valid until the handler is called. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The equivalent function - * signature of the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes read. - * ); @endcode - * - * @note The async_read_some operation may not read all of the requested - * number of bytes. Consider using the @ref async_read function if you need to - * ensure that the requested amount of data is read before the asynchronous - * operation completes. - */ - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_read_some(const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - - asio::async_completion init(handler); - - detail::async_io(next_layer_, core_, - detail::read_op(buffers), - init.completion_handler); - - return init.result.get(); - } - -private: - Stream next_layer_; - detail::stream_core core_; -}; - -} // namespace ssl -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_SSL_STREAM_HPP diff --git a/tools/sdk/include/asio/asio/ssl/stream_base.hpp b/tools/sdk/include/asio/asio/ssl/stream_base.hpp deleted file mode 100644 index 56873e4a5c2..00000000000 --- a/tools/sdk/include/asio/asio/ssl/stream_base.hpp +++ /dev/null @@ -1,52 +0,0 @@ -// -// ssl/stream_base.hpp -// ~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SSL_STREAM_BASE_HPP -#define ASIO_SSL_STREAM_BASE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ssl { - -/// The stream_base class is used as a base for the asio::ssl::stream -/// class template so that we have a common place to define various enums. -class stream_base -{ -public: - /// Different handshake types. - enum handshake_type - { - /// Perform handshaking as a client. - client, - - /// Perform handshaking as a server. - server - }; - -protected: - /// Protected destructor to prevent deletion through this type. - ~stream_base() - { - } -}; - -} // namespace ssl -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_SSL_STREAM_BASE_HPP diff --git a/tools/sdk/include/asio/asio/ssl/verify_context.hpp b/tools/sdk/include/asio/asio/ssl/verify_context.hpp deleted file mode 100644 index e17269715af..00000000000 --- a/tools/sdk/include/asio/asio/ssl/verify_context.hpp +++ /dev/null @@ -1,67 +0,0 @@ -// -// ssl/verify_context.hpp -// ~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SSL_VERIFY_CONTEXT_HPP -#define ASIO_SSL_VERIFY_CONTEXT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include "asio/detail/noncopyable.hpp" -#include "asio/ssl/detail/openssl_types.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ssl { - -/// A simple wrapper around the X509_STORE_CTX type, used during verification of -/// a peer certificate. -/** - * @note The verify_context does not own the underlying X509_STORE_CTX object. - */ -class verify_context - : private noncopyable -{ -public: - /// The native handle type of the verification context. - typedef X509_STORE_CTX* native_handle_type; - - /// Constructor. - explicit verify_context(native_handle_type handle) - : handle_(handle) - { - } - - /// Get the underlying implementation in the native type. - /** - * This function may be used to obtain the underlying implementation of the - * context. This is intended to allow access to context functionality that is - * not otherwise provided. - */ - native_handle_type native_handle() - { - return handle_; - } - -private: - // The underlying native implementation. - native_handle_type handle_; -}; - -} // namespace ssl -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_SSL_VERIFY_CONTEXT_HPP diff --git a/tools/sdk/include/asio/asio/ssl/verify_mode.hpp b/tools/sdk/include/asio/asio/ssl/verify_mode.hpp deleted file mode 100644 index 8c4b3942628..00000000000 --- a/tools/sdk/include/asio/asio/ssl/verify_mode.hpp +++ /dev/null @@ -1,63 +0,0 @@ -// -// ssl/verify_mode.hpp -// ~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SSL_VERIFY_MODE_HPP -#define ASIO_SSL_VERIFY_MODE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/ssl/detail/openssl_types.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace ssl { - -/// Bitmask type for peer verification. -/** - * Possible values are: - * - * @li @ref verify_none - * @li @ref verify_peer - * @li @ref verify_fail_if_no_peer_cert - * @li @ref verify_client_once - */ -typedef int verify_mode; - -#if defined(GENERATING_DOCUMENTATION) -/// No verification. -const int verify_none = implementation_defined; - -/// Verify the peer. -const int verify_peer = implementation_defined; - -/// Fail verification if the peer has no certificate. Ignored unless -/// @ref verify_peer is set. -const int verify_fail_if_no_peer_cert = implementation_defined; - -/// Do not request client certificate on renegotiation. Ignored unless -/// @ref verify_peer is set. -const int verify_client_once = implementation_defined; -#else -const int verify_none = SSL_VERIFY_NONE; -const int verify_peer = SSL_VERIFY_PEER; -const int verify_fail_if_no_peer_cert = SSL_VERIFY_FAIL_IF_NO_PEER_CERT; -const int verify_client_once = SSL_VERIFY_CLIENT_ONCE; -#endif - -} // namespace ssl -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_SSL_VERIFY_MODE_HPP diff --git a/tools/sdk/include/asio/asio/steady_timer.hpp b/tools/sdk/include/asio/asio/steady_timer.hpp deleted file mode 100644 index 3ede2084706..00000000000 --- a/tools/sdk/include/asio/asio/steady_timer.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// -// steady_timer.hpp -// ~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_STEADY_TIMER_HPP -#define ASIO_STEADY_TIMER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION) - -#include "asio/basic_waitable_timer.hpp" -#include "asio/detail/chrono.hpp" - -namespace asio { - -/// Typedef for a timer based on the steady clock. -/** - * This typedef uses the C++11 @c <chrono> standard library facility, if - * available. Otherwise, it may use the Boost.Chrono library. To explicitly - * utilise Boost.Chrono, use the basic_waitable_timer template directly: - * @code - * typedef basic_waitable_timer timer; - * @endcode - */ -typedef basic_waitable_timer steady_timer; - -} // namespace asio - -#endif // defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION) - -#endif // ASIO_STEADY_TIMER_HPP diff --git a/tools/sdk/include/asio/asio/strand.hpp b/tools/sdk/include/asio/asio/strand.hpp deleted file mode 100644 index ea78ef02feb..00000000000 --- a/tools/sdk/include/asio/asio/strand.hpp +++ /dev/null @@ -1,286 +0,0 @@ -// -// strand.hpp -// ~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_STRAND_HPP -#define ASIO_STRAND_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/strand_executor_service.hpp" -#include "asio/detail/type_traits.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Provides serialised function invocation for any executor type. -template -class strand -{ -public: - /// The type of the underlying executor. - typedef Executor inner_executor_type; - - /// Default constructor. - /** - * This constructor is only valid if the underlying executor type is default - * constructible. - */ - strand() - : executor_(), - impl_(use_service( - executor_.context()).create_implementation()) - { - } - - /// Construct a strand for the specified executor. - explicit strand(const Executor& e) - : executor_(e), - impl_(use_service( - executor_.context()).create_implementation()) - { - } - - /// Copy constructor. - strand(const strand& other) ASIO_NOEXCEPT - : executor_(other.executor_), - impl_(other.impl_) - { - } - - /// Converting constructor. - /** - * This constructor is only valid if the @c OtherExecutor type is convertible - * to @c Executor. - */ - template - strand( - const strand& other) ASIO_NOEXCEPT - : executor_(other.executor_), - impl_(other.impl_) - { - } - - /// Assignment operator. - strand& operator=(const strand& other) ASIO_NOEXCEPT - { - executor_ = other.executor_; - impl_ = other.impl_; - return *this; - } - - /// Converting assignment operator. - /** - * This assignment operator is only valid if the @c OtherExecutor type is - * convertible to @c Executor. - */ - template - strand& operator=( - const strand& other) ASIO_NOEXCEPT - { - executor_ = other.executor_; - impl_ = other.impl_; - return *this; - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move constructor. - strand(strand&& other) ASIO_NOEXCEPT - : executor_(ASIO_MOVE_CAST(Executor)(other.executor_)), - impl_(ASIO_MOVE_CAST(implementation_type)(other.impl_)) - { - } - - /// Converting move constructor. - /** - * This constructor is only valid if the @c OtherExecutor type is convertible - * to @c Executor. - */ - template - strand(strand&& other) ASIO_NOEXCEPT - : executor_(ASIO_MOVE_CAST(OtherExecutor)(other)), - impl_(ASIO_MOVE_CAST(implementation_type)(other.impl_)) - { - } - - /// Move assignment operator. - strand& operator=(strand&& other) ASIO_NOEXCEPT - { - executor_ = ASIO_MOVE_CAST(Executor)(other); - impl_ = ASIO_MOVE_CAST(implementation_type)(other.impl_); - return *this; - } - - /// Converting move assignment operator. - /** - * This assignment operator is only valid if the @c OtherExecutor type is - * convertible to @c Executor. - */ - template - strand& operator=( - const strand&& other) ASIO_NOEXCEPT - { - executor_ = ASIO_MOVE_CAST(OtherExecutor)(other); - impl_ = ASIO_MOVE_CAST(implementation_type)(other.impl_); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destructor. - ~strand() - { - } - - /// Obtain the underlying executor. - inner_executor_type get_inner_executor() const ASIO_NOEXCEPT - { - return executor_; - } - - /// Obtain the underlying execution context. - execution_context& context() const ASIO_NOEXCEPT - { - return executor_.context(); - } - - /// Inform the strand that it has some outstanding work to do. - /** - * The strand delegates this call to its underlying executor. - */ - void on_work_started() const ASIO_NOEXCEPT - { - executor_.on_work_started(); - } - - /// Inform the strand that some work is no longer outstanding. - /** - * The strand delegates this call to its underlying executor. - */ - void on_work_finished() const ASIO_NOEXCEPT - { - executor_.on_work_finished(); - } - - /// Request the strand to invoke the given function object. - /** - * This function is used to ask the strand to execute the given function - * object on its underlying executor. The function object will be executed - * inside this function if the strand is not otherwise busy and if the - * underlying executor's @c dispatch() function is also able to execute the - * function before returning. - * - * @param f The function object to be called. The executor will make - * a copy of the handler object as required. The function signature of the - * function object must be: @code void function(); @endcode - * - * @param a An allocator that may be used by the executor to allocate the - * internal storage needed for function invocation. - */ - template - void dispatch(ASIO_MOVE_ARG(Function) f, const Allocator& a) const - { - detail::strand_executor_service::dispatch(impl_, - executor_, ASIO_MOVE_CAST(Function)(f), a); - } - - /// Request the strand to invoke the given function object. - /** - * This function is used to ask the executor to execute the given function - * object. The function object will never be executed inside this function. - * Instead, it will be scheduled by the underlying executor's defer function. - * - * @param f The function object to be called. The executor will make - * a copy of the handler object as required. The function signature of the - * function object must be: @code void function(); @endcode - * - * @param a An allocator that may be used by the executor to allocate the - * internal storage needed for function invocation. - */ - template - void post(ASIO_MOVE_ARG(Function) f, const Allocator& a) const - { - detail::strand_executor_service::post(impl_, - executor_, ASIO_MOVE_CAST(Function)(f), a); - } - - /// Request the strand to invoke the given function object. - /** - * This function is used to ask the executor to execute the given function - * object. The function object will never be executed inside this function. - * Instead, it will be scheduled by the underlying executor's defer function. - * - * @param f The function object to be called. The executor will make - * a copy of the handler object as required. The function signature of the - * function object must be: @code void function(); @endcode - * - * @param a An allocator that may be used by the executor to allocate the - * internal storage needed for function invocation. - */ - template - void defer(ASIO_MOVE_ARG(Function) f, const Allocator& a) const - { - detail::strand_executor_service::defer(impl_, - executor_, ASIO_MOVE_CAST(Function)(f), a); - } - - /// Determine whether the strand is running in the current thread. - /** - * @return @c true if the current thread is executing a function that was - * submitted to the strand using post(), dispatch() or defer(). Otherwise - * returns @c false. - */ - bool running_in_this_thread() const ASIO_NOEXCEPT - { - return detail::strand_executor_service::running_in_this_thread(impl_); - } - - /// Compare two strands for equality. - /** - * Two strands are equal if they refer to the same ordered, non-concurrent - * state. - */ - friend bool operator==(const strand& a, const strand& b) ASIO_NOEXCEPT - { - return a.impl_ == b.impl_; - } - - /// Compare two strands for inequality. - /** - * Two strands are equal if they refer to the same ordered, non-concurrent - * state. - */ - friend bool operator!=(const strand& a, const strand& b) ASIO_NOEXCEPT - { - return a.impl_ != b.impl_; - } - -private: - Executor executor_; - typedef detail::strand_executor_service::implementation_type - implementation_type; - implementation_type impl_; -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -// If both io_context.hpp and strand.hpp have been included, automatically -// include the header file needed for the io_context::strand class. -#if !defined(ASIO_NO_EXTENSIONS) -# if defined(ASIO_IO_CONTEXT_HPP) -# include "asio/io_context_strand.hpp" -# endif // defined(ASIO_IO_CONTEXT_HPP) -#endif // !defined(ASIO_NO_EXTENSIONS) - -#endif // ASIO_STRAND_HPP diff --git a/tools/sdk/include/asio/asio/stream_socket_service.hpp b/tools/sdk/include/asio/asio/stream_socket_service.hpp deleted file mode 100644 index 91b0a711f2a..00000000000 --- a/tools/sdk/include/asio/asio/stream_socket_service.hpp +++ /dev/null @@ -1,412 +0,0 @@ -// -// stream_socket_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_STREAM_SOCKET_SERVICE_HPP -#define ASIO_STREAM_SOCKET_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) - -#include -#include "asio/async_result.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" - -#if defined(ASIO_WINDOWS_RUNTIME) -# include "asio/detail/winrt_ssocket_service.hpp" -#elif defined(ASIO_HAS_IOCP) -# include "asio/detail/win_iocp_socket_service.hpp" -#else -# include "asio/detail/reactive_socket_service.hpp" -#endif - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Default service implementation for a stream socket. -template -class stream_socket_service -#if defined(GENERATING_DOCUMENTATION) - : public asio::io_context::service -#else - : public asio::detail::service_base > -#endif -{ -public: -#if defined(GENERATING_DOCUMENTATION) - /// The unique service identifier. - static asio::io_context::id id; -#endif - - /// The protocol type. - typedef Protocol protocol_type; - - /// The endpoint type. - typedef typename Protocol::endpoint endpoint_type; - -private: - // The type of the platform-specific implementation. -#if defined(ASIO_WINDOWS_RUNTIME) - typedef detail::winrt_ssocket_service service_impl_type; -#elif defined(ASIO_HAS_IOCP) - typedef detail::win_iocp_socket_service service_impl_type; -#else - typedef detail::reactive_socket_service service_impl_type; -#endif - -public: - /// The type of a stream socket implementation. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined implementation_type; -#else - typedef typename service_impl_type::implementation_type implementation_type; -#endif - - /// The native socket type. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined native_handle_type; -#else - typedef typename service_impl_type::native_handle_type native_handle_type; -#endif - - /// Construct a new stream socket service for the specified io_context. - explicit stream_socket_service(asio::io_context& io_context) - : asio::detail::service_base< - stream_socket_service >(io_context), - service_impl_(io_context) - { - } - - /// Construct a new stream socket implementation. - void construct(implementation_type& impl) - { - service_impl_.construct(impl); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a new stream socket implementation. - void move_construct(implementation_type& impl, - implementation_type& other_impl) - { - service_impl_.move_construct(impl, other_impl); - } - - /// Move-assign from another stream socket implementation. - void move_assign(implementation_type& impl, - stream_socket_service& other_service, - implementation_type& other_impl) - { - service_impl_.move_assign(impl, other_service.service_impl_, other_impl); - } - - // All socket services have access to each other's implementations. - template friend class stream_socket_service; - - /// Move-construct a new stream socket implementation from another protocol - /// type. - template - void converting_move_construct(implementation_type& impl, - stream_socket_service& other_service, - typename stream_socket_service< - Protocol1>::implementation_type& other_impl, - typename enable_if::value>::type* = 0) - { - service_impl_.template converting_move_construct( - impl, other_service.service_impl_, other_impl); - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destroy a stream socket implementation. - void destroy(implementation_type& impl) - { - service_impl_.destroy(impl); - } - - /// Open a stream socket. - ASIO_SYNC_OP_VOID open(implementation_type& impl, - const protocol_type& protocol, asio::error_code& ec) - { - if (protocol.type() == ASIO_OS_DEF(SOCK_STREAM)) - service_impl_.open(impl, protocol, ec); - else - ec = asio::error::invalid_argument; - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Assign an existing native socket to a stream socket. - ASIO_SYNC_OP_VOID assign(implementation_type& impl, - const protocol_type& protocol, const native_handle_type& native_socket, - asio::error_code& ec) - { - service_impl_.assign(impl, protocol, native_socket, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Determine whether the socket is open. - bool is_open(const implementation_type& impl) const - { - return service_impl_.is_open(impl); - } - - /// Close a stream socket implementation. - ASIO_SYNC_OP_VOID close(implementation_type& impl, - asio::error_code& ec) - { - service_impl_.close(impl, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Release ownership of the underlying socket. - native_handle_type release(implementation_type& impl, - asio::error_code& ec) - { - return service_impl_.release(impl, ec); - } - - /// Get the native socket implementation. - native_handle_type native_handle(implementation_type& impl) - { - return service_impl_.native_handle(impl); - } - - /// Cancel all asynchronous operations associated with the socket. - ASIO_SYNC_OP_VOID cancel(implementation_type& impl, - asio::error_code& ec) - { - service_impl_.cancel(impl, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Determine whether the socket is at the out-of-band data mark. - bool at_mark(const implementation_type& impl, - asio::error_code& ec) const - { - return service_impl_.at_mark(impl, ec); - } - - /// Determine the number of bytes available for reading. - std::size_t available(const implementation_type& impl, - asio::error_code& ec) const - { - return service_impl_.available(impl, ec); - } - - /// Bind the stream socket to the specified local endpoint. - ASIO_SYNC_OP_VOID bind(implementation_type& impl, - const endpoint_type& endpoint, asio::error_code& ec) - { - service_impl_.bind(impl, endpoint, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Connect the stream socket to the specified endpoint. - ASIO_SYNC_OP_VOID connect(implementation_type& impl, - const endpoint_type& peer_endpoint, asio::error_code& ec) - { - service_impl_.connect(impl, peer_endpoint, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Start an asynchronous connect. - template - ASIO_INITFN_RESULT_TYPE(ConnectHandler, - void (asio::error_code)) - async_connect(implementation_type& impl, - const endpoint_type& peer_endpoint, - ASIO_MOVE_ARG(ConnectHandler) handler) - { - async_completion init(handler); - - service_impl_.async_connect(impl, peer_endpoint, init.completion_handler); - - return init.result.get(); - } - - /// Set a socket option. - template - ASIO_SYNC_OP_VOID set_option(implementation_type& impl, - const SettableSocketOption& option, asio::error_code& ec) - { - service_impl_.set_option(impl, option, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get a socket option. - template - ASIO_SYNC_OP_VOID get_option(const implementation_type& impl, - GettableSocketOption& option, asio::error_code& ec) const - { - service_impl_.get_option(impl, option, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Perform an IO control command on the socket. - template - ASIO_SYNC_OP_VOID io_control(implementation_type& impl, - IoControlCommand& command, asio::error_code& ec) - { - service_impl_.io_control(impl, command, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Gets the non-blocking mode of the socket. - bool non_blocking(const implementation_type& impl) const - { - return service_impl_.non_blocking(impl); - } - - /// Sets the non-blocking mode of the socket. - ASIO_SYNC_OP_VOID non_blocking(implementation_type& impl, - bool mode, asio::error_code& ec) - { - service_impl_.non_blocking(impl, mode, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Gets the non-blocking mode of the native socket implementation. - bool native_non_blocking(const implementation_type& impl) const - { - return service_impl_.native_non_blocking(impl); - } - - /// Sets the non-blocking mode of the native socket implementation. - ASIO_SYNC_OP_VOID native_non_blocking(implementation_type& impl, - bool mode, asio::error_code& ec) - { - service_impl_.native_non_blocking(impl, mode, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get the local endpoint. - endpoint_type local_endpoint(const implementation_type& impl, - asio::error_code& ec) const - { - return service_impl_.local_endpoint(impl, ec); - } - - /// Get the remote endpoint. - endpoint_type remote_endpoint(const implementation_type& impl, - asio::error_code& ec) const - { - return service_impl_.remote_endpoint(impl, ec); - } - - /// Disable sends or receives on the socket. - ASIO_SYNC_OP_VOID shutdown(implementation_type& impl, - socket_base::shutdown_type what, asio::error_code& ec) - { - service_impl_.shutdown(impl, what, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Wait for the socket to become ready to read, ready to write, or to have - /// pending error conditions. - ASIO_SYNC_OP_VOID wait(implementation_type& impl, - socket_base::wait_type w, asio::error_code& ec) - { - service_impl_.wait(impl, w, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Asynchronously wait for the socket to become ready to read, ready to - /// write, or to have pending error conditions. - template - ASIO_INITFN_RESULT_TYPE(WaitHandler, - void (asio::error_code)) - async_wait(implementation_type& impl, socket_base::wait_type w, - ASIO_MOVE_ARG(WaitHandler) handler) - { - async_completion init(handler); - - service_impl_.async_wait(impl, w, init.completion_handler); - - return init.result.get(); - } - - /// Send the given data to the peer. - template - std::size_t send(implementation_type& impl, - const ConstBufferSequence& buffers, - socket_base::message_flags flags, asio::error_code& ec) - { - return service_impl_.send(impl, buffers, flags, ec); - } - - /// Start an asynchronous send. - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_send(implementation_type& impl, - const ConstBufferSequence& buffers, - socket_base::message_flags flags, - ASIO_MOVE_ARG(WriteHandler) handler) - { - async_completion init(handler); - - service_impl_.async_send(impl, buffers, flags, init.completion_handler); - - return init.result.get(); - } - - /// Receive some data from the peer. - template - std::size_t receive(implementation_type& impl, - const MutableBufferSequence& buffers, - socket_base::message_flags flags, asio::error_code& ec) - { - return service_impl_.receive(impl, buffers, flags, ec); - } - - /// Start an asynchronous receive. - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_receive(implementation_type& impl, - const MutableBufferSequence& buffers, - socket_base::message_flags flags, - ASIO_MOVE_ARG(ReadHandler) handler) - { - async_completion init(handler); - - service_impl_.async_receive(impl, buffers, flags, init.completion_handler); - - return init.result.get(); - } - -private: - // Destroy all user-defined handler objects owned by the service. - void shutdown() - { - service_impl_.shutdown(); - } - - // The platform-specific implementation. - service_impl_type service_impl_; -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_STREAM_SOCKET_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/streambuf.hpp b/tools/sdk/include/asio/asio/streambuf.hpp deleted file mode 100644 index cb3f35f7d67..00000000000 --- a/tools/sdk/include/asio/asio/streambuf.hpp +++ /dev/null @@ -1,33 +0,0 @@ -// -// streambuf.hpp -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_STREAMBUF_HPP -#define ASIO_STREAMBUF_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_NO_IOSTREAM) - -#include "asio/basic_streambuf.hpp" - -namespace asio { - -/// Typedef for the typical usage of basic_streambuf. -typedef basic_streambuf<> streambuf; - -} // namespace asio - -#endif // !defined(ASIO_NO_IOSTREAM) - -#endif // ASIO_STREAMBUF_HPP diff --git a/tools/sdk/include/asio/asio/system_context.hpp b/tools/sdk/include/asio/asio/system_context.hpp deleted file mode 100644 index ccd11134305..00000000000 --- a/tools/sdk/include/asio/asio/system_context.hpp +++ /dev/null @@ -1,78 +0,0 @@ -// -// system_context.hpp -// ~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SYSTEM_CONTEXT_HPP -#define ASIO_SYSTEM_CONTEXT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/scheduler.hpp" -#include "asio/detail/thread_group.hpp" -#include "asio/execution_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -class system_executor; - -/// The executor context for the system executor. -class system_context : public execution_context -{ -public: - /// The executor type associated with the context. - typedef system_executor executor_type; - - /// Destructor shuts down all threads in the system thread pool. - ASIO_DECL ~system_context(); - - /// Obtain an executor for the context. - executor_type get_executor() ASIO_NOEXCEPT; - - /// Signal all threads in the system thread pool to stop. - ASIO_DECL void stop(); - - /// Determine whether the system thread pool has been stopped. - ASIO_DECL bool stopped() const ASIO_NOEXCEPT; - - /// Join all threads in the system thread pool. - ASIO_DECL void join(); - -#if defined(GENERATING_DOCUMENTATION) -private: -#endif // defined(GENERATING_DOCUMENTATION) - // Constructor creates all threads in the system thread pool. - ASIO_DECL system_context(); - -private: - friend class system_executor; - - struct thread_function; - - // The underlying scheduler. - detail::scheduler& scheduler_; - - // The threads in the system thread pool. - detail::thread_group threads_; -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/impl/system_context.hpp" -#if defined(ASIO_HEADER_ONLY) -# include "asio/impl/system_context.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_SYSTEM_CONTEXT_HPP diff --git a/tools/sdk/include/asio/asio/system_error.hpp b/tools/sdk/include/asio/asio/system_error.hpp deleted file mode 100644 index 63908941627..00000000000 --- a/tools/sdk/include/asio/asio/system_error.hpp +++ /dev/null @@ -1,131 +0,0 @@ -// -// system_error.hpp -// ~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SYSTEM_ERROR_HPP -#define ASIO_SYSTEM_ERROR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_STD_SYSTEM_ERROR) -# include -#else // defined(ASIO_HAS_STD_SYSTEM_ERROR) -# include -# include -# include -# include "asio/error_code.hpp" -# include "asio/detail/scoped_ptr.hpp" -#endif // defined(ASIO_HAS_STD_SYSTEM_ERROR) - -#include "asio/detail/push_options.hpp" - -namespace asio { - -#if defined(ASIO_HAS_STD_SYSTEM_ERROR) - -typedef std::system_error system_error; - -#else // defined(ASIO_HAS_STD_SYSTEM_ERROR) - -/// The system_error class is used to represent system conditions that -/// prevent the library from operating correctly. -class system_error - : public std::exception -{ -public: - /// Construct with an error code. - system_error(const error_code& ec) - : code_(ec), - context_() - { - } - - /// Construct with an error code and context. - system_error(const error_code& ec, const std::string& context) - : code_(ec), - context_(context) - { - } - - /// Copy constructor. - system_error(const system_error& other) - : std::exception(other), - code_(other.code_), - context_(other.context_), - what_() - { - } - - /// Destructor. - virtual ~system_error() throw () - { - } - - /// Assignment operator. - system_error& operator=(const system_error& e) - { - context_ = e.context_; - code_ = e.code_; - what_.reset(); - return *this; - } - - /// Get a string representation of the exception. - virtual const char* what() const throw () - { -#if !defined(ASIO_NO_EXCEPTIONS) - try -#endif // !defined(ASIO_NO_EXCEPTIONS) - { - if (!what_.get()) - { - std::string tmp(context_); - if (tmp.length()) - tmp += ": "; - tmp += code_.message(); - what_.reset(new std::string(tmp)); - } - return what_->c_str(); - } -#if !defined(ASIO_NO_EXCEPTIONS) - catch (std::exception&) - { - return "system_error"; - } -#endif // !defined(ASIO_NO_EXCEPTIONS) - } - - /// Get the error code associated with the exception. - error_code code() const - { - return code_; - } - -private: - // The code associated with the error. - error_code code_; - - // The context associated with the error. - std::string context_; - - // The string representation of the error. - mutable asio::detail::scoped_ptr what_; -}; - -#endif // defined(ASIO_HAS_STD_SYSTEM_ERROR) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_SYSTEM_ERROR_HPP diff --git a/tools/sdk/include/asio/asio/system_executor.hpp b/tools/sdk/include/asio/asio/system_executor.hpp deleted file mode 100644 index b588a21b410..00000000000 --- a/tools/sdk/include/asio/asio/system_executor.hpp +++ /dev/null @@ -1,129 +0,0 @@ -// -// system_executor.hpp -// ~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SYSTEM_EXECUTOR_HPP -#define ASIO_SYSTEM_EXECUTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -class system_context; - -/// An executor that uses arbitrary threads. -/** - * The system executor represents an execution context where functions are - * permitted to run on arbitrary threads. The post() and defer() functions - * schedule the function to run on an unspecified system thread pool, and - * dispatch() invokes the function immediately. - */ -class system_executor -{ -public: - /// Obtain the underlying execution context. - system_context& context() const ASIO_NOEXCEPT; - - /// Inform the executor that it has some outstanding work to do. - /** - * For the system executor, this is a no-op. - */ - void on_work_started() const ASIO_NOEXCEPT - { - } - - /// Inform the executor that some work is no longer outstanding. - /** - * For the system executor, this is a no-op. - */ - void on_work_finished() const ASIO_NOEXCEPT - { - } - - /// Request the system executor to invoke the given function object. - /** - * This function is used to ask the executor to execute the given function - * object. The function object will always be executed inside this function. - * - * @param f The function object to be called. The executor will make - * a copy of the handler object as required. The function signature of the - * function object must be: @code void function(); @endcode - * - * @param a An allocator that may be used by the executor to allocate the - * internal storage needed for function invocation. - */ - template - void dispatch(ASIO_MOVE_ARG(Function) f, const Allocator& a) const; - - /// Request the system executor to invoke the given function object. - /** - * This function is used to ask the executor to execute the given function - * object. The function object will never be executed inside this function. - * Instead, it will be scheduled to run on an unspecified system thread pool. - * - * @param f The function object to be called. The executor will make - * a copy of the handler object as required. The function signature of the - * function object must be: @code void function(); @endcode - * - * @param a An allocator that may be used by the executor to allocate the - * internal storage needed for function invocation. - */ - template - void post(ASIO_MOVE_ARG(Function) f, const Allocator& a) const; - - /// Request the system executor to invoke the given function object. - /** - * This function is used to ask the executor to execute the given function - * object. The function object will never be executed inside this function. - * Instead, it will be scheduled to run on an unspecified system thread pool. - * - * @param f The function object to be called. The executor will make - * a copy of the handler object as required. The function signature of the - * function object must be: @code void function(); @endcode - * - * @param a An allocator that may be used by the executor to allocate the - * internal storage needed for function invocation. - */ - template - void defer(ASIO_MOVE_ARG(Function) f, const Allocator& a) const; - - /// Compare two executors for equality. - /** - * System executors always compare equal. - */ - friend bool operator==(const system_executor&, - const system_executor&) ASIO_NOEXCEPT - { - return true; - } - - /// Compare two executors for inequality. - /** - * System executors always compare equal. - */ - friend bool operator!=(const system_executor&, - const system_executor&) ASIO_NOEXCEPT - { - return false; - } -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/impl/system_executor.hpp" - -#endif // ASIO_SYSTEM_EXECUTOR_HPP diff --git a/tools/sdk/include/asio/asio/system_timer.hpp b/tools/sdk/include/asio/asio/system_timer.hpp deleted file mode 100644 index e75e7d4c12b..00000000000 --- a/tools/sdk/include/asio/asio/system_timer.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// -// system_timer.hpp -// ~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_SYSTEM_TIMER_HPP -#define ASIO_SYSTEM_TIMER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION) - -#include "asio/basic_waitable_timer.hpp" -#include "asio/detail/chrono.hpp" - -namespace asio { - -/// Typedef for a timer based on the system clock. -/** - * This typedef uses the C++11 @c <chrono> standard library facility, if - * available. Otherwise, it may use the Boost.Chrono library. To explicitly - * utilise Boost.Chrono, use the basic_waitable_timer template directly: - * @code - * typedef basic_waitable_timer timer; - * @endcode - */ -typedef basic_waitable_timer system_timer; - -} // namespace asio - -#endif // defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION) - -#endif // ASIO_SYSTEM_TIMER_HPP diff --git a/tools/sdk/include/asio/asio/thread.hpp b/tools/sdk/include/asio/asio/thread.hpp deleted file mode 100644 index eeeef7bb5cf..00000000000 --- a/tools/sdk/include/asio/asio/thread.hpp +++ /dev/null @@ -1,92 +0,0 @@ -// -// thread.hpp -// ~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_THREAD_HPP -#define ASIO_THREAD_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/thread.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// A simple abstraction for starting threads. -/** - * The asio::thread class implements the smallest possible subset of the - * functionality of boost::thread. It is intended to be used only for starting - * a thread and waiting for it to exit. If more extensive threading - * capabilities are required, you are strongly advised to use something else. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - * - * @par Example - * A typical use of asio::thread would be to launch a thread to run an - * io_context's event processing loop: - * - * @par - * @code asio::io_context io_context; - * // ... - * asio::thread t(boost::bind(&asio::io_context::run, &io_context)); - * // ... - * t.join(); @endcode - */ -class thread - : private noncopyable -{ -public: - /// Start a new thread that executes the supplied function. - /** - * This constructor creates a new thread that will execute the given function - * or function object. - * - * @param f The function or function object to be run in the thread. The - * function signature must be: @code void f(); @endcode - */ - template - explicit thread(Function f) - : impl_(f) - { - } - - /// Destructor. - ~thread() - { - } - - /// Wait for the thread to exit. - /** - * This function will block until the thread has exited. - * - * If this function is not called before the thread object is destroyed, the - * thread itself will continue to run until completion. You will, however, - * no longer have the ability to wait for it to exit. - */ - void join() - { - impl_.join(); - } - -private: - detail::thread impl_; -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_THREAD_HPP diff --git a/tools/sdk/include/asio/asio/thread_pool.hpp b/tools/sdk/include/asio/asio/thread_pool.hpp deleted file mode 100644 index f22f18d1177..00000000000 --- a/tools/sdk/include/asio/asio/thread_pool.hpp +++ /dev/null @@ -1,232 +0,0 @@ -// -// thread_pool.hpp -// ~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_THREAD_POOL_HPP -#define ASIO_THREAD_POOL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/scheduler.hpp" -#include "asio/detail/thread_group.hpp" -#include "asio/execution_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// A simple fixed-size thread pool. -/** - * The thread pool class is an execution context where functions are permitted - * to run on one of a fixed number of threads. - * - * @par Submitting tasks to the pool - * - * To submit functions to the io_context, use the @ref asio::dispatch, - * @ref asio::post or @ref asio::defer free functions. - * - * For example: - * - * @code void my_task() - * { - * ... - * } - * - * ... - * - * // Launch the pool with four threads. - * asio::thread_pool pool(4); - * - * // Submit a function to the pool. - * asio::post(pool, my_task); - * - * // Submit a lambda object to the pool. - * asio::post(pool, - * []() - * { - * ... - * }); - * - * // Wait for all tasks in the pool to complete. - * pool.join(); @endcode - */ -class thread_pool - : public execution_context -{ -public: - class executor_type; - - /// Constructs a pool with an automatically determined number of threads. - ASIO_DECL thread_pool(); - - /// Constructs a pool with a specified number of threads. - ASIO_DECL thread_pool(std::size_t num_threads); - - /// Destructor. - /** - * Automatically stops and joins the pool, if not explicitly done beforehand. - */ - ASIO_DECL ~thread_pool(); - - /// Obtains the executor associated with the pool. - executor_type get_executor() ASIO_NOEXCEPT; - - /// Stops the threads. - /** - * This function stops the threads as soon as possible. As a result of calling - * @c stop(), pending function objects may be never be invoked. - */ - ASIO_DECL void stop(); - - /// Joins the threads. - /** - * This function blocks until the threads in the pool have completed. If @c - * stop() is not called prior to @c join(), the @c join() call will wait - * until the pool has no more outstanding work. - */ - ASIO_DECL void join(); - -private: - friend class executor_type; - struct thread_function; - - // The underlying scheduler. - detail::scheduler& scheduler_; - - // The threads in the pool. - detail::thread_group threads_; -}; - -/// Executor used to submit functions to a thread pool. -class thread_pool::executor_type -{ -public: - /// Obtain the underlying execution context. - thread_pool& context() const ASIO_NOEXCEPT; - - /// Inform the thread pool that it has some outstanding work to do. - /** - * This function is used to inform the thread pool that some work has begun. - * This ensures that the thread pool's join() function will not return while - * the work is underway. - */ - void on_work_started() const ASIO_NOEXCEPT; - - /// Inform the thread pool that some work is no longer outstanding. - /** - * This function is used to inform the thread pool that some work has - * finished. Once the count of unfinished work reaches zero, the thread - * pool's join() function is permitted to exit. - */ - void on_work_finished() const ASIO_NOEXCEPT; - - /// Request the thread pool to invoke the given function object. - /** - * This function is used to ask the thread pool to execute the given function - * object. If the current thread belongs to the pool, @c dispatch() executes - * the function before returning. Otherwise, the function will be scheduled - * to run on the thread pool. - * - * @param f The function object to be called. The executor will make - * a copy of the handler object as required. The function signature of the - * function object must be: @code void function(); @endcode - * - * @param a An allocator that may be used by the executor to allocate the - * internal storage needed for function invocation. - */ - template - void dispatch(ASIO_MOVE_ARG(Function) f, const Allocator& a) const; - - /// Request the thread pool to invoke the given function object. - /** - * This function is used to ask the thread pool to execute the given function - * object. The function object will never be executed inside @c post(). - * Instead, it will be scheduled to run on the thread pool. - * - * @param f The function object to be called. The executor will make - * a copy of the handler object as required. The function signature of the - * function object must be: @code void function(); @endcode - * - * @param a An allocator that may be used by the executor to allocate the - * internal storage needed for function invocation. - */ - template - void post(ASIO_MOVE_ARG(Function) f, const Allocator& a) const; - - /// Request the thread pool to invoke the given function object. - /** - * This function is used to ask the thread pool to execute the given function - * object. The function object will never be executed inside @c defer(). - * Instead, it will be scheduled to run on the thread pool. - * - * If the current thread belongs to the thread pool, @c defer() will delay - * scheduling the function object until the current thread returns control to - * the pool. - * - * @param f The function object to be called. The executor will make - * a copy of the handler object as required. The function signature of the - * function object must be: @code void function(); @endcode - * - * @param a An allocator that may be used by the executor to allocate the - * internal storage needed for function invocation. - */ - template - void defer(ASIO_MOVE_ARG(Function) f, const Allocator& a) const; - - /// Determine whether the thread pool is running in the current thread. - /** - * @return @c true if the current thread belongs to the pool. Otherwise - * returns @c false. - */ - bool running_in_this_thread() const ASIO_NOEXCEPT; - - /// Compare two executors for equality. - /** - * Two executors are equal if they refer to the same underlying thread pool. - */ - friend bool operator==(const executor_type& a, - const executor_type& b) ASIO_NOEXCEPT - { - return &a.pool_ == &b.pool_; - } - - /// Compare two executors for inequality. - /** - * Two executors are equal if they refer to the same underlying thread pool. - */ - friend bool operator!=(const executor_type& a, - const executor_type& b) ASIO_NOEXCEPT - { - return &a.pool_ != &b.pool_; - } - -private: - friend class thread_pool; - - // Constructor. - explicit executor_type(thread_pool& p) : pool_(p) {} - - // The underlying thread pool. - thread_pool& pool_; -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/impl/thread_pool.hpp" -#if defined(ASIO_HEADER_ONLY) -# include "asio/impl/thread_pool.ipp" -#endif // defined(ASIO_HEADER_ONLY) - -#endif // ASIO_THREAD_POOL_HPP diff --git a/tools/sdk/include/asio/asio/time_traits.hpp b/tools/sdk/include/asio/asio/time_traits.hpp deleted file mode 100644 index 72f4aabe782..00000000000 --- a/tools/sdk/include/asio/asio/time_traits.hpp +++ /dev/null @@ -1,86 +0,0 @@ -// -// time_traits.hpp -// ~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_TIME_TRAITS_HPP -#define ASIO_TIME_TRAITS_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/socket_types.hpp" // Must come before posix_time. - -#if defined(ASIO_HAS_BOOST_DATE_TIME) \ - || defined(GENERATING_DOCUMENTATION) - -#include - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Time traits suitable for use with the deadline timer. -template -struct time_traits; - -/// Time traits specialised for posix_time. -template <> -struct time_traits -{ - /// The time type. - typedef boost::posix_time::ptime time_type; - - /// The duration type. - typedef boost::posix_time::time_duration duration_type; - - /// Get the current time. - static time_type now() - { -#if defined(BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK) - return boost::posix_time::microsec_clock::universal_time(); -#else // defined(BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK) - return boost::posix_time::second_clock::universal_time(); -#endif // defined(BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK) - } - - /// Add a duration to a time. - static time_type add(const time_type& t, const duration_type& d) - { - return t + d; - } - - /// Subtract one time from another. - static duration_type subtract(const time_type& t1, const time_type& t2) - { - return t1 - t2; - } - - /// Test whether one time is less than another. - static bool less_than(const time_type& t1, const time_type& t2) - { - return t1 < t2; - } - - /// Convert to POSIX duration type. - static boost::posix_time::time_duration to_posix_duration( - const duration_type& d) - { - return d; - } -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_BOOST_DATE_TIME) - // || defined(GENERATING_DOCUMENTATION) - -#endif // ASIO_TIME_TRAITS_HPP diff --git a/tools/sdk/include/asio/asio/ts/buffer.hpp b/tools/sdk/include/asio/asio/ts/buffer.hpp deleted file mode 100644 index faf08a474b0..00000000000 --- a/tools/sdk/include/asio/asio/ts/buffer.hpp +++ /dev/null @@ -1,24 +0,0 @@ -// -// ts/buffer.hpp -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_TS_BUFFER_HPP -#define ASIO_TS_BUFFER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/buffer.hpp" -#include "asio/completion_condition.hpp" -#include "asio/read.hpp" -#include "asio/write.hpp" -#include "asio/read_until.hpp" - -#endif // ASIO_TS_BUFFER_HPP diff --git a/tools/sdk/include/asio/asio/ts/executor.hpp b/tools/sdk/include/asio/asio/ts/executor.hpp deleted file mode 100644 index 8669cb6c577..00000000000 --- a/tools/sdk/include/asio/asio/ts/executor.hpp +++ /dev/null @@ -1,35 +0,0 @@ -// -// ts/executor.hpp -// ~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_TS_EXECUTOR_HPP -#define ASIO_TS_EXECUTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/handler_type.hpp" -#include "asio/async_result.hpp" -#include "asio/associated_allocator.hpp" -#include "asio/execution_context.hpp" -#include "asio/is_executor.hpp" -#include "asio/associated_executor.hpp" -#include "asio/bind_executor.hpp" -#include "asio/executor_work_guard.hpp" -#include "asio/system_executor.hpp" -#include "asio/executor.hpp" -#include "asio/dispatch.hpp" -#include "asio/post.hpp" -#include "asio/defer.hpp" -#include "asio/strand.hpp" -#include "asio/packaged_task.hpp" -#include "asio/use_future.hpp" - -#endif // ASIO_TS_EXECUTOR_HPP diff --git a/tools/sdk/include/asio/asio/ts/internet.hpp b/tools/sdk/include/asio/asio/ts/internet.hpp deleted file mode 100644 index 6282e905a02..00000000000 --- a/tools/sdk/include/asio/asio/ts/internet.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// -// ts/internet.hpp -// ~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_TS_INTERNET_HPP -#define ASIO_TS_INTERNET_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/ip/address.hpp" -#include "asio/ip/address_v4.hpp" -#include "asio/ip/address_v4_iterator.hpp" -#include "asio/ip/address_v4_range.hpp" -#include "asio/ip/address_v6.hpp" -#include "asio/ip/address_v6_iterator.hpp" -#include "asio/ip/address_v6_range.hpp" -#include "asio/ip/bad_address_cast.hpp" -#include "asio/ip/basic_endpoint.hpp" -#include "asio/ip/basic_resolver_query.hpp" -#include "asio/ip/basic_resolver_entry.hpp" -#include "asio/ip/basic_resolver_iterator.hpp" -#include "asio/ip/basic_resolver.hpp" -#include "asio/ip/host_name.hpp" -#include "asio/ip/network_v4.hpp" -#include "asio/ip/network_v6.hpp" -#include "asio/ip/tcp.hpp" -#include "asio/ip/udp.hpp" -#include "asio/ip/v6_only.hpp" -#include "asio/ip/unicast.hpp" -#include "asio/ip/multicast.hpp" - -#endif // ASIO_TS_INTERNET_HPP diff --git a/tools/sdk/include/asio/asio/ts/io_context.hpp b/tools/sdk/include/asio/asio/ts/io_context.hpp deleted file mode 100644 index b967cd63edf..00000000000 --- a/tools/sdk/include/asio/asio/ts/io_context.hpp +++ /dev/null @@ -1,20 +0,0 @@ -// -// ts/io_context.hpp -// ~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_TS_IO_CONTEXT_HPP -#define ASIO_TS_IO_CONTEXT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/io_context.hpp" - -#endif // ASIO_TS_IO_CONTEXT_HPP diff --git a/tools/sdk/include/asio/asio/ts/net.hpp b/tools/sdk/include/asio/asio/ts/net.hpp deleted file mode 100644 index f96075d9fe6..00000000000 --- a/tools/sdk/include/asio/asio/ts/net.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// -// ts/net.hpp -// ~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_TS_NET_HPP -#define ASIO_TS_NET_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/ts/netfwd.hpp" -#include "asio/ts/executor.hpp" -#include "asio/ts/io_context.hpp" -#include "asio/ts/timer.hpp" -#include "asio/ts/buffer.hpp" -#include "asio/ts/socket.hpp" -#include "asio/ts/internet.hpp" - -#endif // ASIO_TS_NET_HPP diff --git a/tools/sdk/include/asio/asio/ts/netfwd.hpp b/tools/sdk/include/asio/asio/ts/netfwd.hpp deleted file mode 100644 index 657a21d3727..00000000000 --- a/tools/sdk/include/asio/asio/ts/netfwd.hpp +++ /dev/null @@ -1,197 +0,0 @@ -// -// ts/netfwd.hpp -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_TS_NETFWD_HPP -#define ASIO_TS_NETFWD_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_CHRONO) -# include "asio/detail/chrono.hpp" -#endif // defined(ASIO_HAS_CHRONO) - -#if defined(ASIO_HAS_BOOST_DATE_TIME) -# include "asio/detail/date_time_fwd.hpp" -#endif // defined(ASIO_HAS_BOOST_DATE_TIME) - -#if !defined(GENERATING_DOCUMENTATION) - -#include "asio/detail/push_options.hpp" - -namespace asio { - -class execution_context; - -template -class executor_binder; - -template -class executor_work_guard; - -class system_executor; - -class executor; - -template -class strand; - -class io_context; - -template -struct wait_traits; - -#if defined(ASIO_HAS_BOOST_DATE_TIME) - -template -struct time_traits; - -#endif // defined(ASIO_HAS_BOOST_DATE_TIME) - -#if defined(ASIO_ENABLE_OLD_SERVICES) - -template -class waitable_timer_service; - -#if defined(ASIO_HAS_BOOST_DATE_TIME) - -template -class deadline_timer_service; - -#endif // defined(ASIO_HAS_BOOST_DATE_TIME) - -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#if !defined(ASIO_BASIC_WAITABLE_TIMER_FWD_DECL) -#define ASIO_BASIC_WAITABLE_TIMER_FWD_DECL - -template - ASIO_SVC_TPARAM_DEF2(= waitable_timer_service)> -class basic_waitable_timer; - -#endif // !defined(ASIO_BASIC_WAITABLE_TIMER_FWD_DECL) - -#if defined(ASIO_HAS_CHRONO) - -typedef basic_waitable_timer system_timer; - -typedef basic_waitable_timer steady_timer; - -typedef basic_waitable_timer - high_resolution_timer; - -#endif // defined(ASIO_HAS_CHRONO) - -template -class basic_socket; - -template -class basic_datagram_socket; - -template -class basic_stream_socket; - -template -class basic_socket_acceptor; - -#if !defined(ASIO_BASIC_SOCKET_STREAMBUF_FWD_DECL) -#define ASIO_BASIC_SOCKET_STREAMBUF_FWD_DECL - -// Forward declaration with defaulted arguments. -template ), -#if defined(ASIO_HAS_BOOST_DATE_TIME) \ - || defined(GENERATING_DOCUMENTATION) - typename Clock = boost::posix_time::ptime, - typename WaitTraits = time_traits - ASIO_SVC_TPARAM1_DEF2(= deadline_timer_service)> -#else - typename Clock = chrono::steady_clock, - typename WaitTraits = wait_traits - ASIO_SVC_TPARAM1_DEF1(= steady_timer::service_type)> -#endif -class basic_socket_streambuf; - -#endif // !defined(ASIO_BASIC_SOCKET_STREAMBUF_FWD_DECL) - -#if !defined(ASIO_BASIC_SOCKET_IOSTREAM_FWD_DECL) -#define ASIO_BASIC_SOCKET_IOSTREAM_FWD_DECL - -// Forward declaration with defaulted arguments. -template ), -#if defined(ASIO_HAS_BOOST_DATE_TIME) \ - || defined(GENERATING_DOCUMENTATION) - typename Clock = boost::posix_time::ptime, - typename WaitTraits = time_traits - ASIO_SVC_TPARAM1_DEF2(= deadline_timer_service)> -#else - typename Clock = chrono::steady_clock, - typename WaitTraits = wait_traits - ASIO_SVC_TPARAM1_DEF1(= steady_timer::service_type)> -#endif -class basic_socket_iostream; - -#endif // !defined(ASIO_BASIC_SOCKET_IOSTREAM_FWD_DECL) - -namespace ip { - -class address; - -class address_v4; - -class address_v6; - -template -class basic_address_iterator; - -typedef basic_address_iterator address_v4_iterator; - -typedef basic_address_iterator address_v6_iterator; - -template -class basic_address_range; - -typedef basic_address_range address_v4_range; - -typedef basic_address_range address_v6_range; - -class network_v4; - -class network_v6; - -template -class basic_endpoint; - -template -class basic_resolver_entry; - -template -class basic_resolver_results; - -template -class basic_resolver; - -class tcp; - -class udp; - -} // namespace ip -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // !defined(GENERATING_DOCUMENTATION) - -#endif // ASIO_TS_NETFWD_HPP diff --git a/tools/sdk/include/asio/asio/ts/socket.hpp b/tools/sdk/include/asio/asio/ts/socket.hpp deleted file mode 100644 index a542734856e..00000000000 --- a/tools/sdk/include/asio/asio/ts/socket.hpp +++ /dev/null @@ -1,27 +0,0 @@ -// -// ts/socket.hpp -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_TS_SOCKET_HPP -#define ASIO_TS_SOCKET_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/socket_base.hpp" -#include "asio/basic_socket.hpp" -#include "asio/basic_datagram_socket.hpp" -#include "asio/basic_stream_socket.hpp" -#include "asio/basic_socket_acceptor.hpp" -#include "asio/basic_socket_streambuf.hpp" -#include "asio/basic_socket_iostream.hpp" -#include "asio/connect.hpp" - -#endif // ASIO_TS_SOCKET_HPP diff --git a/tools/sdk/include/asio/asio/ts/timer.hpp b/tools/sdk/include/asio/asio/ts/timer.hpp deleted file mode 100644 index 872be8bfd70..00000000000 --- a/tools/sdk/include/asio/asio/ts/timer.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// -// ts/timer.hpp -// ~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_TS_TIMER_HPP -#define ASIO_TS_TIMER_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/chrono.hpp" - -#include "asio/wait_traits.hpp" -#include "asio/basic_waitable_timer.hpp" -#include "asio/system_timer.hpp" -#include "asio/steady_timer.hpp" -#include "asio/high_resolution_timer.hpp" - -#endif // ASIO_TS_TIMER_HPP diff --git a/tools/sdk/include/asio/asio/unyield.hpp b/tools/sdk/include/asio/asio/unyield.hpp deleted file mode 100644 index de3ed0275e4..00000000000 --- a/tools/sdk/include/asio/asio/unyield.hpp +++ /dev/null @@ -1,21 +0,0 @@ -// -// unyield.hpp -// ~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifdef reenter -# undef reenter -#endif - -#ifdef yield -# undef yield -#endif - -#ifdef fork -# undef fork -#endif diff --git a/tools/sdk/include/asio/asio/use_future.hpp b/tools/sdk/include/asio/asio/use_future.hpp deleted file mode 100644 index 3f9c6968790..00000000000 --- a/tools/sdk/include/asio/asio/use_future.hpp +++ /dev/null @@ -1,159 +0,0 @@ -// -// use_future.hpp -// ~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_USE_FUTURE_HPP -#define ASIO_USE_FUTURE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_STD_FUTURE) \ - || defined(GENERATING_DOCUMENTATION) - -#include -#include "asio/detail/type_traits.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -template -class packaged_token; - -template -class packaged_handler; - -} // namespace detail - -/// Class used to specify that an asynchronous operation should return a future. -/** - * The use_future_t class is used to indicate that an asynchronous operation - * should return a std::future object. A use_future_t object may be passed as a - * handler to an asynchronous operation, typically using the special value @c - * asio::use_future. For example: - * - * @code std::future my_future - * = my_socket.async_read_some(my_buffer, asio::use_future); @endcode - * - * The initiating function (async_read_some in the above example) returns a - * future that will receive the result of the operation. If the operation - * completes with an error_code indicating failure, it is converted into a - * system_error and passed back to the caller via the future. - */ -template > -class use_future_t -{ -public: - /// The allocator type. The allocator is used when constructing the - /// @c std::promise object for a given asynchronous operation. - typedef Allocator allocator_type; - - /// Construct using default-constructed allocator. - ASIO_CONSTEXPR use_future_t() - { - } - - /// Construct using specified allocator. - explicit use_future_t(const Allocator& allocator) - : allocator_(allocator) - { - } - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use rebind().) Specify an alternate allocator. - template - use_future_t operator[](const OtherAllocator& allocator) const - { - return use_future_t(allocator); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Specify an alternate allocator. - template - use_future_t rebind(const OtherAllocator& allocator) const - { - return use_future_t(allocator); - } - - /// Obtain allocator. - allocator_type get_allocator() const - { - return allocator_; - } - - /// Wrap a function object in a packaged task. - /** - * The @c package function is used to adapt a function object as a packaged - * task. When this adapter is passed as a completion token to an asynchronous - * operation, the result of the function object is retuned via a std::future. - * - * @par Example - * - * @code std::future fut = - * my_socket.async_read_some(buffer, - * use_future([](asio::error_code ec, std::size_t n) - * { - * return ec ? 0 : n; - * })); - * ... - * std::size_t n = fut.get(); @endcode - */ - template -#if defined(GENERATING_DOCUMENTATION) - unspecified -#else // defined(GENERATING_DOCUMENTATION) - detail::packaged_token::type, Allocator> -#endif // defined(GENERATING_DOCUMENTATION) - operator()(ASIO_MOVE_ARG(Function) f) const; - -private: - // Helper type to ensure that use_future can be constexpr default-constructed - // even when std::allocator can't be. - struct std_allocator_void - { - ASIO_CONSTEXPR std_allocator_void() - { - } - - operator std::allocator() const - { - return std::allocator(); - } - }; - - typename conditional< - is_same, Allocator>::value, - std_allocator_void, Allocator>::type allocator_; -}; - -/// A special value, similar to std::nothrow. -/** - * See the documentation for asio::use_future_t for a usage example. - */ -#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) -constexpr use_future_t<> use_future; -#elif defined(ASIO_MSVC) -__declspec(selectany) use_future_t<> use_future; -#endif - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/impl/use_future.hpp" - -#endif // defined(ASIO_HAS_STD_FUTURE) - // || defined(GENERATING_DOCUMENTATION) - -#endif // ASIO_USE_FUTURE_HPP diff --git a/tools/sdk/include/asio/asio/uses_executor.hpp b/tools/sdk/include/asio/asio/uses_executor.hpp deleted file mode 100644 index e985c28245f..00000000000 --- a/tools/sdk/include/asio/asio/uses_executor.hpp +++ /dev/null @@ -1,71 +0,0 @@ -// -// uses_executor.hpp -// ~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_USES_EXECUTOR_HPP -#define ASIO_USES_EXECUTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/detail/type_traits.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// A special type, similar to std::nothrow_t, used to disambiguate -/// constructors that accept executor arguments. -/** - * The executor_arg_t struct is an empty structure type used as a unique type - * to disambiguate constructor and function overloading. Specifically, some - * types have constructors with executor_arg_t as the first argument, - * immediately followed by an argument of a type that satisfies the Executor - * type requirements. - */ -struct executor_arg_t -{ - /// Constructor. - ASIO_CONSTEXPR executor_arg_t() ASIO_NOEXCEPT - { - } -}; - -/// A special value, similar to std::nothrow, used to disambiguate constructors -/// that accept executor arguments. -/** - * See asio::executor_arg_t and asio::uses_executor - * for more information. - */ -#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) -constexpr executor_arg_t executor_arg; -#elif defined(ASIO_MSVC) -__declspec(selectany) executor_arg_t executor_arg; -#endif - -/// The uses_executor trait detects whether a type T has an associated executor -/// that is convertible from type Executor. -/** - * Meets the BinaryTypeTrait requirements. The Asio library provides a - * definition that is derived from false_type. A program may specialize this - * template to derive from true_type for a user-defined type T that can be - * constructed with an executor, where the first argument of a constructor has - * type executor_arg_t and the second argument is convertible from type - * Executor. - */ -template -struct uses_executor : false_type {}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_USES_EXECUTOR_HPP diff --git a/tools/sdk/include/asio/asio/version.hpp b/tools/sdk/include/asio/asio/version.hpp deleted file mode 100644 index ee0313f7366..00000000000 --- a/tools/sdk/include/asio/asio/version.hpp +++ /dev/null @@ -1,23 +0,0 @@ -// -// version.hpp -// ~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_VERSION_HPP -#define ASIO_VERSION_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -// ASIO_VERSION % 100 is the sub-minor version -// ASIO_VERSION / 100 % 1000 is the minor version -// ASIO_VERSION / 100000 is the major version -#define ASIO_VERSION 101200 // 1.12.0 - -#endif // ASIO_VERSION_HPP diff --git a/tools/sdk/include/asio/asio/wait_traits.hpp b/tools/sdk/include/asio/asio/wait_traits.hpp deleted file mode 100644 index a6016f7c037..00000000000 --- a/tools/sdk/include/asio/asio/wait_traits.hpp +++ /dev/null @@ -1,56 +0,0 @@ -// -// wait_traits.hpp -// ~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_WAIT_TRAITS_HPP -#define ASIO_WAIT_TRAITS_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Wait traits suitable for use with the basic_waitable_timer class template. -template -struct wait_traits -{ - /// Convert a clock duration into a duration used for waiting. - /** - * @returns @c d. - */ - static typename Clock::duration to_wait_duration( - const typename Clock::duration& d) - { - return d; - } - - /// Convert a clock duration into a duration used for waiting. - /** - * @returns @c d. - */ - static typename Clock::duration to_wait_duration( - const typename Clock::time_point& t) - { - typename Clock::time_point now = Clock::now(); - if (now + (Clock::duration::max)() < t) - return (Clock::duration::max)(); - if (now + (Clock::duration::min)() > t) - return (Clock::duration::min)(); - return t - now; - } -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_WAIT_TRAITS_HPP diff --git a/tools/sdk/include/asio/asio/waitable_timer_service.hpp b/tools/sdk/include/asio/asio/waitable_timer_service.hpp deleted file mode 100644 index 75e496f8d28..00000000000 --- a/tools/sdk/include/asio/asio/waitable_timer_service.hpp +++ /dev/null @@ -1,210 +0,0 @@ -// -// waitable_timer_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_WAITABLE_TIMER_SERVICE_HPP -#define ASIO_WAITABLE_TIMER_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) - -#include -#include "asio/async_result.hpp" -#include "asio/detail/chrono_time_traits.hpp" -#include "asio/detail/deadline_timer_service.hpp" -#include "asio/io_context.hpp" -#include "asio/wait_traits.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Default service implementation for a timer. -template > -class waitable_timer_service -#if defined(GENERATING_DOCUMENTATION) - : public asio::io_context::service -#else - : public asio::detail::service_base< - waitable_timer_service > -#endif -{ -public: -#if defined(GENERATING_DOCUMENTATION) - /// The unique service identifier. - static asio::io_context::id id; -#endif - - /// The clock type. - typedef Clock clock_type; - - /// The duration type of the clock. - typedef typename clock_type::duration duration; - - /// The time point type of the clock. - typedef typename clock_type::time_point time_point; - - /// The wait traits type. - typedef WaitTraits traits_type; - -private: - // The type of the platform-specific implementation. - typedef detail::deadline_timer_service< - detail::chrono_time_traits > service_impl_type; - -public: - /// The implementation type of the waitable timer. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined implementation_type; -#else - typedef typename service_impl_type::implementation_type implementation_type; -#endif - - /// Construct a new timer service for the specified io_context. - explicit waitable_timer_service(asio::io_context& io_context) - : asio::detail::service_base< - waitable_timer_service >(io_context), - service_impl_(io_context) - { - } - - /// Construct a new timer implementation. - void construct(implementation_type& impl) - { - service_impl_.construct(impl); - } - - /// Destroy a timer implementation. - void destroy(implementation_type& impl) - { - service_impl_.destroy(impl); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a new timer implementation. - void move_construct(implementation_type& impl, - implementation_type& other_impl) - { - service_impl_.move_construct(impl, other_impl); - } - - /// Move-assign from another timer implementation. - void move_assign(implementation_type& impl, - waitable_timer_service& other_service, - implementation_type& other_impl) - { - service_impl_.move_assign(impl, other_service.service_impl_, other_impl); - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Cancel any asynchronous wait operations associated with the timer. - std::size_t cancel(implementation_type& impl, asio::error_code& ec) - { - return service_impl_.cancel(impl, ec); - } - - /// Cancels one asynchronous wait operation associated with the timer. - std::size_t cancel_one(implementation_type& impl, - asio::error_code& ec) - { - return service_impl_.cancel_one(impl, ec); - } - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use expiry().) Get the expiry time for the timer as an - /// absolute time. - time_point expires_at(const implementation_type& impl) const - { - return service_impl_.expiry(impl); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Get the expiry time for the timer as an absolute time. - time_point expiry(const implementation_type& impl) const - { - return service_impl_.expiry(impl); - } - - /// Set the expiry time for the timer as an absolute time. - std::size_t expires_at(implementation_type& impl, - const time_point& expiry_time, asio::error_code& ec) - { - return service_impl_.expires_at(impl, expiry_time, ec); - } - - /// Set the expiry time for the timer relative to now. - std::size_t expires_after(implementation_type& impl, - const duration& expiry_time, asio::error_code& ec) - { - return service_impl_.expires_after(impl, expiry_time, ec); - } - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use expiry().) Get the expiry time for the timer relative to - /// now. - duration expires_from_now(const implementation_type& impl) const - { - typedef detail::chrono_time_traits traits; - return traits::subtract(service_impl_.expiry(impl), traits::now()); - } - - /// (Deprecated: Use expires_after().) Set the expiry time for the timer - /// relative to now. - std::size_t expires_from_now(implementation_type& impl, - const duration& expiry_time, asio::error_code& ec) - { - return service_impl_.expires_after(impl, expiry_time, ec); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - // Perform a blocking wait on the timer. - void wait(implementation_type& impl, asio::error_code& ec) - { - service_impl_.wait(impl, ec); - } - - // Start an asynchronous wait on the timer. - template - ASIO_INITFN_RESULT_TYPE(WaitHandler, - void (asio::error_code)) - async_wait(implementation_type& impl, - ASIO_MOVE_ARG(WaitHandler) handler) - { - async_completion init(handler); - - service_impl_.async_wait(impl, init.completion_handler); - - return init.result.get(); - } - -private: - // Destroy all user-defined handler objects owned by the service. - void shutdown() - { - service_impl_.shutdown(); - } - - // The platform-specific implementation. - service_impl_type service_impl_; -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_WAITABLE_TIMER_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/windows/basic_handle.hpp b/tools/sdk/include/asio/asio/windows/basic_handle.hpp deleted file mode 100644 index f7c9d0d0368..00000000000 --- a/tools/sdk/include/asio/asio/windows/basic_handle.hpp +++ /dev/null @@ -1,273 +0,0 @@ -// -// windows/basic_handle.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_WINDOWS_BASIC_HANDLE_HPP -#define ASIO_WINDOWS_BASIC_HANDLE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) - -#if defined(ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE) \ - || defined(ASIO_HAS_WINDOWS_STREAM_HANDLE) \ - || defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) \ - || defined(GENERATING_DOCUMENTATION) - -#include "asio/basic_io_object.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/error.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace windows { - -/// Provides Windows handle functionality. -/** - * The windows::basic_handle class template provides the ability to wrap a - * Windows handle. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -template -class basic_handle - : public basic_io_object -{ -public: - /// The native representation of a handle. - typedef typename HandleService::native_handle_type native_handle_type; - - /// A basic_handle is always the lowest layer. - typedef basic_handle lowest_layer_type; - - /// Construct a basic_handle without opening it. - /** - * This constructor creates a handle without opening it. - * - * @param io_context The io_context object that the handle will use to - * dispatch handlers for any asynchronous operations performed on the handle. - */ - explicit basic_handle(asio::io_context& io_context) - : basic_io_object(io_context) - { - } - - /// Construct a basic_handle on an existing native handle. - /** - * This constructor creates a handle object to hold an existing native handle. - * - * @param io_context The io_context object that the handle will use to - * dispatch handlers for any asynchronous operations performed on the handle. - * - * @param handle A native handle. - * - * @throws asio::system_error Thrown on failure. - */ - basic_handle(asio::io_context& io_context, - const native_handle_type& handle) - : basic_io_object(io_context) - { - asio::error_code ec; - this->get_service().assign(this->get_implementation(), handle, ec); - asio::detail::throw_error(ec, "assign"); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a basic_handle from another. - /** - * This constructor moves a handle from one object to another. - * - * @param other The other basic_handle object from which the move will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_handle(io_context&) constructor. - */ - basic_handle(basic_handle&& other) - : basic_io_object( - ASIO_MOVE_CAST(basic_handle)(other)) - { - } - - /// Move-assign a basic_handle from another. - /** - * This assignment operator moves a handle from one object to another. - * - * @param other The other basic_handle object from which the move will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_handle(io_context&) constructor. - */ - basic_handle& operator=(basic_handle&& other) - { - basic_io_object::operator=( - ASIO_MOVE_CAST(basic_handle)(other)); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Get a reference to the lowest layer. - /** - * This function returns a reference to the lowest layer in a stack of - * layers. Since a basic_handle cannot contain any further layers, it simply - * returns a reference to itself. - * - * @return A reference to the lowest layer in the stack of layers. Ownership - * is not transferred to the caller. - */ - lowest_layer_type& lowest_layer() - { - return *this; - } - - /// Get a const reference to the lowest layer. - /** - * This function returns a const reference to the lowest layer in a stack of - * layers. Since a basic_handle cannot contain any further layers, it simply - * returns a reference to itself. - * - * @return A const reference to the lowest layer in the stack of layers. - * Ownership is not transferred to the caller. - */ - const lowest_layer_type& lowest_layer() const - { - return *this; - } - - /// Assign an existing native handle to the handle. - /* - * This function opens the handle to hold an existing native handle. - * - * @param handle A native handle. - * - * @throws asio::system_error Thrown on failure. - */ - void assign(const native_handle_type& handle) - { - asio::error_code ec; - this->get_service().assign(this->get_implementation(), handle, ec); - asio::detail::throw_error(ec, "assign"); - } - - /// Assign an existing native handle to the handle. - /* - * This function opens the handle to hold an existing native handle. - * - * @param handle A native handle. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID assign(const native_handle_type& handle, - asio::error_code& ec) - { - this->get_service().assign(this->get_implementation(), handle, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Determine whether the handle is open. - bool is_open() const - { - return this->get_service().is_open(this->get_implementation()); - } - - /// Close the handle. - /** - * This function is used to close the handle. Any asynchronous read or write - * operations will be cancelled immediately, and will complete with the - * asio::error::operation_aborted error. - * - * @throws asio::system_error Thrown on failure. - */ - void close() - { - asio::error_code ec; - this->get_service().close(this->get_implementation(), ec); - asio::detail::throw_error(ec, "close"); - } - - /// Close the handle. - /** - * This function is used to close the handle. Any asynchronous read or write - * operations will be cancelled immediately, and will complete with the - * asio::error::operation_aborted error. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID close(asio::error_code& ec) - { - this->get_service().close(this->get_implementation(), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get the native handle representation. - /** - * This function may be used to obtain the underlying representation of the - * handle. This is intended to allow access to native handle functionality - * that is not otherwise provided. - */ - native_handle_type native_handle() - { - return this->get_service().native_handle(this->get_implementation()); - } - - /// Cancel all asynchronous operations associated with the handle. - /** - * This function causes all outstanding asynchronous read or write operations - * to finish immediately, and the handlers for cancelled operations will be - * passed the asio::error::operation_aborted error. - * - * @throws asio::system_error Thrown on failure. - */ - void cancel() - { - asio::error_code ec; - this->get_service().cancel(this->get_implementation(), ec); - asio::detail::throw_error(ec, "cancel"); - } - - /// Cancel all asynchronous operations associated with the handle. - /** - * This function causes all outstanding asynchronous read or write operations - * to finish immediately, and the handlers for cancelled operations will be - * passed the asio::error::operation_aborted error. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID cancel(asio::error_code& ec) - { - this->get_service().cancel(this->get_implementation(), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - -protected: - /// Protected destructor to prevent deletion through this type. - ~basic_handle() - { - } -}; - -} // namespace windows -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE) - // || defined(ASIO_HAS_WINDOWS_STREAM_HANDLE) - // || defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) - // || defined(GENERATING_DOCUMENTATION) - -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_WINDOWS_BASIC_HANDLE_HPP diff --git a/tools/sdk/include/asio/asio/windows/basic_object_handle.hpp b/tools/sdk/include/asio/asio/windows/basic_object_handle.hpp deleted file mode 100644 index 4b2968460b7..00000000000 --- a/tools/sdk/include/asio/asio/windows/basic_object_handle.hpp +++ /dev/null @@ -1,182 +0,0 @@ -// -// windows/basic_object_handle.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2011 Boris Schaeling (boris@highscore.de) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_WINDOWS_BASIC_OBJECT_HANDLE_HPP -#define ASIO_WINDOWS_BASIC_OBJECT_HANDLE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) - -#if defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) \ - || defined(GENERATING_DOCUMENTATION) - -#include "asio/detail/throw_error.hpp" -#include "asio/error.hpp" -#include "asio/windows/basic_handle.hpp" -#include "asio/windows/object_handle_service.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace windows { - -/// Provides object-oriented handle functionality. -/** - * The windows::basic_object_handle class template provides asynchronous and - * blocking object-oriented handle functionality. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -template -class basic_object_handle - : public basic_handle -{ -public: - /// The native representation of a handle. - typedef typename ObjectHandleService::native_handle_type native_handle_type; - - /// Construct a basic_object_handle without opening it. - /** - * This constructor creates an object handle without opening it. - * - * @param io_context The io_context object that the object handle will use to - * dispatch handlers for any asynchronous operations performed on the handle. - */ - explicit basic_object_handle(asio::io_context& io_context) - : basic_handle(io_context) - { - } - - /// Construct a basic_object_handle on an existing native handle. - /** - * This constructor creates an object handle object to hold an existing native - * handle. - * - * @param io_context The io_context object that the object handle will use to - * dispatch handlers for any asynchronous operations performed on the handle. - * - * @param native_handle The new underlying handle implementation. - * - * @throws asio::system_error Thrown on failure. - */ - basic_object_handle(asio::io_context& io_context, - const native_handle_type& native_handle) - : basic_handle(io_context, native_handle) - { - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a basic_object_handle from another. - /** - * This constructor moves an object handle from one object to another. - * - * @param other The other basic_object_handle object from which the move will - * occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_object_handle(io_context&) constructor. - */ - basic_object_handle(basic_object_handle&& other) - : basic_handle( - ASIO_MOVE_CAST(basic_object_handle)(other)) - { - } - - /// Move-assign a basic_object_handle from another. - /** - * This assignment operator moves an object handle from one object to another. - * - * @param other The other basic_object_handle object from which the move will - * occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_object_handle(io_context&) constructor. - */ - basic_object_handle& operator=(basic_object_handle&& other) - { - basic_handle::operator=( - ASIO_MOVE_CAST(basic_object_handle)(other)); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Perform a blocking wait on the object handle. - /** - * This function is used to wait for the object handle to be set to the - * signalled state. This function blocks and does not return until the object - * handle has been set to the signalled state. - * - * @throws asio::system_error Thrown on failure. - */ - void wait() - { - asio::error_code ec; - this->get_service().wait(this->get_implementation(), ec); - asio::detail::throw_error(ec, "wait"); - } - - /// Perform a blocking wait on the object handle. - /** - * This function is used to wait for the object handle to be set to the - * signalled state. This function blocks and does not return until the object - * handle has been set to the signalled state. - * - * @param ec Set to indicate what error occurred, if any. - */ - void wait(asio::error_code& ec) - { - this->get_service().wait(this->get_implementation(), ec); - } - - /// Start an asynchronous wait on the object handle. - /** - * This function is be used to initiate an asynchronous wait against the - * object handle. It always returns immediately. - * - * @param handler The handler to be called when the object handle is set to - * the signalled state. Copies will be made of the handler as required. The - * function signature of the handler must be: - * @code void handler( - * const asio::error_code& error // Result of operation. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - */ - template - ASIO_INITFN_RESULT_TYPE(WaitHandler, - void (asio::error_code)) - async_wait(ASIO_MOVE_ARG(WaitHandler) handler) - { - return this->get_service().async_wait(this->get_implementation(), - ASIO_MOVE_CAST(WaitHandler)(handler)); - } -}; - -} // namespace windows -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) - // || defined(GENERATING_DOCUMENTATION) - -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_WINDOWS_BASIC_OBJECT_HANDLE_HPP diff --git a/tools/sdk/include/asio/asio/windows/basic_random_access_handle.hpp b/tools/sdk/include/asio/asio/windows/basic_random_access_handle.hpp deleted file mode 100644 index 4226977315e..00000000000 --- a/tools/sdk/include/asio/asio/windows/basic_random_access_handle.hpp +++ /dev/null @@ -1,376 +0,0 @@ -// -// windows/basic_random_access_handle.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_WINDOWS_BASIC_RANDOM_ACCESS_HANDLE_HPP -#define ASIO_WINDOWS_BASIC_RANDOM_ACCESS_HANDLE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) - -#if defined(ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE) \ - || defined(GENERATING_DOCUMENTATION) - -#include -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/error.hpp" -#include "asio/windows/basic_handle.hpp" -#include "asio/windows/random_access_handle_service.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace windows { - -/// Provides random-access handle functionality. -/** - * The windows::basic_random_access_handle class template provides asynchronous - * and blocking random-access handle functionality. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -template -class basic_random_access_handle - : public basic_handle -{ -public: - /// The native representation of a handle. - typedef typename RandomAccessHandleService::native_handle_type - native_handle_type; - - /// Construct a basic_random_access_handle without opening it. - /** - * This constructor creates a random-access handle without opening it. The - * handle needs to be opened before data can be written to or read from it. - * - * @param io_context The io_context object that the random-access handle will - * use to dispatch handlers for any asynchronous operations performed on the - * handle. - */ - explicit basic_random_access_handle(asio::io_context& io_context) - : basic_handle(io_context) - { - } - - /// Construct a basic_random_access_handle on an existing native handle. - /** - * This constructor creates a random-access handle object to hold an existing - * native handle. - * - * @param io_context The io_context object that the random-access handle will - * use to dispatch handlers for any asynchronous operations performed on the - * handle. - * - * @param handle The new underlying handle implementation. - * - * @throws asio::system_error Thrown on failure. - */ - basic_random_access_handle(asio::io_context& io_context, - const native_handle_type& handle) - : basic_handle(io_context, handle) - { - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a basic_random_access_handle from another. - /** - * This constructor moves a random-access handle from one object to another. - * - * @param other The other basic_random_access_handle object from which the - * move will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_random_access_handle(io_context&) - * constructor. - */ - basic_random_access_handle(basic_random_access_handle&& other) - : basic_handle( - ASIO_MOVE_CAST(basic_random_access_handle)(other)) - { - } - - /// Move-assign a basic_random_access_handle from another. - /** - * This assignment operator moves a random-access handle from one object to - * another. - * - * @param other The other basic_random_access_handle object from which the - * move will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_random_access_handle(io_context&) - * constructor. - */ - basic_random_access_handle& operator=(basic_random_access_handle&& other) - { - basic_handle::operator=( - ASIO_MOVE_CAST(basic_random_access_handle)(other)); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Write some data to the handle at the specified offset. - /** - * This function is used to write data to the random-access handle. The - * function call will block until one or more bytes of the data has been - * written successfully, or until an error occurs. - * - * @param offset The offset at which the data will be written. - * - * @param buffers One or more data buffers to be written to the handle. - * - * @returns The number of bytes written. - * - * @throws asio::system_error Thrown on failure. An error code of - * asio::error::eof indicates that the connection was closed by the - * peer. - * - * @note The write_some_at operation may not write all of the data. Consider - * using the @ref write_at function if you need to ensure that all data is - * written before the blocking operation completes. - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code - * handle.write_some_at(42, asio::buffer(data, size)); - * @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t write_some_at(uint64_t offset, - const ConstBufferSequence& buffers) - { - asio::error_code ec; - std::size_t s = this->get_service().write_some_at( - this->get_implementation(), offset, buffers, ec); - asio::detail::throw_error(ec, "write_some_at"); - return s; - } - - /// Write some data to the handle at the specified offset. - /** - * This function is used to write data to the random-access handle. The - * function call will block until one or more bytes of the data has been - * written successfully, or until an error occurs. - * - * @param offset The offset at which the data will be written. - * - * @param buffers One or more data buffers to be written to the handle. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes written. Returns 0 if an error occurred. - * - * @note The write_some operation may not transmit all of the data to the - * peer. Consider using the @ref write_at function if you need to ensure that - * all data is written before the blocking operation completes. - */ - template - std::size_t write_some_at(uint64_t offset, - const ConstBufferSequence& buffers, asio::error_code& ec) - { - return this->get_service().write_some_at( - this->get_implementation(), offset, buffers, ec); - } - - /// Start an asynchronous write at the specified offset. - /** - * This function is used to asynchronously write data to the random-access - * handle. The function call always returns immediately. - * - * @param offset The offset at which the data will be written. - * - * @param buffers One or more data buffers to be written to the handle. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the write operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes written. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The write operation may not transmit all of the data to the peer. - * Consider using the @ref async_write_at function if you need to ensure that - * all data is written before the asynchronous operation completes. - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code - * handle.async_write_some_at(42, asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_write_some_at(uint64_t offset, - const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - - return this->get_service().async_write_some_at(this->get_implementation(), - offset, buffers, ASIO_MOVE_CAST(WriteHandler)(handler)); - } - - /// Read some data from the handle at the specified offset. - /** - * This function is used to read data from the random-access handle. The - * function call will block until one or more bytes of data has been read - * successfully, or until an error occurs. - * - * @param offset The offset at which the data will be read. - * - * @param buffers One or more buffers into which the data will be read. - * - * @returns The number of bytes read. - * - * @throws asio::system_error Thrown on failure. An error code of - * asio::error::eof indicates that the connection was closed by the - * peer. - * - * @note The read_some operation may not read all of the requested number of - * bytes. Consider using the @ref read_at function if you need to ensure that - * the requested amount of data is read before the blocking operation - * completes. - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code - * handle.read_some_at(42, asio::buffer(data, size)); - * @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t read_some_at(uint64_t offset, - const MutableBufferSequence& buffers) - { - asio::error_code ec; - std::size_t s = this->get_service().read_some_at( - this->get_implementation(), offset, buffers, ec); - asio::detail::throw_error(ec, "read_some_at"); - return s; - } - - /// Read some data from the handle at the specified offset. - /** - * This function is used to read data from the random-access handle. The - * function call will block until one or more bytes of data has been read - * successfully, or until an error occurs. - * - * @param offset The offset at which the data will be read. - * - * @param buffers One or more buffers into which the data will be read. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes read. Returns 0 if an error occurred. - * - * @note The read_some operation may not read all of the requested number of - * bytes. Consider using the @ref read_at function if you need to ensure that - * the requested amount of data is read before the blocking operation - * completes. - */ - template - std::size_t read_some_at(uint64_t offset, - const MutableBufferSequence& buffers, asio::error_code& ec) - { - return this->get_service().read_some_at( - this->get_implementation(), offset, buffers, ec); - } - - /// Start an asynchronous read at the specified offset. - /** - * This function is used to asynchronously read data from the random-access - * handle. The function call always returns immediately. - * - * @param offset The offset at which the data will be read. - * - * @param buffers One or more buffers into which the data will be read. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes read. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The read operation may not read all of the requested number of bytes. - * Consider using the @ref async_read_at function if you need to ensure that - * the requested amount of data is read before the asynchronous operation - * completes. - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code - * handle.async_read_some_at(42, asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_read_some_at(uint64_t offset, - const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - - return this->get_service().async_read_some_at(this->get_implementation(), - offset, buffers, ASIO_MOVE_CAST(ReadHandler)(handler)); - } -}; - -} // namespace windows -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE) - // || defined(GENERATING_DOCUMENTATION) - -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_WINDOWS_BASIC_RANDOM_ACCESS_HANDLE_HPP diff --git a/tools/sdk/include/asio/asio/windows/basic_stream_handle.hpp b/tools/sdk/include/asio/asio/windows/basic_stream_handle.hpp deleted file mode 100644 index 3bfce6884f0..00000000000 --- a/tools/sdk/include/asio/asio/windows/basic_stream_handle.hpp +++ /dev/null @@ -1,359 +0,0 @@ -// -// windows/basic_stream_handle.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_WINDOWS_BASIC_STREAM_HANDLE_HPP -#define ASIO_WINDOWS_BASIC_STREAM_HANDLE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) - -#if defined(ASIO_HAS_WINDOWS_STREAM_HANDLE) \ - || defined(GENERATING_DOCUMENTATION) - -#include -#include "asio/detail/handler_type_requirements.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/error.hpp" -#include "asio/windows/basic_handle.hpp" -#include "asio/windows/stream_handle_service.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace windows { - -/// Provides stream-oriented handle functionality. -/** - * The windows::basic_stream_handle class template provides asynchronous and - * blocking stream-oriented handle functionality. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - * - * @par Concepts: - * AsyncReadStream, AsyncWriteStream, Stream, SyncReadStream, SyncWriteStream. - */ -template -class basic_stream_handle - : public basic_handle -{ -public: - /// The native representation of a handle. - typedef typename StreamHandleService::native_handle_type native_handle_type; - - /// Construct a basic_stream_handle without opening it. - /** - * This constructor creates a stream handle without opening it. The handle - * needs to be opened and then connected or accepted before data can be sent - * or received on it. - * - * @param io_context The io_context object that the stream handle will use to - * dispatch handlers for any asynchronous operations performed on the handle. - */ - explicit basic_stream_handle(asio::io_context& io_context) - : basic_handle(io_context) - { - } - - /// Construct a basic_stream_handle on an existing native handle. - /** - * This constructor creates a stream handle object to hold an existing native - * handle. - * - * @param io_context The io_context object that the stream handle will use to - * dispatch handlers for any asynchronous operations performed on the handle. - * - * @param handle The new underlying handle implementation. - * - * @throws asio::system_error Thrown on failure. - */ - basic_stream_handle(asio::io_context& io_context, - const native_handle_type& handle) - : basic_handle(io_context, handle) - { - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a basic_stream_handle from another. - /** - * This constructor moves a stream handle from one object to another. - * - * @param other The other basic_stream_handle object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_stream_handle(io_context&) constructor. - */ - basic_stream_handle(basic_stream_handle&& other) - : basic_handle( - ASIO_MOVE_CAST(basic_stream_handle)(other)) - { - } - - /// Move-assign a basic_stream_handle from another. - /** - * This assignment operator moves a stream handle from one object to - * another. - * - * @param other The other basic_stream_handle object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_stream_handle(io_context&) constructor. - */ - basic_stream_handle& operator=(basic_stream_handle&& other) - { - basic_handle::operator=( - ASIO_MOVE_CAST(basic_stream_handle)(other)); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Write some data to the handle. - /** - * This function is used to write data to the stream handle. The function call - * will block until one or more bytes of the data has been written - * successfully, or until an error occurs. - * - * @param buffers One or more data buffers to be written to the handle. - * - * @returns The number of bytes written. - * - * @throws asio::system_error Thrown on failure. An error code of - * asio::error::eof indicates that the connection was closed by the - * peer. - * - * @note The write_some operation may not transmit all of the data to the - * peer. Consider using the @ref write function if you need to ensure that - * all data is written before the blocking operation completes. - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code - * handle.write_some(asio::buffer(data, size)); - * @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t write_some(const ConstBufferSequence& buffers) - { - asio::error_code ec; - std::size_t s = this->get_service().write_some( - this->get_implementation(), buffers, ec); - asio::detail::throw_error(ec, "write_some"); - return s; - } - - /// Write some data to the handle. - /** - * This function is used to write data to the stream handle. The function call - * will block until one or more bytes of the data has been written - * successfully, or until an error occurs. - * - * @param buffers One or more data buffers to be written to the handle. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes written. Returns 0 if an error occurred. - * - * @note The write_some operation may not transmit all of the data to the - * peer. Consider using the @ref write function if you need to ensure that - * all data is written before the blocking operation completes. - */ - template - std::size_t write_some(const ConstBufferSequence& buffers, - asio::error_code& ec) - { - return this->get_service().write_some( - this->get_implementation(), buffers, ec); - } - - /// Start an asynchronous write. - /** - * This function is used to asynchronously write data to the stream handle. - * The function call always returns immediately. - * - * @param buffers One or more data buffers to be written to the handle. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the write operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes written. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The write operation may not transmit all of the data to the peer. - * Consider using the @ref async_write function if you need to ensure that all - * data is written before the asynchronous operation completes. - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code - * handle.async_write_some(asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_write_some(const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - - return this->get_service().async_write_some(this->get_implementation(), - buffers, ASIO_MOVE_CAST(WriteHandler)(handler)); - } - - /// Read some data from the handle. - /** - * This function is used to read data from the stream handle. The function - * call will block until one or more bytes of data has been read successfully, - * or until an error occurs. - * - * @param buffers One or more buffers into which the data will be read. - * - * @returns The number of bytes read. - * - * @throws asio::system_error Thrown on failure. An error code of - * asio::error::eof indicates that the connection was closed by the - * peer. - * - * @note The read_some operation may not read all of the requested number of - * bytes. Consider using the @ref read function if you need to ensure that - * the requested amount of data is read before the blocking operation - * completes. - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code - * handle.read_some(asio::buffer(data, size)); - * @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t read_some(const MutableBufferSequence& buffers) - { - asio::error_code ec; - std::size_t s = this->get_service().read_some( - this->get_implementation(), buffers, ec); - asio::detail::throw_error(ec, "read_some"); - return s; - } - - /// Read some data from the handle. - /** - * This function is used to read data from the stream handle. The function - * call will block until one or more bytes of data has been read successfully, - * or until an error occurs. - * - * @param buffers One or more buffers into which the data will be read. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes read. Returns 0 if an error occurred. - * - * @note The read_some operation may not read all of the requested number of - * bytes. Consider using the @ref read function if you need to ensure that - * the requested amount of data is read before the blocking operation - * completes. - */ - template - std::size_t read_some(const MutableBufferSequence& buffers, - asio::error_code& ec) - { - return this->get_service().read_some( - this->get_implementation(), buffers, ec); - } - - /// Start an asynchronous read. - /** - * This function is used to asynchronously read data from the stream handle. - * The function call always returns immediately. - * - * @param buffers One or more buffers into which the data will be read. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes read. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The read operation may not read all of the requested number of bytes. - * Consider using the @ref async_read function if you need to ensure that the - * requested amount of data is read before the asynchronous operation - * completes. - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code - * handle.async_read_some(asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_read_some(const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - - return this->get_service().async_read_some(this->get_implementation(), - buffers, ASIO_MOVE_CAST(ReadHandler)(handler)); - } -}; - -} // namespace windows -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_WINDOWS_STREAM_HANDLE) - // || defined(GENERATING_DOCUMENTATION) - -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_WINDOWS_BASIC_STREAM_HANDLE_HPP diff --git a/tools/sdk/include/asio/asio/windows/object_handle.hpp b/tools/sdk/include/asio/asio/windows/object_handle.hpp deleted file mode 100644 index 581b5680011..00000000000 --- a/tools/sdk/include/asio/asio/windows/object_handle.hpp +++ /dev/null @@ -1,381 +0,0 @@ -// -// windows/object_handle.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2011 Boris Schaeling (boris@highscore.de) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_WINDOWS_OBJECT_HANDLE_HPP -#define ASIO_WINDOWS_OBJECT_HANDLE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) \ - || defined(GENERATING_DOCUMENTATION) - -#include "asio/async_result.hpp" -#include "asio/basic_io_object.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/detail/win_object_handle_service.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" - -#if defined(ASIO_HAS_MOVE) -# include -#endif // defined(ASIO_HAS_MOVE) - -#if defined(ASIO_ENABLE_OLD_SERVICES) -# include "asio/windows/basic_object_handle.hpp" -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#define ASIO_SVC_T asio::detail::win_object_handle_service - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace windows { - -#if defined(ASIO_ENABLE_OLD_SERVICES) -// Typedef for the typical usage of an object handle. -typedef basic_object_handle<> object_handle; -#else // defined(ASIO_ENABLE_OLD_SERVICES) -/// Provides object-oriented handle functionality. -/** - * The windows::object_handle class provides asynchronous and blocking - * object-oriented handle functionality. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -class object_handle - : ASIO_SVC_ACCESS basic_io_object -{ -public: - /// The type of the executor associated with the object. - typedef io_context::executor_type executor_type; - - /// The native representation of a handle. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined native_handle_type; -#else - typedef ASIO_SVC_T::native_handle_type native_handle_type; -#endif - - /// An object_handle is always the lowest layer. - typedef object_handle lowest_layer_type; - - /// Construct an object_handle without opening it. - /** - * This constructor creates an object handle without opening it. - * - * @param io_context The io_context object that the object handle will use to - * dispatch handlers for any asynchronous operations performed on the handle. - */ - explicit object_handle(asio::io_context& io_context) - : basic_io_object(io_context) - { - } - - /// Construct an object_handle on an existing native handle. - /** - * This constructor creates an object handle object to hold an existing native - * handle. - * - * @param io_context The io_context object that the object handle will use to - * dispatch handlers for any asynchronous operations performed on the handle. - * - * @param native_handle The new underlying handle implementation. - * - * @throws asio::system_error Thrown on failure. - */ - object_handle(asio::io_context& io_context, - const native_handle_type& native_handle) - : basic_io_object(io_context) - { - asio::error_code ec; - this->get_service().assign(this->get_implementation(), native_handle, ec); - asio::detail::throw_error(ec, "assign"); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct an object_handle from another. - /** - * This constructor moves an object handle from one object to another. - * - * @param other The other object_handle object from which the move will - * occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c object_handle(io_context&) constructor. - */ - object_handle(object_handle&& other) - : basic_io_object(std::move(other)) - { - } - - /// Move-assign an object_handle from another. - /** - * This assignment operator moves an object handle from one object to another. - * - * @param other The other object_handle object from which the move will - * occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c object_handle(io_context&) constructor. - */ - object_handle& operator=(object_handle&& other) - { - basic_io_object::operator=(std::move(other)); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - /** - * This function may be used to obtain the io_context object that the I/O - * object uses to dispatch handlers for asynchronous operations. - * - * @return A reference to the io_context object that the I/O object will use - * to dispatch handlers. Ownership is not transferred to the caller. - */ - asio::io_context& get_io_context() - { - return basic_io_object::get_io_context(); - } - - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - /** - * This function may be used to obtain the io_context object that the I/O - * object uses to dispatch handlers for asynchronous operations. - * - * @return A reference to the io_context object that the I/O object will use - * to dispatch handlers. Ownership is not transferred to the caller. - */ - asio::io_context& get_io_service() - { - return basic_io_object::get_io_service(); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Get the executor associated with the object. - executor_type get_executor() ASIO_NOEXCEPT - { - return basic_io_object::get_executor(); - } - - /// Get a reference to the lowest layer. - /** - * This function returns a reference to the lowest layer in a stack of - * layers. Since an object_handle cannot contain any further layers, it simply - * returns a reference to itself. - * - * @return A reference to the lowest layer in the stack of layers. Ownership - * is not transferred to the caller. - */ - lowest_layer_type& lowest_layer() - { - return *this; - } - - /// Get a const reference to the lowest layer. - /** - * This function returns a const reference to the lowest layer in a stack of - * layers. Since an object_handle cannot contain any further layers, it simply - * returns a reference to itself. - * - * @return A const reference to the lowest layer in the stack of layers. - * Ownership is not transferred to the caller. - */ - const lowest_layer_type& lowest_layer() const - { - return *this; - } - - /// Assign an existing native handle to the handle. - /* - * This function opens the handle to hold an existing native handle. - * - * @param handle A native handle. - * - * @throws asio::system_error Thrown on failure. - */ - void assign(const native_handle_type& handle) - { - asio::error_code ec; - this->get_service().assign(this->get_implementation(), handle, ec); - asio::detail::throw_error(ec, "assign"); - } - - /// Assign an existing native handle to the handle. - /* - * This function opens the handle to hold an existing native handle. - * - * @param handle A native handle. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID assign(const native_handle_type& handle, - asio::error_code& ec) - { - this->get_service().assign(this->get_implementation(), handle, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Determine whether the handle is open. - bool is_open() const - { - return this->get_service().is_open(this->get_implementation()); - } - - /// Close the handle. - /** - * This function is used to close the handle. Any asynchronous read or write - * operations will be cancelled immediately, and will complete with the - * asio::error::operation_aborted error. - * - * @throws asio::system_error Thrown on failure. - */ - void close() - { - asio::error_code ec; - this->get_service().close(this->get_implementation(), ec); - asio::detail::throw_error(ec, "close"); - } - - /// Close the handle. - /** - * This function is used to close the handle. Any asynchronous read or write - * operations will be cancelled immediately, and will complete with the - * asio::error::operation_aborted error. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID close(asio::error_code& ec) - { - this->get_service().close(this->get_implementation(), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get the native handle representation. - /** - * This function may be used to obtain the underlying representation of the - * handle. This is intended to allow access to native handle functionality - * that is not otherwise provided. - */ - native_handle_type native_handle() - { - return this->get_service().native_handle(this->get_implementation()); - } - - /// Cancel all asynchronous operations associated with the handle. - /** - * This function causes all outstanding asynchronous read or write operations - * to finish immediately, and the handlers for cancelled operations will be - * passed the asio::error::operation_aborted error. - * - * @throws asio::system_error Thrown on failure. - */ - void cancel() - { - asio::error_code ec; - this->get_service().cancel(this->get_implementation(), ec); - asio::detail::throw_error(ec, "cancel"); - } - - /// Cancel all asynchronous operations associated with the handle. - /** - * This function causes all outstanding asynchronous read or write operations - * to finish immediately, and the handlers for cancelled operations will be - * passed the asio::error::operation_aborted error. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID cancel(asio::error_code& ec) - { - this->get_service().cancel(this->get_implementation(), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Perform a blocking wait on the object handle. - /** - * This function is used to wait for the object handle to be set to the - * signalled state. This function blocks and does not return until the object - * handle has been set to the signalled state. - * - * @throws asio::system_error Thrown on failure. - */ - void wait() - { - asio::error_code ec; - this->get_service().wait(this->get_implementation(), ec); - asio::detail::throw_error(ec, "wait"); - } - - /// Perform a blocking wait on the object handle. - /** - * This function is used to wait for the object handle to be set to the - * signalled state. This function blocks and does not return until the object - * handle has been set to the signalled state. - * - * @param ec Set to indicate what error occurred, if any. - */ - void wait(asio::error_code& ec) - { - this->get_service().wait(this->get_implementation(), ec); - } - - /// Start an asynchronous wait on the object handle. - /** - * This function is be used to initiate an asynchronous wait against the - * object handle. It always returns immediately. - * - * @param handler The handler to be called when the object handle is set to - * the signalled state. Copies will be made of the handler as required. The - * function signature of the handler must be: - * @code void handler( - * const asio::error_code& error // Result of operation. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - */ - template - ASIO_INITFN_RESULT_TYPE(WaitHandler, - void (asio::error_code)) - async_wait(ASIO_MOVE_ARG(WaitHandler) handler) - { - asio::async_completion init(handler); - - this->get_service().async_wait(this->get_implementation(), - init.completion_handler); - - return init.result.get(); - } -}; -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -} // namespace windows -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#undef ASIO_SVC_T - -#endif // defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) - // || defined(GENERATING_DOCUMENTATION) - -#endif // ASIO_WINDOWS_OBJECT_HANDLE_HPP diff --git a/tools/sdk/include/asio/asio/windows/object_handle_service.hpp b/tools/sdk/include/asio/asio/windows/object_handle_service.hpp deleted file mode 100644 index 95436d790e0..00000000000 --- a/tools/sdk/include/asio/asio/windows/object_handle_service.hpp +++ /dev/null @@ -1,183 +0,0 @@ -// -// windows/object_handle_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2011 Boris Schaeling (boris@highscore.de) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_WINDOWS_OBJECT_HANDLE_SERVICE_HPP -#define ASIO_WINDOWS_OBJECT_HANDLE_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) - -#if defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) \ - || defined(GENERATING_DOCUMENTATION) - -#include "asio/async_result.hpp" -#include "asio/detail/win_object_handle_service.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace windows { - -/// Default service implementation for an object handle. -class object_handle_service -#if defined(GENERATING_DOCUMENTATION) - : public asio::io_context::service -#else - : public asio::detail::service_base -#endif -{ -public: -#if defined(GENERATING_DOCUMENTATION) - /// The unique service identifier. - static asio::io_context::id id; -#endif - -private: - // The type of the platform-specific implementation. - typedef detail::win_object_handle_service service_impl_type; - -public: - /// The type of an object handle implementation. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined implementation_type; -#else - typedef service_impl_type::implementation_type implementation_type; -#endif - - /// The native handle type. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined native_handle_type; -#else - typedef service_impl_type::native_handle_type native_handle_type; -#endif - - /// Construct a new object handle service for the specified io_context. - explicit object_handle_service(asio::io_context& io_context) - : asio::detail::service_base(io_context), - service_impl_(io_context) - { - } - - /// Construct a new object handle implementation. - void construct(implementation_type& impl) - { - service_impl_.construct(impl); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a new object handle implementation. - void move_construct(implementation_type& impl, - implementation_type& other_impl) - { - service_impl_.move_construct(impl, other_impl); - } - - /// Move-assign from another object handle implementation. - void move_assign(implementation_type& impl, - object_handle_service& other_service, - implementation_type& other_impl) - { - service_impl_.move_assign(impl, other_service.service_impl_, other_impl); - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destroy an object handle implementation. - void destroy(implementation_type& impl) - { - service_impl_.destroy(impl); - } - - /// Assign an existing native handle to an object handle. - ASIO_SYNC_OP_VOID assign(implementation_type& impl, - const native_handle_type& handle, asio::error_code& ec) - { - service_impl_.assign(impl, handle, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Determine whether the handle is open. - bool is_open(const implementation_type& impl) const - { - return service_impl_.is_open(impl); - } - - /// Close an object handle implementation. - ASIO_SYNC_OP_VOID close(implementation_type& impl, - asio::error_code& ec) - { - service_impl_.close(impl, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get the native handle implementation. - native_handle_type native_handle(implementation_type& impl) - { - return service_impl_.native_handle(impl); - } - - /// Cancel all asynchronous operations associated with the handle. - ASIO_SYNC_OP_VOID cancel(implementation_type& impl, - asio::error_code& ec) - { - service_impl_.cancel(impl, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - // Wait for a signaled state. - void wait(implementation_type& impl, asio::error_code& ec) - { - service_impl_.wait(impl, ec); - } - - /// Start an asynchronous wait. - template - ASIO_INITFN_RESULT_TYPE(WaitHandler, - void (asio::error_code)) - async_wait(implementation_type& impl, - ASIO_MOVE_ARG(WaitHandler) handler) - { - asio::async_completion init(handler); - - service_impl_.async_wait(impl, init.completion_handler); - - return init.result.get(); - } - -private: - // Destroy all user-defined handler objects owned by the service. - void shutdown() - { - service_impl_.shutdown(); - } - - // The platform-specific implementation. - service_impl_type service_impl_; -}; - -} // namespace windows -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) - // || defined(GENERATING_DOCUMENTATION) - -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_WINDOWS_OBJECT_HANDLE_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/windows/overlapped_handle.hpp b/tools/sdk/include/asio/asio/windows/overlapped_handle.hpp deleted file mode 100644 index 3d479ba6c82..00000000000 --- a/tools/sdk/include/asio/asio/windows/overlapped_handle.hpp +++ /dev/null @@ -1,331 +0,0 @@ -// -// windows/overlapped_handle.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_WINDOWS_OVERLAPPED_HANDLE_HPP -#define ASIO_WINDOWS_OVERLAPPED_HANDLE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if !defined(ASIO_ENABLE_OLD_SERVICES) - -#if defined(ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE) \ - || defined(ASIO_HAS_WINDOWS_STREAM_HANDLE) \ - || defined(GENERATING_DOCUMENTATION) - -#include -#include "asio/async_result.hpp" -#include "asio/basic_io_object.hpp" -#include "asio/detail/throw_error.hpp" -#include "asio/detail/win_iocp_handle_service.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" - -#if defined(ASIO_HAS_MOVE) -# include -#endif // defined(ASIO_HAS_MOVE) - -#define ASIO_SVC_T asio::detail::win_iocp_handle_service - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace windows { - -/// Provides Windows handle functionality for objects that support -/// overlapped I/O. -/** - * The windows::overlapped_handle class provides the ability to wrap a Windows - * handle. The underlying object referred to by the handle must support - * overlapped I/O. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -class overlapped_handle - : ASIO_SVC_ACCESS basic_io_object -{ -public: - /// The type of the executor associated with the object. - typedef io_context::executor_type executor_type; - - /// The native representation of a handle. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined native_handle_type; -#else - typedef ASIO_SVC_T::native_handle_type native_handle_type; -#endif - - /// An overlapped_handle is always the lowest layer. - typedef overlapped_handle lowest_layer_type; - - /// Construct an overlapped_handle without opening it. - /** - * This constructor creates a handle without opening it. - * - * @param io_context The io_context object that the handle will use to - * dispatch handlers for any asynchronous operations performed on the handle. - */ - explicit overlapped_handle(asio::io_context& io_context) - : basic_io_object(io_context) - { - } - - /// Construct an overlapped_handle on an existing native handle. - /** - * This constructor creates a handle object to hold an existing native handle. - * - * @param io_context The io_context object that the handle will use to - * dispatch handlers for any asynchronous operations performed on the handle. - * - * @param handle A native handle. - * - * @throws asio::system_error Thrown on failure. - */ - overlapped_handle(asio::io_context& io_context, - const native_handle_type& handle) - : basic_io_object(io_context) - { - asio::error_code ec; - this->get_service().assign(this->get_implementation(), handle, ec); - asio::detail::throw_error(ec, "assign"); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct an overlapped_handle from another. - /** - * This constructor moves a handle from one object to another. - * - * @param other The other overlapped_handle object from which the move will - * occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c overlapped_handle(io_context&) constructor. - */ - overlapped_handle(overlapped_handle&& other) - : basic_io_object(std::move(other)) - { - } - - /// Move-assign an overlapped_handle from another. - /** - * This assignment operator moves a handle from one object to another. - * - * @param other The other overlapped_handle object from which the move will - * occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c overlapped_handle(io_context&) constructor. - */ - overlapped_handle& operator=(overlapped_handle&& other) - { - basic_io_object::operator=(std::move(other)); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - /** - * This function may be used to obtain the io_context object that the I/O - * object uses to dispatch handlers for asynchronous operations. - * - * @return A reference to the io_context object that the I/O object will use - * to dispatch handlers. Ownership is not transferred to the caller. - */ - asio::io_context& get_io_context() - { - return basic_io_object::get_io_context(); - } - - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - /** - * This function may be used to obtain the io_context object that the I/O - * object uses to dispatch handlers for asynchronous operations. - * - * @return A reference to the io_context object that the I/O object will use - * to dispatch handlers. Ownership is not transferred to the caller. - */ - asio::io_context& get_io_service() - { - return basic_io_object::get_io_service(); - } -#endif // !defined(ASIO_NO_DEPRECATED) - - /// Get the executor associated with the object. - executor_type get_executor() ASIO_NOEXCEPT - { - return basic_io_object::get_executor(); - } - - /// Get a reference to the lowest layer. - /** - * This function returns a reference to the lowest layer in a stack of - * layers. Since an overlapped_handle cannot contain any further layers, it - * simply returns a reference to itself. - * - * @return A reference to the lowest layer in the stack of layers. Ownership - * is not transferred to the caller. - */ - lowest_layer_type& lowest_layer() - { - return *this; - } - - /// Get a const reference to the lowest layer. - /** - * This function returns a const reference to the lowest layer in a stack of - * layers. Since an overlapped_handle cannot contain any further layers, it - * simply returns a reference to itself. - * - * @return A const reference to the lowest layer in the stack of layers. - * Ownership is not transferred to the caller. - */ - const lowest_layer_type& lowest_layer() const - { - return *this; - } - - /// Assign an existing native handle to the handle. - /* - * This function opens the handle to hold an existing native handle. - * - * @param handle A native handle. - * - * @throws asio::system_error Thrown on failure. - */ - void assign(const native_handle_type& handle) - { - asio::error_code ec; - this->get_service().assign(this->get_implementation(), handle, ec); - asio::detail::throw_error(ec, "assign"); - } - - /// Assign an existing native handle to the handle. - /* - * This function opens the handle to hold an existing native handle. - * - * @param handle A native handle. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID assign(const native_handle_type& handle, - asio::error_code& ec) - { - this->get_service().assign(this->get_implementation(), handle, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Determine whether the handle is open. - bool is_open() const - { - return this->get_service().is_open(this->get_implementation()); - } - - /// Close the handle. - /** - * This function is used to close the handle. Any asynchronous read or write - * operations will be cancelled immediately, and will complete with the - * asio::error::operation_aborted error. - * - * @throws asio::system_error Thrown on failure. - */ - void close() - { - asio::error_code ec; - this->get_service().close(this->get_implementation(), ec); - asio::detail::throw_error(ec, "close"); - } - - /// Close the handle. - /** - * This function is used to close the handle. Any asynchronous read or write - * operations will be cancelled immediately, and will complete with the - * asio::error::operation_aborted error. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID close(asio::error_code& ec) - { - this->get_service().close(this->get_implementation(), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get the native handle representation. - /** - * This function may be used to obtain the underlying representation of the - * handle. This is intended to allow access to native handle functionality - * that is not otherwise provided. - */ - native_handle_type native_handle() - { - return this->get_service().native_handle(this->get_implementation()); - } - - /// Cancel all asynchronous operations associated with the handle. - /** - * This function causes all outstanding asynchronous read or write operations - * to finish immediately, and the handlers for cancelled operations will be - * passed the asio::error::operation_aborted error. - * - * @throws asio::system_error Thrown on failure. - */ - void cancel() - { - asio::error_code ec; - this->get_service().cancel(this->get_implementation(), ec); - asio::detail::throw_error(ec, "cancel"); - } - - /// Cancel all asynchronous operations associated with the handle. - /** - * This function causes all outstanding asynchronous read or write operations - * to finish immediately, and the handlers for cancelled operations will be - * passed the asio::error::operation_aborted error. - * - * @param ec Set to indicate what error occurred, if any. - */ - ASIO_SYNC_OP_VOID cancel(asio::error_code& ec) - { - this->get_service().cancel(this->get_implementation(), ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - -protected: - /// Protected destructor to prevent deletion through this type. - /** - * This function destroys the handle, cancelling any outstanding asynchronous - * wait operations associated with the handle as if by calling @c cancel. - */ - ~overlapped_handle() - { - } -}; - -} // namespace windows -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#undef ASIO_SVC_T - -#endif // defined(ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE) - // || defined(ASIO_HAS_WINDOWS_STREAM_HANDLE) - // || defined(GENERATING_DOCUMENTATION) - -#endif // !defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_WINDOWS_OVERLAPPED_HANDLE_HPP diff --git a/tools/sdk/include/asio/asio/windows/overlapped_ptr.hpp b/tools/sdk/include/asio/asio/windows/overlapped_ptr.hpp deleted file mode 100644 index ce0b2a42d22..00000000000 --- a/tools/sdk/include/asio/asio/windows/overlapped_ptr.hpp +++ /dev/null @@ -1,116 +0,0 @@ -// -// windows/overlapped_ptr.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_WINDOWS_OVERLAPPED_PTR_HPP -#define ASIO_WINDOWS_OVERLAPPED_PTR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_HAS_WINDOWS_OVERLAPPED_PTR) \ - || defined(GENERATING_DOCUMENTATION) - -#include "asio/detail/noncopyable.hpp" -#include "asio/detail/win_iocp_overlapped_ptr.hpp" -#include "asio/io_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace windows { - -/// Wraps a handler to create an OVERLAPPED object for use with overlapped I/O. -/** - * A special-purpose smart pointer used to wrap an application handler so that - * it can be passed as the LPOVERLAPPED argument to overlapped I/O functions. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -class overlapped_ptr - : private noncopyable -{ -public: - /// Construct an empty overlapped_ptr. - overlapped_ptr() - : impl_() - { - } - - /// Construct an overlapped_ptr to contain the specified handler. - template - explicit overlapped_ptr(asio::io_context& io_context, - ASIO_MOVE_ARG(Handler) handler) - : impl_(io_context, ASIO_MOVE_CAST(Handler)(handler)) - { - } - - /// Destructor automatically frees the OVERLAPPED object unless released. - ~overlapped_ptr() - { - } - - /// Reset to empty. - void reset() - { - impl_.reset(); - } - - /// Reset to contain the specified handler, freeing any current OVERLAPPED - /// object. - template - void reset(asio::io_context& io_context, - ASIO_MOVE_ARG(Handler) handler) - { - impl_.reset(io_context, ASIO_MOVE_CAST(Handler)(handler)); - } - - /// Get the contained OVERLAPPED object. - OVERLAPPED* get() - { - return impl_.get(); - } - - /// Get the contained OVERLAPPED object. - const OVERLAPPED* get() const - { - return impl_.get(); - } - - /// Release ownership of the OVERLAPPED object. - OVERLAPPED* release() - { - return impl_.release(); - } - - /// Post completion notification for overlapped operation. Releases ownership. - void complete(const asio::error_code& ec, - std::size_t bytes_transferred) - { - impl_.complete(ec, bytes_transferred); - } - -private: - detail::win_iocp_overlapped_ptr impl_; -}; - -} // namespace windows -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_WINDOWS_OVERLAPPED_PTR) - // || defined(GENERATING_DOCUMENTATION) - -#endif // ASIO_WINDOWS_OVERLAPPED_PTR_HPP diff --git a/tools/sdk/include/asio/asio/windows/random_access_handle.hpp b/tools/sdk/include/asio/asio/windows/random_access_handle.hpp deleted file mode 100644 index 301d5f8dd35..00000000000 --- a/tools/sdk/include/asio/asio/windows/random_access_handle.hpp +++ /dev/null @@ -1,378 +0,0 @@ -// -// windows/random_access_handle.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_WINDOWS_RANDOM_ACCESS_HANDLE_HPP -#define ASIO_WINDOWS_RANDOM_ACCESS_HANDLE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/windows/overlapped_handle.hpp" - -#if defined(ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE) \ - || defined(GENERATING_DOCUMENTATION) - -#if defined(ASIO_ENABLE_OLD_SERVICES) -# include "asio/windows/basic_random_access_handle.hpp" -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace windows { - -#if defined(ASIO_ENABLE_OLD_SERVICES) -// Typedef for the typical usage of a random-access handle. -typedef basic_random_access_handle<> random_access_handle; -#else // defined(ASIO_ENABLE_OLD_SERVICES) -/// Provides random-access handle functionality. -/** - * The windows::random_access_handle class provides asynchronous and - * blocking random-access handle functionality. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - */ -class random_access_handle - : public overlapped_handle -{ -public: - /// Construct a random_access_handle without opening it. - /** - * This constructor creates a random-access handle without opening it. The - * handle needs to be opened before data can be written to or read from it. - * - * @param io_context The io_context object that the random-access handle will - * use to dispatch handlers for any asynchronous operations performed on the - * handle. - */ - explicit random_access_handle(asio::io_context& io_context) - : overlapped_handle(io_context) - { - } - - /// Construct a random_access_handle on an existing native handle. - /** - * This constructor creates a random-access handle object to hold an existing - * native handle. - * - * @param io_context The io_context object that the random-access handle will - * use to dispatch handlers for any asynchronous operations performed on the - * handle. - * - * @param handle The new underlying handle implementation. - * - * @throws asio::system_error Thrown on failure. - */ - random_access_handle(asio::io_context& io_context, - const native_handle_type& handle) - : overlapped_handle(io_context, handle) - { - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a random_access_handle from another. - /** - * This constructor moves a random-access handle from one object to another. - * - * @param other The other random_access_handle object from which the - * move will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c random_access_handle(io_context&) - * constructor. - */ - random_access_handle(random_access_handle&& other) - : overlapped_handle(std::move(other)) - { - } - - /// Move-assign a random_access_handle from another. - /** - * This assignment operator moves a random-access handle from one object to - * another. - * - * @param other The other random_access_handle object from which the - * move will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c random_access_handle(io_context&) - * constructor. - */ - random_access_handle& operator=(random_access_handle&& other) - { - overlapped_handle::operator=(std::move(other)); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Write some data to the handle at the specified offset. - /** - * This function is used to write data to the random-access handle. The - * function call will block until one or more bytes of the data has been - * written successfully, or until an error occurs. - * - * @param offset The offset at which the data will be written. - * - * @param buffers One or more data buffers to be written to the handle. - * - * @returns The number of bytes written. - * - * @throws asio::system_error Thrown on failure. An error code of - * asio::error::eof indicates that the connection was closed by the - * peer. - * - * @note The write_some_at operation may not write all of the data. Consider - * using the @ref write_at function if you need to ensure that all data is - * written before the blocking operation completes. - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code - * handle.write_some_at(42, asio::buffer(data, size)); - * @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t write_some_at(uint64_t offset, - const ConstBufferSequence& buffers) - { - asio::error_code ec; - std::size_t s = this->get_service().write_some_at( - this->get_implementation(), offset, buffers, ec); - asio::detail::throw_error(ec, "write_some_at"); - return s; - } - - /// Write some data to the handle at the specified offset. - /** - * This function is used to write data to the random-access handle. The - * function call will block until one or more bytes of the data has been - * written successfully, or until an error occurs. - * - * @param offset The offset at which the data will be written. - * - * @param buffers One or more data buffers to be written to the handle. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes written. Returns 0 if an error occurred. - * - * @note The write_some operation may not transmit all of the data to the - * peer. Consider using the @ref write_at function if you need to ensure that - * all data is written before the blocking operation completes. - */ - template - std::size_t write_some_at(uint64_t offset, - const ConstBufferSequence& buffers, asio::error_code& ec) - { - return this->get_service().write_some_at( - this->get_implementation(), offset, buffers, ec); - } - - /// Start an asynchronous write at the specified offset. - /** - * This function is used to asynchronously write data to the random-access - * handle. The function call always returns immediately. - * - * @param offset The offset at which the data will be written. - * - * @param buffers One or more data buffers to be written to the handle. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the write operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes written. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The write operation may not transmit all of the data to the peer. - * Consider using the @ref async_write_at function if you need to ensure that - * all data is written before the asynchronous operation completes. - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code - * handle.async_write_some_at(42, asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_write_some_at(uint64_t offset, - const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - - asio::async_completion init(handler); - - this->get_service().async_write_some_at(this->get_implementation(), - offset, buffers, init.completion_handler); - - return init.result.get(); - } - - /// Read some data from the handle at the specified offset. - /** - * This function is used to read data from the random-access handle. The - * function call will block until one or more bytes of data has been read - * successfully, or until an error occurs. - * - * @param offset The offset at which the data will be read. - * - * @param buffers One or more buffers into which the data will be read. - * - * @returns The number of bytes read. - * - * @throws asio::system_error Thrown on failure. An error code of - * asio::error::eof indicates that the connection was closed by the - * peer. - * - * @note The read_some operation may not read all of the requested number of - * bytes. Consider using the @ref read_at function if you need to ensure that - * the requested amount of data is read before the blocking operation - * completes. - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code - * handle.read_some_at(42, asio::buffer(data, size)); - * @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t read_some_at(uint64_t offset, - const MutableBufferSequence& buffers) - { - asio::error_code ec; - std::size_t s = this->get_service().read_some_at( - this->get_implementation(), offset, buffers, ec); - asio::detail::throw_error(ec, "read_some_at"); - return s; - } - - /// Read some data from the handle at the specified offset. - /** - * This function is used to read data from the random-access handle. The - * function call will block until one or more bytes of data has been read - * successfully, or until an error occurs. - * - * @param offset The offset at which the data will be read. - * - * @param buffers One or more buffers into which the data will be read. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes read. Returns 0 if an error occurred. - * - * @note The read_some operation may not read all of the requested number of - * bytes. Consider using the @ref read_at function if you need to ensure that - * the requested amount of data is read before the blocking operation - * completes. - */ - template - std::size_t read_some_at(uint64_t offset, - const MutableBufferSequence& buffers, asio::error_code& ec) - { - return this->get_service().read_some_at( - this->get_implementation(), offset, buffers, ec); - } - - /// Start an asynchronous read at the specified offset. - /** - * This function is used to asynchronously read data from the random-access - * handle. The function call always returns immediately. - * - * @param offset The offset at which the data will be read. - * - * @param buffers One or more buffers into which the data will be read. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes read. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The read operation may not read all of the requested number of bytes. - * Consider using the @ref async_read_at function if you need to ensure that - * the requested amount of data is read before the asynchronous operation - * completes. - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code - * handle.async_read_some_at(42, asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_read_some_at(uint64_t offset, - const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - - asio::async_completion init(handler); - - this->get_service().async_read_some_at(this->get_implementation(), - offset, buffers, init.completion_handler); - - return init.result.get(); - } -}; -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -} // namespace windows -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE) - // || defined(GENERATING_DOCUMENTATION) - -#endif // ASIO_WINDOWS_RANDOM_ACCESS_HANDLE_HPP diff --git a/tools/sdk/include/asio/asio/windows/random_access_handle_service.hpp b/tools/sdk/include/asio/asio/windows/random_access_handle_service.hpp deleted file mode 100644 index ebccf3e3944..00000000000 --- a/tools/sdk/include/asio/asio/windows/random_access_handle_service.hpp +++ /dev/null @@ -1,214 +0,0 @@ -// -// windows/random_access_handle_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_WINDOWS_RANDOM_ACCESS_HANDLE_SERVICE_HPP -#define ASIO_WINDOWS_RANDOM_ACCESS_HANDLE_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) - -#if defined(ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE) \ - || defined(GENERATING_DOCUMENTATION) - -#include -#include "asio/async_result.hpp" -#include "asio/detail/cstdint.hpp" -#include "asio/detail/win_iocp_handle_service.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace windows { - -/// Default service implementation for a random-access handle. -class random_access_handle_service -#if defined(GENERATING_DOCUMENTATION) - : public asio::io_context::service -#else - : public asio::detail::service_base -#endif -{ -public: -#if defined(GENERATING_DOCUMENTATION) - /// The unique service identifier. - static asio::io_context::id id; -#endif - -private: - // The type of the platform-specific implementation. - typedef detail::win_iocp_handle_service service_impl_type; - -public: - /// The type of a random-access handle implementation. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined implementation_type; -#else - typedef service_impl_type::implementation_type implementation_type; -#endif - - /// The native handle type. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined native_handle_type; -#else - typedef service_impl_type::native_handle_type native_handle_type; -#endif - - /// Construct a new random-access handle service for the specified io_context. - explicit random_access_handle_service(asio::io_context& io_context) - : asio::detail::service_base< - random_access_handle_service>(io_context), - service_impl_(io_context) - { - } - - /// Construct a new random-access handle implementation. - void construct(implementation_type& impl) - { - service_impl_.construct(impl); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a new random-access handle implementation. - void move_construct(implementation_type& impl, - implementation_type& other_impl) - { - service_impl_.move_construct(impl, other_impl); - } - - /// Move-assign from another random-access handle implementation. - void move_assign(implementation_type& impl, - random_access_handle_service& other_service, - implementation_type& other_impl) - { - service_impl_.move_assign(impl, other_service.service_impl_, other_impl); - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destroy a random-access handle implementation. - void destroy(implementation_type& impl) - { - service_impl_.destroy(impl); - } - - /// Assign an existing native handle to a random-access handle. - ASIO_SYNC_OP_VOID assign(implementation_type& impl, - const native_handle_type& handle, asio::error_code& ec) - { - service_impl_.assign(impl, handle, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Determine whether the handle is open. - bool is_open(const implementation_type& impl) const - { - return service_impl_.is_open(impl); - } - - /// Close a random-access handle implementation. - ASIO_SYNC_OP_VOID close(implementation_type& impl, - asio::error_code& ec) - { - service_impl_.close(impl, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get the native handle implementation. - native_handle_type native_handle(implementation_type& impl) - { - return service_impl_.native_handle(impl); - } - - /// Cancel all asynchronous operations associated with the handle. - ASIO_SYNC_OP_VOID cancel(implementation_type& impl, - asio::error_code& ec) - { - service_impl_.cancel(impl, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Write the given data at the specified offset. - template - std::size_t write_some_at(implementation_type& impl, uint64_t offset, - const ConstBufferSequence& buffers, asio::error_code& ec) - { - return service_impl_.write_some_at(impl, offset, buffers, ec); - } - - /// Start an asynchronous write at the specified offset. - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_write_some_at(implementation_type& impl, - uint64_t offset, const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler) - { - asio::async_completion init(handler); - - service_impl_.async_write_some_at(impl, - offset, buffers, init.completion_handler); - - return init.result.get(); - } - - /// Read some data from the specified offset. - template - std::size_t read_some_at(implementation_type& impl, uint64_t offset, - const MutableBufferSequence& buffers, asio::error_code& ec) - { - return service_impl_.read_some_at(impl, offset, buffers, ec); - } - - /// Start an asynchronous read at the specified offset. - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_read_some_at(implementation_type& impl, - uint64_t offset, const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler) - { - asio::async_completion init(handler); - - service_impl_.async_read_some_at(impl, - offset, buffers, init.completion_handler); - - return init.result.get(); - } - -private: - // Destroy all user-defined handler objects owned by the service. - void shutdown() - { - service_impl_.shutdown(); - } - - // The platform-specific implementation. - service_impl_type service_impl_; -}; - -} // namespace windows -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE) - // || defined(GENERATING_DOCUMENTATION) - -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_WINDOWS_RANDOM_ACCESS_HANDLE_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/windows/stream_handle.hpp b/tools/sdk/include/asio/asio/windows/stream_handle.hpp deleted file mode 100644 index 8f0a21b1fe9..00000000000 --- a/tools/sdk/include/asio/asio/windows/stream_handle.hpp +++ /dev/null @@ -1,362 +0,0 @@ -// -// windows/stream_handle.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_WINDOWS_STREAM_HANDLE_HPP -#define ASIO_WINDOWS_STREAM_HANDLE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/windows/overlapped_handle.hpp" - -#if defined(ASIO_HAS_WINDOWS_STREAM_HANDLE) \ - || defined(GENERATING_DOCUMENTATION) - -#if defined(ASIO_ENABLE_OLD_SERVICES) -# include "asio/windows/basic_stream_handle.hpp" -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace windows { - -#if defined(ASIO_ENABLE_OLD_SERVICES) -// Typedef for the typical usage of a stream-oriented handle. -typedef basic_stream_handle<> stream_handle; -#else // defined(ASIO_ENABLE_OLD_SERVICES) -/// Provides stream-oriented handle functionality. -/** - * The windows::stream_handle class provides asynchronous and blocking - * stream-oriented handle functionality. - * - * @par Thread Safety - * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Unsafe. - * - * @par Concepts: - * AsyncReadStream, AsyncWriteStream, Stream, SyncReadStream, SyncWriteStream. - */ -class stream_handle - : public overlapped_handle -{ -public: - /// Construct a stream_handle without opening it. - /** - * This constructor creates a stream handle without opening it. The handle - * needs to be opened and then connected or accepted before data can be sent - * or received on it. - * - * @param io_context The io_context object that the stream handle will use to - * dispatch handlers for any asynchronous operations performed on the handle. - */ - explicit stream_handle(asio::io_context& io_context) - : overlapped_handle(io_context) - { - } - - /// Construct a stream_handle on an existing native handle. - /** - * This constructor creates a stream handle object to hold an existing native - * handle. - * - * @param io_context The io_context object that the stream handle will use to - * dispatch handlers for any asynchronous operations performed on the handle. - * - * @param handle The new underlying handle implementation. - * - * @throws asio::system_error Thrown on failure. - */ - stream_handle(asio::io_context& io_context, - const native_handle_type& handle) - : overlapped_handle(io_context, handle) - { - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a stream_handle from another. - /** - * This constructor moves a stream handle from one object to another. - * - * @param other The other stream_handle object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c stream_handle(io_context&) constructor. - */ - stream_handle(stream_handle&& other) - : overlapped_handle(std::move(other)) - { - } - - /// Move-assign a stream_handle from another. - /** - * This assignment operator moves a stream handle from one object to - * another. - * - * @param other The other stream_handle object from which the move - * will occur. - * - * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c stream_handle(io_context&) constructor. - */ - stream_handle& operator=(stream_handle&& other) - { - overlapped_handle::operator=(std::move(other)); - return *this; - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Write some data to the handle. - /** - * This function is used to write data to the stream handle. The function call - * will block until one or more bytes of the data has been written - * successfully, or until an error occurs. - * - * @param buffers One or more data buffers to be written to the handle. - * - * @returns The number of bytes written. - * - * @throws asio::system_error Thrown on failure. An error code of - * asio::error::eof indicates that the connection was closed by the - * peer. - * - * @note The write_some operation may not transmit all of the data to the - * peer. Consider using the @ref write function if you need to ensure that - * all data is written before the blocking operation completes. - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code - * handle.write_some(asio::buffer(data, size)); - * @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t write_some(const ConstBufferSequence& buffers) - { - asio::error_code ec; - std::size_t s = this->get_service().write_some( - this->get_implementation(), buffers, ec); - asio::detail::throw_error(ec, "write_some"); - return s; - } - - /// Write some data to the handle. - /** - * This function is used to write data to the stream handle. The function call - * will block until one or more bytes of the data has been written - * successfully, or until an error occurs. - * - * @param buffers One or more data buffers to be written to the handle. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes written. Returns 0 if an error occurred. - * - * @note The write_some operation may not transmit all of the data to the - * peer. Consider using the @ref write function if you need to ensure that - * all data is written before the blocking operation completes. - */ - template - std::size_t write_some(const ConstBufferSequence& buffers, - asio::error_code& ec) - { - return this->get_service().write_some( - this->get_implementation(), buffers, ec); - } - - /// Start an asynchronous write. - /** - * This function is used to asynchronously write data to the stream handle. - * The function call always returns immediately. - * - * @param buffers One or more data buffers to be written to the handle. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the write operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes written. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The write operation may not transmit all of the data to the peer. - * Consider using the @ref async_write function if you need to ensure that all - * data is written before the asynchronous operation completes. - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code - * handle.async_write_some(asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_write_some(const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - - asio::async_completion init(handler); - - this->get_service().async_write_some( - this->get_implementation(), buffers, init.completion_handler); - - return init.result.get(); - } - - /// Read some data from the handle. - /** - * This function is used to read data from the stream handle. The function - * call will block until one or more bytes of data has been read successfully, - * or until an error occurs. - * - * @param buffers One or more buffers into which the data will be read. - * - * @returns The number of bytes read. - * - * @throws asio::system_error Thrown on failure. An error code of - * asio::error::eof indicates that the connection was closed by the - * peer. - * - * @note The read_some operation may not read all of the requested number of - * bytes. Consider using the @ref read function if you need to ensure that - * the requested amount of data is read before the blocking operation - * completes. - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code - * handle.read_some(asio::buffer(data, size)); - * @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - std::size_t read_some(const MutableBufferSequence& buffers) - { - asio::error_code ec; - std::size_t s = this->get_service().read_some( - this->get_implementation(), buffers, ec); - asio::detail::throw_error(ec, "read_some"); - return s; - } - - /// Read some data from the handle. - /** - * This function is used to read data from the stream handle. The function - * call will block until one or more bytes of data has been read successfully, - * or until an error occurs. - * - * @param buffers One or more buffers into which the data will be read. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes read. Returns 0 if an error occurred. - * - * @note The read_some operation may not read all of the requested number of - * bytes. Consider using the @ref read function if you need to ensure that - * the requested amount of data is read before the blocking operation - * completes. - */ - template - std::size_t read_some(const MutableBufferSequence& buffers, - asio::error_code& ec) - { - return this->get_service().read_some( - this->get_implementation(), buffers, ec); - } - - /// Start an asynchronous read. - /** - * This function is used to asynchronously read data from the stream handle. - * The function call always returns immediately. - * - * @param buffers One or more buffers into which the data will be read. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the read operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * std::size_t bytes_transferred // Number of bytes read. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @note The read operation may not read all of the requested number of bytes. - * Consider using the @ref async_read function if you need to ensure that the - * requested amount of data is read before the asynchronous operation - * completes. - * - * @par Example - * To read into a single data buffer use the @ref buffer function as follows: - * @code - * handle.async_read_some(asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on reading into multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_read_some(const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler) - { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - - asio::async_completion init(handler); - - this->get_service().async_read_some( - this->get_implementation(), buffers, init.completion_handler); - - return init.result.get(); - } -}; -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -} // namespace windows -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_WINDOWS_STREAM_HANDLE) - // || defined(GENERATING_DOCUMENTATION) - -#endif // ASIO_WINDOWS_STREAM_HANDLE_HPP diff --git a/tools/sdk/include/asio/asio/windows/stream_handle_service.hpp b/tools/sdk/include/asio/asio/windows/stream_handle_service.hpp deleted file mode 100644 index 1c665d5e1e0..00000000000 --- a/tools/sdk/include/asio/asio/windows/stream_handle_service.hpp +++ /dev/null @@ -1,210 +0,0 @@ -// -// windows/stream_handle_service.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_WINDOWS_STREAM_HANDLE_SERVICE_HPP -#define ASIO_WINDOWS_STREAM_HANDLE_SERVICE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if defined(ASIO_ENABLE_OLD_SERVICES) - -#if defined(ASIO_HAS_WINDOWS_STREAM_HANDLE) \ - || defined(GENERATING_DOCUMENTATION) - -#include -#include "asio/async_result.hpp" -#include "asio/detail/win_iocp_handle_service.hpp" -#include "asio/error.hpp" -#include "asio/io_context.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace windows { - -/// Default service implementation for a stream handle. -class stream_handle_service -#if defined(GENERATING_DOCUMENTATION) - : public asio::io_context::service -#else - : public asio::detail::service_base -#endif -{ -public: -#if defined(GENERATING_DOCUMENTATION) - /// The unique service identifier. - static asio::io_context::id id; -#endif - -private: - // The type of the platform-specific implementation. - typedef detail::win_iocp_handle_service service_impl_type; - -public: - /// The type of a stream handle implementation. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined implementation_type; -#else - typedef service_impl_type::implementation_type implementation_type; -#endif - - /// The native handle type. -#if defined(GENERATING_DOCUMENTATION) - typedef implementation_defined native_handle_type; -#else - typedef service_impl_type::native_handle_type native_handle_type; -#endif - - /// Construct a new stream handle service for the specified io_context. - explicit stream_handle_service(asio::io_context& io_context) - : asio::detail::service_base(io_context), - service_impl_(io_context) - { - } - - /// Construct a new stream handle implementation. - void construct(implementation_type& impl) - { - service_impl_.construct(impl); - } - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move-construct a new stream handle implementation. - void move_construct(implementation_type& impl, - implementation_type& other_impl) - { - service_impl_.move_construct(impl, other_impl); - } - - /// Move-assign from another stream handle implementation. - void move_assign(implementation_type& impl, - stream_handle_service& other_service, - implementation_type& other_impl) - { - service_impl_.move_assign(impl, other_service.service_impl_, other_impl); - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Destroy a stream handle implementation. - void destroy(implementation_type& impl) - { - service_impl_.destroy(impl); - } - - /// Assign an existing native handle to a stream handle. - ASIO_SYNC_OP_VOID assign(implementation_type& impl, - const native_handle_type& handle, asio::error_code& ec) - { - service_impl_.assign(impl, handle, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Determine whether the handle is open. - bool is_open(const implementation_type& impl) const - { - return service_impl_.is_open(impl); - } - - /// Close a stream handle implementation. - ASIO_SYNC_OP_VOID close(implementation_type& impl, - asio::error_code& ec) - { - service_impl_.close(impl, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Get the native handle implementation. - native_handle_type native_handle(implementation_type& impl) - { - return service_impl_.native_handle(impl); - } - - /// Cancel all asynchronous operations associated with the handle. - ASIO_SYNC_OP_VOID cancel(implementation_type& impl, - asio::error_code& ec) - { - service_impl_.cancel(impl, ec); - ASIO_SYNC_OP_VOID_RETURN(ec); - } - - /// Write the given data to the stream. - template - std::size_t write_some(implementation_type& impl, - const ConstBufferSequence& buffers, asio::error_code& ec) - { - return service_impl_.write_some(impl, buffers, ec); - } - - /// Start an asynchronous write. - template - ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) - async_write_some(implementation_type& impl, - const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler) - { - asio::async_completion init(handler); - - service_impl_.async_write_some(impl, buffers, init.completion_handler); - - return init.result.get(); - } - - /// Read some data from the stream. - template - std::size_t read_some(implementation_type& impl, - const MutableBufferSequence& buffers, asio::error_code& ec) - { - return service_impl_.read_some(impl, buffers, ec); - } - - /// Start an asynchronous read. - template - ASIO_INITFN_RESULT_TYPE(ReadHandler, - void (asio::error_code, std::size_t)) - async_read_some(implementation_type& impl, - const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler) - { - asio::async_completion init(handler); - - service_impl_.async_read_some(impl, buffers, init.completion_handler); - - return init.result.get(); - } - -private: - // Destroy all user-defined handler objects owned by the service. - void shutdown() - { - service_impl_.shutdown(); - } - - // The platform-specific implementation. - service_impl_type service_impl_; -}; - -} // namespace windows -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // defined(ASIO_HAS_WINDOWS_STREAM_HANDLE) - // || defined(GENERATING_DOCUMENTATION) - -#endif // defined(ASIO_ENABLE_OLD_SERVICES) - -#endif // ASIO_WINDOWS_STREAM_HANDLE_SERVICE_HPP diff --git a/tools/sdk/include/asio/asio/write.hpp b/tools/sdk/include/asio/asio/write.hpp deleted file mode 100644 index 517a8420537..00000000000 --- a/tools/sdk/include/asio/asio/write.hpp +++ /dev/null @@ -1,927 +0,0 @@ -// -// write.hpp -// ~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_WRITE_HPP -#define ASIO_WRITE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/async_result.hpp" -#include "asio/buffer.hpp" -#include "asio/error.hpp" - -#if !defined(ASIO_NO_EXTENSIONS) -# include "asio/basic_streambuf_fwd.hpp" -#endif // !defined(ASIO_NO_EXTENSIONS) - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/** - * @defgroup write asio::write - * - * @brief Write a certain amount of data to a stream before returning. - */ -/*@{*/ - -/// Write all of the supplied data to a stream before returning. -/** - * This function is used to write a certain number of bytes of data to a stream. - * The call will block until one of the following conditions is true: - * - * @li All of the data in the supplied buffers has been written. That is, the - * bytes transferred is equal to the sum of the buffer sizes. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * write_some function. - * - * @param s The stream to which the data is to be written. The type must support - * the SyncWriteStream concept. - * - * @param buffers One or more buffers containing the data to be written. The sum - * of the buffer sizes indicates the maximum number of bytes to write to the - * stream. - * - * @returns The number of bytes transferred. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code asio::write(s, asio::buffer(data, size)); @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - * - * @note This overload is equivalent to calling: - * @code asio::write( - * s, buffers, - * asio::transfer_all()); @endcode - */ -template -std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers, - typename enable_if< - is_const_buffer_sequence::value - >::type* = 0); - -/// Write all of the supplied data to a stream before returning. -/** - * This function is used to write a certain number of bytes of data to a stream. - * The call will block until one of the following conditions is true: - * - * @li All of the data in the supplied buffers has been written. That is, the - * bytes transferred is equal to the sum of the buffer sizes. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * write_some function. - * - * @param s The stream to which the data is to be written. The type must support - * the SyncWriteStream concept. - * - * @param buffers One or more buffers containing the data to be written. The sum - * of the buffer sizes indicates the maximum number of bytes to write to the - * stream. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes transferred. - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code asio::write(s, asio::buffer(data, size), ec); @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - * - * @note This overload is equivalent to calling: - * @code asio::write( - * s, buffers, - * asio::transfer_all(), ec); @endcode - */ -template -std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers, - asio::error_code& ec, - typename enable_if< - is_const_buffer_sequence::value - >::type* = 0); - -/// Write a certain amount of data to a stream before returning. -/** - * This function is used to write a certain number of bytes of data to a stream. - * The call will block until one of the following conditions is true: - * - * @li All of the data in the supplied buffers has been written. That is, the - * bytes transferred is equal to the sum of the buffer sizes. - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the stream's - * write_some function. - * - * @param s The stream to which the data is to be written. The type must support - * the SyncWriteStream concept. - * - * @param buffers One or more buffers containing the data to be written. The sum - * of the buffer sizes indicates the maximum number of bytes to write to the - * stream. - * - * @param completion_condition The function object to be called to determine - * whether the write operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest write_some operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the write operation is complete. A - * non-zero return value indicates the maximum number of bytes to be written on - * the next call to the stream's write_some function. - * - * @returns The number of bytes transferred. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code asio::write(s, asio::buffer(data, size), - * asio::transfer_at_least(32)); @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ -template -std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers, - CompletionCondition completion_condition, - typename enable_if< - is_const_buffer_sequence::value - >::type* = 0); - -/// Write a certain amount of data to a stream before returning. -/** - * This function is used to write a certain number of bytes of data to a stream. - * The call will block until one of the following conditions is true: - * - * @li All of the data in the supplied buffers has been written. That is, the - * bytes transferred is equal to the sum of the buffer sizes. - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the stream's - * write_some function. - * - * @param s The stream to which the data is to be written. The type must support - * the SyncWriteStream concept. - * - * @param buffers One or more buffers containing the data to be written. The sum - * of the buffer sizes indicates the maximum number of bytes to write to the - * stream. - * - * @param completion_condition The function object to be called to determine - * whether the write operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest write_some operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the write operation is complete. A - * non-zero return value indicates the maximum number of bytes to be written on - * the next call to the stream's write_some function. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes written. If an error occurs, returns the total - * number of bytes successfully transferred prior to the error. - */ -template -std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers, - CompletionCondition completion_condition, asio::error_code& ec, - typename enable_if< - is_const_buffer_sequence::value - >::type* = 0); - -/// Write all of the supplied data to a stream before returning. -/** - * This function is used to write a certain number of bytes of data to a stream. - * The call will block until one of the following conditions is true: - * - * @li All of the data in the supplied dynamic buffer sequence has been written. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * write_some function. - * - * @param s The stream to which the data is to be written. The type must support - * the SyncWriteStream concept. - * - * @param buffers The dynamic buffer sequence from which data will be written. - * Successfully written data is automatically consumed from the buffers. - * - * @returns The number of bytes transferred. - * - * @throws asio::system_error Thrown on failure. - * - * @note This overload is equivalent to calling: - * @code asio::write( - * s, buffers, - * asio::transfer_all()); @endcode - */ -template -std::size_t write(SyncWriteStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - typename enable_if< - is_dynamic_buffer::type>::value - >::type* = 0); - -/// Write all of the supplied data to a stream before returning. -/** - * This function is used to write a certain number of bytes of data to a stream. - * The call will block until one of the following conditions is true: - * - * @li All of the data in the supplied dynamic buffer sequence has been written. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * write_some function. - * - * @param s The stream to which the data is to be written. The type must support - * the SyncWriteStream concept. - * - * @param buffers The dynamic buffer sequence from which data will be written. - * Successfully written data is automatically consumed from the buffers. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes transferred. - * - * @note This overload is equivalent to calling: - * @code asio::write( - * s, buffers, - * asio::transfer_all(), ec); @endcode - */ -template -std::size_t write(SyncWriteStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - asio::error_code& ec, - typename enable_if< - is_dynamic_buffer::type>::value - >::type* = 0); - -/// Write a certain amount of data to a stream before returning. -/** - * This function is used to write a certain number of bytes of data to a stream. - * The call will block until one of the following conditions is true: - * - * @li All of the data in the supplied dynamic buffer sequence has been written. - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the stream's - * write_some function. - * - * @param s The stream to which the data is to be written. The type must support - * the SyncWriteStream concept. - * - * @param buffers The dynamic buffer sequence from which data will be written. - * Successfully written data is automatically consumed from the buffers. - * - * @param completion_condition The function object to be called to determine - * whether the write operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest write_some operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the write operation is complete. A - * non-zero return value indicates the maximum number of bytes to be written on - * the next call to the stream's write_some function. - * - * @returns The number of bytes transferred. - * - * @throws asio::system_error Thrown on failure. - */ -template -std::size_t write(SyncWriteStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - CompletionCondition completion_condition, - typename enable_if< - is_dynamic_buffer::type>::value - >::type* = 0); - -/// Write a certain amount of data to a stream before returning. -/** - * This function is used to write a certain number of bytes of data to a stream. - * The call will block until one of the following conditions is true: - * - * @li All of the data in the supplied dynamic buffer sequence has been written. - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the stream's - * write_some function. - * - * @param s The stream to which the data is to be written. The type must support - * the SyncWriteStream concept. - * - * @param buffers The dynamic buffer sequence from which data will be written. - * Successfully written data is automatically consumed from the buffers. - * - * @param completion_condition The function object to be called to determine - * whether the write operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest write_some operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the write operation is complete. A - * non-zero return value indicates the maximum number of bytes to be written on - * the next call to the stream's write_some function. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes written. If an error occurs, returns the total - * number of bytes successfully transferred prior to the error. - */ -template -std::size_t write(SyncWriteStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - CompletionCondition completion_condition, asio::error_code& ec, - typename enable_if< - is_dynamic_buffer::type>::value - >::type* = 0); - -#if !defined(ASIO_NO_EXTENSIONS) -#if !defined(ASIO_NO_IOSTREAM) - -/// Write all of the supplied data to a stream before returning. -/** - * This function is used to write a certain number of bytes of data to a stream. - * The call will block until one of the following conditions is true: - * - * @li All of the data in the supplied basic_streambuf has been written. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * write_some function. - * - * @param s The stream to which the data is to be written. The type must support - * the SyncWriteStream concept. - * - * @param b The basic_streambuf object from which data will be written. - * - * @returns The number of bytes transferred. - * - * @throws asio::system_error Thrown on failure. - * - * @note This overload is equivalent to calling: - * @code asio::write( - * s, b, - * asio::transfer_all()); @endcode - */ -template -std::size_t write(SyncWriteStream& s, basic_streambuf& b); - -/// Write all of the supplied data to a stream before returning. -/** - * This function is used to write a certain number of bytes of data to a stream. - * The call will block until one of the following conditions is true: - * - * @li All of the data in the supplied basic_streambuf has been written. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * write_some function. - * - * @param s The stream to which the data is to be written. The type must support - * the SyncWriteStream concept. - * - * @param b The basic_streambuf object from which data will be written. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes transferred. - * - * @note This overload is equivalent to calling: - * @code asio::write( - * s, b, - * asio::transfer_all(), ec); @endcode - */ -template -std::size_t write(SyncWriteStream& s, basic_streambuf& b, - asio::error_code& ec); - -/// Write a certain amount of data to a stream before returning. -/** - * This function is used to write a certain number of bytes of data to a stream. - * The call will block until one of the following conditions is true: - * - * @li All of the data in the supplied basic_streambuf has been written. - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the stream's - * write_some function. - * - * @param s The stream to which the data is to be written. The type must support - * the SyncWriteStream concept. - * - * @param b The basic_streambuf object from which data will be written. - * - * @param completion_condition The function object to be called to determine - * whether the write operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest write_some operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the write operation is complete. A - * non-zero return value indicates the maximum number of bytes to be written on - * the next call to the stream's write_some function. - * - * @returns The number of bytes transferred. - * - * @throws asio::system_error Thrown on failure. - */ -template -std::size_t write(SyncWriteStream& s, basic_streambuf& b, - CompletionCondition completion_condition); - -/// Write a certain amount of data to a stream before returning. -/** - * This function is used to write a certain number of bytes of data to a stream. - * The call will block until one of the following conditions is true: - * - * @li All of the data in the supplied basic_streambuf has been written. - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the stream's - * write_some function. - * - * @param s The stream to which the data is to be written. The type must support - * the SyncWriteStream concept. - * - * @param b The basic_streambuf object from which data will be written. - * - * @param completion_condition The function object to be called to determine - * whether the write operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest write_some operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the write operation is complete. A - * non-zero return value indicates the maximum number of bytes to be written on - * the next call to the stream's write_some function. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes written. If an error occurs, returns the total - * number of bytes successfully transferred prior to the error. - */ -template -std::size_t write(SyncWriteStream& s, basic_streambuf& b, - CompletionCondition completion_condition, asio::error_code& ec); - -#endif // !defined(ASIO_NO_IOSTREAM) -#endif // !defined(ASIO_NO_EXTENSIONS) - -/*@}*/ -/** - * @defgroup async_write asio::async_write - * - * @brief Start an asynchronous operation to write a certain amount of data to a - * stream. - */ -/*@{*/ - -/// Start an asynchronous operation to write all of the supplied data to a -/// stream. -/** - * This function is used to asynchronously write a certain number of bytes of - * data to a stream. The function call always returns immediately. The - * asynchronous operation will continue until one of the following conditions - * is true: - * - * @li All of the data in the supplied buffers has been written. That is, the - * bytes transferred is equal to the sum of the buffer sizes. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * async_write_some function, and is known as a composed operation. The - * program must ensure that the stream performs no other write operations (such - * as async_write, the stream's async_write_some function, or any other composed - * operations that perform writes) until this operation completes. - * - * @param s The stream to which the data is to be written. The type must support - * the AsyncWriteStream concept. - * - * @param buffers One or more buffers containing the data to be written. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the write operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * - * std::size_t bytes_transferred // Number of bytes written from the - * // buffers. If an error occurred, - * // this will be less than the sum - * // of the buffer sizes. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code - * asio::async_write(s, asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ -template -ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) -async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler, - typename enable_if< - is_const_buffer_sequence::value - >::type* = 0); - -/// Start an asynchronous operation to write a certain amount of data to a -/// stream. -/** - * This function is used to asynchronously write a certain number of bytes of - * data to a stream. The function call always returns immediately. The - * asynchronous operation will continue until one of the following conditions - * is true: - * - * @li All of the data in the supplied buffers has been written. That is, the - * bytes transferred is equal to the sum of the buffer sizes. - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the stream's - * async_write_some function, and is known as a composed operation. The - * program must ensure that the stream performs no other write operations (such - * as async_write, the stream's async_write_some function, or any other composed - * operations that perform writes) until this operation completes. - * - * @param s The stream to which the data is to be written. The type must support - * the AsyncWriteStream concept. - * - * @param buffers One or more buffers containing the data to be written. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param completion_condition The function object to be called to determine - * whether the write operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest async_write_some operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the write operation is complete. A - * non-zero return value indicates the maximum number of bytes to be written on - * the next call to the stream's async_write_some function. - * - * @param handler The handler to be called when the write operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * - * std::size_t bytes_transferred // Number of bytes written from the - * // buffers. If an error occurred, - * // this will be less than the sum - * // of the buffer sizes. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code asio::async_write(s, - * asio::buffer(data, size), - * asio::transfer_at_least(32), - * handler); @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ -template -ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) -async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers, - CompletionCondition completion_condition, - ASIO_MOVE_ARG(WriteHandler) handler, - typename enable_if< - is_const_buffer_sequence::value - >::type* = 0); - -/// Start an asynchronous operation to write all of the supplied data to a -/// stream. -/** - * This function is used to asynchronously write a certain number of bytes of - * data to a stream. The function call always returns immediately. The - * asynchronous operation will continue until one of the following conditions - * is true: - * - * @li All of the data in the supplied dynamic buffer sequence has been written. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * async_write_some function, and is known as a composed operation. The - * program must ensure that the stream performs no other write operations (such - * as async_write, the stream's async_write_some function, or any other composed - * operations that perform writes) until this operation completes. - * - * @param s The stream to which the data is to be written. The type must support - * the AsyncWriteStream concept. - * - * @param buffers The dynamic buffer sequence from which data will be written. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. Successfully written - * data is automatically consumed from the buffers. - * - * @param handler The handler to be called when the write operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * - * std::size_t bytes_transferred // Number of bytes written from the - * // buffers. If an error occurred, - * // this will be less than the sum - * // of the buffer sizes. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - */ -template -ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) -async_write(AsyncWriteStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - ASIO_MOVE_ARG(WriteHandler) handler, - typename enable_if< - is_dynamic_buffer::type>::value - >::type* = 0); - -/// Start an asynchronous operation to write a certain amount of data to a -/// stream. -/** - * This function is used to asynchronously write a certain number of bytes of - * data to a stream. The function call always returns immediately. The - * asynchronous operation will continue until one of the following conditions - * is true: - * - * @li All of the data in the supplied dynamic buffer sequence has been written. - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the stream's - * async_write_some function, and is known as a composed operation. The - * program must ensure that the stream performs no other write operations (such - * as async_write, the stream's async_write_some function, or any other composed - * operations that perform writes) until this operation completes. - * - * @param s The stream to which the data is to be written. The type must support - * the AsyncWriteStream concept. - * - * @param buffers The dynamic buffer sequence from which data will be written. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. Successfully written - * data is automatically consumed from the buffers. - * - * @param completion_condition The function object to be called to determine - * whether the write operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest async_write_some operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the write operation is complete. A - * non-zero return value indicates the maximum number of bytes to be written on - * the next call to the stream's async_write_some function. - * - * @param handler The handler to be called when the write operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * - * std::size_t bytes_transferred // Number of bytes written from the - * // buffers. If an error occurred, - * // this will be less than the sum - * // of the buffer sizes. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - */ -template -ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) -async_write(AsyncWriteStream& s, - ASIO_MOVE_ARG(DynamicBuffer) buffers, - CompletionCondition completion_condition, - ASIO_MOVE_ARG(WriteHandler) handler, - typename enable_if< - is_dynamic_buffer::type>::value - >::type* = 0); - -#if !defined(ASIO_NO_EXTENSIONS) -#if !defined(ASIO_NO_IOSTREAM) - -/// Start an asynchronous operation to write all of the supplied data to a -/// stream. -/** - * This function is used to asynchronously write a certain number of bytes of - * data to a stream. The function call always returns immediately. The - * asynchronous operation will continue until one of the following conditions - * is true: - * - * @li All of the data in the supplied basic_streambuf has been written. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the stream's - * async_write_some function, and is known as a composed operation. The - * program must ensure that the stream performs no other write operations (such - * as async_write, the stream's async_write_some function, or any other composed - * operations that perform writes) until this operation completes. - * - * @param s The stream to which the data is to be written. The type must support - * the AsyncWriteStream concept. - * - * @param b A basic_streambuf object from which data will be written. Ownership - * of the streambuf is retained by the caller, which must guarantee that it - * remains valid until the handler is called. - * - * @param handler The handler to be called when the write operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * - * std::size_t bytes_transferred // Number of bytes written from the - * // buffers. If an error occurred, - * // this will be less than the sum - * // of the buffer sizes. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - */ -template -ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) -async_write(AsyncWriteStream& s, basic_streambuf& b, - ASIO_MOVE_ARG(WriteHandler) handler); - -/// Start an asynchronous operation to write a certain amount of data to a -/// stream. -/** - * This function is used to asynchronously write a certain number of bytes of - * data to a stream. The function call always returns immediately. The - * asynchronous operation will continue until one of the following conditions - * is true: - * - * @li All of the data in the supplied basic_streambuf has been written. - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the stream's - * async_write_some function, and is known as a composed operation. The - * program must ensure that the stream performs no other write operations (such - * as async_write, the stream's async_write_some function, or any other composed - * operations that perform writes) until this operation completes. - * - * @param s The stream to which the data is to be written. The type must support - * the AsyncWriteStream concept. - * - * @param b A basic_streambuf object from which data will be written. Ownership - * of the streambuf is retained by the caller, which must guarantee that it - * remains valid until the handler is called. - * - * @param completion_condition The function object to be called to determine - * whether the write operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest async_write_some operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the write operation is complete. A - * non-zero return value indicates the maximum number of bytes to be written on - * the next call to the stream's async_write_some function. - * - * @param handler The handler to be called when the write operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * const asio::error_code& error, // Result of operation. - * - * std::size_t bytes_transferred // Number of bytes written from the - * // buffers. If an error occurred, - * // this will be less than the sum - * // of the buffer sizes. - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - */ -template -ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) -async_write(AsyncWriteStream& s, basic_streambuf& b, - CompletionCondition completion_condition, - ASIO_MOVE_ARG(WriteHandler) handler); - -#endif // !defined(ASIO_NO_IOSTREAM) -#endif // !defined(ASIO_NO_EXTENSIONS) - -/*@}*/ - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/impl/write.hpp" - -#endif // ASIO_WRITE_HPP diff --git a/tools/sdk/include/asio/asio/write_at.hpp b/tools/sdk/include/asio/asio/write_at.hpp deleted file mode 100644 index 5018d210605..00000000000 --- a/tools/sdk/include/asio/asio/write_at.hpp +++ /dev/null @@ -1,677 +0,0 @@ -// -// write_at.hpp -// ~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_WRITE_AT_HPP -#define ASIO_WRITE_AT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/async_result.hpp" -#include "asio/detail/cstdint.hpp" -#include "asio/error.hpp" - -#if !defined(ASIO_NO_EXTENSIONS) -# include "asio/basic_streambuf_fwd.hpp" -#endif // !defined(ASIO_NO_EXTENSIONS) - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/** - * @defgroup write_at asio::write_at - * - * @brief Write a certain amount of data at a specified offset before returning. - */ -/*@{*/ - -/// Write all of the supplied data at the specified offset before returning. -/** - * This function is used to write a certain number of bytes of data to a random - * access device at a specified offset. The call will block until one of the - * following conditions is true: - * - * @li All of the data in the supplied buffers has been written. That is, the - * bytes transferred is equal to the sum of the buffer sizes. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the device's - * write_some_at function. - * - * @param d The device to which the data is to be written. The type must support - * the SyncRandomAccessWriteDevice concept. - * - * @param offset The offset at which the data will be written. - * - * @param buffers One or more buffers containing the data to be written. The sum - * of the buffer sizes indicates the maximum number of bytes to write to the - * device. - * - * @returns The number of bytes transferred. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code asio::write_at(d, 42, asio::buffer(data, size)); @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - * - * @note This overload is equivalent to calling: - * @code asio::write_at( - * d, offset, buffers, - * asio::transfer_all()); @endcode - */ -template -std::size_t write_at(SyncRandomAccessWriteDevice& d, - uint64_t offset, const ConstBufferSequence& buffers); - -/// Write all of the supplied data at the specified offset before returning. -/** - * This function is used to write a certain number of bytes of data to a random - * access device at a specified offset. The call will block until one of the - * following conditions is true: - * - * @li All of the data in the supplied buffers has been written. That is, the - * bytes transferred is equal to the sum of the buffer sizes. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the device's - * write_some_at function. - * - * @param d The device to which the data is to be written. The type must support - * the SyncRandomAccessWriteDevice concept. - * - * @param offset The offset at which the data will be written. - * - * @param buffers One or more buffers containing the data to be written. The sum - * of the buffer sizes indicates the maximum number of bytes to write to the - * device. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes transferred. - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code asio::write_at(d, 42, - * asio::buffer(data, size), ec); @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - * - * @note This overload is equivalent to calling: - * @code asio::write_at( - * d, offset, buffers, - * asio::transfer_all(), ec); @endcode - */ -template -std::size_t write_at(SyncRandomAccessWriteDevice& d, - uint64_t offset, const ConstBufferSequence& buffers, - asio::error_code& ec); - -/// Write a certain amount of data at a specified offset before returning. -/** - * This function is used to write a certain number of bytes of data to a random - * access device at a specified offset. The call will block until one of the - * following conditions is true: - * - * @li All of the data in the supplied buffers has been written. That is, the - * bytes transferred is equal to the sum of the buffer sizes. - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the device's - * write_some_at function. - * - * @param d The device to which the data is to be written. The type must support - * the SyncRandomAccessWriteDevice concept. - * - * @param offset The offset at which the data will be written. - * - * @param buffers One or more buffers containing the data to be written. The sum - * of the buffer sizes indicates the maximum number of bytes to write to the - * device. - * - * @param completion_condition The function object to be called to determine - * whether the write operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest write_some_at operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the write operation is complete. A - * non-zero return value indicates the maximum number of bytes to be written on - * the next call to the device's write_some_at function. - * - * @returns The number of bytes transferred. - * - * @throws asio::system_error Thrown on failure. - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code asio::write_at(d, 42, asio::buffer(data, size), - * asio::transfer_at_least(32)); @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ -template -std::size_t write_at(SyncRandomAccessWriteDevice& d, - uint64_t offset, const ConstBufferSequence& buffers, - CompletionCondition completion_condition); - -/// Write a certain amount of data at a specified offset before returning. -/** - * This function is used to write a certain number of bytes of data to a random - * access device at a specified offset. The call will block until one of the - * following conditions is true: - * - * @li All of the data in the supplied buffers has been written. That is, the - * bytes transferred is equal to the sum of the buffer sizes. - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the device's - * write_some_at function. - * - * @param d The device to which the data is to be written. The type must support - * the SyncRandomAccessWriteDevice concept. - * - * @param offset The offset at which the data will be written. - * - * @param buffers One or more buffers containing the data to be written. The sum - * of the buffer sizes indicates the maximum number of bytes to write to the - * device. - * - * @param completion_condition The function object to be called to determine - * whether the write operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest write_some_at operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the write operation is complete. A - * non-zero return value indicates the maximum number of bytes to be written on - * the next call to the device's write_some_at function. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes written. If an error occurs, returns the total - * number of bytes successfully transferred prior to the error. - */ -template -std::size_t write_at(SyncRandomAccessWriteDevice& d, - uint64_t offset, const ConstBufferSequence& buffers, - CompletionCondition completion_condition, asio::error_code& ec); - -#if !defined(ASIO_NO_EXTENSIONS) -#if !defined(ASIO_NO_IOSTREAM) - -/// Write all of the supplied data at the specified offset before returning. -/** - * This function is used to write a certain number of bytes of data to a random - * access device at a specified offset. The call will block until one of the - * following conditions is true: - * - * @li All of the data in the supplied basic_streambuf has been written. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the device's - * write_some_at function. - * - * @param d The device to which the data is to be written. The type must support - * the SyncRandomAccessWriteDevice concept. - * - * @param offset The offset at which the data will be written. - * - * @param b The basic_streambuf object from which data will be written. - * - * @returns The number of bytes transferred. - * - * @throws asio::system_error Thrown on failure. - * - * @note This overload is equivalent to calling: - * @code asio::write_at( - * d, 42, b, - * asio::transfer_all()); @endcode - */ -template -std::size_t write_at(SyncRandomAccessWriteDevice& d, - uint64_t offset, basic_streambuf& b); - -/// Write all of the supplied data at the specified offset before returning. -/** - * This function is used to write a certain number of bytes of data to a random - * access device at a specified offset. The call will block until one of the - * following conditions is true: - * - * @li All of the data in the supplied basic_streambuf has been written. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the device's - * write_some_at function. - * - * @param d The device to which the data is to be written. The type must support - * the SyncRandomAccessWriteDevice concept. - * - * @param offset The offset at which the data will be written. - * - * @param b The basic_streambuf object from which data will be written. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes transferred. - * - * @note This overload is equivalent to calling: - * @code asio::write_at( - * d, 42, b, - * asio::transfer_all(), ec); @endcode - */ -template -std::size_t write_at(SyncRandomAccessWriteDevice& d, - uint64_t offset, basic_streambuf& b, - asio::error_code& ec); - -/// Write a certain amount of data at a specified offset before returning. -/** - * This function is used to write a certain number of bytes of data to a random - * access device at a specified offset. The call will block until one of the - * following conditions is true: - * - * @li All of the data in the supplied basic_streambuf has been written. - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the device's - * write_some_at function. - * - * @param d The device to which the data is to be written. The type must support - * the SyncRandomAccessWriteDevice concept. - * - * @param offset The offset at which the data will be written. - * - * @param b The basic_streambuf object from which data will be written. - * - * @param completion_condition The function object to be called to determine - * whether the write operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest write_some_at operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the write operation is complete. A - * non-zero return value indicates the maximum number of bytes to be written on - * the next call to the device's write_some_at function. - * - * @returns The number of bytes transferred. - * - * @throws asio::system_error Thrown on failure. - */ -template -std::size_t write_at(SyncRandomAccessWriteDevice& d, uint64_t offset, - basic_streambuf& b, CompletionCondition completion_condition); - -/// Write a certain amount of data at a specified offset before returning. -/** - * This function is used to write a certain number of bytes of data to a random - * access device at a specified offset. The call will block until one of the - * following conditions is true: - * - * @li All of the data in the supplied basic_streambuf has been written. - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the device's - * write_some_at function. - * - * @param d The device to which the data is to be written. The type must support - * the SyncRandomAccessWriteDevice concept. - * - * @param offset The offset at which the data will be written. - * - * @param b The basic_streambuf object from which data will be written. - * - * @param completion_condition The function object to be called to determine - * whether the write operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest write_some_at operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the write operation is complete. A - * non-zero return value indicates the maximum number of bytes to be written on - * the next call to the device's write_some_at function. - * - * @param ec Set to indicate what error occurred, if any. - * - * @returns The number of bytes written. If an error occurs, returns the total - * number of bytes successfully transferred prior to the error. - */ -template -std::size_t write_at(SyncRandomAccessWriteDevice& d, uint64_t offset, - basic_streambuf& b, CompletionCondition completion_condition, - asio::error_code& ec); - -#endif // !defined(ASIO_NO_IOSTREAM) -#endif // !defined(ASIO_NO_EXTENSIONS) - -/*@}*/ -/** - * @defgroup async_write_at asio::async_write_at - * - * @brief Start an asynchronous operation to write a certain amount of data at - * the specified offset. - */ -/*@{*/ - -/// Start an asynchronous operation to write all of the supplied data at the -/// specified offset. -/** - * This function is used to asynchronously write a certain number of bytes of - * data to a random access device at a specified offset. The function call - * always returns immediately. The asynchronous operation will continue until - * one of the following conditions is true: - * - * @li All of the data in the supplied buffers has been written. That is, the - * bytes transferred is equal to the sum of the buffer sizes. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the device's - * async_write_some_at function, and is known as a composed operation. - * The program must ensure that the device performs no overlapping - * write operations (such as async_write_at, the device's async_write_some_at - * function, or any other composed operations that perform writes) until this - * operation completes. Operations are overlapping if the regions defined by - * their offsets, and the numbers of bytes to write, intersect. - * - * @param d The device to which the data is to be written. The type must support - * the AsyncRandomAccessWriteDevice concept. - * - * @param offset The offset at which the data will be written. - * - * @param buffers One or more buffers containing the data to be written. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param handler The handler to be called when the write operation completes. - * Copies will be made of the handler as required. The function signature of - * the handler must be: - * @code void handler( - * // Result of operation. - * const asio::error_code& error, - * - * // Number of bytes written from the buffers. If an error - * // occurred, this will be less than the sum of the buffer sizes. - * std::size_t bytes_transferred - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code - * asio::async_write_at(d, 42, asio::buffer(data, size), handler); - * @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ -template -ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) -async_write_at(AsyncRandomAccessWriteDevice& d, uint64_t offset, - const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler); - -/// Start an asynchronous operation to write a certain amount of data at the -/// specified offset. -/** - * This function is used to asynchronously write a certain number of bytes of - * data to a random access device at a specified offset. The function call - * always returns immediately. The asynchronous operation will continue until - * one of the following conditions is true: - * - * @li All of the data in the supplied buffers has been written. That is, the - * bytes transferred is equal to the sum of the buffer sizes. - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the device's - * async_write_some_at function, and is known as a composed operation. - * The program must ensure that the device performs no overlapping - * write operations (such as async_write_at, the device's async_write_some_at - * function, or any other composed operations that perform writes) until this - * operation completes. Operations are overlapping if the regions defined by - * their offsets, and the numbers of bytes to write, intersect. - * - * @param d The device to which the data is to be written. The type must support - * the AsyncRandomAccessWriteDevice concept. - * - * @param offset The offset at which the data will be written. - * - * @param buffers One or more buffers containing the data to be written. - * Although the buffers object may be copied as necessary, ownership of the - * underlying memory blocks is retained by the caller, which must guarantee - * that they remain valid until the handler is called. - * - * @param completion_condition The function object to be called to determine - * whether the write operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest async_write_some_at operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the write operation is complete. A - * non-zero return value indicates the maximum number of bytes to be written on - * the next call to the device's async_write_some_at function. - * - * @param handler The handler to be called when the write operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * // Result of operation. - * const asio::error_code& error, - * - * // Number of bytes written from the buffers. If an error - * // occurred, this will be less than the sum of the buffer sizes. - * std::size_t bytes_transferred - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - * - * @par Example - * To write a single data buffer use the @ref buffer function as follows: - * @code asio::async_write_at(d, 42, - * asio::buffer(data, size), - * asio::transfer_at_least(32), - * handler); @endcode - * See the @ref buffer documentation for information on writing multiple - * buffers in one go, and how to use it with arrays, boost::array or - * std::vector. - */ -template -ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) -async_write_at(AsyncRandomAccessWriteDevice& d, - uint64_t offset, const ConstBufferSequence& buffers, - CompletionCondition completion_condition, - ASIO_MOVE_ARG(WriteHandler) handler); - -#if !defined(ASIO_NO_EXTENSIONS) -#if !defined(ASIO_NO_IOSTREAM) - -/// Start an asynchronous operation to write all of the supplied data at the -/// specified offset. -/** - * This function is used to asynchronously write a certain number of bytes of - * data to a random access device at a specified offset. The function call - * always returns immediately. The asynchronous operation will continue until - * one of the following conditions is true: - * - * @li All of the data in the supplied basic_streambuf has been written. - * - * @li An error occurred. - * - * This operation is implemented in terms of zero or more calls to the device's - * async_write_some_at function, and is known as a composed operation. - * The program must ensure that the device performs no overlapping - * write operations (such as async_write_at, the device's async_write_some_at - * function, or any other composed operations that perform writes) until this - * operation completes. Operations are overlapping if the regions defined by - * their offsets, and the numbers of bytes to write, intersect. - * - * @param d The device to which the data is to be written. The type must support - * the AsyncRandomAccessWriteDevice concept. - * - * @param offset The offset at which the data will be written. - * - * @param b A basic_streambuf object from which data will be written. Ownership - * of the streambuf is retained by the caller, which must guarantee that it - * remains valid until the handler is called. - * - * @param handler The handler to be called when the write operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * // Result of operation. - * const asio::error_code& error, - * - * // Number of bytes written from the buffers. If an error - * // occurred, this will be less than the sum of the buffer sizes. - * std::size_t bytes_transferred - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - */ -template -ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) -async_write_at(AsyncRandomAccessWriteDevice& d, uint64_t offset, - basic_streambuf& b, ASIO_MOVE_ARG(WriteHandler) handler); - -/// Start an asynchronous operation to write a certain amount of data at the -/// specified offset. -/** - * This function is used to asynchronously write a certain number of bytes of - * data to a random access device at a specified offset. The function call - * always returns immediately. The asynchronous operation will continue until - * one of the following conditions is true: - * - * @li All of the data in the supplied basic_streambuf has been written. - * - * @li The completion_condition function object returns 0. - * - * This operation is implemented in terms of zero or more calls to the device's - * async_write_some_at function, and is known as a composed operation. - * The program must ensure that the device performs no overlapping - * write operations (such as async_write_at, the device's async_write_some_at - * function, or any other composed operations that perform writes) until this - * operation completes. Operations are overlapping if the regions defined by - * their offsets, and the numbers of bytes to write, intersect. - * - * @param d The device to which the data is to be written. The type must support - * the AsyncRandomAccessWriteDevice concept. - * - * @param offset The offset at which the data will be written. - * - * @param b A basic_streambuf object from which data will be written. Ownership - * of the streambuf is retained by the caller, which must guarantee that it - * remains valid until the handler is called. - * - * @param completion_condition The function object to be called to determine - * whether the write operation is complete. The signature of the function object - * must be: - * @code std::size_t completion_condition( - * // Result of latest async_write_some_at operation. - * const asio::error_code& error, - * - * // Number of bytes transferred so far. - * std::size_t bytes_transferred - * ); @endcode - * A return value of 0 indicates that the write operation is complete. A - * non-zero return value indicates the maximum number of bytes to be written on - * the next call to the device's async_write_some_at function. - * - * @param handler The handler to be called when the write operation completes. - * Copies will be made of the handler as required. The function signature of the - * handler must be: - * @code void handler( - * // Result of operation. - * const asio::error_code& error, - * - * // Number of bytes written from the buffers. If an error - * // occurred, this will be less than the sum of the buffer sizes. - * std::size_t bytes_transferred - * ); @endcode - * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation of - * the handler will be performed in a manner equivalent to using - * asio::io_context::post(). - */ -template -ASIO_INITFN_RESULT_TYPE(WriteHandler, - void (asio::error_code, std::size_t)) -async_write_at(AsyncRandomAccessWriteDevice& d, uint64_t offset, - basic_streambuf& b, CompletionCondition completion_condition, - ASIO_MOVE_ARG(WriteHandler) handler); - -#endif // !defined(ASIO_NO_IOSTREAM) -#endif // !defined(ASIO_NO_EXTENSIONS) - -/*@}*/ - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/impl/write_at.hpp" - -#endif // ASIO_WRITE_AT_HPP diff --git a/tools/sdk/include/asio/asio/yield.hpp b/tools/sdk/include/asio/asio/yield.hpp deleted file mode 100644 index b527ac9b4b2..00000000000 --- a/tools/sdk/include/asio/asio/yield.hpp +++ /dev/null @@ -1,23 +0,0 @@ -// -// yield.hpp -// ~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#include "coroutine.hpp" - -#ifndef reenter -# define reenter(c) ASIO_CORO_REENTER(c) -#endif - -#ifndef yield -# define yield ASIO_CORO_YIELD -#endif - -#ifndef fork -# define fork ASIO_CORO_FORK -#endif diff --git a/tools/sdk/include/asio/esp_asio_config.h b/tools/sdk/include/asio/esp_asio_config.h deleted file mode 100644 index accccad0da7..00000000000 --- a/tools/sdk/include/asio/esp_asio_config.h +++ /dev/null @@ -1,45 +0,0 @@ -// 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. -#ifndef _ESP_ASIO_CONFIG_H_ -#define _ESP_ASIO_CONFIG_H_ - -// -// Enabling exceptions only when they are enabled in menuconfig -// -# include -# ifndef CONFIG_CXX_EXCEPTIONS -# define ASIO_NO_EXCEPTIONS -# endif // CONFIG_CXX_EXCEPTIONS - -// -// LWIP compatifility inet and address macros/functions -// -# define LWIP_COMPAT_SOCKET_INET 1 -# define LWIP_COMPAT_SOCKET_ADDR 1 - -// -// Specific ASIO feature flags -// -# define ASIO_DISABLE_SERIAL_PORT -# define ASIO_SEPARATE_COMPILATION -# define ASIO_STANDALONE -# define ASIO_NO_TYPEID -# define ASIO_DISABLE_SIGNAL -# define ASIO_HAS_PTHREADS -# define ASIO_DISABLE_EPOLL -# define ASIO_DISABLE_EVENTFD -# define ASIO_DISABLE_SIGNAL -# define ASIO_DISABLE_SIGACTION - -#endif // _ESP_ASIO_CONFIG_H_ diff --git a/tools/sdk/include/asio/esp_exception.h b/tools/sdk/include/asio/esp_exception.h deleted file mode 100644 index 3c5c043755f..00000000000 --- a/tools/sdk/include/asio/esp_exception.h +++ /dev/null @@ -1,39 +0,0 @@ - -// 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. -#ifndef _ESP_EXCEPTION_H_ -#define _ESP_EXCEPTION_H_ - -// -// This exception stub is enabled only if exceptions are disabled in menuconfig -// -#if !defined(CONFIG_CXX_EXCEPTIONS) && defined (ASIO_NO_EXCEPTIONS) - -#include "esp_log.h" - -// -// asio exception stub -// -namespace asio { -namespace detail { -template -void throw_exception(const Exception& e) -{ - ESP_LOGE("esp32_asio_exception", "Caught exception: %s!", e.what()); - abort(); -} -}} -#endif // CONFIG_CXX_EXCEPTIONS==1 && defined (ASIO_NO_EXCEPTIONS) - -#endif // _ESP_EXCEPTION_H_ diff --git a/tools/sdk/include/bootloader_support/bootloader_clock.h b/tools/sdk/include/bootloader_support/bootloader_clock.h deleted file mode 100644 index 9eaba46a8cd..00000000000 --- a/tools/sdk/include/bootloader_support/bootloader_clock.h +++ /dev/null @@ -1,21 +0,0 @@ -// 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. - -#pragma once - -/** @brief Configure clocks for early boot - * - * Called by bootloader, or by the app if the bootloader version is old (pre v2.1). - */ -void bootloader_clock_configure(void); diff --git a/tools/sdk/include/bootloader_support/bootloader_common.h b/tools/sdk/include/bootloader_support/bootloader_common.h deleted file mode 100644 index e884856f6d2..00000000000 --- a/tools/sdk/include/bootloader_support/bootloader_common.h +++ /dev/null @@ -1,118 +0,0 @@ -// 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. - -#pragma once -#include "esp_flash_data_types.h" -#include "esp_image_format.h" - -/// Type of hold a GPIO in low state -typedef enum { - GPIO_LONG_HOLD = 1, /*!< The long hold GPIO */ - GPIO_SHORT_HOLD = -1, /*!< The short hold GPIO */ - GPIO_NOT_HOLD = 0 /*!< If the GPIO input is not low */ -} esp_comm_gpio_hold_t; - -/** - * @brief Calculate crc for the OTA data partition. - * - * @param[in] ota_data The OTA data partition. - * @return Returns crc value. - */ -uint32_t bootloader_common_ota_select_crc(const esp_ota_select_entry_t *s); - -/** - * @brief Verifies the validity of the OTA data partition - * - * @param[in] ota_data The OTA data partition. - * @return Returns true on valid, false otherwise. - */ -bool bootloader_common_ota_select_valid(const esp_ota_select_entry_t *s); - -/** - * @brief Check if the GPIO input is a long hold or a short hold. - * - * Number of the GPIO input will be configured as an input with internal pull-up enabled. - * If the GPIO input is held low continuously for delay_sec period then it is a long hold. - * If the GPIO input is held low for less period then it is a short hold. - * - * @param[in] num_pin Number of the GPIO input. - * @param[in] delay_sec Input must be driven low for at least this long, continuously. - * @return esp_comm_gpio_hold_t Defines type of hold a GPIO in low state. - */ -esp_comm_gpio_hold_t bootloader_common_check_long_hold_gpio(uint32_t num_pin, uint32_t delay_sec); - -/** - * @brief Erase the partition data that is specified in the transferred list. - * - * @param[in] list_erase String containing a list of cleared partitions. Like this "nvs, phy". The string must be null-terminal. - * @param[in] ota_data_erase If true then the OTA data partition will be cleared (if there is it in partition table). - * @return Returns true on success, false otherwise. - */ -bool bootloader_common_erase_part_type_data(const char *list_erase, bool ota_data_erase); - -/** - * @brief Determines if the list contains the label - * - * @param[in] list A string of names delimited by commas or spaces. Like this "nvs, phy, data". The string must be null-terminated. - * @param[in] label The substring that will be searched in the list. - * @return Returns true if the list contains the label, false otherwise. - */ -bool bootloader_common_label_search(const char *list, char *label); - -/** - * @brief Calculates a sha-256 for a given partition or returns a appended digest. - * - * This function can be used to return the SHA-256 digest of application, bootloader and data partitions. - * For apps with SHA-256 appended to the app image, the result is the appended SHA-256 value for the app image content. - * The hash is verified before returning, if app content is invalid then the function returns ESP_ERR_IMAGE_INVALID. - * For apps without SHA-256 appended to the image, the result is the SHA-256 of all bytes in the app image. - * For other partition types, the result is the SHA-256 of the entire partition. - * - * @param[in] address Address of partition. - * @param[in] size Size of partition. - * @param[in] type Type of partition. For applications the type is 0, otherwise type is data. - * @param[out] out_sha_256 Returned SHA-256 digest for a given partition. - * - * @return - * - ESP_OK: In case of successful operation. - * - ESP_ERR_INVALID_ARG: The size was 0 or the sha_256 was NULL. - * - ESP_ERR_NO_MEM: Cannot allocate memory for sha256 operation. - * - ESP_ERR_IMAGE_INVALID: App partition doesn't contain a valid app image. - * - ESP_FAIL: An allocation error occurred. - */ -esp_err_t bootloader_common_get_sha256_of_partition(uint32_t address, uint32_t size, int type, uint8_t *out_sha_256); - -/** - * @brief Check if the image (bootloader and application) has valid chip ID and revision - * - * @param img_hdr: image header - * @return - * - ESP_OK: image and chip are matched well - * - ESP_FAIL: image doesn't match to the chip - */ -esp_err_t bootloader_common_check_chip_validity(const esp_image_header_t* img_hdr); - - -/** - * @brief Configure VDDSDIO, call this API to rise VDDSDIO to 1.9V when VDDSDIO regulator is enabled as 1.8V mode. - */ -void bootloader_common_vddsdio_configure(); - -/** - * @brief Set the flash CS setup and hold time. - * - * CS setup time is recomemded to be 1.5T, and CS hold time is recommended to be 2.5T. - * cs_setup = 1, cs_setup_time = 0; cs_hold = 1, cs_hold_time = 1 - */ -void bootloader_common_set_flash_cs_timing(); diff --git a/tools/sdk/include/bootloader_support/bootloader_random.h b/tools/sdk/include/bootloader_support/bootloader_random.h deleted file mode 100644 index bb3b2a81dde..00000000000 --- a/tools/sdk/include/bootloader_support/bootloader_random.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2010-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. - -#pragma once - -#include - -/** - * @brief Enable early entropy source for RNG - * - * Uses the SAR ADC to feed entropy into the HWRNG. The ADC is put - * into a test mode that reads the 1.1V internal reference source and - * feeds the LSB of data into the HWRNG. - * - * Can also be used from app code early during operation, if entropy - * is required before WiFi stack is initialised. Call this function - * from app code only if WiFi/BT are not yet enabled and I2S and SAR - * ADC are not in use. - * - * Call bootloader_random_disable() when done. - */ -void bootloader_random_enable(void); - -/** - * @brief Disable early entropy source for RNG - * - * Disables SAR ADC source and resets the I2S hardware. - * - */ -void bootloader_random_disable(void); - -/** - * @brief Fill buffer with 'length' random bytes - * - * @param buffer Pointer to buffer - * @param length This many bytes of random data will be copied to buffer - */ -void bootloader_fill_random(void *buffer, size_t length); diff --git a/tools/sdk/include/bootloader_support/bootloader_util.h b/tools/sdk/include/bootloader_support/bootloader_util.h deleted file mode 100644 index 30f8bd8d2c0..00000000000 --- a/tools/sdk/include/bootloader_support/bootloader_util.h +++ /dev/null @@ -1,34 +0,0 @@ -// 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. - -#pragma once - -#include - -/** - * @brief Check if half-open intervals overlap - * - * @param start1 interval 1 start - * @param end1 interval 1 end - * @param start2 interval 2 start - * @param end2 interval 2 end - * @return true iff [start1; end1) overlaps [start2; end2) - */ -static inline bool bootloader_util_regions_overlap( - const intptr_t start1, const intptr_t end1, - const intptr_t start2, const intptr_t end2) -{ - return (end1 > start2 && end2 > start1) || - !(end1 <= start2 || end2 <= start1); -} diff --git a/tools/sdk/include/bootloader_support/esp_efuse.h b/tools/sdk/include/bootloader_support/esp_efuse.h deleted file mode 100644 index 047a971a4c1..00000000000 --- a/tools/sdk/include/bootloader_support/esp_efuse.h +++ /dev/null @@ -1,106 +0,0 @@ -// 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. -#ifndef _ESP_EFUSE_H -#define _ESP_EFUSE_H - -#include "soc/efuse_reg.h" -#include "esp_err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* @brief Permanently update values written to the efuse write registers - * - * After updating EFUSE_BLKx_WDATAx_REG registers with new values to - * write, call this function to permanently write them to efuse. - * - * @note Setting bits in efuse is permanent, they cannot be unset. - * - * @note Due to this restriction you don't need to copy values to - * Efuse write registers from the matching read registers, bits which - * are set in the read register but unset in the matching write - * register will be unchanged when new values are burned. - * - * @note This function is not threadsafe, if calling code updates - * efuse values from multiple tasks then this is caller's - * responsibility to serialise. - * - * After burning new efuses, the read registers are updated to match - * the new efuse values. - */ -void esp_efuse_burn_new_values(void); - -/* @brief Reset efuse write registers - * - * Efuse write registers are written to zero, to negate - * any changes that have been staged here. - */ -void esp_efuse_reset(void); - -/* @brief Disable BASIC ROM Console via efuse - * - * By default, if booting from flash fails the ESP32 will boot a - * BASIC console in ROM. - * - * Call this function (from bootloader or app) to permanently - * disable the console on this chip. - */ -void esp_efuse_disable_basic_rom_console(void); - -/* @brief Encode one or more sets of 6 byte sequences into - * 8 bytes suitable for 3/4 Coding Scheme. - * - * This function is only useful if the CODING_SCHEME efuse - * is set to value 1 for 3/4 Coding Scheme. - * - * @param[in] in_bytes Pointer to a sequence of bytes to encode for 3/4 Coding Scheme. Must have length in_bytes_len. After being written to hardware, these bytes will read back as little-endian words. - * @param[out] out_words Pointer to array of words suitable for writing to efuse write registers. Array must contain 2 words (8 bytes) for every 6 bytes in in_bytes_len. Can be a pointer to efuse write registers. - * @param in_bytes_len. Length of array pointed to by in_bytes, in bytes. Must be a multiple of 6. - * - * @return ESP_ERR_INVALID_ARG if either pointer is null or in_bytes_len is not a multiple of 6. ESP_OK otherwise. - */ -esp_err_t esp_efuse_apply_34_encoding(const uint8_t *in_bytes, uint32_t *out_words, size_t in_bytes_len); - -/* @brief Write random data to efuse key block write registers - * - * @note Caller is responsible for ensuring efuse - * block is empty and not write protected, before calling. - * - * @note Behaviour depends on coding scheme: a 256-bit key is - * generated and written for Coding Scheme "None", a 192-bit key - * is generated, extended to 256-bits by the Coding Scheme, - * and then writtten for 3/4 Coding Scheme. - * - * @note This function does not burn the new values, caller should - * call esp_efuse_burn_new_values() when ready to do this. - * - * @param blk_wdata0_reg Address of the first data write register - * in the block - */ -void esp_efuse_write_random_key(uint32_t blk_wdata0_reg); - -/** - * @brief Returns chip version from efuse - * - * @return chip version - */ -uint8_t esp_efuse_get_chip_ver(void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_EFUSE_H */ - diff --git a/tools/sdk/include/bootloader_support/esp_flash_encrypt.h b/tools/sdk/include/bootloader_support/esp_flash_encrypt.h deleted file mode 100644 index 59eca33b246..00000000000 --- a/tools/sdk/include/bootloader_support/esp_flash_encrypt.h +++ /dev/null @@ -1,117 +0,0 @@ -// 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. -#ifndef __ESP32_FLASH_ENCRYPT_H -#define __ESP32_FLASH_ENCRYPT_H - -#include -#include "esp_attr.h" -#include "esp_err.h" -#ifndef BOOTLOADER_BUILD -#include "esp_spi_flash.h" -#endif -#include "soc/efuse_reg.h" - -/** - * @file esp_partition.h - * @brief Support functions for flash encryption features - * - * Can be compiled as part of app or bootloader code. - */ - -/** @brief Is flash encryption currently enabled in hardware? - * - * Flash encryption is enabled if the FLASH_CRYPT_CNT efuse has an odd number of bits set. - * - * @return true if flash encryption is enabled. - */ -static inline /** @cond */ IRAM_ATTR /** @endcond */ bool esp_flash_encryption_enabled(void) { - uint32_t flash_crypt_cnt = REG_GET_FIELD(EFUSE_BLK0_RDATA0_REG, EFUSE_RD_FLASH_CRYPT_CNT); - /* __builtin_parity is in flash, so we calculate parity inline */ - bool enabled = false; - while(flash_crypt_cnt) { - if (flash_crypt_cnt & 1) { - enabled = !enabled; - } - flash_crypt_cnt >>= 1; - } - return enabled; -} - -/* @brief Update on-device flash encryption - * - * Intended to be called as part of the bootloader process if flash - * encryption is enabled in device menuconfig. - * - * If FLASH_CRYPT_CNT efuse parity is 1 (ie odd number of bits set), - * then return ESP_OK immediately (indicating flash encryption is enabled - * and functional). - * - * If FLASH_CRYPT_CNT efuse parity is 0 (ie even number of bits set), - * assume the flash has just been written with plaintext that needs encrypting. - * - * The following regions of flash are encrypted in place: - * - * - The bootloader image, if a valid plaintext image is found.[*] - * - The partition table, if a valid plaintext table is found. - * - Any app partition that contains a valid plaintext app image. - * - Any other partitions with the "encrypt" flag set. [**] - * - * After the re-encryption process completes, a '1' bit is added to the - * FLASH_CRYPT_CNT value (setting the parity to 1) and the EFUSE is re-burned. - * - * [*] If reflashing bootloader with secure boot enabled, pre-encrypt - * the bootloader before writing it to flash or secure boot will fail. - * - * [**] For this reason, if serial re-flashing a previous flashed - * device with secure boot enabled and using FLASH_CRYPT_CNT to - * trigger re-encryption, you must simultaneously re-flash plaintext - * content to all partitions with the "encrypt" flag set or this - * data will be corrupted (encrypted twice). - * - * @note The post-condition of this function is that all - * partitions that should be encrypted are encrypted. - * - * @note Take care not to power off the device while this function - * is running, or the partition currently being encrypted will be lost. - * - * @note RTC_WDT will reset while encryption operations will be performed (if RTC_WDT is configured). - * - * @return ESP_OK if all operations succeeded, ESP_ERR_INVALID_STATE - * if a fatal error occured during encryption of all partitions. - */ -esp_err_t esp_flash_encrypt_check_and_update(void); - - -/** @brief Encrypt-in-place a block of flash sectors - * - * @note This function resets RTC_WDT between operations with sectors. - * @param src_addr Source offset in flash. Should be multiple of 4096 bytes. - * @param data_length Length of data to encrypt in bytes. Will be rounded up to next multiple of 4096 bytes. - * - * @return ESP_OK if all operations succeeded, ESP_ERR_FLASH_OP_FAIL - * if SPI flash fails, ESP_ERR_FLASH_OP_TIMEOUT if flash times out. - */ -esp_err_t esp_flash_encrypt_region(uint32_t src_addr, size_t data_length); - -/** @brief Write protect FLASH_CRYPT_CNT - * - * Intended to be called as a part of boot process if flash encryption - * is enabled but secure boot is not used. This should protect against - * serial re-flashing of an unauthorised code in absence of secure boot. - * - * @return - */ -void esp_flash_write_protect_crypt_cnt(); - -#endif diff --git a/tools/sdk/include/bootloader_support/esp_flash_partitions.h b/tools/sdk/include/bootloader_support/esp_flash_partitions.h deleted file mode 100644 index b5f37aa5fc6..00000000000 --- a/tools/sdk/include/bootloader_support/esp_flash_partitions.h +++ /dev/null @@ -1,47 +0,0 @@ -// 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. -#ifndef __ESP_FLASH_PARTITIONS_H -#define __ESP_FLASH_PARTITIONS_H - -#include "esp_err.h" -#include "esp_flash_data_types.h" -#include -#include "sdkconfig.h" - -/* Pre-partition table fixed flash offsets */ -#define ESP_BOOTLOADER_DIGEST_OFFSET 0x0 -#define ESP_BOOTLOADER_OFFSET 0x1000 /* Offset of bootloader image. Has matching value in bootloader KConfig.projbuild file. */ -#define ESP_PARTITION_TABLE_OFFSET CONFIG_PARTITION_TABLE_OFFSET /* Offset of partition table. Backwards-compatible name.*/ - -#define ESP_PARTITION_TABLE_MAX_LEN 0xC00 /* Maximum length of partition table data */ -#define ESP_PARTITION_TABLE_MAX_ENTRIES (ESP_PARTITION_TABLE_MAX_LEN / sizeof(esp_partition_info_t)) /* Maximum length of partition table data, including terminating entry */ - -/* @brief Verify the partition table - * - * @param partition_table Pointer to at least ESP_PARTITION_TABLE_MAX_ENTRIES of potential partition table data. (ESP_PARTITION_TABLE_MAX_LEN bytes.) - * @param log_errors Log errors if the partition table is invalid. - * @param num_partitions If result is ESP_OK, num_partitions is updated with total number of partitions (not including terminating entry). - * - * @return ESP_OK on success, ESP_ERR_INVALID_STATE if partition table is not valid. - */ -esp_err_t esp_partition_table_verify(const esp_partition_info_t *partition_table, bool log_errors, int *num_partitions); - - -/* This function is included for compatibility with the ESP-IDF v3.x API */ -inline static __attribute__((deprecated)) esp_err_t esp_partition_table_basic_verify(const esp_partition_info_t *partition_table, bool log_errors, int *num_partitions) -{ - return esp_partition_table_verify(partition_table, log_errors, num_partitions); -} - -#endif diff --git a/tools/sdk/include/bootloader_support/esp_image_format.h b/tools/sdk/include/bootloader_support/esp_image_format.h deleted file mode 100644 index 0e2bb5283dd..00000000000 --- a/tools/sdk/include/bootloader_support/esp_image_format.h +++ /dev/null @@ -1,240 +0,0 @@ -// 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. -#pragma once - -#include -#include -#include "esp_flash_partitions.h" - -#define ESP_ERR_IMAGE_BASE 0x2000 -#define ESP_ERR_IMAGE_FLASH_FAIL (ESP_ERR_IMAGE_BASE + 1) -#define ESP_ERR_IMAGE_INVALID (ESP_ERR_IMAGE_BASE + 2) - -/* Support for app/bootloader image parsing - Can be compiled as part of app or bootloader code. -*/ - -/* SPI flash mode, used in esp_image_header_t */ -typedef enum { - ESP_IMAGE_SPI_MODE_QIO, - ESP_IMAGE_SPI_MODE_QOUT, - ESP_IMAGE_SPI_MODE_DIO, - ESP_IMAGE_SPI_MODE_DOUT, - ESP_IMAGE_SPI_MODE_FAST_READ, - ESP_IMAGE_SPI_MODE_SLOW_READ -} esp_image_spi_mode_t; - -/* SPI flash clock frequency */ -typedef enum { - ESP_IMAGE_SPI_SPEED_40M, - ESP_IMAGE_SPI_SPEED_26M, - ESP_IMAGE_SPI_SPEED_20M, - ESP_IMAGE_SPI_SPEED_80M = 0xF -} esp_image_spi_freq_t; - -/* Supported SPI flash sizes */ -typedef enum { - ESP_IMAGE_FLASH_SIZE_1MB = 0, - ESP_IMAGE_FLASH_SIZE_2MB, - ESP_IMAGE_FLASH_SIZE_4MB, - ESP_IMAGE_FLASH_SIZE_8MB, - ESP_IMAGE_FLASH_SIZE_16MB, - ESP_IMAGE_FLASH_SIZE_MAX -} esp_image_flash_size_t; - -#define ESP_IMAGE_HEADER_MAGIC 0xE9 - -/** - * @brief ESP chip ID - * - */ -typedef enum { - ESP_CHIP_ID_ESP32 = 0x0000, /*!< chip ID: ESP32 */ - ESP_CHIP_ID_INVALID = 0xFFFF /*!< Invalid chip ID (we defined it to make sure the esp_chip_id_t is 2 bytes size) */ -} __attribute__((packed)) esp_chip_id_t; - -/** @cond */ -_Static_assert(sizeof(esp_chip_id_t) == 2, "esp_chip_id_t should be 16 bit"); - - -/* Main header of binary image */ -typedef struct { - uint8_t magic; - uint8_t segment_count; - /* flash read mode (esp_image_spi_mode_t as uint8_t) */ - uint8_t spi_mode; - /* flash frequency (esp_image_spi_freq_t as uint8_t) */ - uint8_t spi_speed: 4; - /* flash chip size (esp_image_flash_size_t as uint8_t) */ - uint8_t spi_size: 4; - uint32_t entry_addr; - /* WP pin when SPI pins set via efuse (read by ROM bootloader, the IDF bootloader uses software to configure the WP - * pin and sets this field to 0xEE=disabled) */ - uint8_t wp_pin; - /* Drive settings for the SPI flash pins (read by ROM bootloader) */ - uint8_t spi_pin_drv[3]; - /*!< Chip identification number */ - esp_chip_id_t chip_id; - /*!< Minimum chip revision supported by image */ - uint8_t min_chip_rev; - /*!< Reserved bytes in additional header space, currently unused */ - uint8_t reserved[8]; - /* If 1, a SHA256 digest "simple hash" (of the entire image) is appended after the checksum. Included in image length. This digest - * is separate to secure boot and only used for detecting corruption. For secure boot signed images, the signature - * is appended after this (and the simple hash is included in the signed data). */ - uint8_t hash_appended; -} __attribute__((packed)) esp_image_header_t; - -_Static_assert(sizeof(esp_image_header_t) == 24, "binary image header should be 24 bytes"); - -#define ESP_IMAGE_HASH_LEN 32 /* Length of the appended SHA-256 digest */ - -/* Header of binary image segment */ -typedef struct { - uint32_t load_addr; - uint32_t data_len; -} esp_image_segment_header_t; - -#define ESP_IMAGE_MAX_SEGMENTS 16 - -/* Structure to hold on-flash image metadata */ -typedef struct { - uint32_t start_addr; /* Start address of image */ - esp_image_header_t image; /* Header for entire image */ - esp_image_segment_header_t segments[ESP_IMAGE_MAX_SEGMENTS]; /* Per-segment header data */ - uint32_t segment_data[ESP_IMAGE_MAX_SEGMENTS]; /* Data offsets for each segment */ - uint32_t image_len; /* Length of image on flash, in bytes */ - uint8_t image_digest[32]; /* appended SHA-256 digest */ -} esp_image_metadata_t; - -/* Mode selection for esp_image_load() */ -typedef enum { - ESP_IMAGE_VERIFY, /* Verify image contents, load metadata. Print errors. */ - ESP_IMAGE_VERIFY_SILENT, /* Verify image contents, load metadata. Don't print errors. */ -#ifdef BOOTLOADER_BUILD - ESP_IMAGE_LOAD, /* Verify image contents, load to memory. Print errors. */ -#endif -} esp_image_load_mode_t; - -/** - * @brief Verify and (optionally, in bootloader mode) load an app image. - * - * This name is deprecated and is included for compatibility with the ESP-IDF v3.x API. - * It will be removed in V4.0 version. - * Function has been renamed to esp_image_verify(). - * Use function esp_image_verify() to verify a image. And use function bootloader_load_image() to load image from a bootloader space. - * - * If encryption is enabled, data will be transparently decrypted. - * - * @param mode Mode of operation (verify, silent verify, or load). - * @param part Partition to load the app from. - * @param[inout] data Pointer to the image metadata structure which is be filled in by this function. 'start_addr' member should be set (to the start address of the image.) Other fields will all be initialised by this function. - * - * Image validation checks: - * - Magic byte. - * - Partition smaller than 16MB. - * - All segments & image fit in partition. - * - 8 bit image checksum is valid. - * - SHA-256 of image is valid (if image has this appended). - * - (Signature) if signature verification is enabled. - * - * @return - * - ESP_OK if verify or load was successful - * - ESP_ERR_IMAGE_FLASH_FAIL if a SPI flash error occurs - * - ESP_ERR_IMAGE_INVALID if the image appears invalid. - * - ESP_ERR_INVALID_ARG if the partition or data pointers are invalid. - */ -esp_err_t esp_image_load(esp_image_load_mode_t mode, const esp_partition_pos_t *part, esp_image_metadata_t *data) __attribute__((deprecated)); - -/** - * @brief Verify an app image. - * - * If encryption is enabled, data will be transparently decrypted. - * - * @param mode Mode of operation (verify, silent verify, or load). - * @param part Partition to load the app from. - * @param[inout] data Pointer to the image metadata structure which is be filled in by this function. - * 'start_addr' member should be set (to the start address of the image.) - * Other fields will all be initialised by this function. - * - * Image validation checks: - * - Magic byte. - * - Partition smaller than 16MB. - * - All segments & image fit in partition. - * - 8 bit image checksum is valid. - * - SHA-256 of image is valid (if image has this appended). - * - (Signature) if signature verification is enabled. - * - * @return - * - ESP_OK if verify or load was successful - * - ESP_ERR_IMAGE_FLASH_FAIL if a SPI flash error occurs - * - ESP_ERR_IMAGE_INVALID if the image appears invalid. - * - ESP_ERR_INVALID_ARG if the partition or data pointers are invalid. - */ -esp_err_t esp_image_verify(esp_image_load_mode_t mode, const esp_partition_pos_t *part, esp_image_metadata_t *data); - -/** - * @brief Verify and load an app image (available only in space of bootloader). - * - * If encryption is enabled, data will be transparently decrypted. - * - * @param part Partition to load the app from. - * @param[inout] data Pointer to the image metadata structure which is be filled in by this function. - * 'start_addr' member should be set (to the start address of the image.) - * Other fields will all be initialised by this function. - * - * Image validation checks: - * - Magic byte. - * - Partition smaller than 16MB. - * - All segments & image fit in partition. - * - 8 bit image checksum is valid. - * - SHA-256 of image is valid (if image has this appended). - * - (Signature) if signature verification is enabled. - * - * @return - * - ESP_OK if verify or load was successful - * - ESP_ERR_IMAGE_FLASH_FAIL if a SPI flash error occurs - * - ESP_ERR_IMAGE_INVALID if the image appears invalid. - * - ESP_ERR_INVALID_ARG if the partition or data pointers are invalid. - */ -esp_err_t bootloader_load_image(const esp_partition_pos_t *part, esp_image_metadata_t *data); - -/** - * @brief Verify the bootloader image. - * - * @param[out] If result is ESP_OK and this pointer is non-NULL, it - * will be set to the length of the bootloader image. - * - * @return As per esp_image_load_metadata(). - */ -esp_err_t esp_image_verify_bootloader(uint32_t *length); - -/** - * @brief Verify the bootloader image. - * - * @param[out] Metadata for the image. Only valid if result is ESP_OK. - * - * @return As per esp_image_load_metadata(). - */ -esp_err_t esp_image_verify_bootloader_data(esp_image_metadata_t *data); - - -typedef struct { - uint32_t drom_addr; - uint32_t drom_load_addr; - uint32_t drom_size; - uint32_t irom_addr; - uint32_t irom_load_addr; - uint32_t irom_size; -} esp_image_flash_mapping_t; diff --git a/tools/sdk/include/bootloader_support/esp_secure_boot.h b/tools/sdk/include/bootloader_support/esp_secure_boot.h deleted file mode 100644 index 370bdd36332..00000000000 --- a/tools/sdk/include/bootloader_support/esp_secure_boot.h +++ /dev/null @@ -1,115 +0,0 @@ -// 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. -#pragma once - -#include -#include -#include "soc/efuse_reg.h" - -#include "sdkconfig.h" - -#ifdef CONFIG_SECURE_BOOT_ENABLED -#if !defined(CONFIG_SECURE_SIGNED_ON_BOOT) || !defined(CONFIG_SECURE_SIGNED_ON_UPDATE) || !defined(CONFIG_SECURE_SIGNED_APPS) -#error "internal sdkconfig error, secure boot should always enable all signature options" -#endif -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Support functions for secure boot features. - - Can be compiled as part of app or bootloader code. -*/ - -/** @brief Is secure boot currently enabled in hardware? - * - * Secure boot is enabled if the ABS_DONE_0 efuse is blown. This means - * that the ROM bootloader code will only boot a verified secure - * bootloader digest from now on. - * - * @return true if secure boot is enabled. - */ -static inline bool esp_secure_boot_enabled(void) { - return REG_READ(EFUSE_BLK0_RDATA6_REG) & EFUSE_RD_ABS_DONE_0; -} - - -/** @brief Enable secure boot if it is not already enabled. - * - * @important If this function succeeds, secure boot is permanently - * enabled on the chip via efuse. - * - * @important This function is intended to be called from bootloader code only. - * - * If secure boot is not yet enabled for bootloader, this will - * generate the secure boot digest and enable secure boot by blowing - * the EFUSE_RD_ABS_DONE_0 efuse. - * - * This function does not verify secure boot of the bootloader (the - * ROM bootloader does this.) - * - * Will fail if efuses have been part-burned in a way that indicates - * secure boot should not or could not be correctly enabled. - * - * - * @return ESP_ERR_INVALID_STATE if efuse state doesn't allow - * secure boot to be enabled cleanly. ESP_OK if secure boot - * is enabled on this chip from now on. - */ -esp_err_t esp_secure_boot_permanently_enable(void); - -/** @brief Verify the secure boot signature (determinstic ECDSA w/ SHA256) appended to some binary data in flash. - * - * Public key is compiled into the calling program. See docs/security/secure-boot.rst for details. - * - * @param src_addr Starting offset of the data in flash. - * @param length Length of data in bytes. Signature is appended -after- length bytes. - * - * If flash encryption is enabled, the image will be transparently decrypted while being verified. - * - * @return ESP_OK if signature is valid, ESP_ERR_INVALID_STATE if - * signature fails, ESP_FAIL for other failures (ie can't read flash). - */ -esp_err_t esp_secure_boot_verify_signature(uint32_t src_addr, uint32_t length); - -/** @brief Verify the secure boot signature block (deterministic ECDSA w/ SHA256) based on the SHA256 hash of some data. - * - * Similar to esp_secure_boot_verify_signature(), but can be used when the digest is precalculated. - * @param sig_block Pointer to signature block data - * @param image_digest Pointer to 32 byte buffer holding SHA-256 hash. - * - */ - -/** @brief Secure boot verification block, on-flash data format. */ -typedef struct { - uint32_t version; - uint8_t signature[64]; -} esp_secure_boot_sig_block_t; - -esp_err_t esp_secure_boot_verify_signature_block(const esp_secure_boot_sig_block_t *sig_block, const uint8_t *image_digest); - -#define FLASH_OFFS_SECURE_BOOT_IV_DIGEST 0 - -/** @brief Secure boot IV+digest header */ -typedef struct { - uint8_t iv[128]; - uint8_t digest[64]; -} esp_secure_boot_iv_digest_t; - - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/bt/bt.h b/tools/sdk/include/bt/bt.h deleted file mode 100644 index a957698fb0c..00000000000 --- a/tools/sdk/include/bt/bt.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once -#warning "This header is deprecated, please use functions defined in esp_bt.h instead." -#include "esp_bt.h" diff --git a/tools/sdk/include/bt/esp_a2dp_api.h b/tools/sdk/include/bt/esp_a2dp_api.h deleted file mode 100644 index 3b002a405fb..00000000000 --- a/tools/sdk/include/bt/esp_a2dp_api.h +++ /dev/null @@ -1,342 +0,0 @@ -// 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. - -#ifndef __ESP_A2DP_API_H__ -#define __ESP_A2DP_API_H__ - -#include "esp_err.h" -#include "esp_bt_defs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/// Media codec types supported by A2DP -#define ESP_A2D_MCT_SBC (0) /*!< SBC */ -#define ESP_A2D_MCT_M12 (0x01) /*!< MPEG-1, 2 Audio */ -#define ESP_A2D_MCT_M24 (0x02) /*!< MPEG-2, 4 AAC */ -#define ESP_A2D_MCT_ATRAC (0x04) /*!< ATRAC family */ -#define ESP_A2D_MCT_NON_A2DP (0xff) - -typedef uint8_t esp_a2d_mct_t; - -/// A2DP media codec capabilities union -typedef struct { - esp_a2d_mct_t type; /*!< A2DP media codec type */ -#define ESP_A2D_CIE_LEN_SBC (4) -#define ESP_A2D_CIE_LEN_M12 (4) -#define ESP_A2D_CIE_LEN_M24 (6) -#define ESP_A2D_CIE_LEN_ATRAC (7) - union { - uint8_t sbc[ESP_A2D_CIE_LEN_SBC]; - uint8_t m12[ESP_A2D_CIE_LEN_M12]; - uint8_t m24[ESP_A2D_CIE_LEN_M24]; - uint8_t atrac[ESP_A2D_CIE_LEN_ATRAC]; - } cie; /*!< A2DP codec information element */ -} __attribute__((packed)) esp_a2d_mcc_t; - -/// Bluetooth A2DP connection states -typedef enum { - ESP_A2D_CONNECTION_STATE_DISCONNECTED = 0, /*!< connection released */ - ESP_A2D_CONNECTION_STATE_CONNECTING, /*!< connecting remote device */ - ESP_A2D_CONNECTION_STATE_CONNECTED, /*!< connection established */ - ESP_A2D_CONNECTION_STATE_DISCONNECTING /*!< disconnecting remote device */ -} esp_a2d_connection_state_t; - -/// Bluetooth A2DP disconnection reason -typedef enum { - ESP_A2D_DISC_RSN_NORMAL = 0, /*!< Finished disconnection that is initiated by local or remote device */ - ESP_A2D_DISC_RSN_ABNORMAL /*!< Abnormal disconnection caused by signal loss */ -} esp_a2d_disc_rsn_t; - -/// Bluetooth A2DP datapath states -typedef enum { - ESP_A2D_AUDIO_STATE_REMOTE_SUSPEND = 0, /*!< audio stream datapath suspended by remote device */ - ESP_A2D_AUDIO_STATE_STOPPED, /*!< audio stream datapath stopped */ - ESP_A2D_AUDIO_STATE_STARTED, /*!< audio stream datapath started */ -} esp_a2d_audio_state_t; - -/// A2DP media control command acknowledgement code -typedef enum { - ESP_A2D_MEDIA_CTRL_ACK_SUCCESS = 0, /*!< media control command is acknowledged with success */ - ESP_A2D_MEDIA_CTRL_ACK_FAILURE, /*!< media control command is acknowledged with failure */ - ESP_A2D_MEDIA_CTRL_ACK_BUSY, /*!< media control command is rejected, as previous command is not yet acknowledged */ -} esp_a2d_media_ctrl_ack_t; - -/// A2DP media control commands -typedef enum { - ESP_A2D_MEDIA_CTRL_NONE = 0, /*!< dummy command */ - ESP_A2D_MEDIA_CTRL_CHECK_SRC_RDY, /*!< check whether AVDTP is connected, only used in A2DP source */ - ESP_A2D_MEDIA_CTRL_START, /*!< command to set up media transmission channel */ - ESP_A2D_MEDIA_CTRL_STOP, /*!< command to stop media transmission */ - ESP_A2D_MEDIA_CTRL_SUSPEND, /*!< command to suspend media transmission */ -} esp_a2d_media_ctrl_t; - -/// A2DP callback events -typedef enum { - ESP_A2D_CONNECTION_STATE_EVT = 0, /*!< connection state changed event */ - ESP_A2D_AUDIO_STATE_EVT, /*!< audio stream transmission state changed event */ - ESP_A2D_AUDIO_CFG_EVT, /*!< audio codec is configured, only used for A2DP SINK */ - ESP_A2D_MEDIA_CTRL_ACK_EVT, /*!< acknowledge event in response to media control commands */ -} esp_a2d_cb_event_t; - -/// A2DP state callback parameters -typedef union { - /** - * @brief ESP_A2D_CONNECTION_STATE_EVT - */ - struct a2d_conn_stat_param { - esp_a2d_connection_state_t state; /*!< one of values from esp_a2d_connection_state_t */ - esp_bd_addr_t remote_bda; /*!< remote bluetooth device address */ - esp_a2d_disc_rsn_t disc_rsn; /*!< reason of disconnection for "DISCONNECTED" */ - } conn_stat; /*!< A2DP connection status */ - - /** - * @brief ESP_A2D_AUDIO_STATE_EVT - */ - struct a2d_audio_stat_param { - esp_a2d_audio_state_t state; /*!< one of the values from esp_a2d_audio_state_t */ - esp_bd_addr_t remote_bda; /*!< remote bluetooth device address */ - } audio_stat; /*!< audio stream playing state */ - - /** - * @brief ESP_A2D_AUDIO_CFG_EVT - */ - struct a2d_audio_cfg_param { - esp_bd_addr_t remote_bda; /*!< remote bluetooth device address */ - esp_a2d_mcc_t mcc; /*!< A2DP media codec capability information */ - } audio_cfg; /*!< media codec configuration information */ - - /** - * @brief ESP_A2D_MEDIA_CTRL_ACK_EVT - */ - struct media_ctrl_stat_param { - esp_a2d_media_ctrl_t cmd; /*!< media control commands to acknowledge */ - esp_a2d_media_ctrl_ack_t status; /*!< acknowledgement to media control commands */ - } media_ctrl_stat; /*!< status in acknowledgement to media control commands */ -} esp_a2d_cb_param_t; - -/** - * @brief A2DP profile callback function type - * - * @param event : Event type - * - * @param param : Pointer to callback parameter - */ -typedef void (* esp_a2d_cb_t)(esp_a2d_cb_event_t event, esp_a2d_cb_param_t *param); - -/** - * @brief A2DP profile data callback function - * @param[in] buf : data received from A2DP source device and is PCM format decoder from SBC decoder; - * buf references to a static memory block and can be overwritten by upcoming data - * @param[in] len : size(in bytes) in buf - */ -typedef void (* esp_a2d_sink_data_cb_t)(const uint8_t *buf, uint32_t len); - -/** - * @brief A2DP source data read callback function - * - * @param[in] buf : buffer to be filled with PCM data stream from higher layer - * - * @param[in] len : size(in bytes) of data block to be copied to buf. -1 is an indication to user - * that data buffer shall be flushed - * - * @return size of bytes read successfully, if the argument len is -1, this value is ignored. - * - */ -typedef int32_t (* esp_a2d_source_data_cb_t)(uint8_t *buf, int32_t len); - -/** - * @brief Register application callback function to A2DP module. This function should be called - * only after esp_bluedroid_enable() completes successfully, used by both A2DP source - * and sink. - * - * @param[in] callback: A2DP event callback function - * - * @return - * - ESP_OK: success - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: if callback is a NULL function pointer - * - */ -esp_err_t esp_a2d_register_callback(esp_a2d_cb_t callback); - - -/** - * @brief Register A2DP sink data output function; For now the output is PCM data stream decoded - * from SBC format. This function should be called only after esp_bluedroid_enable() - * completes successfully, used only by A2DP sink. The callback is invoked in the context - * of A2DP sink task whose stack size is configurable through menuconfig - * - * @param[in] callback: A2DP sink data callback function - * - * @return - * - ESP_OK: success - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: if callback is a NULL function pointer - * - */ -esp_err_t esp_a2d_sink_register_data_callback(esp_a2d_sink_data_cb_t callback); - - -/** - * - * @brief Initialize the bluetooth A2DP sink module. This function should be called - * after esp_bluedroid_enable() completes successfully - * - * @return - * - ESP_OK: if the initialization request is sent successfully - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_a2d_sink_init(void); - - -/** - * - * @brief De-initialize for A2DP sink module. This function - * should be called only after esp_bluedroid_enable() completes successfully - * - * @return - * - ESP_OK: success - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_a2d_sink_deinit(void); - - -/** - * - * @brief Connect to remote bluetooth A2DP source device, must after esp_a2d_sink_init() - * - * @param[in] remote_bda: remote bluetooth device address - * - * @return - * - ESP_OK: connect request is sent to lower layer - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_a2d_sink_connect(esp_bd_addr_t remote_bda); - - -/** - * - * @brief Disconnect from the remote A2DP source device - * - * @param[in] remote_bda: remote bluetooth device address - * @return - * - ESP_OK: disconnect request is sent to lower layer - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_a2d_sink_disconnect(esp_bd_addr_t remote_bda); - - -/** - * - * @brief media control commands; this API can be used for both A2DP sink and source - * - * @param[in] ctrl: control commands for A2DP data channel - * @return - * - ESP_OK: control command is sent to lower layer - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_a2d_media_ctrl(esp_a2d_media_ctrl_t ctrl); - - -/** - * - * @brief Initialize the bluetooth A2DP source module. This function should be called - * after esp_bluedroid_enable() completes successfully - * - * @return - * - ESP_OK: if the initialization request is sent successfully - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_a2d_source_init(void); - - -/** - * - * @brief De-initialize for A2DP source module. This function - * should be called only after esp_bluedroid_enable() completes successfully - * - * @return - * - ESP_OK: success - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_a2d_source_deinit(void); - - -/** - * @brief Register A2DP source data input function; For now the input is PCM data stream. - * This function should be called only after esp_bluedroid_enable() completes - * successfully. The callback is invoked in the context of A2DP source task whose - * stack size is configurable through menuconfig - * - * @param[in] callback: A2DP source data callback function - * - * @return - * - ESP_OK: success - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: if callback is a NULL function pointer - * - */ -esp_err_t esp_a2d_source_register_data_callback(esp_a2d_source_data_cb_t callback); - - -/** - * - * @brief Connect to remote A2DP sink device, must after esp_a2d_source_init() - * - * @param[in] remote_bda: remote bluetooth device address - * - * @return - * - ESP_OK: connect request is sent to lower layer - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_a2d_source_connect(esp_bd_addr_t remote_bda); - - -/** - * - * @brief Disconnect from the remote A2DP sink device - * - * @param[in] remote_bda: remote bluetooth device address - * @return - * - ESP_OK: disconnect request is sent to lower layer - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_a2d_source_disconnect(esp_bd_addr_t remote_bda); - -#ifdef __cplusplus -} -#endif - - -#endif /* __ESP_A2DP_API_H__ */ diff --git a/tools/sdk/include/bt/esp_avrc_api.h b/tools/sdk/include/bt/esp_avrc_api.h deleted file mode 100644 index e1f68392c86..00000000000 --- a/tools/sdk/include/bt/esp_avrc_api.h +++ /dev/null @@ -1,288 +0,0 @@ -// 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. - -#ifndef __ESP_AVRC_API_H__ -#define __ESP_AVRC_API_H__ - -#include -#include -#include "esp_err.h" -#include "esp_bt_defs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/// AVRC feature bit mask -typedef enum { - ESP_AVRC_FEAT_RCTG = 0x0001, /*!< remote control target */ - ESP_AVRC_FEAT_RCCT = 0x0002, /*!< remote control controller */ - ESP_AVRC_FEAT_VENDOR = 0x0008, /*!< remote control vendor dependent commands */ - ESP_AVRC_FEAT_BROWSE = 0x0010, /*!< use browsing channel */ - ESP_AVRC_FEAT_META_DATA = 0x0040, /*!< remote control metadata transfer command/response */ - ESP_AVRC_FEAT_ADV_CTRL = 0x0200, /*!< remote control advanced control commmand/response */ -} esp_avrc_features_t; - -/// AVRC passthrough command code -typedef enum { - ESP_AVRC_PT_CMD_PLAY = 0x44, /*!< play */ - ESP_AVRC_PT_CMD_STOP = 0x45, /*!< stop */ - ESP_AVRC_PT_CMD_PAUSE = 0x46, /*!< pause */ - ESP_AVRC_PT_CMD_FORWARD = 0x4B, /*!< forward */ - ESP_AVRC_PT_CMD_BACKWARD = 0x4C, /*!< backward */ - ESP_AVRC_PT_CMD_REWIND = 0x48, /*!< rewind */ - ESP_AVRC_PT_CMD_FAST_FORWARD = 0x49 /*!< fast forward */ -} esp_avrc_pt_cmd_t; - -/// AVRC passthrough command state -typedef enum { - ESP_AVRC_PT_CMD_STATE_PRESSED = 0, /*!< key pressed */ - ESP_AVRC_PT_CMD_STATE_RELEASED = 1 /*!< key released */ -} esp_avrc_pt_cmd_state_t; - -/// AVRC Controller callback events -typedef enum { - ESP_AVRC_CT_CONNECTION_STATE_EVT = 0, /*!< connection state changed event */ - ESP_AVRC_CT_PASSTHROUGH_RSP_EVT = 1, /*!< passthrough response event */ - ESP_AVRC_CT_METADATA_RSP_EVT = 2, /*!< metadata response event */ - ESP_AVRC_CT_PLAY_STATUS_RSP_EVT = 3, /*!< play status response event */ - ESP_AVRC_CT_CHANGE_NOTIFY_EVT = 4, /*!< notification event */ - ESP_AVRC_CT_REMOTE_FEATURES_EVT = 5, /*!< feature of remote device indication event */ -} esp_avrc_ct_cb_event_t; - -/// AVRC metadata attribute mask -typedef enum { - ESP_AVRC_MD_ATTR_TITLE = 0x1, /*!< title of the playing track */ - ESP_AVRC_MD_ATTR_ARTIST = 0x2, /*!< track artist */ - ESP_AVRC_MD_ATTR_ALBUM = 0x4, /*!< album name */ - ESP_AVRC_MD_ATTR_TRACK_NUM = 0x8, /*!< track position on the album */ - ESP_AVRC_MD_ATTR_NUM_TRACKS = 0x10, /*!< number of tracks on the album */ - ESP_AVRC_MD_ATTR_GENRE = 0x20, /*!< track genre */ - ESP_AVRC_MD_ATTR_PLAYING_TIME = 0x40 /*!< total album playing time in miliseconds */ -} esp_avrc_md_attr_mask_t; - -/// AVRC event notification ids -typedef enum { - ESP_AVRC_RN_PLAY_STATUS_CHANGE = 0x01, /*!< track status change, eg. from playing to paused */ - ESP_AVRC_RN_TRACK_CHANGE = 0x02, /*!< new track is loaded */ - ESP_AVRC_RN_TRACK_REACHED_END = 0x03, /*!< current track reached end */ - ESP_AVRC_RN_TRACK_REACHED_START = 0x04, /*!< current track reached start position */ - ESP_AVRC_RN_PLAY_POS_CHANGED = 0x05, /*!< track playing position changed */ - ESP_AVRC_RN_BATTERY_STATUS_CHANGE = 0x06, /*!< battery status changed */ - ESP_AVRC_RN_SYSTEM_STATUS_CHANGE = 0x07, /*!< system status changed */ - ESP_AVRC_RN_APP_SETTING_CHANGE = 0x08, /*!< application settings changed */ - ESP_AVRC_RN_MAX_EVT -} esp_avrc_rn_event_ids_t; - -/// AVRC player setting ids -typedef enum { - ESP_AVRC_PS_EQUALIZER = 0x01, /*!< equalizer, on or off */ - ESP_AVRC_PS_REPEAT_MODE = 0x02, /*!< repeat mode */ - ESP_AVRC_PS_SHUFFLE_MODE = 0x03, /*!< shuffle mode */ - ESP_AVRC_PS_SCAN_MODE = 0x04, /*!< scan mode on or off */ - ESP_AVRC_PS_MAX_ATTR -} esp_avrc_ps_attr_ids_t; - -/// AVRC equalizer modes -typedef enum { - ESP_AVRC_PS_EQUALIZER_OFF = 0x1, /*!< equalizer OFF */ - ESP_AVRC_PS_EQUALIZER_ON = 0x2 /*!< equalizer ON */ -} esp_avrc_ps_eq_value_ids_t; - -/// AVRC repeat modes -typedef enum { - ESP_AVRC_PS_REPEAT_OFF = 0x1, /*!< repeat mode off */ - ESP_AVRC_PS_REPEAT_SINGLE = 0x2, /*!< single track repeat */ - ESP_AVRC_PS_REPEAT_GROUP = 0x3 /*!< group repeat */ -} esp_avrc_ps_rpt_value_ids_t; - - -/// AVRC shuffle modes -typedef enum { - ESP_AVRC_PS_SHUFFLE_OFF = 0x1, /* -#include -#include "esp_err.h" -#include "sdkconfig.h" -#include "esp_task.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL 0x20190506 - -/** - * @brief Bluetooth mode for controller enable/disable - */ -typedef enum { - ESP_BT_MODE_IDLE = 0x00, /*!< Bluetooth is not running */ - ESP_BT_MODE_BLE = 0x01, /*!< Run BLE mode */ - ESP_BT_MODE_CLASSIC_BT = 0x02, /*!< Run Classic BT mode */ - ESP_BT_MODE_BTDM = 0x03, /*!< Run dual mode */ -} esp_bt_mode_t; - -#ifdef CONFIG_BT_ENABLED -/* While scanning, if the free memory value in controller is less than SCAN_SEND_ADV_RESERVED_SIZE, -the adv packet will be discarded until the memory is restored. */ -#define SCAN_SEND_ADV_RESERVED_SIZE 1000 -/* enable controller log debug when adv lost */ -#define CONTROLLER_ADV_LOST_DEBUG_BIT (0<<0) - -#ifdef CONFIG_BT_HCI_UART_NO -#define BT_HCI_UART_NO_DEFAULT CONFIG_BT_HCI_UART_NO -#else -#define BT_HCI_UART_NO_DEFAULT 1 -#endif /* BT_HCI_UART_NO_DEFAULT */ - -#ifdef CONFIG_BT_HCI_UART_BAUDRATE -#define BT_HCI_UART_BAUDRATE_DEFAULT CONFIG_BT_HCI_UART_BAUDRATE -#else -#define BT_HCI_UART_BAUDRATE_DEFAULT 921600 -#endif /* BT_HCI_UART_BAUDRATE_DEFAULT */ - -#ifdef CONFIG_SCAN_DUPLICATE_TYPE -#define SCAN_DUPLICATE_TYPE_VALUE CONFIG_SCAN_DUPLICATE_TYPE -#else -#define SCAN_DUPLICATE_TYPE_VALUE 0 -#endif - -/* normal adv cache size */ -#ifdef CONFIG_DUPLICATE_SCAN_CACHE_SIZE -#define NORMAL_SCAN_DUPLICATE_CACHE_SIZE CONFIG_DUPLICATE_SCAN_CACHE_SIZE -#else -#define NORMAL_SCAN_DUPLICATE_CACHE_SIZE 20 -#endif - -#ifndef CONFIG_BLE_MESH_SCAN_DUPLICATE_EN -#define CONFIG_BLE_MESH_SCAN_DUPLICATE_EN FALSE -#endif - -#define SCAN_DUPLICATE_MODE_NORMAL_ADV_ONLY 0 -#define SCAN_DUPLICATE_MODE_NORMAL_ADV_MESH_ADV 1 - -#if CONFIG_BLE_MESH_SCAN_DUPLICATE_EN - #define SCAN_DUPLICATE_MODE SCAN_DUPLICATE_MODE_NORMAL_ADV_MESH_ADV - #ifdef CONFIG_MESH_DUPLICATE_SCAN_CACHE_SIZE - #define MESH_DUPLICATE_SCAN_CACHE_SIZE CONFIG_MESH_DUPLICATE_SCAN_CACHE_SIZE - #else - #define MESH_DUPLICATE_SCAN_CACHE_SIZE 50 - #endif -#else - #define SCAN_DUPLICATE_MODE SCAN_DUPLICATE_MODE_NORMAL_ADV_ONLY - #define MESH_DUPLICATE_SCAN_CACHE_SIZE 0 -#endif - -#if defined(CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY) -#define BTDM_CONTROLLER_MODE_EFF ESP_BT_MODE_BLE -#elif defined(CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY) -#define BTDM_CONTROLLER_MODE_EFF ESP_BT_MODE_CLASSIC_BT -#else -#define BTDM_CONTROLLER_MODE_EFF ESP_BT_MODE_BTDM -#endif - -#define BTDM_CONTROLLER_BLE_MAX_CONN_LIMIT 9 //Maximum BLE connection limitation -#define BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN_LIMIT 7 //Maximum ACL connection limitation -#define BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_LIMIT 3 //Maximum SCO/eSCO connection limitation - -#define BTDM_CONTROLLER_SCO_DATA_PATH_HCI 0 // SCO data is routed to HCI -#define BTDM_CONTROLLER_SCO_DATA_PATH_PCM 1 // SCO data path is PCM - -#define BT_CONTROLLER_INIT_CONFIG_DEFAULT() { \ - .controller_task_stack_size = ESP_TASK_BT_CONTROLLER_STACK, \ - .controller_task_prio = ESP_TASK_BT_CONTROLLER_PRIO, \ - .hci_uart_no = BT_HCI_UART_NO_DEFAULT, \ - .hci_uart_baudrate = BT_HCI_UART_BAUDRATE_DEFAULT, \ - .scan_duplicate_mode = SCAN_DUPLICATE_MODE, \ - .scan_duplicate_type = SCAN_DUPLICATE_TYPE_VALUE, \ - .normal_adv_size = NORMAL_SCAN_DUPLICATE_CACHE_SIZE, \ - .mesh_adv_size = MESH_DUPLICATE_SCAN_CACHE_SIZE, \ - .send_adv_reserved_size = SCAN_SEND_ADV_RESERVED_SIZE, \ - .controller_debug_flag = CONTROLLER_ADV_LOST_DEBUG_BIT, \ - .mode = BTDM_CONTROLLER_MODE_EFF, \ - .ble_max_conn = CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN_EFF, \ - .bt_max_acl_conn = CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN_EFF, \ - .bt_sco_datapath = CONFIG_BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH_EFF, \ - .bt_max_sync_conn = CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_EFF, \ - .magic = ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL, \ -}; - -#else -#define BT_CONTROLLER_INIT_CONFIG_DEFAULT() {0}; _Static_assert(0, "please enable bluetooth in menuconfig to use bt.h"); -#endif - -/** - * @brief Controller config options, depend on config mask. - * Config mask indicate which functions enabled, this means - * some options or parameters of some functions enabled by config mask. - */ -typedef struct { - /* - * Following parameters can be configured runtime, when call esp_bt_controller_init() - */ - uint16_t controller_task_stack_size; /*!< Bluetooth controller task stack size */ - uint8_t controller_task_prio; /*!< Bluetooth controller task priority */ - uint8_t hci_uart_no; /*!< If use UART1/2 as HCI IO interface, indicate UART number */ - uint32_t hci_uart_baudrate; /*!< If use UART1/2 as HCI IO interface, indicate UART baudrate */ - uint8_t scan_duplicate_mode; /*!< scan duplicate mode */ - uint8_t scan_duplicate_type; /*!< scan duplicate type */ - uint16_t normal_adv_size; /*!< Normal adv size for scan duplicate */ - uint16_t mesh_adv_size; /*!< Mesh adv size for scan duplicate */ - uint16_t send_adv_reserved_size; /*!< Controller minimum memory value */ - uint32_t controller_debug_flag; /*!< Controller debug log flag */ - uint8_t mode; /*!< Controller mode: BR/EDR, BLE or Dual Mode */ - uint8_t ble_max_conn; /*!< BLE maximum connection numbers */ - uint8_t bt_max_acl_conn; /*!< BR/EDR maximum ACL connection numbers */ - uint8_t bt_sco_datapath; /*!< SCO data path, i.e. HCI or PCM module */ - /* - * Following parameters can not be configured runtime when call esp_bt_controller_init() - * It will be overwrite with a constant value which in menuconfig or from a macro. - * So, do not modify the value when esp_bt_controller_init() - */ - uint8_t bt_max_sync_conn; /*!< BR/EDR maximum ACL connection numbers. Effective in menuconfig */ - uint32_t magic; /*!< Magic number */ -} esp_bt_controller_config_t; - -/** - * @brief Bluetooth controller enable/disable/initialised/de-initialised status - */ -typedef enum { - ESP_BT_CONTROLLER_STATUS_IDLE = 0, - ESP_BT_CONTROLLER_STATUS_INITED, - ESP_BT_CONTROLLER_STATUS_ENABLED, - ESP_BT_CONTROLLER_STATUS_NUM, -} esp_bt_controller_status_t; - -/** - * @brief BLE tx power type - * ESP_BLE_PWR_TYPE_CONN_HDL0-8: for each connection, and only be set after connection completed. - * when disconnect, the correspond TX power is not effected. - * ESP_BLE_PWR_TYPE_ADV : for advertising/scan response. - * ESP_BLE_PWR_TYPE_SCAN : for scan. - * ESP_BLE_PWR_TYPE_DEFAULT : if each connection's TX power is not set, it will use this default value. - * if neither in scan mode nor in adv mode, it will use this default value. - * If none of power type is set, system will use ESP_PWR_LVL_P3 as default for ADV/SCAN/CONN0-9. - */ -typedef enum { - ESP_BLE_PWR_TYPE_CONN_HDL0 = 0, /*!< For connection handle 0 */ - ESP_BLE_PWR_TYPE_CONN_HDL1 = 1, /*!< For connection handle 1 */ - ESP_BLE_PWR_TYPE_CONN_HDL2 = 2, /*!< For connection handle 2 */ - ESP_BLE_PWR_TYPE_CONN_HDL3 = 3, /*!< For connection handle 3 */ - ESP_BLE_PWR_TYPE_CONN_HDL4 = 4, /*!< For connection handle 4 */ - ESP_BLE_PWR_TYPE_CONN_HDL5 = 5, /*!< For connection handle 5 */ - ESP_BLE_PWR_TYPE_CONN_HDL6 = 6, /*!< For connection handle 6 */ - ESP_BLE_PWR_TYPE_CONN_HDL7 = 7, /*!< For connection handle 7 */ - ESP_BLE_PWR_TYPE_CONN_HDL8 = 8, /*!< For connection handle 8 */ - ESP_BLE_PWR_TYPE_ADV = 9, /*!< For advertising */ - ESP_BLE_PWR_TYPE_SCAN = 10, /*!< For scan */ - ESP_BLE_PWR_TYPE_DEFAULT = 11, /*!< For default, if not set other, it will use default value */ - ESP_BLE_PWR_TYPE_NUM = 12, /*!< TYPE numbers */ -} esp_ble_power_type_t; - -/** - * @brief Bluetooth TX power level(index), it's just a index corresponding to power(dbm). - */ -typedef enum { - ESP_PWR_LVL_N12 = 0, /*!< Corresponding to -12dbm */ - ESP_PWR_LVL_N9 = 1, /*!< Corresponding to -9dbm */ - ESP_PWR_LVL_N6 = 2, /*!< Corresponding to -6dbm */ - ESP_PWR_LVL_N3 = 3, /*!< Corresponding to -3dbm */ - ESP_PWR_LVL_N0 = 4, /*!< Corresponding to 0dbm */ - ESP_PWR_LVL_P3 = 5, /*!< Corresponding to +3dbm */ - ESP_PWR_LVL_P6 = 6, /*!< Corresponding to +6dbm */ - ESP_PWR_LVL_P9 = 7, /*!< Corresponding to +9dbm */ - ESP_PWR_LVL_N14 = ESP_PWR_LVL_N12, /*!< Backward compatibility! Setting to -14dbm will actually result to -12dbm */ - ESP_PWR_LVL_N11 = ESP_PWR_LVL_N9, /*!< Backward compatibility! Setting to -11dbm will actually result to -9dbm */ - ESP_PWR_LVL_N8 = ESP_PWR_LVL_N6, /*!< Backward compatibility! Setting to -8dbm will actually result to -6dbm */ - ESP_PWR_LVL_N5 = ESP_PWR_LVL_N3, /*!< Backward compatibility! Setting to -5dbm will actually result to -3dbm */ - ESP_PWR_LVL_N2 = ESP_PWR_LVL_N0, /*!< Backward compatibility! Setting to -2dbm will actually result to 0dbm */ - ESP_PWR_LVL_P1 = ESP_PWR_LVL_P3, /*!< Backward compatibility! Setting to +1dbm will actually result to +3dbm */ - ESP_PWR_LVL_P4 = ESP_PWR_LVL_P6, /*!< Backward compatibility! Setting to +4dbm will actually result to +6dbm */ - ESP_PWR_LVL_P7 = ESP_PWR_LVL_P9, /*!< Backward compatibility! Setting to +7dbm will actually result to +9dbm */ -} esp_power_level_t; - -/** - * @brief Bluetooth audio data transport path - */ -typedef enum { - ESP_SCO_DATA_PATH_HCI = 0, /*!< data over HCI transport */ - ESP_SCO_DATA_PATH_PCM = 1, /*!< data over PCM interface */ -} esp_sco_data_path_t; - -/** - * @brief Set BLE TX power - * Connection Tx power should only be set after connection created. - * @param power_type : The type of which tx power, could set Advertising/Connection/Default and etc - * @param power_level: Power level(index) corresponding to absolute value(dbm) - * @return ESP_OK - success, other - failed - */ -esp_err_t esp_ble_tx_power_set(esp_ble_power_type_t power_type, esp_power_level_t power_level); - -/** - * @brief Get BLE TX power - * Connection Tx power should only be get after connection created. - * @param power_type : The type of which tx power, could set Advertising/Connection/Default and etc - * @return >= 0 - Power level, < 0 - Invalid - */ -esp_power_level_t esp_ble_tx_power_get(esp_ble_power_type_t power_type); - -/** - * @brief Set BR/EDR TX power - * BR/EDR power control will use the power in range of minimum value and maximum value. - * The power level will effect the global BR/EDR TX power, such inquire, page, connection and so on. - * Please call the function after esp_bt_controller_enable and before any function which cause RF do TX. - * So you can call the function before doing discovery, profile init and so on. - * For example, if you want BR/EDR use the new TX power to do inquire, you should call - * this function before inquire. Another word, If call this function when BR/EDR is in inquire(ING), - * please do inquire again after call this function. - * Default minimum power level is ESP_PWR_LVL_N0, and maximum power level is ESP_PWR_LVL_P3. - * @param min_power_level: The minimum power level - * @param max_power_level: The maximum power level - * @return ESP_OK - success, other - failed - */ -esp_err_t esp_bredr_tx_power_set(esp_power_level_t min_power_level, esp_power_level_t max_power_level); - -/** - * @brief Get BR/EDR TX power - * If the argument is not NULL, then store the corresponding value. - * @param min_power_level: The minimum power level - * @param max_power_level: The maximum power level - * @return ESP_OK - success, other - failed - */ -esp_err_t esp_bredr_tx_power_get(esp_power_level_t *min_power_level, esp_power_level_t *max_power_level); - -/** - * @brief set default SCO data path - * Should be called after controller is enabled, and before (e)SCO link is established - * @param data_path: SCO data path - * @return ESP_OK - success, other - failed - */ -esp_err_t esp_bredr_sco_datapath_set(esp_sco_data_path_t data_path); - -/** - * @brief Initialize BT controller to allocate task and other resource. - * This function should be called only once, before any other BT functions are called. - * @param cfg: Initial configuration of BT controller. Different from previous version, there's a mode and some - * connection configuration in "cfg" to configure controller work mode and allocate the resource which is needed. - * @return ESP_OK - success, other - failed - */ -esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg); - -/** - * @brief De-initialize BT controller to free resource and delete task. - * - * This function should be called only once, after any other BT functions are called. - * This function is not whole completed, esp_bt_controller_init cannot called after this function. - * @return ESP_OK - success, other - failed - */ -esp_err_t esp_bt_controller_deinit(void); - -/** - * @brief Enable BT controller. - * Due to a known issue, you cannot call esp_bt_controller_enable() a second time - * to change the controller mode dynamically. To change controller mode, call - * esp_bt_controller_disable() and then call esp_bt_controller_enable() with the new mode. - * @param mode : the mode(BLE/BT/BTDM) to enable. For compatible of API, retain this argument. This mode must be - * equal as the mode in "cfg" of esp_bt_controller_init(). - * @return ESP_OK - success, other - failed - */ -esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode); - -/** - * @brief Disable BT controller - * @return ESP_OK - success, other - failed - */ -esp_err_t esp_bt_controller_disable(void); - -/** - * @brief Get BT controller is initialised/de-initialised/enabled/disabled - * @return status value - */ -esp_bt_controller_status_t esp_bt_controller_get_status(void); - -/** @brief esp_vhci_host_callback - * used for vhci call host function to notify what host need to do - */ -typedef struct esp_vhci_host_callback { - void (*notify_host_send_available)(void); /*!< callback used to notify that the host can send packet to controller */ - int (*notify_host_recv)(uint8_t *data, uint16_t len); /*!< callback used to notify that the controller has a packet to send to the host*/ -} esp_vhci_host_callback_t; - -/** @brief esp_vhci_host_check_send_available - * used for check actively if the host can send packet to controller or not. - * @return true for ready to send, false means cannot send packet - */ -bool esp_vhci_host_check_send_available(void); - -/** @brief esp_vhci_host_send_packet - * host send packet to controller - * - * Should not call this function from within a critical section - * or when the scheduler is suspended. - * - * @param data the packet point - * @param len the packet length - */ -void esp_vhci_host_send_packet(uint8_t *data, uint16_t len); - -/** @brief esp_vhci_host_register_callback - * register the vhci reference callback - * struct defined by vhci_host_callback structure. - * @param callback esp_vhci_host_callback type variable - * @return ESP_OK - success, ESP_FAIL - failed - */ -esp_err_t esp_vhci_host_register_callback(const esp_vhci_host_callback_t *callback); - -/** @brief esp_bt_controller_mem_release - * release the controller memory as per the mode - * - * This function releases the BSS, data and other sections of the controller to heap. The total size is about 70k bytes. - * - * esp_bt_controller_mem_release(mode) should be called only before esp_bt_controller_init() - * or after esp_bt_controller_deinit(). - * - * Note that once BT controller memory is released, the process cannot be reversed. It means you cannot use the bluetooth - * mode which you have released by this function. - * - * If your firmware will later upgrade the Bluetooth controller mode (BLE -> BT Classic or disabled -> enabled) - * then do not call this function. - * - * If the app calls esp_bt_controller_enable(ESP_BT_MODE_BLE) to use BLE only then it is safe to call - * esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT) at initialization time to free unused BT Classic memory. - * - * If the mode is ESP_BT_MODE_BTDM, then it may be useful to call API esp_bt_mem_release(ESP_BT_MODE_BTDM) instead, - * which internally calls esp_bt_controller_mem_release(ESP_BT_MODE_BTDM) and additionally releases the BSS and data - * consumed by the BT/BLE host stack to heap. For more details about usage please refer to the documentation of - * esp_bt_mem_release() function - * - * @param mode : the mode want to release memory - * @return ESP_OK - success, other - failed - */ -esp_err_t esp_bt_controller_mem_release(esp_bt_mode_t mode); - -/** @brief esp_bt_mem_release - * release controller memory and BSS and data section of the BT/BLE host stack as per the mode - * - * This function first releases controller memory by internally calling esp_bt_controller_mem_release(). - * Additionally, if the mode is set to ESP_BT_MODE_BTDM, it also releases the BSS and data consumed by the BT/BLE host stack to heap - * - * Note that once BT memory is released, the process cannot be reversed. It means you cannot use the bluetooth - * mode which you have released by this function. - * - * If your firmware will later upgrade the Bluetooth controller mode (BLE -> BT Classic or disabled -> enabled) - * then do not call this function. - * - * If you never intend to use bluetooth in a current boot-up cycle, you can call esp_bt_mem_release(ESP_BT_MODE_BTDM) - * before esp_bt_controller_init or after esp_bt_controller_deinit. - * - * For example, if a user only uses bluetooth for setting the WiFi configuration, and does not use bluetooth in the rest of the product operation". - * In such cases, after receiving the WiFi configuration, you can disable/deinit bluetooth and release its memory. - * Below is the sequence of APIs to be called for such scenarios: - * - * esp_bluedroid_disable(); - * esp_bluedroid_deinit(); - * esp_bt_controller_disable(); - * esp_bt_controller_deinit(); - * esp_bt_mem_release(ESP_BT_MODE_BTDM); - * - * @param mode : the mode whose memory is to be released - * @return ESP_OK - success, other - failed - */ -esp_err_t esp_bt_mem_release(esp_bt_mode_t mode); - -/** - * @brief enable bluetooth to enter modem sleep - * - * Note that this function shall not be invoked before esp_bt_controller_enable() - * - * There are currently two options for bluetooth modem sleep, one is ORIG mode, and another is EVED Mode. EVED Mode is intended for BLE only. - * - * For ORIG mode: - * Bluetooth modem sleep is enabled in controller start up by default if CONFIG_BTDM_CONTROLLER_MODEM_SLEEP is set and "ORIG mode" is selected. In ORIG modem sleep mode, bluetooth controller will switch off some components and pause to work every now and then, if there is no event to process; and wakeup according to the scheduled interval and resume the work. It can also wakeup earlier upon external request using function "esp_bt_controller_wakeup_request". - * - * @return - * - ESP_OK : success - * - other : failed - */ -esp_err_t esp_bt_sleep_enable(void); - - -/** - * @brief disable bluetooth modem sleep - * - * Note that this function shall not be invoked before esp_bt_controller_enable() - * - * If esp_bt_sleep_disable() is called, bluetooth controller will not be allowed to enter modem sleep; - * - * If ORIG modem sleep mode is in use, if this function is called, bluetooth controller may not immediately wake up if it is dormant then. - * In this case, esp_bt_controller_wakeup_request() can be used to shorten the time for wakeup. - * - * @return - * - ESP_OK : success - * - other : failed - */ -esp_err_t esp_bt_sleep_disable(void); - -/** - * @brief to check whether bluetooth controller is sleeping at the instant, if modem sleep is enabled - * - * Note that this function shall not be invoked before esp_bt_controller_enable() - * This function is supposed to be used ORIG mode of modem sleep - * - * @return true if in modem sleep state, false otherwise - */ -bool esp_bt_controller_is_sleeping(void); - -/** - * @brief request controller to wakeup from sleeping state during sleep mode - * - * Note that this function shall not be invoked before esp_bt_controller_enable() - * Note that this function is supposed to be used ORIG mode of modem sleep - * Note that after this request, bluetooth controller may again enter sleep as long as the modem sleep is enabled - * - * Profiling shows that it takes several milliseconds to wakeup from modem sleep after this request. - * Generally it takes longer if 32kHz XTAL is used than the main XTAL, due to the lower frequency of the former as the bluetooth low power clock source. - */ -void esp_bt_controller_wakeup_request(void); - -/** - * @brief Manually clear scan duplicate list - * - * Note that scan duplicate list will be automatically cleared when the maximum amount of device in the filter is reached - * the amount of device in the filter can be configured in menuconfig. - * - * - * @return - * - ESP_OK : success - * - other : failed - */ -esp_err_t esp_ble_scan_dupilcate_list_flush(void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_BT_H__ */ diff --git a/tools/sdk/include/bt/esp_bt_defs.h b/tools/sdk/include/bt/esp_bt_defs.h deleted file mode 100644 index da93b87bcad..00000000000 --- a/tools/sdk/include/bt/esp_bt_defs.h +++ /dev/null @@ -1,137 +0,0 @@ -// 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. - -#ifndef __ESP_BT_DEFS_H__ -#define __ESP_BT_DEFS_H__ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define ESP_BLUEDROID_STATUS_CHECK(status) \ - if (esp_bluedroid_get_status() != (status)) { \ - return ESP_ERR_INVALID_STATE; \ - } - - -/* relate to BT_STATUS_xxx in bt_def.h */ -/// Status Return Value -typedef enum { - ESP_BT_STATUS_SUCCESS = 0, /* relate to BT_STATUS_SUCCESS in bt_def.h */ - ESP_BT_STATUS_FAIL, /* relate to BT_STATUS_FAIL in bt_def.h */ - ESP_BT_STATUS_NOT_READY, /* relate to BT_STATUS_NOT_READY in bt_def.h */ - ESP_BT_STATUS_NOMEM, /* relate to BT_STATUS_NOMEM in bt_def.h */ - ESP_BT_STATUS_BUSY, /* relate to BT_STATUS_BUSY in bt_def.h */ - ESP_BT_STATUS_DONE = 5, /* relate to BT_STATUS_DONE in bt_def.h */ - ESP_BT_STATUS_UNSUPPORTED, /* relate to BT_STATUS_UNSUPPORTED in bt_def.h */ - ESP_BT_STATUS_PARM_INVALID, /* relate to BT_STATUS_PARM_INVALID in bt_def.h */ - ESP_BT_STATUS_UNHANDLED, /* relate to BT_STATUS_UNHANDLED in bt_def.h */ - ESP_BT_STATUS_AUTH_FAILURE, /* relate to BT_STATUS_AUTH_FAILURE in bt_def.h */ - ESP_BT_STATUS_RMT_DEV_DOWN = 10, /* relate to BT_STATUS_RMT_DEV_DOWN in bt_def.h */ - ESP_BT_STATUS_AUTH_REJECTED, /* relate to BT_STATUS_AUTH_REJECTED in bt_def.h */ - ESP_BT_STATUS_INVALID_STATIC_RAND_ADDR, /* relate to BT_STATUS_INVALID_STATIC_RAND_ADDR in bt_def.h */ - ESP_BT_STATUS_PENDING, /* relate to BT_STATUS_PENDING in bt_def.h */ - ESP_BT_STATUS_UNACCEPT_CONN_INTERVAL, /* relate to BT_UNACCEPT_CONN_INTERVAL in bt_def.h */ - ESP_BT_STATUS_PARAM_OUT_OF_RANGE, /* relate to BT_PARAM_OUT_OF_RANGE in bt_def.h */ - ESP_BT_STATUS_TIMEOUT, /* relate to BT_STATUS_TIMEOUT in bt_def.h */ - ESP_BT_STATUS_PEER_LE_DATA_LEN_UNSUPPORTED, /* relate to BTM_PEER_LE_DATA_LEN_UNSUPPORTED in stack/btm_api.h */ - ESP_BT_STATUS_CONTROL_LE_DATA_LEN_UNSUPPORTED,/* relate to BTM_CONTROL_LE_DATA_LEN_UNSUPPORTED in stack/btm_api.h */ - ESP_BT_STATUS_ERR_ILLEGAL_PARAMETER_FMT, /* relate to HCI_ERR_ILLEGAL_PARAMETER_FMT in stack/hcidefs.h */ - ESP_BT_STATUS_MEMORY_FULL, /* relate to BT_STATUS_MEMORY_FULL in bt_def.h */ -} esp_bt_status_t; - - -/*Define the bt octet 16 bit size*/ -#define ESP_BT_OCTET16_LEN 16 -typedef uint8_t esp_bt_octet16_t[ESP_BT_OCTET16_LEN]; /* octet array: size 16 */ - -#define ESP_BT_OCTET8_LEN 8 -typedef uint8_t esp_bt_octet8_t[ESP_BT_OCTET8_LEN]; /* octet array: size 8 */ - -typedef uint8_t esp_link_key[ESP_BT_OCTET16_LEN]; /* Link Key */ - -/// Default GATT interface id -#define ESP_DEFAULT_GATT_IF 0xff - -#define ESP_BLE_CONN_INT_MIN 0x0006 /*!< relate to BTM_BLE_CONN_INT_MIN in stack/btm_ble_api.h */ -#define ESP_BLE_CONN_INT_MAX 0x0C80 /*!< relate to BTM_BLE_CONN_INT_MAX in stack/btm_ble_api.h */ -#define ESP_BLE_CONN_LATENCY_MAX 500 /*!< relate to ESP_BLE_CONN_LATENCY_MAX in stack/btm_ble_api.h */ -#define ESP_BLE_CONN_SUP_TOUT_MIN 0x000A /*!< relate to BTM_BLE_CONN_SUP_TOUT_MIN in stack/btm_ble_api.h */ -#define ESP_BLE_CONN_SUP_TOUT_MAX 0x0C80 /*!< relate to ESP_BLE_CONN_SUP_TOUT_MAX in stack/btm_ble_api.h */ -#define ESP_BLE_CONN_PARAM_UNDEF 0xffff /* use this value when a specific value not to be overwritten */ /* relate to ESP_BLE_CONN_PARAM_UNDEF in stack/btm_ble_api.h */ -#define ESP_BLE_SCAN_PARAM_UNDEF 0xffffffff /* relate to ESP_BLE_SCAN_PARAM_UNDEF in stack/btm_ble_api.h */ - -/// Check the param is valid or not -#define ESP_BLE_IS_VALID_PARAM(x, min, max) (((x) >= (min) && (x) <= (max)) || ((x) == ESP_BLE_CONN_PARAM_UNDEF)) - -/// UUID type -typedef struct { -#define ESP_UUID_LEN_16 2 -#define ESP_UUID_LEN_32 4 -#define ESP_UUID_LEN_128 16 - uint16_t len; /*!< UUID length, 16bit, 32bit or 128bit */ - union { - uint16_t uuid16; - uint32_t uuid32; - uint8_t uuid128[ESP_UUID_LEN_128]; - } uuid; /*!< UUID */ -} __attribute__((packed)) esp_bt_uuid_t; - -/// Bluetooth device type -typedef enum { - ESP_BT_DEVICE_TYPE_BREDR = 0x01, - ESP_BT_DEVICE_TYPE_BLE = 0x02, - ESP_BT_DEVICE_TYPE_DUMO = 0x03, -} esp_bt_dev_type_t; - -/// Bluetooth address length -#define ESP_BD_ADDR_LEN 6 - -/// Bluetooth device address -typedef uint8_t esp_bd_addr_t[ESP_BD_ADDR_LEN]; - -/// BLE device address type -typedef enum { - BLE_ADDR_TYPE_PUBLIC = 0x00, - BLE_ADDR_TYPE_RANDOM = 0x01, - BLE_ADDR_TYPE_RPA_PUBLIC = 0x02, - BLE_ADDR_TYPE_RPA_RANDOM = 0x03, -} esp_ble_addr_type_t; - -/// Used to exchange the encryption key in the init key & response key -#define ESP_BLE_ENC_KEY_MASK (1 << 0) /* relate to BTM_BLE_ENC_KEY_MASK in stack/btm_api.h */ -/// Used to exchange the IRK key in the init key & response key -#define ESP_BLE_ID_KEY_MASK (1 << 1) /* relate to BTM_BLE_ID_KEY_MASK in stack/btm_api.h */ -/// Used to exchange the CSRK key in the init key & response key -#define ESP_BLE_CSR_KEY_MASK (1 << 2) /* relate to BTM_BLE_CSR_KEY_MASK in stack/btm_api.h */ -/// Used to exchange the link key(this key just used in the BLE & BR/EDR coexist mode) in the init key & response key -#define ESP_BLE_LINK_KEY_MASK (1 << 3) /* relate to BTM_BLE_LINK_KEY_MASK in stack/btm_api.h */ -typedef uint8_t esp_ble_key_mask_t; /* the key mask type */ - -/// Minimum of the application id -#define ESP_APP_ID_MIN 0x0000 -/// Maximum of the application id -#define ESP_APP_ID_MAX 0x7fff - -#define ESP_BD_ADDR_STR "%02x:%02x:%02x:%02x:%02x:%02x" -#define ESP_BD_ADDR_HEX(addr) addr[0], addr[1], addr[2], addr[3], addr[4], addr[5] - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_BT_DEFS_H__ */ diff --git a/tools/sdk/include/bt/esp_bt_device.h b/tools/sdk/include/bt/esp_bt_device.h deleted file mode 100644 index 76fb1b9d34f..00000000000 --- a/tools/sdk/include/bt/esp_bt_device.h +++ /dev/null @@ -1,57 +0,0 @@ -// 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. - -#ifndef __ESP_BT_DEVICE_H__ -#define __ESP_BT_DEVICE_H__ - -#include -#include -#include "esp_err.h" -#include "esp_bt_defs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * - * @brief Get bluetooth device address. Must use after "esp_bluedroid_enable". - * - * @return bluetooth device address (six bytes), or NULL if bluetooth stack is not enabled - */ -const uint8_t *esp_bt_dev_get_address(void); - - -/** - * @brief Set bluetooth device name. This function should be called after esp_bluedroid_enable() - * completes successfully. - * A BR/EDR/LE device type shall have a single Bluetooth device name which shall be - * identical irrespective of the physical channel used to perform the name discovery procedure. - * - * @param[in] name : device name to be set - * - * @return - * - ESP_OK : Succeed - * - ESP_ERR_INVALID_ARG : if name is NULL pointer or empty, or string length out of limit - * - ESP_ERR_INVALID_STATE : if bluetooth stack is not yet enabled - * - ESP_FAIL : others - */ -esp_err_t esp_bt_dev_set_device_name(const char *name); - -#ifdef __cplusplus -} -#endif - - -#endif /* __ESP_BT_DEVICE_H__ */ diff --git a/tools/sdk/include/bt/esp_bt_main.h b/tools/sdk/include/bt/esp_bt_main.h deleted file mode 100644 index fad010d2c2b..00000000000 --- a/tools/sdk/include/bt/esp_bt_main.h +++ /dev/null @@ -1,81 +0,0 @@ -// 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. - -#ifndef __ESP_BT_MAIN_H__ -#define __ESP_BT_MAIN_H__ - -#include "esp_err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Bluetooth stack status type, to indicate whether the bluetooth stack is ready - */ -typedef enum { - ESP_BLUEDROID_STATUS_UNINITIALIZED = 0, /*!< Bluetooth not initialized */ - ESP_BLUEDROID_STATUS_INITIALIZED, /*!< Bluetooth initialized but not enabled */ - ESP_BLUEDROID_STATUS_ENABLED /*!< Bluetooth initialized and enabled */ -} esp_bluedroid_status_t; - -/** - * @brief Get bluetooth stack status - * - * @return Bluetooth stack status - * - */ -esp_bluedroid_status_t esp_bluedroid_get_status(void); - -/** - * @brief Enable bluetooth, must after esp_bluedroid_init() - * - * @return - * - ESP_OK : Succeed - * - Other : Failed - */ -esp_err_t esp_bluedroid_enable(void); - -/** - * @brief Disable bluetooth, must prior to esp_bluedroid_deinit() - * - * @return - * - ESP_OK : Succeed - * - Other : Failed - */ -esp_err_t esp_bluedroid_disable(void); - -/** - * @brief Init and alloc the resource for bluetooth, must be prior to every bluetooth stuff - * - * @return - * - ESP_OK : Succeed - * - Other : Failed - */ -esp_err_t esp_bluedroid_init(void); - -/** - * @brief Deinit and free the resource for bluetooth, must be after every bluetooth stuff - * - * @return - * - ESP_OK : Succeed - * - Other : Failed - */ -esp_err_t esp_bluedroid_deinit(void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_BT_MAIN_H__ */ diff --git a/tools/sdk/include/bt/esp_gap_ble_api.h b/tools/sdk/include/bt/esp_gap_ble_api.h deleted file mode 100644 index ff30f5f354a..00000000000 --- a/tools/sdk/include/bt/esp_gap_ble_api.h +++ /dev/null @@ -1,1220 +0,0 @@ -// 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. - -#ifndef __ESP_GAP_BLE_API_H__ -#define __ESP_GAP_BLE_API_H__ - -#include -#include - -#include "esp_err.h" -#include "esp_bt_defs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/**@{ - * BLE_ADV_DATA_FLAG data flag bit definition used for advertising data flag - */ -#define ESP_BLE_ADV_FLAG_LIMIT_DISC (0x01 << 0) -#define ESP_BLE_ADV_FLAG_GEN_DISC (0x01 << 1) -#define ESP_BLE_ADV_FLAG_BREDR_NOT_SPT (0x01 << 2) -#define ESP_BLE_ADV_FLAG_DMT_CONTROLLER_SPT (0x01 << 3) -#define ESP_BLE_ADV_FLAG_DMT_HOST_SPT (0x01 << 4) -#define ESP_BLE_ADV_FLAG_NON_LIMIT_DISC (0x00 ) -/** - * @} - */ - -/* relate to BTM_LE_KEY_xxx in stack/btm_api.h */ -#define ESP_LE_KEY_NONE 0 /* relate to BTM_LE_KEY_NONE in stack/btm_api.h */ -#define ESP_LE_KEY_PENC (1 << 0) /*!< encryption key, encryption information of peer device */ /* relate to BTM_LE_KEY_PENC in stack/btm_api.h */ -#define ESP_LE_KEY_PID (1 << 1) /*!< identity key of the peer device */ /* relate to BTM_LE_KEY_PID in stack/btm_api.h */ -#define ESP_LE_KEY_PCSRK (1 << 2) /*!< peer SRK */ /* relate to BTM_LE_KEY_PCSRK in stack/btm_api.h */ -#define ESP_LE_KEY_PLK (1 << 3) /*!< Link key*/ /* relate to BTM_LE_KEY_PLK in stack/btm_api.h */ -#define ESP_LE_KEY_LLK (ESP_LE_KEY_PLK << 4) /* relate to BTM_LE_KEY_LLK in stack/btm_api.h */ -#define ESP_LE_KEY_LENC (ESP_LE_KEY_PENC << 4) /*!< master role security information:div */ /* relate to BTM_LE_KEY_LENC in stack/btm_api.h */ -#define ESP_LE_KEY_LID (ESP_LE_KEY_PID << 4) /*!< master device ID key */ /* relate to BTM_LE_KEY_LID in stack/btm_api.h */ -#define ESP_LE_KEY_LCSRK (ESP_LE_KEY_PCSRK << 4) /*!< local CSRK has been deliver to peer */ /* relate to BTM_LE_KEY_LCSRK in stack/btm_api.h */ -typedef uint8_t esp_ble_key_type_t; - -/* relate to BTM_LE_AUTH_xxx in stack/btm_api.h */ -#define ESP_LE_AUTH_NO_BOND 0x00 /*!< 0*/ /* relate to BTM_LE_AUTH_NO_BOND in stack/btm_api.h */ -#define ESP_LE_AUTH_BOND 0x01 /*!< 1 << 0 */ /* relate to BTM_LE_AUTH_BOND in stack/btm_api.h */ -#define ESP_LE_AUTH_REQ_MITM (1 << 2) /*!< 1 << 2 */ /* relate to BTM_LE_AUTH_REQ_MITM in stack/btm_api.h */ -#define ESP_LE_AUTH_REQ_SC_ONLY (1 << 3) /*!< 1 << 3 */ /* relate to BTM_LE_AUTH_REQ_SC_ONLY in stack/btm_api.h */ -#define ESP_LE_AUTH_REQ_SC_BOND (ESP_LE_AUTH_BOND | ESP_LE_AUTH_REQ_SC_ONLY) /*!< 1001 */ /* relate to BTM_LE_AUTH_REQ_SC_BOND in stack/btm_api.h */ -#define ESP_LE_AUTH_REQ_SC_MITM (ESP_LE_AUTH_REQ_MITM | ESP_LE_AUTH_REQ_SC_ONLY) /*!< 1100 */ /* relate to BTM_LE_AUTH_REQ_SC_MITM in stack/btm_api.h */ -#define ESP_LE_AUTH_REQ_SC_MITM_BOND (ESP_LE_AUTH_REQ_MITM | ESP_LE_AUTH_REQ_SC_ONLY | ESP_LE_AUTH_BOND) /*!< 1101 */ /* relate to BTM_LE_AUTH_REQ_SC_MITM_BOND in stack/btm_api.h */ -typedef uint8_t esp_ble_auth_req_t; /*!< combination of the above bit pattern */ - -#define ESP_BLE_ONLY_ACCEPT_SPECIFIED_AUTH_DISABLE 0 -#define ESP_BLE_ONLY_ACCEPT_SPECIFIED_AUTH_ENABLE 1 - -/* relate to BTM_IO_CAP_xxx in stack/btm_api.h */ -#define ESP_IO_CAP_OUT 0 /*!< DisplayOnly */ /* relate to BTM_IO_CAP_OUT in stack/btm_api.h */ -#define ESP_IO_CAP_IO 1 /*!< DisplayYesNo */ /* relate to BTM_IO_CAP_IO in stack/btm_api.h */ -#define ESP_IO_CAP_IN 2 /*!< KeyboardOnly */ /* relate to BTM_IO_CAP_IN in stack/btm_api.h */ -#define ESP_IO_CAP_NONE 3 /*!< NoInputNoOutput */ /* relate to BTM_IO_CAP_NONE in stack/btm_api.h */ -#define ESP_IO_CAP_KBDISP 4 /*!< Keyboard display */ /* relate to BTM_IO_CAP_KBDISP in stack/btm_api.h */ - -#define ESP_BLE_APPEARANCE_UNKNOWN 0x0000 /* relate to BTM_BLE_APPEARANCE_UNKNOWN in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_PHONE 0x0040 /* relate to BTM_BLE_APPEARANCE_GENERIC_PHONE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_COMPUTER 0x0080 /* relate to BTM_BLE_APPEARANCE_GENERIC_COMPUTER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_WATCH 0x00C0 /* relate to BTM_BLE_APPEARANCE_GENERIC_WATCH in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_SPORTS_WATCH 0x00C1 /* relate to BTM_BLE_APPEARANCE_SPORTS_WATCH in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_CLOCK 0x0100 /* relate to BTM_BLE_APPEARANCE_GENERIC_CLOCK in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_DISPLAY 0x0140 /* relate to BTM_BLE_APPEARANCE_GENERIC_DISPLAY in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_REMOTE 0x0180 /* relate to BTM_BLE_APPEARANCE_GENERIC_REMOTE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_EYEGLASSES 0x01C0 /* relate to BTM_BLE_APPEARANCE_GENERIC_EYEGLASSES in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_TAG 0x0200 /* relate to BTM_BLE_APPEARANCE_GENERIC_TAG in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_KEYRING 0x0240 /* relate to BTM_BLE_APPEARANCE_GENERIC_KEYRING in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER 0x0280 /* relate to BTM_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER 0x02C0 /* relate to BTM_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_THERMOMETER 0x0300 /* relate to BTM_BLE_APPEARANCE_GENERIC_THERMOMETER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_THERMOMETER_EAR 0x0301 /* relate to BTM_BLE_APPEARANCE_THERMOMETER_EAR in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_HEART_RATE 0x0340 /* relate to BTM_BLE_APPEARANCE_GENERIC_HEART_RATE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HEART_RATE_BELT 0x0341 /* relate to BTM_BLE_APPEARANCE_HEART_RATE_BELT in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE 0x0380 /* relate to BTM_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_BLOOD_PRESSURE_ARM 0x0381 /* relate to BTM_BLE_APPEARANCE_BLOOD_PRESSURE_ARM in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST 0x0382 /* relate to BTM_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_HID 0x03C0 /* relate to BTM_BLE_APPEARANCE_GENERIC_HID in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_KEYBOARD 0x03C1 /* relate to BTM_BLE_APPEARANCE_HID_KEYBOARD in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_MOUSE 0x03C2 /* relate to BTM_BLE_APPEARANCE_HID_MOUSE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_JOYSTICK 0x03C3 /* relate to BTM_BLE_APPEARANCE_HID_JOYSTICK in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_GAMEPAD 0x03C4 /* relate to BTM_BLE_APPEARANCE_HID_GAMEPAD in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_DIGITIZER_TABLET 0x03C5 /* relate to BTM_BLE_APPEARANCE_HID_DIGITIZER_TABLET in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_CARD_READER 0x03C6 /* relate to BTM_BLE_APPEARANCE_HID_CARD_READER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_DIGITAL_PEN 0x03C7 /* relate to BTM_BLE_APPEARANCE_HID_DIGITAL_PEN in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_BARCODE_SCANNER 0x03C8 /* relate to BTM_BLE_APPEARANCE_HID_BARCODE_SCANNER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_GLUCOSE 0x0400 /* relate to BTM_BLE_APPEARANCE_GENERIC_GLUCOSE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_WALKING 0x0440 /* relate to BTM_BLE_APPEARANCE_GENERIC_WALKING in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_WALKING_IN_SHOE 0x0441 /* relate to BTM_BLE_APPEARANCE_WALKING_IN_SHOE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_WALKING_ON_SHOE 0x0442 /* relate to BTM_BLE_APPEARANCE_WALKING_ON_SHOE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_WALKING_ON_HIP 0x0443 /* relate to BTM_BLE_APPEARANCE_WALKING_ON_HIP in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_CYCLING 0x0480 /* relate to BTM_BLE_APPEARANCE_GENERIC_CYCLING in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_CYCLING_COMPUTER 0x0481 /* relate to BTM_BLE_APPEARANCE_CYCLING_COMPUTER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_CYCLING_SPEED 0x0482 /* relate to BTM_BLE_APPEARANCE_CYCLING_SPEED in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_CYCLING_CADENCE 0x0483 /* relate to BTM_BLE_APPEARANCE_CYCLING_CADENCE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_CYCLING_POWER 0x0484 /* relate to BTM_BLE_APPEARANCE_CYCLING_POWER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_CYCLING_SPEED_CADENCE 0x0485 /* relate to BTM_BLE_APPEARANCE_CYCLING_SPEED_CADENCE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER 0x0C40 /* relate to BTM_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP 0x0C41 /* relate to BTM_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_PULSE_OXIMETER_WRIST 0x0C42 /* relate to BTM_BLE_APPEARANCE_PULSE_OXIMETER_WRIST in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_WEIGHT 0x0C80 /* relate to BTM_BLE_APPEARANCE_GENERIC_WEIGHT in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE 0x0CC0 /* relate to BTM_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_POWERED_WHEELCHAIR 0x0CC1 /* relate to BTM_BLE_APPEARANCE_POWERED_WHEELCHAIR in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_MOBILITY_SCOOTER 0x0CC2 /* relate to BTM_BLE_APPEARANCE_MOBILITY_SCOOTER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR 0x0D00 /* relate to BTM_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_INSULIN_PUMP 0x0D40 /* relate to BTM_BLE_APPEARANCE_GENERIC_INSULIN_PUMP in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP 0x0D41 /* relate to BTM_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP 0x0D44 /* relate to BTM_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_INSULIN_PEN 0x0D48 /* relate to BTM_BLE_APPEARANCE_INSULIN_PEN in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY 0x0D80 /* relate to BTM_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS 0x1440 /* relate to BTM_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION 0x1441 /* relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV 0x1442 /* relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD 0x1443 /* relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV 0x1444 /* relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV in stack/btm_ble_api.h */ - -typedef uint8_t esp_ble_io_cap_t; /*!< combination of the io capability */ - -/// GAP BLE callback event type -typedef enum { - ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT = 0, /*!< When advertising data set complete, the event comes */ - ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT, /*!< When scan response data set complete, the event comes */ - ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT, /*!< When scan parameters set complete, the event comes */ - ESP_GAP_BLE_SCAN_RESULT_EVT, /*!< When one scan result ready, the event comes each time */ - ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT, /*!< When raw advertising data set complete, the event comes */ - ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT, /*!< When raw advertising data set complete, the event comes */ - ESP_GAP_BLE_ADV_START_COMPLETE_EVT, /*!< When start advertising complete, the event comes */ - ESP_GAP_BLE_SCAN_START_COMPLETE_EVT, /*!< When start scan complete, the event comes */ - ESP_GAP_BLE_AUTH_CMPL_EVT, /* Authentication complete indication. */ - ESP_GAP_BLE_KEY_EVT, /* BLE key event for peer device keys */ - ESP_GAP_BLE_SEC_REQ_EVT, /* BLE security request */ - ESP_GAP_BLE_PASSKEY_NOTIF_EVT, /* passkey notification event */ - ESP_GAP_BLE_PASSKEY_REQ_EVT, /* passkey request event */ - ESP_GAP_BLE_OOB_REQ_EVT, /* OOB request event */ - ESP_GAP_BLE_LOCAL_IR_EVT, /* BLE local IR event */ - ESP_GAP_BLE_LOCAL_ER_EVT, /* BLE local ER event */ - ESP_GAP_BLE_NC_REQ_EVT, /* Numeric Comparison request event */ - ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT, /*!< When stop adv complete, the event comes */ - ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT, /*!< When stop scan complete, the event comes */ - ESP_GAP_BLE_SET_STATIC_RAND_ADDR_EVT, /*!< When set the static rand address complete, the event comes */ - ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT, /*!< When update connection parameters complete, the event comes */ - ESP_GAP_BLE_SET_PKT_LENGTH_COMPLETE_EVT, /*!< When set pkt length complete, the event comes */ - ESP_GAP_BLE_SET_LOCAL_PRIVACY_COMPLETE_EVT, /*!< When Enable/disable privacy on the local device complete, the event comes */ - ESP_GAP_BLE_REMOVE_BOND_DEV_COMPLETE_EVT, /*!< When remove the bond device complete, the event comes */ - ESP_GAP_BLE_CLEAR_BOND_DEV_COMPLETE_EVT, /*!< When clear the bond device clear complete, the event comes */ - ESP_GAP_BLE_GET_BOND_DEV_COMPLETE_EVT, /*!< When get the bond device list complete, the event comes */ - ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT, /*!< When read the rssi complete, the event comes */ - ESP_GAP_BLE_UPDATE_WHITELIST_COMPLETE_EVT, /*!< When add or remove whitelist complete, the event comes */ - ESP_GAP_BLE_UPDATE_DUPLICATE_EXCEPTIONAL_LIST_COMPLETE_EVT, /*!< When update duplicate exceptional list complete, the event comes */ - ESP_GAP_BLE_EVT_MAX, -} esp_gap_ble_cb_event_t; -/// This is the old name, just for backwards compatibility -#define ESP_GAP_BLE_ADD_WHITELIST_COMPLETE_EVT ESP_GAP_BLE_UPDATE_WHITELIST_COMPLETE_EVT - -/// Advertising data maximum length -#define ESP_BLE_ADV_DATA_LEN_MAX 31 -/// Scan response data maximum length -#define ESP_BLE_SCAN_RSP_DATA_LEN_MAX 31 - -/* relate to BTM_BLE_AD_TYPE_xxx in stack/btm_ble_api.h */ -/// The type of advertising data(not adv_type) -typedef enum { - ESP_BLE_AD_TYPE_FLAG = 0x01, /* relate to BTM_BLE_AD_TYPE_FLAG in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_16SRV_PART = 0x02, /* relate to BTM_BLE_AD_TYPE_16SRV_PART in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_16SRV_CMPL = 0x03, /* relate to BTM_BLE_AD_TYPE_16SRV_CMPL in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_32SRV_PART = 0x04, /* relate to BTM_BLE_AD_TYPE_32SRV_PART in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_32SRV_CMPL = 0x05, /* relate to BTM_BLE_AD_TYPE_32SRV_CMPL in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_128SRV_PART = 0x06, /* relate to BTM_BLE_AD_TYPE_128SRV_PART in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_128SRV_CMPL = 0x07, /* relate to BTM_BLE_AD_TYPE_128SRV_CMPL in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_NAME_SHORT = 0x08, /* relate to BTM_BLE_AD_TYPE_NAME_SHORT in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_NAME_CMPL = 0x09, /* relate to BTM_BLE_AD_TYPE_NAME_CMPL in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_TX_PWR = 0x0A, /* relate to BTM_BLE_AD_TYPE_TX_PWR in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_DEV_CLASS = 0x0D, /* relate to BTM_BLE_AD_TYPE_DEV_CLASS in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_SM_TK = 0x10, /* relate to BTM_BLE_AD_TYPE_SM_TK in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_SM_OOB_FLAG = 0x11, /* relate to BTM_BLE_AD_TYPE_SM_OOB_FLAG in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_INT_RANGE = 0x12, /* relate to BTM_BLE_AD_TYPE_INT_RANGE in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_SOL_SRV_UUID = 0x14, /* relate to BTM_BLE_AD_TYPE_SOL_SRV_UUID in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_128SOL_SRV_UUID = 0x15, /* relate to BTM_BLE_AD_TYPE_128SOL_SRV_UUID in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_SERVICE_DATA = 0x16, /* relate to BTM_BLE_AD_TYPE_SERVICE_DATA in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_PUBLIC_TARGET = 0x17, /* relate to BTM_BLE_AD_TYPE_PUBLIC_TARGET in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_RANDOM_TARGET = 0x18, /* relate to BTM_BLE_AD_TYPE_RANDOM_TARGET in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_APPEARANCE = 0x19, /* relate to BTM_BLE_AD_TYPE_APPEARANCE in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_ADV_INT = 0x1A, /* relate to BTM_BLE_AD_TYPE_ADV_INT in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_LE_DEV_ADDR = 0x1b, /* relate to BTM_BLE_AD_TYPE_LE_DEV_ADDR in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_LE_ROLE = 0x1c, /* relate to BTM_BLE_AD_TYPE_LE_ROLE in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_SPAIR_C256 = 0x1d, /* relate to BTM_BLE_AD_TYPE_SPAIR_C256 in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_SPAIR_R256 = 0x1e, /* relate to BTM_BLE_AD_TYPE_SPAIR_R256 in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_32SOL_SRV_UUID = 0x1f, /* relate to BTM_BLE_AD_TYPE_32SOL_SRV_UUID in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_32SERVICE_DATA = 0x20, /* relate to BTM_BLE_AD_TYPE_32SERVICE_DATA in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_128SERVICE_DATA = 0x21, /* relate to BTM_BLE_AD_TYPE_128SERVICE_DATA in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_LE_SECURE_CONFIRM = 0x22, /* relate to BTM_BLE_AD_TYPE_LE_SECURE_CONFIRM in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_LE_SECURE_RANDOM = 0x23, /* relate to BTM_BLE_AD_TYPE_LE_SECURE_RANDOM in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_URI = 0x24, /* relate to BTM_BLE_AD_TYPE_URI in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_INDOOR_POSITION = 0x25, /* relate to BTM_BLE_AD_TYPE_INDOOR_POSITION in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_TRANS_DISC_DATA = 0x26, /* relate to BTM_BLE_AD_TYPE_TRANS_DISC_DATA in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_LE_SUPPORT_FEATURE = 0x27, /* relate to BTM_BLE_AD_TYPE_LE_SUPPORT_FEATURE in stack/btm_ble_api.h */ - ESP_BLE_AD_TYPE_CHAN_MAP_UPDATE = 0x28, /* relate to BTM_BLE_AD_TYPE_CHAN_MAP_UPDATE in stack/btm_ble_api.h */ - ESP_BLE_AD_MANUFACTURER_SPECIFIC_TYPE = 0xFF, /* relate to BTM_BLE_AD_MANUFACTURER_SPECIFIC_TYPE in stack/btm_ble_api.h */ -} esp_ble_adv_data_type; - -/// Advertising mode -typedef enum { - ADV_TYPE_IND = 0x00, - ADV_TYPE_DIRECT_IND_HIGH = 0x01, - ADV_TYPE_SCAN_IND = 0x02, - ADV_TYPE_NONCONN_IND = 0x03, - ADV_TYPE_DIRECT_IND_LOW = 0x04, -} esp_ble_adv_type_t; - -/// Advertising channel mask -typedef enum { - ADV_CHNL_37 = 0x01, - ADV_CHNL_38 = 0x02, - ADV_CHNL_39 = 0x04, - ADV_CHNL_ALL = 0x07, -} esp_ble_adv_channel_t; - -typedef enum { - ///Allow both scan and connection requests from anyone - ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY = 0x00, - ///Allow both scan req from White List devices only and connection req from anyone - ADV_FILTER_ALLOW_SCAN_WLST_CON_ANY, - ///Allow both scan req from anyone and connection req from White List devices only - ADV_FILTER_ALLOW_SCAN_ANY_CON_WLST, - ///Allow scan and connection requests from White List devices only - ADV_FILTER_ALLOW_SCAN_WLST_CON_WLST, - ///Enumeration end value for advertising filter policy value check -} esp_ble_adv_filter_t; - - -/* relate to BTA_DM_BLE_SEC_xxx in bta/bta_api.h */ -typedef enum { - ESP_BLE_SEC_ENCRYPT = 1, /* relate to BTA_DM_BLE_SEC_ENCRYPT in bta/bta_api.h. If the device has already - bonded, the stack will used LTK to encrypt with the remote device directly. - Else if the device hasn't bonded, the stack will used the default authentication request - used the esp_ble_gap_set_security_param function set by the user. */ - ESP_BLE_SEC_ENCRYPT_NO_MITM, /* relate to BTA_DM_BLE_SEC_ENCRYPT_NO_MITM in bta/bta_api.h. If the device has already - bonded, the stack will check the LTK Whether the authentication request has been met, if met, used the LTK - to encrypt with the remote device directly, else Re-pair with the remote device. - Else if the device hasn't bonded, the stack will used NO MITM authentication request in the current link instead of - used the authreq in the esp_ble_gap_set_security_param function set by the user. */ - ESP_BLE_SEC_ENCRYPT_MITM, /* relate to BTA_DM_BLE_SEC_ENCRYPT_MITM in bta/bta_api.h. If the device has already - bonded, the stack will check the LTK Whether the authentication request has been met, if met, used the LTK - to encrypt with the remote device directly, else Re-pair with the remote device. - Else if the device hasn't bonded, the stack will used MITM authentication request in the current link instead of - used the authreq in the esp_ble_gap_set_security_param function set by the user. */ -}esp_ble_sec_act_t; - -typedef enum { - ESP_BLE_SM_PASSKEY = 0, - ESP_BLE_SM_AUTHEN_REQ_MODE, - ESP_BLE_SM_IOCAP_MODE, - ESP_BLE_SM_SET_INIT_KEY, - ESP_BLE_SM_SET_RSP_KEY, - ESP_BLE_SM_MAX_KEY_SIZE, - ESP_BLE_SM_SET_STATIC_PASSKEY, - ESP_BLE_SM_CLEAR_STATIC_PASSKEY, - ESP_BLE_SM_ONLY_ACCEPT_SPECIFIED_SEC_AUTH, - ESP_BLE_SM_MAX_PARAM, -} esp_ble_sm_param_t; - -/// Advertising parameters -typedef struct { - uint16_t adv_int_min; /*!< Minimum advertising interval for - undirected and low duty cycle directed advertising. - Range: 0x0020 to 0x4000 Default: N = 0x0800 (1.28 second) - Time = N * 0.625 msec Time Range: 20 ms to 10.24 sec */ - uint16_t adv_int_max; /*!< Maximum advertising interval for - undirected and low duty cycle directed advertising. - Range: 0x0020 to 0x4000 Default: N = 0x0800 (1.28 second) - Time = N * 0.625 msec Time Range: 20 ms to 10.24 sec Advertising max interval */ - esp_ble_adv_type_t adv_type; /*!< Advertising type */ - esp_ble_addr_type_t own_addr_type; /*!< Owner bluetooth device address type */ - esp_bd_addr_t peer_addr; /*!< Peer device bluetooth device address */ - esp_ble_addr_type_t peer_addr_type; /*!< Peer device bluetooth device address type, only support public address type and random address type */ - esp_ble_adv_channel_t channel_map; /*!< Advertising channel map */ - esp_ble_adv_filter_t adv_filter_policy; /*!< Advertising filter policy */ -} esp_ble_adv_params_t; - -/// Advertising data content, according to "Supplement to the Bluetooth Core Specification" -typedef struct { - bool set_scan_rsp; /*!< Set this advertising data as scan response or not*/ - bool include_name; /*!< Advertising data include device name or not */ - bool include_txpower; /*!< Advertising data include TX power */ - int min_interval; /*!< Advertising data show slave preferred connection min interval. - The connection interval in the following manner: - connIntervalmin = Conn_Interval_Min * 1.25 ms - Conn_Interval_Min range: 0x0006 to 0x0C80 - Value of 0xFFFF indicates no specific minimum. - Values not defined above are reserved for future use.*/ - - int max_interval; /*!< Advertising data show slave preferred connection max interval. - The connection interval in the following manner: - connIntervalmax = Conn_Interval_Max * 1.25 ms - Conn_Interval_Max range: 0x0006 to 0x0C80 - Conn_Interval_Max shall be equal to or greater than the Conn_Interval_Min. - Value of 0xFFFF indicates no specific maximum. - Values not defined above are reserved for future use.*/ - - int appearance; /*!< External appearance of device */ - uint16_t manufacturer_len; /*!< Manufacturer data length */ - uint8_t *p_manufacturer_data; /*!< Manufacturer data point */ - uint16_t service_data_len; /*!< Service data length */ - uint8_t *p_service_data; /*!< Service data point */ - uint16_t service_uuid_len; /*!< Service uuid length */ - uint8_t *p_service_uuid; /*!< Service uuid array point */ - uint8_t flag; /*!< Advertising flag of discovery mode, see BLE_ADV_DATA_FLAG detail */ -} esp_ble_adv_data_t; - -/// Ble scan type -typedef enum { - BLE_SCAN_TYPE_PASSIVE = 0x0, /*!< Passive scan */ - BLE_SCAN_TYPE_ACTIVE = 0x1, /*!< Active scan */ -} esp_ble_scan_type_t; - -/// Ble scan filter type -typedef enum { - BLE_SCAN_FILTER_ALLOW_ALL = 0x0, /*!< Accept all : - 1. advertisement packets except directed advertising packets not addressed to this device (default). */ - BLE_SCAN_FILTER_ALLOW_ONLY_WLST = 0x1, /*!< Accept only : - 1. advertisement packets from devices where the advertiser’s address is in the White list. - 2. Directed advertising packets which are not addressed for this device shall be ignored. */ - BLE_SCAN_FILTER_ALLOW_UND_RPA_DIR = 0x2, /*!< Accept all : - 1. undirected advertisement packets, and - 2. directed advertising packets where the initiator address is a resolvable private address, and - 3. directed advertising packets addressed to this device. */ - BLE_SCAN_FILTER_ALLOW_WLIST_PRA_DIR = 0x3, /*!< Accept all : - 1. advertisement packets from devices where the advertiser’s address is in the White list, and - 2. directed advertising packets where the initiator address is a resolvable private address, and - 3. directed advertising packets addressed to this device.*/ -} esp_ble_scan_filter_t; - -/// Ble scan duplicate type -typedef enum { - BLE_SCAN_DUPLICATE_DISABLE = 0x0, /*!< the Link Layer should generate advertising reports to the host for each packet received */ - BLE_SCAN_DUPLICATE_ENABLE = 0x1, /*!< the Link Layer should filter out duplicate advertising reports to the Host */ - BLE_SCAN_DUPLICATE_MAX = 0x2, /*!< 0x02 – 0xFF, Reserved for future use */ -} esp_ble_scan_duplicate_t; - -/// Ble scan parameters -typedef struct { - esp_ble_scan_type_t scan_type; /*!< Scan type */ - esp_ble_addr_type_t own_addr_type; /*!< Owner address type */ - esp_ble_scan_filter_t scan_filter_policy; /*!< Scan filter policy */ - uint16_t scan_interval; /*!< Scan interval. This is defined as the time interval from - when the Controller started its last LE scan until it begins the subsequent LE scan. - Range: 0x0004 to 0x4000 Default: 0x0010 (10 ms) - Time = N * 0.625 msec - Time Range: 2.5 msec to 10.24 seconds*/ - uint16_t scan_window; /*!< Scan window. The duration of the LE scan. LE_Scan_Window - shall be less than or equal to LE_Scan_Interval - Range: 0x0004 to 0x4000 Default: 0x0010 (10 ms) - Time = N * 0.625 msec - Time Range: 2.5 msec to 10240 msec */ - esp_ble_scan_duplicate_t scan_duplicate; /*!< The Scan_Duplicates parameter controls whether the Link Layer should filter out - duplicate advertising reports (BLE_SCAN_DUPLICATE_ENABLE) to the Host, or if the Link Layer should generate - advertising reports for each packet received */ -} esp_ble_scan_params_t; - -/// Connection update parameters -typedef struct { - esp_bd_addr_t bda; /*!< Bluetooth device address */ - uint16_t min_int; /*!< Min connection interval */ - uint16_t max_int; /*!< Max connection interval */ - uint16_t latency; /*!< Slave latency for the connection in number of connection events. Range: 0x0000 to 0x01F3 */ - uint16_t timeout; /*!< Supervision timeout for the LE Link. Range: 0x000A to 0x0C80. - Mandatory Range: 0x000A to 0x0C80 Time = N * 10 msec - Time Range: 100 msec to 32 seconds */ -} esp_ble_conn_update_params_t; - -/** -* @brief BLE pkt date length keys -*/ -typedef struct -{ - uint16_t rx_len; /*!< pkt rx data length value */ - uint16_t tx_len; /*!< pkt tx data length value */ -}esp_ble_pkt_data_length_params_t; - -/** -* @brief BLE encryption keys -*/ -typedef struct -{ - esp_bt_octet16_t ltk; /*!< The long term key*/ - esp_bt_octet8_t rand; /*!< The random number*/ - uint16_t ediv; /*!< The ediv value*/ - uint8_t sec_level; /*!< The security level of the security link*/ - uint8_t key_size; /*!< The key size(7~16) of the security link*/ -} esp_ble_penc_keys_t; /*!< The key type*/ - -/** -* @brief BLE CSRK keys -*/ -typedef struct -{ - uint32_t counter; /*!< The counter */ - esp_bt_octet16_t csrk; /*!< The csrk key */ - uint8_t sec_level; /*!< The security level */ -} esp_ble_pcsrk_keys_t; /*!< The pcsrk key type */ - -/** -* @brief BLE pid keys -*/ -typedef struct -{ - esp_bt_octet16_t irk; /*!< The irk value */ - esp_ble_addr_type_t addr_type; /*!< The address type */ - esp_bd_addr_t static_addr; /*!< The static address */ -} esp_ble_pid_keys_t; /*!< The pid key type */ - -/** -* @brief BLE Encryption reproduction keys -*/ -typedef struct -{ - esp_bt_octet16_t ltk; /*!< The long term key */ - uint16_t div; /*!< The div value */ - uint8_t key_size; /*!< The key size of the security link */ - uint8_t sec_level; /*!< The security level of the security link */ -} esp_ble_lenc_keys_t; /*!< The key type */ - -/** -* @brief BLE SRK keys -*/ -typedef struct -{ - uint32_t counter; /*!< The counter value */ - uint16_t div; /*!< The div value */ - uint8_t sec_level; /*!< The security level of the security link */ - esp_bt_octet16_t csrk; /*!< The csrk key value */ -} esp_ble_lcsrk_keys; /*!< The csrk key type */ - -/** -* @brief Structure associated with ESP_KEY_NOTIF_EVT -*/ -typedef struct -{ - esp_bd_addr_t bd_addr; /*!< peer address */ - uint32_t passkey; /*!< the numeric value for comparison. If just_works, do not show this number to UI */ -} esp_ble_sec_key_notif_t; /*!< BLE key notify type*/ - -/** -* @brief Structure of the security request -*/ -typedef struct -{ - esp_bd_addr_t bd_addr; /*!< peer address */ -} esp_ble_sec_req_t; /*!< BLE security request type*/ - -/** -* @brief union type of the security key value -*/ -typedef union -{ - esp_ble_penc_keys_t penc_key; /*!< received peer encryption key */ - esp_ble_pcsrk_keys_t pcsrk_key; /*!< received peer device SRK */ - esp_ble_pid_keys_t pid_key; /*!< peer device ID key */ - esp_ble_lenc_keys_t lenc_key; /*!< local encryption reproduction keys LTK = = d1(ER,DIV,0)*/ - esp_ble_lcsrk_keys lcsrk_key; /*!< local device CSRK = d1(ER,DIV,1)*/ -} esp_ble_key_value_t; /*!< ble key value type*/ - -/** -* @brief struct type of the bond key information value -*/ -typedef struct -{ - esp_ble_key_mask_t key_mask; /*!< the key mask to indicate witch key is present */ - esp_ble_penc_keys_t penc_key; /*!< received peer encryption key */ - esp_ble_pcsrk_keys_t pcsrk_key; /*!< received peer device SRK */ - esp_ble_pid_keys_t pid_key; /*!< peer device ID key */ -} esp_ble_bond_key_info_t; /*!< ble bond key information value type */ - -/** -* @brief struct type of the bond device value -*/ -typedef struct -{ - esp_bd_addr_t bd_addr; /*!< peer address */ - esp_ble_bond_key_info_t bond_key; /*!< the bond key information */ -} esp_ble_bond_dev_t; /*!< the ble bond device type */ - - -/** -* @brief union type of the security key value -*/ -typedef struct -{ - esp_bd_addr_t bd_addr; /*!< peer address */ - esp_ble_key_type_t key_type; /*!< key type of the security link */ - esp_ble_key_value_t p_key_value; /*!< the pointer to the key value */ -} esp_ble_key_t; /*!< the union to the ble key value type*/ - -/** -* @brief structure type of the ble local id keys value -*/ -typedef struct { - esp_bt_octet16_t ir; /*!< the 16 bits of the ir value */ - esp_bt_octet16_t irk; /*!< the 16 bits of the ir key value */ - esp_bt_octet16_t dhk; /*!< the 16 bits of the dh key value */ -} esp_ble_local_id_keys_t; /*!< the structure of the ble local id keys value type*/ - - -/** - * @brief Structure associated with ESP_AUTH_CMPL_EVT - */ -typedef struct -{ - esp_bd_addr_t bd_addr; /*!< BD address peer device. */ - bool key_present; /*!< Valid link key value in key element */ - esp_link_key key; /*!< Link key associated with peer device. */ - uint8_t key_type; /*!< The type of Link Key */ - bool success; /*!< TRUE of authentication succeeded, FALSE if failed. */ - uint8_t fail_reason; /*!< The HCI reason/error code for when success=FALSE */ - esp_ble_addr_type_t addr_type; /*!< Peer device address type */ - esp_bt_dev_type_t dev_type; /*!< Device type */ - esp_ble_auth_req_t auth_mode; /*!< authentication mode */ -} esp_ble_auth_cmpl_t; /*!< The ble authentication complete cb type */ - -/** - * @brief union associated with ble security - */ -typedef union -{ - esp_ble_sec_key_notif_t key_notif; /*!< passkey notification */ - esp_ble_sec_req_t ble_req; /*!< BLE SMP related request */ - esp_ble_key_t ble_key; /*!< BLE SMP keys used when pairing */ - esp_ble_local_id_keys_t ble_id_keys; /*!< BLE IR event */ - esp_ble_auth_cmpl_t auth_cmpl; /*!< Authentication complete indication. */ -} esp_ble_sec_t; /*!< BLE security type */ - -/// Sub Event of ESP_GAP_BLE_SCAN_RESULT_EVT -typedef enum { - ESP_GAP_SEARCH_INQ_RES_EVT = 0, /*!< Inquiry result for a peer device. */ - ESP_GAP_SEARCH_INQ_CMPL_EVT = 1, /*!< Inquiry complete. */ - ESP_GAP_SEARCH_DISC_RES_EVT = 2, /*!< Discovery result for a peer device. */ - ESP_GAP_SEARCH_DISC_BLE_RES_EVT = 3, /*!< Discovery result for BLE GATT based service on a peer device. */ - ESP_GAP_SEARCH_DISC_CMPL_EVT = 4, /*!< Discovery complete. */ - ESP_GAP_SEARCH_DI_DISC_CMPL_EVT = 5, /*!< Discovery complete. */ - ESP_GAP_SEARCH_SEARCH_CANCEL_CMPL_EVT = 6, /*!< Search cancelled */ - ESP_GAP_SEARCH_INQ_DISCARD_NUM_EVT = 7, /*!< The number of pkt discarded by flow control */ -} esp_gap_search_evt_t; - -/** - * @brief Ble scan result event type, to indicate the - * result is scan response or advertising data or other - */ -typedef enum { - ESP_BLE_EVT_CONN_ADV = 0x00, /*!< Connectable undirected advertising (ADV_IND) */ - ESP_BLE_EVT_CONN_DIR_ADV = 0x01, /*!< Connectable directed advertising (ADV_DIRECT_IND) */ - ESP_BLE_EVT_DISC_ADV = 0x02, /*!< Scannable undirected advertising (ADV_SCAN_IND) */ - ESP_BLE_EVT_NON_CONN_ADV = 0x03, /*!< Non connectable undirected advertising (ADV_NONCONN_IND) */ - ESP_BLE_EVT_SCAN_RSP = 0x04, /*!< Scan Response (SCAN_RSP) */ -} esp_ble_evt_type_t; - -typedef enum{ - ESP_BLE_WHITELIST_REMOVE = 0X00, /*!< remove mac from whitelist */ - ESP_BLE_WHITELIST_ADD = 0X01, /*!< add address to whitelist */ -}esp_ble_wl_opration_t; - -typedef enum { - ESP_BLE_DUPLICATE_EXCEPTIONAL_LIST_ADD = 0, /*!< Add device info into duplicate scan exceptional list */ - ESP_BLE_DUPLICATE_EXCEPTIONAL_LIST_REMOVE, /*!< Remove device info from duplicate scan exceptional list */ - ESP_BLE_DUPLICATE_EXCEPTIONAL_LIST_CLEAN, /*!< Clean duplicate scan exceptional list */ -} esp_bt_duplicate_exceptional_subcode_type_t; - -#define BLE_BIT(n) (1UL<<(n)) - -typedef enum { - ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_ADV_ADDR = 0, /*!< BLE advertising address , device info will be added into ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_ADDR_LIST */ - ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_LINK_ID, /*!< BLE mesh link ID, it is for BLE mesh, device info will be added into ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_MESH_LINK_ID_LIST */ - ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_BEACON_TYPE, /*!< BLE mesh beacon AD type, the format is | Len | 0x2B | Beacon Type | Beacon Data | */ - ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_PROV_SRV_ADV, /*!< BLE mesh provisioning service uuid, the format is | 0x02 | 0x01 | flags | 0x03 | 0x03 | 0x1827 | .... |` */ - ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_PROXY_SRV_ADV, /*!< BLE mesh adv with proxy service uuid, the format is | 0x02 | 0x01 | flags | 0x03 | 0x03 | 0x1828 | .... |` */ -} esp_ble_duplicate_exceptional_info_type_t; - -typedef enum { - ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_ADDR_LIST = BLE_BIT(0), /*!< duplicate scan exceptional addr list */ - ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_MESH_LINK_ID_LIST = BLE_BIT(1), /*!< duplicate scan exceptional mesh link ID list */ - ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_MESH_BEACON_TYPE_LIST = BLE_BIT(2), /*!< duplicate scan exceptional mesh beacon type list */ - ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_MESH_PROV_SRV_ADV_LIST = BLE_BIT(3), /*!< duplicate scan exceptional mesh adv with provisioning service uuid */ - ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_MESH_PROXY_SRV_ADV_LIST = BLE_BIT(4), /*!< duplicate scan exceptional mesh adv with provisioning service uuid */ - ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_ALL_LIST = 0xFFFF, /*!< duplicate scan exceptional all list */ -} esp_duplicate_scan_exceptional_list_type_t; - -typedef uint8_t esp_duplicate_info_t[ESP_BD_ADDR_LEN]; - -/** - * @brief Gap callback parameters union - */ -typedef union { - /** - * @brief ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT - */ - struct ble_adv_data_cmpl_evt_param { - esp_bt_status_t status; /*!< Indicate the set advertising data operation success status */ - } adv_data_cmpl; /*!< Event parameter of ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT */ - /** - * @brief ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT - */ - struct ble_scan_rsp_data_cmpl_evt_param { - esp_bt_status_t status; /*!< Indicate the set scan response data operation success status */ - } scan_rsp_data_cmpl; /*!< Event parameter of ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT */ - /** - * @brief ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT - */ - struct ble_scan_param_cmpl_evt_param { - esp_bt_status_t status; /*!< Indicate the set scan param operation success status */ - } scan_param_cmpl; /*!< Event parameter of ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT */ - /** - * @brief ESP_GAP_BLE_SCAN_RESULT_EVT - */ - struct ble_scan_result_evt_param { - esp_gap_search_evt_t search_evt; /*!< Search event type */ - esp_bd_addr_t bda; /*!< Bluetooth device address which has been searched */ - esp_bt_dev_type_t dev_type; /*!< Device type */ - esp_ble_addr_type_t ble_addr_type; /*!< Ble device address type */ - esp_ble_evt_type_t ble_evt_type; /*!< Ble scan result event type */ - int rssi; /*!< Searched device's RSSI */ - uint8_t ble_adv[ESP_BLE_ADV_DATA_LEN_MAX + ESP_BLE_SCAN_RSP_DATA_LEN_MAX]; /*!< Received EIR */ - int flag; /*!< Advertising data flag bit */ - int num_resps; /*!< Scan result number */ - uint8_t adv_data_len; /*!< Adv data length */ - uint8_t scan_rsp_len; /*!< Scan response length */ - uint32_t num_dis; /*!< The number of discard packets */ - } scan_rst; /*!< Event parameter of ESP_GAP_BLE_SCAN_RESULT_EVT */ - /** - * @brief ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT - */ - struct ble_adv_data_raw_cmpl_evt_param { - esp_bt_status_t status; /*!< Indicate the set raw advertising data operation success status */ - } adv_data_raw_cmpl; /*!< Event parameter of ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT */ - /** - * @brief ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT - */ - struct ble_scan_rsp_data_raw_cmpl_evt_param { - esp_bt_status_t status; /*!< Indicate the set raw advertising data operation success status */ - } scan_rsp_data_raw_cmpl; /*!< Event parameter of ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT */ - /** - * @brief ESP_GAP_BLE_ADV_START_COMPLETE_EVT - */ - struct ble_adv_start_cmpl_evt_param { - esp_bt_status_t status; /*!< Indicate advertising start operation success status */ - } adv_start_cmpl; /*!< Event parameter of ESP_GAP_BLE_ADV_START_COMPLETE_EVT */ - /** - * @brief ESP_GAP_BLE_SCAN_START_COMPLETE_EVT - */ - struct ble_scan_start_cmpl_evt_param { - esp_bt_status_t status; /*!< Indicate scan start operation success status */ - } scan_start_cmpl; /*!< Event parameter of ESP_GAP_BLE_SCAN_START_COMPLETE_EVT */ - - esp_ble_sec_t ble_security; /*!< ble gap security union type */ - /** - * @brief ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT - */ - struct ble_scan_stop_cmpl_evt_param { - esp_bt_status_t status; /*!< Indicate scan stop operation success status */ - } scan_stop_cmpl; /*!< Event parameter of ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT */ - /** - * @brief ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT - */ - struct ble_adv_stop_cmpl_evt_param { - esp_bt_status_t status; /*!< Indicate adv stop operation success status */ - } adv_stop_cmpl; /*!< Event parameter of ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT */ - /** - * @brief ESP_GAP_BLE_SET_STATIC_RAND_ADDR_EVT - */ - struct ble_set_rand_cmpl_evt_param { - esp_bt_status_t status; /*!< Indicate set static rand address operation success status */ - } set_rand_addr_cmpl; /*!< Event parameter of ESP_GAP_BLE_SET_STATIC_RAND_ADDR_EVT */ - /** - * @brief ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT - */ - struct ble_update_conn_params_evt_param { - esp_bt_status_t status; /*!< Indicate update connection parameters success status */ - esp_bd_addr_t bda; /*!< Bluetooth device address */ - uint16_t min_int; /*!< Min connection interval */ - uint16_t max_int; /*!< Max connection interval */ - uint16_t latency; /*!< Slave latency for the connection in number of connection events. Range: 0x0000 to 0x01F3 */ - uint16_t conn_int; /*!< Current connection interval */ - uint16_t timeout; /*!< Supervision timeout for the LE Link. Range: 0x000A to 0x0C80. - Mandatory Range: 0x000A to 0x0C80 Time = N * 10 msec */ - }update_conn_params; /*!< Event parameter of ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT */ - /** - * @brief ESP_GAP_BLE_SET_PKT_LENGTH_COMPLETE_EVT - */ - struct ble_pkt_data_length_cmpl_evt_param { - esp_bt_status_t status; /*!< Indicate the set pkt data length operation success status */ - esp_ble_pkt_data_length_params_t params; /*!< pkt data length value */ - } pkt_data_lenth_cmpl; /*!< Event parameter of ESP_GAP_BLE_SET_PKT_LENGTH_COMPLETE_EVT */ - /** - * @brief ESP_GAP_BLE_SET_LOCAL_PRIVACY_COMPLETE_EVT - */ - struct ble_local_privacy_cmpl_evt_param { - esp_bt_status_t status; /*!< Indicate the set local privacy operation success status */ - } local_privacy_cmpl; /*!< Event parameter of ESP_GAP_BLE_SET_LOCAL_PRIVACY_COMPLETE_EVT */ - /** - * @brief ESP_GAP_BLE_REMOVE_BOND_DEV_COMPLETE_EVT - */ - struct ble_remove_bond_dev_cmpl_evt_param { - esp_bt_status_t status; /*!< Indicate the remove bond device operation success status */ - esp_bd_addr_t bd_addr; /*!< The device address which has been remove from the bond list */ - }remove_bond_dev_cmpl; /*!< Event parameter of ESP_GAP_BLE_REMOVE_BOND_DEV_COMPLETE_EVT */ - /** - * @brief ESP_GAP_BLE_CLEAR_BOND_DEV_COMPLETE_EVT - */ - struct ble_clear_bond_dev_cmpl_evt_param { - esp_bt_status_t status; /*!< Indicate the clear bond device operation success status */ - }clear_bond_dev_cmpl; /*!< Event parameter of ESP_GAP_BLE_CLEAR_BOND_DEV_COMPLETE_EVT */ - /** - * @brief ESP_GAP_BLE_GET_BOND_DEV_COMPLETE_EVT - */ - struct ble_get_bond_dev_cmpl_evt_param { - esp_bt_status_t status; /*!< Indicate the get bond device operation success status */ - uint8_t dev_num; /*!< Indicate the get number device in the bond list */ - esp_ble_bond_dev_t *bond_dev; /*!< the pointer to the bond device Structure */ - }get_bond_dev_cmpl; /*!< Event parameter of ESP_GAP_BLE_GET_BOND_DEV_COMPLETE_EVT */ - /** - * @brief ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT - */ - struct ble_read_rssi_cmpl_evt_param { - esp_bt_status_t status; /*!< Indicate the read adv tx power operation success status */ - int8_t rssi; /*!< The ble remote device rssi value, the range is from -127 to 20, the unit is dbm, - if the RSSI cannot be read, the RSSI metric shall be set to 127. */ - esp_bd_addr_t remote_addr; /*!< The remote device address */ - } read_rssi_cmpl; /*!< Event parameter of ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT */ - /** - * @brief ESP_GAP_BLE_UPDATE_WHITELIST_COMPLETE_EVT - */ - struct ble_update_whitelist_cmpl_evt_param { - esp_bt_status_t status; /*!< Indicate the add or remove whitelist operation success status */ - esp_ble_wl_opration_t wl_opration; /*!< The value is ESP_BLE_WHITELIST_ADD if add address to whitelist operation success, ESP_BLE_WHITELIST_REMOVE if remove address from the whitelist operation success */ - } update_whitelist_cmpl; /*!< Event parameter of ESP_GAP_BLE_UPDATE_WHITELIST_COMPLETE_EVT */ - /** - * @brief ESP_GAP_BLE_UPDATE_DUPLICATE_EXCEPTIONAL_LIST_COMPLETE_EVT - */ - struct ble_update_duplicate_exceptional_list_cmpl_evt_param { - esp_bt_status_t status; /*!< Indicate update duplicate scan exceptional list operation success status */ - uint8_t subcode; /*!< Define in esp_bt_duplicate_exceptional_subcode_type_t */ - uint16_t length; /*!< The length of device_info */ - esp_duplicate_info_t device_info; /*!< device information, when subcode is ESP_BLE_DUPLICATE_EXCEPTIONAL_LIST_CLEAN, the value is invalid */ - } update_duplicate_exceptional_list_cmpl; /*!< Event parameter of ESP_GAP_BLE_UPDATE_DUPLICATE_EXCEPTIONAL_LIST_COMPLETE_EVT */ -} esp_ble_gap_cb_param_t; - -/** - * @brief GAP callback function type - * @param event : Event type - * @param param : Point to callback parameter, currently is union type - */ -typedef void (* esp_gap_ble_cb_t)(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param); - -/** - * @brief This function is called to occur gap event, such as scan result - * - * @param[in] callback: callback function - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gap_register_callback(esp_gap_ble_cb_t callback); - - -/** - * @brief This function is called to override the BTA default ADV parameters. - * - * @param[in] adv_data: Pointer to User defined ADV data structure. This - * memory space can not be freed until callback of config_adv_data - * is received. - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gap_config_adv_data (esp_ble_adv_data_t *adv_data); - - - -/** - * @brief This function is called to set scan parameters - * - * @param[in] scan_params: Pointer to User defined scan_params data structure. This - * memory space can not be freed until callback of set_scan_params - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gap_set_scan_params(esp_ble_scan_params_t *scan_params); - - -/** - * @brief This procedure keep the device scanning the peer device which advertising on the air - * - * @param[in] duration: Keeping the scanning time, the unit is second. - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gap_start_scanning(uint32_t duration); - - -/** - * @brief This function call to stop the device scanning the peer device which advertising on the air - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gap_stop_scanning(void); - -/** - * @brief This function is called to start advertising. - * - * @param[in] adv_params: pointer to User defined adv_params data structure. - - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gap_start_advertising (esp_ble_adv_params_t *adv_params); - - - -/** - * @brief This function is called to stop advertising. - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gap_stop_advertising(void); - - - -/** - * @brief Update connection parameters, can only be used when connection is up. - * - * @param[in] params - connection update parameters - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gap_update_conn_params(esp_ble_conn_update_params_t *params); - - -/** - * @brief This function is to set maximum LE data packet size - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gap_set_pkt_data_len(esp_bd_addr_t remote_device, uint16_t tx_data_length); - -/** - * @brief This function sets the random address for the application - * - * @param[in] rand_addr: the random address which should be setting - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gap_set_rand_addr(esp_bd_addr_t rand_addr); - -/** - * @brief This function clears the random address for the application - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gap_clear_rand_addr(void); - - - -/** - * @brief Enable/disable privacy on the local device - * - * @param[in] privacy_enable - enable/disable privacy on remote device. - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gap_config_local_privacy (bool privacy_enable); - -/** - * @brief set local gap appearance icon - * - * - * @param[in] icon - External appearance value, these values are defined by the Bluetooth SIG, please refer to - * https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.gap.appearance.xml - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gap_config_local_icon (uint16_t icon); - -/** -* @brief Add or remove device from white list -* -* @param[in] add_remove: the value is true if added the ble device to the white list, and false remove to the white list. -* @param[in] remote_bda: the remote device address add/remove from the white list. -* @return -* - ESP_OK : success -* - other : failed -* -*/ -esp_err_t esp_ble_gap_update_whitelist(bool add_remove, esp_bd_addr_t remote_bda); - -/** -* @brief Get the whitelist size in the controller -* -* @param[out] length: the white list length. -* @return -* - ESP_OK : success -* - other : failed -* -*/ -esp_err_t esp_ble_gap_get_whitelist_size(uint16_t *length); - -/** -* @brief This function is called to set the preferred connection -* parameters when default connection parameter is not desired before connecting. -* This API can only be used in the master role. -* -* @param[in] bd_addr: BD address of the peripheral -* @param[in] min_conn_int: minimum preferred connection interval -* @param[in] max_conn_int: maximum preferred connection interval -* @param[in] slave_latency: preferred slave latency -* @param[in] supervision_tout: preferred supervision timeout -* -* @return -* - ESP_OK : success -* - other : failed -* -*/ -esp_err_t esp_ble_gap_set_prefer_conn_params(esp_bd_addr_t bd_addr, - uint16_t min_conn_int, uint16_t max_conn_int, - uint16_t slave_latency, uint16_t supervision_tout); - -/** - * @brief Set device name to the local device - * - * @param[in] name - device name. - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gap_set_device_name(const char *name); - -/** - * @brief This function is called to get local used address and adress type. - * uint8_t *esp_bt_dev_get_address(void) get the public address - * - * @param[in] local_used_addr - current local used ble address (six bytes) - * @param[in] addr_type - ble address type - * - * @return - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gap_get_local_used_addr(esp_bd_addr_t local_used_addr, uint8_t * addr_type); -/** - * @brief This function is called to get ADV data for a specific type. - * - * @param[in] adv_data - pointer of ADV data which to be resolved - * @param[in] type - finding ADV data type - * @param[out] length - return the length of ADV data not including type - * - * @return pointer of ADV data - * - */ -uint8_t *esp_ble_resolve_adv_data(uint8_t *adv_data, uint8_t type, uint8_t *length); - -/** - * @brief This function is called to set raw advertising data. User need to fill - * ADV data by self. - * - * @param[in] raw_data : raw advertising data - * @param[in] raw_data_len : raw advertising data length , less than 31 bytes - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gap_config_adv_data_raw(uint8_t *raw_data, uint32_t raw_data_len); - -/** - * @brief This function is called to set raw scan response data. User need to fill - * scan response data by self. - * - * @param[in] raw_data : raw scan response data - * @param[in] raw_data_len : raw scan response data length , less than 31 bytes - * - * @return - * - ESP_OK : success - * - other : failed - */ -esp_err_t esp_ble_gap_config_scan_rsp_data_raw(uint8_t *raw_data, uint32_t raw_data_len); - -/** - * @brief This function is called to read the RSSI of remote device. - * The address of link policy results are returned in the gap callback function with - * ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT event. - * - * @param[in] remote_addr : The remote connection device address. - * - * @return - * - ESP_OK : success - * - other : failed - */ -esp_err_t esp_ble_gap_read_rssi(esp_bd_addr_t remote_addr); - -/** - * @brief This function is called to add a device info into the duplicate scan exceptional list. - * - * - * @param[in] type: device info type, it is defined in esp_ble_duplicate_exceptional_info_type_t - * when type is MESH_BEACON_TYPE, MESH_PROV_SRV_ADV or MESH_PROXY_SRV_ADV , device_info is invalid. - * @param[in] device_info: the device information. - * @return - * - ESP_OK : success - * - other : failed - */ -esp_err_t esp_ble_gap_add_duplicate_scan_exceptional_device(esp_ble_duplicate_exceptional_info_type_t type, esp_duplicate_info_t device_info); - -/** - * @brief This function is called to remove a device info from the duplicate scan exceptional list. - * - * - * @param[in] type: device info type, it is defined in esp_ble_duplicate_exceptional_info_type_t - * when type is MESH_BEACON_TYPE, MESH_PROV_SRV_ADV or MESH_PROXY_SRV_ADV , device_info is invalid. - * @param[in] device_info: the device information. - * @return - * - ESP_OK : success - * - other : failed - */ -esp_err_t esp_ble_gap_remove_duplicate_scan_exceptional_device(esp_ble_duplicate_exceptional_info_type_t type, esp_duplicate_info_t device_info); - -/** - * @brief This function is called to clean the duplicate scan exceptional list. - * This API will delete all device information in the duplicate scan exceptional list. - * - * - * @param[in] list_type: duplicate scan exceptional list type, the value can be one or more of esp_duplicate_scan_exceptional_list_type_t. - * - * @return - * - ESP_OK : success - * - other : failed - */ -esp_err_t esp_ble_gap_clean_duplicate_scan_exceptional_list(esp_duplicate_scan_exceptional_list_type_t list_type); - -#if (SMP_INCLUDED == TRUE) -/** -* @brief Set a GAP security parameter value. Overrides the default value. -* -* @param[in] param_type : the type of the param which to be set -* @param[in] value : the param value -* @param[in] len : the length of the param value -* -* @return - ESP_OK : success -* - other : failed -* -*/ -esp_err_t esp_ble_gap_set_security_param(esp_ble_sm_param_t param_type, - void *value, uint8_t len); - -/** -* @brief Grant security request access. -* -* @param[in] bd_addr : BD address of the peer -* @param[in] accept : accept the security request or not -* -* @return - ESP_OK : success -* - other : failed -* -*/ -esp_err_t esp_ble_gap_security_rsp(esp_bd_addr_t bd_addr, bool accept); - - -/** -* @brief Set a gap parameter value. Use this function to change -* the default GAP parameter values. -* -* @param[in] bd_addr : the address of the peer device need to encryption -* @param[in] sec_act : This is the security action to indicate -* what kind of BLE security level is required for -* the BLE link if the BLE is supported -* -* @return - ESP_OK : success -* - other : failed -* -*/ -esp_err_t esp_ble_set_encryption(esp_bd_addr_t bd_addr, esp_ble_sec_act_t sec_act); - -/** -* @brief Reply the key value to the peer device in the legacy connection stage. -* -* @param[in] bd_addr : BD address of the peer -* @param[in] accept : passkey entry successful or declined. -* @param[in] passkey : passkey value, must be a 6 digit number, -* can be lead by 0. -* -* @return - ESP_OK : success -* - other : failed -* -*/ -esp_err_t esp_ble_passkey_reply(esp_bd_addr_t bd_addr, bool accept, uint32_t passkey); - - -/** -* @brief Reply the confirm value to the peer device in the legacy connection stage. -* -* @param[in] bd_addr : BD address of the peer device -* @param[in] accept : numbers to compare are the same or different. -* -* @return - ESP_OK : success -* - other : failed -* -*/ -esp_err_t esp_ble_confirm_reply(esp_bd_addr_t bd_addr, bool accept); - -/** -* @brief Removes a device from the security database list of -* peer device. It manages unpairing event while connected. -* -* @param[in] bd_addr : BD address of the peer device -* -* @return - ESP_OK : success -* - other : failed -* -*/ -esp_err_t esp_ble_remove_bond_device(esp_bd_addr_t bd_addr); - -/** -* @brief Get the device number from the security database list of peer device. -* It will return the device bonded number immediately. -* -* @return - >= 0 : bonded devices number. -* - ESP_FAIL : failed -* -*/ -int esp_ble_get_bond_device_num(void); - - -/** -* @brief Get the device from the security database list of peer device. -* It will return the device bonded information immediately. -* @param[inout] dev_num: Indicate the dev_list array(buffer) size as input. -* If dev_num is large enough, it means the actual number as output. -* Suggest that dev_num value equal to esp_ble_get_bond_device_num(). -* -* @param[out] dev_list: an array(buffer) of `esp_ble_bond_dev_t` type. Use for storing the bonded devices address. -* The dev_list should be allocated by who call this API. -* @return - ESP_OK : success -* - other : failed -* -*/ -esp_err_t esp_ble_get_bond_device_list(int *dev_num, esp_ble_bond_dev_t *dev_list); - -#endif /* #if (SMP_INCLUDED == TRUE) */ - -/** -* @brief This function is to disconnect the physical connection of the peer device -* gattc may have multiple virtual GATT server connections when multiple app_id registered. -* esp_ble_gattc_close (esp_gatt_if_t gattc_if, uint16_t conn_id) only close one virtual GATT server connection. -* if there exist other virtual GATT server connections, it does not disconnect the physical connection. -* esp_ble_gap_disconnect(esp_bd_addr_t remote_device) disconnect the physical connection directly. -* -* -* -* @param[in] remote_device : BD address of the peer device -* -* @return - ESP_OK : success -* - other : failed -* -*/ -esp_err_t esp_ble_gap_disconnect(esp_bd_addr_t remote_device); - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_GAP_BLE_API_H__ */ diff --git a/tools/sdk/include/bt/esp_gap_bt_api.h b/tools/sdk/include/bt/esp_gap_bt_api.h deleted file mode 100644 index f5b2c8f15a2..00000000000 --- a/tools/sdk/include/bt/esp_gap_bt_api.h +++ /dev/null @@ -1,588 +0,0 @@ -// 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. - -#ifndef __ESP_GAP_BT_API_H__ -#define __ESP_GAP_BT_API_H__ - -#include -#include "esp_err.h" -#include "esp_bt_defs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/// RSSI threshold -#define ESP_BT_GAP_RSSI_HIGH_THRLD -20 /*!< High RSSI threshold */ -#define ESP_BT_GAP_RSSI_LOW_THRLD -45 /*!< Low RSSI threshold */ - -/// Class of device -typedef struct { - uint32_t reserved_2: 2; /*!< undefined */ - uint32_t minor: 6; /*!< minor class */ - uint32_t major: 5; /*!< major class */ - uint32_t service: 11; /*!< service class */ - uint32_t reserved_8: 8; /*!< undefined */ -} esp_bt_cod_t; - -/// class of device settings -typedef enum { - ESP_BT_SET_COD_MAJOR_MINOR = 0x01, /*!< overwrite major, minor class */ - ESP_BT_SET_COD_SERVICE_CLASS = 0x02, /*!< set the bits in the input, the current bit will remain */ - ESP_BT_CLR_COD_SERVICE_CLASS = 0x04, /*!< clear the bits in the input, others will remain */ - ESP_BT_SET_COD_ALL = 0x08, /*!< overwrite major, minor, set the bits in service class */ - ESP_BT_INIT_COD = 0x0a, /*!< overwrite major, minor, and service class */ -} esp_bt_cod_mode_t; - -/// Discoverability and Connectability mode -typedef enum { - ESP_BT_SCAN_MODE_NONE = 0, /*!< Neither discoverable nor connectable */ - ESP_BT_SCAN_MODE_CONNECTABLE, /*!< Connectable but not discoverable */ - ESP_BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE /*!< both discoverable and connectable */ -} esp_bt_scan_mode_t; - -/// Bluetooth Device Property type -typedef enum { - ESP_BT_GAP_DEV_PROP_BDNAME = 1, /*!< Bluetooth device name, value type is int8_t [] */ - ESP_BT_GAP_DEV_PROP_COD, /*!< Class of Device, value type is uint32_t */ - ESP_BT_GAP_DEV_PROP_RSSI, /*!< Received Signal strength Indication, value type is int8_t, ranging from -128 to 127 */ - ESP_BT_GAP_DEV_PROP_EIR, /*!< Extended Inquiry Response, value type is uint8_t [] */ -} esp_bt_gap_dev_prop_type_t; - -/// Maximum bytes of Bluetooth device name -#define ESP_BT_GAP_MAX_BDNAME_LEN (248) - -/// Maximum size of EIR Significant part -#define ESP_BT_GAP_EIR_DATA_LEN (240) - -/// Bluetooth Device Property Descriptor -typedef struct { - esp_bt_gap_dev_prop_type_t type; /*!< device property type */ - int len; /*!< device property value length */ - void *val; /*!< device property value */ -} esp_bt_gap_dev_prop_t; - -/// Extended Inquiry Response data type -typedef enum { - ESP_BT_EIR_TYPE_FLAGS = 0x01, /*!< Flag with information such as BR/EDR and LE support */ - ESP_BT_EIR_TYPE_INCMPL_16BITS_UUID = 0x02, /*!< Incomplete list of 16-bit service UUIDs */ - ESP_BT_EIR_TYPE_CMPL_16BITS_UUID = 0x03, /*!< Complete list of 16-bit service UUIDs */ - ESP_BT_EIR_TYPE_INCMPL_32BITS_UUID = 0x04, /*!< Incomplete list of 32-bit service UUIDs */ - ESP_BT_EIR_TYPE_CMPL_32BITS_UUID = 0x05, /*!< Complete list of 32-bit service UUIDs */ - ESP_BT_EIR_TYPE_INCMPL_128BITS_UUID = 0x06, /*!< Incomplete list of 128-bit service UUIDs */ - ESP_BT_EIR_TYPE_CMPL_128BITS_UUID = 0x07, /*!< Complete list of 128-bit service UUIDs */ - ESP_BT_EIR_TYPE_SHORT_LOCAL_NAME = 0x08, /*!< Shortened Local Name */ - ESP_BT_EIR_TYPE_CMPL_LOCAL_NAME = 0x09, /*!< Complete Local Name */ - ESP_BT_EIR_TYPE_TX_POWER_LEVEL = 0x0a, /*!< Tx power level, value is 1 octet ranging from -127 to 127, unit is dBm*/ - ESP_BT_EIR_TYPE_MANU_SPECIFIC = 0xff, /*!< Manufacturer specific data */ -} esp_bt_eir_type_t; - -/// Major service class field of Class of Device, mutiple bits can be set -typedef enum { - ESP_BT_COD_SRVC_NONE = 0, /*!< None indicates an invalid value */ - ESP_BT_COD_SRVC_LMTD_DISCOVER = 0x1, /*!< Limited Discoverable Mode */ - ESP_BT_COD_SRVC_POSITIONING = 0x8, /*!< Positioning (Location identification) */ - ESP_BT_COD_SRVC_NETWORKING = 0x10, /*!< Networking, e.g. LAN, Ad hoc */ - ESP_BT_COD_SRVC_RENDERING = 0x20, /*!< Rendering, e.g. Printing, Speakers */ - ESP_BT_COD_SRVC_CAPTURING = 0x40, /*!< Capturing, e.g. Scanner, Microphone */ - ESP_BT_COD_SRVC_OBJ_TRANSFER = 0x80, /*!< Object Transfer, e.g. v-Inbox, v-Folder */ - ESP_BT_COD_SRVC_AUDIO = 0x100, /*!< Audio, e.g. Speaker, Microphone, Headset service */ - ESP_BT_COD_SRVC_TELEPHONY = 0x200, /*!< Telephony, e.g. Cordless telephony, Modem, Headset service */ - ESP_BT_COD_SRVC_INFORMATION = 0x400, /*!< Information, e.g., WEB-server, WAP-server */ -} esp_bt_cod_srvc_t; - -typedef enum{ - ESP_BT_PIN_TYPE_VARIABLE = 0, /*!< Refer to BTM_PIN_TYPE_VARIABLE */ - ESP_BT_PIN_TYPE_FIXED = 1, /*!< Refer to BTM_PIN_TYPE_FIXED */ -} esp_bt_pin_type_t; - -#define ESP_BT_PIN_CODE_LEN 16 /*!< Max pin code length */ -typedef uint8_t esp_bt_pin_code_t[ESP_BT_PIN_CODE_LEN]; /*!< Pin Code (upto 128 bits) MSB is 0 */ - -typedef enum { - ESP_BT_SP_IOCAP_MODE = 0, /*!< Set IO mode */ - //ESP_BT_SP_OOB_DATA, //TODO /*!< Set OOB data */ -} esp_bt_sp_param_t; - -/* relate to BTM_IO_CAP_xxx in stack/btm_api.h */ -#define ESP_BT_IO_CAP_OUT 0 /*!< DisplayOnly */ /* relate to BTM_IO_CAP_OUT in stack/btm_api.h */ -#define ESP_BT_IO_CAP_IO 1 /*!< DisplayYesNo */ /* relate to BTM_IO_CAP_IO in stack/btm_api.h */ -#define ESP_BT_IO_CAP_IN 2 /*!< KeyboardOnly */ /* relate to BTM_IO_CAP_IN in stack/btm_api.h */ -#define ESP_BT_IO_CAP_NONE 3 /*!< NoInputNoOutput */ /* relate to BTM_IO_CAP_NONE in stack/btm_api.h */ -typedef uint8_t esp_bt_io_cap_t; /*!< combination of the io capability */ - -/// Bits of major service class field -#define ESP_BT_COD_SRVC_BIT_MASK (0xffe000) /*!< Major service bit mask */ -#define ESP_BT_COD_SRVC_BIT_OFFSET (13) /*!< Major service bit offset */ - -/// Major device class field of Class of Device -typedef enum { - ESP_BT_COD_MAJOR_DEV_MISC = 0, /*!< Miscellaneous */ - ESP_BT_COD_MAJOR_DEV_COMPUTER = 1, /*!< Computer */ - ESP_BT_COD_MAJOR_DEV_PHONE = 2, /*!< Phone(cellular, cordless, pay phone, modem */ - ESP_BT_COD_MAJOR_DEV_LAN_NAP = 3, /*!< LAN, Network Access Point */ - ESP_BT_COD_MAJOR_DEV_AV = 4, /*!< Audio/Video(headset, speaker, stereo, video display, VCR */ - ESP_BT_COD_MAJOR_DEV_PERIPHERAL = 5, /*!< Peripheral(mouse, joystick, keyboard) */ - ESP_BT_COD_MAJOR_DEV_IMAGING = 6, /*!< Imaging(printer, scanner, camera, display */ - ESP_BT_COD_MAJOR_DEV_WEARABLE = 7, /*!< Wearable */ - ESP_BT_COD_MAJOR_DEV_TOY = 8, /*!< Toy */ - ESP_BT_COD_MAJOR_DEV_HEALTH = 9, /*!< Health */ - ESP_BT_COD_MAJOR_DEV_UNCATEGORIZED = 31, /*!< Uncategorized: device not specified */ -} esp_bt_cod_major_dev_t; - -/// Bits of major device class field -#define ESP_BT_COD_MAJOR_DEV_BIT_MASK (0x1f00) /*!< Major device bit mask */ -#define ESP_BT_COD_MAJOR_DEV_BIT_OFFSET (8) /*!< Major device bit offset */ - -/// Bits of minor device class field -#define ESP_BT_COD_MINOR_DEV_BIT_MASK (0xfc) /*!< Minor device bit mask */ -#define ESP_BT_COD_MINOR_DEV_BIT_OFFSET (2) /*!< Minor device bit offset */ - -/// Bits of format type -#define ESP_BT_COD_FORMAT_TYPE_BIT_MASK (0x03) /*!< Format type bit mask */ -#define ESP_BT_COD_FORMAT_TYPE_BIT_OFFSET (0) /*!< Format type bit offset */ - -/// Class of device format type 1 -#define ESP_BT_COD_FORMAT_TYPE_1 (0x00) - -/** Bluetooth Device Discovery state */ -typedef enum { - ESP_BT_GAP_DISCOVERY_STOPPED, /*!< device discovery stopped */ - ESP_BT_GAP_DISCOVERY_STARTED, /*!< device discovery started */ -} esp_bt_gap_discovery_state_t; - -/// BT GAP callback events -typedef enum { - ESP_BT_GAP_DISC_RES_EVT = 0, /*!< device discovery result event */ - ESP_BT_GAP_DISC_STATE_CHANGED_EVT, /*!< discovery state changed event */ - ESP_BT_GAP_RMT_SRVCS_EVT, /*!< get remote services event */ - ESP_BT_GAP_RMT_SRVC_REC_EVT, /*!< get remote service record event */ - ESP_BT_GAP_AUTH_CMPL_EVT, /*!< AUTH complete event */ - ESP_BT_GAP_PIN_REQ_EVT, /*!< Legacy Pairing Pin code request */ - ESP_BT_GAP_CFM_REQ_EVT, /*!< Simple Pairing User Confirmation request. */ - ESP_BT_GAP_KEY_NOTIF_EVT, /*!< Simple Pairing Passkey Notification */ - ESP_BT_GAP_KEY_REQ_EVT, /*!< Simple Pairing Passkey request */ - ESP_BT_GAP_READ_RSSI_DELTA_EVT, /*!< read rssi event */ - ESP_BT_GAP_EVT_MAX, -} esp_bt_gap_cb_event_t; - -/** Inquiry Mode */ -typedef enum { - ESP_BT_INQ_MODE_GENERAL_INQUIRY, /*!< General inquiry mode */ - ESP_BT_INQ_MODE_LIMITED_INQUIRY, /*!< Limited inquiry mode */ -} esp_bt_inq_mode_t; - -/** Minimum and Maximum inquiry length*/ -#define ESP_BT_GAP_MIN_INQ_LEN (0x01) /*!< Minimum inquiry duration, unit is 1.28s */ -#define ESP_BT_GAP_MAX_INQ_LEN (0x30) /*!< Maximum inquiry duration, unit is 1.28s */ - -/// A2DP state callback parameters -typedef union { - /** - * @brief ESP_BT_GAP_DISC_RES_EVT - */ - struct disc_res_param { - esp_bd_addr_t bda; /*!< remote bluetooth device address*/ - int num_prop; /*!< number of properties got */ - esp_bt_gap_dev_prop_t *prop; /*!< properties discovered from the new device */ - } disc_res; /*!< discovery result parameter struct */ - - /** - * @brief ESP_BT_GAP_DISC_STATE_CHANGED_EVT - */ - struct disc_state_changed_param { - esp_bt_gap_discovery_state_t state; /*!< discovery state */ - } disc_st_chg; /*!< discovery state changed parameter struct */ - - /** - * @brief ESP_BT_GAP_RMT_SRVCS_EVT - */ - struct rmt_srvcs_param { - esp_bd_addr_t bda; /*!< remote bluetooth device address*/ - esp_bt_status_t stat; /*!< service search status */ - int num_uuids; /*!< number of UUID in uuid_list */ - esp_bt_uuid_t *uuid_list; /*!< list of service UUIDs of remote device */ - } rmt_srvcs; /*!< services of remote device parameter struct */ - - /** - * @brief ESP_BT_GAP_RMT_SRVC_REC_EVT - */ - struct rmt_srvc_rec_param { - esp_bd_addr_t bda; /*!< remote bluetooth device address*/ - esp_bt_status_t stat; /*!< service search status */ - } rmt_srvc_rec; /*!< specific service record from remote device parameter struct */ - - /** - * @brief ESP_BT_GAP_READ_RSSI_DELTA_EVT * - */ - struct read_rssi_delta_param { - esp_bd_addr_t bda; /*!< remote bluetooth device address*/ - esp_bt_status_t stat; /*!< read rssi status */ - int8_t rssi_delta; /*!< rssi delta value range -128 ~127, The value zero indicates that the RSSI is inside the Golden Receive Power Range, the Golden Receive Power Range is from ESP_BT_GAP_RSSI_LOW_THRLD to ESP_BT_GAP_RSSI_HIGH_THRLD */ - } read_rssi_delta; /*!< read rssi parameter struct */ - - /** - * @brief ESP_BT_GAP_AUTH_CMPL_EVT - */ - struct auth_cmpl_param { - esp_bd_addr_t bda; /*!< remote bluetooth device address*/ - esp_bt_status_t stat; /*!< authentication complete status */ - uint8_t device_name[ESP_BT_GAP_MAX_BDNAME_LEN + 1]; /*!< device name */ - } auth_cmpl; /*!< authentication complete parameter struct */ - - /** - * @brief ESP_BT_GAP_PIN_REQ_EVT - */ - struct pin_req_param { - esp_bd_addr_t bda; /*!< remote bluetooth device address*/ - bool min_16_digit; /*!< TRUE if the pin returned must be at least 16 digits */ - } pin_req; /*!< pin request parameter struct */ - - /** - * @brief ESP_BT_GAP_CFM_REQ_EVT - */ - struct cfm_req_param { - esp_bd_addr_t bda; /*!< remote bluetooth device address*/ - uint32_t num_val; /*!< the numeric value for comparison. */ - } cfm_req; /*!< confirm request parameter struct */ - - /** - * @brief ESP_BT_GAP_KEY_NOTIF_EVT - */ - struct key_notif_param { - esp_bd_addr_t bda; /*!< remote bluetooth device address*/ - uint32_t passkey; /*!< the numeric value for passkey entry. */ - } key_notif; /*!< passkey notif parameter struct */ - - /** - * @brief ESP_BT_GAP_KEY_REQ_EVT - */ - struct key_req_param { - esp_bd_addr_t bda; /*!< remote bluetooth device address*/ - } key_req; /*!< passkey request parameter struct */ -} esp_bt_gap_cb_param_t; - -/** - * @brief bluetooth GAP callback function type - * @param event : Event type - * @param param : Pointer to callback parameter - */ -typedef void (* esp_bt_gap_cb_t)(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *param); - -/** - * @brief get major service field of COD - * @param[in] cod: Class of Device - * @return major service bits - */ -inline uint32_t esp_bt_gap_get_cod_srvc(uint32_t cod) -{ - return (cod & ESP_BT_COD_SRVC_BIT_MASK) >> ESP_BT_COD_SRVC_BIT_OFFSET; -} - -/** - * @brief get major device field of COD - * @param[in] cod: Class of Device - * @return major device bits - */ -inline uint32_t esp_bt_gap_get_cod_major_dev(uint32_t cod) -{ - return (cod & ESP_BT_COD_MAJOR_DEV_BIT_MASK) >> ESP_BT_COD_MAJOR_DEV_BIT_OFFSET; -} - -/** - * @brief get minor service field of COD - * @param[in] cod: Class of Device - * @return minor service bits - */ -inline uint32_t esp_bt_gap_get_cod_minor_dev(uint32_t cod) -{ - return (cod & ESP_BT_COD_MINOR_DEV_BIT_MASK) >> ESP_BT_COD_MINOR_DEV_BIT_OFFSET; -} - -/** - * @brief get format type of COD - * @param[in] cod: Class of Device - * @return format type - */ -inline uint32_t esp_bt_gap_get_cod_format_type(uint32_t cod) -{ - return (cod & ESP_BT_COD_FORMAT_TYPE_BIT_MASK); -} - -/** - * @brief decide the integrity of COD - * @param[in] cod: Class of Device - * @return - * - true if cod is valid - * - false otherise - */ -inline bool esp_bt_gap_is_valid_cod(uint32_t cod) -{ - if (esp_bt_gap_get_cod_format_type(cod) == ESP_BT_COD_FORMAT_TYPE_1 && - esp_bt_gap_get_cod_srvc(cod) != ESP_BT_COD_SRVC_NONE) { - return true; - } - - return false; -} - -/** - * @brief register callback function. This function should be called after esp_bluedroid_enable() completes successfully - * - * @return - * - ESP_OK : Succeed - * - ESP_FAIL: others - */ -esp_err_t esp_bt_gap_register_callback(esp_bt_gap_cb_t callback); - -/** - * @brief Set discoverability and connectability mode for legacy bluetooth. This function should - * be called after esp_bluedroid_enable() completes successfully - * - * @param[in] mode : one of the enums of bt_scan_mode_t - * - * @return - * - ESP_OK : Succeed - * - ESP_ERR_INVALID_ARG: if argument invalid - * - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - */ -esp_err_t esp_bt_gap_set_scan_mode(esp_bt_scan_mode_t mode); - -/** - * @brief Start device discovery. This function should be called after esp_bluedroid_enable() completes successfully. - * esp_bt_gap_cb_t will is called with ESP_BT_GAP_DISC_STATE_CHANGED_EVT if discovery is started or halted. - * esp_bt_gap_cb_t will is called with ESP_BT_GAP_DISC_RES_EVT if discovery result is got. - * - * @param[in] mode - inquiry mode - * @param[in] inq_len - inquiry duration in 1.28 sec units, ranging from 0x01 to 0x30 - * @param[in] num_rsps - number of inquiry responses that can be received, value 0 indicates an unlimited number of responses - * - * @return - * - ESP_OK : Succeed - * - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_ERR_INVALID_ARG: if invalid parameters are provided - * - ESP_FAIL: others - */ -esp_err_t esp_bt_gap_start_discovery(esp_bt_inq_mode_t mode, uint8_t inq_len, uint8_t num_rsps); - -/** - * @brief Cancel device discovery. This function should be called after esp_bluedroid_enable() completes successfully - * esp_bt_gap_cb_t will is called with ESP_BT_GAP_DISC_STATE_CHANGED_EVT if discovery is stopped. - * - * @return - * - ESP_OK : Succeed - * - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - */ -esp_err_t esp_bt_gap_cancel_discovery(void); - -/** - * @brief Start SDP to get remote services. This function should be called after esp_bluedroid_enable() completes successfully. - * esp_bt_gap_cb_t will is called with ESP_BT_GAP_RMT_SRVCS_EVT after service discovery ends - * - * @return - * - ESP_OK : Succeed - * - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - */ -esp_err_t esp_bt_gap_get_remote_services(esp_bd_addr_t remote_bda); - -/** - * @brief Start SDP to look up the service matching uuid on the remote device. This function should be called after - * esp_bluedroid_enable() completes successfully - * - * esp_bt_gap_cb_t will is called with ESP_BT_GAP_RMT_SRVC_REC_EVT after service discovery ends - * @return - * - ESP_OK : Succeed - * - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - */ -esp_err_t esp_bt_gap_get_remote_service_record(esp_bd_addr_t remote_bda, esp_bt_uuid_t *uuid); - -/** - * @brief This function is called to get EIR data for a specific type. - * - * @param[in] eir - pointer of raw eir data to be resolved - * @param[in] type - specific EIR data type - * @param[out] length - return the length of EIR data excluding fields of length and data type - * - * @return pointer of starting position of eir data excluding eir data type, NULL if not found - * - */ -uint8_t *esp_bt_gap_resolve_eir_data(uint8_t *eir, esp_bt_eir_type_t type, uint8_t *length); - -/** - * @brief This function is called to set class of device. - * esp_bt_gap_cb_t will is called with ESP_BT_GAP_SET_COD_EVT after set COD ends - * Some profile have special restrictions on class of device, - * changes may cause these profile do not work - * - * @param[in] cod - class of device - * @param[in] mode - setting mode - * - * @return - * - ESP_OK : Succeed - * - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_ERR_INVALID_ARG: if param is invalid - * - ESP_FAIL: others - */ -esp_err_t esp_bt_gap_set_cod(esp_bt_cod_t cod, esp_bt_cod_mode_t mode); - -/** - * @brief This function is called to get class of device. - * - * @param[out] cod - class of device - * - * @return - * - ESP_OK : Succeed - * - ESP_FAIL: others - */ -esp_err_t esp_bt_gap_get_cod(esp_bt_cod_t *cod); - -/** - * @brief This function is called to read RSSI delta by address after connected. The RSSI value returned by ESP_BT_GAP_READ_RSSI_DELTA_EVT. - * - * - * @param[in] remote_addr - remote device address, corresponding to a certain connection handle. - * @return - * - ESP_OK : Succeed - * - ESP_FAIL: others - * - */ -esp_err_t esp_bt_gap_read_rssi_delta(esp_bd_addr_t remote_addr); - -/** -* @brief Removes a device from the security database list of -* peer device. -* -* @param[in] bd_addr : BD address of the peer device -* -* @return - ESP_OK : success -* - ESP_FAIL : failed -* -*/ -esp_err_t esp_bt_gap_remove_bond_device(esp_bd_addr_t bd_addr); - -/** -* @brief Get the device number from the security database list of peer device. -* It will return the device bonded number immediately. -* -* @return - >= 0 : bonded devices number. -* - ESP_FAIL : failed -* -*/ -int esp_bt_gap_get_bond_device_num(void); - -/** -* @brief Get the device from the security database list of peer device. -* It will return the device bonded information immediately. -* @param[inout] dev_num: Indicate the dev_list array(buffer) size as input. -* If dev_num is large enough, it means the actual number as output. -* Suggest that dev_num value equal to esp_ble_get_bond_device_num(). -* -* @param[out] dev_list: an array(buffer) of `esp_bd_addr_t` type. Use for storing the bonded devices address. -* The dev_list should be allocated by who call this API. -* -* @return -* - ESP_OK : Succeed -* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled -* - ESP_FAIL: others -*/ -esp_err_t esp_bt_gap_get_bond_device_list(int *dev_num, esp_bd_addr_t *dev_list); - -/** -* @brief Set pin type and default pin code for legacy pairing. -* -* @param[in] pin_type: Use variable or fixed pin. -* If pin_type is ESP_BT_PIN_TYPE_VARIABLE, pin_code and pin_code_len -* will be ignored, and ESP_BT_GAP_PIN_REQ_EVT will come when control -* requests for pin code. -* Else, will use fixed pin code and not callback to users. -* @param[in] pin_code_len: Length of pin_code -* @param[in] pin_code: Pin_code -* -* @return - ESP_OK : success -* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled -* - other : failed -*/ -esp_err_t esp_bt_gap_set_pin(esp_bt_pin_type_t pin_type, uint8_t pin_code_len, esp_bt_pin_code_t pin_code); - -/** -* @brief Reply the pin_code to the peer device for legacy pairing -* when ESP_BT_GAP_PIN_REQ_EVT is coming. -* -* @param[in] bd_addr: BD address of the peer -* @param[in] accept: Pin_code reply successful or declined. -* @param[in] pin_code_len: Length of pin_code -* @param[in] pin_code: Pin_code -* -* @return - ESP_OK : success -* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled -* - other : failed -*/ -esp_err_t esp_bt_gap_pin_reply(esp_bd_addr_t bd_addr, bool accept, uint8_t pin_code_len, esp_bt_pin_code_t pin_code); - -#if (BT_SSP_INCLUDED == TRUE) -/** -* @brief Set a GAP security parameter value. Overrides the default value. -* -* @param[in] param_type : the type of the param which is to be set -* @param[in] value : the param value -* @param[in] len : the length of the param value -* -* @return - ESP_OK : success -* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled -* - other : failed -* -*/ -esp_err_t esp_bt_gap_set_security_param(esp_bt_sp_param_t param_type, - void *value, uint8_t len); - -/** -* @brief Reply the key value to the peer device in the legacy connection stage. -* -* @param[in] bd_addr : BD address of the peer -* @param[in] accept : passkey entry successful or declined. -* @param[in] passkey : passkey value, must be a 6 digit number, -* can be lead by 0. -* -* @return - ESP_OK : success -* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled -* - other : failed -* -*/ -esp_err_t esp_bt_gap_ssp_passkey_reply(esp_bd_addr_t bd_addr, bool accept, uint32_t passkey); - - -/** -* @brief Reply the confirm value to the peer device in the legacy connection stage. -* -* @param[in] bd_addr : BD address of the peer device -* @param[in] accept : numbers to compare are the same or different. -* -* @return - ESP_OK : success -* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled -* - other : failed -* -*/ -esp_err_t esp_bt_gap_ssp_confirm_reply(esp_bd_addr_t bd_addr, bool accept); - -#endif /*(BT_SSP_INCLUDED == TRUE)*/ - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_GAP_BT_API_H__ */ diff --git a/tools/sdk/include/bt/esp_gatt_common_api.h b/tools/sdk/include/bt/esp_gatt_common_api.h deleted file mode 100644 index 3a9b7445815..00000000000 --- a/tools/sdk/include/bt/esp_gatt_common_api.h +++ /dev/null @@ -1,51 +0,0 @@ -// 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. - -#ifndef __ESP_GATT_COMMON_API_H__ -#define __ESP_GATT_COMMON_API_H__ - -#include -#include - -#include "esp_err.h" -#include "esp_bt_defs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -// Maximum Transmission Unit used in GATT -#define ESP_GATT_DEF_BLE_MTU_SIZE 23 /* relate to GATT_DEF_BLE_MTU_SIZE in stack/gatt_api.h */ - -// Maximum Transmission Unit allowed in GATT -#define ESP_GATT_MAX_MTU_SIZE 517 /* relate to GATT_MAX_MTU_SIZE in stack/gatt_api.h */ - -/** - * @brief This function is called to set local MTU, - * the function is called before BLE connection. - * - * @param[in] mtu: the size of MTU. - * - * @return - * - ESP_OK: success - * - other: failed - * - */ -extern esp_err_t esp_ble_gatt_set_local_mtu (uint16_t mtu); - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_GATT_COMMON_API_H__ */ diff --git a/tools/sdk/include/bt/esp_gatt_defs.h b/tools/sdk/include/bt/esp_gatt_defs.h deleted file mode 100644 index d6c140a1400..00000000000 --- a/tools/sdk/include/bt/esp_gatt_defs.h +++ /dev/null @@ -1,468 +0,0 @@ -// 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. - -#ifndef __ESP_GATT_DEFS_H__ -#define __ESP_GATT_DEFS_H__ - -#include "esp_bt_defs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/// GATT INVALID UUID -#define ESP_GATT_ILLEGAL_UUID 0 -/// GATT INVALID HANDLE -#define ESP_GATT_ILLEGAL_HANDLE 0 -/// GATT attribute max handle -#define ESP_GATT_ATTR_HANDLE_MAX 100 -#define ESP_GATT_MAX_READ_MULTI_HANDLES 10 /* Max attributes to read in one request */ - - -/**@{ - * All "ESP_GATT_UUID_xxx" is attribute types - */ -#define ESP_GATT_UUID_IMMEDIATE_ALERT_SVC 0x1802 /* Immediate alert Service*/ -#define ESP_GATT_UUID_LINK_LOSS_SVC 0x1803 /* Link Loss Service*/ -#define ESP_GATT_UUID_TX_POWER_SVC 0x1804 /* TX Power Service*/ -#define ESP_GATT_UUID_CURRENT_TIME_SVC 0x1805 /* Current Time Service Service*/ -#define ESP_GATT_UUID_REF_TIME_UPDATE_SVC 0x1806 /* Reference Time Update Service*/ -#define ESP_GATT_UUID_NEXT_DST_CHANGE_SVC 0x1807 /* Next DST Change Service*/ -#define ESP_GATT_UUID_GLUCOSE_SVC 0x1808 /* Glucose Service*/ -#define ESP_GATT_UUID_HEALTH_THERMOM_SVC 0x1809 /* Health Thermometer Service*/ -#define ESP_GATT_UUID_DEVICE_INFO_SVC 0x180A /* Device Information Service*/ -#define ESP_GATT_UUID_HEART_RATE_SVC 0x180D /* Heart Rate Service*/ -#define ESP_GATT_UUID_PHONE_ALERT_STATUS_SVC 0x180E /* Phone Alert Status Service*/ -#define ESP_GATT_UUID_BATTERY_SERVICE_SVC 0x180F /* Battery Service*/ -#define ESP_GATT_UUID_BLOOD_PRESSURE_SVC 0x1810 /* Blood Pressure Service*/ -#define ESP_GATT_UUID_ALERT_NTF_SVC 0x1811 /* Alert Notification Service*/ -#define ESP_GATT_UUID_HID_SVC 0x1812 /* HID Service*/ -#define ESP_GATT_UUID_SCAN_PARAMETERS_SVC 0x1813 /* Scan Parameters Service*/ -#define ESP_GATT_UUID_RUNNING_SPEED_CADENCE_SVC 0x1814 /* Running Speed and Cadence Service*/ -#define ESP_GATT_UUID_CYCLING_SPEED_CADENCE_SVC 0x1816 /* Cycling Speed and Cadence Service*/ -#define ESP_GATT_UUID_CYCLING_POWER_SVC 0x1818 /* Cycling Power Service*/ -#define ESP_GATT_UUID_LOCATION_AND_NAVIGATION_SVC 0x1819 /* Location and Navigation Service*/ -#define ESP_GATT_UUID_USER_DATA_SVC 0x181C /* User Data Service*/ -#define ESP_GATT_UUID_WEIGHT_SCALE_SVC 0x181D /* Weight Scale Service*/ - -#define ESP_GATT_UUID_PRI_SERVICE 0x2800 -#define ESP_GATT_UUID_SEC_SERVICE 0x2801 -#define ESP_GATT_UUID_INCLUDE_SERVICE 0x2802 -#define ESP_GATT_UUID_CHAR_DECLARE 0x2803 /* Characteristic Declaration*/ - -#define ESP_GATT_UUID_CHAR_EXT_PROP 0x2900 /* Characteristic Extended Properties */ -#define ESP_GATT_UUID_CHAR_DESCRIPTION 0x2901 /* Characteristic User Description*/ -#define ESP_GATT_UUID_CHAR_CLIENT_CONFIG 0x2902 /* Client Characteristic Configuration */ -#define ESP_GATT_UUID_CHAR_SRVR_CONFIG 0x2903 /* Server Characteristic Configuration */ -#define ESP_GATT_UUID_CHAR_PRESENT_FORMAT 0x2904 /* Characteristic Presentation Format*/ -#define ESP_GATT_UUID_CHAR_AGG_FORMAT 0x2905 /* Characteristic Aggregate Format*/ -#define ESP_GATT_UUID_CHAR_VALID_RANGE 0x2906 /* Characteristic Valid Range */ -#define ESP_GATT_UUID_EXT_RPT_REF_DESCR 0x2907 -#define ESP_GATT_UUID_RPT_REF_DESCR 0x2908 - -/* GAP Profile Attributes */ -#define ESP_GATT_UUID_GAP_DEVICE_NAME 0x2A00 -#define ESP_GATT_UUID_GAP_ICON 0x2A01 -#define ESP_GATT_UUID_GAP_PREF_CONN_PARAM 0x2A04 -#define ESP_GATT_UUID_GAP_CENTRAL_ADDR_RESOL 0x2AA6 - -/* Attribute Profile Attribute UUID */ -#define ESP_GATT_UUID_GATT_SRV_CHGD 0x2A05 - -/* Link ESP_Loss Service */ -#define ESP_GATT_UUID_ALERT_LEVEL 0x2A06 /* Alert Level */ -#define ESP_GATT_UUID_TX_POWER_LEVEL 0x2A07 /* TX power level */ - -/* Current Time Service */ -#define ESP_GATT_UUID_CURRENT_TIME 0x2A2B /* Current Time */ -#define ESP_GATT_UUID_LOCAL_TIME_INFO 0x2A0F /* Local time info */ -#define ESP_GATT_UUID_REF_TIME_INFO 0x2A14 /* reference time information */ - -/* Network availability Profile */ -#define ESP_GATT_UUID_NW_STATUS 0x2A18 /* network availability status */ -#define ESP_GATT_UUID_NW_TRIGGER 0x2A1A /* Network availability trigger */ - -/* Phone alert */ -#define ESP_GATT_UUID_ALERT_STATUS 0x2A3F /* alert status */ -#define ESP_GATT_UUID_RINGER_CP 0x2A40 /* ringer control point */ -#define ESP_GATT_UUID_RINGER_SETTING 0x2A41 /* ringer setting */ - -/* Glucose Service */ -#define ESP_GATT_UUID_GM_MEASUREMENT 0x2A18 -#define ESP_GATT_UUID_GM_CONTEXT 0x2A34 -#define ESP_GATT_UUID_GM_CONTROL_POINT 0x2A52 -#define ESP_GATT_UUID_GM_FEATURE 0x2A51 - -/* device information characteristic */ -#define ESP_GATT_UUID_SYSTEM_ID 0x2A23 -#define ESP_GATT_UUID_MODEL_NUMBER_STR 0x2A24 -#define ESP_GATT_UUID_SERIAL_NUMBER_STR 0x2A25 -#define ESP_GATT_UUID_FW_VERSION_STR 0x2A26 -#define ESP_GATT_UUID_HW_VERSION_STR 0x2A27 -#define ESP_GATT_UUID_SW_VERSION_STR 0x2A28 -#define ESP_GATT_UUID_MANU_NAME 0x2A29 -#define ESP_GATT_UUID_IEEE_DATA 0x2A2A -#define ESP_GATT_UUID_PNP_ID 0x2A50 - -/* HID characteristics */ -#define ESP_GATT_UUID_HID_INFORMATION 0x2A4A -#define ESP_GATT_UUID_HID_REPORT_MAP 0x2A4B -#define ESP_GATT_UUID_HID_CONTROL_POINT 0x2A4C -#define ESP_GATT_UUID_HID_REPORT 0x2A4D -#define ESP_GATT_UUID_HID_PROTO_MODE 0x2A4E -#define ESP_GATT_UUID_HID_BT_KB_INPUT 0x2A22 -#define ESP_GATT_UUID_HID_BT_KB_OUTPUT 0x2A32 -#define ESP_GATT_UUID_HID_BT_MOUSE_INPUT 0x2A33 - - /// Heart Rate Measurement -#define ESP_GATT_HEART_RATE_MEAS 0x2A37 -/// Body Sensor Location -#define ESP_GATT_BODY_SENSOR_LOCATION 0x2A38 -/// Heart Rate Control Point -#define ESP_GATT_HEART_RATE_CNTL_POINT 0x2A39 - -/* Battery Service characteristics */ -#define ESP_GATT_UUID_BATTERY_LEVEL 0x2A19 - -/* Sensor Service */ -#define ESP_GATT_UUID_SC_CONTROL_POINT 0x2A55 -#define ESP_GATT_UUID_SENSOR_LOCATION 0x2A5D - -/* Runners speed and cadence service */ -#define ESP_GATT_UUID_RSC_MEASUREMENT 0x2A53 -#define ESP_GATT_UUID_RSC_FEATURE 0x2A54 - -/* Cycling speed and cadence service */ -#define ESP_GATT_UUID_CSC_MEASUREMENT 0x2A5B -#define ESP_GATT_UUID_CSC_FEATURE 0x2A5C - -/* Scan ESP_Parameter characteristics */ -#define ESP_GATT_UUID_SCAN_INT_WINDOW 0x2A4F -#define ESP_GATT_UUID_SCAN_REFRESH 0x2A31 -/** - * @} - */ - -/* relate to BTA_GATT_PREP_WRITE_xxx in bta/bta_gatt_api.h */ -/// Attribute write data type from the client -typedef enum { - ESP_GATT_PREP_WRITE_CANCEL = 0x00, /*!< Prepare write cancel */ /* relate to BTA_GATT_PREP_WRITE_CANCEL in bta/bta_gatt_api.h */ - ESP_GATT_PREP_WRITE_EXEC = 0x01, /*!< Prepare write execute */ /* relate to BTA_GATT_PREP_WRITE_EXEC in bta/bta_gatt_api.h */ -} esp_gatt_prep_write_type; - -/* relate to BTA_GATT_xxx in bta/bta_gatt_api.h */ -/** - * @brief GATT success code and error codes - */ -typedef enum { - ESP_GATT_OK = 0x0, /* relate to BTA_GATT_OK in bta/bta_gatt_api.h */ - ESP_GATT_INVALID_HANDLE = 0x01, /* 0x0001 */ /* relate to BTA_GATT_INVALID_HANDLE in bta/bta_gatt_api.h */ - ESP_GATT_READ_NOT_PERMIT = 0x02, /* 0x0002 */ /* relate to BTA_GATT_READ_NOT_PERMIT in bta/bta_gatt_api.h */ - ESP_GATT_WRITE_NOT_PERMIT = 0x03, /* 0x0003 */ /* relate to BTA_GATT_WRITE_NOT_PERMIT in bta/bta_gatt_api.h */ - ESP_GATT_INVALID_PDU = 0x04, /* 0x0004 */ /* relate to BTA_GATT_INVALID_PDU in bta/bta_gatt_api.h */ - ESP_GATT_INSUF_AUTHENTICATION = 0x05, /* 0x0005 */ /* relate to BTA_GATT_INSUF_AUTHENTICATION in bta/bta_gatt_api.h */ - ESP_GATT_REQ_NOT_SUPPORTED = 0x06, /* 0x0006 */ /* relate to BTA_GATT_REQ_NOT_SUPPORTED in bta/bta_gatt_api.h */ - ESP_GATT_INVALID_OFFSET = 0x07, /* 0x0007 */ /* relate to BTA_GATT_INVALID_OFFSET in bta/bta_gatt_api.h */ - ESP_GATT_INSUF_AUTHORIZATION = 0x08, /* 0x0008 */ /* relate to BTA_GATT_INSUF_AUTHORIZATION in bta/bta_gatt_api.h */ - ESP_GATT_PREPARE_Q_FULL = 0x09, /* 0x0009 */ /* relate to BTA_GATT_PREPARE_Q_FULL in bta/bta_gatt_api.h */ - ESP_GATT_NOT_FOUND = 0x0a, /* 0x000a */ /* relate to BTA_GATT_NOT_FOUND in bta/bta_gatt_api.h */ - ESP_GATT_NOT_LONG = 0x0b, /* 0x000b */ /* relate to BTA_GATT_NOT_LONG in bta/bta_gatt_api.h */ - ESP_GATT_INSUF_KEY_SIZE = 0x0c, /* 0x000c */ /* relate to BTA_GATT_INSUF_KEY_SIZE in bta/bta_gatt_api.h */ - ESP_GATT_INVALID_ATTR_LEN = 0x0d, /* 0x000d */ /* relate to BTA_GATT_INVALID_ATTR_LEN in bta/bta_gatt_api.h */ - ESP_GATT_ERR_UNLIKELY = 0x0e, /* 0x000e */ /* relate to BTA_GATT_ERR_UNLIKELY in bta/bta_gatt_api.h */ - ESP_GATT_INSUF_ENCRYPTION = 0x0f, /* 0x000f */ /* relate to BTA_GATT_INSUF_ENCRYPTION in bta/bta_gatt_api.h */ - ESP_GATT_UNSUPPORT_GRP_TYPE = 0x10, /* 0x0010 */ /* relate to BTA_GATT_UNSUPPORT_GRP_TYPE in bta/bta_gatt_api.h */ - ESP_GATT_INSUF_RESOURCE = 0x11, /* 0x0011 */ /* relate to BTA_GATT_INSUF_RESOURCE in bta/bta_gatt_api.h */ - - ESP_GATT_NO_RESOURCES = 0x80, /* 0x80 */ /* relate to BTA_GATT_NO_RESOURCES in bta/bta_gatt_api.h */ - ESP_GATT_INTERNAL_ERROR = 0x81, /* 0x81 */ /* relate to BTA_GATT_INTERNAL_ERROR in bta/bta_gatt_api.h */ - ESP_GATT_WRONG_STATE = 0x82, /* 0x82 */ /* relate to BTA_GATT_WRONG_STATE in bta/bta_gatt_api.h */ - ESP_GATT_DB_FULL = 0x83, /* 0x83 */ /* relate to BTA_GATT_DB_FULL in bta/bta_gatt_api.h */ - ESP_GATT_BUSY = 0x84, /* 0x84 */ /* relate to BTA_GATT_BUSY in bta/bta_gatt_api.h */ - ESP_GATT_ERROR = 0x85, /* 0x85 */ /* relate to BTA_GATT_ERROR in bta/bta_gatt_api.h */ - ESP_GATT_CMD_STARTED = 0x86, /* 0x86 */ /* relate to BTA_GATT_CMD_STARTED in bta/bta_gatt_api.h */ - ESP_GATT_ILLEGAL_PARAMETER = 0x87, /* 0x87 */ /* relate to BTA_GATT_ILLEGAL_PARAMETER in bta/bta_gatt_api.h */ - ESP_GATT_PENDING = 0x88, /* 0x88 */ /* relate to BTA_GATT_PENDING in bta/bta_gatt_api.h */ - ESP_GATT_AUTH_FAIL = 0x89, /* 0x89 */ /* relate to BTA_GATT_AUTH_FAIL in bta/bta_gatt_api.h */ - ESP_GATT_MORE = 0x8a, /* 0x8a */ /* relate to BTA_GATT_MORE in bta/bta_gatt_api.h */ - ESP_GATT_INVALID_CFG = 0x8b, /* 0x8b */ /* relate to BTA_GATT_INVALID_CFG in bta/bta_gatt_api.h */ - ESP_GATT_SERVICE_STARTED = 0x8c, /* 0x8c */ /* relate to BTA_GATT_SERVICE_STARTED in bta/bta_gatt_api.h */ - ESP_GATT_ENCRYPED_MITM = ESP_GATT_OK, /* relate to BTA_GATT_ENCRYPED_MITM in bta/bta_gatt_api.h */ - ESP_GATT_ENCRYPED_NO_MITM = 0x8d, /* 0x8d */ /* relate to BTA_GATT_ENCRYPED_NO_MITM in bta/bta_gatt_api.h */ - ESP_GATT_NOT_ENCRYPTED = 0x8e, /* 0x8e */ /* relate to BTA_GATT_NOT_ENCRYPTED in bta/bta_gatt_api.h */ - ESP_GATT_CONGESTED = 0x8f, /* 0x8f */ /* relate to BTA_GATT_CONGESTED in bta/bta_gatt_api.h */ - ESP_GATT_DUP_REG = 0x90, /* 0x90 */ /* relate to BTA_GATT_DUP_REG in bta/bta_gatt_api.h */ - ESP_GATT_ALREADY_OPEN = 0x91, /* 0x91 */ /* relate to BTA_GATT_ALREADY_OPEN in bta/bta_gatt_api.h */ - ESP_GATT_CANCEL = 0x92, /* 0x92 */ /* relate to BTA_GATT_CANCEL in bta/bta_gatt_api.h */ - /* 0xE0 ~ 0xFC reserved for future use */ - ESP_GATT_STACK_RSP = 0xe0, /* 0xe0 */ /* relate to BTA_GATT_STACK_RSP in bta/bta_gatt_api.h */ - ESP_GATT_APP_RSP = 0xe1, /* 0xe1 */ /* relate to BTA_GATT_APP_RSP in bta/bta_gatt_api.h */ - //Error caused by customer application or stack bug - ESP_GATT_UNKNOWN_ERROR = 0xef, /* 0xef */ /* relate to BTA_GATT_UNKNOWN_ERROR in bta/bta_gatt_api.h */ - ESP_GATT_CCC_CFG_ERR = 0xfd, /* 0xFD Client Characteristic Configuration Descriptor Improperly Configured */ /* relate to BTA_GATT_CCC_CFG_ERR in bta/bta_gatt_api.h */ - ESP_GATT_PRC_IN_PROGRESS = 0xfe, /* 0xFE Procedure Already in progress */ /* relate to BTA_GATT_PRC_IN_PROGRESS in bta/bta_gatt_api.h */ - ESP_GATT_OUT_OF_RANGE = 0xff, /* 0xFFAttribute value out of range */ /* relate to BTA_GATT_OUT_OF_RANGE in bta/bta_gatt_api.h */ -} esp_gatt_status_t; - -/* relate to BTA_GATT_CONN_xxx in bta/bta_gatt_api.h */ -/** - * @brief Gatt Connection reason enum - */ -typedef enum { - ESP_GATT_CONN_UNKNOWN = 0, /*!< Gatt connection unknown */ /* relate to BTA_GATT_CONN_UNKNOWN in bta/bta_gatt_api.h */ - ESP_GATT_CONN_L2C_FAILURE = 1, /*!< General L2cap failure */ /* relate to BTA_GATT_CONN_L2C_FAILURE in bta/bta_gatt_api.h */ - ESP_GATT_CONN_TIMEOUT = 0x08, /*!< Connection timeout */ /* relate to BTA_GATT_CONN_TIMEOUT in bta/bta_gatt_api.h */ - ESP_GATT_CONN_TERMINATE_PEER_USER = 0x13, /*!< Connection terminate by peer user */ /* relate to BTA_GATT_CONN_TERMINATE_PEER_USER in bta/bta_gatt_api.h */ - ESP_GATT_CONN_TERMINATE_LOCAL_HOST = 0x16, /*!< Connection terminated by local host */ /* relate to BTA_GATT_CONN_TERMINATE_LOCAL_HOST in bta/bta_gatt_api.h */ - ESP_GATT_CONN_FAIL_ESTABLISH = 0x3e, /*!< Connection fail to establish */ /* relate to BTA_GATT_CONN_FAIL_ESTABLISH in bta/bta_gatt_api.h */ - ESP_GATT_CONN_LMP_TIMEOUT = 0x22, /*!< Connection fail for LMP response tout */ /* relate to BTA_GATT_CONN_LMP_TIMEOUT in bta/bta_gatt_api.h */ - ESP_GATT_CONN_CONN_CANCEL = 0x0100, /*!< L2CAP connection cancelled */ /* relate to BTA_GATT_CONN_CONN_CANCEL in bta/bta_gatt_api.h */ - ESP_GATT_CONN_NONE = 0x0101 /*!< No connection to cancel */ /* relate to BTA_GATT_CONN_NONE in bta/bta_gatt_api.h */ -} esp_gatt_conn_reason_t; - -/** - * @brief Gatt id, include uuid and instance id - */ -typedef struct { - esp_bt_uuid_t uuid; /*!< UUID */ - uint8_t inst_id; /*!< Instance id */ -} __attribute__((packed)) esp_gatt_id_t; - -/** - * @brief Gatt service id, include id - * (uuid and instance id) and primary flag - */ -typedef struct { - esp_gatt_id_t id; /*!< Gatt id, include uuid and instance */ - bool is_primary; /*!< This service is primary or not */ -} __attribute__((packed)) esp_gatt_srvc_id_t; - -/* relate to BTA_GATT_AUTH_REQ_xxx in bta/bta_gatt_api.h */ -/** - * @brief Gatt authentication request type - */ -typedef enum { - ESP_GATT_AUTH_REQ_NONE = 0, /* relate to BTA_GATT_AUTH_REQ_NONE in bta/bta_gatt_api.h */ - ESP_GATT_AUTH_REQ_NO_MITM = 1, /* unauthenticated encryption */ /* relate to BTA_GATT_AUTH_REQ_NO_MITM in bta/bta_gatt_api.h */ - ESP_GATT_AUTH_REQ_MITM = 2, /* authenticated encryption */ /* relate to BTA_GATT_AUTH_REQ_MITM in bta/bta_gatt_api.h */ - ESP_GATT_AUTH_REQ_SIGNED_NO_MITM = 3, /* relate to BTA_GATT_AUTH_REQ_SIGNED_NO_MITM in bta/bta_gatt_api.h */ - ESP_GATT_AUTH_REQ_SIGNED_MITM = 4, /* relate to BTA_GATT_AUTH_REQ_SIGNED_MITM in bta/bta_gatt_api.h */ -} esp_gatt_auth_req_t; - -/* relate to BTA_GATT_PERM_xxx in bta/bta_gatt_api.h */ -/** - * @brief Attribute permissions - */ -#define ESP_GATT_PERM_READ (1 << 0) /* bit 0 - 0x0001 */ /* relate to BTA_GATT_PERM_READ in bta/bta_gatt_api.h */ -#define ESP_GATT_PERM_READ_ENCRYPTED (1 << 1) /* bit 1 - 0x0002 */ /* relate to BTA_GATT_PERM_READ_ENCRYPTED in bta/bta_gatt_api.h */ -#define ESP_GATT_PERM_READ_ENC_MITM (1 << 2) /* bit 2 - 0x0004 */ /* relate to BTA_GATT_PERM_READ_ENC_MITM in bta/bta_gatt_api.h */ -#define ESP_GATT_PERM_WRITE (1 << 4) /* bit 4 - 0x0010 */ /* relate to BTA_GATT_PERM_WRITE in bta/bta_gatt_api.h */ -#define ESP_GATT_PERM_WRITE_ENCRYPTED (1 << 5) /* bit 5 - 0x0020 */ /* relate to BTA_GATT_PERM_WRITE_ENCRYPTED in bta/bta_gatt_api.h */ -#define ESP_GATT_PERM_WRITE_ENC_MITM (1 << 6) /* bit 6 - 0x0040 */ /* relate to BTA_GATT_PERM_WRITE_ENC_MITM in bta/bta_gatt_api.h */ -#define ESP_GATT_PERM_WRITE_SIGNED (1 << 7) /* bit 7 - 0x0080 */ /* relate to BTA_GATT_PERM_WRITE_SIGNED in bta/bta_gatt_api.h */ -#define ESP_GATT_PERM_WRITE_SIGNED_MITM (1 << 8) /* bit 8 - 0x0100 */ /* relate to BTA_GATT_PERM_WRITE_SIGNED_MITM in bta/bta_gatt_api.h */ -typedef uint16_t esp_gatt_perm_t; - -/* relate to BTA_GATT_CHAR_PROP_BIT_xxx in bta/bta_gatt_api.h */ -/* definition of characteristic properties */ -#define ESP_GATT_CHAR_PROP_BIT_BROADCAST (1 << 0) /* 0x01 */ /* relate to BTA_GATT_CHAR_PROP_BIT_BROADCAST in bta/bta_gatt_api.h */ -#define ESP_GATT_CHAR_PROP_BIT_READ (1 << 1) /* 0x02 */ /* relate to BTA_GATT_CHAR_PROP_BIT_READ in bta/bta_gatt_api.h */ -#define ESP_GATT_CHAR_PROP_BIT_WRITE_NR (1 << 2) /* 0x04 */ /* relate to BTA_GATT_CHAR_PROP_BIT_WRITE_NR in bta/bta_gatt_api.h */ -#define ESP_GATT_CHAR_PROP_BIT_WRITE (1 << 3) /* 0x08 */ /* relate to BTA_GATT_CHAR_PROP_BIT_WRITE in bta/bta_gatt_api.h */ -#define ESP_GATT_CHAR_PROP_BIT_NOTIFY (1 << 4) /* 0x10 */ /* relate to BTA_GATT_CHAR_PROP_BIT_NOTIFY in bta/bta_gatt_api.h */ -#define ESP_GATT_CHAR_PROP_BIT_INDICATE (1 << 5) /* 0x20 */ /* relate to BTA_GATT_CHAR_PROP_BIT_INDICATE in bta/bta_gatt_api.h */ -#define ESP_GATT_CHAR_PROP_BIT_AUTH (1 << 6) /* 0x40 */ /* relate to BTA_GATT_CHAR_PROP_BIT_AUTH in bta/bta_gatt_api.h */ -#define ESP_GATT_CHAR_PROP_BIT_EXT_PROP (1 << 7) /* 0x80 */ /* relate to BTA_GATT_CHAR_PROP_BIT_EXT_PROP in bta/bta_gatt_api.h */ -typedef uint8_t esp_gatt_char_prop_t; - -/// GATT maximum attribute length -#define ESP_GATT_MAX_ATTR_LEN 600 //as same as GATT_MAX_ATTR_LEN - -typedef enum { - ESP_GATT_SERVICE_FROM_REMOTE_DEVICE = 0, /* relate to BTA_GATTC_SERVICE_INFO_FROM_REMOTE_DEVICE in bta_gattc_int.h */ - ESP_GATT_SERVICE_FROM_NVS_FLASH = 1, /* relate to BTA_GATTC_SERVICE_INFO_FROM_NVS_FLASH in bta_gattc_int.h */ - ESP_GATT_SERVICE_FROM_UNKNOWN = 2, /* relate to BTA_GATTC_SERVICE_INFO_FROM_UNKNOWN in bta_gattc_int.h */ -} esp_service_source_t; - -/** - * @brief Attribute description (used to create database) - */ - typedef struct - { - uint16_t uuid_length; /*!< UUID length */ - uint8_t *uuid_p; /*!< UUID value */ - uint16_t perm; /*!< Attribute permission */ - uint16_t max_length; /*!< Maximum length of the element*/ - uint16_t length; /*!< Current length of the element*/ - uint8_t *value; /*!< Element value array*/ - } esp_attr_desc_t; - - -/** - * @brief attribute auto response flag - */ -typedef struct -{ -#define ESP_GATT_RSP_BY_APP 0 -#define ESP_GATT_AUTO_RSP 1 - /** - * @brief if auto_rsp set to ESP_GATT_RSP_BY_APP, means the response of Write/Read operation will by replied by application. - if auto_rsp set to ESP_GATT_AUTO_RSP, means the response of Write/Read operation will be replied by GATT stack automatically. - */ - uint8_t auto_rsp; -} esp_attr_control_t; - - -/** - * @brief attribute type added to the gatt server database - */ -typedef struct -{ - esp_attr_control_t attr_control; /*!< The attribute control type */ - esp_attr_desc_t att_desc; /*!< The attribute type */ -} esp_gatts_attr_db_t; - - -/** - * @brief set the attribute value type - */ -typedef struct -{ - uint16_t attr_max_len; /*!< attribute max value length */ - uint16_t attr_len; /*!< attribute current value length */ - uint8_t *attr_value; /*!< the pointer to attribute value */ -} esp_attr_value_t; - - -/** - * @brief Gatt include service entry element - */ -typedef struct -{ - uint16_t start_hdl; /*!< Gatt start handle value of included service */ - uint16_t end_hdl; /*!< Gatt end handle value of included service */ - uint16_t uuid; /*!< Gatt attribute value UUID of included service */ -} esp_gatts_incl_svc_desc_t; /*!< Gatt include service entry element */ - -/** - * @brief Gatt include 128 bit service entry element - */ -typedef struct -{ - uint16_t start_hdl; /*!< Gatt start handle value of included 128 bit service */ - uint16_t end_hdl; /*!< Gatt end handle value of included 128 bit service */ -} esp_gatts_incl128_svc_desc_t; /*!< Gatt include 128 bit service entry element */ - -/// Gatt attribute value -typedef struct { - uint8_t value[ESP_GATT_MAX_ATTR_LEN]; /*!< Gatt attribute value */ - uint16_t handle; /*!< Gatt attribute handle */ - uint16_t offset; /*!< Gatt attribute value offset */ - uint16_t len; /*!< Gatt attribute value length */ - uint8_t auth_req; /*!< Gatt authentication request */ -} esp_gatt_value_t; - -/// GATT remote read request response type -typedef union { - esp_gatt_value_t attr_value; /*!< Gatt attribute structure */ - uint16_t handle; /*!< Gatt attribute handle */ -} esp_gatt_rsp_t; - -/** - * @brief Gatt write type - */ -typedef enum { - ESP_GATT_WRITE_TYPE_NO_RSP = 1, /*!< Gatt write attribute need no response */ - ESP_GATT_WRITE_TYPE_RSP, /*!< Gatt write attribute need remote response */ -} esp_gatt_write_type_t; - -#define ESP_GATT_IF_NONE 0xff /*!< If callback report gattc_if/gatts_if as this macro, means this event is not correspond to any app */ - -typedef uint8_t esp_gatt_if_t; /*!< Gatt interface type, different application on GATT client use different gatt_if */ - -/** - * @brief the type of attribute element - */ -typedef enum { - ESP_GATT_DB_PRIMARY_SERVICE, /*!< Gattc primary service attribute type in the cache */ - ESP_GATT_DB_SECONDARY_SERVICE, /*!< Gattc secondary service attribute type in the cache */ - ESP_GATT_DB_CHARACTERISTIC, /*!< Gattc characteristic attribute type in the cache */ - ESP_GATT_DB_DESCRIPTOR, /*!< Gattc characteristic descriptor attribute type in the cache */ - ESP_GATT_DB_INCLUDED_SERVICE, /*!< Gattc include service attribute type in the cache */ - ESP_GATT_DB_ALL, /*!< Gattc all the attribute (primary service & secondary service & include service & char & descriptor) type in the cache */ -} esp_gatt_db_attr_type_t; /*!< Gattc attribute type element */ - -/** - * @brief read multiple attribute - */ -typedef struct { - uint8_t num_attr; /*!< The number of the attribute */ - uint16_t handles[ESP_GATT_MAX_READ_MULTI_HANDLES]; /*!< The handles list */ -} esp_gattc_multi_t; /*!< The gattc multiple read element */ - -/** - * @brief data base attribute element - */ -typedef struct { - esp_gatt_db_attr_type_t type; /*!< The attribute type */ - uint16_t attribute_handle; /*!< The attribute handle, it's valid for all of the type */ - uint16_t start_handle; /*!< The service start handle, it's valid only when the type = ESP_GATT_DB_PRIMARY_SERVICE or ESP_GATT_DB_SECONDARY_SERVICE */ - uint16_t end_handle; /*!< The service end handle, it's valid only when the type = ESP_GATT_DB_PRIMARY_SERVICE or ESP_GATT_DB_SECONDARY_SERVICE */ - esp_gatt_char_prop_t properties; /*!< The characteristic properties, it's valid only when the type = ESP_GATT_DB_CHARACTERISTIC */ - esp_bt_uuid_t uuid; /*!< The attribute uuid, it's valid for all of the type */ -} esp_gattc_db_elem_t; /*!< The gattc service data base element in the cache */ - -/** - * @brief service element - */ -typedef struct { - bool is_primary; /*!< The service flag, true if the service is primary service, else is secondly service */ - uint16_t start_handle; /*!< The start handle of the service */ - uint16_t end_handle; /*!< The end handle of the service */ - esp_bt_uuid_t uuid; /*!< The uuid of the service */ -} esp_gattc_service_elem_t; /*!< The gattc service element */ - -/** - * @brief characteristic element - */ -typedef struct { - uint16_t char_handle; /*!< The characteristic handle */ - esp_gatt_char_prop_t properties; /*!< The characteristic properties */ - esp_bt_uuid_t uuid; /*!< The characteristic uuid */ -} esp_gattc_char_elem_t; /*!< The gattc characteristic element */ - -/** - * @brief descriptor element - */ -typedef struct { - uint16_t handle; /*!< The characteristic descriptor handle */ - esp_bt_uuid_t uuid; /*!< The characteristic descriptor uuid */ -} esp_gattc_descr_elem_t; /*!< The gattc descriptor type element */ - -/** - * @brief include service element - */ -typedef struct { - uint16_t handle; /*!< The include service current attribute handle */ - uint16_t incl_srvc_s_handle; /*!< The start handle of the service which has been included */ - uint16_t incl_srvc_e_handle; /*!< The end handle of the service which has been included */ - esp_bt_uuid_t uuid; /*!< The include service uuid */ -} esp_gattc_incl_svc_elem_t; /*!< The gattc include service element */ - - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_GATT_DEFS_H__ */ diff --git a/tools/sdk/include/bt/esp_gattc_api.h b/tools/sdk/include/bt/esp_gattc_api.h deleted file mode 100644 index b494bcfd398..00000000000 --- a/tools/sdk/include/bt/esp_gattc_api.h +++ /dev/null @@ -1,845 +0,0 @@ -// 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. - -#ifndef __ESP_GATTC_API_H__ -#define __ESP_GATTC_API_H__ - -#include "esp_bt_defs.h" -#include "esp_gatt_defs.h" -#include "esp_err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/// GATT Client callback function events -typedef enum { - ESP_GATTC_REG_EVT = 0, /*!< When GATT client is registered, the event comes */ - ESP_GATTC_UNREG_EVT = 1, /*!< When GATT client is unregistered, the event comes */ - ESP_GATTC_OPEN_EVT = 2, /*!< When GATT virtual connection is set up, the event comes */ - ESP_GATTC_READ_CHAR_EVT = 3, /*!< When GATT characteristic is read, the event comes */ - ESP_GATTC_WRITE_CHAR_EVT = 4, /*!< When GATT characteristic write operation completes, the event comes */ - ESP_GATTC_CLOSE_EVT = 5, /*!< When GATT virtual connection is closed, the event comes */ - ESP_GATTC_SEARCH_CMPL_EVT = 6, /*!< When GATT service discovery is completed, the event comes */ - ESP_GATTC_SEARCH_RES_EVT = 7, /*!< When GATT service discovery result is got, the event comes */ - ESP_GATTC_READ_DESCR_EVT = 8, /*!< When GATT characteristic descriptor read completes, the event comes */ - ESP_GATTC_WRITE_DESCR_EVT = 9, /*!< When GATT characteristic descriptor write completes, the event comes */ - ESP_GATTC_NOTIFY_EVT = 10, /*!< When GATT notification or indication arrives, the event comes */ - ESP_GATTC_PREP_WRITE_EVT = 11, /*!< When GATT prepare-write operation completes, the event comes */ - ESP_GATTC_EXEC_EVT = 12, /*!< When write execution completes, the event comes */ - ESP_GATTC_ACL_EVT = 13, /*!< When ACL connection is up, the event comes */ - ESP_GATTC_CANCEL_OPEN_EVT = 14, /*!< When GATT client ongoing connection is cancelled, the event comes */ - ESP_GATTC_SRVC_CHG_EVT = 15, /*!< When "service changed" occurs, the event comes */ - ESP_GATTC_ENC_CMPL_CB_EVT = 17, /*!< When encryption procedure completes, the event comes */ - ESP_GATTC_CFG_MTU_EVT = 18, /*!< When configuration of MTU completes, the event comes */ - ESP_GATTC_ADV_DATA_EVT = 19, /*!< When advertising of data, the event comes */ - ESP_GATTC_MULT_ADV_ENB_EVT = 20, /*!< When multi-advertising is enabled, the event comes */ - ESP_GATTC_MULT_ADV_UPD_EVT = 21, /*!< When multi-advertising parameters are updated, the event comes */ - ESP_GATTC_MULT_ADV_DATA_EVT = 22, /*!< When multi-advertising data arrives, the event comes */ - ESP_GATTC_MULT_ADV_DIS_EVT = 23, /*!< When multi-advertising is disabled, the event comes */ - ESP_GATTC_CONGEST_EVT = 24, /*!< When GATT connection congestion comes, the event comes */ - ESP_GATTC_BTH_SCAN_ENB_EVT = 25, /*!< When batch scan is enabled, the event comes */ - ESP_GATTC_BTH_SCAN_CFG_EVT = 26, /*!< When batch scan storage is configured, the event comes */ - ESP_GATTC_BTH_SCAN_RD_EVT = 27, /*!< When Batch scan read event is reported, the event comes */ - ESP_GATTC_BTH_SCAN_THR_EVT = 28, /*!< When Batch scan threshold is set, the event comes */ - ESP_GATTC_BTH_SCAN_PARAM_EVT = 29, /*!< When Batch scan parameters are set, the event comes */ - ESP_GATTC_BTH_SCAN_DIS_EVT = 30, /*!< When Batch scan is disabled, the event comes */ - ESP_GATTC_SCAN_FLT_CFG_EVT = 31, /*!< When Scan filter configuration completes, the event comes */ - ESP_GATTC_SCAN_FLT_PARAM_EVT = 32, /*!< When Scan filter parameters are set, the event comes */ - ESP_GATTC_SCAN_FLT_STATUS_EVT = 33, /*!< When Scan filter status is reported, the event comes */ - ESP_GATTC_ADV_VSC_EVT = 34, /*!< When advertising vendor spec content event is reported, the event comes */ - ESP_GATTC_REG_FOR_NOTIFY_EVT = 38, /*!< When register for notification of a service completes, the event comes */ - ESP_GATTC_UNREG_FOR_NOTIFY_EVT = 39, /*!< When unregister for notification of a service completes, the event comes */ - ESP_GATTC_CONNECT_EVT = 40, /*!< When the ble physical connection is set up, the event comes */ - ESP_GATTC_DISCONNECT_EVT = 41, /*!< When the ble physical connection disconnected, the event comes */ - ESP_GATTC_READ_MULTIPLE_EVT = 42, /*!< When the ble characteristic or descriptor multiple complete, the event comes */ - ESP_GATTC_QUEUE_FULL_EVT = 43, /*!< When the gattc command queue full, the event comes */ - ESP_GATTC_SET_ASSOC_EVT = 44, /*!< When the ble gattc set the associated address complete, the event comes */ - ESP_GATTC_GET_ADDR_LIST_EVT = 45, /*!< When the ble get gattc address list in cache finish, the event comes */ -} esp_gattc_cb_event_t; - - -/** - * @brief Gatt client callback parameters union - */ -typedef union { - /** - * @brief ESP_GATTC_REG_EVT - */ - struct gattc_reg_evt_param { - esp_gatt_status_t status; /*!< Operation status */ - uint16_t app_id; /*!< Application id which input in register API */ - } reg; /*!< Gatt client callback param of ESP_GATTC_REG_EVT */ - - /** - * @brief ESP_GATTC_OPEN_EVT - */ - struct gattc_open_evt_param { - esp_gatt_status_t status; /*!< Operation status */ - uint16_t conn_id; /*!< Connection id */ - esp_bd_addr_t remote_bda; /*!< Remote bluetooth device address */ - uint16_t mtu; /*!< MTU size */ - } open; /*!< Gatt client callback param of ESP_GATTC_OPEN_EVT */ - - /** - * @brief ESP_GATTC_CLOSE_EVT - */ - struct gattc_close_evt_param { - esp_gatt_status_t status; /*!< Operation status */ - uint16_t conn_id; /*!< Connection id */ - esp_bd_addr_t remote_bda; /*!< Remote bluetooth device address */ - esp_gatt_conn_reason_t reason; /*!< The reason of gatt connection close */ - } close; /*!< Gatt client callback param of ESP_GATTC_CLOSE_EVT */ - - /** - * @brief ESP_GATTC_CFG_MTU_EVT - */ - struct gattc_cfg_mtu_evt_param { - esp_gatt_status_t status; /*!< Operation status */ - uint16_t conn_id; /*!< Connection id */ - uint16_t mtu; /*!< MTU size */ - } cfg_mtu; /*!< Gatt client callback param of ESP_GATTC_CFG_MTU_EVT */ - - /** - * @brief ESP_GATTC_SEARCH_CMPL_EVT - */ - struct gattc_search_cmpl_evt_param { - esp_gatt_status_t status; /*!< Operation status */ - uint16_t conn_id; /*!< Connection id */ - esp_service_source_t searched_service_source; /*!< The source of the service information */ - } search_cmpl; /*!< Gatt client callback param of ESP_GATTC_SEARCH_CMPL_EVT */ - - /** - * @brief ESP_GATTC_SEARCH_RES_EVT - */ - struct gattc_search_res_evt_param { - uint16_t conn_id; /*!< Connection id */ - uint16_t start_handle; /*!< Service start handle */ - uint16_t end_handle; /*!< Service end handle */ - esp_gatt_id_t srvc_id; /*!< Service id, include service uuid and other information */ - bool is_primary; /*!< True if this is the primary service */ - } search_res; /*!< Gatt client callback param of ESP_GATTC_SEARCH_RES_EVT */ - - /** - * @brief ESP_GATTC_READ_CHAR_EVT, ESP_GATTC_READ_DESCR_EVT - */ - struct gattc_read_char_evt_param { - - esp_gatt_status_t status; /*!< Operation status */ - uint16_t conn_id; /*!< Connection id */ - uint16_t handle; /*!< Characteristic handle */ - uint8_t *value; /*!< Characteristic value */ - uint16_t value_len; /*!< Characteristic value length */ - } read; /*!< Gatt client callback param of ESP_GATTC_READ_CHAR_EVT */ - - /** - * @brief ESP_GATTC_WRITE_CHAR_EVT, ESP_GATTC_PREP_WRITE_EVT, ESP_GATTC_WRITE_DESCR_EVT - */ - struct gattc_write_evt_param { - esp_gatt_status_t status; /*!< Operation status */ - uint16_t conn_id; /*!< Connection id */ - uint16_t handle; /*!< The Characteristic or descriptor handle */ - uint16_t offset; /*!< The prepare write offset, this value is valid only when prepare write */ - } write; /*!< Gatt client callback param of ESP_GATTC_WRITE_DESCR_EVT */ - - /** - * @brief ESP_GATTC_EXEC_EVT - */ - struct gattc_exec_cmpl_evt_param { - esp_gatt_status_t status; /*!< Operation status */ - uint16_t conn_id; /*!< Connection id */ - } exec_cmpl; /*!< Gatt client callback param of ESP_GATTC_EXEC_EVT */ - - /** - * @brief ESP_GATTC_NOTIFY_EVT - */ - struct gattc_notify_evt_param { - uint16_t conn_id; /*!< Connection id */ - esp_bd_addr_t remote_bda; /*!< Remote bluetooth device address */ - uint16_t handle; /*!< The Characteristic or descriptor handle */ - uint16_t value_len; /*!< Notify attribute value */ - uint8_t *value; /*!< Notify attribute value */ - bool is_notify; /*!< True means notify, false means indicate */ - } notify; /*!< Gatt client callback param of ESP_GATTC_NOTIFY_EVT */ - - /** - * @brief ESP_GATTC_SRVC_CHG_EVT - */ - struct gattc_srvc_chg_evt_param { - esp_bd_addr_t remote_bda; /*!< Remote bluetooth device address */ - } srvc_chg; /*!< Gatt client callback param of ESP_GATTC_SRVC_CHG_EVT */ - - /** - * @brief ESP_GATTC_CONGEST_EVT - */ - struct gattc_congest_evt_param { - uint16_t conn_id; /*!< Connection id */ - bool congested; /*!< Congested or not */ - } congest; /*!< Gatt client callback param of ESP_GATTC_CONGEST_EVT */ - /** - * @brief ESP_GATTC_REG_FOR_NOTIFY_EVT - */ - struct gattc_reg_for_notify_evt_param { - esp_gatt_status_t status; /*!< Operation status */ - uint16_t handle; /*!< The characteristic or descriptor handle */ - } reg_for_notify; /*!< Gatt client callback param of ESP_GATTC_REG_FOR_NOTIFY_EVT */ - - /** - * @brief ESP_GATTC_UNREG_FOR_NOTIFY_EVT - */ - struct gattc_unreg_for_notify_evt_param { - esp_gatt_status_t status; /*!< Operation status */ - uint16_t handle; /*!< The characteristic or descriptor handle */ - } unreg_for_notify; /*!< Gatt client callback param of ESP_GATTC_UNREG_FOR_NOTIFY_EVT */ - - /** - * @brief ESP_GATTC_CONNECT_EVT - */ - struct gattc_connect_evt_param { - uint16_t conn_id; /*!< Connection id */ - esp_bd_addr_t remote_bda; /*!< Remote bluetooth device address */ - } connect; /*!< Gatt client callback param of ESP_GATTC_CONNECT_EVT */ - - /** - * @brief ESP_GATTC_DISCONNECT_EVT - */ - struct gattc_disconnect_evt_param { - esp_gatt_conn_reason_t reason; /*!< disconnection reason */ - uint16_t conn_id; /*!< Connection id */ - esp_bd_addr_t remote_bda; /*!< Remote bluetooth device address */ - } disconnect; /*!< Gatt client callback param of ESP_GATTC_DISCONNECT_EVT */ - /** - * @brief ESP_GATTC_SET_ASSOC_EVT - */ - struct gattc_set_assoc_addr_cmp_evt_param { - esp_gatt_status_t status; /*!< Operation status */ - } set_assoc_cmp; /*!< Gatt client callback param of ESP_GATTC_SET_ASSOC_EVT */ - /** - * @brief ESP_GATTC_GET_ADDR_LIST_EVT - */ - struct gattc_get_addr_list_evt_param { - esp_gatt_status_t status; /*!< Operation status */ - uint8_t num_addr; /*!< The number of address in the gattc cache address list */ - esp_bd_addr_t *addr_list; /*!< The pointer to the address list which has been get from the gattc cache */ - } get_addr_list; /*!< Gatt client callback param of ESP_GATTC_GET_ADDR_LIST_EVT */ - - /** - * @brief ESP_GATTC_QUEUE_FULL_EVT - */ - struct gattc_queue_full_evt_param { - esp_gatt_status_t status; /*!< Operation status */ - uint16_t conn_id; /*!< Connection id */ - bool is_full; /*!< The gattc command queue is full or not */ - } queue_full; /*!< Gatt client callback param of ESP_GATTC_QUEUE_FULL_EVT */ - -} esp_ble_gattc_cb_param_t; /*!< GATT client callback parameter union type */ - -/** - * @brief GATT Client callback function type - * @param event : Event type - * @param gatts_if : GATT client access interface, normally - * different gattc_if correspond to different profile - * @param param : Point to callback parameter, currently is union type - */ -typedef void (* esp_gattc_cb_t)(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param); - -/** - * @brief This function is called to register application callbacks - * with GATTC module. - * - * @param[in] callback : pointer to the application callback function. - * - * @return - * - ESP_OK: success - * - other: failed - * - */ -esp_err_t esp_ble_gattc_register_callback(esp_gattc_cb_t callback); - - -/** - * @brief This function is called to register application callbacks - * with GATTC module. - * - * @param[in] app_id : Application Identify (UUID), for different application - * - * @return - * - ESP_OK: success - * - other: failed - * - */ -esp_err_t esp_ble_gattc_app_register(uint16_t app_id); - - -/** - * @brief This function is called to unregister an application - * from GATTC module. - * - * @param[in] gattc_if: Gatt client access interface. - * - * @return - * - ESP_OK: success - * - other: failed - * - */ -esp_err_t esp_ble_gattc_app_unregister(esp_gatt_if_t gattc_if); - - -/** - * @brief Open a direct connection or add a background auto connection - * - * @param[in] gattc_if: Gatt client access interface. - * @param[in] remote_bda: remote device bluetooth device address. - * @param[in] remote_addr_type: remote device bluetooth device the address type. - * @param[in] is_direct: direct connection or background auto connection - * - * @return - * - ESP_OK: success - * - other: failed - * - */ -esp_err_t esp_ble_gattc_open(esp_gatt_if_t gattc_if, esp_bd_addr_t remote_bda, esp_ble_addr_type_t remote_addr_type, bool is_direct); - - -/** - * @brief Close the virtual connection to the GATT server. gattc may have multiple virtual GATT server connections when multiple app_id registered, - * this API only close one virtual GATT server connection. if there exist other virtual GATT server connections, - * it does not disconnect the physical connection. - * if you want to disconnect the physical connection directly, you can use esp_ble_gap_disconnect(esp_bd_addr_t remote_device). - * - * @param[in] gattc_if: Gatt client access interface. - * @param[in] conn_id: connection ID to be closed. - * - * @return - * - ESP_OK: success - * - other: failed - * - */ -esp_err_t esp_ble_gattc_close (esp_gatt_if_t gattc_if, uint16_t conn_id); - - -/** - * @brief Configure the MTU size in the GATT channel. This can be done - * only once per connection. Before using, use esp_ble_gatt_set_local_mtu() - * to configure the local MTU size. - * - * - * @param[in] gattc_if: Gatt client access interface. - * @param[in] conn_id: connection ID. - * - * @return - * - ESP_OK: success - * - other: failed - * - */ -esp_err_t esp_ble_gattc_send_mtu_req (esp_gatt_if_t gattc_if, uint16_t conn_id); - - -/** - * @brief This function is called to get service from local cache. - * If it does not exist, request a GATT service discovery - * on a GATT server. This function report service search result - * by a callback event, and followed by a service search complete - * event. - * - * @param[in] gattc_if: Gatt client access interface. - * @param[in] conn_id: connection ID. - * @param[in] filter_uuid: a UUID of the service application is interested in. - * If Null, discover for all services. - * - * @return - * - ESP_OK: success - * - other: failed - * - */ -esp_err_t esp_ble_gattc_search_service(esp_gatt_if_t gattc_if, uint16_t conn_id, esp_bt_uuid_t *filter_uuid); - -/** - * @brief Find all the service with the given service uuid in the gattc cache, if the svc_uuid is NULL, find all the service. - * Note: It just get service from local cache, won't get from remote devices. If want to get it from remote device, need - * to used the esp_ble_gattc_search_service. - * - * @param[in] gattc_if: Gatt client access interface. - * @param[in] conn_id: connection ID which identify the server. - * @param[in] svc_uuid: the pointer to the service uuid. - * @param[out] result: The pointer to the service which has been found in the gattc cache. - * @param[inout] count: input the number of service want to find, - * it will output the number of service has been found in the gattc cache with the given service uuid. - * @param[in] offset: Offset of the service position to get. - * - * @return - * - ESP_OK: success - * - other: failed - * - */ -esp_gatt_status_t esp_ble_gattc_get_service(esp_gatt_if_t gattc_if, uint16_t conn_id, esp_bt_uuid_t *svc_uuid, - esp_gattc_service_elem_t *result, uint16_t *count, uint16_t offset); - -/** - * @brief Find all the characteristic with the given service in the gattc cache - * Note: It just get characteristic from local cache, won't get from remote devices. - * - * @param[in] gattc_if: Gatt client access interface. - * @param[in] conn_id: connection ID which identify the server. - * @param[in] start_handle: the attribute start handle. - * @param[in] end_handle: the attribute end handle - * @param[out] result: The pointer to the characteristic in the service. - * @param[inout] count: input the number of characteristic want to find, - * it will output the number of characteristic has been found in the gattc cache with the given service. - * @param[in] offset: Offset of the characteristic position to get. - * - * @return - * - ESP_OK: success - * - other: failed - * - */ -esp_gatt_status_t esp_ble_gattc_get_all_char(esp_gatt_if_t gattc_if, - uint16_t conn_id, - uint16_t start_handle, - uint16_t end_handle, - esp_gattc_char_elem_t *result, - uint16_t *count, uint16_t offset); - -/** - * @brief Find all the descriptor with the given characteristic in the gattc cache - * Note: It just get descriptor from local cache, won't get from remote devices. - * - * @param[in] gattc_if: Gatt client access interface. - * @param[in] conn_id: connection ID which identify the server. - * @param[in] char_handle: the given characteristic handle - * @param[out] result: The pointer to the descriptor in the characteristic. - * @param[inout] count: input the number of descriptor want to find, - * it will output the number of descriptor has been found in the gattc cache with the given characteristic. - * @param[in] offset: Offset of the descriptor position to get. - * - * @return - * - ESP_OK: success - * - other: failed - * - */ -esp_gatt_status_t esp_ble_gattc_get_all_descr(esp_gatt_if_t gattc_if, - uint16_t conn_id, - uint16_t char_handle, - esp_gattc_descr_elem_t *result, - uint16_t *count, uint16_t offset); - - -/** - * @brief Find the characteristic with the given characteristic uuid in the gattc cache - * Note: It just get characteristic from local cache, won't get from remote devices. - * - * @param[in] gattc_if: Gatt client access interface. - * @param[in] conn_id: connection ID which identify the server. - * @param[in] start_handle: the attribute start handle - * @param[in] end_handle: the attribute end handle - * @param[in] char_uuid: the characteristic uuid - * @param[out] result: The pointer to the characteristic in the service. - * @param[inout] count: input the number of characteristic want to find, - * it will output the number of characteristic has been found in the gattc cache with the given service. - * - * @return - * - ESP_OK: success - * - other: failed - * - */ -esp_gatt_status_t esp_ble_gattc_get_char_by_uuid(esp_gatt_if_t gattc_if, - uint16_t conn_id, - uint16_t start_handle, - uint16_t end_handle, - esp_bt_uuid_t char_uuid, - esp_gattc_char_elem_t *result, - uint16_t *count); - -/** - * @brief Find the descriptor with the given characteristic uuid in the gattc cache - * Note: It just get descriptor from local cache, won't get from remote devices. - * - * @param[in] gattc_if: Gatt client access interface. - * @param[in] conn_id: connection ID which identify the server. - * @param[in] start_handle: the attribute start handle - * @param[in] end_handle: the attribute end handle - * @param[in] char_uuid: the characteristic uuid. - * @param[in] descr_uuid: the descriptor uuid. - * @param[out] result: The pointer to the descriptor in the given characteristic. - * @param[inout] count: input the number of descriptor want to find, - * it will output the number of descriptor has been found in the gattc cache with the given characteristic. - * - * @return - * - ESP_OK: success - * - other: failed - * - */ -esp_gatt_status_t esp_ble_gattc_get_descr_by_uuid(esp_gatt_if_t gattc_if, - uint16_t conn_id, - uint16_t start_handle, - uint16_t end_handle, - esp_bt_uuid_t char_uuid, - esp_bt_uuid_t descr_uuid, - esp_gattc_descr_elem_t *result, - uint16_t *count); - -/** - * @brief Find the descriptor with the given characteristic handle in the gattc cache - * Note: It just get descriptor from local cache, won't get from remote devices. - * - * @param[in] gattc_if: Gatt client access interface. - * @param[in] conn_id: connection ID which identify the server. - * @param[in] char_handle: the characteristic handle. - * @param[in] descr_uuid: the descriptor uuid. - * @param[out] result: The pointer to the descriptor in the given characteristic. - * @param[inout] count: input the number of descriptor want to find, - * it will output the number of descriptor has been found in the gattc cache with the given characteristic. - * - * @return - * - ESP_OK: success - * - other: failed - * - */ -esp_gatt_status_t esp_ble_gattc_get_descr_by_char_handle(esp_gatt_if_t gattc_if, - uint16_t conn_id, - uint16_t char_handle, - esp_bt_uuid_t descr_uuid, - esp_gattc_descr_elem_t *result, - uint16_t *count); - -/** - * @brief Find the include service with the given service handle in the gattc cache - * Note: It just get include service from local cache, won't get from remote devices. - * - * @param[in] gattc_if: Gatt client access interface. - * @param[in] conn_id: connection ID which identify the server. - * @param[in] start_handle: the attribute start handle - * @param[in] end_handle: the attribute end handle - * @param[in] incl_uuid: the include service uuid - * @param[out] result: The pointer to the include service in the given service. - * @param[inout] count: input the number of include service want to find, - * it will output the number of include service has been found in the gattc cache with the given service. - * - * @return - * - ESP_OK: success - * - other: failed - * - */ -esp_gatt_status_t esp_ble_gattc_get_include_service(esp_gatt_if_t gattc_if, - uint16_t conn_id, - uint16_t start_handle, - uint16_t end_handle, - esp_bt_uuid_t *incl_uuid, - esp_gattc_incl_svc_elem_t *result, - uint16_t *count); - - -/** - * @brief Find the attribute count with the given service or characteristic in the gattc cache - * - * @param[in] gattc_if: Gatt client access interface. - * @param[in] conn_id: connection ID which identify the server. - * @param[in] type: the attribute type. - * @param[in] start_handle: the attribute start handle, if the type is ESP_GATT_DB_DESCRIPTOR, this parameter should be ignore - * @param[in] end_handle: the attribute end handle, if the type is ESP_GATT_DB_DESCRIPTOR, this parameter should be ignore - * @param[in] char_handle: the characteristic handle, this parameter valid when the type is ESP_GATT_DB_DESCRIPTOR. If the type - * isn't ESP_GATT_DB_DESCRIPTOR, this parameter should be ignore. - * @param[out] count: output the number of attribute has been found in the gattc cache with the given attribute type. - * - * @return - * - ESP_OK: success - * - other: failed - * - */ -esp_gatt_status_t esp_ble_gattc_get_attr_count(esp_gatt_if_t gattc_if, - uint16_t conn_id, - esp_gatt_db_attr_type_t type, - uint16_t start_handle, - uint16_t end_handle, - uint16_t char_handle, - uint16_t *count); - -/** - * @brief This function is called to get the GATT database. - * Note: It just get attribute data base from local cache, won't get from remote devices. - * - * @param[in] gattc_if: Gatt client access interface. - * @param[in] start_handle: the attribute start handle - * @param[in] end_handle: the attribute end handle - * @param[in] conn_id: connection ID which identify the server. - * @param[in] db: output parameter which will contain the GATT database copy. - * Caller is responsible for freeing it. - * @param[in] count: number of elements in database. - * - * @return - * - ESP_OK: success - * - other: failed - * - */ -esp_gatt_status_t esp_ble_gattc_get_db(esp_gatt_if_t gattc_if, uint16_t conn_id, uint16_t start_handle, uint16_t end_handle, - esp_gattc_db_elem_t *db, uint16_t *count); - -/** - * @brief This function is called to read a service's characteristics of - * the given characteristic handle - * - * @param[in] gattc_if: Gatt client access interface. - * @param[in] conn_id : connection ID. - * @param[in] handle : characteritic handle to read. - * @param[in] auth_req : authenticate request type - * - * @return - * - ESP_OK: success - * - other: failed - * - */ -esp_err_t esp_ble_gattc_read_char (esp_gatt_if_t gattc_if, - uint16_t conn_id, - uint16_t handle, - esp_gatt_auth_req_t auth_req); - -/** - * @brief This function is called to read multiple characteristic or - * characteristic descriptors. - * - * @param[in] gattc_if: Gatt client access interface. - * @param[in] conn_id : connection ID. - * @param[in] read_multi : pointer to the read multiple parameter. - * @param[in] auth_req : authenticate request type - * - * @return - * - ESP_OK: success - * - other: failed - * - */ -esp_err_t esp_ble_gattc_read_multiple(esp_gatt_if_t gattc_if, - uint16_t conn_id, esp_gattc_multi_t *read_multi, - esp_gatt_auth_req_t auth_req); - - -/** - * @brief This function is called to read a characteristics descriptor. - * - * @param[in] gattc_if: Gatt client access interface. - * @param[in] conn_id : connection ID. - * @param[in] handle : descriptor handle to read. - * @param[in] auth_req : authenticate request type - * - * @return - * - ESP_OK: success - * - other: failed - * - */ -esp_err_t esp_ble_gattc_read_char_descr (esp_gatt_if_t gattc_if, - uint16_t conn_id, - uint16_t handle, - esp_gatt_auth_req_t auth_req); - - -/** - * @brief This function is called to write characteristic value. - * - * @param[in] gattc_if: Gatt client access interface. - * @param[in] conn_id : connection ID. - * @param[in] handle : characteristic handle to write. - * @param[in] value_len: length of the value to be written. - * @param[in] value : the value to be written. - * @param[in] write_type : the type of attribute write operation. - * @param[in] auth_req : authentication request. - * - * @return - * - ESP_OK: success - * - other: failed - * - */ -esp_err_t esp_ble_gattc_write_char( esp_gatt_if_t gattc_if, - uint16_t conn_id, - uint16_t handle, - uint16_t value_len, - uint8_t *value, - esp_gatt_write_type_t write_type, - esp_gatt_auth_req_t auth_req); - - -/** - * @brief This function is called to write characteristic descriptor value. - * - * @param[in] gattc_if: Gatt client access interface. - * @param[in] conn_id : connection ID - * @param[in] handle : descriptor hadle to write. - * @param[in] value_len: length of the value to be written. - * @param[in] value : the value to be written. - * @param[in] write_type : the type of attribute write operation. - * @param[in] auth_req : authentication request. - * - * @return - * - ESP_OK: success - * - other: failed - * - */ -esp_err_t esp_ble_gattc_write_char_descr (esp_gatt_if_t gattc_if, - uint16_t conn_id, - uint16_t handle, - uint16_t value_len, - uint8_t *value, - esp_gatt_write_type_t write_type, - esp_gatt_auth_req_t auth_req); - - -/** - * @brief This function is called to prepare write a characteristic value. - * - * @param[in] gattc_if: Gatt client access interface. - * @param[in] conn_id : connection ID. - * @param[in] handle : characteristic handle to prepare write. - * @param[in] offset : offset of the write value. - * @param[in] value_len: length of the value to be written. - * @param[in] value : the value to be written. - * @param[in] auth_req : authentication request. - * - * @return - * - ESP_OK: success - * - other: failed - * - */ -esp_err_t esp_ble_gattc_prepare_write(esp_gatt_if_t gattc_if, - uint16_t conn_id, - uint16_t handle, - uint16_t offset, - uint16_t value_len, - uint8_t *value, - esp_gatt_auth_req_t auth_req); - - -/** - * @brief This function is called to prepare write a characteristic descriptor value. - * - * @param[in] gattc_if: Gatt client access interface. - * @param[in] conn_id : connection ID. - * @param[in] handle : characteristic descriptor handle to prepare write. - * @param[in] offset : offset of the write value. - * @param[in] value_len: length of the value to be written. - * @param[in] value : the value to be written. - * @param[in] auth_req : authentication request. - * - * @return - * - ESP_OK: success - * - other: failed - * - */ -esp_err_t esp_ble_gattc_prepare_write_char_descr(esp_gatt_if_t gattc_if, - uint16_t conn_id, - uint16_t handle, - uint16_t offset, - uint16_t value_len, - uint8_t *value, - esp_gatt_auth_req_t auth_req); - - -/** - * @brief This function is called to execute write a prepare write sequence. - * - * @param[in] gattc_if: Gatt client access interface. - * @param[in] conn_id : connection ID. - * @param[in] is_execute : execute or cancel. - * - * @return - * - ESP_OK: success - * - other: failed - * - */ -esp_err_t esp_ble_gattc_execute_write (esp_gatt_if_t gattc_if, uint16_t conn_id, bool is_execute); - - -/** - * @brief This function is called to register for notification of a service. - * - * @param[in] gattc_if: Gatt client access interface. - * @param[in] server_bda : target GATT server. - * @param[in] handle : GATT characteristic handle. - * - * @return - * - ESP_OK: registration succeeds - * - other: failed - * - */ -esp_err_t esp_ble_gattc_register_for_notify (esp_gatt_if_t gattc_if, - esp_bd_addr_t server_bda, - uint16_t handle); - - -/** - * @brief This function is called to de-register for notification of a service. - * - * @param[in] gattc_if: Gatt client access interface. - * @param[in] server_bda : target GATT server. - * @param[in] handle : GATT characteristic handle. - * - * @return - * - ESP_OK: unregister succeeds - * - other: failed - * - */ -esp_err_t esp_ble_gattc_unregister_for_notify (esp_gatt_if_t gattc_if, - esp_bd_addr_t server_bda, - uint16_t handle); - - -/** -* @brief Refresh the server cache store in the gattc stack of the remote device -* -* @param[in] remote_bda: remote device BD address. -* -* @return -* - ESP_OK: success -* - other: failed -* -*/ -esp_err_t esp_ble_gattc_cache_refresh(esp_bd_addr_t remote_bda); - -/** -* @brief Add or delete the associated address with the source address. -* Note: The role of this API is mainly when the client side has stored a server-side database, -* when it needs to connect another device, but the device's attribute database is the same -* as the server database stored on the client-side, calling this API can use the database -* that the device has stored used as the peer server database to reduce the attribute -* database search and discovery process and speed up the connection time. -* The associated address mains that device want to used the database has stored in the local cache. -* The source address mains that device want to share the database to the associated address device. -* -* @param[in] gattc_if: Gatt client access interface. -* @param[in] src_addr: the source address which provide the attribute table. -* @param[in] assoc_addr: the associated device address which went to share the attribute table with the source address. -* @param[in] is_assoc: true add the associated device address, false remove the associated device address. -* @return -* - ESP_OK: success -* - other: failed -* -*/ -esp_err_t esp_ble_gattc_cache_assoc(esp_gatt_if_t gattc_if, esp_bd_addr_t src_addr, - esp_bd_addr_t assoc_addr, bool is_assoc); -/** -* @brief Get the address list which has store the attribute table in the gattc cache. There will -* callback ESP_GATTC_GET_ADDR_LIST_EVT event when get address list complete. -* -* @param[in] gattc_if: Gatt client access interface. -* @return -* - ESP_OK: success -* - other: failed -* -*/ -esp_err_t esp_ble_gattc_cache_get_addr_list(esp_gatt_if_t gattc_if); - - - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_GATTC_API_H__ */ diff --git a/tools/sdk/include/bt/esp_gatts_api.h b/tools/sdk/include/bt/esp_gatts_api.h deleted file mode 100644 index 97296b1c7a8..00000000000 --- a/tools/sdk/include/bt/esp_gatts_api.h +++ /dev/null @@ -1,582 +0,0 @@ -// 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. - -#ifndef __ESP_GATTS_API_H__ -#define __ESP_GATTS_API_H__ - -#include "esp_bt_defs.h" -#include "esp_gatt_defs.h" -#include "esp_err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/// GATT Server callback function events -typedef enum { - ESP_GATTS_REG_EVT = 0, /*!< When register application id, the event comes */ - ESP_GATTS_READ_EVT = 1, /*!< When gatt client request read operation, the event comes */ - ESP_GATTS_WRITE_EVT = 2, /*!< When gatt client request write operation, the event comes */ - ESP_GATTS_EXEC_WRITE_EVT = 3, /*!< When gatt client request execute write, the event comes */ - ESP_GATTS_MTU_EVT = 4, /*!< When set mtu complete, the event comes */ - ESP_GATTS_CONF_EVT = 5, /*!< When receive confirm, the event comes */ - ESP_GATTS_UNREG_EVT = 6, /*!< When unregister application id, the event comes */ - ESP_GATTS_CREATE_EVT = 7, /*!< When create service complete, the event comes */ - ESP_GATTS_ADD_INCL_SRVC_EVT = 8, /*!< When add included service complete, the event comes */ - ESP_GATTS_ADD_CHAR_EVT = 9, /*!< When add characteristic complete, the event comes */ - ESP_GATTS_ADD_CHAR_DESCR_EVT = 10, /*!< When add descriptor complete, the event comes */ - ESP_GATTS_DELETE_EVT = 11, /*!< When delete service complete, the event comes */ - ESP_GATTS_START_EVT = 12, /*!< When start service complete, the event comes */ - ESP_GATTS_STOP_EVT = 13, /*!< When stop service complete, the event comes */ - ESP_GATTS_CONNECT_EVT = 14, /*!< When gatt client connect, the event comes */ - ESP_GATTS_DISCONNECT_EVT = 15, /*!< When gatt client disconnect, the event comes */ - ESP_GATTS_OPEN_EVT = 16, /*!< When connect to peer, the event comes */ - ESP_GATTS_CANCEL_OPEN_EVT = 17, /*!< When disconnect from peer, the event comes */ - ESP_GATTS_CLOSE_EVT = 18, /*!< When gatt server close, the event comes */ - ESP_GATTS_LISTEN_EVT = 19, /*!< When gatt listen to be connected the event comes */ - ESP_GATTS_CONGEST_EVT = 20, /*!< When congest happen, the event comes */ - /* following is extra event */ - ESP_GATTS_RESPONSE_EVT = 21, /*!< When gatt send response complete, the event comes */ - ESP_GATTS_CREAT_ATTR_TAB_EVT = 22, /*!< When gatt create table complete, the event comes */ - ESP_GATTS_SET_ATTR_VAL_EVT = 23, /*!< When gatt set attr value complete, the event comes */ - ESP_GATTS_SEND_SERVICE_CHANGE_EVT = 24, /*!< When gatt send service change indication complete, the event comes */ -} esp_gatts_cb_event_t; - -/** - * @brief Gatt server callback parameters union - */ -typedef union { - /** - * @brief ESP_GATTS_REG_EVT - */ - struct gatts_reg_evt_param { - esp_gatt_status_t status; /*!< Operation status */ - uint16_t app_id; /*!< Application id which input in register API */ - } reg; /*!< Gatt server callback param of ESP_GATTS_REG_EVT */ - - /** - * @brief ESP_GATTS_READ_EVT - */ - struct gatts_read_evt_param { - uint16_t conn_id; /*!< Connection id */ - uint32_t trans_id; /*!< Transfer id */ - esp_bd_addr_t bda; /*!< The bluetooth device address which been read */ - uint16_t handle; /*!< The attribute handle */ - uint16_t offset; /*!< Offset of the value, if the value is too long */ - bool is_long; /*!< The value is too long or not */ - bool need_rsp; /*!< The read operation need to do response */ - } read; /*!< Gatt server callback param of ESP_GATTS_READ_EVT */ - - - /** - * @brief ESP_GATTS_WRITE_EVT - */ - struct gatts_write_evt_param { - uint16_t conn_id; /*!< Connection id */ - uint32_t trans_id; /*!< Transfer id */ - esp_bd_addr_t bda; /*!< The bluetooth device address which been written */ - uint16_t handle; /*!< The attribute handle */ - uint16_t offset; /*!< Offset of the value, if the value is too long */ - bool need_rsp; /*!< The write operation need to do response */ - bool is_prep; /*!< This write operation is prepare write */ - uint16_t len; /*!< The write attribute value length */ - uint8_t *value; /*!< The write attribute value */ - } write; /*!< Gatt server callback param of ESP_GATTS_WRITE_EVT */ - - /** - * @brief ESP_GATTS_EXEC_WRITE_EVT - */ - struct gatts_exec_write_evt_param { - uint16_t conn_id; /*!< Connection id */ - uint32_t trans_id; /*!< Transfer id */ - esp_bd_addr_t bda; /*!< The bluetooth device address which been written */ -#define ESP_GATT_PREP_WRITE_CANCEL 0x00 /*!< Prepare write flag to indicate cancel prepare write */ -#define ESP_GATT_PREP_WRITE_EXEC 0x01 /*!< Prepare write flag to indicate execute prepare write */ - uint8_t exec_write_flag; /*!< Execute write flag */ - } exec_write; /*!< Gatt server callback param of ESP_GATTS_EXEC_WRITE_EVT */ - - /** - * @brief ESP_GATTS_MTU_EVT - */ - struct gatts_mtu_evt_param { - uint16_t conn_id; /*!< Connection id */ - uint16_t mtu; /*!< MTU size */ - } mtu; /*!< Gatt server callback param of ESP_GATTS_MTU_EVT */ - - /** - * @brief ESP_GATTS_CONF_EVT - */ - struct gatts_conf_evt_param { - esp_gatt_status_t status; /*!< Operation status */ - uint16_t conn_id; /*!< Connection id */ - uint16_t handle; /*!< attribute handle */ - uint16_t len; /*!< The indication or notification value length, len is valid when send notification or indication failed */ - uint8_t *value; /*!< The indication or notification value , value is valid when send notification or indication failed */ - } conf; /*!< Gatt server callback param of ESP_GATTS_CONF_EVT (confirm) */ - - /** - * @brief ESP_GATTS_UNREG_EVT - */ - - /** - * @brief ESP_GATTS_CREATE_EVT - */ - struct gatts_create_evt_param { - esp_gatt_status_t status; /*!< Operation status */ - uint16_t service_handle; /*!< Service attribute handle */ - esp_gatt_srvc_id_t service_id; /*!< Service id, include service uuid and other information */ - } create; /*!< Gatt server callback param of ESP_GATTS_CREATE_EVT */ - - /** - * @brief ESP_GATTS_ADD_INCL_SRVC_EVT - */ - struct gatts_add_incl_srvc_evt_param { - esp_gatt_status_t status; /*!< Operation status */ - uint16_t attr_handle; /*!< Included service attribute handle */ - uint16_t service_handle; /*!< Service attribute handle */ - } add_incl_srvc; /*!< Gatt server callback param of ESP_GATTS_ADD_INCL_SRVC_EVT */ - - /** - * @brief ESP_GATTS_ADD_CHAR_EVT - */ - struct gatts_add_char_evt_param { - esp_gatt_status_t status; /*!< Operation status */ - uint16_t attr_handle; /*!< Characteristic attribute handle */ - uint16_t service_handle; /*!< Service attribute handle */ - esp_bt_uuid_t char_uuid; /*!< Characteristic uuid */ - } add_char; /*!< Gatt server callback param of ESP_GATTS_ADD_CHAR_EVT */ - - /** - * @brief ESP_GATTS_ADD_CHAR_DESCR_EVT - */ - struct gatts_add_char_descr_evt_param { - esp_gatt_status_t status; /*!< Operation status */ - uint16_t attr_handle; /*!< Descriptor attribute handle */ - uint16_t service_handle; /*!< Service attribute handle */ - esp_bt_uuid_t descr_uuid; /*!< Characteristic descriptor uuid */ - } add_char_descr; /*!< Gatt server callback param of ESP_GATTS_ADD_CHAR_DESCR_EVT */ - - /** - * @brief ESP_GATTS_DELETE_EVT - */ - struct gatts_delete_evt_param { - esp_gatt_status_t status; /*!< Operation status */ - uint16_t service_handle; /*!< Service attribute handle */ - } del; /*!< Gatt server callback param of ESP_GATTS_DELETE_EVT */ - - /** - * @brief ESP_GATTS_START_EVT - */ - struct gatts_start_evt_param { - esp_gatt_status_t status; /*!< Operation status */ - uint16_t service_handle; /*!< Service attribute handle */ - } start; /*!< Gatt server callback param of ESP_GATTS_START_EVT */ - - /** - * @brief ESP_GATTS_STOP_EVT - */ - struct gatts_stop_evt_param { - esp_gatt_status_t status; /*!< Operation status */ - uint16_t service_handle; /*!< Service attribute handle */ - } stop; /*!< Gatt server callback param of ESP_GATTS_STOP_EVT */ - - /** - * @brief ESP_GATTS_CONNECT_EVT - */ - struct gatts_connect_evt_param { - uint16_t conn_id; /*!< Connection id */ - esp_bd_addr_t remote_bda; /*!< Remote bluetooth device address */ - } connect; /*!< Gatt server callback param of ESP_GATTS_CONNECT_EVT */ - - /** - * @brief ESP_GATTS_DISCONNECT_EVT - */ - struct gatts_disconnect_evt_param { - uint16_t conn_id; /*!< Connection id */ - esp_bd_addr_t remote_bda; /*!< Remote bluetooth device address */ - esp_gatt_conn_reason_t reason; /*!< Indicate the reason of disconnection */ - } disconnect; /*!< Gatt server callback param of ESP_GATTS_DISCONNECT_EVT */ - - /** - * @brief ESP_GATTS_OPEN_EVT - */ - struct gatts_open_evt_param { - esp_gatt_status_t status; /*!< Operation status */ - } open; /*!< Gatt server callback param of ESP_GATTS_OPEN_EVT */ - - /** - * @brief ESP_GATTS_CANCEL_OPEN_EVT - */ - struct gatts_cancel_open_evt_param { - esp_gatt_status_t status; /*!< Operation status */ - } cancel_open; /*!< Gatt server callback param of ESP_GATTS_CANCEL_OPEN_EVT */ - - /** - * @brief ESP_GATTS_CLOSE_EVT - */ - struct gatts_close_evt_param { - esp_gatt_status_t status; /*!< Operation status */ - uint16_t conn_id; /*!< Connection id */ - } close; /*!< Gatt server callback param of ESP_GATTS_CLOSE_EVT */ - - /** - * @brief ESP_GATTS_LISTEN_EVT - */ - /** - * @brief ESP_GATTS_CONGEST_EVT - */ - struct gatts_congest_evt_param { - uint16_t conn_id; /*!< Connection id */ - bool congested; /*!< Congested or not */ - } congest; /*!< Gatt server callback param of ESP_GATTS_CONGEST_EVT */ - - /** - * @brief ESP_GATTS_RESPONSE_EVT - */ - struct gatts_rsp_evt_param { - esp_gatt_status_t status; /*!< Operation status */ - uint16_t handle; /*!< Attribute handle which send response */ - } rsp; /*!< Gatt server callback param of ESP_GATTS_RESPONSE_EVT */ - - /** - * @brief ESP_GATTS_CREAT_ATTR_TAB_EVT - */ - struct gatts_add_attr_tab_evt_param{ - esp_gatt_status_t status; /*!< Operation status */ - esp_bt_uuid_t svc_uuid; /*!< Service uuid type */ - uint16_t num_handle; /*!< The number of the attribute handle to be added to the gatts database */ - uint16_t *handles; /*!< The number to the handles */ - } add_attr_tab; /*!< Gatt server callback param of ESP_GATTS_CREAT_ATTR_TAB_EVT */ - - - /** - * @brief ESP_GATTS_SET_ATTR_VAL_EVT - */ - struct gatts_set_attr_val_evt_param{ - uint16_t srvc_handle; /*!< The service handle */ - uint16_t attr_handle; /*!< The attribute handle */ - esp_gatt_status_t status; /*!< Operation status*/ - } set_attr_val; /*!< Gatt server callback param of ESP_GATTS_SET_ATTR_VAL_EVT */ - - /** - * @brief ESP_GATTS_SEND_SERVICE_CHANGE_EVT - */ - struct gatts_send_service_change_evt_param{ - esp_gatt_status_t status; /*!< Operation status*/ - } service_change; /*!< Gatt server callback param of ESP_GATTS_SEND_SERVICE_CHANGE_EVT */ - -} esp_ble_gatts_cb_param_t; - -/** - * @brief GATT Server callback function type - * @param event : Event type - * @param gatts_if : GATT server access interface, normally - * different gatts_if correspond to different profile - * @param param : Point to callback parameter, currently is union type - */ -typedef void (* esp_gatts_cb_t)(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param); - -/** - * @brief This function is called to register application callbacks - * with BTA GATTS module. - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gatts_register_callback(esp_gatts_cb_t callback); - -/** - * @brief This function is called to register application identifier - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gatts_app_register(uint16_t app_id); - - - -/** - * @brief unregister with GATT Server. - * - * @param[in] gatts_if: GATT server access interface - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gatts_app_unregister(esp_gatt_if_t gatts_if); - - -/** - * @brief Create a service. When service creation is done, a callback - * event BTA_GATTS_CREATE_SRVC_EVT is called to report status - * and service ID to the profile. The service ID obtained in - * the callback function needs to be used when adding included - * service and characteristics/descriptors into the service. - * - * @param[in] gatts_if: GATT server access interface - * @param[in] service_id: service ID. - * @param[in] num_handle: number of handle requested for this service. - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gatts_create_service(esp_gatt_if_t gatts_if, - esp_gatt_srvc_id_t *service_id, uint16_t num_handle); - - -/** - * @brief Create a service attribute tab. - * @param[in] gatts_attr_db: the pointer to the service attr tab - * @param[in] gatts_if: GATT server access interface - * @param[in] max_nb_attr: the number of attribute to be added to the service database. - * @param[in] srvc_inst_id: the instance id of the service - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gatts_create_attr_tab(const esp_gatts_attr_db_t *gatts_attr_db, - esp_gatt_if_t gatts_if, - uint8_t max_nb_attr, - uint8_t srvc_inst_id); -/** - * @brief This function is called to add an included service. This function have to be called between - * 'esp_ble_gatts_create_service' and 'esp_ble_gatts_add_char'. After included - * service is included, a callback event BTA_GATTS_ADD_INCL_SRVC_EVT - * is reported the included service ID. - * - * @param[in] service_handle: service handle to which this included service is to - * be added. - * @param[in] included_service_handle: the service ID to be included. - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gatts_add_included_service(uint16_t service_handle, uint16_t included_service_handle); - - - -/** - * @brief This function is called to add a characteristic into a service. - * - * @param[in] service_handle: service handle to which this included service is to - * be added. - * @param[in] char_uuid : Characteristic UUID. - * @param[in] perm : Characteristic value declaration attribute permission. - * @param[in] property : Characteristic Properties - * @param[in] char_val : Characteristic value - * @param[in] control : attribute response control byte - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gatts_add_char(uint16_t service_handle, esp_bt_uuid_t *char_uuid, - esp_gatt_perm_t perm, esp_gatt_char_prop_t property, esp_attr_value_t *char_val, - esp_attr_control_t *control); - - -/** - * @brief This function is called to add characteristic descriptor. When - * it's done, a callback event BTA_GATTS_ADD_DESCR_EVT is called - * to report the status and an ID number for this descriptor. - * - * @param[in] service_handle: service handle to which this characteristic descriptor is to - * be added. - * @param[in] perm: descriptor access permission. - * @param[in] descr_uuid: descriptor UUID. - * @param[in] char_descr_val : Characteristic descriptor value - * @param[in] control : attribute response control byte - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gatts_add_char_descr (uint16_t service_handle, - esp_bt_uuid_t *descr_uuid, - esp_gatt_perm_t perm, esp_attr_value_t *char_descr_val, - esp_attr_control_t *control); - - - -/** - * @brief This function is called to delete a service. When this is done, - * a callback event BTA_GATTS_DELETE_EVT is report with the status. - * - * @param[in] service_handle: service_handle to be deleted. - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gatts_delete_service(uint16_t service_handle); - - - -/** - * @brief This function is called to start a service. - * - * @param[in] service_handle: the service handle to be started. - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gatts_start_service(uint16_t service_handle); - - - -/** - * @brief This function is called to stop a service. - * - * @param[in] service_handle - service to be topped. - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gatts_stop_service(uint16_t service_handle); - - - -/** - * @brief Send indicate or notify to GATT client. - * Set param need_confirm as false will send notification, otherwise indication. - * - * @param[in] gatts_if: GATT server access interface - * @param[in] conn_id - connection id to indicate. - * @param[in] attr_handle - attribute handle to indicate. - * @param[in] value_len - indicate value length. - * @param[in] value: value to indicate. - * @param[in] need_confirm - Whether a confirmation is required. - * false sends a GATT notification, true sends a GATT indication. - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gatts_send_indicate(esp_gatt_if_t gatts_if, uint16_t conn_id, uint16_t attr_handle, - uint16_t value_len, uint8_t *value, bool need_confirm); - - -/** - * @brief This function is called to send a response to a request. - * - * @param[in] gatts_if: GATT server access interface - * @param[in] conn_id - connection identifier. - * @param[in] trans_id - transfer id - * @param[in] status - response status - * @param[in] rsp - response data. - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gatts_send_response(esp_gatt_if_t gatts_if, uint16_t conn_id, uint32_t trans_id, - esp_gatt_status_t status, esp_gatt_rsp_t *rsp); - - -/** - * @brief This function is called to set the attribute value by the application - * - * @param[in] attr_handle: the attribute handle which to be set - * @param[in] length: the value length - * @param[in] value: the pointer to the attribute value - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gatts_set_attr_value(uint16_t attr_handle, uint16_t length, const uint8_t *value); - -/** - * @brief Retrieve attribute value - * - * @param[in] attr_handle: Attribute handle. - * @param[out] length: pointer to the attribute value length - * @param[out] value: Pointer to attribute value payload, the value cannot be modified by user - * - * @return - * - ESP_GATT_OK : success - * - other : failed - * - */ -esp_gatt_status_t esp_ble_gatts_get_attr_value(uint16_t attr_handle, uint16_t *length, const uint8_t **value); - - -/** - * @brief Open a direct open connection or add a background auto connection - * - * @param[in] gatts_if: GATT server access interface - * @param[in] remote_bda: remote device bluetooth device address. - * @param[in] is_direct: direct connection or background auto connection - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gatts_open(esp_gatt_if_t gatts_if, esp_bd_addr_t remote_bda, bool is_direct); - -/** - * @brief Close a connection a remote device. - * - * @param[in] gatts_if: GATT server access interface - * @param[in] conn_id: connection ID to be closed. - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gatts_close(esp_gatt_if_t gatts_if, uint16_t conn_id); - -/** - * @brief Send service change indication - * - * @param[in] gatts_if: GATT server access interface - * @param[in] remote_bda: remote device bluetooth device address. - * If remote_bda is NULL then it will send service change - * indication to all the connected devices and if not then - * to a specific device - * - * @return - * - ESP_OK : success - * - other : failed - * - */ -esp_err_t esp_ble_gatts_send_service_change_indication(esp_gatt_if_t gatts_if, esp_bd_addr_t remote_bda); - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_GATTS_API_H__ */ diff --git a/tools/sdk/include/bt/esp_hf_client_api.h b/tools/sdk/include/bt/esp_hf_client_api.h deleted file mode 100644 index dfc06ed5d1c..00000000000 --- a/tools/sdk/include/bt/esp_hf_client_api.h +++ /dev/null @@ -1,635 +0,0 @@ -// 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. - -#ifndef __ESP_HF_CLIENT_API_H__ -#define __ESP_HF_CLIENT_API_H__ - -#include "esp_err.h" -#include "esp_bt_defs.h" -#include "esp_hf_defs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ESP_BT_HF_CLIENT_NUMBER_LEN (32) -#define ESP_BT_HF_CLIENT_OPERATOR_NAME_LEN (16) - -/// Bluetooth HFP RFCOMM connection and service level connection status -typedef enum { - ESP_HF_CLIENT_CONNECTION_STATE_DISCONNECTED = 0, /*!< RFCOMM data link channel released */ - ESP_HF_CLIENT_CONNECTION_STATE_CONNECTING, /*!< connecting remote device on the RFCOMM data link*/ - ESP_HF_CLIENT_CONNECTION_STATE_CONNECTED, /*!< RFCOMM connection established */ - ESP_HF_CLIENT_CONNECTION_STATE_SLC_CONNECTED, /*!< service level connection established */ - ESP_HF_CLIENT_CONNECTION_STATE_DISCONNECTING, /*!< disconnecting with remote device on the RFCOMM dat link*/ -} esp_hf_client_connection_state_t; - -/// Bluetooth HFP audio connection status -typedef enum { - ESP_HF_CLIENT_AUDIO_STATE_DISCONNECTED = 0, /*!< audio connection released */ - ESP_HF_CLIENT_AUDIO_STATE_CONNECTING, /*!< audio connection has been initiated */ - ESP_HF_CLIENT_AUDIO_STATE_CONNECTED, /*!< audio connection is established */ - ESP_HF_CLIENT_AUDIO_STATE_CONNECTED_MSBC, /*!< mSBC audio connection is established */ -} esp_hf_client_audio_state_t; - -/// in-band ring tone state -typedef enum { - ESP_HF_CLIENT_IN_BAND_RINGTONE_NOT_PROVIDED = 0, - ESP_HF_CLIENT_IN_BAND_RINGTONE_PROVIDED, -} esp_hf_client_in_band_ring_state_t; - -/* features masks of AG */ -#define ESP_HF_CLIENT_PEER_FEAT_3WAY 0x01 /* Three-way calling */ -#define ESP_HF_CLIENT_PEER_FEAT_ECNR 0x02 /* Echo cancellation and/or noise reduction */ -#define ESP_HF_CLIENT_PEER_FEAT_VREC 0x04 /* Voice recognition */ -#define ESP_HF_CLIENT_PEER_FEAT_INBAND 0x08 /* In-band ring tone */ -#define ESP_HF_CLIENT_PEER_FEAT_VTAG 0x10 /* Attach a phone number to a voice tag */ -#define ESP_HF_CLIENT_PEER_FEAT_REJECT 0x20 /* Ability to reject incoming call */ -#define ESP_HF_CLIENT_PEER_FEAT_ECS 0x40 /* Enhanced Call Status */ -#define ESP_HF_CLIENT_PEER_FEAT_ECC 0x80 /* Enhanced Call Control */ -#define ESP_HF_CLIENT_PEER_FEAT_EXTERR 0x100 /* Extended error codes */ -#define ESP_HF_CLIENT_PEER_FEAT_CODEC 0x200 /* Codec Negotiation */ - -/* CHLD feature masks of AG */ -#define ESP_HF_CLIENT_CHLD_FEAT_REL 0x01 /* 0 Release waiting call or held calls */ -#define ESP_HF_CLIENT_CHLD_FEAT_REL_ACC 0x02 /* 1 Release active calls and accept other waiting or held call */ -#define ESP_HF_CLIENT_CHLD_FEAT_REL_X 0x04 /* 1x Release specified active call only */ -#define ESP_HF_CLIENT_CHLD_FEAT_HOLD_ACC 0x08 /* 2 Active calls on hold and accept other waiting or held call */ -#define ESP_HF_CLIENT_CHLD_FEAT_PRIV_X 0x10 /* 2x Request private mode with specified call(put the rest on hold) */ -#define ESP_HF_CLIENT_CHLD_FEAT_MERGE 0x20 /* 3 Add held call to multiparty */ -#define ESP_HF_CLIENT_CHLD_FEAT_MERGE_DETACH 0x40 /* 4 Connect two calls and leave(disconnect from multiparty) */ - -/// HF CLIENT callback events -typedef enum { - ESP_HF_CLIENT_CONNECTION_STATE_EVT = 0, /*!< connection state changed event */ - ESP_HF_CLIENT_AUDIO_STATE_EVT, /*!< audio connection state change event */ - ESP_HF_CLIENT_BVRA_EVT, /*!< voice recognition state change event */ - ESP_HF_CLIENT_CIND_CALL_EVT, /*!< call indication */ - ESP_HF_CLIENT_CIND_CALL_SETUP_EVT, /*!< call setup indication */ - ESP_HF_CLIENT_CIND_CALL_HELD_EVT, /*!< call held indication */ - ESP_HF_CLIENT_CIND_SERVICE_AVAILABILITY_EVT, /*!< network service availability indication */ - ESP_HF_CLIENT_CIND_SIGNAL_STRENGTH_EVT, /*!< signal strength indication */ - ESP_HF_CLIENT_CIND_ROAMING_STATUS_EVT, /*!< roaming status indication */ - ESP_HF_CLIENT_CIND_BATTERY_LEVEL_EVT, /*!< battery level indication */ - ESP_HF_CLIENT_COPS_CURRENT_OPERATOR_EVT, /*!< current operator information */ - ESP_HF_CLIENT_BTRH_EVT, /*!< call response and hold event */ - ESP_HF_CLIENT_CLIP_EVT, /*!< Calling Line Identification notification */ - ESP_HF_CLIENT_CCWA_EVT, /*!< call waiting notification */ - ESP_HF_CLIENT_CLCC_EVT, /*!< list of current calls notification */ - ESP_HF_CLIENT_VOLUME_CONTROL_EVT, /*!< audio volume control command from AG, provided by +VGM or +VGS message */ - ESP_HF_CLIENT_AT_RESPONSE_EVT, /*!< AT command response event */ - ESP_HF_CLIENT_CNUM_EVT, /*!< subscriber information response from AG */ - ESP_HF_CLIENT_BSIR_EVT, /*!< setting of in-band ring tone */ - ESP_HF_CLIENT_BINP_EVT, /*!< requested number of last voice tag from AG */ - ESP_HF_CLIENT_RING_IND_EVT, /*!< ring indication event */ -} esp_hf_client_cb_event_t; - -/// HFP client callback parameters -typedef union { - /** - * @brief ESP_HF_CLIENT_CONNECTION_STATE_EVT - */ - struct hf_client_conn_stat_param { - esp_hf_client_connection_state_t state; /*!< HF connection state */ - uint32_t peer_feat; /*!< AG supported features */ - uint32_t chld_feat; /*!< AG supported features on call hold and multiparty services */ - esp_bd_addr_t remote_bda; /*!< remote bluetooth device address */ - } conn_stat; /*!< HF callback param of ESP_HF_CLIENT_CONNECTION_STATE_EVT */ - - /** - * @brief ESP_HF_CLIENT_AUDIO_STATE_EVT - */ - struct hf_client_audio_stat_param { - esp_hf_client_audio_state_t state; /*!< audio connection state */ - esp_bd_addr_t remote_bda; /*!< remote bluetooth device address */ - } audio_stat; /*!< HF callback param of ESP_HF_CLIENT_AUDIO_STATE_EVT */ - - /** - * @brief ESP_HF_CLIENT_BVRA_EVT - */ - struct hf_client_bvra_param { - esp_hf_vr_state_t value; /*!< voice recognition state */ - } bvra; /*!< HF callback param of ESP_HF_CLIENT_BVRA_EVT */ - - /** - * @brief ESP_HF_CLIENT_CIND_SERVICE_AVAILABILITY_EVT - */ - struct hf_client_service_availability_param { - esp_hf_service_availability_status_t status; /*!< service availability status */ - } service_availability; /*!< HF callback param of ESP_HF_CLIENT_CIND_SERVICE_AVAILABILITY_EVT */ - - /** - * @brief ESP_HF_CLIENT_CIND_ROAMING_STATUS_EVT - */ - struct hf_client_network_roaming_param { - esp_hf_roaming_status_t status; /*!< roaming status */ - } roaming; /*!< HF callback param of ESP_HF_CLIENT_CIND_ROAMING_STATUS_EVT */ - - /** - * @brief ESP_HF_CLIENT_CIND_SIGNAL_STRENGTH_EVT - */ - struct hf_client_signal_strength_ind_param { - int value; /*!< signal strength value, ranges from 0 to 5 */ - } signal_strength; /*!< HF callback param of ESP_HF_CLIENT_CIND_SIGNAL_STRENGTH_EVT */ - - /** - * @brief ESP_HF_CLIENT_CIND_BATTERY_LEVEL_EVT - */ - struct hf_client_battery_level_ind_param { - int value; /*!< battery charge value, ranges from 0 to 5 */ - } battery_level; /*!< HF callback param of ESP_HF_CLIENT_CIND_BATTERY_LEVEL_EVT */ - - /** - * @brief ESP_HF_CLIENT_COPS_CURRENT_OPERATOR_EVT - */ - struct hf_client_current_operator_param { - const char *name; /*!< name of the network operator */ - } cops; /*!< HF callback param of ESP_HF_CLIENT_COPS_CURRENT_OPERATOR_EVT */ - - /** - * @brief ESP_HF_CLIENT_CIND_CALL_EVT - */ - struct hf_client_call_ind_param { - esp_hf_call_status_t status; /*!< call status indicator */ - } call; /*!< HF callback param of ESP_HF_CLIENT_CIND_CALL_EVT */ - - /** - * @brief ESP_HF_CLIENT_CIND_CALL_SETUP_EVT - */ - struct hf_client_call_setup_ind_param { - esp_hf_call_setup_status_t status; /*!< call setup status indicator */ - } call_setup; /*!< HF callback param of ESP_HF_CLIENT_BVRA_EVT */ - - /** - * @brief ESP_HF_CLIENT_CIND_CALL_HELD_EVT - */ - struct hf_client_call_held_ind_param { - esp_hf_call_held_status_t status; /*!< bluetooth proprietary call hold status indicator */ - } call_held; /*!< HF callback param of ESP_HF_CLIENT_CIND_CALL_HELD_EVT */ - - /** - * @brief ESP_HF_CLIENT_BTRH_EVT - */ - struct hf_client_btrh_param { - esp_hf_btrh_status_t status; /*!< call hold and response status result code */ - } btrh; /*!< HF callback param of ESP_HF_CLIENT_BRTH_EVT */ - - /** - * @brief ESP_HF_CLIENT_CLIP_EVT - */ - struct hf_client_clip_param { - const char *number; /*!< phone number string of call */ - } clip; /*!< HF callback param of ESP_HF_CLIENT_CLIP_EVT */ - - /** - * @brief ESP_HF_CLIENT_CCWA_EVT - */ - struct hf_client_ccwa_param { - const char *number; /*!< phone number string of waiting call */ - } ccwa; /*!< HF callback param of ESP_HF_CLIENT_BVRA_EVT */ - - /** - * @brief ESP_HF_CLIENT_CLCC_EVT - */ - struct hf_client_clcc_param { - int idx; /*!< numbering(starting with 1) of the call */ - esp_hf_current_call_direction_t dir; /*!< direction of the call */ - esp_hf_current_call_status_t status; /*!< status of the call */ - esp_hf_current_call_mpty_type_t mpty; /*!< multi-party flag */ - char *number; /*!< phone number(optional) */ - } clcc; /*!< HF callback param of ESP_HF_CLIENT_CLCC_EVT */ - - /** - * @brief ESP_HF_CLIENT_VOLUME_CONTROL_EVT - */ - struct hf_client_volume_control_param { - esp_hf_volume_control_target_t type; /*!< volume control target, speaker or microphone */ - int volume; /*!< gain, ranges from 0 to 15 */ - } volume_control; /*!< HF callback param of ESP_HF_CLIENT_VOLUME_CONTROL_EVT */ - - /** - * @brief ESP_HF_CLIENT_AT_RESPONSE_EVT - */ - struct hf_client_at_response_param { - esp_hf_at_response_code_t code; /*!< AT response code */ - esp_hf_cme_err_t cme; /*!< Extended Audio Gateway Error Result Code */ - } at_response; /*!< HF callback param of ESP_HF_CLIENT_AT_RESPONSE_EVT */ - - /** - * @brief ESP_HF_CLIENT_CNUM_EVT - */ - struct hf_client_cnum_param { - const char *number; /*!< phone number string */ - esp_hf_subscriber_service_type_t type; /*!< service type that the phone number relates to */ - } cnum; /*!< HF callback param of ESP_HF_CLIENT_CNUM_EVT */ - - /** - * @brief ESP_HF_CLIENT_BSIR_EVT - */ - struct hf_client_bsirparam { - esp_hf_client_in_band_ring_state_t state; /*!< setting state of in-band ring tone */ - } bsir; /*!< HF callback param of ESP_HF_CLIENT_BSIR_EVT */ - - /** - * @brief ESP_HF_CLIENT_BINP_EVT - */ - struct hf_client_binp_param { - const char *number; /*!< phone number corresponding to the last voice tag in the HF */ - } binp; /*!< HF callback param of ESP_HF_CLIENT_BINP_EVT */ - -} esp_hf_client_cb_param_t; - -/** - * @brief HFP client incoming data callback function, the callback is useful in case of - * Voice Over HCI. - * @param[in] buf : pointer to incoming data(payload of HCI synchronous data packet), the - * buffer is allocated inside bluetooth protocol stack and will be released after - * invoke of the callback is finished. - * @param[in] len : size(in bytes) in buf - */ -typedef void (* esp_hf_client_incoming_data_cb_t)(const uint8_t *buf, uint32_t len); - -/** - * @brief HFP client outgoing data callback function, the callback is useful in case of - * Voice Over HCI. Once audio connection is set up and the application layer has - * prepared data to send, the lower layer will call this function to read data - * and then send. This callback is supposed to be implemented as non-blocking, - * and if data is not enough, return value 0 is supposed. - * - * @param[in] buf : pointer to incoming data(payload of HCI synchronous data packet), the - * buffer is allocated inside bluetooth protocol stack and will be released after - * invoke of the callback is finished. - * @param[in] len : size(in bytes) in buf - * @param[out] length of data successfully read - */ -typedef uint32_t (* esp_hf_client_outgoing_data_cb_t)(uint8_t *buf, uint32_t len); - -/** - * @brief HFP client callback function type - * - * @param event : Event type - * - * @param param : Pointer to callback parameter - */ -typedef void (* esp_hf_client_cb_t)(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_t *param); - -/** - * @brief Register application callback function to HFP client module. This function should be called - * only after esp_bluedroid_enable() completes successfully, used by HFP client - * - * @param[in] callback: HFP client event callback function - * - * @return - * - ESP_OK: success - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: if callback is a NULL function pointer - * - */ -esp_err_t esp_hf_client_register_callback(esp_hf_client_cb_t callback); - -/** - * - * @brief Initialize the bluetooth HFP client module. This function should be called - * after esp_bluedroid_enable() completes successfully - * - * @return - * - ESP_OK: if the initialization request is sent successfully - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_hf_client_init(void); - -/** - * - * @brief De-initialize for HFP client module. This function - * should be called only after esp_bluedroid_enable() completes successfully - * - * @return - * - ESP_OK: success - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_hf_client_deinit(void); - -/** - * - * @brief Connect to remote bluetooth HFP audio gateway(AG) device, must after esp_hf_client_init() - * - * @param[in] remote_bda: remote bluetooth device address - * - * @return - * - ESP_OK: connect request is sent to lower layer - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_hf_client_connect(esp_bd_addr_t remote_bda); - -/** - * - * @brief Disconnect from the remote HFP audio gateway - * - * @param[in] remote_bda: remote bluetooth device address - * @return - * - ESP_OK: disconnect request is sent to lower layer - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_hf_client_disconnect(esp_bd_addr_t remote_bda); - -/** - * - * @brief Create audio connection with remote HFP AG. As a precondition to use this API, - * Service Level Connection shall exist with AG - * - * @param[in] remote_bda: remote bluetooth device address - * @return - * - ESP_OK: disconnect request is sent to lower layer - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_hf_client_connect_audio(esp_bd_addr_t remote_bda); - -/** - * - * @brief Release the established audio connection with remote HFP AG. - * - * @param[in] remote_bda: remote bluetooth device address - * @return - * - ESP_OK: disconnect request is sent to lower layer - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_hf_client_disconnect_audio(esp_bd_addr_t remote_bda); - -/** - * - * @brief Enable voice recognition in the AG. As a precondition to use this API, - * Service Level Connection shall exist with AG - * - * @return - * - ESP_OK: disconnect request is sent to lower layer - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_hf_client_start_voice_recognition(void); - -/** - * - * @brief Disable voice recognition in the AG. As a precondition to use this API, - * Service Level Connection shall exist with AG - * - * @return - * - ESP_OK: disconnect request is sent to lower layer - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_hf_client_stop_voice_recognition(void); - -/** - * - * @brief Volume synchronization with AG. As a precondition to use this API, - * Service Level Connection shall exist with AG - * - * @param[in] type: volume control target, speaker or microphone - * @param[in] volume: gain of the speaker of microphone, ranges 0 to 15 - * - * @return - * - ESP_OK: disconnect request is sent to lower layer - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_hf_client_volume_update(esp_hf_volume_control_target_t type, int volume); - -/** - * - * @brief Place a call with a specified number, if number is NULL, last called number is - * called. As a precondition to use this API, Service Level Connection shall - * exist with AG - * - * @param[in] number: number string of the call. If NULL, the last number is called(aka re-dial) - * - * @return - * - ESP_OK: disconnect request is sent to lower layer - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_hf_client_dial(const char *number); - -/** - * - * @brief Place a call with number specified by location(speed dial). As a precondition, - * to use this API, Service Level Connection shall exist with AG - * - * @param[in] location: location of the number in the memory - * - * @return - * - ESP_OK: disconnect request is sent to lower layer - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ - -esp_err_t esp_hf_client_dial_memory(int location); - -/** - * - * @brief Send call hold and multiparty commands, or enhanced call control commands(Use AT+CHLD). - * As a precondition to use this API, Service Level Connection shall exist with AG - * - * @param[in] chld: AT+CHLD call hold and multiparty handling AT command. - * @param[in] idx: used in Enhanced Call Control Mechanisms, used if chld is - * ESP_HF_CHLD_TYPE_REL_X or ESP_HF_CHLD_TYPE_PRIV_X - * - * @return - * - ESP_OK: disconnect request is sent to lower layer - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_hf_client_send_chld_cmd(esp_hf_chld_type_t chld, int idx); - -/** - * - * @brief Send response and hold action command(Send AT+BTRH command) - * As a precondition to use this API, Service Level Connection shall exist with AG - * - * @param[in] btrh: response and hold action to send - * - * @return - * - ESP_OK: disconnect request is sent to lower layer - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_hf_client_send_btrh_cmd(esp_hf_btrh_cmd_t btrh); - -/** - * - * @brief Answer an incoming call(send ATA command). As a precondition to use this API, - * Service Level Connection shall exist with AG - * - * @return - * - ESP_OK: disconnect request is sent to lower layer - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_hf_client_answer_call(void); - -/** - * - * @brief Reject an incoming call(send AT+CHUP command), As a precondition to use this API, - * Service Level Connection shall exist with AG - * - * @return - * - ESP_OK: disconnect request is sent to lower layer - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_hf_client_reject_call(void); - -/** - * - * @brief Query list of current calls in AG(send AT+CLCC command), As a precondition to use this API, - * Service Level Connection shall exist with AG - * - * @return - * - ESP_OK: disconnect request is sent to lower layer - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_hf_client_query_current_calls(void); - -/** - * - * @brief Query the name of currently selected network operator in AG(use AT+COPS commands) - * As a precondition to use this API, Service Level Connection shall exist with AG - * - * @return - * - ESP_OK: disconnect request is sent to lower layer - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_hf_client_query_current_operator_name(void); - -/** - * - * @brief Get subscriber information number from AG(send AT+CNUM command) - * As a precondition to use this API, Service Level Connection shall exist with AG - * - * @return - * - ESP_OK: disconnect request is sent to lower layer - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_hf_client_retrieve_subscriber_info(void); - -/** - * - * @brief Transmit DTMF codes during an ongoing call(use AT+VTS commands) - * As a precondition to use this API, Service Level Connection shall exist with AG - * - * @param[in] code: dtmf code, single ascii character in the set 0-9, #, *, A-D - * - * @return - * - ESP_OK: disconnect request is sent to lower layer - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_hf_client_send_dtmf(char code); - -/** - * - * @brief Request a phone number from AG corresponding to last voice tag recorded - * (send AT+BINP command). As a precondition to use this API, Service Level - * Connection shall exist with AG - * - * @return - * - ESP_OK: disconnect request is sent to lower layer - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: others - * - */ -esp_err_t esp_hf_client_request_last_voice_tag_number(void); - -/** - * @brief Register HFP client data output function; the callback is only used in - * the case that Voice Over HCI is enabled. - * - * @param[in] recv: HFP client incoming data callback function - * @param[in] send: HFP client outgoing data callback function - * - * @return - * - ESP_OK: success - * - ESP_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_FAIL: if callback is a NULL function pointer - * - */ -esp_err_t esp_hf_client_register_data_callback(esp_hf_client_incoming_data_cb_t recv, - esp_hf_client_outgoing_data_cb_t send); - -/** - * @brief Trigger the lower-layer to fetch and send audio data. This function is only - * only used in the case that Voice Over HCI is enabled. Precondition is that - * the HFP audio connection is connected. After this function is called, lower - * layer will invoke esp_hf_client_outgoing_data_cb_t to fetch data - * - */ -void esp_hf_client_outgoing_data_ready(void); - - -/** - * @brief Initialize the down sampling converter. This is a utility function that can - * only be used in the case that Voice Over HCI is enabled. - * - * @param[in] src_sps: original samples per second(source audio data, i.e. 48000, 32000, - * 16000, 44100, 22050, 11025) - * @param[in] bits: number of bits per pcm sample (16) - * @param[in] channels: number of channels (i.e. mono(1), stereo(2)...) - */ -void esp_hf_client_pcm_resample_init(uint32_t src_sps, uint32_t bits, uint32_t channels); - -/** - * @brief Down sampling utility to convert high sampling rate into 8K/16bits 1-channel mode PCM - * samples. This can only be used in the case that Voice Over HCI is enabled. - * - * @param[in] src: pointer to the buffer where the original sampling PCM are stored - * @param[in] in_bytes: length of the input PCM sample buffer in byte - * @param[in] dst: pointer to the buffer which is to be used to store the converted PCM samples - * - * @return number of samples converted - */ -int32_t esp_hf_client_pcm_resample(void *src, uint32_t in_bytes, void *dst); - -#ifdef __cplusplus -} -#endif - - -#endif /* __ESP_HF_CLIENT_API_H__ */ diff --git a/tools/sdk/include/bt/esp_hf_defs.h b/tools/sdk/include/bt/esp_hf_defs.h deleted file mode 100644 index 1ff9f14f6e7..00000000000 --- a/tools/sdk/include/bt/esp_hf_defs.h +++ /dev/null @@ -1,181 +0,0 @@ -// 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. - -#ifndef __ESP_HF_DEFS_H__ -#define __ESP_HF_DEFS_H__ - -#include "esp_bt_defs.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -/// Bluetooth HFP audio volume control target -typedef enum { - ESP_HF_VOLUME_CONTROL_TARGET_SPK = 0, /*!< speaker */ - ESP_HF_VOLUME_CONTROL_TARGET_MIC, /*!< microphone */ -} esp_hf_volume_control_target_t; - -/// +CIND roaming status indicator values -typedef enum { - ESP_HF_ROAMING_STATUS_INACTIVE = 0, /*!< roaming is not active */ - ESP_HF_ROAMING_STATUS_ACTIVE, /*!< a roaming is active */ -} esp_hf_roaming_status_t; - -/// +CIND call status indicator values -typedef enum { - ESP_HF_CALL_STATUS_NO_CALLS = 0, /*!< no call in progress */ - ESP_HF_CALL_STATUS_CALL_IN_PROGRESS = 1, /*!< call is present(active or held) */ -} esp_hf_call_status_t; - -/// +CIND call setup status indicator values -typedef enum { - ESP_HF_CALL_SETUP_STATUS_NONE = 0, /*!< no call setup in progress */ - ESP_HF_CALL_SETUP_STATUS_INCOMING = 1, /*!< incoming call setup in progress */ - ESP_HF_CALL_SETUP_STATUS_OUTGOING_DIALING = 2, /*!< outgoing call setup in dialing state */ - ESP_HF_CALL_SETUP_STATUS_OUTGOING_ALERTING = 3, /*!< outgoing call setup in alerting state */ -} esp_hf_call_setup_status_t; - -/// +CIND call held indicator values -typedef enum { - ESP_HF_CALL_HELD_STATUS_NONE = 0, /*!< no calls held */ - ESP_HF_CALL_HELD_STATUS_HELD_AND_ACTIVE = 1, /*!< both active and held call */ - ESP_HF_CALL_HELD_STATUS_HELD = 2, /*!< call on hold, no active call*/ -} esp_hf_call_held_status_t; - -/// +CIND network service availability status -typedef enum { - ESP_HF_SERVICE_AVAILABILITY_STATUS_UNAVAILABLE = 0, /*!< service not available */ - ESP_HF_SERVICE_AVAILABILITY_STATUS_AVAILABLE, /*!< service available */ -} esp_hf_service_availability_status_t; - -/// +CLCC status of the call -typedef enum { - ESP_HF_CURRENT_CALL_STATUS_ACTIVE = 0, /*!< active */ - ESP_HF_CURRENT_CALL_STATUS_HELD = 1, /*!< held */ - ESP_HF_CURRENT_CALL_STATUS_DIALING = 2, /*!< dialing (outgoing calls only) */ - ESP_HF_CURRENT_CALL_STATUS_ALERTING = 3, /*!< alerting (outgoing calls only) */ - ESP_HF_CURRENT_CALL_STATUS_INCOMING = 4, /*!< incoming (incoming calls only) */ - ESP_HF_CURRENT_CALL_STATUS_WAITING = 5, /*!< waiting (incoming calls only) */ - ESP_HF_CURRENT_CALL_STATUS_HELD_BY_RESP_HOLD = 6, /*!< call held by response and hold */ -} esp_hf_current_call_status_t; - -/// +CLCC direction of the call -typedef enum { - ESP_HF_CURRENT_CALL_DIRECTION_OUTGOING = 0, /*!< outgoing */ - ESP_HF_CURRENT_CALL_DIRECTION_INCOMING = 1, /*!< incoming */ -} esp_hf_current_call_direction_t; - -/// +CLCC multi-party call flag -typedef enum { - ESP_HF_CURRENT_CALL_MPTY_TYPE_SINGLE = 0, /*!< not a member of a multi-party call */ - ESP_HF_CURRENT_CALL_MPTY_TYPE_MULTI = 1, /*!< member of a multi-party call */ -} esp_hf_current_call_mpty_type_t; - -/// +CLCC call mode -typedef enum { - ESP_HF_CURRENT_CALL_MODE_VOICE = 0, - ESP_HF_CURRENT_CALL_MODE_DATA = 1, - ESP_HF_CURRENT_CALL_MODE_FAX = 2, -} esp_hf_current_call_mode_t; - -/// +CLCC address type -typedef enum { - ESP_HF_CALL_ADDR_TYPE_UNKNOWN = 0x81, /*!< unkown address type */ - ESP_HF_CALL_ADDR_TYPE_INTERNATIONAL = 0x91, /*!< international address */ -} esp_hf_call_addr_type_t; - -/// +CNUM service type of the phone number -typedef enum { - ESP_HF_SUBSCRIBER_SERVICE_TYPE_UNKNOWN = 0, /*!< unknown */ - ESP_HF_SUBSCRIBER_SERVICE_TYPE_VOICE, /*!< voice service */ - ESP_HF_SUBSCRIBER_SERVICE_TYPE_FAX, /*!< fax service */ -} esp_hf_subscriber_service_type_t; - -/// +BTRH response and hold result code -typedef enum { - ESP_HF_BTRH_STATUS_HELD = 0, /*!< incoming call is put on held in AG */ - ESP_HF_BTRH_STATUS_ACCEPTED, /*!< held incoming call is accepted in AG */ - ESP_HF_BTRH_STATUS_REJECTED, /*!< held incoming call is rejected in AG */ -} esp_hf_btrh_status_t; - -/// AT+BTRH response and hold action code -typedef enum { - ESP_HF_BTRH_CMD_HOLD = 0, /*!< put the incoming call on hold */ - ESP_HF_BTRH_CMD_ACCEPT = 1, /*!< accept a held incoming call */ - ESP_HF_BTRH_CMD_REJECT = 2, /*!< reject a held incoming call */ -} esp_hf_btrh_cmd_t; - -/// response indication codes for AT commands -typedef enum { - ESP_HF_AT_RESPONSE_CODE_OK = 0, /*!< acknowledges execution of a command line */ - ESP_HF_AT_RESPONSE_CODE_ERR, /*!< command not accepted */ - ESP_HF_AT_RESPONSE_CODE_NO_CARRIER, /*!< connection terminated */ - ESP_HF_AT_RESPONSE_CODE_BUSY, /*!< busy signal detected */ - ESP_HF_AT_RESPONSE_CODE_NO_ANSWER, /*!< connection completion timeout */ - ESP_HF_AT_RESPONSE_CODE_DELAYED, /*!< delayed */ - ESP_HF_AT_RESPONSE_CODE_BLACKLISTED, /*!< blacklisted */ - ESP_HF_AT_RESPONSE_CODE_CME, /*!< CME error */ -} esp_hf_at_response_code_t; - -/// voice recognition state -typedef enum { - ESP_HF_VR_STATE_DISABLED = 0, /*!< voice recognition disabled */ - ESP_HF_VR_STATE_ENABLED, /*!< voice recognition enabled */ -} esp_hf_vr_state_t; - -/// AT+CHLD command values -typedef enum { - ESP_HF_CHLD_TYPE_REL = 0, /*!< <0>, Terminate all held or set UDUB("busy") to a waiting call */ - ESP_HF_CHLD_TYPE_REL_ACC, /*!< <1>, Terminate all active calls and accepts a waiting/held call */ - ESP_HF_CHLD_TYPE_HOLD_ACC, /*!< <2>, Hold all active calls and accepts a waiting/held call */ - ESP_HF_CHLD_TYPE_MERGE, /*!< <3>, Add all held calls to a conference */ - ESP_HF_CHLD_TYPE_MERGE_DETACH, /*!< <4>, connect the two calls and disconnects the subscriber from both calls */ - ESP_HF_CHLD_TYPE_REL_X, /*!< <1x>, releases specified calls only */ - ESP_HF_CHLD_TYPE_PRIV_X, /*!< <2x>, request private consultation mode with specified call */ -} esp_hf_chld_type_t; - -/// Extended Audio Gateway Error Result Code Response -typedef enum { - ESP_HF_CME_AG_FAILURE = 0, /*!< ag failure */ - ESP_HF_CME_NO_CONNECTION_TO_PHONE = 1, /*!< no connection to phone */ - ESP_HF_CME_OPERATION_NOT_ALLOWED = 3, /*!< operation not allowed */ - ESP_HF_CME_OPERATION_NOT_SUPPORTED = 4, /*!< operation not supported */ - ESP_HF_CME_PH_SIM_PIN_REQUIRED = 5, /*!< PH-SIM PIN Required */ - ESP_HF_CME_SIM_NOT_INSERTED = 10, /*!< SIM not inserted */ - ESP_HF_CME_SIM_PIN_REQUIRED = 11, /*!< SIM PIN required */ - ESP_HF_CME_SIM_PUK_REQUIRED = 12, /*!< SIM PUK required */ - ESP_HF_CME_SIM_FAILURE = 13, /*!< SIM failure */ - ESP_HF_CME_SIM_BUSY = 14, /*!< SIM busy */ - ESP_HF_CME_INCORRECT_PASSWORD = 16, /*!< incorrect password */ - ESP_HF_CME_SIM_PIN2_REQUIRED = 17, /*!< SIM PIN2 required */ - ESP_HF_CME_SIM_PUK2_REQUIRED = 18, /*!< SIM PUK2 required */ - ESP_HF_CME_MEMEORY_FULL = 20, /*!< memory full */ - ESP_HF_CME_INVALID_INDEX = 21, /*!< invalid index */ - ESP_HF_CME_MEMEORY_FAILURE = 23, /*!< memory failure */ - ESP_HF_CME_TEXT_STRING_TOO_LONG = 24, /*!< test string too long */ - ESP_HF_CME_INVALID_CHARACTERS_IN_TEXT_STRING = 25, /*!< invalid characters in text string */ - ESP_HF_CME_DIAL_STRING_TOO_LONG = 26, /*!< dial string too long*/ - ESP_HF_CME_INVALID_CHARACTERS_IN_DIAL_STRING = 27, /*!< invalid characters in dial string */ - ESP_HF_CME_NO_NETWORK_SERVICE = 30, /*!< no network service */ - ESP_HF_CME_NETWORK_TIMEOUT = 31, /*!< network timeout */ - ESP_HF_CME_NETWORK_NOT_ALLOWED = 32, /*!< network not allowed --emergency calls only */ -} esp_hf_cme_err_t; - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_HF_DEFS_H__ */ diff --git a/tools/sdk/include/bt/esp_spp_api.h b/tools/sdk/include/bt/esp_spp_api.h deleted file mode 100644 index 31bcf1c687f..00000000000 --- a/tools/sdk/include/bt/esp_spp_api.h +++ /dev/null @@ -1,304 +0,0 @@ -// 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. - -#ifndef __ESP_SPP_API_H__ -#define __ESP_SPP_API_H__ - -#include "esp_err.h" -#include "esp_bt_defs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - ESP_SPP_SUCCESS = 0, /*!< Successful operation. */ - ESP_SPP_FAILURE, /*!< Generic failure. */ - ESP_SPP_BUSY, /*!< Temporarily can not handle this request. */ - ESP_SPP_NO_DATA, /*!< no data. */ - ESP_SPP_NO_RESOURCE /*!< No more set pm control block */ -} esp_spp_status_t; - -/* Security Setting Mask */ -#define ESP_SPP_SEC_NONE 0x0000 /*!< No security. relate to BTA_SEC_NONE in bta/bta_api.h */ -#define ESP_SPP_SEC_AUTHORIZE 0x0001 /*!< Authorization required (only needed for out going connection ) relate to BTA_SEC_AUTHORIZE in bta/bta_api.h*/ -#define ESP_SPP_SEC_AUTHENTICATE 0x0012 /*!< Authentication required. relate to BTA_SEC_AUTHENTICATE in bta/bta_api.h*/ -#define ESP_SPP_SEC_ENCRYPT 0x0024 /*!< Encryption required. relate to BTA_SEC_ENCRYPT in bta/bta_api.h*/ -#define ESP_SPP_SEC_MODE4_LEVEL4 0x0040 /*!< Mode 4 level 4 service, i.e. incoming/outgoing MITM and P-256 encryption relate to BTA_SEC_MODE4_LEVEL4 in bta/bta_api.h*/ -#define ESP_SPP_SEC_MITM 0x3000 /*!< Man-In-The_Middle protection relate to BTA_SEC_MITM in bta/bta_api.h*/ -#define ESP_SPP_SEC_IN_16_DIGITS 0x4000 /*!< Min 16 digit for pin code relate to BTA_SEC_IN_16_DIGITS in bta/bta_api.h*/ -typedef uint16_t esp_spp_sec_t; - -typedef enum { - ESP_SPP_ROLE_MASTER = 0, /*!< Role: master */ - ESP_SPP_ROLE_SLAVE = 1, /*!< Role: slave */ -} esp_spp_role_t; - -typedef enum { - ESP_SPP_MODE_CB = 0, /*!< When data is coming, a callback will come with data */ - ESP_SPP_MODE_VFS = 1, /*!< Use VFS to write/read data */ -} esp_spp_mode_t; - -#define ESP_SPP_MAX_MTU (3*330) /*!< SPP max MTU */ -#define ESP_SPP_MAX_SCN 31 /*!< SPP max SCN */ -/** - * @brief SPP callback function events - */ -typedef enum { - ESP_SPP_INIT_EVT = 0, /*!< When SPP is inited, the event comes */ - ESP_SPP_DISCOVERY_COMP_EVT = 8, /*!< When SDP discovery complete, the event comes */ - ESP_SPP_OPEN_EVT = 26, /*!< When SPP Client connection open, the event comes */ - ESP_SPP_CLOSE_EVT = 27, /*!< When SPP connection closed, the event comes */ - ESP_SPP_START_EVT = 28, /*!< When SPP server started, the event comes */ - ESP_SPP_CL_INIT_EVT = 29, /*!< When SPP client initiated a connection, the event comes */ - ESP_SPP_DATA_IND_EVT = 30, /*!< When SPP connection received data, the event comes, only for ESP_SPP_MODE_CB */ - ESP_SPP_CONG_EVT = 31, /*!< When SPP connection congestion status changed, the event comes, only for ESP_SPP_MODE_CB */ - ESP_SPP_WRITE_EVT = 33, /*!< When SPP write operation completes, the event comes, only for ESP_SPP_MODE_CB */ - ESP_SPP_SRV_OPEN_EVT = 34, /*!< When SPP Server connection open, the event comes */ -} esp_spp_cb_event_t; - - -/** - * @brief SPP callback parameters union - */ -typedef union { - /** - * @brief SPP_INIT_EVT - */ - struct spp_init_evt_param { - esp_spp_status_t status; /*!< status */ - } init; /*!< SPP callback param of SPP_INIT_EVT */ - - /** - * @brief SPP_DISCOVERY_COMP_EVT - */ - struct spp_discovery_comp_evt_param { - esp_spp_status_t status; /*!< status */ - uint8_t scn_num; /*!< The num of scn_num */ - uint8_t scn[ESP_SPP_MAX_SCN]; /*!< channel # */ - } disc_comp; /*!< SPP callback param of SPP_DISCOVERY_COMP_EVT */ - - /** - * @brief ESP_SPP_OPEN_EVT - */ - struct spp_open_evt_param { - esp_spp_status_t status; /*!< status */ - uint32_t handle; /*!< The connection handle */ - int fd; /*!< The file descriptor only for ESP_SPP_MODE_VFS */ - esp_bd_addr_t rem_bda; /*!< The peer address */ - } open; /*!< SPP callback param of ESP_SPP_OPEN_EVT */ - - /** - * @brief ESP_SPP_SRV_OPEN_EVT - */ - struct spp_srv_open_evt_param { - esp_spp_status_t status; /*!< status */ - uint32_t handle; /*!< The connection handle */ - uint32_t new_listen_handle; /*!< The new listen handle */ - int fd; /*!< The file descriptor only for ESP_SPP_MODE_VFS */ - esp_bd_addr_t rem_bda; /*!< The peer address */ - } srv_open; /*!< SPP callback param of ESP_SPP_SRV_OPEN_EVT */ - /** - * @brief ESP_SPP_CLOSE_EVT - */ - struct spp_close_evt_param { - esp_spp_status_t status; /*!< status */ - uint32_t port_status; /*!< PORT status */ - uint32_t handle; /*!< The connection handle */ - bool async; /*!< FALSE, if local initiates disconnect */ - } close; /*!< SPP callback param of ESP_SPP_CLOSE_EVT */ - - /** - * @brief ESP_SPP_START_EVT - */ - struct spp_start_evt_param { - esp_spp_status_t status; /*!< status */ - uint32_t handle; /*!< The connection handle */ - uint8_t sec_id; /*!< security ID used by this server */ - bool use_co; /*!< TRUE to use co_rfc_data */ - } start; /*!< SPP callback param of ESP_SPP_START_EVT */ - /** - * @brief ESP_SPP_CL_INIT_EVT - */ - struct spp_cl_init_evt_param { - esp_spp_status_t status; /*!< status */ - uint32_t handle; /*!< The connection handle */ - uint8_t sec_id; /*!< security ID used by this server */ - bool use_co; /*!< TRUE to use co_rfc_data */ - } cl_init; /*!< SPP callback param of ESP_SPP_CL_INIT_EVT */ - - /** - * @brief ESP_SPP_WRITE_EVT - */ - struct spp_write_evt_param { - esp_spp_status_t status; /*!< status */ - uint32_t handle; /*!< The connection handle */ - int len; /*!< The length of the data written. */ - bool cong; /*!< congestion status */ - } write; /*!< SPP callback param of ESP_SPP_WRITE_EVT */ - - /** - * @brief ESP_SPP_DATA_IND_EVT - */ - struct spp_data_ind_evt_param { - esp_spp_status_t status; /*!< status */ - uint32_t handle; /*!< The connection handle */ - uint16_t len; /*!< The length of data */ - uint8_t *data; /*!< The data received */ - } data_ind; /*!< SPP callback param of ESP_SPP_DATA_IND_EVT */ - - /** - * @brief ESP_SPP_CONG_EVT - */ - struct spp_cong_evt_param { - esp_spp_status_t status; /*!< status */ - uint32_t handle; /*!< The connection handle */ - bool cong; /*!< TRUE, congested. FALSE, uncongested */ - } cong; /*!< SPP callback param of ESP_SPP_CONG_EVT */ -} esp_spp_cb_param_t; /*!< SPP callback parameter union type */ - -/** - * @brief SPP callback function type - * @param event: Event type - * @param param: Point to callback parameter, currently is union type - */ -typedef void (esp_spp_cb_t)(esp_spp_cb_event_t event, esp_spp_cb_param_t *param); - -/** - * @brief This function is called to init callbacks - * with SPP module. - * - * @param[in] callback: pointer to the init callback function. - * - * @return - * - ESP_OK: success - * - other: failed - */ -esp_err_t esp_spp_register_callback(esp_spp_cb_t callback); - -/** - * @brief This function is called to init SPP. - * - * @param[in] mode: Choose the mode of SPP, ESP_SPP_MODE_CB or ESP_SPP_MODE_VFS. - * - * @return - * - ESP_OK: success - * - other: failed - */ -esp_err_t esp_spp_init(esp_spp_mode_t mode); - -/** - * @brief This function is called to uninit SPP. - * - * @return - * - ESP_OK: success - * - other: failed - */ -esp_err_t esp_spp_deinit(); - - -/** - * @brief This function is called to performs service discovery for - * the services provided by the given peer device. When the - * operation is complete the callback function will be called - * with a ESP_SPP_DISCOVERY_COMP_EVT. - * - * @param[in] bd_addr: Remote device bluetooth device address. - * - * @return - * - ESP_OK: success - * - other: failed - */ -esp_err_t esp_spp_start_discovery(esp_bd_addr_t bd_addr); - -/** - * @brief This function makes an SPP connection to a remote BD Address. - * When the connection is initiated or failed to initiate, - * the callback is called with ESP_SPP_CL_INIT_EVT. - * When the connection is established or failed, - * the callback is called with ESP_SPP_OPEN_EVT. - * - * @param[in] sec_mask: Security Setting Mask . - * @param[in] role: Master or slave. - * @param[in] remote_scn: Remote device bluetooth device SCN. - * @param[in] peer_bd_addr: Remote device bluetooth device address. - * - * @return - * - ESP_OK: success - * - other: failed - */ -esp_err_t esp_spp_connect(esp_spp_sec_t sec_mask, - esp_spp_role_t role, uint8_t remote_scn, esp_bd_addr_t peer_bd_addr); - -/** - * @brief This function closes an SPP connection. - * - * @param[in] handle: The connection handle. - * - * @return - * - ESP_OK: success - * - other: failed - */ -esp_err_t esp_spp_disconnect(uint32_t handle); - -/** - * @brief This function create a SPP server and starts listening for an - * SPP connection request from a remote Bluetooth device. - * When the server is started successfully, the callback is called - * with ESP_SPP_START_EVT. - * When the connection is established, the callback is called - * with ESP_SPP_SRV_OPEN_EVT. - * - * @param[in] sec_mask: Security Setting Mask . - * @param[in] role: Master or slave. - * @param[in] local_scn: The specific channel you want to get. - * If channel is 0, means get any channel. - * @param[in] name: Server's name. - * - * @return - * - ESP_OK: success - * - other: failed - */ -esp_err_t esp_spp_start_srv(esp_spp_sec_t sec_mask, - esp_spp_role_t role, uint8_t local_scn, const char *name); - - -/** - * @brief This function is used to write data, only for ESP_SPP_MODE_CB. - * - * @param[in] handle: The connection handle. - * @param[in] len: The length of the data written. - * @param[in] p_data: The data written. - * - * @return - * - ESP_OK: success - * - other: failed - */ -esp_err_t esp_spp_write(uint32_t handle, int len, uint8_t *p_data); - - -/** - * @brief This function is used to register VFS. - * - * @return - * - ESP_OK: success - * - other: failed - */ -esp_err_t esp_spp_vfs_register(void); - -#ifdef __cplusplus -} -#endif - -#endif ///__ESP_SPP_API_H__ diff --git a/tools/sdk/include/coap/address.h b/tools/sdk/include/coap/address.h deleted file mode 100644 index 85db2046e36..00000000000 --- a/tools/sdk/include/coap/address.h +++ /dev/null @@ -1,152 +0,0 @@ -/* - * address.h -- representation of network addresses - * - * Copyright (C) 2010-2011,2015-2016 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -/** - * @file address.h - * @brief Representation of network addresses - */ - -#ifndef _COAP_ADDRESS_H_ -#define _COAP_ADDRESS_H_ - -#include -#include -#include -#include -#include "libcoap.h" - -#ifdef WITH_LWIP -#include - -typedef struct coap_address_t { - uint16_t port; - ip_addr_t addr; -} coap_address_t; - -#define _coap_address_equals_impl(A, B) (!!ip_addr_cmp(&(A)->addr,&(B)->addr)) - -#define _coap_address_isany_impl(A) ip_addr_isany(&(A)->addr) - -#define _coap_is_mcast_impl(Address) ip_addr_ismulticast(&(Address)->addr) -#endif /* WITH_LWIP */ - -#ifdef WITH_CONTIKI -#include "uip.h" - -typedef struct coap_address_t { - uip_ipaddr_t addr; - unsigned short port; -} coap_address_t; - -#define _coap_address_equals_impl(A,B) \ - ((A)->port == (B)->port \ - && uip_ipaddr_cmp(&((A)->addr),&((B)->addr))) - -/** @todo implementation of _coap_address_isany_impl() for Contiki */ -#define _coap_address_isany_impl(A) 0 - -#define _coap_is_mcast_impl(Address) uip_is_addr_mcast(&((Address)->addr)) -#endif /* WITH_CONTIKI */ - -#ifdef WITH_POSIX -/** multi-purpose address abstraction */ -typedef struct coap_address_t { - socklen_t size; /**< size of addr */ - union { - struct sockaddr sa; - struct sockaddr_storage st; - struct sockaddr_in sin; - struct sockaddr_in6 sin6; - } addr; -} coap_address_t; - -/** - * Compares given address objects @p a and @p b. This function returns @c 1 if - * addresses are equal, @c 0 otherwise. The parameters @p a and @p b must not be - * @c NULL; - */ -int coap_address_equals(const coap_address_t *a, const coap_address_t *b); - -static inline int -_coap_address_isany_impl(const coap_address_t *a) { - /* need to compare only relevant parts of sockaddr_in6 */ - switch (a->addr.sa.sa_family) { - case AF_INET: - return a->addr.sin.sin_addr.s_addr == INADDR_ANY; - case AF_INET6: - return memcmp(&in6addr_any, - &a->addr.sin6.sin6_addr, - sizeof(in6addr_any)) == 0; - default: - ; - } - - return 0; -} -#endif /* WITH_POSIX */ - -/** - * Resets the given coap_address_t object @p addr to its default values. In - * particular, the member size must be initialized to the available size for - * storing addresses. - * - * @param addr The coap_address_t object to initialize. - */ -static inline void -coap_address_init(coap_address_t *addr) { - assert(addr); - memset(addr, 0, sizeof(coap_address_t)); -#ifdef WITH_POSIX - /* lwip and Contiki have constant address sizes and doesn't need the .size part */ - addr->size = sizeof(addr->addr); -#endif -} - -#ifndef WITH_POSIX -/** - * Compares given address objects @p a and @p b. This function returns @c 1 if - * addresses are equal, @c 0 otherwise. The parameters @p a and @p b must not be - * @c NULL; - */ -static inline int -coap_address_equals(const coap_address_t *a, const coap_address_t *b) { - assert(a); assert(b); - return _coap_address_equals_impl(a, b); -} -#endif - -/** - * Checks if given address object @p a denotes the wildcard address. This - * function returns @c 1 if this is the case, @c 0 otherwise. The parameters @p - * a must not be @c NULL; - */ -static inline int -coap_address_isany(const coap_address_t *a) { - assert(a); - return _coap_address_isany_impl(a); -} - -#ifdef WITH_POSIX -/** - * Checks if given address @p a denotes a multicast address. This function - * returns @c 1 if @p a is multicast, @c 0 otherwise. - */ -int coap_is_mcast(const coap_address_t *a); -#else /* WITH_POSIX */ -/** - * Checks if given address @p a denotes a multicast address. This function - * returns @c 1 if @p a is multicast, @c 0 otherwise. - */ -static inline int -coap_is_mcast(const coap_address_t *a) { - return a && _coap_is_mcast_impl(a); -} -#endif /* WITH_POSIX */ - -#endif /* _COAP_ADDRESS_H_ */ diff --git a/tools/sdk/include/coap/async.h b/tools/sdk/include/coap/async.h deleted file mode 100644 index 0c36defacdb..00000000000 --- a/tools/sdk/include/coap/async.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - * async.h -- state management for asynchronous messages - * - * Copyright (C) 2010-2011 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -/** - * @file async.h - * @brief State management for asynchronous messages - */ - -#ifndef _COAP_ASYNC_H_ -#define _COAP_ASYNC_H_ - -#include "net.h" - -#ifndef WITHOUT_ASYNC - -/** - * @defgroup coap_async Asynchronous Messaging - * @{ - * Structure for managing asynchronous state of CoAP resources. A - * coap_resource_t object holds a list of coap_async_state_t objects that can be - * used to generate a separate response in case a result of an operation cannot - * be delivered in time, or the resource has been explicitly subscribed to with - * the option @c observe. - */ -typedef struct coap_async_state_t { - unsigned char flags; /**< holds the flags to control behaviour */ - - /** - * Holds the internal time when the object was registered with a - * resource. This field will be updated whenever - * coap_register_async() is called for a specific resource. - */ - coap_tick_t created; - - /** - * This field can be used to register opaque application data with the - * asynchronous state object. - */ - void *appdata; - unsigned short message_id; /**< id of last message seen */ - coap_tid_t id; /**< transaction id */ - struct coap_async_state_t *next; /**< internally used for linking */ - coap_address_t peer; /**< the peer to notify */ - size_t tokenlen; /**< length of the token */ - unsigned char token[]; /**< the token to use in a response */ -} coap_async_state_t; - -/* Definitions for Async Status Flags These flags can be used to control the - * behaviour of asynchronous response generation. - */ -#define COAP_ASYNC_CONFIRM 0x01 /**< send confirmable response */ -#define COAP_ASYNC_SEPARATE 0x02 /**< send separate response */ -#define COAP_ASYNC_OBSERVED 0x04 /**< the resource is being observed */ - -/** release application data on destruction */ -#define COAP_ASYNC_RELEASE_DATA 0x08 - -/** - * Allocates a new coap_async_state_t object and fills its fields according to - * the given @p request. The @p flags are used to control generation of empty - * ACK responses to stop retransmissions and to release registered @p data when - * the resource is deleted by coap_free_async(). This function returns a pointer - * to the registered coap_async_t object or @c NULL on error. Note that this - * function will return @c NULL in case that an object with the same identifier - * is already registered. - * - * @param context The context to use. - * @param peer The remote peer that is to be asynchronously notified. - * @param request The request that is handled asynchronously. - * @param flags Flags to control state management. - * @param data Opaque application data to register. Note that the - * storage occupied by @p data is released on destruction - * only if flag COAP_ASYNC_RELEASE_DATA is set. - * - * @return A pointer to the registered coap_async_state_t object or @c - * NULL in case of an error. - */ -coap_async_state_t * -coap_register_async(coap_context_t *context, - coap_address_t *peer, - coap_pdu_t *request, - unsigned char flags, - void *data); - -/** - * Removes the state object identified by @p id from @p context. The removed - * object is returned in @p s, if found. Otherwise, @p s is undefined. This - * function returns @c 1 if the object was removed, @c 0 otherwise. Note that - * the storage allocated for the stored object is not released by this - * functions. You will have to call coap_free_async() to do so. - * - * @param context The context where the async object is registered. - * @param id The identifier of the asynchronous transaction. - * @param s Will be set to the object identified by @p id after removal. - * - * @return @c 1 if object was removed and @p s updated, or @c 0 if no - * object was found with the given id. @p s is valid only if the - * return value is @c 1. - */ -int coap_remove_async(coap_context_t *context, - coap_tid_t id, - coap_async_state_t **s); - -/** - * Releases the memory that was allocated by coap_async_state_init() for the - * object @p s. The registered application data will be released automatically - * if COAP_ASYNC_RELEASE_DATA is set. - * - * @param state The object to delete. - */ -void -coap_free_async(coap_async_state_t *state); - -/** - * Retrieves the object identified by @p id from the list of asynchronous - * transactions that are registered with @p context. This function returns a - * pointer to that object or @c NULL if not found. - * - * @param context The context where the asynchronous objects are registered - * with. - * @param id The id of the object to retrieve. - * - * @return A pointer to the object identified by @p id or @c NULL if - * not found. - */ -coap_async_state_t *coap_find_async(coap_context_t *context, coap_tid_t id); - -/** - * Updates the time stamp of @p s. - * - * @param s The state object to update. - */ -static inline void -coap_touch_async(coap_async_state_t *s) { coap_ticks(&s->created); } - -/** @} */ - -#endif /* WITHOUT_ASYNC */ - -#endif /* _COAP_ASYNC_H_ */ diff --git a/tools/sdk/include/coap/bits.h b/tools/sdk/include/coap/bits.h deleted file mode 100644 index 0b269166d57..00000000000 --- a/tools/sdk/include/coap/bits.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * bits.h -- bit vector manipulation - * - * Copyright (C) 2010-2011 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -/** - * @file bits.h - * @brief Bit vector manipulation - */ - -#ifndef _COAP_BITS_H_ -#define _COAP_BITS_H_ - -#include - -/** - * Sets the bit @p bit in bit-vector @p vec. This function returns @c 1 if bit - * was set or @c -1 on error (i.e. when the given bit does not fit in the - * vector). - * - * @param vec The bit-vector to change. - * @param size The size of @p vec in bytes. - * @param bit The bit to set in @p vec. - * - * @return @c -1 if @p bit does not fit into @p vec, @c 1 otherwise. - */ -inline static int -bits_setb(uint8_t *vec, size_t size, uint8_t bit) { - if (size <= (bit >> 3)) - return -1; - - *(vec + (bit >> 3)) |= (uint8_t)(1 << (bit & 0x07)); - return 1; -} - -/** - * Clears the bit @p bit from bit-vector @p vec. This function returns @c 1 if - * bit was cleared or @c -1 on error (i.e. when the given bit does not fit in - * the vector). - * - * @param vec The bit-vector to change. - * @param size The size of @p vec in bytes. - * @param bit The bit to clear from @p vec. - * - * @return @c -1 if @p bit does not fit into @p vec, @c 1 otherwise. - */ -inline static int -bits_clrb(uint8_t *vec, size_t size, uint8_t bit) { - if (size <= (bit >> 3)) - return -1; - - *(vec + (bit >> 3)) &= (uint8_t)(~(1 << (bit & 0x07))); - return 1; -} - -/** - * Gets the status of bit @p bit from bit-vector @p vec. This function returns - * @c 1 if the bit is set, @c 0 otherwise (even in case of an error). - * - * @param vec The bit-vector to read from. - * @param size The size of @p vec in bytes. - * @param bit The bit to get from @p vec. - * - * @return @c 1 if the bit is set, @c 0 otherwise. - */ -inline static int -bits_getb(const uint8_t *vec, size_t size, uint8_t bit) { - if (size <= (bit >> 3)) - return -1; - - return (*(vec + (bit >> 3)) & (1 << (bit & 0x07))) != 0; -} - -#endif /* _COAP_BITS_H_ */ diff --git a/tools/sdk/include/coap/block.h b/tools/sdk/include/coap/block.h deleted file mode 100644 index 9ce00311cc4..00000000000 --- a/tools/sdk/include/coap/block.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * block.h -- block transfer - * - * Copyright (C) 2010-2012,2014-2015 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -#ifndef _COAP_BLOCK_H_ -#define _COAP_BLOCK_H_ - -#include "encode.h" -#include "option.h" -#include "pdu.h" - -/** - * @defgroup block Block Transfer - * @{ - */ - -#ifndef COAP_MAX_BLOCK_SZX -/** - * The largest value for the SZX component in a Block option. Note that - * 1 << (COAP_MAX_BLOCK_SZX + 4) should not exceed COAP_MAX_PDU_SIZE. - */ -#define COAP_MAX_BLOCK_SZX 4 -#endif /* COAP_MAX_BLOCK_SZX */ - -/** - * Structure of Block options. - */ -typedef struct { - unsigned int num; /**< block number */ - unsigned int m:1; /**< 1 if more blocks follow, 0 otherwise */ - unsigned int szx:3; /**< block size */ -} coap_block_t; - -/** - * Returns the value of the least significant byte of a Block option @p opt. - * For zero-length options (i.e. num == m == szx == 0), COAP_OPT_BLOCK_LAST - * returns @c NULL. - */ -#define COAP_OPT_BLOCK_LAST(opt) \ - (COAP_OPT_LENGTH(opt) ? (COAP_OPT_VALUE(opt) + (COAP_OPT_LENGTH(opt)-1)) : 0) - -/** Returns the value of the More-bit of a Block option @p opt. */ -#define COAP_OPT_BLOCK_MORE(opt) \ - (COAP_OPT_LENGTH(opt) ? (*COAP_OPT_BLOCK_LAST(opt) & 0x08) : 0) - -/** Returns the value of the SZX-field of a Block option @p opt. */ -#define COAP_OPT_BLOCK_SZX(opt) \ - (COAP_OPT_LENGTH(opt) ? (*COAP_OPT_BLOCK_LAST(opt) & 0x07) : 0) - -/** - * Returns the value of field @c num in the given block option @p block_opt. - */ -unsigned int coap_opt_block_num(const coap_opt_t *block_opt); - -/** - * Checks if more than @p num blocks are required to deliver @p data_len - * bytes of data for a block size of 1 << (@p szx + 4). - */ -static inline int -coap_more_blocks(size_t data_len, unsigned int num, unsigned short szx) { - return ((num+1) << (szx + 4)) < data_len; -} - -/** Sets the More-bit in @p block_opt */ -static inline void -coap_opt_block_set_m(coap_opt_t *block_opt, int m) { - if (m) - *(COAP_OPT_VALUE(block_opt) + (COAP_OPT_LENGTH(block_opt) - 1)) |= 0x08; - else - *(COAP_OPT_VALUE(block_opt) + (COAP_OPT_LENGTH(block_opt) - 1)) &= ~0x08; -} - -/** - * Initializes @p block from @p pdu. @p type must be either COAP_OPTION_BLOCK1 - * or COAP_OPTION_BLOCK2. When option @p type was found in @p pdu, @p block is - * initialized with values from this option and the function returns the value - * @c 1. Otherwise, @c 0 is returned. - * - * @param pdu The pdu to search for option @p type. - * @param type The option to search for (must be COAP_OPTION_BLOCK1 or - * COAP_OPTION_BLOCK2). - * @param block The block structure to initilize. - * - * @return @c 1 on success, @c 0 otherwise. - */ -int coap_get_block(coap_pdu_t *pdu, unsigned short type, coap_block_t *block); - -/** - * Writes a block option of type @p type to message @p pdu. If the requested - * block size is too large to fit in @p pdu, it is reduced accordingly. An - * exception is made for the final block when less space is required. The actual - * length of the resource is specified in @p data_length. - * - * This function may change *block to reflect the values written to @p pdu. As - * the function takes into consideration the remaining space @p pdu, no more - * options should be added after coap_write_block_opt() has returned. - * - * @param block The block structure to use. On return, this object is - * updated according to the values that have been written to - * @p pdu. - * @param type COAP_OPTION_BLOCK1 or COAP_OPTION_BLOCK2. - * @param pdu The message where the block option should be written. - * @param data_length The length of the actual data that will be added the @p - * pdu by calling coap_add_block(). - * - * @return @c 1 on success, or a negative value on error. - */ -int coap_write_block_opt(coap_block_t *block, - unsigned short type, - coap_pdu_t *pdu, - size_t data_length); - -/** - * Adds the @p block_num block of size 1 << (@p block_szx + 4) from source @p - * data to @p pdu. - * - * @param pdu The message to add the block. - * @param len The length of @p data. - * @param data The source data to fill the block with. - * @param block_num The actual block number. - * @param block_szx Encoded size of block @p block_number. - * - * @return @c 1 on success, @c 0 otherwise. - */ -int coap_add_block(coap_pdu_t *pdu, - unsigned int len, - const unsigned char *data, - unsigned int block_num, - unsigned char block_szx); -/**@}*/ - -#endif /* _COAP_BLOCK_H_ */ diff --git a/tools/sdk/include/coap/coap.h b/tools/sdk/include/coap/coap.h deleted file mode 100644 index cbdc9dfc81b..00000000000 --- a/tools/sdk/include/coap/coap.h +++ /dev/null @@ -1,50 +0,0 @@ -/* Modify head file implementation for ESP32 platform. - * - * Uses libcoap software implementation for failover when concurrent - * define operations are in use. - * - * coap.h -- main header file for CoAP stack of libcoap - * - * Copyright (C) 2010-2012,2015-2016 Olaf Bergmann - * 2015 Carsten Schoenert - * - * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -#ifndef _COAP_H_ -#define _COAP_H_ - -#include "libcoap.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#include "address.h" -#include "async.h" -#include "bits.h" -#include "block.h" -#include "coap_io.h" -#include "coap_time.h" -#include "debug.h" -#include "encode.h" -#include "mem.h" -#include "net.h" -#include "option.h" -#include "pdu.h" -#include "prng.h" -#include "resource.h" -#include "str.h" -#include "subscribe.h" -#include "uri.h" -#include "uthash.h" -#include "utlist.h" - -#ifdef __cplusplus -} -#endif - -#endif /* _COAP_H_ */ diff --git a/tools/sdk/include/coap/coap/address.h b/tools/sdk/include/coap/coap/address.h deleted file mode 100644 index 85db2046e36..00000000000 --- a/tools/sdk/include/coap/coap/address.h +++ /dev/null @@ -1,152 +0,0 @@ -/* - * address.h -- representation of network addresses - * - * Copyright (C) 2010-2011,2015-2016 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -/** - * @file address.h - * @brief Representation of network addresses - */ - -#ifndef _COAP_ADDRESS_H_ -#define _COAP_ADDRESS_H_ - -#include -#include -#include -#include -#include "libcoap.h" - -#ifdef WITH_LWIP -#include - -typedef struct coap_address_t { - uint16_t port; - ip_addr_t addr; -} coap_address_t; - -#define _coap_address_equals_impl(A, B) (!!ip_addr_cmp(&(A)->addr,&(B)->addr)) - -#define _coap_address_isany_impl(A) ip_addr_isany(&(A)->addr) - -#define _coap_is_mcast_impl(Address) ip_addr_ismulticast(&(Address)->addr) -#endif /* WITH_LWIP */ - -#ifdef WITH_CONTIKI -#include "uip.h" - -typedef struct coap_address_t { - uip_ipaddr_t addr; - unsigned short port; -} coap_address_t; - -#define _coap_address_equals_impl(A,B) \ - ((A)->port == (B)->port \ - && uip_ipaddr_cmp(&((A)->addr),&((B)->addr))) - -/** @todo implementation of _coap_address_isany_impl() for Contiki */ -#define _coap_address_isany_impl(A) 0 - -#define _coap_is_mcast_impl(Address) uip_is_addr_mcast(&((Address)->addr)) -#endif /* WITH_CONTIKI */ - -#ifdef WITH_POSIX -/** multi-purpose address abstraction */ -typedef struct coap_address_t { - socklen_t size; /**< size of addr */ - union { - struct sockaddr sa; - struct sockaddr_storage st; - struct sockaddr_in sin; - struct sockaddr_in6 sin6; - } addr; -} coap_address_t; - -/** - * Compares given address objects @p a and @p b. This function returns @c 1 if - * addresses are equal, @c 0 otherwise. The parameters @p a and @p b must not be - * @c NULL; - */ -int coap_address_equals(const coap_address_t *a, const coap_address_t *b); - -static inline int -_coap_address_isany_impl(const coap_address_t *a) { - /* need to compare only relevant parts of sockaddr_in6 */ - switch (a->addr.sa.sa_family) { - case AF_INET: - return a->addr.sin.sin_addr.s_addr == INADDR_ANY; - case AF_INET6: - return memcmp(&in6addr_any, - &a->addr.sin6.sin6_addr, - sizeof(in6addr_any)) == 0; - default: - ; - } - - return 0; -} -#endif /* WITH_POSIX */ - -/** - * Resets the given coap_address_t object @p addr to its default values. In - * particular, the member size must be initialized to the available size for - * storing addresses. - * - * @param addr The coap_address_t object to initialize. - */ -static inline void -coap_address_init(coap_address_t *addr) { - assert(addr); - memset(addr, 0, sizeof(coap_address_t)); -#ifdef WITH_POSIX - /* lwip and Contiki have constant address sizes and doesn't need the .size part */ - addr->size = sizeof(addr->addr); -#endif -} - -#ifndef WITH_POSIX -/** - * Compares given address objects @p a and @p b. This function returns @c 1 if - * addresses are equal, @c 0 otherwise. The parameters @p a and @p b must not be - * @c NULL; - */ -static inline int -coap_address_equals(const coap_address_t *a, const coap_address_t *b) { - assert(a); assert(b); - return _coap_address_equals_impl(a, b); -} -#endif - -/** - * Checks if given address object @p a denotes the wildcard address. This - * function returns @c 1 if this is the case, @c 0 otherwise. The parameters @p - * a must not be @c NULL; - */ -static inline int -coap_address_isany(const coap_address_t *a) { - assert(a); - return _coap_address_isany_impl(a); -} - -#ifdef WITH_POSIX -/** - * Checks if given address @p a denotes a multicast address. This function - * returns @c 1 if @p a is multicast, @c 0 otherwise. - */ -int coap_is_mcast(const coap_address_t *a); -#else /* WITH_POSIX */ -/** - * Checks if given address @p a denotes a multicast address. This function - * returns @c 1 if @p a is multicast, @c 0 otherwise. - */ -static inline int -coap_is_mcast(const coap_address_t *a) { - return a && _coap_is_mcast_impl(a); -} -#endif /* WITH_POSIX */ - -#endif /* _COAP_ADDRESS_H_ */ diff --git a/tools/sdk/include/coap/coap/async.h b/tools/sdk/include/coap/coap/async.h deleted file mode 100644 index 0c36defacdb..00000000000 --- a/tools/sdk/include/coap/coap/async.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - * async.h -- state management for asynchronous messages - * - * Copyright (C) 2010-2011 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -/** - * @file async.h - * @brief State management for asynchronous messages - */ - -#ifndef _COAP_ASYNC_H_ -#define _COAP_ASYNC_H_ - -#include "net.h" - -#ifndef WITHOUT_ASYNC - -/** - * @defgroup coap_async Asynchronous Messaging - * @{ - * Structure for managing asynchronous state of CoAP resources. A - * coap_resource_t object holds a list of coap_async_state_t objects that can be - * used to generate a separate response in case a result of an operation cannot - * be delivered in time, or the resource has been explicitly subscribed to with - * the option @c observe. - */ -typedef struct coap_async_state_t { - unsigned char flags; /**< holds the flags to control behaviour */ - - /** - * Holds the internal time when the object was registered with a - * resource. This field will be updated whenever - * coap_register_async() is called for a specific resource. - */ - coap_tick_t created; - - /** - * This field can be used to register opaque application data with the - * asynchronous state object. - */ - void *appdata; - unsigned short message_id; /**< id of last message seen */ - coap_tid_t id; /**< transaction id */ - struct coap_async_state_t *next; /**< internally used for linking */ - coap_address_t peer; /**< the peer to notify */ - size_t tokenlen; /**< length of the token */ - unsigned char token[]; /**< the token to use in a response */ -} coap_async_state_t; - -/* Definitions for Async Status Flags These flags can be used to control the - * behaviour of asynchronous response generation. - */ -#define COAP_ASYNC_CONFIRM 0x01 /**< send confirmable response */ -#define COAP_ASYNC_SEPARATE 0x02 /**< send separate response */ -#define COAP_ASYNC_OBSERVED 0x04 /**< the resource is being observed */ - -/** release application data on destruction */ -#define COAP_ASYNC_RELEASE_DATA 0x08 - -/** - * Allocates a new coap_async_state_t object and fills its fields according to - * the given @p request. The @p flags are used to control generation of empty - * ACK responses to stop retransmissions and to release registered @p data when - * the resource is deleted by coap_free_async(). This function returns a pointer - * to the registered coap_async_t object or @c NULL on error. Note that this - * function will return @c NULL in case that an object with the same identifier - * is already registered. - * - * @param context The context to use. - * @param peer The remote peer that is to be asynchronously notified. - * @param request The request that is handled asynchronously. - * @param flags Flags to control state management. - * @param data Opaque application data to register. Note that the - * storage occupied by @p data is released on destruction - * only if flag COAP_ASYNC_RELEASE_DATA is set. - * - * @return A pointer to the registered coap_async_state_t object or @c - * NULL in case of an error. - */ -coap_async_state_t * -coap_register_async(coap_context_t *context, - coap_address_t *peer, - coap_pdu_t *request, - unsigned char flags, - void *data); - -/** - * Removes the state object identified by @p id from @p context. The removed - * object is returned in @p s, if found. Otherwise, @p s is undefined. This - * function returns @c 1 if the object was removed, @c 0 otherwise. Note that - * the storage allocated for the stored object is not released by this - * functions. You will have to call coap_free_async() to do so. - * - * @param context The context where the async object is registered. - * @param id The identifier of the asynchronous transaction. - * @param s Will be set to the object identified by @p id after removal. - * - * @return @c 1 if object was removed and @p s updated, or @c 0 if no - * object was found with the given id. @p s is valid only if the - * return value is @c 1. - */ -int coap_remove_async(coap_context_t *context, - coap_tid_t id, - coap_async_state_t **s); - -/** - * Releases the memory that was allocated by coap_async_state_init() for the - * object @p s. The registered application data will be released automatically - * if COAP_ASYNC_RELEASE_DATA is set. - * - * @param state The object to delete. - */ -void -coap_free_async(coap_async_state_t *state); - -/** - * Retrieves the object identified by @p id from the list of asynchronous - * transactions that are registered with @p context. This function returns a - * pointer to that object or @c NULL if not found. - * - * @param context The context where the asynchronous objects are registered - * with. - * @param id The id of the object to retrieve. - * - * @return A pointer to the object identified by @p id or @c NULL if - * not found. - */ -coap_async_state_t *coap_find_async(coap_context_t *context, coap_tid_t id); - -/** - * Updates the time stamp of @p s. - * - * @param s The state object to update. - */ -static inline void -coap_touch_async(coap_async_state_t *s) { coap_ticks(&s->created); } - -/** @} */ - -#endif /* WITHOUT_ASYNC */ - -#endif /* _COAP_ASYNC_H_ */ diff --git a/tools/sdk/include/coap/coap/bits.h b/tools/sdk/include/coap/coap/bits.h deleted file mode 100644 index 0b269166d57..00000000000 --- a/tools/sdk/include/coap/coap/bits.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * bits.h -- bit vector manipulation - * - * Copyright (C) 2010-2011 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -/** - * @file bits.h - * @brief Bit vector manipulation - */ - -#ifndef _COAP_BITS_H_ -#define _COAP_BITS_H_ - -#include - -/** - * Sets the bit @p bit in bit-vector @p vec. This function returns @c 1 if bit - * was set or @c -1 on error (i.e. when the given bit does not fit in the - * vector). - * - * @param vec The bit-vector to change. - * @param size The size of @p vec in bytes. - * @param bit The bit to set in @p vec. - * - * @return @c -1 if @p bit does not fit into @p vec, @c 1 otherwise. - */ -inline static int -bits_setb(uint8_t *vec, size_t size, uint8_t bit) { - if (size <= (bit >> 3)) - return -1; - - *(vec + (bit >> 3)) |= (uint8_t)(1 << (bit & 0x07)); - return 1; -} - -/** - * Clears the bit @p bit from bit-vector @p vec. This function returns @c 1 if - * bit was cleared or @c -1 on error (i.e. when the given bit does not fit in - * the vector). - * - * @param vec The bit-vector to change. - * @param size The size of @p vec in bytes. - * @param bit The bit to clear from @p vec. - * - * @return @c -1 if @p bit does not fit into @p vec, @c 1 otherwise. - */ -inline static int -bits_clrb(uint8_t *vec, size_t size, uint8_t bit) { - if (size <= (bit >> 3)) - return -1; - - *(vec + (bit >> 3)) &= (uint8_t)(~(1 << (bit & 0x07))); - return 1; -} - -/** - * Gets the status of bit @p bit from bit-vector @p vec. This function returns - * @c 1 if the bit is set, @c 0 otherwise (even in case of an error). - * - * @param vec The bit-vector to read from. - * @param size The size of @p vec in bytes. - * @param bit The bit to get from @p vec. - * - * @return @c 1 if the bit is set, @c 0 otherwise. - */ -inline static int -bits_getb(const uint8_t *vec, size_t size, uint8_t bit) { - if (size <= (bit >> 3)) - return -1; - - return (*(vec + (bit >> 3)) & (1 << (bit & 0x07))) != 0; -} - -#endif /* _COAP_BITS_H_ */ diff --git a/tools/sdk/include/coap/coap/block.h b/tools/sdk/include/coap/coap/block.h deleted file mode 100644 index 9ce00311cc4..00000000000 --- a/tools/sdk/include/coap/coap/block.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * block.h -- block transfer - * - * Copyright (C) 2010-2012,2014-2015 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -#ifndef _COAP_BLOCK_H_ -#define _COAP_BLOCK_H_ - -#include "encode.h" -#include "option.h" -#include "pdu.h" - -/** - * @defgroup block Block Transfer - * @{ - */ - -#ifndef COAP_MAX_BLOCK_SZX -/** - * The largest value for the SZX component in a Block option. Note that - * 1 << (COAP_MAX_BLOCK_SZX + 4) should not exceed COAP_MAX_PDU_SIZE. - */ -#define COAP_MAX_BLOCK_SZX 4 -#endif /* COAP_MAX_BLOCK_SZX */ - -/** - * Structure of Block options. - */ -typedef struct { - unsigned int num; /**< block number */ - unsigned int m:1; /**< 1 if more blocks follow, 0 otherwise */ - unsigned int szx:3; /**< block size */ -} coap_block_t; - -/** - * Returns the value of the least significant byte of a Block option @p opt. - * For zero-length options (i.e. num == m == szx == 0), COAP_OPT_BLOCK_LAST - * returns @c NULL. - */ -#define COAP_OPT_BLOCK_LAST(opt) \ - (COAP_OPT_LENGTH(opt) ? (COAP_OPT_VALUE(opt) + (COAP_OPT_LENGTH(opt)-1)) : 0) - -/** Returns the value of the More-bit of a Block option @p opt. */ -#define COAP_OPT_BLOCK_MORE(opt) \ - (COAP_OPT_LENGTH(opt) ? (*COAP_OPT_BLOCK_LAST(opt) & 0x08) : 0) - -/** Returns the value of the SZX-field of a Block option @p opt. */ -#define COAP_OPT_BLOCK_SZX(opt) \ - (COAP_OPT_LENGTH(opt) ? (*COAP_OPT_BLOCK_LAST(opt) & 0x07) : 0) - -/** - * Returns the value of field @c num in the given block option @p block_opt. - */ -unsigned int coap_opt_block_num(const coap_opt_t *block_opt); - -/** - * Checks if more than @p num blocks are required to deliver @p data_len - * bytes of data for a block size of 1 << (@p szx + 4). - */ -static inline int -coap_more_blocks(size_t data_len, unsigned int num, unsigned short szx) { - return ((num+1) << (szx + 4)) < data_len; -} - -/** Sets the More-bit in @p block_opt */ -static inline void -coap_opt_block_set_m(coap_opt_t *block_opt, int m) { - if (m) - *(COAP_OPT_VALUE(block_opt) + (COAP_OPT_LENGTH(block_opt) - 1)) |= 0x08; - else - *(COAP_OPT_VALUE(block_opt) + (COAP_OPT_LENGTH(block_opt) - 1)) &= ~0x08; -} - -/** - * Initializes @p block from @p pdu. @p type must be either COAP_OPTION_BLOCK1 - * or COAP_OPTION_BLOCK2. When option @p type was found in @p pdu, @p block is - * initialized with values from this option and the function returns the value - * @c 1. Otherwise, @c 0 is returned. - * - * @param pdu The pdu to search for option @p type. - * @param type The option to search for (must be COAP_OPTION_BLOCK1 or - * COAP_OPTION_BLOCK2). - * @param block The block structure to initilize. - * - * @return @c 1 on success, @c 0 otherwise. - */ -int coap_get_block(coap_pdu_t *pdu, unsigned short type, coap_block_t *block); - -/** - * Writes a block option of type @p type to message @p pdu. If the requested - * block size is too large to fit in @p pdu, it is reduced accordingly. An - * exception is made for the final block when less space is required. The actual - * length of the resource is specified in @p data_length. - * - * This function may change *block to reflect the values written to @p pdu. As - * the function takes into consideration the remaining space @p pdu, no more - * options should be added after coap_write_block_opt() has returned. - * - * @param block The block structure to use. On return, this object is - * updated according to the values that have been written to - * @p pdu. - * @param type COAP_OPTION_BLOCK1 or COAP_OPTION_BLOCK2. - * @param pdu The message where the block option should be written. - * @param data_length The length of the actual data that will be added the @p - * pdu by calling coap_add_block(). - * - * @return @c 1 on success, or a negative value on error. - */ -int coap_write_block_opt(coap_block_t *block, - unsigned short type, - coap_pdu_t *pdu, - size_t data_length); - -/** - * Adds the @p block_num block of size 1 << (@p block_szx + 4) from source @p - * data to @p pdu. - * - * @param pdu The message to add the block. - * @param len The length of @p data. - * @param data The source data to fill the block with. - * @param block_num The actual block number. - * @param block_szx Encoded size of block @p block_number. - * - * @return @c 1 on success, @c 0 otherwise. - */ -int coap_add_block(coap_pdu_t *pdu, - unsigned int len, - const unsigned char *data, - unsigned int block_num, - unsigned char block_szx); -/**@}*/ - -#endif /* _COAP_BLOCK_H_ */ diff --git a/tools/sdk/include/coap/coap/coap.h b/tools/sdk/include/coap/coap/coap.h deleted file mode 100644 index cbdc9dfc81b..00000000000 --- a/tools/sdk/include/coap/coap/coap.h +++ /dev/null @@ -1,50 +0,0 @@ -/* Modify head file implementation for ESP32 platform. - * - * Uses libcoap software implementation for failover when concurrent - * define operations are in use. - * - * coap.h -- main header file for CoAP stack of libcoap - * - * Copyright (C) 2010-2012,2015-2016 Olaf Bergmann - * 2015 Carsten Schoenert - * - * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -#ifndef _COAP_H_ -#define _COAP_H_ - -#include "libcoap.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#include "address.h" -#include "async.h" -#include "bits.h" -#include "block.h" -#include "coap_io.h" -#include "coap_time.h" -#include "debug.h" -#include "encode.h" -#include "mem.h" -#include "net.h" -#include "option.h" -#include "pdu.h" -#include "prng.h" -#include "resource.h" -#include "str.h" -#include "subscribe.h" -#include "uri.h" -#include "uthash.h" -#include "utlist.h" - -#ifdef __cplusplus -} -#endif - -#endif /* _COAP_H_ */ diff --git a/tools/sdk/include/coap/coap/coap_io.h b/tools/sdk/include/coap/coap/coap_io.h deleted file mode 100644 index 7a48b319a1d..00000000000 --- a/tools/sdk/include/coap/coap/coap_io.h +++ /dev/null @@ -1,167 +0,0 @@ -/* - * coap_io.h -- Default network I/O functions for libcoap - * - * Copyright (C) 2012-2013 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -#ifndef _COAP_IO_H_ -#define _COAP_IO_H_ - -#include -#include - -#include "address.h" - -/** - * Abstract handle that is used to identify a local network interface. - */ -typedef int coap_if_handle_t; - -/** Invalid interface handle */ -#define COAP_IF_INVALID -1 - -struct coap_packet_t; -typedef struct coap_packet_t coap_packet_t; - -struct coap_context_t; - -/** - * Abstraction of virtual endpoint that can be attached to coap_context_t. The - * tuple (handle, addr) must uniquely identify this endpoint. - */ -typedef struct coap_endpoint_t { -#if defined(WITH_POSIX) || defined(WITH_CONTIKI) - union { - int fd; /**< on POSIX systems */ - void *conn; /**< opaque connection (e.g. uip_conn in Contiki) */ - } handle; /**< opaque handle to identify this endpoint */ -#endif /* WITH_POSIX or WITH_CONTIKI */ - -#ifdef WITH_LWIP - struct udp_pcb *pcb; - /**< @FIXME --chrysn - * this was added in a hurry, not sure it confirms to the overall model */ - struct coap_context_t *context; -#endif /* WITH_LWIP */ - - coap_address_t addr; /**< local interface address */ - int ifindex; - int flags; -} coap_endpoint_t; - -#define COAP_ENDPOINT_NOSEC 0x00 -#define COAP_ENDPOINT_DTLS 0x01 - -coap_endpoint_t *coap_new_endpoint(const coap_address_t *addr, int flags); - -void coap_free_endpoint(coap_endpoint_t *ep); - -/** - * Function interface for data transmission. This function returns the number of - * bytes that have been transmitted, or a value less than zero on error. - * - * @param context The calling CoAP context. - * @param local_interface The local interface to send the data. - * @param dst The address of the receiver. - * @param data The data to send. - * @param datalen The actual length of @p data. - * - * @return The number of bytes written on success, or a value - * less than zero on error. - */ -ssize_t coap_network_send(struct coap_context_t *context, - const coap_endpoint_t *local_interface, - const coap_address_t *dst, - unsigned char *data, size_t datalen); - -/** - * Function interface for reading data. This function returns the number of - * bytes that have been read, or a value less than zero on error. In case of an - * error, @p *packet is set to NULL. - * - * @param ep The endpoint that is used for reading data from the network. - * @param packet A result parameter where a pointer to the received packet - * structure is stored. The caller must call coap_free_packet to - * release the storage used by this packet. - * - * @return The number of bytes received on success, or a value less than - * zero on error. - */ -ssize_t coap_network_read(coap_endpoint_t *ep, coap_packet_t **packet); - -#ifndef coap_mcast_interface -# define coap_mcast_interface(Local) 0 -#endif - -/** - * Releases the storage allocated for @p packet. - */ -void coap_free_packet(coap_packet_t *packet); - -/** - * Populate the coap_endpoint_t *target from the incoming packet's destination - * data. - * - * This is usually used to copy a packet's data into a node's local_if member. - */ -void coap_packet_populate_endpoint(coap_packet_t *packet, - coap_endpoint_t *target); - -/** - * Given an incoming packet, copy its source address into an address struct. - */ -void coap_packet_copy_source(coap_packet_t *packet, coap_address_t *target); - -/** - * Given a packet, set msg and msg_len to an address and length of the packet's - * data in memory. - * */ -void coap_packet_get_memmapped(coap_packet_t *packet, - unsigned char **address, - size_t *length); - -#ifdef WITH_LWIP -/** - * Get the pbuf of a packet. The caller takes over responsibility for freeing - * the pbuf. - */ -struct pbuf *coap_packet_extract_pbuf(coap_packet_t *packet); -#endif - -#ifdef WITH_CONTIKI -/* - * This is only included in coap_io.h instead of .c in order to be available for - * sizeof in mem.c. - */ -struct coap_packet_t { - coap_if_handle_t hnd; /**< the interface handle */ - coap_address_t src; /**< the packet's source address */ - coap_address_t dst; /**< the packet's destination address */ - const coap_endpoint_t *interface; - int ifindex; - void *session; /**< opaque session data */ - size_t length; /**< length of payload */ - unsigned char payload[]; /**< payload */ -}; -#endif - -#ifdef WITH_LWIP -/* - * This is only included in coap_io.h instead of .c in order to be available for - * sizeof in lwippools.h. - * Simple carry-over of the incoming pbuf that is later turned into a node. - * - * Source address data is currently side-banded via ip_current_dest_addr & co - * as the packets have limited lifetime anyway. - */ -struct coap_packet_t { - struct pbuf *pbuf; - const coap_endpoint_t *local_interface; - uint16_t srcport; -}; -#endif - -#endif /* _COAP_IO_H_ */ diff --git a/tools/sdk/include/coap/coap/coap_time.h b/tools/sdk/include/coap/coap/coap_time.h deleted file mode 100644 index 9357e5ff7d0..00000000000 --- a/tools/sdk/include/coap/coap/coap_time.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - * coap_time.h -- Clock Handling - * - * Copyright (C) 2010-2013 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -/** - * @file coap_time.h - * @brief Clock Handling - */ - -#ifndef _COAP_TIME_H_ -#define _COAP_TIME_H_ - -/** - * @defgroup clock Clock Handling - * Default implementation of internal clock. - * @{ - */ - -#ifdef WITH_LWIP - -#include -#include - -/* lwIP provides ms in sys_now */ -#define COAP_TICKS_PER_SECOND 1000 - -typedef uint32_t coap_tick_t; -typedef uint32_t coap_time_t; -typedef int32_t coap_tick_diff_t; - -static inline void coap_ticks_impl(coap_tick_t *t) { - *t = sys_now(); -} - -static inline void coap_clock_init_impl(void) { -} - -#define coap_clock_init coap_clock_init_impl -#define coap_ticks coap_ticks_impl - -static inline coap_time_t coap_ticks_to_rt(coap_tick_t t) { - return t / COAP_TICKS_PER_SECOND; -} -#endif - -#ifdef WITH_CONTIKI -#include "clock.h" - -typedef clock_time_t coap_tick_t; -typedef clock_time_t coap_time_t; - -/** - * This data type is used to represent the difference between two clock_tick_t - * values. This data type must have the same size in memory as coap_tick_t to - * allow wrapping. - */ -typedef int coap_tick_diff_t; - -#define COAP_TICKS_PER_SECOND CLOCK_SECOND - -static inline void coap_clock_init(void) { - clock_init(); -} - -static inline void coap_ticks(coap_tick_t *t) { - *t = clock_time(); -} - -static inline coap_time_t coap_ticks_to_rt(coap_tick_t t) { - return t / COAP_TICKS_PER_SECOND; -} -#endif /* WITH_CONTIKI */ - -#ifdef WITH_POSIX -/** - * This data type represents internal timer ticks with COAP_TICKS_PER_SECOND - * resolution. - */ -typedef unsigned long coap_tick_t; - -/** - * CoAP time in seconds since epoch. - */ -typedef time_t coap_time_t; - -/** - * This data type is used to represent the difference between two clock_tick_t - * values. This data type must have the same size in memory as coap_tick_t to - * allow wrapping. - */ -typedef long coap_tick_diff_t; - -/** Use ms resolution on POSIX systems */ -#define COAP_TICKS_PER_SECOND 1000 - -/** - * Initializes the internal clock. - */ -void coap_clock_init(void); - -/** - * Sets @p t to the internal time with COAP_TICKS_PER_SECOND resolution. - */ -void coap_ticks(coap_tick_t *t); - -/** - * Helper function that converts coap ticks to wallclock time. On POSIX, this - * function returns the number of seconds since the epoch. On other systems, it - * may be the calculated number of seconds since last reboot or so. - * - * @param t Internal system ticks. - * - * @return The number of seconds that has passed since a specific reference - * point (seconds since epoch on POSIX). - */ -coap_time_t coap_ticks_to_rt(coap_tick_t t); -#endif /* WITH_POSIX */ - -/** - * Returns @c 1 if and only if @p a is less than @p b where less is defined on a - * signed data type. - */ -static inline int coap_time_lt(coap_tick_t a, coap_tick_t b) { - return ((coap_tick_diff_t)(a - b)) < 0; -} - -/** - * Returns @c 1 if and only if @p a is less than or equal @p b where less is - * defined on a signed data type. - */ -static inline int coap_time_le(coap_tick_t a, coap_tick_t b) { - return a == b || coap_time_lt(a,b); -} - -/** @} */ - -#endif /* _COAP_TIME_H_ */ diff --git a/tools/sdk/include/coap/coap/debug.h b/tools/sdk/include/coap/coap/debug.h deleted file mode 100644 index e7c86aff517..00000000000 --- a/tools/sdk/include/coap/coap/debug.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * debug.h -- debug utilities - * - * Copyright (C) 2010-2011,2014 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -#ifndef _COAP_DEBUG_H_ -#define _COAP_DEBUG_H_ - -#ifndef COAP_DEBUG_FD -#define COAP_DEBUG_FD stdout -#endif - -#ifndef COAP_ERR_FD -#define COAP_ERR_FD stderr -#endif - -#ifdef HAVE_SYSLOG_H -#include -typedef short coap_log_t; -#else -/** Pre-defined log levels akin to what is used in \b syslog. */ -typedef enum { - LOG_EMERG=0, - LOG_ALERT, - LOG_CRIT, - LOG_ERR, - LOG_WARNING, - LOG_NOTICE, - LOG_INFO, - LOG_DEBUG -} coap_log_t; -#endif - -/** Returns the current log level. */ -coap_log_t coap_get_log_level(void); - -/** Sets the log level to the specified value. */ -void coap_set_log_level(coap_log_t level); - -/** Returns a zero-terminated string with the name of this library. */ -const char *coap_package_name(void); - -/** Returns a zero-terminated string with the library version. */ -const char *coap_package_version(void); - -/** - * Writes the given text to @c COAP_ERR_FD (for @p level <= @c LOG_CRIT) or @c - * COAP_DEBUG_FD (for @p level >= @c LOG_WARNING). The text is output only when - * @p level is below or equal to the log level that set by coap_set_log_level(). - */ -void coap_log_impl(coap_log_t level, const char *format, ...); - -#ifndef coap_log -#define coap_log(...) coap_log_impl(__VA_ARGS__) -#endif - -#ifndef NDEBUG - -/* A set of convenience macros for common log levels. */ -#define info(...) coap_log(LOG_INFO, __VA_ARGS__) -#define warn(...) coap_log(LOG_WARNING, __VA_ARGS__) -#define debug(...) coap_log(LOG_DEBUG, __VA_ARGS__) - -#include "pdu.h" -void coap_show_pdu(const coap_pdu_t *); - -struct coap_address_t; -size_t coap_print_addr(const struct coap_address_t *, unsigned char *, size_t); - -#else - -#define debug(...) -#define info(...) -#define warn(...) - -#define coap_show_pdu(x) -#define coap_print_addr(...) - -#endif /* NDEBUG */ - -#endif /* _COAP_DEBUG_H_ */ diff --git a/tools/sdk/include/coap/coap/encode.h b/tools/sdk/include/coap/coap/encode.h deleted file mode 100644 index a5d290c4ecf..00000000000 --- a/tools/sdk/include/coap/coap/encode.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * encode.h -- encoding and decoding of CoAP data types - * - * Copyright (C) 2010-2012 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -#ifndef _COAP_ENCODE_H_ -#define _COAP_ENCODE_H_ - -#if (BSD >= 199103) || defined(WITH_CONTIKI) -# include -#else -# include -#endif - -#define Nn 8 /* duplicate definition of N if built on sky motes */ -#define ENCODE_HEADER_SIZE 4 -#define HIBIT (1 << (Nn - 1)) -#define EMASK ((1 << ENCODE_HEADER_SIZE) - 1) -#define MMASK ((1 << Nn) - 1 - EMASK) -#define MAX_VALUE ( (1 << Nn) - (1 << ENCODE_HEADER_SIZE) ) * (1 << ((1 << ENCODE_HEADER_SIZE) - 1)) - -#define COAP_PSEUDOFP_DECODE_8_4(r) (r < HIBIT ? r : (r & MMASK) << (r & EMASK)) - -#ifndef HAVE_FLS -/* include this only if fls() is not available */ -extern int coap_fls(unsigned int i); -#else -#define coap_fls(i) fls(i) -#endif - -/* ls and s must be integer variables */ -#define COAP_PSEUDOFP_ENCODE_8_4_DOWN(v,ls) (v < HIBIT ? v : (ls = coap_fls(v) - Nn, (v >> ls) & MMASK) + ls) -#define COAP_PSEUDOFP_ENCODE_8_4_UP(v,ls,s) (v < HIBIT ? v : (ls = coap_fls(v) - Nn, (s = (((v + ((1<> ls) & MMASK)), s == 0 ? HIBIT + ls + 1 : s + ls)) - -/** - * Decodes multiple-length byte sequences. buf points to an input byte sequence - * of length len. Returns the decoded value. - */ -unsigned int coap_decode_var_bytes(unsigned char *buf,unsigned int len); - -/** - * Encodes multiple-length byte sequences. buf points to an output buffer of - * sufficient length to store the encoded bytes. val is the value to encode. - * Returns the number of bytes used to encode val or 0 on error. - */ -unsigned int coap_encode_var_bytes(unsigned char *buf, unsigned int val); - -#endif /* _COAP_ENCODE_H_ */ diff --git a/tools/sdk/include/coap/coap/hashkey.h b/tools/sdk/include/coap/coap/hashkey.h deleted file mode 100644 index 5cff67d2d8a..00000000000 --- a/tools/sdk/include/coap/coap/hashkey.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * hashkey.h -- definition of hash key type and helper functions - * - * Copyright (C) 2010-2011 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -/** - * @file hashkey.h - * @brief definition of hash key type and helper functions - */ - -#ifndef _COAP_HASHKEY_H_ -#define _COAP_HASHKEY_H_ - -#include "str.h" - -typedef unsigned char coap_key_t[4]; - -#ifndef coap_hash -/** - * Calculates a fast hash over the given string @p s of length @p len and stores - * the result into @p h. Depending on the exact implementation, this function - * cannot be used as one-way function to check message integrity or simlar. - * - * @param s The string used for hash calculation. - * @param len The length of @p s. - * @param h The result buffer to store the calculated hash key. - */ -void coap_hash_impl(const unsigned char *s, unsigned int len, coap_key_t h); - -#define coap_hash(String,Length,Result) \ - coap_hash_impl((String),(Length),(Result)) - -/* This is used to control the pre-set hash-keys for resources. */ -#define __COAP_DEFAULT_HASH -#else -#undef __COAP_DEFAULT_HASH -#endif /* coap_hash */ - -/** - * Calls coap_hash() with given @c str object as parameter. - * - * @param Str Must contain a pointer to a coap string object. - * @param H A coap_key_t object to store the result. - * - * @hideinitializer - */ -#define coap_str_hash(Str,H) { \ - assert(Str); \ - memset((H), 0, sizeof(coap_key_t)); \ - coap_hash((Str)->s, (Str)->length, (H)); \ - } - -#endif /* _COAP_HASHKEY_H_ */ diff --git a/tools/sdk/include/coap/coap/libcoap.h b/tools/sdk/include/coap/coap/libcoap.h deleted file mode 100644 index 214b9e235e8..00000000000 --- a/tools/sdk/include/coap/coap/libcoap.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * libcoap.h -- platform specific header file for CoAP stack - * - * Copyright (C) 2015 Carsten Schoenert - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -#ifndef _LIBCOAP_H_ -#define _LIBCOAP_H_ - -/* The non posix embedded platforms like Contiki, TinyOS, RIOT, ... doesn't have - * a POSIX compatible header structure so we have to slightly do some platform - * related things. Currently there is only Contiki available so we check for a - * CONTIKI environment and do *not* include the POSIX related network stuff. If - * there are other platforms in future there need to be analogous environments. - * - * The CONTIKI variable is within the Contiki build environment! */ - -#if !defined (CONTIKI) -#include -#include -#endif /* CONTIKI */ - -#endif /* _LIBCOAP_H_ */ diff --git a/tools/sdk/include/coap/coap/lwippools.h b/tools/sdk/include/coap/coap/lwippools.h deleted file mode 100644 index 0bfb3f527a7..00000000000 --- a/tools/sdk/include/coap/coap/lwippools.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -/** Memory pool definitions for the libcoap when used with lwIP (which has its - * own mechanism for quickly allocating chunks of data with known sizes). Has - * to be findable by lwIP (ie. an #include must either directly - * include this or include something more generic which includes this), and - * MEMP_USE_CUSTOM_POOLS has to be set in lwipopts.h. */ - -#include "coap_config.h" -#include -#include -#include - -#ifndef MEMP_NUM_COAPCONTEXT -#define MEMP_NUM_COAPCONTEXT 1 -#endif - -#ifndef MEMP_NUM_COAPENDPOINT -#define MEMP_NUM_COAPENDPOINT 1 -#endif - -/* 1 is sufficient as this is very short-lived */ -#ifndef MEMP_NUM_COAPPACKET -#define MEMP_NUM_COAPPACKET 1 -#endif - -#ifndef MEMP_NUM_COAPNODE -#define MEMP_NUM_COAPNODE 4 -#endif - -#ifndef MEMP_NUM_COAPPDU -#define MEMP_NUM_COAPPDU MEMP_NUM_COAPNODE -#endif - -#ifndef MEMP_NUM_COAP_SUBSCRIPTION -#define MEMP_NUM_COAP_SUBSCRIPTION 4 -#endif - -#ifndef MEMP_NUM_COAPRESOURCE -#define MEMP_NUM_COAPRESOURCE 10 -#endif - -#ifndef MEMP_NUM_COAPRESOURCEATTR -#define MEMP_NUM_COAPRESOURCEATTR 20 -#endif - -LWIP_MEMPOOL(COAP_CONTEXT, MEMP_NUM_COAPCONTEXT, sizeof(coap_context_t), "COAP_CONTEXT") -LWIP_MEMPOOL(COAP_ENDPOINT, MEMP_NUM_COAPENDPOINT, sizeof(coap_endpoint_t), "COAP_ENDPOINT") -LWIP_MEMPOOL(COAP_PACKET, MEMP_NUM_COAPPACKET, sizeof(coap_packet_t), "COAP_PACKET") -LWIP_MEMPOOL(COAP_NODE, MEMP_NUM_COAPNODE, sizeof(coap_queue_t), "COAP_NODE") -LWIP_MEMPOOL(COAP_PDU, MEMP_NUM_COAPPDU, sizeof(coap_pdu_t), "COAP_PDU") -LWIP_MEMPOOL(COAP_subscription, MEMP_NUM_COAP_SUBSCRIPTION, sizeof(coap_subscription_t), "COAP_subscription") -LWIP_MEMPOOL(COAP_RESOURCE, MEMP_NUM_COAPRESOURCE, sizeof(coap_resource_t), "COAP_RESOURCE") -LWIP_MEMPOOL(COAP_RESOURCEATTR, MEMP_NUM_COAPRESOURCEATTR, sizeof(coap_attr_t), "COAP_RESOURCEATTR") diff --git a/tools/sdk/include/coap/coap/mem.h b/tools/sdk/include/coap/coap/mem.h deleted file mode 100644 index fd3c69aafde..00000000000 --- a/tools/sdk/include/coap/coap/mem.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * mem.h -- CoAP memory handling - * - * Copyright (C) 2010-2011,2014-2015 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -#ifndef _COAP_MEM_H_ -#define _COAP_MEM_H_ - -#include - -#ifndef WITH_LWIP -/** - * Initializes libcoap's memory management. - * This function must be called once before coap_malloc() can be used on - * constrained devices. - */ -void coap_memory_init(void); -#endif /* WITH_LWIP */ - -/** - * Type specifiers for coap_malloc_type(). Memory objects can be typed to - * facilitate arrays of type objects to be used instead of dynamic memory - * management on constrained devices. - */ -typedef enum { - COAP_STRING, - COAP_ATTRIBUTE_NAME, - COAP_ATTRIBUTE_VALUE, - COAP_PACKET, - COAP_NODE, - COAP_CONTEXT, - COAP_ENDPOINT, - COAP_PDU, - COAP_PDU_BUF, - COAP_RESOURCE, - COAP_RESOURCEATTR -} coap_memory_tag_t; - -#ifndef WITH_LWIP - -/** - * Allocates a chunk of @p size bytes and returns a pointer to the newly - * allocated memory. The @p type is used to select the appropriate storage - * container on constrained devices. The storage allocated by coap_malloc_type() - * must be released with coap_free_type(). - * - * @param type The type of object to be stored. - * @param size The number of bytes requested. - * @return A pointer to the allocated storage or @c NULL on error. - */ -void *coap_malloc_type(coap_memory_tag_t type, size_t size); - -/** - * Releases the memory that was allocated by coap_malloc_type(). The type tag @p - * type must be the same that was used for allocating the object pointed to by - * @p . - * - * @param type The type of the object to release. - * @param p A pointer to memory that was allocated by coap_malloc_type(). - */ -void coap_free_type(coap_memory_tag_t type, void *p); - -/** - * Wrapper function to coap_malloc_type() for backwards compatibility. - */ -static inline void *coap_malloc(size_t size) { - return coap_malloc_type(COAP_STRING, size); -} - -/** - * Wrapper function to coap_free_type() for backwards compatibility. - */ -static inline void coap_free(void *object) { - coap_free_type(COAP_STRING, object); -} - -#endif /* not WITH_LWIP */ - -#ifdef WITH_LWIP - -#include - -/* no initialization needed with lwip (or, more precisely: lwip must be - * completely initialized anyway by the time coap gets active) */ -static inline void coap_memory_init(void) {} - -/* It would be nice to check that size equals the size given at the memp - * declaration, but i currently don't see a standard way to check that without - * sourcing the custom memp pools and becoming dependent of its syntax - */ -#define coap_malloc_type(type, size) memp_malloc(MEMP_ ## type) -#define coap_free_type(type, p) memp_free(MEMP_ ## type, p) - -/* Those are just here to make uri.c happy where string allocation has not been - * made conditional. - */ -static inline void *coap_malloc(size_t size) { - LWIP_ASSERT("coap_malloc must not be used in lwIP", 0); -} - -static inline void coap_free(void *pointer) { - LWIP_ASSERT("coap_free must not be used in lwIP", 0); -} - -#endif /* WITH_LWIP */ - -#endif /* _COAP_MEM_H_ */ diff --git a/tools/sdk/include/coap/coap/net.h b/tools/sdk/include/coap/coap/net.h deleted file mode 100644 index 014b4903ab4..00000000000 --- a/tools/sdk/include/coap/coap/net.h +++ /dev/null @@ -1,521 +0,0 @@ -/* - * net.h -- CoAP network interface - * - * Copyright (C) 2010-2015 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -#ifndef _COAP_NET_H_ -#define _COAP_NET_H_ - -#include -#include -#include -#include -#include - -#ifdef WITH_LWIP -#include -#endif - -#include "coap_io.h" -#include "coap_time.h" -#include "option.h" -#include "pdu.h" -#include "prng.h" - -struct coap_queue_t; - -typedef struct coap_queue_t { - struct coap_queue_t *next; - coap_tick_t t; /**< when to send PDU for the next time */ - unsigned char retransmit_cnt; /**< retransmission counter, will be removed - * when zero */ - unsigned int timeout; /**< the randomized timeout value */ - coap_endpoint_t local_if; /**< the local address interface */ - coap_address_t remote; /**< remote address */ - coap_tid_t id; /**< unique transaction id */ - coap_pdu_t *pdu; /**< the CoAP PDU to send */ -} coap_queue_t; - -/** Adds node to given queue, ordered by node->t. */ -int coap_insert_node(coap_queue_t **queue, coap_queue_t *node); - -/** Destroys specified node. */ -int coap_delete_node(coap_queue_t *node); - -/** Removes all items from given queue and frees the allocated storage. */ -void coap_delete_all(coap_queue_t *queue); - -/** Creates a new node suitable for adding to the CoAP sendqueue. */ -coap_queue_t *coap_new_node(void); - -struct coap_resource_t; -struct coap_context_t; -#ifndef WITHOUT_ASYNC -struct coap_async_state_t; -#endif - -/** Message handler that is used as call-back in coap_context_t */ -typedef void (*coap_response_handler_t)(struct coap_context_t *, - const coap_endpoint_t *local_interface, - const coap_address_t *remote, - coap_pdu_t *sent, - coap_pdu_t *received, - const coap_tid_t id); - -#define COAP_MID_CACHE_SIZE 3 -typedef struct { - unsigned char flags[COAP_MID_CACHE_SIZE]; - coap_key_t item[COAP_MID_CACHE_SIZE]; -} coap_mid_cache_t; - -/** The CoAP stack's global state is stored in a coap_context_t object */ -typedef struct coap_context_t { - coap_opt_filter_t known_options; - struct coap_resource_t *resources; /**< hash table or list of known resources */ - -#ifndef WITHOUT_ASYNC - /** - * list of asynchronous transactions */ - struct coap_async_state_t *async_state; -#endif /* WITHOUT_ASYNC */ - - /** - * The time stamp in the first element of the sendqeue is relative - * to sendqueue_basetime. */ - coap_tick_t sendqueue_basetime; - coap_queue_t *sendqueue; - coap_endpoint_t *endpoint; /**< the endpoint used for listening */ - -#ifdef WITH_POSIX - int sockfd; /**< send/receive socket */ -#endif /* WITH_POSIX */ - -#ifdef WITH_CONTIKI - struct uip_udp_conn *conn; /**< uIP connection object */ - struct etimer retransmit_timer; /**< fires when the next packet must be sent */ - struct etimer notify_timer; /**< used to check resources periodically */ -#endif /* WITH_CONTIKI */ - -#ifdef WITH_LWIP - uint8_t timer_configured; /**< Set to 1 when a retransmission is - * scheduled using lwIP timers for this - * context, otherwise 0. */ -#endif /* WITH_LWIP */ - - /** - * The last message id that was used is stored in this field. The initial - * value is set by coap_new_context() and is usually a random value. A new - * message id can be created with coap_new_message_id(). - */ - unsigned short message_id; - - /** - * The next value to be used for Observe. This field is global for all - * resources and will be updated when notifications are created. - */ - unsigned int observe; - - coap_response_handler_t response_handler; - - ssize_t (*network_send)(struct coap_context_t *context, - const coap_endpoint_t *local_interface, - const coap_address_t *dst, - unsigned char *data, size_t datalen); - - ssize_t (*network_read)(coap_endpoint_t *ep, coap_packet_t **packet); - -} coap_context_t; - -/** - * Registers a new message handler that is called whenever a response was - * received that matches an ongoing transaction. - * - * @param context The context to register the handler for. - * @param handler The response handler to register. - */ -static inline void -coap_register_response_handler(coap_context_t *context, - coap_response_handler_t handler) { - context->response_handler = handler; -} - -/** - * Registers the option type @p type with the given context object @p ctx. - * - * @param ctx The context to use. - * @param type The option type to register. - */ -inline static void -coap_register_option(coap_context_t *ctx, unsigned char type) { - coap_option_setb(ctx->known_options, type); -} - -/** - * Set sendqueue_basetime in the given context object @p ctx to @p now. This - * function returns the number of elements in the queue head that have timed - * out. - */ -unsigned int coap_adjust_basetime(coap_context_t *ctx, coap_tick_t now); - -/** - * Returns the next pdu to send without removing from sendqeue. - */ -coap_queue_t *coap_peek_next( coap_context_t *context ); - -/** - * Returns the next pdu to send and removes it from the sendqeue. - */ -coap_queue_t *coap_pop_next( coap_context_t *context ); - -/** - * Creates a new coap_context_t object that will hold the CoAP stack status. - */ -coap_context_t *coap_new_context(const coap_address_t *listen_addr); - -/** - * Returns a new message id and updates @p context->message_id accordingly. The - * message id is returned in network byte order to make it easier to read in - * tracing tools. - * - * @param context The current coap_context_t object. - * - * @return Incremented message id in network byte order. - */ -static inline unsigned short -coap_new_message_id(coap_context_t *context) { - context->message_id++; -#ifndef WITH_CONTIKI - return htons(context->message_id); -#else /* WITH_CONTIKI */ - return uip_htons(context->message_id); -#endif -} - -/** - * CoAP stack context must be released with coap_free_context(). This function - * clears all entries from the receive queue and send queue and deletes the - * resources that have been registered with @p context, and frees the attached - * endpoints. - */ -void coap_free_context(coap_context_t *context); - - -/** - * Sends a confirmed CoAP message to given destination. The memory that is - * allocated by pdu will not be released by coap_send_confirmed(). The caller - * must release the memory. - * - * @param context The CoAP context to use. - * @param local_interface The local network interface where the outbound - * packet is sent. - * @param dst The address to send to. - * @param pdu The CoAP PDU to send. - * - * @return The message id of the sent message or @c - * COAP_INVALID_TID on error. - */ -coap_tid_t coap_send_confirmed(coap_context_t *context, - const coap_endpoint_t *local_interface, - const coap_address_t *dst, - coap_pdu_t *pdu); - -/** - * Creates a new ACK PDU with specified error @p code. The options specified by - * the filter expression @p opts will be copied from the original request - * contained in @p request. Unless @c SHORT_ERROR_RESPONSE was defined at build - * time, the textual reason phrase for @p code will be added as payload, with - * Content-Type @c 0. - * This function returns a pointer to the new response message, or @c NULL on - * error. The storage allocated for the new message must be relased with - * coap_free(). - * - * @param request Specification of the received (confirmable) request. - * @param code The error code to set. - * @param opts An option filter that specifies which options to copy from - * the original request in @p node. - * - * @return A pointer to the new message or @c NULL on error. - */ -coap_pdu_t *coap_new_error_response(coap_pdu_t *request, - unsigned char code, - coap_opt_filter_t opts); - -/** - * Sends a non-confirmed CoAP message to given destination. The memory that is - * allocated by pdu will not be released by coap_send(). - * The caller must release the memory. - * - * @param context The CoAP context to use. - * @param local_interface The local network interface where the outbound packet - * is sent. - * @param dst The address to send to. - * @param pdu The CoAP PDU to send. - * - * @return The message id of the sent message or @c - * COAP_INVALID_TID on error. - */ -coap_tid_t coap_send(coap_context_t *context, - const coap_endpoint_t *local_interface, - const coap_address_t *dst, - coap_pdu_t *pdu); - -/** - * Sends an error response with code @p code for request @p request to @p dst. - * @p opts will be passed to coap_new_error_response() to copy marked options - * from the request. This function returns the transaction id if the message was - * sent, or @c COAP_INVALID_TID otherwise. - * - * @param context The context to use. - * @param request The original request to respond to. - * @param local_interface The local network interface where the outbound packet - * is sent. - * @param dst The remote peer that sent the request. - * @param code The response code. - * @param opts A filter that specifies the options to copy from the - * @p request. - * - * @return The transaction id if the message was sent, or @c - * COAP_INVALID_TID otherwise. - */ -coap_tid_t coap_send_error(coap_context_t *context, - coap_pdu_t *request, - const coap_endpoint_t *local_interface, - const coap_address_t *dst, - unsigned char code, - coap_opt_filter_t opts); - -/** - * Helper funktion to create and send a message with @p type (usually ACK or - * RST). This function returns @c COAP_INVALID_TID when the message was not - * sent, a valid transaction id otherwise. - * - * @param context The CoAP context. - * @param local_interface The local network interface where the outbound packet - * is sent. - * @param dst Where to send the context. - * @param request The request that should be responded to. - * @param type Which type to set. - * @return transaction id on success or @c COAP_INVALID_TID - * otherwise. - */ -coap_tid_t -coap_send_message_type(coap_context_t *context, - const coap_endpoint_t *local_interface, - const coap_address_t *dst, - coap_pdu_t *request, - unsigned char type); - -/** - * Sends an ACK message with code @c 0 for the specified @p request to @p dst. - * This function returns the corresponding transaction id if the message was - * sent or @c COAP_INVALID_TID on error. - * - * @param context The context to use. - * @param local_interface The local network interface where the outbound packet - * is sent. - * @param dst The destination address. - * @param request The request to be acknowledged. - * - * @return The transaction id if ACK was sent or @c - * COAP_INVALID_TID on error. - */ -coap_tid_t coap_send_ack(coap_context_t *context, - const coap_endpoint_t *local_interface, - const coap_address_t *dst, - coap_pdu_t *request); - -/** - * Sends an RST message with code @c 0 for the specified @p request to @p dst. - * This function returns the corresponding transaction id if the message was - * sent or @c COAP_INVALID_TID on error. - * - * @param context The context to use. - * @param local_interface The local network interface where the outbound packet - * is sent. - * @param dst The destination address. - * @param request The request to be reset. - * - * @return The transaction id if RST was sent or @c - * COAP_INVALID_TID on error. - */ -static inline coap_tid_t -coap_send_rst(coap_context_t *context, - const coap_endpoint_t *local_interface, - const coap_address_t *dst, - coap_pdu_t *request) { - return coap_send_message_type(context, - local_interface, - dst, request, - COAP_MESSAGE_RST); -} - -/** - * Handles retransmissions of confirmable messages - */ -coap_tid_t coap_retransmit(coap_context_t *context, coap_queue_t *node); - -/** - * Reads data from the network and tries to parse as CoAP PDU. On success, 0 is - * returned and a new node with the parsed PDU is added to the receive queue in - * the specified context object. - */ -int coap_read(coap_context_t *context); - -/** - * Parses and interprets a CoAP message with context @p ctx. This function - * returns @c 0 if the message was handled, or a value less than zero on - * error. - * - * @param ctx The current CoAP context. - * @param packet The received packet. - * - * @return @c 0 if message was handled successfully, or less than zero on - * error. - */ -int coap_handle_message(coap_context_t *ctx, - coap_packet_t *packet); - -/** - * Calculates a unique transaction id from given arguments @p peer and @p pdu. - * The id is returned in @p id. - * - * @param peer The remote party who sent @p pdu. - * @param pdu The message that initiated the transaction. - * @param id Set to the new id. - */ -void coap_transaction_id(const coap_address_t *peer, - const coap_pdu_t *pdu, - coap_tid_t *id); - -/** - * This function removes the element with given @p id from the list given list. - * If @p id was found, @p node is updated to point to the removed element. Note - * that the storage allocated by @p node is @b not released. The caller must do - * this manually using coap_delete_node(). This function returns @c 1 if the - * element with id @p id was found, @c 0 otherwise. For a return value of @c 0, - * the contents of @p node is undefined. - * - * @param queue The queue to search for @p id. - * @param id The node id to look for. - * @param node If found, @p node is updated to point to the removed node. You - * must release the storage pointed to by @p node manually. - * - * @return @c 1 if @p id was found, @c 0 otherwise. - */ -int coap_remove_from_queue(coap_queue_t **queue, - coap_tid_t id, - coap_queue_t **node); - -/** - * Removes the transaction identified by @p id from given @p queue. This is a - * convenience function for coap_remove_from_queue() with automatic deletion of - * the removed node. - * - * @param queue The queue to search for @p id. - * @param id The transaction id. - * - * @return @c 1 if node was found, removed and destroyed, @c 0 otherwise. - */ -inline static int -coap_remove_transaction(coap_queue_t **queue, coap_tid_t id) { - coap_queue_t *node; - if (!coap_remove_from_queue(queue, id, &node)) - return 0; - - coap_delete_node(node); - return 1; -} - -/** - * Retrieves transaction from the queue. - * - * @param queue The transaction queue to be searched. - * @param id Unique key of the transaction to find. - * - * @return A pointer to the transaction object or NULL if not found. - */ -coap_queue_t *coap_find_transaction(coap_queue_t *queue, coap_tid_t id); - -/** - * Cancels all outstanding messages for peer @p dst that have the specified - * token. - * - * @param context The context in use. - * @param dst Destination address of the messages to remove. - * @param token Message token. - * @param token_length Actual length of @p token. - */ -void coap_cancel_all_messages(coap_context_t *context, - const coap_address_t *dst, - const unsigned char *token, - size_t token_length); - -/** - * Dispatches the PDUs from the receive queue in given context. - */ -void coap_dispatch(coap_context_t *context, coap_queue_t *rcvd); - -/** - * Returns 1 if there are no messages to send or to dispatch in the context's - * queues. */ -int coap_can_exit(coap_context_t *context); - -/** - * Returns the current value of an internal tick counter. The counter counts \c - * COAP_TICKS_PER_SECOND ticks every second. - */ -void coap_ticks(coap_tick_t *); - -/** - * Verifies that @p pdu contains no unknown critical options. Options must be - * registered at @p ctx, using the function coap_register_option(). A basic set - * of options is registered automatically by coap_new_context(). This function - * returns @c 1 if @p pdu is ok, @c 0 otherwise. The given filter object @p - * unknown will be updated with the unknown options. As only @c COAP_MAX_OPT - * options can be signalled this way, remaining options must be examined - * manually. - * - * @code - coap_opt_filter_t f = COAP_OPT_NONE; - coap_opt_iterator_t opt_iter; - - if (coap_option_check_critical(ctx, pdu, f) == 0) { - coap_option_iterator_init(pdu, &opt_iter, f); - - while (coap_option_next(&opt_iter)) { - if (opt_iter.type & 0x01) { - ... handle unknown critical option in opt_iter ... - } - } - } - * @endcode - * - * @param ctx The context where all known options are registered. - * @param pdu The PDU to check. - * @param unknown The output filter that will be updated to indicate the - * unknown critical options found in @p pdu. - * - * @return @c 1 if everything was ok, @c 0 otherwise. - */ -int coap_option_check_critical(coap_context_t *ctx, - coap_pdu_t *pdu, - coap_opt_filter_t unknown); - -/** - * Creates a new response for given @p request with the contents of @c - * .well-known/core. The result is NULL on error or a newly allocated PDU that - * must be released by coap_delete_pdu(). - * - * @param context The current coap context to use. - * @param request The request for @c .well-known/core . - * - * @return A new 2.05 response for @c .well-known/core or NULL on error. - */ -coap_pdu_t *coap_wellknown_response(coap_context_t *context, - coap_pdu_t *request); - -#endif /* _COAP_NET_H_ */ diff --git a/tools/sdk/include/coap/coap/option.h b/tools/sdk/include/coap/coap/option.h deleted file mode 100644 index ace2b81c713..00000000000 --- a/tools/sdk/include/coap/coap/option.h +++ /dev/null @@ -1,410 +0,0 @@ -/* - * option.h -- helpers for handling options in CoAP PDUs - * - * Copyright (C) 2010-2013 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -/** - * @file option.h - * @brief Helpers for handling options in CoAP PDUs - */ - -#ifndef _COAP_OPTION_H_ -#define _COAP_OPTION_H_ - -#include "bits.h" -#include "pdu.h" - -/** - * Use byte-oriented access methods here because sliding a complex struct - * coap_opt_t over the data buffer may cause bus error on certain platforms. - */ -typedef unsigned char coap_opt_t; -#define PCHAR(p) ((coap_opt_t *)(p)) - -/** Representation of CoAP options. */ -typedef struct { - unsigned short delta; - size_t length; - unsigned char *value; -} coap_option_t; - -/** - * Parses the option pointed to by @p opt into @p result. This function returns - * the number of bytes that have been parsed, or @c 0 on error. An error is - * signaled when illegal delta or length values are encountered or when option - * parsing would result in reading past the option (i.e. beyond opt + length). - * - * @param opt The beginning of the option to parse. - * @param length The maximum length of @p opt. - * @param result A pointer to the coap_option_t structure that is filled with - * actual values iff coap_opt_parse() > 0. - * @return The number of bytes parsed or @c 0 on error. - */ -size_t coap_opt_parse(const coap_opt_t *opt, - size_t length, - coap_option_t *result); - -/** - * Returns the size of the given option, taking into account a possible option - * jump. - * - * @param opt An option jump or the beginning of the option. - * @return The number of bytes between @p opt and the end of the option - * starting at @p opt. In case of an error, this function returns - * @c 0 as options need at least one byte storage space. - */ -size_t coap_opt_size(const coap_opt_t *opt); - -/** @deprecated { Use coap_opt_size() instead. } */ -#define COAP_OPT_SIZE(opt) coap_opt_size(opt) - -/** - * Calculates the beginning of the PDU's option section. - * - * @param pdu The PDU containing the options. - * @return A pointer to the first option if available, or @c NULL otherwise. - */ -coap_opt_t *options_start(coap_pdu_t *pdu); - -/** - * Interprets @p opt as pointer to a CoAP option and advances to - * the next byte past this option. - * @hideinitializer - */ -#define options_next(opt) \ - ((coap_opt_t *)((unsigned char *)(opt) + COAP_OPT_SIZE(opt))) - -/** - * @defgroup opt_filter Option Filters - * @{ - */ - -/** - * The number of option types below 256 that can be stored in an - * option filter. COAP_OPT_FILTER_SHORT + COAP_OPT_FILTER_LONG must be - * at most 16. Each coap_option_filter_t object reserves - * ((COAP_OPT_FILTER_SHORT + 1) / 2) * 2 bytes for short options. - */ -#define COAP_OPT_FILTER_SHORT 6 - -/** - * The number of option types above 255 that can be stored in an - * option filter. COAP_OPT_FILTER_SHORT + COAP_OPT_FILTER_LONG must be - * at most 16. Each coap_option_filter_t object reserves - * COAP_OPT_FILTER_LONG * 2 bytes for short options. - */ -#define COAP_OPT_FILTER_LONG 2 - -/* Ensure that COAP_OPT_FILTER_SHORT and COAP_OPT_FILTER_LONG are set - * correctly. */ -#if (COAP_OPT_FILTER_SHORT + COAP_OPT_FILTER_LONG > 16) -#error COAP_OPT_FILTER_SHORT + COAP_OPT_FILTER_LONG must be less or equal 16 -#endif /* (COAP_OPT_FILTER_SHORT + COAP_OPT_FILTER_LONG > 16) */ - -/** The number of elements in coap_opt_filter_t. */ -#define COAP_OPT_FILTER_SIZE \ - (((COAP_OPT_FILTER_SHORT + 1) >> 1) + COAP_OPT_FILTER_LONG) +1 - -/** - * Fixed-size vector we use for option filtering. It is large enough - * to hold COAP_OPT_FILTER_SHORT entries with an option number between - * 0 and 255, and COAP_OPT_FILTER_LONG entries with an option number - * between 256 and 65535. Its internal structure is - * - * @code -struct { - uint16_t mask; - uint16_t long_opts[COAP_OPT_FILTER_LONG]; - uint8_t short_opts[COAP_OPT_FILTER_SHORT]; -} - * @endcode - * - * The first element contains a bit vector that indicates which fields - * in the remaining array are used. The first COAP_OPT_FILTER_LONG - * bits correspond to the long option types that are stored in the - * elements from index 1 to COAP_OPT_FILTER_LONG. The next - * COAP_OPT_FILTER_SHORT bits correspond to the short option types - * that are stored in the elements from index COAP_OPT_FILTER_LONG + 1 - * to COAP_OPT_FILTER_LONG + COAP_OPT_FILTER_SHORT. The latter - * elements are treated as bytes. - */ -typedef uint16_t coap_opt_filter_t[COAP_OPT_FILTER_SIZE]; - -/** Pre-defined filter that includes all options. */ -#define COAP_OPT_ALL NULL - -/** - * Clears filter @p f. - * - * @param f The filter to clear. - */ -static inline void -coap_option_filter_clear(coap_opt_filter_t f) { - memset(f, 0, sizeof(coap_opt_filter_t)); -} - -/** - * Sets the corresponding entry for @p type in @p filter. This - * function returns @c 1 if bit was set or @c 0 on error (i.e. when - * the given type does not fit in the filter). - * - * @param filter The filter object to change. - * @param type The type for which the bit should be set. - * - * @return @c 1 if bit was set, @c 0 otherwise. - */ -int coap_option_filter_set(coap_opt_filter_t filter, unsigned short type); - -/** - * Clears the corresponding entry for @p type in @p filter. This - * function returns @c 1 if bit was set or @c 0 on error (i.e. when - * the given type does not fit in the filter). - * - * @param filter The filter object to change. - * @param type The type that should be cleared from the filter. - * - * @return @c 1 if bit was set, @c 0 otherwise. - */ -int coap_option_filter_unset(coap_opt_filter_t filter, unsigned short type); - -/** - * Checks if @p type is contained in @p filter. This function returns - * @c 1 if found, @c 0 if not, or @c -1 on error (i.e. when the given - * type does not fit in the filter). - * - * @param filter The filter object to search. - * @param type The type to search for. - * - * @return @c 1 if @p type was found, @c 0 otherwise, or @c -1 on error. - */ -int coap_option_filter_get(const coap_opt_filter_t filter, unsigned short type); - -/** - * Sets the corresponding bit for @p type in @p filter. This function returns @c - * 1 if bit was set or @c -1 on error (i.e. when the given type does not fit in - * the filter). - * - * @deprecated Use coap_option_filter_set() instead. - * - * @param filter The filter object to change. - * @param type The type for which the bit should be set. - * - * @return @c 1 if bit was set, @c -1 otherwise. - */ -inline static int -coap_option_setb(coap_opt_filter_t filter, unsigned short type) { - return coap_option_filter_set(filter, type) ? 1 : -1; -} - -/** - * Clears the corresponding bit for @p type in @p filter. This function returns - * @c 1 if bit was cleared or @c -1 on error (i.e. when the given type does not - * fit in the filter). - * - * @deprecated Use coap_option_filter_unset() instead. - * - * @param filter The filter object to change. - * @param type The type for which the bit should be cleared. - * - * @return @c 1 if bit was set, @c -1 otherwise. - */ -inline static int -coap_option_clrb(coap_opt_filter_t filter, unsigned short type) { - return coap_option_filter_unset(filter, type) ? 1 : -1; -} - -/** - * Gets the corresponding bit for @p type in @p filter. This function returns @c - * 1 if the bit is set @c 0 if not, or @c -1 on error (i.e. when the given type - * does not fit in the filter). - * - * @deprecated Use coap_option_filter_get() instead. - * - * @param filter The filter object to read bit from. - * @param type The type for which the bit should be read. - * - * @return @c 1 if bit was set, @c 0 if not, @c -1 on error. - */ -inline static int -coap_option_getb(const coap_opt_filter_t filter, unsigned short type) { - return coap_option_filter_get(filter, type); -} - -/** - * Iterator to run through PDU options. This object must be - * initialized with coap_option_iterator_init(). Call - * coap_option_next() to walk through the list of options until - * coap_option_next() returns @c NULL. - * - * @code - * coap_opt_t *option; - * coap_opt_iterator_t opt_iter; - * coap_option_iterator_init(pdu, &opt_iter, COAP_OPT_ALL); - * - * while ((option = coap_option_next(&opt_iter))) { - * ... do something with option ... - * } - * @endcode - */ -typedef struct { - size_t length; /**< remaining length of PDU */ - unsigned short type; /**< decoded option type */ - unsigned int bad:1; /**< iterator object is ok if not set */ - unsigned int filtered:1; /**< denotes whether or not filter is used */ - coap_opt_t *next_option; /**< pointer to the unparsed next option */ - coap_opt_filter_t filter; /**< option filter */ -} coap_opt_iterator_t; - -/** - * Initializes the given option iterator @p oi to point to the beginning of the - * @p pdu's option list. This function returns @p oi on success, @c NULL - * otherwise (i.e. when no options exist). Note that a length check on the - * option list must be performed before coap_option_iterator_init() is called. - * - * @param pdu The PDU the options of which should be walked through. - * @param oi An iterator object that will be initilized. - * @param filter An optional option type filter. - * With @p type != @c COAP_OPT_ALL, coap_option_next() - * will return only options matching this bitmask. - * Fence-post options @c 14, @c 28, @c 42, ... are always - * skipped. - * - * @return The iterator object @p oi on success, @c NULL otherwise. - */ -coap_opt_iterator_t *coap_option_iterator_init(coap_pdu_t *pdu, - coap_opt_iterator_t *oi, - const coap_opt_filter_t filter); - -/** - * Updates the iterator @p oi to point to the next option. This function returns - * a pointer to that option or @c NULL if no more options exist. The contents of - * @p oi will be updated. In particular, @c oi->n specifies the current option's - * ordinal number (counted from @c 1), @c oi->type is the option's type code, - * and @c oi->option points to the beginning of the current option itself. When - * advanced past the last option, @c oi->option will be @c NULL. - * - * Note that options are skipped whose corresponding bits in the filter - * specified with coap_option_iterator_init() are @c 0. Options with type codes - * that do not fit in this filter hence will always be returned. - * - * @param oi The option iterator to update. - * - * @return The next option or @c NULL if no more options exist. - */ -coap_opt_t *coap_option_next(coap_opt_iterator_t *oi); - -/** - * Retrieves the first option of type @p type from @p pdu. @p oi must point to a - * coap_opt_iterator_t object that will be initialized by this function to - * filter only options with code @p type. This function returns the first option - * with this type, or @c NULL if not found. - * - * @param pdu The PDU to parse for options. - * @param type The option type code to search for. - * @param oi An iterator object to use. - * - * @return A pointer to the first option of type @p type, or @c NULL if - * not found. - */ -coap_opt_t *coap_check_option(coap_pdu_t *pdu, - unsigned short type, - coap_opt_iterator_t *oi); - -/** - * Encodes the given delta and length values into @p opt. This function returns - * the number of bytes that were required to encode @p delta and @p length or @c - * 0 on error. Note that the result indicates by how many bytes @p opt must be - * advanced to encode the option value. - * - * @param opt The option buffer space where @p delta and @p length are - * written. - * @param maxlen The maximum length of @p opt. - * @param delta The actual delta value to encode. - * @param length The actual length value to encode. - * - * @return The number of bytes used or @c 0 on error. - */ -size_t coap_opt_setheader(coap_opt_t *opt, - size_t maxlen, - unsigned short delta, - size_t length); - -/** - * Encodes option with given @p delta into @p opt. This function returns the - * number of bytes written to @p opt or @c 0 on error. This happens especially - * when @p opt does not provide sufficient space to store the option value, - * delta, and option jumps when required. - * - * @param opt The option buffer space where @p val is written. - * @param n Maximum length of @p opt. - * @param delta The option delta. - * @param val The option value to copy into @p opt. - * @param length The actual length of @p val. - * - * @return The number of bytes that have been written to @p opt or @c 0 on - * error. The return value will always be less than @p n. - */ -size_t coap_opt_encode(coap_opt_t *opt, - size_t n, - unsigned short delta, - const unsigned char *val, - size_t length); - -/** - * Decodes the delta value of the next option. This function returns the number - * of bytes read or @c 0 on error. The caller of this function must ensure that - * it does not read over the boundaries of @p opt (e.g. by calling - * coap_opt_check_delta(). - * - * @param opt The option to examine. - * - * @return The number of bytes read or @c 0 on error. - */ -unsigned short coap_opt_delta(const coap_opt_t *opt); - -/** @deprecated { Use coap_opt_delta() instead. } */ -#define COAP_OPT_DELTA(opt) coap_opt_delta(opt) - -/** @deprecated { Use coap_opt_encode() instead. } */ -#define COAP_OPT_SETDELTA(opt,val) \ - coap_opt_encode((opt), COAP_MAX_PDU_SIZE, (val), NULL, 0) - -/** - * Returns the length of the given option. @p opt must point to an option jump - * or the beginning of the option. This function returns @c 0 when @p opt is not - * an option or the actual length of @p opt (which can be @c 0 as well). - * - * @note {The rationale for using @c 0 in case of an error is that in most - * contexts, the result of this function is used to skip the next - * coap_opt_length() bytes.} - * - * @param opt The option whose length should be returned. - * - * @return The option's length or @c 0 when undefined. - */ -unsigned short coap_opt_length(const coap_opt_t *opt); - -/** @deprecated { Use coap_opt_length() instead. } */ -#define COAP_OPT_LENGTH(opt) coap_opt_length(opt) - -/** - * Returns a pointer to the value of the given option. @p opt must point to an - * option jump or the beginning of the option. This function returns @c NULL if - * @p opt is not a valid option. - * - * @param opt The option whose value should be returned. - * - * @return A pointer to the option value or @c NULL on error. - */ -unsigned char *coap_opt_value(coap_opt_t *opt); - -/** @deprecated { Use coap_opt_value() instead. } */ -#define COAP_OPT_VALUE(opt) coap_opt_value((coap_opt_t *)opt) - -/** @} */ - -#endif /* _OPTION_H_ */ diff --git a/tools/sdk/include/coap/coap/pdu.h b/tools/sdk/include/coap/coap/pdu.h deleted file mode 100644 index 7ed482deee0..00000000000 --- a/tools/sdk/include/coap/coap/pdu.h +++ /dev/null @@ -1,388 +0,0 @@ -/* - * pdu.h -- CoAP message structure - * - * Copyright (C) 2010-2014 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -/** - * @file pdu.h - * @brief Pre-defined constants that reflect defaults for CoAP - */ - -#ifndef _COAP_PDU_H_ -#define _COAP_PDU_H_ - -#include "uri.h" - -#ifdef WITH_LWIP -#include -#endif - -#define COAP_DEFAULT_PORT 5683 /* CoAP default UDP port */ -#define COAP_DEFAULT_MAX_AGE 60 /* default maximum object lifetime in seconds */ -#ifndef COAP_MAX_PDU_SIZE -#define COAP_MAX_PDU_SIZE 1400 /* maximum size of a CoAP PDU */ -#endif /* COAP_MAX_PDU_SIZE */ - -#define COAP_DEFAULT_VERSION 1 /* version of CoAP supported */ -#define COAP_DEFAULT_SCHEME "coap" /* the default scheme for CoAP URIs */ - -/** well-known resources URI */ -#define COAP_DEFAULT_URI_WELLKNOWN ".well-known/core" - -#ifdef __COAP_DEFAULT_HASH -/* pre-calculated hash key for the default well-known URI */ -#define COAP_DEFAULT_WKC_HASHKEY "\345\130\144\245" -#endif - -/* CoAP message types */ - -#define COAP_MESSAGE_CON 0 /* confirmable message (requires ACK/RST) */ -#define COAP_MESSAGE_NON 1 /* non-confirmable message (one-shot message) */ -#define COAP_MESSAGE_ACK 2 /* used to acknowledge confirmable messages */ -#define COAP_MESSAGE_RST 3 /* indicates error in received messages */ - -/* CoAP request methods */ - -#define COAP_REQUEST_GET 1 -#define COAP_REQUEST_POST 2 -#define COAP_REQUEST_PUT 3 -#define COAP_REQUEST_DELETE 4 - -/* CoAP option types (be sure to update check_critical when adding options */ - -#define COAP_OPTION_IF_MATCH 1 /* C, opaque, 0-8 B, (none) */ -#define COAP_OPTION_URI_HOST 3 /* C, String, 1-255 B, destination address */ -#define COAP_OPTION_ETAG 4 /* E, opaque, 1-8 B, (none) */ -#define COAP_OPTION_IF_NONE_MATCH 5 /* empty, 0 B, (none) */ -#define COAP_OPTION_URI_PORT 7 /* C, uint, 0-2 B, destination port */ -#define COAP_OPTION_LOCATION_PATH 8 /* E, String, 0-255 B, - */ -#define COAP_OPTION_URI_PATH 11 /* C, String, 0-255 B, (none) */ -#define COAP_OPTION_CONTENT_FORMAT 12 /* E, uint, 0-2 B, (none) */ -#define COAP_OPTION_CONTENT_TYPE COAP_OPTION_CONTENT_FORMAT -#define COAP_OPTION_MAXAGE 14 /* E, uint, 0--4 B, 60 Seconds */ -#define COAP_OPTION_URI_QUERY 15 /* C, String, 1-255 B, (none) */ -#define COAP_OPTION_ACCEPT 17 /* C, uint, 0-2 B, (none) */ -#define COAP_OPTION_LOCATION_QUERY 20 /* E, String, 0-255 B, (none) */ -#define COAP_OPTION_PROXY_URI 35 /* C, String, 1-1034 B, (none) */ -#define COAP_OPTION_PROXY_SCHEME 39 /* C, String, 1-255 B, (none) */ -#define COAP_OPTION_SIZE1 60 /* E, uint, 0-4 B, (none) */ - -/* option types from RFC 7641 */ - -#define COAP_OPTION_OBSERVE 6 /* E, empty/uint, 0 B/0-3 B, (none) */ -#define COAP_OPTION_SUBSCRIPTION COAP_OPTION_OBSERVE - -/* selected option types from RFC 7959 */ - -#define COAP_OPTION_BLOCK2 23 /* C, uint, 0--3 B, (none) */ -#define COAP_OPTION_BLOCK1 27 /* C, uint, 0--3 B, (none) */ - -/* selected option types from RFC 7967 */ - -#define COAP_OPTION_NORESPONSE 258 /* N, uint, 0--1 B, 0 */ - -#define COAP_MAX_OPT 65535 /**< the highest option number we know */ - -/* CoAP result codes (HTTP-Code / 100 * 40 + HTTP-Code % 100) */ - -/* As of draft-ietf-core-coap-04, response codes are encoded to base - * 32, i.e. the three upper bits determine the response class while - * the remaining five fine-grained information specific to that class. - */ -#define COAP_RESPONSE_CODE(N) (((N)/100 << 5) | (N)%100) - -/* Determines the class of response code C */ -#define COAP_RESPONSE_CLASS(C) (((C) >> 5) & 0xFF) - -#ifndef SHORT_ERROR_RESPONSE -/** - * Returns a human-readable response phrase for the specified CoAP response @p - * code. This function returns @c NULL if not found. - * - * @param code The response code for which the literal phrase should be - * retrieved. - * - * @return A zero-terminated string describing the error, or @c NULL if not - * found. - */ -char *coap_response_phrase(unsigned char code); - -#define COAP_ERROR_PHRASE_LENGTH 32 /**< maximum length of error phrase */ - -#else -#define coap_response_phrase(x) ((char *)NULL) - -#define COAP_ERROR_PHRASE_LENGTH 0 /**< maximum length of error phrase */ -#endif /* SHORT_ERROR_RESPONSE */ - -/* The following definitions exist for backwards compatibility */ -#if 0 /* this does not exist any more */ -#define COAP_RESPONSE_100 40 /* 100 Continue */ -#endif -#define COAP_RESPONSE_200 COAP_RESPONSE_CODE(200) /* 2.00 OK */ -#define COAP_RESPONSE_201 COAP_RESPONSE_CODE(201) /* 2.01 Created */ -#define COAP_RESPONSE_304 COAP_RESPONSE_CODE(203) /* 2.03 Valid */ -#define COAP_RESPONSE_400 COAP_RESPONSE_CODE(400) /* 4.00 Bad Request */ -#define COAP_RESPONSE_404 COAP_RESPONSE_CODE(404) /* 4.04 Not Found */ -#define COAP_RESPONSE_405 COAP_RESPONSE_CODE(405) /* 4.05 Method Not Allowed */ -#define COAP_RESPONSE_415 COAP_RESPONSE_CODE(415) /* 4.15 Unsupported Media Type */ -#define COAP_RESPONSE_500 COAP_RESPONSE_CODE(500) /* 5.00 Internal Server Error */ -#define COAP_RESPONSE_501 COAP_RESPONSE_CODE(501) /* 5.01 Not Implemented */ -#define COAP_RESPONSE_503 COAP_RESPONSE_CODE(503) /* 5.03 Service Unavailable */ -#define COAP_RESPONSE_504 COAP_RESPONSE_CODE(504) /* 5.04 Gateway Timeout */ -#if 0 /* these response codes do not have a valid code any more */ -# define COAP_RESPONSE_X_240 240 /* Token Option required by server */ -# define COAP_RESPONSE_X_241 241 /* Uri-Authority Option required by server */ -#endif -#define COAP_RESPONSE_X_242 COAP_RESPONSE_CODE(402) /* Critical Option not supported */ - -/* CoAP media type encoding */ - -#define COAP_MEDIATYPE_TEXT_PLAIN 0 /* text/plain (UTF-8) */ -#define COAP_MEDIATYPE_APPLICATION_LINK_FORMAT 40 /* application/link-format */ -#define COAP_MEDIATYPE_APPLICATION_XML 41 /* application/xml */ -#define COAP_MEDIATYPE_APPLICATION_OCTET_STREAM 42 /* application/octet-stream */ -#define COAP_MEDIATYPE_APPLICATION_RDF_XML 43 /* application/rdf+xml */ -#define COAP_MEDIATYPE_APPLICATION_EXI 47 /* application/exi */ -#define COAP_MEDIATYPE_APPLICATION_JSON 50 /* application/json */ -#define COAP_MEDIATYPE_APPLICATION_CBOR 60 /* application/cbor */ - -/* Note that identifiers for registered media types are in the range 0-65535. We - * use an unallocated type here and hope for the best. */ -#define COAP_MEDIATYPE_ANY 0xff /* any media type */ - -/** - * coap_tid_t is used to store CoAP transaction id, i.e. a hash value - * built from the remote transport address and the message id of a - * CoAP PDU. Valid transaction ids are greater or equal zero. - */ -typedef int coap_tid_t; - -/** Indicates an invalid transaction id. */ -#define COAP_INVALID_TID -1 - -/** - * Indicates that a response is suppressed. This will occur for error - * responses if the request was received via IP multicast. - */ -#define COAP_DROPPED_RESPONSE -2 - -#ifdef WORDS_BIGENDIAN -typedef struct { - unsigned int version:2; /* protocol version */ - unsigned int type:2; /* type flag */ - unsigned int token_length:4; /* length of Token */ - unsigned int code:8; /* request method (value 1--10) or response - code (value 40-255) */ - unsigned short id; /* message id */ - unsigned char token[]; /* the actual token, if any */ -} coap_hdr_t; -#else -typedef struct { - unsigned int token_length:4; /* length of Token */ - unsigned int type:2; /* type flag */ - unsigned int version:2; /* protocol version */ - unsigned int code:8; /* request method (value 1--10) or response - code (value 40-255) */ - unsigned short id; /* transaction id (network byte order!) */ - unsigned char token[]; /* the actual token, if any */ -} coap_hdr_t; -#endif - -#define COAP_MESSAGE_IS_EMPTY(MSG) ((MSG)->code == 0) -#define COAP_MESSAGE_IS_REQUEST(MSG) (!COAP_MESSAGE_IS_EMPTY(MSG) \ - && ((MSG)->code < 32)) -#define COAP_MESSAGE_IS_RESPONSE(MSG) ((MSG)->code >= 64) - -#define COAP_OPT_LONG 0x0F /* OC == 0b1111 indicates that the option list - * in a CoAP message is limited by 0b11110000 - * marker */ - -#define COAP_OPT_END 0xF0 /* end marker */ - -#define COAP_PAYLOAD_START 0xFF /* payload marker */ - -/** - * Structures for more convenient handling of options. (To be used with ordered - * coap_list_t.) The option's data will be added to the end of the coap_option - * structure (see macro COAP_OPTION_DATA). - */ -typedef struct { - unsigned short key; /* the option key (no delta coding) */ - unsigned int length; -} coap_option; - -#define COAP_OPTION_KEY(option) (option).key -#define COAP_OPTION_LENGTH(option) (option).length -#define COAP_OPTION_DATA(option) ((unsigned char *)&(option) + sizeof(coap_option)) - -/** - * Header structure for CoAP PDUs - */ - -typedef struct { - size_t max_size; /**< allocated storage for options and data */ - coap_hdr_t *hdr; /**< Address of the first byte of the CoAP message. - * This may or may not equal (coap_hdr_t*)(pdu+1) - * depending on the memory management - * implementation. */ - unsigned short max_delta; /**< highest option number */ - unsigned short length; /**< PDU length (including header, options, data) */ - unsigned char *data; /**< payload */ - -#ifdef WITH_LWIP - struct pbuf *pbuf; /**< lwIP PBUF. The package data will always reside - * inside the pbuf's payload, but this pointer - * has to be kept because no exact offset can be - * given. This field must not be accessed from - * outside, because the pbuf's reference count - * is checked to be 1 when the pbuf is assigned - * to the pdu, and the pbuf stays exclusive to - * this pdu. */ -#endif -} coap_pdu_t; - -/** - * Options in coap_pdu_t are accessed with the macro COAP_OPTION. - */ -#define COAP_OPTION(node) ((coap_option *)(node)->options) - -#ifdef WITH_LWIP -/** - * Creates a CoAP PDU from an lwIP @p pbuf, whose reference is passed on to this - * function. - * - * The pbuf is checked for being contiguous, and for having only one reference. - * The reference is stored in the PDU and will be freed when the PDU is freed. - * - * (For now, these are fatal errors; in future, a new pbuf might be allocated, - * the data copied and the passed pbuf freed). - * - * This behaves like coap_pdu_init(0, 0, 0, pbuf->tot_len), and afterwards - * copying the contents of the pbuf to the pdu. - * - * @return A pointer to the new PDU object or @c NULL on error. - */ -coap_pdu_t * coap_pdu_from_pbuf(struct pbuf *pbuf); -#endif - -/** - * Creates a new CoAP PDU of given @p size (must be large enough to hold the - * basic CoAP message header (coap_hdr_t). The function returns a pointer to the - * node coap_pdu_t object on success, or @c NULL on error. The storage allocated - * for the result must be released with coap_delete_pdu(). - * - * @param type The type of the PDU (one of COAP_MESSAGE_CON, COAP_MESSAGE_NON, - * COAP_MESSAGE_ACK, COAP_MESSAGE_RST). - * @param code The message code. - * @param id The message id to set or COAP_INVALID_TID if unknown. - * @param size The number of bytes to allocate for the actual message. - * - * @return A pointer to the new PDU object or @c NULL on error. - */ -coap_pdu_t * -coap_pdu_init(unsigned char type, - unsigned char code, - unsigned short id, - size_t size); - -/** - * Clears any contents from @p pdu and resets @c version field, @c - * length and @c data pointers. @c max_size is set to @p size, any - * other field is set to @c 0. Note that @p pdu must be a valid - * pointer to a coap_pdu_t object created e.g. by coap_pdu_init(). - */ -void coap_pdu_clear(coap_pdu_t *pdu, size_t size); - -/** - * Creates a new CoAP PDU. - * The object is created on the heap and must be released using - * coap_delete_pdu(); - * - * @deprecated This function allocates the maximum storage for each - * PDU. Use coap_pdu_init() instead. - */ -coap_pdu_t *coap_new_pdu(void); - -void coap_delete_pdu(coap_pdu_t *); - -/** - * Parses @p data into the CoAP PDU structure given in @p result. - * This function returns @c 0 on error or a number greater than zero on success. - * - * @param data The raw data to parse as CoAP PDU. - * @param length The actual size of @p data. - * @param result The PDU structure to fill. Note that the structure must - * provide space for at least @p length bytes to hold the - * entire CoAP PDU. - * - * @return A value greater than zero on success or @c 0 on error. - */ -int coap_pdu_parse(unsigned char *data, - size_t length, - coap_pdu_t *result); - -/** - * Adds token of length @p len to @p pdu. - * Adding the token destroys any following contents of the pdu. Hence options - * and data must be added after coap_add_token() has been called. In @p pdu, - * length is set to @p len + @c 4, and max_delta is set to @c 0. This funtion - * returns @c 0 on error or a value greater than zero on success. - * - * @param pdu The PDU where the token is to be added. - * @param len The length of the new token. - * @param data The token to add. - * - * @return A value greater than zero on success, or @c 0 on error. - */ -int coap_add_token(coap_pdu_t *pdu, - size_t len, - const unsigned char *data); - -/** - * Adds option of given type to pdu that is passed as first - * parameter. - * coap_add_option() destroys the PDU's data, so coap_add_data() must be called - * after all options have been added. As coap_add_token() destroys the options - * following the token, the token must be added before coap_add_option() is - * called. This function returns the number of bytes written or @c 0 on error. - */ -size_t coap_add_option(coap_pdu_t *pdu, - unsigned short type, - unsigned int len, - const unsigned char *data); - -/** - * Adds option of given type to pdu that is passed as first parameter, but does - * not write a value. It works like coap_add_option with respect to calling - * sequence (i.e. after token and before data). This function returns a memory - * address to which the option data has to be written before the PDU can be - * sent, or @c NULL on error. - */ -unsigned char *coap_add_option_later(coap_pdu_t *pdu, - unsigned short type, - unsigned int len); - -/** - * Adds given data to the pdu that is passed as first parameter. Note that the - * PDU's data is destroyed by coap_add_option(). coap_add_data() must be called - * only once per PDU, otherwise the result is undefined. - */ -int coap_add_data(coap_pdu_t *pdu, - unsigned int len, - const unsigned char *data); - -/** - * Retrieves the length and data pointer of specified PDU. Returns 0 on error or - * 1 if *len and *data have correct values. Note that these values are destroyed - * with the pdu. - */ -int coap_get_data(coap_pdu_t *pdu, - size_t *len, - unsigned char **data); - -#endif /* _COAP_PDU_H_ */ diff --git a/tools/sdk/include/coap/coap/prng.h b/tools/sdk/include/coap/coap/prng.h deleted file mode 100644 index da6d9534404..00000000000 --- a/tools/sdk/include/coap/coap/prng.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * prng.h -- Pseudo Random Numbers - * - * Copyright (C) 2010-2011 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -/** - * @file prng.h - * @brief Pseudo Random Numbers - */ - -#ifndef _COAP_PRNG_H_ -#define _COAP_PRNG_H_ - -/** - * @defgroup prng Pseudo Random Numbers - * @{ - */ - -#if defined(WITH_POSIX) || (defined(WITH_LWIP) && !defined(LWIP_RAND)) -#include - -/** - * Fills \p buf with \p len random bytes. This is the default implementation for - * prng(). You might want to change prng() to use a better PRNG on your specific - * platform. - */ -static inline int -coap_prng_impl(unsigned char *buf, size_t len) { - while (len--) - *buf++ = rand() & 0xFF; - return 1; -} -#endif /* WITH_POSIX */ - -#ifdef WITH_CONTIKI -#include - -/** - * Fills \p buf with \p len random bytes. This is the default implementation for - * prng(). You might want to change prng() to use a better PRNG on your specific - * platform. - */ -static inline int -contiki_prng_impl(unsigned char *buf, size_t len) { - unsigned short v = random_rand(); - while (len > sizeof(v)) { - memcpy(buf, &v, sizeof(v)); - len -= sizeof(v); - buf += sizeof(v); - v = random_rand(); - } - - memcpy(buf, &v, len); - return 1; -} - -#define prng(Buf,Length) contiki_prng_impl((Buf), (Length)) -#define prng_init(Value) random_init((unsigned short)(Value)) -#endif /* WITH_CONTIKI */ - -#if defined(WITH_LWIP) && defined(LWIP_RAND) -static inline int -lwip_prng_impl(unsigned char *buf, size_t len) { - u32_t v = LWIP_RAND(); - while (len > sizeof(v)) { - memcpy(buf, &v, sizeof(v)); - len -= sizeof(v); - buf += sizeof(v); - v = LWIP_RAND(); - } - - memcpy(buf, &v, len); - return 1; -} - -#define prng(Buf,Length) lwip_prng_impl((Buf), (Length)) -#define prng_init(Value) - -#endif /* WITH_LWIP */ - -#ifndef prng -/** - * Fills \p Buf with \p Length bytes of random data. - * - * @hideinitializer - */ -#define prng(Buf,Length) coap_prng_impl((Buf), (Length)) -#endif - -#ifndef prng_init -/** - * Called to set the PRNG seed. You may want to re-define this to allow for a - * better PRNG. - * - * @hideinitializer - */ -#define prng_init(Value) srand((unsigned long)(Value)) -#endif - -/** @} */ - -#endif /* _COAP_PRNG_H_ */ diff --git a/tools/sdk/include/coap/coap/resource.h b/tools/sdk/include/coap/coap/resource.h deleted file mode 100644 index dbb19a8d1f6..00000000000 --- a/tools/sdk/include/coap/coap/resource.h +++ /dev/null @@ -1,408 +0,0 @@ -/* - * resource.h -- generic resource handling - * - * Copyright (C) 2010,2011,2014,2015 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -/** - * @file resource.h - * @brief Generic resource handling - */ - -#ifndef _COAP_RESOURCE_H_ -#define _COAP_RESOURCE_H_ - -# include - -#ifndef COAP_RESOURCE_CHECK_TIME -/** The interval in seconds to check if resources have changed. */ -#define COAP_RESOURCE_CHECK_TIME 2 -#endif /* COAP_RESOURCE_CHECK_TIME */ - -#ifdef COAP_RESOURCES_NOHASH -# include "utlist.h" -#else -# include "uthash.h" -#endif - -#include "hashkey.h" -#include "async.h" -#include "str.h" -#include "pdu.h" -#include "net.h" -#include "subscribe.h" - -/** - * Definition of message handler function (@sa coap_resource_t). - */ -typedef void (*coap_method_handler_t) - (coap_context_t *, - struct coap_resource_t *, - const coap_endpoint_t *, - coap_address_t *, - coap_pdu_t *, - str * /* token */, - coap_pdu_t * /* response */); - -#define COAP_ATTR_FLAGS_RELEASE_NAME 0x1 -#define COAP_ATTR_FLAGS_RELEASE_VALUE 0x2 - -typedef struct coap_attr_t { - struct coap_attr_t *next; - str name; - str value; - int flags; -} coap_attr_t; - -/** The URI passed to coap_resource_init() is free'd by coap_delete_resource(). */ -#define COAP_RESOURCE_FLAGS_RELEASE_URI 0x1 - -/** - * Notifications will be sent non-confirmable by default. RFC 7641 Section 4.5 - * https://tools.ietf.org/html/rfc7641#section-4.5 - */ -#define COAP_RESOURCE_FLAGS_NOTIFY_NON 0x0 - -/** - * Notifications will be sent confirmable by default. RFC 7641 Section 4.5 - * https://tools.ietf.org/html/rfc7641#section-4.5 - */ -#define COAP_RESOURCE_FLAGS_NOTIFY_CON 0x2 - -typedef struct coap_resource_t { - unsigned int dirty:1; /**< set to 1 if resource has changed */ - unsigned int partiallydirty:1; /**< set to 1 if some subscribers have not yet - * been notified of the last change */ - unsigned int observable:1; /**< can be observed */ - unsigned int cacheable:1; /**< can be cached */ - - /** - * Used to store handlers for the four coap methods @c GET, @c POST, @c PUT, - * and @c DELETE. coap_dispatch() will pass incoming requests to the handler - * that corresponds to its request method or generate a 4.05 response if no - * handler is available. - */ - coap_method_handler_t handler[4]; - - coap_key_t key; /**< the actual key bytes for this resource */ - -#ifdef COAP_RESOURCES_NOHASH - struct coap_resource_t *next; -#else - UT_hash_handle hh; -#endif - - coap_attr_t *link_attr; /**< attributes to be included with the link format */ - coap_subscription_t *subscribers; /**< list of observers for this resource */ - - /** - * Request URI for this resource. This field will point into the static - * memory. - */ - str uri; - int flags; - -} coap_resource_t; - -/** - * Creates a new resource object and initializes the link field to the string - * of length @p len. This function returns the new coap_resource_t object. - * - * @param uri The URI path of the new resource. - * @param len The length of @p uri. - * @param flags Flags for memory management (in particular release of memory). - * - * @return A pointer to the new object or @c NULL on error. - */ -coap_resource_t *coap_resource_init(const unsigned char *uri, - size_t len, int flags); - - -/** - * Sets the notification message type of resource @p r to given - * @p mode which must be one of @c COAP_RESOURCE_FLAGS_NOTIFY_NON - * or @c COAP_RESOURCE_FLAGS_NOTIFY_CON. - */ -static inline void -coap_resource_set_mode(coap_resource_t *r, int mode) { - r->flags = (r->flags & !COAP_RESOURCE_FLAGS_NOTIFY_CON) | mode; -} - -/** - * Registers the given @p resource for @p context. The resource must have been - * created by coap_resource_init(), the storage allocated for the resource will - * be released by coap_delete_resource(). - * - * @param context The context to use. - * @param resource The resource to store. - */ -void coap_add_resource(coap_context_t *context, coap_resource_t *resource); - -/** - * Deletes a resource identified by @p key. The storage allocated for that - * resource is freed. - * - * @param context The context where the resources are stored. - * @param key The unique key for the resource to delete. - * - * @return @c 1 if the resource was found (and destroyed), - * @c 0 otherwise. - */ -int coap_delete_resource(coap_context_t *context, coap_key_t key); - -/** - * Deletes all resources from given @p context and frees their storage. - * - * @param context The CoAP context with the resources to be deleted. - */ -void coap_delete_all_resources(coap_context_t *context); - -/** - * Registers a new attribute with the given @p resource. As the - * attributes str fields will point to @p name and @p val the - * caller must ensure that these pointers are valid during the - * attribute's lifetime. - * - * @param resource The resource to register the attribute with. - * @param name The attribute's name. - * @param nlen Length of @p name. - * @param val The attribute's value or @c NULL if none. - * @param vlen Length of @p val if specified. - * @param flags Flags for memory management (in particular release of - * memory). - * - * @return A pointer to the new attribute or @c NULL on error. - */ -coap_attr_t *coap_add_attr(coap_resource_t *resource, - const unsigned char *name, - size_t nlen, - const unsigned char *val, - size_t vlen, - int flags); - -/** - * Returns @p resource's coap_attr_t object with given @p name if found, @c NULL - * otherwise. - * - * @param resource The resource to search for attribute @p name. - * @param name Name of the requested attribute. - * @param nlen Actual length of @p name. - * @return The first attribute with specified @p name or @c NULL if none - * was found. - */ -coap_attr_t *coap_find_attr(coap_resource_t *resource, - const unsigned char *name, - size_t nlen); - -/** - * Deletes an attribute. - * - * @param attr Pointer to a previously created attribute. - * - */ -void coap_delete_attr(coap_attr_t *attr); - -/** - * Status word to encode the result of conditional print or copy operations such - * as coap_print_link(). The lower 28 bits of coap_print_status_t are used to - * encode the number of characters that has actually been printed, bits 28 to 31 - * encode the status. When COAP_PRINT_STATUS_ERROR is set, an error occurred - * during output. In this case, the other bits are undefined. - * COAP_PRINT_STATUS_TRUNC indicates that the output is truncated, i.e. the - * printing would have exceeded the current buffer. - */ -typedef unsigned int coap_print_status_t; - -#define COAP_PRINT_STATUS_MASK 0xF0000000u -#define COAP_PRINT_OUTPUT_LENGTH(v) ((v) & ~COAP_PRINT_STATUS_MASK) -#define COAP_PRINT_STATUS_ERROR 0x80000000u -#define COAP_PRINT_STATUS_TRUNC 0x40000000u - -/** - * Writes a description of this resource in link-format to given text buffer. @p - * len must be initialized to the maximum length of @p buf and will be set to - * the number of characters actually written if successful. This function - * returns @c 1 on success or @c 0 on error. - * - * @param resource The resource to describe. - * @param buf The output buffer to write the description to. - * @param len Must be initialized to the length of @p buf and - * will be set to the length of the printed link description. - * @param offset The offset within the resource description where to - * start writing into @p buf. This is useful for dealing - * with the Block2 option. @p offset is updated during - * output as it is consumed. - * - * @return If COAP_PRINT_STATUS_ERROR is set, an error occured. Otherwise, - * the lower 28 bits will indicate the number of characters that - * have actually been output into @p buffer. The flag - * COAP_PRINT_STATUS_TRUNC indicates that the output has been - * truncated. - */ -coap_print_status_t coap_print_link(const coap_resource_t *resource, - unsigned char *buf, - size_t *len, - size_t *offset); - -/** - * Registers the specified @p handler as message handler for the request type @p - * method - * - * @param resource The resource for which the handler shall be registered. - * @param method The CoAP request method to handle. - * @param handler The handler to register with @p resource. - */ -static inline void -coap_register_handler(coap_resource_t *resource, - unsigned char method, - coap_method_handler_t handler) { - assert(resource); - assert(method > 0 && (size_t)(method-1) < sizeof(resource->handler)/sizeof(coap_method_handler_t)); - resource->handler[method-1] = handler; -} - -/** - * Returns the resource identified by the unique string @p key. If no resource - * was found, this function returns @c NULL. - * - * @param context The context to look for this resource. - * @param key The unique key of the resource. - * - * @return A pointer to the resource or @c NULL if not found. - */ -coap_resource_t *coap_get_resource_from_key(coap_context_t *context, - coap_key_t key); - -/** - * Calculates the hash key for the resource requested by the Uri-Options of @p - * request. This function calls coap_hash() for every path segment. - * - * @param request The requesting pdu. - * @param key The resulting hash is stored in @p key. - */ -void coap_hash_request_uri(const coap_pdu_t *request, coap_key_t key); - -/** - * @addtogroup observe - */ - -/** - * Adds the specified peer as observer for @p resource. The subscription is - * identified by the given @p token. This function returns the registered - * subscription information if the @p observer has been added, or @c NULL on - * error. - * - * @param resource The observed resource. - * @param local_interface The local network interface where the observer is - * attached to. - * @param observer The remote peer that wants to received status updates. - * @param token The token that identifies this subscription. - * @return A pointer to the added/updated subscription - * information or @c NULL on error. - */ -coap_subscription_t *coap_add_observer(coap_resource_t *resource, - const coap_endpoint_t *local_interface, - const coap_address_t *observer, - const str *token); - -/** - * Returns a subscription object for given @p peer. - * - * @param resource The observed resource. - * @param peer The address to search for. - * @param token The token that identifies this subscription or @c NULL for - * any token. - * @return A valid subscription if exists or @c NULL otherwise. - */ -coap_subscription_t *coap_find_observer(coap_resource_t *resource, - const coap_address_t *peer, - const str *token); - -/** - * Marks an observer as alive. - * - * @param context The CoAP context to use. - * @param observer The transport address of the observer. - * @param token The corresponding token that has been used for the - * subscription. - */ -void coap_touch_observer(coap_context_t *context, - const coap_address_t *observer, - const str *token); - -/** - * Removes any subscription for @p observer from @p resource and releases the - * allocated storage. The result is @c 1 if an observation relationship with @p - * observer and @p token existed, @c 0 otherwise. - * - * @param resource The observed resource. - * @param observer The observer's address. - * @param token The token that identifies this subscription or @c NULL for - * any token. - * @return @c 1 if the observer has been deleted, @c 0 otherwise. - */ -int coap_delete_observer(coap_resource_t *resource, - const coap_address_t *observer, - const str *token); - -/** - * Checks for all known resources, if they are dirty and notifies subscribed - * observers. - */ -void coap_check_notify(coap_context_t *context); - -#ifdef COAP_RESOURCES_NOHASH - -#define RESOURCES_ADD(r, obj) \ - LL_PREPEND((r), (obj)) - -#define RESOURCES_DELETE(r, obj) \ - LL_DELETE((r), (obj)) - -#define RESOURCES_ITER(r,tmp) \ - coap_resource_t *tmp; \ - LL_FOREACH((r), tmp) - -#define RESOURCES_FIND(r, k, res) { \ - coap_resource_t *tmp; \ - (res) = tmp = NULL; \ - LL_FOREACH((r), tmp) { \ - if (memcmp((k), tmp->key, sizeof(coap_key_t)) == 0) { \ - (res) = tmp; \ - break; \ - } \ - } \ - } -#else /* COAP_RESOURCES_NOHASH */ - -#define RESOURCES_ADD(r, obj) \ - HASH_ADD(hh, (r), key, sizeof(coap_key_t), (obj)) - -#define RESOURCES_DELETE(r, obj) \ - HASH_DELETE(hh, (r), (obj)) - -#define RESOURCES_ITER(r,tmp) \ - coap_resource_t *tmp, *rtmp; \ - HASH_ITER(hh, (r), tmp, rtmp) - -#define RESOURCES_FIND(r, k, res) { \ - HASH_FIND(hh, (r), (k), sizeof(coap_key_t), (res)); \ - } - -#endif /* COAP_RESOURCES_NOHASH */ - -/** @} */ - -coap_print_status_t coap_print_wellknown(coap_context_t *, - unsigned char *, - size_t *, size_t, - coap_opt_t *); - -void coap_handle_failed_notify(coap_context_t *, - const coap_address_t *, - const str *); - -#endif /* _COAP_RESOURCE_H_ */ diff --git a/tools/sdk/include/coap/coap/str.h b/tools/sdk/include/coap/coap/str.h deleted file mode 100644 index 3dfa6731550..00000000000 --- a/tools/sdk/include/coap/coap/str.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * str.h -- strings to be used in the CoAP library - * - * Copyright (C) 2010-2011 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -#ifndef _COAP_STR_H_ -#define _COAP_STR_H_ - -#include - -typedef struct { - size_t length; /* length of string */ - unsigned char *s; /* string data */ -} str; - -#define COAP_SET_STR(st,l,v) { (st)->length = (l), (st)->s = (v); } - -/** - * Returns a new string object with at least size bytes storage allocated. The - * string must be released using coap_delete_string(); - */ -str *coap_new_string(size_t size); - -/** - * Deletes the given string and releases any memory allocated. - */ -void coap_delete_string(str *); - -#endif /* _COAP_STR_H_ */ diff --git a/tools/sdk/include/coap/coap/subscribe.h b/tools/sdk/include/coap/coap/subscribe.h deleted file mode 100644 index 52068642dd7..00000000000 --- a/tools/sdk/include/coap/coap/subscribe.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * subscribe.h -- subscription handling for CoAP - * see draft-ietf-core-observe-16 - * - * Copyright (C) 2010-2012,2014-2015 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - - -#ifndef _COAP_SUBSCRIBE_H_ -#define _COAP_SUBSCRIBE_H_ - -#include "address.h" -#include "coap_io.h" - -/** - * @defgroup observe Resource observation - * @{ - */ - -/** - * The value COAP_OBSERVE_ESTABLISH in a GET request indicates a new observe - * relationship for (sender address, token) is requested. - */ -#define COAP_OBSERVE_ESTABLISH 0 - -/** - * The value COAP_OBSERVE_CANCEL in a GET request indicates that the observe - * relationship for (sender address, token) must be cancelled. - */ -#define COAP_OBSERVE_CANCEL 1 - -#ifndef COAP_OBS_MAX_NON -/** - * Number of notifications that may be sent non-confirmable before a confirmable - * message is sent to detect if observers are alive. The maximum allowed value - * here is @c 15. - */ -#define COAP_OBS_MAX_NON 5 -#endif /* COAP_OBS_MAX_NON */ - -#ifndef COAP_OBS_MAX_FAIL -/** - * Number of confirmable notifications that may fail (i.e. time out without - * being ACKed) before an observer is removed. The maximum value for - * COAP_OBS_MAX_FAIL is @c 3. - */ -#define COAP_OBS_MAX_FAIL 3 -#endif /* COAP_OBS_MAX_FAIL */ - -/** Subscriber information */ -typedef struct coap_subscription_t { - struct coap_subscription_t *next; /**< next element in linked list */ - coap_endpoint_t local_if; /**< local communication interface */ - coap_address_t subscriber; /**< address and port of subscriber */ - - unsigned int non_cnt:4; /**< up to 15 non-confirmable notifies allowed */ - unsigned int fail_cnt:2; /**< up to 3 confirmable notifies can fail */ - unsigned int dirty:1; /**< set if the notification temporarily could not be - * sent (in that case, the resource's partially - * dirty flag is set too) */ - size_t token_length; /**< actual length of token */ - unsigned char token[8]; /**< token used for subscription */ -} coap_subscription_t; - -void coap_subscription_init(coap_subscription_t *); - -/** @} */ - -#endif /* _COAP_SUBSCRIBE_H_ */ diff --git a/tools/sdk/include/coap/coap/uri.h b/tools/sdk/include/coap/coap/uri.h deleted file mode 100644 index 2340a7a6c88..00000000000 --- a/tools/sdk/include/coap/coap/uri.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * uri.h -- helper functions for URI treatment - * - * Copyright (C) 2010-2011,2016 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -#ifndef _COAP_URI_H_ -#define _COAP_URI_H_ - -#include "hashkey.h" -#include "str.h" - -/** - * Representation of parsed URI. Components may be filled from a string with - * coap_split_uri() and can be used as input for option-creation functions. - */ -typedef struct { - str host; /**< host part of the URI */ - unsigned short port; /**< The port in host byte order */ - str path; /**< Beginning of the first path segment. - Use coap_split_path() to create Uri-Path options */ - str query; /**< The query part if present */ -} coap_uri_t; - -/** - * Creates a new coap_uri_t object from the specified URI. Returns the new - * object or NULL on error. The memory allocated by the new coap_uri_t - * must be released using coap_free(). - * - * @param uri The URI path to copy. - * @param length The length of uri. - * - * @return New URI object or NULL on error. - */ -coap_uri_t *coap_new_uri(const unsigned char *uri, unsigned int length); - -/** - * Clones the specified coap_uri_t object. Thie function allocates sufficient - * memory to hold the coap_uri_t structure and its contents. The object must - * be released with coap_free(). */ -coap_uri_t *coap_clone_uri(const coap_uri_t *uri); - -/** - * Calculates a hash over the given path and stores the result in - * @p key. This function returns @c 0 on error or @c 1 on success. - * - * @param path The URI path to generate hash for. - * @param len The length of @p path. - * @param key The output buffer. - * - * @return @c 1 if @p key was set, @c 0 otherwise. - */ -int coap_hash_path(const unsigned char *path, size_t len, coap_key_t key); - -/** - * @defgroup uri_parse URI Parsing Functions - * - * CoAP PDUs contain normalized URIs with their path and query split into - * multiple segments. The functions in this module help splitting strings. - * @{ - */ - -/** - * Parses a given string into URI components. The identified syntactic - * components are stored in the result parameter @p uri. Optional URI - * components that are not specified will be set to { 0, 0 }, except for the - * port which is set to @c COAP_DEFAULT_PORT. This function returns @p 0 if - * parsing succeeded, a value less than zero otherwise. - * - * @param str_var The string to split up. - * @param len The actual length of @p str_var - * @param uri The coap_uri_t object to store the result. - * @return @c 0 on success, or < 0 on error. - * - */ -int coap_split_uri(const unsigned char *str_var, size_t len, coap_uri_t *uri); - -/** - * Splits the given URI path into segments. Each segment is preceded - * by an option pseudo-header with delta-value 0 and the actual length - * of the respective segment after percent-decoding. - * - * @param s The path string to split. - * @param length The actual length of @p s. - * @param buf Result buffer for parsed segments. - * @param buflen Maximum length of @p buf. Will be set to the actual number - * of bytes written into buf on success. - * - * @return The number of segments created or @c -1 on error. - */ -int coap_split_path(const unsigned char *s, - size_t length, - unsigned char *buf, - size_t *buflen); - -/** - * Splits the given URI query into segments. Each segment is preceded - * by an option pseudo-header with delta-value 0 and the actual length - * of the respective query term. - * - * @param s The query string to split. - * @param length The actual length of @p s. - * @param buf Result buffer for parsed segments. - * @param buflen Maximum length of @p buf. Will be set to the actual number - * of bytes written into buf on success. - * - * @return The number of segments created or @c -1 on error. - * - * @bug This function does not reserve additional space for delta > 12. - */ -int coap_split_query(const unsigned char *s, - size_t length, - unsigned char *buf, - size_t *buflen); - -/** @} */ - -#endif /* _COAP_URI_H_ */ diff --git a/tools/sdk/include/coap/coap/uthash.h b/tools/sdk/include/coap/coap/uthash.h deleted file mode 100644 index 32b7a81cfbb..00000000000 --- a/tools/sdk/include/coap/coap/uthash.h +++ /dev/null @@ -1,963 +0,0 @@ -/* -Copyright (c) 2003-2014, Troy D. Hanson http://troydhanson.github.com/uthash/ -All rights reserved. - -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. - -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 UTHASH_H -#define UTHASH_H - -#include /* memcmp,strlen */ -#include /* ptrdiff_t */ -#include /* exit() */ - -/* These macros use decltype or the earlier __typeof GNU extension. - As decltype is only available in newer compilers (VS2010 or gcc 4.3+ - when compiling c++ source) this code uses whatever method is needed - or, for VS2008 where neither is available, uses casting workarounds. */ -#if defined(_MSC_VER) /* MS compiler */ -#if _MSC_VER >= 1600 && defined(__cplusplus) /* VS2010 or newer in C++ mode */ -#define DECLTYPE(x) (decltype(x)) -#else /* VS2008 or older (or VS2010 in C mode) */ -#define NO_DECLTYPE -#define DECLTYPE(x) -#endif -#elif defined(__BORLANDC__) || defined(__LCC__) || defined(__WATCOMC__) -#define NO_DECLTYPE -#define DECLTYPE(x) -#else /* GNU, Sun and other compilers */ -#define DECLTYPE(x) (__typeof(x)) -#endif - -#ifdef NO_DECLTYPE -#define DECLTYPE_ASSIGN(dst,src) \ -do { \ - char **_da_dst = (char**)(&(dst)); \ - *_da_dst = (char*)(src); \ -} while(0) -#else -#define DECLTYPE_ASSIGN(dst,src) \ -do { \ - (dst) = DECLTYPE(dst)(src); \ -} while(0) -#endif - -/* a number of the hash function use uint32_t which isn't defined on Pre VS2010 */ -#if defined (_WIN32) -#if defined(_MSC_VER) && _MSC_VER >= 1600 -#include -#elif defined(__WATCOMC__) -#include -#else -typedef unsigned int uint32_t; -typedef unsigned char uint8_t; -#endif -#else -#include -#endif - -#define UTHASH_VERSION 1.9.9 - -#ifndef uthash_fatal -#define uthash_fatal(msg) exit(-1) /* fatal error (out of memory,etc) */ -#endif -#ifndef uthash_malloc -#define uthash_malloc(sz) malloc(sz) /* malloc fcn */ -#endif -#ifndef uthash_free -#define uthash_free(ptr,sz) free(ptr) /* free fcn */ -#endif - -#ifndef uthash_noexpand_fyi -#define uthash_noexpand_fyi(tbl) /* can be defined to log noexpand */ -#endif -#ifndef uthash_expand_fyi -#define uthash_expand_fyi(tbl) /* can be defined to log expands */ -#endif - -/* initial number of buckets */ -#define HASH_INITIAL_NUM_BUCKETS 32 /* initial number of buckets */ -#define HASH_INITIAL_NUM_BUCKETS_LOG2 5 /* lg2 of initial number of buckets */ -#define HASH_BKT_CAPACITY_THRESH 10 /* expand when bucket count reaches */ - -/* calculate the element whose hash handle address is hhe */ -#define ELMT_FROM_HH(tbl,hhp) ((void*)(((char*)(hhp)) - ((tbl)->hho))) - -#define HASH_FIND(hh,head,keyptr,keylen,out) \ -do { \ - out=NULL; \ - if (head) { \ - unsigned _hf_bkt,_hf_hashv; \ - HASH_FCN(keyptr,keylen, (head)->hh.tbl->num_buckets, _hf_hashv, _hf_bkt); \ - if (HASH_BLOOM_TEST((head)->hh.tbl, _hf_hashv)) { \ - HASH_FIND_IN_BKT((head)->hh.tbl, hh, (head)->hh.tbl->buckets[ _hf_bkt ], \ - keyptr,keylen,out); \ - } \ - } \ -} while (0) - -#ifdef HASH_BLOOM -#define HASH_BLOOM_BITLEN (1ULL << HASH_BLOOM) -#define HASH_BLOOM_BYTELEN (HASH_BLOOM_BITLEN/8) + ((HASH_BLOOM_BITLEN%8) ? 1:0) -#define HASH_BLOOM_MAKE(tbl) \ -do { \ - (tbl)->bloom_nbits = HASH_BLOOM; \ - (tbl)->bloom_bv = (uint8_t*)uthash_malloc(HASH_BLOOM_BYTELEN); \ - if (!((tbl)->bloom_bv)) { uthash_fatal( "out of memory"); } \ - memset((tbl)->bloom_bv, 0, HASH_BLOOM_BYTELEN); \ - (tbl)->bloom_sig = HASH_BLOOM_SIGNATURE; \ -} while (0) - -#define HASH_BLOOM_FREE(tbl) \ -do { \ - uthash_free((tbl)->bloom_bv, HASH_BLOOM_BYTELEN); \ -} while (0) - -#define HASH_BLOOM_BITSET(bv,idx) (bv[(idx)/8] |= (1U << ((idx)%8))) -#define HASH_BLOOM_BITTEST(bv,idx) (bv[(idx)/8] & (1U << ((idx)%8))) - -#define HASH_BLOOM_ADD(tbl,hashv) \ - HASH_BLOOM_BITSET((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1))) - -#define HASH_BLOOM_TEST(tbl,hashv) \ - HASH_BLOOM_BITTEST((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1))) - -#else -#define HASH_BLOOM_MAKE(tbl) -#define HASH_BLOOM_FREE(tbl) -#define HASH_BLOOM_ADD(tbl,hashv) -#define HASH_BLOOM_TEST(tbl,hashv) (1) -#define HASH_BLOOM_BYTELEN 0 -#endif - -#define HASH_MAKE_TABLE(hh,head) \ -do { \ - (head)->hh.tbl = (UT_hash_table*)uthash_malloc( \ - sizeof(UT_hash_table)); \ - if (!((head)->hh.tbl)) { uthash_fatal( "out of memory"); } \ - memset((head)->hh.tbl, 0, sizeof(UT_hash_table)); \ - (head)->hh.tbl->tail = &((head)->hh); \ - (head)->hh.tbl->num_buckets = HASH_INITIAL_NUM_BUCKETS; \ - (head)->hh.tbl->log2_num_buckets = HASH_INITIAL_NUM_BUCKETS_LOG2; \ - (head)->hh.tbl->hho = (char*)(&(head)->hh) - (char*)(head); \ - (head)->hh.tbl->buckets = (UT_hash_bucket*)uthash_malloc( \ - HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket)); \ - if (! (head)->hh.tbl->buckets) { uthash_fatal( "out of memory"); } \ - memset((head)->hh.tbl->buckets, 0, \ - HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket)); \ - HASH_BLOOM_MAKE((head)->hh.tbl); \ - (head)->hh.tbl->signature = HASH_SIGNATURE; \ -} while(0) - -#define HASH_ADD(hh,head,fieldname,keylen_in,add) \ - HASH_ADD_KEYPTR(hh,head,&((add)->fieldname),keylen_in,add) - -#define HASH_REPLACE(hh,head,fieldname,keylen_in,add,replaced) \ -do { \ - replaced=NULL; \ - HASH_FIND(hh,head,&((add)->fieldname),keylen_in,replaced); \ - if (replaced!=NULL) { \ - HASH_DELETE(hh,head,replaced); \ - }; \ - HASH_ADD(hh,head,fieldname,keylen_in,add); \ -} while(0) - -#define HASH_ADD_KEYPTR(hh,head,keyptr,keylen_in,add) \ -do { \ - unsigned _ha_bkt; \ - (add)->hh.next = NULL; \ - (add)->hh.key = (char*)(keyptr); \ - (add)->hh.keylen = (unsigned)(keylen_in); \ - if (!(head)) { \ - head = (add); \ - (head)->hh.prev = NULL; \ - HASH_MAKE_TABLE(hh,head); \ - } else { \ - (head)->hh.tbl->tail->next = (add); \ - (add)->hh.prev = ELMT_FROM_HH((head)->hh.tbl, (head)->hh.tbl->tail); \ - (head)->hh.tbl->tail = &((add)->hh); \ - } \ - (head)->hh.tbl->num_items++; \ - (add)->hh.tbl = (head)->hh.tbl; \ - HASH_FCN(keyptr,keylen_in, (head)->hh.tbl->num_buckets, \ - (add)->hh.hashv, _ha_bkt); \ - HASH_ADD_TO_BKT((head)->hh.tbl->buckets[_ha_bkt],&(add)->hh); \ - HASH_BLOOM_ADD((head)->hh.tbl,(add)->hh.hashv); \ - HASH_EMIT_KEY(hh,head,keyptr,keylen_in); \ - HASH_FSCK(hh,head); \ -} while(0) - -#define HASH_TO_BKT( hashv, num_bkts, bkt ) \ -do { \ - bkt = ((hashv) & ((num_bkts) - 1)); \ -} while(0) - -/* delete "delptr" from the hash table. - * "the usual" patch-up process for the app-order doubly-linked-list. - * The use of _hd_hh_del below deserves special explanation. - * These used to be expressed using (delptr) but that led to a bug - * if someone used the same symbol for the head and deletee, like - * HASH_DELETE(hh,users,users); - * We want that to work, but by changing the head (users) below - * we were forfeiting our ability to further refer to the deletee (users) - * in the patch-up process. Solution: use scratch space to - * copy the deletee pointer, then the latter references are via that - * scratch pointer rather than through the repointed (users) symbol. - */ -#define HASH_DELETE(hh,head,delptr) \ -do { \ - struct UT_hash_handle *_hd_hh_del; \ - if ( ((delptr)->hh.prev == NULL) && ((delptr)->hh.next == NULL) ) { \ - uthash_free((head)->hh.tbl->buckets, \ - (head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \ - HASH_BLOOM_FREE((head)->hh.tbl); \ - uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \ - head = NULL; \ - } else { \ - unsigned _hd_bkt; \ - _hd_hh_del = &((delptr)->hh); \ - if ((delptr) == ELMT_FROM_HH((head)->hh.tbl,(head)->hh.tbl->tail)) { \ - (head)->hh.tbl->tail = \ - (UT_hash_handle*)((ptrdiff_t)((delptr)->hh.prev) + \ - (head)->hh.tbl->hho); \ - } \ - if ((delptr)->hh.prev) { \ - ((UT_hash_handle*)((ptrdiff_t)((delptr)->hh.prev) + \ - (head)->hh.tbl->hho))->next = (delptr)->hh.next; \ - } else { \ - DECLTYPE_ASSIGN(head,(delptr)->hh.next); \ - } \ - if (_hd_hh_del->next) { \ - ((UT_hash_handle*)((ptrdiff_t)_hd_hh_del->next + \ - (head)->hh.tbl->hho))->prev = \ - _hd_hh_del->prev; \ - } \ - HASH_TO_BKT( _hd_hh_del->hashv, (head)->hh.tbl->num_buckets, _hd_bkt); \ - HASH_DEL_IN_BKT(hh,(head)->hh.tbl->buckets[_hd_bkt], _hd_hh_del); \ - (head)->hh.tbl->num_items--; \ - } \ - HASH_FSCK(hh,head); \ -} while (0) - - -/* convenience forms of HASH_FIND/HASH_ADD/HASH_DEL */ -#define HASH_FIND_STR(head,findstr,out) \ - HASH_FIND(hh,head,findstr,(unsigned)strlen(findstr),out) -#define HASH_ADD_STR(head,strfield,add) \ - HASH_ADD(hh,head,strfield[0],strlen(add->strfield),add) -#define HASH_REPLACE_STR(head,strfield,add,replaced) \ - HASH_REPLACE(hh,head,strfield[0],(unsigned)strlen(add->strfield),add,replaced) -#define HASH_FIND_INT(head,findint,out) \ - HASH_FIND(hh,head,findint,sizeof(int),out) -#define HASH_ADD_INT(head,intfield,add) \ - HASH_ADD(hh,head,intfield,sizeof(int),add) -#define HASH_REPLACE_INT(head,intfield,add,replaced) \ - HASH_REPLACE(hh,head,intfield,sizeof(int),add,replaced) -#define HASH_FIND_PTR(head,findptr,out) \ - HASH_FIND(hh,head,findptr,sizeof(void *),out) -#define HASH_ADD_PTR(head,ptrfield,add) \ - HASH_ADD(hh,head,ptrfield,sizeof(void *),add) -#define HASH_REPLACE_PTR(head,ptrfield,add,replaced) \ - HASH_REPLACE(hh,head,ptrfield,sizeof(void *),add,replaced) -#define HASH_DEL(head,delptr) \ - HASH_DELETE(hh,head,delptr) - -/* HASH_FSCK checks hash integrity on every add/delete when HASH_DEBUG is defined. - * This is for uthash developer only; it compiles away if HASH_DEBUG isn't defined. - */ -#ifdef HASH_DEBUG -#define HASH_OOPS(...) do { fprintf(stderr,__VA_ARGS__); exit(-1); } while (0) -#define HASH_FSCK(hh,head) \ -do { \ - struct UT_hash_handle *_thh; \ - if (head) { \ - unsigned _bkt_i; \ - unsigned _count; \ - char *_prev; \ - _count = 0; \ - for( _bkt_i = 0; _bkt_i < (head)->hh.tbl->num_buckets; _bkt_i++) { \ - unsigned _bkt_count = 0; \ - _thh = (head)->hh.tbl->buckets[_bkt_i].hh_head; \ - _prev = NULL; \ - while (_thh) { \ - if (_prev != (char*)(_thh->hh_prev)) { \ - HASH_OOPS("invalid hh_prev %p, actual %p\n", \ - _thh->hh_prev, _prev ); \ - } \ - _bkt_count++; \ - _prev = (char*)(_thh); \ - _thh = _thh->hh_next; \ - } \ - _count += _bkt_count; \ - if ((head)->hh.tbl->buckets[_bkt_i].count != _bkt_count) { \ - HASH_OOPS("invalid bucket count %u, actual %u\n", \ - (head)->hh.tbl->buckets[_bkt_i].count, _bkt_count); \ - } \ - } \ - if (_count != (head)->hh.tbl->num_items) { \ - HASH_OOPS("invalid hh item count %u, actual %u\n", \ - (head)->hh.tbl->num_items, _count ); \ - } \ - /* traverse hh in app order; check next/prev integrity, count */ \ - _count = 0; \ - _prev = NULL; \ - _thh = &(head)->hh; \ - while (_thh) { \ - _count++; \ - if (_prev !=(char*)(_thh->prev)) { \ - HASH_OOPS("invalid prev %p, actual %p\n", \ - _thh->prev, _prev ); \ - } \ - _prev = (char*)ELMT_FROM_HH((head)->hh.tbl, _thh); \ - _thh = ( _thh->next ? (UT_hash_handle*)((char*)(_thh->next) + \ - (head)->hh.tbl->hho) : NULL ); \ - } \ - if (_count != (head)->hh.tbl->num_items) { \ - HASH_OOPS("invalid app item count %u, actual %u\n", \ - (head)->hh.tbl->num_items, _count ); \ - } \ - } \ -} while (0) -#else -#define HASH_FSCK(hh,head) -#endif - -/* When compiled with -DHASH_EMIT_KEYS, length-prefixed keys are emitted to - * the descriptor to which this macro is defined for tuning the hash function. - * The app can #include to get the prototype for write(2). */ -#ifdef HASH_EMIT_KEYS -#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen) \ -do { \ - unsigned _klen = fieldlen; \ - write(HASH_EMIT_KEYS, &_klen, sizeof(_klen)); \ - write(HASH_EMIT_KEYS, keyptr, fieldlen); \ -} while (0) -#else -#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen) -#endif - -/* default to Jenkin's hash unless overridden e.g. DHASH_FUNCTION=HASH_SAX */ -#ifdef HASH_FUNCTION -#define HASH_FCN HASH_FUNCTION -#else -#define HASH_FCN HASH_JEN -#endif - -/* The Bernstein hash function, used in Perl prior to v5.6. Note (x<<5+x)=x*33. */ -#define HASH_BER(key,keylen,num_bkts,hashv,bkt) \ -do { \ - unsigned _hb_keylen=keylen; \ - char *_hb_key=(char*)(key); \ - (hashv) = 0; \ - while (_hb_keylen--) { (hashv) = (((hashv) << 5) + (hashv)) + *_hb_key++; } \ - bkt = (hashv) & (num_bkts-1); \ -} while (0) - - -/* SAX/FNV/OAT/JEN hash functions are macro variants of those listed at - * http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx */ -#define HASH_SAX(key,keylen,num_bkts,hashv,bkt) \ -do { \ - unsigned _sx_i; \ - char *_hs_key=(char*)(key); \ - hashv = 0; \ - for(_sx_i=0; _sx_i < keylen; _sx_i++) \ - hashv ^= (hashv << 5) + (hashv >> 2) + _hs_key[_sx_i]; \ - bkt = hashv & (num_bkts-1); \ -} while (0) -/* FNV-1a variation */ -#define HASH_FNV(key,keylen,num_bkts,hashv,bkt) \ -do { \ - unsigned _fn_i; \ - char *_hf_key=(char*)(key); \ - hashv = 2166136261UL; \ - for(_fn_i=0; _fn_i < keylen; _fn_i++) { \ - hashv = hashv ^ _hf_key[_fn_i]; \ - hashv = hashv * 16777619; \ - } \ - bkt = hashv & (num_bkts-1); \ -} while(0) - -#define HASH_OAT(key,keylen,num_bkts,hashv,bkt) \ -do { \ - unsigned _ho_i; \ - char *_ho_key=(char*)(key); \ - hashv = 0; \ - for(_ho_i=0; _ho_i < keylen; _ho_i++) { \ - hashv += _ho_key[_ho_i]; \ - hashv += (hashv << 10); \ - hashv ^= (hashv >> 6); \ - } \ - hashv += (hashv << 3); \ - hashv ^= (hashv >> 11); \ - hashv += (hashv << 15); \ - bkt = hashv & (num_bkts-1); \ -} while(0) - -#define HASH_JEN_MIX(a,b,c) \ -do { \ - a -= b; a -= c; a ^= ( c >> 13 ); \ - b -= c; b -= a; b ^= ( a << 8 ); \ - c -= a; c -= b; c ^= ( b >> 13 ); \ - a -= b; a -= c; a ^= ( c >> 12 ); \ - b -= c; b -= a; b ^= ( a << 16 ); \ - c -= a; c -= b; c ^= ( b >> 5 ); \ - a -= b; a -= c; a ^= ( c >> 3 ); \ - b -= c; b -= a; b ^= ( a << 10 ); \ - c -= a; c -= b; c ^= ( b >> 15 ); \ -} while (0) - -#define HASH_JEN(key,keylen,num_bkts,hashv,bkt) \ -do { \ - unsigned _hj_i,_hj_j,_hj_k; \ - unsigned char *_hj_key=(unsigned char*)(key); \ - hashv = 0xfeedbeef; \ - _hj_i = _hj_j = 0x9e3779b9; \ - _hj_k = (unsigned)(keylen); \ - while (_hj_k >= 12) { \ - _hj_i += (_hj_key[0] + ( (unsigned)_hj_key[1] << 8 ) \ - + ( (unsigned)_hj_key[2] << 16 ) \ - + ( (unsigned)_hj_key[3] << 24 ) ); \ - _hj_j += (_hj_key[4] + ( (unsigned)_hj_key[5] << 8 ) \ - + ( (unsigned)_hj_key[6] << 16 ) \ - + ( (unsigned)_hj_key[7] << 24 ) ); \ - hashv += (_hj_key[8] + ( (unsigned)_hj_key[9] << 8 ) \ - + ( (unsigned)_hj_key[10] << 16 ) \ - + ( (unsigned)_hj_key[11] << 24 ) ); \ - \ - HASH_JEN_MIX(_hj_i, _hj_j, hashv); \ - \ - _hj_key += 12; \ - _hj_k -= 12; \ - } \ - hashv += keylen; \ - switch ( _hj_k ) { \ - case 11: hashv += ( (unsigned)_hj_key[10] << 24 ); \ - case 10: hashv += ( (unsigned)_hj_key[9] << 16 ); \ - case 9: hashv += ( (unsigned)_hj_key[8] << 8 ); \ - case 8: _hj_j += ( (unsigned)_hj_key[7] << 24 ); \ - case 7: _hj_j += ( (unsigned)_hj_key[6] << 16 ); \ - case 6: _hj_j += ( (unsigned)_hj_key[5] << 8 ); \ - case 5: _hj_j += _hj_key[4]; \ - case 4: _hj_i += ( (unsigned)_hj_key[3] << 24 ); \ - case 3: _hj_i += ( (unsigned)_hj_key[2] << 16 ); \ - case 2: _hj_i += ( (unsigned)_hj_key[1] << 8 ); \ - case 1: _hj_i += _hj_key[0]; \ - /* case 0: nothing left to add */ \ - default: /* make gcc -Wswitch-default happy */ \ - ; \ - } \ - HASH_JEN_MIX(_hj_i, _hj_j, hashv); \ - bkt = hashv & (num_bkts-1); \ -} while(0) - -/* The Paul Hsieh hash function */ -#undef get16bits -#if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \ - || defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__) -#define get16bits(d) (*((const uint16_t *) (d))) -#endif - -#if !defined (get16bits) -#define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8) \ - +(uint32_t)(((const uint8_t *)(d))[0]) ) -#endif -#define HASH_SFH(key,keylen,num_bkts,hashv,bkt) \ -do { \ - unsigned char *_sfh_key=(unsigned char*)(key); \ - uint32_t _sfh_tmp, _sfh_len = keylen; \ - \ - int _sfh_rem = _sfh_len & 3; \ - _sfh_len >>= 2; \ - hashv = 0xcafebabe; \ - \ - /* Main loop */ \ - for (;_sfh_len > 0; _sfh_len--) { \ - hashv += get16bits (_sfh_key); \ - _sfh_tmp = (uint32_t)(get16bits (_sfh_key+2)) << 11 ^ hashv; \ - hashv = (hashv << 16) ^ _sfh_tmp; \ - _sfh_key += 2*sizeof (uint16_t); \ - hashv += hashv >> 11; \ - } \ - \ - /* Handle end cases */ \ - switch (_sfh_rem) { \ - case 3: hashv += get16bits (_sfh_key); \ - hashv ^= hashv << 16; \ - hashv ^= (uint32_t)(_sfh_key[sizeof (uint16_t)] << 18); \ - hashv += hashv >> 11; \ - break; \ - case 2: hashv += get16bits (_sfh_key); \ - hashv ^= hashv << 11; \ - hashv += hashv >> 17; \ - break; \ - case 1: hashv += *_sfh_key; \ - hashv ^= hashv << 10; \ - hashv += hashv >> 1; \ - } \ - \ - /* Force "avalanching" of final 127 bits */ \ - hashv ^= hashv << 3; \ - hashv += hashv >> 5; \ - hashv ^= hashv << 4; \ - hashv += hashv >> 17; \ - hashv ^= hashv << 25; \ - hashv += hashv >> 6; \ - bkt = hashv & (num_bkts-1); \ -} while(0) - -#ifdef HASH_USING_NO_STRICT_ALIASING -/* The MurmurHash exploits some CPU's (x86,x86_64) tolerance for unaligned reads. - * For other types of CPU's (e.g. Sparc) an unaligned read causes a bus error. - * MurmurHash uses the faster approach only on CPU's where we know it's safe. - * - * Note the preprocessor built-in defines can be emitted using: - * - * gcc -m64 -dM -E - < /dev/null (on gcc) - * cc -## a.c (where a.c is a simple test file) (Sun Studio) - */ -#if (defined(__i386__) || defined(__x86_64__) || defined(_M_IX86)) -#define MUR_GETBLOCK(p,i) p[i] -#else /* non intel */ -#define MUR_PLUS0_ALIGNED(p) (((unsigned long)p & 0x3) == 0) -#define MUR_PLUS1_ALIGNED(p) (((unsigned long)p & 0x3) == 1) -#define MUR_PLUS2_ALIGNED(p) (((unsigned long)p & 0x3) == 2) -#define MUR_PLUS3_ALIGNED(p) (((unsigned long)p & 0x3) == 3) -#define WP(p) ((uint32_t*)((unsigned long)(p) & ~3UL)) -#if (defined(__BIG_ENDIAN__) || defined(SPARC) || defined(__ppc__) || defined(__ppc64__)) -#define MUR_THREE_ONE(p) ((((*WP(p))&0x00ffffff) << 8) | (((*(WP(p)+1))&0xff000000) >> 24)) -#define MUR_TWO_TWO(p) ((((*WP(p))&0x0000ffff) <<16) | (((*(WP(p)+1))&0xffff0000) >> 16)) -#define MUR_ONE_THREE(p) ((((*WP(p))&0x000000ff) <<24) | (((*(WP(p)+1))&0xffffff00) >> 8)) -#else /* assume little endian non-intel */ -#define MUR_THREE_ONE(p) ((((*WP(p))&0xffffff00) >> 8) | (((*(WP(p)+1))&0x000000ff) << 24)) -#define MUR_TWO_TWO(p) ((((*WP(p))&0xffff0000) >>16) | (((*(WP(p)+1))&0x0000ffff) << 16)) -#define MUR_ONE_THREE(p) ((((*WP(p))&0xff000000) >>24) | (((*(WP(p)+1))&0x00ffffff) << 8)) -#endif -#define MUR_GETBLOCK(p,i) (MUR_PLUS0_ALIGNED(p) ? ((p)[i]) : \ - (MUR_PLUS1_ALIGNED(p) ? MUR_THREE_ONE(p) : \ - (MUR_PLUS2_ALIGNED(p) ? MUR_TWO_TWO(p) : \ - MUR_ONE_THREE(p)))) -#endif -#define MUR_ROTL32(x,r) (((x) << (r)) | ((x) >> (32 - (r)))) -#define MUR_FMIX(_h) \ -do { \ - _h ^= _h >> 16; \ - _h *= 0x85ebca6b; \ - _h ^= _h >> 13; \ - _h *= 0xc2b2ae35l; \ - _h ^= _h >> 16; \ -} while(0) - -#define HASH_MUR(key,keylen,num_bkts,hashv,bkt) \ -do { \ - const uint8_t *_mur_data = (const uint8_t*)(key); \ - const int _mur_nblocks = (keylen) / 4; \ - uint32_t _mur_h1 = 0xf88D5353; \ - uint32_t _mur_c1 = 0xcc9e2d51; \ - uint32_t _mur_c2 = 0x1b873593; \ - uint32_t _mur_k1 = 0; \ - const uint8_t *_mur_tail; \ - const uint32_t *_mur_blocks = (const uint32_t*)(_mur_data+_mur_nblocks*4); \ - int _mur_i; \ - for(_mur_i = -_mur_nblocks; _mur_i; _mur_i++) { \ - _mur_k1 = MUR_GETBLOCK(_mur_blocks,_mur_i); \ - _mur_k1 *= _mur_c1; \ - _mur_k1 = MUR_ROTL32(_mur_k1,15); \ - _mur_k1 *= _mur_c2; \ - \ - _mur_h1 ^= _mur_k1; \ - _mur_h1 = MUR_ROTL32(_mur_h1,13); \ - _mur_h1 = _mur_h1*5+0xe6546b64; \ - } \ - _mur_tail = (const uint8_t*)(_mur_data + _mur_nblocks*4); \ - _mur_k1=0; \ - switch((keylen) & 3) { \ - case 3: _mur_k1 ^= _mur_tail[2] << 16; \ - case 2: _mur_k1 ^= _mur_tail[1] << 8; \ - case 1: _mur_k1 ^= _mur_tail[0]; \ - _mur_k1 *= _mur_c1; \ - _mur_k1 = MUR_ROTL32(_mur_k1,15); \ - _mur_k1 *= _mur_c2; \ - _mur_h1 ^= _mur_k1; \ - } \ - _mur_h1 ^= (keylen); \ - MUR_FMIX(_mur_h1); \ - hashv = _mur_h1; \ - bkt = hashv & (num_bkts-1); \ -} while(0) -#endif /* HASH_USING_NO_STRICT_ALIASING */ - -/* key comparison function; return 0 if keys equal */ -#define HASH_KEYCMP(a,b,len) memcmp(a,b,len) - -/* iterate over items in a known bucket to find desired item */ -#define HASH_FIND_IN_BKT(tbl,hh,head,keyptr,keylen_in,out) \ -do { \ - if (head.hh_head) DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,head.hh_head)); \ - else out=NULL; \ - while (out) { \ - if ((out)->hh.keylen == keylen_in) { \ - if ((HASH_KEYCMP((out)->hh.key,keyptr,keylen_in)) == 0) break; \ - } \ - if ((out)->hh.hh_next) DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,(out)->hh.hh_next)); \ - else out = NULL; \ - } \ -} while(0) - -/* add an item to a bucket */ -#define HASH_ADD_TO_BKT(head,addhh) \ -do { \ - head.count++; \ - (addhh)->hh_next = head.hh_head; \ - (addhh)->hh_prev = NULL; \ - if (head.hh_head) { (head).hh_head->hh_prev = (addhh); } \ - (head).hh_head=addhh; \ - if (head.count >= ((head.expand_mult+1) * HASH_BKT_CAPACITY_THRESH) \ - && (addhh)->tbl->noexpand != 1) { \ - HASH_EXPAND_BUCKETS((addhh)->tbl); \ - } \ -} while(0) - -/* remove an item from a given bucket */ -#define HASH_DEL_IN_BKT(hh,head,hh_del) \ - (head).count--; \ - if ((head).hh_head == hh_del) { \ - (head).hh_head = hh_del->hh_next; \ - } \ - if (hh_del->hh_prev) { \ - hh_del->hh_prev->hh_next = hh_del->hh_next; \ - } \ - if (hh_del->hh_next) { \ - hh_del->hh_next->hh_prev = hh_del->hh_prev; \ - } - -/* Bucket expansion has the effect of doubling the number of buckets - * and redistributing the items into the new buckets. Ideally the - * items will distribute more or less evenly into the new buckets - * (the extent to which this is true is a measure of the quality of - * the hash function as it applies to the key domain). - * - * With the items distributed into more buckets, the chain length - * (item count) in each bucket is reduced. Thus by expanding buckets - * the hash keeps a bound on the chain length. This bounded chain - * length is the essence of how a hash provides constant time lookup. - * - * The calculation of tbl->ideal_chain_maxlen below deserves some - * explanation. First, keep in mind that we're calculating the ideal - * maximum chain length based on the *new* (doubled) bucket count. - * In fractions this is just n/b (n=number of items,b=new num buckets). - * Since the ideal chain length is an integer, we want to calculate - * ceil(n/b). We don't depend on floating point arithmetic in this - * hash, so to calculate ceil(n/b) with integers we could write - * - * ceil(n/b) = (n/b) + ((n%b)?1:0) - * - * and in fact a previous version of this hash did just that. - * But now we have improved things a bit by recognizing that b is - * always a power of two. We keep its base 2 log handy (call it lb), - * so now we can write this with a bit shift and logical AND: - * - * ceil(n/b) = (n>>lb) + ( (n & (b-1)) ? 1:0) - * - */ -#define HASH_EXPAND_BUCKETS(tbl) \ -do { \ - unsigned _he_bkt; \ - unsigned _he_bkt_i; \ - struct UT_hash_handle *_he_thh, *_he_hh_nxt; \ - UT_hash_bucket *_he_new_buckets, *_he_newbkt; \ - _he_new_buckets = (UT_hash_bucket*)uthash_malloc( \ - 2 * tbl->num_buckets * sizeof(struct UT_hash_bucket)); \ - if (!_he_new_buckets) { uthash_fatal( "out of memory"); } \ - memset(_he_new_buckets, 0, \ - 2 * tbl->num_buckets * sizeof(struct UT_hash_bucket)); \ - tbl->ideal_chain_maxlen = \ - (tbl->num_items >> (tbl->log2_num_buckets+1)) + \ - ((tbl->num_items & ((tbl->num_buckets*2)-1)) ? 1 : 0); \ - tbl->nonideal_items = 0; \ - for(_he_bkt_i = 0; _he_bkt_i < tbl->num_buckets; _he_bkt_i++) \ - { \ - _he_thh = tbl->buckets[ _he_bkt_i ].hh_head; \ - while (_he_thh) { \ - _he_hh_nxt = _he_thh->hh_next; \ - HASH_TO_BKT( _he_thh->hashv, tbl->num_buckets*2, _he_bkt); \ - _he_newbkt = &(_he_new_buckets[ _he_bkt ]); \ - if (++(_he_newbkt->count) > tbl->ideal_chain_maxlen) { \ - tbl->nonideal_items++; \ - _he_newbkt->expand_mult = _he_newbkt->count / \ - tbl->ideal_chain_maxlen; \ - } \ - _he_thh->hh_prev = NULL; \ - _he_thh->hh_next = _he_newbkt->hh_head; \ - if (_he_newbkt->hh_head) _he_newbkt->hh_head->hh_prev = \ - _he_thh; \ - _he_newbkt->hh_head = _he_thh; \ - _he_thh = _he_hh_nxt; \ - } \ - } \ - uthash_free( tbl->buckets, tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \ - tbl->num_buckets *= 2; \ - tbl->log2_num_buckets++; \ - tbl->buckets = _he_new_buckets; \ - tbl->ineff_expands = (tbl->nonideal_items > (tbl->num_items >> 1)) ? \ - (tbl->ineff_expands+1) : 0; \ - if (tbl->ineff_expands > 1) { \ - tbl->noexpand=1; \ - uthash_noexpand_fyi(tbl); \ - } \ - uthash_expand_fyi(tbl); \ -} while(0) - - -/* This is an adaptation of Simon Tatham's O(n log(n)) mergesort */ -/* Note that HASH_SORT assumes the hash handle name to be hh. - * HASH_SRT was added to allow the hash handle name to be passed in. */ -#define HASH_SORT(head,cmpfcn) HASH_SRT(hh,head,cmpfcn) -#define HASH_SRT(hh,head,cmpfcn) \ -do { \ - unsigned _hs_i; \ - unsigned _hs_looping,_hs_nmerges,_hs_insize,_hs_psize,_hs_qsize; \ - struct UT_hash_handle *_hs_p, *_hs_q, *_hs_e, *_hs_list, *_hs_tail; \ - if (head) { \ - _hs_insize = 1; \ - _hs_looping = 1; \ - _hs_list = &((head)->hh); \ - while (_hs_looping) { \ - _hs_p = _hs_list; \ - _hs_list = NULL; \ - _hs_tail = NULL; \ - _hs_nmerges = 0; \ - while (_hs_p) { \ - _hs_nmerges++; \ - _hs_q = _hs_p; \ - _hs_psize = 0; \ - for ( _hs_i = 0; _hs_i < _hs_insize; _hs_i++ ) { \ - _hs_psize++; \ - _hs_q = (UT_hash_handle*)((_hs_q->next) ? \ - ((void*)((char*)(_hs_q->next) + \ - (head)->hh.tbl->hho)) : NULL); \ - if (! (_hs_q) ) break; \ - } \ - _hs_qsize = _hs_insize; \ - while ((_hs_psize > 0) || ((_hs_qsize > 0) && _hs_q )) { \ - if (_hs_psize == 0) { \ - _hs_e = _hs_q; \ - _hs_q = (UT_hash_handle*)((_hs_q->next) ? \ - ((void*)((char*)(_hs_q->next) + \ - (head)->hh.tbl->hho)) : NULL); \ - _hs_qsize--; \ - } else if ( (_hs_qsize == 0) || !(_hs_q) ) { \ - _hs_e = _hs_p; \ - if (_hs_p){ \ - _hs_p = (UT_hash_handle*)((_hs_p->next) ? \ - ((void*)((char*)(_hs_p->next) + \ - (head)->hh.tbl->hho)) : NULL); \ - } \ - _hs_psize--; \ - } else if (( \ - cmpfcn(DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_p)), \ - DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_q))) \ - ) <= 0) { \ - _hs_e = _hs_p; \ - if (_hs_p){ \ - _hs_p = (UT_hash_handle*)((_hs_p->next) ? \ - ((void*)((char*)(_hs_p->next) + \ - (head)->hh.tbl->hho)) : NULL); \ - } \ - _hs_psize--; \ - } else { \ - _hs_e = _hs_q; \ - _hs_q = (UT_hash_handle*)((_hs_q->next) ? \ - ((void*)((char*)(_hs_q->next) + \ - (head)->hh.tbl->hho)) : NULL); \ - _hs_qsize--; \ - } \ - if ( _hs_tail ) { \ - _hs_tail->next = ((_hs_e) ? \ - ELMT_FROM_HH((head)->hh.tbl,_hs_e) : NULL); \ - } else { \ - _hs_list = _hs_e; \ - } \ - if (_hs_e) { \ - _hs_e->prev = ((_hs_tail) ? \ - ELMT_FROM_HH((head)->hh.tbl,_hs_tail) : NULL); \ - } \ - _hs_tail = _hs_e; \ - } \ - _hs_p = _hs_q; \ - } \ - if (_hs_tail){ \ - _hs_tail->next = NULL; \ - } \ - if ( _hs_nmerges <= 1 ) { \ - _hs_looping=0; \ - (head)->hh.tbl->tail = _hs_tail; \ - DECLTYPE_ASSIGN(head,ELMT_FROM_HH((head)->hh.tbl, _hs_list)); \ - } \ - _hs_insize *= 2; \ - } \ - HASH_FSCK(hh,head); \ - } \ -} while (0) - -/* This function selects items from one hash into another hash. - * The end result is that the selected items have dual presence - * in both hashes. There is no copy of the items made; rather - * they are added into the new hash through a secondary hash - * hash handle that must be present in the structure. */ -#define HASH_SELECT(hh_dst, dst, hh_src, src, cond) \ -do { \ - unsigned _src_bkt, _dst_bkt; \ - void *_last_elt=NULL, *_elt; \ - UT_hash_handle *_src_hh, *_dst_hh, *_last_elt_hh=NULL; \ - ptrdiff_t _dst_hho = ((char*)(&(dst)->hh_dst) - (char*)(dst)); \ - if (src) { \ - for(_src_bkt=0; _src_bkt < (src)->hh_src.tbl->num_buckets; _src_bkt++) { \ - for(_src_hh = (src)->hh_src.tbl->buckets[_src_bkt].hh_head; \ - _src_hh; \ - _src_hh = _src_hh->hh_next) { \ - _elt = ELMT_FROM_HH((src)->hh_src.tbl, _src_hh); \ - if (cond(_elt)) { \ - _dst_hh = (UT_hash_handle*)(((char*)_elt) + _dst_hho); \ - _dst_hh->key = _src_hh->key; \ - _dst_hh->keylen = _src_hh->keylen; \ - _dst_hh->hashv = _src_hh->hashv; \ - _dst_hh->prev = _last_elt; \ - _dst_hh->next = NULL; \ - if (_last_elt_hh) { _last_elt_hh->next = _elt; } \ - if (!dst) { \ - DECLTYPE_ASSIGN(dst,_elt); \ - HASH_MAKE_TABLE(hh_dst,dst); \ - } else { \ - _dst_hh->tbl = (dst)->hh_dst.tbl; \ - } \ - HASH_TO_BKT(_dst_hh->hashv, _dst_hh->tbl->num_buckets, _dst_bkt); \ - HASH_ADD_TO_BKT(_dst_hh->tbl->buckets[_dst_bkt],_dst_hh); \ - (dst)->hh_dst.tbl->num_items++; \ - _last_elt = _elt; \ - _last_elt_hh = _dst_hh; \ - } \ - } \ - } \ - } \ - HASH_FSCK(hh_dst,dst); \ -} while (0) - -#define HASH_CLEAR(hh,head) \ -do { \ - if (head) { \ - uthash_free((head)->hh.tbl->buckets, \ - (head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket)); \ - HASH_BLOOM_FREE((head)->hh.tbl); \ - uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \ - (head)=NULL; \ - } \ -} while(0) - -#define HASH_OVERHEAD(hh,head) \ - ((head) ? ( \ - (size_t)((((head)->hh.tbl->num_items * sizeof(UT_hash_handle)) + \ - ((head)->hh.tbl->num_buckets * sizeof(UT_hash_bucket)) + \ - (sizeof(UT_hash_table)) + \ - (HASH_BLOOM_BYTELEN)))) : 0) - -#ifdef NO_DECLTYPE -#define HASH_ITER(hh,head,el,tmp) \ -for((el)=(head), (*(char**)(&(tmp)))=(char*)((head)?(head)->hh.next:NULL); \ - el; (el)=(tmp),(*(char**)(&(tmp)))=(char*)((tmp)?(tmp)->hh.next:NULL)) -#else -#define HASH_ITER(hh,head,el,tmp) \ -for((el)=(head),(tmp)=DECLTYPE(el)((head)?(head)->hh.next:NULL); \ - el; (el)=(tmp),(tmp)=DECLTYPE(el)((tmp)?(tmp)->hh.next:NULL)) -#endif - -/* obtain a count of items in the hash */ -#define HASH_COUNT(head) HASH_CNT(hh,head) -#define HASH_CNT(hh,head) ((head)?((head)->hh.tbl->num_items):0) - -typedef struct UT_hash_bucket { - struct UT_hash_handle *hh_head; - unsigned count; - - /* expand_mult is normally set to 0. In this situation, the max chain length - * threshold is enforced at its default value, HASH_BKT_CAPACITY_THRESH. (If - * the bucket's chain exceeds this length, bucket expansion is triggered). - * However, setting expand_mult to a non-zero value delays bucket expansion - * (that would be triggered by additions to this particular bucket) - * until its chain length reaches a *multiple* of HASH_BKT_CAPACITY_THRESH. - * (The multiplier is simply expand_mult+1). The whole idea of this - * multiplier is to reduce bucket expansions, since they are expensive, in - * situations where we know that a particular bucket tends to be overused. - * It is better to let its chain length grow to a longer yet-still-bounded - * value, than to do an O(n) bucket expansion too often. - */ - unsigned expand_mult; - -} UT_hash_bucket; - -/* random signature used only to find hash tables in external analysis */ -#define HASH_SIGNATURE 0xa0111fe1 -#define HASH_BLOOM_SIGNATURE 0xb12220f2 - -typedef struct UT_hash_table { - UT_hash_bucket *buckets; - unsigned num_buckets, log2_num_buckets; - unsigned num_items; - struct UT_hash_handle *tail; /* tail hh in app order, for fast append */ - ptrdiff_t hho; /* hash handle offset (byte pos of hash handle in element */ - - /* in an ideal situation (all buckets used equally), no bucket would have - * more than ceil(#items/#buckets) items. that's the ideal chain length. */ - unsigned ideal_chain_maxlen; - - /* nonideal_items is the number of items in the hash whose chain position - * exceeds the ideal chain maxlen. these items pay the penalty for an uneven - * hash distribution; reaching them in a chain traversal takes >ideal steps */ - unsigned nonideal_items; - - /* ineffective expands occur when a bucket doubling was performed, but - * afterward, more than half the items in the hash had nonideal chain - * positions. If this happens on two consecutive expansions we inhibit any - * further expansion, as it's not helping; this happens when the hash - * function isn't a good fit for the key domain. When expansion is inhibited - * the hash will still work, albeit no longer in constant time. */ - unsigned ineff_expands, noexpand; - - uint32_t signature; /* used only to find hash tables in external analysis */ -#ifdef HASH_BLOOM - uint32_t bloom_sig; /* used only to test bloom exists in external analysis */ - uint8_t *bloom_bv; - char bloom_nbits; -#endif - -} UT_hash_table; - -typedef struct UT_hash_handle { - struct UT_hash_table *tbl; - void *prev; /* prev element in app order */ - void *next; /* next element in app order */ - struct UT_hash_handle *hh_prev; /* previous hh in bucket order */ - struct UT_hash_handle *hh_next; /* next hh in bucket order */ - void *key; /* ptr to enclosing struct's key */ - unsigned keylen; /* enclosing struct's key len */ - unsigned hashv; /* result of hash-fcn(key) */ -} UT_hash_handle; - -#endif /* UTHASH_H */ diff --git a/tools/sdk/include/coap/coap/utlist.h b/tools/sdk/include/coap/coap/utlist.h deleted file mode 100644 index b5f3f04c104..00000000000 --- a/tools/sdk/include/coap/coap/utlist.h +++ /dev/null @@ -1,757 +0,0 @@ -/* -Copyright (c) 2007-2014, Troy D. Hanson http://troydhanson.github.com/uthash/ -All rights reserved. - -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. - -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 UTLIST_H -#define UTLIST_H - -#define UTLIST_VERSION 1.9.9 - -#include - -/* - * This file contains macros to manipulate singly and doubly-linked lists. - * - * 1. LL_ macros: singly-linked lists. - * 2. DL_ macros: doubly-linked lists. - * 3. CDL_ macros: circular doubly-linked lists. - * - * To use singly-linked lists, your structure must have a "next" pointer. - * To use doubly-linked lists, your structure must "prev" and "next" pointers. - * Either way, the pointer to the head of the list must be initialized to NULL. - * - * ----------------.EXAMPLE ------------------------- - * struct item { - * int id; - * struct item *prev, *next; - * } - * - * struct item *list = NULL: - * - * int main() { - * struct item *item; - * ... allocate and populate item ... - * DL_APPEND(list, item); - * } - * -------------------------------------------------- - * - * For doubly-linked lists, the append and delete macros are O(1) - * For singly-linked lists, append and delete are O(n) but prepend is O(1) - * The sort macro is O(n log(n)) for all types of single/double/circular lists. - */ - -/* These macros use decltype or the earlier __typeof GNU extension. - As decltype is only available in newer compilers (VS2010 or gcc 4.3+ - when compiling c++ code), this code uses whatever method is needed - or, for VS2008 where neither is available, uses casting workarounds. */ -#ifdef _MSC_VER /* MS compiler */ -#if _MSC_VER >= 1600 && defined(__cplusplus) /* VS2010 or newer in C++ mode */ -#define LDECLTYPE(x) decltype(x) -#else /* VS2008 or older (or VS2010 in C mode) */ -#define NO_DECLTYPE -#define LDECLTYPE(x) char* -#endif -#elif defined(__ICCARM__) -#define NO_DECLTYPE -#define LDECLTYPE(x) char* -#else /* GNU, Sun and other compilers */ -#define LDECLTYPE(x) __typeof(x) -#endif - -/* for VS2008 we use some workarounds to get around the lack of decltype, - * namely, we always reassign our tmp variable to the list head if we need - * to dereference its prev/next pointers, and save/restore the real head.*/ -#ifdef NO_DECLTYPE -#define _SV(elt,list) _tmp = (char*)(list); {char **_alias = (char**)&(list); *_alias = (elt); } -#define _NEXT(elt,list,next) ((char*)((list)->next)) -#define _NEXTASGN(elt,list,to,next) { char **_alias = (char**)&((list)->next); *_alias=(char*)(to); } -/* #define _PREV(elt,list,prev) ((char*)((list)->prev)) */ -#define _PREVASGN(elt,list,to,prev) { char **_alias = (char**)&((list)->prev); *_alias=(char*)(to); } -#define _RS(list) { char **_alias = (char**)&(list); *_alias=_tmp; } -#define _CASTASGN(a,b) { char **_alias = (char**)&(a); *_alias=(char*)(b); } -#else -#define _SV(elt,list) -#define _NEXT(elt,list,next) ((elt)->next) -#define _NEXTASGN(elt,list,to,next) ((elt)->next)=(to) -/* #define _PREV(elt,list,prev) ((elt)->prev) */ -#define _PREVASGN(elt,list,to,prev) ((elt)->prev)=(to) -#define _RS(list) -#define _CASTASGN(a,b) (a)=(b) -#endif - -/****************************************************************************** - * The sort macro is an adaptation of Simon Tatham's O(n log(n)) mergesort * - * Unwieldy variable names used here to avoid shadowing passed-in variables. * - *****************************************************************************/ -#define LL_SORT(list, cmp) \ - LL_SORT2(list, cmp, next) - -#define LL_SORT2(list, cmp, next) \ -do { \ - LDECLTYPE(list) _ls_p; \ - LDECLTYPE(list) _ls_q; \ - LDECLTYPE(list) _ls_e; \ - LDECLTYPE(list) _ls_tail; \ - int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping; \ - if (list) { \ - _ls_insize = 1; \ - _ls_looping = 1; \ - while (_ls_looping) { \ - _CASTASGN(_ls_p,list); \ - list = NULL; \ - _ls_tail = NULL; \ - _ls_nmerges = 0; \ - while (_ls_p) { \ - _ls_nmerges++; \ - _ls_q = _ls_p; \ - _ls_psize = 0; \ - for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) { \ - _ls_psize++; \ - _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list,next); _RS(list); \ - if (!_ls_q) break; \ - } \ - _ls_qsize = _ls_insize; \ - while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) { \ - if (_ls_psize == 0) { \ - _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = \ - _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--; \ - } else if (_ls_qsize == 0 || !_ls_q) { \ - _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = \ - _NEXT(_ls_p,list,next); _RS(list); _ls_psize--; \ - } else if (cmp(_ls_p,_ls_q) <= 0) { \ - _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = \ - _NEXT(_ls_p,list,next); _RS(list); _ls_psize--; \ - } else { \ - _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = \ - _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--; \ - } \ - if (_ls_tail) { \ - _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_ls_e,next); _RS(list); \ - } else { \ - _CASTASGN(list,_ls_e); \ - } \ - _ls_tail = _ls_e; \ - } \ - _ls_p = _ls_q; \ - } \ - if (_ls_tail) { \ - _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,NULL,next); _RS(list); \ - } \ - if (_ls_nmerges <= 1) { \ - _ls_looping=0; \ - } \ - _ls_insize *= 2; \ - } \ - } \ -} while (0) - - -#define DL_SORT(list, cmp) \ - DL_SORT2(list, cmp, prev, next) - -#define DL_SORT2(list, cmp, prev, next) \ -do { \ - LDECLTYPE(list) _ls_p; \ - LDECLTYPE(list) _ls_q; \ - LDECLTYPE(list) _ls_e; \ - LDECLTYPE(list) _ls_tail; \ - int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping; \ - if (list) { \ - _ls_insize = 1; \ - _ls_looping = 1; \ - while (_ls_looping) { \ - _CASTASGN(_ls_p,list); \ - list = NULL; \ - _ls_tail = NULL; \ - _ls_nmerges = 0; \ - while (_ls_p) { \ - _ls_nmerges++; \ - _ls_q = _ls_p; \ - _ls_psize = 0; \ - for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) { \ - _ls_psize++; \ - _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list,next); _RS(list); \ - if (!_ls_q) break; \ - } \ - _ls_qsize = _ls_insize; \ - while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) { \ - if (_ls_psize == 0) { \ - _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = \ - _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--; \ - } else if (_ls_qsize == 0 || !_ls_q) { \ - _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = \ - _NEXT(_ls_p,list,next); _RS(list); _ls_psize--; \ - } else if (cmp(_ls_p,_ls_q) <= 0) { \ - _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = \ - _NEXT(_ls_p,list,next); _RS(list); _ls_psize--; \ - } else { \ - _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = \ - _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--; \ - } \ - if (_ls_tail) { \ - _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_ls_e,next); _RS(list); \ - } else { \ - _CASTASGN(list,_ls_e); \ - } \ - _SV(_ls_e,list); _PREVASGN(_ls_e,list,_ls_tail,prev); _RS(list); \ - _ls_tail = _ls_e; \ - } \ - _ls_p = _ls_q; \ - } \ - _CASTASGN(list->prev, _ls_tail); \ - _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,NULL,next); _RS(list); \ - if (_ls_nmerges <= 1) { \ - _ls_looping=0; \ - } \ - _ls_insize *= 2; \ - } \ - } \ -} while (0) - -#define CDL_SORT(list, cmp) \ - CDL_SORT2(list, cmp, prev, next) - -#define CDL_SORT2(list, cmp, prev, next) \ -do { \ - LDECLTYPE(list) _ls_p; \ - LDECLTYPE(list) _ls_q; \ - LDECLTYPE(list) _ls_e; \ - LDECLTYPE(list) _ls_tail; \ - LDECLTYPE(list) _ls_oldhead; \ - LDECLTYPE(list) _tmp; \ - int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping; \ - if (list) { \ - _ls_insize = 1; \ - _ls_looping = 1; \ - while (_ls_looping) { \ - _CASTASGN(_ls_p,list); \ - _CASTASGN(_ls_oldhead,list); \ - list = NULL; \ - _ls_tail = NULL; \ - _ls_nmerges = 0; \ - while (_ls_p) { \ - _ls_nmerges++; \ - _ls_q = _ls_p; \ - _ls_psize = 0; \ - for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) { \ - _ls_psize++; \ - _SV(_ls_q,list); \ - if (_NEXT(_ls_q,list,next) == _ls_oldhead) { \ - _ls_q = NULL; \ - } else { \ - _ls_q = _NEXT(_ls_q,list,next); \ - } \ - _RS(list); \ - if (!_ls_q) break; \ - } \ - _ls_qsize = _ls_insize; \ - while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) { \ - if (_ls_psize == 0) { \ - _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = \ - _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--; \ - if (_ls_q == _ls_oldhead) { _ls_q = NULL; } \ - } else if (_ls_qsize == 0 || !_ls_q) { \ - _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = \ - _NEXT(_ls_p,list,next); _RS(list); _ls_psize--; \ - if (_ls_p == _ls_oldhead) { _ls_p = NULL; } \ - } else if (cmp(_ls_p,_ls_q) <= 0) { \ - _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = \ - _NEXT(_ls_p,list,next); _RS(list); _ls_psize--; \ - if (_ls_p == _ls_oldhead) { _ls_p = NULL; } \ - } else { \ - _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = \ - _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--; \ - if (_ls_q == _ls_oldhead) { _ls_q = NULL; } \ - } \ - if (_ls_tail) { \ - _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_ls_e,next); _RS(list); \ - } else { \ - _CASTASGN(list,_ls_e); \ - } \ - _SV(_ls_e,list); _PREVASGN(_ls_e,list,_ls_tail,prev); _RS(list); \ - _ls_tail = _ls_e; \ - } \ - _ls_p = _ls_q; \ - } \ - _CASTASGN(list->prev,_ls_tail); \ - _CASTASGN(_tmp,list); \ - _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_tmp,next); _RS(list); \ - if (_ls_nmerges <= 1) { \ - _ls_looping=0; \ - } \ - _ls_insize *= 2; \ - } \ - } \ -} while (0) - -/****************************************************************************** - * singly linked list macros (non-circular) * - *****************************************************************************/ -#define LL_PREPEND(head,add) \ - LL_PREPEND2(head,add,next) - -#define LL_PREPEND2(head,add,next) \ -do { \ - (add)->next = head; \ - head = add; \ -} while (0) - -#define LL_CONCAT(head1,head2) \ - LL_CONCAT2(head1,head2,next) - -#define LL_CONCAT2(head1,head2,next) \ -do { \ - LDECLTYPE(head1) _tmp; \ - if (head1) { \ - _tmp = head1; \ - while (_tmp->next) { _tmp = _tmp->next; } \ - _tmp->next=(head2); \ - } else { \ - (head1)=(head2); \ - } \ -} while (0) - -#define LL_APPEND(head,add) \ - LL_APPEND2(head,add,next) - -#define LL_APPEND2(head,add,next) \ -do { \ - LDECLTYPE(head) _tmp; \ - (add)->next=NULL; \ - if (head) { \ - _tmp = head; \ - while (_tmp->next) { _tmp = _tmp->next; } \ - _tmp->next=(add); \ - } else { \ - (head)=(add); \ - } \ -} while (0) - -#define LL_DELETE(head,del) \ - LL_DELETE2(head,del,next) - -#define LL_DELETE2(head,del,next) \ -do { \ - LDECLTYPE(head) _tmp; \ - if ((head) == (del)) { \ - (head)=(head)->next; \ - } else { \ - _tmp = head; \ - while (_tmp->next && (_tmp->next != (del))) { \ - _tmp = _tmp->next; \ - } \ - if (_tmp->next) { \ - _tmp->next = ((del)->next); \ - } \ - } \ -} while (0) - -/* Here are VS2008 replacements for LL_APPEND and LL_DELETE */ -#define LL_APPEND_VS2008(head,add) \ - LL_APPEND2_VS2008(head,add,next) - -#define LL_APPEND2_VS2008(head,add,next) \ -do { \ - if (head) { \ - (add)->next = head; /* use add->next as a temp variable */ \ - while ((add)->next->next) { (add)->next = (add)->next->next; } \ - (add)->next->next=(add); \ - } else { \ - (head)=(add); \ - } \ - (add)->next=NULL; \ -} while (0) - -#define LL_DELETE_VS2008(head,del) \ - LL_DELETE2_VS2008(head,del,next) - -#define LL_DELETE2_VS2008(head,del,next) \ -do { \ - if ((head) == (del)) { \ - (head)=(head)->next; \ - } else { \ - char *_tmp = (char*)(head); \ - while ((head)->next && ((head)->next != (del))) { \ - head = (head)->next; \ - } \ - if ((head)->next) { \ - (head)->next = ((del)->next); \ - } \ - { \ - char **_head_alias = (char**)&(head); \ - *_head_alias = _tmp; \ - } \ - } \ -} while (0) -#ifdef NO_DECLTYPE -#undef LL_APPEND -#define LL_APPEND LL_APPEND_VS2008 -#undef LL_DELETE -#define LL_DELETE LL_DELETE_VS2008 -#undef LL_DELETE2 -#define LL_DELETE2 LL_DELETE2_VS2008 -#undef LL_APPEND2 -#define LL_APPEND2 LL_APPEND2_VS2008 -#undef LL_CONCAT /* no LL_CONCAT_VS2008 */ -#undef DL_CONCAT /* no DL_CONCAT_VS2008 */ -#endif -/* end VS2008 replacements */ - -#define LL_COUNT(head,el,counter) \ - LL_COUNT2(head,el,counter,next) \ - -#define LL_COUNT2(head,el,counter,next) \ -{ \ - counter = 0; \ - LL_FOREACH2(head,el,next){ ++counter; } \ -} - -#define LL_FOREACH(head,el) \ - LL_FOREACH2(head,el,next) - -#define LL_FOREACH2(head,el,next) \ - for(el=head;el;el=(el)->next) - -#define LL_FOREACH_SAFE(head,el,tmp) \ - LL_FOREACH_SAFE2(head,el,tmp,next) - -#define LL_FOREACH_SAFE2(head,el,tmp,next) \ - for((el)=(head);(el) && (tmp = (el)->next, 1); (el) = tmp) - -#define LL_SEARCH_SCALAR(head,out,field,val) \ - LL_SEARCH_SCALAR2(head,out,field,val,next) - -#define LL_SEARCH_SCALAR2(head,out,field,val,next) \ -do { \ - LL_FOREACH2(head,out,next) { \ - if ((out)->field == (val)) break; \ - } \ -} while(0) - -#define LL_SEARCH(head,out,elt,cmp) \ - LL_SEARCH2(head,out,elt,cmp,next) - -#define LL_SEARCH2(head,out,elt,cmp,next) \ -do { \ - LL_FOREACH2(head,out,next) { \ - if ((cmp(out,elt))==0) break; \ - } \ -} while(0) - -#define LL_REPLACE_ELEM(head, el, add) \ -do { \ - LDECLTYPE(head) _tmp; \ - assert(head != NULL); \ - assert(el != NULL); \ - assert(add != NULL); \ - (add)->next = (el)->next; \ - if ((head) == (el)) { \ - (head) = (add); \ - } else { \ - _tmp = head; \ - while (_tmp->next && (_tmp->next != (el))) { \ - _tmp = _tmp->next; \ - } \ - if (_tmp->next) { \ - _tmp->next = (add); \ - } \ - } \ -} while (0) - -#define LL_PREPEND_ELEM(head, el, add) \ -do { \ - LDECLTYPE(head) _tmp; \ - assert(head != NULL); \ - assert(el != NULL); \ - assert(add != NULL); \ - (add)->next = (el); \ - if ((head) == (el)) { \ - (head) = (add); \ - } else { \ - _tmp = head; \ - while (_tmp->next && (_tmp->next != (el))) { \ - _tmp = _tmp->next; \ - } \ - if (_tmp->next) { \ - _tmp->next = (add); \ - } \ - } \ -} while (0) \ - - -/****************************************************************************** - * doubly linked list macros (non-circular) * - *****************************************************************************/ -#define DL_PREPEND(head,add) \ - DL_PREPEND2(head,add,prev,next) - -#define DL_PREPEND2(head,add,prev,next) \ -do { \ - (add)->next = head; \ - if (head) { \ - (add)->prev = (head)->prev; \ - (head)->prev = (add); \ - } else { \ - (add)->prev = (add); \ - } \ - (head) = (add); \ -} while (0) - -#define DL_APPEND(head,add) \ - DL_APPEND2(head,add,prev,next) - -#define DL_APPEND2(head,add,prev,next) \ -do { \ - if (head) { \ - (add)->prev = (head)->prev; \ - (head)->prev->next = (add); \ - (head)->prev = (add); \ - (add)->next = NULL; \ - } else { \ - (head)=(add); \ - (head)->prev = (head); \ - (head)->next = NULL; \ - } \ -} while (0) - -#define DL_CONCAT(head1,head2) \ - DL_CONCAT2(head1,head2,prev,next) - -#define DL_CONCAT2(head1,head2,prev,next) \ -do { \ - LDECLTYPE(head1) _tmp; \ - if (head2) { \ - if (head1) { \ - _tmp = (head2)->prev; \ - (head2)->prev = (head1)->prev; \ - (head1)->prev->next = (head2); \ - (head1)->prev = _tmp; \ - } else { \ - (head1)=(head2); \ - } \ - } \ -} while (0) - -#define DL_DELETE(head,del) \ - DL_DELETE2(head,del,prev,next) - -#define DL_DELETE2(head,del,prev,next) \ -do { \ - assert((del)->prev != NULL); \ - if ((del)->prev == (del)) { \ - (head)=NULL; \ - } else if ((del)==(head)) { \ - (del)->next->prev = (del)->prev; \ - (head) = (del)->next; \ - } else { \ - (del)->prev->next = (del)->next; \ - if ((del)->next) { \ - (del)->next->prev = (del)->prev; \ - } else { \ - (head)->prev = (del)->prev; \ - } \ - } \ -} while (0) - -#define DL_COUNT(head,el,counter) \ - DL_COUNT2(head,el,counter,next) \ - -#define DL_COUNT2(head,el,counter,next) \ -{ \ - counter = 0; \ - DL_FOREACH2(head,el,next){ ++counter; } \ -} - -#define DL_FOREACH(head,el) \ - DL_FOREACH2(head,el,next) - -#define DL_FOREACH2(head,el,next) \ - for(el=head;el;el=(el)->next) - -/* this version is safe for deleting the elements during iteration */ -#define DL_FOREACH_SAFE(head,el,tmp) \ - DL_FOREACH_SAFE2(head,el,tmp,next) - -#define DL_FOREACH_SAFE2(head,el,tmp,next) \ - for((el)=(head);(el) && (tmp = (el)->next, 1); (el) = tmp) - -/* these are identical to their singly-linked list counterparts */ -#define DL_SEARCH_SCALAR LL_SEARCH_SCALAR -#define DL_SEARCH LL_SEARCH -#define DL_SEARCH_SCALAR2 LL_SEARCH_SCALAR2 -#define DL_SEARCH2 LL_SEARCH2 - -#define DL_REPLACE_ELEM(head, el, add) \ -do { \ - assert(head != NULL); \ - assert(el != NULL); \ - assert(add != NULL); \ - if ((head) == (el)) { \ - (head) = (add); \ - (add)->next = (el)->next; \ - if ((el)->next == NULL) { \ - (add)->prev = (add); \ - } else { \ - (add)->prev = (el)->prev; \ - (add)->next->prev = (add); \ - } \ - } else { \ - (add)->next = (el)->next; \ - (add)->prev = (el)->prev; \ - (add)->prev->next = (add); \ - if ((el)->next == NULL) { \ - (head)->prev = (add); \ - } else { \ - (add)->next->prev = (add); \ - } \ - } \ -} while (0) - -#define DL_PREPEND_ELEM(head, el, add) \ -do { \ - assert(head != NULL); \ - assert(el != NULL); \ - assert(add != NULL); \ - (add)->next = (el); \ - (add)->prev = (el)->prev; \ - (el)->prev = (add); \ - if ((head) == (el)) { \ - (head) = (add); \ - } else { \ - (add)->prev->next = (add); \ - } \ -} while (0) \ - - -/****************************************************************************** - * circular doubly linked list macros * - *****************************************************************************/ -#define CDL_PREPEND(head,add) \ - CDL_PREPEND2(head,add,prev,next) - -#define CDL_PREPEND2(head,add,prev,next) \ -do { \ - if (head) { \ - (add)->prev = (head)->prev; \ - (add)->next = (head); \ - (head)->prev = (add); \ - (add)->prev->next = (add); \ - } else { \ - (add)->prev = (add); \ - (add)->next = (add); \ - } \ -(head)=(add); \ -} while (0) - -#define CDL_DELETE(head,del) \ - CDL_DELETE2(head,del,prev,next) - -#define CDL_DELETE2(head,del,prev,next) \ -do { \ - if ( ((head)==(del)) && ((head)->next == (head))) { \ - (head) = 0L; \ - } else { \ - (del)->next->prev = (del)->prev; \ - (del)->prev->next = (del)->next; \ - if ((del) == (head)) (head)=(del)->next; \ - } \ -} while (0) - -#define CDL_COUNT(head,el,counter) \ - CDL_COUNT2(head,el,counter,next) \ - -#define CDL_COUNT2(head, el, counter,next) \ -{ \ - counter = 0; \ - CDL_FOREACH2(head,el,next){ ++counter; } \ -} - -#define CDL_FOREACH(head,el) \ - CDL_FOREACH2(head,el,next) - -#define CDL_FOREACH2(head,el,next) \ - for(el=head;el;el=((el)->next==head ? 0L : (el)->next)) - -#define CDL_FOREACH_SAFE(head,el,tmp1,tmp2) \ - CDL_FOREACH_SAFE2(head,el,tmp1,tmp2,prev,next) - -#define CDL_FOREACH_SAFE2(head,el,tmp1,tmp2,prev,next) \ - for((el)=(head), ((tmp1)=(head)?((head)->prev):NULL); \ - (el) && ((tmp2)=(el)->next, 1); \ - ((el) = (((el)==(tmp1)) ? 0L : (tmp2)))) - -#define CDL_SEARCH_SCALAR(head,out,field,val) \ - CDL_SEARCH_SCALAR2(head,out,field,val,next) - -#define CDL_SEARCH_SCALAR2(head,out,field,val,next) \ -do { \ - CDL_FOREACH2(head,out,next) { \ - if ((out)->field == (val)) break; \ - } \ -} while(0) - -#define CDL_SEARCH(head,out,elt,cmp) \ - CDL_SEARCH2(head,out,elt,cmp,next) - -#define CDL_SEARCH2(head,out,elt,cmp,next) \ -do { \ - CDL_FOREACH2(head,out,next) { \ - if ((cmp(out,elt))==0) break; \ - } \ -} while(0) - -#define CDL_REPLACE_ELEM(head, el, add) \ -do { \ - assert(head != NULL); \ - assert(el != NULL); \ - assert(add != NULL); \ - if ((el)->next == (el)) { \ - (add)->next = (add); \ - (add)->prev = (add); \ - (head) = (add); \ - } else { \ - (add)->next = (el)->next; \ - (add)->prev = (el)->prev; \ - (add)->next->prev = (add); \ - (add)->prev->next = (add); \ - if ((head) == (el)) { \ - (head) = (add); \ - } \ - } \ -} while (0) - -#define CDL_PREPEND_ELEM(head, el, add) \ -do { \ - assert(head != NULL); \ - assert(el != NULL); \ - assert(add != NULL); \ - (add)->next = (el); \ - (add)->prev = (el)->prev; \ - (el)->prev = (add); \ - (add)->prev->next = (add); \ - if ((head) == (el)) { \ - (head) = (add); \ - } \ -} while (0) \ - -#endif /* UTLIST_H */ - diff --git a/tools/sdk/include/coap/coap_config.h b/tools/sdk/include/coap/coap_config.h deleted file mode 100644 index db314f2de90..00000000000 --- a/tools/sdk/include/coap/coap_config.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * libcoap configure implementation for ESP32 platform. - * - * Uses libcoap software implementation for failover when concurrent - * configure operations are in use. - * - * coap.h -- main header file for CoAP stack of libcoap - * - * Copyright (C) 2010-2012,2015-2016 Olaf Bergmann - * 2015 Carsten Schoenert - * - * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -#ifndef _CONFIG_H_ -#define _CONFIG_H_ - -#ifdef WITH_POSIX -#include "coap_config_posix.h" -#endif - -#define HAVE_STDIO_H -#define HAVE_ASSERT_H - -#define PACKAGE_STRING PACKAGE_NAME PACKAGE_VERSION - -/* it's just provided by libc. i hope we don't get too many of those, as - * actually we'd need autotools again to find out what environment we're - * building in */ -#define HAVE_STRNLEN 1 - -#define HAVE_LIMITS_H - -#define COAP_RESOURCES_NOHASH - -#endif /* _CONFIG_H_ */ diff --git a/tools/sdk/include/coap/coap_config_posix.h b/tools/sdk/include/coap/coap_config_posix.h deleted file mode 100644 index a77e97f074e..00000000000 --- a/tools/sdk/include/coap/coap_config_posix.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * libcoap configure implementation for ESP32 platform. - * - * Uses libcoap software implementation for failover when concurrent - * configure operations are in use. - * - * coap.h -- main header file for CoAP stack of libcoap - * - * Copyright (C) 2010-2012,2015-2016 Olaf Bergmann - * 2015 Carsten Schoenert - * - * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -#ifndef COAP_CONFIG_POSIX_H_ -#define COAP_CONFIG_POSIX_H_ - -#ifdef WITH_POSIX - -#include - -#define HAVE_SYS_SOCKET_H -#define HAVE_MALLOC -#define HAVE_ARPA_INET_H - -#define IP_PKTINFO IP_MULTICAST_IF -#define IPV6_PKTINFO IPV6_V6ONLY - -#define PACKAGE_NAME "libcoap-posix" -#define PACKAGE_VERSION "?" - -#define CUSTOM_COAP_NETWORK_ENDPOINT -#define CUSTOM_COAP_NETWORK_SEND -#define CUSTOM_COAP_NETWORK_READ - -#endif - -#endif /* COAP_CONFIG_POSIX_H_ */ diff --git a/tools/sdk/include/coap/coap_io.h b/tools/sdk/include/coap/coap_io.h deleted file mode 100644 index 7a48b319a1d..00000000000 --- a/tools/sdk/include/coap/coap_io.h +++ /dev/null @@ -1,167 +0,0 @@ -/* - * coap_io.h -- Default network I/O functions for libcoap - * - * Copyright (C) 2012-2013 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -#ifndef _COAP_IO_H_ -#define _COAP_IO_H_ - -#include -#include - -#include "address.h" - -/** - * Abstract handle that is used to identify a local network interface. - */ -typedef int coap_if_handle_t; - -/** Invalid interface handle */ -#define COAP_IF_INVALID -1 - -struct coap_packet_t; -typedef struct coap_packet_t coap_packet_t; - -struct coap_context_t; - -/** - * Abstraction of virtual endpoint that can be attached to coap_context_t. The - * tuple (handle, addr) must uniquely identify this endpoint. - */ -typedef struct coap_endpoint_t { -#if defined(WITH_POSIX) || defined(WITH_CONTIKI) - union { - int fd; /**< on POSIX systems */ - void *conn; /**< opaque connection (e.g. uip_conn in Contiki) */ - } handle; /**< opaque handle to identify this endpoint */ -#endif /* WITH_POSIX or WITH_CONTIKI */ - -#ifdef WITH_LWIP - struct udp_pcb *pcb; - /**< @FIXME --chrysn - * this was added in a hurry, not sure it confirms to the overall model */ - struct coap_context_t *context; -#endif /* WITH_LWIP */ - - coap_address_t addr; /**< local interface address */ - int ifindex; - int flags; -} coap_endpoint_t; - -#define COAP_ENDPOINT_NOSEC 0x00 -#define COAP_ENDPOINT_DTLS 0x01 - -coap_endpoint_t *coap_new_endpoint(const coap_address_t *addr, int flags); - -void coap_free_endpoint(coap_endpoint_t *ep); - -/** - * Function interface for data transmission. This function returns the number of - * bytes that have been transmitted, or a value less than zero on error. - * - * @param context The calling CoAP context. - * @param local_interface The local interface to send the data. - * @param dst The address of the receiver. - * @param data The data to send. - * @param datalen The actual length of @p data. - * - * @return The number of bytes written on success, or a value - * less than zero on error. - */ -ssize_t coap_network_send(struct coap_context_t *context, - const coap_endpoint_t *local_interface, - const coap_address_t *dst, - unsigned char *data, size_t datalen); - -/** - * Function interface for reading data. This function returns the number of - * bytes that have been read, or a value less than zero on error. In case of an - * error, @p *packet is set to NULL. - * - * @param ep The endpoint that is used for reading data from the network. - * @param packet A result parameter where a pointer to the received packet - * structure is stored. The caller must call coap_free_packet to - * release the storage used by this packet. - * - * @return The number of bytes received on success, or a value less than - * zero on error. - */ -ssize_t coap_network_read(coap_endpoint_t *ep, coap_packet_t **packet); - -#ifndef coap_mcast_interface -# define coap_mcast_interface(Local) 0 -#endif - -/** - * Releases the storage allocated for @p packet. - */ -void coap_free_packet(coap_packet_t *packet); - -/** - * Populate the coap_endpoint_t *target from the incoming packet's destination - * data. - * - * This is usually used to copy a packet's data into a node's local_if member. - */ -void coap_packet_populate_endpoint(coap_packet_t *packet, - coap_endpoint_t *target); - -/** - * Given an incoming packet, copy its source address into an address struct. - */ -void coap_packet_copy_source(coap_packet_t *packet, coap_address_t *target); - -/** - * Given a packet, set msg and msg_len to an address and length of the packet's - * data in memory. - * */ -void coap_packet_get_memmapped(coap_packet_t *packet, - unsigned char **address, - size_t *length); - -#ifdef WITH_LWIP -/** - * Get the pbuf of a packet. The caller takes over responsibility for freeing - * the pbuf. - */ -struct pbuf *coap_packet_extract_pbuf(coap_packet_t *packet); -#endif - -#ifdef WITH_CONTIKI -/* - * This is only included in coap_io.h instead of .c in order to be available for - * sizeof in mem.c. - */ -struct coap_packet_t { - coap_if_handle_t hnd; /**< the interface handle */ - coap_address_t src; /**< the packet's source address */ - coap_address_t dst; /**< the packet's destination address */ - const coap_endpoint_t *interface; - int ifindex; - void *session; /**< opaque session data */ - size_t length; /**< length of payload */ - unsigned char payload[]; /**< payload */ -}; -#endif - -#ifdef WITH_LWIP -/* - * This is only included in coap_io.h instead of .c in order to be available for - * sizeof in lwippools.h. - * Simple carry-over of the incoming pbuf that is later turned into a node. - * - * Source address data is currently side-banded via ip_current_dest_addr & co - * as the packets have limited lifetime anyway. - */ -struct coap_packet_t { - struct pbuf *pbuf; - const coap_endpoint_t *local_interface; - uint16_t srcport; -}; -#endif - -#endif /* _COAP_IO_H_ */ diff --git a/tools/sdk/include/coap/coap_time.h b/tools/sdk/include/coap/coap_time.h deleted file mode 100644 index 9357e5ff7d0..00000000000 --- a/tools/sdk/include/coap/coap_time.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - * coap_time.h -- Clock Handling - * - * Copyright (C) 2010-2013 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -/** - * @file coap_time.h - * @brief Clock Handling - */ - -#ifndef _COAP_TIME_H_ -#define _COAP_TIME_H_ - -/** - * @defgroup clock Clock Handling - * Default implementation of internal clock. - * @{ - */ - -#ifdef WITH_LWIP - -#include -#include - -/* lwIP provides ms in sys_now */ -#define COAP_TICKS_PER_SECOND 1000 - -typedef uint32_t coap_tick_t; -typedef uint32_t coap_time_t; -typedef int32_t coap_tick_diff_t; - -static inline void coap_ticks_impl(coap_tick_t *t) { - *t = sys_now(); -} - -static inline void coap_clock_init_impl(void) { -} - -#define coap_clock_init coap_clock_init_impl -#define coap_ticks coap_ticks_impl - -static inline coap_time_t coap_ticks_to_rt(coap_tick_t t) { - return t / COAP_TICKS_PER_SECOND; -} -#endif - -#ifdef WITH_CONTIKI -#include "clock.h" - -typedef clock_time_t coap_tick_t; -typedef clock_time_t coap_time_t; - -/** - * This data type is used to represent the difference between two clock_tick_t - * values. This data type must have the same size in memory as coap_tick_t to - * allow wrapping. - */ -typedef int coap_tick_diff_t; - -#define COAP_TICKS_PER_SECOND CLOCK_SECOND - -static inline void coap_clock_init(void) { - clock_init(); -} - -static inline void coap_ticks(coap_tick_t *t) { - *t = clock_time(); -} - -static inline coap_time_t coap_ticks_to_rt(coap_tick_t t) { - return t / COAP_TICKS_PER_SECOND; -} -#endif /* WITH_CONTIKI */ - -#ifdef WITH_POSIX -/** - * This data type represents internal timer ticks with COAP_TICKS_PER_SECOND - * resolution. - */ -typedef unsigned long coap_tick_t; - -/** - * CoAP time in seconds since epoch. - */ -typedef time_t coap_time_t; - -/** - * This data type is used to represent the difference between two clock_tick_t - * values. This data type must have the same size in memory as coap_tick_t to - * allow wrapping. - */ -typedef long coap_tick_diff_t; - -/** Use ms resolution on POSIX systems */ -#define COAP_TICKS_PER_SECOND 1000 - -/** - * Initializes the internal clock. - */ -void coap_clock_init(void); - -/** - * Sets @p t to the internal time with COAP_TICKS_PER_SECOND resolution. - */ -void coap_ticks(coap_tick_t *t); - -/** - * Helper function that converts coap ticks to wallclock time. On POSIX, this - * function returns the number of seconds since the epoch. On other systems, it - * may be the calculated number of seconds since last reboot or so. - * - * @param t Internal system ticks. - * - * @return The number of seconds that has passed since a specific reference - * point (seconds since epoch on POSIX). - */ -coap_time_t coap_ticks_to_rt(coap_tick_t t); -#endif /* WITH_POSIX */ - -/** - * Returns @c 1 if and only if @p a is less than @p b where less is defined on a - * signed data type. - */ -static inline int coap_time_lt(coap_tick_t a, coap_tick_t b) { - return ((coap_tick_diff_t)(a - b)) < 0; -} - -/** - * Returns @c 1 if and only if @p a is less than or equal @p b where less is - * defined on a signed data type. - */ -static inline int coap_time_le(coap_tick_t a, coap_tick_t b) { - return a == b || coap_time_lt(a,b); -} - -/** @} */ - -#endif /* _COAP_TIME_H_ */ diff --git a/tools/sdk/include/coap/debug.h b/tools/sdk/include/coap/debug.h deleted file mode 100644 index e7c86aff517..00000000000 --- a/tools/sdk/include/coap/debug.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * debug.h -- debug utilities - * - * Copyright (C) 2010-2011,2014 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -#ifndef _COAP_DEBUG_H_ -#define _COAP_DEBUG_H_ - -#ifndef COAP_DEBUG_FD -#define COAP_DEBUG_FD stdout -#endif - -#ifndef COAP_ERR_FD -#define COAP_ERR_FD stderr -#endif - -#ifdef HAVE_SYSLOG_H -#include -typedef short coap_log_t; -#else -/** Pre-defined log levels akin to what is used in \b syslog. */ -typedef enum { - LOG_EMERG=0, - LOG_ALERT, - LOG_CRIT, - LOG_ERR, - LOG_WARNING, - LOG_NOTICE, - LOG_INFO, - LOG_DEBUG -} coap_log_t; -#endif - -/** Returns the current log level. */ -coap_log_t coap_get_log_level(void); - -/** Sets the log level to the specified value. */ -void coap_set_log_level(coap_log_t level); - -/** Returns a zero-terminated string with the name of this library. */ -const char *coap_package_name(void); - -/** Returns a zero-terminated string with the library version. */ -const char *coap_package_version(void); - -/** - * Writes the given text to @c COAP_ERR_FD (for @p level <= @c LOG_CRIT) or @c - * COAP_DEBUG_FD (for @p level >= @c LOG_WARNING). The text is output only when - * @p level is below or equal to the log level that set by coap_set_log_level(). - */ -void coap_log_impl(coap_log_t level, const char *format, ...); - -#ifndef coap_log -#define coap_log(...) coap_log_impl(__VA_ARGS__) -#endif - -#ifndef NDEBUG - -/* A set of convenience macros for common log levels. */ -#define info(...) coap_log(LOG_INFO, __VA_ARGS__) -#define warn(...) coap_log(LOG_WARNING, __VA_ARGS__) -#define debug(...) coap_log(LOG_DEBUG, __VA_ARGS__) - -#include "pdu.h" -void coap_show_pdu(const coap_pdu_t *); - -struct coap_address_t; -size_t coap_print_addr(const struct coap_address_t *, unsigned char *, size_t); - -#else - -#define debug(...) -#define info(...) -#define warn(...) - -#define coap_show_pdu(x) -#define coap_print_addr(...) - -#endif /* NDEBUG */ - -#endif /* _COAP_DEBUG_H_ */ diff --git a/tools/sdk/include/coap/encode.h b/tools/sdk/include/coap/encode.h deleted file mode 100644 index a5d290c4ecf..00000000000 --- a/tools/sdk/include/coap/encode.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * encode.h -- encoding and decoding of CoAP data types - * - * Copyright (C) 2010-2012 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -#ifndef _COAP_ENCODE_H_ -#define _COAP_ENCODE_H_ - -#if (BSD >= 199103) || defined(WITH_CONTIKI) -# include -#else -# include -#endif - -#define Nn 8 /* duplicate definition of N if built on sky motes */ -#define ENCODE_HEADER_SIZE 4 -#define HIBIT (1 << (Nn - 1)) -#define EMASK ((1 << ENCODE_HEADER_SIZE) - 1) -#define MMASK ((1 << Nn) - 1 - EMASK) -#define MAX_VALUE ( (1 << Nn) - (1 << ENCODE_HEADER_SIZE) ) * (1 << ((1 << ENCODE_HEADER_SIZE) - 1)) - -#define COAP_PSEUDOFP_DECODE_8_4(r) (r < HIBIT ? r : (r & MMASK) << (r & EMASK)) - -#ifndef HAVE_FLS -/* include this only if fls() is not available */ -extern int coap_fls(unsigned int i); -#else -#define coap_fls(i) fls(i) -#endif - -/* ls and s must be integer variables */ -#define COAP_PSEUDOFP_ENCODE_8_4_DOWN(v,ls) (v < HIBIT ? v : (ls = coap_fls(v) - Nn, (v >> ls) & MMASK) + ls) -#define COAP_PSEUDOFP_ENCODE_8_4_UP(v,ls,s) (v < HIBIT ? v : (ls = coap_fls(v) - Nn, (s = (((v + ((1<> ls) & MMASK)), s == 0 ? HIBIT + ls + 1 : s + ls)) - -/** - * Decodes multiple-length byte sequences. buf points to an input byte sequence - * of length len. Returns the decoded value. - */ -unsigned int coap_decode_var_bytes(unsigned char *buf,unsigned int len); - -/** - * Encodes multiple-length byte sequences. buf points to an output buffer of - * sufficient length to store the encoded bytes. val is the value to encode. - * Returns the number of bytes used to encode val or 0 on error. - */ -unsigned int coap_encode_var_bytes(unsigned char *buf, unsigned int val); - -#endif /* _COAP_ENCODE_H_ */ diff --git a/tools/sdk/include/coap/hashkey.h b/tools/sdk/include/coap/hashkey.h deleted file mode 100644 index 5cff67d2d8a..00000000000 --- a/tools/sdk/include/coap/hashkey.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * hashkey.h -- definition of hash key type and helper functions - * - * Copyright (C) 2010-2011 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -/** - * @file hashkey.h - * @brief definition of hash key type and helper functions - */ - -#ifndef _COAP_HASHKEY_H_ -#define _COAP_HASHKEY_H_ - -#include "str.h" - -typedef unsigned char coap_key_t[4]; - -#ifndef coap_hash -/** - * Calculates a fast hash over the given string @p s of length @p len and stores - * the result into @p h. Depending on the exact implementation, this function - * cannot be used as one-way function to check message integrity or simlar. - * - * @param s The string used for hash calculation. - * @param len The length of @p s. - * @param h The result buffer to store the calculated hash key. - */ -void coap_hash_impl(const unsigned char *s, unsigned int len, coap_key_t h); - -#define coap_hash(String,Length,Result) \ - coap_hash_impl((String),(Length),(Result)) - -/* This is used to control the pre-set hash-keys for resources. */ -#define __COAP_DEFAULT_HASH -#else -#undef __COAP_DEFAULT_HASH -#endif /* coap_hash */ - -/** - * Calls coap_hash() with given @c str object as parameter. - * - * @param Str Must contain a pointer to a coap string object. - * @param H A coap_key_t object to store the result. - * - * @hideinitializer - */ -#define coap_str_hash(Str,H) { \ - assert(Str); \ - memset((H), 0, sizeof(coap_key_t)); \ - coap_hash((Str)->s, (Str)->length, (H)); \ - } - -#endif /* _COAP_HASHKEY_H_ */ diff --git a/tools/sdk/include/coap/libcoap.h b/tools/sdk/include/coap/libcoap.h deleted file mode 100644 index 214b9e235e8..00000000000 --- a/tools/sdk/include/coap/libcoap.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * libcoap.h -- platform specific header file for CoAP stack - * - * Copyright (C) 2015 Carsten Schoenert - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -#ifndef _LIBCOAP_H_ -#define _LIBCOAP_H_ - -/* The non posix embedded platforms like Contiki, TinyOS, RIOT, ... doesn't have - * a POSIX compatible header structure so we have to slightly do some platform - * related things. Currently there is only Contiki available so we check for a - * CONTIKI environment and do *not* include the POSIX related network stuff. If - * there are other platforms in future there need to be analogous environments. - * - * The CONTIKI variable is within the Contiki build environment! */ - -#if !defined (CONTIKI) -#include -#include -#endif /* CONTIKI */ - -#endif /* _LIBCOAP_H_ */ diff --git a/tools/sdk/include/coap/lwippools.h b/tools/sdk/include/coap/lwippools.h deleted file mode 100644 index 0bfb3f527a7..00000000000 --- a/tools/sdk/include/coap/lwippools.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -/** Memory pool definitions for the libcoap when used with lwIP (which has its - * own mechanism for quickly allocating chunks of data with known sizes). Has - * to be findable by lwIP (ie. an #include must either directly - * include this or include something more generic which includes this), and - * MEMP_USE_CUSTOM_POOLS has to be set in lwipopts.h. */ - -#include "coap_config.h" -#include -#include -#include - -#ifndef MEMP_NUM_COAPCONTEXT -#define MEMP_NUM_COAPCONTEXT 1 -#endif - -#ifndef MEMP_NUM_COAPENDPOINT -#define MEMP_NUM_COAPENDPOINT 1 -#endif - -/* 1 is sufficient as this is very short-lived */ -#ifndef MEMP_NUM_COAPPACKET -#define MEMP_NUM_COAPPACKET 1 -#endif - -#ifndef MEMP_NUM_COAPNODE -#define MEMP_NUM_COAPNODE 4 -#endif - -#ifndef MEMP_NUM_COAPPDU -#define MEMP_NUM_COAPPDU MEMP_NUM_COAPNODE -#endif - -#ifndef MEMP_NUM_COAP_SUBSCRIPTION -#define MEMP_NUM_COAP_SUBSCRIPTION 4 -#endif - -#ifndef MEMP_NUM_COAPRESOURCE -#define MEMP_NUM_COAPRESOURCE 10 -#endif - -#ifndef MEMP_NUM_COAPRESOURCEATTR -#define MEMP_NUM_COAPRESOURCEATTR 20 -#endif - -LWIP_MEMPOOL(COAP_CONTEXT, MEMP_NUM_COAPCONTEXT, sizeof(coap_context_t), "COAP_CONTEXT") -LWIP_MEMPOOL(COAP_ENDPOINT, MEMP_NUM_COAPENDPOINT, sizeof(coap_endpoint_t), "COAP_ENDPOINT") -LWIP_MEMPOOL(COAP_PACKET, MEMP_NUM_COAPPACKET, sizeof(coap_packet_t), "COAP_PACKET") -LWIP_MEMPOOL(COAP_NODE, MEMP_NUM_COAPNODE, sizeof(coap_queue_t), "COAP_NODE") -LWIP_MEMPOOL(COAP_PDU, MEMP_NUM_COAPPDU, sizeof(coap_pdu_t), "COAP_PDU") -LWIP_MEMPOOL(COAP_subscription, MEMP_NUM_COAP_SUBSCRIPTION, sizeof(coap_subscription_t), "COAP_subscription") -LWIP_MEMPOOL(COAP_RESOURCE, MEMP_NUM_COAPRESOURCE, sizeof(coap_resource_t), "COAP_RESOURCE") -LWIP_MEMPOOL(COAP_RESOURCEATTR, MEMP_NUM_COAPRESOURCEATTR, sizeof(coap_attr_t), "COAP_RESOURCEATTR") diff --git a/tools/sdk/include/coap/mem.h b/tools/sdk/include/coap/mem.h deleted file mode 100644 index fd3c69aafde..00000000000 --- a/tools/sdk/include/coap/mem.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * mem.h -- CoAP memory handling - * - * Copyright (C) 2010-2011,2014-2015 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -#ifndef _COAP_MEM_H_ -#define _COAP_MEM_H_ - -#include - -#ifndef WITH_LWIP -/** - * Initializes libcoap's memory management. - * This function must be called once before coap_malloc() can be used on - * constrained devices. - */ -void coap_memory_init(void); -#endif /* WITH_LWIP */ - -/** - * Type specifiers for coap_malloc_type(). Memory objects can be typed to - * facilitate arrays of type objects to be used instead of dynamic memory - * management on constrained devices. - */ -typedef enum { - COAP_STRING, - COAP_ATTRIBUTE_NAME, - COAP_ATTRIBUTE_VALUE, - COAP_PACKET, - COAP_NODE, - COAP_CONTEXT, - COAP_ENDPOINT, - COAP_PDU, - COAP_PDU_BUF, - COAP_RESOURCE, - COAP_RESOURCEATTR -} coap_memory_tag_t; - -#ifndef WITH_LWIP - -/** - * Allocates a chunk of @p size bytes and returns a pointer to the newly - * allocated memory. The @p type is used to select the appropriate storage - * container on constrained devices. The storage allocated by coap_malloc_type() - * must be released with coap_free_type(). - * - * @param type The type of object to be stored. - * @param size The number of bytes requested. - * @return A pointer to the allocated storage or @c NULL on error. - */ -void *coap_malloc_type(coap_memory_tag_t type, size_t size); - -/** - * Releases the memory that was allocated by coap_malloc_type(). The type tag @p - * type must be the same that was used for allocating the object pointed to by - * @p . - * - * @param type The type of the object to release. - * @param p A pointer to memory that was allocated by coap_malloc_type(). - */ -void coap_free_type(coap_memory_tag_t type, void *p); - -/** - * Wrapper function to coap_malloc_type() for backwards compatibility. - */ -static inline void *coap_malloc(size_t size) { - return coap_malloc_type(COAP_STRING, size); -} - -/** - * Wrapper function to coap_free_type() for backwards compatibility. - */ -static inline void coap_free(void *object) { - coap_free_type(COAP_STRING, object); -} - -#endif /* not WITH_LWIP */ - -#ifdef WITH_LWIP - -#include - -/* no initialization needed with lwip (or, more precisely: lwip must be - * completely initialized anyway by the time coap gets active) */ -static inline void coap_memory_init(void) {} - -/* It would be nice to check that size equals the size given at the memp - * declaration, but i currently don't see a standard way to check that without - * sourcing the custom memp pools and becoming dependent of its syntax - */ -#define coap_malloc_type(type, size) memp_malloc(MEMP_ ## type) -#define coap_free_type(type, p) memp_free(MEMP_ ## type, p) - -/* Those are just here to make uri.c happy where string allocation has not been - * made conditional. - */ -static inline void *coap_malloc(size_t size) { - LWIP_ASSERT("coap_malloc must not be used in lwIP", 0); -} - -static inline void coap_free(void *pointer) { - LWIP_ASSERT("coap_free must not be used in lwIP", 0); -} - -#endif /* WITH_LWIP */ - -#endif /* _COAP_MEM_H_ */ diff --git a/tools/sdk/include/coap/net.h b/tools/sdk/include/coap/net.h deleted file mode 100644 index 014b4903ab4..00000000000 --- a/tools/sdk/include/coap/net.h +++ /dev/null @@ -1,521 +0,0 @@ -/* - * net.h -- CoAP network interface - * - * Copyright (C) 2010-2015 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -#ifndef _COAP_NET_H_ -#define _COAP_NET_H_ - -#include -#include -#include -#include -#include - -#ifdef WITH_LWIP -#include -#endif - -#include "coap_io.h" -#include "coap_time.h" -#include "option.h" -#include "pdu.h" -#include "prng.h" - -struct coap_queue_t; - -typedef struct coap_queue_t { - struct coap_queue_t *next; - coap_tick_t t; /**< when to send PDU for the next time */ - unsigned char retransmit_cnt; /**< retransmission counter, will be removed - * when zero */ - unsigned int timeout; /**< the randomized timeout value */ - coap_endpoint_t local_if; /**< the local address interface */ - coap_address_t remote; /**< remote address */ - coap_tid_t id; /**< unique transaction id */ - coap_pdu_t *pdu; /**< the CoAP PDU to send */ -} coap_queue_t; - -/** Adds node to given queue, ordered by node->t. */ -int coap_insert_node(coap_queue_t **queue, coap_queue_t *node); - -/** Destroys specified node. */ -int coap_delete_node(coap_queue_t *node); - -/** Removes all items from given queue and frees the allocated storage. */ -void coap_delete_all(coap_queue_t *queue); - -/** Creates a new node suitable for adding to the CoAP sendqueue. */ -coap_queue_t *coap_new_node(void); - -struct coap_resource_t; -struct coap_context_t; -#ifndef WITHOUT_ASYNC -struct coap_async_state_t; -#endif - -/** Message handler that is used as call-back in coap_context_t */ -typedef void (*coap_response_handler_t)(struct coap_context_t *, - const coap_endpoint_t *local_interface, - const coap_address_t *remote, - coap_pdu_t *sent, - coap_pdu_t *received, - const coap_tid_t id); - -#define COAP_MID_CACHE_SIZE 3 -typedef struct { - unsigned char flags[COAP_MID_CACHE_SIZE]; - coap_key_t item[COAP_MID_CACHE_SIZE]; -} coap_mid_cache_t; - -/** The CoAP stack's global state is stored in a coap_context_t object */ -typedef struct coap_context_t { - coap_opt_filter_t known_options; - struct coap_resource_t *resources; /**< hash table or list of known resources */ - -#ifndef WITHOUT_ASYNC - /** - * list of asynchronous transactions */ - struct coap_async_state_t *async_state; -#endif /* WITHOUT_ASYNC */ - - /** - * The time stamp in the first element of the sendqeue is relative - * to sendqueue_basetime. */ - coap_tick_t sendqueue_basetime; - coap_queue_t *sendqueue; - coap_endpoint_t *endpoint; /**< the endpoint used for listening */ - -#ifdef WITH_POSIX - int sockfd; /**< send/receive socket */ -#endif /* WITH_POSIX */ - -#ifdef WITH_CONTIKI - struct uip_udp_conn *conn; /**< uIP connection object */ - struct etimer retransmit_timer; /**< fires when the next packet must be sent */ - struct etimer notify_timer; /**< used to check resources periodically */ -#endif /* WITH_CONTIKI */ - -#ifdef WITH_LWIP - uint8_t timer_configured; /**< Set to 1 when a retransmission is - * scheduled using lwIP timers for this - * context, otherwise 0. */ -#endif /* WITH_LWIP */ - - /** - * The last message id that was used is stored in this field. The initial - * value is set by coap_new_context() and is usually a random value. A new - * message id can be created with coap_new_message_id(). - */ - unsigned short message_id; - - /** - * The next value to be used for Observe. This field is global for all - * resources and will be updated when notifications are created. - */ - unsigned int observe; - - coap_response_handler_t response_handler; - - ssize_t (*network_send)(struct coap_context_t *context, - const coap_endpoint_t *local_interface, - const coap_address_t *dst, - unsigned char *data, size_t datalen); - - ssize_t (*network_read)(coap_endpoint_t *ep, coap_packet_t **packet); - -} coap_context_t; - -/** - * Registers a new message handler that is called whenever a response was - * received that matches an ongoing transaction. - * - * @param context The context to register the handler for. - * @param handler The response handler to register. - */ -static inline void -coap_register_response_handler(coap_context_t *context, - coap_response_handler_t handler) { - context->response_handler = handler; -} - -/** - * Registers the option type @p type with the given context object @p ctx. - * - * @param ctx The context to use. - * @param type The option type to register. - */ -inline static void -coap_register_option(coap_context_t *ctx, unsigned char type) { - coap_option_setb(ctx->known_options, type); -} - -/** - * Set sendqueue_basetime in the given context object @p ctx to @p now. This - * function returns the number of elements in the queue head that have timed - * out. - */ -unsigned int coap_adjust_basetime(coap_context_t *ctx, coap_tick_t now); - -/** - * Returns the next pdu to send without removing from sendqeue. - */ -coap_queue_t *coap_peek_next( coap_context_t *context ); - -/** - * Returns the next pdu to send and removes it from the sendqeue. - */ -coap_queue_t *coap_pop_next( coap_context_t *context ); - -/** - * Creates a new coap_context_t object that will hold the CoAP stack status. - */ -coap_context_t *coap_new_context(const coap_address_t *listen_addr); - -/** - * Returns a new message id and updates @p context->message_id accordingly. The - * message id is returned in network byte order to make it easier to read in - * tracing tools. - * - * @param context The current coap_context_t object. - * - * @return Incremented message id in network byte order. - */ -static inline unsigned short -coap_new_message_id(coap_context_t *context) { - context->message_id++; -#ifndef WITH_CONTIKI - return htons(context->message_id); -#else /* WITH_CONTIKI */ - return uip_htons(context->message_id); -#endif -} - -/** - * CoAP stack context must be released with coap_free_context(). This function - * clears all entries from the receive queue and send queue and deletes the - * resources that have been registered with @p context, and frees the attached - * endpoints. - */ -void coap_free_context(coap_context_t *context); - - -/** - * Sends a confirmed CoAP message to given destination. The memory that is - * allocated by pdu will not be released by coap_send_confirmed(). The caller - * must release the memory. - * - * @param context The CoAP context to use. - * @param local_interface The local network interface where the outbound - * packet is sent. - * @param dst The address to send to. - * @param pdu The CoAP PDU to send. - * - * @return The message id of the sent message or @c - * COAP_INVALID_TID on error. - */ -coap_tid_t coap_send_confirmed(coap_context_t *context, - const coap_endpoint_t *local_interface, - const coap_address_t *dst, - coap_pdu_t *pdu); - -/** - * Creates a new ACK PDU with specified error @p code. The options specified by - * the filter expression @p opts will be copied from the original request - * contained in @p request. Unless @c SHORT_ERROR_RESPONSE was defined at build - * time, the textual reason phrase for @p code will be added as payload, with - * Content-Type @c 0. - * This function returns a pointer to the new response message, or @c NULL on - * error. The storage allocated for the new message must be relased with - * coap_free(). - * - * @param request Specification of the received (confirmable) request. - * @param code The error code to set. - * @param opts An option filter that specifies which options to copy from - * the original request in @p node. - * - * @return A pointer to the new message or @c NULL on error. - */ -coap_pdu_t *coap_new_error_response(coap_pdu_t *request, - unsigned char code, - coap_opt_filter_t opts); - -/** - * Sends a non-confirmed CoAP message to given destination. The memory that is - * allocated by pdu will not be released by coap_send(). - * The caller must release the memory. - * - * @param context The CoAP context to use. - * @param local_interface The local network interface where the outbound packet - * is sent. - * @param dst The address to send to. - * @param pdu The CoAP PDU to send. - * - * @return The message id of the sent message or @c - * COAP_INVALID_TID on error. - */ -coap_tid_t coap_send(coap_context_t *context, - const coap_endpoint_t *local_interface, - const coap_address_t *dst, - coap_pdu_t *pdu); - -/** - * Sends an error response with code @p code for request @p request to @p dst. - * @p opts will be passed to coap_new_error_response() to copy marked options - * from the request. This function returns the transaction id if the message was - * sent, or @c COAP_INVALID_TID otherwise. - * - * @param context The context to use. - * @param request The original request to respond to. - * @param local_interface The local network interface where the outbound packet - * is sent. - * @param dst The remote peer that sent the request. - * @param code The response code. - * @param opts A filter that specifies the options to copy from the - * @p request. - * - * @return The transaction id if the message was sent, or @c - * COAP_INVALID_TID otherwise. - */ -coap_tid_t coap_send_error(coap_context_t *context, - coap_pdu_t *request, - const coap_endpoint_t *local_interface, - const coap_address_t *dst, - unsigned char code, - coap_opt_filter_t opts); - -/** - * Helper funktion to create and send a message with @p type (usually ACK or - * RST). This function returns @c COAP_INVALID_TID when the message was not - * sent, a valid transaction id otherwise. - * - * @param context The CoAP context. - * @param local_interface The local network interface where the outbound packet - * is sent. - * @param dst Where to send the context. - * @param request The request that should be responded to. - * @param type Which type to set. - * @return transaction id on success or @c COAP_INVALID_TID - * otherwise. - */ -coap_tid_t -coap_send_message_type(coap_context_t *context, - const coap_endpoint_t *local_interface, - const coap_address_t *dst, - coap_pdu_t *request, - unsigned char type); - -/** - * Sends an ACK message with code @c 0 for the specified @p request to @p dst. - * This function returns the corresponding transaction id if the message was - * sent or @c COAP_INVALID_TID on error. - * - * @param context The context to use. - * @param local_interface The local network interface where the outbound packet - * is sent. - * @param dst The destination address. - * @param request The request to be acknowledged. - * - * @return The transaction id if ACK was sent or @c - * COAP_INVALID_TID on error. - */ -coap_tid_t coap_send_ack(coap_context_t *context, - const coap_endpoint_t *local_interface, - const coap_address_t *dst, - coap_pdu_t *request); - -/** - * Sends an RST message with code @c 0 for the specified @p request to @p dst. - * This function returns the corresponding transaction id if the message was - * sent or @c COAP_INVALID_TID on error. - * - * @param context The context to use. - * @param local_interface The local network interface where the outbound packet - * is sent. - * @param dst The destination address. - * @param request The request to be reset. - * - * @return The transaction id if RST was sent or @c - * COAP_INVALID_TID on error. - */ -static inline coap_tid_t -coap_send_rst(coap_context_t *context, - const coap_endpoint_t *local_interface, - const coap_address_t *dst, - coap_pdu_t *request) { - return coap_send_message_type(context, - local_interface, - dst, request, - COAP_MESSAGE_RST); -} - -/** - * Handles retransmissions of confirmable messages - */ -coap_tid_t coap_retransmit(coap_context_t *context, coap_queue_t *node); - -/** - * Reads data from the network and tries to parse as CoAP PDU. On success, 0 is - * returned and a new node with the parsed PDU is added to the receive queue in - * the specified context object. - */ -int coap_read(coap_context_t *context); - -/** - * Parses and interprets a CoAP message with context @p ctx. This function - * returns @c 0 if the message was handled, or a value less than zero on - * error. - * - * @param ctx The current CoAP context. - * @param packet The received packet. - * - * @return @c 0 if message was handled successfully, or less than zero on - * error. - */ -int coap_handle_message(coap_context_t *ctx, - coap_packet_t *packet); - -/** - * Calculates a unique transaction id from given arguments @p peer and @p pdu. - * The id is returned in @p id. - * - * @param peer The remote party who sent @p pdu. - * @param pdu The message that initiated the transaction. - * @param id Set to the new id. - */ -void coap_transaction_id(const coap_address_t *peer, - const coap_pdu_t *pdu, - coap_tid_t *id); - -/** - * This function removes the element with given @p id from the list given list. - * If @p id was found, @p node is updated to point to the removed element. Note - * that the storage allocated by @p node is @b not released. The caller must do - * this manually using coap_delete_node(). This function returns @c 1 if the - * element with id @p id was found, @c 0 otherwise. For a return value of @c 0, - * the contents of @p node is undefined. - * - * @param queue The queue to search for @p id. - * @param id The node id to look for. - * @param node If found, @p node is updated to point to the removed node. You - * must release the storage pointed to by @p node manually. - * - * @return @c 1 if @p id was found, @c 0 otherwise. - */ -int coap_remove_from_queue(coap_queue_t **queue, - coap_tid_t id, - coap_queue_t **node); - -/** - * Removes the transaction identified by @p id from given @p queue. This is a - * convenience function for coap_remove_from_queue() with automatic deletion of - * the removed node. - * - * @param queue The queue to search for @p id. - * @param id The transaction id. - * - * @return @c 1 if node was found, removed and destroyed, @c 0 otherwise. - */ -inline static int -coap_remove_transaction(coap_queue_t **queue, coap_tid_t id) { - coap_queue_t *node; - if (!coap_remove_from_queue(queue, id, &node)) - return 0; - - coap_delete_node(node); - return 1; -} - -/** - * Retrieves transaction from the queue. - * - * @param queue The transaction queue to be searched. - * @param id Unique key of the transaction to find. - * - * @return A pointer to the transaction object or NULL if not found. - */ -coap_queue_t *coap_find_transaction(coap_queue_t *queue, coap_tid_t id); - -/** - * Cancels all outstanding messages for peer @p dst that have the specified - * token. - * - * @param context The context in use. - * @param dst Destination address of the messages to remove. - * @param token Message token. - * @param token_length Actual length of @p token. - */ -void coap_cancel_all_messages(coap_context_t *context, - const coap_address_t *dst, - const unsigned char *token, - size_t token_length); - -/** - * Dispatches the PDUs from the receive queue in given context. - */ -void coap_dispatch(coap_context_t *context, coap_queue_t *rcvd); - -/** - * Returns 1 if there are no messages to send or to dispatch in the context's - * queues. */ -int coap_can_exit(coap_context_t *context); - -/** - * Returns the current value of an internal tick counter. The counter counts \c - * COAP_TICKS_PER_SECOND ticks every second. - */ -void coap_ticks(coap_tick_t *); - -/** - * Verifies that @p pdu contains no unknown critical options. Options must be - * registered at @p ctx, using the function coap_register_option(). A basic set - * of options is registered automatically by coap_new_context(). This function - * returns @c 1 if @p pdu is ok, @c 0 otherwise. The given filter object @p - * unknown will be updated with the unknown options. As only @c COAP_MAX_OPT - * options can be signalled this way, remaining options must be examined - * manually. - * - * @code - coap_opt_filter_t f = COAP_OPT_NONE; - coap_opt_iterator_t opt_iter; - - if (coap_option_check_critical(ctx, pdu, f) == 0) { - coap_option_iterator_init(pdu, &opt_iter, f); - - while (coap_option_next(&opt_iter)) { - if (opt_iter.type & 0x01) { - ... handle unknown critical option in opt_iter ... - } - } - } - * @endcode - * - * @param ctx The context where all known options are registered. - * @param pdu The PDU to check. - * @param unknown The output filter that will be updated to indicate the - * unknown critical options found in @p pdu. - * - * @return @c 1 if everything was ok, @c 0 otherwise. - */ -int coap_option_check_critical(coap_context_t *ctx, - coap_pdu_t *pdu, - coap_opt_filter_t unknown); - -/** - * Creates a new response for given @p request with the contents of @c - * .well-known/core. The result is NULL on error or a newly allocated PDU that - * must be released by coap_delete_pdu(). - * - * @param context The current coap context to use. - * @param request The request for @c .well-known/core . - * - * @return A new 2.05 response for @c .well-known/core or NULL on error. - */ -coap_pdu_t *coap_wellknown_response(coap_context_t *context, - coap_pdu_t *request); - -#endif /* _COAP_NET_H_ */ diff --git a/tools/sdk/include/coap/option.h b/tools/sdk/include/coap/option.h deleted file mode 100644 index ace2b81c713..00000000000 --- a/tools/sdk/include/coap/option.h +++ /dev/null @@ -1,410 +0,0 @@ -/* - * option.h -- helpers for handling options in CoAP PDUs - * - * Copyright (C) 2010-2013 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -/** - * @file option.h - * @brief Helpers for handling options in CoAP PDUs - */ - -#ifndef _COAP_OPTION_H_ -#define _COAP_OPTION_H_ - -#include "bits.h" -#include "pdu.h" - -/** - * Use byte-oriented access methods here because sliding a complex struct - * coap_opt_t over the data buffer may cause bus error on certain platforms. - */ -typedef unsigned char coap_opt_t; -#define PCHAR(p) ((coap_opt_t *)(p)) - -/** Representation of CoAP options. */ -typedef struct { - unsigned short delta; - size_t length; - unsigned char *value; -} coap_option_t; - -/** - * Parses the option pointed to by @p opt into @p result. This function returns - * the number of bytes that have been parsed, or @c 0 on error. An error is - * signaled when illegal delta or length values are encountered or when option - * parsing would result in reading past the option (i.e. beyond opt + length). - * - * @param opt The beginning of the option to parse. - * @param length The maximum length of @p opt. - * @param result A pointer to the coap_option_t structure that is filled with - * actual values iff coap_opt_parse() > 0. - * @return The number of bytes parsed or @c 0 on error. - */ -size_t coap_opt_parse(const coap_opt_t *opt, - size_t length, - coap_option_t *result); - -/** - * Returns the size of the given option, taking into account a possible option - * jump. - * - * @param opt An option jump or the beginning of the option. - * @return The number of bytes between @p opt and the end of the option - * starting at @p opt. In case of an error, this function returns - * @c 0 as options need at least one byte storage space. - */ -size_t coap_opt_size(const coap_opt_t *opt); - -/** @deprecated { Use coap_opt_size() instead. } */ -#define COAP_OPT_SIZE(opt) coap_opt_size(opt) - -/** - * Calculates the beginning of the PDU's option section. - * - * @param pdu The PDU containing the options. - * @return A pointer to the first option if available, or @c NULL otherwise. - */ -coap_opt_t *options_start(coap_pdu_t *pdu); - -/** - * Interprets @p opt as pointer to a CoAP option and advances to - * the next byte past this option. - * @hideinitializer - */ -#define options_next(opt) \ - ((coap_opt_t *)((unsigned char *)(opt) + COAP_OPT_SIZE(opt))) - -/** - * @defgroup opt_filter Option Filters - * @{ - */ - -/** - * The number of option types below 256 that can be stored in an - * option filter. COAP_OPT_FILTER_SHORT + COAP_OPT_FILTER_LONG must be - * at most 16. Each coap_option_filter_t object reserves - * ((COAP_OPT_FILTER_SHORT + 1) / 2) * 2 bytes for short options. - */ -#define COAP_OPT_FILTER_SHORT 6 - -/** - * The number of option types above 255 that can be stored in an - * option filter. COAP_OPT_FILTER_SHORT + COAP_OPT_FILTER_LONG must be - * at most 16. Each coap_option_filter_t object reserves - * COAP_OPT_FILTER_LONG * 2 bytes for short options. - */ -#define COAP_OPT_FILTER_LONG 2 - -/* Ensure that COAP_OPT_FILTER_SHORT and COAP_OPT_FILTER_LONG are set - * correctly. */ -#if (COAP_OPT_FILTER_SHORT + COAP_OPT_FILTER_LONG > 16) -#error COAP_OPT_FILTER_SHORT + COAP_OPT_FILTER_LONG must be less or equal 16 -#endif /* (COAP_OPT_FILTER_SHORT + COAP_OPT_FILTER_LONG > 16) */ - -/** The number of elements in coap_opt_filter_t. */ -#define COAP_OPT_FILTER_SIZE \ - (((COAP_OPT_FILTER_SHORT + 1) >> 1) + COAP_OPT_FILTER_LONG) +1 - -/** - * Fixed-size vector we use for option filtering. It is large enough - * to hold COAP_OPT_FILTER_SHORT entries with an option number between - * 0 and 255, and COAP_OPT_FILTER_LONG entries with an option number - * between 256 and 65535. Its internal structure is - * - * @code -struct { - uint16_t mask; - uint16_t long_opts[COAP_OPT_FILTER_LONG]; - uint8_t short_opts[COAP_OPT_FILTER_SHORT]; -} - * @endcode - * - * The first element contains a bit vector that indicates which fields - * in the remaining array are used. The first COAP_OPT_FILTER_LONG - * bits correspond to the long option types that are stored in the - * elements from index 1 to COAP_OPT_FILTER_LONG. The next - * COAP_OPT_FILTER_SHORT bits correspond to the short option types - * that are stored in the elements from index COAP_OPT_FILTER_LONG + 1 - * to COAP_OPT_FILTER_LONG + COAP_OPT_FILTER_SHORT. The latter - * elements are treated as bytes. - */ -typedef uint16_t coap_opt_filter_t[COAP_OPT_FILTER_SIZE]; - -/** Pre-defined filter that includes all options. */ -#define COAP_OPT_ALL NULL - -/** - * Clears filter @p f. - * - * @param f The filter to clear. - */ -static inline void -coap_option_filter_clear(coap_opt_filter_t f) { - memset(f, 0, sizeof(coap_opt_filter_t)); -} - -/** - * Sets the corresponding entry for @p type in @p filter. This - * function returns @c 1 if bit was set or @c 0 on error (i.e. when - * the given type does not fit in the filter). - * - * @param filter The filter object to change. - * @param type The type for which the bit should be set. - * - * @return @c 1 if bit was set, @c 0 otherwise. - */ -int coap_option_filter_set(coap_opt_filter_t filter, unsigned short type); - -/** - * Clears the corresponding entry for @p type in @p filter. This - * function returns @c 1 if bit was set or @c 0 on error (i.e. when - * the given type does not fit in the filter). - * - * @param filter The filter object to change. - * @param type The type that should be cleared from the filter. - * - * @return @c 1 if bit was set, @c 0 otherwise. - */ -int coap_option_filter_unset(coap_opt_filter_t filter, unsigned short type); - -/** - * Checks if @p type is contained in @p filter. This function returns - * @c 1 if found, @c 0 if not, or @c -1 on error (i.e. when the given - * type does not fit in the filter). - * - * @param filter The filter object to search. - * @param type The type to search for. - * - * @return @c 1 if @p type was found, @c 0 otherwise, or @c -1 on error. - */ -int coap_option_filter_get(const coap_opt_filter_t filter, unsigned short type); - -/** - * Sets the corresponding bit for @p type in @p filter. This function returns @c - * 1 if bit was set or @c -1 on error (i.e. when the given type does not fit in - * the filter). - * - * @deprecated Use coap_option_filter_set() instead. - * - * @param filter The filter object to change. - * @param type The type for which the bit should be set. - * - * @return @c 1 if bit was set, @c -1 otherwise. - */ -inline static int -coap_option_setb(coap_opt_filter_t filter, unsigned short type) { - return coap_option_filter_set(filter, type) ? 1 : -1; -} - -/** - * Clears the corresponding bit for @p type in @p filter. This function returns - * @c 1 if bit was cleared or @c -1 on error (i.e. when the given type does not - * fit in the filter). - * - * @deprecated Use coap_option_filter_unset() instead. - * - * @param filter The filter object to change. - * @param type The type for which the bit should be cleared. - * - * @return @c 1 if bit was set, @c -1 otherwise. - */ -inline static int -coap_option_clrb(coap_opt_filter_t filter, unsigned short type) { - return coap_option_filter_unset(filter, type) ? 1 : -1; -} - -/** - * Gets the corresponding bit for @p type in @p filter. This function returns @c - * 1 if the bit is set @c 0 if not, or @c -1 on error (i.e. when the given type - * does not fit in the filter). - * - * @deprecated Use coap_option_filter_get() instead. - * - * @param filter The filter object to read bit from. - * @param type The type for which the bit should be read. - * - * @return @c 1 if bit was set, @c 0 if not, @c -1 on error. - */ -inline static int -coap_option_getb(const coap_opt_filter_t filter, unsigned short type) { - return coap_option_filter_get(filter, type); -} - -/** - * Iterator to run through PDU options. This object must be - * initialized with coap_option_iterator_init(). Call - * coap_option_next() to walk through the list of options until - * coap_option_next() returns @c NULL. - * - * @code - * coap_opt_t *option; - * coap_opt_iterator_t opt_iter; - * coap_option_iterator_init(pdu, &opt_iter, COAP_OPT_ALL); - * - * while ((option = coap_option_next(&opt_iter))) { - * ... do something with option ... - * } - * @endcode - */ -typedef struct { - size_t length; /**< remaining length of PDU */ - unsigned short type; /**< decoded option type */ - unsigned int bad:1; /**< iterator object is ok if not set */ - unsigned int filtered:1; /**< denotes whether or not filter is used */ - coap_opt_t *next_option; /**< pointer to the unparsed next option */ - coap_opt_filter_t filter; /**< option filter */ -} coap_opt_iterator_t; - -/** - * Initializes the given option iterator @p oi to point to the beginning of the - * @p pdu's option list. This function returns @p oi on success, @c NULL - * otherwise (i.e. when no options exist). Note that a length check on the - * option list must be performed before coap_option_iterator_init() is called. - * - * @param pdu The PDU the options of which should be walked through. - * @param oi An iterator object that will be initilized. - * @param filter An optional option type filter. - * With @p type != @c COAP_OPT_ALL, coap_option_next() - * will return only options matching this bitmask. - * Fence-post options @c 14, @c 28, @c 42, ... are always - * skipped. - * - * @return The iterator object @p oi on success, @c NULL otherwise. - */ -coap_opt_iterator_t *coap_option_iterator_init(coap_pdu_t *pdu, - coap_opt_iterator_t *oi, - const coap_opt_filter_t filter); - -/** - * Updates the iterator @p oi to point to the next option. This function returns - * a pointer to that option or @c NULL if no more options exist. The contents of - * @p oi will be updated. In particular, @c oi->n specifies the current option's - * ordinal number (counted from @c 1), @c oi->type is the option's type code, - * and @c oi->option points to the beginning of the current option itself. When - * advanced past the last option, @c oi->option will be @c NULL. - * - * Note that options are skipped whose corresponding bits in the filter - * specified with coap_option_iterator_init() are @c 0. Options with type codes - * that do not fit in this filter hence will always be returned. - * - * @param oi The option iterator to update. - * - * @return The next option or @c NULL if no more options exist. - */ -coap_opt_t *coap_option_next(coap_opt_iterator_t *oi); - -/** - * Retrieves the first option of type @p type from @p pdu. @p oi must point to a - * coap_opt_iterator_t object that will be initialized by this function to - * filter only options with code @p type. This function returns the first option - * with this type, or @c NULL if not found. - * - * @param pdu The PDU to parse for options. - * @param type The option type code to search for. - * @param oi An iterator object to use. - * - * @return A pointer to the first option of type @p type, or @c NULL if - * not found. - */ -coap_opt_t *coap_check_option(coap_pdu_t *pdu, - unsigned short type, - coap_opt_iterator_t *oi); - -/** - * Encodes the given delta and length values into @p opt. This function returns - * the number of bytes that were required to encode @p delta and @p length or @c - * 0 on error. Note that the result indicates by how many bytes @p opt must be - * advanced to encode the option value. - * - * @param opt The option buffer space where @p delta and @p length are - * written. - * @param maxlen The maximum length of @p opt. - * @param delta The actual delta value to encode. - * @param length The actual length value to encode. - * - * @return The number of bytes used or @c 0 on error. - */ -size_t coap_opt_setheader(coap_opt_t *opt, - size_t maxlen, - unsigned short delta, - size_t length); - -/** - * Encodes option with given @p delta into @p opt. This function returns the - * number of bytes written to @p opt or @c 0 on error. This happens especially - * when @p opt does not provide sufficient space to store the option value, - * delta, and option jumps when required. - * - * @param opt The option buffer space where @p val is written. - * @param n Maximum length of @p opt. - * @param delta The option delta. - * @param val The option value to copy into @p opt. - * @param length The actual length of @p val. - * - * @return The number of bytes that have been written to @p opt or @c 0 on - * error. The return value will always be less than @p n. - */ -size_t coap_opt_encode(coap_opt_t *opt, - size_t n, - unsigned short delta, - const unsigned char *val, - size_t length); - -/** - * Decodes the delta value of the next option. This function returns the number - * of bytes read or @c 0 on error. The caller of this function must ensure that - * it does not read over the boundaries of @p opt (e.g. by calling - * coap_opt_check_delta(). - * - * @param opt The option to examine. - * - * @return The number of bytes read or @c 0 on error. - */ -unsigned short coap_opt_delta(const coap_opt_t *opt); - -/** @deprecated { Use coap_opt_delta() instead. } */ -#define COAP_OPT_DELTA(opt) coap_opt_delta(opt) - -/** @deprecated { Use coap_opt_encode() instead. } */ -#define COAP_OPT_SETDELTA(opt,val) \ - coap_opt_encode((opt), COAP_MAX_PDU_SIZE, (val), NULL, 0) - -/** - * Returns the length of the given option. @p opt must point to an option jump - * or the beginning of the option. This function returns @c 0 when @p opt is not - * an option or the actual length of @p opt (which can be @c 0 as well). - * - * @note {The rationale for using @c 0 in case of an error is that in most - * contexts, the result of this function is used to skip the next - * coap_opt_length() bytes.} - * - * @param opt The option whose length should be returned. - * - * @return The option's length or @c 0 when undefined. - */ -unsigned short coap_opt_length(const coap_opt_t *opt); - -/** @deprecated { Use coap_opt_length() instead. } */ -#define COAP_OPT_LENGTH(opt) coap_opt_length(opt) - -/** - * Returns a pointer to the value of the given option. @p opt must point to an - * option jump or the beginning of the option. This function returns @c NULL if - * @p opt is not a valid option. - * - * @param opt The option whose value should be returned. - * - * @return A pointer to the option value or @c NULL on error. - */ -unsigned char *coap_opt_value(coap_opt_t *opt); - -/** @deprecated { Use coap_opt_value() instead. } */ -#define COAP_OPT_VALUE(opt) coap_opt_value((coap_opt_t *)opt) - -/** @} */ - -#endif /* _OPTION_H_ */ diff --git a/tools/sdk/include/coap/pdu.h b/tools/sdk/include/coap/pdu.h deleted file mode 100644 index 7ed482deee0..00000000000 --- a/tools/sdk/include/coap/pdu.h +++ /dev/null @@ -1,388 +0,0 @@ -/* - * pdu.h -- CoAP message structure - * - * Copyright (C) 2010-2014 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -/** - * @file pdu.h - * @brief Pre-defined constants that reflect defaults for CoAP - */ - -#ifndef _COAP_PDU_H_ -#define _COAP_PDU_H_ - -#include "uri.h" - -#ifdef WITH_LWIP -#include -#endif - -#define COAP_DEFAULT_PORT 5683 /* CoAP default UDP port */ -#define COAP_DEFAULT_MAX_AGE 60 /* default maximum object lifetime in seconds */ -#ifndef COAP_MAX_PDU_SIZE -#define COAP_MAX_PDU_SIZE 1400 /* maximum size of a CoAP PDU */ -#endif /* COAP_MAX_PDU_SIZE */ - -#define COAP_DEFAULT_VERSION 1 /* version of CoAP supported */ -#define COAP_DEFAULT_SCHEME "coap" /* the default scheme for CoAP URIs */ - -/** well-known resources URI */ -#define COAP_DEFAULT_URI_WELLKNOWN ".well-known/core" - -#ifdef __COAP_DEFAULT_HASH -/* pre-calculated hash key for the default well-known URI */ -#define COAP_DEFAULT_WKC_HASHKEY "\345\130\144\245" -#endif - -/* CoAP message types */ - -#define COAP_MESSAGE_CON 0 /* confirmable message (requires ACK/RST) */ -#define COAP_MESSAGE_NON 1 /* non-confirmable message (one-shot message) */ -#define COAP_MESSAGE_ACK 2 /* used to acknowledge confirmable messages */ -#define COAP_MESSAGE_RST 3 /* indicates error in received messages */ - -/* CoAP request methods */ - -#define COAP_REQUEST_GET 1 -#define COAP_REQUEST_POST 2 -#define COAP_REQUEST_PUT 3 -#define COAP_REQUEST_DELETE 4 - -/* CoAP option types (be sure to update check_critical when adding options */ - -#define COAP_OPTION_IF_MATCH 1 /* C, opaque, 0-8 B, (none) */ -#define COAP_OPTION_URI_HOST 3 /* C, String, 1-255 B, destination address */ -#define COAP_OPTION_ETAG 4 /* E, opaque, 1-8 B, (none) */ -#define COAP_OPTION_IF_NONE_MATCH 5 /* empty, 0 B, (none) */ -#define COAP_OPTION_URI_PORT 7 /* C, uint, 0-2 B, destination port */ -#define COAP_OPTION_LOCATION_PATH 8 /* E, String, 0-255 B, - */ -#define COAP_OPTION_URI_PATH 11 /* C, String, 0-255 B, (none) */ -#define COAP_OPTION_CONTENT_FORMAT 12 /* E, uint, 0-2 B, (none) */ -#define COAP_OPTION_CONTENT_TYPE COAP_OPTION_CONTENT_FORMAT -#define COAP_OPTION_MAXAGE 14 /* E, uint, 0--4 B, 60 Seconds */ -#define COAP_OPTION_URI_QUERY 15 /* C, String, 1-255 B, (none) */ -#define COAP_OPTION_ACCEPT 17 /* C, uint, 0-2 B, (none) */ -#define COAP_OPTION_LOCATION_QUERY 20 /* E, String, 0-255 B, (none) */ -#define COAP_OPTION_PROXY_URI 35 /* C, String, 1-1034 B, (none) */ -#define COAP_OPTION_PROXY_SCHEME 39 /* C, String, 1-255 B, (none) */ -#define COAP_OPTION_SIZE1 60 /* E, uint, 0-4 B, (none) */ - -/* option types from RFC 7641 */ - -#define COAP_OPTION_OBSERVE 6 /* E, empty/uint, 0 B/0-3 B, (none) */ -#define COAP_OPTION_SUBSCRIPTION COAP_OPTION_OBSERVE - -/* selected option types from RFC 7959 */ - -#define COAP_OPTION_BLOCK2 23 /* C, uint, 0--3 B, (none) */ -#define COAP_OPTION_BLOCK1 27 /* C, uint, 0--3 B, (none) */ - -/* selected option types from RFC 7967 */ - -#define COAP_OPTION_NORESPONSE 258 /* N, uint, 0--1 B, 0 */ - -#define COAP_MAX_OPT 65535 /**< the highest option number we know */ - -/* CoAP result codes (HTTP-Code / 100 * 40 + HTTP-Code % 100) */ - -/* As of draft-ietf-core-coap-04, response codes are encoded to base - * 32, i.e. the three upper bits determine the response class while - * the remaining five fine-grained information specific to that class. - */ -#define COAP_RESPONSE_CODE(N) (((N)/100 << 5) | (N)%100) - -/* Determines the class of response code C */ -#define COAP_RESPONSE_CLASS(C) (((C) >> 5) & 0xFF) - -#ifndef SHORT_ERROR_RESPONSE -/** - * Returns a human-readable response phrase for the specified CoAP response @p - * code. This function returns @c NULL if not found. - * - * @param code The response code for which the literal phrase should be - * retrieved. - * - * @return A zero-terminated string describing the error, or @c NULL if not - * found. - */ -char *coap_response_phrase(unsigned char code); - -#define COAP_ERROR_PHRASE_LENGTH 32 /**< maximum length of error phrase */ - -#else -#define coap_response_phrase(x) ((char *)NULL) - -#define COAP_ERROR_PHRASE_LENGTH 0 /**< maximum length of error phrase */ -#endif /* SHORT_ERROR_RESPONSE */ - -/* The following definitions exist for backwards compatibility */ -#if 0 /* this does not exist any more */ -#define COAP_RESPONSE_100 40 /* 100 Continue */ -#endif -#define COAP_RESPONSE_200 COAP_RESPONSE_CODE(200) /* 2.00 OK */ -#define COAP_RESPONSE_201 COAP_RESPONSE_CODE(201) /* 2.01 Created */ -#define COAP_RESPONSE_304 COAP_RESPONSE_CODE(203) /* 2.03 Valid */ -#define COAP_RESPONSE_400 COAP_RESPONSE_CODE(400) /* 4.00 Bad Request */ -#define COAP_RESPONSE_404 COAP_RESPONSE_CODE(404) /* 4.04 Not Found */ -#define COAP_RESPONSE_405 COAP_RESPONSE_CODE(405) /* 4.05 Method Not Allowed */ -#define COAP_RESPONSE_415 COAP_RESPONSE_CODE(415) /* 4.15 Unsupported Media Type */ -#define COAP_RESPONSE_500 COAP_RESPONSE_CODE(500) /* 5.00 Internal Server Error */ -#define COAP_RESPONSE_501 COAP_RESPONSE_CODE(501) /* 5.01 Not Implemented */ -#define COAP_RESPONSE_503 COAP_RESPONSE_CODE(503) /* 5.03 Service Unavailable */ -#define COAP_RESPONSE_504 COAP_RESPONSE_CODE(504) /* 5.04 Gateway Timeout */ -#if 0 /* these response codes do not have a valid code any more */ -# define COAP_RESPONSE_X_240 240 /* Token Option required by server */ -# define COAP_RESPONSE_X_241 241 /* Uri-Authority Option required by server */ -#endif -#define COAP_RESPONSE_X_242 COAP_RESPONSE_CODE(402) /* Critical Option not supported */ - -/* CoAP media type encoding */ - -#define COAP_MEDIATYPE_TEXT_PLAIN 0 /* text/plain (UTF-8) */ -#define COAP_MEDIATYPE_APPLICATION_LINK_FORMAT 40 /* application/link-format */ -#define COAP_MEDIATYPE_APPLICATION_XML 41 /* application/xml */ -#define COAP_MEDIATYPE_APPLICATION_OCTET_STREAM 42 /* application/octet-stream */ -#define COAP_MEDIATYPE_APPLICATION_RDF_XML 43 /* application/rdf+xml */ -#define COAP_MEDIATYPE_APPLICATION_EXI 47 /* application/exi */ -#define COAP_MEDIATYPE_APPLICATION_JSON 50 /* application/json */ -#define COAP_MEDIATYPE_APPLICATION_CBOR 60 /* application/cbor */ - -/* Note that identifiers for registered media types are in the range 0-65535. We - * use an unallocated type here and hope for the best. */ -#define COAP_MEDIATYPE_ANY 0xff /* any media type */ - -/** - * coap_tid_t is used to store CoAP transaction id, i.e. a hash value - * built from the remote transport address and the message id of a - * CoAP PDU. Valid transaction ids are greater or equal zero. - */ -typedef int coap_tid_t; - -/** Indicates an invalid transaction id. */ -#define COAP_INVALID_TID -1 - -/** - * Indicates that a response is suppressed. This will occur for error - * responses if the request was received via IP multicast. - */ -#define COAP_DROPPED_RESPONSE -2 - -#ifdef WORDS_BIGENDIAN -typedef struct { - unsigned int version:2; /* protocol version */ - unsigned int type:2; /* type flag */ - unsigned int token_length:4; /* length of Token */ - unsigned int code:8; /* request method (value 1--10) or response - code (value 40-255) */ - unsigned short id; /* message id */ - unsigned char token[]; /* the actual token, if any */ -} coap_hdr_t; -#else -typedef struct { - unsigned int token_length:4; /* length of Token */ - unsigned int type:2; /* type flag */ - unsigned int version:2; /* protocol version */ - unsigned int code:8; /* request method (value 1--10) or response - code (value 40-255) */ - unsigned short id; /* transaction id (network byte order!) */ - unsigned char token[]; /* the actual token, if any */ -} coap_hdr_t; -#endif - -#define COAP_MESSAGE_IS_EMPTY(MSG) ((MSG)->code == 0) -#define COAP_MESSAGE_IS_REQUEST(MSG) (!COAP_MESSAGE_IS_EMPTY(MSG) \ - && ((MSG)->code < 32)) -#define COAP_MESSAGE_IS_RESPONSE(MSG) ((MSG)->code >= 64) - -#define COAP_OPT_LONG 0x0F /* OC == 0b1111 indicates that the option list - * in a CoAP message is limited by 0b11110000 - * marker */ - -#define COAP_OPT_END 0xF0 /* end marker */ - -#define COAP_PAYLOAD_START 0xFF /* payload marker */ - -/** - * Structures for more convenient handling of options. (To be used with ordered - * coap_list_t.) The option's data will be added to the end of the coap_option - * structure (see macro COAP_OPTION_DATA). - */ -typedef struct { - unsigned short key; /* the option key (no delta coding) */ - unsigned int length; -} coap_option; - -#define COAP_OPTION_KEY(option) (option).key -#define COAP_OPTION_LENGTH(option) (option).length -#define COAP_OPTION_DATA(option) ((unsigned char *)&(option) + sizeof(coap_option)) - -/** - * Header structure for CoAP PDUs - */ - -typedef struct { - size_t max_size; /**< allocated storage for options and data */ - coap_hdr_t *hdr; /**< Address of the first byte of the CoAP message. - * This may or may not equal (coap_hdr_t*)(pdu+1) - * depending on the memory management - * implementation. */ - unsigned short max_delta; /**< highest option number */ - unsigned short length; /**< PDU length (including header, options, data) */ - unsigned char *data; /**< payload */ - -#ifdef WITH_LWIP - struct pbuf *pbuf; /**< lwIP PBUF. The package data will always reside - * inside the pbuf's payload, but this pointer - * has to be kept because no exact offset can be - * given. This field must not be accessed from - * outside, because the pbuf's reference count - * is checked to be 1 when the pbuf is assigned - * to the pdu, and the pbuf stays exclusive to - * this pdu. */ -#endif -} coap_pdu_t; - -/** - * Options in coap_pdu_t are accessed with the macro COAP_OPTION. - */ -#define COAP_OPTION(node) ((coap_option *)(node)->options) - -#ifdef WITH_LWIP -/** - * Creates a CoAP PDU from an lwIP @p pbuf, whose reference is passed on to this - * function. - * - * The pbuf is checked for being contiguous, and for having only one reference. - * The reference is stored in the PDU and will be freed when the PDU is freed. - * - * (For now, these are fatal errors; in future, a new pbuf might be allocated, - * the data copied and the passed pbuf freed). - * - * This behaves like coap_pdu_init(0, 0, 0, pbuf->tot_len), and afterwards - * copying the contents of the pbuf to the pdu. - * - * @return A pointer to the new PDU object or @c NULL on error. - */ -coap_pdu_t * coap_pdu_from_pbuf(struct pbuf *pbuf); -#endif - -/** - * Creates a new CoAP PDU of given @p size (must be large enough to hold the - * basic CoAP message header (coap_hdr_t). The function returns a pointer to the - * node coap_pdu_t object on success, or @c NULL on error. The storage allocated - * for the result must be released with coap_delete_pdu(). - * - * @param type The type of the PDU (one of COAP_MESSAGE_CON, COAP_MESSAGE_NON, - * COAP_MESSAGE_ACK, COAP_MESSAGE_RST). - * @param code The message code. - * @param id The message id to set or COAP_INVALID_TID if unknown. - * @param size The number of bytes to allocate for the actual message. - * - * @return A pointer to the new PDU object or @c NULL on error. - */ -coap_pdu_t * -coap_pdu_init(unsigned char type, - unsigned char code, - unsigned short id, - size_t size); - -/** - * Clears any contents from @p pdu and resets @c version field, @c - * length and @c data pointers. @c max_size is set to @p size, any - * other field is set to @c 0. Note that @p pdu must be a valid - * pointer to a coap_pdu_t object created e.g. by coap_pdu_init(). - */ -void coap_pdu_clear(coap_pdu_t *pdu, size_t size); - -/** - * Creates a new CoAP PDU. - * The object is created on the heap and must be released using - * coap_delete_pdu(); - * - * @deprecated This function allocates the maximum storage for each - * PDU. Use coap_pdu_init() instead. - */ -coap_pdu_t *coap_new_pdu(void); - -void coap_delete_pdu(coap_pdu_t *); - -/** - * Parses @p data into the CoAP PDU structure given in @p result. - * This function returns @c 0 on error or a number greater than zero on success. - * - * @param data The raw data to parse as CoAP PDU. - * @param length The actual size of @p data. - * @param result The PDU structure to fill. Note that the structure must - * provide space for at least @p length bytes to hold the - * entire CoAP PDU. - * - * @return A value greater than zero on success or @c 0 on error. - */ -int coap_pdu_parse(unsigned char *data, - size_t length, - coap_pdu_t *result); - -/** - * Adds token of length @p len to @p pdu. - * Adding the token destroys any following contents of the pdu. Hence options - * and data must be added after coap_add_token() has been called. In @p pdu, - * length is set to @p len + @c 4, and max_delta is set to @c 0. This funtion - * returns @c 0 on error or a value greater than zero on success. - * - * @param pdu The PDU where the token is to be added. - * @param len The length of the new token. - * @param data The token to add. - * - * @return A value greater than zero on success, or @c 0 on error. - */ -int coap_add_token(coap_pdu_t *pdu, - size_t len, - const unsigned char *data); - -/** - * Adds option of given type to pdu that is passed as first - * parameter. - * coap_add_option() destroys the PDU's data, so coap_add_data() must be called - * after all options have been added. As coap_add_token() destroys the options - * following the token, the token must be added before coap_add_option() is - * called. This function returns the number of bytes written or @c 0 on error. - */ -size_t coap_add_option(coap_pdu_t *pdu, - unsigned short type, - unsigned int len, - const unsigned char *data); - -/** - * Adds option of given type to pdu that is passed as first parameter, but does - * not write a value. It works like coap_add_option with respect to calling - * sequence (i.e. after token and before data). This function returns a memory - * address to which the option data has to be written before the PDU can be - * sent, or @c NULL on error. - */ -unsigned char *coap_add_option_later(coap_pdu_t *pdu, - unsigned short type, - unsigned int len); - -/** - * Adds given data to the pdu that is passed as first parameter. Note that the - * PDU's data is destroyed by coap_add_option(). coap_add_data() must be called - * only once per PDU, otherwise the result is undefined. - */ -int coap_add_data(coap_pdu_t *pdu, - unsigned int len, - const unsigned char *data); - -/** - * Retrieves the length and data pointer of specified PDU. Returns 0 on error or - * 1 if *len and *data have correct values. Note that these values are destroyed - * with the pdu. - */ -int coap_get_data(coap_pdu_t *pdu, - size_t *len, - unsigned char **data); - -#endif /* _COAP_PDU_H_ */ diff --git a/tools/sdk/include/coap/prng.h b/tools/sdk/include/coap/prng.h deleted file mode 100644 index da6d9534404..00000000000 --- a/tools/sdk/include/coap/prng.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * prng.h -- Pseudo Random Numbers - * - * Copyright (C) 2010-2011 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -/** - * @file prng.h - * @brief Pseudo Random Numbers - */ - -#ifndef _COAP_PRNG_H_ -#define _COAP_PRNG_H_ - -/** - * @defgroup prng Pseudo Random Numbers - * @{ - */ - -#if defined(WITH_POSIX) || (defined(WITH_LWIP) && !defined(LWIP_RAND)) -#include - -/** - * Fills \p buf with \p len random bytes. This is the default implementation for - * prng(). You might want to change prng() to use a better PRNG on your specific - * platform. - */ -static inline int -coap_prng_impl(unsigned char *buf, size_t len) { - while (len--) - *buf++ = rand() & 0xFF; - return 1; -} -#endif /* WITH_POSIX */ - -#ifdef WITH_CONTIKI -#include - -/** - * Fills \p buf with \p len random bytes. This is the default implementation for - * prng(). You might want to change prng() to use a better PRNG on your specific - * platform. - */ -static inline int -contiki_prng_impl(unsigned char *buf, size_t len) { - unsigned short v = random_rand(); - while (len > sizeof(v)) { - memcpy(buf, &v, sizeof(v)); - len -= sizeof(v); - buf += sizeof(v); - v = random_rand(); - } - - memcpy(buf, &v, len); - return 1; -} - -#define prng(Buf,Length) contiki_prng_impl((Buf), (Length)) -#define prng_init(Value) random_init((unsigned short)(Value)) -#endif /* WITH_CONTIKI */ - -#if defined(WITH_LWIP) && defined(LWIP_RAND) -static inline int -lwip_prng_impl(unsigned char *buf, size_t len) { - u32_t v = LWIP_RAND(); - while (len > sizeof(v)) { - memcpy(buf, &v, sizeof(v)); - len -= sizeof(v); - buf += sizeof(v); - v = LWIP_RAND(); - } - - memcpy(buf, &v, len); - return 1; -} - -#define prng(Buf,Length) lwip_prng_impl((Buf), (Length)) -#define prng_init(Value) - -#endif /* WITH_LWIP */ - -#ifndef prng -/** - * Fills \p Buf with \p Length bytes of random data. - * - * @hideinitializer - */ -#define prng(Buf,Length) coap_prng_impl((Buf), (Length)) -#endif - -#ifndef prng_init -/** - * Called to set the PRNG seed. You may want to re-define this to allow for a - * better PRNG. - * - * @hideinitializer - */ -#define prng_init(Value) srand((unsigned long)(Value)) -#endif - -/** @} */ - -#endif /* _COAP_PRNG_H_ */ diff --git a/tools/sdk/include/coap/resource.h b/tools/sdk/include/coap/resource.h deleted file mode 100644 index dbb19a8d1f6..00000000000 --- a/tools/sdk/include/coap/resource.h +++ /dev/null @@ -1,408 +0,0 @@ -/* - * resource.h -- generic resource handling - * - * Copyright (C) 2010,2011,2014,2015 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -/** - * @file resource.h - * @brief Generic resource handling - */ - -#ifndef _COAP_RESOURCE_H_ -#define _COAP_RESOURCE_H_ - -# include - -#ifndef COAP_RESOURCE_CHECK_TIME -/** The interval in seconds to check if resources have changed. */ -#define COAP_RESOURCE_CHECK_TIME 2 -#endif /* COAP_RESOURCE_CHECK_TIME */ - -#ifdef COAP_RESOURCES_NOHASH -# include "utlist.h" -#else -# include "uthash.h" -#endif - -#include "hashkey.h" -#include "async.h" -#include "str.h" -#include "pdu.h" -#include "net.h" -#include "subscribe.h" - -/** - * Definition of message handler function (@sa coap_resource_t). - */ -typedef void (*coap_method_handler_t) - (coap_context_t *, - struct coap_resource_t *, - const coap_endpoint_t *, - coap_address_t *, - coap_pdu_t *, - str * /* token */, - coap_pdu_t * /* response */); - -#define COAP_ATTR_FLAGS_RELEASE_NAME 0x1 -#define COAP_ATTR_FLAGS_RELEASE_VALUE 0x2 - -typedef struct coap_attr_t { - struct coap_attr_t *next; - str name; - str value; - int flags; -} coap_attr_t; - -/** The URI passed to coap_resource_init() is free'd by coap_delete_resource(). */ -#define COAP_RESOURCE_FLAGS_RELEASE_URI 0x1 - -/** - * Notifications will be sent non-confirmable by default. RFC 7641 Section 4.5 - * https://tools.ietf.org/html/rfc7641#section-4.5 - */ -#define COAP_RESOURCE_FLAGS_NOTIFY_NON 0x0 - -/** - * Notifications will be sent confirmable by default. RFC 7641 Section 4.5 - * https://tools.ietf.org/html/rfc7641#section-4.5 - */ -#define COAP_RESOURCE_FLAGS_NOTIFY_CON 0x2 - -typedef struct coap_resource_t { - unsigned int dirty:1; /**< set to 1 if resource has changed */ - unsigned int partiallydirty:1; /**< set to 1 if some subscribers have not yet - * been notified of the last change */ - unsigned int observable:1; /**< can be observed */ - unsigned int cacheable:1; /**< can be cached */ - - /** - * Used to store handlers for the four coap methods @c GET, @c POST, @c PUT, - * and @c DELETE. coap_dispatch() will pass incoming requests to the handler - * that corresponds to its request method or generate a 4.05 response if no - * handler is available. - */ - coap_method_handler_t handler[4]; - - coap_key_t key; /**< the actual key bytes for this resource */ - -#ifdef COAP_RESOURCES_NOHASH - struct coap_resource_t *next; -#else - UT_hash_handle hh; -#endif - - coap_attr_t *link_attr; /**< attributes to be included with the link format */ - coap_subscription_t *subscribers; /**< list of observers for this resource */ - - /** - * Request URI for this resource. This field will point into the static - * memory. - */ - str uri; - int flags; - -} coap_resource_t; - -/** - * Creates a new resource object and initializes the link field to the string - * of length @p len. This function returns the new coap_resource_t object. - * - * @param uri The URI path of the new resource. - * @param len The length of @p uri. - * @param flags Flags for memory management (in particular release of memory). - * - * @return A pointer to the new object or @c NULL on error. - */ -coap_resource_t *coap_resource_init(const unsigned char *uri, - size_t len, int flags); - - -/** - * Sets the notification message type of resource @p r to given - * @p mode which must be one of @c COAP_RESOURCE_FLAGS_NOTIFY_NON - * or @c COAP_RESOURCE_FLAGS_NOTIFY_CON. - */ -static inline void -coap_resource_set_mode(coap_resource_t *r, int mode) { - r->flags = (r->flags & !COAP_RESOURCE_FLAGS_NOTIFY_CON) | mode; -} - -/** - * Registers the given @p resource for @p context. The resource must have been - * created by coap_resource_init(), the storage allocated for the resource will - * be released by coap_delete_resource(). - * - * @param context The context to use. - * @param resource The resource to store. - */ -void coap_add_resource(coap_context_t *context, coap_resource_t *resource); - -/** - * Deletes a resource identified by @p key. The storage allocated for that - * resource is freed. - * - * @param context The context where the resources are stored. - * @param key The unique key for the resource to delete. - * - * @return @c 1 if the resource was found (and destroyed), - * @c 0 otherwise. - */ -int coap_delete_resource(coap_context_t *context, coap_key_t key); - -/** - * Deletes all resources from given @p context and frees their storage. - * - * @param context The CoAP context with the resources to be deleted. - */ -void coap_delete_all_resources(coap_context_t *context); - -/** - * Registers a new attribute with the given @p resource. As the - * attributes str fields will point to @p name and @p val the - * caller must ensure that these pointers are valid during the - * attribute's lifetime. - * - * @param resource The resource to register the attribute with. - * @param name The attribute's name. - * @param nlen Length of @p name. - * @param val The attribute's value or @c NULL if none. - * @param vlen Length of @p val if specified. - * @param flags Flags for memory management (in particular release of - * memory). - * - * @return A pointer to the new attribute or @c NULL on error. - */ -coap_attr_t *coap_add_attr(coap_resource_t *resource, - const unsigned char *name, - size_t nlen, - const unsigned char *val, - size_t vlen, - int flags); - -/** - * Returns @p resource's coap_attr_t object with given @p name if found, @c NULL - * otherwise. - * - * @param resource The resource to search for attribute @p name. - * @param name Name of the requested attribute. - * @param nlen Actual length of @p name. - * @return The first attribute with specified @p name or @c NULL if none - * was found. - */ -coap_attr_t *coap_find_attr(coap_resource_t *resource, - const unsigned char *name, - size_t nlen); - -/** - * Deletes an attribute. - * - * @param attr Pointer to a previously created attribute. - * - */ -void coap_delete_attr(coap_attr_t *attr); - -/** - * Status word to encode the result of conditional print or copy operations such - * as coap_print_link(). The lower 28 bits of coap_print_status_t are used to - * encode the number of characters that has actually been printed, bits 28 to 31 - * encode the status. When COAP_PRINT_STATUS_ERROR is set, an error occurred - * during output. In this case, the other bits are undefined. - * COAP_PRINT_STATUS_TRUNC indicates that the output is truncated, i.e. the - * printing would have exceeded the current buffer. - */ -typedef unsigned int coap_print_status_t; - -#define COAP_PRINT_STATUS_MASK 0xF0000000u -#define COAP_PRINT_OUTPUT_LENGTH(v) ((v) & ~COAP_PRINT_STATUS_MASK) -#define COAP_PRINT_STATUS_ERROR 0x80000000u -#define COAP_PRINT_STATUS_TRUNC 0x40000000u - -/** - * Writes a description of this resource in link-format to given text buffer. @p - * len must be initialized to the maximum length of @p buf and will be set to - * the number of characters actually written if successful. This function - * returns @c 1 on success or @c 0 on error. - * - * @param resource The resource to describe. - * @param buf The output buffer to write the description to. - * @param len Must be initialized to the length of @p buf and - * will be set to the length of the printed link description. - * @param offset The offset within the resource description where to - * start writing into @p buf. This is useful for dealing - * with the Block2 option. @p offset is updated during - * output as it is consumed. - * - * @return If COAP_PRINT_STATUS_ERROR is set, an error occured. Otherwise, - * the lower 28 bits will indicate the number of characters that - * have actually been output into @p buffer. The flag - * COAP_PRINT_STATUS_TRUNC indicates that the output has been - * truncated. - */ -coap_print_status_t coap_print_link(const coap_resource_t *resource, - unsigned char *buf, - size_t *len, - size_t *offset); - -/** - * Registers the specified @p handler as message handler for the request type @p - * method - * - * @param resource The resource for which the handler shall be registered. - * @param method The CoAP request method to handle. - * @param handler The handler to register with @p resource. - */ -static inline void -coap_register_handler(coap_resource_t *resource, - unsigned char method, - coap_method_handler_t handler) { - assert(resource); - assert(method > 0 && (size_t)(method-1) < sizeof(resource->handler)/sizeof(coap_method_handler_t)); - resource->handler[method-1] = handler; -} - -/** - * Returns the resource identified by the unique string @p key. If no resource - * was found, this function returns @c NULL. - * - * @param context The context to look for this resource. - * @param key The unique key of the resource. - * - * @return A pointer to the resource or @c NULL if not found. - */ -coap_resource_t *coap_get_resource_from_key(coap_context_t *context, - coap_key_t key); - -/** - * Calculates the hash key for the resource requested by the Uri-Options of @p - * request. This function calls coap_hash() for every path segment. - * - * @param request The requesting pdu. - * @param key The resulting hash is stored in @p key. - */ -void coap_hash_request_uri(const coap_pdu_t *request, coap_key_t key); - -/** - * @addtogroup observe - */ - -/** - * Adds the specified peer as observer for @p resource. The subscription is - * identified by the given @p token. This function returns the registered - * subscription information if the @p observer has been added, or @c NULL on - * error. - * - * @param resource The observed resource. - * @param local_interface The local network interface where the observer is - * attached to. - * @param observer The remote peer that wants to received status updates. - * @param token The token that identifies this subscription. - * @return A pointer to the added/updated subscription - * information or @c NULL on error. - */ -coap_subscription_t *coap_add_observer(coap_resource_t *resource, - const coap_endpoint_t *local_interface, - const coap_address_t *observer, - const str *token); - -/** - * Returns a subscription object for given @p peer. - * - * @param resource The observed resource. - * @param peer The address to search for. - * @param token The token that identifies this subscription or @c NULL for - * any token. - * @return A valid subscription if exists or @c NULL otherwise. - */ -coap_subscription_t *coap_find_observer(coap_resource_t *resource, - const coap_address_t *peer, - const str *token); - -/** - * Marks an observer as alive. - * - * @param context The CoAP context to use. - * @param observer The transport address of the observer. - * @param token The corresponding token that has been used for the - * subscription. - */ -void coap_touch_observer(coap_context_t *context, - const coap_address_t *observer, - const str *token); - -/** - * Removes any subscription for @p observer from @p resource and releases the - * allocated storage. The result is @c 1 if an observation relationship with @p - * observer and @p token existed, @c 0 otherwise. - * - * @param resource The observed resource. - * @param observer The observer's address. - * @param token The token that identifies this subscription or @c NULL for - * any token. - * @return @c 1 if the observer has been deleted, @c 0 otherwise. - */ -int coap_delete_observer(coap_resource_t *resource, - const coap_address_t *observer, - const str *token); - -/** - * Checks for all known resources, if they are dirty and notifies subscribed - * observers. - */ -void coap_check_notify(coap_context_t *context); - -#ifdef COAP_RESOURCES_NOHASH - -#define RESOURCES_ADD(r, obj) \ - LL_PREPEND((r), (obj)) - -#define RESOURCES_DELETE(r, obj) \ - LL_DELETE((r), (obj)) - -#define RESOURCES_ITER(r,tmp) \ - coap_resource_t *tmp; \ - LL_FOREACH((r), tmp) - -#define RESOURCES_FIND(r, k, res) { \ - coap_resource_t *tmp; \ - (res) = tmp = NULL; \ - LL_FOREACH((r), tmp) { \ - if (memcmp((k), tmp->key, sizeof(coap_key_t)) == 0) { \ - (res) = tmp; \ - break; \ - } \ - } \ - } -#else /* COAP_RESOURCES_NOHASH */ - -#define RESOURCES_ADD(r, obj) \ - HASH_ADD(hh, (r), key, sizeof(coap_key_t), (obj)) - -#define RESOURCES_DELETE(r, obj) \ - HASH_DELETE(hh, (r), (obj)) - -#define RESOURCES_ITER(r,tmp) \ - coap_resource_t *tmp, *rtmp; \ - HASH_ITER(hh, (r), tmp, rtmp) - -#define RESOURCES_FIND(r, k, res) { \ - HASH_FIND(hh, (r), (k), sizeof(coap_key_t), (res)); \ - } - -#endif /* COAP_RESOURCES_NOHASH */ - -/** @} */ - -coap_print_status_t coap_print_wellknown(coap_context_t *, - unsigned char *, - size_t *, size_t, - coap_opt_t *); - -void coap_handle_failed_notify(coap_context_t *, - const coap_address_t *, - const str *); - -#endif /* _COAP_RESOURCE_H_ */ diff --git a/tools/sdk/include/coap/str.h b/tools/sdk/include/coap/str.h deleted file mode 100644 index 3dfa6731550..00000000000 --- a/tools/sdk/include/coap/str.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * str.h -- strings to be used in the CoAP library - * - * Copyright (C) 2010-2011 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -#ifndef _COAP_STR_H_ -#define _COAP_STR_H_ - -#include - -typedef struct { - size_t length; /* length of string */ - unsigned char *s; /* string data */ -} str; - -#define COAP_SET_STR(st,l,v) { (st)->length = (l), (st)->s = (v); } - -/** - * Returns a new string object with at least size bytes storage allocated. The - * string must be released using coap_delete_string(); - */ -str *coap_new_string(size_t size); - -/** - * Deletes the given string and releases any memory allocated. - */ -void coap_delete_string(str *); - -#endif /* _COAP_STR_H_ */ diff --git a/tools/sdk/include/coap/subscribe.h b/tools/sdk/include/coap/subscribe.h deleted file mode 100644 index 52068642dd7..00000000000 --- a/tools/sdk/include/coap/subscribe.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * subscribe.h -- subscription handling for CoAP - * see draft-ietf-core-observe-16 - * - * Copyright (C) 2010-2012,2014-2015 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - - -#ifndef _COAP_SUBSCRIBE_H_ -#define _COAP_SUBSCRIBE_H_ - -#include "address.h" -#include "coap_io.h" - -/** - * @defgroup observe Resource observation - * @{ - */ - -/** - * The value COAP_OBSERVE_ESTABLISH in a GET request indicates a new observe - * relationship for (sender address, token) is requested. - */ -#define COAP_OBSERVE_ESTABLISH 0 - -/** - * The value COAP_OBSERVE_CANCEL in a GET request indicates that the observe - * relationship for (sender address, token) must be cancelled. - */ -#define COAP_OBSERVE_CANCEL 1 - -#ifndef COAP_OBS_MAX_NON -/** - * Number of notifications that may be sent non-confirmable before a confirmable - * message is sent to detect if observers are alive. The maximum allowed value - * here is @c 15. - */ -#define COAP_OBS_MAX_NON 5 -#endif /* COAP_OBS_MAX_NON */ - -#ifndef COAP_OBS_MAX_FAIL -/** - * Number of confirmable notifications that may fail (i.e. time out without - * being ACKed) before an observer is removed. The maximum value for - * COAP_OBS_MAX_FAIL is @c 3. - */ -#define COAP_OBS_MAX_FAIL 3 -#endif /* COAP_OBS_MAX_FAIL */ - -/** Subscriber information */ -typedef struct coap_subscription_t { - struct coap_subscription_t *next; /**< next element in linked list */ - coap_endpoint_t local_if; /**< local communication interface */ - coap_address_t subscriber; /**< address and port of subscriber */ - - unsigned int non_cnt:4; /**< up to 15 non-confirmable notifies allowed */ - unsigned int fail_cnt:2; /**< up to 3 confirmable notifies can fail */ - unsigned int dirty:1; /**< set if the notification temporarily could not be - * sent (in that case, the resource's partially - * dirty flag is set too) */ - size_t token_length; /**< actual length of token */ - unsigned char token[8]; /**< token used for subscription */ -} coap_subscription_t; - -void coap_subscription_init(coap_subscription_t *); - -/** @} */ - -#endif /* _COAP_SUBSCRIBE_H_ */ diff --git a/tools/sdk/include/coap/uri.h b/tools/sdk/include/coap/uri.h deleted file mode 100644 index 2340a7a6c88..00000000000 --- a/tools/sdk/include/coap/uri.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * uri.h -- helper functions for URI treatment - * - * Copyright (C) 2010-2011,2016 Olaf Bergmann - * - * This file is part of the CoAP library libcoap. Please see README for terms - * of use. - */ - -#ifndef _COAP_URI_H_ -#define _COAP_URI_H_ - -#include "hashkey.h" -#include "str.h" - -/** - * Representation of parsed URI. Components may be filled from a string with - * coap_split_uri() and can be used as input for option-creation functions. - */ -typedef struct { - str host; /**< host part of the URI */ - unsigned short port; /**< The port in host byte order */ - str path; /**< Beginning of the first path segment. - Use coap_split_path() to create Uri-Path options */ - str query; /**< The query part if present */ -} coap_uri_t; - -/** - * Creates a new coap_uri_t object from the specified URI. Returns the new - * object or NULL on error. The memory allocated by the new coap_uri_t - * must be released using coap_free(). - * - * @param uri The URI path to copy. - * @param length The length of uri. - * - * @return New URI object or NULL on error. - */ -coap_uri_t *coap_new_uri(const unsigned char *uri, unsigned int length); - -/** - * Clones the specified coap_uri_t object. Thie function allocates sufficient - * memory to hold the coap_uri_t structure and its contents. The object must - * be released with coap_free(). */ -coap_uri_t *coap_clone_uri(const coap_uri_t *uri); - -/** - * Calculates a hash over the given path and stores the result in - * @p key. This function returns @c 0 on error or @c 1 on success. - * - * @param path The URI path to generate hash for. - * @param len The length of @p path. - * @param key The output buffer. - * - * @return @c 1 if @p key was set, @c 0 otherwise. - */ -int coap_hash_path(const unsigned char *path, size_t len, coap_key_t key); - -/** - * @defgroup uri_parse URI Parsing Functions - * - * CoAP PDUs contain normalized URIs with their path and query split into - * multiple segments. The functions in this module help splitting strings. - * @{ - */ - -/** - * Parses a given string into URI components. The identified syntactic - * components are stored in the result parameter @p uri. Optional URI - * components that are not specified will be set to { 0, 0 }, except for the - * port which is set to @c COAP_DEFAULT_PORT. This function returns @p 0 if - * parsing succeeded, a value less than zero otherwise. - * - * @param str_var The string to split up. - * @param len The actual length of @p str_var - * @param uri The coap_uri_t object to store the result. - * @return @c 0 on success, or < 0 on error. - * - */ -int coap_split_uri(const unsigned char *str_var, size_t len, coap_uri_t *uri); - -/** - * Splits the given URI path into segments. Each segment is preceded - * by an option pseudo-header with delta-value 0 and the actual length - * of the respective segment after percent-decoding. - * - * @param s The path string to split. - * @param length The actual length of @p s. - * @param buf Result buffer for parsed segments. - * @param buflen Maximum length of @p buf. Will be set to the actual number - * of bytes written into buf on success. - * - * @return The number of segments created or @c -1 on error. - */ -int coap_split_path(const unsigned char *s, - size_t length, - unsigned char *buf, - size_t *buflen); - -/** - * Splits the given URI query into segments. Each segment is preceded - * by an option pseudo-header with delta-value 0 and the actual length - * of the respective query term. - * - * @param s The query string to split. - * @param length The actual length of @p s. - * @param buf Result buffer for parsed segments. - * @param buflen Maximum length of @p buf. Will be set to the actual number - * of bytes written into buf on success. - * - * @return The number of segments created or @c -1 on error. - * - * @bug This function does not reserve additional space for delta > 12. - */ -int coap_split_query(const unsigned char *s, - size_t length, - unsigned char *buf, - size_t *buflen); - -/** @} */ - -#endif /* _COAP_URI_H_ */ diff --git a/tools/sdk/include/coap/uthash.h b/tools/sdk/include/coap/uthash.h deleted file mode 100644 index 32b7a81cfbb..00000000000 --- a/tools/sdk/include/coap/uthash.h +++ /dev/null @@ -1,963 +0,0 @@ -/* -Copyright (c) 2003-2014, Troy D. Hanson http://troydhanson.github.com/uthash/ -All rights reserved. - -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. - -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 UTHASH_H -#define UTHASH_H - -#include /* memcmp,strlen */ -#include /* ptrdiff_t */ -#include /* exit() */ - -/* These macros use decltype or the earlier __typeof GNU extension. - As decltype is only available in newer compilers (VS2010 or gcc 4.3+ - when compiling c++ source) this code uses whatever method is needed - or, for VS2008 where neither is available, uses casting workarounds. */ -#if defined(_MSC_VER) /* MS compiler */ -#if _MSC_VER >= 1600 && defined(__cplusplus) /* VS2010 or newer in C++ mode */ -#define DECLTYPE(x) (decltype(x)) -#else /* VS2008 or older (or VS2010 in C mode) */ -#define NO_DECLTYPE -#define DECLTYPE(x) -#endif -#elif defined(__BORLANDC__) || defined(__LCC__) || defined(__WATCOMC__) -#define NO_DECLTYPE -#define DECLTYPE(x) -#else /* GNU, Sun and other compilers */ -#define DECLTYPE(x) (__typeof(x)) -#endif - -#ifdef NO_DECLTYPE -#define DECLTYPE_ASSIGN(dst,src) \ -do { \ - char **_da_dst = (char**)(&(dst)); \ - *_da_dst = (char*)(src); \ -} while(0) -#else -#define DECLTYPE_ASSIGN(dst,src) \ -do { \ - (dst) = DECLTYPE(dst)(src); \ -} while(0) -#endif - -/* a number of the hash function use uint32_t which isn't defined on Pre VS2010 */ -#if defined (_WIN32) -#if defined(_MSC_VER) && _MSC_VER >= 1600 -#include -#elif defined(__WATCOMC__) -#include -#else -typedef unsigned int uint32_t; -typedef unsigned char uint8_t; -#endif -#else -#include -#endif - -#define UTHASH_VERSION 1.9.9 - -#ifndef uthash_fatal -#define uthash_fatal(msg) exit(-1) /* fatal error (out of memory,etc) */ -#endif -#ifndef uthash_malloc -#define uthash_malloc(sz) malloc(sz) /* malloc fcn */ -#endif -#ifndef uthash_free -#define uthash_free(ptr,sz) free(ptr) /* free fcn */ -#endif - -#ifndef uthash_noexpand_fyi -#define uthash_noexpand_fyi(tbl) /* can be defined to log noexpand */ -#endif -#ifndef uthash_expand_fyi -#define uthash_expand_fyi(tbl) /* can be defined to log expands */ -#endif - -/* initial number of buckets */ -#define HASH_INITIAL_NUM_BUCKETS 32 /* initial number of buckets */ -#define HASH_INITIAL_NUM_BUCKETS_LOG2 5 /* lg2 of initial number of buckets */ -#define HASH_BKT_CAPACITY_THRESH 10 /* expand when bucket count reaches */ - -/* calculate the element whose hash handle address is hhe */ -#define ELMT_FROM_HH(tbl,hhp) ((void*)(((char*)(hhp)) - ((tbl)->hho))) - -#define HASH_FIND(hh,head,keyptr,keylen,out) \ -do { \ - out=NULL; \ - if (head) { \ - unsigned _hf_bkt,_hf_hashv; \ - HASH_FCN(keyptr,keylen, (head)->hh.tbl->num_buckets, _hf_hashv, _hf_bkt); \ - if (HASH_BLOOM_TEST((head)->hh.tbl, _hf_hashv)) { \ - HASH_FIND_IN_BKT((head)->hh.tbl, hh, (head)->hh.tbl->buckets[ _hf_bkt ], \ - keyptr,keylen,out); \ - } \ - } \ -} while (0) - -#ifdef HASH_BLOOM -#define HASH_BLOOM_BITLEN (1ULL << HASH_BLOOM) -#define HASH_BLOOM_BYTELEN (HASH_BLOOM_BITLEN/8) + ((HASH_BLOOM_BITLEN%8) ? 1:0) -#define HASH_BLOOM_MAKE(tbl) \ -do { \ - (tbl)->bloom_nbits = HASH_BLOOM; \ - (tbl)->bloom_bv = (uint8_t*)uthash_malloc(HASH_BLOOM_BYTELEN); \ - if (!((tbl)->bloom_bv)) { uthash_fatal( "out of memory"); } \ - memset((tbl)->bloom_bv, 0, HASH_BLOOM_BYTELEN); \ - (tbl)->bloom_sig = HASH_BLOOM_SIGNATURE; \ -} while (0) - -#define HASH_BLOOM_FREE(tbl) \ -do { \ - uthash_free((tbl)->bloom_bv, HASH_BLOOM_BYTELEN); \ -} while (0) - -#define HASH_BLOOM_BITSET(bv,idx) (bv[(idx)/8] |= (1U << ((idx)%8))) -#define HASH_BLOOM_BITTEST(bv,idx) (bv[(idx)/8] & (1U << ((idx)%8))) - -#define HASH_BLOOM_ADD(tbl,hashv) \ - HASH_BLOOM_BITSET((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1))) - -#define HASH_BLOOM_TEST(tbl,hashv) \ - HASH_BLOOM_BITTEST((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1))) - -#else -#define HASH_BLOOM_MAKE(tbl) -#define HASH_BLOOM_FREE(tbl) -#define HASH_BLOOM_ADD(tbl,hashv) -#define HASH_BLOOM_TEST(tbl,hashv) (1) -#define HASH_BLOOM_BYTELEN 0 -#endif - -#define HASH_MAKE_TABLE(hh,head) \ -do { \ - (head)->hh.tbl = (UT_hash_table*)uthash_malloc( \ - sizeof(UT_hash_table)); \ - if (!((head)->hh.tbl)) { uthash_fatal( "out of memory"); } \ - memset((head)->hh.tbl, 0, sizeof(UT_hash_table)); \ - (head)->hh.tbl->tail = &((head)->hh); \ - (head)->hh.tbl->num_buckets = HASH_INITIAL_NUM_BUCKETS; \ - (head)->hh.tbl->log2_num_buckets = HASH_INITIAL_NUM_BUCKETS_LOG2; \ - (head)->hh.tbl->hho = (char*)(&(head)->hh) - (char*)(head); \ - (head)->hh.tbl->buckets = (UT_hash_bucket*)uthash_malloc( \ - HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket)); \ - if (! (head)->hh.tbl->buckets) { uthash_fatal( "out of memory"); } \ - memset((head)->hh.tbl->buckets, 0, \ - HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket)); \ - HASH_BLOOM_MAKE((head)->hh.tbl); \ - (head)->hh.tbl->signature = HASH_SIGNATURE; \ -} while(0) - -#define HASH_ADD(hh,head,fieldname,keylen_in,add) \ - HASH_ADD_KEYPTR(hh,head,&((add)->fieldname),keylen_in,add) - -#define HASH_REPLACE(hh,head,fieldname,keylen_in,add,replaced) \ -do { \ - replaced=NULL; \ - HASH_FIND(hh,head,&((add)->fieldname),keylen_in,replaced); \ - if (replaced!=NULL) { \ - HASH_DELETE(hh,head,replaced); \ - }; \ - HASH_ADD(hh,head,fieldname,keylen_in,add); \ -} while(0) - -#define HASH_ADD_KEYPTR(hh,head,keyptr,keylen_in,add) \ -do { \ - unsigned _ha_bkt; \ - (add)->hh.next = NULL; \ - (add)->hh.key = (char*)(keyptr); \ - (add)->hh.keylen = (unsigned)(keylen_in); \ - if (!(head)) { \ - head = (add); \ - (head)->hh.prev = NULL; \ - HASH_MAKE_TABLE(hh,head); \ - } else { \ - (head)->hh.tbl->tail->next = (add); \ - (add)->hh.prev = ELMT_FROM_HH((head)->hh.tbl, (head)->hh.tbl->tail); \ - (head)->hh.tbl->tail = &((add)->hh); \ - } \ - (head)->hh.tbl->num_items++; \ - (add)->hh.tbl = (head)->hh.tbl; \ - HASH_FCN(keyptr,keylen_in, (head)->hh.tbl->num_buckets, \ - (add)->hh.hashv, _ha_bkt); \ - HASH_ADD_TO_BKT((head)->hh.tbl->buckets[_ha_bkt],&(add)->hh); \ - HASH_BLOOM_ADD((head)->hh.tbl,(add)->hh.hashv); \ - HASH_EMIT_KEY(hh,head,keyptr,keylen_in); \ - HASH_FSCK(hh,head); \ -} while(0) - -#define HASH_TO_BKT( hashv, num_bkts, bkt ) \ -do { \ - bkt = ((hashv) & ((num_bkts) - 1)); \ -} while(0) - -/* delete "delptr" from the hash table. - * "the usual" patch-up process for the app-order doubly-linked-list. - * The use of _hd_hh_del below deserves special explanation. - * These used to be expressed using (delptr) but that led to a bug - * if someone used the same symbol for the head and deletee, like - * HASH_DELETE(hh,users,users); - * We want that to work, but by changing the head (users) below - * we were forfeiting our ability to further refer to the deletee (users) - * in the patch-up process. Solution: use scratch space to - * copy the deletee pointer, then the latter references are via that - * scratch pointer rather than through the repointed (users) symbol. - */ -#define HASH_DELETE(hh,head,delptr) \ -do { \ - struct UT_hash_handle *_hd_hh_del; \ - if ( ((delptr)->hh.prev == NULL) && ((delptr)->hh.next == NULL) ) { \ - uthash_free((head)->hh.tbl->buckets, \ - (head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \ - HASH_BLOOM_FREE((head)->hh.tbl); \ - uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \ - head = NULL; \ - } else { \ - unsigned _hd_bkt; \ - _hd_hh_del = &((delptr)->hh); \ - if ((delptr) == ELMT_FROM_HH((head)->hh.tbl,(head)->hh.tbl->tail)) { \ - (head)->hh.tbl->tail = \ - (UT_hash_handle*)((ptrdiff_t)((delptr)->hh.prev) + \ - (head)->hh.tbl->hho); \ - } \ - if ((delptr)->hh.prev) { \ - ((UT_hash_handle*)((ptrdiff_t)((delptr)->hh.prev) + \ - (head)->hh.tbl->hho))->next = (delptr)->hh.next; \ - } else { \ - DECLTYPE_ASSIGN(head,(delptr)->hh.next); \ - } \ - if (_hd_hh_del->next) { \ - ((UT_hash_handle*)((ptrdiff_t)_hd_hh_del->next + \ - (head)->hh.tbl->hho))->prev = \ - _hd_hh_del->prev; \ - } \ - HASH_TO_BKT( _hd_hh_del->hashv, (head)->hh.tbl->num_buckets, _hd_bkt); \ - HASH_DEL_IN_BKT(hh,(head)->hh.tbl->buckets[_hd_bkt], _hd_hh_del); \ - (head)->hh.tbl->num_items--; \ - } \ - HASH_FSCK(hh,head); \ -} while (0) - - -/* convenience forms of HASH_FIND/HASH_ADD/HASH_DEL */ -#define HASH_FIND_STR(head,findstr,out) \ - HASH_FIND(hh,head,findstr,(unsigned)strlen(findstr),out) -#define HASH_ADD_STR(head,strfield,add) \ - HASH_ADD(hh,head,strfield[0],strlen(add->strfield),add) -#define HASH_REPLACE_STR(head,strfield,add,replaced) \ - HASH_REPLACE(hh,head,strfield[0],(unsigned)strlen(add->strfield),add,replaced) -#define HASH_FIND_INT(head,findint,out) \ - HASH_FIND(hh,head,findint,sizeof(int),out) -#define HASH_ADD_INT(head,intfield,add) \ - HASH_ADD(hh,head,intfield,sizeof(int),add) -#define HASH_REPLACE_INT(head,intfield,add,replaced) \ - HASH_REPLACE(hh,head,intfield,sizeof(int),add,replaced) -#define HASH_FIND_PTR(head,findptr,out) \ - HASH_FIND(hh,head,findptr,sizeof(void *),out) -#define HASH_ADD_PTR(head,ptrfield,add) \ - HASH_ADD(hh,head,ptrfield,sizeof(void *),add) -#define HASH_REPLACE_PTR(head,ptrfield,add,replaced) \ - HASH_REPLACE(hh,head,ptrfield,sizeof(void *),add,replaced) -#define HASH_DEL(head,delptr) \ - HASH_DELETE(hh,head,delptr) - -/* HASH_FSCK checks hash integrity on every add/delete when HASH_DEBUG is defined. - * This is for uthash developer only; it compiles away if HASH_DEBUG isn't defined. - */ -#ifdef HASH_DEBUG -#define HASH_OOPS(...) do { fprintf(stderr,__VA_ARGS__); exit(-1); } while (0) -#define HASH_FSCK(hh,head) \ -do { \ - struct UT_hash_handle *_thh; \ - if (head) { \ - unsigned _bkt_i; \ - unsigned _count; \ - char *_prev; \ - _count = 0; \ - for( _bkt_i = 0; _bkt_i < (head)->hh.tbl->num_buckets; _bkt_i++) { \ - unsigned _bkt_count = 0; \ - _thh = (head)->hh.tbl->buckets[_bkt_i].hh_head; \ - _prev = NULL; \ - while (_thh) { \ - if (_prev != (char*)(_thh->hh_prev)) { \ - HASH_OOPS("invalid hh_prev %p, actual %p\n", \ - _thh->hh_prev, _prev ); \ - } \ - _bkt_count++; \ - _prev = (char*)(_thh); \ - _thh = _thh->hh_next; \ - } \ - _count += _bkt_count; \ - if ((head)->hh.tbl->buckets[_bkt_i].count != _bkt_count) { \ - HASH_OOPS("invalid bucket count %u, actual %u\n", \ - (head)->hh.tbl->buckets[_bkt_i].count, _bkt_count); \ - } \ - } \ - if (_count != (head)->hh.tbl->num_items) { \ - HASH_OOPS("invalid hh item count %u, actual %u\n", \ - (head)->hh.tbl->num_items, _count ); \ - } \ - /* traverse hh in app order; check next/prev integrity, count */ \ - _count = 0; \ - _prev = NULL; \ - _thh = &(head)->hh; \ - while (_thh) { \ - _count++; \ - if (_prev !=(char*)(_thh->prev)) { \ - HASH_OOPS("invalid prev %p, actual %p\n", \ - _thh->prev, _prev ); \ - } \ - _prev = (char*)ELMT_FROM_HH((head)->hh.tbl, _thh); \ - _thh = ( _thh->next ? (UT_hash_handle*)((char*)(_thh->next) + \ - (head)->hh.tbl->hho) : NULL ); \ - } \ - if (_count != (head)->hh.tbl->num_items) { \ - HASH_OOPS("invalid app item count %u, actual %u\n", \ - (head)->hh.tbl->num_items, _count ); \ - } \ - } \ -} while (0) -#else -#define HASH_FSCK(hh,head) -#endif - -/* When compiled with -DHASH_EMIT_KEYS, length-prefixed keys are emitted to - * the descriptor to which this macro is defined for tuning the hash function. - * The app can #include to get the prototype for write(2). */ -#ifdef HASH_EMIT_KEYS -#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen) \ -do { \ - unsigned _klen = fieldlen; \ - write(HASH_EMIT_KEYS, &_klen, sizeof(_klen)); \ - write(HASH_EMIT_KEYS, keyptr, fieldlen); \ -} while (0) -#else -#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen) -#endif - -/* default to Jenkin's hash unless overridden e.g. DHASH_FUNCTION=HASH_SAX */ -#ifdef HASH_FUNCTION -#define HASH_FCN HASH_FUNCTION -#else -#define HASH_FCN HASH_JEN -#endif - -/* The Bernstein hash function, used in Perl prior to v5.6. Note (x<<5+x)=x*33. */ -#define HASH_BER(key,keylen,num_bkts,hashv,bkt) \ -do { \ - unsigned _hb_keylen=keylen; \ - char *_hb_key=(char*)(key); \ - (hashv) = 0; \ - while (_hb_keylen--) { (hashv) = (((hashv) << 5) + (hashv)) + *_hb_key++; } \ - bkt = (hashv) & (num_bkts-1); \ -} while (0) - - -/* SAX/FNV/OAT/JEN hash functions are macro variants of those listed at - * http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx */ -#define HASH_SAX(key,keylen,num_bkts,hashv,bkt) \ -do { \ - unsigned _sx_i; \ - char *_hs_key=(char*)(key); \ - hashv = 0; \ - for(_sx_i=0; _sx_i < keylen; _sx_i++) \ - hashv ^= (hashv << 5) + (hashv >> 2) + _hs_key[_sx_i]; \ - bkt = hashv & (num_bkts-1); \ -} while (0) -/* FNV-1a variation */ -#define HASH_FNV(key,keylen,num_bkts,hashv,bkt) \ -do { \ - unsigned _fn_i; \ - char *_hf_key=(char*)(key); \ - hashv = 2166136261UL; \ - for(_fn_i=0; _fn_i < keylen; _fn_i++) { \ - hashv = hashv ^ _hf_key[_fn_i]; \ - hashv = hashv * 16777619; \ - } \ - bkt = hashv & (num_bkts-1); \ -} while(0) - -#define HASH_OAT(key,keylen,num_bkts,hashv,bkt) \ -do { \ - unsigned _ho_i; \ - char *_ho_key=(char*)(key); \ - hashv = 0; \ - for(_ho_i=0; _ho_i < keylen; _ho_i++) { \ - hashv += _ho_key[_ho_i]; \ - hashv += (hashv << 10); \ - hashv ^= (hashv >> 6); \ - } \ - hashv += (hashv << 3); \ - hashv ^= (hashv >> 11); \ - hashv += (hashv << 15); \ - bkt = hashv & (num_bkts-1); \ -} while(0) - -#define HASH_JEN_MIX(a,b,c) \ -do { \ - a -= b; a -= c; a ^= ( c >> 13 ); \ - b -= c; b -= a; b ^= ( a << 8 ); \ - c -= a; c -= b; c ^= ( b >> 13 ); \ - a -= b; a -= c; a ^= ( c >> 12 ); \ - b -= c; b -= a; b ^= ( a << 16 ); \ - c -= a; c -= b; c ^= ( b >> 5 ); \ - a -= b; a -= c; a ^= ( c >> 3 ); \ - b -= c; b -= a; b ^= ( a << 10 ); \ - c -= a; c -= b; c ^= ( b >> 15 ); \ -} while (0) - -#define HASH_JEN(key,keylen,num_bkts,hashv,bkt) \ -do { \ - unsigned _hj_i,_hj_j,_hj_k; \ - unsigned char *_hj_key=(unsigned char*)(key); \ - hashv = 0xfeedbeef; \ - _hj_i = _hj_j = 0x9e3779b9; \ - _hj_k = (unsigned)(keylen); \ - while (_hj_k >= 12) { \ - _hj_i += (_hj_key[0] + ( (unsigned)_hj_key[1] << 8 ) \ - + ( (unsigned)_hj_key[2] << 16 ) \ - + ( (unsigned)_hj_key[3] << 24 ) ); \ - _hj_j += (_hj_key[4] + ( (unsigned)_hj_key[5] << 8 ) \ - + ( (unsigned)_hj_key[6] << 16 ) \ - + ( (unsigned)_hj_key[7] << 24 ) ); \ - hashv += (_hj_key[8] + ( (unsigned)_hj_key[9] << 8 ) \ - + ( (unsigned)_hj_key[10] << 16 ) \ - + ( (unsigned)_hj_key[11] << 24 ) ); \ - \ - HASH_JEN_MIX(_hj_i, _hj_j, hashv); \ - \ - _hj_key += 12; \ - _hj_k -= 12; \ - } \ - hashv += keylen; \ - switch ( _hj_k ) { \ - case 11: hashv += ( (unsigned)_hj_key[10] << 24 ); \ - case 10: hashv += ( (unsigned)_hj_key[9] << 16 ); \ - case 9: hashv += ( (unsigned)_hj_key[8] << 8 ); \ - case 8: _hj_j += ( (unsigned)_hj_key[7] << 24 ); \ - case 7: _hj_j += ( (unsigned)_hj_key[6] << 16 ); \ - case 6: _hj_j += ( (unsigned)_hj_key[5] << 8 ); \ - case 5: _hj_j += _hj_key[4]; \ - case 4: _hj_i += ( (unsigned)_hj_key[3] << 24 ); \ - case 3: _hj_i += ( (unsigned)_hj_key[2] << 16 ); \ - case 2: _hj_i += ( (unsigned)_hj_key[1] << 8 ); \ - case 1: _hj_i += _hj_key[0]; \ - /* case 0: nothing left to add */ \ - default: /* make gcc -Wswitch-default happy */ \ - ; \ - } \ - HASH_JEN_MIX(_hj_i, _hj_j, hashv); \ - bkt = hashv & (num_bkts-1); \ -} while(0) - -/* The Paul Hsieh hash function */ -#undef get16bits -#if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \ - || defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__) -#define get16bits(d) (*((const uint16_t *) (d))) -#endif - -#if !defined (get16bits) -#define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8) \ - +(uint32_t)(((const uint8_t *)(d))[0]) ) -#endif -#define HASH_SFH(key,keylen,num_bkts,hashv,bkt) \ -do { \ - unsigned char *_sfh_key=(unsigned char*)(key); \ - uint32_t _sfh_tmp, _sfh_len = keylen; \ - \ - int _sfh_rem = _sfh_len & 3; \ - _sfh_len >>= 2; \ - hashv = 0xcafebabe; \ - \ - /* Main loop */ \ - for (;_sfh_len > 0; _sfh_len--) { \ - hashv += get16bits (_sfh_key); \ - _sfh_tmp = (uint32_t)(get16bits (_sfh_key+2)) << 11 ^ hashv; \ - hashv = (hashv << 16) ^ _sfh_tmp; \ - _sfh_key += 2*sizeof (uint16_t); \ - hashv += hashv >> 11; \ - } \ - \ - /* Handle end cases */ \ - switch (_sfh_rem) { \ - case 3: hashv += get16bits (_sfh_key); \ - hashv ^= hashv << 16; \ - hashv ^= (uint32_t)(_sfh_key[sizeof (uint16_t)] << 18); \ - hashv += hashv >> 11; \ - break; \ - case 2: hashv += get16bits (_sfh_key); \ - hashv ^= hashv << 11; \ - hashv += hashv >> 17; \ - break; \ - case 1: hashv += *_sfh_key; \ - hashv ^= hashv << 10; \ - hashv += hashv >> 1; \ - } \ - \ - /* Force "avalanching" of final 127 bits */ \ - hashv ^= hashv << 3; \ - hashv += hashv >> 5; \ - hashv ^= hashv << 4; \ - hashv += hashv >> 17; \ - hashv ^= hashv << 25; \ - hashv += hashv >> 6; \ - bkt = hashv & (num_bkts-1); \ -} while(0) - -#ifdef HASH_USING_NO_STRICT_ALIASING -/* The MurmurHash exploits some CPU's (x86,x86_64) tolerance for unaligned reads. - * For other types of CPU's (e.g. Sparc) an unaligned read causes a bus error. - * MurmurHash uses the faster approach only on CPU's where we know it's safe. - * - * Note the preprocessor built-in defines can be emitted using: - * - * gcc -m64 -dM -E - < /dev/null (on gcc) - * cc -## a.c (where a.c is a simple test file) (Sun Studio) - */ -#if (defined(__i386__) || defined(__x86_64__) || defined(_M_IX86)) -#define MUR_GETBLOCK(p,i) p[i] -#else /* non intel */ -#define MUR_PLUS0_ALIGNED(p) (((unsigned long)p & 0x3) == 0) -#define MUR_PLUS1_ALIGNED(p) (((unsigned long)p & 0x3) == 1) -#define MUR_PLUS2_ALIGNED(p) (((unsigned long)p & 0x3) == 2) -#define MUR_PLUS3_ALIGNED(p) (((unsigned long)p & 0x3) == 3) -#define WP(p) ((uint32_t*)((unsigned long)(p) & ~3UL)) -#if (defined(__BIG_ENDIAN__) || defined(SPARC) || defined(__ppc__) || defined(__ppc64__)) -#define MUR_THREE_ONE(p) ((((*WP(p))&0x00ffffff) << 8) | (((*(WP(p)+1))&0xff000000) >> 24)) -#define MUR_TWO_TWO(p) ((((*WP(p))&0x0000ffff) <<16) | (((*(WP(p)+1))&0xffff0000) >> 16)) -#define MUR_ONE_THREE(p) ((((*WP(p))&0x000000ff) <<24) | (((*(WP(p)+1))&0xffffff00) >> 8)) -#else /* assume little endian non-intel */ -#define MUR_THREE_ONE(p) ((((*WP(p))&0xffffff00) >> 8) | (((*(WP(p)+1))&0x000000ff) << 24)) -#define MUR_TWO_TWO(p) ((((*WP(p))&0xffff0000) >>16) | (((*(WP(p)+1))&0x0000ffff) << 16)) -#define MUR_ONE_THREE(p) ((((*WP(p))&0xff000000) >>24) | (((*(WP(p)+1))&0x00ffffff) << 8)) -#endif -#define MUR_GETBLOCK(p,i) (MUR_PLUS0_ALIGNED(p) ? ((p)[i]) : \ - (MUR_PLUS1_ALIGNED(p) ? MUR_THREE_ONE(p) : \ - (MUR_PLUS2_ALIGNED(p) ? MUR_TWO_TWO(p) : \ - MUR_ONE_THREE(p)))) -#endif -#define MUR_ROTL32(x,r) (((x) << (r)) | ((x) >> (32 - (r)))) -#define MUR_FMIX(_h) \ -do { \ - _h ^= _h >> 16; \ - _h *= 0x85ebca6b; \ - _h ^= _h >> 13; \ - _h *= 0xc2b2ae35l; \ - _h ^= _h >> 16; \ -} while(0) - -#define HASH_MUR(key,keylen,num_bkts,hashv,bkt) \ -do { \ - const uint8_t *_mur_data = (const uint8_t*)(key); \ - const int _mur_nblocks = (keylen) / 4; \ - uint32_t _mur_h1 = 0xf88D5353; \ - uint32_t _mur_c1 = 0xcc9e2d51; \ - uint32_t _mur_c2 = 0x1b873593; \ - uint32_t _mur_k1 = 0; \ - const uint8_t *_mur_tail; \ - const uint32_t *_mur_blocks = (const uint32_t*)(_mur_data+_mur_nblocks*4); \ - int _mur_i; \ - for(_mur_i = -_mur_nblocks; _mur_i; _mur_i++) { \ - _mur_k1 = MUR_GETBLOCK(_mur_blocks,_mur_i); \ - _mur_k1 *= _mur_c1; \ - _mur_k1 = MUR_ROTL32(_mur_k1,15); \ - _mur_k1 *= _mur_c2; \ - \ - _mur_h1 ^= _mur_k1; \ - _mur_h1 = MUR_ROTL32(_mur_h1,13); \ - _mur_h1 = _mur_h1*5+0xe6546b64; \ - } \ - _mur_tail = (const uint8_t*)(_mur_data + _mur_nblocks*4); \ - _mur_k1=0; \ - switch((keylen) & 3) { \ - case 3: _mur_k1 ^= _mur_tail[2] << 16; \ - case 2: _mur_k1 ^= _mur_tail[1] << 8; \ - case 1: _mur_k1 ^= _mur_tail[0]; \ - _mur_k1 *= _mur_c1; \ - _mur_k1 = MUR_ROTL32(_mur_k1,15); \ - _mur_k1 *= _mur_c2; \ - _mur_h1 ^= _mur_k1; \ - } \ - _mur_h1 ^= (keylen); \ - MUR_FMIX(_mur_h1); \ - hashv = _mur_h1; \ - bkt = hashv & (num_bkts-1); \ -} while(0) -#endif /* HASH_USING_NO_STRICT_ALIASING */ - -/* key comparison function; return 0 if keys equal */ -#define HASH_KEYCMP(a,b,len) memcmp(a,b,len) - -/* iterate over items in a known bucket to find desired item */ -#define HASH_FIND_IN_BKT(tbl,hh,head,keyptr,keylen_in,out) \ -do { \ - if (head.hh_head) DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,head.hh_head)); \ - else out=NULL; \ - while (out) { \ - if ((out)->hh.keylen == keylen_in) { \ - if ((HASH_KEYCMP((out)->hh.key,keyptr,keylen_in)) == 0) break; \ - } \ - if ((out)->hh.hh_next) DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,(out)->hh.hh_next)); \ - else out = NULL; \ - } \ -} while(0) - -/* add an item to a bucket */ -#define HASH_ADD_TO_BKT(head,addhh) \ -do { \ - head.count++; \ - (addhh)->hh_next = head.hh_head; \ - (addhh)->hh_prev = NULL; \ - if (head.hh_head) { (head).hh_head->hh_prev = (addhh); } \ - (head).hh_head=addhh; \ - if (head.count >= ((head.expand_mult+1) * HASH_BKT_CAPACITY_THRESH) \ - && (addhh)->tbl->noexpand != 1) { \ - HASH_EXPAND_BUCKETS((addhh)->tbl); \ - } \ -} while(0) - -/* remove an item from a given bucket */ -#define HASH_DEL_IN_BKT(hh,head,hh_del) \ - (head).count--; \ - if ((head).hh_head == hh_del) { \ - (head).hh_head = hh_del->hh_next; \ - } \ - if (hh_del->hh_prev) { \ - hh_del->hh_prev->hh_next = hh_del->hh_next; \ - } \ - if (hh_del->hh_next) { \ - hh_del->hh_next->hh_prev = hh_del->hh_prev; \ - } - -/* Bucket expansion has the effect of doubling the number of buckets - * and redistributing the items into the new buckets. Ideally the - * items will distribute more or less evenly into the new buckets - * (the extent to which this is true is a measure of the quality of - * the hash function as it applies to the key domain). - * - * With the items distributed into more buckets, the chain length - * (item count) in each bucket is reduced. Thus by expanding buckets - * the hash keeps a bound on the chain length. This bounded chain - * length is the essence of how a hash provides constant time lookup. - * - * The calculation of tbl->ideal_chain_maxlen below deserves some - * explanation. First, keep in mind that we're calculating the ideal - * maximum chain length based on the *new* (doubled) bucket count. - * In fractions this is just n/b (n=number of items,b=new num buckets). - * Since the ideal chain length is an integer, we want to calculate - * ceil(n/b). We don't depend on floating point arithmetic in this - * hash, so to calculate ceil(n/b) with integers we could write - * - * ceil(n/b) = (n/b) + ((n%b)?1:0) - * - * and in fact a previous version of this hash did just that. - * But now we have improved things a bit by recognizing that b is - * always a power of two. We keep its base 2 log handy (call it lb), - * so now we can write this with a bit shift and logical AND: - * - * ceil(n/b) = (n>>lb) + ( (n & (b-1)) ? 1:0) - * - */ -#define HASH_EXPAND_BUCKETS(tbl) \ -do { \ - unsigned _he_bkt; \ - unsigned _he_bkt_i; \ - struct UT_hash_handle *_he_thh, *_he_hh_nxt; \ - UT_hash_bucket *_he_new_buckets, *_he_newbkt; \ - _he_new_buckets = (UT_hash_bucket*)uthash_malloc( \ - 2 * tbl->num_buckets * sizeof(struct UT_hash_bucket)); \ - if (!_he_new_buckets) { uthash_fatal( "out of memory"); } \ - memset(_he_new_buckets, 0, \ - 2 * tbl->num_buckets * sizeof(struct UT_hash_bucket)); \ - tbl->ideal_chain_maxlen = \ - (tbl->num_items >> (tbl->log2_num_buckets+1)) + \ - ((tbl->num_items & ((tbl->num_buckets*2)-1)) ? 1 : 0); \ - tbl->nonideal_items = 0; \ - for(_he_bkt_i = 0; _he_bkt_i < tbl->num_buckets; _he_bkt_i++) \ - { \ - _he_thh = tbl->buckets[ _he_bkt_i ].hh_head; \ - while (_he_thh) { \ - _he_hh_nxt = _he_thh->hh_next; \ - HASH_TO_BKT( _he_thh->hashv, tbl->num_buckets*2, _he_bkt); \ - _he_newbkt = &(_he_new_buckets[ _he_bkt ]); \ - if (++(_he_newbkt->count) > tbl->ideal_chain_maxlen) { \ - tbl->nonideal_items++; \ - _he_newbkt->expand_mult = _he_newbkt->count / \ - tbl->ideal_chain_maxlen; \ - } \ - _he_thh->hh_prev = NULL; \ - _he_thh->hh_next = _he_newbkt->hh_head; \ - if (_he_newbkt->hh_head) _he_newbkt->hh_head->hh_prev = \ - _he_thh; \ - _he_newbkt->hh_head = _he_thh; \ - _he_thh = _he_hh_nxt; \ - } \ - } \ - uthash_free( tbl->buckets, tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \ - tbl->num_buckets *= 2; \ - tbl->log2_num_buckets++; \ - tbl->buckets = _he_new_buckets; \ - tbl->ineff_expands = (tbl->nonideal_items > (tbl->num_items >> 1)) ? \ - (tbl->ineff_expands+1) : 0; \ - if (tbl->ineff_expands > 1) { \ - tbl->noexpand=1; \ - uthash_noexpand_fyi(tbl); \ - } \ - uthash_expand_fyi(tbl); \ -} while(0) - - -/* This is an adaptation of Simon Tatham's O(n log(n)) mergesort */ -/* Note that HASH_SORT assumes the hash handle name to be hh. - * HASH_SRT was added to allow the hash handle name to be passed in. */ -#define HASH_SORT(head,cmpfcn) HASH_SRT(hh,head,cmpfcn) -#define HASH_SRT(hh,head,cmpfcn) \ -do { \ - unsigned _hs_i; \ - unsigned _hs_looping,_hs_nmerges,_hs_insize,_hs_psize,_hs_qsize; \ - struct UT_hash_handle *_hs_p, *_hs_q, *_hs_e, *_hs_list, *_hs_tail; \ - if (head) { \ - _hs_insize = 1; \ - _hs_looping = 1; \ - _hs_list = &((head)->hh); \ - while (_hs_looping) { \ - _hs_p = _hs_list; \ - _hs_list = NULL; \ - _hs_tail = NULL; \ - _hs_nmerges = 0; \ - while (_hs_p) { \ - _hs_nmerges++; \ - _hs_q = _hs_p; \ - _hs_psize = 0; \ - for ( _hs_i = 0; _hs_i < _hs_insize; _hs_i++ ) { \ - _hs_psize++; \ - _hs_q = (UT_hash_handle*)((_hs_q->next) ? \ - ((void*)((char*)(_hs_q->next) + \ - (head)->hh.tbl->hho)) : NULL); \ - if (! (_hs_q) ) break; \ - } \ - _hs_qsize = _hs_insize; \ - while ((_hs_psize > 0) || ((_hs_qsize > 0) && _hs_q )) { \ - if (_hs_psize == 0) { \ - _hs_e = _hs_q; \ - _hs_q = (UT_hash_handle*)((_hs_q->next) ? \ - ((void*)((char*)(_hs_q->next) + \ - (head)->hh.tbl->hho)) : NULL); \ - _hs_qsize--; \ - } else if ( (_hs_qsize == 0) || !(_hs_q) ) { \ - _hs_e = _hs_p; \ - if (_hs_p){ \ - _hs_p = (UT_hash_handle*)((_hs_p->next) ? \ - ((void*)((char*)(_hs_p->next) + \ - (head)->hh.tbl->hho)) : NULL); \ - } \ - _hs_psize--; \ - } else if (( \ - cmpfcn(DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_p)), \ - DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_q))) \ - ) <= 0) { \ - _hs_e = _hs_p; \ - if (_hs_p){ \ - _hs_p = (UT_hash_handle*)((_hs_p->next) ? \ - ((void*)((char*)(_hs_p->next) + \ - (head)->hh.tbl->hho)) : NULL); \ - } \ - _hs_psize--; \ - } else { \ - _hs_e = _hs_q; \ - _hs_q = (UT_hash_handle*)((_hs_q->next) ? \ - ((void*)((char*)(_hs_q->next) + \ - (head)->hh.tbl->hho)) : NULL); \ - _hs_qsize--; \ - } \ - if ( _hs_tail ) { \ - _hs_tail->next = ((_hs_e) ? \ - ELMT_FROM_HH((head)->hh.tbl,_hs_e) : NULL); \ - } else { \ - _hs_list = _hs_e; \ - } \ - if (_hs_e) { \ - _hs_e->prev = ((_hs_tail) ? \ - ELMT_FROM_HH((head)->hh.tbl,_hs_tail) : NULL); \ - } \ - _hs_tail = _hs_e; \ - } \ - _hs_p = _hs_q; \ - } \ - if (_hs_tail){ \ - _hs_tail->next = NULL; \ - } \ - if ( _hs_nmerges <= 1 ) { \ - _hs_looping=0; \ - (head)->hh.tbl->tail = _hs_tail; \ - DECLTYPE_ASSIGN(head,ELMT_FROM_HH((head)->hh.tbl, _hs_list)); \ - } \ - _hs_insize *= 2; \ - } \ - HASH_FSCK(hh,head); \ - } \ -} while (0) - -/* This function selects items from one hash into another hash. - * The end result is that the selected items have dual presence - * in both hashes. There is no copy of the items made; rather - * they are added into the new hash through a secondary hash - * hash handle that must be present in the structure. */ -#define HASH_SELECT(hh_dst, dst, hh_src, src, cond) \ -do { \ - unsigned _src_bkt, _dst_bkt; \ - void *_last_elt=NULL, *_elt; \ - UT_hash_handle *_src_hh, *_dst_hh, *_last_elt_hh=NULL; \ - ptrdiff_t _dst_hho = ((char*)(&(dst)->hh_dst) - (char*)(dst)); \ - if (src) { \ - for(_src_bkt=0; _src_bkt < (src)->hh_src.tbl->num_buckets; _src_bkt++) { \ - for(_src_hh = (src)->hh_src.tbl->buckets[_src_bkt].hh_head; \ - _src_hh; \ - _src_hh = _src_hh->hh_next) { \ - _elt = ELMT_FROM_HH((src)->hh_src.tbl, _src_hh); \ - if (cond(_elt)) { \ - _dst_hh = (UT_hash_handle*)(((char*)_elt) + _dst_hho); \ - _dst_hh->key = _src_hh->key; \ - _dst_hh->keylen = _src_hh->keylen; \ - _dst_hh->hashv = _src_hh->hashv; \ - _dst_hh->prev = _last_elt; \ - _dst_hh->next = NULL; \ - if (_last_elt_hh) { _last_elt_hh->next = _elt; } \ - if (!dst) { \ - DECLTYPE_ASSIGN(dst,_elt); \ - HASH_MAKE_TABLE(hh_dst,dst); \ - } else { \ - _dst_hh->tbl = (dst)->hh_dst.tbl; \ - } \ - HASH_TO_BKT(_dst_hh->hashv, _dst_hh->tbl->num_buckets, _dst_bkt); \ - HASH_ADD_TO_BKT(_dst_hh->tbl->buckets[_dst_bkt],_dst_hh); \ - (dst)->hh_dst.tbl->num_items++; \ - _last_elt = _elt; \ - _last_elt_hh = _dst_hh; \ - } \ - } \ - } \ - } \ - HASH_FSCK(hh_dst,dst); \ -} while (0) - -#define HASH_CLEAR(hh,head) \ -do { \ - if (head) { \ - uthash_free((head)->hh.tbl->buckets, \ - (head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket)); \ - HASH_BLOOM_FREE((head)->hh.tbl); \ - uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \ - (head)=NULL; \ - } \ -} while(0) - -#define HASH_OVERHEAD(hh,head) \ - ((head) ? ( \ - (size_t)((((head)->hh.tbl->num_items * sizeof(UT_hash_handle)) + \ - ((head)->hh.tbl->num_buckets * sizeof(UT_hash_bucket)) + \ - (sizeof(UT_hash_table)) + \ - (HASH_BLOOM_BYTELEN)))) : 0) - -#ifdef NO_DECLTYPE -#define HASH_ITER(hh,head,el,tmp) \ -for((el)=(head), (*(char**)(&(tmp)))=(char*)((head)?(head)->hh.next:NULL); \ - el; (el)=(tmp),(*(char**)(&(tmp)))=(char*)((tmp)?(tmp)->hh.next:NULL)) -#else -#define HASH_ITER(hh,head,el,tmp) \ -for((el)=(head),(tmp)=DECLTYPE(el)((head)?(head)->hh.next:NULL); \ - el; (el)=(tmp),(tmp)=DECLTYPE(el)((tmp)?(tmp)->hh.next:NULL)) -#endif - -/* obtain a count of items in the hash */ -#define HASH_COUNT(head) HASH_CNT(hh,head) -#define HASH_CNT(hh,head) ((head)?((head)->hh.tbl->num_items):0) - -typedef struct UT_hash_bucket { - struct UT_hash_handle *hh_head; - unsigned count; - - /* expand_mult is normally set to 0. In this situation, the max chain length - * threshold is enforced at its default value, HASH_BKT_CAPACITY_THRESH. (If - * the bucket's chain exceeds this length, bucket expansion is triggered). - * However, setting expand_mult to a non-zero value delays bucket expansion - * (that would be triggered by additions to this particular bucket) - * until its chain length reaches a *multiple* of HASH_BKT_CAPACITY_THRESH. - * (The multiplier is simply expand_mult+1). The whole idea of this - * multiplier is to reduce bucket expansions, since they are expensive, in - * situations where we know that a particular bucket tends to be overused. - * It is better to let its chain length grow to a longer yet-still-bounded - * value, than to do an O(n) bucket expansion too often. - */ - unsigned expand_mult; - -} UT_hash_bucket; - -/* random signature used only to find hash tables in external analysis */ -#define HASH_SIGNATURE 0xa0111fe1 -#define HASH_BLOOM_SIGNATURE 0xb12220f2 - -typedef struct UT_hash_table { - UT_hash_bucket *buckets; - unsigned num_buckets, log2_num_buckets; - unsigned num_items; - struct UT_hash_handle *tail; /* tail hh in app order, for fast append */ - ptrdiff_t hho; /* hash handle offset (byte pos of hash handle in element */ - - /* in an ideal situation (all buckets used equally), no bucket would have - * more than ceil(#items/#buckets) items. that's the ideal chain length. */ - unsigned ideal_chain_maxlen; - - /* nonideal_items is the number of items in the hash whose chain position - * exceeds the ideal chain maxlen. these items pay the penalty for an uneven - * hash distribution; reaching them in a chain traversal takes >ideal steps */ - unsigned nonideal_items; - - /* ineffective expands occur when a bucket doubling was performed, but - * afterward, more than half the items in the hash had nonideal chain - * positions. If this happens on two consecutive expansions we inhibit any - * further expansion, as it's not helping; this happens when the hash - * function isn't a good fit for the key domain. When expansion is inhibited - * the hash will still work, albeit no longer in constant time. */ - unsigned ineff_expands, noexpand; - - uint32_t signature; /* used only to find hash tables in external analysis */ -#ifdef HASH_BLOOM - uint32_t bloom_sig; /* used only to test bloom exists in external analysis */ - uint8_t *bloom_bv; - char bloom_nbits; -#endif - -} UT_hash_table; - -typedef struct UT_hash_handle { - struct UT_hash_table *tbl; - void *prev; /* prev element in app order */ - void *next; /* next element in app order */ - struct UT_hash_handle *hh_prev; /* previous hh in bucket order */ - struct UT_hash_handle *hh_next; /* next hh in bucket order */ - void *key; /* ptr to enclosing struct's key */ - unsigned keylen; /* enclosing struct's key len */ - unsigned hashv; /* result of hash-fcn(key) */ -} UT_hash_handle; - -#endif /* UTHASH_H */ diff --git a/tools/sdk/include/coap/utlist.h b/tools/sdk/include/coap/utlist.h deleted file mode 100644 index b5f3f04c104..00000000000 --- a/tools/sdk/include/coap/utlist.h +++ /dev/null @@ -1,757 +0,0 @@ -/* -Copyright (c) 2007-2014, Troy D. Hanson http://troydhanson.github.com/uthash/ -All rights reserved. - -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. - -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 UTLIST_H -#define UTLIST_H - -#define UTLIST_VERSION 1.9.9 - -#include - -/* - * This file contains macros to manipulate singly and doubly-linked lists. - * - * 1. LL_ macros: singly-linked lists. - * 2. DL_ macros: doubly-linked lists. - * 3. CDL_ macros: circular doubly-linked lists. - * - * To use singly-linked lists, your structure must have a "next" pointer. - * To use doubly-linked lists, your structure must "prev" and "next" pointers. - * Either way, the pointer to the head of the list must be initialized to NULL. - * - * ----------------.EXAMPLE ------------------------- - * struct item { - * int id; - * struct item *prev, *next; - * } - * - * struct item *list = NULL: - * - * int main() { - * struct item *item; - * ... allocate and populate item ... - * DL_APPEND(list, item); - * } - * -------------------------------------------------- - * - * For doubly-linked lists, the append and delete macros are O(1) - * For singly-linked lists, append and delete are O(n) but prepend is O(1) - * The sort macro is O(n log(n)) for all types of single/double/circular lists. - */ - -/* These macros use decltype or the earlier __typeof GNU extension. - As decltype is only available in newer compilers (VS2010 or gcc 4.3+ - when compiling c++ code), this code uses whatever method is needed - or, for VS2008 where neither is available, uses casting workarounds. */ -#ifdef _MSC_VER /* MS compiler */ -#if _MSC_VER >= 1600 && defined(__cplusplus) /* VS2010 or newer in C++ mode */ -#define LDECLTYPE(x) decltype(x) -#else /* VS2008 or older (or VS2010 in C mode) */ -#define NO_DECLTYPE -#define LDECLTYPE(x) char* -#endif -#elif defined(__ICCARM__) -#define NO_DECLTYPE -#define LDECLTYPE(x) char* -#else /* GNU, Sun and other compilers */ -#define LDECLTYPE(x) __typeof(x) -#endif - -/* for VS2008 we use some workarounds to get around the lack of decltype, - * namely, we always reassign our tmp variable to the list head if we need - * to dereference its prev/next pointers, and save/restore the real head.*/ -#ifdef NO_DECLTYPE -#define _SV(elt,list) _tmp = (char*)(list); {char **_alias = (char**)&(list); *_alias = (elt); } -#define _NEXT(elt,list,next) ((char*)((list)->next)) -#define _NEXTASGN(elt,list,to,next) { char **_alias = (char**)&((list)->next); *_alias=(char*)(to); } -/* #define _PREV(elt,list,prev) ((char*)((list)->prev)) */ -#define _PREVASGN(elt,list,to,prev) { char **_alias = (char**)&((list)->prev); *_alias=(char*)(to); } -#define _RS(list) { char **_alias = (char**)&(list); *_alias=_tmp; } -#define _CASTASGN(a,b) { char **_alias = (char**)&(a); *_alias=(char*)(b); } -#else -#define _SV(elt,list) -#define _NEXT(elt,list,next) ((elt)->next) -#define _NEXTASGN(elt,list,to,next) ((elt)->next)=(to) -/* #define _PREV(elt,list,prev) ((elt)->prev) */ -#define _PREVASGN(elt,list,to,prev) ((elt)->prev)=(to) -#define _RS(list) -#define _CASTASGN(a,b) (a)=(b) -#endif - -/****************************************************************************** - * The sort macro is an adaptation of Simon Tatham's O(n log(n)) mergesort * - * Unwieldy variable names used here to avoid shadowing passed-in variables. * - *****************************************************************************/ -#define LL_SORT(list, cmp) \ - LL_SORT2(list, cmp, next) - -#define LL_SORT2(list, cmp, next) \ -do { \ - LDECLTYPE(list) _ls_p; \ - LDECLTYPE(list) _ls_q; \ - LDECLTYPE(list) _ls_e; \ - LDECLTYPE(list) _ls_tail; \ - int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping; \ - if (list) { \ - _ls_insize = 1; \ - _ls_looping = 1; \ - while (_ls_looping) { \ - _CASTASGN(_ls_p,list); \ - list = NULL; \ - _ls_tail = NULL; \ - _ls_nmerges = 0; \ - while (_ls_p) { \ - _ls_nmerges++; \ - _ls_q = _ls_p; \ - _ls_psize = 0; \ - for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) { \ - _ls_psize++; \ - _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list,next); _RS(list); \ - if (!_ls_q) break; \ - } \ - _ls_qsize = _ls_insize; \ - while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) { \ - if (_ls_psize == 0) { \ - _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = \ - _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--; \ - } else if (_ls_qsize == 0 || !_ls_q) { \ - _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = \ - _NEXT(_ls_p,list,next); _RS(list); _ls_psize--; \ - } else if (cmp(_ls_p,_ls_q) <= 0) { \ - _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = \ - _NEXT(_ls_p,list,next); _RS(list); _ls_psize--; \ - } else { \ - _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = \ - _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--; \ - } \ - if (_ls_tail) { \ - _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_ls_e,next); _RS(list); \ - } else { \ - _CASTASGN(list,_ls_e); \ - } \ - _ls_tail = _ls_e; \ - } \ - _ls_p = _ls_q; \ - } \ - if (_ls_tail) { \ - _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,NULL,next); _RS(list); \ - } \ - if (_ls_nmerges <= 1) { \ - _ls_looping=0; \ - } \ - _ls_insize *= 2; \ - } \ - } \ -} while (0) - - -#define DL_SORT(list, cmp) \ - DL_SORT2(list, cmp, prev, next) - -#define DL_SORT2(list, cmp, prev, next) \ -do { \ - LDECLTYPE(list) _ls_p; \ - LDECLTYPE(list) _ls_q; \ - LDECLTYPE(list) _ls_e; \ - LDECLTYPE(list) _ls_tail; \ - int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping; \ - if (list) { \ - _ls_insize = 1; \ - _ls_looping = 1; \ - while (_ls_looping) { \ - _CASTASGN(_ls_p,list); \ - list = NULL; \ - _ls_tail = NULL; \ - _ls_nmerges = 0; \ - while (_ls_p) { \ - _ls_nmerges++; \ - _ls_q = _ls_p; \ - _ls_psize = 0; \ - for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) { \ - _ls_psize++; \ - _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list,next); _RS(list); \ - if (!_ls_q) break; \ - } \ - _ls_qsize = _ls_insize; \ - while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) { \ - if (_ls_psize == 0) { \ - _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = \ - _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--; \ - } else if (_ls_qsize == 0 || !_ls_q) { \ - _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = \ - _NEXT(_ls_p,list,next); _RS(list); _ls_psize--; \ - } else if (cmp(_ls_p,_ls_q) <= 0) { \ - _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = \ - _NEXT(_ls_p,list,next); _RS(list); _ls_psize--; \ - } else { \ - _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = \ - _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--; \ - } \ - if (_ls_tail) { \ - _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_ls_e,next); _RS(list); \ - } else { \ - _CASTASGN(list,_ls_e); \ - } \ - _SV(_ls_e,list); _PREVASGN(_ls_e,list,_ls_tail,prev); _RS(list); \ - _ls_tail = _ls_e; \ - } \ - _ls_p = _ls_q; \ - } \ - _CASTASGN(list->prev, _ls_tail); \ - _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,NULL,next); _RS(list); \ - if (_ls_nmerges <= 1) { \ - _ls_looping=0; \ - } \ - _ls_insize *= 2; \ - } \ - } \ -} while (0) - -#define CDL_SORT(list, cmp) \ - CDL_SORT2(list, cmp, prev, next) - -#define CDL_SORT2(list, cmp, prev, next) \ -do { \ - LDECLTYPE(list) _ls_p; \ - LDECLTYPE(list) _ls_q; \ - LDECLTYPE(list) _ls_e; \ - LDECLTYPE(list) _ls_tail; \ - LDECLTYPE(list) _ls_oldhead; \ - LDECLTYPE(list) _tmp; \ - int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping; \ - if (list) { \ - _ls_insize = 1; \ - _ls_looping = 1; \ - while (_ls_looping) { \ - _CASTASGN(_ls_p,list); \ - _CASTASGN(_ls_oldhead,list); \ - list = NULL; \ - _ls_tail = NULL; \ - _ls_nmerges = 0; \ - while (_ls_p) { \ - _ls_nmerges++; \ - _ls_q = _ls_p; \ - _ls_psize = 0; \ - for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) { \ - _ls_psize++; \ - _SV(_ls_q,list); \ - if (_NEXT(_ls_q,list,next) == _ls_oldhead) { \ - _ls_q = NULL; \ - } else { \ - _ls_q = _NEXT(_ls_q,list,next); \ - } \ - _RS(list); \ - if (!_ls_q) break; \ - } \ - _ls_qsize = _ls_insize; \ - while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) { \ - if (_ls_psize == 0) { \ - _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = \ - _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--; \ - if (_ls_q == _ls_oldhead) { _ls_q = NULL; } \ - } else if (_ls_qsize == 0 || !_ls_q) { \ - _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = \ - _NEXT(_ls_p,list,next); _RS(list); _ls_psize--; \ - if (_ls_p == _ls_oldhead) { _ls_p = NULL; } \ - } else if (cmp(_ls_p,_ls_q) <= 0) { \ - _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = \ - _NEXT(_ls_p,list,next); _RS(list); _ls_psize--; \ - if (_ls_p == _ls_oldhead) { _ls_p = NULL; } \ - } else { \ - _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = \ - _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--; \ - if (_ls_q == _ls_oldhead) { _ls_q = NULL; } \ - } \ - if (_ls_tail) { \ - _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_ls_e,next); _RS(list); \ - } else { \ - _CASTASGN(list,_ls_e); \ - } \ - _SV(_ls_e,list); _PREVASGN(_ls_e,list,_ls_tail,prev); _RS(list); \ - _ls_tail = _ls_e; \ - } \ - _ls_p = _ls_q; \ - } \ - _CASTASGN(list->prev,_ls_tail); \ - _CASTASGN(_tmp,list); \ - _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_tmp,next); _RS(list); \ - if (_ls_nmerges <= 1) { \ - _ls_looping=0; \ - } \ - _ls_insize *= 2; \ - } \ - } \ -} while (0) - -/****************************************************************************** - * singly linked list macros (non-circular) * - *****************************************************************************/ -#define LL_PREPEND(head,add) \ - LL_PREPEND2(head,add,next) - -#define LL_PREPEND2(head,add,next) \ -do { \ - (add)->next = head; \ - head = add; \ -} while (0) - -#define LL_CONCAT(head1,head2) \ - LL_CONCAT2(head1,head2,next) - -#define LL_CONCAT2(head1,head2,next) \ -do { \ - LDECLTYPE(head1) _tmp; \ - if (head1) { \ - _tmp = head1; \ - while (_tmp->next) { _tmp = _tmp->next; } \ - _tmp->next=(head2); \ - } else { \ - (head1)=(head2); \ - } \ -} while (0) - -#define LL_APPEND(head,add) \ - LL_APPEND2(head,add,next) - -#define LL_APPEND2(head,add,next) \ -do { \ - LDECLTYPE(head) _tmp; \ - (add)->next=NULL; \ - if (head) { \ - _tmp = head; \ - while (_tmp->next) { _tmp = _tmp->next; } \ - _tmp->next=(add); \ - } else { \ - (head)=(add); \ - } \ -} while (0) - -#define LL_DELETE(head,del) \ - LL_DELETE2(head,del,next) - -#define LL_DELETE2(head,del,next) \ -do { \ - LDECLTYPE(head) _tmp; \ - if ((head) == (del)) { \ - (head)=(head)->next; \ - } else { \ - _tmp = head; \ - while (_tmp->next && (_tmp->next != (del))) { \ - _tmp = _tmp->next; \ - } \ - if (_tmp->next) { \ - _tmp->next = ((del)->next); \ - } \ - } \ -} while (0) - -/* Here are VS2008 replacements for LL_APPEND and LL_DELETE */ -#define LL_APPEND_VS2008(head,add) \ - LL_APPEND2_VS2008(head,add,next) - -#define LL_APPEND2_VS2008(head,add,next) \ -do { \ - if (head) { \ - (add)->next = head; /* use add->next as a temp variable */ \ - while ((add)->next->next) { (add)->next = (add)->next->next; } \ - (add)->next->next=(add); \ - } else { \ - (head)=(add); \ - } \ - (add)->next=NULL; \ -} while (0) - -#define LL_DELETE_VS2008(head,del) \ - LL_DELETE2_VS2008(head,del,next) - -#define LL_DELETE2_VS2008(head,del,next) \ -do { \ - if ((head) == (del)) { \ - (head)=(head)->next; \ - } else { \ - char *_tmp = (char*)(head); \ - while ((head)->next && ((head)->next != (del))) { \ - head = (head)->next; \ - } \ - if ((head)->next) { \ - (head)->next = ((del)->next); \ - } \ - { \ - char **_head_alias = (char**)&(head); \ - *_head_alias = _tmp; \ - } \ - } \ -} while (0) -#ifdef NO_DECLTYPE -#undef LL_APPEND -#define LL_APPEND LL_APPEND_VS2008 -#undef LL_DELETE -#define LL_DELETE LL_DELETE_VS2008 -#undef LL_DELETE2 -#define LL_DELETE2 LL_DELETE2_VS2008 -#undef LL_APPEND2 -#define LL_APPEND2 LL_APPEND2_VS2008 -#undef LL_CONCAT /* no LL_CONCAT_VS2008 */ -#undef DL_CONCAT /* no DL_CONCAT_VS2008 */ -#endif -/* end VS2008 replacements */ - -#define LL_COUNT(head,el,counter) \ - LL_COUNT2(head,el,counter,next) \ - -#define LL_COUNT2(head,el,counter,next) \ -{ \ - counter = 0; \ - LL_FOREACH2(head,el,next){ ++counter; } \ -} - -#define LL_FOREACH(head,el) \ - LL_FOREACH2(head,el,next) - -#define LL_FOREACH2(head,el,next) \ - for(el=head;el;el=(el)->next) - -#define LL_FOREACH_SAFE(head,el,tmp) \ - LL_FOREACH_SAFE2(head,el,tmp,next) - -#define LL_FOREACH_SAFE2(head,el,tmp,next) \ - for((el)=(head);(el) && (tmp = (el)->next, 1); (el) = tmp) - -#define LL_SEARCH_SCALAR(head,out,field,val) \ - LL_SEARCH_SCALAR2(head,out,field,val,next) - -#define LL_SEARCH_SCALAR2(head,out,field,val,next) \ -do { \ - LL_FOREACH2(head,out,next) { \ - if ((out)->field == (val)) break; \ - } \ -} while(0) - -#define LL_SEARCH(head,out,elt,cmp) \ - LL_SEARCH2(head,out,elt,cmp,next) - -#define LL_SEARCH2(head,out,elt,cmp,next) \ -do { \ - LL_FOREACH2(head,out,next) { \ - if ((cmp(out,elt))==0) break; \ - } \ -} while(0) - -#define LL_REPLACE_ELEM(head, el, add) \ -do { \ - LDECLTYPE(head) _tmp; \ - assert(head != NULL); \ - assert(el != NULL); \ - assert(add != NULL); \ - (add)->next = (el)->next; \ - if ((head) == (el)) { \ - (head) = (add); \ - } else { \ - _tmp = head; \ - while (_tmp->next && (_tmp->next != (el))) { \ - _tmp = _tmp->next; \ - } \ - if (_tmp->next) { \ - _tmp->next = (add); \ - } \ - } \ -} while (0) - -#define LL_PREPEND_ELEM(head, el, add) \ -do { \ - LDECLTYPE(head) _tmp; \ - assert(head != NULL); \ - assert(el != NULL); \ - assert(add != NULL); \ - (add)->next = (el); \ - if ((head) == (el)) { \ - (head) = (add); \ - } else { \ - _tmp = head; \ - while (_tmp->next && (_tmp->next != (el))) { \ - _tmp = _tmp->next; \ - } \ - if (_tmp->next) { \ - _tmp->next = (add); \ - } \ - } \ -} while (0) \ - - -/****************************************************************************** - * doubly linked list macros (non-circular) * - *****************************************************************************/ -#define DL_PREPEND(head,add) \ - DL_PREPEND2(head,add,prev,next) - -#define DL_PREPEND2(head,add,prev,next) \ -do { \ - (add)->next = head; \ - if (head) { \ - (add)->prev = (head)->prev; \ - (head)->prev = (add); \ - } else { \ - (add)->prev = (add); \ - } \ - (head) = (add); \ -} while (0) - -#define DL_APPEND(head,add) \ - DL_APPEND2(head,add,prev,next) - -#define DL_APPEND2(head,add,prev,next) \ -do { \ - if (head) { \ - (add)->prev = (head)->prev; \ - (head)->prev->next = (add); \ - (head)->prev = (add); \ - (add)->next = NULL; \ - } else { \ - (head)=(add); \ - (head)->prev = (head); \ - (head)->next = NULL; \ - } \ -} while (0) - -#define DL_CONCAT(head1,head2) \ - DL_CONCAT2(head1,head2,prev,next) - -#define DL_CONCAT2(head1,head2,prev,next) \ -do { \ - LDECLTYPE(head1) _tmp; \ - if (head2) { \ - if (head1) { \ - _tmp = (head2)->prev; \ - (head2)->prev = (head1)->prev; \ - (head1)->prev->next = (head2); \ - (head1)->prev = _tmp; \ - } else { \ - (head1)=(head2); \ - } \ - } \ -} while (0) - -#define DL_DELETE(head,del) \ - DL_DELETE2(head,del,prev,next) - -#define DL_DELETE2(head,del,prev,next) \ -do { \ - assert((del)->prev != NULL); \ - if ((del)->prev == (del)) { \ - (head)=NULL; \ - } else if ((del)==(head)) { \ - (del)->next->prev = (del)->prev; \ - (head) = (del)->next; \ - } else { \ - (del)->prev->next = (del)->next; \ - if ((del)->next) { \ - (del)->next->prev = (del)->prev; \ - } else { \ - (head)->prev = (del)->prev; \ - } \ - } \ -} while (0) - -#define DL_COUNT(head,el,counter) \ - DL_COUNT2(head,el,counter,next) \ - -#define DL_COUNT2(head,el,counter,next) \ -{ \ - counter = 0; \ - DL_FOREACH2(head,el,next){ ++counter; } \ -} - -#define DL_FOREACH(head,el) \ - DL_FOREACH2(head,el,next) - -#define DL_FOREACH2(head,el,next) \ - for(el=head;el;el=(el)->next) - -/* this version is safe for deleting the elements during iteration */ -#define DL_FOREACH_SAFE(head,el,tmp) \ - DL_FOREACH_SAFE2(head,el,tmp,next) - -#define DL_FOREACH_SAFE2(head,el,tmp,next) \ - for((el)=(head);(el) && (tmp = (el)->next, 1); (el) = tmp) - -/* these are identical to their singly-linked list counterparts */ -#define DL_SEARCH_SCALAR LL_SEARCH_SCALAR -#define DL_SEARCH LL_SEARCH -#define DL_SEARCH_SCALAR2 LL_SEARCH_SCALAR2 -#define DL_SEARCH2 LL_SEARCH2 - -#define DL_REPLACE_ELEM(head, el, add) \ -do { \ - assert(head != NULL); \ - assert(el != NULL); \ - assert(add != NULL); \ - if ((head) == (el)) { \ - (head) = (add); \ - (add)->next = (el)->next; \ - if ((el)->next == NULL) { \ - (add)->prev = (add); \ - } else { \ - (add)->prev = (el)->prev; \ - (add)->next->prev = (add); \ - } \ - } else { \ - (add)->next = (el)->next; \ - (add)->prev = (el)->prev; \ - (add)->prev->next = (add); \ - if ((el)->next == NULL) { \ - (head)->prev = (add); \ - } else { \ - (add)->next->prev = (add); \ - } \ - } \ -} while (0) - -#define DL_PREPEND_ELEM(head, el, add) \ -do { \ - assert(head != NULL); \ - assert(el != NULL); \ - assert(add != NULL); \ - (add)->next = (el); \ - (add)->prev = (el)->prev; \ - (el)->prev = (add); \ - if ((head) == (el)) { \ - (head) = (add); \ - } else { \ - (add)->prev->next = (add); \ - } \ -} while (0) \ - - -/****************************************************************************** - * circular doubly linked list macros * - *****************************************************************************/ -#define CDL_PREPEND(head,add) \ - CDL_PREPEND2(head,add,prev,next) - -#define CDL_PREPEND2(head,add,prev,next) \ -do { \ - if (head) { \ - (add)->prev = (head)->prev; \ - (add)->next = (head); \ - (head)->prev = (add); \ - (add)->prev->next = (add); \ - } else { \ - (add)->prev = (add); \ - (add)->next = (add); \ - } \ -(head)=(add); \ -} while (0) - -#define CDL_DELETE(head,del) \ - CDL_DELETE2(head,del,prev,next) - -#define CDL_DELETE2(head,del,prev,next) \ -do { \ - if ( ((head)==(del)) && ((head)->next == (head))) { \ - (head) = 0L; \ - } else { \ - (del)->next->prev = (del)->prev; \ - (del)->prev->next = (del)->next; \ - if ((del) == (head)) (head)=(del)->next; \ - } \ -} while (0) - -#define CDL_COUNT(head,el,counter) \ - CDL_COUNT2(head,el,counter,next) \ - -#define CDL_COUNT2(head, el, counter,next) \ -{ \ - counter = 0; \ - CDL_FOREACH2(head,el,next){ ++counter; } \ -} - -#define CDL_FOREACH(head,el) \ - CDL_FOREACH2(head,el,next) - -#define CDL_FOREACH2(head,el,next) \ - for(el=head;el;el=((el)->next==head ? 0L : (el)->next)) - -#define CDL_FOREACH_SAFE(head,el,tmp1,tmp2) \ - CDL_FOREACH_SAFE2(head,el,tmp1,tmp2,prev,next) - -#define CDL_FOREACH_SAFE2(head,el,tmp1,tmp2,prev,next) \ - for((el)=(head), ((tmp1)=(head)?((head)->prev):NULL); \ - (el) && ((tmp2)=(el)->next, 1); \ - ((el) = (((el)==(tmp1)) ? 0L : (tmp2)))) - -#define CDL_SEARCH_SCALAR(head,out,field,val) \ - CDL_SEARCH_SCALAR2(head,out,field,val,next) - -#define CDL_SEARCH_SCALAR2(head,out,field,val,next) \ -do { \ - CDL_FOREACH2(head,out,next) { \ - if ((out)->field == (val)) break; \ - } \ -} while(0) - -#define CDL_SEARCH(head,out,elt,cmp) \ - CDL_SEARCH2(head,out,elt,cmp,next) - -#define CDL_SEARCH2(head,out,elt,cmp,next) \ -do { \ - CDL_FOREACH2(head,out,next) { \ - if ((cmp(out,elt))==0) break; \ - } \ -} while(0) - -#define CDL_REPLACE_ELEM(head, el, add) \ -do { \ - assert(head != NULL); \ - assert(el != NULL); \ - assert(add != NULL); \ - if ((el)->next == (el)) { \ - (add)->next = (add); \ - (add)->prev = (add); \ - (head) = (add); \ - } else { \ - (add)->next = (el)->next; \ - (add)->prev = (el)->prev; \ - (add)->next->prev = (add); \ - (add)->prev->next = (add); \ - if ((head) == (el)) { \ - (head) = (add); \ - } \ - } \ -} while (0) - -#define CDL_PREPEND_ELEM(head, el, add) \ -do { \ - assert(head != NULL); \ - assert(el != NULL); \ - assert(add != NULL); \ - (add)->next = (el); \ - (add)->prev = (el)->prev; \ - (el)->prev = (add); \ - (add)->prev->next = (add); \ - if ((head) == (el)) { \ - (head) = (add); \ - } \ -} while (0) \ - -#endif /* UTLIST_H */ - diff --git a/tools/sdk/include/config/sdkconfig.h b/tools/sdk/include/config/sdkconfig.h deleted file mode 100644 index 444fb1a682a..00000000000 --- a/tools/sdk/include/config/sdkconfig.h +++ /dev/null @@ -1,364 +0,0 @@ -/* - * - * Automatically generated file; DO NOT EDIT. - * Espressif IoT Development Framework Configuration - * - */ -#define CONFIG_GATTC_ENABLE 1 -#define CONFIG_ESP32_PHY_MAX_TX_POWER 20 -#define CONFIG_TRACEMEM_RESERVE_DRAM 0x0 -#define CONFIG_FREERTOS_MAX_TASK_NAME_LEN 16 -#define CONFIG_MQTT_TRANSPORT_SSL 1 -#define CONFIG_BLE_SMP_ENABLE 1 -#define CONFIG_SPIRAM_TYPE_AUTO 1 -#define CONFIG_STACK_CHECK 1 -#define CONFIG_MB_SERIAL_TASK_PRIO 10 -#define CONFIG_MQTT_PROTOCOL_311 1 -#define CONFIG_TCP_RECVMBOX_SIZE 6 -#define CONFIG_LWIP_ETHARP_TRUST_IP_MAC 1 -#define CONFIG_BLE_SCAN_DUPLICATE 1 -#define CONFIG_STACK_CHECK_NORM 1 -#define CONFIG_TCP_WND_DEFAULT 5744 -#define CONFIG_PARTITION_TABLE_OFFSET 0x8000 -#define CONFIG_SW_COEXIST_ENABLE 1 -#define CONFIG_SPIFFS_USE_MAGIC_LENGTH 1 -#define CONFIG_ESPTOOLPY_FLASHSIZE_4MB 1 -#define CONFIG_IPC_TASK_STACK_SIZE 1024 -#define CONFIG_FATFS_PER_FILE_CACHE 1 -#define CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY 1 -#define CONFIG_ESPTOOLPY_FLASHFREQ "40m" -#define CONFIG_MBEDTLS_KEY_EXCHANGE_RSA 1 -#define CONFIG_UDP_RECVMBOX_SIZE 6 -#define CONFIG_ARDUHAL_PARTITION_SCHEME_DEFAULT 1 -#define CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE 0 -#define CONFIG_MBEDTLS_AES_C 1 -#define CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED 1 -#define CONFIG_A2DP_SINK_TASK_STACK_SIZE 2048 -#define CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN 752 -#define CONFIG_MBEDTLS_GCM_C 1 -#define CONFIG_ESPTOOLPY_FLASHSIZE "4MB" -#define CONFIG_SPIFFS_CACHE_WR 1 -#define CONFIG_SPIRAM_CACHE_WORKAROUND 1 -#define CONFIG_BROWNOUT_DET_LVL_SEL_0 1 -#define CONFIG_D0WD_PSRAM_CS_IO 16 -#define CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER 1 -#define CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE 1 -#define CONFIG_BTDM_CONTROLLER_MODEM_SLEEP 1 -#define CONFIG_SPIFFS_CACHE 1 -#define CONFIG_INT_WDT 1 -#define CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL 1 -#define CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN 3 -#define CONFIG_MBEDTLS_SSL_PROTO_TLS1 1 -#define CONFIG_BT_STACK_NO_LOG 1 -#define CONFIG_ESP_GRATUITOUS_ARP 1 -#define CONFIG_MBEDTLS_ECDSA_C 1 -#define CONFIG_ESPTOOLPY_FLASHFREQ_40M 1 -#define CONFIG_HTTPD_MAX_REQ_HDR_LEN 512 -#define CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE 0 -#define CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS 1 -#define CONFIG_MBEDTLS_ECDH_C 1 -#define CONFIG_SPIRAM_USE_CAPS_ALLOC 1 -#define CONFIG_FRMN1_QUANT 1 -#define CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE 1 -#define CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM 16 -#define CONFIG_MBEDTLS_SSL_ALPN 1 -#define CONFIG_MBEDTLS_PEM_WRITE_C 1 -#define CONFIG_BT_SPP_ENABLED 1 -#define CONFIG_BT_RESERVE_DRAM 0xdb5c -#define CONFIG_CXX_EXCEPTIONS 1 -#define CONFIG_D2WD_PSRAM_CLK_IO 9 -#define CONFIG_FATFS_FS_LOCK 0 -#define CONFIG_IP_LOST_TIMER_INTERVAL 120 -#define CONFIG_SPIFFS_META_LENGTH 4 -#define CONFIG_ESP32_PANIC_PRINT_REBOOT 1 -#define CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE 20 -#define CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED 1 -#define CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED 1 -#define CONFIG_CAMERA_CORE1 1 -#define CONFIG_ESP32_DPORT_DIS_INTERRUPT_LVL 5 -#define CONFIG_MB_SERIAL_BUF_SIZE 256 -#define CONFIG_CONSOLE_UART_BAUDRATE 115200 -#define CONFIG_SPIRAM_SUPPORT 1 -#define CONFIG_LWIP_MAX_SOCKETS 10 -#define CONFIG_LWIP_NETIF_LOOPBACK 1 -#define CONFIG_EMAC_TASK_PRIORITY 20 -#define CONFIG_TIMER_TASK_STACK_DEPTH 2048 -#define CONFIG_TCP_MSS 1436 -#define CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED 1 -#define CONFIG_BTDM_CONTROLLER_MODE_BTDM 1 -#define CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN_EFF 3 -#define CONFIG_TCPIP_TASK_AFFINITY_CPU0 1 -#define CONFIG_FATFS_CODEPAGE 850 -#define CONFIG_SPIRAM_SPIWP_SD3_PIN 7 -#define CONFIG_ULP_COPROC_RESERVE_MEM 512 -#define CONFIG_LWIP_MAX_UDP_PCBS 16 -#define CONFIG_ESPTOOLPY_BAUD 921600 -#define CONFIG_INT_WDT_CHECK_CPU1 1 -#define CONFIG_ADC_CAL_LUT_ENABLE 1 -#define CONFIG_FLASHMODE_DIO 1 -#define CONFIG_ESPTOOLPY_AFTER_RESET 1 -#define CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED 1 -#define CONFIG_LWIP_DHCPS_MAX_STATION_NUM 8 -#define CONFIG_TOOLPREFIX "xtensa-esp32-elf-" -#define CONFIG_MBEDTLS_ECP_C 1 -#define CONFIG_FREERTOS_IDLE_TASK_STACKSIZE 1024 -#define CONFIG_MBEDTLS_RC4_DISABLED 1 -#define CONFIG_FATFS_LFN_STACK 1 -#define CONFIG_CONSOLE_UART_NUM 0 -#define CONFIG_ARDUINO_EVENT_RUNNING_CORE 1 -#define CONFIG_ESP32_APPTRACE_LOCK_ENABLE 1 -#define CONFIG_PTHREAD_STACK_MIN 768 -#define CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC 1 -#define CONFIG_TCP_OVERSIZE_MSS 1 -#define CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS 1 -#define CONFIG_CONSOLE_UART_DEFAULT 1 -#define CONFIG_A2DP_SOURCE_TASK_STACK_SIZE 2048 -#define CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN 16384 -#define CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS 4 -#define CONFIG_ESPTOOLPY_FLASHSIZE_DETECT 1 -#define CONFIG_AUTOSTART_ARDUINO 1 -#define CONFIG_ARDUINO_RUNNING_CORE 1 -#define CONFIG_PPP_CHAP_SUPPORT 1 -#define CONFIG_LOG_DEFAULT_LEVEL_ERROR 1 -#define CONFIG_TIMER_TASK_STACK_SIZE 4096 -#define CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE 1 -#define CONFIG_SPIRAM_BANKSWITCH_ENABLE 1 -#define CONFIG_MBEDTLS_X509_CRL_PARSE_C 1 -#define CONFIG_HTTPD_PURGE_BUF_LEN 32 -#define CONFIG_SCAN_DUPLICATE_BY_DEVICE_ADDR 1 -#define CONFIG_MB_SERIAL_TASK_STACK_SIZE 2048 -#define CONFIG_MBEDTLS_PSK_MODES 1 -#define CONFIG_GATTS_SEND_SERVICE_CHANGE_AUTO 1 -#define CONFIG_LWIP_DHCPS_LEASE_UNIT 60 -#define CONFIG_SPIFFS_USE_MAGIC 1 -#define CONFIG_OV7725_SUPPORT 1 -#define CONFIG_TCPIP_TASK_STACK_SIZE 2560 -#define CONFIG_BLUEDROID_PINNED_TO_CORE_0 1 -#define CONFIG_FATFS_CODEPAGE_850 1 -#define CONFIG_TASK_WDT 1 -#define CONFIG_MTMN_LITE_QUANT 1 -#define CONFIG_MAIN_TASK_STACK_SIZE 4096 -#define CONFIG_SPIFFS_PAGE_CHECK 1 -#define CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0 1 -#define CONFIG_LWIP_MAX_ACTIVE_TCP 16 -#define CONFIG_TASK_WDT_TIMEOUT_S 5 -#define CONFIG_INT_WDT_TIMEOUT_MS 300 -#define CONFIG_SCCB_HARDWARE_I2C 1 -#define CONFIG_ARDUINO_EVENT_RUN_CORE1 1 -#define CONFIG_ESPTOOLPY_FLASHMODE "dio" -#define CONFIG_BTC_TASK_STACK_SIZE 8192 -#define CONFIG_BLUEDROID_ENABLED 1 -#define CONFIG_NEWLIB_STDIN_LINE_ENDING_CR 1 -#define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA 1 -#define CONFIG_ESPTOOLPY_BEFORE "default_reset" -#define CONFIG_ADC2_DISABLE_DAC 1 -#define CONFIG_HFP_ENABLE 1 -#define CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_NUM 100 -#define CONFIG_ESP32_REV_MIN_0 1 -#define CONFIG_LOG_DEFAULT_LEVEL 1 -#define CONFIG_TIMER_QUEUE_LENGTH 10 -#define CONFIG_ESP32_REV_MIN 0 -#define CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT 1 -#define CONFIG_GATTS_SEND_SERVICE_CHANGE_MODE 0 -#define CONFIG_MAKE_WARN_UNDEFINED_VARIABLES 1 -#define CONFIG_FATFS_TIMEOUT_MS 10000 -#define CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM 32 -#define CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS 1 -#define CONFIG_MBEDTLS_CCM_C 1 -#define CONFIG_SPI_MASTER_ISR_IN_IRAM 1 -#define CONFIG_ARDUHAL_PARTITION_SCHEME "default" -#define CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER 20 -#define CONFIG_ESP32_RTC_CLK_CAL_CYCLES 1024 -#define CONFIG_ESP32_WIFI_TX_BA_WIN 6 -#define CONFIG_ESP32_WIFI_NVS_ENABLED 1 -#define CONFIG_MDNS_MAX_SERVICES 10 -#define CONFIG_ULP_COPROC_ENABLED 1 -#define CONFIG_HFP_AUDIO_DATA_PATH_PCM 1 -#define CONFIG_EMAC_CHECK_LINK_PERIOD_MS 2000 -#define CONFIG_BTDM_LPCLK_SEL_MAIN_XTAL 1 -#define CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED 1 -#define CONFIG_LIBSODIUM_USE_MBEDTLS_SHA 1 -#define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK 1 -#define CONFIG_DMA_RX_BUF_NUM 10 -#define CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED 1 -#define CONFIG_MBEDTLS_KEY_EXCHANGE_PSK 1 -#define CONFIG_TCP_SYNMAXRTX 6 -#define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA 1 -#define CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_EFF 0 -#define CONFIG_HEAP_POISONING_LIGHT 1 -#define CONFIG_PYTHON "python" -#define CONFIG_SPIRAM_BANKSWITCH_RESERVE 8 -#define CONFIG_MBEDTLS_ECP_NIST_OPTIM 1 -#define CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1 1 -#define CONFIG_ESPTOOLPY_COMPRESSED 1 -#define CONFIG_PARTITION_TABLE_FILENAME "partitions_singleapp.csv" -#define CONFIG_MB_CONTROLLER_STACK_SIZE 4096 -#define CONFIG_TCP_SND_BUF_DEFAULT 5744 -#define CONFIG_GARP_TMR_INTERVAL 60 -#define CONFIG_LWIP_DHCP_MAX_NTP_SERVERS 1 -#define CONFIG_TCP_MSL 60000 -#define CONFIG_MBEDTLS_SSL_PROTO_TLS1_1 1 -#define CONFIG_LWIP_SO_REUSE_RXTOALL 1 -#define CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT 20 -#define CONFIG_ESP32_WIFI_MGMT_SBUF_NUM 32 -#define CONFIG_PARTITION_TABLE_SINGLE_APP 1 -#define CONFIG_XTENSA_IMPL 1 -#define CONFIG_ESP32_WIFI_RX_BA_WIN 16 -#define CONFIG_MBEDTLS_X509_CSR_PARSE_C 1 -#define CONFIG_SPIFFS_USE_MTIME 1 -#define CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN 0 -#define CONFIG_LWIP_DHCP_RESTORE_LAST_IP 1 -#define CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN 2 -#define CONFIG_PICO_PSRAM_CS_IO 10 -#define CONFIG_EMAC_TASK_STACK_SIZE 3072 -#define CONFIG_MB_QUEUE_LENGTH 20 -#define CONFIG_SW_COEXIST_PREFERENCE_VALUE 2 -#define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA 1 -#define CONFIG_OV2640_SUPPORT 1 -#define CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER 1 -#define CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_PSK 1 -#define CONFIG_PPP_SUPPORT 1 -#define CONFIG_SPIRAM_SPEED_40M 1 -#define CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE 2048 -#define CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V 1 -#define CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY 2000 -#define CONFIG_BROWNOUT_DET_LVL 0 -#define CONFIG_BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH_PCM 1 -#define CONFIG_MBEDTLS_PEM_PARSE_C 1 -#define CONFIG_SPIFFS_GC_MAX_RUNS 10 -#define CONFIG_ARDUINO_RUN_CORE1 1 -#define CONFIG_ESP32_APPTRACE_DEST_NONE 1 -#define CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC 1 -#define CONFIG_MBEDTLS_SSL_PROTO_TLS1_2 1 -#define CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA 1 -#define CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM 32 -#define CONFIG_HTTPD_MAX_URI_LEN 512 -#define CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED 1 -#define CONFIG_ARDUHAL_ESP_LOG 1 -#define CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED 1 -#define CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ 240 -#define CONFIG_MBEDTLS_HARDWARE_AES 1 -#define CONFIG_FREERTOS_HZ 1000 -#define CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE 1 -#define CONFIG_ADC_CAL_EFUSE_TP_ENABLE 1 -#define CONFIG_FREERTOS_ASSERT_FAIL_ABORT 1 -#define CONFIG_BROWNOUT_DET 1 -#define CONFIG_ESP32_XTAL_FREQ 0 -#define CONFIG_MONITOR_BAUD_115200B 1 -#define CONFIG_LOG_BOOTLOADER_LEVEL 0 -#define CONFIG_D2WD_PSRAM_CS_IO 10 -#define CONFIG_MBEDTLS_TLS_ENABLED 1 -#define CONFIG_LWIP_MAX_RAW_PCBS 16 -#define CONFIG_SMP_ENABLE 1 -#define CONFIG_SPIRAM_SIZE -1 -#define CONFIG_MBEDTLS_SSL_SESSION_TICKETS 1 -#define CONFIG_SPIFFS_MAX_PARTITIONS 3 -#define CONFIG_ESP_ERR_TO_NAME_LOOKUP 1 -#define CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_0 1 -#define CONFIG_MBEDTLS_SSL_RENEGOTIATION 1 -#define CONFIG_ESPTOOLPY_BEFORE_RESET 1 -#define CONFIG_MB_EVENT_QUEUE_TIMEOUT 20 -#define CONFIG_ESPTOOLPY_BAUD_OTHER_VAL 115200 -#define CONFIG_PPP_MPPE_SUPPORT 1 -#define CONFIG_ENABLE_ARDUINO_DEPENDS 1 -#define CONFIG_WARN_WRITE_STRINGS 1 -#define CONFIG_SPIFFS_OBJ_NAME_LEN 32 -#define CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT 5 -#define CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN_EFF 2 -#define CONFIG_LOG_BOOTLOADER_LEVEL_NONE 1 -#define CONFIG_PARTITION_TABLE_MD5 1 -#define CONFIG_TCPIP_RECVMBOX_SIZE 32 -#define CONFIG_ESP32_DEFAULT_CPU_FREQ_240 1 -#define CONFIG_ESP32_XTAL_FREQ_AUTO 1 -#define CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST 1 -#define CONFIG_TCP_MAXRTX 12 -#define CONFIG_ESPTOOLPY_AFTER "hard_reset" -#define CONFIG_TCPIP_TASK_AFFINITY 0x0 -#define CONFIG_LWIP_SO_REUSE 1 -#define CONFIG_ARDUINO_UDP_RUN_CORE1 1 -#define CONFIG_DMA_TX_BUF_NUM 10 -#define CONFIG_LWIP_MAX_LISTENING_TCP 16 -#define CONFIG_FREERTOS_INTERRUPT_BACKTRACE 1 -#define CONFIG_WL_SECTOR_SIZE 4096 -#define CONFIG_ESP32_DEBUG_OCDAWARE 1 -#define CONFIG_MQTT_TRANSPORT_WEBSOCKET 1 -#define CONFIG_TIMER_TASK_PRIORITY 1 -#define CONFIG_PPP_PAP_SUPPORT 1 -#define CONFIG_MBEDTLS_TLS_CLIENT 1 -#define CONFIG_BTDM_CONTROLLER_HCI_MODE_VHCI 1 -#define CONFIG_BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH_EFF 1 -#define CONFIG_BT_ENABLED 1 -#define CONFIG_D0WD_PSRAM_CLK_IO 17 -#define CONFIG_SW_COEXIST_PREFERENCE_BALANCE 1 -#define CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED 1 -#define CONFIG_MONITOR_BAUD 115200 -#define CONFIG_ESP32_DEBUG_STUBS_ENABLE 1 -#define CONFIG_BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT 30 -#define CONFIG_TCPIP_LWIP 1 -#define CONFIG_REDUCE_PHY_TX_POWER 1 -#define CONFIG_BOOTLOADER_WDT_TIME_MS 9000 -#define CONFIG_FREERTOS_CORETIMER_0 1 -#define CONFIG_IDF_FIRMWARE_CHIP_ID 0x0000 -#define CONFIG_PARTITION_TABLE_CUSTOM_FILENAME "partitions.csv" -#define CONFIG_MBEDTLS_HAVE_TIME 1 -#define CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY 1 -#define CONFIG_TCP_QUEUE_OOSEQ 1 -#define CONFIG_GATTS_ENABLE 1 -#define CONFIG_CXX_EXCEPTIONS_EMG_POOL_SIZE 0 -#define CONFIG_ADC_CAL_EFUSE_VREF_ENABLE 1 -#define CONFIG_MBEDTLS_TLS_SERVER 1 -#define CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT 1 -#define CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_SUPPORTED 1 -#define CONFIG_FREERTOS_ISR_STACKSIZE 1536 -#define CONFIG_SUPPORT_TERMIOS 1 -#define CONFIG_CLASSIC_BT_ENABLED 1 -#define CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK 1 -#define CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_PSK 1 -#define CONFIG_OPENSSL_ASSERT_DO_NOTHING 1 -#define CONFIG_WL_SECTOR_SIZE_4096 1 -#define CONFIG_OPTIMIZATION_LEVEL_DEBUG 1 -#define CONFIG_FREERTOS_NO_AFFINITY 0x7FFFFFFF -#define CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED 1 -#define CONFIG_MB_TIMER_INDEX 0 -#define CONFIG_SCAN_DUPLICATE_TYPE 0 -#define CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED 1 -#define CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED 1 -#define CONFIG_HFP_CLIENT_ENABLE 1 -#define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA 1 -#define CONFIG_SPI_SLAVE_ISR_IN_IRAM 1 -#define CONFIG_SYSTEM_EVENT_QUEUE_SIZE 32 -#define CONFIG_BT_ACL_CONNECTIONS 4 -#define CONFIG_FATFS_MAX_LFN 255 -#define CONFIG_ESP32_WIFI_TX_BUFFER_TYPE 1 -#define CONFIG_ESPTOOLPY_BAUD_921600B 1 -#define CONFIG_BOOTLOADER_WDT_ENABLE 1 -#define CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED 1 -#define CONFIG_LWIP_LOOPBACK_MAX_PBUFS 8 -#define CONFIG_A2DP_ENABLE 1 -#define CONFIG_MB_TIMER_GROUP 0 -#define CONFIG_SPI_FLASH_ROM_DRIVER_PATCH 1 -#define CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE 1 -#define CONFIG_SPIFFS_PAGE_SIZE 256 -#define CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED 1 -#define CONFIG_ESP32_DPORT_WORKAROUND 1 -#define CONFIG_PPP_MSCHAP_SUPPORT 1 -#define CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0 1 -#define CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT 2048 -#define CONFIG_LWIP_SO_RCVBUF 1 -#define CONFIG_MB_TIMER_PORT_ENABLED 1 -#define CONFIG_DUPLICATE_SCAN_CACHE_SIZE 20 -#define CONFIG_ARDUINO_UDP_RUNNING_CORE 1 -#define CONFIG_MONITOR_BAUD_OTHER_VAL 115200 -#define CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF 1 -#define CONFIG_ESPTOOLPY_PORT "/dev/cu.usbserial-DO00EAB0" -#define CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS 1 -#define CONFIG_TASK_WDT_PANIC 1 -#define CONFIG_OV3660_SUPPORT 1 -#define CONFIG_BLE_ADV_REPORT_DISCARD_THRSHOLD 20 -#define CONFIG_BLUEDROID_PINNED_TO_CORE 0 -#define CONFIG_BTDM_MODEM_SLEEP_MODE_ORIG 1 -#define CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_ERROR 1 -#define CONFIG_ESP32_WIFI_IRAM_OPT 1 -#define CONFIG_FATFS_API_ENCODING_ANSI_OEM 1 -#define CONFIG_ARDUINO_IDF_COMMIT "d3e562907" -#define CONFIG_ARDUINO_IDF_BRANCH "release/v3.2" diff --git a/tools/sdk/include/console/argtable3/argtable3.h b/tools/sdk/include/console/argtable3/argtable3.h deleted file mode 100644 index 37a321fb53a..00000000000 --- a/tools/sdk/include/console/argtable3/argtable3.h +++ /dev/null @@ -1,306 +0,0 @@ -/******************************************************************************* - * This file is part of the argtable3 library. - * - * Copyright (C) 1998-2001,2003-2011,2013 Stewart Heitmann - * - * All rights reserved. - * - * 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 STEWART HEITMANN 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 STEWART HEITMANN 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 ARGTABLE3 -#define ARGTABLE3 - -#include /* FILE */ -#include /* struct tm */ - -#ifdef __cplusplus -extern "C" { -#endif - -#define ARG_REX_ICASE 1 - -/* bit masks for arg_hdr.flag */ -enum -{ - ARG_TERMINATOR=0x1, - ARG_HASVALUE=0x2, - ARG_HASOPTVALUE=0x4 -}; - -typedef void (arg_resetfn)(void *parent); -typedef int (arg_scanfn)(void *parent, const char *argval); -typedef int (arg_checkfn)(void *parent); -typedef void (arg_errorfn)(void *parent, FILE *fp, int error, const char *argval, const char *progname); - - -/* -* The arg_hdr struct defines properties that are common to all arg_xxx structs. -* The argtable library requires each arg_xxx struct to have an arg_hdr -* struct as its first data member. -* The argtable library functions then use this data to identify the -* properties of the command line option, such as its option tags, -* datatype string, and glossary strings, and so on. -* Moreover, the arg_hdr struct contains pointers to custom functions that -* are provided by each arg_xxx struct which perform the tasks of parsing -* that particular arg_xxx arguments, performing post-parse checks, and -* reporting errors. -* These functions are private to the individual arg_xxx source code -* and are the pointer to them are initiliased by that arg_xxx struct's -* constructor function. The user could alter them after construction -* if desired, but the original intention is for them to be set by the -* constructor and left unaltered. -*/ -struct arg_hdr -{ - char flag; /* Modifier flags: ARG_TERMINATOR, ARG_HASVALUE. */ - const char *shortopts; /* String defining the short options */ - const char *longopts; /* String defiing the long options */ - const char *datatype; /* Description of the argument data type */ - const char *glossary; /* Description of the option as shown by arg_print_glossary function */ - int mincount; /* Minimum number of occurences of this option accepted */ - int maxcount; /* Maximum number of occurences if this option accepted */ - void *parent; /* Pointer to parent arg_xxx struct */ - arg_resetfn *resetfn; /* Pointer to parent arg_xxx reset function */ - arg_scanfn *scanfn; /* Pointer to parent arg_xxx scan function */ - arg_checkfn *checkfn; /* Pointer to parent arg_xxx check function */ - arg_errorfn *errorfn; /* Pointer to parent arg_xxx error function */ - void *priv; /* Pointer to private header data for use by arg_xxx functions */ -}; - -struct arg_rem -{ - struct arg_hdr hdr; /* The mandatory argtable header struct */ -}; - -struct arg_lit -{ - struct arg_hdr hdr; /* The mandatory argtable header struct */ - int count; /* Number of matching command line args */ -}; - -struct arg_int -{ - struct arg_hdr hdr; /* The mandatory argtable header struct */ - int count; /* Number of matching command line args */ - int *ival; /* Array of parsed argument values */ -}; - -struct arg_dbl -{ - struct arg_hdr hdr; /* The mandatory argtable header struct */ - int count; /* Number of matching command line args */ - double *dval; /* Array of parsed argument values */ -}; - -struct arg_str -{ - struct arg_hdr hdr; /* The mandatory argtable header struct */ - int count; /* Number of matching command line args */ - const char **sval; /* Array of parsed argument values */ -}; - -struct arg_rex -{ - struct arg_hdr hdr; /* The mandatory argtable header struct */ - int count; /* Number of matching command line args */ - const char **sval; /* Array of parsed argument values */ -}; - -struct arg_file -{ - struct arg_hdr hdr; /* The mandatory argtable header struct */ - int count; /* Number of matching command line args*/ - const char **filename; /* Array of parsed filenames (eg: /home/foo.bar) */ - const char **basename; /* Array of parsed basenames (eg: foo.bar) */ - const char **extension; /* Array of parsed extensions (eg: .bar) */ -}; - -struct arg_date -{ - struct arg_hdr hdr; /* The mandatory argtable header struct */ - const char *format; /* strptime format string used to parse the date */ - int count; /* Number of matching command line args */ - struct tm *tmval; /* Array of parsed time values */ -}; - -enum {ARG_ELIMIT=1, ARG_EMALLOC, ARG_ENOMATCH, ARG_ELONGOPT, ARG_EMISSARG}; -struct arg_end -{ - struct arg_hdr hdr; /* The mandatory argtable header struct */ - int count; /* Number of errors encountered */ - int *error; /* Array of error codes */ - void **parent; /* Array of pointers to offending arg_xxx struct */ - const char **argval; /* Array of pointers to offending argv[] string */ -}; - - -/**** arg_xxx constructor functions *********************************/ - -struct arg_rem* arg_rem(const char* datatype, const char* glossary); - -struct arg_lit* arg_lit0(const char* shortopts, - const char* longopts, - const char* glossary); -struct arg_lit* arg_lit1(const char* shortopts, - const char* longopts, - const char *glossary); -struct arg_lit* arg_litn(const char* shortopts, - const char* longopts, - int mincount, - int maxcount, - const char *glossary); - -struct arg_key* arg_key0(const char* keyword, - int flags, - const char* glossary); -struct arg_key* arg_key1(const char* keyword, - int flags, - const char* glossary); -struct arg_key* arg_keyn(const char* keyword, - int flags, - int mincount, - int maxcount, - const char* glossary); - -struct arg_int* arg_int0(const char* shortopts, - const char* longopts, - const char* datatype, - const char* glossary); -struct arg_int* arg_int1(const char* shortopts, - const char* longopts, - const char* datatype, - const char *glossary); -struct arg_int* arg_intn(const char* shortopts, - const char* longopts, - const char *datatype, - int mincount, - int maxcount, - const char *glossary); - -struct arg_dbl* arg_dbl0(const char* shortopts, - const char* longopts, - const char* datatype, - const char* glossary); -struct arg_dbl* arg_dbl1(const char* shortopts, - const char* longopts, - const char* datatype, - const char *glossary); -struct arg_dbl* arg_dbln(const char* shortopts, - const char* longopts, - const char *datatype, - int mincount, - int maxcount, - const char *glossary); - -struct arg_str* arg_str0(const char* shortopts, - const char* longopts, - const char* datatype, - const char* glossary); -struct arg_str* arg_str1(const char* shortopts, - const char* longopts, - const char* datatype, - const char *glossary); -struct arg_str* arg_strn(const char* shortopts, - const char* longopts, - const char* datatype, - int mincount, - int maxcount, - const char *glossary); - -struct arg_rex* arg_rex0(const char* shortopts, - const char* longopts, - const char* pattern, - const char* datatype, - int flags, - const char* glossary); -struct arg_rex* arg_rex1(const char* shortopts, - const char* longopts, - const char* pattern, - const char* datatype, - int flags, - const char *glossary); -struct arg_rex* arg_rexn(const char* shortopts, - const char* longopts, - const char* pattern, - const char* datatype, - int mincount, - int maxcount, - int flags, - const char *glossary); - -struct arg_file* arg_file0(const char* shortopts, - const char* longopts, - const char* datatype, - const char* glossary); -struct arg_file* arg_file1(const char* shortopts, - const char* longopts, - const char* datatype, - const char *glossary); -struct arg_file* arg_filen(const char* shortopts, - const char* longopts, - const char* datatype, - int mincount, - int maxcount, - const char *glossary); - -struct arg_date* arg_date0(const char* shortopts, - const char* longopts, - const char* format, - const char* datatype, - const char* glossary); -struct arg_date* arg_date1(const char* shortopts, - const char* longopts, - const char* format, - const char* datatype, - const char *glossary); -struct arg_date* arg_daten(const char* shortopts, - const char* longopts, - const char* format, - const char* datatype, - int mincount, - int maxcount, - const char *glossary); - -struct arg_end* arg_end(int maxerrors); - - -/**** other functions *******************************************/ -int arg_nullcheck(void **argtable); -int arg_parse(int argc, char **argv, void **argtable); -void arg_print_option(FILE *fp, const char *shortopts, const char *longopts, const char *datatype, const char *suffix); -void arg_print_syntax(FILE *fp, void **argtable, const char *suffix); -void arg_print_syntaxv(FILE *fp, void **argtable, const char *suffix); -void arg_print_glossary(FILE *fp, void **argtable, const char *format); -void arg_print_glossary_gnu(FILE *fp, void **argtable); -void arg_print_errors(FILE* fp, struct arg_end* end, const char* progname); -void arg_freetable(void **argtable, size_t n); -void arg_print_formatted(FILE *fp, const unsigned lmargin, const unsigned rmargin, const char *text); - -/**** deprecated functions, for back-compatibility only ********/ -void arg_free(void **argtable); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/tools/sdk/include/console/esp_console.h b/tools/sdk/include/console/esp_console.h deleted file mode 100644 index 45a10b7a2ed..00000000000 --- a/tools/sdk/include/console/esp_console.h +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright 2016-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. -#pragma once - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include -#include "esp_err.h" - -// Forward declaration. Definition in linenoise/linenoise.h. -typedef struct linenoiseCompletions linenoiseCompletions; - -/** - * @brief Parameters for console initialization - */ -typedef struct { - size_t max_cmdline_length; //!< length of command line buffer, in bytes - size_t max_cmdline_args; //!< maximum number of command line arguments to parse - int hint_color; //!< ASCII color code of hint text - int hint_bold; //!< Set to 1 to print hint text in bold -} esp_console_config_t; - -/** - * @brief initialize console module - * Call this once before using other console module features - * @return - * - ESP_OK on success - * - ESP_ERR_NO_MEM if out of memory - * - ESP_ERR_INVALID_STATE if already initialized - */ -esp_err_t esp_console_init(const esp_console_config_t* config); - - -/** - * @brief de-initialize console module - * Call this once when done using console module functions - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if not initialized yet - */ -esp_err_t esp_console_deinit(); - - -/** - * @brief Console command main function - * @param argc number of arguments - * @param argv array with argc entries, each pointing to a zero-terminated string argument - * @return console command return code, 0 indicates "success" - */ -typedef int (*esp_console_cmd_func_t)(int argc, char** argv); - -/** - * @brief Console command description - */ -typedef struct { - /** - * Command name. Must not be NULL, must not contain spaces. - * The pointer must be valid until the call to esp_console_deinit. - */ - const char* command; //!< command name - /** - * Help text for the command, shown by help command. - * If set, the pointer must be valid until the call to esp_console_deinit. - * If not set, the command will not be listed in 'help' output. - */ - const char* help; - /** - * Hint text, usually lists possible arguments. - * If set to NULL, and 'argtable' field is non-NULL, hint will be generated - * automatically - */ - const char* hint; - /** - * Pointer to a function which implements the command. - */ - esp_console_cmd_func_t func; - /** - * Array or structure of pointers to arg_xxx structures, may be NULL. - * Used to generate hint text if 'hint' is set to NULL. - * Array/structure which this field points to must end with an arg_end. - * Only used for the duration of esp_console_cmd_register call. - */ - void* argtable; -} esp_console_cmd_t; - -/** - * @brief Register console command - * @param cmd pointer to the command description; can point to a temporary value - * @return - * - ESP_OK on success - * - ESP_ERR_NO_MEM if out of memory - */ -esp_err_t esp_console_cmd_register(const esp_console_cmd_t *cmd); - -/** - * @brief Run command line - * @param cmdline command line (command name followed by a number of arguments) - * @param[out] cmd_ret return code from the command (set if command was run) - * @return - * - ESP_OK, if command was run - * - ESP_ERR_INVALID_ARG, if the command line is empty, or only contained - * whitespace - * - ESP_ERR_NOT_FOUND, if command with given name wasn't registered - * - ESP_ERR_INVALID_STATE, if esp_console_init wasn't called - */ -esp_err_t esp_console_run(const char* cmdline, int* cmd_ret); - -/** - * @brief Split command line into arguments in place - * - * - This function finds whitespace-separated arguments in the given input line. - * - * 'abc def 1 20 .3' -> [ 'abc', 'def', '1', '20', '.3' ] - * - * - Argument which include spaces may be surrounded with quotes. In this case - * spaces are preserved and quotes are stripped. - * - * 'abc "123 456" def' -> [ 'abc', '123 456', 'def' ] - * - * - Escape sequences may be used to produce backslash, double quote, and space: - * - * 'a\ b\\c\"' -> [ 'a b\c"' ] - * - * Pointers to at most argv_size - 1 arguments are returned in argv array. - * The pointer after the last one (i.e. argv[argc]) is set to NULL. - * - * @param line pointer to buffer to parse; it is modified in place - * @param argv array where the pointers to arguments are written - * @param argv_size number of elements in argv_array (max. number of arguments) - * @return number of arguments found (argc) - */ -size_t esp_console_split_argv(char *line, char **argv, size_t argv_size); - -/** - * @brief Callback which provides command completion for linenoise library - * - * When using linenoise for line editing, command completion support - * can be enabled like this: - * - * linenoiseSetCompletionCallback(&esp_console_get_completion); - * - * @param buf the string typed by the user - * @param lc linenoiseCompletions to be filled in - */ -void esp_console_get_completion(const char *buf, linenoiseCompletions *lc); - -/** - * @brief Callback which provides command hints for linenoise library - * - * When using linenoise for line editing, hints support can be enabled as - * follows: - * - * linenoiseSetHintsCallback((linenoiseHintsCallback*) &esp_console_get_hint); - * - * The extra cast is needed because linenoiseHintsCallback is defined as - * returning a char* instead of const char*. - * - * @param buf line typed by the user - * @param[out] color ANSI color code to be used when displaying the hint - * @param[out] bold set to 1 if hint has to be displayed in bold - * @return string containing the hint text. This string is persistent and should - * not be freed (i.e. linenoiseSetFreeHintsCallback should not be used). - */ -const char *esp_console_get_hint(const char *buf, int *color, int *bold); - -/** - * @brief Register a 'help' command - * Default 'help' command prints the list of registered commands along with - * hints and help strings. - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE, if esp_console_init wasn't called - */ -esp_err_t esp_console_register_help_command(); - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/console/linenoise/linenoise.h b/tools/sdk/include/console/linenoise/linenoise.h deleted file mode 100644 index a82701f835b..00000000000 --- a/tools/sdk/include/console/linenoise/linenoise.h +++ /dev/null @@ -1,76 +0,0 @@ -/* linenoise.h -- VERSION 1.0 - * - * Guerrilla line editing library against the idea that a line editing lib - * needs to be 20,000 lines of C code. - * - * See linenoise.c for more information. - * - * ------------------------------------------------------------------------ - * - * Copyright (c) 2010-2014, Salvatore Sanfilippo - * Copyright (c) 2010-2013, Pieter Noordhuis - * - * All rights reserved. - * - * 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. - * - * 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 - * HOLDER 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 __LINENOISE_H -#define __LINENOISE_H - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct linenoiseCompletions { - size_t len; - char **cvec; -} linenoiseCompletions; - -typedef void(linenoiseCompletionCallback)(const char *, linenoiseCompletions *); -typedef char*(linenoiseHintsCallback)(const char *, int *color, int *bold); -typedef void(linenoiseFreeHintsCallback)(void *); -void linenoiseSetCompletionCallback(linenoiseCompletionCallback *); -void linenoiseSetHintsCallback(linenoiseHintsCallback *); -void linenoiseSetFreeHintsCallback(linenoiseFreeHintsCallback *); -void linenoiseAddCompletion(linenoiseCompletions *, const char *); - -int linenoiseProbe(void); -char *linenoise(const char *prompt); -void linenoiseFree(void *ptr); -int linenoiseHistoryAdd(const char *line); -int linenoiseHistorySetMaxLen(int len); -int linenoiseHistorySave(const char *filename); -int linenoiseHistoryLoad(const char *filename); -void linenoiseHistoryFree(); -void linenoiseClearScreen(void); -void linenoiseSetMultiLine(int ml); -void linenoiseSetDumbMode(int set); -void linenoisePrintKeyCodes(void); - -#ifdef __cplusplus -} -#endif - -#endif /* __LINENOISE_H */ diff --git a/tools/sdk/include/driver/driver/adc.h b/tools/sdk/include/driver/driver/adc.h deleted file mode 100644 index b5a9a9848e3..00000000000 --- a/tools/sdk/include/driver/driver/adc.h +++ /dev/null @@ -1,408 +0,0 @@ -// 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. - -#ifndef _DRIVER_ADC_H_ -#define _DRIVER_ADC_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include "esp_err.h" -#include "driver/gpio.h" -#include "soc/adc_channel.h" - -typedef enum { - ADC_ATTEN_DB_0 = 0, /*!0dB signal attenuation for that ADC channel. - * - * When VDD_A is 3.3V: - * - * - 0dB attenuaton (ADC_ATTEN_DB_0) gives full-scale voltage 1.1V - * - 2.5dB attenuation (ADC_ATTEN_DB_2_5) gives full-scale voltage 1.5V - * - 6dB attenuation (ADC_ATTEN_DB_6) gives full-scale voltage 2.2V - * - 11dB attenuation (ADC_ATTEN_DB_11) gives full-scale voltage 3.9V (see note below) - * - * @note The full-scale voltage is the voltage corresponding to a maximum reading (depending on ADC1 configured - * bit width, this value is: 4095 for 12-bits, 2047 for 11-bits, 1023 for 10-bits, 511 for 9 bits.) - * - * @note At 11dB attenuation the maximum voltage is limited by VDD_A, not the full scale voltage. - * - * Due to ADC characteristics, most accurate results are obtained within the following approximate voltage ranges: - * - * - 0dB attenuaton (ADC_ATTEN_DB_0) between 100 and 950mV - * - 2.5dB attenuation (ADC_ATTEN_DB_2_5) between 100 and 1250mV - * - 6dB attenuation (ADC_ATTEN_DB_6) between 150 to 1750mV - * - 11dB attenuation (ADC_ATTEN_DB_11) between 150 to 2450mV - * - * For maximum accuracy, use the ADC calibration APIs and measure voltages within these recommended ranges. - * - * @param channel ADC1 channel to configure - * @param atten Attenuation level - * - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t adc1_config_channel_atten(adc1_channel_t channel, adc_atten_t atten); - -/** - * @brief Take an ADC1 reading from a single channel. - * @note When the power switch of SARADC1, SARADC2, HALL sensor and AMP sensor is turned on, - * the input of GPIO36 and GPIO39 will be pulled down for about 80ns. - * When enabling power for any of these peripherals, ignore input from GPIO36 and GPIO39. - * Please refer to section 3.11 of 'ECO_and_Workarounds_for_Bugs_in_ESP32' for the description of this issue. - * - * @note Call adc1_config_width() before the first time this - * function is called. - * - * @note For any given channel, adc1_config_channel_atten(channel) - * must be called before the first time this function is called. Configuring - * a new channel does not prevent a previously configured channel from being read. - * - * @param channel ADC1 channel to read - * - * @return - * - -1: Parameter error - * - Other: ADC1 channel reading. - */ -int adc1_get_raw(adc1_channel_t channel); - -/** @cond */ //Doxygen command to hide deprecated function from API Reference -/* - * @note When the power switch of SARADC1, SARADC2, HALL sensor and AMP sensor is turned on, - * the input of GPIO36 and GPIO39 will be pulled down for about 80ns. - * When enabling power for any of these peripherals, ignore input from GPIO36 and GPIO39. - * Please refer to section 3.11 of 'ECO_and_Workarounds_for_Bugs_in_ESP32' for the description of this issue. - * - * @deprecated This function returns an ADC1 reading but is deprecated due to - * a misleading name and has been changed to directly call the new function. - * Use the new function adc1_get_raw() instead - */ -int adc1_get_voltage(adc1_channel_t channel) __attribute__((deprecated)); -/** @endcond */ - -/** - * @brief Enable ADC power - */ -void adc_power_on(); - -/** - * @brief Power off SAR ADC - * This function will force power down for ADC - */ -void adc_power_off(); - -/** - * @brief Initialize ADC pad - * @param adc_unit ADC unit index - * @param channel ADC channel index - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t adc_gpio_init(adc_unit_t adc_unit, adc_channel_t channel); - -/** - * @brief Set ADC data invert - * @param adc_unit ADC unit index - * @param inv_en whether enable data invert - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t adc_set_data_inv(adc_unit_t adc_unit, bool inv_en); - -/** - * @brief Set ADC source clock - * @param clk_div ADC clock divider, ADC clock is divided from APB clock - * @return - * - ESP_OK success - */ -esp_err_t adc_set_clk_div(uint8_t clk_div); - -/** - * @brief Set I2S data source - * @param src I2S DMA data source, I2S DMA can get data from digital signals or from ADC. - * @return - * - ESP_OK success - */ -esp_err_t adc_set_i2s_data_source(adc_i2s_source_t src); - -/** - * @brief Initialize I2S ADC mode - * @param adc_unit ADC unit index - * @param channel ADC channel index - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t adc_i2s_mode_init(adc_unit_t adc_unit, adc_channel_t channel); - -/** - * @brief Configure ADC1 to be usable by the ULP - * - * This function reconfigures ADC1 to be controlled by the ULP. - * Effect of this function can be reverted using adc1_get_raw function. - * - * Note that adc1_config_channel_atten, adc1_config_width functions need - * to be called to configure ADC1 channels, before ADC1 is used by the ULP. - */ -void adc1_ulp_enable(); - -/** - * @brief Read Hall Sensor - * - * @note When the power switch of SARADC1, SARADC2, HALL sensor and AMP sensor is turned on, - * the input of GPIO36 and GPIO39 will be pulled down for about 80ns. - * When enabling power for any of these peripherals, ignore input from GPIO36 and GPIO39. - * Please refer to section 3.11 of 'ECO_and_Workarounds_for_Bugs_in_ESP32' for the description of this issue. - * - * @note The Hall Sensor uses channels 0 and 3 of ADC1. Do not configure - * these channels for use as ADC channels. - * - * @note The ADC1 module must be enabled by calling - * adc1_config_width() before calling hall_sensor_read(). ADC1 - * should be configured for 12 bit readings, as the hall sensor - * readings are low values and do not cover the full range of the - * ADC. - * - * @return The hall sensor reading. - */ -int hall_sensor_read(); - -/** - * @brief Get the gpio number of a specific ADC2 channel. - * - * @param channel Channel to get the gpio number - * - * @param gpio_num output buffer to hold the gpio number - * - * @return - * - ESP_OK if success - * - ESP_ERR_INVALID_ARG if channal not valid - */ -esp_err_t adc2_pad_get_io_num(adc2_channel_t channel, gpio_num_t *gpio_num); - -/** - * @brief Configure the ADC2 channel, including setting attenuation. - * - * @note This function also configures the input GPIO pin mux to - * connect it to the ADC2 channel. It must be called before calling - * ``adc2_get_raw()`` for this channel. - * - * The default ADC full-scale voltage is 1.1V. To read higher voltages (up to the pin maximum voltage, - * usually 3.3V) requires setting >0dB signal attenuation for that ADC channel. - * - * When VDD_A is 3.3V: - * - * - 0dB attenuaton (ADC_ATTEN_0db) gives full-scale voltage 1.1V - * - 2.5dB attenuation (ADC_ATTEN_2_5db) gives full-scale voltage 1.5V - * - 6dB attenuation (ADC_ATTEN_6db) gives full-scale voltage 2.2V - * - 11dB attenuation (ADC_ATTEN_11db) gives full-scale voltage 3.9V (see note below) - * - * @note The full-scale voltage is the voltage corresponding to a maximum reading - * (depending on ADC2 configured bit width, this value is: 4095 for 12-bits, 2047 - * for 11-bits, 1023 for 10-bits, 511 for 9 bits.) - * - * @note At 11dB attenuation the maximum voltage is limited by VDD_A, not the full scale voltage. - * - * @param channel ADC2 channel to configure - * @param atten Attenuation level - * - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t adc2_config_channel_atten(adc2_channel_t channel, adc_atten_t atten); - -/** - * @brief Take an ADC2 reading on a single channel - * - * @note When the power switch of SARADC1, SARADC2, HALL sensor and AMP sensor is turned on, - * the input of GPIO36 and GPIO39 will be pulled down for about 80ns. - * When enabling power for any of these peripherals, ignore input from GPIO36 and GPIO39. - * Please refer to section 3.11 of 'ECO_and_Workarounds_for_Bugs_in_ESP32' for the description of this issue. - * - * @note For a given channel, ``adc2_config_channel_atten()`` - * must be called before the first time this function is called. If Wi-Fi is started via ``esp_wifi_start()``, this - * function will always fail with ``ESP_ERR_TIMEOUT``. - * - * @param channel ADC2 channel to read - * - * @param width_bit Bit capture width for ADC2 - * - * @param raw_out the variable to hold the output data. - * - * @return - * - ESP_OK if success - * - ESP_ERR_TIMEOUT the WIFI is started, using the ADC2 - */ -esp_err_t adc2_get_raw(adc2_channel_t channel, adc_bits_width_t width_bit, int* raw_out); - -/** - * @brief Output ADC2 reference voltage to gpio 25 or 26 or 27 - * - * This function utilizes the testing mux exclusive to ADC 2 to route the - * reference voltage one of ADC2's channels. Supported gpios are gpios - * 25, 26, and 27. This refernce voltage can be manually read from the pin - * and used in the esp_adc_cal component. - * - * @param[in] gpio GPIO number (gpios 25,26,27 supported) - * - * @return - * - ESP_OK: v_ref successfully routed to selected gpio - * - ESP_ERR_INVALID_ARG: Unsupported gpio - */ -esp_err_t adc2_vref_to_gpio(gpio_num_t gpio); - -#ifdef __cplusplus -} -#endif - -#endif /*_DRIVER_ADC_H_*/ - diff --git a/tools/sdk/include/driver/driver/adc2_wifi_internal.h b/tools/sdk/include/driver/driver/adc2_wifi_internal.h deleted file mode 100644 index ba5c32ead94..00000000000 --- a/tools/sdk/include/driver/driver/adc2_wifi_internal.h +++ /dev/null @@ -1,52 +0,0 @@ -// 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. - -#ifndef _DRIVER_ADC2_INTERNAL_H_ -#define _DRIVER_ADC2_INTERNAL_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "esp_err.h" - -/** - * @brief For WIFI module to claim the usage of ADC2. - * - * Other tasks will be forbidden to use ADC2 between ``adc2_wifi_acquire`` and ``adc2_wifi_release``. - * The WIFI module may have to wait for a short time for the current conversion (if exist) to finish. - * - * @return - * - ESP_OK success - * - ESP_ERR_TIMEOUT reserved for future use. Currently the function will wait until success. - */ -esp_err_t adc2_wifi_acquire(); - - -/** - * @brief For WIFI module to let other tasks use the ADC2 when WIFI is not work. - * - * Other tasks will be forbidden to use ADC2 between ``adc2_wifi_acquire`` and ``adc2_wifi_release``. - * Call this function to release the occupation of ADC2 by WIFI. - * - * @return always return ESP_OK. - */ -esp_err_t adc2_wifi_release(); - -#ifdef __cplusplus -} -#endif - -#endif /*_DRIVER_ADC2_INTERNAL_H_*/ - diff --git a/tools/sdk/include/driver/driver/can.h b/tools/sdk/include/driver/driver/can.h deleted file mode 100644 index af7b66e0b57..00000000000 --- a/tools/sdk/include/driver/driver/can.h +++ /dev/null @@ -1,400 +0,0 @@ -// 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. - -#ifndef _DRIVER_CAN_H_ -#define _DRIVER_CAN_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "esp_types.h" -#include "esp_intr.h" -#include "esp_err.h" -#include "gpio.h" - -/* -------------------- Default initializers and flags ---------------------- */ -/** @cond */ //Doxy command to hide preprocessor definitions from docs -/** - * @brief Initializer macro for general configuration structure. - * - * This initializer macros allows the TX GPIO, RX GPIO, and operating mode to be - * configured. The other members of the general configuration structure are - * assigned default values. - */ -#define CAN_GENERAL_CONFIG_DEFAULT(tx_io_num, rx_io_num, op_mode) {.mode = op_mode, .tx_io = tx_io_num, .rx_io = rx_io_num, \ - .clkout_io = CAN_IO_UNUSED, .bus_off_io = CAN_IO_UNUSED, \ - .tx_queue_len = 5, .rx_queue_len = 5, \ - .alerts_enabled = CAN_ALERT_NONE, .clkout_divider = 0, } - -/** - * @brief Initializer macros for timing configuration structure - * - * The following initializer macros offer commonly found bit rates. - * - * @note These timing values are based on the assumption APB clock is at 80MHz - */ -#define CAN_TIMING_CONFIG_25KBITS() {.brp = 128, .tseg_1 = 16, .tseg_2 = 8, .sjw = 3, .triple_sampling = false} -#define CAN_TIMING_CONFIG_50KBITS() {.brp = 80, .tseg_1 = 15, .tseg_2 = 4, .sjw = 3, .triple_sampling = false} -#define CAN_TIMING_CONFIG_100KBITS() {.brp = 40, .tseg_1 = 15, .tseg_2 = 4, .sjw = 3, .triple_sampling = false} -#define CAN_TIMING_CONFIG_125KBITS() {.brp = 32, .tseg_1 = 15, .tseg_2 = 4, .sjw = 3, .triple_sampling = false} -#define CAN_TIMING_CONFIG_250KBITS() {.brp = 16, .tseg_1 = 15, .tseg_2 = 4, .sjw = 3, .triple_sampling = false} -#define CAN_TIMING_CONFIG_500KBITS() {.brp = 8, .tseg_1 = 15, .tseg_2 = 4, .sjw = 3, .triple_sampling = false} -#define CAN_TIMING_CONFIG_800KBITS() {.brp = 4, .tseg_1 = 16, .tseg_2 = 8, .sjw = 3, .triple_sampling = false} -#define CAN_TIMING_CONFIG_1MBITS() {.brp = 4, .tseg_1 = 15, .tseg_2 = 4, .sjw = 3, .triple_sampling = false} - -/** - * @brief Initializer macro for filter configuration to accept all IDs - */ -#define CAN_FILTER_CONFIG_ACCEPT_ALL() {.acceptance_code = 0, .acceptance_mask = 0xFFFFFFFF, .single_filter = true} - -/** - * @brief Alert flags - * - * The following flags represents the various kind of alerts available in - * the CAN driver. These flags can be used when configuring/reconfiguring - * alerts, or when calling can_read_alerts(). - * - * @note The CAN_ALERT_AND_LOG flag is not an actual alert, but will configure - * the CAN driver to log to UART when an enabled alert occurs. - */ -#define CAN_ALERT_TX_IDLE 0x0001 /**< Alert(1): No more messages to transmit */ -#define CAN_ALERT_TX_SUCCESS 0x0002 /**< Alert(2): The previous transmission was successful */ -#define CAN_ALERT_BELOW_ERR_WARN 0x0004 /**< Alert(4): Both error counters have dropped below error warning limit */ -#define CAN_ALERT_ERR_ACTIVE 0x0008 /**< Alert(8): CAN controller has become error active */ -#define CAN_ALERT_RECOVERY_IN_PROGRESS 0x0010 /**< Alert(16): CAN controller is undergoing bus recovery */ -#define CAN_ALERT_BUS_RECOVERED 0x0020 /**< Alert(32): CAN controller has successfully completed bus recovery */ -#define CAN_ALERT_ARB_LOST 0x0040 /**< Alert(64): The previous transmission lost arbitration */ -#define CAN_ALERT_ABOVE_ERR_WARN 0x0080 /**< Alert(128): One of the error counters have exceeded the error warning limit */ -#define CAN_ALERT_BUS_ERROR 0x0100 /**< Alert(256): A (Bit, Stuff, CRC, Form, ACK) error has occurred on the bus */ -#define CAN_ALERT_TX_FAILED 0x0200 /**< Alert(512): The previous transmission has failed (for single shot transmission) */ -#define CAN_ALERT_RX_QUEUE_FULL 0x0400 /**< Alert(1024): The RX queue is full causing a frame to be lost */ -#define CAN_ALERT_ERR_PASS 0x0800 /**< Alert(2048): CAN controller has become error passive */ -#define CAN_ALERT_BUS_OFF 0x1000 /**< Alert(4096): Bus-off condition occurred. CAN controller can no longer influence bus */ -#define CAN_ALERT_ALL 0x1FFF /**< Bit mask to enable all alerts during configuration */ -#define CAN_ALERT_NONE 0x0000 /**< Bit mask to disable all alerts during configuration */ -#define CAN_ALERT_AND_LOG 0x2000 /**< Bit mask to enable alerts to also be logged when they occur */ - -/** - * @brief Message flags - * - * The message flags are used to indicate the type of message transmitted/received. - * Some flags also specify the type of transmission. - */ -#define CAN_MSG_FLAG_NONE 0x00 /**< No message flags (Standard Frame Format) */ -#define CAN_MSG_FLAG_EXTD 0x01 /**< Extended Frame Format (29bit ID) */ -#define CAN_MSG_FLAG_RTR 0x02 /**< Message is a Remote Transmit Request */ -#define CAN_MSG_FLAG_SS 0x04 /**< Transmit as a Single Shot Transmission */ -#define CAN_MSG_FLAG_SELF 0x08 /**< Transmit as a Self Reception Request */ -#define CAN_MSG_FLAG_DLC_NON_COMP 0x10 /**< Message's Data length code is larger than 8. This will break compliance with CAN2.0B */ - -/** - * @brief Miscellaneous macros - */ -#define CAN_EXTD_ID_MASK 0x1FFFFFFF /**< Bit mask for 29 bit Extended Frame Format ID */ -#define CAN_STD_ID_MASK 0x7FF /**< Bit mask for 11 bit Standard Frame Format ID */ -#define CAN_MAX_DATA_LEN 8 /**< Maximum number of data bytes in a CAN2.0B frame */ -#define CAN_IO_UNUSED (-1) /**< Marks GPIO as unused in CAN configuration */ -/** @endcond */ - -/* ----------------------- Enum and Struct Definitions ---------------------- */ - -/** - * @brief CAN driver operating modes - */ -typedef enum { - CAN_MODE_NORMAL, /**< Normal operating mode where CAN controller can send/receive/acknowledge messages */ - CAN_MODE_NO_ACK, /**< Transmission does not require acknowledgment. Use this mode for self testing */ - CAN_MODE_LISTEN_ONLY, /**< The CAN controller will not influence the bus (No transmissions or acknowledgments) but can receive messages */ -} can_mode_t; - -/** - * @brief CAN driver states - */ -typedef enum { - CAN_STATE_STOPPED, /**< Stopped state. The CAN controller will not participate in any CAN bus activities */ - CAN_STATE_RUNNING, /**< Running state. The CAN controller can transmit and receive messages */ - CAN_STATE_BUS_OFF, /**< Bus-off state. The CAN controller cannot participate in bus activities until it has recovered */ - CAN_STATE_RECOVERING, /**< Recovering state. The CAN controller is undergoing bus recovery */ -} can_state_t; - -/** - * @brief Structure for general configuration of the CAN driver - * - * @note Macro initializers are available for this structure - */ -typedef struct { - can_mode_t mode; /**< Mode of CAN controller */ - gpio_num_t tx_io; /**< Transmit GPIO number */ - gpio_num_t rx_io; /**< Receive GPIO number */ - gpio_num_t clkout_io; /**< CLKOUT GPIO number (optional, set to -1 if unused) */ - gpio_num_t bus_off_io; /**< Bus off indicator GPIO number (optional, set to -1 if unused) */ - uint32_t tx_queue_len; /**< Number of messages TX queue can hold (set to 0 to disable TX Queue) */ - uint32_t rx_queue_len; /**< Number of messages RX queue can hold */ - uint32_t alerts_enabled; /**< Bit field of alerts to enable (see documentation) */ - uint32_t clkout_divider; /**< CLKOUT divider. Can be 1 or any even number from 2 to 14 (optional, set to 0 if unused) */ -} can_general_config_t; - -/** - * @brief Structure for bit timing configuration of the CAN driver - * - * @note Macro initializers are available for this structure - */ -typedef struct { - uint8_t brp; /**< Baudrate prescaler (APB clock divider, even number from 2 to 128) */ - uint8_t tseg_1; /**< Timing segment 1 (Number of time quanta, between 1 to 16) */ - uint8_t tseg_2; /**< Timing segment 2 (Number of time quanta, 1 to 8) */ - uint8_t sjw; /**< Synchronization Jump Width (Max time quanta jump for synchronize from 1 to 4) */ - bool triple_sampling; /**< Enables triple sampling when the CAN controller samples a bit */ -} can_timing_config_t; - -/** - * @brief Structure for acceptance filter configuration of the CAN driver (see documentation) - * - * @note Macro initializers are available for this structure - */ -typedef struct { - uint32_t acceptance_code; /**< 32-bit acceptance code */ - uint32_t acceptance_mask; /**< 32-bit acceptance mask */ - bool single_filter; /**< Use Single Filter Mode (see documentation) */ -} can_filter_config_t; - -/** - * @brief Structure to store status information of CAN driver - */ -typedef struct { - can_state_t state; /**< Current state of CAN controller (Stopped/Running/Bus-Off/Recovery) */ - uint32_t msgs_to_tx; /**< Number of messages queued for transmission or awaiting transmission completion */ - uint32_t msgs_to_rx; /**< Number of messages in RX queue waiting to be read */ - uint32_t tx_error_counter; /**< Current value of Transmit Error Counter */ - uint32_t rx_error_counter; /**< Current value of Receive Error Counter */ - uint32_t tx_failed_count; /**< Number of messages that failed transmissions */ - uint32_t rx_missed_count; /**< Number of messages that were lost due to a full RX queue */ - uint32_t arb_lost_count; /**< Number of instances arbitration was lost */ - uint32_t bus_error_count; /**< Number of instances a bus error has occurred */ -} can_status_info_t; - -/** - * @brief Structure to store a CAN message - * - * @note The flags member is used to control the message type, and transmission - * type (see documentation for message flags) - */ -typedef struct { - uint32_t flags; /**< Bit field of message flags indicates frame/transmission type (see documentation) */ - uint32_t identifier; /**< 11 or 29 bit identifier */ - uint8_t data_length_code; /**< Data length code */ - uint8_t data[CAN_MAX_DATA_LEN]; /**< Data bytes (not relevant in RTR frame) */ -} can_message_t; - -/* ----------------------------- Public API -------------------------------- */ - -/** - * @brief Install CAN driver - * - * This function installs the CAN driver using three configuration structures. - * The required memory is allocated and the CAN driver is placed in the stopped - * state after running this function. - * - * @param[in] g_config General configuration structure - * @param[in] t_config Timing configuration structure - * @param[in] f_config Filter configuration structure - * - * @note Macro initializers are available for the configuration structures (see documentation) - * - * @note To reinstall the CAN driver, call can_driver_uninstall() first - * - * @return - * - ESP_OK: Successfully installed CAN driver - * - ESP_ERR_INVALID_ARG: Arguments are invalid - * - ESP_ERR_NO_MEM: Insufficient memory - * - ESP_ERR_INVALID_STATE: Driver is already installed - */ -esp_err_t can_driver_install(const can_general_config_t *g_config, const can_timing_config_t *t_config, const can_filter_config_t *f_config); - -/** - * @brief Uninstall the CAN driver - * - * This function uninstalls the CAN driver, freeing the memory utilized by the - * driver. This function can only be called when the driver is in the stopped - * state or the bus-off state. - * - * @warning The application must ensure that no tasks are blocked on TX/RX - * queues or alerts when this function is called. - * - * @return - * - ESP_OK: Successfully uninstalled CAN driver - * - ESP_ERR_INVALID_STATE: Driver is not in stopped/bus-off state, or is not installed - */ -esp_err_t can_driver_uninstall(); - -/** - * @brief Start the CAN driver - * - * This function starts the CAN driver, putting the CAN driver into the running - * state. This allows the CAN driver to participate in CAN bus activities such - * as transmitting/receiving messages. The RX queue is reset in this function, - * clearing any unread messages. This function can only be called when the CAN - * driver is in the stopped state. - * - * @return - * - ESP_OK: CAN driver is now running - * - ESP_ERR_INVALID_STATE: Driver is not in stopped state, or is not installed - */ -esp_err_t can_start(); - -/** - * @brief Stop the CAN driver - * - * This function stops the CAN driver, preventing any further message from being - * transmitted or received until can_start() is called. Any messages in the TX - * queue are cleared. Any messages in the RX queue should be read by the - * application after this function is called. This function can only be called - * when the CAN driver is in the running state. - * - * @warning A message currently being transmitted/received on the CAN bus will - * be ceased immediately. This may lead to other CAN nodes interpreting - * the unfinished message as an error. - * - * @return - * - ESP_OK: CAN driver is now Stopped - * - ESP_ERR_INVALID_STATE: Driver is not in running state, or is not installed - */ -esp_err_t can_stop(); - -/** - * @brief Transmit a CAN message - * - * This function queues a CAN message for transmission. Transmission will start - * immediately if no other messages are queued for transmission. If the TX queue - * is full, this function will block until more space becomes available or until - * it timesout. If the TX queue is disabled (TX queue length = 0 in configuration), - * this function will return immediately if another message is undergoing - * transmission. This function can only be called when the CAN driver is in the - * running state and cannot be called under Listen Only Mode. - * - * @param[in] message Message to transmit - * @param[in] ticks_to_wait Number of FreeRTOS ticks to block on the TX queue - * - * @note This function does not guarantee that the transmission is successful. - * The TX_SUCCESS/TX_FAILED alert can be enabled to alert the application - * upon the success/failure of a transmission. - * - * @note The TX_IDLE alert can be used to alert the application when no other - * messages are awaiting transmission. - * - * @return - * - ESP_OK: Transmission successfully queued/initiated - * - ESP_ERR_INVALID_ARG: Arguments are invalid - * - ESP_ERR_TIMEOUT: Timed out waiting for space on TX queue - * - ESP_FAIL: TX queue is disabled and another message is currently transmitting - * - ESP_ERR_INVALID_STATE: CAN driver is not in running state, or is not installed - * - ESP_ERR_NOT_SUPPORTED: Listen Only Mode does not support transmissions - */ -esp_err_t can_transmit(const can_message_t *message, TickType_t ticks_to_wait); - -/** - * @brief Receive a CAN message - * - * This function receives a message from the RX queue. The flags field of the - * message structure will indicate the type of message received. This function - * will block if there are no messages in the RX queue - * - * @param[out] message Received message - * @param[in] ticks_to_wait Number of FreeRTOS ticks to block on RX queue - * - * @warning The flags field of the received message should be checked to determine - * if the received message contains any data bytes. - * - * @return - * - ESP_OK: Message successfully received from RX queue - * - ESP_ERR_TIMEOUT: Timed out waiting for message - * - ESP_ERR_INVALID_ARG: Arguments are invalid - * - ESP_ERR_INVALID_STATE: CAN driver is not installed - */ -esp_err_t can_receive(can_message_t *message, TickType_t ticks_to_wait); - -/** - * @brief Read CAN driver alerts - * - * This function will read the alerts raised by the CAN driver. If no alert has - * been when this function is called, this function will block until an alert - * occurs or until it timeouts. - * - * @param[out] alerts Bit field of raised alerts (see documentation for alert flags) - * @param[in] ticks_to_wait Number of FreeRTOS ticks to block for alert - * - * @note Multiple alerts can be raised simultaneously. The application should - * check for all alerts that have been enabled. - * - * @return - * - ESP_OK: Alerts read - * - ESP_ERR_TIMEOUT: Timed out waiting for alerts - * - ESP_ERR_INVALID_ARG: Arguments are invalid - * - ESP_ERR_INVALID_STATE: CAN driver is not installed - */ -esp_err_t can_read_alerts(uint32_t *alerts, TickType_t ticks_to_wait); - -/** - * @brief Reconfigure which alerts are enabled - * - * This function reconfigures which alerts are enabled. If there are alerts - * which have not been read whilst reconfiguring, this function can read those - * alerts. - * - * @param[in] alerts_enabled Bit field of alerts to enable (see documentation for alert flags) - * @param[out] current_alerts Bit field of currently raised alerts. Set to NULL if unused - * - * @return - * - ESP_OK: Alerts reconfigured - * - ESP_ERR_INVALID_STATE: CAN driver is not installed - */ -esp_err_t can_reconfigure_alerts(uint32_t alerts_enabled, uint32_t *current_alerts); - -/** - * @brief Start the bus recovery process - * - * This function initiates the bus recovery process when the CAN driver is in - * the bus-off state. Once initiated, the CAN driver will enter the recovering - * state and wait for 128 occurrences of the bus-free signal on the CAN bus - * before returning to the stopped state. This function will reset the TX queue, - * clearing any messages pending transmission. - * - * @note The BUS_RECOVERED alert can be enabled to alert the application when - * the bus recovery process completes. - * - * @return - * - ESP_OK: Bus recovery started - * - ESP_ERR_INVALID_STATE: CAN driver is not in the bus-off state, or is not installed - */ -esp_err_t can_initiate_recovery(); - -/** - * @brief Get current status information of the CAN driver - * - * @param[out] status_info Status information - * - * @return - * - ESP_OK: Status information retrieved - * - ESP_ERR_INVALID_ARG: Arguments are invalid - * - ESP_ERR_INVALID_STATE: CAN driver is not installed - */ -esp_err_t can_get_status_info(can_status_info_t *status_info); - -#ifdef __cplusplus -} -#endif - -#endif /*_DRIVER_CAN_H_*/ - diff --git a/tools/sdk/include/driver/driver/dac.h b/tools/sdk/include/driver/driver/dac.h deleted file mode 100644 index f921d98f146..00000000000 --- a/tools/sdk/include/driver/driver/dac.h +++ /dev/null @@ -1,113 +0,0 @@ -// 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. - -#ifndef _DRIVER_DAC_H_ -#define _DRIVER_DAC_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include "esp_err.h" -#include "soc/dac_channel.h" - -typedef enum { - DAC_CHANNEL_1 = 1, /*!< DAC channel 1 is GPIO25 */ - DAC_CHANNEL_2, /*!< DAC channel 2 is GPIO26 */ - DAC_CHANNEL_MAX, -} dac_channel_t; - -/** - * @brief Get the gpio number of a specific DAC channel. - * - * @param channel Channel to get the gpio number - * - * @param gpio_num output buffer to hold the gpio number - * - * @return - * - ESP_OK if success - * - ESP_ERR_INVALID_ARG if channal not valid - */ -esp_err_t dac_pad_get_io_num(dac_channel_t channel, gpio_num_t *gpio_num); - -/** @cond */ -/** - * @brief Set DAC output voltage. - * - * @note Function has been deprecated, please use dac_output_voltage instead. - * This name will be removed in a future release. - * The difference is that before calling dac_output_voltage, we need to initialize the dac pad by dac_output_enable - * - * - * @param channel DAC channel - * @param dac_value DAC output value - * - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t dac_out_voltage(dac_channel_t channel, uint8_t dac_value) __attribute__ ((deprecated)); -/** @endcond */ - -/** - * @brief Set DAC output voltage. - * - * DAC output is 8-bit. Maximum (255) corresponds to VDD. - * - * @note Need to configure DAC pad before calling this function. - * DAC channel 1 is attached to GPIO25, DAC channel 2 is attached to GPIO26 - * - * @param channel DAC channel - * @param dac_value DAC output value - * - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t dac_output_voltage(dac_channel_t channel, uint8_t dac_value); - -/** - * @brief DAC pad output enable - * - * @param channel DAC channel - * @note DAC channel 1 is attached to GPIO25, DAC channel 2 is attached to GPIO26 - * I2S left channel will be mapped to DAC channel 2 - * I2S right channel will be mapped to DAC channel 1 - */ -esp_err_t dac_output_enable(dac_channel_t channel); - -/** - * @brief DAC pad output disable - * - * @param channel DAC channel - * @note DAC channel 1 is attached to GPIO25, DAC channel 2 is attached to GPIO26 - */ -esp_err_t dac_output_disable(dac_channel_t channel); - -/** - * @brief Enable DAC output data from I2S - */ -esp_err_t dac_i2s_enable(); - -/** - * @brief Disable DAC output data from I2S - */ -esp_err_t dac_i2s_disable(); -#ifdef __cplusplus -} -#endif - -#endif /*_DRIVER_DAC_H_*/ - diff --git a/tools/sdk/include/driver/driver/gpio.h b/tools/sdk/include/driver/driver/gpio.h deleted file mode 100644 index c2231a625b1..00000000000 --- a/tools/sdk/include/driver/driver/gpio.h +++ /dev/null @@ -1,617 +0,0 @@ -// 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. - -#ifndef _DRIVER_GPIO_H_ -#define _DRIVER_GPIO_H_ -#include "esp_err.h" -#include -#include "soc/gpio_reg.h" -#include "soc/gpio_struct.h" -#include "soc/rtc_io_reg.h" -#include "soc/io_mux_reg.h" -#include "soc/gpio_sig_map.h" -#include "rom/gpio.h" -#include "esp_attr.h" -#include "esp_intr_alloc.h" -#include "soc/gpio_periph.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define GPIO_SEL_0 (BIT(0)) /*!< Pin 0 selected */ -#define GPIO_SEL_1 (BIT(1)) /*!< Pin 1 selected */ -#define GPIO_SEL_2 (BIT(2)) /*!< Pin 2 selected - @note There are more macros - like that up to pin 39, - excluding pins 20, 24 and 28..31. - They are not shown here - to reduce redundant information. */ -/** @cond */ -#define GPIO_SEL_3 (BIT(3)) /*!< Pin 3 selected */ -#define GPIO_SEL_4 (BIT(4)) /*!< Pin 4 selected */ -#define GPIO_SEL_5 (BIT(5)) /*!< Pin 5 selected */ -#define GPIO_SEL_6 (BIT(6)) /*!< Pin 6 selected */ -#define GPIO_SEL_7 (BIT(7)) /*!< Pin 7 selected */ -#define GPIO_SEL_8 (BIT(8)) /*!< Pin 8 selected */ -#define GPIO_SEL_9 (BIT(9)) /*!< Pin 9 selected */ -#define GPIO_SEL_10 (BIT(10)) /*!< Pin 10 selected */ -#define GPIO_SEL_11 (BIT(11)) /*!< Pin 11 selected */ -#define GPIO_SEL_12 (BIT(12)) /*!< Pin 12 selected */ -#define GPIO_SEL_13 (BIT(13)) /*!< Pin 13 selected */ -#define GPIO_SEL_14 (BIT(14)) /*!< Pin 14 selected */ -#define GPIO_SEL_15 (BIT(15)) /*!< Pin 15 selected */ -#define GPIO_SEL_16 (BIT(16)) /*!< Pin 16 selected */ -#define GPIO_SEL_17 (BIT(17)) /*!< Pin 17 selected */ -#define GPIO_SEL_18 (BIT(18)) /*!< Pin 18 selected */ -#define GPIO_SEL_19 (BIT(19)) /*!< Pin 19 selected */ - -#define GPIO_SEL_21 (BIT(21)) /*!< Pin 21 selected */ -#define GPIO_SEL_22 (BIT(22)) /*!< Pin 22 selected */ -#define GPIO_SEL_23 (BIT(23)) /*!< Pin 23 selected */ - -#define GPIO_SEL_25 (BIT(25)) /*!< Pin 25 selected */ -#define GPIO_SEL_26 (BIT(26)) /*!< Pin 26 selected */ -#define GPIO_SEL_27 (BIT(27)) /*!< Pin 27 selected */ - -#define GPIO_SEL_32 ((uint64_t)(((uint64_t)1)<<32)) /*!< Pin 32 selected */ -#define GPIO_SEL_33 ((uint64_t)(((uint64_t)1)<<33)) /*!< Pin 33 selected */ -#define GPIO_SEL_34 ((uint64_t)(((uint64_t)1)<<34)) /*!< Pin 34 selected */ -#define GPIO_SEL_35 ((uint64_t)(((uint64_t)1)<<35)) /*!< Pin 35 selected */ -#define GPIO_SEL_36 ((uint64_t)(((uint64_t)1)<<36)) /*!< Pin 36 selected */ -#define GPIO_SEL_37 ((uint64_t)(((uint64_t)1)<<37)) /*!< Pin 37 selected */ -#define GPIO_SEL_38 ((uint64_t)(((uint64_t)1)<<38)) /*!< Pin 38 selected */ -#define GPIO_SEL_39 ((uint64_t)(((uint64_t)1)<<39)) /*!< Pin 39 selected */ - -#define GPIO_PIN_REG_0 IO_MUX_GPIO0_REG -#define GPIO_PIN_REG_1 IO_MUX_GPIO1_REG -#define GPIO_PIN_REG_2 IO_MUX_GPIO2_REG -#define GPIO_PIN_REG_3 IO_MUX_GPIO3_REG -#define GPIO_PIN_REG_4 IO_MUX_GPIO4_REG -#define GPIO_PIN_REG_5 IO_MUX_GPIO5_REG -#define GPIO_PIN_REG_6 IO_MUX_GPIO6_REG -#define GPIO_PIN_REG_7 IO_MUX_GPIO7_REG -#define GPIO_PIN_REG_8 IO_MUX_GPIO8_REG -#define GPIO_PIN_REG_9 IO_MUX_GPIO9_REG -#define GPIO_PIN_REG_10 IO_MUX_GPIO10_REG -#define GPIO_PIN_REG_11 IO_MUX_GPIO11_REG -#define GPIO_PIN_REG_12 IO_MUX_GPIO12_REG -#define GPIO_PIN_REG_13 IO_MUX_GPIO13_REG -#define GPIO_PIN_REG_14 IO_MUX_GPIO14_REG -#define GPIO_PIN_REG_15 IO_MUX_GPIO15_REG -#define GPIO_PIN_REG_16 IO_MUX_GPIO16_REG -#define GPIO_PIN_REG_17 IO_MUX_GPIO17_REG -#define GPIO_PIN_REG_18 IO_MUX_GPIO18_REG -#define GPIO_PIN_REG_19 IO_MUX_GPIO19_REG -#define GPIO_PIN_REG_20 IO_MUX_GPIO20_REG -#define GPIO_PIN_REG_21 IO_MUX_GPIO21_REG -#define GPIO_PIN_REG_22 IO_MUX_GPIO22_REG -#define GPIO_PIN_REG_23 IO_MUX_GPIO23_REG -#define GPIO_PIN_REG_25 IO_MUX_GPIO25_REG -#define GPIO_PIN_REG_26 IO_MUX_GPIO26_REG -#define GPIO_PIN_REG_27 IO_MUX_GPIO27_REG -#define GPIO_PIN_REG_32 IO_MUX_GPIO32_REG -#define GPIO_PIN_REG_33 IO_MUX_GPIO33_REG -#define GPIO_PIN_REG_34 IO_MUX_GPIO34_REG -#define GPIO_PIN_REG_35 IO_MUX_GPIO35_REG -#define GPIO_PIN_REG_36 IO_MUX_GPIO36_REG -#define GPIO_PIN_REG_37 IO_MUX_GPIO37_REG -#define GPIO_PIN_REG_38 IO_MUX_GPIO38_REG -#define GPIO_PIN_REG_39 IO_MUX_GPIO39_REG - -#define GPIO_APP_CPU_INTR_ENA (BIT(0)) -#define GPIO_APP_CPU_NMI_INTR_ENA (BIT(1)) -#define GPIO_PRO_CPU_INTR_ENA (BIT(2)) -#define GPIO_PRO_CPU_NMI_INTR_ENA (BIT(3)) -#define GPIO_SDIO_EXT_INTR_ENA (BIT(4)) - -#define GPIO_MODE_DEF_DISABLE (0) -#define GPIO_MODE_DEF_INPUT (BIT0) -#define GPIO_MODE_DEF_OUTPUT (BIT1) -#define GPIO_MODE_DEF_OD (BIT2) - - -/** @endcond */ - -#define GPIO_IS_VALID_GPIO(gpio_num) ((gpio_num < GPIO_PIN_COUNT && GPIO_PIN_MUX_REG[gpio_num] != 0)) /*!< Check whether it is a valid GPIO number */ -#define GPIO_IS_VALID_OUTPUT_GPIO(gpio_num) ((GPIO_IS_VALID_GPIO(gpio_num)) && (gpio_num < 34)) /*!< Check whether it can be a valid GPIO number of output mode */ - -typedef enum { - GPIO_NUM_0 = 0, /*!< GPIO0, input and output */ - GPIO_NUM_1 = 1, /*!< GPIO1, input and output */ - GPIO_NUM_2 = 2, /*!< GPIO2, input and output - @note There are more enumerations like that - up to GPIO39, excluding GPIO20, GPIO24 and GPIO28..31. - They are not shown here to reduce redundant information. - @note GPIO34..39 are input mode only. */ -/** @cond */ - GPIO_NUM_3 = 3, /*!< GPIO3, input and output */ - GPIO_NUM_4 = 4, /*!< GPIO4, input and output */ - GPIO_NUM_5 = 5, /*!< GPIO5, input and output */ - GPIO_NUM_6 = 6, /*!< GPIO6, input and output */ - GPIO_NUM_7 = 7, /*!< GPIO7, input and output */ - GPIO_NUM_8 = 8, /*!< GPIO8, input and output */ - GPIO_NUM_9 = 9, /*!< GPIO9, input and output */ - GPIO_NUM_10 = 10, /*!< GPIO10, input and output */ - GPIO_NUM_11 = 11, /*!< GPIO11, input and output */ - GPIO_NUM_12 = 12, /*!< GPIO12, input and output */ - GPIO_NUM_13 = 13, /*!< GPIO13, input and output */ - GPIO_NUM_14 = 14, /*!< GPIO14, input and output */ - GPIO_NUM_15 = 15, /*!< GPIO15, input and output */ - GPIO_NUM_16 = 16, /*!< GPIO16, input and output */ - GPIO_NUM_17 = 17, /*!< GPIO17, input and output */ - GPIO_NUM_18 = 18, /*!< GPIO18, input and output */ - GPIO_NUM_19 = 19, /*!< GPIO19, input and output */ - - GPIO_NUM_21 = 21, /*!< GPIO21, input and output */ - GPIO_NUM_22 = 22, /*!< GPIO22, input and output */ - GPIO_NUM_23 = 23, /*!< GPIO23, input and output */ - - GPIO_NUM_25 = 25, /*!< GPIO25, input and output */ - GPIO_NUM_26 = 26, /*!< GPIO26, input and output */ - GPIO_NUM_27 = 27, /*!< GPIO27, input and output */ - - GPIO_NUM_32 = 32, /*!< GPIO32, input and output */ - GPIO_NUM_33 = 33, /*!< GPIO33, input and output */ - GPIO_NUM_34 = 34, /*!< GPIO34, input mode only */ - GPIO_NUM_35 = 35, /*!< GPIO35, input mode only */ - GPIO_NUM_36 = 36, /*!< GPIO36, input mode only */ - GPIO_NUM_37 = 37, /*!< GPIO37, input mode only */ - GPIO_NUM_38 = 38, /*!< GPIO38, input mode only */ - GPIO_NUM_39 = 39, /*!< GPIO39, input mode only */ - GPIO_NUM_MAX = 40, -/** @endcond */ -} gpio_num_t; - -typedef enum { - GPIO_INTR_DISABLE = 0, /*!< Disable GPIO interrupt */ - GPIO_INTR_POSEDGE = 1, /*!< GPIO interrupt type : rising edge */ - GPIO_INTR_NEGEDGE = 2, /*!< GPIO interrupt type : falling edge */ - GPIO_INTR_ANYEDGE = 3, /*!< GPIO interrupt type : both rising and falling edge */ - GPIO_INTR_LOW_LEVEL = 4, /*!< GPIO interrupt type : input low level trigger */ - GPIO_INTR_HIGH_LEVEL = 5, /*!< GPIO interrupt type : input high level trigger */ - GPIO_INTR_MAX, -} gpio_int_type_t; - -typedef enum { - GPIO_MODE_DISABLE = GPIO_MODE_DEF_DISABLE, /*!< GPIO mode : disable input and output */ - GPIO_MODE_INPUT = GPIO_MODE_DEF_INPUT, /*!< GPIO mode : input only */ - GPIO_MODE_OUTPUT = GPIO_MODE_DEF_OUTPUT, /*!< GPIO mode : output only mode */ - GPIO_MODE_OUTPUT_OD = ((GPIO_MODE_DEF_OUTPUT)|(GPIO_MODE_DEF_OD)), /*!< GPIO mode : output only with open-drain mode */ - GPIO_MODE_INPUT_OUTPUT_OD = ((GPIO_MODE_DEF_INPUT)|(GPIO_MODE_DEF_OUTPUT)|(GPIO_MODE_DEF_OD)), /*!< GPIO mode : output and input with open-drain mode*/ - GPIO_MODE_INPUT_OUTPUT = ((GPIO_MODE_DEF_INPUT)|(GPIO_MODE_DEF_OUTPUT)), /*!< GPIO mode : output and input mode */ -} gpio_mode_t; - -typedef enum { - GPIO_PULLUP_DISABLE = 0x0, /*!< Disable GPIO pull-up resistor */ - GPIO_PULLUP_ENABLE = 0x1, /*!< Enable GPIO pull-up resistor */ -} gpio_pullup_t; - -typedef enum { - GPIO_PULLDOWN_DISABLE = 0x0, /*!< Disable GPIO pull-down resistor */ - GPIO_PULLDOWN_ENABLE = 0x1, /*!< Enable GPIO pull-down resistor */ -} gpio_pulldown_t; - -/** - * @brief Configuration parameters of GPIO pad for gpio_config function - */ -typedef struct { - uint64_t pin_bit_mask; /*!< GPIO pin: set with bit mask, each bit maps to a GPIO */ - gpio_mode_t mode; /*!< GPIO mode: set input/output mode */ - gpio_pullup_t pull_up_en; /*!< GPIO pull-up */ - gpio_pulldown_t pull_down_en; /*!< GPIO pull-down */ - gpio_int_type_t intr_type; /*!< GPIO interrupt type */ -} gpio_config_t; - -typedef enum { - GPIO_PULLUP_ONLY, /*!< Pad pull up */ - GPIO_PULLDOWN_ONLY, /*!< Pad pull down */ - GPIO_PULLUP_PULLDOWN, /*!< Pad pull up + pull down*/ - GPIO_FLOATING, /*!< Pad floating */ -} gpio_pull_mode_t; - -typedef enum { - GPIO_DRIVE_CAP_0 = 0, /*!< Pad drive capability: weak */ - GPIO_DRIVE_CAP_1 = 1, /*!< Pad drive capability: stronger */ - GPIO_DRIVE_CAP_2 = 2, /*!< Pad drive capability: default value */ - GPIO_DRIVE_CAP_DEFAULT = 2, /*!< Pad drive capability: default value */ - GPIO_DRIVE_CAP_3 = 3, /*!< Pad drive capability: strongest */ - GPIO_DRIVE_CAP_MAX, -} gpio_drive_cap_t; - -typedef void (*gpio_isr_t)(void*); -typedef intr_handle_t gpio_isr_handle_t; - -/** - * @brief GPIO common configuration - * - * Configure GPIO's Mode,pull-up,PullDown,IntrType - * - * @param pGPIOConfig Pointer to GPIO configure struct - * - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_ARG Parameter error - * - */ -esp_err_t gpio_config(const gpio_config_t *pGPIOConfig); - -/** - * @brief Reset an gpio to default state (select gpio function, enable pullup and disable input and output). - * - * @param gpio_num GPIO number. - * - * @note This function also configures the IOMUX for this pin to the GPIO - * function, and disconnects any other peripheral output configured via GPIO - * Matrix. - * - * @return Always return ESP_OK. - */ -esp_err_t gpio_reset_pin(gpio_num_t gpio_num); - -/** - * @brief GPIO set interrupt trigger type - * - * @param gpio_num GPIO number. If you want to set the trigger type of e.g. of GPIO16, gpio_num should be GPIO_NUM_16 (16); - * @param intr_type Interrupt type, select from gpio_int_type_t - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - * - */ -esp_err_t gpio_set_intr_type(gpio_num_t gpio_num, gpio_int_type_t intr_type); - -/** - * @brief Enable GPIO module interrupt signal - * - * @note Please do not use the interrupt of GPIO36 and GPIO39 when using ADC. - * Please refer to the comments of `adc1_get_raw`. - * Please refer to section 3.11 of 'ECO_and_Workarounds_for_Bugs_in_ESP32' for the description of this issue. - * - * @param gpio_num GPIO number. If you want to enable an interrupt on e.g. GPIO16, gpio_num should be GPIO_NUM_16 (16); - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - * - */ -esp_err_t gpio_intr_enable(gpio_num_t gpio_num); - -/** - * @brief Disable GPIO module interrupt signal - * - * @param gpio_num GPIO number. If you want to disable the interrupt of e.g. GPIO16, gpio_num should be GPIO_NUM_16 (16); - * - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_ARG Parameter error - * - */ -esp_err_t gpio_intr_disable(gpio_num_t gpio_num); - -/** - * @brief GPIO set output level - * - * @param gpio_num GPIO number. If you want to set the output level of e.g. GPIO16, gpio_num should be GPIO_NUM_16 (16); - * @param level Output level. 0: low ; 1: high - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG GPIO number error - * - */ -esp_err_t gpio_set_level(gpio_num_t gpio_num, uint32_t level); - -/** - * @brief GPIO get input level - * - * @warning If the pad is not configured for input (or input and output) the returned value is always 0. - * - * @param gpio_num GPIO number. If you want to get the logic level of e.g. pin GPIO16, gpio_num should be GPIO_NUM_16 (16); - * - * @return - * - 0 the GPIO input level is 0 - * - 1 the GPIO input level is 1 - * - */ -int gpio_get_level(gpio_num_t gpio_num); - -/** - * @brief GPIO set direction - * - * Configure GPIO direction,such as output_only,input_only,output_and_input - * - * @param gpio_num Configure GPIO pins number, it should be GPIO number. If you want to set direction of e.g. GPIO16, gpio_num should be GPIO_NUM_16 (16); - * @param mode GPIO direction - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG GPIO error - * - */ -esp_err_t gpio_set_direction(gpio_num_t gpio_num, gpio_mode_t mode); - -/** - * @brief Configure GPIO pull-up/pull-down resistors - * - * Only pins that support both input & output have integrated pull-up and pull-down resistors. Input-only GPIOs 34-39 do not. - * - * @param gpio_num GPIO number. If you want to set pull up or down mode for e.g. GPIO16, gpio_num should be GPIO_NUM_16 (16); - * @param pull GPIO pull up/down mode. - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG : Parameter error - * - */ -esp_err_t gpio_set_pull_mode(gpio_num_t gpio_num, gpio_pull_mode_t pull); - -/** - * @brief Enable GPIO wake-up function. - * - * @param gpio_num GPIO number. - * - * @param intr_type GPIO wake-up type. Only GPIO_INTR_LOW_LEVEL or GPIO_INTR_HIGH_LEVEL can be used. - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t gpio_wakeup_enable(gpio_num_t gpio_num, gpio_int_type_t intr_type); - -/** - * @brief Disable GPIO wake-up function. - * - * @param gpio_num GPIO number - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t gpio_wakeup_disable(gpio_num_t gpio_num); - -/** - * @brief Register GPIO interrupt handler, the handler is an ISR. - * The handler will be attached to the same CPU core that this function is running on. - * - * This ISR function is called whenever any GPIO interrupt occurs. See - * the alternative gpio_install_isr_service() and - * gpio_isr_handler_add() API in order to have the driver support - * per-GPIO ISRs. - * - * @param fn Interrupt handler function. - * @param intr_alloc_flags Flags used to allocate the interrupt. One or multiple (ORred) - * ESP_INTR_FLAG_* values. See esp_intr_alloc.h for more info. - * @param arg Parameter for handler function - * @param handle Pointer to return handle. If non-NULL, a handle for the interrupt will be returned here. - * - * \verbatim embed:rst:leading-asterisk - * To disable or remove the ISR, pass the returned handle to the :doc:`interrupt allocation functions `. - * \endverbatim - * - * @return - * - ESP_OK Success ; - * - ESP_ERR_INVALID_ARG GPIO error - * - ESP_ERR_NOT_FOUND No free interrupt found with the specified flags - */ -esp_err_t gpio_isr_register(void (*fn)(void*), void * arg, int intr_alloc_flags, gpio_isr_handle_t *handle); - -/** - * @brief Enable pull-up on GPIO. - * - * @param gpio_num GPIO number - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t gpio_pullup_en(gpio_num_t gpio_num); - -/** - * @brief Disable pull-up on GPIO. - * - * @param gpio_num GPIO number - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t gpio_pullup_dis(gpio_num_t gpio_num); - -/** - * @brief Enable pull-down on GPIO. - * - * @param gpio_num GPIO number - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t gpio_pulldown_en(gpio_num_t gpio_num); - -/** - * @brief Disable pull-down on GPIO. - * - * @param gpio_num GPIO number - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t gpio_pulldown_dis(gpio_num_t gpio_num); - -/** - * @brief Install the driver's GPIO ISR handler service, which allows per-pin GPIO interrupt handlers. - * - * This function is incompatible with gpio_isr_register() - if that function is used, a single global ISR is registered for all GPIO interrupts. If this function is used, the ISR service provides a global GPIO ISR and individual pin handlers are registered via the gpio_isr_handler_add() function. - * - * @param intr_alloc_flags Flags used to allocate the interrupt. One or multiple (ORred) - * ESP_INTR_FLAG_* values. See esp_intr_alloc.h for more info. - * - * @return - * - ESP_OK Success - * - ESP_ERR_NO_MEM No memory to install this service - * - ESP_ERR_INVALID_STATE ISR service already installed. - * - ESP_ERR_NOT_FOUND No free interrupt found with the specified flags - * - ESP_ERR_INVALID_ARG GPIO error - */ -esp_err_t gpio_install_isr_service(int intr_alloc_flags); - -/** - * @brief Uninstall the driver's GPIO ISR service, freeing related resources. - */ -void gpio_uninstall_isr_service(); - -/** - * @brief Add ISR handler for the corresponding GPIO pin. - * - * Call this function after using gpio_install_isr_service() to - * install the driver's GPIO ISR handler service. - * - * The pin ISR handlers no longer need to be declared with IRAM_ATTR, - * unless you pass the ESP_INTR_FLAG_IRAM flag when allocating the - * ISR in gpio_install_isr_service(). - * - * This ISR handler will be called from an ISR. So there is a stack - * size limit (configurable as "ISR stack size" in menuconfig). This - * limit is smaller compared to a global GPIO interrupt handler due - * to the additional level of indirection. - * - * @param gpio_num GPIO number - * @param isr_handler ISR handler function for the corresponding GPIO number. - * @param args parameter for ISR handler. - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_STATE Wrong state, the ISR service has not been initialized. - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t gpio_isr_handler_add(gpio_num_t gpio_num, gpio_isr_t isr_handler, void* args); - -/** - * @brief Remove ISR handler for the corresponding GPIO pin. - * - * @param gpio_num GPIO number - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_STATE Wrong state, the ISR service has not been initialized. - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t gpio_isr_handler_remove(gpio_num_t gpio_num); - -/** - * @brief Set GPIO pad drive capability - * - * @param gpio_num GPIO number, only support output GPIOs - * @param strength Drive capability of the pad - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t gpio_set_drive_capability(gpio_num_t gpio_num, gpio_drive_cap_t strength); - -/** - * @brief Get GPIO pad drive capability - * - * @param gpio_num GPIO number, only support output GPIOs - * @param strength Pointer to accept drive capability of the pad - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t gpio_get_drive_capability(gpio_num_t gpio_num, gpio_drive_cap_t* strength); - -/** - * @brief Enable gpio pad hold function. - * - * The gpio pad hold function works in both input and output modes, but must be output-capable gpios. - * If pad hold enabled: - * in output mode: the output level of the pad will be force locked and can not be changed. - * in input mode: the input value read will not change, regardless the changes of input signal. - * - * The state of digital gpio cannot be held during Deep-sleep, and it will resume the hold function - * when the chip wakes up from Deep-sleep. If the digital gpio also needs to be held during Deep-sleep, - * `gpio_deep_sleep_hold_en` should also be called. - * - * Power down or call gpio_hold_dis will disable this function. - * - * @param gpio_num GPIO number, only support output-capable GPIOs - * - * @return - * - ESP_OK Success - * - ESP_ERR_NOT_SUPPORTED Not support pad hold function - */ -esp_err_t gpio_hold_en(gpio_num_t gpio_num); - -/** - * @brief Disable gpio pad hold function. - * - * When the chip is woken up from Deep-sleep, the gpio will be set to the default mode, so, the gpio will output - * the default level if this function is called. If you dont't want the level changes, the gpio should be configured to - * a known state before this function is called. - * e.g. - * If you hold gpio18 high during Deep-sleep, after the chip is woken up and `gpio_hold_dis` is called, - * gpio18 will output low level(because gpio18 is input mode by default). If you don't want this behavior, - * you should configure gpio18 as output mode and set it to hight level before calling `gpio_hold_dis`. - * - * @param gpio_num GPIO number, only support output-capable GPIOs - * - * @return - * - ESP_OK Success - * - ESP_ERR_NOT_SUPPORTED Not support pad hold function - */ -esp_err_t gpio_hold_dis(gpio_num_t gpio_num); - -/** - * @brief Enable all digital gpio pad hold function during Deep-sleep. - * - * When the chip is in Deep-sleep mode, all digital gpio will hold the state before sleep, and when the chip is woken up, - * the status of digital gpio will not be held. Note that the pad hold feature only works when the chip is in Deep-sleep mode, - * when not in sleep mode, the digital gpio state can be changed even you have called this function. - * - * Power down or call gpio_hold_dis will disable this function, otherwise, the digital gpio hold feature works as long as the chip enter Deep-sleep. - */ -void gpio_deep_sleep_hold_en(void); - -/** - * @brief Disable all digital gpio pad hold function during Deep-sleep. - * - */ -void gpio_deep_sleep_hold_dis(void); - -/** - * @brief Set pad input to a peripheral signal through the IOMUX. - * @param gpio_num GPIO number of the pad. - * @param signal_idx Peripheral signal id to input. One of the ``*_IN_IDX`` signals in ``soc/gpio_sig_map.h``. - */ -void gpio_iomux_in(uint32_t gpio_num, uint32_t signal_idx); - -/** - * @brief Set peripheral output to an GPIO pad through the IOMUX. - * @param gpio_num gpio_num GPIO number of the pad. - * @param func The function number of the peripheral pin to output pin. - * One of the ``FUNC_X_*`` of specified pin (X) in ``soc/io_mux_reg.h``. - * @param oen_inv True if the output enable needs to be inversed, otherwise False. - */ -void gpio_iomux_out(uint8_t gpio_num, int func, bool oen_inv); - -#ifdef __cplusplus -} -#endif - -#endif /* _DRIVER_GPIO_H_ */ diff --git a/tools/sdk/include/driver/driver/i2c.h b/tools/sdk/include/driver/driver/i2c.h deleted file mode 100644 index feb1d78bd63..00000000000 --- a/tools/sdk/include/driver/driver/i2c.h +++ /dev/null @@ -1,579 +0,0 @@ -// 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. - -#ifndef _DRIVER_I2C_H_ -#define _DRIVER_I2C_H_ - - -#ifdef __cplusplus -extern "C" { -#endif -#include -#include "esp_err.h" -#include "esp_intr_alloc.h" -#include "freertos/FreeRTOS.h" -#include "freertos/semphr.h" -#include "freertos/xtensa_api.h" -#include "freertos/task.h" -#include "freertos/queue.h" -#include "freertos/ringbuf.h" -#include "driver/gpio.h" - -#define I2C_APB_CLK_FREQ APB_CLK_FREQ /*!< I2C source clock is APB clock, 80MHz */ -#define I2C_FIFO_LEN (32) /*!< I2C hardware fifo length */ -typedef enum{ - I2C_MODE_SLAVE = 0, /*!< I2C slave mode */ - I2C_MODE_MASTER, /*!< I2C master mode */ - I2C_MODE_MAX, -}i2c_mode_t; - -typedef enum { - I2C_MASTER_WRITE = 0, /*!< I2C write data */ - I2C_MASTER_READ, /*!< I2C read data */ -} i2c_rw_t; - -typedef enum { - I2C_DATA_MODE_MSB_FIRST = 0, /*!< I2C data msb first */ - I2C_DATA_MODE_LSB_FIRST = 1, /*!< I2C data lsb first */ - I2C_DATA_MODE_MAX -} i2c_trans_mode_t; - -typedef enum{ - I2C_CMD_RESTART = 0, /*!=0) The number of data bytes that pushed to the I2C slave buffer. - */ -int i2c_slave_write_buffer(i2c_port_t i2c_num, uint8_t* data, int size, TickType_t ticks_to_wait); - -/** - * @brief I2C slave read data from internal buffer. When I2C slave receive data, isr will copy received data - * from hardware rx fifo to internal ringbuffer. Then users can read from internal ringbuffer. - * @note - * Only call this function in I2C slave mode - * - * @param i2c_num I2C port number - * @param data data pointer to write into internal buffer - * @param max_size Maximum data size to read - * @param ticks_to_wait Maximum waiting ticks - * - * @return - * - ESP_FAIL(-1) Parameter error - * - Others(>=0) The number of data bytes that read from I2C slave buffer. - */ -int i2c_slave_read_buffer(i2c_port_t i2c_num, uint8_t* data, size_t max_size, TickType_t ticks_to_wait); - -/** - * @brief set I2C master clock period - * - * @param i2c_num I2C port number - * @param high_period clock cycle number during SCL is high level, high_period is a 14 bit value - * @param low_period clock cycle number during SCL is low level, low_period is a 14 bit value - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t i2c_set_period(i2c_port_t i2c_num, int high_period, int low_period); - -/** - * @brief get I2C master clock period - * - * @param i2c_num I2C port number - * @param high_period pointer to get clock cycle number during SCL is high level, will get a 14 bit value - * @param low_period pointer to get clock cycle number during SCL is low level, will get a 14 bit value - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t i2c_get_period(i2c_port_t i2c_num, int* high_period, int* low_period); - -/** - * @brief enable hardware filter on I2C bus - * Sometimes the I2C bus is disturbed by high frequency noise(about 20ns), or the rising edge of - * the SCL clock is very slow, these may cause the master state machine broken. enable hardware - * filter can filter out high frequency interference and make the master more stable. - * @note - * Enable filter will slow the SCL clock. - * - * @param i2c_num I2C port number - * @param cyc_num the APB cycles need to be filtered(0<= cyc_num <=7). - * When the period of a pulse is less than cyc_num * APB_cycle, the I2C controller will ignore this pulse. - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t i2c_filter_enable(i2c_port_t i2c_num, uint8_t cyc_num); - -/** - * @brief disable filter on I2C bus - * - * @param i2c_num I2C port number - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t i2c_filter_disable(i2c_port_t i2c_num); - -/** - * @brief set I2C master start signal timing - * - * @param i2c_num I2C port number - * @param setup_time clock number between the falling-edge of SDA and rising-edge of SCL for start mark, it's a 10-bit value. - * @param hold_time clock num between the falling-edge of SDA and falling-edge of SCL for start mark, it's a 10-bit value. - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t i2c_set_start_timing(i2c_port_t i2c_num, int setup_time, int hold_time); - -/** - * @brief get I2C master start signal timing - * - * @param i2c_num I2C port number - * @param setup_time pointer to get setup time - * @param hold_time pointer to get hold time - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t i2c_get_start_timing(i2c_port_t i2c_num, int* setup_time, int* hold_time); - -/** - * @brief set I2C master stop signal timing - * - * @param i2c_num I2C port number - * @param setup_time clock num between the rising-edge of SCL and the rising-edge of SDA, it's a 10-bit value. - * @param hold_time clock number after the STOP bit's rising-edge, it's a 14-bit value. - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t i2c_set_stop_timing(i2c_port_t i2c_num, int setup_time, int hold_time); - -/** - * @brief get I2C master stop signal timing - * - * @param i2c_num I2C port number - * @param setup_time pointer to get setup time. - * @param hold_time pointer to get hold time. - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t i2c_get_stop_timing(i2c_port_t i2c_num, int* setup_time, int* hold_time); - -/** - * @brief set I2C data signal timing - * - * @param i2c_num I2C port number - * @param sample_time clock number I2C used to sample data on SDA after the rising-edge of SCL, it's a 10-bit value - * @param hold_time clock number I2C used to hold the data after the falling-edge of SCL, it's a 10-bit value - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t i2c_set_data_timing(i2c_port_t i2c_num, int sample_time, int hold_time); - -/** - * @brief get I2C data signal timing - * - * @param i2c_num I2C port number - * @param sample_time pointer to get sample time - * @param hold_time pointer to get hold time - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t i2c_get_data_timing(i2c_port_t i2c_num, int* sample_time, int* hold_time); - -/** - * @brief set I2C timeout value - * @param i2c_num I2C port number - * @param timeout timeout value for I2C bus (unit: APB 80Mhz clock cycle) - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t i2c_set_timeout(i2c_port_t i2c_num, int timeout); - -/** - * @brief get I2C timeout value - * @param i2c_num I2C port number - * @param timeout pointer to get timeout value - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t i2c_get_timeout(i2c_port_t i2c_num, int* timeout); -/** - * @brief set I2C data transfer mode - * - * @param i2c_num I2C port number - * @param tx_trans_mode I2C sending data mode - * @param rx_trans_mode I2C receving data mode - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t i2c_set_data_mode(i2c_port_t i2c_num, i2c_trans_mode_t tx_trans_mode, i2c_trans_mode_t rx_trans_mode); - -/** - * @brief get I2C data transfer mode - * - * @param i2c_num I2C port number - * @param tx_trans_mode pointer to get I2C sending data mode - * @param rx_trans_mode pointer to get I2C receiving data mode - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t i2c_get_data_mode(i2c_port_t i2c_num, i2c_trans_mode_t *tx_trans_mode, i2c_trans_mode_t *rx_trans_mode); - -#ifdef __cplusplus -} -#endif - -#endif /*_DRIVER_I2C_H_*/ diff --git a/tools/sdk/include/driver/driver/i2s.h b/tools/sdk/include/driver/driver/i2s.h deleted file mode 100644 index 1f73e1f5566..00000000000 --- a/tools/sdk/include/driver/driver/i2s.h +++ /dev/null @@ -1,518 +0,0 @@ -// 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. - -#ifndef _DRIVER_I2S_H_ -#define _DRIVER_I2S_H_ -#include "esp_err.h" -#include -#include "soc/gpio_reg.h" -#include "soc/soc.h" -#include "soc/i2s_struct.h" -#include "soc/i2s_reg.h" -#include "soc/rtc_io_reg.h" -#include "soc/io_mux_reg.h" -#include "rom/gpio.h" -#include "esp_attr.h" -#include "esp_intr_alloc.h" -#include "driver/periph_ctrl.h" -#include "driver/adc.h" -#include "freertos/semphr.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief I2S bit width per sample. - * - */ -typedef enum { - I2S_BITS_PER_SAMPLE_8BIT = 8, /*!< I2S bits per sample: 8-bits*/ - I2S_BITS_PER_SAMPLE_16BIT = 16, /*!< I2S bits per sample: 16-bits*/ - I2S_BITS_PER_SAMPLE_24BIT = 24, /*!< I2S bits per sample: 24-bits*/ - I2S_BITS_PER_SAMPLE_32BIT = 32, /*!< I2S bits per sample: 32-bits*/ -} i2s_bits_per_sample_t; - -/** - * @brief I2S channel. - * - */ -typedef enum { - I2S_CHANNEL_MONO = 1, /*!< I2S 1 channel (mono)*/ - I2S_CHANNEL_STEREO = 2 /*!< I2S 2 channel (stereo)*/ -} i2s_channel_t; - -/** - * @brief I2S communication standard format - * - */ -typedef enum { - I2S_COMM_FORMAT_I2S = 0x01, /*!< I2S communication format I2S*/ - I2S_COMM_FORMAT_I2S_MSB = 0x02, /*!< I2S format MSB*/ - I2S_COMM_FORMAT_I2S_LSB = 0x04, /*!< I2S format LSB*/ - I2S_COMM_FORMAT_PCM = 0x08, /*!< I2S communication format PCM*/ - I2S_COMM_FORMAT_PCM_SHORT = 0x10, /*!< PCM Short*/ - I2S_COMM_FORMAT_PCM_LONG = 0x20, /*!< PCM Long*/ -} i2s_comm_format_t; - - -/** - * @brief I2S channel format type - */ -typedef enum { - I2S_CHANNEL_FMT_RIGHT_LEFT = 0x00, - I2S_CHANNEL_FMT_ALL_RIGHT, - I2S_CHANNEL_FMT_ALL_LEFT, - I2S_CHANNEL_FMT_ONLY_RIGHT, - I2S_CHANNEL_FMT_ONLY_LEFT, -} i2s_channel_fmt_t; - -/** - * @brief PDM sample rate ratio, measured in Hz. - * - */ -typedef enum { - PDM_SAMPLE_RATE_RATIO_64, - PDM_SAMPLE_RATE_RATIO_128, -} pdm_sample_rate_ratio_t; - -/** - * @brief PDM PCM convter enable/disable. - * - */ -typedef enum { - PDM_PCM_CONV_ENABLE, - PDM_PCM_CONV_DISABLE, -} pdm_pcm_conv_t; - - -/** - * @brief I2S Peripheral, 0 & 1. - * - */ -typedef enum { - I2S_NUM_0 = 0x0, /*!< I2S 0*/ - I2S_NUM_1 = 0x1, /*!< I2S 1*/ - I2S_NUM_MAX, -} i2s_port_t; - -/** - * @brief I2S Mode, defaut is I2S_MODE_MASTER | I2S_MODE_TX - * - * @note PDM and built-in DAC functions are only supported on I2S0 for current ESP32 chip. - * - */ -typedef enum { - I2S_MODE_MASTER = 1, - I2S_MODE_SLAVE = 2, - I2S_MODE_TX = 4, - I2S_MODE_RX = 8, - I2S_MODE_DAC_BUILT_IN = 16, /*!< Output I2S data to built-in DAC, no matter the data format is 16bit or 32 bit, the DAC module will only take the 8bits from MSB*/ - I2S_MODE_ADC_BUILT_IN = 32, /*!< Input I2S data from built-in ADC, each data can be 12-bit width at most*/ - I2S_MODE_PDM = 64, -} i2s_mode_t; - - - -/** - * @brief I2S configuration parameters for i2s_param_config function - * - */ -typedef struct { - i2s_mode_t mode; /*!< I2S work mode*/ - int sample_rate; /*!< I2S sample rate*/ - i2s_bits_per_sample_t bits_per_sample; /*!< I2S bits per sample*/ - i2s_channel_fmt_t channel_format; /*!< I2S channel format */ - i2s_comm_format_t communication_format; /*!< I2S communication format */ - int intr_alloc_flags; /*!< Flags used to allocate the interrupt. One or multiple (ORred) ESP_INTR_FLAG_* values. See esp_intr_alloc.h for more info */ - int dma_buf_count; /*!< I2S DMA Buffer Count */ - int dma_buf_len; /*!< I2S DMA Buffer Length */ - bool use_apll; /*!< I2S using APLL as main I2S clock, enable it to get accurate clock */ - bool tx_desc_auto_clear; /*!< I2S auto clear tx descriptor if there is underflow condition (helps in avoiding noise in case of data unavailability) */ - int fixed_mclk; /*!< I2S using fixed MCLK output. If use_apll = true and fixed_mclk > 0, then the clock output for i2s is fixed and equal to the fixed_mclk value.*/ -} i2s_config_t; - -/** - * @brief I2S event types - * - */ -typedef enum { - I2S_EVENT_DMA_ERROR, - I2S_EVENT_TX_DONE, /*!< I2S DMA finish sent 1 buffer*/ - I2S_EVENT_RX_DONE, /*!< I2S DMA finish received 1 buffer*/ - I2S_EVENT_MAX, /*!< I2S event max index*/ -} i2s_event_type_t; - -/** - * @brief I2S DAC mode for i2s_set_dac_mode. - * - * @note PDM and built-in DAC functions are only supported on I2S0 for current ESP32 chip. - */ -typedef enum { - I2S_DAC_CHANNEL_DISABLE = 0, /*!< Disable I2S built-in DAC signals*/ - I2S_DAC_CHANNEL_RIGHT_EN = 1, /*!< Enable I2S built-in DAC right channel, maps to DAC channel 1 on GPIO25*/ - I2S_DAC_CHANNEL_LEFT_EN = 2, /*!< Enable I2S built-in DAC left channel, maps to DAC channel 2 on GPIO26*/ - I2S_DAC_CHANNEL_BOTH_EN = 0x3, /*!< Enable both of the I2S built-in DAC channels.*/ - I2S_DAC_CHANNEL_MAX = 0x4, /*!< I2S built-in DAC mode max index*/ -} i2s_dac_mode_t; - -/** - * @brief Event structure used in I2S event queue - * - */ -typedef struct { - i2s_event_type_t type; /*!< I2S event type */ - size_t size; /*!< I2S data size for I2S_DATA event*/ -} i2s_event_t; - -#define I2S_PIN_NO_CHANGE (-1) /*!< Use in i2s_pin_config_t for pins which should not be changed */ - -/** - * @brief I2S pin number for i2s_set_pin - * - */ -typedef struct { - int bck_io_num; /*!< BCK in out pin*/ - int ws_io_num; /*!< WS in out pin*/ - int data_out_num; /*!< DATA out pin*/ - int data_in_num; /*!< DATA in pin*/ -} i2s_pin_config_t; - - -typedef intr_handle_t i2s_isr_handle_t; -/** - * @brief Set I2S pin number - * - * @note - * The I2S peripheral output signals can be connected to multiple GPIO pads. - * However, the I2S peripheral input signal can only be connected to one GPIO pad. - * - * @param i2s_num I2S_NUM_0 or I2S_NUM_1 - * - * @param pin I2S Pin structure, or NULL to set 2-channel 8-bit internal DAC pin configuration (GPIO25 & GPIO26) - * - * Inside the pin configuration structure, set I2S_PIN_NO_CHANGE for any pin where - * the current configuration should not be changed. - * - * @note if *pin is set as NULL, this function will initialize both of the built-in DAC channels by default. - * if you don't want this to happen and you want to initialize only one of the DAC channels, you can call i2s_set_dac_mode instead. - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_FAIL IO error - */ -esp_err_t i2s_set_pin(i2s_port_t i2s_num, const i2s_pin_config_t *pin); - -/** - * @brief Set I2S dac mode, I2S built-in DAC is disabled by default - * - * @param dac_mode DAC mode configurations - see i2s_dac_mode_t - * - * @note Built-in DAC functions are only supported on I2S0 for current ESP32 chip. - * If either of the built-in DAC channel are enabled, the other one can not - * be used as RTC DAC function at the same time. - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t i2s_set_dac_mode(i2s_dac_mode_t dac_mode); - -/** - * @brief Install and start I2S driver. - * - * @param i2s_num I2S_NUM_0, I2S_NUM_1 - * - * @param i2s_config I2S configurations - see i2s_config_t struct - * - * @param queue_size I2S event queue size/depth. - * - * @param i2s_queue I2S event queue handle, if set NULL, driver will not use an event queue. - * - * This function must be called before any I2S driver read/write operations. - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_ERR_NO_MEM Out of memory - */ -esp_err_t i2s_driver_install(i2s_port_t i2s_num, const i2s_config_t *i2s_config, int queue_size, void* i2s_queue); - -/** - * @brief Uninstall I2S driver. - * - * @param i2s_num I2S_NUM_0, I2S_NUM_1 - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t i2s_driver_uninstall(i2s_port_t i2s_num); - -/** - * @brief Write data to I2S DMA transmit buffer. - * - * This function is deprecated. Use 'i2s_write' instead. - * This definition will be removed in a future release. - * - * @return - * - The amount of bytes written, if timeout, the result will be less than the size passed in. - * - ESP_FAIL Parameter error - */ -int i2s_write_bytes(i2s_port_t i2s_num, const void *src, size_t size, TickType_t ticks_to_wait) __attribute__ ((deprecated)); - -/** - * @brief Write data to I2S DMA transmit buffer. - * - * @param i2s_num I2S_NUM_0, I2S_NUM_1 - * - * @param src Source address to write from - * - * @param size Size of data in bytes - * - * @param[out] bytes_written Number of bytes written, if timeout, the result will be less than the size passed in. - * - * @param ticks_to_wait TX buffer wait timeout in RTOS ticks. If this - * many ticks pass without space becoming available in the DMA - * transmit buffer, then the function will return (note that if the - * data is written to the DMA buffer in pieces, the overall operation - * may still take longer than this timeout.) Pass portMAX_DELAY for no - * timeout. - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t i2s_write(i2s_port_t i2s_num, const void *src, size_t size, size_t *bytes_written, TickType_t ticks_to_wait); - -/** - * @brief Write data to I2S DMA transmit buffer while expanding the number of bits per sample. For example, expanding 16-bit PCM to 32-bit PCM. - * - * @param i2s_num I2S_NUM_0, I2S_NUM_1 - * - * @param src Source address to write from - * - * @param size Size of data in bytes - * - * @param src_bits Source audio bit - * - * @param aim_bits Bit wanted, no more than 32, and must be greater than src_bits - * - * @param[out] bytes_written Number of bytes written, if timeout, the result will be less than the size passed in. - * - * @param ticks_to_wait TX buffer wait timeout in RTOS ticks. If this - * many ticks pass without space becoming available in the DMA - * transmit buffer, then the function will return (note that if the - * data is written to the DMA buffer in pieces, the overall operation - * may still take longer than this timeout.) Pass portMAX_DELAY for no - * timeout. - * - * Format of the data in source buffer is determined by the I2S - * configuration (see i2s_config_t). - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t i2s_write_expand(i2s_port_t i2s_num, const void *src, size_t size, size_t src_bits, size_t aim_bits, size_t *bytes_written, TickType_t ticks_to_wait); - -/** - * @brief Read data from I2S DMA receive buffer - * - * This function is deprecated. Use 'i2s_read' instead. - * This definition will be removed in a future release. - * - * @return - * - The amount of bytes read, if timeout, bytes read will be less than the size passed in - * - ESP_FAIL Parameter error - */ -int i2s_read_bytes(i2s_port_t i2s_num, void *dest, size_t size, TickType_t ticks_to_wait) __attribute__ ((deprecated)); - -/** - * @brief Read data from I2S DMA receive buffer - * - * @param i2s_num I2S_NUM_0, I2S_NUM_1 - * - * @param dest Destination address to read into - * - * @param size Size of data in bytes - * - * @param[out] bytes_read Number of bytes read, if timeout, bytes read will be less than the size passed in. - * - * @param ticks_to_wait RX buffer wait timeout in RTOS ticks. If this many ticks pass without bytes becoming available in the DMA receive buffer, then the function will return (note that if data is read from the DMA buffer in pieces, the overall operation may still take longer than this timeout.) Pass portMAX_DELAY for no timeout. - * - * @note If the built-in ADC mode is enabled, we should call i2s_adc_start and i2s_adc_stop around the whole reading process, - * to prevent the data getting corrupted. - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t i2s_read(i2s_port_t i2s_num, void *dest, size_t size, size_t *bytes_read, TickType_t ticks_to_wait); - -/** - * @brief Write a single sample to the I2S DMA TX buffer. - * - * This function is deprecated. Use 'i2s_write' instead. - * This definition will be removed in a future release. - * - * @param i2s_num I2S_NUM_0, I2S_NUM_1 - * - * @param sample Buffer to read data. Size of buffer (in bytes) = bits_per_sample / 8. - * - * @param ticks_to_wait Timeout in RTOS ticks. If a sample is not available in the DMA buffer within this period, no data is read and function returns zero. - * - * @return - * - Number of bytes successfully pushed to DMA buffer, will be either zero or the size of configured sample buffer (in bytes). - * - ESP_FAIL Parameter error - */ -int i2s_push_sample(i2s_port_t i2s_num, const void *sample, TickType_t ticks_to_wait) __attribute__ ((deprecated)); - -/** - * @brief Read a single sample from the I2S DMA RX buffer. - * - * This function is deprecated. Use 'i2s_read' instead. - * This definition will be removed in a future release. - * - * @param i2s_num I2S_NUM_0, I2S_NUM_1 - * - * @param sample Buffer to write data. Size of buffer (in bytes) = bits_per_sample / 8. - * - * @param ticks_to_wait Timeout in RTOS ticks. If a sample is not available in the DMA buffer within this period, no data is read and function returns zero. - * - * @return - * - Number of bytes successfully read from DMA buffer, will be either zero or the size of configured sample buffer (in bytes). - * - ESP_FAIL Parameter error - */ -int i2s_pop_sample(i2s_port_t i2s_num, void *sample, TickType_t ticks_to_wait) __attribute__ ((deprecated)); - -/** - * @brief Set sample rate used for I2S RX and TX. - * - * The bit clock rate is determined by the sample rate and i2s_config_t configuration parameters (number of channels, bits_per_sample). - * - * `bit_clock = rate * (number of channels) * bits_per_sample` - * - * @param i2s_num I2S_NUM_0, I2S_NUM_1 - * - * @param rate I2S sample rate (ex: 8000, 44100...) - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_ERR_NO_MEM Out of memory - */ -esp_err_t i2s_set_sample_rates(i2s_port_t i2s_num, uint32_t rate); - -/** - * @brief Stop I2S driver - * - * Disables I2S TX/RX, until i2s_start() is called. - * - * @param i2s_num I2S_NUM_0, I2S_NUM_1 - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t i2s_stop(i2s_port_t i2s_num); - -/** - * @brief Start I2S driver - * - * It is not necessary to call this function after i2s_driver_install() (it is started automatically), however it is necessary to call it after i2s_stop(). - * - * - * @param i2s_num I2S_NUM_0, I2S_NUM_1 - * -* @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t i2s_start(i2s_port_t i2s_num); - -/** - * @brief Zero the contents of the TX DMA buffer. - * - * Pushes zero-byte samples into the TX DMA buffer, until it is full. - * - * @param i2s_num I2S_NUM_0, I2S_NUM_1 - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t i2s_zero_dma_buffer(i2s_port_t i2s_num); - -/** - * @brief Set clock & bit width used for I2S RX and TX. - * - * Similar to i2s_set_sample_rates(), but also sets bit width. - * - * @param i2s_num I2S_NUM_0, I2S_NUM_1 - * - * @param rate I2S sample rate (ex: 8000, 44100...) - * - * @param bits I2S bit width (I2S_BITS_PER_SAMPLE_16BIT, I2S_BITS_PER_SAMPLE_24BIT, I2S_BITS_PER_SAMPLE_32BIT) - * - * @param ch I2S channel, (I2S_CHANNEL_MONO, I2S_CHANNEL_STEREO) - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_ERR_NO_MEM Out of memory - */ -esp_err_t i2s_set_clk(i2s_port_t i2s_num, uint32_t rate, i2s_bits_per_sample_t bits, i2s_channel_t ch); - -/** - * @brief Set built-in ADC mode for I2S DMA, this function will initialize ADC pad, - * and set ADC parameters. - * @param adc_unit SAR ADC unit index - * @param adc_channel ADC channel index - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t i2s_set_adc_mode(adc_unit_t adc_unit, adc1_channel_t adc_channel); - -/** - * @brief Start to use I2S built-in ADC mode - * @note This function would acquire the lock of ADC to prevent the data getting corrupted - * during the I2S peripheral is being used to do fully continuous ADC sampling. - * - * @param i2s_num i2s port index - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_ERR_INVALID_STATE Driver state error - */ -esp_err_t i2s_adc_enable(i2s_port_t i2s_num); - -/** - * @brief Stop to use I2S built-in ADC mode - * @param i2s_num i2s port index - * @note This function would release the lock of ADC so that other tasks can use ADC. - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_ERR_INVALID_STATE Driver state error - */ -esp_err_t i2s_adc_disable(i2s_port_t i2s_num); - -#ifdef __cplusplus -} -#endif - -#endif /* _DRIVER_I2S_H_ */ diff --git a/tools/sdk/include/driver/driver/ledc.h b/tools/sdk/include/driver/driver/ledc.h deleted file mode 100644 index 6a82c19a2f9..00000000000 --- a/tools/sdk/include/driver/driver/ledc.h +++ /dev/null @@ -1,510 +0,0 @@ -// 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. - -#ifndef _DRIVER_LEDC_H_ -#define _DRIVER_LEDC_H_ -#include "esp_err.h" -#include "soc/soc.h" -#include "driver/gpio.h" -#include "driver/periph_ctrl.h" -#include "esp_intr_alloc.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define LEDC_APB_CLK_HZ (APB_CLK_FREQ) -#define LEDC_REF_CLK_HZ (1*1000000) -#define LEDC_ERR_DUTY (0xFFFFFFFF) -#define LEDC_ERR_VAL (-1) - -typedef enum { - LEDC_HIGH_SPEED_MODE = 0, /*!< LEDC high speed speed_mode */ - LEDC_LOW_SPEED_MODE, /*!< LEDC low speed speed_mode */ - LEDC_SPEED_MODE_MAX, /*!< LEDC speed limit */ -} ledc_mode_t; - -typedef enum { - LEDC_INTR_DISABLE = 0, /*!< Disable LEDC interrupt */ - LEDC_INTR_FADE_END, /*!< Enable LEDC interrupt */ -} ledc_intr_type_t; - -typedef enum { - LEDC_DUTY_DIR_DECREASE = 0, /*!< LEDC duty decrease direction */ - LEDC_DUTY_DIR_INCREASE = 1, /*!< LEDC duty increase direction */ - LEDC_DUTY_DIR_MAX, -} ledc_duty_direction_t; - -typedef enum { - LEDC_REF_TICK = 0, /*!< LEDC timer clock divided from reference tick (1Mhz) */ - LEDC_APB_CLK, /*!< LEDC timer clock divided from APB clock (80Mhz) */ -} ledc_clk_src_t; - -typedef enum { - LEDC_TIMER_0 = 0, /*!< LEDC timer 0 */ - LEDC_TIMER_1, /*!< LEDC timer 1 */ - LEDC_TIMER_2, /*!< LEDC timer 2 */ - LEDC_TIMER_3, /*!< LEDC timer 3 */ - LEDC_TIMER_MAX, -} ledc_timer_t; - -typedef enum { - LEDC_CHANNEL_0 = 0, /*!< LEDC channel 0 */ - LEDC_CHANNEL_1, /*!< LEDC channel 1 */ - LEDC_CHANNEL_2, /*!< LEDC channel 2 */ - LEDC_CHANNEL_3, /*!< LEDC channel 3 */ - LEDC_CHANNEL_4, /*!< LEDC channel 4 */ - LEDC_CHANNEL_5, /*!< LEDC channel 5 */ - LEDC_CHANNEL_6, /*!< LEDC channel 6 */ - LEDC_CHANNEL_7, /*!< LEDC channel 7 */ - LEDC_CHANNEL_MAX, -} ledc_channel_t; - -typedef enum { - LEDC_TIMER_1_BIT = 1, /*!< LEDC PWM duty resolution of 1 bits */ - LEDC_TIMER_2_BIT, /*!< LEDC PWM duty resolution of 2 bits */ - LEDC_TIMER_3_BIT, /*!< LEDC PWM duty resolution of 3 bits */ - LEDC_TIMER_4_BIT, /*!< LEDC PWM duty resolution of 4 bits */ - LEDC_TIMER_5_BIT, /*!< LEDC PWM duty resolution of 5 bits */ - LEDC_TIMER_6_BIT, /*!< LEDC PWM duty resolution of 6 bits */ - LEDC_TIMER_7_BIT, /*!< LEDC PWM duty resolution of 7 bits */ - LEDC_TIMER_8_BIT, /*!< LEDC PWM duty resolution of 8 bits */ - LEDC_TIMER_9_BIT, /*!< LEDC PWM duty resolution of 9 bits */ - LEDC_TIMER_10_BIT, /*!< LEDC PWM duty resolution of 10 bits */ - LEDC_TIMER_11_BIT, /*!< LEDC PWM duty resolution of 11 bits */ - LEDC_TIMER_12_BIT, /*!< LEDC PWM duty resolution of 12 bits */ - LEDC_TIMER_13_BIT, /*!< LEDC PWM duty resolution of 13 bits */ - LEDC_TIMER_14_BIT, /*!< LEDC PWM duty resolution of 14 bits */ - LEDC_TIMER_15_BIT, /*!< LEDC PWM duty resolution of 15 bits */ - LEDC_TIMER_16_BIT, /*!< LEDC PWM duty resolution of 16 bits */ - LEDC_TIMER_17_BIT, /*!< LEDC PWM duty resolution of 17 bits */ - LEDC_TIMER_18_BIT, /*!< LEDC PWM duty resolution of 18 bits */ - LEDC_TIMER_19_BIT, /*!< LEDC PWM duty resolution of 19 bits */ - LEDC_TIMER_20_BIT, /*!< LEDC PWM duty resolution of 20 bits */ - LEDC_TIMER_BIT_MAX, -} ledc_timer_bit_t; - -typedef enum { - LEDC_FADE_NO_WAIT = 0, /*!< LEDC fade function will return immediately */ - LEDC_FADE_WAIT_DONE, /*!< LEDC fade function will block until fading to the target duty */ - LEDC_FADE_MAX, -} ledc_fade_mode_t; - -/** - * @brief Configuration parameters of LEDC channel for ledc_channel_config function - */ -typedef struct { - int gpio_num; /*!< the LEDC output gpio_num, if you want to use gpio16, gpio_num = 16 */ - ledc_mode_t speed_mode; /*!< LEDC speed speed_mode, high-speed mode or low-speed mode */ - ledc_channel_t channel; /*!< LEDC channel (0 - 7) */ - ledc_intr_type_t intr_type; /*!< configure interrupt, Fade interrupt enable or Fade interrupt disable */ - ledc_timer_t timer_sel; /*!< Select the timer source of channel (0 - 3) */ - uint32_t duty; /*!< LEDC channel duty, the range of duty setting is [0, (2**duty_resolution)] */ - int hpoint; /*!< LEDC channel hpoint value, the max value is 0xfffff */ -} ledc_channel_config_t; - -/** - * @brief Configuration parameters of LEDC Timer timer for ledc_timer_config function - */ -typedef struct { - ledc_mode_t speed_mode; /*!< LEDC speed speed_mode, high-speed mode or low-speed mode */ - union { - ledc_timer_bit_t duty_resolution; /*!< LEDC channel duty resolution */ - ledc_timer_bit_t bit_num __attribute__((deprecated)); /*!< Deprecated in ESP-IDF 3.0. This is an alias to 'duty_resolution' for backward compatibility with ESP-IDF 2.1 */ - }; - ledc_timer_t timer_num; /*!< The timer source of channel (0 - 3) */ - uint32_t freq_hz; /*!< LEDC timer frequency (Hz) */ -} ledc_timer_config_t; - -typedef intr_handle_t ledc_isr_handle_t; - -/** - * @brief LEDC channel configuration - * Configure LEDC channel with the given channel/output gpio_num/interrupt/source timer/frequency(Hz)/LEDC duty resolution - * - * @param ledc_conf Pointer of LEDC channel configure struct - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t ledc_channel_config(const ledc_channel_config_t* ledc_conf); - -/** - * @brief LEDC timer configuration - * Configure LEDC timer with the given source timer/frequency(Hz)/duty_resolution - * - * @param timer_conf Pointer of LEDC timer configure struct - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_FAIL Can not find a proper pre-divider number base on the given frequency and the current duty_resolution. - */ -esp_err_t ledc_timer_config(const ledc_timer_config_t* timer_conf); - -/** - * @brief LEDC update channel parameters - * @note Call this function to activate the LEDC updated parameters. - * After ledc_set_duty, we need to call this function to update the settings. - * @note ledc_set_duty, ledc_set_duty_with_hpoint and ledc_update_duty are not thread-safe, do not call these functions to - * control one LEDC channel in different tasks at the same time. - * A thread-safe version of API is ledc_set_duty_and_update - * @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode, - * @param channel LEDC channel (0-7), select from ledc_channel_t - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - * - */ -esp_err_t ledc_update_duty(ledc_mode_t speed_mode, ledc_channel_t channel); - -/** - * @brief LEDC stop. - * Disable LEDC output, and set idle level - * - * @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode - * @param channel LEDC channel (0-7), select from ledc_channel_t - * @param idle_level Set output idle level after LEDC stops. - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t ledc_stop(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t idle_level); - -/** - * @brief LEDC set channel frequency (Hz) - * - * @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode - * @param timer_num LEDC timer index (0-3), select from ledc_timer_t - * @param freq_hz Set the LEDC frequency - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_FAIL Can not find a proper pre-divider number base on the given frequency and the current duty_resolution. - */ -esp_err_t ledc_set_freq(ledc_mode_t speed_mode, ledc_timer_t timer_num, uint32_t freq_hz); - -/** - * @brief LEDC get channel frequency (Hz) - * - * @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode - * @param timer_num LEDC timer index (0-3), select from ledc_timer_t - * - * @return - * - 0 error - * - Others Current LEDC frequency - */ -uint32_t ledc_get_freq(ledc_mode_t speed_mode, ledc_timer_t timer_num); - -/** - * @brief LEDC set duty and hpoint value - * Only after calling ledc_update_duty will the duty update. - * @note ledc_set_duty, ledc_set_duty_with_hpoint and ledc_update_duty are not thread-safe, do not call these functions to - * control one LEDC channel in different tasks at the same time. - * A thread-safe version of API is ledc_set_duty_and_update - * @note If a fade operation is running in progress on that channel, the driver would not allow it to be stopped. - * Other duty operations will have to wait until the fade operation has finished. - * @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode - * @param channel LEDC channel (0-7), select from ledc_channel_t - * @param duty Set the LEDC duty, the range of duty setting is [0, (2**duty_resolution)] - * @param hpoint Set the LEDC hpoint value(max: 0xfffff) - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t ledc_set_duty_with_hpoint(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t duty, uint32_t hpoint); - -/** - * @brief LEDC get hpoint value, the counter value when the output is set high level. - * - * @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode - * @param channel LEDC channel (0-7), select from ledc_channel_t - * @return - * - LEDC_ERR_VAL if parameter error - * - Others Current hpoint value of LEDC channel - */ -int ledc_get_hpoint(ledc_mode_t speed_mode, ledc_channel_t channel); - -/** - * @brief LEDC set duty - * This function do not change the hpoint value of this channel. if needed, please call ledc_set_duty_with_hpoint. - * only after calling ledc_update_duty will the duty update. - * @note ledc_set_duty, ledc_set_duty_with_hpoint and ledc_update_duty are not thread-safe, do not call these functions to - * control one LEDC channel in different tasks at the same time. - * A thread-safe version of API is ledc_set_duty_and_update. - * @note If a fade operation is running in progress on that channel, the driver would not allow it to be stopped. - * Other duty operations will have to wait until the fade operation has finished. - * @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode - * @param channel LEDC channel (0-7), select from ledc_channel_t - * @param duty Set the LEDC duty, the range of duty setting is [0, (2**duty_resolution)] - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t ledc_set_duty(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t duty); - -/** - * @brief LEDC get duty - * - * @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode - * @param channel LEDC channel (0-7), select from ledc_channel_t - * - * @return - * - LEDC_ERR_DUTY if parameter error - * - Others Current LEDC duty - */ -uint32_t ledc_get_duty(ledc_mode_t speed_mode, ledc_channel_t channel); - -/** - * @brief LEDC set gradient - * Set LEDC gradient, After the function calls the ledc_update_duty function, the function can take effect. - * @note If a fade operation is running in progress on that channel, the driver would not allow it to be stopped. - * Other duty operations will have to wait until the fade operation has finished. - * @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode - * @param channel LEDC channel (0-7), select from ledc_channel_t - * @param duty Set the start of the gradient duty, the range of duty setting is [0, (2**duty_resolution)] - * @param fade_direction Set the direction of the gradient - * @param step_num Set the number of the gradient - * @param duty_cyle_num Set how many LEDC tick each time the gradient lasts - * @param duty_scale Set gradient change amplitude - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t ledc_set_fade(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t duty, ledc_duty_direction_t fade_direction, - uint32_t step_num, uint32_t duty_cyle_num, uint32_t duty_scale); - -/** - * @brief Register LEDC interrupt handler, the handler is an ISR. - * The handler will be attached to the same CPU core that this function is running on. - * - * @param fn Interrupt handler function. - * @param arg User-supplied argument passed to the handler function. - * @param intr_alloc_flags Flags used to allocate the interrupt. One or multiple (ORred) - * ESP_INTR_FLAG_* values. See esp_intr_alloc.h for more info. - * @param arg Parameter for handler function - * @param handle Pointer to return handle. If non-NULL, a handle for the interrupt will - * be returned here. - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Function pointer error. - */ -esp_err_t ledc_isr_register(void (*fn)(void*), void * arg, int intr_alloc_flags, ledc_isr_handle_t *handle); - -/** - * @brief Configure LEDC settings - * - * @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode - * @param timer_sel Timer index (0-3), there are 4 timers in LEDC module - * @param clock_divider Timer clock divide value, the timer clock is divided from the selected clock source - * @param duty_resolution Resolution of duty setting in number of bits. The range of duty values is [0, (2**duty_resolution)] - * @param clk_src Select LEDC source clock. - * - * @return - * - (-1) Parameter error - * - Other Current LEDC duty - */ -esp_err_t ledc_timer_set(ledc_mode_t speed_mode, ledc_timer_t timer_sel, uint32_t clock_divider, uint32_t duty_resolution, ledc_clk_src_t clk_src); - -/** - * @brief Reset LEDC timer - * - * @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode - * @param timer_sel LEDC timer index (0-3), select from ledc_timer_t - * - * @return - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_OK Success - */ -esp_err_t ledc_timer_rst(ledc_mode_t speed_mode, uint32_t timer_sel); - -/** - * @brief Pause LEDC timer counter - * - * @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode - * @param timer_sel LEDC timer index (0-3), select from ledc_timer_t - * - * @return - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_OK Success - * - */ -esp_err_t ledc_timer_pause(ledc_mode_t speed_mode, uint32_t timer_sel); - -/** - * @brief Resume LEDC timer - * - * @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode - * @param timer_sel LEDC timer index (0-3), select from ledc_timer_t - * - * @return - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_OK Success - */ -esp_err_t ledc_timer_resume(ledc_mode_t speed_mode, uint32_t timer_sel); - -/** - * @brief Bind LEDC channel with the selected timer - * - * @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode - * @param channel LEDC channel index (0-7), select from ledc_channel_t - * @param timer_idx LEDC timer index (0-3), select from ledc_timer_t - * - * @return - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_OK Success - */ -esp_err_t ledc_bind_channel_timer(ledc_mode_t speed_mode, uint32_t channel, uint32_t timer_idx); - -/** - * @brief Set LEDC fade function. - * @note Call ledc_fade_func_install() once before calling this function. - * Call ledc_fade_start() after this to start fading. - * @note ledc_set_fade_with_step, ledc_set_fade_with_time and ledc_fade_start are not thread-safe, do not call these functions to - * control one LEDC channel in different tasks at the same time. - * A thread-safe version of API is ledc_set_fade_step_and_start - * @note If a fade operation is running in progress on that channel, the driver would not allow it to be stopped. - * Other duty operations will have to wait until the fade operation has finished. - * @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode, - * @param channel LEDC channel index (0-7), select from ledc_channel_t - * @param target_duty Target duty of fading [0, (2**duty_resolution) - 1] - * @param scale Controls the increase or decrease step scale. - * @param cycle_num increase or decrease the duty every cycle_num cycles - * - * @return - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_OK Success - * - ESP_ERR_INVALID_STATE Fade function not installed. - * - ESP_FAIL Fade function init error - */ -esp_err_t ledc_set_fade_with_step(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t target_duty, uint32_t scale, uint32_t cycle_num); - -/** - * @brief Set LEDC fade function, with a limited time. - * @note Call ledc_fade_func_install() once before calling this function. - * Call ledc_fade_start() after this to start fading. - * @note ledc_set_fade_with_step, ledc_set_fade_with_time and ledc_fade_start are not thread-safe, do not call these functions to - * control one LEDC channel in different tasks at the same time. - * A thread-safe version of API is ledc_set_fade_step_and_start - * @note If a fade operation is running in progress on that channel, the driver would not allow it to be stopped. - * Other duty operations will have to wait until the fade operation has finished. - * @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode, - * @param channel LEDC channel index (0-7), select from ledc_channel_t - * @param target_duty Target duty of fading.( 0 - (2 ** duty_resolution - 1))) - * @param max_fade_time_ms The maximum time of the fading ( ms ). - * - * @return - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_OK Success - * - ESP_ERR_INVALID_STATE Fade function not installed. - * - ESP_FAIL Fade function init error - */ -esp_err_t ledc_set_fade_with_time(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t target_duty, int max_fade_time_ms); - -/** - * @brief Install LEDC fade function. This function will occupy interrupt of LEDC module. - * @param intr_alloc_flags Flags used to allocate the interrupt. One or multiple (ORred) - * ESP_INTR_FLAG_* values. See esp_intr_alloc.h for more info. - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_STATE Fade function already installed. - */ -esp_err_t ledc_fade_func_install(int intr_alloc_flags); - -/** - * @brief Uninstall LEDC fade function. - * - */ -void ledc_fade_func_uninstall(); - -/** - * @brief Start LEDC fading. - * @note Call ledc_fade_func_install() once before calling this function. - * Call this API right after ledc_set_fade_with_time or ledc_set_fade_with_step before to start fading. - * @note If a fade operation is running in progress on that channel, the driver would not allow it to be stopped. - * Other duty operations will have to wait until the fade operation has finished. - * @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode - * @param channel LEDC channel number - * @param fade_mode Whether to block until fading done. - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_STATE Fade function not installed. - * - ESP_ERR_INVALID_ARG Parameter error. - */ -esp_err_t ledc_fade_start(ledc_mode_t speed_mode, ledc_channel_t channel, ledc_fade_mode_t fade_mode); - -/** - * @brief A thread-safe API to set duty for LEDC channel and return when duty updated. - * @note If a fade operation is running in progress on that channel, the driver would not allow it to be stopped. - * Other duty operations will have to wait until the fade operation has finished. - * - * @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode - * @param channel LEDC channel (0-7), select from ledc_channel_t - * @param duty Set the LEDC duty, the range of duty setting is [0, (2**duty_resolution)] - * @param hpoint Set the LEDC hpoint value(max: 0xfffff) - * - */ -esp_err_t ledc_set_duty_and_update(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t duty, uint32_t hpoint); - -/** - * @brief A thread-safe API to set and start LEDC fade function, with a limited time. - * @note Call ledc_fade_func_install() once, before calling this function. - * @note If a fade operation is running in progress on that channel, the driver would not allow it to be stopped. - * Other duty operations will have to wait until the fade operation has finished. - * @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode, - * @param channel LEDC channel index (0-7), select from ledc_channel_t - * @param target_duty Target duty of fading.( 0 - (2 ** duty_resolution - 1))) - * @param max_fade_time_ms The maximum time of the fading ( ms ). - * @param fade_mode choose blocking or non-blocking mode - * @return - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_OK Success - * - ESP_ERR_INVALID_STATE Fade function not installed. - * - ESP_FAIL Fade function init error - */ -esp_err_t ledc_set_fade_time_and_start(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t target_duty, uint32_t max_fade_time_ms, ledc_fade_mode_t fade_mode); - -/** - * @brief A thread-safe API to set and start LEDC fade function. - * @note Call ledc_fade_func_install() once before calling this function. - * @note If a fade operation is running in progress on that channel, the driver would not allow it to be stopped. - * Other duty operations will have to wait until the fade operation has finished. - * @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode, - * @param channel LEDC channel index (0-7), select from ledc_channel_t - * @param target_duty Target duty of fading [0, (2**duty_resolution) - 1] - * @param scale Controls the increase or decrease step scale. - * @param cycle_num increase or decrease the duty every cycle_num cycles - * @param fade_mode choose blocking or non-blocking mode - * @return - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_OK Success - * - ESP_ERR_INVALID_STATE Fade function not installed. - * - ESP_FAIL Fade function init error - */ -esp_err_t ledc_set_fade_step_and_start(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t target_duty, uint32_t scale, uint32_t cycle_num, ledc_fade_mode_t fade_mode); -#ifdef __cplusplus -} -#endif - -#endif /* _DRIVER_LEDC_H_ */ diff --git a/tools/sdk/include/driver/driver/mcpwm.h b/tools/sdk/include/driver/driver/mcpwm.h deleted file mode 100644 index 301ca41926b..00000000000 --- a/tools/sdk/include/driver/driver/mcpwm.h +++ /dev/null @@ -1,710 +0,0 @@ -// 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. - -#ifndef _DRIVER_MCPWM_H_ -#define _DRIVER_MCPWM_H_ - -#include "esp_err.h" -#include "soc/soc.h" -#include "driver/gpio.h" -#include "driver/periph_ctrl.h" -#include "esp_intr.h" -#include "esp_intr_alloc.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief IO signals for the MCPWM - * - * - 6 MCPWM output pins that generate PWM signals - * - 3 MCPWM fault input pins to detect faults like overcurrent, overvoltage, etc. - * - 3 MCPWM sync input pins to synchronize MCPWM outputs signals - * - 3 MCPWM capture input pins to gather feedback from controlled motors, using e.g. hall sensors - */ -typedef enum { - MCPWM0A = 0, /*! -#include "esp_intr.h" -#include "esp_err.h" -#include "freertos/FreeRTOS.h" -#include "freertos/semphr.h" -#include "freertos/xtensa_api.h" -#include "soc/soc.h" -#include "soc/pcnt_reg.h" -#include "soc/pcnt_struct.h" -#include "soc/gpio_sig_map.h" -#include "driver/gpio.h" -#include "esp_intr_alloc.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define PCNT_PIN_NOT_USED (-1) /*!< When selected for a pin, this pin will not be used */ - -/** - * @brief Selection of available modes that determine the counter's action depending on the state of the control signal's input GPIO - * @note Configuration covers two actions, one for high, and one for low level on the control input - */ -typedef enum { - PCNT_MODE_KEEP = 0, /*!< Control mode: won't change counter mode*/ - PCNT_MODE_REVERSE = 1, /*!< Control mode: invert counter mode(increase -> decrease, decrease -> increase) */ - PCNT_MODE_DISABLE = 2, /*!< Control mode: Inhibit counter(counter value will not change in this condition) */ - PCNT_MODE_MAX -} pcnt_ctrl_mode_t; - -/** - * @brief Selection of available modes that determine the counter's action on the edge of the pulse signal's input GPIO - * @note Configuration covers two actions, one for positive, and one for negative edge on the pulse input - */ -typedef enum { - PCNT_COUNT_DIS = 0, /*!< Counter mode: Inhibit counter(counter value will not change in this condition) */ - PCNT_COUNT_INC = 1, /*!< Counter mode: Increase counter value */ - PCNT_COUNT_DEC = 2, /*!< Counter mode: Decrease counter value */ - PCNT_COUNT_MAX -} pcnt_count_mode_t; - -/** - * @brief Selection of all available PCNT units - */ -typedef enum { - PCNT_UNIT_0 = 0, /*!< PCNT unit 0 */ - PCNT_UNIT_1 = 1, /*!< PCNT unit 1 */ - PCNT_UNIT_2 = 2, /*!< PCNT unit 2 */ - PCNT_UNIT_3 = 3, /*!< PCNT unit 3 */ - PCNT_UNIT_4 = 4, /*!< PCNT unit 4 */ - PCNT_UNIT_5 = 5, /*!< PCNT unit 5 */ - PCNT_UNIT_6 = 6, /*!< PCNT unit 6 */ - PCNT_UNIT_7 = 7, /*!< PCNT unit 7 */ - PCNT_UNIT_MAX, -} pcnt_unit_t; - -/** - * @brief Selection of channels available for a single PCNT unit - */ -typedef enum { - PCNT_CHANNEL_0 = 0x00, /*!< PCNT channel 0 */ - PCNT_CHANNEL_1 = 0x01, /*!< PCNT channel 1 */ - PCNT_CHANNEL_MAX, -} pcnt_channel_t; - -/** - * @brief Selection of counter's events the may trigger an interrupt - */ -typedef enum { - PCNT_EVT_L_LIM = 0, /*!< PCNT watch point event: Minimum counter value */ - PCNT_EVT_H_LIM = 1, /*!< PCNT watch point event: Maximum counter value */ - PCNT_EVT_THRES_0 = 2, /*!< PCNT watch point event: threshold0 value event */ - PCNT_EVT_THRES_1 = 3, /*!< PCNT watch point event: threshold1 value event */ - PCNT_EVT_ZERO = 4, /*!< PCNT watch point event: counter value zero event */ - PCNT_EVT_MAX -} pcnt_evt_type_t; - -/** - * @brief Pulse Counter configuration for a single channel - */ -typedef struct { - int pulse_gpio_num; /*!< Pulse input GPIO number, if you want to use GPIO16, enter pulse_gpio_num = 16, a negative value will be ignored */ - int ctrl_gpio_num; /*!< Control signal input GPIO number, a negative value will be ignored */ - pcnt_ctrl_mode_t lctrl_mode; /*!< PCNT low control mode */ - pcnt_ctrl_mode_t hctrl_mode; /*!< PCNT high control mode */ - pcnt_count_mode_t pos_mode; /*!< PCNT positive edge count mode */ - pcnt_count_mode_t neg_mode; /*!< PCNT negative edge count mode */ - int16_t counter_h_lim; /*!< Maximum counter value */ - int16_t counter_l_lim; /*!< Minimum counter value */ - pcnt_unit_t unit; /*!< PCNT unit number */ - pcnt_channel_t channel; /*!< the PCNT channel */ -} pcnt_config_t; - -typedef intr_handle_t pcnt_isr_handle_t; - -/** - * @brief Configure Pulse Counter unit - * @note - * This function will disable three events: PCNT_EVT_L_LIM, PCNT_EVT_H_LIM, PCNT_EVT_ZERO. - * - * @param pcnt_config Pointer of Pulse Counter unit configure parameter - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t pcnt_unit_config(const pcnt_config_t *pcnt_config); - -/** - * @brief Get pulse counter value - * - * @param pcnt_unit Pulse Counter unit number - * @param count Pointer to accept counter value - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t pcnt_get_counter_value(pcnt_unit_t pcnt_unit, int16_t* count); - -/** - * @brief Pause PCNT counter of PCNT unit - * - * @param pcnt_unit PCNT unit number - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t pcnt_counter_pause(pcnt_unit_t pcnt_unit); - -/** - * @brief Resume counting for PCNT counter - * - * @param pcnt_unit PCNT unit number, select from pcnt_unit_t - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t pcnt_counter_resume(pcnt_unit_t pcnt_unit); - -/** - * @brief Clear and reset PCNT counter value to zero - * - * @param pcnt_unit PCNT unit number, select from pcnt_unit_t - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t pcnt_counter_clear(pcnt_unit_t pcnt_unit); - -/** - * @brief Enable PCNT interrupt for PCNT unit - * @note - * Each Pulse counter unit has five watch point events that share the same interrupt. - * Configure events with pcnt_event_enable() and pcnt_event_disable() - * - * @param pcnt_unit PCNT unit number - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t pcnt_intr_enable(pcnt_unit_t pcnt_unit); - -/** - * @brief Disable PCNT interrupt for PCNT unit - * - * @param pcnt_unit PCNT unit number - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t pcnt_intr_disable(pcnt_unit_t pcnt_unit); - -/** - * @brief Enable PCNT event of PCNT unit - * - * @param unit PCNT unit number - * @param evt_type Watch point event type. - * All enabled events share the same interrupt (one interrupt per pulse counter unit). - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t pcnt_event_enable(pcnt_unit_t unit, pcnt_evt_type_t evt_type); - -/** - * @brief Disable PCNT event of PCNT unit - * - * @param unit PCNT unit number - * @param evt_type Watch point event type. - * All enabled events share the same interrupt (one interrupt per pulse counter unit). - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t pcnt_event_disable(pcnt_unit_t unit, pcnt_evt_type_t evt_type); - -/** - * @brief Set PCNT event value of PCNT unit - * - * @param unit PCNT unit number - * @param evt_type Watch point event type. - * All enabled events share the same interrupt (one interrupt per pulse counter unit). - * - * @param value Counter value for PCNT event - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t pcnt_set_event_value(pcnt_unit_t unit, pcnt_evt_type_t evt_type, int16_t value); - -/** - * @brief Get PCNT event value of PCNT unit - * - * @param unit PCNT unit number - * @param evt_type Watch point event type. - * All enabled events share the same interrupt (one interrupt per pulse counter unit). - * @param value Pointer to accept counter value for PCNT event - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t pcnt_get_event_value(pcnt_unit_t unit, pcnt_evt_type_t evt_type, int16_t *value); - -/** - * @brief Register PCNT interrupt handler, the handler is an ISR. - * The handler will be attached to the same CPU core that this function is running on. - * Please do not use pcnt_isr_service_install if this function was called. - * - * @param fn Interrupt handler function. - * @param arg Parameter for handler function - * @param intr_alloc_flags Flags used to allocate the interrupt. One or multiple (ORred) - * ESP_INTR_FLAG_* values. See esp_intr_alloc.h for more info. - * @param handle Pointer to return handle. If non-NULL, a handle for the interrupt will - * be returned here. Calling esp_intr_free to unregister this ISR service if needed, - * but only if the handle is not NULL. - * - * @return - * - ESP_OK Success - * - ESP_ERR_NOT_FOUND Can not find the interrupt that matches the flags. - * - ESP_ERR_INVALID_ARG Function pointer error. - */ -esp_err_t pcnt_isr_register(void (*fn)(void*), void * arg, int intr_alloc_flags, pcnt_isr_handle_t *handle); - -/** - * @brief Configure PCNT pulse signal input pin and control input pin - * - * @param unit PCNT unit number - * @param channel PCNT channel number - * @param pulse_io Pulse signal input GPIO - * @param ctrl_io Control signal input GPIO - * - * @note Set the signal input to PCNT_PIN_NOT_USED if unused. - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t pcnt_set_pin(pcnt_unit_t unit, pcnt_channel_t channel, int pulse_io, int ctrl_io); - -/** - * @brief Enable PCNT input filter - * - * @param unit PCNT unit number - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t pcnt_filter_enable(pcnt_unit_t unit); - -/** - * @brief Disable PCNT input filter - * - * @param unit PCNT unit number - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t pcnt_filter_disable(pcnt_unit_t unit); - -/** - * @brief Set PCNT filter value - * - * @param unit PCNT unit number - * @param filter_val PCNT signal filter value, counter in APB_CLK cycles. - * Any pulses lasting shorter than this will be ignored when the filter is enabled. - * @note - * filter_val is a 10-bit value, so the maximum filter_val should be limited to 1023. - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t pcnt_set_filter_value(pcnt_unit_t unit, uint16_t filter_val); - -/** - * @brief Get PCNT filter value - * - * @param unit PCNT unit number - * @param filter_val Pointer to accept PCNT filter value. - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t pcnt_get_filter_value(pcnt_unit_t unit, uint16_t *filter_val); - -/** - * @brief Set PCNT counter mode - * - * @param unit PCNT unit number - * @param channel PCNT channel number - * @param pos_mode Counter mode when detecting positive edge - * @param neg_mode Counter mode when detecting negative edge - * @param hctrl_mode Counter mode when control signal is high level - * @param lctrl_mode Counter mode when control signal is low level - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t pcnt_set_mode(pcnt_unit_t unit, pcnt_channel_t channel, - pcnt_count_mode_t pos_mode, pcnt_count_mode_t neg_mode, - pcnt_ctrl_mode_t hctrl_mode, pcnt_ctrl_mode_t lctrl_mode); - -/** - * @brief Add ISR handler for specified unit. - * - * Call this function after using pcnt_isr_service_install() to - * install the PCNT driver's ISR handler service. - * - * The ISR handlers do not need to be declared with IRAM_ATTR, - * unless you pass the ESP_INTR_FLAG_IRAM flag when allocating the - * ISR in pcnt_isr_service_install(). - * - * This ISR handler will be called from an ISR. So there is a stack - * size limit (configurable as "ISR stack size" in menuconfig). This - * limit is smaller compared to a global PCNT interrupt handler due - * to the additional level of indirection. - * - * @param unit PCNT unit number - * @param isr_handler Interrupt handler function. - * @param args Parameter for handler function - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t pcnt_isr_handler_add(pcnt_unit_t unit, void(*isr_handler)(void *), void *args); - -/** - * @brief Install PCNT ISR service. - * @note We can manage different interrupt service for each unit. - * This function will use the default ISR handle service, Calling pcnt_isr_service_uninstall to - * uninstall the default service if needed. Please do not use pcnt_isr_register if this function was called. - * - * @param intr_alloc_flags Flags used to allocate the interrupt. One or multiple (ORred) - * ESP_INTR_FLAG_* values. See esp_intr_alloc.h for more info. - * - * @return - * - ESP_OK Success - * - ESP_ERR_NO_MEM No memory to install this service - * - ESP_ERR_INVALID_STATE ISR service already installed - */ -esp_err_t pcnt_isr_service_install(int intr_alloc_flags); - -/** - * @brief Uninstall PCNT ISR service, freeing related resources. - */ -void pcnt_isr_service_uninstall(void); - -/** - * @brief Delete ISR handler for specified unit. - * - * @param unit PCNT unit number - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t pcnt_isr_handler_remove(pcnt_unit_t unit); - -/** - * @addtogroup pcnt-examples - * - * @{ - * - * EXAMPLE OF PCNT CONFIGURATION - * ============================== - * @code{c} - * //1. Config PCNT unit - * pcnt_config_t pcnt_config = { - * .pulse_gpio_num = 4, //set gpio4 as pulse input gpio - * .ctrl_gpio_num = 5, //set gpio5 as control gpio - * .channel = PCNT_CHANNEL_0, //use unit 0 channel 0 - * .lctrl_mode = PCNT_MODE_REVERSE, //when control signal is low, reverse the primary counter mode(inc->dec/dec->inc) - * .hctrl_mode = PCNT_MODE_KEEP, //when control signal is high, keep the primary counter mode - * .pos_mode = PCNT_COUNT_INC, //increment the counter - * .neg_mode = PCNT_COUNT_DIS, //keep the counter value - * .counter_h_lim = 10, - * .counter_l_lim = -10, - * }; - * pcnt_unit_config(&pcnt_config); //init unit - * @endcode - * - * EXAMPLE OF PCNT EVENT SETTING - * ============================== - * @code{c} - * //2. Configure PCNT watchpoint event. - * pcnt_set_event_value(PCNT_UNIT_0, PCNT_EVT_THRES_1, 5); //set thres1 value - * pcnt_event_enable(PCNT_UNIT_0, PCNT_EVT_THRES_1); //enable thres1 event - * @endcode - * - * For more examples please refer to PCNT example code in IDF_PATH/examples - * - * @} - */ - -#ifdef __cplusplus -} -#endif - - -#endif diff --git a/tools/sdk/include/driver/driver/periph_ctrl.h b/tools/sdk/include/driver/driver/periph_ctrl.h deleted file mode 100644 index 9689a8cb21c..00000000000 --- a/tools/sdk/include/driver/driver/periph_ctrl.h +++ /dev/null @@ -1,70 +0,0 @@ -// 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. - -#ifndef _DRIVER_PERIPH_CTRL_H_ -#define _DRIVER_PERIPH_CTRL_H_ - -#include "esp_err.h" -#include "soc/soc.h" -#include "soc/dport_reg.h" -#include "soc/periph_defs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief enable peripheral module - * - * @param[in] periph : Peripheral module name - * - * Clock for the module will be ungated, and reset de-asserted. - * - * @return NULL - * - */ -void periph_module_enable(periph_module_t periph); - -/** - * @brief disable peripheral module - * - * @param[in] periph : Peripheral module name - * - * Clock for the module will be gated, reset asserted. - * - * @return NULL - * - */ -void periph_module_disable(periph_module_t periph); - -/** - * @brief reset peripheral module - * - * @param[in] periph : Peripheral module name - * - * Reset will asserted then de-assrted for the peripheral. - * - * Calling this function does not enable or disable the clock for the module. - * - * @return NULL - * - */ -void periph_module_reset(periph_module_t periph); - - -#ifdef __cplusplus -} -#endif - -#endif /* _DRIVER_PERIPH_CTRL_H_ */ diff --git a/tools/sdk/include/driver/driver/rmt.h b/tools/sdk/include/driver/driver/rmt.h deleted file mode 100644 index bf6632f5d1e..00000000000 --- a/tools/sdk/include/driver/driver/rmt.h +++ /dev/null @@ -1,788 +0,0 @@ -// 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. - -#ifndef _DRIVER_RMT_CTRL_H_ -#define _DRIVER_RMT_CTRL_H_ -#include "esp_err.h" -#include "soc/rmt_reg.h" -#include "soc/dport_reg.h" -#include "soc/rmt_struct.h" -#include "freertos/FreeRTOS.h" -#include "freertos/semphr.h" -#include "freertos/xtensa_api.h" -#include "freertos/ringbuf.h" -#include "driver/gpio.h" -#include "driver/periph_ctrl.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define RMT_MEM_BLOCK_BYTE_NUM (256) -#define RMT_MEM_ITEM_NUM (RMT_MEM_BLOCK_BYTE_NUM/4) - -typedef enum { - RMT_CHANNEL_0 = 0, /*!< RMT Channel 0 */ - RMT_CHANNEL_1, /*!< RMT Channel 1 */ - RMT_CHANNEL_2, /*!< RMT Channel 2 */ - RMT_CHANNEL_3, /*!< RMT Channel 3 */ - RMT_CHANNEL_4, /*!< RMT Channel 4 */ - RMT_CHANNEL_5, /*!< RMT Channel 5 */ - RMT_CHANNEL_6, /*!< RMT Channel 6 */ - RMT_CHANNEL_7, /*!< RMT Channel 7 */ - RMT_CHANNEL_MAX -} rmt_channel_t; - -typedef enum { - RMT_MEM_OWNER_TX = 0, /*!< RMT RX mode, RMT transmitter owns the memory block*/ - RMT_MEM_OWNER_RX = 1, /*!< RMT RX mode, RMT receiver owns the memory block*/ - RMT_MEM_OWNER_MAX, -}rmt_mem_owner_t; - -typedef enum { - RMT_BASECLK_REF = 0, /*!< RMT source clock system reference tick, 1MHz by default (not supported in this version) */ - RMT_BASECLK_APB, /*!< RMT source clock is APB CLK, 80Mhz by default */ - RMT_BASECLK_MAX, -} rmt_source_clk_t; - -typedef enum { - RMT_DATA_MODE_FIFO = 0, /* -#include "esp_err.h" -#include "esp_intr_alloc.h" - -/** - * @brief Register a handler for specific RTC_CNTL interrupts - * - * Multiple handlers can be registered using this function. Whenever an - * RTC interrupt happens, all handlers with matching rtc_intr_mask values - * will be called. - * - * @param handler handler function to call - * @param handler_arg argument to be passed to the handler - * @param rtc_intr_mask combination of RTC_CNTL_*_INT_ENA bits indicating the - * sources to call the handler for - * @return - * - ESP_OK on success - * - ESP_ERR_NO_MEM not enough memory to allocate handler structure - * - other errors returned by esp_intr_alloc - */ -esp_err_t rtc_isr_register(intr_handler_t handler, void* handler_arg, - uint32_t rtc_intr_mask); -/** - * @brief Deregister the handler previously registered using rtc_isr_register - * @param handler handler function to call (as passed to rtc_isr_register) - * @param handler_arg argument of the handler (as passed to rtc_isr_register) - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if a handler matching both handler and - * handler_arg isn't registered - */ -esp_err_t rtc_isr_deregister(intr_handler_t handler, void* handler_arg); diff --git a/tools/sdk/include/driver/driver/rtc_io.h b/tools/sdk/include/driver/driver/rtc_io.h deleted file mode 100644 index 4e84ea1da27..00000000000 --- a/tools/sdk/include/driver/driver/rtc_io.h +++ /dev/null @@ -1,276 +0,0 @@ -// 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. - -#ifndef _DRIVER_RTC_GPIO_H_ -#define _DRIVER_RTC_GPIO_H_ - -#include -#include "esp_err.h" -#include "driver/gpio.h" -#include "soc/rtc_gpio_channel.h" -#include "soc/rtc_periph.h" -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - RTC_GPIO_MODE_INPUT_ONLY , /*!< Pad input */ - RTC_GPIO_MODE_OUTPUT_ONLY, /*!< Pad output */ - RTC_GPIO_MODE_INPUT_OUTPUT, /*!< Pad pull input + output */ - RTC_GPIO_MODE_DISABLED, /*!< Pad (output + input) disable */ -} rtc_gpio_mode_t; - -/** - * @brief Determine if the specified GPIO is a valid RTC GPIO. - * - * @param gpio_num GPIO number - * @return true if GPIO is valid for RTC GPIO use. false otherwise. - */ -inline static bool rtc_gpio_is_valid_gpio(gpio_num_t gpio_num) -{ - return gpio_num < GPIO_PIN_COUNT - && rtc_gpio_desc[gpio_num].reg != 0; -} - -#define RTC_GPIO_IS_VALID_GPIO(gpio_num) rtc_gpio_is_valid_gpio(gpio_num) // Deprecated, use rtc_gpio_is_valid_gpio() - -/** - * @brief Init a GPIO as RTC GPIO - * - * This function must be called when initializing a pad for an analog function. - * - * @param gpio_num GPIO number (e.g. GPIO_NUM_12) - * - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_ARG GPIO is not an RTC IO - */ -esp_err_t rtc_gpio_init(gpio_num_t gpio_num); - -/** - * @brief Init a GPIO as digital GPIO - * - * @param gpio_num GPIO number (e.g. GPIO_NUM_12) - * - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_ARG GPIO is not an RTC IO - */ -esp_err_t rtc_gpio_deinit(gpio_num_t gpio_num); - -/** - * @brief Get the RTC IO input level - * - * @param gpio_num GPIO number (e.g. GPIO_NUM_12) - * - * @return - * - 1 High level - * - 0 Low level - * - ESP_ERR_INVALID_ARG GPIO is not an RTC IO - */ -uint32_t rtc_gpio_get_level(gpio_num_t gpio_num); - -/** - * @brief Set the RTC IO output level - * - * @param gpio_num GPIO number (e.g. GPIO_NUM_12) - * @param level output level - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG GPIO is not an RTC IO - */ -esp_err_t rtc_gpio_set_level(gpio_num_t gpio_num, uint32_t level); - -/** - * @brief RTC GPIO set direction - * - * Configure RTC GPIO direction, such as output only, input only, - * output and input. - * - * @param gpio_num GPIO number (e.g. GPIO_NUM_12) - * @param mode GPIO direction - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG GPIO is not an RTC IO - */ -esp_err_t rtc_gpio_set_direction(gpio_num_t gpio_num, rtc_gpio_mode_t mode); - -/** - * @brief RTC GPIO pullup enable - * - * This function only works for RTC IOs. In general, call gpio_pullup_en, - * which will work both for normal GPIOs and RTC IOs. - * - * @param gpio_num GPIO number (e.g. GPIO_NUM_12) - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG GPIO is not an RTC IO - */ -esp_err_t rtc_gpio_pullup_en(gpio_num_t gpio_num); - -/** - * @brief RTC GPIO pulldown enable - * - * This function only works for RTC IOs. In general, call gpio_pulldown_en, - * which will work both for normal GPIOs and RTC IOs. - * - * @param gpio_num GPIO number (e.g. GPIO_NUM_12) - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG GPIO is not an RTC IO - */ -esp_err_t rtc_gpio_pulldown_en(gpio_num_t gpio_num); - -/** - * @brief RTC GPIO pullup disable - * - * This function only works for RTC IOs. In general, call gpio_pullup_dis, - * which will work both for normal GPIOs and RTC IOs. - * - * @param gpio_num GPIO number (e.g. GPIO_NUM_12) - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG GPIO is not an RTC IO - */ -esp_err_t rtc_gpio_pullup_dis(gpio_num_t gpio_num); - -/** - * @brief RTC GPIO pulldown disable - * - * This function only works for RTC IOs. In general, call gpio_pulldown_dis, - * which will work both for normal GPIOs and RTC IOs. - * - * @param gpio_num GPIO number (e.g. GPIO_NUM_12) - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG GPIO is not an RTC IO - */ -esp_err_t rtc_gpio_pulldown_dis(gpio_num_t gpio_num); - -/** - * @brief Enable hold function on an RTC IO pad - * - * Enabling HOLD function will cause the pad to latch current values of - * input enable, output enable, output value, function, drive strength values. - * This function is useful when going into light or deep sleep mode to prevent - * the pin configuration from changing. - * - * @param gpio_num GPIO number (e.g. GPIO_NUM_12) - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG GPIO is not an RTC IO - */ -esp_err_t rtc_gpio_hold_en(gpio_num_t gpio_num); - -/** - * @brief Disable hold function on an RTC IO pad - * - * Disabling hold function will allow the pad receive the values of - * input enable, output enable, output value, function, drive strength from - * RTC_IO peripheral. - * - * @param gpio_num GPIO number (e.g. GPIO_NUM_12) - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG GPIO is not an RTC IO - */ -esp_err_t rtc_gpio_hold_dis(gpio_num_t gpio_num); - -/** - * @brief Helper function to disconnect internal circuits from an RTC IO - * This function disables input, output, pullup, pulldown, and enables - * hold feature for an RTC IO. - * Use this function if an RTC IO needs to be disconnected from internal - * circuits in deep sleep, to minimize leakage current. - * - * In particular, for ESP32-WROVER module, call - * rtc_gpio_isolate(GPIO_NUM_12) before entering deep sleep, to reduce - * deep sleep current. - * - * @param gpio_num GPIO number (e.g. GPIO_NUM_12). - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_ARG if GPIO is not an RTC IO - */ -esp_err_t rtc_gpio_isolate(gpio_num_t gpio_num); - -/** - * @brief Disable force hold signal for all RTC IOs - * - * Each RTC pad has a "force hold" input signal from the RTC controller. - * If this signal is set, pad latches current values of input enable, - * function, output enable, and other signals which come from the RTC mux. - * Force hold signal is enabled before going into deep sleep for pins which - * are used for EXT1 wakeup. - */ -void rtc_gpio_force_hold_dis_all(); - -/** - * @brief Set RTC GPIO pad drive capability - * - * @param gpio_num GPIO number, only support output GPIOs - * @param strength Drive capability of the pad - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t rtc_gpio_set_drive_capability(gpio_num_t gpio_num, gpio_drive_cap_t strength); - -/** - * @brief Get RTC GPIO pad drive capability - * - * @param gpio_num GPIO number, only support output GPIOs - * @param strength Pointer to accept drive capability of the pad - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t rtc_gpio_get_drive_capability(gpio_num_t gpio_num, gpio_drive_cap_t* strength); - -/** - * @brief Enable wakeup from sleep mode using specific GPIO - * @param gpio_num GPIO number - * @param intr_type Wakeup on high level (GPIO_INTR_HIGH_LEVEL) or low level - * (GPIO_INTR_LOW_LEVEL) - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_ARG if gpio_num is not an RTC IO, or intr_type is not - * one of GPIO_INTR_HIGH_LEVEL, GPIO_INTR_LOW_LEVEL. - */ -esp_err_t rtc_gpio_wakeup_enable(gpio_num_t gpio_num, gpio_int_type_t intr_type); - -/** - * @brief Disable wakeup from sleep mode using specific GPIO - * @param gpio_num GPIO number - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_ARG if gpio_num is not an RTC IO - */ -esp_err_t rtc_gpio_wakeup_disable(gpio_num_t gpio_num); - - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/driver/driver/sdio_slave.h b/tools/sdk/include/driver/driver/sdio_slave.h deleted file mode 100644 index fba650d1dca..00000000000 --- a/tools/sdk/include/driver/driver/sdio_slave.h +++ /dev/null @@ -1,309 +0,0 @@ -// 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. - -#ifndef _DRIVER_SDIO_SLAVE_H_ -#define _DRIVER_SDIO_SLAVE_H_ - -#include "freertos/FreeRTOS.h" -#include "freertos/portmacro.h" -#include "esp_err.h" -#include "rom/queue.h" - -#include "soc/sdio_slave_periph.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define SDIO_SLAVE_RECV_MAX_BUFFER (4096-4) - -typedef void(*sdio_event_cb_t)(uint8_t event); - -/// Mask of interrupts sending to the host. -typedef enum { - SDIO_SLAVE_HOSTINT_SEND_NEW_PACKET = HOST_SLC0_RX_NEW_PACKET_INT_ENA, ///< New packet available - SDIO_SLAVE_HOSTINT_RECV_OVF = HOST_SLC0_TX_OVF_INT_ENA, ///< Slave receive buffer overflow - SDIO_SLAVE_HOSTINT_SEND_UDF = HOST_SLC0_RX_UDF_INT_ENA, ///< Slave sending buffer underflow (this case only happen when the host do not request for packet according to the packet len). - SDIO_SLAVE_HOSTINT_BIT7 = HOST_SLC0_TOHOST_BIT7_INT_ENA, ///< General purpose interrupt bits that can be used by the user. - SDIO_SLAVE_HOSTINT_BIT6 = HOST_SLC0_TOHOST_BIT6_INT_ENA, - SDIO_SLAVE_HOSTINT_BIT5 = HOST_SLC0_TOHOST_BIT5_INT_ENA, - SDIO_SLAVE_HOSTINT_BIT4 = HOST_SLC0_TOHOST_BIT4_INT_ENA, - SDIO_SLAVE_HOSTINT_BIT3 = HOST_SLC0_TOHOST_BIT3_INT_ENA, - SDIO_SLAVE_HOSTINT_BIT2 = HOST_SLC0_TOHOST_BIT2_INT_ENA, - SDIO_SLAVE_HOSTINT_BIT1 = HOST_SLC0_TOHOST_BIT1_INT_ENA, - SDIO_SLAVE_HOSTINT_BIT0 = HOST_SLC0_TOHOST_BIT0_INT_ENA, -} sdio_slave_hostint_t; - -/// Timing of SDIO slave -typedef enum { - SDIO_SLAVE_TIMING_PSEND_PSAMPLE = 0,/**< Send at posedge, and sample at posedge. Default value for HS mode. - * Normally there's no problem using this to work in DS mode. - */ - SDIO_SLAVE_TIMING_NSEND_PSAMPLE ,///< Send at negedge, and sample at posedge. Default value for DS mode and below. - SDIO_SLAVE_TIMING_PSEND_NSAMPLE, ///< Send at posedge, and sample at negedge - SDIO_SLAVE_TIMING_NSEND_NSAMPLE, ///< Send at negedge, and sample at negedge -} sdio_slave_timing_t; - -/// Configuration of SDIO slave mode -typedef enum { - SDIO_SLAVE_SEND_STREAM = 0, ///< Stream mode, all packets to send will be combined as one if possible - SDIO_SLAVE_SEND_PACKET = 1, ///< Packet mode, one packets will be sent one after another (only increase packet_len if last packet sent). -} sdio_slave_sending_mode_t; - -/// Configuration of SDIO slave -typedef struct { - sdio_slave_timing_t timing; ///< timing of sdio_slave. see `sdio_slave_timing_t`. - sdio_slave_sending_mode_t sending_mode; ///< mode of sdio_slave. `SDIO_SLAVE_MODE_STREAM` if the data needs to be sent as much as possible; `SDIO_SLAVE_MODE_PACKET` if the data should be sent in packets. - int send_queue_size; ///< max buffers that can be queued before sending. - size_t recv_buffer_size; - ///< If buffer_size is too small, it costs more CPU time to handle larger number of buffers. - ///< If buffer_size is too large, the space larger than the transaction length is left blank but still counts a buffer, and the buffers are easily run out. - ///< Should be set according to length of data really transferred. - ///< All data that do not fully fill a buffer is still counted as one buffer. E.g. 10 bytes data costs 2 buffers if the size is 8 bytes per buffer. - ///< Buffer size of the slave pre-defined between host and slave before communication. All receive buffer given to the driver should be larger than this. - sdio_event_cb_t event_cb; ///< when the host interrupts slave, this callback will be called with interrupt number (0-7). - uint32_t flags; ///< Features to be enabled for the slave, combinations of ``SDIO_SLAVE_FLAG_*``. -#define SDIO_SLAVE_FLAG_DAT2_DISABLED BIT(0) /**< It is required by the SD specification that all 4 data - lines should be used and pulled up even in 1-bit mode or SPI mode. However, as a feature, the user can specify - this flag to make use of DAT2 pin in 1-bit mode. Note that the host cannot read CCCR registers to know we don't - support 4-bit mode anymore, please do this at your own risk. - */ -#define SDIO_SLAVE_FLAG_HOST_INTR_DISABLED BIT(1) /**< The DAT1 line is used as the interrupt line in SDIO - protocol. However, as a feature, the user can specify this flag to make use of DAT1 pin of the slave in 1-bit - mode. Note that the host has to do polling to the interrupt registers to know whether there are interrupts from - the slave. And it cannot read CCCR registers to know we don't support 4-bit mode anymore, please do this at - your own risk. - */ -#define SDIO_SLAVE_FLAG_INTERNAL_PULLUP BIT(2) /**< Enable internal pullups for enabled pins. It is required - by the SD specification that all the 4 data lines should be pulled up even in 1-bit mode or SPI mode. Note that - the internal pull-ups are not sufficient for stable communication, please do connect external pull-ups on the - bus. This is only for example and debug use. - */ -} sdio_slave_config_t; - -/** Handle of a receive buffer, register a handle by calling ``sdio_slave_recv_register_buf``. Use the handle to load the buffer to the - * driver, or call ``sdio_slave_recv_unregister_buf`` if it is no longer used. - */ -typedef void *sdio_slave_buf_handle_t; - -/** Initialize the sdio slave driver - * - * @param config Configuration of the sdio slave driver. - * - * @return - * - ESP_ERR_NOT_FOUND if no free interrupt found. - * - ESP_ERR_INVALID_STATE if already initialized. - * - ESP_ERR_NO_MEM if fail due to memory allocation failed. - * - ESP_OK if success - */ -esp_err_t sdio_slave_initialize(sdio_slave_config_t *config); - -/** De-initialize the sdio slave driver to release the resources. - */ -void sdio_slave_deinit(); - -/** Start hardware for sending and receiving, as well as set the IOREADY1 to 1. - * - * @note The driver will continue sending from previous data and PKT_LEN counting, keep data received as well as start receiving from current TOKEN1 counting. - * See ``sdio_slave_reset``. - * - * @return - * - ESP_ERR_INVALID_STATE if already started. - * - ESP_OK otherwise. - */ -esp_err_t sdio_slave_start(); - -/** Stop hardware from sending and receiving, also set IOREADY1 to 0. - * - * @note this will not clear the data already in the driver, and also not reset the PKT_LEN and TOKEN1 counting. Call ``sdio_slave_reset`` to do that. - */ -void sdio_slave_stop(); - -/** Clear the data still in the driver, as well as reset the PKT_LEN and TOKEN1 counting. - * - * @return always return ESP_OK. - */ -esp_err_t sdio_slave_reset(); - -/*--------------------------------------------------------------------------- - * Receive - *--------------------------------------------------------------------------*/ -/** Register buffer used for receiving. All buffers should be registered before used, and then can be used (again) in the driver by the handle returned. - * - * @param start The start address of the buffer. - * - * @note The driver will use and only use the amount of space specified in the `recv_buffer_size` member set in the `sdio_slave_config_t`. - * All buffers should be larger than that. The buffer is used by the DMA, so it should be DMA capable and 32-bit aligned. - * - * @return The buffer handle if success, otherwise NULL. - */ -sdio_slave_buf_handle_t sdio_slave_recv_register_buf(uint8_t *start); - -/** Unregister buffer from driver, and free the space used by the descriptor pointing to the buffer. - * - * @param handle Handle to the buffer to release. - * - * @return ESP_OK if success, ESP_ERR_INVALID_ARG if the handle is NULL or the buffer is being used. - */ -esp_err_t sdio_slave_recv_unregister_buf(sdio_slave_buf_handle_t handle); - -/** Load buffer to the queue waiting to receive data. The driver takes ownership of the buffer until the buffer is returned by - * ``sdio_slave_send_get_finished`` after the transaction is finished. - * - * @param handle Handle to the buffer ready to receive data. - * - * @return - * - ESP_ERR_INVALID_ARG if invalid handle or the buffer is already in the queue. Only after the buffer is returened by - * ``sdio_slave_recv`` can you load it again. - * - ESP_OK if success - */ -esp_err_t sdio_slave_recv_load_buf(sdio_slave_buf_handle_t handle); - -/** Get received data if exist. The driver returns the ownership of the buffer to the app. - * - * @param handle_ret Handle to the buffer holding received data. Use this handle in ``sdio_slave_recv_load_buf`` to receive in the same buffer again. - * @param[out] out_addr Output of the start address, set to NULL if not needed. - * @param[out] out_len Actual length of the data in the buffer, set to NULL if not needed. - * @param wait Time to wait before data received. - * - * @note Call ``sdio_slave_load_buf`` with the handle to re-load the buffer onto the link list, and receive with the same buffer again. - * The address and length of the buffer got here is the same as got from `sdio_slave_get_buffer`. - * - * @return - * - ESP_ERR_INVALID_ARG if handle_ret is NULL - * - ESP_ERR_TIMEOUT if timeout before receiving new data - * - ESP_OK if success - */ -esp_err_t sdio_slave_recv(sdio_slave_buf_handle_t* handle_ret, uint8_t **out_addr, size_t *out_len, TickType_t wait); - -/** Retrieve the buffer corresponding to a handle. - * - * @param handle Handle to get the buffer. - * @param len_o Output of buffer length - * - * @return buffer address if success, otherwise NULL. - */ -uint8_t* sdio_slave_recv_get_buf(sdio_slave_buf_handle_t handle, size_t *len_o); - -/*--------------------------------------------------------------------------- - * Send - *--------------------------------------------------------------------------*/ -/** Put a new sending transfer into the send queue. The driver takes ownership of the buffer until the buffer is returned by - * ``sdio_slave_send_get_finished`` after the transaction is finished. - * - * @param addr Address for data to be sent. The buffer should be DMA capable and 32-bit aligned. - * @param len Length of the data, should not be longer than 4092 bytes (may support longer in the future). - * @param arg Argument to returned in ``sdio_slave_send_get_finished``. The argument can be used to indicate which transaction is done, - * or as a parameter for a callback. Set to NULL if not needed. - * @param wait Time to wait if the buffer is full. - * - * @return - * - ESP_ERR_INVALID_ARG if the length is not greater than 0. - * - ESP_ERR_TIMEOUT if the queue is still full until timeout. - * - ESP_OK if success. - */ -esp_err_t sdio_slave_send_queue(uint8_t* addr, size_t len, void* arg, TickType_t wait); - -/** Return the ownership of a finished transaction. - * @param out_arg Argument of the finished transaction. Set to NULL if unused. - * @param wait Time to wait if there's no finished sending transaction. - * - * @return ESP_ERR_TIMEOUT if no transaction finished, or ESP_OK if succeed. - */ -esp_err_t sdio_slave_send_get_finished(void** out_arg, TickType_t wait); - -/** Start a new sending transfer, and wait for it (blocked) to be finished. - * - * @param addr Start address of the buffer to send - * @param len Length of buffer to send. - * - * @return - * - ESP_ERR_INVALID_ARG if the length of descriptor is not greater than 0. - * - ESP_ERR_TIMEOUT if the queue is full or host do not start a transfer before timeout. - * - ESP_OK if success. - */ -esp_err_t sdio_slave_transmit(uint8_t* addr, size_t len); - -/*--------------------------------------------------------------------------- - * Host - *--------------------------------------------------------------------------*/ -/** Read the spi slave register shared with host. - * - * @param pos register address, 0-27 or 32-63. - * - * @note register 28 to 31 are reserved for interrupt vector. - * - * @return value of the register. - */ -uint8_t sdio_slave_read_reg(int pos); - -/** Write the spi slave register shared with host. - * - * @param pos register address, 0-11, 14-15, 18-19, 24-27 and 32-63, other address are reserved. - * @param reg the value to write. - * - * @note register 29 and 31 are used for interrupt vector. - * - * @return ESP_ERR_INVALID_ARG if address wrong, otherwise ESP_OK. - */ -esp_err_t sdio_slave_write_reg(int pos, uint8_t reg); - -/** Get the interrupt enable for host. - * - * @return the interrupt mask. - */ -sdio_slave_hostint_t sdio_slave_get_host_intena(); - -/** Set the interrupt enable for host. - * - * @param ena Enable mask for host interrupt. - */ -void sdio_slave_set_host_intena(sdio_slave_hostint_t ena); - -/** Interrupt the host by general purpose interrupt. - * - * @param pos Interrupt num, 0-7. - * - * @return - * - ESP_ERR_INVALID_ARG if interrupt num error - * - ESP_OK otherwise - */ -esp_err_t sdio_slave_send_host_int(uint8_t pos); - -/** Clear general purpose interrupt to host. - * - * @param mask Interrupt bits to clear, by bit mask. - */ -void sdio_slave_clear_host_int(uint8_t mask); - -/** Wait for general purpose interrupt from host. - * - * @param pos Interrupt source number to wait for. - * is set. - * @param wait Time to wait before interrupt triggered. - * - * @note this clears the interrupt at the same time. - * - * @return ESP_OK if success, ESP_ERR_TIMEOUT if timeout. - */ -esp_err_t sdio_slave_wait_int(int pos, TickType_t wait); - - -#ifdef __cplusplus -} -#endif - -#endif /*_DRIVER_SDIO_SLAVE_H */ - - diff --git a/tools/sdk/include/driver/driver/sdmmc_defs.h b/tools/sdk/include/driver/driver/sdmmc_defs.h deleted file mode 100644 index 6ea567b8f56..00000000000 --- a/tools/sdk/include/driver/driver/sdmmc_defs.h +++ /dev/null @@ -1,466 +0,0 @@ -/* - * Copyright (c) 2006 Uwe Stuehler - * Adaptations to ESP-IDF Copyright (c) 2016 Espressif Systems (Shanghai) PTE LTD - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _SDMMC_DEFS_H_ -#define _SDMMC_DEFS_H_ - -#include -#include - -/* MMC commands */ /* response type */ -#define MMC_GO_IDLE_STATE 0 /* R0 */ -#define MMC_SEND_OP_COND 1 /* R3 */ -#define MMC_ALL_SEND_CID 2 /* R2 */ -#define MMC_SET_RELATIVE_ADDR 3 /* R1 */ -#define MMC_SWITCH 6 /* R1B */ -#define MMC_SELECT_CARD 7 /* R1 */ -#define MMC_SEND_EXT_CSD 8 /* R1 */ -#define MMC_SEND_CSD 9 /* R2 */ -#define MMC_SEND_CID 10 /* R1 */ -#define MMC_READ_DAT_UNTIL_STOP 11 /* R1 */ -#define MMC_STOP_TRANSMISSION 12 /* R1B */ -#define MMC_SEND_STATUS 13 /* R1 */ -#define MMC_SET_BLOCKLEN 16 /* R1 */ -#define MMC_READ_BLOCK_SINGLE 17 /* R1 */ -#define MMC_READ_BLOCK_MULTIPLE 18 /* R1 */ -#define MMC_WRITE_DAT_UNTIL_STOP 20 /* R1 */ -#define MMC_SET_BLOCK_COUNT 23 /* R1 */ -#define MMC_WRITE_BLOCK_SINGLE 24 /* R1 */ -#define MMC_WRITE_BLOCK_MULTIPLE 25 /* R1 */ -#define MMC_APP_CMD 55 /* R1 */ - -/* SD commands */ /* response type */ -#define SD_SEND_RELATIVE_ADDR 3 /* R6 */ -#define SD_SEND_SWITCH_FUNC 6 /* R1 */ -#define SD_SEND_IF_COND 8 /* R7 */ -#define SD_READ_OCR 58 /* R3 */ -#define SD_CRC_ON_OFF 59 /* R1 */ - -/* SD application commands */ /* response type */ -#define SD_APP_SET_BUS_WIDTH 6 /* R1 */ -#define SD_APP_SD_STATUS 13 /* R2 */ -#define SD_APP_OP_COND 41 /* R3 */ -#define SD_APP_SEND_SCR 51 /* R1 */ - -/* SD IO commands */ -#define SD_IO_SEND_OP_COND 5 /* R4 */ -#define SD_IO_RW_DIRECT 52 /* R5 */ -#define SD_IO_RW_EXTENDED 53 /* R5 */ - - -/* OCR bits */ -#define MMC_OCR_MEM_READY (1<<31) /* memory power-up status bit */ -#define MMC_OCR_ACCESS_MODE_MASK 0x60000000 /* bits 30:29 */ -#define MMC_OCR_SECTOR_MODE (1<<30) -#define MMC_OCR_BYTE_MODE (1<<29) -#define MMC_OCR_3_5V_3_6V (1<<23) -#define MMC_OCR_3_4V_3_5V (1<<22) -#define MMC_OCR_3_3V_3_4V (1<<21) -#define MMC_OCR_3_2V_3_3V (1<<20) -#define MMC_OCR_3_1V_3_2V (1<<19) -#define MMC_OCR_3_0V_3_1V (1<<18) -#define MMC_OCR_2_9V_3_0V (1<<17) -#define MMC_OCR_2_8V_2_9V (1<<16) -#define MMC_OCR_2_7V_2_8V (1<<15) -#define MMC_OCR_2_6V_2_7V (1<<14) -#define MMC_OCR_2_5V_2_6V (1<<13) -#define MMC_OCR_2_4V_2_5V (1<<12) -#define MMC_OCR_2_3V_2_4V (1<<11) -#define MMC_OCR_2_2V_2_3V (1<<10) -#define MMC_OCR_2_1V_2_2V (1<<9) -#define MMC_OCR_2_0V_2_1V (1<<8) -#define MMC_OCR_1_65V_1_95V (1<<7) - -#define SD_OCR_SDHC_CAP (1<<30) -#define SD_OCR_VOL_MASK 0xFF8000 /* bits 23:15 */ - -/* SD mode R1 response type bits */ -#define MMC_R1_READY_FOR_DATA (1<<8) /* ready for next transfer */ -#define MMC_R1_APP_CMD (1<<5) /* app. commands supported */ -#define MMC_R1_SWITCH_ERROR (1<<7) /* switch command did not succeed */ - -/* SPI mode R1 response type bits */ -#define SD_SPI_R1_IDLE_STATE (1<<0) -#define SD_SPI_R1_ERASE_RST (1<<1) -#define SD_SPI_R1_ILLEGAL_CMD (1<<2) -#define SD_SPI_R1_CMD_CRC_ERR (1<<3) -#define SD_SPI_R1_ERASE_SEQ_ERR (1<<4) -#define SD_SPI_R1_ADDR_ERR (1<<5) -#define SD_SPI_R1_PARAM_ERR (1<<6) -#define SD_SPI_R1_NO_RESPONSE (1<<7) - -/* 48-bit response decoding (32 bits w/o CRC) */ -#define MMC_R1(resp) ((resp)[0]) -#define MMC_R3(resp) ((resp)[0]) -#define MMC_R4(resp) ((resp)[0]) -#define MMC_R5(resp) ((resp)[0]) -#define SD_R6(resp) ((resp)[0]) -#define MMC_R1_CURRENT_STATE(resp) (((resp)[0] >> 9) & 0xf) - -/* SPI mode response decoding */ -#define SD_SPI_R1(resp) ((resp)[0] & 0xff) -#define SD_SPI_R2(resp) ((resp)[0] & 0xffff) -#define SD_SPI_R3(resp) ((resp)[0]) -#define SD_SPI_R7(resp) ((resp)[0]) - -/* RCA argument and response */ -#define MMC_ARG_RCA(rca) ((rca) << 16) -#define SD_R6_RCA(resp) (SD_R6((resp)) >> 16) - -/* bus width argument */ -#define SD_ARG_BUS_WIDTH_1 0 -#define SD_ARG_BUS_WIDTH_4 2 - -/* EXT_CSD fields */ -#define EXT_CSD_BUS_WIDTH 183 /* WO */ -#define EXT_CSD_HS_TIMING 185 /* R/W */ -#define EXT_CSD_REV 192 /* RO */ -#define EXT_CSD_STRUCTURE 194 /* RO */ -#define EXT_CSD_CARD_TYPE 196 /* RO */ -#define EXT_CSD_SEC_COUNT 212 /* RO */ -#define EXT_CSD_PWR_CL_26_360 203 /* RO */ -#define EXT_CSD_PWR_CL_52_360 202 /* RO */ -#define EXT_CSD_PWR_CL_26_195 201 /* RO */ -#define EXT_CSD_PWR_CL_52_195 200 /* RO */ -#define EXT_CSD_POWER_CLASS 187 /* R/W */ -#define EXT_CSD_CMD_SET 191 /* R/W */ -#define EXT_CSD_S_CMD_SET 504 /* RO */ - -/* EXT_CSD field definitions */ -#define EXT_CSD_CMD_SET_NORMAL (1U << 0) -#define EXT_CSD_CMD_SET_SECURE (1U << 1) -#define EXT_CSD_CMD_SET_CPSECURE (1U << 2) - -/* EXT_CSD_HS_TIMING */ -#define EXT_CSD_HS_TIMING_BC 0 -#define EXT_CSD_HS_TIMING_HS 1 -#define EXT_CSD_HS_TIMING_HS200 2 -#define EXT_CSD_HS_TIMING_HS400 3 - -/* EXT_CSD_BUS_WIDTH */ -#define EXT_CSD_BUS_WIDTH_1 0 -#define EXT_CSD_BUS_WIDTH_4 1 -#define EXT_CSD_BUS_WIDTH_8 2 -#define EXT_CSD_BUS_WIDTH_4_DDR 5 -#define EXT_CSD_BUS_WIDTH_8_DDR 6 - -/* EXT_CSD_CARD_TYPE */ -/* The only currently valid values for this field are 0x01, 0x03, 0x07, - * 0x0B and 0x0F. */ -#define EXT_CSD_CARD_TYPE_F_26M (1 << 0) /* SDR at "rated voltages */ -#define EXT_CSD_CARD_TYPE_F_52M (1 << 1) /* SDR at "rated voltages */ -#define EXT_CSD_CARD_TYPE_F_52M_1_8V (1 << 2) /* DDR, 1.8V or 3.3V I/O */ -#define EXT_CSD_CARD_TYPE_F_52M_1_2V (1 << 3) /* DDR, 1.2V I/O */ -#define EXT_CSD_CARD_TYPE_26M 0x01 -#define EXT_CSD_CARD_TYPE_52M 0x03 -#define EXT_CSD_CARD_TYPE_52M_V18 0x07 -#define EXT_CSD_CARD_TYPE_52M_V12 0x0b -#define EXT_CSD_CARD_TYPE_52M_V12_18 0x0f - -/* EXT_CSD MMC */ -#define EXT_CSD_MMC_SIZE 512 - -/* MMC_SWITCH access mode */ -#define MMC_SWITCH_MODE_CMD_SET 0x00 /* Change the command set */ -#define MMC_SWITCH_MODE_SET_BITS 0x01 /* Set bits in value */ -#define MMC_SWITCH_MODE_CLEAR_BITS 0x02 /* Clear bits in value */ -#define MMC_SWITCH_MODE_WRITE_BYTE 0x03 /* Set target to value */ - -/* MMC R2 response (CSD) */ -#define MMC_CSD_CSDVER(resp) MMC_RSP_BITS((resp), 126, 2) -#define MMC_CSD_CSDVER_1_0 1 -#define MMC_CSD_CSDVER_2_0 2 -#define MMC_CSD_CSDVER_EXT_CSD 3 -#define MMC_CSD_MMCVER(resp) MMC_RSP_BITS((resp), 122, 4) -#define MMC_CSD_MMCVER_1_0 0 /* MMC 1.0 - 1.2 */ -#define MMC_CSD_MMCVER_1_4 1 /* MMC 1.4 */ -#define MMC_CSD_MMCVER_2_0 2 /* MMC 2.0 - 2.2 */ -#define MMC_CSD_MMCVER_3_1 3 /* MMC 3.1 - 3.3 */ -#define MMC_CSD_MMCVER_4_0 4 /* MMC 4 */ -#define MMC_CSD_READ_BL_LEN(resp) MMC_RSP_BITS((resp), 80, 4) -#define MMC_CSD_C_SIZE(resp) MMC_RSP_BITS((resp), 62, 12) -#define MMC_CSD_CAPACITY(resp) ((MMC_CSD_C_SIZE((resp))+1) << \ - (MMC_CSD_C_SIZE_MULT((resp))+2)) -#define MMC_CSD_C_SIZE_MULT(resp) MMC_RSP_BITS((resp), 47, 3) - -/* MMC v1 R2 response (CID) */ -#define MMC_CID_MID_V1(resp) MMC_RSP_BITS((resp), 104, 24) -#define MMC_CID_PNM_V1_CPY(resp, pnm) \ - do { \ - (pnm)[0] = MMC_RSP_BITS((resp), 96, 8); \ - (pnm)[1] = MMC_RSP_BITS((resp), 88, 8); \ - (pnm)[2] = MMC_RSP_BITS((resp), 80, 8); \ - (pnm)[3] = MMC_RSP_BITS((resp), 72, 8); \ - (pnm)[4] = MMC_RSP_BITS((resp), 64, 8); \ - (pnm)[5] = MMC_RSP_BITS((resp), 56, 8); \ - (pnm)[6] = MMC_RSP_BITS((resp), 48, 8); \ - (pnm)[7] = '\0'; \ - } while (0) -#define MMC_CID_REV_V1(resp) MMC_RSP_BITS((resp), 40, 8) -#define MMC_CID_PSN_V1(resp) MMC_RSP_BITS((resp), 16, 24) -#define MMC_CID_MDT_V1(resp) MMC_RSP_BITS((resp), 8, 8) - -/* MMC v2 R2 response (CID) */ -#define MMC_CID_MID_V2(resp) MMC_RSP_BITS((resp), 120, 8) -#define MMC_CID_OID_V2(resp) MMC_RSP_BITS((resp), 104, 16) -#define MMC_CID_PNM_V2_CPY(resp, pnm) \ - do { \ - (pnm)[0] = MMC_RSP_BITS((resp), 96, 8); \ - (pnm)[1] = MMC_RSP_BITS((resp), 88, 8); \ - (pnm)[2] = MMC_RSP_BITS((resp), 80, 8); \ - (pnm)[3] = MMC_RSP_BITS((resp), 72, 8); \ - (pnm)[4] = MMC_RSP_BITS((resp), 64, 8); \ - (pnm)[5] = MMC_RSP_BITS((resp), 56, 8); \ - (pnm)[6] = '\0'; \ - } while (0) -#define MMC_CID_PSN_V2(resp) MMC_RSP_BITS((resp), 16, 32) - -/* SD R2 response (CSD) */ -#define SD_CSD_CSDVER(resp) MMC_RSP_BITS((resp), 126, 2) -#define SD_CSD_CSDVER_1_0 0 -#define SD_CSD_CSDVER_2_0 1 -#define SD_CSD_TAAC(resp) MMC_RSP_BITS((resp), 112, 8) -#define SD_CSD_TAAC_1_5_MSEC 0x26 -#define SD_CSD_NSAC(resp) MMC_RSP_BITS((resp), 104, 8) -#define SD_CSD_SPEED(resp) MMC_RSP_BITS((resp), 96, 8) -#define SD_CSD_SPEED_25_MHZ 0x32 -#define SD_CSD_SPEED_50_MHZ 0x5a -#define SD_CSD_CCC(resp) MMC_RSP_BITS((resp), 84, 12) -#define SD_CSD_CCC_BASIC (1 << 0) /* basic */ -#define SD_CSD_CCC_BR (1 << 2) /* block read */ -#define SD_CSD_CCC_BW (1 << 4) /* block write */ -#define SD_CSD_CCC_ERASE (1 << 5) /* erase */ -#define SD_CSD_CCC_WP (1 << 6) /* write protection */ -#define SD_CSD_CCC_LC (1 << 7) /* lock card */ -#define SD_CSD_CCC_AS (1 << 8) /*application specific*/ -#define SD_CSD_CCC_IOM (1 << 9) /* I/O mode */ -#define SD_CSD_CCC_SWITCH (1 << 10) /* switch */ -#define SD_CSD_READ_BL_LEN(resp) MMC_RSP_BITS((resp), 80, 4) -#define SD_CSD_READ_BL_PARTIAL(resp) MMC_RSP_BITS((resp), 79, 1) -#define SD_CSD_WRITE_BLK_MISALIGN(resp) MMC_RSP_BITS((resp), 78, 1) -#define SD_CSD_READ_BLK_MISALIGN(resp) MMC_RSP_BITS((resp), 77, 1) -#define SD_CSD_DSR_IMP(resp) MMC_RSP_BITS((resp), 76, 1) -#define SD_CSD_C_SIZE(resp) MMC_RSP_BITS((resp), 62, 12) -#define SD_CSD_CAPACITY(resp) ((SD_CSD_C_SIZE((resp))+1) << \ - (SD_CSD_C_SIZE_MULT((resp))+2)) -#define SD_CSD_V2_C_SIZE(resp) MMC_RSP_BITS((resp), 48, 22) -#define SD_CSD_V2_CAPACITY(resp) ((SD_CSD_V2_C_SIZE((resp))+1) << 10) -#define SD_CSD_V2_BL_LEN 0x9 /* 512 */ -#define SD_CSD_VDD_R_CURR_MIN(resp) MMC_RSP_BITS((resp), 59, 3) -#define SD_CSD_VDD_R_CURR_MAX(resp) MMC_RSP_BITS((resp), 56, 3) -#define SD_CSD_VDD_W_CURR_MIN(resp) MMC_RSP_BITS((resp), 53, 3) -#define SD_CSD_VDD_W_CURR_MAX(resp) MMC_RSP_BITS((resp), 50, 3) -#define SD_CSD_VDD_RW_CURR_100mA 0x7 -#define SD_CSD_VDD_RW_CURR_80mA 0x6 -#define SD_CSD_C_SIZE_MULT(resp) MMC_RSP_BITS((resp), 47, 3) -#define SD_CSD_ERASE_BLK_EN(resp) MMC_RSP_BITS((resp), 46, 1) -#define SD_CSD_SECTOR_SIZE(resp) MMC_RSP_BITS((resp), 39, 7) /* +1 */ -#define SD_CSD_WP_GRP_SIZE(resp) MMC_RSP_BITS((resp), 32, 7) /* +1 */ -#define SD_CSD_WP_GRP_ENABLE(resp) MMC_RSP_BITS((resp), 31, 1) -#define SD_CSD_R2W_FACTOR(resp) MMC_RSP_BITS((resp), 26, 3) -#define SD_CSD_WRITE_BL_LEN(resp) MMC_RSP_BITS((resp), 22, 4) -#define SD_CSD_RW_BL_LEN_2G 0xa -#define SD_CSD_RW_BL_LEN_1G 0x9 -#define SD_CSD_WRITE_BL_PARTIAL(resp) MMC_RSP_BITS((resp), 21, 1) -#define SD_CSD_FILE_FORMAT_GRP(resp) MMC_RSP_BITS((resp), 15, 1) -#define SD_CSD_COPY(resp) MMC_RSP_BITS((resp), 14, 1) -#define SD_CSD_PERM_WRITE_PROTECT(resp) MMC_RSP_BITS((resp), 13, 1) -#define SD_CSD_TMP_WRITE_PROTECT(resp) MMC_RSP_BITS((resp), 12, 1) -#define SD_CSD_FILE_FORMAT(resp) MMC_RSP_BITS((resp), 10, 2) - -/* SD R2 response (CID) */ -#define SD_CID_MID(resp) MMC_RSP_BITS((resp), 120, 8) -#define SD_CID_OID(resp) MMC_RSP_BITS((resp), 104, 16) -#define SD_CID_PNM_CPY(resp, pnm) \ - do { \ - (pnm)[0] = MMC_RSP_BITS((resp), 96, 8); \ - (pnm)[1] = MMC_RSP_BITS((resp), 88, 8); \ - (pnm)[2] = MMC_RSP_BITS((resp), 80, 8); \ - (pnm)[3] = MMC_RSP_BITS((resp), 72, 8); \ - (pnm)[4] = MMC_RSP_BITS((resp), 64, 8); \ - (pnm)[5] = '\0'; \ - } while (0) -#define SD_CID_REV(resp) MMC_RSP_BITS((resp), 56, 8) -#define SD_CID_PSN(resp) MMC_RSP_BITS((resp), 24, 32) -#define SD_CID_MDT(resp) MMC_RSP_BITS((resp), 8, 12) - -/* SCR (SD Configuration Register) */ -#define SCR_STRUCTURE(scr) MMC_RSP_BITS((scr), 60, 4) -#define SCR_STRUCTURE_VER_1_0 0 /* Version 1.0 */ -#define SCR_SD_SPEC(scr) MMC_RSP_BITS((scr), 56, 4) -#define SCR_SD_SPEC_VER_1_0 0 /* Version 1.0 and 1.01 */ -#define SCR_SD_SPEC_VER_1_10 1 /* Version 1.10 */ -#define SCR_SD_SPEC_VER_2 2 /* Version 2.00 or Version 3.0X */ -#define SCR_DATA_STAT_AFTER_ERASE(scr) MMC_RSP_BITS((scr), 55, 1) -#define SCR_SD_SECURITY(scr) MMC_RSP_BITS((scr), 52, 3) -#define SCR_SD_SECURITY_NONE 0 /* no security */ -#define SCR_SD_SECURITY_1_0 1 /* security protocol 1.0 */ -#define SCR_SD_SECURITY_1_0_2 2 /* security protocol 1.0 */ -#define SCR_SD_BUS_WIDTHS(scr) MMC_RSP_BITS((scr), 48, 4) -#define SCR_SD_BUS_WIDTHS_1BIT (1 << 0) /* 1bit (DAT0) */ -#define SCR_SD_BUS_WIDTHS_4BIT (1 << 2) /* 4bit (DAT0-3) */ -#define SCR_SD_SPEC3(scr) MMC_RSP_BITS((scr), 47, 1) -#define SCR_EX_SECURITY(scr) MMC_RSP_BITS((scr), 43, 4) -#define SCR_SD_SPEC4(scr) MMC_RSP_BITS((scr), 42, 1) -#define SCR_RESERVED(scr) MMC_RSP_BITS((scr), 34, 8) -#define SCR_CMD_SUPPORT_CMD23(scr) MMC_RSP_BITS((scr), 33, 1) -#define SCR_CMD_SUPPORT_CMD20(scr) MMC_RSP_BITS((scr), 32, 1) -#define SCR_RESERVED2(scr) MMC_RSP_BITS((scr), 0, 32) - -/* Max supply current in SWITCH_FUNC response (in mA) */ -#define SD_SFUNC_I_MAX(status) (MMC_RSP_BITS((uint32_t *)(status), 496, 16)) - -/* Supported flags in SWITCH_FUNC response */ -#define SD_SFUNC_SUPPORTED(status, group) \ - (MMC_RSP_BITS((uint32_t *)(status), 400 + (group - 1) * 16, 16)) - -/* Selected function in SWITCH_FUNC response */ -#define SD_SFUNC_SELECTED(status, group) \ - (MMC_RSP_BITS((uint32_t *)(status), 376 + (group - 1) * 4, 4)) - -/* Busy flags in SWITCH_FUNC response */ -#define SD_SFUNC_BUSY(status, group) \ - (MMC_RSP_BITS((uint32_t *)(status), 272 + (group - 1) * 16, 16)) - -/* Version of SWITCH_FUNC response */ -#define SD_SFUNC_VER(status) (MMC_RSP_BITS((uint32_t *)(status), 368, 8)) - -#define SD_SFUNC_GROUP_MAX 6 -#define SD_SFUNC_FUNC_MAX 15 - -#define SD_ACCESS_MODE 1 /* Function group 1, Access Mode */ - -#define SD_ACCESS_MODE_SDR12 0 /* 25 MHz clock */ -#define SD_ACCESS_MODE_SDR25 1 /* 50 MHz clock */ -#define SD_ACCESS_MODE_SDR50 2 /* UHS-I, 100 MHz clock */ -#define SD_ACCESS_MODE_SDR104 3 /* UHS-I, 208 MHz clock */ -#define SD_ACCESS_MODE_DDR50 4 /* UHS-I, 50 MHz clock, DDR */ - -/** - * @brief Extract up to 32 sequential bits from an array of 32-bit words - * - * Bits within the word are numbered in the increasing order from LSB to MSB. - * - * As an example, consider 2 32-bit words: - * - * 0x01234567 0x89abcdef - * - * On a little-endian system, the bytes are stored in memory as follows: - * - * 67 45 23 01 ef cd ab 89 - * - * MMC_RSP_BITS will extact bits as follows: - * - * start=0 len=4 -> result=0x00000007 - * start=0 len=12 -> result=0x00000567 - * start=28 len=8 -> result=0x000000f0 - * start=59 len=5 -> result=0x00000011 - * - * @param src array of words to extract bits from - * @param start index of the first bit to extract - * @param len number of bits to extract, 1 to 32 - * @return 32-bit word where requested bits start from LSB - */ -static inline uint32_t MMC_RSP_BITS(uint32_t *src, int start, int len) -{ - uint32_t mask = (len % 32 == 0) ? UINT_MAX : UINT_MAX >> (32 - (len % 32)); - size_t word = start / 32; - size_t shift = start % 32; - uint32_t right = src[word] >> shift; - uint32_t left = (len + shift <= 32) ? 0 : src[word + 1] << ((32 - shift) % 32); - return (left | right) & mask; -} - -/* SD R4 response (IO OCR) */ -#define SD_IO_OCR_MEM_READY (1<<31) -#define SD_IO_OCR_NUM_FUNCTIONS(ocr) (((ocr) >> 28) & 0x7) -#define SD_IO_OCR_MEM_PRESENT (1<<27) -#define SD_IO_OCR_MASK 0x00fffff0 - -/* CMD52 arguments */ -#define SD_ARG_CMD52_READ (0<<31) -#define SD_ARG_CMD52_WRITE (1<<31) -#define SD_ARG_CMD52_FUNC_SHIFT 28 -#define SD_ARG_CMD52_FUNC_MASK 0x7 -#define SD_ARG_CMD52_EXCHANGE (1<<27) -#define SD_ARG_CMD52_REG_SHIFT 9 -#define SD_ARG_CMD52_REG_MASK 0x1ffff -#define SD_ARG_CMD52_DATA_SHIFT 0 -#define SD_ARG_CMD52_DATA_MASK 0xff -#define SD_R5_DATA(resp) ((resp)[0] & 0xff) - -/* CMD53 arguments */ -#define SD_ARG_CMD53_READ (0<<31) -#define SD_ARG_CMD53_WRITE (1<<31) -#define SD_ARG_CMD53_FUNC_SHIFT 28 -#define SD_ARG_CMD53_FUNC_MASK 0x7 -#define SD_ARG_CMD53_BLOCK_MODE (1<<27) -#define SD_ARG_CMD53_INCREMENT (1<<26) -#define SD_ARG_CMD53_REG_SHIFT 9 -#define SD_ARG_CMD53_REG_MASK 0x1ffff -#define SD_ARG_CMD53_LENGTH_SHIFT 0 -#define SD_ARG_CMD53_LENGTH_MASK 0x1ff -#define SD_ARG_CMD53_LENGTH_MAX 512 - -/* Card Common Control Registers (CCCR) */ -#define SD_IO_CCCR_START 0x00000 -#define SD_IO_CCCR_SIZE 0x100 -#define SD_IO_CCCR_FN_ENABLE 0x02 -#define SD_IO_CCCR_FN_READY 0x03 -#define SD_IO_CCCR_INT_ENABLE 0x04 -#define SD_IO_CCCR_INT_PENDING 0x05 -#define SD_IO_CCCR_CTL 0x06 -#define CCCR_CTL_RES (1<<3) -#define SD_IO_CCCR_BUS_WIDTH 0x07 -#define CCCR_BUS_WIDTH_1 (0<<0) -#define CCCR_BUS_WIDTH_4 (2<<0) -#define CCCR_BUS_WIDTH_8 (3<<0) -#define SD_IO_CCCR_CARD_CAP 0x08 -#define CCCR_CARD_CAP_LSC BIT(6) -#define CCCR_CARD_CAP_4BLS BIT(7) -#define SD_IO_CCCR_CISPTR 0x09 -#define SD_IO_CCCR_BLKSIZEL 0x10 -#define SD_IO_CCCR_BLKSIZEH 0x11 -#define SD_IO_CCCR_HIGHSPEED 0x13 -#define CCCR_HIGHSPEED_SUPPORT BIT(0) -#define CCCR_HIGHSPEED_ENABLE BIT(1) - -/* Function Basic Registers (FBR) */ -#define SD_IO_FBR_START 0x00100 -#define SD_IO_FBR_SIZE 0x00700 - -/* Card Information Structure (CIS) */ -#define SD_IO_CIS_START 0x01000 -#define SD_IO_CIS_SIZE 0x17000 - -/* CIS tuple codes (based on PC Card 16) */ -#define SD_IO_CISTPL_NULL 0x00 -#define SD_IO_CISTPL_VERS_1 0x15 -#define SD_IO_CISTPL_MANFID 0x20 -#define SD_IO_CISTPL_FUNCID 0x21 -#define SD_IO_CISTPL_FUNCE 0x22 -#define SD_IO_CISTPL_END 0xff - -/* CISTPL_FUNCID codes */ -#define TPLFID_FUNCTION_SDIO 0x0c - -/* Timing */ -#define SDMMC_TIMING_LEGACY 0 -#define SDMMC_TIMING_HIGHSPEED 1 -#define SDMMC_TIMING_MMC_DDR52 2 - -#endif //_SDMMC_DEFS_H_ diff --git a/tools/sdk/include/driver/driver/sdmmc_host.h b/tools/sdk/include/driver/driver/sdmmc_host.h deleted file mode 100644 index 4d94d03c7cd..00000000000 --- a/tools/sdk/include/driver/driver/sdmmc_host.h +++ /dev/null @@ -1,242 +0,0 @@ -// 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. - -#pragma once - -#include -#include -#include "esp_err.h" -#include "sdmmc_types.h" -#include "driver/gpio.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define SDMMC_HOST_SLOT_0 0 ///< SDMMC slot 0 -#define SDMMC_HOST_SLOT_1 1 ///< SDMMC slot 1 - -/** - * @brief Default sdmmc_host_t structure initializer for SDMMC peripheral - * - * Uses SDMMC peripheral, with 4-bit mode enabled, and max frequency set to 20MHz - */ -#define SDMMC_HOST_DEFAULT() {\ - .flags = SDMMC_HOST_FLAG_8BIT | \ - SDMMC_HOST_FLAG_4BIT | \ - SDMMC_HOST_FLAG_1BIT | \ - SDMMC_HOST_FLAG_DDR, \ - .slot = SDMMC_HOST_SLOT_1, \ - .max_freq_khz = SDMMC_FREQ_DEFAULT, \ - .io_voltage = 3.3f, \ - .init = &sdmmc_host_init, \ - .set_bus_width = &sdmmc_host_set_bus_width, \ - .get_bus_width = &sdmmc_host_get_slot_width, \ - .set_bus_ddr_mode = &sdmmc_host_set_bus_ddr_mode, \ - .set_card_clk = &sdmmc_host_set_card_clk, \ - .do_transaction = &sdmmc_host_do_transaction, \ - .deinit = &sdmmc_host_deinit, \ - .io_int_enable = sdmmc_host_io_int_enable, \ - .io_int_wait = sdmmc_host_io_int_wait, \ - .command_timeout_ms = 0, \ -} - -/** - * Extra configuration for SDMMC peripheral slot - */ -typedef struct { - gpio_num_t gpio_cd; ///< GPIO number of card detect signal - gpio_num_t gpio_wp; ///< GPIO number of write protect signal - uint8_t width; ///< Bus width used by the slot (might be less than the max width supported) - uint32_t flags; ///< Features used by this slot -#define SDMMC_SLOT_FLAG_INTERNAL_PULLUP BIT(0) - /**< Enable internal pullups on enabled pins. The internal pullups - are insufficient however, please make sure external pullups are - connected on the bus. This is for debug / example purpose only. - */ -} sdmmc_slot_config_t; - -#define SDMMC_SLOT_NO_CD ((gpio_num_t) -1) ///< indicates that card detect line is not used -#define SDMMC_SLOT_NO_WP ((gpio_num_t) -1) ///< indicates that write protect line is not used -#define SDMMC_SLOT_WIDTH_DEFAULT 0 ///< use the default width for the slot (8 for slot 0, 4 for slot 1) - -/** - * Macro defining default configuration of SDMMC host slot - */ -#define SDMMC_SLOT_CONFIG_DEFAULT() {\ - .gpio_cd = SDMMC_SLOT_NO_CD, \ - .gpio_wp = SDMMC_SLOT_NO_WP, \ - .width = SDMMC_SLOT_WIDTH_DEFAULT, \ - .flags = 0, \ -} - -/** - * @brief Initialize SDMMC host peripheral - * - * @note This function is not thread safe - * - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if sdmmc_host_init was already called - * - ESP_ERR_NO_MEM if memory can not be allocated - */ -esp_err_t sdmmc_host_init(); - -/** - * @brief Initialize given slot of SDMMC peripheral - * - * On the ESP32, SDMMC peripheral has two slots: - * - Slot 0: 8-bit wide, maps to HS1_* signals in PIN MUX - * - Slot 1: 4-bit wide, maps to HS2_* signals in PIN MUX - * - * Card detect and write protect signals can be routed to - * arbitrary GPIOs using GPIO matrix. - * - * @note This function is not thread safe - * - * @param slot slot number (SDMMC_HOST_SLOT_0 or SDMMC_HOST_SLOT_1) - * @param slot_config additional configuration for the slot - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if host has not been initialized using sdmmc_host_init - */ -esp_err_t sdmmc_host_init_slot(int slot, const sdmmc_slot_config_t* slot_config); - -/** - * @brief Select bus width to be used for data transfer - * - * SD/MMC card must be initialized prior to this command, and a command to set - * bus width has to be sent to the card (e.g. SD_APP_SET_BUS_WIDTH) - * - * @note This function is not thread safe - * - * @param slot slot number (SDMMC_HOST_SLOT_0 or SDMMC_HOST_SLOT_1) - * @param width bus width (1, 4, or 8 for slot 0; 1 or 4 for slot 1) - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_ARG if slot number or width is not valid - */ -esp_err_t sdmmc_host_set_bus_width(int slot, size_t width); - -/** - * @brief Get bus width configured in ``sdmmc_host_init_slot`` to be used for data transfer - * - * @param slot slot number (SDMMC_HOST_SLOT_0 or SDMMC_HOST_SLOT_1) - * @return configured bus width of the specified slot. - */ -size_t sdmmc_host_get_slot_width(int slot); - -/** - * @brief Set card clock frequency - * - * Currently only integer fractions of 40MHz clock can be used. - * For High Speed cards, 40MHz can be used. - * For Default Speed cards, 20MHz can be used. - * - * @note This function is not thread safe - * - * @param slot slot number (SDMMC_HOST_SLOT_0 or SDMMC_HOST_SLOT_1) - * @param freq_khz card clock frequency, in kHz - * @return - * - ESP_OK on success - * - other error codes may be returned in the future - */ -esp_err_t sdmmc_host_set_card_clk(int slot, uint32_t freq_khz); - -/** - * @brief Enable or disable DDR mode of SD interface - * @param slot slot number (SDMMC_HOST_SLOT_0 or SDMMC_HOST_SLOT_1) - * @param ddr_enabled enable or disable DDR mode - * @return - * - ESP_OK on success - * - ESP_ERR_NOT_SUPPORTED if DDR mode is not supported on this slot - */ -esp_err_t sdmmc_host_set_bus_ddr_mode(int slot, bool ddr_enabled); - -/** - * @brief Send command to the card and get response - * - * This function returns when command is sent and response is received, - * or data is transferred, or timeout occurs. - * - * @note This function is not thread safe w.r.t. init/deinit functions, - * and bus width/clock speed configuration functions. Multiple tasks - * can call sdmmc_host_do_transaction as long as other sdmmc_host_* - * functions are not called. - * - * @attention Data buffer passed in cmdinfo->data must be in DMA capable memory - * - * @param slot slot number (SDMMC_HOST_SLOT_0 or SDMMC_HOST_SLOT_1) - * @param cmdinfo pointer to structure describing command and data to transfer - * @return - * - ESP_OK on success - * - ESP_ERR_TIMEOUT if response or data transfer has timed out - * - ESP_ERR_INVALID_CRC if response or data transfer CRC check has failed - * - ESP_ERR_INVALID_RESPONSE if the card has sent an invalid response - * - ESP_ERR_INVALID_SIZE if the size of data transfer is not valid in SD protocol - * - ESP_ERR_INVALID_ARG if the data buffer is not in DMA capable memory - */ -esp_err_t sdmmc_host_do_transaction(int slot, sdmmc_command_t* cmdinfo); - -/** - * @brief Enable IO interrupts - * - * This function configures the host to accept SDIO interrupts. - * - * @param slot slot number (SDMMC_HOST_SLOT_0 or SDMMC_HOST_SLOT_1) - * @return returns ESP_OK, other errors possible in the future - */ -esp_err_t sdmmc_host_io_int_enable(int slot); - -/** - * @brief Block until an SDIO interrupt is received, or timeout occurs - * @param slot slot number (SDMMC_HOST_SLOT_0 or SDMMC_HOST_SLOT_1) - * @param timeout_ticks number of RTOS ticks to wait for the interrupt - * @return - * - ESP_OK on success (interrupt received) - * - ESP_ERR_TIMEOUT if the interrupt did not occur within timeout_ticks - */ -esp_err_t sdmmc_host_io_int_wait(int slot, TickType_t timeout_ticks); - -/** - * @brief Disable SDMMC host and release allocated resources - * - * @note This function is not thread safe - * - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if sdmmc_host_init function has not been called - */ -esp_err_t sdmmc_host_deinit(); - -/** - * @brief Enable the pull-ups of sd pins. - * - * @note You should always place actual pullups on the lines instead of using - * this function. Internal pullup resistance are high and not sufficient, may - * cause instability in products. This is for debug or examples only. - * - * @param slot Slot to use, normally set it to 1. - * @param width Bit width of your configuration, 1 or 4. - * - * @return - * - ESP_OK: if success - * - ESP_ERR_INVALID_ARG: if configured width larger than maximum the slot can - * support - */ -esp_err_t sdmmc_host_pullup_en(int slot, int width); - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/driver/driver/sdmmc_types.h b/tools/sdk/include/driver/driver/sdmmc_types.h deleted file mode 100644 index 369a9210f8b..00000000000 --- a/tools/sdk/include/driver/driver/sdmmc_types.h +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright (c) 2006 Uwe Stuehler - * Adaptations to ESP-IDF Copyright (c) 2016 Espressif Systems (Shanghai) PTE LTD - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _SDMMC_TYPES_H_ -#define _SDMMC_TYPES_H_ - -#include -#include -#include "esp_err.h" -#include "freertos/FreeRTOS.h" - -/** - * Decoded values from SD card Card Specific Data register - */ -typedef struct { - int csd_ver; /*!< CSD structure format */ - int mmc_ver; /*!< MMC version (for CID format) */ - int capacity; /*!< total number of sectors */ - int sector_size; /*!< sector size in bytes */ - int read_block_len; /*!< block length for reads */ - int card_command_class; /*!< Card Command Class for SD */ - int tr_speed; /*!< Max transfer speed */ -} sdmmc_csd_t; - -/** - * Decoded values from SD card Card IDentification register - */ -typedef struct { - int mfg_id; /*!< manufacturer identification number */ - int oem_id; /*!< OEM/product identification number */ - char name[8]; /*!< product name (MMC v1 has the longest) */ - int revision; /*!< product revision */ - int serial; /*!< product serial number */ - int date; /*!< manufacturing date */ -} sdmmc_cid_t; - -/** - * Decoded values from SD Configuration Register - */ -typedef struct { - int sd_spec; /*!< SD Physical layer specification version, reported by card */ - int bus_width; /*!< bus widths supported by card: BIT(0) — 1-bit bus, BIT(2) — 4-bit bus */ -} sdmmc_scr_t; - -/** - * Decoded values of Extended Card Specific Data - */ -typedef struct { - uint8_t power_class; /*!< Power class used by the card */ -} sdmmc_ext_csd_t; - -/** - * SD/MMC command response buffer - */ -typedef uint32_t sdmmc_response_t[4]; - -/** - * SD SWITCH_FUNC response buffer - */ -typedef struct { - uint32_t data[512 / 8 / sizeof(uint32_t)]; /*!< response data */ -} sdmmc_switch_func_rsp_t; - -/** - * SD/MMC command information - */ -typedef struct { - uint32_t opcode; /*!< SD or MMC command index */ - uint32_t arg; /*!< SD/MMC command argument */ - sdmmc_response_t response; /*!< response buffer */ - void* data; /*!< buffer to send or read into */ - size_t datalen; /*!< length of data buffer */ - size_t blklen; /*!< block length */ - int flags; /*!< see below */ -/** @cond */ -#define SCF_ITSDONE 0x0001 /*!< command is complete */ -#define SCF_CMD(flags) ((flags) & 0x00f0) -#define SCF_CMD_AC 0x0000 -#define SCF_CMD_ADTC 0x0010 -#define SCF_CMD_BC 0x0020 -#define SCF_CMD_BCR 0x0030 -#define SCF_CMD_READ 0x0040 /*!< read command (data expected) */ -#define SCF_RSP_BSY 0x0100 -#define SCF_RSP_136 0x0200 -#define SCF_RSP_CRC 0x0400 -#define SCF_RSP_IDX 0x0800 -#define SCF_RSP_PRESENT 0x1000 -/* response types */ -#define SCF_RSP_R0 0 /*!< none */ -#define SCF_RSP_R1 (SCF_RSP_PRESENT|SCF_RSP_CRC|SCF_RSP_IDX) -#define SCF_RSP_R1B (SCF_RSP_PRESENT|SCF_RSP_CRC|SCF_RSP_IDX|SCF_RSP_BSY) -#define SCF_RSP_R2 (SCF_RSP_PRESENT|SCF_RSP_CRC|SCF_RSP_136) -#define SCF_RSP_R3 (SCF_RSP_PRESENT) -#define SCF_RSP_R4 (SCF_RSP_PRESENT) -#define SCF_RSP_R5 (SCF_RSP_PRESENT|SCF_RSP_CRC|SCF_RSP_IDX) -#define SCF_RSP_R5B (SCF_RSP_PRESENT|SCF_RSP_CRC|SCF_RSP_IDX|SCF_RSP_BSY) -#define SCF_RSP_R6 (SCF_RSP_PRESENT|SCF_RSP_CRC|SCF_RSP_IDX) -#define SCF_RSP_R7 (SCF_RSP_PRESENT|SCF_RSP_CRC|SCF_RSP_IDX) -/* special flags */ -#define SCF_WAIT_BUSY 0x2000 /*!< Wait for completion of card busy signal before returning */ -/** @endcond */ - esp_err_t error; /*!< error returned from transfer */ - int timeout_ms; /*!< response timeout, in milliseconds */ -} sdmmc_command_t; - -/** - * SD/MMC Host description - * - * This structure defines properties of SD/MMC host and functions - * of SD/MMC host which can be used by upper layers. - */ -typedef struct { - uint32_t flags; /*!< flags defining host properties */ -#define SDMMC_HOST_FLAG_1BIT BIT(0) /*!< host supports 1-line SD and MMC protocol */ -#define SDMMC_HOST_FLAG_4BIT BIT(1) /*!< host supports 4-line SD and MMC protocol */ -#define SDMMC_HOST_FLAG_8BIT BIT(2) /*!< host supports 8-line MMC protocol */ -#define SDMMC_HOST_FLAG_SPI BIT(3) /*!< host supports SPI protocol */ -#define SDMMC_HOST_FLAG_DDR BIT(4) /*!< host supports DDR mode for SD/MMC */ - int slot; /*!< slot number, to be passed to host functions */ - int max_freq_khz; /*!< max frequency supported by the host */ -#define SDMMC_FREQ_DEFAULT 20000 /*!< SD/MMC Default speed (limited by clock divider) */ -#define SDMMC_FREQ_HIGHSPEED 40000 /*!< SD High speed (limited by clock divider) */ -#define SDMMC_FREQ_PROBING 400 /*!< SD/MMC probing speed */ -#define SDMMC_FREQ_52M 52000 /*!< MMC 52MHz speed */ -#define SDMMC_FREQ_26M 26000 /*!< MMC 26MHz speed */ - float io_voltage; /*!< I/O voltage used by the controller (voltage switching is not supported) */ - esp_err_t (*init)(void); /*!< Host function to initialize the driver */ - esp_err_t (*set_bus_width)(int slot, size_t width); /*!< host function to set bus width */ - size_t (*get_bus_width)(int slot); /*!< host function to get bus width */ - esp_err_t (*set_bus_ddr_mode)(int slot, bool ddr_enable); /*!< host function to set DDR mode */ - esp_err_t (*set_card_clk)(int slot, uint32_t freq_khz); /*!< host function to set card clock frequency */ - esp_err_t (*do_transaction)(int slot, sdmmc_command_t* cmdinfo); /*!< host function to do a transaction */ - esp_err_t (*deinit)(void); /*!< host function to deinitialize the driver */ - esp_err_t (*io_int_enable)(int slot); /*!< Host function to enable SDIO interrupt line */ - esp_err_t (*io_int_wait)(int slot, TickType_t timeout_ticks); /*!< Host function to wait for SDIO interrupt line to be active */ - int command_timeout_ms; /*!< timeout, in milliseconds, of a single command. Set to 0 to use the default value. */ -} sdmmc_host_t; - -/** - * SD/MMC card information structure - */ -typedef struct { - sdmmc_host_t host; /*!< Host with which the card is associated */ - uint32_t ocr; /*!< OCR (Operation Conditions Register) value */ - sdmmc_cid_t cid; /*!< decoded CID (Card IDentification) register value */ - sdmmc_csd_t csd; /*!< decoded CSD (Card-Specific Data) register value */ - sdmmc_scr_t scr; /*!< decoded SCR (SD card Configuration Register) value */ - sdmmc_ext_csd_t ext_csd; /*!< decoded EXT_CSD (Extended Card Specific Data) register value */ - uint16_t rca; /*!< RCA (Relative Card Address) */ - uint16_t max_freq_khz; /*!< Maximum frequency, in kHz, supported by the card */ - uint32_t is_mem : 1; /*!< Bit indicates if the card is a memory card */ - uint32_t is_sdio : 1; /*!< Bit indicates if the card is an IO card */ - uint32_t is_mmc : 1; /*!< Bit indicates if the card is MMC */ - uint32_t num_io_functions : 3; /*!< If is_sdio is 1, contains the number of IO functions on the card */ - uint32_t log_bus_width : 2; /*!< log2(bus width supported by card) */ - uint32_t is_ddr : 1; /*!< Card supports DDR mode */ - uint32_t reserved : 23; /*!< Reserved for future expansion */ -} sdmmc_card_t; - - -#endif // _SDMMC_TYPES_H_ diff --git a/tools/sdk/include/driver/driver/sdspi_host.h b/tools/sdk/include/driver/driver/sdspi_host.h deleted file mode 100644 index 1b3b67017e1..00000000000 --- a/tools/sdk/include/driver/driver/sdspi_host.h +++ /dev/null @@ -1,161 +0,0 @@ -// 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. - -#pragma once - -#include -#include -#include "esp_err.h" -#include "sdmmc_types.h" -#include "driver/gpio.h" -#include "driver/spi_master.h" -#include "driver/sdmmc_host.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Default sdmmc_host_t structure initializer for SD over SPI driver - * - * Uses SPI mode and max frequency set to 20MHz - * - * 'slot' can be set to one of HSPI_HOST, VSPI_HOST. - */ -#define SDSPI_HOST_DEFAULT() {\ - .flags = SDMMC_HOST_FLAG_SPI, \ - .slot = HSPI_HOST, \ - .max_freq_khz = SDMMC_FREQ_DEFAULT, \ - .io_voltage = 3.3f, \ - .init = &sdspi_host_init, \ - .set_bus_width = NULL, \ - .get_bus_width = NULL, \ - .set_bus_ddr_mode = NULL, \ - .set_card_clk = &sdspi_host_set_card_clk, \ - .do_transaction = &sdspi_host_do_transaction, \ - .deinit = &sdspi_host_deinit, \ - .io_int_enable = NULL, \ - .io_int_wait = NULL, \ - .command_timeout_ms = 0, \ -} - -/** - * Extra configuration for SPI host - */ -typedef struct { - gpio_num_t gpio_miso; ///< GPIO number of MISO signal - gpio_num_t gpio_mosi; ///< GPIO number of MOSI signal - gpio_num_t gpio_sck; ///< GPIO number of SCK signal - gpio_num_t gpio_cs; ///< GPIO number of CS signal - gpio_num_t gpio_cd; ///< GPIO number of card detect signal - gpio_num_t gpio_wp; ///< GPIO number of write protect signal - int dma_channel; ///< DMA channel to be used by SPI driver (1 or 2) -} sdspi_slot_config_t; - -#define SDSPI_SLOT_NO_CD ((gpio_num_t) -1) ///< indicates that card detect line is not used -#define SDSPI_SLOT_NO_WP ((gpio_num_t) -1) ///< indicates that write protect line is not used - -/** - * Macro defining default configuration of SPI host - */ -#define SDSPI_SLOT_CONFIG_DEFAULT() {\ - .gpio_miso = GPIO_NUM_2, \ - .gpio_mosi = GPIO_NUM_15, \ - .gpio_sck = GPIO_NUM_14, \ - .gpio_cs = GPIO_NUM_13, \ - .gpio_cd = SDSPI_SLOT_NO_CD, \ - .gpio_wp = SDSPI_SLOT_NO_WP, \ - .dma_channel = 1 \ -} - -/** - * @brief Initialize SD SPI driver - * - * @note This function is not thread safe - * - * @return - * - ESP_OK on success - * - other error codes may be returned in future versions - */ -esp_err_t sdspi_host_init(); - -/** -* @brief Initialize SD SPI driver for the specific SPI controller -* -* @note This function is not thread safe -* -* @param slot SPI controller to use (HSPI_HOST or VSPI_HOST) -* @param slot_config pointer to slot configuration structure -* -* @return -* - ESP_OK on success -* - ESP_ERR_INVALID_ARG if sdspi_init_slot has invalid arguments -* - ESP_ERR_NO_MEM if memory can not be allocated -* - other errors from the underlying spi_master and gpio drivers -*/ -esp_err_t sdspi_host_init_slot(int slot, const sdspi_slot_config_t* slot_config); - -/** - * @brief Send command to the card and get response - * - * This function returns when command is sent and response is received, - * or data is transferred, or timeout occurs. - * - * @note This function is not thread safe w.r.t. init/deinit functions, - * and bus width/clock speed configuration functions. Multiple tasks - * can call sdspi_host_do_transaction as long as other sdspi_host_* - * functions are not called. - * - * @param slot SPI controller (HSPI_HOST or VSPI_HOST) - * @param cmdinfo pointer to structure describing command and data to transfer - * @return - * - ESP_OK on success - * - ESP_ERR_TIMEOUT if response or data transfer has timed out - * - ESP_ERR_INVALID_CRC if response or data transfer CRC check has failed - * - ESP_ERR_INVALID_RESPONSE if the card has sent an invalid response - */ -esp_err_t sdspi_host_do_transaction(int slot, sdmmc_command_t *cmdinfo); - -/** - * @brief Set card clock frequency - * - * Currently only integer fractions of 40MHz clock can be used. - * For High Speed cards, 40MHz can be used. - * For Default Speed cards, 20MHz can be used. - * - * @note This function is not thread safe - * - * @param slot SPI controller (HSPI_HOST or VSPI_HOST) - * @param freq_khz card clock frequency, in kHz - * @return - * - ESP_OK on success - * - other error codes may be returned in the future - */ -esp_err_t sdspi_host_set_card_clk(int slot, uint32_t freq_khz); - - -/** - * @brief Release resources allocated using sdspi_host_init - * - * @note This function is not thread safe - * - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if sdspi_host_init function has not been called - */ -esp_err_t sdspi_host_deinit(); - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/driver/driver/sigmadelta.h b/tools/sdk/include/driver/driver/sigmadelta.h deleted file mode 100644 index 76237c193d3..00000000000 --- a/tools/sdk/include/driver/driver/sigmadelta.h +++ /dev/null @@ -1,109 +0,0 @@ -// 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. - -#ifndef __DRIVER_SIGMADELTA_H__ -#define __DRIVER_SIGMADELTA_H__ -#include -#include "soc/gpio_sd_struct.h" -#include "soc/gpio_sd_reg.h" -#include "driver/gpio.h" - -#ifdef _cplusplus -extern "C" { -#endif - -/** - * @brief Sigma-delta channel list - */ -typedef enum{ - SIGMADELTA_CHANNEL_0 = 0, /*!< Sigma-delta channel 0 */ - SIGMADELTA_CHANNEL_1 = 1, /*!< Sigma-delta channel 1 */ - SIGMADELTA_CHANNEL_2 = 2, /*!< Sigma-delta channel 2 */ - SIGMADELTA_CHANNEL_3 = 3, /*!< Sigma-delta channel 3 */ - SIGMADELTA_CHANNEL_4 = 4, /*!< Sigma-delta channel 4 */ - SIGMADELTA_CHANNEL_5 = 5, /*!< Sigma-delta channel 5 */ - SIGMADELTA_CHANNEL_6 = 6, /*!< Sigma-delta channel 6 */ - SIGMADELTA_CHANNEL_7 = 7, /*!< Sigma-delta channel 7 */ - SIGMADELTA_CHANNEL_MAX, -} sigmadelta_channel_t; - -/** - * @brief Sigma-delta configure struct - */ -typedef struct { - sigmadelta_channel_t channel; /*!< Sigma-delta channel number */ - int8_t sigmadelta_duty; /*!< Sigma-delta duty, duty ranges from -128 to 127. */ - uint8_t sigmadelta_prescale; /*!< Sigma-delta prescale, prescale ranges from 0 to 255. */ - uint8_t sigmadelta_gpio; /*!< Sigma-delta output io number, refer to gpio.h for more details. */ -} sigmadelta_config_t; - -/** - * @brief Configure Sigma-delta channel - * - * @param config Pointer of Sigma-delta channel configuration struct - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t sigmadelta_config(const sigmadelta_config_t *config); - -/** - * @brief Set Sigma-delta channel duty. - * - * This function is used to set Sigma-delta channel duty, - * If you add a capacitor between the output pin and ground, - * the average output voltage will be Vdc = VDDIO / 256 * duty + VDDIO/2, - * where VDDIO is the power supply voltage. - * - * @param channel Sigma-delta channel number - * @param duty Sigma-delta duty of one channel, the value ranges from -128 to 127, recommended range is -90 ~ 90. - * The waveform is more like a random one in this range. - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t sigmadelta_set_duty(sigmadelta_channel_t channel, int8_t duty); - -/** - * @brief Set Sigma-delta channel's clock pre-scale value. - * The source clock is APP_CLK, 80MHz. The clock frequency of the sigma-delta channel is APP_CLK / pre_scale - * - * @param channel Sigma-delta channel number - * @param prescale The divider of source clock, ranges from 0 to 255 - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t sigmadelta_set_prescale(sigmadelta_channel_t channel, uint8_t prescale); - -/** - * @brief Set Sigma-delta signal output pin - * - * @param channel Sigma-delta channel number - * @param gpio_num GPIO number of output pin. - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t sigmadelta_set_pin(sigmadelta_channel_t channel, gpio_num_t gpio_num); - -#ifdef _cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/driver/driver/spi_common.h b/tools/sdk/include/driver/driver/spi_common.h deleted file mode 100644 index b3a92613616..00000000000 --- a/tools/sdk/include/driver/driver/spi_common.h +++ /dev/null @@ -1,324 +0,0 @@ -// Copyright 2010-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. - - -#ifndef _DRIVER_SPI_COMMON_H_ -#define _DRIVER_SPI_COMMON_H_ - -#include -#include -#include "esp_err.h" -#include "rom/lldesc.h" -#include "soc/spi_periph.h" -#include "sdkconfig.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - - -//Maximum amount of bytes that can be put in one DMA descriptor -#define SPI_MAX_DMA_LEN (4096-4) - -/** - * Transform unsigned integer of length <= 32 bits to the format which can be - * sent by the SPI driver directly. - * - * E.g. to send 9 bits of data, you can: - * - * uint16_t data = SPI_SWAP_DATA_TX(0x145, 9); - * - * Then points tx_buffer to ``&data``. - * - * @param data Data to be sent, can be uint8_t, uint16_t or uint32_t. @param - * len Length of data to be sent, since the SPI peripheral sends from the MSB, - * this helps to shift the data to the MSB. - */ -#define SPI_SWAP_DATA_TX(data, len) __builtin_bswap32((uint32_t)data<<(32-len)) - -/** - * Transform received data of length <= 32 bits to the format of an unsigned integer. - * - * E.g. to transform the data of 15 bits placed in a 4-byte array to integer: - * - * uint16_t data = SPI_SWAP_DATA_RX(*(uint32_t*)t->rx_data, 15); - * - * @param data Data to be rearranged, can be uint8_t, uint16_t or uint32_t. - * @param len Length of data received, since the SPI peripheral writes from - * the MSB, this helps to shift the data to the LSB. - */ -#define SPI_SWAP_DATA_RX(data, len) (__builtin_bswap32(data)>>(32-len)) - -/** - * @brief Enum with the three SPI peripherals that are software-accessible in it - */ -typedef enum { - SPI_HOST=0, ///< SPI1, SPI - HSPI_HOST=1, ///< SPI2, HSPI - VSPI_HOST=2 ///< SPI3, VSPI -} spi_host_device_t; - -/** - * @brief This is a configuration structure for a SPI bus. - * - * You can use this structure to specify the GPIO pins of the bus. Normally, the driver will use the - * GPIO matrix to route the signals. An exception is made when all signals either can be routed through - * the IO_MUX or are -1. In that case, the IO_MUX is used, allowing for >40MHz speeds. - * - * @note Be advised that the slave driver does not use the quadwp/quadhd lines and fields in spi_bus_config_t refering to these lines will be ignored and can thus safely be left uninitialized. - */ -typedef struct { - int mosi_io_num; ///< GPIO pin for Master Out Slave In (=spi_d) signal, or -1 if not used. - int miso_io_num; ///< GPIO pin for Master In Slave Out (=spi_q) signal, or -1 if not used. - int sclk_io_num; ///< GPIO pin for Spi CLocK signal, or -1 if not used. - int quadwp_io_num; ///< GPIO pin for WP (Write Protect) signal which is used as D2 in 4-bit communication modes, or -1 if not used. - int quadhd_io_num; ///< GPIO pin for HD (HolD) signal which is used as D3 in 4-bit communication modes, or -1 if not used. - int max_transfer_sz; ///< Maximum transfer size, in bytes. Defaults to 4094 if 0. - uint32_t flags; ///< Abilities of bus to be checked by the driver. Or-ed value of ``SPICOMMON_BUSFLAG_*`` flags. - int intr_flags; /**< Interrupt flag for the bus to set the priority, and IRAM attribute, see - * ``esp_intr_alloc.h``. Note that the EDGE, INTRDISABLED attribute are ignored - * by the driver. Note that if ESP_INTR_FLAG_IRAM is set, ALL the callbacks of - * the driver, and their callee functions, should be put in the IRAM. - */ -} spi_bus_config_t; - - -/** - * @brief Try to claim a SPI peripheral - * - * Call this if your driver wants to manage a SPI peripheral. - * - * @param host Peripheral to claim - * @return True if peripheral is claimed successfully; false if peripheral already is claimed. - */ -bool spicommon_periph_claim(spi_host_device_t host); - -/** - * @brief Return the SPI peripheral so another driver can claim it. - * - * @param host Peripheral to return - * @return True if peripheral is returned successfully; false if peripheral was free to claim already. - */ -bool spicommon_periph_free(spi_host_device_t host); - -/** - * @brief Try to claim a SPI DMA channel - * - * Call this if your driver wants to use SPI with a DMA channnel. - * - * @param dma_chan channel to claim - * - * @return True if success; false otherwise. - */ -bool spicommon_dma_chan_claim(int dma_chan); - -/** - * @brief Return the SPI DMA channel so other driver can claim it, or just to power down DMA. - * - * @param dma_chan channel to return - * - * @return True if success; false otherwise. - */ -bool spicommon_dma_chan_free(int dma_chan); - -#define SPICOMMON_BUSFLAG_SLAVE 0 ///< Initialize I/O in slave mode -#define SPICOMMON_BUSFLAG_MASTER (1<<0) ///< Initialize I/O in master mode -#define SPICOMMON_BUSFLAG_NATIVE_PINS (1<<1) ///< Check using iomux pins. Or indicates the pins are configured through the IO mux rather than GPIO matrix. -#define SPICOMMON_BUSFLAG_SCLK (1<<2) ///< Check existing of SCLK pin. Or indicates CLK line initialized. -#define SPICOMMON_BUSFLAG_MISO (1<<3) ///< Check existing of MISO pin. Or indicates MISO line initialized. -#define SPICOMMON_BUSFLAG_MOSI (1<<4) ///< Check existing of MOSI pin. Or indicates CLK line initialized. -#define SPICOMMON_BUSFLAG_DUAL (1<<5) ///< Check MOSI and MISO pins can output. Or indicates bus able to work under DIO mode. -#define SPICOMMON_BUSFLAG_WPHD (1<<6) ///< Check existing of WP and HD pins. Or indicates WP & HD pins initialized. -#define SPICOMMON_BUSFLAG_QUAD (SPICOMMON_BUSFLAG_DUAL|SPICOMMON_BUSFLAG_WPHD) ///< Check existing of MOSI/MISO/WP/HD pins as output. Or indicates bus able to work under QIO mode. - -/** - * @brief Connect a SPI peripheral to GPIO pins - * - * This routine is used to connect a SPI peripheral to the IO-pads and DMA channel given in - * the arguments. Depending on the IO-pads requested, the routing is done either using the - * IO_mux or using the GPIO matrix. - * - * @param host SPI peripheral to be routed - * @param bus_config Pointer to a spi_bus_config struct detailing the GPIO pins - * @param dma_chan DMA-channel (1 or 2) to use, or 0 for no DMA. - * @param flags Combination of SPICOMMON_BUSFLAG_* flags, set to ensure the pins set are capable with some functions: - * - ``SPICOMMON_BUSFLAG_MASTER``: Initialize I/O in master mode - * - ``SPICOMMON_BUSFLAG_SLAVE``: Initialize I/O in slave mode - * - ``SPICOMMON_BUSFLAG_NATIVE_PINS``: Pins set should match the iomux pins of the controller. - * - ``SPICOMMON_BUSFLAG_SCLK``, ``SPICOMMON_BUSFLAG_MISO``, ``SPICOMMON_BUSFLAG_MOSI``: - * Make sure SCLK/MISO/MOSI is/are set to a valid GPIO. Also check output capability according to the mode. - * - ``SPICOMMON_BUSFLAG_DUAL``: Make sure both MISO and MOSI are output capable so that DIO mode is capable. - * - ``SPICOMMON_BUSFLAG_WPHD`` Make sure WP and HD are set to valid output GPIOs. - * - ``SPICOMMON_BUSFLAG_QUAD``: Combination of ``SPICOMMON_BUSFLAG_DUAL`` and ``SPICOMMON_BUSFLAG_WPHD``. - * @param[out] flags_o A SPICOMMON_BUSFLAG_* flag combination of bus abilities will be written to this address. - * Leave to NULL if not needed. - * - ``SPICOMMON_BUSFLAG_NATIVE_PINS``: The bus is connected to iomux pins. - * - ``SPICOMMON_BUSFLAG_SCLK``, ``SPICOMMON_BUSFLAG_MISO``, ``SPICOMMON_BUSFLAG_MOSI``: The bus has - * CLK/MISO/MOSI connected. - * - ``SPICOMMON_BUSFLAG_DUAL``: The bus is capable with DIO mode. - * - ``SPICOMMON_BUSFLAG_WPHD`` The bus has WP and HD connected. - * - ``SPICOMMON_BUSFLAG_QUAD``: Combination of ``SPICOMMON_BUSFLAG_DUAL`` and ``SPICOMMON_BUSFLAG_WPHD``. - * @return - * - ESP_ERR_INVALID_ARG if parameter is invalid - * - ESP_OK on success - */ -esp_err_t spicommon_bus_initialize_io(spi_host_device_t host, const spi_bus_config_t *bus_config, int dma_chan, uint32_t flags, uint32_t *flags_o); - -/** - * @brief Free the IO used by a SPI peripheral - * @deprecated Use spicommon_bus_free_io_cfg instead. - * - * @param host SPI peripheral to be freed - * - * @return - * - ESP_ERR_INVALID_ARG if parameter is invalid - * - ESP_OK on success - */ -esp_err_t spicommon_bus_free_io(spi_host_device_t host) __attribute__((deprecated)); - -/** - * @brief Free the IO used by a SPI peripheral - * - * @param bus_cfg Bus config struct which defines which pins to be used. - * - * @return - * - ESP_ERR_INVALID_ARG if parameter is invalid - * - ESP_OK on success - */ -esp_err_t spicommon_bus_free_io_cfg(const spi_bus_config_t *bus_cfg); - -/** - * @brief Initialize a Chip Select pin for a specific SPI peripheral - * - * - * @param host SPI peripheral - * @param cs_io_num GPIO pin to route - * @param cs_num CS id to route - * @param force_gpio_matrix If true, CS will always be routed through the GPIO matrix. If false, - * if the GPIO number allows it, the routing will happen through the IO_mux. - */ - -void spicommon_cs_initialize(spi_host_device_t host, int cs_io_num, int cs_num, int force_gpio_matrix); - -/** - * @brief Free a chip select line - * @deprecated Use spicommon_cs_io, which inputs the gpio num rather than the cs id instead. - * - * @param host SPI peripheral - * @param cs_num CS id to free - */ -void spicommon_cs_free(spi_host_device_t host, int cs_num) __attribute__((deprecated)); - -/** - * @brief Free a chip select line - * - * @param cs_gpio_num CS gpio num to free - */ -void spicommon_cs_free_io(int cs_gpio_num); - -/** - * @brief Setup a DMA link chain - * - * This routine will set up a chain of linked DMA descriptors in the array pointed to by - * ``dmadesc``. Enough DMA descriptors will be used to fit the buffer of ``len`` bytes in, and the - * descriptors will point to the corresponding positions in ``buffer`` and linked together. The - * end result is that feeding ``dmadesc[0]`` into DMA hardware results in the entirety ``len`` bytes - * of ``data`` being read or written. - * - * @param dmadesc Pointer to array of DMA descriptors big enough to be able to convey ``len`` bytes - * @param len Length of buffer - * @param data Data buffer to use for DMA transfer - * @param isrx True if data is to be written into ``data``, false if it's to be read from ``data``. - */ -void spicommon_setup_dma_desc_links(lldesc_t *dmadesc, int len, const uint8_t *data, bool isrx); - -/** - * @brief Get the position of the hardware registers for a specific SPI host - * - * @param host The SPI host - * - * @return A register descriptor stuct pointer, pointed at the hardware registers - */ -spi_dev_t *spicommon_hw_for_host(spi_host_device_t host); - -/** - * @brief Get the IRQ source for a specific SPI host - * - * @param host The SPI host - * - * @return The hosts IRQ source - */ -int spicommon_irqsource_for_host(spi_host_device_t host); - -/** - * Callback, to be called when a DMA engine reset is completed -*/ -typedef void(*dmaworkaround_cb_t)(void *arg); - - -/** - * @brief Request a reset for a certain DMA channel - * - * @note In some (well-defined) cases in the ESP32 (at least rev v.0 and v.1), a SPI DMA channel will get confused. This can be remedied - * by resetting the SPI DMA hardware in case this happens. Unfortunately, the reset knob used for thsi will reset _both_ DMA channels, and - * as such can only done safely when both DMA channels are idle. These functions coordinate this. - * - * Essentially, when a reset is needed, a driver can request this using spicommon_dmaworkaround_req_reset. This is supposed to be called - * with an user-supplied function as an argument. If both DMA channels are idle, this call will reset the DMA subsystem and return true. - * If the other DMA channel is still busy, it will return false; as soon as the other DMA channel is done, however, it will reset the - * DMA subsystem and call the callback. The callback is then supposed to be used to continue the SPI drivers activity. - * - * @param dmachan DMA channel associated with the SPI host that needs a reset - * @param cb Callback to call in case DMA channel cannot be reset immediately - * @param arg Argument to the callback - * - * @return True when a DMA reset could be executed immediately. False when it could not; in this - * case the callback will be called with the specified argument when the logic can execute - * a reset, after that reset. - */ -bool spicommon_dmaworkaround_req_reset(int dmachan, dmaworkaround_cb_t cb, void *arg); - - -/** - * @brief Check if a DMA reset is requested but has not completed yet - * - * @return True when a DMA reset is requested but hasn't completed yet. False otherwise. - */ -bool spicommon_dmaworkaround_reset_in_progress(); - - -/** - * @brief Mark a DMA channel as idle. - * - * A call to this function tells the workaround logic that this channel will - * not be affected by a global SPI DMA reset. - */ -void spicommon_dmaworkaround_idle(int dmachan); - -/** - * @brief Mark a DMA channel as active. - * - * A call to this function tells the workaround logic that this channel will - * be affected by a global SPI DMA reset, and a reset like that should not be attempted. - */ -void spicommon_dmaworkaround_transfer_active(int dmachan); - - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/driver/driver/spi_master.h b/tools/sdk/include/driver/driver/spi_master.h deleted file mode 100644 index 46085d6251b..00000000000 --- a/tools/sdk/include/driver/driver/spi_master.h +++ /dev/null @@ -1,412 +0,0 @@ -// Copyright 2010-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. - - -#ifndef _DRIVER_SPI_MASTER_H_ -#define _DRIVER_SPI_MASTER_H_ - -#include "esp_err.h" -#include "freertos/FreeRTOS.h" -#include "freertos/semphr.h" - -#include "driver/spi_common.h" - -/** SPI master clock is divided by 80MHz apb clock. Below defines are example frequencies, and are accurate. Be free to specify a random frequency, it will be rounded to closest frequency (to macros below if above 8MHz). - * 8MHz - */ -#define SPI_MASTER_FREQ_8M (APB_CLK_FREQ/10) -#define SPI_MASTER_FREQ_9M (APB_CLK_FREQ/9) ///< 8.89MHz -#define SPI_MASTER_FREQ_10M (APB_CLK_FREQ/8) ///< 10MHz -#define SPI_MASTER_FREQ_11M (APB_CLK_FREQ/7) ///< 11.43MHz -#define SPI_MASTER_FREQ_13M (APB_CLK_FREQ/6) ///< 13.33MHz -#define SPI_MASTER_FREQ_16M (APB_CLK_FREQ/5) ///< 16MHz -#define SPI_MASTER_FREQ_20M (APB_CLK_FREQ/4) ///< 20MHz -#define SPI_MASTER_FREQ_26M (APB_CLK_FREQ/3) ///< 26.67MHz -#define SPI_MASTER_FREQ_40M (APB_CLK_FREQ/2) ///< 40MHz -#define SPI_MASTER_FREQ_80M (APB_CLK_FREQ/1) ///< 80MHz - -#ifdef __cplusplus -extern "C" -{ -#endif - -#define SPI_DEVICE_TXBIT_LSBFIRST (1<<0) ///< Transmit command/address/data LSB first instead of the default MSB first -#define SPI_DEVICE_RXBIT_LSBFIRST (1<<1) ///< Receive data LSB first instead of the default MSB first -#define SPI_DEVICE_BIT_LSBFIRST (SPI_DEVICE_TXBIT_LSBFIRST|SPI_DEVICE_RXBIT_LSBFIRST) ///< Transmit and receive LSB first -#define SPI_DEVICE_3WIRE (1<<2) ///< Use MOSI (=spid) for both sending and receiving data -#define SPI_DEVICE_POSITIVE_CS (1<<3) ///< Make CS positive during a transaction instead of negative -#define SPI_DEVICE_HALFDUPLEX (1<<4) ///< Transmit data before receiving it, instead of simultaneously -#define SPI_DEVICE_CLK_AS_CS (1<<5) ///< Output clock on CS line if CS is active -/** There are timing issue when reading at high frequency (the frequency is related to whether iomux pins are used, valid time after slave sees the clock). - * - In half-duplex mode, the driver automatically inserts dummy bits before reading phase to fix the timing issue. Set this flag to disable this feature. - * - In full-duplex mode, however, the hardware cannot use dummy bits, so there is no way to prevent data being read from getting corrupted. - * Set this flag to confirm that you're going to work with output only, or read without dummy bits at your own risk. - */ -#define SPI_DEVICE_NO_DUMMY (1<<6) - - -typedef struct spi_transaction_t spi_transaction_t; -typedef void(*transaction_cb_t)(spi_transaction_t *trans); - -/** - * @brief This is a configuration for a SPI slave device that is connected to one of the SPI buses. - */ -typedef struct { - uint8_t command_bits; ///< Default amount of bits in command phase (0-16), used when ``SPI_TRANS_VARIABLE_CMD`` is not used, otherwise ignored. - uint8_t address_bits; ///< Default amount of bits in address phase (0-64), used when ``SPI_TRANS_VARIABLE_ADDR`` is not used, otherwise ignored. - uint8_t dummy_bits; ///< Amount of dummy bits to insert between address and data phase - uint8_t mode; ///< SPI mode (0-3) - uint8_t duty_cycle_pos; ///< Duty cycle of positive clock, in 1/256th increments (128 = 50%/50% duty). Setting this to 0 (=not setting it) is equivalent to setting this to 128. - uint8_t cs_ena_pretrans; ///< Amount of SPI bit-cycles the cs should be activated before the transmission (0-16). This only works on half-duplex transactions. - uint8_t cs_ena_posttrans; ///< Amount of SPI bit-cycles the cs should stay active after the transmission (0-16) - int clock_speed_hz; ///< Clock speed, divisors of 80MHz, in Hz. See ``SPI_MASTER_FREQ_*``. - int input_delay_ns; /**< Maximum data valid time of slave. The time required between SCLK and MISO - valid, including the possible clock delay from slave to master. The driver uses this value to give an extra - delay before the MISO is ready on the line. Leave at 0 unless you know you need a delay. For better timing - performance at high frequency (over 8MHz), it's suggest to have the right value. - */ - int spics_io_num; ///< CS GPIO pin for this device, or -1 if not used - uint32_t flags; ///< Bitwise OR of SPI_DEVICE_* flags - int queue_size; ///< Transaction queue size. This sets how many transactions can be 'in the air' (queued using spi_device_queue_trans but not yet finished using spi_device_get_trans_result) at the same time - transaction_cb_t pre_cb; /**< Callback to be called before a transmission is started. - * - * This callback is called within interrupt - * context should be in IRAM for best - * performance, see "Transferring Speed" - * section in the SPI Master documentation for - * full details. If not, the callback may crash - * during flash operation when the driver is - * initialized with ESP_INTR_FLAG_IRAM. - */ - transaction_cb_t post_cb; /**< Callback to be called after a transmission has completed. - * - * This callback is called within interrupt - * context should be in IRAM for best - * performance, see "Transferring Speed" - * section in the SPI Master documentation for - * full details. If not, the callback may crash - * during flash operation when the driver is - * initialized with ESP_INTR_FLAG_IRAM. - */ -} spi_device_interface_config_t; - - -#define SPI_TRANS_MODE_DIO (1<<0) ///< Transmit/receive data in 2-bit mode -#define SPI_TRANS_MODE_QIO (1<<1) ///< Transmit/receive data in 4-bit mode -#define SPI_TRANS_USE_RXDATA (1<<2) ///< Receive into rx_data member of spi_transaction_t instead into memory at rx_buffer. -#define SPI_TRANS_USE_TXDATA (1<<3) ///< Transmit tx_data member of spi_transaction_t instead of data at tx_buffer. Do not set tx_buffer when using this. -#define SPI_TRANS_MODE_DIOQIO_ADDR (1<<4) ///< Also transmit address in mode selected by SPI_MODE_DIO/SPI_MODE_QIO -#define SPI_TRANS_VARIABLE_CMD (1<<5) ///< Use the ``command_bits`` in ``spi_transaction_ext_t`` rather than default value in ``spi_device_interface_config_t``. -#define SPI_TRANS_VARIABLE_ADDR (1<<6) ///< Use the ``address_bits`` in ``spi_transaction_ext_t`` rather than default value in ``spi_device_interface_config_t``. - -/** - * This structure describes one SPI transaction. The descriptor should not be modified until the transaction finishes. - */ -struct spi_transaction_t { - uint32_t flags; ///< Bitwise OR of SPI_TRANS_* flags - uint16_t cmd; /**< Command data, of which the length is set in the ``command_bits`` of spi_device_interface_config_t. - * - * NOTE: this field, used to be "command" in ESP-IDF 2.1 and before, is re-written to be used in a new way in ESP-IDF 3.0. - * - * Example: write 0x0123 and command_bits=12 to send command 0x12, 0x3_ (in previous version, you may have to write 0x3_12). - */ - uint64_t addr; /**< Address data, of which the length is set in the ``address_bits`` of spi_device_interface_config_t. - * - * NOTE: this field, used to be "address" in ESP-IDF 2.1 and before, is re-written to be used in a new way in ESP-IDF3.0. - * - * Example: write 0x123400 and address_bits=24 to send address of 0x12, 0x34, 0x00 (in previous version, you may have to write 0x12340000). - */ - size_t length; ///< Total data length, in bits - size_t rxlength; ///< Total data length received, should be not greater than ``length`` in full-duplex mode (0 defaults this to the value of ``length``). - void *user; ///< User-defined variable. Can be used to store eg transaction ID. - union { - const void *tx_buffer; ///< Pointer to transmit buffer, or NULL for no MOSI phase - uint8_t tx_data[4]; ///< If SPI_USE_TXDATA is set, data set here is sent directly from this variable. - }; - union { - void *rx_buffer; ///< Pointer to receive buffer, or NULL for no MISO phase. Written by 4 bytes-unit if DMA is used. - uint8_t rx_data[4]; ///< If SPI_USE_RXDATA is set, data is received directly to this variable - }; -} ; //the rx data should start from a 32-bit aligned address to get around dma issue. - -/** - * This struct is for SPI transactions which may change their address and command length. - * Please do set the flags in base to ``SPI_TRANS_VARIABLE_CMD_ADR`` to use the bit length here. - */ -typedef struct { - struct spi_transaction_t base; ///< Transaction data, so that pointer to spi_transaction_t can be converted into spi_transaction_ext_t - uint8_t command_bits; ///< The command length in this transaction, in bits. - uint8_t address_bits; ///< The address length in this transaction, in bits. -} spi_transaction_ext_t ; - - -typedef struct spi_device_t* spi_device_handle_t; ///< Handle for a device on a SPI bus - -/** - * @brief Initialize a SPI bus - * - * @warning For now, only supports HSPI and VSPI. - * - * @param host SPI peripheral that controls this bus - * @param bus_config Pointer to a spi_bus_config_t struct specifying how the host should be initialized - * @param dma_chan Either channel 1 or 2, or 0 in the case when no DMA is required. Selecting a DMA channel - * for a SPI bus allows transfers on the bus to have sizes only limited by the amount of - * internal memory. Selecting no DMA channel (by passing the value 0) limits the amount of - * bytes transfered to a maximum of 32. - * - * @warning If a DMA channel is selected, any transmit and receive buffer used should be allocated in - * DMA-capable memory. - * - * @return - * - ESP_ERR_INVALID_ARG if configuration is invalid - * - ESP_ERR_INVALID_STATE if host already is in use - * - ESP_ERR_NO_MEM if out of memory - * - ESP_OK on success - */ -esp_err_t spi_bus_initialize(spi_host_device_t host, const spi_bus_config_t *bus_config, int dma_chan); - -/** - * @brief Free a SPI bus - * - * @warning In order for this to succeed, all devices have to be removed first. - * - * @param host SPI peripheral to free - * @return - * - ESP_ERR_INVALID_ARG if parameter is invalid - * - ESP_ERR_INVALID_STATE if not all devices on the bus are freed - * - ESP_OK on success - */ -esp_err_t spi_bus_free(spi_host_device_t host); - -/** - * @brief Allocate a device on a SPI bus - * - * This initializes the internal structures for a device, plus allocates a CS pin on the indicated SPI master - * peripheral and routes it to the indicated GPIO. All SPI master devices have three CS pins and can thus control - * up to three devices. - * - * @note While in general, speeds up to 80MHz on the dedicated SPI pins and 40MHz on GPIO-matrix-routed pins are - * supported, full-duplex transfers routed over the GPIO matrix only support speeds up to 26MHz. - * - * @param host SPI peripheral to allocate device on - * @param dev_config SPI interface protocol config for the device - * @param handle Pointer to variable to hold the device handle - * @return - * - ESP_ERR_INVALID_ARG if parameter is invalid - * - ESP_ERR_NOT_FOUND if host doesn't have any free CS slots - * - ESP_ERR_NO_MEM if out of memory - * - ESP_OK on success - */ -esp_err_t spi_bus_add_device(spi_host_device_t host, const spi_device_interface_config_t *dev_config, spi_device_handle_t *handle); - - -/** - * @brief Remove a device from the SPI bus - * - * @param handle Device handle to free - * @return - * - ESP_ERR_INVALID_ARG if parameter is invalid - * - ESP_ERR_INVALID_STATE if device already is freed - * - ESP_OK on success - */ -esp_err_t spi_bus_remove_device(spi_device_handle_t handle); - - -/** - * @brief Queue a SPI transaction for interrupt transaction execution. Get the result by ``spi_device_get_trans_result``. - * - * @note Normally a device cannot start (queue) polling and interrupt - * transactions simultaneously. - * - * @param handle Device handle obtained using spi_host_add_dev - * @param trans_desc Description of transaction to execute - * @param ticks_to_wait Ticks to wait until there's room in the queue; use portMAX_DELAY to - * never time out. - * @return - * - ESP_ERR_INVALID_ARG if parameter is invalid - * - ESP_ERR_TIMEOUT if there was no room in the queue before ticks_to_wait expired - * - ESP_ERR_NO_MEM if allocating DMA-capable temporary buffer failed - * - ESP_ERR_INVALID_STATE if previous transactions are not finished - * - ESP_OK on success - */ -esp_err_t spi_device_queue_trans(spi_device_handle_t handle, spi_transaction_t *trans_desc, TickType_t ticks_to_wait); - - -/** - * @brief Get the result of a SPI transaction queued earlier by ``spi_device_queue_trans``. - * - * This routine will wait until a transaction to the given device - * succesfully completed. It will then return the description of the - * completed transaction so software can inspect the result and e.g. free the memory or - * re-use the buffers. - * - * @param handle Device handle obtained using spi_host_add_dev - * @param trans_desc Pointer to variable able to contain a pointer to the description of the transaction - that is executed. The descriptor should not be modified until the descriptor is returned by - spi_device_get_trans_result. - * @param ticks_to_wait Ticks to wait until there's a returned item; use portMAX_DELAY to never time - out. - * @return - * - ESP_ERR_INVALID_ARG if parameter is invalid - * - ESP_ERR_TIMEOUT if there was no completed transaction before ticks_to_wait expired - * - ESP_OK on success - */ -esp_err_t spi_device_get_trans_result(spi_device_handle_t handle, spi_transaction_t **trans_desc, TickType_t ticks_to_wait); - - -/** - * @brief Send a SPI transaction, wait for it to complete, and return the result - * - * This function is the equivalent of calling spi_device_queue_trans() followed by spi_device_get_trans_result(). - * Do not use this when there is still a transaction separately queued (started) from spi_device_queue_trans() or polling_start/transmit that hasn't been finalized. - * - * @note This function is not thread safe when multiple tasks access the same SPI device. - * Normally a device cannot start (queue) polling and interrupt - * transactions simutanuously. - * - * @param handle Device handle obtained using spi_host_add_dev - * @param trans_desc Description of transaction to execute - * @return - * - ESP_ERR_INVALID_ARG if parameter is invalid - * - ESP_OK on success - */ -esp_err_t spi_device_transmit(spi_device_handle_t handle, spi_transaction_t *trans_desc); - - -/** - * @brief Immediately start a polling transaction. - * - * @note Normally a device cannot start (queue) polling and interrupt - * transactions simutanuously. Moreover, a device cannot start a new polling - * transaction if another polling transaction is not finished. - * - * @param handle Device handle obtained using spi_host_add_dev - * @param trans_desc Description of transaction to execute - * @param ticks_to_wait Ticks to wait until there's room in the queue; - * currently only portMAX_DELAY is supported. - * - * @return - * - ESP_ERR_INVALID_ARG if parameter is invalid - * - ESP_ERR_TIMEOUT if the device cannot get control of the bus before ``ticks_to_wait`` expired - * - ESP_ERR_NO_MEM if allocating DMA-capable temporary buffer failed - * - ESP_ERR_INVALID_STATE if previous transactions are not finished - * - ESP_OK on success - */ -esp_err_t spi_device_polling_start(spi_device_handle_t handle, spi_transaction_t *trans_desc, TickType_t ticks_to_wait); - - -/** - * @brief Poll until the polling transaction ends. - * - * This routine will not return until the transaction to the given device has - * succesfully completed. The task is not blocked, but actively busy-spins for - * the transaction to be completed. - * - * @param handle Device handle obtained using spi_host_add_dev - * @param ticks_to_wait Ticks to wait until there's a returned item; use portMAX_DELAY to never time - out. - * @return - * - ESP_ERR_INVALID_ARG if parameter is invalid - * - ESP_ERR_TIMEOUT if the transaction cannot finish before ticks_to_wait expired - * - ESP_OK on success - */ -esp_err_t spi_device_polling_end(spi_device_handle_t handle, TickType_t ticks_to_wait); - - -/** - * @brief Send a polling transaction, wait for it to complete, and return the result - * - * This function is the equivalent of calling spi_device_polling_start() followed by spi_device_polling_end(). - * Do not use this when there is still a transaction that hasn't been finalized. - * - * @note This function is not thread safe when multiple tasks access the same SPI device. - * Normally a device cannot start (queue) polling and interrupt - * transactions simutanuously. - * - * @param handle Device handle obtained using spi_host_add_dev - * @param trans_desc Description of transaction to execute - * @return - * - ESP_ERR_INVALID_ARG if parameter is invalid - * - ESP_OK on success - */ -esp_err_t spi_device_polling_transmit(spi_device_handle_t handle, spi_transaction_t *trans_desc); - - -/** - * @brief Occupy the SPI bus for a device to do continuous transactions. - * - * Transactions to all other devices will be put off until ``spi_device_release_bus`` is called. - * - * @note The function will wait until all the existing transactions have been sent. - * - * @param device The device to occupy the bus. - * @param wait Time to wait before the the bus is occupied by the device. Currently MUST set to portMAX_DELAY. - * - * @return - * - ESP_ERR_INVALID_ARG : ``wait`` is not set to portMAX_DELAY. - * - ESP_OK : Success. - */ -esp_err_t spi_device_acquire_bus(spi_device_handle_t device, TickType_t wait); - -/** - * @brief Release the SPI bus occupied by the device. All other devices can start sending transactions. - * - * @param dev The device to release the bus. - */ -void spi_device_release_bus(spi_device_handle_t dev); - - -/** - * @brief Calculate the working frequency that is most close to desired frequency, and also the register value. - * - * @param fapb The frequency of apb clock, should be ``APB_CLK_FREQ``. - * @param hz Desired working frequency - * @param duty_cycle Duty cycle of the spi clock - * @param reg_o Output of value to be set in clock register, or NULL if not needed. - * @return Actual working frequency that most fit. - */ -int spi_cal_clock(int fapb, int hz, int duty_cycle, uint32_t* reg_o); - -/** - * @brief Calculate the timing settings of specified frequency and settings. - * - * @param gpio_is_used True if using GPIO matrix, or False if iomux pins are used. - * @param input_delay_ns Input delay from SCLK launch edge to MISO data valid. - * @param eff_clk Effective clock frequency (in Hz) from spi_cal_clock. - * @param dummy_o Address of dummy bits used output. Set to NULL if not needed. - * @param cycles_remain_o Address of cycles remaining (after dummy bits are used) output. - * - -1 If too many cycles remaining, suggest to compensate half a clock. - * - 0 If no remaining cycles or dummy bits are not used. - * - positive value: cycles suggest to compensate. - * - * @note If **dummy_o* is not zero, it means dummy bits should be applied in half duplex mode, and full duplex mode may not work. - */ -void spi_get_timing(bool gpio_is_used, int input_delay_ns, int eff_clk, int* dummy_o, int* cycles_remain_o); - -/** - * @brief Get the frequency limit of current configurations. - * SPI master working at this limit is OK, while above the limit, full duplex mode and DMA will not work, - * and dummy bits will be aplied in the half duplex mode. - * - * @param gpio_is_used True if using GPIO matrix, or False if native pins are used. - * @param input_delay_ns Input delay from SCLK launch edge to MISO data valid. - * @return Frequency limit of current configurations. - */ -int spi_get_freq_limit(bool gpio_is_used, int input_delay_ns); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/driver/driver/spi_slave.h b/tools/sdk/include/driver/driver/spi_slave.h deleted file mode 100644 index 546f3b67336..00000000000 --- a/tools/sdk/include/driver/driver/spi_slave.h +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright 2010-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. - - -#ifndef _DRIVER_SPI_SLAVE_H_ -#define _DRIVER_SPI_SLAVE_H_ - -#include "esp_err.h" -#include "freertos/FreeRTOS.h" -#include "freertos/semphr.h" -#include "driver/spi_common.h" - - -#ifdef __cplusplus -extern "C" -{ -#endif - - -#define SPI_SLAVE_TXBIT_LSBFIRST (1<<0) ///< Transmit command/address/data LSB first instead of the default MSB first -#define SPI_SLAVE_RXBIT_LSBFIRST (1<<1) ///< Receive data LSB first instead of the default MSB first -#define SPI_SLAVE_BIT_LSBFIRST (SPI_SLAVE_TXBIT_LSBFIRST|SPI_SLAVE_RXBIT_LSBFIRST) ///< Transmit and receive LSB first - - -typedef struct spi_slave_transaction_t spi_slave_transaction_t; -typedef void(*slave_transaction_cb_t)(spi_slave_transaction_t *trans); - -/** - * @brief This is a configuration for a SPI host acting as a slave device. - */ -typedef struct { - int spics_io_num; ///< CS GPIO pin for this device - uint32_t flags; ///< Bitwise OR of SPI_SLAVE_* flags - int queue_size; ///< Transaction queue size. This sets how many transactions can be 'in the air' (queued using spi_slave_queue_trans but not yet finished using spi_slave_get_trans_result) at the same time - uint8_t mode; ///< SPI mode (0-3) - slave_transaction_cb_t post_setup_cb; /**< Callback called after the SPI registers are loaded with new data. - * - * This callback is called within interrupt - * context should be in IRAM for best - * performance, see "Transferring Speed" - * section in the SPI Master documentation for - * full details. If not, the callback may crash - * during flash operation when the driver is - * initialized with ESP_INTR_FLAG_IRAM. - */ - slave_transaction_cb_t post_trans_cb; /**< Callback called after a transaction is done. - * - * This callback is called within interrupt - * context should be in IRAM for best - * performance, see "Transferring Speed" - * section in the SPI Master documentation for - * full details. If not, the callback may crash - * during flash operation when the driver is - * initialized with ESP_INTR_FLAG_IRAM. - */ -} spi_slave_interface_config_t; - -/** - * This structure describes one SPI transaction - */ -struct spi_slave_transaction_t { - size_t length; ///< Total data length, in bits - size_t trans_len; ///< Transaction data length, in bits - const void *tx_buffer; ///< Pointer to transmit buffer, or NULL for no MOSI phase - void *rx_buffer; ///< Pointer to receive buffer, or NULL for no MISO phase - void *user; ///< User-defined variable. Can be used to store eg transaction ID. -}; - -/** - * @brief Initialize a SPI bus as a slave interface - * - * @warning For now, only supports HSPI and VSPI. - * - * @param host SPI peripheral to use as a SPI slave interface - * @param bus_config Pointer to a spi_bus_config_t struct specifying how the host should be initialized - * @param slave_config Pointer to a spi_slave_interface_config_t struct specifying the details for the slave interface - * @param dma_chan Either 1 or 2. A SPI bus used by this driver must have a DMA channel associated with - * it. The SPI hardware has two DMA channels to share. This parameter indicates which - * one to use. - * - * @warning If a DMA channel is selected, any transmit and receive buffer used should be allocated in - * DMA-capable memory. - * - * @return - * - ESP_ERR_INVALID_ARG if configuration is invalid - * - ESP_ERR_INVALID_STATE if host already is in use - * - ESP_ERR_NO_MEM if out of memory - * - ESP_OK on success - */ -esp_err_t spi_slave_initialize(spi_host_device_t host, const spi_bus_config_t *bus_config, const spi_slave_interface_config_t *slave_config, int dma_chan); - -/** - * @brief Free a SPI bus claimed as a SPI slave interface - * - * @param host SPI peripheral to free - * @return - * - ESP_ERR_INVALID_ARG if parameter is invalid - * - ESP_ERR_INVALID_STATE if not all devices on the bus are freed - * - ESP_OK on success - */ -esp_err_t spi_slave_free(spi_host_device_t host); - - -/** - * @brief Queue a SPI transaction for execution - * - * Queues a SPI transaction to be executed by this slave device. (The transaction queue size was specified when the slave - * device was initialised via spi_slave_initialize.) This function may block if the queue is full (depending on the - * ticks_to_wait parameter). No SPI operation is directly initiated by this function, the next queued transaction - * will happen when the master initiates a SPI transaction by pulling down CS and sending out clock signals. - * - * This function hands over ownership of the buffers in ``trans_desc`` to the SPI slave driver; the application is - * not to access this memory until ``spi_slave_queue_trans`` is called to hand ownership back to the application. - * - * @param host SPI peripheral that is acting as a slave - * @param trans_desc Description of transaction to execute. Not const because we may want to write status back - * into the transaction description. - * @param ticks_to_wait Ticks to wait until there's room in the queue; use portMAX_DELAY to - * never time out. - * @return - * - ESP_ERR_INVALID_ARG if parameter is invalid - * - ESP_OK on success - */ -esp_err_t spi_slave_queue_trans(spi_host_device_t host, const spi_slave_transaction_t *trans_desc, TickType_t ticks_to_wait); - - -/** - * @brief Get the result of a SPI transaction queued earlier - * - * This routine will wait until a transaction to the given device (queued earlier with - * spi_slave_queue_trans) has succesfully completed. It will then return the description of the - * completed transaction so software can inspect the result and e.g. free the memory or - * re-use the buffers. - * - * It is mandatory to eventually use this function for any transaction queued by ``spi_slave_queue_trans``. - * - * @param host SPI peripheral to that is acting as a slave - * @param[out] trans_desc Pointer to variable able to contain a pointer to the description of the - * transaction that is executed - * @param ticks_to_wait Ticks to wait until there's a returned item; use portMAX_DELAY to never time - * out. - * @return - * - ESP_ERR_INVALID_ARG if parameter is invalid - * - ESP_OK on success - */ -esp_err_t spi_slave_get_trans_result(spi_host_device_t host, spi_slave_transaction_t **trans_desc, TickType_t ticks_to_wait); - - -/** - * @brief Do a SPI transaction - * - * Essentially does the same as spi_slave_queue_trans followed by spi_slave_get_trans_result. Do - * not use this when there is still a transaction queued that hasn't been finalized - * using spi_slave_get_trans_result. - * - * @param host SPI peripheral to that is acting as a slave - * @param trans_desc Pointer to variable able to contain a pointer to the description of the - * transaction that is executed. Not const because we may want to write status back - * into the transaction description. - * @param ticks_to_wait Ticks to wait until there's a returned item; use portMAX_DELAY to never time - * out. - * @return - * - ESP_ERR_INVALID_ARG if parameter is invalid - * - ESP_OK on success - */ -esp_err_t spi_slave_transmit(spi_host_device_t host, spi_slave_transaction_t *trans_desc, TickType_t ticks_to_wait); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/driver/driver/timer.h b/tools/sdk/include/driver/driver/timer.h deleted file mode 100644 index 48e2b98908d..00000000000 --- a/tools/sdk/include/driver/driver/timer.h +++ /dev/null @@ -1,353 +0,0 @@ -// Copyright 2010-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. - -#ifndef _DRIVER_TIMER_H_ -#define _DRIVER_TIMER_H_ -#include "esp_err.h" -#include "esp_attr.h" -#include "soc/soc.h" -#include "soc/timer_group_reg.h" -#include "soc/timer_group_struct.h" -#include "esp_intr_alloc.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -#define TIMER_BASE_CLK (APB_CLK_FREQ) /*!< Frequency of the clock on the input of the timer groups */ - -/** - * @brief Selects a Timer-Group out of 2 available groups - */ -typedef enum { - TIMER_GROUP_0 = 0, /*! -#include "soc/uart_channel.h" - -#define UART_FIFO_LEN (128) /*!< Length of the hardware FIFO buffers */ -#define UART_INTR_MASK 0x1ff /*!< Mask of all UART interrupts */ -#define UART_LINE_INV_MASK (0x3f << 19) /*!< TBD */ -#define UART_BITRATE_MAX 5000000 /*!< Max bit rate supported by UART */ -#define UART_PIN_NO_CHANGE (-1) /*!< Constant for uart_set_pin function which indicates that UART pin should not be changed */ - -#define UART_INVERSE_DISABLE (0x0) /*!< Disable UART signal inverse*/ -#define UART_INVERSE_RXD (UART_RXD_INV_M) /*!< UART RXD input inverse*/ -#define UART_INVERSE_CTS (UART_CTS_INV_M) /*!< UART CTS input inverse*/ -#define UART_INVERSE_TXD (UART_TXD_INV_M) /*!< UART TXD output inverse*/ -#define UART_INVERSE_RTS (UART_RTS_INV_M) /*!< UART RTS output inverse*/ - -/** - * @brief UART mode selection - */ -typedef enum { - UART_MODE_UART = 0x00, /*!< mode: regular UART mode*/ - UART_MODE_RS485_HALF_DUPLEX = 0x01, /*!< mode: half duplex RS485 UART mode control by RTS pin */ - UART_MODE_IRDA = 0x02, /*!< mode: IRDA UART mode*/ - UART_MODE_RS485_COLLISION_DETECT = 0x03, /*!< mode: RS485 collision detection UART mode (used for test purposes)*/ - UART_MODE_RS485_APP_CTRL = 0x04, /*!< mode: application control RS485 UART mode (used for test purposes)*/ -} uart_mode_t; - -/** - * @brief UART word length constants - */ -typedef enum { - UART_DATA_5_BITS = 0x0, /*!< word length: 5bits*/ - UART_DATA_6_BITS = 0x1, /*!< word length: 6bits*/ - UART_DATA_7_BITS = 0x2, /*!< word length: 7bits*/ - UART_DATA_8_BITS = 0x3, /*!< word length: 8bits*/ - UART_DATA_BITS_MAX = 0x4, -} uart_word_length_t; - -/** - * @brief UART stop bits number - */ -typedef enum { - UART_STOP_BITS_1 = 0x1, /*!< stop bit: 1bit*/ - UART_STOP_BITS_1_5 = 0x2, /*!< stop bit: 1.5bits*/ - UART_STOP_BITS_2 = 0x3, /*!< stop bit: 2bits*/ - UART_STOP_BITS_MAX = 0x4, -} uart_stop_bits_t; - -/** - * @brief UART peripheral number - */ -typedef enum { - UART_NUM_0 = 0x0, /*!< UART base address 0x3ff40000*/ - UART_NUM_1 = 0x1, /*!< UART base address 0x3ff50000*/ - UART_NUM_2 = 0x2, /*!< UART base address 0x3ff6e000*/ - UART_NUM_MAX, -} uart_port_t; - -/** - * @brief UART parity constants - */ -typedef enum { - UART_PARITY_DISABLE = 0x0, /*!< Disable UART parity*/ - UART_PARITY_EVEN = 0x2, /*!< Enable UART even parity*/ - UART_PARITY_ODD = 0x3 /*!< Enable UART odd parity*/ -} uart_parity_t; - -/** - * @brief UART hardware flow control modes - */ -typedef enum { - UART_HW_FLOWCTRL_DISABLE = 0x0, /*!< disable hardware flow control*/ - UART_HW_FLOWCTRL_RTS = 0x1, /*!< enable RX hardware flow control (rts)*/ - UART_HW_FLOWCTRL_CTS = 0x2, /*!< enable TX hardware flow control (cts)*/ - UART_HW_FLOWCTRL_CTS_RTS = 0x3, /*!< enable hardware flow control*/ - UART_HW_FLOWCTRL_MAX = 0x4, -} uart_hw_flowcontrol_t; - -/** - * @brief UART configuration parameters for uart_param_config function - */ -typedef struct { - int baud_rate; /*!< UART baud rate*/ - uart_word_length_t data_bits; /*!< UART byte size*/ - uart_parity_t parity; /*!< UART parity mode*/ - uart_stop_bits_t stop_bits; /*!< UART stop bits*/ - uart_hw_flowcontrol_t flow_ctrl; /*!< UART HW flow control mode (cts/rts)*/ - uint8_t rx_flow_ctrl_thresh; /*!< UART HW RTS threshold*/ - bool use_ref_tick; /*!< Set to true if UART should be clocked from REF_TICK */ -} uart_config_t; - -/** - * @brief UART interrupt configuration parameters for uart_intr_config function - */ -typedef struct { - uint32_t intr_enable_mask; /*!< UART interrupt enable mask, choose from UART_XXXX_INT_ENA_M under UART_INT_ENA_REG(i), connect with bit-or operator*/ - uint8_t rx_timeout_thresh; /*!< UART timeout interrupt threshold (unit: time of sending one byte)*/ - uint8_t txfifo_empty_intr_thresh; /*!< UART TX empty interrupt threshold.*/ - uint8_t rxfifo_full_thresh; /*!< UART RX full interrupt threshold.*/ -} uart_intr_config_t; - -/** - * @brief UART event types used in the ring buffer - */ -typedef enum { - UART_DATA, /*!< UART data event*/ - UART_BREAK, /*!< UART break event*/ - UART_BUFFER_FULL, /*!< UART RX buffer full event*/ - UART_FIFO_OVF, /*!< UART FIFO overflow event*/ - UART_FRAME_ERR, /*!< UART RX frame error event*/ - UART_PARITY_ERR, /*!< UART RX parity event*/ - UART_DATA_BREAK, /*!< UART TX data and break event*/ - UART_PATTERN_DET, /*!< UART pattern detected */ - UART_EVENT_MAX, /*!< UART event max index*/ -} uart_event_type_t; - -/** - * @brief Event structure used in UART event queue - */ -typedef struct { - uart_event_type_t type; /*!< UART event type */ - size_t size; /*!< UART data size for UART_DATA event*/ -} uart_event_t; - -typedef intr_handle_t uart_isr_handle_t; - -/** - * @brief Set UART data bits. - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param data_bit UART data bits - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t uart_set_word_length(uart_port_t uart_num, uart_word_length_t data_bit); - -/** - * @brief Get UART data bits. - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param data_bit Pointer to accept value of UART data bits. - * - * @return - * - ESP_FAIL Parameter error - * - ESP_OK Success, result will be put in (*data_bit) - */ -esp_err_t uart_get_word_length(uart_port_t uart_num, uart_word_length_t* data_bit); - -/** - * @brief Set UART stop bits. - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param stop_bits UART stop bits - * - * @return - * - ESP_OK Success - * - ESP_FAIL Fail - */ -esp_err_t uart_set_stop_bits(uart_port_t uart_num, uart_stop_bits_t stop_bits); - -/** - * @brief Get UART stop bits. - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param stop_bits Pointer to accept value of UART stop bits. - * - * @return - * - ESP_FAIL Parameter error - * - ESP_OK Success, result will be put in (*stop_bit) - */ -esp_err_t uart_get_stop_bits(uart_port_t uart_num, uart_stop_bits_t* stop_bits); - -/** - * @brief Set UART parity mode. - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param parity_mode the enum of uart parity configuration - * - * @return - * - ESP_FAIL Parameter error - * - ESP_OK Success - */ -esp_err_t uart_set_parity(uart_port_t uart_num, uart_parity_t parity_mode); - -/** - * @brief Get UART parity mode. - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param parity_mode Pointer to accept value of UART parity mode. - * - * @return - * - ESP_FAIL Parameter error - * - ESP_OK Success, result will be put in (*parity_mode) - * - */ -esp_err_t uart_get_parity(uart_port_t uart_num, uart_parity_t* parity_mode); - -/** - * @brief Set UART baud rate. - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param baudrate UART baud rate. - * - * @return - * - ESP_FAIL Parameter error - * - ESP_OK Success - */ -esp_err_t uart_set_baudrate(uart_port_t uart_num, uint32_t baudrate); - -/** - * @brief Get UART baud rate. - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param baudrate Pointer to accept value of UART baud rate - * - * @return - * - ESP_FAIL Parameter error - * - ESP_OK Success, result will be put in (*baudrate) - * - */ -esp_err_t uart_get_baudrate(uart_port_t uart_num, uint32_t* baudrate); - -/** - * @brief Set UART line inverse mode - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param inverse_mask Choose the wires that need to be inverted. - * Inverse_mask should be chosen from - * UART_INVERSE_RXD / UART_INVERSE_TXD / UART_INVERSE_RTS / UART_INVERSE_CTS, - * combined with OR operation. - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t uart_set_line_inverse(uart_port_t uart_num, uint32_t inverse_mask); - -/** - * @brief Set hardware flow control. - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param flow_ctrl Hardware flow control mode - * @param rx_thresh Threshold of Hardware RX flow control (0 ~ UART_FIFO_LEN). - * Only when UART_HW_FLOWCTRL_RTS is set, will the rx_thresh value be set. - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t uart_set_hw_flow_ctrl(uart_port_t uart_num, uart_hw_flowcontrol_t flow_ctrl, uint8_t rx_thresh); - -/** - * @brief Set software flow control. - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param enable switch on or off - * @param rx_thresh_xon low water mark - * @param rx_thresh_xoff high water mark - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ - esp_err_t uart_set_sw_flow_ctrl(uart_port_t uart_num, bool enable, uint8_t rx_thresh_xon, uint8_t rx_thresh_xoff); - -/** - * @brief Get hardware flow control mode - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param flow_ctrl Option for different flow control mode. - * - * @return - * - ESP_FAIL Parameter error - * - ESP_OK Success, result will be put in (*flow_ctrl) - */ -esp_err_t uart_get_hw_flow_ctrl(uart_port_t uart_num, uart_hw_flowcontrol_t* flow_ctrl); - -/** - * @brief Clear UART interrupt status - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param clr_mask Bit mask of the interrupt status to be cleared. - * The bit mask should be composed from the fields of register UART_INT_CLR_REG. - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t uart_clear_intr_status(uart_port_t uart_num, uint32_t clr_mask); - -/** - * @brief Set UART interrupt enable - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param enable_mask Bit mask of the enable bits. - * The bit mask should be composed from the fields of register UART_INT_ENA_REG. - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t uart_enable_intr_mask(uart_port_t uart_num, uint32_t enable_mask); - -/** - * @brief Clear UART interrupt enable bits - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param disable_mask Bit mask of the disable bits. - * The bit mask should be composed from the fields of register UART_INT_ENA_REG. - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t uart_disable_intr_mask(uart_port_t uart_num, uint32_t disable_mask); - -/** - * @brief Enable UART RX interrupt (RX_FULL & RX_TIMEOUT INTERRUPT) - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t uart_enable_rx_intr(uart_port_t uart_num); - -/** - * @brief Disable UART RX interrupt (RX_FULL & RX_TIMEOUT INTERRUPT) - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t uart_disable_rx_intr(uart_port_t uart_num); - -/** - * @brief Disable UART TX interrupt (TX_FULL & TX_TIMEOUT INTERRUPT) - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t uart_disable_tx_intr(uart_port_t uart_num); - -/** - * @brief Enable UART TX interrupt (TX_FULL & TX_TIMEOUT INTERRUPT) - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param enable 1: enable; 0: disable - * @param thresh Threshold of TX interrupt, 0 ~ UART_FIFO_LEN - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t uart_enable_tx_intr(uart_port_t uart_num, int enable, int thresh); - -/** - * @brief Register UART interrupt handler (ISR). - * - * @note UART ISR handler will be attached to the same CPU core that this function is running on. - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param fn Interrupt handler function. - * @param arg parameter for handler function - * @param intr_alloc_flags Flags used to allocate the interrupt. One or multiple (ORred) - * ESP_INTR_FLAG_* values. See esp_intr_alloc.h for more info. - * @param handle Pointer to return handle. If non-NULL, a handle for the interrupt will - * be returned here. - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t uart_isr_register(uart_port_t uart_num, void (*fn)(void*), void * arg, int intr_alloc_flags, uart_isr_handle_t *handle); - -/** - * @brief Free UART interrupt handler registered by uart_isr_register. Must be called on the same core as - * uart_isr_register was called. - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t uart_isr_free(uart_port_t uart_num); - -/** - * @brief Set UART pin number - * - * @note Internal signal can be output to multiple GPIO pads. - * Only one GPIO pad can connect with input signal. - * - * @note Instead of GPIO number a macro 'UART_PIN_NO_CHANGE' may be provided - to keep the currently allocated pin. - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param tx_io_num UART TX pin GPIO number. - * @param rx_io_num UART RX pin GPIO number. - * @param rts_io_num UART RTS pin GPIO number. - * @param cts_io_num UART CTS pin GPIO number. - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t uart_set_pin(uart_port_t uart_num, int tx_io_num, int rx_io_num, int rts_io_num, int cts_io_num); - -/** - * @brief Manually set the UART RTS pin level. - * @note UART must be configured with hardware flow control disabled. - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param level 1: RTS output low (active); 0: RTS output high (block) - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t uart_set_rts(uart_port_t uart_num, int level); - -/** - * @brief Manually set the UART DTR pin level. - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param level 1: DTR output low; 0: DTR output high - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t uart_set_dtr(uart_port_t uart_num, int level); - -/** - * @brief Set UART idle interval after tx FIFO is empty - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param idle_num idle interval after tx FIFO is empty(unit: the time it takes to send one bit - * under current baudrate) - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t uart_set_tx_idle_num(uart_port_t uart_num, uint16_t idle_num); - -/** - * @brief Set UART configuration parameters. - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param uart_config UART parameter settings - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t uart_param_config(uart_port_t uart_num, const uart_config_t *uart_config); - -/** - * @brief Configure UART interrupts. - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param intr_conf UART interrupt settings - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t uart_intr_config(uart_port_t uart_num, const uart_intr_config_t *intr_conf); - -/** - * @brief Install UART driver. - * - * UART ISR handler will be attached to the same CPU core that this function is running on. - * - * @note Rx_buffer_size should be greater than UART_FIFO_LEN. Tx_buffer_size should be either zero or greater than UART_FIFO_LEN. - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param rx_buffer_size UART RX ring buffer size. - * @param tx_buffer_size UART TX ring buffer size. - * If set to zero, driver will not use TX buffer, TX function will block task until all data have been sent out. - * @param queue_size UART event queue size/depth. - * @param uart_queue UART event queue handle (out param). On success, a new queue handle is written here to provide - * access to UART events. If set to NULL, driver will not use an event queue. - * @param intr_alloc_flags Flags used to allocate the interrupt. One or multiple (ORred) - * ESP_INTR_FLAG_* values. See esp_intr_alloc.h for more info. Do not set ESP_INTR_FLAG_IRAM here - * (the driver's ISR handler is not located in IRAM) - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t uart_driver_install(uart_port_t uart_num, int rx_buffer_size, int tx_buffer_size, int queue_size, QueueHandle_t* uart_queue, int intr_alloc_flags); - -/** - * @brief Uninstall UART driver. - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t uart_driver_delete(uart_port_t uart_num); - -/** - * @brief Wait until UART TX FIFO is empty. - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param ticks_to_wait Timeout, count in RTOS ticks - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - * - ESP_ERR_TIMEOUT Timeout - */ -esp_err_t uart_wait_tx_done(uart_port_t uart_num, TickType_t ticks_to_wait); - -/** - * @brief Send data to the UART port from a given buffer and length. - * - * This function will not wait for enough space in TX FIFO. It will just fill the available TX FIFO and return when the FIFO is full. - * @note This function should only be used when UART TX buffer is not enabled. - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param buffer data buffer address - * @param len data length to send - * - * @return - * - (-1) Parameter error - * - OTHERS (>=0) The number of bytes pushed to the TX FIFO - */ -int uart_tx_chars(uart_port_t uart_num, const char* buffer, uint32_t len); - -/** - * @brief Send data to the UART port from a given buffer and length, - * - * If the UART driver's parameter 'tx_buffer_size' is set to zero: - * This function will not return until all the data have been sent out, or at least pushed into TX FIFO. - * - * Otherwise, if the 'tx_buffer_size' > 0, this function will return after copying all the data to tx ring buffer, - * UART ISR will then move data from the ring buffer to TX FIFO gradually. - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param src data buffer address - * @param size data length to send - * - * @return - * - (-1) Parameter error - * - OTHERS (>=0) The number of bytes pushed to the TX FIFO - */ -int uart_write_bytes(uart_port_t uart_num, const char* src, size_t size); - -/** - * @brief Send data to the UART port from a given buffer and length, - * - * If the UART driver's parameter 'tx_buffer_size' is set to zero: - * This function will not return until all the data and the break signal have been sent out. - * After all data is sent out, send a break signal. - * - * Otherwise, if the 'tx_buffer_size' > 0, this function will return after copying all the data to tx ring buffer, - * UART ISR will then move data from the ring buffer to TX FIFO gradually. - * After all data sent out, send a break signal. - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param src data buffer address - * @param size data length to send - * @param brk_len break signal duration(unit: the time it takes to send one bit at current baudrate) - * - * @return - * - (-1) Parameter error - * - OTHERS (>=0) The number of bytes pushed to the TX FIFO - */ -int uart_write_bytes_with_break(uart_port_t uart_num, const char* src, size_t size, int brk_len); - -/** - * @brief UART read bytes from UART buffer - * - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * @param buf pointer to the buffer. - * @param length data length - * @param ticks_to_wait sTimeout, count in RTOS ticks - * - * @return - * - (-1) Error - * - OTHERS (>=0) The number of bytes read from UART FIFO - */ -int uart_read_bytes(uart_port_t uart_num, uint8_t* buf, uint32_t length, TickType_t ticks_to_wait); - -/** - * @brief Alias of uart_flush_input. - * UART ring buffer flush. This will discard all data in the UART RX buffer. - * @note Instead of waiting the data sent out, this function will clear UART rx buffer. - * In order to send all the data in tx FIFO, we can use uart_wait_tx_done function. - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t uart_flush(uart_port_t uart_num); - -/** - * @brief Clear input buffer, discard all the data is in the ring-buffer. - * @note In order to send all the data in tx FIFO, we can use uart_wait_tx_done function. - * @param uart_num UART_NUM_0, UART_NUM_1 or UART_NUM_2 - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t uart_flush_input(uart_port_t uart_num); - -/** - * @brief UART get RX ring buffer cached data length - * - * @param uart_num UART port number. - * @param size Pointer of size_t to accept cached data length - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t uart_get_buffered_data_len(uart_port_t uart_num, size_t* size); - -/** - * @brief UART disable pattern detect function. - * Designed for applications like 'AT commands'. - * When the hardware detects a series of one same character, the interrupt will be triggered. - * - * @param uart_num UART port number. - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t uart_disable_pattern_det_intr(uart_port_t uart_num); - -/** - * @brief UART enable pattern detect function. - * Designed for applications like 'AT commands'. - * When the hardware detect a series of one same character, the interrupt will be triggered. - * - * @param uart_num UART port number. - * @param pattern_chr character of the pattern - * @param chr_num number of the character, 8bit value. - * @param chr_tout timeout of the interval between each pattern characters, 24bit value, unit is APB (80Mhz) clock cycle. - * When the duration is less than this value, it will not take this data as at_cmd char - * @param post_idle idle time after the last pattern character, 24bit value, unit is APB (80Mhz) clock cycle. - * When the duration is less than this value, it will not take the previous data as the last at_cmd char - * @param pre_idle idle time before the first pattern character, 24bit value, unit is APB (80Mhz) clock cycle. - * When the duration is less than this value, it will not take this data as the first at_cmd char - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t uart_enable_pattern_det_intr(uart_port_t uart_num, char pattern_chr, uint8_t chr_num, int chr_tout, int post_idle, int pre_idle); - -/** - * @brief Return the nearest detected pattern position in buffer. - * The positions of the detected pattern are saved in a queue, - * this function will dequeue the first pattern position and move the pointer to next pattern position. - * @note If the RX buffer is full and flow control is not enabled, - * the detected pattern may not be found in the rx buffer due to overflow. - * - * The following APIs will modify the pattern position info: - * uart_flush_input, uart_read_bytes, uart_driver_delete, uart_pop_pattern_pos - * It is the application's responsibility to ensure atomic access to the pattern queue and the rx data buffer - * when using pattern detect feature. - * - * @param uart_num UART port number - * @return - * - (-1) No pattern found for current index or parameter error - * - others the pattern position in rx buffer. - */ -int uart_pattern_pop_pos(uart_port_t uart_num); - -/** - * @brief Return the nearest detected pattern position in buffer. - * The positions of the detected pattern are saved in a queue, - * This function do nothing to the queue. - * @note If the RX buffer is full and flow control is not enabled, - * the detected pattern may not be found in the rx buffer due to overflow. - * - * The following APIs will modify the pattern position info: - * uart_flush_input, uart_read_bytes, uart_driver_delete, uart_pop_pattern_pos - * It is the application's responsibility to ensure atomic access to the pattern queue and the rx data buffer - * when using pattern detect feature. - * - * @param uart_num UART port number - * @return - * - (-1) No pattern found for current index or parameter error - * - others the pattern position in rx buffer. - */ -int uart_pattern_get_pos(uart_port_t uart_num); - -/** - * @brief Allocate a new memory with the given length to save record the detected pattern position in rx buffer. - * @param uart_num UART port number - * @param queue_length Max queue length for the detected pattern. - * If the queue length is not large enough, some pattern positions might be lost. - * Set this value to the maximum number of patterns that could be saved in data buffer at the same time. - * @return - * - ESP_ERR_NO_MEM No enough memory - * - ESP_ERR_INVALID_STATE Driver not installed - * - ESP_FAIL Parameter error - * - ESP_OK Success - */ -esp_err_t uart_pattern_queue_reset(uart_port_t uart_num, int queue_length); - -/** - * @brief UART set communication mode - * @note This function must be executed after uart_driver_install(), when the driver object is initialized. - * @param uart_num Uart number to configure - * @param mode UART UART mode to set - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t uart_set_mode(uart_port_t uart_num, uart_mode_t mode); - -/** - * @brief UART set threshold timeout for TOUT feature - * - * @param uart_num Uart number to configure - * @param tout_thresh This parameter defines timeout threshold in uart symbol periods. The maximum value of threshold is 126. - * tout_thresh = 1, defines TOUT interrupt timeout equal to transmission time of one symbol (~11 bit) on current baudrate. - * If the time is expired the UART_RXFIFO_TOUT_INT interrupt is triggered. If tout_thresh == 0, - * the TOUT feature is disabled. - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_ERR_INVALID_STATE Driver is not installed - */ -esp_err_t uart_set_rx_timeout(uart_port_t uart_num, const uint8_t tout_thresh); - -/** - * @brief Returns collision detection flag for RS485 mode - * Function returns the collision detection flag into variable pointed by collision_flag. - * *collision_flag = true, if collision detected else it is equal to false. - * This function should be executed when actual transmission is completed (after uart_write_bytes()). - * - * @param uart_num Uart number to configure - * @param collision_flag Pointer to variable of type bool to return collision flag. - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t uart_get_collision_flag(uart_port_t uart_num, bool* collision_flag); - -/** - * @brief Set the number of RX pin signal edges for light sleep wakeup - * - * UART can be used to wake up the system from light sleep. This feature works - * by counting the number of positive edges on RX pin and comparing the count to - * the threshold. When the count exceeds the threshold, system is woken up from - * light sleep. This function allows setting the threshold value. - * - * Stop bit and parity bits (if enabled) also contribute to the number of edges. - * For example, letter 'a' with ASCII code 97 is encoded as 010001101 on the wire - * (with 8n1 configuration), start and stop bits included. This sequence has 3 - * positive edges (transitions from 0 to 1). Therefore, to wake up the system - * when 'a' is sent, set wakeup_threshold=3. - * - * The character that triggers wakeup is not received by UART (i.e. it can not - * be obtained from UART FIFO). Depending on the baud rate, a few characters - * after that will also not be received. Note that when the chip enters and exits - * light sleep mode, APB frequency will be changing. To make sure that UART has - * correct baud rate all the time, select REF_TICK as UART clock source, - * by setting use_ref_tick field in uart_config_t to true. - * - * @note in ESP32, UART2 does not support light sleep wakeup feature. - * - * @param uart_num UART number - * @param wakeup_threshold number of RX edges for light sleep wakeup, value is 3 .. 0x3ff. - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_ARG if uart_num is incorrect or wakeup_threshold is - * outside of [3, 0x3ff] range. - */ -esp_err_t uart_set_wakeup_threshold(uart_port_t uart_num, int wakeup_threshold); - -/** - * @brief Get the number of RX pin signal edges for light sleep wakeup. - * - * See description of uart_set_wakeup_threshold for the explanation of UART - * wakeup feature. - * - * @param uart_num UART number - * @param[out] out_wakeup_threshold output, set to the current value of wakeup - * threshold for the given UART. - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_ARG if out_wakeup_threshold is NULL - */ -esp_err_t uart_get_wakeup_threshold(uart_port_t uart_num, int* out_wakeup_threshold); - -#ifdef __cplusplus -} -#endif - -#endif /*_DRIVER_UART_H_*/ diff --git a/tools/sdk/include/driver/driver/uart_select.h b/tools/sdk/include/driver/driver/uart_select.h deleted file mode 100644 index 24f06c1de61..00000000000 --- a/tools/sdk/include/driver/driver/uart_select.h +++ /dev/null @@ -1,49 +0,0 @@ - -// 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. - -#ifndef _UART_SELECT_H_ -#define _UART_SELECT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "driver/uart.h" - -typedef enum { - UART_SELECT_READ_NOTIF, - UART_SELECT_WRITE_NOTIF, - UART_SELECT_ERROR_NOTIF, -} uart_select_notif_t; - -typedef void (*uart_select_notif_callback_t)(uart_port_t uart_num, uart_select_notif_t uart_select_notif, BaseType_t *task_woken); - -/** - * @brief Set notification callback function for select() events - * @param uart_num UART port number - * @param uart_select_notif_callback callback function - */ -void uart_set_select_notif_callback(uart_port_t uart_num, uart_select_notif_callback_t uart_select_notif_callback); - -/** - * @brief Get mutex guarding select() notifications - */ -portMUX_TYPE *uart_get_selectlock(); - -#ifdef __cplusplus -} -#endif - -#endif //_UART_SELECT_H_ diff --git a/tools/sdk/include/esp-face/dl_lib_matrix3d.h b/tools/sdk/include/esp-face/dl_lib_matrix3d.h deleted file mode 100644 index 4de26b4209a..00000000000 --- a/tools/sdk/include/esp-face/dl_lib_matrix3d.h +++ /dev/null @@ -1,525 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include - -typedef float fptp_t; -typedef uint8_t uc_t; - -typedef enum -{ - DL_SUCCESS = 0, - DL_FAIL = 1, -} dl_error_type; - -typedef enum -{ - PADDING_VALID = 0, - PADDING_SAME = 1, -} dl_padding_type; - -/* - * Matrix for 3d - * @Warning: the sequence of variables is fixed, cannot be modified, otherwise there will be errors in esp_dsp_dot_float - */ -typedef struct -{ - int w; /*!< Width */ - int h; /*!< Height */ - int c; /*!< Channel */ - int n; /*!< Number of filter, input and output must be 1 */ - int stride; /*!< Step between lines */ - fptp_t *item; /*!< Data */ -} dl_matrix3d_t; - -typedef struct -{ - int w; /*!< Width */ - int h; /*!< Height */ - int c; /*!< Channel */ - int n; /*!< Number of filter, input and output must be 1 */ - int stride; /*!< Step between lines */ - uc_t *item; /*!< Data */ -} dl_matrix3du_t; - -typedef struct -{ - int stride_x; - int stride_y; - dl_padding_type padding; -} dl_matrix3d_mobilenet_config_t; - -/* - * @brief Allocate a 3D matrix with float items, the access sequence is NHWC - * - * @param n Number of matrix3d, for filters it is out channels, for others it is 1 - * @param w Width of matrix3d - * @param h Height of matrix3d - * @param c Channel of matrix3d - * @return 3d matrix - */ -dl_matrix3d_t *dl_matrix3d_alloc(int n, int w, int h, int c); - -/* - * @brief Allocate a 3D matrix with 8-bits items, the access sequence is NHWC - * - * @param n Number of matrix3d, for filters it is out channels, for others it is 1 - * @param w Width of matrix3d - * @param h Height of matrix3d - * @param c Channel of matrix3d - * @return 3d matrix - */ -dl_matrix3du_t *dl_matrix3du_alloc(int n, int w, int h, int c); - -/* - * @brief Free a matrix3d - * - * @param m matrix3d with float items - */ -void dl_matrix3d_free(dl_matrix3d_t *m); - -/* - * @brief Free a matrix3d - * - * @param m matrix3d with 8-bits items - */ -void dl_matrix3du_free(dl_matrix3du_t *m); - -/* - * @brief Dot product with a vector and matrix - * - * @param out Space to put the result - * @param in input vector - * @param f filter matrix - */ -void dl_matrix3dff_dot_product(dl_matrix3d_t *out, dl_matrix3d_t *in, dl_matrix3d_t *f); - -/** - * @brief Do a softmax operation on a matrix3d - * - * @param in Input matrix3d - */ -void dl_matrix3d_softmax(dl_matrix3d_t *m); - -/** - * @brief Copy a range of float items from an existing matrix to a preallocated matrix - * - * @param dst The destination slice matrix - * @param src The source matrix to slice - * @param x X-offset of the origin of the returned matrix within the sliced matrix - * @param y Y-offset of the origin of the returned matrix within the sliced matrix - * @param w Width of the resulting matrix - * @param h Height of the resulting matrix - */ -void dl_matrix3d_slice_copy(dl_matrix3d_t *dst, - dl_matrix3d_t *src, - int x, - int y, - int w, - int h); - -/** - * @brief Copy a range of 8-bits items from an existing matrix to a preallocated matrix - * - * @param dst The destination slice matrix - * @param src The source matrix to slice - * @param x X-offset of the origin of the returned matrix within the sliced matrix - * @param y Y-offset of the origin of the returned matrix within the sliced matrix - * @param w Width of the resulting matrix - * @param h Height of the resulting matrix - */ -void dl_matrix3du_slice_copy(dl_matrix3du_t *dst, - dl_matrix3du_t *src, - int x, - int y, - int w, - int h); - -/** - * @brief Do a general CNN layer pass, dimension is (number, width, height, channel) - * - * @param in Input matrix3d - * @param filter Weights of the neurons - * @param bias Bias for the CNN layer - * @param stride_x The step length of the convolution window in x(width) direction - * @param stride_y The step length of the convolution window in y(height) direction - * @param padding One of VALID or SAME - * @param mode Do convolution using C implement or xtensa implement, 0 or 1, with respect - * If ESP_PLATFORM is not defined, this value is not used. Default is 0 - * @return The result of CNN layer - */ -dl_matrix3d_t *dl_matrix3d_conv(dl_matrix3d_t *in, - dl_matrix3d_t *filter, - dl_matrix3d_t *bias, - int stride_x, - int stride_y, - int padding, - int mode); - -/** - * @brief Do a general CNN layer pass, dimension is (number, width, height, channel) - * - * @param in Input matrix3d - * @param filter Weights of the neurons - * @param bias Bias for the CNN layer - * @param stride_x The step length of the convolution window in x(width) direction - * @param stride_y The step length of the convolution window in y(height) direction - * @param padding One of VALID or SAME - * @param mode Do convolution using C implement or xtensa implement, 0 or 1, with respect - * If ESP_PLATFORM is not defined, this value is not used. Default is 0 - * @return The result of CNN layer - */ - -/** - * @brief Do a global average pooling layer pass, dimension is (number, width, height, channel) - * - * @param in Input matrix3d - * - * @return The result of global average pooling layer - */ -dl_matrix3d_t *dl_matrix3d_global_pool(dl_matrix3d_t *in); - -/** - * @brief Do a batch normalization operation, update the input matrix3d: input = input * scale + offset - * - * @param m Input matrix3d - * @param scale scale matrix3d, scale = gamma/((moving_variance+sigma)^(1/2)) - * @param Offset Offset matrix3d, offset = beta-(moving_mean*gamma/((moving_variance+sigma)^(1/2))) - */ -void dl_matrix3d_batch_normalize(dl_matrix3d_t *m, - dl_matrix3d_t *scale, - dl_matrix3d_t *offset); - -/** - * @brief Add a pair of matrix3d item-by-item: res=in_1+in_2 - * - * @param in_1 First Floating point input matrix3d - * @param in_2 Second Floating point input matrix3d - * - * @return Added data - */ -dl_matrix3d_t *dl_matrix3d_add(dl_matrix3d_t *in_1, dl_matrix3d_t *in_2); - -/** - * @brief Concatenate the channels of two matrix3ds into a new matrix3d - * - * @param in_1 First Floating point input matrix3d - * @param in_2 Second Floating point input matrix3d - * - * @return A newly allocated matrix3d with as avlues in_1|in_2 - */ -dl_matrix3d_t *dl_matrix3d_concat(dl_matrix3d_t *in_1, dl_matrix3d_t *in_2); - -/** - * @brief Concatenate the channels of four matrix3ds into a new matrix3d - * - * @param in_1 First Floating point input matrix3d - * @param in_2 Second Floating point input matrix3d - * @param in_3 Third Floating point input matrix3d - * @param in_4 Fourth Floating point input matrix3d - * - * @return A newly allocated matrix3d with as avlues in_1|in_2|in_3|in_4 - */ -dl_matrix3d_t *dl_matrix3d_concat_4(dl_matrix3d_t *in_1, - dl_matrix3d_t *in_2, - dl_matrix3d_t *in_3, - dl_matrix3d_t *in_4); - -/** - * @brief Concatenate the channels of eight matrix3ds into a new matrix3d - * - * @param in_1 First Floating point input matrix3d - * @param in_2 Second Floating point input matrix3d - * @param in_3 Third Floating point input matrix3d - * @param in_4 Fourth Floating point input matrix3d - * @param in_5 Fifth Floating point input matrix3d - * @param in_6 Sixth Floating point input matrix3d - * @param in_7 Seventh Floating point input matrix3d - * @param in_8 eighth Floating point input matrix3d - * - * @return A newly allocated matrix3d with as avlues in_1|in_2|in_3|in_4|in_5|in_6|in_7|in_8 - */ -dl_matrix3d_t *dl_matrix3d_concat_8(dl_matrix3d_t *in_1, - dl_matrix3d_t *in_2, - dl_matrix3d_t *in_3, - dl_matrix3d_t *in_4, - dl_matrix3d_t *in_5, - dl_matrix3d_t *in_6, - dl_matrix3d_t *in_7, - dl_matrix3d_t *in_8); - -/** - * @brief Do a mobilefacenet block forward, dimension is (number, width, height, channel) - * - * @param in Input matrix3d - * @param pw Weights of the pointwise conv layer - * @param pw_bn_scale The scale params of the batch_normalize layer after the pointwise conv layer - * @param pw_bn_offset The offset params of the batch_normalize layer after the pointwise conv layer - * @param dw Weights of the depthwise conv layer - * @param dw_bn_scale The scale params of the batch_normalize layer after the depthwise conv layer - * @param dw_bn_offset The offset params of the batch_normalize layer after the depthwise conv layer - * @param pw_linear Weights of the pointwise linear conv layer - * @param pw_linear_bn_scale The scale params of the batch_normalize layer after the pointwise linear conv layer - * @param pw_linear_bn_offset The offset params of the batch_normalize layer after the pointwise linear conv layer - * @param stride_x The step length of the convolution window in x(width) direction - * @param stride_y The step length of the convolution window in y(height) direction - * @param padding One of VALID or SAME - * @param mode Do convolution using C implement or xtensa implement, 0 or 1, with respect - * If ESP_PLATFORM is not defined, this value is not used. Default is 0 - * @return The result of a mobilefacenet block - */ -dl_matrix3d_t *dl_matrix3d_mobilefaceblock(dl_matrix3d_t *in, - dl_matrix3d_t *pw, - dl_matrix3d_t *pw_bn_scale, - dl_matrix3d_t *pw_bn_offset, - dl_matrix3d_t *dw, - dl_matrix3d_t *dw_bn_scale, - dl_matrix3d_t *dw_bn_offset, - dl_matrix3d_t *pw_linear, - dl_matrix3d_t *pw_linear_bn_scale, - dl_matrix3d_t *pw_linear_bn_offset, - int stride_x, - int stride_y, - int padding, - int mode, - int shortcut); - -/** - * @brief Do a mobilefacenet block forward with 1x1 split conv, dimension is (number, width, height, channel) - * - * @param in Input matrix3d - * @param pw_1 Weights of the pointwise conv layer 1 - * @param pw_2 Weights of the pointwise conv layer 2 - * @param pw_bn_scale The scale params of the batch_normalize layer after the pointwise conv layer - * @param pw_bn_offset The offset params of the batch_normalize layer after the pointwise conv layer - * @param dw Weights of the depthwise conv layer - * @param dw_bn_scale The scale params of the batch_normalize layer after the depthwise conv layer - * @param dw_bn_offset The offset params of the batch_normalize layer after the depthwise conv layer - * @param pw_linear_1 Weights of the pointwise linear conv layer 1 - * @param pw_linear_2 Weights of the pointwise linear conv layer 2 - * @param pw_linear_bn_scale The scale params of the batch_normalize layer after the pointwise linear conv layer - * @param pw_linear_bn_offset The offset params of the batch_normalize layer after the pointwise linear conv layer - * @param stride_x The step length of the convolution window in x(width) direction - * @param stride_y The step length of the convolution window in y(height) direction - * @param padding One of VALID or SAME - * @param mode Do convolution using C implement or xtensa implement, 0 or 1, with respect - * If ESP_PLATFORM is not defined, this value is not used. Default is 0 - * @return The result of a mobilefacenet block - */ -dl_matrix3d_t *dl_matrix3d_mobilefaceblock_split(dl_matrix3d_t *in, - dl_matrix3d_t *pw_1, - dl_matrix3d_t *pw_2, - dl_matrix3d_t *pw_bn_scale, - dl_matrix3d_t *pw_bn_offset, - dl_matrix3d_t *dw, - dl_matrix3d_t *dw_bn_scale, - dl_matrix3d_t *dw_bn_offset, - dl_matrix3d_t *pw_linear_1, - dl_matrix3d_t *pw_linear_2, - dl_matrix3d_t *pw_linear_bn_scale, - dl_matrix3d_t *pw_linear_bn_offset, - int stride_x, - int stride_y, - int padding, - int mode, - int shortcut); - -void dl_matrix3d_init_bias(dl_matrix3d_t *out, dl_matrix3d_t *bias); - -void dl_matrix3d_multiply(dl_matrix3d_t *out, dl_matrix3d_t *in1, dl_matrix3d_t *in2); - -// -// Activation -// - -/** - * @brief Do a standard relu operation, update the input matrix3d - * - * @param m Floating point input matrix3d - */ -void dl_matrix3d_relu(dl_matrix3d_t *m); - -/** - * @brief Do a relu (Rectifier Linear Unit) operation, update the input matrix3d - * - * @param in Floating point input matrix3d - * @param clip If value is higher than this, it will be clipped to this value - */ -void dl_matrix3d_relu_clip(dl_matrix3d_t *m, fptp_t clip); - -/** - * @brief Do a Prelu (Rectifier Linear Unit) operation, update the input matrix3d - * - * @param in Floating point input matrix3d - * @param alpha If value is less than zero, it will be updated by multiplying this factor - */ -void dl_matrix3d_p_relu(dl_matrix3d_t *in, dl_matrix3d_t *alpha); - -/** - * @brief Do a leaky relu (Rectifier Linear Unit) operation, update the input matrix3d - * - * @param in Floating point input matrix3d - * @param alpha If value is less than zero, it will be updated by multiplying this factor - */ -void dl_matrix3d_leaky_relu(dl_matrix3d_t *m, fptp_t alpha); - -// -// Conv 1x1 -// -void dl_matrix3dff_conv_1x1(dl_matrix3d_t *out, - dl_matrix3d_t *in, - dl_matrix3d_t *filter); - -void dl_matrix3dff_conv_1x1_with_bias(dl_matrix3d_t *out, - dl_matrix3d_t *in, - dl_matrix3d_t *filter, - dl_matrix3d_t *bias); - -void dl_matrix3duf_conv_1x1(dl_matrix3d_t *out, - dl_matrix3du_t *in, - dl_matrix3d_t *filter); - -void dl_matrix3duf_conv_1x1_with_bias(dl_matrix3d_t *out, - dl_matrix3du_t *in, - dl_matrix3d_t *filter, - dl_matrix3d_t *bias); - -// -// Conv 3x3 -// -void dl_matrix3dff_conv_3x3_op(dl_matrix3d_t *out, - dl_matrix3d_t *in, - dl_matrix3d_t *f, - int step_x, - int step_y); - -dl_matrix3d_t *dl_matrix3dff_conv_3x3(dl_matrix3d_t *in, - dl_matrix3d_t *filter, - dl_matrix3d_t *bias, - int stride_x, - int stride_y, - dl_padding_type padding); - -// -// Conv Common -// - -dl_matrix3d_t *dl_matrix3duf_conv_common(dl_matrix3du_t *in, - dl_matrix3d_t *filter, - dl_matrix3d_t *bias, - int stride_x, - int stride_y, - dl_padding_type padding); - -// -// Depthwise 3x3 -// - -dl_matrix3d_t *dl_matrix3dff_depthwise_conv_3x3(dl_matrix3d_t *in, - dl_matrix3d_t *filter, - int stride_x, - int stride_y, - int padding); - -dl_matrix3d_t *dl_matrix3duf_depthwise_conv_3x3(dl_matrix3du_t *in, - dl_matrix3d_t *filter, - int stride_x, - int stride_y, - int padding); - -void dl_matrix3dff_depthwise_conv_3x3_op(dl_matrix3d_t *out, - dl_matrix3d_t *in, - dl_matrix3d_t *f, - int step_x, - int step_y); - -// -// Depthwise Common -// - -/** - * @brief Do a depthwise CNN layer pass, dimension is (number, width, height, channel) - * - * @param in Input matrix3d - * @param filter Weights of the neurons - * @param stride_x The step length of the convolution window in x(width) direction - * @param stride_y The step length of the convolution window in y(height) direction - * @param padding One of VALID or SAME - * @param mode Do convolution using C implement or xtensa implement, 0 or 1, with respect - * If ESP_PLATFORM is not defined, this value is not used. Default is 0 - * @return The result of depthwise CNN layer - */ -dl_matrix3d_t *dl_matrix3dff_depthwise_conv_common(dl_matrix3d_t *in, - dl_matrix3d_t *filter, - int stride_x, - int stride_y, - dl_padding_type padding); - -// -// FC -// -/** - * @brief Do a general fully connected layer pass, dimension is (number, width, height, channel) - * - * @param in Input matrix3d, size is (1, w, 1, 1) - * @param filter Weights of the neurons, size is (1, w, h, 1) - * @param bias Bias for the fc layer, size is (1, 1, 1, h) - * @return The result of fc layer, size is (1, 1, 1, h) - */ -void dl_matrix3dff_fc(dl_matrix3d_t *out, - dl_matrix3d_t *in, - dl_matrix3d_t *filter); - -void dl_matrix3dff_fc_with_bias(dl_matrix3d_t *out, - dl_matrix3d_t *in, - dl_matrix3d_t *filter, - dl_matrix3d_t *bias); - -// -// Mobilenet -// - -/** - * @brief Do a mobilenet block forward, dimension is (number, width, height, channel) - * - * @param in Input matrix3d - * @param filter Weights of the neurons - * @param stride_x The step length of the convolution window in x(width) direction - * @param stride_y The step length of the convolution window in y(height) direction - * @param padding One of VALID or SAME - * @param mode Do convolution using C implement or xtensa implement, 0 or 1, with respect - * If ESP_PLATFORM is not defined, this value is not used. Default is 0 - * @return The result of depthwise CNN layer - */ -dl_matrix3d_t *dl_matrix3dff_mobilenet(dl_matrix3d_t *in, - dl_matrix3d_t *dilate_filter, - dl_matrix3d_t *dilate_prelu, - dl_matrix3d_t *depthwise_filter, - dl_matrix3d_t *depthwise_prelu, - dl_matrix3d_t *compress_filter, - dl_matrix3d_t *bias, - dl_matrix3d_mobilenet_config_t config); - -/** - * @brief Do a mobilenet block forward, dimension is (number, width, height, channel) - * - * @param in Input matrix3du - * @param filter Weights of the neurons - * @param stride_x The step length of the convolution window in x(width) direction - * @param stride_y The step length of the convolution window in y(height) direction - * @param padding One of VALID or SAME - * @param mode Do convolution using C implement or xtensa implement, 0 or 1, with respect - * If ESP_PLATFORM is not defined, this value is not used. Default is 0 - * @return The result of depthwise CNN layer - */ -dl_matrix3d_t *dl_matrix3duf_mobilenet(dl_matrix3du_t *in, - dl_matrix3d_t *dilate_filter, - dl_matrix3d_t *dilate_prelu, - dl_matrix3d_t *depthwise_filter, - dl_matrix3d_t *depthwise_prelu, - dl_matrix3d_t *compress_filter, - dl_matrix3d_t *bias, - dl_matrix3d_mobilenet_config_t config); diff --git a/tools/sdk/include/esp-face/dl_lib_matrix3dq.h b/tools/sdk/include/esp-face/dl_lib_matrix3dq.h deleted file mode 100644 index 57e5e92c22e..00000000000 --- a/tools/sdk/include/esp-face/dl_lib_matrix3dq.h +++ /dev/null @@ -1,779 +0,0 @@ -#pragma once -#include "dl_lib_matrix3d.h" - -typedef int16_t qtp_t; - -/** - * Matrix for input, filter, and output - * @Warning: the sequence of variables is fixed, cannot be modified, otherwise there will be errors in - * some handwrite xtensa instruction functions - */ -typedef struct -{ - /******* fix start *******/ - int w; /*!< Width */ - int h; /*!< Height */ - int c; /*!< Channel */ - int n; /*!< Number of filter, input and output must be 1 */ - int stride; /*!< Step between lines */ - int exponent; /*!< Exponent for quantization */ - qtp_t *item; /*!< Data */ - /******* fix end *******/ -} dl_matrix3dq_t; - -#ifndef DL_QTP_SHIFT -#define DL_QTP_SHIFT 15 -#define DL_ITMQ(m, x, y) m->itemq[(y) + (x)*m->stride] -#define DL_QTP_RANGE ((1 << DL_QTP_SHIFT) - 1) -#define DL_QTP_MAX 32767 -#define DL_QTP_MIN -32768 - -#define DL_QTP_EXP_NA 255 //non-applicable exponent because matrix is null - -#define DL_SHIFT_AUTO 32 -#endif - -/** - * Implementation of matrix relative operations - */ -typedef enum -{ - DL_C_IMPL = 0, /*!< ANSI C */ - DL_XTENSA_IMPL = 1 /*!< Handwrite xtensa instruction */ -} dl_conv_mode; - - -/** - * Configuration of mobilenet operation - */ -typedef struct -{ - int stride_x; /*!< Strides of width */ - int stride_y; /*!< Strides of height */ - dl_padding_type padding; /*!< Padding type */ - dl_conv_mode mode; /*!< Implementation mode */ - int dilate_exponent; /*!< Exponent of dilation filter */ - int depthwise_exponent; /*!< Exponent of depthwise filter */ - int compress_exponent; /*!< Exponent of compress filter */ -} dl_matrix3dq_mobilenet_config_t; - -// -// Utility -// - -/* - * @brief Allocate a 3d quantised matrix - * - * @param n Number of filters, for input and output, should be 1 - * @param w Width of matrix - * @param h Height of matrix - * @param c Channel of matrix - * @param e Exponent of matrix data - * @return 3d quantized matrix - */ -dl_matrix3dq_t *dl_matrix3dq_alloc(int n, int w, int h, int c, int e); - -/* - * @brief Free a 3d quantized matrix - * - * @param m 3d quantised matrix - */ -void dl_matrix3dq_free(dl_matrix3dq_t *m); - -/** - * @brief Copy a range of items from an existing matrix to a preallocated matrix - * - * @param dst The resulting slice matrix - * @param src Old matrix to slice. - * @param x X-offset of the origin of the returned matrix within the sliced matrix - * @param y Y-offset of the origin of the returned matrix within the sliced matrix - * @param w Width of the resulting matrix - * @param h Height of the resulting matrix - */ -void dl_matrix3dq_slice_copy(dl_matrix3dq_t *dst, dl_matrix3dq_t *src, int x, int y, int w, int h); - -/** - * @brief Transform a fixed point matrix to a float point matrix - * - * @param m Quantized matrix - * @return Float point matrix - */ -dl_matrix3d_t *dl_matrix3d_from_matrixq(dl_matrix3dq_t *m); - -/** - * @brief Transform a float point matrix to a fixed point matrix with pre-defined exponent - * - * @param m Float point matrix - * @param exponent Exponent for resulting matrix - * @return Fixed point matrix - */ -dl_matrix3dq_t *dl_matrixq_from_matrix3d_qmf(dl_matrix3d_t *m, int exponent); - -/** - * @brief Transform a float point matrix to a fixed point matrix. The exponent is defined by the distribution of the input matrix. - * - * @param m Float point matrix - * @return Fixed point matrix - */ -dl_matrix3dq_t *dl_matrixq_from_matrix3d(dl_matrix3d_t *m); - -qtp_t dl_matrix3dq_quant_range_exceeded_checking(int64_t value, char *location); - -/** - * @brief Reform a quantized matrix with exponent - * - * @param out Preallocated resulting matrix - * @param in Input matrix - * @param exponent Exponent for resulting matrix - */ -void dl_matrix3dq_shift_exponent(dl_matrix3dq_t *out, dl_matrix3dq_t *in, int exponent); - -/** - * @brief Do batch normalization for a quantized matrix - * - * @param m Input and output quantized matrix, data will be updated - * @param scale Scale of batch-norm - * @param offset Offset of batch-norm - */ -void dl_matrix3dq_batch_normalize(dl_matrix3dq_t *m, dl_matrix3dq_t *scale, dl_matrix3dq_t *offset); - -/** - * @brief Add two quantized matrix with a pre-defined exponent - * - * @param in_1 Adder 1 - * @param in_2 Adder 2 - * @param exponent Exponent for resulting matrix - * @return Result of accumulation of two matrix - */ -dl_matrix3dq_t *dl_matrix3dq_add(dl_matrix3dq_t *in_1, dl_matrix3dq_t *in_2, int exponent); - -// -// Activation -// -/** - * @brief Do relu for a quantized matrix - * - * @param in Input and output quantized matrix, data will be updated - */ -void dl_matrix3dq_relu(dl_matrix3dq_t *in); - -/** - * @brief Do relu with clips for a quantized matrix - * - * @param in Input and output quantized matrix, data will be updated - * @param clip Float point value to limit the maximum data - */ -void dl_matrix3dq_relu_clip(dl_matrix3dq_t *in, fptp_t clip); - -/** - * @brief Do leaky relu for a quantized matrix - * - * @param in Input and output quantized matrix, data will be updated - * @param alpha Float point value to multiply for those less than zero - * @param clip Float point value to limit the maximum data - */ -void dl_matrix3dq_leaky_relu(dl_matrix3dq_t *in, fptp_t alpha, fptp_t clip); - -/** - * @brief Do prelu for a quantized matrix - * - * @param in Input and output quantized matrix, data will be updated - * @param alpha Quantized matrix to multiply for those less than zero - */ -void dl_matrix3dq_p_relu(dl_matrix3dq_t *in, dl_matrix3dq_t *alpha); - -// -// Concat -// -/** - * @brief Concatenate two quantized matrix in channel - * - * @param in_1 Quantized matrix to be concatenated - * @param in_2 Quantized matrix to be concatenated - * @return Quantized matrix with the same width and height of in_1 and in_2, and with the sum of channel number of in_1 and in_2 - */ -dl_matrix3dq_t *dl_matrix3dq_concat(dl_matrix3dq_t *in_1, - dl_matrix3dq_t *in_2); - -/** - * @brief Concatenate four quantized matrix in channel - * - * @param in_1 Quantized matrix to be concatenated - * @param in_2 Quantized matrix to be concatenated - * @param in_3 Quantized matrix to be concatenated - * @param in_4 Quantized matrix to be concatenated - * @return Quantized matrix with the same width and height of all inputs, and with the sum of channel number of all inputs - */ -dl_matrix3dq_t *dl_matrix3dq_concat_4(dl_matrix3dq_t *in_1, - dl_matrix3dq_t *in_2, - dl_matrix3dq_t *in_3, - dl_matrix3dq_t *in_4); - -/** - * @brief Concatenate four quantized matrix in channel - * - * @param in_1 Quantized matrix to be concatenated - * @param in_2 Quantized matrix to be concatenated - * @param in_3 Quantized matrix to be concatenated - * @param in_4 Quantized matrix to be concatenated - * @param in_5 Quantized matrix to be concatenated - * @param in_6 Quantized matrix to be concatenated - * @param in_7 Quantized matrix to be concatenated - * @param in_8 Quantized matrix to be concatenated - * @return Quantized matrix with the same width and height of all inputs, and with the sum of channel number of all inputs - */ -dl_matrix3dq_t *dl_matrix3dq_concat_8(dl_matrix3dq_t *in_1, - dl_matrix3dq_t *in_2, - dl_matrix3dq_t *in_3, - dl_matrix3dq_t *in_4, - dl_matrix3dq_t *in_5, - dl_matrix3dq_t *in_6, - dl_matrix3dq_t *in_7, - dl_matrix3dq_t *in_8); - -// -// Conv 1x1 -// -/** - * @brief Do 1x1 convolution with a quantized matrix - * - * @param out Preallocated quantized matrix, size (1, w, h, n) - * @param in Input matrix, size (1, w, h, c) - * @param filter 1x1 filter, size (n, 1, 1, c) - * @param mode Implementation mode - */ -void dl_matrix3dqq_conv_1x1(dl_matrix3dq_t *out, - dl_matrix3dq_t *in, - dl_matrix3dq_t *filter, - dl_conv_mode mode); - -/** - * @brief Do 1x1 convolution with a quantized matrix, with relu activation - * - * @param out Preallocated quantized matrix, size (1, w, h, n) - * @param in Input matrix, size (1, w, h, c) - * @param filter 1x1 filter, size (n, 1, 1, c) - * @param mode Implementation mode - */ -void dl_matrix3dqq_conv_1x1_with_relu(dl_matrix3dq_t *out, - dl_matrix3dq_t *in, - dl_matrix3dq_t *filter, - dl_conv_mode mode); - -/** - * @brief Do 1x1 convolution with a quantized matrix, with bias adding - * - * @param out Preallocated quantized matrix, size (1, w, h, n) - * @param in Input matrix, size (1, w, h, c) - * @param filter 1x1 filter, size (n, 1, 1, c) - * @param bias Bias, size (1, 1, 1, n) - * @param mode Implementation mode - * @param name Layer name to debug - */ -void dl_matrix3dqq_conv_1x1_with_bias(dl_matrix3dq_t *out, - dl_matrix3dq_t *in, - dl_matrix3dq_t *filter, - dl_matrix3dq_t *bias, - dl_conv_mode mode, - char *name); - -/** - * @brief Do 1x1 convolution with a quantized matrix, with bias adding and relu activation - * - * @param out Preallocated quantized matrix, size (1, w, h, n) - * @param in Input matrix, size (1, w, h, c) - * @param filter 1x1 filter, size (n, 1, 1, c) - * @param bias Bias, size (1, 1, 1, n) - * @param mode Implementation mode - */ -void dl_matrix3dqq_conv_1x1_with_bias_relu(dl_matrix3dq_t *out, - dl_matrix3dq_t *in, - dl_matrix3dq_t *filter, - dl_matrix3dq_t *bias, - dl_conv_mode mode); - -void dl_matrix3dqq_conv_1x1_with_prelu(dl_matrix3dq_t *out, - dl_matrix3dq_t *in, - dl_matrix3dq_t *filter, - dl_matrix3dq_t *prelu, - dl_conv_mode mode); - -/** - * @brief Do 1x1 convolution with an 8-bit fixed point matrix - * - * @param out Preallocated quantized matrix, size (1, w, h, n) - * @param in Input matrix, size (1, w, h, c) - * @param filter 1x1 filter, size (n, 1, 1, c) - * @param mode Implementation mode - */ -void dl_matrix3duq_conv_1x1(dl_matrix3dq_t *out, - dl_matrix3du_t *in, - dl_matrix3dq_t *filter, - dl_conv_mode mode); - -/** - * @brief Do 1x1 convolution with an 8-bit fixed point matrix, with bias adding - * - * @param out Preallocated quantized matrix, size (1, w, h, n) - * @param in Input matrix, size (1, w, h, c) - * @param filter 1x1 filter, size (n, 1, 1, c) - * @param bias Bias, size (1, 1, 1, n) - * @param mode Implementation mode - */ -void dl_matrix3duq_conv_1x1_with_bias(dl_matrix3dq_t *out, - dl_matrix3du_t *in, - dl_matrix3dq_t *filter, - dl_matrix3dq_t *bias, - dl_conv_mode mode); - -// -// Conv 3x3 -// -/** - * @brief Do 3x3 convolution basic operation with a quantized matrix - * - * @param out Preallocated quantized matrix - * @param in Input matrix, size (1, w, h, c) - * @param filter 3x3 filter, size (n, 3, 3, c) - * @param stride_x Stride of width - * @param stride_y Stride of height - */ -void dl_matrix3dqq_conv_3x3_op(dl_matrix3dq_t *out, - dl_matrix3dq_t *in, - dl_matrix3dq_t *filter, - int stride_x, - int stride_y); - -/** - * @brief Do 3x3 convolution with a quantized matrix - * - * @param in Input matrix, size (1, w, h, c) - * @param filter 3x3 filter, size (n, 3, 3, c) - * @param stride_x Stride of width - * @param stride_y Stride of height - * @param padding Padding type, 0: valid, 1: same - * @param exponent Exponent for resulting matrix - * @return Resulting quantized matrix - */ -dl_matrix3dq_t *dl_matrix3dqq_conv_3x3(dl_matrix3dq_t *in, - dl_matrix3dq_t *filter, - int stride_x, - int stride_y, - dl_padding_type padding, - int exponent); - -/** - * @brief Do 3x3 convolution with a quantized matrix, with bias adding - * - * @param in Input matrix, size (1, w, h, c) - * @param filter 3x3 filter, size (n, 3, 3, c) - * @param bias Bias, size (1, 1, 1, n) - * @param stride_x Stride of width - * @param stride_y Stride of height - * @param padding Padding type, 0: valid, 1: same - * @param exponent Exponent for resulting matrix - * @return Resulting quantized matrix - */ -dl_matrix3dq_t *dl_matrix3dqq_conv_3x3_with_bias(dl_matrix3dq_t *in, - dl_matrix3dq_t *f, - dl_matrix3dq_t *bias, - int stride_x, - int stride_y, - dl_padding_type padding, - int exponent, - int relu); - -dl_matrix3dq_t *dl_matrix3duq_conv_3x3_with_bias(dl_matrix3du_t *in, - dl_matrix3dq_t *filter, - dl_matrix3dq_t *bias, - int stride_x, - int stride_y, - dl_padding_type padding, - int exponent, - char *name); - -dl_matrix3dq_t *dl_matrix3duq_conv_3x3_with_bias_prelu(dl_matrix3du_t *in, - dl_matrix3dq_t *filter, - dl_matrix3dq_t *bias, - dl_matrix3dq_t *prelu, - int stride_x, - int stride_y, - dl_padding_type padding, - int exponent, - char *name); - -// -// Conv common -// - -/** - * @brief Do a general convolution layer pass, size is (number, width, height, channel) - * - * @param in Input image - * @param filter Weights of the neurons - * @param bias Bias for the CNN layer. - * @param stride_x The step length of the convolution window in x(width) direction - * @param stride_y The step length of the convolution window in y(height) direction - * @param padding One of VALID or SAME - * @param mode Do convolution using C implement or xtensa implement, 0 or 1, with respect. - * If ESP_PLATFORM is not defined, this value is not used. - * @return The result of CNN layer. - */ -dl_matrix3dq_t *dl_matrix3dqq_conv_common(dl_matrix3dq_t *in, - dl_matrix3dq_t *filter, - dl_matrix3dq_t *bias, - int stride_x, - int stride_y, - dl_padding_type padding, - int exponent, - dl_conv_mode mode); - -/** - * @brief Do a general convolution layer pass for an 8-bit fixed point matrix, size is (number, width, height, channel) - * - * @param in Input image - * @param filter Weights of the neurons - * @param bias Bias for the CNN layer. - * @param stride_x The step length of the convolution window in x(width) direction - * @param stride_y The step length of the convolution window in y(height) direction - * @param padding One of VALID or SAME - * @param mode Do convolution using C implement or xtensa implement, 0 or 1, with respect. - * If ESP_PLATFORM is not defined, this value is not used. - * @return The result of CNN layer. - */ -dl_matrix3dq_t *dl_matrix3duq_conv_common(dl_matrix3du_t *in, - dl_matrix3dq_t *filter, - dl_matrix3dq_t *bias, - int stride_x, - int stride_y, - dl_padding_type padding, - int exponent, - dl_conv_mode mode); - -// -// Depthwise 3x3 -// -/** - * @brief Do 3x3 depthwise convolution with an 8-bit fixed point matrix - * - * @param in Input matrix, size (1, w, h, c) - * @param filter 3x3 filter, size (1, 3, 3, c) - * @param stride_x Stride of width - * @param stride_y Stride of height - * @param padding Padding type, 0: valid, 1: same - * @param exponent Exponent for resulting matrix - * @return Resulting quantized matrix - */ -dl_matrix3dq_t *dl_matrix3duq_depthwise_conv_3x3(dl_matrix3du_t *in, - dl_matrix3dq_t *filter, - int stride_x, - int stride_y, - dl_padding_type padding, - int exponent); - -/** - * @brief Do 3x3 depthwise convolution with a quantized matrix - * - * @param in Input matrix, size (1, w, h, c) - * @param filter 3x3 filter, size (1, 3, 3, c) - * @param stride_x Stride of width - * @param stride_y Stride of height - * @param padding Padding type, 0: valid, 1: same - * @param exponent Exponent for resulting matrix - * @return Resulting quantized matrix - */ -dl_matrix3dq_t *dl_matrix3dqq_depthwise_conv_3x3(dl_matrix3dq_t *in, - dl_matrix3dq_t *filter, - int stride_x, - int stride_y, - dl_padding_type padding, - int exponent); - -#if CONFIG_DEVELOPING_CODE -dl_matrix3dq_t *dl_matrix3dqq_depthwise_conv_3x3_2(dl_matrix3dq_t *in, - dl_matrix3dq_t *filter, - int stride_x, - int stride_y, - dl_padding_type padding, - int exponent); - -dl_matrix3dq_t *dl_matrix3dqq_depthwise_conv_3x3_3(dl_matrix3dq_t *in, - dl_matrix3dq_t *filter, - int stride_x, - int stride_y, - dl_padding_type padding, - int exponent); -#endif - -/** - * @brief Do 3x3 depthwise convolution with a quantized matrix, with bias adding - * - * @param in Input matrix, size (1, w, h, c) - * @param filter 3x3 filter, size (1, 3, 3, c) - * @param bias Bias, size (1, 1, 1, c) - * @param stride_x Stride of width - * @param stride_y Stride of height - * @param padding Padding type, 0: valid, 1: same - * @param exponent Exponent for resulting matrix - * @param relu Whether to use relu activation - * @return Resulting quantized matrix - */ -dl_matrix3dq_t *dl_matrix3dqq_depthwise_conv_3x3_with_bias(dl_matrix3dq_t *in, - dl_matrix3dq_t *f, - dl_matrix3dq_t *bias, - int stride_x, - int stride_y, - dl_padding_type padding, - int exponent, - int relu); - -/** - * @brief Do 3x3 depthwise convolution with a quantized matrix, with bias adding and stride 1 - * - * @param in Input matrix, size (1, w, h, c) - * @param filter 3x3 filter, size (1, 3, 3, c) - * @param bias Bias, size (1, 1, 1, n) - * @param padding Padding type, 0: valid, 1: same - * @param exponent Exponent for resulting matrix - * @param relu Whether to use relu activation - * @return Resulting quantized matrix - */ -dl_matrix3dq_t *dl_matrix3dqq_depthwise_conv_3x3s1_with_bias(dl_matrix3dq_t *in, - dl_matrix3dq_t *f, - dl_matrix3dq_t *bias, - dl_padding_type padding, - int exponent, - int relu); - -dl_matrix3dq_t *dl_matrix3dqq_depthwise_conv_3x3_with_prelu(dl_matrix3dq_t *in, - dl_matrix3dq_t *filter, - dl_matrix3dq_t *prelu, - int stride_x, - int stride_y, - dl_padding_type padding, - int exponent); - - -// -// Depthwise Common -// -#if CONFIG_DEVELOPING_CODE -dl_matrix3dq_t *dl_matrix3dqq_depthwise_conv_common(dl_matrix3dq_t *in, - dl_matrix3dq_t *filter, - int stride_x, - int stride_y, - dl_padding_type padding, - int exponent, - dl_conv_mode mode); - -dl_matrix3dq_t *dl_matrix3duq_depthwise_conv_common(dl_matrix3du_t *in, - dl_matrix3dq_t *filter, - int stride_x, - int stride_y, - dl_padding_type padding, - int exponent, - dl_conv_mode mode); -#endif - -// -// Dot Product -// - -void dl_matrix3dqq_dot_product(dl_matrix3dq_t *out, - dl_matrix3dq_t *in, - dl_matrix3dq_t *filter, - dl_conv_mode mode); - -// -// FC -// -/** - * @brief Do fully connected layer forward. - * - * @param out Preallocated resulting matrix, size (1, 1, 1, h) - * @param in Input matrix, size (1, 1, 1, w) - * @param filter Filter matrix, size (1, w, h, 1) - * @param mode Implementation mode - */ -void dl_matrix3dqq_fc(dl_matrix3dq_t *out, - dl_matrix3dq_t *in, - dl_matrix3dq_t *filter, - dl_conv_mode mode); - -/** - * @brief Do fully connected layer forward, with bias adding - * - * @param out Preallocated resulting matrix, size (1, 1, 1, h) - * @param in Input matrix, size (1, 1, 1, w) - * @param filter Filter matrix, size (1, w, h, 1) - * @param bias Bias matrix, size (1, 1, 1, h) - * @param mode Implementation mode - */ -void dl_matrix3dqq_fc_with_bias(dl_matrix3dq_t *out, - dl_matrix3dq_t *in, - dl_matrix3dq_t *filter, - dl_matrix3dq_t *bias, - dl_conv_mode mode, - char *name); - -// -// Mobilefaceblock -// -/** - * @brief Do mobilefacenet process with splited pointwise 1x1 convolution, the process sequence is 1x1 pointwise->bn->relu->3x3 depthwise->bn->relu->1x1 pointwise->bn - * - * @param in Input matrix, size (1, w, h, c) - * @param pw_1 Pointwise 1x1 filter, size (n1/2, 1, 1, c) - * @param pw_2 Pointwise 1x1 filter, size (n1/2, 1, 1, c) - * @param pw_bias Pointwise bias, size (1, 1, 1, n1) - * @param dw Depthwise 3x3 filter, size (1, 3, 3, n1) - * @param dw_bias Depthwise bias, size (1, 1, 1, n1) - * @param pw_linear_1 Pointwise 1x1 filter, size (n2/2, 1, 1, n1) - * @param pw_linear_2 Pointwise 1x1 filter, size (n2/2, 1, 1, n1) - * @param pw_linear_bias Pointwise bias, size (1, 1, 1, n2) - * @param pw_exponent Exponent for pointwise resulting matrix - * @param dw_exponent Exponent for depthwise resulting matrix - * @param pw_linear_exponent Exponent for pointwise resulting matrix - * @param stride_x Stride of width - * @param stride_y Stride of height - * @param padding Padding type, 0: valid, 1: same - * @param mode Implementation mode - * @param shortcut Whether has a shortcut at pointwise linear - * @return Resulting quantized matrix - */ -dl_matrix3dq_t *dl_matrix3dqq_mobilefaceblock_split(dl_matrix3dq_t *in, - dl_matrix3dq_t *pw_1, - dl_matrix3dq_t *pw_2, - dl_matrix3dq_t *pw_bias, - dl_matrix3dq_t *dw, - dl_matrix3dq_t *dw_bias, - dl_matrix3dq_t *pw_linear_1, - dl_matrix3dq_t *pw_linear_2, - dl_matrix3dq_t *pw_linear_bias, - int pw_exponent, - int dw_exponent, - int pw_linear_exponent, - int stride_x, - int stride_y, - dl_padding_type padding, - dl_conv_mode mode, - int shortcut); - -/** - * @brief Do mobilefacenet process, the process sequence is 1x1 pointwise->bn->relu->3x3 depthwise->bn->relu->1x1 pointwise->bn - * - * @param in Input matrix, size (1, w, h, c) - * @param pw Pointwise 1x1 filter, size (n1, 1, 1, c) - * @param pw_bias Pointwise bias, size (1, 1, 1, n1) - * @param dw Depthwise 3x3 filter, size (1, 3, 3, n1) - * @param dw_bias Depthwise bias, size (1, 1, 1, n1) - * @param pw_linear Pointwise 1x1 filter, size (n2, 1, 1, n1) - * @param pw_linear_bias Pointwise bias, size (1, 1, 1, n2) - * @param pw_exponent Exponent for pointwise resulting matrix - * @param dw_exponent Exponent for depthwise resulting matrix - * @param pw_linear_exponent Exponent for pointwise resulting matrix - * @param stride_x Stride of width - * @param stride_y Stride of height - * @param padding Padding type, 0: valid, 1: same - * @param mode Implementation mode - * @param shortcut Whether has a shortcut at pointwise linear - * @return Resulting quantized matrix - */ -dl_matrix3dq_t *dl_matrix3dqq_mobilefaceblock(dl_matrix3dq_t *in, - dl_matrix3dq_t *pw, - dl_matrix3dq_t *pw_bias, - dl_matrix3dq_t *dw, - dl_matrix3dq_t *dw_bias, - dl_matrix3dq_t *pw_linear, - dl_matrix3dq_t *pw_linear_bias, - int pw_exponent, - int dw_exponent, - int pw_linear_exponent, - int stride_x, - int stride_y, - dl_padding_type padding, - dl_conv_mode mode, - int shortcut); - -// -// Mobilenet -// - -/** - * @brief Do mobilenet process, the process sequence is 1x1 dilated->prelu->3x3 depthwise->prelu->1x1 compress->bias - * - * @param in Input matrix, size (1, w, h, c) - * @param dilate Pointwise 1x1 filter, size (n1, 1, 1, c) - * @param dilate_prelu Pointwise prelu, size (1, 1, 1, n1) - * @param depthwise Depthwise 3x3 filter, size (1, 3, 3, n1) - * @param depthwise_prelu Depthwise prelu, size (1, 1, 1, n1) - * @param compress Pointwise 1x1 filter, size (n2, 1, 1, n1) - * @param bias Pointwise bias, size (1, 1, 1, n2) - * @param config Mobilenet configuration - * @return Resulting quantized matrix - */ -dl_matrix3dq_t *dl_matrix3dqq_mobilenet(dl_matrix3dq_t *in, - dl_matrix3dq_t *dilate, - dl_matrix3dq_t *dilate_prelu, - dl_matrix3dq_t *depthwise, - dl_matrix3dq_t *depth_prelu, - dl_matrix3dq_t *compress, - dl_matrix3dq_t *bias, - dl_matrix3dq_mobilenet_config_t config, - char *name); - -/** - * @brief Do mobilenet process, the process sequence is 1x1 dilated->prelu->3x3 depthwise->prelu->1x1 compress->bias - * - * @param in Input matrix, 8-bit fixed point, size (1, w, h, c) - * @param dilate Pointwise 1x1 filter, size (n1, 1, 1, c) - * @param dilate_prelu Pointwise prelu, size (1, 1, 1, n1) - * @param depthwise Depthwise 3x3 filter, size (1, 3, 3, n1) - * @param depthwise_prelu Depthwise prelu, size (1, 1, 1, n1) - * @param compress Pointwise 1x1 filter, size (n2, 1, 1, n1) - * @param bias Pointwise bias, size (1, 1, 1, n2) - * @param config Mobilenet configuration - * @return Resulting quantized matrix - */ -dl_matrix3dq_t *dl_matrix3duq_mobilenet(dl_matrix3du_t *in, - dl_matrix3dq_t *dilate, - dl_matrix3dq_t *dilate_prelu, - dl_matrix3dq_t *depthwise, - dl_matrix3dq_t *depth_prelu, - dl_matrix3dq_t *compress, - dl_matrix3dq_t *bias, - dl_matrix3dq_mobilenet_config_t config, - char *name); - -// -// Padding -// - -dl_error_type dl_matrix3dqq_padding(dl_matrix3dq_t **padded_in, - dl_matrix3dq_t **out, - dl_matrix3dq_t *in, - int out_c, - int stride_x, - int stride_y, - int padding, - int exponent); - -dl_error_type dl_matrix3duq_padding(dl_matrix3du_t **padded_in, - dl_matrix3dq_t **out, - dl_matrix3du_t *in, - int out_c, - int stride_x, - int stride_y, - int padding, - int exponent); - -// -// Pooling -// -/** - * @brief Calculate average value of a feature map - * - * @param in Input matrix, size (1, w, h, c) - * @return Resulting matrix, size (1, 1, 1, c) - */ -dl_matrix3dq_t *dl_matrix3dq_global_pool(dl_matrix3dq_t *in); diff --git a/tools/sdk/include/esp-face/fd_forward.h b/tools/sdk/include/esp-face/fd_forward.h deleted file mode 100644 index 12db168f659..00000000000 --- a/tools/sdk/include/esp-face/fd_forward.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * ESPRESSIF MIT License - * - * Copyright (c) 2018 - * - * Permission is hereby granted for use on ESPRESSIF SYSTEMS products only, in which case, - * it is 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. - * - */ -#pragma once - -#if __cplusplus -extern "C" -{ -#endif - -#include "image_util.h" -#include "dl_lib_matrix3d.h" -#include "mtmn.h" - - typedef enum - { - FAST = 0, - NORMAL = 1, - } mtmn_resize_type; - - typedef struct - { - float score; /// score threshold for filter candidates by score - float nms; /// nms threshold for nms process - int candidate_number; /// candidate number limitation for each net - } threshold_config_t; - - typedef struct - { - int w; /// net width - int h; /// net height - threshold_config_t threshold; /// threshold of net - } net_config_t; - - typedef struct - { - float min_face; /// The minimum size of a detectable face - float pyramid; /// The scale of the gradient scaling for the input images - int pyramid_times; /// The pyramid resizing times - threshold_config_t p_threshold; /// The thresholds for P-Net. For details, see the definition of threshold_config_t - threshold_config_t r_threshold; /// The thresholds for R-Net. For details, see the definition of threshold_config_t - threshold_config_t o_threshold; /// The thresholds for O-Net. For details, see the definition of threshold_config_t - mtmn_resize_type type; /// The image resize type. 'pyramid' will lose efficacy, when 'type'==FAST. - } mtmn_config_t; - - static inline mtmn_config_t mtmn_init_config() - { - mtmn_config_t mtmn_config; - mtmn_config.type = FAST; - mtmn_config.min_face = 80; - mtmn_config.pyramid = 0.707; - mtmn_config.pyramid_times = 4; - mtmn_config.p_threshold.score = 0.6; - mtmn_config.p_threshold.nms = 0.7; - mtmn_config.p_threshold.candidate_number = 20; - mtmn_config.r_threshold.score = 0.7; - mtmn_config.r_threshold.nms = 0.7; - mtmn_config.r_threshold.candidate_number = 10; - mtmn_config.o_threshold.score = 0.7; - mtmn_config.o_threshold.nms = 0.7; - mtmn_config.o_threshold.candidate_number = 1; - - return mtmn_config; - } - - /** - * @brief Do MTMN face detection, return box and landmark infomation. - * - * @param image_matrix Image matrix, rgb888 format - * @param config Configuration of MTMN i.e. score threshold, nms threshold, candidate number threshold, pyramid, min face size - * @return box_array_t* A list of boxes and score. - */ - box_array_t *face_detect(dl_matrix3du_t *image_matrix, - mtmn_config_t *config); - -#if __cplusplus -} -#endif diff --git a/tools/sdk/include/esp-face/fr_flash.h b/tools/sdk/include/esp-face/fr_flash.h deleted file mode 100644 index b21cea03060..00000000000 --- a/tools/sdk/include/esp-face/fr_flash.h +++ /dev/null @@ -1,52 +0,0 @@ -#pragma once - -#if __cplusplus -extern "C" -{ -#endif - -#include "fr_forward.h" - -#define FR_FLASH_TYPE 32 -#define FR_FLASH_SUBTYPE 32 -#define FR_FLASH_PARTITION_NAME "fr" -#define FR_FLASH_INFO_FLAG 12138 - - /** - * @brief Produce face id according to the input aligned face, and save it to dest_id and flash. - * - * @param l Face id list - * @param aligned_face An aligned face - * @return -2 Flash partition not found - * @return 0 Enrollment finish - * @return >=1 The left piece of aligned faces should be input - */ - int8_t enroll_face_id_to_flash(face_id_list *l, - dl_matrix3du_t *aligned_face); - - int8_t enroll_face_id_to_flash_with_name(face_id_name_list *l, - dl_matrix3d_t *new_id, - char *name); - /** - * @brief Read the enrolled face IDs from the flash. - * - * @param l Face id list - * @return int8_t The number of IDs remaining in flash - */ - int8_t read_face_id_from_flash(face_id_list *l); - - int8_t read_face_id_from_flash_with_name(face_id_name_list *l); - - /** - * @brief Delete the enrolled face IDs in the flash. - * - * @param l Face id list - * @return int8_t The number of IDs remaining in flash - */ - int8_t delete_face_id_in_flash(face_id_list *l); - int8_t delete_face_id_in_flash_with_name(face_id_name_list *l, char *name); - void delete_face_all_in_flash_with_name(face_id_name_list *l); - -#if __cplusplus -} -#endif diff --git a/tools/sdk/include/esp-face/fr_forward.h b/tools/sdk/include/esp-face/fr_forward.h deleted file mode 100644 index a6db0a1b324..00000000000 --- a/tools/sdk/include/esp-face/fr_forward.h +++ /dev/null @@ -1,146 +0,0 @@ -#pragma once - -#if __cplusplus -extern "C" -{ -#endif - -#include "image_util.h" -#include "dl_lib_matrix3d.h" -#include "frmn.h" - -#define FACE_WIDTH 56 -#define FACE_HEIGHT 56 -#define FACE_ID_SIZE 512 -#define FACE_REC_THRESHOLD 0.5 - -#define LEFT_EYE_X 0 -#define LEFT_EYE_Y 1 -#define RIGHT_EYE_X 6 -#define RIGHT_EYE_Y 7 -#define NOSE_X 4 -#define NOSE_Y 5 - -#define EYE_DIST_SET 16.5f -#define NOSE_EYE_RATIO_THRES_MIN 0.49f -#define NOSE_EYE_RATIO_THRES_MAX 2.04f - -/** - * @brief HTTP Client events data - */ -#define ENROLL_NAME_LEN 16 - typedef struct tag_face_id_node - { - struct tag_face_id_node *next; - char id_name[ENROLL_NAME_LEN]; - dl_matrix3d_t *id_vec; - } face_id_node; - - typedef struct - { - face_id_node *head; /*!< head pointer of the id list */ - face_id_node *tail; /*!< tail pointer of the id list */ - uint8_t count; /*!< number of enrolled ids */ - uint8_t confirm_times; /*!< images needed for one enrolling */ - } face_id_name_list; - - typedef struct - { - uint8_t head; /*!< head index of the id list */ - uint8_t tail; /*!< tail index of the id list */ - uint8_t count; /*!< number of enrolled ids */ - uint8_t size; /*!< max len of id list */ - uint8_t confirm_times; /*!< images needed for one enrolling */ - dl_matrix3d_t **id_list; /*!< stores face id vectors */ - } face_id_list; - - /** - * @brief Initialize face id list - * - * @param l Face id list - * @param size Size of list, one list contains one vector - * @param confirm_times Enroll times for one id - * @return dl_matrix3du_t* Size: 1xFACE_WIDTHxFACE_HEIGHTx3 - */ - void face_id_init(face_id_list *l, uint8_t size, uint8_t confirm_times); - void face_id_name_init(face_id_name_list *l, uint8_t size, uint8_t confirm_times); - - /** - * @brief Alloc memory for aligned face. - * - * @return dl_matrix3du_t* Size: 1xFACE_WIDTHxFACE_HEIGHTx3 - */ - dl_matrix3du_t *aligned_face_alloc(); - - /** - * @brief Align detected face to average face according to landmark - * - * @param onet_boxes Output of MTMN with box and landmark - * @param src Image matrix, rgb888 format - * @param dest Output image - * @return ESP_OK Input face is good for recognition - * @return ESP_FAIL Input face is not good for recognition - */ - int8_t align_face(box_array_t *onet_boxes, - dl_matrix3du_t *src, - dl_matrix3du_t *dest); - - int8_t align_face2(fptp_t *landmark, - dl_matrix3du_t *src, - dl_matrix3du_t *dest); - - /** - * @brief Run the face recognition model to get the face feature - * - * @param aligned_face A 56x56x3 image, the variable need to do align_face first - * @return face_id A 512 vector, size (1, 1, 1, 512) - */ - dl_matrix3d_t *get_face_id(dl_matrix3du_t *aligned_face); - - /** - * @brief Add src_id to dest_id - * - * @param dest_id - * @param src_id - */ - void add_face_id(dl_matrix3d_t *dest_id, - dl_matrix3d_t *src_id); - - /** - * @brief Match face with the id_list, and return matched_id. - * - * @param algined_face An aligned face - * @param id_list An ID list - * @return int8_t Matched face id - */ - int8_t recognize_face(face_id_list *l, dl_matrix3du_t *algined_face); - - face_id_node *recognize_face_with_name(face_id_name_list *l, dl_matrix3d_t *face_id); - /** - * @brief Produce face id according to the input aligned face, and save it to dest_id. - * - * @param l face id list - * @param aligned_face An aligned face - * @param enroll_confirm_times Confirm times for each face id enrollment - * @return -1 Wrong input enroll_confirm_times - * @return 0 Enrollment finish - * @return >=1 The left piece of aligned faces should be input - */ - int8_t enroll_face(face_id_list *l, dl_matrix3du_t *aligned_face); - - int8_t enroll_face_with_name(face_id_name_list *l, - dl_matrix3d_t *new_id, - char *name); - - /** - * @brief Alloc memory for aligned face. - * - * @param l face id list - * @return uint8_t left count - */ - uint8_t delete_face(face_id_list *l); - int8_t delete_face_with_name(face_id_name_list *l, char *name); - void delete_face_all_with_name(face_id_name_list *l); -#if __cplusplus -} -#endif diff --git a/tools/sdk/include/esp-face/frmn.h b/tools/sdk/include/esp-face/frmn.h deleted file mode 100644 index 171f69ad885..00000000000 --- a/tools/sdk/include/esp-face/frmn.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#if __cplusplus -extern "C" -{ -#endif - -#include "dl_lib_matrix3d.h" -#include "dl_lib_matrix3dq.h" - - /** - * @brief Forward the face recognition process with frmn model. Calculate in float. - * - * @param in Image matrix, rgb888 format, size is 56x56, normalized - * @return dl_matrix3d_t* Face ID feature vector, size is 512 - */ - dl_matrix3d_t *frmn(dl_matrix3d_t *in); - - /** - * @brief Forward the face recognition process with frmn model. Calculate in quantization. - * - * @param in Image matrix, rgb888 format, size is 56x56, normalized - * @param mode 0: C implement; 1: handwrite xtensa instruction implement - * @return Face ID feature vector, size is 512 - */ - dl_matrix3dq_t *frmn_q(dl_matrix3dq_t *in, dl_conv_mode mode); - - /** - * @brief Forward the face recognition process with frmn2 model. Calculate in quantization. - * - * @param in Image matrix, rgb888 format, size is 56x56, normalized - * @param mode 0: C implement; 1: handwrite xtensa instruction implement - * @return Face ID feature vector, size is 512 - */ - dl_matrix3dq_t *frmn2_q(dl_matrix3dq_t *in, dl_conv_mode mode); - - /** - * @brief Forward the face recognition process with frmn2p model. Calculate in quantization. - * - * @param in Image matrix, rgb888 format, size is 56x56, normalized - * @param mode 0: C implement; 1: handwrite xtensa instruction implement - * @return Face ID feature vector, size is 512 - */ - dl_matrix3dq_t *frmn2p_q(dl_matrix3dq_t *in, dl_conv_mode mode); - - /** - * @brief Forward the face recognition process with frmn2c model. Calculate in quantization. - * - * @param in Image matrix, rgb888 format, size is 56x56, normalized - * @param mode 0: C implement; 1: handwrite xtensa instruction implement - * @return Face ID feature vector, size is 512 - */ - dl_matrix3dq_t *frmn2c_q(dl_matrix3dq_t *in, dl_conv_mode mode); - -#if __cplusplus -} -#endif diff --git a/tools/sdk/include/esp-face/image_util.h b/tools/sdk/include/esp-face/image_util.h deleted file mode 100644 index 961a12299d1..00000000000 --- a/tools/sdk/include/esp-face/image_util.h +++ /dev/null @@ -1,310 +0,0 @@ -/* - * ESPRESSIF MIT License - * - * Copyright (c) 2018 - * - * Permission is hereby granted for use on ESPRESSIF SYSTEMS products only, in which case, - * it is 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. - * - */ -#pragma once -#ifdef __cplusplus -extern "C" -{ -#endif -#include -#include -#include "mtmn.h" - -#define MAX_VALID_COUNT_PER_IMAGE (30) - -#define DL_IMAGE_MIN(A, B) ((A) < (B) ? (A) : (B)) -#define DL_IMAGE_MAX(A, B) ((A) < (B) ? (B) : (A)) - -#define IMAGE_WIDTH 320 -#define IMAGE_HEIGHT 240 - -#define RGB565_MASK_RED 0xF800 -#define RGB565_MASK_GREEN 0x07E0 -#define RGB565_MASK_BLUE 0x001F - - typedef enum - { - BINARY, - } en_threshold_mode; - typedef struct - { - fptp_t landmark_p[10]; - } landmark_t; - - typedef struct - { - fptp_t box_p[4]; - } box_t; - - typedef struct tag_box_list - { - fptp_t *score; - box_t *box; - landmark_t *landmark; - int len; - } box_array_t; - - typedef struct tag_image_box - { - struct tag_image_box *next; - fptp_t score; - box_t box; - box_t offset; - landmark_t landmark; - } image_box_t; - - typedef struct tag_image_list - { - image_box_t *head; - image_box_t *origin_head; - int len; - } image_list_t; - - static inline void image_get_width_and_height(box_t *box, float *w, float *h) - { - *w = box->box_p[2] - box->box_p[0] + 1; - *h = box->box_p[3] - box->box_p[1] + 1; - } - - static inline void image_get_area(box_t *box, float *area) - { - float w, h; - image_get_width_and_height(box, &w, &h); - *area = w * h; - } - - static inline void image_calibrate_by_offset(image_list_t *image_list) - { - for (image_box_t *head = image_list->head; head; head = head->next) - { - float w, h; - image_get_width_and_height(&(head->box), &w, &h); - head->box.box_p[0] = DL_IMAGE_MAX(0, head->box.box_p[0] + head->offset.box_p[0] * w); - head->box.box_p[1] = DL_IMAGE_MAX(0, head->box.box_p[1] + head->offset.box_p[1] * w); - head->box.box_p[2] += head->offset.box_p[2] * w; - if (head->box.box_p[2] > IMAGE_WIDTH) - { - head->box.box_p[2] = IMAGE_WIDTH - 1; - head->box.box_p[0] = IMAGE_WIDTH - w; - } - head->box.box_p[3] += head->offset.box_p[3] * h; - if (head->box.box_p[3] > IMAGE_HEIGHT) - { - head->box.box_p[3] = IMAGE_HEIGHT - 1; - head->box.box_p[1] = IMAGE_HEIGHT - h; - } - } - } - - static inline void image_landmark_calibrate(image_list_t *image_list) - { - for (image_box_t *head = image_list->head; head; head = head->next) - { - float w, h; - image_get_width_and_height(&(head->box), &w, &h); - head->landmark.landmark_p[0] = head->box.box_p[0] + head->landmark.landmark_p[0] * w; - head->landmark.landmark_p[1] = head->box.box_p[1] + head->landmark.landmark_p[1] * h; - - head->landmark.landmark_p[2] = head->box.box_p[0] + head->landmark.landmark_p[2] * w; - head->landmark.landmark_p[3] = head->box.box_p[1] + head->landmark.landmark_p[3] * h; - - head->landmark.landmark_p[4] = head->box.box_p[0] + head->landmark.landmark_p[4] * w; - head->landmark.landmark_p[5] = head->box.box_p[1] + head->landmark.landmark_p[5] * h; - - head->landmark.landmark_p[6] = head->box.box_p[0] + head->landmark.landmark_p[6] * w; - head->landmark.landmark_p[7] = head->box.box_p[1] + head->landmark.landmark_p[7] * h; - - head->landmark.landmark_p[8] = head->box.box_p[0] + head->landmark.landmark_p[8] * w; - head->landmark.landmark_p[9] = head->box.box_p[1] + head->landmark.landmark_p[9] * h; - } - } - - static inline void image_rect2sqr(box_array_t *boxes, int width, int height) - { - for (int i = 0; i < boxes->len; i++) - { - box_t *box = &(boxes->box[i]); - - int x1 = round(box->box_p[0]); - int y1 = round(box->box_p[1]); - int x2 = round(box->box_p[2]); - int y2 = round(box->box_p[3]); - - int w = x2 - x1 + 1; - int h = y2 - y1 + 1; - int l = DL_IMAGE_MAX(w, h); - - box->box_p[0] = round(DL_IMAGE_MAX(0, x1) + 0.5 * (w - l)); - box->box_p[1] = round(DL_IMAGE_MAX(0, y1) + 0.5 * (h - l)); - - box->box_p[2] = box->box_p[0] + l - 1; - if (box->box_p[2] > width) - { - box->box_p[2] = width - 1; - box->box_p[0] = width - l; - } - box->box_p[3] = box->box_p[1] + l - 1; - if (box->box_p[3] > height) - { - box->box_p[3] = height - 1; - box->box_p[1] = height - l; - } - } - } - - static inline void rgb565_to_888(uint16_t in, uint8_t *dst) - { /*{{{*/ - dst[0] = (in & RGB565_MASK_BLUE) << 3; // blue - dst[1] = (in & RGB565_MASK_GREEN) >> 3; // green - dst[2] = (in & RGB565_MASK_RED) >> 8; // red - } /*}}}*/ - - static inline void rgb888_to_565(uint16_t *in, uint8_t r, uint8_t g, uint8_t b) - { /*{{{*/ - uint16_t rgb565 = 0; - rgb565 = ((r >> 3) << 11); - rgb565 |= ((g >> 2) << 5); - rgb565 |= (b >> 3); - *in = rgb565; - } /*}}}*/ - - /** - * @brief - * - * @param score - * @param offset - * @param width - * @param height - * @param p_net_size - * @param score_threshold - * @param scale - * @return image_list_t* - */ - image_list_t *image_get_valid_boxes(fptp_t *score, - fptp_t *offset, - int width, - int height, - int p_net_size, - fptp_t score_threshold, - fptp_t scale); - /** - * @brief - * - * @param image_sorted_list - * @param insert_list - */ - void image_sort_insert_by_score(image_list_t *image_sorted_list, const image_list_t *insert_list); - - /** - * @brief - * - * @param image_list - * @param nms_threshold - * @param same_area - */ - void image_nms_process(image_list_t *image_list, fptp_t nms_threshold, int same_area); - - /** - * @brief - * - * @param dimage - * @param dw - * @param dh - * @param dc - * @param simage - * @param sw - * @param sc - */ - void image_zoom_in_twice(uint8_t *dimage, - int dw, - int dh, - int dc, - uint8_t *simage, - int sw, - int sc); - - /** - * @brief - * - * @param dst_image - * @param src_image - * @param dst_w - * @param dst_h - * @param dst_c - * @param src_w - * @param src_h - */ - void image_resize_linear(uint8_t *dst_image, uint8_t *src_image, int dst_w, int dst_h, int dst_c, int src_w, int src_h); - - /** - * @brief - * - * @param corp_image - * @param src_image - * @param rotate_angle - * @param ratio - * @param center - */ - void image_cropper(uint8_t *corp_image, uint8_t *src_image, int dst_w, int dst_h, int dst_c, int src_w, int src_h, float rotate_angle, float ratio, float *center); - - /** - * @brief - * - * @param m - * @param bmp - * @param count - */ - void transform_input_image(uint8_t *m, uint16_t *bmp, int count); - - /** - * @brief - * - * @param bmp - * @param m - * @param count - */ - void transform_output_image(uint16_t *bmp, uint8_t *m, int count); - - /** - * @brief - * - * @param buf - * @param boxes - * @param width - */ - void draw_rectangle_rgb565(uint16_t *buf, box_array_t *boxes, int width); - - /** - * @brief - * - * @param buf - * @param boxes - * @param width - */ - void draw_rectangle_rgb888(uint8_t *buf, box_array_t *boxes, int width); - void image_abs_diff(uint8_t *dst, uint8_t *src1, uint8_t *src2, int count); - void image_threshold(uint8_t *dst, uint8_t *src, int threshold, int value, int count, en_threshold_mode mode); - void image_erode(uint8_t *dst, uint8_t *src, int src_w, int src_h, int src_c); -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/esp-face/mtmn.h b/tools/sdk/include/esp-face/mtmn.h deleted file mode 100644 index 609a82ea488..00000000000 --- a/tools/sdk/include/esp-face/mtmn.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - * ESPRESSIF MIT License - * - * Copyright (c) 2018 - * - * Permission is hereby granted for use on ESPRESSIF SYSTEMS products only, in which case, - * it is 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. - * - */ -#pragma once - -#ifdef __cplusplus -extern "C" -{ -#endif -#include "dl_lib_matrix3d.h" -#include "dl_lib_matrix3dq.h" - - /** - * Detection results with MTMN. - * - */ - typedef struct - { - dl_matrix3d_t *category; /*!< Classification result after softmax, channel is 2 */ - dl_matrix3d_t *offset; /*!< Bounding box offset of 2 points: top-left and bottom-right, channel is 4 */ - dl_matrix3d_t *landmark; /*!< Offsets of 5 landmarks: - * - Left eye - * - Mouth leftside - * - Nose - * - Right eye - * - Mouth rightside - * - * channel is 10 - * */ - } mtmn_net_t; - - - /** - * @brief Free a mtmn_net_t - * - * @param p A mtmn_net_t pointer - * - */ - - void mtmn_net_t_free(mtmn_net_t *p); - - /** - * @brief Forward the pnet process, coarse detection. Calculate in float. - * - * @param in Image matrix, rgb888 format, size is 320x240 - * @return Scores for every pixel, and box offset with respect. - */ - mtmn_net_t *pnet_lite_f(dl_matrix3du_t *in); - - /** - * @brief Forward the rnet process, fine determine the boxes from pnet. Calculate in float. - * - * @param in Image matrix, rgb888 format - * @param threshold Score threshold to detect human face - * @return Scores for every box, and box offset with respect. - */ - mtmn_net_t *rnet_lite_f_with_score_verify(dl_matrix3du_t *in, float threshold); - - /** - * @brief Forward the onet process, fine determine the boxes from rnet. Calculate in float. - * - * @param in Image matrix, rgb888 format - * @param threshold Score threshold to detect human face - * @return Scores for every box, box offset, and landmark with respect. - */ - mtmn_net_t *onet_lite_f_with_score_verify(dl_matrix3du_t *in, float threshold); - - /** - * @brief Forward the pnet process, coarse detection. Calculate in quantization. - * - * @param in Image matrix, rgb888 format, size is 320x240 - * @return Scores for every pixel, and box offset with respect. - */ - mtmn_net_t *pnet_lite_q(dl_matrix3du_t *in, dl_conv_mode mode); - - /** - * @brief Forward the rnet process, fine determine the boxes from pnet. Calculate in quantization. - * - * @param in Image matrix, rgb888 format - * @param threshold Score threshold to detect human face - * @return Scores for every box, and box offset with respect. - */ - mtmn_net_t *rnet_lite_q_with_score_verify(dl_matrix3du_t *in, float threshold, dl_conv_mode mode); - - /** - * @brief Forward the onet process, fine determine the boxes from rnet. Calculate in quantization. - * - * @param in Image matrix, rgb888 format - * @param threshold Score threshold to detect human face - * @return Scores for every box, box offset, and landmark with respect. - */ - mtmn_net_t *onet_lite_q_with_score_verify(dl_matrix3du_t *in, float threshold, dl_conv_mode mode); - - /** - * @brief Forward the pnet process, coarse detection. Calculate in quantization. - * - * @param in Image matrix, rgb888 format, size is 320x240 - * @return Scores for every pixel, and box offset with respect. - */ - mtmn_net_t *pnet_heavy_q(dl_matrix3du_t *in, dl_conv_mode mode); - - /** - * @brief Forward the rnet process, fine determine the boxes from pnet. Calculate in quantization. - * - * @param in Image matrix, rgb888 format - * @param threshold Score threshold to detect human face - * @return Scores for every box, and box offset with respect. - */ - mtmn_net_t *rnet_heavy_q_with_score_verify(dl_matrix3du_t *in, float threshold, dl_conv_mode mode); - - /** - * @brief Forward the onet process, fine determine the boxes from rnet. Calculate in quantization. - * - * @param in Image matrix, rgb888 format - * @param threshold Score threshold to detect human face - * @return Scores for every box, box offset, and landmark with respect. - */ - mtmn_net_t *onet_heavy_q_with_score_verify(dl_matrix3du_t *in, float threshold, dl_conv_mode mode); - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/esp-tls/esp_tls.h b/tools/sdk/include/esp-tls/esp_tls.h deleted file mode 100644 index 15830d5a3cc..00000000000 --- a/tools/sdk/include/esp-tls/esp_tls.h +++ /dev/null @@ -1,306 +0,0 @@ -// Copyright 2017-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. -#ifndef _ESP_TLS_H_ -#define _ESP_TLS_H_ - -#include -#include -#include - -#include "mbedtls/platform.h" -#include "mbedtls/net_sockets.h" -#include "mbedtls/esp_debug.h" -#include "mbedtls/ssl.h" -#include "mbedtls/entropy.h" -#include "mbedtls/ctr_drbg.h" -#include "mbedtls/error.h" -#include "mbedtls/certs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief ESP-TLS Connection State - */ -typedef enum esp_tls_conn_state { - ESP_TLS_INIT = 0, - ESP_TLS_CONNECTING, - ESP_TLS_HANDSHAKE, - ESP_TLS_FAIL, - ESP_TLS_DONE, -} esp_tls_conn_state_t; - -/** - * @brief ESP-TLS configuration parameters - */ -typedef struct esp_tls_cfg { - const char **alpn_protos; /*!< Application protocols required for HTTP2. - If HTTP2/ALPN support is required, a list - of protocols that should be negotiated. - The format is length followed by protocol - name. - For the most common cases the following is ok: - "\x02h2" - - where the first '2' is the length of the protocol and - - the subsequent 'h2' is the protocol name */ - - const unsigned char *cacert_pem_buf; /*!< Certificate Authority's certificate in a buffer */ - - unsigned int cacert_pem_bytes; /*!< Size of Certificate Authority certificate - pointed to by cacert_pem_buf */ - - const unsigned char *clientcert_pem_buf;/*!< Client certificate in a buffer */ - - unsigned int clientcert_pem_bytes; /*!< Size of client certificate pointed to by - clientcert_pem_buf */ - - const unsigned char *clientkey_pem_buf; /*!< Client key in a buffer */ - - unsigned int clientkey_pem_bytes; /*!< Size of client key pointed to by - clientkey_pem_buf */ - - const unsigned char *clientkey_password;/*!< Client key decryption password string */ - - unsigned int clientkey_password_len; /*!< String length of the password pointed to by - clientkey_password */ - - bool non_block; /*!< Configure non-blocking mode. If set to true the - underneath socket will be configured in non - blocking mode after tls session is established */ - - int timeout_ms; /*!< Network timeout in milliseconds */ - - bool use_global_ca_store; /*!< Use a global ca_store for all the connections in which - this bool is set. */ -} esp_tls_cfg_t; - -/** - * @brief ESP-TLS Connection Handle - */ -typedef struct esp_tls { - mbedtls_ssl_context ssl; /*!< TLS/SSL context */ - - mbedtls_entropy_context entropy; /*!< mbedTLS entropy context structure */ - - mbedtls_ctr_drbg_context ctr_drbg; /*!< mbedTLS ctr drbg context structure. - CTR_DRBG is deterministic random - bit generation based on AES-256 */ - - mbedtls_ssl_config conf; /*!< TLS/SSL configuration to be shared - between mbedtls_ssl_context - structures */ - - mbedtls_net_context server_fd; /*!< mbedTLS wrapper type for sockets */ - - mbedtls_x509_crt cacert; /*!< Container for the X.509 CA certificate */ - - mbedtls_x509_crt *cacert_ptr; /*!< Pointer to the cacert being used. */ - - mbedtls_x509_crt clientcert; /*!< Container for the X.509 client certificate */ - - mbedtls_pk_context clientkey; /*!< Container for the private key of the client - certificate */ - - int sockfd; /*!< Underlying socket file descriptor. */ - - ssize_t (*read)(struct esp_tls *tls, char *data, size_t datalen); /*!< Callback function for reading data from TLS/SSL - connection. */ - - ssize_t (*write)(struct esp_tls *tls, const char *data, size_t datalen); /*!< Callback function for writing data to TLS/SSL - connection. */ - - esp_tls_conn_state_t conn_state; /*!< ESP-TLS Connection state */ - - fd_set rset; /*!< read file descriptors */ - - fd_set wset; /*!< write file descriptors */ -} esp_tls_t; - -/** - * @brief Create a new blocking TLS/SSL connection - * - * This function establishes a TLS/SSL connection with the specified host in blocking manner. - * - * @param[in] hostname Hostname of the host. - * @param[in] hostlen Length of hostname. - * @param[in] port Port number of the host. - * @param[in] cfg TLS configuration as esp_tls_cfg_t. If you wish to open - * non-TLS connection, keep this NULL. For TLS connection, - * a pass pointer to esp_tls_cfg_t. At a minimum, this - * structure should be zero-initialized. - * @return pointer to esp_tls_t, or NULL if connection couldn't be opened. - */ -esp_tls_t *esp_tls_conn_new(const char *hostname, int hostlen, int port, const esp_tls_cfg_t *cfg); - -/** - * @brief Create a new blocking TLS/SSL connection with a given "HTTP" url - * - * The behaviour is same as esp_tls_conn_new() API. However this API accepts host's url. - * - * @param[in] url url of host. - * @param[in] cfg TLS configuration as esp_tls_cfg_t. If you wish to open - * non-TLS connection, keep this NULL. For TLS connection, - * a pass pointer to 'esp_tls_cfg_t'. At a minimum, this - * structure should be zero-initialized. - * @return pointer to esp_tls_t, or NULL if connection couldn't be opened. - */ -esp_tls_t *esp_tls_conn_http_new(const char *url, const esp_tls_cfg_t *cfg); - -/** - * @brief Create a new non-blocking TLS/SSL connection - * - * This function initiates a non-blocking TLS/SSL connection with the specified host, but due to - * its non-blocking nature, it doesn't wait for the connection to get established. - * - * @param[in] hostname Hostname of the host. - * @param[in] hostlen Length of hostname. - * @param[in] port Port number of the host. - * @param[in] cfg TLS configuration as esp_tls_cfg_t. `non_block` member of - * this structure should be set to be true. - * @param[in] tls pointer to esp-tls as esp-tls handle. - * - * @return - * - -1 If connection establishment fails. - * - 0 If connection establishment is in progress. - * - 1 If connection establishment is successful. - */ -int esp_tls_conn_new_async(const char *hostname, int hostlen, int port, const esp_tls_cfg_t *cfg, esp_tls_t *tls); - -/** - * @brief Create a new non-blocking TLS/SSL connection with a given "HTTP" url - * - * The behaviour is same as esp_tls_conn_new() API. However this API accepts host's url. - * - * @param[in] url url of host. - * @param[in] cfg TLS configuration as esp_tls_cfg_t. - * @param[in] tls pointer to esp-tls as esp-tls handle. - * - * @return - * - -1 If connection establishment fails. - * - 0 If connection establishment is in progress. - * - 1 If connection establishment is successful. - */ -int esp_tls_conn_http_new_async(const char *url, const esp_tls_cfg_t *cfg, esp_tls_t *tls); - -/** - * @brief Write from buffer 'data' into specified tls connection. - * - * @param[in] tls pointer to esp-tls as esp-tls handle. - * @param[in] data Buffer from which data will be written. - * @param[in] datalen Length of data buffer. - * - * @return - * - >0 if write operation was successful, the return value is the number - * of bytes actually written to the TLS/SSL connection. - * - 0 if write operation was not successful. The underlying - * connection was closed. - * - <0 if write operation was not successful, because either an - * error occured or an action must be taken by the calling process. - */ -static inline ssize_t esp_tls_conn_write(esp_tls_t *tls, const void *data, size_t datalen) -{ - return tls->write(tls, (char *)data, datalen); -} - -/** - * @brief Read from specified tls connection into the buffer 'data'. - * - * @param[in] tls pointer to esp-tls as esp-tls handle. - * @param[in] data Buffer to hold read data. - * @param[in] datalen Length of data buffer. - * - * @return - * - >0 if read operation was successful, the return value is the number - * of bytes actually read from the TLS/SSL connection. - * - 0 if read operation was not successful. The underlying - * connection was closed. - * - <0 if read operation was not successful, because either an - * error occured or an action must be taken by the calling process. - */ -static inline ssize_t esp_tls_conn_read(esp_tls_t *tls, void *data, size_t datalen) -{ - return tls->read(tls, (char *)data, datalen); -} - -/** - * @brief Close the TLS/SSL connection and free any allocated resources. - * - * This function should be called to close each tls connection opened with esp_tls_conn_new() or - * esp_tls_conn_http_new() APIs. - * - * @param[in] tls pointer to esp-tls as esp-tls handle. - */ -void esp_tls_conn_delete(esp_tls_t *tls); - -/** - * @brief Return the number of application data bytes remaining to be - * read from the current record - * - * This API is a wrapper over mbedtls's mbedtls_ssl_get_bytes_avail() API. - * - * @param[in] tls pointer to esp-tls as esp-tls handle. - * - * @return - * - -1 in case of invalid arg - * - bytes available in the application data - * record read buffer - */ -size_t esp_tls_get_bytes_avail(esp_tls_t *tls); - -/** - * @brief Create a global CA store with the buffer provided in cfg. - * - * This function should be called if the application wants to use the same CA store for - * multiple connections. The application must call this function before calling esp_tls_conn_new(). - * - * @param[in] cacert_pem_buf Buffer which has certificates in pem format. This buffer - * is used for creating a global CA store, which can be used - * by other tls connections. - * @param[in] cacert_pem_bytes Length of the buffer. - * - * @return - * - ESP_OK if creating global CA store was successful. - * - Other if an error occured or an action must be taken by the calling process. - */ -esp_err_t esp_tls_set_global_ca_store(const unsigned char *cacert_pem_buf, const unsigned int cacert_pem_bytes); - -/** - * @brief Get the pointer to the global CA store currently being used. - * - * The application must first call esp_tls_set_global_ca_store(). Then the same - * CA store could be used by the application for APIs other than esp_tls. - * - * @note Modifying the pointer might cause a failure in verifying the certificates. - * - * @return - * - Pointer to the global CA store currently being used if successful. - * - NULL if there is no global CA store set. - */ -mbedtls_x509_crt *esp_tls_get_global_ca_store(); - -/** - * @brief Free the global CA store currently being used. - * - * The memory being used by the global CA store to store all the parsed certificates is - * freed up. The application can call this API if it no longer needs the global CA store. - */ -void esp_tls_free_global_ca_store(); - - -#ifdef __cplusplus -} -#endif - -#endif /* ! _ESP_TLS_H_ */ diff --git a/tools/sdk/include/esp32-camera/esp_camera.h b/tools/sdk/include/esp32-camera/esp_camera.h deleted file mode 100755 index 071b986fa5a..00000000000 --- a/tools/sdk/include/esp32-camera/esp_camera.h +++ /dev/null @@ -1,180 +0,0 @@ -// 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. -/* - * Example Use - * - static camera_config_t camera_example_config = { - .pin_pwdn = PIN_PWDN, - .pin_reset = PIN_RESET, - .pin_xclk = PIN_XCLK, - .pin_sscb_sda = PIN_SIOD, - .pin_sscb_scl = PIN_SIOC, - .pin_d7 = PIN_D7, - .pin_d6 = PIN_D6, - .pin_d5 = PIN_D5, - .pin_d4 = PIN_D4, - .pin_d3 = PIN_D3, - .pin_d2 = PIN_D2, - .pin_d1 = PIN_D1, - .pin_d0 = PIN_D0, - .pin_vsync = PIN_VSYNC, - .pin_href = PIN_HREF, - .pin_pclk = PIN_PCLK, - - .xclk_freq_hz = 20000000, - .ledc_timer = LEDC_TIMER_0, - .ledc_channel = LEDC_CHANNEL_0, - .pixel_format = PIXFORMAT_JPEG, - .frame_size = FRAMESIZE_SVGA, - .jpeg_quality = 10, - .fb_count = 2 - }; - - esp_err_t camera_example_init(){ - return esp_camera_init(&camera_example_config); - } - - esp_err_t camera_example_capture(){ - //capture a frame - camera_fb_t * fb = esp_camera_fb_get(); - if (!fb) { - ESP_LOGE(TAG, "Frame buffer could not be acquired"); - return ESP_FAIL; - } - - //replace this with your own function - display_image(fb->width, fb->height, fb->pixformat, fb->buf, fb->len); - - //return the frame buffer back to be reused - esp_camera_fb_return(fb); - - return ESP_OK; - } -*/ - -#pragma once - -#include "esp_err.h" -#include "driver/ledc.h" -#include "sensor.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Configuration structure for camera initialization - */ -typedef struct { - int pin_pwdn; /*!< GPIO pin for camera power down line */ - int pin_reset; /*!< GPIO pin for camera reset line */ - int pin_xclk; /*!< GPIO pin for camera XCLK line */ - int pin_sscb_sda; /*!< GPIO pin for camera SDA line */ - int pin_sscb_scl; /*!< GPIO pin for camera SCL line */ - int pin_d7; /*!< GPIO pin for camera D7 line */ - int pin_d6; /*!< GPIO pin for camera D6 line */ - int pin_d5; /*!< GPIO pin for camera D5 line */ - int pin_d4; /*!< GPIO pin for camera D4 line */ - int pin_d3; /*!< GPIO pin for camera D3 line */ - int pin_d2; /*!< GPIO pin for camera D2 line */ - int pin_d1; /*!< GPIO pin for camera D1 line */ - int pin_d0; /*!< GPIO pin for camera D0 line */ - int pin_vsync; /*!< GPIO pin for camera VSYNC line */ - int pin_href; /*!< GPIO pin for camera HREF line */ - int pin_pclk; /*!< GPIO pin for camera PCLK line */ - - int xclk_freq_hz; /*!< Frequency of XCLK signal, in Hz. Either 20KHz or 10KHz for OV2640 double FPS (Experimental) */ - - ledc_timer_t ledc_timer; /*!< LEDC timer to be used for generating XCLK */ - ledc_channel_t ledc_channel; /*!< LEDC channel to be used for generating XCLK */ - - pixformat_t pixel_format; /*!< Format of the pixel data: PIXFORMAT_ + YUV422|GRAYSCALE|RGB565|JPEG */ - framesize_t frame_size; /*!< Size of the output image: FRAMESIZE_ + QVGA|CIF|VGA|SVGA|XGA|SXGA|UXGA */ - - int jpeg_quality; /*!< Quality of JPEG output. 0-63 lower means higher quality */ - size_t fb_count; /*!< Number of frame buffers to be allocated. If more than one, then each frame will be acquired (double speed) */ -} camera_config_t; - -/** - * @brief Data structure of camera frame buffer - */ -typedef struct { - uint8_t * buf; /*!< Pointer to the pixel data */ - size_t len; /*!< Length of the buffer in bytes */ - size_t width; /*!< Width of the buffer in pixels */ - size_t height; /*!< Height of the buffer in pixels */ - pixformat_t format; /*!< Format of the pixel data */ -} camera_fb_t; - -#define ESP_ERR_CAMERA_BASE 0x20000 -#define ESP_ERR_CAMERA_NOT_DETECTED (ESP_ERR_CAMERA_BASE + 1) -#define ESP_ERR_CAMERA_FAILED_TO_SET_FRAME_SIZE (ESP_ERR_CAMERA_BASE + 2) -#define ESP_ERR_CAMERA_FAILED_TO_SET_OUT_FORMAT (ESP_ERR_CAMERA_BASE + 3) -#define ESP_ERR_CAMERA_NOT_SUPPORTED (ESP_ERR_CAMERA_BASE + 4) - -/** - * @brief Initialize the camera driver - * - * @note call camera_probe before calling this function - * - * This function detects and configures camera over I2C interface, - * allocates framebuffer and DMA buffers, - * initializes parallel I2S input, and sets up DMA descriptors. - * - * Currently this function can only be called once and there is - * no way to de-initialize this module. - * - * @param config Camera configuration parameters - * - * @return ESP_OK on success - */ -esp_err_t esp_camera_init(const camera_config_t* config); - -/** - * @brief Deinitialize the camera driver - * - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if the driver hasn't been initialized yet - */ -esp_err_t esp_camera_deinit(); - -/** - * @brief Obtain pointer to a frame buffer. - * - * @return pointer to the frame buffer - */ -camera_fb_t* esp_camera_fb_get(); - -/** - * @brief Return the frame buffer to be reused again. - * - * @param fb Pointer to the frame buffer - */ -void esp_camera_fb_return(camera_fb_t * fb); - -/** - * @brief Get a pointer to the image sensor control structure - * - * @return pointer to the sensor - */ -sensor_t * esp_camera_sensor_get(); - - -#ifdef __cplusplus -} -#endif - -#include "img_converters.h" - diff --git a/tools/sdk/include/esp32-camera/esp_jpg_decode.h b/tools/sdk/include/esp32-camera/esp_jpg_decode.h deleted file mode 100644 index f13536edf4d..00000000000 --- a/tools/sdk/include/esp32-camera/esp_jpg_decode.h +++ /dev/null @@ -1,43 +0,0 @@ -// 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. -#ifndef _ESP_JPG_DECODE_H_ -#define _ESP_JPG_DECODE_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include -#include "esp_err.h" - -typedef enum { - JPG_SCALE_NONE, - JPG_SCALE_2X, - JPG_SCALE_4X, - JPG_SCALE_8X, - JPG_SCALE_MAX = JPG_SCALE_8X -} jpg_scale_t; - -typedef size_t (* jpg_reader_cb)(void * arg, size_t index, uint8_t *buf, size_t len); -typedef bool (* jpg_writer_cb)(void * arg, uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint8_t *data); - -esp_err_t esp_jpg_decode(size_t len, jpg_scale_t scale, jpg_reader_cb reader, jpg_writer_cb writer, void * arg); - -#ifdef __cplusplus -} -#endif - -#endif /* _ESP_JPG_DECODE_H_ */ diff --git a/tools/sdk/include/esp32-camera/img_converters.h b/tools/sdk/include/esp32-camera/img_converters.h deleted file mode 100644 index 2b83c4d6f42..00000000000 --- a/tools/sdk/include/esp32-camera/img_converters.h +++ /dev/null @@ -1,126 +0,0 @@ -// 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. -#ifndef _IMG_CONVERTERS_H_ -#define _IMG_CONVERTERS_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include -#include "esp_camera.h" - -typedef size_t (* jpg_out_cb)(void * arg, size_t index, const void* data, size_t len); - -/** - * @brief Convert image buffer to JPEG - * - * @param src Source buffer in RGB565, RGB888, YUYV or GRAYSCALE format - * @param src_len Length in bytes of the source buffer - * @param width Width in pixels of the source image - * @param height Height in pixels of the source image - * @param format Format of the source image - * @param quality JPEG quality of the resulting image - * @param cp Callback to be called to write the bytes of the output JPEG - * @param arg Pointer to be passed to the callback - * - * @return true on success - */ -bool fmt2jpg_cb(uint8_t *src, size_t src_len, uint16_t width, uint16_t height, pixformat_t format, uint8_t quality, jpg_out_cb cb, void * arg); - -/** - * @brief Convert camera frame buffer to JPEG - * - * @param fb Source camera frame buffer - * @param quality JPEG quality of the resulting image - * @param cp Callback to be called to write the bytes of the output JPEG - * @param arg Pointer to be passed to the callback - * - * @return true on success - */ -bool frame2jpg_cb(camera_fb_t * fb, uint8_t quality, jpg_out_cb cb, void * arg); - -/** - * @brief Convert image buffer to JPEG buffer - * - * @param src Source buffer in RGB565, RGB888, YUYV or GRAYSCALE format - * @param src_len Length in bytes of the source buffer - * @param width Width in pixels of the source image - * @param height Height in pixels of the source image - * @param format Format of the source image - * @param quality JPEG quality of the resulting image - * @param out Pointer to be populated with the address of the resulting buffer - * @param out_len Pointer to be populated with the length of the output buffer - * - * @return true on success - */ -bool fmt2jpg(uint8_t *src, size_t src_len, uint16_t width, uint16_t height, pixformat_t format, uint8_t quality, uint8_t ** out, size_t * out_len); - -/** - * @brief Convert camera frame buffer to JPEG buffer - * - * @param fb Source camera frame buffer - * @param quality JPEG quality of the resulting image - * @param out Pointer to be populated with the address of the resulting buffer - * @param out_len Pointer to be populated with the length of the output buffer - * - * @return true on success - */ -bool frame2jpg(camera_fb_t * fb, uint8_t quality, uint8_t ** out, size_t * out_len); - -/** - * @brief Convert image buffer to BMP buffer - * - * @param src Source buffer in JPEG, RGB565, RGB888, YUYV or GRAYSCALE format - * @param src_len Length in bytes of the source buffer - * @param width Width in pixels of the source image - * @param height Height in pixels of the source image - * @param format Format of the source image - * @param out Pointer to be populated with the address of the resulting buffer - * @param out_len Pointer to be populated with the length of the output buffer - * - * @return true on success - */ -bool fmt2bmp(uint8_t *src, size_t src_len, uint16_t width, uint16_t height, pixformat_t format, uint8_t ** out, size_t * out_len); - -/** - * @brief Convert camera frame buffer to BMP buffer - * - * @param fb Source camera frame buffer - * @param out Pointer to be populated with the address of the resulting buffer - * @param out_len Pointer to be populated with the length of the output buffer - * - * @return true on success - */ -bool frame2bmp(camera_fb_t * fb, uint8_t ** out, size_t * out_len); - -/** - * @brief Convert image buffer to RGB888 buffer (used for face detection) - * - * @param src Source buffer in JPEG, RGB565, RGB888, YUYV or GRAYSCALE format - * @param src_len Length in bytes of the source buffer - * @param format Format of the source image - * @param rgb_buf Pointer to the output buffer (width * height * 3) - * - * @return true on success - */ -bool fmt2rgb888(const uint8_t *src_buf, size_t src_len, pixformat_t format, uint8_t * rgb_buf); - -#ifdef __cplusplus -} -#endif - -#endif /* _IMG_CONVERTERS_H_ */ diff --git a/tools/sdk/include/esp32-camera/sensor.h b/tools/sdk/include/esp32-camera/sensor.h deleted file mode 100755 index fc7786498e2..00000000000 --- a/tools/sdk/include/esp32-camera/sensor.h +++ /dev/null @@ -1,138 +0,0 @@ -/* - * This file is part of the OpenMV project. - * Copyright (c) 2013/2014 Ibrahim Abdelkader - * This work is licensed under the MIT license, see the file LICENSE for details. - * - * Sensor abstraction layer. - * - */ -#ifndef __SENSOR_H__ -#define __SENSOR_H__ -#include - -#define OV9650_PID (0x96) -#define OV2640_PID (0x26) -#define OV7725_PID (0x77) -#define OV3660_PID (0x36) - -typedef enum { - PIXFORMAT_RGB565, // 2BPP/RGB565 - PIXFORMAT_YUV422, // 2BPP/YUV422 - PIXFORMAT_GRAYSCALE, // 1BPP/GRAYSCALE - PIXFORMAT_JPEG, // JPEG/COMPRESSED - PIXFORMAT_RGB888, // 3BPP/RGB888 - PIXFORMAT_RAW, // RAW - PIXFORMAT_RGB444, // 3BP2P/RGB444 - PIXFORMAT_RGB555, // 3BP2P/RGB555 -} pixformat_t; - -typedef enum { - FRAMESIZE_QQVGA, // 160x120 - FRAMESIZE_QQVGA2, // 128x160 - FRAMESIZE_QCIF, // 176x144 - FRAMESIZE_HQVGA, // 240x176 - FRAMESIZE_QVGA, // 320x240 - FRAMESIZE_CIF, // 400x296 - FRAMESIZE_VGA, // 640x480 - FRAMESIZE_SVGA, // 800x600 - FRAMESIZE_XGA, // 1024x768 - FRAMESIZE_SXGA, // 1280x1024 - FRAMESIZE_UXGA, // 1600x1200 - FRAMESIZE_QXGA, // 2048*1536 - FRAMESIZE_INVALID -} framesize_t; - -typedef enum { - GAINCEILING_2X, - GAINCEILING_4X, - GAINCEILING_8X, - GAINCEILING_16X, - GAINCEILING_32X, - GAINCEILING_64X, - GAINCEILING_128X, -} gainceiling_t; - -typedef struct { - uint8_t MIDH; - uint8_t MIDL; - uint8_t PID; - uint8_t VER; -} sensor_id_t; - -typedef struct { - framesize_t framesize;//0 - 10 - uint8_t quality;//0 - 63 - int8_t brightness;//-2 - 2 - int8_t contrast;//-2 - 2 - int8_t saturation;//-2 - 2 - int8_t sharpness;//-2 - 2 - uint8_t denoise; - uint8_t special_effect;//0 - 6 - uint8_t wb_mode;//0 - 4 - uint8_t awb; - uint8_t awb_gain; - uint8_t aec; - uint8_t aec2; - int8_t ae_level;//-2 - 2 - uint16_t aec_value;//0 - 1200 - uint8_t agc; - uint8_t agc_gain;//0 - 30 - uint8_t gainceiling;//0 - 6 - uint8_t bpc; - uint8_t wpc; - uint8_t raw_gma; - uint8_t lenc; - uint8_t hmirror; - uint8_t vflip; - uint8_t dcw; - uint8_t colorbar; -} camera_status_t; - -typedef struct _sensor sensor_t; -typedef struct _sensor { - sensor_id_t id; // Sensor ID. - uint8_t slv_addr; // Sensor I2C slave address. - pixformat_t pixformat; - camera_status_t status; - int xclk_freq_hz; - - // Sensor function pointers - int (*init_status) (sensor_t *sensor); - int (*reset) (sensor_t *sensor); - int (*set_pixformat) (sensor_t *sensor, pixformat_t pixformat); - int (*set_framesize) (sensor_t *sensor, framesize_t framesize); - int (*set_contrast) (sensor_t *sensor, int level); - int (*set_brightness) (sensor_t *sensor, int level); - int (*set_saturation) (sensor_t *sensor, int level); - int (*set_sharpness) (sensor_t *sensor, int level); - int (*set_denoise) (sensor_t *sensor, int level); - int (*set_gainceiling) (sensor_t *sensor, gainceiling_t gainceiling); - int (*set_quality) (sensor_t *sensor, int quality); - int (*set_colorbar) (sensor_t *sensor, int enable); - int (*set_whitebal) (sensor_t *sensor, int enable); - int (*set_gain_ctrl) (sensor_t *sensor, int enable); - int (*set_exposure_ctrl) (sensor_t *sensor, int enable); - int (*set_hmirror) (sensor_t *sensor, int enable); - int (*set_vflip) (sensor_t *sensor, int enable); - - int (*set_aec2) (sensor_t *sensor, int enable); - int (*set_awb_gain) (sensor_t *sensor, int enable); - int (*set_agc_gain) (sensor_t *sensor, int gain); - int (*set_aec_value) (sensor_t *sensor, int gain); - - int (*set_special_effect) (sensor_t *sensor, int effect); - int (*set_wb_mode) (sensor_t *sensor, int mode); - int (*set_ae_level) (sensor_t *sensor, int level); - - int (*set_dcw) (sensor_t *sensor, int enable); - int (*set_bpc) (sensor_t *sensor, int enable); - int (*set_wpc) (sensor_t *sensor, int enable); - - int (*set_raw_gma) (sensor_t *sensor, int enable); - int (*set_lenc) (sensor_t *sensor, int enable); -} sensor_t; - -// Resolution table (in camera.c) -extern const int resolution[][2]; - -#endif /* __SENSOR_H__ */ diff --git a/tools/sdk/include/esp32/esp32/pm.h b/tools/sdk/include/esp32/esp32/pm.h deleted file mode 100644 index f64045fb31b..00000000000 --- a/tools/sdk/include/esp32/esp32/pm.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2016-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. - - -#pragma once -#include -#include -#include "esp_err.h" - -#include "soc/rtc.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -/** - * @brief Power management config for ESP32 - * - * Pass a pointer to this structure as an argument to esp_pm_configure function. - */ -typedef struct { - rtc_cpu_freq_t max_cpu_freq __attribute__((deprecated)); /*!< Maximum CPU frequency to use. Deprecated, use max_freq_mhz instead. */ - int max_freq_mhz; /*!< Maximum CPU frequency, in MHz */ - rtc_cpu_freq_t min_cpu_freq __attribute__((deprecated)); /*!< Minimum CPU frequency to use when no frequency locks are taken. Deprecated, use min_freq_mhz instead. */ - int min_freq_mhz; /*!< Minimum CPU frequency to use when no locks are taken, in MHz */ - bool light_sleep_enable; /*!< Enter light sleep when no locks are taken */ -} esp_pm_config_esp32_t; - - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/esp32/esp_assert.h b/tools/sdk/include/esp32/esp_assert.h deleted file mode 100644 index 39d6a32843f..00000000000 --- a/tools/sdk/include/esp32/esp_assert.h +++ /dev/null @@ -1,37 +0,0 @@ -// 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. -#ifndef __ESP_ASSERT_H__ -#define __ESP_ASSERT_H__ - -#include "assert.h" - -/* Assert at compile time if possible, runtime otherwise */ -#ifndef __cplusplus -/* __builtin_choose_expr() is only in C, makes this a lot cleaner */ -#define TRY_STATIC_ASSERT(CONDITION, MSG) do { \ - _Static_assert(__builtin_choose_expr(__builtin_constant_p(CONDITION), (CONDITION), 1), #MSG); \ - assert(#MSG && (CONDITION)); \ - } while(0) -#else -/* for C++, use __attribute__((error)) - works almost as well as _Static_assert */ -#define TRY_STATIC_ASSERT(CONDITION, MSG) do { \ - if (__builtin_constant_p(CONDITION) && !(CONDITION)) { \ - extern __attribute__((error(#MSG))) void failed_compile_time_assert(void); \ - failed_compile_time_assert(); \ - } \ - assert(#MSG && (CONDITION)); \ - } while(0) -#endif /* __cplusplus */ - -#endif /* __ESP_ASSERT_H__ */ diff --git a/tools/sdk/include/esp32/esp_attr.h b/tools/sdk/include/esp32/esp_attr.h deleted file mode 100644 index 6d2d5ea84d4..00000000000 --- a/tools/sdk/include/esp32/esp_attr.h +++ /dev/null @@ -1,74 +0,0 @@ -// 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. -#ifndef __ESP_ATTR_H__ -#define __ESP_ATTR_H__ - -#define ROMFN_ATTR - -//Normally, the linker script will put all code and rodata in flash, -//and all variables in shared RAM. These macros can be used to redirect -//particular functions/variables to other memory regions. - -// Forces code into IRAM instead of flash. -#define IRAM_ATTR __attribute__((section(".iram1"))) - -// Forces data into DRAM instead of flash -#define DRAM_ATTR __attribute__((section(".dram1"))) - -// Forces data to be 4 bytes aligned -#define WORD_ALIGNED_ATTR __attribute__((aligned(4))) - -// Forces data to be placed to DMA-capable places -#define DMA_ATTR WORD_ALIGNED_ATTR DRAM_ATTR - -// Forces a string into DRAM instead of flash -// Use as ets_printf(DRAM_STR("Hello world!\n")); -#define DRAM_STR(str) (__extension__({static const DRAM_ATTR char __c[] = (str); (const char *)&__c;})) - -// Forces code into RTC fast memory. See "docs/deep-sleep-stub.rst" -#define RTC_IRAM_ATTR __attribute__((section(".rtc.text"))) - -#if CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY -// Forces bss variable into external memory. " -#define EXT_RAM_ATTR __attribute__((section(".ext_ram.bss"))) -#else -#define EXT_RAM_ATTR -#endif - -// Forces data into RTC slow memory. See "docs/deep-sleep-stub.rst" -// Any variable marked with this attribute will keep its value -// during a deep sleep / wake cycle. -#define RTC_DATA_ATTR __attribute__((section(".rtc.data"))) - -// Forces read-only data into RTC memory. See "docs/deep-sleep-stub.rst" -#define RTC_RODATA_ATTR __attribute__((section(".rtc.rodata"))) - -// Allows to place data into RTC_SLOW memory. -#define RTC_SLOW_ATTR __attribute__((section(".rtc.force_slow"))) - -// Allows to place data into RTC_FAST memory. -#define RTC_FAST_ATTR __attribute__((section(".rtc.force_fast"))) - -// Forces data into noinit section to avoid initialization after restart. -#define __NOINIT_ATTR __attribute__((section(".noinit"))) - -// Forces data into RTC slow memory of .noinit section. -// Any variable marked with this attribute will keep its value -// after restart or during a deep sleep / wake cycle. -#define RTC_NOINIT_ATTR __attribute__((section(".rtc_noinit"))) - -// Forces to not inline function -#define NOINLINE_ATTR __attribute__((noinline)) - -#endif /* __ESP_ATTR_H__ */ diff --git a/tools/sdk/include/esp32/esp_brownout.h b/tools/sdk/include/esp32/esp_brownout.h deleted file mode 100644 index 5a0b1aec001..00000000000 --- a/tools/sdk/include/esp32/esp_brownout.h +++ /dev/null @@ -1,21 +0,0 @@ -// 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. - - -#ifndef __ESP_BROWNOUT_H -#define __ESP_BROWNOUT_H - -void esp_brownout_init(); - -#endif \ No newline at end of file diff --git a/tools/sdk/include/esp32/esp_cache_err_int.h b/tools/sdk/include/esp32/esp_cache_err_int.h deleted file mode 100644 index bcbd63e7998..00000000000 --- a/tools/sdk/include/esp32/esp_cache_err_int.h +++ /dev/null @@ -1,33 +0,0 @@ -// 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. - - -/** - * @brief initialize cache invalid access interrupt - * - * This function enables cache invalid access interrupt source and connects it - * to interrupt input number ETS_CACHEERR_INUM (see soc/soc.h). It is called - * from the startup code. - */ -void esp_cache_err_int_init(); - - -/** - * @brief get the CPU which caused cache invalid access interrupt - * @return - * - PRO_CPU_NUM, if PRO_CPU has caused cache IA interrupt - * - APP_CPU_NUM, if APP_CPU has caused cache IA interrupt - * - (-1) otherwise - */ -int esp_cache_err_get_cpuid(); diff --git a/tools/sdk/include/esp32/esp_clk.h b/tools/sdk/include/esp32/esp_clk.h deleted file mode 100644 index 1a91d26f91c..00000000000 --- a/tools/sdk/include/esp32/esp_clk.h +++ /dev/null @@ -1,86 +0,0 @@ -// 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. - -#pragma once - -/** - * @file esp_clk.h - * - * This file contains declarations of clock related functions. - */ - -/** - * @brief Get the calibration value of RTC slow clock - * - * The value is in the same format as returned by rtc_clk_cal (microseconds, - * in Q13.19 fixed-point format). - * - * @return the calibration value obtained using rtc_clk_cal, at startup time - */ -uint32_t esp_clk_slowclk_cal_get(); - -/** - * @brief Update the calibration value of RTC slow clock - * - * The value has to be in the same format as returned by rtc_clk_cal (microseconds, - * in Q13.19 fixed-point format). - * This value is used by timekeeping functions (such as gettimeofday) to - * calculate current time based on RTC counter value. - * @param value calibration value obtained using rtc_clk_cal - */ -void esp_clk_slowclk_cal_set(uint32_t value); - -/** - * @brief Return current CPU clock frequency - * When frequency switching is performed, this frequency may change. - * However it is guaranteed that the frequency never changes with a critical - * section. - * - * @return CPU clock frequency, in Hz - */ -int esp_clk_cpu_freq(void); - -/** - * @brief Return current APB clock frequency - * - * When frequency switching is performed, this frequency may change. - * However it is guaranteed that the frequency never changes with a critical - * section. - * - * @return APB clock frequency, in Hz - */ -int esp_clk_apb_freq(void); - -/** - * @brief Return frequency of the main XTAL - * - * Frequency of the main XTAL can be either auto-detected or set at compile - * time (see CONFIG_ESP32_XTAL_FREQ_SEL sdkconfig option). In both cases, this - * function returns the actual value at run time. - * - * @return XTAL frequency, in Hz - */ -int esp_clk_xtal_freq(void); - - -/** - * @brief Read value of RTC counter, converting it to microseconds - * @attention The value returned by this function may change abruptly when - * calibration value of RTC counter is updated via esp_clk_slowclk_cal_set - * function. This should not happen unless application calls esp_clk_slowclk_cal_set. - * In ESP-IDF, esp_clk_slowclk_cal_set is only called in startup code. - * - * @return Value or RTC counter, expressed in microseconds - */ -uint64_t esp_clk_rtc_time(); diff --git a/tools/sdk/include/esp32/esp_coexist.h b/tools/sdk/include/esp32/esp_coexist.h deleted file mode 100644 index c9b241d3dc6..00000000000 --- a/tools/sdk/include/esp32/esp_coexist.h +++ /dev/null @@ -1,59 +0,0 @@ -// 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. - -#ifndef __ESP_COEXIST_H__ -#define __ESP_COEXIST_H__ - -#include -#include "esp_err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief coex prefer value - */ -typedef enum { - ESP_COEX_PREFER_WIFI = 0, /*!< Prefer to WiFi, WiFi will have more opportunity to use RF */ - ESP_COEX_PREFER_BT, /*!< Prefer to bluetooth, bluetooth will have more opportunity to use RF */ - ESP_COEX_PREFER_BALANCE, /*!< Do balance of WiFi and bluetooth */ - ESP_COEX_PREFER_NUM, /*!< Prefer value numbers */ -} esp_coex_prefer_t; - -/** - * @brief Get software coexist version string - * - * @return : version string - */ -const char *esp_coex_version_get(void); - -/** - * @brief Set coexist preference of performance - * For example, if prefer to bluetooth, then it will make A2DP(play audio via classic bt) - * more smooth while wifi is runnning something. - * If prefer to wifi, it will do similar things as prefer to bluetooth. - * Default, it prefer to balance. - * - * @param prefer : the prefer enumeration value - * @return : ESP_OK - success, other - failed - */ -esp_err_t esp_coex_preference_set(esp_coex_prefer_t prefer); - -#ifdef __cplusplus -} -#endif - - -#endif /* __ESP_COEXIST_H__ */ diff --git a/tools/sdk/include/esp32/esp_coexist_adapter.h b/tools/sdk/include/esp32/esp_coexist_adapter.h deleted file mode 100644 index f2a38c31e63..00000000000 --- a/tools/sdk/include/esp32/esp_coexist_adapter.h +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2019 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. - -#ifndef __ESP_COEXIST_ADAPTER_H__ -#define __ESP_COEXIST_ADAPTER_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define COEX_ADAPTER_VERSION 0x00000001 -#define COEX_ADAPTER_MAGIC 0xDEADBEAF - -#define COEX_ADAPTER_FUNCS_TIME_BLOCKING 0xffffffff - -typedef struct { - int32_t _version; - void *(* _spin_lock_create)(void); - void (* _spin_lock_delete)(void *lock); - uint32_t (*_int_disable)(void *mux); - void (*_int_enable)(void *mux, uint32_t tmp); - void (*_task_yield_from_isr)(void); - void *(*_semphr_create)(uint32_t max, uint32_t init); - void (*_semphr_delete)(void *semphr); - int32_t (*_semphr_take_from_isr)(void *semphr, void *hptw); - int32_t (*_semphr_give_from_isr)(void *semphr, void *hptw); - int32_t (*_semphr_take)(void *semphr, uint32_t block_time_tick); - int32_t (*_semphr_give)(void *semphr); - int32_t (* _is_in_isr)(void); - void * (* _malloc_internal)(size_t size); - void (* _free)(void *p); - void (* _timer_disarm)(void *timer); - void (* _timer_done)(void *ptimer); - void (* _timer_setfn)(void *ptimer, void *pfunction, void *parg); - void (* _timer_arm_us)(void *ptimer, uint32_t us, bool repeat); - int64_t (* _esp_timer_get_time)(void); - int32_t _magic; -} coex_adapter_funcs_t; - -extern coex_adapter_funcs_t g_coex_adapter_funcs; - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_COEXIST_ADAPTER_H__ */ diff --git a/tools/sdk/include/esp32/esp_coexist_internal.h b/tools/sdk/include/esp32/esp_coexist_internal.h deleted file mode 100644 index 1d94d6db796..00000000000 --- a/tools/sdk/include/esp32/esp_coexist_internal.h +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright 2018-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. - -#ifndef __ESP_COEXIST_INTERNAL_H__ -#define __ESP_COEXIST_INTERNAL_H__ - -#include -#include "esp_coexist_adapter.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - COEX_PREFER_WIFI = 0, - COEX_PREFER_BT, - COEX_PREFER_BALANCE, - COEX_PREFER_NUM, -} coex_prefer_t; - -typedef void (* coex_func_cb_t)(uint32_t event, int sched_cnt); - -/** - * @brief Init software coexist - * extern function for internal use. - * - * @return Init ok or failed. - */ -esp_err_t coex_init(void); - -/** - * @brief De-init software coexist - * extern function for internal use. - */ -void coex_deinit(void); - -/** - * @brief Pause software coexist - * extern function for internal use. - */ -void coex_pause(void); - -/** - * @brief Resume software coexist - * extern function for internal use. - */ -void coex_resume(void); - -/** - * @brief Get software coexist version string - * extern function for internal use. - * @return : version string - */ -const char *coex_version_get(void); - -/** - * @brief Coexist performance preference set from libbt.a - * extern function for internal use. - * - * @param prefer : the prefer enumeration value - * @return : ESP_OK - success, other - failed - */ -esp_err_t coex_preference_set(coex_prefer_t prefer); - -/** - * @brief Get software coexist status. - * @return : software coexist status - */ -uint32_t coex_status_get(void); - -/** - * @brief WiFi requests coexistence. - * - * @param event : WiFi event - * @param latency : WiFi will request coexistence after latency - * @param duration : duration for WiFi to request coexistence - * @return : 0 - success, other - failed - */ -int coex_wifi_request(uint32_t event, uint32_t latency, uint32_t duration); - -/** - * @brief WiFi release coexistence. - * - * @param event : WiFi event - * @return : 0 - success, other - failed - */ -int coex_wifi_release(uint32_t event); - -/** - * @brief Blue tooth requests coexistence. - * - * @param event : blue tooth event - * @param latency : blue tooth will request coexistence after latency - * @param duration : duration for blue tooth to request coexistence - * @return : 0 - success, other - failed - */ -int coex_bt_request(uint32_t event, uint32_t latency, uint32_t duration); - -/** - * @brief Blue tooth release coexistence. - * - * @param event : blue tooth event - * @return : 0 - success, other - failed - */ -int coex_bt_release(uint32_t event); - -/** - * @brief Register callback function for blue tooth. - * - * @param cb : callback function - * @return : 0 - success, other - failed - */ -int coex_register_bt_cb(coex_func_cb_t cb); - -/** - * @brief Lock before reset base band. - * - * @return : lock value - */ -uint32_t coex_bb_reset_lock(void); - -/** - * @brief Unlock after reset base band. - * - * @param restore : lock value - */ -void coex_bb_reset_unlock(uint32_t restore); - -/** - * @brief Register coexistence adapter functions. - * - * @param funcs : coexistence adapter functions - * @return : ESP_OK - success, other - failed - */ -esp_err_t esp_coex_adapter_register(coex_adapter_funcs_t *funcs); - -/** - * @brief Check the MD5 values of the coexistence adapter header files in IDF and WiFi library - * - * @attention 1. It is used for internal CI version check - * - * @return - * - ESP_OK : succeed - * - ESP_WIFI_INVALID_ARG : MD5 check fail - */ -esp_err_t esp_coex_adapter_funcs_md5_check(const char *md5); - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_COEXIST_INTERNAL_H__ */ diff --git a/tools/sdk/include/esp32/esp_core_dump.h b/tools/sdk/include/esp32/esp_core_dump.h deleted file mode 100644 index c6634364c52..00000000000 --- a/tools/sdk/include/esp32/esp_core_dump.h +++ /dev/null @@ -1,64 +0,0 @@ -// 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. -#ifndef ESP_CORE_DUMP_H_ -#define ESP_CORE_DUMP_H_ - -/** - * @brief Initializes core dump module internal data. - * - * @note Should be called at system startup. - */ -void esp_core_dump_init(); - -/** - * @brief Saves core dump to flash. - * - * The structure of data stored in flash is as follows: - * | MAGIC1 | - * | TOTAL_LEN | TASKS_NUM | TCB_SIZE | - * | TCB_ADDR_1 | STACK_TOP_1 | STACK_END_1 | TCB_1 | STACK_1 | - * . . . . - * . . . . - * | TCB_ADDR_N | STACK_TOP_N | STACK_END_N | TCB_N | STACK_N | - * | MAGIC2 | - * Core dump in flash consists of header and data for every task in the system at the moment of crash. - * For flash data integrity control two magic numbers are used at the beginning and the end of core dump. - * The structure of core dump data is described below in details. - * 1) MAGIC1 and MAGIC2 are special numbers stored at the beginning and the end of core dump. - * They are used to control core dump data integrity. Size of every number is 4 bytes. - * 2) Core dump starts with header: - * 2.1) TOTAL_LEN is total length of core dump data in flash including magic numbers. Size is 4 bytes. - * 2.2) TASKS_NUM is the number of tasks for which data are stored. Size is 4 bytes. - * 2.3) TCB_SIZE is the size of task's TCB structure. Size is 4 bytes. - * 3) Core dump header is followed by the data for every task in the system. - * Task data are started with task header: - * 3.1) TCB_ADDR is the address of TCB in memory. Size is 4 bytes. - * 3.2) STACK_TOP is the top of task's stack (address of the topmost stack item). Size is 4 bytes. - * 3.2) STACK_END is the end of task's stack (address from which task's stack starts). Size is 4 bytes. - * 4) Task header is followed by TCB data. Size is TCB_SIZE bytes. - * 5) Task's stack is placed after TCB data. Size is (STACK_END - STACK_TOP) bytes. - */ -void esp_core_dump_to_flash(); - -/** - * @brief Print base64-encoded core dump to UART. - * - * The structure of core dump data is the same as for data stored in flash (@see esp_core_dump_to_flash) with some notes: - * 1) Magic numbers are not present in core dump printed to UART. - * 2) Since magic numbers are omitted TOTAL_LEN does not include their size. - * 3) Printed base64 data are surrounded with special messages to help user recognize the start and end of actual data. - */ -void esp_core_dump_to_uart(); - -#endif diff --git a/tools/sdk/include/esp32/esp_crosscore_int.h b/tools/sdk/include/esp32/esp_crosscore_int.h deleted file mode 100644 index 2f1c5b3becf..00000000000 --- a/tools/sdk/include/esp32/esp_crosscore_int.h +++ /dev/null @@ -1,54 +0,0 @@ -// 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. -#ifndef __ESP_CROSSCORE_INT_H -#define __ESP_CROSSCORE_INT_H - - -/** - * Initialize the crosscore interrupt system for this CPU. - * This needs to be called once on every CPU that is used - * by FreeRTOS. - * - * If multicore FreeRTOS support is enabled, this will be - * called automatically by the startup code and should not - * be called manually. - */ -void esp_crosscore_int_init(); - - -/** - * Send an interrupt to a CPU indicating it should yield its - * currently running task in favour of a higher-priority task - * that presumably just woke up. - * - * This is used internally by FreeRTOS in multicore mode - * and should not be called by the user. - * - * @param core_id Core that should do the yielding - */ -void esp_crosscore_int_send_yield(int core_id); - - -/** - * Send an interrupt to a CPU indicating it should update its - * CCOMPARE1 value due to a frequency switch. - * - * This is used internally when dynamic frequency switching is - * enabled, and should not be called from application code. - * - * @param core_id Core that should update its CCOMPARE1 value - */ -void esp_crosscore_int_send_freq_switch(int core_id); - -#endif diff --git a/tools/sdk/include/esp32/esp_dbg_stubs.h b/tools/sdk/include/esp32/esp_dbg_stubs.h deleted file mode 100644 index 899dfa56ed8..00000000000 --- a/tools/sdk/include/esp32/esp_dbg_stubs.h +++ /dev/null @@ -1,50 +0,0 @@ -// 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. -#ifndef ESP_DBG_STUBS_H_ -#define ESP_DBG_STUBS_H_ - -#include "esp_err.h" - -/** - * Debug stubs entries IDs - */ -typedef enum { - ESP_DBG_STUB_CONTROL_DATA, ///< stubs descriptor entry - ESP_DBG_STUB_ENTRY_FIRST, - ESP_DBG_STUB_ENTRY_GCOV ///< GCOV entry - = ESP_DBG_STUB_ENTRY_FIRST, - ESP_DBG_STUB_ENTRY_MAX -} esp_dbg_stub_id_t; - -/** - * @brief Initializes debug stubs. - * - * @note Must be called after esp_apptrace_init() if app tracing is enabled. - */ -void esp_dbg_stubs_init(void); - -/** - * @brief Initializes application tracing module. - * - * @note Should be called before any esp_apptrace_xxx call. - * - * @param id Stub ID. - * @param entry Stub entry. Usually it is stub entry function address, - * but can be any value meaningfull for OpenOCD command/code. - * - * @return ESP_OK on success, otherwise see esp_err_t - */ -esp_err_t esp_dbg_stub_entry_set(esp_dbg_stub_id_t id, uint32_t entry); - -#endif //ESP_DBG_STUBS_H_ \ No newline at end of file diff --git a/tools/sdk/include/esp32/esp_deep_sleep.h b/tools/sdk/include/esp32/esp_deep_sleep.h deleted file mode 100644 index ea4601818a5..00000000000 --- a/tools/sdk/include/esp32/esp_deep_sleep.h +++ /dev/null @@ -1,94 +0,0 @@ -// 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. - -#pragma once - -/** - * @file esp_deep_sleep.h - * @brief legacy definitions of esp_deep_sleep APIs - * - * This file provides compatibility for applications using esp_deep_sleep_* APIs. - * New applications should use functions defined in "esp_sleep.h" instead. - * These functions and types will be deprecated at some point. - */ - -#warning esp_deep_sleep.h will be deprecated in the next release. Use esp_sleep.h instead. - -#include "esp_sleep.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef esp_sleep_pd_domain_t esp_deep_sleep_pd_domain_t; -typedef esp_sleep_pd_option_t esp_deep_sleep_pd_option_t; -typedef esp_sleep_ext1_wakeup_mode_t esp_ext1_wakeup_mode_t; -typedef esp_sleep_wakeup_cause_t esp_deep_sleep_wakeup_cause_t; - -inline static esp_err_t esp_deep_sleep_enable_ulp_wakeup(void) -{ - return esp_sleep_enable_ulp_wakeup(); -} - -inline static esp_err_t esp_deep_sleep_enable_timer_wakeup(uint64_t time_in_us) -{ - return esp_sleep_enable_timer_wakeup(time_in_us); -} - -inline static esp_err_t esp_deep_sleep_enable_touchpad_wakeup(void) -{ - return esp_sleep_enable_touchpad_wakeup(); -} - -inline static touch_pad_t esp_deep_sleep_get_touchpad_wakeup_status() -{ - return esp_sleep_get_touchpad_wakeup_status(); -} - -inline static esp_err_t esp_deep_sleep_enable_ext0_wakeup(gpio_num_t gpio_num, int level) -{ - return esp_sleep_enable_ext0_wakeup(gpio_num, level); -} - -inline static esp_err_t esp_deep_sleep_enable_ext1_wakeup(uint64_t mask, esp_ext1_wakeup_mode_t mode) -{ - return esp_sleep_enable_ext1_wakeup(mask, mode); -} - -inline static esp_err_t esp_deep_sleep_pd_config( - esp_deep_sleep_pd_domain_t domain, - esp_deep_sleep_pd_option_t option) -{ - return esp_sleep_pd_config(domain, option); -} - -inline static esp_deep_sleep_wakeup_cause_t esp_deep_sleep_get_wakeup_cause() -{ - return esp_sleep_get_wakeup_cause(); -} - -#define ESP_DEEP_SLEEP_WAKEUP_UNDEFINED ESP_SLEEP_WAKEUP_UNDEFINED -#define ESP_DEEP_SLEEP_WAKEUP_EXT0 ESP_SLEEP_WAKEUP_EXT0 -#define ESP_DEEP_SLEEP_WAKEUP_EXT1 ESP_SLEEP_WAKEUP_EXT1 -#define ESP_DEEP_SLEEP_WAKEUP_TIMER ESP_SLEEP_WAKEUP_TIMER -#define ESP_DEEP_SLEEP_WAKEUP_TOUCHPAD ESP_SLEEP_WAKEUP_TOUCHPAD -#define ESP_DEEP_SLEEP_WAKEUP_ULP ESP_SLEEP_WAKEUP_ULP - - - -#ifdef __cplusplus -} -#endif - diff --git a/tools/sdk/include/esp32/esp_deepsleep.h b/tools/sdk/include/esp32/esp_deepsleep.h deleted file mode 100644 index 3f0151b6a81..00000000000 --- a/tools/sdk/include/esp32/esp_deepsleep.h +++ /dev/null @@ -1,2 +0,0 @@ -#warning esp_deepsleep.h has been renamed to esp_sleep.h, please update include directives -#include "esp_sleep.h" diff --git a/tools/sdk/include/esp32/esp_dport_access.h b/tools/sdk/include/esp32/esp_dport_access.h deleted file mode 100644 index 8ea60c4cdb0..00000000000 --- a/tools/sdk/include/esp32/esp_dport_access.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2010-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. - -#include - -#ifndef _ESP_DPORT_ACCESS_H_ -#define _ESP_DPORT_ACCESS_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -void esp_dport_access_stall_other_cpu_start(void); -void esp_dport_access_stall_other_cpu_end(void); -void esp_dport_access_int_init(void); -void esp_dport_access_int_pause(void); -void esp_dport_access_int_resume(void); -void esp_dport_access_read_buffer(uint32_t *buff_out, uint32_t address, uint32_t num_words); -uint32_t esp_dport_access_reg_read(uint32_t reg); -uint32_t esp_dport_access_sequence_reg_read(uint32_t reg); -//This routine does not stop the dport routines in any way that is recoverable. Please -//only call in case of panic(). -void esp_dport_access_int_abort(void); - -#if defined(BOOTLOADER_BUILD) || !defined(CONFIG_ESP32_DPORT_WORKAROUND) || !defined(ESP_PLATFORM) -#define DPORT_STALL_OTHER_CPU_START() -#define DPORT_STALL_OTHER_CPU_END() -#define DPORT_INTERRUPT_DISABLE() -#define DPORT_INTERRUPT_RESTORE() -#else -#define DPORT_STALL_OTHER_CPU_START() esp_dport_access_stall_other_cpu_start() -#define DPORT_STALL_OTHER_CPU_END() esp_dport_access_stall_other_cpu_end() -#define DPORT_INTERRUPT_DISABLE() unsigned int intLvl = XTOS_SET_INTLEVEL(CONFIG_ESP32_DPORT_DIS_INTERRUPT_LVL) -#define DPORT_INTERRUPT_RESTORE() XTOS_RESTORE_JUST_INTLEVEL(intLvl) -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* _ESP_DPORT_ACCESS_H_ */ diff --git a/tools/sdk/include/esp32/esp_err.h b/tools/sdk/include/esp32/esp_err.h deleted file mode 100644 index 6672f233a19..00000000000 --- a/tools/sdk/include/esp32/esp_err.h +++ /dev/null @@ -1,148 +0,0 @@ -// 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. -#pragma once - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef int32_t esp_err_t; - -/* Definitions for error constants. */ -#define ESP_OK 0 /*!< esp_err_t value indicating success (no error) */ -#define ESP_FAIL -1 /*!< Generic esp_err_t code indicating failure */ - -#define ESP_ERR_NO_MEM 0x101 /*!< Out of memory */ -#define ESP_ERR_INVALID_ARG 0x102 /*!< Invalid argument */ -#define ESP_ERR_INVALID_STATE 0x103 /*!< Invalid state */ -#define ESP_ERR_INVALID_SIZE 0x104 /*!< Invalid size */ -#define ESP_ERR_NOT_FOUND 0x105 /*!< Requested resource not found */ -#define ESP_ERR_NOT_SUPPORTED 0x106 /*!< Operation or feature not supported */ -#define ESP_ERR_TIMEOUT 0x107 /*!< Operation timed out */ -#define ESP_ERR_INVALID_RESPONSE 0x108 /*!< Received response was invalid */ -#define ESP_ERR_INVALID_CRC 0x109 /*!< CRC or checksum was invalid */ -#define ESP_ERR_INVALID_VERSION 0x10A /*!< Version was invalid */ -#define ESP_ERR_INVALID_MAC 0x10B /*!< MAC address was invalid */ - -#define ESP_ERR_WIFI_BASE 0x3000 /*!< Starting number of WiFi error codes */ -#define ESP_ERR_MESH_BASE 0x4000 /*!< Starting number of MESH error codes */ - -/** - * @brief Returns string for esp_err_t error codes - * - * This function finds the error code in a pre-generated lookup-table and - * returns its string representation. - * - * The function is generated by the Python script - * tools/gen_esp_err_to_name.py which should be run each time an esp_err_t - * error is modified, created or removed from the IDF project. - * - * @param code esp_err_t error code - * @return string error message - */ -const char *esp_err_to_name(esp_err_t code); - -/** - * @brief Returns string for esp_err_t and system error codes - * - * This function finds the error code in a pre-generated lookup-table of - * esp_err_t errors and returns its string representation. If the error code - * is not found then it is attempted to be found among system errors. - * - * The function is generated by the Python script - * tools/gen_esp_err_to_name.py which should be run each time an esp_err_t - * error is modified, created or removed from the IDF project. - * - * @param code esp_err_t error code - * @param[out] buf buffer where the error message should be written - * @param buflen Size of buffer buf. At most buflen bytes are written into the buf buffer (including the terminating null byte). - * @return buf containing the string error message - */ -const char *esp_err_to_name_r(esp_err_t code, char *buf, size_t buflen); - -/** @cond */ -void _esp_error_check_failed(esp_err_t rc, const char *file, int line, const char *function, const char *expression) __attribute__((noreturn)); - -/** @cond */ -void _esp_error_check_failed_without_abort(esp_err_t rc, const char *file, int line, const char *function, const char *expression); - -#ifndef __ASSERT_FUNC -/* This won't happen on IDF, which defines __ASSERT_FUNC in assert.h, but it does happen when building on the host which - uses /usr/include/assert.h or equivalent. -*/ -#ifdef __ASSERT_FUNCTION -#define __ASSERT_FUNC __ASSERT_FUNCTION /* used in glibc assert.h */ -#else -#define __ASSERT_FUNC "??" -#endif -#endif -/** @endcond */ - -/** - * Macro which can be used to check the error code, - * and terminate the program in case the code is not ESP_OK. - * Prints the error code, error location, and the failed statement to serial output. - * - * Disabled if assertions are disabled. - */ -#ifdef NDEBUG -#define ESP_ERROR_CHECK(x) do { \ - esp_err_t __err_rc = (x); \ - (void) sizeof(__err_rc); \ - } while(0); -#elif defined(CONFIG_OPTIMIZATION_ASSERTIONS_SILENT) -#define ESP_ERROR_CHECK(x) do { \ - esp_err_t __err_rc = (x); \ - if (__err_rc != ESP_OK) { \ - abort(); \ - } \ - } while(0); -#else -#define ESP_ERROR_CHECK(x) do { \ - esp_err_t __err_rc = (x); \ - if (__err_rc != ESP_OK) { \ - _esp_error_check_failed(__err_rc, __FILE__, __LINE__, \ - __ASSERT_FUNC, #x); \ - } \ - } while(0); -#endif - -/** - * Macro which can be used to check the error code. Prints the error code, error location, and the failed statement to - * serial output. - * In comparison with ESP_ERROR_CHECK(), this prints the same error message but isn't terminating the program. - */ -#ifdef NDEBUG -#define ESP_ERROR_CHECK_WITHOUT_ABORT(x) ({ \ - esp_err_t __err_rc = (x); \ - __err_rc; \ - }) -#else -#define ESP_ERROR_CHECK_WITHOUT_ABORT(x) ({ \ - esp_err_t __err_rc = (x); \ - if (__err_rc != ESP_OK) { \ - _esp_error_check_failed_without_abort(__err_rc, __FILE__, __LINE__, \ - __ASSERT_FUNC, #x); \ - } \ - __err_rc; \ - }) -#endif //NDEBUG - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/esp32/esp_event_legacy.h b/tools/sdk/include/esp32/esp_event_legacy.h deleted file mode 100644 index a2518841819..00000000000 --- a/tools/sdk/include/esp32/esp_event_legacy.h +++ /dev/null @@ -1,188 +0,0 @@ -// 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. - -#ifndef __ESP_EVENT_H__ -#define __ESP_EVENT_H__ - -#include -#include - -#include "esp_err.h" -#include "esp_wifi_types.h" -#include "tcpip_adapter.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - SYSTEM_EVENT_WIFI_READY = 0, /**< ESP32 WiFi ready */ - SYSTEM_EVENT_SCAN_DONE, /**< ESP32 finish scanning AP */ - SYSTEM_EVENT_STA_START, /**< ESP32 station start */ - SYSTEM_EVENT_STA_STOP, /**< ESP32 station stop */ - SYSTEM_EVENT_STA_CONNECTED, /**< ESP32 station connected to AP */ - SYSTEM_EVENT_STA_DISCONNECTED, /**< ESP32 station disconnected from AP */ - SYSTEM_EVENT_STA_AUTHMODE_CHANGE, /**< the auth mode of AP connected by ESP32 station changed */ - SYSTEM_EVENT_STA_GOT_IP, /**< ESP32 station got IP from connected AP */ - SYSTEM_EVENT_STA_LOST_IP, /**< ESP32 station lost IP and the IP is reset to 0 */ - SYSTEM_EVENT_STA_WPS_ER_SUCCESS, /**< ESP32 station wps succeeds in enrollee mode */ - SYSTEM_EVENT_STA_WPS_ER_FAILED, /**< ESP32 station wps fails in enrollee mode */ - SYSTEM_EVENT_STA_WPS_ER_TIMEOUT, /**< ESP32 station wps timeout in enrollee mode */ - SYSTEM_EVENT_STA_WPS_ER_PIN, /**< ESP32 station wps pin code in enrollee mode */ - SYSTEM_EVENT_STA_WPS_ER_PBC_OVERLAP, /*!< ESP32 station wps overlap in enrollee mode */ - SYSTEM_EVENT_AP_START, /**< ESP32 soft-AP start */ - SYSTEM_EVENT_AP_STOP, /**< ESP32 soft-AP stop */ - SYSTEM_EVENT_AP_STACONNECTED, /**< a station connected to ESP32 soft-AP */ - SYSTEM_EVENT_AP_STADISCONNECTED, /**< a station disconnected from ESP32 soft-AP */ - SYSTEM_EVENT_AP_STAIPASSIGNED, /**< ESP32 soft-AP assign an IP to a connected station */ - SYSTEM_EVENT_AP_PROBEREQRECVED, /**< Receive probe request packet in soft-AP interface */ - SYSTEM_EVENT_GOT_IP6, /**< ESP32 station or ap or ethernet interface v6IP addr is preferred */ - SYSTEM_EVENT_ETH_START, /**< ESP32 ethernet start */ - SYSTEM_EVENT_ETH_STOP, /**< ESP32 ethernet stop */ - SYSTEM_EVENT_ETH_CONNECTED, /**< ESP32 ethernet phy link up */ - SYSTEM_EVENT_ETH_DISCONNECTED, /**< ESP32 ethernet phy link down */ - SYSTEM_EVENT_ETH_GOT_IP, /**< ESP32 ethernet got IP from connected AP */ - SYSTEM_EVENT_MAX -} system_event_id_t; - -/* add this macro define for compatible with old IDF version */ -#ifndef SYSTEM_EVENT_AP_STA_GOT_IP6 -#define SYSTEM_EVENT_AP_STA_GOT_IP6 SYSTEM_EVENT_GOT_IP6 -#endif - -typedef enum { - WPS_FAIL_REASON_NORMAL = 0, /**< ESP32 WPS normal fail reason */ - WPS_FAIL_REASON_RECV_M2D, /**< ESP32 WPS receive M2D frame */ - WPS_FAIL_REASON_MAX -}system_event_sta_wps_fail_reason_t; -typedef struct { - uint32_t status; /**< status of scanning APs */ - uint8_t number; - uint8_t scan_id; -} system_event_sta_scan_done_t; - -typedef struct { - uint8_t ssid[32]; /**< SSID of connected AP */ - uint8_t ssid_len; /**< SSID length of connected AP */ - uint8_t bssid[6]; /**< BSSID of connected AP*/ - uint8_t channel; /**< channel of connected AP*/ - wifi_auth_mode_t authmode; -} system_event_sta_connected_t; - -typedef struct { - uint8_t ssid[32]; /**< SSID of disconnected AP */ - uint8_t ssid_len; /**< SSID length of disconnected AP */ - uint8_t bssid[6]; /**< BSSID of disconnected AP */ - uint8_t reason; /**< reason of disconnection */ -} system_event_sta_disconnected_t; - -typedef struct { - wifi_auth_mode_t old_mode; /**< the old auth mode of AP */ - wifi_auth_mode_t new_mode; /**< the new auth mode of AP */ -} system_event_sta_authmode_change_t; - -typedef struct { - tcpip_adapter_ip_info_t ip_info; - bool ip_changed; -} system_event_sta_got_ip_t; - -typedef struct { - uint8_t pin_code[8]; /**< PIN code of station in enrollee mode */ -} system_event_sta_wps_er_pin_t; - -typedef struct { - tcpip_adapter_if_t if_index; - tcpip_adapter_ip6_info_t ip6_info; -} system_event_got_ip6_t; - -typedef struct { - uint8_t mac[6]; /**< MAC address of the station connected to ESP32 soft-AP */ - uint8_t aid; /**< the aid that ESP32 soft-AP gives to the station connected to */ -} system_event_ap_staconnected_t; - -typedef struct { - uint8_t mac[6]; /**< MAC address of the station disconnects to ESP32 soft-AP */ - uint8_t aid; /**< the aid that ESP32 soft-AP gave to the station disconnects to */ -} system_event_ap_stadisconnected_t; - -typedef struct { - int rssi; /**< Received probe request signal strength */ - uint8_t mac[6]; /**< MAC address of the station which send probe request */ -} system_event_ap_probe_req_rx_t; - -typedef union { - system_event_sta_connected_t connected; /**< ESP32 station connected to AP */ - system_event_sta_disconnected_t disconnected; /**< ESP32 station disconnected to AP */ - system_event_sta_scan_done_t scan_done; /**< ESP32 station scan (APs) done */ - system_event_sta_authmode_change_t auth_change; /**< the auth mode of AP ESP32 station connected to changed */ - system_event_sta_got_ip_t got_ip; /**< ESP32 station got IP, first time got IP or when IP is changed */ - system_event_sta_wps_er_pin_t sta_er_pin; /**< ESP32 station WPS enrollee mode PIN code received */ - system_event_sta_wps_fail_reason_t sta_er_fail_reason;/**< ESP32 station WPS enrollee mode failed reason code received */ - system_event_ap_staconnected_t sta_connected; /**< a station connected to ESP32 soft-AP */ - system_event_ap_stadisconnected_t sta_disconnected; /**< a station disconnected to ESP32 soft-AP */ - system_event_ap_probe_req_rx_t ap_probereqrecved; /**< ESP32 soft-AP receive probe request packet */ - system_event_got_ip6_t got_ip6; /**< ESP32 station or ap or ethernet ipv6 addr state change to preferred */ -} system_event_info_t; - -typedef struct { - system_event_id_t event_id; /**< event ID */ - system_event_info_t event_info; /**< event information */ -} system_event_t; - -typedef esp_err_t (*system_event_handler_t)(system_event_t *event); - -/** - * @brief Send a event to event task - * - * @attention 1. Other task/modules, such as the TCPIP module, can call this API to send an event to event task - * - * @param system_event_t * event : event - * - * @return ESP_OK : succeed - * @return others : fail - */ -esp_err_t esp_event_send(system_event_t *event); - -/** - * @brief Default event handler for system events - * - * This function performs default handling of system events. - * When using esp_event_loop APIs, it is called automatically before invoking the user-provided - * callback function. - * - * Applications which implement a custom event loop must call this function - * as part of event processing. - * - * @param event pointer to event to be handled - * @return ESP_OK if an event was handled successfully - */ -esp_err_t esp_event_process_default(system_event_t *event); - -/** - * @brief Install default event handlers for Ethernet interface - * - */ -void esp_event_set_default_eth_handlers(); - -/** - * @brief Install default event handlers for Wi-Fi interfaces (station and AP) - * - */ -void esp_event_set_default_wifi_handlers(); - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_EVENT_H__ */ diff --git a/tools/sdk/include/esp32/esp_event_loop.h b/tools/sdk/include/esp32/esp_event_loop.h deleted file mode 100644 index 97672aedf2d..00000000000 --- a/tools/sdk/include/esp32/esp_event_loop.h +++ /dev/null @@ -1,81 +0,0 @@ -// 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. - -#ifndef __ESP_EVENT_LOOP_H__ -#define __ESP_EVENT_LOOP_H__ - -#include -#include - -#include "esp_err.h" -#include "esp_event.h" -#include "freertos/FreeRTOS.h" -#include "freertos/queue.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Application specified event callback function - * - * @param void *ctx : reserved for user - * @param system_event_t *event : event type defined in this file - * - * @return ESP_OK : succeed - * @return others : fail - */ -typedef esp_err_t (*system_event_cb_t)(void *ctx, system_event_t *event); - -/** - * @brief Initialize event loop - * Create the event handler and task - * - * @param system_event_cb_t cb : application specified event callback, it can be modified by call esp_event_set_cb - * @param void *ctx : reserved for user - * - * @return ESP_OK : succeed - * @return others : fail - */ -esp_err_t esp_event_loop_init(system_event_cb_t cb, void *ctx); - -/** - * @brief Set application specified event callback function - * - * @attention 1. If cb is NULL, means application don't need to handle - * If cb is not NULL, it will be call when an event is received, after the default event callback is completed - * - * @param system_event_cb_t cb : callback - * @param void *ctx : reserved for user - * - * @return system_event_cb_t : old callback - */ -system_event_cb_t esp_event_loop_set_cb(system_event_cb_t cb, void *ctx); - -/** - * @brief Get the queue used by event loop - * - * @attention : currently this API is used to initialize "q" parameter - * of wifi_init structure. - * - * @return QueueHandle_t : event queue handle - */ -QueueHandle_t esp_event_loop_get_queue(void); - - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_EVENT_LOOP_H__ */ diff --git a/tools/sdk/include/esp32/esp_flash_data_types.h b/tools/sdk/include/esp32/esp_flash_data_types.h deleted file mode 100644 index 9a26281b0a8..00000000000 --- a/tools/sdk/include/esp32/esp_flash_data_types.h +++ /dev/null @@ -1,74 +0,0 @@ -// 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. -#ifndef __ESP_BIN_TYPES_H__ -#define __ESP_BIN_TYPES_H__ - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -#define ESP_PARTITION_MAGIC 0x50AA -#define ESP_PARTITION_MAGIC_MD5 0xEBEB - -/* OTA selection structure (two copies in the OTA data partition.) - Size of 32 bytes is friendly to flash encryption */ -typedef struct { - uint32_t ota_seq; - uint8_t seq_label[24]; - uint32_t crc; /* CRC32 of ota_seq field only */ -} esp_ota_select_entry_t; - - -typedef struct { - uint32_t offset; - uint32_t size; -} esp_partition_pos_t; - -/* Structure which describes the layout of partition table entry. - * See docs/partition_tables.rst for more information about individual fields. - */ -typedef struct { - uint16_t magic; - uint8_t type; - uint8_t subtype; - esp_partition_pos_t pos; - uint8_t label[16]; - uint32_t flags; -} esp_partition_info_t; - -#define PART_TYPE_APP 0x00 -#define PART_SUBTYPE_FACTORY 0x00 -#define PART_SUBTYPE_OTA_FLAG 0x10 -#define PART_SUBTYPE_OTA_MASK 0x0f -#define PART_SUBTYPE_TEST 0x20 - -#define PART_TYPE_DATA 0x01 -#define PART_SUBTYPE_DATA_OTA 0x00 -#define PART_SUBTYPE_DATA_RF 0x01 -#define PART_SUBTYPE_DATA_WIFI 0x02 -#define PART_SUBTYPE_DATA_NVS_KEYS 0x04 - -#define PART_TYPE_END 0xff -#define PART_SUBTYPE_END 0xff - -#define PART_FLAG_ENCRYPTED (1<<0) - -#ifdef __cplusplus -} -#endif - -#endif //__ESP_BIN_TYPES_H__ diff --git a/tools/sdk/include/esp32/esp_freertos_hooks.h b/tools/sdk/include/esp32/esp_freertos_hooks.h deleted file mode 100644 index 5f24bc35a6c..00000000000 --- a/tools/sdk/include/esp32/esp_freertos_hooks.h +++ /dev/null @@ -1,131 +0,0 @@ -// 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. - -#ifndef __ESP_FREERTOS_HOOKS_H__ -#define __ESP_FREERTOS_HOOKS_H__ - -#include -#include "esp_err.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* - Definitions for the tickhook and idlehook callbacks -*/ -typedef bool (*esp_freertos_idle_cb_t)(); -typedef void (*esp_freertos_tick_cb_t)(); - -/** - * @brief Register a callback to be called from the specified core's idle hook. - * The callback should return true if it should be called by the idle hook - * once per interrupt (or FreeRTOS tick), and return false if it should - * be called repeatedly as fast as possible by the idle hook. - * - * @warning Idle callbacks MUST NOT, UNDER ANY CIRCUMSTANCES, CALL - * A FUNCTION THAT MIGHT BLOCK. - * - * @param[in] new_idle_cb Callback to be called - * @param[in] cpuid id of the core - * - * @return - * - ESP_OK: Callback registered to the specified core's idle hook - * - ESP_ERR_NO_MEM: No more space on the specified core's idle hook to register callback - * - ESP_ERR_INVALID_ARG: cpuid is invalid - */ -esp_err_t esp_register_freertos_idle_hook_for_cpu(esp_freertos_idle_cb_t new_idle_cb, UBaseType_t cpuid); - -/** - * @brief Register a callback to the idle hook of the core that calls this function. - * The callback should return true if it should be called by the idle hook - * once per interrupt (or FreeRTOS tick), and return false if it should - * be called repeatedly as fast as possible by the idle hook. - * - * @warning Idle callbacks MUST NOT, UNDER ANY CIRCUMSTANCES, CALL - * A FUNCTION THAT MIGHT BLOCK. - * - * @param[in] new_idle_cb Callback to be called - * - * @return - * - ESP_OK: Callback registered to the calling core's idle hook - * - ESP_ERR_NO_MEM: No more space on the calling core's idle hook to register callback - */ -esp_err_t esp_register_freertos_idle_hook(esp_freertos_idle_cb_t new_idle_cb); - -/** - * @brief Register a callback to be called from the specified core's tick hook. - * - * @param[in] new_tick_cb Callback to be called - * @param[in] cpuid id of the core - * - * @return - * - ESP_OK: Callback registered to specified core's tick hook - * - ESP_ERR_NO_MEM: No more space on the specified core's tick hook to register the callback - * - ESP_ERR_INVALID_ARG: cpuid is invalid - */ -esp_err_t esp_register_freertos_tick_hook_for_cpu(esp_freertos_tick_cb_t new_tick_cb, UBaseType_t cpuid); - -/** - * @brief Register a callback to be called from the calling core's tick hook. - * - * @param[in] new_tick_cb Callback to be called - * - * @return - * - ESP_OK: Callback registered to the calling core's tick hook - * - ESP_ERR_NO_MEM: No more space on the calling core's tick hook to register the callback - */ -esp_err_t esp_register_freertos_tick_hook(esp_freertos_tick_cb_t new_tick_cb); - -/** - * @brief Unregister an idle callback from the idle hook of the specified core - * - * @param[in] old_idle_cb Callback to be unregistered - * @param[in] cpuid id of the core - */ -void esp_deregister_freertos_idle_hook_for_cpu(esp_freertos_idle_cb_t old_idle_cb, UBaseType_t cpuid); - -/** - * @brief Unregister an idle callback. If the idle callback is registered to - * the idle hooks of both cores, the idle hook will be unregistered from - * both cores - * - * @param[in] old_idle_cb Callback to be unregistered - */ -void esp_deregister_freertos_idle_hook(esp_freertos_idle_cb_t old_idle_cb); - -/** - * @brief Unregister a tick callback from the tick hook of the specified core - * - * @param[in] old_tick_cb Callback to be unregistered - * @param[in] cpuid id of the core - */ -void esp_deregister_freertos_tick_hook_for_cpu(esp_freertos_tick_cb_t old_tick_cb, UBaseType_t cpuid); - -/** - * @brief Unregister a tick callback. If the tick callback is registered to the - * tick hooks of both cores, the tick hook will be unregistered from - * both cores - * - * @param[in] old_tick_cb Callback to be unregistered - */ -void esp_deregister_freertos_tick_hook(esp_freertos_tick_cb_t old_tick_cb); - -#ifdef __cplusplus -} -#endif - - -#endif diff --git a/tools/sdk/include/esp32/esp_gdbstub.h b/tools/sdk/include/esp32/esp_gdbstub.h deleted file mode 100644 index 9e7243aad07..00000000000 --- a/tools/sdk/include/esp32/esp_gdbstub.h +++ /dev/null @@ -1,22 +0,0 @@ -// 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. -#ifndef GDBSTUB_H -#define GDBSTUB_H - -#include -#include "freertos/xtensa_api.h" - -void esp_gdbstub_panic_handler(XtExcFrame *frame) __attribute__((noreturn)); - -#endif diff --git a/tools/sdk/include/esp32/esp_himem.h b/tools/sdk/include/esp32/esp_himem.h deleted file mode 100644 index 099d9260153..00000000000 --- a/tools/sdk/include/esp32/esp_himem.h +++ /dev/null @@ -1,152 +0,0 @@ -// 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. -#pragma once - -#include -#include "esp_err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -//Opaque pointers as handles for ram/range data -typedef struct esp_himem_ramdata_t *esp_himem_handle_t; -typedef struct esp_himem_rangedata_t *esp_himem_rangehandle_t; - -//ESP32 MMU block size -#define ESP_HIMEM_BLKSZ (0x8000) - -#define ESP_HIMEM_MAPFLAG_RO 1 /*!< Indicates that a mapping will only be read from. Note that this is unused for now. */ - -/** - * @brief Allocate a block in high memory - * - * @param size Size of the to-be-allocated block, in bytes. Note that this needs to be - * a multiple of the external RAM mmu block size (32K). - * @param[out] handle_out Handle to be returned - * @returns - ESP_OK if succesful - * - ESP_ERR_NO_MEM if out of memory - * - ESP_ERR_INVALID_SIZE if size is not a multiple of 32K - */ -esp_err_t esp_himem_alloc(size_t size, esp_himem_handle_t *handle_out); - - -/** - * @brief Allocate a memory region to map blocks into - * - * This allocates a contiguous CPU memory region that can be used to map blocks - * of physical memory into. - * - * @param size Size of the range to be allocated. Note this needs to be a multiple of - * the external RAM mmu block size (32K). - * @param[out] handle_out Handle to be returned - * @returns - ESP_OK if succesful - * - ESP_ERR_NO_MEM if out of memory or address space - * - ESP_ERR_INVALID_SIZE if size is not a multiple of 32K - */ -esp_err_t esp_himem_alloc_map_range(size_t size, esp_himem_rangehandle_t *handle_out); - -/** - * @brief Map a block of high memory into the CPUs address space - * - * This effectively makes the block available for read/write operations. - * - * @note The region to be mapped needs to have offsets and sizes that are aligned to the - * SPI RAM MMU block size (32K) - * - * @param handle Handle to the block of memory, as given by esp_himem_alloc - * @param range Range handle to map the memory in - * @param ram_offset Offset into the block of physical memory of the block to map - * @param range_offset Offset into the address range where the block will be mapped - * @param len Length of region to map - * @param flags One of ESP_HIMEM_MAPFLAG_* - * @param[out] out_ptr Pointer to variable to store resulting memory pointer in - * @returns - ESP_OK if the memory could be mapped - * - ESP_ERR_INVALID_ARG if offset, range or len aren't MMU-block-aligned (32K) - * - ESP_ERR_INVALID_SIZE if the offsets/lengths don't fit in the allocated memory or range - * - ESP_ERR_INVALID_STATE if a block in the selected ram offset/length is already mapped, or - * if a block in the selected range offset/length already has a mapping. - */ -esp_err_t esp_himem_map(esp_himem_handle_t handle, esp_himem_rangehandle_t range, size_t ram_offset, size_t range_offset, size_t len, int flags, void **out_ptr); - - -/** - * @brief Free a block of physical memory - * - * This clears out the associated handle making the memory available for re-allocation again. - * This will only succeed if none of the memory blocks currently have a mapping. - * - * @param handle Handle to the block of memory, as given by esp_himem_alloc - * @returns - ESP_OK if the memory is succesfully freed - * - ESP_ERR_INVALID_ARG if the handle still is (partially) mapped - */ -esp_err_t esp_himem_free(esp_himem_handle_t handle); - - - -/** - * @brief Free a mapping range - * - * This clears out the associated handle making the range available for re-allocation again. - * This will only succeed if none of the range blocks currently are used for a mapping. - * - * @param handle Handle to the range block, as given by esp_himem_alloc_map_range - * @returns - ESP_OK if the memory is succesfully freed - * - ESP_ERR_INVALID_ARG if the handle still is (partially) mapped to - */ -esp_err_t esp_himem_free_map_range(esp_himem_rangehandle_t handle); - - -/** - * @brief Unmap a region - * - * @param range Range handle - * @param ptr Pointer returned by esp_himem_map - * @param len Length of the block to be unmapped. Must be aligned to the SPI RAM MMU blocksize (32K) - * @returns - ESP_OK if the memory is succesfully unmapped, - * - ESP_ERR_INVALID_ARG if ptr or len are invalid. - */ -esp_err_t esp_himem_unmap(esp_himem_rangehandle_t range, void *ptr, size_t len); - - -/** - * @brief Get total amount of memory under control of himem API - * - * @returns Amount of memory, in bytes - */ -size_t esp_himem_get_phys_size(); - -/** - * @brief Get free amount of memory under control of himem API - * - * @returns Amount of free memory, in bytes - */ -size_t esp_himem_get_free_size(); - - -/** - * @brief Get amount of SPI memory address space needed for bankswitching - * - * @note This is also weakly defined in esp32/spiram.c and returns 0 there, so - * if no other function in this file is used, no memory is reserved. - * - * @returns Amount of reserved area, in bytes - */ -size_t esp_himem_reserved_area_size(); - - -#ifdef __cplusplus -} -#endif - diff --git a/tools/sdk/include/esp32/esp_int_wdt.h b/tools/sdk/include/esp32/esp_int_wdt.h deleted file mode 100644 index f581d939ad8..00000000000 --- a/tools/sdk/include/esp32/esp_int_wdt.h +++ /dev/null @@ -1,67 +0,0 @@ -// 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. - -#ifndef __ESP_INT_WDT_H -#define __ESP_INT_WDT_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** @addtogroup Watchdog_APIs - * @{ - */ - -/* -This routine enables a watchdog to catch instances of processes disabling -interrupts for too long, or code within interrupt handlers taking too long. -It does this by setting up a watchdog which gets fed from the FreeRTOS -task switch interrupt. When this watchdog times out, initially it will call -a high-level interrupt routine that will panic FreeRTOS in order to allow -for forensic examination of the state of the both CPUs. When this interrupt -handler is not called and the watchdog times out a second time, it will -reset the SoC. - -This uses the TIMERG1 WDT. -*/ - - -/** - * @brief Initialize the non-CPU-specific parts of interrupt watchdog. - * This is called in the init code if the interrupt watchdog - * is enabled in menuconfig. - * - */ -void esp_int_wdt_init(); - -/** - * @brief Enable the interrupt watchdog on the current CPU. This is called - * in the init code by both CPUs if the interrupt watchdog is enabled - * in menuconfig. - * - */ -void esp_int_wdt_cpu_init(); - - - -/** - * @} - */ - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/esp32/esp_interface.h b/tools/sdk/include/esp32/esp_interface.h deleted file mode 100644 index 950c05bb22c..00000000000 --- a/tools/sdk/include/esp32/esp_interface.h +++ /dev/null @@ -1,37 +0,0 @@ -// 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. - - -#ifndef __ESP_INTERFACE_H__ -#define __ESP_INTERFACE_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - ESP_IF_WIFI_STA = 0, /**< ESP32 station interface */ - ESP_IF_WIFI_AP, /**< ESP32 soft-AP interface */ - ESP_IF_ETH, /**< ESP32 ethernet interface */ - ESP_IF_MAX -} esp_interface_t; - -#ifdef __cplusplus -} -#endif - - -#endif /* __ESP_INTERFACE_TYPES_H__ */ diff --git a/tools/sdk/include/esp32/esp_intr.h b/tools/sdk/include/esp32/esp_intr.h deleted file mode 100644 index 579eb6353d8..00000000000 --- a/tools/sdk/include/esp32/esp_intr.h +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2010-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. - -#ifndef __ESP_INTR_H__ -#define __ESP_INTR_H__ - -#include "rom/ets_sys.h" -#include "freertos/xtensa_api.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ESP_CCOMPARE_INTR_ATTACH(func, arg) \ - xt_set_interrupt_handler(ETS_CCOMPARE_INUM, (func), (void *)(arg)) - -#define ESP_EPWM_INTR_ATTACH(func, arg) \ - xt_set_interrupt_handler(ETS_EPWM_INUM, (func), (void *)(arg)) - -#define ESP_MPWM_INTR_ATTACH(func, arg) \ - xt_set_interrupt_handler(ETS_MPWM_INUM, (func), (void *)(arg)) - -#define ESP_SPI1_INTR_ATTACH(func, arg) \ - xt_set_interrupt_handler(ETS_SPI1_INUM, (func), (void *)(arg)) - -#define ESP_SPI2_INTR_ATTACH(func, arg) \ - xt_set_interrupt_handler(ETS_SPI2_INUM, (func), (void *)(arg)) - -#define ESP_SPI3_INTR_ATTACH(func, arg) \ - xt_set_interrupt_handler(ETS_SPI3_INUM, (func), (void *)(arg)) - -#define ESP_I2S0_INTR_ATTACH(func, arg) \ - xt_set_interrupt_handler(ETS_I2S0_INUM, (func), (void *)(arg)) - -#define ESP_PCNT_INTR_ATTACH(func, arg) \ - xt_set_interrupt_handler(ETS_PCNT_INUM, (func), (void *)(arg)) - -#define ESP_LEDC_INTR_ATTACH(func, arg) \ - xt_set_interrupt_handler(ETS_LEDC_INUM, (func), (void *)(arg)) - -#define ESP_WMAC_INTR_ATTACH(func, arg) \ - xt_set_interrupt_handler(ETS_WMAC_INUM, (func), (void *)(arg)) - -#define ESP_FRC_TIMER1_INTR_ATTACH(func, arg) \ - xt_set_interrupt_handler(ETS_FRC_TIMER1_INUM, (func), (void *)(arg)) - -#define ESP_FRC_TIMER2_INTR_ATTACH(func, arg) \ - xt_set_interrupt_handler(ETS_FRC_TIMER2_INUM, (func), (void *)(arg)) - -#define ESP_GPIO_INTR_ATTACH(func, arg) \ - xt_set_interrupt_handler(ETS_GPIO_INUM, (func), (void *)(arg)) - -#define ESP_UART0_INTR_ATTACH(func, arg) \ - xt_set_interrupt_handler(ETS_UART0_INUM, (func), (void *)(arg)) - -#define ESP_WDT_INTR_ATTACH(func, arg) \ - xt_set_interrupt_handler(ETS_WDT_INUM, (func), (void *)(arg)) - -#define ESP_RTC_INTR_ATTACH(func, arg) \ - xt_set_interrupt_handler(ETS_RTC_INUM, (func), (void *)(arg)) - -#define ESP_SLC_INTR_ATTACH(func, arg) \ - xt_set_interrupt_handler(ETS_SLC_INUM, (func), (void *)(arg)) - -#define ESP_RMT_CTRL_INTRL(func,arg)\ - xt_set_interrupt_handler(ETS_RMT_CTRL_INUM, (func), (void *)(arg)) - -#define ESP_INTR_ENABLE(inum) \ - xt_ints_on((1< -#include -#include "esp_err.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -/** @addtogroup Intr_Alloc - * @{ - */ - - -/** @brief Interrupt allocation flags - * - * These flags can be used to specify which interrupt qualities the - * code calling esp_intr_alloc* needs. - * - */ - -//Keep the LEVELx values as they are here; they match up with (1<3 - * is requested, because these types of interrupts aren't C-callable. - * @param arg Optional argument for passed to the interrupt handler - * @param ret_handle Pointer to an intr_handle_t to store a handle that can later be - * used to request details or free the interrupt. Can be NULL if no handle - * is required. - * - * @return ESP_ERR_INVALID_ARG if the combination of arguments is invalid. - * ESP_ERR_NOT_FOUND No free interrupt found with the specified flags - * ESP_OK otherwise - */ -esp_err_t esp_intr_alloc(int source, int flags, intr_handler_t handler, void *arg, intr_handle_t *ret_handle); - - -/** - * @brief Allocate an interrupt with the given parameters. - * - * - * This essentially does the same as esp_intr_alloc, but allows specifying a register and mask - * combo. For shared interrupts, the handler is only called if a read from the specified - * register, ANDed with the mask, returns non-zero. By passing an interrupt status register - * address and a fitting mask, this can be used to accelerate interrupt handling in the case - * a shared interrupt is triggered; by checking the interrupt statuses first, the code can - * decide which ISRs can be skipped - * - * @param source The interrupt source. One of the ETS_*_INTR_SOURCE interrupt mux - * sources, as defined in soc/soc.h, or one of the internal - * ETS_INTERNAL_*_INTR_SOURCE sources as defined in this header. - * @param flags An ORred mask of the ESP_INTR_FLAG_* defines. These restrict the - * choice of interrupts that this routine can choose from. If this value - * is 0, it will default to allocating a non-shared interrupt of level - * 1, 2 or 3. If this is ESP_INTR_FLAG_SHARED, it will allocate a shared - * interrupt of level 1. Setting ESP_INTR_FLAG_INTRDISABLED will return - * from this function with the interrupt disabled. - * @param intrstatusreg The address of an interrupt status register - * @param intrstatusmask A mask. If a read of address intrstatusreg has any of the bits - * that are 1 in the mask set, the ISR will be called. If not, it will be - * skipped. - * @param handler The interrupt handler. Must be NULL when an interrupt of level >3 - * is requested, because these types of interrupts aren't C-callable. - * @param arg Optional argument for passed to the interrupt handler - * @param ret_handle Pointer to an intr_handle_t to store a handle that can later be - * used to request details or free the interrupt. Can be NULL if no handle - * is required. - * - * @return ESP_ERR_INVALID_ARG if the combination of arguments is invalid. - * ESP_ERR_NOT_FOUND No free interrupt found with the specified flags - * ESP_OK otherwise - */ -esp_err_t esp_intr_alloc_intrstatus(int source, int flags, uint32_t intrstatusreg, uint32_t intrstatusmask, intr_handler_t handler, void *arg, intr_handle_t *ret_handle); - - -/** - * @brief Disable and free an interrupt. - * - * Use an interrupt handle to disable the interrupt and release the resources associated with it. - * If the current core is not the core that registered this interrupt, this routine will be assigned to - * the core that allocated this interrupt, blocking and waiting until the resource is successfully released. - * - * @note - * When the handler shares its source with other handlers, the interrupt status - * bits it's responsible for should be managed properly before freeing it. see - * ``esp_intr_disable`` for more details. Please do not call this function in ``esp_ipc_call_blocking``. - * - * @param handle The handle, as obtained by esp_intr_alloc or esp_intr_alloc_intrstatus - * - * @return ESP_ERR_INVALID_ARG the handle is NULL - * ESP_FAIL failed to release this handle - * ESP_OK otherwise - */ -esp_err_t esp_intr_free(intr_handle_t handle); - - -/** - * @brief Get CPU number an interrupt is tied to - * - * @param handle The handle, as obtained by esp_intr_alloc or esp_intr_alloc_intrstatus - * - * @return The core number where the interrupt is allocated - */ -int esp_intr_get_cpu(intr_handle_t handle); - -/** - * @brief Get the allocated interrupt for a certain handle - * - * @param handle The handle, as obtained by esp_intr_alloc or esp_intr_alloc_intrstatus - * - * @return The interrupt number - */ -int esp_intr_get_intno(intr_handle_t handle); - -/** - * @brief Disable the interrupt associated with the handle - * - * @note - * 1. For local interrupts (ESP_INTERNAL_* sources), this function has to be called on the - * CPU the interrupt is allocated on. Other interrupts have no such restriction. - * 2. When several handlers sharing a same interrupt source, interrupt status bits, which are - * handled in the handler to be disabled, should be masked before the disabling, or handled - * in other enabled interrupts properly. Miss of interrupt status handling will cause infinite - * interrupt calls and finally system crash. - * - * @param handle The handle, as obtained by esp_intr_alloc or esp_intr_alloc_intrstatus - * - * @return ESP_ERR_INVALID_ARG if the combination of arguments is invalid. - * ESP_OK otherwise - */ -esp_err_t esp_intr_disable(intr_handle_t handle); - -/** - * @brief Enable the interrupt associated with the handle - * - * @note For local interrupts (ESP_INTERNAL_* sources), this function has to be called on the - * CPU the interrupt is allocated on. Other interrupts have no such restriction. - * - * @param handle The handle, as obtained by esp_intr_alloc or esp_intr_alloc_intrstatus - * - * @return ESP_ERR_INVALID_ARG if the combination of arguments is invalid. - * ESP_OK otherwise - */ -esp_err_t esp_intr_enable(intr_handle_t handle); - -/** - * @brief Set the "in IRAM" status of the handler. - * - * @note Does not work on shared interrupts. - * - * @param handle The handle, as obtained by esp_intr_alloc or esp_intr_alloc_intrstatus - * @param is_in_iram Whether the handler associated with this handle resides in IRAM. - * Handlers residing in IRAM can be called when cache is disabled. - * - * @return ESP_ERR_INVALID_ARG if the combination of arguments is invalid. - * ESP_OK otherwise - */ -esp_err_t esp_intr_set_in_iram(intr_handle_t handle, bool is_in_iram); - -/** - * @brief Disable interrupts that aren't specifically marked as running from IRAM - */ -void esp_intr_noniram_disable(); - - -/** - * @brief Re-enable interrupts disabled by esp_intr_noniram_disable - */ -void esp_intr_noniram_enable(); - -/**@}*/ - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/esp32/esp_ipc.h b/tools/sdk/include/esp32/esp_ipc.h deleted file mode 100644 index 477b3d0af4e..00000000000 --- a/tools/sdk/include/esp32/esp_ipc.h +++ /dev/null @@ -1,93 +0,0 @@ -// 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. - -#ifndef __ESP_IPC_H__ -#define __ESP_IPC_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif -/** @cond */ -typedef void (*esp_ipc_func_t)(void* arg); -/** @endcond */ -/* - * Inter-processor call APIs - * - * FreeRTOS provides several APIs which can be used to communicate between - * different tasks, including tasks running on different CPUs. - * This module provides additional APIs to run some code on the other CPU. - * - * These APIs can only be used when FreeRTOS scheduler is running. - */ - -/** - * @brief Execute a function on the given CPU - * - * Run a given function on a particular CPU. The given function must accept a - * void* argument and return void. The given function is run in the context of - * the IPC task of the CPU specified by the cpu_id parameter. The calling task - * will be blocked until the IPC task begins executing the given function. If - * another IPC call is ongoing, the calling task will block until the other IPC - * call completes. The stack size allocated for the IPC task can be configured - * in the "Inter-Processor Call (IPC) task stack size" setting in menuconfig. - * Increase this setting if the given function requires more stack than default. - * - * @note In single-core mode, returns ESP_ERR_INVALID_ARG for cpu_id 1. - * - * @param[in] cpu_id CPU where the given function should be executed (0 or 1) - * @param[in] func Pointer to a function of type void func(void* arg) to be executed - * @param[in] arg Arbitrary argument of type void* to be passed into the function - * - * @return - * - ESP_ERR_INVALID_ARG if cpu_id is invalid - * - ESP_ERR_INVALID_STATE if the FreeRTOS scheduler is not running - * - ESP_OK otherwise - */ -esp_err_t esp_ipc_call(uint32_t cpu_id, esp_ipc_func_t func, void* arg); - - -/** - * @brief Execute a function on the given CPU and blocks until it completes - * - * Run a given function on a particular CPU. The given function must accept a - * void* argument and return void. The given function is run in the context of - * the IPC task of the CPU specified by the cpu_id parameter. The calling task - * will be blocked until the IPC task completes execution of the given function. - * If another IPC call is ongoing, the calling task will block until the other - * IPC call completes. The stack size allocated for the IPC task can be - * configured in the "Inter-Processor Call (IPC) task stack size" setting in - * menuconfig. Increase this setting if the given function requires more stack - * than default. - * - * @note In single-core mode, returns ESP_ERR_INVALID_ARG for cpu_id 1. - * - * @param[in] cpu_id CPU where the given function should be executed (0 or 1) - * @param[in] func Pointer to a function of type void func(void* arg) to be executed - * @param[in] arg Arbitrary argument of type void* to be passed into the function - * - * @return - * - ESP_ERR_INVALID_ARG if cpu_id is invalid - * - ESP_ERR_INVALID_STATE if the FreeRTOS scheduler is not running - * - ESP_OK otherwise - */ -esp_err_t esp_ipc_call_blocking(uint32_t cpu_id, esp_ipc_func_t func, void* arg); - - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_IPC_H__ */ diff --git a/tools/sdk/include/esp32/esp_mesh.h b/tools/sdk/include/esp32/esp_mesh.h deleted file mode 100644 index e52e541ff86..00000000000 --- a/tools/sdk/include/esp32/esp_mesh.h +++ /dev/null @@ -1,1492 +0,0 @@ -// Copyright 2017-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. - -/* - * Software Stack demonstrated: - * |------------------------------------------------------------------------------| - * | | | - * | | Application | - * | |-----------------------------------------------------------------| - * | | | Protocols: | | | | | - * | | Mesh Stack | HTTP, DNS, | | | Other | | - * | RTOS: | (Networking, | DHCP, ... | | | Components | | - * | (freeRTOS) | self-healing, |------------| | | | | - * | | flow control, | Network Stack: | | | | - * | | ...) | (LwIP) | | | | - * | |-----------------------------------| |---------------| | - * | | | | - * | | Wi-Fi Driver | | - * | |--------------------------------------------------| | - * | | | - * | | Platform HAL | - * |------------------------------------------------------------------------------| - * - * System Events delivery: - * - * |---------------| - * | | default handler - * | Wi-Fi stack | events |---------------------| - * | | -------------> | | - * |---------------| | | - * | event task | - * |---------------| events | | - * | | -------------> | | - * | LwIP stack | |---------------------| - * | |--------| - * |---------------| | - * | mesh event callback handler - * | |----------------------------| - * |-----> | | - * |---------------| | application | - * | | events | task | - * | mesh stack | -------------> | | - * | | |----------------------------| - * |---------------| - * - * - * Mesh Stack - * - * Mesh event defines almost all system events applications tasks need. - * Mesh event contains Wi-Fi connection states on station interface, children connection states on softAP interface and etc.. - * Applications need to register a mesh event callback handler by API esp_mesh_set_config() firstly. - * This handler is to receive events posted from mesh stack and LwIP stack. - * Applications could add relative handler for each event. - * Examples: - * (1) Applications could use Wi-Fi station connect states to decide when to send data to its parent, to the root or to external IP network; - * (2) Applications could use Wi-Fi softAP states to decide when to send data to its children. - * - * In present implementation, applications are able to access mesh stack directly without having to go through LwIP stack. - * Applications use esp_mesh_send() and esp_mesh_recv() to send and receive messages over the mesh network. - * In mesh stack design, normal devices don't require LwIP stack. But since IDF hasn't supported system without initializing LwIP stack yet, - * applications still need to do LwIP initialization and two more things are required to be done - * (1) stop DHCP server on softAP interface by default - * (2) stop DHCP client on station interface by default. - * Examples: - * tcpip_adapter_init(); - * tcpip_adapter_dhcps_stop(TCPIP_ADAPTER_IF_AP); - * tcpip_adapter_dhcpc_stop(TCPIP_ADAPTER_IF_STA); - * - * Over the mesh network, only the root is able to access external IP network. - * In application mesh event handler, once a device becomes a root, start DHCP client immediately whether DHCP is chosen. - */ - -#ifndef __ESP_MESH_H__ -#define __ESP_MESH_H__ - -#include "esp_err.h" -#include "esp_wifi.h" -#include "esp_wifi_types.h" -#include "esp_mesh_internal.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/******************************************************* - * Constants - *******************************************************/ -#define MESH_ROOT_LAYER (1) /**< root layer value */ -#define MESH_MTU (1500) /**< max transmit unit(in bytes) */ -#define MESH_MPS (1472) /**< max payload size(in bytes) */ -/** - * @brief Mesh error code definition - */ -#define ESP_ERR_MESH_WIFI_NOT_START (ESP_ERR_MESH_BASE + 1) /**< Wi-Fi isn't started */ -#define ESP_ERR_MESH_NOT_INIT (ESP_ERR_MESH_BASE + 2) /**< mesh isn't initialized */ -#define ESP_ERR_MESH_NOT_CONFIG (ESP_ERR_MESH_BASE + 3) /**< mesh isn't configured */ -#define ESP_ERR_MESH_NOT_START (ESP_ERR_MESH_BASE + 4) /**< mesh isn't started */ -#define ESP_ERR_MESH_NOT_SUPPORT (ESP_ERR_MESH_BASE + 5) /**< not supported yet */ -#define ESP_ERR_MESH_NOT_ALLOWED (ESP_ERR_MESH_BASE + 6) /**< operation is not allowed */ -#define ESP_ERR_MESH_NO_MEMORY (ESP_ERR_MESH_BASE + 7) /**< out of memory */ -#define ESP_ERR_MESH_ARGUMENT (ESP_ERR_MESH_BASE + 8) /**< illegal argument */ -#define ESP_ERR_MESH_EXCEED_MTU (ESP_ERR_MESH_BASE + 9) /**< packet size exceeds MTU */ -#define ESP_ERR_MESH_TIMEOUT (ESP_ERR_MESH_BASE + 10) /**< timeout */ -#define ESP_ERR_MESH_DISCONNECTED (ESP_ERR_MESH_BASE + 11) /**< disconnected with parent on station interface */ -#define ESP_ERR_MESH_QUEUE_FAIL (ESP_ERR_MESH_BASE + 12) /**< queue fail */ -#define ESP_ERR_MESH_QUEUE_FULL (ESP_ERR_MESH_BASE + 13) /**< queue full */ -#define ESP_ERR_MESH_NO_PARENT_FOUND (ESP_ERR_MESH_BASE + 14) /**< no parent found to join the mesh network */ -#define ESP_ERR_MESH_NO_ROUTE_FOUND (ESP_ERR_MESH_BASE + 15) /**< no route found to forward the packet */ -#define ESP_ERR_MESH_OPTION_NULL (ESP_ERR_MESH_BASE + 16) /**< no option found */ -#define ESP_ERR_MESH_OPTION_UNKNOWN (ESP_ERR_MESH_BASE + 17) /**< unknown option */ -#define ESP_ERR_MESH_XON_NO_WINDOW (ESP_ERR_MESH_BASE + 18) /**< no window for software flow control on upstream */ -#define ESP_ERR_MESH_INTERFACE (ESP_ERR_MESH_BASE + 19) /**< low-level Wi-Fi interface error */ -#define ESP_ERR_MESH_DISCARD_DUPLICATE (ESP_ERR_MESH_BASE + 20) /**< discard the packet due to the duplicate sequence number */ -#define ESP_ERR_MESH_DISCARD (ESP_ERR_MESH_BASE + 21) /**< discard the packet */ -#define ESP_ERR_MESH_VOTING (ESP_ERR_MESH_BASE + 22) /**< vote in progress */ - -/** - * @brief Flags bitmap for esp_mesh_send() and esp_mesh_recv() - */ -#define MESH_DATA_ENC (0x01) /**< data encrypted (Unimplemented) */ -#define MESH_DATA_P2P (0x02) /**< point-to-point delivery over the mesh network */ -#define MESH_DATA_FROMDS (0x04) /**< receive from external IP network */ -#define MESH_DATA_TODS (0x08) /**< identify this packet is target to external IP network */ -#define MESH_DATA_NONBLOCK (0x10) /**< esp_mesh_send() non-block */ -#define MESH_DATA_DROP (0x20) /**< in the situation of the root having been changed, identify this packet can be dropped by new root */ -#define MESH_DATA_GROUP (0x40) /**< identify this packet is target to a group address */ - -/** - * @brief Option definitions for esp_mesh_send() and esp_mesh_recv() - */ -#define MESH_OPT_SEND_GROUP (7) /**< data transmission by group; used with esp_mesh_send() and shall have payload */ -#define MESH_OPT_RECV_DS_ADDR (8) /**< return a remote IP address; used with esp_mesh_send() and esp_mesh_recv() */ - -/** - * @brief Flag of mesh networking IE - */ -#define MESH_ASSOC_FLAG_VOTE_IN_PROGRESS (0x02) /**< vote in progress */ -#define MESH_ASSOC_FLAG_NETWORK_FREE (0x08) /**< no root in current network */ -#define MESH_ASSOC_FLAG_ROOTS_FOUND (0x20) /**< root conflict is found */ -#define MESH_ASSOC_FLAG_ROOT_FIXED (0x40) /**< fixed root */ - -/******************************************************* - * Enumerations - *******************************************************/ -/** - * @brief Enumerated list of mesh event id - */ -typedef enum { - MESH_EVENT_STARTED, /**< mesh is started */ - MESH_EVENT_STOPPED, /**< mesh is stopped */ - MESH_EVENT_CHANNEL_SWITCH, /**< channel switch */ - MESH_EVENT_CHILD_CONNECTED, /**< a child is connected on softAP interface */ - MESH_EVENT_CHILD_DISCONNECTED, /**< a child is disconnected on softAP interface */ - MESH_EVENT_ROUTING_TABLE_ADD, /**< routing table is changed by adding newly joined children */ - MESH_EVENT_ROUTING_TABLE_REMOVE, /**< routing table is changed by removing leave children */ - MESH_EVENT_PARENT_CONNECTED, /**< parent is connected on station interface */ - MESH_EVENT_PARENT_DISCONNECTED, /**< parent is disconnected on station interface */ - MESH_EVENT_NO_PARENT_FOUND, /**< no parent found */ - MESH_EVENT_LAYER_CHANGE, /**< layer changes over the mesh network */ - MESH_EVENT_TODS_STATE, /**< state represents whether the root is able to access external IP network */ - MESH_EVENT_VOTE_STARTED, /**< the process of voting a new root is started either by children or by the root */ - MESH_EVENT_VOTE_STOPPED, /**< the process of voting a new root is stopped */ - MESH_EVENT_ROOT_ADDRESS, /**< the root address is obtained. It is posted by mesh stack automatically. */ - MESH_EVENT_ROOT_SWITCH_REQ, /**< root switch request sent from a new voted root candidate */ - MESH_EVENT_ROOT_SWITCH_ACK, /**< root switch acknowledgment responds the above request sent from current root */ - MESH_EVENT_ROOT_GOT_IP, /**< the root obtains the IP address. It is posted by LwIP stack automatically */ - MESH_EVENT_ROOT_LOST_IP, /**< the root loses the IP address. It is posted by LwIP stack automatically */ - MESH_EVENT_ROOT_ASKED_YIELD, /**< the root is asked yield by a more powerful existing root. If self organized is disabled - and this device is specified to be a root by users, users should set a new parent - for this device. if self organized is enabled, this device will find a new parent - by itself, users could ignore this event. */ - MESH_EVENT_ROOT_FIXED, /**< when devices join a network, if the setting of Fixed Root for one device is different - from that of its parent, the device will update the setting the same as its parent's. - Fixed Root Setting of each device is variable as that setting changes of the root. */ - MESH_EVENT_SCAN_DONE, /**< if self-organized networking is disabled, user can call esp_wifi_scan_start() to trigger - this event, and add the corresponding scan done handler in this event. */ - MESH_EVENT_NETWORK_STATE, /**< network state, such as whether current mesh network has a root. */ - MESH_EVENT_STOP_RECONNECTION, /**< the root stops reconnecting to the router and non-root devices stop reconnecting to their parents. */ - MESH_EVENT_FIND_NETWORK, /**< when the channel field in mesh configuration is set to zero, mesh stack will perform a - full channel scan to find a mesh network that can join, and return the channel value - after finding it. */ - MESH_EVENT_ROUTER_SWITCH, /**< if users specify BSSID of the router in mesh configuration, when the root connects to another - router with the same SSID, this event will be posted and the new router information is attached. */ - MESH_EVENT_MAX, -} mesh_event_id_t; - -/** - * @brief Device type - */ -typedef enum { - MESH_IDLE, /**< hasn't joined the mesh network yet */ - MESH_ROOT, /**< the only sink of the mesh network. Has the ability to access external IP network */ - MESH_NODE, /**< intermediate device. Has the ability to forward packets over the mesh network */ - MESH_LEAF, /**< has no forwarding ability */ -} mesh_type_t; - -/** - * @brief Protocol of transmitted application data - */ -typedef enum { - MESH_PROTO_BIN, /**< binary */ - MESH_PROTO_HTTP, /**< HTTP protocol */ - MESH_PROTO_JSON, /**< JSON format */ - MESH_PROTO_MQTT, /**< MQTT protocol */ -} mesh_proto_t; - -/** - * @brief For reliable transmission, mesh stack provides three type of services - */ -typedef enum { - MESH_TOS_P2P, /**< provide P2P (point-to-point) retransmission on mesh stack by default */ - MESH_TOS_E2E, /**< provide E2E (end-to-end) retransmission on mesh stack (Unimplemented) */ - MESH_TOS_DEF, /**< no retransmission on mesh stack */ -} mesh_tos_t; - -/** - * @brief Vote reason - */ -typedef enum { - MESH_VOTE_REASON_ROOT_INITIATED = 1, /**< vote is initiated by the root */ - MESH_VOTE_REASON_CHILD_INITIATED, /**< vote is initiated by children */ -} mesh_vote_reason_t; - -/** - * @brief Mesh disconnect reason code - */ -typedef enum { - MESH_REASON_CYCLIC = 100, /**< cyclic is detected */ - MESH_REASON_PARENT_IDLE, /**< parent is idle */ - MESH_REASON_LEAF, /**< the connected device is changed to a leaf */ - MESH_REASON_DIFF_ID, /**< in different mesh ID */ - MESH_REASON_ROOTS, /**< root conflict is detected */ - MESH_REASON_PARENT_STOPPED, /**< parent has stopped the mesh */ - MESH_REASON_SCAN_FAIL, /**< scan fail */ - MESH_REASON_IE_UNKNOWN, /**< unknown IE */ - MESH_REASON_WAIVE_ROOT, /**< waive root */ - MESH_REASON_PARENT_WORSE, /**< parent with very poor RSSI */ - MESH_REASON_EMPTY_PASSWORD, /**< use an empty password to connect to an encrypted parent */ - MESH_REASON_PARENT_UNENCRYPTED, /**< connect to an unencrypted parent/router */ -} mesh_disconnect_reason_t; - -/******************************************************* - * Structures - *******************************************************/ -/** - * @brief IP address and port - */ -typedef struct { - ip4_addr_t ip4; /**< IP address */ - uint16_t port; /**< port */ -} __attribute__((packed)) mip_t; - -/** - * @brief Mesh address - */ -typedef union { - uint8_t addr[6]; /**< mac address */ - mip_t mip; /**< mip address */ -} mesh_addr_t; - -/** - * @brief Channel switch information - */ -typedef struct { - uint8_t channel; /**< new channel */ -} mesh_event_channel_switch_t; - -/** - * @brief Parent connected information - */ -typedef struct { - system_event_sta_connected_t connected; /**< parent information, same as Wi-Fi event SYSTEM_EVENT_STA_CONNECTED does */ - uint8_t self_layer; /**< layer */ -} mesh_event_connected_t; - -/** - * @brief No parent found information - */ -typedef struct { - int scan_times; /**< scan times being through */ -} mesh_event_no_parent_found_t; - -/** - * @brief Layer change information - */ -typedef struct { - uint8_t new_layer; /**< new layer */ -} mesh_event_layer_change_t; - -/** - * @brief The reachability of the root to a DS (distribute system) - */ -typedef enum { - MESH_TODS_UNREACHABLE, /**< the root isn't able to access external IP network */ - MESH_TODS_REACHABLE, /**< the root is able to access external IP network */ -} mesh_event_toDS_state_t; - -/** - * @brief vote started information - */ -typedef struct { - int reason; /**< vote reason, vote could be initiated by children or by the root itself */ - int attempts; /**< max vote attempts before stopped */ - mesh_addr_t rc_addr; /**< root address specified by users via API esp_mesh_waive_root() */ -} mesh_event_vote_started_t; - -/** - * @brief find a mesh network that this device can join - */ -typedef struct { - uint8_t channel; /**< channel number of the new found network */ - uint8_t router_bssid[6]; /**< router BSSID */ -} mesh_event_find_network_t; - -/** - * @brief IP settings from LwIP stack - */ -typedef system_event_sta_got_ip_t mesh_event_root_got_ip_t; - -/** - * @brief Root address - */ -typedef mesh_addr_t mesh_event_root_address_t; - -/** - * @brief Parent disconnected information - */ -typedef system_event_sta_disconnected_t mesh_event_disconnected_t; - -/** - * @brief Child connected information - */ -typedef system_event_ap_staconnected_t mesh_event_child_connected_t; - -/** - * @brief Child disconnected information - */ -typedef system_event_ap_stadisconnected_t mesh_event_child_disconnected_t; - -/** - * @brief Root switch request information - */ -typedef struct { - int reason; /**< root switch reason, generally root switch is initialized by users via API esp_mesh_waive_root() */ - mesh_addr_t rc_addr; /**< the address of root switch requester */ -} mesh_event_root_switch_req_t; - -/** - * @brief Other powerful root address - */ -typedef struct { - int8_t rssi; /**< rssi with router */ - uint16_t capacity; /**< the number of devices in current network */ - uint8_t addr[6]; /**< other powerful root address */ -} mesh_event_root_conflict_t; - -/** - * @brief Routing table change - */ -typedef struct { - uint16_t rt_size_new; /**< the new value */ - uint16_t rt_size_change; /**< the changed value */ -} mesh_event_routing_table_change_t; - -/** - * @brief Root fixed - */ -typedef struct { - bool is_fixed; /**< status */ -} mesh_event_root_fixed_t; - -/** - * @brief Scan done event information - */ -typedef struct { - uint8_t number; /**< the number of APs scanned */ -} mesh_event_scan_done_t; - -/** - * @brief Network state information - */ -typedef struct { - bool is_rootless; /**< whether current mesh network has a root */ -} mesh_event_network_state_t; - -/** - * @brief New router information - */ -typedef system_event_sta_connected_t mesh_event_router_switch_t; - -/** - * @brief Mesh event information - */ -typedef union { - mesh_event_channel_switch_t channel_switch; /**< channel switch */ - mesh_event_child_connected_t child_connected; /**< child connected */ - mesh_event_child_disconnected_t child_disconnected; /**< child disconnected */ - mesh_event_routing_table_change_t routing_table; /**< routing table change */ - mesh_event_connected_t connected; /**< parent connected */ - mesh_event_disconnected_t disconnected; /**< parent disconnected */ - mesh_event_no_parent_found_t no_parent; /**< no parent found */ - mesh_event_layer_change_t layer_change; /**< layer change */ - mesh_event_toDS_state_t toDS_state; /**< toDS state, devices shall check this state firstly before trying to send packets to - external IP network. This state indicates right now whether the root is capable of sending - packets out. If not, devices had better to wait until this state changes to be - MESH_TODS_REACHABLE. */ - mesh_event_vote_started_t vote_started; /**< vote started */ - mesh_event_root_got_ip_t got_ip; /**< root obtains IP address */ - mesh_event_root_address_t root_addr; /**< root address */ - mesh_event_root_switch_req_t switch_req; /**< root switch request */ - mesh_event_root_conflict_t root_conflict; /**< other powerful root */ - mesh_event_root_fixed_t root_fixed; /**< fixed root */ - mesh_event_scan_done_t scan_done; /**< scan done */ - mesh_event_network_state_t network_state; /**< network state, such as whether current mesh network has a root. */ - mesh_event_find_network_t find_network; /**< network found that can join */ - mesh_event_router_switch_t router_switch; /**< new router information */ -} mesh_event_info_t; - -/** - * @brief Mesh event - */ -typedef struct { - mesh_event_id_t id; /**< mesh event id */ - mesh_event_info_t info; /**< mesh event info */ -} mesh_event_t; - -/** - * @brief Mesh event callback handler prototype definition - * - * @param event mesh_event_t - */ -typedef void (*mesh_event_cb_t)(mesh_event_t event); - -/** - * @brief Mesh option - */ -typedef struct { - uint8_t type; /**< option type */ - uint16_t len; /**< option length */ - uint8_t *val; /**< option value */ -} __attribute__((packed)) mesh_opt_t; - -/** - * @brief Mesh data for esp_mesh_send() and esp_mesh_recv() - */ -typedef struct { - uint8_t *data; /**< data */ - uint16_t size; /**< data size */ - mesh_proto_t proto; /**< data protocol */ - mesh_tos_t tos; /**< data type of service */ -} mesh_data_t; - -/** - * @brief Router configuration - */ -typedef struct { - uint8_t ssid[32]; /**< SSID */ - uint8_t ssid_len; /**< length of SSID */ - uint8_t bssid[6]; /**< BSSID, if this value is specified, users should also specify "allow_router_switch". */ - uint8_t password[64]; /**< password */ - bool allow_router_switch; /**< if the BSSID is specified and this value is also set, when the router of this specified BSSID - fails to be found after "fail" (mesh_attempts_t) times, the whole network is allowed to switch - to another router with the same SSID. The new router might also be on a different channel. - The default value is false. - There is a risk that if the password is different between the new switched router and the previous - one, the mesh network could be established but the root will never connect to the new switched router. */ -} mesh_router_t; - -/** - * @brief Mesh softAP configuration - */ -typedef struct { - uint8_t password[64]; /**< mesh softAP password */ - uint8_t max_connection; /**< max number of stations allowed to connect in, max 10 */ -} mesh_ap_cfg_t; - -/** - * @brief Mesh initialization configuration - */ -typedef struct { - uint8_t channel; /**< channel, the mesh network on */ - bool allow_channel_switch; /**< if this value is set, when "fail" (mesh_attempts_t) times is reached, device will change to - a full channel scan for a network that could join. The default value is false. */ - mesh_event_cb_t event_cb; /**< mesh event callback */ - mesh_addr_t mesh_id; /**< mesh network identification */ - mesh_router_t router; /**< router configuration */ - mesh_ap_cfg_t mesh_ap; /**< mesh softAP configuration */ - const mesh_crypto_funcs_t *crypto_funcs; /**< crypto functions */ -} mesh_cfg_t; - -/** - * @brief Vote address configuration - */ -typedef union { - int attempts; /**< max vote attempts before a new root is elected automatically by mesh network. (min:15, 15 by default) */ - mesh_addr_t rc_addr; /**< a new root address specified by users for API esp_mesh_waive_root() */ -} mesh_rc_config_t; - -/** - * @brief Vote - */ -typedef struct { - float percentage; /**< vote percentage threshold for approval of being a root */ - bool is_rc_specified; /**< if true, rc_addr shall be specified (Unimplemented). - if false, attempts value shall be specified to make network start root election. */ - mesh_rc_config_t config; /**< vote address configuration */ -} mesh_vote_t; - -/** - * @brief The number of packets pending in the queue waiting to be sent by the mesh stack - */ -typedef struct { - int to_parent; /**< to parent queue */ - int to_parent_p2p; /**< to parent (P2P) queue */ - int to_child; /**< to child queue */ - int to_child_p2p; /**< to child (P2P) queue */ - int mgmt; /**< management queue */ - int broadcast; /**< broadcast and multicast queue */ -} mesh_tx_pending_t; - -/** - * @brief The number of packets available in the queue waiting to be received by applications - */ -typedef struct { - int toDS; /**< to external DS */ - int toSelf; /**< to self */ -} mesh_rx_pending_t; - -/******************************************************* - * Variable Declaration - *******************************************************/ -/* mesh IE crypto callback function */ -extern const mesh_crypto_funcs_t g_wifi_default_mesh_crypto_funcs; - -/* mesh event callback handler */ -extern mesh_event_cb_t g_mesh_event_cb; - -#define MESH_INIT_CONFIG_DEFAULT() { \ - .crypto_funcs = &g_wifi_default_mesh_crypto_funcs, \ -} - -/******************************************************* - * Function Definitions - *******************************************************/ -/** - * @brief Mesh initialization - * - Check whether Wi-Fi is started. - * - Initialize mesh global variables with default values. - * - * @attention This API shall be called after Wi-Fi is started. - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_mesh_init(void); - -/** - * @brief Mesh de-initialization - * - * - Release resources and stop the mesh - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_mesh_deinit(void); - -/** - * @brief Start mesh - * - Initialize mesh IE. - * - Start mesh network management service. - * - Create TX and RX queues according to the configuration. - * - Register mesh packets receive callback. - * - * @attention  This API shall be called after mesh initialization and configuration. - * - * @return - * - ESP_OK - * - ESP_FAIL - * - ESP_ERR_MESH_NOT_INIT - * - ESP_ERR_MESH_NOT_CONFIG - * - ESP_ERR_MESH_NO_MEMORY - */ -esp_err_t esp_mesh_start(void); - -/** - * @brief Stop mesh - * - Deinitialize mesh IE. - * - Disconnect with current parent. - * - Disassociate all currently associated children. - * - Stop mesh network management service. - * - Unregister mesh packets receive callback. - * - Delete TX and RX queues. - * - Release resources. - * - Restore Wi-Fi softAP to default settings if Wi-Fi dual mode is enabled. - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_mesh_stop(void); - -/** - * @brief Send a packet over the mesh network - * - Send a packet to any device in the mesh network. - * - Send a packet to external IP network. - * - * @attention This API is not reentrant. - * - * @param[in] to the address of the final destination of the packet - * - If the packet is to the root, set this parameter to NULL. - * - If the packet is to an external IP network, set this parameter to the IPv4:PORT combination. - * This packet will be delivered to the root firstly, then the root will forward this packet to the final IP server address. - * @param[in] data pointer to a sending mesh packet - * - Field size should not exceed MESH_MPS. Note that the size of one mesh packet should not exceed MESH_MTU. - * - Field proto should be set to data protocol in use (default is MESH_PROTO_BIN for binary). - * - Field tos should be set to transmission tos (type of service) in use (default is MESH_TOS_P2P for point-to-point reliable). - * @param[in] flag bitmap for data sent - * - Speed up the route search - * - If the packet is to the root and "to" parameter is NULL, set this parameter to 0. - * - If the packet is to an internal device, MESH_DATA_P2P should be set. - * - If the packet is to the root ("to" parameter isn't NULL) or to external IP network, MESH_DATA_TODS should be set. - * - If the packet is from the root to an internal device, MESH_DATA_FROMDS should be set. - * - Specify whether this API is block or non-block, block by default - * - If needs non-block, MESH_DATA_NONBLOCK should be set. - * - In the situation of the root change, MESH_DATA_DROP identifies this packet can be dropped by the new root - * for upstream data to external IP network, we try our best to avoid data loss caused by the root change, but - * there is a risk that the new root is running out of memory because most of memory is occupied by the pending data which - * isn't read out in time by esp_mesh_recv_toDS(). - * - * Generally, we suggest esp_mesh_recv_toDS() is called after a connection with IP network is created. Thus data outgoing - * to external IP network via socket is just from reading esp_mesh_recv_toDS() which avoids unnecessary memory copy. - * - * @param[in] opt options - * - In case of sending a packet to a certain group, MESH_OPT_SEND_GROUP is a good choice. - * In this option, the value field should be set to the target receiver addresses in this group. - * - Root sends a packet to an internal device, this packet is from external IP network in case the receiver device responds - * this packet, MESH_OPT_RECV_DS_ADDR is required to attach the target DS address. - * @param[in] opt_count option count - * - Currently, this API only takes one option, so opt_count is only supported to be 1. - * - * @return - * - ESP_OK - * - ESP_FAIL - * - ESP_ERR_MESH_ARGUMENT - * - ESP_ERR_MESH_NOT_START - * - ESP_ERR_MESH_DISCONNECTED - * - ESP_ERR_MESH_OPT_UNKNOWN - * - ESP_ERR_MESH_EXCEED_MTU - * - ESP_ERR_MESH_NO_MEMORY - * - ESP_ERR_MESH_TIMEOUT - * - ESP_ERR_MESH_QUEUE_FULL - * - ESP_ERR_MESH_NO_ROUTE_FOUND - * - ESP_ERR_MESH_DISCARD - */ -esp_err_t esp_mesh_send(const mesh_addr_t *to, const mesh_data_t *data, - int flag, const mesh_opt_t opt[], int opt_count); - -/** - * @brief Receive a packet targeted to self over the mesh network - * - * @attention Mesh RX queue should be checked regularly to avoid running out of memory. - * - Use esp_mesh_get_rx_pending() to check the number of packets available in the queue waiting - * to be received by applications. - * - * @param[out] from the address of the original source of the packet - * @param[out] data pointer to the received mesh packet - * - Field proto is the data protocol in use. Should follow it to parse the received data. - * - Field tos is the transmission tos (type of service) in use. - * @param[in] timeout_ms wait time if a packet isn't immediately available (0:no wait, portMAX_DELAY:wait forever) - * @param[out] flag bitmap for data received - * - MESH_DATA_FROMDS represents data from external IP network - * - MESH_DATA_TODS represents data directed upward within the mesh network - * - * flag could be MESH_DATA_FROMDS or MESH_DATA_TODS. - * @param[out] opt options desired to receive - * - MESH_OPT_RECV_DS_ADDR attaches the DS address - * @param[in] opt_count option count desired to receive - * - Currently, this API only takes one option, so opt_count is only supported to be 1. - * - * @return - * - ESP_OK - * - ESP_ERR_MESH_ARGUMENT - * - ESP_ERR_MESH_NOT_START - * - ESP_ERR_MESH_TIMEOUT - * - ESP_ERR_MESH_DISCARD - */ -esp_err_t esp_mesh_recv(mesh_addr_t *from, mesh_data_t *data, int timeout_ms, - int *flag, mesh_opt_t opt[], int opt_count); - -/** - * @brief Receive a packet targeted to external IP network - * - Root uses this API to receive packets destined to external IP network - * - Root forwards the received packets to the final destination via socket. - * - If no socket connection is ready to send out the received packets and this esp_mesh_recv_toDS() - * hasn't been called by applications, packets from the whole mesh network will be pending in toDS queue. - * - * Use esp_mesh_get_rx_pending() to check the number of packets available in the queue waiting - * to be received by applications in case of running out of memory in the root. - * - * Using esp_mesh_set_xon_qsize() users may configure the RX queue size, default:32. If this size is too large, - * and esp_mesh_recv_toDS() isn't called in time, there is a risk that a great deal of memory is occupied - * by the pending packets. If this size is too small, it will impact the efficiency on upstream. How to - * decide this value depends on the specific application scenarios. - * - * @attention This API is only called by the root. - * - * @param[out] from the address of the original source of the packet - * @param[out] to the address contains remote IP address and port (IPv4:PORT) - * @param[out] data pointer to the received packet - * - Contain the protocol and applications should follow it to parse the data. - * @param[in] timeout_ms wait time if a packet isn't immediately available (0:no wait, portMAX_DELAY:wait forever) - * @param[out] flag bitmap for data received - * - MESH_DATA_TODS represents the received data target to external IP network. Root shall forward this data to external IP network via the association with router. - * - * flag could be MESH_DATA_TODS. - * @param[out] opt options desired to receive - * @param[in] opt_count option count desired to receive - * - * @return - * - ESP_OK - * - ESP_ERR_MESH_ARGUMENT - * - ESP_ERR_MESH_NOT_START - * - ESP_ERR_MESH_TIMEOUT - * - ESP_ERR_MESH_DISCARD - */ -esp_err_t esp_mesh_recv_toDS(mesh_addr_t *from, mesh_addr_t *to, - mesh_data_t *data, int timeout_ms, int *flag, mesh_opt_t opt[], - int opt_count); - -/** - * @brief Set mesh stack configuration - * - Use MESH_INIT_CONFIG_DEFAULT() to initialize the default values, mesh IE is encrypted by default. - * - Mesh network is established on a fixed channel (1-14). - * - Mesh event callback is mandatory. - * - Mesh ID is an identifier of an MBSS. Nodes with the same mesh ID can communicate with each other. - * - Regarding to the router configuration, if the router is hidden, BSSID field is mandatory. - * - * If BSSID field isn't set and there exists more than one router with same SSID, there is a risk that more - * roots than one connected with different BSSID will appear. It means more than one mesh network is established - * with the same mesh ID. - * - * Root conflict function could eliminate redundant roots connected with the same BSSID, but couldn't handle roots - * connected with different BSSID. Because users might have such requirements of setting up routers with same SSID - * for the future replacement. But in that case, if the above situations happen, please make sure applications - * implement forward functions on the root to guarantee devices in different mesh networks can communicate with each other. - * max_connection of mesh softAP is limited by the max number of Wi-Fi softAP supported (max:10). - * - * @attention This API shall be called before mesh is started after mesh is initialized. - * - * @param[in] config pointer to mesh stack configuration - * - * @return - * - ESP_OK - * - ESP_ERR_MESH_ARGUMENT - * - ESP_ERR_MESH_NOT_ALLOWED - */ -esp_err_t esp_mesh_set_config(const mesh_cfg_t *config); - -/** - * @brief Get mesh stack configuration - * - * @param[out] config pointer to mesh stack configuration - * - * @return - * - ESP_OK - * - ESP_ERR_MESH_ARGUMENT - */ -esp_err_t esp_mesh_get_config(mesh_cfg_t *config); - -/** - * @brief Get router configuration - * - * @attention This API is used to dynamically modify the router configuration after mesh is configured. - * - * @param[in] router pointer to router configuration - * - * @return - * - ESP_OK - * - ESP_ERR_MESH_ARGUMENT - */ -esp_err_t esp_mesh_set_router(const mesh_router_t *router); - -/** - * @brief Get router configuration - * - * @param[out] router pointer to router configuration - * - * @return - * - ESP_OK - * - ESP_ERR_MESH_ARGUMENT - */ -esp_err_t esp_mesh_get_router(mesh_router_t *router); - -/** - * @brief Set mesh network ID - * - * @attention This API is used to dynamically modify the mesh network ID. - * - * @param[in] id pointer to mesh network ID - * - * @return - * - ESP_OK - * - ESP_ERR_MESH_ARGUMENT: invalid argument - */ -esp_err_t esp_mesh_set_id(const mesh_addr_t *id); - -/** - * @brief Get mesh network ID - * - * @param[out] id pointer to mesh network ID - * - * @return - * - ESP_OK - * - ESP_ERR_MESH_ARGUMENT - */ -esp_err_t esp_mesh_get_id(mesh_addr_t *id); - -/** - * @brief Designate device type over the mesh network - * - MESH_ROOT: designates the root node for a mesh network - * - MESH_LEAF: designates a device as a standalone Wi-Fi station - * - * @param[in] type device type - * - * @return - * - ESP_OK - * - ESP_ERR_MESH_NOT_ALLOWED - */ -esp_err_t esp_mesh_set_type(mesh_type_t type); - -/** - * @brief Get device type over mesh network - * - * @attention This API shall be called after having received the event MESH_EVENT_PARENT_CONNECTED. - * - * @return mesh type - * - */ -mesh_type_t esp_mesh_get_type(void); - -/** - * @brief Set network max layer value (max:25, default:25) - * - Network max layer limits the max hop count. - * - * @attention This API shall be called before mesh is started. - * - * @param[in] max_layer max layer value - * - * @return - * - ESP_OK - * - ESP_ERR_MESH_ARGUMENT - * - ESP_ERR_MESH_NOT_ALLOWED - */ -esp_err_t esp_mesh_set_max_layer(int max_layer); - -/** - * @brief Get max layer value - * - * @return max layer value - */ -int esp_mesh_get_max_layer(void); - -/** - * @brief Set mesh softAP password - * - * @attention This API shall be called before mesh is started. - * - * @param[in] pwd pointer to the password - * @param[in] len password length - * - * @return - * - ESP_OK - * - ESP_ERR_MESH_ARGUMENT - * - ESP_ERR_MESH_NOT_ALLOWED - */ -esp_err_t esp_mesh_set_ap_password(const uint8_t *pwd, int len); - -/** - * @brief Set mesh softAP authentication mode - * - * @attention This API shall be called before mesh is started. - * - * @param[in] authmode authentication mode - * - * @return - * - ESP_OK - * - ESP_ERR_MESH_ARGUMENT - * - ESP_ERR_MESH_NOT_ALLOWED - */ -esp_err_t esp_mesh_set_ap_authmode(wifi_auth_mode_t authmode); - -/** - * @brief Get mesh softAP authentication mode - * - * @return authentication mode - */ -wifi_auth_mode_t esp_mesh_get_ap_authmode(void); - -/** - * @brief Set mesh softAP max connection value - * - * @attention This API shall be called before mesh is started. - * - * @param[in] connections the number of max connections - * - * @return - * - ESP_OK - * - ESP_ERR_MESH_ARGUMENT - */ -esp_err_t esp_mesh_set_ap_connections(int connections); - -/** - * @brief Get mesh softAP max connection configuration - * - * @return the number of max connections - */ -int esp_mesh_get_ap_connections(void); - -/** - * @brief Get current layer value over the mesh network - * - * @attention This API shall be called after having received the event MESH_EVENT_PARENT_CONNECTED. - * - * @return layer value - * - */ -int esp_mesh_get_layer(void); - -/** - * @brief Get the parent BSSID - * - * @attention This API shall be called after having received the event MESH_EVENT_PARENT_CONNECTED. - * - * @param[out] bssid pointer to parent BSSID - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_mesh_get_parent_bssid(mesh_addr_t *bssid); - -/** - * @brief Return whether the device is the root node of the network - * - * @return true/false - */ -bool esp_mesh_is_root(void); - -/** - * @brief Enable/disable self-organized networking - * - Self-organized networking has three main functions: - * select the root node; - * find a preferred parent; - * initiate reconnection if a disconnection is detected. - * - Self-organized networking is enabled by default. - * - If self-organized is disabled, users should set a parent for the device via esp_mesh_set_parent(). - * - * @attention This API is used to dynamically modify whether to enable the self organizing. - * - * @param[in] enable enable or disable self-organized networking - * @param[in] select_parent Only valid when self-organized networking is enabled. - * - if select_parent is set to true, the root will give up its mesh root status and search for a new parent - * like other non-root devices. - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_mesh_set_self_organized(bool enable, bool select_parent); - -/** - * @brief Return whether enable self-organized networking or not - * - * @return true/false - */ -bool esp_mesh_get_self_organized(void); - -/** - * @brief Cause the root device to give up (waive) its mesh root status - * - A device is elected root primarily based on RSSI from the external router. - * - If external router conditions change, users can call this API to perform a root switch. - * - In this API, users could specify a desired root address to replace itself or specify an attempts value - * to ask current root to initiate a new round of voting. During the voting, a better root candidate would - * be expected to find to replace the current one. - * - If no desired root candidate, the vote will try a specified number of attempts (at least 15). If no better - * root candidate is found, keep the current one. If a better candidate is found, the new better one will - * send a root switch request to the current root, current root will respond with a root switch acknowledgment. - * - After that, the new candidate will connect to the router to be a new root, the previous root will disconnect - * with the router and choose another parent instead. - * - * Root switch is completed with minimal disruption to the whole mesh network. - * - * @attention This API is only called by the root. - * - * @param[in] vote vote configuration - * - If this parameter is set NULL, the vote will perform the default 15 times. - * - * - Field percentage threshold is 0.9 by default. - * - Field is_rc_specified shall be false. - * - Field attempts shall be at least 15 times. - * @param[in] reason only accept MESH_VOTE_REASON_ROOT_INITIATED for now - * - * @return - * - ESP_OK - * - ESP_ERR_MESH_QUEUE_FULL - * - ESP_ERR_MESH_DISCARD - * - ESP_FAIL - */ -esp_err_t esp_mesh_waive_root(const mesh_vote_t *vote, int reason); - -/** - * @brief Set vote percentage threshold for approval of being a root - * - During the networking, only obtaining vote percentage reaches this threshold, - * the device could be a root. - * - * @attention This API shall be called before mesh is started. - * - * @param[in] percentage vote percentage threshold - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_mesh_set_vote_percentage(float percentage); - -/** - * @brief Get vote percentage threshold for approval of being a root - * - * @return percentage threshold - */ -float esp_mesh_get_vote_percentage(void); - -/** - * @brief Set mesh softAP associate expired time (default:10 seconds) - * - If mesh softAP hasn't received any data from an associated child within this time, - * mesh softAP will take this child inactive and disassociate it. - * - If mesh softAP is encrypted, this value should be set a greater value, such as 30 seconds. - * - * @param[in] seconds the expired time - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_mesh_set_ap_assoc_expire(int seconds); - -/** - * @brief Get mesh softAP associate expired time - * - * @return seconds - */ -int esp_mesh_get_ap_assoc_expire(void); - -/** - * @brief Get total number of devices in current network (including the root) - * - * @attention The returned value might be incorrect when the network is changing. - ** - * @return total number of devices (including the root) - */ -int esp_mesh_get_total_node_num(void); - -/** - * @brief Get the number of devices in this device's sub-network (including self) - * - * @return the number of devices over this device's sub-network (including self) - */ -int esp_mesh_get_routing_table_size(void); - -/** - * @brief Get routing table of this device's sub-network (including itself) - * - * @param[out] mac pointer to routing table - * @param[in] len routing table size(in bytes) - * @param[out] size pointer to the number of devices in routing table (including itself) - * - * @return - * - ESP_OK - * - ESP_ERR_MESH_ARGUMENT - */ -esp_err_t esp_mesh_get_routing_table(mesh_addr_t *mac, int len, int *size); - -/** - * @brief Post the toDS state to the mesh stack - * - * @attention This API is only for the root. - * - * @param[in] reachable this state represents whether the root is able to access external IP network - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_mesh_post_toDS_state(bool reachable); - -/** - * @brief Return the number of packets pending in the queue waiting to be sent by the mesh stack - * - * @param[out] pending pointer to the TX pending - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_mesh_get_tx_pending(mesh_tx_pending_t *pending); - -/** - * @brief Return the number of packets available in the queue waiting to be received by applications - * - * @param[out] pending pointer to the RX pending - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_mesh_get_rx_pending(mesh_rx_pending_t *pending); - -/** - * @brief Return the number of packets could be accepted from the specified address - * - * @param[in] addr self address or an associate children address - * @param[out] xseqno_in sequence number of the last received packet from the specified address - * - * @return the number of upQ for a certain address - */ -int esp_mesh_available_txupQ_num(const mesh_addr_t *addr, uint32_t *xseqno_in); - -/** - * @brief Set the number of queue - * - * @attention This API shall be called before mesh is started. - * - * @param[in] qsize default:32 (min:16) - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_mesh_set_xon_qsize(int qsize); - -/** - * @brief Get queue size - * - * @return the number of queue - */ -int esp_mesh_get_xon_qsize(void); - -/** - * @brief Set whether allow more than one root existing in one network - * - * @param[in] allowed allow or not - * - * @return - * - ESP_OK - * - ESP_WIFI_ERR_NOT_INIT - * - ESP_WIFI_ERR_NOT_START - */ -esp_err_t esp_mesh_allow_root_conflicts(bool allowed); - -/** - * @brief Check whether allow more than one root to exist in one network - * - * @return true/false - */ -bool esp_mesh_is_root_conflicts_allowed(void); - -/** - * @brief Set group ID addresses - * - * @param[in] addr pointer to new group ID addresses - * @param[in] num the number of group ID addresses - * - * @return - * - ESP_OK - * - ESP_MESH_ERR_ARGUMENT - */ -esp_err_t esp_mesh_set_group_id(const mesh_addr_t *addr, int num); - -/** - * @brief Delete group ID addresses - * - * @param[in] addr pointer to deleted group ID address - * @param[in] num the number of group ID addresses - * - * @return - * - ESP_OK - * - ESP_MESH_ERR_ARGUMENT - */ -esp_err_t esp_mesh_delete_group_id(const mesh_addr_t *addr, int num); - -/** - * @brief Get the number of group ID addresses - * - * @return the number of group ID addresses - */ -int esp_mesh_get_group_num(void); - -/** - * @brief Get group ID addresses - * - * @param[out] addr pointer to group ID addresses - * @param[in] num the number of group ID addresses - * - * @return - * - ESP_OK - * - ESP_MESH_ERR_ARGUMENT - */ -esp_err_t esp_mesh_get_group_list(mesh_addr_t *addr, int num); - -/** - * @brief Check whether the specified group address is my group - * - * @return true/false - */ -bool esp_mesh_is_my_group(const mesh_addr_t *addr); - -/** - * @brief Set mesh network capacity (max:1000, default:300) - * - * @attention This API shall be called before mesh is started. - * - * @param[in] num mesh network capacity - * - * @return - * - ESP_OK - * - ESP_ERR_MESH_NOT_ALLOWED - * - ESP_MESH_ERR_ARGUMENT - */ -esp_err_t esp_mesh_set_capacity_num(int num); - -/** - * @brief Get mesh network capacity - * - * @return mesh network capacity - */ -int esp_mesh_get_capacity_num(void); - -/** - * @brief Set mesh IE crypto functions - * - * @attention This API can be called at any time after mesh is initialized. - * - * @param[in] crypto_funcs crypto functions for mesh IE - * - If crypto_funcs is set to NULL, mesh IE is no longer encrypted. - * @return - * - ESP_OK - */ -esp_err_t esp_mesh_set_ie_crypto_funcs(const mesh_crypto_funcs_t *crypto_funcs); - -/** - * @brief Set mesh IE crypto key - * - * @attention This API can be called at any time after mesh is initialized. - * - * @param[in] key ASCII crypto key - * @param[in] len length in bytes, range:8~64 - * - * @return - * - ESP_OK - * - ESP_MESH_ERR_ARGUMENT - */ -esp_err_t esp_mesh_set_ie_crypto_key(const char *key, int len); - -/** - * @brief Get mesh IE crypto key - * - * @param[out] key ASCII crypto key - * @param[in] len length in bytes, range:8~64 - * - * @return - * - ESP_OK - * - ESP_MESH_ERR_ARGUMENT - */ -esp_err_t esp_mesh_get_ie_crypto_key(char *key, int len); - -/** - * @brief Set delay time before starting root healing - * - * @param[in] delay_ms delay time in milliseconds - * - * @return - * - ESP_OK - */ -esp_err_t esp_mesh_set_root_healing_delay(int delay_ms); - -/** - * @brief Get delay time before network starts root healing - * - * @return delay time in milliseconds - */ -int esp_mesh_get_root_healing_delay(void); - -/** - * @brief Set mesh event callback - * - * @param[in] event_cb mesh event call back - * - * @return - * - ESP_OK - */ -esp_err_t esp_mesh_set_event_cb(const mesh_event_cb_t event_cb); - -/** - * @brief Enable network Fixed Root Setting - * - Enabling fixed root disables automatic election of the root node via voting. - * - All devices in the network shall use the same Fixed Root Setting (enabled or disabled). - * - If Fixed Root is enabled, users should make sure a root node is designated for the network. - * - * @param[in] enable enable or not - * - * @return - * - ESP_OK - */ -esp_err_t esp_mesh_fix_root(bool enable); - -/** - * @brief Check whether network Fixed Root Setting is enabled - * - Enable/disable network Fixed Root Setting by API esp_mesh_fix_root(). - * - Network Fixed Root Setting also changes with the "flag" value in parent networking IE. - * - * @return true/false - */ -bool esp_mesh_is_root_fixed(void); - -/** - * @brief Set a specified parent for the device - * - * @attention This API can be called at any time after mesh is configured. - * - * @param[in] parent parent configuration, the SSID and the channel of the parent are mandatory. - * - If the BSSID is set, make sure that the SSID and BSSID represent the same parent, - * otherwise the device will never find this specified parent. - * @param[in] parent_mesh_id parent mesh ID, - * - If this value is not set, the original mesh ID is used. - * @param[in] my_type mesh type - * - If the parent set for the device is the same as the router in the network configuration, - * then my_type shall set MESH_ROOT and my_layer shall set MESH_ROOT_LAYER. - * @param[in] my_layer mesh layer - * - my_layer of the device may change after joining the network. - * - If my_type is set MESH_NODE, my_layer shall be greater than MESH_ROOT_LAYER. - * - If my_type is set MESH_LEAF, the device becomes a standalone Wi-Fi station and no longer - * has the ability to extend the network. - * - * @return - * - ESP_OK - * - ESP_ERR_ARGUMENT - * - ESP_ERR_MESH_NOT_CONFIG - */ -esp_err_t esp_mesh_set_parent(const wifi_config_t *parent, const mesh_addr_t *parent_mesh_id, mesh_type_t my_type, int my_layer); - -/** - * @brief Get mesh networking IE length of one AP - * - * @param[out] len mesh networking IE length - * - * @return - * - ESP_OK - * - ESP_ERR_WIFI_NOT_INIT - * - ESP_ERR_WIFI_ARG - * - ESP_ERR_WIFI_FAIL - */ -esp_err_t esp_mesh_scan_get_ap_ie_len(int *len); - -/** - * @brief Get AP record - * - * @attention Different from esp_wifi_scan_get_ap_records(), this API only gets one of APs scanned each time. - * See "manual_networking" example. - * - * @param[out] ap_record pointer to one AP record - * @param[out] buffer pointer to the mesh networking IE of this AP - * - * @return - * - ESP_OK - * - ESP_ERR_WIFI_NOT_INIT - * - ESP_ERR_WIFI_ARG - * - ESP_ERR_WIFI_FAIL - */ -esp_err_t esp_mesh_scan_get_ap_record(wifi_ap_record_t *ap_record, void *buffer); - -/** - * @brief Flush upstream packets pending in to_parent queue and to_parent_p2p queue - * - * @return - * - ESP_OK - */ -esp_err_t esp_mesh_flush_upstream_packets(void); - -/** - * @brief Get the number of nodes in the subnet of a specific child - * - * @param[in] child_mac an associated child address of this device - * @param[out] nodes_num pointer to the number of nodes in the subnet of a specific child - * - * @return - * - ESP_OK - * - ESP_ERR_MESH_NOT_START - * - ESP_ERR_MESH_ARGUMENT - */ -esp_err_t esp_mesh_get_subnet_nodes_num(const mesh_addr_t *child_mac, int *nodes_num); - -/** - * @brief Get nodes in the subnet of a specific child - * - * @param[in] child_mac an associated child address of this device - * @param[out] nodes pointer to nodes in the subnet of a specific child - * @param[in] nodes_num the number of nodes in the subnet of a specific child - * - * @return - * - ESP_OK - * - ESP_ERR_MESH_NOT_START - * - ESP_ERR_MESH_ARGUMENT - */ -esp_err_t esp_mesh_get_subnet_nodes_list(const mesh_addr_t *child_mac, mesh_addr_t *nodes, int nodes_num); - -/** - * @brief Disconnect from current parent - * - * @return - * - ESP_OK - */ -esp_err_t esp_mesh_disconnect(void); - -/** - * @brief Connect to current parent - * - * @return - * - ESP_OK - */ -esp_err_t esp_mesh_connect(void); - -/** - * @brief Flush scan result - * - * @return - * - ESP_OK - */ -esp_err_t esp_mesh_flush_scan_result(void); - -/** - * @brief Cause the root device to add Channel Switch Announcement Element (CSA IE) to beacon - * - Set the new channel - * - Set how many beacons with CSA IE will be sent before changing a new channel - * - Enable the channel switch function - * - * @attention This API is only called by the root. - * - * @param[in] new_bssid the new router BSSID if the router changes - * @param[in] csa_newchan the new channel number to which the whole network is moving - * @param[in] csa_count channel switch period(beacon count), unit is based on beacon interval of its softAP, the default value is 15. - * - * @return - * - ESP_OK - */ -esp_err_t esp_mesh_switch_channel(const uint8_t *new_bssid, int csa_newchan, int csa_count); - -/** - * @brief Get the router BSSID - * - * @param[out] router_bssid pointer to the router BSSID - * - * @return - * - ESP_OK - * - ESP_ERR_WIFI_NOT_INIT - * - ESP_ERR_WIFI_ARG - */ -esp_err_t esp_mesh_get_router_bssid(uint8_t *router_bssid); - -/** - * @brief Get the TSF time - * - * @return the TSF time - */ -int64_t esp_mesh_get_tsf_time(void); - -#ifdef __cplusplus -} -#endif -#endif /* __ESP_MESH_H__ */ diff --git a/tools/sdk/include/esp32/esp_mesh_internal.h b/tools/sdk/include/esp32/esp_mesh_internal.h deleted file mode 100644 index e061c457725..00000000000 --- a/tools/sdk/include/esp32/esp_mesh_internal.h +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright 2017-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. - -#ifndef __ESP_MESH_INTERNAL_H__ -#define __ESP_MESH_INTERNAL_H__ - -#include "esp_err.h" -#include "esp_wifi.h" -#include "esp_wifi_types.h" -#include "esp_wifi_internal.h" -#include "esp_wifi_crypto_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/******************************************************* - * Constants - *******************************************************/ - -/******************************************************* - * Structures - *******************************************************/ -typedef struct { - int scan; /**< minimum scan times before being a root, default:10 */ - int vote; /**< max vote times in self-healing, default:1000 */ - int fail; /**< parent selection fail times, if the scan times reach this value, - device will disconnect with associated children and join self-healing. default:60 */ - int monitor_ie; /**< acceptable times of parent networking IE change before update its own networking IE. default:3 */ -} mesh_attempts_t; - -typedef struct { - int duration_ms; /* parent weak RSSI monitor duration, if the RSSI continues to be weak during this duration_ms, - device will search for a new parent. */ - int cnx_rssi; /* RSSI threshold for keeping a good connection with parent. - If set a value greater than -120 dBm, a timer will be armed to monitor parent RSSI at a period time of duration_ms. */ - int select_rssi; /* RSSI threshold for parent selection. It should be a value greater than switch_rssi. */ - int switch_rssi; /* Disassociate with current parent and switch to a new parent when the RSSI is greater than this set threshold. */ - int backoff_rssi; /* RSSI threshold for connecting to the root */ -} mesh_switch_parent_t; - -typedef struct { - int high; - int medium; - int low; -} mesh_rssi_threshold_t; - -/** - * @brief Mesh networking IE - */ -typedef struct { - /**< mesh networking IE head */ - uint8_t eid; /**< element ID */ - uint8_t len; /**< element length */ - uint8_t oui[3]; /**< organization identifier */ - /**< mesh networking IE content */ - uint8_t type; /** ESP defined IE type */ - uint8_t encrypted : 1; /**< whether mesh networking IE is encrypted */ - uint8_t version : 7; /**< mesh networking IE version */ - /**< content */ - uint8_t mesh_type; /**< mesh device type */ - uint8_t mesh_id[6]; /**< mesh ID */ - uint8_t layer_cap; /**< max layer */ - uint8_t layer; /**< current layer */ - uint8_t assoc_cap; /**< max connections of mesh AP */ - uint8_t assoc; /**< current connections */ - uint8_t leaf_cap; /**< leaf capacity */ - uint8_t leaf_assoc; /**< the number of current connected leaf */ - uint16_t root_cap; /**< root capacity */ - uint16_t self_cap; /**< self capacity */ - uint16_t layer2_cap; /**< layer2 capacity */ - uint16_t scan_ap_num; /**< the number of scanning APs */ - int8_t rssi; /**< RSSI of the parent */ - int8_t router_rssi; /**< RSSI of the router */ - uint8_t flag; /**< flag of networking */ - uint8_t rc_addr[6]; /**< root address */ - int8_t rc_rssi; /**< root RSSI */ - uint8_t vote_addr[6]; /**< voter address */ - int8_t vote_rssi; /**< vote RSSI of the router */ - uint8_t vote_ttl; /**< vote ttl */ - uint16_t votes; /**< votes */ - uint16_t my_votes; /**< my votes */ - uint8_t reason; /**< reason */ - uint8_t child[6]; /**< child address */ - uint8_t toDS; /**< toDS state */ -} __attribute__((packed)) mesh_assoc_t; - -/******************************************************* - * Function Definitions - *******************************************************/ -/** - * @brief Set mesh softAP beacon interval - * - * @param[in] interval beacon interval (msecs) (100 msecs ~ 60000 msecs) - * - * @return - * - ESP_OK - * - ESP_FAIL - * - ESP_ERR_WIFI_ARG - */ -esp_err_t esp_mesh_set_beacon_interval(int interval_ms); - -/** - * @brief Get mesh softAP beacon interval - * - * @param[out] interval beacon interval (msecs) - * - * @return - * - ESP_OK - */ -esp_err_t esp_mesh_get_beacon_interval(int *interval_ms); - -/** - * @brief Set attempts for mesh self-organized networking - * - * @param[in] attempts - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_mesh_set_attempts(mesh_attempts_t *attempts); - -/** - * @brief Get attempts for mesh self-organized networking - * - * @param[out] attempts - * - * @return - * - ESP_OK - * - ESP_ERR_MESH_ARGUMENT - */ -esp_err_t esp_mesh_get_attempts(mesh_attempts_t *attempts); - -/** - * @brief Set parameters for parent switch - * - * @param[in] paras parameters for parent switch - * - * @return - * - ESP_OK - * - ESP_ERR_MESH_ARGUMENT - */ -esp_err_t esp_mesh_set_switch_parent_paras(mesh_switch_parent_t *paras); - -/** - * @brief Get parameters for parent switch - * - * @param[out] paras parameters for parent switch - * - * @return - * - ESP_OK - * - ESP_ERR_MESH_ARGUMENT - */ -esp_err_t esp_mesh_get_switch_parent_paras(mesh_switch_parent_t *paras); - -/** - * @brief Set RSSI threshold - * - The default high RSSI threshold value is -78 dBm. - * - The default medium RSSI threshold value is -82 dBm. - * - The default low RSSI threshold value is -85 dBm. - * - * @param[in] threshold RSSI threshold - * - * @return - * - ESP_OK - * - ESP_ERR_MESH_ARGUMENT - */ -esp_err_t esp_mesh_set_rssi_threshold(const mesh_rssi_threshold_t *threshold); - -/** - * @brief Get RSSI threshold - * - * @param[out] threshold RSSI threshold - * - * @return - * - ESP_OK - * - ESP_ERR_MESH_ARGUMENT - */ -esp_err_t esp_mesh_get_rssi_threshold(mesh_rssi_threshold_t *threshold); - -/** - * @brief Enable the minimum rate to 6 Mbps - * - * @attention This API shall be called before Wi-Fi is started. - * - * @param[in] is_6m enable or not - * - * @return - * - ESP_OK - */ -esp_err_t esp_mesh_set_6m_rate(bool is_6m); - -/** - * @brief Print the number of txQ waiting - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_mesh_print_txQ_waiting(void); - -/** - * @brief Print the number of rxQ waiting - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_mesh_print_rxQ_waiting(void); - -/** - * @brief Set passive scan time - * - * @param[in] interval_ms passive scan time (msecs) - * - * @return - * - ESP_OK - * - ESP_FAIL - * - ESP_ERR_ARGUMENT - */ -esp_err_t esp_mesh_set_passive_scan_time(int time_ms); - -/** - * @brief Get passive scan time - * - * @return interval_ms passive scan time (msecs) - */ -int esp_mesh_get_passive_scan_time(void); - -/** - * @brief Set announce interval - * - The default short interval is 500 milliseconds. - * - The default long interval is 3000 milliseconds. - * - * @param[in] short_ms shall be greater than the default value - * @param[in] long_ms shall be greater than the default value - * - * @return - * - ESP_OK - */ -esp_err_t esp_mesh_set_announce_interval(int short_ms, int long_ms); - -/** - * @brief Get announce interval - * - * @param[out] short_ms short interval - * @param[out] long_ms long interval - * - * @return - * - ESP_OK - */ -esp_err_t esp_mesh_get_announce_interval(int *short_ms, int *long_ms); - -#ifdef __cplusplus -} -#endif -#endif /* __ESP_MESH_INTERNAL_H__ */ diff --git a/tools/sdk/include/esp32/esp_now.h b/tools/sdk/include/esp32/esp_now.h deleted file mode 100644 index 981c9001e49..00000000000 --- a/tools/sdk/include/esp32/esp_now.h +++ /dev/null @@ -1,317 +0,0 @@ -// 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. - -#ifndef __ESP_NOW_H__ -#define __ESP_NOW_H__ - -#include -#include "esp_err.h" -#include "esp_wifi_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** \defgroup WiFi_APIs WiFi Related APIs - * @brief WiFi APIs - */ - -/** @addtogroup WiFi_APIs - * @{ - */ - -/** \defgroup ESPNOW_APIs ESPNOW APIs - * @brief ESP32 ESPNOW APIs - * - */ - -/** @addtogroup ESPNOW_APIs - * @{ - */ - -#define ESP_ERR_ESPNOW_BASE (ESP_ERR_WIFI_BASE + 100) /*!< ESPNOW error number base. */ -#define ESP_ERR_ESPNOW_NOT_INIT (ESP_ERR_ESPNOW_BASE + 1) /*!< ESPNOW is not initialized. */ -#define ESP_ERR_ESPNOW_ARG (ESP_ERR_ESPNOW_BASE + 2) /*!< Invalid argument */ -#define ESP_ERR_ESPNOW_NO_MEM (ESP_ERR_ESPNOW_BASE + 3) /*!< Out of memory */ -#define ESP_ERR_ESPNOW_FULL (ESP_ERR_ESPNOW_BASE + 4) /*!< ESPNOW peer list is full */ -#define ESP_ERR_ESPNOW_NOT_FOUND (ESP_ERR_ESPNOW_BASE + 5) /*!< ESPNOW peer is not found */ -#define ESP_ERR_ESPNOW_INTERNAL (ESP_ERR_ESPNOW_BASE + 6) /*!< Internal error */ -#define ESP_ERR_ESPNOW_EXIST (ESP_ERR_ESPNOW_BASE + 7) /*!< ESPNOW peer has existed */ -#define ESP_ERR_ESPNOW_IF (ESP_ERR_ESPNOW_BASE + 8) /*!< Interface error */ - -#define ESP_NOW_ETH_ALEN 6 /*!< Length of ESPNOW peer MAC address */ -#define ESP_NOW_KEY_LEN 16 /*!< Length of ESPNOW peer local master key */ - -#define ESP_NOW_MAX_TOTAL_PEER_NUM 20 /*!< Maximum number of ESPNOW total peers */ -#define ESP_NOW_MAX_ENCRYPT_PEER_NUM 6 /*!< Maximum number of ESPNOW encrypted peers */ - -#define ESP_NOW_MAX_DATA_LEN 250 /*!< Maximum length of ESPNOW data which is sent very time */ - -/** - * @brief Status of sending ESPNOW data . - */ -typedef enum { - ESP_NOW_SEND_SUCCESS = 0, /**< Send ESPNOW data successfully */ - ESP_NOW_SEND_FAIL, /**< Send ESPNOW data fail */ -} esp_now_send_status_t; - -/** - * @brief ESPNOW peer information parameters. - */ -typedef struct esp_now_peer_info { - uint8_t peer_addr[ESP_NOW_ETH_ALEN]; /**< ESPNOW peer MAC address that is also the MAC address of station or softap */ - uint8_t lmk[ESP_NOW_KEY_LEN]; /**< ESPNOW peer local master key that is used to encrypt data */ - uint8_t channel; /**< Wi-Fi channel that peer uses to send/receive ESPNOW data. If the value is 0, - use the current channel which station or softap is on. Otherwise, it must be - set as the channel that station or softap is on. */ - wifi_interface_t ifidx; /**< Wi-Fi interface that peer uses to send/receive ESPNOW data */ - bool encrypt; /**< ESPNOW data that this peer sends/receives is encrypted or not */ - void *priv; /**< ESPNOW peer private data */ -} esp_now_peer_info_t; - -/** - * @brief Number of ESPNOW peers which exist currently. - */ -typedef struct esp_now_peer_num { - int total_num; /**< Total number of ESPNOW peers, maximum value is ESP_NOW_MAX_TOTAL_PEER_NUM */ - int encrypt_num; /**< Number of encrypted ESPNOW peers, maximum value is ESP_NOW_MAX_ENCRYPT_PEER_NUM */ -} esp_now_peer_num_t; - -/** - * @brief Callback function of receiving ESPNOW data - * @param mac_addr peer MAC address - * @param data received data - * @param data_len length of received data - */ -typedef void (*esp_now_recv_cb_t)(const uint8_t *mac_addr, const uint8_t *data, int data_len); - -/** - * @brief Callback function of sending ESPNOW data - * @param mac_addr peer MAC address - * @param status status of sending ESPNOW data (succeed or fail) - */ -typedef void (*esp_now_send_cb_t)(const uint8_t *mac_addr, esp_now_send_status_t status); - -/** - * @brief Initialize ESPNOW function - * - * @return - * - ESP_OK : succeed - * - ESP_ERR_ESPNOW_INTERNAL : Internal error - */ -esp_err_t esp_now_init(void); - -/** - * @brief De-initialize ESPNOW function - * - * @return - * - ESP_OK : succeed - */ -esp_err_t esp_now_deinit(void); - -/** - * @brief Get the version of ESPNOW - * - * @param version ESPNOW version - * - * @return - * - ESP_OK : succeed - * - ESP_ERR_ESPNOW_ARG : invalid argument - */ -esp_err_t esp_now_get_version(uint32_t *version); - -/** - * @brief Register callback function of receiving ESPNOW data - * - * @param cb callback function of receiving ESPNOW data - * - * @return - * - ESP_OK : succeed - * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized - * - ESP_ERR_ESPNOW_INTERNAL : internal error - */ -esp_err_t esp_now_register_recv_cb(esp_now_recv_cb_t cb); - -/** - * @brief Unregister callback function of receiving ESPNOW data - * - * @return - * - ESP_OK : succeed - * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized - */ -esp_err_t esp_now_unregister_recv_cb(void); - -/** - * @brief Register callback function of sending ESPNOW data - * - * @param cb callback function of sending ESPNOW data - * - * @return - * - ESP_OK : succeed - * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized - * - ESP_ERR_ESPNOW_INTERNAL : internal error - */ -esp_err_t esp_now_register_send_cb(esp_now_send_cb_t cb); - -/** - * @brief Unregister callback function of sending ESPNOW data - * - * @return - * - ESP_OK : succeed - * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized - */ -esp_err_t esp_now_unregister_send_cb(void); - -/** - * @brief Send ESPNOW data - * - * @attention 1. If peer_addr is not NULL, send data to the peer whose MAC address matches peer_addr - * @attention 2. If peer_addr is NULL, send data to all of the peers that are added to the peer list - * @attention 3. The maximum length of data must be less than ESP_NOW_MAX_DATA_LEN - * @attention 4. The buffer pointed to by data argument does not need to be valid after esp_now_send returns - * - * @param peer_addr peer MAC address - * @param data data to send - * @param len length of data - * - * @return - * - ESP_OK : succeed - * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized - * - ESP_ERR_ESPNOW_ARG : invalid argument - * - ESP_ERR_ESPNOW_INTERNAL : internal error - * - ESP_ERR_ESPNOW_NO_MEM : out of memory - * - ESP_ERR_ESPNOW_NOT_FOUND : peer is not found - * - ESP_ERR_ESPNOW_IF : current WiFi interface doesn't match that of peer - */ -esp_err_t esp_now_send(const uint8_t *peer_addr, const uint8_t *data, size_t len); - -/** - * @brief Add a peer to peer list - * - * @param peer peer information - * - * @return - * - ESP_OK : succeed - * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized - * - ESP_ERR_ESPNOW_ARG : invalid argument - * - ESP_ERR_ESPNOW_FULL : peer list is full - * - ESP_ERR_ESPNOW_NO_MEM : out of memory - * - ESP_ERR_ESPNOW_EXIST : peer has existed - */ -esp_err_t esp_now_add_peer(const esp_now_peer_info_t *peer); - -/** - * @brief Delete a peer from peer list - * - * @param peer_addr peer MAC address - * - * @return - * - ESP_OK : succeed - * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized - * - ESP_ERR_ESPNOW_ARG : invalid argument - * - ESP_ERR_ESPNOW_NOT_FOUND : peer is not found - */ -esp_err_t esp_now_del_peer(const uint8_t *peer_addr); - -/** - * @brief Modify a peer - * - * @param peer peer information - * - * @return - * - ESP_OK : succeed - * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized - * - ESP_ERR_ESPNOW_ARG : invalid argument - * - ESP_ERR_ESPNOW_FULL : peer list is full - */ -esp_err_t esp_now_mod_peer(const esp_now_peer_info_t *peer); - -/** - * @brief Get a peer whose MAC address matches peer_addr from peer list - * - * @param peer_addr peer MAC address - * @param peer peer information - * - * @return - * - ESP_OK : succeed - * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized - * - ESP_ERR_ESPNOW_ARG : invalid argument - * - ESP_ERR_ESPNOW_NOT_FOUND : peer is not found - */ -esp_err_t esp_now_get_peer(const uint8_t *peer_addr, esp_now_peer_info_t *peer); - -/** - * @brief Fetch a peer from peer list - * - * @param from_head fetch from head of list or not - * @param peer peer information - * - * @return - * - ESP_OK : succeed - * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized - * - ESP_ERR_ESPNOW_ARG : invalid argument - * - ESP_ERR_ESPNOW_NOT_FOUND : peer is not found - */ -esp_err_t esp_now_fetch_peer(bool from_head, esp_now_peer_info_t *peer); - -/** - * @brief Peer exists or not - * - * @param peer_addr peer MAC address - * - * @return - * - true : peer exists - * - false : peer not exists - */ -bool esp_now_is_peer_exist(const uint8_t *peer_addr); - -/** - * @brief Get the number of peers - * - * @param num number of peers - * - * @return - * - ESP_OK : succeed - * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized - * - ESP_ERR_ESPNOW_ARG : invalid argument - */ -esp_err_t esp_now_get_peer_num(esp_now_peer_num_t *num); - -/** - * @brief Set the primary master key - * - * @param pmk primary master key - * - * @attention 1. primary master key is used to encrypt local master key - * - * @return - * - ESP_OK : succeed - * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized - * - ESP_ERR_ESPNOW_ARG : invalid argument - */ -esp_err_t esp_now_set_pmk(const uint8_t *pmk); - -/** - * @} - */ - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_NOW_H__ */ diff --git a/tools/sdk/include/esp32/esp_panic.h b/tools/sdk/include/esp32/esp_panic.h deleted file mode 100644 index b9e192f0462..00000000000 --- a/tools/sdk/include/esp32/esp_panic.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef PANIC_H -#define PANIC_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -#define PANIC_RSN_NONE 0 -#define PANIC_RSN_DEBUGEXCEPTION 1 -#define PANIC_RSN_DOUBLEEXCEPTION 2 -#define PANIC_RSN_KERNELEXCEPTION 3 -#define PANIC_RSN_COPROCEXCEPTION 4 -#define PANIC_RSN_INTWDT_CPU0 5 -#define PANIC_RSN_INTWDT_CPU1 6 -#define PANIC_RSN_CACHEERR 7 -#define PANIC_RSN_MAX 7 - - -#ifndef __ASSEMBLER__ - -#include "esp_err.h" - - -/** - * @brief If an OCD is connected over JTAG. set breakpoint 0 to the given function - * address. Do nothing otherwise. - * @param data Pointer to the target breakpoint position - */ - -void esp_set_breakpoint_if_jtag(void *fn); - -#define ESP_WATCHPOINT_LOAD 0x40000000 -#define ESP_WATCHPOINT_STORE 0x80000000 -#define ESP_WATCHPOINT_ACCESS 0xC0000000 - -/** - * @brief Set a watchpoint to break/panic when a certain memory range is accessed. - * - * @param no Watchpoint number. On the ESP32, this can be 0 or 1. - * @param adr Base address to watch - * @param size Size of the region, starting at the base address, to watch. Must - * be one of 2^n, with n in [0..6]. - * @param flags One of ESP_WATCHPOINT_* flags - * - * @return ESP_ERR_INVALID_ARG on invalid arg, ESP_OK otherwise - * - * @warning The ESP32 watchpoint hardware watches a region of bytes by effectively - * masking away the lower n bits for a region with size 2^n. If adr does - * not have zero for these lower n bits, you may not be watching the - * region you intended. - */ -esp_err_t esp_set_watchpoint(int no, void *adr, int size, int flags); - - -/** - * @brief Clear a watchpoint - * - * @param no Watchpoint to clear - * - */ -void esp_clear_watchpoint(int no); - -/** - * @brief Checks stack pointer - */ -static inline bool esp_stack_ptr_is_sane(uint32_t sp) -{ - return !(sp < 0x3ffae010UL || sp > 0x3ffffff0UL || ((sp & 0xf) != 0)); -} -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/esp32/esp_phy_init.h b/tools/sdk/include/esp32/esp_phy_init.h deleted file mode 100644 index 2dfb7447da4..00000000000 --- a/tools/sdk/include/esp32/esp_phy_init.h +++ /dev/null @@ -1,226 +0,0 @@ -// 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. - -#pragma once -#include -#include -#include "esp_err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @file PHY init parameters and API - */ - - -/** - * @brief Structure holding PHY init parameters - */ -typedef struct { - uint8_t params[128]; /*!< opaque PHY initialization parameters */ -} esp_phy_init_data_t; - -/** - * @brief Opaque PHY calibration data - */ -typedef struct { - uint8_t version[4]; /*!< PHY version */ - uint8_t mac[6]; /*!< The MAC address of the station */ - uint8_t opaque[1894]; /*!< calibration data */ -} esp_phy_calibration_data_t; - -typedef enum { - PHY_RF_CAL_PARTIAL = 0x00000000, /*!< Do part of RF calibration. This should be used after power-on reset. */ - PHY_RF_CAL_NONE = 0x00000001, /*!< Don't do any RF calibration. This mode is only suggested to be used after deep sleep reset. */ - PHY_RF_CAL_FULL = 0x00000002 /*!< Do full RF calibration. Produces best results, but also consumes a lot of time and current. Suggested to be used once. */ -} esp_phy_calibration_mode_t; - - -/** - * @brief Modules for modem sleep - */ -typedef enum{ - MODEM_BLE_MODULE, //!< BLE controller used - MODEM_CLASSIC_BT_MODULE, //!< Classic BT controller used - MODEM_WIFI_STATION_MODULE, //!< Wi-Fi Station used - MODEM_WIFI_SOFTAP_MODULE, //!< Wi-Fi SoftAP used - MODEM_WIFI_SNIFFER_MODULE, //!< Wi-Fi Sniffer used - MODEM_WIFI_NULL_MODULE, //!< Wi-Fi Null mode used - MODEM_USER_MODULE, //!< User used - MODEM_MODULE_COUNT //!< Number of items -}modem_sleep_module_t; - -/** - * @brief Module WIFI mask for medem sleep - */ -#define MODEM_BT_MASK ((1< -#include -#include "esp_err.h" - -// Include SoC-specific definitions. Only ESP32 supported for now. -#include "esp32/pm.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Power management constraints - */ -typedef enum { - /** - * Require CPU frequency to be at the maximum value set via esp_pm_configure. - * Argument is unused and should be set to 0. - */ - ESP_PM_CPU_FREQ_MAX, - /** - * Require APB frequency to be at the maximum value supported by the chip. - * Argument is unused and should be set to 0. - */ - ESP_PM_APB_FREQ_MAX, - /** - * Prevent the system from going into light sleep. - * Argument is unused and should be set to 0. - */ - ESP_PM_NO_LIGHT_SLEEP, -} esp_pm_lock_type_t; - -/** - * @brief Set implementation-specific power management configuration - * @param config pointer to implementation-specific configuration structure (e.g. esp_pm_config_esp32) - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_ARG if the configuration values are not correct - * - ESP_ERR_NOT_SUPPORTED if certain combination of values is not supported, - * or if CONFIG_PM_ENABLE is not enabled in sdkconfig - */ -esp_err_t esp_pm_configure(const void* config); - - -/** - * @brief Opaque handle to the power management lock - */ -typedef struct esp_pm_lock* esp_pm_lock_handle_t; - - -/** - * @brief Initialize a lock handle for certain power management parameter - * - * When lock is created, initially it is not taken. - * Call esp_pm_lock_acquire to take the lock. - * - * This function must not be called from an ISR. - * - * @param lock_type Power management constraint which the lock should control - * @param arg argument, value depends on lock_type, see esp_pm_lock_type_t - * @param name arbitrary string identifying the lock (e.g. "wifi" or "spi"). - * Used by the esp_pm_dump_locks function to list existing locks. - * May be set to NULL. If not set to NULL, must point to a string which is valid - * for the lifetime of the lock. - * @param[out] out_handle handle returned from this function. Use this handle when calling - * esp_pm_lock_delete, esp_pm_lock_acquire, esp_pm_lock_release. - * Must not be NULL. - * @return - * - ESP_OK on success - * - ESP_ERR_NO_MEM if the lock structure can not be allocated - * - ESP_ERR_INVALID_ARG if out_handle is NULL or type argument is not valid - * - ESP_ERR_NOT_SUPPORTED if CONFIG_PM_ENABLE is not enabled in sdkconfig - */ -esp_err_t esp_pm_lock_create(esp_pm_lock_type_t lock_type, int arg, - const char* name, esp_pm_lock_handle_t* out_handle); - -/** - * @brief Take a power management lock - * - * Once the lock is taken, power management algorithm will not switch to the - * mode specified in a call to esp_pm_lock_create, or any of the lower power - * modes (higher numeric values of 'mode'). - * - * The lock is recursive, in the sense that if esp_pm_lock_acquire is called - * a number of times, esp_pm_lock_release has to be called the same number of - * times in order to release the lock. - * - * This function may be called from an ISR. - * - * This function is not thread-safe w.r.t. calls to other esp_pm_lock_* - * functions for the same handle. - * - * @param handle handle obtained from esp_pm_lock_create function - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_ARG if the handle is invalid - * - ESP_ERR_NOT_SUPPORTED if CONFIG_PM_ENABLE is not enabled in sdkconfig - */ -esp_err_t esp_pm_lock_acquire(esp_pm_lock_handle_t handle); - -/** - * @brief Release the lock taken using esp_pm_lock_acquire. - * - * Call to this functions removes power management restrictions placed when - * taking the lock. - * - * Locks are recursive, so if esp_pm_lock_acquire is called a number of times, - * esp_pm_lock_release has to be called the same number of times in order to - * actually release the lock. - * - * This function may be called from an ISR. - * - * This function is not thread-safe w.r.t. calls to other esp_pm_lock_* - * functions for the same handle. - * - * @param handle handle obtained from esp_pm_lock_create function - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_ARG if the handle is invalid - * - ESP_ERR_INVALID_STATE if lock is not acquired - * - ESP_ERR_NOT_SUPPORTED if CONFIG_PM_ENABLE is not enabled in sdkconfig - */ -esp_err_t esp_pm_lock_release(esp_pm_lock_handle_t handle); - -/** - * @brief Delete a lock created using esp_pm_lock - * - * The lock must be released before calling this function. - * - * This function must not be called from an ISR. - * - * @param handle handle obtained from esp_pm_lock_create function - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_ARG if the handle argument is NULL - * - ESP_ERR_INVALID_STATE if the lock is still acquired - * - ESP_ERR_NOT_SUPPORTED if CONFIG_PM_ENABLE is not enabled in sdkconfig - */ -esp_err_t esp_pm_lock_delete(esp_pm_lock_handle_t handle); - -/** - * Dump the list of all locks to stderr - * - * This function dumps debugging information about locks created using - * esp_pm_lock_create to an output stream. - * - * This function must not be called from an ISR. If esp_pm_lock_acquire/release - * are called while this function is running, inconsistent results may be - * reported. - * - * @param stream stream to print information to; use stdout or stderr to print - * to the console; use fmemopen/open_memstream to print to a - * string buffer. - * @return - * - ESP_OK on success - * - ESP_ERR_NOT_SUPPORTED if CONFIG_PM_ENABLE is not enabled in sdkconfig - */ -esp_err_t esp_pm_dump_locks(FILE* stream); - - - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/esp32/esp_private/esp_wifi_private.h b/tools/sdk/include/esp32/esp_private/esp_wifi_private.h deleted file mode 100644 index fcdebb6ba59..00000000000 --- a/tools/sdk/include/esp32/esp_private/esp_wifi_private.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2015-2019 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. - -#ifndef _ESP_WIFI_PRIVATE_H -#define _ESP_WIFI_PRIVATE_H - -#include "freertos/FreeRTOS.h" -#include "freertos/queue.h" -#include "rom/queue.h" -#include "sdkconfig.h" -#include "esp_wifi_crypto_types.h" -#include "esp_wifi_os_adapter.h" - -#endif /* _ESP_WIFI_PRIVATE_H */ diff --git a/tools/sdk/include/esp32/esp_private/esp_wifi_types_private.h b/tools/sdk/include/esp32/esp_private/esp_wifi_types_private.h deleted file mode 100644 index dd56e0fdecf..00000000000 --- a/tools/sdk/include/esp32/esp_private/esp_wifi_types_private.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2015-2019 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. - -#ifndef _ESP_WIFI_TYPES_PRIVATE_H -#define _ESP_WIFI_TYPES_PRIVATE_H - -#include "rom/queue.h" -#include "esp_interface.h" - -#endif diff --git a/tools/sdk/include/esp32/esp_sleep.h b/tools/sdk/include/esp32/esp_sleep.h deleted file mode 100644 index c21f26add51..00000000000 --- a/tools/sdk/include/esp32/esp_sleep.h +++ /dev/null @@ -1,373 +0,0 @@ -// 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. - -#pragma once - -#include -#include "esp_err.h" -#include "driver/gpio.h" -#include "driver/touch_pad.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Logic function used for EXT1 wakeup mode. - */ -typedef enum { - ESP_EXT1_WAKEUP_ALL_LOW = 0, //!< Wake the chip when all selected GPIOs go low - ESP_EXT1_WAKEUP_ANY_HIGH = 1 //!< Wake the chip when any of the selected GPIOs go high -} esp_sleep_ext1_wakeup_mode_t; - -/** - * @brief Power domains which can be powered down in sleep mode - */ -typedef enum { - ESP_PD_DOMAIN_RTC_PERIPH, //!< RTC IO, sensors and ULP co-processor - ESP_PD_DOMAIN_RTC_SLOW_MEM, //!< RTC slow memory - ESP_PD_DOMAIN_RTC_FAST_MEM, //!< RTC fast memory - ESP_PD_DOMAIN_XTAL, //!< XTAL oscillator - ESP_PD_DOMAIN_MAX //!< Number of domains -} esp_sleep_pd_domain_t; - -/** - * @brief Power down options - */ -typedef enum { - ESP_PD_OPTION_OFF, //!< Power down the power domain in sleep mode - ESP_PD_OPTION_ON, //!< Keep power domain enabled during sleep mode - ESP_PD_OPTION_AUTO //!< Keep power domain enabled in sleep mode, if it is needed by one of the wakeup options. Otherwise power it down. -} esp_sleep_pd_option_t; - -/** - * @brief Sleep wakeup cause - */ -typedef enum { - ESP_SLEEP_WAKEUP_UNDEFINED, //!< In case of deep sleep, reset was not caused by exit from deep sleep - ESP_SLEEP_WAKEUP_ALL, //!< Not a wakeup cause, used to disable all wakeup sources with esp_sleep_disable_wakeup_source - ESP_SLEEP_WAKEUP_EXT0, //!< Wakeup caused by external signal using RTC_IO - ESP_SLEEP_WAKEUP_EXT1, //!< Wakeup caused by external signal using RTC_CNTL - ESP_SLEEP_WAKEUP_TIMER, //!< Wakeup caused by timer - ESP_SLEEP_WAKEUP_TOUCHPAD, //!< Wakeup caused by touchpad - ESP_SLEEP_WAKEUP_ULP, //!< Wakeup caused by ULP program - ESP_SLEEP_WAKEUP_GPIO, //!< Wakeup caused by GPIO (light sleep only) - ESP_SLEEP_WAKEUP_UART, //!< Wakeup caused by UART (light sleep only) -} esp_sleep_source_t; - -/* Leave this type define for compatibility */ -typedef esp_sleep_source_t esp_sleep_wakeup_cause_t; - -/** - * @brief Disable wakeup source - * - * This function is used to deactivate wake up trigger for source - * defined as parameter of the function. - * - * @note This function does not modify wake up configuration in RTC. - * It will be performed in esp_sleep_start function. - * - * See docs/sleep-modes.rst for details. - * - * @param source - number of source to disable of type esp_sleep_source_t - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if trigger was not active - */ -esp_err_t esp_sleep_disable_wakeup_source(esp_sleep_source_t source); - -/** - * @brief Enable wakeup by ULP coprocessor - * @note In revisions 0 and 1 of the ESP32, ULP wakeup source - * can not be used when RTC_PERIPH power domain is forced - * to be powered on (ESP_PD_OPTION_ON) or when ext0 wakeup - * source is used. - * @return - * - ESP_OK on success - * - ESP_ERR_NOT_SUPPORTED if additional current by touch (CONFIG_ESP32_RTC_EXTERNAL_CRYSTAL_ADDITIONAL_CURRENT) is enabled. - * - ESP_ERR_INVALID_STATE if ULP co-processor is not enabled or if wakeup triggers conflict - */ -esp_err_t esp_sleep_enable_ulp_wakeup(); - -/** - * @brief Enable wakeup by timer - * @param time_in_us time before wakeup, in microseconds - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_ARG if value is out of range (TBD) - */ -esp_err_t esp_sleep_enable_timer_wakeup(uint64_t time_in_us); - -/** - * @brief Enable wakeup by touch sensor - * - * @note In revisions 0 and 1 of the ESP32, touch wakeup source - * can not be used when RTC_PERIPH power domain is forced - * to be powered on (ESP_PD_OPTION_ON) or when ext0 wakeup - * source is used. - * - * @note The FSM mode of the touch button should be configured - * as the timer trigger mode. - * - * @return - * - ESP_OK on success - * - ESP_ERR_NOT_SUPPORTED if additional current by touch (CONFIG_ESP32_RTC_EXTERNAL_CRYSTAL_ADDITIONAL_CURRENT) is enabled. - * - ESP_ERR_INVALID_STATE if wakeup triggers conflict - */ -esp_err_t esp_sleep_enable_touchpad_wakeup(); - -/** - * @brief Get the touch pad which caused wakeup - * - * If wakeup was caused by another source, this function will return TOUCH_PAD_MAX; - * - * @return touch pad which caused wakeup - */ -touch_pad_t esp_sleep_get_touchpad_wakeup_status(); - -/** - * @brief Enable wakeup using a pin - * - * This function uses external wakeup feature of RTC_IO peripheral. - * It will work only if RTC peripherals are kept on during sleep. - * - * This feature can monitor any pin which is an RTC IO. Once the pin transitions - * into the state given by level argument, the chip will be woken up. - * - * @note This function does not modify pin configuration. The pin is - * configured in esp_sleep_start, immediately before entering sleep mode. - * - * @note In revisions 0 and 1 of the ESP32, ext0 wakeup source - * can not be used together with touch or ULP wakeup sources. - * - * @param gpio_num GPIO number used as wakeup source. Only GPIOs which are have RTC - * functionality can be used: 0,2,4,12-15,25-27,32-39. - * @param level input level which will trigger wakeup (0=low, 1=high) - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_ARG if the selected GPIO is not an RTC GPIO, - * or the mode is invalid - * - ESP_ERR_INVALID_STATE if wakeup triggers conflict - */ -esp_err_t esp_sleep_enable_ext0_wakeup(gpio_num_t gpio_num, int level); - -/** - * @brief Enable wakeup using multiple pins - * - * This function uses external wakeup feature of RTC controller. - * It will work even if RTC peripherals are shut down during sleep. - * - * This feature can monitor any number of pins which are in RTC IOs. - * Once any of the selected pins goes into the state given by mode argument, - * the chip will be woken up. - * - * @note This function does not modify pin configuration. The pins are - * configured in esp_sleep_start, immediately before - * entering sleep mode. - * - * @note internal pullups and pulldowns don't work when RTC peripherals are - * shut down. In this case, external resistors need to be added. - * Alternatively, RTC peripherals (and pullups/pulldowns) may be - * kept enabled using esp_sleep_pd_config function. - * - * @param mask bit mask of GPIO numbers which will cause wakeup. Only GPIOs - * which are have RTC functionality can be used in this bit map: - * 0,2,4,12-15,25-27,32-39. - * @param mode select logic function used to determine wakeup condition: - * - ESP_EXT1_WAKEUP_ALL_LOW: wake up when all selected GPIOs are low - * - ESP_EXT1_WAKEUP_ANY_HIGH: wake up when any of the selected GPIOs is high - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_ARG if any of the selected GPIOs is not an RTC GPIO, - * or mode is invalid - */ -esp_err_t esp_sleep_enable_ext1_wakeup(uint64_t mask, esp_sleep_ext1_wakeup_mode_t mode); - -/** - * @brief Enable wakeup from light sleep using GPIOs - * - * Each GPIO supports wakeup function, which can be triggered on either low level - * or high level. Unlike EXT0 and EXT1 wakeup sources, this method can be used - * both for all IOs: RTC IOs and digital IOs. It can only be used to wakeup from - * light sleep though. - * - * To enable wakeup, first call gpio_wakeup_enable, specifying gpio number and - * wakeup level, for each GPIO which is used for wakeup. - * Then call this function to enable wakeup feature. - * - * @note In revisions 0 and 1 of the ESP32, GPIO wakeup source - * can not be used together with touch or ULP wakeup sources. - * - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if wakeup triggers conflict - */ -esp_err_t esp_sleep_enable_gpio_wakeup(); - -/** - * @brief Enable wakeup from light sleep using UART - * - * Use uart_set_wakeup_threshold function to configure UART wakeup threshold. - * - * Wakeup from light sleep takes some time, so not every character sent - * to the UART can be received by the application. - * - * @note ESP32 does not support wakeup from UART2. - * - * @param uart_num UART port to wake up from - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_ARG if wakeup from given UART is not supported - */ -esp_err_t esp_sleep_enable_uart_wakeup(int uart_num); - -/** - * @brief Get the bit mask of GPIOs which caused wakeup (ext1) - * - * If wakeup was caused by another source, this function will return 0. - * - * @return bit mask, if GPIOn caused wakeup, BIT(n) will be set - */ -uint64_t esp_sleep_get_ext1_wakeup_status(); - -/** - * @brief Set power down mode for an RTC power domain in sleep mode - * - * If not set set using this API, all power domains default to ESP_PD_OPTION_AUTO. - * - * @param domain power domain to configure - * @param option power down option (ESP_PD_OPTION_OFF, ESP_PD_OPTION_ON, or ESP_PD_OPTION_AUTO) - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_ARG if either of the arguments is out of range - */ -esp_err_t esp_sleep_pd_config(esp_sleep_pd_domain_t domain, - esp_sleep_pd_option_t option); - -/** - * @brief Enter deep sleep with the configured wakeup options - * - * This function does not return. - */ -void esp_deep_sleep_start() __attribute__((noreturn)); - -/** - * @brief Enter light sleep with the configured wakeup options - * - * @return - * - ESP_OK on success (returned after wakeup) - * - ESP_ERR_INVALID_STATE if WiFi or BT is not stopped - */ -esp_err_t esp_light_sleep_start(); - -/** - * @brief Enter deep-sleep mode - * - * The device will automatically wake up after the deep-sleep time - * Upon waking up, the device calls deep sleep wake stub, and then proceeds - * to load application. - * - * Call to this function is equivalent to a call to esp_deep_sleep_enable_timer_wakeup - * followed by a call to esp_deep_sleep_start. - * - * esp_deep_sleep does not shut down WiFi, BT, and higher level protocol - * connections gracefully. - * Make sure relevant WiFi and BT stack functions are called to close any - * connections and deinitialize the peripherals. These include: - * - esp_bluedroid_disable - * - esp_bt_controller_disable - * - esp_wifi_stop - * - * This function does not return. - * - * @param time_in_us deep-sleep time, unit: microsecond - */ -void esp_deep_sleep(uint64_t time_in_us) __attribute__((noreturn)); - -/** - * @brief Enter deep-sleep mode - * - * Function has been renamed to esp_deep_sleep. - * This name is deprecated and will be removed in a future version. - * - * @param time_in_us deep-sleep time, unit: microsecond - */ -void system_deep_sleep(uint64_t time_in_us) __attribute__((noreturn, deprecated)); - - -/** - * @brief Get the wakeup source which caused wakeup from sleep - * - * @return cause of wake up from last sleep (deep sleep or light sleep) - */ -esp_sleep_wakeup_cause_t esp_sleep_get_wakeup_cause(); - - -/** - * @brief Default stub to run on wake from deep sleep. - * - * Allows for executing code immediately on wake from sleep, before - * the software bootloader or ESP-IDF app has started up. - * - * This function is weak-linked, so you can implement your own version - * to run code immediately when the chip wakes from - * sleep. - * - * See docs/deep-sleep-stub.rst for details. - */ -void esp_wake_deep_sleep(void); - -/** - * @brief Function type for stub to run on wake from sleep. - * - */ -typedef void (*esp_deep_sleep_wake_stub_fn_t)(void); - -/** - * @brief Install a new stub at runtime to run on wake from deep sleep - * - * If implementing esp_wake_deep_sleep() then it is not necessary to - * call this function. - * - * However, it is possible to call this function to substitute a - * different deep sleep stub. Any function used as a deep sleep stub - * must be marked RTC_IRAM_ATTR, and must obey the same rules given - * for esp_wake_deep_sleep(). - */ -void esp_set_deep_sleep_wake_stub(esp_deep_sleep_wake_stub_fn_t new_stub); - -/** - * @brief Get current wake from deep sleep stub - * @return Return current wake from deep sleep stub, or NULL if - * no stub is installed. - */ -esp_deep_sleep_wake_stub_fn_t esp_get_deep_sleep_wake_stub(void); - -/** - * @brief The default esp-idf-provided esp_wake_deep_sleep() stub. - * - * See docs/deep-sleep-stub.rst for details. - */ -void esp_default_wake_deep_sleep(void); - -/** - * @brief Disable logging from the ROM code after deep sleep. - * - * Using LSB of RTC_STORE4. - */ -void esp_deep_sleep_disable_rom_logging(void); - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/esp32/esp_smartconfig.h b/tools/sdk/include/esp32/esp_smartconfig.h deleted file mode 100644 index 34cf8667ab9..00000000000 --- a/tools/sdk/include/esp32/esp_smartconfig.h +++ /dev/null @@ -1,136 +0,0 @@ -// 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. - -#ifndef __ESP_SMARTCONFIG_H__ -#define __ESP_SMARTCONFIG_H__ - -#include -#include -#include "esp_err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - SC_STATUS_WAIT = 0, /**< Waiting to start connect */ - SC_STATUS_FIND_CHANNEL, /**< Finding target channel */ - SC_STATUS_GETTING_SSID_PSWD, /**< Getting SSID and password of target AP */ - SC_STATUS_LINK, /**< Connecting to target AP */ - SC_STATUS_LINK_OVER, /**< Connected to AP successfully */ -} smartconfig_status_t; - -typedef enum { - SC_TYPE_ESPTOUCH = 0, /**< protocol: ESPTouch */ - SC_TYPE_AIRKISS, /**< protocol: AirKiss */ - SC_TYPE_ESPTOUCH_AIRKISS, /**< protocol: ESPTouch and AirKiss */ -} smartconfig_type_t; - -/** - * @brief The callback of SmartConfig, executed when smart-config status changed. - * - * @param status Status of SmartConfig: - * - SC_STATUS_GETTING_SSID_PSWD : pdata is a pointer of smartconfig_type_t, means config type. - * - SC_STATUS_LINK : pdata is a pointer to wifi_config_t. - * - SC_STATUS_LINK_OVER : pdata is a pointer of phone's IP address(4 bytes) if pdata unequal NULL. - * - otherwise : parameter void *pdata is NULL. - * @param pdata According to the different status have different values. - * - */ -typedef void (*sc_callback_t)(smartconfig_status_t status, void *pdata); - -/** - * @brief Get the version of SmartConfig. - * - * @return - * - SmartConfig version const char. - */ -const char *esp_smartconfig_get_version(void); - -/** - * @brief Start SmartConfig, config ESP device to connect AP. You need to broadcast information by phone APP. - * Device sniffer special packets from the air that containing SSID and password of target AP. - * - * @attention 1. This API can be called in station or softAP-station mode. - * @attention 2. Can not call esp_smartconfig_start twice before it finish, please call - * esp_smartconfig_stop first. - * - * @param cb SmartConfig callback function. - * @param ... log 1: UART output logs; 0: UART only outputs the result. - * - * @return - * - ESP_OK: succeed - * - others: fail - */ -esp_err_t esp_smartconfig_start(sc_callback_t cb, ...); - -/** - * @brief Stop SmartConfig, free the buffer taken by esp_smartconfig_start. - * - * @attention Whether connect to AP succeed or not, this API should be called to free - * memory taken by smartconfig_start. - * - * @return - * - ESP_OK: succeed - * - others: fail - */ -esp_err_t esp_smartconfig_stop(void); - -/** - * @brief Set timeout of SmartConfig process. - * - * @attention Timing starts from SC_STATUS_FIND_CHANNEL status. SmartConfig will restart if timeout. - * - * @param time_s range 15s~255s, offset:45s. - * - * @return - * - ESP_OK: succeed - * - others: fail - */ -esp_err_t esp_esptouch_set_timeout(uint8_t time_s); - -/** - * @brief Set protocol type of SmartConfig. - * - * @attention If users need to set the SmartConfig type, please set it before calling - * esp_smartconfig_start. - * - * @param type Choose from the smartconfig_type_t. - * - * @return - * - ESP_OK: succeed - * - others: fail - */ -esp_err_t esp_smartconfig_set_type(smartconfig_type_t type); - -/** - * @brief Set mode of SmartConfig. default normal mode. - * - * @attention 1. Please call it before API esp_smartconfig_start. - * @attention 2. Fast mode have corresponding APP(phone). - * @attention 3. Two mode is compatible. - * - * @param enable false-disable(default); true-enable; - * - * @return - * - ESP_OK: succeed - * - others: fail - */ -esp_err_t esp_smartconfig_fast_mode(bool enable); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/esp32/esp_spiram.h b/tools/sdk/include/esp32/esp_spiram.h deleted file mode 100644 index a55872cd4de..00000000000 --- a/tools/sdk/include/esp32/esp_spiram.h +++ /dev/null @@ -1,116 +0,0 @@ -// 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. - - -#ifndef __ESP_SPIRAM_H -#define __ESP_SPIRAM_H - -#include -#include -#include -#include "esp_err.h" - -typedef enum { - ESP_SPIRAM_SIZE_16MBITS = 0, /*!< SPI RAM size is 16 MBits */ - ESP_SPIRAM_SIZE_32MBITS = 1, /*!< SPI RAM size is 32 MBits */ - ESP_SPIRAM_SIZE_64MBITS = 2, /*!< SPI RAM size is 64 MBits */ - ESP_SPIRAM_SIZE_INVALID, /*!< SPI RAM size is invalid */ -} esp_spiram_size_t; - -/** - * @brief get SPI RAM size - * @return - * - ESP_SPIRAM_SIZE_INVALID if SPI RAM not enabled or not valid - * - SPI RAM size - */ -esp_spiram_size_t esp_spiram_get_chip_size(); - -/** - * @brief Initialize spiram interface/hardware. Normally called from cpu_start.c. - * - * @return ESP_OK on success - */ -esp_err_t esp_spiram_init(); - -/** - * @brief Configure Cache/MMU for access to external SPI RAM. - * - * Normally this function is called from cpu_start, if CONFIG_SPIRAM_BOOT_INIT - * option is enabled. Applications which need to enable SPI RAM at run time - * can disable CONFIG_SPIRAM_BOOT_INIT, and call this function later. - * - * @attention this function must be called with flash cache disabled. - */ -void esp_spiram_init_cache(); - - -/** - * @brief Memory test for SPI RAM. Should be called after SPI RAM is initialized and - * (in case of a dual-core system) the app CPU is online. This test overwrites the - * memory with crap, so do not call after e.g. the heap allocator has stored important - * stuff in SPI RAM. - * - * @return true on success, false on failed memory test - */ -bool esp_spiram_test(); - - -/** - * @brief Add the initialized SPI RAM to the heap allocator. - */ -esp_err_t esp_spiram_add_to_heapalloc(); - - -/** - * @brief Get the size of the attached SPI RAM chip selected in menuconfig - * - * @return Size in bytes, or 0 if no external RAM chip support compiled in. - */ -size_t esp_spiram_get_size(); - - -/** - * @brief Force a writeback of the data in the SPI RAM cache. This is to be called whenever - * cache is disabled, because disabling cache on the ESP32 discards the data in the SPI - * RAM cache. - * - * This is meant for use from within the SPI flash code. - */ -void esp_spiram_writeback_cache(); - - - -/** - * @brief Reserve a pool of internal memory for specific DMA/internal allocations - * - * @param size Size of reserved pool in bytes - * - * @return - * - ESP_OK on success - * - ESP_ERR_NO_MEM when no memory available for pool - */ -esp_err_t esp_spiram_reserve_dma_pool(size_t size); - - -/** - * @brief If SPI RAM(PSRAM) has been initialized - * - * @return - * - true SPI RAM has been initialized successfully - * - false SPI RAM hasn't been initialized or initialized failed - */ -bool esp_spiram_is_initialized(void); - - -#endif diff --git a/tools/sdk/include/esp32/esp_ssc.h b/tools/sdk/include/esp32/esp_ssc.h deleted file mode 100644 index 02893ff4106..00000000000 --- a/tools/sdk/include/esp32/esp_ssc.h +++ /dev/null @@ -1,119 +0,0 @@ -// 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. - -#ifndef __ESP_SSC_H__ -#define __ESP_SSC_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define CMD_T_ASYNC 0x01 -#define CMD_T_SYNC 0x02 - -typedef struct cmd_s { - char *cmd_str; - uint8_t flag; - uint8_t id; - void (* cmd_func)(void); - void (* cmd_callback)(void *arg); -} ssc_cmd_t; - -#define MAX_LINE_N 127 - -typedef enum { - SSC_BR_9600 = 9600, - SSC_BR_19200 = 19200, - SSC_BR_38400 = 38400, - SSC_BR_57600 = 57600, - SSC_BR_74880 = 74880, - SSC_BR_115200 = 115200, - SSC_BR_230400 = 230400, - SSC_BR_460800 = 460800, - SSC_BR_921600 = 921600 -} SscBaudRate; - -/** \defgroup SSC_APIs SSC APIs - * @brief SSC APIs - * - * SSC means simple serial command. - * SSC APIs allows users to define their own command, users can refer to spiffs_test/test_main.c. - * - */ - -/** @addtogroup SSC_APIs - * @{ - */ - -/** - * @brief Initial the ssc function. - * - * @attention param is no use, just compatible with ESP8266, default bandrate is 115200 - * - * @param SscBaudRate bandrate : baud rate - * - * @return null - */ -void ssc_attach(SscBaudRate bandrate); - -/** - * @brief Get the length of the simple serial command. - * - * @param null - * - * @return length of the command. - */ -int ssc_param_len(void); - -/** - * @brief Get the simple serial command string. - * - * @param null - * - * @return the command. - */ -char *ssc_param_str(void); - -/** - * @brief Parse the simple serial command (ssc). - * - * @param char *pLine : [input] the ssc string - * @param char *argv[] : [output] parameters of the ssc - * - * @return the number of parameters. - */ -int ssc_parse_param(char *pLine, char *argv[]); - -/** - * @brief Register the user-defined simple serial command (ssc) set. - * - * @param ssc_cmd_t *cmdset : the ssc set - * @param uint8 cmdnum : number of commands - * @param void (* help)(void) : callback of user-guide - * - * @return null - */ -void ssc_register(ssc_cmd_t *cmdset, uint8_t cmdnum, void (* help)(void)); - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_SSC_H__ */ diff --git a/tools/sdk/include/esp32/esp_system.h b/tools/sdk/include/esp32/esp_system.h deleted file mode 100644 index 05214c8f57b..00000000000 --- a/tools/sdk/include/esp32/esp_system.h +++ /dev/null @@ -1,336 +0,0 @@ -// 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. - -#ifndef __ESP_SYSTEM_H__ -#define __ESP_SYSTEM_H__ - -#include -#include -#include "esp_err.h" -#include "esp_sleep.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - ESP_MAC_WIFI_STA, - ESP_MAC_WIFI_SOFTAP, - ESP_MAC_BT, - ESP_MAC_ETH, -} esp_mac_type_t; - -/** @cond */ -#define TWO_UNIVERSAL_MAC_ADDR 2 -#define FOUR_UNIVERSAL_MAC_ADDR 4 -#define UNIVERSAL_MAC_ADDR_NUM CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS -/** @endcond */ - -/** - * @brief Reset reasons - */ -typedef enum { - ESP_RST_UNKNOWN, //!< Reset reason can not be determined - ESP_RST_POWERON, //!< Reset due to power-on event - ESP_RST_EXT, //!< Reset by external pin (not applicable for ESP32) - ESP_RST_SW, //!< Software reset via esp_restart - ESP_RST_PANIC, //!< Software reset due to exception/panic - ESP_RST_INT_WDT, //!< Reset (software or hardware) due to interrupt watchdog - ESP_RST_TASK_WDT, //!< Reset due to task watchdog - ESP_RST_WDT, //!< Reset due to other watchdogs - ESP_RST_DEEPSLEEP, //!< Reset after exiting deep sleep mode - ESP_RST_BROWNOUT, //!< Brownout reset (software or hardware) - ESP_RST_SDIO, //!< Reset over SDIO -} esp_reset_reason_t; - -/** @cond */ -/** - * @attention Applications don't need to call this function anymore. It does nothing and will - * be removed in future version. - */ -void system_init(void) __attribute__ ((deprecated)); - -/** - * @brief Reset to default settings. - * - * Function has been deprecated, please use esp_wifi_restore instead. - * This name will be removed in a future release. - */ -void system_restore(void) __attribute__ ((deprecated)); -/** @endcond */ - -/** - * Shutdown handler type - */ -typedef void (*shutdown_handler_t)(void); - -/** - * @brief Register shutdown handler - * - * This function allows you to register a handler that gets invoked before - * the application is restarted using esp_restart function. - */ -esp_err_t esp_register_shutdown_handler(shutdown_handler_t handle); - -/** - * @brief Restart PRO and APP CPUs. - * - * This function can be called both from PRO and APP CPUs. - * After successful restart, CPU reset reason will be SW_CPU_RESET. - * Peripherals (except for WiFi, BT, UART0, SPI1, and legacy timers) are not reset. - * This function does not return. - */ -void esp_restart(void) __attribute__ ((noreturn)); - -/** @cond */ -/** - * @brief Restart system. - * - * Function has been renamed to esp_restart. - * This name will be removed in a future release. - */ -void system_restart(void) __attribute__ ((deprecated, noreturn)); -/** @endcond */ - -/** - * @brief Get reason of last reset - * @return See description of esp_reset_reason_t for explanation of each value. - */ -esp_reset_reason_t esp_reset_reason(void); - -/** @cond */ -/** - * @brief Get system time, unit: microsecond. - * - * This function is deprecated. Use 'gettimeofday' function for 64-bit precision. - * This definition will be removed in a future release. - */ -uint32_t system_get_time(void) __attribute__ ((deprecated)); -/** @endcond */ - -/** - * @brief Get the size of available heap. - * - * Note that the returned value may be larger than the maximum contiguous block - * which can be allocated. - * - * @return Available heap size, in bytes. - */ -uint32_t esp_get_free_heap_size(void); - -/** @cond */ -/** - * @brief Get the size of available heap. - * - * Function has been renamed to esp_get_free_heap_size. - * This name will be removed in a future release. - * - * @return Available heap size, in bytes. - */ -uint32_t system_get_free_heap_size(void) __attribute__ ((deprecated)); -/** @endcond */ - -/** - * @brief Get the minimum heap that has ever been available - * - * @return Minimum free heap ever available - */ -uint32_t esp_get_minimum_free_heap_size( void ); - -/** - * @brief Get one random 32-bit word from hardware RNG - * - * The hardware RNG is fully functional whenever an RF subsystem is running (ie Bluetooth or WiFi is enabled). For - * random values, call this function after WiFi or Bluetooth are started. - * - * If the RF subsystem is not used by the program, the function bootloader_random_enable() can be called to enable an - * entropy source. bootloader_random_disable() must be called before RF subsystem or I2S peripheral are used. See these functions' - * documentation for more details. - * - * Any time the app is running without an RF subsystem (or bootloader_random) enabled, RNG hardware should be - * considered a PRNG. A very small amount of entropy is available due to pre-seeding while the IDF - * bootloader is running, but this should not be relied upon for any use. - * - * @return Random value between 0 and UINT32_MAX - */ -uint32_t esp_random(void); - -/** - * @brief Fill a buffer with random bytes from hardware RNG - * - * @note This function has the same restrictions regarding available entropy as esp_random() - * - * @param buf Pointer to buffer to fill with random numbers. - * @param len Length of buffer in bytes - */ -void esp_fill_random(void *buf, size_t len); - -/** - * @brief Set base MAC address with the MAC address which is stored in BLK3 of EFUSE or - * external storage e.g. flash and EEPROM. - * - * Base MAC address is used to generate the MAC addresses used by the networking interfaces. - * If using base MAC address stored in BLK3 of EFUSE or external storage, call this API to set base MAC - * address with the MAC address which is stored in BLK3 of EFUSE or external storage before initializing - * WiFi/BT/Ethernet. - * - * @param mac base MAC address, length: 6 bytes. - * - * @return ESP_OK on success - */ -esp_err_t esp_base_mac_addr_set(uint8_t *mac); - -/** - * @brief Return base MAC address which is set using esp_base_mac_addr_set. - * - * @param mac base MAC address, length: 6 bytes. - * - * @return ESP_OK on success - * ESP_ERR_INVALID_MAC base MAC address has not been set - */ -esp_err_t esp_base_mac_addr_get(uint8_t *mac); - -/** - * @brief Return base MAC address which was previously written to BLK3 of EFUSE. - * - * Base MAC address is used to generate the MAC addresses used by the networking interfaces. - * This API returns the custom base MAC address which was previously written to BLK3 of EFUSE. - * Writing this EFUSE allows setting of a different (non-Espressif) base MAC address. It is also - * possible to store a custom base MAC address elsewhere, see esp_base_mac_addr_set() for details. - * - * @param mac base MAC address, length: 6 bytes. - * - * @return ESP_OK on success - * ESP_ERR_INVALID_VERSION An invalid MAC version field was read from BLK3 of EFUSE - * ESP_ERR_INVALID_CRC An invalid MAC CRC was read from BLK3 of EFUSE - */ -esp_err_t esp_efuse_mac_get_custom(uint8_t *mac); - -/** - * @brief Return base MAC address which is factory-programmed by Espressif in BLK0 of EFUSE. - * - * @param mac base MAC address, length: 6 bytes. - * - * @return ESP_OK on success - */ -esp_err_t esp_efuse_mac_get_default(uint8_t *mac); - -/** @cond */ -/** - * @brief Read hardware MAC address from efuse. - * - * Function has been renamed to esp_efuse_mac_get_default. - * This name will be removed in a future release. - * - * @param mac hardware MAC address, length: 6 bytes. - * - * @return ESP_OK on success - */ -esp_err_t esp_efuse_read_mac(uint8_t *mac) __attribute__ ((deprecated)); - -/** - * @brief Read hardware MAC address. - * - * Function has been renamed to esp_efuse_mac_get_default. - * This name will be removed in a future release. - * - * @param mac hardware MAC address, length: 6 bytes. - * @return ESP_OK on success - */ -esp_err_t system_efuse_read_mac(uint8_t *mac) __attribute__ ((deprecated)); -/** @endcond */ - -/** - * @brief Read base MAC address and set MAC address of the interface. - * - * This function first get base MAC address using esp_base_mac_addr_get or reads base MAC address - * from BLK0 of EFUSE. Then set the MAC address of the interface including wifi station, wifi softap, - * bluetooth and ethernet. - * - * @param mac MAC address of the interface, length: 6 bytes. - * @param type type of MAC address, 0:wifi station, 1:wifi softap, 2:bluetooth, 3:ethernet. - * - * @return ESP_OK on success - */ -esp_err_t esp_read_mac(uint8_t* mac, esp_mac_type_t type); - -/** - * @brief Derive local MAC address from universal MAC address. - * - * This function derives a local MAC address from an universal MAC address. - * A `definition of local vs universal MAC address can be found on Wikipedia - * `. - * In ESP32, universal MAC address is generated from base MAC address in EFUSE or other external storage. - * Local MAC address is derived from the universal MAC address. - * - * @param local_mac Derived local MAC address, length: 6 bytes. - * @param universal_mac Source universal MAC address, length: 6 bytes. - * - * @return ESP_OK on success - */ -esp_err_t esp_derive_local_mac(uint8_t* local_mac, const uint8_t* universal_mac); - -/** @cond */ -/** - * Get SDK version - * - * This function is deprecated and will be removed in a future release. - * - * @return constant string "master" - */ -const char* system_get_sdk_version(void) __attribute__ ((deprecated)); -/** @endcond */ - -/** - * Get IDF version - * - * @return constant string from IDF_VER - */ -const char* esp_get_idf_version(void); - - -/** - * @brief Chip models - */ -typedef enum { - CHIP_ESP32 = 1, //!< ESP32 -} esp_chip_model_t; - -/* Chip feature flags, used in esp_chip_info_t */ -#define CHIP_FEATURE_EMB_FLASH BIT(0) //!< Chip has embedded flash memory -#define CHIP_FEATURE_WIFI_BGN BIT(1) //!< Chip has 2.4GHz WiFi -#define CHIP_FEATURE_BLE BIT(4) //!< Chip has Bluetooth LE -#define CHIP_FEATURE_BT BIT(5) //!< Chip has Bluetooth Classic - -/** - * @brief The structure represents information about the chip - */ -typedef struct { - esp_chip_model_t model; //!< chip model, one of esp_chip_model_t - uint32_t features; //!< bit mask of CHIP_FEATURE_x feature flags - uint8_t cores; //!< number of CPU cores - uint8_t revision; //!< chip revision number -} esp_chip_info_t; - -/** - * @brief Fill an esp_chip_info_t structure with information about the chip - * @param[out] out_info structure to be filled - */ -void esp_chip_info(esp_chip_info_t* out_info); - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_SYSTEM_H__ */ diff --git a/tools/sdk/include/esp32/esp_task.h b/tools/sdk/include/esp32/esp_task.h deleted file mode 100644 index 754014b5511..00000000000 --- a/tools/sdk/include/esp32/esp_task.h +++ /dev/null @@ -1,58 +0,0 @@ -// 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. - -/* Notes: - * 1. Put all task priority and stack size definition in this file - * 2. If the task priority is less than 10, use ESP_TASK_PRIO_MIN + X style, - * otherwise use ESP_TASK_PRIO_MAX - X style - * 3. If this is a daemon task, the macro prefix is ESP_TASKD_, otherwise - * it's ESP_TASK_ - * 4. If the configMAX_PRIORITIES is modified, please make all priority are - * greater than 0 - * 5. Make sure esp_task.h is consistent between wifi lib and idf - */ - -#ifndef _ESP_TASK_H_ -#define _ESP_TASK_H_ - -#include "sdkconfig.h" -#include "freertos/FreeRTOSConfig.h" - -#define ESP_TASK_PRIO_MAX (configMAX_PRIORITIES) -#define ESP_TASK_PRIO_MIN (0) - -/* Bt contoller Task */ -/* controller */ -#define ESP_TASK_BT_CONTROLLER_PRIO (ESP_TASK_PRIO_MAX - 2) -#ifdef CONFIG_NEWLIB_NANO_FORMAT -#define TASK_EXTRA_STACK_SIZE (0) -#else -#define TASK_EXTRA_STACK_SIZE (512) -#endif - -#define BT_TASK_EXTRA_STACK_SIZE TASK_EXTRA_STACK_SIZE -#define ESP_TASK_BT_CONTROLLER_STACK (3584 + TASK_EXTRA_STACK_SIZE) - - -/* idf task */ -#define ESP_TASK_TIMER_PRIO (ESP_TASK_PRIO_MAX - 3) -#define ESP_TASK_TIMER_STACK (CONFIG_TIMER_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE) -#define ESP_TASKD_EVENT_PRIO (ESP_TASK_PRIO_MAX - 5) -#define ESP_TASKD_EVENT_STACK (CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE) -#define ESP_TASK_TCPIP_PRIO (ESP_TASK_PRIO_MAX - 7) -#define ESP_TASK_TCPIP_STACK (CONFIG_TCPIP_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE) -#define ESP_TASK_MAIN_PRIO (ESP_TASK_PRIO_MIN + 1) -#define ESP_TASK_MAIN_STACK (CONFIG_MAIN_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE) - -#endif diff --git a/tools/sdk/include/esp32/esp_task_wdt.h b/tools/sdk/include/esp32/esp_task_wdt.h deleted file mode 100644 index 60b0e5e5c9a..00000000000 --- a/tools/sdk/include/esp32/esp_task_wdt.h +++ /dev/null @@ -1,163 +0,0 @@ -// 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. - -#pragma once - -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "esp_err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Initialize the Task Watchdog Timer (TWDT) - * - * This function configures and initializes the TWDT. If the TWDT is already - * initialized when this function is called, this function will update the - * TWDT's timeout period and panic configurations instead. After initializing - * the TWDT, any task can elect to be watched by the TWDT by subscribing to it - * using esp_task_wdt_add(). - * - * @param[in] timeout Timeout period of TWDT in seconds - * @param[in] panic Flag that controls whether the panic handler will be - * executed when the TWDT times out - * - * @return - * - ESP_OK: Initialization was successful - * - ESP_ERR_NO_MEM: Initialization failed due to lack of memory - * - * @note esp_task_wdt_init() must only be called after the scheduler - * started - */ -esp_err_t esp_task_wdt_init(uint32_t timeout, bool panic); - -/** - * @brief Deinitialize the Task Watchdog Timer (TWDT) - * - * This function will deinitialize the TWDT. Calling this function whilst tasks - * are still subscribed to the TWDT, or when the TWDT is already deinitialized, - * will result in an error code being returned. - * - * @return - * - ESP_OK: TWDT successfully deinitialized - * - ESP_ERR_INVALID_STATE: Error, tasks are still subscribed to the TWDT - * - ESP_ERR_NOT_FOUND: Error, TWDT has already been deinitialized - */ -esp_err_t esp_task_wdt_deinit(); - -/** - * @brief Subscribe a task to the Task Watchdog Timer (TWDT) - * - * This function subscribes a task to the TWDT. Each subscribed task must - * periodically call esp_task_wdt_reset() to prevent the TWDT from elapsing its - * timeout period. Failure to do so will result in a TWDT timeout. If the task - * being subscribed is one of the Idle Tasks, this function will automatically - * enable esp_task_wdt_reset() to called from the Idle Hook of the Idle Task. - * Calling this function whilst the TWDT is uninitialized or attempting to - * subscribe an already subscribed task will result in an error code being - * returned. - * - * @param[in] handle Handle of the task. Input NULL to subscribe the current - * running task to the TWDT - * - * @return - * - ESP_OK: Successfully subscribed the task to the TWDT - * - ESP_ERR_INVALID_ARG: Error, the task is already subscribed - * - ESP_ERR_NO_MEM: Error, could not subscribe the task due to lack of - * memory - * - ESP_ERR_INVALID_STATE: Error, the TWDT has not been initialized yet - */ -esp_err_t esp_task_wdt_add(TaskHandle_t handle); - -/** - * @brief Reset the Task Watchdog Timer (TWDT) on behalf of the currently - * running task - * - * This function will reset the TWDT on behalf of the currently running task. - * Each subscribed task must periodically call this function to prevent the - * TWDT from timing out. If one or more subscribed tasks fail to reset the - * TWDT on their own behalf, a TWDT timeout will occur. If the IDLE tasks have - * been subscribed to the TWDT, they will automatically call this function from - * their idle hooks. Calling this function from a task that has not subscribed - * to the TWDT, or when the TWDT is uninitialized will result in an error code - * being returned. - * - * @return - * - ESP_OK: Successfully reset the TWDT on behalf of the currently - * running task - * - ESP_ERR_NOT_FOUND: Error, the current running task has not subscribed - * to the TWDT - * - ESP_ERR_INVALID_STATE: Error, the TWDT has not been initialized yet - */ -esp_err_t esp_task_wdt_reset(); - -/** - * @brief Unsubscribes a task from the Task Watchdog Timer (TWDT) - * - * This function will unsubscribe a task from the TWDT. After being - * unsubscribed, the task should no longer call esp_task_wdt_reset(). If the - * task is an IDLE task, this function will automatically disable the calling - * of esp_task_wdt_reset() from the Idle Hook. Calling this function whilst the - * TWDT is uninitialized or attempting to unsubscribe an already unsubscribed - * task from the TWDT will result in an error code being returned. - * - * @param[in] handle Handle of the task. Input NULL to unsubscribe the - * current running task. - * - * @return - * - ESP_OK: Successfully unsubscribed the task from the TWDT - * - ESP_ERR_INVALID_ARG: Error, the task is already unsubscribed - * - ESP_ERR_INVALID_STATE: Error, the TWDT has not been initialized yet - */ -esp_err_t esp_task_wdt_delete(TaskHandle_t handle); - -/** - * @brief Query whether a task is subscribed to the Task Watchdog Timer (TWDT) - * - * This function will query whether a task is currently subscribed to the TWDT, - * or whether the TWDT is initialized. - * - * @param[in] handle Handle of the task. Input NULL to query the current - * running task. - * - * @return: - * - ESP_OK: The task is currently subscribed to the TWDT - * - ESP_ERR_NOT_FOUND: The task is currently not subscribed to the TWDT - * - ESP_ERR_INVALID_STATE: The TWDT is not initialized, therefore no tasks - * can be subscribed - */ -esp_err_t esp_task_wdt_status(TaskHandle_t handle); - -/** - * @brief Reset the TWDT on behalf of the current running task, or - * subscribe the TWDT to if it has not done so already - * - * @warning This function is deprecated, use esp_task_wdt_add() and - * esp_task_wdt_reset() instead - * - * This function is similar to esp_task_wdt_reset() and will reset the TWDT on - * behalf of the current running task. However if this task has not subscribed - * to the TWDT, this function will automatically subscribe the task. Therefore, - * an unsubscribed task will subscribe to the TWDT on its first call to this - * function, then proceed to reset the TWDT on subsequent calls of this - * function. - */ -void esp_task_wdt_feed() __attribute__ ((deprecated)); - - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/esp32/esp_timer.h b/tools/sdk/include/esp32/esp_timer.h deleted file mode 100644 index ff5c13ab4c1..00000000000 --- a/tools/sdk/include/esp32/esp_timer.h +++ /dev/null @@ -1,233 +0,0 @@ -// 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. - -#pragma once - -/** - * @file esp_timer.h - * @brief microsecond-precision 64-bit timer API, replacement for ets_timer - * - * esp_timer APIs allow components to receive callbacks when a hardware timer - * reaches certain value. The timer provides microsecond accuracy and - * up to 64 bit range. Note that while the timer itself provides microsecond - * accuracy, callbacks are dispatched from an auxiliary task. Some time is - * needed to notify this task from timer ISR, and then to invoke the callback. - * If more than one callback needs to be dispatched at any particular time, - * each subsequent callback will be dispatched only when the previous callback - * returns. Therefore, callbacks should not do much work; instead, they should - * use RTOS notification mechanisms (queues, semaphores, event groups, etc.) to - * pass information to other tasks. - * - * To be implemented: it should be possible to request the callback to be called - * directly from the ISR. This reduces the latency, but has potential impact on - * all other callbacks which need to be dispatched. This option should only be - * used for simple callback functions, which do not take longer than a few - * microseconds to run. - * - * Implementation note: on the ESP32, esp_timer APIs use the "legacy" FRC2 - * timer. Timer callbacks are called from a task running on the PRO CPU. - */ - -#include -#include -#include "esp_err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Opaque type representing a single esp_timer - */ -typedef struct esp_timer* esp_timer_handle_t; - -/** - * @brief Timer callback function type - * @param arg pointer to opaque user-specific data - */ -typedef void (*esp_timer_cb_t)(void* arg); - - -/** - * @brief Method for dispatching timer callback - */ -typedef enum { - ESP_TIMER_TASK, //!< Callback is called from timer task - - /* Not supported for now, provision to allow callbacks to run directly - * from an ISR: - - ESP_TIMER_ISR, //!< Callback is called from timer ISR - - */ -} esp_timer_dispatch_t; - -/** - * @brief Timer configuration passed to esp_timer_create - */ -typedef struct { - esp_timer_cb_t callback; //!< Function to call when timer expires - void* arg; //!< Argument to pass to the callback - esp_timer_dispatch_t dispatch_method; //!< Call the callback from task or from ISR - const char* name; //!< Timer name, used in esp_timer_dump function -} esp_timer_create_args_t; - -/** - * @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. - * - * @return - * - ESP_OK on success - * - ESP_ERR_NO_MEM if allocation has failed - * - ESP_ERR_INVALID_STATE if already initialized - * - other errors from interrupt allocator - */ -esp_err_t esp_timer_init(); - -/** - * @brief De-initialize esp_timer library - * - * @note Normally this function should not be called from applications - * - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if not yet initialized - */ -esp_err_t esp_timer_deinit(); - -/** - * @brief Create an esp_timer instance - * - * @note When done using the timer, delete it with esp_timer_delete function. - * - * @param create_args Pointer to a structure with timer creation arguments. - * Not saved by the library, can be allocated on the stack. - * @param[out] out_handle Output, pointer to esp_timer_handle_t variable which - * will hold the created timer handle. - * - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_ARG if some of the create_args are not valid - * - ESP_ERR_INVALID_STATE if esp_timer library is not initialized yet - * - ESP_ERR_NO_MEM if memory allocation fails - */ -esp_err_t esp_timer_create(const esp_timer_create_args_t* create_args, - esp_timer_handle_t* out_handle); - -/** - * @brief Start one-shot timer - * - * Timer should not be running when this function is called. - * - * @param timer timer handle created using esp_timer_create - * @param timeout_us timer timeout, in microseconds relative to the current moment - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_ARG if the handle is invalid - * - ESP_ERR_INVALID_STATE if the timer is already running - */ -esp_err_t esp_timer_start_once(esp_timer_handle_t timer, uint64_t timeout_us); - -/** - * @brief Start a periodic timer - * - * Timer should not be running when this function is called. This function will - * start the timer which will trigger every 'period' microseconds. - * - * @param timer timer handle created using esp_timer_create - * @param period timer period, in microseconds - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_ARG if the handle is invalid - * - ESP_ERR_INVALID_STATE if the timer is already running - */ -esp_err_t esp_timer_start_periodic(esp_timer_handle_t timer, uint64_t period); - -/** - * @brief Stop the timer - * - * This function stops the timer previously started using esp_timer_start_once - * or esp_timer_start_periodic. - * - * @param timer timer handle created using esp_timer_create - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if the timer is not running - */ -esp_err_t esp_timer_stop(esp_timer_handle_t timer); - -/** - * @brief Delete an esp_timer instance - * - * The timer must be stopped before deleting. A one-shot timer which has expired - * does not need to be stopped. - * - * @param timer timer handle allocated using esp_timer_create - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if the timer is not running - */ -esp_err_t esp_timer_delete(esp_timer_handle_t timer); - -/** - * @brief Get time in microseconds since boot - * @return number of microseconds since esp_timer_init was called (this normally - * happens early during application startup). - */ -int64_t esp_timer_get_time(); - -/** - * @brief Get the timestamp when the next timeout is expected to occur - * @return Timestamp of the nearest timer event, in microseconds. - * The timebase is the same as for the values returned by esp_timer_get_time. - */ -int64_t esp_timer_get_next_alarm(); - -/** - * @brief Dump the list of timers to a stream - * - * If CONFIG_ESP_TIMER_PROFILING option is enabled, this prints the list of all - * the existing timers. Otherwise, only the list active timers is printed. - * - * The format is: - * - * name period alarm times_armed times_triggered total_callback_run_time - * - * where: - * - * name — timer name (if CONFIG_ESP_TIMER_PROFILING is defined), or timer pointer - * period — period of timer, in microseconds, or 0 for one-shot timer - * alarm - time of the next alarm, in microseconds since boot, or 0 if the timer - * is not started - * - * The following fields are printed if CONFIG_ESP_TIMER_PROFILING is defined: - * - * times_armed — number of times the timer was armed via esp_timer_start_X - * times_triggered - number of times the callback was called - * total_callback_run_time - total time taken by callback to execute, across all calls - * - * @param stream stream (such as stdout) to dump the information to - * @return - * - ESP_OK on success - * - ESP_ERR_NO_MEM if can not allocate temporary buffer for the output - */ -esp_err_t esp_timer_dump(FILE* stream); - - -#ifdef __cplusplus -} -#endif - diff --git a/tools/sdk/include/esp32/esp_types.h b/tools/sdk/include/esp32/esp_types.h deleted file mode 100644 index 547024e3f75..00000000000 --- a/tools/sdk/include/esp32/esp_types.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2010-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. - -#ifndef __ESP_TYPES_H__ -#define __ESP_TYPES_H__ - -#ifdef __GNUC__ -#include -#endif /*__GNUC__*/ -#include -#include -#include - -#endif /* __ESP_TYPES_H__ */ diff --git a/tools/sdk/include/esp32/esp_wifi.h b/tools/sdk/include/esp32/esp_wifi.h deleted file mode 100644 index 57014b8d9a2..00000000000 --- a/tools/sdk/include/esp32/esp_wifi.h +++ /dev/null @@ -1,1070 +0,0 @@ -// 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. - - -/* Notes about WiFi Programming - * - * The esp32 WiFi programming model can be depicted as following picture: - * - * - * default handler user handler - * ------------- --------------- --------------- - * | | event | | callback or | | - * | tcpip | ---------> | event | ----------> | application | - * | stack | | task | event | task | - * |-----------| |-------------| |-------------| - * /|\ | - * | | - * event | | - * | | - * | | - * --------------- | - * | | | - * | WiFi Driver |/__________________| - * | |\ API call - * | | - * |-------------| - * - * The WiFi driver can be consider as black box, it knows nothing about the high layer code, such as - * TCPIP stack, application task, event task etc, all it can do is to receive API call from high layer - * or post event queue to a specified Queue, which is initialized by API esp_wifi_init(). - * - * The event task is a daemon task, which receives events from WiFi driver or from other subsystem, such - * as TCPIP stack, event task will call the default callback function on receiving the event. For example, - * on receiving event SYSTEM_EVENT_STA_CONNECTED, it will call tcpip_adapter_start() to start the DHCP - * client in it's default handler. - * - * Application can register it's own event callback function by API esp_event_init, then the application callback - * function will be called after the default callback. Also, if application doesn't want to execute the callback - * in the event task, what it needs to do is to post the related event to application task in the application callback function. - * - * The application task (code) generally mixes all these thing together, it calls APIs to init the system/WiFi and - * handle the events when necessary. - * - */ - -#ifndef __ESP_WIFI_H__ -#define __ESP_WIFI_H__ - -#include -#include -#include "esp_err.h" -#include "esp_wifi_types.h" -#include "esp_event.h" -#include "esp_private/esp_wifi_private.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ESP_ERR_WIFI_NOT_INIT (ESP_ERR_WIFI_BASE + 1) /*!< WiFi driver was not installed by esp_wifi_init */ -#define ESP_ERR_WIFI_NOT_STARTED (ESP_ERR_WIFI_BASE + 2) /*!< WiFi driver was not started by esp_wifi_start */ -#define ESP_ERR_WIFI_NOT_STOPPED (ESP_ERR_WIFI_BASE + 3) /*!< WiFi driver was not stopped by esp_wifi_stop */ -#define ESP_ERR_WIFI_IF (ESP_ERR_WIFI_BASE + 4) /*!< WiFi interface error */ -#define ESP_ERR_WIFI_MODE (ESP_ERR_WIFI_BASE + 5) /*!< WiFi mode error */ -#define ESP_ERR_WIFI_STATE (ESP_ERR_WIFI_BASE + 6) /*!< WiFi internal state error */ -#define ESP_ERR_WIFI_CONN (ESP_ERR_WIFI_BASE + 7) /*!< WiFi internal control block of station or soft-AP error */ -#define ESP_ERR_WIFI_NVS (ESP_ERR_WIFI_BASE + 8) /*!< WiFi internal NVS module error */ -#define ESP_ERR_WIFI_MAC (ESP_ERR_WIFI_BASE + 9) /*!< MAC address is invalid */ -#define ESP_ERR_WIFI_SSID (ESP_ERR_WIFI_BASE + 10) /*!< SSID is invalid */ -#define ESP_ERR_WIFI_PASSWORD (ESP_ERR_WIFI_BASE + 11) /*!< Password is invalid */ -#define ESP_ERR_WIFI_TIMEOUT (ESP_ERR_WIFI_BASE + 12) /*!< Timeout error */ -#define ESP_ERR_WIFI_WAKE_FAIL (ESP_ERR_WIFI_BASE + 13) /*!< WiFi is in sleep state(RF closed) and wakeup fail */ -#define ESP_ERR_WIFI_WOULD_BLOCK (ESP_ERR_WIFI_BASE + 14) /*!< The caller would block */ -#define ESP_ERR_WIFI_NOT_CONNECT (ESP_ERR_WIFI_BASE + 15) /*!< Station still in disconnect status */ - -#define ESP_ERR_WIFI_POST (ESP_ERR_WIFI_BASE + 18) /*!< Failed to post the event to WiFi task */ -#define ESP_ERR_WIFI_INIT_STATE (ESP_ERR_WIFI_BASE + 19) /*!< Invalod WiFi state when init/deinit is called */ -#define ESP_ERR_WIFI_STOP_STATE (ESP_ERR_WIFI_BASE + 20) /*!< Returned when WiFi is stopping */ - -/** - * @brief WiFi stack configuration parameters passed to esp_wifi_init call. - */ -typedef struct { - system_event_handler_t event_handler; /**< WiFi event handler */ - wifi_osi_funcs_t* osi_funcs; /**< WiFi OS functions */ - wpa_crypto_funcs_t wpa_crypto_funcs; /**< WiFi station crypto functions when connect */ - int static_rx_buf_num; /**< WiFi static RX buffer number */ - int dynamic_rx_buf_num; /**< WiFi dynamic RX buffer number */ - int tx_buf_type; /**< WiFi TX buffer type */ - int static_tx_buf_num; /**< WiFi static TX buffer number */ - int dynamic_tx_buf_num; /**< WiFi dynamic TX buffer number */ - int csi_enable; /**< WiFi channel state information enable flag */ - int ampdu_rx_enable; /**< WiFi AMPDU RX feature enable flag */ - int ampdu_tx_enable; /**< WiFi AMPDU TX feature enable flag */ - int nvs_enable; /**< WiFi NVS flash enable flag */ - int nano_enable; /**< Nano option for printf/scan family enable flag */ - int tx_ba_win; /**< WiFi Block Ack TX window size */ - int rx_ba_win; /**< WiFi Block Ack RX window size */ - int wifi_task_core_id; /**< WiFi Task Core ID */ - int beacon_max_len; /**< WiFi softAP maximum length of the beacon */ - int mgmt_sbuf_num; /**< WiFi management short buffer number, the minimum value is 6, the maximum value is 32 */ - int magic; /**< WiFi init magic number, it should be the last field */ -} wifi_init_config_t; - -#ifdef CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM -#define WIFI_STATIC_TX_BUFFER_NUM CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM -#else -#define WIFI_STATIC_TX_BUFFER_NUM 0 -#endif - -#ifdef CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM -#define WIFI_DYNAMIC_TX_BUFFER_NUM CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM -#else -#define WIFI_DYNAMIC_TX_BUFFER_NUM 0 -#endif - -#if CONFIG_ESP32_WIFI_CSI_ENABLED -#define WIFI_CSI_ENABLED 1 -#else -#define WIFI_CSI_ENABLED 0 -#endif - -#if CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED -#define WIFI_AMPDU_RX_ENABLED 1 -#else -#define WIFI_AMPDU_RX_ENABLED 0 -#endif - -#if CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED -#define WIFI_AMPDU_TX_ENABLED 1 -#else -#define WIFI_AMPDU_TX_ENABLED 0 -#endif - -#if CONFIG_ESP32_WIFI_NVS_ENABLED -#define WIFI_NVS_ENABLED 1 -#else -#define WIFI_NVS_ENABLED 0 -#endif - -#if CONFIG_NEWLIB_NANO_FORMAT -#define WIFI_NANO_FORMAT_ENABLED 1 -#else -#define WIFI_NANO_FORMAT_ENABLED 0 -#endif - -extern const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs; - -#define WIFI_INIT_CONFIG_MAGIC 0x1F2F3F4F - -#ifdef CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED -#define WIFI_DEFAULT_TX_BA_WIN CONFIG_ESP32_WIFI_TX_BA_WIN -#else -#define WIFI_DEFAULT_TX_BA_WIN 0 /* unused if ampdu_tx_enable == false */ -#endif - -#ifdef CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED -#define WIFI_DEFAULT_RX_BA_WIN CONFIG_ESP32_WIFI_RX_BA_WIN -#else -#define WIFI_DEFAULT_RX_BA_WIN 0 /* unused if ampdu_rx_enable == false */ -#endif - -#if CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 -#define WIFI_TASK_CORE_ID 1 -#else -#define WIFI_TASK_CORE_ID 0 -#endif - -#ifdef CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN -#define WIFI_SOFTAP_BEACON_MAX_LEN CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN -#else -#define WIFI_SOFTAP_BEACON_MAX_LEN 752 -#endif - -#ifdef CONFIG_ESP32_WIFI_MGMT_SBUF_NUM -#define WIFI_MGMT_SBUF_NUM CONFIG_ESP32_WIFI_MGMT_SBUF_NUM -#else -#define WIFI_MGMT_SBUF_NUM 32 -#endif - -#define WIFI_INIT_CONFIG_DEFAULT() { \ - .event_handler = &esp_event_send, \ - .osi_funcs = &g_wifi_osi_funcs, \ - .wpa_crypto_funcs = g_wifi_default_wpa_crypto_funcs, \ - .static_rx_buf_num = CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM,\ - .dynamic_rx_buf_num = CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM,\ - .tx_buf_type = CONFIG_ESP32_WIFI_TX_BUFFER_TYPE,\ - .static_tx_buf_num = WIFI_STATIC_TX_BUFFER_NUM,\ - .dynamic_tx_buf_num = WIFI_DYNAMIC_TX_BUFFER_NUM,\ - .csi_enable = WIFI_CSI_ENABLED,\ - .ampdu_rx_enable = WIFI_AMPDU_RX_ENABLED,\ - .ampdu_tx_enable = WIFI_AMPDU_TX_ENABLED,\ - .nvs_enable = WIFI_NVS_ENABLED,\ - .nano_enable = WIFI_NANO_FORMAT_ENABLED,\ - .tx_ba_win = WIFI_DEFAULT_TX_BA_WIN,\ - .rx_ba_win = WIFI_DEFAULT_RX_BA_WIN,\ - .wifi_task_core_id = WIFI_TASK_CORE_ID,\ - .beacon_max_len = WIFI_SOFTAP_BEACON_MAX_LEN, \ - .mgmt_sbuf_num = WIFI_MGMT_SBUF_NUM, \ - .magic = WIFI_INIT_CONFIG_MAGIC\ -}; - -/** - * @brief Init WiFi - * Alloc resource for WiFi driver, such as WiFi control structure, RX/TX buffer, - * WiFi NVS structure etc, this WiFi also start WiFi task - * - * @attention 1. This API must be called before all other WiFi API can be called - * @attention 2. Always use WIFI_INIT_CONFIG_DEFAULT macro to init the config to default values, this can - * guarantee all the fields got correct value when more fields are added into wifi_init_config_t - * in future release. If you want to set your owner initial values, overwrite the default values - * which are set by WIFI_INIT_CONFIG_DEFAULT, please be notified that the field 'magic' of - * wifi_init_config_t should always be WIFI_INIT_CONFIG_MAGIC! - * - * @param config pointer to WiFi init configuration structure; can point to a temporary variable. - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_NO_MEM: out of memory - * - others: refer to error code esp_err.h - */ -esp_err_t esp_wifi_init(const wifi_init_config_t *config); - -/** - * @brief Deinit WiFi - * Free all resource allocated in esp_wifi_init and stop WiFi task - * - * @attention 1. This API should be called if you want to remove WiFi driver from the system - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - */ -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. - * - * @param mode WiFi operating mode - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_INVALID_ARG: invalid argument - * - others: refer to error code in esp_err.h - */ -esp_err_t esp_wifi_set_mode(wifi_mode_t mode); - -/** - * @brief Get current operating mode of WiFi - * - * @param[out] mode store current WiFi mode - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_INVALID_ARG: invalid argument - */ -esp_err_t esp_wifi_get_mode(wifi_mode_t *mode); - -/** - * @brief Start WiFi according to current configuration - * If mode is WIFI_MODE_STA, it create station control block and start station - * If mode is WIFI_MODE_AP, it create soft-AP control block and start soft-AP - * If mode is WIFI_MODE_APSTA, it create soft-AP and station control block and start soft-AP and station - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_INVALID_ARG: invalid argument - * - ESP_ERR_NO_MEM: out of memory - * - ESP_ERR_WIFI_CONN: WiFi internal error, station or soft-AP control block wrong - * - ESP_FAIL: other WiFi internal errors - */ -esp_err_t esp_wifi_start(void); - -/** - * @brief Stop WiFi - * If mode is WIFI_MODE_STA, it stop station and free station control block - * If mode is WIFI_MODE_AP, it stop soft-AP and free soft-AP control block - * If mode is WIFI_MODE_APSTA, it stop station/soft-AP and free station/soft-AP control block - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - */ -esp_err_t esp_wifi_stop(void); - -/** - * @brief Restore WiFi stack persistent settings to default values - * - * This function will reset settings made using the following APIs: - * - esp_wifi_get_auto_connect, - * - esp_wifi_set_protocol, - * - esp_wifi_set_config related - * - esp_wifi_set_mode - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - */ -esp_err_t esp_wifi_restore(void); - -/** - * @brief Connect the ESP32 WiFi station to the AP. - * - * @attention 1. This API only impact WIFI_MODE_STA or WIFI_MODE_APSTA mode - * @attention 2. If the ESP32 is connected to an AP, call esp_wifi_disconnect to disconnect. - * @attention 3. The scanning triggered by esp_wifi_start_scan() will not be effective until connection between ESP32 and the AP is established. - * If ESP32 is scanning and connecting at the same time, ESP32 will abort scanning and return a warning message and error - * number ESP_ERR_WIFI_STATE. - * If you want to do reconnection after ESP32 received disconnect event, remember to add the maximum retry time, otherwise the called - * scan will not work. This is especially true when the AP doesn't exist, and you still try reconnection after ESP32 received disconnect - * event with the reason code WIFI_REASON_NO_AP_FOUND. - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start - * - ESP_ERR_WIFI_CONN: WiFi internal error, station or soft-AP control block wrong - * - ESP_ERR_WIFI_SSID: SSID of AP which station connects is invalid - */ -esp_err_t esp_wifi_connect(void); - -/** - * @brief Disconnect the ESP32 WiFi station from the AP. - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi was not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_STARTED: WiFi was not started by esp_wifi_start - * - ESP_FAIL: other WiFi internal errors - */ -esp_err_t esp_wifi_disconnect(void); - -/** - * @brief Currently this API is just an stub API - * - - * @return - * - ESP_OK: succeed - * - others: fail - */ -esp_err_t esp_wifi_clear_fast_connect(void); - -/** - * @brief deauthenticate all stations or associated id equals to aid - * - * @param aid when aid is 0, deauthenticate all stations, otherwise deauthenticate station whose associated id is aid - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_STARTED: WiFi was not started by esp_wifi_start - * - ESP_ERR_INVALID_ARG: invalid argument - * - ESP_ERR_WIFI_MODE: WiFi mode is wrong - */ -esp_err_t esp_wifi_deauth_sta(uint16_t aid); - -/** - * @brief Scan all available APs. - * - * @attention If this API is called, the found APs are stored in WiFi driver dynamic allocated memory and the - * will be freed in esp_wifi_scan_get_ap_records, so generally, call esp_wifi_scan_get_ap_records to cause - * the memory to be freed once the scan is done - * @attention The values of maximum active scan time and passive scan time per channel are limited to 1500 milliseconds. - * Values above 1500ms may cause station to disconnect from AP and are not recommended. - * - * @param config configuration of scanning - * @param block if block is true, this API will block the caller until the scan is done, otherwise - * it will return immediately - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_STARTED: WiFi was not started by esp_wifi_start - * - ESP_ERR_WIFI_TIMEOUT: blocking scan is timeout - * - ESP_ERR_WIFI_STATE: wifi still connecting when invoke esp_wifi_scan_start - * - others: refer to error code in esp_err.h - */ -esp_err_t esp_wifi_scan_start(const wifi_scan_config_t *config, bool block); - -/** - * @brief Stop the scan in process - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start - */ -esp_err_t esp_wifi_scan_stop(void); - -/** - * @brief Get number of APs found in last scan - * - * @param[out] number store number of APIs found in last scan - * - * @attention This API can only be called when the scan is completed, otherwise it may get wrong value. - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start - * - ESP_ERR_INVALID_ARG: invalid argument - */ -esp_err_t esp_wifi_scan_get_ap_num(uint16_t *number); - -/** - * @brief Get AP list found in last scan - * - * @param[inout] number As input param, it stores max AP number ap_records can hold. - * As output param, it receives the actual AP number this API returns. - * @param ap_records wifi_ap_record_t array to hold the found APs - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start - * - ESP_ERR_INVALID_ARG: invalid argument - * - ESP_ERR_NO_MEM: out of memory - */ -esp_err_t esp_wifi_scan_get_ap_records(uint16_t *number, wifi_ap_record_t *ap_records); - - -/** - * @brief Get information of AP which the ESP32 station is associated with - * - * @param ap_info the wifi_ap_record_t to hold AP information - * sta can get the connected ap's phy mode info through the struct member - * phy_11b,phy_11g,phy_11n,phy_lr in the wifi_ap_record_t struct. - * For example, phy_11b = 1 imply that ap support 802.11b mode - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_CONN: The station interface don't initialized - * - ESP_ERR_WIFI_NOT_CONNECT: The station is in disconnect status - */ -esp_err_t esp_wifi_sta_get_ap_info(wifi_ap_record_t *ap_info); - -/** - * @brief Set current WiFi power save type - * - * @attention Default power save type is WIFI_PS_MIN_MODEM. - * - * @param type power save type - * - * @return ESP_OK: succeed - */ -esp_err_t esp_wifi_set_ps(wifi_ps_type_t type); - -/** - * @brief Get current WiFi power save type - * - * @attention Default power save type is WIFI_PS_MIN_MODEM. - * - * @param[out] type: store current power save type - * - * @return ESP_OK: succeed - */ -esp_err_t esp_wifi_get_ps(wifi_ps_type_t *type); - -/** - * @brief Set protocol type of specified interface - * The default protocol is (WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N) - * - * @attention Currently we only support 802.11b or 802.11bg or 802.11bgn mode - * - * @param ifx interfaces - * @param protocol_bitmap WiFi protocol bitmap - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_IF: invalid interface - * - others: refer to error codes in esp_err.h - */ -esp_err_t esp_wifi_set_protocol(wifi_interface_t ifx, uint8_t protocol_bitmap); - -/** - * @brief Get the current protocol bitmap of the specified interface - * - * @param ifx interface - * @param[out] protocol_bitmap store current WiFi protocol bitmap of interface ifx - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_IF: invalid interface - * - ESP_ERR_INVALID_ARG: invalid argument - * - others: refer to error codes in esp_err.h - */ -esp_err_t esp_wifi_get_protocol(wifi_interface_t ifx, uint8_t *protocol_bitmap); - -/** - * @brief Set the bandwidth of ESP32 specified interface - * - * @attention 1. API return false if try to configure an interface that is not enabled - * @attention 2. WIFI_BW_HT40 is supported only when the interface support 11N - * - * @param ifx interface to be configured - * @param bw bandwidth - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_IF: invalid interface - * - ESP_ERR_INVALID_ARG: invalid argument - * - others: refer to error codes in esp_err.h - */ -esp_err_t esp_wifi_set_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t bw); - -/** - * @brief Get the bandwidth of ESP32 specified interface - * - * @attention 1. API return false if try to get a interface that is not enable - * - * @param ifx interface to be configured - * @param[out] bw store bandwidth of interface ifx - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_IF: invalid interface - * - ESP_ERR_INVALID_ARG: invalid argument - */ -esp_err_t esp_wifi_get_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t *bw); - -/** - * @brief Set primary/secondary channel of ESP32 - * - * @attention 1. This is a special API for sniffer - * @attention 2. This API should be called after esp_wifi_start() or esp_wifi_set_promiscuous() - * - * @param primary for HT20, primary is the channel number, for HT40, primary is the primary channel - * @param second for HT20, second is ignored, for HT40, second is the second channel - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_IF: invalid interface - * - ESP_ERR_INVALID_ARG: invalid argument - */ -esp_err_t esp_wifi_set_channel(uint8_t primary, wifi_second_chan_t second); - -/** - * @brief Get the primary/secondary channel of ESP32 - * - * @attention 1. API return false if try to get a interface that is not enable - * - * @param primary store current primary channel - * @param[out] second store current second channel - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_INVALID_ARG: invalid argument - */ -esp_err_t esp_wifi_get_channel(uint8_t *primary, wifi_second_chan_t *second); - -/** - * @brief configure country info - * - * @attention 1. The default country is {.cc="CN", .schan=1, .nchan=13, policy=WIFI_COUNTRY_POLICY_AUTO} - * @attention 2. When the country policy is WIFI_COUNTRY_POLICY_AUTO, the country info of the AP to which - * the station is connected is used. E.g. if the configured country info is {.cc="USA", .schan=1, .nchan=11} - * and the country info of the AP to which the station is connected is {.cc="JP", .schan=1, .nchan=14} - * then the country info that will be used is {.cc="JP", .schan=1, .nchan=14}. If the station disconnected - * from the AP the country info is set back back to the country info of the station automatically, - * {.cc="US", .schan=1, .nchan=11} in the example. - * @attention 3. When the country policy is WIFI_COUNTRY_POLICY_MANUAL, always use the configured country info. - * @attention 4. When the country info is changed because of configuration or because the station connects to a different - * external AP, the country IE in probe response/beacon of the soft-AP is changed also. - * @attention 5. The country configuration is not stored into flash - * @attention 6. This API doesn't validate the per-country rules, it's up to the user to fill in all fields according to - * local regulations. - * - * @param country the configured country info - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_INVALID_ARG: invalid argument - */ -esp_err_t esp_wifi_set_country(const wifi_country_t *country); - -/** - * @brief get the current country info - * - * @param country country info - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_INVALID_ARG: invalid argument - */ -esp_err_t esp_wifi_get_country(wifi_country_t *country); - - -/** - * @brief Set MAC address of the ESP32 WiFi station or the soft-AP interface. - * - * @attention 1. This API can only be called when the interface is disabled - * @attention 2. ESP32 soft-AP and station have different MAC addresses, do not set them to be the same. - * @attention 3. The bit 0 of the first byte of ESP32 MAC address can not be 1. For example, the MAC address - * can set to be "1a:XX:XX:XX:XX:XX", but can not be "15:XX:XX:XX:XX:XX". - * - * @param ifx interface - * @param mac the MAC address - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_INVALID_ARG: invalid argument - * - ESP_ERR_WIFI_IF: invalid interface - * - ESP_ERR_WIFI_MAC: invalid mac address - * - ESP_ERR_WIFI_MODE: WiFi mode is wrong - * - others: refer to error codes in esp_err.h - */ -esp_err_t esp_wifi_set_mac(wifi_interface_t ifx, const uint8_t mac[6]); - -/** - * @brief Get mac of specified interface - * - * @param ifx interface - * @param[out] mac store mac of the interface ifx - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_INVALID_ARG: invalid argument - * - ESP_ERR_WIFI_IF: invalid interface - */ -esp_err_t esp_wifi_get_mac(wifi_interface_t ifx, uint8_t mac[6]); - -/** - * @brief The RX callback function in the promiscuous mode. - * Each time a packet is received, the callback function will be called. - * - * @param buf Data received. Type of data in buffer (wifi_promiscuous_pkt_t or wifi_pkt_rx_ctrl_t) indicated by 'type' parameter. - * @param type promiscuous packet type. - * - */ -typedef void (* wifi_promiscuous_cb_t)(void *buf, wifi_promiscuous_pkt_type_t type); - -/** - * @brief Register the RX callback function in the promiscuous mode. - * - * Each time a packet is received, the registered callback function will be called. - * - * @param cb callback - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - */ -esp_err_t esp_wifi_set_promiscuous_rx_cb(wifi_promiscuous_cb_t cb); - -/** - * @brief Enable the promiscuous mode. - * - * @param en false - disable, true - enable - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - */ -esp_err_t esp_wifi_set_promiscuous(bool en); - -/** - * @brief Get the promiscuous mode. - * - * @param[out] en store the current status of promiscuous mode - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_INVALID_ARG: invalid argument - */ -esp_err_t esp_wifi_get_promiscuous(bool *en); - -/** - * @brief Enable the promiscuous mode packet type filter. - * - * @note The default filter is to filter all packets except WIFI_PKT_MISC - * - * @param filter the packet type filtered in promiscuous mode. - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - */ -esp_err_t esp_wifi_set_promiscuous_filter(const wifi_promiscuous_filter_t *filter); - -/** - * @brief Get the promiscuous filter. - * - * @param[out] filter store the current status of promiscuous filter - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_INVALID_ARG: invalid argument - */ -esp_err_t esp_wifi_get_promiscuous_filter(wifi_promiscuous_filter_t *filter); - -/** - * @brief Enable subtype filter of the control packet in promiscuous mode. - * - * @note The default filter is to filter none control packet. - * - * @param filter the subtype of the control packet filtered in promiscuous mode. - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - */ -esp_err_t esp_wifi_set_promiscuous_ctrl_filter(const wifi_promiscuous_filter_t *filter); - -/** - * @brief Get the subtype filter of the control packet in promiscuous mode. - * - * @param[out] filter store the current status of subtype filter of the control packet in promiscuous mode - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_ARG: invalid argument - */ -esp_err_t esp_wifi_get_promiscuous_ctrl_filter(wifi_promiscuous_filter_t *filter); - -/** - * @brief Set the configuration of the ESP32 STA or AP - * - * @attention 1. This API can be called only when specified interface is enabled, otherwise, API fail - * @attention 2. For station configuration, bssid_set needs to be 0; and it needs to be 1 only when users need to check the MAC address of the AP. - * @attention 3. ESP32 is limited to only one channel, so when in the soft-AP+station mode, the soft-AP will adjust its channel automatically to be the same as - * the channel of the ESP32 station. - * - * @param interface interface - * @param conf station or soft-AP configuration - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_INVALID_ARG: invalid argument - * - ESP_ERR_WIFI_IF: invalid interface - * - ESP_ERR_WIFI_MODE: invalid mode - * - ESP_ERR_WIFI_PASSWORD: invalid password - * - ESP_ERR_WIFI_NVS: WiFi internal NVS error - * - others: refer to the erro code in esp_err.h - */ -esp_err_t esp_wifi_set_config(wifi_interface_t interface, wifi_config_t *conf); - -/** - * @brief Get configuration of specified interface - * - * @param interface interface - * @param[out] conf station or soft-AP configuration - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_INVALID_ARG: invalid argument - * - ESP_ERR_WIFI_IF: invalid interface - */ -esp_err_t esp_wifi_get_config(wifi_interface_t interface, wifi_config_t *conf); - -/** - * @brief Get STAs associated with soft-AP - * - * @attention SSC only API - * - * @param[out] sta station list - * ap can get the connected sta's phy mode info through the struct member - * phy_11b,phy_11g,phy_11n,phy_lr in the wifi_sta_info_t struct. - * For example, phy_11b = 1 imply that sta support 802.11b mode - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_INVALID_ARG: invalid argument - * - ESP_ERR_WIFI_MODE: WiFi mode is wrong - * - ESP_ERR_WIFI_CONN: WiFi internal error, the station/soft-AP control block is invalid - */ -esp_err_t esp_wifi_ap_get_sta_list(wifi_sta_list_t *sta); - - -/** - * @brief Set the WiFi API configuration storage type - * - * @attention 1. The default value is WIFI_STORAGE_FLASH - * - * @param storage : storage type - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_INVALID_ARG: invalid argument - */ -esp_err_t esp_wifi_set_storage(wifi_storage_t storage); - -/** - * @brief Set auto connect - * The default value is true - * - * @param en : true - enable auto connect / false - disable auto connect - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_MODE: WiFi internal error, the station/soft-AP control block is invalid - * - others: refer to error code in esp_err.h - */ -esp_err_t esp_wifi_set_auto_connect(bool en) __attribute__ ((deprecated)); - -/** - * @brief Get the auto connect flag - * - * @param[out] en store current auto connect configuration - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_INVALID_ARG: invalid argument - */ -esp_err_t esp_wifi_get_auto_connect(bool *en) __attribute__ ((deprecated)); - -/** - * @brief Function signature for received Vendor-Specific Information Element callback. - * @param ctx Context argument, as passed to esp_wifi_set_vendor_ie_cb() when registering callback. - * @param type Information element type, based on frame type received. - * @param sa Source 802.11 address. - * @param vnd_ie Pointer to the vendor specific element data received. - * @param rssi Received signal strength indication. - */ -typedef void (*esp_vendor_ie_cb_t) (void *ctx, wifi_vendor_ie_type_t type, const uint8_t sa[6], const vendor_ie_data_t *vnd_ie, int rssi); - -/** - * @brief Set 802.11 Vendor-Specific Information Element - * - * @param enable If true, specified IE is enabled. If false, specified IE is removed. - * @param type Information Element type. Determines the frame type to associate with the IE. - * @param idx Index to set or clear. Each IE type can be associated with up to two elements (indices 0 & 1). - * @param vnd_ie Pointer to vendor specific element data. First 6 bytes should be a header with fields matching vendor_ie_data_t. - * If enable is false, this argument is ignored and can be NULL. Data does not need to remain valid after the function returns. - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init() - * - ESP_ERR_INVALID_ARG: Invalid argument, including if first byte of vnd_ie is not WIFI_VENDOR_IE_ELEMENT_ID (0xDD) - * or second byte is an invalid length. - * - ESP_ERR_NO_MEM: Out of memory - */ -esp_err_t esp_wifi_set_vendor_ie(bool enable, wifi_vendor_ie_type_t type, wifi_vendor_ie_id_t idx, const void *vnd_ie); - -/** - * @brief Register Vendor-Specific Information Element monitoring callback. - * - * @param cb Callback function - * @param ctx Context argument, passed to callback function. - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - */ -esp_err_t esp_wifi_set_vendor_ie_cb(esp_vendor_ie_cb_t cb, void *ctx); - -/** - * @brief Set maximum WiFi transmitting power - * - * @param power Maximum WiFi transmitting power, unit is 0.25dBm, range is [40, 82] corresponding to 10dBm - 20.5dBm here. - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start - * - ESP_ERR_WIFI_NOT_ARG: invalid argument - */ -esp_err_t esp_wifi_set_max_tx_power(int8_t power); - -/** - * @brief Get maximum WiFi transmiting power - * - * @param power Maximum WiFi transmitting power, unit is 0.25dBm. - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start - * - ESP_ERR_INVALID_ARG: invalid argument - */ -esp_err_t esp_wifi_get_max_tx_power(int8_t *power); - -/** - * @brief Set mask to enable or disable some WiFi events - * - * @attention 1. Mask can be created by logical OR of various WIFI_EVENT_MASK_ constants. - * Events which have corresponding bit set in the mask will not be delivered to the system event handler. - * @attention 2. Default WiFi event mask is WIFI_EVENT_MASK_AP_PROBEREQRECVED. - * @attention 3. There may be lots of stations sending probe request data around. - * Don't unmask this event unless you need to receive probe request data. - * - * @param mask WiFi event mask. - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - */ -esp_err_t esp_wifi_set_event_mask(uint32_t mask); - -/** - * @brief Get mask of WiFi events - * - * @param mask WiFi event mask. - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_ARG: invalid argument - */ -esp_err_t esp_wifi_get_event_mask(uint32_t *mask); - -/** - * @brief Send raw ieee80211 data - * - * @attention Currently only support for sending beacon/probe request/probe response/action and non-QoS - * data frame - * - * @param ifx interface if the Wi-Fi mode is Station, the ifx should be WIFI_IF_STA. If the Wi-Fi - * mode is SoftAP, the ifx should be WIFI_IF_AP. If the Wi-Fi mode is Station+SoftAP, the - * ifx should be WIFI_IF_STA or WIFI_IF_AP. If the ifx is wrong, the API returns ESP_ERR_WIFI_IF. - * @param buffer raw ieee80211 buffer - * @param len the length of raw buffer, the len must be <= 1500 Bytes and >= 24 Bytes - * @param en_sys_seq indicate whether use the internal sequence number. If en_sys_seq is false, the - * sequence in raw buffer is unchanged, otherwise it will be overwritten by WiFi driver with - * the system sequence number. - * Generally, if esp_wifi_80211_tx is called before the Wi-Fi connection has been set up, both - * en_sys_seq==true and en_sys_seq==false are fine. However, if the API is called after the Wi-Fi - * connection has been set up, en_sys_seq must be true, otherwise ESP_ERR_WIFI_ARG is returned. - * - * @return - * - ESP_OK: success - * - ESP_ERR_WIFI_IF: Invalid interface - * - ESP_ERR_INVALID_ARG: Invalid parameter - * - ESP_ERR_WIFI_NO_MEM: out of memory - */ - -esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len, bool en_sys_seq); - -/** - * @brief The RX callback function of Channel State Information(CSI) data. - * - * Each time a CSI data is received, the callback function will be called. - * - * @param ctx context argument, passed to esp_wifi_set_csi_rx_cb() when registering callback function. - * @param data CSI data received. The memory that it points to will be deallocated after callback function returns. - * - */ -typedef void (* wifi_csi_cb_t)(void *ctx, wifi_csi_info_t *data); - - -/** - * @brief Register the RX callback function of CSI data. - * - * Each time a CSI data is received, the callback function will be called. - * - * @param cb callback - * @param ctx context argument, passed to callback function - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - */ - -esp_err_t esp_wifi_set_csi_rx_cb(wifi_csi_cb_t cb, void *ctx); - -/** - * @brief Set CSI data configuration - * - * @param config configuration - * - * return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start or promiscuous mode is not enabled - * - ESP_ERR_INVALID_ARG: invalid argument - */ -esp_err_t esp_wifi_set_csi_config(const wifi_csi_config_t *config); - -/** - * @brief Enable or disable CSI - * - * @param en true - enable, false - disable - * - * return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start or promiscuous mode is not enabled - * - ESP_ERR_INVALID_ARG: invalid argument - */ -esp_err_t esp_wifi_set_csi(bool en); - -/** - * @brief Set antenna GPIO configuration - * - * @param config Antenna GPIO configuration. - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_ARG: Invalid argument, e.g. parameter is NULL, invalid GPIO number etc - */ -esp_err_t esp_wifi_set_ant_gpio(const wifi_ant_gpio_config_t *config); - -/** - * @brief Get current antenna GPIO configuration - * - * @param config Antenna GPIO configuration. - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_ARG: invalid argument, e.g. parameter is NULL - */ -esp_err_t esp_wifi_get_ant_gpio(wifi_ant_gpio_config_t *config); - - -/** - * @brief Set antenna configuration - * - * @param config Antenna configuration. - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_ARG: Invalid argument, e.g. parameter is NULL, invalid antenna mode or invalid GPIO number - */ -esp_err_t esp_wifi_set_ant(const wifi_ant_config_t *config); - -/** - * @brief Get current antenna configuration - * - * @param config Antenna configuration. - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_ARG: invalid argument, e.g. parameter is NULL - */ -esp_err_t esp_wifi_get_ant(wifi_ant_config_t *config); - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_WIFI_H__ */ diff --git a/tools/sdk/include/esp32/esp_wifi_crypto_types.h b/tools/sdk/include/esp32/esp_wifi_crypto_types.h deleted file mode 100644 index e1e2a51a131..00000000000 --- a/tools/sdk/include/esp32/esp_wifi_crypto_types.h +++ /dev/null @@ -1,799 +0,0 @@ -// Hardware crypto support 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. - - -#ifndef __ESP_WIFI_CRYPTO_TYPES_H__ -#define __ESP_WIFI_CRYPTO_TYPES_H__ - -/* This is an internal API header for configuring the implementation used for WiFi cryptographic - operations. - - During normal operation, you don't need to use any of these types or functions in this header. - See esp_wifi.h & esp_wifi_types.h instead. -*/ - -#ifdef __cplusplus -extern "C" { -#endif - -#define ESP_WIFI_CRYPTO_VERSION 0x00000001 - -/* - * Enumeration for hash operations. - * When WPA2 is connecting, this enum is used to - * request a hash algorithm via crypto_hash_xxx functions. - */ -typedef enum { - ESP_CRYPTO_HASH_ALG_MD5, ESP_CRYPTO_HASH_ALG_SHA1, - ESP_CRYPTO_HASH_ALG_HMAC_MD5, ESP_CRYPTO_HASH_ALG_HMAC_SHA1, - ESP_CRYPTO_HASH_ALG_SHA256, ESP_CRYPTO_HASH_ALG_HMAC_SHA256 -}esp_crypto_hash_alg_t; - -/* - * Enumeration for block cipher operations. - * When WPA2 is connecting, this enum is used to request a block - * cipher algorithm via crypto_cipher_xxx functions. - */ -typedef enum { - ESP_CRYPTO_CIPHER_NULL, ESP_CRYPTO_CIPHER_ALG_AES, ESP_CRYPTO_CIPHER_ALG_3DES, - ESP_CRYPTO_CIPHER_ALG_DES, ESP_CRYPTO_CIPHER_ALG_RC2, ESP_CRYPTO_CIPHER_ALG_RC4 -} esp_crypto_cipher_alg_t; - -/* - * This structure is about the algorithm when do crypto_hash operation, for detail, - * please reference to the structure crypto_hash. - */ -typedef struct crypto_hash esp_crypto_hash_t; - -/* - * This structure is about the algorithm when do crypto_cipher operation, for detail, - * please reference to the structure crypto_cipher. - */ -typedef struct crypto_cipher esp_crypto_cipher_t; - -/** - * @brief The crypto callback function used in wpa enterprise hash operation when connect. - * Initialize a esp_crypto_hash_t structure. - * - * @param alg Hash algorithm. - * @param key Key for keyed hash (e.g., HMAC) or %NULL if not needed. - * @param key_len Length of the key in bytes - * - */ -typedef esp_crypto_hash_t * (*esp_crypto_hash_init_t)(esp_crypto_hash_alg_t alg, const unsigned char *key, int key_len); - -/** - * @brief The crypto callback function used in wpa enterprise hash operation when connect. - * Add data to hash calculation. - * - * @param ctz Context pointer from esp_crypto_hash_init_t function. - * @param data Data buffer to add. - * @param len Length of the buffer. - * - */ -typedef void (*esp_crypto_hash_update_t)(esp_crypto_hash_t *ctx, const unsigned char *data, int len); - -/** - * @brief The crypto callback function used in wpa enterprise hash operation when connect. - * Complete hash calculation. - * - * @param ctz Context pointer from esp_crypto_hash_init_t function. - * @param hash Buffer for hash value or %NULL if caller is just freeing the hash - * context. - * @param len Pointer to length of the buffer or %NULL if caller is just freeing the - * hash context; on return, this is set to the actual length of the hash value - * Returns: 0 on success, -1 if buffer is too small (len set to needed length), - * or -2 on other failures (including failed crypto_hash_update() operations) - * - */ -typedef int (*esp_crypto_hash_finish_t)(esp_crypto_hash_t *ctx, unsigned char *hash, int *len); - -/** - * @brief The AES callback function when do WPS connect. - * - * @param key Encryption key. - * @param iv Encryption IV for CBC mode (16 bytes). - * @param data Data to encrypt in-place. - * @param data_len Length of data in bytes (must be divisible by 16) - */ -typedef int (*esp_aes_128_encrypt_t)(const unsigned char *key, const unsigned char *iv, unsigned char *data, int data_len); - -/** - * @brief The AES callback function when do WPS connect. - * - * @param key Decryption key. - * @param iv Decryption IV for CBC mode (16 bytes). - * @param data Data to decrypt in-place. - * @param data_len Length of data in bytes (must be divisible by 16) - * - */ -typedef int (*esp_aes_128_decrypt_t)(const unsigned char *key, const unsigned char *iv, unsigned char *data, int data_len); - -/** - * @brief The AES callback function when do STA connect. - * - * @param kek 16-octet Key encryption key (KEK). - * @param n Length of the plaintext key in 64-bit units; - * @param plain Plaintext key to be wrapped, n * 64 bits - * @param cipher Wrapped key, (n + 1) * 64 bits - * - */ -typedef int (*esp_aes_wrap_t)(const unsigned char *kek, int n, const unsigned char *plain, unsigned char *cipher); - -/** - * @brief The AES callback function when do STA connect. - * - * @param kek 16-octet Key decryption key (KEK). - * @param n Length of the plaintext key in 64-bit units; - * @param cipher Wrapped key to be unwrapped, (n + 1) * 64 bits - * @param plain Plaintext key, n * 64 bits - * - */ -typedef int (*esp_aes_unwrap_t)(const unsigned char *kek, int n, const unsigned char *cipher, unsigned char *plain); - -/** - * @brief The crypto callback function used in wpa enterprise cipher operation when connect. - * Initialize a esp_crypto_cipher_t structure. - * - * @param alg cipher algorithm. - * @param iv Initialization vector for block ciphers or %NULL for stream ciphers. - * @param key Cipher key - * @param key_len Length of key in bytes - * - */ -typedef esp_crypto_cipher_t * (*esp_crypto_cipher_init_t)(esp_crypto_cipher_alg_t alg, const unsigned char *iv, const unsigned char *key, int key_len); - -/** - * @brief The crypto callback function used in wpa enterprise cipher operation when connect. - * Cipher encrypt. - * - * @param ctx Context pointer from esp_crypto_cipher_init_t callback function. - * @param plain Plaintext to cipher. - * @param crypt Resulting ciphertext. - * @param len Length of the plaintext. - * - */ -typedef int (*esp_crypto_cipher_encrypt_t)(esp_crypto_cipher_t *ctx, - const unsigned char *plain, unsigned char *crypt, int len); -/** - * @brief The crypto callback function used in wpa enterprise cipher operation when connect. - * Cipher decrypt. - * - * @param ctx Context pointer from esp_crypto_cipher_init_t callback function. - * @param crypt Ciphertext to decrypt. - * @param plain Resulting plaintext. - * @param len Length of the cipher text. - * - */ -typedef int (*esp_crypto_cipher_decrypt_t)(esp_crypto_cipher_t *ctx, - const unsigned char *crypt, unsigned char *plain, int len); -/** - * @brief The crypto callback function used in wpa enterprise cipher operation when connect. - * Free cipher context. - * - * @param ctx Context pointer from esp_crypto_cipher_init_t callback function. - * - */ -typedef void (*esp_crypto_cipher_deinit_t)(esp_crypto_cipher_t *ctx); - -/** - * @brief The SHA256 callback function when do WPS connect. - * - * @param key Key for HMAC operations. - * @param key_len Length of the key in bytes. - * @param data Pointers to the data area. - * @param data_len Length of the data area. - * @param mac Buffer for the hash (20 bytes). - * - */ -typedef void (*esp_hmac_sha256_t)(const unsigned char *key, int key_len, const unsigned char *data, - int data_len, unsigned char *mac); - -/** - * @brief The SHA256 callback function when do WPS connect. - * - * @param key Key for HMAC operations. - * @param key_len Length of the key in bytes. - * @param num_elem Number of elements in the data vector. - * @param addr Pointers to the data areas. - * @param len Lengths of the data blocks. - * @param mac Buffer for the hash (32 bytes). - * - */ -typedef void (*esp_hmac_sha256_vector_t)(const unsigned char *key, int key_len, int num_elem, - const unsigned char *addr[], const int *len, unsigned char *mac); - -/** - * @brief The AES callback function when do STA connect. - * - * @param key Key for PRF. - * @param key_len Length of the key in bytes. - * @param label A unique label for each purpose of the PRF. - * @param data Extra data to bind into the key. - * @param data_len Length of the data. - * @param buf Buffer for the generated pseudo-random key. - * @param buf_len Number of bytes of key to generate. - * - */ -typedef void (*esp_sha256_prf_t)(const unsigned char *key, int key_len, const char *label, - const unsigned char *data, int data_len, unsigned char *buf, int buf_len); - -/** - * @brief The SHA256 callback function when do WPS connect. - * - * @param num_elem Number of elements in the data vector. - * @param addr Pointers to the data areas. - * @param len Lengths of the data blocks. - * @paramac Buffer for the hash. - * - */ -typedef int (*esp_sha256_vector_t)(int num_elem, const unsigned char *addr[], const int *len, - unsigned char *mac); - -/** - * @brief The bignum calculate callback function used when do connect. - * In WPS process, it used to calculate public key and private key. - * - * @param base Base integer (big endian byte array). - * @param base_len Length of base integer in bytes. - * @param power Power integer (big endian byte array). - * @param power_len Length of power integer in bytes. - * @param modulus Modulus integer (big endian byte array). - * @param modulus_len Length of modulus integer in bytes. - * @param result Buffer for the result. - * @param result_len Result length (max buffer size on input, real len on output). - * - */ -typedef int (*esp_crypto_mod_exp_t)(const unsigned char *base, int base_len, - const unsigned char *power, int power_len, - const unsigned char *modulus, int modulus_len, - unsigned char *result, unsigned int *result_len); - -/** - * @brief HMAC-MD5 over data buffer (RFC 2104)' - * - * @key: Key for HMAC operations - * @key_len: Length of the key in bytes - * @data: Pointers to the data area - * @data_len: Length of the data area - * @mac: Buffer for the hash (16 bytes) - * Returns: 0 on success, -1 on failure - */ -typedef int (*esp_hmac_md5_t)(const unsigned char *key, unsigned int key_len, const unsigned char *data, - unsigned int data_len, unsigned char *mac); - -/** - * @brief HMAC-MD5 over data vector (RFC 2104) - * - * @key: Key for HMAC operations - * @key_len: Length of the key in bytes - * @num_elem: Number of elements in the data vector - * @addr: Pointers to the data areas - * @len: Lengths of the data blocks - * @mac: Buffer for the hash (16 bytes) - * Returns: 0 on success, -1 on failure - */ -typedef int (*esp_hmac_md5_vector_t)(const unsigned char *key, unsigned int key_len, unsigned int num_elem, - const unsigned char *addr[], const unsigned int *len, unsigned char *mac); - -/** - * @brief HMAC-SHA1 over data buffer (RFC 2104) - * - * @key: Key for HMAC operations - * @key_len: Length of the key in bytes - * @data: Pointers to the data area - * @data_len: Length of the data area - * @mac: Buffer for the hash (20 bytes) - * Returns: 0 on success, -1 of failure - */ -typedef int (*esp_hmac_sha1_t)(const unsigned char *key, unsigned int key_len, const unsigned char *data, - unsigned int data_len, unsigned char *mac); - -/** - * @brief HMAC-SHA1 over data vector (RFC 2104) - * - * @key: Key for HMAC operations - * @key_len: Length of the key in bytes - * @num_elem: Number of elements in the data vector - * @addr: Pointers to the data areas - * @len: Lengths of the data blocks - * @mac: Buffer for the hash (20 bytes) - * Returns: 0 on success, -1 on failure - */ -typedef int (*esp_hmac_sha1_vector_t)(const unsigned char *key, unsigned int key_len, unsigned int num_elem, - const unsigned char *addr[], const unsigned int *len, unsigned char *mac); - -/** - * @brief SHA1-based Pseudo-Random Function (PRF) (IEEE 802.11i, 8.5.1.1) - * - * @key: Key for PRF - * @key_len: Length of the key in bytes - * @label: A unique label for each purpose of the PRF - * @data: Extra data to bind into the key - * @data_len: Length of the data - * @buf: Buffer for the generated pseudo-random key - * @buf_len: Number of bytes of key to generate - * Returns: 0 on success, -1 of failure - * - * This function is used to derive new, cryptographically separate keys from a - * given key (e.g., PMK in IEEE 802.11i). - */ -typedef int (*esp_sha1_prf_t)(const unsigned char *key, unsigned int key_len, const char *label, - const unsigned char *data, unsigned int data_len, unsigned char *buf, unsigned int buf_len); - -/** - * @brief SHA-1 hash for data vector - * - * @num_elem: Number of elements in the data vector - * @addr: Pointers to the data areas - * @len: Lengths of the data blocks - * @mac: Buffer for the hash - * Returns: 0 on success, -1 on failure - */ -typedef int (*esp_sha1_vector_t)(unsigned int num_elem, const unsigned char *addr[], const unsigned int *len, - unsigned char *mac); - -/** - * @brief SHA1-based key derivation function (PBKDF2) for IEEE 802.11i - * - * @passphrase: ASCII passphrase - * @ssid: SSID - * @ssid_len: SSID length in bytes - * @iterations: Number of iterations to run - * @buf: Buffer for the generated key - * @buflen: Length of the buffer in bytes - * Returns: 0 on success, -1 of failure - * - * This function is used to derive PSK for WPA-PSK. For this protocol, - * iterations is set to 4096 and buflen to 32. This function is described in - * IEEE Std 802.11-2004, Clause H.4. The main construction is from PKCS#5 v2.0. - */ -typedef int (*esp_pbkdf2_sha1_t)(const char *passphrase, const char *ssid, unsigned int ssid_len, - int iterations, unsigned char *buf, unsigned int buflen); - -/** - * @brief XOR RC4 stream to given data with skip-stream-start - * - * @key: RC4 key - * @keylen: RC4 key length - * @skip: number of bytes to skip from the beginning of the RC4 stream - * @data: data to be XOR'ed with RC4 stream - * @data_len: buf length - * Returns: 0 on success, -1 on failure - * - * Generate RC4 pseudo random stream for the given key, skip beginning of the - * stream, and XOR the end result with the data buffer to perform RC4 - * encryption/decryption. - */ -typedef int (*esp_rc4_skip_t)(const unsigned char *key, unsigned int keylen, unsigned int skip, - unsigned char *data, unsigned int data_len); - -/** - * @brief MD5 hash for data vector - * - * @num_elem: Number of elements in the data vector - * @addr: Pointers to the data areas - * @len: Lengths of the data blocks - * @mac: Buffer for the hash - * Returns: 0 on success, -1 on failure - */ -typedef int (*esp_md5_vector_t)(unsigned int num_elem, const unsigned char *addr[], const unsigned int *len, - unsigned char *mac); - -/** - * @brief Encrypt one AES block - * - * @ctx: Context pointer from aes_encrypt_init() - * @plain: Plaintext data to be encrypted (16 bytes) - * @crypt: Buffer for the encrypted data (16 bytes) - */ -typedef void (*esp_aes_encrypt_t)(void *ctx, const unsigned char *plain, unsigned char *crypt); - -/** - * @brief Initialize AES for encryption - * - * @key: Encryption key - * @len: Key length in bytes (usually 16, i.e., 128 bits) - * Returns: Pointer to context data or %NULL on failure - */ -typedef void * (*esp_aes_encrypt_init_t)(const unsigned char *key, unsigned int len); - -/** - * @brief Deinitialize AES encryption - * - * @ctx: Context pointer from aes_encrypt_init() - */ -typedef void (*esp_aes_encrypt_deinit_t)(void *ctx); - -/** - * @brief Decrypt one AES block - * - * @ctx: Context pointer from aes_encrypt_init() - * @crypt: Encrypted data (16 bytes) - * @plain: Buffer for the decrypted data (16 bytes) - */ -typedef void (*esp_aes_decrypt_t)(void *ctx, const unsigned char *crypt, unsigned char *plain); - -/** - * @brief Initialize AES for decryption - * - * @key: Decryption key - * @len: Key length in bytes (usually 16, i.e., 128 bits) - * Returns: Pointer to context data or %NULL on failure - */ -typedef void * (*esp_aes_decrypt_init_t)(const unsigned char *key, unsigned int len); - -/** - * @brief Deinitialize AES decryption - * - * @ctx: Context pointer from aes_encrypt_init() - */ -typedef void (*esp_aes_decrypt_deinit_t)(void *ctx); - -/** - * @brief Initialize TLS library - * - * @conf: Configuration data for TLS library - * Returns: Context data to be used as tls_ctx in calls to other functions, - * or %NULL on failure. - * - * Called once during program startup and once for each RSN pre-authentication - * session. In other words, there can be two concurrent TLS contexts. If global - * library initialization is needed (i.e., one that is shared between both - * authentication types), the TLS library wrapper should maintain a reference - * counter and do global initialization only when moving from 0 to 1 reference. - */ -typedef void * (*esp_tls_init_t)(void); - -/** - * @brief Deinitialize TLS library - * - * @tls_ctx: TLS context data from tls_init() - * - * Called once during program shutdown and once for each RSN pre-authentication - * session. If global library deinitialization is needed (i.e., one that is - * shared between both authentication types), the TLS library wrapper should - * maintain a reference counter and do global deinitialization only when moving - * from 1 to 0 references. - */ -typedef void (*esp_tls_deinit_t)(void *tls_ctx); - -/** - * @brief Add certificate and private key for connect - - * @sm: eap state machine - * - * Returns: 0 for success, -1 state machine didn't exist, -2 short of certificate or key - */ -typedef int (*esp_eap_peer_blob_init_t)(void *sm); - -/** - * @brief delete the certificate and private - * - * @sm: eap state machine - * - */ -typedef void (*esp_eap_peer_blob_deinit_t)(void *sm); - -/** - * @brief Initialize the eap state machine - * - * @sm: eap state machine - * @private_key_passwd: the start address of private_key_passwd - * @private_key_passwd_len: length of private_key_password - * - * Returns: 0 is success, -1 state machine didn't exist, -2 short of parameters - * - */ -typedef int (*esp_eap_peer_config_init_t)(void *sm, unsigned char *private_key_passwd,int private_key_passwd_len); - -/** - * @brief Deinit the eap state machine - * - * @sm: eap state machine - * - */ -typedef void (*esp_eap_peer_config_deinit_t)(void *sm); - -/** - * @brief Register the eap method - * - * Note: ESP32 only support PEAP/TTLS/TLS three eap methods now. - * - */ -typedef int (*esp_eap_peer_register_methods_t)(void); - -/** - * @brief remove the eap method - * - * Note: ESP32 only support PEAP/TTLS/TLS three eap methods now. - * - */ -typedef void (*esp_eap_peer_unregister_methods_t)(void); - -/** - * @brief remove the eap method before build new connect - * - * @sm: eap state machine - * @txt: not used now - */ -typedef void (*esp_eap_deinit_prev_method_t)(void *sm, const char *txt); - -/** - * @brief Get EAP method based on type number - * - * @vendor: EAP Vendor-Id (0 = IETF) - * @method: EAP type number - * Returns: Pointer to EAP method or %NULL if not found - */ -typedef const void * (*esp_eap_peer_get_eap_method_t)(int vendor, int method); - -/** - * @brief Abort EAP authentication - * - * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init() - * - * Release system resources that have been allocated for the authentication - * session without fully deinitializing the EAP state machine. - */ -typedef void (*esp_eap_sm_abort_t)(void *sm); - -/** - * @brief Build EAP-NAK for the current network - * - * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init() - * @type: EAP type of the fail reason - * @id: EAP identifier for the packet - * - * This function allocates and builds a nak packet for the - * current network. The caller is responsible for freeing the returned data. - */ -typedef void * (*esp_eap_sm_build_nak_t)(void *sm, int type, unsigned char id); - -/** - * @brief Build EAP-Identity/Response for the current network - * - * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init() - * @id: EAP identifier for the packet - * @encrypted: Whether the packet is for encrypted tunnel (EAP phase 2) - * Returns: Pointer to the allocated EAP-Identity/Response packet or %NULL on - * failure - * - * This function allocates and builds an EAP-Identity/Response packet for the - * current network. The caller is responsible for freeing the returned data. - */ -typedef void * (*esp_eap_sm_build_identity_resp_t)(void *sm, unsigned char id, int encrypted); - -/** - * @brief Allocate a buffer for an EAP message - * - * @vendor: Vendor-Id (0 = IETF) - * @type: EAP type - * @payload_len: Payload length in bytes (data after Type) - * @code: Message Code (EAP_CODE_*) - * @identifier: Identifier - * Returns: Pointer to the allocated message buffer or %NULL on error - * - * This function can be used to allocate a buffer for an EAP message and fill - * in the EAP header. This function is automatically using expanded EAP header - * if the selected Vendor-Id is not IETF. In other words, most EAP methods do - * not need to separately select which header type to use when using this - * function to allocate the message buffers. The returned buffer has room for - * payload_len bytes and has the EAP header and Type field already filled in. - */ -typedef void * (*esp_eap_msg_alloc_t)(int vendor, int type, unsigned int payload_len, - unsigned char code, unsigned char identifier); - -/** - * @brief get the enrollee mac address - * @mac_addr: instore the mac address of enrollee - * @uuid: Universally Unique Identifer of the enrollee - * - */ -typedef void (*esp_uuid_gen_mac_addr_t)(const unsigned char *mac_addr, unsigned char *uuid); - -/** - * @brief free the message after finish DH - * - */ -typedef void (*esp_dh5_free_t)(void *ctx); - -/** - * @brief Build WPS IE for (Re)Association Request - * - * @req_type: Value for Request Type attribute - * Returns: WPS IE or %NULL on failure - * - * The caller is responsible for freeing the buffer. - */ -typedef void * (*esp_wps_build_assoc_req_ie_t)(int req_type); - -/** - * @brief Build WPS IE for (Re)Association Response - * - * Returns: WPS IE or %NULL on failure - * - * The caller is responsible for freeing the buffer. - */ -typedef void * (*esp_wps_build_assoc_resp_ie_t)(void); - -/** - * @brief Build WPS IE for Probe Request - * - * @pw_id: Password ID (DEV_PW_PUSHBUTTON for active PBC and DEV_PW_DEFAULT for - * most other use cases) - * @dev: Device attributes - * @uuid: Own UUID - * @req_type: Value for Request Type attribute - * @num_req_dev_types: Number of requested device types - * @req_dev_types: Requested device types (8 * num_req_dev_types octets) or - * %NULL if none - * Returns: WPS IE or %NULL on failure - * - * The caller is responsible for freeing the buffer. - */ -typedef void * (*esp_wps_build_probe_req_ie_t)(uint16_t pw_id, void *dev, const unsigned char *uuid, - int req_type, unsigned int num_req_dev_types, const unsigned char *req_dev_types); - -/** - * @brief build public key for exchange in M1 - * - * - */ -typedef int (*esp_wps_build_public_key_t)(void *wps, void *msg, int mode); - - -/** - * @brief get the wps information in exchange password - * - * - */ -typedef void * (*esp_wps_enrollee_get_msg_t)(void *wps, void *op_code); - -/** - * @brief deal with the wps information in exchange password - * - * - */ -typedef int (*esp_wps_enrollee_process_msg_t)(void *wps, int op_code, const void *msg); - -/** - * @brief Generate a random PIN - * - * Returns: Eight digit PIN (i.e., including the checksum digit) - */ -typedef unsigned int (*esp_wps_generate_pin_t)(void); - -/** - * @brief Check whether WPS IE indicates active PIN - * - * @msg: WPS IE contents from Beacon or Probe Response frame - * Returns: 1 if PIN Registrar is active, 0 if not - */ -typedef int (*esp_wps_is_selected_pin_registrar_t)(const void *msg, unsigned char *bssid); - -/** - * @brief Check whether WPS IE indicates active PBC - * - * @msg: WPS IE contents from Beacon or Probe Response frame - * Returns: 1 if PBC Registrar is active, 0 if not - */ -typedef int (*esp_wps_is_selected_pbc_registrar_t)(const void *msg, unsigned char *bssid); - - - -/** - * @brief The crypto callback function structure used when do station security connect. - * The structure can be set as software crypto or the crypto optimized by ESP32 - * hardware. - */ -typedef struct { - uint32_t size; - uint32_t version; - esp_aes_wrap_t aes_wrap; /**< station connect function used when send EAPOL frame */ - esp_aes_unwrap_t aes_unwrap; /**< station connect function used when decrypt key data */ - esp_hmac_sha256_vector_t hmac_sha256_vector; /**< station connect function used when check MIC */ - esp_sha256_prf_t sha256_prf; /**< station connect function used when check MIC */ - esp_hmac_md5_t hmac_md5; - esp_hmac_md5_vector_t hamc_md5_vector; - esp_hmac_sha1_t hmac_sha1; - esp_hmac_sha1_vector_t hmac_sha1_vector; - esp_sha1_prf_t sha1_prf; - esp_sha1_vector_t sha1_vector; - esp_pbkdf2_sha1_t pbkdf2_sha1; - esp_rc4_skip_t rc4_skip; - esp_md5_vector_t md5_vector; - esp_aes_encrypt_t aes_encrypt; - esp_aes_encrypt_init_t aes_encrypt_init; - esp_aes_encrypt_deinit_t aes_encrypt_deinit; - esp_aes_decrypt_t aes_decrypt; - esp_aes_decrypt_init_t aes_decrypt_init; - esp_aes_decrypt_deinit_t aes_decrypt_deinit; -}wpa_crypto_funcs_t; - -/** - * @brief The crypto callback function structure used when do WPS process. The - * structure can be set as software crypto or the crypto optimized by ESP32 - * hardware. - */ -typedef struct{ - uint32_t size; - uint32_t version; - esp_aes_128_encrypt_t aes_128_encrypt; /**< function used to process message when do WPS */ - esp_aes_128_decrypt_t aes_128_decrypt; /**< function used to process message when do WPS */ - esp_crypto_mod_exp_t crypto_mod_exp; /**< function used to calculate public key and private key */ - esp_hmac_sha256_t hmac_sha256; /**< function used to get attribute */ - esp_hmac_sha256_vector_t hmac_sha256_vector; /**< function used to process message when do WPS */ - esp_sha256_vector_t sha256_vector; /**< function used to process message when do WPS */ - esp_uuid_gen_mac_addr_t uuid_gen_mac_addr; - esp_dh5_free_t dh5_free; - esp_wps_build_assoc_req_ie_t wps_build_assoc_req_ie; - esp_wps_build_assoc_resp_ie_t wps_build_assoc_resp_ie; - esp_wps_build_probe_req_ie_t wps_build_probe_req_ie; - esp_wps_build_public_key_t wps_build_public_key; - esp_wps_enrollee_get_msg_t wps_enrollee_get_msg; - esp_wps_enrollee_process_msg_t wps_enrollee_process_msg; - esp_wps_generate_pin_t wps_generate_pin; - esp_wps_is_selected_pin_registrar_t wps_is_selected_pin_registrar; - esp_wps_is_selected_pbc_registrar_t wps_is_selected_pbc_registrar; - esp_eap_msg_alloc_t eap_msg_alloc; -}wps_crypto_funcs_t; - -/** - * @brief The crypto callback function structure used when do WPA enterprise connect. - * The structure can be set as software crypto or the crypto optimized by ESP32 - * hardware. - */ -typedef struct { - uint32_t size; - uint32_t version; - esp_crypto_hash_init_t crypto_hash_init; /**< function used to initialize a crypto_hash structure when use TLSV1 */ - esp_crypto_hash_update_t crypto_hash_update; /**< function used to calculate hash data when use TLSV1 */ - esp_crypto_hash_finish_t crypto_hash_finish; /**< function used to finish the hash calculate when use TLSV1 */ - esp_crypto_cipher_init_t crypto_cipher_init; /**< function used to initialize a crypt_cipher structure when use TLSV1 */ - esp_crypto_cipher_encrypt_t crypto_cipher_encrypt; /**< function used to encrypt cipher when use TLSV1 */ - esp_crypto_cipher_decrypt_t crypto_cipher_decrypt; /**< function used to decrypt cipher when use TLSV1 */ - esp_crypto_cipher_deinit_t crypto_cipher_deinit; /**< function used to free context when use TLSV1 */ - esp_crypto_mod_exp_t crypto_mod_exp; /**< function used to do key exchange when use TLSV1 */ - esp_sha256_vector_t sha256_vector; /**< function used to do X.509v3 certificate parsing and processing */ - esp_tls_init_t tls_init; - esp_tls_deinit_t tls_deinit; - esp_eap_peer_blob_init_t eap_peer_blob_init; - esp_eap_peer_blob_deinit_t eap_peer_blob_deinit; - esp_eap_peer_config_init_t eap_peer_config_init; - esp_eap_peer_config_deinit_t eap_peer_config_deinit; - esp_eap_peer_register_methods_t eap_peer_register_methods; - esp_eap_peer_unregister_methods_t eap_peer_unregister_methods; - esp_eap_deinit_prev_method_t eap_deinit_prev_method; - esp_eap_peer_get_eap_method_t eap_peer_get_eap_method; - esp_eap_sm_abort_t eap_sm_abort; - esp_eap_sm_build_nak_t eap_sm_build_nak; - esp_eap_sm_build_identity_resp_t eap_sm_build_identity_resp; - esp_eap_msg_alloc_t eap_msg_alloc; -} wpa2_crypto_funcs_t; - -/** - * @brief The crypto callback function structure used in mesh vendor IE encryption. The - * structure can be set as software crypto or the crypto optimized by ESP32 - * hardware. - */ -typedef struct{ - esp_aes_128_encrypt_t aes_128_encrypt; /**< function used in mesh vendor IE encryption */ - esp_aes_128_decrypt_t aes_128_decrypt; /**< function used in mesh vendor IE decryption */ -} mesh_crypto_funcs_t; - -#ifdef __cplusplus -} -#endif -#endif diff --git a/tools/sdk/include/esp32/esp_wifi_internal.h b/tools/sdk/include/esp32/esp_wifi_internal.h deleted file mode 100644 index d41b099db60..00000000000 --- a/tools/sdk/include/esp32/esp_wifi_internal.h +++ /dev/null @@ -1,263 +0,0 @@ -// 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. - -/* - * All the APIs declared here are internal only APIs, it can only be used by - * espressif internal modules, such as SSC, LWIP, TCPIP adapter etc, espressif - * customers are not recommended to use them. - * - * If someone really want to use specified APIs declared in here, please contact - * espressif AE/developer to make sure you know the limitations or risk of - * the API, otherwise you may get unexpected behavior!!! - * - */ - - -#ifndef __ESP_WIFI_INTERNAL_H__ -#define __ESP_WIFI_INTERNAL_H__ - -#include -#include -#include "freertos/FreeRTOS.h" -#include "freertos/queue.h" -#include "rom/queue.h" -#include "esp_err.h" -#include "esp_wifi_types.h" -#include "esp_event.h" -#include "esp_wifi.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { - QueueHandle_t handle; /**< FreeRTOS queue handler */ - void *storage; /**< storage for FreeRTOS queue */ -} wifi_static_queue_t; - -/** - * @brief Initialize Wi-Fi Driver - * Alloc resource for WiFi driver, such as WiFi control structure, RX/TX buffer, - * WiFi NVS structure among others. - * - * For the most part, you need not call this function directly. It gets called - * from esp_wifi_init(). - * - * This function may be called, if you only need to initialize the Wi-Fi driver - * without having to use the network stack on top. - * - * @param config provide WiFi init configuration - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_NO_MEM: out of memory - * - others: refer to error code esp_err.h - */ -esp_err_t esp_wifi_init_internal(const wifi_init_config_t *config); - -/** - * @brief get whether the wifi driver is allowed to transmit data or not - * - * @return - * - true : upper layer should stop to transmit data to wifi driver - * - false : upper layer can transmit data to wifi driver - */ -bool esp_wifi_internal_tx_is_stop(void); - -/** - * @brief free the rx buffer which allocated by wifi driver - * - * @param void* buffer: rx buffer pointer - */ -void esp_wifi_internal_free_rx_buffer(void* buffer); - -/** - * @brief transmit the buffer via wifi driver - * - * @param wifi_interface_t wifi_if : wifi interface id - * @param void *buffer : the buffer to be tansmit - * @param uint16_t len : the length of buffer - * - * @return - * - ERR_OK : Successfully transmit the buffer to wifi driver - * - ERR_MEM : Out of memory - * - ERR_IF : WiFi driver error - * - ERR_ARG : Invalid argument - */ -int esp_wifi_internal_tx(wifi_interface_t wifi_if, void *buffer, uint16_t len); - -/** - * @brief The WiFi RX callback function - * - * Each time the WiFi need to forward the packets to high layer, the callback function will be called - */ -typedef esp_err_t (*wifi_rxcb_t)(void *buffer, uint16_t len, void *eb); - -/** - * @brief Set the WiFi RX callback - * - * @attention 1. Currently we support only one RX callback for each interface - * - * @param wifi_interface_t ifx : interface - * @param wifi_rxcb_t fn : WiFi RX callback - * - * @return - * - ESP_OK : succeed - * - others : fail - */ -esp_err_t esp_wifi_internal_reg_rxcb(wifi_interface_t ifx, wifi_rxcb_t fn); - -/** - * @brief Notify WIFI driver that the station got ip successfully - * - * @return - * - ESP_OK : succeed - * - others : fail - */ -esp_err_t esp_wifi_internal_set_sta_ip(void); - -/** - * @brief enable or disable transmitting WiFi MAC frame with fixed rate - * - * @attention 1. If fixed rate is enabled, both management and data frame are transmitted with fixed rate - * @attention 2. Make sure that the receiver is able to receive the frame with the fixed rate if you want the frame to be received - * - * @param ifx : wifi interface - * @param en : false - disable, true - enable - * @param rate : PHY rate - * - * @return - * - ERR_OK : succeed - * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_STARTED: WiFi was not started by esp_wifi_start - * - ESP_ERR_WIFI_IF : invalid WiFi interface - * - ESP_ERR_INVALID_ARG : invalid rate - * - ESP_ERR_NOT_SUPPORTED : do not support to set fixed rate if TX AMPDU is enabled - */ -esp_err_t esp_wifi_internal_set_fix_rate(wifi_interface_t ifx, bool en, wifi_phy_rate_t rate); - -/** - * @brief Check the MD5 values of the OS adapter header files in IDF and WiFi library - * - * @attention 1. It is used for internal CI version check - * - * @return - * - ESP_OK : succeed - * - ESP_WIFI_INVALID_ARG : MD5 check fail - */ -esp_err_t esp_wifi_internal_osi_funcs_md5_check(const char *md5); - -/** - * @brief Check the MD5 values of the crypto types header files in IDF and WiFi library - * - * @attention 1. It is used for internal CI version check - * - * @return - * - ESP_OK : succeed - * - ESP_WIFI_INVALID_ARG : MD5 check fail - */ -esp_err_t esp_wifi_internal_crypto_funcs_md5_check(const char *md5); - -/** - * @brief Check the MD5 values of the esp_wifi_types.h in IDF and WiFi library - * - * @attention 1. It is used for internal CI version check - * - * @return - * - ESP_OK : succeed - * - ESP_WIFI_INVALID_ARG : MD5 check fail - */ -esp_err_t esp_wifi_internal_wifi_type_md5_check(const char *md5); - -/** - * @brief Check the MD5 values of the esp_wifi.h in IDF and WiFi library - * - * @attention 1. It is used for internal CI version check - * - * @return - * - ESP_OK : succeed - * - ESP_WIFI_INVALID_ARG : MD5 check fail - */ -esp_err_t esp_wifi_internal_esp_wifi_md5_check(const char *md5); - -/** - * @brief Allocate a chunk of memory for WiFi driver - * - * @attention This API is not used for DMA memory allocation. - * - * @param size_t size : Size, in bytes, of the amount of memory to allocate - * - * @return A pointer to the memory allocated on success, NULL on failure - */ -void *wifi_malloc( size_t size ); - -/** - * @brief Reallocate a chunk of memory for WiFi driver - * - * @attention This API is not used for DMA memory allocation. - * - * @param void * ptr : Pointer to previously allocated memory, or NULL for a new allocation. - * @param size_t size : Size, in bytes, of the amount of memory to allocate - * - * @return A pointer to the memory allocated on success, NULL on failure - */ -void *wifi_realloc( void *ptr, size_t size ); - -/** - * @brief Callocate memory for WiFi driver - * - * @attention This API is not used for DMA memory allocation. - * - * @param size_t n : Number of continuing chunks of memory to allocate - * @param size_t size : Size, in bytes, of the amount of memory to allocate - * - * @return A pointer to the memory allocated on success, NULL on failure - */ -void *wifi_calloc( size_t n, size_t size ); - -/** - * @brief Update WiFi MAC time - * - * @param uint32_t time_delta : time duration since the WiFi/BT common clock is disabled - * - * @return Always returns ESP_OK - */ -typedef esp_err_t (* wifi_mac_time_update_cb_t)( uint32_t time_delta ); - -/** - * @brief Update WiFi MAC time - * - * @param uint32_t time_delta : time duration since the WiFi/BT common clock is disabled - * - * @return Always returns ESP_OK - */ -esp_err_t esp_wifi_internal_update_mac_time( uint32_t time_delta ); - -/** - * @brief A general API to set/get WiFi internal configuration, it's for debug only - * - * @param cmd : ioctl command type - * @param cfg : configuration for the command - * - * @return - * - ESP_OK: succeed - * - others: failed - */ -esp_err_t esp_wifi_internal_ioctl(int cmd, wifi_ioctl_config_t *cfg); - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_WIFI_H__ */ diff --git a/tools/sdk/include/esp32/esp_wifi_os_adapter.h b/tools/sdk/include/esp32/esp_wifi_os_adapter.h deleted file mode 100644 index 165caa6edc5..00000000000 --- a/tools/sdk/include/esp32/esp_wifi_os_adapter.h +++ /dev/null @@ -1,135 +0,0 @@ -// 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. - -#ifndef ESP_WIFI_OS_ADAPTER_H_ -#define ESP_WIFI_OS_ADAPTER_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define ESP_WIFI_OS_ADAPTER_VERSION 0x00000002 -#define ESP_WIFI_OS_ADAPTER_MAGIC 0xDEADBEAF - -#define OSI_FUNCS_TIME_BLOCKING 0xffffffff - -#define OSI_QUEUE_SEND_FRONT 0 -#define OSI_QUEUE_SEND_BACK 1 -#define OSI_QUEUE_SEND_OVERWRITE 2 - -typedef struct { - int32_t _version; - void (*_set_isr)(int32_t n, void *f, void *arg); - void (*_ints_on)(uint32_t mask); - void (*_ints_off)(uint32_t mask); - void *(* _spin_lock_create)(void); - void (* _spin_lock_delete)(void *lock); - uint32_t (*_wifi_int_disable)(void *wifi_int_mux); - void (*_wifi_int_restore)(void *wifi_int_mux, uint32_t tmp); - void (*_task_yield_from_isr)(void); - void *(*_semphr_create)(uint32_t max, uint32_t init); - void (*_semphr_delete)(void *semphr); - int32_t (*_semphr_take)(void *semphr, uint32_t block_time_tick); - int32_t (*_semphr_give)(void *semphr); - void *(*_wifi_thread_semphr_get)(void); - void *(*_mutex_create)(void); - void *(*_recursive_mutex_create)(void); - void (*_mutex_delete)(void *mutex); - int32_t (*_mutex_lock)(void *mutex); - int32_t (*_mutex_unlock)(void *mutex); - void *(* _queue_create)(uint32_t queue_len, uint32_t item_size); - void (* _queue_delete)(void *queue); - int32_t (* _queue_send)(void *queue, void *item, uint32_t block_time_tick); - int32_t (* _queue_send_from_isr)(void *queue, void *item, void *hptw); - int32_t (* _queue_send_to_back)(void *queue, void *item, uint32_t block_time_tick); - int32_t (* _queue_send_to_front)(void *queue, void *item, uint32_t block_time_tick); - int32_t (* _queue_recv)(void *queue, void *item, uint32_t block_time_tick); - uint32_t (* _queue_msg_waiting)(void *queue); - void *(* _event_group_create)(void); - void (* _event_group_delete)(void *event); - uint32_t (* _event_group_set_bits)(void *event, uint32_t bits); - uint32_t (* _event_group_clear_bits)(void *event, uint32_t bits); - uint32_t (* _event_group_wait_bits)(void *event, uint32_t bits_to_wait_for, int32_t clear_on_exit, int32_t wait_for_all_bits, uint32_t block_time_tick); - int32_t (* _task_create_pinned_to_core)(void *task_func, const char *name, uint32_t stack_depth, void *param, uint32_t prio, void *task_handle, uint32_t core_id); - int32_t (* _task_create)(void *task_func, const char *name, uint32_t stack_depth, void *param, uint32_t prio, void *task_handle); - void (* _task_delete)(void *task_handle); - void (* _task_delay)(uint32_t tick); - int32_t (* _task_ms_to_tick)(uint32_t ms); - void *(* _task_get_current_task)(void); - int32_t (* _task_get_max_priority)(void); - void *(* _malloc)(uint32_t size); - void (* _free)(void *p); - uint32_t (* _get_free_heap_size)(void); - uint32_t (* _rand)(void); - void (* _dport_access_stall_other_cpu_start_wrap)(void); - void (* _dport_access_stall_other_cpu_end_wrap)(void); - int32_t (* _phy_rf_deinit)(uint32_t module); - void (* _phy_load_cal_and_init)(uint32_t module); - int32_t (* _read_mac)(uint8_t* mac, uint32_t type); - void (* _timer_arm)(void *timer, uint32_t tmout, bool repeat); - void (* _timer_disarm)(void *timer); - void (* _timer_done)(void *ptimer); - void (* _timer_setfn)(void *ptimer, void *pfunction, void *parg); - void (* _timer_arm_us)(void *ptimer, uint32_t us, bool repeat); - void (* _periph_module_enable)(uint32_t periph); - void (* _periph_module_disable)(uint32_t periph); - int64_t (* _esp_timer_get_time)(void); - int32_t (* _nvs_set_i8)(uint32_t handle, const char* key, int8_t value); - int32_t (* _nvs_get_i8)(uint32_t handle, const char* key, int8_t* out_value); - int32_t (* _nvs_set_u8)(uint32_t handle, const char* key, uint8_t value); - int32_t (* _nvs_get_u8)(uint32_t handle, const char* key, uint8_t* out_value); - int32_t (* _nvs_set_u16)(uint32_t handle, const char* key, uint16_t value); - int32_t (* _nvs_get_u16)(uint32_t handle, const char* key, uint16_t* out_value); - int32_t (* _nvs_open)(const char* name, uint32_t open_mode, uint32_t *out_handle); - void (* _nvs_close)(uint32_t handle); - int32_t (* _nvs_commit)(uint32_t handle); - int32_t (* _nvs_set_blob)(uint32_t handle, const char* key, const void* value, size_t length); - int32_t (* _nvs_get_blob)(uint32_t handle, const char* key, void* out_value, size_t* length); - int32_t (* _nvs_erase_key)(uint32_t handle, const char* key); - int32_t (* _get_random)(uint8_t *buf, size_t len); - int32_t (* _get_time)(void *t); - unsigned long (* _random)(void); - void (* _log_write)(uint32_t level, const char* tag, const char* format, ...); - uint32_t (* _log_timestamp)(void); - void * (* _malloc_internal)(size_t size); - void * (* _realloc_internal)(void *ptr, size_t size); - void * (* _calloc_internal)(size_t n, size_t size); - void * (* _zalloc_internal)(size_t size); - void * (* _wifi_malloc)(size_t size); - void * (* _wifi_realloc)(void *ptr, size_t size); - void * (* _wifi_calloc)(size_t n, size_t size); - void * (* _wifi_zalloc)(size_t size); - void * (* _wifi_create_queue)(int32_t queue_len, int32_t item_size); - void (* _wifi_delete_queue)(void * queue); - int32_t (* _modem_sleep_enter)(uint32_t module); - int32_t (* _modem_sleep_exit)(uint32_t module); - int32_t (* _modem_sleep_register)(uint32_t module); - int32_t (* _modem_sleep_deregister)(uint32_t module); - void (* _sc_ack_send)(void *param); - void (* _sc_ack_send_stop)(void); - uint32_t (* _coex_status_get)(void); - int32_t (* _coex_wifi_request)(uint32_t event, uint32_t latency, uint32_t duration); - int32_t (* _coex_wifi_release)(uint32_t event); - int32_t _magic; -} wifi_osi_funcs_t; - -extern wifi_osi_funcs_t g_wifi_osi_funcs; - -#ifdef __cplusplus -} -#endif - -#endif /* ESP_WIFI_OS_ADAPTER_H_ */ diff --git a/tools/sdk/include/esp32/esp_wifi_types.h b/tools/sdk/include/esp32/esp_wifi_types.h deleted file mode 100644 index 3f6eccde0be..00000000000 --- a/tools/sdk/include/esp32/esp_wifi_types.h +++ /dev/null @@ -1,526 +0,0 @@ -// 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. - - -#ifndef __ESP_WIFI_TYPES_H__ -#define __ESP_WIFI_TYPES_H__ - -#include -#include -#include "esp_err.h" -#include "esp_private/esp_wifi_types_private.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - WIFI_MODE_NULL = 0, /**< null mode */ - WIFI_MODE_STA, /**< WiFi station mode */ - WIFI_MODE_AP, /**< WiFi soft-AP mode */ - WIFI_MODE_APSTA, /**< WiFi station + soft-AP mode */ - WIFI_MODE_MAX -} wifi_mode_t; - -typedef esp_interface_t wifi_interface_t; - -#define WIFI_IF_STA ESP_IF_WIFI_STA -#define WIFI_IF_AP ESP_IF_WIFI_AP - -typedef enum { - WIFI_COUNTRY_POLICY_AUTO, /**< Country policy is auto, use the country info of AP to which the station is connected */ - WIFI_COUNTRY_POLICY_MANUAL, /**< Country policy is manual, always use the configured country info */ -} wifi_country_policy_t; - -/** @brief Structure describing WiFi country-based regional restrictions. */ -typedef struct { - char cc[3]; /**< country code string */ - uint8_t schan; /**< start channel */ - uint8_t nchan; /**< total channel number */ - int8_t max_tx_power; /**< This field is used for getting WiFi maximum transmitting power, call esp_wifi_set_max_tx_power to set the maximum transmitting power. */ - wifi_country_policy_t policy; /**< country policy */ -} wifi_country_t; - -typedef enum { - WIFI_AUTH_OPEN = 0, /**< authenticate mode : open */ - WIFI_AUTH_WEP, /**< authenticate mode : WEP */ - WIFI_AUTH_WPA_PSK, /**< authenticate mode : WPA_PSK */ - WIFI_AUTH_WPA2_PSK, /**< authenticate mode : WPA2_PSK */ - WIFI_AUTH_WPA_WPA2_PSK, /**< authenticate mode : WPA_WPA2_PSK */ - WIFI_AUTH_WPA2_ENTERPRISE, /**< authenticate mode : WPA2_ENTERPRISE */ - WIFI_AUTH_MAX -} wifi_auth_mode_t; - -typedef enum { - WIFI_REASON_UNSPECIFIED = 1, - WIFI_REASON_AUTH_EXPIRE = 2, - WIFI_REASON_AUTH_LEAVE = 3, - WIFI_REASON_ASSOC_EXPIRE = 4, - WIFI_REASON_ASSOC_TOOMANY = 5, - WIFI_REASON_NOT_AUTHED = 6, - WIFI_REASON_NOT_ASSOCED = 7, - WIFI_REASON_ASSOC_LEAVE = 8, - WIFI_REASON_ASSOC_NOT_AUTHED = 9, - WIFI_REASON_DISASSOC_PWRCAP_BAD = 10, - WIFI_REASON_DISASSOC_SUPCHAN_BAD = 11, - WIFI_REASON_IE_INVALID = 13, - WIFI_REASON_MIC_FAILURE = 14, - WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT = 15, - WIFI_REASON_GROUP_KEY_UPDATE_TIMEOUT = 16, - WIFI_REASON_IE_IN_4WAY_DIFFERS = 17, - WIFI_REASON_GROUP_CIPHER_INVALID = 18, - WIFI_REASON_PAIRWISE_CIPHER_INVALID = 19, - WIFI_REASON_AKMP_INVALID = 20, - WIFI_REASON_UNSUPP_RSN_IE_VERSION = 21, - WIFI_REASON_INVALID_RSN_IE_CAP = 22, - WIFI_REASON_802_1X_AUTH_FAILED = 23, - WIFI_REASON_CIPHER_SUITE_REJECTED = 24, - - WIFI_REASON_BEACON_TIMEOUT = 200, - WIFI_REASON_NO_AP_FOUND = 201, - WIFI_REASON_AUTH_FAIL = 202, - WIFI_REASON_ASSOC_FAIL = 203, - WIFI_REASON_HANDSHAKE_TIMEOUT = 204, - WIFI_REASON_CONNECTION_FAIL = 205, -} wifi_err_reason_t; - -typedef enum { - WIFI_SECOND_CHAN_NONE = 0, /**< the channel width is HT20 */ - WIFI_SECOND_CHAN_ABOVE, /**< the channel width is HT40 and the secondary channel is above the primary channel */ - WIFI_SECOND_CHAN_BELOW, /**< the channel width is HT40 and the secondary channel is below the primary channel */ -} wifi_second_chan_t; - -typedef enum { - WIFI_SCAN_TYPE_ACTIVE = 0, /**< active scan */ - WIFI_SCAN_TYPE_PASSIVE, /**< passive scan */ -} wifi_scan_type_t; - -/** @brief Range of active scan times per channel */ -typedef struct { - uint32_t min; /**< minimum active scan time per channel, units: millisecond */ - uint32_t max; /**< maximum active scan time per channel, units: millisecond, values above 1500ms may - cause station to disconnect from AP and are not recommended. */ -} wifi_active_scan_time_t; - -/** @brief Aggregate of active & passive scan time per channel */ -typedef union { - wifi_active_scan_time_t active; /**< active scan time per channel, units: millisecond. */ - uint32_t passive; /**< passive scan time per channel, units: millisecond, values above 1500ms may - cause station to disconnect from AP and are not recommended. */ -} wifi_scan_time_t; - -/** @brief Parameters for an SSID scan. */ -typedef struct { - uint8_t *ssid; /**< SSID of AP */ - uint8_t *bssid; /**< MAC address of AP */ - uint8_t channel; /**< channel, scan the specific channel */ - bool show_hidden; /**< enable to scan AP whose SSID is hidden */ - wifi_scan_type_t scan_type; /**< scan type, active or passive */ - wifi_scan_time_t scan_time; /**< scan time per channel */ -} wifi_scan_config_t; - -typedef enum { - WIFI_CIPHER_TYPE_NONE = 0, /**< the cipher type is none */ - WIFI_CIPHER_TYPE_WEP40, /**< the cipher type is WEP40 */ - WIFI_CIPHER_TYPE_WEP104, /**< the cipher type is WEP104 */ - WIFI_CIPHER_TYPE_TKIP, /**< the cipher type is TKIP */ - WIFI_CIPHER_TYPE_CCMP, /**< the cipher type is CCMP */ - WIFI_CIPHER_TYPE_TKIP_CCMP, /**< the cipher type is TKIP and CCMP */ - WIFI_CIPHER_TYPE_UNKNOWN, /**< the cipher type is unknown */ -} wifi_cipher_type_t; - -/** - * @brief WiFi antenna - * - */ -typedef enum { - WIFI_ANT_ANT0, /**< WiFi antenna 0 */ - WIFI_ANT_ANT1, /**< WiFi antenna 1 */ - WIFI_ANT_MAX, /**< Invalid WiFi antenna */ -} wifi_ant_t; - -/** @brief Description of a WiFi AP */ -typedef struct { - uint8_t bssid[6]; /**< MAC address of AP */ - uint8_t ssid[33]; /**< SSID of AP */ - uint8_t primary; /**< channel of AP */ - wifi_second_chan_t second; /**< secondary channel of AP */ - int8_t rssi; /**< signal strength of AP */ - wifi_auth_mode_t authmode; /**< authmode of AP */ - wifi_cipher_type_t pairwise_cipher; /**< pairwise cipher of AP */ - wifi_cipher_type_t group_cipher; /**< group cipher of AP */ - wifi_ant_t ant; /**< antenna used to receive beacon from AP */ - uint32_t phy_11b:1; /**< bit: 0 flag to identify if 11b mode is enabled or not */ - uint32_t phy_11g:1; /**< bit: 1 flag to identify if 11g mode is enabled or not */ - uint32_t phy_11n:1; /**< bit: 2 flag to identify if 11n mode is enabled or not */ - uint32_t phy_lr:1; /**< bit: 3 flag to identify if low rate is enabled or not */ - uint32_t wps:1; /**< bit: 4 flag to identify if WPS is supported or not */ - uint32_t reserved:27; /**< bit: 5..31 reserved */ - wifi_country_t country; /**< country information of AP */ -} wifi_ap_record_t; - -typedef enum { - WIFI_FAST_SCAN = 0, /**< Do fast scan, scan will end after find SSID match AP */ - WIFI_ALL_CHANNEL_SCAN, /**< All channel scan, scan will end after scan all the channel */ -}wifi_scan_method_t; - -typedef enum { - WIFI_CONNECT_AP_BY_SIGNAL = 0, /**< Sort match AP in scan list by RSSI */ - WIFI_CONNECT_AP_BY_SECURITY, /**< Sort match AP in scan list by security mode */ -}wifi_sort_method_t; - -/** @brief Structure describing parameters for a WiFi fast scan */ -typedef struct { - int8_t rssi; /**< The minimum rssi to accept in the fast scan mode */ - wifi_auth_mode_t authmode; /**< The weakest authmode to accept in the fast scan mode */ -}wifi_fast_scan_threshold_t; - -typedef wifi_fast_scan_threshold_t wifi_scan_threshold_t; /**< wifi_fast_scan_threshold_t only used in fast scan mode once, now it enabled in all channel scan, the wifi_fast_scan_threshold_t will be remove in version 4.0 */ - -typedef enum { - WIFI_PS_NONE, /**< No power save */ - WIFI_PS_MIN_MODEM, /**< Minimum modem power saving. In this mode, station wakes up to receive beacon every DTIM period */ - WIFI_PS_MAX_MODEM, /**< Maximum modem power saving. In this mode, interval to receive beacons is determined by the listen_interval parameter in wifi_sta_config_t */ -} wifi_ps_type_t; - -#define WIFI_PS_MODEM WIFI_PS_MIN_MODEM /**< @deprecated Use WIFI_PS_MIN_MODEM or WIFI_PS_MAX_MODEM instead */ - -#define WIFI_PROTOCOL_11B 1 -#define WIFI_PROTOCOL_11G 2 -#define WIFI_PROTOCOL_11N 4 -#define WIFI_PROTOCOL_LR 8 - -typedef enum { - WIFI_BW_HT20 = 1, /* Bandwidth is HT20 */ - WIFI_BW_HT40, /* Bandwidth is HT40 */ -} wifi_bandwidth_t; - -/** @brief Soft-AP configuration settings for the ESP32 */ -typedef struct { - uint8_t ssid[32]; /**< SSID of ESP32 soft-AP */ - uint8_t password[64]; /**< Password of ESP32 soft-AP */ - uint8_t ssid_len; /**< Length of SSID. If softap_config.ssid_len==0, check the SSID until there is a termination character; otherwise, set the SSID length according to softap_config.ssid_len. */ - uint8_t channel; /**< Channel of ESP32 soft-AP */ - wifi_auth_mode_t authmode; /**< Auth mode of ESP32 soft-AP. Do not support AUTH_WEP in soft-AP mode */ - uint8_t ssid_hidden; /**< Broadcast SSID or not, default 0, broadcast the SSID */ - uint8_t max_connection; /**< Max number of stations allowed to connect in, default 4, max 4 */ - uint16_t beacon_interval; /**< Beacon interval, 100 ~ 60000 ms, default 100 ms */ -} wifi_ap_config_t; - -/** @brief STA configuration settings for the ESP32 */ -typedef struct { - uint8_t ssid[32]; /**< SSID of target AP*/ - uint8_t password[64]; /**< password of target AP*/ - wifi_scan_method_t scan_method; /**< do all channel scan or fast scan */ - bool bssid_set; /**< whether set MAC address of target AP or not. Generally, station_config.bssid_set needs to be 0; and it needs to be 1 only when users need to check the MAC address of the AP.*/ - uint8_t bssid[6]; /**< MAC address of target AP*/ - uint8_t channel; /**< channel of target AP. Set to 1~13 to scan starting from the specified channel before connecting to AP. If the channel of AP is unknown, set it to 0.*/ - uint16_t listen_interval; /**< Listen interval for ESP32 station to receive beacon when WIFI_PS_MAX_MODEM is set. Units: AP beacon intervals. Defaults to 3 if set to 0. */ - wifi_sort_method_t sort_method; /**< sort the connect AP in the list by rssi or security mode */ - wifi_scan_threshold_t threshold; /**< When scan_method is set, only APs which have an auth mode that is more secure than the selected auth mode and a signal stronger than the minimum RSSI will be used. */ -} wifi_sta_config_t; - -/** @brief Configuration data for ESP32 AP or STA. - * - * The usage of this union (for ap or sta configuration) is determined by the accompanying - * interface argument passed to esp_wifi_set_config() or esp_wifi_get_config() - * - */ -typedef union { - wifi_ap_config_t ap; /**< configuration of AP */ - wifi_sta_config_t sta; /**< configuration of STA */ -} wifi_config_t; - -/** @brief Description of STA associated with AP */ -typedef struct { - uint8_t mac[6]; /**< mac address */ - int8_t rssi; /**< current average rssi of sta connected */ - uint32_t phy_11b:1; /**< bit: 0 flag to identify if 11b mode is enabled or not */ - uint32_t phy_11g:1; /**< bit: 1 flag to identify if 11g mode is enabled or not */ - uint32_t phy_11n:1; /**< bit: 2 flag to identify if 11n mode is enabled or not */ - uint32_t phy_lr:1; /**< bit: 3 flag to identify if low rate is enabled or not */ - uint32_t reserved:28; /**< bit: 4..31 reserved */ -} wifi_sta_info_t; - -#define ESP_WIFI_MAX_CONN_NUM (10) /**< max number of stations which can connect to ESP32 soft-AP */ - -/** @brief List of stations associated with the ESP32 Soft-AP */ -typedef struct { - wifi_sta_info_t sta[ESP_WIFI_MAX_CONN_NUM]; /**< station list */ - int num; /**< number of stations in the list (other entries are invalid) */ -} wifi_sta_list_t; - -typedef enum { - WIFI_STORAGE_FLASH, /**< all configuration will strore in both memory and flash */ - WIFI_STORAGE_RAM, /**< all configuration will only store in the memory */ -} wifi_storage_t; - -/** - * @brief Vendor Information Element type - * - * Determines the frame type that the IE will be associated with. - */ -typedef enum { - WIFI_VND_IE_TYPE_BEACON, - WIFI_VND_IE_TYPE_PROBE_REQ, - WIFI_VND_IE_TYPE_PROBE_RESP, - WIFI_VND_IE_TYPE_ASSOC_REQ, - WIFI_VND_IE_TYPE_ASSOC_RESP, -} wifi_vendor_ie_type_t; - -/** - * @brief Vendor Information Element index - * - * Each IE type can have up to two associated vendor ID elements. - */ -typedef enum { - WIFI_VND_IE_ID_0, - WIFI_VND_IE_ID_1, -} wifi_vendor_ie_id_t; - -#define WIFI_VENDOR_IE_ELEMENT_ID 0xDD - -/** - * @brief Vendor Information Element header - * - * The first bytes of the Information Element will match this header. Payload follows. - */ -typedef struct { - uint8_t element_id; /**< Should be set to WIFI_VENDOR_IE_ELEMENT_ID (0xDD) */ - uint8_t length; /**< Length of all bytes in the element data following this field. Minimum 4. */ - uint8_t vendor_oui[3]; /**< Vendor identifier (OUI). */ - uint8_t vendor_oui_type; /**< Vendor-specific OUI type. */ - uint8_t payload[0]; /**< Payload. Length is equal to value in 'length' field, minus 4. */ -} vendor_ie_data_t; - -/** @brief Received packet radio metadata header, this is the common header at the beginning of all promiscuous mode RX callback buffers */ -typedef struct { - signed rssi:8; /**< Received Signal Strength Indicator(RSSI) of packet. unit: dBm */ - unsigned rate:5; /**< PHY rate encoding of the packet. Only valid for non HT(11bg) packet */ - unsigned :1; /**< reserve */ - unsigned sig_mode:2; /**< 0: non HT(11bg) packet; 1: HT(11n) packet; 3: VHT(11ac) packet */ - unsigned :16; /**< reserve */ - unsigned mcs:7; /**< Modulation Coding Scheme. If is HT(11n) packet, shows the modulation, range from 0 to 76(MSC0 ~ MCS76) */ - unsigned cwb:1; /**< Channel Bandwidth of the packet. 0: 20MHz; 1: 40MHz */ - unsigned :16; /**< reserve */ - unsigned smoothing:1; /**< reserve */ - unsigned not_sounding:1; /**< reserve */ - unsigned :1; /**< reserve */ - unsigned aggregation:1; /**< Aggregation. 0: MPDU packet; 1: AMPDU packet */ - unsigned stbc:2; /**< Space Time Block Code(STBC). 0: non STBC packet; 1: STBC packet */ - unsigned fec_coding:1; /**< Flag is set for 11n packets which are LDPC */ - unsigned sgi:1; /**< Short Guide Interval(SGI). 0: Long GI; 1: Short GI */ - signed noise_floor:8; /**< noise floor of Radio Frequency Module(RF). unit: 0.25dBm*/ - unsigned ampdu_cnt:8; /**< ampdu cnt */ - unsigned channel:4; /**< primary channel on which this packet is received */ - unsigned secondary_channel:4; /**< secondary channel on which this packet is received. 0: none; 1: above; 2: below */ - unsigned :8; /**< reserve */ - unsigned timestamp:32; /**< timestamp. The local time when this packet is received. It is precise only if modem sleep or light sleep is not enabled. unit: microsecond */ - unsigned :32; /**< reserve */ - unsigned :31; /**< reserve */ - unsigned ant:1; /**< antenna number from which this packet is received. 0: WiFi antenna 0; 1: WiFi antenna 1 */ - unsigned sig_len:12; /**< length of packet including Frame Check Sequence(FCS) */ - unsigned :12; /**< reserve */ - unsigned rx_state:8; /**< state of the packet. 0: no error; others: error numbers which are not public */ -} wifi_pkt_rx_ctrl_t; - -/** @brief Payload passed to 'buf' parameter of promiscuous mode RX callback. - */ -typedef struct { - wifi_pkt_rx_ctrl_t rx_ctrl; /**< metadata header */ - uint8_t payload[0]; /**< Data or management payload. Length of payload is described by rx_ctrl.sig_len. Type of content determined by packet type argument of callback. */ -} wifi_promiscuous_pkt_t; - -/** - * @brief Promiscuous frame type - * - * Passed to promiscuous mode RX callback to indicate the type of parameter in the buffer. - * - */ -typedef enum { - WIFI_PKT_MGMT, /**< Management frame, indicates 'buf' argument is wifi_promiscuous_pkt_t */ - WIFI_PKT_CTRL, /**< Control frame, indicates 'buf' argument is wifi_promiscuous_pkt_t */ - WIFI_PKT_DATA, /**< Data frame, indiciates 'buf' argument is wifi_promiscuous_pkt_t */ - WIFI_PKT_MISC, /**< Other type, such as MIMO etc. 'buf' argument is wifi_promiscuous_pkt_t but the payload is zero length. */ -} wifi_promiscuous_pkt_type_t; - - -#define WIFI_PROMIS_FILTER_MASK_ALL (0xFFFFFFFF) /**< filter all packets */ -#define WIFI_PROMIS_FILTER_MASK_MGMT (1) /**< filter the packets with type of WIFI_PKT_MGMT */ -#define WIFI_PROMIS_FILTER_MASK_CTRL (1<<1) /**< filter the packets with type of WIFI_PKT_CTRL */ -#define WIFI_PROMIS_FILTER_MASK_DATA (1<<2) /**< filter the packets with type of WIFI_PKT_DATA */ -#define WIFI_PROMIS_FILTER_MASK_MISC (1<<3) /**< filter the packets with type of WIFI_PKT_MISC */ -#define WIFI_PROMIS_FILTER_MASK_DATA_MPDU (1<<4) /**< filter the MPDU which is a kind of WIFI_PKT_DATA */ -#define WIFI_PROMIS_FILTER_MASK_DATA_AMPDU (1<<5) /**< filter the AMPDU which is a kind of WIFI_PKT_DATA */ - -#define WIFI_PROMIS_CTRL_FILTER_MASK_ALL (0xFF800000) /**< filter all control packets */ -#define WIFI_PROMIS_CTRL_FILTER_MASK_WRAPPER (1<<23) /**< filter the control packets with subtype of Control Wrapper */ -#define WIFI_PROMIS_CTRL_FILTER_MASK_BAR (1<<24) /**< filter the control packets with subtype of Block Ack Request */ -#define WIFI_PROMIS_CTRL_FILTER_MASK_BA (1<<25) /**< filter the control packets with subtype of Block Ack */ -#define WIFI_PROMIS_CTRL_FILTER_MASK_PSPOLL (1<<26) /**< filter the control packets with subtype of PS-Poll */ -#define WIFI_PROMIS_CTRL_FILTER_MASK_RTS (1<<27) /**< filter the control packets with subtype of RTS */ -#define WIFI_PROMIS_CTRL_FILTER_MASK_CTS (1<<28) /**< filter the control packets with subtype of CTS */ -#define WIFI_PROMIS_CTRL_FILTER_MASK_ACK (1<<29) /**< filter the control packets with subtype of ACK */ -#define WIFI_PROMIS_CTRL_FILTER_MASK_CFEND (1<<30) /**< filter the control packets with subtype of CF-END */ -#define WIFI_PROMIS_CTRL_FILTER_MASK_CFENDACK (1<<31) /**< filter the control packets with subtype of CF-END+CF-ACK */ - -/** @brief Mask for filtering different packet types in promiscuous mode. */ -typedef struct { - uint32_t filter_mask; /**< OR of one or more filter values WIFI_PROMIS_FILTER_* */ -} wifi_promiscuous_filter_t; - -#define WIFI_EVENT_MASK_ALL (0xFFFFFFFF) /**< mask all WiFi events */ -#define WIFI_EVENT_MASK_NONE (0) /**< mask none of the WiFi events */ -#define WIFI_EVENT_MASK_AP_PROBEREQRECVED (BIT(0)) /**< mask SYSTEM_EVENT_AP_PROBEREQRECVED event */ - -/** - * @brief Channel state information(CSI) configuration type - * - */ -typedef struct { - bool lltf_en; /**< enable to receive legacy long training field(lltf) data. Default enabled */ - bool htltf_en; /**< enable to receive HT long training field(htltf) data. Default enabled */ - bool stbc_htltf2_en; /**< enable to receive space time block code HT long training field(stbc-htltf2) data. Default enabled */ - bool ltf_merge_en; /**< enable to generate htlft data by averaging lltf and ht_ltf data when receiving HT packet. Otherwise, use ht_ltf data directly. Default enabled */ - bool channel_filter_en; /**< enable to turn on channel filter to smooth adjacent sub-carrier. Disable it to keep independence of adjacent sub-carrier. Default enabled */ - bool manu_scale; /**< manually scale the CSI data by left shifting or automatically scale the CSI data. If set true, please set the shift bits. false: automatically. true: manually. Default false */ - uint8_t shift; /**< manually left shift bits of the scale of the CSI data. The range of the left shift bits is 0~15 */ -} wifi_csi_config_t; - -/** - * @brief CSI data type - * - */ -typedef struct { - wifi_pkt_rx_ctrl_t rx_ctrl;/**< received packet radio metadata header of the CSI data */ - uint8_t mac[6]; /**< source MAC address of the CSI data */ - bool first_word_invalid; /**< first four bytes of the CSI data is invalid or not */ - int8_t *buf; /**< buffer of CSI data */ - uint16_t len; /**< length of CSI data */ -} wifi_csi_info_t; - -/** - * @brief WiFi GPIO configuration for antenna selection - * - */ -typedef struct { - uint8_t gpio_select: 1, /**< Whether this GPIO is connected to external antenna switch */ - gpio_num: 7; /**< The GPIO number that connects to external antenna switch */ -} wifi_ant_gpio_t; - -/** - * @brief WiFi GPIOs configuration for antenna selection - * - */ -typedef struct { - wifi_ant_gpio_t gpio_cfg[4]; /**< The configurations of GPIOs that connect to external antenna switch */ -} wifi_ant_gpio_config_t; - -/** - * @brief WiFi antenna mode - * - */ -typedef enum { - WIFI_ANT_MODE_ANT0, /**< Enable WiFi antenna 0 only */ - WIFI_ANT_MODE_ANT1, /**< Enable WiFi antenna 1 only */ - WIFI_ANT_MODE_AUTO, /**< Enable WiFi antenna 0 and 1, automatically select an antenna */ - WIFI_ANT_MODE_MAX, /**< Invalid WiFi enabled antenna */ -} wifi_ant_mode_t; - -/** - * @brief WiFi antenna configuration - * - */ -typedef struct { - wifi_ant_mode_t rx_ant_mode; /**< WiFi antenna mode for receiving */ - wifi_ant_t rx_ant_default; /**< Default antenna mode for receiving, it's ignored if rx_ant_mode is not WIFI_ANT_MODE_AUTO */ - wifi_ant_mode_t tx_ant_mode; /**< WiFi antenna mode for transmission, it can be set to WIFI_ANT_MODE_AUTO only if rx_ant_mode is set to WIFI_ANT_MODE_AUTO */ - uint8_t enabled_ant0: 4, /**< Index (in antenna GPIO configuration) of enabled WIFI_ANT_MODE_ANT0 */ - enabled_ant1: 4; /**< Index (in antenna GPIO configuration) of enabled WIFI_ANT_MODE_ANT1 */ -} wifi_ant_config_t; - -/** - * @brief WiFi PHY rate encodings - * - */ -typedef enum { - WIFI_PHY_RATE_1M_L = 0x00, /**< 1 Mbps with long preamble */ - WIFI_PHY_RATE_2M_L = 0x01, /**< 2 Mbps with long preamble */ - WIFI_PHY_RATE_5M_L = 0x02, /**< 5.5 Mbps with long preamble */ - WIFI_PHY_RATE_11M_L = 0x03, /**< 11 Mbps with long preamble */ - WIFI_PHY_RATE_2M_S = 0x05, /**< 2 Mbps with short preamble */ - WIFI_PHY_RATE_5M_S = 0x06, /**< 5.5 Mbps with short preamble */ - WIFI_PHY_RATE_11M_S = 0x07, /**< 11 Mbps with short preamble */ - WIFI_PHY_RATE_48M = 0x08, /**< 48 Mbps */ - WIFI_PHY_RATE_24M = 0x09, /**< 24 Mbps */ - WIFI_PHY_RATE_12M = 0x0A, /**< 12 Mbps */ - WIFI_PHY_RATE_6M = 0x0B, /**< 6 Mbps */ - WIFI_PHY_RATE_54M = 0x0C, /**< 54 Mbps */ - WIFI_PHY_RATE_36M = 0x0D, /**< 36 Mbps */ - WIFI_PHY_RATE_18M = 0x0E, /**< 18 Mbps */ - WIFI_PHY_RATE_9M = 0x0F, /**< 9 Mbps */ - WIFI_PHY_RATE_MCS0_LGI = 0x10, /**< MCS0 with long GI, 6.5 Mbps for 20MHz, 13.5 Mbps for 40MHz */ - WIFI_PHY_RATE_MCS1_LGI = 0x11, /**< MCS1 with long GI, 13 Mbps for 20MHz, 27 Mbps for 40MHz */ - WIFI_PHY_RATE_MCS2_LGI = 0x12, /**< MCS2 with long GI, 19.5 Mbps for 20MHz, 40.5 Mbps for 40MHz */ - WIFI_PHY_RATE_MCS3_LGI = 0x13, /**< MCS3 with long GI, 26 Mbps for 20MHz, 54 Mbps for 40MHz */ - WIFI_PHY_RATE_MCS4_LGI = 0x14, /**< MCS4 with long GI, 39 Mbps for 20MHz, 81 Mbps for 40MHz */ - WIFI_PHY_RATE_MCS5_LGI = 0x15, /**< MCS5 with long GI, 52 Mbps for 20MHz, 108 Mbps for 40MHz */ - WIFI_PHY_RATE_MCS6_LGI = 0x16, /**< MCS6 with long GI, 58.5 Mbps for 20MHz, 121.5 Mbps for 40MHz */ - WIFI_PHY_RATE_MCS7_LGI = 0x17, /**< MCS7 with long GI, 65 Mbps for 20MHz, 135 Mbps for 40MHz */ - WIFI_PHY_RATE_MCS0_SGI = 0x18, /**< MCS0 with short GI, 7.2 Mbps for 20MHz, 15 Mbps for 40MHz */ - WIFI_PHY_RATE_MCS1_SGI = 0x19, /**< MCS1 with short GI, 14.4 Mbps for 20MHz, 30 Mbps for 40MHz */ - WIFI_PHY_RATE_MCS2_SGI = 0x1A, /**< MCS2 with short GI, 21.7 Mbps for 20MHz, 45 Mbps for 40MHz */ - WIFI_PHY_RATE_MCS3_SGI = 0x1B, /**< MCS3 with short GI, 28.9 Mbps for 20MHz, 60 Mbps for 40MHz */ - WIFI_PHY_RATE_MCS4_SGI = 0x1C, /**< MCS4 with short GI, 43.3 Mbps for 20MHz, 90 Mbps for 40MHz */ - WIFI_PHY_RATE_MCS5_SGI = 0x1D, /**< MCS5 with short GI, 57.8 Mbps for 20MHz, 120 Mbps for 40MHz */ - WIFI_PHY_RATE_MCS6_SGI = 0x1E, /**< MCS6 with short GI, 65 Mbps for 20MHz, 135 Mbps for 40MHz */ - WIFI_PHY_RATE_MCS7_SGI = 0x1F, /**< MCS7 with short GI, 72.2 Mbps for 20MHz, 150 Mbps for 40MHz */ - WIFI_PHY_RATE_LORA_250K = 0x29, /**< 250 Kbps */ - WIFI_PHY_RATE_LORA_500K = 0x2A, /**< 500 Kbps */ - WIFI_PHY_RATE_MAX, -} wifi_phy_rate_t; - -/** - * @brief WiFi ioctl command type - * - */ -typedef enum { - WIFI_IOCTL_SET_STA_HT2040_COEX = 1, /**< Set the configuration of STA's HT2040 coexist management */ - WIFI_IOCTL_GET_STA_HT2040_COEX, /**< Get the configuration of STA's HT2040 coexist management */ - WIFI_IOCTL_MAX, -} wifi_ioctl_cmd_t; - -/** - * @brief Configuration for STA's HT2040 coexist management - * - */ -typedef struct { - int enable; /**< Indicate whether STA's HT2040 coexist management is enabled or not */ -} wifi_ht2040_coex_t; - -/** - * @brief Configuration for WiFi ioctl - * - */ -typedef struct { - union { - wifi_ht2040_coex_t ht2040_coex; /**< Configuration of STA's HT2040 coexist management */ - } data; /**< Configuration of ioctl command */ -} wifi_ioctl_config_t; - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_WIFI_TYPES_H__ */ diff --git a/tools/sdk/include/esp32/esp_wpa2.h b/tools/sdk/include/esp32/esp_wpa2.h deleted file mode 100644 index 1b2dfa51038..00000000000 --- a/tools/sdk/include/esp32/esp_wpa2.h +++ /dev/null @@ -1,208 +0,0 @@ -// Hardware crypto support 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. - -#ifndef ESP_WPA2_H -#define ESP_WPA2_H - -#include - -#include "esp_err.h" -#include "esp_wifi_crypto_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -extern const wpa2_crypto_funcs_t g_wifi_default_wpa2_crypto_funcs; - -typedef struct { - const wpa2_crypto_funcs_t *crypto_funcs; -}esp_wpa2_config_t; - -#define WPA2_CONFIG_INIT_DEFAULT() { \ - .crypto_funcs = &g_wifi_default_wpa2_crypto_funcs \ -} - -/** - * @brief Enable wpa2 enterprise authentication. - * - * @attention 1. wpa2 enterprise authentication can only be used when ESP32 station is enabled. - * @attention 2. wpa2 enterprise authentication can only support TLS, PEAP-MSCHAPv2 and TTLS-MSCHAPv2 method. - * - * @return - * - ESP_OK: succeed. - * - ESP_ERR_NO_MEM: fail(internal memory malloc fail) - */ -esp_err_t esp_wifi_sta_wpa2_ent_enable(const esp_wpa2_config_t *config); - -/** - * @brief Disable wpa2 enterprise authentication. - * - * @attention 1. wpa2 enterprise authentication can only be used when ESP32 station is enabled. - * @attention 2. wpa2 enterprise authentication can only support TLS, PEAP-MSCHAPv2 and TTLS-MSCHAPv2 method. - * - * @return - * - ESP_OK: succeed. - */ -esp_err_t esp_wifi_sta_wpa2_ent_disable(void); - -/** - * @brief Set identity for PEAP/TTLS method. - * - * @attention The API only passes the parameter identity to the global pointer variable in wpa2 enterprise module. - * - * @param identity: point to address where stores the identity; - * @param len: length of identity, limited to 1~127 - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_INVALID_ARG: fail(len <= 0 or len >= 128) - * - ESP_ERR_NO_MEM: fail(internal memory malloc fail) - */ -esp_err_t esp_wifi_sta_wpa2_ent_set_identity(const unsigned char *identity, int len); - -/** - * @brief Clear identity for PEAP/TTLS method. - */ -void esp_wifi_sta_wpa2_ent_clear_identity(void); - -/** - * @brief Set username for PEAP/TTLS method. - * - * @attention The API only passes the parameter username to the global pointer variable in wpa2 enterprise module. - * - * @param username: point to address where stores the username; - * @param len: length of username, limited to 1~127 - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_INVALID_ARG: fail(len <= 0 or len >= 128) - * - ESP_ERR_NO_MEM: fail(internal memory malloc fail) - */ -esp_err_t esp_wifi_sta_wpa2_ent_set_username(const unsigned char *username, int len); - -/** - * @brief Clear username for PEAP/TTLS method. - */ -void esp_wifi_sta_wpa2_ent_clear_username(void); - -/** - * @brief Set password for PEAP/TTLS method.. - * - * @attention The API only passes the parameter password to the global pointer variable in wpa2 enterprise module. - * - * @param password: point to address where stores the password; - * @param len: length of password(len > 0) - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_INVALID_ARG: fail(len <= 0) - * - ESP_ERR_NO_MEM: fail(internal memory malloc fail) - */ -esp_err_t esp_wifi_sta_wpa2_ent_set_password(const unsigned char *password, int len); - -/** - * @brief Clear password for PEAP/TTLS method.. - */ -void esp_wifi_sta_wpa2_ent_clear_password(void); - -/** - * @brief Set new password for MSCHAPv2 method.. - * - * @attention 1. The API only passes the parameter password to the global pointer variable in wpa2 enterprise module. - * @attention 2. The new password is used to substitute the old password when eap-mschapv2 failure request message with error code ERROR_PASSWD_EXPIRED is received. - * - * @param new_password: point to address where stores the password; - * @param len: length of password - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_INVALID_ARG: fail(len <= 0) - * - ESP_ERR_NO_MEM: fail(internal memory malloc fail) - */ - -esp_err_t esp_wifi_sta_wpa2_ent_set_new_password(const unsigned char *new_password, int len); - -/** - * @brief Clear new password for MSCHAPv2 method.. - */ -void esp_wifi_sta_wpa2_ent_clear_new_password(void); - -/** - * @brief Set CA certificate for PEAP/TTLS method. - * - * @attention 1. The API only passes the parameter ca_cert to the global pointer variable in wpa2 enterprise module. - * @attention 2. The ca_cert should be zero terminated. - * - * @param ca_cert: point to address where stores the CA certificate; - * @param ca_cert_len: length of ca_cert - * - * @return - * - ESP_OK: succeed - */ -esp_err_t esp_wifi_sta_wpa2_ent_set_ca_cert(const unsigned char *ca_cert, int ca_cert_len); - -/** - * @brief Clear CA certificate for PEAP/TTLS method. - */ -void esp_wifi_sta_wpa2_ent_clear_ca_cert(void); - -/** - * @brief Set client certificate and key. - * - * @attention 1. The API only passes the parameter client_cert, private_key and private_key_passwd to the global pointer variable in wpa2 enterprise module. - * @attention 2. The client_cert, private_key and private_key_passwd should be zero terminated. - * - * @param client_cert: point to address where stores the client certificate; - * @param client_cert_len: length of client certificate; - * @param private_key: point to address where stores the private key; - * @param private_key_len: length of private key, limited to 1~2048; - * @param private_key_password: point to address where stores the private key password; - * @param private_key_password_len: length of private key password; - * - * @return - * - ESP_OK: succeed - */ -esp_err_t esp_wifi_sta_wpa2_ent_set_cert_key(const unsigned char *client_cert, int client_cert_len, const unsigned char *private_key, int private_key_len, const unsigned char *private_key_passwd, int private_key_passwd_len); - -/** - * @brief Clear client certificate and key. - */ -void esp_wifi_sta_wpa2_ent_clear_cert_key(void); - -/** - * @brief Set wpa2 enterprise certs time check(disable or not). - * - * @param true: disable wpa2 enterprise certs time check - * @param false: enable wpa2 enterprise certs time check - * - * @return - * - ESP_OK: succeed - */ -esp_err_t esp_wifi_sta_wpa2_ent_set_disable_time_check(bool disable); - -/** - * @brief Get wpa2 enterprise certs time check(disable or not). - * - * @param disable: store disable value - * - * @return - * - ESP_OK: succeed - */ -esp_err_t esp_wifi_sta_wpa2_ent_get_disable_time_check(bool *disable); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/tools/sdk/include/esp32/esp_wps.h b/tools/sdk/include/esp32/esp_wps.h deleted file mode 100644 index 9bd61cc3af1..00000000000 --- a/tools/sdk/include/esp32/esp_wps.h +++ /dev/null @@ -1,144 +0,0 @@ -// 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. - -#ifndef __ESP_WPS_H__ -#define __ESP_WPS_H__ - -#include -#include -#include "esp_err.h" -#include "esp_wifi_crypto_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** \defgroup WiFi_APIs WiFi Related APIs - * @brief WiFi APIs - */ - -/** @addtogroup WiFi_APIs - * @{ - */ - -/** \defgroup WPS_APIs WPS APIs - * @brief ESP32 WPS APIs - * - * WPS can only be used when ESP32 station is enabled. - * - */ - -/** @addtogroup WPS_APIs - * @{ - */ - -#define ESP_ERR_WIFI_REGISTRAR (ESP_ERR_WIFI_BASE + 51) /*!< WPS registrar is not supported */ -#define ESP_ERR_WIFI_WPS_TYPE (ESP_ERR_WIFI_BASE + 52) /*!< WPS type error */ -#define ESP_ERR_WIFI_WPS_SM (ESP_ERR_WIFI_BASE + 53) /*!< WPS state machine is not initialized */ - -typedef enum wps_type { - WPS_TYPE_DISABLE = 0, - WPS_TYPE_PBC, - WPS_TYPE_PIN, - WPS_TYPE_MAX, -} wps_type_t; - -extern const wps_crypto_funcs_t g_wifi_default_wps_crypto_funcs; - -#define WPS_MAX_MANUFACTURER_LEN 65 -#define WPS_MAX_MODEL_NUMBER_LEN 33 -#define WPS_MAX_MODEL_NAME_LEN 33 -#define WPS_MAX_DEVICE_NAME_LEN 33 - -typedef struct { - char manufacturer[WPS_MAX_MANUFACTURER_LEN]; /*!< Manufacturer, null-terminated string. The default manufcturer is used if the string is empty */ - char model_number[WPS_MAX_MODEL_NUMBER_LEN]; /*!< Model number, null-terminated string. The default model number is used if the string is empty */ - char model_name[WPS_MAX_MODEL_NAME_LEN]; /*!< Model name, null-terminated string. The default model name is used if the string is empty */ - char device_name[WPS_MAX_DEVICE_NAME_LEN]; /*!< Device name, null-terminated string. The default device name is used if the string is empty */ -} wps_factory_information_t; - -typedef struct { - wps_type_t wps_type; - const wps_crypto_funcs_t *crypto_funcs; - wps_factory_information_t factory_info; -} esp_wps_config_t; - -#define WPS_CONFIG_INIT_DEFAULT(type) { \ - .wps_type = type, \ - .crypto_funcs = &g_wifi_default_wps_crypto_funcs, \ - .factory_info = { \ - .manufacturer = "ESPRESSIF", \ - .model_number = "ESP32", \ - .model_name = "ESPRESSIF IOT", \ - .device_name = "ESP STATION", \ - } \ -} - -/** - * @brief Enable Wi-Fi WPS function. - * - * @attention WPS can only be used when ESP32 station is enabled. - * - * @param wps_type_t wps_type : WPS type, so far only WPS_TYPE_PBC and WPS_TYPE_PIN is supported - * - * @return - * - ESP_OK : succeed - * - ESP_ERR_WIFI_WPS_TYPE : wps type is invalid - * - ESP_ERR_WIFI_WPS_MODE : wifi is not in station mode or sniffer mode is on - * - ESP_FAIL : wps initialization fails - */ -esp_err_t esp_wifi_wps_enable(const esp_wps_config_t *config); - -/** - * @brief Disable Wi-Fi WPS function and release resource it taken. - * - * @param null - * - * @return - * - ESP_OK : succeed - * - ESP_ERR_WIFI_WPS_MODE : wifi is not in station mode or sniffer mode is on - */ -esp_err_t esp_wifi_wps_disable(void); - -/** - * @brief WPS starts to work. - * - * @attention WPS can only be used when ESP32 station is enabled. - * - * @param timeout_ms : maximum blocking time before API return. - * - 0 : non-blocking - * - 1~120000 : blocking time (not supported in IDF v1.0) - * - * @return - * - ESP_OK : succeed - * - ESP_ERR_WIFI_WPS_TYPE : wps type is invalid - * - ESP_ERR_WIFI_WPS_MODE : wifi is not in station mode or sniffer mode is on - * - ESP_ERR_WIFI_WPS_SM : wps state machine is not initialized - * - ESP_FAIL : wps initialization fails - */ -esp_err_t esp_wifi_wps_start(int timeout_ms); - -/** - * @} - */ - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_WPS_H__ */ diff --git a/tools/sdk/include/esp32/hwcrypto/aes.h b/tools/sdk/include/esp32/hwcrypto/aes.h deleted file mode 100644 index 5a3fd24fe03..00000000000 --- a/tools/sdk/include/esp32/hwcrypto/aes.h +++ /dev/null @@ -1,331 +0,0 @@ -/** - * \brief AES block cipher, ESP32 hardware accelerated version - * Based on mbedTLS FIPS-197 compliant version. - * - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * Additions Copyright (C) 2016, Espressif Systems (Shanghai) PTE Ltd - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * - */ - -#ifndef ESP_AES_H -#define ESP_AES_H - -#include "esp_types.h" -#include "rom/aes.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* padlock.c and aesni.c rely on these values! */ -#define ESP_AES_ENCRYPT 1 -#define ESP_AES_DECRYPT 0 - -#define ERR_ESP_AES_INVALID_KEY_LENGTH -0x0020 /**< Invalid key length. */ -#define ERR_ESP_AES_INVALID_INPUT_LENGTH -0x0022 /**< Invalid data input length. */ - -/** - * \brief AES context structure - * - */ -typedef struct { - uint8_t key_bytes; - volatile uint8_t key_in_hardware; /* This variable is used for fault injection checks, so marked volatile to avoid optimisation */ - uint8_t key[32]; -} esp_aes_context; - -/** - * \brief The AES XTS context-type definition. - */ -typedef struct -{ - esp_aes_context crypt; /*!< The AES context to use for AES block - encryption or decryption. */ - esp_aes_context tweak; /*!< The AES context used for tweak - computation. */ -} esp_aes_xts_context; - - -/** - * \brief Lock access to AES hardware unit - * - * AES hardware unit can only be used by one - * consumer at a time. - * - * esp_aes_xxx API calls automatically manage locking & unlocking of - * hardware, this function is only needed if you want to call - * ets_aes_xxx functions directly. - */ -void esp_aes_acquire_hardware( void ); - -/** - * \brief Unlock access to AES hardware unit - * - * esp_aes_xxx API calls automatically manage locking & unlocking of - * hardware, this function is only needed if you want to call - * ets_aes_xxx functions directly. - */ -void esp_aes_release_hardware( void ); - -/** - * \brief Initialize AES context - * - * \param ctx AES context to be initialized - */ -void esp_aes_init( esp_aes_context *ctx ); - -/** - * \brief Clear AES context - * - * \param ctx AES context to be cleared - */ -void esp_aes_free( esp_aes_context *ctx ); - -/** - * \brief This function initializes the specified AES XTS context. - * - * It must be the first API called before using - * the context. - * - * \param ctx The AES XTS context to initialize. - */ -void esp_aes_xts_init( esp_aes_xts_context *ctx ); - -/** - * \brief This function releases and clears the specified AES XTS context. - * - * \param ctx The AES XTS context to clear. - */ -void esp_aes_xts_free( esp_aes_xts_context *ctx ); - -/** - * \brief AES set key schedule (encryption or decryption) - * - * \param ctx AES context to be initialized - * \param key encryption key - * \param keybits must be 128, 192 or 256 - * - * \return 0 if successful, or ERR_AES_INVALID_KEY_LENGTH - */ -int esp_aes_setkey( esp_aes_context *ctx, const unsigned char *key, unsigned int keybits ); - -/** - * \brief AES-ECB block encryption/decryption - * - * \param ctx AES context - * \param mode AES_ENCRYPT or AES_DECRYPT - * \param input 16-byte input block - * \param output 16-byte output block - * - * \return 0 if successful - */ -int esp_aes_crypt_ecb( esp_aes_context *ctx, int mode, const unsigned char input[16], unsigned char output[16] ); - -/** - * \brief AES-CBC buffer encryption/decryption - * Length should be a multiple of the block - * size (16 bytes) - * - * \note Upon exit, the content of the IV is updated so that you can - * call the function same function again on the following - * block(s) of data and get the same result as if it was - * encrypted in one call. This allows a "streaming" usage. - * If on the other hand you need to retain the contents of the - * IV, you should either save it manually or use the cipher - * module instead. - * - * \param ctx AES context - * \param mode AES_ENCRYPT or AES_DECRYPT - * \param length length of the input data - * \param iv initialization vector (updated after use) - * \param input buffer holding the input data - * \param output buffer holding the output data - * - * \return 0 if successful, or ERR_AES_INVALID_INPUT_LENGTH - */ -int esp_aes_crypt_cbc( esp_aes_context *ctx, - int mode, - size_t length, - unsigned char iv[16], - const unsigned char *input, - unsigned char *output ); - - -/** - * \brief AES-CFB128 buffer encryption/decryption. - * - * Note: Due to the nature of CFB you should use the same key schedule for - * both encryption and decryption. So a context initialized with - * esp_aes_setkey_enc() for both AES_ENCRYPT and AES_DECRYPT. - * - * \note Upon exit, the content of the IV is updated so that you can - * call the function same function again on the following - * block(s) of data and get the same result as if it was - * encrypted in one call. This allows a "streaming" usage. - * If on the other hand you need to retain the contents of the - * IV, you should either save it manually or use the cipher - * module instead. - * - * \param ctx AES context - * \param mode AES_ENCRYPT or AES_DECRYPT - * \param length length of the input data - * \param iv_off offset in IV (updated after use) - * \param iv initialization vector (updated after use) - * \param input buffer holding the input data - * \param output buffer holding the output data - * - * \return 0 if successful - */ -int esp_aes_crypt_cfb128( esp_aes_context *ctx, - int mode, - size_t length, - size_t *iv_off, - unsigned char iv[16], - const unsigned char *input, - unsigned char *output ); - -/** - * \brief AES-CFB8 buffer encryption/decryption. - * - * Note: Due to the nature of CFB you should use the same key schedule for - * both encryption and decryption. So a context initialized with - * esp_aes_setkey_enc() for both AES_ENCRYPT and AES_DECRYPT. - * - * \note Upon exit, the content of the IV is updated so that you can - * call the function same function again on the following - * block(s) of data and get the same result as if it was - * encrypted in one call. This allows a "streaming" usage. - * If on the other hand you need to retain the contents of the - * IV, you should either save it manually or use the cipher - * module instead. - * - * \param ctx AES context - * \param mode AES_ENCRYPT or AES_DECRYPT - * \param length length of the input data - * \param iv initialization vector (updated after use) - * \param input buffer holding the input data - * \param output buffer holding the output data - * - * \return 0 if successful - */ -int esp_aes_crypt_cfb8( esp_aes_context *ctx, - int mode, - size_t length, - unsigned char iv[16], - const unsigned char *input, - unsigned char *output ); - -/** - * \brief AES-CTR buffer encryption/decryption - * - * Warning: You have to keep the maximum use of your counter in mind! - * - * Note: Due to the nature of CTR you should use the same key schedule for - * both encryption and decryption. So a context initialized with - * esp_aes_setkey_enc() for both AES_ENCRYPT and AES_DECRYPT. - * - * \param ctx AES context - * \param length The length of the data - * \param nc_off The offset in the current stream_block (for resuming - * within current cipher stream). The offset pointer to - * should be 0 at the start of a stream. - * \param nonce_counter The 128-bit nonce and counter. - * \param stream_block The saved stream-block for resuming. Is overwritten - * by the function. - * \param input The input data stream - * \param output The output data stream - * - * \return 0 if successful - */ -int esp_aes_crypt_ctr( esp_aes_context *ctx, - size_t length, - size_t *nc_off, - unsigned char nonce_counter[16], - unsigned char stream_block[16], - const unsigned char *input, - unsigned char *output ); - -/** - * \brief This function prepares an XTS context for encryption and - * sets the encryption key. - * - * \param ctx The AES XTS context to which the key should be bound. - * \param key The encryption key. This is comprised of the XTS key1 - * concatenated with the XTS key2. - * \param keybits The size of \p key passed in bits. Valid options are: - *
  • 256 bits (each of key1 and key2 is a 128-bit key)
  • - *
  • 512 bits (each of key1 and key2 is a 256-bit key)
- * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_AES_INVALID_KEY_LENGTH on failure. - */ -int esp_aes_xts_setkey_enc( esp_aes_xts_context *ctx, - const unsigned char *key, - unsigned int keybits ); - -/** - * \brief This function prepares an XTS context for decryption and - * sets the decryption key. - * - * \param ctx The AES XTS context to which the key should be bound. - * \param key The decryption key. This is comprised of the XTS key1 - * concatenated with the XTS key2. - * \param keybits The size of \p key passed in bits. Valid options are: - *
  • 256 bits (each of key1 and key2 is a 128-bit key)
  • - *
  • 512 bits (each of key1 and key2 is a 256-bit key)
- * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_AES_INVALID_KEY_LENGTH on failure. - */ -int esp_aes_xts_setkey_dec( esp_aes_xts_context *ctx, - const unsigned char *key, - unsigned int keybits ); - - -/** - * \brief Internal AES block encryption function - * (Only exposed to allow overriding it, - * see AES_ENCRYPT_ALT) - * - * \param ctx AES context - * \param input Plaintext block - * \param output Output (ciphertext) block - */ -int esp_internal_aes_encrypt( esp_aes_context *ctx, const unsigned char input[16], unsigned char output[16] ); - -/** Deprecated, see esp_aes_internal_encrypt */ -void esp_aes_encrypt( esp_aes_context *ctx, const unsigned char input[16], unsigned char output[16] ) __attribute__((deprecated)); - -/** - * \brief Internal AES block decryption function - * (Only exposed to allow overriding it, - * see AES_DECRYPT_ALT) - * - * \param ctx AES context - * \param input Ciphertext block - * \param output Output (plaintext) block - */ -int esp_internal_aes_decrypt( esp_aes_context *ctx, const unsigned char input[16], unsigned char output[16] ); - -/** Deprecated, see esp_aes_internal_decrypt */ -void esp_aes_decrypt( esp_aes_context *ctx, const unsigned char input[16], unsigned char output[16] ) __attribute__((deprecated)); - -#ifdef __cplusplus -} -#endif - -#endif /* aes.h */ diff --git a/tools/sdk/include/esp32/hwcrypto/sha.h b/tools/sdk/include/esp32/hwcrypto/sha.h deleted file mode 100644 index 516de6c1272..00000000000 --- a/tools/sdk/include/esp32/hwcrypto/sha.h +++ /dev/null @@ -1,211 +0,0 @@ -// 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. -#ifndef _ESP_SHA_H_ -#define _ESP_SHA_H_ - -#include "rom/sha.h" -#include "esp_types.h" - -/** @brief Low-level support functions for the hardware SHA engine - * - * @note If you're looking for a SHA API to use, try mbedtls component - * mbedtls/shaXX.h. That API supports hardware acceleration. - * - * The API in this header provides some building blocks for implementing a - * full SHA API such as the one in mbedtls, and also a basic SHA function esp_sha(). - * - * Some technical details about the hardware SHA engine: - * - * - SHA accelerator engine calculates one digest at a time, per SHA - * algorithm type. It initialises and maintains the digest state - * internally. It is possible to read out an in-progress SHA digest - * state, but it is not possible to restore a SHA digest state - * into the engine. - * - * - The memory block SHA_TEXT_BASE is shared between all SHA digest - * engines, so all engines must be idle before this memory block is - * modified. - * - */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Defined in rom/sha.h */ -typedef enum SHA_TYPE esp_sha_type; - -/** @brief Calculate SHA1 or SHA2 sum of some data, using hardware SHA engine - * - * @note For more versatile SHA calculations, where data doesn't need - * to be passed all at once, try the mbedTLS mbedtls/shaX.h APIs. The - * hardware-accelerated mbedTLS implementation is also faster when - * hashing large amounts of data. - * - * @note It is not necessary to lock any SHA hardware before calling - * this function, thread safety is managed internally. - * - * @note If a TLS connection is open then this function may block - * indefinitely waiting for a SHA engine to become available. Use the - * mbedTLS SHA API to avoid this problem. - * - * @param sha_type SHA algorithm to use. - * - * @param input Input data buffer. - * - * @param ilen Length of input data in bytes. - * - * @param output Buffer for output SHA digest. Output is 20 bytes for - * sha_type SHA1, 32 bytes for sha_type SHA2_256, 48 bytes for - * sha_type SHA2_384, 64 bytes for sha_type SHA2_512. - */ -void esp_sha(esp_sha_type sha_type, const unsigned char *input, size_t ilen, unsigned char *output); - -/* @brief Begin to execute a single SHA block operation - * - * @note This is a piece of a SHA algorithm, rather than an entire SHA - * algorithm. - * - * @note Call esp_sha_try_lock_engine() before calling this - * function. Do not call esp_sha_lock_memory_block() beforehand, this - * is done inside the function. - * - * @param sha_type SHA algorithm to use. - * - * @param data_block Pointer to block of data. Block size is - * determined by algorithm (SHA1/SHA2_256 = 64 bytes, - * SHA2_384/SHA2_512 = 128 bytes) - * - * @param is_first_block If this parameter is true, the SHA state will - * be initialised (with the initial state of the given SHA algorithm) - * before the block is calculated. If false, the existing state of the - * SHA engine will be used. - * - * @return As a performance optimisation, this function returns before - * the SHA block operation is complete. Both this function and - * esp_sha_read_state() will automatically wait for any previous - * operation to complete before they begin. If using the SHA registers - * directly in another way, call esp_sha_wait_idle() after calling this - * function but before accessing the SHA registers. - */ -void esp_sha_block(esp_sha_type sha_type, const void *data_block, bool is_first_block); - -/** @brief Read out the current state of the SHA digest loaded in the engine. - * - * @note This is a piece of a SHA algorithm, rather than an entire SHA algorithm. - * - * @note Call esp_sha_try_lock_engine() before calling this - * function. Do not call esp_sha_lock_memory_block() beforehand, this - * is done inside the function. - * - * If the SHA suffix padding block has been executed already, the - * value that is read is the SHA digest (in big endian - * format). Otherwise, the value that is read is an interim SHA state. - * - * @note If sha_type is SHA2_384, only 48 bytes of state will be read. - * This is enough for the final SHA2_384 digest, but if you want the - * interim SHA-384 state (to continue digesting) then pass SHA2_512 instead. - * - * @param sha_type SHA algorithm in use. - * - * @param state Pointer to a memory buffer to hold the SHA state. Size - * is 20 bytes (SHA1), 32 bytes (SHA2_256), 48 bytes (SHA2_384) or 64 bytes (SHA2_512). - * - */ -void esp_sha_read_digest_state(esp_sha_type sha_type, void *digest_state); - -/** - * @brief Obtain exclusive access to a particular SHA engine - * - * @param sha_type Type of SHA engine to use. - * - * Blocks until engine is available. Note: Can block indefinitely - * while a TLS connection is open, suggest using - * esp_sha_try_lock_engine() and failing over to software SHA. - */ -void esp_sha_lock_engine(esp_sha_type sha_type); - -/** - * @brief Try and obtain exclusive access to a particular SHA engine - * - * @param sha_type Type of SHA engine to use. - * - * @return Returns true if the SHA engine is locked for exclusive - * use. Call esp_sha_unlock_sha_engine() when done. Returns false if - * the SHA engine is already in use, caller should use software SHA - * algorithm for this digest. - */ -bool esp_sha_try_lock_engine(esp_sha_type sha_type); - -/** - * @brief Unlock an engine previously locked with esp_sha_lock_engine() or esp_sha_try_lock_engine() - * - * @param sha_type Type of engine to release. - */ -void esp_sha_unlock_engine(esp_sha_type sha_type); - -/** - * @brief Acquire exclusive access to the SHA shared memory block at SHA_TEXT_BASE - * - * This memory block is shared across all the SHA algorithm types. - * - * Caller should have already locked a SHA engine before calling this function. - * - * Note that it is possible to obtain exclusive access to the memory block even - * while it is in use by the SHA engine. Caller should use esp_sha_wait_idle() - * to ensure the SHA engine is not reading from the memory block in hardware. - * - * @note This function enters a critical section. Do not block while holding this lock. - * - * @note You do not need to lock the memory block before calling esp_sha_block() or esp_sha_read_digest_state(), these functions handle memory block locking internally. - * - * Call esp_sha_unlock_memory_block() when done. - */ -void esp_sha_lock_memory_block(void); - -/** - * @brief Release exclusive access to the SHA register memory block at SHA_TEXT_BASE - * - * Caller should have already locked a SHA engine before calling this function. - * - * This function releases the critical section entered by esp_sha_lock_memory_block(). - * - * Call following esp_sha_lock_memory_block(). - */ -void esp_sha_unlock_memory_block(void); - -/** @brief Wait for the SHA engine to finish any current operation - * - * @note This function does not ensure exclusive access to any SHA - * engine. Caller should use esp_sha_try_lock_engine() and - * esp_sha_lock_memory_block() as required. - * - * @note Functions declared in this header file wait for SHA engine - * completion automatically, so you don't need to use this API for - * these. However if accessing SHA registers directly, you will need - * to call this before accessing SHA registers if using the - * esp_sha_block() function. - * - * @note This function busy-waits, so wastes CPU resources. - * Best to delay calling until you are about to need it. - * - */ -void esp_sha_wait_idle(void); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/tools/sdk/include/esp32/rom/aes.h b/tools/sdk/include/esp32/rom/aes.h deleted file mode 100644 index 80eca973fc9..00000000000 --- a/tools/sdk/include/esp32/rom/aes.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - ROM functions for hardware AES support. - - It is not recommended to use these functions directly, - use the wrapper functions in hwcrypto/aes.h instead. - - */ -// 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. - -#ifndef _ROM_AES_H_ -#define _ROM_AES_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -//TODO, add comment for aes apis -enum AES_BITS { - AES128, - AES192, - AES256 -}; - -void ets_aes_enable(void); - -void ets_aes_disable(void); - -void ets_aes_set_endian(bool key_word_swap, bool key_byte_swap, - bool in_word_swap, bool in_byte_swap, - bool out_word_swap, bool out_byte_swap); - -bool ets_aes_setkey_enc(const uint8_t *key, enum AES_BITS bits); - -bool ets_aes_setkey_dec(const uint8_t *key, enum AES_BITS bits); - -void ets_aes_crypt(const uint8_t input[16], uint8_t output[16]); - -#ifdef __cplusplus -} -#endif - -#endif /* _ROM_AES_H_ */ diff --git a/tools/sdk/include/esp32/rom/bigint.h b/tools/sdk/include/esp32/rom/bigint.h deleted file mode 100644 index 97ad72202a3..00000000000 --- a/tools/sdk/include/esp32/rom/bigint.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - ROM functions for hardware bigint support. - - It is not recommended to use these functions directly, - use the wrapper functions in hwcrypto/mpi.h instead. - - */ -// 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. - -#ifndef _ROM_BIGINT_H_ -#define _ROM_BIGINT_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -//TODO: add comment here -void ets_bigint_enable(void); - -void ets_bigint_disable(void); - -void ets_bigint_wait_finish(void); - -bool ets_bigint_mod_power_prepare(uint32_t *x, uint32_t *y, uint32_t *m, - uint32_t m_dash, uint32_t *rb, uint32_t len, bool again); - -bool ets_bigint_mod_power_getz(uint32_t *z, uint32_t len); - -bool ets_bigint_mult_prepare(uint32_t *x, uint32_t *y, uint32_t len); - -bool ets_bigint_mult_getz(uint32_t *z, uint32_t len); - -bool ets_bigint_montgomery_mult_prepare(uint32_t *x, uint32_t *y, uint32_t *m, - uint32_t m_dash, uint32_t len, bool again); - -bool ets_bigint_montgomery_mult_getz(uint32_t *z, uint32_t len); - -bool ets_bigint_mod_mult_prepare(uint32_t *x, uint32_t *y, uint32_t *m, - uint32_t m_dash, uint32_t *rb, uint32_t len, bool again); - -bool ets_bigint_mod_mult_getz(uint32_t *m, uint32_t *z, uint32_t len); - -#ifdef __cplusplus -} -#endif - -#endif /* _ROM_BIGINT_H_ */ diff --git a/tools/sdk/include/esp32/rom/cache.h b/tools/sdk/include/esp32/rom/cache.h deleted file mode 100644 index 4b923e669d7..00000000000 --- a/tools/sdk/include/esp32/rom/cache.h +++ /dev/null @@ -1,186 +0,0 @@ -// 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. - -#ifndef _ROM_CACHE_H_ -#define _ROM_CACHE_H_ - -#include "soc/dport_access.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** \defgroup uart_apis, uart configuration and communication related apis - * @brief uart apis - */ - -/** @addtogroup uart_apis - * @{ - */ - -/** - * @brief Initialise cache mmu, mark all entries as invalid. - * Please do not call this function in your SDK application. - * - * @param int cpu_no : 0 for PRO cpu, 1 for APP cpu. - * - * @return None - */ -void mmu_init(int cpu_no); - -/** - * @brief Set Flash-Cache mmu mapping. - * Please do not call this function in your SDK application. - * - * @param int cpu_no : CPU number, 0 for PRO cpu, 1 for APP cpu. - * - * @param int pod : process identifier. Range 0~7. - * - * @param unsigned int vaddr : virtual address in CPU address space. - * Can be IRam0, IRam1, IRom0 and DRom0 memory address. - * Should be aligned by psize. - * - * @param unsigned int paddr : physical address in Flash. - * Should be aligned by psize. - * - * @param int psize : page size of flash, in kilobytes. Should be 64 here. - * - * @param int num : pages to be set. - * - * @return unsigned int: error status - * 0 : mmu set success - * 1 : vaddr or paddr is not aligned - * 2 : pid error - * 3 : psize error - * 4 : mmu table to be written is out of range - * 5 : vaddr is out of range - */ -static inline unsigned int IRAM_ATTR cache_flash_mmu_set(int cpu_no, int pid, unsigned int vaddr, unsigned int paddr, int psize, int num) -{ - extern unsigned int cache_flash_mmu_set_rom(int cpu_no, int pid, unsigned int vaddr, unsigned int paddr, int psize, int num); - - unsigned int ret; - - DPORT_STALL_OTHER_CPU_START(); - ret = cache_flash_mmu_set_rom(cpu_no, pid, vaddr, paddr, psize, num); - DPORT_STALL_OTHER_CPU_END(); - - return ret; -} - -/** - * @brief Set Ext-SRAM-Cache mmu mapping. - * Please do not call this function in your SDK application. - * - * Note that this code lives in IRAM and has a bugfix in respect to the ROM version - * of this function (which erroneously refused a vaddr > 2MiB - * - * @param int cpu_no : CPU number, 0 for PRO cpu, 1 for APP cpu. - * - * @param int pod : process identifier. Range 0~7. - * - * @param unsigned int vaddr : virtual address in CPU address space. - * Can be IRam0, IRam1, IRom0 and DRom0 memory address. - * Should be aligned by psize. - * - * @param unsigned int paddr : physical address in Ext-SRAM. - * Should be aligned by psize. - * - * @param int psize : page size of flash, in kilobytes. Should be 32 here. - * - * @param int num : pages to be set. - * - * @return unsigned int: error status - * 0 : mmu set success - * 1 : vaddr or paddr is not aligned - * 2 : pid error - * 3 : psize error - * 4 : mmu table to be written is out of range - * 5 : vaddr is out of range - */ -unsigned int IRAM_ATTR cache_sram_mmu_set(int cpu_no, int pid, unsigned int vaddr, unsigned int paddr, int psize, int num); - -/** - * @brief Initialise cache access for the cpu. - * Please do not call this function in your SDK application. - * - * @param int cpu_no : 0 for PRO cpu, 1 for APP cpu. - * - * @return None - */ -static inline void IRAM_ATTR Cache_Read_Init(int cpu_no) -{ - extern void Cache_Read_Init_rom(int cpu_no); - DPORT_STALL_OTHER_CPU_START(); - Cache_Read_Init_rom(cpu_no); - DPORT_STALL_OTHER_CPU_END(); -} - -/** - * @brief Flush the cache value for the cpu. - * Please do not call this function in your SDK application. - * - * @param int cpu_no : 0 for PRO cpu, 1 for APP cpu. - * - * @return None - */ -static inline void IRAM_ATTR Cache_Flush(int cpu_no) -{ - extern void Cache_Flush_rom(int cpu_no); - DPORT_STALL_OTHER_CPU_START(); - Cache_Flush_rom(cpu_no); - DPORT_STALL_OTHER_CPU_END(); -} - -/** - * @brief Disable Cache access for the cpu. - * Please do not call this function in your SDK application. - * - * @param int cpu_no : 0 for PRO cpu, 1 for APP cpu. - * - * @return None - */ -static inline void IRAM_ATTR Cache_Read_Disable(int cpu_no) -{ - extern void Cache_Read_Disable_rom(int cpu_no); - DPORT_STALL_OTHER_CPU_START(); - Cache_Read_Disable_rom(cpu_no); - DPORT_STALL_OTHER_CPU_END(); -} - -/** - * @brief Enable Cache access for the cpu. - * Please do not call this function in your SDK application. - * - * @param int cpu_no : 0 for PRO cpu, 1 for APP cpu. - * - * @return None - */ -static inline void IRAM_ATTR Cache_Read_Enable(int cpu_no) -{ - extern void Cache_Read_Enable_rom(int cpu_no); - DPORT_STALL_OTHER_CPU_START(); - Cache_Read_Enable_rom(cpu_no); - DPORT_STALL_OTHER_CPU_END(); -} - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* _ROM_CACHE_H_ */ diff --git a/tools/sdk/include/esp32/rom/crc.h b/tools/sdk/include/esp32/rom/crc.h deleted file mode 100644 index 84e17882de5..00000000000 --- a/tools/sdk/include/esp32/rom/crc.h +++ /dev/null @@ -1,127 +0,0 @@ -// 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. - -#ifndef ROM_CRC_H -#define ROM_CRC_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** \defgroup uart_apis, uart configuration and communication related apis - * @brief uart apis - */ - -/** @addtogroup uart_apis - * @{ - */ - - -/* Standard CRC8/16/32 algorithms. */ -// CRC-8 x8+x2+x1+1 0x07 -// CRC16-CCITT x16+x12+x5+1 1021 ISO HDLC, ITU X.25, V.34/V.41/V.42, PPP-FCS -// CRC32: -//G(x) = x32 +x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x1 + 1 -//If your buf is not continuous, you can use the first result to be the second parameter. - -/** - * @brief Crc32 value that is in little endian. - * - * @param uint32_t crc : init crc value, use 0 at the first use. - * - * @param uint8_t const *buf : buffer to start calculate crc. - * - * @param uint32_t len : buffer length in byte. - * - * @return None - */ -uint32_t crc32_le(uint32_t crc, uint8_t const *buf, uint32_t len); - -/** - * @brief Crc32 value that is in big endian. - * - * @param uint32_t crc : init crc value, use 0 at the first use. - * - * @param uint8_t const *buf : buffer to start calculate crc. - * - * @param uint32_t len : buffer length in byte. - * - * @return None - */ -uint32_t crc32_be(uint32_t crc, uint8_t const *buf, uint32_t len); - -/** - * @brief Crc16 value that is in little endian. - * - * @param uint16_t crc : init crc value, use 0 at the first use. - * - * @param uint8_t const *buf : buffer to start calculate crc. - * - * @param uint32_t len : buffer length in byte. - * - * @return None - */ -uint16_t crc16_le(uint16_t crc, uint8_t const *buf, uint32_t len); - -/** - * @brief Crc16 value that is in big endian. - * - * @param uint16_t crc : init crc value, use 0 at the first use. - * - * @param uint8_t const *buf : buffer to start calculate crc. - * - * @param uint32_t len : buffer length in byte. - * - * @return None - */ -uint16_t crc16_be(uint16_t crc, uint8_t const *buf, uint32_t len); - -/** - * @brief Crc8 value that is in little endian. - * - * @param uint8_t crc : init crc value, use 0 at the first use. - * - * @param uint8_t const *buf : buffer to start calculate crc. - * - * @param uint32_t len : buffer length in byte. - * - * @return None - */ -uint8_t crc8_le(uint8_t crc, uint8_t const *buf, uint32_t len); - -/** - * @brief Crc8 value that is in big endian. - * - * @param uint32_t crc : init crc value, use 0 at the first use. - * - * @param uint8_t const *buf : buffer to start calculate crc. - * - * @param uint32_t len : buffer length in byte. - * - * @return None - */ -uint8_t crc8_be(uint8_t crc, uint8_t const *buf, uint32_t len); - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - - -#endif diff --git a/tools/sdk/include/esp32/rom/efuse.h b/tools/sdk/include/esp32/rom/efuse.h deleted file mode 100644 index 337227ab0d4..00000000000 --- a/tools/sdk/include/esp32/rom/efuse.h +++ /dev/null @@ -1,117 +0,0 @@ -// 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. - -#ifndef _ROM_EFUSE_H_ -#define _ROM_EFUSE_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** \defgroup efuse_APIs efuse APIs - * @brief ESP32 efuse read/write APIs - * @attention - * - */ - -/** @addtogroup efuse_APIs - * @{ - */ - -/** - * @brief Do a efuse read operation, to update the efuse value to efuse read registers. - * - * @param null - * - * @return null - */ -void ets_efuse_read_op(void); - -/** - * @brief Do a efuse write operation, to update efuse write registers to efuse, then you need call ets_efuse_read_op again. - * - * @param null - * - * @return null - */ -void ets_efuse_program_op(void); - -/** - * @brief Read 8M Analog Clock value(8 bit) in efuse, the analog clock will not change with temperature. - * It can be used to test the external xtal frequency, do not touch this efuse field. - * - * @param null - * - * @return u32: 1 for 100KHZ, range is 0 to 255. - */ -uint32_t ets_efuse_get_8M_clock(void); - -/** - * @brief Read spi flash pin configuration from Efuse - * - * @return - * - 0 for default SPI pins. - * - 1 for default HSPI pins. - * - Other values define a custom pin configuration mask. Pins are encoded as per the EFUSE_SPICONFIG_RET_SPICLK, - * EFUSE_SPICONFIG_RET_SPIQ, EFUSE_SPICONFIG_RET_SPID, EFUSE_SPICONFIG_RET_SPICS0, EFUSE_SPICONFIG_RET_SPIHD macros. - * WP pin (for quad I/O modes) is not saved in efuse and not returned by this function. - */ -uint32_t ets_efuse_get_spiconfig(void); - -#define EFUSE_SPICONFIG_SPI_DEFAULTS 0 -#define EFUSE_SPICONFIG_HSPI_DEFAULTS 1 - -#define EFUSE_SPICONFIG_RET_SPICLK_MASK 0x3f -#define EFUSE_SPICONFIG_RET_SPICLK_SHIFT 0 -#define EFUSE_SPICONFIG_RET_SPICLK(ret) (((ret) >> EFUSE_SPICONFIG_RET_SPICLK_SHIFT) & EFUSE_SPICONFIG_RET_SPICLK_MASK) - -#define EFUSE_SPICONFIG_RET_SPIQ_MASK 0x3f -#define EFUSE_SPICONFIG_RET_SPIQ_SHIFT 6 -#define EFUSE_SPICONFIG_RET_SPIQ(ret) (((ret) >> EFUSE_SPICONFIG_RET_SPIQ_SHIFT) & EFUSE_SPICONFIG_RET_SPIQ_MASK) - -#define EFUSE_SPICONFIG_RET_SPID_MASK 0x3f -#define EFUSE_SPICONFIG_RET_SPID_SHIFT 12 -#define EFUSE_SPICONFIG_RET_SPID(ret) (((ret) >> EFUSE_SPICONFIG_RET_SPID_SHIFT) & EFUSE_SPICONFIG_RET_SPID_MASK) - -#define EFUSE_SPICONFIG_RET_SPICS0_MASK 0x3f -#define EFUSE_SPICONFIG_RET_SPICS0_SHIFT 18 -#define EFUSE_SPICONFIG_RET_SPICS0(ret) (((ret) >> EFUSE_SPICONFIG_RET_SPICS0_SHIFT) & EFUSE_SPICONFIG_RET_SPICS0_MASK) - - -#define EFUSE_SPICONFIG_RET_SPIHD_MASK 0x3f -#define EFUSE_SPICONFIG_RET_SPIHD_SHIFT 24 -#define EFUSE_SPICONFIG_RET_SPIHD(ret) (((ret) >> EFUSE_SPICONFIG_RET_SPIHD_SHIFT) & EFUSE_SPICONFIG_RET_SPIHD_MASK) - -/** - * @brief A crc8 algorithm used in efuse check. - * - * @param unsigned char const *p : Pointer to original data. - * - * @param unsigned int len : Data length in byte. - * - * @return unsigned char: Crc value. - */ -unsigned char esp_crc8(unsigned char const *p, unsigned int len); - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* _ROM_EFUSE_H_ */ diff --git a/tools/sdk/include/esp32/rom/ets_sys.h b/tools/sdk/include/esp32/rom/ets_sys.h deleted file mode 100644 index 6e27b38beb3..00000000000 --- a/tools/sdk/include/esp32/rom/ets_sys.h +++ /dev/null @@ -1,645 +0,0 @@ -// Copyright 2010-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. - -#ifndef _ROM_ETS_SYS_H_ -#define _ROM_ETS_SYS_H_ - -#include -#include - -#include "soc/soc.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** \defgroup ets_sys_apis, ets system related apis - * @brief ets system apis - */ - -/** @addtogroup ets_sys_apis - * @{ - */ - -/************************************************************************ - * NOTE - * Many functions in this header files can't be run in FreeRTOS. - * Please see the comment of the Functions. - * There are also some functions that doesn't work on FreeRTOS - * without listed in the header, such as: - * xtos functions start with "_xtos_" in ld file. - * - *********************************************************************** - */ - -/** \defgroup ets_apis, Espressif Task Scheduler related apis - * @brief ets apis - */ - -/** @addtogroup ets_apis - * @{ - */ - -typedef enum { - ETS_OK = 0, /**< return successful in ets*/ - ETS_FAILED = 1 /**< return failed in ets*/ -} ETS_STATUS; - -typedef uint32_t ETSSignal; -typedef uint32_t ETSParam; - -typedef struct ETSEventTag ETSEvent; /**< Event transmit/receive in ets*/ - -struct ETSEventTag { - ETSSignal sig; /**< Event signal, in same task, different Event with different signal*/ - ETSParam par; /**< Event parameter, sometimes without usage, then will be set as 0*/ -}; - -typedef void (*ETSTask)(ETSEvent *e); /**< Type of the Task processer*/ -typedef void (* ets_idle_cb_t)(void *arg); /**< Type of the system idle callback*/ - -/** - * @brief Start the Espressif Task Scheduler, which is an infinit loop. Please do not add code after it. - * - * @param none - * - * @return none - */ -void ets_run(void); - -/** - * @brief Set the Idle callback, when Tasks are processed, will call the callback before CPU goto sleep. - * - * @param ets_idle_cb_t func : The callback function. - * - * @param void *arg : Argument of the callback. - * - * @return None - */ -void ets_set_idle_cb(ets_idle_cb_t func, void *arg); - -/** - * @brief Init a task with processer, priority, queue to receive Event, queue length. - * - * @param ETSTask task : The task processer. - * - * @param uint8_t prio : Task priority, 0-31, bigger num with high priority, one priority with one task. - * - * @param ETSEvent *queue : Queue belongs to the task, task always receives Events, Queue is circular used. - * - * @param uint8_t qlen : Queue length. - * - * @return None - */ -void ets_task(ETSTask task, uint8_t prio, ETSEvent *queue, uint8_t qlen); - -/** - * @brief Post an event to an Task. - * - * @param uint8_t prio : Priority of the Task. - * - * @param ETSSignal sig : Event signal. - * - * @param ETSParam par : Event parameter - * - * @return ETS_OK : post successful - * @return ETS_FAILED : post failed - */ -ETS_STATUS ets_post(uint8_t prio, ETSSignal sig, ETSParam par); - -/** - * @} - */ - -/** \defgroup ets_boot_apis, Boot routing related apis - * @brief ets boot apis - */ - -/** @addtogroup ets_apis - * @{ - */ - -extern const char *const exc_cause_table[40]; ///**< excption cause that defined by the core.*/ - -/** - * @brief Set Pro cpu Entry code, code can be called in PRO CPU when booting is not completed. - * When Pro CPU booting is completed, Pro CPU will call the Entry code if not NULL. - * - * @param uint32_t start : the PRO Entry code address value in uint32_t - * - * @return None - */ -void ets_set_user_start(uint32_t start); - -/** - * @brief Set Pro cpu Startup code, code can be called when booting is not completed, or in Entry code. - * When Entry code completed, CPU will call the Startup code if not NULL, else call ets_run. - * - * @param uint32_t callback : the Startup code address value in uint32_t - * - * @return None : post successful - */ -void ets_set_startup_callback(uint32_t callback); - -/** - * @brief Set App cpu Entry code, code can be called in PRO CPU. - * When APP booting is completed, APP CPU will call the Entry code if not NULL. - * - * @param uint32_t start : the APP Entry code address value in uint32_t, stored in register APPCPU_CTRL_REG_D. - * - * @return None - */ -void ets_set_appcpu_boot_addr(uint32_t start); - -/** - * @brief unpack the image in flash to iram and dram, no using cache. - * - * @param uint32_t pos : Flash physical address. - * - * @param uint32_t *entry_addr: the pointer of an variable that can store Entry code address. - * - * @param bool jump : Jump into the code in the function or not. - * - * @param bool config : Config the flash when unpacking the image, config should be done only once. - * - * @return ETS_OK : unpack successful - * @return ETS_FAILED : unpack failed - */ -ETS_STATUS ets_unpack_flash_code_legacy(uint32_t pos, uint32_t *entry_addr, bool jump, bool config); - -/** - * @brief unpack the image in flash to iram and dram, using cache, maybe decrypting. - * - * @param uint32_t pos : Flash physical address. - * - * @param uint32_t *entry_addr: the pointer of an variable that can store Entry code address. - * - * @param bool jump : Jump into the code in the function or not. - * - * @param bool sb_need_check : Do security boot check or not. - * - * @param bool config : Config the flash when unpacking the image, config should be done only once. - * - * @return ETS_OK : unpack successful - * @return ETS_FAILED : unpack failed - */ -ETS_STATUS ets_unpack_flash_code(uint32_t pos, uint32_t *entry_addr, bool jump, bool sb_need_check, bool config); - -/** - * @} - */ - -/** \defgroup ets_printf_apis, ets_printf related apis used in ets - * @brief ets printf apis - */ - -/** @addtogroup ets_printf_apis - * @{ - */ - -/** - * @brief Printf the strings to uart or other devices, similar with printf, simple than printf. - * Can not print float point data format, or longlong data format. - * So we maybe only use this in ROM. - * - * @param const char *fmt : See printf. - * - * @param ... : See printf. - * - * @return int : the length printed to the output device. - */ -int ets_printf(const char *fmt, ...); - -/** - * @brief Output a char to uart, which uart to output(which is in uart module in ROM) is not in scope of the function. - * Can not print float point data format, or longlong data format - * - * @param char c : char to output. - * - * @return None - */ -void ets_write_char_uart(char c); - -/** - * @brief Ets_printf have two output functions: putc1 and putc2, both of which will be called if need ouput. - * To install putc1, which is defaulted installed as ets_write_char_uart in none silent boot mode, as NULL in silent mode. - * - * @param void (*)(char) p: Output function to install. - * - * @return None - */ -void ets_install_putc1(void (*p)(char c)); - -/** - * @brief Ets_printf have two output functions: putc1 and putc2, both of which will be called if need ouput. - * To install putc2, which is defaulted installed as NULL. - * - * @param void (*)(char) p: Output function to install. - * - * @return None - */ -void ets_install_putc2(void (*p)(char c)); - -/** - * @brief Install putc1 as ets_write_char_uart. - * In silent boot mode(to void interfere the UART attached MCU), we can call this function, after booting ok. - * - * @param None - * - * @return None - */ -void ets_install_uart_printf(void); - -#define ETS_PRINTF(...) ets_printf(...) - -#define ETS_ASSERT(v) do { \ - if (!(v)) { \ - ets_printf("%s %u \n", __FILE__, __LINE__); \ - while (1) {}; \ - } \ -} while (0); - -/** - * @} - */ - -/** \defgroup ets_timer_apis, ets_timer related apis used in ets - * @brief ets timer apis - */ - -/** @addtogroup ets_timer_apis - * @{ - */ -typedef void ETSTimerFunc(void *timer_arg);/**< timer handler*/ - -typedef struct _ETSTIMER_ { - struct _ETSTIMER_ *timer_next; /**< timer linker*/ - uint32_t timer_expire; /**< abstruct time when timer expire*/ - uint32_t timer_period; /**< timer period, 0 means timer is not periodic repeated*/ - ETSTimerFunc *timer_func; /**< timer handler*/ - void *timer_arg; /**< timer handler argument*/ -} ETSTimer; - -/** - * @brief Init ets timer, this timer range is 640 us to 429496 ms - * In FreeRTOS, please call FreeRTOS apis, never call this api. - * - * @param None - * - * @return None - */ -void ets_timer_init(void); - -/** - * @brief In FreeRTOS, please call FreeRTOS apis, never call this api. - * - * @param None - * - * @return None - */ -void ets_timer_deinit(void); - -/** - * @brief Arm an ets timer, this timer range is 640 us to 429496 ms. - * In FreeRTOS, please call FreeRTOS apis, never call this api. - * - * @param ETSTimer *timer : Timer struct pointer. - * - * @param uint32_t tmout : Timer value in ms, range is 1 to 429496. - * - * @param bool repeat : Timer is periodic repeated. - * - * @return None - */ -void ets_timer_arm(ETSTimer *timer, uint32_t tmout, bool repeat); - -/** - * @brief Arm an ets timer, this timer range is 640 us to 429496 ms. - * In FreeRTOS, please call FreeRTOS apis, never call this api. - * - * @param ETSTimer *timer : Timer struct pointer. - * - * @param uint32_t tmout : Timer value in us, range is 1 to 429496729. - * - * @param bool repeat : Timer is periodic repeated. - * - * @return None - */ -void ets_timer_arm_us(ETSTimer *ptimer, uint32_t us, bool repeat); - -/** - * @brief Disarm an ets timer. - * In FreeRTOS, please call FreeRTOS apis, never call this api. - * - * @param ETSTimer *timer : Timer struct pointer. - * - * @return None - */ -void ets_timer_disarm(ETSTimer *timer); - -/** - * @brief Set timer callback and argument. - * In FreeRTOS, please call FreeRTOS apis, never call this api. - * - * @param ETSTimer *timer : Timer struct pointer. - * - * @param ETSTimerFunc *pfunction : Timer callback. - * - * @param void *parg : Timer callback argument. - * - * @return None - */ -void ets_timer_setfn(ETSTimer *ptimer, ETSTimerFunc *pfunction, void *parg); - -/** - * @brief Unset timer callback and argument to NULL. - * In FreeRTOS, please call FreeRTOS apis, never call this api. - * - * @param ETSTimer *timer : Timer struct pointer. - * - * @return None - */ -void ets_timer_done(ETSTimer *ptimer); - -/** - * @brief CPU do while loop for some time. - * In FreeRTOS task, please call FreeRTOS apis. - * - * @param uint32_t us : Delay time in us. - * - * @return None - */ -void ets_delay_us(uint32_t us); - -/** - * @brief Set the real CPU ticks per us to the ets, so that ets_delay_us will be accurate. - * Call this function when CPU frequency is changed. - * - * @param uint32_t ticks_per_us : CPU ticks per us. - * - * @return None - */ -void ets_update_cpu_frequency(uint32_t ticks_per_us); - -/** - * @brief Set the real CPU ticks per us to the ets, so that ets_delay_us will be accurate. - * - * @note This function only sets the tick rate for the current CPU. It is located in ROM, - * so the deep sleep stub can use it even if IRAM is not initialized yet. - * - * @param uint32_t ticks_per_us : CPU ticks per us. - * - * @return None - */ -void ets_update_cpu_frequency_rom(uint32_t ticks_per_us); - -/** - * @brief Get the real CPU ticks per us to the ets. - * This function do not return real CPU ticks per us, just the record in ets. It can be used to check with the real CPU frequency. - * - * @param None - * - * @return uint32_t : CPU ticks per us record in ets. - */ -uint32_t ets_get_cpu_frequency(void); - -/** - * @brief Get xtal_freq/analog_8M*256 value calibrated in rtc module. - * - * @param None - * - * @return uint32_t : xtal_freq/analog_8M*256. - */ -uint32_t ets_get_xtal_scale(void); - -/** - * @brief Get xtal_freq value, If value not stored in RTC_STORE5, than store. - * - * @param None - * - * @return uint32_t : if rtc store the value (RTC_STORE5 high 16 bits and low 16 bits with same value), read from rtc register. - * clock = (REG_READ(RTC_STORE5) & 0xffff) << 12; - * else if analog_8M in efuse - * clock = ets_get_xtal_scale() * 15625 * ets_efuse_get_8M_clock() / 40; - * else clock = 26M. - */ -uint32_t ets_get_detected_xtal_freq(void); - -/** - * @} - */ - -/** \defgroup ets_intr_apis, ets interrupt configure related apis - * @brief ets intr apis - */ - -/** @addtogroup ets_intr_apis - * @{ - */ - -typedef void (* ets_isr_t)(void *);/**< interrupt handler type*/ - -/** - * @brief Attach a interrupt handler to a CPU interrupt number. - * This function equals to _xtos_set_interrupt_handler_arg(i, func, arg). - * In FreeRTOS, please call FreeRTOS apis, never call this api. - * - * @param int i : CPU interrupt number. - * - * @param ets_isr_t func : Interrupt handler. - * - * @param void *arg : argument of the handler. - * - * @return None - */ -void ets_isr_attach(int i, ets_isr_t func, void *arg); - -/** - * @brief Mask the interrupts which show in mask bits. - * This function equals to _xtos_ints_off(mask). - * In FreeRTOS, please call FreeRTOS apis, never call this api. - * - * @param uint32_t mask : BIT(i) means mask CPU interrupt number i. - * - * @return None - */ -void ets_isr_mask(uint32_t mask); - -/** - * @brief Unmask the interrupts which show in mask bits. - * This function equals to _xtos_ints_on(mask). - * In FreeRTOS, please call FreeRTOS apis, never call this api. - * - * @param uint32_t mask : BIT(i) means mask CPU interrupt number i. - * - * @return None - */ -void ets_isr_unmask(uint32_t unmask); - -/** - * @brief Lock the interrupt to level 2. - * This function direct set the CPU registers. - * In FreeRTOS, please call FreeRTOS apis, never call this api. - * - * @param None - * - * @return None - */ -void ets_intr_lock(void); - -/** - * @brief Unlock the interrupt to level 0. - * This function direct set the CPU registers. - * In FreeRTOS, please call FreeRTOS apis, never call this api. - * - * @param None - * - * @return None - */ -void ets_intr_unlock(void); - -/** - * @brief Unlock the interrupt to level 0, and CPU will go into power save mode(wait interrupt). - * This function direct set the CPU registers. - * In FreeRTOS, please call FreeRTOS apis, never call this api. - * - * @param None - * - * @return None - */ -void ets_waiti0(void); - -/** - * @brief Attach an CPU interrupt to a hardware source. - * We have 4 steps to use an interrupt: - * 1.Attach hardware interrupt source to CPU. intr_matrix_set(0, ETS_WIFI_MAC_INTR_SOURCE, ETS_WMAC_INUM); - * 2.Set interrupt handler. xt_set_interrupt_handler(ETS_WMAC_INUM, func, NULL); - * 3.Enable interrupt for CPU. xt_ints_on(1 << ETS_WMAC_INUM); - * 4.Enable interrupt in the module. - * - * @param int cpu_no : The CPU which the interrupt number belongs. - * - * @param uint32_t model_num : The interrupt hardware source number, please see the interrupt hardware source table. - * - * @param uint32_t intr_num : The interrupt number CPU, please see the interrupt cpu using table. - * - * @return None - */ -void intr_matrix_set(int cpu_no, uint32_t model_num, uint32_t intr_num); - -#define _ETSTR(v) # v -#define _ETS_SET_INTLEVEL(intlevel) ({ unsigned __tmp; \ - __asm__ __volatile__( "rsil %0, " _ETSTR(intlevel) "\n" \ - : "=a" (__tmp) : : "memory" ); \ - }) - -#ifdef CONFIG_NONE_OS -#define ETS_INTR_LOCK() \ - ets_intr_lock() - -#define ETS_INTR_UNLOCK() \ - ets_intr_unlock() - -#define ETS_ISR_ATTACH \ - ets_isr_attach - -#define ETS_INTR_ENABLE(inum) \ - ets_isr_unmask((1< -#include - -#include "esp_attr.h" -#include "soc/gpio_reg.h" -#include "soc/gpio_pins.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** \defgroup gpio_apis, uart configuration and communication related apis - * @brief gpio apis - */ - -/** @addtogroup gpio_apis - * @{ - */ - -#define GPIO_REG_READ(reg) READ_PERI_REG(reg) -#define GPIO_REG_WRITE(reg, val) WRITE_PERI_REG(reg, val) -#define GPIO_ID_PIN0 0 -#define GPIO_ID_PIN(n) (GPIO_ID_PIN0+(n)) -#define GPIO_PIN_ADDR(i) (GPIO_PIN0_REG + i*4) - -#define GPIO_FUNC_IN_HIGH 0x38 -#define GPIO_FUNC_IN_LOW 0x30 - -#define GPIO_ID_IS_PIN_REGISTER(reg_id) \ - ((reg_id >= GPIO_ID_PIN0) && (reg_id <= GPIO_ID_PIN(GPIO_PIN_COUNT-1))) - -#define GPIO_REGID_TO_PINIDX(reg_id) ((reg_id) - GPIO_ID_PIN0) - -typedef enum { - GPIO_PIN_INTR_DISABLE = 0, - GPIO_PIN_INTR_POSEDGE = 1, - GPIO_PIN_INTR_NEGEDGE = 2, - GPIO_PIN_INTR_ANYEDGE = 3, - GPIO_PIN_INTR_LOLEVEL = 4, - GPIO_PIN_INTR_HILEVEL = 5 -} GPIO_INT_TYPE; - -#define GPIO_OUTPUT_SET(gpio_no, bit_value) \ - ((gpio_no < 32) ? gpio_output_set(bit_value<>gpio_no)&BIT0) : ((gpio_input_get_high()>>(gpio_no - 32))&BIT0)) - -/* GPIO interrupt handler, registered through gpio_intr_handler_register */ -typedef void (* gpio_intr_handler_fn_t)(uint32_t intr_mask, bool high, void *arg); - -/** - * @brief Initialize GPIO. This includes reading the GPIO Configuration DataSet - * to initialize "output enables" and pin configurations for each gpio pin. - * Please do not call this function in SDK. - * - * @param None - * - * @return None - */ -void gpio_init(void); - -/** - * @brief Change GPIO(0-31) pin output by setting, clearing, or disabling pins, GPIO0<->BIT(0). - * There is no particular ordering guaranteed; so if the order of writes is significant, - * calling code should divide a single call into multiple calls. - * - * @param uint32_t set_mask : the gpios that need high level. - * - * @param uint32_t clear_mask : the gpios that need low level. - * - * @param uint32_t enable_mask : the gpios that need be changed. - * - * @param uint32_t disable_mask : the gpios that need diable output. - * - * @return None - */ -void gpio_output_set(uint32_t set_mask, uint32_t clear_mask, uint32_t enable_mask, uint32_t disable_mask); - -/** - * @brief Change GPIO(32-39) pin output by setting, clearing, or disabling pins, GPIO32<->BIT(0). - * There is no particular ordering guaranteed; so if the order of writes is significant, - * calling code should divide a single call into multiple calls. - * - * @param uint32_t set_mask : the gpios that need high level. - * - * @param uint32_t clear_mask : the gpios that need low level. - * - * @param uint32_t enable_mask : the gpios that need be changed. - * - * @param uint32_t disable_mask : the gpios that need diable output. - * - * @return None - */ -void gpio_output_set_high(uint32_t set_mask, uint32_t clear_mask, uint32_t enable_mask, uint32_t disable_mask); - -/** - * @brief Sample the value of GPIO input pins(0-31) and returns a bitmask. - * - * @param None - * - * @return uint32_t : bitmask for GPIO input pins, BIT(0) for GPIO0. - */ -uint32_t gpio_input_get(void); - -/** - * @brief Sample the value of GPIO input pins(32-39) and returns a bitmask. - * - * @param None - * - * @return uint32_t : bitmask for GPIO input pins, BIT(0) for GPIO32. - */ -uint32_t gpio_input_get_high(void); - -/** - * @brief Register an application-specific interrupt handler for GPIO pin interrupts. - * Once the interrupt handler is called, it will not be called again until after a call to gpio_intr_ack. - * Please do not call this function in SDK. - * - * @param gpio_intr_handler_fn_t fn : gpio application-specific interrupt handler - * - * @param void *arg : gpio application-specific interrupt handler argument. - * - * @return None - */ -void gpio_intr_handler_register(gpio_intr_handler_fn_t fn, void *arg); - -/** - * @brief Get gpio interrupts which happens but not processed. - * Please do not call this function in SDK. - * - * @param None - * - * @return uint32_t : bitmask for GPIO pending interrupts, BIT(0) for GPIO0. - */ -uint32_t gpio_intr_pending(void); - -/** - * @brief Get gpio interrupts which happens but not processed. - * Please do not call this function in SDK. - * - * @param None - * - * @return uint32_t : bitmask for GPIO pending interrupts, BIT(0) for GPIO32. - */ -uint32_t gpio_intr_pending_high(void); - -/** - * @brief Ack gpio interrupts to process pending interrupts. - * Please do not call this function in SDK. - * - * @param uint32_t ack_mask: bitmask for GPIO ack interrupts, BIT(0) for GPIO0. - * - * @return None - */ -void gpio_intr_ack(uint32_t ack_mask); - -/** - * @brief Ack gpio interrupts to process pending interrupts. - * Please do not call this function in SDK. - * - * @param uint32_t ack_mask: bitmask for GPIO ack interrupts, BIT(0) for GPIO32. - * - * @return None - */ -void gpio_intr_ack_high(uint32_t ack_mask); - -/** - * @brief Set GPIO to wakeup the ESP32. - * Please do not call this function in SDK. - * - * @param uint32_t i: gpio number. - * - * @param GPIO_INT_TYPE intr_state : only GPIO_PIN_INTR_LOLEVEL\GPIO_PIN_INTR_HILEVEL can be used - * - * @return None - */ -void gpio_pin_wakeup_enable(uint32_t i, GPIO_INT_TYPE intr_state); - -/** - * @brief disable GPIOs to wakeup the ESP32. - * Please do not call this function in SDK. - * - * @param None - * - * @return None - */ -void gpio_pin_wakeup_disable(void); - -/** - * @brief set gpio input to a signal, one gpio can input to several signals. - * - * @param uint32_t gpio : gpio number, 0~0x27 - * gpio == 0x30, input 0 to signal - * gpio == 0x34, ??? - * gpio == 0x38, input 1 to signal - * - * @param uint32_t signal_idx : signal index. - * - * @param bool inv : the signal is inv or not - * - * @return None - */ -void gpio_matrix_in(uint32_t gpio, uint32_t signal_idx, bool inv); - -/** - * @brief set signal output to gpio, one signal can output to several gpios. - * - * @param uint32_t gpio : gpio number, 0~0x27 - * - * @param uint32_t signal_idx : signal index. - * signal_idx == 0x100, cancel output put to the gpio - * - * @param bool out_inv : the signal output is inv or not - * - * @param bool oen_inv : the signal output enable is inv or not - * - * @return None - */ -void gpio_matrix_out(uint32_t gpio, uint32_t signal_idx, bool out_inv, bool oen_inv); - -/** - * @brief Select pad as a gpio function from IOMUX. - * - * @param uint32_t gpio_num : gpio number, 0~0x27 - * - * @return None - */ -void gpio_pad_select_gpio(uint8_t gpio_num); - -/** - * @brief Set pad driver capability. - * - * @param uint32_t gpio_num : gpio number, 0~0x27 - * - * @param uint8_t drv : 0-3 - * - * @return None - */ -void gpio_pad_set_drv(uint8_t gpio_num, uint8_t drv); - -/** - * @brief Pull up the pad from gpio number. - * - * @param uint32_t gpio_num : gpio number, 0~0x27 - * - * @return None - */ -void gpio_pad_pullup(uint8_t gpio_num); - -/** - * @brief Pull down the pad from gpio number. - * - * @param uint32_t gpio_num : gpio number, 0~0x27 - * - * @return None - */ -void gpio_pad_pulldown(uint8_t gpio_num); - -/** - * @brief Unhold the pad from gpio number. - * - * @param uint32_t gpio_num : gpio number, 0~0x27 - * - * @return None - */ -void gpio_pad_unhold(uint8_t gpio_num); - -/** - * @brief Hold the pad from gpio number. - * - * @param uint32_t gpio_num : gpio number, 0~0x27 - * - * @return None - */ -void gpio_pad_hold(uint8_t gpio_num); - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* _ROM_GPIO_H_ */ diff --git a/tools/sdk/include/esp32/rom/libc_stubs.h b/tools/sdk/include/esp32/rom/libc_stubs.h deleted file mode 100644 index 90c0b446886..00000000000 --- a/tools/sdk/include/esp32/rom/libc_stubs.h +++ /dev/null @@ -1,89 +0,0 @@ -// 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. -#ifndef _ROM_LIBC_STUBS_H_ -#define _ROM_LIBC_STUBS_H_ - -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* -ESP32 ROM code contains implementations of some of C library functions. -Whenever a function in ROM needs to use a syscall, it calls a pointer to the corresponding syscall -implementation defined in the following struct. - -The table itself, by default, is not allocated in RAM. There are two pointers, `syscall_table_ptr_pro` and -`syscall_table_ptr_app`, which can be set to point to the locations of syscall tables of CPU 0 (aka PRO CPU) -and CPU 1 (aka APP CPU). Location of these pointers in .bss segment of ROM code is defined in linker script. - -So, before using any of the C library functions (except for pure functions and memcpy/memset functions), -application must allocate syscall table structure for each CPU being used, and populate it with pointers -to actual implementations of corresponding syscalls. -*/ - -struct syscall_stub_table -{ - struct _reent* (*__getreent)(void); - void* (*_malloc_r)(struct _reent *r, size_t); - void (*_free_r)(struct _reent *r, void*); - void* (*_realloc_r)(struct _reent *r, void*, size_t); - void* (*_calloc_r)(struct _reent *r, size_t, size_t); - void (*_abort)(void); - int (*_system_r)(struct _reent *r, const char*); - int (*_rename_r)(struct _reent *r, const char*, const char*); - clock_t (*_times_r)(struct _reent *r, struct tms *); - int (*_gettimeofday_r) (struct _reent *r, struct timeval *, void *); - void (*_raise_r)(struct _reent *r); /* function signature is incorrect in ROM */ - int (*_unlink_r)(struct _reent *r, const char*); - int (*_link_r)(struct _reent *r, const char*, const char*); - int (*_stat_r)(struct _reent *r, const char*, struct stat *); - int (*_fstat_r)(struct _reent *r, int, struct stat *); - void* (*_sbrk_r)(struct _reent *r, ptrdiff_t); - int (*_getpid_r)(struct _reent *r); - int (*_kill_r)(struct _reent *r, int, int); - void (*_exit_r)(struct _reent *r, int); - int (*_close_r)(struct _reent *r, int); - int (*_open_r)(struct _reent *r, const char *, int, int); - int (*_write_r)(struct _reent *r, int, const void *, int); - int (*_lseek_r)(struct _reent *r, int, int, int); - int (*_read_r)(struct _reent *r, int, void *, int); - void (*_lock_init)(_lock_t *lock); - void (*_lock_init_recursive)(_lock_t *lock); - void (*_lock_close)(_lock_t *lock); - void (*_lock_close_recursive)(_lock_t *lock); - void (*_lock_acquire)(_lock_t *lock); - void (*_lock_acquire_recursive)(_lock_t *lock); - int (*_lock_try_acquire)(_lock_t *lock); - int (*_lock_try_acquire_recursive)(_lock_t *lock); - void (*_lock_release)(_lock_t *lock); - void (*_lock_release_recursive)(_lock_t *lock); - int (*_printf_float)(struct _reent *data, void *pdata, FILE * fp, int (*pfunc) (struct _reent *, FILE *, _CONST char *, size_t len), va_list * ap); - int (*_scanf_float) (struct _reent *rptr, void *pdata, FILE *fp, va_list *ap); -}; - -extern struct syscall_stub_table* syscall_table_ptr_pro; -extern struct syscall_stub_table* syscall_table_ptr_app; - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif /* _ROM_LIBC_STUBS_H_ */ diff --git a/tools/sdk/include/esp32/rom/lldesc.h b/tools/sdk/include/esp32/rom/lldesc.h deleted file mode 100644 index d027362a51f..00000000000 --- a/tools/sdk/include/esp32/rom/lldesc.h +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright 2010-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. - -#ifndef _ROM_LLDESC_H_ -#define _ROM_LLDESC_H_ - -#include - -#include "queue.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define LLDESC_TX_MBLK_SIZE 268 /* */ -#define LLDESC_RX_SMBLK_SIZE 64 /* small block size, for small mgmt frame */ -#define LLDESC_RX_MBLK_SIZE 524 /* rx is large sinec we want to contain mgmt frame in one block*/ -#define LLDESC_RX_AMPDU_ENTRY_MBLK_SIZE 64 /* it is a small buffer which is a cycle link*/ -#define LLDESC_RX_AMPDU_LEN_MBLK_SIZE 256 /*for ampdu entry*/ -#ifdef ESP_MAC_5 -#define LLDESC_TX_MBLK_NUM 116 /* 64K / 256 */ -#define LLDESC_RX_MBLK_NUM 82 /* 64K / 512 MAX 172*/ -#define LLDESC_RX_AMPDU_ENTRY_MBLK_NUM 4 -#define LLDESC_RX_AMPDU_LEN_MLBK_NUM 12 -#else -#ifdef SBUF_RXTX -#define LLDESC_TX_MBLK_NUM_MAX (2 * 48) /* 23K / 260 - 8 */ -#define LLDESC_RX_MBLK_NUM_MAX (2 * 48) /* 23K / 524 */ -#define LLDESC_TX_MBLK_NUM_MIN (2 * 16) /* 23K / 260 - 8 */ -#define LLDESC_RX_MBLK_NUM_MIN (2 * 16) /* 23K / 524 */ -#endif -#define LLDESC_TX_MBLK_NUM 10 //(2 * 32) /* 23K / 260 - 8 */ - -#ifdef IEEE80211_RX_AMPDU -#define LLDESC_RX_MBLK_NUM 30 -#else -#define LLDESC_RX_MBLK_NUM 10 -#endif /*IEEE80211_RX_AMPDU*/ - -#define LLDESC_RX_AMPDU_ENTRY_MBLK_NUM 4 -#define LLDESC_RX_AMPDU_LEN_MLBK_NUM 8 -#endif /* !ESP_MAC_5 */ -/* - * SLC2 DMA Desc struct, aka lldesc_t - * - * -------------------------------------------------------------- - * | own | EoF | sub_sof | 5'b0 | length [11:0] | size [11:0] | - * -------------------------------------------------------------- - * | buf_ptr [31:0] | - * -------------------------------------------------------------- - * | next_desc_ptr [31:0] | - * -------------------------------------------------------------- - */ - -/* this bitfield is start from the LSB!!! */ -typedef struct lldesc_s { - volatile uint32_t size :12, - length:12, - offset: 5, /* h/w reserved 5bit, s/w use it as offset in buffer */ - sosf : 1, /* start of sub-frame */ - eof : 1, /* end of frame */ - owner : 1; /* hw or sw */ - volatile uint8_t *buf; /* point to buffer data */ - union{ - volatile uint32_t empty; - STAILQ_ENTRY(lldesc_s) qe; /* pointing to the next desc */ - }; -} lldesc_t; - -typedef struct tx_ampdu_entry_s{ - uint32_t sub_len :12, - dili_num : 7, - : 1, - null_byte: 2, - data : 1, - enc : 1, - seq : 8; -} tx_ampdu_entry_t; - -typedef struct lldesc_chain_s { - lldesc_t *head; - lldesc_t *tail; -} lldesc_chain_t; - -#ifdef SBUF_RXTX -enum sbuf_mask_s { - SBUF_MOVE_NO = 0, - SBUF_MOVE_TX2RX, - SBUF_MOVE_RX2TX, -} ; - -#define SBUF_MOVE_STEP 8 -#endif -#define LLDESC_SIZE sizeof(struct lldesc_s) - -/* SLC Descriptor */ -#define LLDESC_OWNER_MASK 0x80000000 -#define LLDESC_OWNER_SHIFT 31 -#define LLDESC_SW_OWNED 0 -#define LLDESC_HW_OWNED 1 - -#define LLDESC_EOF_MASK 0x40000000 -#define LLDESC_EOF_SHIFT 30 - -#define LLDESC_SOSF_MASK 0x20000000 -#define LLDESC_SOSF_SHIFT 29 - -#define LLDESC_LENGTH_MASK 0x00fff000 -#define LLDESC_LENGTH_SHIFT 12 - -#define LLDESC_SIZE_MASK 0x00000fff -#define LLDESC_SIZE_SHIFT 0 - -#define LLDESC_ADDR_MASK 0x000fffff - -void lldesc_build_chain(uint8_t *descptr, uint32_t desclen, uint8_t * mblkptr, uint32_t buflen, uint32_t blksz, uint8_t owner, - lldesc_t **head, -#ifdef TO_HOST_RESTART - lldesc_t ** one_before_tail, -#endif - lldesc_t **tail); - -lldesc_t *lldesc_num2link(lldesc_t * head, uint16_t nblks); - -lldesc_t *lldesc_set_owner(lldesc_t * head, uint16_t nblks, uint8_t owner); - -static inline uint32_t lldesc_get_chain_length(lldesc_t *head) -{ - lldesc_t *ds = head; - uint32_t len = 0; - - while (ds) { - len += ds->length; - ds = STAILQ_NEXT(ds, qe); - } - - return len; -} - -static inline void lldesc_config(lldesc_t *ds, uint8_t owner, uint8_t eof, uint8_t sosf, uint16_t len) -{ - ds->owner = owner; - ds->eof = eof; - ds->sosf = sosf; - ds->length = len; -} - -#define LLDESC_CONFIG(_desc, _owner, _eof, _sosf, _len) do { \ - (_desc)->owner = (_owner); \ - (_desc)->eof = (_eof); \ - (_desc)->sosf = (_sosf); \ - (_desc)->length = (_len); \ -} while(0) - -#define LLDESC_FROM_HOST_CLEANUP(ds) LLDESC_CONFIG((ds), LLDESC_HW_OWNED, 0, 0, 0) - -#define LLDESC_MAC_RX_CLEANUP(ds) LLDESC_CONFIG((ds), LLDESC_HW_OWNED, 0, 0, (ds)->size) - -#define LLDESC_TO_HOST_CLEANUP(ds) LLDESC_CONFIG((ds), LLDESC_HW_OWNED, 0, 0, 0) - -#ifdef __cplusplus -} -#endif - -#endif /* _ROM_LLDESC_H_ */ diff --git a/tools/sdk/include/esp32/rom/md5_hash.h b/tools/sdk/include/esp32/rom/md5_hash.h deleted file mode 100644 index f116f1e670f..00000000000 --- a/tools/sdk/include/esp32/rom/md5_hash.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * MD5 internal definitions - * Copyright (c) 2003-2005, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef _ROM_MD5_HASH_H_ -#define _ROM_MD5_HASH_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct MD5Context { - uint32_t buf[4]; - uint32_t bits[2]; - uint8_t in[64]; -}; - -void MD5Init(struct MD5Context *context); -void MD5Update(struct MD5Context *context, unsigned char const *buf, unsigned len); -void MD5Final(unsigned char digest[16], struct MD5Context *context); - -#ifdef __cplusplus -} -#endif - -#endif /* _ROM_MD5_HASH_H_ */ diff --git a/tools/sdk/include/esp32/rom/miniz.h b/tools/sdk/include/esp32/rom/miniz.h deleted file mode 100644 index ed79beb2cbd..00000000000 --- a/tools/sdk/include/esp32/rom/miniz.h +++ /dev/null @@ -1,777 +0,0 @@ -#ifndef MINIZ_HEADER_INCLUDED -#define MINIZ_HEADER_INCLUDED - -#include - -// Defines to completely disable specific portions of miniz.c: -// If all macros here are defined the only functionality remaining will be CRC-32, adler-32, tinfl, and tdefl. - -// Define MINIZ_NO_STDIO to disable all usage and any functions which rely on stdio for file I/O. -#define MINIZ_NO_STDIO - -// If MINIZ_NO_TIME is specified then the ZIP archive functions will not be able to get the current time, or -// get/set file times, and the C run-time funcs that get/set times won't be called. -// The current downside is the times written to your archives will be from 1979. -#define MINIZ_NO_TIME - -// Define MINIZ_NO_ARCHIVE_APIS to disable all ZIP archive API's. -#define MINIZ_NO_ARCHIVE_APIS - -// Define MINIZ_NO_ARCHIVE_APIS to disable all writing related ZIP archive API's. -#define MINIZ_NO_ARCHIVE_WRITING_APIS - -// Define MINIZ_NO_ZLIB_APIS to remove all ZLIB-style compression/decompression API's. -#define MINIZ_NO_ZLIB_APIS - -// Define MINIZ_NO_ZLIB_COMPATIBLE_NAME to disable zlib names, to prevent conflicts against stock zlib. -#define MINIZ_NO_ZLIB_COMPATIBLE_NAMES - -// Define MINIZ_NO_MALLOC to disable all calls to malloc, free, and realloc. -// Note if MINIZ_NO_MALLOC is defined then the user must always provide custom user alloc/free/realloc -// callbacks to the zlib and archive API's, and a few stand-alone helper API's which don't provide custom user -// functions (such as tdefl_compress_mem_to_heap() and tinfl_decompress_mem_to_heap()) won't work. -#define MINIZ_NO_MALLOC - -#if defined(__TINYC__) && (defined(__linux) || defined(__linux__)) - // TODO: Work around "error: include file 'sys\utime.h' when compiling with tcc on Linux - #define MINIZ_NO_TIME -#endif - -#if !defined(MINIZ_NO_TIME) && !defined(MINIZ_NO_ARCHIVE_APIS) - #include -#endif - -//Hardcoded options for Xtensa - JD -#define MINIZ_X86_OR_X64_CPU 0 -#define MINIZ_LITTLE_ENDIAN 1 -#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 0 -#define MINIZ_HAS_64BIT_REGISTERS 0 -#define TINFL_USE_64BIT_BITBUF 0 - - -#if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__i386) || defined(__i486__) || defined(__i486) || defined(i386) || defined(__ia64__) || defined(__x86_64__) -// MINIZ_X86_OR_X64_CPU is only used to help set the below macros. -#define MINIZ_X86_OR_X64_CPU 1 -#endif - -#if (__BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__) || MINIZ_X86_OR_X64_CPU -// Set MINIZ_LITTLE_ENDIAN to 1 if the processor is little endian. -#define MINIZ_LITTLE_ENDIAN 1 -#endif - -#if MINIZ_X86_OR_X64_CPU -// Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES to 1 on CPU's that permit efficient integer loads and stores from unaligned addresses. -#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1 -#endif - -#if defined(_M_X64) || defined(_WIN64) || defined(__MINGW64__) || defined(_LP64) || defined(__LP64__) || defined(__ia64__) || defined(__x86_64__) -// Set MINIZ_HAS_64BIT_REGISTERS to 1 if operations on 64-bit integers are reasonably fast (and don't involve compiler generated calls to helper functions). -#define MINIZ_HAS_64BIT_REGISTERS 1 -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -// ------------------- zlib-style API Definitions. - -// For more compatibility with zlib, miniz.c uses unsigned long for some parameters/struct members. Beware: mz_ulong can be either 32 or 64-bits! -typedef unsigned long mz_ulong; - -// mz_free() internally uses the MZ_FREE() macro (which by default calls free() unless you've modified the MZ_MALLOC macro) to release a block allocated from the heap. -void mz_free(void *p); - -#define MZ_ADLER32_INIT (1) -// mz_adler32() returns the initial adler-32 value to use when called with ptr==NULL. -mz_ulong mz_adler32(mz_ulong adler, const unsigned char *ptr, size_t buf_len); - -#define MZ_CRC32_INIT (0) -// mz_crc32() returns the initial CRC-32 value to use when called with ptr==NULL. -mz_ulong mz_crc32(mz_ulong crc, const unsigned char *ptr, size_t buf_len); - -// Compression strategies. -enum { MZ_DEFAULT_STRATEGY = 0, MZ_FILTERED = 1, MZ_HUFFMAN_ONLY = 2, MZ_RLE = 3, MZ_FIXED = 4 }; - -// Method -#define MZ_DEFLATED 8 - -#ifndef MINIZ_NO_ZLIB_APIS - -// Heap allocation callbacks. -// Note that mz_alloc_func parameter types purpsosely differ from zlib's: items/size is size_t, not unsigned long. -typedef void *(*mz_alloc_func)(void *opaque, size_t items, size_t size); -typedef void (*mz_free_func)(void *opaque, void *address); -typedef void *(*mz_realloc_func)(void *opaque, void *address, size_t items, size_t size); - -#define MZ_VERSION "9.1.15" -#define MZ_VERNUM 0x91F0 -#define MZ_VER_MAJOR 9 -#define MZ_VER_MINOR 1 -#define MZ_VER_REVISION 15 -#define MZ_VER_SUBREVISION 0 - -// Flush values. For typical usage you only need MZ_NO_FLUSH and MZ_FINISH. The other values are for advanced use (refer to the zlib docs). -enum { MZ_NO_FLUSH = 0, MZ_PARTIAL_FLUSH = 1, MZ_SYNC_FLUSH = 2, MZ_FULL_FLUSH = 3, MZ_FINISH = 4, MZ_BLOCK = 5 }; - -// Return status codes. MZ_PARAM_ERROR is non-standard. -enum { MZ_OK = 0, MZ_STREAM_END = 1, MZ_NEED_DICT = 2, MZ_ERRNO = -1, MZ_STREAM_ERROR = -2, MZ_DATA_ERROR = -3, MZ_MEM_ERROR = -4, MZ_BUF_ERROR = -5, MZ_VERSION_ERROR = -6, MZ_PARAM_ERROR = -10000 }; - -// Compression levels: 0-9 are the standard zlib-style levels, 10 is best possible compression (not zlib compatible, and may be very slow), MZ_DEFAULT_COMPRESSION=MZ_DEFAULT_LEVEL. -enum { MZ_NO_COMPRESSION = 0, MZ_BEST_SPEED = 1, MZ_BEST_COMPRESSION = 9, MZ_UBER_COMPRESSION = 10, MZ_DEFAULT_LEVEL = 6, MZ_DEFAULT_COMPRESSION = -1 }; - -// Window bits -#define MZ_DEFAULT_WINDOW_BITS 15 - -struct mz_internal_state; - -// Compression/decompression stream struct. -typedef struct mz_stream_s -{ - const unsigned char *next_in; // pointer to next byte to read - unsigned int avail_in; // number of bytes available at next_in - mz_ulong total_in; // total number of bytes consumed so far - - unsigned char *next_out; // pointer to next byte to write - unsigned int avail_out; // number of bytes that can be written to next_out - mz_ulong total_out; // total number of bytes produced so far - - char *msg; // error msg (unused) - struct mz_internal_state *state; // internal state, allocated by zalloc/zfree - - mz_alloc_func zalloc; // optional heap allocation function (defaults to malloc) - mz_free_func zfree; // optional heap free function (defaults to free) - void *opaque; // heap alloc function user pointer - - int data_type; // data_type (unused) - mz_ulong adler; // adler32 of the source or uncompressed data - mz_ulong reserved; // not used -} mz_stream; - -typedef mz_stream *mz_streamp; - -// Returns the version string of miniz.c. -const char *mz_version(void); - -// mz_deflateInit() initializes a compressor with default options: -// Parameters: -// pStream must point to an initialized mz_stream struct. -// level must be between [MZ_NO_COMPRESSION, MZ_BEST_COMPRESSION]. -// level 1 enables a specially optimized compression function that's been optimized purely for performance, not ratio. -// (This special func. is currently only enabled when MINIZ_USE_UNALIGNED_LOADS_AND_STORES and MINIZ_LITTLE_ENDIAN are defined.) -// Return values: -// MZ_OK on success. -// MZ_STREAM_ERROR if the stream is bogus. -// MZ_PARAM_ERROR if the input parameters are bogus. -// MZ_MEM_ERROR on out of memory. -int mz_deflateInit(mz_streamp pStream, int level); - -// mz_deflateInit2() is like mz_deflate(), except with more control: -// Additional parameters: -// method must be MZ_DEFLATED -// window_bits must be MZ_DEFAULT_WINDOW_BITS (to wrap the deflate stream with zlib header/adler-32 footer) or -MZ_DEFAULT_WINDOW_BITS (raw deflate/no header or footer) -// mem_level must be between [1, 9] (it's checked but ignored by miniz.c) -int mz_deflateInit2(mz_streamp pStream, int level, int method, int window_bits, int mem_level, int strategy); - -// Quickly resets a compressor without having to reallocate anything. Same as calling mz_deflateEnd() followed by mz_deflateInit()/mz_deflateInit2(). -int mz_deflateReset(mz_streamp pStream); - -// mz_deflate() compresses the input to output, consuming as much of the input and producing as much output as possible. -// Parameters: -// pStream is the stream to read from and write to. You must initialize/update the next_in, avail_in, next_out, and avail_out members. -// flush may be MZ_NO_FLUSH, MZ_PARTIAL_FLUSH/MZ_SYNC_FLUSH, MZ_FULL_FLUSH, or MZ_FINISH. -// Return values: -// MZ_OK on success (when flushing, or if more input is needed but not available, and/or there's more output to be written but the output buffer is full). -// MZ_STREAM_END if all input has been consumed and all output bytes have been written. Don't call mz_deflate() on the stream anymore. -// MZ_STREAM_ERROR if the stream is bogus. -// MZ_PARAM_ERROR if one of the parameters is invalid. -// MZ_BUF_ERROR if no forward progress is possible because the input and/or output buffers are empty. (Fill up the input buffer or free up some output space and try again.) -int mz_deflate(mz_streamp pStream, int flush); - -// mz_deflateEnd() deinitializes a compressor: -// Return values: -// MZ_OK on success. -// MZ_STREAM_ERROR if the stream is bogus. -int mz_deflateEnd(mz_streamp pStream); - -// mz_deflateBound() returns a (very) conservative upper bound on the amount of data that could be generated by deflate(), assuming flush is set to only MZ_NO_FLUSH or MZ_FINISH. -mz_ulong mz_deflateBound(mz_streamp pStream, mz_ulong source_len); - -// Single-call compression functions mz_compress() and mz_compress2(): -// Returns MZ_OK on success, or one of the error codes from mz_deflate() on failure. -int mz_compress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len); -int mz_compress2(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len, int level); - -// mz_compressBound() returns a (very) conservative upper bound on the amount of data that could be generated by calling mz_compress(). -mz_ulong mz_compressBound(mz_ulong source_len); - -// Initializes a decompressor. -int mz_inflateInit(mz_streamp pStream); - -// mz_inflateInit2() is like mz_inflateInit() with an additional option that controls the window size and whether or not the stream has been wrapped with a zlib header/footer: -// window_bits must be MZ_DEFAULT_WINDOW_BITS (to parse zlib header/footer) or -MZ_DEFAULT_WINDOW_BITS (raw deflate). -int mz_inflateInit2(mz_streamp pStream, int window_bits); - -// Decompresses the input stream to the output, consuming only as much of the input as needed, and writing as much to the output as possible. -// Parameters: -// pStream is the stream to read from and write to. You must initialize/update the next_in, avail_in, next_out, and avail_out members. -// flush may be MZ_NO_FLUSH, MZ_SYNC_FLUSH, or MZ_FINISH. -// On the first call, if flush is MZ_FINISH it's assumed the input and output buffers are both sized large enough to decompress the entire stream in a single call (this is slightly faster). -// MZ_FINISH implies that there are no more source bytes available beside what's already in the input buffer, and that the output buffer is large enough to hold the rest of the decompressed data. -// Return values: -// MZ_OK on success. Either more input is needed but not available, and/or there's more output to be written but the output buffer is full. -// MZ_STREAM_END if all needed input has been consumed and all output bytes have been written. For zlib streams, the adler-32 of the decompressed data has also been verified. -// MZ_STREAM_ERROR if the stream is bogus. -// MZ_DATA_ERROR if the deflate stream is invalid. -// MZ_PARAM_ERROR if one of the parameters is invalid. -// MZ_BUF_ERROR if no forward progress is possible because the input buffer is empty but the inflater needs more input to continue, or if the output buffer is not large enough. Call mz_inflate() again -// with more input data, or with more room in the output buffer (except when using single call decompression, described above). -int mz_inflate(mz_streamp pStream, int flush); - -// Deinitializes a decompressor. -int mz_inflateEnd(mz_streamp pStream); - -// Single-call decompression. -// Returns MZ_OK on success, or one of the error codes from mz_inflate() on failure. -int mz_uncompress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len); - -// Returns a string description of the specified error code, or NULL if the error code is invalid. -const char *mz_error(int err); - -// Redefine zlib-compatible names to miniz equivalents, so miniz.c can be used as a drop-in replacement for the subset of zlib that miniz.c supports. -// Define MINIZ_NO_ZLIB_COMPATIBLE_NAMES to disable zlib-compatibility if you use zlib in the same project. -#ifndef MINIZ_NO_ZLIB_COMPATIBLE_NAMES - typedef unsigned char Byte; - typedef unsigned int uInt; - typedef mz_ulong uLong; - typedef Byte Bytef; - typedef uInt uIntf; - typedef char charf; - typedef int intf; - typedef void *voidpf; - typedef uLong uLongf; - typedef void *voidp; - typedef void *const voidpc; - #define Z_NULL 0 - #define Z_NO_FLUSH MZ_NO_FLUSH - #define Z_PARTIAL_FLUSH MZ_PARTIAL_FLUSH - #define Z_SYNC_FLUSH MZ_SYNC_FLUSH - #define Z_FULL_FLUSH MZ_FULL_FLUSH - #define Z_FINISH MZ_FINISH - #define Z_BLOCK MZ_BLOCK - #define Z_OK MZ_OK - #define Z_STREAM_END MZ_STREAM_END - #define Z_NEED_DICT MZ_NEED_DICT - #define Z_ERRNO MZ_ERRNO - #define Z_STREAM_ERROR MZ_STREAM_ERROR - #define Z_DATA_ERROR MZ_DATA_ERROR - #define Z_MEM_ERROR MZ_MEM_ERROR - #define Z_BUF_ERROR MZ_BUF_ERROR - #define Z_VERSION_ERROR MZ_VERSION_ERROR - #define Z_PARAM_ERROR MZ_PARAM_ERROR - #define Z_NO_COMPRESSION MZ_NO_COMPRESSION - #define Z_BEST_SPEED MZ_BEST_SPEED - #define Z_BEST_COMPRESSION MZ_BEST_COMPRESSION - #define Z_DEFAULT_COMPRESSION MZ_DEFAULT_COMPRESSION - #define Z_DEFAULT_STRATEGY MZ_DEFAULT_STRATEGY - #define Z_FILTERED MZ_FILTERED - #define Z_HUFFMAN_ONLY MZ_HUFFMAN_ONLY - #define Z_RLE MZ_RLE - #define Z_FIXED MZ_FIXED - #define Z_DEFLATED MZ_DEFLATED - #define Z_DEFAULT_WINDOW_BITS MZ_DEFAULT_WINDOW_BITS - #define alloc_func mz_alloc_func - #define free_func mz_free_func - #define internal_state mz_internal_state - #define z_stream mz_stream - #define deflateInit mz_deflateInit - #define deflateInit2 mz_deflateInit2 - #define deflateReset mz_deflateReset - #define deflate mz_deflate - #define deflateEnd mz_deflateEnd - #define deflateBound mz_deflateBound - #define compress mz_compress - #define compress2 mz_compress2 - #define compressBound mz_compressBound - #define inflateInit mz_inflateInit - #define inflateInit2 mz_inflateInit2 - #define inflate mz_inflate - #define inflateEnd mz_inflateEnd - #define uncompress mz_uncompress - #define crc32 mz_crc32 - #define adler32 mz_adler32 - #define MAX_WBITS 15 - #define MAX_MEM_LEVEL 9 - #define zError mz_error - #define ZLIB_VERSION MZ_VERSION - #define ZLIB_VERNUM MZ_VERNUM - #define ZLIB_VER_MAJOR MZ_VER_MAJOR - #define ZLIB_VER_MINOR MZ_VER_MINOR - #define ZLIB_VER_REVISION MZ_VER_REVISION - #define ZLIB_VER_SUBREVISION MZ_VER_SUBREVISION - #define zlibVersion mz_version - #define zlib_version mz_version() -#endif // #ifndef MINIZ_NO_ZLIB_COMPATIBLE_NAMES - -#endif // MINIZ_NO_ZLIB_APIS - -// ------------------- Types and macros - -typedef unsigned char mz_uint8; -typedef signed short mz_int16; -typedef unsigned short mz_uint16; -typedef unsigned int mz_uint32; -typedef unsigned int mz_uint; -typedef long long mz_int64; -typedef unsigned long long mz_uint64; -typedef int mz_bool; - -#define MZ_FALSE (0) -#define MZ_TRUE (1) - -// An attempt to work around MSVC's spammy "warning C4127: conditional expression is constant" message. -#ifdef _MSC_VER - #define MZ_MACRO_END while (0, 0) -#else - #define MZ_MACRO_END while (0) -#endif - -// ------------------- ZIP archive reading/writing - -#ifndef MINIZ_NO_ARCHIVE_APIS - -enum -{ - MZ_ZIP_MAX_IO_BUF_SIZE = 64*1024, - MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE = 260, - MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE = 256 -}; - -typedef struct -{ - mz_uint32 m_file_index; - mz_uint32 m_central_dir_ofs; - mz_uint16 m_version_made_by; - mz_uint16 m_version_needed; - mz_uint16 m_bit_flag; - mz_uint16 m_method; -#ifndef MINIZ_NO_TIME - time_t m_time; -#endif - mz_uint32 m_crc32; - mz_uint64 m_comp_size; - mz_uint64 m_uncomp_size; - mz_uint16 m_internal_attr; - mz_uint32 m_external_attr; - mz_uint64 m_local_header_ofs; - mz_uint32 m_comment_size; - char m_filename[MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE]; - char m_comment[MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE]; -} mz_zip_archive_file_stat; - -typedef size_t (*mz_file_read_func)(void *pOpaque, mz_uint64 file_ofs, void *pBuf, size_t n); -typedef size_t (*mz_file_write_func)(void *pOpaque, mz_uint64 file_ofs, const void *pBuf, size_t n); - -struct mz_zip_internal_state_tag; -typedef struct mz_zip_internal_state_tag mz_zip_internal_state; - -typedef enum -{ - MZ_ZIP_MODE_INVALID = 0, - MZ_ZIP_MODE_READING = 1, - MZ_ZIP_MODE_WRITING = 2, - MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED = 3 -} mz_zip_mode; - -typedef struct mz_zip_archive_tag -{ - mz_uint64 m_archive_size; - mz_uint64 m_central_directory_file_ofs; - mz_uint m_total_files; - mz_zip_mode m_zip_mode; - - mz_uint m_file_offset_alignment; - - mz_alloc_func m_pAlloc; - mz_free_func m_pFree; - mz_realloc_func m_pRealloc; - void *m_pAlloc_opaque; - - mz_file_read_func m_pRead; - mz_file_write_func m_pWrite; - void *m_pIO_opaque; - - mz_zip_internal_state *m_pState; - -} mz_zip_archive; - -typedef enum -{ - MZ_ZIP_FLAG_CASE_SENSITIVE = 0x0100, - MZ_ZIP_FLAG_IGNORE_PATH = 0x0200, - MZ_ZIP_FLAG_COMPRESSED_DATA = 0x0400, - MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY = 0x0800 -} mz_zip_flags; - -// ZIP archive reading - -// Inits a ZIP archive reader. -// These functions read and validate the archive's central directory. -mz_bool mz_zip_reader_init(mz_zip_archive *pZip, mz_uint64 size, mz_uint32 flags); -mz_bool mz_zip_reader_init_mem(mz_zip_archive *pZip, const void *pMem, size_t size, mz_uint32 flags); - -#ifndef MINIZ_NO_STDIO -mz_bool mz_zip_reader_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint32 flags); -#endif - -// Returns the total number of files in the archive. -mz_uint mz_zip_reader_get_num_files(mz_zip_archive *pZip); - -// Returns detailed information about an archive file entry. -mz_bool mz_zip_reader_file_stat(mz_zip_archive *pZip, mz_uint file_index, mz_zip_archive_file_stat *pStat); - -// Determines if an archive file entry is a directory entry. -mz_bool mz_zip_reader_is_file_a_directory(mz_zip_archive *pZip, mz_uint file_index); -mz_bool mz_zip_reader_is_file_encrypted(mz_zip_archive *pZip, mz_uint file_index); - -// Retrieves the filename of an archive file entry. -// Returns the number of bytes written to pFilename, or if filename_buf_size is 0 this function returns the number of bytes needed to fully store the filename. -mz_uint mz_zip_reader_get_filename(mz_zip_archive *pZip, mz_uint file_index, char *pFilename, mz_uint filename_buf_size); - -// Attempts to locates a file in the archive's central directory. -// Valid flags: MZ_ZIP_FLAG_CASE_SENSITIVE, MZ_ZIP_FLAG_IGNORE_PATH -// Returns -1 if the file cannot be found. -int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags); - -// Extracts a archive file to a memory buffer using no memory allocation. -mz_bool mz_zip_reader_extract_to_mem_no_alloc(mz_zip_archive *pZip, mz_uint file_index, void *pBuf, size_t buf_size, mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size); -mz_bool mz_zip_reader_extract_file_to_mem_no_alloc(mz_zip_archive *pZip, const char *pFilename, void *pBuf, size_t buf_size, mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size); - -// Extracts a archive file to a memory buffer. -mz_bool mz_zip_reader_extract_to_mem(mz_zip_archive *pZip, mz_uint file_index, void *pBuf, size_t buf_size, mz_uint flags); -mz_bool mz_zip_reader_extract_file_to_mem(mz_zip_archive *pZip, const char *pFilename, void *pBuf, size_t buf_size, mz_uint flags); - -// Extracts a archive file to a dynamically allocated heap buffer. -void *mz_zip_reader_extract_to_heap(mz_zip_archive *pZip, mz_uint file_index, size_t *pSize, mz_uint flags); -void *mz_zip_reader_extract_file_to_heap(mz_zip_archive *pZip, const char *pFilename, size_t *pSize, mz_uint flags); - -// Extracts a archive file using a callback function to output the file's data. -mz_bool mz_zip_reader_extract_to_callback(mz_zip_archive *pZip, mz_uint file_index, mz_file_write_func pCallback, void *pOpaque, mz_uint flags); -mz_bool mz_zip_reader_extract_file_to_callback(mz_zip_archive *pZip, const char *pFilename, mz_file_write_func pCallback, void *pOpaque, mz_uint flags); - -#ifndef MINIZ_NO_STDIO -// Extracts a archive file to a disk file and sets its last accessed and modified times. -// This function only extracts files, not archive directory records. -mz_bool mz_zip_reader_extract_to_file(mz_zip_archive *pZip, mz_uint file_index, const char *pDst_filename, mz_uint flags); -mz_bool mz_zip_reader_extract_file_to_file(mz_zip_archive *pZip, const char *pArchive_filename, const char *pDst_filename, mz_uint flags); -#endif - -// Ends archive reading, freeing all allocations, and closing the input archive file if mz_zip_reader_init_file() was used. -mz_bool mz_zip_reader_end(mz_zip_archive *pZip); - -// ZIP archive writing - -#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS - -// Inits a ZIP archive writer. -mz_bool mz_zip_writer_init(mz_zip_archive *pZip, mz_uint64 existing_size); -mz_bool mz_zip_writer_init_heap(mz_zip_archive *pZip, size_t size_to_reserve_at_beginning, size_t initial_allocation_size); - -#ifndef MINIZ_NO_STDIO -mz_bool mz_zip_writer_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint64 size_to_reserve_at_beginning); -#endif - -// Converts a ZIP archive reader object into a writer object, to allow efficient in-place file appends to occur on an existing archive. -// For archives opened using mz_zip_reader_init_file, pFilename must be the archive's filename so it can be reopened for writing. If the file can't be reopened, mz_zip_reader_end() will be called. -// For archives opened using mz_zip_reader_init_mem, the memory block must be growable using the realloc callback (which defaults to realloc unless you've overridden it). -// Finally, for archives opened using mz_zip_reader_init, the mz_zip_archive's user provided m_pWrite function cannot be NULL. -// Note: In-place archive modification is not recommended unless you know what you're doing, because if execution stops or something goes wrong before -// the archive is finalized the file's central directory will be hosed. -mz_bool mz_zip_writer_init_from_reader(mz_zip_archive *pZip, const char *pFilename); - -// Adds the contents of a memory buffer to an archive. These functions record the current local time into the archive. -// To add a directory entry, call this method with an archive name ending in a forwardslash with empty buffer. -// level_and_flags - compression level (0-10, see MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc.) logically OR'd with zero or more mz_zip_flags, or just set to MZ_DEFAULT_COMPRESSION. -mz_bool mz_zip_writer_add_mem(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, mz_uint level_and_flags); -mz_bool mz_zip_writer_add_mem_ex(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, mz_uint64 uncomp_size, mz_uint32 uncomp_crc32); - -#ifndef MINIZ_NO_STDIO -// Adds the contents of a disk file to an archive. This function also records the disk file's modified time into the archive. -// level_and_flags - compression level (0-10, see MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc.) logically OR'd with zero or more mz_zip_flags, or just set to MZ_DEFAULT_COMPRESSION. -mz_bool mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name, const char *pSrc_filename, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags); -#endif - -// Adds a file to an archive by fully cloning the data from another archive. -// This function fully clones the source file's compressed data (no recompression), along with its full filename, extra data, and comment fields. -mz_bool mz_zip_writer_add_from_zip_reader(mz_zip_archive *pZip, mz_zip_archive *pSource_zip, mz_uint file_index); - -// Finalizes the archive by writing the central directory records followed by the end of central directory record. -// After an archive is finalized, the only valid call on the mz_zip_archive struct is mz_zip_writer_end(). -// An archive must be manually finalized by calling this function for it to be valid. -mz_bool mz_zip_writer_finalize_archive(mz_zip_archive *pZip); -mz_bool mz_zip_writer_finalize_heap_archive(mz_zip_archive *pZip, void **pBuf, size_t *pSize); - -// Ends archive writing, freeing all allocations, and closing the output file if mz_zip_writer_init_file() was used. -// Note for the archive to be valid, it must have been finalized before ending. -mz_bool mz_zip_writer_end(mz_zip_archive *pZip); - -// Misc. high-level helper functions: - -// mz_zip_add_mem_to_archive_file_in_place() efficiently (but not atomically) appends a memory blob to a ZIP archive. -// level_and_flags - compression level (0-10, see MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc.) logically OR'd with zero or more mz_zip_flags, or just set to MZ_DEFAULT_COMPRESSION. -mz_bool mz_zip_add_mem_to_archive_file_in_place(const char *pZip_filename, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags); - -// Reads a single file from an archive into a heap block. -// Returns NULL on failure. -void *mz_zip_extract_archive_file_to_heap(const char *pZip_filename, const char *pArchive_name, size_t *pSize, mz_uint zip_flags); - -#endif // #ifndef MINIZ_NO_ARCHIVE_WRITING_APIS - -#endif // #ifndef MINIZ_NO_ARCHIVE_APIS - -// ------------------- Low-level Decompression API Definitions - -// Decompression flags used by tinfl_decompress(). -// TINFL_FLAG_PARSE_ZLIB_HEADER: If set, the input has a valid zlib header and ends with an adler32 checksum (it's a valid zlib stream). Otherwise, the input is a raw deflate stream. -// TINFL_FLAG_HAS_MORE_INPUT: If set, there are more input bytes available beyond the end of the supplied input buffer. If clear, the input buffer contains all remaining input. -// TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF: If set, the output buffer is large enough to hold the entire decompressed stream. If clear, the output buffer is at least the size of the dictionary (typically 32KB). -// TINFL_FLAG_COMPUTE_ADLER32: Force adler-32 checksum computation of the decompressed bytes. -enum -{ - TINFL_FLAG_PARSE_ZLIB_HEADER = 1, - TINFL_FLAG_HAS_MORE_INPUT = 2, - TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF = 4, - TINFL_FLAG_COMPUTE_ADLER32 = 8 -}; - -// High level decompression functions: -// tinfl_decompress_mem_to_heap() decompresses a block in memory to a heap block allocated via malloc(). -// On entry: -// pSrc_buf, src_buf_len: Pointer and size of the Deflate or zlib source data to decompress. -// On return: -// Function returns a pointer to the decompressed data, or NULL on failure. -// *pOut_len will be set to the decompressed data's size, which could be larger than src_buf_len on uncompressible data. -// The caller must call mz_free() on the returned block when it's no longer needed. -void *tinfl_decompress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags); - -// tinfl_decompress_mem_to_mem() decompresses a block in memory to another block in memory. -// Returns TINFL_DECOMPRESS_MEM_TO_MEM_FAILED on failure, or the number of bytes written on success. -#define TINFL_DECOMPRESS_MEM_TO_MEM_FAILED ((size_t)(-1)) -size_t tinfl_decompress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags); - -// tinfl_decompress_mem_to_callback() decompresses a block in memory to an internal 32KB buffer, and a user provided callback function will be called to flush the buffer. -// Returns 1 on success or 0 on failure. -typedef int (*tinfl_put_buf_func_ptr)(const void* pBuf, int len, void *pUser); -int tinfl_decompress_mem_to_callback(const void *pIn_buf, size_t *pIn_buf_size, tinfl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); - -struct tinfl_decompressor_tag; typedef struct tinfl_decompressor_tag tinfl_decompressor; - -// Max size of LZ dictionary. -#define TINFL_LZ_DICT_SIZE 32768 - -// Return status. -typedef enum -{ - TINFL_STATUS_BAD_PARAM = -3, - TINFL_STATUS_ADLER32_MISMATCH = -2, - TINFL_STATUS_FAILED = -1, - TINFL_STATUS_DONE = 0, - TINFL_STATUS_NEEDS_MORE_INPUT = 1, - TINFL_STATUS_HAS_MORE_OUTPUT = 2 -} tinfl_status; - -// Initializes the decompressor to its initial state. -#define tinfl_init(r) do { (r)->m_state = 0; } MZ_MACRO_END -#define tinfl_get_adler32(r) (r)->m_check_adler32 - -// Main low-level decompressor coroutine function. This is the only function actually needed for decompression. All the other functions are just high-level helpers for improved usability. -// This is a universal API, i.e. it can be used as a building block to build any desired higher level decompression API. In the limit case, it can be called once per every byte input or output. -tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_next, size_t *pIn_buf_size, mz_uint8 *pOut_buf_start, mz_uint8 *pOut_buf_next, size_t *pOut_buf_size, const mz_uint32 decomp_flags); - -// Internal/private bits follow. -enum -{ - TINFL_MAX_HUFF_TABLES = 3, TINFL_MAX_HUFF_SYMBOLS_0 = 288, TINFL_MAX_HUFF_SYMBOLS_1 = 32, TINFL_MAX_HUFF_SYMBOLS_2 = 19, - TINFL_FAST_LOOKUP_BITS = 10, TINFL_FAST_LOOKUP_SIZE = 1 << TINFL_FAST_LOOKUP_BITS -}; - -typedef struct -{ - mz_uint8 m_code_size[TINFL_MAX_HUFF_SYMBOLS_0]; - mz_int16 m_look_up[TINFL_FAST_LOOKUP_SIZE], m_tree[TINFL_MAX_HUFF_SYMBOLS_0 * 2]; -} tinfl_huff_table; - -#if MINIZ_HAS_64BIT_REGISTERS - #define TINFL_USE_64BIT_BITBUF 1 -#endif - -#if TINFL_USE_64BIT_BITBUF - typedef mz_uint64 tinfl_bit_buf_t; - #define TINFL_BITBUF_SIZE (64) -#else - typedef mz_uint32 tinfl_bit_buf_t; - #define TINFL_BITBUF_SIZE (32) -#endif - -struct tinfl_decompressor_tag -{ - mz_uint32 m_state, m_num_bits, m_zhdr0, m_zhdr1, m_z_adler32, m_final, m_type, m_check_adler32, m_dist, m_counter, m_num_extra, m_table_sizes[TINFL_MAX_HUFF_TABLES]; - tinfl_bit_buf_t m_bit_buf; - size_t m_dist_from_out_buf_start; - tinfl_huff_table m_tables[TINFL_MAX_HUFF_TABLES]; - mz_uint8 m_raw_header[4], m_len_codes[TINFL_MAX_HUFF_SYMBOLS_0 + TINFL_MAX_HUFF_SYMBOLS_1 + 137]; -}; - -// ------------------- Low-level Compression API Definitions - -// Set TDEFL_LESS_MEMORY to 1 to use less memory (compression will be slightly slower, and raw/dynamic blocks will be output more frequently). -#define TDEFL_LESS_MEMORY 1 - -// tdefl_init() compression flags logically OR'd together (low 12 bits contain the max. number of probes per dictionary search): -// TDEFL_DEFAULT_MAX_PROBES: The compressor defaults to 128 dictionary probes per dictionary search. 0=Huffman only, 1=Huffman+LZ (fastest/crap compression), 4095=Huffman+LZ (slowest/best compression). -enum -{ - TDEFL_HUFFMAN_ONLY = 0, TDEFL_DEFAULT_MAX_PROBES = 128, TDEFL_MAX_PROBES_MASK = 0xFFF -}; - -// TDEFL_WRITE_ZLIB_HEADER: If set, the compressor outputs a zlib header before the deflate data, and the Adler-32 of the source data at the end. Otherwise, you'll get raw deflate data. -// TDEFL_COMPUTE_ADLER32: Always compute the adler-32 of the input data (even when not writing zlib headers). -// TDEFL_GREEDY_PARSING_FLAG: Set to use faster greedy parsing, instead of more efficient lazy parsing. -// TDEFL_NONDETERMINISTIC_PARSING_FLAG: Enable to decrease the compressor's initialization time to the minimum, but the output may vary from run to run given the same input (depending on the contents of memory). -// TDEFL_RLE_MATCHES: Only look for RLE matches (matches with a distance of 1) -// TDEFL_FILTER_MATCHES: Discards matches <= 5 chars if enabled. -// TDEFL_FORCE_ALL_STATIC_BLOCKS: Disable usage of optimized Huffman tables. -// TDEFL_FORCE_ALL_RAW_BLOCKS: Only use raw (uncompressed) deflate blocks. -// The low 12 bits are reserved to control the max # of hash probes per dictionary lookup (see TDEFL_MAX_PROBES_MASK). -enum -{ - TDEFL_WRITE_ZLIB_HEADER = 0x01000, - TDEFL_COMPUTE_ADLER32 = 0x02000, - TDEFL_GREEDY_PARSING_FLAG = 0x04000, - TDEFL_NONDETERMINISTIC_PARSING_FLAG = 0x08000, - TDEFL_RLE_MATCHES = 0x10000, - TDEFL_FILTER_MATCHES = 0x20000, - TDEFL_FORCE_ALL_STATIC_BLOCKS = 0x40000, - TDEFL_FORCE_ALL_RAW_BLOCKS = 0x80000 -}; - -// High level compression functions: -// tdefl_compress_mem_to_heap() compresses a block in memory to a heap block allocated via malloc(). -// On entry: -// pSrc_buf, src_buf_len: Pointer and size of source block to compress. -// flags: The max match finder probes (default is 128) logically OR'd against the above flags. Higher probes are slower but improve compression. -// On return: -// Function returns a pointer to the compressed data, or NULL on failure. -// *pOut_len will be set to the compressed data's size, which could be larger than src_buf_len on uncompressible data. -// The caller must free() the returned block when it's no longer needed. -void *tdefl_compress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags); - -// tdefl_compress_mem_to_mem() compresses a block in memory to another block in memory. -// Returns 0 on failure. -size_t tdefl_compress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags); - -// Compresses an image to a compressed PNG file in memory. -// On entry: -// pImage, w, h, and num_chans describe the image to compress. num_chans may be 1, 2, 3, or 4. -// The image pitch in bytes per scanline will be w*num_chans. The leftmost pixel on the top scanline is stored first in memory. -// level may range from [0,10], use MZ_NO_COMPRESSION, MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc. or a decent default is MZ_DEFAULT_LEVEL -// If flip is true, the image will be flipped on the Y axis (useful for OpenGL apps). -// On return: -// Function returns a pointer to the compressed data, or NULL on failure. -// *pLen_out will be set to the size of the PNG image file. -// The caller must mz_free() the returned heap block (which will typically be larger than *pLen_out) when it's no longer needed. -void *tdefl_write_image_to_png_file_in_memory_ex(const void *pImage, int w, int h, int num_chans, size_t *pLen_out, mz_uint level, mz_bool flip); -void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h, int num_chans, size_t *pLen_out); - -// Output stream interface. The compressor uses this interface to write compressed data. It'll typically be called TDEFL_OUT_BUF_SIZE at a time. -typedef mz_bool (*tdefl_put_buf_func_ptr)(const void* pBuf, int len, void *pUser); - -// tdefl_compress_mem_to_output() compresses a block to an output stream. The above helpers use this function internally. -mz_bool tdefl_compress_mem_to_output(const void *pBuf, size_t buf_len, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); - -enum { TDEFL_MAX_HUFF_TABLES = 3, TDEFL_MAX_HUFF_SYMBOLS_0 = 288, TDEFL_MAX_HUFF_SYMBOLS_1 = 32, TDEFL_MAX_HUFF_SYMBOLS_2 = 19, TDEFL_LZ_DICT_SIZE = 32768, TDEFL_LZ_DICT_SIZE_MASK = TDEFL_LZ_DICT_SIZE - 1, TDEFL_MIN_MATCH_LEN = 3, TDEFL_MAX_MATCH_LEN = 258 }; - -// TDEFL_OUT_BUF_SIZE MUST be large enough to hold a single entire compressed output block (using static/fixed Huffman codes). -#if TDEFL_LESS_MEMORY -enum { TDEFL_LZ_CODE_BUF_SIZE = 24 * 1024, TDEFL_OUT_BUF_SIZE = (TDEFL_LZ_CODE_BUF_SIZE * 13 ) / 10, TDEFL_MAX_HUFF_SYMBOLS = 288, TDEFL_LZ_HASH_BITS = 12, TDEFL_LEVEL1_HASH_SIZE_MASK = 4095, TDEFL_LZ_HASH_SHIFT = (TDEFL_LZ_HASH_BITS + 2) / 3, TDEFL_LZ_HASH_SIZE = 1 << TDEFL_LZ_HASH_BITS }; -#else -enum { TDEFL_LZ_CODE_BUF_SIZE = 64 * 1024, TDEFL_OUT_BUF_SIZE = (TDEFL_LZ_CODE_BUF_SIZE * 13 ) / 10, TDEFL_MAX_HUFF_SYMBOLS = 288, TDEFL_LZ_HASH_BITS = 15, TDEFL_LEVEL1_HASH_SIZE_MASK = 4095, TDEFL_LZ_HASH_SHIFT = (TDEFL_LZ_HASH_BITS + 2) / 3, TDEFL_LZ_HASH_SIZE = 1 << TDEFL_LZ_HASH_BITS }; -#endif - -// The low-level tdefl functions below may be used directly if the above helper functions aren't flexible enough. The low-level functions don't make any heap allocations, unlike the above helper functions. -typedef enum -{ - TDEFL_STATUS_BAD_PARAM = -2, - TDEFL_STATUS_PUT_BUF_FAILED = -1, - TDEFL_STATUS_OKAY = 0, - TDEFL_STATUS_DONE = 1, -} tdefl_status; - -// Must map to MZ_NO_FLUSH, MZ_SYNC_FLUSH, etc. enums -typedef enum -{ - TDEFL_NO_FLUSH = 0, - TDEFL_SYNC_FLUSH = 2, - TDEFL_FULL_FLUSH = 3, - TDEFL_FINISH = 4 -} tdefl_flush; - -// tdefl's compression state structure. -typedef struct -{ - tdefl_put_buf_func_ptr m_pPut_buf_func; - void *m_pPut_buf_user; - mz_uint m_flags, m_max_probes[2]; - int m_greedy_parsing; - mz_uint m_adler32, m_lookahead_pos, m_lookahead_size, m_dict_size; - mz_uint8 *m_pLZ_code_buf, *m_pLZ_flags, *m_pOutput_buf, *m_pOutput_buf_end; - mz_uint m_num_flags_left, m_total_lz_bytes, m_lz_code_buf_dict_pos, m_bits_in, m_bit_buffer; - mz_uint m_saved_match_dist, m_saved_match_len, m_saved_lit, m_output_flush_ofs, m_output_flush_remaining, m_finished, m_block_index, m_wants_to_finish; - tdefl_status m_prev_return_status; - const void *m_pIn_buf; - void *m_pOut_buf; - size_t *m_pIn_buf_size, *m_pOut_buf_size; - tdefl_flush m_flush; - const mz_uint8 *m_pSrc; - size_t m_src_buf_left, m_out_buf_ofs; - mz_uint8 m_dict[TDEFL_LZ_DICT_SIZE + TDEFL_MAX_MATCH_LEN - 1]; - mz_uint16 m_huff_count[TDEFL_MAX_HUFF_TABLES][TDEFL_MAX_HUFF_SYMBOLS]; - mz_uint16 m_huff_codes[TDEFL_MAX_HUFF_TABLES][TDEFL_MAX_HUFF_SYMBOLS]; - mz_uint8 m_huff_code_sizes[TDEFL_MAX_HUFF_TABLES][TDEFL_MAX_HUFF_SYMBOLS]; - mz_uint8 m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE]; - mz_uint16 m_next[TDEFL_LZ_DICT_SIZE]; - mz_uint16 m_hash[TDEFL_LZ_HASH_SIZE]; - mz_uint8 m_output_buf[TDEFL_OUT_BUF_SIZE]; -} tdefl_compressor; - -// Initializes the compressor. -// There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. -// pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. -// If pBut_buf_func is NULL the user should always call the tdefl_compress() API. -// flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) -tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); - -// Compresses a block of data, consuming as much of the specified input buffer as possible, and writing as much compressed data to the specified output buffer as possible. -tdefl_status tdefl_compress(tdefl_compressor *d, const void *pIn_buf, size_t *pIn_buf_size, void *pOut_buf, size_t *pOut_buf_size, tdefl_flush flush); - -// tdefl_compress_buffer() is only usable when the tdefl_init() is called with a non-NULL tdefl_put_buf_func_ptr. -// tdefl_compress_buffer() always consumes the entire input buffer. -tdefl_status tdefl_compress_buffer(tdefl_compressor *d, const void *pIn_buf, size_t in_buf_size, tdefl_flush flush); - -tdefl_status tdefl_get_prev_return_status(tdefl_compressor *d); -mz_uint32 tdefl_get_adler32(tdefl_compressor *d); - -// Can't use tdefl_create_comp_flags_from_zip_params if MINIZ_NO_ZLIB_APIS isn't defined, because it uses some of its macros. -#ifndef MINIZ_NO_ZLIB_APIS -// Create tdefl_compress() flags given zlib-style compression parameters. -// level may range from [0,10] (where 10 is absolute max compression, but may be much slower on some files) -// window_bits may be -15 (raw deflate) or 15 (zlib) -// strategy may be either MZ_DEFAULT_STRATEGY, MZ_FILTERED, MZ_HUFFMAN_ONLY, MZ_RLE, or MZ_FIXED -mz_uint tdefl_create_comp_flags_from_zip_params(int level, int window_bits, int strategy); -#endif // #ifndef MINIZ_NO_ZLIB_APIS - -#ifdef __cplusplus -} -#endif - -#endif // MINIZ_HEADER_INCLUDED - diff --git a/tools/sdk/include/esp32/rom/queue.h b/tools/sdk/include/esp32/rom/queue.h deleted file mode 100644 index 29ee6706009..00000000000 --- a/tools/sdk/include/esp32/rom/queue.h +++ /dev/null @@ -1,645 +0,0 @@ -/*- - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * 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. - * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. - * - * @(#)queue.h 8.5 (Berkeley) 8/20/94 - * $FreeBSD$ - */ - -#ifndef _SYS_QUEUE_H_ -#define _SYS_QUEUE_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * This file defines four types of data structures: singly-linked lists, - * singly-linked tail queues, lists and tail queues. - * - * A singly-linked list is headed by a single forward pointer. The elements - * are singly linked for minimum space and pointer manipulation overhead at - * the expense of O(n) removal for arbitrary elements. New elements can be - * added to the list after an existing element or at the head of the list. - * Elements being removed from the head of the list should use the explicit - * macro for this purpose for optimum efficiency. A singly-linked list may - * only be traversed in the forward direction. Singly-linked lists are ideal - * for applications with large datasets and few or no removals or for - * implementing a LIFO queue. - * - * A singly-linked tail queue is headed by a pair of pointers, one to the - * head of the list and the other to the tail of the list. The elements are - * singly linked for minimum space and pointer manipulation overhead at the - * expense of O(n) removal for arbitrary elements. New elements can be added - * to the list after an existing element, at the head of the list, or at the - * end of the list. Elements being removed from the head of the tail queue - * should use the explicit macro for this purpose for optimum efficiency. - * A singly-linked tail queue may only be traversed in the forward direction. - * Singly-linked tail queues are ideal for applications with large datasets - * and few or no removals or for implementing a FIFO queue. - * - * A list is headed by a single forward pointer (or an array of forward - * pointers for a hash table header). The elements are doubly linked - * so that an arbitrary element can be removed without a need to - * traverse the list. New elements can be added to the list before - * or after an existing element or at the head of the list. A list - * may only be traversed in the forward direction. - * - * A tail queue is headed by a pair of pointers, one to the head of the - * list and the other to the tail of the list. The elements are doubly - * linked so that an arbitrary element can be removed without a need to - * traverse the list. New elements can be added to the list before or - * after an existing element, at the head of the list, or at the end of - * the list. A tail queue may be traversed in either direction. - * - * For details on the use of these macros, see the queue(3) manual page. - * - * - * SLIST LIST STAILQ TAILQ - * _HEAD + + + + - * _HEAD_INITIALIZER + + + + - * _ENTRY + + + + - * _INIT + + + + - * _EMPTY + + + + - * _FIRST + + + + - * _NEXT + + + + - * _PREV - - - + - * _LAST - - + + - * _FOREACH + + + + - * _FOREACH_SAFE + + + + - * _FOREACH_REVERSE - - - + - * _FOREACH_REVERSE_SAFE - - - + - * _INSERT_HEAD + + + + - * _INSERT_BEFORE - + - + - * _INSERT_AFTER + + + + - * _INSERT_TAIL - - + + - * _CONCAT - - + + - * _REMOVE_AFTER + - + - - * _REMOVE_HEAD + - + - - * _REMOVE + + + + - * - */ -#ifdef QUEUE_MACRO_DEBUG -/* Store the last 2 places the queue element or head was altered */ -struct qm_trace { - char * lastfile; - int lastline; - char * prevfile; - int prevline; -}; - -#define TRACEBUF struct qm_trace trace; -#define TRASHIT(x) do {(x) = (void *)-1;} while (0) -#define QMD_SAVELINK(name, link) void **name = (void *)&(link) - -#define QMD_TRACE_HEAD(head) do { \ - (head)->trace.prevline = (head)->trace.lastline; \ - (head)->trace.prevfile = (head)->trace.lastfile; \ - (head)->trace.lastline = __LINE__; \ - (head)->trace.lastfile = __FILE__; \ -} while (0) - -#define QMD_TRACE_ELEM(elem) do { \ - (elem)->trace.prevline = (elem)->trace.lastline; \ - (elem)->trace.prevfile = (elem)->trace.lastfile; \ - (elem)->trace.lastline = __LINE__; \ - (elem)->trace.lastfile = __FILE__; \ -} while (0) - -#else -#define QMD_TRACE_ELEM(elem) -#define QMD_TRACE_HEAD(head) -#define QMD_SAVELINK(name, link) -#define TRACEBUF -#define TRASHIT(x) -#endif /* QUEUE_MACRO_DEBUG */ - -/* - * Singly-linked List declarations. - */ -#define SLIST_HEAD(name, type) \ -struct name { \ - struct type *slh_first; /* first element */ \ -} - -#define SLIST_HEAD_INITIALIZER(head) \ - { NULL } - -#define SLIST_ENTRY(type) \ -struct { \ - struct type *sle_next; /* next element */ \ -} - -/* - * Singly-linked List functions. - */ -#define SLIST_EMPTY(head) ((head)->slh_first == NULL) - -#define SLIST_FIRST(head) ((head)->slh_first) - -#define SLIST_FOREACH(var, head, field) \ - for ((var) = SLIST_FIRST((head)); \ - (var); \ - (var) = SLIST_NEXT((var), field)) - -#define SLIST_FOREACH_SAFE(var, head, field, tvar) \ - for ((var) = SLIST_FIRST((head)); \ - (var) && ((tvar) = SLIST_NEXT((var), field), 1); \ - (var) = (tvar)) - -#define SLIST_FOREACH_PREVPTR(var, varp, head, field) \ - for ((varp) = &SLIST_FIRST((head)); \ - ((var) = *(varp)) != NULL; \ - (varp) = &SLIST_NEXT((var), field)) - -#define SLIST_INIT(head) do { \ - SLIST_FIRST((head)) = NULL; \ -} while (0) - -#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ - SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); \ - SLIST_NEXT((slistelm), field) = (elm); \ -} while (0) - -#define SLIST_INSERT_HEAD(head, elm, field) do { \ - SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \ - SLIST_FIRST((head)) = (elm); \ -} while (0) - -#define SLIST_NEXT(elm, field) ((elm)->field.sle_next) - -#define SLIST_REMOVE(head, elm, type, field) do { \ - QMD_SAVELINK(oldnext, (elm)->field.sle_next); \ - if (SLIST_FIRST((head)) == (elm)) { \ - SLIST_REMOVE_HEAD((head), field); \ - } \ - else { \ - struct type *curelm = SLIST_FIRST((head)); \ - while (SLIST_NEXT(curelm, field) != (elm)) \ - curelm = SLIST_NEXT(curelm, field); \ - SLIST_REMOVE_AFTER(curelm, field); \ - } \ - TRASHIT(*oldnext); \ -} while (0) - -#define SLIST_REMOVE_AFTER(elm, field) do { \ - SLIST_NEXT(elm, field) = \ - SLIST_NEXT(SLIST_NEXT(elm, field), field); \ -} while (0) - -#define SLIST_REMOVE_HEAD(head, field) do { \ - SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \ -} while (0) - -/* - * Singly-linked Tail queue declarations. - */ -#define STAILQ_HEAD(name, type) \ -struct name { \ - struct type *stqh_first;/* first element */ \ - struct type **stqh_last;/* addr of last next element */ \ -} - -#define STAILQ_HEAD_INITIALIZER(head) \ - { NULL, &(head).stqh_first } - -#define STAILQ_ENTRY(type) \ -struct { \ - struct type *stqe_next; /* next element */ \ -} - -/* - * Singly-linked Tail queue functions. - */ -#define STAILQ_CONCAT(head1, head2) do { \ - if (!STAILQ_EMPTY((head2))) { \ - *(head1)->stqh_last = (head2)->stqh_first; \ - (head1)->stqh_last = (head2)->stqh_last; \ - STAILQ_INIT((head2)); \ - } \ -} while (0) - -#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) - -#define STAILQ_FIRST(head) ((head)->stqh_first) - -#define STAILQ_FOREACH(var, head, field) \ - for((var) = STAILQ_FIRST((head)); \ - (var); \ - (var) = STAILQ_NEXT((var), field)) - - -#define STAILQ_FOREACH_SAFE(var, head, field, tvar) \ - for ((var) = STAILQ_FIRST((head)); \ - (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \ - (var) = (tvar)) - -#define STAILQ_INIT(head) do { \ - STAILQ_FIRST((head)) = NULL; \ - (head)->stqh_last = &STAILQ_FIRST((head)); \ -} while (0) - -#define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \ - if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\ - (head)->stqh_last = &STAILQ_NEXT((elm), field); \ - STAILQ_NEXT((tqelm), field) = (elm); \ -} while (0) - -#define STAILQ_INSERT_HEAD(head, elm, field) do { \ - if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \ - (head)->stqh_last = &STAILQ_NEXT((elm), field); \ - STAILQ_FIRST((head)) = (elm); \ -} while (0) - -#define STAILQ_INSERT_TAIL(head, elm, field) do { \ - STAILQ_NEXT((elm), field) = NULL; \ - *(head)->stqh_last = (elm); \ - (head)->stqh_last = &STAILQ_NEXT((elm), field); \ -} while (0) - -#define STAILQ_LAST(head, type, field) \ - (STAILQ_EMPTY((head)) ? \ - NULL : \ - ((struct type *)(void *) \ - ((char *)((head)->stqh_last) - __offsetof(struct type, field)))) - -#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) - -#define STAILQ_REMOVE(head, elm, type, field) do { \ - QMD_SAVELINK(oldnext, (elm)->field.stqe_next); \ - if (STAILQ_FIRST((head)) == (elm)) { \ - STAILQ_REMOVE_HEAD((head), field); \ - } \ - else { \ - struct type *curelm = STAILQ_FIRST((head)); \ - while (STAILQ_NEXT(curelm, field) != (elm)) \ - curelm = STAILQ_NEXT(curelm, field); \ - STAILQ_REMOVE_AFTER(head, curelm, field); \ - } \ - TRASHIT(*oldnext); \ -} while (0) - -#define STAILQ_REMOVE_HEAD(head, field) do { \ - if ((STAILQ_FIRST((head)) = \ - STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \ - (head)->stqh_last = &STAILQ_FIRST((head)); \ -} while (0) - -#define STAILQ_REMOVE_AFTER(head, elm, field) do { \ - if ((STAILQ_NEXT(elm, field) = \ - STAILQ_NEXT(STAILQ_NEXT(elm, field), field)) == NULL) \ - (head)->stqh_last = &STAILQ_NEXT((elm), field); \ -} while (0) - -#define STAILQ_SWAP(head1, head2, type) do { \ - struct type *swap_first = STAILQ_FIRST(head1); \ - struct type **swap_last = (head1)->stqh_last; \ - STAILQ_FIRST(head1) = STAILQ_FIRST(head2); \ - (head1)->stqh_last = (head2)->stqh_last; \ - STAILQ_FIRST(head2) = swap_first; \ - (head2)->stqh_last = swap_last; \ - if (STAILQ_EMPTY(head1)) \ - (head1)->stqh_last = &STAILQ_FIRST(head1); \ - if (STAILQ_EMPTY(head2)) \ - (head2)->stqh_last = &STAILQ_FIRST(head2); \ -} while (0) - -#define STAILQ_INSERT_CHAIN_HEAD(head, elm_chead, elm_ctail, field) do { \ - if ((STAILQ_NEXT(elm_ctail, field) = STAILQ_FIRST(head)) == NULL ) { \ - (head)->stqh_last = &STAILQ_NEXT(elm_ctail, field); \ - } \ - STAILQ_FIRST(head) = (elm_chead); \ -} while (0) - - -/* - * List declarations. - */ -#define LIST_HEAD(name, type) \ -struct name { \ - struct type *lh_first; /* first element */ \ -} - -#define LIST_HEAD_INITIALIZER(head) \ - { NULL } - -#define LIST_ENTRY(type) \ -struct { \ - struct type *le_next; /* next element */ \ - struct type **le_prev; /* address of previous next element */ \ -} - -/* - * List functions. - */ - -#if (defined(_KERNEL) && defined(INVARIANTS)) -#define QMD_LIST_CHECK_HEAD(head, field) do { \ - if (LIST_FIRST((head)) != NULL && \ - LIST_FIRST((head))->field.le_prev != \ - &LIST_FIRST((head))) \ - panic("Bad list head %p first->prev != head", (head)); \ -} while (0) - -#define QMD_LIST_CHECK_NEXT(elm, field) do { \ - if (LIST_NEXT((elm), field) != NULL && \ - LIST_NEXT((elm), field)->field.le_prev != \ - &((elm)->field.le_next)) \ - panic("Bad link elm %p next->prev != elm", (elm)); \ -} while (0) - -#define QMD_LIST_CHECK_PREV(elm, field) do { \ - if (*(elm)->field.le_prev != (elm)) \ - panic("Bad link elm %p prev->next != elm", (elm)); \ -} while (0) -#else -#define QMD_LIST_CHECK_HEAD(head, field) -#define QMD_LIST_CHECK_NEXT(elm, field) -#define QMD_LIST_CHECK_PREV(elm, field) -#endif /* (_KERNEL && INVARIANTS) */ - -#define LIST_EMPTY(head) ((head)->lh_first == NULL) - -#define LIST_FIRST(head) ((head)->lh_first) - -#define LIST_FOREACH(var, head, field) \ - for ((var) = LIST_FIRST((head)); \ - (var); \ - (var) = LIST_NEXT((var), field)) - -#define LIST_FOREACH_SAFE(var, head, field, tvar) \ - for ((var) = LIST_FIRST((head)); \ - (var) && ((tvar) = LIST_NEXT((var), field), 1); \ - (var) = (tvar)) - -#define LIST_INIT(head) do { \ - LIST_FIRST((head)) = NULL; \ -} while (0) - -#define LIST_INSERT_AFTER(listelm, elm, field) do { \ - QMD_LIST_CHECK_NEXT(listelm, field); \ - if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\ - LIST_NEXT((listelm), field)->field.le_prev = \ - &LIST_NEXT((elm), field); \ - LIST_NEXT((listelm), field) = (elm); \ - (elm)->field.le_prev = &LIST_NEXT((listelm), field); \ -} while (0) - -#define LIST_INSERT_BEFORE(listelm, elm, field) do { \ - QMD_LIST_CHECK_PREV(listelm, field); \ - (elm)->field.le_prev = (listelm)->field.le_prev; \ - LIST_NEXT((elm), field) = (listelm); \ - *(listelm)->field.le_prev = (elm); \ - (listelm)->field.le_prev = &LIST_NEXT((elm), field); \ -} while (0) - -#define LIST_INSERT_HEAD(head, elm, field) do { \ - QMD_LIST_CHECK_HEAD((head), field); \ - if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \ - LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\ - LIST_FIRST((head)) = (elm); \ - (elm)->field.le_prev = &LIST_FIRST((head)); \ -} while (0) - -#define LIST_NEXT(elm, field) ((elm)->field.le_next) - -#define LIST_REMOVE(elm, field) do { \ - QMD_SAVELINK(oldnext, (elm)->field.le_next); \ - QMD_SAVELINK(oldprev, (elm)->field.le_prev); \ - QMD_LIST_CHECK_NEXT(elm, field); \ - QMD_LIST_CHECK_PREV(elm, field); \ - if (LIST_NEXT((elm), field) != NULL) \ - LIST_NEXT((elm), field)->field.le_prev = \ - (elm)->field.le_prev; \ - *(elm)->field.le_prev = LIST_NEXT((elm), field); \ - TRASHIT(*oldnext); \ - TRASHIT(*oldprev); \ -} while (0) - -#define LIST_SWAP(head1, head2, type, field) do { \ - struct type *swap_tmp = LIST_FIRST((head1)); \ - LIST_FIRST((head1)) = LIST_FIRST((head2)); \ - LIST_FIRST((head2)) = swap_tmp; \ - if ((swap_tmp = LIST_FIRST((head1))) != NULL) \ - swap_tmp->field.le_prev = &LIST_FIRST((head1)); \ - if ((swap_tmp = LIST_FIRST((head2))) != NULL) \ - swap_tmp->field.le_prev = &LIST_FIRST((head2)); \ -} while (0) - -/* - * Tail queue declarations. - */ -#define TAILQ_HEAD(name, type) \ -struct name { \ - struct type *tqh_first; /* first element */ \ - struct type **tqh_last; /* addr of last next element */ \ - TRACEBUF \ -} - -#define TAILQ_HEAD_INITIALIZER(head) \ - { NULL, &(head).tqh_first } - -#define TAILQ_ENTRY(type) \ -struct { \ - struct type *tqe_next; /* next element */ \ - struct type **tqe_prev; /* address of previous next element */ \ - TRACEBUF \ -} - -/* - * Tail queue functions. - */ -#if (defined(_KERNEL) && defined(INVARIANTS)) -#define QMD_TAILQ_CHECK_HEAD(head, field) do { \ - if (!TAILQ_EMPTY(head) && \ - TAILQ_FIRST((head))->field.tqe_prev != \ - &TAILQ_FIRST((head))) \ - panic("Bad tailq head %p first->prev != head", (head)); \ -} while (0) - -#define QMD_TAILQ_CHECK_TAIL(head, field) do { \ - if (*(head)->tqh_last != NULL) \ - panic("Bad tailq NEXT(%p->tqh_last) != NULL", (head)); \ -} while (0) - -#define QMD_TAILQ_CHECK_NEXT(elm, field) do { \ - if (TAILQ_NEXT((elm), field) != NULL && \ - TAILQ_NEXT((elm), field)->field.tqe_prev != \ - &((elm)->field.tqe_next)) \ - panic("Bad link elm %p next->prev != elm", (elm)); \ -} while (0) - -#define QMD_TAILQ_CHECK_PREV(elm, field) do { \ - if (*(elm)->field.tqe_prev != (elm)) \ - panic("Bad link elm %p prev->next != elm", (elm)); \ -} while (0) -#else -#define QMD_TAILQ_CHECK_HEAD(head, field) -#define QMD_TAILQ_CHECK_TAIL(head, headname) -#define QMD_TAILQ_CHECK_NEXT(elm, field) -#define QMD_TAILQ_CHECK_PREV(elm, field) -#endif /* (_KERNEL && INVARIANTS) */ - -#define TAILQ_CONCAT(head1, head2, field) do { \ - if (!TAILQ_EMPTY(head2)) { \ - *(head1)->tqh_last = (head2)->tqh_first; \ - (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \ - (head1)->tqh_last = (head2)->tqh_last; \ - TAILQ_INIT((head2)); \ - QMD_TRACE_HEAD(head1); \ - QMD_TRACE_HEAD(head2); \ - } \ -} while (0) - -#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) - -#define TAILQ_FIRST(head) ((head)->tqh_first) - -#define TAILQ_FOREACH(var, head, field) \ - for ((var) = TAILQ_FIRST((head)); \ - (var); \ - (var) = TAILQ_NEXT((var), field)) - -#define TAILQ_FOREACH_SAFE(var, head, field, tvar) \ - for ((var) = TAILQ_FIRST((head)); \ - (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \ - (var) = (tvar)) - -#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ - for ((var) = TAILQ_LAST((head), headname); \ - (var); \ - (var) = TAILQ_PREV((var), headname, field)) - -#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \ - for ((var) = TAILQ_LAST((head), headname); \ - (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \ - (var) = (tvar)) - -#define TAILQ_INIT(head) do { \ - TAILQ_FIRST((head)) = NULL; \ - (head)->tqh_last = &TAILQ_FIRST((head)); \ - QMD_TRACE_HEAD(head); \ -} while (0) - -#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ - QMD_TAILQ_CHECK_NEXT(listelm, field); \ - if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\ - TAILQ_NEXT((elm), field)->field.tqe_prev = \ - &TAILQ_NEXT((elm), field); \ - else { \ - (head)->tqh_last = &TAILQ_NEXT((elm), field); \ - QMD_TRACE_HEAD(head); \ - } \ - TAILQ_NEXT((listelm), field) = (elm); \ - (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); \ - QMD_TRACE_ELEM(&(elm)->field); \ - QMD_TRACE_ELEM(&listelm->field); \ -} while (0) - -#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ - QMD_TAILQ_CHECK_PREV(listelm, field); \ - (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ - TAILQ_NEXT((elm), field) = (listelm); \ - *(listelm)->field.tqe_prev = (elm); \ - (listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \ - QMD_TRACE_ELEM(&(elm)->field); \ - QMD_TRACE_ELEM(&listelm->field); \ -} while (0) - -#define TAILQ_INSERT_HEAD(head, elm, field) do { \ - QMD_TAILQ_CHECK_HEAD(head, field); \ - if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \ - TAILQ_FIRST((head))->field.tqe_prev = \ - &TAILQ_NEXT((elm), field); \ - else \ - (head)->tqh_last = &TAILQ_NEXT((elm), field); \ - TAILQ_FIRST((head)) = (elm); \ - (elm)->field.tqe_prev = &TAILQ_FIRST((head)); \ - QMD_TRACE_HEAD(head); \ - QMD_TRACE_ELEM(&(elm)->field); \ -} while (0) - -#define TAILQ_INSERT_TAIL(head, elm, field) do { \ - QMD_TAILQ_CHECK_TAIL(head, field); \ - TAILQ_NEXT((elm), field) = NULL; \ - (elm)->field.tqe_prev = (head)->tqh_last; \ - *(head)->tqh_last = (elm); \ - (head)->tqh_last = &TAILQ_NEXT((elm), field); \ - QMD_TRACE_HEAD(head); \ - QMD_TRACE_ELEM(&(elm)->field); \ -} while (0) - -#define TAILQ_LAST(head, headname) \ - (*(((struct headname *)((head)->tqh_last))->tqh_last)) - -#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) - -#define TAILQ_PREV(elm, headname, field) \ - (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) - -#define TAILQ_REMOVE(head, elm, field) do { \ - QMD_SAVELINK(oldnext, (elm)->field.tqe_next); \ - QMD_SAVELINK(oldprev, (elm)->field.tqe_prev); \ - QMD_TAILQ_CHECK_NEXT(elm, field); \ - QMD_TAILQ_CHECK_PREV(elm, field); \ - if ((TAILQ_NEXT((elm), field)) != NULL) \ - TAILQ_NEXT((elm), field)->field.tqe_prev = \ - (elm)->field.tqe_prev; \ - else { \ - (head)->tqh_last = (elm)->field.tqe_prev; \ - QMD_TRACE_HEAD(head); \ - } \ - *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \ - TRASHIT(*oldnext); \ - TRASHIT(*oldprev); \ - QMD_TRACE_ELEM(&(elm)->field); \ -} while (0) - -#define TAILQ_SWAP(head1, head2, type, field) do { \ - struct type *swap_first = (head1)->tqh_first; \ - struct type **swap_last = (head1)->tqh_last; \ - (head1)->tqh_first = (head2)->tqh_first; \ - (head1)->tqh_last = (head2)->tqh_last; \ - (head2)->tqh_first = swap_first; \ - (head2)->tqh_last = swap_last; \ - if ((swap_first = (head1)->tqh_first) != NULL) \ - swap_first->field.tqe_prev = &(head1)->tqh_first; \ - else \ - (head1)->tqh_last = &(head1)->tqh_first; \ - if ((swap_first = (head2)->tqh_first) != NULL) \ - swap_first->field.tqe_prev = &(head2)->tqh_first; \ - else \ - (head2)->tqh_last = &(head2)->tqh_first; \ -} while (0) - -#ifdef __cplusplus -} -#endif - -#endif /* !_SYS_QUEUE_H_ */ diff --git a/tools/sdk/include/esp32/rom/rtc.h b/tools/sdk/include/esp32/rom/rtc.h deleted file mode 100644 index 6d9d297746a..00000000000 --- a/tools/sdk/include/esp32/rom/rtc.h +++ /dev/null @@ -1,220 +0,0 @@ -// Copyright 2010-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. - -#ifndef _ROM_RTC_H_ -#define _ROM_RTC_H_ - -#include "ets_sys.h" - -#include -#include - -#include "soc/soc.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** \defgroup rtc_apis, rtc registers and memory related apis - * @brief rtc apis - */ - -/** @addtogroup rtc_apis - * @{ - */ - -/************************************************************************************** - * Note: * - * Some Rtc memory and registers are used, in ROM or in internal library. * - * Please do not use reserved or used rtc memory or registers. * - * * - ************************************************************************************* - * RTC Memory & Store Register usage - ************************************************************************************* - * rtc memory addr type size usage - * 0x3ff61000(0x50000000) Slow SIZE_CP Co-Processor code/Reset Entry - * 0x3ff61000+SIZE_CP Slow 4096-SIZE_CP - * 0x3ff62800 Slow 4096 Reserved - * - * 0x3ff80000(0x400c0000) Fast 8192 deep sleep entry code - * - ************************************************************************************* - * RTC store registers usage - * RTC_CNTL_STORE0_REG Reserved - * RTC_CNTL_STORE1_REG RTC_SLOW_CLK calibration value - * RTC_CNTL_STORE2_REG Boot time, low word - * RTC_CNTL_STORE3_REG Boot time, high word - * RTC_CNTL_STORE4_REG External XTAL frequency. The frequency must necessarily be even, otherwise there will be a conflict with the low bit, which is used to disable logs in the ROM code. - * RTC_CNTL_STORE5_REG APB bus frequency - * RTC_CNTL_STORE6_REG FAST_RTC_MEMORY_ENTRY - * RTC_CNTL_STORE7_REG FAST_RTC_MEMORY_CRC - ************************************************************************************* - */ - -#define RTC_SLOW_CLK_CAL_REG RTC_CNTL_STORE1_REG -#define RTC_BOOT_TIME_LOW_REG RTC_CNTL_STORE2_REG -#define RTC_BOOT_TIME_HIGH_REG RTC_CNTL_STORE3_REG -#define RTC_XTAL_FREQ_REG RTC_CNTL_STORE4_REG -#define RTC_APB_FREQ_REG RTC_CNTL_STORE5_REG -#define RTC_ENTRY_ADDR_REG RTC_CNTL_STORE6_REG -#define RTC_RESET_CAUSE_REG RTC_CNTL_STORE6_REG -#define RTC_MEMORY_CRC_REG RTC_CNTL_STORE7_REG - -#define RTC_DISABLE_ROM_LOG ((1 << 0) | (1 << 16)) //!< Disable logging from the ROM code. - -typedef enum { - AWAKE = 0, // - -#ifdef __cplusplus -extern "C" { -#endif - -void ets_secure_boot_start(void); - -void ets_secure_boot_finish(void); - -void ets_secure_boot_hash(const uint32_t *buf); - -void ets_secure_boot_obtain(void); - -int ets_secure_boot_check(uint32_t *buf); - -void ets_secure_boot_rd_iv(uint32_t *buf); - -void ets_secure_boot_rd_abstract(uint32_t *buf); - -bool ets_secure_boot_check_start(uint8_t abs_index, uint32_t iv_addr); - -int ets_secure_boot_check_finish(uint32_t *abstract); - -#ifdef __cplusplus -} -#endif - -#endif /* _ROM_SECURE_BOOT_H_ */ diff --git a/tools/sdk/include/esp32/rom/sha.h b/tools/sdk/include/esp32/rom/sha.h deleted file mode 100644 index 5dd9c9981fb..00000000000 --- a/tools/sdk/include/esp32/rom/sha.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - ROM functions for hardware SHA support. - - It is not recommended to use these functions directly. If using - them from esp-idf then use the esp_sha_lock_engine() and - esp_sha_lock_memory_block() functions in hwcrypto/sha.h to ensure - exclusive access. - */ -// 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. -#ifndef _ROM_SHA_H_ -#define _ROM_SHA_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct SHAContext { - bool start; - uint32_t total_input_bits[4]; -} SHA_CTX; - -enum SHA_TYPE { - SHA1 = 0, - SHA2_256, - SHA2_384, - SHA2_512, - - - SHA_INVALID = -1, -}; - -void ets_sha_init(SHA_CTX *ctx); - -void ets_sha_enable(void); - -void ets_sha_disable(void); - -void ets_sha_update(SHA_CTX *ctx, enum SHA_TYPE type, const uint8_t *input, size_t input_bits); - -void ets_sha_finish(SHA_CTX *ctx, enum SHA_TYPE type, uint8_t *output); - -#ifdef __cplusplus -} -#endif - -#endif /* _ROM_SHA_H_ */ diff --git a/tools/sdk/include/esp32/rom/spi_flash.h b/tools/sdk/include/esp32/rom/spi_flash.h deleted file mode 100644 index 165aaefe66b..00000000000 --- a/tools/sdk/include/esp32/rom/spi_flash.h +++ /dev/null @@ -1,549 +0,0 @@ -// Copyright 2010-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. - -#ifndef _ROM_SPI_FLASH_H_ -#define _ROM_SPI_FLASH_H_ - -#include -#include - -#include "esp_attr.h" - -#include "soc/spi_reg.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** \defgroup spi_flash_apis, spi flash operation related apis - * @brief spi_flash apis - */ - -/** @addtogroup spi_flash_apis - * @{ - */ - -/************************************************************* - * Note - ************************************************************* - * 1. ESP32 chip have 4 SPI slave/master, however, SPI0 is - * used as an SPI master to access Flash and ext-SRAM by - * Cache module. It will support Decryto read for Flash, - * read/write for ext-SRAM. And SPI1 is also used as an - * SPI master for Flash read/write and ext-SRAM read/write. - * It will support Encrypto write for Flash. - * 2. As an SPI master, SPI support Highest clock to 80M, - * however, Flash with 80M Clock should be configured - * for different Flash chips. If you want to use 80M - * clock We should use the SPI that is certified by - * Espressif. However, the certification is not started - * at the time, so please use 40M clock at the moment. - * 3. SPI Flash can use 2 lines or 4 lines mode. If you - * use 2 lines mode, you can save two pad SPIHD and - * SPIWP for gpio. ESP32 support configured SPI pad for - * Flash, the configuration is stored in efuse and flash. - * However, the configurations of pads should be certified - * by Espressif. If you use this function, please use 40M - * clock at the moment. - * 4. ESP32 support to use Common SPI command to configure - * Flash to QIO mode, if you failed to configure with fix - * command. With Common SPI Command, ESP32 can also provide - * a way to use same Common SPI command groups on different - * Flash chips. - * 5. This functions are not protected by packeting, Please use the - ************************************************************* - */ - -#define PERIPHS_SPI_FLASH_CMD SPI_CMD_REG(1) -#define PERIPHS_SPI_FLASH_ADDR SPI_ADDR_REG(1) -#define PERIPHS_SPI_FLASH_CTRL SPI_CTRL_REG(1) -#define PERIPHS_SPI_FLASH_CTRL1 SPI_CTRL1_REG(1) -#define PERIPHS_SPI_FLASH_STATUS SPI_RD_STATUS_REG(1) -#define PERIPHS_SPI_FLASH_USRREG SPI_USER_REG(1) -#define PERIPHS_SPI_FLASH_USRREG1 SPI_USER1_REG(1) -#define PERIPHS_SPI_FLASH_USRREG2 SPI_USER2_REG(1) -#define PERIPHS_SPI_FLASH_C0 SPI_W0_REG(1) -#define PERIPHS_SPI_FLASH_C1 SPI_W1_REG(1) -#define PERIPHS_SPI_FLASH_C2 SPI_W2_REG(1) -#define PERIPHS_SPI_FLASH_C3 SPI_W3_REG(1) -#define PERIPHS_SPI_FLASH_C4 SPI_W4_REG(1) -#define PERIPHS_SPI_FLASH_C5 SPI_W5_REG(1) -#define PERIPHS_SPI_FLASH_C6 SPI_W6_REG(1) -#define PERIPHS_SPI_FLASH_C7 SPI_W7_REG(1) -#define PERIPHS_SPI_FLASH_TX_CRC SPI_TX_CRC_REG(1) - -#define SPI0_R_QIO_DUMMY_CYCLELEN 3 -#define SPI0_R_QIO_ADDR_BITSLEN 31 -#define SPI0_R_FAST_DUMMY_CYCLELEN 7 -#define SPI0_R_DIO_DUMMY_CYCLELEN 1 -#define SPI0_R_DIO_ADDR_BITSLEN 27 -#define SPI0_R_FAST_ADDR_BITSLEN 23 -#define SPI0_R_SIO_ADDR_BITSLEN 23 - -#define SPI1_R_QIO_DUMMY_CYCLELEN 3 -#define SPI1_R_QIO_ADDR_BITSLEN 31 -#define SPI1_R_FAST_DUMMY_CYCLELEN 7 -#define SPI1_R_DIO_DUMMY_CYCLELEN 3 -#define SPI1_R_DIO_ADDR_BITSLEN 31 -#define SPI1_R_FAST_ADDR_BITSLEN 23 -#define SPI1_R_SIO_ADDR_BITSLEN 23 - -#define ESP_ROM_SPIFLASH_W_SIO_ADDR_BITSLEN 23 - -#define ESP_ROM_SPIFLASH_TWO_BYTE_STATUS_EN SPI_WRSR_2B - -//SPI address register -#define ESP_ROM_SPIFLASH_BYTES_LEN 24 -#define ESP_ROM_SPIFLASH_BUFF_BYTE_WRITE_NUM 32 -#define ESP_ROM_SPIFLASH_BUFF_BYTE_READ_NUM 64 -#define ESP_ROM_SPIFLASH_BUFF_BYTE_READ_BITS 0x3f - -//SPI status register -#define ESP_ROM_SPIFLASH_BUSY_FLAG BIT0 -#define ESP_ROM_SPIFLASH_WRENABLE_FLAG BIT1 -#define ESP_ROM_SPIFLASH_BP0 BIT2 -#define ESP_ROM_SPIFLASH_BP1 BIT3 -#define ESP_ROM_SPIFLASH_BP2 BIT4 -#define ESP_ROM_SPIFLASH_WR_PROTECT (ESP_ROM_SPIFLASH_BP0|ESP_ROM_SPIFLASH_BP1|ESP_ROM_SPIFLASH_BP2) -#define ESP_ROM_SPIFLASH_QE BIT9 - -#define FLASH_ID_GD25LQ32C 0xC86016 - -typedef enum { - ESP_ROM_SPIFLASH_QIO_MODE = 0, - ESP_ROM_SPIFLASH_QOUT_MODE, - ESP_ROM_SPIFLASH_DIO_MODE, - ESP_ROM_SPIFLASH_DOUT_MODE, - ESP_ROM_SPIFLASH_FASTRD_MODE, - ESP_ROM_SPIFLASH_SLOWRD_MODE -} esp_rom_spiflash_read_mode_t; - -typedef enum { - ESP_ROM_SPIFLASH_RESULT_OK, - ESP_ROM_SPIFLASH_RESULT_ERR, - ESP_ROM_SPIFLASH_RESULT_TIMEOUT -} esp_rom_spiflash_result_t; - -typedef struct { - uint32_t device_id; - uint32_t chip_size; // chip size in bytes - uint32_t block_size; - uint32_t sector_size; - uint32_t page_size; - uint32_t status_mask; -} esp_rom_spiflash_chip_t; - -typedef struct { - uint8_t data_length; - uint8_t read_cmd0; - uint8_t read_cmd1; - uint8_t write_cmd; - uint16_t data_mask; - uint16_t data; -} esp_rom_spiflash_common_cmd_t; - -/** - * @brief Fix the bug in SPI hardware communication with Flash/Ext-SRAM in High Speed. - * Please do not call this function in SDK. - * - * @param uint8_t spi: 0 for SPI0(Cache Access), 1 for SPI1(Flash read/write). - * - * @param uint8_t freqdiv: Pll is 80M, 4 for 20M, 3 for 26.7M, 2 for 40M, 1 for 80M. - * - * @return None - */ -void esp_rom_spiflash_fix_dummylen(uint8_t spi, uint8_t freqdiv); - -/** - * @brief Select SPI Flash to QIO mode when WP pad is read from Flash. - * Please do not call this function in SDK. - * - * @param uint8_t wp_gpio_num: WP gpio number. - * - * @param uint32_t ishspi: 0 for spi, 1 for hspi, flash pad decided by strapping - * else, bit[5:0] spiclk, bit[11:6] spiq, bit[17:12] spid, bit[23:18] spics0, bit[29:24] spihd - * - * @return None - */ -void esp_rom_spiflash_select_qiomode(uint8_t wp_gpio_num, uint32_t ishspi); - -/** - * @brief Set SPI Flash pad drivers. - * Please do not call this function in SDK. - * - * @param uint8_t wp_gpio_num: WP gpio number. - * - * @param uint32_t ishspi: 0 for spi, 1 for hspi, flash pad decided by strapping - * else, bit[5:0] spiclk, bit[11:6] spiq, bit[17:12] spid, bit[23:18] spics0, bit[29:24] spihd - * - * @param uint8_t *drvs: drvs[0]-bit[3:0] for cpiclk, bit[7:4] for spiq, drvs[1]-bit[3:0] for spid, drvs[1]-bit[7:4] for spid - * drvs[2]-bit[3:0] for spihd, drvs[2]-bit[7:4] for spiwp. - * Values usually read from falsh by rom code, function usually callde by rom code. - * if value with bit(3) set, the value is valid, bit[2:0] is the real value. - * - * @return None - */ -void esp_rom_spiflash_set_drvs(uint8_t wp_gpio_num, uint32_t ishspi, uint8_t *drvs); - -/** - * @brief Select SPI Flash function for pads. - * Please do not call this function in SDK. - * - * @param uint32_t ishspi: 0 for spi, 1 for hspi, flash pad decided by strapping - * else, bit[5:0] spiclk, bit[11:6] spiq, bit[17:12] spid, bit[23:18] spics0, bit[29:24] spihd - * - * @return None - */ -void esp_rom_spiflash_select_padsfunc(uint32_t ishspi); - -/** - * @brief SPI Flash init, clock divisor is 4, use 1 line Slow read mode. - * Please do not call this function in SDK. - * - * @param uint32_t ishspi: 0 for spi, 1 for hspi, flash pad decided by strapping - * else, bit[5:0] spiclk, bit[11:6] spiq, bit[17:12] spid, bit[23:18] spics0, bit[29:24] spihd - * - * @param uint8_t legacy: In legacy mode, more SPI command is used in line. - * - * @return None - */ -void esp_rom_spiflash_attach(uint32_t ishspi, bool legacy); - -/** - * @brief SPI Read Flash status register. We use CMD 0x05 (RDSR). - * Please do not call this function in SDK. - * - * @param esp_rom_spiflash_chip_t *spi : The information for Flash, which is exported from ld file. - * - * @param uint32_t *status : The pointer to which to return the Flash status value. - * - * @return ESP_ROM_SPIFLASH_RESULT_OK : read OK. - * ESP_ROM_SPIFLASH_RESULT_ERR : read error. - * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : read timeout. - */ -esp_rom_spiflash_result_t esp_rom_spiflash_read_status(esp_rom_spiflash_chip_t *spi, uint32_t *status); - -/** - * @brief SPI Read Flash status register bits 8-15. We use CMD 0x35 (RDSR2). - * Please do not call this function in SDK. - * - * @param esp_rom_spiflash_chip_t *spi : The information for Flash, which is exported from ld file. - * - * @param uint32_t *status : The pointer to which to return the Flash status value. - * - * @return ESP_ROM_SPIFLASH_RESULT_OK : read OK. - * ESP_ROM_SPIFLASH_RESULT_ERR : read error. - * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : read timeout. - */ -esp_rom_spiflash_result_t esp_rom_spiflash_read_statushigh(esp_rom_spiflash_chip_t *spi, uint32_t *status); - -/** - * @brief Write status to Falsh status register. - * Please do not call this function in SDK. - * - * @param esp_rom_spiflash_chip_t *spi : The information for Flash, which is exported from ld file. - * - * @param uint32_t status_value : Value to . - * - * @return ESP_ROM_SPIFLASH_RESULT_OK : write OK. - * ESP_ROM_SPIFLASH_RESULT_ERR : write error. - * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : write timeout. - */ -esp_rom_spiflash_result_t esp_rom_spiflash_write_status(esp_rom_spiflash_chip_t *spi, uint32_t status_value); - -/** - * @brief Use a command to Read Flash status register. - * Please do not call this function in SDK. - * - * @param esp_rom_spiflash_chip_t *spi : The information for Flash, which is exported from ld file. - * - * @param uint32_t*status : The pointer to which to return the Flash status value. - * - * @return ESP_ROM_SPIFLASH_RESULT_OK : read OK. - * ESP_ROM_SPIFLASH_RESULT_ERR : read error. - * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : read timeout. - */ -esp_rom_spiflash_result_t esp_rom_spiflash_read_user_cmd(uint32_t *status, uint8_t cmd); - -/** - * @brief Config SPI Flash read mode when init. - * Please do not call this function in SDK. - * - * @param esp_rom_spiflash_read_mode_t mode : QIO/QOUT/DIO/DOUT/FastRD/SlowRD. - * - * This function does not try to set the QIO Enable bit in the status register, caller is responsible for this. - * - * @return ESP_ROM_SPIFLASH_RESULT_OK : config OK. - * ESP_ROM_SPIFLASH_RESULT_ERR : config error. - * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : config timeout. - */ -esp_rom_spiflash_result_t esp_rom_spiflash_config_readmode(esp_rom_spiflash_read_mode_t mode); - -/** - * @brief Config SPI Flash clock divisor. - * Please do not call this function in SDK. - * - * @param uint8_t freqdiv: clock divisor. - * - * @param uint8_t spi: 0 for SPI0, 1 for SPI1. - * - * @return ESP_ROM_SPIFLASH_RESULT_OK : config OK. - * ESP_ROM_SPIFLASH_RESULT_ERR : config error. - * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : config timeout. - */ -esp_rom_spiflash_result_t esp_rom_spiflash_config_clk(uint8_t freqdiv, uint8_t spi); - -/** - * @brief Send CommonCmd to Flash so that is can go into QIO mode, some Flash use different CMD. - * Please do not call this function in SDK. - * - * @param esp_rom_spiflash_common_cmd_t *cmd : A struct to show the action of a command. - * - * @return uint16_t 0 : do not send command any more. - * 1 : go to the next command. - * n > 1 : skip (n - 1) commands. - */ -uint16_t esp_rom_spiflash_common_cmd(esp_rom_spiflash_common_cmd_t *cmd); - -/** - * @brief Unlock SPI write protect. - * Please do not call this function in SDK. - * - * @param None. - * - * @return ESP_ROM_SPIFLASH_RESULT_OK : Unlock OK. - * ESP_ROM_SPIFLASH_RESULT_ERR : Unlock error. - * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Unlock timeout. - */ -esp_rom_spiflash_result_t esp_rom_spiflash_unlock(void); - -/** - * @brief SPI write protect. - * Please do not call this function in SDK. - * - * @param None. - * - * @return ESP_ROM_SPIFLASH_RESULT_OK : Lock OK. - * ESP_ROM_SPIFLASH_RESULT_ERR : Lock error. - * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Lock timeout. - */ -esp_rom_spiflash_result_t esp_rom_spiflash_lock(void); - -/** - * @brief Update SPI Flash parameter. - * Please do not call this function in SDK. - * - * @param uint32_t deviceId : Device ID read from SPI, the low 32 bit. - * - * @param uint32_t chip_size : The Flash size. - * - * @param uint32_t block_size : The Flash block size. - * - * @param uint32_t sector_size : The Flash sector size. - * - * @param uint32_t page_size : The Flash page size. - * - * @param uint32_t status_mask : The Mask used when read status from Flash(use single CMD). - * - * @return ESP_ROM_SPIFLASH_RESULT_OK : Update OK. - * ESP_ROM_SPIFLASH_RESULT_ERR : Update error. - * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Update timeout. - */ -esp_rom_spiflash_result_t esp_rom_spiflash_config_param(uint32_t deviceId, uint32_t chip_size, uint32_t block_size, - uint32_t sector_size, uint32_t page_size, uint32_t status_mask); - -/** - * @brief Erase whole flash chip. - * Please do not call this function in SDK. - * - * @param None - * - * @return ESP_ROM_SPIFLASH_RESULT_OK : Erase OK. - * ESP_ROM_SPIFLASH_RESULT_ERR : Erase error. - * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Erase timeout. - */ -esp_rom_spiflash_result_t esp_rom_spiflash_erase_chip(void); - -/** - * @brief Erase a 64KB block of flash - * Uses SPI flash command D8H. - * Please do not call this function in SDK. - * - * @param uint32_t block_num : Which block to erase. - * - * @return ESP_ROM_SPIFLASH_RESULT_OK : Erase OK. - * ESP_ROM_SPIFLASH_RESULT_ERR : Erase error. - * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Erase timeout. - */ -esp_rom_spiflash_result_t esp_rom_spiflash_erase_block(uint32_t block_num); - -/** - * @brief Erase a sector of flash. - * Uses SPI flash command 20H. - * Please do not call this function in SDK. - * - * @param uint32_t sector_num : Which sector to erase. - * - * @return ESP_ROM_SPIFLASH_RESULT_OK : Erase OK. - * ESP_ROM_SPIFLASH_RESULT_ERR : Erase error. - * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Erase timeout. - */ -esp_rom_spiflash_result_t esp_rom_spiflash_erase_sector(uint32_t sector_num); - -/** - * @brief Erase some sectors. - * Please do not call this function in SDK. - * - * @param uint32_t start_addr : Start addr to erase, should be sector aligned. - * - * @param uint32_t area_len : Length to erase, should be sector aligned. - * - * @return ESP_ROM_SPIFLASH_RESULT_OK : Erase OK. - * ESP_ROM_SPIFLASH_RESULT_ERR : Erase error. - * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Erase timeout. - */ -esp_rom_spiflash_result_t esp_rom_spiflash_erase_area(uint32_t start_addr, uint32_t area_len); - -/** - * @brief Write Data to Flash, you should Erase it yourself if need. - * Please do not call this function in SDK. - * - * @param uint32_t dest_addr : Address to write, should be 4 bytes aligned. - * - * @param const uint32_t *src : The pointer to data which is to write. - * - * @param uint32_t len : Length to write, should be 4 bytes aligned. - * - * @return ESP_ROM_SPIFLASH_RESULT_OK : Write OK. - * ESP_ROM_SPIFLASH_RESULT_ERR : Write error. - * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Write timeout. - */ -esp_rom_spiflash_result_t esp_rom_spiflash_write(uint32_t dest_addr, const uint32_t *src, int32_t len); - -/** - * @brief Read Data from Flash, you should Erase it yourself if need. - * Please do not call this function in SDK. - * - * @param uint32_t src_addr : Address to read, should be 4 bytes aligned. - * - * @param uint32_t *dest : The buf to read the data. - * - * @param uint32_t len : Length to read, should be 4 bytes aligned. - * - * @return ESP_ROM_SPIFLASH_RESULT_OK : Read OK. - * ESP_ROM_SPIFLASH_RESULT_ERR : Read error. - * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Read timeout. - */ -esp_rom_spiflash_result_t esp_rom_spiflash_read(uint32_t src_addr, uint32_t *dest, int32_t len); - -/** - * @brief SPI1 go into encrypto mode. - * Please do not call this function in SDK. - * - * @param None - * - * @return None - */ -void esp_rom_spiflash_write_encrypted_enable(void); - -/** - * @brief Prepare 32 Bytes data to encrpto writing, you should Erase it yourself if need. - * Please do not call this function in SDK. - * - * @param uint32_t flash_addr : Address to write, should be 32 bytes aligned. - * - * @param uint32_t *data : The pointer to data which is to write. - * - * @return ESP_ROM_SPIFLASH_RESULT_OK : Prepare OK. - * ESP_ROM_SPIFLASH_RESULT_ERR : Prepare error. - * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Prepare timeout. - */ -esp_rom_spiflash_result_t esp_rom_spiflash_prepare_encrypted_data(uint32_t flash_addr, uint32_t *data); - -/** - * @brief SPI1 go out of encrypto mode. - * Please do not call this function in SDK. - * - * @param None - * - * @return None - */ -void esp_rom_spiflash_write_encrypted_disable(void); - -/** - * @brief Write data to flash with transparent encryption. - * @note Sectors to be written should already be erased. - * - * @note Please do not call this function in SDK. - * - * @param uint32_t flash_addr : Address to write, should be 32 byte aligned. - * - * @param uint32_t *data : The pointer to data to write. Note, this pointer must - * be 32 bit aligned and the content of the data will be - * modified by the encryption function. - * - * @param uint32_t len : Length to write, should be 32 bytes aligned. - * - * @return ESP_ROM_SPIFLASH_RESULT_OK : Data written successfully. - * ESP_ROM_SPIFLASH_RESULT_ERR : Encryption write error. - * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Encrypto write timeout. - */ -esp_rom_spiflash_result_t esp_rom_spiflash_write_encrypted(uint32_t flash_addr, uint32_t *data, uint32_t len); - - -/** @brief Wait until SPI flash write operation is complete - * - * @note Please do not call this function in SDK. - * - * Reads the Write In Progress bit of the SPI flash status register, - * repeats until this bit is zero (indicating write complete). - * - * @return ESP_ROM_SPIFLASH_RESULT_OK : Write is complete - * ESP_ROM_SPIFLASH_RESULT_ERR : Error while reading status. - */ -esp_rom_spiflash_result_t esp_rom_spiflash_wait_idle(esp_rom_spiflash_chip_t *spi); - - -/** @brief Enable Quad I/O pin functions - * - * @note Please do not call this function in SDK. - * - * Sets the HD & WP pin functions for Quad I/O modes, based on the - * efuse SPI pin configuration. - * - * @param wp_gpio_num - Number of the WP pin to reconfigure for quad I/O. - * - * @param spiconfig - Pin configuration, as returned from ets_efuse_get_spiconfig(). - * - If this parameter is 0, default SPI pins are used and wp_gpio_num parameter is ignored. - * - If this parameter is 1, default HSPI pins are used and wp_gpio_num parameter is ignored. - * - For other values, this parameter encodes the HD pin number and also the CLK pin number. CLK pin selection is used - * to determine if HSPI or SPI peripheral will be used (use HSPI if CLK pin is the HSPI clock pin, otherwise use SPI). - * Both HD & WP pins are configured via GPIO matrix to map to the selected peripheral. - */ -void esp_rom_spiflash_select_qio_pins(uint8_t wp_gpio_num, uint32_t spiconfig); - -/** @brief Global esp_rom_spiflash_chip_t structure used by ROM functions - * - */ -extern esp_rom_spiflash_chip_t g_rom_flashchip; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* _ROM_SPI_FLASH_H_ */ diff --git a/tools/sdk/include/esp32/rom/tbconsole.h b/tools/sdk/include/esp32/rom/tbconsole.h deleted file mode 100644 index 891c2732a53..00000000000 --- a/tools/sdk/include/esp32/rom/tbconsole.h +++ /dev/null @@ -1,27 +0,0 @@ -// 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. -#ifndef _ROM_TBCONSOLE_H_ -#define _ROM_TBCONSOLE_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -void start_tb_console(); - -#ifdef __cplusplus -} -#endif - -#endif /* _ROM_TBCONSOLE_H_ */ diff --git a/tools/sdk/include/esp32/rom/tjpgd.h b/tools/sdk/include/esp32/rom/tjpgd.h deleted file mode 100644 index 31fbc97cce9..00000000000 --- a/tools/sdk/include/esp32/rom/tjpgd.h +++ /dev/null @@ -1,99 +0,0 @@ -/*----------------------------------------------------------------------------/ -/ TJpgDec - Tiny JPEG Decompressor include file (C)ChaN, 2012 -/----------------------------------------------------------------------------*/ -#ifndef _TJPGDEC -#define _TJPGDEC -/*---------------------------------------------------------------------------*/ -/* System Configurations */ - -#define JD_SZBUF 512 /* Size of stream input buffer */ -#define JD_FORMAT 0 /* Output pixel format 0:RGB888 (3 BYTE/pix), 1:RGB565 (1 WORD/pix) */ -#define JD_USE_SCALE 1 /* Use descaling feature for output */ -#define JD_TBLCLIP 1 /* Use table for saturation (might be a bit faster but increases 1K bytes of code size) */ - -/*---------------------------------------------------------------------------*/ - -#ifdef __cplusplus -extern "C" { -#endif - -/* These types must be 16-bit, 32-bit or larger integer */ -typedef int INT; -typedef unsigned int UINT; - -/* These types must be 8-bit integer */ -typedef char CHAR; -typedef unsigned char UCHAR; -typedef unsigned char BYTE; - -/* These types must be 16-bit integer */ -typedef short SHORT; -typedef unsigned short USHORT; -typedef unsigned short WORD; -typedef unsigned short WCHAR; - -/* These types must be 32-bit integer */ -typedef long LONG; -typedef unsigned long ULONG; -typedef unsigned long DWORD; - - -/* Error code */ -typedef enum { - JDR_OK = 0, /* 0: Succeeded */ - JDR_INTR, /* 1: Interrupted by output function */ - JDR_INP, /* 2: Device error or wrong termination of input stream */ - JDR_MEM1, /* 3: Insufficient memory pool for the image */ - JDR_MEM2, /* 4: Insufficient stream input buffer */ - JDR_PAR, /* 5: Parameter error */ - JDR_FMT1, /* 6: Data format error (may be damaged data) */ - JDR_FMT2, /* 7: Right format but not supported */ - JDR_FMT3 /* 8: Not supported JPEG standard */ -} JRESULT; - - - -/* Rectangular structure */ -typedef struct { - WORD left, right, top, bottom; -} JRECT; - - - -/* Decompressor object structure */ -typedef struct JDEC JDEC; -struct JDEC { - UINT dctr; /* Number of bytes available in the input buffer */ - BYTE* dptr; /* Current data read ptr */ - BYTE* inbuf; /* Bit stream input buffer */ - BYTE dmsk; /* Current bit in the current read byte */ - BYTE scale; /* Output scaling ratio */ - BYTE msx, msy; /* MCU size in unit of block (width, height) */ - BYTE qtid[3]; /* Quantization table ID of each component */ - SHORT dcv[3]; /* Previous DC element of each component */ - WORD nrst; /* Restart inverval */ - UINT width, height; /* Size of the input image (pixel) */ - BYTE* huffbits[2][2]; /* Huffman bit distribution tables [id][dcac] */ - WORD* huffcode[2][2]; /* Huffman code word tables [id][dcac] */ - BYTE* huffdata[2][2]; /* Huffman decoded data tables [id][dcac] */ - LONG* qttbl[4]; /* Dequaitizer tables [id] */ - void* workbuf; /* Working buffer for IDCT and RGB output */ - BYTE* mcubuf; /* Working buffer for the MCU */ - void* pool; /* Pointer to available memory pool */ - UINT sz_pool; /* Size of momory pool (bytes available) */ - UINT (*infunc)(JDEC*, BYTE*, UINT);/* Pointer to jpeg stream input function */ - void* device; /* Pointer to I/O device identifiler for the session */ -}; - - - -/* TJpgDec API functions */ -JRESULT jd_prepare (JDEC*, UINT(*)(JDEC*,BYTE*,UINT), void*, UINT, void*); -JRESULT jd_decomp (JDEC*, UINT(*)(JDEC*,void*,JRECT*), BYTE); - - -#ifdef __cplusplus -} -#endif - -#endif /* _TJPGDEC */ diff --git a/tools/sdk/include/esp32/rom/uart.h b/tools/sdk/include/esp32/rom/uart.h deleted file mode 100644 index 87224457343..00000000000 --- a/tools/sdk/include/esp32/rom/uart.h +++ /dev/null @@ -1,420 +0,0 @@ -// Copyright 2010-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. - -#ifndef _ROM_UART_H_ -#define _ROM_UART_H_ - -#include "esp_types.h" -#include "esp_attr.h" -#include "ets_sys.h" -#include "soc/soc.h" -#include "soc/uart_reg.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** \defgroup uart_apis, uart configuration and communication related apis - * @brief uart apis - */ - -/** @addtogroup uart_apis - * @{ - */ - -#define RX_BUFF_SIZE 0x100 -#define TX_BUFF_SIZE 100 - -//uart int enalbe register ctrl bits -#define UART_RCV_INTEN BIT0 -#define UART_TRX_INTEN BIT1 -#define UART_LINE_STATUS_INTEN BIT2 - -//uart int identification ctrl bits -#define UART_INT_FLAG_MASK 0x0E - -//uart fifo ctrl bits -#define UART_CLR_RCV_FIFO BIT1 -#define UART_CLR_TRX_FIFO BIT2 -#define UART_RCVFIFO_TRG_LVL_BITS BIT6 - -//uart line control bits -#define UART_DIV_LATCH_ACCESS_BIT BIT7 - -//uart line status bits -#define UART_RCV_DATA_RDY_FLAG BIT0 -#define UART_RCV_OVER_FLOW_FLAG BIT1 -#define UART_RCV_PARITY_ERR_FLAG BIT2 -#define UART_RCV_FRAME_ERR_FLAG BIT3 -#define UART_BRK_INT_FLAG BIT4 -#define UART_TRX_FIFO_EMPTY_FLAG BIT5 -#define UART_TRX_ALL_EMPTY_FLAG BIT6 // include fifo and shift reg -#define UART_RCV_ERR_FLAG BIT7 - -//send and receive message frame head -#define FRAME_FLAG 0x7E - -typedef enum { - UART_LINE_STATUS_INT_FLAG = 0x06, - UART_RCV_FIFO_INT_FLAG = 0x04, - UART_RCV_TMOUT_INT_FLAG = 0x0C, - UART_TXBUFF_EMPTY_INT_FLAG = 0x02 -} UartIntType; //consider bit0 for int_flag - -typedef enum { - RCV_ONE_BYTE = 0x0, - RCV_FOUR_BYTE = 0x1, - RCV_EIGHT_BYTE = 0x2, - RCV_FOURTEEN_BYTE = 0x3 -} UartRcvFifoTrgLvl; - -typedef enum { - FIVE_BITS = 0x0, - SIX_BITS = 0x1, - SEVEN_BITS = 0x2, - EIGHT_BITS = 0x3 -} UartBitsNum4Char; - -typedef enum { - ONE_STOP_BIT = 1, - ONE_HALF_STOP_BIT = 2, - TWO_STOP_BIT = 3 -} UartStopBitsNum; - -typedef enum { - NONE_BITS = 0, - ODD_BITS = 2, - EVEN_BITS = 3 - -} UartParityMode; - -typedef enum { - STICK_PARITY_DIS = 0, - STICK_PARITY_EN = 2 -} UartExistParity; - -typedef enum { - BIT_RATE_9600 = 9600, - BIT_RATE_19200 = 19200, - BIT_RATE_38400 = 38400, - BIT_RATE_57600 = 57600, - BIT_RATE_115200 = 115200, - BIT_RATE_230400 = 230400, - BIT_RATE_460800 = 460800, - BIT_RATE_921600 = 921600 -} UartBautRate; - -typedef enum { - NONE_CTRL, - HARDWARE_CTRL, - XON_XOFF_CTRL -} UartFlowCtrl; - -typedef enum { - EMPTY, - UNDER_WRITE, - WRITE_OVER -} RcvMsgBuffState; - -typedef struct { - uint8_t *pRcvMsgBuff; - uint8_t *pWritePos; - uint8_t *pReadPos; - uint8_t TrigLvl; - RcvMsgBuffState BuffState; -} RcvMsgBuff; - -typedef struct { - uint32_t TrxBuffSize; - uint8_t *pTrxBuff; -} TrxMsgBuff; - -typedef enum { - BAUD_RATE_DET, - WAIT_SYNC_FRM, - SRCH_MSG_HEAD, - RCV_MSG_BODY, - RCV_ESC_CHAR, -} RcvMsgState; - -typedef struct { - UartBautRate baut_rate; - UartBitsNum4Char data_bits; - UartExistParity exist_parity; - UartParityMode parity; // chip size in byte - UartStopBitsNum stop_bits; - UartFlowCtrl flow_ctrl; - uint8_t buff_uart_no; //indicate which uart use tx/rx buffer - uint8_t tx_uart_no; - RcvMsgBuff rcv_buff; -// TrxMsgBuff trx_buff; - RcvMsgState rcv_state; - int received; -} UartDevice; - -/** - * @brief Init uart device struct value and reset uart0/uart1 rx. - * Please do not call this function in SDK. - * - * @param None - * - * @return None - */ -void uartAttach(void); - -/** - * @brief Init uart0 or uart1 for UART download booting mode. - * Please do not call this function in SDK. - * - * @param uint8_t uart_no : 0 for UART0, else for UART1. - * - * @param uint32_t clock : clock used by uart module, to adjust baudrate. - * - * @return None - */ -void Uart_Init(uint8_t uart_no, uint32_t clock); - -/** - * @brief Modify uart baudrate. - * This function will reset RX/TX fifo for uart. - * - * @param uint8_t uart_no : 0 for UART0, 1 for UART1. - * - * @param uint32_t DivLatchValue : (clock << 4)/baudrate. - * - * @return None - */ -void uart_div_modify(uint8_t uart_no, uint32_t DivLatchValue); - -/** - * @brief Init uart0 or uart1 for UART download booting mode. - * Please do not call this function in SDK. - * - * @param uint8_t uart_no : 0 for UART0, 1 for UART1. - * - * @param uint8_t is_sync : 0, only one UART module, easy to detect, wait until detected; - * 1, two UART modules, hard to detect, detect and return. - * - * @return None - */ -int uart_baudrate_detect(uint8_t uart_no, uint8_t is_sync); - -/** - * @brief Switch printf channel of uart_tx_one_char. - * Please do not call this function when printf. - * - * @param uint8_t uart_no : 0 for UART0, 1 for UART1. - * - * @return None - */ -void uart_tx_switch(uint8_t uart_no); - -/** - * @brief Switch message exchange channel for UART download booting. - * Please do not call this function in SDK. - * - * @param uint8_t uart_no : 0 for UART0, 1 for UART1. - * - * @return None - */ -void uart_buff_switch(uint8_t uart_no); - -/** - * @brief Output a char to printf channel, wait until fifo not full. - * - * @param None - * - * @return OK. - */ -STATUS uart_tx_one_char(uint8_t TxChar); - -/** - * @brief Output a char to message exchange channel, wait until fifo not full. - * Please do not call this function in SDK. - * - * @param None - * - * @return OK. - */ -STATUS uart_tx_one_char2(uint8_t TxChar); - -/** - * @brief Wait until uart tx full empty. - * - * @param uint8_t uart_no : 0 for UART0, 1 for UART1. - * - * @return None. - */ -void uart_tx_flush(uint8_t uart_no); - -/** - * @brief Wait until uart tx full empty and the last char send ok. - * - * @param uart_no : 0 for UART0, 1 for UART1, 2 for UART2 - * - * The function defined in ROM code has a bug, so we define the correct version - * here for compatibility. - */ -static inline void IRAM_ATTR uart_tx_wait_idle(uint8_t uart_no) { - uint32_t status; - do { - status = READ_PERI_REG(UART_STATUS_REG(uart_no)); - /* either tx count or state is non-zero */ - } while ((status & (UART_ST_UTX_OUT_M | UART_TXFIFO_CNT_M)) != 0); -} - -/** - * @brief Get an input char from message channel. - * Please do not call this function in SDK. - * - * @param uint8_t *pRxChar : the pointer to store the char. - * - * @return OK for successful. - * FAIL for failed. - */ -STATUS uart_rx_one_char(uint8_t *pRxChar); - -/** - * @brief Get an input char from message channel, wait until successful. - * Please do not call this function in SDK. - * - * @param None - * - * @return char : input char value. - */ -char uart_rx_one_char_block(void); - -/** - * @brief Get an input string line from message channel. - * Please do not call this function in SDK. - * - * @param uint8_t *pString : the pointer to store the string. - * - * @param uint8_t MaxStrlen : the max string length, incude '\0'. - * - * @return OK. - */ -STATUS UartRxString(uint8_t *pString, uint8_t MaxStrlen); - -/** - * @brief Process uart recevied information in the interrupt handler. - * Please do not call this function in SDK. - * - * @param void *para : the message receive buffer. - * - * @return None - */ -void uart_rx_intr_handler(void *para); - -/** - * @brief Get an char from receive buffer. - * Please do not call this function in SDK. - * - * @param RcvMsgBuff *pRxBuff : the pointer to the struct that include receive buffer. - * - * @param uint8_t *pRxByte : the pointer to store the char. - * - * @return OK for successful. - * FAIL for failed. - */ -STATUS uart_rx_readbuff( RcvMsgBuff *pRxBuff, uint8_t *pRxByte); - -/** - * @brief Get all chars from receive buffer. - * Please do not call this function in SDK. - * - * @param uint8_t *pCmdLn : the pointer to store the string. - * - * @return OK for successful. - * FAIL for failed. - */ -STATUS UartGetCmdLn(uint8_t *pCmdLn); - -/** - * @brief Get uart configuration struct. - * Please do not call this function in SDK. - * - * @param None - * - * @return UartDevice * : uart configuration struct pointer. - */ -UartDevice *GetUartDevice(void); - -/** - * @brief Send an packet to download tool, with SLIP escaping. - * Please do not call this function in SDK. - * - * @param uint8_t *p : the pointer to output string. - * - * @param int len : the string length. - * - * @return None. - */ -void send_packet(uint8_t *p, int len); - -/** - * @brief Receive an packet from download tool, with SLIP escaping. - * Please do not call this function in SDK. - * - * @param uint8_t *p : the pointer to input string. - * - * @param int len : If string length > len, the string will be truncated. - * - * @param uint8_t is_sync : 0, only one UART module; - * 1, two UART modules. - * - * @return int : the length of the string. - */ -int recv_packet(uint8_t *p, int len, uint8_t is_sync); - -/** - * @brief Send an packet to download tool, with SLIP escaping. - * Please do not call this function in SDK. - * - * @param uint8_t *pData : the pointer to input string. - * - * @param uint16_t DataLen : the string length. - * - * @return OK for successful. - * FAIL for failed. - */ -STATUS SendMsg(uint8_t *pData, uint16_t DataLen); - -/** - * @brief Receive an packet from download tool, with SLIP escaping. - * Please do not call this function in SDK. - * - * @param uint8_t *pData : the pointer to input string. - * - * @param uint16_t MaxDataLen : If string length > MaxDataLen, the string will be truncated. - * - * @param uint8_t is_sync : 0, only one UART module; - * 1, two UART modules. - * - * @return OK for successful. - * FAIL for failed. - */ -STATUS RcvMsg(uint8_t *pData, uint16_t MaxDataLen, uint8_t is_sync); - -extern UartDevice UartDev; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* _ROM_UART_H_ */ diff --git a/tools/sdk/include/esp32/xtensa/cacheasm.h b/tools/sdk/include/esp32/xtensa/cacheasm.h deleted file mode 100644 index 225e01b320e..00000000000 --- a/tools/sdk/include/esp32/xtensa/cacheasm.h +++ /dev/null @@ -1,962 +0,0 @@ -/* - * xtensa/cacheasm.h -- assembler-specific cache related definitions - * that depend on CORE configuration - * - * This file is logically part of xtensa/coreasm.h , - * but is kept separate for modularity / compilation-performance. - */ - -/* - * Copyright (c) 2001-2014 Cadence Design Systems, Inc. - * - * 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. - */ - -#ifndef XTENSA_CACHEASM_H -#define XTENSA_CACHEASM_H - -#include -#include -#include -#include - -/* - * This header file defines assembler macros of the form: - * cache_ - * where is 'i' or 'd' for instruction and data caches, - * and indicates the function of the macro. - * - * The following functions are defined, - * and apply only to the specified cache (I or D): - * - * reset - * Resets the cache. - * - * sync - * Makes sure any previous cache instructions have been completed; - * ie. makes sure any previous cache control operations - * have had full effect and been synchronized to memory. - * Eg. any invalidate completed [so as not to generate a hit], - * any writebacks or other pipelined writes written to memory, etc. - * - * invalidate_line (single cache line) - * invalidate_region (specified memory range) - * invalidate_all (entire cache) - * Invalidates all cache entries that cache - * data from the specified memory range. - * NOTE: locked entries are not invalidated. - * - * writeback_line (single cache line) - * writeback_region (specified memory range) - * writeback_all (entire cache) - * Writes back to memory all dirty cache entries - * that cache data from the specified memory range, - * and marks these entries as clean. - * NOTE: on some future implementations, this might - * also invalidate. - * NOTE: locked entries are written back, but never invalidated. - * NOTE: instruction caches never implement writeback. - * - * writeback_inv_line (single cache line) - * writeback_inv_region (specified memory range) - * writeback_inv_all (entire cache) - * Writes back to memory all dirty cache entries - * that cache data from the specified memory range, - * and invalidates these entries (including all clean - * cache entries that cache data from that range). - * NOTE: locked entries are written back but not invalidated. - * NOTE: instruction caches never implement writeback. - * - * lock_line (single cache line) - * lock_region (specified memory range) - * Prefetch and lock the specified memory range into cache. - * NOTE: if any part of the specified memory range cannot - * be locked, a Load/Store Error (for dcache) or Instruction - * Fetch Error (for icache) exception occurs. These macros don't - * do anything special (yet anyway) to handle this situation. - * - * unlock_line (single cache line) - * unlock_region (specified memory range) - * unlock_all (entire cache) - * Unlock cache entries that cache the specified memory range. - * Entries not already locked are unaffected. - * - * coherence_on - * coherence_off - * Turn off and on cache coherence - * - */ - - - -/*************************** GENERIC -- ALL CACHES ***************************/ - - -/* - * The following macros assume the following cache size/parameter limits - * in the current Xtensa core implementation: - * cache size: 1024 bytes minimum - * line size: 16 - 64 bytes - * way count: 1 - 4 - * - * Minimum entries per way (ie. per associativity) = 1024 / 64 / 4 = 4 - * Hence the assumption that each loop can execute four cache instructions. - * - * Correspondingly, the offset range of instructions is assumed able to cover - * four lines, ie. offsets {0,1,2,3} * line_size are assumed valid for - * both hit and indexed cache instructions. Ie. these offsets are all - * valid: 0, 16, 32, 48, 64, 96, 128, 192 (for line sizes 16, 32, 64). - * This is true of all original cache instructions - * (dhi, ihi, dhwb, dhwbi, dii, iii) which have offsets - * of 0 to 1020 in multiples of 4 (ie. 8 bits shifted by 2). - * This is also true of subsequent cache instructions - * (dhu, ihu, diu, iiu, diwb, diwbi, dpfl, ipfl) which have offsets - * of 0 to 240 in multiples of 16 (ie. 4 bits shifted by 4). - * - * (Maximum cache size, currently 32k, doesn't affect the following macros. - * Cache ways > MMU min page size cause aliasing but that's another matter.) - */ - - - -/* - * Macro to apply an 'indexed' cache instruction to the entire cache. - * - * Parameters: - * cainst instruction/ that takes an address register parameter - * and an offset parameter (in range 0 .. 3*linesize). - * size size of cache in bytes - * linesize size of cache line in bytes (always power-of-2) - * assoc_or1 number of associativities (ways/sets) in cache - * if all sets affected by cainst, - * or 1 if only one set (or not all sets) of the cache - * is affected by cainst (eg. DIWB or DIWBI [not yet ISA defined]). - * aa, ab unique address registers (temporaries). - * awb set to other than a0 if wb type of instruction - * loopokay 1 allows use of zero-overhead loops, 0 does not - * immrange range (max value) of cainst's immediate offset parameter, in bytes - * (NOTE: macro assumes immrange allows power-of-2 number of lines) - */ - - .macro cache_index_all cainst, size, linesize, assoc_or1, aa, ab, loopokay, maxofs, awb=a0 - - // Number of indices in cache (lines per way): - .set .Lindices, (\size / (\linesize * \assoc_or1)) - // Number of indices processed per loop iteration (max 4): - .set .Lperloop, .Lindices - .ifgt .Lperloop - 4 - .set .Lperloop, 4 - .endif - // Also limit instructions per loop if cache line size exceeds immediate range: - .set .Lmaxperloop, (\maxofs / \linesize) + 1 - .ifgt .Lperloop - .Lmaxperloop - .set .Lperloop, .Lmaxperloop - .endif - // Avoid addi of 128 which takes two instructions (addmi,addi): - .ifeq .Lperloop*\linesize - 128 - .ifgt .Lperloop - 1 - .set .Lperloop, .Lperloop / 2 - .endif - .endif - - // \size byte cache, \linesize byte lines, \assoc_or1 way(s) affected by each \cainst. - // XCHAL_ERRATUM_497 - don't execute using loop, to reduce the amount of added code - .ifne (\loopokay & XCHAL_HAVE_LOOPS && !XCHAL_ERRATUM_497) - - movi \aa, .Lindices / .Lperloop // number of loop iterations - // Possible improvement: need only loop if \aa > 1 ; - // however \aa == 1 is highly unlikely. - movi \ab, 0 // to iterate over cache - loop \aa, .Lend_cachex\@ - .set .Li, 0 ; .rept .Lperloop - \cainst \ab, .Li*\linesize - .set .Li, .Li+1 ; .endr - addi \ab, \ab, .Lperloop*\linesize // move to next line -.Lend_cachex\@: - - .else - - movi \aa, (\size / \assoc_or1) - // Possible improvement: need only loop if \aa > 1 ; - // however \aa == 1 is highly unlikely. - movi \ab, 0 // to iterate over cache - .ifne ((\awb !=a0) & XCHAL_ERRATUM_497) // don't use awb if set to a0 - movi \awb, 0 - .endif -.Lstart_cachex\@: - .set .Li, 0 ; .rept .Lperloop - \cainst \ab, .Li*\linesize - .set .Li, .Li+1 ; .endr - .ifne ((\awb !=a0) & XCHAL_ERRATUM_497) // do memw after 8 cainst wb instructions - addi \awb, \awb, .Lperloop - blti \awb, 8, .Lstart_memw\@ - memw - movi \awb, 0 -.Lstart_memw\@: - .endif - addi \ab, \ab, .Lperloop*\linesize // move to next line - bltu \ab, \aa, .Lstart_cachex\@ - .endif - - .endm - - -/* - * Macro to apply a 'hit' cache instruction to a memory region, - * ie. to any cache entries that cache a specified portion (region) of memory. - * Takes care of the unaligned cases, ie. may apply to one - * more cache line than $asize / lineSize if $aaddr is not aligned. - * - * - * Parameters are: - * cainst instruction/macro that takes an address register parameter - * and an offset parameter (currently always zero) - * and generates a cache instruction (eg. "dhi", "dhwb", "ihi", etc.) - * linesize_log2 log2(size of cache line in bytes) - * addr register containing start address of region (clobbered) - * asize register containing size of the region in bytes (clobbered) - * askew unique register used as temporary - * awb unique register used as temporary for erratum 497. - * - * Note: A possible optimization to this macro is to apply the operation - * to the entire cache if the region exceeds the size of the cache - * by some empirically determined amount or factor. Some experimentation - * is required to determine the appropriate factors, which also need - * to be tunable if required. - */ - - .macro cache_hit_region cainst, linesize_log2, addr, asize, askew, awb=a0 - - // Make \asize the number of iterations: - extui \askew, \addr, 0, \linesize_log2 // get unalignment amount of \addr - add \asize, \asize, \askew // ... and add it to \asize - addi \asize, \asize, (1 << \linesize_log2) - 1 // round up! - srli \asize, \asize, \linesize_log2 - - // Iterate over region: - .ifne ((\awb !=a0) & XCHAL_ERRATUM_497) // don't use awb if set to a0 - movi \awb, 0 - .endif - floopnez \asize, cacheh\@ - \cainst \addr, 0 - .ifne ((\awb !=a0) & XCHAL_ERRATUM_497) // do memw after 8 cainst wb instructions - addi \awb, \awb, 1 - blti \awb, 8, .Lstart_memw\@ - memw - movi \awb, 0 -.Lstart_memw\@: - .endif - addi \addr, \addr, (1 << \linesize_log2) // move to next line - floopend \asize, cacheh\@ - .endm - - - - - -/*************************** INSTRUCTION CACHE ***************************/ - - -/* - * Reset/initialize the instruction cache by simply invalidating it: - * (need to unlock first also, if cache locking implemented): - * - * Parameters: - * aa, ab unique address registers (temporaries) - */ - .macro icache_reset aa, ab, loopokay=0 - icache_unlock_all \aa, \ab, \loopokay - icache_invalidate_all \aa, \ab, \loopokay - .endm - - -/* - * Synchronize after an instruction cache operation, - * to be sure everything is in sync with memory as to be - * expected following any previous instruction cache control operations. - * - * Even if a config doesn't have caches, an isync is still needed - * when instructions in any memory are modified, whether by a loader - * or self-modifying code. Therefore, this macro always produces - * an isync, whether or not an icache is present. - * - * Parameters are: - * ar an address register (temporary) (currently unused, but may be used in future) - */ - .macro icache_sync ar - isync - .endm - - - -/* - * Invalidate a single line of the instruction cache. - * Parameters are: - * ar address register that contains (virtual) address to invalidate - * (may get clobbered in a future implementation, but not currently) - * offset (optional) offset to add to \ar to compute effective address to invalidate - * (note: some number of lsbits are ignored) - */ - .macro icache_invalidate_line ar, offset -#if XCHAL_ICACHE_SIZE > 0 - ihi \ar, \offset // invalidate icache line - icache_sync \ar -#endif - .endm - - - - -/* - * Invalidate instruction cache entries that cache a specified portion of memory. - * Parameters are: - * astart start address (register gets clobbered) - * asize size of the region in bytes (register gets clobbered) - * ac unique register used as temporary - */ - .macro icache_invalidate_region astart, asize, ac -#if XCHAL_ICACHE_SIZE > 0 - // Instruction cache region invalidation: - cache_hit_region ihi, XCHAL_ICACHE_LINEWIDTH, \astart, \asize, \ac - icache_sync \ac - // End of instruction cache region invalidation -#endif - .endm - - - -/* - * Invalidate entire instruction cache. - * - * Parameters: - * aa, ab unique address registers (temporaries) - */ - .macro icache_invalidate_all aa, ab, loopokay=1 -#if XCHAL_ICACHE_SIZE > 0 - // Instruction cache invalidation: - cache_index_all iii, XCHAL_ICACHE_SIZE, XCHAL_ICACHE_LINESIZE, XCHAL_ICACHE_WAYS, \aa, \ab, \loopokay, 1020 - icache_sync \aa - // End of instruction cache invalidation -#endif - .endm - - - -/* - * Lock (prefetch & lock) a single line of the instruction cache. - * - * Parameters are: - * ar address register that contains (virtual) address to lock - * (may get clobbered in a future implementation, but not currently) - * offset offset to add to \ar to compute effective address to lock - * (note: some number of lsbits are ignored) - */ - .macro icache_lock_line ar, offset -#if XCHAL_ICACHE_SIZE > 0 && XCHAL_ICACHE_LINE_LOCKABLE - ipfl \ar, \offset /* prefetch and lock icache line */ - icache_sync \ar -#endif - .endm - - - -/* - * Lock (prefetch & lock) a specified portion of memory into the instruction cache. - * Parameters are: - * astart start address (register gets clobbered) - * asize size of the region in bytes (register gets clobbered) - * ac unique register used as temporary - */ - .macro icache_lock_region astart, asize, ac -#if XCHAL_ICACHE_SIZE > 0 && XCHAL_ICACHE_LINE_LOCKABLE - // Instruction cache region lock: - cache_hit_region ipfl, XCHAL_ICACHE_LINEWIDTH, \astart, \asize, \ac - icache_sync \ac - // End of instruction cache region lock -#endif - .endm - - - -/* - * Unlock a single line of the instruction cache. - * - * Parameters are: - * ar address register that contains (virtual) address to unlock - * (may get clobbered in a future implementation, but not currently) - * offset offset to add to \ar to compute effective address to unlock - * (note: some number of lsbits are ignored) - */ - .macro icache_unlock_line ar, offset -#if XCHAL_ICACHE_SIZE > 0 && XCHAL_ICACHE_LINE_LOCKABLE - ihu \ar, \offset /* unlock icache line */ - icache_sync \ar -#endif - .endm - - - -/* - * Unlock a specified portion of memory from the instruction cache. - * Parameters are: - * astart start address (register gets clobbered) - * asize size of the region in bytes (register gets clobbered) - * ac unique register used as temporary - */ - .macro icache_unlock_region astart, asize, ac -#if XCHAL_ICACHE_SIZE > 0 && XCHAL_ICACHE_LINE_LOCKABLE - // Instruction cache region unlock: - cache_hit_region ihu, XCHAL_ICACHE_LINEWIDTH, \astart, \asize, \ac - icache_sync \ac - // End of instruction cache region unlock -#endif - .endm - - - -/* - * Unlock entire instruction cache. - * - * Parameters: - * aa, ab unique address registers (temporaries) - */ - .macro icache_unlock_all aa, ab, loopokay=1 -#if XCHAL_ICACHE_SIZE > 0 && XCHAL_ICACHE_LINE_LOCKABLE - // Instruction cache unlock: - cache_index_all iiu, XCHAL_ICACHE_SIZE, XCHAL_ICACHE_LINESIZE, 1, \aa, \ab, \loopokay, 240 - icache_sync \aa - // End of instruction cache unlock -#endif - .endm - - - - - -/*************************** DATA CACHE ***************************/ - - - -/* - * Reset/initialize the data cache by simply invalidating it - * (need to unlock first also, if cache locking implemented): - * - * Parameters: - * aa, ab unique address registers (temporaries) - */ - .macro dcache_reset aa, ab, loopokay=0 - dcache_unlock_all \aa, \ab, \loopokay - dcache_invalidate_all \aa, \ab, \loopokay - .endm - - - - -/* - * Synchronize after a data cache operation, - * to be sure everything is in sync with memory as to be - * expected following any previous data cache control operations. - * - * Parameters are: - * ar an address register (temporary) (currently unused, but may be used in future) - */ - .macro dcache_sync ar, wbtype=0 -#if XCHAL_DCACHE_SIZE > 0 - // No synchronization is needed. - // (memw may be desired e.g. after writeback operation to help ensure subsequent - // external accesses are seen to follow that writeback, however that's outside - // the scope of this macro) - - //dsync - .ifne (\wbtype & XCHAL_ERRATUM_497) - memw - .endif -#endif - .endm - - - -/* - * Turn on cache coherence. - * - * WARNING: for RE-201x.x and later hardware, any interrupt that tries - * to change MEMCTL will see its changes dropped if the interrupt comes - * in the middle of this routine. If this might be an issue, call this - * routine with interrupts disabled. - * - * Parameters are: - * ar,at two scratch address registers (both clobbered) - */ - .macro cache_coherence_on ar at -#if XCHAL_DCACHE_IS_COHERENT -# if XCHAL_HW_MIN_VERSION >= XTENSA_HWVERSION_RE_2012_0 - /* Have MEMCTL. Enable snoop responses. */ - rsr.memctl \ar - movi \at, MEMCTL_SNOOP_EN - or \ar, \ar, \at - wsr.memctl \ar -# elif XCHAL_HAVE_EXTERN_REGS && XCHAL_HAVE_MX - /* Opt into coherence for MX (for backward compatibility / testing). */ - movi \ar, 1 - movi \at, XER_CCON - wer \ar, \at - extw -# endif -#endif - .endm - - - -/* - * Turn off cache coherence. - * - * NOTE: this is generally preceded by emptying the cache; - * see xthal_cache_coherence_optout() in hal/coherence.c for details. - * - * WARNING: for RE-201x.x and later hardware, any interrupt that tries - * to change MEMCTL will see its changes dropped if the interrupt comes - * in the middle of this routine. If this might be an issue, call this - * routine with interrupts disabled. - * - * Parameters are: - * ar,at two scratch address registers (both clobbered) - */ - .macro cache_coherence_off ar at -#if XCHAL_DCACHE_IS_COHERENT -# if XCHAL_HW_MIN_VERSION >= XTENSA_HWVERSION_RE_2012_0 - /* Have MEMCTL. Disable snoop responses. */ - rsr.memctl \ar - movi \at, ~MEMCTL_SNOOP_EN - and \ar, \ar, \at - wsr.memctl \ar -# elif XCHAL_HAVE_EXTERN_REGS && XCHAL_HAVE_MX - /* Opt out of coherence, for MX (for backward compatibility / testing). */ - extw - movi \at, 0 - movi \ar, XER_CCON - wer \at, \ar - extw -# endif -#endif - .endm - - - -/* - * Synchronize after a data store operation, - * to be sure the stored data is completely off the processor - * (and assuming there is no buffering outside the processor, - * that the data is in memory). This may be required to - * ensure that the processor's write buffers are emptied. - * A MEMW followed by a read guarantees this, by definition. - * We also try to make sure the read itself completes. - * - * Parameters are: - * ar an address register (temporary) - */ - .macro write_sync ar - memw // ensure previous memory accesses are complete prior to subsequent memory accesses - l32i \ar, sp, 0 // completing this read ensures any previous write has completed, because of MEMW - //slot - add \ar, \ar, \ar // use the result of the read to help ensure the read completes (in future architectures) - .endm - - -/* - * Invalidate a single line of the data cache. - * Parameters are: - * ar address register that contains (virtual) address to invalidate - * (may get clobbered in a future implementation, but not currently) - * offset (optional) offset to add to \ar to compute effective address to invalidate - * (note: some number of lsbits are ignored) - */ - .macro dcache_invalidate_line ar, offset -#if XCHAL_DCACHE_SIZE > 0 - dhi \ar, \offset - dcache_sync \ar -#endif - .endm - - - - - -/* - * Invalidate data cache entries that cache a specified portion of memory. - * Parameters are: - * astart start address (register gets clobbered) - * asize size of the region in bytes (register gets clobbered) - * ac unique register used as temporary - */ - .macro dcache_invalidate_region astart, asize, ac -#if XCHAL_DCACHE_SIZE > 0 - // Data cache region invalidation: - cache_hit_region dhi, XCHAL_DCACHE_LINEWIDTH, \astart, \asize, \ac - dcache_sync \ac - // End of data cache region invalidation -#endif - .endm - - - -/* - * Invalidate entire data cache. - * - * Parameters: - * aa, ab unique address registers (temporaries) - */ - .macro dcache_invalidate_all aa, ab, loopokay=1 -#if XCHAL_DCACHE_SIZE > 0 - // Data cache invalidation: - cache_index_all dii, XCHAL_DCACHE_SIZE, XCHAL_DCACHE_LINESIZE, XCHAL_DCACHE_WAYS, \aa, \ab, \loopokay, 1020 - dcache_sync \aa - // End of data cache invalidation -#endif - .endm - - - -/* - * Writeback a single line of the data cache. - * Parameters are: - * ar address register that contains (virtual) address to writeback - * (may get clobbered in a future implementation, but not currently) - * offset offset to add to \ar to compute effective address to writeback - * (note: some number of lsbits are ignored) - */ - .macro dcache_writeback_line ar, offset -#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_IS_WRITEBACK - dhwb \ar, \offset - dcache_sync \ar, wbtype=1 -#endif - .endm - - - -/* - * Writeback dirty data cache entries that cache a specified portion of memory. - * Parameters are: - * astart start address (register gets clobbered) - * asize size of the region in bytes (register gets clobbered) - * ac unique register used as temporary - */ - .macro dcache_writeback_region astart, asize, ac, awb -#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_IS_WRITEBACK - // Data cache region writeback: - cache_hit_region dhwb, XCHAL_DCACHE_LINEWIDTH, \astart, \asize, \ac, \awb - dcache_sync \ac, wbtype=1 - // End of data cache region writeback -#endif - .endm - - - -/* - * Writeback entire data cache. - * Parameters: - * aa, ab unique address registers (temporaries) - */ - .macro dcache_writeback_all aa, ab, awb, loopokay=1 -#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_IS_WRITEBACK - // Data cache writeback: - cache_index_all diwb, XCHAL_DCACHE_SIZE, XCHAL_DCACHE_LINESIZE, 1, \aa, \ab, \loopokay, 240, \awb, - dcache_sync \aa, wbtype=1 - // End of data cache writeback -#endif - .endm - - - -/* - * Writeback and invalidate a single line of the data cache. - * Parameters are: - * ar address register that contains (virtual) address to writeback and invalidate - * (may get clobbered in a future implementation, but not currently) - * offset offset to add to \ar to compute effective address to writeback and invalidate - * (note: some number of lsbits are ignored) - */ - .macro dcache_writeback_inv_line ar, offset -#if XCHAL_DCACHE_SIZE > 0 - dhwbi \ar, \offset /* writeback and invalidate dcache line */ - dcache_sync \ar, wbtype=1 -#endif - .endm - - - -/* - * Writeback and invalidate data cache entries that cache a specified portion of memory. - * Parameters are: - * astart start address (register gets clobbered) - * asize size of the region in bytes (register gets clobbered) - * ac unique register used as temporary - */ - .macro dcache_writeback_inv_region astart, asize, ac, awb -#if XCHAL_DCACHE_SIZE > 0 - // Data cache region writeback and invalidate: - cache_hit_region dhwbi, XCHAL_DCACHE_LINEWIDTH, \astart, \asize, \ac, \awb - dcache_sync \ac, wbtype=1 - // End of data cache region writeback and invalidate -#endif - .endm - - - -/* - * Writeback and invalidate entire data cache. - * Parameters: - * aa, ab unique address registers (temporaries) - */ - .macro dcache_writeback_inv_all aa, ab, awb, loopokay=1 -#if XCHAL_DCACHE_SIZE > 0 - // Data cache writeback and invalidate: -#if XCHAL_DCACHE_IS_WRITEBACK - cache_index_all diwbi, XCHAL_DCACHE_SIZE, XCHAL_DCACHE_LINESIZE, 1, \aa, \ab, \loopokay, 240, \awb - dcache_sync \aa, wbtype=1 -#else /*writeback*/ - // Data cache does not support writeback, so just invalidate: */ - dcache_invalidate_all \aa, \ab, \loopokay -#endif /*writeback*/ - // End of data cache writeback and invalidate -#endif - .endm - - - - -/* - * Lock (prefetch & lock) a single line of the data cache. - * - * Parameters are: - * ar address register that contains (virtual) address to lock - * (may get clobbered in a future implementation, but not currently) - * offset offset to add to \ar to compute effective address to lock - * (note: some number of lsbits are ignored) - */ - .macro dcache_lock_line ar, offset -#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_LINE_LOCKABLE - dpfl \ar, \offset /* prefetch and lock dcache line */ - dcache_sync \ar -#endif - .endm - - - -/* - * Lock (prefetch & lock) a specified portion of memory into the data cache. - * Parameters are: - * astart start address (register gets clobbered) - * asize size of the region in bytes (register gets clobbered) - * ac unique register used as temporary - */ - .macro dcache_lock_region astart, asize, ac -#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_LINE_LOCKABLE - // Data cache region lock: - cache_hit_region dpfl, XCHAL_DCACHE_LINEWIDTH, \astart, \asize, \ac - dcache_sync \ac - // End of data cache region lock -#endif - .endm - - - -/* - * Unlock a single line of the data cache. - * - * Parameters are: - * ar address register that contains (virtual) address to unlock - * (may get clobbered in a future implementation, but not currently) - * offset offset to add to \ar to compute effective address to unlock - * (note: some number of lsbits are ignored) - */ - .macro dcache_unlock_line ar, offset -#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_LINE_LOCKABLE - dhu \ar, \offset /* unlock dcache line */ - dcache_sync \ar -#endif - .endm - - - -/* - * Unlock a specified portion of memory from the data cache. - * Parameters are: - * astart start address (register gets clobbered) - * asize size of the region in bytes (register gets clobbered) - * ac unique register used as temporary - */ - .macro dcache_unlock_region astart, asize, ac -#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_LINE_LOCKABLE - // Data cache region unlock: - cache_hit_region dhu, XCHAL_DCACHE_LINEWIDTH, \astart, \asize, \ac - dcache_sync \ac - // End of data cache region unlock -#endif - .endm - - - -/* - * Unlock entire data cache. - * - * Parameters: - * aa, ab unique address registers (temporaries) - */ - .macro dcache_unlock_all aa, ab, loopokay=1 -#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_LINE_LOCKABLE - // Data cache unlock: - cache_index_all diu, XCHAL_DCACHE_SIZE, XCHAL_DCACHE_LINESIZE, 1, \aa, \ab, \loopokay, 240 - dcache_sync \aa - // End of data cache unlock -#endif - .endm - - - -/* - * Get the number of enabled icache ways. Note that this may - * be different from the value read from the MEMCTL register. - * - * Parameters: - * aa address register where value is returned - */ - .macro icache_get_ways aa -#if XCHAL_ICACHE_SIZE > 0 -#if XCHAL_HAVE_ICACHE_DYN_WAYS - // Read from MEMCTL and shift/mask - rsr \aa, MEMCTL - extui \aa, \aa, MEMCTL_ICWU_SHIFT, MEMCTL_ICWU_BITS - blti \aa, XCHAL_ICACHE_WAYS, .Licgw - movi \aa, XCHAL_ICACHE_WAYS -.Licgw: -#else - // All ways are always enabled - movi \aa, XCHAL_ICACHE_WAYS -#endif -#else - // No icache - movi \aa, 0 -#endif - .endm - - - -/* - * Set the number of enabled icache ways. - * - * Parameters: - * aa address register specifying number of ways (trashed) - * ab,ac address register for scratch use (trashed) - */ - .macro icache_set_ways aa, ab, ac -#if XCHAL_ICACHE_SIZE > 0 -#if XCHAL_HAVE_ICACHE_DYN_WAYS - movi \ac, MEMCTL_ICWU_CLR_MASK // set up to clear bits 18-22 - rsr \ab, MEMCTL - and \ab, \ab, \ac - movi \ac, MEMCTL_INV_EN // set bit 23 - slli \aa, \aa, MEMCTL_ICWU_SHIFT // move to right spot - or \ab, \ab, \aa - or \ab, \ab, \ac - wsr \ab, MEMCTL - isync -#else - // All ways are always enabled -#endif -#else - // No icache -#endif - .endm - - - -/* - * Get the number of enabled dcache ways. Note that this may - * be different from the value read from the MEMCTL register. - * - * Parameters: - * aa address register where value is returned - */ - .macro dcache_get_ways aa -#if XCHAL_DCACHE_SIZE > 0 -#if XCHAL_HAVE_DCACHE_DYN_WAYS - // Read from MEMCTL and shift/mask - rsr \aa, MEMCTL - extui \aa, \aa, MEMCTL_DCWU_SHIFT, MEMCTL_DCWU_BITS - blti \aa, XCHAL_DCACHE_WAYS, .Ldcgw - movi \aa, XCHAL_DCACHE_WAYS -.Ldcgw: -#else - // All ways are always enabled - movi \aa, XCHAL_DCACHE_WAYS -#endif -#else - // No dcache - movi \aa, 0 -#endif - .endm - - - -/* - * Set the number of enabled dcache ways. - * - * Parameters: - * aa address register specifying number of ways (trashed) - * ab,ac address register for scratch use (trashed) - */ - .macro dcache_set_ways aa, ab, ac -#if (XCHAL_DCACHE_SIZE > 0) && XCHAL_HAVE_DCACHE_DYN_WAYS - movi \ac, MEMCTL_DCWA_CLR_MASK // set up to clear bits 13-17 - rsr \ab, MEMCTL - and \ab, \ab, \ac // clear ways allocatable - slli \ac, \aa, MEMCTL_DCWA_SHIFT - or \ab, \ab, \ac // set ways allocatable - wsr \ab, MEMCTL -#if XCHAL_DCACHE_IS_WRITEBACK - // Check if the way count is increasing or decreasing - extui \ac, \ab, MEMCTL_DCWU_SHIFT, MEMCTL_DCWU_BITS // bits 8-12 - ways in use - bge \aa, \ac, .Ldsw3 // equal or increasing - slli \ab, \aa, XCHAL_DCACHE_LINEWIDTH + XCHAL_DCACHE_SETWIDTH // start way number - slli \ac, \ac, XCHAL_DCACHE_LINEWIDTH + XCHAL_DCACHE_SETWIDTH // end way number -.Ldsw1: - diwbui.p \ab // auto-increments ab - bge \ab, \ac, .Ldsw2 - beqz \ab, .Ldsw2 - j .Ldsw1 -.Ldsw2: - rsr \ab, MEMCTL -#endif -.Ldsw3: - // No dirty data to write back, just set the new number of ways - movi \ac, MEMCTL_DCWU_CLR_MASK // set up to clear bits 8-12 - and \ab, \ab, \ac // clear ways in use - movi \ac, MEMCTL_INV_EN - or \ab, \ab, \ac // set bit 23 - slli \aa, \aa, MEMCTL_DCWU_SHIFT - or \ab, \ab, \aa // set ways in use - wsr \ab, MEMCTL -#else - // No dcache or no way disable support -#endif - .endm - -#endif /*XTENSA_CACHEASM_H*/ - diff --git a/tools/sdk/include/esp32/xtensa/cacheattrasm.h b/tools/sdk/include/esp32/xtensa/cacheattrasm.h deleted file mode 100644 index 20c4cfd558b..00000000000 --- a/tools/sdk/include/esp32/xtensa/cacheattrasm.h +++ /dev/null @@ -1,436 +0,0 @@ -/* - * xtensa/cacheattrasm.h -- assembler-specific CACHEATTR register related definitions - * that depend on CORE configuration - * - * This file is logically part of xtensa/coreasm.h (or perhaps xtensa/cacheasm.h), - * but is kept separate for modularity / compilation-performance. - */ - -/* - * Copyright (c) 2001-2009 Tensilica Inc. - * - * 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. - */ - -#ifndef XTENSA_CACHEATTRASM_H -#define XTENSA_CACHEATTRASM_H - -#include - -/* Determine whether cache attributes are controlled using eight 512MB entries: */ -#define XCHAL_CA_8X512 (XCHAL_HAVE_CACHEATTR || XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR \ - || (XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY)) - - -/* - * This header file defines assembler macros of the form: - * cacheattr_ - * where: - * is 'i', 'd' or absent for instruction, data - * or both caches; and - * indicates the function of the macro. - * - * The following functions are defined: - * - * icacheattr_get - * Reads I-cache CACHEATTR into a2 (clobbers a3-a5). - * - * dcacheattr_get - * Reads D-cache CACHEATTR into a2 (clobbers a3-a5). - * (Note: for configs with a real CACHEATTR register, the - * above two macros are identical.) - * - * cacheattr_set - * Writes both I-cache and D-cache CACHEATTRs from a2 (a3-a8 clobbered). - * Works even when changing one's own code's attributes. - * - * icacheattr_is_enabled label - * Branches to \label if I-cache appears to have been enabled - * (eg. if CACHEATTR contains a cache-enabled attribute). - * (clobbers a2-a5,SAR) - * - * dcacheattr_is_enabled label - * Branches to \label if D-cache appears to have been enabled - * (eg. if CACHEATTR contains a cache-enabled attribute). - * (clobbers a2-a5,SAR) - * - * cacheattr_is_enabled label - * Branches to \label if either I-cache or D-cache appears to have been enabled - * (eg. if CACHEATTR contains a cache-enabled attribute). - * (clobbers a2-a5,SAR) - * - * The following macros are only defined under certain conditions: - * - * icacheattr_set (if XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR) - * Writes I-cache CACHEATTR from a2 (a3-a8 clobbered). - * - * dcacheattr_set (if XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR) - * Writes D-cache CACHEATTR from a2 (a3-a8 clobbered). - */ - - - -/*************************** GENERIC -- ALL CACHES ***************************/ - -/* - * _cacheattr_get - * - * (Internal macro.) - * Returns value of CACHEATTR register (or closest equivalent) in a2. - * - * Entry: - * (none) - * Exit: - * a2 value read from CACHEATTR - * a3-a5 clobbered (temporaries) - */ - .macro _cacheattr_get tlb -#if XCHAL_HAVE_CACHEATTR - rsr a2, CACHEATTR -#elif XCHAL_CA_8X512 - // We have a config that "mimics" CACHEATTR using a simplified - // "MMU" composed of a single statically-mapped way. - // DTLB and ITLB are independent, so there's no single - // cache attribute that can describe both. So for now - // just return the DTLB state. - movi a5, 0xE0000000 - movi a2, 0 - movi a3, XCHAL_SPANNING_WAY -1: add a3, a3, a5 // next segment - r&tlb&1 a4, a3 // get PPN+CA of segment at 0xE0000000, 0xC0000000, ..., 0 - dsync // interlock??? - slli a2, a2, 4 - extui a4, a4, 0, 4 // extract CA - or a2, a2, a4 - bgeui a3, 16, 1b -#else - // This macro isn't applicable to arbitrary MMU configurations. - // Just return zero. - movi a2, 0 -#endif - .endm - - .macro icacheattr_get - _cacheattr_get itlb - .endm - - .macro dcacheattr_get - _cacheattr_get dtlb - .endm - - -/* Default (powerup/reset) value of CACHEATTR, - all BYPASS mode (ie. disabled/bypassed caches): */ -#if XCHAL_HAVE_PTP_MMU -# define XCHAL_CACHEATTR_ALL_BYPASS 0x33333333 -#else -# define XCHAL_CACHEATTR_ALL_BYPASS 0x22222222 -#endif - -#if XCHAL_CA_8X512 - -#if XCHAL_HAVE_PTP_MMU -# define XCHAL_FCA_ENAMASK 0x0AA0 /* bitmap of fetch attributes that require enabled icache */ -# define XCHAL_LCA_ENAMASK 0x0FF0 /* bitmap of load attributes that require enabled dcache */ -# define XCHAL_SCA_ENAMASK 0x0CC0 /* bitmap of store attributes that require enabled dcache */ -#else -# define XCHAL_FCA_ENAMASK 0x003A /* bitmap of fetch attributes that require enabled icache */ -# define XCHAL_LCA_ENAMASK 0x0033 /* bitmap of load attributes that require enabled dcache */ -# define XCHAL_SCA_ENAMASK 0x0033 /* bitmap of store attributes that require enabled dcache */ -#endif -#define XCHAL_LSCA_ENAMASK (XCHAL_LCA_ENAMASK|XCHAL_SCA_ENAMASK) /* l/s attrs requiring enabled dcache */ -#define XCHAL_ALLCA_ENAMASK (XCHAL_FCA_ENAMASK|XCHAL_LSCA_ENAMASK) /* all attrs requiring enabled caches */ - -/* - * _cacheattr_is_enabled - * - * (Internal macro.) - * Branches to \label if CACHEATTR in a2 indicates an enabled - * cache, using mask in a3. - * - * Parameters: - * label where to branch to if cache is enabled - * Entry: - * a2 contains CACHEATTR value used to determine whether - * caches are enabled - * a3 16-bit constant where each bit correspond to - * one of the 16 possible CA values (in a CACHEATTR mask); - * CA values that indicate the cache is enabled - * have their corresponding bit set in this mask - * (eg. use XCHAL_xCA_ENAMASK , above) - * Exit: - * a2,a4,a5 clobbered - * SAR clobbered - */ - .macro _cacheattr_is_enabled label - movi a4, 8 // loop 8 times -.Lcaife\@: - extui a5, a2, 0, 4 // get CA nibble - ssr a5 // index into mask according to CA... - srl a5, a3 // ...and get CA's mask bit in a5 bit 0 - bbsi.l a5, 0, \label // if CA indicates cache enabled, jump to label - srli a2, a2, 4 // next nibble - addi a4, a4, -1 - bnez a4, .Lcaife\@ // loop for each nibble - .endm - -#else /* XCHAL_CA_8X512 */ - .macro _cacheattr_is_enabled label - j \label // macro not applicable, assume caches always enabled - .endm -#endif /* XCHAL_CA_8X512 */ - - - -/* - * icacheattr_is_enabled - * - * Branches to \label if I-cache is enabled. - * - * Parameters: - * label where to branch to if icache is enabled - * Entry: - * (none) - * Exit: - * a2-a5, SAR clobbered (temporaries) - */ - .macro icacheattr_is_enabled label -#if XCHAL_CA_8X512 - icacheattr_get - movi a3, XCHAL_FCA_ENAMASK -#endif - _cacheattr_is_enabled \label - .endm - -/* - * dcacheattr_is_enabled - * - * Branches to \label if D-cache is enabled. - * - * Parameters: - * label where to branch to if dcache is enabled - * Entry: - * (none) - * Exit: - * a2-a5, SAR clobbered (temporaries) - */ - .macro dcacheattr_is_enabled label -#if XCHAL_CA_8X512 - dcacheattr_get - movi a3, XCHAL_LSCA_ENAMASK -#endif - _cacheattr_is_enabled \label - .endm - -/* - * cacheattr_is_enabled - * - * Branches to \label if either I-cache or D-cache is enabled. - * - * Parameters: - * label where to branch to if a cache is enabled - * Entry: - * (none) - * Exit: - * a2-a5, SAR clobbered (temporaries) - */ - .macro cacheattr_is_enabled label -#if XCHAL_HAVE_CACHEATTR - rsr a2, CACHEATTR - movi a3, XCHAL_ALLCA_ENAMASK -#elif XCHAL_CA_8X512 - icacheattr_get - movi a3, XCHAL_FCA_ENAMASK - _cacheattr_is_enabled \label - dcacheattr_get - movi a3, XCHAL_LSCA_ENAMASK -#endif - _cacheattr_is_enabled \label - .endm - - - -/* - * The ISA does not have a defined way to change the - * instruction cache attributes of the running code, - * ie. of the memory area that encloses the current PC. - * However, each micro-architecture (or class of - * configurations within a micro-architecture) - * provides a way to deal with this issue. - * - * Here are a few macros used to implement the relevant - * approach taken. - */ - -#if XCHAL_CA_8X512 && !XCHAL_HAVE_CACHEATTR - // We have a config that "mimics" CACHEATTR using a simplified - // "MMU" composed of a single statically-mapped way. - -/* - * icacheattr_set - * - * Entry: - * a2 cacheattr value to set - * Exit: - * a2 unchanged - * a3-a8 clobbered (temporaries) - */ - .macro icacheattr_set - - movi a5, 0xE0000000 // mask of upper 3 bits - movi a6, 3f // PC where ITLB is set - movi a3, XCHAL_SPANNING_WAY // start at region 0 (0 .. 7) - mov a7, a2 // copy a2 so it doesn't get clobbered - and a6, a6, a5 // upper 3 bits of local PC area - j 3f - - // Use micro-architecture specific method. - // The following 4-instruction sequence is aligned such that - // it all fits within a single I-cache line. Sixteen byte - // alignment is sufficient for this (using XCHAL_ICACHE_LINESIZE - // actually causes problems because that can be greater than - // the alignment of the reset vector, where this macro is often - // invoked, which would cause the linker to align the reset - // vector code away from the reset vector!!). - .begin no-transform - .align 16 /*XCHAL_ICACHE_LINESIZE*/ -1: witlb a4, a3 // write wired PTE (CA, no PPN) of 512MB segment to ITLB - isync - .end no-transform - nop - nop - - sub a3, a3, a5 // next segment (add 0x20000000) - bltui a3, 16, 4f // done? - - // Note that in the WITLB loop, we don't do any load/stores - // (may not be an issue here, but it is important in the DTLB case). -2: srli a7, a7, 4 // next CA -3: -# if XCHAL_HAVE_MIMIC_CACHEATTR - extui a4, a7, 0, 4 // extract CA to set -# else /* have translation, preserve it: */ - ritlb1 a8, a3 // get current PPN+CA of segment - //dsync // interlock??? - extui a4, a7, 0, 4 // extract CA to set - srli a8, a8, 4 // clear CA but keep PPN ... - slli a8, a8, 4 // ... - add a4, a4, a8 // combine new CA with PPN to preserve -# endif - beq a3, a6, 1b // current PC's region? if so, do it in a safe way - witlb a4, a3 // write wired PTE (CA [+PPN]) of 512MB segment to ITLB - sub a3, a3, a5 // next segment (add 0x20000000) - bgeui a3, 16, 2b - isync // make sure all ifetch changes take effect -4: - .endm // icacheattr_set - - -/* - * dcacheattr_set - * - * Entry: - * a2 cacheattr value to set - * Exit: - * a2 unchanged - * a3-a8 clobbered (temporaries) - */ - - .macro dcacheattr_set - - movi a5, 0xE0000000 // mask of upper 3 bits - movi a3, XCHAL_SPANNING_WAY // start at region 0 (0 .. 7) - mov a7, a2 // copy a2 so it doesn't get clobbered - // Note that in the WDTLB loop, we don't do any load/stores -2: // (including implicit l32r via movi) because it isn't safe. -# if XCHAL_HAVE_MIMIC_CACHEATTR - extui a4, a7, 0, 4 // extract CA to set -# else /* have translation, preserve it: */ - rdtlb1 a8, a3 // get current PPN+CA of segment - //dsync // interlock??? - extui a4, a7, 0, 4 // extract CA to set - srli a8, a8, 4 // clear CA but keep PPN ... - slli a8, a8, 4 // ... - add a4, a4, a8 // combine new CA with PPN to preserve -# endif - wdtlb a4, a3 // write wired PTE (CA [+PPN]) of 512MB segment to DTLB - sub a3, a3, a5 // next segment (add 0x20000000) - srli a7, a7, 4 // next CA - bgeui a3, 16, 2b - dsync // make sure all data path changes take effect - .endm // dcacheattr_set - -#endif /* XCHAL_CA_8X512 && !XCHAL_HAVE_CACHEATTR */ - - - -/* - * cacheattr_set - * - * Macro that sets the current CACHEATTR safely - * (both i and d) according to the current contents of a2. - * It works even when changing the cache attributes of - * the currently running code. - * - * Entry: - * a2 cacheattr value to set - * Exit: - * a2 unchanged - * a3-a8 clobbered (temporaries) - */ - .macro cacheattr_set - -#if XCHAL_HAVE_CACHEATTR -# if XCHAL_ICACHE_LINESIZE < 4 - // No i-cache, so can always safely write to CACHEATTR: - wsr a2, CACHEATTR -# else - // The Athens micro-architecture, when using the old - // exception architecture option (ie. with the CACHEATTR register) - // allows changing the cache attributes of the running code - // using the following exact sequence aligned to be within - // an instruction cache line. (NOTE: using XCHAL_ICACHE_LINESIZE - // alignment actually causes problems because that can be greater - // than the alignment of the reset vector, where this macro is often - // invoked, which would cause the linker to align the reset - // vector code away from the reset vector!!). - j 1f - .begin no-transform - .align 16 /*XCHAL_ICACHE_LINESIZE*/ // align to within an I-cache line -1: wsr a2, CACHEATTR - isync - .end no-transform - nop - nop -# endif -#elif XCHAL_CA_8X512 - // DTLB and ITLB are independent, but to keep semantics - // of this macro we simply write to both. - icacheattr_set - dcacheattr_set -#else - // This macro isn't applicable to arbitrary MMU configurations. - // Do nothing in this case. -#endif - .endm - - -#endif /*XTENSA_CACHEATTRASM_H*/ - diff --git a/tools/sdk/include/esp32/xtensa/config/core-isa.h b/tools/sdk/include/esp32/xtensa/config/core-isa.h deleted file mode 100644 index 1845647264f..00000000000 --- a/tools/sdk/include/esp32/xtensa/config/core-isa.h +++ /dev/null @@ -1,655 +0,0 @@ -/* - * xtensa/config/core-isa.h -- HAL definitions that are dependent on Xtensa - * processor CORE configuration - * - * See , which includes this file, for more details. - */ - -/* Xtensa processor core configuration information. - - Customer ID=11657; Build=0x5fe96; Copyright (c) 1999-2016 Tensilica Inc. - - 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. */ - -#ifndef _XTENSA_CORE_CONFIGURATION_H -#define _XTENSA_CORE_CONFIGURATION_H - - -/**************************************************************************** - Parameters Useful for Any Code, USER or PRIVILEGED - ****************************************************************************/ - -/* - * Note: Macros of the form XCHAL_HAVE_*** have a value of 1 if the option is - * configured, and a value of 0 otherwise. These macros are always defined. - */ - - -/*---------------------------------------------------------------------- - ISA - ----------------------------------------------------------------------*/ - -#define XCHAL_HAVE_BE 0 /* big-endian byte ordering */ -#define XCHAL_HAVE_WINDOWED 1 /* windowed registers option */ -#define XCHAL_NUM_AREGS 64 /* num of physical addr regs */ -#define XCHAL_NUM_AREGS_LOG2 6 /* log2(XCHAL_NUM_AREGS) */ -#define XCHAL_MAX_INSTRUCTION_SIZE 3 /* max instr bytes (3..8) */ -#define XCHAL_HAVE_DEBUG 1 /* debug option */ -#define XCHAL_HAVE_DENSITY 1 /* 16-bit instructions */ -#define XCHAL_HAVE_LOOPS 1 /* zero-overhead loops */ -#define XCHAL_LOOP_BUFFER_SIZE 256 /* zero-ov. loop instr buffer size */ -#define XCHAL_HAVE_NSA 1 /* NSA/NSAU instructions */ -#define XCHAL_HAVE_MINMAX 1 /* MIN/MAX instructions */ -#define XCHAL_HAVE_SEXT 1 /* SEXT instruction */ -#define XCHAL_HAVE_DEPBITS 0 /* DEPBITS instruction */ -#define XCHAL_HAVE_CLAMPS 1 /* CLAMPS instruction */ -#define XCHAL_HAVE_MUL16 1 /* MUL16S/MUL16U instructions */ -#define XCHAL_HAVE_MUL32 1 /* MULL instruction */ -#define XCHAL_HAVE_MUL32_HIGH 1 /* MULUH/MULSH instructions */ -#define XCHAL_HAVE_DIV32 1 /* QUOS/QUOU/REMS/REMU instructions */ -#define XCHAL_HAVE_L32R 1 /* L32R instruction */ -#define XCHAL_HAVE_ABSOLUTE_LITERALS 0 /* non-PC-rel (extended) L32R */ -#define XCHAL_HAVE_CONST16 0 /* CONST16 instruction */ -#define XCHAL_HAVE_ADDX 1 /* ADDX#/SUBX# instructions */ -#define XCHAL_HAVE_WIDE_BRANCHES 0 /* B*.W18 or B*.W15 instr's */ -#define XCHAL_HAVE_PREDICTED_BRANCHES 0 /* B[EQ/EQZ/NE/NEZ]T instr's */ -#define XCHAL_HAVE_CALL4AND12 1 /* (obsolete option) */ -#define XCHAL_HAVE_ABS 1 /* ABS instruction */ -/*#define XCHAL_HAVE_POPC 0*/ /* POPC instruction */ -/*#define XCHAL_HAVE_CRC 0*/ /* CRC instruction */ -#define XCHAL_HAVE_RELEASE_SYNC 1 /* L32AI/S32RI instructions */ -#define XCHAL_HAVE_S32C1I 1 /* S32C1I instruction */ -#define XCHAL_HAVE_SPECULATION 0 /* speculation */ -#define XCHAL_HAVE_FULL_RESET 1 /* all regs/state reset */ -#define XCHAL_NUM_CONTEXTS 1 /* */ -#define XCHAL_NUM_MISC_REGS 4 /* num of scratch regs (0..4) */ -#define XCHAL_HAVE_TAP_MASTER 0 /* JTAG TAP control instr's */ -#define XCHAL_HAVE_PRID 1 /* processor ID register */ -#define XCHAL_HAVE_EXTERN_REGS 1 /* WER/RER instructions */ -#define XCHAL_HAVE_MX 0 /* MX core (Tensilica internal) */ -#define XCHAL_HAVE_MP_INTERRUPTS 0 /* interrupt distributor port */ -#define XCHAL_HAVE_MP_RUNSTALL 0 /* core RunStall control port */ -#define XCHAL_HAVE_PSO 0 /* Power Shut-Off */ -#define XCHAL_HAVE_PSO_CDM 0 /* core/debug/mem pwr domains */ -#define XCHAL_HAVE_PSO_FULL_RETENTION 0 /* all regs preserved on PSO */ -#define XCHAL_HAVE_THREADPTR 1 /* THREADPTR register */ -#define XCHAL_HAVE_BOOLEANS 1 /* boolean registers */ -#define XCHAL_HAVE_CP 1 /* CPENABLE reg (coprocessor) */ -#define XCHAL_CP_MAXCFG 8 /* max allowed cp id plus one */ -#define XCHAL_HAVE_MAC16 1 /* MAC16 package */ - -#define XCHAL_HAVE_FUSION 0 /* Fusion*/ -#define XCHAL_HAVE_FUSION_FP 0 /* Fusion FP option */ -#define XCHAL_HAVE_FUSION_LOW_POWER 0 /* Fusion Low Power option */ -#define XCHAL_HAVE_FUSION_AES 0 /* Fusion BLE/Wifi AES-128 CCM option */ -#define XCHAL_HAVE_FUSION_CONVENC 0 /* Fusion Conv Encode option */ -#define XCHAL_HAVE_FUSION_LFSR_CRC 0 /* Fusion LFSR-CRC option */ -#define XCHAL_HAVE_FUSION_BITOPS 0 /* Fusion Bit Operations Support option */ -#define XCHAL_HAVE_FUSION_AVS 0 /* Fusion AVS option */ -#define XCHAL_HAVE_FUSION_16BIT_BASEBAND 0 /* Fusion 16-bit Baseband option */ -#define XCHAL_HAVE_FUSION_VITERBI 0 /* Fusion Viterbi option */ -#define XCHAL_HAVE_FUSION_SOFTDEMAP 0 /* Fusion Soft Bit Demap option */ -#define XCHAL_HAVE_HIFIPRO 0 /* HiFiPro Audio Engine pkg */ -#define XCHAL_HAVE_HIFI4 0 /* HiFi4 Audio Engine pkg */ -#define XCHAL_HAVE_HIFI4_VFPU 0 /* HiFi4 Audio Engine VFPU option */ -#define XCHAL_HAVE_HIFI3 0 /* HiFi3 Audio Engine pkg */ -#define XCHAL_HAVE_HIFI3_VFPU 0 /* HiFi3 Audio Engine VFPU option */ -#define XCHAL_HAVE_HIFI2 0 /* HiFi2 Audio Engine pkg */ -#define XCHAL_HAVE_HIFI2EP 0 /* HiFi2EP */ -#define XCHAL_HAVE_HIFI_MINI 0 - - -#define XCHAL_HAVE_VECTORFPU2005 0 /* vector or user floating-point pkg */ -#define XCHAL_HAVE_USER_DPFPU 0 /* user DP floating-point pkg */ -#define XCHAL_HAVE_USER_SPFPU 0 /* user DP floating-point pkg */ -#define XCHAL_HAVE_FP 1 /* single prec floating point */ -#define XCHAL_HAVE_FP_DIV 1 /* FP with DIV instructions */ -#define XCHAL_HAVE_FP_RECIP 1 /* FP with RECIP instructions */ -#define XCHAL_HAVE_FP_SQRT 1 /* FP with SQRT instructions */ -#define XCHAL_HAVE_FP_RSQRT 1 /* FP with RSQRT instructions */ -#define XCHAL_HAVE_DFP 0 /* double precision FP pkg */ -#define XCHAL_HAVE_DFP_DIV 0 /* DFP with DIV instructions */ -#define XCHAL_HAVE_DFP_RECIP 0 /* DFP with RECIP instructions*/ -#define XCHAL_HAVE_DFP_SQRT 0 /* DFP with SQRT instructions */ -#define XCHAL_HAVE_DFP_RSQRT 0 /* DFP with RSQRT instructions*/ -#define XCHAL_HAVE_DFP_ACCEL 1 /* double precision FP acceleration pkg */ -#define XCHAL_HAVE_DFP_accel XCHAL_HAVE_DFP_ACCEL /* for backward compatibility */ - -#define XCHAL_HAVE_DFPU_SINGLE_ONLY 1 /* DFPU Coprocessor, single precision only */ -#define XCHAL_HAVE_DFPU_SINGLE_DOUBLE 0 /* DFPU Coprocessor, single and double precision */ -#define XCHAL_HAVE_VECTRA1 0 /* Vectra I pkg */ -#define XCHAL_HAVE_VECTRALX 0 /* Vectra LX pkg */ -#define XCHAL_HAVE_PDX4 0 /* PDX4 */ -#define XCHAL_HAVE_CONNXD2 0 /* ConnX D2 pkg */ -#define XCHAL_HAVE_CONNXD2_DUALLSFLIX 0 /* ConnX D2 & Dual LoadStore Flix */ -#define XCHAL_HAVE_BBE16 0 /* ConnX BBE16 pkg */ -#define XCHAL_HAVE_BBE16_RSQRT 0 /* BBE16 & vector recip sqrt */ -#define XCHAL_HAVE_BBE16_VECDIV 0 /* BBE16 & vector divide */ -#define XCHAL_HAVE_BBE16_DESPREAD 0 /* BBE16 & despread */ -#define XCHAL_HAVE_BBENEP 0 /* ConnX BBENEP pkgs */ -#define XCHAL_HAVE_BSP3 0 /* ConnX BSP3 pkg */ -#define XCHAL_HAVE_BSP3_TRANSPOSE 0 /* BSP3 & transpose32x32 */ -#define XCHAL_HAVE_SSP16 0 /* ConnX SSP16 pkg */ -#define XCHAL_HAVE_SSP16_VITERBI 0 /* SSP16 & viterbi */ -#define XCHAL_HAVE_TURBO16 0 /* ConnX Turbo16 pkg */ -#define XCHAL_HAVE_BBP16 0 /* ConnX BBP16 pkg */ -#define XCHAL_HAVE_FLIX3 0 /* basic 3-way FLIX option */ -#define XCHAL_HAVE_GRIVPEP 0 /* GRIVPEP is General Release of IVPEP */ -#define XCHAL_HAVE_GRIVPEP_HISTOGRAM 0 /* Histogram option on GRIVPEP */ - - -/*---------------------------------------------------------------------- - MISC - ----------------------------------------------------------------------*/ - -#define XCHAL_NUM_LOADSTORE_UNITS 1 /* load/store units */ -#define XCHAL_NUM_WRITEBUFFER_ENTRIES 4 /* size of write buffer */ -#define XCHAL_INST_FETCH_WIDTH 4 /* instr-fetch width in bytes */ -#define XCHAL_DATA_WIDTH 4 /* data width in bytes */ -#define XCHAL_DATA_PIPE_DELAY 2 /* d-side pipeline delay - (1 = 5-stage, 2 = 7-stage) */ -#define XCHAL_CLOCK_GATING_GLOBAL 1 /* global clock gating */ -#define XCHAL_CLOCK_GATING_FUNCUNIT 1 /* funct. unit clock gating */ -/* In T1050, applies to selected core load and store instructions (see ISA): */ -#define XCHAL_UNALIGNED_LOAD_EXCEPTION 0 /* unaligned loads cause exc. */ -#define XCHAL_UNALIGNED_STORE_EXCEPTION 0 /* unaligned stores cause exc.*/ -#define XCHAL_UNALIGNED_LOAD_HW 1 /* unaligned loads work in hw */ -#define XCHAL_UNALIGNED_STORE_HW 1 /* unaligned stores work in hw*/ - -#define XCHAL_SW_VERSION 1100003 /* sw version of this header */ - -#define XCHAL_CORE_ID "esp32_v3_49_prod" /* alphanum core name - (CoreID) set in the Xtensa - Processor Generator */ - -#define XCHAL_BUILD_UNIQUE_ID 0x0005FE96 /* 22-bit sw build ID */ - -/* - * These definitions describe the hardware targeted by this software. - */ -#define XCHAL_HW_CONFIGID0 0xC2BCFFFE /* ConfigID hi 32 bits*/ -#define XCHAL_HW_CONFIGID1 0x1CC5FE96 /* ConfigID lo 32 bits*/ -#define XCHAL_HW_VERSION_NAME "LX6.0.3" /* full version name */ -#define XCHAL_HW_VERSION_MAJOR 2600 /* major ver# of targeted hw */ -#define XCHAL_HW_VERSION_MINOR 3 /* minor ver# of targeted hw */ -#define XCHAL_HW_VERSION 260003 /* major*100+minor */ -#define XCHAL_HW_REL_LX6 1 -#define XCHAL_HW_REL_LX6_0 1 -#define XCHAL_HW_REL_LX6_0_3 1 -#define XCHAL_HW_CONFIGID_RELIABLE 1 -/* If software targets a *range* of hardware versions, these are the bounds: */ -#define XCHAL_HW_MIN_VERSION_MAJOR 2600 /* major v of earliest tgt hw */ -#define XCHAL_HW_MIN_VERSION_MINOR 3 /* minor v of earliest tgt hw */ -#define XCHAL_HW_MIN_VERSION 260003 /* earliest targeted hw */ -#define XCHAL_HW_MAX_VERSION_MAJOR 2600 /* major v of latest tgt hw */ -#define XCHAL_HW_MAX_VERSION_MINOR 3 /* minor v of latest tgt hw */ -#define XCHAL_HW_MAX_VERSION 260003 /* latest targeted hw */ - - -/*---------------------------------------------------------------------- - CACHE - ----------------------------------------------------------------------*/ - -#define XCHAL_ICACHE_LINESIZE 4 /* I-cache line size in bytes */ -#define XCHAL_DCACHE_LINESIZE 4 /* D-cache line size in bytes */ -#define XCHAL_ICACHE_LINEWIDTH 2 /* log2(I line size in bytes) */ -#define XCHAL_DCACHE_LINEWIDTH 2 /* log2(D line size in bytes) */ - -#define XCHAL_ICACHE_SIZE 0 /* I-cache size in bytes or 0 */ -#define XCHAL_DCACHE_SIZE 0 /* D-cache size in bytes or 0 */ - -#define XCHAL_DCACHE_IS_WRITEBACK 0 /* writeback feature */ -#define XCHAL_DCACHE_IS_COHERENT 0 /* MP coherence feature */ - -#define XCHAL_HAVE_PREFETCH 0 /* PREFCTL register */ -#define XCHAL_HAVE_PREFETCH_L1 0 /* prefetch to L1 dcache */ -#define XCHAL_PREFETCH_CASTOUT_LINES 0 /* dcache pref. castout bufsz */ -#define XCHAL_PREFETCH_ENTRIES 0 /* cache prefetch entries */ -#define XCHAL_PREFETCH_BLOCK_ENTRIES 0 /* prefetch block streams */ -#define XCHAL_HAVE_CACHE_BLOCKOPS 0 /* block prefetch for caches */ -#define XCHAL_HAVE_ICACHE_TEST 0 /* Icache test instructions */ -#define XCHAL_HAVE_DCACHE_TEST 0 /* Dcache test instructions */ -#define XCHAL_HAVE_ICACHE_DYN_WAYS 0 /* Icache dynamic way support */ -#define XCHAL_HAVE_DCACHE_DYN_WAYS 0 /* Dcache dynamic way support */ - - - - -/**************************************************************************** - Parameters Useful for PRIVILEGED (Supervisory or Non-Virtualized) Code - ****************************************************************************/ - - -#ifndef XTENSA_HAL_NON_PRIVILEGED_ONLY - -/*---------------------------------------------------------------------- - CACHE - ----------------------------------------------------------------------*/ - -#define XCHAL_HAVE_PIF 1 /* any outbound PIF present */ -#define XCHAL_HAVE_AXI 0 /* AXI bus */ - -#define XCHAL_HAVE_PIF_WR_RESP 0 /* pif write response */ -#define XCHAL_HAVE_PIF_REQ_ATTR 0 /* pif attribute */ - -/* If present, cache size in bytes == (ways * 2^(linewidth + setwidth)). */ - -/* Number of cache sets in log2(lines per way): */ -#define XCHAL_ICACHE_SETWIDTH 0 -#define XCHAL_DCACHE_SETWIDTH 0 - -/* Cache set associativity (number of ways): */ -#define XCHAL_ICACHE_WAYS 1 -#define XCHAL_DCACHE_WAYS 1 - -/* Cache features: */ -#define XCHAL_ICACHE_LINE_LOCKABLE 0 -#define XCHAL_DCACHE_LINE_LOCKABLE 0 -#define XCHAL_ICACHE_ECC_PARITY 0 -#define XCHAL_DCACHE_ECC_PARITY 0 - -/* Cache access size in bytes (affects operation of SICW instruction): */ -#define XCHAL_ICACHE_ACCESS_SIZE 1 -#define XCHAL_DCACHE_ACCESS_SIZE 1 - -#define XCHAL_DCACHE_BANKS 0 /* number of banks */ - -/* Number of encoded cache attr bits (see for decoded bits): */ -#define XCHAL_CA_BITS 4 - - -/*---------------------------------------------------------------------- - INTERNAL I/D RAM/ROMs and XLMI - ----------------------------------------------------------------------*/ - -#define XCHAL_NUM_INSTROM 1 /* number of core instr. ROMs */ -#define XCHAL_NUM_INSTRAM 2 /* number of core instr. RAMs */ -#define XCHAL_NUM_DATAROM 1 /* number of core data ROMs */ -#define XCHAL_NUM_DATARAM 2 /* number of core data RAMs */ -#define XCHAL_NUM_URAM 0 /* number of core unified RAMs*/ -#define XCHAL_NUM_XLMI 1 /* number of core XLMI ports */ - -/* Instruction ROM 0: */ -#define XCHAL_INSTROM0_VADDR 0x40800000 /* virtual address */ -#define XCHAL_INSTROM0_PADDR 0x40800000 /* physical address */ -#define XCHAL_INSTROM0_SIZE 4194304 /* size in bytes */ -#define XCHAL_INSTROM0_ECC_PARITY 0 /* ECC/parity type, 0=none */ - -/* Instruction RAM 0: */ -#define XCHAL_INSTRAM0_VADDR 0x40000000 /* virtual address */ -#define XCHAL_INSTRAM0_PADDR 0x40000000 /* physical address */ -#define XCHAL_INSTRAM0_SIZE 4194304 /* size in bytes */ -#define XCHAL_INSTRAM0_ECC_PARITY 0 /* ECC/parity type, 0=none */ - -/* Instruction RAM 1: */ -#define XCHAL_INSTRAM1_VADDR 0x40400000 /* virtual address */ -#define XCHAL_INSTRAM1_PADDR 0x40400000 /* physical address */ -#define XCHAL_INSTRAM1_SIZE 4194304 /* size in bytes */ -#define XCHAL_INSTRAM1_ECC_PARITY 0 /* ECC/parity type, 0=none */ - -/* Data ROM 0: */ -#define XCHAL_DATAROM0_VADDR 0x3F400000 /* virtual address */ -#define XCHAL_DATAROM0_PADDR 0x3F400000 /* physical address */ -#define XCHAL_DATAROM0_SIZE 4194304 /* size in bytes */ -#define XCHAL_DATAROM0_ECC_PARITY 0 /* ECC/parity type, 0=none */ -#define XCHAL_DATAROM0_BANKS 1 /* number of banks */ - -/* Data RAM 0: */ -#define XCHAL_DATARAM0_VADDR 0x3FF80000 /* virtual address */ -#define XCHAL_DATARAM0_PADDR 0x3FF80000 /* physical address */ -#define XCHAL_DATARAM0_SIZE 524288 /* size in bytes */ -#define XCHAL_DATARAM0_ECC_PARITY 0 /* ECC/parity type, 0=none */ -#define XCHAL_DATARAM0_BANKS 1 /* number of banks */ - -/* Data RAM 1: */ -#define XCHAL_DATARAM1_VADDR 0x3F800000 /* virtual address */ -#define XCHAL_DATARAM1_PADDR 0x3F800000 /* physical address */ -#define XCHAL_DATARAM1_SIZE 4194304 /* size in bytes */ -#define XCHAL_DATARAM1_ECC_PARITY 0 /* ECC/parity type, 0=none */ -#define XCHAL_DATARAM1_BANKS 1 /* number of banks */ - -/* XLMI Port 0: */ -#define XCHAL_XLMI0_VADDR 0x3FF00000 /* virtual address */ -#define XCHAL_XLMI0_PADDR 0x3FF00000 /* physical address */ -#define XCHAL_XLMI0_SIZE 524288 /* size in bytes */ -#define XCHAL_XLMI0_ECC_PARITY 0 /* ECC/parity type, 0=none */ - -#define XCHAL_HAVE_IMEM_LOADSTORE 1 /* can load/store to IROM/IRAM*/ - - -/*---------------------------------------------------------------------- - INTERRUPTS and TIMERS - ----------------------------------------------------------------------*/ - -#define XCHAL_HAVE_INTERRUPTS 1 /* interrupt option */ -#define XCHAL_HAVE_HIGHPRI_INTERRUPTS 1 /* med/high-pri. interrupts */ -#define XCHAL_HAVE_NMI 1 /* non-maskable interrupt */ -#define XCHAL_HAVE_CCOUNT 1 /* CCOUNT reg. (timer option) */ -#define XCHAL_NUM_TIMERS 3 /* number of CCOMPAREn regs */ -#define XCHAL_NUM_INTERRUPTS 32 /* number of interrupts */ -#define XCHAL_NUM_INTERRUPTS_LOG2 5 /* ceil(log2(NUM_INTERRUPTS)) */ -#define XCHAL_NUM_EXTINTERRUPTS 26 /* num of external interrupts */ -#define XCHAL_NUM_INTLEVELS 6 /* number of interrupt levels - (not including level zero) */ -#define XCHAL_EXCM_LEVEL 3 /* level masked by PS.EXCM */ - /* (always 1 in XEA1; levels 2 .. EXCM_LEVEL are "medium priority") */ - -/* Masks of interrupts at each interrupt level: */ -#define XCHAL_INTLEVEL1_MASK 0x000637FF -#define XCHAL_INTLEVEL2_MASK 0x00380000 -#define XCHAL_INTLEVEL3_MASK 0x28C08800 -#define XCHAL_INTLEVEL4_MASK 0x53000000 -#define XCHAL_INTLEVEL5_MASK 0x84010000 -#define XCHAL_INTLEVEL6_MASK 0x00000000 -#define XCHAL_INTLEVEL7_MASK 0x00004000 - -/* Masks of interrupts at each range 1..n of interrupt levels: */ -#define XCHAL_INTLEVEL1_ANDBELOW_MASK 0x000637FF -#define XCHAL_INTLEVEL2_ANDBELOW_MASK 0x003E37FF -#define XCHAL_INTLEVEL3_ANDBELOW_MASK 0x28FEBFFF -#define XCHAL_INTLEVEL4_ANDBELOW_MASK 0x7BFEBFFF -#define XCHAL_INTLEVEL5_ANDBELOW_MASK 0xFFFFBFFF -#define XCHAL_INTLEVEL6_ANDBELOW_MASK 0xFFFFBFFF -#define XCHAL_INTLEVEL7_ANDBELOW_MASK 0xFFFFFFFF - -/* Level of each interrupt: */ -#define XCHAL_INT0_LEVEL 1 -#define XCHAL_INT1_LEVEL 1 -#define XCHAL_INT2_LEVEL 1 -#define XCHAL_INT3_LEVEL 1 -#define XCHAL_INT4_LEVEL 1 -#define XCHAL_INT5_LEVEL 1 -#define XCHAL_INT6_LEVEL 1 -#define XCHAL_INT7_LEVEL 1 -#define XCHAL_INT8_LEVEL 1 -#define XCHAL_INT9_LEVEL 1 -#define XCHAL_INT10_LEVEL 1 -#define XCHAL_INT11_LEVEL 3 -#define XCHAL_INT12_LEVEL 1 -#define XCHAL_INT13_LEVEL 1 -#define XCHAL_INT14_LEVEL 7 -#define XCHAL_INT15_LEVEL 3 -#define XCHAL_INT16_LEVEL 5 -#define XCHAL_INT17_LEVEL 1 -#define XCHAL_INT18_LEVEL 1 -#define XCHAL_INT19_LEVEL 2 -#define XCHAL_INT20_LEVEL 2 -#define XCHAL_INT21_LEVEL 2 -#define XCHAL_INT22_LEVEL 3 -#define XCHAL_INT23_LEVEL 3 -#define XCHAL_INT24_LEVEL 4 -#define XCHAL_INT25_LEVEL 4 -#define XCHAL_INT26_LEVEL 5 -#define XCHAL_INT27_LEVEL 3 -#define XCHAL_INT28_LEVEL 4 -#define XCHAL_INT29_LEVEL 3 -#define XCHAL_INT30_LEVEL 4 -#define XCHAL_INT31_LEVEL 5 -#define XCHAL_DEBUGLEVEL 6 /* debug interrupt level */ -#define XCHAL_HAVE_DEBUG_EXTERN_INT 1 /* OCD external db interrupt */ -#define XCHAL_NMILEVEL 7 /* NMI "level" (for use with - EXCSAVE/EPS/EPC_n, RFI n) */ - -/* Type of each interrupt: */ -#define XCHAL_INT0_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT1_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT2_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT3_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT4_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT5_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT6_TYPE XTHAL_INTTYPE_TIMER -#define XCHAL_INT7_TYPE XTHAL_INTTYPE_SOFTWARE -#define XCHAL_INT8_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT9_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT10_TYPE XTHAL_INTTYPE_EXTERN_EDGE -#define XCHAL_INT11_TYPE XTHAL_INTTYPE_PROFILING -#define XCHAL_INT12_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT13_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT14_TYPE XTHAL_INTTYPE_NMI -#define XCHAL_INT15_TYPE XTHAL_INTTYPE_TIMER -#define XCHAL_INT16_TYPE XTHAL_INTTYPE_TIMER -#define XCHAL_INT17_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT18_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT19_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT20_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT21_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT22_TYPE XTHAL_INTTYPE_EXTERN_EDGE -#define XCHAL_INT23_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT24_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT25_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT26_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT27_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT28_TYPE XTHAL_INTTYPE_EXTERN_EDGE -#define XCHAL_INT29_TYPE XTHAL_INTTYPE_SOFTWARE -#define XCHAL_INT30_TYPE XTHAL_INTTYPE_EXTERN_EDGE -#define XCHAL_INT31_TYPE XTHAL_INTTYPE_EXTERN_LEVEL - -/* Masks of interrupts for each type of interrupt: */ -#define XCHAL_INTTYPE_MASK_UNCONFIGURED 0x00000000 -#define XCHAL_INTTYPE_MASK_SOFTWARE 0x20000080 -#define XCHAL_INTTYPE_MASK_EXTERN_EDGE 0x50400400 -#define XCHAL_INTTYPE_MASK_EXTERN_LEVEL 0x8FBE333F -#define XCHAL_INTTYPE_MASK_TIMER 0x00018040 -#define XCHAL_INTTYPE_MASK_NMI 0x00004000 -#define XCHAL_INTTYPE_MASK_WRITE_ERROR 0x00000000 -#define XCHAL_INTTYPE_MASK_PROFILING 0x00000800 - -/* Interrupt numbers assigned to specific interrupt sources: */ -#define XCHAL_TIMER0_INTERRUPT 6 /* CCOMPARE0 */ -#define XCHAL_TIMER1_INTERRUPT 15 /* CCOMPARE1 */ -#define XCHAL_TIMER2_INTERRUPT 16 /* CCOMPARE2 */ -#define XCHAL_TIMER3_INTERRUPT XTHAL_TIMER_UNCONFIGURED -#define XCHAL_NMI_INTERRUPT 14 /* non-maskable interrupt */ -#define XCHAL_PROFILING_INTERRUPT 11 /* profiling interrupt */ - -/* Interrupt numbers for levels at which only one interrupt is configured: */ -#define XCHAL_INTLEVEL7_NUM 14 -/* (There are many interrupts each at level(s) 1, 2, 3, 4, 5.) */ - - -/* - * External interrupt mapping. - * These macros describe how Xtensa processor interrupt numbers - * (as numbered internally, eg. in INTERRUPT and INTENABLE registers) - * map to external BInterrupt pins, for those interrupts - * configured as external (level-triggered, edge-triggered, or NMI). - * See the Xtensa processor databook for more details. - */ - -/* Core interrupt numbers mapped to each EXTERNAL BInterrupt pin number: */ -#define XCHAL_EXTINT0_NUM 0 /* (intlevel 1) */ -#define XCHAL_EXTINT1_NUM 1 /* (intlevel 1) */ -#define XCHAL_EXTINT2_NUM 2 /* (intlevel 1) */ -#define XCHAL_EXTINT3_NUM 3 /* (intlevel 1) */ -#define XCHAL_EXTINT4_NUM 4 /* (intlevel 1) */ -#define XCHAL_EXTINT5_NUM 5 /* (intlevel 1) */ -#define XCHAL_EXTINT6_NUM 8 /* (intlevel 1) */ -#define XCHAL_EXTINT7_NUM 9 /* (intlevel 1) */ -#define XCHAL_EXTINT8_NUM 10 /* (intlevel 1) */ -#define XCHAL_EXTINT9_NUM 12 /* (intlevel 1) */ -#define XCHAL_EXTINT10_NUM 13 /* (intlevel 1) */ -#define XCHAL_EXTINT11_NUM 14 /* (intlevel 7) */ -#define XCHAL_EXTINT12_NUM 17 /* (intlevel 1) */ -#define XCHAL_EXTINT13_NUM 18 /* (intlevel 1) */ -#define XCHAL_EXTINT14_NUM 19 /* (intlevel 2) */ -#define XCHAL_EXTINT15_NUM 20 /* (intlevel 2) */ -#define XCHAL_EXTINT16_NUM 21 /* (intlevel 2) */ -#define XCHAL_EXTINT17_NUM 22 /* (intlevel 3) */ -#define XCHAL_EXTINT18_NUM 23 /* (intlevel 3) */ -#define XCHAL_EXTINT19_NUM 24 /* (intlevel 4) */ -#define XCHAL_EXTINT20_NUM 25 /* (intlevel 4) */ -#define XCHAL_EXTINT21_NUM 26 /* (intlevel 5) */ -#define XCHAL_EXTINT22_NUM 27 /* (intlevel 3) */ -#define XCHAL_EXTINT23_NUM 28 /* (intlevel 4) */ -#define XCHAL_EXTINT24_NUM 30 /* (intlevel 4) */ -#define XCHAL_EXTINT25_NUM 31 /* (intlevel 5) */ -/* EXTERNAL BInterrupt pin numbers mapped to each core interrupt number: */ -#define XCHAL_INT0_EXTNUM 0 /* (intlevel 1) */ -#define XCHAL_INT1_EXTNUM 1 /* (intlevel 1) */ -#define XCHAL_INT2_EXTNUM 2 /* (intlevel 1) */ -#define XCHAL_INT3_EXTNUM 3 /* (intlevel 1) */ -#define XCHAL_INT4_EXTNUM 4 /* (intlevel 1) */ -#define XCHAL_INT5_EXTNUM 5 /* (intlevel 1) */ -#define XCHAL_INT8_EXTNUM 6 /* (intlevel 1) */ -#define XCHAL_INT9_EXTNUM 7 /* (intlevel 1) */ -#define XCHAL_INT10_EXTNUM 8 /* (intlevel 1) */ -#define XCHAL_INT12_EXTNUM 9 /* (intlevel 1) */ -#define XCHAL_INT13_EXTNUM 10 /* (intlevel 1) */ -#define XCHAL_INT14_EXTNUM 11 /* (intlevel 7) */ -#define XCHAL_INT17_EXTNUM 12 /* (intlevel 1) */ -#define XCHAL_INT18_EXTNUM 13 /* (intlevel 1) */ -#define XCHAL_INT19_EXTNUM 14 /* (intlevel 2) */ -#define XCHAL_INT20_EXTNUM 15 /* (intlevel 2) */ -#define XCHAL_INT21_EXTNUM 16 /* (intlevel 2) */ -#define XCHAL_INT22_EXTNUM 17 /* (intlevel 3) */ -#define XCHAL_INT23_EXTNUM 18 /* (intlevel 3) */ -#define XCHAL_INT24_EXTNUM 19 /* (intlevel 4) */ -#define XCHAL_INT25_EXTNUM 20 /* (intlevel 4) */ -#define XCHAL_INT26_EXTNUM 21 /* (intlevel 5) */ -#define XCHAL_INT27_EXTNUM 22 /* (intlevel 3) */ -#define XCHAL_INT28_EXTNUM 23 /* (intlevel 4) */ -#define XCHAL_INT30_EXTNUM 24 /* (intlevel 4) */ -#define XCHAL_INT31_EXTNUM 25 /* (intlevel 5) */ - - -/*---------------------------------------------------------------------- - EXCEPTIONS and VECTORS - ----------------------------------------------------------------------*/ - -#define XCHAL_XEA_VERSION 2 /* Xtensa Exception Architecture - number: 1 == XEA1 (old) - 2 == XEA2 (new) - 0 == XEAX (extern) or TX */ -#define XCHAL_HAVE_XEA1 0 /* Exception Architecture 1 */ -#define XCHAL_HAVE_XEA2 1 /* Exception Architecture 2 */ -#define XCHAL_HAVE_XEAX 0 /* External Exception Arch. */ -#define XCHAL_HAVE_EXCEPTIONS 1 /* exception option */ -#define XCHAL_HAVE_HALT 0 /* halt architecture option */ -#define XCHAL_HAVE_BOOTLOADER 0 /* boot loader (for TX) */ -#define XCHAL_HAVE_MEM_ECC_PARITY 0 /* local memory ECC/parity */ -#define XCHAL_HAVE_VECTOR_SELECT 1 /* relocatable vectors */ -#define XCHAL_HAVE_VECBASE 1 /* relocatable vectors */ -#define XCHAL_VECBASE_RESET_VADDR 0x40000000 /* VECBASE reset value */ -#define XCHAL_VECBASE_RESET_PADDR 0x40000000 -#define XCHAL_RESET_VECBASE_OVERLAP 0 - -#define XCHAL_RESET_VECTOR0_VADDR 0x50000000 -#define XCHAL_RESET_VECTOR0_PADDR 0x50000000 -#define XCHAL_RESET_VECTOR1_VADDR 0x40000400 -#define XCHAL_RESET_VECTOR1_PADDR 0x40000400 -#define XCHAL_RESET_VECTOR_VADDR 0x40000400 -#define XCHAL_RESET_VECTOR_PADDR 0x40000400 -#define XCHAL_USER_VECOFS 0x00000340 -#define XCHAL_USER_VECTOR_VADDR 0x40000340 -#define XCHAL_USER_VECTOR_PADDR 0x40000340 -#define XCHAL_KERNEL_VECOFS 0x00000300 -#define XCHAL_KERNEL_VECTOR_VADDR 0x40000300 -#define XCHAL_KERNEL_VECTOR_PADDR 0x40000300 -#define XCHAL_DOUBLEEXC_VECOFS 0x000003C0 -#define XCHAL_DOUBLEEXC_VECTOR_VADDR 0x400003C0 -#define XCHAL_DOUBLEEXC_VECTOR_PADDR 0x400003C0 -#define XCHAL_WINDOW_OF4_VECOFS 0x00000000 -#define XCHAL_WINDOW_UF4_VECOFS 0x00000040 -#define XCHAL_WINDOW_OF8_VECOFS 0x00000080 -#define XCHAL_WINDOW_UF8_VECOFS 0x000000C0 -#define XCHAL_WINDOW_OF12_VECOFS 0x00000100 -#define XCHAL_WINDOW_UF12_VECOFS 0x00000140 -#define XCHAL_WINDOW_VECTORS_VADDR 0x40000000 -#define XCHAL_WINDOW_VECTORS_PADDR 0x40000000 -#define XCHAL_INTLEVEL2_VECOFS 0x00000180 -#define XCHAL_INTLEVEL2_VECTOR_VADDR 0x40000180 -#define XCHAL_INTLEVEL2_VECTOR_PADDR 0x40000180 -#define XCHAL_INTLEVEL3_VECOFS 0x000001C0 -#define XCHAL_INTLEVEL3_VECTOR_VADDR 0x400001C0 -#define XCHAL_INTLEVEL3_VECTOR_PADDR 0x400001C0 -#define XCHAL_INTLEVEL4_VECOFS 0x00000200 -#define XCHAL_INTLEVEL4_VECTOR_VADDR 0x40000200 -#define XCHAL_INTLEVEL4_VECTOR_PADDR 0x40000200 -#define XCHAL_INTLEVEL5_VECOFS 0x00000240 -#define XCHAL_INTLEVEL5_VECTOR_VADDR 0x40000240 -#define XCHAL_INTLEVEL5_VECTOR_PADDR 0x40000240 -#define XCHAL_INTLEVEL6_VECOFS 0x00000280 -#define XCHAL_INTLEVEL6_VECTOR_VADDR 0x40000280 -#define XCHAL_INTLEVEL6_VECTOR_PADDR 0x40000280 -#define XCHAL_DEBUG_VECOFS XCHAL_INTLEVEL6_VECOFS -#define XCHAL_DEBUG_VECTOR_VADDR XCHAL_INTLEVEL6_VECTOR_VADDR -#define XCHAL_DEBUG_VECTOR_PADDR XCHAL_INTLEVEL6_VECTOR_PADDR -#define XCHAL_NMI_VECOFS 0x000002C0 -#define XCHAL_NMI_VECTOR_VADDR 0x400002C0 -#define XCHAL_NMI_VECTOR_PADDR 0x400002C0 -#define XCHAL_INTLEVEL7_VECOFS XCHAL_NMI_VECOFS -#define XCHAL_INTLEVEL7_VECTOR_VADDR XCHAL_NMI_VECTOR_VADDR -#define XCHAL_INTLEVEL7_VECTOR_PADDR XCHAL_NMI_VECTOR_PADDR - - -/*---------------------------------------------------------------------- - DEBUG MODULE - ----------------------------------------------------------------------*/ - -/* Misc */ -#define XCHAL_HAVE_DEBUG_ERI 1 /* ERI to debug module */ -#define XCHAL_HAVE_DEBUG_APB 1 /* APB to debug module */ -#define XCHAL_HAVE_DEBUG_JTAG 1 /* JTAG to debug module */ - -/* On-Chip Debug (OCD) */ -#define XCHAL_HAVE_OCD 1 /* OnChipDebug option */ -#define XCHAL_NUM_IBREAK 2 /* number of IBREAKn regs */ -#define XCHAL_NUM_DBREAK 2 /* number of DBREAKn regs */ -#define XCHAL_HAVE_OCD_DIR_ARRAY 0 /* faster OCD option (to LX4) */ -#define XCHAL_HAVE_OCD_LS32DDR 1 /* L32DDR/S32DDR (faster OCD) */ - -/* TRAX (in core) */ -#define XCHAL_HAVE_TRAX 1 /* TRAX in debug module */ -#define XCHAL_TRAX_MEM_SIZE 16384 /* TRAX memory size in bytes */ -#define XCHAL_TRAX_MEM_SHAREABLE 1 /* start/end regs; ready sig. */ -#define XCHAL_TRAX_ATB_WIDTH 32 /* ATB width (bits), 0=no ATB */ -#define XCHAL_TRAX_TIME_WIDTH 0 /* timestamp bitwidth, 0=none */ - -/* Perf counters */ -#define XCHAL_NUM_PERF_COUNTERS 2 /* performance counters */ - - -/*---------------------------------------------------------------------- - MMU - ----------------------------------------------------------------------*/ - -/* See core-matmap.h header file for more details. */ - -#define XCHAL_HAVE_TLBS 1 /* inverse of HAVE_CACHEATTR */ -#define XCHAL_HAVE_SPANNING_WAY 1 /* one way maps I+D 4GB vaddr */ -#define XCHAL_SPANNING_WAY 0 /* TLB spanning way number */ -#define XCHAL_HAVE_IDENTITY_MAP 1 /* vaddr == paddr always */ -#define XCHAL_HAVE_CACHEATTR 0 /* CACHEATTR register present */ -#define XCHAL_HAVE_MIMIC_CACHEATTR 1 /* region protection */ -#define XCHAL_HAVE_XLT_CACHEATTR 0 /* region prot. w/translation */ -#define XCHAL_HAVE_PTP_MMU 0 /* full MMU (with page table - [autorefill] and protection) - usable for an MMU-based OS */ -/* If none of the above last 4 are set, it's a custom TLB configuration. */ - -#define XCHAL_MMU_ASID_BITS 0 /* number of bits in ASIDs */ -#define XCHAL_MMU_RINGS 1 /* number of rings (1..4) */ -#define XCHAL_MMU_RING_BITS 0 /* num of bits in RING field */ - -#endif /* !XTENSA_HAL_NON_PRIVILEGED_ONLY */ - - -#endif /* _XTENSA_CORE_CONFIGURATION_H */ - diff --git a/tools/sdk/include/esp32/xtensa/config/core-matmap.h b/tools/sdk/include/esp32/xtensa/config/core-matmap.h deleted file mode 100644 index b101f1e6aa8..00000000000 --- a/tools/sdk/include/esp32/xtensa/config/core-matmap.h +++ /dev/null @@ -1,318 +0,0 @@ -/* - * xtensa/config/core-matmap.h -- Memory access and translation mapping - * parameters (CHAL) of the Xtensa processor core configuration. - * - * If you are using Xtensa Tools, see (which includes - * this file) for more details. - * - * In the Xtensa processor products released to date, all parameters - * defined in this file are derivable (at least in theory) from - * information contained in the core-isa.h header file. - * In particular, the following core configuration parameters are relevant: - * XCHAL_HAVE_CACHEATTR - * XCHAL_HAVE_MIMIC_CACHEATTR - * XCHAL_HAVE_XLT_CACHEATTR - * XCHAL_HAVE_PTP_MMU - * XCHAL_ITLB_ARF_ENTRIES_LOG2 - * XCHAL_DTLB_ARF_ENTRIES_LOG2 - * XCHAL_DCACHE_IS_WRITEBACK - * XCHAL_ICACHE_SIZE (presence of I-cache) - * XCHAL_DCACHE_SIZE (presence of D-cache) - * XCHAL_HW_VERSION_MAJOR - * XCHAL_HW_VERSION_MINOR - */ - -/* Customer ID=11657; Build=0x5fe96; Copyright (c) 1999-2016 Tensilica Inc. - - 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. */ - - -#ifndef XTENSA_CONFIG_CORE_MATMAP_H -#define XTENSA_CONFIG_CORE_MATMAP_H - - -/*---------------------------------------------------------------------- - CACHE (MEMORY ACCESS) ATTRIBUTES - ----------------------------------------------------------------------*/ - - -/* Cache Attribute encodings -- lists of access modes for each cache attribute: */ -#define XCHAL_FCA_LIST XTHAL_FAM_EXCEPTION XCHAL_SEP \ - XTHAL_FAM_BYPASS XCHAL_SEP \ - XTHAL_FAM_BYPASS XCHAL_SEP \ - XTHAL_FAM_BYPASS XCHAL_SEP \ - XTHAL_FAM_BYPASS XCHAL_SEP \ - XTHAL_FAM_BYPASS XCHAL_SEP \ - XTHAL_FAM_BYPASS XCHAL_SEP \ - XTHAL_FAM_EXCEPTION XCHAL_SEP \ - XTHAL_FAM_EXCEPTION XCHAL_SEP \ - XTHAL_FAM_EXCEPTION XCHAL_SEP \ - XTHAL_FAM_EXCEPTION XCHAL_SEP \ - XTHAL_FAM_EXCEPTION XCHAL_SEP \ - XTHAL_FAM_EXCEPTION XCHAL_SEP \ - XTHAL_FAM_EXCEPTION XCHAL_SEP \ - XTHAL_FAM_EXCEPTION XCHAL_SEP \ - XTHAL_FAM_EXCEPTION -#define XCHAL_LCA_LIST XTHAL_LAM_BYPASSG XCHAL_SEP \ - XTHAL_LAM_BYPASSG XCHAL_SEP \ - XTHAL_LAM_BYPASSG XCHAL_SEP \ - XTHAL_LAM_EXCEPTION XCHAL_SEP \ - XTHAL_LAM_BYPASSG XCHAL_SEP \ - XTHAL_LAM_BYPASSG XCHAL_SEP \ - XTHAL_LAM_BYPASSG XCHAL_SEP \ - XTHAL_LAM_EXCEPTION XCHAL_SEP \ - XTHAL_LAM_EXCEPTION XCHAL_SEP \ - XTHAL_LAM_EXCEPTION XCHAL_SEP \ - XTHAL_LAM_EXCEPTION XCHAL_SEP \ - XTHAL_LAM_EXCEPTION XCHAL_SEP \ - XTHAL_LAM_EXCEPTION XCHAL_SEP \ - XTHAL_LAM_EXCEPTION XCHAL_SEP \ - XTHAL_LAM_BYPASSG XCHAL_SEP \ - XTHAL_LAM_EXCEPTION -#define XCHAL_SCA_LIST XTHAL_SAM_BYPASS XCHAL_SEP \ - XTHAL_SAM_BYPASS XCHAL_SEP \ - XTHAL_SAM_BYPASS XCHAL_SEP \ - XTHAL_SAM_EXCEPTION XCHAL_SEP \ - XTHAL_SAM_BYPASS XCHAL_SEP \ - XTHAL_SAM_BYPASS XCHAL_SEP \ - XTHAL_SAM_BYPASS XCHAL_SEP \ - XTHAL_SAM_EXCEPTION XCHAL_SEP \ - XTHAL_SAM_EXCEPTION XCHAL_SEP \ - XTHAL_SAM_EXCEPTION XCHAL_SEP \ - XTHAL_SAM_EXCEPTION XCHAL_SEP \ - XTHAL_SAM_EXCEPTION XCHAL_SEP \ - XTHAL_SAM_EXCEPTION XCHAL_SEP \ - XTHAL_SAM_EXCEPTION XCHAL_SEP \ - XTHAL_SAM_BYPASS XCHAL_SEP \ - XTHAL_SAM_EXCEPTION - - -/* - * Specific encoded cache attribute values of general interest. - * If a specific cache mode is not available, the closest available - * one is returned instead (eg. writethru instead of writeback, - * bypass instead of writethru). - */ -#define XCHAL_CA_BYPASS 2 /* cache disabled (bypassed) mode */ -#define XCHAL_CA_BYPASSBUF 6 /* cache disabled (bypassed) bufferable mode */ -#define XCHAL_CA_WRITETHRU 2 /* cache enabled (write-through) mode */ -#define XCHAL_CA_WRITEBACK 2 /* cache enabled (write-back) mode */ -#define XCHAL_HAVE_CA_WRITEBACK_NOALLOC 0 /* write-back no-allocate availability */ -#define XCHAL_CA_WRITEBACK_NOALLOC 2 /* cache enabled (write-back no-allocate) mode */ -#define XCHAL_CA_BYPASS_RW 0 /* cache disabled (bypassed) mode (no exec) */ -#define XCHAL_CA_WRITETHRU_RW 0 /* cache enabled (write-through) mode (no exec) */ -#define XCHAL_CA_WRITEBACK_RW 0 /* cache enabled (write-back) mode (no exec) */ -#define XCHAL_CA_WRITEBACK_NOALLOC_RW 0 /* cache enabled (write-back no-allocate) mode (no exec) */ -#define XCHAL_CA_ILLEGAL 15 /* no access allowed (all cause exceptions) mode */ -#define XCHAL_CA_ISOLATE 0 /* cache isolate (accesses go to cache not memory) mode */ - - -/*---------------------------------------------------------------------- - MMU - ----------------------------------------------------------------------*/ - -/* - * General notes on MMU parameters. - * - * Terminology: - * ASID = address-space ID (acts as an "extension" of virtual addresses) - * VPN = virtual page number - * PPN = physical page number - * CA = encoded cache attribute (access modes) - * TLB = translation look-aside buffer (term is stretched somewhat here) - * I = instruction (fetch accesses) - * D = data (load and store accesses) - * way = each TLB (ITLB and DTLB) consists of a number of "ways" - * that simultaneously match the virtual address of an access; - * a TLB successfully translates a virtual address if exactly - * one way matches the vaddr; if none match, it is a miss; - * if multiple match, one gets a "multihit" exception; - * each way can be independently configured in terms of number of - * entries, page sizes, which fields are writable or constant, etc. - * set = group of contiguous ways with exactly identical parameters - * ARF = auto-refill; hardware services a 1st-level miss by loading a PTE - * from the page table and storing it in one of the auto-refill ways; - * if this PTE load also misses, a miss exception is posted for s/w. - * min-wired = a "min-wired" way can be used to map a single (minimum-sized) - * page arbitrarily under program control; it has a single entry, - * is non-auto-refill (some other way(s) must be auto-refill), - * all its fields (VPN, PPN, ASID, CA) are all writable, and it - * supports the XCHAL_MMU_MIN_PTE_PAGE_SIZE page size (a current - * restriction is that this be the only page size it supports). - * - * TLB way entries are virtually indexed. - * TLB ways that support multiple page sizes: - * - must have all writable VPN and PPN fields; - * - can only use one page size at any given time (eg. setup at startup), - * selected by the respective ITLBCFG or DTLBCFG special register, - * whose bits n*4+3 .. n*4 index the list of page sizes for way n - * (XCHAL_xTLB_SETm_PAGESZ_LOG2_LIST for set m corresponding to way n); - * this list may be sparse for auto-refill ways because auto-refill - * ways have independent lists of supported page sizes sharing a - * common encoding with PTE entries; the encoding is the index into - * this list; unsupported sizes for a given way are zero in the list; - * selecting unsupported sizes results in undefined hardware behaviour; - * - is only possible for ways 0 thru 7 (due to ITLBCFG/DTLBCFG definition). - */ - -#define XCHAL_MMU_ASID_INVALID 0 /* ASID value indicating invalid address space */ -#define XCHAL_MMU_ASID_KERNEL 0 /* ASID value indicating kernel (ring 0) address space */ -#define XCHAL_MMU_SR_BITS 0 /* number of size-restriction bits supported */ -#define XCHAL_MMU_CA_BITS 4 /* number of bits needed to hold cache attribute encoding */ -#define XCHAL_MMU_MAX_PTE_PAGE_SIZE 29 /* max page size in a PTE structure (log2) */ -#define XCHAL_MMU_MIN_PTE_PAGE_SIZE 29 /* min page size in a PTE structure (log2) */ - - -/*** Instruction TLB: ***/ - -#define XCHAL_ITLB_WAY_BITS 0 /* number of bits holding the ways */ -#define XCHAL_ITLB_WAYS 1 /* number of ways (n-way set-associative TLB) */ -#define XCHAL_ITLB_ARF_WAYS 0 /* number of auto-refill ways */ -#define XCHAL_ITLB_SETS 1 /* number of sets (groups of ways with identical settings) */ - -/* Way set to which each way belongs: */ -#define XCHAL_ITLB_WAY0_SET 0 - -/* Ways sets that are used by hardware auto-refill (ARF): */ -#define XCHAL_ITLB_ARF_SETS 0 /* number of auto-refill sets */ - -/* Way sets that are "min-wired" (see terminology comment above): */ -#define XCHAL_ITLB_MINWIRED_SETS 0 /* number of "min-wired" sets */ - - -/* ITLB way set 0 (group of ways 0 thru 0): */ -#define XCHAL_ITLB_SET0_WAY 0 /* index of first way in this way set */ -#define XCHAL_ITLB_SET0_WAYS 1 /* number of (contiguous) ways in this way set */ -#define XCHAL_ITLB_SET0_ENTRIES_LOG2 3 /* log2(number of entries in this way) */ -#define XCHAL_ITLB_SET0_ENTRIES 8 /* number of entries in this way (always a power of 2) */ -#define XCHAL_ITLB_SET0_ARF 0 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */ -#define XCHAL_ITLB_SET0_PAGESIZES 1 /* number of supported page sizes in this way */ -#define XCHAL_ITLB_SET0_PAGESZ_BITS 0 /* number of bits to encode the page size */ -#define XCHAL_ITLB_SET0_PAGESZ_LOG2_MIN 29 /* log2(minimum supported page size) */ -#define XCHAL_ITLB_SET0_PAGESZ_LOG2_MAX 29 /* log2(maximum supported page size) */ -#define XCHAL_ITLB_SET0_PAGESZ_LOG2_LIST 29 /* list of log2(page size)s, separated by XCHAL_SEP; - 2^PAGESZ_BITS entries in list, unsupported entries are zero */ -#define XCHAL_ITLB_SET0_ASID_CONSTMASK 0 /* constant ASID bits; 0 if all writable */ -#define XCHAL_ITLB_SET0_VPN_CONSTMASK 0x00000000 /* constant VPN bits, not including entry index bits; 0 if all writable */ -#define XCHAL_ITLB_SET0_PPN_CONSTMASK 0xE0000000 /* constant PPN bits, including entry index bits; 0 if all writable */ -#define XCHAL_ITLB_SET0_CA_CONSTMASK 0 /* constant CA bits; 0 if all writable */ -#define XCHAL_ITLB_SET0_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */ -#define XCHAL_ITLB_SET0_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */ -#define XCHAL_ITLB_SET0_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */ -#define XCHAL_ITLB_SET0_CA_RESET 1 /* 1 if CA reset values defined (and all writable); 0 otherwise */ -/* Constant VPN values for each entry of ITLB way set 0 (because VPN_CONSTMASK is non-zero): */ -#define XCHAL_ITLB_SET0_E0_VPN_CONST 0x00000000 -#define XCHAL_ITLB_SET0_E1_VPN_CONST 0x20000000 -#define XCHAL_ITLB_SET0_E2_VPN_CONST 0x40000000 -#define XCHAL_ITLB_SET0_E3_VPN_CONST 0x60000000 -#define XCHAL_ITLB_SET0_E4_VPN_CONST 0x80000000 -#define XCHAL_ITLB_SET0_E5_VPN_CONST 0xA0000000 -#define XCHAL_ITLB_SET0_E6_VPN_CONST 0xC0000000 -#define XCHAL_ITLB_SET0_E7_VPN_CONST 0xE0000000 -/* Constant PPN values for each entry of ITLB way set 0 (because PPN_CONSTMASK is non-zero): */ -#define XCHAL_ITLB_SET0_E0_PPN_CONST 0x00000000 -#define XCHAL_ITLB_SET0_E1_PPN_CONST 0x20000000 -#define XCHAL_ITLB_SET0_E2_PPN_CONST 0x40000000 -#define XCHAL_ITLB_SET0_E3_PPN_CONST 0x60000000 -#define XCHAL_ITLB_SET0_E4_PPN_CONST 0x80000000 -#define XCHAL_ITLB_SET0_E5_PPN_CONST 0xA0000000 -#define XCHAL_ITLB_SET0_E6_PPN_CONST 0xC0000000 -#define XCHAL_ITLB_SET0_E7_PPN_CONST 0xE0000000 -/* Reset CA values for each entry of ITLB way set 0 (because SET0_CA_RESET is non-zero): */ -#define XCHAL_ITLB_SET0_E0_CA_RESET 0x02 -#define XCHAL_ITLB_SET0_E1_CA_RESET 0x02 -#define XCHAL_ITLB_SET0_E2_CA_RESET 0x02 -#define XCHAL_ITLB_SET0_E3_CA_RESET 0x02 -#define XCHAL_ITLB_SET0_E4_CA_RESET 0x02 -#define XCHAL_ITLB_SET0_E5_CA_RESET 0x02 -#define XCHAL_ITLB_SET0_E6_CA_RESET 0x02 -#define XCHAL_ITLB_SET0_E7_CA_RESET 0x02 - - -/*** Data TLB: ***/ - -#define XCHAL_DTLB_WAY_BITS 0 /* number of bits holding the ways */ -#define XCHAL_DTLB_WAYS 1 /* number of ways (n-way set-associative TLB) */ -#define XCHAL_DTLB_ARF_WAYS 0 /* number of auto-refill ways */ -#define XCHAL_DTLB_SETS 1 /* number of sets (groups of ways with identical settings) */ - -/* Way set to which each way belongs: */ -#define XCHAL_DTLB_WAY0_SET 0 - -/* Ways sets that are used by hardware auto-refill (ARF): */ -#define XCHAL_DTLB_ARF_SETS 0 /* number of auto-refill sets */ - -/* Way sets that are "min-wired" (see terminology comment above): */ -#define XCHAL_DTLB_MINWIRED_SETS 0 /* number of "min-wired" sets */ - - -/* DTLB way set 0 (group of ways 0 thru 0): */ -#define XCHAL_DTLB_SET0_WAY 0 /* index of first way in this way set */ -#define XCHAL_DTLB_SET0_WAYS 1 /* number of (contiguous) ways in this way set */ -#define XCHAL_DTLB_SET0_ENTRIES_LOG2 3 /* log2(number of entries in this way) */ -#define XCHAL_DTLB_SET0_ENTRIES 8 /* number of entries in this way (always a power of 2) */ -#define XCHAL_DTLB_SET0_ARF 0 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */ -#define XCHAL_DTLB_SET0_PAGESIZES 1 /* number of supported page sizes in this way */ -#define XCHAL_DTLB_SET0_PAGESZ_BITS 0 /* number of bits to encode the page size */ -#define XCHAL_DTLB_SET0_PAGESZ_LOG2_MIN 29 /* log2(minimum supported page size) */ -#define XCHAL_DTLB_SET0_PAGESZ_LOG2_MAX 29 /* log2(maximum supported page size) */ -#define XCHAL_DTLB_SET0_PAGESZ_LOG2_LIST 29 /* list of log2(page size)s, separated by XCHAL_SEP; - 2^PAGESZ_BITS entries in list, unsupported entries are zero */ -#define XCHAL_DTLB_SET0_ASID_CONSTMASK 0 /* constant ASID bits; 0 if all writable */ -#define XCHAL_DTLB_SET0_VPN_CONSTMASK 0x00000000 /* constant VPN bits, not including entry index bits; 0 if all writable */ -#define XCHAL_DTLB_SET0_PPN_CONSTMASK 0xE0000000 /* constant PPN bits, including entry index bits; 0 if all writable */ -#define XCHAL_DTLB_SET0_CA_CONSTMASK 0 /* constant CA bits; 0 if all writable */ -#define XCHAL_DTLB_SET0_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */ -#define XCHAL_DTLB_SET0_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */ -#define XCHAL_DTLB_SET0_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */ -#define XCHAL_DTLB_SET0_CA_RESET 1 /* 1 if CA reset values defined (and all writable); 0 otherwise */ -/* Constant VPN values for each entry of DTLB way set 0 (because VPN_CONSTMASK is non-zero): */ -#define XCHAL_DTLB_SET0_E0_VPN_CONST 0x00000000 -#define XCHAL_DTLB_SET0_E1_VPN_CONST 0x20000000 -#define XCHAL_DTLB_SET0_E2_VPN_CONST 0x40000000 -#define XCHAL_DTLB_SET0_E3_VPN_CONST 0x60000000 -#define XCHAL_DTLB_SET0_E4_VPN_CONST 0x80000000 -#define XCHAL_DTLB_SET0_E5_VPN_CONST 0xA0000000 -#define XCHAL_DTLB_SET0_E6_VPN_CONST 0xC0000000 -#define XCHAL_DTLB_SET0_E7_VPN_CONST 0xE0000000 -/* Constant PPN values for each entry of DTLB way set 0 (because PPN_CONSTMASK is non-zero): */ -#define XCHAL_DTLB_SET0_E0_PPN_CONST 0x00000000 -#define XCHAL_DTLB_SET0_E1_PPN_CONST 0x20000000 -#define XCHAL_DTLB_SET0_E2_PPN_CONST 0x40000000 -#define XCHAL_DTLB_SET0_E3_PPN_CONST 0x60000000 -#define XCHAL_DTLB_SET0_E4_PPN_CONST 0x80000000 -#define XCHAL_DTLB_SET0_E5_PPN_CONST 0xA0000000 -#define XCHAL_DTLB_SET0_E6_PPN_CONST 0xC0000000 -#define XCHAL_DTLB_SET0_E7_PPN_CONST 0xE0000000 -/* Reset CA values for each entry of DTLB way set 0 (because SET0_CA_RESET is non-zero): */ -#define XCHAL_DTLB_SET0_E0_CA_RESET 0x02 -#define XCHAL_DTLB_SET0_E1_CA_RESET 0x02 -#define XCHAL_DTLB_SET0_E2_CA_RESET 0x02 -#define XCHAL_DTLB_SET0_E3_CA_RESET 0x02 -#define XCHAL_DTLB_SET0_E4_CA_RESET 0x02 -#define XCHAL_DTLB_SET0_E5_CA_RESET 0x02 -#define XCHAL_DTLB_SET0_E6_CA_RESET 0x02 -#define XCHAL_DTLB_SET0_E7_CA_RESET 0x02 - - - - -#endif /*XTENSA_CONFIG_CORE_MATMAP_H*/ - diff --git a/tools/sdk/include/esp32/xtensa/config/core.h b/tools/sdk/include/esp32/xtensa/config/core.h deleted file mode 100644 index 0204757b055..00000000000 --- a/tools/sdk/include/esp32/xtensa/config/core.h +++ /dev/null @@ -1,1416 +0,0 @@ -/* - * xtensa/config/core.h -- HAL definitions dependent on CORE configuration - * - * This header file is sometimes referred to as the "compile-time HAL" or CHAL. - * It pulls definitions tailored for a specific Xtensa processor configuration. - * - * Sources for binaries meant to be configuration-independent generally avoid - * including this file (they may use the configuration-specific HAL library). - * It is normal for the HAL library source itself to include this file. - */ - -/* - * Copyright (c) 2005-2014 Cadence Design Systems, Inc. - * - * 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. - */ - - -#ifndef XTENSA_CONFIG_CORE_H -#define XTENSA_CONFIG_CORE_H - -/* CONFIGURATION INDEPENDENT DEFINITIONS: */ -#ifdef __XTENSA__ -#include -#include -#else -#include "../hal.h" -#include "../xtensa-versions.h" -#endif - -/* CONFIGURATION SPECIFIC DEFINITIONS: */ -#ifdef __XTENSA__ -#include -#include -#include -#else -#include "core-isa.h" -#include "core-matmap.h" -#include "tie.h" -#endif - -#if defined (_ASMLANGUAGE) || defined (__ASSEMBLER__) -#ifdef __XTENSA__ -#include -#else -#include "tie-asm.h" -#endif -#endif /*_ASMLANGUAGE or __ASSEMBLER__*/ - - -/*---------------------------------------------------------------------- - GENERAL - ----------------------------------------------------------------------*/ - -/* - * Separators for macros that expand into arrays. - * These can be predefined by files that #include this one, - * when different separators are required. - */ -/* Element separator for macros that expand into 1-dimensional arrays: */ -#ifndef XCHAL_SEP -#define XCHAL_SEP , -#endif -/* Array separator for macros that expand into 2-dimensional arrays: */ -#ifndef XCHAL_SEP2 -#define XCHAL_SEP2 },{ -#endif - - - -/*---------------------------------------------------------------------- - ISA - ----------------------------------------------------------------------*/ - -#if XCHAL_HAVE_BE -# define XCHAL_HAVE_LE 0 -# define XCHAL_MEMORY_ORDER XTHAL_BIGENDIAN -#else -# define XCHAL_HAVE_LE 1 -# define XCHAL_MEMORY_ORDER XTHAL_LITTLEENDIAN -#endif - - - -/*---------------------------------------------------------------------- - INTERRUPTS - ----------------------------------------------------------------------*/ - -/* Indexing macros: */ -#define _XCHAL_INTLEVEL_MASK(n) XCHAL_INTLEVEL ## n ## _MASK -#define XCHAL_INTLEVEL_MASK(n) _XCHAL_INTLEVEL_MASK(n) /* n = 0 .. 15 */ -#define _XCHAL_INTLEVEL_ANDBELOWMASK(n) XCHAL_INTLEVEL ## n ## _ANDBELOW_MASK -#define XCHAL_INTLEVEL_ANDBELOW_MASK(n) _XCHAL_INTLEVEL_ANDBELOWMASK(n) /* n = 0 .. 15 */ -#define _XCHAL_INTLEVEL_NUM(n) XCHAL_INTLEVEL ## n ## _NUM -#define XCHAL_INTLEVEL_NUM(n) _XCHAL_INTLEVEL_NUM(n) /* n = 0 .. 15 */ -#define _XCHAL_INT_LEVEL(n) XCHAL_INT ## n ## _LEVEL -#define XCHAL_INT_LEVEL(n) _XCHAL_INT_LEVEL(n) /* n = 0 .. 31 */ -#define _XCHAL_INT_TYPE(n) XCHAL_INT ## n ## _TYPE -#define XCHAL_INT_TYPE(n) _XCHAL_INT_TYPE(n) /* n = 0 .. 31 */ -#define _XCHAL_TIMER_INTERRUPT(n) XCHAL_TIMER ## n ## _INTERRUPT -#define XCHAL_TIMER_INTERRUPT(n) _XCHAL_TIMER_INTERRUPT(n) /* n = 0 .. 3 */ - - -#define XCHAL_HAVE_HIGHLEVEL_INTERRUPTS XCHAL_HAVE_HIGHPRI_INTERRUPTS -#define XCHAL_NUM_LOWPRI_LEVELS 1 /* number of low-priority interrupt levels (always 1) */ -#define XCHAL_FIRST_HIGHPRI_LEVEL (XCHAL_NUM_LOWPRI_LEVELS+1) /* level of first high-priority interrupt (always 2) */ -/* Note: 1 <= LOWPRI_LEVELS <= EXCM_LEVEL < DEBUGLEVEL <= NUM_INTLEVELS < NMILEVEL <= 15 */ - -/* These values are constant for existing Xtensa processor implementations: */ -#define XCHAL_INTLEVEL0_MASK 0x00000000 -#define XCHAL_INTLEVEL8_MASK 0x00000000 -#define XCHAL_INTLEVEL9_MASK 0x00000000 -#define XCHAL_INTLEVEL10_MASK 0x00000000 -#define XCHAL_INTLEVEL11_MASK 0x00000000 -#define XCHAL_INTLEVEL12_MASK 0x00000000 -#define XCHAL_INTLEVEL13_MASK 0x00000000 -#define XCHAL_INTLEVEL14_MASK 0x00000000 -#define XCHAL_INTLEVEL15_MASK 0x00000000 - -/* Array of masks of interrupts at each interrupt level: */ -#define XCHAL_INTLEVEL_MASKS XCHAL_INTLEVEL0_MASK \ - XCHAL_SEP XCHAL_INTLEVEL1_MASK \ - XCHAL_SEP XCHAL_INTLEVEL2_MASK \ - XCHAL_SEP XCHAL_INTLEVEL3_MASK \ - XCHAL_SEP XCHAL_INTLEVEL4_MASK \ - XCHAL_SEP XCHAL_INTLEVEL5_MASK \ - XCHAL_SEP XCHAL_INTLEVEL6_MASK \ - XCHAL_SEP XCHAL_INTLEVEL7_MASK \ - XCHAL_SEP XCHAL_INTLEVEL8_MASK \ - XCHAL_SEP XCHAL_INTLEVEL9_MASK \ - XCHAL_SEP XCHAL_INTLEVEL10_MASK \ - XCHAL_SEP XCHAL_INTLEVEL11_MASK \ - XCHAL_SEP XCHAL_INTLEVEL12_MASK \ - XCHAL_SEP XCHAL_INTLEVEL13_MASK \ - XCHAL_SEP XCHAL_INTLEVEL14_MASK \ - XCHAL_SEP XCHAL_INTLEVEL15_MASK - -/* These values are constant for existing Xtensa processor implementations: */ -#define XCHAL_INTLEVEL0_ANDBELOW_MASK 0x00000000 -#define XCHAL_INTLEVEL8_ANDBELOW_MASK XCHAL_INTLEVEL7_ANDBELOW_MASK -#define XCHAL_INTLEVEL9_ANDBELOW_MASK XCHAL_INTLEVEL7_ANDBELOW_MASK -#define XCHAL_INTLEVEL10_ANDBELOW_MASK XCHAL_INTLEVEL7_ANDBELOW_MASK -#define XCHAL_INTLEVEL11_ANDBELOW_MASK XCHAL_INTLEVEL7_ANDBELOW_MASK -#define XCHAL_INTLEVEL12_ANDBELOW_MASK XCHAL_INTLEVEL7_ANDBELOW_MASK -#define XCHAL_INTLEVEL13_ANDBELOW_MASK XCHAL_INTLEVEL7_ANDBELOW_MASK -#define XCHAL_INTLEVEL14_ANDBELOW_MASK XCHAL_INTLEVEL7_ANDBELOW_MASK -#define XCHAL_INTLEVEL15_ANDBELOW_MASK XCHAL_INTLEVEL7_ANDBELOW_MASK - -/* Mask of all low-priority interrupts: */ -#define XCHAL_LOWPRI_MASK XCHAL_INTLEVEL1_ANDBELOW_MASK - -/* Mask of all interrupts masked by PS.EXCM (or CEXCM): */ -#define XCHAL_EXCM_MASK XCHAL_INTLEVEL_ANDBELOW_MASK(XCHAL_EXCM_LEVEL) - -/* Array of masks of interrupts at each range 1..n of interrupt levels: */ -#define XCHAL_INTLEVEL_ANDBELOW_MASKS XCHAL_INTLEVEL0_ANDBELOW_MASK \ - XCHAL_SEP XCHAL_INTLEVEL1_ANDBELOW_MASK \ - XCHAL_SEP XCHAL_INTLEVEL2_ANDBELOW_MASK \ - XCHAL_SEP XCHAL_INTLEVEL3_ANDBELOW_MASK \ - XCHAL_SEP XCHAL_INTLEVEL4_ANDBELOW_MASK \ - XCHAL_SEP XCHAL_INTLEVEL5_ANDBELOW_MASK \ - XCHAL_SEP XCHAL_INTLEVEL6_ANDBELOW_MASK \ - XCHAL_SEP XCHAL_INTLEVEL7_ANDBELOW_MASK \ - XCHAL_SEP XCHAL_INTLEVEL8_ANDBELOW_MASK \ - XCHAL_SEP XCHAL_INTLEVEL9_ANDBELOW_MASK \ - XCHAL_SEP XCHAL_INTLEVEL10_ANDBELOW_MASK \ - XCHAL_SEP XCHAL_INTLEVEL11_ANDBELOW_MASK \ - XCHAL_SEP XCHAL_INTLEVEL12_ANDBELOW_MASK \ - XCHAL_SEP XCHAL_INTLEVEL13_ANDBELOW_MASK \ - XCHAL_SEP XCHAL_INTLEVEL14_ANDBELOW_MASK \ - XCHAL_SEP XCHAL_INTLEVEL15_ANDBELOW_MASK - -#if 0 /*XCHAL_HAVE_NMI*/ -/* NMI "interrupt level" (for use with EXCSAVE_n, EPS_n, EPC_n, RFI n): */ -# define XCHAL_NMILEVEL (XCHAL_NUM_INTLEVELS+1) -#endif - -/* Array of levels of each possible interrupt: */ -#define XCHAL_INT_LEVELS XCHAL_INT0_LEVEL \ - XCHAL_SEP XCHAL_INT1_LEVEL \ - XCHAL_SEP XCHAL_INT2_LEVEL \ - XCHAL_SEP XCHAL_INT3_LEVEL \ - XCHAL_SEP XCHAL_INT4_LEVEL \ - XCHAL_SEP XCHAL_INT5_LEVEL \ - XCHAL_SEP XCHAL_INT6_LEVEL \ - XCHAL_SEP XCHAL_INT7_LEVEL \ - XCHAL_SEP XCHAL_INT8_LEVEL \ - XCHAL_SEP XCHAL_INT9_LEVEL \ - XCHAL_SEP XCHAL_INT10_LEVEL \ - XCHAL_SEP XCHAL_INT11_LEVEL \ - XCHAL_SEP XCHAL_INT12_LEVEL \ - XCHAL_SEP XCHAL_INT13_LEVEL \ - XCHAL_SEP XCHAL_INT14_LEVEL \ - XCHAL_SEP XCHAL_INT15_LEVEL \ - XCHAL_SEP XCHAL_INT16_LEVEL \ - XCHAL_SEP XCHAL_INT17_LEVEL \ - XCHAL_SEP XCHAL_INT18_LEVEL \ - XCHAL_SEP XCHAL_INT19_LEVEL \ - XCHAL_SEP XCHAL_INT20_LEVEL \ - XCHAL_SEP XCHAL_INT21_LEVEL \ - XCHAL_SEP XCHAL_INT22_LEVEL \ - XCHAL_SEP XCHAL_INT23_LEVEL \ - XCHAL_SEP XCHAL_INT24_LEVEL \ - XCHAL_SEP XCHAL_INT25_LEVEL \ - XCHAL_SEP XCHAL_INT26_LEVEL \ - XCHAL_SEP XCHAL_INT27_LEVEL \ - XCHAL_SEP XCHAL_INT28_LEVEL \ - XCHAL_SEP XCHAL_INT29_LEVEL \ - XCHAL_SEP XCHAL_INT30_LEVEL \ - XCHAL_SEP XCHAL_INT31_LEVEL - -/* Array of types of each possible interrupt: */ -#define XCHAL_INT_TYPES XCHAL_INT0_TYPE \ - XCHAL_SEP XCHAL_INT1_TYPE \ - XCHAL_SEP XCHAL_INT2_TYPE \ - XCHAL_SEP XCHAL_INT3_TYPE \ - XCHAL_SEP XCHAL_INT4_TYPE \ - XCHAL_SEP XCHAL_INT5_TYPE \ - XCHAL_SEP XCHAL_INT6_TYPE \ - XCHAL_SEP XCHAL_INT7_TYPE \ - XCHAL_SEP XCHAL_INT8_TYPE \ - XCHAL_SEP XCHAL_INT9_TYPE \ - XCHAL_SEP XCHAL_INT10_TYPE \ - XCHAL_SEP XCHAL_INT11_TYPE \ - XCHAL_SEP XCHAL_INT12_TYPE \ - XCHAL_SEP XCHAL_INT13_TYPE \ - XCHAL_SEP XCHAL_INT14_TYPE \ - XCHAL_SEP XCHAL_INT15_TYPE \ - XCHAL_SEP XCHAL_INT16_TYPE \ - XCHAL_SEP XCHAL_INT17_TYPE \ - XCHAL_SEP XCHAL_INT18_TYPE \ - XCHAL_SEP XCHAL_INT19_TYPE \ - XCHAL_SEP XCHAL_INT20_TYPE \ - XCHAL_SEP XCHAL_INT21_TYPE \ - XCHAL_SEP XCHAL_INT22_TYPE \ - XCHAL_SEP XCHAL_INT23_TYPE \ - XCHAL_SEP XCHAL_INT24_TYPE \ - XCHAL_SEP XCHAL_INT25_TYPE \ - XCHAL_SEP XCHAL_INT26_TYPE \ - XCHAL_SEP XCHAL_INT27_TYPE \ - XCHAL_SEP XCHAL_INT28_TYPE \ - XCHAL_SEP XCHAL_INT29_TYPE \ - XCHAL_SEP XCHAL_INT30_TYPE \ - XCHAL_SEP XCHAL_INT31_TYPE - -/* Array of masks of interrupts for each type of interrupt: */ -#define XCHAL_INTTYPE_MASKS XCHAL_INTTYPE_MASK_UNCONFIGURED \ - XCHAL_SEP XCHAL_INTTYPE_MASK_SOFTWARE \ - XCHAL_SEP XCHAL_INTTYPE_MASK_EXTERN_EDGE \ - XCHAL_SEP XCHAL_INTTYPE_MASK_EXTERN_LEVEL \ - XCHAL_SEP XCHAL_INTTYPE_MASK_TIMER \ - XCHAL_SEP XCHAL_INTTYPE_MASK_NMI \ - XCHAL_SEP XCHAL_INTTYPE_MASK_WRITE_ERROR - -/* Interrupts that can be cleared using the INTCLEAR special register: */ -#define XCHAL_INTCLEARABLE_MASK (XCHAL_INTTYPE_MASK_SOFTWARE+XCHAL_INTTYPE_MASK_EXTERN_EDGE+XCHAL_INTTYPE_MASK_WRITE_ERROR) -/* Interrupts that can be triggered using the INTSET special register: */ -#define XCHAL_INTSETTABLE_MASK XCHAL_INTTYPE_MASK_SOFTWARE - -/* Array of interrupts assigned to each timer (CCOMPARE0 to CCOMPARE3): */ -#define XCHAL_TIMER_INTERRUPTS XCHAL_TIMER0_INTERRUPT \ - XCHAL_SEP XCHAL_TIMER1_INTERRUPT \ - XCHAL_SEP XCHAL_TIMER2_INTERRUPT \ - XCHAL_SEP XCHAL_TIMER3_INTERRUPT - - - -/* For backward compatibility and for the array macros, define macros for - * each unconfigured interrupt number (unfortunately, the value of - * XTHAL_INTTYPE_UNCONFIGURED is not zero): */ -#if XCHAL_NUM_INTERRUPTS == 0 -# define XCHAL_INT0_LEVEL 0 -# define XCHAL_INT0_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 1 -# define XCHAL_INT1_LEVEL 0 -# define XCHAL_INT1_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 2 -# define XCHAL_INT2_LEVEL 0 -# define XCHAL_INT2_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 3 -# define XCHAL_INT3_LEVEL 0 -# define XCHAL_INT3_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 4 -# define XCHAL_INT4_LEVEL 0 -# define XCHAL_INT4_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 5 -# define XCHAL_INT5_LEVEL 0 -# define XCHAL_INT5_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 6 -# define XCHAL_INT6_LEVEL 0 -# define XCHAL_INT6_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 7 -# define XCHAL_INT7_LEVEL 0 -# define XCHAL_INT7_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 8 -# define XCHAL_INT8_LEVEL 0 -# define XCHAL_INT8_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 9 -# define XCHAL_INT9_LEVEL 0 -# define XCHAL_INT9_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 10 -# define XCHAL_INT10_LEVEL 0 -# define XCHAL_INT10_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 11 -# define XCHAL_INT11_LEVEL 0 -# define XCHAL_INT11_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 12 -# define XCHAL_INT12_LEVEL 0 -# define XCHAL_INT12_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 13 -# define XCHAL_INT13_LEVEL 0 -# define XCHAL_INT13_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 14 -# define XCHAL_INT14_LEVEL 0 -# define XCHAL_INT14_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 15 -# define XCHAL_INT15_LEVEL 0 -# define XCHAL_INT15_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 16 -# define XCHAL_INT16_LEVEL 0 -# define XCHAL_INT16_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 17 -# define XCHAL_INT17_LEVEL 0 -# define XCHAL_INT17_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 18 -# define XCHAL_INT18_LEVEL 0 -# define XCHAL_INT18_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 19 -# define XCHAL_INT19_LEVEL 0 -# define XCHAL_INT19_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 20 -# define XCHAL_INT20_LEVEL 0 -# define XCHAL_INT20_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 21 -# define XCHAL_INT21_LEVEL 0 -# define XCHAL_INT21_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 22 -# define XCHAL_INT22_LEVEL 0 -# define XCHAL_INT22_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 23 -# define XCHAL_INT23_LEVEL 0 -# define XCHAL_INT23_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 24 -# define XCHAL_INT24_LEVEL 0 -# define XCHAL_INT24_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 25 -# define XCHAL_INT25_LEVEL 0 -# define XCHAL_INT25_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 26 -# define XCHAL_INT26_LEVEL 0 -# define XCHAL_INT26_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 27 -# define XCHAL_INT27_LEVEL 0 -# define XCHAL_INT27_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 28 -# define XCHAL_INT28_LEVEL 0 -# define XCHAL_INT28_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 29 -# define XCHAL_INT29_LEVEL 0 -# define XCHAL_INT29_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 30 -# define XCHAL_INT30_LEVEL 0 -# define XCHAL_INT30_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif -#if XCHAL_NUM_INTERRUPTS <= 31 -# define XCHAL_INT31_LEVEL 0 -# define XCHAL_INT31_TYPE XTHAL_INTTYPE_UNCONFIGURED -#endif - - -/* - * Masks and levels corresponding to each *external* interrupt. - */ - -#define XCHAL_EXTINT0_MASK (1 << XCHAL_EXTINT0_NUM) -#define XCHAL_EXTINT0_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT0_NUM) -#define XCHAL_EXTINT1_MASK (1 << XCHAL_EXTINT1_NUM) -#define XCHAL_EXTINT1_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT1_NUM) -#define XCHAL_EXTINT2_MASK (1 << XCHAL_EXTINT2_NUM) -#define XCHAL_EXTINT2_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT2_NUM) -#define XCHAL_EXTINT3_MASK (1 << XCHAL_EXTINT3_NUM) -#define XCHAL_EXTINT3_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT3_NUM) -#define XCHAL_EXTINT4_MASK (1 << XCHAL_EXTINT4_NUM) -#define XCHAL_EXTINT4_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT4_NUM) -#define XCHAL_EXTINT5_MASK (1 << XCHAL_EXTINT5_NUM) -#define XCHAL_EXTINT5_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT5_NUM) -#define XCHAL_EXTINT6_MASK (1 << XCHAL_EXTINT6_NUM) -#define XCHAL_EXTINT6_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT6_NUM) -#define XCHAL_EXTINT7_MASK (1 << XCHAL_EXTINT7_NUM) -#define XCHAL_EXTINT7_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT7_NUM) -#define XCHAL_EXTINT8_MASK (1 << XCHAL_EXTINT8_NUM) -#define XCHAL_EXTINT8_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT8_NUM) -#define XCHAL_EXTINT9_MASK (1 << XCHAL_EXTINT9_NUM) -#define XCHAL_EXTINT9_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT9_NUM) -#define XCHAL_EXTINT10_MASK (1 << XCHAL_EXTINT10_NUM) -#define XCHAL_EXTINT10_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT10_NUM) -#define XCHAL_EXTINT11_MASK (1 << XCHAL_EXTINT11_NUM) -#define XCHAL_EXTINT11_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT11_NUM) -#define XCHAL_EXTINT12_MASK (1 << XCHAL_EXTINT12_NUM) -#define XCHAL_EXTINT12_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT12_NUM) -#define XCHAL_EXTINT13_MASK (1 << XCHAL_EXTINT13_NUM) -#define XCHAL_EXTINT13_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT13_NUM) -#define XCHAL_EXTINT14_MASK (1 << XCHAL_EXTINT14_NUM) -#define XCHAL_EXTINT14_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT14_NUM) -#define XCHAL_EXTINT15_MASK (1 << XCHAL_EXTINT15_NUM) -#define XCHAL_EXTINT15_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT15_NUM) -#define XCHAL_EXTINT16_MASK (1 << XCHAL_EXTINT16_NUM) -#define XCHAL_EXTINT16_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT16_NUM) -#define XCHAL_EXTINT17_MASK (1 << XCHAL_EXTINT17_NUM) -#define XCHAL_EXTINT17_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT17_NUM) -#define XCHAL_EXTINT18_MASK (1 << XCHAL_EXTINT18_NUM) -#define XCHAL_EXTINT18_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT18_NUM) -#define XCHAL_EXTINT19_MASK (1 << XCHAL_EXTINT19_NUM) -#define XCHAL_EXTINT19_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT19_NUM) -#define XCHAL_EXTINT20_MASK (1 << XCHAL_EXTINT20_NUM) -#define XCHAL_EXTINT20_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT20_NUM) -#define XCHAL_EXTINT21_MASK (1 << XCHAL_EXTINT21_NUM) -#define XCHAL_EXTINT21_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT21_NUM) -#define XCHAL_EXTINT22_MASK (1 << XCHAL_EXTINT22_NUM) -#define XCHAL_EXTINT22_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT22_NUM) -#define XCHAL_EXTINT23_MASK (1 << XCHAL_EXTINT23_NUM) -#define XCHAL_EXTINT23_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT23_NUM) -#define XCHAL_EXTINT24_MASK (1 << XCHAL_EXTINT24_NUM) -#define XCHAL_EXTINT24_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT24_NUM) -#define XCHAL_EXTINT25_MASK (1 << XCHAL_EXTINT25_NUM) -#define XCHAL_EXTINT25_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT25_NUM) -#define XCHAL_EXTINT26_MASK (1 << XCHAL_EXTINT26_NUM) -#define XCHAL_EXTINT26_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT26_NUM) -#define XCHAL_EXTINT27_MASK (1 << XCHAL_EXTINT27_NUM) -#define XCHAL_EXTINT27_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT27_NUM) -#define XCHAL_EXTINT28_MASK (1 << XCHAL_EXTINT28_NUM) -#define XCHAL_EXTINT28_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT28_NUM) -#define XCHAL_EXTINT29_MASK (1 << XCHAL_EXTINT29_NUM) -#define XCHAL_EXTINT29_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT29_NUM) -#define XCHAL_EXTINT30_MASK (1 << XCHAL_EXTINT30_NUM) -#define XCHAL_EXTINT30_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT30_NUM) -#define XCHAL_EXTINT31_MASK (1 << XCHAL_EXTINT31_NUM) -#define XCHAL_EXTINT31_LEVEL XCHAL_INT_LEVEL(XCHAL_EXTINT31_NUM) - - -/*---------------------------------------------------------------------- - EXCEPTIONS and VECTORS - ----------------------------------------------------------------------*/ - -/* For backward compatibility ONLY -- DO NOT USE (will be removed in future release): */ -#define XCHAL_HAVE_OLD_EXC_ARCH XCHAL_HAVE_XEA1 /* (DEPRECATED) 1 if old exception architecture (XEA1), 0 otherwise (eg. XEA2) */ -#define XCHAL_HAVE_EXCM XCHAL_HAVE_XEA2 /* (DEPRECATED) 1 if PS.EXCM bit exists (currently equals XCHAL_HAVE_TLBS) */ -#ifdef XCHAL_USER_VECTOR_VADDR -#define XCHAL_PROGRAMEXC_VECTOR_VADDR XCHAL_USER_VECTOR_VADDR -#define XCHAL_USEREXC_VECTOR_VADDR XCHAL_USER_VECTOR_VADDR -#endif -#ifdef XCHAL_USER_VECTOR_PADDR -# define XCHAL_PROGRAMEXC_VECTOR_PADDR XCHAL_USER_VECTOR_PADDR -# define XCHAL_USEREXC_VECTOR_PADDR XCHAL_USER_VECTOR_PADDR -#endif -#ifdef XCHAL_KERNEL_VECTOR_VADDR -# define XCHAL_STACKEDEXC_VECTOR_VADDR XCHAL_KERNEL_VECTOR_VADDR -# define XCHAL_KERNELEXC_VECTOR_VADDR XCHAL_KERNEL_VECTOR_VADDR -#endif -#ifdef XCHAL_KERNEL_VECTOR_PADDR -# define XCHAL_STACKEDEXC_VECTOR_PADDR XCHAL_KERNEL_VECTOR_PADDR -# define XCHAL_KERNELEXC_VECTOR_PADDR XCHAL_KERNEL_VECTOR_PADDR -#endif - -#if 0 -#if XCHAL_HAVE_DEBUG -# define XCHAL_DEBUG_VECTOR_VADDR XCHAL_INTLEVEL_VECTOR_VADDR(XCHAL_DEBUGLEVEL) -/* This one should only get defined if the corresponding intlevel paddr macro exists: */ -# define XCHAL_DEBUG_VECTOR_PADDR XCHAL_INTLEVEL_VECTOR_PADDR(XCHAL_DEBUGLEVEL) -#endif -#endif - -/* Indexing macros: */ -#define _XCHAL_INTLEVEL_VECTOR_VADDR(n) XCHAL_INTLEVEL ## n ## _VECTOR_VADDR -#define XCHAL_INTLEVEL_VECTOR_VADDR(n) _XCHAL_INTLEVEL_VECTOR_VADDR(n) /* n = 0 .. 15 */ - -/* - * General Exception Causes - * (values of EXCCAUSE special register set by general exceptions, - * which vector to the user, kernel, or double-exception vectors). - * - * DEPRECATED. Please use the equivalent EXCCAUSE_xxx macros - * defined in . (Note that these have slightly - * different names, they don't just have the XCHAL_ prefix removed.) - */ -#define XCHAL_EXCCAUSE_ILLEGAL_INSTRUCTION 0 /* Illegal Instruction */ -#define XCHAL_EXCCAUSE_SYSTEM_CALL 1 /* System Call */ -#define XCHAL_EXCCAUSE_INSTRUCTION_FETCH_ERROR 2 /* Instruction Fetch Error */ -#define XCHAL_EXCCAUSE_LOAD_STORE_ERROR 3 /* Load Store Error */ -#define XCHAL_EXCCAUSE_LEVEL1_INTERRUPT 4 /* Level 1 Interrupt */ -#define XCHAL_EXCCAUSE_ALLOCA 5 /* Stack Extension Assist */ -#define XCHAL_EXCCAUSE_INTEGER_DIVIDE_BY_ZERO 6 /* Integer Divide by Zero */ -#define XCHAL_EXCCAUSE_SPECULATION 7 /* Speculation */ -#define XCHAL_EXCCAUSE_PRIVILEGED 8 /* Privileged Instruction */ -#define XCHAL_EXCCAUSE_UNALIGNED 9 /* Unaligned Load Store */ -/*10..15 reserved*/ -#define XCHAL_EXCCAUSE_ITLB_MISS 16 /* ITlb Miss Exception */ -#define XCHAL_EXCCAUSE_ITLB_MULTIHIT 17 /* ITlb Mutltihit Exception */ -#define XCHAL_EXCCAUSE_ITLB_PRIVILEGE 18 /* ITlb Privilege Exception */ -#define XCHAL_EXCCAUSE_ITLB_SIZE_RESTRICTION 19 /* ITlb Size Restriction Exception */ -#define XCHAL_EXCCAUSE_FETCH_CACHE_ATTRIBUTE 20 /* Fetch Cache Attribute Exception */ -/*21..23 reserved*/ -#define XCHAL_EXCCAUSE_DTLB_MISS 24 /* DTlb Miss Exception */ -#define XCHAL_EXCCAUSE_DTLB_MULTIHIT 25 /* DTlb Multihit Exception */ -#define XCHAL_EXCCAUSE_DTLB_PRIVILEGE 26 /* DTlb Privilege Exception */ -#define XCHAL_EXCCAUSE_DTLB_SIZE_RESTRICTION 27 /* DTlb Size Restriction Exception */ -#define XCHAL_EXCCAUSE_LOAD_CACHE_ATTRIBUTE 28 /* Load Cache Attribute Exception */ -#define XCHAL_EXCCAUSE_STORE_CACHE_ATTRIBUTE 29 /* Store Cache Attribute Exception */ -/*30..31 reserved*/ -#define XCHAL_EXCCAUSE_COPROCESSOR0_DISABLED 32 /* Coprocessor 0 disabled */ -#define XCHAL_EXCCAUSE_COPROCESSOR1_DISABLED 33 /* Coprocessor 1 disabled */ -#define XCHAL_EXCCAUSE_COPROCESSOR2_DISABLED 34 /* Coprocessor 2 disabled */ -#define XCHAL_EXCCAUSE_COPROCESSOR3_DISABLED 35 /* Coprocessor 3 disabled */ -#define XCHAL_EXCCAUSE_COPROCESSOR4_DISABLED 36 /* Coprocessor 4 disabled */ -#define XCHAL_EXCCAUSE_COPROCESSOR5_DISABLED 37 /* Coprocessor 5 disabled */ -#define XCHAL_EXCCAUSE_COPROCESSOR6_DISABLED 38 /* Coprocessor 6 disabled */ -#define XCHAL_EXCCAUSE_COPROCESSOR7_DISABLED 39 /* Coprocessor 7 disabled */ -/*40..63 reserved*/ - - -/* - * Miscellaneous special register fields. - * - * For each special register, and each field within each register: - * XCHAL__VALIDMASK is the set of bits defined in the register. - * XCHAL___BITS is the number of bits in the field. - * XCHAL___NUM is 2^bits, the number of possible values - * of the field. - * XCHAL___SHIFT is the position of the field within - * the register, starting from the least significant bit. - * - * DEPRECATED. Please use the equivalent macros defined in - * . (Note that these have different names.) - */ - -/* DBREAKC (special register number 160): */ -#define XCHAL_DBREAKC_VALIDMASK 0xC000003F -#define XCHAL_DBREAKC_MASK_BITS 6 -#define XCHAL_DBREAKC_MASK_NUM 64 -#define XCHAL_DBREAKC_MASK_SHIFT 0 -#define XCHAL_DBREAKC_MASK_MASK 0x0000003F -#define XCHAL_DBREAKC_LOADBREAK_BITS 1 -#define XCHAL_DBREAKC_LOADBREAK_NUM 2 -#define XCHAL_DBREAKC_LOADBREAK_SHIFT 30 -#define XCHAL_DBREAKC_LOADBREAK_MASK 0x40000000 -#define XCHAL_DBREAKC_STOREBREAK_BITS 1 -#define XCHAL_DBREAKC_STOREBREAK_NUM 2 -#define XCHAL_DBREAKC_STOREBREAK_SHIFT 31 -#define XCHAL_DBREAKC_STOREBREAK_MASK 0x80000000 -/* PS (special register number 230): */ -#define XCHAL_PS_VALIDMASK 0x00070F3F -#define XCHAL_PS_INTLEVEL_BITS 4 -#define XCHAL_PS_INTLEVEL_NUM 16 -#define XCHAL_PS_INTLEVEL_SHIFT 0 -#define XCHAL_PS_INTLEVEL_MASK 0x0000000F -#define XCHAL_PS_EXCM_BITS 1 -#define XCHAL_PS_EXCM_NUM 2 -#define XCHAL_PS_EXCM_SHIFT 4 -#define XCHAL_PS_EXCM_MASK 0x00000010 -#define XCHAL_PS_UM_BITS 1 -#define XCHAL_PS_UM_NUM 2 -#define XCHAL_PS_UM_SHIFT 5 -#define XCHAL_PS_UM_MASK 0x00000020 -#define XCHAL_PS_RING_BITS 2 -#define XCHAL_PS_RING_NUM 4 -#define XCHAL_PS_RING_SHIFT 6 -#define XCHAL_PS_RING_MASK 0x000000C0 -#define XCHAL_PS_OWB_BITS 4 -#define XCHAL_PS_OWB_NUM 16 -#define XCHAL_PS_OWB_SHIFT 8 -#define XCHAL_PS_OWB_MASK 0x00000F00 -#define XCHAL_PS_CALLINC_BITS 2 -#define XCHAL_PS_CALLINC_NUM 4 -#define XCHAL_PS_CALLINC_SHIFT 16 -#define XCHAL_PS_CALLINC_MASK 0x00030000 -#define XCHAL_PS_WOE_BITS 1 -#define XCHAL_PS_WOE_NUM 2 -#define XCHAL_PS_WOE_SHIFT 18 -#define XCHAL_PS_WOE_MASK 0x00040000 -/* EXCCAUSE (special register number 232): */ -#define XCHAL_EXCCAUSE_VALIDMASK 0x0000003F -#define XCHAL_EXCCAUSE_BITS 6 -#define XCHAL_EXCCAUSE_NUM 64 -#define XCHAL_EXCCAUSE_SHIFT 0 -#define XCHAL_EXCCAUSE_MASK 0x0000003F -/* DEBUGCAUSE (special register number 233): */ -#define XCHAL_DEBUGCAUSE_VALIDMASK 0x0000003F -#define XCHAL_DEBUGCAUSE_ICOUNT_BITS 1 -#define XCHAL_DEBUGCAUSE_ICOUNT_NUM 2 -#define XCHAL_DEBUGCAUSE_ICOUNT_SHIFT 0 -#define XCHAL_DEBUGCAUSE_ICOUNT_MASK 0x00000001 -#define XCHAL_DEBUGCAUSE_IBREAK_BITS 1 -#define XCHAL_DEBUGCAUSE_IBREAK_NUM 2 -#define XCHAL_DEBUGCAUSE_IBREAK_SHIFT 1 -#define XCHAL_DEBUGCAUSE_IBREAK_MASK 0x00000002 -#define XCHAL_DEBUGCAUSE_DBREAK_BITS 1 -#define XCHAL_DEBUGCAUSE_DBREAK_NUM 2 -#define XCHAL_DEBUGCAUSE_DBREAK_SHIFT 2 -#define XCHAL_DEBUGCAUSE_DBREAK_MASK 0x00000004 -#define XCHAL_DEBUGCAUSE_BREAK_BITS 1 -#define XCHAL_DEBUGCAUSE_BREAK_NUM 2 -#define XCHAL_DEBUGCAUSE_BREAK_SHIFT 3 -#define XCHAL_DEBUGCAUSE_BREAK_MASK 0x00000008 -#define XCHAL_DEBUGCAUSE_BREAKN_BITS 1 -#define XCHAL_DEBUGCAUSE_BREAKN_NUM 2 -#define XCHAL_DEBUGCAUSE_BREAKN_SHIFT 4 -#define XCHAL_DEBUGCAUSE_BREAKN_MASK 0x00000010 -#define XCHAL_DEBUGCAUSE_DEBUGINT_BITS 1 -#define XCHAL_DEBUGCAUSE_DEBUGINT_NUM 2 -#define XCHAL_DEBUGCAUSE_DEBUGINT_SHIFT 5 -#define XCHAL_DEBUGCAUSE_DEBUGINT_MASK 0x00000020 - - - - -/*---------------------------------------------------------------------- - TIMERS - ----------------------------------------------------------------------*/ - -/*#define XCHAL_HAVE_TIMERS XCHAL_HAVE_CCOUNT*/ - - - -/*---------------------------------------------------------------------- - INTERNAL I/D RAM/ROMs and XLMI - ----------------------------------------------------------------------*/ - -#define XCHAL_NUM_IROM XCHAL_NUM_INSTROM /* (DEPRECATED) */ -#define XCHAL_NUM_IRAM XCHAL_NUM_INSTRAM /* (DEPRECATED) */ -#define XCHAL_NUM_DROM XCHAL_NUM_DATAROM /* (DEPRECATED) */ -#define XCHAL_NUM_DRAM XCHAL_NUM_DATARAM /* (DEPRECATED) */ - -#define XCHAL_IROM0_VADDR XCHAL_INSTROM0_VADDR /* (DEPRECATED) */ -#define XCHAL_IROM0_PADDR XCHAL_INSTROM0_PADDR /* (DEPRECATED) */ -#define XCHAL_IROM0_SIZE XCHAL_INSTROM0_SIZE /* (DEPRECATED) */ -#define XCHAL_IROM1_VADDR XCHAL_INSTROM1_VADDR /* (DEPRECATED) */ -#define XCHAL_IROM1_PADDR XCHAL_INSTROM1_PADDR /* (DEPRECATED) */ -#define XCHAL_IROM1_SIZE XCHAL_INSTROM1_SIZE /* (DEPRECATED) */ -#define XCHAL_IRAM0_VADDR XCHAL_INSTRAM0_VADDR /* (DEPRECATED) */ -#define XCHAL_IRAM0_PADDR XCHAL_INSTRAM0_PADDR /* (DEPRECATED) */ -#define XCHAL_IRAM0_SIZE XCHAL_INSTRAM0_SIZE /* (DEPRECATED) */ -#define XCHAL_IRAM1_VADDR XCHAL_INSTRAM1_VADDR /* (DEPRECATED) */ -#define XCHAL_IRAM1_PADDR XCHAL_INSTRAM1_PADDR /* (DEPRECATED) */ -#define XCHAL_IRAM1_SIZE XCHAL_INSTRAM1_SIZE /* (DEPRECATED) */ -#define XCHAL_DROM0_VADDR XCHAL_DATAROM0_VADDR /* (DEPRECATED) */ -#define XCHAL_DROM0_PADDR XCHAL_DATAROM0_PADDR /* (DEPRECATED) */ -#define XCHAL_DROM0_SIZE XCHAL_DATAROM0_SIZE /* (DEPRECATED) */ -#define XCHAL_DROM1_VADDR XCHAL_DATAROM1_VADDR /* (DEPRECATED) */ -#define XCHAL_DROM1_PADDR XCHAL_DATAROM1_PADDR /* (DEPRECATED) */ -#define XCHAL_DROM1_SIZE XCHAL_DATAROM1_SIZE /* (DEPRECATED) */ -#define XCHAL_DRAM0_VADDR XCHAL_DATARAM0_VADDR /* (DEPRECATED) */ -#define XCHAL_DRAM0_PADDR XCHAL_DATARAM0_PADDR /* (DEPRECATED) */ -#define XCHAL_DRAM0_SIZE XCHAL_DATARAM0_SIZE /* (DEPRECATED) */ -#define XCHAL_DRAM1_VADDR XCHAL_DATARAM1_VADDR /* (DEPRECATED) */ -#define XCHAL_DRAM1_PADDR XCHAL_DATARAM1_PADDR /* (DEPRECATED) */ -#define XCHAL_DRAM1_SIZE XCHAL_DATARAM1_SIZE /* (DEPRECATED) */ - - - -/*---------------------------------------------------------------------- - CACHE - ----------------------------------------------------------------------*/ - - -/* Default PREFCTL value to enable prefetch. */ -#if XCHAL_HW_MIN_VERSION < XTENSA_HWVERSION_RE_2012_0 -#define XCHAL_CACHE_PREFCTL_DEFAULT 0x00044 /* enabled, not aggressive */ -#elif XCHAL_HW_MIN_VERSION < XTENSA_HWVERSION_RF_2014_0 -#define XCHAL_CACHE_PREFCTL_DEFAULT 0x01044 /* + enable prefetch to L1 */ -#elif XCHAL_PREFETCH_ENTRIES >= 16 -#define XCHAL_CACHE_PREFCTL_DEFAULT 0x81044 /* 12 entries for block ops */ -#elif XCHAL_PREFETCH_ENTRIES >= 8 -#define XCHAL_CACHE_PREFCTL_DEFAULT 0x51044 /* 5 entries for block ops */ -#else -#define XCHAL_CACHE_PREFCTL_DEFAULT 0x01044 /* 0 entries for block ops */ -#endif - - -/* Max for both I-cache and D-cache (used for general alignment): */ -#if XCHAL_ICACHE_LINESIZE > XCHAL_DCACHE_LINESIZE -# define XCHAL_CACHE_LINEWIDTH_MAX XCHAL_ICACHE_LINEWIDTH -# define XCHAL_CACHE_LINESIZE_MAX XCHAL_ICACHE_LINESIZE -#else -# define XCHAL_CACHE_LINEWIDTH_MAX XCHAL_DCACHE_LINEWIDTH -# define XCHAL_CACHE_LINESIZE_MAX XCHAL_DCACHE_LINESIZE -#endif - -#define XCHAL_ICACHE_SETSIZE (1< XCHAL_DCACHE_SETWIDTH -# define XCHAL_CACHE_SETWIDTH_MAX XCHAL_ICACHE_SETWIDTH -# define XCHAL_CACHE_SETSIZE_MAX XCHAL_ICACHE_SETSIZE -#else -# define XCHAL_CACHE_SETWIDTH_MAX XCHAL_DCACHE_SETWIDTH -# define XCHAL_CACHE_SETSIZE_MAX XCHAL_DCACHE_SETSIZE -#endif - -/* Instruction cache tag bits: */ -#define XCHAL_ICACHE_TAG_V_SHIFT 0 -#define XCHAL_ICACHE_TAG_V 0x1 /* valid bit */ -#if XCHAL_ICACHE_WAYS > 1 -# define XCHAL_ICACHE_TAG_F_SHIFT 1 -# define XCHAL_ICACHE_TAG_F 0x2 /* fill (LRU) bit */ -#else -# define XCHAL_ICACHE_TAG_F_SHIFT 0 -# define XCHAL_ICACHE_TAG_F 0 /* no fill (LRU) bit */ -#endif -#if XCHAL_ICACHE_LINE_LOCKABLE -# define XCHAL_ICACHE_TAG_L_SHIFT (XCHAL_ICACHE_TAG_F_SHIFT+1) -# define XCHAL_ICACHE_TAG_L (1 << XCHAL_ICACHE_TAG_L_SHIFT) /* lock bit */ -#else -# define XCHAL_ICACHE_TAG_L_SHIFT XCHAL_ICACHE_TAG_F_SHIFT -# define XCHAL_ICACHE_TAG_L 0 /* no lock bit */ -#endif -/* Data cache tag bits: */ -#define XCHAL_DCACHE_TAG_V_SHIFT 0 -#define XCHAL_DCACHE_TAG_V 0x1 /* valid bit */ -#if XCHAL_DCACHE_WAYS > 1 -# define XCHAL_DCACHE_TAG_F_SHIFT 1 -# define XCHAL_DCACHE_TAG_F 0x2 /* fill (LRU) bit */ -#else -# define XCHAL_DCACHE_TAG_F_SHIFT 0 -# define XCHAL_DCACHE_TAG_F 0 /* no fill (LRU) bit */ -#endif -#if XCHAL_DCACHE_IS_WRITEBACK -# define XCHAL_DCACHE_TAG_D_SHIFT (XCHAL_DCACHE_TAG_F_SHIFT+1) -# define XCHAL_DCACHE_TAG_D (1 << XCHAL_DCACHE_TAG_D_SHIFT) /* dirty bit */ -#else -# define XCHAL_DCACHE_TAG_D_SHIFT XCHAL_DCACHE_TAG_F_SHIFT -# define XCHAL_DCACHE_TAG_D 0 /* no dirty bit */ -#endif -#if XCHAL_DCACHE_LINE_LOCKABLE -# define XCHAL_DCACHE_TAG_L_SHIFT (XCHAL_DCACHE_TAG_D_SHIFT+1) -# define XCHAL_DCACHE_TAG_L (1 << XCHAL_DCACHE_TAG_L_SHIFT) /* lock bit */ -#else -# define XCHAL_DCACHE_TAG_L_SHIFT XCHAL_DCACHE_TAG_D_SHIFT -# define XCHAL_DCACHE_TAG_L 0 /* no lock bit */ -#endif - -/* Whether MEMCTL register has anything useful */ -#define XCHAL_USE_MEMCTL (((XCHAL_LOOP_BUFFER_SIZE > 0) || \ - XCHAL_DCACHE_IS_COHERENT || \ - XCHAL_HAVE_ICACHE_DYN_WAYS || \ - XCHAL_HAVE_DCACHE_DYN_WAYS) && \ - (XCHAL_HW_MIN_VERSION >= XTENSA_HWVERSION_RE_2012_0)) - -/* Default MEMCTL values: */ -#if XCHAL_HAVE_ICACHE_DYN_WAYS || XCHAL_HAVE_DCACHE_DYN_WAYS -/* NOTE: constant defined this way to allow movi instead of l32r in reset code. */ -#define XCHAL_CACHE_MEMCTL_DEFAULT 0xFFFFFF00 /* Init all possible ways */ -#else -#define XCHAL_CACHE_MEMCTL_DEFAULT 0x00000000 /* Nothing to do */ -#endif - -#if XCHAL_DCACHE_IS_COHERENT -#define _MEMCTL_SNOOP_EN 0x02 /* Enable snoop */ -#else -#define _MEMCTL_SNOOP_EN 0x00 /* Don't enable snoop */ -#endif - -#if (XCHAL_LOOP_BUFFER_SIZE == 0) || XCHAL_ERRATUM_453 -#define _MEMCTL_L0IBUF_EN 0x00 /* No loop buffer or don't enable */ -#else -#define _MEMCTL_L0IBUF_EN 0x01 /* Enable loop buffer */ -#endif - -#define XCHAL_SNOOP_LB_MEMCTL_DEFAULT (_MEMCTL_SNOOP_EN | _MEMCTL_L0IBUF_EN) - - -/*---------------------------------------------------------------------- - MMU - ----------------------------------------------------------------------*/ - -/* See for more details. */ - -/* Has different semantic in open source headers (where it means HAVE_PTP_MMU), - so comment out starting with RB-2008.3 release; later, might get - get reintroduced as a synonym for XCHAL_HAVE_PTP_MMU instead: */ -/*#define XCHAL_HAVE_MMU XCHAL_HAVE_TLBS*/ /* (DEPRECATED; use XCHAL_HAVE_TLBS instead) */ - -/* Indexing macros: */ -#define _XCHAL_ITLB_SET(n,_what) XCHAL_ITLB_SET ## n ## _what -#define XCHAL_ITLB_SET(n,what) _XCHAL_ITLB_SET(n, _ ## what ) -#define _XCHAL_ITLB_SET_E(n,i,_what) XCHAL_ITLB_SET ## n ## _E ## i ## _what -#define XCHAL_ITLB_SET_E(n,i,what) _XCHAL_ITLB_SET_E(n,i, _ ## what ) -#define _XCHAL_DTLB_SET(n,_what) XCHAL_DTLB_SET ## n ## _what -#define XCHAL_DTLB_SET(n,what) _XCHAL_DTLB_SET(n, _ ## what ) -#define _XCHAL_DTLB_SET_E(n,i,_what) XCHAL_DTLB_SET ## n ## _E ## i ## _what -#define XCHAL_DTLB_SET_E(n,i,what) _XCHAL_DTLB_SET_E(n,i, _ ## what ) -/* - * Example use: XCHAL_ITLB_SET(XCHAL_ITLB_ARF_SET0,ENTRIES) - * to get the value of XCHAL_ITLB_SET_ENTRIES where is the first auto-refill set. - */ - -/* Number of entries per autorefill way: */ -#define XCHAL_ITLB_ARF_ENTRIES (1< 0 && XCHAL_DTLB_ARF_WAYS > 0 && XCHAL_MMU_RINGS >= 2 -# define XCHAL_HAVE_PTP_MMU 1 /* have full MMU (with page table [autorefill] and protection) */ -#else -# define XCHAL_HAVE_PTP_MMU 0 /* don't have full MMU */ -#endif -#endif - -/* - * For full MMUs, report kernel RAM segment and kernel I/O segment static page mappings: - */ -#if XCHAL_HAVE_PTP_MMU && !XCHAL_HAVE_SPANNING_WAY -#define XCHAL_KSEG_CACHED_VADDR 0xD0000000 /* virt.addr of kernel RAM cached static map */ -#define XCHAL_KSEG_CACHED_PADDR 0x00000000 /* phys.addr of kseg_cached */ -#define XCHAL_KSEG_CACHED_SIZE 0x08000000 /* size in bytes of kseg_cached (assumed power of 2!!!) */ -#define XCHAL_KSEG_BYPASS_VADDR 0xD8000000 /* virt.addr of kernel RAM bypass (uncached) static map */ -#define XCHAL_KSEG_BYPASS_PADDR 0x00000000 /* phys.addr of kseg_bypass */ -#define XCHAL_KSEG_BYPASS_SIZE 0x08000000 /* size in bytes of kseg_bypass (assumed power of 2!!!) */ - -#define XCHAL_KIO_CACHED_VADDR 0xE0000000 /* virt.addr of kernel I/O cached static map */ -#define XCHAL_KIO_CACHED_PADDR 0xF0000000 /* phys.addr of kio_cached */ -#define XCHAL_KIO_CACHED_SIZE 0x10000000 /* size in bytes of kio_cached (assumed power of 2!!!) */ -#define XCHAL_KIO_BYPASS_VADDR 0xF0000000 /* virt.addr of kernel I/O bypass (uncached) static map */ -#define XCHAL_KIO_BYPASS_PADDR 0xF0000000 /* phys.addr of kio_bypass */ -#define XCHAL_KIO_BYPASS_SIZE 0x10000000 /* size in bytes of kio_bypass (assumed power of 2!!!) */ - -#define XCHAL_SEG_MAPPABLE_VADDR 0x00000000 /* start of largest non-static-mapped virtual addr area */ -#define XCHAL_SEG_MAPPABLE_SIZE 0xD0000000 /* size in bytes of " */ -/* define XCHAL_SEG_MAPPABLE2_xxx if more areas present, sorted in order of descending size. */ -#endif - - -/*---------------------------------------------------------------------- - MISC - ----------------------------------------------------------------------*/ - -/* Data alignment required if used for instructions: */ -#if XCHAL_INST_FETCH_WIDTH > XCHAL_DATA_WIDTH -# define XCHAL_ALIGN_MAX XCHAL_INST_FETCH_WIDTH -#else -# define XCHAL_ALIGN_MAX XCHAL_DATA_WIDTH -#endif - -/* - * Names kept for backward compatibility. - * (Here "RELEASE" is now a misnomer; these are product *versions*, not the releases - * under which they are released. In the T10##.# era there was no distinction.) - */ -#define XCHAL_HW_RELEASE_MAJOR XCHAL_HW_VERSION_MAJOR -#define XCHAL_HW_RELEASE_MINOR XCHAL_HW_VERSION_MINOR -#define XCHAL_HW_RELEASE_NAME XCHAL_HW_VERSION_NAME - - - - -/*---------------------------------------------------------------------- - COPROCESSORS and EXTRA STATE - ----------------------------------------------------------------------*/ - -#define XCHAL_EXTRA_SA_SIZE XCHAL_NCP_SA_SIZE -#define XCHAL_EXTRA_SA_ALIGN XCHAL_NCP_SA_ALIGN -#define XCHAL_CPEXTRA_SA_SIZE XCHAL_TOTAL_SA_SIZE -#define XCHAL_CPEXTRA_SA_ALIGN XCHAL_TOTAL_SA_ALIGN - -#if defined (_ASMLANGUAGE) || defined (__ASSEMBLER__) - - /* Invoked at start of save area load/store sequence macro to setup macro - * internal offsets. Not usually invoked directly. - * continue 0 for 1st sequence, 1 for subsequent consecutive ones. - * totofs offset from original ptr to next load/store location. - */ - .macro xchal_sa_start continue totofs - .ifeq \continue - .set .Lxchal_pofs_, 0 /* offset from original ptr to current \ptr */ - .set .Lxchal_ofs_, 0 /* offset from current \ptr to next load/store location */ - .endif - .if \totofs + 1 /* if totofs specified (not -1) */ - .set .Lxchal_ofs_, \totofs - .Lxchal_pofs_ /* specific offset from original ptr */ - .endif - .endm - - /* Align portion of save area and bring ptr in range if necessary. - * Used by save area load/store sequences. Not usually invoked directly. - * Allows combining multiple (sub-)sequences arbitrarily. - * ptr pointer to save area (may be off, see .Lxchal_pofs_) - * minofs,maxofs range of offset from cur ptr to next load/store loc; - * minofs <= 0 <= maxofs (0 must always be valid offset) - * range must be within +/- 30kB or so. - * ofsalign alignment granularity of minofs .. maxofs (pow of 2) - * (restriction on offset from ptr to next load/store loc) - * totalign align from orig ptr to next load/store loc (pow of 2) - */ - .macro xchal_sa_align ptr minofs maxofs ofsalign totalign - /* First align where we start accessing the next register - * per \totalign relative to original ptr (i.e. start of the save area): - */ - .set .Lxchal_ofs_, ((.Lxchal_pofs_ + .Lxchal_ofs_ + \totalign - 1) & -\totalign) - .Lxchal_pofs_ - /* If necessary, adjust \ptr to bring .Lxchal_ofs_ in acceptable range: */ - .if (((\maxofs) - .Lxchal_ofs_) & 0xC0000000) | ((.Lxchal_ofs_ - (\minofs)) & 0xC0000000) | (.Lxchal_ofs_ & (\ofsalign-1)) - .set .Ligmask, 0xFFFFFFFF /* TODO: optimize to addmi, per aligns and .Lxchal_ofs_ */ - addi \ptr, \ptr, (.Lxchal_ofs_ & .Ligmask) - .set .Lxchal_pofs_, .Lxchal_pofs_ + (.Lxchal_ofs_ & .Ligmask) - .set .Lxchal_ofs_, (.Lxchal_ofs_ & ~.Ligmask) - .endif - .endm - /* - * We could optimize for addi to expand to only addmi instead of - * "addmi;addi", where possible. Here's a partial example how: - * .set .Lmaxmask, -(\ofsalign) & -(\totalign) - * .if (((\maxofs) + ~.Lmaxmask + 1) & 0xFFFFFF00) && ((.Lxchal_ofs_ & ~.Lmaxmask) == 0) - * .set .Ligmask, 0xFFFFFF00 - * .elif ... ditto for negative ofs range ... - * .set .Ligmask, 0xFFFFFF00 - * .set ... adjust per offset ... - * .else - * .set .Ligmask, 0xFFFFFFFF - * .endif - */ - - /* Invoke this after xchal_XXX_{load,store} macros to restore \ptr. */ - .macro xchal_sa_ptr_restore ptr - .if .Lxchal_pofs_ - addi \ptr, \ptr, - .Lxchal_pofs_ - .set .Lxchal_ofs_, .Lxchal_ofs_ + .Lxchal_pofs_ - .set .Lxchal_pofs_, 0 - .endif - .endm - - /* - * Use as eg: - * xchal_atmps_store a1, SOMEOFS, XCHAL_SA_NUM_ATMPS, a4, a5 - * xchal_ncp_load a2, a0,a3,a4,a5 - * xchal_atmps_load a1, SOMEOFS, XCHAL_SA_NUM_ATMPS, a4, a5 - * - * Specify only the ARs you *haven't* saved/restored already, up to 4. - * They *must* be the *last* ARs (in same order) specified to save area - * load/store sequences. In the example above, a0 and a3 were already - * saved/restored and unused (thus available) but a4 and a5 were not. - */ -#define xchal_atmps_store xchal_atmps_loadstore s32i, -#define xchal_atmps_load xchal_atmps_loadstore l32i, - .macro xchal_atmps_loadstore inst ptr offset nreq aa=0 ab=0 ac=0 ad=0 - .set .Lnsaved_, 0 - .irp reg,\aa,\ab,\ac,\ad - .ifeq 0x\reg ; .set .Lnsaved_,.Lnsaved_+1 ; .endif - .endr - .set .Laofs_, 0 - .irp reg,\aa,\ab,\ac,\ad - .ifgt (\nreq)-.Lnsaved_ - \inst \reg, \ptr, .Laofs_+\offset - .set .Laofs_,.Laofs_+4 - .set .Lnsaved_,.Lnsaved_+1 - .endif - .endr - .endm - -/*#define xchal_ncp_load_a2 xchal_ncp_load a2,a3,a4,a5,a6*/ -/*#define xchal_ncp_store_a2 xchal_ncp_store a2,a3,a4,a5,a6*/ -#define xchal_extratie_load xchal_ncptie_load -#define xchal_extratie_store xchal_ncptie_store -#define xchal_extratie_load_a2 xchal_ncptie_load a2,a3,a4,a5,a6 -#define xchal_extratie_store_a2 xchal_ncptie_store a2,a3,a4,a5,a6 -#define xchal_extra_load xchal_ncp_load -#define xchal_extra_store xchal_ncp_store -#define xchal_extra_load_a2 xchal_ncp_load a2,a3,a4,a5,a6 -#define xchal_extra_store_a2 xchal_ncp_store a2,a3,a4,a5,a6 -#define xchal_extra_load_funcbody xchal_ncp_load a2,a3,a4,a5,a6 -#define xchal_extra_store_funcbody xchal_ncp_store a2,a3,a4,a5,a6 -#define xchal_cp0_store_a2 xchal_cp0_store a2,a3,a4,a5,a6 -#define xchal_cp0_load_a2 xchal_cp0_load a2,a3,a4,a5,a6 -#define xchal_cp1_store_a2 xchal_cp1_store a2,a3,a4,a5,a6 -#define xchal_cp1_load_a2 xchal_cp1_load a2,a3,a4,a5,a6 -#define xchal_cp2_store_a2 xchal_cp2_store a2,a3,a4,a5,a6 -#define xchal_cp2_load_a2 xchal_cp2_load a2,a3,a4,a5,a6 -#define xchal_cp3_store_a2 xchal_cp3_store a2,a3,a4,a5,a6 -#define xchal_cp3_load_a2 xchal_cp3_load a2,a3,a4,a5,a6 -#define xchal_cp4_store_a2 xchal_cp4_store a2,a3,a4,a5,a6 -#define xchal_cp4_load_a2 xchal_cp4_load a2,a3,a4,a5,a6 -#define xchal_cp5_store_a2 xchal_cp5_store a2,a3,a4,a5,a6 -#define xchal_cp5_load_a2 xchal_cp5_load a2,a3,a4,a5,a6 -#define xchal_cp6_store_a2 xchal_cp6_store a2,a3,a4,a5,a6 -#define xchal_cp6_load_a2 xchal_cp6_load a2,a3,a4,a5,a6 -#define xchal_cp7_store_a2 xchal_cp7_store a2,a3,a4,a5,a6 -#define xchal_cp7_load_a2 xchal_cp7_load a2,a3,a4,a5,a6 - -/* Empty placeholder macros for undefined coprocessors: */ -#if (XCHAL_CP_MASK & ~XCHAL_CP_PORT_MASK) == 0 -# if XCHAL_CP0_SA_SIZE == 0 - .macro xchal_cp0_store p a b c d continue=0 ofs=-1 select=-1 ; .endm - .macro xchal_cp0_load p a b c d continue=0 ofs=-1 select=-1 ; .endm -# endif -# if XCHAL_CP1_SA_SIZE == 0 - .macro xchal_cp1_store p a b c d continue=0 ofs=-1 select=-1 ; .endm - .macro xchal_cp1_load p a b c d continue=0 ofs=-1 select=-1 ; .endm -# endif -# if XCHAL_CP2_SA_SIZE == 0 - .macro xchal_cp2_store p a b c d continue=0 ofs=-1 select=-1 ; .endm - .macro xchal_cp2_load p a b c d continue=0 ofs=-1 select=-1 ; .endm -# endif -# if XCHAL_CP3_SA_SIZE == 0 - .macro xchal_cp3_store p a b c d continue=0 ofs=-1 select=-1 ; .endm - .macro xchal_cp3_load p a b c d continue=0 ofs=-1 select=-1 ; .endm -# endif -# if XCHAL_CP4_SA_SIZE == 0 - .macro xchal_cp4_store p a b c d continue=0 ofs=-1 select=-1 ; .endm - .macro xchal_cp4_load p a b c d continue=0 ofs=-1 select=-1 ; .endm -# endif -# if XCHAL_CP5_SA_SIZE == 0 - .macro xchal_cp5_store p a b c d continue=0 ofs=-1 select=-1 ; .endm - .macro xchal_cp5_load p a b c d continue=0 ofs=-1 select=-1 ; .endm -# endif -# if XCHAL_CP6_SA_SIZE == 0 - .macro xchal_cp6_store p a b c d continue=0 ofs=-1 select=-1 ; .endm - .macro xchal_cp6_load p a b c d continue=0 ofs=-1 select=-1 ; .endm -# endif -# if XCHAL_CP7_SA_SIZE == 0 - .macro xchal_cp7_store p a b c d continue=0 ofs=-1 select=-1 ; .endm - .macro xchal_cp7_load p a b c d continue=0 ofs=-1 select=-1 ; .endm -# endif -#endif - - /******************** - * Macros to create functions that save and restore the state of *any* TIE - * coprocessor (by dynamic index). - */ - - /* - * Macro that expands to the body of a function - * that stores the selected coprocessor's state (registers etc). - * Entry: a2 = ptr to save area in which to save cp state - * a3 = coprocessor number - * Exit: any register a2-a15 (?) may have been clobbered. - */ - .macro xchal_cpi_store_funcbody -#if (XCHAL_CP_MASK & ~XCHAL_CP_PORT_MASK) -# if XCHAL_CP0_SA_SIZE - bnez a3, 99f - xchal_cp0_store_a2 - j 90f -99: -# endif -# if XCHAL_CP1_SA_SIZE - bnei a3, 1, 99f - xchal_cp1_store_a2 - j 90f -99: -# endif -# if XCHAL_CP2_SA_SIZE - bnei a3, 2, 99f - xchal_cp2_store_a2 - j 90f -99: -# endif -# if XCHAL_CP3_SA_SIZE - bnei a3, 3, 99f - xchal_cp3_store_a2 - j 90f -99: -# endif -# if XCHAL_CP4_SA_SIZE - bnei a3, 4, 99f - xchal_cp4_store_a2 - j 90f -99: -# endif -# if XCHAL_CP5_SA_SIZE - bnei a3, 5, 99f - xchal_cp5_store_a2 - j 90f -99: -# endif -# if XCHAL_CP6_SA_SIZE - bnei a3, 6, 99f - xchal_cp6_store_a2 - j 90f -99: -# endif -# if XCHAL_CP7_SA_SIZE - bnei a3, 7, 99f - xchal_cp7_store_a2 - j 90f -99: -# endif -90: -#endif - .endm - - /* - * Macro that expands to the body of a function - * that loads the selected coprocessor's state (registers etc). - * Entry: a2 = ptr to save area from which to restore cp state - * a3 = coprocessor number - * Exit: any register a2-a15 (?) may have been clobbered. - */ - .macro xchal_cpi_load_funcbody -#if (XCHAL_CP_MASK & ~XCHAL_CP_PORT_MASK) -# if XCHAL_CP0_SA_SIZE - bnez a3, 99f - xchal_cp0_load_a2 - j 90f -99: -# endif -# if XCHAL_CP1_SA_SIZE - bnei a3, 1, 99f - xchal_cp1_load_a2 - j 90f -99: -# endif -# if XCHAL_CP2_SA_SIZE - bnei a3, 2, 99f - xchal_cp2_load_a2 - j 90f -99: -# endif -# if XCHAL_CP3_SA_SIZE - bnei a3, 3, 99f - xchal_cp3_load_a2 - j 90f -99: -# endif -# if XCHAL_CP4_SA_SIZE - bnei a3, 4, 99f - xchal_cp4_load_a2 - j 90f -99: -# endif -# if XCHAL_CP5_SA_SIZE - bnei a3, 5, 99f - xchal_cp5_load_a2 - j 90f -99: -# endif -# if XCHAL_CP6_SA_SIZE - bnei a3, 6, 99f - xchal_cp6_load_a2 - j 90f -99: -# endif -# if XCHAL_CP7_SA_SIZE - bnei a3, 7, 99f - xchal_cp7_load_a2 - j 90f -99: -# endif -90: -#endif - .endm - -#endif /*_ASMLANGUAGE or __ASSEMBLER__*/ - - -/* Other default macros for undefined coprocessors: */ -#ifndef XCHAL_CP0_NAME -# define XCHAL_CP0_NAME 0 -# define XCHAL_CP0_SA_CONTENTS_LIBDB_NUM 0 -# define XCHAL_CP0_SA_CONTENTS_LIBDB /* empty */ -#endif -#ifndef XCHAL_CP1_NAME -# define XCHAL_CP1_NAME 0 -# define XCHAL_CP1_SA_CONTENTS_LIBDB_NUM 0 -# define XCHAL_CP1_SA_CONTENTS_LIBDB /* empty */ -#endif -#ifndef XCHAL_CP2_NAME -# define XCHAL_CP2_NAME 0 -# define XCHAL_CP2_SA_CONTENTS_LIBDB_NUM 0 -# define XCHAL_CP2_SA_CONTENTS_LIBDB /* empty */ -#endif -#ifndef XCHAL_CP3_NAME -# define XCHAL_CP3_NAME 0 -# define XCHAL_CP3_SA_CONTENTS_LIBDB_NUM 0 -# define XCHAL_CP3_SA_CONTENTS_LIBDB /* empty */ -#endif -#ifndef XCHAL_CP4_NAME -# define XCHAL_CP4_NAME 0 -# define XCHAL_CP4_SA_CONTENTS_LIBDB_NUM 0 -# define XCHAL_CP4_SA_CONTENTS_LIBDB /* empty */ -#endif -#ifndef XCHAL_CP5_NAME -# define XCHAL_CP5_NAME 0 -# define XCHAL_CP5_SA_CONTENTS_LIBDB_NUM 0 -# define XCHAL_CP5_SA_CONTENTS_LIBDB /* empty */ -#endif -#ifndef XCHAL_CP6_NAME -# define XCHAL_CP6_NAME 0 -# define XCHAL_CP6_SA_CONTENTS_LIBDB_NUM 0 -# define XCHAL_CP6_SA_CONTENTS_LIBDB /* empty */ -#endif -#ifndef XCHAL_CP7_NAME -# define XCHAL_CP7_NAME 0 -# define XCHAL_CP7_SA_CONTENTS_LIBDB_NUM 0 -# define XCHAL_CP7_SA_CONTENTS_LIBDB /* empty */ -#endif - -#if XCHAL_CP_MASK == 0 -/* Filler info for unassigned coprocessors, to simplify arrays etc: */ -#define XCHAL_CP0_SA_SIZE 0 -#define XCHAL_CP0_SA_ALIGN 1 -#define XCHAL_CP1_SA_SIZE 0 -#define XCHAL_CP1_SA_ALIGN 1 -#define XCHAL_CP2_SA_SIZE 0 -#define XCHAL_CP2_SA_ALIGN 1 -#define XCHAL_CP3_SA_SIZE 0 -#define XCHAL_CP3_SA_ALIGN 1 -#define XCHAL_CP4_SA_SIZE 0 -#define XCHAL_CP4_SA_ALIGN 1 -#define XCHAL_CP5_SA_SIZE 0 -#define XCHAL_CP5_SA_ALIGN 1 -#define XCHAL_CP6_SA_SIZE 0 -#define XCHAL_CP6_SA_ALIGN 1 -#define XCHAL_CP7_SA_SIZE 0 -#define XCHAL_CP7_SA_ALIGN 1 -#endif - - -/* Indexing macros: */ -#define _XCHAL_CP_SA_SIZE(n) XCHAL_CP ## n ## _SA_SIZE -#define XCHAL_CP_SA_SIZE(n) _XCHAL_CP_SA_SIZE(n) /* n = 0 .. 7 */ -#define _XCHAL_CP_SA_ALIGN(n) XCHAL_CP ## n ## _SA_ALIGN -#define XCHAL_CP_SA_ALIGN(n) _XCHAL_CP_SA_ALIGN(n) /* n = 0 .. 7 */ - -#define XCHAL_CPEXTRA_SA_SIZE_TOR2 XCHAL_CPEXTRA_SA_SIZE /* Tor2Beta only - do not use */ - -/* Link-time HAL global variables that report coprocessor numbers by name - (names are case-preserved from the original TIE): */ -#if !defined(_ASMLANGUAGE) && !defined(_NOCLANGUAGE) && !defined(__ASSEMBLER__) -# define _XCJOIN(a,b) a ## b -# define XCJOIN(a,b) _XCJOIN(a,b) -# ifdef XCHAL_CP0_NAME -extern const unsigned char XCJOIN(Xthal_cp_id_,XCHAL_CP0_IDENT); -extern const unsigned int XCJOIN(Xthal_cp_mask_,XCHAL_CP0_IDENT); -# endif -# ifdef XCHAL_CP1_NAME -extern const unsigned char XCJOIN(Xthal_cp_id_,XCHAL_CP1_IDENT); -extern const unsigned int XCJOIN(Xthal_cp_mask_,XCHAL_CP1_IDENT); -# endif -# ifdef XCHAL_CP2_NAME -extern const unsigned char XCJOIN(Xthal_cp_id_,XCHAL_CP2_IDENT); -extern const unsigned int XCJOIN(Xthal_cp_mask_,XCHAL_CP2_IDENT); -# endif -# ifdef XCHAL_CP3_NAME -extern const unsigned char XCJOIN(Xthal_cp_id_,XCHAL_CP3_IDENT); -extern const unsigned int XCJOIN(Xthal_cp_mask_,XCHAL_CP3_IDENT); -# endif -# ifdef XCHAL_CP4_NAME -extern const unsigned char XCJOIN(Xthal_cp_id_,XCHAL_CP4_IDENT); -extern const unsigned int XCJOIN(Xthal_cp_mask_,XCHAL_CP4_IDENT); -# endif -# ifdef XCHAL_CP5_NAME -extern const unsigned char XCJOIN(Xthal_cp_id_,XCHAL_CP5_IDENT); -extern const unsigned int XCJOIN(Xthal_cp_mask_,XCHAL_CP5_IDENT); -# endif -# ifdef XCHAL_CP6_NAME -extern const unsigned char XCJOIN(Xthal_cp_id_,XCHAL_CP6_IDENT); -extern const unsigned int XCJOIN(Xthal_cp_mask_,XCHAL_CP6_IDENT); -# endif -# ifdef XCHAL_CP7_NAME -extern const unsigned char XCJOIN(Xthal_cp_id_,XCHAL_CP7_IDENT); -extern const unsigned int XCJOIN(Xthal_cp_mask_,XCHAL_CP7_IDENT); -# endif -#endif - - - - -/*---------------------------------------------------------------------- - DERIVED - ----------------------------------------------------------------------*/ - -#if XCHAL_HAVE_BE -#define XCHAL_INST_ILLN 0xD60F /* 2-byte illegal instruction, msb-first */ -#define XCHAL_INST_ILLN_BYTE0 0xD6 /* 2-byte illegal instruction, 1st byte */ -#define XCHAL_INST_ILLN_BYTE1 0x0F /* 2-byte illegal instruction, 2nd byte */ -#else -#define XCHAL_INST_ILLN 0xF06D /* 2-byte illegal instruction, lsb-first */ -#define XCHAL_INST_ILLN_BYTE0 0x6D /* 2-byte illegal instruction, 1st byte */ -#define XCHAL_INST_ILLN_BYTE1 0xF0 /* 2-byte illegal instruction, 2nd byte */ -#endif -/* Belongs in xtensa/hal.h: */ -#define XTHAL_INST_ILL 0x000000 /* 3-byte illegal instruction */ - - -/* - * Because information as to exactly which hardware version is targeted - * by a given software build is not always available, compile-time HAL - * Hardware-Release "_AT" macros are fuzzy (return 0, 1, or XCHAL_MAYBE): - * (Here "RELEASE" is now a misnomer; these are product *versions*, not the releases - * under which they are released. In the T10##.# era there was no distinction.) - */ -#if XCHAL_HW_CONFIGID_RELIABLE -# define XCHAL_HW_RELEASE_AT_OR_BELOW(major,minor) (XTHAL_REL_LE( XCHAL_HW_VERSION_MAJOR,XCHAL_HW_VERSION_MINOR, major,minor ) ? 1 : 0) -# define XCHAL_HW_RELEASE_AT_OR_ABOVE(major,minor) (XTHAL_REL_GE( XCHAL_HW_VERSION_MAJOR,XCHAL_HW_VERSION_MINOR, major,minor ) ? 1 : 0) -# define XCHAL_HW_RELEASE_AT(major,minor) (XTHAL_REL_EQ( XCHAL_HW_VERSION_MAJOR,XCHAL_HW_VERSION_MINOR, major,minor ) ? 1 : 0) -# define XCHAL_HW_RELEASE_MAJOR_AT(major) ((XCHAL_HW_VERSION_MAJOR == (major)) ? 1 : 0) -#else -# define XCHAL_HW_RELEASE_AT_OR_BELOW(major,minor) ( ((major) < 1040 && XCHAL_HAVE_XEA2) ? 0 \ - : ((major) > 1050 && XCHAL_HAVE_XEA1) ? 1 \ - : XTHAL_MAYBE ) -# define XCHAL_HW_RELEASE_AT_OR_ABOVE(major,minor) ( ((major) >= 2000 && XCHAL_HAVE_XEA1) ? 0 \ - : (XTHAL_REL_LE(major,minor, 1040,0) && XCHAL_HAVE_XEA2) ? 1 \ - : XTHAL_MAYBE ) -# define XCHAL_HW_RELEASE_AT(major,minor) ( (((major) < 1040 && XCHAL_HAVE_XEA2) || \ - ((major) >= 2000 && XCHAL_HAVE_XEA1)) ? 0 : XTHAL_MAYBE) -# define XCHAL_HW_RELEASE_MAJOR_AT(major) XCHAL_HW_RELEASE_AT(major,0) -#endif - -/* - * Specific errata: - */ - -/* - * Erratum T1020.H13, T1030.H7, T1040.H10, T1050.H4 (fixed in T1040.3 and T1050.1; - * relevant only in XEA1, kernel-vector mode, level-one interrupts and overflows enabled): - */ -#define XCHAL_MAYHAVE_ERRATUM_XEA1KWIN (XCHAL_HAVE_XEA1 && \ - (XCHAL_HW_RELEASE_AT_OR_BELOW(1040,2) != 0 \ - || XCHAL_HW_RELEASE_AT(1050,0))) -/* - * Erratum 453 present in RE-2013.2 up to RF-2014.0, fixed in RF-2014.1. - * Applies to specific set of configuration options. - * Part of the workaround is to add ISYNC at certain points in the code. - * The workaround gated by this macro can be disabled if not needed, e.g. if - * zero-overhead loop buffer will be disabled, by defining _NO_ERRATUM_453. - */ -#if ( XCHAL_HW_MAX_VERSION >= XTENSA_HWVERSION_RE_2013_2 && \ - XCHAL_HW_MIN_VERSION <= XTENSA_HWVERSION_RF_2014_0 && \ - XCHAL_ICACHE_SIZE != 0 && XCHAL_HAVE_PIF /*covers also AXI/AHB*/ && \ - XCHAL_HAVE_LOOPS && XCHAL_LOOP_BUFFER_SIZE != 0 && \ - XCHAL_CLOCK_GATING_GLOBAL && !defined(_NO_ERRATUM_453) ) -#define XCHAL_ERRATUM_453 1 -#else -#define XCHAL_ERRATUM_453 0 -#endif - -/* - * Erratum 497 present in RE-2012.2 up to RG/RF-2015.2 - * Applies to specific set of configuration options. - * Workaround is to add MEMWs after at most 8 cache WB instructions - */ -#if ( ((XCHAL_HW_MAX_VERSION >= XTENSA_HWVERSION_RE_2012_0 && \ - XCHAL_HW_MIN_VERSION <= XTENSA_HWVERSION_RF_2015_2) || \ - (XCHAL_HW_MAX_VERSION >= XTENSA_HWVERSION_RG_2015_0 && \ - XCHAL_HW_MIN_VERSION <= XTENSA_HWVERSION_RG_2015_2) \ - ) && \ - XCHAL_DCACHE_IS_WRITEBACK && \ - XCHAL_HAVE_AXI && \ - XCHAL_HAVE_PIF_WR_RESP && \ - XCHAL_HAVE_PIF_REQ_ATTR && !defined(_NO_ERRATUM_497) \ - ) -#define XCHAL_ERRATUM_497 1 -#else -#define XCHAL_ERRATUM_497 0 -#endif - -/* - * Erratum 572 (releases TBD, but present in ESP32) - * Disable zero-overhead loop buffer to prevent rare illegal instruction - * exceptions while executing zero-overhead loops. - */ -#if ( XCHAL_HAVE_LOOPS && XCHAL_LOOP_BUFFER_SIZE != 0 ) -#define XCHAL_ERRATUM_572 1 -#else -#define XCHAL_ERRATUM_572 0 -#endif - -#endif /*XTENSA_CONFIG_CORE_H*/ - diff --git a/tools/sdk/include/esp32/xtensa/config/defs.h b/tools/sdk/include/esp32/xtensa/config/defs.h deleted file mode 100644 index d7c48ea84ab..00000000000 --- a/tools/sdk/include/esp32/xtensa/config/defs.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Definitions for Xtensa instructions, types, and protos. */ - -/* Customer ID=11657; Build=0x5fe96; Copyright (c) 2003-2004 Tensilica Inc. - - 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. */ - -/* NOTE: This file exists only for backward compatibility with T1050 - and earlier Xtensa releases. It includes only a subset of the - available header files. */ - -#ifndef _XTENSA_BASE_HEADER -#define _XTENSA_BASE_HEADER - -#ifdef __XTENSA__ - -#include -#include -#include - -#endif /* __XTENSA__ */ -#endif /* !_XTENSA_BASE_HEADER */ diff --git a/tools/sdk/include/esp32/xtensa/config/specreg.h b/tools/sdk/include/esp32/xtensa/config/specreg.h deleted file mode 100644 index 0135d4c7f5a..00000000000 --- a/tools/sdk/include/esp32/xtensa/config/specreg.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Xtensa Special Register symbolic names - */ - -/* $Id: //depot/rel/Eaglenest/Xtensa/SWConfig/hal/specreg.h.tpp#1 $ */ - -/* Customer ID=11657; Build=0x5fe96; Copyright (c) 1998-2002 Tensilica Inc. - - 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. */ - -#ifndef XTENSA_SPECREG_H -#define XTENSA_SPECREG_H - -/* Include these special register bitfield definitions, for historical reasons: */ -#include - - -/* Special registers: */ -#define LBEG 0 -#define LEND 1 -#define LCOUNT 2 -#define SAR 3 -#define BR 4 -#define SCOMPARE1 12 -#define ACCLO 16 -#define ACCHI 17 -#define MR_0 32 -#define MR_1 33 -#define MR_2 34 -#define MR_3 35 -#define WINDOWBASE 72 -#define WINDOWSTART 73 -#define IBREAKENABLE 96 -#define MEMCTL 97 -#define ATOMCTL 99 -#define DDR 104 -#define IBREAKA_0 128 -#define IBREAKA_1 129 -#define DBREAKA_0 144 -#define DBREAKA_1 145 -#define DBREAKC_0 160 -#define DBREAKC_1 161 -#define EPC_1 177 -#define EPC_2 178 -#define EPC_3 179 -#define EPC_4 180 -#define EPC_5 181 -#define EPC_6 182 -#define EPC_7 183 -#define DEPC 192 -#define EPS_2 194 -#define EPS_3 195 -#define EPS_4 196 -#define EPS_5 197 -#define EPS_6 198 -#define EPS_7 199 -#define EXCSAVE_1 209 -#define EXCSAVE_2 210 -#define EXCSAVE_3 211 -#define EXCSAVE_4 212 -#define EXCSAVE_5 213 -#define EXCSAVE_6 214 -#define EXCSAVE_7 215 -#define CPENABLE 224 -#define INTERRUPT 226 -#define INTENABLE 228 -#define PS 230 -#define VECBASE 231 -#define EXCCAUSE 232 -#define DEBUGCAUSE 233 -#define CCOUNT 234 -#define PRID 235 -#define ICOUNT 236 -#define ICOUNTLEVEL 237 -#define EXCVADDR 238 -#define CCOMPARE_0 240 -#define CCOMPARE_1 241 -#define CCOMPARE_2 242 -#define MISC_REG_0 244 -#define MISC_REG_1 245 -#define MISC_REG_2 246 -#define MISC_REG_3 247 - -/* Special cases (bases of special register series): */ -#define MR 32 -#define IBREAKA 128 -#define DBREAKA 144 -#define DBREAKC 160 -#define EPC 176 -#define EPS 192 -#define EXCSAVE 208 -#define CCOMPARE 240 - -/* Special names for read-only and write-only interrupt registers: */ -#define INTREAD 226 -#define INTSET 226 -#define INTCLEAR 227 - -#endif /* XTENSA_SPECREG_H */ - diff --git a/tools/sdk/include/esp32/xtensa/config/system.h b/tools/sdk/include/esp32/xtensa/config/system.h deleted file mode 100644 index 0d56eef74fc..00000000000 --- a/tools/sdk/include/esp32/xtensa/config/system.h +++ /dev/null @@ -1,274 +0,0 @@ -/* - * xtensa/config/system.h -- HAL definitions that are dependent on SYSTEM configuration - * - * NOTE: The location and contents of this file are highly subject to change. - * - * Source for configuration-independent binaries (which link in a - * configuration-specific HAL library) must NEVER include this file. - * The HAL itself has historically included this file in some instances, - * but this is not appropriate either, because the HAL is meant to be - * core-specific but system independent. - */ - -/* Customer ID=11657; Build=0x5fe96; Copyright (c) 2000-2010 Tensilica Inc. - - 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. */ - - -#ifndef XTENSA_CONFIG_SYSTEM_H -#define XTENSA_CONFIG_SYSTEM_H - -/*#include */ - - - -/*---------------------------------------------------------------------- - CONFIGURED SOFTWARE OPTIONS - ----------------------------------------------------------------------*/ - -#define XSHAL_USE_ABSOLUTE_LITERALS 0 /* (sw-only option, whether software uses absolute literals) */ -#define XSHAL_HAVE_TEXT_SECTION_LITERALS 1 /* Set if there is some memory that allows both code and literals. */ - -#define XSHAL_ABI XTHAL_ABI_WINDOWED /* (sw-only option, selected ABI) */ -/* The above maps to one of the following constants: */ -#define XTHAL_ABI_WINDOWED 0 -#define XTHAL_ABI_CALL0 1 -/* Alternatives: */ -/*#define XSHAL_WINDOWED_ABI 1*/ /* set if windowed ABI selected */ -/*#define XSHAL_CALL0_ABI 0*/ /* set if call0 ABI selected */ - -#define XSHAL_CLIB XTHAL_CLIB_NEWLIB /* (sw-only option, selected C library) */ -/* The above maps to one of the following constants: */ -#define XTHAL_CLIB_NEWLIB 0 -#define XTHAL_CLIB_UCLIBC 1 -#define XTHAL_CLIB_XCLIB 2 -/* Alternatives: */ -/*#define XSHAL_NEWLIB 1*/ /* set if newlib C library selected */ -/*#define XSHAL_UCLIBC 0*/ /* set if uCLibC C library selected */ -/*#define XSHAL_XCLIB 0*/ /* set if Xtensa C library selected */ - -#define XSHAL_USE_FLOATING_POINT 1 - -#define XSHAL_FLOATING_POINT_ABI 0 - -/* SW workarounds enabled for HW errata: */ - -/*---------------------------------------------------------------------- - DEVICE ADDRESSES - ----------------------------------------------------------------------*/ - -/* - * Strange place to find these, but the configuration GUI - * allows moving these around to account for various core - * configurations. Specific boards (and their BSP software) - * will have specific meanings for these components. - */ - -/* I/O Block areas: */ -#define XSHAL_IOBLOCK_CACHED_VADDR 0x70000000 -#define XSHAL_IOBLOCK_CACHED_PADDR 0x70000000 -#define XSHAL_IOBLOCK_CACHED_SIZE 0x0E000000 - -#define XSHAL_IOBLOCK_BYPASS_VADDR 0x90000000 -#define XSHAL_IOBLOCK_BYPASS_PADDR 0x90000000 -#define XSHAL_IOBLOCK_BYPASS_SIZE 0x0E000000 - -/* System ROM: */ -#define XSHAL_ROM_VADDR 0x50000000 -#define XSHAL_ROM_PADDR 0x50000000 -#define XSHAL_ROM_SIZE 0x01000000 -/* Largest available area (free of vectors): */ -#define XSHAL_ROM_AVAIL_VADDR 0x50000000 -#define XSHAL_ROM_AVAIL_VSIZE 0x01000000 - -/* System RAM: */ -#define XSHAL_RAM_VADDR 0x60000000 -#define XSHAL_RAM_PADDR 0x60000000 -#define XSHAL_RAM_VSIZE 0x20000000 -#define XSHAL_RAM_PSIZE 0x20000000 -#define XSHAL_RAM_SIZE XSHAL_RAM_PSIZE -/* Largest available area (free of vectors): */ -#define XSHAL_RAM_AVAIL_VADDR 0x60000000 -#define XSHAL_RAM_AVAIL_VSIZE 0x20000000 - -/* - * Shadow system RAM (same device as system RAM, at different address). - * (Emulation boards need this for the SONIC Ethernet driver - * when data caches are configured for writeback mode.) - * NOTE: on full MMU configs, this points to the BYPASS virtual address - * of system RAM, ie. is the same as XSHAL_RAM_* except that virtual - * addresses are viewed through the BYPASS static map rather than - * the CACHED static map. - */ -#define XSHAL_RAM_BYPASS_VADDR 0xA0000000 -#define XSHAL_RAM_BYPASS_PADDR 0xA0000000 -#define XSHAL_RAM_BYPASS_PSIZE 0x20000000 - -/* Alternate system RAM (different device than system RAM): */ -/*#define XSHAL_ALTRAM_[VP]ADDR ...not configured...*/ -/*#define XSHAL_ALTRAM_SIZE ...not configured...*/ - -/* Some available location in which to place devices in a simulation (eg. XTMP): */ -#define XSHAL_SIMIO_CACHED_VADDR 0xC0000000 -#define XSHAL_SIMIO_BYPASS_VADDR 0xC0000000 -#define XSHAL_SIMIO_PADDR 0xC0000000 -#define XSHAL_SIMIO_SIZE 0x20000000 - - -/*---------------------------------------------------------------------- - * For use by reference testbench exit and diagnostic routines. - */ -#define XSHAL_MAGIC_EXIT 0x0 - -/*---------------------------------------------------------------------- - * DEVICE-ADDRESS DEPENDENT... - * - * Values written to CACHEATTR special register (or its equivalent) - * to enable and disable caches in various modes. - *----------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------- - BACKWARD COMPATIBILITY ... - ----------------------------------------------------------------------*/ - -/* - * NOTE: the following two macros are DEPRECATED. Use the latter - * board-specific macros instead, which are specially tuned for the - * particular target environments' memory maps. - */ -#define XSHAL_CACHEATTR_BYPASS XSHAL_XT2000_CACHEATTR_BYPASS /* disable caches in bypass mode */ -#define XSHAL_CACHEATTR_DEFAULT XSHAL_XT2000_CACHEATTR_DEFAULT /* default setting to enable caches (no writeback!) */ - -/*---------------------------------------------------------------------- - GENERIC - ----------------------------------------------------------------------*/ - -/* For the following, a 512MB region is used if it contains a system (PIF) RAM, - * system (PIF) ROM, local memory, or XLMI. */ - -/* These set any unused 512MB region to cache-BYPASS attribute: */ -#define XSHAL_ALLVALID_CACHEATTR_WRITEBACK 0x22221112 /* enable caches in write-back mode */ -#define XSHAL_ALLVALID_CACHEATTR_WRITEALLOC 0x22221112 /* enable caches in write-allocate mode */ -#define XSHAL_ALLVALID_CACHEATTR_WRITETHRU 0x22221112 /* enable caches in write-through mode */ -#define XSHAL_ALLVALID_CACHEATTR_BYPASS 0x22222222 /* disable caches in bypass mode */ -#define XSHAL_ALLVALID_CACHEATTR_DEFAULT XSHAL_ALLVALID_CACHEATTR_WRITEBACK /* default setting to enable caches */ - -/* These set any unused 512MB region to ILLEGAL attribute: */ -#define XSHAL_STRICT_CACHEATTR_WRITEBACK 0xFFFF111F /* enable caches in write-back mode */ -#define XSHAL_STRICT_CACHEATTR_WRITEALLOC 0xFFFF111F /* enable caches in write-allocate mode */ -#define XSHAL_STRICT_CACHEATTR_WRITETHRU 0xFFFF111F /* enable caches in write-through mode */ -#define XSHAL_STRICT_CACHEATTR_BYPASS 0xFFFF222F /* disable caches in bypass mode */ -#define XSHAL_STRICT_CACHEATTR_DEFAULT XSHAL_STRICT_CACHEATTR_WRITEBACK /* default setting to enable caches */ - -/* These set the first 512MB, if unused, to ILLEGAL attribute to help catch - * NULL-pointer dereference bugs; all other unused 512MB regions are set - * to cache-BYPASS attribute: */ -#define XSHAL_TRAPNULL_CACHEATTR_WRITEBACK 0x2222111F /* enable caches in write-back mode */ -#define XSHAL_TRAPNULL_CACHEATTR_WRITEALLOC 0x2222111F /* enable caches in write-allocate mode */ -#define XSHAL_TRAPNULL_CACHEATTR_WRITETHRU 0x2222111F /* enable caches in write-through mode */ -#define XSHAL_TRAPNULL_CACHEATTR_BYPASS 0x2222222F /* disable caches in bypass mode */ -#define XSHAL_TRAPNULL_CACHEATTR_DEFAULT XSHAL_TRAPNULL_CACHEATTR_WRITEBACK /* default setting to enable caches */ - -/*---------------------------------------------------------------------- - ISS (Instruction Set Simulator) SPECIFIC ... - ----------------------------------------------------------------------*/ - -/* For now, ISS defaults to the TRAPNULL settings: */ -#define XSHAL_ISS_CACHEATTR_WRITEBACK XSHAL_TRAPNULL_CACHEATTR_WRITEBACK -#define XSHAL_ISS_CACHEATTR_WRITEALLOC XSHAL_TRAPNULL_CACHEATTR_WRITEALLOC -#define XSHAL_ISS_CACHEATTR_WRITETHRU XSHAL_TRAPNULL_CACHEATTR_WRITETHRU -#define XSHAL_ISS_CACHEATTR_BYPASS XSHAL_TRAPNULL_CACHEATTR_BYPASS -#define XSHAL_ISS_CACHEATTR_DEFAULT XSHAL_TRAPNULL_CACHEATTR_WRITEBACK - -#define XSHAL_ISS_PIPE_REGIONS 0 -#define XSHAL_ISS_SDRAM_REGIONS 0 - - -/*---------------------------------------------------------------------- - XT2000 BOARD SPECIFIC ... - ----------------------------------------------------------------------*/ - -/* For the following, a 512MB region is used if it contains any system RAM, - * system ROM, local memory, XLMI, or other XT2000 board device or memory. - * Regions containing devices are forced to cache-BYPASS mode regardless - * of whether the macro is _WRITEBACK vs. _BYPASS etc. */ - -/* These set any 512MB region unused on the XT2000 to ILLEGAL attribute: */ -#define XSHAL_XT2000_CACHEATTR_WRITEBACK 0xFF22111F /* enable caches in write-back mode */ -#define XSHAL_XT2000_CACHEATTR_WRITEALLOC 0xFF22111F /* enable caches in write-allocate mode */ -#define XSHAL_XT2000_CACHEATTR_WRITETHRU 0xFF22111F /* enable caches in write-through mode */ -#define XSHAL_XT2000_CACHEATTR_BYPASS 0xFF22222F /* disable caches in bypass mode */ -#define XSHAL_XT2000_CACHEATTR_DEFAULT XSHAL_XT2000_CACHEATTR_WRITEBACK /* default setting to enable caches */ - -#define XSHAL_XT2000_PIPE_REGIONS 0x00000000 /* BusInt pipeline regions */ -#define XSHAL_XT2000_SDRAM_REGIONS 0x00000440 /* BusInt SDRAM regions */ - - -/*---------------------------------------------------------------------- - VECTOR INFO AND SIZES - ----------------------------------------------------------------------*/ - -#define XSHAL_VECTORS_PACKED 0 -#define XSHAL_STATIC_VECTOR_SELECT 1 -#define XSHAL_RESET_VECTOR_VADDR 0x40000400 -#define XSHAL_RESET_VECTOR_PADDR 0x40000400 - -/* - * Sizes allocated to vectors by the system (memory map) configuration. - * These sizes are constrained by core configuration (eg. one vector's - * code cannot overflow into another vector) but are dependent on the - * system or board (or LSP) memory map configuration. - * - * Whether or not each vector happens to be in a system ROM is also - * a system configuration matter, sometimes useful, included here also: - */ -#define XSHAL_RESET_VECTOR_SIZE 0x00000300 -#define XSHAL_RESET_VECTOR_ISROM 0 -#define XSHAL_USER_VECTOR_SIZE 0x00000038 -#define XSHAL_USER_VECTOR_ISROM 0 -#define XSHAL_PROGRAMEXC_VECTOR_SIZE XSHAL_USER_VECTOR_SIZE /* for backward compatibility */ -#define XSHAL_USEREXC_VECTOR_SIZE XSHAL_USER_VECTOR_SIZE /* for backward compatibility */ -#define XSHAL_KERNEL_VECTOR_SIZE 0x00000038 -#define XSHAL_KERNEL_VECTOR_ISROM 0 -#define XSHAL_STACKEDEXC_VECTOR_SIZE XSHAL_KERNEL_VECTOR_SIZE /* for backward compatibility */ -#define XSHAL_KERNELEXC_VECTOR_SIZE XSHAL_KERNEL_VECTOR_SIZE /* for backward compatibility */ -#define XSHAL_DOUBLEEXC_VECTOR_SIZE 0x00000040 -#define XSHAL_DOUBLEEXC_VECTOR_ISROM 0 -#define XSHAL_WINDOW_VECTORS_SIZE 0x00000178 -#define XSHAL_WINDOW_VECTORS_ISROM 0 -#define XSHAL_INTLEVEL2_VECTOR_SIZE 0x00000038 -#define XSHAL_INTLEVEL2_VECTOR_ISROM 0 -#define XSHAL_INTLEVEL3_VECTOR_SIZE 0x00000038 -#define XSHAL_INTLEVEL3_VECTOR_ISROM 0 -#define XSHAL_INTLEVEL4_VECTOR_SIZE 0x00000038 -#define XSHAL_INTLEVEL4_VECTOR_ISROM 0 -#define XSHAL_INTLEVEL5_VECTOR_SIZE 0x00000038 -#define XSHAL_INTLEVEL5_VECTOR_ISROM 0 -#define XSHAL_INTLEVEL6_VECTOR_SIZE 0x00000038 -#define XSHAL_INTLEVEL6_VECTOR_ISROM 0 -#define XSHAL_DEBUG_VECTOR_SIZE XSHAL_INTLEVEL6_VECTOR_SIZE -#define XSHAL_DEBUG_VECTOR_ISROM XSHAL_INTLEVEL6_VECTOR_ISROM -#define XSHAL_NMI_VECTOR_SIZE 0x00000038 -#define XSHAL_NMI_VECTOR_ISROM 0 -#define XSHAL_INTLEVEL7_VECTOR_SIZE XSHAL_NMI_VECTOR_SIZE - - -#endif /*XTENSA_CONFIG_SYSTEM_H*/ - diff --git a/tools/sdk/include/esp32/xtensa/config/tie-asm.h b/tools/sdk/include/esp32/xtensa/config/tie-asm.h deleted file mode 100644 index 831d8676ae2..00000000000 --- a/tools/sdk/include/esp32/xtensa/config/tie-asm.h +++ /dev/null @@ -1,323 +0,0 @@ -/* - * tie-asm.h -- compile-time HAL assembler definitions dependent on CORE & TIE - * - * NOTE: This header file is not meant to be included directly. - */ - -/* This header file contains assembly-language definitions (assembly - macros, etc.) for this specific Xtensa processor's TIE extensions - and options. It is customized to this Xtensa processor configuration. - - Customer ID=11657; Build=0x5fe96; Copyright (c) 1999-2016 Cadence Design Systems Inc. - - 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. */ - -#ifndef _XTENSA_CORE_TIE_ASM_H -#define _XTENSA_CORE_TIE_ASM_H - -/* Selection parameter values for save-area save/restore macros: */ -/* Option vs. TIE: */ -#define XTHAL_SAS_TIE 0x0001 /* custom extension or coprocessor */ -#define XTHAL_SAS_OPT 0x0002 /* optional (and not a coprocessor) */ -#define XTHAL_SAS_ANYOT 0x0003 /* both of the above */ -/* Whether used automatically by compiler: */ -#define XTHAL_SAS_NOCC 0x0004 /* not used by compiler w/o special opts/code */ -#define XTHAL_SAS_CC 0x0008 /* used by compiler without special opts/code */ -#define XTHAL_SAS_ANYCC 0x000C /* both of the above */ -/* ABI handling across function calls: */ -#define XTHAL_SAS_CALR 0x0010 /* caller-saved */ -#define XTHAL_SAS_CALE 0x0020 /* callee-saved */ -#define XTHAL_SAS_GLOB 0x0040 /* global across function calls (in thread) */ -#define XTHAL_SAS_ANYABI 0x0070 /* all of the above three */ -/* Misc */ -#define XTHAL_SAS_ALL 0xFFFF /* include all default NCP contents */ -#define XTHAL_SAS3(optie,ccuse,abi) ( ((optie) & XTHAL_SAS_ANYOT) \ - | ((ccuse) & XTHAL_SAS_ANYCC) \ - | ((abi) & XTHAL_SAS_ANYABI) ) - - - /* - * Macro to store all non-coprocessor (extra) custom TIE and optional state - * (not including zero-overhead loop registers). - * Required parameters: - * ptr Save area pointer address register (clobbered) - * (register must contain a 4 byte aligned address). - * at1..at4 Four temporary address registers (first XCHAL_NCP_NUM_ATMPS - * registers are clobbered, the remaining are unused). - * Optional parameters: - * continue If macro invoked as part of a larger store sequence, set to 1 - * if this is not the first in the sequence. Defaults to 0. - * ofs Offset from start of larger sequence (from value of first ptr - * in sequence) at which to store. Defaults to next available space - * (or 0 if is 0). - * select Select what category(ies) of registers to store, as a bitmask - * (see XTHAL_SAS_xxx constants). Defaults to all registers. - * alloc Select what category(ies) of registers to allocate; if any - * category is selected here that is not in , space for - * the corresponding registers is skipped without doing any load. - */ - .macro xchal_ncp_load ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0 - xchal_sa_start \continue, \ofs - // Optional global registers used by default by the compiler: - .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~(\select) - xchal_sa_align \ptr, 0, 1016, 4, 4 - l32i \at1, \ptr, .Lxchal_ofs_+0 - wur.THREADPTR \at1 // threadptr option - .set .Lxchal_ofs_, .Lxchal_ofs_ + 4 - .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~(\alloc)) == 0 - xchal_sa_align \ptr, 0, 1016, 4, 4 - .set .Lxchal_ofs_, .Lxchal_ofs_ + 4 - .endif - // Optional caller-saved registers used by default by the compiler: - .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~(\select) - xchal_sa_align \ptr, 0, 1012, 4, 4 - l32i \at1, \ptr, .Lxchal_ofs_+0 - wsr.ACCLO \at1 // MAC16 option - l32i \at1, \ptr, .Lxchal_ofs_+4 - wsr.ACCHI \at1 // MAC16 option - .set .Lxchal_ofs_, .Lxchal_ofs_ + 8 - .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~(\alloc)) == 0 - xchal_sa_align \ptr, 0, 1012, 4, 4 - .set .Lxchal_ofs_, .Lxchal_ofs_ + 8 - .endif - // Optional caller-saved registers not used by default by the compiler: - .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\select) - xchal_sa_align \ptr, 0, 996, 4, 4 - l32i \at1, \ptr, .Lxchal_ofs_+0 - wsr.BR \at1 // boolean option - l32i \at1, \ptr, .Lxchal_ofs_+4 - wsr.SCOMPARE1 \at1 // conditional store option - l32i \at1, \ptr, .Lxchal_ofs_+8 - wsr.M0 \at1 // MAC16 option - l32i \at1, \ptr, .Lxchal_ofs_+12 - wsr.M1 \at1 // MAC16 option - l32i \at1, \ptr, .Lxchal_ofs_+16 - wsr.M2 \at1 // MAC16 option - l32i \at1, \ptr, .Lxchal_ofs_+20 - wsr.M3 \at1 // MAC16 option - .set .Lxchal_ofs_, .Lxchal_ofs_ + 24 - .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0 - xchal_sa_align \ptr, 0, 996, 4, 4 - .set .Lxchal_ofs_, .Lxchal_ofs_ + 24 - .endif - // Custom caller-saved registers not used by default by the compiler: - .ifeq (XTHAL_SAS_TIE | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\select) - xchal_sa_align \ptr, 0, 1008, 4, 4 - l32i \at1, \ptr, .Lxchal_ofs_+0 - wur.F64R_LO \at1 // ureg 234 - l32i \at1, \ptr, .Lxchal_ofs_+4 - wur.F64R_HI \at1 // ureg 235 - l32i \at1, \ptr, .Lxchal_ofs_+8 - wur.F64S \at1 // ureg 236 - .set .Lxchal_ofs_, .Lxchal_ofs_ + 12 - .elseif ((XTHAL_SAS_TIE | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0 - xchal_sa_align \ptr, 0, 1008, 4, 4 - .set .Lxchal_ofs_, .Lxchal_ofs_ + 12 - .endif - .endm // xchal_ncp_load - - -#define XCHAL_NCP_NUM_ATMPS 1 - - /* - * Macro to store the state of TIE coprocessor FPU. - * Required parameters: - * ptr Save area pointer address register (clobbered) - * (register must contain a 4 byte aligned address). - * at1..at4 Four temporary address registers (first XCHAL_CP0_NUM_ATMPS - * registers are clobbered, the remaining are unused). - * Optional parameters are the same as for xchal_ncp_store. - */ -#define xchal_cp_FPU_store xchal_cp0_store - .macro xchal_cp0_store ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0 - xchal_sa_start \continue, \ofs - // Custom caller-saved registers not used by default by the compiler: - .ifeq (XTHAL_SAS_TIE | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\select) - xchal_sa_align \ptr, 0, 948, 4, 4 - rur.FCR \at1 // ureg 232 - s32i \at1, \ptr, .Lxchal_ofs_+0 - rur.FSR \at1 // ureg 233 - s32i \at1, \ptr, .Lxchal_ofs_+4 - ssi f0, \ptr, .Lxchal_ofs_+8 - ssi f1, \ptr, .Lxchal_ofs_+12 - ssi f2, \ptr, .Lxchal_ofs_+16 - ssi f3, \ptr, .Lxchal_ofs_+20 - ssi f4, \ptr, .Lxchal_ofs_+24 - ssi f5, \ptr, .Lxchal_ofs_+28 - ssi f6, \ptr, .Lxchal_ofs_+32 - ssi f7, \ptr, .Lxchal_ofs_+36 - ssi f8, \ptr, .Lxchal_ofs_+40 - ssi f9, \ptr, .Lxchal_ofs_+44 - ssi f10, \ptr, .Lxchal_ofs_+48 - ssi f11, \ptr, .Lxchal_ofs_+52 - ssi f12, \ptr, .Lxchal_ofs_+56 - ssi f13, \ptr, .Lxchal_ofs_+60 - ssi f14, \ptr, .Lxchal_ofs_+64 - ssi f15, \ptr, .Lxchal_ofs_+68 - .set .Lxchal_ofs_, .Lxchal_ofs_ + 72 - .elseif ((XTHAL_SAS_TIE | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0 - xchal_sa_align \ptr, 0, 948, 4, 4 - .set .Lxchal_ofs_, .Lxchal_ofs_ + 72 - .endif - .endm // xchal_cp0_store - - /* - * Macro to load the state of TIE coprocessor FPU. - * Required parameters: - * ptr Save area pointer address register (clobbered) - * (register must contain a 4 byte aligned address). - * at1..at4 Four temporary address registers (first XCHAL_CP0_NUM_ATMPS - * registers are clobbered, the remaining are unused). - * Optional parameters are the same as for xchal_ncp_load. - */ -#define xchal_cp_FPU_load xchal_cp0_load - .macro xchal_cp0_load ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0 - xchal_sa_start \continue, \ofs - // Custom caller-saved registers not used by default by the compiler: - .ifeq (XTHAL_SAS_TIE | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\select) - xchal_sa_align \ptr, 0, 948, 4, 4 - l32i \at1, \ptr, .Lxchal_ofs_+0 - wur.FCR \at1 // ureg 232 - l32i \at1, \ptr, .Lxchal_ofs_+4 - wur.FSR \at1 // ureg 233 - lsi f0, \ptr, .Lxchal_ofs_+8 - lsi f1, \ptr, .Lxchal_ofs_+12 - lsi f2, \ptr, .Lxchal_ofs_+16 - lsi f3, \ptr, .Lxchal_ofs_+20 - lsi f4, \ptr, .Lxchal_ofs_+24 - lsi f5, \ptr, .Lxchal_ofs_+28 - lsi f6, \ptr, .Lxchal_ofs_+32 - lsi f7, \ptr, .Lxchal_ofs_+36 - lsi f8, \ptr, .Lxchal_ofs_+40 - lsi f9, \ptr, .Lxchal_ofs_+44 - lsi f10, \ptr, .Lxchal_ofs_+48 - lsi f11, \ptr, .Lxchal_ofs_+52 - lsi f12, \ptr, .Lxchal_ofs_+56 - lsi f13, \ptr, .Lxchal_ofs_+60 - lsi f14, \ptr, .Lxchal_ofs_+64 - lsi f15, \ptr, .Lxchal_ofs_+68 - .set .Lxchal_ofs_, .Lxchal_ofs_ + 72 - .elseif ((XTHAL_SAS_TIE | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0 - xchal_sa_align \ptr, 0, 948, 4, 4 - .set .Lxchal_ofs_, .Lxchal_ofs_ + 72 - .endif - .endm // xchal_cp0_load - -#define XCHAL_CP0_NUM_ATMPS 1 -#define XCHAL_SA_NUM_ATMPS 1 - - /* Empty macros for unconfigured coprocessors: */ - .macro xchal_cp1_store p a b c d continue=0 ofs=-1 select=-1 ; .endm - .macro xchal_cp1_load p a b c d continue=0 ofs=-1 select=-1 ; .endm - .macro xchal_cp2_store p a b c d continue=0 ofs=-1 select=-1 ; .endm - .macro xchal_cp2_load p a b c d continue=0 ofs=-1 select=-1 ; .endm - .macro xchal_cp3_store p a b c d continue=0 ofs=-1 select=-1 ; .endm - .macro xchal_cp3_load p a b c d continue=0 ofs=-1 select=-1 ; .endm - .macro xchal_cp4_store p a b c d continue=0 ofs=-1 select=-1 ; .endm - .macro xchal_cp4_load p a b c d continue=0 ofs=-1 select=-1 ; .endm - .macro xchal_cp5_store p a b c d continue=0 ofs=-1 select=-1 ; .endm - .macro xchal_cp5_load p a b c d continue=0 ofs=-1 select=-1 ; .endm - .macro xchal_cp6_store p a b c d continue=0 ofs=-1 select=-1 ; .endm - .macro xchal_cp6_load p a b c d continue=0 ofs=-1 select=-1 ; .endm - .macro xchal_cp7_store p a b c d continue=0 ofs=-1 select=-1 ; .endm - .macro xchal_cp7_load p a b c d continue=0 ofs=-1 select=-1 ; .endm - -#endif /*_XTENSA_CORE_TIE_ASM_H*/ - diff --git a/tools/sdk/include/esp32/xtensa/config/tie.h b/tools/sdk/include/esp32/xtensa/config/tie.h deleted file mode 100644 index e178799708e..00000000000 --- a/tools/sdk/include/esp32/xtensa/config/tie.h +++ /dev/null @@ -1,182 +0,0 @@ -/* - * tie.h -- compile-time HAL definitions dependent on CORE & TIE configuration - * - * NOTE: This header file is not meant to be included directly. - */ - -/* This header file describes this specific Xtensa processor's TIE extensions - that extend basic Xtensa core functionality. It is customized to this - Xtensa processor configuration. - - Customer ID=11657; Build=0x5fe96; Copyright (c) 1999-2016 Cadence Design Systems Inc. - - 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. */ - -#ifndef _XTENSA_CORE_TIE_H -#define _XTENSA_CORE_TIE_H - -#define XCHAL_CP_NUM 1 /* number of coprocessors */ -#define XCHAL_CP_MAX 1 /* max CP ID + 1 (0 if none) */ -#define XCHAL_CP_MASK 0x01 /* bitmask of all CPs by ID */ -#define XCHAL_CP_PORT_MASK 0x00 /* bitmask of only port CPs */ - -/* Basic parameters of each coprocessor: */ -#define XCHAL_CP0_NAME "FPU" -#define XCHAL_CP0_IDENT FPU -#define XCHAL_CP0_SA_SIZE 72 /* size of state save area */ -#define XCHAL_CP0_SA_ALIGN 4 /* min alignment of save area */ -#define XCHAL_CP_ID_FPU 0 /* coprocessor ID (0..7) */ - -/* Filler info for unassigned coprocessors, to simplify arrays etc: */ -#define XCHAL_CP1_SA_SIZE 0 -#define XCHAL_CP1_SA_ALIGN 1 -#define XCHAL_CP2_SA_SIZE 0 -#define XCHAL_CP2_SA_ALIGN 1 -#define XCHAL_CP3_SA_SIZE 0 -#define XCHAL_CP3_SA_ALIGN 1 -#define XCHAL_CP4_SA_SIZE 0 -#define XCHAL_CP4_SA_ALIGN 1 -#define XCHAL_CP5_SA_SIZE 0 -#define XCHAL_CP5_SA_ALIGN 1 -#define XCHAL_CP6_SA_SIZE 0 -#define XCHAL_CP6_SA_ALIGN 1 -#define XCHAL_CP7_SA_SIZE 0 -#define XCHAL_CP7_SA_ALIGN 1 - -/* Save area for non-coprocessor optional and custom (TIE) state: */ -#define XCHAL_NCP_SA_SIZE 48 -#define XCHAL_NCP_SA_ALIGN 4 - -/* Total save area for optional and custom state (NCP + CPn): */ -#define XCHAL_TOTAL_SA_SIZE 128 /* with 16-byte align padding */ -#define XCHAL_TOTAL_SA_ALIGN 4 /* actual minimum alignment */ - -/* - * Detailed contents of save areas. - * NOTE: caller must define the XCHAL_SA_REG macro (not defined here) - * before expanding the XCHAL_xxx_SA_LIST() macros. - * - * XCHAL_SA_REG(s,ccused,abikind,kind,opt,name,galign,align,asize, - * dbnum,base,regnum,bitsz,gapsz,reset,x...) - * - * s = passed from XCHAL_*_LIST(s), eg. to select how to expand - * ccused = set if used by compiler without special options or code - * abikind = 0 (caller-saved), 1 (callee-saved), or 2 (thread-global) - * kind = 0 (special reg), 1 (TIE user reg), or 2 (TIE regfile reg) - * opt = 0 (custom TIE extension or coprocessor), or 1 (optional reg) - * name = lowercase reg name (no quotes) - * galign = group byte alignment (power of 2) (galign >= align) - * align = register byte alignment (power of 2) - * asize = allocated size in bytes (asize*8 == bitsz + gapsz + padsz) - * (not including any pad bytes required to galign this or next reg) - * dbnum = unique target number f/debug (see ) - * base = reg shortname w/o index (or sr=special, ur=TIE user reg) - * regnum = reg index in regfile, or special/TIE-user reg number - * bitsz = number of significant bits (regfile width, or ur/sr mask bits) - * gapsz = intervening bits, if bitsz bits not stored contiguously - * (padsz = pad bits at end [TIE regfile] or at msbits [ur,sr] of asize) - * reset = register reset value (or 0 if undefined at reset) - * x = reserved for future use (0 until then) - * - * To filter out certain registers, e.g. to expand only the non-global - * registers used by the compiler, you can do something like this: - * - * #define XCHAL_SA_REG(s,ccused,p...) SELCC##ccused(p) - * #define SELCC0(p...) - * #define SELCC1(abikind,p...) SELAK##abikind(p) - * #define SELAK0(p...) REG(p) - * #define SELAK1(p...) REG(p) - * #define SELAK2(p...) - * #define REG(kind,tie,name,galn,aln,asz,csz,dbnum,base,rnum,bsz,rst,x...) \ - * ...what you want to expand... - */ - -#define XCHAL_NCP_SA_NUM 12 -#define XCHAL_NCP_SA_LIST(s) \ - XCHAL_SA_REG(s,1,2,1,1, threadptr, 4, 4, 4,0x03E7, ur,231, 32,0,0,0) \ - XCHAL_SA_REG(s,1,0,0,1, acclo, 4, 4, 4,0x0210, sr,16 , 32,0,0,0) \ - XCHAL_SA_REG(s,1,0,0,1, acchi, 4, 4, 4,0x0211, sr,17 , 8,0,0,0) \ - XCHAL_SA_REG(s,0,0,0,1, br, 4, 4, 4,0x0204, sr,4 , 16,0,0,0) \ - XCHAL_SA_REG(s,0,0,0,1, scompare1, 4, 4, 4,0x020C, sr,12 , 32,0,0,0) \ - XCHAL_SA_REG(s,0,0,0,1, m0, 4, 4, 4,0x0220, sr,32 , 32,0,0,0) \ - XCHAL_SA_REG(s,0,0,0,1, m1, 4, 4, 4,0x0221, sr,33 , 32,0,0,0) \ - XCHAL_SA_REG(s,0,0,0,1, m2, 4, 4, 4,0x0222, sr,34 , 32,0,0,0) \ - XCHAL_SA_REG(s,0,0,0,1, m3, 4, 4, 4,0x0223, sr,35 , 32,0,0,0) \ - XCHAL_SA_REG(s,0,0,1,0, f64r_lo, 4, 4, 4,0x03EA, ur,234, 32,0,0,0) \ - XCHAL_SA_REG(s,0,0,1,0, f64r_hi, 4, 4, 4,0x03EB, ur,235, 32,0,0,0) \ - XCHAL_SA_REG(s,0,0,1,0, f64s, 4, 4, 4,0x03EC, ur,236, 32,0,0,0) - -#define XCHAL_CP0_SA_NUM 18 -#define XCHAL_CP0_SA_LIST(s) \ - XCHAL_SA_REG(s,0,0,1,0, fcr, 4, 4, 4,0x03E8, ur,232, 32,0,0,0) \ - XCHAL_SA_REG(s,0,0,1,0, fsr, 4, 4, 4,0x03E9, ur,233, 32,0,0,0) \ - XCHAL_SA_REG(s,0,0,2,0, f0, 4, 4, 4,0x0030, f,0 , 32,0,0,0) \ - XCHAL_SA_REG(s,0,0,2,0, f1, 4, 4, 4,0x0031, f,1 , 32,0,0,0) \ - XCHAL_SA_REG(s,0,0,2,0, f2, 4, 4, 4,0x0032, f,2 , 32,0,0,0) \ - XCHAL_SA_REG(s,0,0,2,0, f3, 4, 4, 4,0x0033, f,3 , 32,0,0,0) \ - XCHAL_SA_REG(s,0,0,2,0, f4, 4, 4, 4,0x0034, f,4 , 32,0,0,0) \ - XCHAL_SA_REG(s,0,0,2,0, f5, 4, 4, 4,0x0035, f,5 , 32,0,0,0) \ - XCHAL_SA_REG(s,0,0,2,0, f6, 4, 4, 4,0x0036, f,6 , 32,0,0,0) \ - XCHAL_SA_REG(s,0,0,2,0, f7, 4, 4, 4,0x0037, f,7 , 32,0,0,0) \ - XCHAL_SA_REG(s,0,0,2,0, f8, 4, 4, 4,0x0038, f,8 , 32,0,0,0) \ - XCHAL_SA_REG(s,0,0,2,0, f9, 4, 4, 4,0x0039, f,9 , 32,0,0,0) \ - XCHAL_SA_REG(s,0,0,2,0, f10, 4, 4, 4,0x003A, f,10 , 32,0,0,0) \ - XCHAL_SA_REG(s,0,0,2,0, f11, 4, 4, 4,0x003B, f,11 , 32,0,0,0) \ - XCHAL_SA_REG(s,0,0,2,0, f12, 4, 4, 4,0x003C, f,12 , 32,0,0,0) \ - XCHAL_SA_REG(s,0,0,2,0, f13, 4, 4, 4,0x003D, f,13 , 32,0,0,0) \ - XCHAL_SA_REG(s,0,0,2,0, f14, 4, 4, 4,0x003E, f,14 , 32,0,0,0) \ - XCHAL_SA_REG(s,0,0,2,0, f15, 4, 4, 4,0x003F, f,15 , 32,0,0,0) - -#define XCHAL_CP1_SA_NUM 0 -#define XCHAL_CP1_SA_LIST(s) /* empty */ - -#define XCHAL_CP2_SA_NUM 0 -#define XCHAL_CP2_SA_LIST(s) /* empty */ - -#define XCHAL_CP3_SA_NUM 0 -#define XCHAL_CP3_SA_LIST(s) /* empty */ - -#define XCHAL_CP4_SA_NUM 0 -#define XCHAL_CP4_SA_LIST(s) /* empty */ - -#define XCHAL_CP5_SA_NUM 0 -#define XCHAL_CP5_SA_LIST(s) /* empty */ - -#define XCHAL_CP6_SA_NUM 0 -#define XCHAL_CP6_SA_LIST(s) /* empty */ - -#define XCHAL_CP7_SA_NUM 0 -#define XCHAL_CP7_SA_LIST(s) /* empty */ - -/* Byte length of instruction from its first nibble (op0 field), per FLIX. */ -#define XCHAL_OP0_FORMAT_LENGTHS 3,3,3,3,3,3,3,3,2,2,2,2,2,2,3,3 -/* Byte length of instruction from its first byte, per FLIX. */ -#define XCHAL_BYTE0_FORMAT_LENGTHS \ - 3,3,3,3,3,3,3,3,2,2,2,2,2,2,3,3, 3,3,3,3,3,3,3,3,2,2,2,2,2,2,3,3,\ - 3,3,3,3,3,3,3,3,2,2,2,2,2,2,3,3, 3,3,3,3,3,3,3,3,2,2,2,2,2,2,3,3,\ - 3,3,3,3,3,3,3,3,2,2,2,2,2,2,3,3, 3,3,3,3,3,3,3,3,2,2,2,2,2,2,3,3,\ - 3,3,3,3,3,3,3,3,2,2,2,2,2,2,3,3, 3,3,3,3,3,3,3,3,2,2,2,2,2,2,3,3,\ - 3,3,3,3,3,3,3,3,2,2,2,2,2,2,3,3, 3,3,3,3,3,3,3,3,2,2,2,2,2,2,3,3,\ - 3,3,3,3,3,3,3,3,2,2,2,2,2,2,3,3, 3,3,3,3,3,3,3,3,2,2,2,2,2,2,3,3,\ - 3,3,3,3,3,3,3,3,2,2,2,2,2,2,3,3, 3,3,3,3,3,3,3,3,2,2,2,2,2,2,3,3,\ - 3,3,3,3,3,3,3,3,2,2,2,2,2,2,3,3, 3,3,3,3,3,3,3,3,2,2,2,2,2,2,3,3 - -#endif /*_XTENSA_CORE_TIE_H*/ - diff --git a/tools/sdk/include/esp32/xtensa/core-macros.h b/tools/sdk/include/esp32/xtensa/core-macros.h deleted file mode 100644 index 37c48921a4f..00000000000 --- a/tools/sdk/include/esp32/xtensa/core-macros.h +++ /dev/null @@ -1,456 +0,0 @@ -/* - * xtensa/core-macros.h -- C specific definitions - * that depend on CORE configuration - */ - -/* - * Copyright (c) 2012 Tensilica Inc. - * - * 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. - */ - -#ifndef XTENSA_CACHE_H -#define XTENSA_CACHE_H - -#include - -/* Only define things for C code. */ -#if !defined(_ASMLANGUAGE) && !defined(_NOCLANGUAGE) && !defined(__ASSEMBLER__) - - - -/*************************** CACHE ***************************/ - -/* All the macros are in the lower case now and some of them - * share the name with the existing functions from hal.h. - * Including this header file will define XTHAL_USE_CACHE_MACROS - * which directs hal.h not to use the functions. - */ - -/* - * Single-cache-line operations in C-callable inline assembly. - * Essentially macro versions (uppercase) of: - * - * xthal_icache_line_invalidate(void *addr); - * xthal_icache_line_lock(void *addr); - * xthal_icache_line_unlock(void *addr); - * xthal_icache_sync(void); - * - * NOTE: unlike the above functions, the following macros do NOT - * execute the xthal_icache_sync() as part of each line operation. - * This sync must be called explicitly by the caller. This is to - * allow better optimization when operating on more than one line. - * - * xthal_dcache_line_invalidate(void *addr); - * xthal_dcache_line_writeback(void *addr); - * xthal_dcache_line_writeback_inv(void *addr); - * xthal_dcache_line_lock(void *addr); - * xthal_dcache_line_unlock(void *addr); - * xthal_dcache_sync(void); - * xthal_dcache_line_prefetch_for_write(void *addr); - * xthal_dcache_line_prefetch_for_read(void *addr); - * - * All are made memory-barriers, given that's how they're typically used - * (ops operate on a whole line, so clobbers all memory not just *addr). - * - * NOTE: All the block block cache ops and line prefetches are implemented - * using intrinsics so they are better optimized regarding memory barriers etc. - * - * All block downgrade functions exist in two forms: with and without - * the 'max' parameter: This parameter allows compiler to optimize - * the functions whenever the parameter is smaller than the cache size. - * - * xthal_dcache_block_invalidate(void *addr, unsigned size); - * xthal_dcache_block_writeback(void *addr, unsigned size); - * xthal_dcache_block_writeback_inv(void *addr, unsigned size); - * xthal_dcache_block_invalidate_max(void *addr, unsigned size, unsigned max); - * xthal_dcache_block_writeback_max(void *addr, unsigned size, unsigned max); - * xthal_dcache_block_writeback_inv_max(void *addr, unsigned size, unsigned max); - * - * xthal_dcache_block_prefetch_for_read(void *addr, unsigned size); - * xthal_dcache_block_prefetch_for_write(void *addr, unsigned size); - * xthal_dcache_block_prefetch_modify(void *addr, unsigned size); - * xthal_dcache_block_prefetch_read_write(void *addr, unsigned size); - * xthal_dcache_block_prefetch_for_read_grp(void *addr, unsigned size); - * xthal_dcache_block_prefetch_for_write_grp(void *addr, unsigned size); - * xthal_dcache_block_prefetch_modify_grp(void *addr, unsigned size); - * xthal_dcache_block_prefetch_read_write_grp(void *addr, unsigned size) - * - * xthal_dcache_block_wait(); - * xthal_dcache_block_required_wait(); - * xthal_dcache_block_abort(); - * xthal_dcache_block_prefetch_end(); - * xthal_dcache_block_newgrp(); - */ - -/*** INSTRUCTION CACHE ***/ - -#define XTHAL_USE_CACHE_MACROS - -#if XCHAL_ICACHE_SIZE > 0 -# define xthal_icache_line_invalidate(addr) do { void *__a = (void*)(addr); \ - __asm__ __volatile__("ihi %0, 0" :: "a"(__a) : "memory"); \ - } while(0) -#else -# define xthal_icache_line_invalidate(addr) do {/*nothing*/} while(0) -#endif - -#if XCHAL_ICACHE_SIZE > 0 && XCHAL_ICACHE_LINE_LOCKABLE -# define xthal_icache_line_lock(addr) do { void *__a = (void*)(addr); \ - __asm__ __volatile__("ipfl %0, 0" :: "a"(__a) : "memory"); \ - } while(0) -# define xthal_icache_line_unlock(addr) do { void *__a = (void*)(addr); \ - __asm__ __volatile__("ihu %0, 0" :: "a"(__a) : "memory"); \ - } while(0) -#else -# define xthal_icache_line_lock(addr) do {/*nothing*/} while(0) -# define xthal_icache_line_unlock(addr) do {/*nothing*/} while(0) -#endif - -/* - * Even if a config doesn't have caches, an isync is still needed - * when instructions in any memory are modified, whether by a loader - * or self-modifying code. Therefore, this macro always produces - * an isync, whether or not an icache is present. - */ -#define xthal_icache_sync() \ - __asm__ __volatile__("isync":::"memory") - - -/*** DATA CACHE ***/ - -#if XCHAL_DCACHE_SIZE > 0 - -# include - -# define xthal_dcache_line_invalidate(addr) do { void *__a = (void*)(addr); \ - __asm__ __volatile__("dhi %0, 0" :: "a"(__a) : "memory"); \ - } while(0) -# define xthal_dcache_line_writeback(addr) do { void *__a = (void*)(addr); \ - __asm__ __volatile__("dhwb %0, 0" :: "a"(__a) : "memory"); \ - } while(0) -# define xthal_dcache_line_writeback_inv(addr) do { void *__a = (void*)(addr); \ - __asm__ __volatile__("dhwbi %0, 0" :: "a"(__a) : "memory"); \ - } while(0) -# define xthal_dcache_sync() \ - __asm__ __volatile__("" /*"dsync"?*/:::"memory") -# define xthal_dcache_line_prefetch_for_read(addr) do { \ - XT_DPFR((const int*)addr, 0); \ - } while(0) -#else -# define xthal_dcache_line_invalidate(addr) do {/*nothing*/} while(0) -# define xthal_dcache_line_writeback(addr) do {/*nothing*/} while(0) -# define xthal_dcache_line_writeback_inv(addr) do {/*nothing*/} while(0) -# define xthal_dcache_sync() __asm__ __volatile__("":::"memory") -# define xthal_dcache_line_prefetch_for_read(addr) do {/*nothing*/} while(0) -#endif - -#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_LINE_LOCKABLE -# define xthal_dcache_line_lock(addr) do { void *__a = (void*)(addr); \ - __asm__ __volatile__("dpfl %0, 0" :: "a"(__a) : "memory"); \ - } while(0) -# define xthal_dcache_line_unlock(addr) do { void *__a = (void*)(addr); \ - __asm__ __volatile__("dhu %0, 0" :: "a"(__a) : "memory"); \ - } while(0) -#else -# define xthal_dcache_line_lock(addr) do {/*nothing*/} while(0) -# define xthal_dcache_line_unlock(addr) do {/*nothing*/} while(0) -#endif - -#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_IS_WRITEBACK - -# define xthal_dcache_line_prefetch_for_write(addr) do { \ - XT_DPFW((const int*)addr, 0); \ - } while(0) -#else -# define xthal_dcache_line_prefetch_for_write(addr) do {/*nothing*/} while(0) -#endif - - -/***** Block Operations *****/ - -#if XCHAL_DCACHE_SIZE > 0 && XCHAL_HAVE_CACHE_BLOCKOPS - -/* upgrades */ - -# define _XTHAL_DCACHE_BLOCK_UPGRADE(addr, size, type) \ - { \ - type((const int*)addr, size); \ - } - -/*downgrades */ - -# define _XTHAL_DCACHE_BLOCK_DOWNGRADE(addr, size, type) \ - unsigned _s = size; \ - unsigned _a = addr; \ - do { \ - unsigned __s = (_s > XCHAL_DCACHE_SIZE) ? \ - XCHAL_DCACHE_SIZE : _s; \ - type((const int*)_a, __s); \ - _s -= __s; \ - _a += __s; \ - } while(_s > 0); - -# define _XTHAL_DCACHE_BLOCK_DOWNGRADE_MAX(addr, size, type, max) \ - if (max <= XCHAL_DCACHE_SIZE) { \ - unsigned _s = size; \ - unsigned _a = addr; \ - type((const int*)_a, _s); \ - } \ - else { \ - _XTHAL_DCACHE_BLOCK_DOWNGRADE(addr, size, type); \ - } - -# define xthal_dcache_block_invalidate(addr, size) do { \ - _XTHAL_DCACHE_BLOCK_DOWNGRADE(addr, size, XT_DHI_B); \ - } while(0) -# define xthal_dcache_block_writeback(addr, size) do { \ - _XTHAL_DCACHE_BLOCK_DOWNGRADE(addr, size, XT_DHWB_B); \ - } while(0) -# define xthal_dcache_block_writeback_inv(addr, size) do { \ - _XTHAL_DCACHE_BLOCK_DOWNGRADE(addr, size, XT_DHWBI_B); \ - } while(0) - -# define xthal_dcache_block_invalidate_max(addr, size, max) do { \ - _XTHAL_DCACHE_BLOCK_DOWNGRADE_MAX(addr, size, XT_DHI_B, max); \ - } while(0) -# define xthal_dcache_block_writeback_max(addr, size, max) do { \ - _XTHAL_DCACHE_BLOCK_DOWNGRADE_MAX(addr, size, XT_DHWB_B, max); \ - } while(0) -# define xthal_dcache_block_writeback_inv_max(addr, size, max) do { \ - _XTHAL_DCACHE_BLOCK_DOWNGRADE_MAX(addr, size, XT_DHWBI_B, max); \ - } while(0) - -/* upgrades that are performed even with write-thru caches */ - -# define xthal_dcache_block_prefetch_read_write(addr, size) do { \ - _XTHAL_DCACHE_BLOCK_UPGRADE(addr, size, XT_DPFW_B); \ - } while(0) -# define xthal_dcache_block_prefetch_read_write_grp(addr, size) do { \ - _XTHAL_DCACHE_BLOCK_UPGRADE(addr, size, XT_DPFW_BF); \ - } while(0) -# define xthal_dcache_block_prefetch_for_read(addr, size) do { \ - _XTHAL_DCACHE_BLOCK_UPGRADE(addr, size, XT_DPFR_B); \ - } while(0) -# define xthal_dcache_block_prefetch_for_read_grp(addr, size) do { \ - _XTHAL_DCACHE_BLOCK_UPGRADE(addr, size, XT_DPFR_BF); \ - } while(0) - -/* abort all or end optional block cache operations */ -# define xthal_dcache_block_abort() do { \ - XT_PFEND_A(); \ - } while(0) -# define xthal_dcache_block_end() do { \ - XT_PFEND_O(); \ - } while(0) - -/* wait for all/required block cache operations to finish */ -# define xthal_dcache_block_wait() do { \ - XT_PFWAIT_A(); \ - } while(0) -# define xthal_dcache_block_required_wait() do { \ - XT_PFWAIT_R(); \ - } while(0) -/* Start a new group */ -# define xthal_dcache_block_newgrp() do { \ - XT_PFNXT_F(); \ - } while(0) -#else -# define xthal_dcache_block_invalidate(addr, size) do {/*nothing*/} while(0) -# define xthal_dcache_block_writeback(addr, size) do {/*nothing*/} while(0) -# define xthal_dcache_block_writeback_inv(addr, size) do {/*nothing*/} while(0) -# define xthal_dcache_block_invalidate_max(addr, size, max) do {/*nothing*/} while(0) -# define xthal_dcache_block_writeback_max(addr, size, max) do {/*nothing*/} while(0) -# define xthal_dcache_block_writeback_inv_max(addr, size, max) do {/*nothing*/} while(0) -# define xthal_dcache_block_prefetch_read_write(addr, size) do {/*nothing*/} while(0) -# define xthal_dcache_block_prefetch_read_write_grp(addr, size) do {/*nothing*/} while(0) -# define xthal_dcache_block_prefetch_for_read(addr, size) do {/*nothing*/} while(0) -# define xthal_dcache_block_prefetch_for_read_grp(addr, size) do {/*nothing*/} while(0) -# define xthal_dcache_block_end() do {/*nothing*/} while(0) -# define xthal_dcache_block_abort() do {/*nothing*/} while(0) -# define xthal_dcache_block_wait() do {/*nothing*/} while(0) -# define xthal_dcache_block_required_wait() do {/*nothing*/} while(0) -# define xthal_dcache_block_newgrp() do {/*nothing*/} while(0) -#endif - -#if XCHAL_DCACHE_SIZE > 0 && XCHAL_HAVE_CACHE_BLOCKOPS && XCHAL_DCACHE_IS_WRITEBACK - -# define xthal_dcache_block_prefetch_for_write(addr, size) do { \ - _XTHAL_DCACHE_BLOCK_UPGRADE(addr, size, XT_DPFW_B); \ - } while(0) -# define xthal_dcache_block_prefetch_modify(addr, size) do { \ - _XTHAL_DCACHE_BLOCK_UPGRADE(addr, size, XT_DPFM_B); \ - } while(0) -# define xthal_dcache_block_prefetch_for_write_grp(addr, size) do { \ - _XTHAL_DCACHE_BLOCK_UPGRADE(addr, size, XT_DPFW_BF); \ - } while(0) -# define xthal_dcache_block_prefetch_modify_grp(addr, size) do { \ - _XTHAL_DCACHE_BLOCK_UPGRADE(addr, size, XT_DPFM_BF); \ - } while(0) -#else -# define xthal_dcache_block_prefetch_for_write(addr, size) do {/*nothing*/} while(0) -# define xthal_dcache_block_prefetch_modify(addr, size) do {/*nothing*/} while(0) -# define xthal_dcache_block_prefetch_for_write_grp(addr, size) do {/*nothing*/} while(0) -# define xthal_dcache_block_prefetch_modify_grp(addr, size) do {/*nothing*/} while(0) -#endif - -/*************************** INTERRUPTS ***************************/ - -/* - * Macro versions of: - * unsigned xthal_get_intenable( void ); - * void xthal_set_intenable( unsigned ); - * unsigned xthal_get_interrupt( void ); - * void xthal_set_intset( unsigned ); - * void xthal_set_intclear( unsigned ); - * unsigned xthal_get_ccount(void); - * void xthal_set_ccompare(int, unsigned); - * unsigned xthal_get_ccompare(int); - * - * NOTE: for {set,get}_ccompare, the first argument MUST be a decimal constant. - */ - -#if XCHAL_HAVE_INTERRUPTS -# define XTHAL_GET_INTENABLE() ({ int __intenable; \ - __asm__("rsr.intenable %0" : "=a"(__intenable)); \ - __intenable; }) -# define XTHAL_SET_INTENABLE(v) do { int __intenable = (int)(v); \ - __asm__ __volatile__("wsr.intenable %0" :: "a"(__intenable):"memory"); \ - } while(0) -# define XTHAL_GET_INTERRUPT() ({ int __interrupt; \ - __asm__ __volatile__("rsr.interrupt %0" : "=a"(__interrupt)); \ - __interrupt; }) -# define XTHAL_SET_INTSET(v) do { int __interrupt = (int)(v); \ - __asm__ __volatile__("wsr.intset %0" :: "a"(__interrupt):"memory"); \ - } while(0) -# define XTHAL_SET_INTCLEAR(v) do { int __interrupt = (int)(v); \ - __asm__ __volatile__("wsr.intclear %0" :: "a"(__interrupt):"memory"); \ - } while(0) -# define XTHAL_GET_CCOUNT() ({ int __ccount; \ - __asm__ __volatile__("rsr.ccount %0" : "=a"(__ccount)); \ - __ccount; }) -# define XTHAL_SET_CCOUNT(v) do { int __ccount = (int)(v); \ - __asm__ __volatile__("wsr.ccount %0" :: "a"(__ccount):"memory"); \ - } while(0) -# define _XTHAL_GET_CCOMPARE(n) ({ int __ccompare; \ - __asm__("rsr.ccompare" #n " %0" : "=a"(__ccompare)); \ - __ccompare; }) -# define XTHAL_GET_CCOMPARE(n) _XTHAL_GET_CCOMPARE(n) -# define _XTHAL_SET_CCOMPARE(n,v) do { int __ccompare = (int)(v); \ - __asm__ __volatile__("wsr.ccompare" #n " %0 ; esync" :: "a"(__ccompare):"memory"); \ - } while(0) -# define XTHAL_SET_CCOMPARE(n,v) _XTHAL_SET_CCOMPARE(n,v) -#else -# define XTHAL_GET_INTENABLE() 0 -# define XTHAL_SET_INTENABLE(v) do {/*nothing*/} while(0) -# define XTHAL_GET_INTERRUPT() 0 -# define XTHAL_SET_INTSET(v) do {/*nothing*/} while(0) -# define XTHAL_SET_INTCLEAR(v) do {/*nothing*/} while(0) -# define XTHAL_GET_CCOUNT() 0 -# define XTHAL_SET_CCOUNT(v) do {/*nothing*/} while(0) -# define XTHAL_GET_CCOMPARE(n) 0 -# define XTHAL_SET_CCOMPARE(n,v) do {/*nothing*/} while(0) -#endif - - -/*************************** MISC ***************************/ - -/* - * Macro or inline versions of: - * void xthal_clear_regcached_code( void ); - * unsigned xthal_get_prid( void ); - * unsigned xthal_compare_and_set( int *addr, int testval, int setval ); - */ - -#if XCHAL_HAVE_LOOPS -# define XTHAL_CLEAR_REGCACHED_CODE() \ - __asm__ __volatile__("wsr.lcount %0" :: "a"(0) : "memory") -#else -# define XTHAL_CLEAR_REGCACHED_CODE() do {/*nothing*/} while(0) -#endif - -#if XCHAL_HAVE_PRID -# define XTHAL_GET_PRID() ({ int __prid; \ - __asm__("rsr.prid %0" : "=a"(__prid)); \ - __prid; }) -#else -# define XTHAL_GET_PRID() 0 -#endif - - -static inline unsigned XTHAL_COMPARE_AND_SET( int *addr, int testval, int setval ) -{ - int result; - -#if XCHAL_HAVE_S32C1I && XCHAL_HW_MIN_VERSION_MAJOR >= 2200 - __asm__ __volatile__ ( - " wsr.scompare1 %2 \n" - " s32c1i %0, %3, 0 \n" - : "=a"(result) : "0" (setval), "a" (testval), "a" (addr) - : "memory"); -#elif XCHAL_HAVE_INTERRUPTS - int tmp; - __asm__ __volatile__ ( - " rsil %4, 15 \n" // %4 == saved ps - " l32i %0, %3, 0 \n" // %0 == value to test, return val - " bne %2, %0, 9f \n" // test - " s32i %1, %3, 0 \n" // write the new value - "9: wsr.ps %4 ; rsync \n" // restore the PS - : "=a"(result) - : "0" (setval), "a" (testval), "a" (addr), "a" (tmp) - : "memory"); -#else - __asm__ __volatile__ ( - " l32i %0, %3, 0 \n" // %0 == value to test, return val - " bne %2, %0, 9f \n" // test - " s32i %1, %3, 0 \n" // write the new value - "9: \n" - : "=a"(result) : "0" (setval), "a" (testval), "a" (addr) - : "memory"); -#endif - return result; -} - -#if XCHAL_HAVE_EXTERN_REGS - -static inline unsigned XTHAL_RER (unsigned int reg) -{ - unsigned result; - - __asm__ __volatile__ ( - " rer %0, %1" - : "=a" (result) : "a" (reg) : "memory"); - - return result; -} - -static inline void XTHAL_WER (unsigned reg, unsigned value) -{ - __asm__ __volatile__ ( - " wer %0, %1" - : : "a" (value), "a" (reg) : "memory"); -} - -#endif /* XCHAL_HAVE_EXTERN_REGS */ - -#endif /* C code */ - -#endif /*XTENSA_CACHE_H*/ - diff --git a/tools/sdk/include/esp32/xtensa/coreasm.h b/tools/sdk/include/esp32/xtensa/coreasm.h deleted file mode 100644 index e41e04d1bda..00000000000 --- a/tools/sdk/include/esp32/xtensa/coreasm.h +++ /dev/null @@ -1,939 +0,0 @@ -/* - * xtensa/coreasm.h -- assembler-specific definitions that depend on CORE configuration - * - * Source for configuration-independent binaries (which link in a - * configuration-specific HAL library) must NEVER include this file. - * It is perfectly normal, however, for the HAL itself to include this file. - * - * This file must NOT include xtensa/config/system.h. Any assembler - * header file that depends on system information should likely go - * in a new systemasm.h (or sysasm.h) header file. - * - * NOTE: macro beqi32 is NOT configuration-dependent, and is placed - * here until we have a proper configuration-independent header file. - */ - -/* $Id: //depot/rel/Eaglenest/Xtensa/OS/include/xtensa/coreasm.h#3 $ */ - -/* - * Copyright (c) 2000-2014 Tensilica Inc. - * - * 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. - */ - -#ifndef XTENSA_COREASM_H -#define XTENSA_COREASM_H - -/* - * Tell header files this is assembly source, so they can avoid non-assembler - * definitions (eg. C types etc): - */ -#ifndef _ASMLANGUAGE /* conditionalize to avoid cpp warnings (3rd parties might use same macro) */ -#define _ASMLANGUAGE -#endif - -#include -#include -#include - -/* - * Assembly-language specific definitions (assembly macros, etc.). - */ - -/*---------------------------------------------------------------------- - * find_ms_setbit - * - * This macro finds the most significant bit that is set in - * and return its index + in , or - 1 if is zero. - * The index counts starting at zero for the lsbit, so the return - * value ranges from -1 (no bit set) to +31 (msbit set). - * - * Parameters: - * destination address register (any register) - * source address register - * temporary address register (must be different than ) - * constant value added to result (usually 0 or 1) - * On entry: - * = undefined if different than - * = value whose most significant set bit is to be found - * = undefined - * no other registers are used by this macro. - * On exit: - * = + index of msbit set in original , - * = - 1 if original was zero. - * clobbered (if not ) - * clobbered (if not ) - * Example: - * find_ms_setbit a0, a4, a0, 0 -- return in a0 index of msbit set in a4 - */ - - .macro find_ms_setbit ad, as, at, base -#if XCHAL_HAVE_NSA - movi \at, 31+\base - nsau \as, \as // get index of \as, numbered from msbit (32 if absent) - sub \ad, \at, \as // get numbering from lsbit (0..31, -1 if absent) -#else /* XCHAL_HAVE_NSA */ - movi \at, \base // start with result of 0 (point to lsbit of 32) - - beqz \as, 2f // special case for zero argument: return -1 - bltui \as, 0x10000, 1f // is it one of the 16 lsbits? (if so, check lower 16 bits) - addi \at, \at, 16 // no, increment result to upper 16 bits (of 32) - //srli \as, \as, 16 // check upper half (shift right 16 bits) - extui \as, \as, 16, 16 // check upper half (shift right 16 bits) -1: bltui \as, 0x100, 1f // is it one of the 8 lsbits? (if so, check lower 8 bits) - addi \at, \at, 8 // no, increment result to upper 8 bits (of 16) - srli \as, \as, 8 // shift right to check upper 8 bits -1: bltui \as, 0x10, 1f // is it one of the 4 lsbits? (if so, check lower 4 bits) - addi \at, \at, 4 // no, increment result to upper 4 bits (of 8) - srli \as, \as, 4 // shift right 4 bits to check upper half -1: bltui \as, 0x4, 1f // is it one of the 2 lsbits? (if so, check lower 2 bits) - addi \at, \at, 2 // no, increment result to upper 2 bits (of 4) - srli \as, \as, 2 // shift right 2 bits to check upper half -1: bltui \as, 0x2, 1f // is it the lsbit? - addi \at, \at, 2 // no, increment result to upper bit (of 2) -2: addi \at, \at, -1 // (from just above: add 1; from beqz: return -1) - //srli \as, \as, 1 -1: // done! \at contains index of msbit set (or -1 if none set) - .if 0x\ad - 0x\at // destination different than \at ? (works because regs are a0-a15) - mov \ad, \at // then move result to \ad - .endif -#endif /* XCHAL_HAVE_NSA */ - .endm // find_ms_setbit - -/*---------------------------------------------------------------------- - * find_ls_setbit - * - * This macro finds the least significant bit that is set in , - * and return its index in . - * Usage is the same as for the find_ms_setbit macro. - * Example: - * find_ls_setbit a0, a4, a0, 0 -- return in a0 index of lsbit set in a4 - */ - - .macro find_ls_setbit ad, as, at, base - neg \at, \as // keep only the least-significant bit that is set... - and \as, \at, \as // ... in \as - find_ms_setbit \ad, \as, \at, \base - .endm // find_ls_setbit - -/*---------------------------------------------------------------------- - * find_ls_one - * - * Same as find_ls_setbit with base zero. - * Source (as) and destination (ad) registers must be different. - * Provided for backward compatibility. - */ - - .macro find_ls_one ad, as - find_ls_setbit \ad, \as, \ad, 0 - .endm // find_ls_one - -/*---------------------------------------------------------------------- - * floop, floopnez, floopgtz, floopend - * - * These macros are used for fast inner loops that - * work whether or not the Loops options is configured. - * If the Loops option is configured, they simply use - * the zero-overhead LOOP instructions; otherwise - * they use explicit decrement and branch instructions. - * - * They are used in pairs, with floop, floopnez or floopgtz - * at the beginning of the loop, and floopend at the end. - * - * Each pair of loop macro calls must be given the loop count - * address register and a unique label for that loop. - * - * Example: - * - * movi a3, 16 // loop 16 times - * floop a3, myloop1 - * : - * bnez a7, end1 // exit loop if a7 != 0 - * : - * floopend a3, myloop1 - * end1: - * - * Like the LOOP instructions, these macros cannot be - * nested, must include at least one instruction, - * cannot call functions inside the loop, etc. - * The loop can be exited by jumping to the instruction - * following floopend (or elsewhere outside the loop), - * or continued by jumping to a NOP instruction placed - * immediately before floopend. - * - * Unlike LOOP instructions, the register passed to floop* - * cannot be used inside the loop, because it is used as - * the loop counter if the Loops option is not configured. - * And its value is undefined after exiting the loop. - * And because the loop counter register is active inside - * the loop, you can't easily use this construct to loop - * across a register file using ROTW as you might with LOOP - * instructions, unless you copy the loop register along. - */ - - /* Named label version of the macros: */ - - .macro floop ar, endlabel - floop_ \ar, .Lfloopstart_\endlabel, .Lfloopend_\endlabel - .endm - - .macro floopnez ar, endlabel - floopnez_ \ar, .Lfloopstart_\endlabel, .Lfloopend_\endlabel - .endm - - .macro floopgtz ar, endlabel - floopgtz_ \ar, .Lfloopstart_\endlabel, .Lfloopend_\endlabel - .endm - - .macro floopend ar, endlabel - floopend_ \ar, .Lfloopstart_\endlabel, .Lfloopend_\endlabel - .endm - - /* Numbered local label version of the macros: */ -#if 0 /*UNTESTED*/ - .macro floop89 ar - floop_ \ar, 8, 9f - .endm - - .macro floopnez89 ar - floopnez_ \ar, 8, 9f - .endm - - .macro floopgtz89 ar - floopgtz_ \ar, 8, 9f - .endm - - .macro floopend89 ar - floopend_ \ar, 8b, 9 - .endm -#endif /*0*/ - - /* Underlying version of the macros: */ - - .macro floop_ ar, startlabel, endlabelref - .ifdef _infloop_ - .if _infloop_ - .err // Error: floop cannot be nested - .endif - .endif - .set _infloop_, 1 -#if XCHAL_HAVE_LOOPS - loop \ar, \endlabelref -#else /* XCHAL_HAVE_LOOPS */ -\startlabel: - addi \ar, \ar, -1 -#endif /* XCHAL_HAVE_LOOPS */ - .endm // floop_ - - .macro floopnez_ ar, startlabel, endlabelref - .ifdef _infloop_ - .if _infloop_ - .err // Error: floopnez cannot be nested - .endif - .endif - .set _infloop_, 1 -#if XCHAL_HAVE_LOOPS - loopnez \ar, \endlabelref -#else /* XCHAL_HAVE_LOOPS */ - beqz \ar, \endlabelref -\startlabel: - addi \ar, \ar, -1 -#endif /* XCHAL_HAVE_LOOPS */ - .endm // floopnez_ - - .macro floopgtz_ ar, startlabel, endlabelref - .ifdef _infloop_ - .if _infloop_ - .err // Error: floopgtz cannot be nested - .endif - .endif - .set _infloop_, 1 -#if XCHAL_HAVE_LOOPS - loopgtz \ar, \endlabelref -#else /* XCHAL_HAVE_LOOPS */ - bltz \ar, \endlabelref - beqz \ar, \endlabelref -\startlabel: - addi \ar, \ar, -1 -#endif /* XCHAL_HAVE_LOOPS */ - .endm // floopgtz_ - - - .macro floopend_ ar, startlabelref, endlabel - .ifndef _infloop_ - .err // Error: floopend without matching floopXXX - .endif - .ifeq _infloop_ - .err // Error: floopend without matching floopXXX - .endif - .set _infloop_, 0 -#if ! XCHAL_HAVE_LOOPS - bnez \ar, \startlabelref -#endif /* XCHAL_HAVE_LOOPS */ -\endlabel: - .endm // floopend_ - -/*---------------------------------------------------------------------- - * crsil -- conditional RSIL (read/set interrupt level) - * - * Executes the RSIL instruction if it exists, else just reads PS. - * The RSIL instruction does not exist in the new exception architecture - * if the interrupt option is not selected. - */ - - .macro crsil ar, newlevel -#if XCHAL_HAVE_OLD_EXC_ARCH || XCHAL_HAVE_INTERRUPTS - rsil \ar, \newlevel -#else - rsr \ar, PS -#endif - .endm // crsil - -/*---------------------------------------------------------------------- - * safe_movi_a0 -- move constant into a0 when L32R is not safe - * - * This macro is typically used by interrupt/exception handlers. - * Loads a 32-bit constant in a0, without using any other register, - * and without corrupting the LITBASE register, even when the - * value of the LITBASE register is unknown (eg. when application - * code and interrupt/exception handling code are built independently, - * and thus with independent values of the LITBASE register; - * debug monitors are one example of this). - * - * Worst-case size of resulting code: 17 bytes. - */ - - .macro safe_movi_a0 constant -#if XCHAL_HAVE_ABSOLUTE_LITERALS - /* Contort a PC-relative literal load even though we may be in litbase-relative mode: */ - j 1f - .begin no-transform // ensure what follows is assembled exactly as-is - .align 4 // ensure constant and call0 target ... - .byte 0 // ... are 4-byte aligned (call0 instruction is 3 bytes long) -1: call0 2f // read PC (that follows call0) in a0 - .long \constant // 32-bit constant to load into a0 -2: - .end no-transform - l32i a0, a0, 0 // load constant -#else - movi a0, \constant // no LITBASE, can assume PC-relative L32R -#endif - .endm - - - - -/*---------------------------------------------------------------------- - * window_spill{4,8,12} - * - * These macros spill callers' register windows to the stack. - * They work for both privileged and non-privileged tasks. - * Must be called from a windowed ABI context, eg. within - * a windowed ABI function (ie. valid stack frame, window - * exceptions enabled, not in exception mode, etc). - * - * This macro requires a single invocation of the window_spill_common - * macro in the same assembly unit and section. - * - * Note that using window_spill{4,8,12} macros is more efficient - * than calling a function implemented using window_spill_function, - * because the latter needs extra code to figure out the size of - * the call to the spilling function. - * - * Example usage: - * - * .text - * .align 4 - * .global some_function - * .type some_function,@function - * some_function: - * entry a1, 16 - * : - * : - * - * window_spill4 // Spill windows of some_function's callers; preserves a0..a3 only; - * // to use window_spill{8,12} in this example function we'd have - * // to increase space allocated by the entry instruction, because - * // 16 bytes only allows call4; 32 or 48 bytes (+locals) are needed - * // for call8/window_spill8 or call12/window_spill12 respectively. - * - * : - * - * retw - * - * window_spill_common // instantiates code used by window_spill4 - * - * - * On entry: - * none (if window_spill4) - * stack frame has enough space allocated for call8 (if window_spill8) - * stack frame has enough space allocated for call12 (if window_spill12) - * On exit: - * a4..a15 clobbered (if window_spill4) - * a8..a15 clobbered (if window_spill8) - * a12..a15 clobbered (if window_spill12) - * no caller windows are in live registers - */ - - .macro window_spill4 -#if XCHAL_HAVE_WINDOWED -# if XCHAL_NUM_AREGS == 16 - movi a15, 0 // for 16-register files, no need to call to reach the end -# elif XCHAL_NUM_AREGS == 32 - call4 .L__wdwspill_assist28 // call deep enough to clear out any live callers -# elif XCHAL_NUM_AREGS == 64 - call4 .L__wdwspill_assist60 // call deep enough to clear out any live callers -# endif -#endif - .endm // window_spill4 - - .macro window_spill8 -#if XCHAL_HAVE_WINDOWED -# if XCHAL_NUM_AREGS == 16 - movi a15, 0 // for 16-register files, no need to call to reach the end -# elif XCHAL_NUM_AREGS == 32 - call8 .L__wdwspill_assist24 // call deep enough to clear out any live callers -# elif XCHAL_NUM_AREGS == 64 - call8 .L__wdwspill_assist56 // call deep enough to clear out any live callers -# endif -#endif - .endm // window_spill8 - - .macro window_spill12 -#if XCHAL_HAVE_WINDOWED -# if XCHAL_NUM_AREGS == 16 - movi a15, 0 // for 16-register files, no need to call to reach the end -# elif XCHAL_NUM_AREGS == 32 - call12 .L__wdwspill_assist20 // call deep enough to clear out any live callers -# elif XCHAL_NUM_AREGS == 64 - call12 .L__wdwspill_assist52 // call deep enough to clear out any live callers -# endif -#endif - .endm // window_spill12 - - -/*---------------------------------------------------------------------- - * window_spill_function - * - * This macro outputs a function that will spill its caller's callers' - * register windows to the stack. Eg. it could be used to implement - * a version of xthal_window_spill() that works in non-privileged tasks. - * This works for both privileged and non-privileged tasks. - * - * Typical usage: - * - * .text - * .align 4 - * .global my_spill_function - * .type my_spill_function,@function - * my_spill_function: - * window_spill_function - * - * On entry to resulting function: - * none - * On exit from resulting function: - * none (no caller windows are in live registers) - */ - - .macro window_spill_function -#if XCHAL_HAVE_WINDOWED -# if XCHAL_NUM_AREGS == 32 - entry sp, 48 - bbci.l a0, 31, 1f // branch if called with call4 - bbsi.l a0, 30, 2f // branch if called with call12 - call8 .L__wdwspill_assist16 // called with call8, only need another 8 - retw -1: call12 .L__wdwspill_assist16 // called with call4, only need another 12 - retw -2: call4 .L__wdwspill_assist16 // called with call12, only need another 4 - retw -# elif XCHAL_NUM_AREGS == 64 - entry sp, 48 - bbci.l a0, 31, 1f // branch if called with call4 - bbsi.l a0, 30, 2f // branch if called with call12 - call4 .L__wdwspill_assist52 // called with call8, only need a call4 - retw -1: call8 .L__wdwspill_assist52 // called with call4, only need a call8 - retw -2: call12 .L__wdwspill_assist40 // called with call12, can skip a call12 - retw -# elif XCHAL_NUM_AREGS == 16 - entry sp, 16 - bbci.l a0, 31, 1f // branch if called with call4 - bbsi.l a0, 30, 2f // branch if called with call12 - movi a7, 0 // called with call8 - retw -1: movi a11, 0 // called with call4 -2: retw // if called with call12, everything already spilled - -// movi a15, 0 // trick to spill all but the direct caller -// j 1f -// // The entry instruction is magical in the assembler (gets auto-aligned) -// // so we have to jump to it to avoid falling through the padding. -// // We need entry/retw to know where to return. -//1: entry sp, 16 -// retw -# else -# error "unrecognized address register file size" -# endif - -#endif /* XCHAL_HAVE_WINDOWED */ - window_spill_common - .endm // window_spill_function - -/*---------------------------------------------------------------------- - * window_spill_common - * - * Common code used by any number of invocations of the window_spill## - * and window_spill_function macros. - * - * Must be instantiated exactly once within a given assembly unit, - * within call/j range of and same section as window_spill## - * macro invocations for that assembly unit. - * (Is automatically instantiated by the window_spill_function macro.) - */ - - .macro window_spill_common -#if XCHAL_HAVE_WINDOWED && (XCHAL_NUM_AREGS == 32 || XCHAL_NUM_AREGS == 64) - .ifndef .L__wdwspill_defined -# if XCHAL_NUM_AREGS >= 64 -.L__wdwspill_assist60: - entry sp, 32 - call8 .L__wdwspill_assist52 - retw -.L__wdwspill_assist56: - entry sp, 16 - call4 .L__wdwspill_assist52 - retw -.L__wdwspill_assist52: - entry sp, 48 - call12 .L__wdwspill_assist40 - retw -.L__wdwspill_assist40: - entry sp, 48 - call12 .L__wdwspill_assist28 - retw -# endif -.L__wdwspill_assist28: - entry sp, 48 - call12 .L__wdwspill_assist16 - retw -.L__wdwspill_assist24: - entry sp, 32 - call8 .L__wdwspill_assist16 - retw -.L__wdwspill_assist20: - entry sp, 16 - call4 .L__wdwspill_assist16 - retw -.L__wdwspill_assist16: - entry sp, 16 - movi a15, 0 - retw - .set .L__wdwspill_defined, 1 - .endif -#endif /* XCHAL_HAVE_WINDOWED with 32 or 64 aregs */ - .endm // window_spill_common - -/*---------------------------------------------------------------------- - * beqi32 - * - * macro implements version of beqi for arbitrary 32-bit immediate value - * - * beqi32 ax, ay, imm32, label - * - * Compares value in register ax with imm32 value and jumps to label if - * equal. Clobbers register ay if needed - * - */ - .macro beqi32 ax, ay, imm, label - .ifeq ((\imm-1) & ~7) // 1..8 ? - beqi \ax, \imm, \label - .else - .ifeq (\imm+1) // -1 ? - beqi \ax, \imm, \label - .else - .ifeq (\imm) // 0 ? - beqz \ax, \label - .else - // We could also handle immediates 10,12,16,32,64,128,256 - // but it would be a long macro... - movi \ay, \imm - beq \ax, \ay, \label - .endif - .endif - .endif - .endm // beqi32 - -/*---------------------------------------------------------------------- - * isync_retw_nop - * - * This macro must be invoked immediately after ISYNC if ISYNC - * would otherwise be immediately followed by RETW (or other instruction - * modifying WindowBase or WindowStart), in a context where - * kernel vector mode may be selected, and level-one interrupts - * and window overflows may be enabled, on an XEA1 configuration. - * - * On hardware with erratum "XEA1KWIN" (see for details), - * XEA1 code must have at least one instruction between ISYNC and RETW if - * run in kernel vector mode with interrupts and window overflows enabled. - */ - .macro isync_retw_nop -#if XCHAL_MAYHAVE_ERRATUM_XEA1KWIN - nop -#endif - .endm - -/*---------------------------------------------------------------------- - * isync_erratum453 - * - * This macro must be invoked at certain points in the code, - * such as in exception and interrupt vectors in particular, - * to work around erratum 453. - */ - .macro isync_erratum453 -#if XCHAL_ERRATUM_453 - isync -#endif - .endm - - - -/*---------------------------------------------------------------------- - * abs - * - * implements abs on machines that do not have it configured - */ - -#if !XCHAL_HAVE_ABS - .macro abs arr, ars - .ifc \arr, \ars - //src equal dest is less efficient - bgez \arr, 1f - neg \arr, \arr -1: - .else - neg \arr, \ars - movgez \arr, \ars, \ars - .endif - .endm -#endif /* !XCHAL_HAVE_ABS */ - - -/*---------------------------------------------------------------------- - * addx2 - * - * implements addx2 on machines that do not have it configured - * - */ - -#if !XCHAL_HAVE_ADDX - .macro addx2 arr, ars, art - .ifc \arr, \art - .ifc \arr, \ars - // addx2 a, a, a (not common) - .err - .else - add \arr, \ars, \art - add \arr, \ars, \art - .endif - .else - //addx2 a, b, c - //addx2 a, a, b - //addx2 a, b, b - slli \arr, \ars, 1 - add \arr, \arr, \art - .endif - .endm -#endif /* !XCHAL_HAVE_ADDX */ - -/*---------------------------------------------------------------------- - * addx4 - * - * implements addx4 on machines that do not have it configured - * - */ - -#if !XCHAL_HAVE_ADDX - .macro addx4 arr, ars, art - .ifc \arr, \art - .ifc \arr, \ars - // addx4 a, a, a (not common) - .err - .else - //# addx4 a, b, a - add \arr, \ars, \art - add \arr, \ars, \art - add \arr, \ars, \art - add \arr, \ars, \art - .endif - .else - //addx4 a, b, c - //addx4 a, a, b - //addx4 a, b, b - slli \arr, \ars, 2 - add \arr, \arr, \art - .endif - .endm -#endif /* !XCHAL_HAVE_ADDX */ - -/*---------------------------------------------------------------------- - * addx8 - * - * implements addx8 on machines that do not have it configured - * - */ - -#if !XCHAL_HAVE_ADDX - .macro addx8 arr, ars, art - .ifc \arr, \art - .ifc \arr, \ars - //addx8 a, a, a (not common) - .err - .else - //addx8 a, b, a - add \arr, \ars, \art - add \arr, \ars, \art - add \arr, \ars, \art - add \arr, \ars, \art - add \arr, \ars, \art - add \arr, \ars, \art - add \arr, \ars, \art - add \arr, \ars, \art - .endif - .else - //addx8 a, b, c - //addx8 a, a, b - //addx8 a, b, b - slli \arr, \ars, 3 - add \arr, \arr, \art - .endif - .endm -#endif /* !XCHAL_HAVE_ADDX */ - - -/*---------------------------------------------------------------------- - * rfe_rfue - * - * Maps to RFUE on XEA1, and RFE on XEA2. No mapping on XEAX. - */ - -#if XCHAL_HAVE_XEA1 - .macro rfe_rfue - rfue - .endm -#elif XCHAL_HAVE_XEA2 - .macro rfe_rfue - rfe - .endm -#endif - - -/*---------------------------------------------------------------------- - * abi_entry - * - * Generate proper function entry sequence for the current ABI - * (windowed or call0). Takes care of allocating stack space (up to 1kB) - * and saving the return PC, if necessary. The corresponding abi_return - * macro does the corresponding stack deallocation and restoring return PC. - * - * Parameters are: - * - * locsize Number of bytes to allocate on the stack - * for local variables (and for args to pass to - * callees, if any calls are made). Defaults to zero. - * The macro rounds this up to a multiple of 16. - * NOTE: large values are allowed (e.g. up to 1 GB). - * - * callsize Maximum call size made by this function. - * Leave zero (default) for leaf functions, i.e. if - * this function makes no calls to other functions. - * Otherwise must be set to 4, 8, or 12 according - * to whether the "largest" call made is a call[x]4, - * call[x]8, or call[x]12 (for call0 ABI, it makes - * no difference whether this is set to 4, 8 or 12, - * but it must be set to one of these values). - * - * NOTE: It is up to the caller to align the entry point, declare the - * function symbol, make it global, etc. - * - * NOTE: This macro relies on assembler relaxation for large values - * of locsize. It might not work with the no-transform directive. - * NOTE: For the call0 ABI, this macro ensures SP is allocated or - * de-allocated cleanly, i.e. without temporarily allocating too much - * (or allocating negatively!) due to addi relaxation. - * - * NOTE: Generating the proper sequence and register allocation for - * making calls in an ABI independent manner is a separate topic not - * covered by this macro. - * - * NOTE: To access arguments, you can't use a fixed offset from SP. - * The offset depends on the ABI, whether the function is leaf, etc. - * The simplest method is probably to use the .locsz symbol, which - * is set by this macro to the actual number of bytes allocated on - * the stack, in other words, to the offset from SP to the arguments. - * E.g. for a function whose arguments are all 32-bit integers, you - * can get the 7th and 8th arguments (1st and 2nd args stored on stack) - * using: - * l32i a2, sp, .locsz - * l32i a3, sp, .locsz+4 - * (this example works as long as locsize is under L32I's offset limit - * of 1020 minus up to 48 bytes of ABI-specific stack usage; - * otherwise you might first need to do "addi a?, sp, .locsz" - * or similar sequence). - * - * NOTE: For call0 ABI, this macro (and abi_return) may clobber a9 - * (a caller-saved register). - * - * Examples: - * abi_entry - * abi_entry 5 - * abi_entry 22, 8 - * abi_entry 0, 4 - */ - - /* - * Compute .locsz and .callsz without emitting any instructions. - * Used by both abi_entry and abi_return. - * Assumes locsize >= 0. - */ - .macro abi_entry_size locsize=0, callsize=0 -#if XCHAL_HAVE_WINDOWED && !__XTENSA_CALL0_ABI__ - .ifeq \callsize - .set .callsz, 16 - .else - .ifeq \callsize-4 - .set .callsz, 16 - .else - .ifeq \callsize-8 - .set .callsz, 32 - .else - .ifeq \callsize-12 - .set .callsz, 48 - .else - .error "abi_entry: invalid call size \callsize" - .endif - .endif - .endif - .endif - .set .locsz, .callsz + ((\locsize + 15) & -16) -#else - .set .callsz, \callsize - .if .callsz /* if calls, need space for return PC */ - .set .locsz, (\locsize + 4 + 15) & -16 - .else - .set .locsz, (\locsize + 15) & -16 - .endif -#endif - .endm - - .macro abi_entry locsize=0, callsize=0 - .iflt \locsize - .error "abi_entry: invalid negative size of locals (\locsize)" - .endif - abi_entry_size \locsize, \callsize -#if XCHAL_HAVE_WINDOWED && !__XTENSA_CALL0_ABI__ - .ifgt .locsz - 32760 /* .locsz > 32760 (ENTRY's max range)? */ - /* Funky computation to try to have assembler use addmi efficiently if possible: */ - entry sp, 0x7F00 + (.locsz & 0xF0) - addi a12, sp, - ((.locsz & -0x100) - 0x7F00) - movsp sp, a12 - .else - entry sp, .locsz - .endif -#else - .if .locsz - .ifle .locsz - 128 /* if locsz <= 128 */ - addi sp, sp, -.locsz - .if .callsz - s32i a0, sp, .locsz - 4 - .endif - .elseif .callsz /* locsz > 128, with calls: */ - movi a9, .locsz - 16 /* note: a9 is caller-saved */ - addi sp, sp, -16 - s32i a0, sp, 12 - sub sp, sp, a9 - .else /* locsz > 128, no calls: */ - movi a9, .locsz - sub sp, sp, a9 - .endif /* end */ - .endif -#endif - .endm - - - -/*---------------------------------------------------------------------- - * abi_return - * - * Generate proper function exit sequence for the current ABI - * (windowed or call0). Takes care of freeing stack space and - * restoring the return PC, if necessary. - * NOTE: This macro MUST be invoked following a corresponding - * abi_entry macro invocation. For call0 ABI in particular, - * all stack and PC restoration are done according to the last - * abi_entry macro invoked before this macro in the assembly file. - * - * Normally this macro takes no arguments. However to allow - * for placing abi_return *before* abi_entry (as must be done - * for some highly optimized assembly), it optionally takes - * exactly the same arguments as abi_entry. - */ - - .macro abi_return locsize=-1, callsize=0 - .ifge \locsize - abi_entry_size \locsize, \callsize - .endif -#if XCHAL_HAVE_WINDOWED && !__XTENSA_CALL0_ABI__ - retw -#else - .if .locsz - .iflt .locsz - 128 /* if locsz < 128 */ - .if .callsz - l32i a0, sp, .locsz - 4 - .endif - addi sp, sp, .locsz - .elseif .callsz /* locsz >= 128, with calls: */ - addi a9, sp, .locsz - 16 - l32i a0, a9, 12 - addi sp, a9, 16 - .else /* locsz >= 128, no calls: */ - movi a9, .locsz - add sp, sp, a9 - .endif /* end */ - .endif - ret -#endif - .endm - - -/* - * HW erratum fixes. - */ - - .macro hw_erratum_487_fix -#if defined XSHAL_ERRATUM_487_FIX - isync -#endif - .endm - - -#endif /*XTENSA_COREASM_H*/ - diff --git a/tools/sdk/include/esp32/xtensa/corebits.h b/tools/sdk/include/esp32/xtensa/corebits.h deleted file mode 100644 index 0ac0c8014c8..00000000000 --- a/tools/sdk/include/esp32/xtensa/corebits.h +++ /dev/null @@ -1,185 +0,0 @@ -/* - * xtensa/corebits.h - Xtensa Special Register field positions, masks, values. - * - * (In previous releases, these were defined in specreg.h, a generated file. - * This file is not generated, ie. it is processor configuration independent.) - */ - -/* $Id: //depot/rel/Eaglenest/Xtensa/OS/include/xtensa/corebits.h#2 $ */ - -/* - * Copyright (c) 2005-2011 Tensilica Inc. - * - * 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. - */ - -#ifndef XTENSA_COREBITS_H -#define XTENSA_COREBITS_H - -/* EXCCAUSE register fields: */ -#define EXCCAUSE_EXCCAUSE_SHIFT 0 -#define EXCCAUSE_EXCCAUSE_MASK 0x3F -/* EXCCAUSE register values: */ -/* - * General Exception Causes - * (values of EXCCAUSE special register set by general exceptions, - * which vector to the user, kernel, or double-exception vectors). - */ -#define EXCCAUSE_ILLEGAL 0 /* Illegal Instruction */ -#define EXCCAUSE_SYSCALL 1 /* System Call (SYSCALL instruction) */ -#define EXCCAUSE_INSTR_ERROR 2 /* Instruction Fetch Error */ -# define EXCCAUSE_IFETCHERROR 2 /* (backward compatibility macro, deprecated, avoid) */ -#define EXCCAUSE_LOAD_STORE_ERROR 3 /* Load Store Error */ -# define EXCCAUSE_LOADSTOREERROR 3 /* (backward compatibility macro, deprecated, avoid) */ -#define EXCCAUSE_LEVEL1_INTERRUPT 4 /* Level 1 Interrupt */ -# define EXCCAUSE_LEVEL1INTERRUPT 4 /* (backward compatibility macro, deprecated, avoid) */ -#define EXCCAUSE_ALLOCA 5 /* Stack Extension Assist (MOVSP instruction) for alloca */ -#define EXCCAUSE_DIVIDE_BY_ZERO 6 /* Integer Divide by Zero */ -#define EXCCAUSE_SPECULATION 7 /* Use of Failed Speculative Access (not implemented) */ -#define EXCCAUSE_PRIVILEGED 8 /* Privileged Instruction */ -#define EXCCAUSE_UNALIGNED 9 /* Unaligned Load or Store */ -/* Reserved 10..11 */ -#define EXCCAUSE_INSTR_DATA_ERROR 12 /* PIF Data Error on Instruction Fetch (RB-200x and later) */ -#define EXCCAUSE_LOAD_STORE_DATA_ERROR 13 /* PIF Data Error on Load or Store (RB-200x and later) */ -#define EXCCAUSE_INSTR_ADDR_ERROR 14 /* PIF Address Error on Instruction Fetch (RB-200x and later) */ -#define EXCCAUSE_LOAD_STORE_ADDR_ERROR 15 /* PIF Address Error on Load or Store (RB-200x and later) */ -#define EXCCAUSE_ITLB_MISS 16 /* ITLB Miss (no ITLB entry matches, hw refill also missed) */ -#define EXCCAUSE_ITLB_MULTIHIT 17 /* ITLB Multihit (multiple ITLB entries match) */ -#define EXCCAUSE_INSTR_RING 18 /* Ring Privilege Violation on Instruction Fetch */ -/* Reserved 19 */ /* Size Restriction on IFetch (not implemented) */ -#define EXCCAUSE_INSTR_PROHIBITED 20 /* Cache Attribute does not allow Instruction Fetch */ -/* Reserved 21..23 */ -#define EXCCAUSE_DTLB_MISS 24 /* DTLB Miss (no DTLB entry matches, hw refill also missed) */ -#define EXCCAUSE_DTLB_MULTIHIT 25 /* DTLB Multihit (multiple DTLB entries match) */ -#define EXCCAUSE_LOAD_STORE_RING 26 /* Ring Privilege Violation on Load or Store */ -/* Reserved 27 */ /* Size Restriction on Load/Store (not implemented) */ -#define EXCCAUSE_LOAD_PROHIBITED 28 /* Cache Attribute does not allow Load */ -#define EXCCAUSE_STORE_PROHIBITED 29 /* Cache Attribute does not allow Store */ -/* Reserved 30..31 */ -#define EXCCAUSE_CP_DISABLED(n) (32+(n)) /* Access to Coprocessor 'n' when disabled */ -#define EXCCAUSE_CP0_DISABLED 32 /* Access to Coprocessor 0 when disabled */ -#define EXCCAUSE_CP1_DISABLED 33 /* Access to Coprocessor 1 when disabled */ -#define EXCCAUSE_CP2_DISABLED 34 /* Access to Coprocessor 2 when disabled */ -#define EXCCAUSE_CP3_DISABLED 35 /* Access to Coprocessor 3 when disabled */ -#define EXCCAUSE_CP4_DISABLED 36 /* Access to Coprocessor 4 when disabled */ -#define EXCCAUSE_CP5_DISABLED 37 /* Access to Coprocessor 5 when disabled */ -#define EXCCAUSE_CP6_DISABLED 38 /* Access to Coprocessor 6 when disabled */ -#define EXCCAUSE_CP7_DISABLED 39 /* Access to Coprocessor 7 when disabled */ -/* Reserved 40..63 */ - -/* PS register fields: */ -#define PS_WOE_SHIFT 18 -#define PS_WOE_MASK 0x00040000 -#define PS_WOE PS_WOE_MASK -#define PS_CALLINC_SHIFT 16 -#define PS_CALLINC_MASK 0x00030000 -#define PS_CALLINC(n) (((n)&3)<4) 0 2 or >3 (TBD) - * T1030.0 0 1 (HAL beta) - * T1030.{1,2} 0 3 Equivalent to first release. - * T1030.n (n>=3) 0 >= 3 (TBD) - * T1040.n 1040 n Full CHAL available from T1040.2 - * T1050.n 1050 n . - * 6.0.n 6000 n Xtensa Tools v6 (RA-200x.n) - * 7.0.n 7000 n Xtensa Tools v7 (RB-200x.n) - * 7.1.n 7010 n Xtensa Tools v7.1 (RB-200x.(n+2)) - * 8.0.n 8000 n Xtensa Tools v8 (RC-20xx.n) - * 9.0.n 9000 n Xtensa Tools v9 (RD-201x.n) - * 10.0.n 10000 n Xtensa Tools v10 (RE-201x.n) - * - * - * Note: there is a distinction between the software version with - * which something is compiled (accessible using XTHAL_RELEASE_* macros) - * and the software version with which the HAL library was compiled - * (accessible using Xthal_release_* global variables). This - * distinction is particularly relevant for vendors that distribute - * configuration-independent binaries (eg. an OS), where their customer - * might link it with a HAL of a different Xtensa software version. - * In this case, it may be appropriate for the OS to verify at run-time - * whether XTHAL_RELEASE_* and Xthal_release_* are compatible. - * [Guidelines as to which version is compatible with which are not - * currently provided explicitly, but might be inferred from reading - * OSKit documentation for all releases -- compatibility is also highly - * dependent on which HAL features are used. Each version is usually - * backward compatible, with very few exceptions if any.] - */ - -/* Version comparison operators (among major/minor pairs): */ -#define XTHAL_REL_GE(maja,mina, majb,minb) ((maja) > (majb) || \ - ((maja) == (majb) && (mina) >= (minb))) -#define XTHAL_REL_GT(maja,mina, majb,minb) ((maja) > (majb) || \ - ((maja) == (majb) && (mina) > (minb))) -#define XTHAL_REL_LE(maja,mina, majb,minb) ((maja) < (majb) || \ - ((maja) == (majb) && (mina) <= (minb))) -#define XTHAL_REL_LT(maja,mina, majb,minb) ((maja) < (majb) || \ - ((maja) == (majb) && (mina) < (minb))) -#define XTHAL_REL_EQ(maja,mina, majb,minb) ((maja) == (majb) && (mina) == (minb)) - -/* Fuzzy (3-way) logic operators: */ -#define XTHAL_MAYBE -1 /* 0=NO, 1=YES, -1=MAYBE */ -#define XTHAL_FUZZY_AND(a,b) (((a)==0 || (b)==0) ? 0 : ((a)==1 && (b)==1) ? 1 : XTHAL_MAYBE) -#define XTHAL_FUZZY_OR(a,b) (((a)==1 || (b)==1) ? 1 : ((a)==0 && (b)==0) ? 0 : XTHAL_MAYBE) -#define XTHAL_FUZZY_NOT(a) (((a)==0 || (a)==1) ? (1-(a)) : XTHAL_MAYBE) - - -/* - * Architectural limit, independent of configuration: - */ -#define XTHAL_MAX_CPS 8 /* max number of coprocessors (0..7) */ - -/* Misc: */ -#define XTHAL_LITTLEENDIAN 0 -#define XTHAL_BIGENDIAN 1 - - - -#if !defined(_ASMLANGUAGE) && !defined(_NOCLANGUAGE) && !defined(__ASSEMBLER__) -#ifdef __cplusplus -extern "C" { -#endif - -/*---------------------------------------------------------------------- - HAL - ----------------------------------------------------------------------*/ - -/* Constant to be checked in build = (XTHAL_MAJOR_REV<<16)|XTHAL_MINOR_REV */ -extern const unsigned int Xthal_rev_no; - - -/*---------------------------------------------------------------------- - Optional/Custom Processor State - ----------------------------------------------------------------------*/ - -/* save & restore the extra processor state */ -extern void xthal_save_extra(void *base); -extern void xthal_restore_extra(void *base); - -extern void xthal_save_cpregs(void *base, int); -extern void xthal_restore_cpregs(void *base, int); -/* versions specific to each coprocessor id */ -extern void xthal_save_cp0(void *base); -extern void xthal_save_cp1(void *base); -extern void xthal_save_cp2(void *base); -extern void xthal_save_cp3(void *base); -extern void xthal_save_cp4(void *base); -extern void xthal_save_cp5(void *base); -extern void xthal_save_cp6(void *base); -extern void xthal_save_cp7(void *base); -extern void xthal_restore_cp0(void *base); -extern void xthal_restore_cp1(void *base); -extern void xthal_restore_cp2(void *base); -extern void xthal_restore_cp3(void *base); -extern void xthal_restore_cp4(void *base); -extern void xthal_restore_cp5(void *base); -extern void xthal_restore_cp6(void *base); -extern void xthal_restore_cp7(void *base); -/* pointers to each of the functions above */ -extern void* Xthal_cpregs_save_fn[XTHAL_MAX_CPS]; -extern void* Xthal_cpregs_restore_fn[XTHAL_MAX_CPS]; -/* similarly for non-windowed ABI (may be same or different) */ -extern void* Xthal_cpregs_save_nw_fn[XTHAL_MAX_CPS]; -extern void* Xthal_cpregs_restore_nw_fn[XTHAL_MAX_CPS]; - -/*extern void xthal_save_all_extra(void *base);*/ -/*extern void xthal_restore_all_extra(void *base);*/ - -/* space for processor state */ -extern const unsigned int Xthal_extra_size; -extern const unsigned int Xthal_extra_align; -extern const unsigned int Xthal_cpregs_size[XTHAL_MAX_CPS]; -extern const unsigned int Xthal_cpregs_align[XTHAL_MAX_CPS]; -extern const unsigned int Xthal_all_extra_size; -extern const unsigned int Xthal_all_extra_align; -/* coprocessor names */ -extern const char * const Xthal_cp_names[XTHAL_MAX_CPS]; - -/* initialize the extra processor */ -/*extern void xthal_init_extra(void);*/ -/* initialize the TIE coprocessor */ -/*extern void xthal_init_cp(int);*/ - -/* initialize the extra processor */ -extern void xthal_init_mem_extra(void *); -/* initialize the TIE coprocessor */ -extern void xthal_init_mem_cp(void *, int); - -/* the number of TIE coprocessors contiguous from zero (for Tor2) */ -extern const unsigned int Xthal_num_coprocessors; - -/* actual number of coprocessors */ -extern const unsigned char Xthal_cp_num; -/* index of highest numbered coprocessor, plus one */ -extern const unsigned char Xthal_cp_max; -/* index of highest allowed coprocessor number, per cfg, plus one */ -/*extern const unsigned char Xthal_cp_maxcfg;*/ -/* bitmask of which coprocessors are present */ -extern const unsigned int Xthal_cp_mask; - -/* read & write extra state register */ -/*extern int xthal_read_extra(void *base, unsigned reg, unsigned *value);*/ -/*extern int xthal_write_extra(void *base, unsigned reg, unsigned value);*/ - -/* read & write a TIE coprocessor register */ -/*extern int xthal_read_cpreg(void *base, int cp, unsigned reg, unsigned *value);*/ -/*extern int xthal_write_cpreg(void *base, int cp, unsigned reg, unsigned value);*/ - -/* return coprocessor number based on register */ -/*extern int xthal_which_cp(unsigned reg);*/ - - -/*---------------------------------------------------------------------- - Register Windows - ----------------------------------------------------------------------*/ - -/* number of registers in register window */ -extern const unsigned int Xthal_num_aregs; -extern const unsigned char Xthal_num_aregs_log2; - - -/*---------------------------------------------------------------------- - Cache - ----------------------------------------------------------------------*/ - -/* size of the cache lines in log2(bytes) */ -extern const unsigned char Xthal_icache_linewidth; -extern const unsigned char Xthal_dcache_linewidth; -/* size of the cache lines in bytes (2^linewidth) */ -extern const unsigned short Xthal_icache_linesize; -extern const unsigned short Xthal_dcache_linesize; - -/* size of the caches in bytes (ways * 2^(linewidth + setwidth)) */ -extern const unsigned int Xthal_icache_size; -extern const unsigned int Xthal_dcache_size; -/* cache features */ -extern const unsigned char Xthal_dcache_is_writeback; - -/* invalidate the caches */ - -extern void xthal_icache_region_invalidate( void *addr, unsigned size ); -extern void xthal_dcache_region_invalidate( void *addr, unsigned size ); -# ifndef XTHAL_USE_CACHE_MACROS -extern void xthal_icache_line_invalidate(void *addr); -extern void xthal_dcache_line_invalidate(void *addr); -# endif -/* write dirty data back */ -extern void xthal_dcache_region_writeback( void *addr, unsigned size ); -# ifndef XTHAL_USE_CACHE_MACROS -extern void xthal_dcache_line_writeback(void *addr); -# endif -/* write dirty data back and invalidate */ -extern void xthal_dcache_region_writeback_inv( void *addr, unsigned size ); -# ifndef XTHAL_USE_CACHE_MACROS -extern void xthal_dcache_line_writeback_inv(void *addr); -/* sync icache and memory */ -extern void xthal_icache_sync( void ); -/* sync dcache and memory */ -extern void xthal_dcache_sync( void ); -#endif - -/* get number of icache ways enabled */ -extern unsigned int xthal_icache_get_ways(void); -/* set number of icache ways enabled */ -extern void xthal_icache_set_ways(unsigned int ways); -/* get number of dcache ways enabled */ -extern unsigned int xthal_dcache_get_ways(void); -/* set number of dcache ways enabled */ -extern void xthal_dcache_set_ways(unsigned int ways); - -/* coherency (low-level -- not normally called directly) */ -extern void xthal_cache_coherence_on( void ); -extern void xthal_cache_coherence_off( void ); -/* coherency (high-level) */ -extern void xthal_cache_coherence_optin( void ); -extern void xthal_cache_coherence_optout( void ); - -/* - * Cache prefetch control. - * The parameter to xthal_set_cache_prefetch() contains both - * a PREFCTL register value and a mask of which bits to actually modify. - * This allows easily combining field macros (below) by ORing, - * leaving unspecified fields unmodified. - * - * For backward compatibility with the older version of this routine - * (that took 15-bit value and mask in a 32-bit parameter, for pre-RF - * cores with only the lower 15 bits of PREFCTL defined), the 32-bit - * value and mask are staggered as follows in a 64-bit parameter: - * param[63:48] are PREFCTL[31:16] if param[31] is set - * param[47:32] are mask[31:16] if param[31] is set - * param[31] is set if mask is used, 0 if not - * param[31:16] are mask[15:0] if param[31] is set - * param[31:16] are PREFCTL[31:16] if param[31] is clear - * param[15:0] are PREFCTL[15:0] - * - * Limitation: PREFCTL register bit 31 cannot be set without masking, - * and bit 15 must always be set when using masking, so it is hoped that - * these two bits will remain reserved, read-as-zero in PREFCTL. - */ -#define XTHAL_PREFETCH_ENABLE -1 /* enable inst+data prefetch */ -#define XTHAL_PREFETCH_DISABLE 0xFFFF0000 /* disab inst+data prefetch*/ -#define XTHAL_DCACHE_PREFETCH(n) (0x800F0000+((n)&0xF)) /* data-side */ -#define XTHAL_DCACHE_PREFETCH_OFF XTHAL_DCACHE_PREFETCH(0) /* disable */ -#define XTHAL_DCACHE_PREFETCH_LOW XTHAL_DCACHE_PREFETCH(4) /* less aggr.*/ -#define XTHAL_DCACHE_PREFETCH_MEDIUM XTHAL_DCACHE_PREFETCH(5) /* mid aggr. */ -#define XTHAL_DCACHE_PREFETCH_HIGH XTHAL_DCACHE_PREFETCH(8) /* more aggr.*/ -#define XTHAL_DCACHE_PREFETCH_L1_OFF 0x90000000 /* to prefetch buffers*/ -#define XTHAL_DCACHE_PREFETCH_L1 0x90001000 /* direct to L1 dcache*/ -#define XTHAL_ICACHE_PREFETCH(n) (0x80F00000+(((n)&0xF)<<4)) /* i-side */ -#define XTHAL_ICACHE_PREFETCH_OFF XTHAL_ICACHE_PREFETCH(0) /* disable */ -#define XTHAL_ICACHE_PREFETCH_LOW XTHAL_ICACHE_PREFETCH(4) /* less aggr.*/ -#define XTHAL_ICACHE_PREFETCH_MEDIUM XTHAL_ICACHE_PREFETCH(5) /* mid aggr. */ -#define XTHAL_ICACHE_PREFETCH_HIGH XTHAL_ICACHE_PREFETCH(8) /* more aggr.*/ -#define XTHAL_ICACHE_PREFETCH_L1_OFF 0xA0000000 /* (not implemented) */ -#define XTHAL_ICACHE_PREFETCH_L1 0xA0002000 /* (not implemented) */ -#define _XTHAL_PREFETCH_BLOCKS(n) ((n)<0?0:(n)<5?(n):(n)<15?((n)>>1)+2:9) -#define XTHAL_PREFETCH_BLOCKS(n) (0x0000000F80000000ULL + \ - (((unsigned long long)_XTHAL_PREFETCH_BLOCKS(n))<<48)) - -extern int xthal_get_cache_prefetch( void ); -extern int xthal_set_cache_prefetch( int ); -extern int xthal_set_cache_prefetch_long( unsigned long long ); -/* Only use the new extended function from now on: */ -#define xthal_set_cache_prefetch xthal_set_cache_prefetch_long -#define xthal_set_cache_prefetch_nw xthal_set_cache_prefetch_long_nw - - -/*---------------------------------------------------------------------- - Debug - ----------------------------------------------------------------------*/ - -/* 1 if debug option configured, 0 if not: */ -extern const int Xthal_debug_configured; - -/* Set (plant) and remove software breakpoint, both synchronizing cache: */ -extern unsigned int xthal_set_soft_break(void *addr); -extern void xthal_remove_soft_break(void *addr, unsigned int); - - -/*---------------------------------------------------------------------- - Disassembler - ----------------------------------------------------------------------*/ - -/* Max expected size of the return buffer for a disassembled instruction (hint only): */ -#define XTHAL_DISASM_BUFSIZE 80 - -/* Disassembly option bits for selecting what to return: */ -#define XTHAL_DISASM_OPT_ADDR 0x0001 /* display address */ -#define XTHAL_DISASM_OPT_OPHEX 0x0002 /* display opcode bytes in hex */ -#define XTHAL_DISASM_OPT_OPCODE 0x0004 /* display opcode name (mnemonic) */ -#define XTHAL_DISASM_OPT_PARMS 0x0008 /* display parameters */ -#define XTHAL_DISASM_OPT_ALL 0x0FFF /* display everything */ - -/* routine to get a string for the disassembled instruction */ -extern int xthal_disassemble( unsigned char *instr_buf, void *tgt_addr, - char *buffer, unsigned buflen, unsigned options ); - -/* routine to get the size of the next instruction. Returns 0 for - illegal instruction */ -extern int xthal_disassemble_size( unsigned char *instr_buf ); - - -/*---------------------------------------------------------------------- - Instruction/Data RAM/ROM Access - ----------------------------------------------------------------------*/ - -extern void* xthal_memcpy(void *dst, const void *src, unsigned len); -extern void* xthal_bcopy(const void *src, void *dst, unsigned len); - - -/*---------------------------------------------------------------------- - MP Synchronization - ----------------------------------------------------------------------*/ - -extern int xthal_compare_and_set( int *addr, int test_val, int compare_val ); - -/*extern const char Xthal_have_s32c1i;*/ - - -/*---------------------------------------------------------------------- - Miscellaneous - ----------------------------------------------------------------------*/ - -extern const unsigned int Xthal_release_major; -extern const unsigned int Xthal_release_minor; -extern const char * const Xthal_release_name; -extern const char * const Xthal_release_internal; - -extern const unsigned char Xthal_memory_order; -extern const unsigned char Xthal_have_windowed; -extern const unsigned char Xthal_have_density; -extern const unsigned char Xthal_have_booleans; -extern const unsigned char Xthal_have_loops; -extern const unsigned char Xthal_have_nsa; -extern const unsigned char Xthal_have_minmax; -extern const unsigned char Xthal_have_sext; -extern const unsigned char Xthal_have_clamps; -extern const unsigned char Xthal_have_mac16; -extern const unsigned char Xthal_have_mul16; -extern const unsigned char Xthal_have_fp; -extern const unsigned char Xthal_have_speculation; -extern const unsigned char Xthal_have_threadptr; - -extern const unsigned char Xthal_have_pif; -extern const unsigned short Xthal_num_writebuffer_entries; - -extern const unsigned int Xthal_build_unique_id; -/* Version info for hardware targeted by software upgrades: */ -extern const unsigned int Xthal_hw_configid0; -extern const unsigned int Xthal_hw_configid1; -extern const unsigned int Xthal_hw_release_major; -extern const unsigned int Xthal_hw_release_minor; -extern const char * const Xthal_hw_release_name; -extern const char * const Xthal_hw_release_internal; - -/* Clear any remnant code-dependent state (i.e. clear loop count regs). */ -extern void xthal_clear_regcached_code( void ); - -#ifdef __cplusplus -} -#endif -#endif /*!_ASMLANGUAGE && !_NOCLANGUAGE && !__ASSEMBLER__ */ - - - - - -/**************************************************************************** - Definitions Useful for PRIVILEGED (Supervisory or Non-Virtualized) Code - ****************************************************************************/ - - -#ifndef XTENSA_HAL_NON_PRIVILEGED_ONLY - -/*---------------------------------------------------------------------- - Constant Definitions (shared with assembly) - ----------------------------------------------------------------------*/ - -/* - * Architectural limits, independent of configuration. - * Note that these are ISA-defined limits, not micro-architecture implementation - * limits enforced by the Xtensa Processor Generator (which may be stricter than - * these below). - */ -#define XTHAL_MAX_INTERRUPTS 32 /* max number of interrupts (0..31) */ -#define XTHAL_MAX_INTLEVELS 16 /* max number of interrupt levels (0..15) */ - /* (as of T1040, implementation limit is 7: 0..6) */ -#define XTHAL_MAX_TIMERS 4 /* max number of timers (CCOMPARE0..CCOMPARE3) */ - /* (as of T1040, implementation limit is 3: 0..2) */ - -/* Interrupt types: */ -#define XTHAL_INTTYPE_UNCONFIGURED 0 -#define XTHAL_INTTYPE_SOFTWARE 1 -#define XTHAL_INTTYPE_EXTERN_EDGE 2 -#define XTHAL_INTTYPE_EXTERN_LEVEL 3 -#define XTHAL_INTTYPE_TIMER 4 -#define XTHAL_INTTYPE_NMI 5 -#define XTHAL_INTTYPE_WRITE_ERROR 6 -#define XTHAL_INTTYPE_PROFILING 7 -#define XTHAL_MAX_INTTYPES 8 /* number of interrupt types */ - -/* Timer related: */ -#define XTHAL_TIMER_UNCONFIGURED -1 /* Xthal_timer_interrupt[] value for non-existent timers */ -#define XTHAL_TIMER_UNASSIGNED XTHAL_TIMER_UNCONFIGURED /* (for backwards compatibility only) */ - -/* Local Memory ECC/Parity: */ -#define XTHAL_MEMEP_PARITY 1 -#define XTHAL_MEMEP_ECC 2 -/* Flags parameter to xthal_memep_inject_error(): */ -#define XTHAL_MEMEP_F_LOCAL 0 /* local memory (default) */ -#define XTHAL_MEMEP_F_DCACHE_DATA 4 /* data cache data */ -#define XTHAL_MEMEP_F_DCACHE_TAG 5 /* data cache tag */ -#define XTHAL_MEMEP_F_ICACHE_DATA 6 /* instruction cache data */ -#define XTHAL_MEMEP_F_ICACHE_TAG 7 /* instruction cache tag */ -#define XTHAL_MEMEP_F_CORRECTABLE 16 /* inject correctable error - (default is non-corr.) */ - - -/* Access Mode bits (tentative): */ /* bit abbr unit short_name PPC equ - Description */ -#define XTHAL_AMB_EXCEPTION 0 /* 001 E EX fls: EXception none - exception on any access (aka "illegal") */ -#define XTHAL_AMB_HITCACHE 1 /* 002 C CH fls: use Cache on Hit ~(I CI) - [or H HC] way from tag match; - [or U UC] (ISA: same except Isolate case) */ -#define XTHAL_AMB_ALLOCATE 2 /* 004 A AL fl?: ALlocate none - [or F FI fill] refill cache on miss, way from LRU - (ISA: Read/Write Miss Refill) */ -#define XTHAL_AMB_WRITETHRU 3 /* 008 W WT --s: WriteThrough W WT - store immediately to memory (ISA: same) */ -#define XTHAL_AMB_ISOLATE 4 /* 010 I IS fls: ISolate none - use cache regardless of hit-vs-miss, - way from vaddr (ISA: use-cache-on-miss+hit) */ -#define XTHAL_AMB_GUARD 5 /* 020 G GU ?l?: GUard G * - non-speculative; spec/replay refs not permitted */ -#define XTHAL_AMB_COHERENT 6 /* 040 M MC ?ls: Mem/MP Coherent M - on read, other CPU/bus-master may need to supply data; - on write, maybe redirect to or flush other CPU dirty line; etc */ -#if 0 -#define XTHAL_AMB_BUFFERABLE x /* 000 B BU --s: BUfferable ? - write response may return earlier than from final destination */ -#define XTHAL_AMB_ORDERED x /* 000 O OR fls: ORdered G * - mem accesses cannot be out of order */ -#define XTHAL_AMB_FUSEWRITES x /* 000 F FW --s: FuseWrites none - allow combining/merging/coalescing multiple writes - (to same datapath data unit) into one - (implied by writeback) */ -#define XTHAL_AMB_TRUSTED x /* 000 T TR ?l?: TRusted none - memory will not bus error (if it does, - handle as fatal imprecise interrupt) */ -#define XTHAL_AMB_PREFETCH x /* 000 P PR fl?: PRefetch none - on refill, read line+1 into prefetch buffers */ -#define XTHAL_AMB_STREAM x /* 000 S ST ???: STreaming none - access one of N stream buffers */ -#endif /*0*/ - -#define XTHAL_AM_EXCEPTION (1< = bit is set - * '-' = bit is clear - * '.' = bit is irrelevant / don't care, as follows: - * E=1 makes all others irrelevant - * W,F relevant only for stores - * "2345" - * Indicates which Xtensa releases support the corresponding - * access mode. Releases for each character column are: - * 2 = prior to T1020.2: T1015 (V1.5), T1020.0, T1020.1 - * 3 = T1020.2 and later: T1020.2+, T1030 - * 4 = T1040 - * 5 = T1050 (maybe), LX1, LX2, LX2.1 - * 7 = LX2.2 - * 8 = LX3, LX4 - * 9 = LX5 - * And the character column contents are: - * = supported by release(s) - * "." = unsupported by release(s) - * "?" = support unknown - */ - /* foMGIWACE 2345789 */ -/* For instruction fetch: */ -#define XTHAL_FAM_EXCEPTION 0x001 /* ........E 2345789 exception */ -/*efine XTHAL_FAM_ISOLATE*/ /*0x012*/ /* .---I.-C- ....... isolate */ -#define XTHAL_FAM_BYPASS 0x000 /* .----.--- 2345789 bypass */ -/*efine XTHAL_FAM_NACACHED*/ /*0x002*/ /* .----.-C- ....... cached no-allocate (frozen) */ -#define XTHAL_FAM_CACHED 0x006 /* .----.AC- 2345789 cached */ -/* For data load: */ -#define XTHAL_LAM_EXCEPTION 0x001 /* ........E 2345789 exception */ -#define XTHAL_LAM_ISOLATE 0x012 /* .---I.-C- 2345789 isolate */ -#define XTHAL_LAM_BYPASS 0x000 /* .O---.--- 2...... bypass speculative */ -#define XTHAL_LAM_BYPASSG 0x020 /* .O-G-.--- .345789 bypass guarded */ -#define XTHAL_LAM_CACHED_NOALLOC 0x002 /* .O---.-C- 2345789 cached no-allocate speculative */ -#define XTHAL_LAM_NACACHED XTHAL_LAM_CACHED_NOALLOC -#define XTHAL_LAM_NACACHEDG 0x022 /* .O-G-.-C- .?..... cached no-allocate guarded */ -#define XTHAL_LAM_CACHED 0x006 /* .----.AC- 2345789 cached speculative */ -#define XTHAL_LAM_COHCACHED 0x046 /* .-M--.AC- ....*89 cached speculative MP-coherent */ -/* For data store: */ -#define XTHAL_SAM_EXCEPTION 0x001 /* ........E 2345789 exception */ -#define XTHAL_SAM_ISOLATE 0x032 /* .--GI--C- 2345789 isolate */ -#define XTHAL_SAM_BYPASS 0x028 /* -O-G-W--- 2345789 bypass */ -#define XTHAL_SAM_WRITETHRU 0x02A /* -O-G-W-C- 2345789 writethrough */ -/*efine XTHAL_SAM_WRITETHRU_ALLOC*/ /*0x02E*/ /* -O-G-WAC- ....... writethrough allocate */ -#define XTHAL_SAM_WRITEBACK 0x026 /* F--G--AC- ...5789 writeback */ -#define XTHAL_SAM_WRITEBACK_NOALLOC 0x022 /* ?--G---C- .....89 writeback no-allocate */ -#define XTHAL_SAM_COHWRITEBACK 0x066 /* F-MG--AC- ....*89 writeback MP-coherent */ -/* For PIF attributes: */ /* -PIwrWCBUUUU ...9 */ -#define XTHAL_PAM_BYPASS 0x000 /* xxx00000xxxx ...9 bypass non-bufferable */ -#define XTHAL_PAM_BYPASS_BUF 0x010 /* xxx0000bxxxx ...9 bypass */ -#define XTHAL_PAM_CACHED_NOALLOC 0x030 /* xxx0001bxxxx ...9 cached no-allocate */ -#define XTHAL_PAM_WRITETHRU 0x0B0 /* xxx0101bxxxx ...9 writethrough (WT) */ -#define XTHAL_PAM_WRITEBACK_NOALLOC 0x0F0 /* xxx0111bxxxx ...9 writeback no-alloc (WBNA) */ -#define XTHAL_PAM_WRITEBACK 0x1F0 /* xxx1111bxxxx ...9 writeback (WB) */ -/*efine XTHAL_PAM_NORMAL*/ /*0x050*/ /* xxx0010bxxxx .... (unimplemented) */ -/*efine XTHAL_PAM_WRITETHRU_WA*/ /*0x130*/ /* xxx1001bxxxx .... (unimplemented, less likely) */ -/*efine XTHAL_PAM_WRITETHRU_RWA*/ /*0x1B0*/ /* xxx1101bxxxx .... (unimplemented, less likely) */ -/*efine XTHAL_PAM_WRITEBACK_WA*/ /*0x170*/ /* xxx1011bxxxx .... (unimplemented, less likely) */ - - -#if 0 -/* - Cache attribute encoding for CACHEATTR (per ISA): - (Note: if this differs from ISA Ref Manual, ISA has precedence) - - Inst-fetches Loads Stores - ------------- ------------ ------------- -0x0 FCA_EXCEPTION LCA_NACACHED SCA_WRITETHRU cached no-allocate (previously misnamed "uncached") -0x1 FCA_CACHED LCA_CACHED SCA_WRITETHRU cached -0x2 FCA_BYPASS LCA_BYPASS_G* SCA_BYPASS bypass cache (what most people call uncached) -0x3 FCA_CACHED LCA_CACHED SCA_WRITEALLOCF write-allocate - or LCA_EXCEPTION SCA_EXCEPTION (if unimplemented) -0x4 FCA_CACHED LCA_CACHED SCA_WRITEBACK[M] write-back [MP-coherent] - or LCA_EXCEPTION SCA_EXCEPTION (if unimplemented) -0x5 FCA_CACHED LCA_CACHED SCA_WRITEBACK_NOALLOC write-back no-allocate - or FCA_EXCEPTION LCA_EXCEPTION SCA_EXCEPTION (if unimplemented) -0x6..D FCA_EXCEPTION LCA_EXCEPTION SCA_EXCEPTION (reserved) -0xE FCA_EXCEPTION LCA_ISOLATE SCA_ISOLATE isolate -0xF FCA_EXCEPTION LCA_EXCEPTION SCA_EXCEPTION illegal - * Prior to T1020.2?, guard feature not supported, this defaulted to speculative (no _G) -*/ -#endif /*0*/ - - -#if !defined(_ASMLANGUAGE) && !defined(_NOCLANGUAGE) && !defined(__ASSEMBLER__) -#ifdef __cplusplus -extern "C" { -#endif - - -/*---------------------------------------------------------------------- - Register Windows - ----------------------------------------------------------------------*/ - -/* This spill any live register windows (other than the caller's): - * (NOTE: current implementation require privileged code, but - * a user-callable implementation is possible.) */ -extern void xthal_window_spill( void ); - - -/*---------------------------------------------------------------------- - Optional/Custom Processor State - ----------------------------------------------------------------------*/ - -/* validate & invalidate the TIE register file */ -extern void xthal_validate_cp(int); -extern void xthal_invalidate_cp(int); - -/* read and write cpenable register */ -extern void xthal_set_cpenable(unsigned); -extern unsigned xthal_get_cpenable(void); - - -/*---------------------------------------------------------------------- - Interrupts - ----------------------------------------------------------------------*/ - -/* the number of interrupt levels */ -extern const unsigned char Xthal_num_intlevels; -/* the number of interrupts */ -extern const unsigned char Xthal_num_interrupts; -/* the highest level of interrupts masked by PS.EXCM */ -extern const unsigned char Xthal_excm_level; - -/* mask for level of interrupts */ -extern const unsigned int Xthal_intlevel_mask[XTHAL_MAX_INTLEVELS]; -/* mask for level 0 to N interrupts */ -extern const unsigned int Xthal_intlevel_andbelow_mask[XTHAL_MAX_INTLEVELS]; - -/* level of each interrupt */ -extern const unsigned char Xthal_intlevel[XTHAL_MAX_INTERRUPTS]; - -/* type per interrupt */ -extern const unsigned char Xthal_inttype[XTHAL_MAX_INTERRUPTS]; - -/* masks of each type of interrupt */ -extern const unsigned int Xthal_inttype_mask[XTHAL_MAX_INTTYPES]; - -/* interrupt numbers assigned to each timer interrupt */ -extern const int Xthal_timer_interrupt[XTHAL_MAX_TIMERS]; - -/* INTENABLE,INTERRUPT,INTSET,INTCLEAR register access functions: */ -extern unsigned xthal_get_intenable( void ); -extern void xthal_set_intenable( unsigned ); -extern unsigned xthal_get_interrupt( void ); -#define xthal_get_intread xthal_get_interrupt /* backward compatibility */ -extern void xthal_set_intset( unsigned ); -extern void xthal_set_intclear( unsigned ); - - -/*---------------------------------------------------------------------- - Debug - ----------------------------------------------------------------------*/ - -/* Number of instruction and data break registers: */ -extern const int Xthal_num_ibreak; -extern const int Xthal_num_dbreak; - - -/*---------------------------------------------------------------------- - Core Counter - ----------------------------------------------------------------------*/ - -/* counter info */ -extern const unsigned char Xthal_have_ccount; /* set if CCOUNT register present */ -extern const unsigned char Xthal_num_ccompare; /* number of CCOMPAREn registers */ - -/* get CCOUNT register (if not present return 0) */ -extern unsigned xthal_get_ccount(void); - -/* set and get CCOMPAREn registers (if not present, get returns 0) */ -extern void xthal_set_ccompare(int, unsigned); -extern unsigned xthal_get_ccompare(int); - - -/*---------------------------------------------------------------------- - Miscellaneous - ----------------------------------------------------------------------*/ - -extern const unsigned char Xthal_have_prid; -extern const unsigned char Xthal_have_exceptions; -extern const unsigned char Xthal_xea_version; -extern const unsigned char Xthal_have_interrupts; -extern const unsigned char Xthal_have_highlevel_interrupts; -extern const unsigned char Xthal_have_nmi; - -extern unsigned xthal_get_prid( void ); - - -/*---------------------------------------------------------------------- - Virtual interrupt prioritization (DEPRECATED) - ----------------------------------------------------------------------*/ - -/* Convert between interrupt levels (as per PS.INTLEVEL) and virtual interrupt priorities: */ -extern unsigned xthal_vpri_to_intlevel(unsigned vpri); -extern unsigned xthal_intlevel_to_vpri(unsigned intlevel); - -/* Enables/disables given set (mask) of interrupts; returns previous enabled-mask of all ints: */ -extern unsigned xthal_int_enable(unsigned); -extern unsigned xthal_int_disable(unsigned); - -/* Set/get virtual priority of an interrupt: */ -extern int xthal_set_int_vpri(int intnum, int vpri); -extern int xthal_get_int_vpri(int intnum); - -/* Set/get interrupt lockout level for exclusive access to virtual priority data structures: */ -extern void xthal_set_vpri_locklevel(unsigned intlevel); -extern unsigned xthal_get_vpri_locklevel(void); - -/* Set/get current virtual interrupt priority: */ -extern unsigned xthal_set_vpri(unsigned vpri); -extern unsigned xthal_get_vpri(void); -extern unsigned xthal_set_vpri_intlevel(unsigned intlevel); -extern unsigned xthal_set_vpri_lock(void); - - -/*---------------------------------------------------------------------- - Generic Interrupt Trampolining Support (DEPRECATED) - ----------------------------------------------------------------------*/ - -typedef void (XtHalVoidFunc)(void); - -/* Bitmask of interrupts currently trampolining down: */ -extern unsigned Xthal_tram_pending; - -/* - * Bitmask of which interrupts currently trampolining down synchronously are - * actually enabled; this bitmask is necessary because INTENABLE cannot hold - * that state (sync-trampolining interrupts must be kept disabled while - * trampolining); in the current implementation, any bit set here is not set - * in INTENABLE, and vice-versa; once a sync-trampoline is handled (at level - * one), its enable bit must be moved from here to INTENABLE: - */ -extern unsigned Xthal_tram_enabled; - -/* Bitmask of interrupts configured for sync trampolining: */ -extern unsigned Xthal_tram_sync; - -/* Trampoline support functions: */ -extern unsigned xthal_tram_pending_to_service( void ); -extern void xthal_tram_done( unsigned serviced_mask ); -extern int xthal_tram_set_sync( int intnum, int sync ); -extern XtHalVoidFunc* xthal_set_tram_trigger_func( XtHalVoidFunc *trigger_fn ); - - -/*---------------------------------------------------------------------- - Internal Memories - ----------------------------------------------------------------------*/ - -extern const unsigned char Xthal_num_instrom; -extern const unsigned char Xthal_num_instram; -extern const unsigned char Xthal_num_datarom; -extern const unsigned char Xthal_num_dataram; -extern const unsigned char Xthal_num_xlmi; - -/* Each of the following arrays contains at least one entry, - * or as many entries as needed if more than one: */ -extern const unsigned int Xthal_instrom_vaddr[]; -extern const unsigned int Xthal_instrom_paddr[]; -extern const unsigned int Xthal_instrom_size []; -extern const unsigned int Xthal_instram_vaddr[]; -extern const unsigned int Xthal_instram_paddr[]; -extern const unsigned int Xthal_instram_size []; -extern const unsigned int Xthal_datarom_vaddr[]; -extern const unsigned int Xthal_datarom_paddr[]; -extern const unsigned int Xthal_datarom_size []; -extern const unsigned int Xthal_dataram_vaddr[]; -extern const unsigned int Xthal_dataram_paddr[]; -extern const unsigned int Xthal_dataram_size []; -extern const unsigned int Xthal_xlmi_vaddr[]; -extern const unsigned int Xthal_xlmi_paddr[]; -extern const unsigned int Xthal_xlmi_size []; - - -/*---------------------------------------------------------------------- - Cache - ----------------------------------------------------------------------*/ - -/* number of cache sets in log2(lines per way) */ -extern const unsigned char Xthal_icache_setwidth; -extern const unsigned char Xthal_dcache_setwidth; -/* cache set associativity (number of ways) */ -extern const unsigned int Xthal_icache_ways; -extern const unsigned int Xthal_dcache_ways; -/* cache features */ -extern const unsigned char Xthal_icache_line_lockable; -extern const unsigned char Xthal_dcache_line_lockable; - -/* cache attribute register control (used by other HAL routines) */ -extern unsigned xthal_get_cacheattr( void ); -extern unsigned xthal_get_icacheattr( void ); -extern unsigned xthal_get_dcacheattr( void ); -extern void xthal_set_cacheattr( unsigned ); -extern void xthal_set_icacheattr( unsigned ); -extern void xthal_set_dcacheattr( unsigned ); -/* set cache attribute (access modes) for a range of memory */ -extern int xthal_set_region_attribute( void *addr, unsigned size, - unsigned cattr, unsigned flags ); -/* Bits of flags parameter to xthal_set_region_attribute(): */ -#define XTHAL_CAFLAG_EXPAND 0x000100 /* only expand allowed access to range, don't reduce it */ -#define XTHAL_CAFLAG_EXACT 0x000200 /* return error if can't apply change to exact range specified */ -#define XTHAL_CAFLAG_NO_PARTIAL 0x000400 /* don't apply change to regions partially covered by range */ -#define XTHAL_CAFLAG_NO_AUTO_WB 0x000800 /* don't writeback data after leaving writeback attribute */ -#define XTHAL_CAFLAG_NO_AUTO_INV 0x001000 /* don't invalidate after disabling cache (entering bypass) */ - -/* enable caches */ -extern void xthal_icache_enable( void ); /* DEPRECATED */ -extern void xthal_dcache_enable( void ); /* DEPRECATED */ -/* disable caches */ -extern void xthal_icache_disable( void ); /* DEPRECATED */ -extern void xthal_dcache_disable( void ); /* DEPRECATED */ - -/* invalidate the caches */ -extern void xthal_icache_all_invalidate( void ); -extern void xthal_dcache_all_invalidate( void ); -/* write dirty data back */ -extern void xthal_dcache_all_writeback( void ); -/* write dirty data back and invalidate */ -extern void xthal_dcache_all_writeback_inv( void ); -/* prefetch and lock specified memory range into cache */ -extern void xthal_icache_region_lock( void *addr, unsigned size ); -extern void xthal_dcache_region_lock( void *addr, unsigned size ); -# ifndef XTHAL_USE_CACHE_MACROS -extern void xthal_icache_line_lock(void *addr); -extern void xthal_dcache_line_lock(void *addr); -# endif -/* unlock from cache */ -extern void xthal_icache_all_unlock( void ); -extern void xthal_dcache_all_unlock( void ); -extern void xthal_icache_region_unlock( void *addr, unsigned size ); -extern void xthal_dcache_region_unlock( void *addr, unsigned size ); -# ifndef XTHAL_USE_CACHE_MACROS -extern void xthal_icache_line_unlock(void *addr); -extern void xthal_dcache_line_unlock(void *addr); -# endif - - - -/*---------------------------------------------------------------------- - Local Memory ECC/Parity - ----------------------------------------------------------------------*/ - -/* Inject memory errors; flags is bit combination of XTHAL_MEMEP_F_xxx: */ -extern void xthal_memep_inject_error(void *addr, int size, int flags); - - - -/*---------------------------------------------------------------------- - Memory Management Unit - ----------------------------------------------------------------------*/ - -extern const unsigned char Xthal_have_spanning_way; -extern const unsigned char Xthal_have_identity_map; -extern const unsigned char Xthal_have_mimic_cacheattr; -extern const unsigned char Xthal_have_xlt_cacheattr; -extern const unsigned char Xthal_have_cacheattr; -extern const unsigned char Xthal_have_tlbs; - -extern const unsigned char Xthal_mmu_asid_bits; /* 0 .. 8 */ -extern const unsigned char Xthal_mmu_asid_kernel; -extern const unsigned char Xthal_mmu_rings; /* 1 .. 4 (perhaps 0 if no MMU and/or no protection?) */ -extern const unsigned char Xthal_mmu_ring_bits; -extern const unsigned char Xthal_mmu_sr_bits; -extern const unsigned char Xthal_mmu_ca_bits; -extern const unsigned int Xthal_mmu_max_pte_page_size; -extern const unsigned int Xthal_mmu_min_pte_page_size; - -extern const unsigned char Xthal_itlb_way_bits; -extern const unsigned char Xthal_itlb_ways; -extern const unsigned char Xthal_itlb_arf_ways; -extern const unsigned char Xthal_dtlb_way_bits; -extern const unsigned char Xthal_dtlb_ways; -extern const unsigned char Xthal_dtlb_arf_ways; - -/* Convert between virtual and physical addresses (through static maps only): */ -/*** WARNING: these two functions may go away in a future release; don't depend on them! ***/ -extern int xthal_static_v2p( unsigned vaddr, unsigned *paddrp ); -extern int xthal_static_p2v( unsigned paddr, unsigned *vaddrp, unsigned cached ); - -#define XCHAL_SUCCESS 0 -#define XCHAL_ADDRESS_MISALIGNED -1 -#define XCHAL_INEXACT -2 -#define XCHAL_INVALID_ADDRESS -3 -#define XCHAL_UNSUPPORTED_ON_THIS_ARCH -4 -#define XCHAL_NO_PAGES_MAPPED -5 -#define XTHAL_NO_MAPPING -6 - -#define XCHAL_CA_R (0xC0 | 0x40000000) -#define XCHAL_CA_RX (0xD0 | 0x40000000) -#define XCHAL_CA_RW (0xE0 | 0x40000000) -#define XCHAL_CA_RWX (0xF0 | 0x40000000) - -extern int xthal_set_region_translation(void* vaddr, void* paddr, unsigned size, unsigned cache_atr, unsigned flags); -extern int xthal_v2p(void*, void**, unsigned*, unsigned*); -extern int xthal_invalidate_region(void* addr); -extern int xthal_set_region_translation_raw(void *vaddr, void *paddr, unsigned cattr); - -#ifdef __cplusplus -} -#endif -#endif /*!_ASMLANGUAGE && !_NOCLANGUAGE && !__ASSEMBLER__ */ - -#endif /* !XTENSA_HAL_NON_PRIVILEGED_ONLY */ - - - - -/**************************************************************************** - EXPERIMENTAL and DEPRECATED Definitions - ****************************************************************************/ - - -#if !defined(_ASMLANGUAGE) && !defined(_NOCLANGUAGE) && !defined(__ASSEMBLER__) -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef INCLUDE_DEPRECATED_HAL_CODE -extern const unsigned char Xthal_have_old_exc_arch; -extern const unsigned char Xthal_have_mmu; -extern const unsigned int Xthal_num_regs; -extern const unsigned char Xthal_num_iroms; -extern const unsigned char Xthal_num_irams; -extern const unsigned char Xthal_num_droms; -extern const unsigned char Xthal_num_drams; -extern const unsigned int Xthal_configid0; -extern const unsigned int Xthal_configid1; -#endif - -#ifdef INCLUDE_DEPRECATED_HAL_DEBUG_CODE -#define XTHAL_24_BIT_BREAK 0x80000000 -#define XTHAL_16_BIT_BREAK 0x40000000 -extern const unsigned short Xthal_ill_inst_16[16]; -#define XTHAL_DEST_REG 0xf0000000 /* Mask for destination register */ -#define XTHAL_DEST_REG_INST 0x08000000 /* Branch address is in register */ -#define XTHAL_DEST_REL_INST 0x04000000 /* Branch address is relative */ -#define XTHAL_RFW_INST 0x00000800 -#define XTHAL_RFUE_INST 0x00000400 -#define XTHAL_RFI_INST 0x00000200 -#define XTHAL_RFE_INST 0x00000100 -#define XTHAL_RET_INST 0x00000080 -#define XTHAL_BREAK_INST 0x00000040 -#define XTHAL_SYSCALL_INST 0x00000020 -#define XTHAL_LOOP_END 0x00000010 /* Not set by xthal_inst_type */ -#define XTHAL_JUMP_INST 0x00000008 /* Call or jump instruction */ -#define XTHAL_BRANCH_INST 0x00000004 /* Branch instruction */ -#define XTHAL_24_BIT_INST 0x00000002 -#define XTHAL_16_BIT_INST 0x00000001 -typedef struct xthal_state { - unsigned pc; - unsigned ar[16]; - unsigned lbeg; - unsigned lend; - unsigned lcount; - unsigned extra_ptr; - unsigned cpregs_ptr[XTHAL_MAX_CPS]; -} XTHAL_STATE; -extern unsigned int xthal_inst_type(void *addr); -extern unsigned int xthal_branch_addr(void *addr); -extern unsigned int xthal_get_npc(XTHAL_STATE *user_state); -#endif /* INCLUDE_DEPRECATED_HAL_DEBUG_CODE */ - -#ifdef __cplusplus -} -#endif -#endif /*!_ASMLANGUAGE && !_NOCLANGUAGE && !__ASSEMBLER__ */ - -#endif /*XTENSA_HAL_H*/ - diff --git a/tools/sdk/include/esp32/xtensa/specreg.h b/tools/sdk/include/esp32/xtensa/specreg.h deleted file mode 100644 index 0b2edee0172..00000000000 --- a/tools/sdk/include/esp32/xtensa/specreg.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Xtensa Special Register symbolic names - */ - -/* $Id: //depot/rel/Eaglenest/Xtensa/OS/include/xtensa/specreg.h#2 $ */ - -/* - * Copyright (c) 2005-2011 Tensilica Inc. - * - * 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. - */ - -#ifndef XTENSA_SPECREG_H -#define XTENSA_SPECREG_H - -/* Special registers: */ -#define LBEG 0 -#define LEND 1 -#define LCOUNT 2 -#define SAR 3 -#define BR 4 -#define LITBASE 5 -#define SCOMPARE1 12 -#define ACCLO 16 -#define ACCHI 17 -#define MR_0 32 -#define MR_1 33 -#define MR_2 34 -#define MR_3 35 -#define PREFCTL 40 -#define WINDOWBASE 72 -#define WINDOWSTART 73 -#define PTEVADDR 83 -#define RASID 90 -#define ITLBCFG 91 -#define DTLBCFG 92 -#define IBREAKENABLE 96 -#define MEMCTL 97 -#define CACHEATTR 98 -#define ATOMCTL 99 -#define DDR 104 -#define MECR 110 -#define IBREAKA_0 128 -#define IBREAKA_1 129 -#define DBREAKA_0 144 -#define DBREAKA_1 145 -#define DBREAKC_0 160 -#define DBREAKC_1 161 -#define CONFIGID0 176 -#define EPC_1 177 -#define EPC_2 178 -#define EPC_3 179 -#define EPC_4 180 -#define EPC_5 181 -#define EPC_6 182 -#define EPC_7 183 -#define DEPC 192 -#define EPS_2 194 -#define EPS_3 195 -#define EPS_4 196 -#define EPS_5 197 -#define EPS_6 198 -#define EPS_7 199 -#define CONFIGID1 208 -#define EXCSAVE_1 209 -#define EXCSAVE_2 210 -#define EXCSAVE_3 211 -#define EXCSAVE_4 212 -#define EXCSAVE_5 213 -#define EXCSAVE_6 214 -#define EXCSAVE_7 215 -#define CPENABLE 224 -#define INTERRUPT 226 -#define INTREAD INTERRUPT /* alternate name for backward compatibility */ -#define INTSET INTERRUPT /* alternate name for backward compatibility */ -#define INTCLEAR 227 -#define INTENABLE 228 -#define PS 230 -#define VECBASE 231 -#define EXCCAUSE 232 -#define DEBUGCAUSE 233 -#define CCOUNT 234 -#define PRID 235 -#define ICOUNT 236 -#define ICOUNTLEVEL 237 -#define EXCVADDR 238 -#define CCOMPARE_0 240 -#define CCOMPARE_1 241 -#define CCOMPARE_2 242 -#define MISC_REG_0 244 -#define MISC_REG_1 245 -#define MISC_REG_2 246 -#define MISC_REG_3 247 - -/* Special cases (bases of special register series): */ -#define MR 32 -#define IBREAKA 128 -#define DBREAKA 144 -#define DBREAKC 160 -#define EPC 176 -#define EPS 192 -#define EXCSAVE 208 -#define CCOMPARE 240 -#define MISC_REG 244 - -/* Tensilica-defined user registers: */ -#if 0 -/*#define ... 21..24 */ /* (545CK) */ -/*#define ... 140..143 */ /* (545CK) */ -#define EXPSTATE 230 /* Diamond */ -#define THREADPTR 231 /* threadptr option */ -#define FCR 232 /* FPU */ -#define FSR 233 /* FPU */ -#define AE_OVF_SAR 240 /* HiFi2 */ -#define AE_BITHEAD 241 /* HiFi2 */ -#define AE_TS_FTS_BU_BP 242 /* HiFi2 */ -#define AE_SD_NO 243 /* HiFi2 */ -#define VSAR 240 /* VectraLX */ -#define ROUND_LO 242 /* VectraLX */ -#define ROUND_HI 243 /* VectraLX */ -#define CBEGIN 246 /* VectraLX */ -#define CEND 247 /* VectraLX */ -#endif - -#endif /* XTENSA_SPECREG_H */ - diff --git a/tools/sdk/include/esp32/xtensa/traxreg.h b/tools/sdk/include/esp32/xtensa/traxreg.h deleted file mode 100644 index 282ba1feef2..00000000000 --- a/tools/sdk/include/esp32/xtensa/traxreg.h +++ /dev/null @@ -1,199 +0,0 @@ -/* TRAX register definitions - - Copyright (c) 2006-2012 Tensilica Inc. - - 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. */ - -#ifndef _TRAX_REGISTERS_H_ -#define _TRAX_REGISTERS_H_ - -#define SHOW 1 -#define HIDE 0 - -#define RO 0 -#define RW 1 - -/* TRAX Register Numbers (from possible range of 0..127) */ -#if 0 -#define TRAXREG_ID 0 -#define TRAXREG_CONTROL 1 -#define TRAXREG_STATUS 2 -#define TRAXREG_DATA 3 -#define TRAXREG_ADDRESS 4 -#define TRAXREG_TRIGGER 5 -#define TRAXREG_MATCH 6 -#define TRAXREG_DELAY 7 -#define TRAXREG_STARTADDR 8 -#define TRAXREG_ENDADDR 9 -/* Internal use only (unpublished): */ -#define TRAXREG_P4CHANGE 16 -#define TRAXREG_P4REV 17 -#define TRAXREG_P4DATE 18 -#define TRAXREG_P4TIME 19 -#define TRAXREG_PDSTATUS 20 -#define TRAXREG_PDDATA 21 -#define TRAXREG_STOP_PC 22 -#define TRAXREG_STOP_ICNT 23 -#define TRAXREG_MSG_STATUS 24 -#define TRAXREG_FSM_STATUS 25 -#define TRAXREG_IB_STATUS 26 -#define TRAXREG_MAX 27 -#define TRAXREG_ITCTRL 96 -#endif -/* The registers above match the NAR addresses. So, their values are used for NAR access */ - -/* TRAX Register Fields */ - -/* TRAX ID register fields: */ -#define TRAX_ID_PRODNO 0xf0000000 /* product number (0=TRAX) */ -#define TRAX_ID_PRODOPT 0x0f000000 /* product options */ -#define TRAX_ID_MIW64 0x08000000 /* opt: instruction width */ -#define TRAX_ID_AMTRAX 0x04000000 /* opt: collection of options, - internal (VER_2_0 or later)*/ -#define TRAX_ID_MAJVER(id) (((id) >> 20) & 0x0f) -#define TRAX_ID_MINVER(id) (((id) >> 17) & 0x07) -#define TRAX_ID_VER(id) ((TRAX_ID_MAJVER(id)<<4)|TRAX_ID_MINVER(id)) -#define TRAX_ID_STDCFG 0x00010000 /* standard config */ -#define TRAX_ID_CFGID 0x0000ffff /* TRAX configuration ID */ -#define TRAX_ID_MEMSHARED 0x00001000 /* Memshared option in TRAX */ -#define TRAX_ID_FROM_VER(ver) ((((ver) & 0xf0) << 16) | (((ver) & 0x7) << 17)) -/* Other TRAX ID register macros: */ -/* TRAX versions of interest (TRAX_ID_VER(), ie. MAJVER*16 + MINVER): */ -#define TRAX_VER_1_0 0x10 /* RA */ -#define TRAX_VER_1_1 0x11 /* RB thru RC-2010.1 */ -#define TRAX_VER_2_0 0x20 /* RC-2010.2, RD-2010.0, - RD-2011.1 */ -#define TRAX_VER_2_1 0x21 /* RC-2011.3 / RD-2011.2 and - later */ -#define TRAX_VER_3_0 0x30 /* RE-2012.0 */ -#define TRAX_VER_3_1 0x31 /* RE-2012.1 */ -#define TRAX_VER_HUAWEI_3 TRAX_VER_3_0 /* For Huawei, PRs: 25223, 25224 - , 24880 */ - - -/* TRAX version 1.0 requires a couple software workarounds: */ -#define TRAX_ID_1_0_ERRATUM(id) (TRAX_ID_VER(id) == TRAX_VER_1_0) -/* TRAX version 2.0 requires software workaround for PR 22161: */ -#define TRAX_ID_MEMSZ_ERRATUM(id) (TRAX_ID_VER(id) == TRAX_VER_2_0) - -/* TRAX Control register fields: */ -#define TRAX_CONTROL_TREN 0x00000001 -#define TRAX_CONTROL_TRSTP 0x00000002 -#define TRAX_CONTROL_PCMEN 0x00000004 -#define TRAX_CONTROL_PTIEN 0x00000010 -#define TRAX_CONTROL_CTIEN 0x00000020 -#define TRAX_CONTROL_TMEN 0x00000080 /* 2.0+ */ -#define TRAX_CONTROL_CNTU 0x00000200 -#define TRAX_CONTROL_BIEN 0x00000400 -#define TRAX_CONTROL_BOEN 0x00000800 -#define TRAX_CONTROL_TSEN 0x00000800 -#define TRAX_CONTROL_SMPER 0x00007000 -#define TRAX_CONTROL_SMPER_SHIFT 12 -#define TRAX_CONTROL_PTOWT 0x00010000 -#define TRAX_CONTROL_CTOWT 0x00020000 -#define TRAX_CONTROL_PTOWS 0x00100000 -#define TRAX_CONTROL_CTOWS 0x00200000 -#define TRAX_CONTROL_ATID 0x7F000000 /* 2.0+, amtrax */ -#define TRAX_CONTROL_ATID_SHIFT 24 -#define TRAX_CONTROL_ATEN 0x80000000 /* 2.0+, amtrax */ - -#define TRAX_CONTROL_PTOWS_ER 0x00020000 /* For 3.0 */ -#define TRAX_CONTROL_CTOWT_ER 0x00100000 /* For 3.0 */ - -#define TRAX_CONTROL_ITCTO 0x00400000 /* For 3.0 */ -#define TRAX_CONTROL_ITCTIA 0x00800000 /* For 3.0 */ -#define TRAX_CONTROL_ITATV 0x01000000 /* For 3.0 */ - - -/* TRAX Status register fields: */ -#define TRAX_STATUS_TRACT 0x00000001 -#define TRAX_STATUS_TRIG 0x00000002 -#define TRAX_STATUS_PCMTG 0x00000004 -#define TRAX_STATUS_BUSY 0x00000008 /* ER ??? */ -#define TRAX_STATUS_PTITG 0x00000010 -#define TRAX_STATUS_CTITG 0x00000020 -#define TRAX_STATUS_MEMSZ 0x00001F00 -#define TRAX_STATUS_MEMSZ_SHIFT 8 -#define TRAX_STATUS_PTO 0x00010000 -#define TRAX_STATUS_CTO 0x00020000 - -#define TRAX_STATUS_ITCTOA 0x00400000 /* For 3.0 */ -#define TRAX_STATUS_ITCTI 0x00800000 /* For 3.0 */ -#define TRAX_STATUS_ITATR 0x01000000 /* For 3.0 */ - - -/* TRAX Address register fields: */ -#define TRAX_ADDRESS_TWSAT 0x80000000 -#define TRAX_ADDRESS_TWSAT_SHIFT 31 -#define TRAX_ADDRESS_TOTALMASK 0x00FFFFFF -// !!! VUakiVU. added for new TRAX: -#define TRAX_ADDRESS_WRAPCNT 0x7FE00000 /* version ???... */ -#define TRAX_ADDRESS_WRAP_SHIFT 21 - -/* TRAX PCMatch register fields: */ -#define TRAX_PCMATCH_PCML 0x0000001F -#define TRAX_PCMATCH_PCML_SHIFT 0 -#define TRAX_PCMATCH_PCMS 0x80000000 - -/* Compute trace ram buffer size (in bytes) from status register: */ -#define TRAX_MEM_SIZE(status) (1L << (((status) & TRAX_STATUS_MEMSZ) >> TRAX_STATUS_MEMSZ_SHIFT)) - -#if 0 -/* Describes a field within a register: */ -typedef struct { - const char* name; -// unsigned width; -// unsigned shift; - char width; - char shift; - char visible; /* 0 = internal use only, 1 = shown */ - char reserved; -} trax_regfield_t; -#endif - -/* Describes a TRAX register: */ -typedef struct { - const char* name; - unsigned id; - char width; - char visible; - char writable; - char reserved; - //const trax_regfield_t * fieldset; -} trax_regdef_t; - - -extern const trax_regdef_t trax_reglist[]; -extern const signed char trax_readable_regs[]; - -#ifdef __cplusplus -extern "C" { -#endif - -/* Prototypes: */ -extern int trax_find_reg(char * regname, char **errmsg); -extern const char * trax_regname(int regno); - -#ifdef __cplusplus -} -#endif - -#endif /* _TRAX_REGISTERS_H_ */ - diff --git a/tools/sdk/include/esp32/xtensa/xdm-regs.h b/tools/sdk/include/esp32/xtensa/xdm-regs.h deleted file mode 100644 index 50ee0293387..00000000000 --- a/tools/sdk/include/esp32/xtensa/xdm-regs.h +++ /dev/null @@ -1,530 +0,0 @@ -/* xdm-regs.h - Common register and related definitions for the XDM - (Xtensa Debug Module) */ - -/* Copyright (c) 2011-2012 Tensilica Inc. - - 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. */ - - -#ifndef _XDM_REGS_H_ -#define _XDM_REGS_H_ - -/* NOTE: This header file is included by C, assembler, and other sources. - So any C-specific or asm-specific content must be appropriately #ifdef'd. */ - - -/* - * XDM registers can be accessed using APB, ERI, or JTAG (via NAR). - * Address offsets for APB and ERI are the same, and for JTAG - * is different (due to the limited 7-bit NAR addressing). - * - * Here, we first provide the constants as APB / ERI address offsets. - * This is necessary for assembler code (which accesses XDM via ERI), - * because complex conversion macros between the two address maps - * don't work in the assembler. - * Conversion macros are used to convert these to/from JTAG (NAR), - * addresses, for software using JTAG. - */ -/* FIXME: maybe provide only MISC+CS registers here, and leave specific - subsystem registers in separate headers? eg. for TRAX, PERF, OCD */ - -/* XDM_.... ERI addr [NAR addr] Description...... */ - -/* TRAX */ -#define XDM_TRAX_ID 0x0000 /*[0x00] ID */ -#define XDM_TRAX_CONTROL 0x0004 /*[0x01] Control */ -#define XDM_TRAX_STATUS 0x0008 /*[0x02] Status */ -#define XDM_TRAX_DATA 0x000C /*[0x03] Data */ -#define XDM_TRAX_ADDRESS 0x0010 /*[0x04] Address */ -#define XDM_TRAX_TRIGGER 0x0014 /*[0x05] Stop PC */ -#define XDM_TRAX_MATCH 0x0018 /*[0x06] Stop PC Range */ -#define XDM_TRAX_DELAY 0x001C /*[0x07] Post Stop Trigger Capture Size */ -#define XDM_TRAX_STARTADDR 0x0020 /*[0x08] Trace Memory Start */ -#define XDM_TRAX_ENDADDR 0x0024 /*[0x09] Trace Memory End */ -#define XDM_TRAX_DEBUGPC 0x003C /*[0x0F] Debug PC */ -#define XDM_TRAX_P4CHANGE 0x0040 /*[0x10] X */ -#define XDM_TRAX_TIME0 0x0040 /*[0x10] First Time Register */ -#define XDM_TRAX_P4REV 0x0044 /*[0x11] X */ -#define XDM_TRAX_TIME1 0x0044 /*[0x11] Second Time Register */ -#define XDM_TRAX_P4DATE 0x0048 /*[0x12] X */ -#define XDM_TRAX_INTTIME_MAX 0x0048 /*[0x12] maximal Value of Timestamp IntTime */ -#define XDM_TRAX_P4TIME 0x004C /*[0x13] X */ -#define XDM_TRAX_PDSTATUS 0x0050 /*[0x14] Sample of PDebugStatus */ -#define XDM_TRAX_PDDATA 0x0054 /*[0x15] Sample of PDebugData */ -#define XDM_TRAX_STOP_PC 0x0058 /*[0x16] X */ -#define XDM_TRAX_STOP_ICNT 0x005C /*[0x16] X */ -#define XDM_TRAX_MSG_STATUS 0x0060 /*[0x17] X */ -#define XDM_TRAX_FSM_STATUS 0x0064 /*[0x18] X */ -#define XDM_TRAX_IB_STATUS 0x0068 /*[0x19] X */ -#define XDM_TRAX_STOPCNT 0x006C /*[0x1A] X */ - -/* Performance Monitoring Counters */ -#define XDM_PERF_PMG 0x1000 /*[0x20] perf. mon. global control register */ -#define XDM_PERF_INTPC 0x1010 /*[0x24] perf. mon. interrupt PC */ -#define XDM_PERF_PM0 0x1080 /*[0x28] perf. mon. counter 0 value */ -#define XDM_PERF_PM1 0x1084 /*[0x29] perf. mon. counter 1 value */ -#define XDM_PERF_PM2 0x1088 /*[0x2A] perf. mon. counter 2 value */ -#define XDM_PERF_PM3 0x108C /*[0x2B] perf. mon. counter 3 value */ -#define XDM_PERF_PM4 0x1090 /*[0x2C] perf. mon. counter 4 value */ -#define XDM_PERF_PM5 0x1094 /*[0x2D] perf. mon. counter 5 value */ -#define XDM_PERF_PM6 0x1098 /*[0x2E] perf. mon. counter 6 value */ -#define XDM_PERF_PM7 0x109C /*[0x2F] perf. mon. counter 7 value */ -#define XDM_PERF_PM(n) (0x1080+((n)<<2)) /* perfmon cnt n=0..7 value */ -#define XDM_PERF_PMCTRL0 0x1100 /*[0x30] perf. mon. counter 0 control */ -#define XDM_PERF_PMCTRL1 0x1104 /*[0x31] perf. mon. counter 1 control */ -#define XDM_PERF_PMCTRL2 0x1108 /*[0x32] perf. mon. counter 2 control */ -#define XDM_PERF_PMCTRL3 0x110C /*[0x33] perf. mon. counter 3 control */ -#define XDM_PERF_PMCTRL4 0x1110 /*[0x34] perf. mon. counter 4 control */ -#define XDM_PERF_PMCTRL5 0x1114 /*[0x35] perf. mon. counter 5 control */ -#define XDM_PERF_PMCTRL6 0x1118 /*[0x36] perf. mon. counter 6 control */ -#define XDM_PERF_PMCTRL7 0x111C /*[0x37] perf. mon. counter 7 control */ -#define XDM_PERF_PMCTRL(n) (0x1100+((n)<<2)) /* perfmon cnt n=0..7 control */ -#define XDM_PERF_PMSTAT0 0x1180 /*[0x38] perf. mon. counter 0 status */ -#define XDM_PERF_PMSTAT1 0x1184 /*[0x39] perf. mon. counter 1 status */ -#define XDM_PERF_PMSTAT2 0x1188 /*[0x3A] perf. mon. counter 2 status */ -#define XDM_PERF_PMSTAT3 0x118C /*[0x3B] perf. mon. counter 3 status */ -#define XDM_PERF_PMSTAT4 0x1190 /*[0x3C] perf. mon. counter 4 status */ -#define XDM_PERF_PMSTAT5 0x1194 /*[0x3D] perf. mon. counter 5 status */ -#define XDM_PERF_PMSTAT6 0x1198 /*[0x3E] perf. mon. counter 6 status */ -#define XDM_PERF_PMSTAT7 0x119C /*[0x3F] perf. mon. counter 7 status */ -#define XDM_PERF_PMSTAT(n) (0x1180+((n)<<2)) /* perfmon cnt n=0..7 status */ - -/* On-Chip-Debug (OCD) */ -#define XDM_OCD_ID 0x2000 /*[0x40] ID register */ -#define XDM_OCD_DCR_CLR 0x2008 /*[0x42] Debug Control reg clear */ -#define XDM_OCD_DCR_SET 0x200C /*[0x43] Debug Control reg set */ -#define XDM_OCD_DSR 0x2010 /*[0x44] Debug Status reg */ -#define XDM_OCD_DDR 0x2014 /*[0x45] Debug Data reg */ -#define XDM_OCD_DDREXEC 0x2018 /*[0x46] Debug Data reg + execute-DIR */ -#define XDM_OCD_DIR0EXEC 0x201C /*[0x47] Debug Instruction reg, word 0 + execute-DIR */ -#define XDM_OCD_DIR0 0x2020 /*[0x48] Debug Instruction reg, word 1 */ -#define XDM_OCD_DIR1 0x2024 /*[0x49] Debug Instruction reg, word 2 */ -#define XDM_OCD_DIR2 0x2028 /*[0x4A] Debug Instruction reg, word 3 */ -#define XDM_OCD_DIR3 0x202C /*[0x49] Debug Instruction reg, word 4 */ -#define XDM_OCD_DIR4 0x2030 /*[0x4C] Debug Instruction reg, word 5 */ -#define XDM_OCD_DIR5 0x2034 /*[0x4D] Debug Instruction reg, word 5 */ -#define XDM_OCD_DIR6 0x2038 /*[0x4E] Debug Instruction reg, word 6 */ -#define XDM_OCD_DIR7 0x203C /*[0x4F] Debug Instruction reg, word 7 */ - -/* Miscellaneous Registers */ -#define XDM_MISC_PWRCTL 0x3020 /*[0x58] Power and Reset Control */ -#define XDM_MISC_PWRSTAT 0x3024 /*[0x59] Power and Reset Status */ -#define XDM_MISC_ERISTAT 0x3028 /*[0x5A] ERI Transaction Status */ -#define XDM_MISC_DATETIME 0x3034 /*[0x5D] [INTERNAL] Timestamps of build */ -#define XDM_MISC_UBID 0x3038 /*[0x5E] [INTERNAL] Build Unique ID */ -#define XDM_MISC_CID 0x303C /*[0x5F] [INTERNAL] Customer ID */ - -/* CoreSight compatibility */ -#define XDM_CS_ITCTRL 0x3F00 /*[0x60] InTegration Mode control reg */ -#define XDM_CS_CLAIMSET 0x3FA0 /*[0x68] Claim Tag Set reg */ -#define XDM_CS_CLAIMCLR 0x3FA4 /*[0x69] Claim Tag Clear reg */ -#define XDM_CS_LOCK_ACCESS 0x3FB0 /*[0x6B] Lock Access (writing 0xC5ACCE55 unlocks) */ -#define XDM_CS_LOCK_STATUS 0x3FB4 /*[0x6D] Lock Status */ -#define XDM_CS_AUTH_STATUS 0x3FB8 /*[0x6E] Authentication Status */ -#define XDM_CS_DEV_ID 0x3FC8 /*[0x72] Device ID */ -#define XDM_CS_DEV_TYPE 0x3FCC /*[0x73] Device Type */ -#define XDM_CS_PER_ID4 0x3FD0 /*[0x74] Peripheral ID reg byte 4 */ -#define XDM_CS_PER_ID5 0x3FD4 /*[0x75] Peripheral ID reg byte 5 */ -#define XDM_CS_PER_ID6 0x3FD8 /*[0x76] Peripheral ID reg byte 6 */ -#define XDM_CS_PER_ID7 0x3FDC /*[0x77] Peripheral ID reg byte 7 */ -#define XDM_CS_PER_ID0 0x3FE0 /*[0x78] Peripheral ID reg byte 0 */ -#define XDM_CS_PER_ID1 0x3FE4 /*[0x79] Peripheral ID reg byte 1 */ -#define XDM_CS_PER_ID2 0x3FE8 /*[0x7A] Peripheral ID reg byte 2 */ -#define XDM_CS_PER_ID3 0x3FEC /*[0x7B] Peripheral ID reg byte 3 */ -#define XDM_CS_COMP_ID0 0x3FF0 /*[0x7C] Component ID reg byte 0 */ -#define XDM_CS_COMP_ID1 0x3FF4 /*[0x7D] Component ID reg byte 1 */ -#define XDM_CS_COMP_ID2 0x3FF8 /*[0x7E] Component ID reg byte 2 */ -#define XDM_CS_COMP_ID3 0x3FFC /*[0x7F] Component ID reg byte 3 */ - -#define CS_PER_ID0 0x00000003 -#define CS_PER_ID1 0x00000021 -#define CS_PER_ID2 0x0000000f -#define CS_PER_ID3 0x00000000 -#define CS_PER_ID4 0x00000024 - -#define CS_COMP_ID0 0x0000000d -#define CS_COMP_ID1 0x00000090 -#define CS_COMP_ID2 0x00000005 -#define CS_COMP_ID3 0x000000b1 - -#define CS_DEV_TYPE 0x00000015 - -#define XTENSA_IDCODE 0x120034e5 // FIXME (upper bits not spec. out but BE is !) -#define XTENSA_MFC_ID (XTENSA_IDCODE & 0xFFF) -#define CS_DEV_ID XTENSA_IDCODE - -#define NXS_OCD_REG(val) ((val >= 0x40) && (val <= 0x5F)) -#define NXS_TRAX_REG(val) val <= 0x3F - -#define ERI_TRAX_REG(val) ((val & 0xFFFF) < 0x1000) -#define ERI_OCD_REG(val) ((val & 0xFFFF) >= 0x2000) && ((val & 0xFFFF) < 0x4000)) - -/* Convert above 14-bit ERI/APB address/offset to 7-bit NAR address: */ -#define _XDM_ERI_TO_NAR(a) ( ((a)&0x3F80)==0x0000 ? (((a)>>2) & 0x1F) \ - : ((a)&0x3E00)==0x1000 ? (0x20 | (((a)>>2) & 7) | (((a)>>4) & 0x18)) \ - : ((a)&0x3FC0)==0x2000 ? (0x40 | (((a)>>2) & 0xF)) \ - : ((a)&0x3FE0)==0x3020 ? (0x50 | (((a)>>2) & 0xF)) \ - : ((a)&0x3FFC)==0x3F00 ? 0x60 \ - : ((a)&0x3F80)==0x3F80 ? (0x60 | (((a)>>2) & 0x1F)) \ - : -1 ) - -#define XDM_ERI_TO_NAR(a) _XDM_ERI_TO_NAR(a & 0xFFFF) - -/* Convert 7-bit NAR address back to ERI/APB address/offset: */ -#define _XDM_NAR_TO_APB(a) ((a) <= 0x1f ? ((a) << 2) \ - :(a) >= 0x20 && (a) <= 0x3F ? (0x1000 | (((a)& 7) << 2) | (((a)&0x18)<<4)) \ - :(a) >= 0x40 && (a) <= 0x4F ? (0x2000 | (((a)&0xF) << 2)) \ - :(a) >= 0x58 && (a) <= 0x5F ? (0x3000 | (((a)&0xF) << 2)) \ - :(a) == 0x60 ? (0x3F00) \ - :(a) >= 0x68 && (a) <= 0x7F ? (0x3F80 | (((a)&0x1F) << 2)) \ - : -1) - -#define XDM_NAR_TO_APB(a) _XDM_NAR_TO_APB((a & 0xFFFF)) -#define XDM_NAR_TO_ERI(a) _XDM_NAR_TO_APB((a & 0xFFFF)) | 0x000000 - -/* Convert APB to ERI address */ -#define XDM_APB_TO_ERI(a) ((a) | (0x100000)) -#define XDM_ERI_TO_APB(a) ((a) & (0x0FFFFF)) - -/*********** Bit definitions within some of the above registers ***********/ -#define OCD_ID_LSDDRP 0x01000000 -#define OCD_ID_LSDDRP_SHIFT 24 -#define OCD_ID_ENDIANESS 0x00000001 -#define OCD_ID_ENDIANESS_SHIFT 0 -#define OCD_ID_PSO 0x0000000C -#define OCD_ID_PSO_SHIFT 2 -#define OCD_ID_TRACEPORT 0x00000080 -#define OCD_ID_TRACEPORT_SHIFT 7 - -/* Power Status register. NOTE: different bit positions in JTAG vs. ERI/APB !! */ -/* ERI/APB: */ -#define PWRSTAT_CORE_DOMAIN_ON 0x00000001 /* set if core is powered on */ -#define PWRSTAT_CORE_DOMAIN_ON_SHIFT 0 -#define PWRSTAT_WAKEUP_RESET 0x00000002 /* [ERI only] 0=cold start, 1=PSO wakeup */ -#define PWRSTAT_WAKEUP_RESET_SHIFT 1 -#define PWRSTAT_CACHES_LOST_POWER 0x00000004 /* [ERI only] set if caches (/localmems?) lost power */ - /* FIXME: does this include local memories? */ -#define PWRSTAT_CACHES_LOST_POWER_SHIFT 2 -#define PWRSTAT_CORE_STILL_NEEDED 0x00000010 /* set if others keeping core awake */ -#define PWRSTAT_CORE_STILL_NEEDED_SHIFT 4 -#define PWRSTAT_MEM_DOMAIN_ON 0x00000100 /* set if memory domain is powered on */ -#define PWRSTAT_MEM_DOMAIN_ON_SHIFT 8 -#define PWRSTAT_DEBUG_DOMAIN_ON 0x00001000 /* set if debug domain is powered on */ -#define PWRSTAT_DEBUG_DOMAIN_ON_SHIFT 12 -#define PWRSTAT_ALL_ON PWRSTAT_CORE_DOMAIN_ON | PWRSTAT_MEM_DOMAIN_ON | PWRSTAT_DEBUG_DOMAIN_ON -#define PWRSTAT_CORE_WAS_RESET 0x00010000 /* [APB only] set if core got reset */ -#define PWRSTAT_CORE_WAS_RESET_SHIFT 16 -#define PWRSTAT_DEBUG_WAS_RESET 0x10000000 /* set if debug module got reset */ -#define PWRSTAT_DEBUG_WAS_RESET_SHIFT 28 -/* JTAG: */ -#define J_PWRSTAT_CORE_DOMAIN_ON 0x01 /* set if core is powered on */ -#define J_PWRSTAT_MEM_DOMAIN_ON 0x02 /* set if memory domain is powered on */ -#define J_PWRSTAT_DEBUG_DOMAIN_ON 0x04 /* set if debug domain is powered on */ -#define J_PWRSTAT_ALL_ON J_PWRSTAT_CORE_DOMAIN_ON | J_PWRSTAT_MEM_DOMAIN_ON | J_PWRSTAT_DEBUG_DOMAIN_ON -#define J_PWRSTAT_CORE_STILL_NEEDED 0x08 /* set if others keeping core awake */ -#define J_PWRSTAT_CORE_WAS_RESET 0x10 /* set if core got reset */ -#define J_PWRSTAT_DEBUG_WAS_RESET 0x40 /* set if debug module got reset */ - -/* Power Control register. NOTE: different bit positions in JTAG vs. ERI/APB !! */ -/* ERI/APB: */ -#define PWRCTL_CORE_SHUTOFF 0x00000001 /* [ERI only] core wants to shut off on WAITI */ -#define PWRCTL_CORE_SHUTOFF_SHIFT 0 -#define PWRCTL_CORE_WAKEUP 0x00000001 /* [APB only] set to force core to stay powered on */ -#define PWRCTL_CORE_WAKEUP_SHIFT 0 -#define PWRCTL_MEM_WAKEUP 0x00000100 /* set to force memory domain to stay powered on */ -#define PWRCTL_MEM_WAKEUP_SHIFT 8 -#define PWRCTL_DEBUG_WAKEUP 0x00001000 /* set to force debug domain to stay powered on */ -#define PWRCTL_DEBUG_WAKEUP_SHIFT 12 -#define PWRCTL_ALL_ON PWRCTL_CORE_WAKEUP | PWRCTL_MEM_WAKEUP | PWRCTL_DEBUG_WAKEUP -#define PWRCTL_CORE_RESET 0x00010000 /* [APB only] set to assert core reset */ -#define PWRCTL_CORE_RESET_SHIFT 16 -#define PWRCTL_DEBUG_RESET 0x10000000 /* set to assert debug module reset */ -#define PWRCTL_DEBUG_RESET_SHIFT 28 -/* JTAG: */ -#define J_PWRCTL_CORE_WAKEUP 0x01 /* set to force core to stay powered on */ -#define J_PWRCTL_MEM_WAKEUP 0x02 /* set to force memory domain to stay powered on */ -#define J_PWRCTL_DEBUG_WAKEUP 0x04 /* set to force debug domain to stay powered on */ -#define J_DEBUG_USE 0x80 /* */ -#define J_PWRCTL_ALL_ON J_DEBUG_USE | J_PWRCTL_CORE_WAKEUP | J_PWRCTL_MEM_WAKEUP | J_PWRCTL_DEBUG_WAKEUP -#define J_PWRCTL_DEBUG_ON J_DEBUG_USE | J_PWRCTL_DEBUG_WAKEUP -#define J_PWRCTL_CORE_RESET 0x10 /* set to assert core reset */ -#define J_PWRCTL_DEBUG_RESET 0x40 /* set to assert debug module reset */ - -#define J_PWRCTL_WRITE_MASK 0xFF -#define J_PWRSTAT_WRITE_MASK 0xFF - -#define PWRCTL_WRITE_MASK ~0 -#define PWRSTAT_WRITE_MASK ~0 - -/************ The following are only relevant for JTAG, so perhaps belong in OCD only **************/ - -/* XDM 5-bit JTAG Instruction Register (IR) values: */ -#define XDM_IR_PWRCTL 0x08 /* select 8-bit Power/Reset Control (PRC) */ -#define XDM_IR_PWRSTAT 0x09 /* select 8-bit Power/Reset Status (PRS) */ -#define XDM_IR_NAR_SEL 0x1c /* select altern. 8-bit NAR / 32-bit NDR (Nexus-style) */ -#define XDM_IR_NDR_SEL 0x1d /* select altern. 32-bit NDR / 8-bit NAR - (FIXME - functionality not yet in HW) */ -#define XDM_IR_IDCODE 0x1e /* select 32-bit JTAG IDCODE */ -#define XDM_IR_BYPASS 0x1f /* select 1-bit bypass */ - -#define XDM_IR_WIDTH 5 /* width of IR for Xtensa TAP */ - -/* NAR register bits: */ -#define XDM_NAR_WRITE 0x01 -#define XDM_NAR_ADDR_MASK 0xFE -#define XDM_NAR_ADDR_SHIFT 1 - -#define XDM_NAR_BUSY 0x02 -#define XDM_NAR_ERROR 0x01 - -#define NEXUS_DIR_READ 0x00 -#define NEXUS_DIR_WRITE 0x01 - -/************ Define DCR register bits **************/ - -#define DCR_ENABLEOCD 0x0000001 -#define DCR_ENABLEOCD_SHIFT 0 -#define DCR_DEBUG_INT 0x0000002 -#define DCR_DEBUG_INT_SHIFT 1 -#define DCR_DEBUG_OVERRIDE 0x0000004 -#define DCR_DEBUG_OVERRIDE_SHIFT 2 -#define DCR_DEBUG_INTERCEPT 0x0000008 -#define DCR_DEBUG_INTERCEPT_SHIFT 3 -#define DCR_MASK_NMI 0x0000020 -#define DCR_MASK_NMI_SHIFT 5 -#define DCR_STEP_ENABLE 0x0000040 -#define DCR_STEP_ENABLE_SHIFT 6 -#define DCR_BREAK_IN_EN 0x0010000 -#define DCR_BREAK_IN_EN_SHIFT 16 -#define DCR_BREAK_OUT_EN 0x0020000 -#define DCR_BREAK_OUT_EN_SHIFT 17 -#define DCR_DEBUG_INT_EN 0x0040000 -#define DCR_DEBUG_INT_EN_SHIFT 18 -#define DCR_DBG_SW_ACTIVE 0x0100000 -#define DCR_DBG_SW_ACTIVE_SHIFT 20 -#define DCR_STALL_IN_EN 0x0200000 -#define DCR_STALL_IN_EN_SHIFT 21 -#define DCR_DEBUG_OUT_EN 0x0400000 -#define DCR_DEBUG_OUT_EN_SHIFT 22 -#define DCR_BREAK_OUT_ITO 0x1000000 -#define DCR_STALL_OUT_ITO 0x2000000 -#define DCR_STALL_OUT_ITO_SHIFT 25 - -/************ Define DSR register bits **************/ - -#define DOSR_EXECDONE_ER 0x01 -#define DOSR_EXECDONE_SHIFT 0 -#define DOSR_EXCEPTION_ER 0x02 -#define DOSR_EXCEPTION_SHIFT 1 -#define DOSR_BUSY 0x04 -#define DOSR_BUSY_SHIFT 2 -#define DOSR_OVERRUN 0x08 -#define DOSR_OVERRUN_SHIFT 3 -#define DOSR_INOCDMODE_ER 0x10 -#define DOSR_INOCDMODE_SHIFT 4 -#define DOSR_CORE_WROTE_DDR_ER 0x400 -#define DOSR_CORE_WROTE_DDR_SHIFT 10 -#define DOSR_CORE_READ_DDR_ER 0x800 -#define DOSR_CORE_READ_DDR_SHIFT 11 -#define DOSR_HOST_WROTE_DDR_ER 0x4000 -#define DOSR_HOST_WROTE_DDR_SHIFT 14 -#define DOSR_HOST_READ_DDR_ER 0x8000 -#define DOSR_HOST_READ_DDR_SHIFT 15 - -#define DOSR_DEBUG_PEND_BIN 0x10000 -#define DOSR_DEBUG_PEND_HOST 0x20000 -#define DOSR_DEBUG_PEND_TRAX 0x40000 -#define DOSR_DEBUG_BIN 0x100000 -#define DOSR_DEBUG_HOST 0x200000 -#define DOSR_DEBUG_TRAX 0x400000 -#define DOSR_DEBUG_PEND_BIN_SHIFT 16 -#define DOSR_DEBUG_PEND_HOST_SHIFT 17 -#define DOSR_DEBUG_PEND_TRAX_SHIFT 18 -#define DOSR_DEBUG_BREAKIN 0x0100000 -#define DOSR_DEBUG_BREAKIN_SHIFT 20 -#define DOSR_DEBUG_HOST_SHIFT 21 -#define DOSR_DEBUG_TRAX_SHIFT 22 - -#define DOSR_DEBUG_STALL 0x1000000 -#define DOSR_DEBUG_STALL_SHIFT 24 - -#define DOSR_CORE_ON 0x40000000 -#define DOSR_CORE_ON_SHIFT 30 -#define DOSR_DEBUG_ON 0x80000000 -#define DOSR_DEBUG_ON_SHIFT 31 - -/********** Performance monitor registers bits **********/ - -#define PERF_PMG_ENABLE 0x00000001 /* global enable bit */ -#define PERF_PMG_ENABLE_SHIFT 0 - -#define PERF_PMCTRL_INT_ENABLE 0x00000001 /* assert interrupt on overflow */ -#define PERF_PMCTRL_INT_ENABLE_SHIFT 0 -#define PERF_PMCTRL_KRNLCNT 0x00000008 /* ignore TRACELEVEL */ -#define PERF_PMCTRL_KRNLCNT_SHIFT 3 -#define PERF_PMCTRL_TRACELEVEL 0x000000F0 /* count when CINTLEVEL <= TRACELEVEL */ -#define PERF_PMCTRL_TRACELEVEL_SHIFT 4 -#define PERF_PMCTRL_SELECT 0x00001F00 /* events group selector */ -#define PERF_PMCTRL_SELECT_SHIFT 8 -#define PERF_PMCTRL_MASK 0xFFFF0000 /* events mask */ -#define PERF_PMCTRL_MASK_SHIFT 16 - -#define PERF_PMSTAT_OVERFLOW 0x00000001 /* counter overflowed */ -#define PERF_PMSTAT_OVERFLOW_SHIFT 0 -#define PERF_PMSTAT_INT 0x00000010 /* interrupt asserted */ -#define PERF_PMSTAT_INT_SHIFT 4 - -#if defined (USE_XDM_REGNAME) || defined (USE_DAP_REGNAME) -/* Describes XDM register: */ -typedef struct { - int reg; - char* name; -} regdef_t; - -/*char* regname(regdef_t* list, int regno) -{ - unsigned i; - for(i = 0 ; i < (sizeof(list) / sizeof(regdef_t)); i++){ - if(list[i].reg == regno) - return list[i].name; - } - return "???"; -}*/ - -/* - * Returns the name of the specified XDM register number, - * or simply "???" if the register number is not recognized. - * FIXME - requires -1 as the last entry - change to compare the name to ??? - * or even better, make the code above to work. - */ -static char * regname(regdef_t* list, int reg) -{ - int i = 0; - while (list[i].reg != -1){ - if (list[i].reg == reg) - break; - i++; - } - return list[i].name; -} - -#if defined (USE_XDM_REGNAME) -regdef_t xdm_reglist[] = -{ - {XDM_TRAX_ID ,"TRAX_ID" }, - {XDM_TRAX_CONTROL ,"CONTROL" }, - {XDM_TRAX_STATUS ,"STATUS" }, - {XDM_TRAX_DATA ,"DATA" }, - {XDM_TRAX_ADDRESS ,"ADDRESS" }, - {XDM_TRAX_TRIGGER ,"TRIGGER PC" }, - {XDM_TRAX_MATCH ,"PC MATCH" }, - {XDM_TRAX_DELAY ,"DELAY CNT." }, - {XDM_TRAX_STARTADDR ,"START ADDRESS"}, - {XDM_TRAX_ENDADDR ,"END ADDRESS" }, - {XDM_TRAX_DEBUGPC ,"DEBUG PC" }, - {XDM_TRAX_P4CHANGE ,"P4 CHANGE" }, - {XDM_TRAX_P4REV ,"P4 REV." }, - {XDM_TRAX_P4DATE ,"P4 DATE" }, - {XDM_TRAX_P4TIME ,"P4 TIME" }, - {XDM_TRAX_PDSTATUS ,"PD STATUS" }, - {XDM_TRAX_PDDATA ,"PD DATA" }, - {XDM_TRAX_STOP_PC ,"STOP PC" }, - {XDM_TRAX_STOP_ICNT ,"STOP ICNT" }, - {XDM_TRAX_MSG_STATUS ,"MSG STAT." }, - {XDM_TRAX_FSM_STATUS ,"FSM STAT." }, - {XDM_TRAX_IB_STATUS ,"IB STAT." }, - - {XDM_OCD_ID ,"OCD_ID" }, - {XDM_OCD_DCR_CLR ,"DCR_CLR" }, - {XDM_OCD_DCR_SET ,"DCR_SET" }, - {XDM_OCD_DSR ,"DOSR" }, - {XDM_OCD_DDR ,"DDR" }, - {XDM_OCD_DDREXEC ,"DDREXEC" }, - {XDM_OCD_DIR0EXEC ,"DIR0EXEC"}, - {XDM_OCD_DIR0 ,"DIR0" }, - {XDM_OCD_DIR1 ,"DIR1" }, - {XDM_OCD_DIR2 ,"DIR2" }, - {XDM_OCD_DIR3 ,"DIR3" }, - {XDM_OCD_DIR4 ,"DIR4" }, - {XDM_OCD_DIR5 ,"DIR5" }, - {XDM_OCD_DIR6 ,"DIR6" }, - {XDM_OCD_DIR7 ,"DIR7" }, - - {XDM_PERF_PMG ,"PMG" }, - {XDM_PERF_INTPC ,"INTPC" }, - {XDM_PERF_PM0 ,"PM0 " }, - {XDM_PERF_PM1 ,"PM1 " }, - {XDM_PERF_PM2 ,"PM2 " }, - {XDM_PERF_PM3 ,"PM3 " }, - {XDM_PERF_PM4 ,"PM4 " }, - {XDM_PERF_PM5 ,"PM5 " }, - {XDM_PERF_PM6 ,"PM6 " }, - {XDM_PERF_PM7 ,"PM7 " }, - {XDM_PERF_PMCTRL0 ,"PMCTRL0"}, - {XDM_PERF_PMCTRL1 ,"PMCTRL1"}, - {XDM_PERF_PMCTRL2 ,"PMCTRL2"}, - {XDM_PERF_PMCTRL3 ,"PMCTRL3"}, - {XDM_PERF_PMCTRL4 ,"PMCTRL4"}, - {XDM_PERF_PMCTRL5 ,"PMCTRL5"}, - {XDM_PERF_PMCTRL6 ,"PMCTRL6"}, - {XDM_PERF_PMCTRL7 ,"PMCTRL7"}, - {XDM_PERF_PMSTAT0 ,"PMSTAT0"}, - {XDM_PERF_PMSTAT1 ,"PMSTAT1"}, - {XDM_PERF_PMSTAT2 ,"PMSTAT2"}, - {XDM_PERF_PMSTAT3 ,"PMSTAT3"}, - {XDM_PERF_PMSTAT4 ,"PMSTAT4"}, - {XDM_PERF_PMSTAT5 ,"PMSTAT5"}, - {XDM_PERF_PMSTAT6 ,"PMSTAT6"}, - {XDM_PERF_PMSTAT7 ,"PMSTAT7"}, - - {XDM_MISC_PWRCTL ,"PWRCTL" }, - {XDM_MISC_PWRSTAT ,"PWRSTAT" }, - {XDM_MISC_ERISTAT ,"ERISTAT" }, - {XDM_MISC_DATETIME ,"DATETIME"}, - {XDM_MISC_UBID ,"UBID" }, - {XDM_MISC_CID ,"CID" }, - - {XDM_CS_ITCTRL ,"ITCTRL" }, - {XDM_CS_CLAIMSET ,"CLAIMSET" }, - {XDM_CS_CLAIMCLR ,"CLAIMCLR" }, - {XDM_CS_LOCK_ACCESS ,"LOCK_ACCESS"}, - {XDM_CS_LOCK_STATUS ,"LOCK_STATUS"}, - {XDM_CS_AUTH_STATUS ,"AUTH_STATUS"}, - {XDM_CS_DEV_ID ,"DEV_ID" }, - {XDM_CS_DEV_TYPE ,"DEV_TYPE" }, - {XDM_CS_PER_ID4 ,"PER_ID4" }, - {XDM_CS_PER_ID5 ,"PER_ID5" }, - {XDM_CS_PER_ID6 ,"PER_ID6" }, - {XDM_CS_PER_ID7 ,"PER_ID7" }, - {XDM_CS_PER_ID0 ,"PER_ID0" }, - {XDM_CS_PER_ID1 ,"PER_ID1" }, - {XDM_CS_PER_ID2 ,"PER_ID2" }, - {XDM_CS_PER_ID3 ,"PER_ID3" }, - {XDM_CS_COMP_ID0 ,"COMP_ID0" }, - {XDM_CS_COMP_ID1 ,"COMP_ID1" }, - {XDM_CS_COMP_ID2 ,"COMP_ID2" }, - {XDM_CS_COMP_ID3 ,"COMP_ID3" }, - {-1 ,"???" }, -}; -#endif - -#endif - -#endif /* _XDM_REGS_H_ */ diff --git a/tools/sdk/include/esp32/xtensa/xt_perf_consts.h b/tools/sdk/include/esp32/xtensa/xt_perf_consts.h deleted file mode 100644 index f063a31f775..00000000000 --- a/tools/sdk/include/esp32/xtensa/xt_perf_consts.h +++ /dev/null @@ -1,283 +0,0 @@ -/* - * Customer ID=11656; Build=0x5f626; Copyright (c) 2012 by Tensilica Inc. ALL RIGHTS RESERVED. - * - * 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. - */ - -#ifndef __XT_PERF_CONSTS_H__ -#define __XT_PERF_CONSTS_H__ - -/* - * Performance monitor counter selectors - */ - -#define XTPERF_CNT_COMMITTED_INSN 0x8002 /* Instructions committed */ -#define XTPERF_CNT_BRANCH_PENALTY 0x8003 /* Branch penalty cycles */ -#define XTPERF_CNT_PIPELINE_INTERLOCKS 0x8004 /* Pipeline interlocks cycles */ -#define XTPERF_CNT_ICACHE_MISSES 0x8005 /* ICache misses penalty in cycles */ -#define XTPERF_CNT_DCACHE_MISSES 0x8006 /* DCache misses penalty in cycles */ - -#define XTPERF_CNT_CYCLES 0 /* Count cycles */ -#define XTPERF_CNT_OVERFLOW 1 /* Overflow of counter n-1 (assuming this is counter n) */ -#define XTPERF_CNT_INSN 2 /* Successfully completed instructions */ -#define XTPERF_CNT_D_STALL 3 /* Data-related GlobalStall cycles */ -#define XTPERF_CNT_I_STALL 4 /* Instruction-related and other GlobalStall cycles */ -#define XTPERF_CNT_EXR 5 /* Exceptions and pipeline replays */ -#define XTPERF_CNT_BUBBLES 6 /* Hold and other bubble cycles */ -#define XTPERF_CNT_I_TLB 7 /* Instruction TLB Accesses (per instruction retiring) */ -#define XTPERF_CNT_I_MEM 8 /* Instruction memory accesses (per instruction retiring) */ -#define XTPERF_CNT_D_TLB 9 /* Data TLB accesses */ -#define XTPERF_CNT_D_LOAD_U1 10 /* Data memory load instruction (load-store unit 1) */ -#define XTPERF_CNT_D_STORE_U1 11 /* Data memory store instruction (load-store unit 1) */ -#define XTPERF_CNT_D_ACCESS_U1 12 /* Data memory accesses (load, store, S32C1I, etc; load-store unit 1) */ -#define XTPERF_CNT_D_LOAD_U2 13 /* Data memory load instruction (load-store unit 2) */ -#define XTPERF_CNT_D_STORE_U2 14 /* Data memory store instruction (load-store unit 2) */ -#define XTPERF_CNT_D_ACCESS_U2 15 /* Data memory accesses (load, store, S32C1I, etc; load-store unit 2) */ -#define XTPERF_CNT_D_LOAD_U3 16 /* Data memory load instruction (load-store unit 3) */ -#define XTPERF_CNT_D_STORE_U3 17 /* Data memory store instruction (load-store unit 3) */ -#define XTPERF_CNT_D_ACCESS_U3 18 /* Data memory accesses (load, store, S32C1I, etc; load-store unit 3) */ -#define XTPERF_CNT_MULTIPLE_LS 22 /* Multiple Load/Store */ -#define XTPERF_CNT_OUTBOUND_PIF 23 /* Outbound PIF transactions */ -#define XTPERF_CNT_INBOUND_PIF 24 /* Inbound PIF transactions */ -#define XTPERF_CNT_PREFETCH 26 /* Prefetch events */ - - -/* - * Masks for each of the selector listed above - */ - -/* XTPERF_CNT_COMMITTED_INSN selector mask */ - -#define XTPERF_MASK_COMMITTED_INSN 0x0001 - -/* XTPERF_CNT_BRANCH_PENALTY selector mask */ - -#define XTPERF_MASK_BRANCH_PENALTY 0x0001 - -/* XTPERF_CNT_PIPELINE_INTERLOCKS selector mask */ - -#define XTPERF_MASK_PIPELINE_INTERLOCKS 0x0001 - -/* XTPERF_CNT_ICACHE_MISSES selector mask */ - -#define XTPERF_MASK_ICACHE_MISSES 0x0001 - -/* XTPERF_CNT_DCACHE_MISSES selector mask */ - -#define XTPERF_MASK_DCACHE_MISSES 0x0001 - -/* XTPERF_CNT_CYCLES selector mask */ - -#define XTPERF_MASK_CYCLES 0x0001 - -/* XTPERF_CNT_OVERFLOW selector mask */ - -#define XTPERF_MASK_OVERFLOW 0x0001 - -/* - * XTPERF_CNT_INSN selector mask - */ - -#define XTPERF_MASK_INSN_ALL 0x8DFF - -#define XTPERF_MASK_INSN_JX 0x0001 /* JX */ -#define XTPERF_MASK_INSN_CALLX 0x0002 /* CALLXn */ -#define XTPERF_MASK_INSN_RET 0x0004 /* call return i.e. RET, RETW */ -#define XTPERF_MASK_INSN_RF 0x0008 /* supervisor return i.e. RFDE, RFE, RFI, RFWO, RFWU */ -#define XTPERF_MASK_INSN_BRANCH_TAKEN 0x0010 /* Conditional branch taken, or loopgtz/loopnez skips loop */ -#define XTPERF_MASK_INSN_J 0x0020 /* J */ -#define XTPERF_MASK_INSN_CALL 0x0040 /* CALLn */ -#define XTPERF_MASK_INSN_BRANCH_NOT_TAKEN 0x0080 /* Conditional branch fall through (aka. not-taken branch) */ -#define XTPERF_MASK_INSN_LOOP_TAKEN 0x0100 /* Loop instr falls into loop (aka. taken loop) */ -#define XTPERF_MASK_INSN_LOOP_BEG 0x0400 /* Loopback taken to LBEG */ -#define XTPERF_MASK_INSN_LOOP_END 0x0800 /* Loopback falls through to LEND */ -#define XTPERF_MASK_INSN_NON_BRANCH 0x8000 /* Non-branch instruction (aka. non-CTI) */ - -/* - * XTPERF_CNT_D_STALL selector mask - */ - -#define XTPERF_MASK_D_STALL_ALL 0x01FE - -#define XTPERF_MASK_D_STALL_STORE_BUF_FULL 0x0002 /* Store buffer full stall */ -#define XTPERF_MASK_D_STALL_STORE_BUF_CONFLICT 0x0004 /* Store buffer conflict stall */ -#define XTPERF_MASK_D_STALL_CACHE_MISS 0x0008 /* DCache-miss stall */ -#define XTPERF_MASK_D_STALL_BUSY 0x0010 /* Data RAM/ROM/XLMI busy stall */ -#define XTPERF_MASK_D_STALL_IN_PIF 0x0020 /* Data inbound-PIF request stall (incl s32c1i) */ -#define XTPERF_MASK_D_STALL_MHT_LOOKUP 0x0040 /* MHT lookup stall */ -#define XTPERF_MASK_D_STALL_UNCACHED_LOAD 0x0080 /* Uncached load stall (included in MHT lookup stall) */ -#define XTPERF_MASK_D_STALL_BANK_CONFLICT 0x0100 /* Bank-conflict stall */ - -/* - * XTPERF_CNT_I_STALL selector mask - */ - -#define XTPERF_MASK_I_STALL_ALL 0x01FF - -#define XTPERF_MASK_I_STALL_CACHE_MISS 0x0001 /* ICache-miss stall */ -#define XTPERF_MASK_I_STALL_BUSY 0x0002 /* Instruction RAM/ROM busy stall */ -#define XTPERF_MASK_I_STALL_IN_PIF 0x0004 /* Instruction RAM inbound-PIF request stall */ -#define XTPERF_MASK_I_STALL_TIE_PORT 0x0008 /* TIE port stall */ -#define XTPERF_MASK_I_STALL_EXTERNAL_SIGNAL 0x0010 /* External RunStall signal status */ -#define XTPERF_MASK_I_STALL_UNCACHED_FETCH 0x0020 /* Uncached fetch stall */ -#define XTPERF_MASK_I_STALL_FAST_L32R 0x0040 /* FastL32R stall */ -#define XTPERF_MASK_I_STALL_ITERATIVE_MUL 0x0080 /* Iterative multiply stall */ -#define XTPERF_MASK_I_STALL_ITERATIVE_DIV 0x0100 /* Iterative divide stall */ - -/* - * XTPERF_CNT_EXR selector mask - */ - -#define XTPERF_MASK_EXR_ALL 0x01FF - -#define XTPERF_MASK_EXR_REPLAYS 0x0001 /* Other Pipeline Replay (i.e. excludes $ miss etc.) */ -#define XTPERF_MASK_EXR_LEVEL1_INT 0x0002 /* Level-1 interrupt */ -#define XTPERF_MASK_EXR_LEVELH_INT 0x0004 /* Greater-than-level-1 interrupt */ -#define XTPERF_MASK_EXR_DEBUG 0x0008 /* Debug exception */ -#define XTPERF_MASK_EXR_NMI 0x0010 /* NMI */ -#define XTPERF_MASK_EXR_WINDOW 0x0020 /* Window exception */ -#define XTPERF_MASK_EXR_ALLOCA 0x0040 /* Alloca exception */ -#define XTPERF_MASK_EXR_OTHER 0x0080 /* Other exceptions */ -#define XTPERF_MASK_EXR_MEM_ERR 0x0100 /* HW-corrected memory error */ - -/* - * XTPERF_CNT_BUBBLES selector mask - */ - -#define XTPERF_MASK_BUBBLES_ALL 0x01FD - -#define XTPERF_MASK_BUBBLES_PSO 0x0001 /* Processor domain PSO bubble */ -#define XTPERF_MASK_BUBBLES_R_HOLD_D_CACHE_MISS 0x0004 /* R hold caused by DCache miss */ -#define XTPERF_MASK_BUBBLES_R_HOLD_STORE_RELEASE 0x0008 /* R hold caused by Store release */ -#define XTPERF_MASK_BUBBLES_R_HOLD_REG_DEP 0x0010 /* R hold caused by register dependency */ -#define XTPERF_MASK_BUBBLES_R_HOLD_WAIT 0x0020 /* R hold caused by MEMW, EXTW or EXCW */ -#define XTPERF_MASK_BUBBLES_R_HOLD_HALT 0x0040 /* R hold caused by Halt instruction (TX only) */ -#define XTPERF_MASK_BUBBLES_CTI 0x0080 /* CTI bubble (e.g. branch delay slot) */ -#define XTPERF_MASK_BUBBLES_WAITI 0x0100 /* WAITI bubble */ - -/* - * XTPERF_CNT_I_TLB selector mask - */ - -#define XTPERF_MASK_I_TLB_ALL 0x000F - -#define XTPERF_MASK_I_TLB_HITS 0x0001 /* Hit */ -#define XTPERF_MASK_I_TLB_REPLAYS 0x0002 /* Replay of instruction due to ITLB miss */ -#define XTPERF_MASK_I_TLB_REFILLS 0x0004 /* HW-assisted TLB Refill completes */ -#define XTPERF_MASK_I_TLB_MISSES 0x0008 /* ITLB Miss Exception */ - -/* - * XTPERF_CNT_I_MEM selector mask - */ - -#define XTPERF_MASK_I_MEM_ALL 0x000F - -#define XTPERF_MASK_I_MEM_CACHE_HITS 0x0001 /* ICache Hit */ -#define XTPERF_MASK_I_MEM_CACHE_MISSES 0x0002 /* ICache Miss (includes uncached) */ -#define XTPERF_MASK_I_MEM_IRAM 0x0004 /* InstRAM or InstROM */ -#define XTPERF_MASK_I_MEM_BYPASS 0x0008 /* Bypass (i.e. uncached) fetch */ - -/* - * XTPERF_CNT_D_TLB selector mask - */ - -#define XTPERF_MASK_D_TLB_ALL 0x000F - -#define XTPERF_MASK_D_TLB_HITS 0x0001 /* Hit */ -#define XTPERF_MASK_D_TLB_REPLAYS 0x0002 /* Replay of instruction due to DTLB miss */ -#define XTPERF_MASK_D_TLB_REFILLS 0x0004 /* HW-assisted TLB Refill completes */ -#define XTPERF_MASK_D_TLB_MISSES 0x0008 /* DTLB Miss Exception */ - -/* - * XTPERF_CNT_D_LOAD_U* selector mask - */ - -#define XTPERF_MASK_D_LOAD_ALL 0x000F - -#define XTPERF_MASK_D_LOAD_CACHE_HITS 0x0001 /* Cache Hit */ -#define XTPERF_MASK_D_LOAD_CACHE_MISSES 0x0002 /* Cache Miss */ -#define XTPERF_MASK_D_LOAD_LOCAL_MEM 0x0004 /* Local memory hit */ -#define XTPERF_MASK_D_LOAD_BYPASS 0x0008 /* Bypass (i.e. uncached) load */ - -/* - * XTPERF_CNT_D_STORE_U* selector mask - */ - -#define XTPERF_MASK_D_STORE_ALL 0x000F - -#define XTPERF_MASK_D_STORE_CACHE_HITS 0x0001 /* DCache Hit */ -#define XTPERF_MASK_D_STORE_CACHE_MISSES 0x0002 /* DCache Miss */ -#define XTPERF_MASK_D_STORE_LOCAL_MEM 0x0004 /* Local memory hit */ -#define XTPERF_MASK_D_STORE_PIF 0x0008 /* PIF Store */ - -/* - * XTPERF_CNT_D_ACCESS_U* selector mask - */ - -#define XTPERF_MASK_D_ACCESS_ALL 0x000F - -#define XTPERF_MASK_D_ACCESS_CACHE_MISSES 0x0001 /* DCache Miss */ -#define XTPERF_MASK_D_ACCESS_HITS_SHARED 0x0002 /* Hit Shared */ -#define XTPERF_MASK_D_ACCESS_HITS_EXCLUSIVE 0x0004 /* Hit Exclusive */ -#define XTPERF_MASK_D_ACCESS_HITS_MODIFIED 0x0008 /* Hit Modified */ - -/* - * XTPERF_CNT_MULTIPLE_LS selector mask - */ - -#define XTPERF_MASK_MULTIPLE_LS_ALL 0x003F - -#define XTPERF_MASK_MULTIPLE_LS_0S_0L 0x0001 /* 0 stores and 0 loads */ -#define XTPERF_MASK_MULTIPLE_LS_0S_1L 0x0002 /* 0 stores and 1 loads */ -#define XTPERF_MASK_MULTIPLE_LS_1S_0L 0x0004 /* 1 stores and 0 loads */ -#define XTPERF_MASK_MULTIPLE_LS_1S_1L 0x0008 /* 1 stores and 1 loads */ -#define XTPERF_MASK_MULTIPLE_LS_0S_2L 0x0010 /* 0 stores and 2 loads */ -#define XTPERF_MASK_MULTIPLE_LS_2S_0L 0x0020 /* 2 stores and 0 loads */ - -/* - * XTPERF_CNT_OUTBOUND_PIF selector mask - */ - -#define XTPERF_MASK_OUTBOUND_PIF_ALL 0x0003 - -#define XTPERF_MASK_OUTBOUND_PIF_CASTOUT 0x0001 /* Castout */ -#define XTPERF_MASK_OUTBOUND_PIF_PREFETCH 0x0002 /* Prefetch */ - -/* - * XTPERF_CNT_INBOUND_PIF selector mask - */ - -#define XTPERF_MASK_INBOUND_PIF_ALL 0x0003 - -#define XTPERF_MASK_INBOUND_PIF_I_DMA 0x0001 /* Instruction DMA */ -#define XTPERF_MASK_INBOUND_PIF_D_DMA 0x0002 /* Data DMA */ - -/* - * XTPERF_CNT_PREFETCH selector mask - */ - -#define XTPERF_MASK_PREFETCH_ALL 0x002F - -#define XTPERF_MASK_PREFETCH_I_HIT 0x0001 /* I prefetch-buffer-lookup hit */ -#define XTPERF_MASK_PREFETCH_D_HIT 0x0002 /* D prefetch-buffer-lookup hit */ -#define XTPERF_MASK_PREFETCH_I_MISS 0x0004 /* I prefetch-buffer-lookup miss */ -#define XTPERF_MASK_PREFETCH_D_MISS 0x0008 /* D prefetch-buffer-lookup miss */ -#define XTPERF_MASK_PREFETCH_D_L1_FILL 0x0020 /* Fill directly to DCache L1 */ - -#endif /* __XT_PERF_CONSTS_H__ */ diff --git a/tools/sdk/include/esp32/xtensa/xtensa-libdb-macros.h b/tools/sdk/include/esp32/xtensa/xtensa-libdb-macros.h deleted file mode 100644 index fbbe50964c0..00000000000 --- a/tools/sdk/include/esp32/xtensa/xtensa-libdb-macros.h +++ /dev/null @@ -1,161 +0,0 @@ -/* - * xtensa-libdb-macros.h - */ - -/* $Id: //depot/rel/Eaglenest/Xtensa/Software/libdb/xtensa-libdb-macros.h#1 $ */ - -/* Copyright (c) 2004-2008 Tensilica Inc. - - 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. */ - -#ifndef __H_LIBDB_MACROS -#define __H_LIBDB_MACROS - -/* - * This header file provides macros used to construct, identify and use - * "target numbers" that are assigned to various types of Xtensa processor - * registers and states. These target numbers are used by GDB in the remote - * protocol, and are thus used by all GDB debugger agents (targets). - * They are also used in ELF debugger information sections (stabs, dwarf, etc). - * - * These macros are separated from xtensa-libdb.h because they are needed - * by certain debugger agents that do not use or have access to libdb, - * e.g. the OCD daemon, RedBoot, XMON, etc. - * - * For the time being, for compatibility with certain 3rd party debugger - * software vendors, target numbers are limited to 16 bits. It is - * conceivable that this will be extended in the future to 32 bits. - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef uint32 - #define uint32 unsigned int -#endif -#ifndef int32 - #define int32 int -#endif - - -/* - * Macros to form register "target numbers" for various standard registers/states: - */ -#define XTENSA_DBREGN_INVALID -1 /* not a valid target number */ -#define XTENSA_DBREGN_A(n) (0x0000+(n)) /* address registers a0..a15 */ -#define XTENSA_DBREGN_B(n) (0x0010+(n)) /* boolean bits b0..b15 */ -#define XTENSA_DBREGN_PC 0x0020 /* program counter */ - /* 0x0021 RESERVED for use by Tensilica */ -#define XTENSA_DBREGN_BO(n) (0x0022+(n)) /* boolean octuple-bits bo0..bo1 */ -#define XTENSA_DBREGN_BQ(n) (0x0024+(n)) /* boolean quadruple-bits bq0..bq3 */ -#define XTENSA_DBREGN_BD(n) (0x0028+(n)) /* boolean double-bits bd0..bd7 */ -#define XTENSA_DBREGN_F(n) (0x0030+(n)) /* floating point registers f0..f15 */ -#define XTENSA_DBREGN_VEC(n) (0x0040+(n)) /* Vectra vec regs v0..v15 */ -#define XTENSA_DBREGN_VSEL(n) (0x0050+(n)) /* Vectra sel s0..s3 (V1) ..s7 (V2) */ -#define XTENSA_DBREGN_VALIGN(n) (0x0058+(n)) /* Vectra valign regs u0..u3 */ -#define XTENSA_DBREGN_VCOEFF(n) (0x005C+(n)) /* Vectra I vcoeff regs c0..c1 */ - /* 0x005E..0x005F RESERVED for use by Tensilica */ -#define XTENSA_DBREGN_AEP(n) (0x0060+(n)) /* HiFi2 Audio Engine regs aep0..aep7 */ -#define XTENSA_DBREGN_AEQ(n) (0x0068+(n)) /* HiFi2 Audio Engine regs aeq0..aeq3 */ - /* 0x006C..0x00FF RESERVED for use by Tensilica */ -#define XTENSA_DBREGN_AR(n) (0x0100+(n)) /* physical address regs ar0..ar63 - (note: only with window option) */ - /* 0x0140..0x01FF RESERVED for use by Tensilica */ -#define XTENSA_DBREGN_SREG(n) (0x0200+(n)) /* special registers 0..255 (core) */ -#define XTENSA_DBREGN_BR XTENSA_DBREGN_SREG(0x04) /* all 16 boolean bits, BR */ -#define XTENSA_DBREGN_MR(n) XTENSA_DBREGN_SREG(0x20+(n)) /* MAC16 registers m0..m3 */ -#define XTENSA_DBREGN_UREG(n) (0x0300+(n)) /* user registers 0..255 (TIE) */ - /* 0x0400..0x0FFF RESERVED for use by Tensilica */ - /* 0x1000..0x1FFF user-defined regfiles */ - /* 0x2000..0xEFFF other states (and regfiles) */ -#define XTENSA_DBREGN_DBAGENT(n) (0xF000+(n)) /* non-processor "registers" 0..4095 for - 3rd-party debugger agent defined use */ - /* > 0xFFFF (32-bit) RESERVED for use by Tensilica */ -/*#define XTENSA_DBREGN_CONTEXT(n) (0x02000000+((n)<<20))*/ /* add this macro's value to a target - number to identify a specific context 0..31 - for context-replicated registers */ -#define XTENSA_DBREGN_MASK 0xFFFF /* mask of valid target_number bits */ -#define XTENSA_DBREGN_WRITE_SIDE 0x04000000 /* flag to request write half of a register - split into distinct read and write entries - with the same target number (currently only - valid in a couple of libdb API functions; - see xtensa-libdb.h for details) */ - -/* - * Macros to identify specific ranges of target numbers (formed above): - * NOTE: any context number (or other upper 12 bits) are considered - * modifiers and are thus stripped out for identification purposes. - */ -#define XTENSA_DBREGN_IS_VALID(tn) (((tn) & ~0xFFFF) == 0) /* just tests it's 16-bit unsigned */ -#define XTENSA_DBREGN_IS_A(tn) (((tn) & 0xFFF0)==0x0000) /* is a0..a15 */ -#define XTENSA_DBREGN_IS_B(tn) (((tn) & 0xFFF0)==0x0010) /* is b0..b15 */ -#define XTENSA_DBREGN_IS_PC(tn) (((tn) & 0xFFFF)==0x0020) /* is program counter */ -#define XTENSA_DBREGN_IS_BO(tn) (((tn) & 0xFFFE)==0x0022) /* is bo0..bo1 */ -#define XTENSA_DBREGN_IS_BQ(tn) (((tn) & 0xFFFC)==0x0024) /* is bq0..bq3 */ -#define XTENSA_DBREGN_IS_BD(tn) (((tn) & 0xFFF8)==0x0028) /* is bd0..bd7 */ -#define XTENSA_DBREGN_IS_F(tn) (((tn) & 0xFFF0)==0x0030) /* is f0..f15 */ -#define XTENSA_DBREGN_IS_VEC(tn) (((tn) & 0xFFF0)==0x0040) /* is v0..v15 */ -#define XTENSA_DBREGN_IS_VSEL(tn) (((tn) & 0xFFF8)==0x0050) /* is s0..s7 (s0..s3 in V1) */ -#define XTENSA_DBREGN_IS_VALIGN(tn) (((tn) & 0xFFFC)==0x0058) /* is u0..u3 */ -#define XTENSA_DBREGN_IS_VCOEFF(tn) (((tn) & 0xFFFE)==0x005C) /* is c0..c1 */ -#define XTENSA_DBREGN_IS_AEP(tn) (((tn) & 0xFFF8)==0x0060) /* is aep0..aep7 */ -#define XTENSA_DBREGN_IS_AEQ(tn) (((tn) & 0xFFFC)==0x0068) /* is aeq0..aeq3 */ -#define XTENSA_DBREGN_IS_AR(tn) (((tn) & 0xFFC0)==0x0100) /* is ar0..ar63 */ -#define XTENSA_DBREGN_IS_SREG(tn) (((tn) & 0xFF00)==0x0200) /* is special register */ -#define XTENSA_DBREGN_IS_BR(tn) (((tn) & 0xFFFF)==XTENSA_DBREGN_SREG(0x04)) /* is BR */ -#define XTENSA_DBREGN_IS_MR(tn) (((tn) & 0xFFFC)==XTENSA_DBREGN_SREG(0x20)) /* m0..m3 */ -#define XTENSA_DBREGN_IS_UREG(tn) (((tn) & 0xFF00)==0x0300) /* is user register */ -#define XTENSA_DBREGN_IS_DBAGENT(tn) (((tn) & 0xF000)==0xF000) /* is non-processor */ -/*#define XTENSA_DBREGN_IS_CONTEXT(tn) (((tn) & 0x02000000) != 0)*/ /* specifies context # */ - -/* - * Macros to extract register index from a register "target number" - * when a specific range has been identified using one of the _IS_ macros above. - * These macros only return a useful value if the corresponding _IS_ macro returns true. - */ -#define XTENSA_DBREGN_A_INDEX(tn) ((tn) & 0x0F) /* 0..15 for a0..a15 */ -#define XTENSA_DBREGN_B_INDEX(tn) ((tn) & 0x0F) /* 0..15 for b0..b15 */ -#define XTENSA_DBREGN_BO_INDEX(tn) ((tn) & 0x01) /* 0..1 for bo0..bo1 */ -#define XTENSA_DBREGN_BQ_INDEX(tn) ((tn) & 0x03) /* 0..3 for bq0..bq3 */ -#define XTENSA_DBREGN_BD_INDEX(tn) ((tn) & 0x07) /* 0..7 for bd0..bd7 */ -#define XTENSA_DBREGN_F_INDEX(tn) ((tn) & 0x0F) /* 0..15 for f0..f15 */ -#define XTENSA_DBREGN_VEC_INDEX(tn) ((tn) & 0x0F) /* 0..15 for v0..v15 */ -#define XTENSA_DBREGN_VSEL_INDEX(tn) ((tn) & 0x07) /* 0..7 for s0..s7 */ -#define XTENSA_DBREGN_VALIGN_INDEX(tn) ((tn) & 0x03) /* 0..3 for u0..u3 */ -#define XTENSA_DBREGN_VCOEFF_INDEX(tn) ((tn) & 0x01) /* 0..1 for c0..c1 */ -#define XTENSA_DBREGN_AEP_INDEX(tn) ((tn) & 0x07) /* 0..7 for aep0..aep7 */ -#define XTENSA_DBREGN_AEQ_INDEX(tn) ((tn) & 0x03) /* 0..3 for aeq0..aeq3 */ -#define XTENSA_DBREGN_AR_INDEX(tn) ((tn) & 0x3F) /* 0..63 for ar0..ar63 */ -#define XTENSA_DBREGN_SREG_INDEX(tn) ((tn) & 0xFF) /* 0..255 for special registers */ -#define XTENSA_DBREGN_MR_INDEX(tn) ((tn) & 0x03) /* 0..3 for m0..m3 */ -#define XTENSA_DBREGN_UREG_INDEX(tn) ((tn) & 0xFF) /* 0..255 for user registers */ -#define XTENSA_DBREGN_DBAGENT_INDEX(tn) ((tn) & 0xFFF) /* 0..4095 for non-processor */ -/*#define XTENSA_DBREGN_CONTEXT_INDEX(tn) (((tn) >> 20) & 0x1F)*/ /* 0..31 context numbers */ - - - - -#ifdef __cplusplus -} -#endif - -#endif /* __H_LIBDB_MACROS */ - diff --git a/tools/sdk/include/esp32/xtensa/xtensa-versions.h b/tools/sdk/include/esp32/xtensa/xtensa-versions.h deleted file mode 100644 index abed3a18dc9..00000000000 --- a/tools/sdk/include/esp32/xtensa/xtensa-versions.h +++ /dev/null @@ -1,347 +0,0 @@ -/* - xtensa-versions.h -- definitions of Xtensa version and release numbers - - This file defines most Xtensa-related product versions and releases - that exist so far. - It also provides a bit of information about which ones are current. - This file changes every release, as versions/releases get added. - - - $Id: //depot/rel/Eaglenest/Xtensa/Software/misc/xtensa-versions.h.tpp#2 $ - - Copyright (c) 2006-2010 Tensilica Inc. - - 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. -*/ - -#ifndef XTENSA_VERSIONS_H -#define XTENSA_VERSIONS_H - - -/* - * NOTE: A "release" is a collection of product versions - * made available at once (together) to customers. - * In the past, release and version names all matched in T####.# form, - * making the distinction irrelevant. - * Starting with the RA-2004.1 release, this is no longer the case. - */ - - -/* Hardware (Xtensa/Diamond processor) versions: */ -#define XTENSA_HWVERSION_T1020_0 102000 /* versions T1020.0 */ -#define XTENSA_HWCIDSCHEME_T1020_0 10 -#define XTENSA_HWCIDVERS_T1020_0 2 -#define XTENSA_HWVERSION_T1020_1 102001 /* versions T1020.1 */ -#define XTENSA_HWCIDSCHEME_T1020_1 10 -#define XTENSA_HWCIDVERS_T1020_1 3 -#define XTENSA_HWVERSION_T1020_2B 102002 /* versions T1020.2b */ -#define XTENSA_HWCIDSCHEME_T1020_2B 10 -#define XTENSA_HWCIDVERS_T1020_2B 5 -#define XTENSA_HWVERSION_T1020_2 102002 /* versions T1020.2 */ -#define XTENSA_HWCIDSCHEME_T1020_2 10 -#define XTENSA_HWCIDVERS_T1020_2 4 -#define XTENSA_HWVERSION_T1020_3 102003 /* versions T1020.3 */ -#define XTENSA_HWCIDSCHEME_T1020_3 10 -#define XTENSA_HWCIDVERS_T1020_3 6 -#define XTENSA_HWVERSION_T1020_4 102004 /* versions T1020.4 */ -#define XTENSA_HWCIDSCHEME_T1020_4 10 -#define XTENSA_HWCIDVERS_T1020_4 7 -#define XTENSA_HWVERSION_T1030_0 103000 /* versions T1030.0 */ -#define XTENSA_HWCIDSCHEME_T1030_0 10 -#define XTENSA_HWCIDVERS_T1030_0 9 -#define XTENSA_HWVERSION_T1030_1 103001 /* versions T1030.1 */ -#define XTENSA_HWCIDSCHEME_T1030_1 10 -#define XTENSA_HWCIDVERS_T1030_1 10 -#define XTENSA_HWVERSION_T1030_2 103002 /* versions T1030.2 */ -#define XTENSA_HWCIDSCHEME_T1030_2 10 -#define XTENSA_HWCIDVERS_T1030_2 11 -#define XTENSA_HWVERSION_T1030_3 103003 /* versions T1030.3 */ -#define XTENSA_HWCIDSCHEME_T1030_3 10 -#define XTENSA_HWCIDVERS_T1030_3 12 -#define XTENSA_HWVERSION_T1040_0 104000 /* versions T1040.0 */ -#define XTENSA_HWCIDSCHEME_T1040_0 10 -#define XTENSA_HWCIDVERS_T1040_0 15 -#define XTENSA_HWVERSION_T1040_1 104001 /* versions T1040.1 */ -#define XTENSA_HWCIDSCHEME_T1040_1 01 -#define XTENSA_HWCIDVERS_T1040_1 32 -#define XTENSA_HWVERSION_T1040_1P 104001 /* versions T1040.1-prehotfix */ -#define XTENSA_HWCIDSCHEME_T1040_1P 10 -#define XTENSA_HWCIDVERS_T1040_1P 16 -#define XTENSA_HWVERSION_T1040_2 104002 /* versions T1040.2 */ -#define XTENSA_HWCIDSCHEME_T1040_2 01 -#define XTENSA_HWCIDVERS_T1040_2 33 -#define XTENSA_HWVERSION_T1040_3 104003 /* versions T1040.3 */ -#define XTENSA_HWCIDSCHEME_T1040_3 01 -#define XTENSA_HWCIDVERS_T1040_3 34 -#define XTENSA_HWVERSION_T1050_0 105000 /* versions T1050.0 */ -#define XTENSA_HWCIDSCHEME_T1050_0 1100 -#define XTENSA_HWCIDVERS_T1050_0 1 -#define XTENSA_HWVERSION_T1050_1 105001 /* versions T1050.1 */ -#define XTENSA_HWCIDSCHEME_T1050_1 1100 -#define XTENSA_HWCIDVERS_T1050_1 2 -#define XTENSA_HWVERSION_T1050_2 105002 /* versions T1050.2 */ -#define XTENSA_HWCIDSCHEME_T1050_2 1100 -#define XTENSA_HWCIDVERS_T1050_2 4 -#define XTENSA_HWVERSION_T1050_3 105003 /* versions T1050.3 */ -#define XTENSA_HWCIDSCHEME_T1050_3 1100 -#define XTENSA_HWCIDVERS_T1050_3 6 -#define XTENSA_HWVERSION_T1050_4 105004 /* versions T1050.4 */ -#define XTENSA_HWCIDSCHEME_T1050_4 1100 -#define XTENSA_HWCIDVERS_T1050_4 7 -#define XTENSA_HWVERSION_T1050_5 105005 /* versions T1050.5 */ -#define XTENSA_HWCIDSCHEME_T1050_5 1100 -#define XTENSA_HWCIDVERS_T1050_5 8 -#define XTENSA_HWVERSION_RA_2004_1 210000 /* versions LX1.0.0 */ -#define XTENSA_HWCIDSCHEME_RA_2004_1 1100 -#define XTENSA_HWCIDVERS_RA_2004_1 3 -#define XTENSA_HWVERSION_RA_2005_1 210001 /* versions LX1.0.1 */ -#define XTENSA_HWCIDSCHEME_RA_2005_1 1100 -#define XTENSA_HWCIDVERS_RA_2005_1 20 -#define XTENSA_HWVERSION_RA_2005_2 210002 /* versions LX1.0.2 */ -#define XTENSA_HWCIDSCHEME_RA_2005_2 1100 -#define XTENSA_HWCIDVERS_RA_2005_2 21 -#define XTENSA_HWVERSION_RA_2005_3 210003 /* versions LX1.0.3, X6.0.3 */ -#define XTENSA_HWCIDSCHEME_RA_2005_3 1100 -#define XTENSA_HWCIDVERS_RA_2005_3 22 -#define XTENSA_HWVERSION_RA_2006_4 210004 /* versions LX1.0.4, X6.0.4 */ -#define XTENSA_HWCIDSCHEME_RA_2006_4 1100 -#define XTENSA_HWCIDVERS_RA_2006_4 23 -#define XTENSA_HWVERSION_RA_2006_5 210005 /* versions LX1.0.5, X6.0.5 */ -#define XTENSA_HWCIDSCHEME_RA_2006_5 1100 -#define XTENSA_HWCIDVERS_RA_2006_5 24 -#define XTENSA_HWVERSION_RA_2006_6 210006 /* versions LX1.0.6, X6.0.6 */ -#define XTENSA_HWCIDSCHEME_RA_2006_6 1100 -#define XTENSA_HWCIDVERS_RA_2006_6 25 -#define XTENSA_HWVERSION_RA_2007_7 210007 /* versions LX1.0.7, X6.0.7 */ -#define XTENSA_HWCIDSCHEME_RA_2007_7 1100 -#define XTENSA_HWCIDVERS_RA_2007_7 26 -#define XTENSA_HWVERSION_RA_2008_8 210008 /* versions LX1.0.8, X6.0.8 */ -#define XTENSA_HWCIDSCHEME_RA_2008_8 1100 -#define XTENSA_HWCIDVERS_RA_2008_8 27 -#define XTENSA_HWVERSION_RB_2006_0 220000 /* versions LX2.0.0, X7.0.0 */ -#define XTENSA_HWCIDSCHEME_RB_2006_0 1100 -#define XTENSA_HWCIDVERS_RB_2006_0 48 -#define XTENSA_HWVERSION_RB_2007_1 220001 /* versions LX2.0.1, X7.0.1 */ -#define XTENSA_HWCIDSCHEME_RB_2007_1 1100 -#define XTENSA_HWCIDVERS_RB_2007_1 49 -#define XTENSA_HWVERSION_RB_2007_2 221000 /* versions LX2.1.0, X7.1.0 */ -#define XTENSA_HWCIDSCHEME_RB_2007_2 1100 -#define XTENSA_HWCIDVERS_RB_2007_2 52 -#define XTENSA_HWVERSION_RB_2008_3 221001 /* versions LX2.1.1, X7.1.1 */ -#define XTENSA_HWCIDSCHEME_RB_2008_3 1100 -#define XTENSA_HWCIDVERS_RB_2008_3 53 -#define XTENSA_HWVERSION_RB_2008_4 221002 /* versions LX2.1.2, X7.1.2 */ -#define XTENSA_HWCIDSCHEME_RB_2008_4 1100 -#define XTENSA_HWCIDVERS_RB_2008_4 54 -#define XTENSA_HWVERSION_RB_2009_5 221003 /* versions LX2.1.3, X7.1.3 */ -#define XTENSA_HWCIDSCHEME_RB_2009_5 1100 -#define XTENSA_HWCIDVERS_RB_2009_5 55 -#define XTENSA_HWVERSION_RB_2007_2_MP 221100 /* versions LX2.1.8-MP, X7.1.8-MP */ -#define XTENSA_HWCIDSCHEME_RB_2007_2_MP 1100 -#define XTENSA_HWCIDVERS_RB_2007_2_MP 64 -#define XTENSA_HWVERSION_RC_2009_0 230000 /* versions LX3.0.0, X8.0.0, MX1.0.0 */ -#define XTENSA_HWCIDSCHEME_RC_2009_0 1100 -#define XTENSA_HWCIDVERS_RC_2009_0 65 -#define XTENSA_HWVERSION_RC_2010_1 230001 /* versions LX3.0.1, X8.0.1, MX1.0.1 */ -#define XTENSA_HWCIDSCHEME_RC_2010_1 1100 -#define XTENSA_HWCIDVERS_RC_2010_1 66 -#define XTENSA_HWVERSION_RC_2010_2 230002 /* versions LX3.0.2, X8.0.2, MX1.0.2 */ -#define XTENSA_HWCIDSCHEME_RC_2010_2 1100 -#define XTENSA_HWCIDVERS_RC_2010_2 67 -#define XTENSA_HWVERSION_RC_2011_3 230003 /* versions LX3.0.3, X8.0.3, MX1.0.3 */ -#define XTENSA_HWCIDSCHEME_RC_2011_3 1100 -#define XTENSA_HWCIDVERS_RC_2011_3 68 -#define XTENSA_HWVERSION_RD_2010_0 240000 /* versions LX4.0.0, X9.0.0, MX1.1.0, TX1.0.0 */ -#define XTENSA_HWCIDSCHEME_RD_2010_0 1100 -#define XTENSA_HWCIDVERS_RD_2010_0 80 -#define XTENSA_HWVERSION_RD_2011_1 240001 /* versions LX4.0.1, X9.0.1, MX1.1.1, TX1.0.1 */ -#define XTENSA_HWCIDSCHEME_RD_2011_1 1100 -#define XTENSA_HWCIDVERS_RD_2011_1 81 -#define XTENSA_HWVERSION_RD_2011_2 240002 /* versions LX4.0.2, X9.0.2, MX1.1.2, TX1.0.2 */ -#define XTENSA_HWCIDSCHEME_RD_2011_2 1100 -#define XTENSA_HWCIDVERS_RD_2011_2 82 -#define XTENSA_HWVERSION_RD_2011_3 240003 /* versions LX4.0.3, X9.0.3, MX1.1.3, TX1.0.3 */ -#define XTENSA_HWCIDSCHEME_RD_2011_3 1100 -#define XTENSA_HWCIDVERS_RD_2011_3 83 -#define XTENSA_HWVERSION_RD_2012_4 240004 /* versions LX4.0.4, X9.0.4, MX1.1.4, TX1.0.4 */ -#define XTENSA_HWCIDSCHEME_RD_2012_4 1100 -#define XTENSA_HWCIDVERS_RD_2012_4 84 -#define XTENSA_HWVERSION_RD_2012_5 240005 /* versions LX4.0.5, X9.0.5, MX1.1.5, TX1.0.5 */ -#define XTENSA_HWCIDSCHEME_RD_2012_5 1100 -#define XTENSA_HWCIDVERS_RD_2012_5 85 -#define XTENSA_HWVERSION_RE_2012_0 250000 /* versions LX5.0.0, X10.0.0, MX1.2.0, TX2.0.0 */ -#define XTENSA_HWCIDSCHEME_RE_2012_0 1100 -#define XTENSA_HWCIDVERS_RE_2012_0 96 -#define XTENSA_HWVERSION_RE_2012_1 250001 /* versions LX5.0.1, X10.0.1, MX1.2.1, TX2.0.1 */ -#define XTENSA_HWCIDSCHEME_RE_2012_1 1100 -#define XTENSA_HWCIDVERS_RE_2012_1 97 -#define XTENSA_HWVERSION_RE_2013_2 250002 /* versions LX5.0.2, X10.0.2, MX1.2.2, TX2.0.2 */ -#define XTENSA_HWCIDSCHEME_RE_2013_2 1100 -#define XTENSA_HWCIDVERS_RE_2013_2 98 -#define XTENSA_HWVERSION_RE_2013_3 250003 /* versions LX5.0.3, X10.0.3, MX1.2.3, TX2.0.3 */ -#define XTENSA_HWCIDSCHEME_RE_2013_3 1100 -#define XTENSA_HWCIDVERS_RE_2013_3 99 -#define XTENSA_HWVERSION_RE_2013_4 250004 /* versions LX5.0.4, X10.0.4, MX1.2.4, TX2.0.4 */ -#define XTENSA_HWCIDSCHEME_RE_2013_4 1100 -#define XTENSA_HWCIDVERS_RE_2013_4 100 -#define XTENSA_HWVERSION_RE_2014_5 250005 /* versions LX5.0.5, X10.0.5, MX1.2.5, TX2.0.5 */ -#define XTENSA_HWCIDSCHEME_RE_2014_5 1100 -#define XTENSA_HWCIDVERS_RE_2014_5 101 -#define XTENSA_HWVERSION_RE_2015_6 250006 /* versions LX5.0.6, X10.0.6, MX1.2.6, TX2.0.6 */ -#define XTENSA_HWCIDSCHEME_RE_2015_6 1100 -#define XTENSA_HWCIDVERS_RE_2015_6 102 -#define XTENSA_HWVERSION_RF_2014_0 260000 /* versions LX6.0.0, X11.0.0, MX1.3.0, TX3.0.0 */ -#define XTENSA_HWCIDSCHEME_RF_2014_0 1100 -#define XTENSA_HWCIDVERS_RF_2014_0 112 -#define XTENSA_HWVERSION_RF_2014_1 260001 /* versions LX6.0.1, X11.0.1 */ -#define XTENSA_HWCIDSCHEME_RF_2014_1 1100 -#define XTENSA_HWCIDVERS_RF_2014_1 113 -#define XTENSA_HWVERSION_RF_2015_2 260002 /* versions LX6.0.2, X11.0.2 */ -#define XTENSA_HWCIDSCHEME_RF_2015_2 1100 -#define XTENSA_HWCIDVERS_RF_2015_2 114 -#define XTENSA_HWVERSION_RF_2015_3 260003 /* versions LX6.0.3, X11.0.3 */ -#define XTENSA_HWCIDSCHEME_RF_2015_3 1100 -#define XTENSA_HWCIDVERS_RF_2015_3 115 -#define XTENSA_HWVERSION_RG_2015_0 270000 /* versions LX7.0.0, X12.0.0, NX1.0.0, SX1.0.0, MX1.4.0, TX4.0.0 */ -#define XTENSA_HWCIDSCHEME_RG_2015_0 1100 -#define XTENSA_HWCIDVERS_RG_2015_0 128 - -/* Software (Xtensa Tools) versions: */ -#define XTENSA_SWVERSION_T1020_0 102000 /* versions T1020.0 */ -#define XTENSA_SWVERSION_T1020_1 102001 /* versions T1020.1 */ -#define XTENSA_SWVERSION_T1020_2B 102002 /* versions T1020.2b */ -#define XTENSA_SWVERSION_T1020_2 102002 /* versions T1020.2 */ -#define XTENSA_SWVERSION_T1020_3 102003 /* versions T1020.3 */ -#define XTENSA_SWVERSION_T1020_4 102004 /* versions T1020.4 */ -#define XTENSA_SWVERSION_T1030_0 103000 /* versions T1030.0 */ -#define XTENSA_SWVERSION_T1030_1 103001 /* versions T1030.1 */ -#define XTENSA_SWVERSION_T1030_2 103002 /* versions T1030.2 */ -#define XTENSA_SWVERSION_T1030_3 103003 /* versions T1030.3 */ -#define XTENSA_SWVERSION_T1040_0 104000 /* versions T1040.0 */ -#define XTENSA_SWVERSION_T1040_1 104001 /* versions T1040.1 */ -#define XTENSA_SWVERSION_T1040_1P 104001 /* versions T1040.1-prehotfix */ -#define XTENSA_SWVERSION_T1040_2 104002 /* versions T1040.2 */ -#define XTENSA_SWVERSION_T1040_3 104003 /* versions T1040.3 */ -#define XTENSA_SWVERSION_T1050_0 105000 /* versions T1050.0 */ -#define XTENSA_SWVERSION_T1050_1 105001 /* versions T1050.1 */ -#define XTENSA_SWVERSION_T1050_2 105002 /* versions T1050.2 */ -#define XTENSA_SWVERSION_T1050_3 105003 /* versions T1050.3 */ -#define XTENSA_SWVERSION_T1050_4 105004 /* versions T1050.4 */ -#define XTENSA_SWVERSION_T1050_5 105005 /* versions T1050.5 */ -#define XTENSA_SWVERSION_RA_2004_1 600000 /* versions 6.0.0 */ -#define XTENSA_SWVERSION_RA_2005_1 600001 /* versions 6.0.1 */ -#define XTENSA_SWVERSION_RA_2005_2 600002 /* versions 6.0.2 */ -#define XTENSA_SWVERSION_RA_2005_3 600003 /* versions 6.0.3 */ -#define XTENSA_SWVERSION_RA_2006_4 600004 /* versions 6.0.4 */ -#define XTENSA_SWVERSION_RA_2006_5 600005 /* versions 6.0.5 */ -#define XTENSA_SWVERSION_RA_2006_6 600006 /* versions 6.0.6 */ -#define XTENSA_SWVERSION_RA_2007_7 600007 /* versions 6.0.7 */ -#define XTENSA_SWVERSION_RA_2008_8 600008 /* versions 6.0.8 */ -#define XTENSA_SWVERSION_RB_2006_0 700000 /* versions 7.0.0 */ -#define XTENSA_SWVERSION_RB_2007_1 700001 /* versions 7.0.1 */ -#define XTENSA_SWVERSION_RB_2007_2 701000 /* versions 7.1.0 */ -#define XTENSA_SWVERSION_RB_2008_3 701001 /* versions 7.1.1 */ -#define XTENSA_SWVERSION_RB_2008_4 701002 /* versions 7.1.2 */ -#define XTENSA_SWVERSION_RB_2009_5 701003 /* versions 7.1.3 */ -#define XTENSA_SWVERSION_RB_2007_2_MP 701100 /* versions 7.1.8-MP */ -#define XTENSA_SWVERSION_RC_2009_0 800000 /* versions 8.0.0 */ -#define XTENSA_SWVERSION_RC_2010_1 800001 /* versions 8.0.1 */ -#define XTENSA_SWVERSION_RC_2010_2 800002 /* versions 8.0.2 */ -#define XTENSA_SWVERSION_RC_2011_3 800003 /* versions 8.0.3 */ -#define XTENSA_SWVERSION_RD_2010_0 900000 /* versions 9.0.0 */ -#define XTENSA_SWVERSION_RD_2011_1 900001 /* versions 9.0.1 */ -#define XTENSA_SWVERSION_RD_2011_2 900002 /* versions 9.0.2 */ -#define XTENSA_SWVERSION_RD_2011_3 900003 /* versions 9.0.3 */ -#define XTENSA_SWVERSION_RD_2012_4 900004 /* versions 9.0.4 */ -#define XTENSA_SWVERSION_RD_2012_5 900005 /* versions 9.0.5 */ -#define XTENSA_SWVERSION_RE_2012_0 1000000 /* versions 10.0.0 */ -#define XTENSA_SWVERSION_RE_2012_1 1000001 /* versions 10.0.1 */ -#define XTENSA_SWVERSION_RE_2013_2 1000002 /* versions 10.0.2 */ -#define XTENSA_SWVERSION_RE_2013_3 1000003 /* versions 10.0.3 */ -#define XTENSA_SWVERSION_RE_2013_4 1000004 /* versions 10.0.4 */ -#define XTENSA_SWVERSION_RE_2014_5 1000005 /* versions 10.0.5 */ -#define XTENSA_SWVERSION_RE_2015_6 1000006 /* versions 10.0.6 */ -#define XTENSA_SWVERSION_RF_2014_0 1100000 /* versions 11.0.0 */ -#define XTENSA_SWVERSION_RF_2014_1 1100001 /* versions 11.0.1 */ -#define XTENSA_SWVERSION_RF_2015_2 1100002 /* versions 11.0.2 */ -#define XTENSA_SWVERSION_RF_2015_3 1100003 /* versions 11.0.3 */ -#define XTENSA_SWVERSION_RG_2015_0 1200000 /* versions 12.0.0 */ -#define XTENSA_SWVERSION_T1040_1_PREHOTFIX XTENSA_SWVERSION_T1040_1P /* T1040.1-prehotfix */ -#define XTENSA_SWVERSION_6_0_0 XTENSA_SWVERSION_RA_2004_1 /* 6.0.0 */ -#define XTENSA_SWVERSION_6_0_1 XTENSA_SWVERSION_RA_2005_1 /* 6.0.1 */ -#define XTENSA_SWVERSION_6_0_2 XTENSA_SWVERSION_RA_2005_2 /* 6.0.2 */ -#define XTENSA_SWVERSION_6_0_3 XTENSA_SWVERSION_RA_2005_3 /* 6.0.3 */ -#define XTENSA_SWVERSION_6_0_4 XTENSA_SWVERSION_RA_2006_4 /* 6.0.4 */ -#define XTENSA_SWVERSION_6_0_5 XTENSA_SWVERSION_RA_2006_5 /* 6.0.5 */ -#define XTENSA_SWVERSION_6_0_6 XTENSA_SWVERSION_RA_2006_6 /* 6.0.6 */ -#define XTENSA_SWVERSION_6_0_7 XTENSA_SWVERSION_RA_2007_7 /* 6.0.7 */ -#define XTENSA_SWVERSION_6_0_8 XTENSA_SWVERSION_RA_2008_8 /* 6.0.8 */ -#define XTENSA_SWVERSION_7_0_0 XTENSA_SWVERSION_RB_2006_0 /* 7.0.0 */ -#define XTENSA_SWVERSION_7_0_1 XTENSA_SWVERSION_RB_2007_1 /* 7.0.1 */ -#define XTENSA_SWVERSION_7_1_0 XTENSA_SWVERSION_RB_2007_2 /* 7.1.0 */ -#define XTENSA_SWVERSION_7_1_1 XTENSA_SWVERSION_RB_2008_3 /* 7.1.1 */ -#define XTENSA_SWVERSION_7_1_2 XTENSA_SWVERSION_RB_2008_4 /* 7.1.2 */ -#define XTENSA_SWVERSION_7_1_3 XTENSA_SWVERSION_RB_2009_5 /* 7.1.3 */ -#define XTENSA_SWVERSION_7_1_8_MP XTENSA_SWVERSION_RB_2007_2_MP /* 7.1.8-MP */ -#define XTENSA_SWVERSION_8_0_0 XTENSA_SWVERSION_RC_2009_0 /* 8.0.0 */ -#define XTENSA_SWVERSION_8_0_1 XTENSA_SWVERSION_RC_2010_1 /* 8.0.1 */ -#define XTENSA_SWVERSION_8_0_2 XTENSA_SWVERSION_RC_2010_2 /* 8.0.2 */ -#define XTENSA_SWVERSION_8_0_3 XTENSA_SWVERSION_RC_2011_3 /* 8.0.3 */ -#define XTENSA_SWVERSION_9_0_0 XTENSA_SWVERSION_RD_2010_0 /* 9.0.0 */ -#define XTENSA_SWVERSION_9_0_1 XTENSA_SWVERSION_RD_2011_1 /* 9.0.1 */ -#define XTENSA_SWVERSION_9_0_2 XTENSA_SWVERSION_RD_2011_2 /* 9.0.2 */ -#define XTENSA_SWVERSION_9_0_3 XTENSA_SWVERSION_RD_2011_3 /* 9.0.3 */ -#define XTENSA_SWVERSION_9_0_4 XTENSA_SWVERSION_RD_2012_4 /* 9.0.4 */ -#define XTENSA_SWVERSION_9_0_5 XTENSA_SWVERSION_RD_2012_5 /* 9.0.5 */ -#define XTENSA_SWVERSION_10_0_0 XTENSA_SWVERSION_RE_2012_0 /* 10.0.0 */ -#define XTENSA_SWVERSION_10_0_1 XTENSA_SWVERSION_RE_2012_1 /* 10.0.1 */ -#define XTENSA_SWVERSION_10_0_2 XTENSA_SWVERSION_RE_2013_2 /* 10.0.2 */ -#define XTENSA_SWVERSION_10_0_3 XTENSA_SWVERSION_RE_2013_3 /* 10.0.3 */ -#define XTENSA_SWVERSION_10_0_4 XTENSA_SWVERSION_RE_2013_4 /* 10.0.4 */ -#define XTENSA_SWVERSION_10_0_5 XTENSA_SWVERSION_RE_2014_5 /* 10.0.5 */ -#define XTENSA_SWVERSION_10_0_6 XTENSA_SWVERSION_RE_2015_6 /* 10.0.6 */ -#define XTENSA_SWVERSION_11_0_0 XTENSA_SWVERSION_RF_2014_0 /* 11.0.0 */ -#define XTENSA_SWVERSION_11_0_1 XTENSA_SWVERSION_RF_2014_1 /* 11.0.1 */ -#define XTENSA_SWVERSION_11_0_2 XTENSA_SWVERSION_RF_2015_2 /* 11.0.2 */ -#define XTENSA_SWVERSION_11_0_3 XTENSA_SWVERSION_RF_2015_3 /* 11.0.3 */ -#define XTENSA_SWVERSION_12_0_0 XTENSA_SWVERSION_RG_2015_0 /* 12.0.0 */ - - -/* The current release: */ -#define XTENSA_RELEASE_NAME "RF-2015.3" -#define XTENSA_RELEASE_CANONICAL_NAME "RF-2015.3" - -/* The product versions within the current release: */ -#define XTENSA_SWVERSION XTENSA_SWVERSION_RF_2015_3 -#define XTENSA_SWVERSION_NAME "11.0.3" -#define XTENSA_SWVERSION_CANONICAL_NAME "11.0.3" -#define XTENSA_SWVERSION_MAJORMID_NAME "11.0" -#define XTENSA_SWVERSION_MAJOR_NAME "11" -/* For product licensing (not necessarily same as *_MAJORMID_NAME): */ -#define XTENSA_SWVERSION_LICENSE_NAME "11.0" - -/* Note: there may be multiple hardware products in one release, - and software can target older hardware, so the notion of - "current" hardware versions is partially configuration dependent. - For now, "current" hardware product version info is left out - to avoid confusion. */ - -#endif /*XTENSA_VERSIONS_H*/ - diff --git a/tools/sdk/include/esp32/xtensa/xtensa-xer.h b/tools/sdk/include/esp32/xtensa/xtensa-xer.h deleted file mode 100644 index 900bda33384..00000000000 --- a/tools/sdk/include/esp32/xtensa/xtensa-xer.h +++ /dev/null @@ -1,149 +0,0 @@ -/* xer-constants.h -- various constants describing external registers accessed - via wer and rer. - - TODO: find a better prefix. Also conditionalize certain constants based - on number of cores and interrupts actually present. -*/ - -/* - * Copyright (c) 1999-2008 Tensilica Inc. - * - * 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. - */ - -#include - -#define NUM_INTERRUPTS 27 -#define NUM_CORES 4 - -/* Routing of NMI (BInterrupt2) and interrupts 0..n-1 (BInterrupt3+) - RER reads - WER writes - */ - -#define XER_MIROUT 0x0000 -#define XER_MIROUT_LAST (XER_MIROUT + NUM_INTERRUPTS) - - -/* IPI to core M (all 16 causes). - - RER reads - WER clears - */ -#define XER_MIPICAUSE 0x0100 -#define XER_MIPICAUSE_FIELD_A_FIRST 0x0 -#define XER_MIPICAUSE_FIELD_A_LAST 0x0 -#define XER_MIPICAUSE_FIELD_B_FIRST 0x1 -#define XER_MIPICAUSE_FIELD_B_LAST 0x3 -#define XER_MIPICAUSE_FIELD_C_FIRST 0x4 -#define XER_MIPICAUSE_FIELD_C_LAST 0x7 -#define XER_MIPICAUSE_FIELD_D_FIRST 0x8 -#define XER_MIPICAUSE_FIELD_D_LAST 0xF - - -/* IPI from cause bit 0..15 - - RER invalid - WER sets -*/ -#define XER_MIPISET 0x0140 -#define XER_MIPISET_LAST 0x014F - - -/* Global enable - - RER read - WER clear -*/ -#define XER_MIENG 0x0180 - - -/* Global enable - - RER invalid - WER set -*/ -#define XER_MIENG_SET 0x0184 - -/* Global assert - - RER read - WER clear -*/ -#define XER_MIASG 0x0188 - - -/* Global enable - - RER invalid - WER set -*/ -#define XER_MIASG_SET 0x018C - - -/* IPI partition register - - RER read - WER write -*/ -#define XER_PART 0x0190 -#define XER_IPI0 0x0 -#define XER_IPI1 0x1 -#define XER_IPI2 0x2 -#define XER_IPI3 0x3 - -#define XER_PART_ROUTE_IPI(NUM, FIELD) ((NUM) << ((FIELD) << 2)) - -#define XER_PART_ROUTE_IPI_CAUSE(TO_A, TO_B, TO_C, TO_D) \ - (XER_PART_ROUTE_IPI(TO_A, XER_IPI0) | \ - XER_PART_ROUTE_IPI(TO_B, XER_IPI1) | \ - XER_PART_ROUTE_IPI(TO_C, XER_IPI2) | \ - XER_PART_ROUTE_IPI(TO_D, XER_IPI3)) - -#define XER_IPI_WAKE_EXT_INTERRUPT XCHAL_EXTINT0_NUM -#define XER_IPI_WAKE_CAUSE XER_MIPICAUSE_FIELD_C_FIRST -#define XER_IPI_WAKE_ADDRESS (XER_MIPISET + XER_IPI_WAKE_CAUSE) -#define XER_DEFAULT_IPI_ROUTING XER_PART_ROUTE_IPI_CAUSE(XER_IPI1, XER_IPI0, XER_IPI2, XER_IPI3) - - -/* System configuration ID - - RER read - WER invalid -*/ -#define XER_SYSCFGID 0x01A0 - - -/* RunStall to slave processors - - RER read - WER write -*/ -#define XER_MPSCORE 0x0200 - - -/* Cache coherency ON - - RER read - WER write -*/ -#define XER_CCON 0x0220 - - diff --git a/tools/sdk/include/esp32/xtensa/xtruntime-core-state.h b/tools/sdk/include/esp32/xtensa/xtruntime-core-state.h deleted file mode 100644 index 37d203c2159..00000000000 --- a/tools/sdk/include/esp32/xtensa/xtruntime-core-state.h +++ /dev/null @@ -1,212 +0,0 @@ -/* xtruntime-core-state.h - core state save area (used eg. by PSO) */ -/* $Id: //depot/rel/Eaglenest/Xtensa/OS/include/xtensa/xtruntime-core-state.h#1 $ */ - -/* - * Copyright (c) 2012-2013 Tensilica Inc. - * - * 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. - */ - -#ifndef _XTOS_CORE_STATE_H_ -#define _XTOS_CORE_STATE_H_ - -/* Import STRUCT_xxx macros for defining structures: */ -#include -#include -#include - -//#define XTOS_PSO_TEST 1 // uncommented for internal PSO testing only - -#define CORE_STATE_SIGNATURE 0xB1C5AFED // pattern that indicates state was saved - - -/* - * Save area for saving entire core state, such as across Power Shut-Off (PSO). - */ - -STRUCT_BEGIN -STRUCT_FIELD (long,4,CS_SA_,signature) // for checking whether state was saved -STRUCT_FIELD (long,4,CS_SA_,restore_label) -STRUCT_FIELD (long,4,CS_SA_,aftersave_label) -STRUCT_AFIELD(long,4,CS_SA_,areg,XCHAL_NUM_AREGS) -#if XCHAL_HAVE_WINDOWED -STRUCT_AFIELD(long,4,CS_SA_,caller_regs,16) // save a max of 16 caller regs -STRUCT_FIELD (long,4,CS_SA_,caller_regs_saved) // flag to show if caller regs saved -#endif -#if XCHAL_HAVE_PSO_CDM -STRUCT_FIELD (long,4,CS_SA_,pwrctl) -#endif -#if XCHAL_HAVE_WINDOWED -STRUCT_FIELD (long,4,CS_SA_,windowbase) -STRUCT_FIELD (long,4,CS_SA_,windowstart) -#endif -STRUCT_FIELD (long,4,CS_SA_,sar) -#if XCHAL_HAVE_EXCEPTIONS -STRUCT_FIELD (long,4,CS_SA_,epc1) -STRUCT_FIELD (long,4,CS_SA_,ps) -STRUCT_FIELD (long,4,CS_SA_,excsave1) -# ifdef XCHAL_DOUBLEEXC_VECTOR_VADDR -STRUCT_FIELD (long,4,CS_SA_,depc) -# endif -#endif -#if XCHAL_NUM_INTLEVELS + XCHAL_HAVE_NMI >= 2 -STRUCT_AFIELD(long,4,CS_SA_,epc, XCHAL_NUM_INTLEVELS + XCHAL_HAVE_NMI - 1) -STRUCT_AFIELD(long,4,CS_SA_,eps, XCHAL_NUM_INTLEVELS + XCHAL_HAVE_NMI - 1) -STRUCT_AFIELD(long,4,CS_SA_,excsave,XCHAL_NUM_INTLEVELS + XCHAL_HAVE_NMI - 1) -#endif -#if XCHAL_HAVE_LOOPS -STRUCT_FIELD (long,4,CS_SA_,lcount) -STRUCT_FIELD (long,4,CS_SA_,lbeg) -STRUCT_FIELD (long,4,CS_SA_,lend) -#endif -#if XCHAL_HAVE_ABSOLUTE_LITERALS -STRUCT_FIELD (long,4,CS_SA_,litbase) -#endif -#if XCHAL_HAVE_VECBASE -STRUCT_FIELD (long,4,CS_SA_,vecbase) -#endif -#if XCHAL_HAVE_S32C1I && (XCHAL_HW_MIN_VERSION >= XTENSA_HWVERSION_RC_2009_0) /* have ATOMCTL ? */ -STRUCT_FIELD (long,4,CS_SA_,atomctl) -#endif -#if XCHAL_HAVE_PREFETCH -STRUCT_FIELD (long,4,CS_SA_,prefctl) -#endif -#if XCHAL_USE_MEMCTL -STRUCT_FIELD (long,4,CS_SA_,memctl) -#endif -#if XCHAL_HAVE_CCOUNT -STRUCT_FIELD (long,4,CS_SA_,ccount) -STRUCT_AFIELD(long,4,CS_SA_,ccompare, XCHAL_NUM_TIMERS) -#endif -#if XCHAL_HAVE_INTERRUPTS -STRUCT_FIELD (long,4,CS_SA_,intenable) -STRUCT_FIELD (long,4,CS_SA_,interrupt) -#endif -#if XCHAL_HAVE_DEBUG -STRUCT_FIELD (long,4,CS_SA_,icount) -STRUCT_FIELD (long,4,CS_SA_,icountlevel) -STRUCT_FIELD (long,4,CS_SA_,debugcause) -// DDR not saved -# if XCHAL_NUM_DBREAK -STRUCT_AFIELD(long,4,CS_SA_,dbreakc, XCHAL_NUM_DBREAK) -STRUCT_AFIELD(long,4,CS_SA_,dbreaka, XCHAL_NUM_DBREAK) -# endif -# if XCHAL_NUM_IBREAK -STRUCT_AFIELD(long,4,CS_SA_,ibreaka, XCHAL_NUM_IBREAK) -STRUCT_FIELD (long,4,CS_SA_,ibreakenable) -# endif -#endif -#if XCHAL_NUM_MISC_REGS -STRUCT_AFIELD(long,4,CS_SA_,misc,XCHAL_NUM_MISC_REGS) -#endif -#if XCHAL_HAVE_MEM_ECC_PARITY -STRUCT_FIELD (long,4,CS_SA_,mepc) -STRUCT_FIELD (long,4,CS_SA_,meps) -STRUCT_FIELD (long,4,CS_SA_,mesave) -STRUCT_FIELD (long,4,CS_SA_,mesr) -STRUCT_FIELD (long,4,CS_SA_,mecr) -STRUCT_FIELD (long,4,CS_SA_,mevaddr) -#endif - -/* We put this ahead of TLB and other TIE state, - to keep it within S32I/L32I offset range. */ -#if XCHAL_HAVE_CP -STRUCT_FIELD (long,4,CS_SA_,cpenable) -#endif - -/* TLB state */ -#if XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR -STRUCT_AFIELD(long,4,CS_SA_,tlbs,8*2) -#endif -#if XCHAL_HAVE_PTP_MMU -/* Compute number of auto-refill (ARF) entries as max of I and D, - to simplify TLB save logic. On the unusual configs with - ITLB ARF != DTLB ARF entries, we'll just end up - saving/restoring some extra entries redundantly. */ -# if XCHAL_DTLB_ARF_ENTRIES_LOG2 + XCHAL_ITLB_ARF_ENTRIES_LOG2 > 4 -# define ARF_ENTRIES 8 -# else -# define ARF_ENTRIES 4 -# endif -STRUCT_FIELD (long,4,CS_SA_,ptevaddr) -STRUCT_FIELD (long,4,CS_SA_,rasid) -STRUCT_FIELD (long,4,CS_SA_,dtlbcfg) -STRUCT_FIELD (long,4,CS_SA_,itlbcfg) -/*** WARNING: past this point, field offsets may be larger than S32I/L32I range ***/ -STRUCT_AFIELD(long,4,CS_SA_,tlbs,((4*ARF_ENTRIES+4)*2+3)*2) -# if XCHAL_HAVE_SPANNING_WAY /* MMU v3 */ -STRUCT_AFIELD(long,4,CS_SA_,tlbs_ways56,(4+8)*2*2) -# endif -#endif - -/* TIE state */ -/* NOTE: NCP area is aligned to XCHAL_TOTAL_SA_ALIGN not XCHAL_NCP_SA_ALIGN, - because the offsets of all subsequent coprocessor save areas are relative - to the NCP save area. */ -STRUCT_AFIELD_A(char,1,XCHAL_TOTAL_SA_ALIGN,CS_SA_,ncp,XCHAL_NCP_SA_SIZE) -#if XCHAL_HAVE_CP -STRUCT_AFIELD_A(char,1,XCHAL_CP0_SA_ALIGN,CS_SA_,cp0,XCHAL_CP0_SA_SIZE) -STRUCT_AFIELD_A(char,1,XCHAL_CP1_SA_ALIGN,CS_SA_,cp1,XCHAL_CP1_SA_SIZE) -STRUCT_AFIELD_A(char,1,XCHAL_CP2_SA_ALIGN,CS_SA_,cp2,XCHAL_CP2_SA_SIZE) -STRUCT_AFIELD_A(char,1,XCHAL_CP3_SA_ALIGN,CS_SA_,cp3,XCHAL_CP3_SA_SIZE) -STRUCT_AFIELD_A(char,1,XCHAL_CP4_SA_ALIGN,CS_SA_,cp4,XCHAL_CP4_SA_SIZE) -STRUCT_AFIELD_A(char,1,XCHAL_CP5_SA_ALIGN,CS_SA_,cp5,XCHAL_CP5_SA_SIZE) -STRUCT_AFIELD_A(char,1,XCHAL_CP6_SA_ALIGN,CS_SA_,cp6,XCHAL_CP6_SA_SIZE) -STRUCT_AFIELD_A(char,1,XCHAL_CP7_SA_ALIGN,CS_SA_,cp7,XCHAL_CP7_SA_SIZE) -//STRUCT_AFIELD_A(char,1,XCHAL_CP8_SA_ALIGN,CS_SA_,cp8,XCHAL_CP8_SA_SIZE) -//STRUCT_AFIELD_A(char,1,XCHAL_CP9_SA_ALIGN,CS_SA_,cp9,XCHAL_CP9_SA_SIZE) -//STRUCT_AFIELD_A(char,1,XCHAL_CP10_SA_ALIGN,CS_SA_,cp10,XCHAL_CP10_SA_SIZE) -//STRUCT_AFIELD_A(char,1,XCHAL_CP11_SA_ALIGN,CS_SA_,cp11,XCHAL_CP11_SA_SIZE) -//STRUCT_AFIELD_A(char,1,XCHAL_CP12_SA_ALIGN,CS_SA_,cp12,XCHAL_CP12_SA_SIZE) -//STRUCT_AFIELD_A(char,1,XCHAL_CP13_SA_ALIGN,CS_SA_,cp13,XCHAL_CP13_SA_SIZE) -//STRUCT_AFIELD_A(char,1,XCHAL_CP14_SA_ALIGN,CS_SA_,cp14,XCHAL_CP14_SA_SIZE) -//STRUCT_AFIELD_A(char,1,XCHAL_CP15_SA_ALIGN,CS_SA_,cp15,XCHAL_CP15_SA_SIZE) -#endif - -STRUCT_END(XtosCoreState) - - - -// These are part of non-coprocessor state (ncp): -#if XCHAL_HAVE_MAC16 -//STRUCT_FIELD (long,4,CS_SA_,acclo) -//STRUCT_FIELD (long,4,CS_SA_,acchi) -//STRUCT_AFIELD(long,4,CS_SA_,mr, 4) -#endif -#if XCHAL_HAVE_THREADPTR -//STRUCT_FIELD (long,4,CS_SA_,threadptr) -#endif -#if XCHAL_HAVE_S32C1I -//STRUCT_FIELD (long,4,CS_SA_,scompare1) -#endif -#if XCHAL_HAVE_BOOLEANS -//STRUCT_FIELD (long,4,CS_SA_,br) -#endif - -// Not saved: -// EXCCAUSE ?? -// DEBUGCAUSE ?? -// EXCVADDR ?? -// DDR -// INTERRUPT -// ... locked cache lines ... - -#endif /* _XTOS_CORE_STATE_H_ */ - diff --git a/tools/sdk/include/esp32/xtensa/xtruntime-frames.h b/tools/sdk/include/esp32/xtensa/xtruntime-frames.h deleted file mode 100644 index 8b5a7463abe..00000000000 --- a/tools/sdk/include/esp32/xtensa/xtruntime-frames.h +++ /dev/null @@ -1,162 +0,0 @@ -/* xtruntime-frames.h - exception stack frames for single-threaded run-time */ -/* $Id: //depot/rel/Eaglenest/Xtensa/OS/include/xtensa/xtruntime-frames.h#1 $ */ - -/* - * Copyright (c) 2002-2012 Tensilica Inc. - * - * 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. - */ - -#ifndef _XTRUNTIME_FRAMES_H_ -#define _XTRUNTIME_FRAMES_H_ - -#include - -/* Macros that help define structures for both C and assembler: */ -#if defined(_ASMLANGUAGE) || defined(__ASSEMBLER__) -#define STRUCT_BEGIN .pushsection .text; .struct 0 -#define STRUCT_FIELD(ctype,size,pre,name) pre##name: .space size -#define STRUCT_AFIELD(ctype,size,pre,name,n) pre##name: .if n ; .space (size)*(n) ; .endif -#define STRUCT_AFIELD_A(ctype,size,align,pre,name,n) .balign align ; pre##name: .if n ; .space (size)*(n) ; .endif -#define STRUCT_END(sname) sname##Size:; .popsection -#else /*_ASMLANGUAGE||__ASSEMBLER__*/ -#define STRUCT_BEGIN typedef struct { -#define STRUCT_FIELD(ctype,size,pre,name) ctype name; -#define STRUCT_AFIELD(ctype,size,pre,name,n) ctype name[n]; -#define STRUCT_AFIELD_A(ctype,size,align,pre,name,n) ctype name[n] __attribute__((aligned(align))); -#define STRUCT_END(sname) } sname; -#endif /*_ASMLANGUAGE||__ASSEMBLER__*/ - - -/* - * Kernel vector mode exception stack frame. - * - * NOTE: due to the limited range of addi used in the current - * kernel exception vector, and the fact that historically - * the vector is limited to 12 bytes, the size of this - * stack frame is limited to 128 bytes (currently at 64). - */ -STRUCT_BEGIN -STRUCT_FIELD (long,4,KEXC_,pc) /* "parm" */ -STRUCT_FIELD (long,4,KEXC_,ps) -STRUCT_AFIELD(long,4,KEXC_,areg, 4) /* a12 .. a15 */ -STRUCT_FIELD (long,4,KEXC_,sar) /* "save" */ -#if XCHAL_HAVE_LOOPS -STRUCT_FIELD (long,4,KEXC_,lcount) -STRUCT_FIELD (long,4,KEXC_,lbeg) -STRUCT_FIELD (long,4,KEXC_,lend) -#endif -#if XCHAL_HAVE_MAC16 -STRUCT_FIELD (long,4,KEXC_,acclo) -STRUCT_FIELD (long,4,KEXC_,acchi) -STRUCT_AFIELD(long,4,KEXC_,mr, 4) -#endif -STRUCT_END(KernelFrame) - - -/* - * User vector mode exception stack frame: - * - * WARNING: if you modify this structure, you MUST modify the - * computation of the pad size (ALIGNPAD) accordingly. - */ -STRUCT_BEGIN -STRUCT_FIELD (long,4,UEXC_,pc) -STRUCT_FIELD (long,4,UEXC_,ps) -STRUCT_FIELD (long,4,UEXC_,sar) -STRUCT_FIELD (long,4,UEXC_,vpri) -#ifdef __XTENSA_CALL0_ABI__ -STRUCT_FIELD (long,4,UEXC_,a0) -#endif -STRUCT_FIELD (long,4,UEXC_,a2) -STRUCT_FIELD (long,4,UEXC_,a3) -STRUCT_FIELD (long,4,UEXC_,a4) -STRUCT_FIELD (long,4,UEXC_,a5) -#ifdef __XTENSA_CALL0_ABI__ -STRUCT_FIELD (long,4,UEXC_,a6) -STRUCT_FIELD (long,4,UEXC_,a7) -STRUCT_FIELD (long,4,UEXC_,a8) -STRUCT_FIELD (long,4,UEXC_,a9) -STRUCT_FIELD (long,4,UEXC_,a10) -STRUCT_FIELD (long,4,UEXC_,a11) -STRUCT_FIELD (long,4,UEXC_,a12) -STRUCT_FIELD (long,4,UEXC_,a13) -STRUCT_FIELD (long,4,UEXC_,a14) -STRUCT_FIELD (long,4,UEXC_,a15) -#endif -STRUCT_FIELD (long,4,UEXC_,exccause) /* NOTE: can probably rid of this one (pass direct) */ -#if XCHAL_HAVE_LOOPS -STRUCT_FIELD (long,4,UEXC_,lcount) -STRUCT_FIELD (long,4,UEXC_,lbeg) -STRUCT_FIELD (long,4,UEXC_,lend) -#endif -#if XCHAL_HAVE_MAC16 -STRUCT_FIELD (long,4,UEXC_,acclo) -STRUCT_FIELD (long,4,UEXC_,acchi) -STRUCT_AFIELD(long,4,UEXC_,mr, 4) -#endif -/* ALIGNPAD is the 16-byte alignment padding. */ -#ifdef __XTENSA_CALL0_ABI__ -# define CALL0_ABI 1 -#else -# define CALL0_ABI 0 -#endif -#define ALIGNPAD ((3 + XCHAL_HAVE_LOOPS*1 + XCHAL_HAVE_MAC16*2 + CALL0_ABI*1) & 3) -#if ALIGNPAD -STRUCT_AFIELD(long,4,UEXC_,pad, ALIGNPAD) /* 16-byte alignment padding */ -#endif -/*STRUCT_AFIELD_A(char,1,XCHAL_CPEXTRA_SA_ALIGN,UEXC_,ureg, (XCHAL_CPEXTRA_SA_SIZE+3)&-4)*/ /* not used */ -STRUCT_END(UserFrame) - - -#if defined(_ASMLANGUAGE) || defined(__ASSEMBLER__) - - -/* Check for UserFrameSize small enough not to require rounding...: */ - /* Skip 16-byte save area, then 32-byte space for 8 regs of call12 - * (which overlaps with 16-byte GCC nested func chaining area), - * then exception stack frame: */ - .set UserFrameTotalSize, 16+32+UserFrameSize - /* Greater than 112 bytes? (max range of ADDI, both signs, when aligned to 16 bytes): */ - .ifgt UserFrameTotalSize-112 - /* Round up to 256-byte multiple to accelerate immediate adds: */ - .set UserFrameTotalSize, ((UserFrameTotalSize+255) & 0xFFFFFF00) - .endif -# define ESF_TOTALSIZE UserFrameTotalSize - -#endif /* _ASMLANGUAGE || __ASSEMBLER__ */ - - -#if XCHAL_NUM_CONTEXTS > 1 -/* Structure of info stored on new context's stack for setup: */ -STRUCT_BEGIN -STRUCT_FIELD (long,4,INFO_,sp) -STRUCT_FIELD (long,4,INFO_,arg1) -STRUCT_FIELD (long,4,INFO_,funcpc) -STRUCT_FIELD (long,4,INFO_,prevps) -STRUCT_END(SetupInfo) -#endif - - -#define KERNELSTACKSIZE 1024 - - -#endif /* _XTRUNTIME_FRAMES_H_ */ - diff --git a/tools/sdk/include/esp32/xtensa/xtruntime.h b/tools/sdk/include/esp32/xtensa/xtruntime.h deleted file mode 100644 index 9dae1f4b23e..00000000000 --- a/tools/sdk/include/esp32/xtensa/xtruntime.h +++ /dev/null @@ -1,221 +0,0 @@ -/* - * xtruntime.h -- general C definitions for single-threaded run-time - * - * Copyright (c) 2002-2013 Tensilica Inc. - * - * 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. - */ - -#ifndef XTRUNTIME_H -#define XTRUNTIME_H - -#include -#include -#include - -#ifndef XTSTR -#define _XTSTR(x) # x -#define XTSTR(x) _XTSTR(x) -#endif - -/* _xtos_core_shutoff() flags parameter values: */ -#define XTOS_KEEPON_MEM 0x00000100 /* ==PWRCTL_MEM_WAKEUP */ -#define XTOS_KEEPON_MEM_SHIFT 8 -#define XTOS_KEEPON_DEBUG 0x00001000 /* ==PWRCTL_DEBUG_WAKEUP */ -#define XTOS_KEEPON_DEBUG_SHIFT 12 - -#define XTOS_COREF_PSO 0x00000001 /* do power shutoff */ -#define XTOS_COREF_PSO_SHIFT 0 - -#define _xtos_set_execption_handler _xtos_set_exception_handler /* backward compatibility */ -#define _xtos_set_saved_intenable _xtos_ints_on /* backward compatibility */ -#define _xtos_clear_saved_intenable _xtos_ints_off /* backward compatibility */ - -#if !defined(_ASMLANGUAGE) && !defined(__ASSEMBLER__) - -#ifdef __cplusplus -extern "C" { -#endif - -/*typedef void (_xtos_timerdelta_func)(int);*/ -#ifdef __cplusplus -typedef void (_xtos_handler_func)(...); -#else -typedef void (_xtos_handler_func)(); -#endif -typedef _xtos_handler_func *_xtos_handler; - -/* - * unsigned XTOS_SET_INTLEVEL(int intlevel); - * This macro sets the current interrupt level. - * The 'intlevel' parameter must be a constant. - * This macro returns a 32-bit value that must be passed to - * XTOS_RESTORE_INTLEVEL() to restore the previous interrupt level. - * XTOS_RESTORE_JUST_INTLEVEL() also does this, but in XEA2 configs - * it restores only PS.INTLEVEL rather than the entire PS register - * and thus is slower. - */ -#if !XCHAL_HAVE_INTERRUPTS -# define XTOS_SET_INTLEVEL(intlevel) 0 -# define XTOS_SET_MIN_INTLEVEL(intlevel) 0 -# define XTOS_RESTORE_INTLEVEL(restoreval) -# define XTOS_RESTORE_JUST_INTLEVEL(restoreval) -#elif XCHAL_HAVE_XEA2 -/* In XEA2, we can simply safely set PS.INTLEVEL directly: */ -/* NOTE: these asm macros don't modify memory, but they are marked - * as such to act as memory access barriers to the compiler because - * these macros are sometimes used to delineate critical sections; - * function calls are natural barriers (the compiler does not know - * whether a function modifies memory) unless declared to be inlined. */ -# define XTOS_SET_INTLEVEL(intlevel) ({ unsigned __tmp; \ - __asm__ __volatile__( "rsil %0, " XTSTR(intlevel) "\n" \ - : "=a" (__tmp) : : "memory" ); \ - __tmp;}) -# define XTOS_SET_MIN_INTLEVEL(intlevel) ({ unsigned __tmp, __tmp2, __tmp3; \ - __asm__ __volatile__( "rsr %0, " XTSTR(PS) "\n" /* get old (current) PS.INTLEVEL */ \ - "movi %2, " XTSTR(intlevel) "\n" \ - "extui %1, %0, 0, 4\n" /* keep only INTLEVEL bits of parameter */ \ - "blt %2, %1, 1f\n" \ - "rsil %0, " XTSTR(intlevel) "\n" \ - "1:\n" \ - : "=a" (__tmp), "=&a" (__tmp2), "=&a" (__tmp3) : : "memory" ); \ - __tmp;}) -# define XTOS_RESTORE_INTLEVEL(restoreval) do{ unsigned __tmp = (restoreval); \ - __asm__ __volatile__( "wsr %0, " XTSTR(PS) " ; rsync\n" \ - : : "a" (__tmp) : "memory" ); \ - }while(0) -# define XTOS_RESTORE_JUST_INTLEVEL(restoreval) _xtos_set_intlevel(restoreval) -#else -/* In XEA1, we have to rely on INTENABLE register virtualization: */ -extern unsigned _xtos_set_vpri( unsigned vpri ); -extern unsigned _xtos_vpri_enabled; /* current virtual priority */ -# define XTOS_SET_INTLEVEL(intlevel) _xtos_set_vpri(~XCHAL_INTLEVEL_ANDBELOW_MASK(intlevel)) -# define XTOS_SET_MIN_INTLEVEL(intlevel) _xtos_set_vpri(_xtos_vpri_enabled & ~XCHAL_INTLEVEL_ANDBELOW_MASK(intlevel)) -# define XTOS_RESTORE_INTLEVEL(restoreval) _xtos_set_vpri(restoreval) -# define XTOS_RESTORE_JUST_INTLEVEL(restoreval) _xtos_set_vpri(restoreval) -#endif - -/* - * The following macros build upon the above. They are generally used - * instead of invoking the SET_INTLEVEL and SET_MIN_INTLEVEL macros directly. - * They all return a value that can be used with XTOS_RESTORE_INTLEVEL() - * or _xtos_restore_intlevel() or _xtos_restore_just_intlevel() to restore - * the effective interrupt level to what it was before the macro was invoked. - * In XEA2, the DISABLE macros are much faster than the MASK macros - * (in all configs, DISABLE sets the effective interrupt level, whereas MASK - * makes ensures the effective interrupt level is at least the level given - * without lowering it; in XEA2 with INTENABLE virtualization, these macros - * affect PS.INTLEVEL only, not the virtual priority, so DISABLE has partial - * MASK semantics). - * - * A typical critical section sequence might be: - * unsigned rval = XTOS_DISABLE_EXCM_INTERRUPTS; - * ... critical section ... - * XTOS_RESTORE_INTLEVEL(rval); - */ -/* Enable all interrupts (those activated with _xtos_ints_on()): */ -#define XTOS_ENABLE_INTERRUPTS XTOS_SET_INTLEVEL(0) -/* Disable low priority level interrupts (they can interact with the OS): */ -#define XTOS_DISABLE_LOWPRI_INTERRUPTS XTOS_SET_INTLEVEL(XCHAL_NUM_LOWPRI_LEVELS) -#define XTOS_MASK_LOWPRI_INTERRUPTS XTOS_SET_MIN_INTLEVEL(XCHAL_NUM_LOWPRI_LEVELS) -/* Disable interrupts that can interact with the OS: */ -#define XTOS_DISABLE_EXCM_INTERRUPTS XTOS_SET_INTLEVEL(XCHAL_EXCM_LEVEL) -#define XTOS_MASK_EXCM_INTERRUPTS XTOS_SET_MIN_INTLEVEL(XCHAL_EXCM_LEVEL) -#if 0 /* XTOS_LOCK_LEVEL is not exported to applications */ -/* Disable interrupts that can interact with the OS, or manipulate virtual INTENABLE: */ -#define XTOS_DISABLE_LOCK_INTERRUPTS XTOS_SET_INTLEVEL(XTOS_LOCK_LEVEL) -#define XTOS_MASK_LOCK_INTERRUPTS XTOS_SET_MIN_INTLEVEL(XTOS_LOCK_LEVEL) -#endif -/* Disable ALL interrupts (not for common use, particularly if one's processor - * configuration has high-level interrupts and one cares about their latency): */ -#define XTOS_DISABLE_ALL_INTERRUPTS XTOS_SET_INTLEVEL(15) - - -extern unsigned int _xtos_ints_off( unsigned int mask ); -extern unsigned int _xtos_ints_on( unsigned int mask ); -extern unsigned _xtos_set_intlevel( int intlevel ); -extern unsigned _xtos_set_min_intlevel( int intlevel ); -extern unsigned _xtos_restore_intlevel( unsigned restoreval ); -extern unsigned _xtos_restore_just_intlevel( unsigned restoreval ); -extern _xtos_handler _xtos_set_interrupt_handler( int n, _xtos_handler f ); -extern _xtos_handler _xtos_set_interrupt_handler_arg( int n, _xtos_handler f, void *arg ); -extern _xtos_handler _xtos_set_exception_handler( int n, _xtos_handler f ); - -extern void _xtos_memep_initrams( void ); -extern void _xtos_memep_enable( int flags ); - -/* For use with the tiny LSP (see LSP reference manual). */ -#if XCHAL_NUM_INTLEVELS >= 1 -extern void _xtos_dispatch_level1_interrupts( void ); -#endif -#if XCHAL_NUM_INTLEVELS >= 2 -extern void _xtos_dispatch_level2_interrupts( void ); -#endif -#if XCHAL_NUM_INTLEVELS >= 3 -extern void _xtos_dispatch_level3_interrupts( void ); -#endif -#if XCHAL_NUM_INTLEVELS >= 4 -extern void _xtos_dispatch_level4_interrupts( void ); -#endif -#if XCHAL_NUM_INTLEVELS >= 5 -extern void _xtos_dispatch_level5_interrupts( void ); -#endif -#if XCHAL_NUM_INTLEVELS >= 6 -extern void _xtos_dispatch_level6_interrupts( void ); -#endif - -/* Deprecated (but kept because they were documented): */ -extern unsigned int _xtos_read_ints( void ); /* use xthal_get_interrupt() instead */ -extern void _xtos_clear_ints( unsigned int mask ); /* use xthal_set_intclear() instead */ - - -/* Power shut-off related routines. */ -extern int _xtos_core_shutoff(unsigned flags); -extern int _xtos_core_save(unsigned flags, XtosCoreState *savearea, void *code); -extern void _xtos_core_restore(unsigned retvalue, XtosCoreState *savearea); - - -#if XCHAL_NUM_CONTEXTS > 1 -extern unsigned _xtos_init_context(int context_num, int stack_size, - _xtos_handler_func *start_func, int arg1); -#endif - -/* Deprecated: */ -#if XCHAL_NUM_TIMERS > 0 -extern void _xtos_timer_0_delta( int cycles ); -#endif -#if XCHAL_NUM_TIMERS > 1 -extern void _xtos_timer_1_delta( int cycles ); -#endif -#if XCHAL_NUM_TIMERS > 2 -extern void _xtos_timer_2_delta( int cycles ); -#endif -#if XCHAL_NUM_TIMERS > 3 -extern void _xtos_timer_3_delta( int cycles ); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* !_ASMLANGUAGE && !__ASSEMBLER__ */ - -#endif /* XTRUNTIME_H */ - diff --git a/tools/sdk/include/esp_adc_cal/esp_adc_cal.h b/tools/sdk/include/esp_adc_cal/esp_adc_cal.h deleted file mode 100644 index af611357b49..00000000000 --- a/tools/sdk/include/esp_adc_cal/esp_adc_cal.h +++ /dev/null @@ -1,152 +0,0 @@ -// 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. - -#ifndef __ESP_ADC_CAL_H__ -#define __ESP_ADC_CAL_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include "esp_err.h" -#include "driver/adc.h" - -/** - * @brief Type of calibration value used in characterization - */ -typedef enum { - ESP_ADC_CAL_VAL_EFUSE_VREF = 0, /**< Characterization based on reference voltage stored in eFuse*/ - ESP_ADC_CAL_VAL_EFUSE_TP = 1, /**< Characterization based on Two Point values stored in eFuse*/ - ESP_ADC_CAL_VAL_DEFAULT_VREF = 2, /**< Characterization based on default reference voltage*/ -} esp_adc_cal_value_t; - -/** - * @brief Structure storing characteristics of an ADC - * - * @note Call esp_adc_cal_characterize() to initialize the structure - */ -typedef struct { - adc_unit_t adc_num; /**< ADC number*/ - adc_atten_t atten; /**< ADC attenuation*/ - adc_bits_width_t bit_width; /**< ADC bit width */ - uint32_t coeff_a; /**< Gradient of ADC-Voltage curve*/ - uint32_t coeff_b; /**< Offset of ADC-Voltage curve*/ - uint32_t vref; /**< Vref used by lookup table*/ - const uint32_t *low_curve; /**< Pointer to low Vref curve of lookup table (NULL if unused)*/ - const uint32_t *high_curve; /**< Pointer to high Vref curve of lookup table (NULL if unused)*/ -} esp_adc_cal_characteristics_t; - -/** - * @brief Checks if ADC calibration values are burned into eFuse - * - * This function checks if ADC reference voltage or Two Point values have been - * burned to the eFuse of the current ESP32 - * - * @param value_type Type of calibration value (ESP_ADC_CAL_VAL_EFUSE_VREF or ESP_ADC_CAL_VAL_EFUSE_TP) - * - * @return - * - ESP_OK: The calibration mode is supported in eFuse - * - ESP_ERR_NOT_SUPPORTED: Error, eFuse values are not burned - * - ESP_ERR_INVALID_ARG: Error, invalid argument (ESP_ADC_CAL_VAL_DEFAULT_VREF) - */ -esp_err_t esp_adc_cal_check_efuse(esp_adc_cal_value_t value_type); - -/** - * @brief Characterize an ADC at a particular attenuation - * - * This function will characterize the ADC at a particular attenuation and generate - * the ADC-Voltage curve in the form of [y = coeff_a * x + coeff_b]. - * Characterization can be based on Two Point values, eFuse Vref, or default Vref - * and the calibration values will be prioritized in that order. - * - * @note Two Point values and eFuse Vref can be enabled/disabled using menuconfig. - * - * @param[in] adc_num ADC to characterize (ADC_UNIT_1 or ADC_UNIT_2) - * @param[in] atten Attenuation to characterize - * @param[in] bit_width Bit width configuration of ADC - * @param[in] default_vref Default ADC reference voltage in mV (used if eFuse values is not available) - * @param[out] chars Pointer to empty structure used to store ADC characteristics - * - * @return - * - ESP_ADC_CAL_VAL_EFUSE_VREF: eFuse Vref used for characterization - * - ESP_ADC_CAL_VAL_EFUSE_TP: Two Point value used for characterization (only in Linear Mode) - * - ESP_ADC_CAL_VAL_DEFAULT_VREF: Default Vref used for characterization - */ -esp_adc_cal_value_t esp_adc_cal_characterize(adc_unit_t adc_num, - adc_atten_t atten, - adc_bits_width_t bit_width, - uint32_t default_vref, - esp_adc_cal_characteristics_t *chars); - -/** - * @brief Convert an ADC reading to voltage in mV - * - * This function converts an ADC reading to a voltage in mV based on the ADC's - * characteristics. - * - * @note Characteristics structure must be initialized before this function - * is called (call esp_adc_cal_characterize()) - * - * @param[in] adc_reading ADC reading - * @param[in] chars Pointer to initialized structure containing ADC characteristics - * - * @return Voltage in mV - */ -uint32_t esp_adc_cal_raw_to_voltage(uint32_t adc_reading, const esp_adc_cal_characteristics_t *chars); - -/** - * @brief Reads an ADC and converts the reading to a voltage in mV - * - * This function reads an ADC then converts the raw reading to a voltage in mV - * based on the characteristics provided. The ADC that is read is also - * determined by the characteristics. - * - * @note The Characteristics structure must be initialized before this - * function is called (call esp_adc_cal_characterize()) - * - * @param[in] channel ADC Channel to read - * @param[in] chars Pointer to initialized ADC characteristics structure - * @param[out] voltage Pointer to store converted voltage - * - * @return - * - ESP_OK: ADC read and converted to mV - * - ESP_ERR_TIMEOUT: Error, timed out attempting to read ADC - * - ESP_ERR_INVALID_ARG: Error due to invalid arguments - */ -esp_err_t esp_adc_cal_get_voltage(adc_channel_t channel, const esp_adc_cal_characteristics_t *chars, uint32_t *voltage); - -/* -------------------------- Deprecated API ------------------------------- */ - -/** @cond */ //Doxygen command to hide deprecated function from API Reference -/** - * @deprecated ADC1 characterization function. Deprecated in order to accommodate - * ADC2 and eFuse functionality. Use esp_adc_cal_characterize() instead - */ -void esp_adc_cal_get_characteristics(uint32_t vref, adc_atten_t atten, adc_bits_width_t bit_width, esp_adc_cal_characteristics_t *chars) __attribute__((deprecated)); - -/* - * @deprecated This function reads ADC1 and returns the corrected voltage. This - * has been deprecated in order to accommodate ADC2 support. Use the - * new function esp_adc_cal_get_voltage() instead. - */ -uint32_t adc1_to_voltage(adc1_channel_t channel, const esp_adc_cal_characteristics_t *chars) __attribute__((deprecated)); - -/** @endcond */ - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_ADC_CAL_H__ */ diff --git a/tools/sdk/include/esp_event/esp_event.h b/tools/sdk/include/esp_event/esp_event.h deleted file mode 100644 index f095844a72b..00000000000 --- a/tools/sdk/include/esp_event/esp_event.h +++ /dev/null @@ -1,336 +0,0 @@ -// 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. - -#ifndef ESP_EVENT_H_ -#define ESP_EVENT_H_ - -#include "esp_err.h" - -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "freertos/queue.h" -#include "freertos/semphr.h" - -#include "esp_event_base.h" -#include "esp_event_legacy.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -/// Configuration for creating event loops -typedef struct { - int32_t queue_size; /**< size of the event loop queue */ - const char* task_name; /**< name of the event loop task; if NULL, - a dedicated task is not created for event loop*/ - UBaseType_t task_priority; /**< priority of the event loop task, ignored if task name is NULL */ - uint32_t task_stack_size; /**< stack size of the event loop task, ignored if task name is NULL */ - BaseType_t task_core_id; /**< core to which the event loop task is pinned to, - ignored if task name is NULL */ -} esp_event_loop_args_t; - -/** - * @brief Create a new event loop. - * - * @param[in] event_loop_args configuration structure for the event loop to create - * @param[out] event_loop handle to the created event loop - * - * @return - * - ESP_OK: Success - * - ESP_ERR_NO_MEM: Cannot allocate memory for event loops list - * - ESP_FAIL: Failed to create task loop - * - Others: Fail - */ -esp_err_t esp_event_loop_create(const esp_event_loop_args_t* event_loop_args, esp_event_loop_handle_t* event_loop); - -/** - * @brief Delete an existing event loop. - * - * @param[in] event_loop event loop to delete - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t esp_event_loop_delete(esp_event_loop_handle_t event_loop); - -/** - * @brief Create default event loop - * - * @return - * - ESP_OK: Success - * - ESP_ERR_NO_MEM: Cannot allocate memory for event loops list - * - ESP_FAIL: Failed to create task loop - * - Others: Fail - */ -esp_err_t esp_event_loop_create_default(); - -/** - * @brief Delete the default event loop - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t esp_event_loop_delete_default(); - -/** - * @brief Dispatch events posted to an event loop. - * - * This function is used to dispatch events posted to a loop with no dedicated task, i.e task name was set to NULL - * in event_loop_args argument during loop creation. This function includes an argument to limit the amount of time - * it runs, returning control to the caller when that time expires (or some time afterwards). There is no guarantee - * that a call to this function will exit at exactly the time of expiry. There is also no guarantee that events have - * been dispatched during the call, as the function might have spent all of the alloted time waiting on the event queue. - * Once an event has been unqueued, however, it is guaranteed to be dispatched. This guarantee contributes to not being - * able to exit exactly at time of expiry as (1) blocking on internal mutexes is necessary for dispatching the unqueued - * event, and (2) during dispatch of the unqueued event there is no way to control the time occupied by handler code - * execution. The guaranteed time of exit is therefore the alloted time + amount of time required to dispatch - * the last unqueued event. - * - * In cases where waiting on the queue times out, ESP_OK is returned and not ESP_ERR_TIMEOUT, since it is - * normal behavior. - * - * @param[in] event_loop event loop to dispatch posted events from - * @param[in] ticks_to_run number of ticks to run the loop - * - * @note encountering an unknown event that has been posted to the loop will only generate a warning, not an error. - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t esp_event_loop_run(esp_event_loop_handle_t event_loop, TickType_t ticks_to_run); - -/** - * @brief Register an event handler to the system event loop. - * - * This function can be used to register a handler for either: (1) specific events, - * (2) all events of a certain event base, or (3) all events known by the system event loop. - * - * - specific events: specify exact event_base and event_id - * - all events of a certain base: specify exact event_base and use ESP_EVENT_ANY_ID as the event_id - * - all events known by the loop: use ESP_EVENT_ANY_BASE for event_base and ESP_EVENT_ANY_ID as the event_id - * - * Registering multiple handlers to events is possible. Registering a single handler to multiple events is - * also possible. However, registering the same handler to the same event multiple times would cause the - * previous registrations to be overwritten. - * - * @param[in] event_base the base id of the event to register the handler for - * @param[in] event_id the id of the event to register the handler for - * @param[in] event_handler the handler function which gets called when the event is dispatched - * @param[in] event_handler_arg data, aside from event data, that is passed to the handler when it is called - * - * @note the event loop library does not maintain a copy of event_handler_arg, therefore the user should - * ensure that event_handler_arg still points to a valid location by the time the handler gets called - * - * @return - * - ESP_OK: Success - * - ESP_ERR_NO_MEM: Cannot allocate memory for the handler - * - ESP_ERR_INVALIG_ARG: Invalid combination of event base and event id - * - Others: Fail - */ -esp_err_t esp_event_handler_register(esp_event_base_t event_base, - int32_t event_id, - esp_event_handler_t event_handler, - void* event_handler_arg); - -/** - * @brief Register an event handler to a specific loop. - * - * This function behaves in the same manner as esp_event_handler_register, except the additional - * specification of the event loop to register the handler to. - * - * @param[in] event_loop the event loop to register this handler function to - * @param[in] event_base the base id of the event to register the handler for - * @param[in] event_id the id of the event to register the handler for - * @param[in] event_handler the handler function which gets called when the event is dispatched - * @param[in] event_handler_arg data, aside from event data, that is passed to the handler when it is called - * - * @return - * - ESP_OK: Success - * - ESP_ERR_NO_MEM: Cannot allocate memory for the handler - * - ESP_ERR_INVALIG_ARG: Invalid combination of event base and event id - * - Others: Fail - */ -esp_err_t esp_event_handler_register_with(esp_event_loop_handle_t event_loop, - esp_event_base_t event_base, - int32_t event_id, - esp_event_handler_t event_handler, - void* event_handler_arg); - -/** - * @brief Unregister a handler with the system event loop. - * - * This function can be used to unregister a handler so that it no longer gets called during dispatch. - * Handlers can be unregistered for either: (1) specific events, (2) all events of a certain event base, - * or (3) all events known by the system event loop - * - * - specific events: specify exact event_base and event_id - * - all events of a certain base: specify exact event_base and use ESP_EVENT_ANY_ID as the event_id - * - all events known by the loop: use ESP_EVENT_ANY_BASE for event_base and ESP_EVENT_ANY_ID as the event_id - * - * This function ignores unregistration of handlers that has not been previously registered. - * - * @param[in] event_base the base of the event with which to unregister the handler - * @param[in] event_id the id of the event with which to unregister the handler - * @param[in] event_handler the handler to unregister - * - * @return ESP_OK success - * @return ESP_ERR_INVALIG_ARG invalid combination of event base and event id - * @return others fail - */ -esp_err_t esp_event_handler_unregister(esp_event_base_t event_base, int32_t event_id, esp_event_handler_t event_handler); - -/** - * @brief Unregister a handler with the system event loop. - * - * This function behaves in the same manner as esp_event_handler_unregister, except the additional specification of - * the event loop to unregister the handler with. - * - * @param[in] event_loop the event loop with which to unregister this handler function - * @param[in] event_base the base of the event with which to unregister the handler - * @param[in] event_id the id of the event with which to unregister the handler - * @param[in] event_handler the handler to unregister - * - * @return - * - ESP_OK: Success - * - ESP_ERR_INVALIG_ARG: Invalid combination of event base and event id - * - Others: Fail - */ -esp_err_t esp_event_handler_unregister_with(esp_event_loop_handle_t event_loop, - esp_event_base_t event_base, - int32_t event_id, - esp_event_handler_t event_handler); - -/** - * @brief Posts an event to the system default event loop. The event loop library keeps a copy of event_data and manages - * the copy's lifetime automatically (allocation + deletion); this ensures that the data the - * handler recieves is always valid. - * - * @param[in] event_base the event base that identifies the event - * @param[in] event_id the the event id that identifies the event - * @param[in] event_data the data, specific to the event occurence, that gets passed to the handler - * @param[in] event_data_size the size of the event data - * @param[in] ticks_to_wait number of ticks to block on a full event queue - * - * @note posting events from an ISR is not supported - * - * @return - * - ESP_OK: Success - * - ESP_ERR_TIMEOUT: Time to wait for event queue to unblock expired - * - ESP_ERR_INVALIG_ARG: Invalid combination of event base and event id - * - Others: Fail - */ -esp_err_t esp_event_post(esp_event_base_t event_base, - int32_t event_id, - void* event_data, - size_t event_data_size, - TickType_t ticks_to_wait); - -/** - * @brief Posts an event to the specified event loop. The event loop library keeps a copy of event_data and manages - * the copy's lifetime automatically (allocation + deletion); this ensures that the data the - * handler recieves is always valid. - * - * This function behaves in the same manner as esp_event_post_to, except the additional specification of the event loop - * to post the event to. - * - * @param[in] event_loop the event loop to post to - * @param[in] event_base the event base that identifies the event - * @param[in] event_id the the event id that identifies the event - * @param[in] event_data the data, specific to the event occurence, that gets passed to the handler - * @param[in] event_data_size the size of the event data - * @param[in] ticks_to_wait number of ticks to block on a full event queue - * - * @note posting events from an ISR is not supported - * - * @return - * - ESP_OK: Success - * - ESP_ERR_TIMEOUT: Time to wait for event queue to unblock expired - * - ESP_ERR_INVALIG_ARG: Invalid combination of event base and event id - * - Others: Fail - */ -esp_err_t esp_event_post_to(esp_event_loop_handle_t event_loop, - esp_event_base_t event_base, - int32_t event_id, - void* event_data, - size_t event_data_size, - TickType_t ticks_to_wait); - -/** - * @brief Dumps statistics of all event loops. - * - * Dumps event loop info in the format: - * - @verbatim - event loop - event - handler - handler - event - handler - handler - event loop - event - handler - ... - ... - ... - - where: - - event loop - format: address,name rx:total_recieved dr:total_dropped inv:total_number_of_invocations run:total_runtime - where: - address - memory address of the event loop - name - name of the event loop - total_recieved - number of successfully posted events - total_number_of_invocations - total number of handler invocations performed so far - total_runtime - total runtime of all invocations so far - - event - format: base:id proc:total_processed run:total_runtime - where: - base - event base - id - event id - total_processed - number of instances of this event that has been processed - total_runtime - total amount of time in microseconds used for invoking handlers of this event - - handler - format: address inv:total_invoked run:total_runtime - where: - address - address of the handler function - total_invoked - number of times this handler has been invoked - total_runtime - total amount of time used for invoking this handler - - @endverbatim - * - * @param[in] file the file stream to output to - * - * @note this function is a noop when CONFIG_EVENT_LOOP_PROFILING is disabled - * - * @return - * - ESP_OK: Success - * - ESP_ERR_NO_MEM: Cannot allocate memory for event loops list - * - Others: Fail - */ -esp_err_t esp_event_dump(FILE* file); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // #ifndef ESP_EVENT_H_ \ No newline at end of file diff --git a/tools/sdk/include/esp_event/esp_event_base.h b/tools/sdk/include/esp_event/esp_event_base.h deleted file mode 100644 index d2fd3804283..00000000000 --- a/tools/sdk/include/esp_event/esp_event_base.h +++ /dev/null @@ -1,43 +0,0 @@ -// 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. - -#ifndef ESP_EVENT_BASE_H_ -#define ESP_EVENT_BASE_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -// Defines for declaring and defining event base -#define ESP_EVENT_DECLARE_BASE(id) extern esp_event_base_t id; -#define ESP_EVENT_DEFINE_BASE(id) esp_event_base_t id = #id; - -// Event loop library types -typedef const char* esp_event_base_t; /**< unique pointer to a subsystem that exposes events */ -typedef void* esp_event_loop_handle_t; /**< a number that identifies an event with respect to a base */ -typedef void (*esp_event_handler_t)(void* event_handler_arg, - esp_event_base_t event_base, - int32_t event_id, - void* event_data); /**< function called when an event is posted to the queue */ - - -// Defines for registering/unregistering event handlers -#define ESP_EVENT_ANY_BASE NULL /**< register handler for any event base */ -#define ESP_EVENT_ANY_ID -1 /**< register handler for any event id */ - -#ifdef __cplusplus -} -#endif - -#endif // #ifndef ESP_EVENT_BASE_H_ diff --git a/tools/sdk/include/esp_http_client/esp_http_client.h b/tools/sdk/include/esp_http_client/esp_http_client.h deleted file mode 100644 index 18b68b88334..00000000000 --- a/tools/sdk/include/esp_http_client/esp_http_client.h +++ /dev/null @@ -1,397 +0,0 @@ -// 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. - -#ifndef _ESP_HTTP_CLIENT_H -#define _ESP_HTTP_CLIENT_H - -#include "freertos/FreeRTOS.h" -#include "http_parser.h" -#include "sdkconfig.h" -#include "esp_err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define DEFAULT_HTTP_BUF_SIZE (512) - -typedef struct esp_http_client *esp_http_client_handle_t; -typedef struct esp_http_client_event *esp_http_client_event_handle_t; - -/** - * @brief HTTP Client events id - */ -typedef enum { - HTTP_EVENT_ERROR = 0, /*!< This event occurs when there are any errors during execution */ - HTTP_EVENT_ON_CONNECTED, /*!< Once the HTTP has been connected to the server, no data exchange has been performed */ - HTTP_EVENT_HEADER_SENT, /*!< After sending all the headers to the server */ - HTTP_EVENT_ON_HEADER, /*!< Occurs when receiving each header sent from the server */ - HTTP_EVENT_ON_DATA, /*!< Occurs when receiving data from the server, possibly multiple portions of the packet */ - HTTP_EVENT_ON_FINISH, /*!< Occurs when finish a HTTP session */ - HTTP_EVENT_DISCONNECTED, /*!< The connection has been disconnected */ -} esp_http_client_event_id_t; - -/** - * @brief HTTP Client events data - */ -typedef struct esp_http_client_event { - esp_http_client_event_id_t event_id; /*!< event_id, to know the cause of the event */ - esp_http_client_handle_t client; /*!< esp_http_client_handle_t context */ - void *data; /*!< data of the event */ - int data_len; /*!< data length of data */ - void *user_data; /*!< user_data context, from esp_http_client_config_t user_data */ - char *header_key; /*!< For HTTP_EVENT_ON_HEADER event_id, it's store current http header key */ - char *header_value; /*!< For HTTP_EVENT_ON_HEADER event_id, it's store current http header value */ -} esp_http_client_event_t; - - -/** - * @brief HTTP Client transport - */ -typedef enum { - HTTP_TRANSPORT_UNKNOWN = 0x0, /*!< Unknown */ - HTTP_TRANSPORT_OVER_TCP, /*!< Transport over tcp */ - HTTP_TRANSPORT_OVER_SSL, /*!< Transport over ssl */ -} esp_http_client_transport_t; - -typedef esp_err_t (*http_event_handle_cb)(esp_http_client_event_t *evt); - -/** - * @brief HTTP method - */ -typedef enum { - HTTP_METHOD_GET = 0, /*!< HTTP GET Method */ - HTTP_METHOD_POST, /*!< HTTP POST Method */ - HTTP_METHOD_PUT, /*!< HTTP PUT Method */ - HTTP_METHOD_PATCH, /*!< HTTP PATCH Method */ - HTTP_METHOD_DELETE, /*!< HTTP DELETE Method */ - HTTP_METHOD_HEAD, /*!< HTTP HEAD Method */ - HTTP_METHOD_NOTIFY, /*!< HTTP NOTIFY Method */ - HTTP_METHOD_SUBSCRIBE, /*!< HTTP SUBSCRIBE Method */ - HTTP_METHOD_UNSUBSCRIBE,/*!< HTTP UNSUBSCRIBE Method */ - HTTP_METHOD_OPTIONS, /*!< HTTP OPTIONS Method */ - HTTP_METHOD_MAX, -} esp_http_client_method_t; - -/** - * @brief HTTP Authentication type - */ -typedef enum { - HTTP_AUTH_TYPE_NONE = 0, /*!< No authention */ - HTTP_AUTH_TYPE_BASIC, /*!< HTTP Basic authentication */ - HTTP_AUTH_TYPE_DIGEST, /*!< HTTP Disgest authentication */ -} esp_http_client_auth_type_t; - -/** - * @brief HTTP configuration - */ -typedef struct { - const char *url; /*!< HTTP URL, the information on the URL is most important, it overrides the other fields below, if any */ - const char *host; /*!< Domain or IP as string */ - int port; /*!< Port to connect, default depend on esp_http_client_transport_t (80 or 443) */ - const char *username; /*!< Using for Http authentication */ - const char *password; /*!< Using for Http authentication */ - esp_http_client_auth_type_t auth_type; /*!< Http authentication type, see `esp_http_client_auth_type_t` */ - const char *path; /*!< HTTP Path, if not set, default is `/` */ - const char *query; /*!< HTTP query */ - const char *cert_pem; /*!< SSL server certification, PEM format as string, if the client requires to verify server */ - const char *client_cert_pem; /*!< SSL client certification, PEM format as string, if the server requires to verify client */ - const char *client_key_pem; /*!< SSL client key, PEM format as string, if the server requires to verify client */ - esp_http_client_method_t method; /*!< HTTP Method */ - int timeout_ms; /*!< Network timeout in milliseconds */ - bool disable_auto_redirect; /*!< Disable HTTP automatic redirects */ - int max_redirection_count; /*!< Max redirection number, using default value if zero*/ - http_event_handle_cb event_handler; /*!< HTTP Event Handle */ - esp_http_client_transport_t transport_type; /*!< HTTP transport type, see `esp_http_client_transport_t` */ - int buffer_size; /*!< HTTP buffer size (both send and receive) */ - void *user_data; /*!< HTTP user_data context */ - bool is_async; /*!< Set asynchronous mode, only supported with HTTPS for now */ - bool use_global_ca_store; /*!< Use a global ca_store for all the connections in which this bool is set. */ -} esp_http_client_config_t; - - -#define ESP_ERR_HTTP_BASE (0x7000) /*!< Starting number of HTTP error codes */ -#define ESP_ERR_HTTP_MAX_REDIRECT (ESP_ERR_HTTP_BASE + 1) /*!< The error exceeds the number of HTTP redirects */ -#define ESP_ERR_HTTP_CONNECT (ESP_ERR_HTTP_BASE + 2) /*!< Error open the HTTP connection */ -#define ESP_ERR_HTTP_WRITE_DATA (ESP_ERR_HTTP_BASE + 3) /*!< Error write HTTP data */ -#define ESP_ERR_HTTP_FETCH_HEADER (ESP_ERR_HTTP_BASE + 4) /*!< Error read HTTP header from server */ -#define ESP_ERR_HTTP_INVALID_TRANSPORT (ESP_ERR_HTTP_BASE + 5) /*!< There are no transport support for the input scheme */ -#define ESP_ERR_HTTP_CONNECTING (ESP_ERR_HTTP_BASE + 6) /*!< HTTP connection hasn't been established yet */ -#define ESP_ERR_HTTP_EAGAIN (ESP_ERR_HTTP_BASE + 7) /*!< Mapping of errno EAGAIN to esp_err_t */ - -/** - * @brief Start a HTTP session - * This function must be the first function to call, - * and it returns a esp_http_client_handle_t that you must use as input to other functions in the interface. - * This call MUST have a corresponding call to esp_http_client_cleanup when the operation is complete. - * - * @param[in] config The configurations, see `http_client_config_t` - * - * @return - * - `esp_http_client_handle_t` - * - NULL if any errors - */ -esp_http_client_handle_t esp_http_client_init(const esp_http_client_config_t *config); - -/** - * @brief Invoke this function after `esp_http_client_init` and all the options calls are made, and will perform the - * transfer as described in the options. It must be called with the same esp_http_client_handle_t as input as the esp_http_client_init call returned. - * esp_http_client_perform performs the entire request in either blocking or non-blocking manner. By default, the API performs request in a blocking manner and returns when done, - * or if it failed, and in non-blocking manner, it returns if EAGAIN/EWOULDBLOCK or EINPROGRESS is encountered, or if it failed. And in case of non-blocking request, - * the user may call this API multiple times unless request & response is complete or there is a failure. To enable non-blocking esp_http_client_perform(), `is_async` member of esp_http_client_config_t - * must be set while making a call to esp_http_client_init() API. - * You can do any amount of calls to esp_http_client_perform while using the same esp_http_client_handle_t. The underlying connection may be kept open if the server allows it. - * If you intend to transfer more than one file, you are even encouraged to do so. - * esp_http_client will then attempt to re-use the same connection for the following transfers, thus making the operations faster, less CPU intense and using less network resources. - * Just note that you will have to use `esp_http_client_set_**` between the invokes to set options for the following esp_http_client_perform. - * - * @note You must never call this function simultaneously from two places using the same client handle. - * Let the function return first before invoking it another time. - * If you want parallel transfers, you must use several esp_http_client_handle_t. - * This function include `esp_http_client_open` -> `esp_http_client_write` -> `esp_http_client_fetch_headers` -> `esp_http_client_read` (and option) `esp_http_client_close`. - * - * @param client The esp_http_client handle - * - * @return - * - ESP_OK on successful - * - ESP_FAIL on error - */ -esp_err_t esp_http_client_perform(esp_http_client_handle_t client); - -/** - * @brief Set URL for client, when performing this behavior, the options in the URL will replace the old ones - * - * @param[in] client The esp_http_client handle - * @param[in] url The url - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_http_client_set_url(esp_http_client_handle_t client, const char *url); - -/** - * @brief Set post data, this function must be called before `esp_http_client_perform`. - * Note: The data parameter passed to this function is a pointer and this function will not copy the data - * - * @param[in] client The esp_http_client handle - * @param[in] data post data pointer - * @param[in] len post length - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_http_client_set_post_field(esp_http_client_handle_t client, const char *data, int len); - -/** - * @brief Get current post field information - * - * @param[in] client The client - * @param[out] data Point to post data pointer - * - * @return Size of post data - */ -int esp_http_client_get_post_field(esp_http_client_handle_t client, char **data); - -/** - * @brief Set http request header, this function must be called after esp_http_client_init and before any - * perform function - * - * @param[in] client The esp_http_client handle - * @param[in] key The header key - * @param[in] value The header value - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_http_client_set_header(esp_http_client_handle_t client, const char *key, const char *value); - -/** - * @brief Get http request header. - * The value parameter will be set to NULL if there is no header which is same as - * the key specified, otherwise the address of header value will be assigned to value parameter. - * This function must be called after `esp_http_client_init`. - * - * @param[in] client The esp_http_client handle - * @param[in] key The header key - * @param[out] value The header value - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_http_client_get_header(esp_http_client_handle_t client, const char *key, char **value); - -/** - * @brief Set http request method - * - * @param[in] client The esp_http_client handle - * @param[in] method The method - * - * @return ESP_OK - */ -esp_err_t esp_http_client_set_method(esp_http_client_handle_t client, esp_http_client_method_t method); - -/** - * @brief Delete http request header - * - * @param[in] client The esp_http_client handle - * @param[in] key The key - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_http_client_delete_header(esp_http_client_handle_t client, const char *key); - -/** - * @brief This function will be open the connection, write all header strings and return - * - * @param[in] client The esp_http_client handle - * @param[in] write_len HTTP Content length need to write to the server - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_http_client_open(esp_http_client_handle_t client, int write_len); - -/** - * @brief This function will write data to the HTTP connection previously opened by esp_http_client_open() - * - * @param[in] client The esp_http_client handle - * @param buffer The buffer - * @param[in] len This value must not be larger than the write_len parameter provided to esp_http_client_open() - * - * @return - * - (-1) if any errors - * - Length of data written - */ -int esp_http_client_write(esp_http_client_handle_t client, const char *buffer, int len); - -/** - * @brief This function need to call after esp_http_client_open, it will read from http stream, process all receive headers - * - * @param[in] client The esp_http_client handle - * - * @return - * - (0) if stream doesn't contain content-length header, or chunked encoding (checked by `esp_http_client_is_chunked` response) - * - (-1: ESP_FAIL) if any errors - * - Download data length defined by content-length header - */ -int esp_http_client_fetch_headers(esp_http_client_handle_t client); - - -/** - * @brief Check response data is chunked - * - * @param[in] client The esp_http_client handle - * - * @return true or false - */ -bool esp_http_client_is_chunked_response(esp_http_client_handle_t client); - -/** - * @brief Read data from http stream - * - * @param[in] client The esp_http_client handle - * @param buffer The buffer - * @param[in] len The length - * - * @return - * - (-1) if any errors - * - Length of data was read - */ -int esp_http_client_read(esp_http_client_handle_t client, char *buffer, int len); - - -/** - * @brief Get http response status code, the valid value if this function invoke after `esp_http_client_perform` - * - * @param[in] client The esp_http_client handle - * - * @return Status code - */ -int esp_http_client_get_status_code(esp_http_client_handle_t client); - -/** - * @brief Get http response content length (from header Content-Length) - * the valid value if this function invoke after `esp_http_client_perform` - * - * @param[in] client The esp_http_client handle - * - * @return - * - (-1) Chunked transfer - * - Content-Length value as bytes - */ -int esp_http_client_get_content_length(esp_http_client_handle_t client); - -/** - * @brief Close http connection, still kept all http request resources - * - * @param[in] client The esp_http_client handle - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_http_client_close(esp_http_client_handle_t client); - -/** - * @brief This function must be the last function to call for an session. - * It is the opposite of the esp_http_client_init function and must be called with the same handle as input that a esp_http_client_init call returned. - * This might close all connections this handle has used and possibly has kept open until now. - * Don't call this function if you intend to transfer more files, re-using handles is a key to good performance with esp_http_client. - * - * @param[in] client The esp_http_client handle - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_http_client_cleanup(esp_http_client_handle_t client); - -/** - * @brief Get transport type - * - * @param[in] client The esp_http_client handle - * - * @return - * - HTTP_TRANSPORT_UNKNOWN - * - HTTP_TRANSPORT_OVER_TCP - * - HTTP_TRANSPORT_OVER_SSL - */ -esp_http_client_transport_t esp_http_client_get_transport_type(esp_http_client_handle_t client); - -/** - * @brief Set redirection URL. - * When received the 30x code from the server, the client stores the redirect URL provided by the server. - * This function will set the current URL to redirect to enable client to execute the redirection request. - * - * @param[in] client The esp_http_client handle - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_http_client_set_redirection(esp_http_client_handle_t client); - -#ifdef __cplusplus -} -#endif - - -#endif diff --git a/tools/sdk/include/esp_http_server/esp_http_server.h b/tools/sdk/include/esp_http_server/esp_http_server.h deleted file mode 100644 index 7d4b1a63e02..00000000000 --- a/tools/sdk/include/esp_http_server/esp_http_server.h +++ /dev/null @@ -1,1203 +0,0 @@ -// 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. - -#ifndef _ESP_HTTP_SERVER_H_ -#define _ESP_HTTP_SERVER_H_ - -#include -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* -note: esp_https_server.h includes a customized copy of this -initializer that should be kept in sync -*/ -#define HTTPD_DEFAULT_CONFIG() { \ - .task_priority = tskIDLE_PRIORITY+5, \ - .stack_size = 4096, \ - .server_port = 80, \ - .ctrl_port = 32768, \ - .max_open_sockets = 7, \ - .max_uri_handlers = 8, \ - .max_resp_headers = 8, \ - .backlog_conn = 5, \ - .lru_purge_enable = false, \ - .recv_wait_timeout = 5, \ - .send_wait_timeout = 5, \ - .global_user_ctx = NULL, \ - .global_user_ctx_free_fn = NULL, \ - .global_transport_ctx = NULL, \ - .global_transport_ctx_free_fn = NULL, \ - .open_fn = NULL, \ - .close_fn = NULL, \ -} - -#define ESP_ERR_HTTPD_BASE (0x8000) /*!< Starting number of HTTPD error codes */ -#define ESP_ERR_HTTPD_HANDLERS_FULL (ESP_ERR_HTTPD_BASE + 1) /*!< All slots for registering URI handlers have been consumed */ -#define ESP_ERR_HTTPD_HANDLER_EXISTS (ESP_ERR_HTTPD_BASE + 2) /*!< URI handler with same method and target URI already registered */ -#define ESP_ERR_HTTPD_INVALID_REQ (ESP_ERR_HTTPD_BASE + 3) /*!< Invalid request pointer */ -#define ESP_ERR_HTTPD_RESULT_TRUNC (ESP_ERR_HTTPD_BASE + 4) /*!< Result string truncated */ -#define ESP_ERR_HTTPD_RESP_HDR (ESP_ERR_HTTPD_BASE + 5) /*!< Response header field larger than supported */ -#define ESP_ERR_HTTPD_RESP_SEND (ESP_ERR_HTTPD_BASE + 6) /*!< Error occured while sending response packet */ -#define ESP_ERR_HTTPD_ALLOC_MEM (ESP_ERR_HTTPD_BASE + 7) /*!< Failed to dynamically allocate memory for resource */ -#define ESP_ERR_HTTPD_TASK (ESP_ERR_HTTPD_BASE + 8) /*!< Failed to launch server task/thread */ - -/* ************** Group: Initialization ************** */ -/** @name Initialization - * APIs related to the Initialization of the web server - * @{ - */ - -/** - * @brief HTTP Server Instance Handle - * - * Every instance of the server will have a unique handle. - */ -typedef void* httpd_handle_t; - -/** - * @brief HTTP Method Type wrapper over "enum http_method" - * available in "http_parser" library - */ -typedef enum http_method httpd_method_t; - -/** - * @brief Prototype for freeing context data (if any) - * @param[in] ctx : object to free - */ -typedef void (*httpd_free_ctx_fn_t)(void *ctx); - -/** - * @brief Function prototype for opening a session. - * - * Called immediately after the socket was opened to set up the send/recv functions and - * other parameters of the socket. - * - * @param[in] hd : server instance - * @param[in] sockfd : session socket file descriptor - * @return status - */ -typedef esp_err_t (*httpd_open_func_t)(httpd_handle_t hd, int sockfd); - -/** - * @brief Function prototype for closing a session. - * - * @note It's possible that the socket descriptor is invalid at this point, the function - * is called for all terminated sessions. Ensure proper handling of return codes. - * - * @param[in] hd : server instance - * @param[in] sockfd : session socket file descriptor - */ -typedef void (*httpd_close_func_t)(httpd_handle_t hd, int sockfd); - -/** - * @brief HTTP Server Configuration Structure - * - * @note Use HTTPD_DEFAULT_CONFIG() to initialize the configuration - * to a default value and then modify only those fields that are - * specifically determined by the use case. - */ -typedef struct httpd_config { - unsigned task_priority; /*!< Priority of FreeRTOS task which runs the server */ - size_t stack_size; /*!< The maximum stack size allowed for the server task */ - - /** - * TCP Port number for receiving and transmitting HTTP traffic - */ - uint16_t server_port; - - /** - * UDP Port number for asynchronously exchanging control signals - * between various components of the server - */ - uint16_t ctrl_port; - - uint16_t max_open_sockets; /*!< Max number of sockets/clients connected at any time*/ - uint16_t max_uri_handlers; /*!< Maximum allowed uri handlers */ - uint16_t max_resp_headers; /*!< Maximum allowed additional headers in HTTP response */ - uint16_t backlog_conn; /*!< Number of backlog connections */ - bool lru_purge_enable; /*!< Purge "Least Recently Used" connection */ - uint16_t recv_wait_timeout; /*!< Timeout for recv function (in seconds)*/ - uint16_t send_wait_timeout; /*!< Timeout for send function (in seconds)*/ - - /** - * Global user context. - * - * This field can be used to store arbitrary user data within the server context. - * The value can be retrieved using the server handle, available e.g. in the httpd_req_t struct. - * - * When shutting down, the server frees up the user context by - * calling free() on the global_user_ctx field. If you wish to use a custom - * function for freeing the global user context, please specify that here. - */ - void * global_user_ctx; - - /** - * Free function for global user context - */ - httpd_free_ctx_fn_t global_user_ctx_free_fn; - - /** - * Global transport context. - * - * Similar to global_user_ctx, but used for session encoding or encryption (e.g. to hold the SSL context). - * It will be freed using free(), unless global_transport_ctx_free_fn is specified. - */ - void * global_transport_ctx; - - /** - * Free function for global transport context - */ - httpd_free_ctx_fn_t global_transport_ctx_free_fn; - - /** - * Custom session opening callback. - * - * Called on a new session socket just after accept(), but before reading any data. - * - * This is an opportunity to set up e.g. SSL encryption using global_transport_ctx - * and the send/recv/pending session overrides. - * - * If a context needs to be maintained between these functions, store it in the session using - * httpd_sess_set_transport_ctx() and retrieve it later with httpd_sess_get_transport_ctx() - */ - httpd_open_func_t open_fn; - - /** - * Custom session closing callback. - * - * Called when a session is deleted, before freeing user and transport contexts and before - * closing the socket. This is a place for custom de-init code common to all sockets. - * - * Set the user or transport context to NULL if it was freed here, so the server does not - * try to free it again. - * - * This function is run for all terminated sessions, including sessions where the socket - * was closed by the network stack - that is, the file descriptor may not be valid anymore. - */ - httpd_close_func_t close_fn; -} httpd_config_t; - -/** - * @brief Starts the web server - * - * Create an instance of HTTP server and allocate memory/resources for it - * depending upon the specified configuration. - * - * Example usage: - * @code{c} - * - * //Function for starting the webserver - * httpd_handle_t start_webserver(void) - * { - * // Generate default configuration - * httpd_config_t config = HTTPD_DEFAULT_CONFIG(); - * - * // Empty handle to http_server - * httpd_handle_t server = NULL; - * - * // Start the httpd server - * if (httpd_start(&server, &config) == ESP_OK) { - * // Register URI handlers - * httpd_register_uri_handler(server, &uri_get); - * httpd_register_uri_handler(server, &uri_post); - * } - * // If server failed to start, handle will be NULL - * return server; - * } - * - * @endcode - * - * @param[in] config : Configuration for new instance of the server - * @param[out] handle : Handle to newly created instance of the server. NULL on error - * @return - * - ESP_OK : Instance created successfully - * - ESP_ERR_INVALID_ARG : Null argument(s) - * - ESP_ERR_HTTPD_ALLOC_MEM : Failed to allocate memory for instance - * - ESP_ERR_HTTPD_TASK : Failed to launch server task - */ -esp_err_t httpd_start(httpd_handle_t *handle, const httpd_config_t *config); - -/** - * @brief Stops the web server - * - * Deallocates memory/resources used by an HTTP server instance and - * deletes it. Once deleted the handle can no longer be used for accessing - * the instance. - * - * Example usage: - * @code{c} - * - * // Function for stopping the webserver - * void stop_webserver(httpd_handle_t server) - * { - * // Ensure handle is non NULL - * if (server != NULL) { - * // Stop the httpd server - * httpd_stop(server); - * } - * } - * - * @endcode - * - * @param[in] handle Handle to server returned by httpd_start - * @return - * - ESP_OK : Server stopped successfully - * - ESP_ERR_INVALID_ARG : Handle argument is Null - */ -esp_err_t httpd_stop(httpd_handle_t handle); - -/** End of Group Initialization - * @} - */ - -/* ************** Group: URI Handlers ************** */ -/** @name URI Handlers - * APIs related to the URI handlers - * @{ - */ - -/* Max supported HTTP request header length */ -#define HTTPD_MAX_REQ_HDR_LEN CONFIG_HTTPD_MAX_REQ_HDR_LEN - -/* Max supported HTTP request URI length */ -#define HTTPD_MAX_URI_LEN CONFIG_HTTPD_MAX_URI_LEN - -/** - * @brief HTTP Request Data Structure - */ -typedef struct httpd_req { - httpd_handle_t handle; /*!< Handle to server instance */ - int method; /*!< The type of HTTP request, -1 if unsupported method */ - const char uri[HTTPD_MAX_URI_LEN + 1]; /*!< The URI of this request (1 byte extra for null termination) */ - size_t content_len; /*!< Length of the request body */ - void *aux; /*!< Internally used members */ - - /** - * User context pointer passed during URI registration. - */ - void *user_ctx; - - /** - * Session Context Pointer - * - * A session context. Contexts are maintained across 'sessions' for a - * given open TCP connection. One session could have multiple request - * responses. The web server will ensure that the context persists - * across all these request and responses. - * - * By default, this is NULL. URI Handlers can set this to any meaningful - * value. - * - * If the underlying socket gets closed, and this pointer is non-NULL, - * the web server will free up the context by calling free(), unless - * free_ctx function is set. - */ - void *sess_ctx; - - /** - * Pointer to free context hook - * - * Function to free session context - * - * If the web server's socket closes, it frees up the session context by - * calling free() on the sess_ctx member. If you wish to use a custom - * function for freeing the session context, please specify that here. - */ - httpd_free_ctx_fn_t free_ctx; - - /** - * Flag indicating if Session Context changes should be ignored - * - * By default, if you change the sess_ctx in some URI handler, the http server - * will internally free the earlier context (if non NULL), after the URI handler - * returns. If you want to manage the allocation/reallocation/freeing of - * sess_ctx yourself, set this flag to true, so that the server will not - * perform any checks on it. The context will be cleared by the server - * (by calling free_ctx or free()) only if the socket gets closed. - */ - bool ignore_sess_ctx_changes; -} httpd_req_t; - -/** - * @brief Structure for URI handler - */ -typedef struct httpd_uri { - const char *uri; /*!< The URI to handle */ - httpd_method_t method; /*!< Method supported by the URI */ - - /** - * Handler to call for supported request method. This must - * return ESP_OK, or else the underlying socket will be closed. - */ - esp_err_t (*handler)(httpd_req_t *r); - - /** - * Pointer to user context data which will be available to handler - */ - void *user_ctx; -} httpd_uri_t; - -/** - * @brief Registers a URI handler - * - * @note URI handlers can be registered in real time as long as the - * server handle is valid. - * - * Example usage: - * @code{c} - * - * esp_err_t my_uri_handler(httpd_req_t* req) - * { - * // Recv , Process and Send - * .... - * .... - * .... - * - * // Fail condition - * if (....) { - * // Return fail to close session // - * return ESP_FAIL; - * } - * - * // On success - * return ESP_OK; - * } - * - * // URI handler structure - * httpd_uri_t my_uri { - * .uri = "/my_uri/path/xyz", - * .method = HTTPD_GET, - * .handler = my_uri_handler, - * .user_ctx = NULL - * }; - * - * // Register handler - * if (httpd_register_uri_handler(server_handle, &my_uri) != ESP_OK) { - * // If failed to register handler - * .... - * } - * - * @endcode - * - * @param[in] handle handle to HTTPD server instance - * @param[in] uri_handler pointer to handler that needs to be registered - * - * @return - * - ESP_OK : On successfully registering the handler - * - ESP_ERR_INVALID_ARG : Null arguments - * - ESP_ERR_HTTPD_HANDLERS_FULL : If no slots left for new handler - * - ESP_ERR_HTTPD_HANDLER_EXISTS : If handler with same URI and - * method is already registered - */ -esp_err_t httpd_register_uri_handler(httpd_handle_t handle, - const httpd_uri_t *uri_handler); - -/** - * @brief Unregister a URI handler - * - * @param[in] handle handle to HTTPD server instance - * @param[in] uri URI string - * @param[in] method HTTP method - * - * @return - * - ESP_OK : On successfully deregistering the handler - * - ESP_ERR_INVALID_ARG : Null arguments - * - ESP_ERR_NOT_FOUND : Handler with specified URI and method not found - */ -esp_err_t httpd_unregister_uri_handler(httpd_handle_t handle, - const char *uri, httpd_method_t method); - -/** - * @brief Unregister all URI handlers with the specified uri string - * - * @param[in] handle handle to HTTPD server instance - * @param[in] uri uri string specifying all handlers that need - * to be deregisterd - * - * @return - * - ESP_OK : On successfully deregistering all such handlers - * - ESP_ERR_INVALID_ARG : Null arguments - * - ESP_ERR_NOT_FOUND : No handler registered with specified uri string - */ -esp_err_t httpd_unregister_uri(httpd_handle_t handle, const char* uri); - -/** End of URI Handlers - * @} - */ - -/* ************** Group: TX/RX ************** */ -/** @name TX / RX - * Prototype for HTTPDs low-level send/recv functions - * @{ - */ - -#define HTTPD_SOCK_ERR_FAIL -1 -#define HTTPD_SOCK_ERR_INVALID -2 -#define HTTPD_SOCK_ERR_TIMEOUT -3 - -/** - * @brief Prototype for HTTPDs low-level send function - * - * @note User specified send function must handle errors internally, - * depending upon the set value of errno, and return specific - * HTTPD_SOCK_ERR_ codes, which will eventually be conveyed as - * return value of httpd_send() function - * - * @param[in] hd : server instance - * @param[in] sockfd : session socket file descriptor - * @param[in] buf : buffer with bytes to send - * @param[in] buf_len : data size - * @param[in] flags : flags for the send() function - * @return - * - Bytes : The number of bytes sent successfully - * - HTTPD_SOCK_ERR_INVALID : Invalid arguments - * - HTTPD_SOCK_ERR_TIMEOUT : Timeout/interrupted while calling socket send() - * - HTTPD_SOCK_ERR_FAIL : Unrecoverable error while calling socket send() - */ -typedef int (*httpd_send_func_t)(httpd_handle_t hd, int sockfd, const char *buf, size_t buf_len, int flags); - -/** - * @brief Prototype for HTTPDs low-level recv function - * - * @note User specified recv function must handle errors internally, - * depending upon the set value of errno, and return specific - * HTTPD_SOCK_ERR_ codes, which will eventually be conveyed as - * return value of httpd_req_recv() function - * - * @param[in] hd : server instance - * @param[in] sockfd : session socket file descriptor - * @param[in] buf : buffer with bytes to send - * @param[in] buf_len : data size - * @param[in] flags : flags for the send() function - * @return - * - Bytes : The number of bytes received successfully - * - 0 : Buffer length parameter is zero / connection closed by peer - * - HTTPD_SOCK_ERR_INVALID : Invalid arguments - * - HTTPD_SOCK_ERR_TIMEOUT : Timeout/interrupted while calling socket recv() - * - HTTPD_SOCK_ERR_FAIL : Unrecoverable error while calling socket recv() - */ -typedef int (*httpd_recv_func_t)(httpd_handle_t hd, int sockfd, char *buf, size_t buf_len, int flags); - -/** - * @brief Prototype for HTTPDs low-level "get pending bytes" function - * - * @note User specified pending function must handle errors internally, - * depending upon the set value of errno, and return specific - * HTTPD_SOCK_ERR_ codes, which will be handled accordingly in - * the server task. - * - * @param[in] hd : server instance - * @param[in] sockfd : session socket file descriptor - * @return - * - Bytes : The number of bytes waiting to be received - * - HTTPD_SOCK_ERR_INVALID : Invalid arguments - * - HTTPD_SOCK_ERR_TIMEOUT : Timeout/interrupted while calling socket pending() - * - HTTPD_SOCK_ERR_FAIL : Unrecoverable error while calling socket pending() - */ -typedef int (*httpd_pending_func_t)(httpd_handle_t hd, int sockfd); - -/** End of TX / RX - * @} - */ - -/* ************** Group: Request/Response ************** */ -/** @name Request / Response - * APIs related to the data send/receive by URI handlers. - * These APIs are supposed to be called only from the context of - * a URI handler where httpd_req_t* request pointer is valid. - * @{ - */ - -/** - * @brief Override web server's receive function (by session FD) - * - * This function overrides the web server's receive function. This same function is - * used to read HTTP request packets. - * - * @note This API is supposed to be called either from the context of - * - an http session APIs where sockfd is a valid parameter - * - a URI handler where sockfd is obtained using httpd_req_to_sockfd() - * - * @param[in] hd HTTPD instance handle - * @param[in] sockfd Session socket FD - * @param[in] recv_func The receive function to be set for this session - * - * @return - * - ESP_OK : On successfully registering override - * - ESP_ERR_INVALID_ARG : Null arguments - */ -esp_err_t httpd_sess_set_recv_override(httpd_handle_t hd, int sockfd, httpd_recv_func_t recv_func); - -/** - * @brief Override web server's send function (by session FD) - * - * This function overrides the web server's send function. This same function is - * used to send out any response to any HTTP request. - * - * @note This API is supposed to be called either from the context of - * - an http session APIs where sockfd is a valid parameter - * - a URI handler where sockfd is obtained using httpd_req_to_sockfd() - * - * @param[in] hd HTTPD instance handle - * @param[in] sockfd Session socket FD - * @param[in] send_func The send function to be set for this session - * - * @return - * - ESP_OK : On successfully registering override - * - ESP_ERR_INVALID_ARG : Null arguments - */ -esp_err_t httpd_sess_set_send_override(httpd_handle_t hd, int sockfd, httpd_send_func_t send_func); - -/** - * @brief Override web server's pending function (by session FD) - * - * This function overrides the web server's pending function. This function is - * used to test for pending bytes in a socket. - * - * @note This API is supposed to be called either from the context of - * - an http session APIs where sockfd is a valid parameter - * - a URI handler where sockfd is obtained using httpd_req_to_sockfd() - * - * @param[in] hd HTTPD instance handle - * @param[in] sockfd Session socket FD - * @param[in] pending_func The receive function to be set for this session - * - * @return - * - ESP_OK : On successfully registering override - * - ESP_ERR_INVALID_ARG : Null arguments - */ -esp_err_t httpd_sess_set_pending_override(httpd_handle_t hd, int sockfd, httpd_pending_func_t pending_func); - -/** - * @brief Get the Socket Descriptor from the HTTP request - * - * This API will return the socket descriptor of the session for - * which URI handler was executed on reception of HTTP request. - * This is useful when user wants to call functions that require - * session socket fd, from within a URI handler, ie. : - * httpd_sess_get_ctx(), - * httpd_sess_trigger_close(), - * httpd_sess_update_lru_counter(). - * - * @note This API is supposed to be called only from the context of - * a URI handler where httpd_req_t* request pointer is valid. - * - * @param[in] r The request whose socket descriptor should be found - * - * @return - * - Socket descriptor : The socket descriptor for this request - * - -1 : Invalid/NULL request pointer - */ -int httpd_req_to_sockfd(httpd_req_t *r); - -/** - * @brief API to read content data from the HTTP request - * - * This API will read HTTP content data from the HTTP request into - * provided buffer. Use content_len provided in httpd_req_t structure - * to know the length of data to be fetched. If content_len is too - * large for the buffer then user may have to make multiple calls to - * this function, each time fetching 'buf_len' number of bytes, - * while the pointer to content data is incremented internally by - * the same number. - * - * @note - * - This API is supposed to be called only from the context of - * a URI handler where httpd_req_t* request pointer is valid. - * - If an error is returned, the URI handler must further return an error. - * This will ensure that the erroneous socket is closed and cleaned up by - * the web server. - * - Presently Chunked Encoding is not supported - * - * @param[in] r The request being responded to - * @param[in] buf Pointer to a buffer that the data will be read into - * @param[in] buf_len Length of the buffer - * - * @return - * - Bytes : Number of bytes read into the buffer successfully - * - 0 : Buffer length parameter is zero / connection closed by peer - * - HTTPD_SOCK_ERR_INVALID : Invalid arguments - * - HTTPD_SOCK_ERR_TIMEOUT : Timeout/interrupted while calling socket recv() - * - HTTPD_SOCK_ERR_FAIL : Unrecoverable error while calling socket recv() - */ -int httpd_req_recv(httpd_req_t *r, char *buf, size_t buf_len); - -/** - * @brief Search for a field in request headers and - * return the string length of it's value - * - * @note - * - This API is supposed to be called only from the context of - * a URI handler where httpd_req_t* request pointer is valid. - * - Once httpd_resp_send() API is called all request headers - * are purged, so request headers need be copied into separate - * buffers if they are required later. - * - * @param[in] r The request being responded to - * @param[in] field The header field to be searched in the request - * - * @return - * - Length : If field is found in the request URL - * - Zero : Field not found / Invalid request / Null arguments - */ -size_t httpd_req_get_hdr_value_len(httpd_req_t *r, const char *field); - -/** - * @brief Get the value string of a field from the request headers - * - * @note - * - This API is supposed to be called only from the context of - * a URI handler where httpd_req_t* request pointer is valid. - * - Once httpd_resp_send() API is called all request headers - * are purged, so request headers need be copied into separate - * buffers if they are required later. - * - If output size is greater than input, then the value is truncated, - * accompanied by truncation error as return value. - * - Use httpd_req_get_hdr_value_len() to know the right buffer length - * - * @param[in] r The request being responded to - * @param[in] field The field to be searched in the header - * @param[out] val Pointer to the buffer into which the value will be copied if the field is found - * @param[in] val_size Size of the user buffer "val" - * - * @return - * - ESP_OK : Field found in the request header and value string copied - * - ESP_ERR_NOT_FOUND : Key not found - * - ESP_ERR_INVALID_ARG : Null arguments - * - ESP_ERR_HTTPD_INVALID_REQ : Invalid HTTP request pointer - * - ESP_ERR_HTTPD_RESULT_TRUNC : Value string truncated - */ -esp_err_t httpd_req_get_hdr_value_str(httpd_req_t *r, const char *field, char *val, size_t val_size); - -/** - * @brief Get Query string length from the request URL - * - * @note This API is supposed to be called only from the context of - * a URI handler where httpd_req_t* request pointer is valid - * - * @param[in] r The request being responded to - * - * @return - * - Length : Query is found in the request URL - * - Zero : Query not found / Null arguments / Invalid request - */ -size_t httpd_req_get_url_query_len(httpd_req_t *r); - -/** - * @brief Get Query string from the request URL - * - * @note - * - Presently, the user can fetch the full URL query string, but decoding - * will have to be performed by the user. Request headers can be read using - * httpd_req_get_hdr_value_str() to know the 'Content-Type' (eg. Content-Type: - * application/x-www-form-urlencoded) and then the appropriate decoding - * algorithm needs to be applied. - * - This API is supposed to be called only from the context of - * a URI handler where httpd_req_t* request pointer is valid - * - If output size is greater than input, then the value is truncated, - * accompanied by truncation error as return value - * - Prior to calling this function, one can use httpd_req_get_url_query_len() - * to know the query string length beforehand and hence allocate the buffer - * of right size (usually query string length + 1 for null termination) - * for storing the query string - * - * @param[in] r The request being responded to - * @param[out] buf Pointer to the buffer into which the query string will be copied (if found) - * @param[in] buf_len Length of output buffer - * - * @return - * - ESP_OK : Query is found in the request URL and copied to buffer - * - ESP_ERR_NOT_FOUND : Query not found - * - ESP_ERR_INVALID_ARG : Null arguments - * - ESP_ERR_HTTPD_INVALID_REQ : Invalid HTTP request pointer - * - ESP_ERR_HTTPD_RESULT_TRUNC : Query string truncated - */ -esp_err_t httpd_req_get_url_query_str(httpd_req_t *r, char *buf, size_t buf_len); - -/** - * @brief Helper function to get a URL query tag from a query - * string of the type param1=val1¶m2=val2 - * - * @note - * - The components of URL query string (keys and values) are not URLdecoded. - * The user must check for 'Content-Type' field in the request headers and - * then depending upon the specified encoding (URLencoded or otherwise) apply - * the appropriate decoding algorithm. - * - If actual value size is greater than val_size, then the value is truncated, - * accompanied by truncation error as return value. - * - * @param[in] qry Pointer to query string - * @param[in] key The key to be searched in the query string - * @param[out] val Pointer to the buffer into which the value will be copied if the key is found - * @param[in] val_size Size of the user buffer "val" - * - * @return - * - ESP_OK : Key is found in the URL query string and copied to buffer - * - ESP_ERR_NOT_FOUND : Key not found - * - ESP_ERR_INVALID_ARG : Null arguments - * - ESP_ERR_HTTPD_RESULT_TRUNC : Value string truncated - */ -esp_err_t httpd_query_key_value(const char *qry, const char *key, char *val, size_t val_size); - -/** - * @brief API to send a complete HTTP response. - * - * This API will send the data as an HTTP response to the request. - * This assumes that you have the entire response ready in a single - * buffer. If you wish to send response in incremental chunks use - * httpd_resp_send_chunk() instead. - * - * If no status code and content-type were set, by default this - * will send 200 OK status code and content type as text/html. - * You may call the following functions before this API to configure - * the response headers : - * httpd_resp_set_status() - for setting the HTTP status string, - * httpd_resp_set_type() - for setting the Content Type, - * httpd_resp_set_hdr() - for appending any additional field - * value entries in the response header - * - * @note - * - This API is supposed to be called only from the context of - * a URI handler where httpd_req_t* request pointer is valid. - * - Once this API is called, the request has been responded to. - * - No additional data can then be sent for the request. - * - Once this API is called, all request headers are purged, so - * request headers need be copied into separate buffers if - * they are required later. - * - * @param[in] r The request being responded to - * @param[in] buf Buffer from where the content is to be fetched - * @param[in] buf_len Length of the buffer, -1 to use strlen() - * - * @return - * - ESP_OK : On successfully sending the response packet - * - ESP_ERR_INVALID_ARG : Null request pointer - * - ESP_ERR_HTTPD_RESP_HDR : Essential headers are too large for internal buffer - * - ESP_ERR_HTTPD_RESP_SEND : Error in raw send - * - ESP_ERR_HTTPD_INVALID_REQ : Invalid request - */ -esp_err_t httpd_resp_send(httpd_req_t *r, const char *buf, ssize_t buf_len); - -/** - * @brief API to send one HTTP chunk - * - * This API will send the data as an HTTP response to the - * request. This API will use chunked-encoding and send the response - * in the form of chunks. If you have the entire response contained in - * a single buffer, please use httpd_resp_send() instead. - * - * If no status code and content-type were set, by default this will - * send 200 OK status code and content type as text/html. You may - * call the following functions before this API to configure the - * response headers - * httpd_resp_set_status() - for setting the HTTP status string, - * httpd_resp_set_type() - for setting the Content Type, - * httpd_resp_set_hdr() - for appending any additional field - * value entries in the response header - * - * @note - * - This API is supposed to be called only from the context of - * a URI handler where httpd_req_t* request pointer is valid. - * - When you are finished sending all your chunks, you must call - * this function with buf_len as 0. - * - Once this API is called, all request headers are purged, so - * request headers need be copied into separate buffers if they - * are required later. - * - * @param[in] r The request being responded to - * @param[in] buf Pointer to a buffer that stores the data - * @param[in] buf_len Length of the data from the buffer that should be sent out, -1 to use strlen() - * - * @return - * - ESP_OK : On successfully sending the response packet chunk - * - ESP_ERR_INVALID_ARG : Null request pointer - * - ESP_ERR_HTTPD_RESP_HDR : Essential headers are too large for internal buffer - * - ESP_ERR_HTTPD_RESP_SEND : Error in raw send - * - ESP_ERR_HTTPD_INVALID_REQ : Invalid request pointer - */ -esp_err_t httpd_resp_send_chunk(httpd_req_t *r, const char *buf, ssize_t buf_len); - -/* Some commonly used status codes */ -#define HTTPD_200 "200 OK" /*!< HTTP Response 200 */ -#define HTTPD_204 "204 No Content" /*!< HTTP Response 204 */ -#define HTTPD_207 "207 Multi-Status" /*!< HTTP Response 207 */ -#define HTTPD_400 "400 Bad Request" /*!< HTTP Response 400 */ -#define HTTPD_404 "404 Not Found" /*!< HTTP Response 404 */ -#define HTTPD_408 "408 Request Timeout" /*!< HTTP Response 408 */ -#define HTTPD_500 "500 Internal Server Error" /*!< HTTP Response 500 */ - -/** - * @brief API to set the HTTP status code - * - * This API sets the status of the HTTP response to the value specified. - * By default, the '200 OK' response is sent as the response. - * - * @note - * - This API is supposed to be called only from the context of - * a URI handler where httpd_req_t* request pointer is valid. - * - This API only sets the status to this value. The status isn't - * sent out until any of the send APIs is executed. - * - Make sure that the lifetime of the status string is valid till - * send function is called. - * - * @param[in] r The request being responded to - * @param[in] status The HTTP status code of this response - * - * @return - * - ESP_OK : On success - * - ESP_ERR_INVALID_ARG : Null arguments - * - ESP_ERR_HTTPD_INVALID_REQ : Invalid request pointer - */ -esp_err_t httpd_resp_set_status(httpd_req_t *r, const char *status); - -/* Some commonly used content types */ -#define HTTPD_TYPE_JSON "application/json" /*!< HTTP Content type JSON */ -#define HTTPD_TYPE_TEXT "text/html" /*!< HTTP Content type text/HTML */ -#define HTTPD_TYPE_OCTET "application/octet-stream" /*!< HTTP Content type octext-stream */ - -/** - * @brief API to set the HTTP content type - * - * This API sets the 'Content Type' field of the response. - * The default content type is 'text/html'. - * - * @note - * - This API is supposed to be called only from the context of - * a URI handler where httpd_req_t* request pointer is valid. - * - This API only sets the content type to this value. The type - * isn't sent out until any of the send APIs is executed. - * - Make sure that the lifetime of the type string is valid till - * send function is called. - * - * @param[in] r The request being responded to - * @param[in] type The Content Type of the response - * - * @return - * - ESP_OK : On success - * - ESP_ERR_INVALID_ARG : Null arguments - * - ESP_ERR_HTTPD_INVALID_REQ : Invalid request pointer - */ -esp_err_t httpd_resp_set_type(httpd_req_t *r, const char *type); - -/** - * @brief API to append any additional headers - * - * This API sets any additional header fields that need to be sent in the response. - * - * @note - * - This API is supposed to be called only from the context of - * a URI handler where httpd_req_t* request pointer is valid. - * - The header isn't sent out until any of the send APIs is executed. - * - The maximum allowed number of additional headers is limited to - * value of max_resp_headers in config structure. - * - Make sure that the lifetime of the field value strings are valid till - * send function is called. - * - * @param[in] r The request being responded to - * @param[in] field The field name of the HTTP header - * @param[in] value The value of this HTTP header - * - * @return - * - ESP_OK : On successfully appending new header - * - ESP_ERR_INVALID_ARG : Null arguments - * - ESP_ERR_HTTPD_RESP_HDR : Total additional headers exceed max allowed - * - ESP_ERR_HTTPD_INVALID_REQ : Invalid request pointer - */ -esp_err_t httpd_resp_set_hdr(httpd_req_t *r, const char *field, const char *value); - -/** - * @brief Helper function for HTTP 404 - * - * Send HTTP 404 message. If you wish to send additional data in the body of the - * response, please use the lower-level functions directly. - * - * @note - * - This API is supposed to be called only from the context of - * a URI handler where httpd_req_t* request pointer is valid. - * - Once this API is called, all request headers are purged, so - * request headers need be copied into separate buffers if - * they are required later. - * - * @param[in] r The request being responded to - * - * @return - * - ESP_OK : On successfully sending the response packet - * - ESP_ERR_INVALID_ARG : Null arguments - * - ESP_ERR_HTTPD_RESP_SEND : Error in raw send - * - ESP_ERR_HTTPD_INVALID_REQ : Invalid request pointer - */ -esp_err_t httpd_resp_send_404(httpd_req_t *r); - -/** - * @brief Helper function for HTTP 408 - * - * Send HTTP 408 message. If you wish to send additional data in the body of the - * response, please use the lower-level functions directly. - * - * @note - * - This API is supposed to be called only from the context of - * a URI handler where httpd_req_t* request pointer is valid. - * - Once this API is called, all request headers are purged, so - * request headers need be copied into separate buffers if - * they are required later. - * - * @param[in] r The request being responded to - * - * @return - * - ESP_OK : On successfully sending the response packet - * - ESP_ERR_INVALID_ARG : Null arguments - * - ESP_ERR_HTTPD_RESP_SEND : Error in raw send - * - ESP_ERR_HTTPD_INVALID_REQ : Invalid request pointer - */ -esp_err_t httpd_resp_send_408(httpd_req_t *r); - -/** - * @brief Helper function for HTTP 500 - * - * Send HTTP 500 message. If you wish to send additional data in the body of the - * response, please use the lower-level functions directly. - * - * @note - * - This API is supposed to be called only from the context of - * a URI handler where httpd_req_t* request pointer is valid. - * - Once this API is called, all request headers are purged, so - * request headers need be copied into separate buffers if - * they are required later. - * - * @param[in] r The request being responded to - * - * @return - * - ESP_OK : On successfully sending the response packet - * - ESP_ERR_INVALID_ARG : Null arguments - * - ESP_ERR_HTTPD_RESP_SEND : Error in raw send - * - ESP_ERR_HTTPD_INVALID_REQ : Invalid request pointer - */ -esp_err_t httpd_resp_send_500(httpd_req_t *r); - -/** - * @brief Raw HTTP send - * - * Call this API if you wish to construct your custom response packet. - * When using this, all essential header, eg. HTTP version, Status Code, - * Content Type and Length, Encoding, etc. will have to be constructed - * manually, and HTTP delimeters (CRLF) will need to be placed correctly - * for separating sub-sections of the HTTP response packet. - * - * If the send override function is set, this API will end up - * calling that function eventually to send data out. - * - * @note - * - This API is supposed to be called only from the context of - * a URI handler where httpd_req_t* request pointer is valid. - * - Unless the response has the correct HTTP structure (which the - * user must now ensure) it is not guaranteed that it will be - * recognized by the client. For most cases, you wouldn't have - * to call this API, but you would rather use either of : - * httpd_resp_send(), - * httpd_resp_send_chunk() - * - * @param[in] r The request being responded to - * @param[in] buf Buffer from where the fully constructed packet is to be read - * @param[in] buf_len Length of the buffer - * - * @return - * - Bytes : Number of bytes that were sent successfully - * - HTTPD_SOCK_ERR_INVALID : Invalid arguments - * - HTTPD_SOCK_ERR_TIMEOUT : Timeout/interrupted while calling socket send() - * - HTTPD_SOCK_ERR_FAIL : Unrecoverable error while calling socket send() - */ -int httpd_send(httpd_req_t *r, const char *buf, size_t buf_len); - -/** End of Request / Response - * @} - */ - -/* ************** Group: Session ************** */ -/** @name Session - * Functions for controlling sessions and accessing context data - * @{ - */ - -/** - * @brief Get session context from socket descriptor - * - * Typically if a session context is created, it is available to URI handlers - * through the httpd_req_t structure. But, there are cases where the web - * server's send/receive functions may require the context (for example, for - * accessing keying information etc). Since the send/receive function only have - * the socket descriptor at their disposal, this API provides them with a way to - * retrieve the session context. - * - * @param[in] handle Handle to server returned by httpd_start - * @param[in] sockfd The socket descriptor for which the context should be extracted. - * - * @return - * - void* : Pointer to the context associated with this session - * - NULL : Empty context / Invalid handle / Invalid socket fd - */ -void *httpd_sess_get_ctx(httpd_handle_t handle, int sockfd); - -/** - * @brief Set session context by socket descriptor - * - * @param[in] handle Handle to server returned by httpd_start - * @param[in] sockfd The socket descriptor for which the context should be extracted. - * @param[in] ctx Context object to assign to the session - * @param[in] free_fn Function that should be called to free the context - */ -void httpd_sess_set_ctx(httpd_handle_t handle, int sockfd, void *ctx, httpd_free_ctx_fn_t free_fn); - -/** - * @brief Get session 'transport' context by socket descriptor - * @see httpd_sess_get_ctx() - * - * This context is used by the send/receive functions, for example to manage SSL context. - * - * @param[in] handle Handle to server returned by httpd_start - * @param[in] sockfd The socket descriptor for which the context should be extracted. - * @return - * - void* : Pointer to the transport context associated with this session - * - NULL : Empty context / Invalid handle / Invalid socket fd - */ -void *httpd_sess_get_transport_ctx(httpd_handle_t handle, int sockfd); - -/** - * @brief Set session 'transport' context by socket descriptor - * @see httpd_sess_set_ctx() - * - * @param[in] handle Handle to server returned by httpd_start - * @param[in] sockfd The socket descriptor for which the context should be extracted. - * @param[in] ctx Transport context object to assign to the session - * @param[in] free_fn Function that should be called to free the transport context - */ -void httpd_sess_set_transport_ctx(httpd_handle_t handle, int sockfd, void *ctx, httpd_free_ctx_fn_t free_fn); - -/** - * @brief Get HTTPD global user context (it was set in the server config struct) - * - * @param[in] handle Handle to server returned by httpd_start - * @return global user context - */ -void *httpd_get_global_user_ctx(httpd_handle_t handle); - -/** - * @brief Get HTTPD global transport context (it was set in the server config struct) - * - * @param[in] handle Handle to server returned by httpd_start - * @return global transport context - */ -void *httpd_get_global_transport_ctx(httpd_handle_t handle); - -/** - * @brief Trigger an httpd session close externally - * - * @note Calling this API is only required in special circumstances wherein - * some application requires to close an httpd client session asynchronously. - * - * @param[in] handle Handle to server returned by httpd_start - * @param[in] sockfd The socket descriptor of the session to be closed - * - * @return - * - ESP_OK : On successfully initiating closure - * - ESP_FAIL : Failure to queue work - * - ESP_ERR_NOT_FOUND : Socket fd not found - * - ESP_ERR_INVALID_ARG : Null arguments - */ -esp_err_t httpd_sess_trigger_close(httpd_handle_t handle, int sockfd); - -/** - * @brief Update LRU counter for a given socket - * - * LRU Counters are internally associated with each session to monitor - * how recently a session exchanged traffic. When LRU purge is enabled, - * if a client is requesting for connection but maximum number of - * sockets/sessions is reached, then the session having the earliest - * LRU counter is closed automatically. - * - * Updating the LRU counter manually prevents the socket from being purged - * due to the Least Recently Used (LRU) logic, even though it might not - * have received traffic for some time. This is useful when all open - * sockets/session are frequently exchanging traffic but the user specifically - * wants one of the sessions to be kept open, irrespective of when it last - * exchanged a packet. - * - * @note Calling this API is only necessary if the LRU Purge Enable option - * is enabled. - * - * @param[in] handle Handle to server returned by httpd_start - * @param[in] sockfd The socket descriptor of the session for which LRU counter - * is to be updated - * - * @return - * - ESP_OK : Socket found and LRU counter updated - * - ESP_ERR_NOT_FOUND : Socket not found - * - ESP_ERR_INVALID_ARG : Null arguments - */ -esp_err_t httpd_sess_update_lru_counter(httpd_handle_t handle, int sockfd); - -/** End of Session - * @} - */ - -/* ************** Group: Work Queue ************** */ -/** @name Work Queue - * APIs related to the HTTPD Work Queue - * @{ - */ - -/** - * @brief Prototype of the HTTPD work function - * Please refer to httpd_queue_work() for more details. - * @param[in] arg The arguments for this work function - */ -typedef void (*httpd_work_fn_t)(void *arg); - -/** - * @brief Queue execution of a function in HTTPD's context - * - * This API queues a work function for asynchronous execution - * - * @note Some protocols require that the web server generate some asynchronous data - * and send it to the persistently opened connection. This facility is for use - * by such protocols. - * - * @param[in] handle Handle to server returned by httpd_start - * @param[in] work Pointer to the function to be executed in the HTTPD's context - * @param[in] arg Pointer to the arguments that should be passed to this function - * - * @return - * - ESP_OK : On successfully queueing the work - * - ESP_FAIL : Failure in ctrl socket - * - ESP_ERR_INVALID_ARG : Null arguments - */ -esp_err_t httpd_queue_work(httpd_handle_t handle, httpd_work_fn_t work, void *arg); - -/** End of Group Work Queue - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* ! _ESP_HTTP_SERVER_H_ */ diff --git a/tools/sdk/include/esp_http_server/http_server.h b/tools/sdk/include/esp_http_server/http_server.h deleted file mode 100644 index 56f73c5b74c..00000000000 --- a/tools/sdk/include/esp_http_server/http_server.h +++ /dev/null @@ -1,2 +0,0 @@ -#warning http_server.h has been renamed to esp_http_server.h, please update include directives -#include "esp_http_server.h" diff --git a/tools/sdk/include/esp_https_ota/esp_https_ota.h b/tools/sdk/include/esp_https_ota/esp_https_ota.h deleted file mode 100644 index 157195601c7..00000000000 --- a/tools/sdk/include/esp_https_ota/esp_https_ota.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2017-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. - -#pragma once - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief HTTPS OTA Firmware upgrade. - * - * This function performs HTTPS OTA Firmware upgrade - * - * @param[in] config pointer to esp_http_client_config_t structure. - * - * @note For secure HTTPS updates, the `cert_pem` member of `config` - * structure must be set to the server certificate. - * - * @return - * - ESP_OK: OTA data updated, next reboot will use specified partition. - * - ESP_FAIL: For generic failure. - * - ESP_ERR_OTA_VALIDATE_FAILED: Invalid app image - * - ESP_ERR_NO_MEM: Cannot allocate memory for OTA operation. - * - ESP_ERR_FLASH_OP_TIMEOUT or ESP_ERR_FLASH_OP_FAIL: Flash write failed. - * - For other return codes, refer OTA documentation in esp-idf's app_update component. - */ -esp_err_t esp_https_ota(const esp_http_client_config_t *config); - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/esp_ringbuf/freertos/ringbuf.h b/tools/sdk/include/esp_ringbuf/freertos/ringbuf.h deleted file mode 100644 index de8a3690952..00000000000 --- a/tools/sdk/include/esp_ringbuf/freertos/ringbuf.h +++ /dev/null @@ -1,415 +0,0 @@ -// 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. - -#ifndef FREERTOS_RINGBUF_H -#define FREERTOS_RINGBUF_H - -#ifndef INC_FREERTOS_H - #error "include FreeRTOS.h" must appear in source files before "include ringbuf.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -/** - * Type by which ring buffers are referenced. For example, a call to xRingbufferCreate() - * returns a RingbufHandle_t variable that can then be used as a parameter to - * xRingbufferSend(), xRingbufferReceive(), etc. - */ -typedef void * RingbufHandle_t; - -typedef enum { - /** - * No-split buffers will only store an item in contiguous memory and will - * never split an item. Each item requires an 8 byte overhead for a header - * and will always internally occupy a 32-bit aligned size of space. - */ - RINGBUF_TYPE_NOSPLIT = 0, - /** - * Allow-split buffers will split an item into two parts if necessary in - * order to store it. Each item requires an 8 byte overhead for a header, - * splitting incurs an extra header. Each item will always internally occupy - * a 32-bit aligned size of space. - */ - RINGBUF_TYPE_ALLOWSPLIT, - /** - * Byte buffers store data as a sequence of bytes and do not maintain separate - * items, therefore byte buffers have no overhead. All data is stored as a - * sequence of byte and any number of bytes can be sent or retrieved each - * time. - */ - RINGBUF_TYPE_BYTEBUF -} ringbuf_type_t; - -/** - * @brief Create a ring buffer - * - * @param[in] xBufferSize Size of the buffer in bytes. Note that items require - * space for overhead in no-split/allow-split buffers - * @param[in] xBufferType Type of ring buffer, see documentation. - * - * @note xBufferSize of no-split/allow-split buffers will be rounded up to the nearest 32-bit aligned size. - * - * @return A handle to the created ring buffer, or NULL in case of error. - */ -RingbufHandle_t xRingbufferCreate(size_t xBufferSize, ringbuf_type_t xBufferType); - -/** - * @brief Create a ring buffer of type RINGBUF_TYPE_NOSPLIT for a fixed item_size - * - * This API is similar to xRingbufferCreate(), but it will internally allocate - * additional space for the headers. - * - * @param[in] xItemSize Size of each item to be put into the ring buffer - * @param[in] xItemNum Maximum number of items the buffer needs to hold simultaneously - * - * @return A RingbufHandle_t handle to the created ring buffer, or NULL in case of error. - */ -RingbufHandle_t xRingbufferCreateNoSplit(size_t xItemSize, size_t xItemNum); - -/** - * @brief Insert an item into the ring buffer - * - * Attempt to insert an item into the ring buffer. This function will block until - * enough free space is available or until it timesout. - * - * @param[in] xRingbuffer Ring buffer to insert the item into - * @param[in] pvItem Pointer to data to insert. NULL is allowed if xItemSize is 0. - * @param[in] xItemSize Size of data to insert. - * @param[in] xTicksToWait Ticks to wait for room in the ring buffer. - * - * @note For no-split/allow-split ring buffers, the actual size of memory that - * the item will occupy will be rounded up to the nearest 32-bit aligned - * size. This is done to ensure all items are always stored in 32-bit - * aligned fashion. - * - * @return - * - pdTRUE if succeeded - * - pdFALSE on time-out or when the data is larger than the maximum permissible size of the buffer - */ -BaseType_t xRingbufferSend(RingbufHandle_t xRingbuffer, const void *pvItem, size_t xItemSize, TickType_t xTicksToWait); - -/** - * @brief Insert an item into the ring buffer in an ISR - * - * Attempt to insert an item into the ring buffer from an ISR. This function - * will return immediately if there is insufficient free space in the buffer. - * - * @param[in] xRingbuffer Ring buffer to insert the item into - * @param[in] pvItem Pointer to data to insert. NULL is allowed if xItemSize is 0. - * @param[in] xItemSize Size of data to insert. - * @param[out] pxHigherPriorityTaskWoken Value pointed to will be set to pdTRUE if the function woke up a higher priority task. - * - * @note For no-split/allow-split ring buffers, the actual size of memory that - * the item will occupy will be rounded up to the nearest 32-bit aligned - * size. This is done to ensure all items are always stored in 32-bit - * aligned fashion. - * - * @return - * - pdTRUE if succeeded - * - pdFALSE when the ring buffer does not have space. - */ -BaseType_t xRingbufferSendFromISR(RingbufHandle_t xRingbuffer, const void *pvItem, size_t xItemSize, BaseType_t *pxHigherPriorityTaskWoken); - -/** - * @brief Retrieve an item from the ring buffer - * - * Attempt to retrieve an item from the ring buffer. This function will block - * until an item is available or until it timesout. - * - * @param[in] xRingbuffer Ring buffer to retrieve the item from - * @param[out] pxItemSize Pointer to a variable to which the size of the retrieved item will be written. - * @param[in] xTicksToWait Ticks to wait for items in the ring buffer. - * - * @note A call to vRingbufferReturnItem() is required after this to free the item retrieved. - * - * @return - * - Pointer to the retrieved item on success; *pxItemSize filled with the length of the item. - * - NULL on timeout, *pxItemSize is untouched in that case. - */ -void *xRingbufferReceive(RingbufHandle_t xRingbuffer, size_t *pxItemSize, TickType_t xTicksToWait); - -/** - * @brief Retrieve an item from the ring buffer in an ISR - * - * Attempt to retrieve an item from the ring buffer. This function returns immediately - * if there are no items available for retrieval - * - * @param[in] xRingbuffer Ring buffer to retrieve the item from - * @param[out] pxItemSize Pointer to a variable to which the size of the - * retrieved item will be written. - * - * @note A call to vRingbufferReturnItemFromISR() is required after this to free the item retrieved. - * @note Byte buffers do not allow multiple retrievals before returning an item - * - * @return - * - Pointer to the retrieved item on success; *pxItemSize filled with the length of the item. - * - NULL when the ring buffer is empty, *pxItemSize is untouched in that case. - */ -void *xRingbufferReceiveFromISR(RingbufHandle_t xRingbuffer, size_t *pxItemSize); - -/** - * @brief Retrieve a split item from an allow-split ring buffer - * - * Attempt to retrieve a split item from an allow-split ring buffer. If the item - * is not split, only a single item is retried. If the item is split, both parts - * will be retrieved. This function will block until an item is available or - * until it timesout. - * - * @param[in] xRingbuffer Ring buffer to retrieve the item from - * @param[out] ppvHeadItem Double pointer to first part (set to NULL if no items were retrieved) - * @param[out] ppvTailItem Double pointer to second part (set to NULL if item is not split) - * @param[out] pxHeadItemSize Pointer to size of first part (unmodified if no items were retrieved) - * @param[out] pxTailItemSize Pointer to size of second part (unmodified if item is not split) - * @param[in] xTicksToWait Ticks to wait for items in the ring buffer. - * - * @note Call(s) to vRingbufferReturnItem() is required after this to free up the item(s) retrieved. - * @note This function should only be called on allow-split buffers - * - * @return - * - pdTRUE if an item (split or unsplit) was retrieved - * - pdFALSE when no item was retrieved - */ -BaseType_t xRingbufferReceiveSplit(RingbufHandle_t xRingbuffer, void **ppvHeadItem, void **ppvTailItem, size_t *pxHeadItemSize, size_t *pxTailItemSize, TickType_t xTicksToWait); - -/** - * @brief Retrieve a split item from an allow-split ring buffer in an ISR - * - * Attempt to retrieve a split item from an allow-split ring buffer. If the item - * is not split, only a single item is retried. If the item is split, both parts - * will be retrieved. This function returns immediately if there are no items - * available for retrieval - * - * @param[in] xRingbuffer Ring buffer to retrieve the item from - * @param[out] ppvHeadItem Double pointer to first part (set to NULL if no items were retrieved) - * @param[out] ppvTailItem Double pointer to second part (set to NULL if item is not split) - * @param[out] pxHeadItemSize Pointer to size of first part (unmodified if no items were retrieved) - * @param[out] pxTailItemSize Pointer to size of second part (unmodified if item is not split) - * - * @note Calls to vRingbufferReturnItemFromISR() is required after this to free up the item(s) retrieved. - * @note This function should only be called on allow-split buffers - * - * @return - * - pdTRUE if an item (split or unsplit) was retrieved - * - pdFALSE when no item was retrieved - */ -BaseType_t xRingbufferReceiveSplitFromISR(RingbufHandle_t xRingbuffer, void **ppvHeadItem, void **ppvTailItem, size_t *pxHeadItemSize, size_t *pxTailItemSize); - -/** - * @brief Retrieve bytes from a byte buffer, specifying the maximum amount of bytes to retrieve - * - * Attempt to retrieve data from a byte buffer whilst specifying a maximum number - * of bytes to retrieve. This function will block until there is data available - * for retrieval or until it timesout. - * - * @param[in] xRingbuffer Ring buffer to retrieve the item from - * @param[out] pxItemSize Pointer to a variable to which the size of the retrieved item will be written. - * @param[in] xTicksToWait Ticks to wait for items in the ring buffer. - * @param[in] xMaxSize Maximum number of bytes to return. - * - * @note A call to vRingbufferReturnItem() is required after this to free up the data retrieved. - * @note This function should only be called on byte buffers - * @note Byte buffers do not allow multiple retrievals before returning an item - * - * @return - * - Pointer to the retrieved item on success; *pxItemSize filled with - * the length of the item. - * - NULL on timeout, *pxItemSize is untouched in that case. - */ -void *xRingbufferReceiveUpTo(RingbufHandle_t xRingbuffer, size_t *pxItemSize, TickType_t xTicksToWait, size_t xMaxSize); - -/** - * @brief Retrieve bytes from a byte buffer, specifying the maximum amount of - * bytes to retrieve. Call this from an ISR. - * - * Attempt to retrieve bytes from a byte buffer whilst specifying a maximum number - * of bytes to retrieve. This function will return immediately if there is no data - * available for retrieval. - * - * @param[in] xRingbuffer Ring buffer to retrieve the item from - * @param[out] pxItemSize Pointer to a variable to which the size of the retrieved item will be written. - * @param[in] xMaxSize Maximum number of bytes to return. - * - * @note A call to vRingbufferReturnItemFromISR() is required after this to free up the data received. - * @note This function should only be called on byte buffers - * @note Byte buffers do not allow multiple retrievals before returning an item - * - * @return - * - Pointer to the retrieved item on success; *pxItemSize filled with - * the length of the item. - * - NULL when the ring buffer is empty, *pxItemSize is untouched in that case. - */ -void *xRingbufferReceiveUpToFromISR(RingbufHandle_t xRingbuffer, size_t *pxItemSize, size_t xMaxSize); - -/** - * @brief Return a previously-retrieved item to the ring buffer - * - * @param[in] xRingbuffer Ring buffer the item was retrieved from - * @param[in] pvItem Item that was received earlier - * - * @note If a split item is retrieved, both parts should be returned by calling this function twice - */ -void vRingbufferReturnItem(RingbufHandle_t xRingbuffer, void *pvItem); - -/** - * @brief Return a previously-retrieved item to the ring buffer from an ISR - * - * @param[in] xRingbuffer Ring buffer the item was retrieved from - * @param[in] pvItem Item that was received earlier - * @param[out] pxHigherPriorityTaskWoken Value pointed to will be set to pdTRUE - * if the function woke up a higher priority task. - * - * @note If a split item is retrieved, both parts should be returned by calling this function twice - */ -void vRingbufferReturnItemFromISR(RingbufHandle_t xRingbuffer, void *pvItem, BaseType_t *pxHigherPriorityTaskWoken); - -/** - * @brief Delete a ring buffer - * - * @param[in] xRingbuffer Ring buffer to delete - */ -void vRingbufferDelete(RingbufHandle_t xRingbuffer); - -/** - * @brief Get maximum size of an item that can be placed in the ring buffer - * - * This function returns the maximum size an item can have if it was placed in - * an empty ring buffer. - * - * @param[in] xRingbuffer Ring buffer to query - * - * @return Maximum size, in bytes, of an item that can be placed in a ring buffer. - */ -size_t xRingbufferGetMaxItemSize(RingbufHandle_t xRingbuffer); - -/** - * @brief Get current free size available for an item/data in the buffer - * - * This gives the real time free space available for an item/data in the ring - * buffer. This represents the maximum size an item/data can have if it was - * currently sent to the ring buffer. - * - * @warning This API is not thread safe. So, if multiple threads are accessing - * the same ring buffer, it is the application's responsibility to - * ensure atomic access to this API and the subsequent Send - * - * @param[in] xRingbuffer Ring buffer to query - * - * @return Current free size, in bytes, available for an entry - */ -size_t xRingbufferGetCurFreeSize(RingbufHandle_t xRingbuffer); - -/** - * @brief Add the ring buffer's read semaphore to a queue set. - * - * The ring buffer's read semaphore indicates that data has been written - * to the ring buffer. This function adds the ring buffer's read semaphore to - * a queue set. - * - * @param[in] xRingbuffer Ring buffer to add to the queue set - * @param[in] xQueueSet Queue set to add the ring buffer's read semaphore to - * - * @return - * - pdTRUE on success, pdFALSE otherwise - */ -BaseType_t xRingbufferAddToQueueSetRead(RingbufHandle_t xRingbuffer, QueueSetHandle_t xQueueSet); - - -/** - * @brief Check if the selected queue set member is the ring buffer's read semaphore - * - * This API checks if queue set member returned from xQueueSelectFromSet() - * is the read semaphore of this ring buffer. If so, this indicates the ring buffer - * has items waiting to be retrieved. - * - * @param[in] xRingbuffer Ring buffer which should be checked - * @param[in] xMember Member returned from xQueueSelectFromSet - * - * @return - * - pdTRUE when semaphore belongs to ring buffer - * - pdFALSE otherwise. - */ -BaseType_t xRingbufferCanRead(RingbufHandle_t xRingbuffer, QueueSetMemberHandle_t xMember); - -/** - * @brief Remove the ring buffer's read semaphore from a queue set. - * - * This specifically removes a ring buffer's read semaphore from a queue set. The - * read semaphore is used to indicate when data has been written to the ring buffer - * - * @param[in] xRingbuffer Ring buffer to remove from the queue set - * @param[in] xQueueSet Queue set to remove the ring buffer's read semaphore from - * - * @return - * - pdTRUE on success - * - pdFALSE otherwise - */ -BaseType_t xRingbufferRemoveFromQueueSetRead(RingbufHandle_t xRingbuffer, QueueSetHandle_t xQueueSet); - -/** - * @brief Get information about ring buffer status - * - * Get information of the a ring buffer's current status such as - * free/read/write pointer positions, and number of items waiting to be retrieved. - * Arguments can be set to NULL if they are not required. - * - * @param[in] xRingbuffer Ring buffer to remove from the queue set - * @param[out] uxFree Pointer use to store free pointer position - * @param[out] uxRead Pointer use to store read pointer position - * @param[out] uxWrite Pointer use to store write pointer position - * @param[out] uxItemsWaiting Pointer use to store number of items (bytes for byte buffer) waiting to be retrieved - */ -void vRingbufferGetInfo(RingbufHandle_t xRingbuffer, UBaseType_t *uxFree, UBaseType_t *uxRead, UBaseType_t *uxWrite, UBaseType_t *uxItemsWaiting); - -/** - * @brief Debugging function to print the internal pointers in the ring buffer - * - * @param xRingbuffer Ring buffer to show - */ -void xRingbufferPrintInfo(RingbufHandle_t xRingbuffer); - -/* -------------------------------- Deprecated Functions --------------------------- */ - -/** @cond */ //Doxygen command to hide deprecated function from API Reference -/* - * Deprecated as function is not thread safe and does not check if an item is - * actually available for retrieval. Use xRingbufferReceiveSplit() instead for - * thread safe method of retrieve a split item. - */ -bool xRingbufferIsNextItemWrapped(RingbufHandle_t xRingbuffer) __attribute__((deprecated)); - -/* - * Deprecated as queue sets are not meant to be used for writing to buffers. Adding - * the ring buffer write semaphore to a queue set will break queue set usage rules, - * as every read of a semaphore must be preceded by a call to xQueueSelectFromSet(). - * QueueSetWrite no longer supported. - */ -BaseType_t xRingbufferAddToQueueSetWrite(RingbufHandle_t xRingbuffer, QueueSetHandle_t xQueueSet) __attribute__((deprecated)); - -/* - * Deprecated as queue sets are not meant to be used for writing to buffers. - * QueueSetWrite no longer supported. - */ -BaseType_t xRingbufferRemoveFromQueueSetWrite(RingbufHandle_t xRingbuffer, QueueSetHandle_t xQueueSet) __attribute__((deprecated)); -/** @endcond */ - -#ifdef __cplusplus -} -#endif - -#endif /* FREERTOS_RINGBUF_H */ - diff --git a/tools/sdk/include/ethernet/esp_eth.h b/tools/sdk/include/ethernet/esp_eth.h deleted file mode 100644 index f22cf4f7013..00000000000 --- a/tools/sdk/include/ethernet/esp_eth.h +++ /dev/null @@ -1,308 +0,0 @@ -// 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. - -#ifndef __ESP_ETH_H__ -#define __ESP_ETH_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "esp_types.h" -#include "esp_err.h" - -/** - * @brief Ethernet interface mode - * - */ -typedef enum { - ETH_MODE_RMII = 0, /*!< RMII mode */ - ETH_MODE_MII, /*!< MII mode */ -} eth_mode_t; - -/** - * @brief Ethernet clock mode - * - */ -typedef enum { - ETH_CLOCK_GPIO0_IN = 0, /*!< RMII clock input to GPIO0 */ - ETH_CLOCK_GPIO0_OUT = 1, /*!< RMII clock output from GPIO0 */ - ETH_CLOCK_GPIO16_OUT = 2, /*!< RMII clock output from GPIO16 */ - ETH_CLOCK_GPIO17_OUT = 3 /*!< RMII clock output from GPIO17 */ -} eth_clock_mode_t; - -/** - * @brief Ethernet Speed - * - */ -typedef enum { - ETH_SPEED_MODE_10M = 0, /*!< Ethernet speed: 10Mbps */ - ETH_SPEED_MODE_100M, /*!< Ethernet speed: 100Mbps */ -} eth_speed_mode_t; - -/** - * @brief Ethernet Duplex - * - */ -typedef enum { - ETH_MODE_HALFDUPLEX = 0, /*!< Ethernet half duplex */ - ETH_MODE_FULLDUPLEX, /*!< Ethernet full duplex */ -} eth_duplex_mode_t; - -/** - * @brief Ethernet PHY address - * - */ -typedef enum { - PHY0 = 0, /*!< PHY address 0 */ - PHY1, /*!< PHY address 1 */ - PHY2, /*!< PHY address 2 */ - PHY3, /*!< PHY address 3 */ - PHY4, /*!< PHY address 4 */ - PHY5, /*!< PHY address 5 */ - PHY6, /*!< PHY address 6 */ - PHY7, /*!< PHY address 7 */ - PHY8, /*!< PHY address 8 */ - PHY9, /*!< PHY address 9 */ - PHY10, /*!< PHY address 10 */ - PHY11, /*!< PHY address 11 */ - PHY12, /*!< PHY address 12 */ - PHY13, /*!< PHY address 13 */ - PHY14, /*!< PHY address 14 */ - PHY15, /*!< PHY address 15 */ - PHY16, /*!< PHY address 16 */ - PHY17, /*!< PHY address 17 */ - PHY18, /*!< PHY address 18 */ - PHY19, /*!< PHY address 19 */ - PHY20, /*!< PHY address 20 */ - PHY21, /*!< PHY address 21 */ - PHY22, /*!< PHY address 22 */ - PHY23, /*!< PHY address 23 */ - PHY24, /*!< PHY address 24 */ - PHY25, /*!< PHY address 25 */ - PHY26, /*!< PHY address 26 */ - PHY27, /*!< PHY address 27 */ - PHY28, /*!< PHY address 28 */ - PHY29, /*!< PHY address 29 */ - PHY30, /*!< PHY address 30 */ - PHY31 /*!< PHY address 31 */ -} eth_phy_base_t; - -typedef bool (*eth_phy_check_link_func)(void); -typedef void (*eth_phy_check_init_func)(void); -typedef eth_speed_mode_t (*eth_phy_get_speed_mode_func)(void); -typedef eth_duplex_mode_t (*eth_phy_get_duplex_mode_func)(void); -typedef esp_err_t (*eth_phy_func)(void); -typedef esp_err_t (*eth_tcpip_input_func)(void *buffer, uint16_t len, void *eb); -typedef void (*eth_gpio_config_func)(void); -typedef bool (*eth_phy_get_partner_pause_enable_func)(void); -typedef void (*eth_phy_power_enable_func)(bool enable); - -/** - * @brief ethernet configuration - * - */ -typedef struct { - eth_phy_base_t phy_addr; /*!< PHY address (0~31) */ - eth_mode_t mac_mode; /*!< MAC mode: only support RMII now */ - eth_clock_mode_t clock_mode; /*!< external/internal clock mode selection */ - eth_tcpip_input_func tcpip_input; /*!< tcpip input func */ - eth_phy_func phy_init; /*!< phy init func */ - eth_phy_check_link_func phy_check_link; /*!< phy check link func */ - eth_phy_check_init_func phy_check_init; /*!< phy check init func */ - eth_phy_get_speed_mode_func phy_get_speed_mode; /*!< phy check init func */ - eth_phy_get_duplex_mode_func phy_get_duplex_mode; /*!< phy check init func */ - eth_gpio_config_func gpio_config; /*!< gpio config func */ - bool flow_ctrl_enable; /*!< flag of flow ctrl enable */ - eth_phy_get_partner_pause_enable_func phy_get_partner_pause_enable; /*!< get partner pause enable */ - eth_phy_power_enable_func phy_power_enable; /*!< enable or disable phy power */ - uint32_t reset_timeout_ms; /*!< timeout value for reset emac */ - bool promiscuous_enable; /*!< set true to enable promiscuous mode */ -} eth_config_t; - -/** - * @brief Init ethernet mac - * - * @note config can not be NULL, and phy chip must be suitable to phy init func. - * - * @param[in] config mac init data. - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_eth_init(eth_config_t *config); - -/** - * @brief Deinit ethernet mac - * - * @return - * - ESP_OK - * - ESP_FAIL - * - ESP_ERR_INVALID_STATE - */ -esp_err_t esp_eth_deinit(void); - -/** - * @brief Init Ethernet mac driver only - * - * For the most part, you need not call this function directly. It gets called - * from esp_eth_init(). - * - * This function may be called, if you only need to initialize the Ethernet - * driver without having to use the network stack on top. - * - * @note config can not be NULL, and phy chip must be suitable to phy init func. - * @param[in] config mac init data. - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_eth_init_internal(eth_config_t *config); - -/** - * @brief Send packet from tcp/ip to mac - * - * @note buf can not be NULL, size must be less than 1580 - * - * @param[in] buf: start address of packet data. - * - * @param[in] size: size (byte) of packet data. - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_eth_tx(uint8_t *buf, uint16_t size); - -/** - * @brief Enable ethernet interface - * - * @note Should be called after esp_eth_init - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_eth_enable(void); - -/** - * @brief Disable ethernet interface - * - * @note Should be called after esp_eth_init - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_eth_disable(void); - -/** - * @brief Get mac addr - * - * @note mac addr must be a valid unicast address - * - * @param[out] mac: start address of mac address. - */ -void esp_eth_get_mac(uint8_t mac[6]); - -/** - * @brief Write PHY reg with SMI interface. - * - * @note PHY base addr must be right. - * - * @param[in] reg_num: PHY reg num. - * - * @param[in] value: value which is written to PHY reg. - */ -void esp_eth_smi_write(uint32_t reg_num, uint16_t value); - -/** - * @brief Read PHY reg with SMI interface. - * - * @note PHY base addr must be right. - * - * @param[in] reg_num: PHY reg num. - * - * @return value that is read from PHY reg - */ -uint16_t esp_eth_smi_read(uint32_t reg_num); - -/** - * @brief Continuously read a PHY register over SMI interface, wait until the register has the desired value. - * - * @note PHY base address must be right. - * - * @param reg_num: PHY register number - * @param value: Value to wait for (masked with value_mask) - * @param value_mask: Mask of bits to match in the register. - * @param timeout_ms: Timeout to wait for this value (milliseconds). 0 means never timeout. - * - * @return ESP_OK if desired value matches, ESP_ERR_TIMEOUT if timed out. - */ -esp_err_t esp_eth_smi_wait_value(uint32_t reg_num, uint16_t value, uint16_t value_mask, int timeout_ms); - -/** - * @brief Continuously read a PHY register over SMI interface, wait until the register has all bits in a mask set. - * - * @note PHY base address must be right. - * - * @param reg_num: PHY register number - * @param value_mask: Value mask to wait for (all bits in this mask must be set) - * @param timeout_ms: Timeout to wait for this value (milliseconds). 0 means never timeout. - * - * @return ESP_OK if desired value matches, ESP_ERR_TIMEOUT if timed out. - */ -static inline esp_err_t esp_eth_smi_wait_set(uint32_t reg_num, uint16_t value_mask, int timeout_ms) -{ - return esp_eth_smi_wait_value(reg_num, value_mask, value_mask, timeout_ms); -} - -/** - * @brief Free emac rx buf. - * - * @note buf can not be null, and it is tcpip input buf. - * - * @param[in] buf: start address of received packet data. - * - */ -void esp_eth_free_rx_buf(void *buf); - -/** - * @brief Set mac of ethernet interface. - * - * @note user can call this function after emac_init, and the new mac address will be enabled after emac_enable. - * - * @param[in] mac: the Mac address. - * - * @return - * - ESP_OK: succeed - * - ESP_ERR_INVALID_MAC: invalid mac address - */ -esp_err_t esp_eth_set_mac(const uint8_t mac[6]); - -/** - * @brief Get Ethernet link speed - * - * @return eth_speed_mode_t ETH_SPEED_MODE_10M when link speed is 10Mbps - * ETH_SPEED_MODE_100M when link speed is 100Mbps - */ -eth_speed_mode_t esp_eth_get_speed(void); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/ethernet/eth_phy/phy.h b/tools/sdk/include/ethernet/eth_phy/phy.h deleted file mode 100644 index d38e9819d6d..00000000000 --- a/tools/sdk/include/ethernet/eth_phy/phy.h +++ /dev/null @@ -1,76 +0,0 @@ -// 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. - -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -#include "esp_eth.h" - -/** - * @brief Common PHY-management functions. - * - * @note These are not enough to drive any particular Ethernet PHY. - * They provide a common configuration structure and management functions. - * - */ - -/** - * @brief Configure fixed pins for RMII data interface. - * - * @note This configures GPIOs 0, 19, 22, 25, 26, 27 for use with RMII data interface. - * These pins cannot be changed, and must be wired to ethernet functions. - * This is not sufficient to fully configure the Ethernet PHY. - * MDIO configuration interface pins (such as SMI MDC, MDO, MDI) must also be configured correctly in the GPIO matrix. - * - */ -void phy_rmii_configure_data_interface_pins(void); - -/** - * @brief Configure variable pins for SMI ethernet functions. - * - * @param mdc_gpio MDC GPIO Pin number - * @param mdio_gpio MDIO GPIO Pin number - * - * @note Calling this function along with mii_configure_default_pins() will fully configure the GPIOs for the ethernet PHY. - */ -void phy_rmii_smi_configure_pins(uint8_t mdc_gpio, uint8_t mdio_gpio); - -/** - * @brief Enable flow control in standard PHY MII register. - * - */ -void phy_mii_enable_flow_ctrl(void); - -/** - * @brief Check Ethernet link status via MII interface - * - * @return true Link is on - * @return false Link is off - */ -bool phy_mii_check_link_status(void); - -/** - * @brief Check pause frame ability of partner via MII interface - * - * @return true Partner is able to process pause frame - * @return false Partner can not process pause frame - */ -bool phy_mii_get_partner_pause_enable(void); - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/ethernet/eth_phy/phy_ip101.h b/tools/sdk/include/ethernet/eth_phy/phy_ip101.h deleted file mode 100644 index d18ef2d0964..00000000000 --- a/tools/sdk/include/ethernet/eth_phy/phy_ip101.h +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2015-2019 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. - -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -#include "phy.h" - -/** - * @brief Dump IP101 PHY SMI configuration registers - * - */ -void phy_ip101_dump_registers(); - -/** - * @brief Default IP101 phy_check_init function - * - */ -void phy_ip101_check_phy_init(void); - -/** - * @brief Default IP101 phy_get_speed_mode function - * - * @return eth_speed_mode_t Ethernet speed mode - */ -eth_speed_mode_t phy_ip101_get_speed_mode(void); - -/** - * @brief Default IP101 phy_get_duplex_mode function - * - * @return eth_duplex_mode_t Ethernet duplex mode - */ -eth_duplex_mode_t phy_ip101_get_duplex_mode(void); - -/** - * @brief Default IP101 phy_power_enable function - * - */ -void phy_ip101_power_enable(bool); - -/** - * @brief Default IP101 phy_init function - * - * @return esp_err_t - * - ESP_OK on success - * - ESP_FAIL on error - */ -esp_err_t phy_ip101_init(void); - -/** - * @brief Default IP101 PHY configuration - * - * @note This configuration is not suitable for use as-is, - * it will need to be modified for your particular PHY hardware setup. - * - */ -extern const eth_config_t phy_ip101_default_ethernet_config; - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/ethernet/eth_phy/phy_lan8720.h b/tools/sdk/include/ethernet/eth_phy/phy_lan8720.h deleted file mode 100644 index 1448f36556c..00000000000 --- a/tools/sdk/include/ethernet/eth_phy/phy_lan8720.h +++ /dev/null @@ -1,75 +0,0 @@ -// 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. - -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -#include "phy.h" - -/** - * @brief Dump LAN8720 PHY SMI configuration registers - * - */ -void phy_lan8720_dump_registers(); - -/** - * @brief Default LAN8720 phy_check_init function - * - */ -void phy_lan8720_check_phy_init(void); - -/** - * @brief Default LAN8720 phy_get_speed_mode function - * - * @return eth_speed_mode_t Ethernet speed mode - */ -eth_speed_mode_t phy_lan8720_get_speed_mode(void); - -/** - * @brief Default LAN8720 phy_get_duplex_mode function - * - * @return eth_duplex_mode_t Ethernet duplex mode - */ -eth_duplex_mode_t phy_lan8720_get_duplex_mode(void); - -/** - * @brief Default LAN8720 phy_power_enable function - * - */ -void phy_lan8720_power_enable(bool); - -/** - * @brief Default LAN8720 phy_init function - * - * @return esp_err_t - * - ESP_OK on success - * - ESP_FAIL on error - */ -esp_err_t phy_lan8720_init(void); - -/** - * @brief Default LAN8720 PHY configuration - * - * @note This configuration is not suitable for use as-is, - * it will need to be modified for your particular PHY hardware setup. - * - */ -extern const eth_config_t phy_lan8720_default_ethernet_config; - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/ethernet/eth_phy/phy_reg.h b/tools/sdk/include/ethernet/eth_phy/phy_reg.h deleted file mode 100644 index 2a9a141676a..00000000000 --- a/tools/sdk/include/ethernet/eth_phy/phy_reg.h +++ /dev/null @@ -1,54 +0,0 @@ -// 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. - -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief This header contains register/bit masks for the standard PHY MII registers that should be supported by all PHY models. - * - */ - -#define MII_BASIC_MODE_CONTROL_REG (0x0) -#define MII_SOFTWARE_RESET BIT(15) -#define MII_SPEED_SELECT BIT(13) -#define MII_AUTO_NEGOTIATION_ENABLE BIT(12) -#define MII_POWER_DOWN BIT(11) -#define MII_RESTART_AUTO_NEGOTIATION BIT(9) -#define MII_DUPLEX_MODE BIT(8) - -#define MII_BASIC_MODE_STATUS_REG (0x1) -#define MII_AUTO_NEGOTIATION_COMPLETE BIT(5) -#define MII_LINK_STATUS BIT(2) - -#define MII_PHY_IDENTIFIER_1_REG (0x2) -#define MII_PHY_IDENTIFIER_2_REG (0x3) - -#define MII_AUTO_NEGOTIATION_ADVERTISEMENT_REG (0x4) -#define MII_ASM_DIR BIT(11) -#define MII_PAUSE BIT(10) - -#define MII_PHY_LINK_PARTNER_ABILITY_REG (0x5) -#define MII_PARTNER_ASM_DIR BIT(11) -#define MII_PARTNER_PAUSE BIT(10) - -/******************************legacy*******************************/ -#define MII_AUTO_NEG_ADVERTISEMENT_REG MII_AUTO_NEGOTIATION_ADVERTISEMENT_REG - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/ethernet/eth_phy/phy_tlk110.h b/tools/sdk/include/ethernet/eth_phy/phy_tlk110.h deleted file mode 100644 index 077f13cece0..00000000000 --- a/tools/sdk/include/ethernet/eth_phy/phy_tlk110.h +++ /dev/null @@ -1,75 +0,0 @@ -// 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. - -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -#include "phy.h" - -/** - * @brief Dump TLK110 PHY SMI configuration registers - * - */ -void phy_tlk110_dump_registers(); - -/** - * @brief Default TLK110 phy_check_init function - * - */ -void phy_tlk110_check_phy_init(void); - -/** - * @brief Default TLK110 phy_get_speed_mode function - * - * @return eth_speed_mode_t Ethernet speed mode - */ -eth_speed_mode_t phy_tlk110_get_speed_mode(void); - -/** - * @brief Default TLK110 phy_get_duplex_mode function - * - * @return eth_duplex_mode_t Ethernet duplex mode - */ -eth_duplex_mode_t phy_tlk110_get_duplex_mode(void); - -/** - * @brief Default TLK110 phy_power_enable function - * - */ -void phy_tlk110_power_enable(bool); - -/** - * @brief Default TLK110 phy_init function - * - * @return esp_err_t - * - ESP_OK on success - * - ESP_FAIL on error - */ -esp_err_t phy_tlk110_init(void); - -/** - * @brief Default TLK110 PHY configuration - * - * @note This configuration is not suitable for use as-is, - * it will need to be modified for your particular PHY hardware setup. - * - */ -extern const eth_config_t phy_tlk110_default_ethernet_config; - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/expat/ascii.h b/tools/sdk/include/expat/ascii.h deleted file mode 100644 index c3587e57332..00000000000 --- a/tools/sdk/include/expat/ascii.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 1997-2000 Thai Open Source Software Center Ltd - Copyright (c) 2000-2017 Expat development team - Licensed under the MIT license: - - 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. -*/ - -#define ASCII_A 0x41 -#define ASCII_B 0x42 -#define ASCII_C 0x43 -#define ASCII_D 0x44 -#define ASCII_E 0x45 -#define ASCII_F 0x46 -#define ASCII_G 0x47 -#define ASCII_H 0x48 -#define ASCII_I 0x49 -#define ASCII_J 0x4A -#define ASCII_K 0x4B -#define ASCII_L 0x4C -#define ASCII_M 0x4D -#define ASCII_N 0x4E -#define ASCII_O 0x4F -#define ASCII_P 0x50 -#define ASCII_Q 0x51 -#define ASCII_R 0x52 -#define ASCII_S 0x53 -#define ASCII_T 0x54 -#define ASCII_U 0x55 -#define ASCII_V 0x56 -#define ASCII_W 0x57 -#define ASCII_X 0x58 -#define ASCII_Y 0x59 -#define ASCII_Z 0x5A - -#define ASCII_a 0x61 -#define ASCII_b 0x62 -#define ASCII_c 0x63 -#define ASCII_d 0x64 -#define ASCII_e 0x65 -#define ASCII_f 0x66 -#define ASCII_g 0x67 -#define ASCII_h 0x68 -#define ASCII_i 0x69 -#define ASCII_j 0x6A -#define ASCII_k 0x6B -#define ASCII_l 0x6C -#define ASCII_m 0x6D -#define ASCII_n 0x6E -#define ASCII_o 0x6F -#define ASCII_p 0x70 -#define ASCII_q 0x71 -#define ASCII_r 0x72 -#define ASCII_s 0x73 -#define ASCII_t 0x74 -#define ASCII_u 0x75 -#define ASCII_v 0x76 -#define ASCII_w 0x77 -#define ASCII_x 0x78 -#define ASCII_y 0x79 -#define ASCII_z 0x7A - -#define ASCII_0 0x30 -#define ASCII_1 0x31 -#define ASCII_2 0x32 -#define ASCII_3 0x33 -#define ASCII_4 0x34 -#define ASCII_5 0x35 -#define ASCII_6 0x36 -#define ASCII_7 0x37 -#define ASCII_8 0x38 -#define ASCII_9 0x39 - -#define ASCII_TAB 0x09 -#define ASCII_SPACE 0x20 -#define ASCII_EXCL 0x21 -#define ASCII_QUOT 0x22 -#define ASCII_AMP 0x26 -#define ASCII_APOS 0x27 -#define ASCII_MINUS 0x2D -#define ASCII_PERIOD 0x2E -#define ASCII_COLON 0x3A -#define ASCII_SEMI 0x3B -#define ASCII_LT 0x3C -#define ASCII_EQUALS 0x3D -#define ASCII_GT 0x3E -#define ASCII_LSQB 0x5B -#define ASCII_RSQB 0x5D -#define ASCII_UNDERSCORE 0x5F -#define ASCII_LPAREN 0x28 -#define ASCII_RPAREN 0x29 -#define ASCII_FF 0x0C -#define ASCII_SLASH 0x2F -#define ASCII_HASH 0x23 -#define ASCII_PIPE 0x7C -#define ASCII_COMMA 0x2C diff --git a/tools/sdk/include/expat/asciitab.h b/tools/sdk/include/expat/asciitab.h deleted file mode 100644 index 2f59fd92906..00000000000 --- a/tools/sdk/include/expat/asciitab.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 1997-2000 Thai Open Source Software Center Ltd - Copyright (c) 2000-2017 Expat development team - Licensed under the MIT license: - - 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. -*/ - -/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, -/* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML, -/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, -/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, -/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, -/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, -/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, -/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, -/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, -/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, -/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, -/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, -/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, -/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, -/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, -/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, -/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, -/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, diff --git a/tools/sdk/include/expat/expat.h b/tools/sdk/include/expat/expat.h deleted file mode 100644 index 1f608c02d6f..00000000000 --- a/tools/sdk/include/expat/expat.h +++ /dev/null @@ -1,1085 +0,0 @@ -/* - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 1997-2000 Thai Open Source Software Center Ltd - Copyright (c) 2000-2017 Expat development team - Licensed under the MIT license: - - 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. -*/ - -#ifndef Expat_INCLUDED -#define Expat_INCLUDED 1 - -#ifdef __VMS -/* 0 1 2 3 0 1 2 3 - 1234567890123456789012345678901 1234567890123456789012345678901 */ -#define XML_SetProcessingInstructionHandler XML_SetProcessingInstrHandler -#define XML_SetUnparsedEntityDeclHandler XML_SetUnparsedEntDeclHandler -#define XML_SetStartNamespaceDeclHandler XML_SetStartNamespcDeclHandler -#define XML_SetExternalEntityRefHandlerArg XML_SetExternalEntRefHandlerArg -#endif - -#include -#include "expat_external.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct XML_ParserStruct; -typedef struct XML_ParserStruct *XML_Parser; - -typedef unsigned char XML_Bool; -#define XML_TRUE ((XML_Bool) 1) -#define XML_FALSE ((XML_Bool) 0) - -/* The XML_Status enum gives the possible return values for several - API functions. The preprocessor #defines are included so this - stanza can be added to code that still needs to support older - versions of Expat 1.95.x: - - #ifndef XML_STATUS_OK - #define XML_STATUS_OK 1 - #define XML_STATUS_ERROR 0 - #endif - - Otherwise, the #define hackery is quite ugly and would have been - dropped. -*/ -enum XML_Status { - XML_STATUS_ERROR = 0, -#define XML_STATUS_ERROR XML_STATUS_ERROR - XML_STATUS_OK = 1, -#define XML_STATUS_OK XML_STATUS_OK - XML_STATUS_SUSPENDED = 2 -#define XML_STATUS_SUSPENDED XML_STATUS_SUSPENDED -}; - -enum XML_Error { - XML_ERROR_NONE, - XML_ERROR_NO_MEMORY, - XML_ERROR_SYNTAX, - XML_ERROR_NO_ELEMENTS, - XML_ERROR_INVALID_TOKEN, - XML_ERROR_UNCLOSED_TOKEN, - XML_ERROR_PARTIAL_CHAR, - XML_ERROR_TAG_MISMATCH, - XML_ERROR_DUPLICATE_ATTRIBUTE, - XML_ERROR_JUNK_AFTER_DOC_ELEMENT, - XML_ERROR_PARAM_ENTITY_REF, - XML_ERROR_UNDEFINED_ENTITY, - XML_ERROR_RECURSIVE_ENTITY_REF, - XML_ERROR_ASYNC_ENTITY, - XML_ERROR_BAD_CHAR_REF, - XML_ERROR_BINARY_ENTITY_REF, - XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF, - XML_ERROR_MISPLACED_XML_PI, - XML_ERROR_UNKNOWN_ENCODING, - XML_ERROR_INCORRECT_ENCODING, - XML_ERROR_UNCLOSED_CDATA_SECTION, - XML_ERROR_EXTERNAL_ENTITY_HANDLING, - XML_ERROR_NOT_STANDALONE, - XML_ERROR_UNEXPECTED_STATE, - XML_ERROR_ENTITY_DECLARED_IN_PE, - XML_ERROR_FEATURE_REQUIRES_XML_DTD, - XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING, - /* Added in 1.95.7. */ - XML_ERROR_UNBOUND_PREFIX, - /* Added in 1.95.8. */ - XML_ERROR_UNDECLARING_PREFIX, - XML_ERROR_INCOMPLETE_PE, - XML_ERROR_XML_DECL, - XML_ERROR_TEXT_DECL, - XML_ERROR_PUBLICID, - XML_ERROR_SUSPENDED, - XML_ERROR_NOT_SUSPENDED, - XML_ERROR_ABORTED, - XML_ERROR_FINISHED, - XML_ERROR_SUSPEND_PE, - /* Added in 2.0. */ - XML_ERROR_RESERVED_PREFIX_XML, - XML_ERROR_RESERVED_PREFIX_XMLNS, - XML_ERROR_RESERVED_NAMESPACE_URI, - /* Added in 2.2.1. */ - XML_ERROR_INVALID_ARGUMENT -}; - -enum XML_Content_Type { - XML_CTYPE_EMPTY = 1, - XML_CTYPE_ANY, - XML_CTYPE_MIXED, - XML_CTYPE_NAME, - XML_CTYPE_CHOICE, - XML_CTYPE_SEQ -}; - -enum XML_Content_Quant { - XML_CQUANT_NONE, - XML_CQUANT_OPT, - XML_CQUANT_REP, - XML_CQUANT_PLUS -}; - -/* If type == XML_CTYPE_EMPTY or XML_CTYPE_ANY, then quant will be - XML_CQUANT_NONE, and the other fields will be zero or NULL. - If type == XML_CTYPE_MIXED, then quant will be NONE or REP and - numchildren will contain number of elements that may be mixed in - and children point to an array of XML_Content cells that will be - all of XML_CTYPE_NAME type with no quantification. - - If type == XML_CTYPE_NAME, then the name points to the name, and - the numchildren field will be zero and children will be NULL. The - quant fields indicates any quantifiers placed on the name. - - CHOICE and SEQ will have name NULL, the number of children in - numchildren and children will point, recursively, to an array - of XML_Content cells. - - The EMPTY, ANY, and MIXED types will only occur at top level. -*/ - -typedef struct XML_cp XML_Content; - -struct XML_cp { - enum XML_Content_Type type; - enum XML_Content_Quant quant; - XML_Char * name; - unsigned int numchildren; - XML_Content * children; -}; - - -/* This is called for an element declaration. See above for - description of the model argument. It's the caller's responsibility - to free model when finished with it. -*/ -typedef void (XMLCALL *XML_ElementDeclHandler) (void *userData, - const XML_Char *name, - XML_Content *model); - -XMLPARSEAPI(void) -XML_SetElementDeclHandler(XML_Parser parser, - XML_ElementDeclHandler eldecl); - -/* The Attlist declaration handler is called for *each* attribute. So - a single Attlist declaration with multiple attributes declared will - generate multiple calls to this handler. The "default" parameter - may be NULL in the case of the "#IMPLIED" or "#REQUIRED" - keyword. The "isrequired" parameter will be true and the default - value will be NULL in the case of "#REQUIRED". If "isrequired" is - true and default is non-NULL, then this is a "#FIXED" default. -*/ -typedef void (XMLCALL *XML_AttlistDeclHandler) ( - void *userData, - const XML_Char *elname, - const XML_Char *attname, - const XML_Char *att_type, - const XML_Char *dflt, - int isrequired); - -XMLPARSEAPI(void) -XML_SetAttlistDeclHandler(XML_Parser parser, - XML_AttlistDeclHandler attdecl); - -/* The XML declaration handler is called for *both* XML declarations - and text declarations. The way to distinguish is that the version - parameter will be NULL for text declarations. The encoding - parameter may be NULL for XML declarations. The standalone - parameter will be -1, 0, or 1 indicating respectively that there - was no standalone parameter in the declaration, that it was given - as no, or that it was given as yes. -*/ -typedef void (XMLCALL *XML_XmlDeclHandler) (void *userData, - const XML_Char *version, - const XML_Char *encoding, - int standalone); - -XMLPARSEAPI(void) -XML_SetXmlDeclHandler(XML_Parser parser, - XML_XmlDeclHandler xmldecl); - - -typedef struct { - void *(*malloc_fcn)(size_t size); - void *(*realloc_fcn)(void *ptr, size_t size); - void (*free_fcn)(void *ptr); -} XML_Memory_Handling_Suite; - -/* Constructs a new parser; encoding is the encoding specified by the - external protocol or NULL if there is none specified. -*/ -XMLPARSEAPI(XML_Parser) -XML_ParserCreate(const XML_Char *encoding); - -/* Constructs a new parser and namespace processor. Element type - names and attribute names that belong to a namespace will be - expanded; unprefixed attribute names are never expanded; unprefixed - element type names are expanded only if there is a default - namespace. The expanded name is the concatenation of the namespace - URI, the namespace separator character, and the local part of the - name. If the namespace separator is '\0' then the namespace URI - and the local part will be concatenated without any separator. - It is a programming error to use the separator '\0' with namespace - triplets (see XML_SetReturnNSTriplet). -*/ -XMLPARSEAPI(XML_Parser) -XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator); - - -/* Constructs a new parser using the memory management suite referred to - by memsuite. If memsuite is NULL, then use the standard library memory - suite. If namespaceSeparator is non-NULL it creates a parser with - namespace processing as described above. The character pointed at - will serve as the namespace separator. - - All further memory operations used for the created parser will come from - the given suite. -*/ -XMLPARSEAPI(XML_Parser) -XML_ParserCreate_MM(const XML_Char *encoding, - const XML_Memory_Handling_Suite *memsuite, - const XML_Char *namespaceSeparator); - -/* Prepare a parser object to be re-used. This is particularly - valuable when memory allocation overhead is disproportionatly high, - such as when a large number of small documnents need to be parsed. - All handlers are cleared from the parser, except for the - unknownEncodingHandler. The parser's external state is re-initialized - except for the values of ns and ns_triplets. - - Added in Expat 1.95.3. -*/ -XMLPARSEAPI(XML_Bool) -XML_ParserReset(XML_Parser parser, const XML_Char *encoding); - -/* atts is array of name/value pairs, terminated by 0; - names and values are 0 terminated. -*/ -typedef void (XMLCALL *XML_StartElementHandler) (void *userData, - const XML_Char *name, - const XML_Char **atts); - -typedef void (XMLCALL *XML_EndElementHandler) (void *userData, - const XML_Char *name); - - -/* s is not 0 terminated. */ -typedef void (XMLCALL *XML_CharacterDataHandler) (void *userData, - const XML_Char *s, - int len); - -/* target and data are 0 terminated */ -typedef void (XMLCALL *XML_ProcessingInstructionHandler) ( - void *userData, - const XML_Char *target, - const XML_Char *data); - -/* data is 0 terminated */ -typedef void (XMLCALL *XML_CommentHandler) (void *userData, - const XML_Char *data); - -typedef void (XMLCALL *XML_StartCdataSectionHandler) (void *userData); -typedef void (XMLCALL *XML_EndCdataSectionHandler) (void *userData); - -/* This is called for any characters in the XML document for which - there is no applicable handler. This includes both characters that - are part of markup which is of a kind that is not reported - (comments, markup declarations), or characters that are part of a - construct which could be reported but for which no handler has been - supplied. The characters are passed exactly as they were in the XML - document except that they will be encoded in UTF-8 or UTF-16. - Line boundaries are not normalized. Note that a byte order mark - character is not passed to the default handler. There are no - guarantees about how characters are divided between calls to the - default handler: for example, a comment might be split between - multiple calls. -*/ -typedef void (XMLCALL *XML_DefaultHandler) (void *userData, - const XML_Char *s, - int len); - -/* This is called for the start of the DOCTYPE declaration, before - any DTD or internal subset is parsed. -*/ -typedef void (XMLCALL *XML_StartDoctypeDeclHandler) ( - void *userData, - const XML_Char *doctypeName, - const XML_Char *sysid, - const XML_Char *pubid, - int has_internal_subset); - -/* This is called for the start of the DOCTYPE declaration when the - closing > is encountered, but after processing any external - subset. -*/ -typedef void (XMLCALL *XML_EndDoctypeDeclHandler)(void *userData); - -/* This is called for entity declarations. The is_parameter_entity - argument will be non-zero if the entity is a parameter entity, zero - otherwise. - - For internal entities (), value will - be non-NULL and systemId, publicID, and notationName will be NULL. - The value string is NOT nul-terminated; the length is provided in - the value_length argument. Since it is legal to have zero-length - values, do not use this argument to test for internal entities. - - For external entities, value will be NULL and systemId will be - non-NULL. The publicId argument will be NULL unless a public - identifier was provided. The notationName argument will have a - non-NULL value only for unparsed entity declarations. - - Note that is_parameter_entity can't be changed to XML_Bool, since - that would break binary compatibility. -*/ -typedef void (XMLCALL *XML_EntityDeclHandler) ( - void *userData, - const XML_Char *entityName, - int is_parameter_entity, - const XML_Char *value, - int value_length, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId, - const XML_Char *notationName); - -XMLPARSEAPI(void) -XML_SetEntityDeclHandler(XML_Parser parser, - XML_EntityDeclHandler handler); - -/* OBSOLETE -- OBSOLETE -- OBSOLETE - This handler has been superseded by the EntityDeclHandler above. - It is provided here for backward compatibility. - - This is called for a declaration of an unparsed (NDATA) entity. - The base argument is whatever was set by XML_SetBase. The - entityName, systemId and notationName arguments will never be - NULL. The other arguments may be. -*/ -typedef void (XMLCALL *XML_UnparsedEntityDeclHandler) ( - void *userData, - const XML_Char *entityName, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId, - const XML_Char *notationName); - -/* This is called for a declaration of notation. The base argument is - whatever was set by XML_SetBase. The notationName will never be - NULL. The other arguments can be. -*/ -typedef void (XMLCALL *XML_NotationDeclHandler) ( - void *userData, - const XML_Char *notationName, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId); - -/* When namespace processing is enabled, these are called once for - each namespace declaration. The call to the start and end element - handlers occur between the calls to the start and end namespace - declaration handlers. For an xmlns attribute, prefix will be - NULL. For an xmlns="" attribute, uri will be NULL. -*/ -typedef void (XMLCALL *XML_StartNamespaceDeclHandler) ( - void *userData, - const XML_Char *prefix, - const XML_Char *uri); - -typedef void (XMLCALL *XML_EndNamespaceDeclHandler) ( - void *userData, - const XML_Char *prefix); - -/* This is called if the document is not standalone, that is, it has an - external subset or a reference to a parameter entity, but does not - have standalone="yes". If this handler returns XML_STATUS_ERROR, - then processing will not continue, and the parser will return a - XML_ERROR_NOT_STANDALONE error. - If parameter entity parsing is enabled, then in addition to the - conditions above this handler will only be called if the referenced - entity was actually read. -*/ -typedef int (XMLCALL *XML_NotStandaloneHandler) (void *userData); - -/* This is called for a reference to an external parsed general - entity. The referenced entity is not automatically parsed. The - application can parse it immediately or later using - XML_ExternalEntityParserCreate. - - The parser argument is the parser parsing the entity containing the - reference; it can be passed as the parser argument to - XML_ExternalEntityParserCreate. The systemId argument is the - system identifier as specified in the entity declaration; it will - not be NULL. - - The base argument is the system identifier that should be used as - the base for resolving systemId if systemId was relative; this is - set by XML_SetBase; it may be NULL. - - The publicId argument is the public identifier as specified in the - entity declaration, or NULL if none was specified; the whitespace - in the public identifier will have been normalized as required by - the XML spec. - - The context argument specifies the parsing context in the format - expected by the context argument to XML_ExternalEntityParserCreate; - context is valid only until the handler returns, so if the - referenced entity is to be parsed later, it must be copied. - context is NULL only when the entity is a parameter entity. - - The handler should return XML_STATUS_ERROR if processing should not - continue because of a fatal error in the handling of the external - entity. In this case the calling parser will return an - XML_ERROR_EXTERNAL_ENTITY_HANDLING error. - - Note that unlike other handlers the first argument is the parser, - not userData. -*/ -typedef int (XMLCALL *XML_ExternalEntityRefHandler) ( - XML_Parser parser, - const XML_Char *context, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId); - -/* This is called in two situations: - 1) An entity reference is encountered for which no declaration - has been read *and* this is not an error. - 2) An internal entity reference is read, but not expanded, because - XML_SetDefaultHandler has been called. - Note: skipped parameter entities in declarations and skipped general - entities in attribute values cannot be reported, because - the event would be out of sync with the reporting of the - declarations or attribute values -*/ -typedef void (XMLCALL *XML_SkippedEntityHandler) ( - void *userData, - const XML_Char *entityName, - int is_parameter_entity); - -/* This structure is filled in by the XML_UnknownEncodingHandler to - provide information to the parser about encodings that are unknown - to the parser. - - The map[b] member gives information about byte sequences whose - first byte is b. - - If map[b] is c where c is >= 0, then b by itself encodes the - Unicode scalar value c. - - If map[b] is -1, then the byte sequence is malformed. - - If map[b] is -n, where n >= 2, then b is the first byte of an - n-byte sequence that encodes a single Unicode scalar value. - - The data member will be passed as the first argument to the convert - function. - - The convert function is used to convert multibyte sequences; s will - point to a n-byte sequence where map[(unsigned char)*s] == -n. The - convert function must return the Unicode scalar value represented - by this byte sequence or -1 if the byte sequence is malformed. - - The convert function may be NULL if the encoding is a single-byte - encoding, that is if map[b] >= -1 for all bytes b. - - When the parser is finished with the encoding, then if release is - not NULL, it will call release passing it the data member; once - release has been called, the convert function will not be called - again. - - Expat places certain restrictions on the encodings that are supported - using this mechanism. - - 1. Every ASCII character that can appear in a well-formed XML document, - other than the characters - - $@\^`{}~ - - must be represented by a single byte, and that byte must be the - same byte that represents that character in ASCII. - - 2. No character may require more than 4 bytes to encode. - - 3. All characters encoded must have Unicode scalar values <= - 0xFFFF, (i.e., characters that would be encoded by surrogates in - UTF-16 are not allowed). Note that this restriction doesn't - apply to the built-in support for UTF-8 and UTF-16. - - 4. No Unicode character may be encoded by more than one distinct - sequence of bytes. -*/ -typedef struct { - int map[256]; - void *data; - int (XMLCALL *convert)(void *data, const char *s); - void (XMLCALL *release)(void *data); -} XML_Encoding; - -/* This is called for an encoding that is unknown to the parser. - - The encodingHandlerData argument is that which was passed as the - second argument to XML_SetUnknownEncodingHandler. - - The name argument gives the name of the encoding as specified in - the encoding declaration. - - If the callback can provide information about the encoding, it must - fill in the XML_Encoding structure, and return XML_STATUS_OK. - Otherwise it must return XML_STATUS_ERROR. - - If info does not describe a suitable encoding, then the parser will - return an XML_UNKNOWN_ENCODING error. -*/ -typedef int (XMLCALL *XML_UnknownEncodingHandler) ( - void *encodingHandlerData, - const XML_Char *name, - XML_Encoding *info); - -XMLPARSEAPI(void) -XML_SetElementHandler(XML_Parser parser, - XML_StartElementHandler start, - XML_EndElementHandler end); - -XMLPARSEAPI(void) -XML_SetStartElementHandler(XML_Parser parser, - XML_StartElementHandler handler); - -XMLPARSEAPI(void) -XML_SetEndElementHandler(XML_Parser parser, - XML_EndElementHandler handler); - -XMLPARSEAPI(void) -XML_SetCharacterDataHandler(XML_Parser parser, - XML_CharacterDataHandler handler); - -XMLPARSEAPI(void) -XML_SetProcessingInstructionHandler(XML_Parser parser, - XML_ProcessingInstructionHandler handler); -XMLPARSEAPI(void) -XML_SetCommentHandler(XML_Parser parser, - XML_CommentHandler handler); - -XMLPARSEAPI(void) -XML_SetCdataSectionHandler(XML_Parser parser, - XML_StartCdataSectionHandler start, - XML_EndCdataSectionHandler end); - -XMLPARSEAPI(void) -XML_SetStartCdataSectionHandler(XML_Parser parser, - XML_StartCdataSectionHandler start); - -XMLPARSEAPI(void) -XML_SetEndCdataSectionHandler(XML_Parser parser, - XML_EndCdataSectionHandler end); - -/* This sets the default handler and also inhibits expansion of - internal entities. These entity references will be passed to the - default handler, or to the skipped entity handler, if one is set. -*/ -XMLPARSEAPI(void) -XML_SetDefaultHandler(XML_Parser parser, - XML_DefaultHandler handler); - -/* This sets the default handler but does not inhibit expansion of - internal entities. The entity reference will not be passed to the - default handler. -*/ -XMLPARSEAPI(void) -XML_SetDefaultHandlerExpand(XML_Parser parser, - XML_DefaultHandler handler); - -XMLPARSEAPI(void) -XML_SetDoctypeDeclHandler(XML_Parser parser, - XML_StartDoctypeDeclHandler start, - XML_EndDoctypeDeclHandler end); - -XMLPARSEAPI(void) -XML_SetStartDoctypeDeclHandler(XML_Parser parser, - XML_StartDoctypeDeclHandler start); - -XMLPARSEAPI(void) -XML_SetEndDoctypeDeclHandler(XML_Parser parser, - XML_EndDoctypeDeclHandler end); - -XMLPARSEAPI(void) -XML_SetUnparsedEntityDeclHandler(XML_Parser parser, - XML_UnparsedEntityDeclHandler handler); - -XMLPARSEAPI(void) -XML_SetNotationDeclHandler(XML_Parser parser, - XML_NotationDeclHandler handler); - -XMLPARSEAPI(void) -XML_SetNamespaceDeclHandler(XML_Parser parser, - XML_StartNamespaceDeclHandler start, - XML_EndNamespaceDeclHandler end); - -XMLPARSEAPI(void) -XML_SetStartNamespaceDeclHandler(XML_Parser parser, - XML_StartNamespaceDeclHandler start); - -XMLPARSEAPI(void) -XML_SetEndNamespaceDeclHandler(XML_Parser parser, - XML_EndNamespaceDeclHandler end); - -XMLPARSEAPI(void) -XML_SetNotStandaloneHandler(XML_Parser parser, - XML_NotStandaloneHandler handler); - -XMLPARSEAPI(void) -XML_SetExternalEntityRefHandler(XML_Parser parser, - XML_ExternalEntityRefHandler handler); - -/* If a non-NULL value for arg is specified here, then it will be - passed as the first argument to the external entity ref handler - instead of the parser object. -*/ -XMLPARSEAPI(void) -XML_SetExternalEntityRefHandlerArg(XML_Parser parser, - void *arg); - -XMLPARSEAPI(void) -XML_SetSkippedEntityHandler(XML_Parser parser, - XML_SkippedEntityHandler handler); - -XMLPARSEAPI(void) -XML_SetUnknownEncodingHandler(XML_Parser parser, - XML_UnknownEncodingHandler handler, - void *encodingHandlerData); - -/* This can be called within a handler for a start element, end - element, processing instruction or character data. It causes the - corresponding markup to be passed to the default handler. -*/ -XMLPARSEAPI(void) -XML_DefaultCurrent(XML_Parser parser); - -/* If do_nst is non-zero, and namespace processing is in effect, and - a name has a prefix (i.e. an explicit namespace qualifier) then - that name is returned as a triplet in a single string separated by - the separator character specified when the parser was created: URI - + sep + local_name + sep + prefix. - - If do_nst is zero, then namespace information is returned in the - default manner (URI + sep + local_name) whether or not the name - has a prefix. - - Note: Calling XML_SetReturnNSTriplet after XML_Parse or - XML_ParseBuffer has no effect. -*/ - -XMLPARSEAPI(void) -XML_SetReturnNSTriplet(XML_Parser parser, int do_nst); - -/* This value is passed as the userData argument to callbacks. */ -XMLPARSEAPI(void) -XML_SetUserData(XML_Parser parser, void *userData); - -/* Returns the last value set by XML_SetUserData or NULL. */ -#define XML_GetUserData(parser) (*(void **)(parser)) - -/* This is equivalent to supplying an encoding argument to - XML_ParserCreate. On success XML_SetEncoding returns non-zero, - zero otherwise. - Note: Calling XML_SetEncoding after XML_Parse or XML_ParseBuffer - has no effect and returns XML_STATUS_ERROR. -*/ -XMLPARSEAPI(enum XML_Status) -XML_SetEncoding(XML_Parser parser, const XML_Char *encoding); - -/* If this function is called, then the parser will be passed as the - first argument to callbacks instead of userData. The userData will - still be accessible using XML_GetUserData. -*/ -XMLPARSEAPI(void) -XML_UseParserAsHandlerArg(XML_Parser parser); - -/* If useDTD == XML_TRUE is passed to this function, then the parser - will assume that there is an external subset, even if none is - specified in the document. In such a case the parser will call the - externalEntityRefHandler with a value of NULL for the systemId - argument (the publicId and context arguments will be NULL as well). - Note: For the purpose of checking WFC: Entity Declared, passing - useDTD == XML_TRUE will make the parser behave as if the document - had a DTD with an external subset. - Note: If this function is called, then this must be done before - the first call to XML_Parse or XML_ParseBuffer, since it will - have no effect after that. Returns - XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING. - Note: If the document does not have a DOCTYPE declaration at all, - then startDoctypeDeclHandler and endDoctypeDeclHandler will not - be called, despite an external subset being parsed. - Note: If XML_DTD is not defined when Expat is compiled, returns - XML_ERROR_FEATURE_REQUIRES_XML_DTD. - Note: If parser == NULL, returns XML_ERROR_INVALID_ARGUMENT. -*/ -XMLPARSEAPI(enum XML_Error) -XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD); - - -/* Sets the base to be used for resolving relative URIs in system - identifiers in declarations. Resolving relative identifiers is - left to the application: this value will be passed through as the - base argument to the XML_ExternalEntityRefHandler, - XML_NotationDeclHandler and XML_UnparsedEntityDeclHandler. The base - argument will be copied. Returns XML_STATUS_ERROR if out of memory, - XML_STATUS_OK otherwise. -*/ -XMLPARSEAPI(enum XML_Status) -XML_SetBase(XML_Parser parser, const XML_Char *base); - -XMLPARSEAPI(const XML_Char *) -XML_GetBase(XML_Parser parser); - -/* Returns the number of the attribute/value pairs passed in last call - to the XML_StartElementHandler that were specified in the start-tag - rather than defaulted. Each attribute/value pair counts as 2; thus - this correspondds to an index into the atts array passed to the - XML_StartElementHandler. Returns -1 if parser == NULL. -*/ -XMLPARSEAPI(int) -XML_GetSpecifiedAttributeCount(XML_Parser parser); - -/* Returns the index of the ID attribute passed in the last call to - XML_StartElementHandler, or -1 if there is no ID attribute or - parser == NULL. Each attribute/value pair counts as 2; thus this - correspondds to an index into the atts array passed to the - XML_StartElementHandler. -*/ -XMLPARSEAPI(int) -XML_GetIdAttributeIndex(XML_Parser parser); - -#ifdef XML_ATTR_INFO -/* Source file byte offsets for the start and end of attribute names and values. - The value indices are exclusive of surrounding quotes; thus in a UTF-8 source - file an attribute value of "blah" will yield: - info->valueEnd - info->valueStart = 4 bytes. -*/ -typedef struct { - XML_Index nameStart; /* Offset to beginning of the attribute name. */ - XML_Index nameEnd; /* Offset after the attribute name's last byte. */ - XML_Index valueStart; /* Offset to beginning of the attribute value. */ - XML_Index valueEnd; /* Offset after the attribute value's last byte. */ -} XML_AttrInfo; - -/* Returns an array of XML_AttrInfo structures for the attribute/value pairs - passed in last call to the XML_StartElementHandler that were specified - in the start-tag rather than defaulted. Each attribute/value pair counts - as 1; thus the number of entries in the array is - XML_GetSpecifiedAttributeCount(parser) / 2. -*/ -XMLPARSEAPI(const XML_AttrInfo *) -XML_GetAttributeInfo(XML_Parser parser); -#endif - -/* Parses some input. Returns XML_STATUS_ERROR if a fatal error is - detected. The last call to XML_Parse must have isFinal true; len - may be zero for this call (or any other). - - Though the return values for these functions has always been - described as a Boolean value, the implementation, at least for the - 1.95.x series, has always returned exactly one of the XML_Status - values. -*/ -XMLPARSEAPI(enum XML_Status) -XML_Parse(XML_Parser parser, const char *s, int len, int isFinal); - -XMLPARSEAPI(void *) -XML_GetBuffer(XML_Parser parser, int len); - -XMLPARSEAPI(enum XML_Status) -XML_ParseBuffer(XML_Parser parser, int len, int isFinal); - -/* Stops parsing, causing XML_Parse() or XML_ParseBuffer() to return. - Must be called from within a call-back handler, except when aborting - (resumable = 0) an already suspended parser. Some call-backs may - still follow because they would otherwise get lost. Examples: - - endElementHandler() for empty elements when stopped in - startElementHandler(), - - endNameSpaceDeclHandler() when stopped in endElementHandler(), - and possibly others. - - Can be called from most handlers, including DTD related call-backs, - except when parsing an external parameter entity and resumable != 0. - Returns XML_STATUS_OK when successful, XML_STATUS_ERROR otherwise. - Possible error codes: - - XML_ERROR_SUSPENDED: when suspending an already suspended parser. - - XML_ERROR_FINISHED: when the parser has already finished. - - XML_ERROR_SUSPEND_PE: when suspending while parsing an external PE. - - When resumable != 0 (true) then parsing is suspended, that is, - XML_Parse() and XML_ParseBuffer() return XML_STATUS_SUSPENDED. - Otherwise, parsing is aborted, that is, XML_Parse() and XML_ParseBuffer() - return XML_STATUS_ERROR with error code XML_ERROR_ABORTED. - - *Note*: - This will be applied to the current parser instance only, that is, if - there is a parent parser then it will continue parsing when the - externalEntityRefHandler() returns. It is up to the implementation of - the externalEntityRefHandler() to call XML_StopParser() on the parent - parser (recursively), if one wants to stop parsing altogether. - - When suspended, parsing can be resumed by calling XML_ResumeParser(). -*/ -XMLPARSEAPI(enum XML_Status) -XML_StopParser(XML_Parser parser, XML_Bool resumable); - -/* Resumes parsing after it has been suspended with XML_StopParser(). - Must not be called from within a handler call-back. Returns same - status codes as XML_Parse() or XML_ParseBuffer(). - Additional error code XML_ERROR_NOT_SUSPENDED possible. - - *Note*: - This must be called on the most deeply nested child parser instance - first, and on its parent parser only after the child parser has finished, - to be applied recursively until the document entity's parser is restarted. - That is, the parent parser will not resume by itself and it is up to the - application to call XML_ResumeParser() on it at the appropriate moment. -*/ -XMLPARSEAPI(enum XML_Status) -XML_ResumeParser(XML_Parser parser); - -enum XML_Parsing { - XML_INITIALIZED, - XML_PARSING, - XML_FINISHED, - XML_SUSPENDED -}; - -typedef struct { - enum XML_Parsing parsing; - XML_Bool finalBuffer; -} XML_ParsingStatus; - -/* Returns status of parser with respect to being initialized, parsing, - finished, or suspended and processing the final buffer. - XXX XML_Parse() and XML_ParseBuffer() should return XML_ParsingStatus, - XXX with XML_FINISHED_OK or XML_FINISHED_ERROR replacing XML_FINISHED -*/ -XMLPARSEAPI(void) -XML_GetParsingStatus(XML_Parser parser, XML_ParsingStatus *status); - -/* Creates an XML_Parser object that can parse an external general - entity; context is a '\0'-terminated string specifying the parse - context; encoding is a '\0'-terminated string giving the name of - the externally specified encoding, or NULL if there is no - externally specified encoding. The context string consists of a - sequence of tokens separated by formfeeds (\f); a token consisting - of a name specifies that the general entity of the name is open; a - token of the form prefix=uri specifies the namespace for a - particular prefix; a token of the form =uri specifies the default - namespace. This can be called at any point after the first call to - an ExternalEntityRefHandler so longer as the parser has not yet - been freed. The new parser is completely independent and may - safely be used in a separate thread. The handlers and userData are - initialized from the parser argument. Returns NULL if out of memory. - Otherwise returns a new XML_Parser object. -*/ -XMLPARSEAPI(XML_Parser) -XML_ExternalEntityParserCreate(XML_Parser parser, - const XML_Char *context, - const XML_Char *encoding); - -enum XML_ParamEntityParsing { - XML_PARAM_ENTITY_PARSING_NEVER, - XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE, - XML_PARAM_ENTITY_PARSING_ALWAYS -}; - -/* Controls parsing of parameter entities (including the external DTD - subset). If parsing of parameter entities is enabled, then - references to external parameter entities (including the external - DTD subset) will be passed to the handler set with - XML_SetExternalEntityRefHandler. The context passed will be 0. - - Unlike external general entities, external parameter entities can - only be parsed synchronously. If the external parameter entity is - to be parsed, it must be parsed during the call to the external - entity ref handler: the complete sequence of - XML_ExternalEntityParserCreate, XML_Parse/XML_ParseBuffer and - XML_ParserFree calls must be made during this call. After - XML_ExternalEntityParserCreate has been called to create the parser - for the external parameter entity (context must be 0 for this - call), it is illegal to make any calls on the old parser until - XML_ParserFree has been called on the newly created parser. - If the library has been compiled without support for parameter - entity parsing (ie without XML_DTD being defined), then - XML_SetParamEntityParsing will return 0 if parsing of parameter - entities is requested; otherwise it will return non-zero. - Note: If XML_SetParamEntityParsing is called after XML_Parse or - XML_ParseBuffer, then it has no effect and will always return 0. - Note: If parser == NULL, the function will do nothing and return 0. -*/ -XMLPARSEAPI(int) -XML_SetParamEntityParsing(XML_Parser parser, - enum XML_ParamEntityParsing parsing); - -/* Sets the hash salt to use for internal hash calculations. - Helps in preventing DoS attacks based on predicting hash - function behavior. This must be called before parsing is started. - Returns 1 if successful, 0 when called after parsing has started. - Note: If parser == NULL, the function will do nothing and return 0. -*/ -XMLPARSEAPI(int) -XML_SetHashSalt(XML_Parser parser, - unsigned long hash_salt); - -/* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then - XML_GetErrorCode returns information about the error. -*/ -XMLPARSEAPI(enum XML_Error) -XML_GetErrorCode(XML_Parser parser); - -/* These functions return information about the current parse - location. They may be called from any callback called to report - some parse event; in this case the location is the location of the - first of the sequence of characters that generated the event. When - called from callbacks generated by declarations in the document - prologue, the location identified isn't as neatly defined, but will - be within the relevant markup. When called outside of the callback - functions, the position indicated will be just past the last parse - event (regardless of whether there was an associated callback). - - They may also be called after returning from a call to XML_Parse - or XML_ParseBuffer. If the return value is XML_STATUS_ERROR then - the location is the location of the character at which the error - was detected; otherwise the location is the location of the last - parse event, as described above. - - Note: XML_GetCurrentLineNumber and XML_GetCurrentColumnNumber - return 0 to indicate an error. - Note: XML_GetCurrentByteIndex returns -1 to indicate an error. -*/ -XMLPARSEAPI(XML_Size) XML_GetCurrentLineNumber(XML_Parser parser); -XMLPARSEAPI(XML_Size) XML_GetCurrentColumnNumber(XML_Parser parser); -XMLPARSEAPI(XML_Index) XML_GetCurrentByteIndex(XML_Parser parser); - -/* Return the number of bytes in the current event. - Returns 0 if the event is in an internal entity. -*/ -XMLPARSEAPI(int) -XML_GetCurrentByteCount(XML_Parser parser); - -/* If XML_CONTEXT_BYTES is defined, returns the input buffer, sets - the integer pointed to by offset to the offset within this buffer - of the current parse position, and sets the integer pointed to by size - to the size of this buffer (the number of input bytes). Otherwise - returns a NULL pointer. Also returns a NULL pointer if a parse isn't - active. - - NOTE: The character pointer returned should not be used outside - the handler that makes the call. -*/ -XMLPARSEAPI(const char *) -XML_GetInputContext(XML_Parser parser, - int *offset, - int *size); - -/* For backwards compatibility with previous versions. */ -#define XML_GetErrorLineNumber XML_GetCurrentLineNumber -#define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber -#define XML_GetErrorByteIndex XML_GetCurrentByteIndex - -/* Frees the content model passed to the element declaration handler */ -XMLPARSEAPI(void) -XML_FreeContentModel(XML_Parser parser, XML_Content *model); - -/* Exposing the memory handling functions used in Expat */ -XMLPARSEAPI(void *) -XML_ATTR_MALLOC -XML_ATTR_ALLOC_SIZE(2) -XML_MemMalloc(XML_Parser parser, size_t size); - -XMLPARSEAPI(void *) -XML_ATTR_ALLOC_SIZE(3) -XML_MemRealloc(XML_Parser parser, void *ptr, size_t size); - -XMLPARSEAPI(void) -XML_MemFree(XML_Parser parser, void *ptr); - -/* Frees memory used by the parser. */ -XMLPARSEAPI(void) -XML_ParserFree(XML_Parser parser); - -/* Returns a string describing the error. */ -XMLPARSEAPI(const XML_LChar *) -XML_ErrorString(enum XML_Error code); - -/* Return a string containing the version number of this expat */ -XMLPARSEAPI(const XML_LChar *) -XML_ExpatVersion(void); - -typedef struct { - int major; - int minor; - int micro; -} XML_Expat_Version; - -/* Return an XML_Expat_Version structure containing numeric version - number information for this version of expat. -*/ -XMLPARSEAPI(XML_Expat_Version) -XML_ExpatVersionInfo(void); - -/* Added in Expat 1.95.5. */ -enum XML_FeatureEnum { - XML_FEATURE_END = 0, - XML_FEATURE_UNICODE, - XML_FEATURE_UNICODE_WCHAR_T, - XML_FEATURE_DTD, - XML_FEATURE_CONTEXT_BYTES, - XML_FEATURE_MIN_SIZE, - XML_FEATURE_SIZEOF_XML_CHAR, - XML_FEATURE_SIZEOF_XML_LCHAR, - XML_FEATURE_NS, - XML_FEATURE_LARGE_SIZE, - XML_FEATURE_ATTR_INFO - /* Additional features must be added to the end of this enum. */ -}; - -typedef struct { - enum XML_FeatureEnum feature; - const XML_LChar *name; - long int value; -} XML_Feature; - -XMLPARSEAPI(const XML_Feature *) -XML_GetFeatureList(void); - - -/* Expat follows the semantic versioning convention. - See http://semver.org. -*/ -#define XML_MAJOR_VERSION 2 -#define XML_MINOR_VERSION 2 -#define XML_MICRO_VERSION 5 - -#ifdef __cplusplus -} -#endif - -#endif /* not Expat_INCLUDED */ diff --git a/tools/sdk/include/expat/expat_config.h b/tools/sdk/include/expat/expat_config.h deleted file mode 100644 index b6b927a19bb..00000000000 --- a/tools/sdk/include/expat/expat_config.h +++ /dev/null @@ -1,103 +0,0 @@ -/* expat_config.h. Generated from expat_config.h.in by configure. */ -/* expat_config.h.in. Generated from configure.ac by autoheader. */ - -/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ -#define BYTEORDER 1234 -/* Define to 1 if you have the `bcopy' function. */ -#define HAVE_BCOPY 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_FCNTL_H 1 - -/* Define to 1 if you have the `getpagesize' function. */ -#define HAVE_GETPAGESIZE 1 -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define to 1 if you have the `memmove' function. */ -#define HAVE_MEMMOVE 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have a working `mmap' system call. */ -#define HAVE_MMAP 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_PARAM_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define to the sub-directory where libtool stores uninstalled libraries. */ -#define LT_OBJDIR ".libs/" - -/* Name of package */ -#define PACKAGE "expat" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "expat-bugs@libexpat.org" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "expat" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "expat 2.2.5" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "expat" - -/* Define to the home page for this package. */ -#define PACKAGE_URL "" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "2.2.5" - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Version number of package */ -#define VERSION "2.2.5" - -/* whether byteorder is bigendian */ -/* #undef WORDS_BIGENDIAN */ - -/* Define to specify how much context to retain around the current parse - point. */ -#define XML_CONTEXT_BYTES 1024 - -/* Define to make parameter entity parsing functionality available. */ -#define XML_DTD 1 - -/* Define to make XML Namespaces functionality available. */ -#define XML_NS 1 - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef const */ - -/* Define to `long int' if does not define. */ -/* #undef off_t */ - -/* Define to `unsigned int' if does not define. */ -/* #undef size_t */ diff --git a/tools/sdk/include/expat/expat_external.h b/tools/sdk/include/expat/expat_external.h deleted file mode 100644 index 629483a91b2..00000000000 --- a/tools/sdk/include/expat/expat_external.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 1997-2000 Thai Open Source Software Center Ltd - Copyright (c) 2000-2017 Expat development team - Licensed under the MIT license: - - 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. -*/ - -#ifndef Expat_External_INCLUDED -#define Expat_External_INCLUDED 1 - -/* External API definitions */ - -#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__) -# define XML_USE_MSC_EXTENSIONS 1 -#endif - -/* Expat tries very hard to make the API boundary very specifically - defined. There are two macros defined to control this boundary; - each of these can be defined before including this header to - achieve some different behavior, but doing so it not recommended or - tested frequently. - - XMLCALL - The calling convention to use for all calls across the - "library boundary." This will default to cdecl, and - try really hard to tell the compiler that's what we - want. - - XMLIMPORT - Whatever magic is needed to note that a function is - to be imported from a dynamically loaded library - (.dll, .so, or .sl, depending on your platform). - - The XMLCALL macro was added in Expat 1.95.7. The only one which is - expected to be directly useful in client code is XMLCALL. - - Note that on at least some Unix versions, the Expat library must be - compiled with the cdecl calling convention as the default since - system headers may assume the cdecl convention. -*/ -#ifndef XMLCALL -# if defined(_MSC_VER) -# define XMLCALL __cdecl -# elif defined(__GNUC__) && defined(__i386) && !defined(__INTEL_COMPILER) -# define XMLCALL __attribute__((cdecl)) -# else -/* For any platform which uses this definition and supports more than - one calling convention, we need to extend this definition to - declare the convention used on that platform, if it's possible to - do so. - - If this is the case for your platform, please file a bug report - with information on how to identify your platform via the C - pre-processor and how to specify the same calling convention as the - platform's malloc() implementation. -*/ -# define XMLCALL -# endif -#endif /* not defined XMLCALL */ - - -#if !defined(XML_STATIC) && !defined(XMLIMPORT) -# ifndef XML_BUILDING_EXPAT -/* using Expat from an application */ - -# ifdef XML_USE_MSC_EXTENSIONS -# define XMLIMPORT __declspec(dllimport) -# endif - -# endif -#endif /* not defined XML_STATIC */ - -#if !defined(XMLIMPORT) && defined(__GNUC__) && (__GNUC__ >= 4) -# define XMLIMPORT __attribute__ ((visibility ("default"))) -#endif - -/* If we didn't define it above, define it away: */ -#ifndef XMLIMPORT -# define XMLIMPORT -#endif - -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)) -# define XML_ATTR_MALLOC __attribute__((__malloc__)) -#else -# define XML_ATTR_MALLOC -#endif - -#if defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) -# define XML_ATTR_ALLOC_SIZE(x) __attribute__((__alloc_size__(x))) -#else -# define XML_ATTR_ALLOC_SIZE(x) -#endif - -#define XMLPARSEAPI(type) XMLIMPORT type XMLCALL - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef XML_UNICODE_WCHAR_T -# ifndef XML_UNICODE -# define XML_UNICODE -# endif -# if defined(__SIZEOF_WCHAR_T__) && (__SIZEOF_WCHAR_T__ != 2) -# error "sizeof(wchar_t) != 2; Need -fshort-wchar for both Expat and libc" -# endif -#endif - -#ifdef XML_UNICODE /* Information is UTF-16 encoded. */ -# ifdef XML_UNICODE_WCHAR_T -typedef wchar_t XML_Char; -typedef wchar_t XML_LChar; -# else -typedef unsigned short XML_Char; -typedef char XML_LChar; -# endif /* XML_UNICODE_WCHAR_T */ -#else /* Information is UTF-8 encoded. */ -typedef char XML_Char; -typedef char XML_LChar; -#endif /* XML_UNICODE */ - -#ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */ -# if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400 -typedef __int64 XML_Index; -typedef unsigned __int64 XML_Size; -# else -typedef long long XML_Index; -typedef unsigned long long XML_Size; -# endif -#else -typedef long XML_Index; -typedef unsigned long XML_Size; -#endif /* XML_LARGE_SIZE */ - -#ifdef __cplusplus -} -#endif - -#endif /* not Expat_External_INCLUDED */ diff --git a/tools/sdk/include/expat/iasciitab.h b/tools/sdk/include/expat/iasciitab.h deleted file mode 100644 index ce4a4bf7ede..00000000000 --- a/tools/sdk/include/expat/iasciitab.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 1997-2000 Thai Open Source Software Center Ltd - Copyright (c) 2000-2017 Expat development team - Licensed under the MIT license: - - 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. -*/ - -/* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */ -/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, -/* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML, -/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, -/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, -/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, -/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, -/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, -/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, -/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, -/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, -/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, -/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, -/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, -/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, -/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, -/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, -/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, -/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, diff --git a/tools/sdk/include/expat/internal.h b/tools/sdk/include/expat/internal.h deleted file mode 100644 index e33fdcb0238..00000000000 --- a/tools/sdk/include/expat/internal.h +++ /dev/null @@ -1,124 +0,0 @@ -/* internal.h - - Internal definitions used by Expat. This is not needed to compile - client code. - - The following calling convention macros are defined for frequently - called functions: - - FASTCALL - Used for those internal functions that have a simple - body and a low number of arguments and local variables. - - PTRCALL - Used for functions called though function pointers. - - PTRFASTCALL - Like PTRCALL, but for low number of arguments. - - inline - Used for selected internal functions for which inlining - may improve performance on some platforms. - - Note: Use of these macros is based on judgement, not hard rules, - and therefore subject to change. - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 1997-2000 Thai Open Source Software Center Ltd - Copyright (c) 2000-2017 Expat development team - Licensed under the MIT license: - - 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. -*/ - -#if defined(__GNUC__) && defined(__i386__) && !defined(__MINGW32__) -/* We'll use this version by default only where we know it helps. - - regparm() generates warnings on Solaris boxes. See SF bug #692878. - - Instability reported with egcs on a RedHat Linux 7.3. - Let's comment out: - #define FASTCALL __attribute__((stdcall, regparm(3))) - and let's try this: -*/ -#define FASTCALL __attribute__((regparm(3))) -#define PTRFASTCALL __attribute__((regparm(3))) -#endif - -/* Using __fastcall seems to have an unexpected negative effect under - MS VC++, especially for function pointers, so we won't use it for - now on that platform. It may be reconsidered for a future release - if it can be made more effective. - Likely reason: __fastcall on Windows is like stdcall, therefore - the compiler cannot perform stack optimizations for call clusters. -*/ - -/* Make sure all of these are defined if they aren't already. */ - -#ifndef FASTCALL -#define FASTCALL -#endif - -#ifndef PTRCALL -#define PTRCALL -#endif - -#ifndef PTRFASTCALL -#define PTRFASTCALL -#endif - -#ifndef XML_MIN_SIZE -#if !defined(__cplusplus) && !defined(inline) -#ifdef __GNUC__ -#define inline __inline -#endif /* __GNUC__ */ -#endif -#endif /* XML_MIN_SIZE */ - -#ifdef __cplusplus -#define inline inline -#else -#ifndef inline -#define inline -#endif -#endif - -#ifndef UNUSED_P -# ifdef __GNUC__ -# define UNUSED_P(p) UNUSED_ ## p __attribute__((__unused__)) -# else -# define UNUSED_P(p) UNUSED_ ## p -# endif -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - - -void -_INTERNAL_trim_to_complete_utf8_characters(const char * from, const char ** fromLimRef); - - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/expat/latin1tab.h b/tools/sdk/include/expat/latin1tab.h deleted file mode 100644 index 95dfa52b1fb..00000000000 --- a/tools/sdk/include/expat/latin1tab.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 1997-2000 Thai Open Source Software Center Ltd - Copyright (c) 2000-2017 Expat development team - Licensed under the MIT license: - - 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. -*/ - -/* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, -/* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME, -/* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, -/* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, -/* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, -/* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, diff --git a/tools/sdk/include/expat/nametab.h b/tools/sdk/include/expat/nametab.h deleted file mode 100644 index bfa2bd38cd9..00000000000 --- a/tools/sdk/include/expat/nametab.h +++ /dev/null @@ -1,182 +0,0 @@ -/* - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 1997-2000 Thai Open Source Software Center Ltd - Copyright (c) 2000-2017 Expat development team - Licensed under the MIT license: - - 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. -*/ - -static const unsigned namingBitmap[] = { -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, -0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, -0x00000000, 0x04000000, 0x87FFFFFE, 0x07FFFFFE, -0x00000000, 0x00000000, 0xFF7FFFFF, 0xFF7FFFFF, -0xFFFFFFFF, 0x7FF3FFFF, 0xFFFFFDFE, 0x7FFFFFFF, -0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE00F, 0xFC31FFFF, -0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF, -0xFFFFFFFF, 0xF80001FF, 0x00000003, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0xFFFFD740, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD, -0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF, -0xFFFF0003, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF, -0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE, -0x0000007F, 0x00000000, 0xFFFF0000, 0x000707FF, -0x00000000, 0x07FFFFFE, 0x000007FE, 0xFFFE0000, -0xFFFFFFFF, 0x7CFFFFFF, 0x002F7FFF, 0x00000060, -0xFFFFFFE0, 0x23FFFFFF, 0xFF000000, 0x00000003, -0xFFF99FE0, 0x03C5FDFF, 0xB0000000, 0x00030003, -0xFFF987E0, 0x036DFDFF, 0x5E000000, 0x001C0000, -0xFFFBAFE0, 0x23EDFDFF, 0x00000000, 0x00000001, -0xFFF99FE0, 0x23CDFDFF, 0xB0000000, 0x00000003, -0xD63DC7E0, 0x03BFC718, 0x00000000, 0x00000000, -0xFFFDDFE0, 0x03EFFDFF, 0x00000000, 0x00000003, -0xFFFDDFE0, 0x03EFFDFF, 0x40000000, 0x00000003, -0xFFFDDFE0, 0x03FFFDFF, 0x00000000, 0x00000003, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0xFFFFFFFE, 0x000D7FFF, 0x0000003F, 0x00000000, -0xFEF02596, 0x200D6CAE, 0x0000001F, 0x00000000, -0x00000000, 0x00000000, 0xFFFFFEFF, 0x000003FF, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0xFFFFFFFF, 0xFFFF003F, 0x007FFFFF, -0x0007DAED, 0x50000000, 0x82315001, 0x002C62AB, -0x40000000, 0xF580C900, 0x00000007, 0x02010800, -0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, -0x0FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x03FFFFFF, -0x3F3FFFFF, 0xFFFFFFFF, 0xAAFF3F3F, 0x3FFFFFFF, -0xFFFFFFFF, 0x5FDFFFFF, 0x0FCF1FDC, 0x1FDC1FFF, -0x00000000, 0x00004C40, 0x00000000, 0x00000000, -0x00000007, 0x00000000, 0x00000000, 0x00000000, -0x00000080, 0x000003FE, 0xFFFFFFFE, 0xFFFFFFFF, -0x001FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x07FFFFFF, -0xFFFFFFE0, 0x00001FFF, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, -0xFFFFFFFF, 0x0000003F, 0x00000000, 0x00000000, -0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, -0xFFFFFFFF, 0x0000000F, 0x00000000, 0x00000000, -0x00000000, 0x07FF6000, 0x87FFFFFE, 0x07FFFFFE, -0x00000000, 0x00800000, 0xFF7FFFFF, 0xFF7FFFFF, -0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF, -0xFFFFFFFF, 0xF80001FF, 0x00030003, 0x00000000, -0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000003, -0xFFFFD7C0, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD, -0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF, -0xFFFF007B, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF, -0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE, -0xFFFE007F, 0xBBFFFFFB, 0xFFFF0016, 0x000707FF, -0x00000000, 0x07FFFFFE, 0x0007FFFF, 0xFFFF03FF, -0xFFFFFFFF, 0x7CFFFFFF, 0xFFEF7FFF, 0x03FF3DFF, -0xFFFFFFEE, 0xF3FFFFFF, 0xFF1E3FFF, 0x0000FFCF, -0xFFF99FEE, 0xD3C5FDFF, 0xB080399F, 0x0003FFCF, -0xFFF987E4, 0xD36DFDFF, 0x5E003987, 0x001FFFC0, -0xFFFBAFEE, 0xF3EDFDFF, 0x00003BBF, 0x0000FFC1, -0xFFF99FEE, 0xF3CDFDFF, 0xB0C0398F, 0x0000FFC3, -0xD63DC7EC, 0xC3BFC718, 0x00803DC7, 0x0000FF80, -0xFFFDDFEE, 0xC3EFFDFF, 0x00603DDF, 0x0000FFC3, -0xFFFDDFEC, 0xC3EFFDFF, 0x40603DDF, 0x0000FFC3, -0xFFFDDFEC, 0xC3FFFDFF, 0x00803DCF, 0x0000FFC3, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0xFFFFFFFE, 0x07FF7FFF, 0x03FF7FFF, 0x00000000, -0xFEF02596, 0x3BFF6CAE, 0x03FF3F5F, 0x00000000, -0x03000000, 0xC2A003FF, 0xFFFFFEFF, 0xFFFE03FF, -0xFEBF0FDF, 0x02FE3FFF, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x1FFF0000, 0x00000002, -0x000000A0, 0x003EFFFE, 0xFFFFFFFE, 0xFFFFFFFF, -0x661FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x77FFFFFF, -}; -static const unsigned char nmstrtPages[] = { -0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, -0x00, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, -0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, -0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x15, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -static const unsigned char namePages[] = { -0x19, 0x03, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x00, -0x00, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, -0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, -0x26, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x27, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; diff --git a/tools/sdk/include/expat/siphash.h b/tools/sdk/include/expat/siphash.h deleted file mode 100644 index 581872df7b4..00000000000 --- a/tools/sdk/include/expat/siphash.h +++ /dev/null @@ -1,374 +0,0 @@ -/* ========================================================================== - * siphash.h - SipHash-2-4 in a single header file - * -------------------------------------------------------------------------- - * Derived by William Ahern from the reference implementation[1] published[2] - * by Jean-Philippe Aumasson and Daniel J. Berstein. - * Minimal changes by Sebastian Pipping and Victor Stinner on top, see below. - * Licensed under the CC0 Public Domain Dedication license. - * - * 1. https://www.131002.net/siphash/siphash24.c - * 2. https://www.131002.net/siphash/ - * -------------------------------------------------------------------------- - * HISTORY: - * - * 2017-07-25 (Vadim Zeitlin) - * - Fix use of SIPHASH_MAIN macro - * - * 2017-07-05 (Sebastian Pipping) - * - Use _SIP_ULL macro to not require a C++11 compiler if compiled as C++ - * - Add const qualifiers at two places - * - Ensure <=80 characters line length (assuming tab width 4) - * - * 2017-06-23 (Victor Stinner) - * - Address Win64 compile warnings - * - * 2017-06-18 (Sebastian Pipping) - * - Clarify license note in the header - * - Address C89 issues: - * - Stop using inline keyword (and let compiler decide) - * - Replace _Bool by int - * - Turn macro siphash24 into a function - * - Address invalid conversion (void pointer) by explicit cast - * - Address lack of stdint.h for Visual Studio 2003 to 2008 - * - Always expose sip24_valid (for self-tests) - * - * 2012-11-04 - Born. (William Ahern) - * -------------------------------------------------------------------------- - * USAGE: - * - * SipHash-2-4 takes as input two 64-bit words as the key, some number of - * message bytes, and outputs a 64-bit word as the message digest. This - * implementation employs two data structures: a struct sipkey for - * representing the key, and a struct siphash for representing the hash - * state. - * - * For converting a 16-byte unsigned char array to a key, use either the - * macro sip_keyof or the routine sip_tokey. The former instantiates a - * compound literal key, while the latter requires a key object as a - * parameter. - * - * unsigned char secret[16]; - * arc4random_buf(secret, sizeof secret); - * struct sipkey *key = sip_keyof(secret); - * - * For hashing a message, use either the convenience macro siphash24 or the - * routines sip24_init, sip24_update, and sip24_final. - * - * struct siphash state; - * void *msg; - * size_t len; - * uint64_t hash; - * - * sip24_init(&state, key); - * sip24_update(&state, msg, len); - * hash = sip24_final(&state); - * - * or - * - * hash = siphash24(msg, len, key); - * - * To convert the 64-bit hash value to a canonical 8-byte little-endian - * binary representation, use either the macro sip_binof or the routine - * sip_tobin. The former instantiates and returns a compound literal array, - * while the latter requires an array object as a parameter. - * -------------------------------------------------------------------------- - * NOTES: - * - * o Neither sip_keyof, sip_binof, nor siphash24 will work with compilers - * lacking compound literal support. Instead, you must use the lower-level - * interfaces which take as parameters the temporary state objects. - * - * o Uppercase macros may evaluate parameters more than once. Lowercase - * macros should not exhibit any such side effects. - * ========================================================================== - */ -#ifndef SIPHASH_H -#define SIPHASH_H - -#include /* size_t */ - -#if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER < 1600) - /* For vs2003/7.1 up to vs2008/9.0; _MSC_VER 1600 is vs2010/10.0 */ - typedef unsigned __int8 uint8_t; - typedef unsigned __int32 uint32_t; - typedef unsigned __int64 uint64_t; -#else - #include /* uint64_t uint32_t uint8_t */ -#endif - - -/* - * Workaround to not require a C++11 compiler for using ULL suffix - * if this code is included and compiled as C++; related GCC warning is: - * warning: use of C++11 long long integer constant [-Wlong-long] - */ -#define _SIP_ULL(high, low) (((uint64_t)high << 32) | low) - - -#define SIP_ROTL(x, b) (uint64_t)(((x) << (b)) | ( (x) >> (64 - (b)))) - -#define SIP_U32TO8_LE(p, v) \ - (p)[0] = (uint8_t)((v) >> 0); (p)[1] = (uint8_t)((v) >> 8); \ - (p)[2] = (uint8_t)((v) >> 16); (p)[3] = (uint8_t)((v) >> 24); - -#define SIP_U64TO8_LE(p, v) \ - SIP_U32TO8_LE((p) + 0, (uint32_t)((v) >> 0)); \ - SIP_U32TO8_LE((p) + 4, (uint32_t)((v) >> 32)); - -#define SIP_U8TO64_LE(p) \ - (((uint64_t)((p)[0]) << 0) | \ - ((uint64_t)((p)[1]) << 8) | \ - ((uint64_t)((p)[2]) << 16) | \ - ((uint64_t)((p)[3]) << 24) | \ - ((uint64_t)((p)[4]) << 32) | \ - ((uint64_t)((p)[5]) << 40) | \ - ((uint64_t)((p)[6]) << 48) | \ - ((uint64_t)((p)[7]) << 56)) - - -#define SIPHASH_INITIALIZER { 0, 0, 0, 0, { 0 }, 0, 0 } - -struct siphash { - uint64_t v0, v1, v2, v3; - - unsigned char buf[8], *p; - uint64_t c; -}; /* struct siphash */ - - -#define SIP_KEYLEN 16 - -struct sipkey { - uint64_t k[2]; -}; /* struct sipkey */ - -#define sip_keyof(k) sip_tokey(&(struct sipkey){ { 0 } }, (k)) - -static struct sipkey *sip_tokey(struct sipkey *key, const void *src) { - key->k[0] = SIP_U8TO64_LE((const unsigned char *)src); - key->k[1] = SIP_U8TO64_LE((const unsigned char *)src + 8); - return key; -} /* sip_tokey() */ - - -#define sip_binof(v) sip_tobin((unsigned char[8]){ 0 }, (v)) - -static void *sip_tobin(void *dst, uint64_t u64) { - SIP_U64TO8_LE((unsigned char *)dst, u64); - return dst; -} /* sip_tobin() */ - - -static void sip_round(struct siphash *H, const int rounds) { - int i; - - for (i = 0; i < rounds; i++) { - H->v0 += H->v1; - H->v1 = SIP_ROTL(H->v1, 13); - H->v1 ^= H->v0; - H->v0 = SIP_ROTL(H->v0, 32); - - H->v2 += H->v3; - H->v3 = SIP_ROTL(H->v3, 16); - H->v3 ^= H->v2; - - H->v0 += H->v3; - H->v3 = SIP_ROTL(H->v3, 21); - H->v3 ^= H->v0; - - H->v2 += H->v1; - H->v1 = SIP_ROTL(H->v1, 17); - H->v1 ^= H->v2; - H->v2 = SIP_ROTL(H->v2, 32); - } -} /* sip_round() */ - - -static struct siphash *sip24_init(struct siphash *H, - const struct sipkey *key) { - H->v0 = _SIP_ULL(0x736f6d65U, 0x70736575U) ^ key->k[0]; - H->v1 = _SIP_ULL(0x646f7261U, 0x6e646f6dU) ^ key->k[1]; - H->v2 = _SIP_ULL(0x6c796765U, 0x6e657261U) ^ key->k[0]; - H->v3 = _SIP_ULL(0x74656462U, 0x79746573U) ^ key->k[1]; - - H->p = H->buf; - H->c = 0; - - return H; -} /* sip24_init() */ - - -#define sip_endof(a) (&(a)[sizeof (a) / sizeof *(a)]) - -static struct siphash *sip24_update(struct siphash *H, const void *src, - size_t len) { - const unsigned char *p = (const unsigned char *)src, *pe = p + len; - uint64_t m; - - do { - while (p < pe && H->p < sip_endof(H->buf)) - *H->p++ = *p++; - - if (H->p < sip_endof(H->buf)) - break; - - m = SIP_U8TO64_LE(H->buf); - H->v3 ^= m; - sip_round(H, 2); - H->v0 ^= m; - - H->p = H->buf; - H->c += 8; - } while (p < pe); - - return H; -} /* sip24_update() */ - - -static uint64_t sip24_final(struct siphash *H) { - const char left = (char)(H->p - H->buf); - uint64_t b = (H->c + left) << 56; - - switch (left) { - case 7: b |= (uint64_t)H->buf[6] << 48; - case 6: b |= (uint64_t)H->buf[5] << 40; - case 5: b |= (uint64_t)H->buf[4] << 32; - case 4: b |= (uint64_t)H->buf[3] << 24; - case 3: b |= (uint64_t)H->buf[2] << 16; - case 2: b |= (uint64_t)H->buf[1] << 8; - case 1: b |= (uint64_t)H->buf[0] << 0; - case 0: break; - } - - H->v3 ^= b; - sip_round(H, 2); - H->v0 ^= b; - H->v2 ^= 0xff; - sip_round(H, 4); - - return H->v0 ^ H->v1 ^ H->v2 ^ H->v3; -} /* sip24_final() */ - - -static uint64_t siphash24(const void *src, size_t len, - const struct sipkey *key) { - struct siphash state = SIPHASH_INITIALIZER; - return sip24_final(sip24_update(sip24_init(&state, key), src, len)); -} /* siphash24() */ - - -/* - * SipHash-2-4 output with - * k = 00 01 02 ... - * and - * in = (empty string) - * in = 00 (1 byte) - * in = 00 01 (2 bytes) - * in = 00 01 02 (3 bytes) - * ... - * in = 00 01 02 ... 3e (63 bytes) - */ -static int sip24_valid(void) { - static const unsigned char vectors[64][8] = { - { 0x31, 0x0e, 0x0e, 0xdd, 0x47, 0xdb, 0x6f, 0x72, }, - { 0xfd, 0x67, 0xdc, 0x93, 0xc5, 0x39, 0xf8, 0x74, }, - { 0x5a, 0x4f, 0xa9, 0xd9, 0x09, 0x80, 0x6c, 0x0d, }, - { 0x2d, 0x7e, 0xfb, 0xd7, 0x96, 0x66, 0x67, 0x85, }, - { 0xb7, 0x87, 0x71, 0x27, 0xe0, 0x94, 0x27, 0xcf, }, - { 0x8d, 0xa6, 0x99, 0xcd, 0x64, 0x55, 0x76, 0x18, }, - { 0xce, 0xe3, 0xfe, 0x58, 0x6e, 0x46, 0xc9, 0xcb, }, - { 0x37, 0xd1, 0x01, 0x8b, 0xf5, 0x00, 0x02, 0xab, }, - { 0x62, 0x24, 0x93, 0x9a, 0x79, 0xf5, 0xf5, 0x93, }, - { 0xb0, 0xe4, 0xa9, 0x0b, 0xdf, 0x82, 0x00, 0x9e, }, - { 0xf3, 0xb9, 0xdd, 0x94, 0xc5, 0xbb, 0x5d, 0x7a, }, - { 0xa7, 0xad, 0x6b, 0x22, 0x46, 0x2f, 0xb3, 0xf4, }, - { 0xfb, 0xe5, 0x0e, 0x86, 0xbc, 0x8f, 0x1e, 0x75, }, - { 0x90, 0x3d, 0x84, 0xc0, 0x27, 0x56, 0xea, 0x14, }, - { 0xee, 0xf2, 0x7a, 0x8e, 0x90, 0xca, 0x23, 0xf7, }, - { 0xe5, 0x45, 0xbe, 0x49, 0x61, 0xca, 0x29, 0xa1, }, - { 0xdb, 0x9b, 0xc2, 0x57, 0x7f, 0xcc, 0x2a, 0x3f, }, - { 0x94, 0x47, 0xbe, 0x2c, 0xf5, 0xe9, 0x9a, 0x69, }, - { 0x9c, 0xd3, 0x8d, 0x96, 0xf0, 0xb3, 0xc1, 0x4b, }, - { 0xbd, 0x61, 0x79, 0xa7, 0x1d, 0xc9, 0x6d, 0xbb, }, - { 0x98, 0xee, 0xa2, 0x1a, 0xf2, 0x5c, 0xd6, 0xbe, }, - { 0xc7, 0x67, 0x3b, 0x2e, 0xb0, 0xcb, 0xf2, 0xd0, }, - { 0x88, 0x3e, 0xa3, 0xe3, 0x95, 0x67, 0x53, 0x93, }, - { 0xc8, 0xce, 0x5c, 0xcd, 0x8c, 0x03, 0x0c, 0xa8, }, - { 0x94, 0xaf, 0x49, 0xf6, 0xc6, 0x50, 0xad, 0xb8, }, - { 0xea, 0xb8, 0x85, 0x8a, 0xde, 0x92, 0xe1, 0xbc, }, - { 0xf3, 0x15, 0xbb, 0x5b, 0xb8, 0x35, 0xd8, 0x17, }, - { 0xad, 0xcf, 0x6b, 0x07, 0x63, 0x61, 0x2e, 0x2f, }, - { 0xa5, 0xc9, 0x1d, 0xa7, 0xac, 0xaa, 0x4d, 0xde, }, - { 0x71, 0x65, 0x95, 0x87, 0x66, 0x50, 0xa2, 0xa6, }, - { 0x28, 0xef, 0x49, 0x5c, 0x53, 0xa3, 0x87, 0xad, }, - { 0x42, 0xc3, 0x41, 0xd8, 0xfa, 0x92, 0xd8, 0x32, }, - { 0xce, 0x7c, 0xf2, 0x72, 0x2f, 0x51, 0x27, 0x71, }, - { 0xe3, 0x78, 0x59, 0xf9, 0x46, 0x23, 0xf3, 0xa7, }, - { 0x38, 0x12, 0x05, 0xbb, 0x1a, 0xb0, 0xe0, 0x12, }, - { 0xae, 0x97, 0xa1, 0x0f, 0xd4, 0x34, 0xe0, 0x15, }, - { 0xb4, 0xa3, 0x15, 0x08, 0xbe, 0xff, 0x4d, 0x31, }, - { 0x81, 0x39, 0x62, 0x29, 0xf0, 0x90, 0x79, 0x02, }, - { 0x4d, 0x0c, 0xf4, 0x9e, 0xe5, 0xd4, 0xdc, 0xca, }, - { 0x5c, 0x73, 0x33, 0x6a, 0x76, 0xd8, 0xbf, 0x9a, }, - { 0xd0, 0xa7, 0x04, 0x53, 0x6b, 0xa9, 0x3e, 0x0e, }, - { 0x92, 0x59, 0x58, 0xfc, 0xd6, 0x42, 0x0c, 0xad, }, - { 0xa9, 0x15, 0xc2, 0x9b, 0xc8, 0x06, 0x73, 0x18, }, - { 0x95, 0x2b, 0x79, 0xf3, 0xbc, 0x0a, 0xa6, 0xd4, }, - { 0xf2, 0x1d, 0xf2, 0xe4, 0x1d, 0x45, 0x35, 0xf9, }, - { 0x87, 0x57, 0x75, 0x19, 0x04, 0x8f, 0x53, 0xa9, }, - { 0x10, 0xa5, 0x6c, 0xf5, 0xdf, 0xcd, 0x9a, 0xdb, }, - { 0xeb, 0x75, 0x09, 0x5c, 0xcd, 0x98, 0x6c, 0xd0, }, - { 0x51, 0xa9, 0xcb, 0x9e, 0xcb, 0xa3, 0x12, 0xe6, }, - { 0x96, 0xaf, 0xad, 0xfc, 0x2c, 0xe6, 0x66, 0xc7, }, - { 0x72, 0xfe, 0x52, 0x97, 0x5a, 0x43, 0x64, 0xee, }, - { 0x5a, 0x16, 0x45, 0xb2, 0x76, 0xd5, 0x92, 0xa1, }, - { 0xb2, 0x74, 0xcb, 0x8e, 0xbf, 0x87, 0x87, 0x0a, }, - { 0x6f, 0x9b, 0xb4, 0x20, 0x3d, 0xe7, 0xb3, 0x81, }, - { 0xea, 0xec, 0xb2, 0xa3, 0x0b, 0x22, 0xa8, 0x7f, }, - { 0x99, 0x24, 0xa4, 0x3c, 0xc1, 0x31, 0x57, 0x24, }, - { 0xbd, 0x83, 0x8d, 0x3a, 0xaf, 0xbf, 0x8d, 0xb7, }, - { 0x0b, 0x1a, 0x2a, 0x32, 0x65, 0xd5, 0x1a, 0xea, }, - { 0x13, 0x50, 0x79, 0xa3, 0x23, 0x1c, 0xe6, 0x60, }, - { 0x93, 0x2b, 0x28, 0x46, 0xe4, 0xd7, 0x06, 0x66, }, - { 0xe1, 0x91, 0x5f, 0x5c, 0xb1, 0xec, 0xa4, 0x6c, }, - { 0xf3, 0x25, 0x96, 0x5c, 0xa1, 0x6d, 0x62, 0x9f, }, - { 0x57, 0x5f, 0xf2, 0x8e, 0x60, 0x38, 0x1b, 0xe5, }, - { 0x72, 0x45, 0x06, 0xeb, 0x4c, 0x32, 0x8a, 0x95, } - }; - unsigned char in[64]; - struct sipkey k; - size_t i; - - sip_tokey(&k, "\000\001\002\003\004\005\006\007\010\011" - "\012\013\014\015\016\017"); - - for (i = 0; i < sizeof in; ++i) { - in[i] = (unsigned char)i; - - if (siphash24(in, i, &k) != SIP_U8TO64_LE(vectors[i])) - return 0; - } - - return 1; -} /* sip24_valid() */ - - -#ifdef SIPHASH_MAIN - -#include - -int main(void) { - const int ok = sip24_valid(); - - if (ok) - puts("OK"); - else - puts("FAIL"); - - return !ok; -} /* main() */ - -#endif /* SIPHASH_MAIN */ - - -#endif /* SIPHASH_H */ diff --git a/tools/sdk/include/expat/utf8tab.h b/tools/sdk/include/expat/utf8tab.h deleted file mode 100644 index fa0bed6f5d7..00000000000 --- a/tools/sdk/include/expat/utf8tab.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 1997-2000 Thai Open Source Software Center Ltd - Copyright (c) 2000-2017 Expat development team - Licensed under the MIT license: - - 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. -*/ - -/* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, -/* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, -/* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, -/* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, -/* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4, -/* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM, diff --git a/tools/sdk/include/expat/winconfig.h b/tools/sdk/include/expat/winconfig.h deleted file mode 100644 index 17fea468900..00000000000 --- a/tools/sdk/include/expat/winconfig.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 1997-2000 Thai Open Source Software Center Ltd - Copyright (c) 2000-2017 Expat development team - Licensed under the MIT license: - - 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. -*/ - -#ifndef WINCONFIG_H -#define WINCONFIG_H - -#define WIN32_LEAN_AND_MEAN -#include -#undef WIN32_LEAN_AND_MEAN - -#include -#include - - -#if defined(HAVE_EXPAT_CONFIG_H) /* e.g. MinGW */ -# include -#else /* !defined(HAVE_EXPAT_CONFIG_H) */ - - -#define XML_NS 1 -#define XML_DTD 1 -#define XML_CONTEXT_BYTES 1024 - -/* we will assume all Windows platforms are little endian */ -#define BYTEORDER 1234 - -/* Windows has memmove() available. */ -#define HAVE_MEMMOVE - - -#endif /* !defined(HAVE_EXPAT_CONFIG_H) */ - - -#endif /* ndef WINCONFIG_H */ diff --git a/tools/sdk/include/expat/xmlrole.h b/tools/sdk/include/expat/xmlrole.h deleted file mode 100644 index e5f048eab55..00000000000 --- a/tools/sdk/include/expat/xmlrole.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 1997-2000 Thai Open Source Software Center Ltd - Copyright (c) 2000-2017 Expat development team - Licensed under the MIT license: - - 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. -*/ - -#ifndef XmlRole_INCLUDED -#define XmlRole_INCLUDED 1 - -#ifdef __VMS -/* 0 1 2 3 0 1 2 3 - 1234567890123456789012345678901 1234567890123456789012345678901 */ -#define XmlPrologStateInitExternalEntity XmlPrologStateInitExternalEnt -#endif - -#include "xmltok.h" - -#ifdef __cplusplus -extern "C" { -#endif - -enum { - XML_ROLE_ERROR = -1, - XML_ROLE_NONE = 0, - XML_ROLE_XML_DECL, - XML_ROLE_INSTANCE_START, - XML_ROLE_DOCTYPE_NONE, - XML_ROLE_DOCTYPE_NAME, - XML_ROLE_DOCTYPE_SYSTEM_ID, - XML_ROLE_DOCTYPE_PUBLIC_ID, - XML_ROLE_DOCTYPE_INTERNAL_SUBSET, - XML_ROLE_DOCTYPE_CLOSE, - XML_ROLE_GENERAL_ENTITY_NAME, - XML_ROLE_PARAM_ENTITY_NAME, - XML_ROLE_ENTITY_NONE, - XML_ROLE_ENTITY_VALUE, - XML_ROLE_ENTITY_SYSTEM_ID, - XML_ROLE_ENTITY_PUBLIC_ID, - XML_ROLE_ENTITY_COMPLETE, - XML_ROLE_ENTITY_NOTATION_NAME, - XML_ROLE_NOTATION_NONE, - XML_ROLE_NOTATION_NAME, - XML_ROLE_NOTATION_SYSTEM_ID, - XML_ROLE_NOTATION_NO_SYSTEM_ID, - XML_ROLE_NOTATION_PUBLIC_ID, - XML_ROLE_ATTRIBUTE_NAME, - XML_ROLE_ATTRIBUTE_TYPE_CDATA, - XML_ROLE_ATTRIBUTE_TYPE_ID, - XML_ROLE_ATTRIBUTE_TYPE_IDREF, - XML_ROLE_ATTRIBUTE_TYPE_IDREFS, - XML_ROLE_ATTRIBUTE_TYPE_ENTITY, - XML_ROLE_ATTRIBUTE_TYPE_ENTITIES, - XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN, - XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS, - XML_ROLE_ATTRIBUTE_ENUM_VALUE, - XML_ROLE_ATTRIBUTE_NOTATION_VALUE, - XML_ROLE_ATTLIST_NONE, - XML_ROLE_ATTLIST_ELEMENT_NAME, - XML_ROLE_IMPLIED_ATTRIBUTE_VALUE, - XML_ROLE_REQUIRED_ATTRIBUTE_VALUE, - XML_ROLE_DEFAULT_ATTRIBUTE_VALUE, - XML_ROLE_FIXED_ATTRIBUTE_VALUE, - XML_ROLE_ELEMENT_NONE, - XML_ROLE_ELEMENT_NAME, - XML_ROLE_CONTENT_ANY, - XML_ROLE_CONTENT_EMPTY, - XML_ROLE_CONTENT_PCDATA, - XML_ROLE_GROUP_OPEN, - XML_ROLE_GROUP_CLOSE, - XML_ROLE_GROUP_CLOSE_REP, - XML_ROLE_GROUP_CLOSE_OPT, - XML_ROLE_GROUP_CLOSE_PLUS, - XML_ROLE_GROUP_CHOICE, - XML_ROLE_GROUP_SEQUENCE, - XML_ROLE_CONTENT_ELEMENT, - XML_ROLE_CONTENT_ELEMENT_REP, - XML_ROLE_CONTENT_ELEMENT_OPT, - XML_ROLE_CONTENT_ELEMENT_PLUS, - XML_ROLE_PI, - XML_ROLE_COMMENT, -#ifdef XML_DTD - XML_ROLE_TEXT_DECL, - XML_ROLE_IGNORE_SECT, - XML_ROLE_INNER_PARAM_ENTITY_REF, -#endif /* XML_DTD */ - XML_ROLE_PARAM_ENTITY_REF -}; - -typedef struct prolog_state { - int (PTRCALL *handler) (struct prolog_state *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc); - unsigned level; - int role_none; -#ifdef XML_DTD - unsigned includeLevel; - int documentEntity; - int inEntityValue; -#endif /* XML_DTD */ -} PROLOG_STATE; - -void XmlPrologStateInit(PROLOG_STATE *); -#ifdef XML_DTD -void XmlPrologStateInitExternalEntity(PROLOG_STATE *); -#endif /* XML_DTD */ - -#define XmlTokenRole(state, tok, ptr, end, enc) \ - (((state)->handler)(state, tok, ptr, end, enc)) - -#ifdef __cplusplus -} -#endif - -#endif /* not XmlRole_INCLUDED */ diff --git a/tools/sdk/include/expat/xmltok.h b/tools/sdk/include/expat/xmltok.h deleted file mode 100644 index 50926f38ab3..00000000000 --- a/tools/sdk/include/expat/xmltok.h +++ /dev/null @@ -1,345 +0,0 @@ -/* - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 1997-2000 Thai Open Source Software Center Ltd - Copyright (c) 2000-2017 Expat development team - Licensed under the MIT license: - - 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. -*/ - -#ifndef XmlTok_INCLUDED -#define XmlTok_INCLUDED 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* The following token may be returned by XmlContentTok */ -#define XML_TOK_TRAILING_RSQB -5 /* ] or ]] at the end of the scan; might be - start of illegal ]]> sequence */ -/* The following tokens may be returned by both XmlPrologTok and - XmlContentTok. -*/ -#define XML_TOK_NONE -4 /* The string to be scanned is empty */ -#define XML_TOK_TRAILING_CR -3 /* A CR at the end of the scan; - might be part of CRLF sequence */ -#define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */ -#define XML_TOK_PARTIAL -1 /* only part of a token */ -#define XML_TOK_INVALID 0 - -/* The following tokens are returned by XmlContentTok; some are also - returned by XmlAttributeValueTok, XmlEntityTok, XmlCdataSectionTok. -*/ -#define XML_TOK_START_TAG_WITH_ATTS 1 -#define XML_TOK_START_TAG_NO_ATTS 2 -#define XML_TOK_EMPTY_ELEMENT_WITH_ATTS 3 /* empty element tag */ -#define XML_TOK_EMPTY_ELEMENT_NO_ATTS 4 -#define XML_TOK_END_TAG 5 -#define XML_TOK_DATA_CHARS 6 -#define XML_TOK_DATA_NEWLINE 7 -#define XML_TOK_CDATA_SECT_OPEN 8 -#define XML_TOK_ENTITY_REF 9 -#define XML_TOK_CHAR_REF 10 /* numeric character reference */ - -/* The following tokens may be returned by both XmlPrologTok and - XmlContentTok. -*/ -#define XML_TOK_PI 11 /* processing instruction */ -#define XML_TOK_XML_DECL 12 /* XML decl or text decl */ -#define XML_TOK_COMMENT 13 -#define XML_TOK_BOM 14 /* Byte order mark */ - -/* The following tokens are returned only by XmlPrologTok */ -#define XML_TOK_PROLOG_S 15 -#define XML_TOK_DECL_OPEN 16 /* */ -#define XML_TOK_NAME 18 -#define XML_TOK_NMTOKEN 19 -#define XML_TOK_POUND_NAME 20 /* #name */ -#define XML_TOK_OR 21 /* | */ -#define XML_TOK_PERCENT 22 -#define XML_TOK_OPEN_PAREN 23 -#define XML_TOK_CLOSE_PAREN 24 -#define XML_TOK_OPEN_BRACKET 25 -#define XML_TOK_CLOSE_BRACKET 26 -#define XML_TOK_LITERAL 27 -#define XML_TOK_PARAM_ENTITY_REF 28 -#define XML_TOK_INSTANCE_START 29 - -/* The following occur only in element type declarations */ -#define XML_TOK_NAME_QUESTION 30 /* name? */ -#define XML_TOK_NAME_ASTERISK 31 /* name* */ -#define XML_TOK_NAME_PLUS 32 /* name+ */ -#define XML_TOK_COND_SECT_OPEN 33 /* */ -#define XML_TOK_CLOSE_PAREN_QUESTION 35 /* )? */ -#define XML_TOK_CLOSE_PAREN_ASTERISK 36 /* )* */ -#define XML_TOK_CLOSE_PAREN_PLUS 37 /* )+ */ -#define XML_TOK_COMMA 38 - -/* The following token is returned only by XmlAttributeValueTok */ -#define XML_TOK_ATTRIBUTE_VALUE_S 39 - -/* The following token is returned only by XmlCdataSectionTok */ -#define XML_TOK_CDATA_SECT_CLOSE 40 - -/* With namespace processing this is returned by XmlPrologTok for a - name with a colon. -*/ -#define XML_TOK_PREFIXED_NAME 41 - -#ifdef XML_DTD -#define XML_TOK_IGNORE_SECT 42 -#endif /* XML_DTD */ - -#ifdef XML_DTD -#define XML_N_STATES 4 -#else /* not XML_DTD */ -#define XML_N_STATES 3 -#endif /* not XML_DTD */ - -#define XML_PROLOG_STATE 0 -#define XML_CONTENT_STATE 1 -#define XML_CDATA_SECTION_STATE 2 -#ifdef XML_DTD -#define XML_IGNORE_SECTION_STATE 3 -#endif /* XML_DTD */ - -#define XML_N_LITERAL_TYPES 2 -#define XML_ATTRIBUTE_VALUE_LITERAL 0 -#define XML_ENTITY_VALUE_LITERAL 1 - -/* The size of the buffer passed to XmlUtf8Encode must be at least this. */ -#define XML_UTF8_ENCODE_MAX 4 -/* The size of the buffer passed to XmlUtf16Encode must be at least this. */ -#define XML_UTF16_ENCODE_MAX 2 - -typedef struct position { - /* first line and first column are 0 not 1 */ - XML_Size lineNumber; - XML_Size columnNumber; -} POSITION; - -typedef struct { - const char *name; - const char *valuePtr; - const char *valueEnd; - char normalized; -} ATTRIBUTE; - -struct encoding; -typedef struct encoding ENCODING; - -typedef int (PTRCALL *SCANNER)(const ENCODING *, - const char *, - const char *, - const char **); - -enum XML_Convert_Result { - XML_CONVERT_COMPLETED = 0, - XML_CONVERT_INPUT_INCOMPLETE = 1, - XML_CONVERT_OUTPUT_EXHAUSTED = 2 /* and therefore potentially input remaining as well */ -}; - -struct encoding { - SCANNER scanners[XML_N_STATES]; - SCANNER literalScanners[XML_N_LITERAL_TYPES]; - int (PTRCALL *nameMatchesAscii)(const ENCODING *, - const char *, - const char *, - const char *); - int (PTRFASTCALL *nameLength)(const ENCODING *, const char *); - const char *(PTRFASTCALL *skipS)(const ENCODING *, const char *); - int (PTRCALL *getAtts)(const ENCODING *enc, - const char *ptr, - int attsMax, - ATTRIBUTE *atts); - int (PTRFASTCALL *charRefNumber)(const ENCODING *enc, const char *ptr); - int (PTRCALL *predefinedEntityName)(const ENCODING *, - const char *, - const char *); - void (PTRCALL *updatePosition)(const ENCODING *, - const char *ptr, - const char *end, - POSITION *); - int (PTRCALL *isPublicId)(const ENCODING *enc, - const char *ptr, - const char *end, - const char **badPtr); - enum XML_Convert_Result (PTRCALL *utf8Convert)(const ENCODING *enc, - const char **fromP, - const char *fromLim, - char **toP, - const char *toLim); - enum XML_Convert_Result (PTRCALL *utf16Convert)(const ENCODING *enc, - const char **fromP, - const char *fromLim, - unsigned short **toP, - const unsigned short *toLim); - int minBytesPerChar; - char isUtf8; - char isUtf16; -}; - -/* Scan the string starting at ptr until the end of the next complete - token, but do not scan past eptr. Return an integer giving the - type of token. - - Return XML_TOK_NONE when ptr == eptr; nextTokPtr will not be set. - - Return XML_TOK_PARTIAL when the string does not contain a complete - token; nextTokPtr will not be set. - - Return XML_TOK_INVALID when the string does not start a valid - token; nextTokPtr will be set to point to the character which made - the token invalid. - - Otherwise the string starts with a valid token; nextTokPtr will be - set to point to the character following the end of that token. - - Each data character counts as a single token, but adjacent data - characters may be returned together. Similarly for characters in - the prolog outside literals, comments and processing instructions. -*/ - - -#define XmlTok(enc, state, ptr, end, nextTokPtr) \ - (((enc)->scanners[state])(enc, ptr, end, nextTokPtr)) - -#define XmlPrologTok(enc, ptr, end, nextTokPtr) \ - XmlTok(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr) - -#define XmlContentTok(enc, ptr, end, nextTokPtr) \ - XmlTok(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr) - -#define XmlCdataSectionTok(enc, ptr, end, nextTokPtr) \ - XmlTok(enc, XML_CDATA_SECTION_STATE, ptr, end, nextTokPtr) - -#ifdef XML_DTD - -#define XmlIgnoreSectionTok(enc, ptr, end, nextTokPtr) \ - XmlTok(enc, XML_IGNORE_SECTION_STATE, ptr, end, nextTokPtr) - -#endif /* XML_DTD */ - -/* This is used for performing a 2nd-level tokenization on the content - of a literal that has already been returned by XmlTok. -*/ -#define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \ - (((enc)->literalScanners[literalType])(enc, ptr, end, nextTokPtr)) - -#define XmlAttributeValueTok(enc, ptr, end, nextTokPtr) \ - XmlLiteralTok(enc, XML_ATTRIBUTE_VALUE_LITERAL, ptr, end, nextTokPtr) - -#define XmlEntityValueTok(enc, ptr, end, nextTokPtr) \ - XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr) - -#define XmlNameMatchesAscii(enc, ptr1, end1, ptr2) \ - (((enc)->nameMatchesAscii)(enc, ptr1, end1, ptr2)) - -#define XmlNameLength(enc, ptr) \ - (((enc)->nameLength)(enc, ptr)) - -#define XmlSkipS(enc, ptr) \ - (((enc)->skipS)(enc, ptr)) - -#define XmlGetAttributes(enc, ptr, attsMax, atts) \ - (((enc)->getAtts)(enc, ptr, attsMax, atts)) - -#define XmlCharRefNumber(enc, ptr) \ - (((enc)->charRefNumber)(enc, ptr)) - -#define XmlPredefinedEntityName(enc, ptr, end) \ - (((enc)->predefinedEntityName)(enc, ptr, end)) - -#define XmlUpdatePosition(enc, ptr, end, pos) \ - (((enc)->updatePosition)(enc, ptr, end, pos)) - -#define XmlIsPublicId(enc, ptr, end, badPtr) \ - (((enc)->isPublicId)(enc, ptr, end, badPtr)) - -#define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim) \ - (((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim)) - -#define XmlUtf16Convert(enc, fromP, fromLim, toP, toLim) \ - (((enc)->utf16Convert)(enc, fromP, fromLim, toP, toLim)) - -typedef struct { - ENCODING initEnc; - const ENCODING **encPtr; -} INIT_ENCODING; - -int XmlParseXmlDecl(int isGeneralTextEntity, - const ENCODING *enc, - const char *ptr, - const char *end, - const char **badPtr, - const char **versionPtr, - const char **versionEndPtr, - const char **encodingNamePtr, - const ENCODING **namedEncodingPtr, - int *standalonePtr); - -int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name); -const ENCODING *XmlGetUtf8InternalEncoding(void); -const ENCODING *XmlGetUtf16InternalEncoding(void); -int FASTCALL XmlUtf8Encode(int charNumber, char *buf); -int FASTCALL XmlUtf16Encode(int charNumber, unsigned short *buf); -int XmlSizeOfUnknownEncoding(void); - - -typedef int (XMLCALL *CONVERTER) (void *userData, const char *p); - -ENCODING * -XmlInitUnknownEncoding(void *mem, - int *table, - CONVERTER convert, - void *userData); - -int XmlParseXmlDeclNS(int isGeneralTextEntity, - const ENCODING *enc, - const char *ptr, - const char *end, - const char **badPtr, - const char **versionPtr, - const char **versionEndPtr, - const char **encodingNamePtr, - const ENCODING **namedEncodingPtr, - int *standalonePtr); - -int XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name); -const ENCODING *XmlGetUtf8InternalEncodingNS(void); -const ENCODING *XmlGetUtf16InternalEncodingNS(void); -ENCODING * -XmlInitUnknownEncodingNS(void *mem, - int *table, - CONVERTER convert, - void *userData); -#ifdef __cplusplus -} -#endif - -#endif /* not XmlTok_INCLUDED */ diff --git a/tools/sdk/include/expat/xmltok_impl.h b/tools/sdk/include/expat/xmltok_impl.h deleted file mode 100644 index a6420f48eed..00000000000 --- a/tools/sdk/include/expat/xmltok_impl.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 1997-2000 Thai Open Source Software Center Ltd - Copyright (c) 2000-2017 Expat development team - Licensed under the MIT license: - - 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. -*/ - -enum { - BT_NONXML, - BT_MALFORM, - BT_LT, - BT_AMP, - BT_RSQB, - BT_LEAD2, - BT_LEAD3, - BT_LEAD4, - BT_TRAIL, - BT_CR, - BT_LF, - BT_GT, - BT_QUOT, - BT_APOS, - BT_EQUALS, - BT_QUEST, - BT_EXCL, - BT_SOL, - BT_SEMI, - BT_NUM, - BT_LSQB, - BT_S, - BT_NMSTRT, - BT_COLON, - BT_HEX, - BT_DIGIT, - BT_NAME, - BT_MINUS, - BT_OTHER, /* known not to be a name or name start character */ - BT_NONASCII, /* might be a name or name start character */ - BT_PERCNT, - BT_LPAR, - BT_RPAR, - BT_AST, - BT_PLUS, - BT_COMMA, - BT_VERBAR -}; - -#include diff --git a/tools/sdk/include/fatfs/diskio.h b/tools/sdk/include/fatfs/diskio.h deleted file mode 100644 index 572f03dce03..00000000000 --- a/tools/sdk/include/fatfs/diskio.h +++ /dev/null @@ -1,133 +0,0 @@ -/*-----------------------------------------------------------------------/ -/ Low level disk interface modlue include file (C)ChaN, 2014 / -/-----------------------------------------------------------------------*/ - -#ifndef _DISKIO_DEFINED -#define _DISKIO_DEFINED - -#ifdef __cplusplus -extern "C" { -#endif - -#include "integer.h" -#include "sdmmc_cmd.h" -#include "driver/sdmmc_host.h" - -/* Status of Disk Functions */ -typedef BYTE DSTATUS; - -/* Results of Disk Functions */ -typedef enum { - RES_OK = 0, /* 0: Successful */ - RES_ERROR, /* 1: R/W Error */ - RES_WRPRT, /* 2: Write Protected */ - RES_NOTRDY, /* 3: Not Ready */ - RES_PARERR /* 4: Invalid Parameter */ -} DRESULT; - - -/*---------------------------------------*/ -/* Prototypes for disk control functions */ - - -/* Redefine names of disk IO functions to prevent name collisions */ -#define disk_initialize ff_disk_initialize -#define disk_status ff_disk_status -#define disk_read ff_disk_read -#define disk_write ff_disk_write -#define disk_ioctl ff_disk_ioctl - - -DSTATUS disk_initialize (BYTE pdrv); -DSTATUS disk_status (BYTE pdrv); -DRESULT disk_read (BYTE pdrv, BYTE* buff, DWORD sector, UINT count); -DRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count); -DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff); - -/** - * Structure of pointers to disk IO driver functions. - * - * See FatFs documentation for details about these functions - */ -typedef struct { - DSTATUS (*init) (BYTE pdrv); /*!< disk initialization function */ - DSTATUS (*status) (BYTE pdrv); /*!< disk status check function */ - DRESULT (*read) (BYTE pdrv, BYTE* buff, DWORD sector, UINT count); /*!< sector read function */ - DRESULT (*write) (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count); /*!< sector write function */ - DRESULT (*ioctl) (BYTE pdrv, BYTE cmd, void* buff); /*!< function to get info about disk and do some misc operations */ -} ff_diskio_impl_t; - -/** - * Register or unregister diskio driver for given drive number. - * - * When FATFS library calls one of disk_xxx functions for driver number pdrv, - * corresponding function in discio_impl for given pdrv will be called. - * - * @param pdrv drive number - * @param discio_impl pointer to ff_diskio_impl_t structure with diskio functions - * or NULL to unregister and free previously registered drive - */ -void ff_diskio_register(BYTE pdrv, const ff_diskio_impl_t* discio_impl); - -#define ff_diskio_unregister(pdrv_) ff_diskio_register(pdrv_, NULL) - -/** - * Register SD/MMC diskio driver - * - * @param pdrv drive number - * @param card pointer to sdmmc_card_t structure describing a card; card should be initialized before calling f_mount. - */ -void ff_diskio_register_sdmmc(BYTE pdrv, sdmmc_card_t* card); - -/** - * Get next available drive number - * - * @param out_pdrv pointer to the byte to set if successful - * - * @return ESP_OK on success - * ESP_ERR_NOT_FOUND if all drives are attached - */ -esp_err_t ff_diskio_get_drive(BYTE* out_pdrv); - -/* Disk Status Bits (DSTATUS) */ - -#define STA_NOINIT 0x01 /* Drive not initialized */ -#define STA_NODISK 0x02 /* No medium in the drive */ -#define STA_PROTECT 0x04 /* Write protected */ - - -/* Command code for disk_ioctrl fucntion */ - -/* Generic command (Used by FatFs) */ -#define CTRL_SYNC 0 /* Complete pending write process (needed at _FS_READONLY == 0) */ -#define GET_SECTOR_COUNT 1 /* Get media size (needed at _USE_MKFS == 1) */ -#define GET_SECTOR_SIZE 2 /* Get sector size (needed at _MAX_SS != _MIN_SS) */ -#define GET_BLOCK_SIZE 3 /* Get erase block size (needed at _USE_MKFS == 1) */ -#define CTRL_TRIM 4 /* Inform device that the data on the block of sectors is no longer used (needed at _USE_TRIM == 1) */ - -/* Generic command (Not used by FatFs) */ -#define CTRL_POWER 5 /* Get/Set power status */ -#define CTRL_LOCK 6 /* Lock/Unlock media removal */ -#define CTRL_EJECT 7 /* Eject media */ -#define CTRL_FORMAT 8 /* Create physical format on the media */ - -/* MMC/SDC specific ioctl command */ -#define MMC_GET_TYPE 10 /* Get card type */ -#define MMC_GET_CSD 11 /* Get CSD */ -#define MMC_GET_CID 12 /* Get CID */ -#define MMC_GET_OCR 13 /* Get OCR */ -#define MMC_GET_SDSTAT 14 /* Get SD status */ -#define ISDIO_READ 55 /* Read data form SD iSDIO register */ -#define ISDIO_WRITE 56 /* Write data to SD iSDIO register */ -#define ISDIO_MRITE 57 /* Masked write data to SD iSDIO register */ - -/* ATA/CF specific ioctl command */ -#define ATA_GET_REV 20 /* Get F/W revision */ -#define ATA_GET_MODEL 21 /* Get model name */ -#define ATA_GET_SN 22 /* Get serial number */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/fatfs/diskio_rawflash.h b/tools/sdk/include/fatfs/diskio_rawflash.h deleted file mode 100644 index a7b61a4708a..00000000000 --- a/tools/sdk/include/fatfs/diskio_rawflash.h +++ /dev/null @@ -1,38 +0,0 @@ -// 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. - -#ifndef _DISKIO_RAWFLASH_DEFINED -#define _DISKIO_RAWFLASH_DEFINED - -#ifdef __cplusplus -extern "C" { -#endif - -#include "integer.h" -#include "esp_partition.h" - -/** - * Register spi flash partition - * - * @param pdrv drive number - * @param part_handle pointer to raw flash partition. - */ -esp_err_t ff_diskio_register_raw_partition(BYTE pdrv, const esp_partition_t* part_handle); -BYTE ff_diskio_get_pdrv_raw(const esp_partition_t* part_handle); - -#ifdef __cplusplus -} -#endif - -#endif // _DISKIO_RAWFLASH_DEFINED diff --git a/tools/sdk/include/fatfs/diskio_wl.h b/tools/sdk/include/fatfs/diskio_wl.h deleted file mode 100644 index 9abff7ae06d..00000000000 --- a/tools/sdk/include/fatfs/diskio_wl.h +++ /dev/null @@ -1,40 +0,0 @@ -// 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. - -#ifndef _DISKIO_WL_DEFINED -#define _DISKIO_WL_DEFINED - -#ifdef __cplusplus -extern "C" { -#endif - -#include "integer.h" -#include "wear_levelling.h" - - -/** - * Register spi flash partition - * - * @param pdrv drive number - * @param flash_handle handle of the wear levelling partition. - */ -esp_err_t ff_diskio_register_wl_partition(BYTE pdrv, wl_handle_t flash_handle); -BYTE ff_diskio_get_pdrv_wl(wl_handle_t flash_handle); -void ff_diskio_clear_pdrv_wl(wl_handle_t flash_handle); - -#ifdef __cplusplus -} -#endif - -#endif // _DISKIO_WL_DEFINED diff --git a/tools/sdk/include/fatfs/esp_vfs_fat.h b/tools/sdk/include/fatfs/esp_vfs_fat.h deleted file mode 100644 index a2a05951e18..00000000000 --- a/tools/sdk/include/fatfs/esp_vfs_fat.h +++ /dev/null @@ -1,251 +0,0 @@ -// 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. - -#pragma once -#include -#include "esp_err.h" -#include "driver/gpio.h" -#include "driver/sdmmc_types.h" -#include "driver/sdmmc_host.h" -#include "driver/sdspi_host.h" -#include "ff.h" -#include "wear_levelling.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Register FATFS with VFS component - * - * This function registers given FAT drive in VFS, at the specified base path. - * If only one drive is used, fat_drive argument can be an empty string. - * Refer to FATFS library documentation on how to specify FAT drive. - * This function also allocates FATFS structure which should be used for f_mount - * call. - * - * @note This function doesn't mount the drive into FATFS, it just connects - * POSIX and C standard library IO function with FATFS. You need to mount - * desired drive into FATFS separately. - * - * @param base_path path prefix where FATFS should be registered - * @param fat_drive FATFS drive specification; if only one drive is used, can be an empty string - * @param max_files maximum number of files which can be open at the same time - * @param[out] out_fs pointer to FATFS structure which can be used for FATFS f_mount call is returned via this argument. - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if esp_vfs_fat_register was already called - * - ESP_ERR_NO_MEM if not enough memory or too many VFSes already registered - */ -esp_err_t esp_vfs_fat_register(const char* base_path, const char* fat_drive, - size_t max_files, FATFS** out_fs); - -/** - * @brief Un-register FATFS from VFS - * - * @note FATFS structure returned by esp_vfs_fat_register is destroyed after - * this call. Make sure to call f_mount function to unmount it before - * calling esp_vfs_fat_unregister. - * This function is left for compatibility and will be changed in - * future versions to accept base_path and replace the method below - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if FATFS is not registered in VFS - */ -esp_err_t esp_vfs_fat_unregister() __attribute__((deprecated)); - -/** - * @brief Un-register FATFS from VFS - * - * @note FATFS structure returned by esp_vfs_fat_register is destroyed after - * this call. Make sure to call f_mount function to unmount it before - * calling esp_vfs_fat_unregister_ctx. - * Difference between this function and the one above is that this one - * will release the correct drive, while the one above will release - * the last registered one - * - * @param base_path path prefix where FATFS is registered. This is the same - * used when esp_vfs_fat_register was called - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if FATFS is not registered in VFS - */ -esp_err_t esp_vfs_fat_unregister_path(const char* base_path); - - -/** - * @brief Configuration arguments for esp_vfs_fat_sdmmc_mount and esp_vfs_fat_spiflash_mount functions - */ -typedef struct { - /** - * If FAT partition can not be mounted, and this parameter is true, - * create partition table and format the filesystem. - */ - bool format_if_mount_failed; - int max_files; ///< Max number of open files - /** - * If format_if_mount_failed is set, and mount fails, format the card - * with given allocation unit size. Must be a power of 2, between sector - * size and 128 * sector size. - * For SD cards, sector size is always 512 bytes. For wear_levelling, - * sector size is determined by CONFIG_WL_SECTOR_SIZE option. - * - * Using larger allocation unit size will result in higher read/write - * performance and higher overhead when storing small files. - * - * Setting this field to 0 will result in allocation unit set to the - * sector size. - */ - size_t allocation_unit_size; -} esp_vfs_fat_mount_config_t; - -// Compatibility definition -typedef esp_vfs_fat_mount_config_t esp_vfs_fat_sdmmc_mount_config_t; - -/** - * @brief Convenience function to get FAT filesystem on SD card registered in VFS - * - * This is an all-in-one function which does the following: - * - initializes SDMMC driver or SPI driver with configuration in host_config - * - initializes SD card with configuration in slot_config - * - mounts FAT partition on SD card using FATFS library, with configuration in mount_config - * - registers FATFS library with VFS, with prefix given by base_prefix variable - * - * This function is intended to make example code more compact. - * For real world applications, developers should implement the logic of - * probing SD card, locating and mounting partition, and registering FATFS in VFS, - * with proper error checking and handling of exceptional conditions. - * - * @param base_path path where partition should be registered (e.g. "/sdcard") - * @param host_config Pointer to structure describing SDMMC host. When using - * SDMMC peripheral, this structure can be initialized using - * SDMMC_HOST_DEFAULT() macro. When using SPI peripheral, - * this structure can be initialized using SDSPI_HOST_DEFAULT() - * macro. - * @param slot_config Pointer to structure with slot configuration. - * For SDMMC peripheral, pass a pointer to sdmmc_slot_config_t - * structure initialized using SDMMC_SLOT_CONFIG_DEFAULT. - * For SPI peripheral, pass a pointer to sdspi_slot_config_t - * structure initialized using SDSPI_SLOT_CONFIG_DEFAULT. - * @param mount_config pointer to structure with extra parameters for mounting FATFS - * @param[out] out_card if not NULL, pointer to the card information structure will be returned via this argument - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if esp_vfs_fat_sdmmc_mount was already called - * - ESP_ERR_NO_MEM if memory can not be allocated - * - ESP_FAIL if partition can not be mounted - * - other error codes from SDMMC or SPI drivers, SDMMC protocol, or FATFS drivers - */ -esp_err_t esp_vfs_fat_sdmmc_mount(const char* base_path, - const sdmmc_host_t* host_config, - const void* slot_config, - const esp_vfs_fat_mount_config_t* mount_config, - sdmmc_card_t** out_card); - -/** - * @brief Unmount FAT filesystem and release resources acquired using esp_vfs_fat_sdmmc_mount - * - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if esp_vfs_fat_sdmmc_mount hasn't been called - */ -esp_err_t esp_vfs_fat_sdmmc_unmount(); - -/** - * @brief Convenience function to initialize FAT filesystem in SPI flash and register it in VFS - * - * This is an all-in-one function which does the following: - * - * - finds the partition with defined partition_label. Partition label should be - * configured in the partition table. - * - initializes flash wear levelling library on top of the given partition - * - mounts FAT partition using FATFS library on top of flash wear levelling - * library - * - registers FATFS library with VFS, with prefix given by base_prefix variable - * - * This function is intended to make example code more compact. - * - * @param base_path path where FATFS partition should be mounted (e.g. "/spiflash") - * @param partition_label label of the partition which should be used - * @param mount_config pointer to structure with extra parameters for mounting FATFS - * @param[out] wl_handle wear levelling driver handle - * @return - * - ESP_OK on success - * - ESP_ERR_NOT_FOUND if the partition table does not contain FATFS partition with given label - * - ESP_ERR_INVALID_STATE if esp_vfs_fat_spiflash_mount was already called - * - ESP_ERR_NO_MEM if memory can not be allocated - * - ESP_FAIL if partition can not be mounted - * - other error codes from wear levelling library, SPI flash driver, or FATFS drivers - */ -esp_err_t esp_vfs_fat_spiflash_mount(const char* base_path, - const char* partition_label, - const esp_vfs_fat_mount_config_t* mount_config, - wl_handle_t* wl_handle); - -/** - * @brief Unmount FAT filesystem and release resources acquired using esp_vfs_fat_spiflash_mount - * - * @param base_path path where partition should be registered (e.g. "/spiflash") - * @param wl_handle wear levelling driver handle returned by esp_vfs_fat_spiflash_mount - * - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if esp_vfs_fat_spiflash_mount hasn't been called - */ - esp_err_t esp_vfs_fat_spiflash_unmount(const char* base_path, wl_handle_t wl_handle); - - -/** - * @brief Convenience function to initialize read-only FAT filesystem and register it in VFS - * - * This is an all-in-one function which does the following: - * - * - finds the partition with defined partition_label. Partition label should be - * configured in the partition table. - * - mounts FAT partition using FATFS library - * - registers FATFS library with VFS, with prefix given by base_prefix variable - * - * @note Wear levelling is not used when FAT is mounted in read-only mode using this function. - * - * @param base_path path where FATFS partition should be mounted (e.g. "/spiflash") - * @param partition_label label of the partition which should be used - * @param mount_config pointer to structure with extra parameters for mounting FATFS - * @return - * - ESP_OK on success - * - ESP_ERR_NOT_FOUND if the partition table does not contain FATFS partition with given label - * - ESP_ERR_INVALID_STATE if esp_vfs_fat_rawflash_mount was already called for the same partition - * - ESP_ERR_NO_MEM if memory can not be allocated - * - ESP_FAIL if partition can not be mounted - * - other error codes from SPI flash driver, or FATFS drivers - */ -esp_err_t esp_vfs_fat_rawflash_mount(const char* base_path, - const char* partition_label, - const esp_vfs_fat_mount_config_t* mount_config); - -/** - * @brief Unmount FAT filesystem and release resources acquired using esp_vfs_fat_rawflash_mount - * - * @param base_path path where partition should be registered (e.g. "/spiflash") - * @param partition_label label of partition to be unmounted - * - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if esp_vfs_fat_spiflash_mount hasn't been called - */ - esp_err_t esp_vfs_fat_rawflash_unmount(const char* base_path, const char* partition_label); - - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/fatfs/ff.h b/tools/sdk/include/fatfs/ff.h deleted file mode 100644 index 55c1329827a..00000000000 --- a/tools/sdk/include/fatfs/ff.h +++ /dev/null @@ -1,369 +0,0 @@ -/*----------------------------------------------------------------------------/ -/ FatFs - Generic FAT Filesystem module R0.13a / -/-----------------------------------------------------------------------------/ -/ -/ Copyright (C) 2017, ChaN, all right reserved. -/ -/ FatFs module is an open source software. Redistribution and use of FatFs in -/ source and binary forms, with or without modification, are permitted provided -/ that the following condition is met: - -/ 1. Redistributions of source code must retain the above copyright notice, -/ this condition and the following disclaimer. -/ -/ This software is provided by the copyright holder and contributors "AS IS" -/ and any warranties related to this software are DISCLAIMED. -/ The copyright owner or contributors be NOT LIABLE for any damages caused -/ by use of this software. -/ -/----------------------------------------------------------------------------*/ - - -#ifndef FF_DEFINED -#define FF_DEFINED 89352 /* Revision ID */ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "integer.h" /* Basic integer types */ -#include "ffconf.h" /* FatFs configuration options */ - -#if FF_DEFINED != FFCONF_DEF -#error Wrong configuration file (ffconf.h). -#endif - -#ifdef FF_DEFINE_DIR -#define FF_DIR DIR -#endif - - -/* Definitions of volume management */ - -#if FF_MULTI_PARTITION /* Multiple partition configuration */ -typedef struct { - BYTE pd; /* Physical drive number */ - BYTE pt; /* Partition: 0:Auto detect, 1-4:Forced partition) */ -} PARTITION; -extern PARTITION VolToPart[]; /* Volume - Partition resolution table */ -#endif - - - -/* Type of path name strings on FatFs API */ - -#ifndef _INC_TCHAR -#define _INC_TCHAR - -#if FF_USE_LFN && FF_LFN_UNICODE == 1 /* Unicode in UTF-16 encoding */ -typedef WCHAR TCHAR; -#define _T(x) L ## x -#define _TEXT(x) L ## x -#elif FF_USE_LFN && FF_LFN_UNICODE == 2 /* Unicode in UTF-8 encoding */ -typedef char TCHAR; -#define _T(x) u8 ## x -#define _TEXT(x) u8 ## x -#elif FF_USE_LFN && (FF_LFN_UNICODE < 0 || FF_LFN_UNICODE > 2) -#error Wrong FF_LFN_UNICODE setting -#else /* ANSI/OEM code in SBCS/DBCS */ -typedef char TCHAR; -#define _T(x) x -#define _TEXT(x) x -#endif - -#endif - - - -/* Type of file size variables */ - -#if FF_FS_EXFAT -typedef QWORD FSIZE_t; -#else -typedef DWORD FSIZE_t; -#endif - - - -/* Filesystem object structure (FATFS) */ - -typedef struct { - BYTE fs_type; /* Filesystem type (0:N/A) */ - BYTE pdrv; /* Physical drive number */ - BYTE n_fats; /* Number of FATs (1 or 2) */ - BYTE wflag; /* win[] flag (b0:dirty) */ - BYTE fsi_flag; /* FSINFO flags (b7:disabled, b0:dirty) */ - WORD id; /* Volume mount ID */ - WORD n_rootdir; /* Number of root directory entries (FAT12/16) */ - WORD csize; /* Cluster size [sectors] */ -#if FF_MAX_SS != FF_MIN_SS - WORD ssize; /* Sector size (512, 1024, 2048 or 4096) */ -#endif -#if FF_USE_LFN - WCHAR* lfnbuf; /* LFN working buffer */ -#endif -#if FF_FS_EXFAT - BYTE* dirbuf; /* Directory entry block scratchpad buffer for exFAT */ -#endif -#if FF_FS_REENTRANT - FF_SYNC_t sobj; /* Identifier of sync object */ -#endif -#if !FF_FS_READONLY - DWORD last_clst; /* Last allocated cluster */ - DWORD free_clst; /* Number of free clusters */ -#endif -#if FF_FS_RPATH - DWORD cdir; /* Current directory start cluster (0:root) */ -#if FF_FS_EXFAT - DWORD cdc_scl; /* Containing directory start cluster (invalid when cdir is 0) */ - DWORD cdc_size; /* b31-b8:Size of containing directory, b7-b0: Chain status */ - DWORD cdc_ofs; /* Offset in the containing directory (invalid when cdir is 0) */ -#endif -#endif - DWORD n_fatent; /* Number of FAT entries (number of clusters + 2) */ - DWORD fsize; /* Size of an FAT [sectors] */ - DWORD volbase; /* Volume base sector */ - DWORD fatbase; /* FAT base sector */ - DWORD dirbase; /* Root directory base sector/cluster */ - DWORD database; /* Data base sector */ - DWORD winsect; /* Current sector appearing in the win[] */ - BYTE win[FF_MAX_SS]; /* Disk access window for Directory, FAT (and file data at tiny cfg) */ -} FATFS; - - - -/* Object ID and allocation information (FFOBJID) */ - -typedef struct { - FATFS* fs; /* Pointer to the hosting volume of this object */ - WORD id; /* Hosting volume mount ID */ - BYTE attr; /* Object attribute */ - BYTE stat; /* Object chain status (b1-0: =0:not contiguous, =2:contiguous, =3:flagmented in this session, b2:sub-directory stretched) */ - DWORD sclust; /* Object data start cluster (0:no cluster or root directory) */ - FSIZE_t objsize; /* Object size (valid when sclust != 0) */ -#if FF_FS_EXFAT - DWORD n_cont; /* Size of first fragment - 1 (valid when stat == 3) */ - DWORD n_frag; /* Size of last fragment needs to be written to FAT (valid when not zero) */ - DWORD c_scl; /* Containing directory start cluster (valid when sclust != 0) */ - DWORD c_size; /* b31-b8:Size of containing directory, b7-b0: Chain status (valid when c_scl != 0) */ - DWORD c_ofs; /* Offset in the containing directory (valid when file object and sclust != 0) */ -#endif -#if FF_FS_LOCK - UINT lockid; /* File lock ID origin from 1 (index of file semaphore table Files[]) */ -#endif -} FFOBJID; - - - -/* File object structure (FIL) */ - -typedef struct { - FFOBJID obj; /* Object identifier (must be the 1st member to detect invalid object pointer) */ - BYTE flag; /* File status flags */ - BYTE err; /* Abort flag (error code) */ - FSIZE_t fptr; /* File read/write pointer (Zeroed on file open) */ - DWORD clust; /* Current cluster of fpter (invalid when fptr is 0) */ - DWORD sect; /* Sector number appearing in buf[] (0:invalid) */ -#if !FF_FS_READONLY - DWORD dir_sect; /* Sector number containing the directory entry (not used at exFAT) */ - BYTE* dir_ptr; /* Pointer to the directory entry in the win[] (not used at exFAT) */ -#endif -#if FF_USE_FASTSEEK - DWORD* cltbl; /* Pointer to the cluster link map table (nulled on open, set by application) */ -#endif -#if !FF_FS_TINY - BYTE buf[FF_MAX_SS]; /* File private data read/write window */ -#endif -} FIL; - - - -/* Directory object structure (FF_DIR) */ - -typedef struct { - FFOBJID obj; /* Object identifier */ - DWORD dptr; /* Current read/write offset */ - DWORD clust; /* Current cluster */ - DWORD sect; /* Current sector (0:Read operation has terminated) */ - BYTE* dir; /* Pointer to the directory item in the win[] */ - BYTE fn[12]; /* SFN (in/out) {body[8],ext[3],status[1]} */ -#if FF_USE_LFN - DWORD blk_ofs; /* Offset of current entry block being processed (0xFFFFFFFF:Invalid) */ -#endif -#if FF_USE_FIND - const TCHAR* pat; /* Pointer to the name matching pattern */ -#endif -} FF_DIR; - - - -/* File information structure (FILINFO) */ - -typedef struct { - FSIZE_t fsize; /* File size */ - WORD fdate; /* Modified date */ - WORD ftime; /* Modified time */ - BYTE fattrib; /* File attribute */ -#if FF_USE_LFN - TCHAR altname[FF_SFN_BUF + 1];/* Altenative file name */ - TCHAR fname[FF_LFN_BUF + 1]; /* Primary file name */ -#else - TCHAR fname[12 + 1]; /* File name */ -#endif -} FILINFO; - - - -/* File function return code (FRESULT) */ - -typedef enum { - FR_OK = 0, /* (0) Succeeded */ - FR_DISK_ERR, /* (1) A hard error occurred in the low level disk I/O layer */ - FR_INT_ERR, /* (2) Assertion failed */ - FR_NOT_READY, /* (3) The physical drive cannot work */ - FR_NO_FILE, /* (4) Could not find the file */ - FR_NO_PATH, /* (5) Could not find the path */ - FR_INVALID_NAME, /* (6) The path name format is invalid */ - FR_DENIED, /* (7) Access denied due to prohibited access or directory full */ - FR_EXIST, /* (8) Access denied due to prohibited access */ - FR_INVALID_OBJECT, /* (9) The file/directory object is invalid */ - FR_WRITE_PROTECTED, /* (10) The physical drive is write protected */ - FR_INVALID_DRIVE, /* (11) The logical drive number is invalid */ - FR_NOT_ENABLED, /* (12) The volume has no work area */ - FR_NO_FILESYSTEM, /* (13) There is no valid FAT volume */ - FR_MKFS_ABORTED, /* (14) The f_mkfs() aborted due to any problem */ - FR_TIMEOUT, /* (15) Could not get a grant to access the volume within defined period */ - FR_LOCKED, /* (16) The operation is rejected according to the file sharing policy */ - FR_NOT_ENOUGH_CORE, /* (17) LFN working buffer could not be allocated */ - FR_TOO_MANY_OPEN_FILES, /* (18) Number of open files > FF_FS_LOCK */ - FR_INVALID_PARAMETER /* (19) Given parameter is invalid */ -} FRESULT; - - - -/*--------------------------------------------------------------*/ -/* FatFs module application interface */ - -FRESULT f_open (FIL* fp, const TCHAR* path, BYTE mode); /* Open or create a file */ -FRESULT f_close (FIL* fp); /* Close an open file object */ -FRESULT f_read (FIL* fp, void* buff, UINT btr, UINT* br); /* Read data from the file */ -FRESULT f_write (FIL* fp, const void* buff, UINT btw, UINT* bw); /* Write data to the file */ -FRESULT f_lseek (FIL* fp, FSIZE_t ofs); /* Move file pointer of the file object */ -FRESULT f_truncate (FIL* fp); /* Truncate the file */ -FRESULT f_sync (FIL* fp); /* Flush cached data of the writing file */ -FRESULT f_opendir (FF_DIR* dp, const TCHAR* path); /* Open a directory */ -FRESULT f_closedir (FF_DIR* dp); /* Close an open directory */ -FRESULT f_readdir (FF_DIR* dp, FILINFO* fno); /* Read a directory item */ -FRESULT f_findfirst (FF_DIR* dp, FILINFO* fno, const TCHAR* path, const TCHAR* pattern); /* Find first file */ -FRESULT f_findnext (FF_DIR* dp, FILINFO* fno); /* Find next file */ -FRESULT f_mkdir (const TCHAR* path); /* Create a sub directory */ -FRESULT f_unlink (const TCHAR* path); /* Delete an existing file or directory */ -FRESULT f_rename (const TCHAR* path_old, const TCHAR* path_new); /* Rename/Move a file or directory */ -FRESULT f_stat (const TCHAR* path, FILINFO* fno); /* Get file status */ -FRESULT f_chmod (const TCHAR* path, BYTE attr, BYTE mask); /* Change attribute of a file/dir */ -FRESULT f_utime (const TCHAR* path, const FILINFO* fno); /* Change timestamp of a file/dir */ -FRESULT f_chdir (const TCHAR* path); /* Change current directory */ -FRESULT f_chdrive (const TCHAR* path); /* Change current drive */ -FRESULT f_getcwd (TCHAR* buff, UINT len); /* Get current directory */ -FRESULT f_getfree (const TCHAR* path, DWORD* nclst, FATFS** fatfs); /* Get number of free clusters on the drive */ -FRESULT f_getlabel (const TCHAR* path, TCHAR* label, DWORD* vsn); /* Get volume label */ -FRESULT f_setlabel (const TCHAR* label); /* Set volume label */ -FRESULT f_forward (FIL* fp, UINT(*func)(const BYTE*,UINT), UINT btf, UINT* bf); /* Forward data to the stream */ -FRESULT f_expand (FIL* fp, FSIZE_t szf, BYTE opt); /* Allocate a contiguous block to the file */ -FRESULT f_mount (FATFS* fs, const TCHAR* path, BYTE opt); /* Mount/Unmount a logical drive */ -FRESULT f_mkfs (const TCHAR* path, BYTE opt, DWORD au, void* work, UINT len); /* Create a FAT volume */ -FRESULT f_fdisk (BYTE pdrv, const DWORD* szt, void* work); /* Divide a physical drive into some partitions */ -FRESULT f_setcp (WORD cp); /* Set current code page */ -int f_putc (TCHAR c, FIL* fp); /* Put a character to the file */ -int f_puts (const TCHAR* str, FIL* cp); /* Put a string to the file */ -int f_printf (FIL* fp, const TCHAR* str, ...); /* Put a formatted string to the file */ -TCHAR* f_gets (TCHAR* buff, int len, FIL* fp); /* Get a string from the file */ - -#define f_eof(fp) ((int)((fp)->fptr == (fp)->obj.objsize)) -#define f_error(fp) ((fp)->err) -#define f_tell(fp) ((fp)->fptr) -#define f_size(fp) ((fp)->obj.objsize) -#define f_rewind(fp) f_lseek((fp), 0) -#define f_rewinddir(dp) f_readdir((dp), 0) -#define f_rmdir(path) f_unlink(path) -#define f_unmount(path) f_mount(0, path, 0) - -#ifndef EOF -#define EOF (-1) -#endif - - - - -/*--------------------------------------------------------------*/ -/* Additional user defined functions */ - -/* RTC function */ -#if !FF_FS_READONLY && !FF_FS_NORTC -DWORD get_fattime (void); -#endif - -/* LFN support functions */ -#if FF_USE_LFN >= 1 /* Code conversion (defined in unicode.c) */ -WCHAR ff_oem2uni (WCHAR oem, WORD cp); /* OEM code to Unicode conversion */ -WCHAR ff_uni2oem (DWORD uni, WORD cp); /* Unicode to OEM code conversion */ -DWORD ff_wtoupper (DWORD uni); /* Unicode upper-case conversion */ -#endif -#if FF_USE_LFN == 3 /* Dynamic memory allocation */ -void* ff_memalloc (UINT msize); /* Allocate memory block */ -void ff_memfree (void* mblock); /* Free memory block */ -#endif - -/* Sync functions */ -#if FF_FS_REENTRANT -int ff_cre_syncobj (BYTE vol, FF_SYNC_t* sobj); /* Create a sync object */ -int ff_req_grant (FF_SYNC_t sobj); /* Lock sync object */ -void ff_rel_grant (FF_SYNC_t sobj); /* Unlock sync object */ -int ff_del_syncobj (FF_SYNC_t sobj); /* Delete a sync object */ -#endif - - - - -/*--------------------------------------------------------------*/ -/* Flags and offset address */ - - -/* File access mode and open method flags (3rd argument of f_open) */ -#define FA_READ 0x01 -#define FA_WRITE 0x02 -#define FA_OPEN_EXISTING 0x00 -#define FA_CREATE_NEW 0x04 -#define FA_CREATE_ALWAYS 0x08 -#define FA_OPEN_ALWAYS 0x10 -#define FA_OPEN_APPEND 0x30 - -/* Fast seek controls (2nd argument of f_lseek) */ -#define CREATE_LINKMAP ((FSIZE_t)0 - 1) - -/* Format options (2nd argument of f_mkfs) */ -#define FM_FAT 0x01 -#define FM_FAT32 0x02 -#define FM_EXFAT 0x04 -#define FM_ANY 0x07 -#define FM_SFD 0x08 - -/* Filesystem type (FATFS.fs_type) */ -#define FS_FAT12 1 -#define FS_FAT16 2 -#define FS_FAT32 3 -#define FS_EXFAT 4 - -/* File attribute bits for directory entry (FILINFO.fattrib) */ -#define AM_RDO 0x01 /* Read only */ -#define AM_HID 0x02 /* Hidden */ -#define AM_SYS 0x04 /* System */ -#define AM_DIR 0x10 /* Directory */ -#define AM_ARC 0x20 /* Archive */ - - -#ifdef __cplusplus -} -#endif - -#endif /* FF_DEFINED */ diff --git a/tools/sdk/include/fatfs/ffconf.h b/tools/sdk/include/fatfs/ffconf.h deleted file mode 100644 index 1b1cf8c85ca..00000000000 --- a/tools/sdk/include/fatfs/ffconf.h +++ /dev/null @@ -1,304 +0,0 @@ -#include -#include "sdkconfig.h" -/*---------------------------------------------------------------------------/ -/ FatFs - Configuration file -/---------------------------------------------------------------------------*/ - -#define FFCONF_DEF 89352 /* Revision ID */ - -/*---------------------------------------------------------------------------/ -/ Function Configurations -/---------------------------------------------------------------------------*/ - -#define FF_FS_READONLY 0 -/* This option switches read-only configuration. (0:Read/Write or 1:Read-only) -/ Read-only configuration removes writing API functions, f_write(), f_sync(), -/ f_unlink(), f_mkdir(), f_chmod(), f_rename(), f_truncate(), f_getfree() -/ and optional writing functions as well. */ - - -#define FF_FS_MINIMIZE 0 -/* This option defines minimization level to remove some basic API functions. -/ -/ 0: Basic functions are fully enabled. -/ 1: f_stat(), f_getfree(), f_unlink(), f_mkdir(), f_truncate() and f_rename() -/ are removed. -/ 2: f_opendir(), f_readdir() and f_closedir() are removed in addition to 1. -/ 3: f_lseek() function is removed in addition to 2. */ - - -#define FF_USE_STRFUNC 0 -/* This option switches string functions, f_gets(), f_putc(), f_puts() and f_printf(). -/ -/ 0: Disable string functions. -/ 1: Enable without LF-CRLF conversion. -/ 2: Enable with LF-CRLF conversion. */ - - -#define FF_USE_FIND 0 -/* This option switches filtered directory read functions, f_findfirst() and -/ f_findnext(). (0:Disable, 1:Enable 2:Enable with matching altname[] too) */ - - -#define FF_USE_MKFS 1 -/* This option switches f_mkfs() function. (0:Disable or 1:Enable) */ - - -#define FF_USE_FASTSEEK 0 -/* This option switches fast seek function. (0:Disable or 1:Enable) */ - - -#define FF_USE_EXPAND 0 -/* This option switches f_expand function. (0:Disable or 1:Enable) */ - - -#define FF_USE_CHMOD 0 -/* This option switches attribute manipulation functions, f_chmod() and f_utime(). -/ (0:Disable or 1:Enable) Also FF_FS_READONLY needs to be 0 to enable this option. */ - - -#define FF_USE_LABEL 0 -/* This option switches volume label functions, f_getlabel() and f_setlabel(). -/ (0:Disable or 1:Enable) */ - - -#define FF_USE_FORWARD 0 -/* This option switches f_forward() function. (0:Disable or 1:Enable) */ - - -/*---------------------------------------------------------------------------/ -/ Locale and Namespace Configurations -/---------------------------------------------------------------------------*/ - -#define FF_CODE_PAGE CONFIG_FATFS_CODEPAGE -/* This option specifies the OEM code page to be used on the target system. -/ Incorrect code page setting can cause a file open failure. -/ -/ 437 - U.S. -/ 720 - Arabic -/ 737 - Greek -/ 771 - KBL -/ 775 - Baltic -/ 850 - Latin 1 -/ 852 - Latin 2 -/ 855 - Cyrillic -/ 857 - Turkish -/ 860 - Portuguese -/ 861 - Icelandic -/ 862 - Hebrew -/ 863 - Canadian French -/ 864 - Arabic -/ 865 - Nordic -/ 866 - Russian -/ 869 - Greek 2 -/ 932 - Japanese (DBCS) -/ 936 - Simplified Chinese (DBCS) -/ 949 - Korean (DBCS) -/ 950 - Traditional Chinese (DBCS) -/ 0 - Include all code pages above and configured by f_setcp() -*/ - - -#if defined(CONFIG_FATFS_LFN_STACK) -#define FF_USE_LFN 2 -#elif defined(CONFIG_FATFS_LFN_HEAP) -#define FF_USE_LFN 3 -#else /* CONFIG_FATFS_LFN_NONE */ -#define FF_USE_LFN 0 -#endif - -#ifdef CONFIG_FATFS_MAX_LFN -#define FF_MAX_LFN CONFIG_FATFS_MAX_LFN -#endif - -/* The FF_USE_LFN switches the support for LFN (long file name). -/ -/ 0: Disable LFN. FF_MAX_LFN has no effect. -/ 1: Enable LFN with static working buffer on the BSS. Always NOT thread-safe. -/ 2: Enable LFN with dynamic working buffer on the STACK. -/ 3: Enable LFN with dynamic working buffer on the HEAP. -/ -/ To enable the LFN, ffunicode.c needs to be added to the project. The LFN function -/ requiers certain internal working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and -/ additional (FF_MAX_LFN + 44) / 15 * 32 bytes when exFAT is enabled. -/ The FF_MAX_LFN defines size of the working buffer in UTF-16 code unit and it can -/ be in range of 12 to 255. It is recommended to be set 255 to fully support LFN -/ specification. -/ When use stack for the working buffer, take care on stack overflow. When use heap -/ memory for the working buffer, memory management functions, ff_memalloc() and -/ ff_memfree() in ffsystem.c, need to be added to the project. */ - - -#ifdef CONFIG_FATFS_API_ENCODING_UTF_8 -#define FF_LFN_UNICODE 2 -#elif defined(CONFIG_FATFS_API_ENCODING_UTF_16) -#define FF_LFN_UNICODE 1 -#else /* CONFIG_FATFS_API_ENCODING_ANSI_OEM */ -#define FF_LFN_UNICODE 0 -#endif -/* This option switches the character encoding on the API when LFN is enabled. -/ -/ 0: ANSI/OEM in current CP (TCHAR = char) -/ 1: Unicode in UTF-16 (TCHAR = WCHAR) -/ 2: Unicode in UTF-8 (TCHAR = char) -/ -/ Also behavior of string I/O functions will be affected by this option. -/ When LFN is not enabled, this option has no effect. */ - - -#define FF_LFN_BUF 255 -#define FF_SFN_BUF 12 -/* This set of options defines size of file name members in the FILINFO structure -/ which is used to read out directory items. These values should be suffcient for -/ the file names to read. The maximum possible length of the read file name depends -/ on character encoding. When LFN is not enabled, these options have no effect. */ - - -#define FF_STRF_ENCODE 3 -/* When FF_LFN_UNICODE >= 1 with LFN enabled, string I/O functions, f_gets(), -/ f_putc(), f_puts and f_printf() convert the character encoding in it. -/ This option selects assumption of character encoding ON THE FILE to be -/ read/written via those functions. -/ -/ 0: ANSI/OEM in current CP -/ 1: Unicode in UTF-16LE -/ 2: Unicode in UTF-16BE -/ 3: Unicode in UTF-8 -*/ - - -#define FF_FS_RPATH 0 -/* This option configures support for relative path. -/ -/ 0: Disable relative path and remove related functions. -/ 1: Enable relative path. f_chdir() and f_chdrive() are available. -/ 2: f_getcwd() function is available in addition to 1. -*/ - - -/*---------------------------------------------------------------------------/ -/ Drive/Volume Configurations -/---------------------------------------------------------------------------*/ - -#define FF_VOLUMES 2 -/* Number of volumes (logical drives) to be used. (1-10) */ - - -#define FF_STR_VOLUME_ID 0 -#define FF_VOLUME_STRS "RAM","NAND","CF","SD","SD2","USB","USB2","USB3" -/* FF_STR_VOLUME_ID switches string support for volume ID. -/ When FF_STR_VOLUME_ID is set to 1, also pre-defined strings can be used as drive -/ number in the path name. FF_VOLUME_STRS defines the drive ID strings for each -/ logical drives. Number of items must be equal to FF_VOLUMES. Valid characters for -/ the drive ID strings are: A-Z and 0-9. */ - - -#define FF_MULTI_PARTITION 1 -/* This option switches support for multiple volumes on the physical drive. -/ By default (0), each logical drive number is bound to the same physical drive -/ number and only an FAT volume found on the physical drive will be mounted. -/ When this function is enabled (1), each logical drive number can be bound to -/ arbitrary physical drive and partition listed in the VolToPart[]. Also f_fdisk() -/ funciton will be available. */ - -/* SD card sector size */ -#define FF_SS_SDCARD 512 -/* wear_levelling library sector size */ -#define FF_SS_WL CONFIG_WL_SECTOR_SIZE - -#define FF_MIN_SS MIN(FF_SS_SDCARD, FF_SS_WL) -#define FF_MAX_SS MAX(FF_SS_SDCARD, FF_SS_WL) -/* This set of options configures the range of sector size to be supported. (512, -/ 1024, 2048 or 4096) Always set both 512 for most systems, generic memory card and -/ harddisk. But a larger value may be required for on-board flash memory and some -/ type of optical media. When FF_MAX_SS is larger than FF_MIN_SS, FatFs is configured -/ for variable sector size mode and disk_ioctl() function needs to implement -/ GET_SECTOR_SIZE command. */ - - -#define FF_USE_TRIM 0 -/* This option switches support for ATA-TRIM. (0:Disable or 1:Enable) -/ To enable Trim function, also CTRL_TRIM command should be implemented to the -/ disk_ioctl() function. */ - - -#define FF_FS_NOFSINFO 0 -/* If you need to know correct free space on the FAT32 volume, set bit 0 of this -/ option, and f_getfree() function at first time after volume mount will force -/ a full FAT scan. Bit 1 controls the use of last allocated cluster number. -/ -/ bit0=0: Use free cluster count in the FSINFO if available. -/ bit0=1: Do not trust free cluster count in the FSINFO. -/ bit1=0: Use last allocated cluster number in the FSINFO if available. -/ bit1=1: Do not trust last allocated cluster number in the FSINFO. -*/ - - - -/*---------------------------------------------------------------------------/ -/ System Configurations -/---------------------------------------------------------------------------*/ - -#define FF_FS_TINY (!CONFIG_FATFS_PER_FILE_CACHE) -/* This option switches tiny buffer configuration. (0:Normal or 1:Tiny) -/ At the tiny configuration, size of file object (FIL) is shrinked FF_MAX_SS bytes. -/ Instead of private sector buffer eliminated from the file object, common sector -/ buffer in the filesystem object (FATFS) is used for the file data transfer. */ - - -#define FF_FS_EXFAT 0 -/* This option switches support for exFAT filesystem. (0:Disable or 1:Enable) -/ When enable exFAT, also LFN needs to be enabled. -/ Note that enabling exFAT discards ANSI C (C89) compatibility. */ - - -#define FF_FS_NORTC 0 -#define FF_NORTC_MON 1 -#define FF_NORTC_MDAY 1 -#define FF_NORTC_YEAR 2017 -/* The option FF_FS_NORTC switches timestamp functiton. If the system does not have -/ any RTC function or valid timestamp is not needed, set FF_FS_NORTC = 1 to disable -/ the timestamp function. All objects modified by FatFs will have a fixed timestamp -/ defined by FF_NORTC_MON, FF_NORTC_MDAY and FF_NORTC_YEAR in local time. -/ To enable timestamp function (FF_FS_NORTC = 0), get_fattime() function need to be -/ added to the project to read current time form real-time clock. FF_NORTC_MON, -/ FF_NORTC_MDAY and FF_NORTC_YEAR have no effect. -/ These options have no effect at read-only configuration (FF_FS_READONLY = 1). */ - - -#define FF_FS_LOCK CONFIG_FATFS_FS_LOCK -/* The option FF_FS_LOCK switches file lock function to control duplicated file open -/ and illegal operation to open objects. This option must be 0 when FF_FS_READONLY -/ is 1. -/ -/ 0: Disable file lock function. To avoid volume corruption, application program -/ should avoid illegal open, remove and rename to the open objects. -/ >0: Enable file lock function. The value defines how many files/sub-directories -/ can be opened simultaneously under file lock control. Note that the file -/ lock control is independent of re-entrancy. */ - - -#define FF_FS_REENTRANT 1 -#define FF_FS_TIMEOUT (CONFIG_FATFS_TIMEOUT_MS / portTICK_PERIOD_MS) -#define FF_SYNC_t SemaphoreHandle_t -/* The option FF_FS_REENTRANT switches the re-entrancy (thread safe) of the FatFs -/ module itself. Note that regardless of this option, file access to different -/ volume is always re-entrant and volume control functions, f_mount(), f_mkfs() -/ and f_fdisk() function, are always not re-entrant. Only file/directory access -/ to the same volume is under control of this function. -/ -/ 0: Disable re-entrancy. FF_FS_TIMEOUT and FF_SYNC_t have no effect. -/ 1: Enable re-entrancy. Also user provided synchronization handlers, -/ ff_req_grant(), ff_rel_grant(), ff_del_syncobj() and ff_cre_syncobj() -/ function, must be added to the project. Samples are available in -/ option/syscall.c. -/ -/ The FF_FS_TIMEOUT defines timeout period in unit of time tick. -/ The FF_SYNC_t defines O/S dependent sync object type. e.g. HANDLE, ID, OS_EVENT*, -/ SemaphoreHandle_t and etc. A header file for O/S definitions needs to be -/ included somewhere in the scope of ff.h. */ - -#include "freertos/FreeRTOS.h" -#include "freertos/semphr.h" - -/*--- End of configuration options ---*/ diff --git a/tools/sdk/include/fatfs/integer.h b/tools/sdk/include/fatfs/integer.h deleted file mode 100644 index 4fcf5c443ff..00000000000 --- a/tools/sdk/include/fatfs/integer.h +++ /dev/null @@ -1,38 +0,0 @@ -/*-------------------------------------------*/ -/* Integer type definitions for FatFs module */ -/*-------------------------------------------*/ - -#ifndef FF_INTEGER -#define FF_INTEGER - -#ifdef _WIN32 /* FatFs development platform */ - -#include -#include -typedef unsigned __int64 QWORD; - - -#else /* Embedded platform */ - -/* These types MUST be 16-bit or 32-bit */ -typedef int INT; -typedef unsigned int UINT; - -/* This type MUST be 8-bit */ -typedef unsigned char BYTE; - -/* These types MUST be 16-bit */ -typedef short SHORT; -typedef unsigned short WORD; -typedef unsigned short WCHAR; - -/* These types MUST be 32-bit */ -typedef long LONG; -typedef unsigned long DWORD; - -/* This type MUST be 64-bit (Remove this for ANSI C (C89) compatibility) */ -typedef unsigned long long QWORD; - -#endif - -#endif diff --git a/tools/sdk/include/fatfs/vfs_fat_internal.h b/tools/sdk/include/fatfs/vfs_fat_internal.h deleted file mode 100644 index dc3bae271ca..00000000000 --- a/tools/sdk/include/fatfs/vfs_fat_internal.h +++ /dev/null @@ -1,30 +0,0 @@ -// 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. - -#pragma once - -#include "esp_vfs_fat.h" -#include -#include - -static inline size_t esp_vfs_fat_get_allocation_unit_size( - size_t sector_size, size_t requested_size) -{ - size_t alloc_unit_size = requested_size; - const size_t max_sectors_per_cylinder = 128; - const size_t max_size = sector_size * max_sectors_per_cylinder; - alloc_unit_size = MAX(alloc_unit_size, sector_size); - alloc_unit_size = MIN(alloc_unit_size, max_size); - return alloc_unit_size; -} diff --git a/tools/sdk/include/fb_gfx/fb_gfx.h b/tools/sdk/include/fb_gfx/fb_gfx.h deleted file mode 100644 index 079ff7bfe4a..00000000000 --- a/tools/sdk/include/fb_gfx/fb_gfx.h +++ /dev/null @@ -1,44 +0,0 @@ -// 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. -#ifndef _FB_GFX_H_ -#define _FB_GFX_H_ - -#ifdef __cplusplus -extern "C" { -#endif - - typedef enum { - FB_RGB888, FB_BGR888, FB_RGB565, FB_BGR565 - } fb_format_t; - - typedef struct { - int width; - int height; - int bytes_per_pixel; - fb_format_t format; - uint8_t * data; - } fb_data_t; - - void fb_gfx_fillRect (fb_data_t *fb, int32_t x, int32_t y, int32_t w, int32_t h, uint32_t color); - void fb_gfx_drawFastHLine(fb_data_t *fb, int32_t x, int32_t y, int32_t w, uint32_t color); - void fb_gfx_drawFastVLine(fb_data_t *fb, int32_t x, int32_t y, int32_t h, uint32_t color); - uint8_t fb_gfx_putc (fb_data_t *fb, int32_t x, int32_t y, uint32_t color, unsigned char c); - uint32_t fb_gfx_print (fb_data_t *fb, int32_t x, int32_t y, uint32_t color, const char * str); - uint32_t fb_gfx_printf (fb_data_t *fb, int32_t x, int32_t y, uint32_t color, const char *format, ...); - -#ifdef __cplusplus -} -#endif - -#endif /* _FB_GFX_H_ */ diff --git a/tools/sdk/include/freemodbus/mb.h b/tools/sdk/include/freemodbus/mb.h deleted file mode 100644 index 8d6be7b4226..00000000000 --- a/tools/sdk/include/freemodbus/mb.h +++ /dev/null @@ -1,417 +0,0 @@ -/* - * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. - * - * 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. - * - * File: $Id: mb.h,v 1.17 2006/12/07 22:10:34 wolti Exp $ - */ - -#ifndef _MB_H -#define _MB_H - -#include "port.h" - -#ifdef __cplusplus -PR_BEGIN_EXTERN_C -#endif - -#include "mbport.h" -#include "mbproto.h" - -/*! \defgroup modbus Modbus - * \code #include "mb.h" \endcode - * - * This module defines the interface for the application. It contains - * the basic functions and types required to use the Modbus protocol stack. - * A typical application will want to call eMBInit() first. If the device - * is ready to answer network requests it must then call eMBEnable() to activate - * the protocol stack. In the main loop the function eMBPoll() must be called - * periodically. The time interval between pooling depends on the configured - * Modbus timeout. If an RTOS is available a separate task should be created - * and the task should always call the function eMBPoll(). - * - * \code - * // Initialize protocol stack in RTU mode for a slave with address 10 = 0x0A - * eMBInit( MB_RTU, 0x0A, 38400, MB_PAR_EVEN ); - * // Enable the Modbus Protocol Stack. - * eMBEnable( ); - * for( ;; ) - * { - * // Call the main polling loop of the Modbus protocol stack. - * eMBPoll( ); - * ... - * } - * \endcode - */ - -/* ----------------------- Defines ------------------------------------------*/ - -/*! \ingroup modbus - * \brief Use the default Modbus TCP port (502) - */ -#define MB_TCP_PORT_USE_DEFAULT 0 - -/* ----------------------- Type definitions ---------------------------------*/ - -/*! \ingroup modbus - * \brief Modbus serial transmission modes (RTU/ASCII). - * - * Modbus serial supports two transmission modes. Either ASCII or RTU. RTU - * is faster but has more hardware requirements and requires a network with - * a low jitter. ASCII is slower and more reliable on slower links (E.g. modems) - */ - typedef enum -{ - MB_RTU, /*!< RTU transmission mode. */ - MB_ASCII, /*!< ASCII transmission mode. */ - MB_TCP /*!< TCP mode. */ -} eMBMode; - -/*! \ingroup modbus - * \brief If register should be written or read. - * - * This value is passed to the callback functions which support either - * reading or writing register values. Writing means that the application - * registers should be updated and reading means that the modbus protocol - * stack needs to know the current register values. - * - * \see eMBRegHoldingCB( ), eMBRegCoilsCB( ), eMBRegDiscreteCB( ) and - * eMBRegInputCB( ). - */ -typedef enum -{ - MB_REG_READ, /*!< Read register values and pass to protocol stack. */ - MB_REG_WRITE /*!< Update register values. */ -} eMBRegisterMode; - -/*! \ingroup modbus - * \brief Errorcodes used by all function in the protocol stack. - */ -typedef enum -{ - MB_ENOERR, /*!< no error. */ - MB_ENOREG, /*!< illegal register address. */ - MB_EINVAL, /*!< illegal argument. */ - MB_EPORTERR, /*!< porting layer error. */ - MB_ENORES, /*!< insufficient resources. */ - MB_EIO, /*!< I/O error. */ - MB_EILLSTATE, /*!< protocol stack in illegal state. */ - MB_ETIMEDOUT /*!< timeout error occurred. */ -} eMBErrorCode; - - -/* ----------------------- Function prototypes ------------------------------*/ -/*! \ingroup modbus - * \brief Initialize the Modbus protocol stack. - * - * This functions initializes the ASCII or RTU module and calls the - * init functions of the porting layer to prepare the hardware. Please - * note that the receiver is still disabled and no Modbus frames are - * processed until eMBEnable( ) has been called. - * - * \param eMode If ASCII or RTU mode should be used. - * \param ucSlaveAddress The slave address. Only frames sent to this - * address or to the broadcast address are processed. - * \param ucPort The port to use. E.g. 1 for COM1 on windows. This value - * is platform dependent and some ports simply choose to ignore it. - * \param ulBaudRate The baudrate. E.g. 19200. Supported baudrates depend - * on the porting layer. - * \param eParity Parity used for serial transmission. - * - * \return If no error occurs the function returns eMBErrorCode::MB_ENOERR. - * The protocol is then in the disabled state and ready for activation - * by calling eMBEnable( ). Otherwise one of the following error codes - * is returned: - * - eMBErrorCode::MB_EINVAL If the slave address was not valid. Valid - * slave addresses are in the range 1 - 247. - * - eMBErrorCode::MB_EPORTERR IF the porting layer returned an error. - */ -eMBErrorCode eMBInit( eMBMode eMode, UCHAR ucSlaveAddress, - UCHAR ucPort, ULONG ulBaudRate, eMBParity eParity ); - -/*! \ingroup modbus - * \brief Initialize the Modbus protocol stack for Modbus TCP. - * - * This function initializes the Modbus TCP Module. Please note that - * frame processing is still disabled until eMBEnable( ) is called. - * - * \param usTCPPort The TCP port to listen on. - * \return If the protocol stack has been initialized correctly the function - * returns eMBErrorCode::MB_ENOERR. Otherwise one of the following error - * codes is returned: - * - eMBErrorCode::MB_EINVAL If the slave address was not valid. Valid - * slave addresses are in the range 1 - 247. - * - eMBErrorCode::MB_EPORTERR IF the porting layer returned an error. - */ -eMBErrorCode eMBTCPInit( USHORT usTCPPort ); - -/*! \ingroup modbus - * \brief Release resources used by the protocol stack. - * - * This function disables the Modbus protocol stack and release all - * hardware resources. It must only be called when the protocol stack - * is disabled. - * - * \note Note all ports implement this function. A port which wants to - * get an callback must define the macro MB_PORT_HAS_CLOSE to 1. - * - * \return If the resources where released it return eMBErrorCode::MB_ENOERR. - * If the protocol stack is not in the disabled state it returns - * eMBErrorCode::MB_EILLSTATE. - */ -eMBErrorCode eMBClose( void ); - -/*! \ingroup modbus - * \brief Enable the Modbus protocol stack. - * - * This function enables processing of Modbus frames. Enabling the protocol - * stack is only possible if it is in the disabled state. - * - * \return If the protocol stack is now in the state enabled it returns - * eMBErrorCode::MB_ENOERR. If it was not in the disabled state it - * return eMBErrorCode::MB_EILLSTATE. - */ -eMBErrorCode eMBEnable( void ); - -/*! \ingroup modbus - * \brief Disable the Modbus protocol stack. - * - * This function disables processing of Modbus frames. - * - * \return If the protocol stack has been disabled it returns - * eMBErrorCode::MB_ENOERR. If it was not in the enabled state it returns - * eMBErrorCode::MB_EILLSTATE. - */ -eMBErrorCode eMBDisable( void ); - -/*! \ingroup modbus - * \brief The main pooling loop of the Modbus protocol stack. - * - * This function must be called periodically. The timer interval required - * is given by the application dependent Modbus slave timeout. Internally the - * function calls xMBPortEventGet() and waits for an event from the receiver or - * transmitter state machines. - * - * \return If the protocol stack is not in the enabled state the function - * returns eMBErrorCode::MB_EILLSTATE. Otherwise it returns - * eMBErrorCode::MB_ENOERR. - */ -eMBErrorCode eMBPoll( void ); - -/*! \ingroup modbus - * \brief Configure the slave id of the device. - * - * This function should be called when the Modbus function Report Slave ID - * is enabled ( By defining MB_FUNC_OTHER_REP_SLAVEID_ENABLED in mbconfig.h ). - * - * \param ucSlaveID Values is returned in the Slave ID byte of the - * Report Slave ID response. - * \param xIsRunning If TRUE the Run Indicator Status byte is set to 0xFF. - * otherwise the Run Indicator Status is 0x00. - * \param pucAdditional Values which should be returned in the Additional - * bytes of the Report Slave ID response. - * \param usAdditionalLen Length of the buffer pucAdditonal. - * - * \return If the static buffer defined by MB_FUNC_OTHER_REP_SLAVEID_BUF in - * mbconfig.h is to small it returns eMBErrorCode::MB_ENORES. Otherwise - * it returns eMBErrorCode::MB_ENOERR. - */ -eMBErrorCode eMBSetSlaveID( UCHAR ucSlaveID, BOOL xIsRunning, - UCHAR const *pucAdditional, - USHORT usAdditionalLen ); - -/*! \ingroup modbus - * \brief Registers a callback handler for a given function code. - * - * This function registers a new callback handler for a given function code. - * The callback handler supplied is responsible for interpreting the Modbus PDU and - * the creation of an appropriate response. In case of an error it should return - * one of the possible Modbus exceptions which results in a Modbus exception frame - * sent by the protocol stack. - * - * \param ucFunctionCode The Modbus function code for which this handler should - * be registers. Valid function codes are in the range 1 to 127. - * \param pxHandler The function handler which should be called in case - * such a frame is received. If \c NULL a previously registered function handler - * for this function code is removed. - * - * \return eMBErrorCode::MB_ENOERR if the handler has been installed. If no - * more resources are available it returns eMBErrorCode::MB_ENORES. In this - * case the values in mbconfig.h should be adjusted. If the argument was not - * valid it returns eMBErrorCode::MB_EINVAL. - */ -eMBErrorCode eMBRegisterCB( UCHAR ucFunctionCode, - pxMBFunctionHandler pxHandler ); - -/* ----------------------- Callback -----------------------------------------*/ - -/*! \defgroup modbus_registers Modbus Registers - * \code #include "mb.h" \endcode - * The protocol stack does not internally allocate any memory for the - * registers. This makes the protocol stack very small and also usable on - * low end targets. In addition the values don't have to be in the memory - * and could for example be stored in a flash.
- * Whenever the protocol stack requires a value it calls one of the callback - * function with the register address and the number of registers to read - * as an argument. The application should then read the actual register values - * (for example the ADC voltage) and should store the result in the supplied - * buffer.
- * If the protocol stack wants to update a register value because a write - * register function was received a buffer with the new register values is - * passed to the callback function. The function should then use these values - * to update the application register values. - */ - -/*! \ingroup modbus_registers - * \brief Callback function used if the value of a Input Register - * is required by the protocol stack. The starting register address is given - * by \c usAddress and the last register is given by usAddress + - * usNRegs - 1. - * - * \param pucRegBuffer A buffer where the callback function should write - * the current value of the modbus registers to. - * \param usAddress The starting address of the register. Input registers - * are in the range 1 - 65535. - * \param usNRegs Number of registers the callback function must supply. - * - * \return The function must return one of the following error codes: - * - eMBErrorCode::MB_ENOERR If no error occurred. In this case a normal - * Modbus response is sent. - * - eMBErrorCode::MB_ENOREG If the application can not supply values - * for registers within this range. In this case a - * ILLEGAL DATA ADDRESS exception frame is sent as a response. - * - eMBErrorCode::MB_ETIMEDOUT If the requested register block is - * currently not available and the application dependent response - * timeout would be violated. In this case a SLAVE DEVICE BUSY - * exception is sent as a response. - * - eMBErrorCode::MB_EIO If an unrecoverable error occurred. In this case - * a SLAVE DEVICE FAILURE exception is sent as a response. - */ -eMBErrorCode eMBRegInputCB( UCHAR * pucRegBuffer, USHORT usAddress, - USHORT usNRegs ); - -/*! \ingroup modbus_registers - * \brief Callback function used if a Holding Register value is - * read or written by the protocol stack. The starting register address - * is given by \c usAddress and the last register is given by - * usAddress + usNRegs - 1. - * - * \param pucRegBuffer If the application registers values should be updated the - * buffer points to the new registers values. If the protocol stack needs - * to now the current values the callback function should write them into - * this buffer. - * \param usAddress The starting address of the register. - * \param usNRegs Number of registers to read or write. - * \param eMode If eMBRegisterMode::MB_REG_WRITE the application register - * values should be updated from the values in the buffer. For example - * this would be the case when the Modbus master has issued an - * WRITE SINGLE REGISTER command. - * If the value eMBRegisterMode::MB_REG_READ the application should copy - * the current values into the buffer \c pucRegBuffer. - * - * \return The function must return one of the following error codes: - * - eMBErrorCode::MB_ENOERR If no error occurred. In this case a normal - * Modbus response is sent. - * - eMBErrorCode::MB_ENOREG If the application can not supply values - * for registers within this range. In this case a - * ILLEGAL DATA ADDRESS exception frame is sent as a response. - * - eMBErrorCode::MB_ETIMEDOUT If the requested register block is - * currently not available and the application dependent response - * timeout would be violated. In this case a SLAVE DEVICE BUSY - * exception is sent as a response. - * - eMBErrorCode::MB_EIO If an unrecoverable error occurred. In this case - * a SLAVE DEVICE FAILURE exception is sent as a response. - */ -eMBErrorCode eMBRegHoldingCB( UCHAR * pucRegBuffer, USHORT usAddress, - USHORT usNRegs, eMBRegisterMode eMode ); - -/*! \ingroup modbus_registers - * \brief Callback function used if a Coil Register value is - * read or written by the protocol stack. If you are going to use - * this function you might use the functions xMBUtilSetBits( ) and - * xMBUtilGetBits( ) for working with bitfields. - * - * \param pucRegBuffer The bits are packed in bytes where the first coil - * starting at address \c usAddress is stored in the LSB of the - * first byte in the buffer pucRegBuffer. - * If the buffer should be written by the callback function unused - * coil values (I.e. if not a multiple of eight coils is used) should be set - * to zero. - * \param usAddress The first coil number. - * \param usNCoils Number of coil values requested. - * \param eMode If eMBRegisterMode::MB_REG_WRITE the application values should - * be updated from the values supplied in the buffer \c pucRegBuffer. - * If eMBRegisterMode::MB_REG_READ the application should store the current - * values in the buffer \c pucRegBuffer. - * - * \return The function must return one of the following error codes: - * - eMBErrorCode::MB_ENOERR If no error occurred. In this case a normal - * Modbus response is sent. - * - eMBErrorCode::MB_ENOREG If the application does not map an coils - * within the requested address range. In this case a - * ILLEGAL DATA ADDRESS is sent as a response. - * - eMBErrorCode::MB_ETIMEDOUT If the requested register block is - * currently not available and the application dependent response - * timeout would be violated. In this case a SLAVE DEVICE BUSY - * exception is sent as a response. - * - eMBErrorCode::MB_EIO If an unrecoverable error occurred. In this case - * a SLAVE DEVICE FAILURE exception is sent as a response. - */ -eMBErrorCode eMBRegCoilsCB( UCHAR * pucRegBuffer, USHORT usAddress, - USHORT usNCoils, eMBRegisterMode eMode ); - -/*! \ingroup modbus_registers - * \brief Callback function used if a Input Discrete Register value is - * read by the protocol stack. - * - * If you are going to use his function you might use the functions - * xMBUtilSetBits( ) and xMBUtilGetBits( ) for working with bitfields. - * - * \param pucRegBuffer The buffer should be updated with the current - * coil values. The first discrete input starting at \c usAddress must be - * stored at the LSB of the first byte in the buffer. If the requested number - * is not a multiple of eight the remaining bits should be set to zero. - * \param usAddress The starting address of the first discrete input. - * \param usNDiscrete Number of discrete input values. - * \return The function must return one of the following error codes: - * - eMBErrorCode::MB_ENOERR If no error occurred. In this case a normal - * Modbus response is sent. - * - eMBErrorCode::MB_ENOREG If no such discrete inputs exists. - * In this case a ILLEGAL DATA ADDRESS exception frame is sent - * as a response. - * - eMBErrorCode::MB_ETIMEDOUT If the requested register block is - * currently not available and the application dependent response - * timeout would be violated. In this case a SLAVE DEVICE BUSY - * exception is sent as a response. - * - eMBErrorCode::MB_EIO If an unrecoverable error occurred. In this case - * a SLAVE DEVICE FAILURE exception is sent as a response. - */ -eMBErrorCode eMBRegDiscreteCB( UCHAR * pucRegBuffer, USHORT usAddress, - USHORT usNDiscrete ); - -#ifdef __cplusplus -PR_END_EXTERN_C -#endif -#endif diff --git a/tools/sdk/include/freemodbus/mbconfig.h b/tools/sdk/include/freemodbus/mbconfig.h deleted file mode 100644 index 54194de26d9..00000000000 --- a/tools/sdk/include/freemodbus/mbconfig.h +++ /dev/null @@ -1,132 +0,0 @@ -/* - * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. - * - * 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. - * - * File: $Id: mbconfig.h,v 1.15 2010/06/06 13:54:40 wolti Exp $ - */ - -#ifndef _MB_CONFIG_H -#define _MB_CONFIG_H - -#ifdef __cplusplus -PR_BEGIN_EXTERN_C -#endif -/* ----------------------- Defines ------------------------------------------*/ -/*! \defgroup modbus_cfg Modbus Configuration - * - * Most modules in the protocol stack are completly optional and can be - * excluded. This is specially important if target resources are very small - * and program memory space should be saved.
- * - * All of these settings are available in the file mbconfig.h - */ -/*! \addtogroup modbus_cfg - * @{ - */ -/*! \brief If Modbus ASCII support is enabled. */ -#define MB_ASCII_ENABLED ( 0 ) - -/*! \brief If Modbus RTU support is enabled. */ -#define MB_RTU_ENABLED ( 1 ) - -/*! \brief If Modbus TCP support is enabled. */ -#define MB_TCP_ENABLED ( 0 ) - -/*! \brief The character timeout value for Modbus ASCII. - * - * The character timeout value is not fixed for Modbus ASCII and is therefore - * a configuration option. It should be set to the maximum expected delay - * time of the network. - */ -#define MB_ASCII_TIMEOUT_SEC ( 1 ) - -/*! \brief Timeout to wait in ASCII prior to enabling transmitter. - * - * If defined the function calls vMBPortSerialDelay with the argument - * MB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS to allow for a delay before - * the serial transmitter is enabled. This is required because some - * targets are so fast that there is no time between receiving and - * transmitting the frame. If the master is to slow with enabling its - * receiver then he will not receive the response correctly. - */ -#ifndef MB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS -#define MB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS ( 0 ) -#endif - -/*! \brief Maximum number of Modbus functions codes the protocol stack - * should support. - * - * The maximum number of supported Modbus functions must be greater than - * the sum of all enabled functions in this file and custom function - * handlers. If set to small adding more functions will fail. - */ -#define MB_FUNC_HANDLERS_MAX ( 16 ) - -/*! \brief Number of bytes which should be allocated for the Report Slave ID - * command. - * - * This number limits the maximum size of the additional segment in the - * report slave id function. See eMBSetSlaveID( ) for more information on - * how to set this value. It is only used if MB_FUNC_OTHER_REP_SLAVEID_ENABLED - * is set to 1. - */ -#define MB_FUNC_OTHER_REP_SLAVEID_BUF ( 32 ) - -/*! \brief If the Report Slave ID function should be enabled. */ -#define MB_FUNC_OTHER_REP_SLAVEID_ENABLED ( CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT ) - -/*! \brief If the Read Input Registers function should be enabled. */ -#define MB_FUNC_READ_INPUT_ENABLED ( 1 ) - -/*! \brief If the Read Holding Registers function should be enabled. */ -#define MB_FUNC_READ_HOLDING_ENABLED ( 1 ) - -/*! \brief If the Write Single Register function should be enabled. */ -#define MB_FUNC_WRITE_HOLDING_ENABLED ( 1 ) - -/*! \brief If the Write Multiple registers function should be enabled. */ -#define MB_FUNC_WRITE_MULTIPLE_HOLDING_ENABLED ( 1 ) - -/*! \brief If the Read Coils function should be enabled. */ -#define MB_FUNC_READ_COILS_ENABLED ( 1 ) - -/*! \brief If the Write Coils function should be enabled. */ -#define MB_FUNC_WRITE_COIL_ENABLED ( 1 ) - -/*! \brief If the Write Multiple Coils function should be enabled. */ -#define MB_FUNC_WRITE_MULTIPLE_COILS_ENABLED ( 1 ) - -/*! \brief If the Read Discrete Inputs function should be enabled. */ -#define MB_FUNC_READ_DISCRETE_INPUTS_ENABLED ( 1 ) - -/*! \brief If the Read/Write Multiple Registers function should be enabled. */ -#define MB_FUNC_READWRITE_HOLDING_ENABLED ( 1 ) - -/*! @} */ -#ifdef __cplusplus -PR_END_EXTERN_C -#endif -#endif diff --git a/tools/sdk/include/freemodbus/mbcontroller.h b/tools/sdk/include/freemodbus/mbcontroller.h deleted file mode 100644 index b6b206e2a68..00000000000 --- a/tools/sdk/include/freemodbus/mbcontroller.h +++ /dev/null @@ -1,186 +0,0 @@ -// 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. - -// mbcontroller.h -// Implementation of the MbController - -#ifndef _MODBUS_CONTROLLER -#define _MODBUS_CONTROLLER - -#include // for standard int types definition -#include // for NULL and std defines -#include "soc/soc.h" // for BITN definitions -#include "sdkconfig.h" // for KConfig options -#include "driver/uart.h" // for uart port number defines - -/* ----------------------- Defines ------------------------------------------*/ -#define MB_INST_MIN_SIZE (2) // The minimal size of Modbus registers area in bytes -#define MB_INST_MAX_SIZE (2048) // The maximum size of Modbus area in bytes - -#define MB_CONTROLLER_STACK_SIZE (CONFIG_MB_CONTROLLER_STACK_SIZE) // Stack size for Modbus controller -#define MB_CONTROLLER_PRIORITY (CONFIG_MB_SERIAL_TASK_PRIO - 1) // priority of MB controller task -#define MB_CONTROLLER_NOTIFY_QUEUE_SIZE (CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE) // Number of messages in parameter notification queue -#define MB_CONTROLLER_NOTIFY_TIMEOUT (pdMS_TO_TICKS(CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT)) // notification timeout - -// Default port defines -#define MB_DEVICE_ADDRESS (1) // Default slave device address in Modbus -#define MB_DEVICE_SPEED (115200) // Default Modbus speed for now hard defined -#define MB_UART_PORT (UART_NUM_2) // Default UART port number -#define MB_PAR_INFO_TOUT (10) // Timeout for get parameter info -#define MB_PARITY_NONE (UART_PARITY_DISABLE) - -/** - * @brief Event group for parameters notification - */ -typedef enum -{ - MB_EVENT_NO_EVENTS = 0x00, - MB_EVENT_HOLDING_REG_WR = BIT0, /*!< Modbus Event Write Holding registers. */ - MB_EVENT_HOLDING_REG_RD = BIT1, /*!< Modbus Event Read Holding registers. */ - MB_EVENT_INPUT_REG_RD = BIT3, /*!< Modbus Event Read Input registers. */ - MB_EVENT_COILS_WR = BIT4, /*!< Modbus Event Write Coils. */ - MB_EVENT_COILS_RD = BIT5, /*!< Modbus Event Read Coils. */ - MB_EVENT_DISCRETE_RD = BIT6, /*!< Modbus Event Read Discrete bits. */ - MB_EVENT_STACK_STARTED = BIT7 /*!< Modbus Event Stack started */ -} mb_event_group_t; - -/** - * @brief Type of Modbus parameter - */ -typedef enum -{ - MB_PARAM_HOLDING, /*!< Modbus Holding register. */ - MB_PARAM_INPUT, /*!< Modbus Input register. */ - MB_PARAM_COIL, /*!< Modbus Coils. */ - MB_PARAM_DISCRETE, /*!< Modbus Discrete bits. */ - MB_PARAM_COUNT, - MB_PARAM_UNKNOWN = 0xFF -} mb_param_type_t; - -/*! - * \brief Modbus serial transmission modes (RTU/ASCII). - */ -typedef enum -{ - MB_MODE_RTU, /*!< RTU transmission mode. */ - MB_MODE_ASCII, /*!< ASCII transmission mode. */ - MB_MODE_TCP /*!< TCP mode. */ -} mb_mode_type_t; - -/** - * @brief Parameter access event information type - */ -typedef struct { - uint32_t time_stamp; /*!< Timestamp of Modbus Event (uS)*/ - uint16_t mb_offset; /*!< Modbus register offset */ - mb_event_group_t type; /*!< Modbus event type */ - uint8_t* address; /*!< Modbus data storage address */ - size_t size; /*!< Modbus event register size (number of registers)*/ -} mb_param_info_t; - -/** - * @brief Parameter storage area descriptor - */ -typedef struct { - uint16_t start_offset; /*!< Modbus start address for area descriptor */ - mb_param_type_t type; /*!< Type of storage area descriptor */ - void* address; /*!< Instance address for storage area descriptor */ - size_t size; /*!< Instance size for area descriptor (bytes) */ -} mb_register_area_descriptor_t; - -/** - * @brief Device communication parameters - */ -typedef struct { - mb_mode_type_t mode; /*!< Modbus communication mode */ - uint8_t slave_addr; /*!< Modbus Slave Address */ - uart_port_t port; /*!< Modbus communication port (UART) number */ - uint32_t baudrate; /*!< Modbus baudrate */ - uart_parity_t parity; /*!< Modbus UART parity settings */ -} mb_communication_info_t; - -/** - * @brief Initialize modbus controller and stack - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t mbcontroller_init(void); - -/** - * @brief Destroy Modbus controller and stack - * - * @return - * - ESP_OK Success - * - ESP_FAIL Parameter error - */ -esp_err_t mbcontroller_destroy(void); - -/** - * @brief Start Modbus communication stack - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Modbus stack start error - */ -esp_err_t mbcontroller_start(void); - -/** - * @brief Set Modbus communication parameters for the controller - * - * @param comm_info Communication parameters structure. - * - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG Incorrect parameter data - */ -esp_err_t mbcontroller_setup(mb_communication_info_t comm_info); - -/** - * @brief Wait for specific event on parameter change. - * - * @param group Group event bit mask to wait for change - * - * @return - * - mb_event_group_t event bits triggered - */ -mb_event_group_t mbcontroller_check_event(mb_event_group_t group); - -/** - * @brief Get parameter information - * - * @param[out] reg_info parameter info structure - * @param timeout Timeout in milliseconds to read information from - * parameter queue - * @return - * - ESP_OK Success - * - ESP_ERR_TIMEOUT Can not get data from parameter queue - * or queue overflow - */ -esp_err_t mbcontroller_get_param_info(mb_param_info_t* reg_info, uint32_t timeout); - -/** - * @brief Set Modbus area descriptor - * - * @param descr_data Modbus registers area descriptor structure - * - * @return - * - ESP_OK: The appropriate descriptor is set - * - ESP_ERR_INVALID_ARG: The argument is incorrect - */ -esp_err_t mbcontroller_set_descriptor(mb_register_area_descriptor_t descr_data); - -#endif - diff --git a/tools/sdk/include/freemodbus/mbframe.h b/tools/sdk/include/freemodbus/mbframe.h deleted file mode 100644 index 99d59c613e3..00000000000 --- a/tools/sdk/include/freemodbus/mbframe.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. - * - * 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. - * - * File: $Id: mbframe.h,v 1.9 2006/12/07 22:10:34 wolti Exp $ - */ - -#ifndef _MB_FRAME_H -#define _MB_FRAME_H - -#ifdef __cplusplus -PR_BEGIN_EXTERN_C -#endif - -/*! - * Constants which defines the format of a modbus frame. The example is - * shown for a Modbus RTU/ASCII frame. Note that the Modbus PDU is not - * dependent on the underlying transport. - * - * - * <------------------------ MODBUS SERIAL LINE PDU (1) -------------------> - * <----------- MODBUS PDU (1') ----------------> - * +-----------+---------------+----------------------------+-------------+ - * | Address | Function Code | Data | CRC/LRC | - * +-----------+---------------+----------------------------+-------------+ - * | | | | - * (2) (3/2') (3') (4) - * - * (1) ... MB_SER_PDU_SIZE_MAX = 256 - * (2) ... MB_SER_PDU_ADDR_OFF = 0 - * (3) ... MB_SER_PDU_PDU_OFF = 1 - * (4) ... MB_SER_PDU_SIZE_CRC = 2 - * - * (1') ... MB_PDU_SIZE_MAX = 253 - * (2') ... MB_PDU_FUNC_OFF = 0 - * (3') ... MB_PDU_DATA_OFF = 1 - * - */ - -/* ----------------------- Defines ------------------------------------------*/ -#define MB_PDU_SIZE_MAX 253 /*!< Maximum size of a PDU. */ -#define MB_PDU_SIZE_MIN 1 /*!< Function Code */ -#define MB_PDU_FUNC_OFF 0 /*!< Offset of function code in PDU. */ -#define MB_PDU_DATA_OFF 1 /*!< Offset for response data in PDU. */ - -/* ----------------------- Prototypes 0-------------------------------------*/ -typedef void ( *pvMBFrameStart ) ( void ); - -typedef void ( *pvMBFrameStop ) ( void ); - -typedef eMBErrorCode( *peMBFrameReceive ) ( UCHAR * pucRcvAddress, - UCHAR ** pucFrame, - USHORT * pusLength ); - -typedef eMBErrorCode( *peMBFrameSend ) ( UCHAR slaveAddress, - const UCHAR * pucFrame, - USHORT usLength ); - -typedef void( *pvMBFrameClose ) ( void ); - -#ifdef __cplusplus -PR_END_EXTERN_C -#endif -#endif diff --git a/tools/sdk/include/freemodbus/mbfunc.h b/tools/sdk/include/freemodbus/mbfunc.h deleted file mode 100644 index aea14f75914..00000000000 --- a/tools/sdk/include/freemodbus/mbfunc.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. - * - * 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. - * - * File: $Id: mbfunc.h,v 1.12 2006/12/07 22:10:34 wolti Exp $ - */ - -#ifndef _MB_FUNC_H -#define _MB_FUNC_H - -#ifdef __cplusplus -PR_BEGIN_EXTERN_C -#endif -#if MB_FUNC_OTHER_REP_SLAVEID_BUF > 0 - eMBException eMBFuncReportSlaveID( UCHAR * pucFrame, USHORT * usLen ); -#endif - -#if MB_FUNC_READ_INPUT_ENABLED > 0 -eMBException eMBFuncReadInputRegister( UCHAR * pucFrame, USHORT * usLen ); -#endif - -#if MB_FUNC_READ_HOLDING_ENABLED > 0 -eMBException eMBFuncReadHoldingRegister( UCHAR * pucFrame, USHORT * usLen ); -#endif - -#if MB_FUNC_WRITE_HOLDING_ENABLED > 0 -eMBException eMBFuncWriteHoldingRegister( UCHAR * pucFrame, USHORT * usLen ); -#endif - -#if MB_FUNC_WRITE_MULTIPLE_HOLDING_ENABLED > 0 -eMBException eMBFuncWriteMultipleHoldingRegister( UCHAR * pucFrame, USHORT * usLen ); -#endif - -#if MB_FUNC_READ_COILS_ENABLED > 0 -eMBException eMBFuncReadCoils( UCHAR * pucFrame, USHORT * usLen ); -#endif - -#if MB_FUNC_WRITE_COIL_ENABLED > 0 -eMBException eMBFuncWriteCoil( UCHAR * pucFrame, USHORT * usLen ); -#endif - -#if MB_FUNC_WRITE_MULTIPLE_COILS_ENABLED > 0 -eMBException eMBFuncWriteMultipleCoils( UCHAR * pucFrame, USHORT * usLen ); -#endif - -#if MB_FUNC_READ_DISCRETE_INPUTS_ENABLED > 0 -eMBException eMBFuncReadDiscreteInputs( UCHAR * pucFrame, USHORT * usLen ); -#endif - -#if MB_FUNC_READWRITE_HOLDING_ENABLED > 0 -eMBException eMBFuncReadWriteMultipleHoldingRegister( UCHAR * pucFrame, USHORT * usLen ); -#endif - -#ifdef __cplusplus -PR_END_EXTERN_C -#endif -#endif diff --git a/tools/sdk/include/freemodbus/mbport.h b/tools/sdk/include/freemodbus/mbport.h deleted file mode 100644 index 8d334d0e0b5..00000000000 --- a/tools/sdk/include/freemodbus/mbport.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. - * - * 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. - * - * File: $Id: mbport.h,v 1.19 2010/06/06 13:54:40 wolti Exp $ - */ - -#ifndef _MB_PORT_H -#define _MB_PORT_H - -#ifdef __cplusplus -PR_BEGIN_EXTERN_C -#endif - -/* ----------------------- Type definitions ---------------------------------*/ - -typedef enum -{ - EV_READY, /*!< Startup finished. */ - EV_FRAME_RECEIVED, /*!< Frame received. */ - EV_EXECUTE, /*!< Execute function. */ - EV_FRAME_SENT /*!< Frame sent. */ -} eMBEventType; - -/*! \ingroup modbus - * \brief Parity used for characters in serial mode. - * - * The parity which should be applied to the characters sent over the serial - * link. Please note that this values are actually passed to the porting - * layer and therefore not all parity modes might be available. - */ -typedef enum -{ - MB_PAR_NONE, /*!< No parity. */ - MB_PAR_ODD, /*!< Odd parity. */ - MB_PAR_EVEN /*!< Even parity. */ -} eMBParity; - -/* ----------------------- Supporting functions -----------------------------*/ -BOOL xMBPortEventInit( void ); - -BOOL xMBPortEventPost( eMBEventType eEvent ); - -BOOL xMBPortEventGet( /*@out@ */ eMBEventType * eEvent ); - -/* ----------------------- Serial port functions ----------------------------*/ - -BOOL xMBPortSerialInit( UCHAR ucPort, ULONG ulBaudRate, - UCHAR ucDataBits, eMBParity eParity ); - -void vMBPortClose( void ); - -void xMBPortSerialClose( void ); - -void vMBPortSerialEnable( BOOL xRxEnable, BOOL xTxEnable ); - -BOOL xMBPortSerialGetByte( CHAR * pucByte ); - -BOOL xMBPortSerialPutByte( CHAR ucByte ); - -/* ----------------------- Timers functions ---------------------------------*/ -BOOL xMBPortTimersInit( USHORT usTimeOut50us ); - -void xMBPortTimersClose( void ); - -void vMBPortTimersEnable( void ); - -void vMBPortTimersDisable( void ); - -void vMBPortTimersDelay( USHORT usTimeOutMS ); - -/* ----------------------- Callback for the protocol stack ------------------*/ -/*! - * \brief Callback function for the porting layer when a new byte is - * available. - * - * Depending upon the mode this callback function is used by the RTU or - * ASCII transmission layers. In any case a call to xMBPortSerialGetByte() - * must immediately return a new character. - * - * \return TRUE if a event was posted to the queue because - * a new byte was received. The port implementation should wake up the - * tasks which are currently blocked on the eventqueue. - */ -extern BOOL( *pxMBFrameCBByteReceived ) ( void ); - -extern BOOL( *pxMBFrameCBTransmitterEmpty ) ( void ); - -extern BOOL( *pxMBPortCBTimerExpired ) ( void ); - -/* ----------------------- TCP port functions -------------------------------*/ -#if MB_TCP_ENABLED == 1 -BOOL xMBTCPPortInit( USHORT usTCPPort ); - -void vMBTCPPortClose( void ); - -void vMBTCPPortDisable( void ); - -BOOL xMBTCPPortGetRequest( UCHAR **ppucMBTCPFrame, USHORT * usTCPLength ); - -BOOL xMBTCPPortSendResponse( const UCHAR *pucMBTCPFrame, USHORT usTCPLength ); -#endif - -#ifdef __cplusplus -PR_END_EXTERN_C -#endif -#endif diff --git a/tools/sdk/include/freemodbus/mbproto.h b/tools/sdk/include/freemodbus/mbproto.h deleted file mode 100644 index 786aaf4030d..00000000000 --- a/tools/sdk/include/freemodbus/mbproto.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. - * - * 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. - * - * File: $Id: mbproto.h,v 1.14 2006/12/07 22:10:34 wolti Exp $ - */ - -#ifndef _MB_PROTO_H -#define _MB_PROTO_H - -#ifdef __cplusplus -PR_BEGIN_EXTERN_C -#endif -/* ----------------------- Defines ------------------------------------------*/ -#define MB_ADDRESS_BROADCAST ( 0 ) /*! Modbus broadcast address. */ -#define MB_ADDRESS_MIN ( 1 ) /*! Smallest possible slave address. */ -#define MB_ADDRESS_MAX ( 247 ) /*! Biggest possible slave address. */ -#define MB_FUNC_NONE ( 0 ) -#define MB_FUNC_READ_COILS ( 1 ) -#define MB_FUNC_READ_DISCRETE_INPUTS ( 2 ) -#define MB_FUNC_WRITE_SINGLE_COIL ( 5 ) -#define MB_FUNC_WRITE_MULTIPLE_COILS ( 15 ) -#define MB_FUNC_READ_HOLDING_REGISTER ( 3 ) -#define MB_FUNC_READ_INPUT_REGISTER ( 4 ) -#define MB_FUNC_WRITE_REGISTER ( 6 ) -#define MB_FUNC_WRITE_MULTIPLE_REGISTERS ( 16 ) -#define MB_FUNC_READWRITE_MULTIPLE_REGISTERS ( 23 ) -#define MB_FUNC_DIAG_READ_EXCEPTION ( 7 ) -#define MB_FUNC_DIAG_DIAGNOSTIC ( 8 ) -#define MB_FUNC_DIAG_GET_COM_EVENT_CNT ( 11 ) -#define MB_FUNC_DIAG_GET_COM_EVENT_LOG ( 12 ) -#define MB_FUNC_OTHER_REPORT_SLAVEID ( 17 ) -#define MB_FUNC_ERROR ( 128 ) -/* ----------------------- Type definitions ---------------------------------*/ - typedef enum -{ - MB_EX_NONE = 0x00, - MB_EX_ILLEGAL_FUNCTION = 0x01, - MB_EX_ILLEGAL_DATA_ADDRESS = 0x02, - MB_EX_ILLEGAL_DATA_VALUE = 0x03, - MB_EX_SLAVE_DEVICE_FAILURE = 0x04, - MB_EX_ACKNOWLEDGE = 0x05, - MB_EX_SLAVE_BUSY = 0x06, - MB_EX_MEMORY_PARITY_ERROR = 0x08, - MB_EX_GATEWAY_PATH_FAILED = 0x0A, - MB_EX_GATEWAY_TGT_FAILED = 0x0B -} eMBException; - -typedef eMBException( *pxMBFunctionHandler ) ( UCHAR * pucFrame, USHORT * pusLength ); - -typedef struct -{ - UCHAR ucFunctionCode; - pxMBFunctionHandler pxHandler; -} xMBFunctionHandler; - -#ifdef __cplusplus -PR_END_EXTERN_C -#endif -#endif diff --git a/tools/sdk/include/freemodbus/mbutils.h b/tools/sdk/include/freemodbus/mbutils.h deleted file mode 100644 index 61495751d46..00000000000 --- a/tools/sdk/include/freemodbus/mbutils.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. - * - * 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. - * - * File: $Id: mbutils.h,v 1.5 2006/12/07 22:10:34 wolti Exp $ - */ - -#ifndef _MB_UTILS_H -#define _MB_UTILS_H - -#ifdef __cplusplus -PR_BEGIN_EXTERN_C -#endif -/*! \defgroup modbus_utils Utilities - * - * This module contains some utility functions which can be used by - * the application. It includes some special functions for working with - * bitfields backed by a character array buffer. - * - */ -/*! \addtogroup modbus_utils - * @{ - */ -/*! \brief Function to set bits in a byte buffer. - * - * This function allows the efficient use of an array to implement bitfields. - * The array used for storing the bits must always be a multiple of two - * bytes. Up to eight bits can be set or cleared in one operation. - * - * \param ucByteBuf A buffer where the bit values are stored. Must be a - * multiple of 2 bytes. No length checking is performed and if - * usBitOffset / 8 is greater than the size of the buffer memory contents - * is overwritten. - * \param usBitOffset The starting address of the bits to set. The first - * bit has the offset 0. - * \param ucNBits Number of bits to modify. The value must always be smaller - * than 8. - * \param ucValues Thew new values for the bits. The value for the first bit - * starting at usBitOffset is the LSB of the value - * ucValues - * - * \code - * ucBits[2] = {0, 0}; - * - * // Set bit 4 to 1 (read: set 1 bit starting at bit offset 4 to value 1) - * xMBUtilSetBits( ucBits, 4, 1, 1 ); - * - * // Set bit 7 to 1 and bit 8 to 0. - * xMBUtilSetBits( ucBits, 7, 2, 0x01 ); - * - * // Set bits 8 - 11 to 0x05 and bits 12 - 15 to 0x0A; - * xMBUtilSetBits( ucBits, 8, 8, 0x5A); - * \endcode - */ -void xMBUtilSetBits( UCHAR * ucByteBuf, USHORT usBitOffset, - UCHAR ucNBits, UCHAR ucValues ); - -/*! \brief Function to read bits in a byte buffer. - * - * This function is used to extract up bit values from an array. Up to eight - * bit values can be extracted in one step. - * - * \param ucByteBuf A buffer where the bit values are stored. - * \param usBitOffset The starting address of the bits to set. The first - * bit has the offset 0. - * \param ucNBits Number of bits to modify. The value must always be smaller - * than 8. - * - * \code - * UCHAR ucBits[2] = {0, 0}; - * UCHAR ucResult; - * - * // Extract the bits 3 - 10. - * ucResult = xMBUtilGetBits( ucBits, 3, 8 ); - * \endcode - */ -UCHAR xMBUtilGetBits( UCHAR * ucByteBuf, USHORT usBitOffset, - UCHAR ucNBits ); - -/*! @} */ - -#ifdef __cplusplus -PR_END_EXTERN_C -#endif -#endif diff --git a/tools/sdk/include/freertos/freertos/FreeRTOS.h b/tools/sdk/include/freertos/freertos/FreeRTOS.h deleted file mode 100644 index 486d9c329aa..00000000000 --- a/tools/sdk/include/freertos/freertos/FreeRTOS.h +++ /dev/null @@ -1,1053 +0,0 @@ -/* - FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd. - All rights reserved - - VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. - - This file is part of the FreeRTOS distribution. - - FreeRTOS is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License (version 2) as published by the - Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. - - *************************************************************************** - >>! NOTE: The modification to the GPL is included to allow you to !<< - >>! distribute a combined work that includes FreeRTOS without being !<< - >>! obliged to provide the source code for proprietary components !<< - >>! outside of the FreeRTOS kernel. !<< - *************************************************************************** - - FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. Full license text is available on the following - link: http://www.freertos.org/a00114.html - - *************************************************************************** - * * - * FreeRTOS provides completely free yet professionally developed, * - * robust, strictly quality controlled, supported, and cross * - * platform software that is more than just the market leader, it * - * is the industry's de facto standard. * - * * - * Help yourself get started quickly while simultaneously helping * - * to support the FreeRTOS project by purchasing a FreeRTOS * - * tutorial book, reference manual, or both: * - * http://www.FreeRTOS.org/Documentation * - * * - *************************************************************************** - - http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading - the FAQ page "My application does not run, what could be wrong?". Have you - defined configASSERT()? - - http://www.FreeRTOS.org/support - In return for receiving this top quality - embedded software for free we request you assist our global community by - participating in the support forum. - - http://www.FreeRTOS.org/training - Investing in training allows your team to - be as productive as possible as early as possible. Now you can receive - FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers - Ltd, and the world's leading authority on the world's leading RTOS. - - http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, - including FreeRTOS+Trace - an indispensable productivity tool, a DOS - compatible FAT file system, and our tiny thread aware UDP/IP stack. - - http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. - Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. - - http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High - Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS - licenses offer ticketed support, indemnification and commercial middleware. - - http://www.SafeRTOS.com - High Integrity Systems also provide a safety - engineered and independently SIL3 certified version for use in safety and - mission critical applications that require provable dependability. - - 1 tab == 4 spaces! -*/ - -#ifndef INC_FREERTOS_H -#define INC_FREERTOS_H - -/* - * Include the generic headers required for the FreeRTOS port being used. - */ -#include -#include "sys/reent.h" - -/* - * If stdint.h cannot be located then: - * + If using GCC ensure the -nostdint options is *not* being used. - * + Ensure the project's include path includes the directory in which your - * compiler stores stdint.h. - * + Set any compiler options necessary for it to support C99, as technically - * stdint.h is only mandatory with C99 (FreeRTOS does not require C99 in any - * other way). - * + The FreeRTOS download includes a simple stdint.h definition that can be - * used in cases where none is provided by the compiler. The files only - * contains the typedefs required to build FreeRTOS. Read the instructions - * in FreeRTOS/source/stdint.readme for more information. - */ -#include /* READ COMMENT ABOVE. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Application specific configuration options. */ -#include "FreeRTOSConfig.h" - -/* Basic FreeRTOS definitions. */ -#include "projdefs.h" - -/* Definitions specific to the port being used. */ -#include "portable.h" - -/* - * Check all the required application specific macros have been defined. - * These macros are application specific and (as downloaded) are defined - * within FreeRTOSConfig.h. - */ - -#ifndef configMINIMAL_STACK_SIZE - #error Missing definition: configMINIMAL_STACK_SIZE must be defined in FreeRTOSConfig.h. configMINIMAL_STACK_SIZE defines the size (in words) of the stack allocated to the idle task. Refer to the demo project provided for your port for a suitable value. -#endif - -#ifndef configMAX_PRIORITIES - #error Missing definition: configMAX_PRIORITIES must be defined in FreeRTOSConfig.h. See the Configuration section of the FreeRTOS API documentation for details. -#endif - -#ifndef configUSE_PREEMPTION - #error Missing definition: configUSE_PREEMPTION must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details. -#endif - -#ifndef configUSE_IDLE_HOOK - #error Missing definition: configUSE_IDLE_HOOK must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details. -#endif - -#ifndef configUSE_TICK_HOOK - #error Missing definition: configUSE_TICK_HOOK must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details. -#endif - -#ifndef configUSE_CO_ROUTINES - #error Missing definition: configUSE_CO_ROUTINES must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details. -#endif - -#ifndef INCLUDE_vTaskPrioritySet - #error Missing definition: INCLUDE_vTaskPrioritySet must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details. -#endif - -#ifndef INCLUDE_uxTaskPriorityGet - #error Missing definition: INCLUDE_uxTaskPriorityGet must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details. -#endif - -#ifndef INCLUDE_vTaskDelete - #error Missing definition: INCLUDE_vTaskDelete must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details. -#endif - -#ifndef INCLUDE_vTaskSuspend - #error Missing definition: INCLUDE_vTaskSuspend must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details. -#endif - -#ifndef INCLUDE_vTaskDelayUntil - #error Missing definition: INCLUDE_vTaskDelayUntil must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details. -#endif - -#ifndef INCLUDE_vTaskDelay - #error Missing definition: INCLUDE_vTaskDelay must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details. -#endif - -#ifndef configUSE_16_BIT_TICKS - #error Missing definition: configUSE_16_BIT_TICKS must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details. -#endif - -#if configUSE_CO_ROUTINES != 0 - #ifndef configMAX_CO_ROUTINE_PRIORITIES - #error configMAX_CO_ROUTINE_PRIORITIES must be greater than or equal to 1. - #endif -#endif - -#ifndef configMAX_PRIORITIES - #error configMAX_PRIORITIES must be defined to be greater than or equal to 1. -#endif - -#ifndef INCLUDE_xTaskGetIdleTaskHandle - #define INCLUDE_xTaskGetIdleTaskHandle 0 -#endif - -#ifndef INCLUDE_xTimerGetTimerDaemonTaskHandle - #define INCLUDE_xTimerGetTimerDaemonTaskHandle 0 -#endif - -#ifndef INCLUDE_xQueueGetMutexHolder - #define INCLUDE_xQueueGetMutexHolder 0 -#endif - -#ifndef INCLUDE_xSemaphoreGetMutexHolder - #define INCLUDE_xSemaphoreGetMutexHolder INCLUDE_xQueueGetMutexHolder -#endif - -#ifndef INCLUDE_pcTaskGetTaskName - #define INCLUDE_pcTaskGetTaskName 1 -#endif - -#ifndef configUSE_APPLICATION_TASK_TAG - #define configUSE_APPLICATION_TASK_TAG 0 -#endif - -#ifndef INCLUDE_uxTaskGetStackHighWaterMark - #define INCLUDE_uxTaskGetStackHighWaterMark 0 -#endif - -#ifndef INCLUDE_pxTaskGetStackStart - #define INCLUDE_pxTaskGetStackStart 0 -#endif - -#ifndef INCLUDE_eTaskGetState - #define INCLUDE_eTaskGetState 0 -#endif - -#ifndef configUSE_RECURSIVE_MUTEXES - #define configUSE_RECURSIVE_MUTEXES 0 -#endif - -#ifndef configUSE_MUTEXES - #define configUSE_MUTEXES 0 -#endif - -#ifndef configUSE_TIMERS - #define configUSE_TIMERS 0 -#endif - -#ifndef configUSE_COUNTING_SEMAPHORES - #define configUSE_COUNTING_SEMAPHORES 0 -#endif - -#ifndef configUSE_ALTERNATIVE_API - #define configUSE_ALTERNATIVE_API 0 -#endif - -#ifndef portCRITICAL_NESTING_IN_TCB - #define portCRITICAL_NESTING_IN_TCB 0 -#endif - -#ifndef configMAX_TASK_NAME_LEN - #define configMAX_TASK_NAME_LEN 16 -#endif - -#ifndef configIDLE_SHOULD_YIELD - #define configIDLE_SHOULD_YIELD 1 -#endif - -#if configMAX_TASK_NAME_LEN < 1 - #error configMAX_TASK_NAME_LEN must be set to a minimum of 1 in FreeRTOSConfig.h -#endif - -#ifndef INCLUDE_xTaskResumeFromISR - #define INCLUDE_xTaskResumeFromISR 1 -#endif - -#ifndef INCLUDE_xEventGroupSetBitFromISR - #define INCLUDE_xEventGroupSetBitFromISR 0 -#endif - -#ifndef INCLUDE_xTimerPendFunctionCall - #define INCLUDE_xTimerPendFunctionCall 0 -#endif - -#ifndef configASSERT - #define configASSERT( x ) - #define configASSERT_DEFINED 0 -#else - #define configASSERT_DEFINED 1 -#endif - -/* The timers module relies on xTaskGetSchedulerState(). */ -#if configUSE_TIMERS == 1 - - #ifndef configTIMER_TASK_PRIORITY - #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_PRIORITY must also be defined. - #endif /* configTIMER_TASK_PRIORITY */ - - #ifndef configTIMER_QUEUE_LENGTH - #error If configUSE_TIMERS is set to 1 then configTIMER_QUEUE_LENGTH must also be defined. - #endif /* configTIMER_QUEUE_LENGTH */ - - #ifndef configTIMER_TASK_STACK_DEPTH - #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_STACK_DEPTH must also be defined. - #endif /* configTIMER_TASK_STACK_DEPTH */ - -#endif /* configUSE_TIMERS */ - -#ifndef INCLUDE_xTaskGetSchedulerState - #define INCLUDE_xTaskGetSchedulerState 0 -#endif - -#ifndef INCLUDE_xTaskGetCurrentTaskHandle - #define INCLUDE_xTaskGetCurrentTaskHandle 0 -#endif - - -#ifndef portSET_INTERRUPT_MASK_FROM_ISR - #define portSET_INTERRUPT_MASK_FROM_ISR() 0 -#endif - -#ifndef portCLEAR_INTERRUPT_MASK_FROM_ISR - #define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedStatusValue ) ( void ) uxSavedStatusValue -#endif - -#ifndef portCLEAN_UP_TCB - #define portCLEAN_UP_TCB( pxTCB ) ( void ) pxTCB -#endif - -#ifndef portPRE_TASK_DELETE_HOOK - #define portPRE_TASK_DELETE_HOOK( pvTaskToDelete, pxYieldPending ) -#endif - -#ifndef portSETUP_TCB - #define portSETUP_TCB( pxTCB ) ( void ) pxTCB -#endif - -#ifndef configQUEUE_REGISTRY_SIZE - #define configQUEUE_REGISTRY_SIZE 0U -#endif - -#if ( configQUEUE_REGISTRY_SIZE < 1 ) - #define vQueueAddToRegistry( xQueue, pcName ) - #define vQueueUnregisterQueue( xQueue ) -#endif - -#ifndef portPOINTER_SIZE_TYPE - #define portPOINTER_SIZE_TYPE uint32_t -#endif - -/* Remove any unused trace macros. */ -#ifndef traceSTART - /* Used to perform any necessary initialisation - for example, open a file - into which trace is to be written. */ - #define traceSTART() -#endif - -#ifndef traceEND - /* Use to close a trace, for example close a file into which trace has been - written. */ - #define traceEND() -#endif - -#ifndef traceTASK_SWITCHED_IN - /* Called after a task has been selected to run. pxCurrentTCB holds a pointer - to the task control block of the selected task. */ - #define traceTASK_SWITCHED_IN() -#endif - -#ifndef traceINCREASE_TICK_COUNT - /* Called before stepping the tick count after waking from tickless idle - sleep. */ - #define traceINCREASE_TICK_COUNT( x ) -#endif - -#ifndef traceLOW_POWER_IDLE_BEGIN - /* Called immediately before entering tickless idle. */ - #define traceLOW_POWER_IDLE_BEGIN() -#endif - -#ifndef traceLOW_POWER_IDLE_END - /* Called when returning to the Idle task after a tickless idle. */ - #define traceLOW_POWER_IDLE_END() -#endif - -#ifndef traceTASK_SWITCHED_OUT - /* Called before a task has been selected to run. pxCurrentTCB holds a pointer - to the task control block of the task being switched out. */ - #define traceTASK_SWITCHED_OUT() -#endif - -#ifndef traceTASK_PRIORITY_INHERIT - /* Called when a task attempts to take a mutex that is already held by a - lower priority task. pxTCBOfMutexHolder is a pointer to the TCB of the task - that holds the mutex. uxInheritedPriority is the priority the mutex holder - will inherit (the priority of the task that is attempting to obtain the - muted. */ - #define traceTASK_PRIORITY_INHERIT( pxTCBOfMutexHolder, uxInheritedPriority ) -#endif - -#ifndef traceTASK_PRIORITY_DISINHERIT - /* Called when a task releases a mutex, the holding of which had resulted in - the task inheriting the priority of a higher priority task. - pxTCBOfMutexHolder is a pointer to the TCB of the task that is releasing the - mutex. uxOriginalPriority is the task's configured (base) priority. */ - #define traceTASK_PRIORITY_DISINHERIT( pxTCBOfMutexHolder, uxOriginalPriority ) -#endif - -#ifndef traceBLOCKING_ON_QUEUE_RECEIVE - /* Task is about to block because it cannot read from a - queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore - upon which the read was attempted. pxCurrentTCB points to the TCB of the - task that attempted the read. */ - #define traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue ) -#endif - -#ifndef traceBLOCKING_ON_QUEUE_SEND - /* Task is about to block because it cannot write to a - queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore - upon which the write was attempted. pxCurrentTCB points to the TCB of the - task that attempted the write. */ - #define traceBLOCKING_ON_QUEUE_SEND( pxQueue ) -#endif - -#ifndef configCHECK_FOR_STACK_OVERFLOW - #define configCHECK_FOR_STACK_OVERFLOW 0 -#endif - -/* The following event macros are embedded in the kernel API calls. */ - -#ifndef traceMOVED_TASK_TO_READY_STATE - #define traceMOVED_TASK_TO_READY_STATE( pxTCB ) -#endif - -#ifndef traceREADDED_TASK_TO_READY_STATE - #define traceREADDED_TASK_TO_READY_STATE( pxTCB ) traceMOVED_TASK_TO_READY_STATE( pxTCB ) -#endif - -#ifndef traceMOVED_TASK_TO_DELAYED_LIST - #define traceMOVED_TASK_TO_DELAYED_LIST() -#endif - -#ifndef traceMOVED_TASK_TO_OVERFLOW_DELAYED_LIST - #define traceMOVED_TASK_TO_OVERFLOW_DELAYED_LIST() -#endif - -#ifndef traceMOVED_TASK_TO_SUSPENDED_LIST - #define traceMOVED_TASK_TO_SUSPENDED_LIST( pxTCB ) -#endif - -#ifndef traceQUEUE_CREATE - #define traceQUEUE_CREATE( pxNewQueue ) -#endif - -#ifndef traceQUEUE_CREATE_FAILED - #define traceQUEUE_CREATE_FAILED( ucQueueType ) -#endif - -#ifndef traceCREATE_MUTEX - #define traceCREATE_MUTEX( pxNewQueue ) -#endif - -#ifndef traceCREATE_MUTEX_FAILED - #define traceCREATE_MUTEX_FAILED() -#endif - -#ifndef traceGIVE_MUTEX_RECURSIVE - #define traceGIVE_MUTEX_RECURSIVE( pxMutex ) -#endif - -#ifndef traceGIVE_MUTEX_RECURSIVE_FAILED - #define traceGIVE_MUTEX_RECURSIVE_FAILED( pxMutex ) -#endif - -#ifndef traceTAKE_MUTEX_RECURSIVE - #define traceTAKE_MUTEX_RECURSIVE( pxMutex ) -#endif - -#ifndef traceTAKE_MUTEX_RECURSIVE_FAILED - #define traceTAKE_MUTEX_RECURSIVE_FAILED( pxMutex ) -#endif - -#ifndef traceCREATE_COUNTING_SEMAPHORE - #define traceCREATE_COUNTING_SEMAPHORE() -#endif - -#ifndef traceCREATE_COUNTING_SEMAPHORE_FAILED - #define traceCREATE_COUNTING_SEMAPHORE_FAILED() -#endif - -#ifndef traceQUEUE_SEND - #define traceQUEUE_SEND( pxQueue ) -#endif - -#ifndef traceQUEUE_SEND_FAILED - #define traceQUEUE_SEND_FAILED( pxQueue ) -#endif - -#ifndef traceQUEUE_RECEIVE - #define traceQUEUE_RECEIVE( pxQueue ) -#endif - -#ifndef traceQUEUE_PEEK - #define traceQUEUE_PEEK( pxQueue ) -#endif - -#ifndef traceQUEUE_PEEK_FROM_ISR - #define traceQUEUE_PEEK_FROM_ISR( pxQueue ) -#endif - -#ifndef traceQUEUE_RECEIVE_FAILED - #define traceQUEUE_RECEIVE_FAILED( pxQueue ) -#endif - -#ifndef traceQUEUE_SEND_FROM_ISR - #define traceQUEUE_SEND_FROM_ISR( pxQueue ) -#endif - -#ifndef traceQUEUE_SEND_FROM_ISR_FAILED - #define traceQUEUE_SEND_FROM_ISR_FAILED( pxQueue ) -#endif - -#ifndef traceQUEUE_RECEIVE_FROM_ISR - #define traceQUEUE_RECEIVE_FROM_ISR( pxQueue ) -#endif - -#ifndef traceQUEUE_RECEIVE_FROM_ISR_FAILED - #define traceQUEUE_RECEIVE_FROM_ISR_FAILED( pxQueue ) -#endif - -#ifndef traceQUEUE_PEEK_FROM_ISR_FAILED - #define traceQUEUE_PEEK_FROM_ISR_FAILED( pxQueue ) -#endif - -#ifndef traceQUEUE_DELETE - #define traceQUEUE_DELETE( pxQueue ) -#endif - -#ifndef traceTASK_CREATE - #define traceTASK_CREATE( pxNewTCB ) -#endif - -#ifndef traceTASK_CREATE_FAILED - #define traceTASK_CREATE_FAILED() -#endif - -#ifndef traceTASK_DELETE - #define traceTASK_DELETE( pxTaskToDelete ) -#endif - -#ifndef traceTASK_DELAY_UNTIL - #define traceTASK_DELAY_UNTIL() -#endif - -#ifndef traceTASK_DELAY - #define traceTASK_DELAY() -#endif - -#ifndef traceTASK_PRIORITY_SET - #define traceTASK_PRIORITY_SET( pxTask, uxNewPriority ) -#endif - -#ifndef traceTASK_SUSPEND - #define traceTASK_SUSPEND( pxTaskToSuspend ) -#endif - -#ifndef traceTASK_RESUME - #define traceTASK_RESUME( pxTaskToResume ) -#endif - -#ifndef traceTASK_RESUME_FROM_ISR - #define traceTASK_RESUME_FROM_ISR( pxTaskToResume ) -#endif - -#ifndef traceTASK_INCREMENT_TICK - #define traceTASK_INCREMENT_TICK( xTickCount ) -#endif - -#ifndef traceTIMER_CREATE - #define traceTIMER_CREATE( pxNewTimer ) -#endif - -#ifndef traceTIMER_CREATE_FAILED - #define traceTIMER_CREATE_FAILED() -#endif - -#ifndef traceTIMER_COMMAND_SEND - #define traceTIMER_COMMAND_SEND( xTimer, xMessageID, xMessageValueValue, xReturn ) -#endif - -#ifndef traceTIMER_EXPIRED - #define traceTIMER_EXPIRED( pxTimer ) -#endif - -#ifndef traceTIMER_COMMAND_RECEIVED - #define traceTIMER_COMMAND_RECEIVED( pxTimer, xMessageID, xMessageValue ) -#endif - -#ifndef traceMALLOC - #define traceMALLOC( pvAddress, uiSize ) -#endif - -#ifndef traceFREE - #define traceFREE( pvAddress, uiSize ) -#endif - -#ifndef traceEVENT_GROUP_CREATE - #define traceEVENT_GROUP_CREATE( xEventGroup ) -#endif - -#ifndef traceEVENT_GROUP_CREATE_FAILED - #define traceEVENT_GROUP_CREATE_FAILED() -#endif - -#ifndef traceEVENT_GROUP_SYNC_BLOCK - #define traceEVENT_GROUP_SYNC_BLOCK( xEventGroup, uxBitsToSet, uxBitsToWaitFor ) -#endif - -#ifndef traceEVENT_GROUP_SYNC_END - #define traceEVENT_GROUP_SYNC_END( xEventGroup, uxBitsToSet, uxBitsToWaitFor, xTimeoutOccurred ) ( void ) xTimeoutOccurred -#endif - -#ifndef traceEVENT_GROUP_WAIT_BITS_BLOCK - #define traceEVENT_GROUP_WAIT_BITS_BLOCK( xEventGroup, uxBitsToWaitFor ) -#endif - -#ifndef traceEVENT_GROUP_WAIT_BITS_END - #define traceEVENT_GROUP_WAIT_BITS_END( xEventGroup, uxBitsToWaitFor, xTimeoutOccurred ) ( void ) xTimeoutOccurred -#endif - -#ifndef traceEVENT_GROUP_CLEAR_BITS - #define traceEVENT_GROUP_CLEAR_BITS( xEventGroup, uxBitsToClear ) -#endif - -#ifndef traceEVENT_GROUP_CLEAR_BITS_FROM_ISR - #define traceEVENT_GROUP_CLEAR_BITS_FROM_ISR( xEventGroup, uxBitsToClear ) -#endif - -#ifndef traceEVENT_GROUP_SET_BITS - #define traceEVENT_GROUP_SET_BITS( xEventGroup, uxBitsToSet ) -#endif - -#ifndef traceEVENT_GROUP_SET_BITS_FROM_ISR - #define traceEVENT_GROUP_SET_BITS_FROM_ISR( xEventGroup, uxBitsToSet ) -#endif - -#ifndef traceEVENT_GROUP_DELETE - #define traceEVENT_GROUP_DELETE( xEventGroup ) -#endif - -#ifndef tracePEND_FUNC_CALL - #define tracePEND_FUNC_CALL(xFunctionToPend, pvParameter1, ulParameter2, ret) -#endif - -#ifndef tracePEND_FUNC_CALL_FROM_ISR - #define tracePEND_FUNC_CALL_FROM_ISR(xFunctionToPend, pvParameter1, ulParameter2, ret) -#endif - -#ifndef traceQUEUE_REGISTRY_ADD - #define traceQUEUE_REGISTRY_ADD(xQueue, pcQueueName) -#endif - -#ifndef traceTASK_NOTIFY_GIVE_FROM_ISR - #define traceTASK_NOTIFY_GIVE_FROM_ISR() - #endif - -#ifndef traceISR_EXIT_TO_SCHEDULER - #define traceISR_EXIT_TO_SCHEDULER() -#endif - -#ifndef traceISR_EXIT - #define traceISR_EXIT() -#endif - -#ifndef traceISR_ENTER - #define traceISR_ENTER(_n_) -#endif - -#ifndef configGENERATE_RUN_TIME_STATS - #define configGENERATE_RUN_TIME_STATS 0 -#endif - -#if ( configGENERATE_RUN_TIME_STATS == 1 ) - - #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS - #error If configGENERATE_RUN_TIME_STATS is defined then portCONFIGURE_TIMER_FOR_RUN_TIME_STATS must also be defined. portCONFIGURE_TIMER_FOR_RUN_TIME_STATS should call a port layer function to setup a peripheral timer/counter that can then be used as the run time counter time base. - #endif /* portCONFIGURE_TIMER_FOR_RUN_TIME_STATS */ - - #ifndef portGET_RUN_TIME_COUNTER_VALUE - #ifndef portALT_GET_RUN_TIME_COUNTER_VALUE - #error If configGENERATE_RUN_TIME_STATS is defined then either portGET_RUN_TIME_COUNTER_VALUE or portALT_GET_RUN_TIME_COUNTER_VALUE must also be defined. See the examples provided and the FreeRTOS web site for more information. - #endif /* portALT_GET_RUN_TIME_COUNTER_VALUE */ - #endif /* portGET_RUN_TIME_COUNTER_VALUE */ - -#endif /* configGENERATE_RUN_TIME_STATS */ - -#ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS - #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() -#endif - -#ifndef configUSE_MALLOC_FAILED_HOOK - #define configUSE_MALLOC_FAILED_HOOK 0 -#endif - -#ifndef portPRIVILEGE_BIT - #define portPRIVILEGE_BIT ( ( UBaseType_t ) 0x00 ) -#endif - -#ifndef portYIELD_WITHIN_API - #define portYIELD_WITHIN_API portYIELD -#endif - -#ifndef pvPortMallocAligned - #define pvPortMallocAligned( x, puxStackBuffer ) ( ( ( puxStackBuffer ) == NULL ) ? ( pvPortMalloc( ( x ) ) ) : ( puxStackBuffer ) ) -#endif - -#ifndef vPortFreeAligned - #define vPortFreeAligned( pvBlockToFree ) vPortFree( pvBlockToFree ) -#endif - -#ifndef portSUPPRESS_TICKS_AND_SLEEP - #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) -#endif - -#ifndef configEXPECTED_IDLE_TIME_BEFORE_SLEEP - #define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 2 -#endif - -#if configEXPECTED_IDLE_TIME_BEFORE_SLEEP < 2 - #error configEXPECTED_IDLE_TIME_BEFORE_SLEEP must not be less than 2 -#endif - -#ifndef configUSE_TICKLESS_IDLE - #define configUSE_TICKLESS_IDLE 0 -#endif - -#ifndef configPRE_SLEEP_PROCESSING - #define configPRE_SLEEP_PROCESSING( x ) -#endif - -#ifndef configPOST_SLEEP_PROCESSING - #define configPOST_SLEEP_PROCESSING( x ) -#endif - -#ifndef configUSE_QUEUE_SETS - #define configUSE_QUEUE_SETS 0 -#endif - -#ifndef portTASK_USES_FLOATING_POINT - #define portTASK_USES_FLOATING_POINT() -#endif - -#ifndef configUSE_TIME_SLICING - #define configUSE_TIME_SLICING 1 -#endif - -#ifndef configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS - #define configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS 0 -#endif - -#ifndef configUSE_NEWLIB_REENTRANT - #define configUSE_NEWLIB_REENTRANT 0 -#endif - -#ifndef configUSE_STATS_FORMATTING_FUNCTIONS - #define configUSE_STATS_FORMATTING_FUNCTIONS 0 -#endif - -#ifndef configTASKLIST_INCLUDE_COREID - #define configTASKLIST_INCLUDE_COREID 0 -#endif - -#ifndef portASSERT_IF_INTERRUPT_PRIORITY_INVALID - #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() -#endif - -#ifndef configUSE_TRACE_FACILITY - #define configUSE_TRACE_FACILITY 0 -#endif - -#ifndef mtCOVERAGE_TEST_MARKER - #define mtCOVERAGE_TEST_MARKER() -#endif - -#ifndef portASSERT_IF_IN_ISR - #define portASSERT_IF_IN_ISR() -#endif - -#ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION - #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 -#endif - -#ifndef configAPPLICATION_ALLOCATED_HEAP - #define configAPPLICATION_ALLOCATED_HEAP 0 -#endif - -#ifndef configUSE_TASK_NOTIFICATIONS - #define configUSE_TASK_NOTIFICATIONS 1 -#endif - -#ifndef portTICK_TYPE_IS_ATOMIC - #define portTICK_TYPE_IS_ATOMIC 0 -#endif - -#ifndef configSUPPORT_STATIC_ALLOCATION - /* Defaults to 0 for backward compatibility. */ - #define configSUPPORT_STATIC_ALLOCATION 0 -#endif - -#ifndef configSUPPORT_DYNAMIC_ALLOCATION - /* Defaults to 1 for backward compatibility. */ - #define configSUPPORT_DYNAMIC_ALLOCATION 1 -#endif - -#if( ( configSUPPORT_STATIC_ALLOCATION == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) ) - #error configSUPPORT_STATIC_ALLOCATION and configSUPPORT_DYNAMIC_ALLOCATION cannot both be 0, but can both be 1. -#endif - -#if( portTICK_TYPE_IS_ATOMIC == 0 ) - /* Either variables of tick type cannot be read atomically, or - portTICK_TYPE_IS_ATOMIC was not set - map the critical sections used when - the tick count is returned to the standard critical section macros. */ - #define portTICK_TYPE_ENTER_CRITICAL(mux) portENTER_CRITICAL(mux) - #define portTICK_TYPE_EXIT_CRITICAL(mux) portEXIT_CRITICAL(mux) - #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR() - #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( ( x ) ) -#else - /* The tick type can be read atomically, so critical sections used when the - tick count is returned can be defined away. */ - #define portTICK_TYPE_ENTER_CRITICAL() - #define portTICK_TYPE_EXIT_CRITICAL() - #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() 0 - #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) ( void ) x -#endif - -/* Definitions to allow backward compatibility with FreeRTOS versions prior to -V8 if desired. */ -#ifndef configENABLE_BACKWARD_COMPATIBILITY - #define configENABLE_BACKWARD_COMPATIBILITY 1 -#endif - -#if configENABLE_BACKWARD_COMPATIBILITY == 1 - #define eTaskStateGet eTaskGetState - #define portTickType TickType_t - #define xTaskHandle TaskHandle_t - #define xQueueHandle QueueHandle_t - #define xSemaphoreHandle SemaphoreHandle_t - #define xQueueSetHandle QueueSetHandle_t - #define xQueueSetMemberHandle QueueSetMemberHandle_t - #define xTimeOutType TimeOut_t - #define xMemoryRegion MemoryRegion_t - #define xTaskParameters TaskParameters_t - #define xTaskStatusType TaskStatus_t - #define xTimerHandle TimerHandle_t - #define xCoRoutineHandle CoRoutineHandle_t - #define pdTASK_HOOK_CODE TaskHookFunction_t - #define portTICK_RATE_MS portTICK_PERIOD_MS - - /* Backward compatibility within the scheduler code only - these definitions - are not really required but are included for completeness. */ - #define tmrTIMER_CALLBACK TimerCallbackFunction_t - #define pdTASK_CODE TaskFunction_t - #define xListItem ListItem_t - #define xList List_t -#endif /* configENABLE_BACKWARD_COMPATIBILITY */ - -#ifndef configESP32_PER_TASK_DATA - #define configESP32_PER_TASK_DATA 1 -#endif - -/* - * In line with software engineering best practice, FreeRTOS implements a strict - * data hiding policy, so the real structures used by FreeRTOS to maintain the - * state of tasks, queues, semaphores, etc. are not accessible to the application - * code. However, if the application writer wants to statically allocate such - * an object then the size of the object needs to be know. Dummy structures - * that are guaranteed to have the same size and alignment requirements of the - * real objects are used for this purpose. The dummy list and list item - * structures below are used for inclusion in such a dummy structure. - */ -struct xSTATIC_LIST_ITEM -{ - TickType_t xDummy1; - void *pvDummy2[ 4 ]; -}; -typedef struct xSTATIC_LIST_ITEM StaticListItem_t; - -/* See the comments above the struct xSTATIC_LIST_ITEM definition. */ -struct xSTATIC_MINI_LIST_ITEM -{ - TickType_t xDummy1; - void *pvDummy2[ 2 ]; -}; -typedef struct xSTATIC_MINI_LIST_ITEM StaticMiniListItem_t; - -/* See the comments above the struct xSTATIC_LIST_ITEM definition. */ -typedef struct xSTATIC_LIST -{ - UBaseType_t uxDummy1; - void *pvDummy2; - StaticMiniListItem_t xDummy3; -} StaticList_t; - -/* - * In line with software engineering best practice, especially when supplying a - * library that is likely to change in future versions, FreeRTOS implements a - * strict data hiding policy. This means the Task structure used internally by - * FreeRTOS is not accessible to application code. However, if the application - * writer wants to statically allocate the memory required to create a task then - * the size of the task object needs to be know. The StaticTask_t structure - * below is provided for this purpose. Its sizes and alignment requirements are - * guaranteed to match those of the genuine structure, no matter which - * architecture is being used, and no matter how the values in FreeRTOSConfig.h - * are set. Its contents are somewhat obfuscated in the hope users will - * recognise that it would be unwise to make direct use of the structure members. - */ -typedef struct xSTATIC_TCB -{ - void *pxDummy1; - #if ( portUSING_MPU_WRAPPERS == 1 ) - xMPU_SETTINGS xDummy2; - #endif - StaticListItem_t xDummy3[ 2 ]; - UBaseType_t uxDummy5; - void *pxDummy6; - uint8_t ucDummy7[ configMAX_TASK_NAME_LEN ]; - UBaseType_t uxDummyCoreId; - #if ( portSTACK_GROWTH > 0 || configENABLE_TASK_SNAPSHOT == 1 ) - void *pxDummy8; - #endif - #if ( portCRITICAL_NESTING_IN_TCB == 1 ) - UBaseType_t uxDummy9; - uint32_t OldInterruptState; - #endif - #if ( configUSE_TRACE_FACILITY == 1 ) - UBaseType_t uxDummy10[ 2 ]; - #endif - #if ( configUSE_MUTEXES == 1 ) - UBaseType_t uxDummy12[ 2 ]; - #endif - #if ( configUSE_APPLICATION_TASK_TAG == 1 ) - void *pxDummy14; - #endif - #if( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 ) - void *pvDummy15[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ]; - #if ( configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS ) - void *pvDummyLocalStorageCallBack[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ]; - #endif - #endif - #if ( configGENERATE_RUN_TIME_STATS == 1 ) - uint32_t ulDummy16; - #endif - #if ( configUSE_NEWLIB_REENTRANT == 1 ) - struct _reent xDummy17; - #endif - #if ( configUSE_TASK_NOTIFICATIONS == 1 ) - uint32_t ulDummy18; - uint32_t ucDummy19; - #endif - #if( ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) \ - || ( portUSING_MPU_WRAPPERS == 1 ) ) - uint8_t uxDummy20; - #endif - -} StaticTask_t; - -/* - * In line with software engineering best practice, especially when supplying a - * library that is likely to change in future versions, FreeRTOS implements a - * strict data hiding policy. This means the Queue structure used internally by - * FreeRTOS is not accessible to application code. However, if the application - * writer wants to statically allocate the memory required to create a queue - * then the size of the queue object needs to be know. The StaticQueue_t - * structure below is provided for this purpose. Its sizes and alignment - * requirements are guaranteed to match those of the genuine structure, no - * matter which architecture is being used, and no matter how the values in - * FreeRTOSConfig.h are set. Its contents are somewhat obfuscated in the hope - * users will recognise that it would be unwise to make direct use of the - * structure members. - */ -typedef struct xSTATIC_QUEUE -{ - void *pvDummy1[ 3 ]; - - union - { - void *pvDummy2; - UBaseType_t uxDummy2; - } u; - - StaticList_t xDummy3[ 2 ]; - UBaseType_t uxDummy4[ 3 ]; - - #if( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) - uint8_t ucDummy6; - #endif - - #if ( configUSE_QUEUE_SETS == 1 ) - void *pvDummy7; - #endif - - #if ( configUSE_TRACE_FACILITY == 1 ) - UBaseType_t uxDummy8; - uint8_t ucDummy9; - #endif - - portMUX_TYPE muxDummy; //Mutex required due to SMP - -} StaticQueue_t; -typedef StaticQueue_t StaticSemaphore_t; - -/* - * In line with software engineering best practice, especially when supplying a - * library that is likely to change in future versions, FreeRTOS implements a - * strict data hiding policy. This means the event group structure used - * internally by FreeRTOS is not accessible to application code. However, if - * the application writer wants to statically allocate the memory required to - * create an event group then the size of the event group object needs to be - * know. The StaticEventGroup_t structure below is provided for this purpose. - * Its sizes and alignment requirements are guaranteed to match those of the - * genuine structure, no matter which architecture is being used, and no matter - * how the values in FreeRTOSConfig.h are set. Its contents are somewhat - * obfuscated in the hope users will recognise that it would be unwise to make - * direct use of the structure members. - */ -typedef struct xSTATIC_EVENT_GROUP -{ - TickType_t xDummy1; - StaticList_t xDummy2; - - #if( configUSE_TRACE_FACILITY == 1 ) - UBaseType_t uxDummy3; - #endif - - #if( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) - uint8_t ucDummy4; - #endif - - portMUX_TYPE muxDummy; //Mutex required due to SMP - -} StaticEventGroup_t; - -/* - * In line with software engineering best practice, especially when supplying a - * library that is likely to change in future versions, FreeRTOS implements a - * strict data hiding policy. This means the software timer structure used - * internally by FreeRTOS is not accessible to application code. However, if - * the application writer wants to statically allocate the memory required to - * create a software timer then the size of the queue object needs to be know. - * The StaticTimer_t structure below is provided for this purpose. Its sizes - * and alignment requirements are guaranteed to match those of the genuine - * structure, no matter which architecture is being used, and no matter how the - * values in FreeRTOSConfig.h are set. Its contents are somewhat obfuscated in - * the hope users will recognise that it would be unwise to make direct use of - * the structure members. - */ -typedef struct xSTATIC_TIMER -{ - void *pvDummy1; - StaticListItem_t xDummy2; - TickType_t xDummy3; - UBaseType_t uxDummy4; - void *pvDummy5[ 2 ]; - #if( configUSE_TRACE_FACILITY == 1 ) - UBaseType_t uxDummy6; - #endif - - #if( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) - uint8_t ucDummy7; - #endif - -} StaticTimer_t; - -#ifdef __cplusplus -} -#endif - -#endif /* INC_FREERTOS_H */ - diff --git a/tools/sdk/include/freertos/freertos/FreeRTOSConfig.h b/tools/sdk/include/freertos/freertos/FreeRTOSConfig.h deleted file mode 100644 index aa33917e2c0..00000000000 --- a/tools/sdk/include/freertos/freertos/FreeRTOSConfig.h +++ /dev/null @@ -1,313 +0,0 @@ -/* - FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd. - All rights reserved - - VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. - - This file is part of the FreeRTOS distribution. - - FreeRTOS is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License (version 2) as published by the - Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. - - *************************************************************************** - >>! NOTE: The modification to the GPL is included to allow you to !<< - >>! distribute a combined work that includes FreeRTOS without being !<< - >>! obliged to provide the source code for proprietary components !<< - >>! outside of the FreeRTOS kernel. !<< - *************************************************************************** - - FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. Full license text is available on the following - link: http://www.freertos.org/a00114.html - - *************************************************************************** - * * - * FreeRTOS provides completely free yet professionally developed, * - * robust, strictly quality controlled, supported, and cross * - * platform software that is more than just the market leader, it * - * is the industry's de facto standard. * - * * - * Help yourself get started quickly while simultaneously helping * - * to support the FreeRTOS project by purchasing a FreeRTOS * - * tutorial book, reference manual, or both: * - * http://www.FreeRTOS.org/Documentation * - * * - *************************************************************************** - - http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading - the FAQ page "My application does not run, what could be wrong?". Have you - defined configASSERT()? - - http://www.FreeRTOS.org/support - In return for receiving this top quality - embedded software for free we request you assist our global community by - participating in the support forum. - - http://www.FreeRTOS.org/training - Investing in training allows your team to - be as productive as possible as early as possible. Now you can receive - FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers - Ltd, and the world's leading authority on the world's leading RTOS. - - http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, - including FreeRTOS+Trace - an indispensable productivity tool, a DOS - compatible FAT file system, and our tiny thread aware UDP/IP stack. - - http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. - Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. - - http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High - Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS - licenses offer ticketed support, indemnification and commercial middleware. - - http://www.SafeRTOS.com - High Integrity Systems also provide a safety - engineered and independently SIL3 certified version for use in safety and - mission critical applications that require provable dependability. - - 1 tab == 4 spaces! -*/ - -#ifndef FREERTOS_CONFIG_H -#define FREERTOS_CONFIG_H - -#include "sdkconfig.h" - - -/* ESP31 and ESP32 are dualcore processors. */ -#ifndef CONFIG_FREERTOS_UNICORE -#define portNUM_PROCESSORS 2 -#else -#define portNUM_PROCESSORS 1 -#endif - -#define XT_USE_THREAD_SAFE_CLIB 0 -#define configASSERT_2 0 -#define portUSING_MPU_WRAPPERS 0 -#define configUSE_MUTEX 1 -#undef XT_USE_SWPRI - -#if CONFIG_FREERTOS_CORETIMER_0 -#define XT_TIMER_INDEX 0 -#elif CONFIG_FREERTOS_CORETIMER_1 -#define XT_TIMER_INDEX 1 -#endif - -#define configNUM_THREAD_LOCAL_STORAGE_POINTERS CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS -#define configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS 1 - -#ifndef __ASSEMBLER__ - -/** - * This function is defined to provide a deprecation warning whenever - * XT_CLOCK_FREQ macro is used. - * Update the code to use esp_clk_cpu_freq function instead. - * @return current CPU clock frequency, in Hz - */ -int xt_clock_freq(void) __attribute__((deprecated)); - -#define XT_CLOCK_FREQ (xt_clock_freq()) - -#endif // __ASSEMBLER__ - - -/* Required for configuration-dependent settings */ -#include "xtensa_config.h" - - -/* configASSERT behaviour */ -#ifndef __ASSEMBLER__ -#include /* for abort() */ -#include "rom/ets_sys.h" - -#if defined(CONFIG_FREERTOS_ASSERT_DISABLE) -#define configASSERT(a) /* assertions disabled */ -#elif defined(CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE) -#define configASSERT(a) if (!(a)) { \ - ets_printf("%s:%d (%s)- assert failed!\n", __FILE__, __LINE__, \ - __FUNCTION__); \ - } -#else /* CONFIG_FREERTOS_ASSERT_FAIL_ABORT */ -#define configASSERT(a) if (!(a)) { \ - ets_printf("%s:%d (%s)- assert failed!\n", __FILE__, __LINE__, \ - __FUNCTION__); \ - abort(); \ - } -#endif - -#if CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION -#define UNTESTED_FUNCTION() { ets_printf("Untested FreeRTOS function %s\r\n", __FUNCTION__); configASSERT(false); } while(0) -#else -#define UNTESTED_FUNCTION() -#endif - - -#endif /* def __ASSEMBLER__ */ - - -/*----------------------------------------------------------- - * Application specific definitions. - * - * These definitions should be adjusted for your particular hardware and - * application requirements. - * - * Note that the default heap size is deliberately kept small so that - * the build is more likely to succeed for configurations with limited - * memory. - * - * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. - *----------------------------------------------------------*/ - -#define configUSE_PREEMPTION 1 -#define configUSE_IDLE_HOOK 1 -#define configUSE_TICK_HOOK 1 - -#define configTICK_RATE_HZ ( CONFIG_FREERTOS_HZ ) - -/* Default clock rate for simulator */ -//#define configCPU_CLOCK_HZ 80000000 - -/* This has impact on speed of search for highest priority */ -#ifdef SMALL_TEST -#define configMAX_PRIORITIES ( 7 ) -#else -#define configMAX_PRIORITIES ( 25 ) -#endif - -#ifndef CONFIG_ESP32_APPTRACE_ENABLE -#define configMINIMAL_STACK_SIZE 768 -#else -/* apptrace module requires at least 2KB of stack per task */ -#define configMINIMAL_STACK_SIZE 2048 -#endif - -#ifndef configIDLE_TASK_STACK_SIZE -#define configIDLE_TASK_STACK_SIZE CONFIG_FREERTOS_IDLE_TASK_STACKSIZE -#endif - -/* The Xtensa port uses a separate interrupt stack. Adjust the stack size */ -/* to suit the needs of your specific application. */ -#ifndef configISR_STACK_SIZE -#define configISR_STACK_SIZE CONFIG_FREERTOS_ISR_STACKSIZE -#endif - -/* Minimal heap size to make sure examples can run on memory limited - configs. Adjust this to suit your system. */ - - -//We define the heap to span all of the non-statically-allocated shared RAM. ToDo: Make sure there -//is some space left for the app and main cpu when running outside of a thread. -#define configAPPLICATION_ALLOCATED_HEAP 1 -#define configTOTAL_HEAP_SIZE (&_heap_end - &_heap_start)//( ( size_t ) (64 * 1024) ) - -#define configMAX_TASK_NAME_LEN ( CONFIG_FREERTOS_MAX_TASK_NAME_LEN ) - -#ifdef CONFIG_FREERTOS_USE_TRACE_FACILITY -#define configUSE_TRACE_FACILITY 1 /* Used by uxTaskGetSystemState(), and other trace facility functions */ -#endif - -#ifdef CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS -#define configUSE_STATS_FORMATTING_FUNCTIONS 1 /* Used by vTaskList() */ -#endif - -#ifdef CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID -#define configTASKLIST_INCLUDE_COREID 1 -#endif - -#ifdef CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS -#define configGENERATE_RUN_TIME_STATS 1 /* Used by vTaskGetRunTimeStats() */ -#endif - -#define configUSE_TRACE_FACILITY_2 0 /* Provided by Xtensa port patch */ -#define configBENCHMARK 0 /* Provided by Xtensa port patch */ -#define configUSE_16_BIT_TICKS 0 -#define configIDLE_SHOULD_YIELD 0 -#define configQUEUE_REGISTRY_SIZE CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE - -#define configUSE_MUTEXES 1 -#define configUSE_RECURSIVE_MUTEXES 1 -#define configUSE_COUNTING_SEMAPHORES 1 - -#if CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE -#define configCHECK_FOR_STACK_OVERFLOW 0 -#elif CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL -#define configCHECK_FOR_STACK_OVERFLOW 1 -#elif CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY -#define configCHECK_FOR_STACK_OVERFLOW 2 -#endif - - - - -/* Co-routine definitions. */ -#define configUSE_CO_ROUTINES 0 -#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) - -/* Set the following definitions to 1 to include the API function, or zero - to exclude the API function. */ - -#define INCLUDE_vTaskPrioritySet 1 -#define INCLUDE_uxTaskPriorityGet 1 -#define INCLUDE_vTaskDelete 1 -#define INCLUDE_vTaskCleanUpResources 0 -#define INCLUDE_vTaskSuspend 1 -#define INCLUDE_vTaskDelayUntil 1 -#define INCLUDE_vTaskDelay 1 -#define INCLUDE_uxTaskGetStackHighWaterMark 1 -#define INCLUDE_pcTaskGetTaskName 1 -#define INCLUDE_xTaskGetIdleTaskHandle 1 -#define INCLUDE_pxTaskGetStackStart 1 - -#define INCLUDE_xSemaphoreGetMutexHolder 1 - -/* The priority at which the tick interrupt runs. This should probably be - kept at 1. */ -#define configKERNEL_INTERRUPT_PRIORITY 1 - -/* The maximum interrupt priority from which FreeRTOS.org API functions can - be called. Only API functions that end in ...FromISR() can be used within - interrupts. */ -#define configMAX_SYSCALL_INTERRUPT_PRIORITY XCHAL_EXCM_LEVEL - -#define configUSE_NEWLIB_REENTRANT 1 - -#define configSUPPORT_DYNAMIC_ALLOCATION 1 -#define configSUPPORT_STATIC_ALLOCATION CONFIG_SUPPORT_STATIC_ALLOCATION - -#ifndef __ASSEMBLER__ -#if CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK -extern void vPortCleanUpTCB ( void *pxTCB ); -#define portCLEAN_UP_TCB( pxTCB ) vPortCleanUpTCB( pxTCB ) -#endif -#endif - -/* Test FreeRTOS timers (with timer task) and more. */ -/* Some files don't compile if this flag is disabled */ -#define configUSE_TIMERS 1 -#define configTIMER_TASK_PRIORITY CONFIG_TIMER_TASK_PRIORITY -#define configTIMER_QUEUE_LENGTH CONFIG_TIMER_QUEUE_LENGTH -#define configTIMER_TASK_STACK_DEPTH CONFIG_TIMER_TASK_STACK_DEPTH - -#define INCLUDE_xTimerPendFunctionCall 1 -#define INCLUDE_eTaskGetState 1 -#define configUSE_QUEUE_SETS 1 - -#define configUSE_TICKLESS_IDLE CONFIG_FREERTOS_USE_TICKLESS_IDLE -#if configUSE_TICKLESS_IDLE -#define configEXPECTED_IDLE_TIME_BEFORE_SLEEP CONFIG_FREERTOS_IDLE_TIME_BEFORE_SLEEP -#endif //configUSE_TICKLESS_IDLE - -#define configXT_BOARD 1 /* Board mode */ -#define configXT_SIMULATOR 0 - -#define configENABLE_TASK_SNAPSHOT 1 - -#if CONFIG_SYSVIEW_ENABLE -#ifndef __ASSEMBLER__ -#include "SEGGER_SYSVIEW_FreeRTOS.h" -#undef INLINE // to avoid redefinition -#endif /* def __ASSEMBLER__ */ -#endif - -#endif /* FREERTOS_CONFIG_H */ - diff --git a/tools/sdk/include/freertos/freertos/StackMacros.h b/tools/sdk/include/freertos/freertos/StackMacros.h deleted file mode 100644 index 50d2e198fc2..00000000000 --- a/tools/sdk/include/freertos/freertos/StackMacros.h +++ /dev/null @@ -1,184 +0,0 @@ -/* - FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd. - All rights reserved - - VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. - - This file is part of the FreeRTOS distribution. - - FreeRTOS is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License (version 2) as published by the - Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. - - *************************************************************************** - >>! NOTE: The modification to the GPL is included to allow you to !<< - >>! distribute a combined work that includes FreeRTOS without being !<< - >>! obliged to provide the source code for proprietary components !<< - >>! outside of the FreeRTOS kernel. !<< - *************************************************************************** - - FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. Full license text is available on the following - link: http://www.freertos.org/a00114.html - - *************************************************************************** - * * - * FreeRTOS provides completely free yet professionally developed, * - * robust, strictly quality controlled, supported, and cross * - * platform software that is more than just the market leader, it * - * is the industry's de facto standard. * - * * - * Help yourself get started quickly while simultaneously helping * - * to support the FreeRTOS project by purchasing a FreeRTOS * - * tutorial book, reference manual, or both: * - * http://www.FreeRTOS.org/Documentation * - * * - *************************************************************************** - - http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading - the FAQ page "My application does not run, what could be wrong?". Have you - defined configASSERT()? - - http://www.FreeRTOS.org/support - In return for receiving this top quality - embedded software for free we request you assist our global community by - participating in the support forum. - - http://www.FreeRTOS.org/training - Investing in training allows your team to - be as productive as possible as early as possible. Now you can receive - FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers - Ltd, and the world's leading authority on the world's leading RTOS. - - http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, - including FreeRTOS+Trace - an indispensable productivity tool, a DOS - compatible FAT file system, and our tiny thread aware UDP/IP stack. - - http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. - Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. - - http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High - Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS - licenses offer ticketed support, indemnification and commercial middleware. - - http://www.SafeRTOS.com - High Integrity Systems also provide a safety - engineered and independently SIL3 certified version for use in safety and - mission critical applications that require provable dependability. - - 1 tab == 4 spaces! -*/ - -#ifndef STACK_MACROS_H -#define STACK_MACROS_H - -/* - * Call the stack overflow hook function if the stack of the task being swapped - * out is currently overflowed, or looks like it might have overflowed in the - * past. - * - * Setting configCHECK_FOR_STACK_OVERFLOW to 1 will cause the macro to check - * the current stack state only - comparing the current top of stack value to - * the stack limit. Setting configCHECK_FOR_STACK_OVERFLOW to greater than 1 - * will also cause the last few stack bytes to be checked to ensure the value - * to which the bytes were set when the task was created have not been - * overwritten. Note this second test does not guarantee that an overflowed - * stack will always be recognised. - */ - -/*-----------------------------------------------------------*/ - -#if( configCHECK_FOR_STACK_OVERFLOW == 0 ) - - /* FreeRTOSConfig.h is not set to check for stack overflows. */ - #define taskFIRST_CHECK_FOR_STACK_OVERFLOW() - #define taskSECOND_CHECK_FOR_STACK_OVERFLOW() - -#endif /* configCHECK_FOR_STACK_OVERFLOW == 0 */ -/*-----------------------------------------------------------*/ - -#if( configCHECK_FOR_STACK_OVERFLOW == 1 ) - - /* FreeRTOSConfig.h is only set to use the first method of - overflow checking. */ - #define taskSECOND_CHECK_FOR_STACK_OVERFLOW() - -#endif -/*-----------------------------------------------------------*/ - -#if( ( configCHECK_FOR_STACK_OVERFLOW > 0 ) && ( portSTACK_GROWTH < 0 ) ) - - /* Only the current stack state is to be checked. */ - #define taskFIRST_CHECK_FOR_STACK_OVERFLOW() \ - { \ - /* Is the currently saved stack pointer within the stack limit? */ \ - if( pxCurrentTCB[ xPortGetCoreID() ]->pxTopOfStack <= pxCurrentTCB[ xPortGetCoreID() ]->pxStack ) \ - { \ - vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB[ xPortGetCoreID() ], pxCurrentTCB[ xPortGetCoreID() ]->pcTaskName ); \ - } \ - } - -#endif /* configCHECK_FOR_STACK_OVERFLOW > 0 */ -/*-----------------------------------------------------------*/ - -#if( ( configCHECK_FOR_STACK_OVERFLOW > 0 ) && ( portSTACK_GROWTH > 0 ) ) - - /* Only the current stack state is to be checked. */ - #define taskFIRST_CHECK_FOR_STACK_OVERFLOW() \ - { \ - \ - /* Is the currently saved stack pointer within the stack limit? */ \ - if( pxCurrentTCB[ xPortGetCoreID() ]->pxTopOfStack >= pxCurrentTCB[ xPortGetCoreID() ]->pxEndOfStack ) \ - { \ - vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB[ xPortGetCoreID() ], pxCurrentTCB[ xPortGetCoreID() ]->pcTaskName ); \ - } \ - } - -#endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */ -/*-----------------------------------------------------------*/ - -#if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) ) - - #define taskSECOND_CHECK_FOR_STACK_OVERFLOW() \ - { \ - static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ - tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ - tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ - tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ - tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE }; \ - \ - \ - /* Has the extremity of the task stack ever been written over? */ \ - if( memcmp( ( void * ) pxCurrentTCB[ xPortGetCoreID() ]->pxStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \ - { \ - vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB[ xPortGetCoreID() ], pxCurrentTCB[ xPortGetCoreID() ]->pcTaskName ); \ - } \ - } - -#endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */ -/*-----------------------------------------------------------*/ - -#if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH > 0 ) ) - - #define taskSECOND_CHECK_FOR_STACK_OVERFLOW() \ - { \ - int8_t *pcEndOfStack = ( int8_t * ) pxCurrentTCB[ xPortGetCoreID() ]->pxEndOfStack; \ - static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ - tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ - tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ - tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ - tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE }; \ - \ - \ - pcEndOfStack -= sizeof( ucExpectedStackBytes ); \ - \ - /* Has the extremity of the task stack ever been written over? */ \ - if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \ - { \ - vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB[ xPortGetCoreID() ], pxCurrentTCB[ xPortGetCoreID() ]->pcTaskName ); \ - } \ - } - -#endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */ -/*-----------------------------------------------------------*/ - -#endif /* STACK_MACROS_H */ - diff --git a/tools/sdk/include/freertos/freertos/croutine.h b/tools/sdk/include/freertos/freertos/croutine.h deleted file mode 100644 index 7dfd4b8c357..00000000000 --- a/tools/sdk/include/freertos/freertos/croutine.h +++ /dev/null @@ -1,762 +0,0 @@ -/* - FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd. - All rights reserved - - VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. - - This file is part of the FreeRTOS distribution. - - FreeRTOS is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License (version 2) as published by the - Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. - - *************************************************************************** - >>! NOTE: The modification to the GPL is included to allow you to !<< - >>! distribute a combined work that includes FreeRTOS without being !<< - >>! obliged to provide the source code for proprietary components !<< - >>! outside of the FreeRTOS kernel. !<< - *************************************************************************** - - FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. Full license text is available on the following - link: http://www.freertos.org/a00114.html - - *************************************************************************** - * * - * FreeRTOS provides completely free yet professionally developed, * - * robust, strictly quality controlled, supported, and cross * - * platform software that is more than just the market leader, it * - * is the industry's de facto standard. * - * * - * Help yourself get started quickly while simultaneously helping * - * to support the FreeRTOS project by purchasing a FreeRTOS * - * tutorial book, reference manual, or both: * - * http://www.FreeRTOS.org/Documentation * - * * - *************************************************************************** - - http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading - the FAQ page "My application does not run, what could be wrong?". Have you - defined configASSERT()? - - http://www.FreeRTOS.org/support - In return for receiving this top quality - embedded software for free we request you assist our global community by - participating in the support forum. - - http://www.FreeRTOS.org/training - Investing in training allows your team to - be as productive as possible as early as possible. Now you can receive - FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers - Ltd, and the world's leading authority on the world's leading RTOS. - - http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, - including FreeRTOS+Trace - an indispensable productivity tool, a DOS - compatible FAT file system, and our tiny thread aware UDP/IP stack. - - http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. - Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. - - http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High - Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS - licenses offer ticketed support, indemnification and commercial middleware. - - http://www.SafeRTOS.com - High Integrity Systems also provide a safety - engineered and independently SIL3 certified version for use in safety and - mission critical applications that require provable dependability. - - 1 tab == 4 spaces! -*/ - -#ifndef CO_ROUTINE_H -#define CO_ROUTINE_H - -#ifndef INC_FREERTOS_H - #error "include FreeRTOS.h must appear in source files before include croutine.h" -#endif - -#include "list.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Used to hide the implementation of the co-routine control block. The -control block structure however has to be included in the header due to -the macro implementation of the co-routine functionality. */ -typedef void * CoRoutineHandle_t; - -/* Defines the prototype to which co-routine functions must conform. */ -typedef void (*crCOROUTINE_CODE)( CoRoutineHandle_t, UBaseType_t ); - -typedef struct corCoRoutineControlBlock -{ - crCOROUTINE_CODE pxCoRoutineFunction; - ListItem_t xGenericListItem; /*< List item used to place the CRCB in ready and blocked queues. */ - ListItem_t xEventListItem; /*< List item used to place the CRCB in event lists. */ - UBaseType_t uxPriority; /*< The priority of the co-routine in relation to other co-routines. */ - UBaseType_t uxIndex; /*< Used to distinguish between co-routines when multiple co-routines use the same co-routine function. */ - uint16_t uxState; /*< Used internally by the co-routine implementation. */ -} CRCB_t; /* Co-routine control block. Note must be identical in size down to uxPriority with TCB_t. */ - -/** - * croutine. h - *
- BaseType_t xCoRoutineCreate(
-                                 crCOROUTINE_CODE pxCoRoutineCode,
-                                 UBaseType_t uxPriority,
-                                 UBaseType_t uxIndex
-                               );
- * - * Create a new co-routine and add it to the list of co-routines that are - * ready to run. - * - * @param pxCoRoutineCode Pointer to the co-routine function. Co-routine - * functions require special syntax - see the co-routine section of the WEB - * documentation for more information. - * - * @param uxPriority The priority with respect to other co-routines at which - * the co-routine will run. - * - * @param uxIndex Used to distinguish between different co-routines that - * execute the same function. See the example below and the co-routine section - * of the WEB documentation for further information. - * - * @return pdPASS if the co-routine was successfully created and added to a ready - * list, otherwise an error code defined with ProjDefs.h. - * - * Example usage: -
- // Co-routine to be created.
- void vFlashCoRoutine( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )
- {
- // Variables in co-routines must be declared static if they must maintain value across a blocking call.
- // This may not be necessary for const variables.
- static const char cLedToFlash[ 2 ] = { 5, 6 };
- static const TickType_t uxFlashRates[ 2 ] = { 200, 400 };
-
-     // Must start every co-routine with a call to crSTART();
-     crSTART( xHandle );
-
-     for( ;; )
-     {
-         // This co-routine just delays for a fixed period, then toggles
-         // an LED.  Two co-routines are created using this function, so
-         // the uxIndex parameter is used to tell the co-routine which
-         // LED to flash and how int32_t to delay.  This assumes xQueue has
-         // already been created.
-         vParTestToggleLED( cLedToFlash[ uxIndex ] );
-         crDELAY( xHandle, uxFlashRates[ uxIndex ] );
-     }
-
-     // Must end every co-routine with a call to crEND();
-     crEND();
- }
-
- // Function that creates two co-routines.
- void vOtherFunction( void )
- {
- uint8_t ucParameterToPass;
- TaskHandle_t xHandle;
-
-     // Create two co-routines at priority 0.  The first is given index 0
-     // so (from the code above) toggles LED 5 every 200 ticks.  The second
-     // is given index 1 so toggles LED 6 every 400 ticks.
-     for( uxIndex = 0; uxIndex < 2; uxIndex++ )
-     {
-         xCoRoutineCreate( vFlashCoRoutine, 0, uxIndex );
-     }
- }
-   
- * \defgroup xCoRoutineCreate xCoRoutineCreate - * \ingroup Tasks - */ -BaseType_t xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode, UBaseType_t uxPriority, UBaseType_t uxIndex ); - - -/** - * croutine. h - *
- void vCoRoutineSchedule( void );
- * - * Run a co-routine. - * - * vCoRoutineSchedule() executes the highest priority co-routine that is able - * to run. The co-routine will execute until it either blocks, yields or is - * preempted by a task. Co-routines execute cooperatively so one - * co-routine cannot be preempted by another, but can be preempted by a task. - * - * If an application comprises of both tasks and co-routines then - * vCoRoutineSchedule should be called from the idle task (in an idle task - * hook). - * - * Example usage: -
- // This idle task hook will schedule a co-routine each time it is called.
- // The rest of the idle task will execute between co-routine calls.
- void vApplicationIdleHook( void )
- {
-	vCoRoutineSchedule();
- }
-
- // Alternatively, if you do not require any other part of the idle task to
- // execute, the idle task hook can call vCoRoutineScheduler() within an
- // infinite loop.
- void vApplicationIdleHook( void )
- {
-    for( ;; )
-    {
-        vCoRoutineSchedule();
-    }
- }
- 
- * \defgroup vCoRoutineSchedule vCoRoutineSchedule - * \ingroup Tasks - */ -void vCoRoutineSchedule( void ); - -/** - * croutine. h - *
- crSTART( CoRoutineHandle_t xHandle );
- * - * This macro MUST always be called at the start of a co-routine function. - * - * Example usage: -
- // Co-routine to be created.
- void vACoRoutine( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )
- {
- // Variables in co-routines must be declared static if they must maintain value across a blocking call.
- static int32_t ulAVariable;
-
-     // Must start every co-routine with a call to crSTART();
-     crSTART( xHandle );
-
-     for( ;; )
-     {
-          // Co-routine functionality goes here.
-     }
-
-     // Must end every co-routine with a call to crEND();
-     crEND();
- }
- * \defgroup crSTART crSTART - * \ingroup Tasks - */ -#define crSTART( pxCRCB ) switch( ( ( CRCB_t * )( pxCRCB ) )->uxState ) { case 0: - -/** - * croutine. h - *
- crEND();
- * - * This macro MUST always be called at the end of a co-routine function. - * - * Example usage: -
- // Co-routine to be created.
- void vACoRoutine( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )
- {
- // Variables in co-routines must be declared static if they must maintain value across a blocking call.
- static int32_t ulAVariable;
-
-     // Must start every co-routine with a call to crSTART();
-     crSTART( xHandle );
-
-     for( ;; )
-     {
-          // Co-routine functionality goes here.
-     }
-
-     // Must end every co-routine with a call to crEND();
-     crEND();
- }
- * \defgroup crSTART crSTART - * \ingroup Tasks - */ -#define crEND() } - -/* - * These macros are intended for internal use by the co-routine implementation - * only. The macros should not be used directly by application writers. - */ -#define crSET_STATE0( xHandle ) ( ( CRCB_t * )( xHandle ) )->uxState = (__LINE__ * 2); return; case (__LINE__ * 2): -#define crSET_STATE1( xHandle ) ( ( CRCB_t * )( xHandle ) )->uxState = ((__LINE__ * 2)+1); return; case ((__LINE__ * 2)+1): - -/** - * croutine. h - *
- crDELAY( CoRoutineHandle_t xHandle, TickType_t xTicksToDelay );
- * - * Delay a co-routine for a fixed period of time. - * - * crDELAY can only be called from the co-routine function itself - not - * from within a function called by the co-routine function. This is because - * co-routines do not maintain their own stack. - * - * @param xHandle The handle of the co-routine to delay. This is the xHandle - * parameter of the co-routine function. - * - * @param xTickToDelay The number of ticks that the co-routine should delay - * for. The actual amount of time this equates to is defined by - * configTICK_RATE_HZ (set in FreeRTOSConfig.h). The constant portTICK_PERIOD_MS - * can be used to convert ticks to milliseconds. - * - * Example usage: -
- // Co-routine to be created.
- void vACoRoutine( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )
- {
- // Variables in co-routines must be declared static if they must maintain value across a blocking call.
- // This may not be necessary for const variables.
- // We are to delay for 200ms.
- static const xTickType xDelayTime = 200 / portTICK_PERIOD_MS;
-
-     // Must start every co-routine with a call to crSTART();
-     crSTART( xHandle );
-
-     for( ;; )
-     {
-        // Delay for 200ms.
-        crDELAY( xHandle, xDelayTime );
-
-        // Do something here.
-     }
-
-     // Must end every co-routine with a call to crEND();
-     crEND();
- }
- * \defgroup crDELAY crDELAY - * \ingroup Tasks - */ -#define crDELAY( xHandle, xTicksToDelay ) \ - if( ( xTicksToDelay ) > 0 ) \ - { \ - vCoRoutineAddToDelayedList( ( xTicksToDelay ), NULL ); \ - } \ - crSET_STATE0( ( xHandle ) ); - -/** - *
- crQUEUE_SEND(
-                  CoRoutineHandle_t xHandle,
-                  QueueHandle_t pxQueue,
-                  void *pvItemToQueue,
-                  TickType_t xTicksToWait,
-                  BaseType_t *pxResult
-             )
- * - * The macro's crQUEUE_SEND() and crQUEUE_RECEIVE() are the co-routine - * equivalent to the xQueueSend() and xQueueReceive() functions used by tasks. - * - * crQUEUE_SEND and crQUEUE_RECEIVE can only be used from a co-routine whereas - * xQueueSend() and xQueueReceive() can only be used from tasks. - * - * crQUEUE_SEND can only be called from the co-routine function itself - not - * from within a function called by the co-routine function. This is because - * co-routines do not maintain their own stack. - * - * See the co-routine section of the WEB documentation for information on - * passing data between tasks and co-routines and between ISR's and - * co-routines. - * - * @param xHandle The handle of the calling co-routine. This is the xHandle - * parameter of the co-routine function. - * - * @param pxQueue The handle of the queue on which the data will be posted. - * The handle is obtained as the return value when the queue is created using - * the xQueueCreate() API function. - * - * @param pvItemToQueue A pointer to the data being posted onto the queue. - * The number of bytes of each queued item is specified when the queue is - * created. This number of bytes is copied from pvItemToQueue into the queue - * itself. - * - * @param xTickToDelay The number of ticks that the co-routine should block - * to wait for space to become available on the queue, should space not be - * available immediately. The actual amount of time this equates to is defined - * by configTICK_RATE_HZ (set in FreeRTOSConfig.h). The constant - * portTICK_PERIOD_MS can be used to convert ticks to milliseconds (see example - * below). - * - * @param pxResult The variable pointed to by pxResult will be set to pdPASS if - * data was successfully posted onto the queue, otherwise it will be set to an - * error defined within ProjDefs.h. - * - * Example usage: -
- // Co-routine function that blocks for a fixed period then posts a number onto
- // a queue.
- static void prvCoRoutineFlashTask( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )
- {
- // Variables in co-routines must be declared static if they must maintain value across a blocking call.
- static BaseType_t xNumberToPost = 0;
- static BaseType_t xResult;
-
-    // Co-routines must begin with a call to crSTART().
-    crSTART( xHandle );
-
-    for( ;; )
-    {
-        // This assumes the queue has already been created.
-        crQUEUE_SEND( xHandle, xCoRoutineQueue, &xNumberToPost, NO_DELAY, &xResult );
-
-        if( xResult != pdPASS )
-        {
-            // The message was not posted!
-        }
-
-        // Increment the number to be posted onto the queue.
-        xNumberToPost++;
-
-        // Delay for 100 ticks.
-        crDELAY( xHandle, 100 );
-    }
-
-    // Co-routines must end with a call to crEND().
-    crEND();
- }
- * \defgroup crQUEUE_SEND crQUEUE_SEND - * \ingroup Tasks - */ -#define crQUEUE_SEND( xHandle, pxQueue, pvItemToQueue, xTicksToWait, pxResult ) \ -{ \ - *( pxResult ) = xQueueCRSend( ( pxQueue) , ( pvItemToQueue) , ( xTicksToWait ) ); \ - if( *( pxResult ) == errQUEUE_BLOCKED ) \ - { \ - crSET_STATE0( ( xHandle ) ); \ - *pxResult = xQueueCRSend( ( pxQueue ), ( pvItemToQueue ), 0 ); \ - } \ - if( *pxResult == errQUEUE_YIELD ) \ - { \ - crSET_STATE1( ( xHandle ) ); \ - *pxResult = pdPASS; \ - } \ -} - -/** - * croutine. h - *
-  crQUEUE_RECEIVE(
-                     CoRoutineHandle_t xHandle,
-                     QueueHandle_t pxQueue,
-                     void *pvBuffer,
-                     TickType_t xTicksToWait,
-                     BaseType_t *pxResult
-                 )
- * - * The macro's crQUEUE_SEND() and crQUEUE_RECEIVE() are the co-routine - * equivalent to the xQueueSend() and xQueueReceive() functions used by tasks. - * - * crQUEUE_SEND and crQUEUE_RECEIVE can only be used from a co-routine whereas - * xQueueSend() and xQueueReceive() can only be used from tasks. - * - * crQUEUE_RECEIVE can only be called from the co-routine function itself - not - * from within a function called by the co-routine function. This is because - * co-routines do not maintain their own stack. - * - * See the co-routine section of the WEB documentation for information on - * passing data between tasks and co-routines and between ISR's and - * co-routines. - * - * @param xHandle The handle of the calling co-routine. This is the xHandle - * parameter of the co-routine function. - * - * @param pxQueue The handle of the queue from which the data will be received. - * The handle is obtained as the return value when the queue is created using - * the xQueueCreate() API function. - * - * @param pvBuffer The buffer into which the received item is to be copied. - * The number of bytes of each queued item is specified when the queue is - * created. This number of bytes is copied into pvBuffer. - * - * @param xTickToDelay The number of ticks that the co-routine should block - * to wait for data to become available from the queue, should data not be - * available immediately. The actual amount of time this equates to is defined - * by configTICK_RATE_HZ (set in FreeRTOSConfig.h). The constant - * portTICK_PERIOD_MS can be used to convert ticks to milliseconds (see the - * crQUEUE_SEND example). - * - * @param pxResult The variable pointed to by pxResult will be set to pdPASS if - * data was successfully retrieved from the queue, otherwise it will be set to - * an error code as defined within ProjDefs.h. - * - * Example usage: -
- // A co-routine receives the number of an LED to flash from a queue.  It
- // blocks on the queue until the number is received.
- static void prvCoRoutineFlashWorkTask( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )
- {
- // Variables in co-routines must be declared static if they must maintain value across a blocking call.
- static BaseType_t xResult;
- static UBaseType_t uxLEDToFlash;
-
-    // All co-routines must start with a call to crSTART().
-    crSTART( xHandle );
-
-    for( ;; )
-    {
-        // Wait for data to become available on the queue.
-        crQUEUE_RECEIVE( xHandle, xCoRoutineQueue, &uxLEDToFlash, portMAX_DELAY, &xResult );
-
-        if( xResult == pdPASS )
-        {
-            // We received the LED to flash - flash it!
-            vParTestToggleLED( uxLEDToFlash );
-        }
-    }
-
-    crEND();
- }
- * \defgroup crQUEUE_RECEIVE crQUEUE_RECEIVE - * \ingroup Tasks - */ -#define crQUEUE_RECEIVE( xHandle, pxQueue, pvBuffer, xTicksToWait, pxResult ) \ -{ \ - *( pxResult ) = xQueueCRReceive( ( pxQueue) , ( pvBuffer ), ( xTicksToWait ) ); \ - if( *( pxResult ) == errQUEUE_BLOCKED ) \ - { \ - crSET_STATE0( ( xHandle ) ); \ - *( pxResult ) = xQueueCRReceive( ( pxQueue) , ( pvBuffer ), 0 ); \ - } \ - if( *( pxResult ) == errQUEUE_YIELD ) \ - { \ - crSET_STATE1( ( xHandle ) ); \ - *( pxResult ) = pdPASS; \ - } \ -} - -/** - * croutine. h - *
-  crQUEUE_SEND_FROM_ISR(
-                            QueueHandle_t pxQueue,
-                            void *pvItemToQueue,
-                            BaseType_t xCoRoutinePreviouslyWoken
-                       )
- * - * The macro's crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() are the - * co-routine equivalent to the xQueueSendFromISR() and xQueueReceiveFromISR() - * functions used by tasks. - * - * crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() can only be used to - * pass data between a co-routine and and ISR, whereas xQueueSendFromISR() and - * xQueueReceiveFromISR() can only be used to pass data between a task and and - * ISR. - * - * crQUEUE_SEND_FROM_ISR can only be called from an ISR to send data to a queue - * that is being used from within a co-routine. - * - * See the co-routine section of the WEB documentation for information on - * passing data between tasks and co-routines and between ISR's and - * co-routines. - * - * @param xQueue The handle to the queue on which the item is to be posted. - * - * @param pvItemToQueue A pointer to the item that is to be placed on the - * queue. The size of the items the queue will hold was defined when the - * queue was created, so this many bytes will be copied from pvItemToQueue - * into the queue storage area. - * - * @param xCoRoutinePreviouslyWoken This is included so an ISR can post onto - * the same queue multiple times from a single interrupt. The first call - * should always pass in pdFALSE. Subsequent calls should pass in - * the value returned from the previous call. - * - * @return pdTRUE if a co-routine was woken by posting onto the queue. This is - * used by the ISR to determine if a context switch may be required following - * the ISR. - * - * Example usage: -
- // A co-routine that blocks on a queue waiting for characters to be received.
- static void vReceivingCoRoutine( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )
- {
- char cRxedChar;
- BaseType_t xResult;
-
-     // All co-routines must start with a call to crSTART().
-     crSTART( xHandle );
-
-     for( ;; )
-     {
-         // Wait for data to become available on the queue.  This assumes the
-         // queue xCommsRxQueue has already been created!
-         crQUEUE_RECEIVE( xHandle, xCommsRxQueue, &uxLEDToFlash, portMAX_DELAY, &xResult );
-
-         // Was a character received?
-         if( xResult == pdPASS )
-         {
-             // Process the character here.
-         }
-     }
-
-     // All co-routines must end with a call to crEND().
-     crEND();
- }
-
- // An ISR that uses a queue to send characters received on a serial port to
- // a co-routine.
- void vUART_ISR( void )
- {
- char cRxedChar;
- BaseType_t xCRWokenByPost = pdFALSE;
-
-     // We loop around reading characters until there are none left in the UART.
-     while( UART_RX_REG_NOT_EMPTY() )
-     {
-         // Obtain the character from the UART.
-         cRxedChar = UART_RX_REG;
-
-         // Post the character onto a queue.  xCRWokenByPost will be pdFALSE
-         // the first time around the loop.  If the post causes a co-routine
-         // to be woken (unblocked) then xCRWokenByPost will be set to pdTRUE.
-         // In this manner we can ensure that if more than one co-routine is
-         // blocked on the queue only one is woken by this ISR no matter how
-         // many characters are posted to the queue.
-         xCRWokenByPost = crQUEUE_SEND_FROM_ISR( xCommsRxQueue, &cRxedChar, xCRWokenByPost );
-     }
- }
- * \defgroup crQUEUE_SEND_FROM_ISR crQUEUE_SEND_FROM_ISR - * \ingroup Tasks - */ -#define crQUEUE_SEND_FROM_ISR( pxQueue, pvItemToQueue, xCoRoutinePreviouslyWoken ) xQueueCRSendFromISR( ( pxQueue ), ( pvItemToQueue ), ( xCoRoutinePreviouslyWoken ) ) - - -/** - * croutine. h - *
-  crQUEUE_SEND_FROM_ISR(
-                            QueueHandle_t pxQueue,
-                            void *pvBuffer,
-                            BaseType_t * pxCoRoutineWoken
-                       )
- * - * The macro's crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() are the - * co-routine equivalent to the xQueueSendFromISR() and xQueueReceiveFromISR() - * functions used by tasks. - * - * crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() can only be used to - * pass data between a co-routine and and ISR, whereas xQueueSendFromISR() and - * xQueueReceiveFromISR() can only be used to pass data between a task and and - * ISR. - * - * crQUEUE_RECEIVE_FROM_ISR can only be called from an ISR to receive data - * from a queue that is being used from within a co-routine (a co-routine - * posted to the queue). - * - * See the co-routine section of the WEB documentation for information on - * passing data between tasks and co-routines and between ISR's and - * co-routines. - * - * @param xQueue The handle to the queue on which the item is to be posted. - * - * @param pvBuffer A pointer to a buffer into which the received item will be - * placed. The size of the items the queue will hold was defined when the - * queue was created, so this many bytes will be copied from the queue into - * pvBuffer. - * - * @param pxCoRoutineWoken A co-routine may be blocked waiting for space to become - * available on the queue. If crQUEUE_RECEIVE_FROM_ISR causes such a - * co-routine to unblock *pxCoRoutineWoken will get set to pdTRUE, otherwise - * *pxCoRoutineWoken will remain unchanged. - * - * @return pdTRUE an item was successfully received from the queue, otherwise - * pdFALSE. - * - * Example usage: -
- // A co-routine that posts a character to a queue then blocks for a fixed
- // period.  The character is incremented each time.
- static void vSendingCoRoutine( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )
- {
- // cChar holds its value while this co-routine is blocked and must therefore
- // be declared static.
- static char cCharToTx = 'a';
- BaseType_t xResult;
-
-     // All co-routines must start with a call to crSTART().
-     crSTART( xHandle );
-
-     for( ;; )
-     {
-         // Send the next character to the queue.
-         crQUEUE_SEND( xHandle, xCoRoutineQueue, &cCharToTx, NO_DELAY, &xResult );
-
-         if( xResult == pdPASS )
-         {
-             // The character was successfully posted to the queue.
-         }
-		 else
-		 {
-			// Could not post the character to the queue.
-		 }
-
-         // Enable the UART Tx interrupt to cause an interrupt in this
-		 // hypothetical UART.  The interrupt will obtain the character
-		 // from the queue and send it.
-		 ENABLE_RX_INTERRUPT();
-
-		 // Increment to the next character then block for a fixed period.
-		 // cCharToTx will maintain its value across the delay as it is
-		 // declared static.
-		 cCharToTx++;
-		 if( cCharToTx > 'x' )
-		 {
-			cCharToTx = 'a';
-		 }
-		 crDELAY( 100 );
-     }
-
-     // All co-routines must end with a call to crEND().
-     crEND();
- }
-
- // An ISR that uses a queue to receive characters to send on a UART.
- void vUART_ISR( void )
- {
- char cCharToTx;
- BaseType_t xCRWokenByPost = pdFALSE;
-
-     while( UART_TX_REG_EMPTY() )
-     {
-         // Are there any characters in the queue waiting to be sent?
-		 // xCRWokenByPost will automatically be set to pdTRUE if a co-routine
-		 // is woken by the post - ensuring that only a single co-routine is
-		 // woken no matter how many times we go around this loop.
-         if( crQUEUE_RECEIVE_FROM_ISR( pxQueue, &cCharToTx, &xCRWokenByPost ) )
-		 {
-			 SEND_CHARACTER( cCharToTx );
-		 }
-     }
- }
- * \defgroup crQUEUE_RECEIVE_FROM_ISR crQUEUE_RECEIVE_FROM_ISR - * \ingroup Tasks - */ -#define crQUEUE_RECEIVE_FROM_ISR( pxQueue, pvBuffer, pxCoRoutineWoken ) xQueueCRReceiveFromISR( ( pxQueue ), ( pvBuffer ), ( pxCoRoutineWoken ) ) - -/* - * This function is intended for internal use by the co-routine macros only. - * The macro nature of the co-routine implementation requires that the - * prototype appears here. The function should not be used by application - * writers. - * - * Removes the current co-routine from its ready list and places it in the - * appropriate delayed list. - */ -void vCoRoutineAddToDelayedList( TickType_t xTicksToDelay, List_t *pxEventList ); - -/* - * This function is intended for internal use by the queue implementation only. - * The function should not be used by application writers. - * - * Removes the highest priority co-routine from the event list and places it in - * the pending ready list. - */ -BaseType_t xCoRoutineRemoveFromEventList( const List_t *pxEventList ); - -#ifdef __cplusplus -} -#endif - -#endif /* CO_ROUTINE_H */ diff --git a/tools/sdk/include/freertos/freertos/deprecated_definitions.h b/tools/sdk/include/freertos/freertos/deprecated_definitions.h deleted file mode 100644 index fb031cdde63..00000000000 --- a/tools/sdk/include/freertos/freertos/deprecated_definitions.h +++ /dev/null @@ -1,321 +0,0 @@ -/* - FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd. - All rights reserved - - VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. - - This file is part of the FreeRTOS distribution. - - FreeRTOS is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License (version 2) as published by the - Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. - - *************************************************************************** - >>! NOTE: The modification to the GPL is included to allow you to !<< - >>! distribute a combined work that includes FreeRTOS without being !<< - >>! obliged to provide the source code for proprietary components !<< - >>! outside of the FreeRTOS kernel. !<< - *************************************************************************** - - FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. Full license text is available on the following - link: http://www.freertos.org/a00114.html - - *************************************************************************** - * * - * FreeRTOS provides completely free yet professionally developed, * - * robust, strictly quality controlled, supported, and cross * - * platform software that is more than just the market leader, it * - * is the industry's de facto standard. * - * * - * Help yourself get started quickly while simultaneously helping * - * to support the FreeRTOS project by purchasing a FreeRTOS * - * tutorial book, reference manual, or both: * - * http://www.FreeRTOS.org/Documentation * - * * - *************************************************************************** - - http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading - the FAQ page "My application does not run, what could be wrong?". Have you - defined configASSERT()? - - http://www.FreeRTOS.org/support - In return for receiving this top quality - embedded software for free we request you assist our global community by - participating in the support forum. - - http://www.FreeRTOS.org/training - Investing in training allows your team to - be as productive as possible as early as possible. Now you can receive - FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers - Ltd, and the world's leading authority on the world's leading RTOS. - - http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, - including FreeRTOS+Trace - an indispensable productivity tool, a DOS - compatible FAT file system, and our tiny thread aware UDP/IP stack. - - http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. - Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. - - http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High - Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS - licenses offer ticketed support, indemnification and commercial middleware. - - http://www.SafeRTOS.com - High Integrity Systems also provide a safety - engineered and independently SIL3 certified version for use in safety and - mission critical applications that require provable dependability. - - 1 tab == 4 spaces! -*/ - -#ifndef DEPRECATED_DEFINITIONS_H -#define DEPRECATED_DEFINITIONS_H - - -/* Each FreeRTOS port has a unique portmacro.h header file. Originally a -pre-processor definition was used to ensure the pre-processor found the correct -portmacro.h file for the port being used. That scheme was deprecated in favour -of setting the compiler's include path such that it found the correct -portmacro.h file - removing the need for the constant and allowing the -portmacro.h file to be located anywhere in relation to the port being used. The -definitions below remain in the code for backward compatibility only. New -projects should not use them. */ - -#ifdef OPEN_WATCOM_INDUSTRIAL_PC_PORT - #include "..\..\Source\portable\owatcom\16bitdos\pc\portmacro.h" - typedef void ( __interrupt __far *pxISR )(); -#endif - -#ifdef OPEN_WATCOM_FLASH_LITE_186_PORT - #include "..\..\Source\portable\owatcom\16bitdos\flsh186\portmacro.h" - typedef void ( __interrupt __far *pxISR )(); -#endif - -#ifdef GCC_MEGA_AVR - #include "../portable/GCC/ATMega323/portmacro.h" -#endif - -#ifdef IAR_MEGA_AVR - #include "../portable/IAR/ATMega323/portmacro.h" -#endif - -#ifdef MPLAB_PIC24_PORT - #include "../../Source/portable/MPLAB/PIC24_dsPIC/portmacro.h" -#endif - -#ifdef MPLAB_DSPIC_PORT - #include "../../Source/portable/MPLAB/PIC24_dsPIC/portmacro.h" -#endif - -#ifdef MPLAB_PIC18F_PORT - #include "../../Source/portable/MPLAB/PIC18F/portmacro.h" -#endif - -#ifdef MPLAB_PIC32MX_PORT - #include "../../Source/portable/MPLAB/PIC32MX/portmacro.h" -#endif - -#ifdef _FEDPICC - #include "libFreeRTOS/Include/portmacro.h" -#endif - -#ifdef SDCC_CYGNAL - #include "../../Source/portable/SDCC/Cygnal/portmacro.h" -#endif - -#ifdef GCC_ARM7 - #include "../../Source/portable/GCC/ARM7_LPC2000/portmacro.h" -#endif - -#ifdef GCC_ARM7_ECLIPSE - #include "portmacro.h" -#endif - -#ifdef ROWLEY_LPC23xx - #include "../../Source/portable/GCC/ARM7_LPC23xx/portmacro.h" -#endif - -#ifdef IAR_MSP430 - #include "..\..\Source\portable\IAR\MSP430\portmacro.h" -#endif - -#ifdef GCC_MSP430 - #include "../../Source/portable/GCC/MSP430F449/portmacro.h" -#endif - -#ifdef ROWLEY_MSP430 - #include "../../Source/portable/Rowley/MSP430F449/portmacro.h" -#endif - -#ifdef ARM7_LPC21xx_KEIL_RVDS - #include "..\..\Source\portable\RVDS\ARM7_LPC21xx\portmacro.h" -#endif - -#ifdef SAM7_GCC - #include "../../Source/portable/GCC/ARM7_AT91SAM7S/portmacro.h" -#endif - -#ifdef SAM7_IAR - #include "..\..\Source\portable\IAR\AtmelSAM7S64\portmacro.h" -#endif - -#ifdef SAM9XE_IAR - #include "..\..\Source\portable\IAR\AtmelSAM9XE\portmacro.h" -#endif - -#ifdef LPC2000_IAR - #include "..\..\Source\portable\IAR\LPC2000\portmacro.h" -#endif - -#ifdef STR71X_IAR - #include "..\..\Source\portable\IAR\STR71x\portmacro.h" -#endif - -#ifdef STR75X_IAR - #include "..\..\Source\portable\IAR\STR75x\portmacro.h" -#endif - -#ifdef STR75X_GCC - #include "..\..\Source\portable\GCC\STR75x\portmacro.h" -#endif - -#ifdef STR91X_IAR - #include "..\..\Source\portable\IAR\STR91x\portmacro.h" -#endif - -#ifdef GCC_H8S - #include "../../Source/portable/GCC/H8S2329/portmacro.h" -#endif - -#ifdef GCC_AT91FR40008 - #include "../../Source/portable/GCC/ARM7_AT91FR40008/portmacro.h" -#endif - -#ifdef RVDS_ARMCM3_LM3S102 - #include "../../Source/portable/RVDS/ARM_CM3/portmacro.h" -#endif - -#ifdef GCC_ARMCM3_LM3S102 - #include "../../Source/portable/GCC/ARM_CM3/portmacro.h" -#endif - -#ifdef GCC_ARMCM3 - #include "../../Source/portable/GCC/ARM_CM3/portmacro.h" -#endif - -#ifdef IAR_ARM_CM3 - #include "../../Source/portable/IAR/ARM_CM3/portmacro.h" -#endif - -#ifdef IAR_ARMCM3_LM - #include "../../Source/portable/IAR/ARM_CM3/portmacro.h" -#endif - -#ifdef HCS12_CODE_WARRIOR - #include "../../Source/portable/CodeWarrior/HCS12/portmacro.h" -#endif - -#ifdef MICROBLAZE_GCC - #include "../../Source/portable/GCC/MicroBlaze/portmacro.h" -#endif - -#ifdef TERN_EE - #include "..\..\Source\portable\Paradigm\Tern_EE\small\portmacro.h" -#endif - -#ifdef GCC_HCS12 - #include "../../Source/portable/GCC/HCS12/portmacro.h" -#endif - -#ifdef GCC_MCF5235 - #include "../../Source/portable/GCC/MCF5235/portmacro.h" -#endif - -#ifdef COLDFIRE_V2_GCC - #include "../../../Source/portable/GCC/ColdFire_V2/portmacro.h" -#endif - -#ifdef COLDFIRE_V2_CODEWARRIOR - #include "../../Source/portable/CodeWarrior/ColdFire_V2/portmacro.h" -#endif - -#ifdef GCC_PPC405 - #include "../../Source/portable/GCC/PPC405_Xilinx/portmacro.h" -#endif - -#ifdef GCC_PPC440 - #include "../../Source/portable/GCC/PPC440_Xilinx/portmacro.h" -#endif - -#ifdef _16FX_SOFTUNE - #include "..\..\Source\portable\Softune\MB96340\portmacro.h" -#endif - -#ifdef BCC_INDUSTRIAL_PC_PORT - /* A short file name has to be used in place of the normal - FreeRTOSConfig.h when using the Borland compiler. */ - #include "frconfig.h" - #include "..\portable\BCC\16BitDOS\PC\prtmacro.h" - typedef void ( __interrupt __far *pxISR )(); -#endif - -#ifdef BCC_FLASH_LITE_186_PORT - /* A short file name has to be used in place of the normal - FreeRTOSConfig.h when using the Borland compiler. */ - #include "frconfig.h" - #include "..\portable\BCC\16BitDOS\flsh186\prtmacro.h" - typedef void ( __interrupt __far *pxISR )(); -#endif - -#ifdef __GNUC__ - #ifdef __AVR32_AVR32A__ - #include "portmacro.h" - #endif -#endif - -#ifdef __ICCAVR32__ - #ifdef __CORE__ - #if __CORE__ == __AVR32A__ - #include "portmacro.h" - #endif - #endif -#endif - -#ifdef __91467D - #include "portmacro.h" -#endif - -#ifdef __96340 - #include "portmacro.h" -#endif - - -#ifdef __IAR_V850ES_Fx3__ - #include "../../Source/portable/IAR/V850ES/portmacro.h" -#endif - -#ifdef __IAR_V850ES_Jx3__ - #include "../../Source/portable/IAR/V850ES/portmacro.h" -#endif - -#ifdef __IAR_V850ES_Jx3_L__ - #include "../../Source/portable/IAR/V850ES/portmacro.h" -#endif - -#ifdef __IAR_V850ES_Jx2__ - #include "../../Source/portable/IAR/V850ES/portmacro.h" -#endif - -#ifdef __IAR_V850ES_Hx2__ - #include "../../Source/portable/IAR/V850ES/portmacro.h" -#endif - -#ifdef __IAR_78K0R_Kx3__ - #include "../../Source/portable/IAR/78K0R/portmacro.h" -#endif - -#ifdef __IAR_78K0R_Kx3L__ - #include "../../Source/portable/IAR/78K0R/portmacro.h" -#endif - -#endif /* DEPRECATED_DEFINITIONS_H */ - diff --git a/tools/sdk/include/freertos/freertos/event_groups.h b/tools/sdk/include/freertos/freertos/event_groups.h deleted file mode 100644 index eda2456388d..00000000000 --- a/tools/sdk/include/freertos/freertos/event_groups.h +++ /dev/null @@ -1,726 +0,0 @@ -/* - FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd. - All rights reserved - - VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. - - This file is part of the FreeRTOS distribution. - - FreeRTOS is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License (version 2) as published by the - Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. - - *************************************************************************** - >>! NOTE: The modification to the GPL is included to allow you to !<< - >>! distribute a combined work that includes FreeRTOS without being !<< - >>! obliged to provide the source code for proprietary components !<< - >>! outside of the FreeRTOS kernel. !<< - *************************************************************************** - - FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. Full license text is available on the following - link: http://www.freertos.org/a00114.html - - *************************************************************************** - * * - * FreeRTOS provides completely free yet professionally developed, * - * robust, strictly quality controlled, supported, and cross * - * platform software that is more than just the market leader, it * - * is the industry's de facto standard. * - * * - * Help yourself get started quickly while simultaneously helping * - * to support the FreeRTOS project by purchasing a FreeRTOS * - * tutorial book, reference manual, or both: * - * http://www.FreeRTOS.org/Documentation * - * * - *************************************************************************** - - http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading - the FAQ page "My application does not run, what could be wrong?". Have you - defined configASSERT()? - - http://www.FreeRTOS.org/support - In return for receiving this top quality - embedded software for free we request you assist our global community by - participating in the support forum. - - http://www.FreeRTOS.org/training - Investing in training allows your team to - be as productive as possible as early as possible. Now you can receive - FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers - Ltd, and the world's leading authority on the world's leading RTOS. - - http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, - including FreeRTOS+Trace - an indispensable productivity tool, a DOS - compatible FAT file system, and our tiny thread aware UDP/IP stack. - - http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. - Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. - - http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High - Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS - licenses offer ticketed support, indemnification and commercial middleware. - - http://www.SafeRTOS.com - High Integrity Systems also provide a safety - engineered and independently SIL3 certified version for use in safety and - mission critical applications that require provable dependability. - - 1 tab == 4 spaces! -*/ - -#ifndef EVENT_GROUPS_H -#define EVENT_GROUPS_H - -#ifndef INC_FREERTOS_H - #error "include FreeRTOS.h" must appear in source files before "include event_groups.h" -#endif - -#include "timers.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * An event group is a collection of bits to which an application can assign a - * meaning. For example, an application may create an event group to convey - * the status of various CAN bus related events in which bit 0 might mean "A CAN - * message has been received and is ready for processing", bit 1 might mean "The - * application has queued a message that is ready for sending onto the CAN - * network", and bit 2 might mean "It is time to send a SYNC message onto the - * CAN network" etc. A task can then test the bit values to see which events - * are active, and optionally enter the Blocked state to wait for a specified - * bit or a group of specified bits to be active. To continue the CAN bus - * example, a CAN controlling task can enter the Blocked state (and therefore - * not consume any processing time) until either bit 0, bit 1 or bit 2 are - * active, at which time the bit that was actually active would inform the task - * which action it had to take (process a received message, send a message, or - * send a SYNC). - * - * The event groups implementation contains intelligence to avoid race - * conditions that would otherwise occur were an application to use a simple - * variable for the same purpose. This is particularly important with respect - * to when a bit within an event group is to be cleared, and when bits have to - * be set and then tested atomically - as is the case where event groups are - * used to create a synchronisation point between multiple tasks (a - * 'rendezvous'). - * - */ - - - -/** - * event_groups.h - * - * Type by which event groups are referenced. For example, a call to - * xEventGroupCreate() returns an EventGroupHandle_t variable that can then - * be used as a parameter to other event group functions. - * - * \ingroup EventGroup - */ -typedef void * EventGroupHandle_t; - -/* - * The type that holds event bits always matches TickType_t - therefore the - * number of bits it holds is set by configUSE_16_BIT_TICKS (16 bits if set to 1, - * 32 bits if set to 0. - * - * \ingroup EventGroup - */ -typedef TickType_t EventBits_t; - -/** - * Create a new event group. - * - * Internally, within the FreeRTOS implementation, event groups use a [small] - * block of memory, in which the event group's structure is stored. If an event - * groups is created using xEventGroupCreate() then the required memory is - * automatically dynamically allocated inside the xEventGroupCreate() function. - * (see http://www.freertos.org/a00111.html). If an event group is created - * using xEventGropuCreateStatic() then the application writer must instead - * provide the memory that will get used by the event group. - * xEventGroupCreateStatic() therefore allows an event group to be created - * without using any dynamic memory allocation. - * - * Although event groups are not related to ticks, for internal implementation - * reasons the number of bits available for use in an event group is dependent - * on the configUSE_16_BIT_TICKS setting in FreeRTOSConfig.h. If - * configUSE_16_BIT_TICKS is 1 then each event group contains 8 usable bits (bit - * 0 to bit 7). If configUSE_16_BIT_TICKS is set to 0 then each event group has - * 24 usable bits (bit 0 to bit 23). The EventBits_t type is used to store - * event bits within an event group. - * - * @return If the event group was created then a handle to the event group is - * returned. If there was insufficient FreeRTOS heap available to create the - * event group then NULL is returned. See http://www.freertos.org/a00111.html - * - * Example usage: - * @code{c} - * // Declare a variable to hold the created event group. - * EventGroupHandle_t xCreatedEventGroup; - * - * // Attempt to create the event group. - * xCreatedEventGroup = xEventGroupCreate(); - * - * // Was the event group created successfully? - * if( xCreatedEventGroup == NULL ) - * { - * // The event group was not created because there was insufficient - * // FreeRTOS heap available. - * } - * else - * { - * // The event group was created. - * } - * @endcode - * \ingroup EventGroup - */ -#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) - EventGroupHandle_t xEventGroupCreate( void ) PRIVILEGED_FUNCTION; -#endif - -/** - * Create a new event group. - * - * Internally, within the FreeRTOS implementation, event groups use a [small] - * block of memory, in which the event group's structure is stored. If an event - * groups is created using xEventGropuCreate() then the required memory is - * automatically dynamically allocated inside the xEventGroupCreate() function. - * (see http://www.freertos.org/a00111.html). If an event group is created - * using xEventGropuCreateStatic() then the application writer must instead - * provide the memory that will get used by the event group. - * xEventGroupCreateStatic() therefore allows an event group to be created - * without using any dynamic memory allocation. - * - * Although event groups are not related to ticks, for internal implementation - * reasons the number of bits available for use in an event group is dependent - * on the configUSE_16_BIT_TICKS setting in FreeRTOSConfig.h. If - * configUSE_16_BIT_TICKS is 1 then each event group contains 8 usable bits (bit - * 0 to bit 7). If configUSE_16_BIT_TICKS is set to 0 then each event group has - * 24 usable bits (bit 0 to bit 23). The EventBits_t type is used to store - * event bits within an event group. - * - * @param pxEventGroupBuffer pxEventGroupBuffer must point to a variable of type - * StaticEventGroup_t, which will be then be used to hold the event group's data - * structures, removing the need for the memory to be allocated dynamically. - * - * @return If the event group was created then a handle to the event group is - * returned. If pxEventGroupBuffer was NULL then NULL is returned. - * - * Example usage: - * @code{c} - * // StaticEventGroup_t is a publicly accessible structure that has the same - * // size and alignment requirements as the real event group structure. It is - * // provided as a mechanism for applications to know the size of the event - * // group (which is dependent on the architecture and configuration file - * // settings) without breaking the strict data hiding policy by exposing the - * // real event group internals. This StaticEventGroup_t variable is passed - * // into the xSemaphoreCreateEventGroupStatic() function and is used to store - * // the event group's data structures - * StaticEventGroup_t xEventGroupBuffer; - * - * // Create the event group without dynamically allocating any memory. - * xEventGroup = xEventGroupCreateStatic( &xEventGroupBuffer ); - * @endcode - */ -#if( configSUPPORT_STATIC_ALLOCATION == 1 ) - EventGroupHandle_t xEventGroupCreateStatic( StaticEventGroup_t *pxEventGroupBuffer ) PRIVILEGED_FUNCTION; -#endif - -/** - * [Potentially] block to wait for one or more bits to be set within a - * previously created event group. - * - * This function cannot be called from an interrupt. - * - * @param xEventGroup The event group in which the bits are being tested. The - * event group must have previously been created using a call to - * xEventGroupCreate(). - * - * @param uxBitsToWaitFor A bitwise value that indicates the bit or bits to test - * inside the event group. For example, to wait for bit 0 and/or bit 2 set - * uxBitsToWaitFor to 0x05. To wait for bits 0 and/or bit 1 and/or bit 2 set - * uxBitsToWaitFor to 0x07. Etc. - * - * @param xClearOnExit If xClearOnExit is set to pdTRUE then any bits within - * uxBitsToWaitFor that are set within the event group will be cleared before - * xEventGroupWaitBits() returns if the wait condition was met (if the function - * returns for a reason other than a timeout). If xClearOnExit is set to - * pdFALSE then the bits set in the event group are not altered when the call to - * xEventGroupWaitBits() returns. - * - * @param xWaitForAllBits If xWaitForAllBits is set to pdTRUE then - * xEventGroupWaitBits() will return when either all the bits in uxBitsToWaitFor - * are set or the specified block time expires. If xWaitForAllBits is set to - * pdFALSE then xEventGroupWaitBits() will return when any one of the bits set - * in uxBitsToWaitFor is set or the specified block time expires. The block - * time is specified by the xTicksToWait parameter. - * - * @param xTicksToWait The maximum amount of time (specified in 'ticks') to wait - * for one/all (depending on the xWaitForAllBits value) of the bits specified by - * uxBitsToWaitFor to become set. - * - * @return The value of the event group at the time either the bits being waited - * for became set, or the block time expired. Test the return value to know - * which bits were set. If xEventGroupWaitBits() returned because its timeout - * expired then not all the bits being waited for will be set. If - * xEventGroupWaitBits() returned because the bits it was waiting for were set - * then the returned value is the event group value before any bits were - * automatically cleared in the case that xClearOnExit parameter was set to - * pdTRUE. - * - * Example usage: - * @code{c} - * #define BIT_0 ( 1 << 0 ) - * #define BIT_4 ( 1 << 4 ) - * - * void aFunction( EventGroupHandle_t xEventGroup ) - * { - * EventBits_t uxBits; - * const TickType_t xTicksToWait = 100 / portTICK_PERIOD_MS; - * - * // Wait a maximum of 100ms for either bit 0 or bit 4 to be set within - * // the event group. Clear the bits before exiting. - * uxBits = xEventGroupWaitBits( - * xEventGroup, // The event group being tested. - * BIT_0 | BIT_4, // The bits within the event group to wait for. - * pdTRUE, // BIT_0 and BIT_4 should be cleared before returning. - * pdFALSE, // Don't wait for both bits, either bit will do. - * xTicksToWait ); // Wait a maximum of 100ms for either bit to be set. - * - * if( ( uxBits & ( BIT_0 | BIT_4 ) ) == ( BIT_0 | BIT_4 ) ) - * { - * // xEventGroupWaitBits() returned because both bits were set. - * } - * else if( ( uxBits & BIT_0 ) != 0 ) - * { - * // xEventGroupWaitBits() returned because just BIT_0 was set. - * } - * else if( ( uxBits & BIT_4 ) != 0 ) - * { - * // xEventGroupWaitBits() returned because just BIT_4 was set. - * } - * else - * { - * // xEventGroupWaitBits() returned because xTicksToWait ticks passed - * // without either BIT_0 or BIT_4 becoming set. - * } - * } - * @endcode{c} - * \ingroup EventGroup - */ -EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToWaitFor, const BaseType_t xClearOnExit, const BaseType_t xWaitForAllBits, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION; - -/** - * Clear bits within an event group. This function cannot be called from an - * interrupt. - * - * @param xEventGroup The event group in which the bits are to be cleared. - * - * @param uxBitsToClear A bitwise value that indicates the bit or bits to clear - * in the event group. For example, to clear bit 3 only, set uxBitsToClear to - * 0x08. To clear bit 3 and bit 0 set uxBitsToClear to 0x09. - * - * @return The value of the event group before the specified bits were cleared. - * - * Example usage: - * @code{c} - * #define BIT_0 ( 1 << 0 ) - * #define BIT_4 ( 1 << 4 ) - * - * void aFunction( EventGroupHandle_t xEventGroup ) - * { - * EventBits_t uxBits; - * - * // Clear bit 0 and bit 4 in xEventGroup. - * uxBits = xEventGroupClearBits( - * xEventGroup, // The event group being updated. - * BIT_0 | BIT_4 );// The bits being cleared. - * - * if( ( uxBits & ( BIT_0 | BIT_4 ) ) == ( BIT_0 | BIT_4 ) ) - * { - * // Both bit 0 and bit 4 were set before xEventGroupClearBits() was - * // called. Both will now be clear (not set). - * } - * else if( ( uxBits & BIT_0 ) != 0 ) - * { - * // Bit 0 was set before xEventGroupClearBits() was called. It will - * // now be clear. - * } - * else if( ( uxBits & BIT_4 ) != 0 ) - * { - * // Bit 4 was set before xEventGroupClearBits() was called. It will - * // now be clear. - * } - * else - * { - * // Neither bit 0 nor bit 4 were set in the first place. - * } - * } - * @endcode - * \ingroup EventGroup - */ -EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear ) PRIVILEGED_FUNCTION; - -/** - * A version of xEventGroupClearBits() that can be called from an interrupt. - * - * Setting bits in an event group is not a deterministic operation because there - * are an unknown number of tasks that may be waiting for the bit or bits being - * set. FreeRTOS does not allow nondeterministic operations to be performed - * while interrupts are disabled, so protects event groups that are accessed - * from tasks by suspending the scheduler rather than disabling interrupts. As - * a result event groups cannot be accessed directly from an interrupt service - * routine. Therefore xEventGroupClearBitsFromISR() sends a message to the - * timer task to have the clear operation performed in the context of the timer - * task. - * - * @param xEventGroup The event group in which the bits are to be cleared. - * - * @param uxBitsToClear A bitwise value that indicates the bit or bits to clear. - * For example, to clear bit 3 only, set uxBitsToClear to 0x08. To clear bit 3 - * and bit 0 set uxBitsToClear to 0x09. - * - * @return If the request to execute the function was posted successfully then - * pdPASS is returned, otherwise pdFALSE is returned. pdFALSE will be returned - * if the timer service queue was full. - * - * Example usage: - * @code{c} - * #define BIT_0 ( 1 << 0 ) - * #define BIT_4 ( 1 << 4 ) - * - * // An event group which it is assumed has already been created by a call to - * // xEventGroupCreate(). - * EventGroupHandle_t xEventGroup; - * - * void anInterruptHandler( void ) - * { - * // Clear bit 0 and bit 4 in xEventGroup. - * xResult = xEventGroupClearBitsFromISR( - * xEventGroup, // The event group being updated. - * BIT_0 | BIT_4 ); // The bits being set. - * - * if( xResult == pdPASS ) - * { - * // The message was posted successfully. - * } - * } - * @endcode - * \ingroup EventGroup - */ -#if( configUSE_TRACE_FACILITY == 1 ) - BaseType_t xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet ); -#else - #define xEventGroupClearBitsFromISR( xEventGroup, uxBitsToClear ) xTimerPendFunctionCallFromISR( vEventGroupClearBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToClear, NULL ) -#endif - -/** - * Set bits within an event group. - * This function cannot be called from an interrupt. xEventGroupSetBitsFromISR() - * is a version that can be called from an interrupt. - * - * Setting bits in an event group will automatically unblock tasks that are - * blocked waiting for the bits. - * - * @param xEventGroup The event group in which the bits are to be set. - * - * @param uxBitsToSet A bitwise value that indicates the bit or bits to set. - * For example, to set bit 3 only, set uxBitsToSet to 0x08. To set bit 3 - * and bit 0 set uxBitsToSet to 0x09. - * - * @return The value of the event group at the time the call to - * xEventGroupSetBits() returns. There are two reasons why the returned value - * might have the bits specified by the uxBitsToSet parameter cleared. First, - * if setting a bit results in a task that was waiting for the bit leaving the - * blocked state then it is possible the bit will be cleared automatically - * (see the xClearBitOnExit parameter of xEventGroupWaitBits()). Second, any - * unblocked (or otherwise Ready state) task that has a priority above that of - * the task that called xEventGroupSetBits() will execute and may change the - * event group value before the call to xEventGroupSetBits() returns. - * - * Example usage: - * @code{c} - * #define BIT_0 ( 1 << 0 ) - * #define BIT_4 ( 1 << 4 ) - * - * void aFunction( EventGroupHandle_t xEventGroup ) - * { - * EventBits_t uxBits; - * - * // Set bit 0 and bit 4 in xEventGroup. - * uxBits = xEventGroupSetBits( - * xEventGroup, // The event group being updated. - * BIT_0 | BIT_4 );// The bits being set. - * - * if( ( uxBits & ( BIT_0 | BIT_4 ) ) == ( BIT_0 | BIT_4 ) ) - * { - * // Both bit 0 and bit 4 remained set when the function returned. - * } - * else if( ( uxBits & BIT_0 ) != 0 ) - * { - * // Bit 0 remained set when the function returned, but bit 4 was - * // cleared. It might be that bit 4 was cleared automatically as a - * // task that was waiting for bit 4 was removed from the Blocked - * // state. - * } - * else if( ( uxBits & BIT_4 ) != 0 ) - * { - * // Bit 4 remained set when the function returned, but bit 0 was - * // cleared. It might be that bit 0 was cleared automatically as a - * // task that was waiting for bit 0 was removed from the Blocked - * // state. - * } - * else - * { - * // Neither bit 0 nor bit 4 remained set. It might be that a task - * // was waiting for both of the bits to be set, and the bits were - * // cleared as the task left the Blocked state. - * } - * } - * @endcode{c} - * \ingroup EventGroup - */ -EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet ) PRIVILEGED_FUNCTION; - -/** - * A version of xEventGroupSetBits() that can be called from an interrupt. - * - * Setting bits in an event group is not a deterministic operation because there - * are an unknown number of tasks that may be waiting for the bit or bits being - * set. FreeRTOS does not allow nondeterministic operations to be performed in - * interrupts or from critical sections. Therefore xEventGroupSetBitFromISR() - * sends a message to the timer task to have the set operation performed in the - * context of the timer task - where a scheduler lock is used in place of a - * critical section. - * - * @param xEventGroup The event group in which the bits are to be set. - * - * @param uxBitsToSet A bitwise value that indicates the bit or bits to set. - * For example, to set bit 3 only, set uxBitsToSet to 0x08. To set bit 3 - * and bit 0 set uxBitsToSet to 0x09. - * - * @param pxHigherPriorityTaskWoken As mentioned above, calling this function - * will result in a message being sent to the timer daemon task. If the - * priority of the timer daemon task is higher than the priority of the - * currently running task (the task the interrupt interrupted) then - * *pxHigherPriorityTaskWoken will be set to pdTRUE by - * xEventGroupSetBitsFromISR(), indicating that a context switch should be - * requested before the interrupt exits. For that reason - * *pxHigherPriorityTaskWoken must be initialised to pdFALSE. See the - * example code below. - * - * @return If the request to execute the function was posted successfully then - * pdPASS is returned, otherwise pdFALSE is returned. pdFALSE will be returned - * if the timer service queue was full. - * - * Example usage: - * @code{c} - * #define BIT_0 ( 1 << 0 ) - * #define BIT_4 ( 1 << 4 ) - * - * // An event group which it is assumed has already been created by a call to - * // xEventGroupCreate(). - * EventGroupHandle_t xEventGroup; - * - * void anInterruptHandler( void ) - * { - * BaseType_t xHigherPriorityTaskWoken, xResult; - * - * // xHigherPriorityTaskWoken must be initialised to pdFALSE. - * xHigherPriorityTaskWoken = pdFALSE; - * - * // Set bit 0 and bit 4 in xEventGroup. - * xResult = xEventGroupSetBitsFromISR( - * xEventGroup, // The event group being updated. - * BIT_0 | BIT_4 // The bits being set. - * &xHigherPriorityTaskWoken ); - * - * // Was the message posted successfully? - * if( xResult == pdPASS ) - * { - * // If xHigherPriorityTaskWoken is now set to pdTRUE then a context - * // switch should be requested. The macro used is port specific and - * // will be either portYIELD_FROM_ISR() or portEND_SWITCHING_ISR() - - * // refer to the documentation page for the port being used. - * portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); - * } - * } - * @endcode - * \ingroup EventGroup - */ -#if( configUSE_TRACE_FACILITY == 1 ) - BaseType_t xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, BaseType_t *pxHigherPriorityTaskWoken ); -#else - #define xEventGroupSetBitsFromISR( xEventGroup, uxBitsToSet, pxHigherPriorityTaskWoken ) xTimerPendFunctionCallFromISR( vEventGroupSetBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToSet, pxHigherPriorityTaskWoken ) -#endif - -/** - * Atomically set bits within an event group, then wait for a combination of - * bits to be set within the same event group. This functionality is typically - * used to synchronise multiple tasks, where each task has to wait for the other - * tasks to reach a synchronisation point before proceeding. - * - * This function cannot be used from an interrupt. - * - * The function will return before its block time expires if the bits specified - * by the uxBitsToWait parameter are set, or become set within that time. In - * this case all the bits specified by uxBitsToWait will be automatically - * cleared before the function returns. - * - * @param xEventGroup The event group in which the bits are being tested. The - * event group must have previously been created using a call to - * xEventGroupCreate(). - * - * @param uxBitsToSet The bits to set in the event group before determining - * if, and possibly waiting for, all the bits specified by the uxBitsToWait - * parameter are set. - * - * @param uxBitsToWaitFor A bitwise value that indicates the bit or bits to test - * inside the event group. For example, to wait for bit 0 and bit 2 set - * uxBitsToWaitFor to 0x05. To wait for bits 0 and bit 1 and bit 2 set - * uxBitsToWaitFor to 0x07. Etc. - * - * @param xTicksToWait The maximum amount of time (specified in 'ticks') to wait - * for all of the bits specified by uxBitsToWaitFor to become set. - * - * @return The value of the event group at the time either the bits being waited - * for became set, or the block time expired. Test the return value to know - * which bits were set. If xEventGroupSync() returned because its timeout - * expired then not all the bits being waited for will be set. If - * xEventGroupSync() returned because all the bits it was waiting for were - * set then the returned value is the event group value before any bits were - * automatically cleared. - * - * Example usage: - * @code{c} - * // Bits used by the three tasks. - * #define TASK_0_BIT ( 1 << 0 ) - * #define TASK_1_BIT ( 1 << 1 ) - * #define TASK_2_BIT ( 1 << 2 ) - * - * #define ALL_SYNC_BITS ( TASK_0_BIT | TASK_1_BIT | TASK_2_BIT ) - * - * // Use an event group to synchronise three tasks. It is assumed this event - * // group has already been created elsewhere. - * EventGroupHandle_t xEventBits; - * - * void vTask0( void *pvParameters ) - * { - * EventBits_t uxReturn; - * TickType_t xTicksToWait = 100 / portTICK_PERIOD_MS; - * - * for( ;; ) - * { - * // Perform task functionality here. - * - * // Set bit 0 in the event flag to note this task has reached the - * // sync point. The other two tasks will set the other two bits defined - * // by ALL_SYNC_BITS. All three tasks have reached the synchronisation - * // point when all the ALL_SYNC_BITS are set. Wait a maximum of 100ms - * // for this to happen. - * uxReturn = xEventGroupSync( xEventBits, TASK_0_BIT, ALL_SYNC_BITS, xTicksToWait ); - * - * if( ( uxReturn & ALL_SYNC_BITS ) == ALL_SYNC_BITS ) - * { - * // All three tasks reached the synchronisation point before the call - * // to xEventGroupSync() timed out. - * } - * } - * } - * - * void vTask1( void *pvParameters ) - * { - * for( ;; ) - * { - * // Perform task functionality here. - * - * // Set bit 1 in the event flag to note this task has reached the - * // synchronisation point. The other two tasks will set the other two - * // bits defined by ALL_SYNC_BITS. All three tasks have reached the - * // synchronisation point when all the ALL_SYNC_BITS are set. Wait - * // indefinitely for this to happen. - * xEventGroupSync( xEventBits, TASK_1_BIT, ALL_SYNC_BITS, portMAX_DELAY ); - * - * // xEventGroupSync() was called with an indefinite block time, so - * // this task will only reach here if the syncrhonisation was made by all - * // three tasks, so there is no need to test the return value. - * } - * } - * - * void vTask2( void *pvParameters ) - * { - * for( ;; ) - * { - * // Perform task functionality here. - * - * // Set bit 2 in the event flag to note this task has reached the - * // synchronisation point. The other two tasks will set the other two - * // bits defined by ALL_SYNC_BITS. All three tasks have reached the - * // synchronisation point when all the ALL_SYNC_BITS are set. Wait - * // indefinitely for this to happen. - * xEventGroupSync( xEventBits, TASK_2_BIT, ALL_SYNC_BITS, portMAX_DELAY ); - * - * // xEventGroupSync() was called with an indefinite block time, so - * // this task will only reach here if the syncrhonisation was made by all - * // three tasks, so there is no need to test the return value. - * } - * } - * - * @endcode - * \ingroup EventGroup - */ -EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, const EventBits_t uxBitsToWaitFor, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION; - - -/** - * Returns the current value of the bits in an event group. This function - * cannot be used from an interrupt. - * - * @param xEventGroup The event group being queried. - * - * @return The event group bits at the time xEventGroupGetBits() was called. - * - * \ingroup EventGroup - */ -#define xEventGroupGetBits( xEventGroup ) xEventGroupClearBits( xEventGroup, 0 ) - -/** - * A version of xEventGroupGetBits() that can be called from an ISR. - * - * @param xEventGroup The event group being queried. - * - * @return The event group bits at the time xEventGroupGetBitsFromISR() was called. - * - * \ingroup EventGroup - */ -EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup ); - -/** - * - * Delete an event group that was previously created by a call to - * xEventGroupCreate(). Tasks that are blocked on the event group will be - * unblocked and obtain 0 as the event group's value. - * - * @param xEventGroup The event group being deleted. - */ -void vEventGroupDelete( EventGroupHandle_t xEventGroup ); - -/** @cond */ - -/* For internal use only. */ -void vEventGroupSetBitsCallback( void *pvEventGroup, const uint32_t ulBitsToSet ); -void vEventGroupClearBitsCallback( void *pvEventGroup, const uint32_t ulBitsToClear ); - -#if (configUSE_TRACE_FACILITY == 1) - UBaseType_t uxEventGroupGetNumber( void* xEventGroup ); -#endif - -/** @endcond */ - -#ifdef __cplusplus -} -#endif - -#endif /* EVENT_GROUPS_H */ - - diff --git a/tools/sdk/include/freertos/freertos/list.h b/tools/sdk/include/freertos/freertos/list.h deleted file mode 100644 index 8606deba5ae..00000000000 --- a/tools/sdk/include/freertos/freertos/list.h +++ /dev/null @@ -1,466 +0,0 @@ -/* - FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd. - All rights reserved - - VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. - - This file is part of the FreeRTOS distribution. - - FreeRTOS is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License (version 2) as published by the - Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. - - *************************************************************************** - >>! NOTE: The modification to the GPL is included to allow you to !<< - >>! distribute a combined work that includes FreeRTOS without being !<< - >>! obliged to provide the source code for proprietary components !<< - >>! outside of the FreeRTOS kernel. !<< - *************************************************************************** - - FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. Full license text is available on the following - link: http://www.freertos.org/a00114.html - - *************************************************************************** - * * - * FreeRTOS provides completely free yet professionally developed, * - * robust, strictly quality controlled, supported, and cross * - * platform software that is more than just the market leader, it * - * is the industry's de facto standard. * - * * - * Help yourself get started quickly while simultaneously helping * - * to support the FreeRTOS project by purchasing a FreeRTOS * - * tutorial book, reference manual, or both: * - * http://www.FreeRTOS.org/Documentation * - * * - *************************************************************************** - - http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading - the FAQ page "My application does not run, what could be wrong?". Have you - defined configASSERT()? - - http://www.FreeRTOS.org/support - In return for receiving this top quality - embedded software for free we request you assist our global community by - participating in the support forum. - - http://www.FreeRTOS.org/training - Investing in training allows your team to - be as productive as possible as early as possible. Now you can receive - FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers - Ltd, and the world's leading authority on the world's leading RTOS. - - http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, - including FreeRTOS+Trace - an indispensable productivity tool, a DOS - compatible FAT file system, and our tiny thread aware UDP/IP stack. - - http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. - Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. - - http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High - Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS - licenses offer ticketed support, indemnification and commercial middleware. - - http://www.SafeRTOS.com - High Integrity Systems also provide a safety - engineered and independently SIL3 certified version for use in safety and - mission critical applications that require provable dependability. - - 1 tab == 4 spaces! -*/ - -/* - * This is the list implementation used by the scheduler. While it is tailored - * heavily for the schedulers needs, it is also available for use by - * application code. - * - * list_ts can only store pointers to list_item_ts. Each ListItem_t contains a - * numeric value (xItemValue). Most of the time the lists are sorted in - * descending item value order. - * - * Lists are created already containing one list item. The value of this - * item is the maximum possible that can be stored, it is therefore always at - * the end of the list and acts as a marker. The list member pxHead always - * points to this marker - even though it is at the tail of the list. This - * is because the tail contains a wrap back pointer to the true head of - * the list. - * - * In addition to it's value, each list item contains a pointer to the next - * item in the list (pxNext), a pointer to the list it is in (pxContainer) - * and a pointer to back to the object that contains it. These later two - * pointers are included for efficiency of list manipulation. There is - * effectively a two way link between the object containing the list item and - * the list item itself. - * - * - * \page ListIntroduction List Implementation - * \ingroup FreeRTOSIntro - */ - -#ifndef INC_FREERTOS_H - #error FreeRTOS.h must be included before list.h -#endif - -#ifndef LIST_H -#define LIST_H - -/* - * The list structure members are modified from within interrupts, and therefore - * by rights should be declared volatile. However, they are only modified in a - * functionally atomic way (within critical sections of with the scheduler - * suspended) and are either passed by reference into a function or indexed via - * a volatile variable. Therefore, in all use cases tested so far, the volatile - * qualifier can be omitted in order to provide a moderate performance - * improvement without adversely affecting functional behaviour. The assembly - * instructions generated by the IAR, ARM and GCC compilers when the respective - * compiler's options were set for maximum optimisation has been inspected and - * deemed to be as intended. That said, as compiler technology advances, and - * especially if aggressive cross module optimisation is used (a use case that - * has not been exercised to any great extend) then it is feasible that the - * volatile qualifier will be needed for correct optimisation. It is expected - * that a compiler removing essential code because, without the volatile - * qualifier on the list structure members and with aggressive cross module - * optimisation, the compiler deemed the code unnecessary will result in - * complete and obvious failure of the scheduler. If this is ever experienced - * then the volatile qualifier can be inserted in the relevant places within the - * list structures by simply defining configLIST_VOLATILE to volatile in - * FreeRTOSConfig.h (as per the example at the bottom of this comment block). - * If configLIST_VOLATILE is not defined then the preprocessor directives below - * will simply #define configLIST_VOLATILE away completely. - * - * To use volatile list structure members then add the following line to - * FreeRTOSConfig.h (without the quotes): - * "#define configLIST_VOLATILE volatile" - */ -#ifndef configLIST_VOLATILE - #define configLIST_VOLATILE -#endif /* configSUPPORT_CROSS_MODULE_OPTIMISATION */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Macros that can be used to place known values within the list structures, -then check that the known values do not get corrupted during the execution of -the application. These may catch the list data structures being overwritten in -memory. They will not catch data errors caused by incorrect configuration or -use of FreeRTOS.*/ -#if( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 0 ) - /* Define the macros to do nothing. */ - #define listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE - #define listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE - #define listFIRST_LIST_INTEGRITY_CHECK_VALUE - #define listSECOND_LIST_INTEGRITY_CHECK_VALUE - #define listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) - #define listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) - #define listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList ) - #define listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList ) - #define listTEST_LIST_ITEM_INTEGRITY( pxItem ) - #define listTEST_LIST_INTEGRITY( pxList ) -#else - /* Define macros that add new members into the list structures. */ - #define listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE TickType_t xListItemIntegrityValue1; - #define listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE TickType_t xListItemIntegrityValue2; - #define listFIRST_LIST_INTEGRITY_CHECK_VALUE TickType_t xListIntegrityValue1; - #define listSECOND_LIST_INTEGRITY_CHECK_VALUE TickType_t xListIntegrityValue2; - - /* Define macros that set the new structure members to known values. */ - #define listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) ( pxItem )->xListItemIntegrityValue1 = pdINTEGRITY_CHECK_VALUE - #define listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) ( pxItem )->xListItemIntegrityValue2 = pdINTEGRITY_CHECK_VALUE - #define listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList ) ( pxList )->xListIntegrityValue1 = pdINTEGRITY_CHECK_VALUE - #define listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList ) ( pxList )->xListIntegrityValue2 = pdINTEGRITY_CHECK_VALUE - - /* Define macros that will assert if one of the structure members does not - contain its expected value. */ - #define listTEST_LIST_ITEM_INTEGRITY( pxItem ) configASSERT( ( ( pxItem )->xListItemIntegrityValue1 == pdINTEGRITY_CHECK_VALUE ) && ( ( pxItem )->xListItemIntegrityValue2 == pdINTEGRITY_CHECK_VALUE ) ) - #define listTEST_LIST_INTEGRITY( pxList ) configASSERT( ( ( pxList )->xListIntegrityValue1 == pdINTEGRITY_CHECK_VALUE ) && ( ( pxList )->xListIntegrityValue2 == pdINTEGRITY_CHECK_VALUE ) ) -#endif /* configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES */ - - -/* - * Definition of the only type of object that a list can contain. - */ -struct xLIST_ITEM -{ - listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */ - configLIST_VOLATILE TickType_t xItemValue; /*< The value being listed. In most cases this is used to sort the list in descending order. */ - struct xLIST_ITEM * configLIST_VOLATILE pxNext; /*< Pointer to the next ListItem_t in the list. */ - struct xLIST_ITEM * configLIST_VOLATILE pxPrevious; /*< Pointer to the previous ListItem_t in the list. */ - void * pvOwner; /*< Pointer to the object (normally a TCB) that contains the list item. There is therefore a two way link between the object containing the list item and the list item itself. */ - void * configLIST_VOLATILE pvContainer; /*< Pointer to the list in which this list item is placed (if any). */ - listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */ -}; -typedef struct xLIST_ITEM ListItem_t; /* For some reason lint wants this as two separate definitions. */ - -#if __GNUC_PREREQ(4, 6) -_Static_assert(sizeof(StaticListItem_t) == sizeof(ListItem_t), "StaticListItem_t != ListItem_t"); -#endif - -struct xMINI_LIST_ITEM -{ - listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */ - configLIST_VOLATILE TickType_t xItemValue; - struct xLIST_ITEM * configLIST_VOLATILE pxNext; - struct xLIST_ITEM * configLIST_VOLATILE pxPrevious; -}; -typedef struct xMINI_LIST_ITEM MiniListItem_t; - -#if __GNUC_PREREQ(4, 6) -_Static_assert(sizeof(StaticMiniListItem_t) == sizeof(MiniListItem_t), "StaticMiniListItem_t != MiniListItem_t"); -#endif - - -/* - * Definition of the type of queue used by the scheduler. - */ -typedef struct xLIST -{ - listFIRST_LIST_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */ - configLIST_VOLATILE UBaseType_t uxNumberOfItems; - ListItem_t * configLIST_VOLATILE pxIndex; /*< Used to walk through the list. Points to the last item returned by a call to listGET_OWNER_OF_NEXT_ENTRY (). */ - MiniListItem_t xListEnd; /*< List item that contains the maximum possible item value meaning it is always at the end of the list and is therefore used as a marker. */ - listSECOND_LIST_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */ -} List_t; - -#if __GNUC_PREREQ(4, 6) -_Static_assert(sizeof(StaticList_t) == sizeof(List_t), "StaticList_t != List_t"); -#endif - -/* - * Access macro to set the owner of a list item. The owner of a list item - * is the object (usually a TCB) that contains the list item. - * - * \page listSET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER - * \ingroup LinkedList - */ -#define listSET_LIST_ITEM_OWNER( pxListItem, pxOwner ) ( ( pxListItem )->pvOwner = ( void * ) ( pxOwner ) ) - -/* - * Access macro to get the owner of a list item. The owner of a list item - * is the object (usually a TCB) that contains the list item. - * - * \page listSET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER - * \ingroup LinkedList - */ -#define listGET_LIST_ITEM_OWNER( pxListItem ) ( ( pxListItem )->pvOwner ) - -/* - * Access macro to set the value of the list item. In most cases the value is - * used to sort the list in descending order. - * - * \page listSET_LIST_ITEM_VALUE listSET_LIST_ITEM_VALUE - * \ingroup LinkedList - */ -#define listSET_LIST_ITEM_VALUE( pxListItem, xValue ) ( ( pxListItem )->xItemValue = ( xValue ) ) - -/* - * Access macro to retrieve the value of the list item. The value can - * represent anything - for example the priority of a task, or the time at - * which a task should be unblocked. - * - * \page listGET_LIST_ITEM_VALUE listGET_LIST_ITEM_VALUE - * \ingroup LinkedList - */ -#define listGET_LIST_ITEM_VALUE( pxListItem ) ( ( pxListItem )->xItemValue ) - -/* - * Access macro to retrieve the value of the list item at the head of a given - * list. - * - * \page listGET_LIST_ITEM_VALUE listGET_LIST_ITEM_VALUE - * \ingroup LinkedList - */ -#define listGET_ITEM_VALUE_OF_HEAD_ENTRY( pxList ) ( ( ( pxList )->xListEnd ).pxNext->xItemValue ) - -/* - * Return the list item at the head of the list. - * - * \page listGET_HEAD_ENTRY listGET_HEAD_ENTRY - * \ingroup LinkedList - */ -#define listGET_HEAD_ENTRY( pxList ) ( ( ( pxList )->xListEnd ).pxNext ) - -/* - * Return the list item at the head of the list. - * - * \page listGET_NEXT listGET_NEXT - * \ingroup LinkedList - */ -#define listGET_NEXT( pxListItem ) ( ( pxListItem )->pxNext ) - -/* - * Return the list item that marks the end of the list - * - * \page listGET_END_MARKER listGET_END_MARKER - * \ingroup LinkedList - */ -#define listGET_END_MARKER( pxList ) ( ( ListItem_t const * ) ( &( ( pxList )->xListEnd ) ) ) - -/* - * Access macro to determine if a list contains any items. The macro will - * only have the value true if the list is empty. - * - * \page listLIST_IS_EMPTY listLIST_IS_EMPTY - * \ingroup LinkedList - */ -#define listLIST_IS_EMPTY( pxList ) ( ( BaseType_t ) ( ( pxList )->uxNumberOfItems == ( UBaseType_t ) 0 ) ) - -/* - * Access macro to return the number of items in the list. - */ -#define listCURRENT_LIST_LENGTH( pxList ) ( ( pxList )->uxNumberOfItems ) - -/* - * Access function to obtain the owner of the next entry in a list. - * - * The list member pxIndex is used to walk through a list. Calling - * listGET_OWNER_OF_NEXT_ENTRY increments pxIndex to the next item in the list - * and returns that entry's pxOwner parameter. Using multiple calls to this - * function it is therefore possible to move through every item contained in - * a list. - * - * The pxOwner parameter of a list item is a pointer to the object that owns - * the list item. In the scheduler this is normally a task control block. - * The pxOwner parameter effectively creates a two way link between the list - * item and its owner. - * - * @param pxTCB pxTCB is set to the address of the owner of the next list item. - * @param pxList The list from which the next item owner is to be returned. - * - * \page listGET_OWNER_OF_NEXT_ENTRY listGET_OWNER_OF_NEXT_ENTRY - * \ingroup LinkedList - */ -#define listGET_OWNER_OF_NEXT_ENTRY( pxTCB, pxList ) \ -{ \ -List_t * const pxConstList = ( pxList ); \ - /* Increment the index to the next item and return the item, ensuring */ \ - /* we don't return the marker used at the end of the list. */ \ - ( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \ - if( ( void * ) ( pxConstList )->pxIndex == ( void * ) &( ( pxConstList )->xListEnd ) ) \ - { \ - ( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \ - } \ - ( pxTCB ) = ( pxConstList )->pxIndex->pvOwner; \ -} - - -/* - * Access function to obtain the owner of the first entry in a list. Lists - * are normally sorted in ascending item value order. - * - * This function returns the pxOwner member of the first item in the list. - * The pxOwner parameter of a list item is a pointer to the object that owns - * the list item. In the scheduler this is normally a task control block. - * The pxOwner parameter effectively creates a two way link between the list - * item and its owner. - * - * @param pxList The list from which the owner of the head item is to be - * returned. - * - * \page listGET_OWNER_OF_HEAD_ENTRY listGET_OWNER_OF_HEAD_ENTRY - * \ingroup LinkedList - */ -#define listGET_OWNER_OF_HEAD_ENTRY( pxList ) ( (&( ( pxList )->xListEnd ))->pxNext->pvOwner ) - -/* - * Check to see if a list item is within a list. The list item maintains a - * "container" pointer that points to the list it is in. All this macro does - * is check to see if the container and the list match. - * - * @param pxList The list we want to know if the list item is within. - * @param pxListItem The list item we want to know if is in the list. - * @return pdTRUE if the list item is in the list, otherwise pdFALSE. - */ -#define listIS_CONTAINED_WITHIN( pxList, pxListItem ) ( ( BaseType_t ) ( ( pxListItem )->pvContainer == ( void * ) ( pxList ) ) ) - -/* - * Return the list a list item is contained within (referenced from). - * - * @param pxListItem The list item being queried. - * @return A pointer to the List_t object that references the pxListItem - */ -#define listLIST_ITEM_CONTAINER( pxListItem ) ( ( pxListItem )->pvContainer ) - -/* - * This provides a crude means of knowing if a list has been initialised, as - * pxList->xListEnd.xItemValue is set to portMAX_DELAY by the vListInitialise() - * function. - */ -#define listLIST_IS_INITIALISED( pxList ) ( ( pxList )->xListEnd.xItemValue == portMAX_DELAY ) - -/* - * Must be called before a list is used! This initialises all the members - * of the list structure and inserts the xListEnd item into the list as a - * marker to the back of the list. - * - * @param pxList Pointer to the list being initialised. - * - * \page vListInitialise vListInitialise - * \ingroup LinkedList - */ -void vListInitialise( List_t * const pxList ); - -/* - * Must be called before a list item is used. This sets the list container to - * null so the item does not think that it is already contained in a list. - * - * @param pxItem Pointer to the list item being initialised. - * - * \page vListInitialiseItem vListInitialiseItem - * \ingroup LinkedList - */ -void vListInitialiseItem( ListItem_t * const pxItem ); - -/* - * Insert a list item into a list. The item will be inserted into the list in - * a position determined by its item value (descending item value order). - * - * @param pxList The list into which the item is to be inserted. - * - * @param pxNewListItem The item that is to be placed in the list. - * - * \page vListInsert vListInsert - * \ingroup LinkedList - */ -void vListInsert( List_t * const pxList, ListItem_t * const pxNewListItem ); - -/* - * Insert a list item into a list. The item will be inserted in a position - * such that it will be the last item within the list returned by multiple - * calls to listGET_OWNER_OF_NEXT_ENTRY. - * - * The list member pvIndex is used to walk through a list. Calling - * listGET_OWNER_OF_NEXT_ENTRY increments pvIndex to the next item in the list. - * Placing an item in a list using vListInsertEnd effectively places the item - * in the list position pointed to by pvIndex. This means that every other - * item within the list will be returned by listGET_OWNER_OF_NEXT_ENTRY before - * the pvIndex parameter again points to the item being inserted. - * - * @param pxList The list into which the item is to be inserted. - * - * @param pxNewListItem The list item to be inserted into the list. - * - * \page vListInsertEnd vListInsertEnd - * \ingroup LinkedList - */ -void vListInsertEnd( List_t * const pxList, ListItem_t * const pxNewListItem ); - -/* - * Remove an item from a list. The list item has a pointer to the list that - * it is in, so only the list item need be passed into the function. - * - * @param uxListRemove The item to be removed. The item will remove itself from - * the list pointed to by it's pxContainer parameter. - * - * @return The number of items that remain in the list after the list item has - * been removed. - * - * \page uxListRemove uxListRemove - * \ingroup LinkedList - */ -UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove ); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/tools/sdk/include/freertos/freertos/mpu_wrappers.h b/tools/sdk/include/freertos/freertos/mpu_wrappers.h deleted file mode 100644 index 504f6d934da..00000000000 --- a/tools/sdk/include/freertos/freertos/mpu_wrappers.h +++ /dev/null @@ -1,157 +0,0 @@ -/* - FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd. - All rights reserved - - VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. - - This file is part of the FreeRTOS distribution. - - FreeRTOS is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License (version 2) as published by the - Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. - - *************************************************************************** - >>! NOTE: The modification to the GPL is included to allow you to !<< - >>! distribute a combined work that includes FreeRTOS without being !<< - >>! obliged to provide the source code for proprietary components !<< - >>! outside of the FreeRTOS kernel. !<< - *************************************************************************** - - FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. Full license text is available on the following - link: http://www.freertos.org/a00114.html - - *************************************************************************** - * * - * FreeRTOS provides completely free yet professionally developed, * - * robust, strictly quality controlled, supported, and cross * - * platform software that is more than just the market leader, it * - * is the industry's de facto standard. * - * * - * Help yourself get started quickly while simultaneously helping * - * to support the FreeRTOS project by purchasing a FreeRTOS * - * tutorial book, reference manual, or both: * - * http://www.FreeRTOS.org/Documentation * - * * - *************************************************************************** - - http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading - the FAQ page "My application does not run, what could be wrong?". Have you - defined configASSERT()? - - http://www.FreeRTOS.org/support - In return for receiving this top quality - embedded software for free we request you assist our global community by - participating in the support forum. - - http://www.FreeRTOS.org/training - Investing in training allows your team to - be as productive as possible as early as possible. Now you can receive - FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers - Ltd, and the world's leading authority on the world's leading RTOS. - - http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, - including FreeRTOS+Trace - an indispensable productivity tool, a DOS - compatible FAT file system, and our tiny thread aware UDP/IP stack. - - http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. - Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. - - http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High - Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS - licenses offer ticketed support, indemnification and commercial middleware. - - http://www.SafeRTOS.com - High Integrity Systems also provide a safety - engineered and independently SIL3 certified version for use in safety and - mission critical applications that require provable dependability. - - 1 tab == 4 spaces! -*/ - -#ifndef MPU_WRAPPERS_H -#define MPU_WRAPPERS_H - -/* This file redefines API functions to be called through a wrapper macro, but -only for ports that are using the MPU. */ -#if portUSING_MPU_WRAPPERS - - /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE will be defined when this file is - included from queue.c or task.c to prevent it from having an effect within - those files. */ - #ifndef MPU_WRAPPERS_INCLUDED_FROM_API_FILE - - #define xTaskGenericCreate MPU_xTaskGenericCreate - #define vTaskAllocateMPURegions MPU_vTaskAllocateMPURegions - #define vTaskDelete MPU_vTaskDelete - #define vTaskDelayUntil MPU_vTaskDelayUntil - #define vTaskDelay MPU_vTaskDelay - #define uxTaskPriorityGet MPU_uxTaskPriorityGet - #define vTaskPrioritySet MPU_vTaskPrioritySet - #define eTaskGetState MPU_eTaskGetState - #define vTaskSuspend MPU_vTaskSuspend - #define vTaskResume MPU_vTaskResume - #define vTaskSuspendAll MPU_vTaskSuspendAll - #define xTaskResumeAll MPU_xTaskResumeAll - #define xTaskGetTickCount MPU_xTaskGetTickCount - #define uxTaskGetNumberOfTasks MPU_uxTaskGetNumberOfTasks - #define vTaskList MPU_vTaskList - #define vTaskGetRunTimeStats MPU_vTaskGetRunTimeStats - #define vTaskSetApplicationTaskTag MPU_vTaskSetApplicationTaskTag - #define xTaskGetApplicationTaskTag MPU_xTaskGetApplicationTaskTag - #define xTaskCallApplicationTaskHook MPU_xTaskCallApplicationTaskHook - #define uxTaskGetStackHighWaterMark MPU_uxTaskGetStackHighWaterMark - #define xTaskGetCurrentTaskHandle MPU_xTaskGetCurrentTaskHandle - #define xTaskGetSchedulerState MPU_xTaskGetSchedulerState - #define xTaskGetIdleTaskHandle MPU_xTaskGetIdleTaskHandle - #define uxTaskGetSystemState MPU_uxTaskGetSystemState - - #define xQueueGenericCreate MPU_xQueueGenericCreate - #define xQueueCreateMutex MPU_xQueueCreateMutex - #define xQueueGiveMutexRecursive MPU_xQueueGiveMutexRecursive - #define xQueueTakeMutexRecursive MPU_xQueueTakeMutexRecursive - #define xQueueCreateCountingSemaphore MPU_xQueueCreateCountingSemaphore - #define xQueueGenericSend MPU_xQueueGenericSend - #define xQueueAltGenericSend MPU_xQueueAltGenericSend - #define xQueueAltGenericReceive MPU_xQueueAltGenericReceive - #define xQueueGenericReceive MPU_xQueueGenericReceive - #define uxQueueMessagesWaiting MPU_uxQueueMessagesWaiting - #define vQueueDelete MPU_vQueueDelete - #define xQueueGenericReset MPU_xQueueGenericReset - #define xQueueCreateSet MPU_xQueueCreateSet - #define xQueueSelectFromSet MPU_xQueueSelectFromSet - #define xQueueAddToSet MPU_xQueueAddToSet - #define xQueueRemoveFromSet MPU_xQueueRemoveFromSet - #define xQueuePeekFromISR MPU_xQueuePeekFromISR - #define xQueueGetMutexHolder MPU_xQueueGetMutexHolder - - #define pvPortMalloc MPU_pvPortMalloc - #define vPortFree MPU_vPortFree - #define xPortGetFreeHeapSize MPU_xPortGetFreeHeapSize - #define vPortInitialiseBlocks MPU_vPortInitialiseBlocks - - #if configQUEUE_REGISTRY_SIZE > 0 - #define vQueueAddToRegistry MPU_vQueueAddToRegistry - #define vQueueUnregisterQueue MPU_vQueueUnregisterQueue - #endif - - /* Remove the privileged function macro. */ - #define PRIVILEGED_FUNCTION - - #else /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */ - - /* Ensure API functions go in the privileged execution section. */ - #define PRIVILEGED_FUNCTION __attribute__((section("privileged_functions"))) - #define PRIVILEGED_DATA __attribute__((section("privileged_data"))) - - #endif /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */ - -#else /* portUSING_MPU_WRAPPERS */ - - #define PRIVILEGED_FUNCTION - #define PRIVILEGED_DATA - #define portUSING_MPU_WRAPPERS 0 - -#endif /* portUSING_MPU_WRAPPERS */ - - -#endif /* MPU_WRAPPERS_H */ - diff --git a/tools/sdk/include/freertos/freertos/portable.h b/tools/sdk/include/freertos/freertos/portable.h deleted file mode 100644 index ce189f31cde..00000000000 --- a/tools/sdk/include/freertos/freertos/portable.h +++ /dev/null @@ -1,225 +0,0 @@ -/* - FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd. - All rights reserved - - VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. - - This file is part of the FreeRTOS distribution. - - FreeRTOS is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License (version 2) as published by the - Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. - - *************************************************************************** - >>! NOTE: The modification to the GPL is included to allow you to !<< - >>! distribute a combined work that includes FreeRTOS without being !<< - >>! obliged to provide the source code for proprietary components !<< - >>! outside of the FreeRTOS kernel. !<< - *************************************************************************** - - FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. Full license text is available on the following - link: http://www.freertos.org/a00114.html - - *************************************************************************** - * * - * FreeRTOS provides completely free yet professionally developed, * - * robust, strictly quality controlled, supported, and cross * - * platform software that is more than just the market leader, it * - * is the industry's de facto standard. * - * * - * Help yourself get started quickly while simultaneously helping * - * to support the FreeRTOS project by purchasing a FreeRTOS * - * tutorial book, reference manual, or both: * - * http://www.FreeRTOS.org/Documentation * - * * - *************************************************************************** - - http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading - the FAQ page "My application does not run, what could be wrong?". Have you - defined configASSERT()? - - http://www.FreeRTOS.org/support - In return for receiving this top quality - embedded software for free we request you assist our global community by - participating in the support forum. - - http://www.FreeRTOS.org/training - Investing in training allows your team to - be as productive as possible as early as possible. Now you can receive - FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers - Ltd, and the world's leading authority on the world's leading RTOS. - - http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, - including FreeRTOS+Trace - an indispensable productivity tool, a DOS - compatible FAT file system, and our tiny thread aware UDP/IP stack. - - http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. - Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. - - http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High - Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS - licenses offer ticketed support, indemnification and commercial middleware. - - http://www.SafeRTOS.com - High Integrity Systems also provide a safety - engineered and independently SIL3 certified version for use in safety and - mission critical applications that require provable dependability. - - 1 tab == 4 spaces! -*/ - -/*----------------------------------------------------------- - * Portable layer API. Each function must be defined for each port. - *----------------------------------------------------------*/ - -#ifndef PORTABLE_H -#define PORTABLE_H - -/* Each FreeRTOS port has a unique portmacro.h header file. Originally a -pre-processor definition was used to ensure the pre-processor found the correct -portmacro.h file for the port being used. That scheme was deprecated in favour -of setting the compiler's include path such that it found the correct -portmacro.h file - removing the need for the constant and allowing the -portmacro.h file to be located anywhere in relation to the port being used. -Purely for reasons of backward compatibility the old method is still valid, but -to make it clear that new projects should not use it, support for the port -specific constants has been moved into the deprecated_definitions.h header -file. */ -#include "deprecated_definitions.h" - -/* If portENTER_CRITICAL is not defined then including deprecated_definitions.h -did not result in a portmacro.h header file being included - and it should be -included here. In this case the path to the correct portmacro.h header file -must be set in the compiler's include path. */ -#ifndef portENTER_CRITICAL - #include "portmacro.h" -#endif - -#if portBYTE_ALIGNMENT == 8 - #define portBYTE_ALIGNMENT_MASK ( 0x0007U ) -#endif - -#if portBYTE_ALIGNMENT == 4 - #define portBYTE_ALIGNMENT_MASK ( 0x0003 ) -#endif - -#if portBYTE_ALIGNMENT == 2 - #define portBYTE_ALIGNMENT_MASK ( 0x0001 ) -#endif - -#if portBYTE_ALIGNMENT == 1 - #define portBYTE_ALIGNMENT_MASK ( 0x0000 ) -#endif - -#ifndef portBYTE_ALIGNMENT_MASK - #error "Invalid portBYTE_ALIGNMENT definition" -#endif - -#ifndef portNUM_CONFIGURABLE_REGIONS - #define portNUM_CONFIGURABLE_REGIONS 1 -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#include "mpu_wrappers.h" -#include "esp_system.h" - -/* - * Setup the stack of a new task so it is ready to be placed under the - * scheduler control. The registers have to be placed on the stack in - * the order that the port expects to find them. - * - */ -#if( portUSING_MPU_WRAPPERS == 1 ) - StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters, BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION; -#else - StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters ) PRIVILEGED_FUNCTION; -#endif - -/* - * Map to the memory management routines required for the port. - * - * Note that libc standard malloc/free are also available for - * non-FreeRTOS-specific code, and behave the same as - * pvPortMalloc()/vPortFree(). - */ -#define pvPortMalloc malloc -#define vPortFree free -#define xPortGetFreeHeapSize esp_get_free_heap_size -#define xPortGetMinimumEverFreeHeapSize esp_get_minimum_free_heap_size - -/* - * Setup the hardware ready for the scheduler to take control. This generally - * sets up a tick interrupt and sets timers for the correct tick frequency. - */ -BaseType_t xPortStartScheduler( void ) PRIVILEGED_FUNCTION; - -/* - * Undo any hardware/ISR setup that was performed by xPortStartScheduler() so - * the hardware is left in its original condition after the scheduler stops - * executing. - */ -void vPortEndScheduler( void ) PRIVILEGED_FUNCTION; - - -/* - * Send an interrupt to another core in order to make the task running - * on it yield for a higher-priority task. - */ - -void vPortYieldOtherCore( BaseType_t coreid) PRIVILEGED_FUNCTION; - - -/* - Callback to set a watchpoint on the end of the stack. Called every context switch to change the stack - watchpoint around. - */ -void vPortSetStackWatchpoint( void* pxStackStart ); - -/* - * Returns true if the current core is in ISR context; low prio ISR, med prio ISR or timer tick ISR. High prio ISRs - * aren't detected here, but they normally cannot call C code, so that should not be an issue anyway. - */ -BaseType_t xPortInIsrContext(); - -/* - * This function will be called in High prio ISRs. Returns true if the current core was in ISR context - * before calling into high prio ISR context. - */ -BaseType_t xPortInterruptedFromISRContext(); - -/* - * The structures and methods of manipulating the MPU are contained within the - * port layer. - * - * Fills the xMPUSettings structure with the memory region information - * contained in xRegions. - */ -#if( portUSING_MPU_WRAPPERS == 1 ) - struct xMEMORY_REGION; - void vPortStoreTaskMPUSettings( xMPU_SETTINGS *xMPUSettings, const struct xMEMORY_REGION * const xRegions, StackType_t *pxBottomOfStack, uint32_t usStackDepth ) PRIVILEGED_FUNCTION; - void vPortReleaseTaskMPUSettings( xMPU_SETTINGS *xMPUSettings ); -#endif - -/* Multi-core: get current core ID */ -static inline uint32_t IRAM_ATTR xPortGetCoreID() { - int id; - __asm__ __volatile__ ( - "rsr.prid %0\n" - " extui %0,%0,13,1" - :"=r"(id)); - return id; -} - -/* Get tick rate per second */ -uint32_t xPortGetTickRateHz(void); - -#ifdef __cplusplus -} -#endif - -void uxPortCompareSetExtram(volatile uint32_t *addr, uint32_t compare, uint32_t *set); - -#endif /* PORTABLE_H */ - diff --git a/tools/sdk/include/freertos/freertos/portbenchmark.h b/tools/sdk/include/freertos/freertos/portbenchmark.h deleted file mode 100644 index 4ce41d3dad8..00000000000 --- a/tools/sdk/include/freertos/freertos/portbenchmark.h +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* -// Copyright (c) 2003-2015 Cadence Design Systems, Inc. -// -// 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 utility helps benchmarking interrupt latency and context switches. - * In order to enable it, set configBENCHMARK to 1 in FreeRTOSConfig.h. - * You will also need to download the FreeRTOS_trace patch that contains - * portbenchmark.c and the complete version of portbenchmark.h - */ - -#ifndef PORTBENCHMARK_H -#define PORTBENCHMARK_H - -#if configBENCHMARK - #error "You need to download the FreeRTOS_trace patch that overwrites this file" -#endif - -#define portbenchmarkINTERRUPT_DISABLE() -#define portbenchmarkINTERRUPT_RESTORE(newstate) -#define portbenchmarkIntLatency() -#define portbenchmarkIntWait() -#define portbenchmarkReset() -#define portbenchmarkPrint() - -#endif /* PORTBENCHMARK */ diff --git a/tools/sdk/include/freertos/freertos/portmacro.h b/tools/sdk/include/freertos/freertos/portmacro.h deleted file mode 100644 index adeb3bb0097..00000000000 --- a/tools/sdk/include/freertos/freertos/portmacro.h +++ /dev/null @@ -1,402 +0,0 @@ -/* - FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd. - All rights reserved - - VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. - - *************************************************************************** - * * - * FreeRTOS provides completely free yet professionally developed, * - * robust, strictly quality controlled, supported, and cross * - * platform software that has become a de facto standard. * - * * - * Help yourself get started quickly and support the FreeRTOS * - * project by purchasing a FreeRTOS tutorial book, reference * - * manual, or both from: http://www.FreeRTOS.org/Documentation * - * * - * Thank you! * - * * - *************************************************************************** - - This file is part of the FreeRTOS distribution. - - FreeRTOS is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License (version 2) as published by the - Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. - - >>! NOTE: The modification to the GPL is included to allow you to !<< - >>! distribute a combined work that includes FreeRTOS without being !<< - >>! obliged to provide the source code for proprietary components !<< - >>! outside of the FreeRTOS kernel. !<< - - FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. Full license text is available from the following - link: http://www.freertos.org/a00114.html - - 1 tab == 4 spaces! - - *************************************************************************** - * * - * Having a problem? Start by reading the FAQ "My application does * - * not run, what could be wrong?" * - * * - * http://www.FreeRTOS.org/FAQHelp.html * - * * - *************************************************************************** - - http://www.FreeRTOS.org - Documentation, books, training, latest versions, - license and Real Time Engineers Ltd. contact details. - - http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, - including FreeRTOS+Trace - an indispensable productivity tool, a DOS - compatible FAT file system, and our tiny thread aware UDP/IP stack. - - http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High - Integrity Systems to sell under the OpenRTOS brand. Low cost OpenRTOS - licenses offer ticketed support, indemnification and middleware. - - http://www.SafeRTOS.com - High Integrity Systems also provide a safety - engineered and independently SIL3 certified version for use in safety and - mission critical applications that require provable dependability. - - 1 tab == 4 spaces! -*/ - -#ifndef PORTMACRO_H -#define PORTMACRO_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef __ASSEMBLER__ - -#include - -#include -#include -#include /* required for XSHAL_CLIB */ -#include -#include "esp_crosscore_int.h" -#include "esp_timer.h" /* required for FreeRTOS run time stats */ - - -#include -#include "soc/soc_memory_layout.h" - -//#include "xtensa_context.h" - -/*----------------------------------------------------------- - * Port specific definitions. - * - * The settings in this file configure FreeRTOS correctly for the - * given hardware and compiler. - * - * These settings should not be altered. - *----------------------------------------------------------- - */ - -/* Type definitions. */ - -#define portCHAR int8_t -#define portFLOAT float -#define portDOUBLE double -#define portLONG int32_t -#define portSHORT int16_t -#define portSTACK_TYPE uint8_t -#define portBASE_TYPE int - -typedef portSTACK_TYPE StackType_t; -typedef portBASE_TYPE BaseType_t; -typedef unsigned portBASE_TYPE UBaseType_t; - -#if( configUSE_16_BIT_TICKS == 1 ) - typedef uint16_t TickType_t; - #define portMAX_DELAY ( TickType_t ) 0xffff -#else - typedef uint32_t TickType_t; - #define portMAX_DELAY ( TickType_t ) 0xffffffffUL -#endif -/*-----------------------------------------------------------*/ - -// portbenchmark -#include "portbenchmark.h" - -#include "sdkconfig.h" -#include "esp_attr.h" - -/* "mux" data structure (spinlock) */ -typedef struct { - /* owner field values: - * 0 - Uninitialized (invalid) - * portMUX_FREE_VAL - Mux is free, can be locked by either CPU - * CORE_ID_PRO / CORE_ID_APP - Mux is locked to the particular core - * - * Any value other than portMUX_FREE_VAL, CORE_ID_PRO, CORE_ID_APP indicates corruption - */ - uint32_t owner; - /* count field: - * If mux is unlocked, count should be zero. - * If mux is locked, count is non-zero & represents the number of recursive locks on the mux. - */ - uint32_t count; -#ifdef CONFIG_FREERTOS_PORTMUX_DEBUG - const char *lastLockedFn; - int lastLockedLine; -#endif -} portMUX_TYPE; - -#define portMUX_FREE_VAL 0xB33FFFFF - -/* Special constants for vPortCPUAcquireMutexTimeout() */ -#define portMUX_NO_TIMEOUT (-1) /* When passed for 'timeout_cycles', spin forever if necessary */ -#define portMUX_TRY_LOCK 0 /* Try to acquire the spinlock a single time only */ - -// Keep this in sync with the portMUX_TYPE struct definition please. -#ifndef CONFIG_FREERTOS_PORTMUX_DEBUG -#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 - - -#define portASSERT_IF_IN_ISR() vPortAssertIfInISR() -void vPortAssertIfInISR(); - -#define portCRITICAL_NESTING_IN_TCB 1 - -/* -Modifications to portENTER_CRITICAL. - -For an introduction, see "Critical Sections & Disabling Interrupts" in docs/api-guides/freertos-smp.rst - -The original portENTER_CRITICAL only disabled the ISRs. This is enough for single-CPU operation: by -disabling the interrupts, there is no task switch so no other tasks can meddle in the data, and because -interrupts are disabled, ISRs can't corrupt data structures either. - -For multiprocessing, things get a bit more hairy. First of all, disabling the interrupts doesn't stop -the tasks or ISRs on the other processors meddling with our CPU. For tasks, this is solved by adding -a spinlock to the portENTER_CRITICAL macro. A task running on the other CPU accessing the same data will -spinlock in the portENTER_CRITICAL code until the first CPU is done. - -For ISRs, we now also need muxes: while portENTER_CRITICAL disabling interrupts will stop ISRs on the same -CPU from meddling with the data, it does not stop interrupts on the other cores from interfering with the -data. For this, we also use a spinlock in the routines called by the ISR, but these spinlocks -do not disable the interrupts (because they already are). - -This all assumes that interrupts are either entirely disabled or enabled. Interrupt priority levels -will break this scheme. - -Remark: For the ESP32, portENTER_CRITICAL and portENTER_CRITICAL_ISR both alias vTaskEnterCritical, meaning -that either function can be called both from ISR as well as task context. This is not standard FreeRTOS -behaviour; please keep this in mind if you need any compatibility with other FreeRTOS implementations. -*/ -void vPortCPUInitializeMutex(portMUX_TYPE *mux); -#ifdef CONFIG_FREERTOS_PORTMUX_DEBUG -void vPortCPUAcquireMutex(portMUX_TYPE *mux, const char *function, int line); -bool vPortCPUAcquireMutexTimeout(portMUX_TYPE *mux, int timeout_cycles, const char *function, int line); -void vPortCPUReleaseMutex(portMUX_TYPE *mux, const char *function, int line); - - -void vTaskEnterCritical( portMUX_TYPE *mux, const char *function, int line ); -void vTaskExitCritical( portMUX_TYPE *mux, const char *function, int line ); -#define portENTER_CRITICAL(mux) vTaskEnterCritical(mux, __FUNCTION__, __LINE__) -#define portEXIT_CRITICAL(mux) vTaskExitCritical(mux, __FUNCTION__, __LINE__) -#define portENTER_CRITICAL_ISR(mux) vTaskEnterCritical(mux, __FUNCTION__, __LINE__) -#define portEXIT_CRITICAL_ISR(mux) vTaskExitCritical(mux, __FUNCTION__, __LINE__) -#else -void vTaskExitCritical( portMUX_TYPE *mux ); -void vTaskEnterCritical( portMUX_TYPE *mux ); -void vPortCPUAcquireMutex(portMUX_TYPE *mux); - -/** @brief Acquire a portmux spinlock with a timeout - * - * @param mux Pointer to portmux to acquire. - * @param timeout_cycles Timeout to spin, in CPU cycles. Pass portMUX_NO_TIMEOUT to wait forever, - * portMUX_TRY_LOCK to try a single time to acquire the lock. - * - * @return true if mutex is successfully acquired, false on timeout. - */ -bool vPortCPUAcquireMutexTimeout(portMUX_TYPE *mux, int timeout_cycles); -void vPortCPUReleaseMutex(portMUX_TYPE *mux); - -#define portENTER_CRITICAL(mux) vTaskEnterCritical(mux) -#define portEXIT_CRITICAL(mux) vTaskExitCritical(mux) -#define portENTER_CRITICAL_ISR(mux) vTaskEnterCritical(mux) -#define portEXIT_CRITICAL_ISR(mux) vTaskExitCritical(mux) -#endif - -// Critical section management. NW-TODO: replace XTOS_SET_INTLEVEL with more efficient version, if any? -// These cannot be nested. They should be used with a lot of care and cannot be called from interrupt level. -// -// Only applies to one CPU. See notes above & below for reasons not to use these. -#define portDISABLE_INTERRUPTS() do { XTOS_SET_INTLEVEL(XCHAL_EXCM_LEVEL); portbenchmarkINTERRUPT_DISABLE(); } while (0) -#define portENABLE_INTERRUPTS() do { portbenchmarkINTERRUPT_RESTORE(0); XTOS_SET_INTLEVEL(0); } while (0) - -// 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. See notes above. -static inline unsigned portENTER_CRITICAL_NESTED() { - unsigned state = XTOS_SET_INTLEVEL(XCHAL_EXCM_LEVEL); - portbenchmarkINTERRUPT_DISABLE(); - return state; -} -#define portEXIT_CRITICAL_NESTED(state) do { portbenchmarkINTERRUPT_RESTORE(state); XTOS_RESTORE_JUST_INTLEVEL(state); } while (0) - -// These FreeRTOS versions are similar to the nested versions above -#define portSET_INTERRUPT_MASK_FROM_ISR() portENTER_CRITICAL_NESTED() -#define portCLEAR_INTERRUPT_MASK_FROM_ISR(state) portEXIT_CRITICAL_NESTED(state) - -//Because the ROM routines don't necessarily handle a stack in external RAM correctly, we force -//the stack memory to always be internal. -#define portTcbMemoryCaps (MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT) -#define portStackMemoryCaps (MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT) - -#define pvPortMallocTcbMem(size) heap_caps_malloc(size, portTcbMemoryCaps) -#define pvPortMallocStackMem(size) heap_caps_malloc(size, portStackMemoryCaps) - -//xTaskCreateStatic uses these functions to check incoming memory. -#define portVALID_TCB_MEM(ptr) (esp_ptr_internal(ptr) && esp_ptr_byte_accessible(ptr)) -#ifdef CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY -#define portVALID_STACK_MEM(ptr) esp_ptr_byte_accessible(ptr) -#else -#define portVALID_STACK_MEM(ptr) (esp_ptr_internal(ptr) && esp_ptr_byte_accessible(ptr)) -#endif - -/* - * Wrapper for the Xtensa 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). - */ -static inline void uxPortCompareSet(volatile uint32_t *addr, uint32_t compare, uint32_t *set) { - __asm__ __volatile__ ( - "WSR %2,SCOMPARE1 \n" - "S32C1I %0, %1, 0 \n" - :"=r"(*set) - :"r"(addr), "r"(compare), "0"(*set) - ); -} - - -/*-----------------------------------------------------------*/ - -/* Architecture specifics. */ -#define portSTACK_GROWTH ( -1 ) -#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ ) -#define portBYTE_ALIGNMENT 4 -#define portNOP() XT_NOP() -/*-----------------------------------------------------------*/ - -/* Fine resolution time */ -#define portGET_RUN_TIME_COUNTER_VALUE() xthal_get_ccount() -//ccount or esp_timer are initialized elsewhere -#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() - -#ifdef CONFIG_FREERTOS_RUN_TIME_STATS_USING_ESP_TIMER -/* Coarse resolution time (us) */ -#define portALT_GET_RUN_TIME_COUNTER_VALUE(x) x = (uint32_t)esp_timer_get_time() -#endif - - - -/* Kernel utilities. */ -void vPortYield( void ); -void _frxt_setup_switch( void ); -#define portYIELD() vPortYield() -#define portYIELD_FROM_ISR() {traceISR_EXIT_TO_SCHEDULER(); _frxt_setup_switch();} - -static inline uint32_t xPortGetCoreID(); - -/* Yielding within an API call (when interrupts are off), means the yield should be delayed - until interrupts are re-enabled. - - To do this, we use the "cross-core" interrupt as a trigger to yield on this core when interrupts are re-enabled.This - is the same interrupt & code path which is used to trigger a yield between CPUs, although in this case the yield is - happening on the same CPU. -*/ -#define portYIELD_WITHIN_API() esp_crosscore_int_send_yield(xPortGetCoreID()) - -/*-----------------------------------------------------------*/ - -/* Task function macros as described on the FreeRTOS.org WEB site. */ -#define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters ) -#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters ) - -// When coprocessors are defined, we to maintain a pointer to coprocessors area. -// We currently use a hack: redefine field xMPU_SETTINGS in TCB block as a structure that can hold: -// MPU wrappers, coprocessor area pointer, trace code structure, and more if needed. -// The field is normally used for memory protection. FreeRTOS should create another general purpose field. -typedef struct { - #if XCHAL_CP_NUM > 0 - volatile StackType_t* coproc_area; // Pointer to coprocessor save area; MUST BE FIRST - #endif - - #if portUSING_MPU_WRAPPERS - // Define here mpu_settings, which is port dependent - int mpu_setting; // Just a dummy example here; MPU not ported to Xtensa yet - #endif - - #if configUSE_TRACE_FACILITY_2 - struct { - // Cf. porttraceStamp() - int taskstamp; /* Stamp from inside task to see where we are */ - int taskstampcount; /* A counter usually incremented when we restart the task's loop */ - } porttrace; - #endif -} xMPU_SETTINGS; - -// Main hack to use MPU_wrappers even when no MPU is defined (warning: mpu_setting should not be accessed; otherwise move this above xMPU_SETTINGS) -#if (XCHAL_CP_NUM > 0 || configUSE_TRACE_FACILITY_2) && !portUSING_MPU_WRAPPERS // If MPU wrappers not used, we still need to allocate coproc area - #undef portUSING_MPU_WRAPPERS - #define portUSING_MPU_WRAPPERS 1 // Enable it to allocate coproc area - #define MPU_WRAPPERS_H // Override mpu_wrapper.h to disable unwanted code - #define PRIVILEGED_FUNCTION - #define PRIVILEGED_DATA -#endif - -extern void esp_vApplicationIdleHook( void ); -extern void esp_vApplicationTickHook( void ); - -#ifndef CONFIG_FREERTOS_LEGACY_HOOKS -#define vApplicationIdleHook esp_vApplicationIdleHook -#define vApplicationTickHook esp_vApplicationTickHook -#endif /* !CONFIG_FREERTOS_LEGACY_HOOKS */ - -void _xt_coproc_release(volatile void * coproc_sa_base); -void vApplicationSleep( TickType_t xExpectedIdleTime ); - -#define portSUPPRESS_TICKS_AND_SLEEP( idleTime ) vApplicationSleep( idleTime ) - -// porttrace -#if configUSE_TRACE_FACILITY_2 -#include "porttrace.h" -#endif - -// configASSERT_2 if requested -#if configASSERT_2 -#include -void exit(int); -#define configASSERT( x ) if (!(x)) { porttracePrint(-1); printf("\nAssertion failed in %s:%d\n", __FILE__, __LINE__); exit(-1); } -#endif - -#endif // __ASSEMBLER__ - -#ifdef __cplusplus -} -#endif - -#endif /* PORTMACRO_H */ - diff --git a/tools/sdk/include/freertos/freertos/porttrace.h b/tools/sdk/include/freertos/freertos/porttrace.h deleted file mode 100644 index bf2fb412525..00000000000 --- a/tools/sdk/include/freertos/freertos/porttrace.h +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* -// Copyright (c) 2003-2015 Cadence Design Systems, Inc. -// -// 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 utility helps tracing the entering and exiting from tasks. It maintains a circular buffer - * of tasks in the order they execute, and their execution time. - * In order to enable it, set configUSE_TRACE_FACILITY_2 to 1 in FreeRTOSConfig.h. - * You will also need to download the FreeRTOS_trace patch that contains - * porttrace.c and the complete version of porttrace.h - */ - -#ifndef PORTTRACE_H -#define PORTTRACE_H - -#if configUSE_TRACE_FACILITY_2 - #error "You need to download the FreeRTOS_trace patch that overwrites this file" -#endif - -#define porttracePrint(nelements) -#define porttraceStamp(stamp, count_incr) - -#endif /* PORTTRACE_H */ diff --git a/tools/sdk/include/freertos/freertos/projdefs.h b/tools/sdk/include/freertos/freertos/projdefs.h deleted file mode 100644 index 1bd39c58d8b..00000000000 --- a/tools/sdk/include/freertos/freertos/projdefs.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd. - All rights reserved - - VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. - - This file is part of the FreeRTOS distribution. - - FreeRTOS is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License (version 2) as published by the - Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. - - *************************************************************************** - >>! NOTE: The modification to the GPL is included to allow you to !<< - >>! distribute a combined work that includes FreeRTOS without being !<< - >>! obliged to provide the source code for proprietary components !<< - >>! outside of the FreeRTOS kernel. !<< - *************************************************************************** - - FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. Full license text is available on the following - link: http://www.freertos.org/a00114.html - - *************************************************************************** - * * - * FreeRTOS provides completely free yet professionally developed, * - * robust, strictly quality controlled, supported, and cross * - * platform software that is more than just the market leader, it * - * is the industry's de facto standard. * - * * - * Help yourself get started quickly while simultaneously helping * - * to support the FreeRTOS project by purchasing a FreeRTOS * - * tutorial book, reference manual, or both: * - * http://www.FreeRTOS.org/Documentation * - * * - *************************************************************************** - - http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading - the FAQ page "My application does not run, what could be wrong?". Have you - defined configASSERT()? - - http://www.FreeRTOS.org/support - In return for receiving this top quality - embedded software for free we request you assist our global community by - participating in the support forum. - - http://www.FreeRTOS.org/training - Investing in training allows your team to - be as productive as possible as early as possible. Now you can receive - FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers - Ltd, and the world's leading authority on the world's leading RTOS. - - http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, - including FreeRTOS+Trace - an indispensable productivity tool, a DOS - compatible FAT file system, and our tiny thread aware UDP/IP stack. - - http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. - Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. - - http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High - Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS - licenses offer ticketed support, indemnification and commercial middleware. - - http://www.SafeRTOS.com - High Integrity Systems also provide a safety - engineered and independently SIL3 certified version for use in safety and - mission critical applications that require provable dependability. - - 1 tab == 4 spaces! -*/ - -#ifndef PROJDEFS_H -#define PROJDEFS_H - -/* - * Defines the prototype to which task functions must conform. Defined in this - * file to ensure the type is known before portable.h is included. - */ -typedef void (*TaskFunction_t)( void * ); - -/* Converts a time in milliseconds to a time in ticks. */ -#define pdMS_TO_TICKS( xTimeInMs ) ( ( ( TickType_t ) ( xTimeInMs ) * configTICK_RATE_HZ ) / ( TickType_t ) 1000 ) - -#define pdFALSE ( ( BaseType_t ) 0 ) -#define pdTRUE ( ( BaseType_t ) 1 ) - -#define pdPASS ( pdTRUE ) -#define pdFAIL ( pdFALSE ) -#define errQUEUE_EMPTY ( ( BaseType_t ) 0 ) -#define errQUEUE_FULL ( ( BaseType_t ) 0 ) - -/* Error definitions. */ -#define errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY ( -1 ) -#define errQUEUE_BLOCKED ( -4 ) -#define errQUEUE_YIELD ( -5 ) - -/* Macros used for basic data corruption checks. */ -#ifndef configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES - #define configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES 0 -#endif - -#if( configUSE_16_BIT_TICKS == 1 ) - #define pdINTEGRITY_CHECK_VALUE 0x5a5a -#else - #define pdINTEGRITY_CHECK_VALUE 0x5a5a5a5aUL -#endif - -#endif /* PROJDEFS_H */ - - - diff --git a/tools/sdk/include/freertos/freertos/queue.h b/tools/sdk/include/freertos/freertos/queue.h deleted file mode 100644 index e15152ee975..00000000000 --- a/tools/sdk/include/freertos/freertos/queue.h +++ /dev/null @@ -1,1648 +0,0 @@ -/* - FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd. - All rights reserved - - VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. - - This file is part of the FreeRTOS distribution. - - FreeRTOS is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License (version 2) as published by the - Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. - - *************************************************************************** - >>! NOTE: The modification to the GPL is included to allow you to !<< - >>! distribute a combined work that includes FreeRTOS without being !<< - >>! obliged to provide the source code for proprietary components !<< - >>! outside of the FreeRTOS kernel. !<< - *************************************************************************** - - FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. Full license text is available on the following - link: http://www.freertos.org/a00114.html - - *************************************************************************** - * * - * FreeRTOS provides completely free yet professionally developed, * - * robust, strictly quality controlled, supported, and cross * - * platform software that is more than just the market leader, it * - * is the industry's de facto standard. * - * * - * Help yourself get started quickly while simultaneously helping * - * to support the FreeRTOS project by purchasing a FreeRTOS * - * tutorial book, reference manual, or both: * - * http://www.FreeRTOS.org/Documentation * - * * - *************************************************************************** - - http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading - the FAQ page "My application does not run, what could be wrong?". Have you - defined configASSERT()? - - http://www.FreeRTOS.org/support - In return for receiving this top quality - embedded software for free we request you assist our global community by - participating in the support forum. - - http://www.FreeRTOS.org/training - Investing in training allows your team to - be as productive as possible as early as possible. Now you can receive - FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers - Ltd, and the world's leading authority on the world's leading RTOS. - - http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, - including FreeRTOS+Trace - an indispensable productivity tool, a DOS - compatible FAT file system, and our tiny thread aware UDP/IP stack. - - http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. - Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. - - http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High - Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS - licenses offer ticketed support, indemnification and commercial middleware. - - http://www.SafeRTOS.com - High Integrity Systems also provide a safety - engineered and independently SIL3 certified version for use in safety and - mission critical applications that require provable dependability. - - 1 tab == 4 spaces! -*/ - - -#ifndef QUEUE_H -#define QUEUE_H - -#ifndef INC_FREERTOS_H - #error "include FreeRTOS.h" must appear in source files before "include queue.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - - -/** - * Type by which queues are referenced. For example, a call to xQueueCreate() - * returns an QueueHandle_t variable that can then be used as a parameter to - * xQueueSend(), xQueueReceive(), etc. - */ -typedef void * QueueHandle_t; - -/** - * Type by which queue sets are referenced. For example, a call to - * xQueueCreateSet() returns an xQueueSet variable that can then be used as a - * parameter to xQueueSelectFromSet(), xQueueAddToSet(), etc. - */ -typedef void * QueueSetHandle_t; - -/** - * Queue sets can contain both queues and semaphores, so the - * QueueSetMemberHandle_t is defined as a type to be used where a parameter or - * return value can be either an QueueHandle_t or an SemaphoreHandle_t. - */ -typedef void * QueueSetMemberHandle_t; - -/** @cond */ -/* For internal use only. */ -#define queueSEND_TO_BACK ( ( BaseType_t ) 0 ) -#define queueSEND_TO_FRONT ( ( BaseType_t ) 1 ) -#define queueOVERWRITE ( ( BaseType_t ) 2 ) - -/* For internal use only. These definitions *must* match those in queue.c. */ -#define queueQUEUE_TYPE_BASE ( ( uint8_t ) 0U ) -#define queueQUEUE_TYPE_SET ( ( uint8_t ) 0U ) -#define queueQUEUE_TYPE_MUTEX ( ( uint8_t ) 1U ) -#define queueQUEUE_TYPE_COUNTING_SEMAPHORE ( ( uint8_t ) 2U ) -#define queueQUEUE_TYPE_BINARY_SEMAPHORE ( ( uint8_t ) 3U ) -#define queueQUEUE_TYPE_RECURSIVE_MUTEX ( ( uint8_t ) 4U ) - -/** @endcond */ - -/** - * Creates a new queue instance. This allocates the storage required by the - * new queue and returns a handle for the queue. - * - * @param uxQueueLength The maximum number of items that the queue can contain. - * - * @param uxItemSize The number of bytes each item in the queue will require. - * Items are queued by copy, not by reference, so this is the number of bytes - * that will be copied for each posted item. Each item on the queue must be - * the same size. - * - * @return If the queue is successfully create then a handle to the newly - * created queue is returned. If the queue cannot be created then 0 is - * returned. - * - * Example usage: - * @code{c} - * struct AMessage - * { - * char ucMessageID; - * char ucData[ 20 ]; - * }; - * - * void vATask( void *pvParameters ) - * { - * QueueHandle_t xQueue1, xQueue2; - * - * // Create a queue capable of containing 10 uint32_t values. - * xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) ); - * if( xQueue1 == 0 ) - * { - * // Queue was not created and must not be used. - * } - * - * // Create a queue capable of containing 10 pointers to AMessage structures. - * // These should be passed by pointer as they contain a lot of data. - * xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) ); - * if( xQueue2 == 0 ) - * { - * // Queue was not created and must not be used. - * } - * - * // ... Rest of task code. - * } - * @endcode - * \ingroup QueueManagement - */ -#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) - #define xQueueCreate( uxQueueLength, uxItemSize ) xQueueGenericCreate( ( uxQueueLength ), ( uxItemSize ), ( queueQUEUE_TYPE_BASE ) ) -#endif - -/** - * Creates a new queue instance, and returns a handle by which the new queue - * can be referenced. - * - * Internally, within the FreeRTOS implementation, queues use two blocks of - * memory. The first block is used to hold the queue's data structures. The - * second block is used to hold items placed into the queue. If a queue is - * created using xQueueCreate() then both blocks of memory are automatically - * dynamically allocated inside the xQueueCreate() function. (see - * http://www.freertos.org/a00111.html). If a queue is created using - * xQueueCreateStatic() then the application writer must provide the memory that - * will get used by the queue. xQueueCreateStatic() therefore allows a queue to - * be created without using any dynamic memory allocation. - * - * http://www.FreeRTOS.org/Embedded-RTOS-Queues.html - * - * @param uxQueueLength The maximum number of items that the queue can contain. - * - * @param uxItemSize The number of bytes each item in the queue will require. - * Items are queued by copy, not by reference, so this is the number of bytes - * that will be copied for each posted item. Each item on the queue must be - * the same size. - * - * @param pucQueueStorage If uxItemSize is not zero then - * pucQueueStorageBuffer must point to a uint8_t array that is at least large - * enough to hold the maximum number of items that can be in the queue at any - * one time - which is ( uxQueueLength * uxItemsSize ) bytes. If uxItemSize is - * zero then pucQueueStorageBuffer can be NULL. - * - * @param pxQueueBuffer Must point to a variable of type StaticQueue_t, which - * will be used to hold the queue's data structure. - * - * @return If the queue is created then a handle to the created queue is - * returned. If pxQueueBuffer is NULL then NULL is returned. - * - * Example usage: - * @code{c} - * struct AMessage - * { - * char ucMessageID; - * char ucData[ 20 ]; - * }; - * - * #define QUEUE_LENGTH 10 - * #define ITEM_SIZE sizeof( uint32_t ) - * - * // xQueueBuffer will hold the queue structure. - * StaticQueue_t xQueueBuffer; - * - * // ucQueueStorage will hold the items posted to the queue. Must be at least - * // [(queue length) * ( queue item size)] bytes long. - * uint8_t ucQueueStorage[ QUEUE_LENGTH * ITEM_SIZE ]; - * - * void vATask( void *pvParameters ) - * { - * QueueHandle_t xQueue1; - * - * // Create a queue capable of containing 10 uint32_t values. - * xQueue1 = xQueueCreate( QUEUE_LENGTH, // The number of items the queue can hold. - * ITEM_SIZE // The size of each item in the queue - * &( ucQueueStorage[ 0 ] ), // The buffer that will hold the items in the queue. - * &xQueueBuffer ); // The buffer that will hold the queue structure. - * - * // The queue is guaranteed to be created successfully as no dynamic memory - * // allocation is used. Therefore xQueue1 is now a handle to a valid queue. - * - * // ... Rest of task code. - * } - * @endcode - * \ingroup QueueManagement - */ -#if( configSUPPORT_STATIC_ALLOCATION == 1 ) - #define xQueueCreateStatic( uxQueueLength, uxItemSize, pucQueueStorage, pxQueueBuffer ) xQueueGenericCreateStatic( ( uxQueueLength ), ( uxItemSize ), ( pucQueueStorage ), ( pxQueueBuffer ), ( queueQUEUE_TYPE_BASE ) ) -#endif /* configSUPPORT_STATIC_ALLOCATION */ - -/** - * This is a macro that calls xQueueGenericSend(). - * - * Post an item to the front of a queue. The item is queued by copy, not by - * reference. This function must not be called from an interrupt service - * routine. See xQueueSendFromISR () for an alternative which may be used - * in an ISR. - * - * @param xQueue The handle to the queue on which the item is to be posted. - * - * @param pvItemToQueue A pointer to the item that is to be placed on the - * queue. The size of the items the queue will hold was defined when the - * queue was created, so this many bytes will be copied from pvItemToQueue - * into the queue storage area. - * - * @param xTicksToWait The maximum amount of time the task should block - * waiting for space to become available on the queue, should it already - * be full. The call will return immediately if this is set to 0 and the - * queue is full. The time is defined in tick periods so the constant - * portTICK_PERIOD_MS should be used to convert to real time if this is required. - * - * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL. - * - * Example usage: - * @code{c} - * struct AMessage - * { - * char ucMessageID; - * char ucData[ 20 ]; - * } xMessage; - * - * uint32_t ulVar = 10UL; - * - * void vATask( void *pvParameters ) - * { - * QueueHandle_t xQueue1, xQueue2; - * struct AMessage *pxMessage; - * - * // Create a queue capable of containing 10 uint32_t values. - * xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) ); - * - * // Create a queue capable of containing 10 pointers to AMessage structures. - * // These should be passed by pointer as they contain a lot of data. - * xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) ); - * - * // ... - * - * if( xQueue1 != 0 ) - * { - * // Send an uint32_t. Wait for 10 ticks for space to become - * // available if necessary. - * if( xQueueSendToFront( xQueue1, ( void * ) &ulVar, ( TickType_t ) 10 ) != pdPASS ) - * { - * // Failed to post the message, even after 10 ticks. - * } - * } - * - * if( xQueue2 != 0 ) - * { - * // Send a pointer to a struct AMessage object. Don't block if the - * // queue is already full. - * pxMessage = & xMessage; - * xQueueSendToFront( xQueue2, ( void * ) &pxMessage, ( TickType_t ) 0 ); - * } - * - * // ... Rest of task code. - * } - * @endcode - * \ingroup QueueManagement - */ -#define xQueueSendToFront( xQueue, pvItemToQueue, xTicksToWait ) xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_FRONT ) - -/** - * This is a macro that calls xQueueGenericSend(). - * - * Post an item to the back of a queue. The item is queued by copy, not by - * reference. This function must not be called from an interrupt service - * routine. See xQueueSendFromISR () for an alternative which may be used - * in an ISR. - * - * @param xQueue The handle to the queue on which the item is to be posted. - * - * @param pvItemToQueue A pointer to the item that is to be placed on the - * queue. The size of the items the queue will hold was defined when the - * queue was created, so this many bytes will be copied from pvItemToQueue - * into the queue storage area. - * - * @param xTicksToWait The maximum amount of time the task should block - * waiting for space to become available on the queue, should it already - * be full. The call will return immediately if this is set to 0 and the queue - * is full. The time is defined in tick periods so the constant - * portTICK_PERIOD_MS should be used to convert to real time if this is required. - * - * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL. - * - * Example usage: - * @code{c} - * struct AMessage - * { - * char ucMessageID; - * char ucData[ 20 ]; - * } xMessage; - * - * uint32_t ulVar = 10UL; - * - * void vATask( void *pvParameters ) - * { - * QueueHandle_t xQueue1, xQueue2; - * struct AMessage *pxMessage; - * - * // Create a queue capable of containing 10 uint32_t values. - * xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) ); - * - * // Create a queue capable of containing 10 pointers to AMessage structures. - * // These should be passed by pointer as they contain a lot of data. - * xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) ); - * - * // ... - * - * if( xQueue1 != 0 ) - * { - * // Send an uint32_t. Wait for 10 ticks for space to become - * // available if necessary. - * if( xQueueSendToBack( xQueue1, ( void * ) &ulVar, ( TickType_t ) 10 ) != pdPASS ) - * { - * // Failed to post the message, even after 10 ticks. - * } - * } - * - * if( xQueue2 != 0 ) - * { - * // Send a pointer to a struct AMessage object. Don't block if the - * // queue is already full. - * pxMessage = & xMessage; - * xQueueSendToBack( xQueue2, ( void * ) &pxMessage, ( TickType_t ) 0 ); - * } - * - * // ... Rest of task code. - * } - * @endcode - * \ingroup QueueManagement - */ -#define xQueueSendToBack( xQueue, pvItemToQueue, xTicksToWait ) xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_BACK ) - -/** - * This is a macro that calls xQueueGenericSend(). It is included for - * backward compatibility with versions of FreeRTOS.org that did not - * include the xQueueSendToFront() and xQueueSendToBack() macros. It is - * equivalent to xQueueSendToBack(). - * - * Post an item on a queue. The item is queued by copy, not by reference. - * This function must not be called from an interrupt service routine. - * See xQueueSendFromISR () for an alternative which may be used in an ISR. - * - * @param xQueue The handle to the queue on which the item is to be posted. - * - * @param pvItemToQueue A pointer to the item that is to be placed on the - * queue. The size of the items the queue will hold was defined when the - * queue was created, so this many bytes will be copied from pvItemToQueue - * into the queue storage area. - * - * @param xTicksToWait The maximum amount of time the task should block - * waiting for space to become available on the queue, should it already - * be full. The call will return immediately if this is set to 0 and the - * queue is full. The time is defined in tick periods so the constant - * portTICK_PERIOD_MS should be used to convert to real time if this is required. - * - * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL. - * - * Example usage: - * @code{c} - * struct AMessage - * { - * char ucMessageID; - * char ucData[ 20 ]; - * } xMessage; - * - * uint32_t ulVar = 10UL; - * - * void vATask( void *pvParameters ) - * { - * QueueHandle_t xQueue1, xQueue2; - * struct AMessage *pxMessage; - * - * // Create a queue capable of containing 10 uint32_t values. - * xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) ); - * - * // Create a queue capable of containing 10 pointers to AMessage structures. - * // These should be passed by pointer as they contain a lot of data. - * xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) ); - * - * // ... - * - * if( xQueue1 != 0 ) - * { - * // Send an uint32_t. Wait for 10 ticks for space to become - * // available if necessary. - * if( xQueueSend( xQueue1, ( void * ) &ulVar, ( TickType_t ) 10 ) != pdPASS ) - * { - * // Failed to post the message, even after 10 ticks. - * } - * } - * - * if( xQueue2 != 0 ) - * { - * // Send a pointer to a struct AMessage object. Don't block if the - * // queue is already full. - * pxMessage = & xMessage; - * xQueueSend( xQueue2, ( void * ) &pxMessage, ( TickType_t ) 0 ); - * } - * - * // ... Rest of task code. - * } - * @endcode - * \ingroup QueueManagement - */ -#define xQueueSend( xQueue, pvItemToQueue, xTicksToWait ) xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_BACK ) - -/** - * Only for use with queues that have a length of one - so the queue is either - * empty or full. - * - * Post an item on a queue. If the queue is already full then overwrite the - * value held in the queue. The item is queued by copy, not by reference. - * - * This function must not be called from an interrupt service routine. - * See xQueueOverwriteFromISR () for an alternative which may be used in an ISR. - * - * @param xQueue The handle of the queue to which the data is being sent. - * - * @param pvItemToQueue A pointer to the item that is to be placed on the - * queue. The size of the items the queue will hold was defined when the - * queue was created, so this many bytes will be copied from pvItemToQueue - * into the queue storage area. - * - * @return xQueueOverwrite() is a macro that calls xQueueGenericSend(), and - * therefore has the same return values as xQueueSendToFront(). However, pdPASS - * is the only value that can be returned because xQueueOverwrite() will write - * to the queue even when the queue is already full. - * - * Example usage: - * @code{c} - * - * void vFunction( void *pvParameters ) - * { - * QueueHandle_t xQueue; - * uint32_t ulVarToSend, ulValReceived; - * - * // Create a queue to hold one uint32_t value. It is strongly - * // recommended *not* to use xQueueOverwrite() on queues that can - * // contain more than one value, and doing so will trigger an assertion - * // if configASSERT() is defined. - * xQueue = xQueueCreate( 1, sizeof( uint32_t ) ); - * - * // Write the value 10 to the queue using xQueueOverwrite(). - * ulVarToSend = 10; - * xQueueOverwrite( xQueue, &ulVarToSend ); - * - * // Peeking the queue should now return 10, but leave the value 10 in - * // the queue. A block time of zero is used as it is known that the - * // queue holds a value. - * ulValReceived = 0; - * xQueuePeek( xQueue, &ulValReceived, 0 ); - * - * if( ulValReceived != 10 ) - * { - * // Error unless the item was removed by a different task. - * } - * - * // The queue is still full. Use xQueueOverwrite() to overwrite the - * // value held in the queue with 100. - * ulVarToSend = 100; - * xQueueOverwrite( xQueue, &ulVarToSend ); - * - * // This time read from the queue, leaving the queue empty once more. - * // A block time of 0 is used again. - * xQueueReceive( xQueue, &ulValReceived, 0 ); - * - * // The value read should be the last value written, even though the - * // queue was already full when the value was written. - * if( ulValReceived != 100 ) - * { - * // Error! - * } - * - * // ... - * } - * @endcode - * \ingroup QueueManagement - */ -#define xQueueOverwrite( xQueue, pvItemToQueue ) xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), 0, queueOVERWRITE ) - - -/** - * It is preferred that the macros xQueueSend(), xQueueSendToFront() and - * xQueueSendToBack() are used in place of calling this function directly. - * - * Post an item on a queue. The item is queued by copy, not by reference. - * This function must not be called from an interrupt service routine. - * See xQueueSendFromISR () for an alternative which may be used in an ISR. - * - * @param xQueue The handle to the queue on which the item is to be posted. - * - * @param pvItemToQueue A pointer to the item that is to be placed on the - * queue. The size of the items the queue will hold was defined when the - * queue was created, so this many bytes will be copied from pvItemToQueue - * into the queue storage area. - * - * @param xTicksToWait The maximum amount of time the task should block - * waiting for space to become available on the queue, should it already - * be full. The call will return immediately if this is set to 0 and the - * queue is full. The time is defined in tick periods so the constant - * portTICK_PERIOD_MS should be used to convert to real time if this is required. - * - * @param xCopyPosition Can take the value queueSEND_TO_BACK to place the - * item at the back of the queue, or queueSEND_TO_FRONT to place the item - * at the front of the queue (for high priority messages). - * - * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL. - * - * Example usage: - * @code{c} - * struct AMessage - * { - * char ucMessageID; - * char ucData[ 20 ]; - * } xMessage; - * - * uint32_t ulVar = 10UL; - * - * void vATask( void *pvParameters ) - * { - * QueueHandle_t xQueue1, xQueue2; - * struct AMessage *pxMessage; - * - * // Create a queue capable of containing 10 uint32_t values. - * xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) ); - * - * // Create a queue capable of containing 10 pointers to AMessage structures. - * // These should be passed by pointer as they contain a lot of data. - * xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) ); - * - * // ... - * - * if( xQueue1 != 0 ) - * { - * // Send an uint32_t. Wait for 10 ticks for space to become - * // available if necessary. - * if( xQueueGenericSend( xQueue1, ( void * ) &ulVar, ( TickType_t ) 10, queueSEND_TO_BACK ) != pdPASS ) - * { - * // Failed to post the message, even after 10 ticks. - * } - * } - * - * if( xQueue2 != 0 ) - * { - * // Send a pointer to a struct AMessage object. Don't block if the - * // queue is already full. - * pxMessage = & xMessage; - * xQueueGenericSend( xQueue2, ( void * ) &pxMessage, ( TickType_t ) 0, queueSEND_TO_BACK ); - * } - * - * // ... Rest of task code. - * } - * @endcode - * \ingroup QueueManagement - */ -BaseType_t xQueueGenericSend( QueueHandle_t xQueue, const void * const pvItemToQueue, TickType_t xTicksToWait, const BaseType_t xCopyPosition ) PRIVILEGED_FUNCTION; - -/** - * This is a macro that calls the xQueueGenericReceive() function. - * - * Receive an item from a queue without removing the item from the queue. - * The item is received by copy so a buffer of adequate size must be - * provided. The number of bytes copied into the buffer was defined when - * the queue was created. - * - * Successfully received items remain on the queue so will be returned again - * by the next call, or a call to xQueueReceive(). - * - * This macro must not be used in an interrupt service routine. See - * xQueuePeekFromISR() for an alternative that can be called from an interrupt - * service routine. - * - * @param xQueue The handle to the queue from which the item is to be - * received. - * - * @param pvBuffer Pointer to the buffer into which the received item will - * be copied. - * - * @param xTicksToWait The maximum amount of time the task should block - * waiting for an item to receive should the queue be empty at the time - * of the call. The time is defined in tick periods so the constant - * portTICK_PERIOD_MS should be used to convert to real time if this is required. - * xQueuePeek() will return immediately if xTicksToWait is 0 and the queue - * is empty. - * - * @return pdTRUE if an item was successfully received from the queue, - * otherwise pdFALSE. - * - * Example usage: - * @code{c} - * struct AMessage - * { - * char ucMessageID; - * char ucData[ 20 ]; - * } xMessage; - * - * QueueHandle_t xQueue; - * - * // Task to create a queue and post a value. - * void vATask( void *pvParameters ) - * { - * struct AMessage *pxMessage; - * - * // Create a queue capable of containing 10 pointers to AMessage structures. - * // These should be passed by pointer as they contain a lot of data. - * xQueue = xQueueCreate( 10, sizeof( struct AMessage * ) ); - * if( xQueue == 0 ) - * { - * // Failed to create the queue. - * } - * - * // ... - * - * // Send a pointer to a struct AMessage object. Don't block if the - * // queue is already full. - * pxMessage = & xMessage; - * xQueueSend( xQueue, ( void * ) &pxMessage, ( TickType_t ) 0 ); - * - * // ... Rest of task code. - * } - * - * // Task to peek the data from the queue. - * void vADifferentTask( void *pvParameters ) - * { - * struct AMessage *pxRxedMessage; - * - * if( xQueue != 0 ) - * { - * // Peek a message on the created queue. Block for 10 ticks if a - * // message is not immediately available. - * if( xQueuePeek( xQueue, &( pxRxedMessage ), ( TickType_t ) 10 ) ) - * { - * // pcRxedMessage now points to the struct AMessage variable posted - * // by vATask, but the item still remains on the queue. - * } - * } - * - * // ... Rest of task code. - * } - * @endcode - * \ingroup QueueManagement - */ -#define xQueuePeek( xQueue, pvBuffer, xTicksToWait ) xQueueGenericReceive( ( xQueue ), ( pvBuffer ), ( xTicksToWait ), pdTRUE ) - -/** - * A version of xQueuePeek() that can be called from an interrupt service - * routine (ISR). - * - * Receive an item from a queue without removing the item from the queue. - * The item is received by copy so a buffer of adequate size must be - * provided. The number of bytes copied into the buffer was defined when - * the queue was created. - * - * Successfully received items remain on the queue so will be returned again - * by the next call, or a call to xQueueReceive(). - * - * @param xQueue The handle to the queue from which the item is to be - * received. - * - * @param pvBuffer Pointer to the buffer into which the received item will - * be copied. - * - * @return pdTRUE if an item was successfully received from the queue, - * otherwise pdFALSE. - * - * \ingroup QueueManagement - */ -BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue, void * const pvBuffer ) PRIVILEGED_FUNCTION; - -/** - * queue. h - *
- BaseType_t xQueueReceive(
-								 QueueHandle_t xQueue,
-								 void *pvBuffer,
-								 TickType_t xTicksToWait
-							);
- * - * This is a macro that calls the xQueueGenericReceive() function. - * - * Receive an item from a queue. The item is received by copy so a buffer of - * adequate size must be provided. The number of bytes copied into the buffer - * was defined when the queue was created. - * - * Successfully received items are removed from the queue. - * - * This function must not be used in an interrupt service routine. See - * xQueueReceiveFromISR for an alternative that can. - * - * @param xQueue The handle to the queue from which the item is to be - * received. - * - * @param pvBuffer Pointer to the buffer into which the received item will - * be copied. - * - * @param xTicksToWait The maximum amount of time the task should block - * waiting for an item to receive should the queue be empty at the time - * of the call. xQueueReceive() will return immediately if xTicksToWait - * is zero and the queue is empty. The time is defined in tick periods so the - * constant portTICK_PERIOD_MS should be used to convert to real time if this is - * required. - * - * @return pdTRUE if an item was successfully received from the queue, - * otherwise pdFALSE. - * - * Example usage: - * @code{c} - * struct AMessage - * { - * char ucMessageID; - * char ucData[ 20 ]; - * } xMessage; - * - * QueueHandle_t xQueue; - * - * // Task to create a queue and post a value. - * void vATask( void *pvParameters ) - * { - * struct AMessage *pxMessage; - * - * // Create a queue capable of containing 10 pointers to AMessage structures. - * // These should be passed by pointer as they contain a lot of data. - * xQueue = xQueueCreate( 10, sizeof( struct AMessage * ) ); - * if( xQueue == 0 ) - * { - * // Failed to create the queue. - * } - * - * // ... - * - * // Send a pointer to a struct AMessage object. Don't block if the - * // queue is already full. - * pxMessage = & xMessage; - * xQueueSend( xQueue, ( void * ) &pxMessage, ( TickType_t ) 0 ); - * - * // ... Rest of task code. - * } - * - * // Task to receive from the queue. - * void vADifferentTask( void *pvParameters ) - * { - * struct AMessage *pxRxedMessage; - * - * if( xQueue != 0 ) - * { - * // Receive a message on the created queue. Block for 10 ticks if a - * // message is not immediately available. - * if( xQueueReceive( xQueue, &( pxRxedMessage ), ( TickType_t ) 10 ) ) - * { - * // pcRxedMessage now points to the struct AMessage variable posted - * // by vATask. - * } - * } - * - * // ... Rest of task code. - * } - * @endcode - * \ingroup QueueManagement - */ -#define xQueueReceive( xQueue, pvBuffer, xTicksToWait ) xQueueGenericReceive( ( xQueue ), ( pvBuffer ), ( xTicksToWait ), pdFALSE ) - - -/** - * It is preferred that the macro xQueueReceive() be used rather than calling - * this function directly. - * - * Receive an item from a queue. The item is received by copy so a buffer of - * adequate size must be provided. The number of bytes copied into the buffer - * was defined when the queue was created. - * - * This function must not be used in an interrupt service routine. See - * xQueueReceiveFromISR for an alternative that can. - * - * @param xQueue The handle to the queue from which the item is to be - * received. - * - * @param pvBuffer Pointer to the buffer into which the received item will - * be copied. - * - * @param xTicksToWait The maximum amount of time the task should block - * waiting for an item to receive should the queue be empty at the time - * of the call. The time is defined in tick periods so the constant - * portTICK_PERIOD_MS should be used to convert to real time if this is required. - * xQueueGenericReceive() will return immediately if the queue is empty and - * xTicksToWait is 0. - * - * @param xJustPeek When set to true, the item received from the queue is not - * actually removed from the queue - meaning a subsequent call to - * xQueueReceive() will return the same item. When set to false, the item - * being received from the queue is also removed from the queue. - * - * @return pdTRUE if an item was successfully received from the queue, - * otherwise pdFALSE. - * - * Example usage: - * @code{c} - * struct AMessage - * { - * char ucMessageID; - * char ucData[ 20 ]; - * } xMessage; - * - * QueueHandle_t xQueue; - * - * // Task to create a queue and post a value. - * void vATask( void *pvParameters ) - * { - * struct AMessage *pxMessage; - * - * // Create a queue capable of containing 10 pointers to AMessage structures. - * // These should be passed by pointer as they contain a lot of data. - * xQueue = xQueueCreate( 10, sizeof( struct AMessage * ) ); - * if( xQueue == 0 ) - * { - * // Failed to create the queue. - * } - * - * // ... - * - * // Send a pointer to a struct AMessage object. Don't block if the - * // queue is already full. - * pxMessage = & xMessage; - * xQueueSend( xQueue, ( void * ) &pxMessage, ( TickType_t ) 0 ); - * - * // ... Rest of task code. - * } - * - * // Task to receive from the queue. - * void vADifferentTask( void *pvParameters ) - * { - * struct AMessage *pxRxedMessage; - * - * if( xQueue != 0 ) - * { - * // Receive a message on the created queue. Block for 10 ticks if a - * // message is not immediately available. - * if( xQueueGenericReceive( xQueue, &( pxRxedMessage ), ( TickType_t ) 10 ) ) - * { - * // pcRxedMessage now points to the struct AMessage variable posted - * // by vATask. - * } - * } - * - * // ... Rest of task code. - * } - * @endcode - * \ingroup QueueManagement - */ -BaseType_t xQueueGenericReceive( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait, const BaseType_t xJustPeek ) PRIVILEGED_FUNCTION; - -/** - * Return the number of messages stored in a queue. - * - * @param xQueue A handle to the queue being queried. - * - * @return The number of messages available in the queue. - * - * \ingroup QueueManagement - */ -UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; - -/** - * Return the number of free spaces available in a queue. This is equal to the - * number of items that can be sent to the queue before the queue becomes full - * if no items are removed. - * - * @param xQueue A handle to the queue being queried. - * - * @return The number of spaces available in the queue. - * - * \ingroup QueueManagement - */ -UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; - -/** - * Delete a queue - freeing all the memory allocated for storing of items - * placed on the queue. - * - * @param xQueue A handle to the queue to be deleted. - * - * \ingroup QueueManagement - */ -void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; - -/** - * This is a macro that calls xQueueGenericSendFromISR(). - * - * Post an item to the front of a queue. It is safe to use this macro from - * within an interrupt service routine. - * - * Items are queued by copy not reference so it is preferable to only - * queue small items, especially when called from an ISR. In most cases - * it would be preferable to store a pointer to the item being queued. - * - * @param xQueue The handle to the queue on which the item is to be posted. - * - * @param pvItemToQueue A pointer to the item that is to be placed on the - * queue. The size of the items the queue will hold was defined when the - * queue was created, so this many bytes will be copied from pvItemToQueue - * into the queue storage area. - * - * @param[out] pxHigherPriorityTaskWoken xQueueSendToFrontFromISR() will set - * *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task - * to unblock, and the unblocked task has a priority higher than the currently - * running task. If xQueueSendToFromFromISR() sets this value to pdTRUE then - * a context switch should be requested before the interrupt is exited. - * - * @return pdTRUE if the data was successfully sent to the queue, otherwise - * errQUEUE_FULL. - * - * Example usage for buffered IO (where the ISR can obtain more than one value - * per call): - * @code{c} - * void vBufferISR( void ) - * { - * char cIn; - * BaseType_t xHigherPrioritTaskWoken; - * - * // We have not woken a task at the start of the ISR. - * xHigherPriorityTaskWoken = pdFALSE; - * - * // Loop until the buffer is empty. - * do - * { - * // Obtain a byte from the buffer. - * cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS ); - * - * // Post the byte. - * xQueueSendToFrontFromISR( xRxQueue, &cIn, &xHigherPriorityTaskWoken ); - * - * } while( portINPUT_BYTE( BUFFER_COUNT ) ); - * - * // Now the buffer is empty we can switch context if necessary. - * if( xHigherPriorityTaskWoken ) - * { - * portYIELD_FROM_ISR (); - * } - * } - * @endcode - * \ingroup QueueManagement - */ -#define xQueueSendToFrontFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_FRONT ) - - -/** - * This is a macro that calls xQueueGenericSendFromISR(). - * - * Post an item to the back of a queue. It is safe to use this macro from - * within an interrupt service routine. - * - * Items are queued by copy not reference so it is preferable to only - * queue small items, especially when called from an ISR. In most cases - * it would be preferable to store a pointer to the item being queued. - * - * @param xQueue The handle to the queue on which the item is to be posted. - * - * @param pvItemToQueue A pointer to the item that is to be placed on the - * queue. The size of the items the queue will hold was defined when the - * queue was created, so this many bytes will be copied from pvItemToQueue - * into the queue storage area. - * - * @param[out] pxHigherPriorityTaskWoken xQueueSendToBackFromISR() will set - * *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task - * to unblock, and the unblocked task has a priority higher than the currently - * running task. If xQueueSendToBackFromISR() sets this value to pdTRUE then - * a context switch should be requested before the interrupt is exited. - * - * @return pdTRUE if the data was successfully sent to the queue, otherwise - * errQUEUE_FULL. - * - * Example usage for buffered IO (where the ISR can obtain more than one value - * per call): - * @code{c} - * void vBufferISR( void ) - * { - * char cIn; - * BaseType_t xHigherPriorityTaskWoken; - * - * // We have not woken a task at the start of the ISR. - * xHigherPriorityTaskWoken = pdFALSE; - * - * // Loop until the buffer is empty. - * do - * { - * // Obtain a byte from the buffer. - * cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS ); - * - * // Post the byte. - * xQueueSendToBackFromISR( xRxQueue, &cIn, &xHigherPriorityTaskWoken ); - * - * } while( portINPUT_BYTE( BUFFER_COUNT ) ); - * - * // Now the buffer is empty we can switch context if necessary. - * if( xHigherPriorityTaskWoken ) - * { - * portYIELD_FROM_ISR (); - * } - * } - * @endcode - * \ingroup QueueManagement - */ -#define xQueueSendToBackFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_BACK ) - -/** - * A version of xQueueOverwrite() that can be used in an interrupt service - * routine (ISR). - * - * Only for use with queues that can hold a single item - so the queue is either - * empty or full. - * - * Post an item on a queue. If the queue is already full then overwrite the - * value held in the queue. The item is queued by copy, not by reference. - * - * @param xQueue The handle to the queue on which the item is to be posted. - * - * @param pvItemToQueue A pointer to the item that is to be placed on the - * queue. The size of the items the queue will hold was defined when the - * queue was created, so this many bytes will be copied from pvItemToQueue - * into the queue storage area. - * - * @param[out] pxHigherPriorityTaskWoken xQueueOverwriteFromISR() will set - * *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task - * to unblock, and the unblocked task has a priority higher than the currently - * running task. If xQueueOverwriteFromISR() sets this value to pdTRUE then - * a context switch should be requested before the interrupt is exited. - * - * @return xQueueOverwriteFromISR() is a macro that calls - * xQueueGenericSendFromISR(), and therefore has the same return values as - * xQueueSendToFrontFromISR(). However, pdPASS is the only value that can be - * returned because xQueueOverwriteFromISR() will write to the queue even when - * the queue is already full. - * - * Example usage: - * @code{c} - * QueueHandle_t xQueue; - * - * void vFunction( void *pvParameters ) - * { - * // Create a queue to hold one uint32_t value. It is strongly - * // recommended *not* to use xQueueOverwriteFromISR() on queues that can - * // contain more than one value, and doing so will trigger an assertion - * // if configASSERT() is defined. - * xQueue = xQueueCreate( 1, sizeof( uint32_t ) ); - * } - * - * void vAnInterruptHandler( void ) - * { - * // xHigherPriorityTaskWoken must be set to pdFALSE before it is used. - * BaseType_t xHigherPriorityTaskWoken = pdFALSE; - * uint32_t ulVarToSend, ulValReceived; - * - * // Write the value 10 to the queue using xQueueOverwriteFromISR(). - * ulVarToSend = 10; - * xQueueOverwriteFromISR( xQueue, &ulVarToSend, &xHigherPriorityTaskWoken ); - * - * // The queue is full, but calling xQueueOverwriteFromISR() again will still - * // pass because the value held in the queue will be overwritten with the - * // new value. - * ulVarToSend = 100; - * xQueueOverwriteFromISR( xQueue, &ulVarToSend, &xHigherPriorityTaskWoken ); - * - * // Reading from the queue will now return 100. - * - * // ... - * - * if( xHigherPrioritytaskWoken == pdTRUE ) - * { - * // Writing to the queue caused a task to unblock and the unblocked task - * // has a priority higher than or equal to the priority of the currently - * // executing task (the task this interrupt interrupted). Perform a context - * // switch so this interrupt returns directly to the unblocked task. - * portYIELD_FROM_ISR(); // or portEND_SWITCHING_ISR() depending on the port. - * } - * } - * @endcode - * \ingroup QueueManagement - */ -#define xQueueOverwriteFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueOVERWRITE ) - -/** - * This is a macro that calls xQueueGenericSendFromISR(). It is included - * for backward compatibility with versions of FreeRTOS.org that did not - * include the xQueueSendToBackFromISR() and xQueueSendToFrontFromISR() - * macros. - * - * Post an item to the back of a queue. It is safe to use this function from - * within an interrupt service routine. - * - * Items are queued by copy not reference so it is preferable to only - * queue small items, especially when called from an ISR. In most cases - * it would be preferable to store a pointer to the item being queued. - * - * @param xQueue The handle to the queue on which the item is to be posted. - * - * @param pvItemToQueue A pointer to the item that is to be placed on the - * queue. The size of the items the queue will hold was defined when the - * queue was created, so this many bytes will be copied from pvItemToQueue - * into the queue storage area. - * - * @param[out] pxHigherPriorityTaskWoken xQueueSendFromISR() will set - * *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task - * to unblock, and the unblocked task has a priority higher than the currently - * running task. If xQueueSendFromISR() sets this value to pdTRUE then - * a context switch should be requested before the interrupt is exited. - * - * @return pdTRUE if the data was successfully sent to the queue, otherwise - * errQUEUE_FULL. - * - * Example usage for buffered IO (where the ISR can obtain more than one value - * per call): - * @code{c} - * void vBufferISR( void ) - * { - * char cIn; - * BaseType_t xHigherPriorityTaskWoken; - * - * // We have not woken a task at the start of the ISR. - * xHigherPriorityTaskWoken = pdFALSE; - * - * // Loop until the buffer is empty. - * do - * { - * // Obtain a byte from the buffer. - * cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS ); - * - * // Post the byte. - * xQueueSendFromISR( xRxQueue, &cIn, &xHigherPriorityTaskWoken ); - * - * } while( portINPUT_BYTE( BUFFER_COUNT ) ); - * - * // Now the buffer is empty we can switch context if necessary. - * if( xHigherPriorityTaskWoken ) - * { - * // Actual macro used here is port specific. - * portYIELD_FROM_ISR (); - * } - * } - * @endcode - * - * \ingroup QueueManagement - */ -#define xQueueSendFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_BACK ) - -/**@{*/ -/** - * It is preferred that the macros xQueueSendFromISR(), - * xQueueSendToFrontFromISR() and xQueueSendToBackFromISR() be used in place - * of calling this function directly. xQueueGiveFromISR() is an - * equivalent for use by semaphores that don't actually copy any data. - * - * Post an item on a queue. It is safe to use this function from within an - * interrupt service routine. - * - * Items are queued by copy not reference so it is preferable to only - * queue small items, especially when called from an ISR. In most cases - * it would be preferable to store a pointer to the item being queued. - * - * @param xQueue The handle to the queue on which the item is to be posted. - * - * @param pvItemToQueue A pointer to the item that is to be placed on the - * queue. The size of the items the queue will hold was defined when the - * queue was created, so this many bytes will be copied from pvItemToQueue - * into the queue storage area. - * - * @param[out] pxHigherPriorityTaskWoken xQueueGenericSendFromISR() will set - * *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task - * to unblock, and the unblocked task has a priority higher than the currently - * running task. If xQueueGenericSendFromISR() sets this value to pdTRUE then - * a context switch should be requested before the interrupt is exited. - * - * @param xCopyPosition Can take the value queueSEND_TO_BACK to place the - * item at the back of the queue, or queueSEND_TO_FRONT to place the item - * at the front of the queue (for high priority messages). - * - * @return pdTRUE if the data was successfully sent to the queue, otherwise - * errQUEUE_FULL. - * - * Example usage for buffered IO (where the ISR can obtain more than one value - * per call): - * @code{c} - * void vBufferISR( void ) - * { - * char cIn; - * BaseType_t xHigherPriorityTaskWokenByPost; - * - * // We have not woken a task at the start of the ISR. - * xHigherPriorityTaskWokenByPost = pdFALSE; - * - * // Loop until the buffer is empty. - * do - * { - * // Obtain a byte from the buffer. - * cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS ); - * - * // Post each byte. - * xQueueGenericSendFromISR( xRxQueue, &cIn, &xHigherPriorityTaskWokenByPost, queueSEND_TO_BACK ); - * - * } while( portINPUT_BYTE( BUFFER_COUNT ) ); - * - * // Now the buffer is empty we can switch context if necessary. Note that the - * // name of the yield function required is port specific. - * if( xHigherPriorityTaskWokenByPost ) - * { - * taskYIELD_YIELD_FROM_ISR(); - * } - * } - * @endcode - * \ingroup QueueManagement - */ -BaseType_t xQueueGenericSendFromISR( QueueHandle_t xQueue, const void * const pvItemToQueue, BaseType_t * const pxHigherPriorityTaskWoken, const BaseType_t xCopyPosition ) PRIVILEGED_FUNCTION; -BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue, BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION; -/**@}*/ - -/** - * Receive an item from a queue. It is safe to use this function from within an - * interrupt service routine. - * - * @param xQueue The handle to the queue from which the item is to be - * received. - * - * @param pvBuffer Pointer to the buffer into which the received item will - * be copied. - * - * @param[out] pxHigherPriorityTaskWoken A task may be blocked waiting for space to become - * available on the queue. If xQueueReceiveFromISR causes such a task to - * unblock *pxTaskWoken will get set to pdTRUE, otherwise *pxTaskWoken will - * remain unchanged. - * - * @return pdTRUE if an item was successfully received from the queue, - * otherwise pdFALSE. - * - * Example usage: - * @code{c} - * QueueHandle_t xQueue; - * - * // Function to create a queue and post some values. - * void vAFunction( void *pvParameters ) - * { - * char cValueToPost; - * const TickType_t xTicksToWait = ( TickType_t )0xff; - * - * // Create a queue capable of containing 10 characters. - * xQueue = xQueueCreate( 10, sizeof( char ) ); - * if( xQueue == 0 ) - * { - * // Failed to create the queue. - * } - * - * // ... - * - * // Post some characters that will be used within an ISR. If the queue - * // is full then this task will block for xTicksToWait ticks. - * cValueToPost = 'a'; - * xQueueSend( xQueue, ( void * ) &cValueToPost, xTicksToWait ); - * cValueToPost = 'b'; - * xQueueSend( xQueue, ( void * ) &cValueToPost, xTicksToWait ); - * - * // ... keep posting characters ... this task may block when the queue - * // becomes full. - * - * cValueToPost = 'c'; - * xQueueSend( xQueue, ( void * ) &cValueToPost, xTicksToWait ); - * } - * - * // ISR that outputs all the characters received on the queue. - * void vISR_Routine( void ) - * { - * BaseType_t xTaskWokenByReceive = pdFALSE; - * char cRxedChar; - * - * while( xQueueReceiveFromISR( xQueue, ( void * ) &cRxedChar, &xTaskWokenByReceive) ) - * { - * // A character was received. Output the character now. - * vOutputCharacter( cRxedChar ); - * - * // If removing the character from the queue woke the task that was - * // posting onto the queue cTaskWokenByReceive will have been set to - * // pdTRUE. No matter how many times this loop iterates only one - * // task will be woken. - * } - * - * if( cTaskWokenByPost != ( char ) pdFALSE; - * { - * taskYIELD (); - * } - * } - * @endcode - * \ingroup QueueManagement - */ -BaseType_t xQueueReceiveFromISR( QueueHandle_t xQueue, void * const pvBuffer, BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION; - -/**@{*/ -/** - * Utilities to query queues that are safe to use from an ISR. These utilities - * should be used only from witin an ISR, or within a critical section. - */ -BaseType_t xQueueIsQueueEmptyFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; -BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; -UBaseType_t uxQueueMessagesWaitingFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; -/**@}*/ - -/** @cond */ -/** - * xQueueAltGenericSend() is an alternative version of xQueueGenericSend(). - * Likewise xQueueAltGenericReceive() is an alternative version of - * xQueueGenericReceive(). - * - * The source code that implements the alternative (Alt) API is much - * simpler because it executes everything from within a critical section. - * This is the approach taken by many other RTOSes, but FreeRTOS.org has the - * preferred fully featured API too. The fully featured API has more - * complex code that takes longer to execute, but makes much less use of - * critical sections. Therefore the alternative API sacrifices interrupt - * responsiveness to gain execution speed, whereas the fully featured API - * sacrifices execution speed to ensure better interrupt responsiveness. - */ -BaseType_t xQueueAltGenericSend( QueueHandle_t xQueue, const void * const pvItemToQueue, TickType_t xTicksToWait, BaseType_t xCopyPosition ); -BaseType_t xQueueAltGenericReceive( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait, BaseType_t xJustPeeking ); -#define xQueueAltSendToFront( xQueue, pvItemToQueue, xTicksToWait ) xQueueAltGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_FRONT ) -#define xQueueAltSendToBack( xQueue, pvItemToQueue, xTicksToWait ) xQueueAltGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_BACK ) -#define xQueueAltReceive( xQueue, pvBuffer, xTicksToWait ) xQueueAltGenericReceive( ( xQueue ), ( pvBuffer ), ( xTicksToWait ), pdFALSE ) -#define xQueueAltPeek( xQueue, pvBuffer, xTicksToWait ) xQueueAltGenericReceive( ( xQueue ), ( pvBuffer ), ( xTicksToWait ), pdTRUE ) - -/* - * The functions defined above are for passing data to and from tasks. The - * functions below are the equivalents for passing data to and from - * co-routines. - * - * These functions are called from the co-routine macro implementation and - * should not be called directly from application code. Instead use the macro - * wrappers defined within croutine.h. - */ -BaseType_t xQueueCRSendFromISR( QueueHandle_t xQueue, const void *pvItemToQueue, BaseType_t xCoRoutinePreviouslyWoken ); -BaseType_t xQueueCRReceiveFromISR( QueueHandle_t xQueue, void *pvBuffer, BaseType_t *pxTaskWoken ); -BaseType_t xQueueCRSend( QueueHandle_t xQueue, const void *pvItemToQueue, TickType_t xTicksToWait ); -BaseType_t xQueueCRReceive( QueueHandle_t xQueue, void *pvBuffer, TickType_t xTicksToWait ); - -/* - * For internal use only. Use xSemaphoreCreateMutex(), - * xSemaphoreCreateCounting() or xSemaphoreGetMutexHolder() instead of calling - * these functions directly. - */ -QueueHandle_t xQueueCreateMutex( const uint8_t ucQueueType ) PRIVILEGED_FUNCTION; -QueueHandle_t xQueueCreateMutexStatic( const uint8_t ucQueueType, StaticQueue_t *pxStaticQueue ) PRIVILEGED_FUNCTION; -QueueHandle_t xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount, const UBaseType_t uxInitialCount ) PRIVILEGED_FUNCTION; -QueueHandle_t xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount, const UBaseType_t uxInitialCount, StaticQueue_t *pxStaticQueue ) PRIVILEGED_FUNCTION; -void* xQueueGetMutexHolder( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION; - -/* - * For internal use only. Use xSemaphoreTakeMutexRecursive() or - * xSemaphoreGiveMutexRecursive() instead of calling these functions directly. - */ -BaseType_t xQueueTakeMutexRecursive( QueueHandle_t xMutex, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION; -BaseType_t xQueueGiveMutexRecursive( QueueHandle_t pxMutex ) PRIVILEGED_FUNCTION; -/** @endcond */ - -/** - * Reset a queue back to its original empty state. pdPASS is returned if the - * queue is successfully reset. pdFAIL is returned if the queue could not be - * reset because there are tasks blocked on the queue waiting to either - * receive from the queue or send to the queue. - * - * @param xQueue The queue to reset - * @return always returns pdPASS - */ -#define xQueueReset( xQueue ) xQueueGenericReset( xQueue, pdFALSE ) - -/** - * The registry is provided as a means for kernel aware debuggers to - * locate queues, semaphores and mutexes. Call vQueueAddToRegistry() add - * a queue, semaphore or mutex handle to the registry if you want the handle - * to be available to a kernel aware debugger. If you are not using a kernel - * aware debugger then this function can be ignored. - * - * configQUEUE_REGISTRY_SIZE defines the maximum number of handles the - * registry can hold. configQUEUE_REGISTRY_SIZE must be greater than 0 - * within FreeRTOSConfig.h for the registry to be available. Its value - * does not effect the number of queues, semaphores and mutexes that can be - * created - just the number that the registry can hold. - * - * @param xQueue The handle of the queue being added to the registry. This - * is the handle returned by a call to xQueueCreate(). Semaphore and mutex - * handles can also be passed in here. - * - * @param pcName The name to be associated with the handle. This is the - * name that the kernel aware debugger will display. The queue registry only - * stores a pointer to the string - so the string must be persistent (global or - * preferably in ROM/Flash), not on the stack. - */ -#if configQUEUE_REGISTRY_SIZE > 0 - void vQueueAddToRegistry( QueueHandle_t xQueue, const char *pcName ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ -#endif - -/** - * The registry is provided as a means for kernel aware debuggers to - * locate queues, semaphores and mutexes. Call vQueueAddToRegistry() add - * a queue, semaphore or mutex handle to the registry if you want the handle - * to be available to a kernel aware debugger, and vQueueUnregisterQueue() to - * remove the queue, semaphore or mutex from the register. If you are not using - * a kernel aware debugger then this function can be ignored. - * - * @param xQueue The handle of the queue being removed from the registry. - */ -#if configQUEUE_REGISTRY_SIZE > 0 - void vQueueUnregisterQueue( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; -#endif - -/** - * @note This function has been back ported from FreeRTOS v9.0.0 - * - * The queue registry is provided as a means for kernel aware debuggers to - * locate queues, semaphores and mutexes. Call pcQueueGetName() to look - * up and return the name of a queue in the queue registry from the queue's - * handle. - * - * @param xQueue The handle of the queue the name of which will be returned. - * @return If the queue is in the registry then a pointer to the name of the - * queue is returned. If the queue is not in the registry then NULL is - * returned. - */ -#if( configQUEUE_REGISTRY_SIZE > 0 ) - const char *pcQueueGetName( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ -#endif - -/** - * Generic version of the function used to creaet a queue using dynamic memory - * allocation. This is called by other functions and macros that create other - * RTOS objects that use the queue structure as their base. - */ -#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) - QueueHandle_t xQueueGenericCreate( const UBaseType_t uxQueueLength, const UBaseType_t uxItemSize, const uint8_t ucQueueType ) PRIVILEGED_FUNCTION; -#endif - -/** - * Generic version of the function used to creaet a queue using dynamic memory - * allocation. This is called by other functions and macros that create other - * RTOS objects that use the queue structure as their base. - */ -#if( configSUPPORT_STATIC_ALLOCATION == 1 ) - QueueHandle_t xQueueGenericCreateStatic( const UBaseType_t uxQueueLength, const UBaseType_t uxItemSize, uint8_t *pucQueueStorage, StaticQueue_t *pxStaticQueue, const uint8_t ucQueueType ) PRIVILEGED_FUNCTION; -#endif - -/** - * Queue sets provide a mechanism to allow a task to block (pend) on a read - * operation from multiple queues or semaphores simultaneously. - * - * See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this - * function. - * - * A queue set must be explicitly created using a call to xQueueCreateSet() - * before it can be used. Once created, standard FreeRTOS queues and semaphores - * can be added to the set using calls to xQueueAddToSet(). - * xQueueSelectFromSet() is then used to determine which, if any, of the queues - * or semaphores contained in the set is in a state where a queue read or - * semaphore take operation would be successful. - * - * Note 1: See the documentation on http://wwwFreeRTOS.org/RTOS-queue-sets.html - * for reasons why queue sets are very rarely needed in practice as there are - * simpler methods of blocking on multiple objects. - * - * Note 2: Blocking on a queue set that contains a mutex will not cause the - * mutex holder to inherit the priority of the blocked task. - * - * Note 3: An additional 4 bytes of RAM is required for each space in a every - * queue added to a queue set. Therefore counting semaphores that have a high - * maximum count value should not be added to a queue set. - * - * Note 4: A receive (in the case of a queue) or take (in the case of a - * semaphore) operation must not be performed on a member of a queue set unless - * a call to xQueueSelectFromSet() has first returned a handle to that set member. - * - * @param uxEventQueueLength Queue sets store events that occur on - * the queues and semaphores contained in the set. uxEventQueueLength specifies - * the maximum number of events that can be queued at once. To be absolutely - * certain that events are not lost uxEventQueueLength should be set to the - * total sum of the length of the queues added to the set, where binary - * semaphores and mutexes have a length of 1, and counting semaphores have a - * length set by their maximum count value. Examples: - * + If a queue set is to hold a queue of length 5, another queue of length 12, - * and a binary semaphore, then uxEventQueueLength should be set to - * (5 + 12 + 1), or 18. - * + If a queue set is to hold three binary semaphores then uxEventQueueLength - * should be set to (1 + 1 + 1 ), or 3. - * + If a queue set is to hold a counting semaphore that has a maximum count of - * 5, and a counting semaphore that has a maximum count of 3, then - * uxEventQueueLength should be set to (5 + 3), or 8. - * - * @return If the queue set is created successfully then a handle to the created - * queue set is returned. Otherwise NULL is returned. - */ -QueueSetHandle_t xQueueCreateSet( const UBaseType_t uxEventQueueLength ) PRIVILEGED_FUNCTION; - -/** - * Adds a queue or semaphore to a queue set that was previously created by a - * call to xQueueCreateSet(). - * - * See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this - * function. - * - * Note 1: A receive (in the case of a queue) or take (in the case of a - * semaphore) operation must not be performed on a member of a queue set unless - * a call to xQueueSelectFromSet() has first returned a handle to that set member. - * - * @param xQueueOrSemaphore The handle of the queue or semaphore being added to - * the queue set (cast to an QueueSetMemberHandle_t type). - * - * @param xQueueSet The handle of the queue set to which the queue or semaphore - * is being added. - * - * @return If the queue or semaphore was successfully added to the queue set - * then pdPASS is returned. If the queue could not be successfully added to the - * queue set because it is already a member of a different queue set then pdFAIL - * is returned. - */ -BaseType_t xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION; - -/** - * Removes a queue or semaphore from a queue set. A queue or semaphore can only - * be removed from a set if the queue or semaphore is empty. - * - * See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this - * function. - * - * @param xQueueOrSemaphore The handle of the queue or semaphore being removed - * from the queue set (cast to an QueueSetMemberHandle_t type). - * - * @param xQueueSet The handle of the queue set in which the queue or semaphore - * is included. - * - * @return If the queue or semaphore was successfully removed from the queue set - * then pdPASS is returned. If the queue was not in the queue set, or the - * queue (or semaphore) was not empty, then pdFAIL is returned. - */ -BaseType_t xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION; - -/** - * xQueueSelectFromSet() selects from the members of a queue set a queue or - * semaphore that either contains data (in the case of a queue) or is available - * to take (in the case of a semaphore). xQueueSelectFromSet() effectively - * allows a task to block (pend) on a read operation on all the queues and - * semaphores in a queue set simultaneously. - * - * See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this - * function. - * - * Note 1: See the documentation on http://wwwFreeRTOS.org/RTOS-queue-sets.html - * for reasons why queue sets are very rarely needed in practice as there are - * simpler methods of blocking on multiple objects. - * - * Note 2: Blocking on a queue set that contains a mutex will not cause the - * mutex holder to inherit the priority of the blocked task. - * - * Note 3: A receive (in the case of a queue) or take (in the case of a - * semaphore) operation must not be performed on a member of a queue set unless - * a call to xQueueSelectFromSet() has first returned a handle to that set member. - * - * @param xQueueSet The queue set on which the task will (potentially) block. - * - * @param xTicksToWait The maximum time, in ticks, that the calling task will - * remain in the Blocked state (with other tasks executing) to wait for a member - * of the queue set to be ready for a successful queue read or semaphore take - * operation. - * - * @return xQueueSelectFromSet() will return the handle of a queue (cast to - * a QueueSetMemberHandle_t type) contained in the queue set that contains data, - * or the handle of a semaphore (cast to a QueueSetMemberHandle_t type) contained - * in the queue set that is available, or NULL if no such queue or semaphore - * exists before before the specified block time expires. - */ -QueueSetMemberHandle_t xQueueSelectFromSet( QueueSetHandle_t xQueueSet, const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION; - -/** - * A version of xQueueSelectFromSet() that can be used from an ISR. - */ -QueueSetMemberHandle_t xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION; - -/** @cond */ -/* Not public API functions. */ -void vQueueWaitForMessageRestricted( QueueHandle_t xQueue, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION; -BaseType_t xQueueGenericReset( QueueHandle_t xQueue, BaseType_t xNewQueue ) PRIVILEGED_FUNCTION; -void vQueueSetQueueNumber( QueueHandle_t xQueue, UBaseType_t uxQueueNumber ) PRIVILEGED_FUNCTION; -UBaseType_t uxQueueGetQueueNumber( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; -uint8_t ucQueueGetQueueType( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; -/** @endcond */ - -#ifdef __cplusplus -} -#endif - -#endif /* QUEUE_H */ - diff --git a/tools/sdk/include/freertos/freertos/semphr.h b/tools/sdk/include/freertos/freertos/semphr.h deleted file mode 100644 index abe3819f8f3..00000000000 --- a/tools/sdk/include/freertos/freertos/semphr.h +++ /dev/null @@ -1,1118 +0,0 @@ -/* - FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd. - All rights reserved - - VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. - - This file is part of the FreeRTOS distribution. - - FreeRTOS is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License (version 2) as published by the - Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. - - *************************************************************************** - >>! NOTE: The modification to the GPL is included to allow you to !<< - >>! distribute a combined work that includes FreeRTOS without being !<< - >>! obliged to provide the source code for proprietary components !<< - >>! outside of the FreeRTOS kernel. !<< - *************************************************************************** - - FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. Full license text is available on the following - link: http://www.freertos.org/a00114.html - - *************************************************************************** - * * - * FreeRTOS provides completely free yet professionally developed, * - * robust, strictly quality controlled, supported, and cross * - * platform software that is more than just the market leader, it * - * is the industry's de facto standard. * - * * - * Help yourself get started quickly while simultaneously helping * - * to support the FreeRTOS project by purchasing a FreeRTOS * - * tutorial book, reference manual, or both: * - * http://www.FreeRTOS.org/Documentation * - * * - *************************************************************************** - - http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading - the FAQ page "My application does not run, what could be wrong?". Have you - defined configASSERT()? - - http://www.FreeRTOS.org/support - In return for receiving this top quality - embedded software for free we request you assist our global community by - participating in the support forum. - - http://www.FreeRTOS.org/training - Investing in training allows your team to - be as productive as possible as early as possible. Now you can receive - FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers - Ltd, and the world's leading authority on the world's leading RTOS. - - http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, - including FreeRTOS+Trace - an indispensable productivity tool, a DOS - compatible FAT file system, and our tiny thread aware UDP/IP stack. - - http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. - Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. - - http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High - Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS - licenses offer ticketed support, indemnification and commercial middleware. - - http://www.SafeRTOS.com - High Integrity Systems also provide a safety - engineered and independently SIL3 certified version for use in safety and - mission critical applications that require provable dependability. - - 1 tab == 4 spaces! -*/ - -#ifndef SEMAPHORE_H -#define SEMAPHORE_H - -#ifndef INC_FREERTOS_H - #error "include FreeRTOS.h" must appear in source files before "include semphr.h" -#endif - -#include "queue.h" - -typedef QueueHandle_t SemaphoreHandle_t; - -#define semBINARY_SEMAPHORE_QUEUE_LENGTH ( ( uint8_t ) 1U ) -#define semSEMAPHORE_QUEUE_ITEM_LENGTH ( ( uint8_t ) 0U ) -#define semGIVE_BLOCK_TIME ( ( TickType_t ) 0U ) - -/** @cond */ -/** - * This old vSemaphoreCreateBinary() macro is now deprecated in favour of the - * xSemaphoreCreateBinary() function. Note that binary semaphores created using - * the vSemaphoreCreateBinary() macro are created in a state such that the - * first call to 'take' the semaphore would pass, whereas binary semaphores - * created using xSemaphoreCreateBinary() are created in a state such that the - * the semaphore must first be 'given' before it can be 'taken'. - * - * Macro that implements a semaphore by using the existing queue mechanism. - * The queue length is 1 as this is a binary semaphore. The data size is 0 - * as we don't want to actually store any data - we just want to know if the - * queue is empty or full. - * - * This type of semaphore can be used for pure synchronisation between tasks or - * between an interrupt and a task. The semaphore need not be given back once - * obtained, so one task/interrupt can continuously 'give' the semaphore while - * another continuously 'takes' the semaphore. For this reason this type of - * semaphore does not use a priority inheritance mechanism. For an alternative - * that does use priority inheritance see xSemaphoreCreateMutex(). - * - * @param xSemaphore Handle to the created semaphore. Should be of type SemaphoreHandle_t. - * - * Example usage: - * @code{c} - * SemaphoreHandle_t xSemaphore = NULL; - * - * void vATask( void * pvParameters ) - * { - * // Semaphore cannot be used before a call to vSemaphoreCreateBinary (). - * // This is a macro so pass the variable in directly. - * vSemaphoreCreateBinary( xSemaphore ); - * - * if( xSemaphore != NULL ) - * { - * // The semaphore was created successfully. - * // The semaphore can now be used. - * } - * } - * @endcode - * \ingroup Semaphores - */ -#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) - #define vSemaphoreCreateBinary( xSemaphore ) \ - { \ - ( xSemaphore ) = xQueueGenericCreate( ( UBaseType_t ) 1, semSEMAPHORE_QUEUE_ITEM_LENGTH, queueQUEUE_TYPE_BINARY_SEMAPHORE ); \ - if( ( xSemaphore ) != NULL ) \ - { \ - ( void ) xSemaphoreGive( ( xSemaphore ) ); \ - } \ - } -#endif -/** @endcond */ - -/** - * Creates a new binary semaphore instance, and returns a handle by which the - * new semaphore can be referenced. - * - * In many usage scenarios it is faster and more memory efficient to use a - * direct to task notification in place of a binary semaphore! - * http://www.freertos.org/RTOS-task-notifications.html - * - * Internally, within the FreeRTOS implementation, binary semaphores use a block - * of memory, in which the semaphore structure is stored. If a binary semaphore - * is created using xSemaphoreCreateBinary() then the required memory is - * automatically dynamically allocated inside the xSemaphoreCreateBinary() - * function. (see http://www.freertos.org/a00111.html). If a binary semaphore - * is created using xSemaphoreCreateBinaryStatic() then the application writer - * must provide the memory. xSemaphoreCreateBinaryStatic() therefore allows a - * binary semaphore to be created without using any dynamic memory allocation. - * - * The old vSemaphoreCreateBinary() macro is now deprecated in favour of this - * xSemaphoreCreateBinary() function. Note that binary semaphores created using - * the vSemaphoreCreateBinary() macro are created in a state such that the - * first call to 'take' the semaphore would pass, whereas binary semaphores - * created using xSemaphoreCreateBinary() are created in a state such that the - * the semaphore must first be 'given' before it can be 'taken'. - * - * Function that creates a semaphore by using the existing queue mechanism. - * The queue length is 1 as this is a binary semaphore. The data size is 0 - * as nothing is actually stored - all that is important is whether the queue is - * empty or full (the binary semaphore is available or not). - * - * This type of semaphore can be used for pure synchronisation between tasks or - * between an interrupt and a task. The semaphore need not be given back once - * obtained, so one task/interrupt can continuously 'give' the semaphore while - * another continuously 'takes' the semaphore. For this reason this type of - * semaphore does not use a priority inheritance mechanism. For an alternative - * that does use priority inheritance see xSemaphoreCreateMutex(). - * - * @return Handle to the created semaphore. - * - * Example usage: - * @code{c} - * SemaphoreHandle_t xSemaphore = NULL; - * - * void vATask( void * pvParameters ) - * { - * // Semaphore cannot be used before a call to vSemaphoreCreateBinary (). - * // This is a macro so pass the variable in directly. - * xSemaphore = xSemaphoreCreateBinary(); - * - * if( xSemaphore != NULL ) - * { - * // The semaphore was created successfully. - * // The semaphore can now be used. - * } - * } - * @endcode - * \ingroup Semaphores - */ -#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) - #define xSemaphoreCreateBinary() xQueueGenericCreate( ( UBaseType_t ) 1, semSEMAPHORE_QUEUE_ITEM_LENGTH, queueQUEUE_TYPE_BINARY_SEMAPHORE ) -#endif - -/** - * Creates a new binary semaphore instance, and returns a handle by which the - * new semaphore can be referenced. - * - * NOTE: In many usage scenarios it is faster and more memory efficient to use a - * direct to task notification in place of a binary semaphore! - * http://www.freertos.org/RTOS-task-notifications.html - * - * Internally, within the FreeRTOS implementation, binary semaphores use a block - * of memory, in which the semaphore structure is stored. If a binary semaphore - * is created using xSemaphoreCreateBinary() then the required memory is - * automatically dynamically allocated inside the xSemaphoreCreateBinary() - * function. (see http://www.freertos.org/a00111.html). If a binary semaphore - * is created using xSemaphoreCreateBinaryStatic() then the application writer - * must provide the memory. xSemaphoreCreateBinaryStatic() therefore allows a - * binary semaphore to be created without using any dynamic memory allocation. - * - * This type of semaphore can be used for pure synchronisation between tasks or - * between an interrupt and a task. The semaphore need not be given back once - * obtained, so one task/interrupt can continuously 'give' the semaphore while - * another continuously 'takes' the semaphore. For this reason this type of - * semaphore does not use a priority inheritance mechanism. For an alternative - * that does use priority inheritance see xSemaphoreCreateMutex(). - * - * @param pxStaticSemaphore Must point to a variable of type StaticSemaphore_t, - * which will then be used to hold the semaphore's data structure, removing the - * need for the memory to be allocated dynamically. - * - * @return If the semaphore is created then a handle to the created semaphore is - * returned. If pxSemaphoreBuffer is NULL then NULL is returned. - * - * Example usage: - * @code{c} - * SemaphoreHandle_t xSemaphore = NULL; - * StaticSemaphore_t xSemaphoreBuffer; - * - * void vATask( void * pvParameters ) - * { - * // Semaphore cannot be used before a call to xSemaphoreCreateBinary(). - * // The semaphore's data structures will be placed in the xSemaphoreBuffer - * // variable, the address of which is passed into the function. The - * // function's parameter is not NULL, so the function will not attempt any - * // dynamic memory allocation, and therefore the function will not return - * // return NULL. - * xSemaphore = xSemaphoreCreateBinary( &xSemaphoreBuffer ); - * - * // Rest of task code goes here. - * } - * @endcode - * \ingroup Semaphores - */ -#if( configSUPPORT_STATIC_ALLOCATION == 1 ) - #define xSemaphoreCreateBinaryStatic( pxStaticSemaphore ) xQueueGenericCreateStatic( ( UBaseType_t ) 1, semSEMAPHORE_QUEUE_ITEM_LENGTH, NULL, pxStaticSemaphore, queueQUEUE_TYPE_BINARY_SEMAPHORE ) -#endif /* configSUPPORT_STATIC_ALLOCATION */ - -/** - * Macro to obtain a semaphore. The semaphore must have previously been - * created with a call to vSemaphoreCreateBinary(), xSemaphoreCreateMutex() or - * xSemaphoreCreateCounting(). - * - * @param xSemaphore A handle to the semaphore being taken - obtained when - * the semaphore was created. - * - * @param xBlockTime The time in ticks to wait for the semaphore to become - * available. The macro portTICK_PERIOD_MS can be used to convert this to a - * real time. A block time of zero can be used to poll the semaphore. A block - * time of portMAX_DELAY can be used to block indefinitely (provided - * INCLUDE_vTaskSuspend is set to 1 in FreeRTOSConfig.h). - * - * @return pdTRUE if the semaphore was obtained. pdFALSE - * if xBlockTime expired without the semaphore becoming available. - * - * Example usage: - * @code{c} - * SemaphoreHandle_t xSemaphore = NULL; - * - * // A task that creates a semaphore. - * void vATask( void * pvParameters ) - * { - * // Create the semaphore to guard a shared resource. - * vSemaphoreCreateBinary( xSemaphore ); - * } - * - * // A task that uses the semaphore. - * void vAnotherTask( void * pvParameters ) - * { - * // ... Do other things. - * - * if( xSemaphore != NULL ) - * { - * // See if we can obtain the semaphore. If the semaphore is not available - * // wait 10 ticks to see if it becomes free. - * if( xSemaphoreTake( xSemaphore, ( TickType_t ) 10 ) == pdTRUE ) - * { - * // We were able to obtain the semaphore and can now access the - * // shared resource. - * - * // ... - * - * // We have finished accessing the shared resource. Release the - * // semaphore. - * xSemaphoreGive( xSemaphore ); - * } - * else - * { - * // We could not obtain the semaphore and can therefore not access - * // the shared resource safely. - * } - * } - * } - * @endcode - * \ingroup Semaphores - */ -#define xSemaphoreTake( xSemaphore, xBlockTime ) xQueueGenericReceive( ( QueueHandle_t ) ( xSemaphore ), NULL, ( xBlockTime ), pdFALSE ) - -/** - * Macro to recursively obtain, or 'take', a mutex type semaphore. - * The mutex must have previously been created using a call to - * xSemaphoreCreateRecursiveMutex(); - * - * configUSE_RECURSIVE_MUTEXES must be set to 1 in FreeRTOSConfig.h for this - * macro to be available. - * - * This macro must not be used on mutexes created using xSemaphoreCreateMutex(). - * - * A mutex used recursively can be 'taken' repeatedly by the owner. The mutex - * doesn't become available again until the owner has called - * xSemaphoreGiveRecursive() for each successful 'take' request. For example, - * if a task successfully 'takes' the same mutex 5 times then the mutex will - * not be available to any other task until it has also 'given' the mutex back - * exactly five times. - * - * @param xMutex A handle to the mutex being obtained. This is the - * handle returned by xSemaphoreCreateRecursiveMutex(); - * - * @param xBlockTime The time in ticks to wait for the semaphore to become - * available. The macro portTICK_PERIOD_MS can be used to convert this to a - * real time. A block time of zero can be used to poll the semaphore. If - * the task already owns the semaphore then xSemaphoreTakeRecursive() will - * return immediately no matter what the value of xBlockTime. - * - * @return pdTRUE if the semaphore was obtained. pdFALSE if xBlockTime - * expired without the semaphore becoming available. - * - * Example usage: - * @code{c} - * SemaphoreHandle_t xMutex = NULL; - * - * // A task that creates a mutex. - * void vATask( void * pvParameters ) - * { - * // Create the mutex to guard a shared resource. - * xMutex = xSemaphoreCreateRecursiveMutex(); - * } - * - * // A task that uses the mutex. - * void vAnotherTask( void * pvParameters ) - * { - * // ... Do other things. - * - * if( xMutex != NULL ) - * { - * // See if we can obtain the mutex. If the mutex is not available - * // wait 10 ticks to see if it becomes free. - * if( xSemaphoreTakeRecursive( xSemaphore, ( TickType_t ) 10 ) == pdTRUE ) - * { - * // We were able to obtain the mutex and can now access the - * // shared resource. - * - * // ... - * // For some reason due to the nature of the code further calls to - * // xSemaphoreTakeRecursive() are made on the same mutex. In real - * // code these would not be just sequential calls as this would make - * // no sense. Instead the calls are likely to be buried inside - * // a more complex call structure. - * xSemaphoreTakeRecursive( xMutex, ( TickType_t ) 10 ); - * xSemaphoreTakeRecursive( xMutex, ( TickType_t ) 10 ); - * - * // The mutex has now been 'taken' three times, so will not be - * // available to another task until it has also been given back - * // three times. Again it is unlikely that real code would have - * // these calls sequentially, but instead buried in a more complex - * // call structure. This is just for illustrative purposes. - * xSemaphoreGiveRecursive( xMutex ); - * xSemaphoreGiveRecursive( xMutex ); - * xSemaphoreGiveRecursive( xMutex ); - * - * // Now the mutex can be taken by other tasks. - * } - * else - * { - * // We could not obtain the mutex and can therefore not access - * // the shared resource safely. - * } - * } - * } - * @endcode - * \ingroup Semaphores - */ -#define xSemaphoreTakeRecursive( xMutex, xBlockTime ) xQueueTakeMutexRecursive( ( xMutex ), ( xBlockTime ) ) - -/** @cond */ -/* - * xSemaphoreAltTake() is an alternative version of xSemaphoreTake(). - * - * The source code that implements the alternative (Alt) API is much - * simpler because it executes everything from within a critical section. - * This is the approach taken by many other RTOSes, but FreeRTOS.org has the - * preferred fully featured API too. The fully featured API has more - * complex code that takes longer to execute, but makes much less use of - * critical sections. Therefore the alternative API sacrifices interrupt - * responsiveness to gain execution speed, whereas the fully featured API - * sacrifices execution speed to ensure better interrupt responsiveness. - */ -#define xSemaphoreAltTake( xSemaphore, xBlockTime ) xQueueAltGenericReceive( ( QueueHandle_t ) ( xSemaphore ), NULL, ( xBlockTime ), pdFALSE ) -/** @endcond */ - -/** - * Macro to release a semaphore. The semaphore must have previously been - * created with a call to vSemaphoreCreateBinary(), xSemaphoreCreateMutex() or - * xSemaphoreCreateCounting(). and obtained using sSemaphoreTake(). - * - * This macro must not be used from an ISR. See xSemaphoreGiveFromISR () for - * an alternative which can be used from an ISR. - * - * This macro must also not be used on semaphores created using - * xSemaphoreCreateRecursiveMutex(). - * - * @param xSemaphore A handle to the semaphore being released. This is the - * handle returned when the semaphore was created. - * - * @return pdTRUE if the semaphore was released. pdFALSE if an error occurred. - * Semaphores are implemented using queues. An error can occur if there is - * no space on the queue to post a message - indicating that the - * semaphore was not first obtained correctly. - * - * Example usage: - * @code{c} - * SemaphoreHandle_t xSemaphore = NULL; - * - * void vATask( void * pvParameters ) - * { - * // Create the semaphore to guard a shared resource. - * vSemaphoreCreateBinary( xSemaphore ); - * - * if( xSemaphore != NULL ) - * { - * if( xSemaphoreGive( xSemaphore ) != pdTRUE ) - * { - * // We would expect this call to fail because we cannot give - * // a semaphore without first "taking" it! - * } - * - * // Obtain the semaphore - don't block if the semaphore is not - * // immediately available. - * if( xSemaphoreTake( xSemaphore, ( TickType_t ) 0 ) ) - * { - * // We now have the semaphore and can access the shared resource. - * - * // ... - * - * // We have finished accessing the shared resource so can free the - * // semaphore. - * if( xSemaphoreGive( xSemaphore ) != pdTRUE ) - * { - * // We would not expect this call to fail because we must have - * // obtained the semaphore to get here. - * } - * } - * } - * } - * @endcode - * \ingroup Semaphores - */ -#define xSemaphoreGive( xSemaphore ) xQueueGenericSend( ( QueueHandle_t ) ( xSemaphore ), NULL, semGIVE_BLOCK_TIME, queueSEND_TO_BACK ) - -/** - * Macro to recursively release, or 'give', a mutex type semaphore. - * The mutex must have previously been created using a call to - * xSemaphoreCreateRecursiveMutex(); - * - * configUSE_RECURSIVE_MUTEXES must be set to 1 in FreeRTOSConfig.h for this - * macro to be available. - * - * This macro must not be used on mutexes created using xSemaphoreCreateMutex(). - * - * A mutex used recursively can be 'taken' repeatedly by the owner. The mutex - * doesn't become available again until the owner has called - * xSemaphoreGiveRecursive() for each successful 'take' request. For example, - * if a task successfully 'takes' the same mutex 5 times then the mutex will - * not be available to any other task until it has also 'given' the mutex back - * exactly five times. - * - * @param xMutex A handle to the mutex being released, or 'given'. This is the - * handle returned by xSemaphoreCreateMutex(); - * - * @return pdTRUE if the semaphore was given. - * - * Example usage: - * @code{c} - * SemaphoreHandle_t xMutex = NULL; - * - * // A task that creates a mutex. - * void vATask( void * pvParameters ) - * { - * // Create the mutex to guard a shared resource. - * xMutex = xSemaphoreCreateRecursiveMutex(); - * } - * - * // A task that uses the mutex. - * void vAnotherTask( void * pvParameters ) - * { - * // ... Do other things. - * - * if( xMutex != NULL ) - * { - * // See if we can obtain the mutex. If the mutex is not available - * // wait 10 ticks to see if it becomes free. - * if( xSemaphoreTakeRecursive( xMutex, ( TickType_t ) 10 ) == pdTRUE ) - * { - * // We were able to obtain the mutex and can now access the - * // shared resource. - * - * // ... - * // For some reason due to the nature of the code further calls to - * // xSemaphoreTakeRecursive() are made on the same mutex. In real - * // code these would not be just sequential calls as this would make - * // no sense. Instead the calls are likely to be buried inside - * // a more complex call structure. - * xSemaphoreTakeRecursive( xMutex, ( TickType_t ) 10 ); - * xSemaphoreTakeRecursive( xMutex, ( TickType_t ) 10 ); - * - * // The mutex has now been 'taken' three times, so will not be - * // available to another task until it has also been given back - * // three times. Again it is unlikely that real code would have - * // these calls sequentially, it would be more likely that the calls - * // to xSemaphoreGiveRecursive() would be called as a call stack - * // unwound. This is just for demonstrative purposes. - * xSemaphoreGiveRecursive( xMutex ); - * xSemaphoreGiveRecursive( xMutex ); - * xSemaphoreGiveRecursive( xMutex ); - * - * // Now the mutex can be taken by other tasks. - * } - * else - * { - * // We could not obtain the mutex and can therefore not access - * // the shared resource safely. - * } - * } - * } - * @endcode - * \ingroup Semaphores - */ -#define xSemaphoreGiveRecursive( xMutex ) xQueueGiveMutexRecursive( ( xMutex ) ) - -/** @cond */ -/* - * xSemaphoreAltGive() is an alternative version of xSemaphoreGive(). - * - * The source code that implements the alternative (Alt) API is much - * simpler because it executes everything from within a critical section. - * This is the approach taken by many other RTOSes, but FreeRTOS.org has the - * preferred fully featured API too. The fully featured API has more - * complex code that takes longer to execute, but makes much less use of - * critical sections. Therefore the alternative API sacrifices interrupt - * responsiveness to gain execution speed, whereas the fully featured API - * sacrifices execution speed to ensure better interrupt responsiveness. - */ -#define xSemaphoreAltGive( xSemaphore ) xQueueAltGenericSend( ( QueueHandle_t ) ( xSemaphore ), NULL, semGIVE_BLOCK_TIME, queueSEND_TO_BACK ) - -/** @endcond */ - -/** - * Macro to release a semaphore. The semaphore must have previously been - * created with a call to vSemaphoreCreateBinary() or xSemaphoreCreateCounting(). - * - * Mutex type semaphores (those created using a call to xSemaphoreCreateMutex()) - * must not be used with this macro. - * - * This macro can be used from an ISR. - * - * @param xSemaphore A handle to the semaphore being released. This is the - * handle returned when the semaphore was created. - * - * @param[out] pxHigherPriorityTaskWoken xSemaphoreGiveFromISR() will set - * *pxHigherPriorityTaskWoken to pdTRUE if giving the semaphore caused a task - * to unblock, and the unblocked task has a priority higher than the currently - * running task. If xSemaphoreGiveFromISR() sets this value to pdTRUE then - * a context switch should be requested before the interrupt is exited. - * - * @return pdTRUE if the semaphore was successfully given, otherwise errQUEUE_FULL. - * - * Example usage: - * @code{c} - * \#define LONG_TIME 0xffff - * \#define TICKS_TO_WAIT 10 - * SemaphoreHandle_t xSemaphore = NULL; - * - * // Repetitive task. - * void vATask( void * pvParameters ) - * { - * for( ;; ) - * { - * // We want this task to run every 10 ticks of a timer. The semaphore - * // was created before this task was started. - * - * // Block waiting for the semaphore to become available. - * if( xSemaphoreTake( xSemaphore, LONG_TIME ) == pdTRUE ) - * { - * // It is time to execute. - * - * // ... - * - * // We have finished our task. Return to the top of the loop where - * // we will block on the semaphore until it is time to execute - * // again. Note when using the semaphore for synchronisation with an - * // ISR in this manner there is no need to 'give' the semaphore back. - * } - * } - * } - * - * // Timer ISR - * void vTimerISR( void * pvParameters ) - * { - * static uint8_t ucLocalTickCount = 0; - * static BaseType_t xHigherPriorityTaskWoken; - * - * // A timer tick has occurred. - * - * // ... Do other time functions. - * - * // Is it time for vATask () to run? - * xHigherPriorityTaskWoken = pdFALSE; - * ucLocalTickCount++; - * if( ucLocalTickCount >= TICKS_TO_WAIT ) - * { - * // Unblock the task by releasing the semaphore. - * xSemaphoreGiveFromISR( xSemaphore, &xHigherPriorityTaskWoken ); - * - * // Reset the count so we release the semaphore again in 10 ticks time. - * ucLocalTickCount = 0; - * } - * - * if( xHigherPriorityTaskWoken != pdFALSE ) - * { - * // We can force a context switch here. Context switching from an - * // ISR uses port specific syntax. Check the demo task for your port - * // to find the syntax required. - * } - * } - * @endcode - * \ingroup Semaphores - */ -#define xSemaphoreGiveFromISR( xSemaphore, pxHigherPriorityTaskWoken ) xQueueGiveFromISR( ( QueueHandle_t ) ( xSemaphore ), ( pxHigherPriorityTaskWoken ) ) - -/** - * Macro to take a semaphore from an ISR. The semaphore must have - * previously been created with a call to vSemaphoreCreateBinary() or - * xSemaphoreCreateCounting(). - * - * Mutex type semaphores (those created using a call to xSemaphoreCreateMutex()) - * must not be used with this macro. - * - * This macro can be used from an ISR, however taking a semaphore from an ISR - * is not a common operation. It is likely to only be useful when taking a - * counting semaphore when an interrupt is obtaining an object from a resource - * pool (when the semaphore count indicates the number of resources available). - * - * @param xSemaphore A handle to the semaphore being taken. This is the - * handle returned when the semaphore was created. - * - * @param[out] pxHigherPriorityTaskWoken xSemaphoreTakeFromISR() will set - * *pxHigherPriorityTaskWoken to pdTRUE if taking the semaphore caused a task - * to unblock, and the unblocked task has a priority higher than the currently - * running task. If xSemaphoreTakeFromISR() sets this value to pdTRUE then - * a context switch should be requested before the interrupt is exited. - * - * @return pdTRUE if the semaphore was successfully taken, otherwise - * pdFALSE - */ -#define xSemaphoreTakeFromISR( xSemaphore, pxHigherPriorityTaskWoken ) xQueueReceiveFromISR( ( QueueHandle_t ) ( xSemaphore ), NULL, ( pxHigherPriorityTaskWoken ) ) - -/** - * Macro that implements a mutex semaphore by using the existing queue - * mechanism. - * - * Internally, within the FreeRTOS implementation, mutex semaphores use a block - * of memory, in which the mutex structure is stored. If a mutex is created - * using xSemaphoreCreateMutex() then the required memory is automatically - * dynamically allocated inside the xSemaphoreCreateMutex() function. (see - * http://www.freertos.org/a00111.html). If a mutex is created using - * xSemaphoreCreateMutexStatic() then the application writer must provided the - * memory. xSemaphoreCreateMutexStatic() therefore allows a mutex to be created - * without using any dynamic memory allocation. - * - * Mutexes created using this function can be accessed using the xSemaphoreTake() - * and xSemaphoreGive() macros. The xSemaphoreTakeRecursive() and - * xSemaphoreGiveRecursive() macros must not be used. - * - * This type of semaphore uses a priority inheritance mechanism so a task - * 'taking' a semaphore MUST ALWAYS 'give' the semaphore back once the - * semaphore it is no longer required. - * - * Mutex type semaphores cannot be used from within interrupt service routines. - * - * See vSemaphoreCreateBinary() for an alternative implementation that can be - * used for pure synchronisation (where one task or interrupt always 'gives' the - * semaphore and another always 'takes' the semaphore) and from within interrupt - * service routines. - * - * @return If the mutex was successfully created then a handle to the created - * semaphore is returned. If there was not enough heap to allocate the mutex - * data structures then NULL is returned. - * - * Example usage: - * @code{c} - * SemaphoreHandle_t xSemaphore; - * - * void vATask( void * pvParameters ) - * { - * // Semaphore cannot be used before a call to xSemaphoreCreateMutex(). - * // This is a macro so pass the variable in directly. - * xSemaphore = xSemaphoreCreateMutex(); - * - * if( xSemaphore != NULL ) - * { - * // The semaphore was created successfully. - * // The semaphore can now be used. - * } - * } - * @endcode - * \ingroup Semaphores - */ -#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) - #define xSemaphoreCreateMutex() xQueueCreateMutex( queueQUEUE_TYPE_MUTEX ) -#endif - -/** - * Creates a new mutex type semaphore instance, and returns a handle by which - * the new mutex can be referenced. - * - * Internally, within the FreeRTOS implementation, mutex semaphores use a block - * of memory, in which the mutex structure is stored. If a mutex is created - * using xSemaphoreCreateMutex() then the required memory is automatically - * dynamically allocated inside the xSemaphoreCreateMutex() function. (see - * http://www.freertos.org/a00111.html). If a mutex is created using - * xSemaphoreCreateMutexStatic() then the application writer must provided the - * memory. xSemaphoreCreateMutexStatic() therefore allows a mutex to be created - * without using any dynamic memory allocation. - * - * Mutexes created using this function can be accessed using the xSemaphoreTake() - * and xSemaphoreGive() macros. The xSemaphoreTakeRecursive() and - * xSemaphoreGiveRecursive() macros must not be used. - * - * This type of semaphore uses a priority inheritance mechanism so a task - * 'taking' a semaphore MUST ALWAYS 'give' the semaphore back once the - * semaphore it is no longer required. - * - * Mutex type semaphores cannot be used from within interrupt service routines. - * - * See xSemaphoreCreateBinary() for an alternative implementation that can be - * used for pure synchronisation (where one task or interrupt always 'gives' the - * semaphore and another always 'takes' the semaphore) and from within interrupt - * service routines. - * - * @param pxMutexBuffer Must point to a variable of type StaticSemaphore_t, - * which will be used to hold the mutex's data structure, removing the need for - * the memory to be allocated dynamically. - * - * @return If the mutex was successfully created then a handle to the created - * mutex is returned. If pxMutexBuffer was NULL then NULL is returned. - * - * Example usage: - * @code - * SemaphoreHandle_t xSemaphore; - * StaticSemaphore_t xMutexBuffer; - * - * void vATask( void * pvParameters ) - * { - * // A mutex cannot be used before it has been created. xMutexBuffer is - * // into xSemaphoreCreateMutexStatic() so no dynamic memory allocation is - * // attempted. - * xSemaphore = xSemaphoreCreateMutexStatic( &xMutexBuffer ); - * - * // As no dynamic memory allocation was performed, xSemaphore cannot be NULL, - * // so there is no need to check it. - * } - * @endcode - * \ingroup Semaphores - */ - #if( configSUPPORT_STATIC_ALLOCATION == 1 ) - #define xSemaphoreCreateMutexStatic( pxMutexBuffer ) xQueueCreateMutexStatic( queueQUEUE_TYPE_MUTEX, ( pxMutexBuffer ) ) -#endif /* configSUPPORT_STATIC_ALLOCATION */ - - -/** - * Creates a new recursive mutex type semaphore instance, and returns a handle - * by which the new recursive mutex can be referenced. - * - * Internally, within the FreeRTOS implementation, recursive mutexs use a block - * of memory, in which the mutex structure is stored. If a recursive mutex is - * created using xSemaphoreCreateRecursiveMutex() then the required memory is - * automatically dynamically allocated inside the - * xSemaphoreCreateRecursiveMutex() function. (see - * http://www.freertos.org/a00111.html). If a recursive mutex is created using - * xSemaphoreCreateRecursiveMutexStatic() then the application writer must - * provide the memory that will get used by the mutex. - * xSemaphoreCreateRecursiveMutexStatic() therefore allows a recursive mutex to - * be created without using any dynamic memory allocation. - * - * Mutexes created using this macro can be accessed using the - * xSemaphoreTakeRecursive() and xSemaphoreGiveRecursive() macros. The - * xSemaphoreTake() and xSemaphoreGive() macros must not be used. - * - * A mutex used recursively can be 'taken' repeatedly by the owner. The mutex - * doesn't become available again until the owner has called - * xSemaphoreGiveRecursive() for each successful 'take' request. For example, - * if a task successfully 'takes' the same mutex 5 times then the mutex will - * not be available to any other task until it has also 'given' the mutex back - * exactly five times. - * - * This type of semaphore uses a priority inheritance mechanism so a task - * 'taking' a semaphore MUST ALWAYS 'give' the semaphore back once the - * semaphore it is no longer required. - * - * Mutex type semaphores cannot be used from within interrupt service routines. - * - * See vSemaphoreCreateBinary() for an alternative implementation that can be - * used for pure synchronisation (where one task or interrupt always 'gives' the - * semaphore and another always 'takes' the semaphore) and from within interrupt - * service routines. - * - * @return xSemaphore Handle to the created mutex semaphore. Should be of type - * SemaphoreHandle_t. - * - * Example usage: - * @code{c} - * SemaphoreHandle_t xSemaphore; - * - * void vATask( void * pvParameters ) - * { - * // Semaphore cannot be used before a call to xSemaphoreCreateMutex(). - * // This is a macro so pass the variable in directly. - * xSemaphore = xSemaphoreCreateRecursiveMutex(); - * - * if( xSemaphore != NULL ) - * { - * // The semaphore was created successfully. - * // The semaphore can now be used. - * } - * } - * @endcode - * \ingroup Semaphores - */ -#if( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configUSE_RECURSIVE_MUTEXES == 1 ) ) - #define xSemaphoreCreateRecursiveMutex() xQueueCreateMutex( queueQUEUE_TYPE_RECURSIVE_MUTEX ) -#endif - -/** - * Creates a new recursive mutex type semaphore instance, and returns a handle - * by which the new recursive mutex can be referenced. - * - * Internally, within the FreeRTOS implementation, recursive mutexs use a block - * of memory, in which the mutex structure is stored. If a recursive mutex is - * created using xSemaphoreCreateRecursiveMutex() then the required memory is - * automatically dynamically allocated inside the - * xSemaphoreCreateRecursiveMutex() function. (see - * http://www.freertos.org/a00111.html). If a recursive mutex is created using - * xSemaphoreCreateRecursiveMutexStatic() then the application writer must - * provide the memory that will get used by the mutex. - * xSemaphoreCreateRecursiveMutexStatic() therefore allows a recursive mutex to - * be created without using any dynamic memory allocation. - * - * Mutexes created using this macro can be accessed using the - * xSemaphoreTakeRecursive() and xSemaphoreGiveRecursive() macros. The - * xSemaphoreTake() and xSemaphoreGive() macros must not be used. - * - * A mutex used recursively can be 'taken' repeatedly by the owner. The mutex - * doesn't become available again until the owner has called - * xSemaphoreGiveRecursive() for each successful 'take' request. For example, - * if a task successfully 'takes' the same mutex 5 times then the mutex will - * not be available to any other task until it has also 'given' the mutex back - * exactly five times. - * - * This type of semaphore uses a priority inheritance mechanism so a task - * 'taking' a semaphore MUST ALWAYS 'give' the semaphore back once the - * semaphore it is no longer required. - * - * Mutex type semaphores cannot be used from within interrupt service routines. - * - * See xSemaphoreCreateBinary() for an alternative implementation that can be - * used for pure synchronisation (where one task or interrupt always 'gives' the - * semaphore and another always 'takes' the semaphore) and from within interrupt - * service routines. - * - * @param pxStaticSemaphore Must point to a variable of type StaticSemaphore_t, - * which will then be used to hold the recursive mutex's data structure, - * removing the need for the memory to be allocated dynamically. - * - * @return If the recursive mutex was successfully created then a handle to the - * created recursive mutex is returned. If pxMutexBuffer was NULL then NULL is - * returned. - * - * Example usage: - * @code - * SemaphoreHandle_t xSemaphore; - * StaticSemaphore_t xMutexBuffer; - * - * void vATask( void * pvParameters ) - * { - * // A recursive semaphore cannot be used before it is created. Here a - * // recursive mutex is created using xSemaphoreCreateRecursiveMutexStatic(). - * // The address of xMutexBuffer is passed into the function, and will hold - * // the mutexes data structures - so no dynamic memory allocation will be - * // attempted. - * xSemaphore = xSemaphoreCreateRecursiveMutexStatic( &xMutexBuffer ); - * - * // As no dynamic memory allocation was performed, xSemaphore cannot be NULL, - * // so there is no need to check it. - * } - * @endcode - * \ingroup Semaphores - */ -#if( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configUSE_RECURSIVE_MUTEXES == 1 ) ) - #define xSemaphoreCreateRecursiveMutexStatic( pxStaticSemaphore ) xQueueCreateMutexStatic( queueQUEUE_TYPE_RECURSIVE_MUTEX, pxStaticSemaphore ) -#endif /* configSUPPORT_STATIC_ALLOCATION */ - -/** - * Creates a new counting semaphore instance, and returns a handle by which the - * new counting semaphore can be referenced. - * - * In many usage scenarios it is faster and more memory efficient to use a - * direct to task notification in place of a counting semaphore! - * http://www.freertos.org/RTOS-task-notifications.html - * - * Internally, within the FreeRTOS implementation, counting semaphores use a - * block of memory, in which the counting semaphore structure is stored. If a - * counting semaphore is created using xSemaphoreCreateCounting() then the - * required memory is automatically dynamically allocated inside the - * xSemaphoreCreateCounting() function. (see - * http://www.freertos.org/a00111.html). If a counting semaphore is created - * using xSemaphoreCreateCountingStatic() then the application writer can - * instead optionally provide the memory that will get used by the counting - * semaphore. xSemaphoreCreateCountingStatic() therefore allows a counting - * semaphore to be created without using any dynamic memory allocation. - * - * Counting semaphores are typically used for two things: - * - * 1) Counting events. - * - * In this usage scenario an event handler will 'give' a semaphore each time - * an event occurs (incrementing the semaphore count value), and a handler - * task will 'take' a semaphore each time it processes an event - * (decrementing the semaphore count value). The count value is therefore - * the difference between the number of events that have occurred and the - * number that have been processed. In this case it is desirable for the - * initial count value to be zero. - * - * 2) Resource management. - * - * In this usage scenario the count value indicates the number of resources - * available. To obtain control of a resource a task must first obtain a - * semaphore - decrementing the semaphore count value. When the count value - * reaches zero there are no free resources. When a task finishes with the - * resource it 'gives' the semaphore back - incrementing the semaphore count - * value. In this case it is desirable for the initial count value to be - * equal to the maximum count value, indicating that all resources are free. - * - * @param uxMaxCount The maximum count value that can be reached. When the - * semaphore reaches this value it can no longer be 'given'. - * - * @param uxInitialCount The count value assigned to the semaphore when it is - * created. - * - * @return Handle to the created semaphore. Null if the semaphore could not be - * created. - * - * Example usage: - * @code{c} - * SemaphoreHandle_t xSemaphore; - * - * void vATask( void * pvParameters ) - * { - * SemaphoreHandle_t xSemaphore = NULL; - * - * // Semaphore cannot be used before a call to xSemaphoreCreateCounting(). - * // The max value to which the semaphore can count should be 10, and the - * // initial value assigned to the count should be 0. - * xSemaphore = xSemaphoreCreateCounting( 10, 0 ); - * - * if( xSemaphore != NULL ) - * { - * // The semaphore was created successfully. - * // The semaphore can now be used. - * } - * } - * @endcode - * \ingroup Semaphores - */ -#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) - #define xSemaphoreCreateCounting( uxMaxCount, uxInitialCount ) xQueueCreateCountingSemaphore( ( uxMaxCount ), ( uxInitialCount ) ) -#endif - -/** - * Creates a new counting semaphore instance, and returns a handle by which the - * new counting semaphore can be referenced. - * - * In many usage scenarios it is faster and more memory efficient to use a - * direct to task notification in place of a counting semaphore! - * http://www.freertos.org/RTOS-task-notifications.html - * - * Internally, within the FreeRTOS implementation, counting semaphores use a - * block of memory, in which the counting semaphore structure is stored. If a - * counting semaphore is created using xSemaphoreCreateCounting() then the - * required memory is automatically dynamically allocated inside the - * xSemaphoreCreateCounting() function. (see - * http://www.freertos.org/a00111.html). If a counting semaphore is created - * using xSemaphoreCreateCountingStatic() then the application writer must - * provide the memory. xSemaphoreCreateCountingStatic() therefore allows a - * counting semaphore to be created without using any dynamic memory allocation. - * - * Counting semaphores are typically used for two things: - * - * 1) Counting events. - * - * In this usage scenario an event handler will 'give' a semaphore each time - * an event occurs (incrementing the semaphore count value), and a handler - * task will 'take' a semaphore each time it processes an event - * (decrementing the semaphore count value). The count value is therefore - * the difference between the number of events that have occurred and the - * number that have been processed. In this case it is desirable for the - * initial count value to be zero. - * - * 2) Resource management. - * - * In this usage scenario the count value indicates the number of resources - * available. To obtain control of a resource a task must first obtain a - * semaphore - decrementing the semaphore count value. When the count value - * reaches zero there are no free resources. When a task finishes with the - * resource it 'gives' the semaphore back - incrementing the semaphore count - * value. In this case it is desirable for the initial count value to be - * equal to the maximum count value, indicating that all resources are free. - * - * @param uxMaxCount The maximum count value that can be reached. When the - * semaphore reaches this value it can no longer be 'given'. - * - * @param uxInitialCount The count value assigned to the semaphore when it is - * created. - * - * @param pxSemaphoreBuffer Must point to a variable of type StaticSemaphore_t, - * which will then be used to hold the semaphore's data structure, removing the - * need for the memory to be allocated dynamically. - * - * @return If the counting semaphore was successfully created then a handle to - * the created counting semaphore is returned. If pxSemaphoreBuffer was NULL - * then NULL is returned. - * - * Example usage: - * @code{c} - * SemaphoreHandle_t xSemaphore; - * StaticSemaphore_t xSemaphoreBuffer; - * - * void vATask( void * pvParameters ) - * { - * SemaphoreHandle_t xSemaphore = NULL; - * - * // Counting semaphore cannot be used before they have been created. Create - * // a counting semaphore using xSemaphoreCreateCountingStatic(). The max - * // value to which the semaphore can count is 10, and the initial value - * // assigned to the count will be 0. The address of xSemaphoreBuffer is - * // passed in and will be used to hold the semaphore structure, so no dynamic - * // memory allocation will be used. - * xSemaphore = xSemaphoreCreateCounting( 10, 0, &xSemaphoreBuffer ); - * - * // No memory allocation was attempted so xSemaphore cannot be NULL, so there - * // is no need to check its value. - * } - * @endcode - * \ingroup Semaphores - */ -#if( configSUPPORT_STATIC_ALLOCATION == 1 ) - #define xSemaphoreCreateCountingStatic( uxMaxCount, uxInitialCount, pxSemaphoreBuffer ) xQueueCreateCountingSemaphoreStatic( ( uxMaxCount ), ( uxInitialCount ), ( pxSemaphoreBuffer ) ) -#endif /* configSUPPORT_STATIC_ALLOCATION */ - -/** - * Delete a semaphore. This function must be used with care. For example, - * do not delete a mutex type semaphore if the mutex is held by a task. - * - * @param xSemaphore A handle to the semaphore to be deleted. - * - * \ingroup Semaphores - */ -#define vSemaphoreDelete( xSemaphore ) vQueueDelete( ( QueueHandle_t ) ( xSemaphore ) ) - -/** - * If xMutex is indeed a mutex type semaphore, return the current mutex holder. - * If xMutex is not a mutex type semaphore, or the mutex is available (not held - * by a task), return NULL. - * - * Note: This is a good way of determining if the calling task is the mutex - * holder, but not a good way of determining the identity of the mutex holder as - * the holder may change between the function exiting and the returned value - * being tested. - */ -#define xSemaphoreGetMutexHolder( xSemaphore ) xQueueGetMutexHolder( ( xSemaphore ) ) - -/** - * If the semaphore is a counting semaphore then uxSemaphoreGetCount() returns - * its current count value. If the semaphore is a binary semaphore then - * uxSemaphoreGetCount() returns 1 if the semaphore is available, and 0 if the - * semaphore is not available. - * - */ -#define uxSemaphoreGetCount( xSemaphore ) uxQueueMessagesWaiting( ( QueueHandle_t ) ( xSemaphore ) ) - -#endif /* SEMAPHORE_H */ - - diff --git a/tools/sdk/include/freertos/freertos/task.h b/tools/sdk/include/freertos/freertos/task.h deleted file mode 100644 index 3fc06d9e38a..00000000000 --- a/tools/sdk/include/freertos/freertos/task.h +++ /dev/null @@ -1,2317 +0,0 @@ -/* - FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd. - All rights reserved - - VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. - - This file is part of the FreeRTOS distribution. - - FreeRTOS is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License (version 2) as published by the - Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. - - *************************************************************************** - >>! NOTE: The modification to the GPL is included to allow you to !<< - >>! distribute a combined work that includes FreeRTOS without being !<< - >>! obliged to provide the source code for proprietary components !<< - >>! outside of the FreeRTOS kernel. !<< - *************************************************************************** - - FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. Full license text is available on the following - link: http://www.freertos.org/a00114.html - - *************************************************************************** - * * - * FreeRTOS provides completely free yet professionally developed, * - * robust, strictly quality controlled, supported, and cross * - * platform software that is more than just the market leader, it * - * is the industry's de facto standard. * - * * - * Help yourself get started quickly while simultaneously helping * - * to support the FreeRTOS project by purchasing a FreeRTOS * - * tutorial book, reference manual, or both: * - * http://www.FreeRTOS.org/Documentation * - * * - *************************************************************************** - - http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading - the FAQ page "My application does not run, what could be wrong?". Have you - defined configASSERT()? - - http://www.FreeRTOS.org/support - In return for receiving this top quality - embedded software for free we request you assist our global community by - participating in the support forum. - - http://www.FreeRTOS.org/training - Investing in training allows your team to - be as productive as possible as early as possible. Now you can receive - FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers - Ltd, and the world's leading authority on the world's leading RTOS. - - http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, - including FreeRTOS+Trace - an indispensable productivity tool, a DOS - compatible FAT file system, and our tiny thread aware UDP/IP stack. - - http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. - Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. - - http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High - Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS - licenses offer ticketed support, indemnification and commercial middleware. - - http://www.SafeRTOS.com - High Integrity Systems also provide a safety - engineered and independently SIL3 certified version for use in safety and - mission critical applications that require provable dependability. - - 1 tab == 4 spaces! -*/ - - -#ifndef INC_TASK_H -#define INC_TASK_H - -#ifndef INC_FREERTOS_H - #error "include FreeRTOS.h must appear in source files before include task.h" -#endif - -#include - -#include "list.h" -#include "portmacro.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/*----------------------------------------------------------- - * MACROS AND DEFINITIONS - *----------------------------------------------------------*/ - -#define tskKERNEL_VERSION_NUMBER "V8.2.0" -#define tskKERNEL_VERSION_MAJOR 8 -#define tskKERNEL_VERSION_MINOR 2 -#define tskKERNEL_VERSION_BUILD 0 - -/** - * @brief Argument of xTaskCreatePinnedToCore indicating that task has no affinity - */ -#define tskNO_AFFINITY INT_MAX - -/** - * task. h - * - * Type by which tasks are referenced. For example, a call to xTaskCreate - * returns (via a pointer parameter) an TaskHandle_t variable that can then - * be used as a parameter to vTaskDelete to delete the task. - * - * \ingroup Tasks - */ -typedef void * TaskHandle_t; - -/** - * Defines the prototype to which the application task hook function must - * conform. - */ -typedef BaseType_t (*TaskHookFunction_t)( void * ); - -/** Task states returned by eTaskGetState. */ -typedef enum -{ - eRunning = 0, /*!< A task is querying the state of itself, so must be running. */ - eReady, /*!< The task being queried is in a read or pending ready list. */ - eBlocked, /*!< The task being queried is in the Blocked state. */ - eSuspended, /*!< The task being queried is in the Suspended state, or is in the Blocked state with an infinite time out. */ - eDeleted /*!< The task being queried has been deleted, but its TCB has not yet been freed. */ -} eTaskState; - -/** Actions that can be performed when vTaskNotify() is called. */ -typedef enum -{ - eNoAction = 0, /*!< Notify the task without updating its notify value. */ - eSetBits, /*!< Set bits in the task's notification value. */ - eIncrement, /*!< Increment the task's notification value. */ - eSetValueWithOverwrite, /*!< Set the task's notification value to a specific value even if the previous value has not yet been read by the task. */ - eSetValueWithoutOverwrite /*!< Set the task's notification value if the previous value has been read by the task. */ -} eNotifyAction; - -/** @cond */ -/** - * Used internally only. - */ -typedef struct xTIME_OUT -{ - BaseType_t xOverflowCount; - TickType_t xTimeOnEntering; -} TimeOut_t; - -/** - * Defines the memory ranges allocated to the task when an MPU is used. - */ -typedef struct xMEMORY_REGION -{ - void *pvBaseAddress; - uint32_t ulLengthInBytes; - uint32_t ulParameters; -} MemoryRegion_t; - -/** - * Parameters required to create an MPU protected task. - */ -typedef struct xTASK_PARAMETERS -{ - TaskFunction_t pvTaskCode; - const char * const pcName; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ - uint32_t usStackDepth; - void *pvParameters; - UBaseType_t uxPriority; - StackType_t *puxStackBuffer; - MemoryRegion_t xRegions[ portNUM_CONFIGURABLE_REGIONS ]; -} TaskParameters_t; -/** @endcond */ - -/** - * Used with the uxTaskGetSystemState() function to return the state of each task in the system. -*/ -typedef struct xTASK_STATUS -{ - TaskHandle_t xHandle; /*!< The handle of the task to which the rest of the information in the structure relates. */ - const char *pcTaskName; /*!< A pointer to the task's name. This value will be invalid if the task was deleted since the structure was populated! */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ - UBaseType_t xTaskNumber; /*!< A number unique to the task. */ - eTaskState eCurrentState; /*!< The state in which the task existed when the structure was populated. */ - UBaseType_t uxCurrentPriority; /*!< The priority at which the task was running (may be inherited) when the structure was populated. */ - UBaseType_t uxBasePriority; /*!< The priority to which the task will return if the task's current priority has been inherited to avoid unbounded priority inversion when obtaining a mutex. Only valid if configUSE_MUTEXES is defined as 1 in FreeRTOSConfig.h. */ - uint32_t ulRunTimeCounter; /*!< The total run time allocated to the task so far, as defined by the run time stats clock. See http://www.freertos.org/rtos-run-time-stats.html. Only valid when configGENERATE_RUN_TIME_STATS is defined as 1 in FreeRTOSConfig.h. */ - StackType_t *pxStackBase; /*!< Points to the lowest address of the task's stack area. */ - uint32_t usStackHighWaterMark; /*!< The minimum amount of stack space that has remained for the task since the task was created. The closer this value is to zero the closer the task has come to overflowing its stack. */ -#if configTASKLIST_INCLUDE_COREID - BaseType_t xCoreID; /*!< Core this task is pinned to. This field is present if CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID is set. */ -#endif -} TaskStatus_t; - -/** - * Used with the uxTaskGetSnapshotAll() function to save memory snapshot of each task in the system. - * We need this struct because TCB_t is defined (hidden) in tasks.c. - */ -typedef struct xTASK_SNAPSHOT -{ - void *pxTCB; /*!< Address of task control block. */ - StackType_t *pxTopOfStack; /*!< Points to the location of the last item placed on the tasks stack. */ - StackType_t *pxEndOfStack; /*!< Points to the end of the stack. pxTopOfStack < pxEndOfStack, stack grows hi2lo - pxTopOfStack > pxEndOfStack, stack grows lo2hi*/ -} TaskSnapshot_t; - -/** - * Possible return values for eTaskConfirmSleepModeStatus(). - */ -typedef enum -{ - eAbortSleep = 0, /*!< A task has been made ready or a context switch pended since portSUPPORESS_TICKS_AND_SLEEP() was called - abort entering a sleep mode. */ - eStandardSleep, /*!< Enter a sleep mode that will not last any longer than the expected idle time. */ - eNoTasksWaitingTimeout /*!< No tasks are waiting for a timeout so it is safe to enter a sleep mode that can only be exited by an external interrupt. */ -} eSleepModeStatus; - - -/** - * Defines the priority used by the idle task. This must not be modified. - * - * \ingroup TaskUtils - */ -#define tskIDLE_PRIORITY ( ( UBaseType_t ) 0U ) - -/** - * task. h - * - * Macro for forcing a context switch. - * - * \ingroup SchedulerControl - */ -#define taskYIELD() portYIELD() - -/** - * task. h - * - * Macro to mark the start of a critical code region. Preemptive context - * switches cannot occur when in a critical region. - * - * @note This may alter the stack (depending on the portable implementation) - * so must be used with care! - * - * \ingroup SchedulerControl - */ -#ifdef _ESP_FREERTOS_INTERNAL -#define taskENTER_CRITICAL(mux) portENTER_CRITICAL(mux) -#else -#define taskENTER_CRITICAL(mux) _Pragma("GCC warning \"'taskENTER_CRITICAL(mux)' is deprecated in ESP-IDF, consider using 'portENTER_CRITICAL(mux)'\"") portENTER_CRITICAL(mux) -#endif -#define taskENTER_CRITICAL_ISR(mux) portENTER_CRITICAL_ISR(mux) - -/** - * task. h - * - * Macro to mark the end of a critical code region. Preemptive context - * switches cannot occur when in a critical region. - * - * @note This may alter the stack (depending on the portable implementation) - * so must be used with care! - * - * \ingroup SchedulerControl - */ -#ifdef _ESP_FREERTOS_INTERNAL -#define taskEXIT_CRITICAL(mux) portEXIT_CRITICAL(mux) -#else -#define taskEXIT_CRITICAL(mux) _Pragma("GCC warning \"'taskEXIT_CRITICAL(mux)' is deprecated in ESP-IDF, consider using 'portEXIT_CRITICAL(mux)'\"") portEXIT_CRITICAL(mux) -#endif -#define taskEXIT_CRITICAL_ISR(mux) portEXIT_CRITICAL_ISR(mux) - -/** - * task. h - * - * Macro to disable all maskable interrupts. - * - * \ingroup SchedulerControl - */ -#define taskDISABLE_INTERRUPTS() portDISABLE_INTERRUPTS() - -/** - * task. h - * - * Macro to enable microcontroller interrupts. - * - * \ingroup SchedulerControl - */ -#define taskENABLE_INTERRUPTS() portENABLE_INTERRUPTS() - -/* Definitions returned by xTaskGetSchedulerState(). taskSCHEDULER_SUSPENDED is -0 to generate more optimal code when configASSERT() is defined as the constant -is used in assert() statements. */ -#define taskSCHEDULER_SUSPENDED ( ( BaseType_t ) 0 ) -#define taskSCHEDULER_NOT_STARTED ( ( BaseType_t ) 1 ) -#define taskSCHEDULER_RUNNING ( ( BaseType_t ) 2 ) - - -/*----------------------------------------------------------- - * TASK CREATION API - *----------------------------------------------------------*/ - -/** - * Create a new task with a specified affinity. - * - * This function is similar to xTaskCreate, but allows setting task affinity - * in SMP system. - * - * @param pvTaskCode Pointer to the task entry function. Tasks - * must be implemented to never return (i.e. continuous loop). - * - * @param pcName A descriptive name for the task. This is mainly used to - * facilitate debugging. Max length defined by configMAX_TASK_NAME_LEN - default - * is 16. - * - * @param usStackDepth The size of the task stack specified as the number of - * bytes. Note that this differs from vanilla FreeRTOS. - * - * @param pvParameters Pointer that will be used as the parameter for the task - * being created. - * - * @param uxPriority The priority at which the task should run. Systems that - * include MPU support can optionally create tasks in a privileged (system) - * mode by setting bit portPRIVILEGE_BIT of the priority parameter. For - * example, to create a privileged task at priority 2 the uxPriority parameter - * should be set to ( 2 | portPRIVILEGE_BIT ). - * - * @param pvCreatedTask Used to pass back a handle by which the created task - * can be referenced. - * - * @param xCoreID If the value is tskNO_AFFINITY, the created task is not - * pinned to any CPU, and the scheduler can run it on any core available. - * Other values indicate the index number of the CPU which the task should - * be pinned to. Specifying values larger than (portNUM_PROCESSORS - 1) will - * cause the function to fail. - * - * @return pdPASS if the task was successfully created and added to a ready - * list, otherwise an error code defined in the file projdefs.h - * - * \ingroup Tasks - */ -#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) - BaseType_t xTaskCreatePinnedToCore( TaskFunction_t pvTaskCode, - const char * const pcName, - const uint32_t usStackDepth, - void * const pvParameters, - UBaseType_t uxPriority, - TaskHandle_t * const pvCreatedTask, - const BaseType_t xCoreID); - -#endif - -/** - * Create a new task and add it to the list of tasks that are ready to run. - * - * Internally, within the FreeRTOS implementation, tasks use two blocks of - * memory. The first block is used to hold the task's data structures. The - * second block is used by the task as its stack. If a task is created using - * xTaskCreate() then both blocks of memory are automatically dynamically - * allocated inside the xTaskCreate() function. (see - * http://www.freertos.org/a00111.html). If a task is created using - * xTaskCreateStatic() then the application writer must provide the required - * memory. xTaskCreateStatic() therefore allows a task to be created without - * using any dynamic memory allocation. - * - * See xTaskCreateStatic() for a version that does not use any dynamic memory - * allocation. - * - * xTaskCreate() can only be used to create a task that has unrestricted - * access to the entire microcontroller memory map. Systems that include MPU - * support can alternatively create an MPU constrained task using - * xTaskCreateRestricted(). - * - * @param pvTaskCode Pointer to the task entry function. Tasks - * must be implemented to never return (i.e. continuous loop). - * - * @param pcName A descriptive name for the task. This is mainly used to - * facilitate debugging. Max length defined by configMAX_TASK_NAME_LEN - default - * is 16. - * - * @param usStackDepth The size of the task stack specified as the number of - * bytes. Note that this differs from vanilla FreeRTOS. - * - * @param pvParameters Pointer that will be used as the parameter for the task - * being created. - * - * @param uxPriority The priority at which the task should run. Systems that - * include MPU support can optionally create tasks in a privileged (system) - * mode by setting bit portPRIVILEGE_BIT of the priority parameter. For - * example, to create a privileged task at priority 2 the uxPriority parameter - * should be set to ( 2 | portPRIVILEGE_BIT ). - * - * @param pvCreatedTask Used to pass back a handle by which the created task - * can be referenced. - * - * @return pdPASS if the task was successfully created and added to a ready - * list, otherwise an error code defined in the file projdefs.h - * - * @note If program uses thread local variables (ones specified with "__thread" keyword) - * then storage for them will be allocated on the task's stack. - * - * Example usage: - * @code{c} - * // Task to be created. - * void vTaskCode( void * pvParameters ) - * { - * for( ;; ) - * { - * // Task code goes here. - * } - * } - * - * // Function that creates a task. - * void vOtherFunction( void ) - * { - * static uint8_t ucParameterToPass; - * TaskHandle_t xHandle = NULL; - * - * // Create the task, storing the handle. Note that the passed parameter ucParameterToPass - * // must exist for the lifetime of the task, so in this case is declared static. If it was just an - * // an automatic stack variable it might no longer exist, or at least have been corrupted, by the time - * // the new task attempts to access it. - * xTaskCreate( vTaskCode, "NAME", STACK_SIZE, &ucParameterToPass, tskIDLE_PRIORITY, &xHandle ); - * configASSERT( xHandle ); - * - * // Use the handle to delete the task. - * if( xHandle != NULL ) - * { - * vTaskDelete( xHandle ); - * } - * } - * @endcode - * \ingroup Tasks - */ - -#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) - - static inline IRAM_ATTR BaseType_t xTaskCreate( - TaskFunction_t pvTaskCode, - const char * const pcName, - const uint32_t usStackDepth, - void * const pvParameters, - UBaseType_t uxPriority, - TaskHandle_t * const pvCreatedTask) - { - return xTaskCreatePinnedToCore( pvTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pvCreatedTask, tskNO_AFFINITY ); - } - -#endif - - - - -/** - * Create a new task with a specified affinity. - * - * This function is similar to xTaskCreateStatic, but allows specifying - * task affinity in an SMP system. - * - * @param pvTaskCode Pointer to the task entry function. Tasks - * must be implemented to never return (i.e. continuous loop). - * - * @param pcName A descriptive name for the task. This is mainly used to - * facilitate debugging. The maximum length of the string is defined by - * configMAX_TASK_NAME_LEN in FreeRTOSConfig.h. - * - * @param ulStackDepth The size of the task stack specified as the number of - * bytes. Note that this differs from vanilla FreeRTOS. - * - * @param pvParameters Pointer that will be used as the parameter for the task - * being created. - * - * @param uxPriority The priority at which the task will run. - * - * @param pxStackBuffer Must point to a StackType_t array that has at least - * ulStackDepth indexes - the array will then be used as the task's stack, - * removing the need for the stack to be allocated dynamically. - * - * @param pxTaskBuffer Must point to a variable of type StaticTask_t, which will - * then be used to hold the task's data structures, removing the need for the - * memory to be allocated dynamically. - * - * @param xCoreID If the value is tskNO_AFFINITY, the created task is not - * pinned to any CPU, and the scheduler can run it on any core available. - * Other values indicate the index number of the CPU which the task should - * be pinned to. Specifying values larger than (portNUM_PROCESSORS - 1) will - * cause the function to fail. - * - * @return If neither pxStackBuffer or pxTaskBuffer are NULL, then the task will - * be created and pdPASS is returned. If either pxStackBuffer or pxTaskBuffer - * are NULL then the task will not be created and - * errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY is returned. - * - * \ingroup Tasks - */ -#if( configSUPPORT_STATIC_ALLOCATION == 1 ) - TaskHandle_t xTaskCreateStaticPinnedToCore( TaskFunction_t pvTaskCode, - const char * const pcName, - const uint32_t ulStackDepth, - void * const pvParameters, - UBaseType_t uxPriority, - StackType_t * const pxStackBuffer, - StaticTask_t * const pxTaskBuffer, - const BaseType_t xCoreID ); -#endif /* configSUPPORT_STATIC_ALLOCATION */ - -/** - * Create a new task and add it to the list of tasks that are ready to run. - * - * Internally, within the FreeRTOS implementation, tasks use two blocks of - * memory. The first block is used to hold the task's data structures. The - * second block is used by the task as its stack. If a task is created using - * xTaskCreate() then both blocks of memory are automatically dynamically - * allocated inside the xTaskCreate() function. (see - * http://www.freertos.org/a00111.html). If a task is created using - * xTaskCreateStatic() then the application writer must provide the required - * memory. xTaskCreateStatic() therefore allows a task to be created without - * using any dynamic memory allocation. - * - * @param pvTaskCode Pointer to the task entry function. Tasks - * must be implemented to never return (i.e. continuous loop). - * - * @param pcName A descriptive name for the task. This is mainly used to - * facilitate debugging. The maximum length of the string is defined by - * configMAX_TASK_NAME_LEN in FreeRTOSConfig.h. - * - * @param ulStackDepth The size of the task stack specified as the number of - * bytes. Note that this differs from vanilla FreeRTOS. - * - * @param pvParameters Pointer that will be used as the parameter for the task - * being created. - * - * @param uxPriority The priority at which the task will run. - * - * @param pxStackBuffer Must point to a StackType_t array that has at least - * ulStackDepth indexes - the array will then be used as the task's stack, - * removing the need for the stack to be allocated dynamically. - * - * @param pxTaskBuffer Must point to a variable of type StaticTask_t, which will - * then be used to hold the task's data structures, removing the need for the - * memory to be allocated dynamically. - * - * @return If neither pxStackBuffer or pxTaskBuffer are NULL, then the task will - * be created and pdPASS is returned. If either pxStackBuffer or pxTaskBuffer - * are NULL then the task will not be created and - * errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY is returned. - * - * @note If program uses thread local variables (ones specified with "__thread" keyword) - * then storage for them will be allocated on the task's stack. - * - * Example usage: - * @code{c} - * - * // Dimensions the buffer that the task being created will use as its stack. - * // NOTE: This is the number of bytes the stack will hold, not the number of - * // words as found in vanilla FreeRTOS. - * #define STACK_SIZE 200 - * - * // Structure that will hold the TCB of the task being created. - * StaticTask_t xTaskBuffer; - * - * // Buffer that the task being created will use as its stack. Note this is - * // an array of StackType_t variables. The size of StackType_t is dependent on - * // the RTOS port. - * StackType_t xStack[ STACK_SIZE ]; - * - * // Function that implements the task being created. - * void vTaskCode( void * pvParameters ) - * { - * // The parameter value is expected to be 1 as 1 is passed in the - * // pvParameters value in the call to xTaskCreateStatic(). - * configASSERT( ( uint32_t ) pvParameters == 1UL ); - * - * for( ;; ) - * { - * // Task code goes here. - * } - * } - * - * // Function that creates a task. - * void vOtherFunction( void ) - * { - * TaskHandle_t xHandle = NULL; - * - * // Create the task without using any dynamic memory allocation. - * xHandle = xTaskCreateStatic( - * vTaskCode, // Function that implements the task. - * "NAME", // Text name for the task. - * STACK_SIZE, // Stack size in bytes, not words. - * ( void * ) 1, // Parameter passed into the task. - * tskIDLE_PRIORITY,// Priority at which the task is created. - * xStack, // Array to use as the task's stack. - * &xTaskBuffer ); // Variable to hold the task's data structure. - * - * // puxStackBuffer and pxTaskBuffer were not NULL, so the task will have - * // been created, and xHandle will be the task's handle. Use the handle - * // to suspend the task. - * vTaskSuspend( xHandle ); - * } - * @endcode - * \ingroup Tasks - */ - -#if( configSUPPORT_STATIC_ALLOCATION == 1 ) - static inline IRAM_ATTR TaskHandle_t xTaskCreateStatic( - TaskFunction_t pvTaskCode, - const char * const pcName, - const uint32_t ulStackDepth, - void * const pvParameters, - UBaseType_t uxPriority, - StackType_t * const pxStackBuffer, - StaticTask_t * const pxTaskBuffer) - { - return xTaskCreateStaticPinnedToCore( pvTaskCode, pcName, ulStackDepth, pvParameters, uxPriority, pxStackBuffer, pxTaskBuffer, tskNO_AFFINITY ); - } -#endif /* configSUPPORT_STATIC_ALLOCATION */ - -/** @cond */ -/** - * xTaskCreateRestricted() should only be used in systems that include an MPU - * implementation. - * - * Create a new task and add it to the list of tasks that are ready to run. - * The function parameters define the memory regions and associated access - * permissions allocated to the task. - * - * @param pxTaskDefinition Pointer to a structure that contains a member - * for each of the normal xTaskCreate() parameters (see the xTaskCreate() API - * documentation) plus an optional stack buffer and the memory region - * definitions. - * - * @param pxCreatedTask Used to pass back a handle by which the created task - * can be referenced. - * - * @return pdPASS if the task was successfully created and added to a ready - * list, otherwise an error code defined in the file projdefs.h - * - * Example usage: - * @code{c} - * // Create an TaskParameters_t structure that defines the task to be created. - * static const TaskParameters_t xCheckTaskParameters = - * { - * vATask, // pvTaskCode - the function that implements the task. - * "ATask", // pcName - just a text name for the task to assist debugging. - * 100, // usStackDepth - the stack size DEFINED IN BYTES. - * NULL, // pvParameters - passed into the task function as the function parameters. - * ( 1UL | portPRIVILEGE_BIT ),// uxPriority - task priority, set the portPRIVILEGE_BIT if the task should run in a privileged state. - * cStackBuffer,// puxStackBuffer - the buffer to be used as the task stack. - * - * // xRegions - Allocate up to three separate memory regions for access by - * // the task, with appropriate access permissions. Different processors have - * // different memory alignment requirements - refer to the FreeRTOS documentation - * // for full information. - * { - * // Base address Length Parameters - * { cReadWriteArray, 32, portMPU_REGION_READ_WRITE }, - * { cReadOnlyArray, 32, portMPU_REGION_READ_ONLY }, - * { cPrivilegedOnlyAccessArray, 128, portMPU_REGION_PRIVILEGED_READ_WRITE } - * } - * }; - * - * int main( void ) - * { - * TaskHandle_t xHandle; - * - * // Create a task from the const structure defined above. The task handle - * // is requested (the second parameter is not NULL) but in this case just for - * // demonstration purposes as its not actually used. - * xTaskCreateRestricted( &xRegTest1Parameters, &xHandle ); - * - * // Start the scheduler. - * vTaskStartScheduler(); - * - * // Will only get here if there was insufficient memory to create the idle - * // and/or timer task. - * for( ;; ); - * } - * @endcode - * \ingroup Tasks - */ -#if( portUSING_MPU_WRAPPERS == 1 ) - BaseType_t xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition, TaskHandle_t *pxCreatedTask ) PRIVILEGED_FUNCTION; -#endif - - -/** - * Memory regions are assigned to a restricted task when the task is created by - * a call to xTaskCreateRestricted(). These regions can be redefined using - * vTaskAllocateMPURegions(). - * - * @param xTask The handle of the task being updated. - * - * @param xRegions A pointer to an MemoryRegion_t structure that contains the - * new memory region definitions. - * - * Example usage: - * - * @code{c} - * // Define an array of MemoryRegion_t structures that configures an MPU region - * // allowing read/write access for 1024 bytes starting at the beginning of the - * // ucOneKByte array. The other two of the maximum 3 definable regions are - * // unused so set to zero. - * static const MemoryRegion_t xAltRegions[ portNUM_CONFIGURABLE_REGIONS ] = - * { - * // Base address Length Parameters - * { ucOneKByte, 1024, portMPU_REGION_READ_WRITE }, - * { 0, 0, 0 }, - * { 0, 0, 0 } - * }; - * - * void vATask( void *pvParameters ) - * { - * // This task was created such that it has access to certain regions of - * // memory as defined by the MPU configuration. At some point it is - * // desired that these MPU regions are replaced with that defined in the - * // xAltRegions const struct above. Use a call to vTaskAllocateMPURegions() - * // for this purpose. NULL is used as the task handle to indicate that this - * // function should modify the MPU regions of the calling task. - * vTaskAllocateMPURegions( NULL, xAltRegions ); - * - * // Now the task can continue its function, but from this point on can only - * // access its stack and the ucOneKByte array (unless any other statically - * // defined or shared regions have been declared elsewhere). - * } - * @endcode - * \ingroup Tasks - */ -void vTaskAllocateMPURegions( TaskHandle_t xTask, const MemoryRegion_t * const pxRegions ) PRIVILEGED_FUNCTION; - -/** @endcond */ - -/** - * Remove a task from the RTOS real time kernel's management. - * - * The task being deleted will be removed from all ready, blocked, suspended - * and event lists. - * - * INCLUDE_vTaskDelete must be defined as 1 for this function to be available. - * See the configuration section for more information. - * - * @note The idle task is responsible for freeing the kernel allocated - * memory from tasks that have been deleted. It is therefore important that - * the idle task is not starved of microcontroller processing time if your - * application makes any calls to vTaskDelete (). Memory allocated by the - * task code is not automatically freed, and should be freed before the task - * is deleted. - * - * See the demo application file death.c for sample code that utilises - * vTaskDelete (). - * - * @param xTaskToDelete The handle of the task to be deleted. Passing NULL will - * cause the calling task to be deleted. - * - * Example usage: - * @code{c} - * void vOtherFunction( void ) - * { - * TaskHandle_t xHandle; - * - * // Create the task, storing the handle. - * xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle ); - * - * // Use the handle to delete the task. - * vTaskDelete( xHandle ); - * } - * @endcode - * \ingroup Tasks - */ -void vTaskDelete( TaskHandle_t xTaskToDelete ) PRIVILEGED_FUNCTION; - -/*----------------------------------------------------------- - * TASK CONTROL API - *----------------------------------------------------------*/ - -/** - * Delay a task for a given number of ticks. - * - * The actual time that the task remains blocked depends on the tick rate. - * The constant portTICK_PERIOD_MS can be used to calculate real time from - * the tick rate - with the resolution of one tick period. - * - * INCLUDE_vTaskDelay must be defined as 1 for this function to be available. - * See the configuration section for more information. - * - * vTaskDelay() specifies a time at which the task wishes to unblock relative to - * the time at which vTaskDelay() is called. For example, specifying a block - * period of 100 ticks will cause the task to unblock 100 ticks after - * vTaskDelay() is called. vTaskDelay() does not therefore provide a good method - * of controlling the frequency of a periodic task as the path taken through the - * code, as well as other task and interrupt activity, will effect the frequency - * at which vTaskDelay() gets called and therefore the time at which the task - * next executes. See vTaskDelayUntil() for an alternative API function designed - * to facilitate fixed frequency execution. It does this by specifying an - * absolute time (rather than a relative time) at which the calling task should - * unblock. - * - * @param xTicksToDelay The amount of time, in tick periods, that - * the calling task should block. - * - * Example usage: - * @code{c} - * void vTaskFunction( void * pvParameters ) - * { - * // Block for 500ms. - * const TickType_t xDelay = 500 / portTICK_PERIOD_MS; - * - * for( ;; ) - * { - * // Simply toggle the LED every 500ms, blocking between each toggle. - * vToggleLED(); - * vTaskDelay( xDelay ); - * } - * } - * @endcode - * \ingroup TaskCtrl - */ -void vTaskDelay( const TickType_t xTicksToDelay ) PRIVILEGED_FUNCTION; - -/** - * Delay a task until a specified time. - * - * INCLUDE_vTaskDelayUntil must be defined as 1 for this function to be available. - * See the configuration section for more information. - * - * This function can be used by periodic tasks to ensure a constant execution frequency. - * - * This function differs from vTaskDelay () in one important aspect: vTaskDelay () will - * cause a task to block for the specified number of ticks from the time vTaskDelay () is - * called. It is therefore difficult to use vTaskDelay () by itself to generate a fixed - * execution frequency as the time between a task starting to execute and that task - * calling vTaskDelay () may not be fixed [the task may take a different path though the - * code between calls, or may get interrupted or preempted a different number of times - * each time it executes]. - * - * Whereas vTaskDelay () specifies a wake time relative to the time at which the function - * is called, vTaskDelayUntil () specifies the absolute (exact) time at which it wishes to - * unblock. - * - * The constant portTICK_PERIOD_MS can be used to calculate real time from the tick - * rate - with the resolution of one tick period. - * - * @param pxPreviousWakeTime Pointer to a variable that holds the time at which the - * task was last unblocked. The variable must be initialised with the current time - * prior to its first use (see the example below). Following this the variable is - * automatically updated within vTaskDelayUntil (). - * - * @param xTimeIncrement The cycle time period. The task will be unblocked at - * time *pxPreviousWakeTime + xTimeIncrement. Calling vTaskDelayUntil with the - * same xTimeIncrement parameter value will cause the task to execute with - * a fixed interface period. - * - * Example usage: - * @code{c} - * // Perform an action every 10 ticks. - * void vTaskFunction( void * pvParameters ) - * { - * TickType_t xLastWakeTime; - * const TickType_t xFrequency = 10; - * - * // Initialise the xLastWakeTime variable with the current time. - * xLastWakeTime = xTaskGetTickCount (); - * for( ;; ) - * { - * // Wait for the next cycle. - * vTaskDelayUntil( &xLastWakeTime, xFrequency ); - * - * // Perform action here. - * } - * } - * @endcode - * \ingroup TaskCtrl - */ -void vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xTimeIncrement ) PRIVILEGED_FUNCTION; - -/** - * Obtain the priority of any task. - * - * INCLUDE_uxTaskPriorityGet must be defined as 1 for this function to be available. - * See the configuration section for more information. - * - * @param xTask Handle of the task to be queried. Passing a NULL - * handle results in the priority of the calling task being returned. - * - * @return The priority of xTask. - * - * Example usage: - * @code{c} - * void vAFunction( void ) - * { - * TaskHandle_t xHandle; - * - * // Create a task, storing the handle. - * xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle ); - * - * // ... - * - * // Use the handle to obtain the priority of the created task. - * // It was created with tskIDLE_PRIORITY, but may have changed - * // it itself. - * if( uxTaskPriorityGet( xHandle ) != tskIDLE_PRIORITY ) - * { - * // The task has changed it's priority. - * } - * - * // ... - * - * // Is our priority higher than the created task? - * if( uxTaskPriorityGet( xHandle ) < uxTaskPriorityGet( NULL ) ) - * { - * // Our priority (obtained using NULL handle) is higher. - * } - * } - * @endcode - * \ingroup TaskCtrl - */ -UBaseType_t uxTaskPriorityGet( TaskHandle_t xTask ) PRIVILEGED_FUNCTION; - -/** - * A version of uxTaskPriorityGet() that can be used from an ISR. - * - * @param xTask Handle of the task to be queried. Passing a NULL - * handle results in the priority of the calling task being returned. - * - * @return The priority of xTask. - * - */ -UBaseType_t uxTaskPriorityGetFromISR( TaskHandle_t xTask ) PRIVILEGED_FUNCTION; - -/** - * Obtain the state of any task. - * - * States are encoded by the eTaskState enumerated type. - * - * INCLUDE_eTaskGetState must be defined as 1 for this function to be available. - * See the configuration section for more information. - * - * @param xTask Handle of the task to be queried. - * - * @return The state of xTask at the time the function was called. Note the - * state of the task might change between the function being called, and the - * functions return value being tested by the calling task. - */ -eTaskState eTaskGetState( TaskHandle_t xTask ) PRIVILEGED_FUNCTION; - -/** - * Set the priority of any task. - * - * INCLUDE_vTaskPrioritySet must be defined as 1 for this function to be available. - * See the configuration section for more information. - * - * A context switch will occur before the function returns if the priority - * being set is higher than the currently executing task. - * - * @param xTask Handle to the task for which the priority is being set. - * Passing a NULL handle results in the priority of the calling task being set. - * - * @param uxNewPriority The priority to which the task will be set. - * - * Example usage: - * @code{c} - * void vAFunction( void ) - * { - * TaskHandle_t xHandle; - * - * // Create a task, storing the handle. - * xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle ); - * - * // ... - * - * // Use the handle to raise the priority of the created task. - * vTaskPrioritySet( xHandle, tskIDLE_PRIORITY + 1 ); - * - * // ... - * - * // Use a NULL handle to raise our priority to the same value. - * vTaskPrioritySet( NULL, tskIDLE_PRIORITY + 1 ); - * } - * @endcode - * \ingroup TaskCtrl - */ -void vTaskPrioritySet( TaskHandle_t xTask, UBaseType_t uxNewPriority ) PRIVILEGED_FUNCTION; - -/** - * Suspend a task. - * - * INCLUDE_vTaskSuspend must be defined as 1 for this function to be available. - * See the configuration section for more information. - * - * When suspended, a task will never get any microcontroller processing time, - * no matter what its priority. - * - * Calls to vTaskSuspend are not accumulative - - * i.e. calling vTaskSuspend () twice on the same task still only requires one - * call to vTaskResume () to ready the suspended task. - * - * @param xTaskToSuspend Handle to the task being suspended. Passing a NULL - * handle will cause the calling task to be suspended. - * - * Example usage: - * @code{c} - * void vAFunction( void ) - * { - * TaskHandle_t xHandle; - * - * // Create a task, storing the handle. - * xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle ); - * - * // ... - * - * // Use the handle to suspend the created task. - * vTaskSuspend( xHandle ); - * - * // ... - * - * // The created task will not run during this period, unless - * // another task calls vTaskResume( xHandle ). - * - * //... - * - * - * // Suspend ourselves. - * vTaskSuspend( NULL ); - * - * // We cannot get here unless another task calls vTaskResume - * // with our handle as the parameter. - * } - * @endcode - * \ingroup TaskCtrl - */ -void vTaskSuspend( TaskHandle_t xTaskToSuspend ) PRIVILEGED_FUNCTION; - -/** - * Resumes a suspended task. - * - * INCLUDE_vTaskSuspend must be defined as 1 for this function to be available. - * See the configuration section for more information. - * - * A task that has been suspended by one or more calls to vTaskSuspend () - * will be made available for running again by a single call to - * vTaskResume (). - * - * @param xTaskToResume Handle to the task being readied. - * - * Example usage: - * @code{c} - * void vAFunction( void ) - * { - * TaskHandle_t xHandle; - * - * // Create a task, storing the handle. - * xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle ); - * - * // ... - * - * // Use the handle to suspend the created task. - * vTaskSuspend( xHandle ); - * - * // ... - * - * // The created task will not run during this period, unless - * // another task calls vTaskResume( xHandle ). - * - * //... - * - * - * // Resume the suspended task ourselves. - * vTaskResume( xHandle ); - * - * // The created task will once again get microcontroller processing - * // time in accordance with its priority within the system. - * } - * @endcode - * \ingroup TaskCtrl - */ -void vTaskResume( TaskHandle_t xTaskToResume ) PRIVILEGED_FUNCTION; - -/** - * An implementation of vTaskResume() that can be called from within an ISR. - * - * INCLUDE_xTaskResumeFromISR must be defined as 1 for this function to be - * available. See the configuration section for more information. - * - * A task that has been suspended by one or more calls to vTaskSuspend () - * will be made available for running again by a single call to - * xTaskResumeFromISR (). - * - * xTaskResumeFromISR() should not be used to synchronise a task with an - * interrupt if there is a chance that the interrupt could arrive prior to the - * task being suspended - as this can lead to interrupts being missed. Use of a - * semaphore as a synchronisation mechanism would avoid this eventuality. - * - * @param xTaskToResume Handle to the task being readied. - * - * @return pdTRUE if resuming the task should result in a context switch, - * otherwise pdFALSE. This is used by the ISR to determine if a context switch - * may be required following the ISR. - * - * \ingroup TaskCtrl - */ -BaseType_t xTaskResumeFromISR( TaskHandle_t xTaskToResume ) PRIVILEGED_FUNCTION; - -/*----------------------------------------------------------- - * SCHEDULER CONTROL - *----------------------------------------------------------*/ -/** @cond */ -/** - * Starts the real time kernel tick processing. - * - * After calling the kernel has control over which tasks are executed and when. - * - * See the demo application file main.c for an example of creating - * tasks and starting the kernel. - * - * Example usage: - * @code{c} - * void vAFunction( void ) - * { - * // Create at least one task before starting the kernel. - * xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); - * - * // Start the real time kernel with preemption. - * vTaskStartScheduler (); - * - * // Will not get here unless a task calls vTaskEndScheduler () - * } - * @endcode - * - * \ingroup SchedulerControl - */ -void vTaskStartScheduler( void ) PRIVILEGED_FUNCTION; - -/** - * Stops the real time kernel tick. - * - * @note At the time of writing only the x86 real mode port, which runs on a PC - * in place of DOS, implements this function. - * - * All created tasks will be automatically deleted and multitasking - * (either preemptive or cooperative) will stop. - * Execution then resumes from the point where vTaskStartScheduler () - * was called, as if vTaskStartScheduler () had just returned. - * - * See the demo application file main. c in the demo/PC directory for an - * example that uses vTaskEndScheduler (). - * - * vTaskEndScheduler () requires an exit function to be defined within the - * portable layer (see vPortEndScheduler () in port. c for the PC port). This - * performs hardware specific operations such as stopping the kernel tick. - * - * vTaskEndScheduler () will cause all of the resources allocated by the - * kernel to be freed - but will not free resources allocated by application - * tasks. - * - * Example usage: - * @code{c} - * void vTaskCode( void * pvParameters ) - * { - * for( ;; ) - * { - * // Task code goes here. - * - * // At some point we want to end the real time kernel processing - * // so call ... - * vTaskEndScheduler (); - * } - * } - * - * void vAFunction( void ) - * { - * // Create at least one task before starting the kernel. - * xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); - * - * // Start the real time kernel with preemption. - * vTaskStartScheduler (); - * - * // Will only get here when the vTaskCode () task has called - * // vTaskEndScheduler (). When we get here we are back to single task - * // execution. - * } - * @endcode - * \ingroup SchedulerControl - */ -void vTaskEndScheduler( void ) PRIVILEGED_FUNCTION; - -/** @endcond */ - -/** - * Suspends the scheduler without disabling interrupts. - * - * Context switches will not occur while the scheduler is suspended. - * - * After calling vTaskSuspendAll () the calling task will continue to execute - * without risk of being swapped out until a call to xTaskResumeAll () has been - * made. - * - * API functions that have the potential to cause a context switch (for example, - * vTaskDelayUntil(), xQueueSend(), etc.) must not be called while the scheduler - * is suspended. - * - * Example usage: - * @code{c} - * void vTask1( void * pvParameters ) - * { - * for( ;; ) - * { - * // Task code goes here. - * - * // ... - * - * // At some point the task wants to perform a long operation during - * // which it does not want to get swapped out. It cannot use - * // taskENTER_CRITICAL ()/taskEXIT_CRITICAL () as the length of the - * // operation may cause interrupts to be missed - including the - * // ticks. - * - * // Prevent the real time kernel swapping out the task. - * vTaskSuspendAll (); - * - * // Perform the operation here. There is no need to use critical - * // sections as we have all the microcontroller processing time. - * // During this time interrupts will still operate and the kernel - * // tick count will be maintained. - * - * // ... - * - * // The operation is complete. Restart the kernel. - * xTaskResumeAll (); - * } - * } - * @endcode - * \ingroup SchedulerControl - */ -void vTaskSuspendAll( void ) PRIVILEGED_FUNCTION; - -/** - * Resumes scheduler activity after it was suspended by a call to - * vTaskSuspendAll(). - * - * xTaskResumeAll() only resumes the scheduler. It does not unsuspend tasks - * that were previously suspended by a call to vTaskSuspend(). - * - * @return If resuming the scheduler caused a context switch then pdTRUE is - * returned, otherwise pdFALSE is returned. - * - * Example usage: - * @code{c} - * void vTask1( void * pvParameters ) - * { - * for( ;; ) - * { - * // Task code goes here. - * - * // ... - * - * // At some point the task wants to perform a long operation during - * // which it does not want to get swapped out. It cannot use - * // taskENTER_CRITICAL ()/taskEXIT_CRITICAL () as the length of the - * // operation may cause interrupts to be missed - including the - * // ticks. - * - * // Prevent the real time kernel swapping out the task. - * vTaskSuspendAll (); - * - * // Perform the operation here. There is no need to use critical - * // sections as we have all the microcontroller processing time. - * // During this time interrupts will still operate and the real - * // time kernel tick count will be maintained. - * - * // ... - * - * // The operation is complete. Restart the kernel. We want to force - * // a context switch - but there is no point if resuming the scheduler - * // caused a context switch already. - * if( !xTaskResumeAll () ) - * { - * taskYIELD (); - * } - * } - * } - * @endcode - * \ingroup SchedulerControl - */ -BaseType_t xTaskResumeAll( void ) PRIVILEGED_FUNCTION; - -/*----------------------------------------------------------- - * TASK UTILITIES - *----------------------------------------------------------*/ - -/** - * Get tick count - * - * @return The count of ticks since vTaskStartScheduler was called. - * - * \ingroup TaskUtils - */ -TickType_t xTaskGetTickCount( void ) PRIVILEGED_FUNCTION; - -/** - * Get tick count from ISR - * - * @return The count of ticks since vTaskStartScheduler was called. - * - * This is a version of xTaskGetTickCount() that is safe to be called from an - * ISR - provided that TickType_t is the natural word size of the - * microcontroller being used or interrupt nesting is either not supported or - * not being used. - * - * \ingroup TaskUtils - */ -TickType_t xTaskGetTickCountFromISR( void ) PRIVILEGED_FUNCTION; - -/** - * Get current number of tasks - * - * @return The number of tasks that the real time kernel is currently managing. - * This includes all ready, blocked and suspended tasks. A task that - * has been deleted but not yet freed by the idle task will also be - * included in the count. - * - * \ingroup TaskUtils - */ -UBaseType_t uxTaskGetNumberOfTasks( void ) PRIVILEGED_FUNCTION; - -/** - * Get task name - * - * @return The text (human readable) name of the task referenced by the handle - * xTaskToQuery. A task can query its own name by either passing in its own - * handle, or by setting xTaskToQuery to NULL. INCLUDE_pcTaskGetTaskName must be - * set to 1 in FreeRTOSConfig.h for pcTaskGetTaskName() to be available. - * - * \ingroup TaskUtils - */ -char *pcTaskGetTaskName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ - -/** - * Returns the high water mark of the stack associated with xTask. - * - * INCLUDE_uxTaskGetStackHighWaterMark must be set to 1 in FreeRTOSConfig.h for - * this function to be available. - * - * High water mark is the minimum free stack space there has been (in bytes - * rather than words as found in vanilla FreeRTOS) since the task started. - * The smaller the returned number the closer the task has come to overflowing its stack. - * - * @param xTask Handle of the task associated with the stack to be checked. - * Set xTask to NULL to check the stack of the calling task. - * - * @return The smallest amount of free stack space there has been (in bytes - * rather than words as found in vanilla FreeRTOS) since the task referenced by - * xTask was created. - */ -UBaseType_t uxTaskGetStackHighWaterMark( TaskHandle_t xTask ) PRIVILEGED_FUNCTION; - -/** - * Returns the start of the stack associated with xTask. - * - * INCLUDE_pxTaskGetStackStart must be set to 1 in FreeRTOSConfig.h for - * this function to be available. - * - * Returns the highest stack memory address on architectures where the stack grows down - * from high memory, and the lowest memory address on architectures where the - * stack grows up from low memory. - * - * @param xTask Handle of the task associated with the stack returned. - * Set xTask to NULL to return the stack of the calling task. - * - * @return A pointer to the start of the stack. - */ -uint8_t* pxTaskGetStackStart( TaskHandle_t xTask) PRIVILEGED_FUNCTION; - -/* When using trace macros it is sometimes necessary to include task.h before -FreeRTOS.h. When this is done TaskHookFunction_t will not yet have been defined, -so the following two prototypes will cause a compilation error. This can be -fixed by simply guarding against the inclusion of these two prototypes unless -they are explicitly required by the configUSE_APPLICATION_TASK_TAG configuration -constant. */ -#ifdef configUSE_APPLICATION_TASK_TAG - #if configUSE_APPLICATION_TASK_TAG == 1 - /** - * Sets pxHookFunction to be the task hook function used by the task xTask. - * @param xTask Handle of the task to set the hook function for - * Passing xTask as NULL has the effect of setting the calling - * tasks hook function. - * @param pxHookFunction Pointer to the hook function. - */ - void vTaskSetApplicationTaskTag( TaskHandle_t xTask, TaskHookFunction_t pxHookFunction ) PRIVILEGED_FUNCTION; - - /** - * Get the hook function assigned to given task. - * @param xTask Handle of the task to get the hook function for - * Passing xTask as NULL has the effect of getting the calling - * tasks hook function. - * @return The pxHookFunction value assigned to the task xTask. - */ - TaskHookFunction_t xTaskGetApplicationTaskTag( TaskHandle_t xTask ) PRIVILEGED_FUNCTION; - #endif /* configUSE_APPLICATION_TASK_TAG ==1 */ -#endif /* ifdef configUSE_APPLICATION_TASK_TAG */ -#if( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 ) - - /** - * Set local storage pointer specific to the given task. - * - * Each task contains an array of pointers that is dimensioned by the - * configNUM_THREAD_LOCAL_STORAGE_POINTERS setting in FreeRTOSConfig.h. - * The kernel does not use the pointers itself, so the application writer - * can use the pointers for any purpose they wish. - * - * @param xTaskToSet Task to set thread local storage pointer for - * @param xIndex The index of the pointer to set, from 0 to - * configNUM_THREAD_LOCAL_STORAGE_POINTERS - 1. - * @param pvValue Pointer value to set. - */ - void vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet, BaseType_t xIndex, void *pvValue ) PRIVILEGED_FUNCTION; - - - /** - * Get local storage pointer specific to the given task. - * - * Each task contains an array of pointers that is dimensioned by the - * configNUM_THREAD_LOCAL_STORAGE_POINTERS setting in FreeRTOSConfig.h. - * The kernel does not use the pointers itself, so the application writer - * can use the pointers for any purpose they wish. - * - * @param xTaskToQuery Task to get thread local storage pointer for - * @param xIndex The index of the pointer to get, from 0 to - * configNUM_THREAD_LOCAL_STORAGE_POINTERS - 1. - * @return Pointer value - */ - void *pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery, BaseType_t xIndex ) PRIVILEGED_FUNCTION; - - #if ( configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS ) - - /** - * Prototype of local storage pointer deletion callback. - */ - typedef void (*TlsDeleteCallbackFunction_t)( int, void * ); - - /** - * Set local storage pointer and deletion callback. - * - * Each task contains an array of pointers that is dimensioned by the - * configNUM_THREAD_LOCAL_STORAGE_POINTERS setting in FreeRTOSConfig.h. - * The kernel does not use the pointers itself, so the application writer - * can use the pointers for any purpose they wish. - * - * Local storage pointers set for a task can reference dynamically - * allocated resources. This function is similar to - * vTaskSetThreadLocalStoragePointer, but provides a way to release - * these resources when the task gets deleted. For each pointer, - * a callback function can be set. This function will be called - * when task is deleted, with the local storage pointer index - * and value as arguments. - * - * @param xTaskToSet Task to set thread local storage pointer for - * @param xIndex The index of the pointer to set, from 0 to - * configNUM_THREAD_LOCAL_STORAGE_POINTERS - 1. - * @param pvValue Pointer value to set. - * @param pvDelCallback Function to call to dispose of the local - * storage pointer when the task is deleted. - */ - void vTaskSetThreadLocalStoragePointerAndDelCallback( TaskHandle_t xTaskToSet, BaseType_t xIndex, void *pvValue, TlsDeleteCallbackFunction_t pvDelCallback); - #endif - -#endif - -/** - * Calls the hook function associated with xTask. Passing xTask as NULL has - * the effect of calling the Running tasks (the calling task) hook function. - * - * @param xTask Handle of the task to call the hook for. - * @param pvParameter Parameter passed to the hook function for the task to interpret as it - * wants. The return value is the value returned by the task hook function - * registered by the user. - */ -BaseType_t xTaskCallApplicationTaskHook( TaskHandle_t xTask, void *pvParameter ) PRIVILEGED_FUNCTION; - -/** - * Get the handle of idle task for the current CPU. - * - * xTaskGetIdleTaskHandle() is only available if - * INCLUDE_xTaskGetIdleTaskHandle is set to 1 in FreeRTOSConfig.h. - * - * @return The handle of the idle task. It is not valid to call - * xTaskGetIdleTaskHandle() before the scheduler has been started. - */ -TaskHandle_t xTaskGetIdleTaskHandle( void ); - -/** - * Get the handle of idle task for the given CPU. - * - * xTaskGetIdleTaskHandleForCPU() is only available if - * INCLUDE_xTaskGetIdleTaskHandle is set to 1 in FreeRTOSConfig.h. - * - * @param cpuid The CPU to get the handle for - * - * @return Idle task handle of a given cpu. It is not valid to call - * xTaskGetIdleTaskHandleForCPU() before the scheduler has been started. - */ -TaskHandle_t xTaskGetIdleTaskHandleForCPU( UBaseType_t cpuid ); - -/** - * Get the state of tasks in the system. - * - * configUSE_TRACE_FACILITY must be defined as 1 in FreeRTOSConfig.h for - * uxTaskGetSystemState() to be available. - * - * uxTaskGetSystemState() populates an TaskStatus_t structure for each task in - * the system. TaskStatus_t structures contain, among other things, members - * for the task handle, task name, task priority, task state, and total amount - * of run time consumed by the task. See the TaskStatus_t structure - * definition in this file for the full member list. - * - * @note This function is intended for debugging use only as its use results in - * the scheduler remaining suspended for an extended period. - * - * @param pxTaskStatusArray A pointer to an array of TaskStatus_t structures. - * The array must contain at least one TaskStatus_t structure for each task - * that is under the control of the RTOS. The number of tasks under the control - * of the RTOS can be determined using the uxTaskGetNumberOfTasks() API function. - * - * @param uxArraySize The size of the array pointed to by the pxTaskStatusArray - * parameter. The size is specified as the number of indexes in the array, or - * the number of TaskStatus_t structures contained in the array, not by the - * number of bytes in the array. - * - * @param pulTotalRunTime If configGENERATE_RUN_TIME_STATS is set to 1 in - * FreeRTOSConfig.h then *pulTotalRunTime is set by uxTaskGetSystemState() to the - * total run time (as defined by the run time stats clock, see - * http://www.freertos.org/rtos-run-time-stats.html) since the target booted. - * pulTotalRunTime can be set to NULL to omit the total run time information. - * - * @return The number of TaskStatus_t structures that were populated by - * uxTaskGetSystemState(). This should equal the number returned by the - * uxTaskGetNumberOfTasks() API function, but will be zero if the value passed - * in the uxArraySize parameter was too small. - * - * Example usage: - * @code{c} - * // This example demonstrates how a human readable table of run time stats - * // information is generated from raw data provided by uxTaskGetSystemState(). - * // The human readable table is written to pcWriteBuffer - * void vTaskGetRunTimeStats( char *pcWriteBuffer ) - * { - * TaskStatus_t *pxTaskStatusArray; - * volatile UBaseType_t uxArraySize, x; - * uint32_t ulTotalRunTime, ulStatsAsPercentage; - * - * // Make sure the write buffer does not contain a string. - * *pcWriteBuffer = 0x00; - * - * // Take a snapshot of the number of tasks in case it changes while this - * // function is executing. - * uxArraySize = uxTaskGetNumberOfTasks(); - * - * // Allocate a TaskStatus_t structure for each task. An array could be - * // allocated statically at compile time. - * pxTaskStatusArray = pvPortMalloc( uxArraySize * sizeof( TaskStatus_t ) ); - * - * if( pxTaskStatusArray != NULL ) - * { - * // Generate raw status information about each task. - * uxArraySize = uxTaskGetSystemState( pxTaskStatusArray, uxArraySize, &ulTotalRunTime ); - * - * // For percentage calculations. - * ulTotalRunTime /= 100UL; - * - * // Avoid divide by zero errors. - * if( ulTotalRunTime > 0 ) - * { - * // For each populated position in the pxTaskStatusArray array, - * // format the raw data as human readable ASCII data - * for( x = 0; x < uxArraySize; x++ ) - * { - * // What percentage of the total run time has the task used? - * // This will always be rounded down to the nearest integer. - * // ulTotalRunTimeDiv100 has already been divided by 100. - * ulStatsAsPercentage = pxTaskStatusArray[ x ].ulRunTimeCounter / ulTotalRunTime; - * - * if( ulStatsAsPercentage > 0UL ) - * { - * sprintf( pcWriteBuffer, "%s\t\t%lu\t\t%lu%%\r\n", pxTaskStatusArray[ x ].pcTaskName, pxTaskStatusArray[ x ].ulRunTimeCounter, ulStatsAsPercentage ); - * } - * else - * { - * // If the percentage is zero here then the task has - * // consumed less than 1% of the total run time. - * sprintf( pcWriteBuffer, "%s\t\t%lu\t\t<1%%\r\n", pxTaskStatusArray[ x ].pcTaskName, pxTaskStatusArray[ x ].ulRunTimeCounter ); - * } - * - * pcWriteBuffer += strlen( ( char * ) pcWriteBuffer ); - * } - * } - * - * // The array is no longer needed, free the memory it consumes. - * vPortFree( pxTaskStatusArray ); - * } - * } - * @endcode - */ -UBaseType_t uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray, const UBaseType_t uxArraySize, uint32_t * const pulTotalRunTime ); - -/** - * List all the current tasks. - * - * configUSE_TRACE_FACILITY and configUSE_STATS_FORMATTING_FUNCTIONS must - * both be defined as 1 for this function to be available. See the - * configuration section of the FreeRTOS.org website for more information. - * - * @note This function will disable interrupts for its duration. It is - * not intended for normal application runtime use but as a debug aid. - * - * Lists all the current tasks, along with their current state and stack - * usage high water mark. - * - * Tasks are reported as blocked ('B'), ready ('R'), deleted ('D') or - * suspended ('S'). - * - * @note This function is provided for convenience only, and is used by many of the - * demo applications. Do not consider it to be part of the scheduler. - * - * vTaskList() calls uxTaskGetSystemState(), then formats part of the - * uxTaskGetSystemState() output into a human readable table that displays task - * names, states and stack usage. - * - * vTaskList() has a dependency on the sprintf() C library function that might - * bloat the code size, use a lot of stack, and provide different results on - * different platforms. An alternative, tiny, third party, and limited - * functionality implementation of sprintf() is provided in many of the - * FreeRTOS/Demo sub-directories in a file called printf-stdarg.c (note - * printf-stdarg.c does not provide a full snprintf() implementation!). - * - * It is recommended that production systems call uxTaskGetSystemState() - * directly to get access to raw stats data, rather than indirectly through a - * call to vTaskList(). - * - * @param pcWriteBuffer A buffer into which the above mentioned details - * will be written, in ASCII form. This buffer is assumed to be large - * enough to contain the generated report. Approximately 40 bytes per - * task should be sufficient. - * - * \ingroup TaskUtils - */ -void vTaskList( char * pcWriteBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ - -/** - * Get the state of running tasks as a string - * - * configGENERATE_RUN_TIME_STATS and configUSE_STATS_FORMATTING_FUNCTIONS - * must both be defined as 1 for this function to be available. The application - * must also then provide definitions for - * portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() and portGET_RUN_TIME_COUNTER_VALUE() - * to configure a peripheral timer/counter and return the timers current count - * value respectively. The counter should be at least 10 times the frequency of - * the tick count. - * - * @note This function will disable interrupts for its duration. It is - * not intended for normal application runtime use but as a debug aid. - * - * Setting configGENERATE_RUN_TIME_STATS to 1 will result in a total - * accumulated execution time being stored for each task. The resolution - * of the accumulated time value depends on the frequency of the timer - * configured by the portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() macro. - * Calling vTaskGetRunTimeStats() writes the total execution time of each - * task into a buffer, both as an absolute count value and as a percentage - * of the total system execution time. - * - * @note This function is provided for convenience only, and is used by many of the - * demo applications. Do not consider it to be part of the scheduler. - * - * vTaskGetRunTimeStats() calls uxTaskGetSystemState(), then formats part of the - * uxTaskGetSystemState() output into a human readable table that displays the - * amount of time each task has spent in the Running state in both absolute and - * percentage terms. - * - * vTaskGetRunTimeStats() has a dependency on the sprintf() C library function - * that might bloat the code size, use a lot of stack, and provide different - * results on different platforms. An alternative, tiny, third party, and - * limited functionality implementation of sprintf() is provided in many of the - * FreeRTOS/Demo sub-directories in a file called printf-stdarg.c (note - * printf-stdarg.c does not provide a full snprintf() implementation!). - * - * It is recommended that production systems call uxTaskGetSystemState() directly - * to get access to raw stats data, rather than indirectly through a call to - * vTaskGetRunTimeStats(). - * - * @param pcWriteBuffer A buffer into which the execution times will be - * written, in ASCII form. This buffer is assumed to be large enough to - * contain the generated report. Approximately 40 bytes per task should - * be sufficient. - * - * \ingroup TaskUtils - */ -void vTaskGetRunTimeStats( char *pcWriteBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ - -/** - * Send task notification. - * - * configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for this - * function to be available. - * - * When configUSE_TASK_NOTIFICATIONS is set to one each task has its own private - * "notification value", which is a 32-bit unsigned integer (uint32_t). - * - * Events can be sent to a task using an intermediary object. Examples of such - * objects are queues, semaphores, mutexes and event groups. Task notifications - * are a method of sending an event directly to a task without the need for such - * an intermediary object. - * - * A notification sent to a task can optionally perform an action, such as - * update, overwrite or increment the task's notification value. In that way - * task notifications can be used to send data to a task, or be used as light - * weight and fast binary or counting semaphores. - * - * A notification sent to a task will remain pending until it is cleared by the - * task calling xTaskNotifyWait() or ulTaskNotifyTake(). If the task was - * already in the Blocked state to wait for a notification when the notification - * arrives then the task will automatically be removed from the Blocked state - * (unblocked) and the notification cleared. - * - * A task can use xTaskNotifyWait() to [optionally] block to wait for a - * notification to be pending, or ulTaskNotifyTake() to [optionally] block - * to wait for its notification value to have a non-zero value. The task does - * not consume any CPU time while it is in the Blocked state. - * - * See http://www.FreeRTOS.org/RTOS-task-notifications.html for details. - * - * @param xTaskToNotify The handle of the task being notified. The handle to a - * task can be returned from the xTaskCreate() API function used to create the - * task, and the handle of the currently running task can be obtained by calling - * xTaskGetCurrentTaskHandle(). - * - * @param ulValue Data that can be sent with the notification. How the data is - * used depends on the value of the eAction parameter. - * - * @param eAction Specifies how the notification updates the task's notification - * value, if at all. Valid values for eAction are as follows: - * - eSetBits: - * The task's notification value is bitwise ORed with ulValue. xTaskNofify() - * always returns pdPASS in this case. - * - * - eIncrement: - * The task's notification value is incremented. ulValue is not used and - * xTaskNotify() always returns pdPASS in this case. - * - * - eSetValueWithOverwrite: - * The task's notification value is set to the value of ulValue, even if the - * task being notified had not yet processed the previous notification (the - * task already had a notification pending). xTaskNotify() always returns - * pdPASS in this case. - * - * - eSetValueWithoutOverwrite: - * If the task being notified did not already have a notification pending then - * the task's notification value is set to ulValue and xTaskNotify() will - * return pdPASS. If the task being notified already had a notification - * pending then no action is performed and pdFAIL is returned. - * - * - eNoAction: - * The task receives a notification without its notification value being - *   updated. ulValue is not used and xTaskNotify() always returns pdPASS in - * this case. - * - * @return Dependent on the value of eAction. See the description of the - * eAction parameter. - * - * \ingroup TaskNotifications - */ -BaseType_t xTaskNotify( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction ); - -/** - * Send task notification from an ISR. - * - * configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for this - * function to be available. - * - * When configUSE_TASK_NOTIFICATIONS is set to one each task has its own private - * "notification value", which is a 32-bit unsigned integer (uint32_t). - * - * A version of xTaskNotify() that can be used from an interrupt service routine - * (ISR). - * - * Events can be sent to a task using an intermediary object. Examples of such - * objects are queues, semaphores, mutexes and event groups. Task notifications - * are a method of sending an event directly to a task without the need for such - * an intermediary object. - * - * A notification sent to a task can optionally perform an action, such as - * update, overwrite or increment the task's notification value. In that way - * task notifications can be used to send data to a task, or be used as light - * weight and fast binary or counting semaphores. - * - * A notification sent to a task will remain pending until it is cleared by the - * task calling xTaskNotifyWait() or ulTaskNotifyTake(). If the task was - * already in the Blocked state to wait for a notification when the notification - * arrives then the task will automatically be removed from the Blocked state - * (unblocked) and the notification cleared. - * - * A task can use xTaskNotifyWait() to [optionally] block to wait for a - * notification to be pending, or ulTaskNotifyTake() to [optionally] block - * to wait for its notification value to have a non-zero value. The task does - * not consume any CPU time while it is in the Blocked state. - * - * See http://www.FreeRTOS.org/RTOS-task-notifications.html for details. - * - * @param xTaskToNotify The handle of the task being notified. The handle to a - * task can be returned from the xTaskCreate() API function used to create the - * task, and the handle of the currently running task can be obtained by calling - * xTaskGetCurrentTaskHandle(). - * - * @param ulValue Data that can be sent with the notification. How the data is - * used depends on the value of the eAction parameter. - * - * @param eAction Specifies how the notification updates the task's notification - * value, if at all. Valid values for eAction are as follows: - * - eSetBits: - * The task's notification value is bitwise ORed with ulValue. xTaskNofify() - * always returns pdPASS in this case. - * - * - eIncrement: - * The task's notification value is incremented. ulValue is not used and - * xTaskNotify() always returns pdPASS in this case. - * - * - eSetValueWithOverwrite: - * The task's notification value is set to the value of ulValue, even if the - * task being notified had not yet processed the previous notification (the - * task already had a notification pending). xTaskNotify() always returns - * pdPASS in this case. - * - * - eSetValueWithoutOverwrite: - * If the task being notified did not already have a notification pending then - * the task's notification value is set to ulValue and xTaskNotify() will - * return pdPASS. If the task being notified already had a notification - * pending then no action is performed and pdFAIL is returned. - * - * - eNoAction: - * The task receives a notification without its notification value being - * updated. ulValue is not used and xTaskNotify() always returns pdPASS in - * this case. - * - * @param pxHigherPriorityTaskWoken xTaskNotifyFromISR() will set - * *pxHigherPriorityTaskWoken to pdTRUE if sending the notification caused the - * task to which the notification was sent to leave the Blocked state, and the - * unblocked task has a priority higher than the currently running task. If - * xTaskNotifyFromISR() sets this value to pdTRUE then a context switch should - * be requested before the interrupt is exited. How a context switch is - * requested from an ISR is dependent on the port - see the documentation page - * for the port in use. - * - * @return Dependent on the value of eAction. See the description of the - * eAction parameter. - * - * \ingroup TaskNotifications - */ -BaseType_t xTaskNotifyFromISR( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, BaseType_t *pxHigherPriorityTaskWoken ); - -/** - * Wait for task notification - * - * configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for this - * function to be available. - * - * When configUSE_TASK_NOTIFICATIONS is set to one each task has its own private - * "notification value", which is a 32-bit unsigned integer (uint32_t). - * - * Events can be sent to a task using an intermediary object. Examples of such - * objects are queues, semaphores, mutexes and event groups. Task notifications - * are a method of sending an event directly to a task without the need for such - * an intermediary object. - * - * A notification sent to a task can optionally perform an action, such as - * update, overwrite or increment the task's notification value. In that way - * task notifications can be used to send data to a task, or be used as light - * weight and fast binary or counting semaphores. - * - * A notification sent to a task will remain pending until it is cleared by the - * task calling xTaskNotifyWait() or ulTaskNotifyTake(). If the task was - * already in the Blocked state to wait for a notification when the notification - * arrives then the task will automatically be removed from the Blocked state - * (unblocked) and the notification cleared. - * - * A task can use xTaskNotifyWait() to [optionally] block to wait for a - * notification to be pending, or ulTaskNotifyTake() to [optionally] block - * to wait for its notification value to have a non-zero value. The task does - * not consume any CPU time while it is in the Blocked state. - * - * See http://www.FreeRTOS.org/RTOS-task-notifications.html for details. - * - * @param ulBitsToClearOnEntry Bits that are set in ulBitsToClearOnEntry value - * will be cleared in the calling task's notification value before the task - * checks to see if any notifications are pending, and optionally blocks if no - * notifications are pending. Setting ulBitsToClearOnEntry to ULONG_MAX (if - * limits.h is included) or 0xffffffffUL (if limits.h is not included) will have - * the effect of resetting the task's notification value to 0. Setting - * ulBitsToClearOnEntry to 0 will leave the task's notification value unchanged. - * - * @param ulBitsToClearOnExit If a notification is pending or received before - * the calling task exits the xTaskNotifyWait() function then the task's - * notification value (see the xTaskNotify() API function) is passed out using - * the pulNotificationValue parameter. Then any bits that are set in - * ulBitsToClearOnExit will be cleared in the task's notification value (note - * *pulNotificationValue is set before any bits are cleared). Setting - * ulBitsToClearOnExit to ULONG_MAX (if limits.h is included) or 0xffffffffUL - * (if limits.h is not included) will have the effect of resetting the task's - * notification value to 0 before the function exits. Setting - * ulBitsToClearOnExit to 0 will leave the task's notification value unchanged - * when the function exits (in which case the value passed out in - * pulNotificationValue will match the task's notification value). - * - * @param pulNotificationValue Used to pass the task's notification value out - * of the function. Note the value passed out will not be effected by the - * clearing of any bits caused by ulBitsToClearOnExit being non-zero. - * - * @param xTicksToWait The maximum amount of time that the task should wait in - * the Blocked state for a notification to be received, should a notification - * not already be pending when xTaskNotifyWait() was called. The task - * will not consume any processing time while it is in the Blocked state. This - * is specified in kernel ticks, the macro pdMS_TO_TICSK( value_in_ms ) can be - * used to convert a time specified in milliseconds to a time specified in - * ticks. - * - * @return If a notification was received (including notifications that were - * already pending when xTaskNotifyWait was called) then pdPASS is - * returned. Otherwise pdFAIL is returned. - * - * \ingroup TaskNotifications - */ -BaseType_t xTaskNotifyWait( uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait ); - -/** - * Simplified macro for sending task notification. - * - * configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for this macro - * to be available. - * - * When configUSE_TASK_NOTIFICATIONS is set to one each task has its own private - * "notification value", which is a 32-bit unsigned integer (uint32_t). - * - * Events can be sent to a task using an intermediary object. Examples of such - * objects are queues, semaphores, mutexes and event groups. Task notifications - * are a method of sending an event directly to a task without the need for such - * an intermediary object. - * - * A notification sent to a task can optionally perform an action, such as - * update, overwrite or increment the task's notification value. In that way - * task notifications can be used to send data to a task, or be used as light - * weight and fast binary or counting semaphores. - * - * xTaskNotifyGive() is a helper macro intended for use when task notifications - * are used as light weight and faster binary or counting semaphore equivalents. - * Actual FreeRTOS semaphores are given using the xSemaphoreGive() API function, - * the equivalent action that instead uses a task notification is - * xTaskNotifyGive(). - * - * When task notifications are being used as a binary or counting semaphore - * equivalent then the task being notified should wait for the notification - * using the ulTaskNotificationTake() API function rather than the - * xTaskNotifyWait() API function. - * - * See http://www.FreeRTOS.org/RTOS-task-notifications.html for more details. - * - * @param xTaskToNotify The handle of the task being notified. The handle to a - * task can be returned from the xTaskCreate() API function used to create the - * task, and the handle of the currently running task can be obtained by calling - * xTaskGetCurrentTaskHandle(). - * - * @return xTaskNotifyGive() is a macro that calls xTaskNotify() with the - * eAction parameter set to eIncrement - so pdPASS is always returned. - * - * \ingroup TaskNotifications - */ -#define xTaskNotifyGive( xTaskToNotify ) xTaskNotify( ( xTaskToNotify ), 0, eIncrement ); - -/** - * Simplified macro for sending task notification from ISR. - * - * configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for this macro - * to be available. - * - * When configUSE_TASK_NOTIFICATIONS is set to one each task has its own private - * "notification value", which is a 32-bit unsigned integer (uint32_t). - * - * A version of xTaskNotifyGive() that can be called from an interrupt service - * routine (ISR). - * - * Events can be sent to a task using an intermediary object. Examples of such - * objects are queues, semaphores, mutexes and event groups. Task notifications - * are a method of sending an event directly to a task without the need for such - * an intermediary object. - * - * A notification sent to a task can optionally perform an action, such as - * update, overwrite or increment the task's notification value. In that way - * task notifications can be used to send data to a task, or be used as light - * weight and fast binary or counting semaphores. - * - * vTaskNotifyGiveFromISR() is intended for use when task notifications are - * used as light weight and faster binary or counting semaphore equivalents. - * Actual FreeRTOS semaphores are given from an ISR using the - * xSemaphoreGiveFromISR() API function, the equivalent action that instead uses - * a task notification is vTaskNotifyGiveFromISR(). - * - * When task notifications are being used as a binary or counting semaphore - * equivalent then the task being notified should wait for the notification - * using the ulTaskNotificationTake() API function rather than the - * xTaskNotifyWait() API function. - * - * See http://www.FreeRTOS.org/RTOS-task-notifications.html for more details. - * - * @param xTaskToNotify The handle of the task being notified. The handle to a - * task can be returned from the xTaskCreate() API function used to create the - * task, and the handle of the currently running task can be obtained by calling - * xTaskGetCurrentTaskHandle(). - * - * @param pxHigherPriorityTaskWoken vTaskNotifyGiveFromISR() will set - * *pxHigherPriorityTaskWoken to pdTRUE if sending the notification caused the - * task to which the notification was sent to leave the Blocked state, and the - * unblocked task has a priority higher than the currently running task. If - * vTaskNotifyGiveFromISR() sets this value to pdTRUE then a context switch - * should be requested before the interrupt is exited. How a context switch is - * requested from an ISR is dependent on the port - see the documentation page - * for the port in use. - * - * \ingroup TaskNotifications - */ -void vTaskNotifyGiveFromISR( TaskHandle_t xTaskToNotify, BaseType_t *pxHigherPriorityTaskWoken ); - -/** - * Simplified macro for receiving task notification. - * - * configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for this - * function to be available. - * - * When configUSE_TASK_NOTIFICATIONS is set to one each task has its own private - * "notification value", which is a 32-bit unsigned integer (uint32_t). - * - * Events can be sent to a task using an intermediary object. Examples of such - * objects are queues, semaphores, mutexes and event groups. Task notifications - * are a method of sending an event directly to a task without the need for such - * an intermediary object. - * - * A notification sent to a task can optionally perform an action, such as - * update, overwrite or increment the task's notification value. In that way - * task notifications can be used to send data to a task, or be used as light - * weight and fast binary or counting semaphores. - * - * ulTaskNotifyTake() is intended for use when a task notification is used as a - * faster and lighter weight binary or counting semaphore alternative. Actual - * FreeRTOS semaphores are taken using the xSemaphoreTake() API function, the - * equivalent action that instead uses a task notification is - * ulTaskNotifyTake(). - * - * When a task is using its notification value as a binary or counting semaphore - * other tasks should send notifications to it using the xTaskNotifyGive() - * macro, or xTaskNotify() function with the eAction parameter set to - * eIncrement. - * - * ulTaskNotifyTake() can either clear the task's notification value to - * zero on exit, in which case the notification value acts like a binary - * semaphore, or decrement the task's notification value on exit, in which case - * the notification value acts like a counting semaphore. - * - * A task can use ulTaskNotifyTake() to [optionally] block to wait for a - * the task's notification value to be non-zero. The task does not consume any - * CPU time while it is in the Blocked state. - * - * Where as xTaskNotifyWait() will return when a notification is pending, - * ulTaskNotifyTake() will return when the task's notification value is - * not zero. - * - * See http://www.FreeRTOS.org/RTOS-task-notifications.html for details. - * - * @param xClearCountOnExit if xClearCountOnExit is pdFALSE then the task's - * notification value is decremented when the function exits. In this way the - * notification value acts like a counting semaphore. If xClearCountOnExit is - * not pdFALSE then the task's notification value is cleared to zero when the - * function exits. In this way the notification value acts like a binary - * semaphore. - * - * @param xTicksToWait The maximum amount of time that the task should wait in - * the Blocked state for the task's notification value to be greater than zero, - * should the count not already be greater than zero when - * ulTaskNotifyTake() was called. The task will not consume any processing - * time while it is in the Blocked state. This is specified in kernel ticks, - * the macro pdMS_TO_TICSK( value_in_ms ) can be used to convert a time - * specified in milliseconds to a time specified in ticks. - * - * @return The task's notification count before it is either cleared to zero or - * decremented (see the xClearCountOnExit parameter). - * - * \ingroup TaskNotifications - */ -uint32_t ulTaskNotifyTake( BaseType_t xClearCountOnExit, TickType_t xTicksToWait ); - -/*----------------------------------------------------------- - * SCHEDULER INTERNALS AVAILABLE FOR PORTING PURPOSES - *----------------------------------------------------------*/ -/** @cond */ -/* - * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS ONLY - * INTENDED FOR USE WHEN IMPLEMENTING A PORT OF THE SCHEDULER AND IS - * AN INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER. - * - * Called from the real time kernel tick (either preemptive or cooperative), - * this increments the tick count and checks if any tasks that are blocked - * for a finite period required removing from a blocked list and placing on - * a ready list. If a non-zero value is returned then a context switch is - * required because either: - * + A task was removed from a blocked list because its timeout had expired, - * or - * + Time slicing is in use and there is a task of equal priority to the - * currently running task. - */ -BaseType_t xTaskIncrementTick( void ) PRIVILEGED_FUNCTION; - -/* - * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN - * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER. - * - * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED. - * - * Removes the calling task from the ready list and places it both - * on the list of tasks waiting for a particular event, and the - * list of delayed tasks. The task will be removed from both lists - * and replaced on the ready list should either the event occur (and - * there be no higher priority tasks waiting on the same event) or - * the delay period expires. - * - * The 'unordered' version replaces the event list item value with the - * xItemValue value, and inserts the list item at the end of the list. - * - * The 'ordered' version uses the existing event list item value (which is the - * owning tasks priority) to insert the list item into the event list is task - * priority order. - * - * @param pxEventList The list containing tasks that are blocked waiting - * for the event to occur. - * - * @param xItemValue The item value to use for the event list item when the - * event list is not ordered by task priority. - * - * @param xTicksToWait The maximum amount of time that the task should wait - * for the event to occur. This is specified in kernel ticks,the constant - * portTICK_PERIOD_MS can be used to convert kernel ticks into a real time - * period. - */ -void vTaskPlaceOnEventList( List_t * const pxEventList, const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION; -void vTaskPlaceOnUnorderedEventList( List_t * pxEventList, const TickType_t xItemValue, const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION; - -/* - * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN - * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER. - * - * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED. - * - * This function performs nearly the same function as vTaskPlaceOnEventList(). - * The difference being that this function does not permit tasks to block - * indefinitely, whereas vTaskPlaceOnEventList() does. - * - */ -void vTaskPlaceOnEventListRestricted( List_t * const pxEventList, const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION; - -/* - * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN - * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER. - * - * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED. - * - * Removes a task from both the specified event list and the list of blocked - * tasks, and places it on a ready queue. - * - * xTaskRemoveFromEventList()/xTaskRemoveFromUnorderedEventList() will be called - * if either an event occurs to unblock a task, or the block timeout period - * expires. - * - * xTaskRemoveFromEventList() is used when the event list is in task priority - * order. It removes the list item from the head of the event list as that will - * have the highest priority owning task of all the tasks on the event list. - * xTaskRemoveFromUnorderedEventList() is used when the event list is not - * ordered and the event list items hold something other than the owning tasks - * priority. In this case the event list item value is updated to the value - * passed in the xItemValue parameter. - * - * @return pdTRUE if the task being removed has a higher priority than the task - * making the call, otherwise pdFALSE. - */ -BaseType_t xTaskRemoveFromEventList( const List_t * const pxEventList ) PRIVILEGED_FUNCTION; -BaseType_t xTaskRemoveFromUnorderedEventList( ListItem_t * pxEventListItem, const TickType_t xItemValue ) PRIVILEGED_FUNCTION; - -/* - * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS ONLY - * INTENDED FOR USE WHEN IMPLEMENTING A PORT OF THE SCHEDULER AND IS - * AN INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER. - * - * Sets the pointer to the current TCB to the TCB of the highest priority task - * that is ready to run. - */ -void vTaskSwitchContext( void ) PRIVILEGED_FUNCTION; - -/* - * THESE FUNCTIONS MUST NOT BE USED FROM APPLICATION CODE. THEY ARE USED BY - * THE EVENT BITS MODULE. - */ -TickType_t uxTaskResetEventItemValue( void ) PRIVILEGED_FUNCTION; - -/* - * Return the handle of the calling task. - */ -TaskHandle_t xTaskGetCurrentTaskHandle( void ) PRIVILEGED_FUNCTION; - - - -/* - * Return the handle of the task running on a certain CPU. Because of - * the nature of SMP processing, there is no guarantee that this - * value will still be valid on return and should only be used for - * debugging purposes. - */ -TaskHandle_t xTaskGetCurrentTaskHandleForCPU( BaseType_t cpuid ); - - -/* - * Capture the current time status for future reference. - */ -void vTaskSetTimeOutState( TimeOut_t * const pxTimeOut ) PRIVILEGED_FUNCTION; - -/* - * Compare the time status now with that previously captured to see if the - * timeout has expired. - */ -BaseType_t xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut, TickType_t * const pxTicksToWait ) PRIVILEGED_FUNCTION; - -/* - * Shortcut used by the queue implementation to prevent unnecessary call to - * taskYIELD(); - */ -void vTaskMissedYield( void ) PRIVILEGED_FUNCTION; - -/* - * Returns the scheduler state as taskSCHEDULER_RUNNING, - * taskSCHEDULER_NOT_STARTED or taskSCHEDULER_SUSPENDED. - */ -BaseType_t xTaskGetSchedulerState( void ) PRIVILEGED_FUNCTION; - -/* - * Raises the priority of the mutex holder to that of the calling task should - * the mutex holder have a priority less than the calling task. - */ -void vTaskPriorityInherit( TaskHandle_t const pxMutexHolder ) PRIVILEGED_FUNCTION; - -/* - * Set the priority of a task back to its proper priority in the case that it - * inherited a higher priority while it was holding a semaphore. - */ -BaseType_t xTaskPriorityDisinherit( TaskHandle_t const pxMutexHolder ) PRIVILEGED_FUNCTION; - -/* - * Get the uxTCBNumber assigned to the task referenced by the xTask parameter. - */ -UBaseType_t uxTaskGetTaskNumber( TaskHandle_t xTask ) PRIVILEGED_FUNCTION; - - -/* - * Get the current core affinity of a task - */ -BaseType_t xTaskGetAffinity( TaskHandle_t xTask ) PRIVILEGED_FUNCTION; - -/* - * Set the uxTaskNumber of the task referenced by the xTask parameter to - * uxHandle. - */ -void vTaskSetTaskNumber( TaskHandle_t xTask, const UBaseType_t uxHandle ) PRIVILEGED_FUNCTION; - -/* - * Only available when configUSE_TICKLESS_IDLE is set to 1. - * If tickless mode is being used, or a low power mode is implemented, then - * the tick interrupt will not execute during idle periods. When this is the - * case, the tick count value maintained by the scheduler needs to be kept up - * to date with the actual execution time by being skipped forward by a time - * equal to the idle period. - */ -void vTaskStepTick( const TickType_t xTicksToJump ) PRIVILEGED_FUNCTION; - -/* - * Only avilable when configUSE_TICKLESS_IDLE is set to 1. - * Provided for use within portSUPPRESS_TICKS_AND_SLEEP() to allow the port - * specific sleep function to determine if it is ok to proceed with the sleep, - * and if it is ok to proceed, if it is ok to sleep indefinitely. - * - * This function is necessary because portSUPPRESS_TICKS_AND_SLEEP() is only - * called with the scheduler suspended, not from within a critical section. It - * is therefore possible for an interrupt to request a context switch between - * portSUPPRESS_TICKS_AND_SLEEP() and the low power mode actually being - * entered. eTaskConfirmSleepModeStatus() should be called from a short - * critical section between the timer being stopped and the sleep mode being - * entered to ensure it is ok to proceed into the sleep mode. - */ -eSleepModeStatus eTaskConfirmSleepModeStatus( void ) PRIVILEGED_FUNCTION; - -/* - * For internal use only. Increment the mutex held count when a mutex is - * taken and return the handle of the task that has taken the mutex. - */ -void *pvTaskIncrementMutexHeldCount( void ); - -/* - * This function fills array with TaskSnapshot_t structures for every task in the system. - * Used by core dump facility to get snapshots of all tasks in the system. - * Only available when configENABLE_TASK_SNAPSHOT is set to 1. - * @param pxTaskSnapshotArray Pointer to array of TaskSnapshot_t structures to store tasks snapshot data. - * @param uxArraySize Size of tasks snapshots array. - * @param pxTcbSz Pointer to store size of TCB. - * @return Number of elements stored in array. - */ -UBaseType_t uxTaskGetSnapshotAll( TaskSnapshot_t * const pxTaskSnapshotArray, const UBaseType_t uxArraySize, UBaseType_t * const pxTcbSz ); - -/** @endcond */ - -#ifdef __cplusplus -} -#endif -#endif /* INC_TASK_H */ - - - diff --git a/tools/sdk/include/freertos/freertos/timers.h b/tools/sdk/include/freertos/freertos/timers.h deleted file mode 100644 index 17492e64c66..00000000000 --- a/tools/sdk/include/freertos/freertos/timers.h +++ /dev/null @@ -1,1258 +0,0 @@ -/* - FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd. - All rights reserved - - VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. - - This file is part of the FreeRTOS distribution. - - FreeRTOS is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License (version 2) as published by the - Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. - - *************************************************************************** - >>! NOTE: The modification to the GPL is included to allow you to !<< - >>! distribute a combined work that includes FreeRTOS without being !<< - >>! obliged to provide the source code for proprietary components !<< - >>! outside of the FreeRTOS kernel. !<< - *************************************************************************** - - FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. Full license text is available on the following - link: http://www.freertos.org/a00114.html - - *************************************************************************** - * * - * FreeRTOS provides completely free yet professionally developed, * - * robust, strictly quality controlled, supported, and cross * - * platform software that is more than just the market leader, it * - * is the industry's de facto standard. * - * * - * Help yourself get started quickly while simultaneously helping * - * to support the FreeRTOS project by purchasing a FreeRTOS * - * tutorial book, reference manual, or both: * - * http://www.FreeRTOS.org/Documentation * - * * - *************************************************************************** - - http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading - the FAQ page "My application does not run, what could be wrong?". Have you - defined configASSERT()? - - http://www.FreeRTOS.org/support - In return for receiving this top quality - embedded software for free we request you assist our global community by - participating in the support forum. - - http://www.FreeRTOS.org/training - Investing in training allows your team to - be as productive as possible as early as possible. Now you can receive - FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers - Ltd, and the world's leading authority on the world's leading RTOS. - - http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, - including FreeRTOS+Trace - an indispensable productivity tool, a DOS - compatible FAT file system, and our tiny thread aware UDP/IP stack. - - http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. - Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. - - http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High - Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS - licenses offer ticketed support, indemnification and commercial middleware. - - http://www.SafeRTOS.com - High Integrity Systems also provide a safety - engineered and independently SIL3 certified version for use in safety and - mission critical applications that require provable dependability. - - 1 tab == 4 spaces! -*/ - - -#ifndef TIMERS_H -#define TIMERS_H - -#ifndef INC_FREERTOS_H - #error "include FreeRTOS.h must appear in source files before include timers.h" -#endif - -/*lint -e537 This headers are only multiply included if the application code -happens to also be including task.h. */ -#include "task.h" -/*lint +e537 */ - -#ifdef __cplusplus -extern "C" { -#endif - -/*----------------------------------------------------------- - * MACROS AND DEFINITIONS - *----------------------------------------------------------*/ - -/* IDs for commands that can be sent/received on the timer queue. These are to -be used solely through the macros that make up the public software timer API, -as defined below. The commands that are sent from interrupts must use the -highest numbers as tmrFIRST_FROM_ISR_COMMAND is used to determine if the task -or interrupt version of the queue send function should be used. */ -#define tmrCOMMAND_EXECUTE_CALLBACK_FROM_ISR ( ( BaseType_t ) -2 ) -#define tmrCOMMAND_EXECUTE_CALLBACK ( ( BaseType_t ) -1 ) -#define tmrCOMMAND_START_DONT_TRACE ( ( BaseType_t ) 0 ) -#define tmrCOMMAND_START ( ( BaseType_t ) 1 ) -#define tmrCOMMAND_RESET ( ( BaseType_t ) 2 ) -#define tmrCOMMAND_STOP ( ( BaseType_t ) 3 ) -#define tmrCOMMAND_CHANGE_PERIOD ( ( BaseType_t ) 4 ) -#define tmrCOMMAND_DELETE ( ( BaseType_t ) 5 ) - -#define tmrFIRST_FROM_ISR_COMMAND ( ( BaseType_t ) 6 ) -#define tmrCOMMAND_START_FROM_ISR ( ( BaseType_t ) 6 ) -#define tmrCOMMAND_RESET_FROM_ISR ( ( BaseType_t ) 7 ) -#define tmrCOMMAND_STOP_FROM_ISR ( ( BaseType_t ) 8 ) -#define tmrCOMMAND_CHANGE_PERIOD_FROM_ISR ( ( BaseType_t ) 9 ) - - -/** - * Type by which software timers are referenced. For example, a call to - * xTimerCreate() returns an TimerHandle_t variable that can then be used to - * reference the subject timer in calls to other software timer API functions - * (for example, xTimerStart(), xTimerReset(), etc.). - */ -typedef void * TimerHandle_t; - -/** - * Defines the prototype to which timer callback functions must conform. - */ -typedef void (*TimerCallbackFunction_t)( TimerHandle_t xTimer ); - -/** - * Defines the prototype to which functions used with the - * xTimerPendFunctionCallFromISR() function must conform. - */ -typedef void (*PendedFunction_t)( void *, uint32_t ); - -/** - * Creates a new software timer instance, and returns a handle by which the - * created software timer can be referenced. - * - * Internally, within the FreeRTOS implementation, software timers use a block - * of memory, in which the timer data structure is stored. If a software timer - * is created using xTimerCreate() then the required memory is automatically - * dynamically allocated inside the xTimerCreate() function. (see - * http://www.freertos.org/a00111.html). If a software timer is created using - * xTimerCreateStatic() then the application writer must provide the memory that - * will get used by the software timer. xTimerCreateStatic() therefore allows a - * software timer to be created without using any dynamic memory allocation. - * - * Timers are created in the dormant state. The xTimerStart(), xTimerReset(), - * xTimerStartFromISR(), xTimerResetFromISR(), xTimerChangePeriod() and - * xTimerChangePeriodFromISR() API functions can all be used to transition a - * timer into the active state. - * - * @param pcTimerName A text name that is assigned to the timer. This is done - * purely to assist debugging. The kernel itself only ever references a timer - * by its handle, and never by its name. - * - * @param xTimerPeriodInTicks The timer period. The time is defined in tick - * periods so the constant portTICK_PERIOD_MS can be used to convert a time that - * has been specified in milliseconds. For example, if the timer must expire - * after 100 ticks, then xTimerPeriodInTicks should be set to 100. - * Alternatively, if the timer must expire after 500ms, then xPeriod can be set - * to ( 500 / portTICK_PERIOD_MS ) provided configTICK_RATE_HZ is less than or - * equal to 1000. - * - * @param uxAutoReload If uxAutoReload is set to pdTRUE then the timer will - * expire repeatedly with a frequency set by the xTimerPeriodInTicks parameter. - * If uxAutoReload is set to pdFALSE then the timer will be a one-shot timer and - * enter the dormant state after it expires. - * - * @param pvTimerID An identifier that is assigned to the timer being created. - * Typically this would be used in the timer callback function to identify which - * timer expired when the same callback function is assigned to more than one - * timer. - * - * @param pxCallbackFunction The function to call when the timer expires. - * Callback functions must have the prototype defined by TimerCallbackFunction_t, - * which is "void vCallbackFunction( TimerHandle_t xTimer );". - * - * @return If the timer is successfully created then a handle to the newly - * created timer is returned. If the timer cannot be created (because either - * there is insufficient FreeRTOS heap remaining to allocate the timer - * structures, or the timer period was set to 0) then NULL is returned. - * - * Example usage: - * @code{c} - * #define NUM_TIMERS 5 - * - * // An array to hold handles to the created timers. - * TimerHandle_t xTimers[ NUM_TIMERS ]; - * - * // An array to hold a count of the number of times each timer expires. - * int32_t lExpireCounters[ NUM_TIMERS ] = { 0 }; - * - * // Define a callback function that will be used by multiple timer instances. - * // The callback function does nothing but count the number of times the - * // associated timer expires, and stop the timer once the timer has expired - * // 10 times. - * void vTimerCallback( TimerHandle_t pxTimer ) - * { - * int32_t lArrayIndex; - * const int32_t xMaxExpiryCountBeforeStopping = 10; - * - * // Optionally do something if the pxTimer parameter is NULL. - * configASSERT( pxTimer ); - * - * // Which timer expired? - * lArrayIndex = ( int32_t ) pvTimerGetTimerID( pxTimer ); - * - * // Increment the number of times that pxTimer has expired. - * lExpireCounters[ lArrayIndex ] += 1; - * - * // If the timer has expired 10 times then stop it from running. - * if( lExpireCounters[ lArrayIndex ] == xMaxExpiryCountBeforeStopping ) - * { - * // Do not use a block time if calling a timer API function from a - * // timer callback function, as doing so could cause a deadlock! - * xTimerStop( pxTimer, 0 ); - * } - * } - * - * void main( void ) - * { - * int32_t x; - * - * // Create then start some timers. Starting the timers before the scheduler - * // has been started means the timers will start running immediately that - * // the scheduler starts. - * for( x = 0; x < NUM_TIMERS; x++ ) - * { - * xTimers[ x ] = xTimerCreate( "Timer", // Just a text name, not used by the kernel. - * ( 100 * x ), // The timer period in ticks. - * pdTRUE, // The timers will auto-reload themselves when they expire. - * ( void * ) x, // Assign each timer a unique id equal to its array index. - * vTimerCallback // Each timer calls the same callback when it expires. - * ); - * - * if( xTimers[ x ] == NULL ) - * { - * // The timer was not created. - * } - * else - * { - * // Start the timer. No block time is specified, and even if one was - * // it would be ignored because the scheduler has not yet been - * // started. - * if( xTimerStart( xTimers[ x ], 0 ) != pdPASS ) - * { - * // The timer could not be set into the Active state. - * } - * } - * } - * - * // ... - * // Create tasks here. - * // ... - * - * // Starting the scheduler will start the timers running as they have already - * // been set into the active state. - * vTaskStartScheduler(); - * - * // Should not reach here. - * for( ;; ); - * } - * @endcode - */ -#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) - TimerHandle_t xTimerCreate( const char * const pcTimerName, - const TickType_t xTimerPeriodInTicks, - const UBaseType_t uxAutoReload, - void * const pvTimerID, - TimerCallbackFunction_t pxCallbackFunction ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ -#endif - - /** - * Creates a new software timer instance, and returns a handle by which the - * created software timer can be referenced. - * - * Internally, within the FreeRTOS implementation, software timers use a block - * of memory, in which the timer data structure is stored. If a software timer - * is created using xTimerCreate() then the required memory is automatically - * dynamically allocated inside the xTimerCreate() function. (see - * http://www.freertos.org/a00111.html). If a software timer is created using - * xTimerCreateStatic() then the application writer must provide the memory that - * will get used by the software timer. xTimerCreateStatic() therefore allows a - * software timer to be created without using any dynamic memory allocation. - * - * Timers are created in the dormant state. The xTimerStart(), xTimerReset(), - * xTimerStartFromISR(), xTimerResetFromISR(), xTimerChangePeriod() and - * xTimerChangePeriodFromISR() API functions can all be used to transition a - * timer into the active state. - * - * @param pcTimerName A text name that is assigned to the timer. This is done - * purely to assist debugging. The kernel itself only ever references a timer - * by its handle, and never by its name. - * - * @param xTimerPeriodInTicks The timer period. The time is defined in tick - * periods so the constant portTICK_PERIOD_MS can be used to convert a time that - * has been specified in milliseconds. For example, if the timer must expire - * after 100 ticks, then xTimerPeriodInTicks should be set to 100. - * Alternatively, if the timer must expire after 500ms, then xPeriod can be set - * to ( 500 / portTICK_PERIOD_MS ) provided configTICK_RATE_HZ is less than or - * equal to 1000. - * - * @param uxAutoReload If uxAutoReload is set to pdTRUE then the timer will - * expire repeatedly with a frequency set by the xTimerPeriodInTicks parameter. - * If uxAutoReload is set to pdFALSE then the timer will be a one-shot timer and - * enter the dormant state after it expires. - * - * @param pvTimerID An identifier that is assigned to the timer being created. - * Typically this would be used in the timer callback function to identify which - * timer expired when the same callback function is assigned to more than one - * timer. - * - * @param pxCallbackFunction The function to call when the timer expires. - * Callback functions must have the prototype defined by TimerCallbackFunction_t, - * which is "void vCallbackFunction( TimerHandle_t xTimer );". - * - * @param pxTimerBuffer Must point to a variable of type StaticTimer_t, which - * will be then be used to hold the software timer's data structures, removing - * the need for the memory to be allocated dynamically. - * - * @return If the timer is created then a handle to the created timer is - * returned. If pxTimerBuffer was NULL then NULL is returned. - * - * Example usage: - * @code{c} - * - * // The buffer used to hold the software timer's data structure. - * static StaticTimer_t xTimerBuffer; - * - * // A variable that will be incremented by the software timer's callback - * // function. - * UBaseType_t uxVariableToIncrement = 0; - * - * // A software timer callback function that increments a variable passed to - * // it when the software timer was created. After the 5th increment the - * // callback function stops the software timer. - * static void prvTimerCallback( TimerHandle_t xExpiredTimer ) - * { - * UBaseType_t *puxVariableToIncrement; - * BaseType_t xReturned; - * - * // Obtain the address of the variable to increment from the timer ID. - * puxVariableToIncrement = ( UBaseType_t * ) pvTimerGetTimerID( xExpiredTimer ); - * - * // Increment the variable to show the timer callback has executed. - * ( *puxVariableToIncrement )++; - * - * // If this callback has executed the required number of times, stop the - * // timer. - * if( *puxVariableToIncrement == 5 ) - * { - * // This is called from a timer callback so must not block. - * xTimerStop( xExpiredTimer, staticDONT_BLOCK ); - * } - * } - * - * - * void main( void ) - * { - * // Create the software time. xTimerCreateStatic() has an extra parameter - * // than the normal xTimerCreate() API function. The parameter is a pointer - * // to the StaticTimer_t structure that will hold the software timer - * // structure. If the parameter is passed as NULL then the structure will be - * // allocated dynamically, just as if xTimerCreate() had been called. - * xTimer = xTimerCreateStatic( "T1", // Text name for the task. Helps debugging only. Not used by FreeRTOS. - * xTimerPeriod, // The period of the timer in ticks. - * pdTRUE, // This is an auto-reload timer. - * ( void * ) &uxVariableToIncrement, // A variable incremented by the software timer's callback function - * prvTimerCallback, // The function to execute when the timer expires. - * &xTimerBuffer ); // The buffer that will hold the software timer structure. - * - * // The scheduler has not started yet so a block time is not used. - * xReturned = xTimerStart( xTimer, 0 ); - * - * // ... - * // Create tasks here. - * // ... - * - * // Starting the scheduler will start the timers running as they have already - * // been set into the active state. - * vTaskStartScheduler(); - * - * // Should not reach here. - * for( ;; ); - * } - * @endcode - */ - #if( configSUPPORT_STATIC_ALLOCATION == 1 ) - TimerHandle_t xTimerCreateStatic( const char * const pcTimerName, - const TickType_t xTimerPeriodInTicks, - const UBaseType_t uxAutoReload, - void * const pvTimerID, - TimerCallbackFunction_t pxCallbackFunction, - StaticTimer_t *pxTimerBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ - #endif /* configSUPPORT_STATIC_ALLOCATION */ - -/** - * Returns the ID assigned to the timer. - * - * IDs are assigned to timers using the pvTimerID parameter of the call to - * xTimerCreated() that was used to create the timer. - * - * If the same callback function is assigned to multiple timers then the timer - * ID can be used within the callback function to identify which timer actually - * expired. - * - * @param xTimer The timer being queried. - * - * @return The ID assigned to the timer being queried. - * - * Example usage: - * - * See the xTimerCreate() API function example usage scenario. - */ -void *pvTimerGetTimerID( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION; - -/** - * Sets the ID assigned to the timer. - * - * IDs are assigned to timers using the pvTimerID parameter of the call to - * xTimerCreated() that was used to create the timer. - * - * If the same callback function is assigned to multiple timers then the timer - * ID can be used as time specific (timer local) storage. - * - * @param xTimer The timer being updated. - * - * @param pvNewID The ID to assign to the timer. - * - * Example usage: - * - * See the xTimerCreate() API function example usage scenario. - */ -void vTimerSetTimerID( TimerHandle_t xTimer, void *pvNewID ) PRIVILEGED_FUNCTION; - -/** - * Queries a timer to see if it is active or dormant. - * - * A timer will be dormant if: - * - * 1) It has been created but not started, or - * - * 2) It is an expired one-shot timer that has not been restarted. - * - * Timers are created in the dormant state. The xTimerStart(), xTimerReset(), - * xTimerStartFromISR(), xTimerResetFromISR(), xTimerChangePeriod() and - * xTimerChangePeriodFromISR() API functions can all be used to transition a timer into the - * active state. - * - * @param xTimer The timer being queried. - * - * @return pdFALSE will be returned if the timer is dormant. A value other than - * pdFALSE will be returned if the timer is active. - * - * Example usage: - * @code{c} - * // This function assumes xTimer has already been created. - * void vAFunction( TimerHandle_t xTimer ) - * { - * if( xTimerIsTimerActive( xTimer ) != pdFALSE ) // or more simply and equivalently "if( xTimerIsTimerActive( xTimer ) )" - * { - * // xTimer is active, do something. - * } - * else - * { - * // xTimer is not active, do something else. - * } - * } - * @endcode - */ -BaseType_t xTimerIsTimerActive( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION; - -/** - * xTimerGetTimerDaemonTaskHandle() is only available if - * INCLUDE_xTimerGetTimerDaemonTaskHandle is set to 1 in FreeRTOSConfig.h. - * - * Simply returns the handle of the timer service/daemon task. It it not valid - * to call xTimerGetTimerDaemonTaskHandle() before the scheduler has been started. - */ -TaskHandle_t xTimerGetTimerDaemonTaskHandle( void ); - -/** - * Returns the period of a timer. - * - * @param xTimer The handle of the timer being queried. - * - * @return The period of the timer in ticks. - */ -TickType_t xTimerGetPeriod( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION; - -/** - * Returns the time in ticks at which the timer will expire. If this is less - * than the current tick count then the expiry time has overflowed from the - * current time. - * - * @param xTimer The handle of the timer being queried. - * - * @return If the timer is running then the time in ticks at which the timer - * will next expire is returned. If the timer is not running then the return - * value is undefined. - */ -TickType_t xTimerGetExpiryTime( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION; - -/** - * Timer functionality is provided by a timer service/daemon task. Many of the - * public FreeRTOS timer API functions send commands to the timer service task - * through a queue called the timer command queue. The timer command queue is - * private to the kernel itself and is not directly accessible to application - * code. The length of the timer command queue is set by the - * configTIMER_QUEUE_LENGTH configuration constant. - * - * xTimerStart() starts a timer that was previously created using the - * xTimerCreate() API function. If the timer had already been started and was - * already in the active state, then xTimerStart() has equivalent functionality - * to the xTimerReset() API function. - * - * Starting a timer ensures the timer is in the active state. If the timer - * is not stopped, deleted, or reset in the mean time, the callback function - * associated with the timer will get called 'n' ticks after xTimerStart() was - * called, where 'n' is the timers defined period. - * - * It is valid to call xTimerStart() before the scheduler has been started, but - * when this is done the timer will not actually start until the scheduler is - * started, and the timers expiry time will be relative to when the scheduler is - * started, not relative to when xTimerStart() was called. - * - * The configUSE_TIMERS configuration constant must be set to 1 for xTimerStart() - * to be available. - * - * @param xTimer The handle of the timer being started/restarted. - * - * @param xTicksToWait Specifies the time, in ticks, that the calling task should - * be held in the Blocked state to wait for the start command to be successfully - * sent to the timer command queue, should the queue already be full when - * xTimerStart() was called. xTicksToWait is ignored if xTimerStart() is called - * before the scheduler is started. - * - * @return pdFAIL will be returned if the start command could not be sent to - * the timer command queue even after xTicksToWait ticks had passed. pdPASS will - * be returned if the command was successfully sent to the timer command queue. - * When the command is actually processed will depend on the priority of the - * timer service/daemon task relative to other tasks in the system, although the - * timers expiry time is relative to when xTimerStart() is actually called. The - * timer service/daemon task priority is set by the configTIMER_TASK_PRIORITY - * configuration constant. - * - * Example usage: - * - * See the xTimerCreate() API function example usage scenario. - * - */ -#define xTimerStart( xTimer, xTicksToWait ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_START, ( xTaskGetTickCount() ), NULL, ( xTicksToWait ) ) - -/** - * Timer functionality is provided by a timer service/daemon task. Many of the - * public FreeRTOS timer API functions send commands to the timer service task - * through a queue called the timer command queue. The timer command queue is - * private to the kernel itself and is not directly accessible to application - * code. The length of the timer command queue is set by the - * configTIMER_QUEUE_LENGTH configuration constant. - * - * xTimerStop() stops a timer that was previously started using either of the - * The xTimerStart(), xTimerReset(), xTimerStartFromISR(), xTimerResetFromISR(), - * xTimerChangePeriod() or xTimerChangePeriodFromISR() API functions. - * - * Stopping a timer ensures the timer is not in the active state. - * - * The configUSE_TIMERS configuration constant must be set to 1 for xTimerStop() - * to be available. - * - * @param xTimer The handle of the timer being stopped. - * - * @param xTicksToWait Specifies the time, in ticks, that the calling task should - * be held in the Blocked state to wait for the stop command to be successfully - * sent to the timer command queue, should the queue already be full when - * xTimerStop() was called. xTicksToWait is ignored if xTimerStop() is called - * before the scheduler is started. - * - * @return pdFAIL will be returned if the stop command could not be sent to - * the timer command queue even after xTicksToWait ticks had passed. pdPASS will - * be returned if the command was successfully sent to the timer command queue. - * When the command is actually processed will depend on the priority of the - * timer service/daemon task relative to other tasks in the system. The timer - * service/daemon task priority is set by the configTIMER_TASK_PRIORITY - * configuration constant. - * - * Example usage: - * - * See the xTimerCreate() API function example usage scenario. - * - */ -#define xTimerStop( xTimer, xTicksToWait ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_STOP, 0U, NULL, ( xTicksToWait ) ) - -/** - * Timer functionality is provided by a timer service/daemon task. Many of the - * public FreeRTOS timer API functions send commands to the timer service task - * through a queue called the timer command queue. The timer command queue is - * private to the kernel itself and is not directly accessible to application - * code. The length of the timer command queue is set by the - * configTIMER_QUEUE_LENGTH configuration constant. - * - * xTimerChangePeriod() changes the period of a timer that was previously - * created using the xTimerCreate() API function. - * - * xTimerChangePeriod() can be called to change the period of an active or - * dormant state timer. - * - * The configUSE_TIMERS configuration constant must be set to 1 for - * xTimerChangePeriod() to be available. - * - * @param xTimer The handle of the timer that is having its period changed. - * - * @param xNewPeriod The new period for xTimer. Timer periods are specified in - * tick periods, so the constant portTICK_PERIOD_MS can be used to convert a time - * that has been specified in milliseconds. For example, if the timer must - * expire after 100 ticks, then xNewPeriod should be set to 100. Alternatively, - * if the timer must expire after 500ms, then xNewPeriod can be set to - * ( 500 / portTICK_PERIOD_MS ) provided configTICK_RATE_HZ is less than - * or equal to 1000. - * - * @param xTicksToWait Specifies the time, in ticks, that the calling task should - * be held in the Blocked state to wait for the change period command to be - * successfully sent to the timer command queue, should the queue already be - * full when xTimerChangePeriod() was called. xTicksToWait is ignored if - * xTimerChangePeriod() is called before the scheduler is started. - * - * @return pdFAIL will be returned if the change period command could not be - * sent to the timer command queue even after xTicksToWait ticks had passed. - * pdPASS will be returned if the command was successfully sent to the timer - * command queue. When the command is actually processed will depend on the - * priority of the timer service/daemon task relative to other tasks in the - * system. The timer service/daemon task priority is set by the - * configTIMER_TASK_PRIORITY configuration constant. - * - * Example usage: - * @code{c} - * // This function assumes xTimer has already been created. If the timer - * // referenced by xTimer is already active when it is called, then the timer - * // is deleted. If the timer referenced by xTimer is not active when it is - * // called, then the period of the timer is set to 500ms and the timer is - * // started. - * void vAFunction( TimerHandle_t xTimer ) - * { - * if( xTimerIsTimerActive( xTimer ) != pdFALSE ) // or more simply and equivalently "if( xTimerIsTimerActive( xTimer ) )" - * { - * // xTimer is already active - delete it. - * xTimerDelete( xTimer ); - * } - * else - * { - * // xTimer is not active, change its period to 500ms. This will also - * // cause the timer to start. Block for a maximum of 100 ticks if the - * // change period command cannot immediately be sent to the timer - * // command queue. - * if( xTimerChangePeriod( xTimer, 500 / portTICK_PERIOD_MS, 100 ) == pdPASS ) - * { - * // The command was successfully sent. - * } - * else - * { - * // The command could not be sent, even after waiting for 100 ticks - * // to pass. Take appropriate action here. - * } - * } - * } - * @endcode - */ - #define xTimerChangePeriod( xTimer, xNewPeriod, xTicksToWait ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_CHANGE_PERIOD, ( xNewPeriod ), NULL, ( xTicksToWait ) ) - -/** - * Timer functionality is provided by a timer service/daemon task. Many of the - * public FreeRTOS timer API functions send commands to the timer service task - * through a queue called the timer command queue. The timer command queue is - * private to the kernel itself and is not directly accessible to application - * code. The length of the timer command queue is set by the - * configTIMER_QUEUE_LENGTH configuration constant. - * - * xTimerDelete() deletes a timer that was previously created using the - * xTimerCreate() API function. - * - * The configUSE_TIMERS configuration constant must be set to 1 for - * xTimerDelete() to be available. - * - * @param xTimer The handle of the timer being deleted. - * - * @param xTicksToWait Specifies the time, in ticks, that the calling task should - * be held in the Blocked state to wait for the delete command to be - * successfully sent to the timer command queue, should the queue already be - * full when xTimerDelete() was called. xTicksToWait is ignored if xTimerDelete() - * is called before the scheduler is started. - * - * @return pdFAIL will be returned if the delete command could not be sent to - * the timer command queue even after xTicksToWait ticks had passed. pdPASS will - * be returned if the command was successfully sent to the timer command queue. - * When the command is actually processed will depend on the priority of the - * timer service/daemon task relative to other tasks in the system. The timer - * service/daemon task priority is set by the configTIMER_TASK_PRIORITY - * configuration constant. - * - * Example usage: - * - * See the xTimerChangePeriod() API function example usage scenario. - */ -#define xTimerDelete( xTimer, xTicksToWait ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_DELETE, 0U, NULL, ( xTicksToWait ) ) - -/** - * Timer functionality is provided by a timer service/daemon task. Many of the - * public FreeRTOS timer API functions send commands to the timer service task - * through a queue called the timer command queue. The timer command queue is - * private to the kernel itself and is not directly accessible to application - * code. The length of the timer command queue is set by the - * configTIMER_QUEUE_LENGTH configuration constant. - * - * xTimerReset() re-starts a timer that was previously created using the - * xTimerCreate() API function. If the timer had already been started and was - * already in the active state, then xTimerReset() will cause the timer to - * re-evaluate its expiry time so that it is relative to when xTimerReset() was - * called. If the timer was in the dormant state then xTimerReset() has - * equivalent functionality to the xTimerStart() API function. - * - * Resetting a timer ensures the timer is in the active state. If the timer - * is not stopped, deleted, or reset in the mean time, the callback function - * associated with the timer will get called 'n' ticks after xTimerReset() was - * called, where 'n' is the timers defined period. - * - * It is valid to call xTimerReset() before the scheduler has been started, but - * when this is done the timer will not actually start until the scheduler is - * started, and the timers expiry time will be relative to when the scheduler is - * started, not relative to when xTimerReset() was called. - * - * The configUSE_TIMERS configuration constant must be set to 1 for xTimerReset() - * to be available. - * - * @param xTimer The handle of the timer being reset/started/restarted. - * - * @param xTicksToWait Specifies the time, in ticks, that the calling task should - * be held in the Blocked state to wait for the reset command to be successfully - * sent to the timer command queue, should the queue already be full when - * xTimerReset() was called. xTicksToWait is ignored if xTimerReset() is called - * before the scheduler is started. - * - * @return pdFAIL will be returned if the reset command could not be sent to - * the timer command queue even after xTicksToWait ticks had passed. pdPASS will - * be returned if the command was successfully sent to the timer command queue. - * When the command is actually processed will depend on the priority of the - * timer service/daemon task relative to other tasks in the system, although the - * timers expiry time is relative to when xTimerStart() is actually called. The - * timer service/daemon task priority is set by the configTIMER_TASK_PRIORITY - * configuration constant. - * - * Example usage: - * @code{c} - * // When a key is pressed, an LCD back-light is switched on. If 5 seconds pass - * // without a key being pressed, then the LCD back-light is switched off. In - * // this case, the timer is a one-shot timer. - * - * TimerHandle_t xBacklightTimer = NULL; - * - * // The callback function assigned to the one-shot timer. In this case the - * // parameter is not used. - * void vBacklightTimerCallback( TimerHandle_t pxTimer ) - * { - * // The timer expired, therefore 5 seconds must have passed since a key - * // was pressed. Switch off the LCD back-light. - * vSetBacklightState( BACKLIGHT_OFF ); - * } - * - * // The key press event handler. - * void vKeyPressEventHandler( char cKey ) - * { - * // Ensure the LCD back-light is on, then reset the timer that is - * // responsible for turning the back-light off after 5 seconds of - * // key inactivity. Wait 10 ticks for the command to be successfully sent - * // if it cannot be sent immediately. - * vSetBacklightState( BACKLIGHT_ON ); - * if( xTimerReset( xBacklightTimer, 100 ) != pdPASS ) - * { - * // The reset command was not executed successfully. Take appropriate - * // action here. - * } - * - * // Perform the rest of the key processing here. - * } - * - * void main( void ) - * { - * int32_t x; - * - * // Create then start the one-shot timer that is responsible for turning - * // the back-light off if no keys are pressed within a 5 second period. - * xBacklightTimer = xTimerCreate( "BacklightTimer", // Just a text name, not used by the kernel. - * ( 5000 / portTICK_PERIOD_MS), // The timer period in ticks. - * pdFALSE, // The timer is a one-shot timer. - * 0, // The id is not used by the callback so can take any value. - * vBacklightTimerCallback // The callback function that switches the LCD back-light off. - * ); - * - * if( xBacklightTimer == NULL ) - * { - * // The timer was not created. - * } - * else - * { - * // Start the timer. No block time is specified, and even if one was - * // it would be ignored because the scheduler has not yet been - * // started. - * if( xTimerStart( xBacklightTimer, 0 ) != pdPASS ) - * { - * // The timer could not be set into the Active state. - * } - * } - * - * // ... - * // Create tasks here. - * // ... - * - * // Starting the scheduler will start the timer running as it has already - * // been set into the active state. - * xTaskStartScheduler(); - * - * // Should not reach here. - * for( ;; ); - * } - * @endcode - */ -#define xTimerReset( xTimer, xTicksToWait ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_RESET, ( xTaskGetTickCount() ), NULL, ( xTicksToWait ) ) - -/** - * A version of xTimerStart() that can be called from an interrupt service - * routine. - * - * @param xTimer The handle of the timer being started/restarted. - * - * @param pxHigherPriorityTaskWoken The timer service/daemon task spends most - * of its time in the Blocked state, waiting for messages to arrive on the timer - * command queue. Calling xTimerStartFromISR() writes a message to the timer - * command queue, so has the potential to transition the timer service/daemon - * task out of the Blocked state. If calling xTimerStartFromISR() causes the - * timer service/daemon task to leave the Blocked state, and the timer service/ - * daemon task has a priority equal to or greater than the currently executing - * task (the task that was interrupted), then *pxHigherPriorityTaskWoken will - * get set to pdTRUE internally within the xTimerStartFromISR() function. If - * xTimerStartFromISR() sets this value to pdTRUE then a context switch should - * be performed before the interrupt exits. - * - * @return pdFAIL will be returned if the start command could not be sent to - * the timer command queue. pdPASS will be returned if the command was - * successfully sent to the timer command queue. When the command is actually - * processed will depend on the priority of the timer service/daemon task - * relative to other tasks in the system, although the timers expiry time is - * relative to when xTimerStartFromISR() is actually called. The timer - * service/daemon task priority is set by the configTIMER_TASK_PRIORITY - * configuration constant. - * - * Example usage: - * @code{c} - * // This scenario assumes xBacklightTimer has already been created. When a - * // key is pressed, an LCD back-light is switched on. If 5 seconds pass - * // without a key being pressed, then the LCD back-light is switched off. In - * // this case, the timer is a one-shot timer, and unlike the example given for - * // the xTimerReset() function, the key press event handler is an interrupt - * // service routine. - * - * // The callback function assigned to the one-shot timer. In this case the - * // parameter is not used. - * void vBacklightTimerCallback( TimerHandle_t pxTimer ) - * { - * // The timer expired, therefore 5 seconds must have passed since a key - * // was pressed. Switch off the LCD back-light. - * vSetBacklightState( BACKLIGHT_OFF ); - * } - * - * // The key press interrupt service routine. - * void vKeyPressEventInterruptHandler( void ) - * { - * BaseType_t xHigherPriorityTaskWoken = pdFALSE; - * - * // Ensure the LCD back-light is on, then restart the timer that is - * // responsible for turning the back-light off after 5 seconds of - * // key inactivity. This is an interrupt service routine so can only - * // call FreeRTOS API functions that end in "FromISR". - * vSetBacklightState( BACKLIGHT_ON ); - * - * // xTimerStartFromISR() or xTimerResetFromISR() could be called here - * // as both cause the timer to re-calculate its expiry time. - * // xHigherPriorityTaskWoken was initialised to pdFALSE when it was - * // declared (in this function). - * if( xTimerStartFromISR( xBacklightTimer, &xHigherPriorityTaskWoken ) != pdPASS ) - * { - * // The start command was not executed successfully. Take appropriate - * // action here. - * } - * - * // Perform the rest of the key processing here. - * - * // If xHigherPriorityTaskWoken equals pdTRUE, then a context switch - * // should be performed. The syntax required to perform a context switch - * // from inside an ISR varies from port to port, and from compiler to - * // compiler. Inspect the demos for the port you are using to find the - * // actual syntax required. - * if( xHigherPriorityTaskWoken != pdFALSE ) - * { - * // Call the interrupt safe yield function here (actual function - * // depends on the FreeRTOS port being used). - * } - * } - * @endcode - */ -#define xTimerStartFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_START_FROM_ISR, ( xTaskGetTickCountFromISR() ), ( pxHigherPriorityTaskWoken ), 0U ) - -/** - * A version of xTimerStop() that can be called from an interrupt service - * routine. - * - * @param xTimer The handle of the timer being stopped. - * - * @param pxHigherPriorityTaskWoken The timer service/daemon task spends most - * of its time in the Blocked state, waiting for messages to arrive on the timer - * command queue. Calling xTimerStopFromISR() writes a message to the timer - * command queue, so has the potential to transition the timer service/daemon - * task out of the Blocked state. If calling xTimerStopFromISR() causes the - * timer service/daemon task to leave the Blocked state, and the timer service/ - * daemon task has a priority equal to or greater than the currently executing - * task (the task that was interrupted), then *pxHigherPriorityTaskWoken will - * get set to pdTRUE internally within the xTimerStopFromISR() function. If - * xTimerStopFromISR() sets this value to pdTRUE then a context switch should - * be performed before the interrupt exits. - * - * @return pdFAIL will be returned if the stop command could not be sent to - * the timer command queue. pdPASS will be returned if the command was - * successfully sent to the timer command queue. When the command is actually - * processed will depend on the priority of the timer service/daemon task - * relative to other tasks in the system. The timer service/daemon task - * priority is set by the configTIMER_TASK_PRIORITY configuration constant. - * - * Example usage: - * @code{c} - * // This scenario assumes xTimer has already been created and started. When - * // an interrupt occurs, the timer should be simply stopped. - * - * // The interrupt service routine that stops the timer. - * void vAnExampleInterruptServiceRoutine( void ) - * { - * BaseType_t xHigherPriorityTaskWoken = pdFALSE; - * - * // The interrupt has occurred - simply stop the timer. - * // xHigherPriorityTaskWoken was set to pdFALSE where it was defined - * // (within this function). As this is an interrupt service routine, only - * // FreeRTOS API functions that end in "FromISR" can be used. - * if( xTimerStopFromISR( xTimer, &xHigherPriorityTaskWoken ) != pdPASS ) - * { - * // The stop command was not executed successfully. Take appropriate - * // action here. - * } - * - * // If xHigherPriorityTaskWoken equals pdTRUE, then a context switch - * // should be performed. The syntax required to perform a context switch - * // from inside an ISR varies from port to port, and from compiler to - * // compiler. Inspect the demos for the port you are using to find the - * // actual syntax required. - * if( xHigherPriorityTaskWoken != pdFALSE ) - * { - * // Call the interrupt safe yield function here (actual function - * // depends on the FreeRTOS port being used). - * } - * } - * @endcode - */ -#define xTimerStopFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_STOP_FROM_ISR, 0, ( pxHigherPriorityTaskWoken ), 0U ) - -/** - * A version of xTimerChangePeriod() that can be called from an interrupt - * service routine. - * - * @param xTimer The handle of the timer that is having its period changed. - * - * @param xNewPeriod The new period for xTimer. Timer periods are specified in - * tick periods, so the constant portTICK_PERIOD_MS can be used to convert a time - * that has been specified in milliseconds. For example, if the timer must - * expire after 100 ticks, then xNewPeriod should be set to 100. Alternatively, - * if the timer must expire after 500ms, then xNewPeriod can be set to - * ( 500 / portTICK_PERIOD_MS ) provided configTICK_RATE_HZ is less than - * or equal to 1000. - * - * @param pxHigherPriorityTaskWoken The timer service/daemon task spends most - * of its time in the Blocked state, waiting for messages to arrive on the timer - * command queue. Calling xTimerChangePeriodFromISR() writes a message to the - * timer command queue, so has the potential to transition the timer service/ - * daemon task out of the Blocked state. If calling xTimerChangePeriodFromISR() - * causes the timer service/daemon task to leave the Blocked state, and the - * timer service/daemon task has a priority equal to or greater than the - * currently executing task (the task that was interrupted), then - * *pxHigherPriorityTaskWoken will get set to pdTRUE internally within the - * xTimerChangePeriodFromISR() function. If xTimerChangePeriodFromISR() sets - * this value to pdTRUE then a context switch should be performed before the - * interrupt exits. - * - * @return pdFAIL will be returned if the command to change the timers period - * could not be sent to the timer command queue. pdPASS will be returned if the - * command was successfully sent to the timer command queue. When the command - * is actually processed will depend on the priority of the timer service/daemon - * task relative to other tasks in the system. The timer service/daemon task - * priority is set by the configTIMER_TASK_PRIORITY configuration constant. - * - * Example usage: - * @code{c} - * // This scenario assumes xTimer has already been created and started. When - * // an interrupt occurs, the period of xTimer should be changed to 500ms. - * - * // The interrupt service routine that changes the period of xTimer. - * void vAnExampleInterruptServiceRoutine( void ) - * { - * BaseType_t xHigherPriorityTaskWoken = pdFALSE; - * - * // The interrupt has occurred - change the period of xTimer to 500ms. - * // xHigherPriorityTaskWoken was set to pdFALSE where it was defined - * // (within this function). As this is an interrupt service routine, only - * // FreeRTOS API functions that end in "FromISR" can be used. - * if( xTimerChangePeriodFromISR( xTimer, &xHigherPriorityTaskWoken ) != pdPASS ) - * { - * // The command to change the timers period was not executed - * // successfully. Take appropriate action here. - * } - * - * // If xHigherPriorityTaskWoken equals pdTRUE, then a context switch - * // should be performed. The syntax required to perform a context switch - * // from inside an ISR varies from port to port, and from compiler to - * // compiler. Inspect the demos for the port you are using to find the - * // actual syntax required. - * if( xHigherPriorityTaskWoken != pdFALSE ) - * { - * // Call the interrupt safe yield function here (actual function - * // depends on the FreeRTOS port being used). - * } - * } - * @endcode - */ -#define xTimerChangePeriodFromISR( xTimer, xNewPeriod, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_CHANGE_PERIOD_FROM_ISR, ( xNewPeriod ), ( pxHigherPriorityTaskWoken ), 0U ) - -/** - * A version of xTimerReset() that can be called from an interrupt service - * routine. - * - * @param xTimer The handle of the timer that is to be started, reset, or - * restarted. - * - * @param pxHigherPriorityTaskWoken The timer service/daemon task spends most - * of its time in the Blocked state, waiting for messages to arrive on the timer - * command queue. Calling xTimerResetFromISR() writes a message to the timer - * command queue, so has the potential to transition the timer service/daemon - * task out of the Blocked state. If calling xTimerResetFromISR() causes the - * timer service/daemon task to leave the Blocked state, and the timer service/ - * daemon task has a priority equal to or greater than the currently executing - * task (the task that was interrupted), then *pxHigherPriorityTaskWoken will - * get set to pdTRUE internally within the xTimerResetFromISR() function. If - * xTimerResetFromISR() sets this value to pdTRUE then a context switch should - * be performed before the interrupt exits. - * - * @return pdFAIL will be returned if the reset command could not be sent to - * the timer command queue. pdPASS will be returned if the command was - * successfully sent to the timer command queue. When the command is actually - * processed will depend on the priority of the timer service/daemon task - * relative to other tasks in the system, although the timers expiry time is - * relative to when xTimerResetFromISR() is actually called. The timer service/daemon - * task priority is set by the configTIMER_TASK_PRIORITY configuration constant. - * - * Example usage: - * @code{c} - * // This scenario assumes xBacklightTimer has already been created. When a - * // key is pressed, an LCD back-light is switched on. If 5 seconds pass - * // without a key being pressed, then the LCD back-light is switched off. In - * // this case, the timer is a one-shot timer, and unlike the example given for - * // the xTimerReset() function, the key press event handler is an interrupt - * // service routine. - * - * // The callback function assigned to the one-shot timer. In this case the - * // parameter is not used. - * void vBacklightTimerCallback( TimerHandle_t pxTimer ) - * { - * // The timer expired, therefore 5 seconds must have passed since a key - * // was pressed. Switch off the LCD back-light. - * vSetBacklightState( BACKLIGHT_OFF ); - * } - * - * // The key press interrupt service routine. - * void vKeyPressEventInterruptHandler( void ) - * { - * BaseType_t xHigherPriorityTaskWoken = pdFALSE; - * - * // Ensure the LCD back-light is on, then reset the timer that is - * // responsible for turning the back-light off after 5 seconds of - * // key inactivity. This is an interrupt service routine so can only - * // call FreeRTOS API functions that end in "FromISR". - * vSetBacklightState( BACKLIGHT_ON ); - * - * // xTimerStartFromISR() or xTimerResetFromISR() could be called here - * // as both cause the timer to re-calculate its expiry time. - * // xHigherPriorityTaskWoken was initialised to pdFALSE when it was - * // declared (in this function). - * if( xTimerResetFromISR( xBacklightTimer, &xHigherPriorityTaskWoken ) != pdPASS ) - * { - * // The reset command was not executed successfully. Take appropriate - * // action here. - * } - * - * // Perform the rest of the key processing here. - * - * // If xHigherPriorityTaskWoken equals pdTRUE, then a context switch - * // should be performed. The syntax required to perform a context switch - * // from inside an ISR varies from port to port, and from compiler to - * // compiler. Inspect the demos for the port you are using to find the - * // actual syntax required. - * if( xHigherPriorityTaskWoken != pdFALSE ) - * { - * // Call the interrupt safe yield function here (actual function - * // depends on the FreeRTOS port being used). - * } - * } - * @endcode - */ -#define xTimerResetFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_RESET_FROM_ISR, ( xTaskGetTickCountFromISR() ), ( pxHigherPriorityTaskWoken ), 0U ) - - -/** - * Used from application interrupt service routines to defer the execution of a - * function to the RTOS daemon task (the timer service task, hence this function - * is implemented in timers.c and is prefixed with 'Timer'). - * - * Ideally an interrupt service routine (ISR) is kept as short as possible, but - * sometimes an ISR either has a lot of processing to do, or needs to perform - * processing that is not deterministic. In these cases - * xTimerPendFunctionCallFromISR() can be used to defer processing of a function - * to the RTOS daemon task. - * - * A mechanism is provided that allows the interrupt to return directly to the - * task that will subsequently execute the pended callback function. This - * allows the callback function to execute contiguously in time with the - * interrupt - just as if the callback had executed in the interrupt itself. - * - * @param xFunctionToPend The function to execute from the timer service/ - * daemon task. The function must conform to the PendedFunction_t - * prototype. - * - * @param pvParameter1 The value of the callback function's first parameter. - * The parameter has a void * type to allow it to be used to pass any type. - * For example, unsigned longs can be cast to a void *, or the void * can be - * used to point to a structure. - * - * @param ulParameter2 The value of the callback function's second parameter. - * - * @param pxHigherPriorityTaskWoken As mentioned above, calling this function - * will result in a message being sent to the timer daemon task. If the - * priority of the timer daemon task (which is set using - * configTIMER_TASK_PRIORITY in FreeRTOSConfig.h) is higher than the priority of - * the currently running task (the task the interrupt interrupted) then - * *pxHigherPriorityTaskWoken will be set to pdTRUE within - * xTimerPendFunctionCallFromISR(), indicating that a context switch should be - * requested before the interrupt exits. For that reason - * *pxHigherPriorityTaskWoken must be initialised to pdFALSE. See the - * example code below. - * - * @return pdPASS is returned if the message was successfully sent to the - * timer daemon task, otherwise pdFALSE is returned. - * - * Example usage: - * @code{c} - * - * // The callback function that will execute in the context of the daemon task. - * // Note callback functions must all use this same prototype. - * void vProcessInterface( void *pvParameter1, uint32_t ulParameter2 ) - * { - * BaseType_t xInterfaceToService; - * - * // The interface that requires servicing is passed in the second - * // parameter. The first parameter is not used in this case. - * xInterfaceToService = ( BaseType_t ) ulParameter2; - * - * // ...Perform the processing here... - * } - * - * // An ISR that receives data packets from multiple interfaces - * void vAnISR( void ) - * { - * BaseType_t xInterfaceToService, xHigherPriorityTaskWoken; - * - * // Query the hardware to determine which interface needs processing. - * xInterfaceToService = prvCheckInterfaces(); - * - * // The actual processing is to be deferred to a task. Request the - * // vProcessInterface() callback function is executed, passing in the - * // number of the interface that needs processing. The interface to - * // service is passed in the second parameter. The first parameter is - * // not used in this case. - * xHigherPriorityTaskWoken = pdFALSE; - * xTimerPendFunctionCallFromISR( vProcessInterface, NULL, ( uint32_t ) xInterfaceToService, &xHigherPriorityTaskWoken ); - * - * // If xHigherPriorityTaskWoken is now set to pdTRUE then a context - * // switch should be requested. The macro used is port specific and will - * // be either portYIELD_FROM_ISR() or portEND_SWITCHING_ISR() - refer to - * // the documentation page for the port being used. - * portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); - * - * } - * @endcode - */ -BaseType_t xTimerPendFunctionCallFromISR( PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, BaseType_t *pxHigherPriorityTaskWoken ); - - /** - * Used to defer the execution of a function to the RTOS daemon task (the timer - * service task, hence this function is implemented in timers.c and is prefixed - * with 'Timer'). - * - * @param xFunctionToPend The function to execute from the timer service/ - * daemon task. The function must conform to the PendedFunction_t - * prototype. - * - * @param pvParameter1 The value of the callback function's first parameter. - * The parameter has a void * type to allow it to be used to pass any type. - * For example, unsigned longs can be cast to a void *, or the void * can be - * used to point to a structure. - * - * @param ulParameter2 The value of the callback function's second parameter. - * - * @param xTicksToWait Calling this function will result in a message being - * sent to the timer daemon task on a queue. xTicksToWait is the amount of - * time the calling task should remain in the Blocked state (so not using any - * processing time) for space to become available on the timer queue if the - * queue is found to be full. - * - * @return pdPASS is returned if the message was successfully sent to the - * timer daemon task, otherwise pdFALSE is returned. - * - */ -BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, TickType_t xTicksToWait ); - -/** - * Returns the name that was assigned to a timer when the timer was created. - * - * @param xTimer The handle of the timer being queried. - * - * @return The name assigned to the timer specified by the xTimer parameter. - */ -const char * pcTimerGetTimerName( TimerHandle_t xTimer ); /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ - -/** @cond */ -/* - * Functions beyond this part are not part of the public API and are intended - * for use by the kernel only. - */ -BaseType_t xTimerCreateTimerTask( void ) PRIVILEGED_FUNCTION; -BaseType_t xTimerGenericCommand( TimerHandle_t xTimer, const BaseType_t xCommandID, const TickType_t xOptionalValue, BaseType_t * const pxHigherPriorityTaskWoken, const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION; - -/** @endcond */ - -#ifdef __cplusplus -} -#endif -#endif /* TIMERS_H */ - - - diff --git a/tools/sdk/include/freertos/freertos/xtensa_api.h b/tools/sdk/include/freertos/freertos/xtensa_api.h deleted file mode 100644 index 19630ce5819..00000000000 --- a/tools/sdk/include/freertos/freertos/xtensa_api.h +++ /dev/null @@ -1,130 +0,0 @@ -/******************************************************************************* -Copyright (c) 2006-2015 Cadence Design Systems Inc. - -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. -******************************************************************************/ - -/****************************************************************************** - Xtensa-specific API for RTOS ports. -******************************************************************************/ - -#ifndef __XTENSA_API_H__ -#define __XTENSA_API_H__ - -#include - -#include "xtensa_context.h" - - -/* Typedef for C-callable interrupt handler function */ -typedef void (*xt_handler)(void *); - -/* Typedef for C-callable exception handler function */ -typedef void (*xt_exc_handler)(XtExcFrame *); - - -/* -------------------------------------------------------------------------------- - Call this function to set a handler for the specified exception. The handler - will be installed on the core that calls this function. - - n - Exception number (type) - f - Handler function address, NULL to uninstall handler. - - The handler will be passed a pointer to the exception frame, which is created - on the stack of the thread that caused the exception. - - If the handler returns, the thread context will be restored and the faulting - instruction will be retried. Any values in the exception frame that are - modified by the handler will be restored as part of the context. For details - of the exception frame structure see xtensa_context.h. -------------------------------------------------------------------------------- -*/ -extern xt_exc_handler xt_set_exception_handler(int n, xt_exc_handler f); - - -/* -------------------------------------------------------------------------------- - Call this function to set a handler for the specified interrupt. The handler - will be installed on the core that calls this function. - - n - Interrupt number. - f - Handler function address, NULL to uninstall handler. - arg - Argument to be passed to handler. -------------------------------------------------------------------------------- -*/ -extern xt_handler xt_set_interrupt_handler(int n, xt_handler f, void * arg); - - -/* -------------------------------------------------------------------------------- - Call this function to enable the specified interrupts on the core that runs - this code. - - mask - Bit mask of interrupts to be enabled. -------------------------------------------------------------------------------- -*/ -extern void xt_ints_on(unsigned int mask); - - -/* -------------------------------------------------------------------------------- - Call this function to disable the specified interrupts on the core that runs - this code. - - mask - Bit mask of interrupts to be disabled. -------------------------------------------------------------------------------- -*/ -extern void xt_ints_off(unsigned int mask); - - -/* -------------------------------------------------------------------------------- - Call this function to set the specified (s/w) interrupt. -------------------------------------------------------------------------------- -*/ -static inline void xt_set_intset(unsigned int arg) -{ - xthal_set_intset(arg); -} - - -/* -------------------------------------------------------------------------------- - Call this function to clear the specified (s/w or edge-triggered) - interrupt. -------------------------------------------------------------------------------- -*/ -static inline void xt_set_intclear(unsigned int arg) -{ - xthal_set_intclear(arg); -} - -/* -------------------------------------------------------------------------------- - Call this function to get handler's argument for the specified interrupt. - - n - Interrupt number. -------------------------------------------------------------------------------- -*/ -extern void * xt_get_interrupt_handler_arg(int n); - -#endif /* __XTENSA_API_H__ */ - diff --git a/tools/sdk/include/freertos/freertos/xtensa_config.h b/tools/sdk/include/freertos/freertos/xtensa_config.h deleted file mode 100644 index 58baee2da71..00000000000 --- a/tools/sdk/include/freertos/freertos/xtensa_config.h +++ /dev/null @@ -1,146 +0,0 @@ -/******************************************************************************* -// Copyright (c) 2003-2015 Cadence Design Systems, Inc. -// -// 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. --------------------------------------------------------------------------------- - - Configuration-specific information for Xtensa build. This file must be - included in FreeRTOSConfig.h to properly set up the config-dependent - parameters correctly. - - NOTE: To enable thread-safe C library support, XT_USE_THREAD_SAFE_CLIB must - be defined to be > 0 somewhere above or on the command line. - -*******************************************************************************/ - -#ifndef XTENSA_CONFIG_H -#define XTENSA_CONFIG_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include /* required for XSHAL_CLIB */ - -#include "xtensa_context.h" - - -/*----------------------------------------------------------------------------- -* STACK REQUIREMENTS -* -* This section defines the minimum stack size, and the extra space required to -* be allocated for saving coprocessor state and/or C library state information -* (if thread safety is enabled for the C library). The sizes are in bytes. -* -* Stack sizes for individual tasks should be derived from these minima based on -* the maximum call depth of the task and the maximum level of interrupt nesting. -* A minimum stack size is defined by XT_STACK_MIN_SIZE. This minimum is based -* on the requirement for a task that calls nothing else but can be interrupted. -* This assumes that interrupt handlers do not call more than a few levels deep. -* If this is not true, i.e. one or more interrupt handlers make deep calls then -* the minimum must be increased. -* -* If the Xtensa processor configuration includes coprocessors, then space is -* allocated to save the coprocessor state on the stack. -* -* If thread safety is enabled for the C runtime library, (XT_USE_THREAD_SAFE_CLIB -* is defined) then space is allocated to save the C library context in the TCB. -* -* Allocating insufficient stack space is a common source of hard-to-find errors. -* During development, it is best to enable the FreeRTOS stack checking features. -* -* Usage: -* -* XT_USE_THREAD_SAFE_CLIB -- Define this to a nonzero value to enable thread-safe -* use of the C library. This will require extra stack -* space to be allocated for tasks that use the C library -* reentrant functions. See below for more information. -* -* NOTE: The Xtensa toolchain supports multiple C libraries and not all of them -* support thread safety. Check your core configuration to see which C library -* was chosen for your system. -* -* XT_STACK_MIN_SIZE -- The minimum stack size for any task. It is recommended -* that you do not use a stack smaller than this for any -* task. In case you want to use stacks smaller than this -* size, you must verify that the smaller size(s) will work -* under all operating conditions. -* -* XT_STACK_EXTRA -- The amount of extra stack space to allocate for a task -* that does not make C library reentrant calls. Add this -* to the amount of stack space required by the task itself. -* -* XT_STACK_EXTRA_CLIB -- The amount of space to allocate for C library state. -* ------------------------------------------------------------------------------*/ - -/* Extra space required for interrupt/exception hooks. */ -#ifdef XT_INTEXC_HOOKS - #ifdef __XTENSA_CALL0_ABI__ - #define STK_INTEXC_EXTRA 0x200 - #else - #define STK_INTEXC_EXTRA 0x180 - #endif -#else - #define STK_INTEXC_EXTRA 0 -#endif - -#define XT_CLIB_CONTEXT_AREA_SIZE 0 - -/*------------------------------------------------------------------------------ - Extra size -- interrupt frame plus coprocessor save area plus hook space. - NOTE: Make sure XT_INTEXC_HOOKS is undefined unless you really need the hooks. -------------------------------------------------------------------------------*/ -#ifdef __XTENSA_CALL0_ABI__ - #define XT_XTRA_SIZE (XT_STK_FRMSZ + STK_INTEXC_EXTRA + 0x10 + XT_CP_SIZE) -#else - #define XT_XTRA_SIZE (XT_STK_FRMSZ + STK_INTEXC_EXTRA + 0x20 + XT_CP_SIZE) -#endif - -/*------------------------------------------------------------------------------ - Space allocated for user code -- function calls and local variables. - NOTE: This number can be adjusted to suit your needs. You must verify that the - amount of space you reserve is adequate for the worst-case conditions in your - application. - NOTE: The windowed ABI requires more stack, since space has to be reserved - for spilling register windows. -------------------------------------------------------------------------------*/ -#ifdef __XTENSA_CALL0_ABI__ - #define XT_USER_SIZE 0x200 -#else - #define XT_USER_SIZE 0x400 -#endif - -/* Minimum recommended stack size. */ -#define XT_STACK_MIN_SIZE ((XT_XTRA_SIZE + XT_USER_SIZE) / sizeof(unsigned char)) - -/* OS overhead with and without C library thread context. */ -#define XT_STACK_EXTRA (XT_XTRA_SIZE) -#define XT_STACK_EXTRA_CLIB (XT_XTRA_SIZE + XT_CLIB_CONTEXT_AREA_SIZE) - - -#ifdef __cplusplus -} -#endif - -#endif /* XTENSA_CONFIG_H */ - diff --git a/tools/sdk/include/freertos/freertos/xtensa_context.h b/tools/sdk/include/freertos/freertos/xtensa_context.h deleted file mode 100644 index 9e6fe558f54..00000000000 --- a/tools/sdk/include/freertos/freertos/xtensa_context.h +++ /dev/null @@ -1,378 +0,0 @@ -/******************************************************************************* -Copyright (c) 2006-2015 Cadence Design Systems Inc. - -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. --------------------------------------------------------------------------------- - - XTENSA CONTEXT FRAMES AND MACROS FOR RTOS ASSEMBLER SOURCES - -This header contains definitions and macros for use primarily by Xtensa -RTOS assembly coded source files. It includes and uses the Xtensa hardware -abstraction layer (HAL) to deal with config specifics. It may also be -included in C source files. - -!! Supports only Xtensa Exception Architecture 2 (XEA2). XEA1 not supported. !! - -NOTE: The Xtensa architecture requires stack pointer alignment to 16 bytes. - -*******************************************************************************/ - -#ifndef XTENSA_CONTEXT_H -#define XTENSA_CONTEXT_H - -#ifdef __ASSEMBLER__ -#include -#endif - -#include -#include -#include -#include - - -/* Align a value up to nearest n-byte boundary, where n is a power of 2. */ -#define ALIGNUP(n, val) (((val) + (n)-1) & -(n)) - - -/* -------------------------------------------------------------------------------- - Macros that help define structures for both C and assembler. -------------------------------------------------------------------------------- -*/ - -#ifdef STRUCT_BEGIN -#undef STRUCT_BEGIN -#undef STRUCT_FIELD -#undef STRUCT_AFIELD -#undef STRUCT_END -#endif - -#if defined(_ASMLANGUAGE) || defined(__ASSEMBLER__) - -#define STRUCT_BEGIN .pushsection .text; .struct 0 -#define STRUCT_FIELD(ctype,size,asname,name) asname: .space size -#define STRUCT_AFIELD(ctype,size,asname,name,n) asname: .space (size)*(n) -#define STRUCT_END(sname) sname##Size:; .popsection - -#else - -#define STRUCT_BEGIN typedef struct { -#define STRUCT_FIELD(ctype,size,asname,name) ctype name; -#define STRUCT_AFIELD(ctype,size,asname,name,n) ctype name[n]; -#define STRUCT_END(sname) } sname; - -#endif //_ASMLANGUAGE || __ASSEMBLER__ - - -/* -------------------------------------------------------------------------------- - INTERRUPT/EXCEPTION STACK FRAME FOR A THREAD OR NESTED INTERRUPT - - A stack frame of this structure is allocated for any interrupt or exception. - It goes on the current stack. If the RTOS has a system stack for handling - interrupts, every thread stack must allow space for just one interrupt stack - frame, then nested interrupt stack frames go on the system stack. - - The frame includes basic registers (explicit) and "extra" registers introduced - by user TIE or the use of the MAC16 option in the user's Xtensa config. - The frame size is minimized by omitting regs not applicable to user's config. - - For Windowed ABI, this stack frame includes the interruptee's base save area, - another base save area to manage gcc nested functions, and a little temporary - space to help manage the spilling of the register windows. -------------------------------------------------------------------------------- -*/ - -STRUCT_BEGIN -STRUCT_FIELD (long, 4, XT_STK_EXIT, exit) /* exit point for dispatch */ -STRUCT_FIELD (long, 4, XT_STK_PC, pc) /* return PC */ -STRUCT_FIELD (long, 4, XT_STK_PS, ps) /* return PS */ -STRUCT_FIELD (long, 4, XT_STK_A0, a0) -STRUCT_FIELD (long, 4, XT_STK_A1, a1) /* stack pointer before interrupt */ -STRUCT_FIELD (long, 4, XT_STK_A2, a2) -STRUCT_FIELD (long, 4, XT_STK_A3, a3) -STRUCT_FIELD (long, 4, XT_STK_A4, a4) -STRUCT_FIELD (long, 4, XT_STK_A5, a5) -STRUCT_FIELD (long, 4, XT_STK_A6, a6) -STRUCT_FIELD (long, 4, XT_STK_A7, a7) -STRUCT_FIELD (long, 4, XT_STK_A8, a8) -STRUCT_FIELD (long, 4, XT_STK_A9, a9) -STRUCT_FIELD (long, 4, XT_STK_A10, a10) -STRUCT_FIELD (long, 4, XT_STK_A11, a11) -STRUCT_FIELD (long, 4, XT_STK_A12, a12) -STRUCT_FIELD (long, 4, XT_STK_A13, a13) -STRUCT_FIELD (long, 4, XT_STK_A14, a14) -STRUCT_FIELD (long, 4, XT_STK_A15, a15) -STRUCT_FIELD (long, 4, XT_STK_SAR, sar) -STRUCT_FIELD (long, 4, XT_STK_EXCCAUSE, exccause) -STRUCT_FIELD (long, 4, XT_STK_EXCVADDR, excvaddr) -#if XCHAL_HAVE_LOOPS -STRUCT_FIELD (long, 4, XT_STK_LBEG, lbeg) -STRUCT_FIELD (long, 4, XT_STK_LEND, lend) -STRUCT_FIELD (long, 4, XT_STK_LCOUNT, lcount) -#endif -#ifndef __XTENSA_CALL0_ABI__ -/* Temporary space for saving stuff during window spill */ -STRUCT_FIELD (long, 4, XT_STK_TMP0, tmp0) -STRUCT_FIELD (long, 4, XT_STK_TMP1, tmp1) -STRUCT_FIELD (long, 4, XT_STK_TMP2, tmp2) -#endif -#ifdef XT_USE_SWPRI -/* Storage for virtual priority mask */ -STRUCT_FIELD (long, 4, XT_STK_VPRI, vpri) -#endif -#ifdef XT_USE_OVLY -/* Storage for overlay state */ -STRUCT_FIELD (long, 4, XT_STK_OVLY, ovly) -#endif -STRUCT_END(XtExcFrame) - -#if defined(_ASMLANGUAGE) || defined(__ASSEMBLER__) -#define XT_STK_NEXT1 XtExcFrameSize -#else -#define XT_STK_NEXT1 sizeof(XtExcFrame) -#endif - -/* Allocate extra storage if needed */ -#if XCHAL_EXTRA_SA_SIZE != 0 - -#if XCHAL_EXTRA_SA_ALIGN <= 16 -#define XT_STK_EXTRA ALIGNUP(XCHAL_EXTRA_SA_ALIGN, XT_STK_NEXT1) -#else -/* If need more alignment than stack, add space for dynamic alignment */ -#define XT_STK_EXTRA (ALIGNUP(XCHAL_EXTRA_SA_ALIGN, XT_STK_NEXT1) + XCHAL_EXTRA_SA_ALIGN) -#endif -#define XT_STK_NEXT2 (XT_STK_EXTRA + XCHAL_EXTRA_SA_SIZE) - -#else - -#define XT_STK_NEXT2 XT_STK_NEXT1 - -#endif - -/* -------------------------------------------------------------------------------- - This is the frame size. Add space for 4 registers (interruptee's base save - area) and some space for gcc nested functions if any. -------------------------------------------------------------------------------- -*/ -#define XT_STK_FRMSZ (ALIGNUP(0x10, XT_STK_NEXT2) + 0x20) - - -/* -------------------------------------------------------------------------------- - SOLICITED STACK FRAME FOR A THREAD - - A stack frame of this structure is allocated whenever a thread enters the - RTOS kernel intentionally (and synchronously) to submit to thread scheduling. - It goes on the current thread's stack. - - The solicited frame only includes registers that are required to be preserved - by the callee according to the compiler's ABI conventions, some space to save - the return address for returning to the caller, and the caller's PS register. - - For Windowed ABI, this stack frame includes the caller's base save area. - - Note on XT_SOL_EXIT field: - It is necessary to distinguish a solicited from an interrupt stack frame. - This field corresponds to XT_STK_EXIT in the interrupt stack frame and is - always at the same offset (0). It can be written with a code (usually 0) - to distinguish a solicted frame from an interrupt frame. An RTOS port may - opt to ignore this field if it has another way of distinguishing frames. -------------------------------------------------------------------------------- -*/ - -STRUCT_BEGIN -#ifdef __XTENSA_CALL0_ABI__ -STRUCT_FIELD (long, 4, XT_SOL_EXIT, exit) -STRUCT_FIELD (long, 4, XT_SOL_PC, pc) -STRUCT_FIELD (long, 4, XT_SOL_PS, ps) -STRUCT_FIELD (long, 4, XT_SOL_NEXT, next) -STRUCT_FIELD (long, 4, XT_SOL_A12, a12) /* should be on 16-byte alignment */ -STRUCT_FIELD (long, 4, XT_SOL_A13, a13) -STRUCT_FIELD (long, 4, XT_SOL_A14, a14) -STRUCT_FIELD (long, 4, XT_SOL_A15, a15) -#else -STRUCT_FIELD (long, 4, XT_SOL_EXIT, exit) -STRUCT_FIELD (long, 4, XT_SOL_PC, pc) -STRUCT_FIELD (long, 4, XT_SOL_PS, ps) -STRUCT_FIELD (long, 4, XT_SOL_NEXT, next) -STRUCT_FIELD (long, 4, XT_SOL_A0, a0) /* should be on 16-byte alignment */ -STRUCT_FIELD (long, 4, XT_SOL_A1, a1) -STRUCT_FIELD (long, 4, XT_SOL_A2, a2) -STRUCT_FIELD (long, 4, XT_SOL_A3, a3) -#endif -STRUCT_END(XtSolFrame) - -/* Size of solicited stack frame */ -#define XT_SOL_FRMSZ ALIGNUP(0x10, XtSolFrameSize) - - -/* -------------------------------------------------------------------------------- - CO-PROCESSOR STATE SAVE AREA FOR A THREAD - - The RTOS must provide an area per thread to save the state of co-processors - when that thread does not have control. Co-processors are context-switched - lazily (on demand) only when a new thread uses a co-processor instruction, - otherwise a thread retains ownership of the co-processor even when it loses - control of the processor. An Xtensa co-processor exception is triggered when - any co-processor instruction is executed by a thread that is not the owner, - and the context switch of that co-processor is then peformed by the handler. - Ownership represents which thread's state is currently in the co-processor. - - Co-processors may not be used by interrupt or exception handlers. If an - co-processor instruction is executed by an interrupt or exception handler, - the co-processor exception handler will trigger a kernel panic and freeze. - This restriction is introduced to reduce the overhead of saving and restoring - co-processor state (which can be quite large) and in particular remove that - overhead from interrupt handlers. - - The co-processor state save area may be in any convenient per-thread location - such as in the thread control block or above the thread stack area. It need - not be in the interrupt stack frame since interrupts don't use co-processors. - - Along with the save area for each co-processor, two bitmasks with flags per - co-processor (laid out as in the CPENABLE reg) help manage context-switching - co-processors as efficiently as possible: - - XT_CPENABLE - The contents of a non-running thread's CPENABLE register. - It represents the co-processors owned (and whose state is still needed) - by the thread. When a thread is preempted, its CPENABLE is saved here. - When a thread solicits a context-swtich, its CPENABLE is cleared - the - compiler has saved the (caller-saved) co-proc state if it needs to. - When a non-running thread loses ownership of a CP, its bit is cleared. - When a thread runs, it's XT_CPENABLE is loaded into the CPENABLE reg. - Avoids co-processor exceptions when no change of ownership is needed. - - XT_CPSTORED - A bitmask with the same layout as CPENABLE, a bit per co-processor. - Indicates whether the state of each co-processor is saved in the state - save area. When a thread enters the kernel, only the state of co-procs - still enabled in CPENABLE is saved. When the co-processor exception - handler assigns ownership of a co-processor to a thread, it restores - the saved state only if this bit is set, and clears this bit. - - XT_CP_CS_ST - A bitmask with the same layout as CPENABLE, a bit per co-processor. - Indicates whether callee-saved state is saved in the state save area. - Callee-saved state is saved by itself on a solicited context switch, - and restored when needed by the coprocessor exception handler. - Unsolicited switches will cause the entire coprocessor to be saved - when necessary. - - XT_CP_ASA - Pointer to the aligned save area. Allows it to be aligned more than - the overall save area (which might only be stack-aligned or TCB-aligned). - Especially relevant for Xtensa cores configured with a very large data - path that requires alignment greater than 16 bytes (ABI stack alignment). -------------------------------------------------------------------------------- -*/ - -#if XCHAL_CP_NUM > 0 - -/* Offsets of each coprocessor save area within the 'aligned save area': */ -#define XT_CP0_SA 0 -#define XT_CP1_SA ALIGNUP(XCHAL_CP1_SA_ALIGN, XT_CP0_SA + XCHAL_CP0_SA_SIZE) -#define XT_CP2_SA ALIGNUP(XCHAL_CP2_SA_ALIGN, XT_CP1_SA + XCHAL_CP1_SA_SIZE) -#define XT_CP3_SA ALIGNUP(XCHAL_CP3_SA_ALIGN, XT_CP2_SA + XCHAL_CP2_SA_SIZE) -#define XT_CP4_SA ALIGNUP(XCHAL_CP4_SA_ALIGN, XT_CP3_SA + XCHAL_CP3_SA_SIZE) -#define XT_CP5_SA ALIGNUP(XCHAL_CP5_SA_ALIGN, XT_CP4_SA + XCHAL_CP4_SA_SIZE) -#define XT_CP6_SA ALIGNUP(XCHAL_CP6_SA_ALIGN, XT_CP5_SA + XCHAL_CP5_SA_SIZE) -#define XT_CP7_SA ALIGNUP(XCHAL_CP7_SA_ALIGN, XT_CP6_SA + XCHAL_CP6_SA_SIZE) -#define XT_CP_SA_SIZE ALIGNUP(16, XT_CP7_SA + XCHAL_CP7_SA_SIZE) - -/* Offsets within the overall save area: */ -#define XT_CPENABLE 0 /* (2 bytes) coprocessors active for this thread */ -#define XT_CPSTORED 2 /* (2 bytes) coprocessors saved for this thread */ -#define XT_CP_CS_ST 4 /* (2 bytes) coprocessor callee-saved regs stored for this thread */ -#define XT_CP_ASA 8 /* (4 bytes) ptr to aligned save area */ -/* Overall size allows for dynamic alignment: */ -#define XT_CP_SIZE (12 + XT_CP_SA_SIZE + XCHAL_TOTAL_SA_ALIGN) -#else -#define XT_CP_SIZE 0 -#endif - - -/* - Macro to get the current core ID. Only uses the reg given as an argument. - Reading PRID on the ESP32 gives us 0xCDCD on the PRO processor (0) - and 0xABAB on the APP CPU (1). We can distinguish between the two by checking - bit 13: it's 1 on the APP and 0 on the PRO processor. -*/ -#ifdef __ASSEMBLER__ - .macro getcoreid reg - rsr.prid \reg - extui \reg,\reg,13,1 - .endm -#endif - -#define CORE_ID_PRO 0xCDCD -#define CORE_ID_APP 0xABAB - -/* -------------------------------------------------------------------------------- - MACROS TO HANDLE ABI SPECIFICS OF FUNCTION ENTRY AND RETURN - - Convenient where the frame size requirements are the same for both ABIs. - ENTRY(sz), RET(sz) are for framed functions (have locals or make calls). - ENTRY0, RET0 are for frameless functions (no locals, no calls). - - where size = size of stack frame in bytes (must be >0 and aligned to 16). - For framed functions the frame is created and the return address saved at - base of frame (Call0 ABI) or as determined by hardware (Windowed ABI). - For frameless functions, there is no frame and return address remains in a0. - Note: Because CPP macros expand to a single line, macros requiring multi-line - expansions are implemented as assembler macros. -------------------------------------------------------------------------------- -*/ - -#ifdef __ASSEMBLER__ -#ifdef __XTENSA_CALL0_ABI__ - /* Call0 */ - #define ENTRY(sz) entry1 sz - .macro entry1 size=0x10 - addi sp, sp, -\size - s32i a0, sp, 0 - .endm - #define ENTRY0 - #define RET(sz) ret1 sz - .macro ret1 size=0x10 - l32i a0, sp, 0 - addi sp, sp, \size - ret - .endm - #define RET0 ret -#else - /* Windowed */ - #define ENTRY(sz) entry sp, sz - #define ENTRY0 entry sp, 0x10 - #define RET(sz) retw - #define RET0 retw -#endif -#endif - - - - - -#endif /* XTENSA_CONTEXT_H */ - diff --git a/tools/sdk/include/freertos/freertos/xtensa_rtos.h b/tools/sdk/include/freertos/freertos/xtensa_rtos.h deleted file mode 100644 index 25d42da59bc..00000000000 --- a/tools/sdk/include/freertos/freertos/xtensa_rtos.h +++ /dev/null @@ -1,232 +0,0 @@ -/******************************************************************************* -// Copyright (c) 2003-2015 Cadence Design Systems, Inc. -// -// 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. --------------------------------------------------------------------------------- - - RTOS-SPECIFIC INFORMATION FOR XTENSA RTOS ASSEMBLER SOURCES - (FreeRTOS Port) - -This header is the primary glue between generic Xtensa RTOS support -sources and a specific RTOS port for Xtensa. It contains definitions -and macros for use primarily by Xtensa assembly coded source files. - -Macros in this header map callouts from generic Xtensa files to specific -RTOS functions. It may also be included in C source files. - -Xtensa RTOS ports support all RTOS-compatible configurations of the Xtensa -architecture, using the Xtensa hardware abstraction layer (HAL) to deal -with configuration specifics. - -Should be included by all Xtensa generic and RTOS port-specific sources. - -*******************************************************************************/ - -#ifndef XTENSA_RTOS_H -#define XTENSA_RTOS_H - -#ifdef __ASSEMBLER__ -#include -#else -#include -#endif - -#include -#include - -/* -Include any RTOS specific definitions that are needed by this header. -*/ -#include "FreeRTOSConfig.h" - -/* -Convert FreeRTOSConfig definitions to XTENSA definitions. -However these can still be overridden from the command line. -*/ - -#ifndef XT_SIMULATOR - #if configXT_SIMULATOR - #define XT_SIMULATOR 1 /* Simulator mode */ - #endif -#endif - -#ifndef XT_BOARD - #if configXT_BOARD - #define XT_BOARD 1 /* Board mode */ - #endif -#endif - -#ifndef XT_TIMER_INDEX - #if defined configXT_TIMER_INDEX - #define XT_TIMER_INDEX configXT_TIMER_INDEX /* Index of hardware timer to be used */ - #endif -#endif - -#ifndef XT_INTEXC_HOOKS - #if configXT_INTEXC_HOOKS - #define XT_INTEXC_HOOKS 1 /* Enables exception hooks */ - #endif -#endif - -#if !defined(XT_SIMULATOR) && !defined(XT_BOARD) - #error Either XT_SIMULATOR or XT_BOARD must be defined. -#endif - - -/* -Name of RTOS (for messages). -*/ -#define XT_RTOS_NAME FreeRTOS - -/* -Check some Xtensa configuration requirements and report error if not met. -Error messages can be customize to the RTOS port. -*/ - -#if !XCHAL_HAVE_XEA2 -#error "FreeRTOS/Xtensa requires XEA2 (exception architecture 2)." -#endif - - -/******************************************************************************* - -RTOS CALLOUT MACROS MAPPED TO RTOS PORT-SPECIFIC FUNCTIONS. - -Define callout macros used in generic Xtensa code to interact with the RTOS. -The macros are simply the function names for use in calls from assembler code. -Some of these functions may call back to generic functions in xtensa_context.h . - -*******************************************************************************/ - -/* -Inform RTOS of entry into an interrupt handler that will affect it. -Allows RTOS to manage switch to any system stack and count nesting level. -Called after minimal context has been saved, with interrupts disabled. -RTOS port can call0 _xt_context_save to save the rest of the context. -May only be called from assembly code by the 'call0' instruction. -*/ -// void XT_RTOS_INT_ENTER(void) -#define XT_RTOS_INT_ENTER _frxt_int_enter - -/* -Inform RTOS of completion of an interrupt handler, and give control to -RTOS to perform thread/task scheduling, switch back from any system stack -and restore the context, and return to the exit dispatcher saved in the -stack frame at XT_STK_EXIT. RTOS port can call0 _xt_context_restore -to save the context saved in XT_RTOS_INT_ENTER via _xt_context_save, -leaving only a minimal part of the context to be restored by the exit -dispatcher. This function does not return to the place it was called from. -May only be called from assembly code by the 'call0' instruction. -*/ -// void XT_RTOS_INT_EXIT(void) -#define XT_RTOS_INT_EXIT _frxt_int_exit - -/* -Inform RTOS of the occurrence of a tick timer interrupt. -If RTOS has no tick timer, leave XT_RTOS_TIMER_INT undefined. -May be coded in or called from C or assembly, per ABI conventions. -RTOS may optionally define XT_TICK_PER_SEC in its own way (eg. macro). -*/ -// void XT_RTOS_TIMER_INT(void) -#define XT_RTOS_TIMER_INT _frxt_timer_int -#define XT_TICK_PER_SEC configTICK_RATE_HZ - -/* -Return in a15 the base address of the co-processor state save area for the -thread that triggered a co-processor exception, or 0 if no thread was running. -The state save area is structured as defined in xtensa_context.h and has size -XT_CP_SIZE. Co-processor instructions should only be used in thread code, never -in interrupt handlers or the RTOS kernel. May only be called from assembly code -and by the 'call0' instruction. A result of 0 indicates an unrecoverable error. -The implementation may use only a2-4, a15 (all other regs must be preserved). -*/ -// void* XT_RTOS_CP_STATE(void) -#define XT_RTOS_CP_STATE _frxt_task_coproc_state - - -/******************************************************************************* - -HOOKS TO DYNAMICALLY INSTALL INTERRUPT AND EXCEPTION HANDLERS PER LEVEL. - -This Xtensa RTOS port provides hooks for dynamically installing exception -and interrupt handlers to facilitate automated testing where each test -case can install its own handler for user exceptions and each interrupt -priority (level). This consists of an array of function pointers indexed -by interrupt priority, with index 0 being the user exception handler hook. -Each entry in the array is initially 0, and may be replaced by a function -pointer of type XT_INTEXC_HOOK. A handler may be uninstalled by installing 0. - -The handler for low and medium priority obeys ABI conventions so may be coded -in C. For the exception handler, the cause is the contents of the EXCCAUSE -reg, and the result is -1 if handled, else the cause (still needs handling). -For interrupt handlers, the cause is a mask of pending enabled interrupts at -that level, and the result is the same mask with the bits for the handled -interrupts cleared (those not cleared still need handling). This allows a test -case to either pre-handle or override the default handling for the exception -or interrupt level (see xtensa_vectors.S). - -High priority handlers (including NMI) must be coded in assembly, are always -called by 'call0' regardless of ABI, must preserve all registers except a0, -and must not use or modify the interrupted stack. The hook argument 'cause' -is not passed and the result is ignored, so as not to burden the caller with -saving and restoring a2 (it assumes only one interrupt per level - see the -discussion in high priority interrupts in xtensa_vectors.S). The handler -therefore should be coded to prototype 'void h(void)' even though it plugs -into an array of handlers of prototype 'unsigned h(unsigned)'. - -To enable interrupt/exception hooks, compile the RTOS with '-DXT_INTEXC_HOOKS'. - -*******************************************************************************/ - -#define XT_INTEXC_HOOK_NUM (1 + XCHAL_NUM_INTLEVELS + XCHAL_HAVE_NMI) - -#ifndef __ASSEMBLER__ -typedef unsigned (*XT_INTEXC_HOOK)(unsigned cause); -extern volatile XT_INTEXC_HOOK _xt_intexc_hooks[XT_INTEXC_HOOK_NUM]; -#endif - - -/******************************************************************************* - -CONVENIENCE INCLUSIONS. - -Ensures RTOS specific files need only include this one Xtensa-generic header. -These headers are included last so they can use the RTOS definitions above. - -*******************************************************************************/ - -#include "xtensa_context.h" - -#ifdef XT_RTOS_TIMER_INT -#include "xtensa_timer.h" -#endif - - -/******************************************************************************* - -Xtensa Port Version. - -*******************************************************************************/ - -#define XTENSA_PORT_VERSION 1.4.2 -#define XTENSA_PORT_VERSION_STRING "1.4.2" - -#endif /* XTENSA_RTOS_H */ - diff --git a/tools/sdk/include/freertos/freertos/xtensa_timer.h b/tools/sdk/include/freertos/freertos/xtensa_timer.h deleted file mode 100644 index fa4f96098c0..00000000000 --- a/tools/sdk/include/freertos/freertos/xtensa_timer.h +++ /dev/null @@ -1,159 +0,0 @@ -/******************************************************************************* -// Copyright (c) 2003-2015 Cadence Design Systems, Inc. -// -// 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. --------------------------------------------------------------------------------- - - XTENSA INFORMATION FOR RTOS TICK TIMER AND CLOCK FREQUENCY - -This header contains definitions and macros for use primarily by Xtensa -RTOS assembly coded source files. It includes and uses the Xtensa hardware -abstraction layer (HAL) to deal with config specifics. It may also be -included in C source files. - -User may edit to modify timer selection and to specify clock frequency and -tick duration to match timer interrupt to the real-time tick duration. - -If the RTOS has no timer interrupt, then there is no tick timer and the -clock frequency is irrelevant, so all of these macros are left undefined -and the Xtensa core configuration need not have a timer. - -*******************************************************************************/ - -#ifndef XTENSA_TIMER_H -#define XTENSA_TIMER_H - -#ifdef __ASSEMBLER__ -#include -#endif - -#include -#include - -#include "xtensa_rtos.h" /* in case this wasn't included directly */ - -#include "FreeRTOSConfig.h" - -/* -Select timer to use for periodic tick, and determine its interrupt number -and priority. User may specify a timer by defining XT_TIMER_INDEX with -D, -in which case its validity is checked (it must exist in this core and must -not be on a high priority interrupt - an error will be reported in invalid). -Otherwise select the first low or medium priority interrupt timer available. -*/ -#if XCHAL_NUM_TIMERS == 0 - - #error "This Xtensa configuration is unsupported, it has no timers." - -#else - -#ifndef XT_TIMER_INDEX - #if XCHAL_TIMER3_INTERRUPT != XTHAL_TIMER_UNCONFIGURED - #if XCHAL_INT_LEVEL(XCHAL_TIMER3_INTERRUPT) <= XCHAL_EXCM_LEVEL - #undef XT_TIMER_INDEX - #define XT_TIMER_INDEX 3 - #endif - #endif - #if XCHAL_TIMER2_INTERRUPT != XTHAL_TIMER_UNCONFIGURED - #if XCHAL_INT_LEVEL(XCHAL_TIMER2_INTERRUPT) <= XCHAL_EXCM_LEVEL - #undef XT_TIMER_INDEX - #define XT_TIMER_INDEX 2 - #endif - #endif - #if XCHAL_TIMER1_INTERRUPT != XTHAL_TIMER_UNCONFIGURED - #if XCHAL_INT_LEVEL(XCHAL_TIMER1_INTERRUPT) <= XCHAL_EXCM_LEVEL - #undef XT_TIMER_INDEX - #define XT_TIMER_INDEX 1 - #endif - #endif - #if XCHAL_TIMER0_INTERRUPT != XTHAL_TIMER_UNCONFIGURED - #if XCHAL_INT_LEVEL(XCHAL_TIMER0_INTERRUPT) <= XCHAL_EXCM_LEVEL - #undef XT_TIMER_INDEX - #define XT_TIMER_INDEX 0 - #endif - #endif -#endif -#ifndef XT_TIMER_INDEX - #error "There is no suitable timer in this Xtensa configuration." -#endif - -#define XT_CCOMPARE (CCOMPARE + XT_TIMER_INDEX) -#define XT_TIMER_INTNUM XCHAL_TIMER_INTERRUPT(XT_TIMER_INDEX) -#define XT_TIMER_INTPRI XCHAL_INT_LEVEL(XT_TIMER_INTNUM) -#define XT_TIMER_INTEN (1 << XT_TIMER_INTNUM) - -#if XT_TIMER_INTNUM == XTHAL_TIMER_UNCONFIGURED - #error "The timer selected by XT_TIMER_INDEX does not exist in this core." -#elif XT_TIMER_INTPRI > XCHAL_EXCM_LEVEL - #error "The timer interrupt cannot be high priority (use medium or low)." -#endif - -#endif /* XCHAL_NUM_TIMERS */ - -/* -Set processor clock frequency, used to determine clock divisor for timer tick. -User should BE SURE TO ADJUST THIS for the Xtensa platform being used. -If using a supported board via the board-independent API defined in xtbsp.h, -this may be left undefined and frequency and tick divisor will be computed -and cached during run-time initialization. - -NOTE ON SIMULATOR: -Under the Xtensa instruction set simulator, the frequency can only be estimated -because it depends on the speed of the host and the version of the simulator. -Also because it runs much slower than hardware, it is not possible to achieve -real-time performance for most applications under the simulator. A frequency -too low does not allow enough time between timer interrupts, starving threads. -To obtain a more convenient but non-real-time tick duration on the simulator, -compile with xt-xcc option "-DXT_SIMULATOR". -Adjust this frequency to taste (it's not real-time anyway!). -*/ -#if defined(XT_SIMULATOR) && !defined(XT_CLOCK_FREQ) -#define XT_CLOCK_FREQ configCPU_CLOCK_HZ -#endif - -#if !defined(XT_CLOCK_FREQ) && !defined(XT_BOARD) - #error "XT_CLOCK_FREQ must be defined for the target platform." -#endif - -/* -Default number of timer "ticks" per second (default 100 for 10ms tick). -RTOS may define this in its own way (if applicable) in xtensa_rtos.h. -User may redefine this to an optimal value for the application, either by -editing this here or in xtensa_rtos.h, or compiling with xt-xcc option -"-DXT_TICK_PER_SEC=" where is a suitable number. -*/ -#ifndef XT_TICK_PER_SEC -#define XT_TICK_PER_SEC configTICK_RATE_HZ /* 10 ms tick = 100 ticks per second */ -#endif - -/* -Derivation of clock divisor for timer tick and interrupt (one per tick). -*/ -#ifdef XT_CLOCK_FREQ -#define XT_TICK_DIVISOR (XT_CLOCK_FREQ / XT_TICK_PER_SEC) -#endif - -#ifndef __ASSEMBLER__ -extern unsigned _xt_tick_divisor; -extern void _xt_tick_divisor_init(void); -#endif - -#endif /* XTENSA_TIMER_H */ - diff --git a/tools/sdk/include/heap/esp_heap_alloc_caps.h b/tools/sdk/include/heap/esp_heap_alloc_caps.h deleted file mode 100644 index 7e6e25d6a85..00000000000 --- a/tools/sdk/include/heap/esp_heap_alloc_caps.h +++ /dev/null @@ -1,35 +0,0 @@ -// 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. -#pragma once -#warning "This header is deprecated, please use functions defined in esp_heap_caps.h instead." -#include "esp_heap_caps.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Deprecated FreeRTOS-style esp_heap_alloc_caps.h functions follow */ - -/* Please use heap_caps_malloc() instead of this function */ -void *pvPortMallocCaps(size_t xWantedSize, uint32_t caps) asm("heap_caps_malloc") __attribute__((deprecated)); - -/* Please use heap_caps_get_minimum_free_size() instead of this function */ -size_t xPortGetMinimumEverFreeHeapSizeCaps( uint32_t caps ) asm("heap_caps_get_minimum_free_size") __attribute__((deprecated)); - -/* Please use heap_caps_get_free_size() instead of this function */ -size_t xPortGetFreeHeapSizeCaps( uint32_t caps ) asm("heap_caps_get_free_size") __attribute__((deprecated)); - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/heap/esp_heap_caps.h b/tools/sdk/include/heap/esp_heap_caps.h deleted file mode 100644 index 5a7aa6bc2f3..00000000000 --- a/tools/sdk/include/heap/esp_heap_caps.h +++ /dev/null @@ -1,315 +0,0 @@ -// 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. -#pragma once - -#include -#include -#include "multi_heap.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Flags to indicate the capabilities of the various memory systems - */ -#define MALLOC_CAP_EXEC (1<<0) ///< Memory must be able to run executable code -#define MALLOC_CAP_32BIT (1<<1) ///< Memory must allow for aligned 32-bit data accesses -#define MALLOC_CAP_8BIT (1<<2) ///< Memory must allow for 8/16/...-bit data accesses -#define MALLOC_CAP_DMA (1<<3) ///< Memory must be able to accessed by DMA -#define MALLOC_CAP_PID2 (1<<4) ///< Memory must be mapped to PID2 memory space (PIDs are not currently used) -#define MALLOC_CAP_PID3 (1<<5) ///< Memory must be mapped to PID3 memory space (PIDs are not currently used) -#define MALLOC_CAP_PID4 (1<<6) ///< Memory must be mapped to PID4 memory space (PIDs are not currently used) -#define MALLOC_CAP_PID5 (1<<7) ///< Memory must be mapped to PID5 memory space (PIDs are not currently used) -#define MALLOC_CAP_PID6 (1<<8) ///< Memory must be mapped to PID6 memory space (PIDs are not currently used) -#define MALLOC_CAP_PID7 (1<<9) ///< Memory must be mapped to PID7 memory space (PIDs are not currently used) -#define MALLOC_CAP_SPIRAM (1<<10) ///< Memory must be in SPI RAM -#define MALLOC_CAP_INTERNAL (1<<11) ///< Memory must be internal; specifically it should not disappear when flash/spiram cache is switched off -#define MALLOC_CAP_DEFAULT (1<<12) ///< Memory can be returned in a non-capability-specific memory allocation (e.g. malloc(), calloc()) call -#define MALLOC_CAP_INVALID (1<<31) ///< Memory can't be used / list end marker - -/** - * @brief Allocate a chunk of memory which has the given capabilities - * - * Equivalent semantics to libc malloc(), for capability-aware memory. - * - * In IDF, ``malloc(p)`` is equivalent to ``heap_caps_malloc(p, MALLOC_CAP_8BIT)``. - * - * @param size Size, in bytes, of the amount of memory to allocate - * @param caps Bitwise OR of MALLOC_CAP_* flags indicating the type - * of memory to be returned - * - * @return A pointer to the memory allocated on success, NULL on failure - */ -void *heap_caps_malloc(size_t size, uint32_t caps); - - -/** - * @brief Free memory previously allocated via heap_caps_malloc() or heap_caps_realloc(). - * - * Equivalent semantics to libc free(), for capability-aware memory. - * - * In IDF, ``free(p)`` is equivalent to ``heap_caps_free(p)``. - * - * @param ptr Pointer to memory previously returned from heap_caps_malloc() or heap_caps_realloc(). Can be NULL. - */ -void heap_caps_free( void *ptr); - -/** - * @brief Reallocate memory previously allocated via heap_caps_malloc() or heap_caps_realloc(). - * - * Equivalent semantics to libc realloc(), for capability-aware memory. - * - * In IDF, ``realloc(p, s)`` is equivalent to ``heap_caps_realloc(p, s, MALLOC_CAP_8BIT)``. - * - * 'caps' parameter can be different to the capabilities that any original 'ptr' was allocated with. In this way, - * realloc can be used to "move" a buffer if necessary to ensure it meets a new set of capabilities. - * - * @param ptr Pointer to previously allocated memory, or NULL for a new allocation. - * @param size Size of the new buffer requested, or 0 to free the buffer. - * @param caps Bitwise OR of MALLOC_CAP_* flags indicating the type - * of memory desired for the new allocation. - * - * @return Pointer to a new buffer of size 'size' with capabilities 'caps', or NULL if allocation failed. - */ -void *heap_caps_realloc( void *ptr, size_t size, int caps); - -/** - * @brief Allocate a chunk of memory which has the given capabilities. The initialized value in the memory is set to zero. - * - * Equivalent semantics to libc calloc(), for capability-aware memory. - * - * In IDF, ``calloc(p)`` is equivalent to ``heap_caps_calloc(p, MALLOC_CAP_8BIT)``. - * - * @param n Number of continuing chunks of memory to allocate - * @param size Size, in bytes, of a chunk of memory to allocate - * @param caps Bitwise OR of MALLOC_CAP_* flags indicating the type - * of memory to be returned - * - * @return A pointer to the memory allocated on success, NULL on failure - */ -void *heap_caps_calloc(size_t n, size_t size, uint32_t caps); - -/** - * @brief Get the total free size of all the regions that have the given capabilities - * - * This function takes all regions capable of having the given capabilities allocated in them - * and adds up the free space they have. - * - * Note that because of heap fragmentation it is probably not possible to allocate a single block of memory - * of this size. Use heap_caps_get_largest_free_block() for this purpose. - - * @param caps Bitwise OR of MALLOC_CAP_* flags indicating the type - * of memory - * - * @return Amount of free bytes in the regions - */ -size_t heap_caps_get_free_size( uint32_t caps ); - - -/** - * @brief Get the total minimum free memory of all regions with the given capabilities - * - * This adds all the low water marks of the regions capable of delivering the memory - * with the given capabilities. - * - * Note the result may be less than the global all-time minimum available heap of this kind, as "low water marks" are - * tracked per-region. Individual regions' heaps may have reached their "low water marks" at different points in time. However - * this result still gives a "worst case" indication for all-time minimum free heap. - * - * @param caps Bitwise OR of MALLOC_CAP_* flags indicating the type - * of memory - * - * @return Amount of free bytes in the regions - */ -size_t heap_caps_get_minimum_free_size( uint32_t caps ); - -/** - * @brief Get the largest free block of memory able to be allocated with the given capabilities. - * - * Returns the largest value of ``s`` for which ``heap_caps_malloc(s, caps)`` will succeed. - * - * @param caps Bitwise OR of MALLOC_CAP_* flags indicating the type - * of memory - * - * @return Size of largest free block in bytes. - */ -size_t heap_caps_get_largest_free_block( uint32_t caps ); - - -/** - * @brief Get heap info for all regions with the given capabilities. - * - * Calls multi_heap_info() on all heaps which share the given capabilities. The information returned is an aggregate - * across all matching heaps. The meanings of fields are the same as defined for multi_heap_info_t, except that - * ``minimum_free_bytes`` has the same caveats described in heap_caps_get_minimum_free_size(). - * - * @param info Pointer to a structure which will be filled with relevant - * heap metadata. - * @param caps Bitwise OR of MALLOC_CAP_* flags indicating the type - * of memory - * - */ -void heap_caps_get_info( multi_heap_info_t *info, uint32_t caps ); - - -/** - * @brief Print a summary of all memory with the given capabilities. - * - * Calls multi_heap_info on all heaps which share the given capabilities, and - * prints a two-line summary for each, then a total summary. - * - * @param caps Bitwise OR of MALLOC_CAP_* flags indicating the type - * of memory - * - */ -void heap_caps_print_heap_info( uint32_t caps ); - -/** - * @brief Check integrity of all heap memory in the system. - * - * Calls multi_heap_check on all heaps. Optionally print errors if heaps are corrupt. - * - * Calling this function is equivalent to calling heap_caps_check_integrity - * with the caps argument set to MALLOC_CAP_INVALID. - * - * @param print_errors Print specific errors if heap corruption is found. - * - * @return True if all heaps are valid, False if at least one heap is corrupt. - */ -bool heap_caps_check_integrity_all(bool print_errors); - -/** - * @brief Check integrity of all heaps with the given capabilities. - * - * Calls multi_heap_check on all heaps which share the given capabilities. Optionally - * print errors if the heaps are corrupt. - * - * See also heap_caps_check_integrity_all to check all heap memory - * in the system and heap_caps_check_integrity_addr to check memory - * around a single address. - * - * @param caps Bitwise OR of MALLOC_CAP_* flags indicating the type - * of memory - * @param print_errors Print specific errors if heap corruption is found. - * - * @return True if all heaps are valid, False if at least one heap is corrupt. - */ -bool heap_caps_check_integrity(uint32_t caps, bool print_errors); - -/** - * @brief Check integrity of heap memory around a given address. - * - * This function can be used to check the integrity of a single region of heap memory, - * which contains the given address. - * - * This can be useful if debugging heap integrity for corruption at a known address, - * as it has a lower overhead than checking all heap regions. Note that if the corrupt - * address moves around between runs (due to timing or other factors) then this approach - * won't work and you should call heap_caps_check_integrity or - * heap_caps_check_integrity_all instead. - * - * @note The entire heap region around the address is checked, not only the adjacent - * heap blocks. - * - * @param addr Address in memory. Check for corruption in region containing this address. - * @param print_errors Print specific errors if heap corruption is found. - * - * @return True if the heap containing the specified address is valid, - * False if at least one heap is corrupt or the address doesn't belong to a heap region. - */ -bool heap_caps_check_integrity_addr(intptr_t addr, bool print_errors); - -/** - * @brief Enable malloc() in external memory and set limit below which - * malloc() attempts are placed in internal memory. - * - * When external memory is in use, the allocation strategy is to initially try to - * satisfy smaller allocation requests with internal memory and larger requests - * with external memory. This sets the limit between the two, as well as generally - * enabling allocation in external memory. - * - * @param limit Limit, in bytes. - */ -void heap_caps_malloc_extmem_enable(size_t limit); - -/** - * @brief Allocate a chunk of memory as preference in decreasing order. - * - * @attention The variable parameters are bitwise OR of MALLOC_CAP_* flags indicating the type of memory. - * This API prefers to allocate memory with the first parameter. If failed, allocate memory with - * the next parameter. It will try in this order until allocating a chunk of memory successfully - * or fail to allocate memories with any of the parameters. - * - * @param size Size, in bytes, of the amount of memory to allocate - * @param num Number of variable paramters - * - * @return A pointer to the memory allocated on success, NULL on failure - */ -void *heap_caps_malloc_prefer( size_t size, size_t num, ... ); - -/** - * @brief Allocate a chunk of memory as preference in decreasing order. - * - * @param ptr Pointer to previously allocated memory, or NULL for a new allocation. - * @param size Size of the new buffer requested, or 0 to free the buffer. - * @param num Number of variable paramters - * - * @return Pointer to a new buffer of size 'size', or NULL if allocation failed. - */ -void *heap_caps_realloc_prefer( void *ptr, size_t size, size_t num, ... ); - -/** - * @brief Allocate a chunk of memory as preference in decreasing order. - * - * @param n Number of continuing chunks of memory to allocate - * @param size Size, in bytes, of a chunk of memory to allocate - * @param num Number of variable paramters - * - * @return A pointer to the memory allocated on success, NULL on failure - */ -void *heap_caps_calloc_prefer( size_t n, size_t size, size_t num, ... ); - -/** - * @brief Dump the full structure of all heaps with matching capabilities. - * - * Prints a large amount of output to serial (because of locking limitations, - * the output bypasses stdout/stderr). For each (variable sized) block - * in each matching heap, the following output is printed on a single line: - * - * - Block address (the data buffer returned by malloc is 4 bytes after this - * if heap debugging is set to Basic, or 8 bytes otherwise). - * - Data size (the data size may be larger than the size requested by malloc, - * either due to heap fragmentation or because of heap debugging level). - * - Address of next block in the heap. - * - If the block is free, the address of the next free block is also printed. - * - * @param caps Bitwise OR of MALLOC_CAP_* flags indicating the type - * of memory - */ -void heap_caps_dump(uint32_t caps); - -/** - * @brief Dump the full structure of all heaps. - * - * Covers all registered heaps. Prints a large amount of output to serial. - * - * Output is the same as for heap_caps_dump. - * - */ -void heap_caps_dump_all(); - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/heap/esp_heap_caps_init.h b/tools/sdk/include/heap/esp_heap_caps_init.h deleted file mode 100644 index 3ae6b8e4fc4..00000000000 --- a/tools/sdk/include/heap/esp_heap_caps_init.h +++ /dev/null @@ -1,92 +0,0 @@ -// 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. -#pragma once - -#include "esp_err.h" -#include "esp_heap_caps.h" -#include "soc/soc_memory_layout.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Initialize the capability-aware heap allocator. - * - * This is called once in the IDF startup code. Do not call it - * at other times. - */ -void heap_caps_init(); - -/** - * @brief Enable heap(s) in memory regions where the startup stacks are located. - * - * On startup, the pro/app CPUs have a certain memory region they use as stack, so we - * cannot do allocations in the regions these stack frames are. When FreeRTOS is - * completely started, they do not use that memory anymore and heap(s) there can - * be enabled. - */ -void heap_caps_enable_nonos_stack_heaps(); - -/** - * @brief Add a region of memory to the collection of heaps at runtime. - * - * Most memory regions are defined in soc_memory_layout.c for the SoC, - * and are registered via heap_caps_init(). Some regions can't be used - * immediately and are later enabled via heap_caps_enable_nonos_stack_heaps(). - * - * Call this function to add a region of memory to the heap at some later time. - * - * This function does not consider any of the "reserved" regions or other data in soc_memory_layout, caller needs to - * consider this themselves. - * - * All memory within the region specified by start & end parameters must be otherwise unused. - * - * The capabilities of the newly registered memory will be determined by the start address, as looked up in the regions - * specified in soc_memory_layout.c. - * - * Use heap_caps_add_region_with_caps() to register a region with custom capabilities. - * - * @param start Start address of new region. - * @param end End address of new region. - * - * @return ESP_OK on success, ESP_ERR_INVALID_ARG if a parameter is invalid, ESP_ERR_NOT_FOUND if the - * specified start address doesn't reside in a known region, or any error returned by heap_caps_add_region_with_caps(). - */ -esp_err_t heap_caps_add_region(intptr_t start, intptr_t end); - - -/** - * @brief Add a region of memory to the collection of heaps at runtime, with custom capabilities. - * - * Similar to heap_caps_add_region(), only custom memory capabilities are specified by the caller. - * - * @param caps Ordered array of capability masks for the new region, in order of priority. Must have length - * SOC_MEMORY_TYPE_NO_PRIOS. Does not need to remain valid after the call returns. - * @param start Start address of new region. - * @param end End address of new region. - * - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_ARG if a parameter is invalid - * - ESP_ERR_NO_MEM if no memory to register new heap. - * - ESP_ERR_INVALID_SIZE if the memory region is too small to fit a heap - * - ESP_FAIL if region overlaps the start and/or end of an existing region - */ -esp_err_t heap_caps_add_region_with_caps(const uint32_t caps[], intptr_t start, intptr_t end); - - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/heap/esp_heap_task_info.h b/tools/sdk/include/heap/esp_heap_task_info.h deleted file mode 100644 index fca9a43ba66..00000000000 --- a/tools/sdk/include/heap/esp_heap_task_info.h +++ /dev/null @@ -1,98 +0,0 @@ -// 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. -#pragma once - -#ifdef CONFIG_HEAP_TASK_TRACKING - -#ifdef __cplusplus -extern "C" { -#endif - -// This macro controls how much space is provided for partitioning the per-task -// heap allocation info according to one or more sets of heap capabilities. -#define NUM_HEAP_TASK_CAPS 4 - -/** @brief Structure to collect per-task heap allocation totals partitioned by selected caps */ -typedef struct { - TaskHandle_t task; ///< Task to which these totals belong - size_t size[NUM_HEAP_TASK_CAPS]; ///< Total allocations partitioned by selected caps - size_t count[NUM_HEAP_TASK_CAPS]; ///< Number of blocks partitioned by selected caps -} heap_task_totals_t; - -/** @brief Structure providing details about a block allocated by a task */ -typedef struct { - TaskHandle_t task; ///< Task that allocated the block - void *address; ///< User address of allocated block - uint32_t size; ///< Size of the allocated block -} heap_task_block_t; - -/** @brief Structure to provide parameters to heap_caps_get_per_task_info - * - * The 'caps' and 'mask' arrays allow partitioning the per-task heap allocation - * totals by selected sets of heap region capabilities so that totals for - * multiple regions can be accumulated in one scan. The capabilities flags for - * each region ANDed with mask[i] are compared to caps[i] in order; the - * allocations in that region are added to totals->size[i] and totals->count[i] - * for the first i that matches. To collect the totals without any - * partitioning, set mask[0] and caps[0] both to zero. The allocation totals - * are returned in the 'totals' array of heap_task_totals_t structs. To allow - * easily comparing the totals array between consecutive calls, that array can - * be left populated from one call to the next so the order of tasks is the - * same even if some tasks have freed their blocks or have been deleted. The - * number of blocks prepopulated is given by num_totals, which is updated upon - * return. If there are more tasks with allocations than the capacity of the - * totals array (given by max_totals), information for the excess tasks will be - * not be collected. The totals array pointer can be NULL if the totals are - * not desired. - * - * The 'tasks' array holds a list of handles for tasks whose block details are - * to be returned in the 'blocks' array of heap_task_block_t structs. If the - * tasks array pointer is NULL, block details for all tasks will be returned up - * to the capacity of the buffer array, given by max_blocks. The function - * return value tells the number of blocks filled into the array. The blocks - * array pointer can be NULL if block details are not desired, or max_blocks - * can be set to zero. - */ -typedef struct { - int32_t caps[NUM_HEAP_TASK_CAPS]; ///< Array of caps for partitioning task totals - int32_t mask[NUM_HEAP_TASK_CAPS]; ///< Array of masks under which caps must match - TaskHandle_t *tasks; ///< Array of tasks whose block info is returned - size_t num_tasks; ///< Length of tasks array - heap_task_totals_t *totals; ///< Array of structs to collect task totals - size_t *num_totals; ///< Number of task structs currently in array - size_t max_totals; ///< Capacity of array of task totals structs - heap_task_block_t *blocks; ///< Array of task block details structs - size_t max_blocks; ///< Capacity of array of task block info structs -} heap_task_info_params_t; - -/** - * @brief Return per-task heap allocation totals and lists of blocks. - * - * For each task that has allocated memory from the heap, return totals for - * allocations within regions matching one or more sets of capabilities. - * - * Optionally also return an array of structs providing details about each - * block allocated by one or more requested tasks, or by all tasks. - * - * @param params Structure to hold all the parameters for the function - * (@see heap_task_info_params_t). - * @return Number of block detail structs returned (@see heap_task_block_t). - */ -extern size_t heap_caps_get_per_task_info(heap_task_info_params_t *params); - -#ifdef __cplusplus -} -#endif - -#endif // CONFIG_HEAP_TASK_TRACKING diff --git a/tools/sdk/include/heap/esp_heap_trace.h b/tools/sdk/include/heap/esp_heap_trace.h deleted file mode 100644 index 5573d5e5abb..00000000000 --- a/tools/sdk/include/heap/esp_heap_trace.h +++ /dev/null @@ -1,144 +0,0 @@ -// 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. -#pragma once - -#include "sdkconfig.h" -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(CONFIG_HEAP_TRACING) && !defined(HEAP_TRACE_SRCFILE) -#warning "esp_heap_trace.h is included but heap tracing is disabled in menuconfig, functions are no-ops" -#endif - -#ifndef CONFIG_HEAP_TRACING_STACK_DEPTH -#define CONFIG_HEAP_TRACING_STACK_DEPTH 0 -#endif - -typedef enum { - HEAP_TRACE_ALL, - HEAP_TRACE_LEAKS, -} heap_trace_mode_t; - -/** - * @brief Trace record data type. Stores information about an allocated region of memory. - */ -typedef struct { - uint32_t ccount; ///< CCOUNT of the CPU when the allocation was made. LSB (bit value 1) is the CPU number (0 or 1). - void *address; ///< Address which was allocated - size_t size; ///< Size of the allocation - void *alloced_by[CONFIG_HEAP_TRACING_STACK_DEPTH]; ///< Call stack of the caller which allocated the memory. - void *freed_by[CONFIG_HEAP_TRACING_STACK_DEPTH]; ///< Call stack of the caller which freed the memory (all zero if not freed.) -} heap_trace_record_t; - -/** - * @brief Initialise heap tracing in standalone mode. - * @note Standalone mode is the only mode currently supported. - * - * This function must be called before any other heap tracing functions. - * - * To disable heap tracing and allow the buffer to be freed, stop tracing and then call heap_trace_init_standalone(NULL, 0); - * - * @param record_buffer Provide a buffer to use for heap trace data. Must remain valid any time heap tracing is enabled, meaning - * it must be allocated from internal memory not in PSRAM. - * @param num_records Size of the heap trace buffer, as number of record structures. - * @return - * - ESP_ERR_NOT_SUPPORTED Project was compiled without heap tracing enabled in menuconfig. - * - ESP_ERR_INVALID_STATE Heap tracing is currently in progress. - * - ESP_OK Heap tracing initialised successfully. - */ -esp_err_t heap_trace_init_standalone(heap_trace_record_t *record_buffer, size_t num_records); - -/** - * @brief Start heap tracing. All heap allocations & frees will be traced, until heap_trace_stop() is called. - * - * @note heap_trace_init_standalone() must be called to provide a valid buffer, before this function is called. - * - * @note Calling this function while heap tracing is running will reset the heap trace state and continue tracing. - * - * @param mode Mode for tracing. - * - HEAP_TRACE_ALL means all heap allocations and frees are traced. - * - HEAP_TRACE_LEAKS means only suspected memory leaks are traced. (When memory is freed, the record is removed from the trace buffer.) - * @return - * - ESP_ERR_NOT_SUPPORTED Project was compiled without heap tracing enabled in menuconfig. - * - ESP_ERR_INVALID_STATE A non-zero-length buffer has not been set via heap_trace_init_standalone(). - * - ESP_OK Tracing is started. - */ -esp_err_t heap_trace_start(heap_trace_mode_t mode); - -/** - * @brief Stop heap tracing. - * - * @return - * - ESP_ERR_NOT_SUPPORTED Project was compiled without heap tracing enabled in menuconfig. - * - ESP_ERR_INVALID_STATE Heap tracing was not in progress. - * - ESP_OK Heap tracing stopped.. - */ -esp_err_t heap_trace_stop(void); - -/** - * @brief Resume heap tracing which was previously stopped. - * - * Unlike heap_trace_start(), this function does not clear the - * buffer of any pre-existing trace records. - * - * The heap trace mode is the same as when heap_trace_start() was - * last called (or HEAP_TRACE_ALL if heap_trace_start() was never called). - * - * @return - * - ESP_ERR_NOT_SUPPORTED Project was compiled without heap tracing enabled in menuconfig. - * - ESP_ERR_INVALID_STATE Heap tracing was already started. - * - ESP_OK Heap tracing resumed. - */ -esp_err_t heap_trace_resume(void); - -/** - * @brief Return number of records in the heap trace buffer - * - * It is safe to call this function while heap tracing is running. - */ -size_t heap_trace_get_count(void); - -/** - * @brief Return a raw record from the heap trace buffer - * - * @note It is safe to call this function while heap tracing is running, however in HEAP_TRACE_LEAK mode record indexing may - * skip entries unless heap tracing is stopped first. - * - * @param index Index (zero-based) of the record to return. - * @param[out] record Record where the heap trace record will be copied. - * @return - * - ESP_ERR_NOT_SUPPORTED Project was compiled without heap tracing enabled in menuconfig. - * - ESP_ERR_INVALID_STATE Heap tracing was not initialised. - * - ESP_ERR_INVALID_ARG Index is out of bounds for current heap trace record count. - * - ESP_OK Record returned successfully. - */ -esp_err_t heap_trace_get(size_t index, heap_trace_record_t *record); - -/** - * @brief Dump heap trace record data to stdout - * - * @note It is safe to call this function while heap tracing is running, however in HEAP_TRACE_LEAK mode the dump may skip - * entries unless heap tracing is stopped first. - * - * - */ -void heap_trace_dump(void); - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/heap/multi_heap.h b/tools/sdk/include/heap/multi_heap.h deleted file mode 100644 index dbd0cae8649..00000000000 --- a/tools/sdk/include/heap/multi_heap.h +++ /dev/null @@ -1,171 +0,0 @@ -// 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. -#pragma once -#include -#include -#include - -/* multi_heap is a heap implementation for handling multiple - heterogenous heaps in a single program. - - Any contiguous block of memory can be registered as a heap. -*/ - -#ifdef __cplusplus -extern "C" { -#endif - -/** @brief Opaque handle to a registered heap */ -typedef struct multi_heap_info *multi_heap_handle_t; - -/** @brief malloc() a buffer in a given heap - * - * Semantics are the same as standard malloc(), only the returned buffer will be allocated in the specified heap. - * - * @param heap Handle to a registered heap. - * @param size Size of desired buffer. - * - * @return Pointer to new memory, or NULL if allocation fails. - */ -void *multi_heap_malloc(multi_heap_handle_t heap, size_t size); - -/** @brief free() a buffer in a given heap. - * - * Semantics are the same as standard free(), only the argument 'p' must be NULL or have been allocated in the specified heap. - * - * @param heap Handle to a registered heap. - * @param p NULL, or a pointer previously returned from multi_heap_malloc() or multi_heap_realloc() for the same heap. - */ -void multi_heap_free(multi_heap_handle_t heap, void *p); - -/** @brief realloc() a buffer in a given heap. - * - * Semantics are the same as standard realloc(), only the argument 'p' must be NULL or have been allocated in the specified heap. - * - * @param heap Handle to a registered heap. - * @param p NULL, or a pointer previously returned from multi_heap_malloc() or multi_heap_realloc() for the same heap. - * @param size Desired new size for buffer. - * - * @return New buffer of 'size' containing contents of 'p', or NULL if reallocation failed. - */ -void *multi_heap_realloc(multi_heap_handle_t heap, void *p, size_t size); - - -/** @brief Return the size that a particular pointer was allocated with. - * - * @param heap Handle to a registered heap. - * @param p Pointer, must have been previously returned from multi_heap_malloc() or multi_heap_realloc() for the same heap. - * - * @return Size of the memory allocated at this block. May be more than the original size argument, due - * to padding and minimum block sizes. - */ -size_t multi_heap_get_allocated_size(multi_heap_handle_t heap, void *p); - - -/** @brief Register a new heap for use - * - * This function initialises a heap at the specified address, and returns a handle for future heap operations. - * - * There is no equivalent function for deregistering a heap - if all blocks in the heap are free, you can immediately start using the memory for other purposes. - * - * @param start Start address of the memory to use for a new heap. - * @param size Size (in bytes) of the new heap. - * - * @return Handle of a new heap ready for use, or NULL if the heap region was too small to be initialised. - */ -multi_heap_handle_t multi_heap_register(void *start, size_t size); - - -/** @brief Associate a private lock pointer with a heap - * - * The lock argument is supplied to the MULTI_HEAP_LOCK() and MULTI_HEAP_UNLOCK() macros, defined in multi_heap_platform.h. - * - * The lock in question must be recursive. - * - * When the heap is first registered, the associated lock is NULL. - * - * @param heap Handle to a registered heap. - * @param lock Optional pointer to a locking structure to associate with this heap. - */ -void multi_heap_set_lock(multi_heap_handle_t heap, void* lock); - -/** @brief Dump heap information to stdout - * - * For debugging purposes, this function dumps information about every block in the heap to stdout. - * - * @param heap Handle to a registered heap. - */ -void multi_heap_dump(multi_heap_handle_t heap); - -/** @brief Check heap integrity - * - * Walks the heap and checks all heap data structures are valid. If any errors are detected, an error-specific message - * can be optionally printed to stderr. Print behaviour can be overriden at compile time by defining - * MULTI_CHECK_FAIL_PRINTF in multi_heap_platform.h. - * - * @param heap Handle to a registered heap. - * @param print_errors If true, errors will be printed to stderr. - * @return true if heap is valid, false otherwise. - */ -bool multi_heap_check(multi_heap_handle_t heap, bool print_errors); - -/** @brief Return free heap size - * - * Returns the number of bytes available in the heap. - * - * Equivalent to the total_free_bytes member returned by multi_heap_get_heap_info(). - * - * Note that the heap may be fragmented, so the actual maximum size for a single malloc() may be lower. To know this - * size, see the largest_free_block member returned by multi_heap_get_heap_info(). - * - * @param heap Handle to a registered heap. - * @return Number of free bytes. - */ -size_t multi_heap_free_size(multi_heap_handle_t heap); - -/** @brief Return the lifetime minimum free heap size - * - * Equivalent to the minimum_free_bytes member returned by multi_heap_get_info(). - * - * Returns the lifetime "low water mark" of possible values returned from multi_free_heap_size(), for the specified - * heap. - * - * @param heap Handle to a registered heap. - * @return Number of free bytes. - */ -size_t multi_heap_minimum_free_size(multi_heap_handle_t heap); - -/** @brief Structure to access heap metadata via multi_heap_get_info */ -typedef struct { - size_t total_free_bytes; ///< Total free bytes in the heap. Equivalent to multi_free_heap_size(). - size_t total_allocated_bytes; ///< Total bytes allocated to data in the heap. - size_t largest_free_block; ///< Size of largest free block in the heap. This is the largest malloc-able size. - size_t minimum_free_bytes; ///< Lifetime minimum free heap size. Equivalent to multi_minimum_free_heap_size(). - size_t allocated_blocks; ///< Number of (variable size) blocks allocated in the heap. - size_t free_blocks; ///< Number of (variable size) free blocks in the heap. - size_t total_blocks; ///< Total number of (variable size) blocks in the heap. -} multi_heap_info_t; - -/** @brief Return metadata about a given heap - * - * Fills a multi_heap_info_t structure with information about the specified heap. - * - * @param heap Handle to a registered heap. - * @param info Pointer to a structure to fill with heap metadata. - */ -void multi_heap_get_info(multi_heap_handle_t heap, multi_heap_info_t *info); - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/idf_test/idf_performance.h b/tools/sdk/include/idf_test/idf_performance.h deleted file mode 100644 index e864b293299..00000000000 --- a/tools/sdk/include/idf_test/idf_performance.h +++ /dev/null @@ -1,35 +0,0 @@ - -/* @brief macro to print IDF performance - * @param mode : performance item name. a string pointer. - * @param value_fmt: print format and unit of the value, for example: "%02fms", "%dKB" - * @param value : the performance value. -*/ -#define IDF_LOG_PERFORMANCE(item, value_fmt, value) \ - printf("[Performance][%s]: "value_fmt"\n", item, value) - - -/* declare the performance here */ -#define IDF_PERFORMANCE_MAX_HTTPS_REQUEST_BIN_SIZE 800 -#define IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP 200 -#define IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP_PSRAM 300 -#define IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP_UNICORE 130 -#define IDF_PERFORMANCE_MAX_ESP_TIMER_GET_TIME_PER_CALL 1000 -#define IDF_PERFORMANCE_MAX_SPI_PER_TRANS_NO_POLLING 30 -#define IDF_PERFORMANCE_MAX_SPI_PER_TRANS_NO_POLLING_NO_DMA 27 -#define IDF_PERFORMANCE_MAX_SPI_PER_TRANS_POLLING 15 -#define IDF_PERFORMANCE_MAX_SPI_PER_TRANS_POLLING_NO_DMA 15 -/* Due to code size & linker layout differences interacting with cache, VFS - microbenchmark currently runs slower with PSRAM enabled. */ -#define IDF_PERFORMANCE_MAX_VFS_OPEN_WRITE_CLOSE_TIME 50000 -#define IDF_PERFORMANCE_MAX_VFS_OPEN_WRITE_CLOSE_TIME_PSRAM 40000 -// throughput performance by iperf -#define IDF_PERFORMANCE_MIN_TCP_RX_THROUGHPUT 50 -#define IDF_PERFORMANCE_MIN_TCP_TX_THROUGHPUT 40 -#define IDF_PERFORMANCE_MIN_UDP_RX_THROUGHPUT 80 -#define IDF_PERFORMANCE_MIN_UDP_TX_THROUGHPUT 50 -// events dispatched per second by event loop library -#define IDF_PERFORMANCE_MIN_EVENT_DISPATCH 25000 -#define IDF_PERFORMANCE_MIN_EVENT_DISPATCH_PSRAM 21000 -// esp_sha() time to process 32KB of input data from RAM -#define IDF_PERFORMANCE_MAX_ESP32_TIME_SHA1_32KB 5000 -#define IDF_PERFORMANCE_MAX_ESP32_TIME_SHA512_32KB 4500 diff --git a/tools/sdk/include/jsmn/jsmn.h b/tools/sdk/include/jsmn/jsmn.h deleted file mode 100644 index 1df808e3946..00000000000 --- a/tools/sdk/include/jsmn/jsmn.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2010 Serge A. Zaitsev - * - * 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. - */ - -/** - * @file jsmn.h - * @brief Definition of the JSMN (Jasmine) JSON parser. - * - * For more information on JSMN: - * @see http://zserge.com/jsmn.html - */ - -#ifndef __JSMN_H_ -#define __JSMN_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * JSON type identifier. Basic types are: - * o Object - * o Array - * o String - * o Other primitive: number, boolean (true/false) or null - */ -typedef enum { - JSMN_UNDEFINED = 0, - JSMN_OBJECT = 1, - JSMN_ARRAY = 2, - JSMN_STRING = 3, - JSMN_PRIMITIVE = 4 -} jsmntype_t; - -enum jsmnerr { - /* Not enough tokens were provided */ - JSMN_ERROR_NOMEM = -1, - /* Invalid character inside JSON string */ - JSMN_ERROR_INVAL = -2, - /* The string is not a full JSON packet, more bytes expected */ - JSMN_ERROR_PART = -3 -}; - -/** - * JSON token description. - * @param type type (object, array, string etc.) - * @param start start position in JSON data string - * @param end end position in JSON data string - */ -typedef struct { - jsmntype_t type; - int start; - int end; - int size; -#ifdef JSMN_PARENT_LINKS - int parent; -#endif -} jsmntok_t; - -/** - * JSON parser. Contains an array of token blocks available. Also stores - * the string being parsed now and current position in that string - */ -typedef struct { - unsigned int pos; /* offset in the JSON string */ - unsigned int toknext; /* next token to allocate */ - int toksuper; /* superior token node, e.g parent object or array */ -} jsmn_parser; - -/** - * Create JSON parser over an array of tokens - */ -void jsmn_init(jsmn_parser *parser); - -/** - * Run JSON parser. It parses a JSON data string into and array of tokens, each describing - * a single JSON object. - */ -int jsmn_parse(jsmn_parser *parser, const char *js, size_t len, - jsmntok_t *tokens, unsigned int num_tokens); - -#ifdef __cplusplus -} -#endif - -#endif /* __JSMN_H_ */ diff --git a/tools/sdk/include/json/cJSON.h b/tools/sdk/include/json/cJSON.h deleted file mode 100644 index 592986b86e9..00000000000 --- a/tools/sdk/include/json/cJSON.h +++ /dev/null @@ -1,285 +0,0 @@ -/* - Copyright (c) 2009-2017 Dave Gamble and cJSON contributors - - 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. -*/ - -#ifndef cJSON__h -#define cJSON__h - -#ifdef __cplusplus -extern "C" -{ -#endif - -#if !defined(__WINDOWS__) && (defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32)) -#define __WINDOWS__ -#endif - -#ifdef __WINDOWS__ - -/* When compiling for windows, we specify a specific calling convention to avoid issues where we are being called from a project with a different default calling convention. For windows you have 3 define options: - -CJSON_HIDE_SYMBOLS - Define this in the case where you don't want to ever dllexport symbols -CJSON_EXPORT_SYMBOLS - Define this on library build when you want to dllexport symbols (default) -CJSON_IMPORT_SYMBOLS - Define this if you want to dllimport symbol - -For *nix builds that support visibility attribute, you can define similar behavior by - -setting default visibility to hidden by adding --fvisibility=hidden (for gcc) -or --xldscope=hidden (for sun cc) -to CFLAGS - -then using the CJSON_API_VISIBILITY flag to "export" the same symbols the way CJSON_EXPORT_SYMBOLS does - -*/ - -#define CJSON_CDECL __cdecl -#define CJSON_STDCALL __stdcall - -/* export symbols by default, this is necessary for copy pasting the C and header file */ -#if !defined(CJSON_HIDE_SYMBOLS) && !defined(CJSON_IMPORT_SYMBOLS) && !defined(CJSON_EXPORT_SYMBOLS) -#define CJSON_EXPORT_SYMBOLS -#endif - -#if defined(CJSON_HIDE_SYMBOLS) -#define CJSON_PUBLIC(type) type CJSON_STDCALL -#elif defined(CJSON_EXPORT_SYMBOLS) -#define CJSON_PUBLIC(type) __declspec(dllexport) type CJSON_STDCALL -#elif defined(CJSON_IMPORT_SYMBOLS) -#define CJSON_PUBLIC(type) __declspec(dllimport) type CJSON_STDCALL -#endif -#else /* !__WINDOWS__ */ -#define CJSON_CDECL -#define CJSON_STDCALL - -#if (defined(__GNUC__) || defined(__SUNPRO_CC) || defined (__SUNPRO_C)) && defined(CJSON_API_VISIBILITY) -#define CJSON_PUBLIC(type) __attribute__((visibility("default"))) type -#else -#define CJSON_PUBLIC(type) type -#endif -#endif - -/* project version */ -#define CJSON_VERSION_MAJOR 1 -#define CJSON_VERSION_MINOR 7 -#define CJSON_VERSION_PATCH 12 - -#include - -/* cJSON Types: */ -#define cJSON_Invalid (0) -#define cJSON_False (1 << 0) -#define cJSON_True (1 << 1) -#define cJSON_NULL (1 << 2) -#define cJSON_Number (1 << 3) -#define cJSON_String (1 << 4) -#define cJSON_Array (1 << 5) -#define cJSON_Object (1 << 6) -#define cJSON_Raw (1 << 7) /* raw json */ - -#define cJSON_IsReference 256 -#define cJSON_StringIsConst 512 - -/* The cJSON structure: */ -typedef struct cJSON -{ - /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */ - struct cJSON *next; - struct cJSON *prev; - /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */ - struct cJSON *child; - - /* The type of the item, as above. */ - int type; - - /* The item's string, if type==cJSON_String and type == cJSON_Raw */ - char *valuestring; - /* writing to valueint is DEPRECATED, use cJSON_SetNumberValue instead */ - int valueint; - /* The item's number, if type==cJSON_Number */ - double valuedouble; - - /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */ - char *string; -} cJSON; - -typedef struct cJSON_Hooks -{ - /* malloc/free are CDECL on Windows regardless of the default calling convention of the compiler, so ensure the hooks allow passing those functions directly. */ - void *(CJSON_CDECL *malloc_fn)(size_t sz); - void (CJSON_CDECL *free_fn)(void *ptr); -} cJSON_Hooks; - -typedef int cJSON_bool; - -/* Limits how deeply nested arrays/objects can be before cJSON rejects to parse them. - * This is to prevent stack overflows. */ -#ifndef CJSON_NESTING_LIMIT -#define CJSON_NESTING_LIMIT 1000 -#endif - -/* returns the version of cJSON as a string */ -CJSON_PUBLIC(const char*) cJSON_Version(void); - -/* Supply malloc, realloc and free functions to cJSON */ -CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks); - -/* Memory Management: the caller is always responsible to free the results from all variants of cJSON_Parse (with cJSON_Delete) and cJSON_Print (with stdlib free, cJSON_Hooks.free_fn, or cJSON_free as appropriate). The exception is cJSON_PrintPreallocated, where the caller has full responsibility of the buffer. */ -/* Supply a block of JSON, and this returns a cJSON object you can interrogate. */ -CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value); -/* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */ -/* If you supply a ptr in return_parse_end and parsing fails, then return_parse_end will contain a pointer to the error so will match cJSON_GetErrorPtr(). */ -CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated); - -/* Render a cJSON entity to text for transfer/storage. */ -CJSON_PUBLIC(char *) cJSON_Print(const cJSON *item); -/* Render a cJSON entity to text for transfer/storage without any formatting. */ -CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON *item); -/* Render a cJSON entity to text using a buffered strategy. prebuffer is a guess at the final size. guessing well reduces reallocation. fmt=0 gives unformatted, =1 gives formatted */ -CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt); -/* Render a cJSON entity to text using a buffer already allocated in memory with given length. Returns 1 on success and 0 on failure. */ -/* NOTE: cJSON is not always 100% accurate in estimating how much memory it will use, so to be safe allocate 5 bytes more than you actually need */ -CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format); -/* Delete a cJSON entity and all subentities. */ -CJSON_PUBLIC(void) cJSON_Delete(cJSON *c); - -/* Returns the number of items in an array (or object). */ -CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array); -/* Retrieve item number "index" from array "array". Returns NULL if unsuccessful. */ -CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index); -/* Get item "string" from object. Case insensitive. */ -CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string); -CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON * const object, const char * const string); -CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *string); -/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */ -CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void); - -/* Check if the item is a string and return its valuestring */ -CJSON_PUBLIC(char *) cJSON_GetStringValue(cJSON *item); - -/* These functions check the type of an item */ -CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item); -CJSON_PUBLIC(cJSON_bool) cJSON_IsFalse(const cJSON * const item); -CJSON_PUBLIC(cJSON_bool) cJSON_IsTrue(const cJSON * const item); -CJSON_PUBLIC(cJSON_bool) cJSON_IsBool(const cJSON * const item); -CJSON_PUBLIC(cJSON_bool) cJSON_IsNull(const cJSON * const item); -CJSON_PUBLIC(cJSON_bool) cJSON_IsNumber(const cJSON * const item); -CJSON_PUBLIC(cJSON_bool) cJSON_IsString(const cJSON * const item); -CJSON_PUBLIC(cJSON_bool) cJSON_IsArray(const cJSON * const item); -CJSON_PUBLIC(cJSON_bool) cJSON_IsObject(const cJSON * const item); -CJSON_PUBLIC(cJSON_bool) cJSON_IsRaw(const cJSON * const item); - -/* These calls create a cJSON item of the appropriate type. */ -CJSON_PUBLIC(cJSON *) cJSON_CreateNull(void); -CJSON_PUBLIC(cJSON *) cJSON_CreateTrue(void); -CJSON_PUBLIC(cJSON *) cJSON_CreateFalse(void); -CJSON_PUBLIC(cJSON *) cJSON_CreateBool(cJSON_bool boolean); -CJSON_PUBLIC(cJSON *) cJSON_CreateNumber(double num); -CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string); -/* raw json */ -CJSON_PUBLIC(cJSON *) cJSON_CreateRaw(const char *raw); -CJSON_PUBLIC(cJSON *) cJSON_CreateArray(void); -CJSON_PUBLIC(cJSON *) cJSON_CreateObject(void); - -/* Create a string where valuestring references a string so - * it will not be freed by cJSON_Delete */ -CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string); -/* Create an object/arrray that only references it's elements so - * they will not be freed by cJSON_Delete */ -CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON *child); -CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON *child); - -/* These utilities create an Array of count items. */ -CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count); -CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count); -CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count); -CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char **strings, int count); - -/* Append item to the specified array/object. */ -CJSON_PUBLIC(void) cJSON_AddItemToArray(cJSON *array, cJSON *item); -CJSON_PUBLIC(void) cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item); -/* Use this when string is definitely const (i.e. a literal, or as good as), and will definitely survive the cJSON object. - * WARNING: When this function was used, make sure to always check that (item->type & cJSON_StringIsConst) is zero before - * writing to `item->string` */ -CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item); -/* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */ -CJSON_PUBLIC(void) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item); -CJSON_PUBLIC(void) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item); - -/* Remove/Detatch items from Arrays/Objects. */ -CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item); -CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which); -CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which); -CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string); -CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string); -CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string); -CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON *object, const char *string); - -/* Update array items. */ -CJSON_PUBLIC(void) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem); /* Shifts pre-existing items to the right. */ -CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement); -CJSON_PUBLIC(void) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem); -CJSON_PUBLIC(void) cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem); -CJSON_PUBLIC(void) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object,const char *string,cJSON *newitem); - -/* Duplicate a cJSON item */ -CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool recurse); -/* Duplicate will create a new, identical cJSON item to the one you pass, in new memory that will -need to be released. With recurse!=0, it will duplicate any children connected to the item. -The item->next and ->prev pointers are always zero on return from Duplicate. */ -/* Recursively compare two cJSON items for equality. If either a or b is NULL or invalid, they will be considered unequal. - * case_sensitive determines if object keys are treated case sensitive (1) or case insensitive (0) */ -CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * const b, const cJSON_bool case_sensitive); - - -CJSON_PUBLIC(void) cJSON_Minify(char *json); - -/* Helper functions for creating and adding items to an object at the same time. - * They return the added item or NULL on failure. */ -CJSON_PUBLIC(cJSON*) cJSON_AddNullToObject(cJSON * const object, const char * const name); -CJSON_PUBLIC(cJSON*) cJSON_AddTrueToObject(cJSON * const object, const char * const name); -CJSON_PUBLIC(cJSON*) cJSON_AddFalseToObject(cJSON * const object, const char * const name); -CJSON_PUBLIC(cJSON*) cJSON_AddBoolToObject(cJSON * const object, const char * const name, const cJSON_bool boolean); -CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number); -CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string); -CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw); -CJSON_PUBLIC(cJSON*) cJSON_AddObjectToObject(cJSON * const object, const char * const name); -CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * const name); - -/* When assigning an integer value, it needs to be propagated to valuedouble too. */ -#define cJSON_SetIntValue(object, number) ((object) ? (object)->valueint = (object)->valuedouble = (number) : (number)) -/* helper for the cJSON_SetNumberValue macro */ -CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number); -#define cJSON_SetNumberValue(object, number) ((object != NULL) ? cJSON_SetNumberHelper(object, (double)number) : (number)) - -/* Macro for iterating over an array or object */ -#define cJSON_ArrayForEach(element, array) for(element = (array != NULL) ? (array)->child : NULL; element != NULL; element = element->next) - -/* malloc/free objects using the malloc/free functions that have been set with cJSON_InitHooks */ -CJSON_PUBLIC(void *) cJSON_malloc(size_t size); -CJSON_PUBLIC(void) cJSON_free(void *object); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/json/cJSON_Utils.h b/tools/sdk/include/json/cJSON_Utils.h deleted file mode 100644 index a970c650467..00000000000 --- a/tools/sdk/include/json/cJSON_Utils.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - Copyright (c) 2009-2017 Dave Gamble and cJSON contributors - - 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. -*/ - -#ifndef cJSON_Utils__h -#define cJSON_Utils__h - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include "cJSON.h" - -/* Implement RFC6901 (https://tools.ietf.org/html/rfc6901) JSON Pointer spec. */ -CJSON_PUBLIC(cJSON *) cJSONUtils_GetPointer(cJSON * const object, const char *pointer); -CJSON_PUBLIC(cJSON *) cJSONUtils_GetPointerCaseSensitive(cJSON * const object, const char *pointer); - -/* Implement RFC6902 (https://tools.ietf.org/html/rfc6902) JSON Patch spec. */ -/* NOTE: This modifies objects in 'from' and 'to' by sorting the elements by their key */ -CJSON_PUBLIC(cJSON *) cJSONUtils_GeneratePatches(cJSON * const from, cJSON * const to); -CJSON_PUBLIC(cJSON *) cJSONUtils_GeneratePatchesCaseSensitive(cJSON * const from, cJSON * const to); -/* Utility for generating patch array entries. */ -CJSON_PUBLIC(void) cJSONUtils_AddPatchToArray(cJSON * const array, const char * const operation, const char * const path, const cJSON * const value); -/* Returns 0 for success. */ -CJSON_PUBLIC(int) cJSONUtils_ApplyPatches(cJSON * const object, const cJSON * const patches); -CJSON_PUBLIC(int) cJSONUtils_ApplyPatchesCaseSensitive(cJSON * const object, const cJSON * const patches); - -/* -// Note that ApplyPatches is NOT atomic on failure. To implement an atomic ApplyPatches, use: -//int cJSONUtils_AtomicApplyPatches(cJSON **object, cJSON *patches) -//{ -// cJSON *modme = cJSON_Duplicate(*object, 1); -// int error = cJSONUtils_ApplyPatches(modme, patches); -// if (!error) -// { -// cJSON_Delete(*object); -// *object = modme; -// } -// else -// { -// cJSON_Delete(modme); -// } -// -// return error; -//} -// Code not added to library since this strategy is a LOT slower. -*/ - -/* Implement RFC7386 (https://tools.ietf.org/html/rfc7396) JSON Merge Patch spec. */ -/* target will be modified by patch. return value is new ptr for target. */ -CJSON_PUBLIC(cJSON *) cJSONUtils_MergePatch(cJSON *target, const cJSON * const patch); -CJSON_PUBLIC(cJSON *) cJSONUtils_MergePatchCaseSensitive(cJSON *target, const cJSON * const patch); -/* generates a patch to move from -> to */ -/* NOTE: This modifies objects in 'from' and 'to' by sorting the elements by their key */ -CJSON_PUBLIC(cJSON *) cJSONUtils_GenerateMergePatch(cJSON * const from, cJSON * const to); -CJSON_PUBLIC(cJSON *) cJSONUtils_GenerateMergePatchCaseSensitive(cJSON * const from, cJSON * const to); - -/* Given a root object and a target object, construct a pointer from one to the other. */ -CJSON_PUBLIC(char *) cJSONUtils_FindPointerFromObjectTo(const cJSON * const object, const cJSON * const target); - -/* Sorts the members of the object into alphabetical order. */ -CJSON_PUBLIC(void) cJSONUtils_SortObject(cJSON * const object); -CJSON_PUBLIC(void) cJSONUtils_SortObjectCaseSensitive(cJSON * const object); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/json/tests/common.h b/tools/sdk/include/json/tests/common.h deleted file mode 100644 index 4db6bf8c2d1..00000000000 --- a/tools/sdk/include/json/tests/common.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - Copyright (c) 2009-2017 Dave Gamble and cJSON contributors - - 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. -*/ - -#ifndef CJSON_TESTS_COMMON_H -#define CJSON_TESTS_COMMON_H - -#include "../cJSON.c" - -void reset(cJSON *item); -void reset(cJSON *item) { - if ((item != NULL) && (item->child != NULL)) - { - cJSON_Delete(item->child); - } - if ((item->valuestring != NULL) && !(item->type & cJSON_IsReference)) - { - global_hooks.deallocate(item->valuestring); - } - if ((item->string != NULL) && !(item->type & cJSON_StringIsConst)) - { - global_hooks.deallocate(item->string); - } - - memset(item, 0, sizeof(cJSON)); -} - -char* read_file(const char *filename); -char* read_file(const char *filename) { - FILE *file = NULL; - long length = 0; - char *content = NULL; - size_t read_chars = 0; - - /* open in read binary mode */ - file = fopen(filename, "rb"); - if (file == NULL) - { - goto cleanup; - } - - /* get the length */ - if (fseek(file, 0, SEEK_END) != 0) - { - goto cleanup; - } - length = ftell(file); - if (length < 0) - { - goto cleanup; - } - if (fseek(file, 0, SEEK_SET) != 0) - { - goto cleanup; - } - - /* allocate content buffer */ - content = (char*)malloc((size_t)length + sizeof("")); - if (content == NULL) - { - goto cleanup; - } - - /* read the file into memory */ - read_chars = fread(content, sizeof(char), (size_t)length, file); - if ((long)read_chars != length) - { - free(content); - content = NULL; - goto cleanup; - } - content[read_chars] = '\0'; - - -cleanup: - if (file != NULL) - { - fclose(file); - } - - return content; -} - -/* assertion helper macros */ -#define assert_has_type(item, item_type) TEST_ASSERT_BITS_MESSAGE(0xFF, item_type, item->type, "Item doesn't have expected type.") -#define assert_has_no_reference(item) TEST_ASSERT_BITS_MESSAGE(cJSON_IsReference, 0, item->type, "Item should not have a string as reference.") -#define assert_has_no_const_string(item) TEST_ASSERT_BITS_MESSAGE(cJSON_StringIsConst, 0, item->type, "Item should not have a const string.") -#define assert_has_valuestring(item) TEST_ASSERT_NOT_NULL_MESSAGE(item->valuestring, "Valuestring is NULL.") -#define assert_has_no_valuestring(item) TEST_ASSERT_NULL_MESSAGE(item->valuestring, "Valuestring is not NULL.") -#define assert_has_string(item) TEST_ASSERT_NOT_NULL_MESSAGE(item->string, "String is NULL") -#define assert_has_no_string(item) TEST_ASSERT_NULL_MESSAGE(item->string, "String is not NULL.") -#define assert_not_in_list(item) \ - TEST_ASSERT_NULL_MESSAGE(item->next, "Linked list next pointer is not NULL.");\ - TEST_ASSERT_NULL_MESSAGE(item->prev, "Linked list previous pointer is not NULL.") -#define assert_has_child(item) TEST_ASSERT_NOT_NULL_MESSAGE(item->child, "Item doesn't have a child.") -#define assert_has_no_child(item) TEST_ASSERT_NULL_MESSAGE(item->child, "Item has a child.") -#define assert_is_invalid(item) \ - assert_has_type(item, cJSON_Invalid);\ - assert_not_in_list(item);\ - assert_has_no_child(item);\ - assert_has_no_string(item);\ - assert_has_no_valuestring(item) - -#endif diff --git a/tools/sdk/include/json/tests/unity/examples/example_1/src/ProductionCode.h b/tools/sdk/include/json/tests/unity/examples/example_1/src/ProductionCode.h deleted file mode 100644 index 250ca0dc6fe..00000000000 --- a/tools/sdk/include/json/tests/unity/examples/example_1/src/ProductionCode.h +++ /dev/null @@ -1,3 +0,0 @@ - -int FindFunction_WhichIsBroken(int NumberToFind); -int FunctionWhichReturnsLocalVariable(void); diff --git a/tools/sdk/include/json/tests/unity/examples/example_1/src/ProductionCode2.h b/tools/sdk/include/json/tests/unity/examples/example_1/src/ProductionCode2.h deleted file mode 100644 index 34ae980d182..00000000000 --- a/tools/sdk/include/json/tests/unity/examples/example_1/src/ProductionCode2.h +++ /dev/null @@ -1,2 +0,0 @@ - -char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction); diff --git a/tools/sdk/include/json/tests/unity/examples/example_2/src/ProductionCode.h b/tools/sdk/include/json/tests/unity/examples/example_2/src/ProductionCode.h deleted file mode 100644 index 250ca0dc6fe..00000000000 --- a/tools/sdk/include/json/tests/unity/examples/example_2/src/ProductionCode.h +++ /dev/null @@ -1,3 +0,0 @@ - -int FindFunction_WhichIsBroken(int NumberToFind); -int FunctionWhichReturnsLocalVariable(void); diff --git a/tools/sdk/include/json/tests/unity/examples/example_2/src/ProductionCode2.h b/tools/sdk/include/json/tests/unity/examples/example_2/src/ProductionCode2.h deleted file mode 100644 index 34ae980d182..00000000000 --- a/tools/sdk/include/json/tests/unity/examples/example_2/src/ProductionCode2.h +++ /dev/null @@ -1,2 +0,0 @@ - -char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction); diff --git a/tools/sdk/include/json/tests/unity/examples/example_3/helper/UnityHelper.h b/tools/sdk/include/json/tests/unity/examples/example_3/helper/UnityHelper.h deleted file mode 100644 index 151611158a9..00000000000 --- a/tools/sdk/include/json/tests/unity/examples/example_3/helper/UnityHelper.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef _TESTHELPER_H -#define _TESTHELPER_H - -#include "Types.h" - -void AssertEqualExampleStruct(const EXAMPLE_STRUCT_T expected, const EXAMPLE_STRUCT_T actual, const unsigned short line); - -#define UNITY_TEST_ASSERT_EQUAL_EXAMPLE_STRUCT_T(expected, actual, line, message) AssertEqualExampleStruct(expected, actual, line); - -#define TEST_ASSERT_EQUAL_EXAMPLE_STRUCT_T(expected, actual) UNITY_TEST_ASSERT_EQUAL_EXAMPLE_STRUCT_T(expected, actual, __LINE__, NULL); - -#endif // _TESTHELPER_H diff --git a/tools/sdk/include/json/tests/unity/examples/example_3/src/ProductionCode.h b/tools/sdk/include/json/tests/unity/examples/example_3/src/ProductionCode.h deleted file mode 100644 index 250ca0dc6fe..00000000000 --- a/tools/sdk/include/json/tests/unity/examples/example_3/src/ProductionCode.h +++ /dev/null @@ -1,3 +0,0 @@ - -int FindFunction_WhichIsBroken(int NumberToFind); -int FunctionWhichReturnsLocalVariable(void); diff --git a/tools/sdk/include/json/tests/unity/examples/example_3/src/ProductionCode2.h b/tools/sdk/include/json/tests/unity/examples/example_3/src/ProductionCode2.h deleted file mode 100644 index 34ae980d182..00000000000 --- a/tools/sdk/include/json/tests/unity/examples/example_3/src/ProductionCode2.h +++ /dev/null @@ -1,2 +0,0 @@ - -char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction); diff --git a/tools/sdk/include/json/tests/unity/examples/unity_config.h b/tools/sdk/include/json/tests/unity/examples/unity_config.h deleted file mode 100644 index a2f161a7a72..00000000000 --- a/tools/sdk/include/json/tests/unity/examples/unity_config.h +++ /dev/null @@ -1,239 +0,0 @@ -/* Unity Configuration - * As of May 11th, 2016 at ThrowTheSwitch/Unity commit 837c529 - * Update: December 29th, 2016 - * See Also: Unity/docs/UnityConfigurationGuide.pdf - * - * Unity is designed to run on almost anything that is targeted by a C compiler. - * It would be awesome if this could be done with zero configuration. While - * there are some targets that come close to this dream, it is sadly not - * universal. It is likely that you are going to need at least a couple of the - * configuration options described in this document. - * - * All of Unity's configuration options are `#defines`. Most of these are simple - * definitions. A couple are macros with arguments. They live inside the - * unity_internals.h header file. We don't necessarily recommend opening that - * file unless you really need to. That file is proof that a cross-platform - * library is challenging to build. From a more positive perspective, it is also - * proof that a great deal of complexity can be centralized primarily to one - * place in order to provide a more consistent and simple experience elsewhere. - * - * Using These Options - * It doesn't matter if you're using a target-specific compiler and a simulator - * or a native compiler. In either case, you've got a couple choices for - * configuring these options: - * - * 1. Because these options are specified via C defines, you can pass most of - * these options to your compiler through command line compiler flags. Even - * if you're using an embedded target that forces you to use their - * overbearing IDE for all configuration, there will be a place somewhere in - * your project to configure defines for your compiler. - * 2. You can create a custom `unity_config.h` configuration file (present in - * your toolchain's search paths). In this file, you will list definitions - * and macros specific to your target. All you must do is define - * `UNITY_INCLUDE_CONFIG_H` and Unity will rely on `unity_config.h` for any - * further definitions it may need. - */ - -#ifndef UNITY_CONFIG_H -#define UNITY_CONFIG_H - -/* ************************* AUTOMATIC INTEGER TYPES *************************** - * C's concept of an integer varies from target to target. The C Standard has - * rules about the `int` matching the register size of the target - * microprocessor. It has rules about the `int` and how its size relates to - * other integer types. An `int` on one target might be 16 bits while on another - * target it might be 64. There are more specific types in compilers compliant - * with C99 or later, but that's certainly not every compiler you are likely to - * encounter. Therefore, Unity has a number of features for helping to adjust - * itself to match your required integer sizes. It starts off by trying to do it - * automatically. - **************************************************************************** */ - -/* The first attempt to guess your types is to check `limits.h`. Some compilers - * that don't support `stdint.h` could include `limits.h`. If you don't - * want Unity to check this file, define this to make it skip the inclusion. - * Unity looks at UINT_MAX & ULONG_MAX, which were available since C89. - */ -/* #define UNITY_EXCLUDE_LIMITS_H */ - -/* The second thing that Unity does to guess your types is check `stdint.h`. - * This file defines `UINTPTR_MAX`, since C99, that Unity can make use of to - * learn about your system. It's possible you don't want it to do this or it's - * possible that your system doesn't support `stdint.h`. If that's the case, - * you're going to want to define this. That way, Unity will know to skip the - * inclusion of this file and you won't be left with a compiler error. - */ -/* #define UNITY_EXCLUDE_STDINT_H */ - -/* ********************** MANUAL INTEGER TYPE DEFINITION *********************** - * If you've disabled all of the automatic options above, you're going to have - * to do the configuration yourself. There are just a handful of defines that - * you are going to specify if you don't like the defaults. - **************************************************************************** */ - - /* Define this to be the number of bits an `int` takes up on your system. The - * default, if not auto-detected, is 32 bits. - * - * Example: - */ -/* #define UNITY_INT_WIDTH 16 */ - -/* Define this to be the number of bits a `long` takes up on your system. The - * default, if not autodetected, is 32 bits. This is used to figure out what - * kind of 64-bit support your system can handle. Does it need to specify a - * `long` or a `long long` to get a 64-bit value. On 16-bit systems, this option - * is going to be ignored. - * - * Example: - */ -/* #define UNITY_LONG_WIDTH 16 */ - -/* Define this to be the number of bits a pointer takes up on your system. The - * default, if not autodetected, is 32-bits. If you're getting ugly compiler - * warnings about casting from pointers, this is the one to look at. - * - * Example: - */ -/* #define UNITY_POINTER_WIDTH 64 */ - -/* Unity will automatically include 64-bit support if it auto-detects it, or if - * your `int`, `long`, or pointer widths are greater than 32-bits. Define this - * to enable 64-bit support if none of the other options already did it for you. - * There can be a significant size and speed impact to enabling 64-bit support - * on small targets, so don't define it if you don't need it. - */ -/* #define UNITY_INCLUDE_64 */ - - -/* *************************** FLOATING POINT TYPES **************************** - * In the embedded world, it's not uncommon for targets to have no support for - * floating point operations at all or to have support that is limited to only - * single precision. We are able to guess integer sizes on the fly because - * integers are always available in at least one size. Floating point, on the - * other hand, is sometimes not available at all. Trying to include `float.h` on - * these platforms would result in an error. This leaves manual configuration as - * the only option. - **************************************************************************** */ - - /* By default, Unity guesses that you will want single precision floating point - * support, but not double precision. It's easy to change either of these using - * the include and exclude options here. You may include neither, just float, - * or both, as suits your needs. - */ -/* #define UNITY_EXCLUDE_FLOAT */ -#define UNITY_INCLUDE_DOUBLE -/* #define UNITY_EXCLUDE_DOUBLE */ - -/* For features that are enabled, the following floating point options also - * become available. - */ - -/* Unity aims for as small of a footprint as possible and avoids most standard - * library calls (some embedded platforms don't have a standard library!). - * Because of this, its routines for printing integer values are minimalist and - * hand-coded. To keep Unity universal, though, we eventually chose to develop - * our own floating point print routines. Still, the display of floating point - * values during a failure are optional. By default, Unity will print the - * actual results of floating point assertion failures. So a failed assertion - * will produce a message like "Expected 4.0 Was 4.25". If you would like less - * verbose failure messages for floating point assertions, use this option to - * give a failure message `"Values Not Within Delta"` and trim the binary size. - */ -/* #define UNITY_EXCLUDE_FLOAT_PRINT */ - -/* If enabled, Unity assumes you want your `FLOAT` asserts to compare standard C - * floats. If your compiler supports a specialty floating point type, you can - * always override this behavior by using this definition. - * - * Example: - */ -/* #define UNITY_FLOAT_TYPE float16_t */ - -/* If enabled, Unity assumes you want your `DOUBLE` asserts to compare standard - * C doubles. If you would like to change this, you can specify something else - * by using this option. For example, defining `UNITY_DOUBLE_TYPE` to `long - * double` could enable gargantuan floating point types on your 64-bit processor - * instead of the standard `double`. - * - * Example: - */ -/* #define UNITY_DOUBLE_TYPE long double */ - -/* If you look up `UNITY_ASSERT_EQUAL_FLOAT` and `UNITY_ASSERT_EQUAL_DOUBLE` as - * documented in the Unity Assertion Guide, you will learn that they are not - * really asserting that two values are equal but rather that two values are - * "close enough" to equal. "Close enough" is controlled by these precision - * configuration options. If you are working with 32-bit floats and/or 64-bit - * doubles (the normal on most processors), you should have no need to change - * these options. They are both set to give you approximately 1 significant bit - * in either direction. The float precision is 0.00001 while the double is - * 10^-12. For further details on how this works, see the appendix of the Unity - * Assertion Guide. - * - * Example: - */ -/* #define UNITY_FLOAT_PRECISION 0.001f */ -/* #define UNITY_DOUBLE_PRECISION 0.001f */ - - -/* *************************** TOOLSET CUSTOMIZATION *************************** - * In addition to the options listed above, there are a number of other options - * which will come in handy to customize Unity's behavior for your specific - * toolchain. It is possible that you may not need to touch any of these but - * certain platforms, particularly those running in simulators, may need to jump - * through extra hoops to operate properly. These macros will help in those - * situations. - **************************************************************************** */ - -/* By default, Unity prints its results to `stdout` as it runs. This works - * perfectly fine in most situations where you are using a native compiler for - * testing. It works on some simulators as well so long as they have `stdout` - * routed back to the command line. There are times, however, where the - * simulator will lack support for dumping results or you will want to route - * results elsewhere for other reasons. In these cases, you should define the - * `UNITY_OUTPUT_CHAR` macro. This macro accepts a single character at a time - * (as an `int`, since this is the parameter type of the standard C `putchar` - * function most commonly used). You may replace this with whatever function - * call you like. - * - * Example: - * Say you are forced to run your test suite on an embedded processor with no - * `stdout` option. You decide to route your test result output to a custom - * serial `RS232_putc()` function you wrote like thus: - */ -/* #define UNITY_OUTPUT_CHAR(a) RS232_putc(a) */ -/* #define UNITY_OUTPUT_CHAR_HEADER_DECLARATION RS232_putc(int) */ -/* #define UNITY_OUTPUT_FLUSH() RS232_flush() */ -/* #define UNITY_OUTPUT_FLUSH_HEADER_DECLARATION RS232_flush(void) */ -/* #define UNITY_OUTPUT_START() RS232_config(115200,1,8,0) */ -/* #define UNITY_OUTPUT_COMPLETE() RS232_close() */ - -/* For some targets, Unity can make the otherwise required `setUp()` and - * `tearDown()` functions optional. This is a nice convenience for test writers - * since `setUp` and `tearDown` don't often actually _do_ anything. If you're - * using gcc or clang, this option is automatically defined for you. Other - * compilers can also support this behavior, if they support a C feature called - * weak functions. A weak function is a function that is compiled into your - * executable _unless_ a non-weak version of the same function is defined - * elsewhere. If a non-weak version is found, the weak version is ignored as if - * it never existed. If your compiler supports this feature, you can let Unity - * know by defining `UNITY_SUPPORT_WEAK` as the function attributes that would - * need to be applied to identify a function as weak. If your compiler lacks - * support for weak functions, you will always need to define `setUp` and - * `tearDown` functions (though they can be and often will be just empty). The - * most common options for this feature are: - */ -/* #define UNITY_SUPPORT_WEAK weak */ -/* #define UNITY_SUPPORT_WEAK __attribute__((weak)) */ -/* #define UNITY_NO_WEAK */ - -/* Some compilers require a custom attribute to be assigned to pointers, like - * `near` or `far`. In these cases, you can give Unity a safe default for these - * by defining this option with the attribute you would like. - * - * Example: - */ -/* #define UNITY_PTR_ATTRIBUTE __attribute__((far)) */ -/* #define UNITY_PTR_ATTRIBUTE near */ - -#endif /* UNITY_CONFIG_H */ diff --git a/tools/sdk/include/json/tests/unity/extras/fixture/src/unity_fixture.h b/tools/sdk/include/json/tests/unity/extras/fixture/src/unity_fixture.h deleted file mode 100644 index 6f8d6234b37..00000000000 --- a/tools/sdk/include/json/tests/unity/extras/fixture/src/unity_fixture.h +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright (c) 2010 James Grenning and Contributed to Unity Project - * ========================================== - * Unity Project - A Test Framework for C - * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - * [Released under MIT License. Please refer to license.txt for details] - * ========================================== */ - -#ifndef UNITY_FIXTURE_H_ -#define UNITY_FIXTURE_H_ - -#include "unity.h" -#include "unity_internals.h" -#include "unity_fixture_malloc_overrides.h" -#include "unity_fixture_internals.h" - -int UnityMain(int argc, const char* argv[], void (*runAllTests)(void)); - - -#define TEST_GROUP(group)\ - static const char* TEST_GROUP_##group = #group - -#define TEST_SETUP(group) void TEST_##group##_SETUP(void);\ - void TEST_##group##_SETUP(void) - -#define TEST_TEAR_DOWN(group) void TEST_##group##_TEAR_DOWN(void);\ - void TEST_##group##_TEAR_DOWN(void) - - -#define TEST(group, name) \ - void TEST_##group##_##name##_(void);\ - void TEST_##group##_##name##_run(void);\ - void TEST_##group##_##name##_run(void)\ - {\ - UnityTestRunner(TEST_##group##_SETUP,\ - TEST_##group##_##name##_,\ - TEST_##group##_TEAR_DOWN,\ - "TEST(" #group ", " #name ")",\ - TEST_GROUP_##group, #name,\ - __FILE__, __LINE__);\ - }\ - void TEST_##group##_##name##_(void) - -#define IGNORE_TEST(group, name) \ - void TEST_##group##_##name##_(void);\ - void TEST_##group##_##name##_run(void);\ - void TEST_##group##_##name##_run(void)\ - {\ - UnityIgnoreTest("IGNORE_TEST(" #group ", " #name ")", TEST_GROUP_##group, #name);\ - }\ - void TEST_##group##_##name##_(void) - -/* Call this for each test, insider the group runner */ -#define RUN_TEST_CASE(group, name) \ - { void TEST_##group##_##name##_run(void);\ - TEST_##group##_##name##_run(); } - -/* This goes at the bottom of each test file or in a separate c file */ -#define TEST_GROUP_RUNNER(group)\ - void TEST_##group##_GROUP_RUNNER(void);\ - void TEST_##group##_GROUP_RUNNER(void) - -/* Call this from main */ -#define RUN_TEST_GROUP(group)\ - { void TEST_##group##_GROUP_RUNNER(void);\ - TEST_##group##_GROUP_RUNNER(); } - -/* CppUTest Compatibility Macros */ -#ifndef UNITY_EXCLUDE_CPPUTEST_ASSERTS -/* Sets a pointer and automatically restores it to its old value after teardown */ -#define UT_PTR_SET(ptr, newPointerValue) UnityPointer_Set((void**)&(ptr), (void*)(newPointerValue), __LINE__) -#define TEST_ASSERT_POINTERS_EQUAL(expected, actual) TEST_ASSERT_EQUAL_PTR((expected), (actual)) -#define TEST_ASSERT_BYTES_EQUAL(expected, actual) TEST_ASSERT_EQUAL_HEX8(0xff & (expected), 0xff & (actual)) -#define FAIL(message) TEST_FAIL_MESSAGE((message)) -#define CHECK(condition) TEST_ASSERT_TRUE((condition)) -#define LONGS_EQUAL(expected, actual) TEST_ASSERT_EQUAL_INT((expected), (actual)) -#define STRCMP_EQUAL(expected, actual) TEST_ASSERT_EQUAL_STRING((expected), (actual)) -#define DOUBLES_EQUAL(expected, actual, delta) TEST_ASSERT_DOUBLE_WITHIN((delta), (expected), (actual)) -#endif - -/* You must compile with malloc replacement, as defined in unity_fixture_malloc_overrides.h */ -void UnityMalloc_MakeMallocFailAfterCount(int count); - -#endif /* UNITY_FIXTURE_H_ */ diff --git a/tools/sdk/include/json/tests/unity/extras/fixture/src/unity_fixture_internals.h b/tools/sdk/include/json/tests/unity/extras/fixture/src/unity_fixture_internals.h deleted file mode 100644 index aa0d9e7c0b9..00000000000 --- a/tools/sdk/include/json/tests/unity/extras/fixture/src/unity_fixture_internals.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright (c) 2010 James Grenning and Contributed to Unity Project - * ========================================== - * Unity Project - A Test Framework for C - * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - * [Released under MIT License. Please refer to license.txt for details] - * ========================================== */ - -#ifndef UNITY_FIXTURE_INTERNALS_H_ -#define UNITY_FIXTURE_INTERNALS_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -struct UNITY_FIXTURE_T -{ - int Verbose; - unsigned int RepeatCount; - const char* NameFilter; - const char* GroupFilter; -}; -extern struct UNITY_FIXTURE_T UnityFixture; - -typedef void unityfunction(void); -void UnityTestRunner(unityfunction* setup, - unityfunction* body, - unityfunction* teardown, - const char* printableName, - const char* group, - const char* name, - const char* file, unsigned int line); - -void UnityIgnoreTest(const char* printableName, const char* group, const char* name); -void UnityMalloc_StartTest(void); -void UnityMalloc_EndTest(void); -int UnityGetCommandLineOptions(int argc, const char* argv[]); -void UnityConcludeFixtureTest(void); - -void UnityPointer_Set(void** ptr, void* newValue, UNITY_LINE_TYPE line); -void UnityPointer_UndoAllSets(void); -void UnityPointer_Init(void); -#ifndef UNITY_MAX_POINTERS -#define UNITY_MAX_POINTERS 5 -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* UNITY_FIXTURE_INTERNALS_H_ */ diff --git a/tools/sdk/include/json/tests/unity/extras/fixture/src/unity_fixture_malloc_overrides.h b/tools/sdk/include/json/tests/unity/extras/fixture/src/unity_fixture_malloc_overrides.h deleted file mode 100644 index 7daba50aae5..00000000000 --- a/tools/sdk/include/json/tests/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright (c) 2010 James Grenning and Contributed to Unity Project - * ========================================== - * Unity Project - A Test Framework for C - * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - * [Released under MIT License. Please refer to license.txt for details] - * ========================================== */ - -#ifndef UNITY_FIXTURE_MALLOC_OVERRIDES_H_ -#define UNITY_FIXTURE_MALLOC_OVERRIDES_H_ - -#include - -#ifdef UNITY_EXCLUDE_STDLIB_MALLOC -/* Define this macro to remove the use of stdlib.h, malloc, and free. - * Many embedded systems do not have a heap or malloc/free by default. - * This internal unity_malloc() provides allocated memory deterministically from - * the end of an array only, unity_free() only releases from end-of-array, - * blocks are not coalesced, and memory not freed in LIFO order is stranded. */ - #ifndef UNITY_INTERNAL_HEAP_SIZE_BYTES - #define UNITY_INTERNAL_HEAP_SIZE_BYTES 256 - #endif -#endif - -/* These functions are used by the Unity Fixture to allocate and release memory - * on the heap and can be overridden with platform-specific implementations. - * For example, when using FreeRTOS UNITY_FIXTURE_MALLOC becomes pvPortMalloc() - * and UNITY_FIXTURE_FREE becomes vPortFree(). */ -#if !defined(UNITY_FIXTURE_MALLOC) || !defined(UNITY_FIXTURE_FREE) - #include - #define UNITY_FIXTURE_MALLOC(size) malloc(size) - #define UNITY_FIXTURE_FREE(ptr) free(ptr) -#else - extern void* UNITY_FIXTURE_MALLOC(size_t size); - extern void UNITY_FIXTURE_FREE(void* ptr); -#endif - -#define malloc unity_malloc -#define calloc unity_calloc -#define realloc unity_realloc -#define free unity_free - -void* unity_malloc(size_t size); -void* unity_calloc(size_t num, size_t size); -void* unity_realloc(void * oldMem, size_t size); -void unity_free(void * mem); - -#endif /* UNITY_FIXTURE_MALLOC_OVERRIDES_H_ */ diff --git a/tools/sdk/include/json/tests/unity/extras/fixture/test/unity_output_Spy.h b/tools/sdk/include/json/tests/unity/extras/fixture/test/unity_output_Spy.h deleted file mode 100644 index b30a7f13bbe..00000000000 --- a/tools/sdk/include/json/tests/unity/extras/fixture/test/unity_output_Spy.h +++ /dev/null @@ -1,17 +0,0 @@ -/* Copyright (c) 2010 James Grenning and Contributed to Unity Project - * ========================================== - * Unity Project - A Test Framework for C - * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - * [Released under MIT License. Please refer to license.txt for details] - * ========================================== */ - -#ifndef D_unity_output_Spy_H -#define D_unity_output_Spy_H - -void UnityOutputCharSpy_Create(int s); -void UnityOutputCharSpy_Destroy(void); -void UnityOutputCharSpy_OutputChar(int c); -const char * UnityOutputCharSpy_Get(void); -void UnityOutputCharSpy_Enable(int enable); - -#endif diff --git a/tools/sdk/include/json/tests/unity/src/unity.h b/tools/sdk/include/json/tests/unity/src/unity.h deleted file mode 100644 index 32ff0e6df46..00000000000 --- a/tools/sdk/include/json/tests/unity/src/unity.h +++ /dev/null @@ -1,503 +0,0 @@ -/* ========================================== - Unity Project - A Test Framework for C - Copyright (c) 2007-14 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ - -#ifndef UNITY_FRAMEWORK_H -#define UNITY_FRAMEWORK_H -#define UNITY - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include "unity_internals.h" - -/*------------------------------------------------------- - * Test Setup / Teardown - *-------------------------------------------------------*/ - -/* These functions are intended to be called before and after each test. */ -void setUp(void); -void tearDown(void); - -/* These functions are intended to be called at the beginning and end of an - * entire test suite. suiteTearDown() is passed the number of tests that - * failed, and its return value becomes the exit code of main(). */ -void suiteSetUp(void); -int suiteTearDown(int num_failures); - -/* If the compiler supports it, the following block provides stub - * implementations of the above functions as weak symbols. Note that on - * some platforms (MinGW for example), weak function implementations need - * to be in the same translation unit they are called from. This can be - * achieved by defining UNITY_INCLUDE_SETUP_STUBS before including unity.h. */ -#ifdef UNITY_INCLUDE_SETUP_STUBS - #ifdef UNITY_WEAK_ATTRIBUTE - UNITY_WEAK_ATTRIBUTE void setUp(void) { } - UNITY_WEAK_ATTRIBUTE void tearDown(void) { } - UNITY_WEAK_ATTRIBUTE void suiteSetUp(void) { } - UNITY_WEAK_ATTRIBUTE int suiteTearDown(int num_failures) { return num_failures; } - #elif defined(UNITY_WEAK_PRAGMA) - #pragma weak setUp - void setUp(void) { } - #pragma weak tearDown - void tearDown(void) { } - #pragma weak suiteSetUp - void suiteSetUp(void) { } - #pragma weak suiteTearDown - int suiteTearDown(int num_failures) { return num_failures; } - #endif -#endif - -/*------------------------------------------------------- - * Configuration Options - *------------------------------------------------------- - * All options described below should be passed as a compiler flag to all files using Unity. If you must add #defines, place them BEFORE the #include above. - - * Integers/longs/pointers - * - Unity attempts to automatically discover your integer sizes - * - define UNITY_EXCLUDE_STDINT_H to stop attempting to look in - * - define UNITY_EXCLUDE_LIMITS_H to stop attempting to look in - * - If you cannot use the automatic methods above, you can force Unity by using these options: - * - define UNITY_SUPPORT_64 - * - set UNITY_INT_WIDTH - * - set UNITY_LONG_WIDTH - * - set UNITY_POINTER_WIDTH - - * Floats - * - define UNITY_EXCLUDE_FLOAT to disallow floating point comparisons - * - define UNITY_FLOAT_PRECISION to specify the precision to use when doing TEST_ASSERT_EQUAL_FLOAT - * - define UNITY_FLOAT_TYPE to specify doubles instead of single precision floats - * - define UNITY_INCLUDE_DOUBLE to allow double floating point comparisons - * - define UNITY_EXCLUDE_DOUBLE to disallow double floating point comparisons (default) - * - define UNITY_DOUBLE_PRECISION to specify the precision to use when doing TEST_ASSERT_EQUAL_DOUBLE - * - define UNITY_DOUBLE_TYPE to specify something other than double - * - define UNITY_EXCLUDE_FLOAT_PRINT to trim binary size, won't print floating point values in errors - - * Output - * - by default, Unity prints to standard out with putchar. define UNITY_OUTPUT_CHAR(a) with a different function if desired - * - define UNITY_DIFFERENTIATE_FINAL_FAIL to print FAILED (vs. FAIL) at test end summary - for automated search for failure - - * Optimization - * - by default, line numbers are stored in unsigned shorts. Define UNITY_LINE_TYPE with a different type if your files are huge - * - by default, test and failure counters are unsigned shorts. Define UNITY_COUNTER_TYPE with a different type if you want to save space or have more than 65535 Tests. - - * Test Cases - * - define UNITY_SUPPORT_TEST_CASES to include the TEST_CASE macro, though really it's mostly about the runner generator script - - * Parameterized Tests - * - you'll want to create a define of TEST_CASE(...) which basically evaluates to nothing - - * Tests with Arguments - * - you'll want to define UNITY_USE_COMMAND_LINE_ARGS if you have the test runner passing arguments to Unity - - *------------------------------------------------------- - * Basic Fail and Ignore - *-------------------------------------------------------*/ - -#define TEST_FAIL_MESSAGE(message) UNITY_TEST_FAIL(__LINE__, (message)) -#define TEST_FAIL() UNITY_TEST_FAIL(__LINE__, NULL) -#define TEST_IGNORE_MESSAGE(message) UNITY_TEST_IGNORE(__LINE__, (message)) -#define TEST_IGNORE() UNITY_TEST_IGNORE(__LINE__, NULL) -#define TEST_ONLY() - -/* It is not necessary for you to call PASS. A PASS condition is assumed if nothing fails. - * This method allows you to abort a test immediately with a PASS state, ignoring the remainder of the test. */ -#define TEST_PASS() TEST_ABORT() - -/* This macro does nothing, but it is useful for build tools (like Ceedling) to make use of this to figure out - * which files should be linked to in order to perform a test. Use it like TEST_FILE("sandwiches.c") */ -#define TEST_FILE(a) - -/*------------------------------------------------------- - * Test Asserts (simple) - *-------------------------------------------------------*/ - -/* Boolean */ -#define TEST_ASSERT(condition) UNITY_TEST_ASSERT( (condition), __LINE__, " Expression Evaluated To FALSE") -#define TEST_ASSERT_TRUE(condition) UNITY_TEST_ASSERT( (condition), __LINE__, " Expected TRUE Was FALSE") -#define TEST_ASSERT_UNLESS(condition) UNITY_TEST_ASSERT( !(condition), __LINE__, " Expression Evaluated To TRUE") -#define TEST_ASSERT_FALSE(condition) UNITY_TEST_ASSERT( !(condition), __LINE__, " Expected FALSE Was TRUE") -#define TEST_ASSERT_NULL(pointer) UNITY_TEST_ASSERT_NULL( (pointer), __LINE__, " Expected NULL") -#define TEST_ASSERT_NOT_NULL(pointer) UNITY_TEST_ASSERT_NOT_NULL((pointer), __LINE__, " Expected Non-NULL") - -/* Integers (of all sizes) */ -#define TEST_ASSERT_EQUAL_INT(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT((expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_INT8(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT8((expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_INT16(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT16((expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_INT32(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT32((expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_INT64(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT64((expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_EQUAL(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT((expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_NOT_EQUAL(expected, actual) UNITY_TEST_ASSERT(((expected) != (actual)), __LINE__, " Expected Not-Equal") -#define TEST_ASSERT_EQUAL_UINT(expected, actual) UNITY_TEST_ASSERT_EQUAL_UINT( (expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_UINT8(expected, actual) UNITY_TEST_ASSERT_EQUAL_UINT8( (expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_UINT16(expected, actual) UNITY_TEST_ASSERT_EQUAL_UINT16( (expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_UINT32(expected, actual) UNITY_TEST_ASSERT_EQUAL_UINT32( (expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_UINT64(expected, actual) UNITY_TEST_ASSERT_EQUAL_UINT64( (expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_HEX(expected, actual) UNITY_TEST_ASSERT_EQUAL_HEX32((expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_HEX8(expected, actual) UNITY_TEST_ASSERT_EQUAL_HEX8( (expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_HEX16(expected, actual) UNITY_TEST_ASSERT_EQUAL_HEX16((expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_HEX32(expected, actual) UNITY_TEST_ASSERT_EQUAL_HEX32((expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_HEX64(expected, actual) UNITY_TEST_ASSERT_EQUAL_HEX64((expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_BITS(mask, expected, actual) UNITY_TEST_ASSERT_BITS((mask), (expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_BITS_HIGH(mask, actual) UNITY_TEST_ASSERT_BITS((mask), (UNITY_UINT32)(-1), (actual), __LINE__, NULL) -#define TEST_ASSERT_BITS_LOW(mask, actual) UNITY_TEST_ASSERT_BITS((mask), (UNITY_UINT32)(0), (actual), __LINE__, NULL) -#define TEST_ASSERT_BIT_HIGH(bit, actual) UNITY_TEST_ASSERT_BITS(((UNITY_UINT32)1 << (bit)), (UNITY_UINT32)(-1), (actual), __LINE__, NULL) -#define TEST_ASSERT_BIT_LOW(bit, actual) UNITY_TEST_ASSERT_BITS(((UNITY_UINT32)1 << (bit)), (UNITY_UINT32)(0), (actual), __LINE__, NULL) - -/* Integer Greater Than/ Less Than (of all sizes) */ -#define TEST_ASSERT_GREATER_THAN(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_INT((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_THAN_INT(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_INT((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_THAN_INT8(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_INT8((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_THAN_INT16(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_INT16((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_THAN_INT32(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_INT32((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_THAN_INT64(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_INT64((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_THAN_UINT(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_UINT((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_THAN_UINT8(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_UINT8((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_THAN_UINT16(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_UINT16((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_THAN_UINT32(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_UINT32((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_THAN_UINT64(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_UINT64((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_THAN_HEX8(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_HEX8((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_THAN_HEX16(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_HEX16((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_THAN_HEX32(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_HEX32((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_THAN_HEX64(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_HEX64((threshold), (actual), __LINE__, NULL) - -#define TEST_ASSERT_LESS_THAN(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_THAN_INT(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_THAN_INT8(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT8((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_THAN_INT16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT16((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_THAN_INT32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT32((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_THAN_INT64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT64((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_THAN_UINT(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_UINT((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_THAN_UINT8(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_UINT8((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_THAN_UINT16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_UINT16((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_THAN_UINT32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_UINT32((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_THAN_UINT64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_UINT64((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_THAN_HEX8(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_HEX8((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_THAN_HEX16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_HEX16((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_THAN_HEX32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_HEX32((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_THAN_HEX64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_HEX64((threshold), (actual), __LINE__, NULL) - -#define TEST_ASSERT_GREATER_OR_EQUAL(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_OR_EQUAL_INT(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_OR_EQUAL_INT8(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT8((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_OR_EQUAL_INT16(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT16((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_OR_EQUAL_INT32(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT32((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_OR_EQUAL_INT64(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT64((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_OR_EQUAL_UINT(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_OR_EQUAL_UINT8(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT8((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_OR_EQUAL_UINT16(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT16((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_OR_EQUAL_UINT32(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT32((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_OR_EQUAL_UINT64(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT64((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_OR_EQUAL_HEX8(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX8((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_OR_EQUAL_HEX16(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX16((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_OR_EQUAL_HEX32(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX32((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_GREATER_OR_EQUAL_HEX64(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX64((threshold), (actual), __LINE__, NULL) - -#define TEST_ASSERT_LESS_OR_EQUAL(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_OR_EQUAL_INT(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_OR_EQUAL_INT8(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT8((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_OR_EQUAL_INT16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT16((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_OR_EQUAL_INT32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT32((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_OR_EQUAL_INT64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT64((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_OR_EQUAL_UINT(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_OR_EQUAL_UINT8(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT8((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_OR_EQUAL_UINT16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT16((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_OR_EQUAL_UINT32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT32((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_OR_EQUAL_UINT64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT64((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_OR_EQUAL_HEX8(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX8((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_OR_EQUAL_HEX16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX16((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_OR_EQUAL_HEX32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX32((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_LESS_OR_EQUAL_HEX64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX64((threshold), (actual), __LINE__, NULL) - -/* Integer Ranges (of all sizes) */ -#define TEST_ASSERT_INT_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_INT_WITHIN((delta), (expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_INT8_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_INT8_WITHIN((delta), (expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_INT16_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_INT16_WITHIN((delta), (expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_INT32_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_INT32_WITHIN((delta), (expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_INT64_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_INT64_WITHIN((delta), (expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_UINT_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_UINT_WITHIN((delta), (expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_UINT8_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_UINT8_WITHIN((delta), (expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_UINT16_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_UINT16_WITHIN((delta), (expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_UINT32_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_UINT32_WITHIN((delta), (expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_UINT64_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_UINT64_WITHIN((delta), (expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_HEX_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_HEX32_WITHIN((delta), (expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_HEX8_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_HEX8_WITHIN((delta), (expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_HEX16_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_HEX16_WITHIN((delta), (expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_HEX32_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_HEX32_WITHIN((delta), (expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_HEX64_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_HEX64_WITHIN((delta), (expected), (actual), __LINE__, NULL) - -/* Structs and Strings */ -#define TEST_ASSERT_EQUAL_PTR(expected, actual) UNITY_TEST_ASSERT_EQUAL_PTR((expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_STRING(expected, actual) UNITY_TEST_ASSERT_EQUAL_STRING((expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_STRING_LEN(expected, actual, len) UNITY_TEST_ASSERT_EQUAL_STRING_LEN((expected), (actual), (len), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_MEMORY(expected, actual, len) UNITY_TEST_ASSERT_EQUAL_MEMORY((expected), (actual), (len), __LINE__, NULL) - -/* Arrays */ -#define TEST_ASSERT_EQUAL_INT_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_INT_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_INT8_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_INT8_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_INT16_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_INT16_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_INT32_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_INT32_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_INT64_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_INT64_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_UINT_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_UINT_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_UINT8_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_UINT8_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_UINT16_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_UINT32_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_UINT32_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_UINT64_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_HEX_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_HEX8_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_HEX16_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_HEX16_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_HEX32_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_HEX64_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_PTR_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_PTR_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_STRING_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_MEMORY_ARRAY(expected, actual, len, num_elements) UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((expected), (actual), (len), (num_elements), __LINE__, NULL) - -/* Arrays Compared To Single Value */ -#define TEST_ASSERT_EACH_EQUAL_INT(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_INT((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EACH_EQUAL_INT8(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_INT8((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EACH_EQUAL_INT16(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_INT16((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EACH_EQUAL_INT32(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_INT32((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EACH_EQUAL_INT64(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_INT64((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EACH_EQUAL_UINT(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_UINT((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EACH_EQUAL_UINT8(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_UINT8((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EACH_EQUAL_UINT16(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_UINT16((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EACH_EQUAL_UINT32(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_UINT32((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EACH_EQUAL_UINT64(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_UINT64((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EACH_EQUAL_HEX(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_HEX32((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EACH_EQUAL_HEX8(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_HEX8((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EACH_EQUAL_HEX16(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_HEX16((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EACH_EQUAL_HEX32(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_HEX32((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EACH_EQUAL_HEX64(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_HEX64((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EACH_EQUAL_PTR(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_PTR((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EACH_EQUAL_STRING(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_STRING((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EACH_EQUAL_MEMORY(expected, actual, len, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_MEMORY((expected), (actual), (len), (num_elements), __LINE__, NULL) - -/* Floating Point (If Enabled) */ -#define TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_FLOAT_WITHIN((delta), (expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_FLOAT(expected, actual) UNITY_TEST_ASSERT_EQUAL_FLOAT((expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_FLOAT_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_FLOAT_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EACH_EQUAL_FLOAT(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_FLOAT((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_FLOAT_IS_INF(actual) UNITY_TEST_ASSERT_FLOAT_IS_INF((actual), __LINE__, NULL) -#define TEST_ASSERT_FLOAT_IS_NEG_INF(actual) UNITY_TEST_ASSERT_FLOAT_IS_NEG_INF((actual), __LINE__, NULL) -#define TEST_ASSERT_FLOAT_IS_NAN(actual) UNITY_TEST_ASSERT_FLOAT_IS_NAN((actual), __LINE__, NULL) -#define TEST_ASSERT_FLOAT_IS_DETERMINATE(actual) UNITY_TEST_ASSERT_FLOAT_IS_DETERMINATE((actual), __LINE__, NULL) -#define TEST_ASSERT_FLOAT_IS_NOT_INF(actual) UNITY_TEST_ASSERT_FLOAT_IS_NOT_INF((actual), __LINE__, NULL) -#define TEST_ASSERT_FLOAT_IS_NOT_NEG_INF(actual) UNITY_TEST_ASSERT_FLOAT_IS_NOT_NEG_INF((actual), __LINE__, NULL) -#define TEST_ASSERT_FLOAT_IS_NOT_NAN(actual) UNITY_TEST_ASSERT_FLOAT_IS_NOT_NAN((actual), __LINE__, NULL) -#define TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(actual) UNITY_TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE((actual), __LINE__, NULL) - -/* Double (If Enabled) */ -#define TEST_ASSERT_DOUBLE_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_DOUBLE_WITHIN((delta), (expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_DOUBLE(expected, actual) UNITY_TEST_ASSERT_EQUAL_DOUBLE((expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_DOUBLE_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_EACH_EQUAL_DOUBLE(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_DOUBLE((expected), (actual), (num_elements), __LINE__, NULL) -#define TEST_ASSERT_DOUBLE_IS_INF(actual) UNITY_TEST_ASSERT_DOUBLE_IS_INF((actual), __LINE__, NULL) -#define TEST_ASSERT_DOUBLE_IS_NEG_INF(actual) UNITY_TEST_ASSERT_DOUBLE_IS_NEG_INF((actual), __LINE__, NULL) -#define TEST_ASSERT_DOUBLE_IS_NAN(actual) UNITY_TEST_ASSERT_DOUBLE_IS_NAN((actual), __LINE__, NULL) -#define TEST_ASSERT_DOUBLE_IS_DETERMINATE(actual) UNITY_TEST_ASSERT_DOUBLE_IS_DETERMINATE((actual), __LINE__, NULL) -#define TEST_ASSERT_DOUBLE_IS_NOT_INF(actual) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_INF((actual), __LINE__, NULL) -#define TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF(actual) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF((actual), __LINE__, NULL) -#define TEST_ASSERT_DOUBLE_IS_NOT_NAN(actual) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NAN((actual), __LINE__, NULL) -#define TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(actual) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE((actual), __LINE__, NULL) - -/*------------------------------------------------------- - * Test Asserts (with additional messages) - *-------------------------------------------------------*/ - -/* Boolean */ -#define TEST_ASSERT_MESSAGE(condition, message) UNITY_TEST_ASSERT( (condition), __LINE__, (message)) -#define TEST_ASSERT_TRUE_MESSAGE(condition, message) UNITY_TEST_ASSERT( (condition), __LINE__, (message)) -#define TEST_ASSERT_UNLESS_MESSAGE(condition, message) UNITY_TEST_ASSERT( !(condition), __LINE__, (message)) -#define TEST_ASSERT_FALSE_MESSAGE(condition, message) UNITY_TEST_ASSERT( !(condition), __LINE__, (message)) -#define TEST_ASSERT_NULL_MESSAGE(pointer, message) UNITY_TEST_ASSERT_NULL( (pointer), __LINE__, (message)) -#define TEST_ASSERT_NOT_NULL_MESSAGE(pointer, message) UNITY_TEST_ASSERT_NOT_NULL((pointer), __LINE__, (message)) - -/* Integers (of all sizes) */ -#define TEST_ASSERT_EQUAL_INT_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT((expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_INT8_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT8((expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_INT16_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT16((expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_INT32_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT32((expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_INT64_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT64((expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT((expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_NOT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT(((expected) != (actual)), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_UINT_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_UINT( (expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_UINT8_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_UINT8( (expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_UINT16_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_UINT16( (expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_UINT32_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_UINT32( (expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_UINT64_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_UINT64( (expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_HEX_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_HEX32((expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_HEX8_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_HEX8( (expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_HEX16_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_HEX16((expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_HEX32_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_HEX32((expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_HEX64_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_HEX64((expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_BITS_MESSAGE(mask, expected, actual, message) UNITY_TEST_ASSERT_BITS((mask), (expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_BITS_HIGH_MESSAGE(mask, actual, message) UNITY_TEST_ASSERT_BITS((mask), (UNITY_UINT32)(-1), (actual), __LINE__, (message)) -#define TEST_ASSERT_BITS_LOW_MESSAGE(mask, actual, message) UNITY_TEST_ASSERT_BITS((mask), (UNITY_UINT32)(0), (actual), __LINE__, (message)) -#define TEST_ASSERT_BIT_HIGH_MESSAGE(bit, actual, message) UNITY_TEST_ASSERT_BITS(((UNITY_UINT32)1 << (bit)), (UNITY_UINT32)(-1), (actual), __LINE__, (message)) -#define TEST_ASSERT_BIT_LOW_MESSAGE(bit, actual, message) UNITY_TEST_ASSERT_BITS(((UNITY_UINT32)1 << (bit)), (UNITY_UINT32)(0), (actual), __LINE__, (message)) - -/* Integer Greater Than/ Less Than (of all sizes) */ -#define TEST_ASSERT_GREATER_THAN_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_INT((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_THAN_INT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_INT((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_THAN_INT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_INT8((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_THAN_INT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_INT16((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_THAN_INT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_INT32((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_THAN_INT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_INT64((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_THAN_UINT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_UINT((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_THAN_UINT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_UINT8((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_THAN_UINT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_UINT16((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_THAN_UINT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_UINT32((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_THAN_UINT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_UINT64((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_THAN_HEX8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_HEX8((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_THAN_HEX16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_HEX16((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_THAN_HEX32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_HEX32((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_THAN_HEX64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_HEX64((threshold), (actual), __LINE__, (message)) - -#define TEST_ASSERT_LESS_THAN_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_THAN_INT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_THAN_INT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT8((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_THAN_INT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT16((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_THAN_INT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT32((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_THAN_INT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT64((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_THAN_UINT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_UINT((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_THAN_UINT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_UINT8((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_THAN_UINT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_UINT16((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_THAN_UINT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_UINT32((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_THAN_UINT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_UINT64((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_THAN_HEX8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_HEX8((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_THAN_HEX16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_HEX16((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_THAN_HEX32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_HEX32((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_THAN_HEX64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_HEX64((threshold), (actual), __LINE__, (message)) - -#define TEST_ASSERT_GREATER_OR_EQUAL_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_OR_EQUAL_INT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_OR_EQUAL_INT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT8((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_OR_EQUAL_INT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT16((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_OR_EQUAL_INT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT32((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_OR_EQUAL_INT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT64((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_OR_EQUAL_UINT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_OR_EQUAL_UINT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT8((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_OR_EQUAL_UINT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT16((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_OR_EQUAL_UINT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT32((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_OR_EQUAL_UINT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT64((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_OR_EQUAL_HEX8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX8((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_OR_EQUAL_HEX16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX16((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_OR_EQUAL_HEX32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX32((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_GREATER_OR_EQUAL_HEX64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX64((threshold), (actual), __LINE__, (message)) - -#define TEST_ASSERT_LESS_OR_EQUAL_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_OR_EQUAL_INT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_OR_EQUAL_INT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT8((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_OR_EQUAL_INT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT16((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_OR_EQUAL_INT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT32((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_OR_EQUAL_INT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT64((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_OR_EQUAL_UINT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_OR_EQUAL_UINT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT8((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_OR_EQUAL_UINT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT16((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_OR_EQUAL_UINT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT32((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_OR_EQUAL_UINT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT64((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_OR_EQUAL_HEX8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX8((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_OR_EQUAL_HEX16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX16((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_OR_EQUAL_HEX32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_HEX32((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_OR_EQUAL_HEX64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_HEX64((threshold), (actual), __LINE__, (message)) - -/* Integer Ranges (of all sizes) */ -#define TEST_ASSERT_INT_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_INT_WITHIN((delta), (expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_INT8_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_INT8_WITHIN((delta), (expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_INT16_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_INT16_WITHIN((delta), (expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_INT32_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_INT32_WITHIN((delta), (expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_INT64_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_INT64_WITHIN((delta), (expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_UINT_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_UINT_WITHIN((delta), (expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_UINT8_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_UINT8_WITHIN((delta), (expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_UINT16_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_UINT16_WITHIN((delta), (expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_UINT32_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_UINT32_WITHIN((delta), (expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_UINT64_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_UINT64_WITHIN((delta), (expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_HEX_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_HEX32_WITHIN((delta), (expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_HEX8_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_HEX8_WITHIN((delta), (expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_HEX16_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_HEX16_WITHIN((delta), (expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_HEX32_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_HEX32_WITHIN((delta), (expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_HEX64_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_HEX64_WITHIN((delta), (expected), (actual), __LINE__, (message)) - -/* Structs and Strings */ -#define TEST_ASSERT_EQUAL_PTR_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_PTR((expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_STRING_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_STRING((expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_STRING_LEN_MESSAGE(expected, actual, len, message) UNITY_TEST_ASSERT_EQUAL_STRING_LEN((expected), (actual), (len), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_MEMORY_MESSAGE(expected, actual, len, message) UNITY_TEST_ASSERT_EQUAL_MEMORY((expected), (actual), (len), __LINE__, (message)) - -/* Arrays */ -#define TEST_ASSERT_EQUAL_INT_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_INT_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_INT8_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_INT8_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_INT16_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_INT16_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_INT32_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_INT32_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_INT64_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_INT64_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_UINT_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_UINT_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_UINT8_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_UINT8_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_UINT16_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_UINT32_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_UINT32_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_UINT64_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_HEX_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_HEX8_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_HEX8_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_HEX16_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_HEX16_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_HEX32_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_HEX64_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_PTR_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_PTR_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_STRING_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_MEMORY_ARRAY_MESSAGE(expected, actual, len, num_elements, message) UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((expected), (actual), (len), (num_elements), __LINE__, (message)) - -/* Arrays Compared To Single Value*/ -#define TEST_ASSERT_EACH_EQUAL_INT_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_INT((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EACH_EQUAL_INT8_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_INT8((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EACH_EQUAL_INT16_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_INT16((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EACH_EQUAL_INT32_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_INT32((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EACH_EQUAL_INT64_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_INT64((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EACH_EQUAL_UINT_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_UINT((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EACH_EQUAL_UINT8_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_UINT8((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EACH_EQUAL_UINT16_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_UINT16((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EACH_EQUAL_UINT32_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_UINT32((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EACH_EQUAL_UINT64_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_UINT64((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EACH_EQUAL_HEX_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_HEX32((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EACH_EQUAL_HEX8_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_HEX8((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EACH_EQUAL_HEX16_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_HEX16((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EACH_EQUAL_HEX32_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_HEX32((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EACH_EQUAL_HEX64_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_HEX64((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EACH_EQUAL_PTR_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_PTR((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EACH_EQUAL_STRING_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_STRING((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EACH_EQUAL_MEMORY_MESSAGE(expected, actual, len, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_MEMORY((expected), (actual), (len), (num_elements), __LINE__, (message)) - -/* Floating Point (If Enabled) */ -#define TEST_ASSERT_FLOAT_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_FLOAT_WITHIN((delta), (expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_FLOAT_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_FLOAT((expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_FLOAT_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_FLOAT_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EACH_EQUAL_FLOAT_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_FLOAT((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_FLOAT_IS_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_INF((actual), __LINE__, (message)) -#define TEST_ASSERT_FLOAT_IS_NEG_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_NEG_INF((actual), __LINE__, (message)) -#define TEST_ASSERT_FLOAT_IS_NAN_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_NAN((actual), __LINE__, (message)) -#define TEST_ASSERT_FLOAT_IS_DETERMINATE_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_DETERMINATE((actual), __LINE__, (message)) -#define TEST_ASSERT_FLOAT_IS_NOT_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_NOT_INF((actual), __LINE__, (message)) -#define TEST_ASSERT_FLOAT_IS_NOT_NEG_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_NOT_NEG_INF((actual), __LINE__, (message)) -#define TEST_ASSERT_FLOAT_IS_NOT_NAN_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_NOT_NAN((actual), __LINE__, (message)) -#define TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE((actual), __LINE__, (message)) - -/* Double (If Enabled) */ -#define TEST_ASSERT_DOUBLE_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_DOUBLE_WITHIN((delta), (expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_DOUBLE_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_DOUBLE((expected), (actual), __LINE__, (message)) -#define TEST_ASSERT_EQUAL_DOUBLE_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_DOUBLE_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_EACH_EQUAL_DOUBLE_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_DOUBLE((expected), (actual), (num_elements), __LINE__, (message)) -#define TEST_ASSERT_DOUBLE_IS_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_INF((actual), __LINE__, (message)) -#define TEST_ASSERT_DOUBLE_IS_NEG_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NEG_INF((actual), __LINE__, (message)) -#define TEST_ASSERT_DOUBLE_IS_NAN_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NAN((actual), __LINE__, (message)) -#define TEST_ASSERT_DOUBLE_IS_DETERMINATE_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_DETERMINATE((actual), __LINE__, (message)) -#define TEST_ASSERT_DOUBLE_IS_NOT_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_INF((actual), __LINE__, (message)) -#define TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF((actual), __LINE__, (message)) -#define TEST_ASSERT_DOUBLE_IS_NOT_NAN_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NAN((actual), __LINE__, (message)) -#define TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE((actual), __LINE__, (message)) - -/* end of UNITY_FRAMEWORK_H */ -#ifdef __cplusplus -} -#endif -#endif diff --git a/tools/sdk/include/json/tests/unity/src/unity_internals.h b/tools/sdk/include/json/tests/unity/src/unity_internals.h deleted file mode 100644 index f78cebace4e..00000000000 --- a/tools/sdk/include/json/tests/unity/src/unity_internals.h +++ /dev/null @@ -1,870 +0,0 @@ -/* ========================================== - Unity Project - A Test Framework for C - Copyright (c) 2007-14 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ - -#ifndef UNITY_INTERNALS_H -#define UNITY_INTERNALS_H - -#include "../examples/unity_config.h" - -#ifndef UNITY_EXCLUDE_SETJMP_H -#include -#endif - -#ifndef UNITY_EXCLUDE_MATH_H -#include -#endif - -/* Unity Attempts to Auto-Detect Integer Types - * Attempt 1: UINT_MAX, ULONG_MAX in , or default to 32 bits - * Attempt 2: UINTPTR_MAX in , or default to same size as long - * The user may override any of these derived constants: - * UNITY_INT_WIDTH, UNITY_LONG_WIDTH, UNITY_POINTER_WIDTH */ -#ifndef UNITY_EXCLUDE_STDINT_H -#include -#endif - -#ifndef UNITY_EXCLUDE_LIMITS_H -#include -#endif - -/*------------------------------------------------------- - * Guess Widths If Not Specified - *-------------------------------------------------------*/ - -/* Determine the size of an int, if not already specified. - * We cannot use sizeof(int), because it is not yet defined - * at this stage in the translation of the C program. - * Therefore, infer it from UINT_MAX if possible. */ -#ifndef UNITY_INT_WIDTH - #ifdef UINT_MAX - #if (UINT_MAX == 0xFFFF) - #define UNITY_INT_WIDTH (16) - #elif (UINT_MAX == 0xFFFFFFFF) - #define UNITY_INT_WIDTH (32) - #elif (UINT_MAX == 0xFFFFFFFFFFFFFFFF) - #define UNITY_INT_WIDTH (64) - #endif - #else /* Set to default */ - #define UNITY_INT_WIDTH (32) - #endif /* UINT_MAX */ -#endif - -/* Determine the size of a long, if not already specified. */ -#ifndef UNITY_LONG_WIDTH - #ifdef ULONG_MAX - #if (ULONG_MAX == 0xFFFF) - #define UNITY_LONG_WIDTH (16) - #elif (ULONG_MAX == 0xFFFFFFFF) - #define UNITY_LONG_WIDTH (32) - #elif (ULONG_MAX == 0xFFFFFFFFFFFFFFFF) - #define UNITY_LONG_WIDTH (64) - #endif - #else /* Set to default */ - #define UNITY_LONG_WIDTH (32) - #endif /* ULONG_MAX */ -#endif - -/* Determine the size of a pointer, if not already specified. */ -#ifndef UNITY_POINTER_WIDTH - #ifdef UINTPTR_MAX - #if (UINTPTR_MAX <= 0xFFFF) - #define UNITY_POINTER_WIDTH (16) - #elif (UINTPTR_MAX <= 0xFFFFFFFF) - #define UNITY_POINTER_WIDTH (32) - #elif (UINTPTR_MAX <= 0xFFFFFFFFFFFFFFFF) - #define UNITY_POINTER_WIDTH (64) - #endif - #else /* Set to default */ - #define UNITY_POINTER_WIDTH UNITY_LONG_WIDTH - #endif /* UINTPTR_MAX */ -#endif - -/*------------------------------------------------------- - * Int Support (Define types based on detected sizes) - *-------------------------------------------------------*/ - -#if (UNITY_INT_WIDTH == 32) - typedef unsigned char UNITY_UINT8; - typedef unsigned short UNITY_UINT16; - typedef unsigned int UNITY_UINT32; - typedef signed char UNITY_INT8; - typedef signed short UNITY_INT16; - typedef signed int UNITY_INT32; -#elif (UNITY_INT_WIDTH == 16) - typedef unsigned char UNITY_UINT8; - typedef unsigned int UNITY_UINT16; - typedef unsigned long UNITY_UINT32; - typedef signed char UNITY_INT8; - typedef signed int UNITY_INT16; - typedef signed long UNITY_INT32; -#else - #error Invalid UNITY_INT_WIDTH specified! (16 or 32 are supported) -#endif - -/*------------------------------------------------------- - * 64-bit Support - *-------------------------------------------------------*/ - -#ifndef UNITY_SUPPORT_64 - #if UNITY_LONG_WIDTH == 64 || UNITY_POINTER_WIDTH == 64 - #define UNITY_SUPPORT_64 - #endif -#endif - -#ifndef UNITY_SUPPORT_64 - /* No 64-bit Support */ - typedef UNITY_UINT32 UNITY_UINT; - typedef UNITY_INT32 UNITY_INT; -#else - - /* 64-bit Support */ - #if (UNITY_LONG_WIDTH == 32) - typedef unsigned long long UNITY_UINT64; - typedef signed long long UNITY_INT64; - #elif (UNITY_LONG_WIDTH == 64) - typedef unsigned long UNITY_UINT64; - typedef signed long UNITY_INT64; - #else - #error Invalid UNITY_LONG_WIDTH specified! (32 or 64 are supported) - #endif - typedef UNITY_UINT64 UNITY_UINT; - typedef UNITY_INT64 UNITY_INT; - -#endif - -/*------------------------------------------------------- - * Pointer Support - *-------------------------------------------------------*/ - -#if (UNITY_POINTER_WIDTH == 32) -#define UNITY_PTR_TO_INT UNITY_INT32 -#define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX32 -#elif (UNITY_POINTER_WIDTH == 64) -#define UNITY_PTR_TO_INT UNITY_INT64 -#define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX64 -#elif (UNITY_POINTER_WIDTH == 16) -#define UNITY_PTR_TO_INT UNITY_INT16 -#define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX16 -#else - #error Invalid UNITY_POINTER_WIDTH specified! (16, 32 or 64 are supported) -#endif - -#ifndef UNITY_PTR_ATTRIBUTE -#define UNITY_PTR_ATTRIBUTE -#endif - -#ifndef UNITY_INTERNAL_PTR -#define UNITY_INTERNAL_PTR UNITY_PTR_ATTRIBUTE const void* -#endif - -/*------------------------------------------------------- - * Float Support - *-------------------------------------------------------*/ - -#ifdef UNITY_EXCLUDE_FLOAT - -/* No Floating Point Support */ -#ifndef UNITY_EXCLUDE_DOUBLE -#define UNITY_EXCLUDE_DOUBLE /* Remove double when excluding float support */ -#endif -#ifndef UNITY_EXCLUDE_FLOAT_PRINT -#define UNITY_EXCLUDE_FLOAT_PRINT -#endif - -#else - -/* Floating Point Support */ -#ifndef UNITY_FLOAT_PRECISION -#define UNITY_FLOAT_PRECISION (0.00001f) -#endif -#ifndef UNITY_FLOAT_TYPE -#define UNITY_FLOAT_TYPE float -#endif -typedef UNITY_FLOAT_TYPE UNITY_FLOAT; - -/* isinf & isnan macros should be provided by math.h */ -#ifndef isinf -/* The value of Inf - Inf is NaN */ -#define isinf(n) (isnan((n) - (n)) && !isnan(n)) -#endif - -#ifndef isnan -/* NaN is the only floating point value that does NOT equal itself. - * Therefore if n != n, then it is NaN. */ -#define isnan(n) ((n != n) ? 1 : 0) -#endif - -#endif - -/*------------------------------------------------------- - * Double Float Support - *-------------------------------------------------------*/ - -/* unlike float, we DON'T include by default */ -#if defined(UNITY_EXCLUDE_DOUBLE) || !defined(UNITY_INCLUDE_DOUBLE) - - /* No Floating Point Support */ - #ifndef UNITY_EXCLUDE_DOUBLE - #define UNITY_EXCLUDE_DOUBLE - #else - #undef UNITY_INCLUDE_DOUBLE - #endif - - #ifndef UNITY_EXCLUDE_FLOAT - #ifndef UNITY_DOUBLE_TYPE - #define UNITY_DOUBLE_TYPE double - #endif - typedef UNITY_FLOAT UNITY_DOUBLE; - /* For parameter in UnityPrintFloat(UNITY_DOUBLE), which aliases to double or float */ - #endif - -#else - - /* Double Floating Point Support */ - #ifndef UNITY_DOUBLE_PRECISION - #define UNITY_DOUBLE_PRECISION (1e-12) - #endif - - #ifndef UNITY_DOUBLE_TYPE - #define UNITY_DOUBLE_TYPE double - #endif - typedef UNITY_DOUBLE_TYPE UNITY_DOUBLE; - -#endif - -/*------------------------------------------------------- - * Output Method: stdout (DEFAULT) - *-------------------------------------------------------*/ -#ifndef UNITY_OUTPUT_CHAR -/* Default to using putchar, which is defined in stdio.h */ -#include -#define UNITY_OUTPUT_CHAR(a) (void)putchar(a) -#else - /* If defined as something else, make sure we declare it here so it's ready for use */ - #ifdef UNITY_OUTPUT_CHAR_HEADER_DECLARATION -extern void UNITY_OUTPUT_CHAR_HEADER_DECLARATION; - #endif -#endif - -#ifndef UNITY_OUTPUT_FLUSH -#ifdef UNITY_USE_FLUSH_STDOUT -/* We want to use the stdout flush utility */ -#include -#define UNITY_OUTPUT_FLUSH() (void)fflush(stdout) -#else -/* We've specified nothing, therefore flush should just be ignored */ -#define UNITY_OUTPUT_FLUSH() -#endif -#else -/* We've defined flush as something else, so make sure we declare it here so it's ready for use */ -#ifdef UNITY_OUTPUT_FLUSH_HEADER_DECLARATION -extern void UNITY_OMIT_OUTPUT_FLUSH_HEADER_DECLARATION; -#endif -#endif - -#ifndef UNITY_OUTPUT_FLUSH -#define UNITY_FLUSH_CALL() -#else -#define UNITY_FLUSH_CALL() UNITY_OUTPUT_FLUSH() -#endif - -#ifndef UNITY_PRINT_EOL -#define UNITY_PRINT_EOL() UNITY_OUTPUT_CHAR('\n') -#endif - -#ifndef UNITY_OUTPUT_START -#define UNITY_OUTPUT_START() -#endif - -#ifndef UNITY_OUTPUT_COMPLETE -#define UNITY_OUTPUT_COMPLETE() -#endif - -/*------------------------------------------------------- - * Footprint - *-------------------------------------------------------*/ - -#ifndef UNITY_LINE_TYPE -#define UNITY_LINE_TYPE UNITY_UINT -#endif - -#ifndef UNITY_COUNTER_TYPE -#define UNITY_COUNTER_TYPE UNITY_UINT -#endif - -/*------------------------------------------------------- - * Language Features Available - *-------------------------------------------------------*/ -#if !defined(UNITY_WEAK_ATTRIBUTE) && !defined(UNITY_WEAK_PRAGMA) -# if defined(__GNUC__) || defined(__ghs__) /* __GNUC__ includes clang */ -# if !(defined(__WIN32__) && defined(__clang__)) && !defined(__TMS470__) -# define UNITY_WEAK_ATTRIBUTE __attribute__((weak)) -# endif -# endif -#endif - -#ifdef UNITY_NO_WEAK -# undef UNITY_WEAK_ATTRIBUTE -# undef UNITY_WEAK_PRAGMA -#endif - - -/*------------------------------------------------------- - * Internal Structs Needed - *-------------------------------------------------------*/ - -typedef void (*UnityTestFunction)(void); - -#define UNITY_DISPLAY_RANGE_INT (0x10) -#define UNITY_DISPLAY_RANGE_UINT (0x20) -#define UNITY_DISPLAY_RANGE_HEX (0x40) - -typedef enum -{ -UNITY_DISPLAY_STYLE_INT = sizeof(int)+ UNITY_DISPLAY_RANGE_INT, - UNITY_DISPLAY_STYLE_INT8 = 1 + UNITY_DISPLAY_RANGE_INT, - UNITY_DISPLAY_STYLE_INT16 = 2 + UNITY_DISPLAY_RANGE_INT, - UNITY_DISPLAY_STYLE_INT32 = 4 + UNITY_DISPLAY_RANGE_INT, -#ifdef UNITY_SUPPORT_64 - UNITY_DISPLAY_STYLE_INT64 = 8 + UNITY_DISPLAY_RANGE_INT, -#endif - -UNITY_DISPLAY_STYLE_UINT = sizeof(unsigned) + UNITY_DISPLAY_RANGE_UINT, - UNITY_DISPLAY_STYLE_UINT8 = 1 + UNITY_DISPLAY_RANGE_UINT, - UNITY_DISPLAY_STYLE_UINT16 = 2 + UNITY_DISPLAY_RANGE_UINT, - UNITY_DISPLAY_STYLE_UINT32 = 4 + UNITY_DISPLAY_RANGE_UINT, -#ifdef UNITY_SUPPORT_64 - UNITY_DISPLAY_STYLE_UINT64 = 8 + UNITY_DISPLAY_RANGE_UINT, -#endif - - UNITY_DISPLAY_STYLE_HEX8 = 1 + UNITY_DISPLAY_RANGE_HEX, - UNITY_DISPLAY_STYLE_HEX16 = 2 + UNITY_DISPLAY_RANGE_HEX, - UNITY_DISPLAY_STYLE_HEX32 = 4 + UNITY_DISPLAY_RANGE_HEX, -#ifdef UNITY_SUPPORT_64 - UNITY_DISPLAY_STYLE_HEX64 = 8 + UNITY_DISPLAY_RANGE_HEX, -#endif - - UNITY_DISPLAY_STYLE_UNKNOWN -} UNITY_DISPLAY_STYLE_T; - -typedef enum -{ - UNITY_EQUAL_TO = 1, - UNITY_GREATER_THAN = 2, - UNITY_GREATER_OR_EQUAL = 2 + UNITY_EQUAL_TO, - UNITY_SMALLER_THAN = 4, - UNITY_SMALLER_OR_EQUAL = 4 + UNITY_EQUAL_TO -} UNITY_COMPARISON_T; - -#ifndef UNITY_EXCLUDE_FLOAT -typedef enum UNITY_FLOAT_TRAIT -{ - UNITY_FLOAT_IS_NOT_INF = 0, - UNITY_FLOAT_IS_INF, - UNITY_FLOAT_IS_NOT_NEG_INF, - UNITY_FLOAT_IS_NEG_INF, - UNITY_FLOAT_IS_NOT_NAN, - UNITY_FLOAT_IS_NAN, - UNITY_FLOAT_IS_NOT_DET, - UNITY_FLOAT_IS_DET, - UNITY_FLOAT_INVALID_TRAIT -} UNITY_FLOAT_TRAIT_T; -#endif - -typedef enum -{ - UNITY_ARRAY_TO_VAL = 0, - UNITY_ARRAY_TO_ARRAY -} UNITY_FLAGS_T; - -struct UNITY_STORAGE_T -{ - const char* TestFile; - const char* CurrentTestName; -#ifndef UNITY_EXCLUDE_DETAILS - const char* CurrentDetail1; - const char* CurrentDetail2; -#endif - UNITY_LINE_TYPE CurrentTestLineNumber; - UNITY_COUNTER_TYPE NumberOfTests; - UNITY_COUNTER_TYPE TestFailures; - UNITY_COUNTER_TYPE TestIgnores; - UNITY_COUNTER_TYPE CurrentTestFailed; - UNITY_COUNTER_TYPE CurrentTestIgnored; -#ifndef UNITY_EXCLUDE_SETJMP_H - jmp_buf AbortFrame; -#endif -}; - -extern struct UNITY_STORAGE_T Unity; - -/*------------------------------------------------------- - * Test Suite Management - *-------------------------------------------------------*/ - -void UnityBegin(const char* filename); -int UnityEnd(void); -void UnityConcludeTest(void); -void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum); - -/*------------------------------------------------------- - * Details Support - *-------------------------------------------------------*/ - -#ifdef UNITY_EXCLUDE_DETAILS -#define UNITY_CLR_DETAILS() -#define UNITY_SET_DETAIL(d1) -#define UNITY_SET_DETAILS(d1,d2) -#else -#define UNITY_CLR_DETAILS() { Unity.CurrentDetail1 = 0; Unity.CurrentDetail2 = 0; } -#define UNITY_SET_DETAIL(d1) { Unity.CurrentDetail1 = d1; Unity.CurrentDetail2 = 0; } -#define UNITY_SET_DETAILS(d1,d2) { Unity.CurrentDetail1 = d1; Unity.CurrentDetail2 = d2; } - -#ifndef UNITY_DETAIL1_NAME -#define UNITY_DETAIL1_NAME "Function" -#endif - -#ifndef UNITY_DETAIL2_NAME -#define UNITY_DETAIL2_NAME "Argument" -#endif -#endif - -/*------------------------------------------------------- - * Test Output - *-------------------------------------------------------*/ - -void UnityPrint(const char* string); -void UnityPrintLen(const char* string, const UNITY_UINT32 length); -void UnityPrintMask(const UNITY_UINT mask, const UNITY_UINT number); -void UnityPrintNumberByStyle(const UNITY_INT number, const UNITY_DISPLAY_STYLE_T style); -void UnityPrintNumber(const UNITY_INT number); -void UnityPrintNumberUnsigned(const UNITY_UINT number); -void UnityPrintNumberHex(const UNITY_UINT number, const char nibbles); - -#ifndef UNITY_EXCLUDE_FLOAT_PRINT -void UnityPrintFloat(const UNITY_DOUBLE input_number); -#endif - -/*------------------------------------------------------- - * Test Assertion Functions - *------------------------------------------------------- - * Use the macros below this section instead of calling - * these directly. The macros have a consistent naming - * convention and will pull in file and line information - * for you. */ - -void UnityAssertEqualNumber(const UNITY_INT expected, - const UNITY_INT actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_DISPLAY_STYLE_T style); - -void UnityAssertGreaterOrLessOrEqualNumber(const UNITY_INT threshold, - const UNITY_INT actual, - const UNITY_COMPARISON_T compare, - const char *msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_DISPLAY_STYLE_T style); - -void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected, - UNITY_INTERNAL_PTR actual, - const UNITY_UINT32 num_elements, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_DISPLAY_STYLE_T style, - const UNITY_FLAGS_T flags); - -void UnityAssertBits(const UNITY_INT mask, - const UNITY_INT expected, - const UNITY_INT actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber); - -void UnityAssertEqualString(const char* expected, - const char* actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber); - -void UnityAssertEqualStringLen(const char* expected, - const char* actual, - const UNITY_UINT32 length, - const char* msg, - const UNITY_LINE_TYPE lineNumber); - -void UnityAssertEqualStringArray( UNITY_INTERNAL_PTR expected, - const char** actual, - const UNITY_UINT32 num_elements, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_FLAGS_T flags); - -void UnityAssertEqualMemory( UNITY_INTERNAL_PTR expected, - UNITY_INTERNAL_PTR actual, - const UNITY_UINT32 length, - const UNITY_UINT32 num_elements, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_FLAGS_T flags); - -void UnityAssertNumbersWithin(const UNITY_UINT delta, - const UNITY_INT expected, - const UNITY_INT actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_DISPLAY_STYLE_T style); - -void UnityFail(const char* message, const UNITY_LINE_TYPE line); - -void UnityIgnore(const char* message, const UNITY_LINE_TYPE line); - -#ifndef UNITY_EXCLUDE_FLOAT -void UnityAssertFloatsWithin(const UNITY_FLOAT delta, - const UNITY_FLOAT expected, - const UNITY_FLOAT actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber); - -void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* expected, - UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* actual, - const UNITY_UINT32 num_elements, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_FLAGS_T flags); - -void UnityAssertFloatSpecial(const UNITY_FLOAT actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_FLOAT_TRAIT_T style); -#endif - -#ifndef UNITY_EXCLUDE_DOUBLE -void UnityAssertDoublesWithin(const UNITY_DOUBLE delta, - const UNITY_DOUBLE expected, - const UNITY_DOUBLE actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber); - -void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* expected, - UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* actual, - const UNITY_UINT32 num_elements, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_FLAGS_T flags); - -void UnityAssertDoubleSpecial(const UNITY_DOUBLE actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_FLOAT_TRAIT_T style); -#endif - -/*------------------------------------------------------- - * Helpers - *-------------------------------------------------------*/ - -UNITY_INTERNAL_PTR UnityNumToPtr(const UNITY_INT num, const UNITY_UINT8 size); -#ifndef UNITY_EXCLUDE_FLOAT -UNITY_INTERNAL_PTR UnityFloatToPtr(const float num); -#endif -#ifndef UNITY_EXCLUDE_DOUBLE -UNITY_INTERNAL_PTR UnityDoubleToPtr(const double num); -#endif - -/*------------------------------------------------------- - * Error Strings We Might Need - *-------------------------------------------------------*/ - -extern const char UnityStrErrFloat[]; -extern const char UnityStrErrDouble[]; -extern const char UnityStrErr64[]; - -/*------------------------------------------------------- - * Test Running Macros - *-------------------------------------------------------*/ - -#ifndef UNITY_EXCLUDE_SETJMP_H -#define TEST_PROTECT() (setjmp(Unity.AbortFrame) == 0) -#define TEST_ABORT() longjmp(Unity.AbortFrame, 1) -#else -#define TEST_PROTECT() 1 -#define TEST_ABORT() return -#endif - -/* This tricky series of macros gives us an optional line argument to treat it as RUN_TEST(func, num=__LINE__) */ -#ifndef RUN_TEST -#ifdef __STDC_VERSION__ -#if __STDC_VERSION__ >= 199901L -#define RUN_TEST(...) UnityDefaultTestRun(RUN_TEST_FIRST(__VA_ARGS__), RUN_TEST_SECOND(__VA_ARGS__)) -#define RUN_TEST_FIRST(...) RUN_TEST_FIRST_HELPER(__VA_ARGS__, throwaway) -#define RUN_TEST_FIRST_HELPER(first, ...) (first), #first -#define RUN_TEST_SECOND(...) RUN_TEST_SECOND_HELPER(__VA_ARGS__, __LINE__, throwaway) -#define RUN_TEST_SECOND_HELPER(first, second, ...) (second) -#endif -#endif -#endif - -/* If we can't do the tricky version, we'll just have to require them to always include the line number */ -#ifndef RUN_TEST -#ifdef CMOCK -#define RUN_TEST(func, num) UnityDefaultTestRun(func, #func, num) -#else -#define RUN_TEST(func) UnityDefaultTestRun(func, #func, __LINE__) -#endif -#endif - -#define TEST_LINE_NUM (Unity.CurrentTestLineNumber) -#define TEST_IS_IGNORED (Unity.CurrentTestIgnored) -#define UNITY_NEW_TEST(a) \ - Unity.CurrentTestName = (a); \ - Unity.CurrentTestLineNumber = (UNITY_LINE_TYPE)(__LINE__); \ - Unity.NumberOfTests++; - -#ifndef UNITY_BEGIN -#define UNITY_BEGIN() UnityBegin(__FILE__) -#endif - -#ifndef UNITY_END -#define UNITY_END() UnityEnd() -#endif - -/*----------------------------------------------- - * Command Line Argument Support - *-----------------------------------------------*/ - -#ifdef UNITY_USE_COMMAND_LINE_ARGS -int UnityParseOptions(int argc, char** argv); -int UnityTestMatches(void); -#endif - -/*------------------------------------------------------- - * Basic Fail and Ignore - *-------------------------------------------------------*/ - -#define UNITY_TEST_FAIL(line, message) UnityFail( (message), (UNITY_LINE_TYPE)(line)) -#define UNITY_TEST_IGNORE(line, message) UnityIgnore( (message), (UNITY_LINE_TYPE)(line)) - -/*------------------------------------------------------- - * Test Asserts - *-------------------------------------------------------*/ - -#define UNITY_TEST_ASSERT(condition, line, message) if (condition) {} else {UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), (message));} -#define UNITY_TEST_ASSERT_NULL(pointer, line, message) UNITY_TEST_ASSERT(((pointer) == NULL), (UNITY_LINE_TYPE)(line), (message)) -#define UNITY_TEST_ASSERT_NOT_NULL(pointer, line, message) UNITY_TEST_ASSERT(((pointer) != NULL), (UNITY_LINE_TYPE)(line), (message)) - -#define UNITY_TEST_ASSERT_EQUAL_INT(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) -#define UNITY_TEST_ASSERT_EQUAL_INT8(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(expected), (UNITY_INT)(UNITY_INT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) -#define UNITY_TEST_ASSERT_EQUAL_INT16(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT16)(expected), (UNITY_INT)(UNITY_INT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) -#define UNITY_TEST_ASSERT_EQUAL_INT32(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT32)(expected), (UNITY_INT)(UNITY_INT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) -#define UNITY_TEST_ASSERT_EQUAL_UINT(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) -#define UNITY_TEST_ASSERT_EQUAL_UINT8(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_UINT8 )(expected), (UNITY_INT)(UNITY_UINT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) -#define UNITY_TEST_ASSERT_EQUAL_UINT16(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_UINT16)(expected), (UNITY_INT)(UNITY_UINT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) -#define UNITY_TEST_ASSERT_EQUAL_UINT32(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_UINT32)(expected), (UNITY_INT)(UNITY_UINT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) -#define UNITY_TEST_ASSERT_EQUAL_HEX8(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(expected), (UNITY_INT)(UNITY_INT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) -#define UNITY_TEST_ASSERT_EQUAL_HEX16(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT16)(expected), (UNITY_INT)(UNITY_INT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) -#define UNITY_TEST_ASSERT_EQUAL_HEX32(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT32)(expected), (UNITY_INT)(UNITY_INT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) -#define UNITY_TEST_ASSERT_BITS(mask, expected, actual, line, message) UnityAssertBits((UNITY_INT)(mask), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line)) - -#define UNITY_TEST_ASSERT_GREATER_THAN_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) -#define UNITY_TEST_ASSERT_GREATER_THAN_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) -#define UNITY_TEST_ASSERT_GREATER_THAN_INT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) -#define UNITY_TEST_ASSERT_GREATER_THAN_INT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) -#define UNITY_TEST_ASSERT_GREATER_THAN_UINT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) -#define UNITY_TEST_ASSERT_GREATER_THAN_UINT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) -#define UNITY_TEST_ASSERT_GREATER_THAN_UINT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) -#define UNITY_TEST_ASSERT_GREATER_THAN_UINT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) -#define UNITY_TEST_ASSERT_GREATER_THAN_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) -#define UNITY_TEST_ASSERT_GREATER_THAN_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) -#define UNITY_TEST_ASSERT_GREATER_THAN_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) - -#define UNITY_TEST_ASSERT_SMALLER_THAN_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) -#define UNITY_TEST_ASSERT_SMALLER_THAN_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) -#define UNITY_TEST_ASSERT_SMALLER_THAN_INT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) -#define UNITY_TEST_ASSERT_SMALLER_THAN_INT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) -#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) -#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) -#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) -#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) -#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) -#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) -#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) - -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) - -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) - -#define UNITY_TEST_ASSERT_INT_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((delta), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) -#define UNITY_TEST_ASSERT_INT8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT8 )(delta), (UNITY_INT)(UNITY_INT8 )(expected), (UNITY_INT)(UNITY_INT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) -#define UNITY_TEST_ASSERT_INT16_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT16)(delta), (UNITY_INT)(UNITY_INT16)(expected), (UNITY_INT)(UNITY_INT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) -#define UNITY_TEST_ASSERT_INT32_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT32)(delta), (UNITY_INT)(UNITY_INT32)(expected), (UNITY_INT)(UNITY_INT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) -#define UNITY_TEST_ASSERT_UINT_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((delta), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) -#define UNITY_TEST_ASSERT_UINT8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT8 )(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT8 )(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) -#define UNITY_TEST_ASSERT_UINT16_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT16)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) -#define UNITY_TEST_ASSERT_UINT32_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT32)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) -#define UNITY_TEST_ASSERT_HEX8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT8 )(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT8 )(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) -#define UNITY_TEST_ASSERT_HEX16_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT16)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) -#define UNITY_TEST_ASSERT_HEX32_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT32)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) - -#define UNITY_TEST_ASSERT_EQUAL_PTR(expected, actual, line, message) UnityAssertEqualNumber((UNITY_PTR_TO_INT)(expected), (UNITY_PTR_TO_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_POINTER) -#define UNITY_TEST_ASSERT_EQUAL_STRING(expected, actual, line, message) UnityAssertEqualString((const char*)(expected), (const char*)(actual), (message), (UNITY_LINE_TYPE)(line)) -#define UNITY_TEST_ASSERT_EQUAL_STRING_LEN(expected, actual, len, line, message) UnityAssertEqualStringLen((const char*)(expected), (const char*)(actual), (UNITY_UINT32)(len), (message), (UNITY_LINE_TYPE)(line)) -#define UNITY_TEST_ASSERT_EQUAL_MEMORY(expected, actual, len, line, message) UnityAssertEqualMemory((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(len), 1, (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_ARRAY) - -#define UNITY_TEST_ASSERT_EQUAL_INT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT, UNITY_ARRAY_TO_ARRAY) -#define UNITY_TEST_ASSERT_EQUAL_INT8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8, UNITY_ARRAY_TO_ARRAY) -#define UNITY_TEST_ASSERT_EQUAL_INT16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16, UNITY_ARRAY_TO_ARRAY) -#define UNITY_TEST_ASSERT_EQUAL_INT32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32, UNITY_ARRAY_TO_ARRAY) -#define UNITY_TEST_ASSERT_EQUAL_UINT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT, UNITY_ARRAY_TO_ARRAY) -#define UNITY_TEST_ASSERT_EQUAL_UINT8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8, UNITY_ARRAY_TO_ARRAY) -#define UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16, UNITY_ARRAY_TO_ARRAY) -#define UNITY_TEST_ASSERT_EQUAL_UINT32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32, UNITY_ARRAY_TO_ARRAY) -#define UNITY_TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8, UNITY_ARRAY_TO_ARRAY) -#define UNITY_TEST_ASSERT_EQUAL_HEX16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16, UNITY_ARRAY_TO_ARRAY) -#define UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32, UNITY_ARRAY_TO_ARRAY) -#define UNITY_TEST_ASSERT_EQUAL_PTR_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_POINTER, UNITY_ARRAY_TO_ARRAY) -#define UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualStringArray((UNITY_INTERNAL_PTR)(expected), (const char**)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_ARRAY) -#define UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY(expected, actual, len, num_elements, line, message) UnityAssertEqualMemory((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(len), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_ARRAY) - -#define UNITY_TEST_ASSERT_EACH_EQUAL_INT(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT) expected, sizeof(int)), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT, UNITY_ARRAY_TO_VAL) -#define UNITY_TEST_ASSERT_EACH_EQUAL_INT8(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT8 )expected, 1), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8, UNITY_ARRAY_TO_VAL) -#define UNITY_TEST_ASSERT_EACH_EQUAL_INT16(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT16 )expected, 2), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16, UNITY_ARRAY_TO_VAL) -#define UNITY_TEST_ASSERT_EACH_EQUAL_INT32(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT32 )expected, 4), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32, UNITY_ARRAY_TO_VAL) -#define UNITY_TEST_ASSERT_EACH_EQUAL_UINT(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT) expected, sizeof(unsigned int)), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT, UNITY_ARRAY_TO_VAL) -#define UNITY_TEST_ASSERT_EACH_EQUAL_UINT8(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_UINT8 )expected, 1), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8, UNITY_ARRAY_TO_VAL) -#define UNITY_TEST_ASSERT_EACH_EQUAL_UINT16(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_UINT16)expected, 2), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16, UNITY_ARRAY_TO_VAL) -#define UNITY_TEST_ASSERT_EACH_EQUAL_UINT32(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_UINT32)expected, 4), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32, UNITY_ARRAY_TO_VAL) -#define UNITY_TEST_ASSERT_EACH_EQUAL_HEX8(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT8 )expected, 1), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8, UNITY_ARRAY_TO_VAL) -#define UNITY_TEST_ASSERT_EACH_EQUAL_HEX16(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT16 )expected, 2), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16, UNITY_ARRAY_TO_VAL) -#define UNITY_TEST_ASSERT_EACH_EQUAL_HEX32(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT32 )expected, 4), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32, UNITY_ARRAY_TO_VAL) -#define UNITY_TEST_ASSERT_EACH_EQUAL_PTR(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_PTR_TO_INT) expected, sizeof(int*)), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_POINTER, UNITY_ARRAY_TO_VAL) -#define UNITY_TEST_ASSERT_EACH_EQUAL_STRING(expected, actual, num_elements, line, message) UnityAssertEqualStringArray((UNITY_INTERNAL_PTR)(expected), (const char**)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_VAL) -#define UNITY_TEST_ASSERT_EACH_EQUAL_MEMORY(expected, actual, len, num_elements, line, message) UnityAssertEqualMemory((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(len), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_VAL) - -#ifdef UNITY_SUPPORT_64 -#define UNITY_TEST_ASSERT_EQUAL_INT64(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) -#define UNITY_TEST_ASSERT_EQUAL_UINT64(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) -#define UNITY_TEST_ASSERT_EQUAL_HEX64(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) -#define UNITY_TEST_ASSERT_EQUAL_INT64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64, UNITY_ARRAY_TO_ARRAY) -#define UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64, UNITY_ARRAY_TO_ARRAY) -#define UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64, UNITY_ARRAY_TO_ARRAY) -#define UNITY_TEST_ASSERT_EACH_EQUAL_INT64(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT64)expected, 8), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64, UNITY_ARRAY_TO_VAL) -#define UNITY_TEST_ASSERT_EACH_EQUAL_UINT64(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_UINT64)expected, 8), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64, UNITY_ARRAY_TO_VAL) -#define UNITY_TEST_ASSERT_EACH_EQUAL_HEX64(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT64)expected, 8), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64, UNITY_ARRAY_TO_VAL) -#define UNITY_TEST_ASSERT_INT64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((delta), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) -#define UNITY_TEST_ASSERT_UINT64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((delta), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) -#define UNITY_TEST_ASSERT_HEX64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((delta), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) -#define UNITY_TEST_ASSERT_GREATER_THAN_INT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) -#define UNITY_TEST_ASSERT_GREATER_THAN_UINT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) -#define UNITY_TEST_ASSERT_GREATER_THAN_HEX64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) -#define UNITY_TEST_ASSERT_SMALLER_THAN_INT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) -#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) -#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) -#else -#define UNITY_TEST_ASSERT_EQUAL_INT64(expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) -#define UNITY_TEST_ASSERT_EQUAL_UINT64(expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) -#define UNITY_TEST_ASSERT_EQUAL_HEX64(expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) -#define UNITY_TEST_ASSERT_EQUAL_INT64_ARRAY(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) -#define UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) -#define UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) -#define UNITY_TEST_ASSERT_INT64_WITHIN(delta, expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) -#define UNITY_TEST_ASSERT_UINT64_WITHIN(delta, expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) -#define UNITY_TEST_ASSERT_HEX64_WITHIN(delta, expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) -#define UNITY_TEST_ASSERT_GREATER_THAN_INT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) -#define UNITY_TEST_ASSERT_GREATER_THAN_UINT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) -#define UNITY_TEST_ASSERT_GREATER_THAN_HEX64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) -#define UNITY_TEST_ASSERT_SMALLER_THAN_INT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) -#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) -#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) -#endif - -#ifdef UNITY_EXCLUDE_FLOAT -#define UNITY_TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) -#define UNITY_TEST_ASSERT_EQUAL_FLOAT(expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) -#define UNITY_TEST_ASSERT_EQUAL_FLOAT_ARRAY(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) -#define UNITY_TEST_ASSERT_EACH_EQUAL_FLOAT(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) -#define UNITY_TEST_ASSERT_FLOAT_IS_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) -#define UNITY_TEST_ASSERT_FLOAT_IS_NEG_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) -#define UNITY_TEST_ASSERT_FLOAT_IS_NAN(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) -#define UNITY_TEST_ASSERT_FLOAT_IS_DETERMINATE(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) -#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) -#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NEG_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) -#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NAN(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) -#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) -#else -#define UNITY_TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual, line, message) UnityAssertFloatsWithin((UNITY_FLOAT)(delta), (UNITY_FLOAT)(expected), (UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line)) -#define UNITY_TEST_ASSERT_EQUAL_FLOAT(expected, actual, line, message) UNITY_TEST_ASSERT_FLOAT_WITHIN((UNITY_FLOAT)(expected) * (UNITY_FLOAT)UNITY_FLOAT_PRECISION, (UNITY_FLOAT)(expected), (UNITY_FLOAT)(actual), (UNITY_LINE_TYPE)(line), (message)) -#define UNITY_TEST_ASSERT_EQUAL_FLOAT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualFloatArray((UNITY_FLOAT*)(expected), (UNITY_FLOAT*)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_ARRAY) -#define UNITY_TEST_ASSERT_EACH_EQUAL_FLOAT(expected, actual, num_elements, line, message) UnityAssertEqualFloatArray(UnityFloatToPtr(expected), (UNITY_FLOAT*)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_VAL) -#define UNITY_TEST_ASSERT_FLOAT_IS_INF(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_INF) -#define UNITY_TEST_ASSERT_FLOAT_IS_NEG_INF(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NEG_INF) -#define UNITY_TEST_ASSERT_FLOAT_IS_NAN(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NAN) -#define UNITY_TEST_ASSERT_FLOAT_IS_DETERMINATE(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_DET) -#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_INF(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_INF) -#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NEG_INF(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_NEG_INF) -#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NAN(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_NAN) -#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_DET) -#endif - -#ifdef UNITY_EXCLUDE_DOUBLE -#define UNITY_TEST_ASSERT_DOUBLE_WITHIN(delta, expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) -#define UNITY_TEST_ASSERT_EQUAL_DOUBLE(expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) -#define UNITY_TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) -#define UNITY_TEST_ASSERT_EACH_EQUAL_DOUBLE(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) -#define UNITY_TEST_ASSERT_DOUBLE_IS_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) -#define UNITY_TEST_ASSERT_DOUBLE_IS_NEG_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) -#define UNITY_TEST_ASSERT_DOUBLE_IS_NAN(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) -#define UNITY_TEST_ASSERT_DOUBLE_IS_DETERMINATE(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) -#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) -#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) -#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NAN(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) -#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) -#else -#define UNITY_TEST_ASSERT_DOUBLE_WITHIN(delta, expected, actual, line, message) UnityAssertDoublesWithin((UNITY_DOUBLE)(delta), (UNITY_DOUBLE)(expected), (UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)line) -#define UNITY_TEST_ASSERT_EQUAL_DOUBLE(expected, actual, line, message) UNITY_TEST_ASSERT_DOUBLE_WITHIN((UNITY_DOUBLE)(expected) * (UNITY_DOUBLE)UNITY_DOUBLE_PRECISION, (UNITY_DOUBLE)expected, (UNITY_DOUBLE)actual, (UNITY_LINE_TYPE)(line), message) -#define UNITY_TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualDoubleArray((UNITY_DOUBLE*)(expected), (UNITY_DOUBLE*)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_ARRAY_TO_ARRAY) -#define UNITY_TEST_ASSERT_EACH_EQUAL_DOUBLE(expected, actual, num_elements, line, message) UnityAssertEqualDoubleArray(UnityDoubleToPtr(expected), (UNITY_DOUBLE*)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_ARRAY_TO_VAL) -#define UNITY_TEST_ASSERT_DOUBLE_IS_INF(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_INF) -#define UNITY_TEST_ASSERT_DOUBLE_IS_NEG_INF(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NEG_INF) -#define UNITY_TEST_ASSERT_DOUBLE_IS_NAN(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NAN) -#define UNITY_TEST_ASSERT_DOUBLE_IS_DETERMINATE(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_DET) -#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_INF(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_INF) -#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_NEG_INF) -#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NAN(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_NAN) -#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_DET) -#endif - -/* End of UNITY_INTERNALS_H */ -#endif diff --git a/tools/sdk/include/json/tests/unity/test/expectdata/testsample_head1.h b/tools/sdk/include/json/tests/unity/test/expectdata/testsample_head1.h deleted file mode 100644 index da6b7ab26bb..00000000000 --- a/tools/sdk/include/json/tests/unity/test/expectdata/testsample_head1.h +++ /dev/null @@ -1,15 +0,0 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ -#ifndef _TESTSAMPLE_HEAD1_H -#define _TESTSAMPLE_HEAD1_H - -#include "unity.h" -#include "funky.h" -#include "stanky.h" -#include - -void test_TheFirstThingToTest(void); -void test_TheSecondThingToTest(void); -void test_TheThirdThingToTest(void); -void test_TheFourthThingToTest(void); -#endif - diff --git a/tools/sdk/include/json/tests/unity/test/expectdata/testsample_mock_head1.h b/tools/sdk/include/json/tests/unity/test/expectdata/testsample_mock_head1.h deleted file mode 100644 index 30c509ad077..00000000000 --- a/tools/sdk/include/json/tests/unity/test/expectdata/testsample_mock_head1.h +++ /dev/null @@ -1,13 +0,0 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ -#ifndef _TESTSAMPLE_MOCK_HEAD1_H -#define _TESTSAMPLE_MOCK_HEAD1_H - -#include "unity.h" -#include "cmock.h" -#include "funky.h" -#include - -void test_TheFirstThingToTest(void); -void test_TheSecondThingToTest(void); -#endif - diff --git a/tools/sdk/include/json/tests/unity/test/testdata/CException.h b/tools/sdk/include/json/tests/unity/test/testdata/CException.h deleted file mode 100644 index 91ad3e1bf22..00000000000 --- a/tools/sdk/include/json/tests/unity/test/testdata/CException.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef CEXCEPTION_H -#define CEXCEPTION_H - -#define CEXCEPTION_BEING_USED 1 - -#define CEXCEPTION_NONE 0 -#define CEXCEPTION_T int e = 1; (void) -#define Try if (e) -#define Catch(a) if (!a) - -#endif //CEXCEPTION_H diff --git a/tools/sdk/include/json/tests/unity/test/testdata/Defs.h b/tools/sdk/include/json/tests/unity/test/testdata/Defs.h deleted file mode 100644 index d3a90c0d506..00000000000 --- a/tools/sdk/include/json/tests/unity/test/testdata/Defs.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef DEF_H -#define DEF_H - -#define EXTERN_DECL - -extern int CounterSuiteSetup; - -#endif //DEF_H diff --git a/tools/sdk/include/json/tests/unity/test/testdata/cmock.h b/tools/sdk/include/json/tests/unity/test/testdata/cmock.h deleted file mode 100644 index c6149be1b01..00000000000 --- a/tools/sdk/include/json/tests/unity/test/testdata/cmock.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef CMOCK_H -#define CMOCK_H - -int CMockMemFreeFinalCounter = 0; -int mockMock_Init_Counter = 0; -int mockMock_Verify_Counter = 0; -int mockMock_Destroy_Counter = 0; - -void CMock_Guts_MemFreeFinal(void) { CMockMemFreeFinalCounter++; } -void mockMock_Init(void) { mockMock_Init_Counter++; } -void mockMock_Verify(void) { mockMock_Verify_Counter++; } -void mockMock_Destroy(void) { mockMock_Destroy_Counter++; } - -#endif //CMOCK_H diff --git a/tools/sdk/include/json/tests/unity/test/testdata/mockMock.h b/tools/sdk/include/json/tests/unity/test/testdata/mockMock.h deleted file mode 100644 index 0a2c616f797..00000000000 --- a/tools/sdk/include/json/tests/unity/test/testdata/mockMock.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef MOCK_MOCK_H -#define MOCK_MOCK_H - -extern int mockMock_Init_Counter; -extern int mockMock_Verify_Counter; -extern int mockMock_Destroy_Counter; -extern int CMockMemFreeFinalCounter; - -void mockMock_Init(void); -void mockMock_Verify(void); -void mockMock_Destroy(void); - -#endif //MOCK_MOCK_H diff --git a/tools/sdk/include/libsodium/sodium.h b/tools/sdk/include/libsodium/sodium.h deleted file mode 100644 index d0bb25c8741..00000000000 --- a/tools/sdk/include/libsodium/sodium.h +++ /dev/null @@ -1,68 +0,0 @@ - -#ifndef sodium_H -#define sodium_H - -#include "sodium/version.h" - -#include "sodium/core.h" -#include "sodium/crypto_aead_aes256gcm.h" -#include "sodium/crypto_aead_chacha20poly1305.h" -#include "sodium/crypto_aead_xchacha20poly1305.h" -#include "sodium/crypto_auth.h" -#include "sodium/crypto_auth_hmacsha256.h" -#include "sodium/crypto_auth_hmacsha512.h" -#include "sodium/crypto_auth_hmacsha512256.h" -#include "sodium/crypto_box.h" -#include "sodium/crypto_box_curve25519xsalsa20poly1305.h" -#include "sodium/crypto_core_hsalsa20.h" -#include "sodium/crypto_core_hchacha20.h" -#include "sodium/crypto_core_salsa20.h" -#include "sodium/crypto_core_salsa2012.h" -#include "sodium/crypto_core_salsa208.h" -#include "sodium/crypto_generichash.h" -#include "sodium/crypto_generichash_blake2b.h" -#include "sodium/crypto_hash.h" -#include "sodium/crypto_hash_sha256.h" -#include "sodium/crypto_hash_sha512.h" -#include "sodium/crypto_kdf.h" -#include "sodium/crypto_kdf_blake2b.h" -#include "sodium/crypto_kx.h" -#include "sodium/crypto_onetimeauth.h" -#include "sodium/crypto_onetimeauth_poly1305.h" -#include "sodium/crypto_pwhash.h" -#include "sodium/crypto_pwhash_argon2i.h" -#include "sodium/crypto_pwhash_scryptsalsa208sha256.h" -#include "sodium/crypto_scalarmult.h" -#include "sodium/crypto_scalarmult_curve25519.h" -#include "sodium/crypto_secretbox.h" -#include "sodium/crypto_secretbox_xsalsa20poly1305.h" -#include "sodium/crypto_shorthash.h" -#include "sodium/crypto_shorthash_siphash24.h" -#include "sodium/crypto_sign.h" -#include "sodium/crypto_sign_ed25519.h" -#include "sodium/crypto_stream.h" -#include "sodium/crypto_stream_chacha20.h" -#include "sodium/crypto_stream_salsa20.h" -#include "sodium/crypto_stream_xsalsa20.h" -#include "sodium/crypto_verify_16.h" -#include "sodium/crypto_verify_32.h" -#include "sodium/crypto_verify_64.h" -#include "sodium/randombytes.h" -#ifdef __native_client__ -# include "sodium/randombytes_nativeclient.h" -#endif -#include "sodium/randombytes_salsa20_random.h" -#include "sodium/randombytes_sysrandom.h" -#include "sodium/runtime.h" -#include "sodium/utils.h" - -#ifndef SODIUM_LIBRARY_MINIMAL -# include "sodium/crypto_box_curve25519xchacha20poly1305.h" -# include "sodium/crypto_secretbox_xchacha20poly1305.h" -# include "sodium/crypto_stream_aes128ctr.h" -# include "sodium/crypto_stream_salsa2012.h" -# include "sodium/crypto_stream_salsa208.h" -# include "sodium/crypto_stream_xchacha20.h" -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/core.h b/tools/sdk/include/libsodium/sodium/core.h deleted file mode 100644 index 3ca447628e4..00000000000 --- a/tools/sdk/include/libsodium/sodium/core.h +++ /dev/null @@ -1,19 +0,0 @@ - -#ifndef sodium_core_H -#define sodium_core_H - -#include "export.h" - -#ifdef __cplusplus -extern "C" { -#endif - -SODIUM_EXPORT -int sodium_init(void) - __attribute__ ((warn_unused_result)); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_aead_aes256gcm.h b/tools/sdk/include/libsodium/sodium/crypto_aead_aes256gcm.h deleted file mode 100644 index 972df54f6ec..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_aead_aes256gcm.h +++ /dev/null @@ -1,145 +0,0 @@ -#ifndef crypto_aead_aes256gcm_H -#define crypto_aead_aes256gcm_H - -#include -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -SODIUM_EXPORT -int crypto_aead_aes256gcm_is_available(void); - -#define crypto_aead_aes256gcm_KEYBYTES 32U -SODIUM_EXPORT -size_t crypto_aead_aes256gcm_keybytes(void); - -#define crypto_aead_aes256gcm_NSECBYTES 0U -SODIUM_EXPORT -size_t crypto_aead_aes256gcm_nsecbytes(void); - -#define crypto_aead_aes256gcm_NPUBBYTES 12U -SODIUM_EXPORT -size_t crypto_aead_aes256gcm_npubbytes(void); - -#define crypto_aead_aes256gcm_ABYTES 16U -SODIUM_EXPORT -size_t crypto_aead_aes256gcm_abytes(void); - -typedef CRYPTO_ALIGN(16) unsigned char crypto_aead_aes256gcm_state[512]; - -SODIUM_EXPORT -size_t crypto_aead_aes256gcm_statebytes(void); - -SODIUM_EXPORT -int crypto_aead_aes256gcm_encrypt(unsigned char *c, - unsigned long long *clen_p, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *nsec, - const unsigned char *npub, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_aead_aes256gcm_decrypt(unsigned char *m, - unsigned long long *mlen_p, - unsigned char *nsec, - const unsigned char *c, - unsigned long long clen, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *npub, - const unsigned char *k) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_aead_aes256gcm_encrypt_detached(unsigned char *c, - unsigned char *mac, - unsigned long long *maclen_p, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *nsec, - const unsigned char *npub, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_aead_aes256gcm_decrypt_detached(unsigned char *m, - unsigned char *nsec, - const unsigned char *c, - unsigned long long clen, - const unsigned char *mac, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *npub, - const unsigned char *k) - __attribute__ ((warn_unused_result)); - -/* -- Precomputation interface -- */ - -SODIUM_EXPORT -int crypto_aead_aes256gcm_beforenm(crypto_aead_aes256gcm_state *ctx_, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_aead_aes256gcm_encrypt_afternm(unsigned char *c, - unsigned long long *clen_p, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *nsec, - const unsigned char *npub, - const crypto_aead_aes256gcm_state *ctx_); - -SODIUM_EXPORT -int crypto_aead_aes256gcm_decrypt_afternm(unsigned char *m, - unsigned long long *mlen_p, - unsigned char *nsec, - const unsigned char *c, - unsigned long long clen, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *npub, - const crypto_aead_aes256gcm_state *ctx_) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_aead_aes256gcm_encrypt_detached_afternm(unsigned char *c, - unsigned char *mac, - unsigned long long *maclen_p, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *nsec, - const unsigned char *npub, - const crypto_aead_aes256gcm_state *ctx_); - -SODIUM_EXPORT -int crypto_aead_aes256gcm_decrypt_detached_afternm(unsigned char *m, - unsigned char *nsec, - const unsigned char *c, - unsigned long long clen, - const unsigned char *mac, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *npub, - const crypto_aead_aes256gcm_state *ctx_) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -void crypto_aead_aes256gcm_keygen(unsigned char k[crypto_aead_aes256gcm_KEYBYTES]); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_aead_chacha20poly1305.h b/tools/sdk/include/libsodium/sodium/crypto_aead_chacha20poly1305.h deleted file mode 100644 index 0bbc6885934..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_aead_chacha20poly1305.h +++ /dev/null @@ -1,162 +0,0 @@ -#ifndef crypto_aead_chacha20poly1305_H -#define crypto_aead_chacha20poly1305_H - -#include -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -/* -- IETF ChaCha20-Poly1305 construction with a 96-bit nonce and a 32-bit internal counter -- */ - -#define crypto_aead_chacha20poly1305_ietf_KEYBYTES 32U -SODIUM_EXPORT -size_t crypto_aead_chacha20poly1305_ietf_keybytes(void); - -#define crypto_aead_chacha20poly1305_ietf_NSECBYTES 0U -SODIUM_EXPORT -size_t crypto_aead_chacha20poly1305_ietf_nsecbytes(void); - -#define crypto_aead_chacha20poly1305_ietf_NPUBBYTES 12U - -SODIUM_EXPORT -size_t crypto_aead_chacha20poly1305_ietf_npubbytes(void); - -#define crypto_aead_chacha20poly1305_ietf_ABYTES 16U -SODIUM_EXPORT -size_t crypto_aead_chacha20poly1305_ietf_abytes(void); - -SODIUM_EXPORT -int crypto_aead_chacha20poly1305_ietf_encrypt(unsigned char *c, - unsigned long long *clen_p, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *nsec, - const unsigned char *npub, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_aead_chacha20poly1305_ietf_decrypt(unsigned char *m, - unsigned long long *mlen_p, - unsigned char *nsec, - const unsigned char *c, - unsigned long long clen, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *npub, - const unsigned char *k) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_aead_chacha20poly1305_ietf_encrypt_detached(unsigned char *c, - unsigned char *mac, - unsigned long long *maclen_p, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *nsec, - const unsigned char *npub, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_aead_chacha20poly1305_ietf_decrypt_detached(unsigned char *m, - unsigned char *nsec, - const unsigned char *c, - unsigned long long clen, - const unsigned char *mac, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *npub, - const unsigned char *k) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -void crypto_aead_chacha20poly1305_ietf_keygen(unsigned char k[crypto_aead_chacha20poly1305_ietf_KEYBYTES]); - -/* -- Original ChaCha20-Poly1305 construction with a 64-bit nonce and a 64-bit internal counter -- */ - -#define crypto_aead_chacha20poly1305_KEYBYTES 32U -SODIUM_EXPORT -size_t crypto_aead_chacha20poly1305_keybytes(void); - -#define crypto_aead_chacha20poly1305_NSECBYTES 0U -SODIUM_EXPORT -size_t crypto_aead_chacha20poly1305_nsecbytes(void); - -#define crypto_aead_chacha20poly1305_NPUBBYTES 8U -SODIUM_EXPORT -size_t crypto_aead_chacha20poly1305_npubbytes(void); - -#define crypto_aead_chacha20poly1305_ABYTES 16U -SODIUM_EXPORT -size_t crypto_aead_chacha20poly1305_abytes(void); - -SODIUM_EXPORT -int crypto_aead_chacha20poly1305_encrypt(unsigned char *c, - unsigned long long *clen_p, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *nsec, - const unsigned char *npub, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_aead_chacha20poly1305_decrypt(unsigned char *m, - unsigned long long *mlen_p, - unsigned char *nsec, - const unsigned char *c, - unsigned long long clen, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *npub, - const unsigned char *k) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_aead_chacha20poly1305_encrypt_detached(unsigned char *c, - unsigned char *mac, - unsigned long long *maclen_p, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *nsec, - const unsigned char *npub, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_aead_chacha20poly1305_decrypt_detached(unsigned char *m, - unsigned char *nsec, - const unsigned char *c, - unsigned long long clen, - const unsigned char *mac, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *npub, - const unsigned char *k) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -void crypto_aead_chacha20poly1305_keygen(unsigned char k[crypto_aead_chacha20poly1305_KEYBYTES]); - -/* Aliases */ - -#define crypto_aead_chacha20poly1305_IETF_KEYBYTES crypto_aead_chacha20poly1305_ietf_KEYBYTES -#define crypto_aead_chacha20poly1305_IETF_NSECBYTES crypto_aead_chacha20poly1305_ietf_NSECBYTES -#define crypto_aead_chacha20poly1305_IETF_NPUBBYTES crypto_aead_chacha20poly1305_ietf_NPUBBYTES -#define crypto_aead_chacha20poly1305_IETF_ABYTES crypto_aead_chacha20poly1305_ietf_ABYTES - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_aead_xchacha20poly1305.h b/tools/sdk/include/libsodium/sodium/crypto_aead_xchacha20poly1305.h deleted file mode 100644 index f863ce88ca2..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_aead_xchacha20poly1305.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef crypto_aead_xchacha20poly1305_H -#define crypto_aead_xchacha20poly1305_H - -#include -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_aead_xchacha20poly1305_ietf_KEYBYTES 32U -SODIUM_EXPORT -size_t crypto_aead_xchacha20poly1305_ietf_keybytes(void); - -#define crypto_aead_xchacha20poly1305_ietf_NSECBYTES 0U -SODIUM_EXPORT -size_t crypto_aead_xchacha20poly1305_ietf_nsecbytes(void); - -#define crypto_aead_xchacha20poly1305_ietf_NPUBBYTES 24U -SODIUM_EXPORT -size_t crypto_aead_xchacha20poly1305_ietf_npubbytes(void); - -#define crypto_aead_xchacha20poly1305_ietf_ABYTES 16U -SODIUM_EXPORT -size_t crypto_aead_xchacha20poly1305_ietf_abytes(void); - -SODIUM_EXPORT -int crypto_aead_xchacha20poly1305_ietf_encrypt(unsigned char *c, - unsigned long long *clen_p, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *nsec, - const unsigned char *npub, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_aead_xchacha20poly1305_ietf_decrypt(unsigned char *m, - unsigned long long *mlen_p, - unsigned char *nsec, - const unsigned char *c, - unsigned long long clen, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *npub, - const unsigned char *k) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_aead_xchacha20poly1305_ietf_encrypt_detached(unsigned char *c, - unsigned char *mac, - unsigned long long *maclen_p, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *nsec, - const unsigned char *npub, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_aead_xchacha20poly1305_ietf_decrypt_detached(unsigned char *m, - unsigned char *nsec, - const unsigned char *c, - unsigned long long clen, - const unsigned char *mac, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *npub, - const unsigned char *k) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -void crypto_aead_xchacha20poly1305_ietf_keygen(unsigned char k[crypto_aead_xchacha20poly1305_ietf_KEYBYTES]); - -/* Aliases */ - -#define crypto_aead_xchacha20poly1305_IETF_KEYBYTES crypto_aead_xchacha20poly1305_ietf_KEYBYTES -#define crypto_aead_xchacha20poly1305_IETF_NSECBYTES crypto_aead_xchacha20poly1305_ietf_NSECBYTES -#define crypto_aead_xchacha20poly1305_IETF_NPUBBYTES crypto_aead_xchacha20poly1305_ietf_NPUBBYTES -#define crypto_aead_xchacha20poly1305_IETF_ABYTES crypto_aead_xchacha20poly1305_ietf_ABYTES - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_auth.h b/tools/sdk/include/libsodium/sodium/crypto_auth.h deleted file mode 100644 index 7174e7bcedd..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_auth.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef crypto_auth_H -#define crypto_auth_H - -#include - -#include "crypto_auth_hmacsha512256.h" -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_auth_BYTES crypto_auth_hmacsha512256_BYTES -SODIUM_EXPORT -size_t crypto_auth_bytes(void); - -#define crypto_auth_KEYBYTES crypto_auth_hmacsha512256_KEYBYTES -SODIUM_EXPORT -size_t crypto_auth_keybytes(void); - -#define crypto_auth_PRIMITIVE "hmacsha512256" -SODIUM_EXPORT -const char *crypto_auth_primitive(void); - -SODIUM_EXPORT -int crypto_auth(unsigned char *out, const unsigned char *in, - unsigned long long inlen, const unsigned char *k); - -SODIUM_EXPORT -int crypto_auth_verify(const unsigned char *h, const unsigned char *in, - unsigned long long inlen, const unsigned char *k) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -void crypto_auth_keygen(unsigned char k[crypto_auth_KEYBYTES]); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_auth_hmacsha256.h b/tools/sdk/include/libsodium/sodium/crypto_auth_hmacsha256.h deleted file mode 100644 index deec5266e68..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_auth_hmacsha256.h +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef crypto_auth_hmacsha256_H -#define crypto_auth_hmacsha256_H - -#include -#include "crypto_hash_sha256.h" -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_auth_hmacsha256_BYTES 32U -SODIUM_EXPORT -size_t crypto_auth_hmacsha256_bytes(void); - -#define crypto_auth_hmacsha256_KEYBYTES 32U -SODIUM_EXPORT -size_t crypto_auth_hmacsha256_keybytes(void); - -SODIUM_EXPORT -int crypto_auth_hmacsha256(unsigned char *out, - const unsigned char *in, - unsigned long long inlen, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_auth_hmacsha256_verify(const unsigned char *h, - const unsigned char *in, - unsigned long long inlen, - const unsigned char *k) - __attribute__ ((warn_unused_result)); - -/* ------------------------------------------------------------------------- */ - -typedef struct crypto_auth_hmacsha256_state { - crypto_hash_sha256_state ictx; - crypto_hash_sha256_state octx; -} crypto_auth_hmacsha256_state; - -SODIUM_EXPORT -size_t crypto_auth_hmacsha256_statebytes(void); - -SODIUM_EXPORT -int crypto_auth_hmacsha256_init(crypto_auth_hmacsha256_state *state, - const unsigned char *key, - size_t keylen); - -SODIUM_EXPORT -int crypto_auth_hmacsha256_update(crypto_auth_hmacsha256_state *state, - const unsigned char *in, - unsigned long long inlen); - -SODIUM_EXPORT -int crypto_auth_hmacsha256_final(crypto_auth_hmacsha256_state *state, - unsigned char *out); - - -SODIUM_EXPORT -void crypto_auth_hmacsha256_keygen(unsigned char k[crypto_auth_hmacsha256_KEYBYTES]); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_auth_hmacsha512.h b/tools/sdk/include/libsodium/sodium/crypto_auth_hmacsha512.h deleted file mode 100644 index 77a55fbc008..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_auth_hmacsha512.h +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef crypto_auth_hmacsha512_H -#define crypto_auth_hmacsha512_H - -#include -#include "crypto_hash_sha512.h" -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_auth_hmacsha512_BYTES 64U -SODIUM_EXPORT -size_t crypto_auth_hmacsha512_bytes(void); - -#define crypto_auth_hmacsha512_KEYBYTES 32U -SODIUM_EXPORT -size_t crypto_auth_hmacsha512_keybytes(void); - -SODIUM_EXPORT -int crypto_auth_hmacsha512(unsigned char *out, - const unsigned char *in, - unsigned long long inlen, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_auth_hmacsha512_verify(const unsigned char *h, - const unsigned char *in, - unsigned long long inlen, - const unsigned char *k) - __attribute__ ((warn_unused_result)); - -/* ------------------------------------------------------------------------- */ - -typedef struct crypto_auth_hmacsha512_state { - crypto_hash_sha512_state ictx; - crypto_hash_sha512_state octx; -} crypto_auth_hmacsha512_state; - -SODIUM_EXPORT -size_t crypto_auth_hmacsha512_statebytes(void); - -SODIUM_EXPORT -int crypto_auth_hmacsha512_init(crypto_auth_hmacsha512_state *state, - const unsigned char *key, - size_t keylen); - -SODIUM_EXPORT -int crypto_auth_hmacsha512_update(crypto_auth_hmacsha512_state *state, - const unsigned char *in, - unsigned long long inlen); - -SODIUM_EXPORT -int crypto_auth_hmacsha512_final(crypto_auth_hmacsha512_state *state, - unsigned char *out); - -SODIUM_EXPORT -void crypto_auth_hmacsha512_keygen(unsigned char k[crypto_auth_hmacsha512_KEYBYTES]); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_auth_hmacsha512256.h b/tools/sdk/include/libsodium/sodium/crypto_auth_hmacsha512256.h deleted file mode 100644 index 4842f3debc7..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_auth_hmacsha512256.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef crypto_auth_hmacsha512256_H -#define crypto_auth_hmacsha512256_H - -#include -#include "crypto_auth_hmacsha512.h" -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_auth_hmacsha512256_BYTES 32U -SODIUM_EXPORT -size_t crypto_auth_hmacsha512256_bytes(void); - -#define crypto_auth_hmacsha512256_KEYBYTES 32U -SODIUM_EXPORT -size_t crypto_auth_hmacsha512256_keybytes(void); - -SODIUM_EXPORT -int crypto_auth_hmacsha512256(unsigned char *out, const unsigned char *in, - unsigned long long inlen,const unsigned char *k); - -SODIUM_EXPORT -int crypto_auth_hmacsha512256_verify(const unsigned char *h, - const unsigned char *in, - unsigned long long inlen, - const unsigned char *k) - __attribute__ ((warn_unused_result)); - -/* ------------------------------------------------------------------------- */ - -typedef crypto_auth_hmacsha512_state crypto_auth_hmacsha512256_state; - -SODIUM_EXPORT -size_t crypto_auth_hmacsha512256_statebytes(void); - -SODIUM_EXPORT -int crypto_auth_hmacsha512256_init(crypto_auth_hmacsha512256_state *state, - const unsigned char *key, - size_t keylen); - -SODIUM_EXPORT -int crypto_auth_hmacsha512256_update(crypto_auth_hmacsha512256_state *state, - const unsigned char *in, - unsigned long long inlen); - -SODIUM_EXPORT -int crypto_auth_hmacsha512256_final(crypto_auth_hmacsha512256_state *state, - unsigned char *out); - -SODIUM_EXPORT -void crypto_auth_hmacsha512256_keygen(unsigned char k[crypto_auth_hmacsha512256_KEYBYTES]); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_box.h b/tools/sdk/include/libsodium/sodium/crypto_box.h deleted file mode 100644 index 614cd1e0ac1..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_box.h +++ /dev/null @@ -1,169 +0,0 @@ -#ifndef crypto_box_H -#define crypto_box_H - -/* - * THREAD SAFETY: crypto_box_keypair() is thread-safe, - * provided that sodium_init() was called before. - * - * Other functions are always thread-safe. - */ - -#include - -#include "crypto_box_curve25519xsalsa20poly1305.h" -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_box_SEEDBYTES crypto_box_curve25519xsalsa20poly1305_SEEDBYTES -SODIUM_EXPORT -size_t crypto_box_seedbytes(void); - -#define crypto_box_PUBLICKEYBYTES crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES -SODIUM_EXPORT -size_t crypto_box_publickeybytes(void); - -#define crypto_box_SECRETKEYBYTES crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES -SODIUM_EXPORT -size_t crypto_box_secretkeybytes(void); - -#define crypto_box_NONCEBYTES crypto_box_curve25519xsalsa20poly1305_NONCEBYTES -SODIUM_EXPORT -size_t crypto_box_noncebytes(void); - -#define crypto_box_MACBYTES crypto_box_curve25519xsalsa20poly1305_MACBYTES -SODIUM_EXPORT -size_t crypto_box_macbytes(void); - -#define crypto_box_PRIMITIVE "curve25519xsalsa20poly1305" -SODIUM_EXPORT -const char *crypto_box_primitive(void); - -SODIUM_EXPORT -int crypto_box_seed_keypair(unsigned char *pk, unsigned char *sk, - const unsigned char *seed); - -SODIUM_EXPORT -int crypto_box_keypair(unsigned char *pk, unsigned char *sk); - -SODIUM_EXPORT -int crypto_box_easy(unsigned char *c, const unsigned char *m, - unsigned long long mlen, const unsigned char *n, - const unsigned char *pk, const unsigned char *sk) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_box_open_easy(unsigned char *m, const unsigned char *c, - unsigned long long clen, const unsigned char *n, - const unsigned char *pk, const unsigned char *sk) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_box_detached(unsigned char *c, unsigned char *mac, - const unsigned char *m, unsigned long long mlen, - const unsigned char *n, const unsigned char *pk, - const unsigned char *sk) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_box_open_detached(unsigned char *m, const unsigned char *c, - const unsigned char *mac, - unsigned long long clen, - const unsigned char *n, - const unsigned char *pk, - const unsigned char *sk) - __attribute__ ((warn_unused_result)); - -/* -- Precomputation interface -- */ - -#define crypto_box_BEFORENMBYTES crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES -SODIUM_EXPORT -size_t crypto_box_beforenmbytes(void); - -SODIUM_EXPORT -int crypto_box_beforenm(unsigned char *k, const unsigned char *pk, - const unsigned char *sk) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_box_easy_afternm(unsigned char *c, const unsigned char *m, - unsigned long long mlen, const unsigned char *n, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_box_open_easy_afternm(unsigned char *m, const unsigned char *c, - unsigned long long clen, const unsigned char *n, - const unsigned char *k) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_box_detached_afternm(unsigned char *c, unsigned char *mac, - const unsigned char *m, unsigned long long mlen, - const unsigned char *n, const unsigned char *k); - -SODIUM_EXPORT -int crypto_box_open_detached_afternm(unsigned char *m, const unsigned char *c, - const unsigned char *mac, - unsigned long long clen, const unsigned char *n, - const unsigned char *k) - __attribute__ ((warn_unused_result)); - -/* -- Ephemeral SK interface -- */ - -#define crypto_box_SEALBYTES (crypto_box_PUBLICKEYBYTES + crypto_box_MACBYTES) -SODIUM_EXPORT -size_t crypto_box_sealbytes(void); - -SODIUM_EXPORT -int crypto_box_seal(unsigned char *c, const unsigned char *m, - unsigned long long mlen, const unsigned char *pk); - -SODIUM_EXPORT -int crypto_box_seal_open(unsigned char *m, const unsigned char *c, - unsigned long long clen, - const unsigned char *pk, const unsigned char *sk) - __attribute__ ((warn_unused_result)); - -/* -- NaCl compatibility interface ; Requires padding -- */ - -#define crypto_box_ZEROBYTES crypto_box_curve25519xsalsa20poly1305_ZEROBYTES -SODIUM_EXPORT -size_t crypto_box_zerobytes(void); - -#define crypto_box_BOXZEROBYTES crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES -SODIUM_EXPORT -size_t crypto_box_boxzerobytes(void); - -SODIUM_EXPORT -int crypto_box(unsigned char *c, const unsigned char *m, - unsigned long long mlen, const unsigned char *n, - const unsigned char *pk, const unsigned char *sk) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_box_open(unsigned char *m, const unsigned char *c, - unsigned long long clen, const unsigned char *n, - const unsigned char *pk, const unsigned char *sk) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_box_afternm(unsigned char *c, const unsigned char *m, - unsigned long long mlen, const unsigned char *n, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_box_open_afternm(unsigned char *m, const unsigned char *c, - unsigned long long clen, const unsigned char *n, - const unsigned char *k) - __attribute__ ((warn_unused_result)); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_box_curve25519xchacha20poly1305.h b/tools/sdk/include/libsodium/sodium/crypto_box_curve25519xchacha20poly1305.h deleted file mode 100644 index 29c9b255202..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_box_curve25519xchacha20poly1305.h +++ /dev/null @@ -1,130 +0,0 @@ - -#ifndef crypto_box_curve25519xchacha20poly1305_H -#define crypto_box_curve25519xchacha20poly1305_H - -#include -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_box_curve25519xchacha20poly1305_SEEDBYTES 32U -SODIUM_EXPORT -size_t crypto_box_curve25519xchacha20poly1305_seedbytes(void); - -#define crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES 32U -SODIUM_EXPORT -size_t crypto_box_curve25519xchacha20poly1305_publickeybytes(void); - -#define crypto_box_curve25519xchacha20poly1305_SECRETKEYBYTES 32U -SODIUM_EXPORT -size_t crypto_box_curve25519xchacha20poly1305_secretkeybytes(void); - -#define crypto_box_curve25519xchacha20poly1305_BEFORENMBYTES 32U -SODIUM_EXPORT -size_t crypto_box_curve25519xchacha20poly1305_beforenmbytes(void); - -#define crypto_box_curve25519xchacha20poly1305_NONCEBYTES 24U -SODIUM_EXPORT -size_t crypto_box_curve25519xchacha20poly1305_noncebytes(void); - -#define crypto_box_curve25519xchacha20poly1305_MACBYTES 16U -SODIUM_EXPORT -size_t crypto_box_curve25519xchacha20poly1305_macbytes(void); - -SODIUM_EXPORT -int crypto_box_curve25519xchacha20poly1305_seed_keypair(unsigned char *pk, - unsigned char *sk, - const unsigned char *seed); - -SODIUM_EXPORT -int crypto_box_curve25519xchacha20poly1305_keypair(unsigned char *pk, - unsigned char *sk); - -SODIUM_EXPORT -int crypto_box_curve25519xchacha20poly1305_easy(unsigned char *c, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *n, - const unsigned char *pk, - const unsigned char *sk) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_box_curve25519xchacha20poly1305_open_easy(unsigned char *m, - const unsigned char *c, - unsigned long long clen, - const unsigned char *n, - const unsigned char *pk, - const unsigned char *sk) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_box_curve25519xchacha20poly1305_detached(unsigned char *c, - unsigned char *mac, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *n, - const unsigned char *pk, - const unsigned char *sk) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_box_curve25519xchacha20poly1305_open_detached(unsigned char *m, - const unsigned char *c, - const unsigned char *mac, - unsigned long long clen, - const unsigned char *n, - const unsigned char *pk, - const unsigned char *sk) - __attribute__ ((warn_unused_result)); - -/* -- Precomputation interface -- */ - -SODIUM_EXPORT -int crypto_box_curve25519xchacha20poly1305_beforenm(unsigned char *k, - const unsigned char *pk, - const unsigned char *sk) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_box_curve25519xchacha20poly1305_easy_afternm(unsigned char *c, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *n, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_box_curve25519xchacha20poly1305_open_easy_afternm(unsigned char *m, - const unsigned char *c, - unsigned long long clen, - const unsigned char *n, - const unsigned char *k) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_box_curve25519xchacha20poly1305_detached_afternm(unsigned char *c, - unsigned char *mac, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *n, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_box_curve25519xchacha20poly1305_open_detached_afternm(unsigned char *m, - const unsigned char *c, - const unsigned char *mac, - unsigned long long clen, - const unsigned char *n, - const unsigned char *k) - __attribute__ ((warn_unused_result)); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_box_curve25519xsalsa20poly1305.h b/tools/sdk/include/libsodium/sodium/crypto_box_curve25519xsalsa20poly1305.h deleted file mode 100644 index 9b5a39c3fa4..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_box_curve25519xsalsa20poly1305.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef crypto_box_curve25519xsalsa20poly1305_H -#define crypto_box_curve25519xsalsa20poly1305_H - -#include -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_box_curve25519xsalsa20poly1305_SEEDBYTES 32U -SODIUM_EXPORT -size_t crypto_box_curve25519xsalsa20poly1305_seedbytes(void); - -#define crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES 32U -SODIUM_EXPORT -size_t crypto_box_curve25519xsalsa20poly1305_publickeybytes(void); - -#define crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES 32U -SODIUM_EXPORT -size_t crypto_box_curve25519xsalsa20poly1305_secretkeybytes(void); - -#define crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES 32U -SODIUM_EXPORT -size_t crypto_box_curve25519xsalsa20poly1305_beforenmbytes(void); - -#define crypto_box_curve25519xsalsa20poly1305_NONCEBYTES 24U -SODIUM_EXPORT -size_t crypto_box_curve25519xsalsa20poly1305_noncebytes(void); - -#define crypto_box_curve25519xsalsa20poly1305_MACBYTES 16U -SODIUM_EXPORT -size_t crypto_box_curve25519xsalsa20poly1305_macbytes(void); - -#define crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES 16U -SODIUM_EXPORT -size_t crypto_box_curve25519xsalsa20poly1305_boxzerobytes(void); - -#define crypto_box_curve25519xsalsa20poly1305_ZEROBYTES \ - (crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES + \ - crypto_box_curve25519xsalsa20poly1305_MACBYTES) -SODIUM_EXPORT -size_t crypto_box_curve25519xsalsa20poly1305_zerobytes(void); - -SODIUM_EXPORT -int crypto_box_curve25519xsalsa20poly1305(unsigned char *c, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *n, - const unsigned char *pk, - const unsigned char *sk) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_box_curve25519xsalsa20poly1305_open(unsigned char *m, - const unsigned char *c, - unsigned long long clen, - const unsigned char *n, - const unsigned char *pk, - const unsigned char *sk) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_box_curve25519xsalsa20poly1305_seed_keypair(unsigned char *pk, - unsigned char *sk, - const unsigned char *seed); - -SODIUM_EXPORT -int crypto_box_curve25519xsalsa20poly1305_keypair(unsigned char *pk, - unsigned char *sk); - -SODIUM_EXPORT -int crypto_box_curve25519xsalsa20poly1305_beforenm(unsigned char *k, - const unsigned char *pk, - const unsigned char *sk) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_box_curve25519xsalsa20poly1305_afternm(unsigned char *c, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *n, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_box_curve25519xsalsa20poly1305_open_afternm(unsigned char *m, - const unsigned char *c, - unsigned long long clen, - const unsigned char *n, - const unsigned char *k) - __attribute__ ((warn_unused_result)); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_core_hchacha20.h b/tools/sdk/include/libsodium/sodium/crypto_core_hchacha20.h deleted file mode 100644 index 05e5670c10e..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_core_hchacha20.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef crypto_core_hchacha20_H -#define crypto_core_hchacha20_H - -#include -#include "export.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define crypto_core_hchacha20_OUTPUTBYTES 32U -SODIUM_EXPORT -size_t crypto_core_hchacha20_outputbytes(void); - -#define crypto_core_hchacha20_INPUTBYTES 16U -SODIUM_EXPORT -size_t crypto_core_hchacha20_inputbytes(void); - -#define crypto_core_hchacha20_KEYBYTES 32U -SODIUM_EXPORT -size_t crypto_core_hchacha20_keybytes(void); - -#define crypto_core_hchacha20_CONSTBYTES 16U -SODIUM_EXPORT -size_t crypto_core_hchacha20_constbytes(void); - -SODIUM_EXPORT -int crypto_core_hchacha20(unsigned char *out, const unsigned char *in, - const unsigned char *k, const unsigned char *c); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_core_hsalsa20.h b/tools/sdk/include/libsodium/sodium/crypto_core_hsalsa20.h deleted file mode 100644 index 82e475b8f67..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_core_hsalsa20.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef crypto_core_hsalsa20_H -#define crypto_core_hsalsa20_H - -#include -#include "export.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define crypto_core_hsalsa20_OUTPUTBYTES 32U -SODIUM_EXPORT -size_t crypto_core_hsalsa20_outputbytes(void); - -#define crypto_core_hsalsa20_INPUTBYTES 16U -SODIUM_EXPORT -size_t crypto_core_hsalsa20_inputbytes(void); - -#define crypto_core_hsalsa20_KEYBYTES 32U -SODIUM_EXPORT -size_t crypto_core_hsalsa20_keybytes(void); - -#define crypto_core_hsalsa20_CONSTBYTES 16U -SODIUM_EXPORT -size_t crypto_core_hsalsa20_constbytes(void); - -SODIUM_EXPORT -int crypto_core_hsalsa20(unsigned char *out, const unsigned char *in, - const unsigned char *k, const unsigned char *c); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_core_salsa20.h b/tools/sdk/include/libsodium/sodium/crypto_core_salsa20.h deleted file mode 100644 index 160cc56d2c4..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_core_salsa20.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef crypto_core_salsa20_H -#define crypto_core_salsa20_H - -#include -#include "export.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define crypto_core_salsa20_OUTPUTBYTES 64U -SODIUM_EXPORT -size_t crypto_core_salsa20_outputbytes(void); - -#define crypto_core_salsa20_INPUTBYTES 16U -SODIUM_EXPORT -size_t crypto_core_salsa20_inputbytes(void); - -#define crypto_core_salsa20_KEYBYTES 32U -SODIUM_EXPORT -size_t crypto_core_salsa20_keybytes(void); - -#define crypto_core_salsa20_CONSTBYTES 16U -SODIUM_EXPORT -size_t crypto_core_salsa20_constbytes(void); - -SODIUM_EXPORT -int crypto_core_salsa20(unsigned char *out, const unsigned char *in, - const unsigned char *k, const unsigned char *c); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_core_salsa2012.h b/tools/sdk/include/libsodium/sodium/crypto_core_salsa2012.h deleted file mode 100644 index bdd5f9fdbb2..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_core_salsa2012.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef crypto_core_salsa2012_H -#define crypto_core_salsa2012_H - -#include -#include "export.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define crypto_core_salsa2012_OUTPUTBYTES 64U -SODIUM_EXPORT -size_t crypto_core_salsa2012_outputbytes(void); - -#define crypto_core_salsa2012_INPUTBYTES 16U -SODIUM_EXPORT -size_t crypto_core_salsa2012_inputbytes(void); - -#define crypto_core_salsa2012_KEYBYTES 32U -SODIUM_EXPORT -size_t crypto_core_salsa2012_keybytes(void); - -#define crypto_core_salsa2012_CONSTBYTES 16U -SODIUM_EXPORT -size_t crypto_core_salsa2012_constbytes(void); - -SODIUM_EXPORT -int crypto_core_salsa2012(unsigned char *out, const unsigned char *in, - const unsigned char *k, const unsigned char *c); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_core_salsa208.h b/tools/sdk/include/libsodium/sodium/crypto_core_salsa208.h deleted file mode 100644 index 3c13efa4ef3..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_core_salsa208.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef crypto_core_salsa208_H -#define crypto_core_salsa208_H - -#include -#include "export.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define crypto_core_salsa208_OUTPUTBYTES 64U -SODIUM_EXPORT -size_t crypto_core_salsa208_outputbytes(void); - -#define crypto_core_salsa208_INPUTBYTES 16U -SODIUM_EXPORT -size_t crypto_core_salsa208_inputbytes(void); - -#define crypto_core_salsa208_KEYBYTES 32U -SODIUM_EXPORT -size_t crypto_core_salsa208_keybytes(void); - -#define crypto_core_salsa208_CONSTBYTES 16U -SODIUM_EXPORT -size_t crypto_core_salsa208_constbytes(void); - -SODIUM_EXPORT -int crypto_core_salsa208(unsigned char *out, const unsigned char *in, - const unsigned char *k, const unsigned char *c); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_generichash.h b/tools/sdk/include/libsodium/sodium/crypto_generichash.h deleted file mode 100644 index 2398fb9dbba..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_generichash.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef crypto_generichash_H -#define crypto_generichash_H - -#include - -#include "crypto_generichash_blake2b.h" -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_generichash_BYTES_MIN crypto_generichash_blake2b_BYTES_MIN -SODIUM_EXPORT -size_t crypto_generichash_bytes_min(void); - -#define crypto_generichash_BYTES_MAX crypto_generichash_blake2b_BYTES_MAX -SODIUM_EXPORT -size_t crypto_generichash_bytes_max(void); - -#define crypto_generichash_BYTES crypto_generichash_blake2b_BYTES -SODIUM_EXPORT -size_t crypto_generichash_bytes(void); - -#define crypto_generichash_KEYBYTES_MIN crypto_generichash_blake2b_KEYBYTES_MIN -SODIUM_EXPORT -size_t crypto_generichash_keybytes_min(void); - -#define crypto_generichash_KEYBYTES_MAX crypto_generichash_blake2b_KEYBYTES_MAX -SODIUM_EXPORT -size_t crypto_generichash_keybytes_max(void); - -#define crypto_generichash_KEYBYTES crypto_generichash_blake2b_KEYBYTES -SODIUM_EXPORT -size_t crypto_generichash_keybytes(void); - -#define crypto_generichash_PRIMITIVE "blake2b" -SODIUM_EXPORT -const char *crypto_generichash_primitive(void); - -typedef crypto_generichash_blake2b_state crypto_generichash_state; - -SODIUM_EXPORT -size_t crypto_generichash_statebytes(void); - -SODIUM_EXPORT -int crypto_generichash(unsigned char *out, size_t outlen, - const unsigned char *in, unsigned long long inlen, - const unsigned char *key, size_t keylen); - -SODIUM_EXPORT -int crypto_generichash_init(crypto_generichash_state *state, - const unsigned char *key, - const size_t keylen, const size_t outlen); - -SODIUM_EXPORT -int crypto_generichash_update(crypto_generichash_state *state, - const unsigned char *in, - unsigned long long inlen); - -SODIUM_EXPORT -int crypto_generichash_final(crypto_generichash_state *state, - unsigned char *out, const size_t outlen); - -SODIUM_EXPORT -void crypto_generichash_keygen(unsigned char k[crypto_generichash_KEYBYTES]); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_generichash_blake2b.h b/tools/sdk/include/libsodium/sodium/crypto_generichash_blake2b.h deleted file mode 100644 index 7b0c0820743..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_generichash_blake2b.h +++ /dev/null @@ -1,121 +0,0 @@ -#ifndef crypto_generichash_blake2b_H -#define crypto_generichash_blake2b_H - -#include -#include -#include - -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#if defined(__IBMC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) -# pragma pack(1) -#else -# pragma pack(push, 1) -#endif - -typedef CRYPTO_ALIGN(64) struct crypto_generichash_blake2b_state { - uint64_t h[8]; - uint64_t t[2]; - uint64_t f[2]; - uint8_t buf[2 * 128]; - size_t buflen; - uint8_t last_node; -} crypto_generichash_blake2b_state; - -#if defined(__IBMC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) -# pragma pack() -#else -# pragma pack(pop) -#endif - -#define crypto_generichash_blake2b_BYTES_MIN 16U -SODIUM_EXPORT -size_t crypto_generichash_blake2b_bytes_min(void); - -#define crypto_generichash_blake2b_BYTES_MAX 64U -SODIUM_EXPORT -size_t crypto_generichash_blake2b_bytes_max(void); - -#define crypto_generichash_blake2b_BYTES 32U -SODIUM_EXPORT -size_t crypto_generichash_blake2b_bytes(void); - -#define crypto_generichash_blake2b_KEYBYTES_MIN 16U -SODIUM_EXPORT -size_t crypto_generichash_blake2b_keybytes_min(void); - -#define crypto_generichash_blake2b_KEYBYTES_MAX 64U -SODIUM_EXPORT -size_t crypto_generichash_blake2b_keybytes_max(void); - -#define crypto_generichash_blake2b_KEYBYTES 32U -SODIUM_EXPORT -size_t crypto_generichash_blake2b_keybytes(void); - -#define crypto_generichash_blake2b_SALTBYTES 16U -SODIUM_EXPORT -size_t crypto_generichash_blake2b_saltbytes(void); - -#define crypto_generichash_blake2b_PERSONALBYTES 16U -SODIUM_EXPORT -size_t crypto_generichash_blake2b_personalbytes(void); - -SODIUM_EXPORT -size_t crypto_generichash_blake2b_statebytes(void); - -SODIUM_EXPORT -int crypto_generichash_blake2b(unsigned char *out, size_t outlen, - const unsigned char *in, - unsigned long long inlen, - const unsigned char *key, size_t keylen); - -SODIUM_EXPORT -int crypto_generichash_blake2b_salt_personal(unsigned char *out, size_t outlen, - const unsigned char *in, - unsigned long long inlen, - const unsigned char *key, - size_t keylen, - const unsigned char *salt, - const unsigned char *personal); - -SODIUM_EXPORT -int crypto_generichash_blake2b_init(crypto_generichash_blake2b_state *state, - const unsigned char *key, - const size_t keylen, const size_t outlen); - -SODIUM_EXPORT -int crypto_generichash_blake2b_init_salt_personal(crypto_generichash_blake2b_state *state, - const unsigned char *key, - const size_t keylen, const size_t outlen, - const unsigned char *salt, - const unsigned char *personal); - -SODIUM_EXPORT -int crypto_generichash_blake2b_update(crypto_generichash_blake2b_state *state, - const unsigned char *in, - unsigned long long inlen); - -SODIUM_EXPORT -int crypto_generichash_blake2b_final(crypto_generichash_blake2b_state *state, - unsigned char *out, - const size_t outlen); - -SODIUM_EXPORT -void crypto_generichash_blake2b_keygen(unsigned char k[crypto_generichash_blake2b_KEYBYTES]); - -/* ------------------------------------------------------------------------- */ - -int _crypto_generichash_blake2b_pick_best_implementation(void); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_hash.h b/tools/sdk/include/libsodium/sodium/crypto_hash.h deleted file mode 100644 index 302ed5c5ea2..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_hash.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef crypto_hash_H -#define crypto_hash_H - -/* - * WARNING: Unless you absolutely need to use SHA512 for interoperatibility, - * purposes, you might want to consider crypto_generichash() instead. - * Unlike SHA512, crypto_generichash() is not vulnerable to length - * extension attacks. - */ - -#include - -#include "crypto_hash_sha512.h" -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_hash_BYTES crypto_hash_sha512_BYTES -SODIUM_EXPORT -size_t crypto_hash_bytes(void); - -SODIUM_EXPORT -int crypto_hash(unsigned char *out, const unsigned char *in, - unsigned long long inlen); - -#define crypto_hash_PRIMITIVE "sha512" -SODIUM_EXPORT -const char *crypto_hash_primitive(void) - __attribute__ ((warn_unused_result)); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_hash_sha256.h b/tools/sdk/include/libsodium/sodium/crypto_hash_sha256.h deleted file mode 100644 index f64d16e0e5c..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_hash_sha256.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef crypto_hash_sha256_H -#define crypto_hash_sha256_H - -/* - * WARNING: Unless you absolutely need to use SHA256 for interoperatibility, - * purposes, you might want to consider crypto_generichash() instead. - * Unlike SHA256, crypto_generichash() is not vulnerable to length - * extension attacks. - */ - -#include -#include -#include - -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -typedef struct crypto_hash_sha256_state { - uint32_t state[8]; - uint64_t count; - uint8_t buf[64]; -} crypto_hash_sha256_state; - -SODIUM_EXPORT -size_t crypto_hash_sha256_statebytes(void); - -#define crypto_hash_sha256_BYTES 32U -SODIUM_EXPORT -size_t crypto_hash_sha256_bytes(void); - -SODIUM_EXPORT -int crypto_hash_sha256(unsigned char *out, const unsigned char *in, - unsigned long long inlen); - -SODIUM_EXPORT -int crypto_hash_sha256_init(crypto_hash_sha256_state *state); - -SODIUM_EXPORT -int crypto_hash_sha256_update(crypto_hash_sha256_state *state, - const unsigned char *in, - unsigned long long inlen); - -SODIUM_EXPORT -int crypto_hash_sha256_final(crypto_hash_sha256_state *state, - unsigned char *out); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_hash_sha512.h b/tools/sdk/include/libsodium/sodium/crypto_hash_sha512.h deleted file mode 100644 index 6b0330f14fe..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_hash_sha512.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef crypto_hash_sha512_H -#define crypto_hash_sha512_H - -/* - * WARNING: Unless you absolutely need to use SHA512 for interoperatibility, - * purposes, you might want to consider crypto_generichash() instead. - * Unlike SHA512, crypto_generichash() is not vulnerable to length - * extension attacks. - */ - -#include -#include -#include - -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -typedef struct crypto_hash_sha512_state { - uint64_t state[8]; - uint64_t count[2]; - uint8_t buf[128]; -} crypto_hash_sha512_state; - -SODIUM_EXPORT -size_t crypto_hash_sha512_statebytes(void); - -#define crypto_hash_sha512_BYTES 64U -SODIUM_EXPORT -size_t crypto_hash_sha512_bytes(void); - -SODIUM_EXPORT -int crypto_hash_sha512(unsigned char *out, const unsigned char *in, - unsigned long long inlen); - -SODIUM_EXPORT -int crypto_hash_sha512_init(crypto_hash_sha512_state *state); - -SODIUM_EXPORT -int crypto_hash_sha512_update(crypto_hash_sha512_state *state, - const unsigned char *in, - unsigned long long inlen); - -SODIUM_EXPORT -int crypto_hash_sha512_final(crypto_hash_sha512_state *state, - unsigned char *out); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_kdf.h b/tools/sdk/include/libsodium/sodium/crypto_kdf.h deleted file mode 100644 index 52e496a7449..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_kdf.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef crypto_kdf_H -#define crypto_kdf_H - -#include -#include - -#include "crypto_kdf_blake2b.h" -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_kdf_BYTES_MIN crypto_kdf_blake2b_BYTES_MIN -SODIUM_EXPORT -size_t crypto_kdf_bytes_min(void); - -#define crypto_kdf_BYTES_MAX crypto_kdf_blake2b_BYTES_MAX -SODIUM_EXPORT -size_t crypto_kdf_bytes_max(void); - -#define crypto_kdf_CONTEXTBYTES crypto_kdf_blake2b_CONTEXTBYTES -SODIUM_EXPORT -size_t crypto_kdf_contextbytes(void); - -#define crypto_kdf_KEYBYTES crypto_kdf_blake2b_KEYBYTES -SODIUM_EXPORT -size_t crypto_kdf_keybytes(void); - -#define crypto_kdf_PRIMITIVE "blake2b" -SODIUM_EXPORT -const char *crypto_kdf_primitive(void) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_kdf_derive_from_key(unsigned char *subkey, size_t subkey_len, - uint64_t subkey_id, - const char ctx[crypto_kdf_CONTEXTBYTES], - const unsigned char key[crypto_kdf_KEYBYTES]); - -SODIUM_EXPORT -void crypto_kdf_keygen(unsigned char k[crypto_kdf_KEYBYTES]); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_kdf_blake2b.h b/tools/sdk/include/libsodium/sodium/crypto_kdf_blake2b.h deleted file mode 100644 index 5480ebe82f1..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_kdf_blake2b.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef crypto_kdf_blake2b_H -#define crypto_kdf_blake2b_H - -#include -#include - -#include "crypto_kdf_blake2b.h" -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_kdf_blake2b_BYTES_MIN 16 -SODIUM_EXPORT -size_t crypto_kdf_blake2b_bytes_min(void); - -#define crypto_kdf_blake2b_BYTES_MAX 64 -SODIUM_EXPORT -size_t crypto_kdf_blake2b_bytes_max(void); - -#define crypto_kdf_blake2b_CONTEXTBYTES 8 -SODIUM_EXPORT -size_t crypto_kdf_blake2b_contextbytes(void); - -#define crypto_kdf_blake2b_KEYBYTES 32 -SODIUM_EXPORT -size_t crypto_kdf_blake2b_keybytes(void); - -SODIUM_EXPORT -int crypto_kdf_blake2b_derive_from_key(unsigned char *subkey, size_t subkey_len, - uint64_t subkey_id, - const char ctx[crypto_kdf_blake2b_CONTEXTBYTES], - const unsigned char key[crypto_kdf_blake2b_KEYBYTES]); -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_kx.h b/tools/sdk/include/libsodium/sodium/crypto_kx.h deleted file mode 100644 index d1fce90da57..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_kx.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef crypto_kx_H -#define crypto_kx_H - -#include - -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_kx_PUBLICKEYBYTES 32 -SODIUM_EXPORT -size_t crypto_kx_publickeybytes(void); - -#define crypto_kx_SECRETKEYBYTES 32 -SODIUM_EXPORT -size_t crypto_kx_secretkeybytes(void); - -#define crypto_kx_SEEDBYTES 32 -SODIUM_EXPORT -size_t crypto_kx_seedbytes(void); - -#define crypto_kx_SESSIONKEYBYTES 32 -SODIUM_EXPORT -size_t crypto_kx_sessionkeybytes(void); - -#define crypto_kx_PRIMITIVE "x25519blake2b" -SODIUM_EXPORT -const char *crypto_kx_primitive(void); - -SODIUM_EXPORT -int crypto_kx_seed_keypair(unsigned char pk[crypto_kx_PUBLICKEYBYTES], - unsigned char sk[crypto_kx_SECRETKEYBYTES], - const unsigned char seed[crypto_kx_SEEDBYTES]); - -SODIUM_EXPORT -int crypto_kx_keypair(unsigned char pk[crypto_kx_PUBLICKEYBYTES], - unsigned char sk[crypto_kx_SECRETKEYBYTES]); - -SODIUM_EXPORT -int crypto_kx_client_session_keys(unsigned char rx[crypto_kx_SESSIONKEYBYTES], - unsigned char tx[crypto_kx_SESSIONKEYBYTES], - const unsigned char client_pk[crypto_kx_PUBLICKEYBYTES], - const unsigned char client_sk[crypto_kx_SECRETKEYBYTES], - const unsigned char server_pk[crypto_kx_PUBLICKEYBYTES]) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_kx_server_session_keys(unsigned char rx[crypto_kx_SESSIONKEYBYTES], - unsigned char tx[crypto_kx_SESSIONKEYBYTES], - const unsigned char server_pk[crypto_kx_PUBLICKEYBYTES], - const unsigned char server_sk[crypto_kx_SECRETKEYBYTES], - const unsigned char client_pk[crypto_kx_PUBLICKEYBYTES]) - __attribute__ ((warn_unused_result)); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_onetimeauth.h b/tools/sdk/include/libsodium/sodium/crypto_onetimeauth.h deleted file mode 100644 index 5951c5b82d3..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_onetimeauth.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef crypto_onetimeauth_H -#define crypto_onetimeauth_H - -#include - -#include "crypto_onetimeauth_poly1305.h" -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -typedef crypto_onetimeauth_poly1305_state crypto_onetimeauth_state; - -SODIUM_EXPORT -size_t crypto_onetimeauth_statebytes(void); - -#define crypto_onetimeauth_BYTES crypto_onetimeauth_poly1305_BYTES -SODIUM_EXPORT -size_t crypto_onetimeauth_bytes(void); - -#define crypto_onetimeauth_KEYBYTES crypto_onetimeauth_poly1305_KEYBYTES -SODIUM_EXPORT -size_t crypto_onetimeauth_keybytes(void); - -#define crypto_onetimeauth_PRIMITIVE "poly1305" -SODIUM_EXPORT -const char *crypto_onetimeauth_primitive(void); - -SODIUM_EXPORT -int crypto_onetimeauth(unsigned char *out, const unsigned char *in, - unsigned long long inlen, const unsigned char *k); - -SODIUM_EXPORT -int crypto_onetimeauth_verify(const unsigned char *h, const unsigned char *in, - unsigned long long inlen, const unsigned char *k) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_onetimeauth_init(crypto_onetimeauth_state *state, - const unsigned char *key); - -SODIUM_EXPORT -int crypto_onetimeauth_update(crypto_onetimeauth_state *state, - const unsigned char *in, - unsigned long long inlen); - -SODIUM_EXPORT -int crypto_onetimeauth_final(crypto_onetimeauth_state *state, - unsigned char *out); - -SODIUM_EXPORT -void crypto_onetimeauth_keygen(unsigned char k[crypto_onetimeauth_KEYBYTES]); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_onetimeauth_poly1305.h b/tools/sdk/include/libsodium/sodium/crypto_onetimeauth_poly1305.h deleted file mode 100644 index 479e923dccb..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_onetimeauth_poly1305.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef crypto_onetimeauth_poly1305_H -#define crypto_onetimeauth_poly1305_H - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#include -#include -#include - -#include - -#include "export.h" - -typedef CRYPTO_ALIGN(16) struct crypto_onetimeauth_poly1305_state { - unsigned char opaque[256]; -} crypto_onetimeauth_poly1305_state; - -SODIUM_EXPORT -size_t crypto_onetimeauth_poly1305_statebytes(void); - -#define crypto_onetimeauth_poly1305_BYTES 16U -SODIUM_EXPORT -size_t crypto_onetimeauth_poly1305_bytes(void); - -#define crypto_onetimeauth_poly1305_KEYBYTES 32U -SODIUM_EXPORT -size_t crypto_onetimeauth_poly1305_keybytes(void); - -SODIUM_EXPORT -int crypto_onetimeauth_poly1305(unsigned char *out, - const unsigned char *in, - unsigned long long inlen, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_onetimeauth_poly1305_verify(const unsigned char *h, - const unsigned char *in, - unsigned long long inlen, - const unsigned char *k) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_onetimeauth_poly1305_init(crypto_onetimeauth_poly1305_state *state, - const unsigned char *key); - -SODIUM_EXPORT -int crypto_onetimeauth_poly1305_update(crypto_onetimeauth_poly1305_state *state, - const unsigned char *in, - unsigned long long inlen); - -SODIUM_EXPORT -int crypto_onetimeauth_poly1305_final(crypto_onetimeauth_poly1305_state *state, - unsigned char *out); - -SODIUM_EXPORT -void crypto_onetimeauth_poly1305_keygen(unsigned char k[crypto_onetimeauth_poly1305_KEYBYTES]); - -/* ------------------------------------------------------------------------- */ - -int _crypto_onetimeauth_poly1305_pick_best_implementation(void); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_pwhash.h b/tools/sdk/include/libsodium/sodium/crypto_pwhash.h deleted file mode 100644 index 56eca0680c1..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_pwhash.h +++ /dev/null @@ -1,121 +0,0 @@ -#ifndef crypto_pwhash_H -#define crypto_pwhash_H - -#include - -#include "crypto_pwhash_argon2i.h" -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_pwhash_ALG_ARGON2I13 crypto_pwhash_argon2i_ALG_ARGON2I13 -SODIUM_EXPORT -int crypto_pwhash_alg_argon2i13(void); - -#define crypto_pwhash_ALG_DEFAULT crypto_pwhash_ALG_ARGON2I13 -SODIUM_EXPORT -int crypto_pwhash_alg_default(void); - -#define crypto_pwhash_BYTES_MIN crypto_pwhash_argon2i_BYTES_MIN -SODIUM_EXPORT -size_t crypto_pwhash_bytes_min(void); - -#define crypto_pwhash_BYTES_MAX crypto_pwhash_argon2i_BYTES_MAX -SODIUM_EXPORT -size_t crypto_pwhash_bytes_max(void); - -#define crypto_pwhash_PASSWD_MIN crypto_pwhash_argon2i_PASSWD_MIN -SODIUM_EXPORT -size_t crypto_pwhash_passwd_min(void); - -#define crypto_pwhash_PASSWD_MAX crypto_pwhash_argon2i_PASSWD_MAX -SODIUM_EXPORT -size_t crypto_pwhash_passwd_max(void); - -#define crypto_pwhash_SALTBYTES crypto_pwhash_argon2i_SALTBYTES -SODIUM_EXPORT -size_t crypto_pwhash_saltbytes(void); - -#define crypto_pwhash_STRBYTES crypto_pwhash_argon2i_STRBYTES -SODIUM_EXPORT -size_t crypto_pwhash_strbytes(void); - -#define crypto_pwhash_STRPREFIX crypto_pwhash_argon2i_STRPREFIX -SODIUM_EXPORT -const char *crypto_pwhash_strprefix(void); - -#define crypto_pwhash_OPSLIMIT_MIN crypto_pwhash_argon2i_OPSLIMIT_MIN -SODIUM_EXPORT -size_t crypto_pwhash_opslimit_min(void); - -#define crypto_pwhash_OPSLIMIT_MAX crypto_pwhash_argon2i_OPSLIMIT_MAX -SODIUM_EXPORT -size_t crypto_pwhash_opslimit_max(void); - -#define crypto_pwhash_MEMLIMIT_MIN crypto_pwhash_argon2i_MEMLIMIT_MIN -SODIUM_EXPORT -size_t crypto_pwhash_memlimit_min(void); - -#define crypto_pwhash_MEMLIMIT_MAX crypto_pwhash_argon2i_MEMLIMIT_MAX -SODIUM_EXPORT -size_t crypto_pwhash_memlimit_max(void); - -#define crypto_pwhash_OPSLIMIT_INTERACTIVE crypto_pwhash_argon2i_OPSLIMIT_INTERACTIVE -SODIUM_EXPORT -size_t crypto_pwhash_opslimit_interactive(void); - -#define crypto_pwhash_MEMLIMIT_INTERACTIVE crypto_pwhash_argon2i_MEMLIMIT_INTERACTIVE -SODIUM_EXPORT -size_t crypto_pwhash_memlimit_interactive(void); - -#define crypto_pwhash_OPSLIMIT_MODERATE crypto_pwhash_argon2i_OPSLIMIT_MODERATE -SODIUM_EXPORT -size_t crypto_pwhash_opslimit_moderate(void); - -#define crypto_pwhash_MEMLIMIT_MODERATE crypto_pwhash_argon2i_MEMLIMIT_MODERATE -SODIUM_EXPORT -size_t crypto_pwhash_memlimit_moderate(void); - -#define crypto_pwhash_OPSLIMIT_SENSITIVE crypto_pwhash_argon2i_OPSLIMIT_SENSITIVE -SODIUM_EXPORT -size_t crypto_pwhash_opslimit_sensitive(void); - -#define crypto_pwhash_MEMLIMIT_SENSITIVE crypto_pwhash_argon2i_MEMLIMIT_SENSITIVE -SODIUM_EXPORT -size_t crypto_pwhash_memlimit_sensitive(void); - -SODIUM_EXPORT -int crypto_pwhash(unsigned char * const out, unsigned long long outlen, - const char * const passwd, unsigned long long passwdlen, - const unsigned char * const salt, - unsigned long long opslimit, size_t memlimit, int alg) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_pwhash_str(char out[crypto_pwhash_STRBYTES], - const char * const passwd, unsigned long long passwdlen, - unsigned long long opslimit, size_t memlimit) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_pwhash_str_verify(const char str[crypto_pwhash_STRBYTES], - const char * const passwd, - unsigned long long passwdlen) - __attribute__ ((warn_unused_result)); - -#define crypto_pwhash_PRIMITIVE "argon2i" -SODIUM_EXPORT -const char *crypto_pwhash_primitive(void) - __attribute__ ((warn_unused_result)); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/tools/sdk/include/libsodium/sodium/crypto_pwhash_argon2i.h b/tools/sdk/include/libsodium/sodium/crypto_pwhash_argon2i.h deleted file mode 100644 index d414b939d1f..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_pwhash_argon2i.h +++ /dev/null @@ -1,120 +0,0 @@ -#ifndef crypto_pwhash_argon2i_H -#define crypto_pwhash_argon2i_H - -#include -#include -#include - -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_pwhash_argon2i_ALG_ARGON2I13 1 -SODIUM_EXPORT -int crypto_pwhash_argon2i_alg_argon2i13(void); - -#define crypto_pwhash_argon2i_BYTES_MIN 16U -SODIUM_EXPORT -size_t crypto_pwhash_argon2i_bytes_min(void); - -#define crypto_pwhash_argon2i_BYTES_MAX 4294967295U -SODIUM_EXPORT -size_t crypto_pwhash_argon2i_bytes_max(void); - -#define crypto_pwhash_argon2i_PASSWD_MIN 0U -SODIUM_EXPORT -size_t crypto_pwhash_argon2i_passwd_min(void); - -#define crypto_pwhash_argon2i_PASSWD_MAX 4294967295U -SODIUM_EXPORT -size_t crypto_pwhash_argon2i_passwd_max(void); - -#define crypto_pwhash_argon2i_SALTBYTES 16U -SODIUM_EXPORT -size_t crypto_pwhash_argon2i_saltbytes(void); - -#define crypto_pwhash_argon2i_STRBYTES 128U -SODIUM_EXPORT -size_t crypto_pwhash_argon2i_strbytes(void); - -#define crypto_pwhash_argon2i_STRPREFIX "$argon2i$" -SODIUM_EXPORT -const char *crypto_pwhash_argon2i_strprefix(void); - -#define crypto_pwhash_argon2i_OPSLIMIT_MIN 3U -SODIUM_EXPORT -size_t crypto_pwhash_argon2i_opslimit_min(void); - -#define crypto_pwhash_argon2i_OPSLIMIT_MAX 4294967295U -SODIUM_EXPORT -size_t crypto_pwhash_argon2i_opslimit_max(void); - -#define crypto_pwhash_argon2i_MEMLIMIT_MIN 1U -SODIUM_EXPORT -size_t crypto_pwhash_argon2i_memlimit_min(void); - -#define crypto_pwhash_argon2i_MEMLIMIT_MAX ((SIZE_MAX >= 1ULL << 48) ? 4398046510080U : (SIZE_MAX >= 1ULL << 32) ? 2147483648U : 32768U) -SODIUM_EXPORT -size_t crypto_pwhash_argon2i_memlimit_max(void); - -#define crypto_pwhash_argon2i_OPSLIMIT_INTERACTIVE 4U -SODIUM_EXPORT -size_t crypto_pwhash_argon2i_opslimit_interactive(void); - -#define crypto_pwhash_argon2i_MEMLIMIT_INTERACTIVE 33554432U -SODIUM_EXPORT -size_t crypto_pwhash_argon2i_memlimit_interactive(void); - -#define crypto_pwhash_argon2i_OPSLIMIT_MODERATE 6U -SODIUM_EXPORT -size_t crypto_pwhash_argon2i_opslimit_moderate(void); - -#define crypto_pwhash_argon2i_MEMLIMIT_MODERATE 134217728U -SODIUM_EXPORT -size_t crypto_pwhash_argon2i_memlimit_moderate(void); - -#define crypto_pwhash_argon2i_OPSLIMIT_SENSITIVE 8U -SODIUM_EXPORT -size_t crypto_pwhash_argon2i_opslimit_sensitive(void); - -#define crypto_pwhash_argon2i_MEMLIMIT_SENSITIVE 536870912U -SODIUM_EXPORT -size_t crypto_pwhash_argon2i_memlimit_sensitive(void); - -SODIUM_EXPORT -int crypto_pwhash_argon2i(unsigned char * const out, - unsigned long long outlen, - const char * const passwd, - unsigned long long passwdlen, - const unsigned char * const salt, - unsigned long long opslimit, size_t memlimit, - int alg) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_pwhash_argon2i_str(char out[crypto_pwhash_argon2i_STRBYTES], - const char * const passwd, - unsigned long long passwdlen, - unsigned long long opslimit, size_t memlimit) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_pwhash_argon2i_str_verify(const char str[crypto_pwhash_argon2i_STRBYTES], - const char * const passwd, - unsigned long long passwdlen) - __attribute__ ((warn_unused_result)); - -/* ------------------------------------------------------------------------- */ - -int _crypto_pwhash_argon2i_pick_best_implementation(void); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_pwhash_scryptsalsa208sha256.h b/tools/sdk/include/libsodium/sodium/crypto_pwhash_scryptsalsa208sha256.h deleted file mode 100644 index 9f693e540e7..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_pwhash_scryptsalsa208sha256.h +++ /dev/null @@ -1,112 +0,0 @@ -#ifndef crypto_pwhash_scryptsalsa208sha256_H -#define crypto_pwhash_scryptsalsa208sha256_H - -#include -#include -#include - -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_pwhash_scryptsalsa208sha256_BYTES_MIN 16U -SODIUM_EXPORT -size_t crypto_pwhash_scryptsalsa208sha256_bytes_min(void); - -#define crypto_pwhash_scryptsalsa208sha256_BYTES_MAX SIZE_MAX -SODIUM_EXPORT -size_t crypto_pwhash_scryptsalsa208sha256_bytes_max(void); - -#define crypto_pwhash_scryptsalsa208sha256_PASSWD_MIN 0U -SODIUM_EXPORT -size_t crypto_pwhash_scryptsalsa208sha256_passwd_min(void); - -#define crypto_pwhash_scryptsalsa208sha256_PASSWD_MAX SIZE_MAX -SODIUM_EXPORT -size_t crypto_pwhash_scryptsalsa208sha256_passwd_max(void); - -#define crypto_pwhash_scryptsalsa208sha256_SALTBYTES 32U -SODIUM_EXPORT -size_t crypto_pwhash_scryptsalsa208sha256_saltbytes(void); - -#define crypto_pwhash_scryptsalsa208sha256_STRBYTES 102U -SODIUM_EXPORT -size_t crypto_pwhash_scryptsalsa208sha256_strbytes(void); - -#define crypto_pwhash_scryptsalsa208sha256_STRPREFIX "$7$" -SODIUM_EXPORT -const char *crypto_pwhash_scryptsalsa208sha256_strprefix(void); - -#define crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN 32768U -SODIUM_EXPORT -size_t crypto_pwhash_scryptsalsa208sha256_opslimit_min(void); - -#define crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MAX 4294967295U -SODIUM_EXPORT -size_t crypto_pwhash_scryptsalsa208sha256_opslimit_max(void); - -#define crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MIN 16777216U -SODIUM_EXPORT -size_t crypto_pwhash_scryptsalsa208sha256_memlimit_min(void); - -#define crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX ((SIZE_MAX >= 68719476736U) ? 68719476736U : SIZE_MAX) -SODIUM_EXPORT -size_t crypto_pwhash_scryptsalsa208sha256_memlimit_max(void); - -#define crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE 524288U -SODIUM_EXPORT -size_t crypto_pwhash_scryptsalsa208sha256_opslimit_interactive(void); - -#define crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE 16777216U -SODIUM_EXPORT -size_t crypto_pwhash_scryptsalsa208sha256_memlimit_interactive(void); - -#define crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE 33554432U -SODIUM_EXPORT -size_t crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive(void); - -#define crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE 1073741824U -SODIUM_EXPORT -size_t crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive(void); - -SODIUM_EXPORT -int crypto_pwhash_scryptsalsa208sha256(unsigned char * const out, - unsigned long long outlen, - const char * const passwd, - unsigned long long passwdlen, - const unsigned char * const salt, - unsigned long long opslimit, - size_t memlimit) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_pwhash_scryptsalsa208sha256_str(char out[crypto_pwhash_scryptsalsa208sha256_STRBYTES], - const char * const passwd, - unsigned long long passwdlen, - unsigned long long opslimit, - size_t memlimit) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_pwhash_scryptsalsa208sha256_str_verify(const char str[crypto_pwhash_scryptsalsa208sha256_STRBYTES], - const char * const passwd, - unsigned long long passwdlen) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_pwhash_scryptsalsa208sha256_ll(const uint8_t * passwd, size_t passwdlen, - const uint8_t * salt, size_t saltlen, - uint64_t N, uint32_t r, uint32_t p, - uint8_t * buf, size_t buflen) - __attribute__ ((warn_unused_result)); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_scalarmult.h b/tools/sdk/include/libsodium/sodium/crypto_scalarmult.h deleted file mode 100644 index 830c10f6473..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_scalarmult.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef crypto_scalarmult_H -#define crypto_scalarmult_H - -#include - -#include "crypto_scalarmult_curve25519.h" -#include "export.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define crypto_scalarmult_BYTES crypto_scalarmult_curve25519_BYTES -SODIUM_EXPORT -size_t crypto_scalarmult_bytes(void); - -#define crypto_scalarmult_SCALARBYTES crypto_scalarmult_curve25519_SCALARBYTES -SODIUM_EXPORT -size_t crypto_scalarmult_scalarbytes(void); - -#define crypto_scalarmult_PRIMITIVE "curve25519" -SODIUM_EXPORT -const char *crypto_scalarmult_primitive(void); - -SODIUM_EXPORT -int crypto_scalarmult_base(unsigned char *q, const unsigned char *n); - -SODIUM_EXPORT -int crypto_scalarmult(unsigned char *q, const unsigned char *n, - const unsigned char *p) - __attribute__ ((warn_unused_result)); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_scalarmult_curve25519.h b/tools/sdk/include/libsodium/sodium/crypto_scalarmult_curve25519.h deleted file mode 100644 index 953f8923c5e..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_scalarmult_curve25519.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef crypto_scalarmult_curve25519_H -#define crypto_scalarmult_curve25519_H - -#include - -#include "export.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define crypto_scalarmult_curve25519_BYTES 32U -SODIUM_EXPORT -size_t crypto_scalarmult_curve25519_bytes(void); - -#define crypto_scalarmult_curve25519_SCALARBYTES 32U -SODIUM_EXPORT -size_t crypto_scalarmult_curve25519_scalarbytes(void); - -SODIUM_EXPORT -int crypto_scalarmult_curve25519(unsigned char *q, const unsigned char *n, - const unsigned char *p) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_scalarmult_curve25519_base(unsigned char *q, const unsigned char *n); - -/* ------------------------------------------------------------------------- */ - -int _crypto_scalarmult_curve25519_pick_best_implementation(void); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_secretbox.h b/tools/sdk/include/libsodium/sodium/crypto_secretbox.h deleted file mode 100644 index 9b098200e0b..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_secretbox.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef crypto_secretbox_H -#define crypto_secretbox_H - -#include - -#include "crypto_secretbox_xsalsa20poly1305.h" -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_secretbox_KEYBYTES crypto_secretbox_xsalsa20poly1305_KEYBYTES -SODIUM_EXPORT -size_t crypto_secretbox_keybytes(void); - -#define crypto_secretbox_NONCEBYTES crypto_secretbox_xsalsa20poly1305_NONCEBYTES -SODIUM_EXPORT -size_t crypto_secretbox_noncebytes(void); - -#define crypto_secretbox_MACBYTES crypto_secretbox_xsalsa20poly1305_MACBYTES -SODIUM_EXPORT -size_t crypto_secretbox_macbytes(void); - -#define crypto_secretbox_PRIMITIVE "xsalsa20poly1305" -SODIUM_EXPORT -const char *crypto_secretbox_primitive(void); - -SODIUM_EXPORT -int crypto_secretbox_easy(unsigned char *c, const unsigned char *m, - unsigned long long mlen, const unsigned char *n, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_secretbox_open_easy(unsigned char *m, const unsigned char *c, - unsigned long long clen, const unsigned char *n, - const unsigned char *k) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_secretbox_detached(unsigned char *c, unsigned char *mac, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *n, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_secretbox_open_detached(unsigned char *m, - const unsigned char *c, - const unsigned char *mac, - unsigned long long clen, - const unsigned char *n, - const unsigned char *k) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -void crypto_secretbox_keygen(unsigned char k[crypto_secretbox_KEYBYTES]); - -/* -- NaCl compatibility interface ; Requires padding -- */ - -#define crypto_secretbox_ZEROBYTES crypto_secretbox_xsalsa20poly1305_ZEROBYTES -SODIUM_EXPORT -size_t crypto_secretbox_zerobytes(void); - -#define crypto_secretbox_BOXZEROBYTES crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES -SODIUM_EXPORT -size_t crypto_secretbox_boxzerobytes(void); - -SODIUM_EXPORT -int crypto_secretbox(unsigned char *c, const unsigned char *m, - unsigned long long mlen, const unsigned char *n, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_secretbox_open(unsigned char *m, const unsigned char *c, - unsigned long long clen, const unsigned char *n, - const unsigned char *k) - __attribute__ ((warn_unused_result)); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_secretbox_xchacha20poly1305.h b/tools/sdk/include/libsodium/sodium/crypto_secretbox_xchacha20poly1305.h deleted file mode 100644 index 7a61a09174e..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_secretbox_xchacha20poly1305.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef crypto_secretbox_xchacha20poly1305_H -#define crypto_secretbox_xchacha20poly1305_H - -#include -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_secretbox_xchacha20poly1305_KEYBYTES 32U -SODIUM_EXPORT -size_t crypto_secretbox_xchacha20poly1305_keybytes(void); - -#define crypto_secretbox_xchacha20poly1305_NONCEBYTES 24U -SODIUM_EXPORT -size_t crypto_secretbox_xchacha20poly1305_noncebytes(void); - -#define crypto_secretbox_xchacha20poly1305_MACBYTES 16U -SODIUM_EXPORT -size_t crypto_secretbox_xchacha20poly1305_macbytes(void); - -SODIUM_EXPORT -int crypto_secretbox_xchacha20poly1305_easy(unsigned char *c, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *n, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_secretbox_xchacha20poly1305_open_easy(unsigned char *m, - const unsigned char *c, - unsigned long long clen, - const unsigned char *n, - const unsigned char *k) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_secretbox_xchacha20poly1305_detached(unsigned char *c, - unsigned char *mac, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *n, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_secretbox_xchacha20poly1305_open_detached(unsigned char *m, - const unsigned char *c, - const unsigned char *mac, - unsigned long long clen, - const unsigned char *n, - const unsigned char *k) - __attribute__ ((warn_unused_result)); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_secretbox_xsalsa20poly1305.h b/tools/sdk/include/libsodium/sodium/crypto_secretbox_xsalsa20poly1305.h deleted file mode 100644 index 5aa30805d6c..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_secretbox_xsalsa20poly1305.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef crypto_secretbox_xsalsa20poly1305_H -#define crypto_secretbox_xsalsa20poly1305_H - -#include -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_secretbox_xsalsa20poly1305_KEYBYTES 32U -SODIUM_EXPORT -size_t crypto_secretbox_xsalsa20poly1305_keybytes(void); - -#define crypto_secretbox_xsalsa20poly1305_NONCEBYTES 24U -SODIUM_EXPORT -size_t crypto_secretbox_xsalsa20poly1305_noncebytes(void); - -#define crypto_secretbox_xsalsa20poly1305_MACBYTES 16U -SODIUM_EXPORT -size_t crypto_secretbox_xsalsa20poly1305_macbytes(void); - -#define crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES 16U -SODIUM_EXPORT -size_t crypto_secretbox_xsalsa20poly1305_boxzerobytes(void); - -#define crypto_secretbox_xsalsa20poly1305_ZEROBYTES \ - (crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES + \ - crypto_secretbox_xsalsa20poly1305_MACBYTES) -SODIUM_EXPORT -size_t crypto_secretbox_xsalsa20poly1305_zerobytes(void); - -SODIUM_EXPORT -int crypto_secretbox_xsalsa20poly1305(unsigned char *c, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *n, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_secretbox_xsalsa20poly1305_open(unsigned char *m, - const unsigned char *c, - unsigned long long clen, - const unsigned char *n, - const unsigned char *k) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -void crypto_secretbox_xsalsa20poly1305_keygen(unsigned char k[crypto_secretbox_xsalsa20poly1305_KEYBYTES]); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_shorthash.h b/tools/sdk/include/libsodium/sodium/crypto_shorthash.h deleted file mode 100644 index a4988082471..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_shorthash.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef crypto_shorthash_H -#define crypto_shorthash_H - -#include - -#include "crypto_shorthash_siphash24.h" -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_shorthash_BYTES crypto_shorthash_siphash24_BYTES -SODIUM_EXPORT -size_t crypto_shorthash_bytes(void); - -#define crypto_shorthash_KEYBYTES crypto_shorthash_siphash24_KEYBYTES -SODIUM_EXPORT -size_t crypto_shorthash_keybytes(void); - -#define crypto_shorthash_PRIMITIVE "siphash24" -SODIUM_EXPORT -const char *crypto_shorthash_primitive(void); - -SODIUM_EXPORT -int crypto_shorthash(unsigned char *out, const unsigned char *in, - unsigned long long inlen, const unsigned char *k); - -SODIUM_EXPORT -void crypto_shorthash_keygen(unsigned char k[crypto_shorthash_KEYBYTES]); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_shorthash_siphash24.h b/tools/sdk/include/libsodium/sodium/crypto_shorthash_siphash24.h deleted file mode 100644 index 745ed48fae9..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_shorthash_siphash24.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef crypto_shorthash_siphash24_H -#define crypto_shorthash_siphash24_H - -#include -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -/* -- 64-bit output -- */ - -#define crypto_shorthash_siphash24_BYTES 8U -SODIUM_EXPORT -size_t crypto_shorthash_siphash24_bytes(void); - -#define crypto_shorthash_siphash24_KEYBYTES 16U -SODIUM_EXPORT -size_t crypto_shorthash_siphash24_keybytes(void); - -SODIUM_EXPORT -int crypto_shorthash_siphash24(unsigned char *out, const unsigned char *in, - unsigned long long inlen, const unsigned char *k); - -#ifndef SODIUM_LIBRARY_MINIMAL -/* -- 128-bit output -- */ - -#define crypto_shorthash_siphashx24_BYTES 16U -SODIUM_EXPORT -size_t crypto_shorthash_siphashx24_bytes(void); - -#define crypto_shorthash_siphashx24_KEYBYTES 16U -SODIUM_EXPORT -size_t crypto_shorthash_siphashx24_keybytes(void); - -SODIUM_EXPORT -int crypto_shorthash_siphashx24(unsigned char *out, const unsigned char *in, - unsigned long long inlen, const unsigned char *k); -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_sign.h b/tools/sdk/include/libsodium/sodium/crypto_sign.h deleted file mode 100644 index b0335bf274c..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_sign.h +++ /dev/null @@ -1,99 +0,0 @@ -#ifndef crypto_sign_H -#define crypto_sign_H - -/* - * THREAD SAFETY: crypto_sign_keypair() is thread-safe, - * provided that sodium_init() was called before. - * - * Other functions, including crypto_sign_seed_keypair() are always thread-safe. - */ - -#include - -#include "crypto_sign_ed25519.h" -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -typedef crypto_sign_ed25519ph_state crypto_sign_state; - -SODIUM_EXPORT -size_t crypto_sign_statebytes(void); - -#define crypto_sign_BYTES crypto_sign_ed25519_BYTES -SODIUM_EXPORT -size_t crypto_sign_bytes(void); - -#define crypto_sign_SEEDBYTES crypto_sign_ed25519_SEEDBYTES -SODIUM_EXPORT -size_t crypto_sign_seedbytes(void); - -#define crypto_sign_PUBLICKEYBYTES crypto_sign_ed25519_PUBLICKEYBYTES -SODIUM_EXPORT -size_t crypto_sign_publickeybytes(void); - -#define crypto_sign_SECRETKEYBYTES crypto_sign_ed25519_SECRETKEYBYTES -SODIUM_EXPORT -size_t crypto_sign_secretkeybytes(void); - -#define crypto_sign_PRIMITIVE "ed25519" -SODIUM_EXPORT -const char *crypto_sign_primitive(void); - -SODIUM_EXPORT -int crypto_sign_seed_keypair(unsigned char *pk, unsigned char *sk, - const unsigned char *seed); - -SODIUM_EXPORT -int crypto_sign_keypair(unsigned char *pk, unsigned char *sk); - -SODIUM_EXPORT -int crypto_sign(unsigned char *sm, unsigned long long *smlen_p, - const unsigned char *m, unsigned long long mlen, - const unsigned char *sk); - -SODIUM_EXPORT -int crypto_sign_open(unsigned char *m, unsigned long long *mlen_p, - const unsigned char *sm, unsigned long long smlen, - const unsigned char *pk) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_sign_detached(unsigned char *sig, unsigned long long *siglen_p, - const unsigned char *m, unsigned long long mlen, - const unsigned char *sk); - -SODIUM_EXPORT -int crypto_sign_verify_detached(const unsigned char *sig, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *pk) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_sign_init(crypto_sign_state *state); - -SODIUM_EXPORT -int crypto_sign_update(crypto_sign_state *state, - const unsigned char *m, unsigned long long mlen); - -SODIUM_EXPORT -int crypto_sign_final_create(crypto_sign_state *state, unsigned char *sig, - unsigned long long *siglen_p, - const unsigned char *sk); - -SODIUM_EXPORT -int crypto_sign_final_verify(crypto_sign_state *state, unsigned char *sig, - const unsigned char *pk) - __attribute__ ((warn_unused_result)); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_sign_ed25519.h b/tools/sdk/include/libsodium/sodium/crypto_sign_ed25519.h deleted file mode 100644 index 17c150f284a..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_sign_ed25519.h +++ /dev/null @@ -1,110 +0,0 @@ -#ifndef crypto_sign_ed25519_H -#define crypto_sign_ed25519_H - -#include -#include "crypto_hash_sha512.h" -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -typedef struct crypto_sign_ed25519ph_state { - crypto_hash_sha512_state hs; -} crypto_sign_ed25519ph_state; - -SODIUM_EXPORT -size_t crypto_sign_ed25519ph_statebytes(void); - -#define crypto_sign_ed25519_BYTES 64U -SODIUM_EXPORT -size_t crypto_sign_ed25519_bytes(void); - -#define crypto_sign_ed25519_SEEDBYTES 32U -SODIUM_EXPORT -size_t crypto_sign_ed25519_seedbytes(void); - -#define crypto_sign_ed25519_PUBLICKEYBYTES 32U -SODIUM_EXPORT -size_t crypto_sign_ed25519_publickeybytes(void); - -#define crypto_sign_ed25519_SECRETKEYBYTES (32U + 32U) -SODIUM_EXPORT -size_t crypto_sign_ed25519_secretkeybytes(void); - -SODIUM_EXPORT -int crypto_sign_ed25519(unsigned char *sm, unsigned long long *smlen_p, - const unsigned char *m, unsigned long long mlen, - const unsigned char *sk); - -SODIUM_EXPORT -int crypto_sign_ed25519_open(unsigned char *m, unsigned long long *mlen_p, - const unsigned char *sm, unsigned long long smlen, - const unsigned char *pk) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_sign_ed25519_detached(unsigned char *sig, - unsigned long long *siglen_p, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *sk); - -SODIUM_EXPORT -int crypto_sign_ed25519_verify_detached(const unsigned char *sig, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *pk) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_sign_ed25519_keypair(unsigned char *pk, unsigned char *sk); - -SODIUM_EXPORT -int crypto_sign_ed25519_seed_keypair(unsigned char *pk, unsigned char *sk, - const unsigned char *seed); - -SODIUM_EXPORT -int crypto_sign_ed25519_pk_to_curve25519(unsigned char *curve25519_pk, - const unsigned char *ed25519_pk) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int crypto_sign_ed25519_sk_to_curve25519(unsigned char *curve25519_sk, - const unsigned char *ed25519_sk); - -SODIUM_EXPORT -int crypto_sign_ed25519_sk_to_seed(unsigned char *seed, - const unsigned char *sk); - -SODIUM_EXPORT -int crypto_sign_ed25519_sk_to_pk(unsigned char *pk, const unsigned char *sk); - -SODIUM_EXPORT -int crypto_sign_ed25519ph_init(crypto_sign_ed25519ph_state *state); - -SODIUM_EXPORT -int crypto_sign_ed25519ph_update(crypto_sign_ed25519ph_state *state, - const unsigned char *m, - unsigned long long mlen); - -SODIUM_EXPORT -int crypto_sign_ed25519ph_final_create(crypto_sign_ed25519ph_state *state, - unsigned char *sig, - unsigned long long *siglen_p, - const unsigned char *sk); - -SODIUM_EXPORT -int crypto_sign_ed25519ph_final_verify(crypto_sign_ed25519ph_state *state, - unsigned char *sig, - const unsigned char *pk) - __attribute__ ((warn_unused_result)); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_sign_edwards25519sha512batch.h b/tools/sdk/include/libsodium/sodium/crypto_sign_edwards25519sha512batch.h deleted file mode 100644 index 2224a94e013..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_sign_edwards25519sha512batch.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef crypto_sign_edwards25519sha512batch_H -#define crypto_sign_edwards25519sha512batch_H - -/* - * WARNING: This construction was a prototype, which should not be used - * any more in new projects. - * - * crypto_sign_edwards25519sha512batch is provided for applications - * initially built with NaCl, but as recommended by the author of this - * construction, new applications should use ed25519 instead. - * - * In Sodium, you should use the high-level crypto_sign_*() functions instead. - */ - -#include -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_sign_edwards25519sha512batch_BYTES 64U -#define crypto_sign_edwards25519sha512batch_PUBLICKEYBYTES 32U -#define crypto_sign_edwards25519sha512batch_SECRETKEYBYTES (32U + 32U) - -SODIUM_EXPORT -int crypto_sign_edwards25519sha512batch(unsigned char *sm, - unsigned long long *smlen_p, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *sk) - __attribute__ ((deprecated)); - -SODIUM_EXPORT -int crypto_sign_edwards25519sha512batch_open(unsigned char *m, - unsigned long long *mlen_p, - const unsigned char *sm, - unsigned long long smlen, - const unsigned char *pk) - __attribute__ ((deprecated)); - -SODIUM_EXPORT -int crypto_sign_edwards25519sha512batch_keypair(unsigned char *pk, - unsigned char *sk) - __attribute__ ((deprecated)); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_stream.h b/tools/sdk/include/libsodium/sodium/crypto_stream.h deleted file mode 100644 index 22de6ff52d3..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_stream.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef crypto_stream_H -#define crypto_stream_H - -/* - * WARNING: This is just a stream cipher. It is NOT authenticated encryption. - * While it provides some protection against eavesdropping, it does NOT - * provide any security against active attacks. - * Unless you know what you're doing, what you are looking for is probably - * the crypto_box functions. - */ - -#include - -#include "crypto_stream_xsalsa20.h" -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_stream_KEYBYTES crypto_stream_xsalsa20_KEYBYTES -SODIUM_EXPORT -size_t crypto_stream_keybytes(void); - -#define crypto_stream_NONCEBYTES crypto_stream_xsalsa20_NONCEBYTES -SODIUM_EXPORT -size_t crypto_stream_noncebytes(void); - -#define crypto_stream_PRIMITIVE "xsalsa20" -SODIUM_EXPORT -const char *crypto_stream_primitive(void); - -SODIUM_EXPORT -int crypto_stream(unsigned char *c, unsigned long long clen, - const unsigned char *n, const unsigned char *k); - -SODIUM_EXPORT -int crypto_stream_xor(unsigned char *c, const unsigned char *m, - unsigned long long mlen, const unsigned char *n, - const unsigned char *k); - -SODIUM_EXPORT -void crypto_stream_keygen(unsigned char k[crypto_stream_KEYBYTES]); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_stream_aes128ctr.h b/tools/sdk/include/libsodium/sodium/crypto_stream_aes128ctr.h deleted file mode 100644 index 33ee1b89714..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_stream_aes128ctr.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef crypto_stream_aes128ctr_H -#define crypto_stream_aes128ctr_H - -/* - * WARNING: This is just a stream cipher. It is NOT authenticated encryption. - * While it provides some protection against eavesdropping, it does NOT - * provide any security against active attacks. - * Unless you know what you're doing, what you are looking for is probably - * the crypto_box functions. - */ - -#include -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_stream_aes128ctr_KEYBYTES 16U -SODIUM_EXPORT -size_t crypto_stream_aes128ctr_keybytes(void); - -#define crypto_stream_aes128ctr_NONCEBYTES 16U -SODIUM_EXPORT -size_t crypto_stream_aes128ctr_noncebytes(void); - -#define crypto_stream_aes128ctr_BEFORENMBYTES 1408U -SODIUM_EXPORT -size_t crypto_stream_aes128ctr_beforenmbytes(void); - -SODIUM_EXPORT -int crypto_stream_aes128ctr(unsigned char *out, unsigned long long outlen, - const unsigned char *n, const unsigned char *k) - __attribute__ ((deprecated)); - -SODIUM_EXPORT -int crypto_stream_aes128ctr_xor(unsigned char *out, const unsigned char *in, - unsigned long long inlen, const unsigned char *n, - const unsigned char *k) - __attribute__ ((deprecated)); - -SODIUM_EXPORT -int crypto_stream_aes128ctr_beforenm(unsigned char *c, const unsigned char *k) - __attribute__ ((deprecated)); - -SODIUM_EXPORT -int crypto_stream_aes128ctr_afternm(unsigned char *out, unsigned long long len, - const unsigned char *nonce, const unsigned char *c) - __attribute__ ((deprecated)); - -SODIUM_EXPORT -int crypto_stream_aes128ctr_xor_afternm(unsigned char *out, const unsigned char *in, - unsigned long long len, - const unsigned char *nonce, - const unsigned char *c) - __attribute__ ((deprecated)); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_stream_chacha20.h b/tools/sdk/include/libsodium/sodium/crypto_stream_chacha20.h deleted file mode 100644 index cf3ffe89595..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_stream_chacha20.h +++ /dev/null @@ -1,92 +0,0 @@ -#ifndef crypto_stream_chacha20_H -#define crypto_stream_chacha20_H - -/* - * WARNING: This is just a stream cipher. It is NOT authenticated encryption. - * While it provides some protection against eavesdropping, it does NOT - * provide any security against active attacks. - * Unless you know what you're doing, what you are looking for is probably - * the crypto_box functions. - */ - -#include -#include -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_stream_chacha20_KEYBYTES 32U -SODIUM_EXPORT -size_t crypto_stream_chacha20_keybytes(void); - -#define crypto_stream_chacha20_NONCEBYTES 8U -SODIUM_EXPORT -size_t crypto_stream_chacha20_noncebytes(void); - -/* ChaCha20 with a 64-bit nonce and a 64-bit counter, as originally designed */ - -SODIUM_EXPORT -int crypto_stream_chacha20(unsigned char *c, unsigned long long clen, - const unsigned char *n, const unsigned char *k); - -SODIUM_EXPORT -int crypto_stream_chacha20_xor(unsigned char *c, const unsigned char *m, - unsigned long long mlen, const unsigned char *n, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_stream_chacha20_xor_ic(unsigned char *c, const unsigned char *m, - unsigned long long mlen, - const unsigned char *n, uint64_t ic, - const unsigned char *k); - -SODIUM_EXPORT -void crypto_stream_chacha20_keygen(unsigned char k[crypto_stream_chacha20_KEYBYTES]); - -/* ChaCha20 with a 96-bit nonce and a 32-bit counter (IETF) */ - -#define crypto_stream_chacha20_ietf_KEYBYTES 32U -SODIUM_EXPORT -size_t crypto_stream_chacha20_ietf_keybytes(void); - -#define crypto_stream_chacha20_ietf_NONCEBYTES 12U -SODIUM_EXPORT -size_t crypto_stream_chacha20_ietf_noncebytes(void); - -SODIUM_EXPORT -int crypto_stream_chacha20_ietf(unsigned char *c, unsigned long long clen, - const unsigned char *n, const unsigned char *k); - -SODIUM_EXPORT -int crypto_stream_chacha20_ietf_xor(unsigned char *c, const unsigned char *m, - unsigned long long mlen, const unsigned char *n, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_stream_chacha20_ietf_xor_ic(unsigned char *c, const unsigned char *m, - unsigned long long mlen, - const unsigned char *n, uint32_t ic, - const unsigned char *k); - -SODIUM_EXPORT -void crypto_stream_chacha20_ietf_keygen(unsigned char k[crypto_stream_chacha20_ietf_KEYBYTES]); - -/* ------------------------------------------------------------------------- */ - -int _crypto_stream_chacha20_pick_best_implementation(void); - -/* Aliases */ - -#define crypto_stream_chacha20_IETF_KEYBYTES crypto_stream_chacha20_ietf_KEYBYTES -#define crypto_stream_chacha20_IETF_NONCEBYTES crypto_stream_chacha20_ietf_NONCEBYTES - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_stream_salsa20.h b/tools/sdk/include/libsodium/sodium/crypto_stream_salsa20.h deleted file mode 100644 index 741140eb22d..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_stream_salsa20.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef crypto_stream_salsa20_H -#define crypto_stream_salsa20_H - -/* - * WARNING: This is just a stream cipher. It is NOT authenticated encryption. - * While it provides some protection against eavesdropping, it does NOT - * provide any security against active attacks. - * Unless you know what you're doing, what you are looking for is probably - * the crypto_box functions. - */ - -#include -#include -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_stream_salsa20_KEYBYTES 32U -SODIUM_EXPORT -size_t crypto_stream_salsa20_keybytes(void); - -#define crypto_stream_salsa20_NONCEBYTES 8U -SODIUM_EXPORT -size_t crypto_stream_salsa20_noncebytes(void); - -SODIUM_EXPORT -int crypto_stream_salsa20(unsigned char *c, unsigned long long clen, - const unsigned char *n, const unsigned char *k); - -SODIUM_EXPORT -int crypto_stream_salsa20_xor(unsigned char *c, const unsigned char *m, - unsigned long long mlen, const unsigned char *n, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_stream_salsa20_xor_ic(unsigned char *c, const unsigned char *m, - unsigned long long mlen, - const unsigned char *n, uint64_t ic, - const unsigned char *k); - -SODIUM_EXPORT -void crypto_stream_salsa20_keygen(unsigned char k[crypto_stream_salsa20_KEYBYTES]); - -/* ------------------------------------------------------------------------- */ - -int _crypto_stream_salsa20_pick_best_implementation(void); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_stream_salsa2012.h b/tools/sdk/include/libsodium/sodium/crypto_stream_salsa2012.h deleted file mode 100644 index d5c44282174..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_stream_salsa2012.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef crypto_stream_salsa2012_H -#define crypto_stream_salsa2012_H - -/* - * WARNING: This is just a stream cipher. It is NOT authenticated encryption. - * While it provides some protection against eavesdropping, it does NOT - * provide any security against active attacks. - * Unless you know what you're doing, what you are looking for is probably - * the crypto_box functions. - */ - -#include -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_stream_salsa2012_KEYBYTES 32U -SODIUM_EXPORT -size_t crypto_stream_salsa2012_keybytes(void); - -#define crypto_stream_salsa2012_NONCEBYTES 8U -SODIUM_EXPORT -size_t crypto_stream_salsa2012_noncebytes(void); - -SODIUM_EXPORT -int crypto_stream_salsa2012(unsigned char *c, unsigned long long clen, - const unsigned char *n, const unsigned char *k); - -SODIUM_EXPORT -int crypto_stream_salsa2012_xor(unsigned char *c, const unsigned char *m, - unsigned long long mlen, const unsigned char *n, - const unsigned char *k); - -SODIUM_EXPORT -void crypto_stream_salsa2012_keygen(unsigned char k[crypto_stream_salsa2012_KEYBYTES]); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_stream_salsa208.h b/tools/sdk/include/libsodium/sodium/crypto_stream_salsa208.h deleted file mode 100644 index 02b4166e1ca..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_stream_salsa208.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef crypto_stream_salsa208_H -#define crypto_stream_salsa208_H - -/* - * WARNING: This is just a stream cipher. It is NOT authenticated encryption. - * While it provides some protection against eavesdropping, it does NOT - * provide any security against active attacks. - * Unless you know what you're doing, what you are looking for is probably - * the crypto_box functions. - */ - -#include -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_stream_salsa208_KEYBYTES 32U -SODIUM_EXPORT -size_t crypto_stream_salsa208_keybytes(void); - -#define crypto_stream_salsa208_NONCEBYTES 8U -SODIUM_EXPORT -size_t crypto_stream_salsa208_noncebytes(void); - -SODIUM_EXPORT -int crypto_stream_salsa208(unsigned char *c, unsigned long long clen, - const unsigned char *n, const unsigned char *k); - -SODIUM_EXPORT -int crypto_stream_salsa208_xor(unsigned char *c, const unsigned char *m, - unsigned long long mlen, const unsigned char *n, - const unsigned char *k); - -SODIUM_EXPORT -void crypto_stream_salsa208_keygen(unsigned char k[crypto_stream_salsa208_KEYBYTES]); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_stream_xchacha20.h b/tools/sdk/include/libsodium/sodium/crypto_stream_xchacha20.h deleted file mode 100644 index f884798e740..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_stream_xchacha20.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef crypto_stream_xchacha20_H -#define crypto_stream_xchacha20_H - -/* - * WARNING: This is just a stream cipher. It is NOT authenticated encryption. - * While it provides some protection against eavesdropping, it does NOT - * provide any security against active attacks. - * Unless you know what you're doing, what you are looking for is probably - * the crypto_box functions. - */ - -#include -#include -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_stream_xchacha20_KEYBYTES 32U -SODIUM_EXPORT -size_t crypto_stream_xchacha20_keybytes(void); - -#define crypto_stream_xchacha20_NONCEBYTES 24U -SODIUM_EXPORT -size_t crypto_stream_xchacha20_noncebytes(void); - -SODIUM_EXPORT -int crypto_stream_xchacha20(unsigned char *c, unsigned long long clen, - const unsigned char *n, const unsigned char *k); - -SODIUM_EXPORT -int crypto_stream_xchacha20_xor(unsigned char *c, const unsigned char *m, - unsigned long long mlen, const unsigned char *n, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_stream_xchacha20_xor_ic(unsigned char *c, const unsigned char *m, - unsigned long long mlen, - const unsigned char *n, uint64_t ic, - const unsigned char *k); - -SODIUM_EXPORT -void crypto_stream_xchacha20_keygen(unsigned char k[crypto_stream_xchacha20_KEYBYTES]); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_stream_xsalsa20.h b/tools/sdk/include/libsodium/sodium/crypto_stream_xsalsa20.h deleted file mode 100644 index ed5ae3c3d3c..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_stream_xsalsa20.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef crypto_stream_xsalsa20_H -#define crypto_stream_xsalsa20_H - -/* - * WARNING: This is just a stream cipher. It is NOT authenticated encryption. - * While it provides some protection against eavesdropping, it does NOT - * provide any security against active attacks. - * Unless you know what you're doing, what you are looking for is probably - * the crypto_box functions. - */ - -#include -#include -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -#define crypto_stream_xsalsa20_KEYBYTES 32U -SODIUM_EXPORT -size_t crypto_stream_xsalsa20_keybytes(void); - -#define crypto_stream_xsalsa20_NONCEBYTES 24U -SODIUM_EXPORT -size_t crypto_stream_xsalsa20_noncebytes(void); - -SODIUM_EXPORT -int crypto_stream_xsalsa20(unsigned char *c, unsigned long long clen, - const unsigned char *n, const unsigned char *k); - -SODIUM_EXPORT -int crypto_stream_xsalsa20_xor(unsigned char *c, const unsigned char *m, - unsigned long long mlen, const unsigned char *n, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_stream_xsalsa20_xor_ic(unsigned char *c, const unsigned char *m, - unsigned long long mlen, - const unsigned char *n, uint64_t ic, - const unsigned char *k); - -SODIUM_EXPORT -void crypto_stream_xsalsa20_keygen(unsigned char k[crypto_stream_xsalsa20_KEYBYTES]); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_verify_16.h b/tools/sdk/include/libsodium/sodium/crypto_verify_16.h deleted file mode 100644 index 5e9eeabee84..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_verify_16.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef crypto_verify_16_H -#define crypto_verify_16_H - -#include -#include "export.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define crypto_verify_16_BYTES 16U -SODIUM_EXPORT -size_t crypto_verify_16_bytes(void); - -SODIUM_EXPORT -int crypto_verify_16(const unsigned char *x, const unsigned char *y) - __attribute__ ((warn_unused_result)); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_verify_32.h b/tools/sdk/include/libsodium/sodium/crypto_verify_32.h deleted file mode 100644 index 281b5a1bb79..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_verify_32.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef crypto_verify_32_H -#define crypto_verify_32_H - -#include -#include "export.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define crypto_verify_32_BYTES 32U -SODIUM_EXPORT -size_t crypto_verify_32_bytes(void); - -SODIUM_EXPORT -int crypto_verify_32(const unsigned char *x, const unsigned char *y) - __attribute__ ((warn_unused_result)); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/crypto_verify_64.h b/tools/sdk/include/libsodium/sodium/crypto_verify_64.h deleted file mode 100644 index 0dc7c304a99..00000000000 --- a/tools/sdk/include/libsodium/sodium/crypto_verify_64.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef crypto_verify_64_H -#define crypto_verify_64_H - -#include -#include "export.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define crypto_verify_64_BYTES 64U -SODIUM_EXPORT -size_t crypto_verify_64_bytes(void); - -SODIUM_EXPORT -int crypto_verify_64(const unsigned char *x, const unsigned char *y) - __attribute__ ((warn_unused_result)); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/export.h b/tools/sdk/include/libsodium/sodium/export.h deleted file mode 100644 index c33bced8188..00000000000 --- a/tools/sdk/include/libsodium/sodium/export.h +++ /dev/null @@ -1,44 +0,0 @@ - -#ifndef sodium_export_H -#define sodium_export_H - -#ifndef __GNUC__ -# ifdef __attribute__ -# undef __attribute__ -# endif -# define __attribute__(a) -#endif - -#ifdef SODIUM_STATIC -# define SODIUM_EXPORT -#else -# if defined(_MSC_VER) -# ifdef SODIUM_DLL_EXPORT -# define SODIUM_EXPORT __declspec(dllexport) -# else -# define SODIUM_EXPORT __declspec(dllimport) -# endif -# else -# if defined(__SUNPRO_C) -# ifndef __GNU_C__ -# define SODIUM_EXPORT __attribute__ (visibility(__global)) -# else -# define SODIUM_EXPORT __attribute__ __global -# endif -# elif defined(_MSG_VER) -# define SODIUM_EXPORT extern __declspec(dllexport) -# else -# define SODIUM_EXPORT __attribute__ ((visibility ("default"))) -# endif -# endif -#endif - -#ifndef CRYPTO_ALIGN -# if defined(__INTEL_COMPILER) || defined(_MSC_VER) -# define CRYPTO_ALIGN(x) __declspec(align(x)) -# else -# define CRYPTO_ALIGN(x) __attribute__ ((aligned(x))) -# endif -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/private/common.h b/tools/sdk/include/libsodium/sodium/private/common.h deleted file mode 100644 index 5e27e5749f9..00000000000 --- a/tools/sdk/include/libsodium/sodium/private/common.h +++ /dev/null @@ -1,217 +0,0 @@ -#ifndef common_H -#define common_H 1 - -#include -#include -#include - -#define COMPILER_ASSERT(X) (void) sizeof(char[(X) ? 1 : -1]) - -#define ROTL32(X, B) rotl32((X), (B)) -static inline uint32_t -rotl32(const uint32_t x, const int b) -{ - return (x << b) | (x >> (32 - b)); -} - -#define ROTL64(X, B) rotl64((X), (B)) -static inline uint64_t -rotl64(const uint64_t x, const int b) -{ - return (x << b) | (x >> (64 - b)); -} - -#define ROTR32(X, B) rotr32((X), (B)) -static inline uint32_t -rotr32(const uint32_t x, const int b) -{ - return (x >> b) | (x << (32 - b)); -} - -#define ROTR64(X, B) rotr64((X), (B)) -static inline uint64_t -rotr64(const uint64_t x, const int b) -{ - return (x >> b) | (x << (64 - b)); -} - -#define LOAD64_LE(SRC) load64_le(SRC) -static inline uint64_t -load64_le(const uint8_t src[8]) -{ -#ifdef NATIVE_LITTLE_ENDIAN - uint64_t w; - memcpy(&w, src, sizeof w); - return w; -#else - uint64_t w = (uint64_t) src[0]; - w |= (uint64_t) src[1] << 8; - w |= (uint64_t) src[2] << 16; - w |= (uint64_t) src[3] << 24; - w |= (uint64_t) src[4] << 32; - w |= (uint64_t) src[5] << 40; - w |= (uint64_t) src[6] << 48; - w |= (uint64_t) src[7] << 56; - return w; -#endif -} - -#define STORE64_LE(DST, W) store64_le((DST), (W)) -static inline void -store64_le(uint8_t dst[8], uint64_t w) -{ -#ifdef NATIVE_LITTLE_ENDIAN - memcpy(dst, &w, sizeof w); -#else - dst[0] = (uint8_t) w; w >>= 8; - dst[1] = (uint8_t) w; w >>= 8; - dst[2] = (uint8_t) w; w >>= 8; - dst[3] = (uint8_t) w; w >>= 8; - dst[4] = (uint8_t) w; w >>= 8; - dst[5] = (uint8_t) w; w >>= 8; - dst[6] = (uint8_t) w; w >>= 8; - dst[7] = (uint8_t) w; -#endif -} - -#define LOAD32_LE(SRC) load32_le(SRC) -static inline uint32_t -load32_le(const uint8_t src[4]) -{ -#ifdef NATIVE_LITTLE_ENDIAN - uint32_t w; - memcpy(&w, src, sizeof w); - return w; -#else - uint32_t w = (uint32_t) src[0]; - w |= (uint32_t) src[1] << 8; - w |= (uint32_t) src[2] << 16; - w |= (uint32_t) src[3] << 24; - return w; -#endif -} - -#define STORE32_LE(DST, W) store32_le((DST), (W)) -static inline void -store32_le(uint8_t dst[4], uint32_t w) -{ -#ifdef NATIVE_LITTLE_ENDIAN - memcpy(dst, &w, sizeof w); -#else - dst[0] = (uint8_t) w; w >>= 8; - dst[1] = (uint8_t) w; w >>= 8; - dst[2] = (uint8_t) w; w >>= 8; - dst[3] = (uint8_t) w; -#endif -} - -/* ----- */ - -#define LOAD64_BE(SRC) load64_be(SRC) -static inline uint64_t -load64_be(const uint8_t src[8]) -{ -#ifdef NATIVE_BIG_ENDIAN - uint64_t w; - memcpy(&w, src, sizeof w); - return w; -#else - uint64_t w = (uint64_t) src[7]; - w |= (uint64_t) src[6] << 8; - w |= (uint64_t) src[5] << 16; - w |= (uint64_t) src[4] << 24; - w |= (uint64_t) src[3] << 32; - w |= (uint64_t) src[2] << 40; - w |= (uint64_t) src[1] << 48; - w |= (uint64_t) src[0] << 56; - return w; -#endif -} - -#define STORE64_BE(DST, W) store64_be((DST), (W)) -static inline void -store64_be(uint8_t dst[8], uint64_t w) -{ -#ifdef NATIVE_BIG_ENDIAN - memcpy(dst, &w, sizeof w); -#else - dst[7] = (uint8_t) w; w >>= 8; - dst[6] = (uint8_t) w; w >>= 8; - dst[5] = (uint8_t) w; w >>= 8; - dst[4] = (uint8_t) w; w >>= 8; - dst[3] = (uint8_t) w; w >>= 8; - dst[2] = (uint8_t) w; w >>= 8; - dst[1] = (uint8_t) w; w >>= 8; - dst[0] = (uint8_t) w; -#endif -} - -#define LOAD32_BE(SRC) load32_be(SRC) -static inline uint32_t -load32_be(const uint8_t src[4]) -{ -#ifdef NATIVE_BIG_ENDIAN - uint32_t w; - memcpy(&w, src, sizeof w); - return w; -#else - uint32_t w = (uint32_t) src[3]; - w |= (uint32_t) src[2] << 8; - w |= (uint32_t) src[1] << 16; - w |= (uint32_t) src[0] << 24; - return w; -#endif -} - -#define STORE32_BE(DST, W) store32_be((DST), (W)) -static inline void -store32_be(uint8_t dst[4], uint32_t w) -{ -#ifdef NATIVE_BIG_ENDIAN - memcpy(dst, &w, sizeof w); -#else - dst[3] = (uint8_t) w; w >>= 8; - dst[2] = (uint8_t) w; w >>= 8; - dst[1] = (uint8_t) w; w >>= 8; - dst[0] = (uint8_t) w; -#endif -} - -#ifndef __GNUC__ -# ifdef __attribute__ -# undef __attribute__ -# endif -# define __attribute__(a) -#endif - -#ifndef CRYPTO_ALIGN -# if defined(__INTEL_COMPILER) || defined(_MSC_VER) -# define CRYPTO_ALIGN(x) __declspec(align(x)) -# else -# define CRYPTO_ALIGN(x) __attribute__ ((aligned(x))) -# endif -#endif - -#if defined(_MSC_VER) && \ - (defined(_M_X64) || defined(_M_AMD64) || defined(_M_IX86)) - -# include - -# define HAVE_INTRIN_H 1 -# define HAVE_MMINTRIN_H 1 -# define HAVE_EMMINTRIN_H 1 -# define HAVE_PMMINTRIN_H 1 -# define HAVE_TMMINTRIN_H 1 -# define HAVE_SMMINTRIN_H 1 -# define HAVE_AVXINTRIN_H 1 -# if _MSC_VER >= 1600 -# define HAVE_WMMINTRIN_H 1 -# endif -# if _MSC_VER >= 1700 && defined(_M_X64) -# define HAVE_AVX2INTRIN_H 1 -# endif -#elif defined(HAVE_INTRIN_H) -# include -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/private/curve25519_ref10.h b/tools/sdk/include/libsodium/sodium/private/curve25519_ref10.h deleted file mode 100644 index 2b9caeb1f0d..00000000000 --- a/tools/sdk/include/libsodium/sodium/private/curve25519_ref10.h +++ /dev/null @@ -1,160 +0,0 @@ -#ifndef curve25519_ref10_H -#define curve25519_ref10_H - -#include -#include - -#define fe crypto_core_curve25519_ref10_fe -typedef int32_t fe[10]; - -/* - fe means field element. - Here the field is \Z/(2^255-19). - An element t, entries t[0]...t[9], represents the integer - t[0]+2^26 t[1]+2^51 t[2]+2^77 t[3]+2^102 t[4]+...+2^230 t[9]. - Bounds on each t[i] vary depending on context. - */ - -#define fe_frombytes crypto_core_curve25519_ref10_fe_frombytes -#define fe_tobytes crypto_core_curve25519_ref10_fe_tobytes -#define fe_copy crypto_core_curve25519_ref10_fe_copy -#define fe_isnonzero crypto_core_curve25519_ref10_fe_isnonzero -#define fe_isnegative crypto_core_curve25519_ref10_fe_isnegative -#define fe_0 crypto_core_curve25519_ref10_fe_0 -#define fe_1 crypto_core_curve25519_ref10_fe_1 -#define fe_cmov crypto_core_curve25519_ref10_fe_cmov -#define fe_add crypto_core_curve25519_ref10_fe_add -#define fe_sub crypto_core_curve25519_ref10_fe_sub -#define fe_neg crypto_core_curve25519_ref10_fe_neg -#define fe_mul crypto_core_curve25519_ref10_fe_mul -#define fe_sq crypto_core_curve25519_ref10_fe_sq -#define fe_sq2 crypto_core_curve25519_ref10_fe_sq2 -#define fe_invert crypto_core_curve25519_ref10_fe_invert -#define fe_pow22523 crypto_core_curve25519_ref10_fe_pow22523 - -extern void fe_frombytes(fe,const unsigned char *); -extern void fe_tobytes(unsigned char *,const fe); - -extern void fe_copy(fe,const fe); -extern int fe_isnonzero(const fe); -extern int fe_isnegative(const fe); -extern void fe_0(fe); -extern void fe_1(fe); -extern void fe_cmov(fe,const fe,unsigned int); -extern void fe_add(fe,const fe,const fe); -extern void fe_sub(fe,const fe,const fe); -extern void fe_neg(fe,const fe); -extern void fe_mul(fe,const fe,const fe); -extern void fe_sq(fe,const fe); -extern void fe_sq2(fe,const fe); -extern void fe_invert(fe,const fe); -extern void fe_pow22523(fe,const fe); - -/* - ge means group element. - * - Here the group is the set of pairs (x,y) of field elements (see fe.h) - satisfying -x^2 + y^2 = 1 + d x^2y^2 - where d = -121665/121666. - * - Representations: - ge_p2 (projective): (X:Y:Z) satisfying x=X/Z, y=Y/Z - ge_p3 (extended): (X:Y:Z:T) satisfying x=X/Z, y=Y/Z, XY=ZT - ge_p1p1 (completed): ((X:Z),(Y:T)) satisfying x=X/Z, y=Y/T - ge_precomp (Duif): (y+x,y-x,2dxy) - */ - -#define ge_p2 crypto_core_curve25519_ref10_ge_p2 -typedef struct { - fe X; - fe Y; - fe Z; -} ge_p2; - -#define ge_p3 crypto_core_curve25519_ref10_ge_p3 -typedef struct { - fe X; - fe Y; - fe Z; - fe T; -} ge_p3; - -#define ge_p1p1 crypto_core_curve25519_ref10_ge_p1p1 -typedef struct { - fe X; - fe Y; - fe Z; - fe T; -} ge_p1p1; - -#define ge_precomp crypto_core_curve25519_ref10_ge_precomp -typedef struct { - fe yplusx; - fe yminusx; - fe xy2d; -} ge_precomp; - -#define ge_cached crypto_core_curve25519_ref10_ge_cached -typedef struct { - fe YplusX; - fe YminusX; - fe Z; - fe T2d; -} ge_cached; - -#define ge_frombytes_negate_vartime crypto_core_curve25519_ref10_ge_frombytes_negate_vartime -#define ge_tobytes crypto_core_curve25519_ref10_ge_tobytes -#define ge_p3_tobytes crypto_core_curve25519_ref10_ge_p3_tobytes - -#define ge_p2_0 crypto_core_curve25519_ref10_ge_p2_0 -#define ge_p3_0 crypto_core_curve25519_ref10_ge_p3_0 -#define ge_precomp_0 crypto_core_curve25519_ref10_ge_precomp_0 -#define ge_p3_to_p2 crypto_core_curve25519_ref10_ge_p3_to_p2 -#define ge_p3_to_cached crypto_core_curve25519_ref10_ge_p3_to_cached -#define ge_p1p1_to_p2 crypto_core_curve25519_ref10_ge_p1p1_to_p2 -#define ge_p1p1_to_p3 crypto_core_curve25519_ref10_ge_p1p1_to_p3 -#define ge_p2_dbl crypto_core_curve25519_ref10_ge_p2_dbl -#define ge_p3_dbl crypto_core_curve25519_ref10_ge_p3_dbl - -#define ge_madd crypto_core_curve25519_ref10_ge_madd -#define ge_msub crypto_core_curve25519_ref10_ge_msub -#define ge_add crypto_core_curve25519_ref10_ge_add -#define ge_sub crypto_core_curve25519_ref10_ge_sub -#define ge_scalarmult_base crypto_core_curve25519_ref10_ge_scalarmult_base -#define ge_double_scalarmult_vartime crypto_core_curve25519_ref10_ge_double_scalarmult_vartime -#define ge_scalarmult_vartime crypto_core_curve25519_ref10_ge_scalarmult_vartime - -extern void ge_tobytes(unsigned char *,const ge_p2 *); -extern void ge_p3_tobytes(unsigned char *,const ge_p3 *); -extern int ge_frombytes_negate_vartime(ge_p3 *,const unsigned char *); - -extern void ge_p2_0(ge_p2 *); -extern void ge_p3_0(ge_p3 *); -extern void ge_precomp_0(ge_precomp *); -extern void ge_p3_to_p2(ge_p2 *,const ge_p3 *); -extern void ge_p3_to_cached(ge_cached *,const ge_p3 *); -extern void ge_p1p1_to_p2(ge_p2 *,const ge_p1p1 *); -extern void ge_p1p1_to_p3(ge_p3 *,const ge_p1p1 *); -extern void ge_p2_dbl(ge_p1p1 *,const ge_p2 *); -extern void ge_p3_dbl(ge_p1p1 *,const ge_p3 *); - -extern void ge_madd(ge_p1p1 *,const ge_p3 *,const ge_precomp *); -extern void ge_msub(ge_p1p1 *,const ge_p3 *,const ge_precomp *); -extern void ge_add(ge_p1p1 *,const ge_p3 *,const ge_cached *); -extern void ge_sub(ge_p1p1 *,const ge_p3 *,const ge_cached *); -extern void ge_scalarmult_base(ge_p3 *,const unsigned char *); -extern void ge_double_scalarmult_vartime(ge_p2 *,const unsigned char *,const ge_p3 *,const unsigned char *); -extern void ge_scalarmult_vartime(ge_p3 *,const unsigned char *,const ge_p3 *); - -/* - The set of scalars is \Z/l - where l = 2^252 + 27742317777372353535851937790883648493. - */ - -#define sc_reduce crypto_core_curve25519_ref10_sc_reduce -#define sc_muladd crypto_core_curve25519_ref10_sc_muladd - -extern void sc_reduce(unsigned char *); -extern void sc_muladd(unsigned char *,const unsigned char *,const unsigned char *,const unsigned char *); - -#endif diff --git a/tools/sdk/include/libsodium/sodium/private/mutex.h b/tools/sdk/include/libsodium/sodium/private/mutex.h deleted file mode 100644 index 322b6742b26..00000000000 --- a/tools/sdk/include/libsodium/sodium/private/mutex.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef mutex_H -#define mutex_H 1 - -extern int sodium_crit_enter(void); -extern int sodium_crit_leave(void); - -#endif diff --git a/tools/sdk/include/libsodium/sodium/private/sse2_64_32.h b/tools/sdk/include/libsodium/sodium/private/sse2_64_32.h deleted file mode 100644 index d0455b41b49..00000000000 --- a/tools/sdk/include/libsodium/sodium/private/sse2_64_32.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef sse2_64_32_H -#define sse2_64_32_H 1 - -#include "common.h" - -#ifdef HAVE_INTRIN_H -# include -#endif - -#if defined(HAVE_EMMINTRIN_H) && \ - !(defined(__amd64) || defined(__amd64__) || defined(__x86_64__) || \ - defined(_M_X64) || defined(_M_AMD64)) - -# include -# include - -# ifndef _mm_set_epi64x -# define _mm_set_epi64x(Q0, Q1) sodium__mm_set_epi64x((Q0), (Q1)) -static inline __m128i -sodium__mm_set_epi64x(int64_t q1, int64_t q0) -{ - union { int64_t as64; int32_t as32[2]; } x0, x1; - x0.as64 = q0; x1.as64 = q1; - return _mm_set_epi32(x1.as32[1], x1.as32[0], x0.as32[1], x0.as32[0]); -} -# endif - -# ifndef _mm_set1_epi64x -# define _mm_set1_epi64x(Q) sodium__mm_set1_epi64x(Q) -static inline __m128i -sodium__mm_set1_epi64x(int64_t q) -{ - return _mm_set_epi64x(q, q); -} -# endif - -# ifndef _mm_cvtsi64_si128 -# define _mm_cvtsi64_si128(Q) sodium__mm_cvtsi64_si128(Q) -static inline __m128i -sodium__mm_cvtsi64_si128(int64_t q) -{ - union { int64_t as64; int32_t as32[2]; } x; - x.as64 = q; - return _mm_setr_epi32(x.as32[0], x.as32[1], 0, 0); -} -# endif - -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/randombytes.h b/tools/sdk/include/libsodium/sodium/randombytes.h deleted file mode 100644 index d112fb293e5..00000000000 --- a/tools/sdk/include/libsodium/sodium/randombytes.h +++ /dev/null @@ -1,66 +0,0 @@ - -#ifndef randombytes_H -#define randombytes_H - -#include -#include - -#include - -#include "export.h" - -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -typedef struct randombytes_implementation { - const char *(*implementation_name)(void); /* required */ - uint32_t (*random)(void); /* required */ - void (*stir)(void); /* optional */ - uint32_t (*uniform)(const uint32_t upper_bound); /* optional, a default implementation will be used if NULL */ - void (*buf)(void * const buf, const size_t size); /* required */ - int (*close)(void); /* optional */ -} randombytes_implementation; - -#define randombytes_SEEDBYTES 32U -SODIUM_EXPORT -size_t randombytes_seedbytes(void); - -SODIUM_EXPORT -void randombytes_buf(void * const buf, const size_t size); - -SODIUM_EXPORT -void randombytes_buf_deterministic(void * const buf, const size_t size, - const unsigned char seed[randombytes_SEEDBYTES]); - -SODIUM_EXPORT -uint32_t randombytes_random(void); - -SODIUM_EXPORT -uint32_t randombytes_uniform(const uint32_t upper_bound); - -SODIUM_EXPORT -void randombytes_stir(void); - -SODIUM_EXPORT -int randombytes_close(void); - -SODIUM_EXPORT -int randombytes_set_implementation(randombytes_implementation *impl); - -SODIUM_EXPORT -const char *randombytes_implementation_name(void); - -/* -- NaCl compatibility interface -- */ - -SODIUM_EXPORT -void randombytes(unsigned char * const buf, const unsigned long long buf_len); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/randombytes_nativeclient.h b/tools/sdk/include/libsodium/sodium/randombytes_nativeclient.h deleted file mode 100644 index 5158d8c3c33..00000000000 --- a/tools/sdk/include/libsodium/sodium/randombytes_nativeclient.h +++ /dev/null @@ -1,23 +0,0 @@ - -#ifndef randombytes_nativeclient_H -#define randombytes_nativeclient_H - -#ifdef __native_client__ - -# include "export.h" -# include "randombytes.h" - -# ifdef __cplusplus -extern "C" { -# endif - -SODIUM_EXPORT -extern struct randombytes_implementation randombytes_nativeclient_implementation; - -# ifdef __cplusplus -} -# endif - -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/randombytes_salsa20_random.h b/tools/sdk/include/libsodium/sodium/randombytes_salsa20_random.h deleted file mode 100644 index 4deae15b6d9..00000000000 --- a/tools/sdk/include/libsodium/sodium/randombytes_salsa20_random.h +++ /dev/null @@ -1,19 +0,0 @@ - -#ifndef randombytes_salsa20_random_H -#define randombytes_salsa20_random_H - -#include "export.h" -#include "randombytes.h" - -#ifdef __cplusplus -extern "C" { -#endif - -SODIUM_EXPORT -extern struct randombytes_implementation randombytes_salsa20_implementation; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/randombytes_sysrandom.h b/tools/sdk/include/libsodium/sodium/randombytes_sysrandom.h deleted file mode 100644 index 9e27b674c79..00000000000 --- a/tools/sdk/include/libsodium/sodium/randombytes_sysrandom.h +++ /dev/null @@ -1,19 +0,0 @@ - -#ifndef randombytes_sysrandom_H -#define randombytes_sysrandom_H - -#include "export.h" -#include "randombytes.h" - -#ifdef __cplusplus -extern "C" { -#endif - -SODIUM_EXPORT -extern struct randombytes_implementation randombytes_sysrandom_implementation; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/runtime.h b/tools/sdk/include/libsodium/sodium/runtime.h deleted file mode 100644 index 76859ea0e13..00000000000 --- a/tools/sdk/include/libsodium/sodium/runtime.h +++ /dev/null @@ -1,46 +0,0 @@ - -#ifndef sodium_runtime_H -#define sodium_runtime_H - -#include "export.h" - -#ifdef __cplusplus -extern "C" { -#endif - -SODIUM_EXPORT -int sodium_runtime_has_neon(void); - -SODIUM_EXPORT -int sodium_runtime_has_sse2(void); - -SODIUM_EXPORT -int sodium_runtime_has_sse3(void); - -SODIUM_EXPORT -int sodium_runtime_has_ssse3(void); - -SODIUM_EXPORT -int sodium_runtime_has_sse41(void); - -SODIUM_EXPORT -int sodium_runtime_has_avx(void); - -SODIUM_EXPORT -int sodium_runtime_has_avx2(void); - -SODIUM_EXPORT -int sodium_runtime_has_pclmul(void); - -SODIUM_EXPORT -int sodium_runtime_has_aesni(void); - -/* ------------------------------------------------------------------------- */ - -int _sodium_runtime_get_cpu_features(void); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/utils.h b/tools/sdk/include/libsodium/sodium/utils.h deleted file mode 100644 index 0a7aadb434c..00000000000 --- a/tools/sdk/include/libsodium/sodium/utils.h +++ /dev/null @@ -1,131 +0,0 @@ - -#ifndef sodium_utils_H -#define sodium_utils_H - -#include - -#include "export.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef SODIUM_C99 -# if defined(__cplusplus) || !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L -# define SODIUM_C99(X) -# else -# define SODIUM_C99(X) X -# endif -#endif - -SODIUM_EXPORT -void sodium_memzero(void * const pnt, const size_t len); - -/* - * WARNING: sodium_memcmp() must be used to verify if two secret keys - * are equal, in constant time. - * It returns 0 if the keys are equal, and -1 if they differ. - * This function is not designed for lexicographical comparisons. - */ -SODIUM_EXPORT -int sodium_memcmp(const void * const b1_, const void * const b2_, size_t len) - __attribute__ ((warn_unused_result)); - -/* - * sodium_compare() returns -1 if b1_ < b2_, 1 if b1_ > b2_ and 0 if b1_ == b2_ - * It is suitable for lexicographical comparisons, or to compare nonces - * and counters stored in little-endian format. - * However, it is slower than sodium_memcmp(). - */ -SODIUM_EXPORT -int sodium_compare(const unsigned char *b1_, const unsigned char *b2_, - size_t len) - __attribute__ ((warn_unused_result)); - -SODIUM_EXPORT -int sodium_is_zero(const unsigned char *n, const size_t nlen); - -SODIUM_EXPORT -void sodium_increment(unsigned char *n, const size_t nlen); - -SODIUM_EXPORT -void sodium_add(unsigned char *a, const unsigned char *b, const size_t len); - -SODIUM_EXPORT -char *sodium_bin2hex(char * const hex, const size_t hex_maxlen, - const unsigned char * const bin, const size_t bin_len); - -SODIUM_EXPORT -int sodium_hex2bin(unsigned char * const bin, const size_t bin_maxlen, - const char * const hex, const size_t hex_len, - const char * const ignore, size_t * const bin_len, - const char ** const hex_end); - -SODIUM_EXPORT -int sodium_mlock(void * const addr, const size_t len); - -SODIUM_EXPORT -int sodium_munlock(void * const addr, const size_t len); - -/* WARNING: sodium_malloc() and sodium_allocarray() are not general-purpose - * allocation functions. - * - * They return a pointer to a region filled with 0xd0 bytes, immediately - * followed by a guard page. - * As a result, accessing a single byte after the requested allocation size - * will intentionally trigger a segmentation fault. - * - * A canary and an additional guard page placed before the beginning of the - * region may also kill the process if a buffer underflow is detected. - * - * The memory layout is: - * [unprotected region size (read only)][guard page (no access)][unprotected pages (read/write)][guard page (no access)] - * With the layout of the unprotected pages being: - * [optional padding][16-bytes canary][user region] - * - * However: - * - These functions are significantly slower than standard functions - * - Each allocation requires 3 or 4 additional pages - * - The returned address will not be aligned if the allocation size is not - * a multiple of the required alignment. For this reason, these functions - * are designed to store data, such as secret keys and messages. - * - * sodium_malloc() can be used to allocate any libsodium data structure. - * - * The crypto_generichash_state structure is packed and its length is - * either 357 or 361 bytes. For this reason, when using sodium_malloc() to - * allocate a crypto_generichash_state structure, padding must be added in - * order to ensure proper alignment. crypto_generichash_statebytes() - * returns the rounded up structure size, and should be prefered to sizeof(): - * state = sodium_malloc(crypto_generichash_statebytes()); - */ - -SODIUM_EXPORT -void *sodium_malloc(const size_t size) - __attribute__ ((malloc)); - -SODIUM_EXPORT -void *sodium_allocarray(size_t count, size_t size) - __attribute__ ((malloc)); - -SODIUM_EXPORT -void sodium_free(void *ptr); - -SODIUM_EXPORT -int sodium_mprotect_noaccess(void *ptr); - -SODIUM_EXPORT -int sodium_mprotect_readonly(void *ptr); - -SODIUM_EXPORT -int sodium_mprotect_readwrite(void *ptr); - -/* -------- */ - -int _sodium_alloc_init(void); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/libsodium/sodium/version.h b/tools/sdk/include/libsodium/sodium/version.h deleted file mode 100644 index c0bf5869deb..00000000000 --- a/tools/sdk/include/libsodium/sodium/version.h +++ /dev/null @@ -1,35 +0,0 @@ - -#ifndef sodium_version_H -#define sodium_version_H - -#include - -/* IMPORTANT: As we don't use autotools, these version are not automatically - updated if we change submodules. They need to be changed manually. -*/ - -#define SODIUM_VERSION_STRING "1.0.12-idf" - -/* Note: these are not the same as the overall version, see - configure.ac for the relevant macros */ -#define SODIUM_LIBRARY_VERSION_MAJOR 9 -#define SODIUM_LIBRARY_VERSION_MINOR 4 - -#ifdef __cplusplus -extern "C" { -#endif - -SODIUM_EXPORT -const char *sodium_version_string(void); - -SODIUM_EXPORT -int sodium_library_version_major(void); - -SODIUM_EXPORT -int sodium_library_version_minor(void); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/log/esp_log.h b/tools/sdk/include/log/esp_log.h deleted file mode 100644 index e57aabbdd53..00000000000 --- a/tools/sdk/include/log/esp_log.h +++ /dev/null @@ -1,319 +0,0 @@ -// 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. - -#ifndef __ESP_LOG_H__ -#define __ESP_LOG_H__ - -#include -#include -#include "sdkconfig.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Log level - * - */ -typedef enum { - ESP_LOG_NONE, /*!< No log output */ - ESP_LOG_ERROR, /*!< Critical errors, software module can not recover on its own */ - ESP_LOG_WARN, /*!< Error conditions from which recovery measures have been taken */ - ESP_LOG_INFO, /*!< Information messages which describe normal flow of events */ - ESP_LOG_DEBUG, /*!< Extra information which is not necessary for normal use (values, pointers, sizes, etc). */ - ESP_LOG_VERBOSE /*!< Bigger chunks of debugging information, or frequent messages which can potentially flood the output. */ -} esp_log_level_t; - -typedef int (*vprintf_like_t)(const char *, va_list); - -/** - * @brief Set log level for given tag - * - * If logging for given component has already been enabled, changes previous setting. - * - * Note that this function can not raise log level above the level set using - * CONFIG_LOG_DEFAULT_LEVEL setting in menuconfig. - * - * To raise log level above the default one for a given file, define - * LOG_LOCAL_LEVEL to one of the ESP_LOG_* values, before including - * esp_log.h in this file. - * - * @param tag Tag of the log entries to enable. Must be a non-NULL zero terminated string. - * Value "*" resets log level for all tags to the given value. - * - * @param level Selects log level to enable. Only logs at this and lower verbosity - * levels will be shown. - */ -void esp_log_level_set(const char* tag, esp_log_level_t level); - -/** - * @brief Set function used to output log entries - * - * By default, log output goes to UART0. This function can be used to redirect log - * output to some other destination, such as file or network. Returns the original - * log handler, which may be necessary to return output to the previous destination. - * - * @param func new Function used for output. Must have same signature as vprintf. - * - * @return func old Function used for output. - */ -vprintf_like_t esp_log_set_vprintf(vprintf_like_t func); - -/** - * @brief Function which returns timestamp to be used in log output - * - * This function is used in expansion of ESP_LOGx macros. - * In the 2nd stage bootloader, and at early application startup stage - * this function uses CPU cycle counter as time source. Later when - * FreeRTOS scheduler start running, it switches to FreeRTOS tick count. - * - * For now, we ignore millisecond counter overflow. - * - * @return timestamp, in milliseconds - */ -uint32_t esp_log_timestamp(void); - -/** - * @brief Function which returns timestamp to be used in log output - * - * This function uses HW cycle counter and does not depend on OS, - * so it can be safely used after application crash. - * - * @return timestamp, in milliseconds - */ -uint32_t esp_log_early_timestamp(void); - -/** - * @brief Write message into the log - * - * This function is not intended to be used directly. Instead, use one of - * ESP_LOGE, ESP_LOGW, ESP_LOGI, ESP_LOGD, ESP_LOGV macros. - * - * This function or these macros should not be used from an interrupt. - */ -void esp_log_write(esp_log_level_t level, const char* tag, const char* format, ...) __attribute__ ((format (printf, 3, 4))); - -/** @cond */ - -#include "esp_log_internal.h" - -#ifndef LOG_LOCAL_LEVEL -#ifndef BOOTLOADER_BUILD -#define LOG_LOCAL_LEVEL CONFIG_LOG_DEFAULT_LEVEL -#else -#define LOG_LOCAL_LEVEL CONFIG_LOG_BOOTLOADER_LEVEL -#endif -#endif - -/** @endcond */ - -/** - * @brief Log a buffer of hex bytes at specified level, separated into 16 bytes each line. - * - * @param tag description tag - * @param buffer Pointer to the buffer array - * @param buff_len length of buffer in bytes - * @param level level of the log - * - */ -#define ESP_LOG_BUFFER_HEX_LEVEL( tag, buffer, buff_len, level ) \ - do {\ - if ( LOG_LOCAL_LEVEL >= (level) ) { \ - esp_log_buffer_hex_internal( tag, buffer, buff_len, level ); \ - } \ - } while(0) - -/** - * @brief Log a buffer of characters at specified level, separated into 16 bytes each line. Buffer should contain only printable characters. - * - * @param tag description tag - * @param buffer Pointer to the buffer array - * @param buff_len length of buffer in bytes - * @param level level of the log - * - */ -#define ESP_LOG_BUFFER_CHAR_LEVEL( tag, buffer, buff_len, level ) \ - do {\ - if ( LOG_LOCAL_LEVEL >= (level) ) { \ - esp_log_buffer_char_internal( tag, buffer, buff_len, level ); \ - } \ - } while(0) - -/** - * @brief Dump a buffer to the log at specified level. - * - * The dump log shows just like the one below: - * - * W (195) log_example: 0x3ffb4280 45 53 50 33 32 20 69 73 20 67 72 65 61 74 2c 20 |ESP32 is great, | - * W (195) log_example: 0x3ffb4290 77 6f 72 6b 69 6e 67 20 61 6c 6f 6e 67 20 77 69 |working along wi| - * W (205) log_example: 0x3ffb42a0 74 68 20 74 68 65 20 49 44 46 2e 00 |th the IDF..| - * - * It is highly recommend to use terminals with over 102 text width. - * - * @param tag description tag - * @param buffer Pointer to the buffer array - * @param buff_len length of buffer in bytes - * @param level level of the log - */ -#define ESP_LOG_BUFFER_HEXDUMP( tag, buffer, buff_len, level ) \ - do { \ - if ( LOG_LOCAL_LEVEL >= (level) ) { \ - esp_log_buffer_hexdump_internal( tag, buffer, buff_len, level); \ - } \ - } while(0) - -/** - * @brief Log a buffer of hex bytes at Info level - * - * @param tag description tag - * @param buffer Pointer to the buffer array - * @param buff_len length of buffer in bytes - * - * @see ``esp_log_buffer_hex_level`` - * - */ -#define ESP_LOG_BUFFER_HEX(tag, buffer, buff_len) \ - do { \ - if (LOG_LOCAL_LEVEL >= ESP_LOG_INFO) { \ - ESP_LOG_BUFFER_HEX_LEVEL( tag, buffer, buff_len, ESP_LOG_INFO ); \ - }\ - } while(0) - -/** - * @brief Log a buffer of characters at Info level. Buffer should contain only printable characters. - * - * @param tag description tag - * @param buffer Pointer to the buffer array - * @param buff_len length of buffer in bytes - * - * @see ``esp_log_buffer_char_level`` - * - */ -#define ESP_LOG_BUFFER_CHAR(tag, buffer, buff_len) \ - do { \ - if (LOG_LOCAL_LEVEL >= ESP_LOG_INFO) { \ - ESP_LOG_BUFFER_CHAR_LEVEL( tag, buffer, buff_len, ESP_LOG_INFO ); \ - }\ - } while(0) - -/** @cond */ - -//to be back compatible -#define esp_log_buffer_hex ESP_LOG_BUFFER_HEX -#define esp_log_buffer_char ESP_LOG_BUFFER_CHAR - - -#if CONFIG_LOG_COLORS -#define LOG_COLOR_BLACK "30" -#define LOG_COLOR_RED "31" -#define LOG_COLOR_GREEN "32" -#define LOG_COLOR_BROWN "33" -#define LOG_COLOR_BLUE "34" -#define LOG_COLOR_PURPLE "35" -#define LOG_COLOR_CYAN "36" -#define LOG_COLOR(COLOR) "\033[0;" COLOR "m" -#define LOG_BOLD(COLOR) "\033[1;" COLOR "m" -#define LOG_RESET_COLOR "\033[0m" -#define LOG_COLOR_E LOG_COLOR(LOG_COLOR_RED) -#define LOG_COLOR_W LOG_COLOR(LOG_COLOR_BROWN) -#define LOG_COLOR_I LOG_COLOR(LOG_COLOR_GREEN) -#define LOG_COLOR_D -#define LOG_COLOR_V -#else //CONFIG_LOG_COLORS -#define LOG_COLOR_E -#define LOG_COLOR_W -#define LOG_COLOR_I -#define LOG_COLOR_D -#define LOG_COLOR_V -#define LOG_RESET_COLOR -#endif //CONFIG_LOG_COLORS - -#define LOG_FORMAT(letter, format) LOG_COLOR_ ## letter #letter " (%d) %s: " format LOG_RESET_COLOR "\n" - -/** @endcond */ - -/// macro to output logs in startup code, before heap allocator and syscalls have been initialized. log at ``ESP_LOG_ERROR`` level. @see ``printf``,``ESP_LOGE`` -#define ESP_EARLY_LOGE( tag, format, ... ) ESP_LOG_EARLY_IMPL(tag, format, ESP_LOG_ERROR, E, ##__VA_ARGS__) -/// macro to output logs in startup code at ``ESP_LOG_WARN`` level. @see ``ESP_EARLY_LOGE``,``ESP_LOGE``, ``printf`` -#define ESP_EARLY_LOGW( tag, format, ... ) ESP_LOG_EARLY_IMPL(tag, format, ESP_LOG_WARN, W, ##__VA_ARGS__) -/// macro to output logs in startup code at ``ESP_LOG_INFO`` level. @see ``ESP_EARLY_LOGE``,``ESP_LOGE``, ``printf`` -#define ESP_EARLY_LOGI( tag, format, ... ) ESP_LOG_EARLY_IMPL(tag, format, ESP_LOG_INFO, I, ##__VA_ARGS__) -/// macro to output logs in startup code at ``ESP_LOG_DEBUG`` level. @see ``ESP_EARLY_LOGE``,``ESP_LOGE``, ``printf`` -#define ESP_EARLY_LOGD( tag, format, ... ) ESP_LOG_EARLY_IMPL(tag, format, ESP_LOG_DEBUG, D, ##__VA_ARGS__) -/// macro to output logs in startup code at ``ESP_LOG_VERBOSE`` level. @see ``ESP_EARLY_LOGE``,``ESP_LOGE``, ``printf`` -#define ESP_EARLY_LOGV( tag, format, ... ) ESP_LOG_EARLY_IMPL(tag, format, ESP_LOG_VERBOSE, V, ##__VA_ARGS__) - -#define ESP_LOG_EARLY_IMPL(tag, format, log_level, log_tag_letter, ...) do { \ - if (LOG_LOCAL_LEVEL >= log_level) { \ - ets_printf(LOG_FORMAT(log_tag_letter, format), esp_log_timestamp(), tag, ##__VA_ARGS__); \ - }} while(0) - -#ifndef BOOTLOADER_BUILD -#define ESP_LOGE( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_ERROR, tag, format, ##__VA_ARGS__) -#define ESP_LOGW( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_WARN, tag, format, ##__VA_ARGS__) -#define ESP_LOGI( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_INFO, tag, format, ##__VA_ARGS__) -#define ESP_LOGD( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_DEBUG, tag, format, ##__VA_ARGS__) -#define ESP_LOGV( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_VERBOSE, tag, format, ##__VA_ARGS__) -#else -/** - * macro to output logs at ESP_LOG_ERROR level. - * - * @param tag tag of the log, which can be used to change the log level by ``esp_log_level_set`` at runtime. - * - * @see ``printf`` - */ -#define ESP_LOGE( tag, format, ... ) ESP_EARLY_LOGE(tag, format, ##__VA_ARGS__) -/// macro to output logs at ``ESP_LOG_WARN`` level. @see ``ESP_LOGE`` -#define ESP_LOGW( tag, format, ... ) ESP_EARLY_LOGW(tag, format, ##__VA_ARGS__) -/// macro to output logs at ``ESP_LOG_INFO`` level. @see ``ESP_LOGE`` -#define ESP_LOGI( tag, format, ... ) ESP_EARLY_LOGI(tag, format, ##__VA_ARGS__) -/// macro to output logs at ``ESP_LOG_DEBUG`` level. @see ``ESP_LOGE`` -#define ESP_LOGD( tag, format, ... ) ESP_EARLY_LOGD(tag, format, ##__VA_ARGS__) -/// macro to output logs at ``ESP_LOG_VERBOSE`` level. @see ``ESP_LOGE`` -#define ESP_LOGV( tag, format, ... ) ESP_EARLY_LOGV(tag, format, ##__VA_ARGS__) -#endif // BOOTLOADER_BUILD - -/** runtime macro to output logs at a specified level. - * - * @param tag tag of the log, which can be used to change the log level by ``esp_log_level_set`` at runtime. - * @param level level of the output log. - * @param format format of the output log. see ``printf`` - * @param ... variables to be replaced into the log. see ``printf`` - * - * @see ``printf`` - */ -#define ESP_LOG_LEVEL(level, tag, format, ...) do { \ - if (level==ESP_LOG_ERROR ) { esp_log_write(ESP_LOG_ERROR, tag, LOG_FORMAT(E, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \ - else if (level==ESP_LOG_WARN ) { esp_log_write(ESP_LOG_WARN, tag, LOG_FORMAT(W, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \ - else if (level==ESP_LOG_DEBUG ) { esp_log_write(ESP_LOG_DEBUG, tag, LOG_FORMAT(D, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \ - else if (level==ESP_LOG_VERBOSE ) { esp_log_write(ESP_LOG_VERBOSE, tag, LOG_FORMAT(V, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \ - else { esp_log_write(ESP_LOG_INFO, tag, LOG_FORMAT(I, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \ - } while(0) - -/** runtime macro to output logs at a specified level. Also check the level with ``LOG_LOCAL_LEVEL``. - * - * @see ``printf``, ``ESP_LOG_LEVEL`` - */ -#define ESP_LOG_LEVEL_LOCAL(level, tag, format, ...) do { \ - if ( LOG_LOCAL_LEVEL >= level ) ESP_LOG_LEVEL(level, tag, format, ##__VA_ARGS__); \ - } while(0) - -#ifdef __cplusplus -} -#endif - - -#endif /* __ESP_LOG_H__ */ diff --git a/tools/sdk/include/log/esp_log_internal.h b/tools/sdk/include/log/esp_log_internal.h deleted file mode 100644 index 94ec3463227..00000000000 --- a/tools/sdk/include/log/esp_log_internal.h +++ /dev/null @@ -1,24 +0,0 @@ -// 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. - -#ifndef __ESP_LOG_INTERNAL_H__ -#define __ESP_LOG_INTERNAL_H__ - -//these functions do not check level versus ESP_LOCAL_LEVEL, this should be done in esp_log.h -void esp_log_buffer_hex_internal(const char *tag, const void *buffer, uint16_t buff_len, esp_log_level_t level); -void esp_log_buffer_char_internal(const char *tag, const void *buffer, uint16_t buff_len, esp_log_level_t level); -void esp_log_buffer_hexdump_internal( const char *tag, const void *buffer, uint16_t buff_len, esp_log_level_t log_level); - -#endif - diff --git a/tools/sdk/include/lwip/apps/sntp/sntp.h b/tools/sdk/include/lwip/apps/sntp/sntp.h deleted file mode 100644 index 3db0fba1eba..00000000000 --- a/tools/sdk/include/lwip/apps/sntp/sntp.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once -#warning "This header file is deprecated, please include lwip/apps/sntp.h instead." -#include "lwip/apps/sntp.h" diff --git a/tools/sdk/include/lwip/arch/cc.h b/tools/sdk/include/lwip/arch/cc.h deleted file mode 100644 index cba0b365ea2..00000000000 --- a/tools/sdk/include/lwip/arch/cc.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. - * - * 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. Neither the name of the Institute 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 INSTITUTE 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 INSTITUTE 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. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __ARCH_CC_H__ -#define __ARCH_CC_H__ - -#include -#include -#include -#include - -#include "arch/sys_arch.h" - -#define BYTE_ORDER LITTLE_ENDIAN - -typedef uint8_t u8_t; -typedef int8_t s8_t; -typedef uint16_t u16_t; -typedef int16_t s16_t; -typedef uint32_t u32_t; -typedef int32_t s32_t; - -typedef unsigned long mem_ptr_t; -typedef int sys_prot_t; - -#define S16_F "d" -#define U16_F "d" -#define X16_F "x" - -#define S32_F "d" -#define U32_F "d" -#define X32_F "x" - -#define PACK_STRUCT_FIELD(x) x -#define PACK_STRUCT_STRUCT __attribute__((packed)) -#define PACK_STRUCT_BEGIN -#define PACK_STRUCT_END - -#include - -#define LWIP_PLATFORM_DIAG(x) do {printf x;} while(0) -// __assert_func is the assertion failure handler from newlib, defined in assert.h -#define LWIP_PLATFORM_ASSERT(message) __assert_func(__FILE__, __LINE__, __ASSERT_FUNC, message) - -#ifdef NDEBUG -#define LWIP_NOASSERT -#else // Assertions enabled - -// If assertions are on, the default LWIP_ERROR handler behaviour is to -// abort w/ an assertion failure. Don't do this, instead just print the error (if LWIP_DEBUG is set) -// and run the handler (same as the LWIP_ERROR behaviour if LWIP_NOASSERT is set). -#ifdef LWIP_DEBUG -#define LWIP_ERROR(message, expression, handler) do { if (!(expression)) { \ - puts(message); handler;}} while(0) -#else -// If LWIP_DEBUG is not set, return the error silently (default LWIP behaviour, also.) -#define LWIP_ERROR(message, expression, handler) do { if (!(expression)) { \ - handler;}} while(0) -#endif // LWIP_DEBUG - -#endif /* NDEBUG */ - - -#endif /* __ARCH_CC_H__ */ diff --git a/tools/sdk/include/lwip/arch/perf.h b/tools/sdk/include/lwip/arch/perf.h deleted file mode 100644 index 089facac1df..00000000000 --- a/tools/sdk/include/lwip/arch/perf.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. - * - * 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. Neither the name of the Institute 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 INSTITUTE 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 INSTITUTE 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. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __PERF_H__ -#define __PERF_H__ - -#define PERF_START /* null definition */ -#define PERF_STOP(x) /* null definition */ - -#endif /* __PERF_H__ */ diff --git a/tools/sdk/include/lwip/arch/sys_arch.h b/tools/sdk/include/lwip/arch/sys_arch.h deleted file mode 100644 index 9638fdfd621..00000000000 --- a/tools/sdk/include/lwip/arch/sys_arch.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ - -#ifndef __SYS_ARCH_H__ -#define __SYS_ARCH_H__ - -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "freertos/queue.h" -#include "freertos/semphr.h" -#include "arch/vfs_lwip.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef xSemaphoreHandle sys_sem_t; -typedef xSemaphoreHandle sys_mutex_t; -typedef xTaskHandle sys_thread_t; - -typedef struct sys_mbox_s { - xQueueHandle os_mbox; - void *owner; -}* sys_mbox_t; - - -#define LWIP_COMPAT_MUTEX 0 - -#if !LWIP_COMPAT_MUTEX -#define sys_mutex_valid( x ) ( ( ( *x ) == NULL) ? pdFALSE : pdTRUE ) -#define sys_mutex_set_invalid( x ) ( ( *x ) = NULL ) -#endif - -#define sys_mbox_valid( x ) ( ( ( *x ) == NULL) ? pdFALSE : pdTRUE ) - -/* Define the sys_mbox_set_invalid() to empty to support lock-free mbox in ESP LWIP. - * - * The basic idea about the lock-free mbox is that the mbox should always be valid unless - * no socket APIs are using the socket and the socket is closed. ESP LWIP achieves this by - * following two changes to official LWIP: - * 1. Postpone the deallocation of mbox to netconn_free(), in other words, free the mbox when - * no one is using the socket. - * 2. Define the sys_mbox_set_invalid() to empty if the mbox is not actually freed. - - * The second change is necessary. Consider a common scenario: the application task calls - * recv() to receive packets from the socket, the sys_mbox_valid() returns true. Because there - * is no lock for the mbox, the LWIP CORE can call sys_mbox_set_invalid() to set the mbox at - * anytime and the thread-safe issue may happen. - * - * However, if the sys_mbox_set_invalid() is not called after sys_mbox_free(), e.g. in netconn_alloc(), - * we need to initialize the mbox to invalid explicitly since sys_mbox_set_invalid() now is empty. - */ -#define sys_mbox_set_invalid( x ) - -#define sys_sem_valid( x ) ( ( ( *x ) == NULL) ? pdFALSE : pdTRUE ) -#define sys_sem_set_invalid( x ) ( ( *x ) = NULL ) - -void sys_delay_ms(uint32_t ms); -sys_sem_t* sys_thread_sem_init(void); -void sys_thread_sem_deinit(void); -sys_sem_t* sys_thread_sem_get(void); - -#ifdef __cplusplus -} -#endif - -#endif /* __SYS_ARCH_H__ */ - diff --git a/tools/sdk/include/lwip/arch/vfs_lwip.h b/tools/sdk/include/lwip/arch/vfs_lwip.h deleted file mode 100644 index 1957304b9f2..00000000000 --- a/tools/sdk/include/lwip/arch/vfs_lwip.h +++ /dev/null @@ -1,23 +0,0 @@ -// 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. - -#ifdef __cplusplus -extern "C" { -#endif - -void esp_vfs_lwip_sockets_register(); - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/lwip/arpa/inet.h b/tools/sdk/include/lwip/arpa/inet.h deleted file mode 100644 index 90428f687d7..00000000000 --- a/tools/sdk/include/lwip/arpa/inet.h +++ /dev/null @@ -1,20 +0,0 @@ -// 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. - -#ifndef INET_H_ -#define INET_H_ - -#include "../../../lwip/src/include/lwip/inet.h" - -#endif /* INET_H_ */ diff --git a/tools/sdk/include/lwip/cc.h b/tools/sdk/include/lwip/cc.h deleted file mode 100644 index cba0b365ea2..00000000000 --- a/tools/sdk/include/lwip/cc.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. - * - * 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. Neither the name of the Institute 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 INSTITUTE 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 INSTITUTE 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. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __ARCH_CC_H__ -#define __ARCH_CC_H__ - -#include -#include -#include -#include - -#include "arch/sys_arch.h" - -#define BYTE_ORDER LITTLE_ENDIAN - -typedef uint8_t u8_t; -typedef int8_t s8_t; -typedef uint16_t u16_t; -typedef int16_t s16_t; -typedef uint32_t u32_t; -typedef int32_t s32_t; - -typedef unsigned long mem_ptr_t; -typedef int sys_prot_t; - -#define S16_F "d" -#define U16_F "d" -#define X16_F "x" - -#define S32_F "d" -#define U32_F "d" -#define X32_F "x" - -#define PACK_STRUCT_FIELD(x) x -#define PACK_STRUCT_STRUCT __attribute__((packed)) -#define PACK_STRUCT_BEGIN -#define PACK_STRUCT_END - -#include - -#define LWIP_PLATFORM_DIAG(x) do {printf x;} while(0) -// __assert_func is the assertion failure handler from newlib, defined in assert.h -#define LWIP_PLATFORM_ASSERT(message) __assert_func(__FILE__, __LINE__, __ASSERT_FUNC, message) - -#ifdef NDEBUG -#define LWIP_NOASSERT -#else // Assertions enabled - -// If assertions are on, the default LWIP_ERROR handler behaviour is to -// abort w/ an assertion failure. Don't do this, instead just print the error (if LWIP_DEBUG is set) -// and run the handler (same as the LWIP_ERROR behaviour if LWIP_NOASSERT is set). -#ifdef LWIP_DEBUG -#define LWIP_ERROR(message, expression, handler) do { if (!(expression)) { \ - puts(message); handler;}} while(0) -#else -// If LWIP_DEBUG is not set, return the error silently (default LWIP behaviour, also.) -#define LWIP_ERROR(message, expression, handler) do { if (!(expression)) { \ - handler;}} while(0) -#endif // LWIP_DEBUG - -#endif /* NDEBUG */ - - -#endif /* __ARCH_CC_H__ */ diff --git a/tools/sdk/include/lwip/debug/lwip_debug.h b/tools/sdk/include/lwip/debug/lwip_debug.h deleted file mode 100644 index 4da520269ae..00000000000 --- a/tools/sdk/include/lwip/debug/lwip_debug.h +++ /dev/null @@ -1,25 +0,0 @@ -// 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. - - -#ifndef _LWIP_DEBUG_H -#define _LWIP_DEBUG_H - -void dbg_lwip_tcp_pcb_show(void); -void dbg_lwip_udp_pcb_show(void); -void dbg_lwip_tcp_rxtx_show(void); -void dbg_lwip_udp_rxtx_show(void); -void dbg_lwip_mem_cnt_show(void); - -#endif diff --git a/tools/sdk/include/lwip/dhcpserver/dhcpserver.h b/tools/sdk/include/lwip/dhcpserver/dhcpserver.h deleted file mode 100644 index a6ad51d9957..00000000000 --- a/tools/sdk/include/lwip/dhcpserver/dhcpserver.h +++ /dev/null @@ -1,95 +0,0 @@ -// 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. -#ifndef __DHCPS_H__ -#define __DHCPS_H__ - -#include "sdkconfig.h" -#include "lwip/ip_addr.h" - -typedef struct dhcps_state{ - s16_t state; -} dhcps_state; - -typedef struct dhcps_msg { - u8_t op, htype, hlen, hops; - u8_t xid[4]; - u16_t secs, flags; - u8_t ciaddr[4]; - u8_t yiaddr[4]; - u8_t siaddr[4]; - u8_t giaddr[4]; - u8_t chaddr[16]; - u8_t sname[64]; - u8_t file[128]; - u8_t options[312]; -}dhcps_msg; - -/* Defined in esp_misc.h */ -typedef struct { - bool enable; - ip4_addr_t start_ip; - ip4_addr_t end_ip; -} dhcps_lease_t; - -enum dhcps_offer_option{ - OFFER_START = 0x00, - OFFER_ROUTER = 0x01, - OFFER_DNS = 0x02, - OFFER_END -}; - -#define DHCPS_COARSE_TIMER_SECS 1 -#define DHCPS_MAX_LEASE 0x64 -#define DHCPS_LEASE_TIME_DEF (120) -#define DHCPS_LEASE_UNIT CONFIG_LWIP_DHCPS_LEASE_UNIT - -struct dhcps_pool{ - ip4_addr_t ip; - u8_t mac[6]; - u32_t lease_timer; -}; - -typedef u32_t dhcps_time_t; -typedef u8_t dhcps_offer_t; - -typedef struct { - dhcps_offer_t dhcps_offer; - dhcps_offer_t dhcps_dns; - dhcps_time_t dhcps_time; - dhcps_lease_t dhcps_poll; -} dhcps_options_t; - -typedef void (*dhcps_cb_t)(u8_t client_ip[4]); - -static inline bool dhcps_router_enabled (dhcps_offer_t offer) -{ - return (offer & OFFER_ROUTER) != 0; -} - -static inline bool dhcps_dns_enabled (dhcps_offer_t offer) -{ - return (offer & OFFER_DNS) != 0; -} - -void dhcps_start(struct netif *netif, ip4_addr_t ip); -void dhcps_stop(struct netif *netif); -void *dhcps_option_info(u8_t op_id, u32_t opt_len); -void dhcps_set_option_info(u8_t op_id, void *opt_info, u32_t opt_len); -bool dhcp_search_ip_on_mac(u8_t *mac, ip4_addr_t *ip); -void dhcps_dns_setserver(const ip_addr_t *dnsserver); -ip4_addr_t dhcps_dns_getserver(); -void dhcps_set_new_lease_cb(dhcps_cb_t cb); - -#endif - diff --git a/tools/sdk/include/lwip/dhcpserver/dhcpserver_options.h b/tools/sdk/include/lwip/dhcpserver/dhcpserver_options.h deleted file mode 100644 index 38d46f6bff2..00000000000 --- a/tools/sdk/include/lwip/dhcpserver/dhcpserver_options.h +++ /dev/null @@ -1,134 +0,0 @@ -// 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. -#pragma once - -/** DHCP Options - - This macros are not part of the public dhcpserver.h interface. - **/ -typedef enum -{ - /* RFC 1497 Vendor Extensions */ - - PAD = 0, - END = 255, - - SUBNET_MASK = 1, - TIME_OFFSET = 2, - ROUTER = 3, - TIME_SERVER = 4, - NAME_SERVER = 5, - DOMAIN_NAME_SERVER = 6, - LOG_SERVER = 7, - COOKIE_SERVER = 8, - LPR_SERVER = 9, - IMPRESS_SERVER = 10, - RESOURCE_LOCATION_SERVER = 11, - HOST_NAME = 12, - BOOT_FILE_SIZE = 13, - MERIT_DUMP_FILE = 14, - DOMAIN_NAME = 15, - SWAP_SERVER = 16, - ROOT_PATH = 17, - EXTENSIONS_PATH = 18, - - /* IP Layer Parameters per Host */ - - IP_FORWARDING = 19, - NON_LOCAL_SOURCE_ROUTING = 20, - POLICY_FILTER = 21, - MAXIMUM_DATAGRAM_REASSEMBLY_SIZE = 22, - DEFAULT_IP_TIME_TO_LIVE = 23, - PATH_MTU_AGING_TIMEOUT = 24, - PATH_MTU_PLATEAU_TABLE = 25, - - /* IP Layer Parameters per Interface */ - - INTERFACE_MTU = 26, - ALL_SUBNETS_ARE_LOCAL = 27, - BROADCAST_ADDRESS = 28, - PERFORM_MASK_DISCOVERY = 29, - MASK_SUPPLIER = 30, - PERFORM_ROUTER_DISCOVERY = 31, - ROUTER_SOLICITATION_ADDRESS = 32, - STATIC_ROUTE = 33, - - /* Link Layer Parameters per Interface */ - - TRAILER_ENCAPSULATION = 34, - ARP_CACHE_TIMEOUT = 35, - ETHERNET_ENCAPSULATION = 36, - - /* TCP Parameters */ - - TCP_DEFAULT_TTL = 37, - TCP_KEEPALIVE_INTERVAL = 38, - TCP_KEEPALIVE_GARBAGE = 39, - - /* Application and Service Parameters */ - - NETWORK_INFORMATION_SERVICE_DOMAIN = 40, - NETWORK_INFORMATION_SERVERS = 41, - NETWORK_TIME_PROTOCOL_SERVERS = 42, - VENDOR_SPECIFIC_INFORMATION = 43, - NETBIOS_OVER_TCP_IP_NAME_SERVER = 44, - NETBIOS_OVER_TCP_IP_DATAGRAM_DISTRIBUTION_SERVER = 45, - NETBIOS_OVER_TCP_IP_NODE_TYPE = 46, - NETBIOS_OVER_TCP_IP_SCOPE = 47, - X_WINDOW_SYSTEM_FONT_SERVER = 48, - X_WINDOW_SYSTEM_DISPLAY_MANAGER = 49, - NETWORK_INFORMATION_SERVICE_PLUS_DOMAIN = 64, - NETWORK_INFORMATION_SERVICE_PLUS_SERVERS = 65, - MOBILE_IP_HOME_AGENT = 68, - SMTP_SERVER = 69, - POP3_SERVER = 70, - NNTP_SERVER = 71, - DEFAULT_WWW_SERVER = 72, - DEFAULT_FINGER_SERVER = 73, - DEFAULT_IRC_SERVER = 74, - STREETTALK_SERVER = 75, - STREETTALK_DIRECTORY_ASSISTANCE_SERVER = 76, - - /* DHCP Extensions */ - - REQUESTED_IP_ADDRESS = 50, - IP_ADDRESS_LEASE_TIME = 51, - OPTION_OVERLOAD = 52, - TFTP_SERVER_NAME = 66, - BOOTFILE_NAME = 67, - DHCP_MESSAGE_TYPE = 53, - SERVER_IDENTIFIER = 54, - PARAMETER_REQUEST_LIST = 55, - MESSAGE = 56, - MAXIMUM_DHCP_MESSAGE_SIZE = 57, - RENEWAL_T1_TIME_VALUE = 58, - REBINDING_T2_TIME_VALUE = 59, - VENDOR_CLASS_IDENTIFIER = 60, - CLIENT_IDENTIFIER = 61, - - USER_CLASS = 77, - FQDN = 81, - DHCP_AGENT_OPTIONS = 82, - NDS_SERVERS = 85, - NDS_TREE_NAME = 86, - NDS_CONTEXT = 87, - CLIENT_LAST_TRANSACTION_TIME = 91, - ASSOCIATED_IP = 92, - USER_AUTHENTICATION_PROTOCOL = 98, - AUTO_CONFIGURE = 116, - NAME_SERVICE_SEARCH = 117, - SUBNET_SELECTION = 118, - DOMAIN_SEARCH = 119, - CLASSLESS_ROUTE = 121, -} dhcp_msg_option; diff --git a/tools/sdk/include/lwip/esp_ping.h b/tools/sdk/include/lwip/esp_ping.h deleted file mode 100644 index 9abb883c233..00000000000 --- a/tools/sdk/include/lwip/esp_ping.h +++ /dev/null @@ -1,111 +0,0 @@ -// 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. - -#ifndef ESP_PING_H_ -#define ESP_PING_H_ - -#include "esp_err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -// gen_esp_err_to_name.py: include this as "esp_ping.h" because "components/lwip/include/apps/" is in the compiler path -// and not "components/lwip/include" - -#define ESP_ERR_PING_BASE 0x6000 - -#define ESP_ERR_PING_INVALID_PARAMS ESP_ERR_PING_BASE + 0x01 -#define ESP_ERR_PING_NO_MEM ESP_ERR_PING_BASE + 0x02 - -#define ESP_PING_CHECK_OPTLEN(optlen, opttype) do { if ((optlen) < sizeof(opttype)) { return ESP_ERR_PING_INVALID_PARAMS; }}while(0) - -typedef struct _ping_found { - uint32_t resp_time; - uint32_t timeout_count; - uint32_t send_count; - uint32_t recv_count; - uint32_t err_count; - uint32_t bytes; - uint32_t total_bytes; - uint32_t total_time; - uint32_t min_time; - uint32_t max_time; - int8_t ping_err; -} esp_ping_found; - -typedef enum { - PING_TARGET_IP_ADDRESS = 50, /**< target IP address */ - PING_TARGET_IP_ADDRESS_COUNT = 51, /**< target IP address total counter */ - PING_TARGET_RCV_TIMEO = 52, /**< receive timeout in milliseconds */ - PING_TARGET_DELAY_TIME = 53, /**< delay time in milliseconds */ - PING_TARGET_ID = 54, /**< identifier */ - PING_TARGET_RES_FN = 55, /**< ping result callback function */ - PING_TARGET_RES_RESET = 56, /**< ping result statistic reset */ - PING_TARGET_DATA_LEN = 57, /**< ping data length*/ - PING_TARGET_IP_TOS = 58 /**< ping QOS*/ -} ping_target_id_t; - -typedef enum { - PING_RES_TIMEOUT = 0, - PING_RES_OK = 1, - PING_RES_FINISH = 2, -} ping_res_t; - -typedef void (* esp_ping_found_fn)(ping_target_id_t found_id, esp_ping_found *found_val); - -/** - * @brief Set PING function option - * - * @param[in] opt_id: option index, 50 for IP, 51 for COUNT, 52 for RCV TIMEOUT, 53 for DELAY TIME, 54 for ID - * @param[in] opt_val: option parameter - * @param[in] opt_len: option length - * - * @return - * - ESP_OK - * - ESP_ERR_PING_INVALID_PARAMS - */ -esp_err_t esp_ping_set_target(ping_target_id_t opt_id, void *opt_val, uint32_t opt_len); - -/** - * @brief Get PING function option - * - * @param[in] opt_id: option index, 50 for IP, 51 for COUNT, 52 for RCV TIMEOUT, 53 for DELAY TIME, 54 for ID - * @param[in] opt_val: option parameter - * @param[in] opt_len: option length - * - * @return - * - ESP_OK - * - ESP_ERR_PING_INVALID_PARAMS - */ -esp_err_t esp_ping_get_target(ping_target_id_t opt_id, void *opt_val, uint32_t opt_len); - -/** - * @brief Get PING function result action - * - * @param[in] res_val: ping function action, 1 for successful, 0 for fail. - * res_len: response bytes - * res_time: response time - * - * @return - * - ESP_OK - * - ESP_ERR_PING_INVALID_PARAMS - */ -esp_err_t esp_ping_result(uint8_t res_val, uint16_t res_len, uint32_t res_time); - -#ifdef __cplusplus -} -#endif - -#endif /* ESP_PING_H_ */ diff --git a/tools/sdk/include/lwip/lwip/api.h b/tools/sdk/include/lwip/lwip/api.h deleted file mode 100644 index a4fed9bbfbf..00000000000 --- a/tools/sdk/include/lwip/lwip/api.h +++ /dev/null @@ -1,418 +0,0 @@ -/** - * @file - * netconn API (to be used from non-TCPIP threads) - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_API_H -#define LWIP_HDR_API_H - -#include "lwip/opt.h" - -#if LWIP_NETCONN || LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */ -/* Note: Netconn API is always available when sockets are enabled - - * sockets are implemented on top of them */ - -#include "lwip/arch.h" -#include "lwip/netbuf.h" -#include "lwip/sys.h" -#include "lwip/ip_addr.h" -#include "lwip/err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Throughout this file, IP addresses and port numbers are expected to be in - * the same byte order as in the corresponding pcb. - */ - -/* Flags for netconn_write (u8_t) */ -#define NETCONN_NOFLAG 0x00 -#define NETCONN_NOCOPY 0x00 /* Only for source code compatibility */ -#define NETCONN_COPY 0x01 -#define NETCONN_MORE 0x02 -#define NETCONN_DONTBLOCK 0x04 - -/* Flags for struct netconn.flags (u8_t) */ -/** Should this netconn avoid blocking? */ -#define NETCONN_FLAG_NON_BLOCKING 0x02 -/** Was the last connect action a non-blocking one? */ -#define NETCONN_FLAG_IN_NONBLOCKING_CONNECT 0x04 -#if ESP_AUTO_RECV -/** If this is set, a TCP netconn must call netconn_recved() to update - the TCP receive window (done automatically if not set). */ -#define NETCONN_FLAG_NO_AUTO_RECVED 0x08 -#endif -/** If a nonblocking write has been rejected before, poll_tcp needs to - check if the netconn is writable again */ -#define NETCONN_FLAG_CHECK_WRITESPACE 0x10 -#if LWIP_IPV6 -/** If this flag is set then only IPv6 communication is allowed on the - netconn. As per RFC#3493 this features defaults to OFF allowing - dual-stack usage by default. */ -#define NETCONN_FLAG_IPV6_V6ONLY 0x20 -#endif /* LWIP_IPV6 */ - - -/* Helpers to process several netconn_types by the same code */ -#define NETCONNTYPE_GROUP(t) ((t)&0xF0) -#define NETCONNTYPE_DATAGRAM(t) ((t)&0xE0) -#if LWIP_IPV6 -#define NETCONN_TYPE_IPV6 0x08 -#define NETCONNTYPE_ISIPV6(t) (((t)&NETCONN_TYPE_IPV6) != 0) -#define NETCONNTYPE_ISUDPLITE(t) (((t)&0xF3) == NETCONN_UDPLITE) -#define NETCONNTYPE_ISUDPNOCHKSUM(t) (((t)&0xF3) == NETCONN_UDPNOCHKSUM) -#else /* LWIP_IPV6 */ -#define NETCONNTYPE_ISIPV6(t) (0) -#define NETCONNTYPE_ISUDPLITE(t) ((t) == NETCONN_UDPLITE) -#define NETCONNTYPE_ISUDPNOCHKSUM(t) ((t) == NETCONN_UDPNOCHKSUM) -#endif /* LWIP_IPV6 */ - -/** @ingroup netconn_common - * Protocol family and type of the netconn - */ -enum netconn_type { - NETCONN_INVALID = 0, - /** TCP IPv4 */ - NETCONN_TCP = 0x10, -#if LWIP_IPV6 - /** TCP IPv6 */ - NETCONN_TCP_IPV6 = NETCONN_TCP | NETCONN_TYPE_IPV6 /* 0x18 */, -#endif /* LWIP_IPV6 */ - /** UDP IPv4 */ - NETCONN_UDP = 0x20, - /** UDP IPv4 lite */ - NETCONN_UDPLITE = 0x21, - /** UDP IPv4 no checksum */ - NETCONN_UDPNOCHKSUM = 0x22, - -#if LWIP_IPV6 - /** UDP IPv6 (dual-stack by default, unless you call @ref netconn_set_ipv6only) */ - NETCONN_UDP_IPV6 = NETCONN_UDP | NETCONN_TYPE_IPV6 /* 0x28 */, - /** UDP IPv6 lite (dual-stack by default, unless you call @ref netconn_set_ipv6only) */ - NETCONN_UDPLITE_IPV6 = NETCONN_UDPLITE | NETCONN_TYPE_IPV6 /* 0x29 */, - /** UDP IPv6 no checksum (dual-stack by default, unless you call @ref netconn_set_ipv6only) */ - NETCONN_UDPNOCHKSUM_IPV6 = NETCONN_UDPNOCHKSUM | NETCONN_TYPE_IPV6 /* 0x2a */, -#endif /* LWIP_IPV6 */ - - /** Raw connection IPv4 */ - NETCONN_RAW = 0x40 -#if LWIP_IPV6 - /** Raw connection IPv6 (dual-stack by default, unless you call @ref netconn_set_ipv6only) */ - , NETCONN_RAW_IPV6 = NETCONN_RAW | NETCONN_TYPE_IPV6 /* 0x48 */ -#endif /* LWIP_IPV6 */ -}; - -/** Current state of the netconn. Non-TCP netconns are always - * in state NETCONN_NONE! */ -enum netconn_state { - NETCONN_NONE, - NETCONN_WRITE, - NETCONN_LISTEN, - NETCONN_CONNECT, - NETCONN_CLOSE -}; - -/** Used to inform the callback function about changes - * - * Event explanation: - * - * In the netconn implementation, there are three ways to block a client: - * - * - accept mbox (sys_arch_mbox_fetch(&conn->acceptmbox, &accept_ptr, 0); in netconn_accept()) - * - receive mbox (sys_arch_mbox_fetch(&conn->recvmbox, &buf, 0); in netconn_recv_data()) - * - send queue is full (sys_arch_sem_wait(LWIP_API_MSG_SEM(msg), 0); in lwip_netconn_do_write()) - * - * The events have to be seen as events signaling the state of these mboxes/semaphores. For non-blocking - * connections, you need to know in advance whether a call to a netconn function call would block or not, - * and these events tell you about that. - * - * RCVPLUS events say: Safe to perform a potentially blocking call call once more. - * They are counted in sockets - three RCVPLUS events for accept mbox means you are safe - * to call netconn_accept 3 times without being blocked. - * Same thing for receive mbox. - * - * RCVMINUS events say: Your call to to a possibly blocking function is "acknowledged". - * Socket implementation decrements the counter. - * - * For TX, there is no need to count, its merely a flag. SENDPLUS means you may send something. - * SENDPLUS occurs when enough data was delivered to peer so netconn_send() can be called again. - * A SENDMINUS event occurs when the next call to a netconn_send() would be blocking. - */ -enum netconn_evt { - NETCONN_EVT_RCVPLUS, - NETCONN_EVT_RCVMINUS, - NETCONN_EVT_SENDPLUS, - NETCONN_EVT_SENDMINUS, - NETCONN_EVT_ERROR -}; - -#if LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) -/** Used for netconn_join_leave_group() */ -enum netconn_igmp { - NETCONN_JOIN, - NETCONN_LEAVE -}; -#endif /* LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) */ - -#if LWIP_DNS -/* Used for netconn_gethostbyname_addrtype(), these should match the DNS_ADDRTYPE defines in dns.h */ -#define NETCONN_DNS_DEFAULT NETCONN_DNS_IPV4_IPV6 -#define NETCONN_DNS_IPV4 0 -#define NETCONN_DNS_IPV6 1 -#define NETCONN_DNS_IPV4_IPV6 2 /* try to resolve IPv4 first, try IPv6 if IPv4 fails only */ -#define NETCONN_DNS_IPV6_IPV4 3 /* try to resolve IPv6 first, try IPv4 if IPv6 fails only */ -#endif /* LWIP_DNS */ - -/* forward-declare some structs to avoid to include their headers */ -struct ip_pcb; -struct tcp_pcb; -struct udp_pcb; -struct raw_pcb; -struct netconn; -struct api_msg; - -/** A callback prototype to inform about events for a netconn */ -typedef void (* netconn_callback)(struct netconn *, enum netconn_evt, u16_t len); - -/** A netconn descriptor */ -struct netconn { - /** type of the netconn (TCP, UDP or RAW) */ - enum netconn_type type; - /** current state of the netconn */ - enum netconn_state state; - /** the lwIP internal protocol control block */ - union { - struct ip_pcb *ip; - struct tcp_pcb *tcp; - struct udp_pcb *udp; - struct raw_pcb *raw; - } pcb; - /** the last error this netconn had */ - err_t last_err; -#if !LWIP_NETCONN_SEM_PER_THREAD - /** sem that is used to synchronously execute functions in the core context */ - sys_sem_t op_completed; -#endif - /** mbox where received packets are stored until they are fetched - by the netconn application thread (can grow quite big) */ - sys_mbox_t recvmbox; -#if LWIP_TCP - /** mbox where new connections are stored until processed - by the application thread */ - sys_mbox_t acceptmbox; -#endif /* LWIP_TCP */ - /** only used for socket layer */ -#if LWIP_SOCKET - int socket; -#endif /* LWIP_SOCKET */ -#if LWIP_SO_SNDTIMEO - /** timeout to wait for sending data (which means enqueueing data for sending - in internal buffers) in milliseconds */ - s32_t send_timeout; -#endif /* LWIP_SO_RCVTIMEO */ -#if LWIP_SO_RCVTIMEO - /** timeout in milliseconds to wait for new data to be received - (or connections to arrive for listening netconns) */ - int recv_timeout; -#endif /* LWIP_SO_RCVTIMEO */ -#if LWIP_SO_RCVBUF - /** maximum amount of bytes queued in recvmbox - not used for TCP: adjust TCP_WND instead! */ - int recv_bufsize; - /** number of bytes currently in recvmbox to be received, - tested against recv_bufsize to limit bytes on recvmbox - for UDP and RAW, used for FIONREAD */ - int recv_avail; -#endif /* LWIP_SO_RCVBUF */ -#if LWIP_SO_LINGER - /** values <0 mean linger is disabled, values > 0 are seconds to linger */ - s16_t linger; -#endif /* LWIP_SO_LINGER */ - /** flags holding more netconn-internal state, see NETCONN_FLAG_* defines */ - u8_t flags; -#if LWIP_TCP - /** TCP: when data passed to netconn_write doesn't fit into the send buffer, - this temporarily stores how much is already sent. */ - size_t write_offset; - /** TCP: when data passed to netconn_write doesn't fit into the send buffer, - this temporarily stores the message. - Also used during connect and close. */ - struct api_msg *current_msg; -#endif /* LWIP_TCP */ - /** A callback function that is informed about events for this netconn */ - netconn_callback callback; -}; - -/** Register an Network connection event */ -#define API_EVENT(c,e,l) if (c->callback) { \ - (*c->callback)(c, e, l); \ - } - -/** Set conn->last_err to err but don't overwrite fatal errors */ -#define NETCONN_SET_SAFE_ERR(conn, err) do { if ((conn) != NULL) { \ - SYS_ARCH_DECL_PROTECT(netconn_set_safe_err_lev); \ - SYS_ARCH_PROTECT(netconn_set_safe_err_lev); \ - if (!ERR_IS_FATAL((conn)->last_err)) { \ - (conn)->last_err = err; \ - } \ - SYS_ARCH_UNPROTECT(netconn_set_safe_err_lev); \ -}} while(0); - -/* Network connection functions: */ - -/** @ingroup netconn_common - * Create new netconn connection - * @param t @ref netconn_type */ -#define netconn_new(t) netconn_new_with_proto_and_callback(t, 0, NULL) -#define netconn_new_with_callback(t, c) netconn_new_with_proto_and_callback(t, 0, c) -struct netconn *netconn_new_with_proto_and_callback(enum netconn_type t, u8_t proto, - netconn_callback callback); -err_t netconn_delete(struct netconn *conn); -/** Get the type of a netconn (as enum netconn_type). */ -#define netconn_type(conn) (conn->type) - -err_t netconn_getaddr(struct netconn *conn, ip_addr_t *addr, - u16_t *port, u8_t local); -/** @ingroup netconn_common */ -#define netconn_peer(c,i,p) netconn_getaddr(c,i,p,0) -/** @ingroup netconn_common */ -#define netconn_addr(c,i,p) netconn_getaddr(c,i,p,1) - -err_t netconn_bind(struct netconn *conn, const ip_addr_t *addr, u16_t port); -err_t netconn_connect(struct netconn *conn, const ip_addr_t *addr, u16_t port); -err_t netconn_disconnect (struct netconn *conn); -err_t netconn_listen_with_backlog(struct netconn *conn, u8_t backlog); -/** @ingroup netconn_tcp */ -#define netconn_listen(conn) netconn_listen_with_backlog(conn, TCP_DEFAULT_LISTEN_BACKLOG) -err_t netconn_accept(struct netconn *conn, struct netconn **new_conn); -err_t netconn_recv(struct netconn *conn, struct netbuf **new_buf); -err_t netconn_recv_tcp_pbuf(struct netconn *conn, struct pbuf **new_buf); -#if ESP_AUTO_RECV -void netconn_recved(struct netconn *conn, u32_t length); -#endif -err_t netconn_sendto(struct netconn *conn, struct netbuf *buf, - const ip_addr_t *addr, u16_t port); -err_t netconn_send(struct netconn *conn, struct netbuf *buf); -err_t netconn_write_partly(struct netconn *conn, const void *dataptr, size_t size, - u8_t apiflags, size_t *bytes_written); -/** @ingroup netconn_tcp */ -#define netconn_write(conn, dataptr, size, apiflags) \ - netconn_write_partly(conn, dataptr, size, apiflags, NULL) -err_t netconn_close(struct netconn *conn); -err_t netconn_shutdown(struct netconn *conn, u8_t shut_rx, u8_t shut_tx); - -#if LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) -err_t netconn_join_leave_group(struct netconn *conn, const ip_addr_t *multiaddr, - const ip_addr_t *netif_addr, enum netconn_igmp join_or_leave); -#endif /* LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) */ -#if LWIP_DNS -#if LWIP_IPV4 && LWIP_IPV6 -err_t netconn_gethostbyname_addrtype(const char *name, ip_addr_t *addr, u8_t dns_addrtype); -#define netconn_gethostbyname(name, addr) netconn_gethostbyname_addrtype(name, addr, NETCONN_DNS_DEFAULT) -#else /* LWIP_IPV4 && LWIP_IPV6 */ -err_t netconn_gethostbyname(const char *name, ip_addr_t *addr); -#define netconn_gethostbyname_addrtype(name, addr, dns_addrtype) netconn_gethostbyname(name, addr) -#endif /* LWIP_IPV4 && LWIP_IPV6 */ -#endif /* LWIP_DNS */ - -#define netconn_err(conn) ((conn)->last_err) -#define netconn_recv_bufsize(conn) ((conn)->recv_bufsize) - -/** Set the blocking status of netconn calls (@todo: write/send is missing) */ -#define netconn_set_nonblocking(conn, val) do { if(val) { \ - (conn)->flags |= NETCONN_FLAG_NON_BLOCKING; \ -} else { \ - (conn)->flags &= ~ NETCONN_FLAG_NON_BLOCKING; }} while(0) -/** Get the blocking status of netconn calls (@todo: write/send is missing) */ -#define netconn_is_nonblocking(conn) (((conn)->flags & NETCONN_FLAG_NON_BLOCKING) != 0) - -#if ESP_AUTO_RECV -/** TCP: Set the no-auto-recved status of netconn calls (see NETCONN_FLAG_NO_AUTO_RECVED) */ -#define netconn_set_noautorecved(conn, val) do { if(val) { \ - (conn)->flags |= NETCONN_FLAG_NO_AUTO_RECVED; \ -} else { \ - (conn)->flags &= ~ NETCONN_FLAG_NO_AUTO_RECVED; }} while(0) -/** TCP: Get the no-auto-recved status of netconn calls (see NETCONN_FLAG_NO_AUTO_RECVED) */ -#define netconn_get_noautorecved(conn) (((conn)->flags & NETCONN_FLAG_NO_AUTO_RECVED) != 0) -#endif - -#if LWIP_IPV6 -/** @ingroup netconn_common - * TCP: Set the IPv6 ONLY status of netconn calls (see NETCONN_FLAG_IPV6_V6ONLY) - */ -#define netconn_set_ipv6only(conn, val) do { if(val) { \ - (conn)->flags |= NETCONN_FLAG_IPV6_V6ONLY; \ -} else { \ - (conn)->flags &= ~ NETCONN_FLAG_IPV6_V6ONLY; }} while(0) -/** @ingroup netconn_common - * TCP: Get the IPv6 ONLY status of netconn calls (see NETCONN_FLAG_IPV6_V6ONLY) - */ -#define netconn_get_ipv6only(conn) (((conn)->flags & NETCONN_FLAG_IPV6_V6ONLY) != 0) -#endif /* LWIP_IPV6 */ - -#if LWIP_SO_SNDTIMEO -/** Set the send timeout in milliseconds */ -#define netconn_set_sendtimeout(conn, timeout) ((conn)->send_timeout = (timeout)) -/** Get the send timeout in milliseconds */ -#define netconn_get_sendtimeout(conn) ((conn)->send_timeout) -#endif /* LWIP_SO_SNDTIMEO */ -#if LWIP_SO_RCVTIMEO -/** Set the receive timeout in milliseconds */ -#define netconn_set_recvtimeout(conn, timeout) ((conn)->recv_timeout = (timeout)) -/** Get the receive timeout in milliseconds */ -#define netconn_get_recvtimeout(conn) ((conn)->recv_timeout) -#endif /* LWIP_SO_RCVTIMEO */ -#if LWIP_SO_RCVBUF -/** Set the receive buffer in bytes */ -#define netconn_set_recvbufsize(conn, recvbufsize) ((conn)->recv_bufsize = (recvbufsize)) -/** Get the receive buffer in bytes */ -#define netconn_get_recvbufsize(conn) ((conn)->recv_bufsize) -#endif /* LWIP_SO_RCVBUF*/ - -#if LWIP_NETCONN_SEM_PER_THREAD -void netconn_thread_init(void); -void netconn_thread_cleanup(void); -#else /* LWIP_NETCONN_SEM_PER_THREAD */ -#define netconn_thread_init() -#define netconn_thread_cleanup() -#endif /* LWIP_NETCONN_SEM_PER_THREAD */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_NETCONN || LWIP_SOCKET */ - -#endif /* LWIP_HDR_API_H */ diff --git a/tools/sdk/include/lwip/lwip/apps/fs.h b/tools/sdk/include/lwip/lwip/apps/fs.h deleted file mode 100644 index bb176fa0107..00000000000 --- a/tools/sdk/include/lwip/lwip/apps/fs.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_APPS_FS_H -#define LWIP_HDR_APPS_FS_H - -#include "httpd_opts.h" -#include "lwip/err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define FS_READ_EOF -1 -#define FS_READ_DELAYED -2 - -#if HTTPD_PRECALCULATED_CHECKSUM -struct fsdata_chksum { - u32_t offset; - u16_t chksum; - u16_t len; -}; -#endif /* HTTPD_PRECALCULATED_CHECKSUM */ - -#define FS_FILE_FLAGS_HEADER_INCLUDED 0x01 -#define FS_FILE_FLAGS_HEADER_PERSISTENT 0x02 - -struct fs_file { - const char *data; - int len; - int index; - void *pextension; -#if HTTPD_PRECALCULATED_CHECKSUM - const struct fsdata_chksum *chksum; - u16_t chksum_count; -#endif /* HTTPD_PRECALCULATED_CHECKSUM */ - u8_t flags; -#if LWIP_HTTPD_CUSTOM_FILES - u8_t is_custom_file; -#endif /* LWIP_HTTPD_CUSTOM_FILES */ -#if LWIP_HTTPD_FILE_STATE - void *state; -#endif /* LWIP_HTTPD_FILE_STATE */ -}; - -#if LWIP_HTTPD_FS_ASYNC_READ -typedef void (*fs_wait_cb)(void *arg); -#endif /* LWIP_HTTPD_FS_ASYNC_READ */ - -err_t fs_open(struct fs_file *file, const char *name); -void fs_close(struct fs_file *file); -#if LWIP_HTTPD_DYNAMIC_FILE_READ -#if LWIP_HTTPD_FS_ASYNC_READ -int fs_read_async(struct fs_file *file, char *buffer, int count, fs_wait_cb callback_fn, void *callback_arg); -#else /* LWIP_HTTPD_FS_ASYNC_READ */ -int fs_read(struct fs_file *file, char *buffer, int count); -#endif /* LWIP_HTTPD_FS_ASYNC_READ */ -#endif /* LWIP_HTTPD_DYNAMIC_FILE_READ */ -#if LWIP_HTTPD_FS_ASYNC_READ -int fs_is_file_ready(struct fs_file *file, fs_wait_cb callback_fn, void *callback_arg); -#endif /* LWIP_HTTPD_FS_ASYNC_READ */ -int fs_bytes_left(struct fs_file *file); - -#if LWIP_HTTPD_FILE_STATE -/** This user-defined function is called when a file is opened. */ -void *fs_state_init(struct fs_file *file, const char *name); -/** This user-defined function is called when a file is closed. */ -void fs_state_free(struct fs_file *file, void *state); -#endif /* #if LWIP_HTTPD_FILE_STATE */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_APPS_FS_H */ diff --git a/tools/sdk/include/lwip/lwip/apps/httpd.h b/tools/sdk/include/lwip/lwip/apps/httpd.h deleted file mode 100644 index 40f1811e574..00000000000 --- a/tools/sdk/include/lwip/lwip/apps/httpd.h +++ /dev/null @@ -1,236 +0,0 @@ -/** - * @file - * HTTP server - */ - -/* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - * This version of the file has been modified by Texas Instruments to offer - * simple server-side-include (SSI) and Common Gateway Interface (CGI) - * capability. - */ - -#ifndef LWIP_HDR_APPS_HTTPD_H -#define LWIP_HDR_APPS_HTTPD_H - -#include "httpd_opts.h" -#include "lwip/err.h" -#include "lwip/pbuf.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if LWIP_HTTPD_CGI - -/* - * Function pointer for a CGI script handler. - * - * This function is called each time the HTTPD server is asked for a file - * whose name was previously registered as a CGI function using a call to - * http_set_cgi_handler. The iIndex parameter provides the index of the - * CGI within the ppcURLs array passed to http_set_cgi_handler. Parameters - * pcParam and pcValue provide access to the parameters provided along with - * the URI. iNumParams provides a count of the entries in the pcParam and - * pcValue arrays. Each entry in the pcParam array contains the name of a - * parameter with the corresponding entry in the pcValue array containing the - * value for that parameter. Note that pcParam may contain multiple elements - * with the same name if, for example, a multi-selection list control is used - * in the form generating the data. - * - * The function should return a pointer to a character string which is the - * path and filename of the response that is to be sent to the connected - * browser, for example "/thanks.htm" or "/response/error.ssi". - * - * The maximum number of parameters that will be passed to this function via - * iNumParams is defined by LWIP_HTTPD_MAX_CGI_PARAMETERS. Any parameters in the incoming - * HTTP request above this number will be discarded. - * - * Requests intended for use by this CGI mechanism must be sent using the GET - * method (which encodes all parameters within the URI rather than in a block - * later in the request). Attempts to use the POST method will result in the - * request being ignored. - * - */ -typedef const char *(*tCGIHandler)(int iIndex, int iNumParams, char *pcParam[], - char *pcValue[]); - -/* - * Structure defining the base filename (URL) of a CGI and the associated - * function which is to be called when that URL is requested. - */ -typedef struct -{ - const char *pcCGIName; - tCGIHandler pfnCGIHandler; -} tCGI; - -void http_set_cgi_handlers(const tCGI *pCGIs, int iNumHandlers); - -#endif /* LWIP_HTTPD_CGI */ - -#if LWIP_HTTPD_CGI || LWIP_HTTPD_CGI_SSI - -#if LWIP_HTTPD_CGI_SSI -/** Define this generic CGI handler in your application. - * It is called once for every URI with parameters. - * The parameters can be stored to - */ -extern void httpd_cgi_handler(const char* uri, int iNumParams, char **pcParam, char **pcValue -#if defined(LWIP_HTTPD_FILE_STATE) && LWIP_HTTPD_FILE_STATE - , void *connection_state -#endif /* LWIP_HTTPD_FILE_STATE */ - ); -#endif /* LWIP_HTTPD_CGI_SSI */ - -#endif /* LWIP_HTTPD_CGI || LWIP_HTTPD_CGI_SSI */ - -#if LWIP_HTTPD_SSI - -/* - * Function pointer for the SSI tag handler callback. - * - * This function will be called each time the HTTPD server detects a tag of the - * form in a .shtml, .ssi or .shtm file where "name" appears as - * one of the tags supplied to http_set_ssi_handler in the ppcTags array. The - * returned insert string, which will be appended after the the string - * "" in file sent back to the client,should be written to pointer - * pcInsert. iInsertLen contains the size of the buffer pointed to by - * pcInsert. The iIndex parameter provides the zero-based index of the tag as - * found in the ppcTags array and identifies the tag that is to be processed. - * - * The handler returns the number of characters written to pcInsert excluding - * any terminating NULL or a negative number to indicate a failure (tag not - * recognized, for example). - * - * Note that the behavior of this SSI mechanism is somewhat different from the - * "normal" SSI processing as found in, for example, the Apache web server. In - * this case, the inserted text is appended following the SSI tag rather than - * replacing the tag entirely. This allows for an implementation that does not - * require significant additional buffering of output data yet which will still - * offer usable SSI functionality. One downside to this approach is when - * attempting to use SSI within JavaScript. The SSI tag is structured to - * resemble an HTML comment but this syntax does not constitute a comment - * within JavaScript and, hence, leaving the tag in place will result in - * problems in these cases. To work around this, any SSI tag which needs to - * output JavaScript code must do so in an encapsulated way, sending the whole - * HTML section as a single include. - */ -typedef u16_t (*tSSIHandler)( -#if LWIP_HTTPD_SSI_RAW - const char* ssi_tag_name, -#else /* LWIP_HTTPD_SSI_RAW */ - int iIndex, -#endif /* LWIP_HTTPD_SSI_RAW */ - char *pcInsert, int iInsertLen -#if LWIP_HTTPD_SSI_MULTIPART - , u16_t current_tag_part, u16_t *next_tag_part -#endif /* LWIP_HTTPD_SSI_MULTIPART */ -#if defined(LWIP_HTTPD_FILE_STATE) && LWIP_HTTPD_FILE_STATE - , void *connection_state -#endif /* LWIP_HTTPD_FILE_STATE */ - ); - -/** Set the SSI handler function - * (if LWIP_HTTPD_SSI_RAW==1, only the first argument is used) - */ -void http_set_ssi_handler(tSSIHandler pfnSSIHandler, - const char **ppcTags, int iNumTags); - -/** For LWIP_HTTPD_SSI_RAW==1, return this to indicate the tag is unknown. - * In this case, the webserver writes a warning into the page. - * You can also just return 0 to write nothing for unknown tags. - */ -#define HTTPD_SSI_TAG_UNKNOWN 0xFFFF - -#endif /* LWIP_HTTPD_SSI */ - -#if LWIP_HTTPD_SUPPORT_POST - -/* These functions must be implemented by the application */ - -/** Called when a POST request has been received. The application can decide - * whether to accept it or not. - * - * @param connection Unique connection identifier, valid until httpd_post_end - * is called. - * @param uri The HTTP header URI receiving the POST request. - * @param http_request The raw HTTP request (the first packet, normally). - * @param http_request_len Size of 'http_request'. - * @param content_len Content-Length from HTTP header. - * @param response_uri Filename of response file, to be filled when denying the - * request - * @param response_uri_len Size of the 'response_uri' buffer. - * @param post_auto_wnd Set this to 0 to let the callback code handle window - * updates by calling 'httpd_post_data_recved' (to throttle rx speed) - * default is 1 (httpd handles window updates automatically) - * @return ERR_OK: Accept the POST request, data may be passed in - * another err_t: Deny the POST request, send back 'bad request'. - */ -err_t httpd_post_begin(void *connection, const char *uri, const char *http_request, - u16_t http_request_len, int content_len, char *response_uri, - u16_t response_uri_len, u8_t *post_auto_wnd); - -/** Called for each pbuf of data that has been received for a POST. - * ATTENTION: The application is responsible for freeing the pbufs passed in! - * - * @param connection Unique connection identifier. - * @param p Received data. - * @return ERR_OK: Data accepted. - * another err_t: Data denied, http_post_get_response_uri will be called. - */ -err_t httpd_post_receive_data(void *connection, struct pbuf *p); - -/** Called when all data is received or when the connection is closed. - * The application must return the filename/URI of a file to send in response - * to this POST request. If the response_uri buffer is untouched, a 404 - * response is returned. - * - * @param connection Unique connection identifier. - * @param response_uri Filename of response file, to be filled when denying the request - * @param response_uri_len Size of the 'response_uri' buffer. - */ -void httpd_post_finished(void *connection, char *response_uri, u16_t response_uri_len); - -#if LWIP_HTTPD_POST_MANUAL_WND -void httpd_post_data_recved(void *connection, u16_t recved_len); -#endif /* LWIP_HTTPD_POST_MANUAL_WND */ - -#endif /* LWIP_HTTPD_SUPPORT_POST */ - -void httpd_init(void); - - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HTTPD_H */ diff --git a/tools/sdk/include/lwip/lwip/apps/httpd_opts.h b/tools/sdk/include/lwip/lwip/apps/httpd_opts.h deleted file mode 100644 index 340db15f663..00000000000 --- a/tools/sdk/include/lwip/lwip/apps/httpd_opts.h +++ /dev/null @@ -1,323 +0,0 @@ -/** - * @file - * HTTP server options list - */ - -/* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - * This version of the file has been modified by Texas Instruments to offer - * simple server-side-include (SSI) and Common Gateway Interface (CGI) - * capability. - */ - -#ifndef LWIP_HDR_APPS_HTTPD_OPTS_H -#define LWIP_HDR_APPS_HTTPD_OPTS_H - -#include "lwip/opt.h" - -/** - * @defgroup httpd_opts Options - * @ingroup httpd - * @{ - */ - -/** Set this to 1 to support CGI (old style) */ -#if !defined LWIP_HTTPD_CGI || defined __DOXYGEN__ -#define LWIP_HTTPD_CGI 0 -#endif - -/** Set this to 1 to support CGI (new style) */ -#if !defined LWIP_HTTPD_CGI_SSI || defined __DOXYGEN__ -#define LWIP_HTTPD_CGI_SSI 0 -#endif - -/** Set this to 1 to support SSI (Server-Side-Includes) */ -#if !defined LWIP_HTTPD_SSI || defined __DOXYGEN__ -#define LWIP_HTTPD_SSI 0 -#endif - -/** Set this to 1 to implement an SSI tag handler callback that gets a const char* - * to the tag (instead of an index into a pre-registered array of known tags) */ -#if !defined LWIP_HTTPD_SSI_RAW || defined __DOXYGEN__ -#define LWIP_HTTPD_SSI_RAW 0 -#endif - -/** Set this to 1 to support HTTP POST */ -#if !defined LWIP_HTTPD_SUPPORT_POST || defined __DOXYGEN__ -#define LWIP_HTTPD_SUPPORT_POST 0 -#endif - -/* The maximum number of parameters that the CGI handler can be sent. */ -#if !defined LWIP_HTTPD_MAX_CGI_PARAMETERS || defined __DOXYGEN__ -#define LWIP_HTTPD_MAX_CGI_PARAMETERS 16 -#endif - -/** LWIP_HTTPD_SSI_MULTIPART==1: SSI handler function is called with 2 more - * arguments indicating a counter for insert string that are too long to be - * inserted at once: the SSI handler function must then set 'next_tag_part' - * which will be passed back to it in the next call. */ -#if !defined LWIP_HTTPD_SSI_MULTIPART || defined __DOXYGEN__ -#define LWIP_HTTPD_SSI_MULTIPART 0 -#endif - -/* The maximum length of the string comprising the tag name */ -#if !defined LWIP_HTTPD_MAX_TAG_NAME_LEN || defined __DOXYGEN__ -#define LWIP_HTTPD_MAX_TAG_NAME_LEN 8 -#endif - -/* The maximum length of string that can be returned to replace any given tag */ -#if !defined LWIP_HTTPD_MAX_TAG_INSERT_LEN || defined __DOXYGEN__ -#define LWIP_HTTPD_MAX_TAG_INSERT_LEN 192 -#endif - -#if !defined LWIP_HTTPD_POST_MANUAL_WND || defined __DOXYGEN__ -#define LWIP_HTTPD_POST_MANUAL_WND 0 -#endif - -/** This string is passed in the HTTP header as "Server: " */ -#if !defined HTTPD_SERVER_AGENT || defined __DOXYGEN__ -#define HTTPD_SERVER_AGENT "lwIP/" LWIP_VERSION_STRING " (http://savannah.nongnu.org/projects/lwip)" -#endif - -/** Set this to 1 if you want to include code that creates HTTP headers - * at runtime. Default is off: HTTP headers are then created statically - * by the makefsdata tool. Static headers mean smaller code size, but - * the (readonly) fsdata will grow a bit as every file includes the HTTP - * header. */ -#if !defined LWIP_HTTPD_DYNAMIC_HEADERS || defined __DOXYGEN__ -#define LWIP_HTTPD_DYNAMIC_HEADERS 0 -#endif - -#if !defined HTTPD_DEBUG || defined __DOXYGEN__ -#define HTTPD_DEBUG LWIP_DBG_OFF -#endif - -/** Set this to 1 to use a memp pool for allocating - * struct http_state instead of the heap. - */ -#if !defined HTTPD_USE_MEM_POOL || defined __DOXYGEN__ -#define HTTPD_USE_MEM_POOL 0 -#endif - -/** The server port for HTTPD to use */ -#if !defined HTTPD_SERVER_PORT || defined __DOXYGEN__ -#define HTTPD_SERVER_PORT 80 -#endif - -/** Maximum retries before the connection is aborted/closed. - * - number of times pcb->poll is called -> default is 4*500ms = 2s; - * - reset when pcb->sent is called - */ -#if !defined HTTPD_MAX_RETRIES || defined __DOXYGEN__ -#define HTTPD_MAX_RETRIES 4 -#endif - -/** The poll delay is X*500ms */ -#if !defined HTTPD_POLL_INTERVAL || defined __DOXYGEN__ -#define HTTPD_POLL_INTERVAL 4 -#endif - -/** Priority for tcp pcbs created by HTTPD (very low by default). - * Lower priorities get killed first when running out of memory. - */ -#if !defined HTTPD_TCP_PRIO || defined __DOXYGEN__ -#define HTTPD_TCP_PRIO TCP_PRIO_MIN -#endif - -/** Set this to 1 to enable timing each file sent */ -#if !defined LWIP_HTTPD_TIMING || defined __DOXYGEN__ -#define LWIP_HTTPD_TIMING 0 -#endif -/** Set this to 1 to enable timing each file sent */ -#if !defined HTTPD_DEBUG_TIMING || defined __DOXYGEN__ -#define HTTPD_DEBUG_TIMING LWIP_DBG_OFF -#endif - -/** Set this to one to show error pages when parsing a request fails instead - of simply closing the connection. */ -#if !defined LWIP_HTTPD_SUPPORT_EXTSTATUS || defined __DOXYGEN__ -#define LWIP_HTTPD_SUPPORT_EXTSTATUS 0 -#endif - -/** Set this to 0 to drop support for HTTP/0.9 clients (to save some bytes) */ -#if !defined LWIP_HTTPD_SUPPORT_V09 || defined __DOXYGEN__ -#define LWIP_HTTPD_SUPPORT_V09 1 -#endif - -/** Set this to 1 to enable HTTP/1.1 persistent connections. - * ATTENTION: If the generated file system includes HTTP headers, these must - * include the "Connection: keep-alive" header (pass argument "-11" to makefsdata). - */ -#if !defined LWIP_HTTPD_SUPPORT_11_KEEPALIVE || defined __DOXYGEN__ -#define LWIP_HTTPD_SUPPORT_11_KEEPALIVE 0 -#endif - -/** Set this to 1 to support HTTP request coming in in multiple packets/pbufs */ -#if !defined LWIP_HTTPD_SUPPORT_REQUESTLIST || defined __DOXYGEN__ -#define LWIP_HTTPD_SUPPORT_REQUESTLIST 1 -#endif - -#if LWIP_HTTPD_SUPPORT_REQUESTLIST -/** Number of rx pbufs to enqueue to parse an incoming request (up to the first - newline) */ -#if !defined LWIP_HTTPD_REQ_QUEUELEN || defined __DOXYGEN__ -#define LWIP_HTTPD_REQ_QUEUELEN 5 -#endif - -/** Number of (TCP payload-) bytes (in pbufs) to enqueue to parse and incoming - request (up to the first double-newline) */ -#if !defined LWIP_HTTPD_REQ_BUFSIZE || defined __DOXYGEN__ -#define LWIP_HTTPD_REQ_BUFSIZE LWIP_HTTPD_MAX_REQ_LENGTH -#endif - -/** Defines the maximum length of a HTTP request line (up to the first CRLF, - copied from pbuf into this a global buffer when pbuf- or packet-queues - are received - otherwise the input pbuf is used directly) */ -#if !defined LWIP_HTTPD_MAX_REQ_LENGTH || defined __DOXYGEN__ -#define LWIP_HTTPD_MAX_REQ_LENGTH LWIP_MIN(1023, (LWIP_HTTPD_REQ_QUEUELEN * PBUF_POOL_BUFSIZE)) -#endif -#endif /* LWIP_HTTPD_SUPPORT_REQUESTLIST */ - -/** This is the size of a static buffer used when URIs end with '/'. - * In this buffer, the directory requested is concatenated with all the - * configured default file names. - * Set to 0 to disable checking default filenames on non-root directories. - */ -#if !defined LWIP_HTTPD_MAX_REQUEST_URI_LEN || defined __DOXYGEN__ -#define LWIP_HTTPD_MAX_REQUEST_URI_LEN 63 -#endif - -/** Maximum length of the filename to send as response to a POST request, - * filled in by the application when a POST is finished. - */ -#if !defined LWIP_HTTPD_POST_MAX_RESPONSE_URI_LEN || defined __DOXYGEN__ -#define LWIP_HTTPD_POST_MAX_RESPONSE_URI_LEN 63 -#endif - -/** Set this to 0 to not send the SSI tag (default is on, so the tag will - * be sent in the HTML page */ -#if !defined LWIP_HTTPD_SSI_INCLUDE_TAG || defined __DOXYGEN__ -#define LWIP_HTTPD_SSI_INCLUDE_TAG 1 -#endif - -/** Set this to 1 to call tcp_abort when tcp_close fails with memory error. - * This can be used to prevent consuming all memory in situations where the - * HTTP server has low priority compared to other communication. */ -#if !defined LWIP_HTTPD_ABORT_ON_CLOSE_MEM_ERROR || defined __DOXYGEN__ -#define LWIP_HTTPD_ABORT_ON_CLOSE_MEM_ERROR 0 -#endif - -/** Set this to 1 to kill the oldest connection when running out of - * memory for 'struct http_state' or 'struct http_ssi_state'. - * ATTENTION: This puts all connections on a linked list, so may be kind of slow. - */ -#if !defined LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED || defined __DOXYGEN__ -#define LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED 0 -#endif - -/** Set this to 1 to send URIs without extension without headers - * (who uses this at all??) */ -#if !defined LWIP_HTTPD_OMIT_HEADER_FOR_EXTENSIONLESS_URI || defined __DOXYGEN__ -#define LWIP_HTTPD_OMIT_HEADER_FOR_EXTENSIONLESS_URI 0 -#endif - -/** Default: Tags are sent from struct http_state and are therefore volatile */ -#if !defined HTTP_IS_TAG_VOLATILE || defined __DOXYGEN__ -#define HTTP_IS_TAG_VOLATILE(ptr) TCP_WRITE_FLAG_COPY -#endif - -/* By default, the httpd is limited to send 2*pcb->mss to keep resource usage low - when http is not an important protocol in the device. */ -#if !defined HTTPD_LIMIT_SENDING_TO_2MSS || defined __DOXYGEN__ -#define HTTPD_LIMIT_SENDING_TO_2MSS 1 -#endif - -/* Define this to a function that returns the maximum amount of data to enqueue. - The function have this signature: u16_t fn(struct tcp_pcb* pcb); */ -#if !defined HTTPD_MAX_WRITE_LEN || defined __DOXYGEN__ -#if HTTPD_LIMIT_SENDING_TO_2MSS -#define HTTPD_MAX_WRITE_LEN(pcb) (2 * tcp_mss(pcb)) -#endif -#endif - -/*------------------- FS OPTIONS -------------------*/ - -/** Set this to 1 and provide the functions: - * - "int fs_open_custom(struct fs_file *file, const char *name)" - * Called first for every opened file to allow opening files - * that are not included in fsdata(_custom).c - * - "void fs_close_custom(struct fs_file *file)" - * Called to free resources allocated by fs_open_custom(). - */ -#if !defined LWIP_HTTPD_CUSTOM_FILES || defined __DOXYGEN__ -#define LWIP_HTTPD_CUSTOM_FILES 0 -#endif - -/** Set this to 1 to support fs_read() to dynamically read file data. - * Without this (default=off), only one-block files are supported, - * and the contents must be ready after fs_open(). - */ -#if !defined LWIP_HTTPD_DYNAMIC_FILE_READ || defined __DOXYGEN__ -#define LWIP_HTTPD_DYNAMIC_FILE_READ 0 -#endif - -/** Set this to 1 to include an application state argument per file - * that is opened. This allows to keep a state per connection/file. - */ -#if !defined LWIP_HTTPD_FILE_STATE || defined __DOXYGEN__ -#define LWIP_HTTPD_FILE_STATE 0 -#endif - -/** HTTPD_PRECALCULATED_CHECKSUM==1: include precompiled checksums for - * predefined (MSS-sized) chunks of the files to prevent having to calculate - * the checksums at runtime. */ -#if !defined HTTPD_PRECALCULATED_CHECKSUM || defined __DOXYGEN__ -#define HTTPD_PRECALCULATED_CHECKSUM 0 -#endif - -/** LWIP_HTTPD_FS_ASYNC_READ==1: support asynchronous read operations - * (fs_read_async returns FS_READ_DELAYED and calls a callback when finished). - */ -#if !defined LWIP_HTTPD_FS_ASYNC_READ || defined __DOXYGEN__ -#define LWIP_HTTPD_FS_ASYNC_READ 0 -#endif - -/** Set this to 1 to include "fsdata_custom.c" instead of "fsdata.c" for the - * file system (to prevent changing the file included in CVS) */ -#if !defined HTTPD_USE_CUSTOM_FSDATA || defined __DOXYGEN__ -#define HTTPD_USE_CUSTOM_FSDATA 0 -#endif - -/** - * @} - */ - -#endif /* LWIP_HDR_APPS_HTTPD_OPTS_H */ diff --git a/tools/sdk/include/lwip/lwip/apps/lwiperf.h b/tools/sdk/include/lwip/lwip/apps/lwiperf.h deleted file mode 100644 index 7dbebb08264..00000000000 --- a/tools/sdk/include/lwip/lwip/apps/lwiperf.h +++ /dev/null @@ -1,84 +0,0 @@ -/** - * @file - * lwIP iPerf server implementation - */ - -/* - * Copyright (c) 2014 Simon Goldschmidt - * All rights reserved. - * - * 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 - * - */ -#ifndef LWIP_HDR_APPS_LWIPERF_H -#define LWIP_HDR_APPS_LWIPERF_H - -#include "lwip/opt.h" -#include "lwip/ip_addr.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define LWIPERF_TCP_PORT_DEFAULT 5001 - -/** lwIPerf test results */ -enum lwiperf_report_type -{ - /** The server side test is done */ - LWIPERF_TCP_DONE_SERVER, - /** The client side test is done */ - LWIPERF_TCP_DONE_CLIENT, - /** Local error lead to test abort */ - LWIPERF_TCP_ABORTED_LOCAL, - /** Data check error lead to test abort */ - LWIPERF_TCP_ABORTED_LOCAL_DATAERROR, - /** Transmit error lead to test abort */ - LWIPERF_TCP_ABORTED_LOCAL_TXERROR, - /** Remote side aborted the test */ - LWIPERF_TCP_ABORTED_REMOTE -}; - -/** Prototype of a report function that is called when a session is finished. - This report function can show the test results. - @param report_type contains the test result */ -typedef void (*lwiperf_report_fn)(void *arg, enum lwiperf_report_type report_type, - const ip_addr_t* local_addr, u16_t local_port, const ip_addr_t* remote_addr, u16_t remote_port, - u32_t bytes_transferred, u32_t ms_duration, u32_t bandwidth_kbitpsec); - - -void* lwiperf_start_tcp_server(const ip_addr_t* local_addr, u16_t local_port, - lwiperf_report_fn report_fn, void* report_arg); -void* lwiperf_start_tcp_server_default(lwiperf_report_fn report_fn, void* report_arg); -void lwiperf_abort(void* lwiperf_session); - - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_APPS_LWIPERF_H */ diff --git a/tools/sdk/include/lwip/lwip/apps/mdns.h b/tools/sdk/include/lwip/lwip/apps/mdns.h deleted file mode 100644 index d036816115d..00000000000 --- a/tools/sdk/include/lwip/lwip/apps/mdns.h +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @file - * MDNS responder - */ - - /* - * Copyright (c) 2015 Verisure Innovation AB - * All rights reserved. - * - * 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: Erik Ekman - * - */ -#ifndef LWIP_HDR_MDNS_H -#define LWIP_HDR_MDNS_H - -#include "lwip/apps/mdns_opts.h" -#include "lwip/netif.h" - -#if LWIP_MDNS_RESPONDER - -enum mdns_sd_proto { - DNSSD_PROTO_UDP = 0, - DNSSD_PROTO_TCP = 1 -}; - -#define MDNS_LABEL_MAXLEN 63 - -struct mdns_host; -struct mdns_service; - -/** Callback function to add text to a reply, called when generating the reply */ -typedef void (*service_get_txt_fn_t)(struct mdns_service *service, void *txt_userdata); - -void mdns_resp_init(void); - -err_t mdns_resp_add_netif(struct netif *netif, const char *hostname, u32_t dns_ttl); -err_t mdns_resp_remove_netif(struct netif *netif); - -err_t mdns_resp_add_service(struct netif *netif, const char *name, const char *service, enum mdns_sd_proto proto, u16_t port, u32_t dns_ttl, service_get_txt_fn_t txt_fn, void *txt_userdata); -err_t mdns_resp_add_service_txtitem(struct mdns_service *service, const char *txt, u8_t txt_len); -void mdns_resp_netif_settings_changed(struct netif *netif); - -#endif /* LWIP_MDNS_RESPONDER */ - -#endif /* LWIP_HDR_MDNS_H */ diff --git a/tools/sdk/include/lwip/lwip/apps/mdns_opts.h b/tools/sdk/include/lwip/lwip/apps/mdns_opts.h deleted file mode 100644 index bf186bcce17..00000000000 --- a/tools/sdk/include/lwip/lwip/apps/mdns_opts.h +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @file - * MDNS responder - */ - - /* - * Copyright (c) 2015 Verisure Innovation AB - * All rights reserved. - * - * 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: Erik Ekman - * - */ - -#ifndef LWIP_HDR_APPS_MDNS_OPTS_H -#define LWIP_HDR_APPS_MDNS_OPTS_H - -#include "lwip/opt.h" - -/** - * @defgroup mdns_opts Options - * @ingroup mdns - * @{ - */ - -/** - * LWIP_MDNS_RESPONDER==1: Turn on multicast DNS module. UDP must be available for MDNS - * transport. IGMP is needed for IPv4 multicast. - */ -#ifndef LWIP_MDNS_RESPONDER -#define LWIP_MDNS_RESPONDER 0 -#endif /* LWIP_MDNS_RESPONDER */ - -/** The maximum number of services per netif */ -#ifndef MDNS_MAX_SERVICES -#define MDNS_MAX_SERVICES 1 -#endif - -/** - * MDNS_DEBUG: Enable debugging for multicast DNS. - */ -#ifndef MDNS_DEBUG -#define MDNS_DEBUG LWIP_DBG_OFF -#endif - -/** - * @} - */ - -#endif /* LWIP_HDR_APPS_MDNS_OPTS_H */ - diff --git a/tools/sdk/include/lwip/lwip/apps/mdns_priv.h b/tools/sdk/include/lwip/lwip/apps/mdns_priv.h deleted file mode 100644 index 8ee6db86af4..00000000000 --- a/tools/sdk/include/lwip/lwip/apps/mdns_priv.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @file - * MDNS responder private definitions - */ - - /* - * Copyright (c) 2015 Verisure Innovation AB - * All rights reserved. - * - * 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: Erik Ekman - * - */ -#ifndef LWIP_HDR_MDNS_PRIV_H -#define LWIP_HDR_MDNS_PRIV_H - -#include "lwip/apps/mdns_opts.h" -#include "lwip/pbuf.h" - -#if LWIP_MDNS_RESPONDER - -/* Domain struct and methods - visible for unit tests */ - -#define MDNS_DOMAIN_MAXLEN 256 -#define MDNS_READNAME_ERROR 0xFFFF - -struct mdns_domain { - /* Encoded domain name */ - u8_t name[MDNS_DOMAIN_MAXLEN]; - /* Total length of domain name, including zero */ - u16_t length; - /* Set if compression of this domain is not allowed */ - u8_t skip_compression; -}; - -err_t mdns_domain_add_label(struct mdns_domain *domain, const char *label, u8_t len); -u16_t mdns_readname(struct pbuf *p, u16_t offset, struct mdns_domain *domain); -int mdns_domain_eq(struct mdns_domain *a, struct mdns_domain *b); -u16_t mdns_compress_domain(struct pbuf *pbuf, u16_t *offset, struct mdns_domain *domain); - -#endif /* LWIP_MDNS_RESPONDER */ - -#endif /* LWIP_HDR_MDNS_PRIV_H */ diff --git a/tools/sdk/include/lwip/lwip/apps/mqtt.h b/tools/sdk/include/lwip/lwip/apps/mqtt.h deleted file mode 100644 index 34b230b888b..00000000000 --- a/tools/sdk/include/lwip/lwip/apps/mqtt.h +++ /dev/null @@ -1,244 +0,0 @@ -/** - * @file - * MQTT client - */ - -/* - * Copyright (c) 2016 Erik Andersson - * All rights reserved. - * - * 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: Erik Andersson - * - */ -#ifndef LWIP_HDR_APPS_MQTT_CLIENT_H -#define LWIP_HDR_APPS_MQTT_CLIENT_H - -#include "lwip/apps/mqtt_opts.h" -#include "lwip/err.h" -#include "lwip/ip_addr.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct mqtt_client_t mqtt_client_t; - -/** @ingroup mqtt - * Default MQTT port */ -#define MQTT_PORT 1883 - -/*---------------------------------------------------------------------------------------------- */ -/* Connection with server */ - -/** - * @ingroup mqtt - * Client information and connection parameters */ -struct mqtt_connect_client_info_t { - /** Client identifier, must be set by caller */ - const char *client_id; - /** User name and password, set to NULL if not used */ - const char* client_user; - const char* client_pass; - /** keep alive time in seconds, 0 to disable keep alive functionality*/ - u16_t keep_alive; - /** will topic, set to NULL if will is not to be used, - will_msg, will_qos and will retain are then ignored */ - const char* will_topic; - const char* will_msg; - u8_t will_qos; - u8_t will_retain; -}; - -/** - * @ingroup mqtt - * Connection status codes */ -typedef enum -{ - MQTT_CONNECT_ACCEPTED = 0, - MQTT_CONNECT_REFUSED_PROTOCOL_VERSION = 1, - MQTT_CONNECT_REFUSED_IDENTIFIER = 2, - MQTT_CONNECT_REFUSED_SERVER = 3, - MQTT_CONNECT_REFUSED_USERNAME_PASS = 4, - MQTT_CONNECT_REFUSED_NOT_AUTHORIZED_ = 5, - MQTT_CONNECT_DISCONNECTED = 256, - MQTT_CONNECT_TIMEOUT = 257 -} mqtt_connection_status_t; - -/** - * @ingroup mqtt - * Function prototype for mqtt connection status callback. Called when - * client has connected to the server after initiating a mqtt connection attempt by - * calling mqtt_connect() or when connection is closed by server or an error - * - * @param client MQTT client itself - * @param arg Additional argument to pass to the callback function - * @param status Connect result code or disconnection notification @see mqtt_connection_status_t - * - */ -typedef void (*mqtt_connection_cb_t)(mqtt_client_t *client, void *arg, mqtt_connection_status_t status); - - -/** - * @ingroup mqtt - * Data callback flags */ -enum { - /** Flag set when last fragment of data arrives in data callback */ - MQTT_DATA_FLAG_LAST = 1 -}; - -/** - * @ingroup mqtt - * Function prototype for MQTT incoming publish data callback function. Called when data - * arrives to a subscribed topic @see mqtt_subscribe - * - * @param arg Additional argument to pass to the callback function - * @param data User data, pointed object, data may not be referenced after callback return, - NULL is passed when all publish data are delivered - * @param len Length of publish data fragment - * @param flags MQTT_DATA_FLAG_LAST set when this call contains the last part of data from publish message - * - */ -typedef void (*mqtt_incoming_data_cb_t)(void *arg, const u8_t *data, u16_t len, u8_t flags); - - -/** - * @ingroup mqtt - * Function prototype for MQTT incoming publish function. Called when an incoming publish - * arrives to a subscribed topic @see mqtt_subscribe - * - * @param arg Additional argument to pass to the callback function - * @param topic Zero terminated Topic text string, topic may not be referenced after callback return - * @param tot_len Total length of publish data, if set to 0 (no publish payload) data callback will not be invoked - */ -typedef void (*mqtt_incoming_publish_cb_t)(void *arg, const char *topic, u32_t tot_len); - - -/** - * @ingroup mqtt - * Function prototype for mqtt request callback. Called when a subscribe, unsubscribe - * or publish request has completed - * @param arg Pointer to user data supplied when invoking request - * @param err ERR_OK on success - * ERR_TIMEOUT if no response was received within timeout, - * ERR_ABRT if (un)subscribe was denied - */ -typedef void (*mqtt_request_cb_t)(void *arg, err_t err); - - -/** - * Pending request item, binds application callback to pending server requests - */ -struct mqtt_request_t -{ - /** Next item in list, NULL means this is the last in chain, - next pointing at itself means request is unallocated */ - struct mqtt_request_t *next; - /** Callback to upper layer */ - mqtt_request_cb_t cb; - void *arg; - /** MQTT packet identifier */ - u16_t pkt_id; - /** Expire time relative to element before this */ - u16_t timeout_diff; -}; - -/** Ring buffer */ -struct mqtt_ringbuf_t { - u16_t put; - u16_t get; - u8_t buf[MQTT_OUTPUT_RINGBUF_SIZE]; -}; - -/** MQTT client */ -struct mqtt_client_t -{ - /** Timers and timeouts */ - u16_t cyclic_tick; - u16_t keep_alive; - u16_t server_watchdog; - /** Packet identifier generator*/ - u16_t pkt_id_seq; - /** Packet identifier of pending incoming publish */ - u16_t inpub_pkt_id; - /** Connection state */ - u8_t conn_state; - struct tcp_pcb *conn; - /** Connection callback */ - void *connect_arg; - mqtt_connection_cb_t connect_cb; - /** Pending requests to server */ - struct mqtt_request_t *pend_req_queue; - struct mqtt_request_t req_list[MQTT_REQ_MAX_IN_FLIGHT]; - void *inpub_arg; - /** Incoming data callback */ - mqtt_incoming_data_cb_t data_cb; - mqtt_incoming_publish_cb_t pub_cb; - /** Input */ - u32_t msg_idx; - u8_t rx_buffer[MQTT_VAR_HEADER_BUFFER_LEN]; - /** Output ring-buffer */ - struct mqtt_ringbuf_t output; -}; - - -/** Connect to server */ -err_t mqtt_client_connect(mqtt_client_t *client, const ip_addr_t *ipaddr, u16_t port, mqtt_connection_cb_t cb, void *arg, - const struct mqtt_connect_client_info_t *client_info); - -/** Disconnect from server */ -void mqtt_disconnect(mqtt_client_t *client); - -/** Create new client */ -mqtt_client_t *mqtt_client_new(void); - -/** Check connection status */ -u8_t mqtt_client_is_connected(mqtt_client_t *client); - -/** Set callback to call for incoming publish */ -void mqtt_set_inpub_callback(mqtt_client_t *client, mqtt_incoming_publish_cb_t, - mqtt_incoming_data_cb_t data_cb, void *arg); - -/** Common function for subscribe and unsubscribe */ -err_t mqtt_sub_unsub(mqtt_client_t *client, const char *topic, u8_t qos, mqtt_request_cb_t cb, void *arg, u8_t sub); - -/** @ingroup mqtt - *Subscribe to topic */ -#define mqtt_subscribe(client, topic, qos, cb, arg) mqtt_sub_unsub(client, topic, qos, cb, arg, 1) -/** @ingroup mqtt - * Unsubscribe to topic */ -#define mqtt_unsubscribe(client, topic, cb, arg) mqtt_sub_unsub(client, topic, 0, cb, arg, 0) - - -/** Publish data to topic */ -err_t mqtt_publish(mqtt_client_t *client, const char *topic, const void *payload, u16_t payload_length, u8_t qos, u8_t retain, - mqtt_request_cb_t cb, void *arg); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_APPS_MQTT_CLIENT_H */ diff --git a/tools/sdk/include/lwip/lwip/apps/mqtt_opts.h b/tools/sdk/include/lwip/lwip/apps/mqtt_opts.h deleted file mode 100644 index ffefacd2595..00000000000 --- a/tools/sdk/include/lwip/lwip/apps/mqtt_opts.h +++ /dev/null @@ -1,103 +0,0 @@ -/** - * @file - * MQTT client options - */ - -/* - * Copyright (c) 2016 Erik Andersson - * All rights reserved. - * - * 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: Erik Andersson - * - */ -#ifndef LWIP_HDR_APPS_MQTT_OPTS_H -#define LWIP_HDR_APPS_MQTT_OPTS_H - -#include "lwip/opt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup mqtt_opts Options - * @ingroup mqtt - * @{ - */ - -/** - * Output ring-buffer size, must be able to fit largest outgoing publish message topic+payloads - */ -#ifndef MQTT_OUTPUT_RINGBUF_SIZE -#define MQTT_OUTPUT_RINGBUF_SIZE 256 -#endif - -/** - * Number of bytes in receive buffer, must be at least the size of the longest incoming topic + 8 - * If one wants to avoid fragmented incoming publish, set length to max incoming topic length + max payload length + 8 - */ -#ifndef MQTT_VAR_HEADER_BUFFER_LEN -#define MQTT_VAR_HEADER_BUFFER_LEN 128 -#endif - -/** - * Maximum number of pending subscribe, unsubscribe and publish requests to server . - */ -#ifndef MQTT_REQ_MAX_IN_FLIGHT -#define MQTT_REQ_MAX_IN_FLIGHT 4 -#endif - -/** - * Seconds between each cyclic timer call. - */ -#ifndef MQTT_CYCLIC_TIMER_INTERVAL -#define MQTT_CYCLIC_TIMER_INTERVAL 5 -#endif - -/** - * Publish, subscribe and unsubscribe request timeout in seconds. - */ -#ifndef MQTT_REQ_TIMEOUT -#define MQTT_REQ_TIMEOUT 30 -#endif - -/** - * Seconds for MQTT connect response timeout after sending connect request - */ -#ifndef MQTT_CONNECT_TIMOUT -#define MQTT_CONNECT_TIMOUT 100 -#endif - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_APPS_MQTT_OPTS_H */ diff --git a/tools/sdk/include/lwip/lwip/apps/netbiosns.h b/tools/sdk/include/lwip/lwip/apps/netbiosns.h deleted file mode 100644 index c9f68d8d12c..00000000000 --- a/tools/sdk/include/lwip/lwip/apps/netbiosns.h +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @file - * NETBIOS name service responder - */ - -/* - * 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. - * - */ -#ifndef LWIP_HDR_APPS_NETBIOS_H -#define LWIP_HDR_APPS_NETBIOS_H - -#include "lwip/apps/netbiosns_opts.h" - -void netbiosns_init(void); -#ifndef NETBIOS_LWIP_NAME -void netbiosns_set_name(const char* hostname); -#endif -void netbiosns_stop(void); - -#endif /* LWIP_HDR_APPS_NETBIOS_H */ diff --git a/tools/sdk/include/lwip/lwip/apps/netbiosns_opts.h b/tools/sdk/include/lwip/lwip/apps/netbiosns_opts.h deleted file mode 100644 index 0909ef7b94e..00000000000 --- a/tools/sdk/include/lwip/lwip/apps/netbiosns_opts.h +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @file - * NETBIOS name service responder options - */ - -/* - * 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. - * - */ -#ifndef LWIP_HDR_APPS_NETBIOS_OPTS_H -#define LWIP_HDR_APPS_NETBIOS_OPTS_H - -#include "lwip/opt.h" - -/** - * @defgroup netbiosns_opts Options - * @ingroup netbiosns - * @{ - */ - -/** NetBIOS name of lwip device - * This must be uppercase until NETBIOS_STRCMP() is defined to a string - * comparision function that is case insensitive. - * If you want to use the netif's hostname, use this (with LWIP_NETIF_HOSTNAME): - * (ip_current_netif() != NULL ? ip_current_netif()->hostname != NULL ? ip_current_netif()->hostname : "" : "") - * - * If this is not defined, netbiosns_set_name() can be called at runtime to change the name. - */ -#ifdef __DOXYGEN__ -#define NETBIOS_LWIP_NAME "NETBIOSLWIPDEV" -#endif - -/** - * @} - */ - -#endif /* LWIP_HDR_APPS_NETBIOS_OPTS_H */ diff --git a/tools/sdk/include/lwip/lwip/apps/snmp.h b/tools/sdk/include/lwip/lwip/apps/snmp.h deleted file mode 100644 index 10e8ff434bb..00000000000 --- a/tools/sdk/include/lwip/lwip/apps/snmp.h +++ /dev/null @@ -1,128 +0,0 @@ -/** - * @file - * SNMP server main API - start and basic configuration - */ - -/* - * Copyright (c) 2001, 2002 Leon Woestenberg - * Copyright (c) 2001, 2002 Axon Digital Design B.V., The Netherlands. - * All rights reserved. - * - * 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: Leon Woestenberg - * Martin Hentschel - * - */ -#ifndef LWIP_HDR_APPS_SNMP_H -#define LWIP_HDR_APPS_SNMP_H - -#include "lwip/apps/snmp_opts.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/err.h" -#include "lwip/apps/snmp_core.h" - -/** SNMP variable binding descriptor (publically needed for traps) */ -struct snmp_varbind -{ - /** pointer to next varbind, NULL for last in list */ - struct snmp_varbind *next; - /** pointer to previous varbind, NULL for first in list */ - struct snmp_varbind *prev; - - /** object identifier */ - struct snmp_obj_id oid; - - /** value ASN1 type */ - u8_t type; - /** object value length */ - u16_t value_len; - /** object value */ - void *value; -}; - -/** - * @ingroup snmp_core - * Agent setup, start listening to port 161. - */ -void snmp_init(void); -void snmp_set_mibs(const struct snmp_mib **mibs, u8_t num_mibs); - -void snmp_set_device_enterprise_oid(const struct snmp_obj_id* device_enterprise_oid); -const struct snmp_obj_id* snmp_get_device_enterprise_oid(void); - -void snmp_trap_dst_enable(u8_t dst_idx, u8_t enable); -void snmp_trap_dst_ip_set(u8_t dst_idx, const ip_addr_t *dst); - -/** Generic trap: cold start */ -#define SNMP_GENTRAP_COLDSTART 0 -/** Generic trap: warm start */ -#define SNMP_GENTRAP_WARMSTART 1 -/** Generic trap: link down */ -#define SNMP_GENTRAP_LINKDOWN 2 -/** Generic trap: link up */ -#define SNMP_GENTRAP_LINKUP 3 -/** Generic trap: authentication failure */ -#define SNMP_GENTRAP_AUTH_FAILURE 4 -/** Generic trap: EGP neighbor lost */ -#define SNMP_GENTRAP_EGP_NEIGHBOR_LOSS 5 -/** Generic trap: enterprise specific */ -#define SNMP_GENTRAP_ENTERPRISE_SPECIFIC 6 - -err_t snmp_send_trap_generic(s32_t generic_trap); -err_t snmp_send_trap_specific(s32_t specific_trap, struct snmp_varbind *varbinds); -err_t snmp_send_trap(const struct snmp_obj_id* oid, s32_t generic_trap, s32_t specific_trap, struct snmp_varbind *varbinds); - -#define SNMP_AUTH_TRAPS_DISABLED 0 -#define SNMP_AUTH_TRAPS_ENABLED 1 -void snmp_set_auth_traps_enabled(u8_t enable); -u8_t snmp_get_auth_traps_enabled(void); - -const char * snmp_get_community(void); -const char * snmp_get_community_write(void); -const char * snmp_get_community_trap(void); -void snmp_set_community(const char * const community); -void snmp_set_community_write(const char * const community); -void snmp_set_community_trap(const char * const community); - -void snmp_coldstart_trap(void); -void snmp_authfail_trap(void); - -typedef void (*snmp_write_callback_fct)(const u32_t* oid, u8_t oid_len, void* callback_arg); -void snmp_set_write_callback(snmp_write_callback_fct write_callback, void* callback_arg); - -#endif /* LWIP_SNMP */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_APPS_SNMP_H */ diff --git a/tools/sdk/include/lwip/lwip/apps/snmp_core.h b/tools/sdk/include/lwip/lwip/apps/snmp_core.h deleted file mode 100644 index e781c532b38..00000000000 --- a/tools/sdk/include/lwip/lwip/apps/snmp_core.h +++ /dev/null @@ -1,364 +0,0 @@ -/** - * @file - * SNMP core API for implementing MIBs - */ - -/* - * Copyright (c) 2006 Axon Digital Design B.V., The Netherlands. - * All rights reserved. - * - * 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. - * - * Author: Christiaan Simons - * Martin Hentschel - */ - -#ifndef LWIP_HDR_APPS_SNMP_CORE_H -#define LWIP_HDR_APPS_SNMP_CORE_H - -#include "lwip/apps/snmp_opts.h" - -#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/ip_addr.h" -#include "lwip/err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* basic ASN1 defines */ -#define SNMP_ASN1_CLASS_UNIVERSAL 0x00 -#define SNMP_ASN1_CLASS_APPLICATION 0x40 -#define SNMP_ASN1_CLASS_CONTEXT 0x80 -#define SNMP_ASN1_CLASS_PRIVATE 0xC0 - -#define SNMP_ASN1_CONTENTTYPE_PRIMITIVE 0x00 -#define SNMP_ASN1_CONTENTTYPE_CONSTRUCTED 0x20 - -/* universal tags (from ASN.1 spec.) */ -#define SNMP_ASN1_UNIVERSAL_END_OF_CONTENT 0 -#define SNMP_ASN1_UNIVERSAL_INTEGER 2 -#define SNMP_ASN1_UNIVERSAL_OCTET_STRING 4 -#define SNMP_ASN1_UNIVERSAL_NULL 5 -#define SNMP_ASN1_UNIVERSAL_OBJECT_ID 6 -#define SNMP_ASN1_UNIVERSAL_SEQUENCE_OF 16 - -/* application specific (SNMP) tags (from SNMPv2-SMI) */ -#define SNMP_ASN1_APPLICATION_IPADDR 0 /* [APPLICATION 0] IMPLICIT OCTET STRING (SIZE (4)) */ -#define SNMP_ASN1_APPLICATION_COUNTER 1 /* [APPLICATION 1] IMPLICIT INTEGER (0..4294967295) => u32_t */ -#define SNMP_ASN1_APPLICATION_GAUGE 2 /* [APPLICATION 2] IMPLICIT INTEGER (0..4294967295) => u32_t */ -#define SNMP_ASN1_APPLICATION_TIMETICKS 3 /* [APPLICATION 3] IMPLICIT INTEGER (0..4294967295) => u32_t */ -#define SNMP_ASN1_APPLICATION_OPAQUE 4 /* [APPLICATION 4] IMPLICIT OCTET STRING */ -#define SNMP_ASN1_APPLICATION_COUNTER64 6 /* [APPLICATION 6] IMPLICIT INTEGER (0..18446744073709551615) */ - -/* context specific (SNMP) tags (from RFC 1905) */ -#define SNMP_ASN1_CONTEXT_VARBIND_NO_SUCH_INSTANCE 1 - -/* full ASN1 type defines */ -#define SNMP_ASN1_TYPE_END_OF_CONTENT (SNMP_ASN1_CLASS_UNIVERSAL | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_UNIVERSAL_END_OF_CONTENT) -#define SNMP_ASN1_TYPE_INTEGER (SNMP_ASN1_CLASS_UNIVERSAL | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_UNIVERSAL_INTEGER) -#define SNMP_ASN1_TYPE_OCTET_STRING (SNMP_ASN1_CLASS_UNIVERSAL | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_UNIVERSAL_OCTET_STRING) -#define SNMP_ASN1_TYPE_NULL (SNMP_ASN1_CLASS_UNIVERSAL | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_UNIVERSAL_NULL) -#define SNMP_ASN1_TYPE_OBJECT_ID (SNMP_ASN1_CLASS_UNIVERSAL | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_UNIVERSAL_OBJECT_ID) -#define SNMP_ASN1_TYPE_SEQUENCE (SNMP_ASN1_CLASS_UNIVERSAL | SNMP_ASN1_CONTENTTYPE_CONSTRUCTED | SNMP_ASN1_UNIVERSAL_SEQUENCE_OF) -#define SNMP_ASN1_TYPE_IPADDR (SNMP_ASN1_CLASS_APPLICATION | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_APPLICATION_IPADDR) -#define SNMP_ASN1_TYPE_IPADDRESS SNMP_ASN1_TYPE_IPADDR -#define SNMP_ASN1_TYPE_COUNTER (SNMP_ASN1_CLASS_APPLICATION | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_APPLICATION_COUNTER) -#define SNMP_ASN1_TYPE_COUNTER32 SNMP_ASN1_TYPE_COUNTER -#define SNMP_ASN1_TYPE_GAUGE (SNMP_ASN1_CLASS_APPLICATION | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_APPLICATION_GAUGE) -#define SNMP_ASN1_TYPE_GAUGE32 SNMP_ASN1_TYPE_GAUGE -#define SNMP_ASN1_TYPE_UNSIGNED32 SNMP_ASN1_TYPE_GAUGE -#define SNMP_ASN1_TYPE_TIMETICKS (SNMP_ASN1_CLASS_APPLICATION | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_APPLICATION_TIMETICKS) -#define SNMP_ASN1_TYPE_OPAQUE (SNMP_ASN1_CLASS_APPLICATION | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_APPLICATION_OPAQUE) -#define SNMP_ASN1_TYPE_COUNTER64 (SNMP_ASN1_CLASS_APPLICATION | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_APPLICATION_COUNTER64) - -#define SNMP_VARBIND_EXCEPTION_OFFSET 0xF0 -#define SNMP_VARBIND_EXCEPTION_MASK 0x0F - -/** error codes predefined by SNMP prot. */ -typedef enum { - SNMP_ERR_NOERROR = 0, -/* -outdated v1 error codes. do not use anmore! -#define SNMP_ERR_NOSUCHNAME 2 use SNMP_ERR_NOSUCHINSTANCE instead -#define SNMP_ERR_BADVALUE 3 use SNMP_ERR_WRONGTYPE,SNMP_ERR_WRONGLENGTH,SNMP_ERR_WRONGENCODING or SNMP_ERR_WRONGVALUE instead -#define SNMP_ERR_READONLY 4 use SNMP_ERR_NOTWRITABLE instead -*/ - SNMP_ERR_GENERROR = 5, - SNMP_ERR_NOACCESS = 6, - SNMP_ERR_WRONGTYPE = 7, - SNMP_ERR_WRONGLENGTH = 8, - SNMP_ERR_WRONGENCODING = 9, - SNMP_ERR_WRONGVALUE = 10, - SNMP_ERR_NOCREATION = 11, - SNMP_ERR_INCONSISTENTVALUE = 12, - SNMP_ERR_RESOURCEUNAVAILABLE = 13, - SNMP_ERR_COMMITFAILED = 14, - SNMP_ERR_UNDOFAILED = 15, - SNMP_ERR_NOTWRITABLE = 17, - SNMP_ERR_INCONSISTENTNAME = 18, - - SNMP_ERR_NOSUCHINSTANCE = SNMP_VARBIND_EXCEPTION_OFFSET + SNMP_ASN1_CONTEXT_VARBIND_NO_SUCH_INSTANCE -} snmp_err_t; - -/** internal object identifier representation */ -struct snmp_obj_id -{ - u8_t len; - u32_t id[SNMP_MAX_OBJ_ID_LEN]; -}; - -struct snmp_obj_id_const_ref -{ - u8_t len; - const u32_t* id; -}; - -extern const struct snmp_obj_id_const_ref snmp_zero_dot_zero; /* administrative identifier from SNMPv2-SMI */ - -/** SNMP variant value, used as reference in struct snmp_node_instance and table implementation */ -union snmp_variant_value -{ - void* ptr; - const void* const_ptr; - u32_t u32; - s32_t s32; -}; - - -/** -SNMP MIB node types - tree node is the only node the stack can process in order to walk the tree, - all other nodes are assumed to be leaf nodes. - This cannot be an enum because users may want to define their own node types. -*/ -#define SNMP_NODE_TREE 0x00 -/* predefined leaf node types */ -#define SNMP_NODE_SCALAR 0x01 -#define SNMP_NODE_SCALAR_ARRAY 0x02 -#define SNMP_NODE_TABLE 0x03 -#define SNMP_NODE_THREADSYNC 0x04 - -/** node "base class" layout, the mandatory fields for a node */ -struct snmp_node -{ - /** one out of SNMP_NODE_TREE or any leaf node type (like SNMP_NODE_SCALAR) */ - u8_t node_type; - /** the number assigned to this node which used as part of the full OID */ - u32_t oid; -}; - -/** SNMP node instance access types */ -typedef enum { - SNMP_NODE_INSTANCE_ACCESS_READ = 1, - SNMP_NODE_INSTANCE_ACCESS_WRITE = 2, - SNMP_NODE_INSTANCE_READ_ONLY = SNMP_NODE_INSTANCE_ACCESS_READ, - SNMP_NODE_INSTANCE_READ_WRITE = (SNMP_NODE_INSTANCE_ACCESS_READ | SNMP_NODE_INSTANCE_ACCESS_WRITE), - SNMP_NODE_INSTANCE_WRITE_ONLY = SNMP_NODE_INSTANCE_ACCESS_WRITE, - SNMP_NODE_INSTANCE_NOT_ACCESSIBLE = 0 -} snmp_access_t; - -struct snmp_node_instance; - -typedef s16_t (*node_instance_get_value_method)(struct snmp_node_instance*, void*); -typedef snmp_err_t (*node_instance_set_test_method)(struct snmp_node_instance*, u16_t, void*); -typedef snmp_err_t (*node_instance_set_value_method)(struct snmp_node_instance*, u16_t, void*); -typedef void (*node_instance_release_method)(struct snmp_node_instance*); - -#define SNMP_GET_VALUE_RAW_DATA 0x8000 - -/** SNMP node instance */ -struct snmp_node_instance -{ - /** prefilled with the node, get_instance() is called on; may be changed by user to any value to pass an arbitrary node between calls to get_instance() and get_value/test_value/set_value */ - const struct snmp_node* node; - /** prefilled with the instance id requested; for get_instance() this is the exact oid requested; for get_next_instance() this is the relative starting point, stack expects relative oid of next node here */ - struct snmp_obj_id instance_oid; - - /** ASN type for this object (see snmp_asn1.h for definitions) */ - u8_t asn1_type; - /** one out of instance access types defined above (SNMP_NODE_INSTANCE_READ_ONLY,...) */ - snmp_access_t access; - - /** returns object value for the given object identifier. Return values <0 to indicate an error */ - node_instance_get_value_method get_value; - /** tests length and/or range BEFORE setting */ - node_instance_set_test_method set_test; - /** sets object value, only called when set_test() was successful */ - node_instance_set_value_method set_value; - /** called in any case when the instance is not required anymore by stack (useful for freeing memory allocated in get_instance/get_next_instance methods) */ - node_instance_release_method release_instance; - - /** reference to pass arbitrary value between calls to get_instance() and get_value/test_value/set_value */ - union snmp_variant_value reference; - /** see reference (if reference is a pointer, the length of underlying data may be stored here or anything else) */ - u32_t reference_len; -}; - - -/** SNMP tree node */ -struct snmp_tree_node -{ - /** inherited "base class" members */ - struct snmp_node node; - u16_t subnode_count; - const struct snmp_node* const *subnodes; -}; - -#define SNMP_CREATE_TREE_NODE(oid, subnodes) \ - {{ SNMP_NODE_TREE, (oid) }, \ - (u16_t)LWIP_ARRAYSIZE(subnodes), (subnodes) } - -#define SNMP_CREATE_EMPTY_TREE_NODE(oid) \ - {{ SNMP_NODE_TREE, (oid) }, \ - 0, NULL } - -/** SNMP leaf node */ -struct snmp_leaf_node -{ - /** inherited "base class" members */ - struct snmp_node node; - snmp_err_t (*get_instance)(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance); - snmp_err_t (*get_next_instance)(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance); -}; - -/** represents a single mib with its base oid and root node */ -struct snmp_mib -{ - const u32_t *base_oid; - u8_t base_oid_len; - const struct snmp_node *root_node; -}; - -#define SNMP_MIB_CREATE(oid_list, root_node) { (oid_list), (u8_t)LWIP_ARRAYSIZE(oid_list), root_node } - -/** OID range structure */ -struct snmp_oid_range -{ - u32_t min; - u32_t max; -}; - -/** checks if incoming OID length and values are in allowed ranges */ -u8_t snmp_oid_in_range(const u32_t *oid_in, u8_t oid_len, const struct snmp_oid_range *oid_ranges, u8_t oid_ranges_len); - -typedef enum { - SNMP_NEXT_OID_STATUS_SUCCESS, - SNMP_NEXT_OID_STATUS_NO_MATCH, - SNMP_NEXT_OID_STATUS_BUF_TO_SMALL -} snmp_next_oid_status_t; - -/** state for next_oid_init / next_oid_check functions */ -struct snmp_next_oid_state -{ - const u32_t* start_oid; - u8_t start_oid_len; - - u32_t* next_oid; - u8_t next_oid_len; - u8_t next_oid_max_len; - - snmp_next_oid_status_t status; - void* reference; -}; - -void snmp_next_oid_init(struct snmp_next_oid_state *state, - const u32_t *start_oid, u8_t start_oid_len, - u32_t *next_oid_buf, u8_t next_oid_max_len); -u8_t snmp_next_oid_precheck(struct snmp_next_oid_state *state, const u32_t *oid, const u8_t oid_len); -u8_t snmp_next_oid_check(struct snmp_next_oid_state *state, const u32_t *oid, const u8_t oid_len, void* reference); - -void snmp_oid_assign(struct snmp_obj_id* target, const u32_t *oid, u8_t oid_len); -void snmp_oid_combine(struct snmp_obj_id* target, const u32_t *oid1, u8_t oid1_len, const u32_t *oid2, u8_t oid2_len); -void snmp_oid_prefix(struct snmp_obj_id* target, const u32_t *oid, u8_t oid_len); -void snmp_oid_append(struct snmp_obj_id* target, const u32_t *oid, u8_t oid_len); -u8_t snmp_oid_equal(const u32_t *oid1, u8_t oid1_len, const u32_t *oid2, u8_t oid2_len); -s8_t snmp_oid_compare(const u32_t *oid1, u8_t oid1_len, const u32_t *oid2, u8_t oid2_len); - -#if LWIP_IPV4 -u8_t snmp_oid_to_ip4(const u32_t *oid, ip4_addr_t *ip); -void snmp_ip4_to_oid(const ip4_addr_t *ip, u32_t *oid); -#endif /* LWIP_IPV4 */ -#if LWIP_IPV6 -u8_t snmp_oid_to_ip6(const u32_t *oid, ip6_addr_t *ip); -void snmp_ip6_to_oid(const ip6_addr_t *ip, u32_t *oid); -#endif /* LWIP_IPV6 */ -#if LWIP_IPV4 || LWIP_IPV6 -u8_t snmp_ip_to_oid(const ip_addr_t *ip, u32_t *oid); -u8_t snmp_ip_port_to_oid(const ip_addr_t *ip, u16_t port, u32_t *oid); - -u8_t snmp_oid_to_ip(const u32_t *oid, u8_t oid_len, ip_addr_t *ip); -u8_t snmp_oid_to_ip_port(const u32_t *oid, u8_t oid_len, ip_addr_t *ip, u16_t *port); -#endif /* LWIP_IPV4 || LWIP_IPV6 */ - -struct netif; -u8_t netif_to_num(const struct netif *netif); - -snmp_err_t snmp_set_test_ok(struct snmp_node_instance* instance, u16_t value_len, void* value); /* generic function which can be used if test is always successful */ - -err_t snmp_decode_bits(const u8_t *buf, u32_t buf_len, u32_t *bit_value); -err_t snmp_decode_truthvalue(const s32_t *asn1_value, u8_t *bool_value); -u8_t snmp_encode_bits(u8_t *buf, u32_t buf_len, u32_t bit_value, u8_t bit_count); -u8_t snmp_encode_truthvalue(s32_t *asn1_value, u32_t bool_value); - -struct snmp_statistics -{ - u32_t inpkts; - u32_t outpkts; - u32_t inbadversions; - u32_t inbadcommunitynames; - u32_t inbadcommunityuses; - u32_t inasnparseerrs; - u32_t intoobigs; - u32_t innosuchnames; - u32_t inbadvalues; - u32_t inreadonlys; - u32_t ingenerrs; - u32_t intotalreqvars; - u32_t intotalsetvars; - u32_t ingetrequests; - u32_t ingetnexts; - u32_t insetrequests; - u32_t ingetresponses; - u32_t intraps; - u32_t outtoobigs; - u32_t outnosuchnames; - u32_t outbadvalues; - u32_t outgenerrs; - u32_t outgetrequests; - u32_t outgetnexts; - u32_t outsetrequests; - u32_t outgetresponses; - u32_t outtraps; -}; - -extern struct snmp_statistics snmp_stats; - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_SNMP */ - -#endif /* LWIP_HDR_APPS_SNMP_CORE_H */ diff --git a/tools/sdk/include/lwip/lwip/apps/snmp_mib2.h b/tools/sdk/include/lwip/lwip/apps/snmp_mib2.h deleted file mode 100644 index 2f4a68935e2..00000000000 --- a/tools/sdk/include/lwip/lwip/apps/snmp_mib2.h +++ /dev/null @@ -1,78 +0,0 @@ -/** - * @file - * SNMP MIB2 API - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Dirk Ziegelmeier - * - */ -#ifndef LWIP_HDR_APPS_SNMP_MIB2_H -#define LWIP_HDR_APPS_SNMP_MIB2_H - -#include "lwip/apps/snmp_opts.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */ -#if SNMP_LWIP_MIB2 - -#include "lwip/apps/snmp_core.h" - -extern const struct snmp_mib mib2; - -#if SNMP_USE_NETCONN -#include "lwip/apps/snmp_threadsync.h" -void snmp_mib2_lwip_synchronizer(snmp_threadsync_called_fn fn, void* arg); -extern struct snmp_threadsync_instance snmp_mib2_lwip_locks; -#endif - -#ifndef SNMP_SYSSERVICES -#define SNMP_SYSSERVICES ((1 << 6) | (1 << 3) | ((IP_FORWARD) << 2)) -#endif - -void snmp_mib2_set_sysdescr(const u8_t* str, const u16_t* len); /* read-only be defintion */ -void snmp_mib2_set_syscontact(u8_t *ocstr, u16_t *ocstrlen, u16_t bufsize); -void snmp_mib2_set_syscontact_readonly(const u8_t *ocstr, const u16_t *ocstrlen); -void snmp_mib2_set_sysname(u8_t *ocstr, u16_t *ocstrlen, u16_t bufsize); -void snmp_mib2_set_sysname_readonly(const u8_t *ocstr, const u16_t *ocstrlen); -void snmp_mib2_set_syslocation(u8_t *ocstr, u16_t *ocstrlen, u16_t bufsize); -void snmp_mib2_set_syslocation_readonly(const u8_t *ocstr, const u16_t *ocstrlen); - -#endif /* SNMP_LWIP_MIB2 */ -#endif /* LWIP_SNMP */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_APPS_SNMP_MIB2_H */ diff --git a/tools/sdk/include/lwip/lwip/apps/snmp_opts.h b/tools/sdk/include/lwip/lwip/apps/snmp_opts.h deleted file mode 100644 index 6c9ba7beb33..00000000000 --- a/tools/sdk/include/lwip/lwip/apps/snmp_opts.h +++ /dev/null @@ -1,293 +0,0 @@ -/** - * @file - * SNMP server options list - */ - -/* - * Copyright (c) 2015 Dirk Ziegelmeier - * All rights reserved. - * - * 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: Dirk Ziegelmeier - * - */ -#ifndef LWIP_HDR_SNMP_OPTS_H -#define LWIP_HDR_SNMP_OPTS_H - -#include "lwip/opt.h" - -/** - * @defgroup snmp_opts Options - * @ingroup snmp - * @{ - */ - -/** - * LWIP_SNMP==1: This enables the lwIP SNMP agent. UDP must be available - * for SNMP transport. - * If you want to use your own SNMP agent, leave this disabled. - * To integrate MIB2 of an external agent, you need to enable - * LWIP_MIB2_CALLBACKS and MIB2_STATS. This will give you the callbacks - * and statistics counters you need to get MIB2 working. - */ -#if !defined LWIP_SNMP || defined __DOXYGEN__ -#define LWIP_SNMP 0 -#endif - -/** - * SNMP_USE_NETCONN: Use netconn API instead of raw API. - * Makes SNMP agent run in a worker thread, so blocking operations - * can be done in MIB calls. - */ -#if !defined SNMP_USE_NETCONN || defined __DOXYGEN__ -#define SNMP_USE_NETCONN 0 -#endif - -/** - * SNMP_USE_RAW: Use raw API. - * SNMP agent does not run in a worker thread, so blocking operations - * should not be done in MIB calls. - */ -#if !defined SNMP_USE_RAW || defined __DOXYGEN__ -#define SNMP_USE_RAW 1 -#endif - -#if SNMP_USE_NETCONN && SNMP_USE_RAW -#error SNMP stack can use only one of the APIs {raw, netconn} -#endif - -#if LWIP_SNMP && !SNMP_USE_NETCONN && !SNMP_USE_RAW -#error SNMP stack needs a receive API and UDP {raw, netconn} -#endif - -#if SNMP_USE_NETCONN -/** - * SNMP_STACK_SIZE: Stack size of SNMP netconn worker thread - */ -#if !defined SNMP_STACK_SIZE || defined __DOXYGEN__ -#define SNMP_STACK_SIZE DEFAULT_THREAD_STACKSIZE -#endif - -/** - * SNMP_THREAD_PRIO: SNMP netconn worker thread priority - */ -#if !defined SNMP_THREAD_PRIO || defined __DOXYGEN__ -#define SNMP_THREAD_PRIO DEFAULT_THREAD_PRIO -#endif -#endif /* SNMP_USE_NETCONN */ - -/** - * SNMP_TRAP_DESTINATIONS: Number of trap destinations. At least one trap - * destination is required - */ -#if !defined SNMP_TRAP_DESTINATIONS || defined __DOXYGEN__ -#define SNMP_TRAP_DESTINATIONS 1 -#endif - -/** - * Only allow SNMP write actions that are 'safe' (e.g. disabling netifs is not - * a safe action and disabled when SNMP_SAFE_REQUESTS = 1). - * Unsafe requests are disabled by default! - */ -#if !defined SNMP_SAFE_REQUESTS || defined __DOXYGEN__ -#define SNMP_SAFE_REQUESTS 1 -#endif - -/** - * The maximum length of strings used. - */ -#if !defined SNMP_MAX_OCTET_STRING_LEN || defined __DOXYGEN__ -#define SNMP_MAX_OCTET_STRING_LEN 127 -#endif - -/** - * The maximum number of Sub ID's inside an object identifier. - * Indirectly this also limits the maximum depth of SNMP tree. - */ -#if !defined SNMP_MAX_OBJ_ID_LEN || defined __DOXYGEN__ -#define SNMP_MAX_OBJ_ID_LEN 50 -#endif - -#if !defined SNMP_MAX_VALUE_SIZE || defined __DOXYGEN__ -/** - * The maximum size of a value. - */ -#define SNMP_MIN_VALUE_SIZE (2 * sizeof(u32_t*)) /* size required to store the basic types (8 bytes for counter64) */ -/** - * The minimum size of a value. - */ -#define SNMP_MAX_VALUE_SIZE LWIP_MAX(LWIP_MAX((SNMP_MAX_OCTET_STRING_LEN), sizeof(u32_t)*(SNMP_MAX_OBJ_ID_LEN)), SNMP_MIN_VALUE_SIZE) -#endif - -/** - * The snmp read-access community. Used for write-access and traps, too - * unless SNMP_COMMUNITY_WRITE or SNMP_COMMUNITY_TRAP are enabled, respectively. - */ -#if !defined SNMP_COMMUNITY || defined __DOXYGEN__ -#define SNMP_COMMUNITY "public" -#endif - -/** - * The snmp write-access community. - * Set this community to "" in order to disallow any write access. - */ -#if !defined SNMP_COMMUNITY_WRITE || defined __DOXYGEN__ -#define SNMP_COMMUNITY_WRITE "private" -#endif - -/** - * The snmp community used for sending traps. - */ -#if !defined SNMP_COMMUNITY_TRAP || defined __DOXYGEN__ -#define SNMP_COMMUNITY_TRAP "public" -#endif - -/** - * The maximum length of community string. - * If community names shall be adjusted at runtime via snmp_set_community() calls, - * enter here the possible maximum length (+1 for terminating null character). - */ -#if !defined SNMP_MAX_COMMUNITY_STR_LEN || defined __DOXYGEN__ -#define SNMP_MAX_COMMUNITY_STR_LEN LWIP_MAX(LWIP_MAX(sizeof(SNMP_COMMUNITY), sizeof(SNMP_COMMUNITY_WRITE)), sizeof(SNMP_COMMUNITY_TRAP)) -#endif - -/** - * The OID identifiying the device. This may be the enterprise OID itself or any OID located below it in tree. - */ -#if !defined SNMP_DEVICE_ENTERPRISE_OID || defined __DOXYGEN__ -#define SNMP_LWIP_ENTERPRISE_OID 26381 -/** - * IANA assigned enterprise ID for lwIP is 26381 - * @see http://www.iana.org/assignments/enterprise-numbers - * - * @note this enterprise ID is assigned to the lwIP project, - * all object identifiers living under this ID are assigned - * by the lwIP maintainers! - * @note don't change this define, use snmp_set_device_enterprise_oid() - * - * If you need to create your own private MIB you'll need - * to apply for your own enterprise ID with IANA: - * http://www.iana.org/numbers.html - */ -#define SNMP_DEVICE_ENTERPRISE_OID {1, 3, 6, 1, 4, 1, SNMP_LWIP_ENTERPRISE_OID} -/** - * Length of SNMP_DEVICE_ENTERPRISE_OID - */ -#define SNMP_DEVICE_ENTERPRISE_OID_LEN 7 -#endif - -/** - * SNMP_DEBUG: Enable debugging for SNMP messages. - */ -#if !defined SNMP_DEBUG || defined __DOXYGEN__ -#define SNMP_DEBUG LWIP_DBG_OFF -#endif - -/** - * SNMP_MIB_DEBUG: Enable debugging for SNMP MIBs. - */ -#if !defined SNMP_MIB_DEBUG || defined __DOXYGEN__ -#define SNMP_MIB_DEBUG LWIP_DBG_OFF -#endif - -/** - * Indicates if the MIB2 implementation of LWIP SNMP stack is used. - */ -#if !defined SNMP_LWIP_MIB2 || defined __DOXYGEN__ -#define SNMP_LWIP_MIB2 LWIP_SNMP -#endif - -/** - * Value return for sysDesc field of MIB2. - */ -#if !defined SNMP_LWIP_MIB2_SYSDESC || defined __DOXYGEN__ -#define SNMP_LWIP_MIB2_SYSDESC "lwIP" -#endif - -/** - * Value return for sysName field of MIB2. - * To make sysName field settable, call snmp_mib2_set_sysname() to provide the necessary buffers. - */ -#if !defined SNMP_LWIP_MIB2_SYSNAME || defined __DOXYGEN__ -#define SNMP_LWIP_MIB2_SYSNAME "FQDN-unk" -#endif - -/** - * Value return for sysContact field of MIB2. - * To make sysContact field settable, call snmp_mib2_set_syscontact() to provide the necessary buffers. - */ -#if !defined SNMP_LWIP_MIB2_SYSCONTACT || defined __DOXYGEN__ -#define SNMP_LWIP_MIB2_SYSCONTACT "" -#endif - -/** - * Value return for sysLocation field of MIB2. - * To make sysLocation field settable, call snmp_mib2_set_syslocation() to provide the necessary buffers. - */ -#if !defined SNMP_LWIP_MIB2_SYSLOCATION || defined __DOXYGEN__ -#define SNMP_LWIP_MIB2_SYSLOCATION "" -#endif - -/** - * This value is used to limit the repetitions processed in GetBulk requests (value == 0 means no limitation). - * This may be useful to limit the load for a single request. - * According to SNMP RFC 1905 it is allowed to not return all requested variables from a GetBulk request if system load would be too high. - * so the effect is that the client will do more requests to gather all data. - * For the stack this could be useful in case that SNMP processing is done in TCP/IP thread. In this situation a request with many - * repetitions could block the thread for a longer time. Setting limit here will keep the stack more responsive. - */ -#if !defined SNMP_LWIP_GETBULK_MAX_REPETITIONS || defined __DOXYGEN__ -#define SNMP_LWIP_GETBULK_MAX_REPETITIONS 0 -#endif - -/** - * @} - */ - -/* - ------------------------------------ - ---------- SNMPv3 options ---------- - ------------------------------------ -*/ - -/** - * LWIP_SNMP_V3==1: This enables EXPERIMENTAL SNMPv3 support. LWIP_SNMP must - * also be enabled. - * THIS IS UNDER DEVELOPMENT AND SHOULD NOT BE ENABLED IN PRODUCTS. - */ -#ifndef LWIP_SNMP_V3 -#define LWIP_SNMP_V3 0 -#endif - -#ifndef LWIP_SNMP_V3_CRYPTO -#define LWIP_SNMP_V3_CRYPTO LWIP_SNMP_V3 -#endif - -#ifndef LWIP_SNMP_V3_MBEDTLS -#define LWIP_SNMP_V3_MBEDTLS LWIP_SNMP_V3 -#endif - -#endif /* LWIP_HDR_SNMP_OPTS_H */ diff --git a/tools/sdk/include/lwip/lwip/apps/snmp_scalar.h b/tools/sdk/include/lwip/lwip/apps/snmp_scalar.h deleted file mode 100644 index 40a060c6404..00000000000 --- a/tools/sdk/include/lwip/lwip/apps/snmp_scalar.h +++ /dev/null @@ -1,113 +0,0 @@ -/** - * @file - * SNMP server MIB API to implement scalar nodes - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Martin Hentschel - * - */ - -#ifndef LWIP_HDR_APPS_SNMP_SCALAR_H -#define LWIP_HDR_APPS_SNMP_SCALAR_H - -#include "lwip/apps/snmp_opts.h" -#include "lwip/apps/snmp_core.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */ - -/** basic scalar node */ -struct snmp_scalar_node -{ - /** inherited "base class" members */ - struct snmp_leaf_node node; - u8_t asn1_type; - snmp_access_t access; - node_instance_get_value_method get_value; - node_instance_set_test_method set_test; - node_instance_set_value_method set_value; -}; - - -snmp_err_t snmp_scalar_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance); -snmp_err_t snmp_scalar_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance); - -#define SNMP_SCALAR_CREATE_NODE(oid, access, asn1_type, get_value_method, set_test_method, set_value_method) \ - {{{ SNMP_NODE_SCALAR, (oid) }, \ - snmp_scalar_get_instance, \ - snmp_scalar_get_next_instance }, \ - (asn1_type), (access), (get_value_method), (set_test_method), (set_value_method) } - -#define SNMP_SCALAR_CREATE_NODE_READONLY(oid, asn1_type, get_value_method) SNMP_SCALAR_CREATE_NODE(oid, SNMP_NODE_INSTANCE_READ_ONLY, asn1_type, get_value_method, NULL, NULL) - -/** scalar array node - a tree node which contains scalars only as children */ -struct snmp_scalar_array_node_def -{ - u32_t oid; - u8_t asn1_type; - snmp_access_t access; -}; - -typedef s16_t (*snmp_scalar_array_get_value_method)(const struct snmp_scalar_array_node_def*, void*); -typedef snmp_err_t (*snmp_scalar_array_set_test_method)(const struct snmp_scalar_array_node_def*, u16_t, void*); -typedef snmp_err_t (*snmp_scalar_array_set_value_method)(const struct snmp_scalar_array_node_def*, u16_t, void*); - -/** basic scalar array node */ -struct snmp_scalar_array_node -{ - /** inherited "base class" members */ - struct snmp_leaf_node node; - u16_t array_node_count; - const struct snmp_scalar_array_node_def* array_nodes; - snmp_scalar_array_get_value_method get_value; - snmp_scalar_array_set_test_method set_test; - snmp_scalar_array_set_value_method set_value; -}; - -snmp_err_t snmp_scalar_array_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance); -snmp_err_t snmp_scalar_array_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance); - -#define SNMP_SCALAR_CREATE_ARRAY_NODE(oid, array_nodes, get_value_method, set_test_method, set_value_method) \ - {{{ SNMP_NODE_SCALAR_ARRAY, (oid) }, \ - snmp_scalar_array_get_instance, \ - snmp_scalar_array_get_next_instance }, \ - (u16_t)LWIP_ARRAYSIZE(array_nodes), (array_nodes), (get_value_method), (set_test_method), (set_value_method) } - -#endif /* LWIP_SNMP */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_APPS_SNMP_SCALAR_H */ diff --git a/tools/sdk/include/lwip/lwip/apps/snmp_table.h b/tools/sdk/include/lwip/lwip/apps/snmp_table.h deleted file mode 100644 index 4988b51c250..00000000000 --- a/tools/sdk/include/lwip/lwip/apps/snmp_table.h +++ /dev/null @@ -1,134 +0,0 @@ -/** - * @file - * SNMP server MIB API to implement table nodes - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Martin Hentschel - * - */ - -#ifndef LWIP_HDR_APPS_SNMP_TABLE_H -#define LWIP_HDR_APPS_SNMP_TABLE_H - -#include "lwip/apps/snmp_opts.h" -#include "lwip/apps/snmp_core.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */ - -/** default (customizable) read/write table */ -struct snmp_table_col_def -{ - u32_t index; - u8_t asn1_type; - snmp_access_t access; -}; - -/** table node */ -struct snmp_table_node -{ - /** inherited "base class" members */ - struct snmp_leaf_node node; - u16_t column_count; - const struct snmp_table_col_def* columns; - snmp_err_t (*get_cell_instance)(const u32_t* column, const u32_t* row_oid, u8_t row_oid_len, struct snmp_node_instance* cell_instance); - snmp_err_t (*get_next_cell_instance)(const u32_t* column, struct snmp_obj_id* row_oid, struct snmp_node_instance* cell_instance); - /** returns object value for the given object identifier */ - node_instance_get_value_method get_value; - /** tests length and/or range BEFORE setting */ - node_instance_set_test_method set_test; - /** sets object value, only called when set_test() was successful */ - node_instance_set_value_method set_value; -}; - -snmp_err_t snmp_table_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance); -snmp_err_t snmp_table_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance); - -#define SNMP_TABLE_CREATE(oid, columns, get_cell_instance_method, get_next_cell_instance_method, get_value_method, set_test_method, set_value_method) \ - {{{ SNMP_NODE_TABLE, (oid) }, \ - snmp_table_get_instance, \ - snmp_table_get_next_instance }, \ - (u16_t)LWIP_ARRAYSIZE(columns), (columns), \ - (get_cell_instance_method), (get_next_cell_instance_method), \ - (get_value_method), (set_test_method), (set_value_method)} - -#define SNMP_TABLE_GET_COLUMN_FROM_OID(oid) ((oid)[1]) /* first array value is (fixed) row entry (fixed to 1) and 2nd value is column, follow3ed by instance */ - - -/** simple read-only table */ -typedef enum { - SNMP_VARIANT_VALUE_TYPE_U32, - SNMP_VARIANT_VALUE_TYPE_S32, - SNMP_VARIANT_VALUE_TYPE_PTR, - SNMP_VARIANT_VALUE_TYPE_CONST_PTR -} snmp_table_column_data_type_t; - -struct snmp_table_simple_col_def -{ - u32_t index; - u8_t asn1_type; - snmp_table_column_data_type_t data_type; /* depending of what union member is used to store the value*/ -}; - -/** simple read-only table node */ -struct snmp_table_simple_node -{ - /* inherited "base class" members */ - struct snmp_leaf_node node; - u16_t column_count; - const struct snmp_table_simple_col_def* columns; - snmp_err_t (*get_cell_value)(const u32_t* column, const u32_t* row_oid, u8_t row_oid_len, union snmp_variant_value* value, u32_t* value_len); - snmp_err_t (*get_next_cell_instance_and_value)(const u32_t* column, struct snmp_obj_id* row_oid, union snmp_variant_value* value, u32_t* value_len); -}; - -snmp_err_t snmp_table_simple_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance); -snmp_err_t snmp_table_simple_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance); - -#define SNMP_TABLE_CREATE_SIMPLE(oid, columns, get_cell_value_method, get_next_cell_instance_and_value_method) \ - {{{ SNMP_NODE_TABLE, (oid) }, \ - snmp_table_simple_get_instance, \ - snmp_table_simple_get_next_instance }, \ - (u16_t)LWIP_ARRAYSIZE(columns), (columns), (get_cell_value_method), (get_next_cell_instance_and_value_method) } - -s16_t snmp_table_extract_value_from_s32ref(struct snmp_node_instance* instance, void* value); -s16_t snmp_table_extract_value_from_u32ref(struct snmp_node_instance* instance, void* value); -s16_t snmp_table_extract_value_from_refconstptr(struct snmp_node_instance* instance, void* value); - -#endif /* LWIP_SNMP */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_APPS_SNMP_TABLE_H */ diff --git a/tools/sdk/include/lwip/lwip/apps/snmp_threadsync.h b/tools/sdk/include/lwip/lwip/apps/snmp_threadsync.h deleted file mode 100644 index a25dbf2d0f0..00000000000 --- a/tools/sdk/include/lwip/lwip/apps/snmp_threadsync.h +++ /dev/null @@ -1,114 +0,0 @@ -/** - * @file - * SNMP server MIB API to implement thread synchronization - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Dirk Ziegelmeier - * - */ - -#ifndef LWIP_HDR_APPS_SNMP_THREADSYNC_H -#define LWIP_HDR_APPS_SNMP_THREADSYNC_H - -#include "lwip/apps/snmp_opts.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/apps/snmp_core.h" -#include "lwip/sys.h" - -typedef void (*snmp_threadsync_called_fn)(void* arg); -typedef void (*snmp_threadsync_synchronizer_fn)(snmp_threadsync_called_fn fn, void* arg); - - -/** Thread sync runtime data. For internal usage only. */ -struct threadsync_data -{ - union { - snmp_err_t err; - s16_t s16; - } retval; - union { - const u32_t *root_oid; - void *value; - } arg1; - union { - u8_t root_oid_len; - u16_t len; - } arg2; - const struct snmp_threadsync_node *threadsync_node; - struct snmp_node_instance proxy_instance; -}; - -/** Thread sync instance. Needed EXCATLY once for every thread to be synced into. */ -struct snmp_threadsync_instance -{ - sys_sem_t sem; - sys_mutex_t sem_usage_mutex; - snmp_threadsync_synchronizer_fn sync_fn; - struct threadsync_data data; -}; - -/** SNMP thread sync proxy leaf node */ -struct snmp_threadsync_node -{ - /* inherited "base class" members */ - struct snmp_leaf_node node; - - const struct snmp_leaf_node *target; - struct snmp_threadsync_instance *instance; -}; - -snmp_err_t snmp_threadsync_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance); -snmp_err_t snmp_threadsync_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance); - -/** Create thread sync proxy node */ -#define SNMP_CREATE_THREAD_SYNC_NODE(oid, target_leaf_node, threadsync_instance) \ - {{{ SNMP_NODE_THREADSYNC, (oid) }, \ - snmp_threadsync_get_instance, \ - snmp_threadsync_get_next_instance }, \ - (target_leaf_node), \ - (threadsync_instance) } - -/** Create thread sync instance data */ -void snmp_threadsync_init(struct snmp_threadsync_instance *instance, snmp_threadsync_synchronizer_fn sync_fn); - -#endif /* LWIP_SNMP */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_APPS_SNMP_THREADSYNC_H */ diff --git a/tools/sdk/include/lwip/lwip/apps/snmpv3.h b/tools/sdk/include/lwip/lwip/apps/snmpv3.h deleted file mode 100644 index c99fed4e101..00000000000 --- a/tools/sdk/include/lwip/lwip/apps/snmpv3.h +++ /dev/null @@ -1,90 +0,0 @@ -/** - * @file - * Additional SNMPv3 functionality RFC3414 and RFC3826. - */ - -/* - * Copyright (c) 2016 Elias Oenal. - * All rights reserved. - * - * 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. - * - * Author: Elias Oenal - */ - -#ifndef LWIP_HDR_APPS_SNMP_V3_H -#define LWIP_HDR_APPS_SNMP_V3_H - -#include "lwip/apps/snmp_opts.h" -#include "lwip/err.h" - -#if LWIP_SNMP && LWIP_SNMP_V3 - -#define SNMP_V3_AUTH_ALGO_INVAL 0 -#define SNMP_V3_AUTH_ALGO_MD5 1 -#define SNMP_V3_AUTH_ALGO_SHA 2 - -#define SNMP_V3_PRIV_ALGO_INVAL 0 -#define SNMP_V3_PRIV_ALGO_DES 1 -#define SNMP_V3_PRIV_ALGO_AES 2 - -#define SNMP_V3_PRIV_MODE_DECRYPT 0 -#define SNMP_V3_PRIV_MODE_ENCRYPT 1 - -/* - * The following callback functions must be implemented by the application. - * There is a dummy implementation in snmpv3_dummy.c. - */ - -void snmpv3_get_engine_id(const char **id, u8_t *len); -err_t snmpv3_set_engine_id(const char* id, u8_t len); - -u32_t snmpv3_get_engine_boots(void); -void snmpv3_set_engine_boots(u32_t boots); - -u32_t snmpv3_get_engine_time(void); -void snmpv3_reset_engine_time(void); - -err_t snmpv3_get_user(const char* username, u8_t *auth_algo, u8_t *auth_key, u8_t *priv_algo, u8_t *priv_key); - -/* The following functions are provided by the SNMPv3 agent */ - -void snmpv3_engine_id_changed(void); - -void snmpv3_password_to_key_md5( - const u8_t *password, /* IN */ - u8_t passwordlen, /* IN */ - const u8_t *engineID, /* IN - pointer to snmpEngineID */ - u8_t engineLength, /* IN - length of snmpEngineID */ - u8_t *key); /* OUT - pointer to caller 16-octet buffer */ - -void snmpv3_password_to_key_sha( - const u8_t *password, /* IN */ - u8_t passwordlen, /* IN */ - const u8_t *engineID, /* IN - pointer to snmpEngineID */ - u8_t engineLength, /* IN - length of snmpEngineID */ - u8_t *key); /* OUT - pointer to caller 20-octet buffer */ - -#endif - -#endif /* LWIP_HDR_APPS_SNMP_V3_H */ diff --git a/tools/sdk/include/lwip/lwip/apps/sntp.h b/tools/sdk/include/lwip/lwip/apps/sntp.h deleted file mode 100644 index 40df9cc590f..00000000000 --- a/tools/sdk/include/lwip/lwip/apps/sntp.h +++ /dev/null @@ -1,76 +0,0 @@ -/** - * @file - * SNTP client API - */ - -/* - * Copyright (c) 2007-2009 Frédéric Bernon, Simon Goldschmidt - * All rights reserved. - * - * 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: Frédéric Bernon, Simon Goldschmidt - * - */ -#ifndef LWIP_HDR_APPS_SNTP_H -#define LWIP_HDR_APPS_SNTP_H - -#include "lwip/apps/sntp_opts.h" -#include "lwip/ip_addr.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* SNTP operating modes: default is to poll using unicast. - The mode has to be set before calling sntp_init(). */ -#define SNTP_OPMODE_POLL 0 -#define SNTP_OPMODE_LISTENONLY 1 -void sntp_setoperatingmode(u8_t operating_mode); -u8_t sntp_getoperatingmode(void); - -void sntp_init(void); -void sntp_stop(void); -u8_t sntp_enabled(void); - -void sntp_setserver(u8_t idx, const ip_addr_t *addr); -const ip_addr_t* sntp_getserver(u8_t idx); - -#if SNTP_SERVER_DNS -void sntp_setservername(u8_t idx, char *server); -char *sntp_getservername(u8_t idx); -#endif /* SNTP_SERVER_DNS */ - -#if SNTP_GET_SERVERS_FROM_DHCP -void sntp_servermode_dhcp(int set_servers_from_dhcp); -#else /* SNTP_GET_SERVERS_FROM_DHCP */ -#define sntp_servermode_dhcp(x) -#endif /* SNTP_GET_SERVERS_FROM_DHCP */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_APPS_SNTP_H */ diff --git a/tools/sdk/include/lwip/lwip/apps/sntp_opts.h b/tools/sdk/include/lwip/lwip/apps/sntp_opts.h deleted file mode 100644 index dee0f0a41bd..00000000000 --- a/tools/sdk/include/lwip/lwip/apps/sntp_opts.h +++ /dev/null @@ -1,173 +0,0 @@ -/** - * @file - * SNTP client options list - */ - -/* - * Copyright (c) 2007-2009 Frédéric Bernon, Simon Goldschmidt - * All rights reserved. - * - * 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: Frédéric Bernon, Simon Goldschmidt - * - */ -#ifndef LWIP_HDR_APPS_SNTP_OPTS_H -#define LWIP_HDR_APPS_SNTP_OPTS_H - -#include "lwip/opt.h" - -/** - * @defgroup sntp_opts Options - * @ingroup sntp - * @{ - */ - -/** SNTP macro to change system time in seconds - * Define SNTP_SET_SYSTEM_TIME_US(sec, us) to set the time in microseconds instead of this one - * if you need the additional precision. - */ -#if !defined SNTP_SET_SYSTEM_TIME || defined __DOXYGEN__ -#define SNTP_SET_SYSTEM_TIME(sec) LWIP_UNUSED_ARG(sec) -#endif - -/** The maximum number of SNTP servers that can be set */ -#if !defined SNTP_MAX_SERVERS || defined __DOXYGEN__ -#define SNTP_MAX_SERVERS LWIP_DHCP_MAX_NTP_SERVERS -#endif - -/** Set this to 1 to implement the callback function called by dhcp when - * NTP servers are received. */ -#if !defined SNTP_GET_SERVERS_FROM_DHCP || defined __DOXYGEN__ -#define SNTP_GET_SERVERS_FROM_DHCP LWIP_DHCP_GET_NTP_SRV -#endif - -/** Set this to 1 to support DNS names (or IP address strings) to set sntp servers - * One server address/name can be defined as default if SNTP_SERVER_DNS == 1: - * \#define SNTP_SERVER_ADDRESS "pool.ntp.org" - */ -#if !defined SNTP_SERVER_DNS || defined __DOXYGEN__ -#define SNTP_SERVER_DNS 1 -#endif - -/** - * SNTP_DEBUG: Enable debugging for SNTP. - */ -#if !defined SNTP_DEBUG || defined __DOXYGEN__ -#define SNTP_DEBUG LWIP_DBG_OFF -#endif - -/** SNTP server port */ -#if !defined SNTP_PORT || defined __DOXYGEN__ -#define SNTP_PORT 123 -#endif - -/** Set this to 1 to allow config of SNTP server(s) by DNS name */ -#if !defined SNTP_SERVER_DNS || defined __DOXYGEN__ -#define SNTP_SERVER_DNS 0 -#endif - -/** Sanity check: - * Define this to - * - 0 to turn off sanity checks (default; smaller code) - * - >= 1 to check address and port of the response packet to ensure the - * response comes from the server we sent the request to. - * - >= 2 to check returned Originate Timestamp against Transmit Timestamp - * sent to the server (to ensure response to older request). - * - >= 3 @todo: discard reply if any of the LI, Stratum, or Transmit Timestamp - * fields is 0 or the Mode field is not 4 (unicast) or 5 (broadcast). - * - >= 4 @todo: to check that the Root Delay and Root Dispersion fields are each - * greater than or equal to 0 and less than infinity, where infinity is - * currently a cozy number like one second. This check avoids using a - * server whose synchronization source has expired for a very long time. - */ -#if !defined SNTP_CHECK_RESPONSE || defined __DOXYGEN__ -#define SNTP_CHECK_RESPONSE 0 -#endif - -/** According to the RFC, this shall be a random delay - * between 1 and 5 minutes (in milliseconds) to prevent load peaks. - * This can be defined to a random generation function, - * which must return the delay in milliseconds as u32_t. - * Turned off by default. - */ -#if !defined SNTP_STARTUP_DELAY || defined __DOXYGEN__ -#define SNTP_STARTUP_DELAY 0 -#endif - -/** If you want the startup delay to be a function, define this - * to a function (including the brackets) and define SNTP_STARTUP_DELAY to 1. - */ -#if !defined SNTP_STARTUP_DELAY_FUNC || defined __DOXYGEN__ -#define SNTP_STARTUP_DELAY_FUNC SNTP_STARTUP_DELAY -#endif - -/** SNTP receive timeout - in milliseconds - * Also used as retry timeout - this shouldn't be too low. - * Default is 3 seconds. - */ -#if !defined SNTP_RECV_TIMEOUT || defined __DOXYGEN__ -#define SNTP_RECV_TIMEOUT 3000 -#endif - -/** SNTP update delay - in milliseconds - * Default is 1 hour. Must not be beolw 15 seconds by specification (i.e. 15000) - */ -#if !defined SNTP_UPDATE_DELAY || defined __DOXYGEN__ -#define SNTP_UPDATE_DELAY 3600000 -#endif - -/** SNTP macro to get system time, used with SNTP_CHECK_RESPONSE >= 2 - * to send in request and compare in response. - */ -#if !defined SNTP_GET_SYSTEM_TIME || defined __DOXYGEN__ -#define SNTP_GET_SYSTEM_TIME(sec, us) do { (sec) = 0; (us) = 0; } while(0) -#endif - -/** Default retry timeout (in milliseconds) if the response - * received is invalid. - * This is doubled with each retry until SNTP_RETRY_TIMEOUT_MAX is reached. - */ -#if !defined SNTP_RETRY_TIMEOUT || defined __DOXYGEN__ -#define SNTP_RETRY_TIMEOUT SNTP_RECV_TIMEOUT -#endif - -/** Maximum retry timeout (in milliseconds). */ -#if !defined SNTP_RETRY_TIMEOUT_MAX || defined __DOXYGEN__ -#define SNTP_RETRY_TIMEOUT_MAX (SNTP_RETRY_TIMEOUT * 10) -#endif - -/** Increase retry timeout with every retry sent - * Default is on to conform to RFC. - */ -#if !defined SNTP_RETRY_TIMEOUT_EXP || defined __DOXYGEN__ -#define SNTP_RETRY_TIMEOUT_EXP 1 -#endif - -/** - * @} - */ - -#endif /* LWIP_HDR_APPS_SNTP_OPTS_H */ diff --git a/tools/sdk/include/lwip/lwip/apps/tftp_opts.h b/tools/sdk/include/lwip/lwip/apps/tftp_opts.h deleted file mode 100644 index 6968a803b43..00000000000 --- a/tools/sdk/include/lwip/lwip/apps/tftp_opts.h +++ /dev/null @@ -1,105 +0,0 @@ -/****************************************************************//** - * - * @file tftp_opts.h - * - * @author Logan Gunthorpe - * - * @brief Trivial File Transfer Protocol (RFC 1350) implementation options - * - * Copyright (c) Deltatee Enterprises Ltd. 2013 - * All rights reserved. - * - ********************************************************************/ - -/* - * 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. - * - * Author: Logan Gunthorpe - * - */ - -#ifndef LWIP_HDR_APPS_TFTP_OPTS_H -#define LWIP_HDR_APPS_TFTP_OPTS_H - -#include "lwip/opt.h" - -/** - * @defgroup tftp_opts Options - * @ingroup tftp - * @{ - */ - -/** - * Enable TFTP debug messages - */ -#if !defined TFTP_DEBUG || defined __DOXYGEN__ -#define TFTP_DEBUG LWIP_DBG_ON -#endif - -/** - * TFTP server port - */ -#if !defined TFTP_PORT || defined __DOXYGEN__ -#define TFTP_PORT 69 -#endif - -/** - * TFTP timeout - */ -#if !defined TFTP_TIMEOUT_MSECS || defined __DOXYGEN__ -#define TFTP_TIMEOUT_MSECS 10000 -#endif - -/** - * Max. number of retries when a file is read from server - */ -#if !defined TFTP_MAX_RETRIES || defined __DOXYGEN__ -#define TFTP_MAX_RETRIES 5 -#endif - -/** - * TFTP timer cyclic interval - */ -#if !defined TFTP_TIMER_MSECS || defined __DOXYGEN__ -#define TFTP_TIMER_MSECS 50 -#endif - -/** - * Max. length of TFTP filename - */ -#if !defined TFTP_MAX_FILENAME_LEN || defined __DOXYGEN__ -#define TFTP_MAX_FILENAME_LEN 20 -#endif - -/** - * Max. length of TFTP mode - */ -#if !defined TFTP_MAX_MODE_LEN || defined __DOXYGEN__ -#define TFTP_MAX_MODE_LEN 7 -#endif - -/** - * @} - */ - -#endif /* LWIP_HDR_APPS_TFTP_OPTS_H */ diff --git a/tools/sdk/include/lwip/lwip/apps/tftp_server.h b/tools/sdk/include/lwip/lwip/apps/tftp_server.h deleted file mode 100644 index 3fbe701e0a2..00000000000 --- a/tools/sdk/include/lwip/lwip/apps/tftp_server.h +++ /dev/null @@ -1,94 +0,0 @@ -/****************************************************************//** - * - * @file tftp_server.h - * - * @author Logan Gunthorpe - * - * @brief Trivial File Transfer Protocol (RFC 1350) - * - * Copyright (c) Deltatee Enterprises Ltd. 2013 - * All rights reserved. - * - ********************************************************************/ - -/* - * 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. - * - * Author: Logan Gunthorpe - * - */ - -#ifndef LWIP_HDR_APPS_TFTP_SERVER_H -#define LWIP_HDR_APPS_TFTP_SERVER_H - -#include "lwip/apps/tftp_opts.h" -#include "lwip/err.h" -#include "lwip/pbuf.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** @ingroup tftp - * TFTP context containing callback functions for TFTP transfers - */ -struct tftp_context { - /** - * Open file for read/write. - * @param fname Filename - * @param mode Mode string from TFTP RFC 1350 (netascii, octet, mail) - * @param write Flag indicating read (0) or write (!= 0) access - * @returns File handle supplied to other functions - */ - void* (*open)(const char* fname, const char* mode, u8_t write); - /** - * Close file handle - * @param handle File handle returned by open() - */ - void (*close)(void* handle); - /** - * Read from file - * @param handle File handle returned by open() - * @param buf Target buffer to copy read data to - * @param bytes Number of bytes to copy to buf - * @returns >= 0: Success; < 0: Error - */ - int (*read)(void* handle, void* buf, int bytes); - /** - * Write to file - * @param handle File handle returned by open() - * @param pbuf PBUF adjusted such that payload pointer points - * to the beginning of write data. In other words, - * TFTP headers are stripped off. - * @returns >= 0: Success; < 0: Error - */ - int (*write)(void* handle, struct pbuf* p); -}; - -err_t tftp_init(const struct tftp_context* ctx); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_APPS_TFTP_SERVER_H */ diff --git a/tools/sdk/include/lwip/lwip/arch.h b/tools/sdk/include/lwip/lwip/arch.h deleted file mode 100644 index 31d92ca3f44..00000000000 --- a/tools/sdk/include/lwip/lwip/arch.h +++ /dev/null @@ -1,318 +0,0 @@ -/** - * @file - * Support for different processor and compiler architectures - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_ARCH_H -#define LWIP_HDR_ARCH_H - -#ifndef LITTLE_ENDIAN -#define LITTLE_ENDIAN 1234 -#endif - -#ifndef BIG_ENDIAN -#define BIG_ENDIAN 4321 -#endif - -#include "arch/cc.h" - -/** - * @defgroup compiler_abstraction Compiler/platform abstraction - * @ingroup sys_layer - * All defines related to this section must not be placed in lwipopts.h, - * but in arch/cc.h! - * These options cannot be \#defined in lwipopts.h since they are not options - * of lwIP itself, but options of the lwIP port to your system. - * @{ - */ - -/** Define the byte order of the system. - * Needed for conversion of network data to host byte order. - * Allowed values: LITTLE_ENDIAN and BIG_ENDIAN - */ -#ifndef BYTE_ORDER -#define BYTE_ORDER LITTLE_ENDIAN -#endif - -/** Define random number generator function of your system */ -#ifdef __DOXYGEN__ -#define LWIP_RAND() ((u32_t)rand()) -#endif - -/** Platform specific diagnostic output.\n - * Note the default implementation pulls in printf, which may - * in turn pull in a lot of standard libary code. In resource-constrained - * systems, this should be defined to something less resource-consuming. - */ -#ifndef LWIP_PLATFORM_DIAG -#define LWIP_PLATFORM_DIAG(x) do {printf x;} while(0) -#include -#include -#endif - -/** Platform specific assertion handling.\n - * Note the default implementation pulls in printf, fflush and abort, which may - * in turn pull in a lot of standard libary code. In resource-constrained - * systems, this should be defined to something less resource-consuming. - */ -#ifndef LWIP_PLATFORM_ASSERT -#define LWIP_PLATFORM_ASSERT(x) do {printf("Assertion \"%s\" failed at line %d in %s\n", \ - x, __LINE__, __FILE__); fflush(NULL); abort();} while(0) -#include -#include -#endif - -/** Define this to 1 in arch/cc.h of your port if you do not want to - * include stddef.h header to get size_t. You need to typedef size_t - * by yourself in this case. - */ -#ifndef LWIP_NO_STDDEF_H -#define LWIP_NO_STDDEF_H 0 -#endif - -#if !LWIP_NO_STDDEF_H -#include /* for size_t */ -#endif - -/** Define this to 1 in arch/cc.h of your port if your compiler does not provide - * the stdint.h header. You need to typedef the generic types listed in - * lwip/arch.h yourself in this case (u8_t, u16_t...). - */ -#ifndef LWIP_NO_STDINT_H -#define LWIP_NO_STDINT_H 0 -#endif - -/* Define generic types used in lwIP */ -#if !LWIP_NO_STDINT_H -#include -typedef uint8_t u8_t; -typedef int8_t s8_t; -typedef uint16_t u16_t; -typedef int16_t s16_t; -typedef uint32_t u32_t; -typedef int32_t s32_t; -#endif - -/** Define this to 1 in arch/cc.h of your port if your compiler does not provide - * the inttypes.h header. You need to define the format strings listed in - * lwip/arch.h yourself in this case (X8_F, U16_F...). - */ -#ifndef LWIP_NO_INTTYPES_H -#define LWIP_NO_INTTYPES_H 0 -#endif - -/* Define (sn)printf formatters for these lwIP types */ -#if !LWIP_NO_INTTYPES_H -#include -#ifndef X8_F -#define X8_F "02" PRIx8 -#endif -#ifndef U16_F -#define U16_F PRIu16 -#endif -#ifndef S16_F -#define S16_F PRId16 -#endif -#ifndef X16_F -#define X16_F PRIx16 -#endif -#ifndef U32_F -#define U32_F PRIu32 -#endif -#ifndef S32_F -#define S32_F PRId32 -#endif -#ifndef X32_F -#define X32_F PRIx32 -#endif -#ifndef SZT_F -#define SZT_F PRIuPTR -#endif -#endif - -/** Define this to 1 in arch/cc.h of your port if your compiler does not provide - * the limits.h header. You need to define the type limits yourself in this case - * (e.g. INT_MAX). - */ -#ifndef LWIP_NO_LIMITS_H -#define LWIP_NO_LIMITS_H 0 -#endif - -/* Include limits.h? */ -#if !LWIP_NO_LIMITS_H -#include -#endif - -/** C++ const_cast(val) equivalent to remove constness from a value (GCC -Wcast-qual) */ -#ifndef LWIP_CONST_CAST -#define LWIP_CONST_CAST(target_type, val) ((target_type)((ptrdiff_t)val)) -#endif - -/** Get rid of alignment cast warnings (GCC -Wcast-align) */ -#ifndef LWIP_ALIGNMENT_CAST -#define LWIP_ALIGNMENT_CAST(target_type, val) LWIP_CONST_CAST(target_type, val) -#endif - -/** Get rid of warnings related to pointer-to-numeric and vice-versa casts, - * e.g. "conversion from 'u8_t' to 'void *' of greater size" - */ -#ifndef LWIP_PTR_NUMERIC_CAST -#define LWIP_PTR_NUMERIC_CAST(target_type, val) LWIP_CONST_CAST(target_type, val) -#endif - -/** Allocates a memory buffer of specified size that is of sufficient size to align - * its start address using LWIP_MEM_ALIGN. - * You can declare your own version here e.g. to enforce alignment without adding - * trailing padding bytes (see LWIP_MEM_ALIGN_BUFFER) or your own section placement - * requirements.\n - * e.g. if you use gcc and need 32 bit alignment:\n - * \#define LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size) u8_t variable_name[size] \_\_attribute\_\_((aligned(4)))\n - * or more portable:\n - * \#define LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size) u32_t variable_name[(size + sizeof(u32_t) - 1) / sizeof(u32_t)] - */ -#ifndef LWIP_DECLARE_MEMORY_ALIGNED -#define LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size) u8_t variable_name[LWIP_MEM_ALIGN_BUFFER(size)] -#endif - -/** Calculate memory size for an aligned buffer - returns the next highest - * multiple of MEM_ALIGNMENT (e.g. LWIP_MEM_ALIGN_SIZE(3) and - * LWIP_MEM_ALIGN_SIZE(4) will both yield 4 for MEM_ALIGNMENT == 4). - */ -#ifndef LWIP_MEM_ALIGN_SIZE -#define LWIP_MEM_ALIGN_SIZE(size) (((size) + MEM_ALIGNMENT - 1U) & ~(MEM_ALIGNMENT-1U)) -#endif - -/** Calculate safe memory size for an aligned buffer when using an unaligned - * type as storage. This includes a safety-margin on (MEM_ALIGNMENT - 1) at the - * start (e.g. if buffer is u8_t[] and actual data will be u32_t*) - */ -#ifndef LWIP_MEM_ALIGN_BUFFER -#define LWIP_MEM_ALIGN_BUFFER(size) (((size) + MEM_ALIGNMENT - 1U)) -#endif - -/** Align a memory pointer to the alignment defined by MEM_ALIGNMENT - * so that ADDR % MEM_ALIGNMENT == 0 - */ -#ifndef LWIP_MEM_ALIGN -#define LWIP_MEM_ALIGN(addr) ((void *)(((mem_ptr_t)(addr) + MEM_ALIGNMENT - 1) & ~(mem_ptr_t)(MEM_ALIGNMENT-1))) -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** Packed structs support. - * Placed BEFORE declaration of a packed struct.\n - * For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n - * A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here. - */ -#ifndef PACK_STRUCT_BEGIN -#define PACK_STRUCT_BEGIN -#endif /* PACK_STRUCT_BEGIN */ - -/** Packed structs support. - * Placed AFTER declaration of a packed struct.\n - * For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n - * A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here. - */ -#ifndef PACK_STRUCT_END -#define PACK_STRUCT_END -#endif /* PACK_STRUCT_END */ - -/** Packed structs support. - * Placed between end of declaration of a packed struct and trailing semicolon.\n - * For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n - * A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here. - */ -#ifndef PACK_STRUCT_STRUCT -#if defined(__GNUC__) || defined(__clang__) -#define PACK_STRUCT_STRUCT __attribute__((packed)) -#else -#define PACK_STRUCT_STRUCT -#endif -#endif /* PACK_STRUCT_STRUCT */ - -/** Packed structs support. - * Wraps u32_t and u16_t members.\n - * For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n - * A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here. - */ -#ifndef PACK_STRUCT_FIELD -#define PACK_STRUCT_FIELD(x) x -#endif /* PACK_STRUCT_FIELD */ - -/** Packed structs support. - * Wraps u8_t members, where some compilers warn that packing is not necessary.\n - * For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n - * A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here. - */ -#ifndef PACK_STRUCT_FLD_8 -#define PACK_STRUCT_FLD_8(x) PACK_STRUCT_FIELD(x) -#endif /* PACK_STRUCT_FLD_8 */ - -/** Packed structs support. - * Wraps members that are packed structs themselves, where some compilers warn that packing is not necessary.\n - * For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n - * A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here. - */ -#ifndef PACK_STRUCT_FLD_S -#define PACK_STRUCT_FLD_S(x) PACK_STRUCT_FIELD(x) -#endif /* PACK_STRUCT_FLD_S */ - -/** Packed structs support using \#include files before and after struct to be packed.\n - * The file included BEFORE the struct is "arch/bpstruct.h".\n - * The file included AFTER the struct is "arch/epstruct.h".\n - * This can be used to implement struct packing on MS Visual C compilers, see - * the Win32 port in the lwIP contrib repository for reference. - * For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n - * A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here. - */ -#ifdef __DOXYGEN__ -#define PACK_STRUCT_USE_INCLUDES -#endif - -/** Eliminates compiler warning about unused arguments (GCC -Wextra -Wunused). */ -#ifndef LWIP_UNUSED_ARG -#define LWIP_UNUSED_ARG(x) (void)x -#endif /* LWIP_UNUSED_ARG */ - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_ARCH_H */ diff --git a/tools/sdk/include/lwip/lwip/autoip.h b/tools/sdk/include/lwip/lwip/autoip.h deleted file mode 100644 index 1d85bccff8b..00000000000 --- a/tools/sdk/include/lwip/lwip/autoip.h +++ /dev/null @@ -1,99 +0,0 @@ -/** - * @file - * - * AutoIP Automatic LinkLocal IP Configuration - */ - -/* - * - * Copyright (c) 2007 Dominik Spies - * All rights reserved. - * - * 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. - * - * Author: Dominik Spies - * - * This is a AutoIP implementation for the lwIP TCP/IP stack. It aims to conform - * with RFC 3927. - * - */ - -#ifndef LWIP_HDR_AUTOIP_H -#define LWIP_HDR_AUTOIP_H - -#include "lwip/opt.h" - -#if LWIP_IPV4 && LWIP_AUTOIP /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/netif.h" -/* #include "lwip/udp.h" */ -#include "lwip/etharp.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** AutoIP Timing */ -#define AUTOIP_TMR_INTERVAL 100 -#define AUTOIP_TICKS_PER_SECOND (1000 / AUTOIP_TMR_INTERVAL) - -/** AutoIP state information per netif */ -struct autoip -{ - /** the currently selected, probed, announced or used LL IP-Address */ - ip4_addr_t llipaddr; - /** current AutoIP state machine state */ - u8_t state; - /** sent number of probes or announces, dependent on state */ - u8_t sent_num; - /** ticks to wait, tick is AUTOIP_TMR_INTERVAL long */ - u16_t ttw; - /** ticks until a conflict can be solved by defending */ - u8_t lastconflict; - /** total number of probed/used Link Local IP-Addresses */ - u8_t tried_llipaddr; -}; - - -void autoip_set_struct(struct netif *netif, struct autoip *autoip); -/** Remove a struct autoip previously set to the netif using autoip_set_struct() */ -#define autoip_remove_struct(netif) do { (netif)->autoip = NULL; } while (0) -err_t autoip_start(struct netif *netif); -err_t autoip_stop(struct netif *netif); -void autoip_arp_reply(struct netif *netif, struct etharp_hdr *hdr); -void autoip_tmr(void); -void autoip_network_changed(struct netif *netif); -u8_t autoip_supplied_address(const struct netif *netif); - -/* for lwIP internal use by ip4.c */ -u8_t autoip_accept_packet(struct netif *netif, const ip4_addr_t *addr); - -#define netif_autoip_data(netif) ((struct autoip*)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_AUTOIP)) - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_IPV4 && LWIP_AUTOIP */ - -#endif /* LWIP_HDR_AUTOIP_H */ diff --git a/tools/sdk/include/lwip/lwip/debug.h b/tools/sdk/include/lwip/lwip/debug.h deleted file mode 100644 index a142f1cff3c..00000000000 --- a/tools/sdk/include/lwip/lwip/debug.h +++ /dev/null @@ -1,167 +0,0 @@ -/** - * @file - * Debug messages infrastructure - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_DEBUG_H -#define LWIP_HDR_DEBUG_H - -#include "lwip/arch.h" -#include "lwip/opt.h" - -/** - * @defgroup debugging_levels LWIP_DBG_MIN_LEVEL and LWIP_DBG_TYPES_ON values - * @ingroup lwip_opts_debugmsg - * @{ - */ - -/** @name Debug level (LWIP_DBG_MIN_LEVEL) - * @{ - */ -/** Debug level: ALL messages*/ -#define LWIP_DBG_LEVEL_ALL 0x00 -/** Debug level: Warnings. bad checksums, dropped packets, ... */ -#define LWIP_DBG_LEVEL_WARNING 0x01 -/** Debug level: Serious. memory allocation failures, ... */ -#define LWIP_DBG_LEVEL_SERIOUS 0x02 -/** Debug level: Severe */ -#define LWIP_DBG_LEVEL_SEVERE 0x03 -/** - * @} - */ - -#define LWIP_DBG_MASK_LEVEL 0x03 -/* compatibility define only */ -#define LWIP_DBG_LEVEL_OFF LWIP_DBG_LEVEL_ALL - -/** @name Enable/disable debug messages completely (LWIP_DBG_TYPES_ON) - * @{ - */ -/** flag for LWIP_DEBUGF to enable that debug message */ -#define LWIP_DBG_ON 0x80U -/** flag for LWIP_DEBUGF to disable that debug message */ -#define LWIP_DBG_OFF 0x00U -/** - * @} - */ - -/** @name Debug message types (LWIP_DBG_TYPES_ON) - * @{ - */ -/** flag for LWIP_DEBUGF indicating a tracing message (to follow program flow) */ -#define LWIP_DBG_TRACE 0x40U -/** flag for LWIP_DEBUGF indicating a state debug message (to follow module states) */ -#define LWIP_DBG_STATE 0x20U -/** flag for LWIP_DEBUGF indicating newly added code, not thoroughly tested yet */ -#define LWIP_DBG_FRESH 0x10U -/** flag for LWIP_DEBUGF to halt after printing this debug message */ -#define LWIP_DBG_HALT 0x08U -/** - * @} - */ - -/** - * @} - */ - -/** - * @defgroup lwip_assertions Assertion handling - * @ingroup lwip_opts_debug - * @{ - */ -/** - * LWIP_NOASSERT: Disable LWIP_ASSERT checks: - * To disable assertions define LWIP_NOASSERT in arch/cc.h. - */ -#ifdef __DOXYGEN__ -#define LWIP_NOASSERT -#undef LWIP_NOASSERT -#endif -/** - * @} - */ - -#ifndef LWIP_NOASSERT -#define LWIP_ASSERT(message, assertion) do { if (!(assertion)) { \ - LWIP_PLATFORM_ASSERT(message); }} while(0) -#ifndef LWIP_PLATFORM_ASSERT -#error "If you want to use LWIP_ASSERT, LWIP_PLATFORM_ASSERT(message) needs to be defined in your arch/cc.h" -#endif -#else /* LWIP_NOASSERT */ -#define LWIP_ASSERT(message, assertion) -#endif /* LWIP_NOASSERT */ - -#ifndef LWIP_ERROR -#ifndef LWIP_NOASSERT -#define LWIP_PLATFORM_ERROR(message) LWIP_PLATFORM_ASSERT(message) -#elif defined LWIP_DEBUG -#define LWIP_PLATFORM_ERROR(message) LWIP_PLATFORM_DIAG((message)) -#else -#define LWIP_PLATFORM_ERROR(message) -#endif - -/* if "expression" isn't true, then print "message" and execute "handler" expression */ -#define LWIP_ERROR(message, expression, handler) do { if (!(expression)) { \ - LWIP_PLATFORM_ERROR(message); handler;}} while(0) -#endif /* LWIP_ERROR */ - -/** Enable debug message printing, but only if debug message type is enabled - * AND is of correct type AND is at least LWIP_DBG_LEVEL. - */ -#ifdef __DOXYGEN__ -#define LWIP_DEBUG -#undef LWIP_DEBUG -#endif - -#ifdef LWIP_DEBUG -#ifndef LWIP_PLATFORM_DIAG -#error "If you want to use LWIP_DEBUG, LWIP_PLATFORM_DIAG(message) needs to be defined in your arch/cc.h" -#endif -#define LWIP_DEBUGF(debug, message) do { \ - if ( \ - ((debug) & LWIP_DBG_ON) && \ - ((debug) & LWIP_DBG_TYPES_ON) && \ - ((s16_t)((debug) & LWIP_DBG_MASK_LEVEL) >= LWIP_DBG_MIN_LEVEL)) { \ - LWIP_PLATFORM_DIAG(message); \ - if ((debug) & LWIP_DBG_HALT) { \ - while(1); \ - } \ - } \ - } while(0) - -#else /* LWIP_DEBUG */ -#define LWIP_DEBUGF(debug, message) -#endif /* LWIP_DEBUG */ - -#endif /* LWIP_HDR_DEBUG_H */ diff --git a/tools/sdk/include/lwip/lwip/def.h b/tools/sdk/include/lwip/lwip/def.h deleted file mode 100644 index 82a9d896f0f..00000000000 --- a/tools/sdk/include/lwip/lwip/def.h +++ /dev/null @@ -1,141 +0,0 @@ -/** - * @file - * various utility macros - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_DEF_H -#define LWIP_HDR_DEF_H - -/* arch.h might define NULL already */ -#include "lwip/arch.h" -#include "lwip/opt.h" -#if LWIP_PERF -#include "arch/perf.h" -#else /* LWIP_PERF */ -#define PERF_START /* null definition */ -#define PERF_STOP(x) /* null definition */ -#endif /* LWIP_PERF */ - -#ifdef __cplusplus -extern "C" { -#endif - -#define LWIP_MAX(x , y) (((x) > (y)) ? (x) : (y)) -#define LWIP_MIN(x , y) (((x) < (y)) ? (x) : (y)) - -/* Get the number of entries in an array ('x' must NOT be a pointer!) */ -#define LWIP_ARRAYSIZE(x) (sizeof(x)/sizeof((x)[0])) - -/** Create u32_t value from bytes */ -#define LWIP_MAKEU32(a,b,c,d) (((u32_t)((a) & 0xff) << 24) | \ - ((u32_t)((b) & 0xff) << 16) | \ - ((u32_t)((c) & 0xff) << 8) | \ - (u32_t)((d) & 0xff)) - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if BYTE_ORDER == BIG_ENDIAN -#define lwip_htons(x) (x) -#define lwip_ntohs(x) (x) -#define lwip_htonl(x) (x) -#define lwip_ntohl(x) (x) -#define PP_HTONS(x) (x) -#define PP_NTOHS(x) (x) -#define PP_HTONL(x) (x) -#define PP_NTOHL(x) (x) -#else /* BYTE_ORDER != BIG_ENDIAN */ -#ifndef lwip_htons -u16_t lwip_htons(u16_t x); -#endif -#define lwip_ntohs(x) lwip_htons(x) - -#ifndef lwip_htonl -u32_t lwip_htonl(u32_t x); -#endif -#define lwip_ntohl(x) lwip_htonl(x) - -/* These macros should be calculated by the preprocessor and are used - with compile-time constants only (so that there is no little-endian - overhead at runtime). */ -#define PP_HTONS(x) ((((x) & 0x00ffUL) << 8) | (((x) & 0xff00UL) >> 8)) -#define PP_NTOHS(x) PP_HTONS(x) -#define PP_HTONL(x) ((((x) & 0x000000ffUL) << 24) | \ - (((x) & 0x0000ff00UL) << 8) | \ - (((x) & 0x00ff0000UL) >> 8) | \ - (((x) & 0xff000000UL) >> 24)) -#define PP_NTOHL(x) PP_HTONL(x) -#endif /* BYTE_ORDER == BIG_ENDIAN */ - -/* Provide usual function names as macros for users, but this can be turned off */ -#ifndef LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS -#define htons(x) lwip_htons(x) -#define ntohs(x) lwip_ntohs(x) -#define htonl(x) lwip_htonl(x) -#define ntohl(x) lwip_ntohl(x) -#endif - -/* Functions that are not available as standard implementations. - * In cc.h, you can #define these to implementations available on - * your platform to save some code bytes if you use these functions - * in your application, too. - */ - -#ifndef lwip_itoa -/* This can be #defined to itoa() or snprintf(result, bufsize, "%d", number) depending on your platform */ -void lwip_itoa(char* result, size_t bufsize, int number); -#endif -#ifndef lwip_strnicmp -/* This can be #defined to strnicmp() or strncasecmp() depending on your platform */ -int lwip_strnicmp(const char* str1, const char* str2, size_t len); -#endif -#ifndef lwip_stricmp -/* This can be #defined to stricmp() or strcasecmp() depending on your platform */ -int lwip_stricmp(const char* str1, const char* str2); -#endif -#ifndef lwip_strnstr -/* This can be #defined to strnstr() depending on your platform */ -char* lwip_strnstr(const char* buffer, const char* token, size_t n); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_DEF_H */ diff --git a/tools/sdk/include/lwip/lwip/dhcp.h b/tools/sdk/include/lwip/lwip/dhcp.h deleted file mode 100644 index 23a36bb02b9..00000000000 --- a/tools/sdk/include/lwip/lwip/dhcp.h +++ /dev/null @@ -1,165 +0,0 @@ -/** - * @file - * DHCP client API - */ - -/* - * Copyright (c) 2001-2004 Leon Woestenberg - * Copyright (c) 2001-2004 Axon Digital Design B.V., The Netherlands. - * All rights reserved. - * - * 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: Leon Woestenberg - * - */ -#ifndef LWIP_HDR_DHCP_H -#define LWIP_HDR_DHCP_H - -#include "lwip/opt.h" - -#if LWIP_DHCP /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/netif.h" -#include "lwip/udp.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** period (in seconds) of the application calling dhcp_coarse_tmr() */ -#if ESP_DHCP -#define DHCP_COARSE_TIMER_SECS 1 -#else -#define DHCP_COARSE_TIMER_SECS 60 -#endif -/** period (in milliseconds) of the application calling dhcp_coarse_tmr() */ -#define DHCP_COARSE_TIMER_MSECS (DHCP_COARSE_TIMER_SECS * 1000UL) -/** period (in milliseconds) of the application calling dhcp_fine_tmr() */ -#define DHCP_FINE_TIMER_MSECS 500 - -#define DHCP_BOOT_FILE_LEN 128U - -/* AutoIP cooperation flags (struct dhcp.autoip_coop_state) */ -typedef enum { - DHCP_AUTOIP_COOP_STATE_OFF = 0, - DHCP_AUTOIP_COOP_STATE_ON = 1 -} dhcp_autoip_coop_state_enum_t; - -struct dhcp -{ - /** transaction identifier of last sent request */ - u32_t xid; - /** incoming msg */ - struct dhcp_msg *msg_in; - /** track PCB allocation state */ - u8_t pcb_allocated; - /** current DHCP state machine state */ - u8_t state; - /** retries of current request */ - u8_t tries; -#if LWIP_DHCP_AUTOIP_COOP - u8_t autoip_coop_state; -#endif - u8_t subnet_mask_given; - - struct pbuf *p_out; /* pbuf of outcoming msg */ - struct dhcp_msg *msg_out; /* outgoing msg */ - u16_t options_out_len; /* outgoing msg options length */ - u16_t request_timeout; /* #ticks with period DHCP_FINE_TIMER_SECS for request timeout */ - u16_t t1_timeout; /* #ticks with period DHCP_COARSE_TIMER_SECS for renewal time */ - u16_t t2_timeout; /* #ticks with period DHCP_COARSE_TIMER_SECS for rebind time */ - u16_t t1_renew_time; /* #ticks with period DHCP_COARSE_TIMER_SECS until next renew try */ - u16_t t2_rebind_time; /* #ticks with period DHCP_COARSE_TIMER_SECS until next rebind try */ - u16_t lease_used; /* #ticks with period DHCP_COARSE_TIMER_SECS since last received DHCP ack */ - u16_t t0_timeout; /* #ticks with period DHCP_COARSE_TIMER_SECS for lease time */ - ip_addr_t server_ip_addr; /* dhcp server address that offered this lease (ip_addr_t because passed to UDP) */ - ip4_addr_t offered_ip_addr; - ip4_addr_t offered_sn_mask; - ip4_addr_t offered_gw_addr; - - u32_t offered_t0_lease; /* lease period (in seconds) */ - u32_t offered_t1_renew; /* recommended renew time (usually 50% of lease period) */ - u32_t offered_t2_rebind; /* recommended rebind time (usually 87.5 of lease period) */ -#if LWIP_DHCP_BOOTP_FILE - ip4_addr_t offered_si_addr; - char boot_file_name[DHCP_BOOT_FILE_LEN]; -#endif /* LWIP_DHCP_BOOTPFILE */ - - /* Espressif add start. */ -#ifdef ESP_DHCP - void (*cb)(struct netif*); /* callback for dhcp, add a parameter to show dhcp status if needed */ -#else - void (*cb)(void); /* callback for dhcp, add a parameter to show dhcp status if needed */ -#endif - /* Espressif add end. */ -}; - - -void dhcp_set_struct(struct netif *netif, struct dhcp *dhcp); -/** Remove a struct dhcp previously set to the netif using dhcp_set_struct() */ -#define dhcp_remove_struct(netif) netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_DHCP, NULL) -void dhcp_cleanup(struct netif *netif); -err_t dhcp_start(struct netif *netif); -err_t dhcp_renew(struct netif *netif); -err_t dhcp_release(struct netif *netif); -void dhcp_stop(struct netif *netif); -void dhcp_inform(struct netif *netif); -void dhcp_network_changed(struct netif *netif); - -/* Espressif add start. */ -/** set callback for DHCP */ -#ifdef ESP_DHCP -void dhcp_set_cb(struct netif *netif, void (*cb)(struct netif*)); -#else -void dhcp_set_cb(struct netif *netif, void (*cb)(void)); -#endif -/* Espressif add end. */ - -#if DHCP_DOES_ARP_CHECK -void dhcp_arp_reply(struct netif *netif, const ip4_addr_t *addr); -#endif -u8_t dhcp_supplied_address(const struct netif *netif); -/* to be called every minute */ -void dhcp_coarse_tmr(void); -/* to be called every half second */ -void dhcp_fine_tmr(void); - -#if LWIP_DHCP_GET_NTP_SRV -/** This function must exist, in other to add offered NTP servers to - * the NTP (or SNTP) engine. - * See LWIP_DHCP_MAX_NTP_SERVERS */ -extern void dhcp_set_ntp_servers(u8_t num_ntp_servers, const ip4_addr_t* ntp_server_addrs); -#endif /* LWIP_DHCP_GET_NTP_SRV */ - -#define netif_dhcp_data(netif) ((struct dhcp*)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_DHCP)) - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_DHCP */ - -#endif /*LWIP_HDR_DHCP_H*/ diff --git a/tools/sdk/include/lwip/lwip/dhcp6.h b/tools/sdk/include/lwip/lwip/dhcp6.h deleted file mode 100644 index 455336d37dc..00000000000 --- a/tools/sdk/include/lwip/lwip/dhcp6.h +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @file - * - * IPv6 address autoconfiguration as per RFC 4862. - */ - -/* - * Copyright (c) 2010 Inico Technologies Ltd. - * All rights reserved. - * - * 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: Ivan Delamer - * - * IPv6 address autoconfiguration as per RFC 4862. - * - * Please coordinate changes and requests with Ivan Delamer - * - */ - -#ifndef LWIP_HDR_IP6_DHCP6_H -#define LWIP_HDR_IP6_DHCP6_H - -#include "lwip/opt.h" - -#if LWIP_IPV6_DHCP6 /* don't build if not configured for use in lwipopts.h */ - - -struct dhcp6 -{ - /*@todo: implement DHCP6*/ -}; - -#endif /* LWIP_IPV6_DHCP6 */ - -#endif /* LWIP_HDR_IP6_DHCP6_H */ diff --git a/tools/sdk/include/lwip/lwip/dns.h b/tools/sdk/include/lwip/lwip/dns.h deleted file mode 100644 index 38ea6367e1c..00000000000 --- a/tools/sdk/include/lwip/lwip/dns.h +++ /dev/null @@ -1,138 +0,0 @@ -/** - * @file - * DNS API - */ - -/** - * lwip DNS resolver header file. - - * Author: Jim Pettinato - * April 2007 - - * ported from uIP resolv.c Copyright (c) 2002-2003, Adam Dunkels. - * - * 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. - */ - -#ifndef LWIP_HDR_DNS_H -#define LWIP_HDR_DNS_H - -#include "lwip/opt.h" - -#if LWIP_DNS - -#include "lwip/ip_addr.h" -#include "lwip/err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** DNS timer period */ -#define DNS_TMR_INTERVAL 1000 - -/* DNS resolve types: */ -#define LWIP_DNS_ADDRTYPE_IPV4 0 -#define LWIP_DNS_ADDRTYPE_IPV6 1 -#define LWIP_DNS_ADDRTYPE_IPV4_IPV6 2 /* try to resolve IPv4 first, try IPv6 if IPv4 fails only */ -#define LWIP_DNS_ADDRTYPE_IPV6_IPV4 3 /* try to resolve IPv6 first, try IPv4 if IPv6 fails only */ -#if LWIP_IPV4 && LWIP_IPV6 -#ifndef LWIP_DNS_ADDRTYPE_DEFAULT -#define LWIP_DNS_ADDRTYPE_DEFAULT LWIP_DNS_ADDRTYPE_IPV4_IPV6 -#endif -#elif LWIP_IPV4 -#define LWIP_DNS_ADDRTYPE_DEFAULT LWIP_DNS_ADDRTYPE_IPV4 -#else -#define LWIP_DNS_ADDRTYPE_DEFAULT LWIP_DNS_ADDRTYPE_IPV6 -#endif - -#if DNS_LOCAL_HOSTLIST -/** struct used for local host-list */ -struct local_hostlist_entry { - /** static hostname */ - const char *name; - /** static host address in network byteorder */ - ip_addr_t addr; - struct local_hostlist_entry *next; -}; -#define DNS_LOCAL_HOSTLIST_ELEM(name, addr_init) {name, addr_init, NULL} -#if DNS_LOCAL_HOSTLIST_IS_DYNAMIC -#ifndef DNS_LOCAL_HOSTLIST_MAX_NAMELEN -#define DNS_LOCAL_HOSTLIST_MAX_NAMELEN DNS_MAX_NAME_LENGTH -#endif -#define LOCALHOSTLIST_ELEM_SIZE ((sizeof(struct local_hostlist_entry) + DNS_LOCAL_HOSTLIST_MAX_NAMELEN + 1)) -#endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ -#endif /* DNS_LOCAL_HOSTLIST */ - -#if LWIP_IPV4 -extern const ip_addr_t dns_mquery_v4group; -#endif /* LWIP_IPV4 */ -#if LWIP_IPV6 -extern const ip_addr_t dns_mquery_v6group; -#endif /* LWIP_IPV6 */ - -/** Callback which is invoked when a hostname is found. - * A function of this type must be implemented by the application using the DNS resolver. - * @param name pointer to the name that was looked up. - * @param ipaddr pointer to an ip_addr_t containing the IP address of the hostname, - * or NULL if the name could not be found (or on any other error). - * @param callback_arg a user-specified callback argument passed to dns_gethostbyname -*/ -typedef void (*dns_found_callback)(const char *name, const ip_addr_t *ipaddr, void *callback_arg); - -void dns_init(void); -void dns_tmr(void); -void dns_setserver(u8_t numdns, const ip_addr_t *dnsserver); -#if ESP_DNS -ip_addr_t dns_getserver(u8_t numdns); -#else -const ip_addr_t* dns_getserver(u8_t numdns); -#endif -err_t dns_gethostbyname(const char *hostname, ip_addr_t *addr, - dns_found_callback found, void *callback_arg); -err_t dns_gethostbyname_addrtype(const char *hostname, ip_addr_t *addr, - dns_found_callback found, void *callback_arg, - u8_t dns_addrtype); -#if ESP_DNS -void dns_clear_servers(bool keep_fallback); -#endif - - -#if DNS_LOCAL_HOSTLIST -size_t dns_local_iterate(dns_found_callback iterator_fn, void *iterator_arg); -err_t dns_local_lookup(const char *hostname, ip_addr_t *addr, u8_t dns_addrtype); -#if DNS_LOCAL_HOSTLIST_IS_DYNAMIC -int dns_local_removehost(const char *hostname, const ip_addr_t *addr); -err_t dns_local_addhost(const char *hostname, const ip_addr_t *addr); -#endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ -#endif /* DNS_LOCAL_HOSTLIST */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_DNS */ - -#endif /* LWIP_HDR_DNS_H */ diff --git a/tools/sdk/include/lwip/lwip/err.h b/tools/sdk/include/lwip/lwip/err.h deleted file mode 100644 index 84e528d1ed8..00000000000 --- a/tools/sdk/include/lwip/lwip/err.h +++ /dev/null @@ -1,119 +0,0 @@ -/** - * @file - * lwIP Error codes - */ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_ERR_H -#define LWIP_HDR_ERR_H - -#include "lwip/opt.h" -#include "lwip/arch.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup infrastructure_errors Error codes - * @ingroup infrastructure - * @{ - */ - -/** Define LWIP_ERR_T in cc.h if you want to use - * a different type for your platform (must be signed). */ -#ifdef LWIP_ERR_T -typedef LWIP_ERR_T err_t; -#else /* LWIP_ERR_T */ -typedef s8_t err_t; -#endif /* LWIP_ERR_T*/ - -/** Definitions for error constants. */ -typedef enum { -/** No error, everything OK. */ - ERR_OK = 0, -/** Out of memory error. */ - ERR_MEM = -1, -/** Buffer error. */ - ERR_BUF = -2, -/** Timeout. */ - ERR_TIMEOUT = -3, -/** Routing problem. */ - ERR_RTE = -4, -/** Operation in progress */ - ERR_INPROGRESS = -5, -/** Illegal value. */ - ERR_VAL = -6, -/** Operation would block. */ - ERR_WOULDBLOCK = -7, -/** Address in use. */ - ERR_USE = -8, -/** Already connecting. */ - ERR_ALREADY = -9, -/** Conn already established.*/ - ERR_ISCONN = -10, -/** Not connected. */ - ERR_CONN = -11, -/** Low-level netif error */ - ERR_IF = -12, - -/** Connection aborted. */ - ERR_ABRT = -13, -/** Connection reset. */ - ERR_RST = -14, -/** Connection closed. */ - ERR_CLSD = -15, -/** Illegal argument. */ - ERR_ARG = -16 -} err_enum_t; - -#define ERR_IS_FATAL(e) ((e) <= ERR_ABRT) - -/** - * @} - */ - -#ifdef LWIP_DEBUG -extern const char *lwip_strerr(err_t err); -#else -#define lwip_strerr(x) "" -#endif /* LWIP_DEBUG */ - -#if !NO_SYS -int err_to_errno(err_t err); -#endif /* !NO_SYS */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_ERR_H */ diff --git a/tools/sdk/include/lwip/lwip/errno.h b/tools/sdk/include/lwip/lwip/errno.h deleted file mode 100644 index 641cffb09cc..00000000000 --- a/tools/sdk/include/lwip/lwip/errno.h +++ /dev/null @@ -1,193 +0,0 @@ -/** - * @file - * Posix Errno defines - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_ERRNO_H -#define LWIP_HDR_ERRNO_H - -#include "lwip/opt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef LWIP_PROVIDE_ERRNO - -#define EPERM 1 /* Operation not permitted */ -#define ENOENT 2 /* No such file or directory */ -#define ESRCH 3 /* No such process */ -#define EINTR 4 /* Interrupted system call */ -#define EIO 5 /* I/O error */ -#define ENXIO 6 /* No such device or address */ -#define E2BIG 7 /* Arg list too long */ -#define ENOEXEC 8 /* Exec format error */ -#define EBADF 9 /* Bad file number */ -#define ECHILD 10 /* No child processes */ -#define EAGAIN 11 /* Try again */ -#define ENOMEM 12 /* Out of memory */ -#define EACCES 13 /* Permission denied */ -#define EFAULT 14 /* Bad address */ -#define ENOTBLK 15 /* Block device required */ -#define EBUSY 16 /* Device or resource busy */ -#define EEXIST 17 /* File exists */ -#define EXDEV 18 /* Cross-device link */ -#define ENODEV 19 /* No such device */ -#define ENOTDIR 20 /* Not a directory */ -#define EISDIR 21 /* Is a directory */ -#define EINVAL 22 /* Invalid argument */ -#define ENFILE 23 /* File table overflow */ -#define EMFILE 24 /* Too many open files */ -#define ENOTTY 25 /* Not a typewriter */ -#define ETXTBSY 26 /* Text file busy */ -#define EFBIG 27 /* File too large */ -#define ENOSPC 28 /* No space left on device */ -#define ESPIPE 29 /* Illegal seek */ -#define EROFS 30 /* Read-only file system */ -#define EMLINK 31 /* Too many links */ -#define EPIPE 32 /* Broken pipe */ -#define EDOM 33 /* Math argument out of domain of func */ -#define ERANGE 34 /* Math result not representable */ -#define EDEADLK 35 /* Resource deadlock would occur */ -#define ENAMETOOLONG 36 /* File name too long */ -#define ENOLCK 37 /* No record locks available */ -#define ENOSYS 38 /* Function not implemented */ -#define ENOTEMPTY 39 /* Directory not empty */ -#define ELOOP 40 /* Too many symbolic links encountered */ -#define EWOULDBLOCK EAGAIN /* Operation would block */ -#define ENOMSG 42 /* No message of desired type */ -#define EIDRM 43 /* Identifier removed */ -#define ECHRNG 44 /* Channel number out of range */ -#define EL2NSYNC 45 /* Level 2 not synchronized */ -#define EL3HLT 46 /* Level 3 halted */ -#define EL3RST 47 /* Level 3 reset */ -#define ELNRNG 48 /* Link number out of range */ -#define EUNATCH 49 /* Protocol driver not attached */ -#define ENOCSI 50 /* No CSI structure available */ -#define EL2HLT 51 /* Level 2 halted */ -#define EBADE 52 /* Invalid exchange */ -#define EBADR 53 /* Invalid request descriptor */ -#define EXFULL 54 /* Exchange full */ -#define ENOANO 55 /* No anode */ -#define EBADRQC 56 /* Invalid request code */ -#define EBADSLT 57 /* Invalid slot */ - -#define EDEADLOCK EDEADLK - -#define EBFONT 59 /* Bad font file format */ -#define ENOSTR 60 /* Device not a stream */ -#define ENODATA 61 /* No data available */ -#define ETIME 62 /* Timer expired */ -#define ENOSR 63 /* Out of streams resources */ -#define ENONET 64 /* Machine is not on the network */ -#define ENOPKG 65 /* Package not installed */ -#define EREMOTE 66 /* Object is remote */ -#define ENOLINK 67 /* Link has been severed */ -#define EADV 68 /* Advertise error */ -#define ESRMNT 69 /* Srmount error */ -#define ECOMM 70 /* Communication error on send */ -#define EPROTO 71 /* Protocol error */ -#define EMULTIHOP 72 /* Multihop attempted */ -#define EDOTDOT 73 /* RFS specific error */ -#define EBADMSG 74 /* Not a data message */ -#define EOVERFLOW 75 /* Value too large for defined data type */ -#define ENOTUNIQ 76 /* Name not unique on network */ -#define EBADFD 77 /* File descriptor in bad state */ -#define EREMCHG 78 /* Remote address changed */ -#define ELIBACC 79 /* Can not access a needed shared library */ -#define ELIBBAD 80 /* Accessing a corrupted shared library */ -#define ELIBSCN 81 /* .lib section in a.out corrupted */ -#define ELIBMAX 82 /* Attempting to link in too many shared libraries */ -#define ELIBEXEC 83 /* Cannot exec a shared library directly */ -#define EILSEQ 84 /* Illegal byte sequence */ -#define ERESTART 85 /* Interrupted system call should be restarted */ -#define ESTRPIPE 86 /* Streams pipe error */ -#define EUSERS 87 /* Too many users */ -#define ENOTSOCK 88 /* Socket operation on non-socket */ -#define EDESTADDRREQ 89 /* Destination address required */ -#define EMSGSIZE 90 /* Message too long */ -#define EPROTOTYPE 91 /* Protocol wrong type for socket */ -#define ENOPROTOOPT 92 /* Protocol not available */ -#define EPROTONOSUPPORT 93 /* Protocol not supported */ -#define ESOCKTNOSUPPORT 94 /* Socket type not supported */ -#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ -#define EPFNOSUPPORT 96 /* Protocol family not supported */ -#define EAFNOSUPPORT 97 /* Address family not supported by protocol */ -#define EADDRINUSE 98 /* Address already in use */ -#define EADDRNOTAVAIL 99 /* Cannot assign requested address */ -#define ENETDOWN 100 /* Network is down */ -#define ENETUNREACH 101 /* Network is unreachable */ -#define ENETRESET 102 /* Network dropped connection because of reset */ -#define ECONNABORTED 103 /* Software caused connection abort */ -#define ECONNRESET 104 /* Connection reset by peer */ -#define ENOBUFS 105 /* No buffer space available */ -#define EISCONN 106 /* Transport endpoint is already connected */ -#define ENOTCONN 107 /* Transport endpoint is not connected */ -#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ -#define ETOOMANYREFS 109 /* Too many references: cannot splice */ -#define ETIMEDOUT 110 /* Connection timed out */ -#define ECONNREFUSED 111 /* Connection refused */ -#define EHOSTDOWN 112 /* Host is down */ -#define EHOSTUNREACH 113 /* No route to host */ -#define EALREADY 114 /* Operation already in progress */ -#define EINPROGRESS 115 /* Operation now in progress */ -#define ESTALE 116 /* Stale NFS file handle */ -#define EUCLEAN 117 /* Structure needs cleaning */ -#define ENOTNAM 118 /* Not a XENIX named type file */ -#define ENAVAIL 119 /* No XENIX semaphores available */ -#define EISNAM 120 /* Is a named type file */ -#define EREMOTEIO 121 /* Remote I/O error */ -#define EDQUOT 122 /* Quota exceeded */ - -#define ENOMEDIUM 123 /* No medium found */ -#define EMEDIUMTYPE 124 /* Wrong medium type */ - -#ifndef errno -extern int errno; -#endif - -#else /* LWIP_PROVIDE_ERRNO */ - -/* Define LWIP_ERRNO_INCLUDE to to include the error defines here */ -#ifdef LWIP_ERRNO_INCLUDE -#include LWIP_ERRNO_INCLUDE -#endif /* LWIP_ERRNO_INCLUDE */ - -#endif /* LWIP_PROVIDE_ERRNO */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_ERRNO_H */ diff --git a/tools/sdk/include/lwip/lwip/etharp.h b/tools/sdk/include/lwip/lwip/etharp.h deleted file mode 100644 index 0662f07241e..00000000000 --- a/tools/sdk/include/lwip/lwip/etharp.h +++ /dev/null @@ -1,116 +0,0 @@ -/** - * @file - * Ethernet output function - handles OUTGOING ethernet level traffic, implements - * ARP resolving. - * To be used in most low-level netif implementations - */ - -/* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * Copyright (c) 2003-2004 Leon Woestenberg - * Copyright (c) 2003-2004 Axon Digital Design B.V., The Netherlands. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ - -#ifndef LWIP_HDR_NETIF_ETHARP_H -#define LWIP_HDR_NETIF_ETHARP_H - -#include "lwip/opt.h" - -#if LWIP_ARP || LWIP_ETHERNET /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/pbuf.h" -#include "lwip/ip4_addr.h" -#include "lwip/netif.h" -#include "lwip/ip4.h" -#include "lwip/prot/ethernet.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if LWIP_IPV4 && LWIP_ARP /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/prot/etharp.h" - -/** 1 seconds period */ -#define ARP_TMR_INTERVAL 1000 - -#if ARP_QUEUEING -/** struct for queueing outgoing packets for unknown address - * defined here to be accessed by memp.h - */ -struct etharp_q_entry { - struct etharp_q_entry *next; - struct pbuf *p; -}; -#endif /* ARP_QUEUEING */ - -#if ESP_GRATUITOUS_ARP -#ifdef CONFIG_GARP_TMR_INTERVAL -#define GARP_TMR_INTERVAL (CONFIG_GARP_TMR_INTERVAL*1000UL) -#else -#define GARP_TMR_INTERVAL 60000 -#endif - -void garp_tmr(void); -#endif - -#define etharp_init() /* Compatibility define, no init needed. */ -void etharp_tmr(void); -s8_t etharp_find_addr(struct netif *netif, const ip4_addr_t *ipaddr, - struct eth_addr **eth_ret, const ip4_addr_t **ip_ret); -u8_t etharp_get_entry(u8_t i, ip4_addr_t **ipaddr, struct netif **netif, struct eth_addr **eth_ret); -err_t etharp_output(struct netif *netif, struct pbuf *q, const ip4_addr_t *ipaddr); -err_t etharp_query(struct netif *netif, const ip4_addr_t *ipaddr, struct pbuf *q); -err_t etharp_request(struct netif *netif, const ip4_addr_t *ipaddr); -/** For Ethernet network interfaces, we might want to send "gratuitous ARP"; - * this is an ARP packet sent by a node in order to spontaneously cause other - * nodes to update an entry in their ARP cache. - * From RFC 3220 "IP Mobility Support for IPv4" section 4.6. */ -#define etharp_gratuitous(netif) etharp_request((netif), netif_ip4_addr(netif)) -void etharp_cleanup_netif(struct netif *netif); - -#if ETHARP_SUPPORT_STATIC_ENTRIES -err_t etharp_add_static_entry(const ip4_addr_t *ipaddr, struct eth_addr *ethaddr); -err_t etharp_remove_static_entry(const ip4_addr_t *ipaddr); -#endif /* ETHARP_SUPPORT_STATIC_ENTRIES */ - -#endif /* LWIP_IPV4 && LWIP_ARP */ - -void etharp_input(struct pbuf *p, struct netif *netif); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_ARP || LWIP_ETHERNET */ - -#endif /* LWIP_HDR_NETIF_ETHARP_H */ diff --git a/tools/sdk/include/lwip/lwip/ethip6.h b/tools/sdk/include/lwip/lwip/ethip6.h deleted file mode 100644 index 5e88dffd05f..00000000000 --- a/tools/sdk/include/lwip/lwip/ethip6.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - * @file - * - * Ethernet output for IPv6. Uses ND tables for link-layer addressing. - */ - -/* - * Copyright (c) 2010 Inico Technologies Ltd. - * All rights reserved. - * - * 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: Ivan Delamer - * - * - * Please coordinate changes and requests with Ivan Delamer - * - */ - -#ifndef LWIP_HDR_ETHIP6_H -#define LWIP_HDR_ETHIP6_H - -#include "lwip/opt.h" - -#if LWIP_IPV6 && LWIP_ETHERNET /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/pbuf.h" -#include "lwip/ip6.h" -#include "lwip/ip6_addr.h" -#include "lwip/netif.h" - - -#ifdef __cplusplus -extern "C" { -#endif - - -err_t ethip6_output(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_IPV6 && LWIP_ETHERNET */ - -#endif /* LWIP_HDR_ETHIP6_H */ diff --git a/tools/sdk/include/lwip/lwip/icmp.h b/tools/sdk/include/lwip/lwip/icmp.h deleted file mode 100644 index f5a31fd4c07..00000000000 --- a/tools/sdk/include/lwip/lwip/icmp.h +++ /dev/null @@ -1,110 +0,0 @@ -/** - * @file - * ICMP API - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_ICMP_H -#define LWIP_HDR_ICMP_H - -#include "lwip/opt.h" -#include "lwip/pbuf.h" -#include "lwip/ip_addr.h" -#include "lwip/netif.h" -#include "lwip/prot/icmp.h" - -#if LWIP_IPV6 && LWIP_ICMP6 -#include "lwip/icmp6.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** ICMP destination unreachable codes */ -enum icmp_dur_type { - /** net unreachable */ - ICMP_DUR_NET = 0, - /** host unreachable */ - ICMP_DUR_HOST = 1, - /** protocol unreachable */ - ICMP_DUR_PROTO = 2, - /** port unreachable */ - ICMP_DUR_PORT = 3, - /** fragmentation needed and DF set */ - ICMP_DUR_FRAG = 4, - /** source route failed */ - ICMP_DUR_SR = 5 -}; - -/** ICMP time exceeded codes */ -enum icmp_te_type { - /** time to live exceeded in transit */ - ICMP_TE_TTL = 0, - /** fragment reassembly time exceeded */ - ICMP_TE_FRAG = 1 -}; - -#if LWIP_IPV4 && LWIP_ICMP /* don't build if not configured for use in lwipopts.h */ - -void icmp_input(struct pbuf *p, struct netif *inp); -void icmp_dest_unreach(struct pbuf *p, enum icmp_dur_type t); -void icmp_time_exceeded(struct pbuf *p, enum icmp_te_type t); - -#endif /* LWIP_IPV4 && LWIP_ICMP */ - -#if LWIP_IPV4 && LWIP_IPV6 -#if LWIP_ICMP && LWIP_ICMP6 -#define icmp_port_unreach(isipv6, pbuf) ((isipv6) ? \ - icmp6_dest_unreach(pbuf, ICMP6_DUR_PORT) : \ - icmp_dest_unreach(pbuf, ICMP_DUR_PORT)) -#elif LWIP_ICMP -#define icmp_port_unreach(isipv6, pbuf) do{ if(!(isipv6)) { icmp_dest_unreach(pbuf, ICMP_DUR_PORT);}}while(0) -#elif LWIP_ICMP6 -#define icmp_port_unreach(isipv6, pbuf) do{ if(isipv6) { icmp6_dest_unreach(pbuf, ICMP6_DUR_PORT);}}while(0) -#else -#define icmp_port_unreach(isipv6, pbuf) -#endif -#elif LWIP_IPV6 && LWIP_ICMP6 -#define icmp_port_unreach(isipv6, pbuf) icmp6_dest_unreach(pbuf, ICMP6_DUR_PORT) -#elif LWIP_IPV4 && LWIP_ICMP -#define icmp_port_unreach(isipv6, pbuf) icmp_dest_unreach(pbuf, ICMP_DUR_PORT) -#else /* (LWIP_IPV6 && LWIP_ICMP6) || (LWIP_IPV4 && LWIP_ICMP) */ -#define icmp_port_unreach(isipv6, pbuf) -#endif /* (LWIP_IPV6 && LWIP_ICMP6) || (LWIP_IPV4 && LWIP_ICMP) LWIP_IPV4*/ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_ICMP_H */ diff --git a/tools/sdk/include/lwip/lwip/icmp6.h b/tools/sdk/include/lwip/lwip/icmp6.h deleted file mode 100644 index a29dc8c1c23..00000000000 --- a/tools/sdk/include/lwip/lwip/icmp6.h +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @file - * - * IPv6 version of ICMP, as per RFC 4443. - */ - -/* - * Copyright (c) 2010 Inico Technologies Ltd. - * All rights reserved. - * - * 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: Ivan Delamer - * - * - * Please coordinate changes and requests with Ivan Delamer - * - */ -#ifndef LWIP_HDR_ICMP6_H -#define LWIP_HDR_ICMP6_H - -#include "lwip/opt.h" -#include "lwip/pbuf.h" -#include "lwip/ip6_addr.h" -#include "lwip/netif.h" -#include "lwip/prot/icmp6.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if LWIP_ICMP6 && LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */ - -void icmp6_input(struct pbuf *p, struct netif *inp); -void icmp6_dest_unreach(struct pbuf *p, enum icmp6_dur_code c); -void icmp6_packet_too_big(struct pbuf *p, u32_t mtu); -void icmp6_time_exceeded(struct pbuf *p, enum icmp6_te_code c); -void icmp6_param_problem(struct pbuf *p, enum icmp6_pp_code c, u32_t pointer); - -#endif /* LWIP_ICMP6 && LWIP_IPV6 */ - - -#ifdef __cplusplus -} -#endif - - -#endif /* LWIP_HDR_ICMP6_H */ diff --git a/tools/sdk/include/lwip/lwip/igmp.h b/tools/sdk/include/lwip/lwip/igmp.h deleted file mode 100644 index ffd80e680c3..00000000000 --- a/tools/sdk/include/lwip/lwip/igmp.h +++ /dev/null @@ -1,115 +0,0 @@ -/** - * @file - * IGMP API - */ - -/* - * Copyright (c) 2002 CITEL Technologies Ltd. - * All rights reserved. - * - * 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. Neither the name of CITEL Technologies Ltd 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 CITEL TECHNOLOGIES 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 CITEL TECHNOLOGIES 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. - * - * This file is a contribution to the lwIP TCP/IP stack. - * The Swedish Institute of Computer Science and Adam Dunkels - * are specifically granted permission to redistribute this - * source code. -*/ - -#ifndef LWIP_HDR_IGMP_H -#define LWIP_HDR_IGMP_H - -#include "lwip/opt.h" -#include "lwip/ip_addr.h" -#include "lwip/netif.h" -#include "lwip/pbuf.h" - -#if LWIP_IPV4 && LWIP_IGMP /* don't build if not configured for use in lwipopts.h */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* IGMP timer */ -#define IGMP_TMR_INTERVAL 100 /* Milliseconds */ -#define IGMP_V1_DELAYING_MEMBER_TMR (1000/IGMP_TMR_INTERVAL) -#define IGMP_JOIN_DELAYING_MEMBER_TMR (500 /IGMP_TMR_INTERVAL) - -/* Compatibility defines (don't use for new code) */ -#define IGMP_DEL_MAC_FILTER NETIF_DEL_MAC_FILTER -#define IGMP_ADD_MAC_FILTER NETIF_ADD_MAC_FILTER - -/** - * igmp group structure - there is - * a list of groups for each interface - * these should really be linked from the interface, but - * if we keep them separate we will not affect the lwip original code - * too much - * - * There will be a group for the all systems group address but this - * will not run the state machine as it is used to kick off reports - * from all the other groups - */ -struct igmp_group { - /** next link */ - struct igmp_group *next; - /** multicast address */ - ip4_addr_t group_address; - /** signifies we were the last person to report */ - u8_t last_reporter_flag; - /** current state of the group */ - u8_t group_state; - /** timer for reporting, negative is OFF */ - u16_t timer; - /** counter of simultaneous uses */ - u8_t use; -}; - -/* Prototypes */ -void igmp_init(void); -err_t igmp_start(struct netif *netif); -err_t igmp_stop(struct netif *netif); -void igmp_report_groups(struct netif *netif); -struct igmp_group *igmp_lookfor_group(struct netif *ifp, const ip4_addr_t *addr); -void igmp_input(struct pbuf *p, struct netif *inp, const ip4_addr_t *dest); -err_t igmp_joingroup(const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr); -err_t igmp_joingroup_netif(struct netif *netif, const ip4_addr_t *groupaddr); -err_t igmp_leavegroup(const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr); -err_t igmp_leavegroup_netif(struct netif *netif, const ip4_addr_t *groupaddr); -void igmp_tmr(void); - -/** @ingroup igmp - * Get list head of IGMP groups for netif. - * Note: The allsystems group IP is contained in the list as first entry. - * @see @ref netif_set_igmp_mac_filter() - */ -#define netif_igmp_data(netif) ((struct igmp_group *)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_IGMP)) - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_IPV4 && LWIP_IGMP */ - -#endif /* LWIP_HDR_IGMP_H */ diff --git a/tools/sdk/include/lwip/lwip/inet.h b/tools/sdk/include/lwip/lwip/inet.h deleted file mode 100644 index 4a34f026533..00000000000 --- a/tools/sdk/include/lwip/lwip/inet.h +++ /dev/null @@ -1,172 +0,0 @@ -/** - * @file - * This file (together with sockets.h) aims to provide structs and functions from - * - arpa/inet.h - * - netinet/in.h - * - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_INET_H -#define LWIP_HDR_INET_H - -#include "lwip/opt.h" -#include "lwip/def.h" -#include "lwip/ip_addr.h" -#include "lwip/ip6_addr.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* If your port already typedef's in_addr_t, define IN_ADDR_T_DEFINED - to prevent this code from redefining it. */ -#if !defined(in_addr_t) && !defined(IN_ADDR_T_DEFINED) -typedef u32_t in_addr_t; -#endif - -struct in_addr { - in_addr_t s_addr; -}; - -struct in6_addr { - union { - u32_t u32_addr[4]; - u8_t u8_addr[16]; - } un; -#define s6_addr un.u8_addr -}; - -/** 255.255.255.255 */ -#define INADDR_NONE IPADDR_NONE -/** 127.0.0.1 */ -#define INADDR_LOOPBACK IPADDR_LOOPBACK -/** 0.0.0.0 */ -#define INADDR_ANY IPADDR_ANY -/** 255.255.255.255 */ -#define INADDR_BROADCAST IPADDR_BROADCAST - -/** This macro can be used to initialize a variable of type struct in6_addr - to the IPv6 wildcard address. */ -#define IN6ADDR_ANY_INIT {{{0,0,0,0}}} -/** This macro can be used to initialize a variable of type struct in6_addr - to the IPv6 loopback address. */ -#define IN6ADDR_LOOPBACK_INIT {{{0,0,0,PP_HTONL(1)}}} -/** This variable is initialized by the system to contain the wildcard IPv6 address. */ -extern const struct in6_addr in6addr_any; - -/* Definitions of the bits in an (IPv4) Internet address integer. - - On subnets, host and network parts are found according to - the subnet mask, not these masks. */ -#define IN_CLASSA(a) IP_CLASSA(a) -#define IN_CLASSA_NET IP_CLASSA_NET -#define IN_CLASSA_NSHIFT IP_CLASSA_NSHIFT -#define IN_CLASSA_HOST IP_CLASSA_HOST -#define IN_CLASSA_MAX IP_CLASSA_MAX - -#define IN_CLASSB(b) IP_CLASSB(b) -#define IN_CLASSB_NET IP_CLASSB_NET -#define IN_CLASSB_NSHIFT IP_CLASSB_NSHIFT -#define IN_CLASSB_HOST IP_CLASSB_HOST -#define IN_CLASSB_MAX IP_CLASSB_MAX - -#define IN_CLASSC(c) IP_CLASSC(c) -#define IN_CLASSC_NET IP_CLASSC_NET -#define IN_CLASSC_NSHIFT IP_CLASSC_NSHIFT -#define IN_CLASSC_HOST IP_CLASSC_HOST -#define IN_CLASSC_MAX IP_CLASSC_MAX - -#define IN_CLASSD(d) IP_CLASSD(d) -#define IN_CLASSD_NET IP_CLASSD_NET /* These ones aren't really */ -#define IN_CLASSD_NSHIFT IP_CLASSD_NSHIFT /* net and host fields, but */ -#define IN_CLASSD_HOST IP_CLASSD_HOST /* routing needn't know. */ -#define IN_CLASSD_MAX IP_CLASSD_MAX - -#define IN_MULTICAST(a) IP_MULTICAST(a) - -#define IN_EXPERIMENTAL(a) IP_EXPERIMENTAL(a) -#define IN_BADCLASS(a) IP_BADCLASS(a) - -#define IN_LOOPBACKNET IP_LOOPBACKNET - - -#ifndef INET_ADDRSTRLEN -#define INET_ADDRSTRLEN IP4ADDR_STRLEN_MAX -#endif -#if LWIP_IPV6 -#ifndef INET6_ADDRSTRLEN -#define INET6_ADDRSTRLEN IP6ADDR_STRLEN_MAX -#endif -#endif - -#if LWIP_IPV4 - -#define inet_addr_from_ip4addr(target_inaddr, source_ipaddr) ((target_inaddr)->s_addr = ip4_addr_get_u32(source_ipaddr)) -#define inet_addr_to_ip4addr(target_ipaddr, source_inaddr) (ip4_addr_set_u32(target_ipaddr, (source_inaddr)->s_addr)) -/* ATTENTION: the next define only works because both s_addr and ip4_addr_t are an u32_t effectively! */ -#define inet_addr_to_ip4addr_p(target_ip4addr_p, source_inaddr) ((target_ip4addr_p) = (ip4_addr_t*)&((source_inaddr)->s_addr)) - -/* directly map this to the lwip internal functions */ -#define inet_addr(cp) ipaddr_addr(cp) -#define inet_aton(cp, addr) ip4addr_aton(cp, (ip4_addr_t*)addr) -#define inet_ntoa(addr) ip4addr_ntoa((const ip4_addr_t*)&(addr)) -#define inet_ntoa_r(addr, buf, buflen) ip4addr_ntoa_r((const ip4_addr_t*)&(addr), buf, buflen) - -#endif /* LWIP_IPV4 */ - -#if LWIP_IPV6 -#define inet6_addr_from_ip6addr(target_in6addr, source_ip6addr) {(target_in6addr)->un.u32_addr[0] = (source_ip6addr)->addr[0]; \ - (target_in6addr)->un.u32_addr[1] = (source_ip6addr)->addr[1]; \ - (target_in6addr)->un.u32_addr[2] = (source_ip6addr)->addr[2]; \ - (target_in6addr)->un.u32_addr[3] = (source_ip6addr)->addr[3];} -#define inet6_addr_to_ip6addr(target_ip6addr, source_in6addr) {(target_ip6addr)->addr[0] = (source_in6addr)->un.u32_addr[0]; \ - (target_ip6addr)->addr[1] = (source_in6addr)->un.u32_addr[1]; \ - (target_ip6addr)->addr[2] = (source_in6addr)->un.u32_addr[2]; \ - (target_ip6addr)->addr[3] = (source_in6addr)->un.u32_addr[3];} -/* ATTENTION: the next define only works because both in6_addr and ip6_addr_t are an u32_t[4] effectively! */ -#define inet6_addr_to_ip6addr_p(target_ip6addr_p, source_in6addr) ((target_ip6addr_p) = (ip6_addr_t*)(source_in6addr)) - -/* directly map this to the lwip internal functions */ -#define inet6_aton(cp, addr) ip6addr_aton(cp, (ip6_addr_t*)addr) -#define inet6_ntoa(addr) ip6addr_ntoa((const ip6_addr_t*)&(addr)) -#define inet6_ntoa_r(addr, buf, buflen) ip6addr_ntoa_r((const ip6_addr_t*)&(addr), buf, buflen) - -#endif /* LWIP_IPV6 */ - - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_INET_H */ diff --git a/tools/sdk/include/lwip/lwip/inet_chksum.h b/tools/sdk/include/lwip/lwip/inet_chksum.h deleted file mode 100644 index 4e23d7f1944..00000000000 --- a/tools/sdk/include/lwip/lwip/inet_chksum.h +++ /dev/null @@ -1,105 +0,0 @@ -/** - * @file - * IP checksum calculation functions - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_INET_CHKSUM_H -#define LWIP_HDR_INET_CHKSUM_H - -#include "lwip/opt.h" - -#include "lwip/pbuf.h" -#include "lwip/ip_addr.h" - -/** Swap the bytes in an u16_t: much like lwip_htons() for little-endian */ -#ifndef SWAP_BYTES_IN_WORD -#define SWAP_BYTES_IN_WORD(w) (((w) & 0xff) << 8) | (((w) & 0xff00) >> 8) -#endif /* SWAP_BYTES_IN_WORD */ - -/** Split an u32_t in two u16_ts and add them up */ -#ifndef FOLD_U32T -#define FOLD_U32T(u) (((u) >> 16) + ((u) & 0x0000ffffUL)) -#endif - -#if LWIP_CHECKSUM_ON_COPY -/** Function-like macro: same as MEMCPY but returns the checksum of copied data - as u16_t */ -# ifndef LWIP_CHKSUM_COPY -# define LWIP_CHKSUM_COPY(dst, src, len) lwip_chksum_copy(dst, src, len) -# ifndef LWIP_CHKSUM_COPY_ALGORITHM -# define LWIP_CHKSUM_COPY_ALGORITHM 1 -# endif /* LWIP_CHKSUM_COPY_ALGORITHM */ -# else /* LWIP_CHKSUM_COPY */ -# define LWIP_CHKSUM_COPY_ALGORITHM 0 -# endif /* LWIP_CHKSUM_COPY */ -#else /* LWIP_CHECKSUM_ON_COPY */ -# define LWIP_CHKSUM_COPY_ALGORITHM 0 -#endif /* LWIP_CHECKSUM_ON_COPY */ - -#ifdef __cplusplus -extern "C" { -#endif - -u16_t inet_chksum(const void *dataptr, u16_t len); -u16_t inet_chksum_pbuf(struct pbuf *p); -#if LWIP_CHKSUM_COPY_ALGORITHM -u16_t lwip_chksum_copy(void *dst, const void *src, u16_t len); -#endif /* LWIP_CHKSUM_COPY_ALGORITHM */ - -#if LWIP_IPV4 -u16_t inet_chksum_pseudo(struct pbuf *p, u8_t proto, u16_t proto_len, - const ip4_addr_t *src, const ip4_addr_t *dest); -u16_t inet_chksum_pseudo_partial(struct pbuf *p, u8_t proto, - u16_t proto_len, u16_t chksum_len, const ip4_addr_t *src, const ip4_addr_t *dest); -#endif /* LWIP_IPV4 */ - -#if LWIP_IPV6 -u16_t ip6_chksum_pseudo(struct pbuf *p, u8_t proto, u16_t proto_len, - const ip6_addr_t *src, const ip6_addr_t *dest); -u16_t ip6_chksum_pseudo_partial(struct pbuf *p, u8_t proto, u16_t proto_len, - u16_t chksum_len, const ip6_addr_t *src, const ip6_addr_t *dest); -#endif /* LWIP_IPV6 */ - - -u16_t ip_chksum_pseudo(struct pbuf *p, u8_t proto, u16_t proto_len, - const ip_addr_t *src, const ip_addr_t *dest); -u16_t ip_chksum_pseudo_partial(struct pbuf *p, u8_t proto, u16_t proto_len, - u16_t chksum_len, const ip_addr_t *src, const ip_addr_t *dest); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_INET_H */ - diff --git a/tools/sdk/include/lwip/lwip/init.h b/tools/sdk/include/lwip/lwip/init.h deleted file mode 100644 index 3c234cb58de..00000000000 --- a/tools/sdk/include/lwip/lwip/init.h +++ /dev/null @@ -1,100 +0,0 @@ -/** - * @file - * lwIP initialization API - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_INIT_H -#define LWIP_HDR_INIT_H - -#include "lwip/opt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup lwip_version Version - * @ingroup lwip - * @{ - */ - -/** X.x.x: Major version of the stack */ -#define LWIP_VERSION_MAJOR 2 -/** x.X.x: Minor version of the stack */ -#define LWIP_VERSION_MINOR 0 -/** x.x.X: Revision of the stack */ -#define LWIP_VERSION_REVISION 3 -/** For release candidates, this is set to 1..254 - * For official releases, this is set to 255 (LWIP_RC_RELEASE) - * For development versions (Git), this is set to 0 (LWIP_RC_DEVELOPMENT) */ -#define LWIP_VERSION_RC LWIP_RC_RELEASE - -/** LWIP_VERSION_RC is set to LWIP_RC_RELEASE for official releases */ -#define LWIP_RC_RELEASE 255 -/** LWIP_VERSION_RC is set to LWIP_RC_DEVELOPMENT for Git versions */ -#define LWIP_RC_DEVELOPMENT 0 - -#define LWIP_VERSION_IS_RELEASE (LWIP_VERSION_RC == LWIP_RC_RELEASE) -#define LWIP_VERSION_IS_DEVELOPMENT (LWIP_VERSION_RC == LWIP_RC_DEVELOPMENT) -#define LWIP_VERSION_IS_RC ((LWIP_VERSION_RC != LWIP_RC_RELEASE) && (LWIP_VERSION_RC != LWIP_RC_DEVELOPMENT)) - -/* Some helper defines to get a version string */ -#define LWIP_VERSTR2(x) #x -#define LWIP_VERSTR(x) LWIP_VERSTR2(x) -#if LWIP_VERSION_IS_RELEASE -#define LWIP_VERSION_STRING_SUFFIX "" -#elif LWIP_VERSION_IS_DEVELOPMENT -#define LWIP_VERSION_STRING_SUFFIX "d" -#else -#define LWIP_VERSION_STRING_SUFFIX "rc" LWIP_VERSTR(LWIP_VERSION_RC) -#endif - -/** Provides the version of the stack */ -#define LWIP_VERSION (((u32_t)LWIP_VERSION_MAJOR) << 24 | ((u32_t)LWIP_VERSION_MINOR) << 16 | \ - ((u32_t)LWIP_VERSION_REVISION) << 8 | ((u32_t)LWIP_VERSION_RC)) -/** Provides the version of the stack as string */ -#define LWIP_VERSION_STRING LWIP_VERSTR(LWIP_VERSION_MAJOR) "." LWIP_VERSTR(LWIP_VERSION_MINOR) "." LWIP_VERSTR(LWIP_VERSION_REVISION) LWIP_VERSION_STRING_SUFFIX - -/** - * @} - */ - -/* Modules initialization */ -void lwip_init(void); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_INIT_H */ diff --git a/tools/sdk/include/lwip/lwip/ip.h b/tools/sdk/include/lwip/lwip/ip.h deleted file mode 100644 index 0673be9b4a8..00000000000 --- a/tools/sdk/include/lwip/lwip/ip.h +++ /dev/null @@ -1,319 +0,0 @@ -/** - * @file - * IP API - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_IP_H -#define LWIP_HDR_IP_H - -#include "lwip/opt.h" - -#include "lwip/def.h" -#include "lwip/pbuf.h" -#include "lwip/ip_addr.h" -#include "lwip/err.h" -#include "lwip/netif.h" -#include "lwip/ip4.h" -#include "lwip/ip6.h" -#include "lwip/prot/ip.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* This is passed as the destination address to ip_output_if (not - to ip_output), meaning that an IP header already is constructed - in the pbuf. This is used when TCP retransmits. */ -#define LWIP_IP_HDRINCL NULL - -/** pbufs passed to IP must have a ref-count of 1 as their payload pointer - gets altered as the packet is passed down the stack */ -#ifndef LWIP_IP_CHECK_PBUF_REF_COUNT_FOR_TX -#define LWIP_IP_CHECK_PBUF_REF_COUNT_FOR_TX(p) LWIP_ASSERT("p->ref == 1", (p)->ref == 1) -#endif - -#if LWIP_NETIF_HWADDRHINT -#define IP_PCB_ADDRHINT ;u8_t addr_hint -#else -#define IP_PCB_ADDRHINT -#endif /* LWIP_NETIF_HWADDRHINT */ - -/** This is the common part of all PCB types. It needs to be at the - beginning of a PCB type definition. It is located here so that - changes to this common part are made in one location instead of - having to change all PCB structs. */ -#define IP_PCB \ - /* ip addresses in network byte order */ \ - ip_addr_t local_ip; \ - ip_addr_t remote_ip; \ - /* Socket options */ \ - u8_t so_options; \ - /* Type Of Service */ \ - u8_t tos; \ - /* Time To Live */ \ - u8_t ttl \ - /* link layer address resolution hint */ \ - IP_PCB_ADDRHINT - -struct ip_pcb { -/* Common members of all PCB types */ - IP_PCB; -}; - -/* - * Option flags per-socket. These are the same like SO_XXX in sockets.h - */ -#define SOF_REUSEADDR 0x04U /* allow local address reuse */ -#define SOF_KEEPALIVE 0x08U /* keep connections alive */ -#define SOF_BROADCAST 0x20U /* permit to send and to receive broadcast messages (see IP_SOF_BROADCAST option) */ - -/* These flags are inherited (e.g. from a listen-pcb to a connection-pcb): */ -#define SOF_INHERITED (SOF_REUSEADDR|SOF_KEEPALIVE) - -/** Global variables of this module, kept in a struct for efficient access using base+index. */ -struct ip_globals -{ - /** The interface that accepted the packet for the current callback invocation. */ - struct netif *current_netif; - /** The interface that received the packet for the current callback invocation. */ - struct netif *current_input_netif; -#if LWIP_IPV4 - /** Header of the input packet currently being processed. */ - struct ip_hdr *current_ip4_header; -#endif /* LWIP_IPV4 */ -#if LWIP_IPV6 - /** Header of the input IPv6 packet currently being processed. */ - struct ip6_hdr *current_ip6_header; -#endif /* LWIP_IPV6 */ - /** Total header length of current_ip4/6_header (i.e. after this, the UDP/TCP header starts) */ - u16_t current_ip_header_tot_len; - /** Source IP address of current_header */ - ip_addr_t current_iphdr_src; - /** Destination IP address of current_header */ - ip_addr_t current_iphdr_dest; -}; -extern struct ip_globals ip_data; - - -/** Get the interface that accepted the current packet. - * This may or may not be the receiving netif, depending on your netif/network setup. - * This function must only be called from a receive callback (udp_recv, - * raw_recv, tcp_accept). It will return NULL otherwise. */ -#define ip_current_netif() (ip_data.current_netif) -/** Get the interface that received the current packet. - * This function must only be called from a receive callback (udp_recv, - * raw_recv, tcp_accept). It will return NULL otherwise. */ -#define ip_current_input_netif() (ip_data.current_input_netif) -/** Total header length of ip(6)_current_header() (i.e. after this, the UDP/TCP header starts) */ -#define ip_current_header_tot_len() (ip_data.current_ip_header_tot_len) -/** Source IP address of current_header */ -#define ip_current_src_addr() (&ip_data.current_iphdr_src) -/** Destination IP address of current_header */ -#define ip_current_dest_addr() (&ip_data.current_iphdr_dest) - -#if LWIP_IPV4 && LWIP_IPV6 -/** Get the IPv4 header of the current packet. - * This function must only be called from a receive callback (udp_recv, - * raw_recv, tcp_accept). It will return NULL otherwise. */ -#define ip4_current_header() ((const struct ip_hdr*)(ip_data.current_ip4_header)) -/** Get the IPv6 header of the current packet. - * This function must only be called from a receive callback (udp_recv, - * raw_recv, tcp_accept). It will return NULL otherwise. */ -#define ip6_current_header() ((const struct ip6_hdr*)(ip_data.current_ip6_header)) -/** Returns TRUE if the current IP input packet is IPv6, FALSE if it is IPv4 */ -#define ip_current_is_v6() (ip6_current_header() != NULL) -/** Source IPv6 address of current_header */ -#define ip6_current_src_addr() (ip_2_ip6(&ip_data.current_iphdr_src)) -/** Destination IPv6 address of current_header */ -#define ip6_current_dest_addr() (ip_2_ip6(&ip_data.current_iphdr_dest)) -/** Get the transport layer protocol */ -#define ip_current_header_proto() (ip_current_is_v6() ? \ - IP6H_NEXTH(ip6_current_header()) :\ - IPH_PROTO(ip4_current_header())) -/** Get the transport layer header */ -#define ip_next_header_ptr() ((const void*)((ip_current_is_v6() ? \ - (const u8_t*)ip6_current_header() : (const u8_t*)ip4_current_header()) + ip_current_header_tot_len())) - -/** Source IP4 address of current_header */ -#define ip4_current_src_addr() (ip_2_ip4(&ip_data.current_iphdr_src)) -/** Destination IP4 address of current_header */ -#define ip4_current_dest_addr() (ip_2_ip4(&ip_data.current_iphdr_dest)) - -#elif LWIP_IPV4 /* LWIP_IPV4 && LWIP_IPV6 */ - -/** Get the IPv4 header of the current packet. - * This function must only be called from a receive callback (udp_recv, - * raw_recv, tcp_accept). It will return NULL otherwise. */ -#define ip4_current_header() ((const struct ip_hdr*)(ip_data.current_ip4_header)) -/** Always returns FALSE when only supporting IPv4 only */ -#define ip_current_is_v6() 0 -/** Get the transport layer protocol */ -#define ip_current_header_proto() IPH_PROTO(ip4_current_header()) -/** Get the transport layer header */ -#define ip_next_header_ptr() ((const void*)((const u8_t*)ip4_current_header() + ip_current_header_tot_len())) -/** Source IP4 address of current_header */ -#define ip4_current_src_addr() (&ip_data.current_iphdr_src) -/** Destination IP4 address of current_header */ -#define ip4_current_dest_addr() (&ip_data.current_iphdr_dest) - -#elif LWIP_IPV6 /* LWIP_IPV4 && LWIP_IPV6 */ - -/** Get the IPv6 header of the current packet. - * This function must only be called from a receive callback (udp_recv, - * raw_recv, tcp_accept). It will return NULL otherwise. */ -#define ip6_current_header() ((const struct ip6_hdr*)(ip_data.current_ip6_header)) -/** Always returns TRUE when only supporting IPv6 only */ -#define ip_current_is_v6() 1 -/** Get the transport layer protocol */ -#define ip_current_header_proto() IP6H_NEXTH(ip6_current_header()) -/** Get the transport layer header */ -#define ip_next_header_ptr() ((const void*)((const u8_t*)ip6_current_header())) -/** Source IP6 address of current_header */ -#define ip6_current_src_addr() (&ip_data.current_iphdr_src) -/** Destination IP6 address of current_header */ -#define ip6_current_dest_addr() (&ip_data.current_iphdr_dest) - -#endif /* LWIP_IPV6 */ - -/** Union source address of current_header */ -#define ip_current_src_addr() (&ip_data.current_iphdr_src) -/** Union destination address of current_header */ -#define ip_current_dest_addr() (&ip_data.current_iphdr_dest) - -/** Gets an IP pcb option (SOF_* flags) */ -#define ip_get_option(pcb, opt) ((pcb)->so_options & (opt)) -/** Sets an IP pcb option (SOF_* flags) */ -#define ip_set_option(pcb, opt) ((pcb)->so_options |= (opt)) -/** Resets an IP pcb option (SOF_* flags) */ -#define ip_reset_option(pcb, opt) ((pcb)->so_options &= ~(opt)) - -#if LWIP_IPV4 && LWIP_IPV6 -/** - * @ingroup ip - * Output IP packet, netif is selected by source address - */ -#define ip_output(p, src, dest, ttl, tos, proto) \ - (IP_IS_V6(dest) ? \ - ip6_output(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto) : \ - ip4_output(p, ip_2_ip4(src), ip_2_ip4(dest), ttl, tos, proto)) -/** - * @ingroup ip - * Output IP packet to specified interface - */ -#define ip_output_if(p, src, dest, ttl, tos, proto, netif) \ - (IP_IS_V6(dest) ? \ - ip6_output_if(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto, netif) : \ - ip4_output_if(p, ip_2_ip4(src), ip_2_ip4(dest), ttl, tos, proto, netif)) -/** - * @ingroup ip - * Output IP packet to interface specifying source address - */ -#define ip_output_if_src(p, src, dest, ttl, tos, proto, netif) \ - (IP_IS_V6(dest) ? \ - ip6_output_if_src(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto, netif) : \ - ip4_output_if_src(p, ip_2_ip4(src), ip_2_ip4(dest), ttl, tos, proto, netif)) -/** Output IP packet with addr_hint */ -#define ip_output_hinted(p, src, dest, ttl, tos, proto, addr_hint) \ - (IP_IS_V6(dest) ? \ - ip6_output_hinted(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto, addr_hint) : \ - ip4_output_hinted(p, ip_2_ip4(src), ip_2_ip4(dest), ttl, tos, proto, addr_hint)) -/** - * @ingroup ip - * Get netif for address combination. See \ref ip6_route and \ref ip4_route - */ -#define ip_route(src, dest) \ - (IP_IS_V6(dest) ? \ - ip6_route(ip_2_ip6(src), ip_2_ip6(dest)) : \ - ip4_route_src(ip_2_ip4(dest), ip_2_ip4(src))) -/** - * @ingroup ip - * Get netif for IP. - */ -#define ip_netif_get_local_ip(netif, dest) (IP_IS_V6(dest) ? \ - ip6_netif_get_local_ip(netif, ip_2_ip6(dest)) : \ - ip4_netif_get_local_ip(netif)) -#define ip_debug_print(is_ipv6, p) ((is_ipv6) ? ip6_debug_print(p) : ip4_debug_print(p)) - -err_t ip_input(struct pbuf *p, struct netif *inp); - -#elif LWIP_IPV4 /* LWIP_IPV4 && LWIP_IPV6 */ - -#define ip_output(p, src, dest, ttl, tos, proto) \ - ip4_output(p, src, dest, ttl, tos, proto) -#define ip_output_if(p, src, dest, ttl, tos, proto, netif) \ - ip4_output_if(p, src, dest, ttl, tos, proto, netif) -#define ip_output_if_src(p, src, dest, ttl, tos, proto, netif) \ - ip4_output_if_src(p, src, dest, ttl, tos, proto, netif) -#define ip_output_hinted(p, src, dest, ttl, tos, proto, addr_hint) \ - ip4_output_hinted(p, src, dest, ttl, tos, proto, addr_hint) -#define ip_route(src, dest) \ - ip4_route_src(dest, src) -#define ip_netif_get_local_ip(netif, dest) \ - ip4_netif_get_local_ip(netif) -#define ip_debug_print(is_ipv6, p) ip4_debug_print(p) - -#define ip_input ip4_input - -#elif LWIP_IPV6 /* LWIP_IPV4 && LWIP_IPV6 */ - -#define ip_output(p, src, dest, ttl, tos, proto) \ - ip6_output(p, src, dest, ttl, tos, proto) -#define ip_output_if(p, src, dest, ttl, tos, proto, netif) \ - ip6_output_if(p, src, dest, ttl, tos, proto, netif) -#define ip_output_if_src(p, src, dest, ttl, tos, proto, netif) \ - ip6_output_if_src(p, src, dest, ttl, tos, proto, netif) -#define ip_output_hinted(p, src, dest, ttl, tos, proto, addr_hint) \ - ip6_output_hinted(p, src, dest, ttl, tos, proto, addr_hint) -#define ip_route(src, dest) \ - ip6_route(src, dest) -#define ip_netif_get_local_ip(netif, dest) \ - ip6_netif_get_local_ip(netif, dest) -#define ip_debug_print(is_ipv6, p) ip6_debug_print(p) - -#define ip_input ip6_input - -#endif /* LWIP_IPV6 */ - -#define ip_route_get_local_ip(src, dest, netif, ipaddr) do { \ - (netif) = ip_route(src, dest); \ - (ipaddr) = ip_netif_get_local_ip(netif, dest); \ -}while(0) - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_IP_H */ - - diff --git a/tools/sdk/include/lwip/lwip/ip4.h b/tools/sdk/include/lwip/lwip/ip4.h deleted file mode 100644 index 48246ecc257..00000000000 --- a/tools/sdk/include/lwip/lwip/ip4.h +++ /dev/null @@ -1,111 +0,0 @@ -/** - * @file - * IPv4 API - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_IP4_H -#define LWIP_HDR_IP4_H - -#include "lwip/opt.h" - -#if LWIP_IPV4 - -#include "lwip/def.h" -#include "lwip/pbuf.h" -#include "lwip/ip4_addr.h" -#include "lwip/err.h" -#include "lwip/netif.h" -#include "lwip/prot/ip4.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef LWIP_HOOK_IP4_ROUTE_SRC -#define LWIP_IPV4_SRC_ROUTING 1 -#else -#define LWIP_IPV4_SRC_ROUTING 0 -#endif - -/** Currently, the function ip_output_if_opt() is only used with IGMP */ -#define IP_OPTIONS_SEND (LWIP_IPV4 && LWIP_IGMP) - -#define ip_init() /* Compatibility define, no init needed. */ -struct netif *ip4_route(const ip4_addr_t *dest); -#if LWIP_IPV4_SRC_ROUTING -struct netif *ip4_route_src(const ip4_addr_t *dest, const ip4_addr_t *src); -#else /* LWIP_IPV4_SRC_ROUTING */ -#define ip4_route_src(dest, src) ip4_route(dest) -#endif /* LWIP_IPV4_SRC_ROUTING */ -err_t ip4_input(struct pbuf *p, struct netif *inp); -err_t ip4_output(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, - u8_t ttl, u8_t tos, u8_t proto); -err_t ip4_output_if(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, - u8_t ttl, u8_t tos, u8_t proto, struct netif *netif); -err_t ip4_output_if_src(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, - u8_t ttl, u8_t tos, u8_t proto, struct netif *netif); -#if LWIP_NETIF_HWADDRHINT -err_t ip4_output_hinted(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, - u8_t ttl, u8_t tos, u8_t proto, u8_t *addr_hint); -#endif /* LWIP_NETIF_HWADDRHINT */ -#if IP_OPTIONS_SEND -err_t ip4_output_if_opt(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, - u8_t ttl, u8_t tos, u8_t proto, struct netif *netif, void *ip_options, - u16_t optlen); -err_t ip4_output_if_opt_src(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, - u8_t ttl, u8_t tos, u8_t proto, struct netif *netif, void *ip_options, - u16_t optlen); -#endif /* IP_OPTIONS_SEND */ - -#if LWIP_MULTICAST_TX_OPTIONS -void ip4_set_default_multicast_netif(struct netif* default_multicast_netif); -#endif /* LWIP_MULTICAST_TX_OPTIONS */ - -#define ip4_netif_get_local_ip(netif) (((netif) != NULL) ? netif_ip_addr4(netif) : NULL) - -#if IP_DEBUG -void ip4_debug_print(struct pbuf *p); -#else -#define ip4_debug_print(p) -#endif /* IP_DEBUG */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_IPV4 */ - -#endif /* LWIP_HDR_IP_H */ - - diff --git a/tools/sdk/include/lwip/lwip/ip4_addr.h b/tools/sdk/include/lwip/lwip/ip4_addr.h deleted file mode 100644 index 51b46b8d4c6..00000000000 --- a/tools/sdk/include/lwip/lwip/ip4_addr.h +++ /dev/null @@ -1,227 +0,0 @@ -/** - * @file - * IPv4 address API - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_IP4_ADDR_H -#define LWIP_HDR_IP4_ADDR_H - -#include "lwip/opt.h" -#include "lwip/def.h" - -#if LWIP_IPV4 - -#ifdef __cplusplus -extern "C" { -#endif - -/** This is the aligned version of ip4_addr_t, - used as local variable, on the stack, etc. */ -struct ip4_addr { - u32_t addr; -}; - -/** ip4_addr_t uses a struct for convenience only, so that the same defines can - * operate both on ip4_addr_t as well as on ip4_addr_p_t. */ -typedef struct ip4_addr ip4_addr_t; - -/** - * struct ipaddr2 is used in the definition of the ARP packet format in - * order to support compilers that don't have structure packing. - */ -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct ip4_addr2 { - PACK_STRUCT_FIELD(u16_t addrw[2]); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -/* Forward declaration to not include netif.h */ -struct netif; - -/** 255.255.255.255 */ -#define IPADDR_NONE ((u32_t)0xffffffffUL) -/** 127.0.0.1 */ -#define IPADDR_LOOPBACK ((u32_t)0x7f000001UL) -/** 0.0.0.0 */ -#define IPADDR_ANY ((u32_t)0x00000000UL) -/** 255.255.255.255 */ -#define IPADDR_BROADCAST ((u32_t)0xffffffffUL) - -/* Definitions of the bits in an Internet address integer. - - On subnets, host and network parts are found according to - the subnet mask, not these masks. */ -#define IP_CLASSA(a) ((((u32_t)(a)) & 0x80000000UL) == 0) -#define IP_CLASSA_NET 0xff000000 -#define IP_CLASSA_NSHIFT 24 -#define IP_CLASSA_HOST (0xffffffff & ~IP_CLASSA_NET) -#define IP_CLASSA_MAX 128 - -#define IP_CLASSB(a) ((((u32_t)(a)) & 0xc0000000UL) == 0x80000000UL) -#define IP_CLASSB_NET 0xffff0000 -#define IP_CLASSB_NSHIFT 16 -#define IP_CLASSB_HOST (0xffffffff & ~IP_CLASSB_NET) -#define IP_CLASSB_MAX 65536 - -#define IP_CLASSC(a) ((((u32_t)(a)) & 0xe0000000UL) == 0xc0000000UL) -#define IP_CLASSC_NET 0xffffff00 -#define IP_CLASSC_NSHIFT 8 -#define IP_CLASSC_HOST (0xffffffff & ~IP_CLASSC_NET) - -#define IP_CLASSD(a) (((u32_t)(a) & 0xf0000000UL) == 0xe0000000UL) -#define IP_CLASSD_NET 0xf0000000 /* These ones aren't really */ -#define IP_CLASSD_NSHIFT 28 /* net and host fields, but */ -#define IP_CLASSD_HOST 0x0fffffff /* routing needn't know. */ -#define IP_MULTICAST(a) IP_CLASSD(a) - -#define IP_EXPERIMENTAL(a) (((u32_t)(a) & 0xf0000000UL) == 0xf0000000UL) -#define IP_BADCLASS(a) (((u32_t)(a) & 0xf0000000UL) == 0xf0000000UL) - -#define IP_LOOPBACKNET 127 /* official! */ - -/** Set an IP address given by the four byte-parts */ -#define IP4_ADDR(ipaddr, a,b,c,d) (ipaddr)->addr = PP_HTONL(LWIP_MAKEU32(a,b,c,d)) - -/** MEMCPY-like copying of IP addresses where addresses are known to be - * 16-bit-aligned if the port is correctly configured (so a port could define - * this to copying 2 u16_t's) - no NULL-pointer-checking needed. */ -#ifndef IPADDR2_COPY -#define IPADDR2_COPY(dest, src) SMEMCPY(dest, src, sizeof(ip4_addr_t)) -#endif - -/** Copy IP address - faster than ip4_addr_set: no NULL check */ -#define ip4_addr_copy(dest, src) ((dest).addr = (src).addr) -/** Safely copy one IP address to another (src may be NULL) */ -#define ip4_addr_set(dest, src) ((dest)->addr = \ - ((src) == NULL ? 0 : \ - (src)->addr)) -/** Set complete address to zero */ -#define ip4_addr_set_zero(ipaddr) ((ipaddr)->addr = 0) -/** Set address to IPADDR_ANY (no need for lwip_htonl()) */ -#define ip4_addr_set_any(ipaddr) ((ipaddr)->addr = IPADDR_ANY) -/** Set address to loopback address */ -#define ip4_addr_set_loopback(ipaddr) ((ipaddr)->addr = PP_HTONL(IPADDR_LOOPBACK)) -/** Check if an address is in the loopback region */ -#define ip4_addr_isloopback(ipaddr) (((ipaddr)->addr & PP_HTONL(IP_CLASSA_NET)) == PP_HTONL(((u32_t)IP_LOOPBACKNET) << 24)) -/** Safely copy one IP address to another and change byte order - * from host- to network-order. */ -#define ip4_addr_set_hton(dest, src) ((dest)->addr = \ - ((src) == NULL ? 0:\ - lwip_htonl((src)->addr))) -/** IPv4 only: set the IP address given as an u32_t */ -#define ip4_addr_set_u32(dest_ipaddr, src_u32) ((dest_ipaddr)->addr = (src_u32)) -/** IPv4 only: get the IP address as an u32_t */ -#define ip4_addr_get_u32(src_ipaddr) ((src_ipaddr)->addr) - -/** Get the network address by combining host address with netmask */ -#define ip4_addr_get_network(target, host, netmask) do { ((target)->addr = ((host)->addr) & ((netmask)->addr)); } while(0) - -/** - * Determine if two address are on the same network. - * - * @arg addr1 IP address 1 - * @arg addr2 IP address 2 - * @arg mask network identifier mask - * @return !0 if the network identifiers of both address match - */ -#define ip4_addr_netcmp(addr1, addr2, mask) (((addr1)->addr & \ - (mask)->addr) == \ - ((addr2)->addr & \ - (mask)->addr)) -#define ip4_addr_cmp(addr1, addr2) ((addr1)->addr == (addr2)->addr) - -#define ip4_addr_isany_val(addr1) ((addr1).addr == IPADDR_ANY) -#define ip4_addr_isany(addr1) ((addr1) == NULL || ip4_addr_isany_val(*(addr1))) - -#define ip4_addr_isbroadcast(addr1, netif) ip4_addr_isbroadcast_u32((addr1)->addr, netif) -u8_t ip4_addr_isbroadcast_u32(u32_t addr, const struct netif *netif); - -#define ip_addr_netmask_valid(netmask) ip4_addr_netmask_valid((netmask)->addr) -u8_t ip4_addr_netmask_valid(u32_t netmask); - -#define ip4_addr_ismulticast(addr1) (((addr1)->addr & PP_HTONL(0xf0000000UL)) == PP_HTONL(0xe0000000UL)) - -#define ip4_addr_islinklocal(addr1) (((addr1)->addr & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xa9fe0000UL)) - -#define ip4_addr_debug_print_parts(debug, a, b, c, d) \ - LWIP_DEBUGF(debug, ("%" U16_F ".%" U16_F ".%" U16_F ".%" U16_F, a, b, c, d)) -#define ip4_addr_debug_print(debug, ipaddr) \ - ip4_addr_debug_print_parts(debug, \ - (u16_t)((ipaddr) != NULL ? ip4_addr1_16(ipaddr) : 0), \ - (u16_t)((ipaddr) != NULL ? ip4_addr2_16(ipaddr) : 0), \ - (u16_t)((ipaddr) != NULL ? ip4_addr3_16(ipaddr) : 0), \ - (u16_t)((ipaddr) != NULL ? ip4_addr4_16(ipaddr) : 0)) -#define ip4_addr_debug_print_val(debug, ipaddr) \ - ip4_addr_debug_print_parts(debug, \ - ip4_addr1_16(&(ipaddr)), \ - ip4_addr2_16(&(ipaddr)), \ - ip4_addr3_16(&(ipaddr)), \ - ip4_addr4_16(&(ipaddr))) - -/* Get one byte from the 4-byte address */ -#define ip4_addr1(ipaddr) (((const u8_t*)(&(ipaddr)->addr))[0]) -#define ip4_addr2(ipaddr) (((const u8_t*)(&(ipaddr)->addr))[1]) -#define ip4_addr3(ipaddr) (((const u8_t*)(&(ipaddr)->addr))[2]) -#define ip4_addr4(ipaddr) (((const u8_t*)(&(ipaddr)->addr))[3]) -/* These are cast to u16_t, with the intent that they are often arguments - * to printf using the U16_F format from cc.h. */ -#define ip4_addr1_16(ipaddr) ((u16_t)ip4_addr1(ipaddr)) -#define ip4_addr2_16(ipaddr) ((u16_t)ip4_addr2(ipaddr)) -#define ip4_addr3_16(ipaddr) ((u16_t)ip4_addr3(ipaddr)) -#define ip4_addr4_16(ipaddr) ((u16_t)ip4_addr4(ipaddr)) - -#define IP4ADDR_STRLEN_MAX 16 - -/** For backwards compatibility */ -#define ip_ntoa(ipaddr) ipaddr_ntoa(ipaddr) - -u32_t ipaddr_addr(const char *cp); -int ip4addr_aton(const char *cp, ip4_addr_t *addr); -/** returns ptr to static buffer; not reentrant! */ -char *ip4addr_ntoa(const ip4_addr_t *addr); -char *ip4addr_ntoa_r(const ip4_addr_t *addr, char *buf, int buflen); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_IPV4 */ - -#endif /* LWIP_HDR_IP_ADDR_H */ diff --git a/tools/sdk/include/lwip/lwip/ip4_frag.h b/tools/sdk/include/lwip/lwip/ip4_frag.h deleted file mode 100644 index ed5bf14a31c..00000000000 --- a/tools/sdk/include/lwip/lwip/ip4_frag.h +++ /dev/null @@ -1,100 +0,0 @@ -/** - * @file - * IP fragmentation/reassembly - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Jani Monoses - * - */ - -#ifndef LWIP_HDR_IP4_FRAG_H -#define LWIP_HDR_IP4_FRAG_H - -#include "lwip/opt.h" -#include "lwip/err.h" -#include "lwip/pbuf.h" -#include "lwip/netif.h" -#include "lwip/ip_addr.h" -#include "lwip/ip.h" - -#if LWIP_IPV4 - -#ifdef __cplusplus -extern "C" { -#endif - -#if IP_REASSEMBLY -/* The IP reassembly timer interval in milliseconds. */ -#define IP_TMR_INTERVAL 1000 - -/** IP reassembly helper struct. - * This is exported because memp needs to know the size. - */ -struct ip_reassdata { - struct ip_reassdata *next; - struct pbuf *p; - struct ip_hdr iphdr; - u16_t datagram_len; - u8_t flags; - u8_t timer; -}; - -void ip_reass_init(void); -void ip_reass_tmr(void); -struct pbuf * ip4_reass(struct pbuf *p); -#endif /* IP_REASSEMBLY */ - -#if IP_FRAG -#if !LWIP_NETIF_TX_SINGLE_PBUF -#ifndef LWIP_PBUF_CUSTOM_REF_DEFINED -#define LWIP_PBUF_CUSTOM_REF_DEFINED -/** A custom pbuf that holds a reference to another pbuf, which is freed - * when this custom pbuf is freed. This is used to create a custom PBUF_REF - * that points into the original pbuf. */ -struct pbuf_custom_ref { - /** 'base class' */ - struct pbuf_custom pc; - /** pointer to the original pbuf that is referenced */ - struct pbuf *original; -}; -#endif /* LWIP_PBUF_CUSTOM_REF_DEFINED */ -#endif /* !LWIP_NETIF_TX_SINGLE_PBUF */ - -err_t ip4_frag(struct pbuf *p, struct netif *netif, const ip4_addr_t *dest); -#endif /* IP_FRAG */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_IPV4 */ - -#endif /* LWIP_HDR_IP4_FRAG_H */ diff --git a/tools/sdk/include/lwip/lwip/ip6.h b/tools/sdk/include/lwip/lwip/ip6.h deleted file mode 100644 index 099b94fb74f..00000000000 --- a/tools/sdk/include/lwip/lwip/ip6.h +++ /dev/null @@ -1,93 +0,0 @@ -/** - * @file - * - * IPv6 layer. - */ - -/* - * Copyright (c) 2010 Inico Technologies Ltd. - * All rights reserved. - * - * 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: Ivan Delamer - * - * - * Please coordinate changes and requests with Ivan Delamer - * - */ -#ifndef LWIP_HDR_IP6_H -#define LWIP_HDR_IP6_H - -#include "lwip/opt.h" - -#if LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/ip6_addr.h" -#include "lwip/prot/ip6.h" -#include "lwip/def.h" -#include "lwip/pbuf.h" -#include "lwip/netif.h" - -#include "lwip/err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct netif *ip6_route(const ip6_addr_t *src, const ip6_addr_t *dest); -const ip_addr_t *ip6_select_source_address(struct netif *netif, const ip6_addr_t * dest); -err_t ip6_input(struct pbuf *p, struct netif *inp); -err_t ip6_output(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, - u8_t hl, u8_t tc, u8_t nexth); -err_t ip6_output_if(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, - u8_t hl, u8_t tc, u8_t nexth, struct netif *netif); -err_t ip6_output_if_src(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, - u8_t hl, u8_t tc, u8_t nexth, struct netif *netif); -#if LWIP_NETIF_HWADDRHINT -err_t ip6_output_hinted(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, - u8_t hl, u8_t tc, u8_t nexth, u8_t *addr_hint); -#endif /* LWIP_NETIF_HWADDRHINT */ -#if LWIP_IPV6_MLD -err_t ip6_options_add_hbh_ra(struct pbuf * p, u8_t nexth, u8_t value); -#endif /* LWIP_IPV6_MLD */ - -#define ip6_netif_get_local_ip(netif, dest) (((netif) != NULL) ? \ - ip6_select_source_address(netif, dest) : NULL) - -#if IP6_DEBUG -void ip6_debug_print(struct pbuf *p); -#else -#define ip6_debug_print(p) -#endif /* IP6_DEBUG */ - - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_IPV6 */ - -#endif /* LWIP_HDR_IP6_H */ diff --git a/tools/sdk/include/lwip/lwip/ip6_addr.h b/tools/sdk/include/lwip/lwip/ip6_addr.h deleted file mode 100644 index ee381aeb233..00000000000 --- a/tools/sdk/include/lwip/lwip/ip6_addr.h +++ /dev/null @@ -1,285 +0,0 @@ -/** - * @file - * - * IPv6 addresses. - */ - -/* - * Copyright (c) 2010 Inico Technologies Ltd. - * All rights reserved. - * - * 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: Ivan Delamer - * - * Structs and macros for handling IPv6 addresses. - * - * Please coordinate changes and requests with Ivan Delamer - * - */ -#ifndef LWIP_HDR_IP6_ADDR_H -#define LWIP_HDR_IP6_ADDR_H - -#include "lwip/opt.h" -#include "def.h" - -#if LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */ - - -#ifdef __cplusplus -extern "C" { -#endif - - -/** This is the aligned version of ip6_addr_t, - used as local variable, on the stack, etc. */ -struct ip6_addr { - u32_t addr[4]; -}; - -/** IPv6 address */ -typedef struct ip6_addr ip6_addr_t; - -/** Set an IPv6 partial address given by byte-parts */ -#define IP6_ADDR_PART(ip6addr, index, a,b,c,d) \ - (ip6addr)->addr[index] = PP_HTONL(LWIP_MAKEU32(a,b,c,d)) - -/** Set a full IPv6 address by passing the 4 u32_t indices in network byte order - (use PP_HTONL() for constants) */ -#define IP6_ADDR(ip6addr, idx0, idx1, idx2, idx3) do { \ - (ip6addr)->addr[0] = idx0; \ - (ip6addr)->addr[1] = idx1; \ - (ip6addr)->addr[2] = idx2; \ - (ip6addr)->addr[3] = idx3; } while(0) - -/** Access address in 16-bit block */ -#define IP6_ADDR_BLOCK1(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[0]) >> 16) & 0xffff)) -/** Access address in 16-bit block */ -#define IP6_ADDR_BLOCK2(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[0])) & 0xffff)) -/** Access address in 16-bit block */ -#define IP6_ADDR_BLOCK3(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[1]) >> 16) & 0xffff)) -/** Access address in 16-bit block */ -#define IP6_ADDR_BLOCK4(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[1])) & 0xffff)) -/** Access address in 16-bit block */ -#define IP6_ADDR_BLOCK5(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[2]) >> 16) & 0xffff)) -/** Access address in 16-bit block */ -#define IP6_ADDR_BLOCK6(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[2])) & 0xffff)) -/** Access address in 16-bit block */ -#define IP6_ADDR_BLOCK7(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[3]) >> 16) & 0xffff)) -/** Access address in 16-bit block */ -#define IP6_ADDR_BLOCK8(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[3])) & 0xffff)) - -/** Copy IPv6 address - faster than ip6_addr_set: no NULL check */ -#define ip6_addr_copy(dest, src) do{(dest).addr[0] = (src).addr[0]; \ - (dest).addr[1] = (src).addr[1]; \ - (dest).addr[2] = (src).addr[2]; \ - (dest).addr[3] = (src).addr[3];}while(0) -/** Safely copy one IPv6 address to another (src may be NULL) */ -#define ip6_addr_set(dest, src) do{(dest)->addr[0] = (src) == NULL ? 0 : (src)->addr[0]; \ - (dest)->addr[1] = (src) == NULL ? 0 : (src)->addr[1]; \ - (dest)->addr[2] = (src) == NULL ? 0 : (src)->addr[2]; \ - (dest)->addr[3] = (src) == NULL ? 0 : (src)->addr[3];}while(0) - -/** Set complete address to zero */ -#define ip6_addr_set_zero(ip6addr) do{(ip6addr)->addr[0] = 0; \ - (ip6addr)->addr[1] = 0; \ - (ip6addr)->addr[2] = 0; \ - (ip6addr)->addr[3] = 0;}while(0) - -/** Set address to ipv6 'any' (no need for lwip_htonl()) */ -#define ip6_addr_set_any(ip6addr) ip6_addr_set_zero(ip6addr) -/** Set address to ipv6 loopback address */ -#define ip6_addr_set_loopback(ip6addr) do{(ip6addr)->addr[0] = 0; \ - (ip6addr)->addr[1] = 0; \ - (ip6addr)->addr[2] = 0; \ - (ip6addr)->addr[3] = PP_HTONL(0x00000001UL);}while(0) -/** Safely copy one IPv6 address to another and change byte order - * from host- to network-order. */ -#define ip6_addr_set_hton(dest, src) do{(dest)->addr[0] = (src) == NULL ? 0 : lwip_htonl((src)->addr[0]); \ - (dest)->addr[1] = (src) == NULL ? 0 : lwip_htonl((src)->addr[1]); \ - (dest)->addr[2] = (src) == NULL ? 0 : lwip_htonl((src)->addr[2]); \ - (dest)->addr[3] = (src) == NULL ? 0 : lwip_htonl((src)->addr[3]);}while(0) - - -/** - * Determine if two IPv6 address are on the same network. - * - * @arg addr1 IPv6 address 1 - * @arg addr2 IPv6 address 2 - * @return !0 if the network identifiers of both address match - */ -#define ip6_addr_netcmp(addr1, addr2) (((addr1)->addr[0] == (addr2)->addr[0]) && \ - ((addr1)->addr[1] == (addr2)->addr[1])) - -#define ip6_addr_cmp(addr1, addr2) (((addr1)->addr[0] == (addr2)->addr[0]) && \ - ((addr1)->addr[1] == (addr2)->addr[1]) && \ - ((addr1)->addr[2] == (addr2)->addr[2]) && \ - ((addr1)->addr[3] == (addr2)->addr[3])) - -#define ip6_get_subnet_id(ip6addr) (lwip_htonl((ip6addr)->addr[2]) & 0x0000ffffUL) - -#define ip6_addr_isany_val(ip6addr) (((ip6addr).addr[0] == 0) && \ - ((ip6addr).addr[1] == 0) && \ - ((ip6addr).addr[2] == 0) && \ - ((ip6addr).addr[3] == 0)) -#define ip6_addr_isany(ip6addr) (((ip6addr) == NULL) || ip6_addr_isany_val(*(ip6addr))) - -#define ip6_addr_isloopback(ip6addr) (((ip6addr)->addr[0] == 0UL) && \ - ((ip6addr)->addr[1] == 0UL) && \ - ((ip6addr)->addr[2] == 0UL) && \ - ((ip6addr)->addr[3] == PP_HTONL(0x00000001UL))) - -#define ip6_addr_isglobal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xe0000000UL)) == PP_HTONL(0x20000000UL)) - -#define ip6_addr_islinklocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xffc00000UL)) == PP_HTONL(0xfe800000UL)) - -#define ip6_addr_issitelocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xffc00000UL)) == PP_HTONL(0xfec00000UL)) - -#define ip6_addr_isuniquelocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xfe000000UL)) == PP_HTONL(0xfc000000UL)) - -#define ip6_addr_isipv4mappedipv6(ip6addr) (((ip6addr)->addr[0] == 0) && ((ip6addr)->addr[1] == 0) && (((ip6addr)->addr[2]) == PP_HTONL(0x0000FFFFUL))) - -#define ip6_addr_ismulticast(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff000000UL)) == PP_HTONL(0xff000000UL)) -#define ip6_addr_multicast_transient_flag(ip6addr) ((ip6addr)->addr[0] & PP_HTONL(0x00100000UL)) -#define ip6_addr_multicast_prefix_flag(ip6addr) ((ip6addr)->addr[0] & PP_HTONL(0x00200000UL)) -#define ip6_addr_multicast_rendezvous_flag(ip6addr) ((ip6addr)->addr[0] & PP_HTONL(0x00400000UL)) -#define ip6_addr_multicast_scope(ip6addr) ((lwip_htonl((ip6addr)->addr[0]) >> 16) & 0xf) -#define IP6_MULTICAST_SCOPE_RESERVED 0x0 -#define IP6_MULTICAST_SCOPE_RESERVED0 0x0 -#define IP6_MULTICAST_SCOPE_INTERFACE_LOCAL 0x1 -#define IP6_MULTICAST_SCOPE_LINK_LOCAL 0x2 -#define IP6_MULTICAST_SCOPE_RESERVED3 0x3 -#define IP6_MULTICAST_SCOPE_ADMIN_LOCAL 0x4 -#define IP6_MULTICAST_SCOPE_SITE_LOCAL 0x5 -#define IP6_MULTICAST_SCOPE_ORGANIZATION_LOCAL 0x8 -#define IP6_MULTICAST_SCOPE_GLOBAL 0xe -#define IP6_MULTICAST_SCOPE_RESERVEDF 0xf -#define ip6_addr_ismulticast_iflocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff010000UL)) -#define ip6_addr_ismulticast_linklocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff020000UL)) -#define ip6_addr_ismulticast_adminlocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff040000UL)) -#define ip6_addr_ismulticast_sitelocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff050000UL)) -#define ip6_addr_ismulticast_orglocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff080000UL)) -#define ip6_addr_ismulticast_global(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff0e0000UL)) - -/* @todo define get/set for well-know multicast addresses, e.g. ff02::1 */ -#define ip6_addr_isallnodes_iflocal(ip6addr) (((ip6addr)->addr[0] == PP_HTONL(0xff010000UL)) && \ - ((ip6addr)->addr[1] == 0UL) && \ - ((ip6addr)->addr[2] == 0UL) && \ - ((ip6addr)->addr[3] == PP_HTONL(0x00000001UL))) - -#define ip6_addr_isallnodes_linklocal(ip6addr) (((ip6addr)->addr[0] == PP_HTONL(0xff020000UL)) && \ - ((ip6addr)->addr[1] == 0UL) && \ - ((ip6addr)->addr[2] == 0UL) && \ - ((ip6addr)->addr[3] == PP_HTONL(0x00000001UL))) -#define ip6_addr_set_allnodes_linklocal(ip6addr) do{(ip6addr)->addr[0] = PP_HTONL(0xff020000UL); \ - (ip6addr)->addr[1] = 0; \ - (ip6addr)->addr[2] = 0; \ - (ip6addr)->addr[3] = PP_HTONL(0x00000001UL);}while(0) - -#define ip6_addr_isallrouters_linklocal(ip6addr) (((ip6addr)->addr[0] == PP_HTONL(0xff020000UL)) && \ - ((ip6addr)->addr[1] == 0UL) && \ - ((ip6addr)->addr[2] == 0UL) && \ - ((ip6addr)->addr[3] == PP_HTONL(0x00000002UL))) -#define ip6_addr_set_allrouters_linklocal(ip6addr) do{(ip6addr)->addr[0] = PP_HTONL(0xff020000UL); \ - (ip6addr)->addr[1] = 0; \ - (ip6addr)->addr[2] = 0; \ - (ip6addr)->addr[3] = PP_HTONL(0x00000002UL);}while(0) - -#define ip6_addr_issolicitednode(ip6addr) ( ((ip6addr)->addr[0] == PP_HTONL(0xff020000UL)) && \ - ((ip6addr)->addr[2] == PP_HTONL(0x00000001UL)) && \ - (((ip6addr)->addr[3] & PP_HTONL(0xff000000UL)) == PP_HTONL(0xff000000UL)) ) - -#define ip6_addr_set_solicitednode(ip6addr, if_id) do{(ip6addr)->addr[0] = PP_HTONL(0xff020000UL); \ - (ip6addr)->addr[1] = 0; \ - (ip6addr)->addr[2] = PP_HTONL(0x00000001UL); \ - (ip6addr)->addr[3] = (PP_HTONL(0xff000000UL) | (if_id));}while(0) - -#define ip6_addr_cmp_solicitednode(ip6addr, sn_addr) (((ip6addr)->addr[0] == PP_HTONL(0xff020000UL)) && \ - ((ip6addr)->addr[1] == 0) && \ - ((ip6addr)->addr[2] == PP_HTONL(0x00000001UL)) && \ - ((ip6addr)->addr[3] == (PP_HTONL(0xff000000UL) | (sn_addr)->addr[3]))) - -/* IPv6 address states. */ -#define IP6_ADDR_INVALID 0x00 -#define IP6_ADDR_TENTATIVE 0x08 -#define IP6_ADDR_TENTATIVE_1 0x09 /* 1 probe sent */ -#define IP6_ADDR_TENTATIVE_2 0x0a /* 2 probes sent */ -#define IP6_ADDR_TENTATIVE_3 0x0b /* 3 probes sent */ -#define IP6_ADDR_TENTATIVE_4 0x0c /* 4 probes sent */ -#define IP6_ADDR_TENTATIVE_5 0x0d /* 5 probes sent */ -#define IP6_ADDR_TENTATIVE_6 0x0e /* 6 probes sent */ -#define IP6_ADDR_TENTATIVE_7 0x0f /* 7 probes sent */ -#define IP6_ADDR_VALID 0x10 /* This bit marks an address as valid (preferred or deprecated) */ -#define IP6_ADDR_PREFERRED 0x30 -#define IP6_ADDR_DEPRECATED 0x10 /* Same as VALID (valid but not preferred) */ - -#define IP6_ADDR_TENTATIVE_COUNT_MASK 0x07 /* 1-7 probes sent */ - -#define ip6_addr_isinvalid(addr_state) (addr_state == IP6_ADDR_INVALID) -#define ip6_addr_istentative(addr_state) (addr_state & IP6_ADDR_TENTATIVE) -#define ip6_addr_isvalid(addr_state) (addr_state & IP6_ADDR_VALID) /* Include valid, preferred, and deprecated. */ -#define ip6_addr_ispreferred(addr_state) (addr_state == IP6_ADDR_PREFERRED) -#define ip6_addr_isdeprecated(addr_state) (addr_state == IP6_ADDR_DEPRECATED) - -#define ip6_addr_debug_print_parts(debug, a, b, c, d, e, f, g, h) \ - LWIP_DEBUGF(debug, ("%" X16_F ":%" X16_F ":%" X16_F ":%" X16_F ":%" X16_F ":%" X16_F ":%" X16_F ":%" X16_F, \ - a, b, c, d, e, f, g, h)) -#define ip6_addr_debug_print(debug, ipaddr) \ - ip6_addr_debug_print_parts(debug, \ - (u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK1(ipaddr) : 0), \ - (u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK2(ipaddr) : 0), \ - (u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK3(ipaddr) : 0), \ - (u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK4(ipaddr) : 0), \ - (u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK5(ipaddr) : 0), \ - (u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK6(ipaddr) : 0), \ - (u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK7(ipaddr) : 0), \ - (u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK8(ipaddr) : 0)) -#define ip6_addr_debug_print_val(debug, ipaddr) \ - ip6_addr_debug_print_parts(debug, \ - IP6_ADDR_BLOCK1(&(ipaddr)), \ - IP6_ADDR_BLOCK2(&(ipaddr)), \ - IP6_ADDR_BLOCK3(&(ipaddr)), \ - IP6_ADDR_BLOCK4(&(ipaddr)), \ - IP6_ADDR_BLOCK5(&(ipaddr)), \ - IP6_ADDR_BLOCK6(&(ipaddr)), \ - IP6_ADDR_BLOCK7(&(ipaddr)), \ - IP6_ADDR_BLOCK8(&(ipaddr))) - -#define IP6ADDR_STRLEN_MAX 46 - -int ip6addr_aton(const char *cp, ip6_addr_t *addr); -/** returns ptr to static buffer; not reentrant! */ -char *ip6addr_ntoa(const ip6_addr_t *addr); -char *ip6addr_ntoa_r(const ip6_addr_t *addr, char *buf, int buflen); - - - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_IPV6 */ - -#endif /* LWIP_HDR_IP6_ADDR_H */ diff --git a/tools/sdk/include/lwip/lwip/ip6_frag.h b/tools/sdk/include/lwip/lwip/ip6_frag.h deleted file mode 100644 index 6be274734b2..00000000000 --- a/tools/sdk/include/lwip/lwip/ip6_frag.h +++ /dev/null @@ -1,120 +0,0 @@ -/** - * @file - * - * IPv6 fragmentation and reassembly. - */ - -/* - * Copyright (c) 2010 Inico Technologies Ltd. - * All rights reserved. - * - * 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: Ivan Delamer - * - * - * Please coordinate changes and requests with Ivan Delamer - * - */ -#ifndef LWIP_HDR_IP6_FRAG_H -#define LWIP_HDR_IP6_FRAG_H - -#include "lwip/opt.h" -#include "lwip/pbuf.h" -#include "lwip/ip6_addr.h" -#include "lwip/ip6.h" -#include "lwip/netif.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -#if LWIP_IPV6 && LWIP_IPV6_REASS /* don't build if not configured for use in lwipopts.h */ - -/** IP6_FRAG_COPYHEADER==1: for platforms where sizeof(void*) > 4, this needs to - * be enabled (to not overwrite part of the data). When enabled, the IPv6 header - * is copied instead of referencing it, which gives more room for struct ip6_reass_helper */ -#ifndef IPV6_FRAG_COPYHEADER -#define IPV6_FRAG_COPYHEADER 0 -#endif - -/** The IPv6 reassembly timer interval in milliseconds. */ -#define IP6_REASS_TMR_INTERVAL 1000 - -/* Copy the complete header of the first fragment to struct ip6_reassdata - or just point to its original location in the first pbuf? */ -#if IPV6_FRAG_COPYHEADER -#define IPV6_FRAG_HDRPTR -#define IPV6_FRAG_HDRREF(hdr) (&(hdr)) -#else /* IPV6_FRAG_COPYHEADER */ -#define IPV6_FRAG_HDRPTR * -#define IPV6_FRAG_HDRREF(hdr) (hdr) -#endif /* IPV6_FRAG_COPYHEADER */ - -/** IPv6 reassembly helper struct. - * This is exported because memp needs to know the size. - */ -struct ip6_reassdata { - struct ip6_reassdata *next; - struct pbuf *p; - struct ip6_hdr IPV6_FRAG_HDRPTR iphdr; - u32_t identification; - u16_t datagram_len; - u8_t nexth; - u8_t timer; -}; - -#define ip6_reass_init() /* Compatibility define */ -void ip6_reass_tmr(void); -struct pbuf *ip6_reass(struct pbuf *p); - -#endif /* LWIP_IPV6 && LWIP_IPV6_REASS */ - -#if LWIP_IPV6 && LWIP_IPV6_FRAG /* don't build if not configured for use in lwipopts.h */ - -#ifndef LWIP_PBUF_CUSTOM_REF_DEFINED -#define LWIP_PBUF_CUSTOM_REF_DEFINED -/** A custom pbuf that holds a reference to another pbuf, which is freed - * when this custom pbuf is freed. This is used to create a custom PBUF_REF - * that points into the original pbuf. */ -struct pbuf_custom_ref { - /** 'base class' */ - struct pbuf_custom pc; - /** pointer to the original pbuf that is referenced */ - struct pbuf *original; -}; -#endif /* LWIP_PBUF_CUSTOM_REF_DEFINED */ - -err_t ip6_frag(struct pbuf *p, struct netif *netif, const ip6_addr_t *dest); - -#endif /* LWIP_IPV6 && LWIP_IPV6_FRAG */ - - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_IP6_FRAG_H */ diff --git a/tools/sdk/include/lwip/lwip/ip_addr.h b/tools/sdk/include/lwip/lwip/ip_addr.h deleted file mode 100644 index ca09ed3982a..00000000000 --- a/tools/sdk/include/lwip/lwip/ip_addr.h +++ /dev/null @@ -1,412 +0,0 @@ -/** - * @file - * IP address API (common IPv4 and IPv6) - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_IP_ADDR_H -#define LWIP_HDR_IP_ADDR_H - -#include "lwip/opt.h" -#include "lwip/def.h" - -#include "lwip/ip4_addr.h" -#include "lwip/ip6_addr.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** @ingroup ipaddr - * IP address types for use in ip_addr_t.type member. - * @see tcp_new_ip_type(), udp_new_ip_type(), raw_new_ip_type(). - */ -enum lwip_ip_addr_type { - /** IPv4 */ - IPADDR_TYPE_V4 = 0U, - /** IPv6 */ - IPADDR_TYPE_V6 = 6U, - /** IPv4+IPv6 ("dual-stack") */ - IPADDR_TYPE_ANY = 46U -}; - -#if LWIP_IPV4 && LWIP_IPV6 -/** - * @ingroup ipaddr - * A union struct for both IP version's addresses. - * ATTENTION: watch out for its size when adding IPv6 address scope! - */ -typedef struct ip_addr { - union { - ip6_addr_t ip6; - ip4_addr_t ip4; - } u_addr; - /** @ref lwip_ip_addr_type */ - u8_t type; -} ip_addr_t; - -extern const ip_addr_t ip_addr_any_type; - -/** @ingroup ip4addr */ -#define IPADDR4_INIT(u32val) { { { { u32val, 0ul, 0ul, 0ul } } }, IPADDR_TYPE_V4 } -/** @ingroup ip4addr */ -#define IPADDR4_INIT_BYTES(a,b,c,d) IPADDR4_INIT(PP_HTONL(LWIP_MAKEU32(a,b,c,d))) -/** @ingroup ip6addr */ -#define IPADDR6_INIT(a, b, c, d) { { { { a, b, c, d } } }, IPADDR_TYPE_V6 } -/** @ingroup ip6addr */ -#define IPADDR6_INIT_HOST(a, b, c, d) { { { { PP_HTONL(a), PP_HTONL(b), PP_HTONL(c), PP_HTONL(d) } } }, IPADDR_TYPE_V6 } - -/** @ingroup ipaddr */ -#define IP_IS_ANY_TYPE_VAL(ipaddr) (IP_GET_TYPE(&ipaddr) == IPADDR_TYPE_ANY) -/** @ingroup ipaddr */ -#define IPADDR_ANY_TYPE_INIT { { { { 0ul, 0ul, 0ul, 0ul } } }, IPADDR_TYPE_ANY } - -/** @ingroup ip4addr */ -#define IP_IS_V4_VAL(ipaddr) (IP_GET_TYPE(&ipaddr) == IPADDR_TYPE_V4) -/** @ingroup ip6addr */ -#define IP_IS_V6_VAL(ipaddr) (IP_GET_TYPE(&ipaddr) == IPADDR_TYPE_V6) -/** @ingroup ip4addr */ -#define IP_IS_V4(ipaddr) (((ipaddr) == NULL) || IP_IS_V4_VAL(*(ipaddr))) -/** @ingroup ip6addr */ -#define IP_IS_V6(ipaddr) (((ipaddr) != NULL) && IP_IS_V6_VAL(*(ipaddr))) - -#if ESP_LWIP -#define IP_V6_EQ_PART(ipaddr, WORD, VAL) (ip_2_ip6(ipaddr)->addr[WORD] == htonl(VAL)) -#define IP_IS_V4MAPPEDV6(ipaddr) (IP_IS_V6(ipaddr) && IP_V6_EQ_PART(ipaddr, 0, 0) && IP_V6_EQ_PART(ipaddr, 1, 0) && IP_V6_EQ_PART(ipaddr, 2, 0x0000FFFF)) -#endif - -#define IP_SET_TYPE_VAL(ipaddr, iptype) do { (ipaddr).type = (iptype); }while(0) -#define IP_SET_TYPE(ipaddr, iptype) do { if((ipaddr) != NULL) { IP_SET_TYPE_VAL(*(ipaddr), iptype); }}while(0) -#define IP_GET_TYPE(ipaddr) ((ipaddr)->type) - -#define IP_ADDR_PCB_VERSION_MATCH_EXACT(pcb, ipaddr) (IP_GET_TYPE(&pcb->local_ip) == IP_GET_TYPE(ipaddr)) -#define IP_ADDR_PCB_VERSION_MATCH(pcb, ipaddr) (IP_IS_ANY_TYPE_VAL(pcb->local_ip) || IP_ADDR_PCB_VERSION_MATCH_EXACT(pcb, ipaddr)) - -/** @ingroup ip6addr - * Convert generic ip address to specific protocol version - */ -#define ip_2_ip6(ipaddr) (&((ipaddr)->u_addr.ip6)) -/** @ingroup ip4addr - * Convert generic ip address to specific protocol version - */ -#define ip_2_ip4(ipaddr) (&((ipaddr)->u_addr.ip4)) - -/** @ingroup ip4addr */ -#define IP_ADDR4(ipaddr,a,b,c,d) do { IP4_ADDR(ip_2_ip4(ipaddr),a,b,c,d); \ - IP_SET_TYPE_VAL(*(ipaddr), IPADDR_TYPE_V4); } while(0) -/** @ingroup ip6addr */ -#define IP_ADDR6(ipaddr,i0,i1,i2,i3) do { IP6_ADDR(ip_2_ip6(ipaddr),i0,i1,i2,i3); \ - IP_SET_TYPE_VAL(*(ipaddr), IPADDR_TYPE_V6); } while(0) -/** @ingroup ip6addr */ -#define IP_ADDR6_HOST(ipaddr,i0,i1,i2,i3) IP_ADDR6(ipaddr,PP_HTONL(i0),PP_HTONL(i1),PP_HTONL(i2),PP_HTONL(i3)) - -/** @ingroup ipaddr */ -#define ip_addr_copy(dest, src) do{ IP_SET_TYPE_VAL(dest, IP_GET_TYPE(&src)); if(IP_IS_V6_VAL(src)){ \ - ip6_addr_copy(*ip_2_ip6(&(dest)), *ip_2_ip6(&(src))); }else{ \ - ip4_addr_copy(*ip_2_ip4(&(dest)), *ip_2_ip4(&(src))); }}while(0) -/** @ingroup ip6addr */ -#define ip_addr_copy_from_ip6(dest, src) do{ \ - ip6_addr_copy(*ip_2_ip6(&(dest)), src); IP_SET_TYPE_VAL(dest, IPADDR_TYPE_V6); }while(0) -/** @ingroup ip4addr */ -#define ip_addr_copy_from_ip4(dest, src) do{ \ - ip4_addr_copy(*ip_2_ip4(&(dest)), src); IP_SET_TYPE_VAL(dest, IPADDR_TYPE_V4); }while(0) -/** @ingroup ip4addr */ -#define ip_addr_set_ip4_u32(ipaddr, val) do{if(ipaddr){ip4_addr_set_u32(ip_2_ip4(ipaddr), val); \ - IP_SET_TYPE(ipaddr, IPADDR_TYPE_V4); }}while(0) -/** @ingroup ip4addr */ -#define ip_addr_get_ip4_u32(ipaddr) (((ipaddr) && IP_IS_V4(ipaddr)) ? \ - ip4_addr_get_u32(ip_2_ip4(ipaddr)) : 0) -/** @ingroup ipaddr */ -#define ip_addr_set(dest, src) do{ IP_SET_TYPE(dest, IP_GET_TYPE(src)); if(IP_IS_V6(src)){ \ - ip6_addr_set(ip_2_ip6(dest), ip_2_ip6(src)); }else{ \ - ip4_addr_set(ip_2_ip4(dest), ip_2_ip4(src)); }}while(0) -/** @ingroup ipaddr */ -#define ip_addr_set_ipaddr(dest, src) ip_addr_set(dest, src) -/** @ingroup ipaddr */ -#define ip_addr_set_zero(ipaddr) do{ \ - ip6_addr_set_zero(ip_2_ip6(ipaddr)); IP_SET_TYPE(ipaddr, 0); }while(0) -/** @ingroup ip5addr */ -#define ip_addr_set_zero_ip4(ipaddr) do{ \ - ip6_addr_set_zero(ip_2_ip6(ipaddr)); IP_SET_TYPE(ipaddr, IPADDR_TYPE_V4); }while(0) -/** @ingroup ip6addr */ -#define ip_addr_set_zero_ip6(ipaddr) do{ \ - ip6_addr_set_zero(ip_2_ip6(ipaddr)); IP_SET_TYPE(ipaddr, IPADDR_TYPE_V6); }while(0) -/** @ingroup ipaddr */ -#define ip_addr_set_any(is_ipv6, ipaddr) do{if(is_ipv6){ \ - ip6_addr_set_any(ip_2_ip6(ipaddr)); IP_SET_TYPE(ipaddr, IPADDR_TYPE_V6); }else{ \ - ip4_addr_set_any(ip_2_ip4(ipaddr)); IP_SET_TYPE(ipaddr, IPADDR_TYPE_V4); }}while(0) -/** @ingroup ipaddr */ -#define ip_addr_set_loopback(is_ipv6, ipaddr) do{if(is_ipv6){ \ - ip6_addr_set_loopback(ip_2_ip6(ipaddr)); IP_SET_TYPE(ipaddr, IPADDR_TYPE_V6); }else{ \ - ip4_addr_set_loopback(ip_2_ip4(ipaddr)); IP_SET_TYPE(ipaddr, IPADDR_TYPE_V4); }}while(0) -/** @ingroup ipaddr */ -#define ip_addr_set_hton(dest, src) do{if(IP_IS_V6(src)){ \ - ip6_addr_set_hton(ip_2_ip6(ipaddr), (src)); IP_SET_TYPE(dest, IPADDR_TYPE_V6); }else{ \ - ip4_addr_set_hton(ip_2_ip4(ipaddr), (src)); IP_SET_TYPE(dest, IPADDR_TYPE_V4); }}while(0) -/** @ingroup ipaddr */ -#define ip_addr_get_network(target, host, netmask) do{if(IP_IS_V6(host)){ \ - ip4_addr_set_zero(ip_2_ip4(target)); IP_SET_TYPE(target, IPADDR_TYPE_V6); } else { \ - ip4_addr_get_network(ip_2_ip4(target), ip_2_ip4(host), ip_2_ip4(netmask)); IP_SET_TYPE(target, IPADDR_TYPE_V4); }}while(0) -/** @ingroup ipaddr */ -#define ip_addr_netcmp(addr1, addr2, mask) ((IP_IS_V6(addr1) && IP_IS_V6(addr2)) ? \ - 0 : \ - ip4_addr_netcmp(ip_2_ip4(addr1), ip_2_ip4(addr2), mask)) -/** @ingroup ipaddr */ -#define ip_addr_cmp(addr1, addr2) ((IP_GET_TYPE(addr1) != IP_GET_TYPE(addr2)) ? 0 : (IP_IS_V6_VAL(*(addr1)) ? \ - ip6_addr_cmp(ip_2_ip6(addr1), ip_2_ip6(addr2)) : \ - ip4_addr_cmp(ip_2_ip4(addr1), ip_2_ip4(addr2)))) -/** @ingroup ipaddr */ -#define ip_addr_isany(ipaddr) ((IP_IS_V6(ipaddr)) ? \ - ip6_addr_isany(ip_2_ip6(ipaddr)) : \ - ip4_addr_isany(ip_2_ip4(ipaddr))) -/** @ingroup ipaddr */ -#define ip_addr_isany_val(ipaddr) ((IP_IS_V6_VAL(ipaddr)) ? \ - ip6_addr_isany_val(*ip_2_ip6(&(ipaddr))) : \ - ip4_addr_isany_val(*ip_2_ip4(&(ipaddr)))) -/** @ingroup ipaddr */ -#define ip_addr_isbroadcast(ipaddr, netif) ((IP_IS_V6(ipaddr)) ? \ - 0 : \ - ip4_addr_isbroadcast(ip_2_ip4(ipaddr), netif)) -/** @ingroup ipaddr */ -#define ip_addr_ismulticast(ipaddr) ((IP_IS_V6(ipaddr)) ? \ - ip6_addr_ismulticast(ip_2_ip6(ipaddr)) : \ - ip4_addr_ismulticast(ip_2_ip4(ipaddr))) -/** @ingroup ipaddr */ -#define ip_addr_isloopback(ipaddr) ((IP_IS_V6(ipaddr)) ? \ - ip6_addr_isloopback(ip_2_ip6(ipaddr)) : \ - ip4_addr_isloopback(ip_2_ip4(ipaddr))) -/** @ingroup ipaddr */ -#define ip_addr_islinklocal(ipaddr) ((IP_IS_V6(ipaddr)) ? \ - ip6_addr_islinklocal(ip_2_ip6(ipaddr)) : \ - ip4_addr_islinklocal(ip_2_ip4(ipaddr))) -#define ip_addr_debug_print(debug, ipaddr) do { if(IP_IS_V6(ipaddr)) { \ - ip6_addr_debug_print(debug, ip_2_ip6(ipaddr)); } else { \ - ip4_addr_debug_print(debug, ip_2_ip4(ipaddr)); }}while(0) -#define ip_addr_debug_print_val(debug, ipaddr) do { if(IP_IS_V6_VAL(ipaddr)) { \ - ip6_addr_debug_print_val(debug, *ip_2_ip6(&(ipaddr))); } else { \ - ip4_addr_debug_print_val(debug, *ip_2_ip4(&(ipaddr))); }}while(0) -/** @ingroup ipaddr */ -#define ipaddr_ntoa(addr) (((addr) == NULL) ? "NULL" : \ - ((IP_IS_V6(addr)) ? ip6addr_ntoa(ip_2_ip6(addr)) : ip4addr_ntoa(ip_2_ip4(addr)))) -/** @ingroup ipaddr */ -#define ipaddr_ntoa_r(addr, buf, buflen) (((addr) == NULL) ? "NULL" : \ - ((IP_IS_V6(addr)) ? ip6addr_ntoa_r(ip_2_ip6(addr), buf, buflen) : ip4addr_ntoa_r(ip_2_ip4(addr), buf, buflen))) -int ipaddr_aton(const char *cp, ip_addr_t *addr); - -/** @ingroup ipaddr */ -#define IPADDR_STRLEN_MAX IP6ADDR_STRLEN_MAX - -/** @ingroup ipaddr */ -#define ip4_2_ipv4_mapped_ipv6(ip6addr, ip4addr) do { \ - (ip6addr)->addr[3] = (ip4addr)->addr; \ - (ip6addr)->addr[2] = PP_HTONL(0x0000FFFFUL); \ - (ip6addr)->addr[1] = 0; \ - (ip6addr)->addr[0] = 0; } while(0); - -/** @ingroup ipaddr */ -#define unmap_ipv4_mapped_ipv6(ip4addr, ip6addr) \ - (ip4addr)->addr = (ip6addr)->addr[3]; - -#define IP46_ADDR_ANY(type) (((type) == IPADDR_TYPE_V6)? IP6_ADDR_ANY : IP4_ADDR_ANY) - -#else /* LWIP_IPV4 && LWIP_IPV6 */ - -#define IP_ADDR_PCB_VERSION_MATCH(addr, pcb) 1 -#define IP_ADDR_PCB_VERSION_MATCH_EXACT(pcb, ipaddr) 1 - -#if LWIP_IPV4 - -typedef ip4_addr_t ip_addr_t; -#define IPADDR4_INIT(u32val) { u32val } -#define IPADDR4_INIT_BYTES(a,b,c,d) IPADDR4_INIT(PP_HTONL(LWIP_MAKEU32(a,b,c,d))) -#define IP_IS_V4_VAL(ipaddr) 1 -#define IP_IS_V6_VAL(ipaddr) 0 -#define IP_IS_V4(ipaddr) 1 -#define IP_IS_V6(ipaddr) 0 -#define IP_IS_ANY_TYPE_VAL(ipaddr) 0 -#define IP_SET_TYPE_VAL(ipaddr, iptype) -#define IP_SET_TYPE(ipaddr, iptype) -#define IP_GET_TYPE(ipaddr) IPADDR_TYPE_V4 -#define ip_2_ip4(ipaddr) (ipaddr) -#define IP_ADDR4(ipaddr,a,b,c,d) IP4_ADDR(ipaddr,a,b,c,d) - -#define ip_addr_copy(dest, src) ip4_addr_copy(dest, src) -#define ip_addr_copy_from_ip4(dest, src) ip4_addr_copy(dest, src) -#define ip_addr_set_ip4_u32(ipaddr, val) ip4_addr_set_u32(ip_2_ip4(ipaddr), val) -#define ip_addr_get_ip4_u32(ipaddr) ip4_addr_get_u32(ip_2_ip4(ipaddr)) -#define ip_addr_set(dest, src) ip4_addr_set(dest, src) -#define ip_addr_set_ipaddr(dest, src) ip4_addr_set(dest, src) -#define ip_addr_set_zero(ipaddr) ip4_addr_set_zero(ipaddr) -#define ip_addr_set_zero_ip4(ipaddr) ip4_addr_set_zero(ipaddr) -#define ip_addr_set_any(is_ipv6, ipaddr) ip4_addr_set_any(ipaddr) -#define ip_addr_set_loopback(is_ipv6, ipaddr) ip4_addr_set_loopback(ipaddr) -#define ip_addr_set_hton(dest, src) ip4_addr_set_hton(dest, src) -#define ip_addr_get_network(target, host, mask) ip4_addr_get_network(target, host, mask) -#define ip_addr_netcmp(addr1, addr2, mask) ip4_addr_netcmp(addr1, addr2, mask) -#define ip_addr_cmp(addr1, addr2) ip4_addr_cmp(addr1, addr2) -#define ip_addr_isany(ipaddr) ip4_addr_isany(ipaddr) -#define ip_addr_isany_val(ipaddr) ip4_addr_isany_val(ipaddr) -#define ip_addr_isloopback(ipaddr) ip4_addr_isloopback(ipaddr) -#define ip_addr_islinklocal(ipaddr) ip4_addr_islinklocal(ipaddr) -#define ip_addr_isbroadcast(addr, netif) ip4_addr_isbroadcast(addr, netif) -#define ip_addr_ismulticast(ipaddr) ip4_addr_ismulticast(ipaddr) -#define ip_addr_debug_print(debug, ipaddr) ip4_addr_debug_print(debug, ipaddr) -#define ip_addr_debug_print_val(debug, ipaddr) ip4_addr_debug_print_val(debug, ipaddr) -#define ipaddr_ntoa(ipaddr) ip4addr_ntoa(ipaddr) -#define ipaddr_ntoa_r(ipaddr, buf, buflen) ip4addr_ntoa_r(ipaddr, buf, buflen) -#define ipaddr_aton(cp, addr) ip4addr_aton(cp, addr) - -#define IPADDR_STRLEN_MAX IP4ADDR_STRLEN_MAX - -#define IP46_ADDR_ANY(type) (IP4_ADDR_ANY) - -#else /* LWIP_IPV4 */ - -typedef ip6_addr_t ip_addr_t; -#define IPADDR6_INIT(a, b, c, d) { { a, b, c, d } } -#define IPADDR6_INIT_HOST(a, b, c, d) { { PP_HTONL(a), PP_HTONL(b), PP_HTONL(c), PP_HTONL(d) } } -#define IP_IS_V4_VAL(ipaddr) 0 -#define IP_IS_V6_VAL(ipaddr) 1 -#define IP_IS_V4(ipaddr) 0 -#define IP_IS_V6(ipaddr) 1 -#define IP_IS_ANY_TYPE_VAL(ipaddr) 0 -#define IP_SET_TYPE_VAL(ipaddr, iptype) -#define IP_SET_TYPE(ipaddr, iptype) -#define IP_GET_TYPE(ipaddr) IPADDR_TYPE_V6 -#define ip_2_ip6(ipaddr) (ipaddr) -#define IP_ADDR6(ipaddr,i0,i1,i2,i3) IP6_ADDR(ipaddr,i0,i1,i2,i3) -#define IP_ADDR6_HOST(ipaddr,i0,i1,i2,i3) IP_ADDR6(ipaddr,PP_HTONL(i0),PP_HTONL(i1),PP_HTONL(i2),PP_HTONL(i3)) - -#define ip_addr_copy(dest, src) ip6_addr_copy(dest, src) -#define ip_addr_copy_from_ip6(dest, src) ip6_addr_copy(dest, src) -#define ip_addr_set(dest, src) ip6_addr_set(dest, src) -#define ip_addr_set_ipaddr(dest, src) ip6_addr_set(dest, src) -#define ip_addr_set_zero(ipaddr) ip6_addr_set_zero(ipaddr) -#define ip_addr_set_zero_ip6(ipaddr) ip6_addr_set_zero(ipaddr) -#define ip_addr_set_any(is_ipv6, ipaddr) ip6_addr_set_any(ipaddr) -#define ip_addr_set_loopback(is_ipv6, ipaddr) ip6_addr_set_loopback(ipaddr) -#define ip_addr_set_hton(dest, src) ip6_addr_set_hton(dest, src) -#define ip_addr_get_network(target, host, mask) ip6_addr_set_zero(target) -#define ip_addr_netcmp(addr1, addr2, mask) 0 -#define ip_addr_cmp(addr1, addr2) ip6_addr_cmp(addr1, addr2) -#define ip_addr_isany(ipaddr) ip6_addr_isany(ipaddr) -#define ip_addr_isany_val(ipaddr) ip6_addr_isany_val(ipaddr) -#define ip_addr_isloopback(ipaddr) ip6_addr_isloopback(ipaddr) -#define ip_addr_islinklocal(ipaddr) ip6_addr_islinklocal(ipaddr) -#define ip_addr_isbroadcast(addr, netif) 0 -#define ip_addr_ismulticast(ipaddr) ip6_addr_ismulticast(ipaddr) -#define ip_addr_debug_print(debug, ipaddr) ip6_addr_debug_print(debug, ipaddr) -#define ip_addr_debug_print_val(debug, ipaddr) ip6_addr_debug_print_val(debug, ipaddr) -#define ipaddr_ntoa(ipaddr) ip6addr_ntoa(ipaddr) -#define ipaddr_ntoa_r(ipaddr, buf, buflen) ip6addr_ntoa_r(ipaddr, buf, buflen) -#define ipaddr_aton(cp, addr) ip6addr_aton(cp, addr) - -#define IPADDR_STRLEN_MAX IP6ADDR_STRLEN_MAX - -#define IP46_ADDR_ANY(type) (IP6_ADDR_ANY) - -#endif /* LWIP_IPV4 */ -#endif /* LWIP_IPV4 && LWIP_IPV6 */ - -#if LWIP_IPV4 - -extern const ip_addr_t ip_addr_any; -extern const ip_addr_t ip_addr_broadcast; - -/** - * @ingroup ip4addr - * Can be used as a fixed/const ip_addr_t - * for the IP wildcard. - * Defined to @ref IP4_ADDR_ANY when IPv4 is enabled. - * Defined to @ref IP6_ADDR_ANY in IPv6 only systems. - * Use this if you can handle IPv4 _AND_ IPv6 addresses. - * Use @ref IP4_ADDR_ANY or @ref IP6_ADDR_ANY when the IP - * type matters. - */ -#define IP_ADDR_ANY IP4_ADDR_ANY -/** - * @ingroup ip4addr - * Can be used as a fixed/const ip_addr_t - * for the IPv4 wildcard and the broadcast address - */ -#define IP4_ADDR_ANY (&ip_addr_any) -/** - * @ingroup ip4addr - * Can be used as a fixed/const ip4_addr_t - * for the wildcard and the broadcast address - */ -#define IP4_ADDR_ANY4 (ip_2_ip4(&ip_addr_any)) - -/** @ingroup ip4addr */ -#define IP_ADDR_BROADCAST (&ip_addr_broadcast) -/** @ingroup ip4addr */ -#define IP4_ADDR_BROADCAST (ip_2_ip4(&ip_addr_broadcast)) - -#endif /* LWIP_IPV4*/ - -#if LWIP_IPV6 - -extern const ip_addr_t ip6_addr_any; - -/** - * @ingroup ip6addr - * IP6_ADDR_ANY can be used as a fixed ip_addr_t - * for the IPv6 wildcard address - */ -#define IP6_ADDR_ANY (&ip6_addr_any) -/** - * @ingroup ip6addr - * IP6_ADDR_ANY6 can be used as a fixed ip6_addr_t - * for the IPv6 wildcard address - */ -#define IP6_ADDR_ANY6 (ip_2_ip6(&ip6_addr_any)) - -#if !LWIP_IPV4 -/** IPv6-only configurations */ -#define IP_ADDR_ANY IP6_ADDR_ANY -#endif /* !LWIP_IPV4 */ - -#endif - -#if LWIP_IPV4 && LWIP_IPV6 -/** @ingroup ipaddr */ -#define IP_ANY_TYPE (&ip_addr_any_type) -#else -#define IP_ANY_TYPE IP_ADDR_ANY -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_IP_ADDR_H */ diff --git a/tools/sdk/include/lwip/lwip/mem.h b/tools/sdk/include/lwip/lwip/mem.h deleted file mode 100644 index ff208d25c32..00000000000 --- a/tools/sdk/include/lwip/lwip/mem.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - * @file - * Heap API - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_MEM_H -#define LWIP_HDR_MEM_H - -#include "lwip/opt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if MEM_LIBC_MALLOC - -#include "lwip/arch.h" - -typedef size_t mem_size_t; -#define MEM_SIZE_F SZT_F - -#elif MEM_USE_POOLS - -typedef u16_t mem_size_t; -#define MEM_SIZE_F U16_F - -#else - -/* MEM_SIZE would have to be aligned, but using 64000 here instead of - * 65535 leaves some room for alignment... - */ -#if MEM_SIZE > 64000L -typedef u32_t mem_size_t; -#define MEM_SIZE_F U32_F -#else -typedef u16_t mem_size_t; -#define MEM_SIZE_F U16_F -#endif /* MEM_SIZE > 64000 */ -#endif - -void mem_init(void); -void *mem_trim(void *mem, mem_size_t size); -void *mem_malloc(mem_size_t size); -void *mem_calloc(mem_size_t count, mem_size_t size); -void mem_free(void *mem); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_MEM_H */ diff --git a/tools/sdk/include/lwip/lwip/memp.h b/tools/sdk/include/lwip/lwip/memp.h deleted file mode 100644 index 562cd05bffd..00000000000 --- a/tools/sdk/include/lwip/lwip/memp.h +++ /dev/null @@ -1,155 +0,0 @@ -/** - * @file - * Memory pool API - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ - -#ifndef LWIP_HDR_MEMP_H -#define LWIP_HDR_MEMP_H - -#include "lwip/opt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* run once with empty definition to handle all custom includes in lwippools.h */ -#define LWIP_MEMPOOL(name,num,size,desc) -#include "lwip/priv/memp_std.h" - -/** Create the list of all memory pools managed by memp. MEMP_MAX represents a NULL pool at the end */ -typedef enum { -#define LWIP_MEMPOOL(name,num,size,desc) MEMP_##name, -#include "lwip/priv/memp_std.h" - MEMP_MAX -} memp_t; - -#include "lwip/priv/memp_priv.h" -#include "lwip/stats.h" - -extern const struct memp_desc* const memp_pools[MEMP_MAX]; - -/** - * @ingroup mempool - * Declare prototype for private memory pool if it is used in multiple files - */ -#define LWIP_MEMPOOL_PROTOTYPE(name) extern const struct memp_desc memp_ ## name - -#if MEMP_MEM_MALLOC - -#define LWIP_MEMPOOL_DECLARE(name,num,size,desc) \ - LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(memp_stats_ ## name) \ - const struct memp_desc memp_ ## name = { \ - DECLARE_LWIP_MEMPOOL_DESC(desc) \ - LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(memp_stats_ ## name) \ - LWIP_MEM_ALIGN_SIZE(size) \ - }; - -#else /* MEMP_MEM_MALLOC */ - -/** - * @ingroup mempool - * Declare a private memory pool - * Private mempools example: - * .h: only when pool is used in multiple .c files: LWIP_MEMPOOL_PROTOTYPE(my_private_pool); - * .c: - * - in global variables section: LWIP_MEMPOOL_DECLARE(my_private_pool, 10, sizeof(foo), "Some description") - * - call ONCE before using pool (e.g. in some init() function): LWIP_MEMPOOL_INIT(my_private_pool); - * - allocate: void* my_new_mem = LWIP_MEMPOOL_ALLOC(my_private_pool); - * - free: LWIP_MEMPOOL_FREE(my_private_pool, my_new_mem); - * - * To relocate a pool, declare it as extern in cc.h. Example for GCC: - * extern u8_t __attribute__((section(".onchip_mem"))) memp_memory_my_private_pool[]; - */ -#define LWIP_MEMPOOL_DECLARE(name,num,size,desc) \ - LWIP_DECLARE_MEMORY_ALIGNED(memp_memory_ ## name ## _base, ((num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size)))); \ - \ - LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(memp_stats_ ## name) \ - \ - static struct memp *memp_tab_ ## name; \ - \ - const struct memp_desc memp_ ## name = { \ - DECLARE_LWIP_MEMPOOL_DESC(desc) \ - LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(memp_stats_ ## name) \ - LWIP_MEM_ALIGN_SIZE(size), \ - (num), \ - memp_memory_ ## name ## _base, \ - &memp_tab_ ## name \ - }; - -#endif /* MEMP_MEM_MALLOC */ - -/** - * @ingroup mempool - * Initialize a private memory pool - */ -#define LWIP_MEMPOOL_INIT(name) memp_init_pool(&memp_ ## name) -/** - * @ingroup mempool - * Allocate from a private memory pool - */ -#define LWIP_MEMPOOL_ALLOC(name) memp_malloc_pool(&memp_ ## name) -/** - * @ingroup mempool - * Free element from a private memory pool - */ -#define LWIP_MEMPOOL_FREE(name, x) memp_free_pool(&memp_ ## name, (x)) - -#if MEM_USE_POOLS -/** This structure is used to save the pool one element came from. - * This has to be defined here as it is required for pool size calculation. */ -struct memp_malloc_helper -{ - memp_t poolnr; -#if MEMP_OVERFLOW_CHECK || (LWIP_STATS && MEM_STATS) - u16_t size; -#endif /* MEMP_OVERFLOW_CHECK || (LWIP_STATS && MEM_STATS) */ -}; -#endif /* MEM_USE_POOLS */ - -void memp_init(void); - -#if MEMP_OVERFLOW_CHECK -void *memp_malloc_fn(memp_t type, const char* file, const int line); -#define memp_malloc(t) memp_malloc_fn((t), __FILE__, __LINE__) -#else -void *memp_malloc(memp_t type); -#endif -void memp_free(memp_t type, void *mem); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_MEMP_H */ diff --git a/tools/sdk/include/lwip/lwip/mld6.h b/tools/sdk/include/lwip/lwip/mld6.h deleted file mode 100644 index 7fa0797f272..00000000000 --- a/tools/sdk/include/lwip/lwip/mld6.h +++ /dev/null @@ -1,99 +0,0 @@ -/** - * @file - * - * Multicast listener discovery for IPv6. Aims to be compliant with RFC 2710. - * No support for MLDv2. - */ - -/* - * Copyright (c) 2010 Inico Technologies Ltd. - * All rights reserved. - * - * 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: Ivan Delamer - * - * - * Please coordinate changes and requests with Ivan Delamer - * - */ - -#ifndef LWIP_HDR_MLD6_H -#define LWIP_HDR_MLD6_H - -#include "lwip/opt.h" - -#if LWIP_IPV6_MLD && LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/pbuf.h" -#include "lwip/netif.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** MLD group */ -struct mld_group { - /** next link */ - struct mld_group *next; - /** multicast address */ - ip6_addr_t group_address; - /** signifies we were the last person to report */ - u8_t last_reporter_flag; - /** current state of the group */ - u8_t group_state; - /** timer for reporting */ - u16_t timer; - /** counter of simultaneous uses */ - u8_t use; -}; - -#define MLD6_TMR_INTERVAL 100 /* Milliseconds */ - -err_t mld6_stop(struct netif *netif); -void mld6_report_groups(struct netif *netif); -void mld6_tmr(void); -struct mld_group *mld6_lookfor_group(struct netif *ifp, const ip6_addr_t *addr); -void mld6_input(struct pbuf *p, struct netif *inp); -err_t mld6_joingroup(const ip6_addr_t *srcaddr, const ip6_addr_t *groupaddr); -err_t mld6_joingroup_netif(struct netif *netif, const ip6_addr_t *groupaddr); -err_t mld6_leavegroup(const ip6_addr_t *srcaddr, const ip6_addr_t *groupaddr); -err_t mld6_leavegroup_netif(struct netif *netif, const ip6_addr_t *groupaddr); - -/** @ingroup mld6 - * Get list head of MLD6 groups for netif. - * Note: The allnodes group IP is NOT in the list, since it must always - * be received for correct IPv6 operation. - * @see @ref netif_set_mld_mac_filter() - */ -#define netif_mld6_data(netif) ((struct mld_group *)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_MLD6)) - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_IPV6_MLD && LWIP_IPV6 */ - -#endif /* LWIP_HDR_MLD6_H */ diff --git a/tools/sdk/include/lwip/lwip/nd6.h b/tools/sdk/include/lwip/lwip/nd6.h deleted file mode 100644 index d9fba970729..00000000000 --- a/tools/sdk/include/lwip/lwip/nd6.h +++ /dev/null @@ -1,89 +0,0 @@ -/** - * @file - * - * Neighbor discovery and stateless address autoconfiguration for IPv6. - * Aims to be compliant with RFC 4861 (Neighbor discovery) and RFC 4862 - * (Address autoconfiguration). - */ - -/* - * Copyright (c) 2010 Inico Technologies Ltd. - * All rights reserved. - * - * 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: Ivan Delamer - * - * - * Please coordinate changes and requests with Ivan Delamer - * - */ - -#ifndef LWIP_HDR_ND6_H -#define LWIP_HDR_ND6_H - -#include "lwip/opt.h" - -#if LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/ip6_addr.h" -#include "lwip/err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** 1 second period */ -#define ND6_TMR_INTERVAL 1000 - -struct pbuf; -struct netif; - -void nd6_tmr(void); -void nd6_input(struct pbuf *p, struct netif *inp); -void nd6_clear_destination_cache(void); -struct netif *nd6_find_route(const ip6_addr_t *ip6addr); -err_t nd6_get_next_hop_addr_or_queue(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr, const u8_t **hwaddrp); -u16_t nd6_get_destination_mtu(const ip6_addr_t *ip6addr, struct netif *netif); -#if LWIP_ND6_TCP_REACHABILITY_HINTS -void nd6_reachability_hint(const ip6_addr_t *ip6addr); -#endif /* LWIP_ND6_TCP_REACHABILITY_HINTS */ -void nd6_cleanup_netif(struct netif *netif); -#if LWIP_IPV6_MLD -void nd6_adjust_mld_membership(struct netif *netif, s8_t addr_idx, u8_t new_state); -#endif /* LWIP_IPV6_MLD */ - -#if ESP_LWIP -/** set nd6 callback when ipv6 addr state pref*/ -void nd6_set_cb(struct netif *netif, void (*cb)(struct netif *netif, u8_t ip_index)); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_IPV6 */ - -#endif /* LWIP_HDR_ND6_H */ diff --git a/tools/sdk/include/lwip/lwip/netbuf.h b/tools/sdk/include/lwip/lwip/netbuf.h deleted file mode 100644 index e6865f80f94..00000000000 --- a/tools/sdk/include/lwip/lwip/netbuf.h +++ /dev/null @@ -1,118 +0,0 @@ -/** - * @file - * netbuf API (for netconn API) - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_NETBUF_H -#define LWIP_HDR_NETBUF_H - -#include "lwip/opt.h" - -#if LWIP_NETCONN || LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */ -/* Note: Netconn API is always available when sockets are enabled - - * sockets are implemented on top of them */ - -#include "lwip/pbuf.h" -#include "lwip/ip_addr.h" -#include "lwip/ip6_addr.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** This netbuf has dest-addr/port set */ -#define NETBUF_FLAG_DESTADDR 0x01 -/** This netbuf includes a checksum */ -#define NETBUF_FLAG_CHKSUM 0x02 - -/** "Network buffer" - contains data and addressing info */ -struct netbuf { - struct pbuf *p, *ptr; - ip_addr_t addr; - u16_t port; -#if LWIP_NETBUF_RECVINFO || LWIP_CHECKSUM_ON_COPY -#if LWIP_CHECKSUM_ON_COPY - u8_t flags; -#endif /* LWIP_CHECKSUM_ON_COPY */ - u16_t toport_chksum; -#if LWIP_NETBUF_RECVINFO - ip_addr_t toaddr; -#endif /* LWIP_NETBUF_RECVINFO */ -#endif /* LWIP_NETBUF_RECVINFO || LWIP_CHECKSUM_ON_COPY */ -}; - -/* Network buffer functions: */ -struct netbuf * netbuf_new (void); -void netbuf_delete (struct netbuf *buf); -void * netbuf_alloc (struct netbuf *buf, u16_t size); -void netbuf_free (struct netbuf *buf); -err_t netbuf_ref (struct netbuf *buf, - const void *dataptr, u16_t size); -void netbuf_chain (struct netbuf *head, struct netbuf *tail); - -err_t netbuf_data (struct netbuf *buf, - void **dataptr, u16_t *len); -s8_t netbuf_next (struct netbuf *buf); -void netbuf_first (struct netbuf *buf); - - -#define netbuf_copy_partial(buf, dataptr, len, offset) \ - pbuf_copy_partial((buf)->p, (dataptr), (len), (offset)) -#define netbuf_copy(buf,dataptr,len) netbuf_copy_partial(buf, dataptr, len, 0) -#define netbuf_take(buf, dataptr, len) pbuf_take((buf)->p, dataptr, len) -#define netbuf_len(buf) ((buf)->p->tot_len) -#define netbuf_fromaddr(buf) (&((buf)->addr)) -#define netbuf_set_fromaddr(buf, fromaddr) ip_addr_set(&((buf)->addr), fromaddr) -#define netbuf_fromport(buf) ((buf)->port) -#if LWIP_NETBUF_RECVINFO -#define netbuf_destaddr(buf) (&((buf)->toaddr)) -#define netbuf_set_destaddr(buf, destaddr) ip_addr_set(&((buf)->toaddr), destaddr) -#if LWIP_CHECKSUM_ON_COPY -#define netbuf_destport(buf) (((buf)->flags & NETBUF_FLAG_DESTADDR) ? (buf)->toport_chksum : 0) -#else /* LWIP_CHECKSUM_ON_COPY */ -#define netbuf_destport(buf) ((buf)->toport_chksum) -#endif /* LWIP_CHECKSUM_ON_COPY */ -#endif /* LWIP_NETBUF_RECVINFO */ -#if LWIP_CHECKSUM_ON_COPY -#define netbuf_set_chksum(buf, chksum) do { (buf)->flags = NETBUF_FLAG_CHKSUM; \ - (buf)->toport_chksum = chksum; } while(0) -#endif /* LWIP_CHECKSUM_ON_COPY */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_NETCONN || LWIP_SOCKET */ - -#endif /* LWIP_HDR_NETBUF_H */ diff --git a/tools/sdk/include/lwip/lwip/netdb.h b/tools/sdk/include/lwip/lwip/netdb.h deleted file mode 100644 index e0b07accc9d..00000000000 --- a/tools/sdk/include/lwip/lwip/netdb.h +++ /dev/null @@ -1,181 +0,0 @@ -/** - * @file - * NETDB API (sockets) - */ - -/* - * 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 - * - */ -#ifndef LWIP_HDR_NETDB_H -#define LWIP_HDR_NETDB_H - -#include "lwip/opt.h" - -#if LWIP_DNS && LWIP_SOCKET - -#include "lwip/arch.h" -#include "lwip/inet.h" -#include "lwip/sockets.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* some rarely used options */ -#ifndef LWIP_DNS_API_DECLARE_H_ERRNO -#define LWIP_DNS_API_DECLARE_H_ERRNO 1 -#endif - -#ifndef LWIP_DNS_API_DEFINE_ERRORS -#define LWIP_DNS_API_DEFINE_ERRORS 1 -#endif - -#ifndef LWIP_DNS_API_DEFINE_FLAGS -#define LWIP_DNS_API_DEFINE_FLAGS 1 -#endif - -#ifndef LWIP_DNS_API_DECLARE_STRUCTS -#define LWIP_DNS_API_DECLARE_STRUCTS 1 -#endif - -#if LWIP_DNS_API_DEFINE_ERRORS -/** Errors used by the DNS API functions, h_errno can be one of them */ -#define EAI_NONAME 200 -#define EAI_SERVICE 201 -#define EAI_FAIL 202 -#define EAI_MEMORY 203 -#define EAI_FAMILY 204 - -#define HOST_NOT_FOUND 210 -#define NO_DATA 211 -#define NO_RECOVERY 212 -#define TRY_AGAIN 213 -#endif /* LWIP_DNS_API_DEFINE_ERRORS */ - -#if LWIP_DNS_API_DEFINE_FLAGS -/* input flags for struct addrinfo */ -#define AI_PASSIVE 0x01 -#define AI_CANONNAME 0x02 -#define AI_NUMERICHOST 0x04 -#define AI_NUMERICSERV 0x08 -#define AI_V4MAPPED 0x10 -#define AI_ALL 0x20 -#define AI_ADDRCONFIG 0x40 -#endif /* LWIP_DNS_API_DEFINE_FLAGS */ - -#if LWIP_DNS_API_DECLARE_STRUCTS -struct hostent { - char *h_name; /* Official name of the host. */ - char **h_aliases; /* A pointer to an array of pointers to alternative host names, - terminated by a null pointer. */ - int h_addrtype; /* Address type. */ - int h_length; /* The length, in bytes, of the address. */ - char **h_addr_list; /* A pointer to an array of pointers to network addresses (in - network byte order) for the host, terminated by a null pointer. */ -#define h_addr h_addr_list[0] /* for backward compatibility */ -}; - -struct addrinfo { - int ai_flags; /* Input flags. */ - int ai_family; /* Address family of socket. */ - int ai_socktype; /* Socket type. */ - int ai_protocol; /* Protocol of socket. */ - socklen_t ai_addrlen; /* Length of socket address. */ - struct sockaddr *ai_addr; /* Socket address of socket. */ - char *ai_canonname; /* Canonical name of service location. */ - struct addrinfo *ai_next; /* Pointer to next in list. */ -}; -#endif /* LWIP_DNS_API_DECLARE_STRUCTS */ - -#define NETDB_ELEM_SIZE (sizeof(struct addrinfo) + sizeof(struct sockaddr_storage) + DNS_MAX_NAME_LENGTH + 1) - -#if LWIP_DNS_API_DECLARE_H_ERRNO -/* application accessible error code set by the DNS API functions */ -extern int h_errno; -#endif /* LWIP_DNS_API_DECLARE_H_ERRNO*/ - -struct hostent *lwip_gethostbyname(const char *name); -int lwip_gethostbyname_r(const char *name, struct hostent *ret, char *buf, - size_t buflen, struct hostent **result, int *h_errnop); -void lwip_freeaddrinfo(struct addrinfo *ai); -int lwip_getaddrinfo(const char *nodename, - const char *servname, - const struct addrinfo *hints, - struct addrinfo **res); - -#if LWIP_COMPAT_SOCKETS -#if ESP_LWIP -#if LWIP_COMPAT_SOCKET_ADDR == 1 -/* Some libraries have problems with inet_... being macros, so please use this define - to declare normal functions */ -static inline int gethostbyname_r(const char *name, struct hostent *ret, char *buf, size_t buflen, struct hostent **result, int *h_errnop) -{ return lwip_gethostbyname_r(name, ret, buf, buflen, result, h_errnop); } -static inline struct hostent *gethostbyname(const char *name) -{ return lwip_gethostbyname(name); } -static inline void freeaddrinfo(struct addrinfo *ai) -{ lwip_freeaddrinfo(ai); } -static inline int getaddrinfo(const char *nodename, const char *servname, const struct addrinfo *hints, struct addrinfo **res) -{ return lwip_getaddrinfo(nodename, servname, hints, res); } -#else -/* By default fall back to original inet_... macros */ - -/** @ingroup netdbapi */ -#define gethostbyname(name) lwip_gethostbyname(name) -/** @ingroup netdbapi */ -#define gethostbyname_r(name, ret, buf, buflen, result, h_errnop) \ - lwip_gethostbyname_r(name, ret, buf, buflen, result, h_errnop) -/** @ingroup netdbapi */ -#define freeaddrinfo(addrinfo) lwip_freeaddrinfo(addrinfo) -/** @ingroup netdbapi */ -#define getaddrinfo(nodname, servname, hints, res) \ - lwip_getaddrinfo(nodname, servname, hints, res) -#endif /* LWIP_COMPAT_SOCKET_ADDR == 1 */ - -#else /* ESP_LWIP */ - -/** @ingroup netdbapi */ -#define gethostbyname(name) lwip_gethostbyname(name) -/** @ingroup netdbapi */ -#define gethostbyname_r(name, ret, buf, buflen, result, h_errnop) \ - lwip_gethostbyname_r(name, ret, buf, buflen, result, h_errnop) -/** @ingroup netdbapi */ -#define freeaddrinfo(addrinfo) lwip_freeaddrinfo(addrinfo) -/** @ingroup netdbapi */ -#define getaddrinfo(nodname, servname, hints, res) \ - lwip_getaddrinfo(nodname, servname, hints, res) - -#endif /* ESP_LWIP */ -#endif /* LWIP_COMPAT_SOCKETS */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_DNS && LWIP_SOCKET */ - -#endif /* LWIP_HDR_NETDB_H */ diff --git a/tools/sdk/include/lwip/lwip/netif.h b/tools/sdk/include/lwip/lwip/netif.h deleted file mode 100644 index bcc9c5b1d0b..00000000000 --- a/tools/sdk/include/lwip/lwip/netif.h +++ /dev/null @@ -1,508 +0,0 @@ -/** - * @file - * netif API (to be used from TCPIP thread) - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_NETIF_H -#define LWIP_HDR_NETIF_H - -#include "lwip/opt.h" - -#define ENABLE_LOOPBACK (LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF) - -#include "lwip/err.h" - -#include "lwip/ip_addr.h" - -#include "lwip/def.h" -#include "lwip/pbuf.h" -#include "lwip/stats.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Throughout this file, IP addresses are expected to be in - * the same byte order as in IP_PCB. */ - -/** Must be the maximum of all used hardware address lengths - across all types of interfaces in use. - This does not have to be changed, normally. */ -#ifndef NETIF_MAX_HWADDR_LEN -#define NETIF_MAX_HWADDR_LEN 6U -#endif - -/** - * @defgroup netif_flags Flags - * @ingroup netif - * @{ - */ - -/** Whether the network interface is 'up'. This is - * a software flag used to control whether this network - * interface is enabled and processes traffic. - * It must be set by the startup code before this netif can be used - * (also for dhcp/autoip). - */ -#define NETIF_FLAG_UP 0x01U -/** If set, the netif has broadcast capability. - * Set by the netif driver in its init function. */ -#define NETIF_FLAG_BROADCAST 0x02U -/** If set, the interface has an active link - * (set by the network interface driver). - * Either set by the netif driver in its init function (if the link - * is up at that time) or at a later point once the link comes up - * (if link detection is supported by the hardware). */ -#define NETIF_FLAG_LINK_UP 0x04U -/** If set, the netif is an ethernet device using ARP. - * Set by the netif driver in its init function. - * Used to check input packet types and use of DHCP. */ -#define NETIF_FLAG_ETHARP 0x08U -/** If set, the netif is an ethernet device. It might not use - * ARP or TCP/IP if it is used for PPPoE only. - */ -#define NETIF_FLAG_ETHERNET 0x10U -/** If set, the netif has IGMP capability. - * Set by the netif driver in its init function. */ -#define NETIF_FLAG_IGMP 0x20U -/** If set, the netif has MLD6 capability. - * Set by the netif driver in its init function. */ -#define NETIF_FLAG_MLD6 0x40U - -#if ESP_GRATUITOUS_ARP -/** If set, the netif will send gratuitous ARP periodically */ -#define NETIF_FLAG_GARP 0x80U -#endif - -/** - * @} - */ - -enum lwip_internal_netif_client_data_index -{ -#if LWIP_DHCP - LWIP_NETIF_CLIENT_DATA_INDEX_DHCP, -#endif -#if LWIP_AUTOIP - LWIP_NETIF_CLIENT_DATA_INDEX_AUTOIP, -#endif -#if LWIP_IGMP - LWIP_NETIF_CLIENT_DATA_INDEX_IGMP, -#endif -#if LWIP_IPV6_MLD - LWIP_NETIF_CLIENT_DATA_INDEX_MLD6, -#endif - LWIP_NETIF_CLIENT_DATA_INDEX_MAX -}; - -#if LWIP_CHECKSUM_CTRL_PER_NETIF -#define NETIF_CHECKSUM_GEN_IP 0x0001 -#define NETIF_CHECKSUM_GEN_UDP 0x0002 -#define NETIF_CHECKSUM_GEN_TCP 0x0004 -#define NETIF_CHECKSUM_GEN_ICMP 0x0008 -#define NETIF_CHECKSUM_GEN_ICMP6 0x0010 -#define NETIF_CHECKSUM_CHECK_IP 0x0100 -#define NETIF_CHECKSUM_CHECK_UDP 0x0200 -#define NETIF_CHECKSUM_CHECK_TCP 0x0400 -#define NETIF_CHECKSUM_CHECK_ICMP 0x0800 -#define NETIF_CHECKSUM_CHECK_ICMP6 0x1000 -#define NETIF_CHECKSUM_ENABLE_ALL 0xFFFF -#define NETIF_CHECKSUM_DISABLE_ALL 0x0000 -#endif /* LWIP_CHECKSUM_CTRL_PER_NETIF */ - -struct netif; - -/** MAC Filter Actions, these are passed to a netif's igmp_mac_filter or - * mld_mac_filter callback function. */ -enum netif_mac_filter_action { - /** Delete a filter entry */ - NETIF_DEL_MAC_FILTER = 0, - /** Add a filter entry */ - NETIF_ADD_MAC_FILTER = 1 -}; - -/** Function prototype for netif init functions. Set up flags and output/linkoutput - * callback functions in this function. - * - * @param netif The netif to initialize - */ -typedef err_t (*netif_init_fn)(struct netif *netif); -/** Function prototype for netif->input functions. This function is saved as 'input' - * callback function in the netif struct. Call it when a packet has been received. - * - * @param p The received packet, copied into a pbuf - * @param inp The netif which received the packet - */ -typedef err_t (*netif_input_fn)(struct pbuf *p, struct netif *inp); - -#if LWIP_IPV4 -/** Function prototype for netif->output functions. Called by lwIP when a packet - * shall be sent. For ethernet netif, set this to 'etharp_output' and set - * 'linkoutput'. - * - * @param netif The netif which shall send a packet - * @param p The packet to send (p->payload points to IP header) - * @param ipaddr The IP address to which the packet shall be sent - */ -typedef err_t (*netif_output_fn)(struct netif *netif, struct pbuf *p, - const ip4_addr_t *ipaddr); -#endif /* LWIP_IPV4*/ - -#if LWIP_IPV6 -/** Function prototype for netif->output_ip6 functions. Called by lwIP when a packet - * shall be sent. For ethernet netif, set this to 'ethip6_output' and set - * 'linkoutput'. - * - * @param netif The netif which shall send a packet - * @param p The packet to send (p->payload points to IP header) - * @param ipaddr The IPv6 address to which the packet shall be sent - */ -typedef err_t (*netif_output_ip6_fn)(struct netif *netif, struct pbuf *p, - const ip6_addr_t *ipaddr); -#endif /* LWIP_IPV6 */ - -/** Function prototype for netif->linkoutput functions. Only used for ethernet - * netifs. This function is called by ARP when a packet shall be sent. - * - * @param netif The netif which shall send a packet - * @param p The packet to send (raw ethernet packet) - */ -typedef err_t (*netif_linkoutput_fn)(struct netif *netif, struct pbuf *p); -/** Function prototype for netif status- or link-callback functions. */ -typedef void (*netif_status_callback_fn)(struct netif *netif); -#if LWIP_IPV4 && LWIP_IGMP -/** Function prototype for netif igmp_mac_filter functions */ -typedef err_t (*netif_igmp_mac_filter_fn)(struct netif *netif, - const ip4_addr_t *group, enum netif_mac_filter_action action); -#endif /* LWIP_IPV4 && LWIP_IGMP */ -#if LWIP_IPV6 && LWIP_IPV6_MLD -/** Function prototype for netif mld_mac_filter functions */ -typedef err_t (*netif_mld_mac_filter_fn)(struct netif *netif, - const ip6_addr_t *group, enum netif_mac_filter_action action); -#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */ - -#if LWIP_DHCP || LWIP_AUTOIP || LWIP_IGMP || LWIP_IPV6_MLD || (LWIP_NUM_NETIF_CLIENT_DATA > 0) -u8_t netif_alloc_client_data_id(void); -/** @ingroup netif_cd - * Set client data. Obtain ID from netif_alloc_client_data_id(). - */ -#define netif_set_client_data(netif, id, data) netif_get_client_data(netif, id) = (data) -/** @ingroup netif_cd - * Get client data. Obtain ID from netif_alloc_client_data_id(). - */ -#define netif_get_client_data(netif, id) (netif)->client_data[(id)] -#endif /* LWIP_DHCP || LWIP_AUTOIP || (LWIP_NUM_NETIF_CLIENT_DATA > 0) */ - -#if ESP_DHCP -/*add DHCP event processing by LiuHan*/ -typedef void (*dhcp_event_fn)(void); -#endif - -/** Generic data structure used for all lwIP network interfaces. - * The following fields should be filled in by the initialization - * function for the device driver: hwaddr_len, hwaddr[], mtu, flags */ -struct netif { - /** pointer to next in linked list */ - struct netif *next; - -#if LWIP_IPV4 - /** IP address configuration in network byte order */ - ip_addr_t ip_addr; - ip_addr_t netmask; - ip_addr_t gw; -#endif /* LWIP_IPV4 */ -#if LWIP_IPV6 - /** Array of IPv6 addresses for this netif. */ - ip_addr_t ip6_addr[LWIP_IPV6_NUM_ADDRESSES]; - /** The state of each IPv6 address (Tentative, Preferred, etc). - * @see ip6_addr.h */ - u8_t ip6_addr_state[LWIP_IPV6_NUM_ADDRESSES]; -#if ESP_LWIP - void (*ipv6_addr_cb)(struct netif* netif, u8_t ip_idex); /* callback for ipv6 addr states changed */ -#endif - -#endif /* LWIP_IPV6 */ - /** This function is called by the network device driver - * to pass a packet up the TCP/IP stack. */ - netif_input_fn input; -#if LWIP_IPV4 - /** This function is called by the IP module when it wants - * to send a packet on the interface. This function typically - * first resolves the hardware address, then sends the packet. - * For ethernet physical layer, this is usually etharp_output() */ - netif_output_fn output; -#endif /* LWIP_IPV4 */ - /** This function is called by ethernet_output() when it wants - * to send a packet on the interface. This function outputs - * the pbuf as-is on the link medium. */ - netif_linkoutput_fn linkoutput; -#if LWIP_IPV6 - /** This function is called by the IPv6 module when it wants - * to send a packet on the interface. This function typically - * first resolves the hardware address, then sends the packet. - * For ethernet physical layer, this is usually ethip6_output() */ - netif_output_ip6_fn output_ip6; -#endif /* LWIP_IPV6 */ -#if LWIP_NETIF_STATUS_CALLBACK - /** This function is called when the netif state is set to up or down - */ - netif_status_callback_fn status_callback; -#endif /* LWIP_NETIF_STATUS_CALLBACK */ -#if LWIP_NETIF_LINK_CALLBACK - /** This function is called when the netif link is set to up or down - */ - netif_status_callback_fn link_callback; -#endif /* LWIP_NETIF_LINK_CALLBACK */ -#if LWIP_NETIF_REMOVE_CALLBACK - /** This function is called when the netif has been removed */ - netif_status_callback_fn remove_callback; -#endif /* LWIP_NETIF_REMOVE_CALLBACK */ - /** This field can be set by the device driver and could point - * to state information for the device. */ - void *state; -#ifdef netif_get_client_data - void* client_data[LWIP_NETIF_CLIENT_DATA_INDEX_MAX + LWIP_NUM_NETIF_CLIENT_DATA]; -#endif - -#if ESP_DHCP - struct udp_pcb *dhcps_pcb; - dhcp_event_fn dhcp_event; -#endif - -#if LWIP_IPV6_AUTOCONFIG - /** is this netif enabled for IPv6 autoconfiguration */ - u8_t ip6_autoconfig_enabled; -#endif /* LWIP_IPV6_AUTOCONFIG */ -#if LWIP_IPV6_SEND_ROUTER_SOLICIT - /** Number of Router Solicitation messages that remain to be sent. */ - u8_t rs_count; -#endif /* LWIP_IPV6_SEND_ROUTER_SOLICIT */ -#if LWIP_NETIF_HOSTNAME - /* the hostname for this netif, NULL is a valid value */ - const char* hostname; -#endif /* LWIP_NETIF_HOSTNAME */ -#if LWIP_CHECKSUM_CTRL_PER_NETIF - u16_t chksum_flags; -#endif /* LWIP_CHECKSUM_CTRL_PER_NETIF*/ - /** maximum transfer unit (in bytes) */ - u16_t mtu; - /** number of bytes used in hwaddr */ - u8_t hwaddr_len; - /** link level hardware address of this interface */ - u8_t hwaddr[NETIF_MAX_HWADDR_LEN]; - /** flags (@see @ref netif_flags) */ - u8_t flags; - /** descriptive abbreviation */ - char name[2]; - /** number of this interface */ - u8_t num; -#if MIB2_STATS - /** link type (from "snmp_ifType" enum from snmp_mib2.h) */ - u8_t link_type; - /** (estimate) link speed */ - u32_t link_speed; - /** timestamp at last change made (up/down) */ - u32_t ts; - /** counters */ - struct stats_mib2_netif_ctrs mib2_counters; -#endif /* MIB2_STATS */ -#if LWIP_IPV4 && LWIP_IGMP - /** This function could be called to add or delete an entry in the multicast - filter table of the ethernet MAC.*/ - netif_igmp_mac_filter_fn igmp_mac_filter; -#endif /* LWIP_IPV4 && LWIP_IGMP */ -#if LWIP_IPV6 && LWIP_IPV6_MLD - /** This function could be called to add or delete an entry in the IPv6 multicast - filter table of the ethernet MAC. */ - netif_mld_mac_filter_fn mld_mac_filter; -#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */ -#if LWIP_NETIF_HWADDRHINT - u8_t *addr_hint; -#endif /* LWIP_NETIF_HWADDRHINT */ -#if ENABLE_LOOPBACK - /* List of packets to be queued for ourselves. */ - struct pbuf *loop_first; - struct pbuf *loop_last; -#if LWIP_LOOPBACK_MAX_PBUFS - u16_t loop_cnt_current; -#endif /* LWIP_LOOPBACK_MAX_PBUFS */ -#endif /* ENABLE_LOOPBACK */ - -#if ESP_LWIP - void (*l2_buffer_free_notify)(void *user_buf); /* Allows LWIP to notify driver when a L2-supplied pbuf can be freed */ - ip_addr_t last_ip_addr; /* Store last non-zero ip address */ -#endif -}; - -#if LWIP_CHECKSUM_CTRL_PER_NETIF -#define NETIF_SET_CHECKSUM_CTRL(netif, chksumflags) do { \ - (netif)->chksum_flags = chksumflags; } while(0) -#define IF__NETIF_CHECKSUM_ENABLED(netif, chksumflag) if (((netif) == NULL) || (((netif)->chksum_flags & (chksumflag)) != 0)) -#else /* LWIP_CHECKSUM_CTRL_PER_NETIF */ -#define NETIF_SET_CHECKSUM_CTRL(netif, chksumflags) -#define IF__NETIF_CHECKSUM_ENABLED(netif, chksumflag) -#endif /* LWIP_CHECKSUM_CTRL_PER_NETIF */ - -/** The list of network interfaces. */ -extern struct netif *netif_list; -/** The default network interface. */ -extern struct netif *netif_default; - -void netif_init(void); - -struct netif *netif_add(struct netif *netif, -#if LWIP_IPV4 - const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw, -#endif /* LWIP_IPV4 */ - void *state, netif_init_fn init, netif_input_fn input); -#if LWIP_IPV4 -void netif_set_addr(struct netif *netif, const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, - const ip4_addr_t *gw); -#endif /* LWIP_IPV4 */ - -#if ESP_GRATUITOUS_ARP -void netif_set_garp_flag(struct netif *netif); -#endif - -void netif_remove(struct netif * netif); - -/* Returns a network interface given its name. The name is of the form - "et0", where the first two letters are the "name" field in the - netif structure, and the digit is in the num field in the same - structure. */ -struct netif *netif_find(const char *name); - -void netif_set_default(struct netif *netif); - -#if LWIP_IPV4 -void netif_set_ipaddr(struct netif *netif, const ip4_addr_t *ipaddr); -void netif_set_netmask(struct netif *netif, const ip4_addr_t *netmask); -void netif_set_gw(struct netif *netif, const ip4_addr_t *gw); -/** @ingroup netif_ip4 */ -#define netif_ip4_addr(netif) ((const ip4_addr_t*)ip_2_ip4(&((netif)->ip_addr))) -/** @ingroup netif_ip4 */ -#define netif_ip4_netmask(netif) ((const ip4_addr_t*)ip_2_ip4(&((netif)->netmask))) -/** @ingroup netif_ip4 */ -#define netif_ip4_gw(netif) ((const ip4_addr_t*)ip_2_ip4(&((netif)->gw))) -/** @ingroup netif_ip4 */ -#define netif_ip_addr4(netif) ((const ip_addr_t*)&((netif)->ip_addr)) -/** @ingroup netif_ip4 */ -#define netif_ip_netmask4(netif) ((const ip_addr_t*)&((netif)->netmask)) -/** @ingroup netif_ip4 */ -#define netif_ip_gw4(netif) ((const ip_addr_t*)&((netif)->gw)) -#endif /* LWIP_IPV4 */ - -void netif_set_up(struct netif *netif); -void netif_set_down(struct netif *netif); -/** @ingroup netif - * Ask if an interface is up - */ -#if ESP_LWIP -#define netif_is_up(netif) ( ((netif) && ((netif)->flags & NETIF_FLAG_UP)) ? (u8_t)1 : (u8_t)0) -#else -#define netif_is_up(netif) (((netif)->flags & NETIF_FLAG_UP) ? (u8_t)1 : (u8_t)0) -#endif - -#if LWIP_NETIF_STATUS_CALLBACK -void netif_set_status_callback(struct netif *netif, netif_status_callback_fn status_callback); -#endif /* LWIP_NETIF_STATUS_CALLBACK */ -#if LWIP_NETIF_REMOVE_CALLBACK -void netif_set_remove_callback(struct netif *netif, netif_status_callback_fn remove_callback); -#endif /* LWIP_NETIF_REMOVE_CALLBACK */ - -void netif_set_link_up(struct netif *netif); -void netif_set_link_down(struct netif *netif); -/** Ask if a link is up */ -#define netif_is_link_up(netif) (((netif)->flags & NETIF_FLAG_LINK_UP) ? (u8_t)1 : (u8_t)0) - -#if LWIP_NETIF_LINK_CALLBACK -void netif_set_link_callback(struct netif *netif, netif_status_callback_fn link_callback); -#endif /* LWIP_NETIF_LINK_CALLBACK */ - -#if LWIP_NETIF_HOSTNAME -/** @ingroup netif */ -#define netif_set_hostname(netif, name) do { if((netif) != NULL) { (netif)->hostname = name; }}while(0) -/** @ingroup netif */ -#define netif_get_hostname(netif) (((netif) != NULL) ? ((netif)->hostname) : NULL) -#endif /* LWIP_NETIF_HOSTNAME */ - -#if LWIP_IGMP -/** @ingroup netif */ -#define netif_set_igmp_mac_filter(netif, function) do { if((netif) != NULL) { (netif)->igmp_mac_filter = function; }}while(0) -#define netif_get_igmp_mac_filter(netif) (((netif) != NULL) ? ((netif)->igmp_mac_filter) : NULL) -#endif /* LWIP_IGMP */ - -#if LWIP_IPV6 && LWIP_IPV6_MLD -/** @ingroup netif */ -#define netif_set_mld_mac_filter(netif, function) do { if((netif) != NULL) { (netif)->mld_mac_filter = function; }}while(0) -#define netif_get_mld_mac_filter(netif) (((netif) != NULL) ? ((netif)->mld_mac_filter) : NULL) -#define netif_mld_mac_filter(netif, addr, action) do { if((netif) && (netif)->mld_mac_filter) { (netif)->mld_mac_filter((netif), (addr), (action)); }}while(0) -#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */ - -#if ENABLE_LOOPBACK -err_t netif_loop_output(struct netif *netif, struct pbuf *p); -void netif_poll(struct netif *netif); -#if !LWIP_NETIF_LOOPBACK_MULTITHREADING -void netif_poll_all(void); -#endif /* !LWIP_NETIF_LOOPBACK_MULTITHREADING */ -#endif /* ENABLE_LOOPBACK */ - -err_t netif_input(struct pbuf *p, struct netif *inp); - -#if LWIP_IPV6 -/** @ingroup netif_ip6 */ -#define netif_ip_addr6(netif, i) ((const ip_addr_t*)(&((netif)->ip6_addr[i]))) -/** @ingroup netif_ip6 */ -#define netif_ip6_addr(netif, i) ((const ip6_addr_t*)ip_2_ip6(&((netif)->ip6_addr[i]))) -void netif_ip6_addr_set(struct netif *netif, s8_t addr_idx, const ip6_addr_t *addr6); -void netif_ip6_addr_set_parts(struct netif *netif, s8_t addr_idx, u32_t i0, u32_t i1, u32_t i2, u32_t i3); -#define netif_ip6_addr_state(netif, i) ((netif)->ip6_addr_state[i]) -void netif_ip6_addr_set_state(struct netif* netif, s8_t addr_idx, u8_t state); -s8_t netif_get_ip6_addr_match(struct netif *netif, const ip6_addr_t *ip6addr); -void netif_create_ip6_linklocal_address(struct netif *netif, u8_t from_mac_48bit); -err_t netif_add_ip6_address(struct netif *netif, const ip6_addr_t *ip6addr, s8_t *chosen_idx); -#define netif_set_ip6_autoconfig_enabled(netif, action) do { if(netif) { (netif)->ip6_autoconfig_enabled = (action); }}while(0) -#endif /* LWIP_IPV6 */ - -#if LWIP_NETIF_HWADDRHINT -#define NETIF_SET_HWADDRHINT(netif, hint) ((netif)->addr_hint = (hint)) -#else /* LWIP_NETIF_HWADDRHINT */ -#define NETIF_SET_HWADDRHINT(netif, hint) -#endif /* LWIP_NETIF_HWADDRHINT */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_NETIF_H */ diff --git a/tools/sdk/include/lwip/lwip/netifapi.h b/tools/sdk/include/lwip/lwip/netifapi.h deleted file mode 100644 index 8bd2b4f76f7..00000000000 --- a/tools/sdk/include/lwip/lwip/netifapi.h +++ /dev/null @@ -1,140 +0,0 @@ -/** - * @file - * netif API (to be used from non-TCPIP threads) - */ - -/* - * 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. - * - */ -#ifndef LWIP_HDR_NETIFAPI_H -#define LWIP_HDR_NETIFAPI_H - -#include "lwip/opt.h" - -#if LWIP_NETIF_API /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/sys.h" -#include "lwip/netif.h" -#include "lwip/dhcp.h" -#include "lwip/autoip.h" -#include "lwip/priv/tcpip_priv.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if LWIP_MPU_COMPATIBLE -#define NETIFAPI_IPADDR_DEF(type, m) type m -#else /* LWIP_MPU_COMPATIBLE */ -#define NETIFAPI_IPADDR_DEF(type, m) const type * m -#endif /* LWIP_MPU_COMPATIBLE */ - -typedef void (*netifapi_void_fn)(struct netif *netif); -typedef err_t (*netifapi_errt_fn)(struct netif *netif); - -struct netifapi_msg { - struct tcpip_api_call_data call; - struct netif *netif; - union { - struct { -#if LWIP_IPV4 - NETIFAPI_IPADDR_DEF(ip4_addr_t, ipaddr); - NETIFAPI_IPADDR_DEF(ip4_addr_t, netmask); - NETIFAPI_IPADDR_DEF(ip4_addr_t, gw); -#endif /* LWIP_IPV4 */ - void *state; - netif_init_fn init; - netif_input_fn input; - } add; - struct { - netifapi_void_fn voidfunc; - netifapi_errt_fn errtfunc; - } common; - } msg; -}; - - -/* API for application */ -err_t netifapi_netif_add(struct netif *netif, -#if LWIP_IPV4 - const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw, -#endif /* LWIP_IPV4 */ - void *state, netif_init_fn init, netif_input_fn input); - -#if LWIP_IPV4 -err_t netifapi_netif_set_addr(struct netif *netif, const ip4_addr_t *ipaddr, - const ip4_addr_t *netmask, const ip4_addr_t *gw); -#endif /* LWIP_IPV4*/ - -err_t netifapi_netif_common(struct netif *netif, netifapi_void_fn voidfunc, - netifapi_errt_fn errtfunc); - -/** @ingroup netifapi_netif */ -#define netifapi_netif_remove(n) netifapi_netif_common(n, netif_remove, NULL) -/** @ingroup netifapi_netif */ -#define netifapi_netif_set_up(n) netifapi_netif_common(n, netif_set_up, NULL) -/** @ingroup netifapi_netif */ -#define netifapi_netif_set_down(n) netifapi_netif_common(n, netif_set_down, NULL) -/** @ingroup netifapi_netif */ -#define netifapi_netif_set_default(n) netifapi_netif_common(n, netif_set_default, NULL) -/** @ingroup netifapi_netif */ -#define netifapi_netif_set_link_up(n) netifapi_netif_common(n, netif_set_link_up, NULL) -/** @ingroup netifapi_netif */ -#define netifapi_netif_set_link_down(n) netifapi_netif_common(n, netif_set_link_down, NULL) - -/** - * @defgroup netifapi_dhcp4 DHCPv4 - * @ingroup netifapi - * To be called from non-TCPIP threads - */ -/** @ingroup netifapi_dhcp4 */ -#define netifapi_dhcp_start(n) netifapi_netif_common(n, NULL, dhcp_start) -/** @ingroup netifapi_dhcp4 */ -#define netifapi_dhcp_stop(n) netifapi_netif_common(n, dhcp_stop, NULL) -/** @ingroup netifapi_dhcp4 */ -#define netifapi_dhcp_inform(n) netifapi_netif_common(n, dhcp_inform, NULL) -/** @ingroup netifapi_dhcp4 */ -#define netifapi_dhcp_renew(n) netifapi_netif_common(n, NULL, dhcp_renew) -/** @ingroup netifapi_dhcp4 */ -#define netifapi_dhcp_release(n) netifapi_netif_common(n, NULL, dhcp_release) - -/** - * @defgroup netifapi_autoip AUTOIP - * @ingroup netifapi - * To be called from non-TCPIP threads - */ -/** @ingroup netifapi_autoip */ -#define netifapi_autoip_start(n) netifapi_netif_common(n, NULL, autoip_start) -/** @ingroup netifapi_autoip */ -#define netifapi_autoip_stop(n) netifapi_netif_common(n, NULL, autoip_stop) - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_NETIF_API */ - -#endif /* LWIP_HDR_NETIFAPI_H */ diff --git a/tools/sdk/include/lwip/lwip/opt.h b/tools/sdk/include/lwip/lwip/opt.h deleted file mode 100644 index f15aa7b6887..00000000000 --- a/tools/sdk/include/lwip/lwip/opt.h +++ /dev/null @@ -1,2892 +0,0 @@ -/** - * @file - * - * lwIP Options Configuration - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ - -/* - * NOTE: || defined __DOXYGEN__ is a workaround for doxygen bug - - * without this, doxygen does not see the actual #define - */ - -#if !defined LWIP_HDR_OPT_H -#define LWIP_HDR_OPT_H - -/* - * Include user defined options first. Anything not defined in these files - * will be set to standard values. Override anything you don't like! - */ -#include "lwipopts.h" -#include "lwip/debug.h" - -/** - * @defgroup lwip_opts Options (lwipopts.h) - * @ingroup lwip - * - * @defgroup lwip_opts_debug Debugging - * @ingroup lwip_opts - * - * @defgroup lwip_opts_infrastructure Infrastructure - * @ingroup lwip_opts - * - * @defgroup lwip_opts_callback Callback-style APIs - * @ingroup lwip_opts - * - * @defgroup lwip_opts_threadsafe_apis Thread-safe APIs - * @ingroup lwip_opts - */ - - /* - ------------------------------------ - -------------- NO SYS -------------- - ------------------------------------ -*/ -/** - * @defgroup lwip_opts_nosys NO_SYS - * @ingroup lwip_opts_infrastructure - * @{ - */ -/** - * NO_SYS==1: Use lwIP without OS-awareness (no thread, semaphores, mutexes or - * mboxes). This means threaded APIs cannot be used (socket, netconn, - * i.e. everything in the 'api' folder), only the callback-style raw API is - * available (and you have to watch out for yourself that you don't access - * lwIP functions/structures from more than one context at a time!) - */ -#if !defined NO_SYS || defined __DOXYGEN__ -#define NO_SYS 0 -#endif -/** - * @} - */ - -/** - * @defgroup lwip_opts_timers Timers - * @ingroup lwip_opts_infrastructure - * @{ - */ -/** - * LWIP_TIMERS==0: Drop support for sys_timeout and lwip-internal cyclic timers. - * (the array of lwip-internal cyclic timers is still provided) - * (check NO_SYS_NO_TIMERS for compatibility to old versions) - */ -#if !defined LWIP_TIMERS || defined __DOXYGEN__ -#ifdef NO_SYS_NO_TIMERS -#define LWIP_TIMERS (!NO_SYS || (NO_SYS && !NO_SYS_NO_TIMERS)) -#else -#define LWIP_TIMERS 1 -#endif -#endif - -/** - * LWIP_TIMERS_CUSTOM==1: Provide your own timer implementation. - * Function prototypes in timeouts.h and the array of lwip-internal cyclic timers - * are still included, but the implementation is not. The following functions - * will be required: sys_timeouts_init(), sys_timeout(), sys_untimeout(), - * sys_timeouts_mbox_fetch() - */ -#if !defined LWIP_TIMERS_CUSTOM || defined __DOXYGEN__ -#define LWIP_TIMERS_CUSTOM 0 -#endif -/** - * @} - */ - -/** - * @defgroup lwip_opts_memcpy memcpy - * @ingroup lwip_opts_infrastructure - * @{ - */ -/** - * MEMCPY: override this if you have a faster implementation at hand than the - * one included in your C library - */ -#if !defined MEMCPY || defined __DOXYGEN__ -#define MEMCPY(dst,src,len) memcpy(dst,src,len) -#endif - -/** - * SMEMCPY: override this with care! Some compilers (e.g. gcc) can inline a - * call to memcpy() if the length is known at compile time and is small. - */ -#if !defined SMEMCPY || defined __DOXYGEN__ -#define SMEMCPY(dst,src,len) memcpy(dst,src,len) -#endif -/** - * @} - */ - -/* - ------------------------------------ - ----------- Core locking ----------- - ------------------------------------ -*/ -/** - * @defgroup lwip_opts_lock Core locking and MPU - * @ingroup lwip_opts_infrastructure - * @{ - */ -/** - * LWIP_MPU_COMPATIBLE: enables special memory management mechanism - * which makes lwip able to work on MPU (Memory Protection Unit) system - * by not passing stack-pointers to other threads - * (this decreases performance as memory is allocated from pools instead - * of keeping it on the stack) - */ -#if !defined LWIP_MPU_COMPATIBLE || defined __DOXYGEN__ -#define LWIP_MPU_COMPATIBLE 0 -#endif - -/** - * LWIP_TCPIP_CORE_LOCKING - * Creates a global mutex that is held during TCPIP thread operations. - * Can be locked by client code to perform lwIP operations without changing - * into TCPIP thread using callbacks. See LOCK_TCPIP_CORE() and - * UNLOCK_TCPIP_CORE(). - * Your system should provide mutexes supporting priority inversion to use this. - */ -#if !defined LWIP_TCPIP_CORE_LOCKING || defined __DOXYGEN__ -#define LWIP_TCPIP_CORE_LOCKING 1 -#endif - -/** - * LWIP_TCPIP_CORE_LOCKING_INPUT: when LWIP_TCPIP_CORE_LOCKING is enabled, - * this lets tcpip_input() grab the mutex for input packets as well, - * instead of allocating a message and passing it to tcpip_thread. - * - * ATTENTION: this does not work when tcpip_input() is called from - * interrupt context! - */ -#if !defined LWIP_TCPIP_CORE_LOCKING_INPUT || defined __DOXYGEN__ -#define LWIP_TCPIP_CORE_LOCKING_INPUT 0 -#endif - -/** - * SYS_LIGHTWEIGHT_PROT==1: enable inter-task protection (and task-vs-interrupt - * protection) for certain critical regions during buffer allocation, deallocation - * and memory allocation and deallocation. - * ATTENTION: This is required when using lwIP from more than one context! If - * you disable this, you must be sure what you are doing! - */ -#if !defined SYS_LIGHTWEIGHT_PROT || defined __DOXYGEN__ -#define SYS_LIGHTWEIGHT_PROT 1 -#endif -/** - * @} - */ - -/* - ------------------------------------ - ---------- Memory options ---------- - ------------------------------------ -*/ -/** - * @defgroup lwip_opts_mem Heap and memory pools - * @ingroup lwip_opts_infrastructure - * @{ - */ -/** - * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library - * instead of the lwip internal allocator. Can save code size if you - * already use it. - */ -#if !defined MEM_LIBC_MALLOC || defined __DOXYGEN__ -#define MEM_LIBC_MALLOC 0 -#endif - -/** - * MEMP_MEM_MALLOC==1: Use mem_malloc/mem_free instead of the lwip pool allocator. - * Especially useful with MEM_LIBC_MALLOC but handle with care regarding execution - * speed (heap alloc can be much slower than pool alloc) and usage from interrupts - * (especially if your netif driver allocates PBUF_POOL pbufs for received frames - * from interrupt)! - * ATTENTION: Currently, this uses the heap for ALL pools (also for private pools, - * not only for internal pools defined in memp_std.h)! - */ -#if !defined MEMP_MEM_MALLOC || defined __DOXYGEN__ -#define MEMP_MEM_MALLOC 0 -#endif - -/** - * MEM_ALIGNMENT: should be set to the alignment of the CPU - * 4 byte alignment -> \#define MEM_ALIGNMENT 4 - * 2 byte alignment -> \#define MEM_ALIGNMENT 2 - */ -#if !defined MEM_ALIGNMENT || defined __DOXYGEN__ -#define MEM_ALIGNMENT 1 -#endif - -/** - * MEM_SIZE: the size of the heap memory. If the application will send - * a lot of data that needs to be copied, this should be set high. - */ -#if !defined MEM_SIZE || defined __DOXYGEN__ -#define MEM_SIZE 1600 -#endif - -/** - * MEMP_OVERFLOW_CHECK: memp overflow protection reserves a configurable - * amount of bytes before and after each memp element in every pool and fills - * it with a prominent default value. - * MEMP_OVERFLOW_CHECK == 0 no checking - * MEMP_OVERFLOW_CHECK == 1 checks each element when it is freed - * MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time - * memp_malloc() or memp_free() is called (useful but slow!) - */ -#if !defined MEMP_OVERFLOW_CHECK || defined __DOXYGEN__ -#define MEMP_OVERFLOW_CHECK 0 -#endif - -/** - * MEMP_SANITY_CHECK==1: run a sanity check after each memp_free() to make - * sure that there are no cycles in the linked lists. - */ -#if !defined MEMP_SANITY_CHECK || defined __DOXYGEN__ -#define MEMP_SANITY_CHECK 0 -#endif - -/** - * MEM_USE_POOLS==1: Use an alternative to malloc() by allocating from a set - * of memory pools of various sizes. When mem_malloc is called, an element of - * the smallest pool that can provide the length needed is returned. - * To use this, MEMP_USE_CUSTOM_POOLS also has to be enabled. - */ -#if !defined MEM_USE_POOLS || defined __DOXYGEN__ -#define MEM_USE_POOLS 0 -#endif - -/** - * MEM_USE_POOLS_TRY_BIGGER_POOL==1: if one malloc-pool is empty, try the next - * bigger pool - WARNING: THIS MIGHT WASTE MEMORY but it can make a system more - * reliable. */ -#if !defined MEM_USE_POOLS_TRY_BIGGER_POOL || defined __DOXYGEN__ -#define MEM_USE_POOLS_TRY_BIGGER_POOL 0 -#endif - -/** - * MEMP_USE_CUSTOM_POOLS==1: whether to include a user file lwippools.h - * that defines additional pools beyond the "standard" ones required - * by lwIP. If you set this to 1, you must have lwippools.h in your - * include path somewhere. - */ -#if !defined MEMP_USE_CUSTOM_POOLS || defined __DOXYGEN__ -#define MEMP_USE_CUSTOM_POOLS 0 -#endif - -/** - * Set this to 1 if you want to free PBUF_RAM pbufs (or call mem_free()) from - * interrupt context (or another context that doesn't allow waiting for a - * semaphore). - * If set to 1, mem_malloc will be protected by a semaphore and SYS_ARCH_PROTECT, - * while mem_free will only use SYS_ARCH_PROTECT. mem_malloc SYS_ARCH_UNPROTECTs - * with each loop so that mem_free can run. - * - * ATTENTION: As you can see from the above description, this leads to dis-/ - * enabling interrupts often, which can be slow! Also, on low memory, mem_malloc - * can need longer. - * - * If you don't want that, at least for NO_SYS=0, you can still use the following - * functions to enqueue a deallocation call which then runs in the tcpip_thread - * context: - * - pbuf_free_callback(p); - * - mem_free_callback(m); - */ -#if !defined LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT || defined __DOXYGEN__ -#define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 0 -#endif -/** - * @} - */ - -/* - ------------------------------------------------ - ---------- Internal Memory Pool Sizes ---------- - ------------------------------------------------ -*/ -/** - * @defgroup lwip_opts_memp Internal memory pools - * @ingroup lwip_opts_infrastructure - * @{ - */ -/** - * MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF). - * If the application sends a lot of data out of ROM (or other static memory), - * this should be set high. - */ -#if !defined MEMP_NUM_PBUF || defined __DOXYGEN__ -#define MEMP_NUM_PBUF 16 -#endif - -/** - * MEMP_NUM_RAW_PCB: Number of raw connection PCBs - * (requires the LWIP_RAW option) - */ -#if !defined MEMP_NUM_RAW_PCB || defined __DOXYGEN__ -#define MEMP_NUM_RAW_PCB 4 -#endif - -/** - * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One - * per active UDP "connection". - * (requires the LWIP_UDP option) - */ -#if !defined MEMP_NUM_UDP_PCB || defined __DOXYGEN__ -#define MEMP_NUM_UDP_PCB 4 -#endif - -/** - * MEMP_NUM_TCP_PCB: the number of simultaneously active TCP connections. - * (requires the LWIP_TCP option) - */ -#if !defined MEMP_NUM_TCP_PCB || defined __DOXYGEN__ -#define MEMP_NUM_TCP_PCB 5 -#endif - -/** - * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections. - * (requires the LWIP_TCP option) - */ -#if !defined MEMP_NUM_TCP_PCB_LISTEN || defined __DOXYGEN__ -#define MEMP_NUM_TCP_PCB_LISTEN 8 -#endif - -/** - * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. - * (requires the LWIP_TCP option) - */ -#if !defined MEMP_NUM_TCP_SEG || defined __DOXYGEN__ -#define MEMP_NUM_TCP_SEG 16 -#endif - -/** - * MEMP_NUM_REASSDATA: the number of IP packets simultaneously queued for - * reassembly (whole packets, not fragments!) - */ -#if !defined MEMP_NUM_REASSDATA || defined __DOXYGEN__ -#define MEMP_NUM_REASSDATA 5 -#endif - -/** - * MEMP_NUM_FRAG_PBUF: the number of IP fragments simultaneously sent - * (fragments, not whole packets!). - * This is only used with LWIP_NETIF_TX_SINGLE_PBUF==0 and only has to be > 1 - * with DMA-enabled MACs where the packet is not yet sent when netif->output - * returns. - */ -#if !defined MEMP_NUM_FRAG_PBUF || defined __DOXYGEN__ -#define MEMP_NUM_FRAG_PBUF 15 -#endif - -/** - * MEMP_NUM_ARP_QUEUE: the number of simultaneously queued outgoing - * packets (pbufs) that are waiting for an ARP request (to resolve - * their destination address) to finish. - * (requires the ARP_QUEUEING option) - */ -#if !defined MEMP_NUM_ARP_QUEUE || defined __DOXYGEN__ -#define MEMP_NUM_ARP_QUEUE 30 -#endif - -/** - * MEMP_NUM_IGMP_GROUP: The number of multicast groups whose network interfaces - * can be members at the same time (one per netif - allsystems group -, plus one - * per netif membership). - * (requires the LWIP_IGMP option) - */ -#if !defined MEMP_NUM_IGMP_GROUP || defined __DOXYGEN__ -#define MEMP_NUM_IGMP_GROUP 8 -#endif - -/** - * MEMP_NUM_SYS_TIMEOUT: the number of simultaneously active timeouts. - * The default number of timeouts is calculated here for all enabled modules. - * The formula expects settings to be either '0' or '1'. - */ -#if !defined MEMP_NUM_SYS_TIMEOUT || defined __DOXYGEN__ -#if ESP_LWIP -#define MEMP_NUM_SYS_TIMEOUT (LWIP_TCP + IP_REASSEMBLY + (LWIP_ARP + (ESP_GRATUITOUS_ARP ? 1 : 0)) + (2*LWIP_DHCP + (ESP_DHCPS_TIMER ? 1 : 0)) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + (PPP_SUPPORT*6*MEMP_NUM_PPP_PCB) + (LWIP_IPV6 ? (1 + LWIP_IPV6_REASS + LWIP_IPV6_MLD) : 0)) -#else -#define MEMP_NUM_SYS_TIMEOUT (LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + (PPP_SUPPORT*6*MEMP_NUM_PPP_PCB) + (LWIP_IPV6 ? (1 + LWIP_IPV6_REASS + LWIP_IPV6_MLD) : 0)) -#endif -#endif - -/** - * MEMP_NUM_NETBUF: the number of struct netbufs. - * (only needed if you use the sequential API, like api_lib.c) - */ -#if !defined MEMP_NUM_NETBUF || defined __DOXYGEN__ -#define MEMP_NUM_NETBUF 2 -#endif - -/** - * MEMP_NUM_NETCONN: the number of struct netconns. - * (only needed if you use the sequential API, like api_lib.c) - */ -#if !defined MEMP_NUM_NETCONN || defined __DOXYGEN__ -#define MEMP_NUM_NETCONN 4 -#endif - -/** - * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used - * for callback/timeout API communication. - * (only needed if you use tcpip.c) - */ -#if !defined MEMP_NUM_TCPIP_MSG_API || defined __DOXYGEN__ -#define MEMP_NUM_TCPIP_MSG_API 8 -#endif - -/** - * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used - * for incoming packets. - * (only needed if you use tcpip.c) - */ -#if !defined MEMP_NUM_TCPIP_MSG_INPKT || defined __DOXYGEN__ -#define MEMP_NUM_TCPIP_MSG_INPKT 8 -#endif - -/** - * MEMP_NUM_NETDB: the number of concurrently running lwip_addrinfo() calls - * (before freeing the corresponding memory using lwip_freeaddrinfo()). - */ -#if !defined MEMP_NUM_NETDB || defined __DOXYGEN__ -#define MEMP_NUM_NETDB 1 -#endif - -/** - * MEMP_NUM_LOCALHOSTLIST: the number of host entries in the local host list - * if DNS_LOCAL_HOSTLIST_IS_DYNAMIC==1. - */ -#if !defined MEMP_NUM_LOCALHOSTLIST || defined __DOXYGEN__ -#define MEMP_NUM_LOCALHOSTLIST 1 -#endif - -/** - * PBUF_POOL_SIZE: the number of buffers in the pbuf pool. - */ -#if !defined PBUF_POOL_SIZE || defined __DOXYGEN__ -#define PBUF_POOL_SIZE 16 -#endif - -/** MEMP_NUM_API_MSG: the number of concurrently active calls to various - * socket, netconn, and tcpip functions - */ -#if !defined MEMP_NUM_API_MSG || defined __DOXYGEN__ -#define MEMP_NUM_API_MSG MEMP_NUM_TCPIP_MSG_API -#endif - -/** MEMP_NUM_DNS_API_MSG: the number of concurrently active calls to netconn_gethostbyname - */ -#if !defined MEMP_NUM_DNS_API_MSG || defined __DOXYGEN__ -#define MEMP_NUM_DNS_API_MSG MEMP_NUM_TCPIP_MSG_API -#endif - -/** MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA: the number of concurrently active calls - * to getsockopt/setsockopt - */ -#if !defined MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA || defined __DOXYGEN__ -#define MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA MEMP_NUM_TCPIP_MSG_API -#endif - -/** MEMP_NUM_NETIFAPI_MSG: the number of concurrently active calls to the - * netifapi functions - */ -#if !defined MEMP_NUM_NETIFAPI_MSG || defined __DOXYGEN__ -#define MEMP_NUM_NETIFAPI_MSG MEMP_NUM_TCPIP_MSG_API -#endif -/** - * @} - */ - -/* - --------------------------------- - ---------- ARP options ---------- - --------------------------------- -*/ -/** - * @defgroup lwip_opts_arp ARP - * @ingroup lwip_opts_ipv4 - * @{ - */ -/** - * LWIP_ARP==1: Enable ARP functionality. - */ -#if !defined LWIP_ARP || defined __DOXYGEN__ -#define LWIP_ARP 1 -#endif - -/** - * ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached. - */ -#if !defined ARP_TABLE_SIZE || defined __DOXYGEN__ -#define ARP_TABLE_SIZE 10 -#endif - -/** the time an ARP entry stays valid after its last update, - * for ARP_TMR_INTERVAL = 1000, this is - * (60 * 5) seconds = 5 minutes. - */ -#if !defined ARP_MAXAGE || defined __DOXYGEN__ -#define ARP_MAXAGE 300 -#endif - -/** - * ARP_QUEUEING==1: Multiple outgoing packets are queued during hardware address - * resolution. By default, only the most recent packet is queued per IP address. - * This is sufficient for most protocols and mainly reduces TCP connection - * startup time. Set this to 1 if you know your application sends more than one - * packet in a row to an IP address that is not in the ARP cache. - */ -#if !defined ARP_QUEUEING || defined __DOXYGEN__ -#define ARP_QUEUEING 0 -#endif - -/** The maximum number of packets which may be queued for each - * unresolved address by other network layers. Defaults to 3, 0 means disabled. - * Old packets are dropped, new packets are queued. - */ -#if !defined ARP_QUEUE_LEN || defined __DOXYGEN__ -#define ARP_QUEUE_LEN 3 -#endif - -/** - * ETHARP_SUPPORT_VLAN==1: support receiving and sending ethernet packets with - * VLAN header. See the description of LWIP_HOOK_VLAN_CHECK and - * LWIP_HOOK_VLAN_SET hooks to check/set VLAN headers. - * Additionally, you can define ETHARP_VLAN_CHECK to an u16_t VLAN ID to check. - * If ETHARP_VLAN_CHECK is defined, only VLAN-traffic for this VLAN is accepted. - * If ETHARP_VLAN_CHECK is not defined, all traffic is accepted. - * Alternatively, define a function/define ETHARP_VLAN_CHECK_FN(eth_hdr, vlan) - * that returns 1 to accept a packet or 0 to drop a packet. - */ -#if !defined ETHARP_SUPPORT_VLAN || defined __DOXYGEN__ -#define ETHARP_SUPPORT_VLAN 0 -#endif - -/** LWIP_ETHERNET==1: enable ethernet support even though ARP might be disabled - */ -#if !defined LWIP_ETHERNET || defined __DOXYGEN__ -#define LWIP_ETHERNET LWIP_ARP -#endif - -/** ETH_PAD_SIZE: number of bytes added before the ethernet header to ensure - * alignment of payload after that header. Since the header is 14 bytes long, - * without this padding e.g. addresses in the IP header will not be aligned - * on a 32-bit boundary, so setting this to 2 can speed up 32-bit-platforms. - */ -#if !defined ETH_PAD_SIZE || defined __DOXYGEN__ -#define ETH_PAD_SIZE 0 -#endif - -/** ETHARP_SUPPORT_STATIC_ENTRIES==1: enable code to support static ARP table - * entries (using etharp_add_static_entry/etharp_remove_static_entry). - */ -#if !defined ETHARP_SUPPORT_STATIC_ENTRIES || defined __DOXYGEN__ -#define ETHARP_SUPPORT_STATIC_ENTRIES 0 -#endif - -/** ETHARP_TABLE_MATCH_NETIF==1: Match netif for ARP table entries. - * If disabled, duplicate IP address on multiple netifs are not supported - * (but this should only occur for AutoIP). - */ -#if !defined ETHARP_TABLE_MATCH_NETIF || defined __DOXYGEN__ -#define ETHARP_TABLE_MATCH_NETIF 0 -#endif -/** - * @} - */ - -/* - -------------------------------- - ---------- IP options ---------- - -------------------------------- -*/ -/** - * @defgroup lwip_opts_ipv4 IPv4 - * @ingroup lwip_opts - * @{ - */ -/** - * LWIP_IPV4==1: Enable IPv4 - */ -#if !defined LWIP_IPV4 || defined __DOXYGEN__ -#define LWIP_IPV4 1 -#endif - -/** - * IP_FORWARD==1: Enables the ability to forward IP packets across network - * interfaces. If you are going to run lwIP on a device with only one network - * interface, define this to 0. - */ -#if !defined IP_FORWARD || defined __DOXYGEN__ -#define IP_FORWARD 0 -#endif - -/** - * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that - * this option does not affect outgoing packet sizes, which can be controlled - * via IP_FRAG. - */ -#if !defined IP_REASSEMBLY || defined __DOXYGEN__ -#define IP_REASSEMBLY 1 -#endif - -/** - * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note - * that this option does not affect incoming packet sizes, which can be - * controlled via IP_REASSEMBLY. - */ -#if !defined IP_FRAG || defined __DOXYGEN__ -#define IP_FRAG 1 -#endif - -#if !LWIP_IPV4 -/* disable IPv4 extensions when IPv4 is disabled */ -#undef IP_FORWARD -#define IP_FORWARD 0 -#undef IP_REASSEMBLY -#define IP_REASSEMBLY 0 -#undef IP_FRAG -#define IP_FRAG 0 -#endif /* !LWIP_IPV4 */ - -/** - * IP_OPTIONS_ALLOWED: Defines the behavior for IP options. - * IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped. - * IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed). - */ -#if !defined IP_OPTIONS_ALLOWED || defined __DOXYGEN__ -#define IP_OPTIONS_ALLOWED 1 -#endif - -/** - * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally) - * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived - * in this time, the whole packet is discarded. - */ -#if !defined IP_REASS_MAXAGE || defined __DOXYGEN__ -#define IP_REASS_MAXAGE 3 -#endif - -/** - * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled. - * Since the received pbufs are enqueued, be sure to configure - * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive - * packets even if the maximum amount of fragments is enqueued for reassembly! - */ -#if !defined IP_REASS_MAX_PBUFS || defined __DOXYGEN__ -#define IP_REASS_MAX_PBUFS 10 -#endif - -/** - * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers. - */ -#if !defined IP_DEFAULT_TTL || defined __DOXYGEN__ -#define IP_DEFAULT_TTL 255 -#endif - -/** - * IP_SOF_BROADCAST=1: Use the SOF_BROADCAST field to enable broadcast - * filter per pcb on udp and raw send operations. To enable broadcast filter - * on recv operations, you also have to set IP_SOF_BROADCAST_RECV=1. - */ -#if !defined IP_SOF_BROADCAST || defined __DOXYGEN__ -#define IP_SOF_BROADCAST 0 -#endif - -/** - * IP_SOF_BROADCAST_RECV (requires IP_SOF_BROADCAST=1) enable the broadcast - * filter on recv operations. - */ -#if !defined IP_SOF_BROADCAST_RECV || defined __DOXYGEN__ -#define IP_SOF_BROADCAST_RECV 0 -#endif - -/** - * IP_FORWARD_ALLOW_TX_ON_RX_NETIF==1: allow ip_forward() to send packets back - * out on the netif where it was received. This should only be used for - * wireless networks. - * ATTENTION: When this is 1, make sure your netif driver correctly marks incoming - * link-layer-broadcast/multicast packets as such using the corresponding pbuf flags! - */ -#if !defined IP_FORWARD_ALLOW_TX_ON_RX_NETIF || defined __DOXYGEN__ -#define IP_FORWARD_ALLOW_TX_ON_RX_NETIF 0 -#endif - -/** - * LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS==1: randomize the local port for the first - * local TCP/UDP pcb (default==0). This can prevent creating predictable port - * numbers after booting a device. - */ -#if !defined LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS || defined __DOXYGEN__ -#define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS 0 -#endif -/** - * @} - */ - -/* - ---------------------------------- - ---------- ICMP options ---------- - ---------------------------------- -*/ -/** - * @defgroup lwip_opts_icmp ICMP - * @ingroup lwip_opts_ipv4 - * @{ - */ -/** - * LWIP_ICMP==1: Enable ICMP module inside the IP stack. - * Be careful, disable that make your product non-compliant to RFC1122 - */ -#if !defined LWIP_ICMP || defined __DOXYGEN__ -#define LWIP_ICMP 1 -#endif - -/** - * ICMP_TTL: Default value for Time-To-Live used by ICMP packets. - */ -#if !defined ICMP_TTL || defined __DOXYGEN__ -#define ICMP_TTL (IP_DEFAULT_TTL) -#endif - -/** - * LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only) - */ -#if !defined LWIP_BROADCAST_PING || defined __DOXYGEN__ -#define LWIP_BROADCAST_PING 0 -#endif - -/** - * LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only) - */ -#if !defined LWIP_MULTICAST_PING || defined __DOXYGEN__ -#define LWIP_MULTICAST_PING 0 -#endif -/** - * @} - */ - -/* - --------------------------------- - ---------- RAW options ---------- - --------------------------------- -*/ -/** - * @defgroup lwip_opts_raw RAW - * @ingroup lwip_opts_callback - * @{ - */ -/** - * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. - */ -#if !defined LWIP_RAW || defined __DOXYGEN__ -#define LWIP_RAW 0 -#endif - -/** - * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. - */ -#if !defined RAW_TTL || defined __DOXYGEN__ -#define RAW_TTL (IP_DEFAULT_TTL) -#endif -/** - * @} - */ - -/* - ---------------------------------- - ---------- DHCP options ---------- - ---------------------------------- -*/ -/** - * @defgroup lwip_opts_dhcp DHCP - * @ingroup lwip_opts_ipv4 - * @{ - */ -/** - * LWIP_DHCP==1: Enable DHCP module. - */ -#if !defined LWIP_DHCP || defined __DOXYGEN__ -#define LWIP_DHCP 0 -#endif -#if !LWIP_IPV4 -/* disable DHCP when IPv4 is disabled */ -#undef LWIP_DHCP -#define LWIP_DHCP 0 -#endif /* !LWIP_IPV4 */ - -/** - * DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address. - */ -#if !defined DHCP_DOES_ARP_CHECK || defined __DOXYGEN__ -#define DHCP_DOES_ARP_CHECK ((LWIP_DHCP) && (LWIP_ARP)) -#endif - -/** - * LWIP_DHCP_CHECK_LINK_UP==1: dhcp_start() only really starts if the netif has - * NETIF_FLAG_LINK_UP set in its flags. As this is only an optimization and - * netif drivers might not set this flag, the default is off. If enabled, - * netif_set_link_up() must be called to continue dhcp starting. - */ -#if !defined LWIP_DHCP_CHECK_LINK_UP -#define LWIP_DHCP_CHECK_LINK_UP 0 -#endif - -/** - * LWIP_DHCP_BOOTP_FILE==1: Store offered_si_addr and boot_file_name. - */ -#if !defined LWIP_DHCP_BOOTP_FILE || defined __DOXYGEN__ -#define LWIP_DHCP_BOOTP_FILE 0 -#endif - -/** - * LWIP_DHCP_GETS_NTP==1: Request NTP servers with discover/select. For each - * response packet, an callback is called, which has to be provided by the port: - * void dhcp_set_ntp_servers(u8_t num_ntp_servers, ip_addr_t* ntp_server_addrs); -*/ -#if !defined LWIP_DHCP_GET_NTP_SRV || defined __DOXYGEN__ -#define LWIP_DHCP_GET_NTP_SRV 0 -#endif - -/** - * The maximum of NTP servers requested - */ -#if !defined LWIP_DHCP_MAX_NTP_SERVERS || defined __DOXYGEN__ -#define LWIP_DHCP_MAX_NTP_SERVERS 1 -#endif - -/** - * LWIP_DHCP_MAX_DNS_SERVERS > 0: Request DNS servers with discover/select. - * DHCP servers received in the response are passed to DNS via @ref dns_setserver() - * (up to the maximum limit defined here). - */ -#if !defined LWIP_DHCP_MAX_DNS_SERVERS || defined __DOXYGEN__ -#define LWIP_DHCP_MAX_DNS_SERVERS DNS_MAX_SERVERS -#endif -/** - * @} - */ - -#ifndef LWIP_DHCP_IP_ADDR_RESTORE -#define LWIP_DHCP_IP_ADDR_RESTORE() 0 -#endif - -#ifndef LWIP_DHCP_IP_ADDR_STORE -#define LWIP_DHCP_IP_ADDR_STORE() -#endif - -#ifndef LWIP_DHCP_IP_ADDR_ERASE -#define LWIP_DHCP_IP_ADDR_ERASE() -#endif - -/* - ------------------------------------ - ---------- AUTOIP options ---------- - ------------------------------------ -*/ -/** - * @defgroup lwip_opts_autoip AUTOIP - * @ingroup lwip_opts_ipv4 - * @{ - */ -/** - * LWIP_AUTOIP==1: Enable AUTOIP module. - */ -#if !defined LWIP_AUTOIP || defined __DOXYGEN__ -#define LWIP_AUTOIP 0 -#endif -#if !LWIP_IPV4 -/* disable AUTOIP when IPv4 is disabled */ -#undef LWIP_AUTOIP -#define LWIP_AUTOIP 0 -#endif /* !LWIP_IPV4 */ - -/** - * LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on - * the same interface at the same time. - */ -#if !defined LWIP_DHCP_AUTOIP_COOP || defined __DOXYGEN__ -#define LWIP_DHCP_AUTOIP_COOP 0 -#endif - -/** - * LWIP_DHCP_AUTOIP_COOP_TRIES: Set to the number of DHCP DISCOVER probes - * that should be sent before falling back on AUTOIP (the DHCP client keeps - * running in this case). This can be set as low as 1 to get an AutoIP address - * very quickly, but you should be prepared to handle a changing IP address - * when DHCP overrides AutoIP. - */ -#if !defined LWIP_DHCP_AUTOIP_COOP_TRIES || defined __DOXYGEN__ -#define LWIP_DHCP_AUTOIP_COOP_TRIES 9 -#endif -/** - * @} - */ - -/* - ---------------------------------- - ----- SNMP MIB2 support ----- - ---------------------------------- -*/ -/** - * @defgroup lwip_opts_mib2 SNMP MIB2 callbacks - * @ingroup lwip_opts_infrastructure - * @{ - */ -/** - * LWIP_MIB2_CALLBACKS==1: Turn on SNMP MIB2 callbacks. - * Turn this on to get callbacks needed to implement MIB2. - * Usually MIB2_STATS should be enabled, too. - */ -#if !defined LWIP_MIB2_CALLBACKS || defined __DOXYGEN__ -#define LWIP_MIB2_CALLBACKS 0 -#endif -/** - * @} - */ - -/* - ---------------------------------- - ----- Multicast/IGMP options ----- - ---------------------------------- -*/ -/** - * @defgroup lwip_opts_igmp IGMP - * @ingroup lwip_opts_ipv4 - * @{ - */ -/** - * LWIP_IGMP==1: Turn on IGMP module. - */ -#if !defined LWIP_IGMP || defined __DOXYGEN__ -#define LWIP_IGMP 0 -#endif -#if !LWIP_IPV4 -#undef LWIP_IGMP -#define LWIP_IGMP 0 -#endif - -/** - * LWIP_MULTICAST_TX_OPTIONS==1: Enable multicast TX support like the socket options - * IP_MULTICAST_TTL/IP_MULTICAST_IF/IP_MULTICAST_LOOP - */ -#if !defined LWIP_MULTICAST_TX_OPTIONS || defined __DOXYGEN__ -#define LWIP_MULTICAST_TX_OPTIONS (LWIP_IGMP && LWIP_UDP) -#endif -/** - * @} - */ - -/* - ---------------------------------- - ---------- DNS options ----------- - ---------------------------------- -*/ -/** - * @defgroup lwip_opts_dns DNS - * @ingroup lwip_opts_callback - * @{ - */ -/** - * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS - * transport. - */ -#if !defined LWIP_DNS || defined __DOXYGEN__ -#define LWIP_DNS 0 -#endif - -/** DNS maximum number of entries to maintain locally. */ -#if !defined DNS_TABLE_SIZE || defined __DOXYGEN__ -#define DNS_TABLE_SIZE 4 -#endif - -/** DNS maximum host name length supported in the name table. */ -#if !defined DNS_MAX_NAME_LENGTH || defined __DOXYGEN__ -#define DNS_MAX_NAME_LENGTH 256 -#endif - -/** The maximum of DNS servers - * The first server can be initialized automatically by defining - * DNS_SERVER_ADDRESS(ipaddr), where 'ipaddr' is an 'ip_addr_t*' - */ -#if !defined DNS_MAX_SERVERS || defined __DOXYGEN__ -#define DNS_MAX_SERVERS 2 -#endif - -/** DNS do a name checking between the query and the response. */ -#if !defined DNS_DOES_NAME_CHECK || defined __DOXYGEN__ -#define DNS_DOES_NAME_CHECK 1 -#endif - -/** LWIP_DNS_SECURE: controls the security level of the DNS implementation - * Use all DNS security features by default. - * This is overridable but should only be needed by very small targets - * or when using against non standard DNS servers. */ -#if !defined LWIP_DNS_SECURE || defined __DOXYGEN__ -#define LWIP_DNS_SECURE (LWIP_DNS_SECURE_RAND_XID | LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING | LWIP_DNS_SECURE_RAND_SRC_PORT) -#endif - -/* A list of DNS security features follows */ -#define LWIP_DNS_SECURE_RAND_XID 1 -#define LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING 2 -#define LWIP_DNS_SECURE_RAND_SRC_PORT 4 - -/** DNS_LOCAL_HOSTLIST: Implements a local host-to-address list. If enabled, you have to define an initializer: - * \#define DNS_LOCAL_HOSTLIST_INIT {DNS_LOCAL_HOSTLIST_ELEM("host_ip4", IPADDR4_INIT_BYTES(1,2,3,4)), \ - * DNS_LOCAL_HOSTLIST_ELEM("host_ip6", IPADDR6_INIT_HOST(123, 234, 345, 456)} - * - * Instead, you can also use an external function: - * \#define DNS_LOOKUP_LOCAL_EXTERN(x) extern err_t my_lookup_function(const char *name, ip_addr_t *addr, u8_t dns_addrtype) - * that looks up the IP address and returns ERR_OK if found (LWIP_DNS_ADDRTYPE_xxx is passed in dns_addrtype). - */ -#if !defined DNS_LOCAL_HOSTLIST || defined __DOXYGEN__ -#define DNS_LOCAL_HOSTLIST 0 -#endif /* DNS_LOCAL_HOSTLIST */ - -/** If this is turned on, the local host-list can be dynamically changed - * at runtime. */ -#if !defined DNS_LOCAL_HOSTLIST_IS_DYNAMIC || defined __DOXYGEN__ -#define DNS_LOCAL_HOSTLIST_IS_DYNAMIC 0 -#endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ - -/** Set this to 1 to enable querying ".local" names via mDNS - * using a One-Shot Multicast DNS Query */ -#if !defined LWIP_DNS_SUPPORT_MDNS_QUERIES || defined __DOXYGEN__ -#define LWIP_DNS_SUPPORT_MDNS_QUERIES 0 -#endif -/** - * @} - */ - -/* - --------------------------------- - ---------- UDP options ---------- - --------------------------------- -*/ -/** - * @defgroup lwip_opts_udp UDP - * @ingroup lwip_opts_callback - * @{ - */ -/** - * LWIP_UDP==1: Turn on UDP. - */ -#if !defined LWIP_UDP || defined __DOXYGEN__ -#define LWIP_UDP 1 -#endif - -/** - * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP) - */ -#if !defined LWIP_UDPLITE || defined __DOXYGEN__ -#define LWIP_UDPLITE 0 -#endif - -/** - * UDP_TTL: Default Time-To-Live value. - */ -#if !defined UDP_TTL || defined __DOXYGEN__ -#define UDP_TTL (IP_DEFAULT_TTL) -#endif - -/** - * LWIP_NETBUF_RECVINFO==1: append destination addr and port to every netbuf. - */ -#if !defined LWIP_NETBUF_RECVINFO || defined __DOXYGEN__ -#define LWIP_NETBUF_RECVINFO 0 -#endif -/** - * @} - */ - -/* - --------------------------------- - ---------- TCP options ---------- - --------------------------------- -*/ -/** - * @defgroup lwip_opts_tcp TCP - * @ingroup lwip_opts_callback - * @{ - */ -/** - * LWIP_TCP==1: Turn on TCP. - */ -#if !defined LWIP_TCP || defined __DOXYGEN__ -#define LWIP_TCP 1 -#endif - -/** - * TCP_TTL: Default Time-To-Live value. - */ -#if !defined TCP_TTL || defined __DOXYGEN__ -#define TCP_TTL (IP_DEFAULT_TTL) -#endif - -/** - * TCP_WND: The size of a TCP window. This must be at least - * (2 * TCP_MSS) for things to work well. - * ATTENTION: when using TCP_RCV_SCALE, TCP_WND is the total size - * with scaling applied. Maximum window value in the TCP header - * will be TCP_WND >> TCP_RCV_SCALE - */ -#if !defined TCP_WND || defined __DOXYGEN__ -#define TCP_WND (4 * TCP_MSS) -#endif - -/** - * TCP_MAXRTX: Maximum number of retransmissions of data segments. - */ -#if !defined TCP_MAXRTX || defined __DOXYGEN__ -#define TCP_MAXRTX 12 -#endif - -/** - * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments. - */ -#if !defined TCP_SYNMAXRTX || defined __DOXYGEN__ -#define TCP_SYNMAXRTX 6 -#endif - -/** - * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order. - * Define to 0 if your device is low on memory. - */ -#if !defined TCP_QUEUE_OOSEQ || defined __DOXYGEN__ -#define TCP_QUEUE_OOSEQ (LWIP_TCP) -#endif - -/** - * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default, - * you might want to increase this.) - * For the receive side, this MSS is advertised to the remote side - * when opening a connection. For the transmit size, this MSS sets - * an upper limit on the MSS advertised by the remote host. - */ -#if !defined TCP_MSS || defined __DOXYGEN__ -#define TCP_MSS 536 -#endif - -/** - * TCP_CALCULATE_EFF_SEND_MSS: "The maximum size of a segment that TCP really - * sends, the 'effective send MSS,' MUST be the smaller of the send MSS (which - * reflects the available reassembly buffer size at the remote host) and the - * largest size permitted by the IP layer" (RFC 1122) - * Setting this to 1 enables code that checks TCP_MSS against the MTU of the - * netif used for a connection and limits the MSS if it would be too big otherwise. - */ -#if !defined TCP_CALCULATE_EFF_SEND_MSS || defined __DOXYGEN__ -#define TCP_CALCULATE_EFF_SEND_MSS 1 -#endif - - -/** - * TCP_SND_BUF: TCP sender buffer space (bytes). - * To achieve good performance, this should be at least 2 * TCP_MSS. - */ -#if !defined TCP_SND_BUF || defined __DOXYGEN__ -#define TCP_SND_BUF (2 * TCP_MSS) -#endif - -/** - * TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least - * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work. - */ -#if !defined TCP_SND_QUEUELEN || defined __DOXYGEN__ -#define TCP_SND_QUEUELEN ((4 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS)) -#endif - -/** - * TCP_SNDLOWAT: TCP writable space (bytes). This must be less than - * TCP_SND_BUF. It is the amount of space which must be available in the - * TCP snd_buf for select to return writable (combined with TCP_SNDQUEUELOWAT). - */ -#if !defined TCP_SNDLOWAT || defined __DOXYGEN__ -#define TCP_SNDLOWAT LWIP_MIN(LWIP_MAX(((TCP_SND_BUF)/2), (2 * TCP_MSS) + 1), (TCP_SND_BUF) - 1) -#endif - -/** - * TCP_SNDQUEUELOWAT: TCP writable bufs (pbuf count). This must be less - * than TCP_SND_QUEUELEN. If the number of pbufs queued on a pcb drops below - * this number, select returns writable (combined with TCP_SNDLOWAT). - */ -#if !defined TCP_SNDQUEUELOWAT || defined __DOXYGEN__ -#define TCP_SNDQUEUELOWAT LWIP_MAX(((TCP_SND_QUEUELEN)/2), 5) -#endif - -/** - * TCP_OOSEQ_MAX_BYTES: The maximum number of bytes queued on ooseq per pcb. - * Default is 0 (no limit). Only valid for TCP_QUEUE_OOSEQ==1. - */ -#if !defined TCP_OOSEQ_MAX_BYTES || defined __DOXYGEN__ -#define TCP_OOSEQ_MAX_BYTES 0 -#endif - -/** - * TCP_OOSEQ_MAX_PBUFS: The maximum number of pbufs queued on ooseq per pcb. - * Default is 0 (no limit). Only valid for TCP_QUEUE_OOSEQ==1. - */ -#if !defined TCP_OOSEQ_MAX_PBUFS || defined __DOXYGEN__ -#define TCP_OOSEQ_MAX_PBUFS 0 -#endif - -/** - * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb. - */ -#if !defined TCP_LISTEN_BACKLOG || defined __DOXYGEN__ -#define TCP_LISTEN_BACKLOG 0 -#endif - -/** - * The maximum allowed backlog for TCP listen netconns. - * This backlog is used unless another is explicitly specified. - * 0xff is the maximum (u8_t). - */ -#if !defined TCP_DEFAULT_LISTEN_BACKLOG || defined __DOXYGEN__ -#define TCP_DEFAULT_LISTEN_BACKLOG 0xff -#endif - -/** - * TCP_OVERSIZE: The maximum number of bytes that tcp_write may - * allocate ahead of time in an attempt to create shorter pbuf chains - * for transmission. The meaningful range is 0 to TCP_MSS. Some - * suggested values are: - * - * 0: Disable oversized allocation. Each tcp_write() allocates a new - pbuf (old behaviour). - * 1: Allocate size-aligned pbufs with minimal excess. Use this if your - * scatter-gather DMA requires aligned fragments. - * 128: Limit the pbuf/memory overhead to 20%. - * TCP_MSS: Try to create unfragmented TCP packets. - * TCP_MSS/4: Try to create 4 fragments or less per TCP packet. - */ -#if !defined TCP_OVERSIZE || defined __DOXYGEN__ -#define TCP_OVERSIZE TCP_MSS -#endif - -/** - * LWIP_TCP_TIMESTAMPS==1: support the TCP timestamp option. - * The timestamp option is currently only used to help remote hosts, it is not - * really used locally. Therefore, it is only enabled when a TS option is - * received in the initial SYN packet from a remote host. - */ -#if !defined LWIP_TCP_TIMESTAMPS || defined __DOXYGEN__ -#define LWIP_TCP_TIMESTAMPS 0 -#endif - -/** - * TCP_WND_UPDATE_THRESHOLD: difference in window to trigger an - * explicit window update - */ -#if !defined TCP_WND_UPDATE_THRESHOLD || defined __DOXYGEN__ -#define TCP_WND_UPDATE_THRESHOLD LWIP_MIN((TCP_WND / 4), (TCP_MSS * 4)) -#endif - -/** - * LWIP_EVENT_API and LWIP_CALLBACK_API: Only one of these should be set to 1. - * LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all - * events (accept, sent, etc) that happen in the system. - * LWIP_CALLBACK_API==1: The PCB callback function is called directly - * for the event. This is the default. - */ -#if !defined(LWIP_EVENT_API) && !defined(LWIP_CALLBACK_API) || defined __DOXYGEN__ -#define LWIP_EVENT_API 0 -#define LWIP_CALLBACK_API 1 -#else -#ifndef LWIP_EVENT_API -#define LWIP_EVENT_API 0 -#endif -#ifndef LWIP_CALLBACK_API -#define LWIP_CALLBACK_API 0 -#endif -#endif - -/** - * LWIP_WND_SCALE and TCP_RCV_SCALE: - * Set LWIP_WND_SCALE to 1 to enable window scaling. - * Set TCP_RCV_SCALE to the desired scaling factor (shift count in the - * range of [0..14]). - * When LWIP_WND_SCALE is enabled but TCP_RCV_SCALE is 0, we can use a large - * send window while having a small receive window only. - */ -#if !defined LWIP_WND_SCALE || defined __DOXYGEN__ -#define LWIP_WND_SCALE 0 -#define TCP_RCV_SCALE 0 -#endif -/** - * @} - */ - -/* - ---------------------------------- - ---------- Pbuf options ---------- - ---------------------------------- -*/ -/** - * @defgroup lwip_opts_pbuf PBUF - * @ingroup lwip_opts - * @{ - */ -/** - * PBUF_LINK_HLEN: the number of bytes that should be allocated for a - * link level header. The default is 14, the standard value for - * Ethernet. - */ -#if !defined PBUF_LINK_HLEN || defined __DOXYGEN__ -#if defined LWIP_HOOK_VLAN_SET && !defined __DOXYGEN__ -#define PBUF_LINK_HLEN (18 + ETH_PAD_SIZE) -#else /* LWIP_HOOK_VLAN_SET */ -#define PBUF_LINK_HLEN (14 + ETH_PAD_SIZE) -#endif /* LWIP_HOOK_VLAN_SET */ -#endif - -/** - * PBUF_LINK_ENCAPSULATION_HLEN: the number of bytes that should be allocated - * for an additional encapsulation header before ethernet headers (e.g. 802.11) - */ -#if !defined PBUF_LINK_ENCAPSULATION_HLEN || defined __DOXYGEN__ -#define PBUF_LINK_ENCAPSULATION_HLEN 0u -#endif - -/** - * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is - * designed to accommodate single full size TCP frame in one pbuf, including - * TCP_MSS, IP header, and link header. - */ -#if !defined PBUF_POOL_BUFSIZE || defined __DOXYGEN__ -#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN) -#endif -/** - * @} - */ - -/* - ------------------------------------------------ - ---------- Network Interfaces options ---------- - ------------------------------------------------ -*/ -/** - * @defgroup lwip_opts_netif NETIF - * @ingroup lwip_opts - * @{ - */ -/** - * LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname - * field. - */ -#if !defined LWIP_NETIF_HOSTNAME || defined __DOXYGEN__ -#define LWIP_NETIF_HOSTNAME 0 -#endif - -/** - * LWIP_NETIF_API==1: Support netif api (in netifapi.c) - */ -#if !defined LWIP_NETIF_API || defined __DOXYGEN__ -#define LWIP_NETIF_API 0 -#endif - -/** - * LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface - * changes its up/down status (i.e., due to DHCP IP acquisition) - */ -#if !defined LWIP_NETIF_STATUS_CALLBACK || defined __DOXYGEN__ -#define LWIP_NETIF_STATUS_CALLBACK 0 -#endif - -/** - * LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface - * whenever the link changes (i.e., link down) - */ -#if !defined LWIP_NETIF_LINK_CALLBACK || defined __DOXYGEN__ -#define LWIP_NETIF_LINK_CALLBACK 0 -#endif - -/** - * LWIP_NETIF_REMOVE_CALLBACK==1: Support a callback function that is called - * when a netif has been removed - */ -#if !defined LWIP_NETIF_REMOVE_CALLBACK || defined __DOXYGEN__ -#define LWIP_NETIF_REMOVE_CALLBACK 0 -#endif - -/** - * LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table - * indices) in struct netif. TCP and UDP can make use of this to prevent - * scanning the ARP table for every sent packet. While this is faster for big - * ARP tables or many concurrent connections, it might be counterproductive - * if you have a tiny ARP table or if there never are concurrent connections. - */ -#if !defined LWIP_NETIF_HWADDRHINT || defined __DOXYGEN__ -#define LWIP_NETIF_HWADDRHINT 0 -#endif - -/** - * LWIP_NETIF_TX_SINGLE_PBUF: if this is set to 1, lwIP tries to put all data - * to be sent into one single pbuf. This is for compatibility with DMA-enabled - * MACs that do not support scatter-gather. - * Beware that this might involve CPU-memcpy before transmitting that would not - * be needed without this flag! Use this only if you need to! - * - * @todo: TCP and IP-frag do not work with this, yet: - */ -#if !defined LWIP_NETIF_TX_SINGLE_PBUF || defined __DOXYGEN__ -#define LWIP_NETIF_TX_SINGLE_PBUF 0 -#endif /* LWIP_NETIF_TX_SINGLE_PBUF */ - -/** - * LWIP_NUM_NETIF_CLIENT_DATA: Number of clients that may store - * data in client_data member array of struct netif. - */ -#if !defined LWIP_NUM_NETIF_CLIENT_DATA || defined __DOXYGEN__ -#define LWIP_NUM_NETIF_CLIENT_DATA 0 -#endif -/** - * @} - */ - -/* - ------------------------------------ - ---------- LOOPIF options ---------- - ------------------------------------ -*/ -/** - * @defgroup lwip_opts_loop Loopback interface - * @ingroup lwip_opts_netif - * @{ - */ -/** - * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1). - * This is only needed when no real netifs are available. If at least one other - * netif is available, loopback traffic uses this netif. - */ -#if !defined LWIP_HAVE_LOOPIF || defined __DOXYGEN__ -#define LWIP_HAVE_LOOPIF LWIP_NETIF_LOOPBACK -#endif - -/** - * LWIP_LOOPIF_MULTICAST==1: Support multicast/IGMP on loop interface (127.0.0.1). - */ -#if !defined LWIP_LOOPIF_MULTICAST || defined __DOXYGEN__ -#define LWIP_LOOPIF_MULTICAST 0 -#endif - -/** - * LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP - * address equal to the netif IP address, looping them back up the stack. - */ -#if !defined LWIP_NETIF_LOOPBACK || defined __DOXYGEN__ -#define LWIP_NETIF_LOOPBACK 0 -#endif - -/** - * LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback - * sending for each netif (0 = disabled) - */ -#if !defined LWIP_LOOPBACK_MAX_PBUFS || defined __DOXYGEN__ -#define LWIP_LOOPBACK_MAX_PBUFS 0 -#endif - -/** - * LWIP_NETIF_LOOPBACK_MULTITHREADING: Indicates whether threading is enabled in - * the system, as netifs must change how they behave depending on this setting - * for the LWIP_NETIF_LOOPBACK option to work. - * Setting this is needed to avoid reentering non-reentrant functions like - * tcp_input(). - * LWIP_NETIF_LOOPBACK_MULTITHREADING==1: Indicates that the user is using a - * multithreaded environment like tcpip.c. In this case, netif->input() - * is called directly. - * LWIP_NETIF_LOOPBACK_MULTITHREADING==0: Indicates a polling (or NO_SYS) setup. - * The packets are put on a list and netif_poll() must be called in - * the main application loop. - */ -#if !defined LWIP_NETIF_LOOPBACK_MULTITHREADING || defined __DOXYGEN__ -#define LWIP_NETIF_LOOPBACK_MULTITHREADING (!NO_SYS) -#endif -/** - * @} - */ - -/* - ------------------------------------ - ---------- Thread options ---------- - ------------------------------------ -*/ -/** - * @defgroup lwip_opts_thread Threading - * @ingroup lwip_opts_infrastructure - * @{ - */ -/** - * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread. - */ -#if !defined TCPIP_THREAD_NAME || defined __DOXYGEN__ -#define TCPIP_THREAD_NAME "tcpip_thread" -#endif - -/** - * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread. - * The stack size value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#if !defined TCPIP_THREAD_STACKSIZE || defined __DOXYGEN__ -#define TCPIP_THREAD_STACKSIZE 0 -#endif - -/** - * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread. - * The priority value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#if !defined TCPIP_THREAD_PRIO || defined __DOXYGEN__ -#define TCPIP_THREAD_PRIO 1 -#endif - -/** - * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages - * The queue size value itself is platform-dependent, but is passed to - * sys_mbox_new() when tcpip_init is called. - */ -#if !defined TCPIP_MBOX_SIZE || defined __DOXYGEN__ -#define TCPIP_MBOX_SIZE 0 -#endif - -/** - * Define this to something that triggers a watchdog. This is called from - * tcpip_thread after processing a message. - */ -#if !defined LWIP_TCPIP_THREAD_ALIVE || defined __DOXYGEN__ -#define LWIP_TCPIP_THREAD_ALIVE() -#endif - -/** - * SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread. - */ -#if !defined SLIPIF_THREAD_NAME || defined __DOXYGEN__ -#define SLIPIF_THREAD_NAME "slipif_loop" -#endif - -/** - * SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread. - * The stack size value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#if !defined SLIPIF_THREAD_STACKSIZE || defined __DOXYGEN__ -#define SLIPIF_THREAD_STACKSIZE 0 -#endif - -/** - * SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread. - * The priority value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#if !defined SLIPIF_THREAD_PRIO || defined __DOXYGEN__ -#define SLIPIF_THREAD_PRIO 1 -#endif - -/** - * DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread. - */ -#if !defined DEFAULT_THREAD_NAME || defined __DOXYGEN__ -#define DEFAULT_THREAD_NAME "lwIP" -#endif - -/** - * DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread. - * The stack size value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#if !defined DEFAULT_THREAD_STACKSIZE || defined __DOXYGEN__ -#define DEFAULT_THREAD_STACKSIZE 0 -#endif - -/** - * DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread. - * The priority value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#if !defined DEFAULT_THREAD_PRIO || defined __DOXYGEN__ -#define DEFAULT_THREAD_PRIO 1 -#endif - -/** - * DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a - * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed - * to sys_mbox_new() when the recvmbox is created. - */ -#if !defined DEFAULT_RAW_RECVMBOX_SIZE || defined __DOXYGEN__ -#define DEFAULT_RAW_RECVMBOX_SIZE 0 -#endif - -/** - * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a - * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed - * to sys_mbox_new() when the recvmbox is created. - */ -#if !defined DEFAULT_UDP_RECVMBOX_SIZE || defined __DOXYGEN__ -#define DEFAULT_UDP_RECVMBOX_SIZE 0 -#endif - -/** - * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a - * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed - * to sys_mbox_new() when the recvmbox is created. - */ -#if !defined DEFAULT_TCP_RECVMBOX_SIZE || defined __DOXYGEN__ -#define DEFAULT_TCP_RECVMBOX_SIZE 0 -#endif - -/** - * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections. - * The queue size value itself is platform-dependent, but is passed to - * sys_mbox_new() when the acceptmbox is created. - */ -#if !defined DEFAULT_ACCEPTMBOX_SIZE || defined __DOXYGEN__ -#define DEFAULT_ACCEPTMBOX_SIZE 0 -#endif -/** - * @} - */ - -/* - ---------------------------------------------- - ---------- Sequential layer options ---------- - ---------------------------------------------- -*/ -/** - * @defgroup lwip_opts_netconn Netconn - * @ingroup lwip_opts_threadsafe_apis - * @{ - */ -/** - * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c) - */ -#if !defined LWIP_NETCONN || defined __DOXYGEN__ -#define LWIP_NETCONN 1 -#endif - -/** LWIP_TCPIP_TIMEOUT==1: Enable tcpip_timeout/tcpip_untimeout to create - * timers running in tcpip_thread from another thread. - */ -#if !defined LWIP_TCPIP_TIMEOUT || defined __DOXYGEN__ -#define LWIP_TCPIP_TIMEOUT 0 -#endif - -/** LWIP_NETCONN_SEM_PER_THREAD==1: Use one (thread-local) semaphore per - * thread calling socket/netconn functions instead of allocating one - * semaphore per netconn (and per select etc.) - * ATTENTION: a thread-local semaphore for API calls is needed: - * - LWIP_NETCONN_THREAD_SEM_GET() returning a sys_sem_t* - * - LWIP_NETCONN_THREAD_SEM_ALLOC() creating the semaphore - * - LWIP_NETCONN_THREAD_SEM_FREE() freeing the semaphore - * The latter 2 can be invoked up by calling netconn_thread_init()/netconn_thread_cleanup(). - * Ports may call these for threads created with sys_thread_new(). - */ -#if !defined LWIP_NETCONN_SEM_PER_THREAD || defined __DOXYGEN__ -#define LWIP_NETCONN_SEM_PER_THREAD 0 -#endif - -/** LWIP_NETCONN_FULLDUPLEX==1: Enable code that allows reading from one thread, - * writing from a 2nd thread and closing from a 3rd thread at the same time. - * ATTENTION: This is currently really alpha! Some requirements: - * - LWIP_NETCONN_SEM_PER_THREAD==1 is required to use one socket/netconn from - * multiple threads at once - * - sys_mbox_free() has to unblock receive tasks waiting on recvmbox/acceptmbox - * and prevent a task pending on this during/after deletion - */ -#if !defined LWIP_NETCONN_FULLDUPLEX || defined __DOXYGEN__ -#define LWIP_NETCONN_FULLDUPLEX 0 -#endif -/** - * @} - */ - -/* - ------------------------------------ - ---------- Socket options ---------- - ------------------------------------ -*/ -/** - * @defgroup lwip_opts_socket Sockets - * @ingroup lwip_opts_threadsafe_apis - * @{ - */ -/** - * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c) - */ -#if !defined LWIP_SOCKET || defined __DOXYGEN__ -#define LWIP_SOCKET 1 -#endif - -/* LWIP_SOCKET_SET_ERRNO==1: Set errno when socket functions cannot complete - * successfully, as required by POSIX. Default is POSIX-compliant. - */ -#if !defined LWIP_SOCKET_SET_ERRNO || defined __DOXYGEN__ -#define LWIP_SOCKET_SET_ERRNO 1 -#endif - -/** - * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names through defines. - * LWIP_COMPAT_SOCKETS==2: Same as ==1 but correctly named functions are created. - * While this helps code completion, it might conflict with existing libraries. - * (only used if you use sockets.c) - */ -#if !defined LWIP_COMPAT_SOCKETS || defined __DOXYGEN__ -#define LWIP_COMPAT_SOCKETS 1 -#endif - -/** - * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names. - * Disable this option if you use a POSIX operating system that uses the same - * names (read, write & close). (only used if you use sockets.c) - */ -#if !defined LWIP_POSIX_SOCKETS_IO_NAMES || defined __DOXYGEN__ -#define LWIP_POSIX_SOCKETS_IO_NAMES 1 -#endif - -/** - * LWIP_SOCKET_OFFSET==n: Increases the file descriptor number created by LwIP with n. - * This can be useful when there are multiple APIs which create file descriptors. - * When they all start with a different offset and you won't make them overlap you can - * re implement read/write/close/ioctl/fnctl to send the requested action to the right - * library (sharing select will need more work though). - */ -#if !defined LWIP_SOCKET_OFFSET || defined __DOXYGEN__ -#define LWIP_SOCKET_OFFSET 0 -#endif - -/** - * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT - * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set - * in seconds. (does not require sockets.c, and will affect tcp.c) - */ -#if !defined LWIP_TCP_KEEPALIVE || defined __DOXYGEN__ -#define LWIP_TCP_KEEPALIVE 0 -#endif - -/** - * LWIP_SO_SNDTIMEO==1: Enable send timeout for sockets/netconns and - * SO_SNDTIMEO processing. - */ -#if !defined LWIP_SO_SNDTIMEO || defined __DOXYGEN__ -#define LWIP_SO_SNDTIMEO 0 -#endif - -/** - * LWIP_SO_RCVTIMEO==1: Enable receive timeout for sockets/netconns and - * SO_RCVTIMEO processing. - */ -#if !defined LWIP_SO_RCVTIMEO || defined __DOXYGEN__ -#define LWIP_SO_RCVTIMEO 0 -#endif - -/** - * LWIP_SO_SNDRCVTIMEO_NONSTANDARD==1: SO_RCVTIMEO/SO_SNDTIMEO take an int - * (milliseconds, much like winsock does) instead of a struct timeval (default). - */ -#if !defined LWIP_SO_SNDRCVTIMEO_NONSTANDARD || defined __DOXYGEN__ -#define LWIP_SO_SNDRCVTIMEO_NONSTANDARD 0 -#endif - -/** - * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing. - */ -#if !defined LWIP_SO_RCVBUF || defined __DOXYGEN__ -#define LWIP_SO_RCVBUF 0 -#endif - -/** - * LWIP_SO_LINGER==1: Enable SO_LINGER processing. - */ -#if !defined LWIP_SO_LINGER || defined __DOXYGEN__ -#define LWIP_SO_LINGER 0 -#endif - -/** - * If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize. - */ -#if !defined RECV_BUFSIZE_DEFAULT || defined __DOXYGEN__ -#define RECV_BUFSIZE_DEFAULT INT_MAX -#endif - -/** - * By default, TCP socket/netconn close waits 20 seconds max to send the FIN - */ -#if !defined LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT || defined __DOXYGEN__ -#define LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT 20000 -#endif - -/** - * SO_REUSE==1: Enable SO_REUSEADDR option. - */ -#if !defined SO_REUSE || defined __DOXYGEN__ -#define SO_REUSE 0 -#endif - -/** - * SO_REUSE_RXTOALL==1: Pass a copy of incoming broadcast/multicast packets - * to all local matches if SO_REUSEADDR is turned on. - * WARNING: Adds a memcpy for every packet if passing to more than one pcb! - */ -#if !defined SO_REUSE_RXTOALL || defined __DOXYGEN__ -#define SO_REUSE_RXTOALL 0 -#endif - -/** - * LWIP_FIONREAD_LINUXMODE==0 (default): ioctl/FIONREAD returns the amount of - * pending data in the network buffer. This is the way windows does it. It's - * the default for lwIP since it is smaller. - * LWIP_FIONREAD_LINUXMODE==1: ioctl/FIONREAD returns the size of the next - * pending datagram in bytes. This is the way linux does it. This code is only - * here for compatibility. - */ -#if !defined LWIP_FIONREAD_LINUXMODE || defined __DOXYGEN__ -#define LWIP_FIONREAD_LINUXMODE 0 -#endif -/** - * @} - */ - -/* - ---------------------------------------- - ---------- Statistics options ---------- - ---------------------------------------- -*/ -/** - * @defgroup lwip_opts_stats Statistics - * @ingroup lwip_opts_debug - * @{ - */ -/** - * LWIP_STATS==1: Enable statistics collection in lwip_stats. - */ -#if !defined LWIP_STATS || defined __DOXYGEN__ -#define LWIP_STATS 1 -#endif - -#if LWIP_STATS - -/** - * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions. - */ -#if !defined LWIP_STATS_DISPLAY || defined __DOXYGEN__ -#define LWIP_STATS_DISPLAY 0 -#endif - -/** - * LINK_STATS==1: Enable link stats. - */ -#if !defined LINK_STATS || defined __DOXYGEN__ -#define LINK_STATS 1 -#endif - -/** - * ETHARP_STATS==1: Enable etharp stats. - */ -#if !defined ETHARP_STATS || defined __DOXYGEN__ -#define ETHARP_STATS (LWIP_ARP) -#endif - -/** - * IP_STATS==1: Enable IP stats. - */ -#if !defined IP_STATS || defined __DOXYGEN__ -#define IP_STATS 1 -#endif - -/** - * IPFRAG_STATS==1: Enable IP fragmentation stats. Default is - * on if using either frag or reass. - */ -#if !defined IPFRAG_STATS || defined __DOXYGEN__ -#define IPFRAG_STATS (IP_REASSEMBLY || IP_FRAG) -#endif - -/** - * ICMP_STATS==1: Enable ICMP stats. - */ -#if !defined ICMP_STATS || defined __DOXYGEN__ -#define ICMP_STATS 1 -#endif - -/** - * IGMP_STATS==1: Enable IGMP stats. - */ -#if !defined IGMP_STATS || defined __DOXYGEN__ -#define IGMP_STATS (LWIP_IGMP) -#endif - -/** - * UDP_STATS==1: Enable UDP stats. Default is on if - * UDP enabled, otherwise off. - */ -#if !defined UDP_STATS || defined __DOXYGEN__ -#define UDP_STATS (LWIP_UDP) -#endif - -/** - * TCP_STATS==1: Enable TCP stats. Default is on if TCP - * enabled, otherwise off. - */ -#if !defined TCP_STATS || defined __DOXYGEN__ -#define TCP_STATS (LWIP_TCP) -#endif - -/** - * MEM_STATS==1: Enable mem.c stats. - */ -#if !defined MEM_STATS || defined __DOXYGEN__ -#define MEM_STATS ((MEM_LIBC_MALLOC == 0) && (MEM_USE_POOLS == 0)) -#endif - -/** - * MEMP_STATS==1: Enable memp.c pool stats. - */ -#if !defined MEMP_STATS || defined __DOXYGEN__ -#define MEMP_STATS (MEMP_MEM_MALLOC == 0) -#endif - -/** - * SYS_STATS==1: Enable system stats (sem and mbox counts, etc). - */ -#if !defined SYS_STATS || defined __DOXYGEN__ -#define SYS_STATS (NO_SYS == 0) -#endif - -/** - * IP6_STATS==1: Enable IPv6 stats. - */ -#if !defined IP6_STATS || defined __DOXYGEN__ -#define IP6_STATS (LWIP_IPV6) -#endif - -/** - * ICMP6_STATS==1: Enable ICMP for IPv6 stats. - */ -#if !defined ICMP6_STATS || defined __DOXYGEN__ -#define ICMP6_STATS (LWIP_IPV6 && LWIP_ICMP6) -#endif - -/** - * IP6_FRAG_STATS==1: Enable IPv6 fragmentation stats. - */ -#if !defined IP6_FRAG_STATS || defined __DOXYGEN__ -#define IP6_FRAG_STATS (LWIP_IPV6 && (LWIP_IPV6_FRAG || LWIP_IPV6_REASS)) -#endif - -/** - * MLD6_STATS==1: Enable MLD for IPv6 stats. - */ -#if !defined MLD6_STATS || defined __DOXYGEN__ -#define MLD6_STATS (LWIP_IPV6 && LWIP_IPV6_MLD) -#endif - -/** - * ND6_STATS==1: Enable Neighbor discovery for IPv6 stats. - */ -#if !defined ND6_STATS || defined __DOXYGEN__ -#define ND6_STATS (LWIP_IPV6) -#endif - -/** - * MIB2_STATS==1: Stats for SNMP MIB2. - */ -#if !defined MIB2_STATS || defined __DOXYGEN__ -#define MIB2_STATS 0 -#endif - -#else - -#define LINK_STATS 0 -#define ETHARP_STATS 0 -#define IP_STATS 0 -#define IPFRAG_STATS 0 -#define ICMP_STATS 0 -#define IGMP_STATS 0 -#define UDP_STATS 0 -#define TCP_STATS 0 -#define MEM_STATS 0 -#define MEMP_STATS 0 -#define SYS_STATS 0 -#define LWIP_STATS_DISPLAY 0 -#define IP6_STATS 0 -#define ICMP6_STATS 0 -#define IP6_FRAG_STATS 0 -#define MLD6_STATS 0 -#define ND6_STATS 0 -#define MIB2_STATS 0 - -#endif /* LWIP_STATS */ -/** - * @} - */ - -/* - -------------------------------------- - ---------- Checksum options ---------- - -------------------------------------- -*/ -/** - * @defgroup lwip_opts_checksum Checksum - * @ingroup lwip_opts_infrastructure - * @{ - */ -/** - * LWIP_CHECKSUM_CTRL_PER_NETIF==1: Checksum generation/check can be enabled/disabled - * per netif. - * ATTENTION: if enabled, the CHECKSUM_GEN_* and CHECKSUM_CHECK_* defines must be enabled! - */ -#if !defined LWIP_CHECKSUM_CTRL_PER_NETIF || defined __DOXYGEN__ -#define LWIP_CHECKSUM_CTRL_PER_NETIF 0 -#endif - -/** - * CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets. - */ -#if !defined CHECKSUM_GEN_IP || defined __DOXYGEN__ -#define CHECKSUM_GEN_IP 1 -#endif - -/** - * CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets. - */ -#if !defined CHECKSUM_GEN_UDP || defined __DOXYGEN__ -#define CHECKSUM_GEN_UDP 1 -#endif - -/** - * CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets. - */ -#if !defined CHECKSUM_GEN_TCP || defined __DOXYGEN__ -#define CHECKSUM_GEN_TCP 1 -#endif - -/** - * CHECKSUM_GEN_ICMP==1: Generate checksums in software for outgoing ICMP packets. - */ -#if !defined CHECKSUM_GEN_ICMP || defined __DOXYGEN__ -#define CHECKSUM_GEN_ICMP 1 -#endif - -/** - * CHECKSUM_GEN_ICMP6==1: Generate checksums in software for outgoing ICMP6 packets. - */ -#if !defined CHECKSUM_GEN_ICMP6 || defined __DOXYGEN__ -#define CHECKSUM_GEN_ICMP6 1 -#endif - -/** - * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets. - */ -#if !defined CHECKSUM_CHECK_IP || defined __DOXYGEN__ -#define CHECKSUM_CHECK_IP 1 -#endif - -/** - * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets. - */ -#if !defined CHECKSUM_CHECK_UDP || defined __DOXYGEN__ -#define CHECKSUM_CHECK_UDP 1 -#endif - -/** - * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets. - */ -#if !defined CHECKSUM_CHECK_TCP || defined __DOXYGEN__ -#define CHECKSUM_CHECK_TCP 1 -#endif - -/** - * CHECKSUM_CHECK_ICMP==1: Check checksums in software for incoming ICMP packets. - */ -#if !defined CHECKSUM_CHECK_ICMP || defined __DOXYGEN__ -#define CHECKSUM_CHECK_ICMP 1 -#endif - -/** - * CHECKSUM_CHECK_ICMP6==1: Check checksums in software for incoming ICMPv6 packets - */ -#if !defined CHECKSUM_CHECK_ICMP6 || defined __DOXYGEN__ -#define CHECKSUM_CHECK_ICMP6 1 -#endif - -/** - * LWIP_CHECKSUM_ON_COPY==1: Calculate checksum when copying data from - * application buffers to pbufs. - */ -#if !defined LWIP_CHECKSUM_ON_COPY || defined __DOXYGEN__ -#define LWIP_CHECKSUM_ON_COPY 0 -#endif -/** - * @} - */ - -/* - --------------------------------------- - ---------- IPv6 options --------------- - --------------------------------------- -*/ -/** - * @defgroup lwip_opts_ipv6 IPv6 - * @ingroup lwip_opts - * @{ - */ -/** - * LWIP_IPV6==1: Enable IPv6 - */ -#if !defined LWIP_IPV6 || defined __DOXYGEN__ -#define LWIP_IPV6 0 -#endif - -/** - * LWIP_IPV6_NUM_ADDRESSES: Number of IPv6 addresses per netif. - */ -#if !defined LWIP_IPV6_NUM_ADDRESSES || defined __DOXYGEN__ -#define LWIP_IPV6_NUM_ADDRESSES 3 -#endif - -/** - * LWIP_IPV6_FORWARD==1: Forward IPv6 packets across netifs - */ -#if !defined LWIP_IPV6_FORWARD || defined __DOXYGEN__ -#define LWIP_IPV6_FORWARD 0 -#endif - -/** - * LWIP_IPV6_FRAG==1: Fragment outgoing IPv6 packets that are too big. - */ -#if !defined LWIP_IPV6_FRAG || defined __DOXYGEN__ -#define LWIP_IPV6_FRAG 0 -#endif - -/** - * LWIP_IPV6_REASS==1: reassemble incoming IPv6 packets that fragmented - */ -#if !defined LWIP_IPV6_REASS || defined __DOXYGEN__ -#define LWIP_IPV6_REASS (LWIP_IPV6) -#endif - -/** - * LWIP_IPV6_SEND_ROUTER_SOLICIT==1: Send router solicitation messages during - * network startup. - */ -#if !defined LWIP_IPV6_SEND_ROUTER_SOLICIT || defined __DOXYGEN__ -#define LWIP_IPV6_SEND_ROUTER_SOLICIT 1 -#endif - -/** - * LWIP_IPV6_AUTOCONFIG==1: Enable stateless address autoconfiguration as per RFC 4862. - */ -#if !defined LWIP_IPV6_AUTOCONFIG || defined __DOXYGEN__ -#define LWIP_IPV6_AUTOCONFIG (LWIP_IPV6) -#endif - -/** - * LWIP_IPV6_DUP_DETECT_ATTEMPTS=[0..7]: Number of duplicate address detection attempts. - */ -#if !defined LWIP_IPV6_DUP_DETECT_ATTEMPTS || defined __DOXYGEN__ -#define LWIP_IPV6_DUP_DETECT_ATTEMPTS 1 -#endif -/** - * @} - */ - -/** - * @defgroup lwip_opts_icmp6 ICMP6 - * @ingroup lwip_opts_ipv6 - * @{ - */ -/** - * LWIP_ICMP6==1: Enable ICMPv6 (mandatory per RFC) - */ -#if !defined LWIP_ICMP6 || defined __DOXYGEN__ -#define LWIP_ICMP6 (LWIP_IPV6) -#endif - -/** - * LWIP_ICMP6_DATASIZE: bytes from original packet to send back in - * ICMPv6 error messages. - */ -#if !defined LWIP_ICMP6_DATASIZE || defined __DOXYGEN__ -#define LWIP_ICMP6_DATASIZE 8 -#endif - -/** - * LWIP_ICMP6_HL: default hop limit for ICMPv6 messages - */ -#if !defined LWIP_ICMP6_HL || defined __DOXYGEN__ -#define LWIP_ICMP6_HL 255 -#endif -/** - * @} - */ - -/** - * @defgroup lwip_opts_mld6 Multicast listener discovery - * @ingroup lwip_opts_ipv6 - * @{ - */ -/** - * LWIP_IPV6_MLD==1: Enable multicast listener discovery protocol. - * If LWIP_IPV6 is enabled but this setting is disabled, the MAC layer must - * indiscriminately pass all inbound IPv6 multicast traffic to lwIP. - */ -#if !defined LWIP_IPV6_MLD || defined __DOXYGEN__ -#define LWIP_IPV6_MLD (LWIP_IPV6) -#endif - -/** - * MEMP_NUM_MLD6_GROUP: Max number of IPv6 multicast groups that can be joined. - * There must be enough groups so that each netif can join the solicited-node - * multicast group for each of its local addresses, plus one for MDNS if - * applicable, plus any number of groups to be joined on UDP sockets. - */ -#if !defined MEMP_NUM_MLD6_GROUP || defined __DOXYGEN__ -#define MEMP_NUM_MLD6_GROUP 4 -#endif -/** - * @} - */ - -/** - * @defgroup lwip_opts_nd6 Neighbor discovery - * @ingroup lwip_opts_ipv6 - * @{ - */ -/** - * LWIP_ND6_QUEUEING==1: queue outgoing IPv6 packets while MAC address - * is being resolved. - */ -#if !defined LWIP_ND6_QUEUEING || defined __DOXYGEN__ -#define LWIP_ND6_QUEUEING (LWIP_IPV6) -#endif - -/** - * MEMP_NUM_ND6_QUEUE: Max number of IPv6 packets to queue during MAC resolution. - */ -#if !defined MEMP_NUM_ND6_QUEUE || defined __DOXYGEN__ -#define MEMP_NUM_ND6_QUEUE 20 -#endif - -/** - * LWIP_ND6_NUM_NEIGHBORS: Number of entries in IPv6 neighbor cache - */ -#if !defined LWIP_ND6_NUM_NEIGHBORS || defined __DOXYGEN__ -#define LWIP_ND6_NUM_NEIGHBORS 10 -#endif - -/** - * LWIP_ND6_NUM_DESTINATIONS: number of entries in IPv6 destination cache - */ -#if !defined LWIP_ND6_NUM_DESTINATIONS || defined __DOXYGEN__ -#define LWIP_ND6_NUM_DESTINATIONS 10 -#endif - -/** - * LWIP_ND6_NUM_PREFIXES: number of entries in IPv6 on-link prefixes cache - */ -#if !defined LWIP_ND6_NUM_PREFIXES || defined __DOXYGEN__ -#define LWIP_ND6_NUM_PREFIXES 5 -#endif - -/** - * LWIP_ND6_NUM_ROUTERS: number of entries in IPv6 default router cache - */ -#if !defined LWIP_ND6_NUM_ROUTERS || defined __DOXYGEN__ -#define LWIP_ND6_NUM_ROUTERS 3 -#endif - -/** - * LWIP_ND6_MAX_MULTICAST_SOLICIT: max number of multicast solicit messages to send - * (neighbor solicit and router solicit) - */ -#if !defined LWIP_ND6_MAX_MULTICAST_SOLICIT || defined __DOXYGEN__ -#define LWIP_ND6_MAX_MULTICAST_SOLICIT 3 -#endif - -/** - * LWIP_ND6_MAX_UNICAST_SOLICIT: max number of unicast neighbor solicitation messages - * to send during neighbor reachability detection. - */ -#if !defined LWIP_ND6_MAX_UNICAST_SOLICIT || defined __DOXYGEN__ -#define LWIP_ND6_MAX_UNICAST_SOLICIT 3 -#endif - -/** - * Unused: See ND RFC (time in milliseconds). - */ -#if !defined LWIP_ND6_MAX_ANYCAST_DELAY_TIME || defined __DOXYGEN__ -#define LWIP_ND6_MAX_ANYCAST_DELAY_TIME 1000 -#endif - -/** - * Unused: See ND RFC - */ -#if !defined LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT || defined __DOXYGEN__ -#define LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT 3 -#endif - -/** - * LWIP_ND6_REACHABLE_TIME: default neighbor reachable time (in milliseconds). - * May be updated by router advertisement messages. - */ -#if !defined LWIP_ND6_REACHABLE_TIME || defined __DOXYGEN__ -#define LWIP_ND6_REACHABLE_TIME 30000 -#endif - -/** - * LWIP_ND6_RETRANS_TIMER: default retransmission timer for solicitation messages - */ -#if !defined LWIP_ND6_RETRANS_TIMER || defined __DOXYGEN__ -#define LWIP_ND6_RETRANS_TIMER 1000 -#endif - -/** - * LWIP_ND6_DELAY_FIRST_PROBE_TIME: Delay before first unicast neighbor solicitation - * message is sent, during neighbor reachability detection. - */ -#if !defined LWIP_ND6_DELAY_FIRST_PROBE_TIME || defined __DOXYGEN__ -#define LWIP_ND6_DELAY_FIRST_PROBE_TIME 5000 -#endif - -/** - * LWIP_ND6_ALLOW_RA_UPDATES==1: Allow Router Advertisement messages to update - * Reachable time and retransmission timers, and netif MTU. - */ -#if !defined LWIP_ND6_ALLOW_RA_UPDATES || defined __DOXYGEN__ -#define LWIP_ND6_ALLOW_RA_UPDATES 1 -#endif - -/** - * LWIP_ND6_TCP_REACHABILITY_HINTS==1: Allow TCP to provide Neighbor Discovery - * with reachability hints for connected destinations. This helps avoid sending - * unicast neighbor solicitation messages. - */ -#if !defined LWIP_ND6_TCP_REACHABILITY_HINTS || defined __DOXYGEN__ -#define LWIP_ND6_TCP_REACHABILITY_HINTS 1 -#endif - -/** - * LWIP_ND6_RDNSS_MAX_DNS_SERVERS > 0: Use IPv6 Router Advertisement Recursive - * DNS Server Option (as per RFC 6106) to copy a defined maximum number of DNS - * servers to the DNS module. - */ -#if !defined LWIP_ND6_RDNSS_MAX_DNS_SERVERS || defined __DOXYGEN__ -#define LWIP_ND6_RDNSS_MAX_DNS_SERVERS 0 -#endif -/** - * @} - */ - -/** - * LWIP_IPV6_DHCP6==1: enable DHCPv6 stateful address autoconfiguration. - */ -#if !defined LWIP_IPV6_DHCP6 || defined __DOXYGEN__ -#define LWIP_IPV6_DHCP6 0 -#endif - -/* - --------------------------------------- - ---------- Hook options --------------- - --------------------------------------- -*/ - -/** - * @defgroup lwip_opts_hooks Hooks - * @ingroup lwip_opts_infrastructure - * Hooks are undefined by default, define them to a function if you need them. - * @{ - */ - -/** - * LWIP_HOOK_FILENAME: Custom filename to #include in files that provide hooks. - * Declare your hook function prototypes in there, you may also #include all headers - * providing data types that are need in this file. - */ -#ifdef __DOXYGEN__ -#define LWIP_HOOK_FILENAME "path/to/my/lwip_hooks.h" -#endif - -/** - * LWIP_HOOK_TCP_ISN: - * Hook for generation of the Initial Sequence Number (ISN) for a new TCP - * connection. The default lwIP ISN generation algorithm is very basic and may - * allow for TCP spoofing attacks. This hook provides the means to implement - * the standardized ISN generation algorithm from RFC 6528 (see contrib/adons/tcp_isn), - * or any other desired algorithm as a replacement. - * Called from tcp_connect() and tcp_listen_input() when an ISN is needed for - * a new TCP connection, if TCP support (@ref LWIP_TCP) is enabled.\n - * Signature: u32_t my_hook_tcp_isn(const ip_addr_t* local_ip, u16_t local_port, const ip_addr_t* remote_ip, u16_t remote_port); - * - it may be necessary to use "struct ip_addr" (ip4_addr, ip6_addr) instead of "ip_addr_t" in function declarations\n - * Arguments: - * - local_ip: pointer to the local IP address of the connection - * - local_port: local port number of the connection (host-byte order) - * - remote_ip: pointer to the remote IP address of the connection - * - remote_port: remote port number of the connection (host-byte order)\n - * Return value: - * - the 32-bit Initial Sequence Number to use for the new TCP connection. - */ -#ifdef __DOXYGEN__ -#define LWIP_HOOK_TCP_ISN(local_ip, local_port, remote_ip, remote_port) -#endif - -/** - * LWIP_HOOK_IP4_INPUT(pbuf, input_netif): - * - called from ip_input() (IPv4) - * - pbuf: received struct pbuf passed to ip_input() - * - input_netif: struct netif on which the packet has been received - * Return values: - * - 0: Hook has not consumed the packet, packet is processed as normal - * - != 0: Hook has consumed the packet. - * If the hook consumed the packet, 'pbuf' is in the responsibility of the hook - * (i.e. free it when done). - */ -#ifdef __DOXYGEN__ -#define LWIP_HOOK_IP4_INPUT(pbuf, input_netif) -#endif - -/** - * LWIP_HOOK_IP4_ROUTE(dest): - * - called from ip_route() (IPv4) - * - dest: destination IPv4 address - * Returns the destination netif or NULL if no destination netif is found. In - * that case, ip_route() continues as normal. - */ -#ifdef __DOXYGEN__ -#define LWIP_HOOK_IP4_ROUTE() -#endif - -/** - * LWIP_HOOK_IP4_ROUTE_SRC(dest, src): - * - source-based routing for IPv4 (see LWIP_HOOK_IP4_ROUTE(), src may be NULL) - */ -#ifdef __DOXYGEN__ -#define LWIP_HOOK_IP4_ROUTE_SRC(dest, src) -#endif - -/** - * LWIP_HOOK_ETHARP_GET_GW(netif, dest): - * - called from etharp_output() (IPv4) - * - netif: the netif used for sending - * - dest: the destination IPv4 address - * Returns the IPv4 address of the gateway to handle the specified destination - * IPv4 address. If NULL is returned, the netif's default gateway is used. - * The returned address MUST be directly reachable on the specified netif! - * This function is meant to implement advanced IPv4 routing together with - * LWIP_HOOK_IP4_ROUTE(). The actual routing/gateway table implementation is - * not part of lwIP but can e.g. be hidden in the netif's state argument. -*/ -#ifdef __DOXYGEN__ -#define LWIP_HOOK_ETHARP_GET_GW(netif, dest) -#endif - -/** - * LWIP_HOOK_IP6_INPUT(pbuf, input_netif): - * - called from ip6_input() (IPv6) - * - pbuf: received struct pbuf passed to ip6_input() - * - input_netif: struct netif on which the packet has been received - * Return values: - * - 0: Hook has not consumed the packet, packet is processed as normal - * - != 0: Hook has consumed the packet. - * If the hook consumed the packet, 'pbuf' is in the responsibility of the hook - * (i.e. free it when done). - */ -#ifdef __DOXYGEN__ -#define LWIP_HOOK_IP6_INPUT(pbuf, input_netif) -#endif - -/** - * LWIP_HOOK_IP6_ROUTE(src, dest): - * - called from ip6_route() (IPv6) - * - src: sourc IPv6 address - * - dest: destination IPv6 address - * Returns the destination netif or NULL if no destination netif is found. In - * that case, ip6_route() continues as normal. - */ -#ifdef __DOXYGEN__ -#define LWIP_HOOK_IP6_ROUTE(src, dest) -#endif - -/** - * LWIP_HOOK_ND6_GET_GW(netif, dest): - * - called from nd6_get_next_hop_entry() (IPv6) - * - netif: the netif used for sending - * - dest: the destination IPv6 address - * Returns the IPv6 address of the next hop to handle the specified destination - * IPv6 address. If NULL is returned, a NDP-discovered router is used instead. - * The returned address MUST be directly reachable on the specified netif! - * This function is meant to implement advanced IPv6 routing together with - * LWIP_HOOK_IP6_ROUTE(). The actual routing/gateway table implementation is - * not part of lwIP but can e.g. be hidden in the netif's state argument. -*/ -#ifdef __DOXYGEN__ -#define LWIP_HOOK_ND6_GET_GW(netif, dest) -#endif - -/** - * LWIP_HOOK_VLAN_CHECK(netif, eth_hdr, vlan_hdr): - * - called from ethernet_input() if VLAN support is enabled - * - netif: struct netif on which the packet has been received - * - eth_hdr: struct eth_hdr of the packet - * - vlan_hdr: struct eth_vlan_hdr of the packet - * Return values: - * - 0: Packet must be dropped. - * - != 0: Packet must be accepted. - */ -#ifdef __DOXYGEN__ -#define LWIP_HOOK_VLAN_CHECK(netif, eth_hdr, vlan_hdr) -#endif - -/** - * LWIP_HOOK_VLAN_SET: - * Hook can be used to set prio_vid field of vlan_hdr. If you need to store data - * on per-netif basis to implement this callback, see @ref netif_cd. - * Called from ethernet_output() if VLAN support (@ref ETHARP_SUPPORT_VLAN) is enabled.\n - * Signature: s32_t my_hook_vlan_set(struct netif* netif, struct pbuf* pbuf, const struct eth_addr* src, const struct eth_addr* dst, u16_t eth_type);\n - * Arguments: - * - netif: struct netif that the packet will be sent through - * - p: struct pbuf packet to be sent - * - src: source eth address - * - dst: destination eth address - * - eth_type: ethernet type to packet to be sent\n - * - * - * Return values: - * - <0: Packet shall not contain VLAN header. - * - 0 <= return value <= 0xFFFF: Packet shall contain VLAN header. Return value is prio_vid in host byte order. - */ -#ifdef __DOXYGEN__ -#define LWIP_HOOK_VLAN_SET(netif, p, src, dst, eth_type) -#endif - -/** - * LWIP_HOOK_MEMP_AVAILABLE(memp_t_type): - * - called from memp_free() when a memp pool was empty and an item is now available - */ -#ifdef __DOXYGEN__ -#define LWIP_HOOK_MEMP_AVAILABLE(memp_t_type) -#endif - -/** - * LWIP_HOOK_UNKNOWN_ETH_PROTOCOL(pbuf, netif): - * Called from ethernet_input() when an unknown eth type is encountered. - * Return ERR_OK if packet is accepted, any error code otherwise. - * Payload points to ethernet header! - */ -#ifdef __DOXYGEN__ -#define LWIP_HOOK_UNKNOWN_ETH_PROTOCOL(pbuf, netif) -#endif -/** - * @} - */ - -/* - --------------------------------------- - ---------- Debugging options ---------- - --------------------------------------- -*/ -/** - * @defgroup lwip_opts_debugmsg Debug messages - * @ingroup lwip_opts_debug - * @{ - */ -/** - * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is - * compared against this value. If it is smaller, then debugging - * messages are written. - * @see debugging_levels - */ -#if !defined LWIP_DBG_MIN_LEVEL || defined __DOXYGEN__ -#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL -#endif - -/** - * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable - * debug messages of certain types. - * @see debugging_levels - */ -#if !defined LWIP_DBG_TYPES_ON || defined __DOXYGEN__ -#define LWIP_DBG_TYPES_ON LWIP_DBG_ON -#endif - -/** - * ETHARP_DEBUG: Enable debugging in etharp.c. - */ -#if !defined ETHARP_DEBUG || defined __DOXYGEN__ -#define ETHARP_DEBUG LWIP_DBG_OFF -#endif - -/** - * NETIF_DEBUG: Enable debugging in netif.c. - */ -#if !defined NETIF_DEBUG || defined __DOXYGEN__ -#define NETIF_DEBUG LWIP_DBG_OFF -#endif - -/** - * PBUF_DEBUG: Enable debugging in pbuf.c. - */ -#if !defined PBUF_DEBUG || defined __DOXYGEN__ -#define PBUF_DEBUG LWIP_DBG_OFF -#endif - -/** - * API_LIB_DEBUG: Enable debugging in api_lib.c. - */ -#if !defined API_LIB_DEBUG || defined __DOXYGEN__ -#define API_LIB_DEBUG LWIP_DBG_OFF -#endif - -/** - * API_MSG_DEBUG: Enable debugging in api_msg.c. - */ -#if !defined API_MSG_DEBUG || defined __DOXYGEN__ -#define API_MSG_DEBUG LWIP_DBG_OFF -#endif - -/** - * SOCKETS_DEBUG: Enable debugging in sockets.c. - */ -#if !defined SOCKETS_DEBUG || defined __DOXYGEN__ -#define SOCKETS_DEBUG LWIP_DBG_OFF -#endif - -/** - * ICMP_DEBUG: Enable debugging in icmp.c. - */ -#if !defined ICMP_DEBUG || defined __DOXYGEN__ -#define ICMP_DEBUG LWIP_DBG_OFF -#endif - -/** - * IGMP_DEBUG: Enable debugging in igmp.c. - */ -#if !defined IGMP_DEBUG || defined __DOXYGEN__ -#define IGMP_DEBUG LWIP_DBG_OFF -#endif - -/** - * INET_DEBUG: Enable debugging in inet.c. - */ -#if !defined INET_DEBUG || defined __DOXYGEN__ -#define INET_DEBUG LWIP_DBG_OFF -#endif - -/** - * IP_DEBUG: Enable debugging for IP. - */ -#if !defined IP_DEBUG || defined __DOXYGEN__ -#define IP_DEBUG LWIP_DBG_OFF -#endif - -/** - * IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass. - */ -#if !defined IP_REASS_DEBUG || defined __DOXYGEN__ -#define IP_REASS_DEBUG LWIP_DBG_OFF -#endif - -/** - * RAW_DEBUG: Enable debugging in raw.c. - */ -#if !defined RAW_DEBUG || defined __DOXYGEN__ -#define RAW_DEBUG LWIP_DBG_OFF -#endif - -/** - * MEM_DEBUG: Enable debugging in mem.c. - */ -#if !defined MEM_DEBUG || defined __DOXYGEN__ -#define MEM_DEBUG LWIP_DBG_OFF -#endif - -/** - * MEMP_DEBUG: Enable debugging in memp.c. - */ -#if !defined MEMP_DEBUG || defined __DOXYGEN__ -#define MEMP_DEBUG LWIP_DBG_OFF -#endif - -/** - * SYS_DEBUG: Enable debugging in sys.c. - */ -#if !defined SYS_DEBUG || defined __DOXYGEN__ -#define SYS_DEBUG LWIP_DBG_OFF -#endif - -/** - * TIMERS_DEBUG: Enable debugging in timers.c. - */ -#if !defined TIMERS_DEBUG || defined __DOXYGEN__ -#define TIMERS_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_DEBUG: Enable debugging for TCP. - */ -#if !defined TCP_DEBUG || defined __DOXYGEN__ -#define TCP_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug. - */ -#if !defined TCP_INPUT_DEBUG || defined __DOXYGEN__ -#define TCP_INPUT_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit. - */ -#if !defined TCP_FR_DEBUG || defined __DOXYGEN__ -#define TCP_FR_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_RTO_DEBUG: Enable debugging in TCP for retransmit - * timeout. - */ -#if !defined TCP_RTO_DEBUG || defined __DOXYGEN__ -#define TCP_RTO_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_CWND_DEBUG: Enable debugging for TCP congestion window. - */ -#if !defined TCP_CWND_DEBUG || defined __DOXYGEN__ -#define TCP_CWND_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating. - */ -#if !defined TCP_WND_DEBUG || defined __DOXYGEN__ -#define TCP_WND_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions. - */ -#if !defined TCP_OUTPUT_DEBUG || defined __DOXYGEN__ -#define TCP_OUTPUT_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_RST_DEBUG: Enable debugging for TCP with the RST message. - */ -#if !defined TCP_RST_DEBUG || defined __DOXYGEN__ -#define TCP_RST_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths. - */ -#if !defined TCP_QLEN_DEBUG || defined __DOXYGEN__ -#define TCP_QLEN_DEBUG LWIP_DBG_OFF -#endif - -/** - * UDP_DEBUG: Enable debugging in UDP. - */ -#if !defined UDP_DEBUG || defined __DOXYGEN__ -#define UDP_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCPIP_DEBUG: Enable debugging in tcpip.c. - */ -#if !defined TCPIP_DEBUG || defined __DOXYGEN__ -#define TCPIP_DEBUG LWIP_DBG_OFF -#endif - -/** - * SLIP_DEBUG: Enable debugging in slipif.c. - */ -#if !defined SLIP_DEBUG || defined __DOXYGEN__ -#define SLIP_DEBUG LWIP_DBG_OFF -#endif - -/** - * DHCP_DEBUG: Enable debugging in dhcp.c. - */ -#if !defined DHCP_DEBUG || defined __DOXYGEN__ -#define DHCP_DEBUG LWIP_DBG_OFF -#endif - -/** - * AUTOIP_DEBUG: Enable debugging in autoip.c. - */ -#if !defined AUTOIP_DEBUG || defined __DOXYGEN__ -#define AUTOIP_DEBUG LWIP_DBG_OFF -#endif - -/** - * DNS_DEBUG: Enable debugging for DNS. - */ -#if !defined DNS_DEBUG || defined __DOXYGEN__ -#define DNS_DEBUG LWIP_DBG_OFF -#endif - -/** - * IP6_DEBUG: Enable debugging for IPv6. - */ -#if !defined IP6_DEBUG || defined __DOXYGEN__ -#define IP6_DEBUG LWIP_DBG_OFF -#endif -/** - * @} - */ - -/* - -------------------------------------------------- - ---------- Performance tracking options ---------- - -------------------------------------------------- -*/ -/** - * @defgroup lwip_opts_perf Performance - * @ingroup lwip_opts_debug - * @{ - */ -/** - * LWIP_PERF: Enable performance testing for lwIP - * (if enabled, arch/perf.h is included) - */ -#if !defined LWIP_PERF || defined __DOXYGEN__ -#define LWIP_PERF 0 -#endif -/** - * @} - */ - -#endif /* LWIP_HDR_OPT_H */ diff --git a/tools/sdk/include/lwip/lwip/pbuf.h b/tools/sdk/include/lwip/lwip/pbuf.h deleted file mode 100644 index a8f1d951ade..00000000000 --- a/tools/sdk/include/lwip/lwip/pbuf.h +++ /dev/null @@ -1,268 +0,0 @@ -/** - * @file - * pbuf API - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ - -#ifndef LWIP_HDR_PBUF_H -#define LWIP_HDR_PBUF_H - -#include "lwip/opt.h" -#include "lwip/err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** LWIP_SUPPORT_CUSTOM_PBUF==1: Custom pbufs behave much like their pbuf type - * but they are allocated by external code (initialised by calling - * pbuf_alloced_custom()) and when pbuf_free gives up their last reference, they - * are freed by calling pbuf_custom->custom_free_function(). - * Currently, the pbuf_custom code is only needed for one specific configuration - * of IP_FRAG, unless required by external driver/application code. */ -#ifndef LWIP_SUPPORT_CUSTOM_PBUF -#define LWIP_SUPPORT_CUSTOM_PBUF ((IP_FRAG && !LWIP_NETIF_TX_SINGLE_PBUF) || (LWIP_IPV6 && LWIP_IPV6_FRAG)) -#endif - -/* @todo: We need a mechanism to prevent wasting memory in every pbuf - (TCP vs. UDP, IPv4 vs. IPv6: UDP/IPv4 packets may waste up to 28 bytes) */ - -#define PBUF_TRANSPORT_HLEN 20 -#if LWIP_IPV6 -#define PBUF_IP_HLEN 40 -#else -#define PBUF_IP_HLEN 20 -#endif - -/** - * @ingroup pbuf - * Enumeration of pbuf layers - */ -typedef enum { - /** Includes spare room for transport layer header, e.g. UDP header. - * Use this if you intend to pass the pbuf to functions like udp_send(). - */ - PBUF_TRANSPORT, - /** Includes spare room for IP header. - * Use this if you intend to pass the pbuf to functions like raw_send(). - */ - PBUF_IP, - /** Includes spare room for link layer header (ethernet header). - * Use this if you intend to pass the pbuf to functions like ethernet_output(). - * @see PBUF_LINK_HLEN - */ - PBUF_LINK, - /** Includes spare room for additional encapsulation header before ethernet - * headers (e.g. 802.11). - * Use this if you intend to pass the pbuf to functions like netif->linkoutput(). - * @see PBUF_LINK_ENCAPSULATION_HLEN - */ - PBUF_RAW_TX, - /** Use this for input packets in a netif driver when calling netif->input() - * in the most common case - ethernet-layer netif driver. */ - PBUF_RAW -} pbuf_layer; - -/** - * @ingroup pbuf - * Enumeration of pbuf types - */ -typedef enum { - /** pbuf data is stored in RAM, used for TX mostly, struct pbuf and its payload - are allocated in one piece of contiguous memory (so the first payload byte - can be calculated from struct pbuf). - pbuf_alloc() allocates PBUF_RAM pbufs as unchained pbufs (although that might - change in future versions). - This should be used for all OUTGOING packets (TX).*/ - PBUF_RAM, - /** pbuf data is stored in ROM, i.e. struct pbuf and its payload are located in - totally different memory areas. Since it points to ROM, payload does not - have to be copied when queued for transmission. */ - PBUF_ROM, - /** pbuf comes from the pbuf pool. Much like PBUF_ROM but payload might change - so it has to be duplicated when queued before transmitting, depending on - who has a 'ref' to it. */ - PBUF_REF, - /** pbuf payload refers to RAM. This one comes from a pool and should be used - for RX. Payload can be chained (scatter-gather RX) but like PBUF_RAM, struct - pbuf and its payload are allocated in one piece of contiguous memory (so - the first payload byte can be calculated from struct pbuf). - Don't use this for TX, if the pool becomes empty e.g. because of TCP queuing, - you are unable to receive TCP acks! */ - PBUF_POOL -} pbuf_type; - - -/** indicates this packet's data should be immediately passed to the application */ -#define PBUF_FLAG_PUSH 0x01U -/** indicates this is a custom pbuf: pbuf_free calls pbuf_custom->custom_free_function() - when the last reference is released (plus custom PBUF_RAM cannot be trimmed) */ -#define PBUF_FLAG_IS_CUSTOM 0x02U -/** indicates this pbuf is UDP multicast to be looped back */ -#define PBUF_FLAG_MCASTLOOP 0x04U -/** indicates this pbuf was received as link-level broadcast */ -#define PBUF_FLAG_LLBCAST 0x08U -/** indicates this pbuf was received as link-level multicast */ -#define PBUF_FLAG_LLMCAST 0x10U -/** indicates this pbuf includes a TCP FIN flag */ -#define PBUF_FLAG_TCP_FIN 0x20U - -/** Main packet buffer struct */ -struct pbuf { - /** next pbuf in singly linked pbuf chain */ - struct pbuf *next; - - /** pointer to the actual data in the buffer */ - void *payload; - - /** - * total length of this buffer and all next buffers in chain - * belonging to the same packet. - * - * For non-queue packet chains this is the invariant: - * p->tot_len == p->len + (p->next? p->next->tot_len: 0) - */ - u16_t tot_len; - - /** length of this buffer */ - u16_t len; - - /** pbuf_type as u8_t instead of enum to save space */ - u8_t /*pbuf_type*/ type; - - /** misc flags */ - u8_t flags; - - /** - * the reference count always equals the number of pointers - * that refer to this pbuf. This can be pointers from an application, - * the stack itself, or pbuf->next pointers from a chain. - */ - u16_t ref; - -#if ESP_LWIP - struct netif *l2_owner; - void *l2_buf; -#endif -}; - - -/** Helper struct for const-correctness only. - * The only meaning of this one is to provide a const payload pointer - * for PBUF_ROM type. - */ -struct pbuf_rom { - /** next pbuf in singly linked pbuf chain */ - struct pbuf *next; - - /** pointer to the actual data in the buffer */ - const void *payload; -}; - -#if LWIP_SUPPORT_CUSTOM_PBUF -/** Prototype for a function to free a custom pbuf */ -typedef void (*pbuf_free_custom_fn)(struct pbuf *p); - -/** A custom pbuf: like a pbuf, but following a function pointer to free it. */ -struct pbuf_custom { - /** The actual pbuf */ - struct pbuf pbuf; - /** This function is called when pbuf_free deallocates this pbuf(_custom) */ - pbuf_free_custom_fn custom_free_function; -}; -#endif /* LWIP_SUPPORT_CUSTOM_PBUF */ - -/** Define this to 0 to prevent freeing ooseq pbufs when the PBUF_POOL is empty */ -#ifndef PBUF_POOL_FREE_OOSEQ -#define PBUF_POOL_FREE_OOSEQ 1 -#endif /* PBUF_POOL_FREE_OOSEQ */ -#if LWIP_TCP && TCP_QUEUE_OOSEQ && NO_SYS && PBUF_POOL_FREE_OOSEQ -extern volatile u8_t pbuf_free_ooseq_pending; -void pbuf_free_ooseq(void); -/** When not using sys_check_timeouts(), call PBUF_CHECK_FREE_OOSEQ() - at regular intervals from main level to check if ooseq pbufs need to be - freed! */ -#define PBUF_CHECK_FREE_OOSEQ() do { if(pbuf_free_ooseq_pending) { \ - /* pbuf_alloc() reported PBUF_POOL to be empty -> try to free some \ - ooseq queued pbufs now */ \ - pbuf_free_ooseq(); }}while(0) -#else /* LWIP_TCP && TCP_QUEUE_OOSEQ && NO_SYS && PBUF_POOL_FREE_OOSEQ */ - /* Otherwise declare an empty PBUF_CHECK_FREE_OOSEQ */ - #define PBUF_CHECK_FREE_OOSEQ() -#endif /* LWIP_TCP && TCP_QUEUE_OOSEQ && NO_SYS && PBUF_POOL_FREE_OOSEQ*/ - -/* Initializes the pbuf module. This call is empty for now, but may not be in future. */ -#define pbuf_init() - -struct pbuf *pbuf_alloc(pbuf_layer l, u16_t length, pbuf_type type); -#if LWIP_SUPPORT_CUSTOM_PBUF -struct pbuf *pbuf_alloced_custom(pbuf_layer l, u16_t length, pbuf_type type, - struct pbuf_custom *p, void *payload_mem, - u16_t payload_mem_len); -#endif /* LWIP_SUPPORT_CUSTOM_PBUF */ -void pbuf_realloc(struct pbuf *p, u16_t size); -u8_t pbuf_header(struct pbuf *p, s16_t header_size); -u8_t pbuf_header_force(struct pbuf *p, s16_t header_size); -void pbuf_ref(struct pbuf *p); -u8_t pbuf_free(struct pbuf *p); -u16_t pbuf_clen(const struct pbuf *p); -void pbuf_cat(struct pbuf *head, struct pbuf *tail); -void pbuf_chain(struct pbuf *head, struct pbuf *tail); -struct pbuf *pbuf_dechain(struct pbuf *p); -err_t pbuf_copy(struct pbuf *p_to, const struct pbuf *p_from); -u16_t pbuf_copy_partial(const struct pbuf *p, void *dataptr, u16_t len, u16_t offset); -err_t pbuf_take(struct pbuf *buf, const void *dataptr, u16_t len); -err_t pbuf_take_at(struct pbuf *buf, const void *dataptr, u16_t len, u16_t offset); -struct pbuf *pbuf_skip(struct pbuf* in, u16_t in_offset, u16_t* out_offset); -struct pbuf *pbuf_coalesce(struct pbuf *p, pbuf_layer layer); -#if LWIP_CHECKSUM_ON_COPY -err_t pbuf_fill_chksum(struct pbuf *p, u16_t start_offset, const void *dataptr, - u16_t len, u16_t *chksum); -#endif /* LWIP_CHECKSUM_ON_COPY */ -#if LWIP_TCP && TCP_QUEUE_OOSEQ && LWIP_WND_SCALE -void pbuf_split_64k(struct pbuf *p, struct pbuf **rest); -#endif /* LWIP_TCP && TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ - -u8_t pbuf_get_at(const struct pbuf* p, u16_t offset); -int pbuf_try_get_at(const struct pbuf* p, u16_t offset); -void pbuf_put_at(struct pbuf* p, u16_t offset, u8_t data); -u16_t pbuf_memcmp(const struct pbuf* p, u16_t offset, const void* s2, u16_t n); -u16_t pbuf_memfind(const struct pbuf* p, const void* mem, u16_t mem_len, u16_t start_offset); -u16_t pbuf_strstr(const struct pbuf* p, const char* substr); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_PBUF_H */ diff --git a/tools/sdk/include/lwip/lwip/priv/api_msg.h b/tools/sdk/include/lwip/lwip/priv/api_msg.h deleted file mode 100644 index bcc0b5019af..00000000000 --- a/tools/sdk/include/lwip/lwip/priv/api_msg.h +++ /dev/null @@ -1,224 +0,0 @@ -/** - * @file - * netconn API lwIP internal implementations (do not use in application code) - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_API_MSG_H -#define LWIP_HDR_API_MSG_H - -#include "lwip/opt.h" - -#if LWIP_NETCONN || LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */ -/* Note: Netconn API is always available when sockets are enabled - - * sockets are implemented on top of them */ - -#include "lwip/arch.h" -#include "lwip/ip_addr.h" -#include "lwip/err.h" -#include "lwip/sys.h" -#include "lwip/igmp.h" -#include "lwip/api.h" -#include "lwip/priv/tcpip_priv.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if LWIP_MPU_COMPATIBLE -#if LWIP_NETCONN_SEM_PER_THREAD -#define API_MSG_M_DEF_SEM(m) *m -#else -#define API_MSG_M_DEF_SEM(m) API_MSG_M_DEF(m) -#endif -#else /* LWIP_MPU_COMPATIBLE */ -#define API_MSG_M_DEF_SEM(m) API_MSG_M_DEF(m) -#endif /* LWIP_MPU_COMPATIBLE */ - -/* For the netconn API, these values are use as a bitmask! */ -#define NETCONN_SHUT_RD 1 -#define NETCONN_SHUT_WR 2 -#define NETCONN_SHUT_RDWR (NETCONN_SHUT_RD | NETCONN_SHUT_WR) - -/* IP addresses and port numbers are expected to be in - * the same byte order as in the corresponding pcb. - */ -/** This struct includes everything that is necessary to execute a function - for a netconn in another thread context (mainly used to process netconns - in the tcpip_thread context to be thread safe). */ -struct api_msg { - /** The netconn which to process - always needed: it includes the semaphore - which is used to block the application thread until the function finished. */ - struct netconn *conn; - /** The return value of the function executed in tcpip_thread. */ - err_t err; - /** Depending on the executed function, one of these union members is used */ - union { - /** used for lwip_netconn_do_send */ - struct netbuf *b; - /** used for lwip_netconn_do_newconn */ - struct { - u8_t proto; - } n; - /** used for lwip_netconn_do_bind and lwip_netconn_do_connect */ - struct { - API_MSG_M_DEF_C(ip_addr_t, ipaddr); - u16_t port; - } bc; - /** used for lwip_netconn_do_getaddr */ - struct { - ip_addr_t API_MSG_M_DEF(ipaddr); - u16_t API_MSG_M_DEF(port); - u8_t local; - } ad; - /** used for lwip_netconn_do_write */ - struct { - const void *dataptr; - size_t len; - u8_t apiflags; -#if LWIP_SO_SNDTIMEO - u32_t time_started; -#endif /* LWIP_SO_SNDTIMEO */ - } w; - /** used for lwip_netconn_do_recv */ - struct { - u32_t len; - } r; -#if LWIP_TCP - /** used for lwip_netconn_do_close (/shutdown) */ - struct { - u8_t shut; -#if LWIP_SO_SNDTIMEO || LWIP_SO_LINGER - u32_t time_started; -#else /* LWIP_SO_SNDTIMEO || LWIP_SO_LINGER */ - u8_t polls_left; -#endif /* LWIP_SO_SNDTIMEO || LWIP_SO_LINGER */ - } sd; -#endif /* LWIP_TCP */ -#if LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) - /** used for lwip_netconn_do_join_leave_group */ - struct { - API_MSG_M_DEF_C(ip_addr_t, multiaddr); - API_MSG_M_DEF_C(ip_addr_t, netif_addr); - enum netconn_igmp join_or_leave; - } jl; -#endif /* LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) */ -#if TCP_LISTEN_BACKLOG - struct { - u8_t backlog; - } lb; -#endif /* TCP_LISTEN_BACKLOG */ - } msg; -#if LWIP_NETCONN_SEM_PER_THREAD - sys_sem_t* op_completed_sem; -#endif /* LWIP_NETCONN_SEM_PER_THREAD */ -}; - -#if LWIP_NETCONN_SEM_PER_THREAD -#define LWIP_API_MSG_SEM(msg) ((msg)->op_completed_sem) -#else /* LWIP_NETCONN_SEM_PER_THREAD */ -#define LWIP_API_MSG_SEM(msg) (&(msg)->conn->op_completed) -#endif /* LWIP_NETCONN_SEM_PER_THREAD */ - - -#if LWIP_DNS -/** As lwip_netconn_do_gethostbyname requires more arguments but doesn't require a netconn, - it has its own struct (to avoid struct api_msg getting bigger than necessary). - lwip_netconn_do_gethostbyname must be called using tcpip_callback instead of tcpip_apimsg - (see netconn_gethostbyname). */ -struct dns_api_msg { - /** Hostname to query or dotted IP address string */ -#if LWIP_MPU_COMPATIBLE - char name[DNS_MAX_NAME_LENGTH]; -#else /* LWIP_MPU_COMPATIBLE */ - const char *name; -#endif /* LWIP_MPU_COMPATIBLE */ - /** The resolved address is stored here */ - ip_addr_t API_MSG_M_DEF(addr); -#if LWIP_IPV4 && LWIP_IPV6 - /** Type of resolve call */ - u8_t dns_addrtype; -#endif /* LWIP_IPV4 && LWIP_IPV6 */ - /** This semaphore is posted when the name is resolved, the application thread - should wait on it. */ - sys_sem_t API_MSG_M_DEF_SEM(sem); - /** Errors are given back here */ - err_t API_MSG_M_DEF(err); -}; -#endif /* LWIP_DNS */ - -#if LWIP_NETCONN_SEM_PER_THREAD -#if ESP_THREAD_SAFE -#define LWIP_NETCONN_THREAD_SEM_GET() sys_thread_sem_get() -#define LWIP_NETCONN_THREAD_SEM_ALLOC() sys_thread_sem_init() -#define LWIP_NETCONN_THREAD_SEM_FREE() sys_thread_sem_deinit() -#endif -#endif - -#if LWIP_TCP -extern u8_t netconn_aborted; -#endif /* LWIP_TCP */ - -void lwip_netconn_do_newconn (void *m); -void lwip_netconn_do_delconn (void *m); -void lwip_netconn_do_bind (void *m); -void lwip_netconn_do_connect (void *m); -void lwip_netconn_do_disconnect (void *m); -void lwip_netconn_do_listen (void *m); -void lwip_netconn_do_send (void *m); -void lwip_netconn_do_recv (void *m); -#if TCP_LISTEN_BACKLOG -void lwip_netconn_do_accepted (void *m); -#endif /* TCP_LISTEN_BACKLOG */ -void lwip_netconn_do_write (void *m); -void lwip_netconn_do_getaddr (void *m); -void lwip_netconn_do_close (void *m); -void lwip_netconn_do_shutdown (void *m); -#if LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) -void lwip_netconn_do_join_leave_group(void *m); -#endif /* LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) */ - -#if LWIP_DNS -void lwip_netconn_do_gethostbyname(void *arg); -#endif /* LWIP_DNS */ - -struct netconn* netconn_alloc(enum netconn_type t, netconn_callback callback); -void netconn_free(struct netconn *conn); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_NETCONN || LWIP_SOCKET */ - -#endif /* LWIP_HDR_API_MSG_H */ diff --git a/tools/sdk/include/lwip/lwip/priv/memp_priv.h b/tools/sdk/include/lwip/lwip/priv/memp_priv.h deleted file mode 100644 index f246061dadf..00000000000 --- a/tools/sdk/include/lwip/lwip/priv/memp_priv.h +++ /dev/null @@ -1,183 +0,0 @@ -/** - * @file - * memory pools lwIP internal implementations (do not use in application code) - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ - -#ifndef LWIP_HDR_MEMP_PRIV_H -#define LWIP_HDR_MEMP_PRIV_H - -#include "lwip/opt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#include "lwip/mem.h" - -#if MEMP_OVERFLOW_CHECK -/* if MEMP_OVERFLOW_CHECK is turned on, we reserve some bytes at the beginning - * and at the end of each element, initialize them as 0xcd and check - * them later. */ -/* If MEMP_OVERFLOW_CHECK is >= 2, on every call to memp_malloc or memp_free, - * every single element in each pool is checked! - * This is VERY SLOW but also very helpful. */ -/* MEMP_SANITY_REGION_BEFORE and MEMP_SANITY_REGION_AFTER can be overridden in - * lwipopts.h to change the amount reserved for checking. */ -#ifndef MEMP_SANITY_REGION_BEFORE -#define MEMP_SANITY_REGION_BEFORE 16 -#endif /* MEMP_SANITY_REGION_BEFORE*/ -#if MEMP_SANITY_REGION_BEFORE > 0 -#define MEMP_SANITY_REGION_BEFORE_ALIGNED LWIP_MEM_ALIGN_SIZE(MEMP_SANITY_REGION_BEFORE) -#else -#define MEMP_SANITY_REGION_BEFORE_ALIGNED 0 -#endif /* MEMP_SANITY_REGION_BEFORE*/ -#ifndef MEMP_SANITY_REGION_AFTER -#define MEMP_SANITY_REGION_AFTER 16 -#endif /* MEMP_SANITY_REGION_AFTER*/ -#if MEMP_SANITY_REGION_AFTER > 0 -#define MEMP_SANITY_REGION_AFTER_ALIGNED LWIP_MEM_ALIGN_SIZE(MEMP_SANITY_REGION_AFTER) -#else -#define MEMP_SANITY_REGION_AFTER_ALIGNED 0 -#endif /* MEMP_SANITY_REGION_AFTER*/ - -/* MEMP_SIZE: save space for struct memp and for sanity check */ -#define MEMP_SIZE (LWIP_MEM_ALIGN_SIZE(sizeof(struct memp)) + MEMP_SANITY_REGION_BEFORE_ALIGNED) -#define MEMP_ALIGN_SIZE(x) (LWIP_MEM_ALIGN_SIZE(x) + MEMP_SANITY_REGION_AFTER_ALIGNED) - -#else /* MEMP_OVERFLOW_CHECK */ - -/* No sanity checks - * We don't need to preserve the struct memp while not allocated, so we - * can save a little space and set MEMP_SIZE to 0. - */ -#define MEMP_SIZE 0 -#define MEMP_ALIGN_SIZE(x) (LWIP_MEM_ALIGN_SIZE(x)) - -#endif /* MEMP_OVERFLOW_CHECK */ - -#if !MEMP_MEM_MALLOC || MEMP_OVERFLOW_CHECK -struct memp { - struct memp *next; -#if MEMP_OVERFLOW_CHECK - const char *file; - int line; -#endif /* MEMP_OVERFLOW_CHECK */ -}; -#endif /* !MEMP_MEM_MALLOC || MEMP_OVERFLOW_CHECK */ - -#if MEM_USE_POOLS && MEMP_USE_CUSTOM_POOLS -/* Use a helper type to get the start and end of the user "memory pools" for mem_malloc */ -typedef enum { - /* Get the first (via: - MEMP_POOL_HELPER_START = ((u8_t) 1*MEMP_POOL_A + 0*MEMP_POOL_B + 0*MEMP_POOL_C + 0)*/ - MEMP_POOL_HELPER_FIRST = ((u8_t) -#define LWIP_MEMPOOL(name,num,size,desc) -#define LWIP_MALLOC_MEMPOOL_START 1 -#define LWIP_MALLOC_MEMPOOL(num, size) * MEMP_POOL_##size + 0 -#define LWIP_MALLOC_MEMPOOL_END -#include "lwip/priv/memp_std.h" - ) , - /* Get the last (via: - MEMP_POOL_HELPER_END = ((u8_t) 0 + MEMP_POOL_A*0 + MEMP_POOL_B*0 + MEMP_POOL_C*1) */ - MEMP_POOL_HELPER_LAST = ((u8_t) -#define LWIP_MEMPOOL(name,num,size,desc) -#define LWIP_MALLOC_MEMPOOL_START -#define LWIP_MALLOC_MEMPOOL(num, size) 0 + MEMP_POOL_##size * -#define LWIP_MALLOC_MEMPOOL_END 1 -#include "lwip/priv/memp_std.h" - ) -} memp_pool_helper_t; - -/* The actual start and stop values are here (cast them over) - We use this helper type and these defines so we can avoid using const memp_t values */ -#define MEMP_POOL_FIRST ((memp_t) MEMP_POOL_HELPER_FIRST) -#define MEMP_POOL_LAST ((memp_t) MEMP_POOL_HELPER_LAST) -#endif /* MEM_USE_POOLS && MEMP_USE_CUSTOM_POOLS */ - -/** Memory pool descriptor */ -struct memp_desc { -#if defined(LWIP_DEBUG) || MEMP_OVERFLOW_CHECK || LWIP_STATS_DISPLAY - /** Textual description */ - const char *desc; -#endif /* LWIP_DEBUG || MEMP_OVERFLOW_CHECK || LWIP_STATS_DISPLAY */ -#if MEMP_STATS - /** Statistics */ - struct stats_mem *stats; -#endif - - /** Element size */ - u16_t size; - -#if !MEMP_MEM_MALLOC - /** Number of elements */ - u16_t num; - - /** Base address */ - u8_t *base; - - /** First free element of each pool. Elements form a linked list. */ - struct memp **tab; -#endif /* MEMP_MEM_MALLOC */ -}; - -#if defined(LWIP_DEBUG) || MEMP_OVERFLOW_CHECK || LWIP_STATS_DISPLAY -#define DECLARE_LWIP_MEMPOOL_DESC(desc) (desc), -#else -#define DECLARE_LWIP_MEMPOOL_DESC(desc) -#endif - -#if MEMP_STATS -#define LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(name) static struct stats_mem name; -#define LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(name) &name, -#else -#define LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(name) -#define LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(name) -#endif - -void memp_init_pool(const struct memp_desc *desc); - -#if MEMP_OVERFLOW_CHECK -void *memp_malloc_pool_fn(const struct memp_desc* desc, const char* file, const int line); -#define memp_malloc_pool(d) memp_malloc_pool_fn((d), __FILE__, __LINE__) -#else -void *memp_malloc_pool(const struct memp_desc *desc); -#endif -void memp_free_pool(const struct memp_desc* desc, void *mem); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_MEMP_PRIV_H */ diff --git a/tools/sdk/include/lwip/lwip/priv/memp_std.h b/tools/sdk/include/lwip/lwip/priv/memp_std.h deleted file mode 100644 index ce9fd500312..00000000000 --- a/tools/sdk/include/lwip/lwip/priv/memp_std.h +++ /dev/null @@ -1,146 +0,0 @@ -/** - * @file - * lwIP internal memory pools (do not use in application code) - * This file is deliberately included multiple times: once with empty - * definition of LWIP_MEMPOOL() to handle all includes and multiple times - * to build up various lists of mem pools. - */ - -/* - * SETUP: Make sure we define everything we will need. - * - * We have create three types of pools: - * 1) MEMPOOL - standard pools - * 2) MALLOC_MEMPOOL - to be used by mem_malloc in mem.c - * 3) PBUF_MEMPOOL - a mempool of pbuf's, so include space for the pbuf struct - * - * If the include'r doesn't require any special treatment of each of the types - * above, then will declare #2 & #3 to be just standard mempools. - */ -#ifndef LWIP_MALLOC_MEMPOOL -/* This treats "malloc pools" just like any other pool. - The pools are a little bigger to provide 'size' as the amount of user data. */ -#define LWIP_MALLOC_MEMPOOL(num, size) LWIP_MEMPOOL(POOL_##size, num, (size + LWIP_MEM_ALIGN_SIZE(sizeof(struct memp_malloc_helper))), "MALLOC_"#size) -#define LWIP_MALLOC_MEMPOOL_START -#define LWIP_MALLOC_MEMPOOL_END -#endif /* LWIP_MALLOC_MEMPOOL */ - -#ifndef LWIP_PBUF_MEMPOOL -/* This treats "pbuf pools" just like any other pool. - * Allocates buffers for a pbuf struct AND a payload size */ -#define LWIP_PBUF_MEMPOOL(name, num, payload, desc) LWIP_MEMPOOL(name, num, (MEMP_ALIGN_SIZE(sizeof(struct pbuf)) + MEMP_ALIGN_SIZE(payload)), desc) -#endif /* LWIP_PBUF_MEMPOOL */ - - -/* - * A list of internal pools used by LWIP. - * - * LWIP_MEMPOOL(pool_name, number_elements, element_size, pool_description) - * creates a pool name MEMP_pool_name. description is used in stats.c - */ -#if LWIP_RAW -LWIP_MEMPOOL(RAW_PCB, MEMP_NUM_RAW_PCB, sizeof(struct raw_pcb), "RAW_PCB") -#endif /* LWIP_RAW */ - -#if LWIP_UDP -LWIP_MEMPOOL(UDP_PCB, MEMP_NUM_UDP_PCB, sizeof(struct udp_pcb), "UDP_PCB") -#endif /* LWIP_UDP */ - -#if LWIP_TCP -LWIP_MEMPOOL(TCP_PCB, MEMP_NUM_TCP_PCB, sizeof(struct tcp_pcb), "TCP_PCB") -LWIP_MEMPOOL(TCP_PCB_LISTEN, MEMP_NUM_TCP_PCB_LISTEN, sizeof(struct tcp_pcb_listen), "TCP_PCB_LISTEN") -LWIP_MEMPOOL(TCP_SEG, MEMP_NUM_TCP_SEG, sizeof(struct tcp_seg), "TCP_SEG") -#endif /* LWIP_TCP */ - -#if LWIP_IPV4 && IP_REASSEMBLY -LWIP_MEMPOOL(REASSDATA, MEMP_NUM_REASSDATA, sizeof(struct ip_reassdata), "REASSDATA") -#endif /* LWIP_IPV4 && IP_REASSEMBLY */ -#if (IP_FRAG && !LWIP_NETIF_TX_SINGLE_PBUF) || (LWIP_IPV6 && LWIP_IPV6_FRAG) -LWIP_MEMPOOL(FRAG_PBUF, MEMP_NUM_FRAG_PBUF, sizeof(struct pbuf_custom_ref),"FRAG_PBUF") -#endif /* IP_FRAG && !LWIP_NETIF_TX_SINGLE_PBUF || (LWIP_IPV6 && LWIP_IPV6_FRAG) */ - -#if LWIP_NETCONN || LWIP_SOCKET -LWIP_MEMPOOL(NETBUF, MEMP_NUM_NETBUF, sizeof(struct netbuf), "NETBUF") -LWIP_MEMPOOL(NETCONN, MEMP_NUM_NETCONN, sizeof(struct netconn), "NETCONN") -#endif /* LWIP_NETCONN || LWIP_SOCKET */ - -#if NO_SYS==0 -LWIP_MEMPOOL(TCPIP_MSG_API, MEMP_NUM_TCPIP_MSG_API, sizeof(struct tcpip_msg), "TCPIP_MSG_API") -#if LWIP_MPU_COMPATIBLE -LWIP_MEMPOOL(API_MSG, MEMP_NUM_API_MSG, sizeof(struct api_msg), "API_MSG") -#if LWIP_DNS -LWIP_MEMPOOL(DNS_API_MSG, MEMP_NUM_DNS_API_MSG, sizeof(struct dns_api_msg), "DNS_API_MSG") -#endif -#if LWIP_SOCKET && !LWIP_TCPIP_CORE_LOCKING -LWIP_MEMPOOL(SOCKET_SETGETSOCKOPT_DATA, MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA, sizeof(struct lwip_setgetsockopt_data), "SOCKET_SETGETSOCKOPT_DATA") -#endif -#if LWIP_NETIF_API -LWIP_MEMPOOL(NETIFAPI_MSG, MEMP_NUM_NETIFAPI_MSG, sizeof(struct netifapi_msg), "NETIFAPI_MSG") -#endif -#endif /* LWIP_MPU_COMPATIBLE */ -#if !LWIP_TCPIP_CORE_LOCKING_INPUT -LWIP_MEMPOOL(TCPIP_MSG_INPKT,MEMP_NUM_TCPIP_MSG_INPKT, sizeof(struct tcpip_msg), "TCPIP_MSG_INPKT") -#endif /* !LWIP_TCPIP_CORE_LOCKING_INPUT */ -#endif /* NO_SYS==0 */ - -#if LWIP_IPV4 && LWIP_ARP && ARP_QUEUEING -LWIP_MEMPOOL(ARP_QUEUE, MEMP_NUM_ARP_QUEUE, sizeof(struct etharp_q_entry), "ARP_QUEUE") -#endif /* LWIP_IPV4 && LWIP_ARP && ARP_QUEUEING */ - -#if LWIP_IGMP -LWIP_MEMPOOL(IGMP_GROUP, MEMP_NUM_IGMP_GROUP, sizeof(struct igmp_group), "IGMP_GROUP") -#endif /* LWIP_IGMP */ - -#if LWIP_TIMERS && !LWIP_TIMERS_CUSTOM -LWIP_MEMPOOL(SYS_TIMEOUT, MEMP_NUM_SYS_TIMEOUT, sizeof(struct sys_timeo), "SYS_TIMEOUT") -#endif /* LWIP_TIMERS && !LWIP_TIMERS_CUSTOM */ - -#if LWIP_DNS && LWIP_SOCKET -LWIP_MEMPOOL(NETDB, MEMP_NUM_NETDB, NETDB_ELEM_SIZE, "NETDB") -#endif /* LWIP_DNS && LWIP_SOCKET */ -#if LWIP_DNS && DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC -LWIP_MEMPOOL(LOCALHOSTLIST, MEMP_NUM_LOCALHOSTLIST, LOCALHOSTLIST_ELEM_SIZE, "LOCALHOSTLIST") -#endif /* LWIP_DNS && DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ - -#if LWIP_IPV6 && LWIP_ND6_QUEUEING -LWIP_MEMPOOL(ND6_QUEUE, MEMP_NUM_ND6_QUEUE, sizeof(struct nd6_q_entry), "ND6_QUEUE") -#endif /* LWIP_IPV6 && LWIP_ND6_QUEUEING */ - -#if LWIP_IPV6 && LWIP_IPV6_REASS -LWIP_MEMPOOL(IP6_REASSDATA, MEMP_NUM_REASSDATA, sizeof(struct ip6_reassdata), "IP6_REASSDATA") -#endif /* LWIP_IPV6 && LWIP_IPV6_REASS */ - -#if LWIP_IPV6 && LWIP_IPV6_MLD -LWIP_MEMPOOL(MLD6_GROUP, MEMP_NUM_MLD6_GROUP, sizeof(struct mld_group), "MLD6_GROUP") -#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */ - - -/* - * A list of pools of pbuf's used by LWIP. - * - * LWIP_PBUF_MEMPOOL(pool_name, number_elements, pbuf_payload_size, pool_description) - * creates a pool name MEMP_pool_name. description is used in stats.c - * This allocates enough space for the pbuf struct and a payload. - * (Example: pbuf_payload_size=0 allocates only size for the struct) - */ -LWIP_PBUF_MEMPOOL(PBUF, MEMP_NUM_PBUF, 0, "PBUF_REF/ROM") -LWIP_PBUF_MEMPOOL(PBUF_POOL, PBUF_POOL_SIZE, PBUF_POOL_BUFSIZE, "PBUF_POOL") - - -/* - * Allow for user-defined pools; this must be explicitly set in lwipopts.h - * since the default is to NOT look for lwippools.h - */ -#if MEMP_USE_CUSTOM_POOLS -#include "lwippools.h" -#endif /* MEMP_USE_CUSTOM_POOLS */ - -/* - * REQUIRED CLEANUP: Clear up so we don't get "multiply defined" error later - * (#undef is ignored for something that is not defined) - */ -#undef LWIP_MEMPOOL -#undef LWIP_MALLOC_MEMPOOL -#undef LWIP_MALLOC_MEMPOOL_START -#undef LWIP_MALLOC_MEMPOOL_END -#undef LWIP_PBUF_MEMPOOL diff --git a/tools/sdk/include/lwip/lwip/priv/nd6_priv.h b/tools/sdk/include/lwip/lwip/priv/nd6_priv.h deleted file mode 100644 index 4bda0b793a3..00000000000 --- a/tools/sdk/include/lwip/lwip/priv/nd6_priv.h +++ /dev/null @@ -1,144 +0,0 @@ -/** - * @file - * - * Neighbor discovery and stateless address autoconfiguration for IPv6. - * Aims to be compliant with RFC 4861 (Neighbor discovery) and RFC 4862 - * (Address autoconfiguration). - */ - -/* - * Copyright (c) 2010 Inico Technologies Ltd. - * All rights reserved. - * - * 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: Ivan Delamer - * - * - * Please coordinate changes and requests with Ivan Delamer - * - */ - -#ifndef LWIP_HDR_ND6_PRIV_H -#define LWIP_HDR_ND6_PRIV_H - -#include "lwip/opt.h" - -#if LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/pbuf.h" -#include "lwip/ip6_addr.h" -#include "lwip/netif.h" - - -#ifdef __cplusplus -extern "C" { -#endif - -#if LWIP_ND6_QUEUEING -/** struct for queueing outgoing packets for unknown address - * defined here to be accessed by memp.h - */ -struct nd6_q_entry { - struct nd6_q_entry *next; - struct pbuf *p; -}; -#endif /* LWIP_ND6_QUEUEING */ - -/** Struct for tables. */ -struct nd6_neighbor_cache_entry { - ip6_addr_t next_hop_address; - struct netif *netif; - u8_t lladdr[NETIF_MAX_HWADDR_LEN]; - /*u32_t pmtu;*/ -#if LWIP_ND6_QUEUEING - /** Pointer to queue of pending outgoing packets on this entry. */ - struct nd6_q_entry *q; -#else /* LWIP_ND6_QUEUEING */ - /** Pointer to a single pending outgoing packet on this entry. */ - struct pbuf *q; -#endif /* LWIP_ND6_QUEUEING */ - u8_t state; - u8_t isrouter; - union { - u32_t reachable_time; /* in ms since value may originate from network packet */ - u32_t delay_time; /* ticks (ND6_TMR_INTERVAL) */ - u32_t probes_sent; - u32_t stale_time; /* ticks (ND6_TMR_INTERVAL) */ - } counter; -}; - -struct nd6_destination_cache_entry { - ip6_addr_t destination_addr; - ip6_addr_t next_hop_addr; - u16_t pmtu; - u32_t age; -}; - -struct nd6_prefix_list_entry { - ip6_addr_t prefix; - struct netif *netif; - u32_t invalidation_timer; /* in ms since value may originate from network packet */ -#if LWIP_IPV6_AUTOCONFIG - u8_t flags; -#define ND6_PREFIX_AUTOCONFIG_AUTONOMOUS 0x01 -#define ND6_PREFIX_AUTOCONFIG_ADDRESS_GENERATED 0x02 -#define ND6_PREFIX_AUTOCONFIG_ADDRESS_DUPLICATE 0x04 -#endif /* LWIP_IPV6_AUTOCONFIG */ -}; - -struct nd6_router_list_entry { - struct nd6_neighbor_cache_entry *neighbor_entry; - u32_t invalidation_timer; /* in ms since value may originate from network packet */ - u8_t flags; -}; - -enum nd6_neighbor_cache_entry_state { - ND6_NO_ENTRY = 0, - ND6_INCOMPLETE, - ND6_REACHABLE, - ND6_STALE, - ND6_DELAY, - ND6_PROBE -}; - -/* Router tables. */ -/* @todo make these static? and entries accessible through API? */ -extern struct nd6_neighbor_cache_entry neighbor_cache[]; -extern struct nd6_destination_cache_entry destination_cache[]; -extern struct nd6_prefix_list_entry prefix_list[]; -extern struct nd6_router_list_entry default_router_list[]; - -/* Default values, can be updated by a RA message. */ -extern u32_t reachable_time; -extern u32_t retrans_timer; - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_IPV6 */ - -#endif /* LWIP_HDR_ND6_PRIV_H */ diff --git a/tools/sdk/include/lwip/lwip/priv/tcp_priv.h b/tools/sdk/include/lwip/lwip/priv/tcp_priv.h deleted file mode 100644 index 73e8967e47d..00000000000 --- a/tools/sdk/include/lwip/lwip/priv/tcp_priv.h +++ /dev/null @@ -1,507 +0,0 @@ -/** - * @file - * TCP internal implementations (do not use in application code) - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_TCP_PRIV_H -#define LWIP_HDR_TCP_PRIV_H - -#include "lwip/opt.h" - -#if LWIP_TCP /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/tcp.h" -#include "lwip/mem.h" -#include "lwip/pbuf.h" -#include "lwip/ip.h" -#include "lwip/icmp.h" -#include "lwip/err.h" -#include "lwip/ip6.h" -#include "lwip/ip6_addr.h" -#include "lwip/prot/tcp.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Functions for interfacing with TCP: */ - -/* Lower layer interface to TCP: */ -void tcp_init (void); /* Initialize this module. */ -void tcp_tmr (void); /* Must be called every - TCP_TMR_INTERVAL - ms. (Typically 250 ms). */ -/* It is also possible to call these two functions at the right - intervals (instead of calling tcp_tmr()). */ -void tcp_slowtmr (void); -void tcp_fasttmr (void); - -/* Call this from a netif driver (watch out for threading issues!) that has - returned a memory error on transmit and now has free buffers to send more. - This iterates all active pcbs that had an error and tries to call - tcp_output, so use this with care as it might slow down the system. */ -void tcp_txnow (void); - -/* Only used by IP to pass a TCP segment to TCP: */ -void tcp_input (struct pbuf *p, struct netif *inp); -/* Used within the TCP code only: */ -struct tcp_pcb * tcp_alloc (u8_t prio); -void tcp_abandon (struct tcp_pcb *pcb, int reset); -err_t tcp_send_empty_ack(struct tcp_pcb *pcb); -void tcp_rexmit (struct tcp_pcb *pcb); -void tcp_rexmit_rto (struct tcp_pcb *pcb); -void tcp_rexmit_fast (struct tcp_pcb *pcb); -u32_t tcp_update_rcv_ann_wnd(struct tcp_pcb *pcb); -err_t tcp_process_refused_data(struct tcp_pcb *pcb); - -/** - * This is the Nagle algorithm: try to combine user data to send as few TCP - * segments as possible. Only send if - * - no previously transmitted data on the connection remains unacknowledged or - * - the TF_NODELAY flag is set (nagle algorithm turned off for this pcb) or - * - the only unsent segment is at least pcb->mss bytes long (or there is more - * than one unsent segment - with lwIP, this can happen although unsent->len < mss) - * - or if we are in fast-retransmit (TF_INFR) - */ -#define tcp_do_output_nagle(tpcb) ((((tpcb)->unacked == NULL) || \ - ((tpcb)->flags & (TF_NODELAY | TF_INFR)) || \ - (((tpcb)->unsent != NULL) && (((tpcb)->unsent->next != NULL) || \ - ((tpcb)->unsent->len >= (tpcb)->mss))) || \ - ((tcp_sndbuf(tpcb) == 0) || (tcp_sndqueuelen(tpcb) >= TCP_SND_QUEUELEN)) \ - ) ? 1 : 0) -#define tcp_output_nagle(tpcb) (tcp_do_output_nagle(tpcb) ? tcp_output(tpcb) : ERR_OK) - - -#define TCP_SEQ_LT(a,b) ((s32_t)((u32_t)(a) - (u32_t)(b)) < 0) -#define TCP_SEQ_LEQ(a,b) ((s32_t)((u32_t)(a) - (u32_t)(b)) <= 0) -#define TCP_SEQ_GT(a,b) ((s32_t)((u32_t)(a) - (u32_t)(b)) > 0) -#define TCP_SEQ_GEQ(a,b) ((s32_t)((u32_t)(a) - (u32_t)(b)) >= 0) -/* is b<=a<=c? */ -#if 0 /* see bug #10548 */ -#define TCP_SEQ_BETWEEN(a,b,c) ((c)-(b) >= (a)-(b)) -#endif -#define TCP_SEQ_BETWEEN(a,b,c) (TCP_SEQ_GEQ(a,b) && TCP_SEQ_LEQ(a,c)) - -#ifndef TCP_TMR_INTERVAL -#define TCP_TMR_INTERVAL 250 /* The TCP timer interval in milliseconds. */ -#endif /* TCP_TMR_INTERVAL */ - -#ifndef TCP_FAST_INTERVAL -#define TCP_FAST_INTERVAL TCP_TMR_INTERVAL /* the fine grained timeout in milliseconds */ -#endif /* TCP_FAST_INTERVAL */ - -#ifndef TCP_SLOW_INTERVAL -#define TCP_SLOW_INTERVAL (2*TCP_TMR_INTERVAL) /* the coarse grained timeout in milliseconds */ -#endif /* TCP_SLOW_INTERVAL */ - -#define TCP_FIN_WAIT_TIMEOUT 20000 /* milliseconds */ -#define TCP_SYN_RCVD_TIMEOUT 20000 /* milliseconds */ - -#define TCP_OOSEQ_TIMEOUT 6U /* x RTO */ - -#ifndef TCP_MSL -#define TCP_MSL 60000UL /* The maximum segment lifetime in milliseconds */ -#endif - -/* Keepalive values, compliant with RFC 1122. Don't change this unless you know what you're doing */ -#ifndef TCP_KEEPIDLE_DEFAULT -#define TCP_KEEPIDLE_DEFAULT 7200000UL /* Default KEEPALIVE timer in milliseconds */ -#endif - -#ifndef TCP_KEEPINTVL_DEFAULT -#define TCP_KEEPINTVL_DEFAULT 75000UL /* Default Time between KEEPALIVE probes in milliseconds */ -#endif - -#ifndef TCP_KEEPCNT_DEFAULT -#define TCP_KEEPCNT_DEFAULT 9U /* Default Counter for KEEPALIVE probes */ -#endif - -#define TCP_MAXIDLE TCP_KEEPCNT_DEFAULT * TCP_KEEPINTVL_DEFAULT /* Maximum KEEPALIVE probe time */ - -#define TCP_TCPLEN(seg) ((seg)->len + (((TCPH_FLAGS((seg)->tcphdr) & (TCP_FIN | TCP_SYN)) != 0) ? 1U : 0U)) - -/** Flags used on input processing, not on pcb->flags -*/ -#define TF_RESET (u8_t)0x08U /* Connection was reset. */ -#define TF_CLOSED (u8_t)0x10U /* Connection was successfully closed. */ -#define TF_GOT_FIN (u8_t)0x20U /* Connection was closed by the remote end. */ - - -#if LWIP_EVENT_API - -#define TCP_EVENT_ACCEPT(lpcb,pcb,arg,err,ret) ret = lwip_tcp_event(arg, (pcb),\ - LWIP_EVENT_ACCEPT, NULL, 0, err) -#define TCP_EVENT_SENT(pcb,space,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\ - LWIP_EVENT_SENT, NULL, space, ERR_OK) -#define TCP_EVENT_RECV(pcb,p,err,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\ - LWIP_EVENT_RECV, (p), 0, (err)) -#define TCP_EVENT_CLOSED(pcb,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\ - LWIP_EVENT_RECV, NULL, 0, ERR_OK) -#define TCP_EVENT_CONNECTED(pcb,err,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\ - LWIP_EVENT_CONNECTED, NULL, 0, (err)) -#define TCP_EVENT_POLL(pcb,ret) do { if ((pcb)->state != SYN_RCVD) { \ - ret = lwip_tcp_event((pcb)->callback_arg, (pcb), LWIP_EVENT_POLL, NULL, 0, ERR_OK); \ - } else { \ - ret = ERR_ARG; } } while(0) -#define TCP_EVENT_ERR(last_state,errf,arg,err) do { if (last_state != SYN_RCVD) { \ - lwip_tcp_event((arg), NULL, LWIP_EVENT_ERR, NULL, 0, (err)); } } while(0) - -#else /* LWIP_EVENT_API */ - -#define TCP_EVENT_ACCEPT(lpcb,pcb,arg,err,ret) \ - do { \ - if((lpcb)->accept != NULL) \ - (ret) = (lpcb)->accept((arg),(pcb),(err)); \ - else (ret) = ERR_ARG; \ - } while (0) - -#define TCP_EVENT_SENT(pcb,space,ret) \ - do { \ - if((pcb)->sent != NULL) \ - (ret) = (pcb)->sent((pcb)->callback_arg,(pcb),(space)); \ - else (ret) = ERR_OK; \ - } while (0) - -#define TCP_EVENT_RECV(pcb,p,err,ret) \ - do { \ - if((pcb)->recv != NULL) { \ - (ret) = (pcb)->recv((pcb)->callback_arg,(pcb),(p),(err));\ - } else { \ - (ret) = tcp_recv_null(NULL, (pcb), (p), (err)); \ - } \ - } while (0) - -#define TCP_EVENT_CLOSED(pcb,ret) \ - do { \ - if(((pcb)->recv != NULL)) { \ - (ret) = (pcb)->recv((pcb)->callback_arg,(pcb),NULL,ERR_OK);\ - } else { \ - (ret) = ERR_OK; \ - } \ - } while (0) - -#define TCP_EVENT_CONNECTED(pcb,err,ret) \ - do { \ - if((pcb)->connected != NULL) \ - (ret) = (pcb)->connected((pcb)->callback_arg,(pcb),(err)); \ - else (ret) = ERR_OK; \ - } while (0) - -#define TCP_EVENT_POLL(pcb,ret) \ - do { \ - if((pcb)->poll != NULL) \ - (ret) = (pcb)->poll((pcb)->callback_arg,(pcb)); \ - else (ret) = ERR_OK; \ - } while (0) - -#define TCP_EVENT_ERR(last_state,errf,arg,err) \ - do { \ - LWIP_UNUSED_ARG(last_state); \ - if((errf) != NULL) \ - (errf)((arg),(err)); \ - } while (0) - -#endif /* LWIP_EVENT_API */ - -/** Enabled extra-check for TCP_OVERSIZE if LWIP_DEBUG is enabled */ -#if TCP_OVERSIZE && defined(LWIP_DEBUG) -#define TCP_OVERSIZE_DBGCHECK 1 -#else -#define TCP_OVERSIZE_DBGCHECK 0 -#endif - -/** Don't generate checksum on copy if CHECKSUM_GEN_TCP is disabled */ -#define TCP_CHECKSUM_ON_COPY (LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_TCP) - -/* This structure represents a TCP segment on the unsent, unacked and ooseq queues */ -struct tcp_seg { - struct tcp_seg *next; /* used when putting segments on a queue */ - struct pbuf *p; /* buffer containing data + TCP header */ - u16_t len; /* the TCP length of this segment */ -#if TCP_OVERSIZE_DBGCHECK - u16_t oversize_left; /* Extra bytes available at the end of the last - pbuf in unsent (used for asserting vs. - tcp_pcb.unsent_oversize only) */ -#endif /* TCP_OVERSIZE_DBGCHECK */ -#if TCP_CHECKSUM_ON_COPY - u16_t chksum; - u8_t chksum_swapped; -#endif /* TCP_CHECKSUM_ON_COPY */ - u8_t flags; -#define TF_SEG_OPTS_MSS (u8_t)0x01U /* Include MSS option. */ -#define TF_SEG_OPTS_TS (u8_t)0x02U /* Include timestamp option. */ -#define TF_SEG_DATA_CHECKSUMMED (u8_t)0x04U /* ALL data (not the header) is - checksummed into 'chksum' */ -#define TF_SEG_OPTS_WND_SCALE (u8_t)0x08U /* Include WND SCALE option */ - struct tcp_hdr *tcphdr; /* the TCP header */ -}; - -#define LWIP_TCP_OPT_EOL 0 -#define LWIP_TCP_OPT_NOP 1 -#define LWIP_TCP_OPT_MSS 2 -#define LWIP_TCP_OPT_WS 3 -#define LWIP_TCP_OPT_TS 8 - -#define LWIP_TCP_OPT_LEN_MSS 4 -#if LWIP_TCP_TIMESTAMPS -#define LWIP_TCP_OPT_LEN_TS 10 -#define LWIP_TCP_OPT_LEN_TS_OUT 12 /* aligned for output (includes NOP padding) */ -#else -#define LWIP_TCP_OPT_LEN_TS_OUT 0 -#endif -#if LWIP_WND_SCALE -#define LWIP_TCP_OPT_LEN_WS 3 -#define LWIP_TCP_OPT_LEN_WS_OUT 4 /* aligned for output (includes NOP padding) */ -#else -#define LWIP_TCP_OPT_LEN_WS_OUT 0 -#endif - -#define LWIP_TCP_OPT_LENGTH(flags) \ - (flags & TF_SEG_OPTS_MSS ? LWIP_TCP_OPT_LEN_MSS : 0) + \ - (flags & TF_SEG_OPTS_TS ? LWIP_TCP_OPT_LEN_TS_OUT : 0) + \ - (flags & TF_SEG_OPTS_WND_SCALE ? LWIP_TCP_OPT_LEN_WS_OUT : 0) - -/** This returns a TCP header option for MSS in an u32_t */ -#define TCP_BUILD_MSS_OPTION(mss) lwip_htonl(0x02040000 | ((mss) & 0xFFFF)) - -#if LWIP_WND_SCALE -#define TCPWNDSIZE_F U32_F -#define TCPWND_MAX 0xFFFFFFFFU -#define TCPWND_CHECK16(x) LWIP_ASSERT("window size > 0xFFFF", (x) <= 0xFFFF) -#define TCPWND_MIN16(x) ((u16_t)LWIP_MIN((x), 0xFFFF)) -#else /* LWIP_WND_SCALE */ -#define TCPWNDSIZE_F U16_F -#define TCPWND_MAX 0xFFFFU -#define TCPWND_CHECK16(x) -#define TCPWND_MIN16(x) x -#endif /* LWIP_WND_SCALE */ - -/* Global variables: */ -extern struct tcp_pcb *tcp_input_pcb; -extern u32_t tcp_ticks; -extern u8_t tcp_active_pcbs_changed; - -/* The TCP PCB lists. */ -union tcp_listen_pcbs_t { /* List of all TCP PCBs in LISTEN state. */ - struct tcp_pcb_listen *listen_pcbs; - struct tcp_pcb *pcbs; -}; -extern struct tcp_pcb *tcp_bound_pcbs; -extern union tcp_listen_pcbs_t tcp_listen_pcbs; -extern struct tcp_pcb *tcp_active_pcbs; /* List of all TCP PCBs that are in a - state in which they accept or send - data. */ -extern struct tcp_pcb *tcp_tw_pcbs; /* List of all TCP PCBs in TIME-WAIT. */ - -#define NUM_TCP_PCB_LISTS_NO_TIME_WAIT 3 -#define NUM_TCP_PCB_LISTS 4 -extern struct tcp_pcb ** const tcp_pcb_lists[NUM_TCP_PCB_LISTS]; - -/* Axioms about the above lists: - 1) Every TCP PCB that is not CLOSED is in one of the lists. - 2) A PCB is only in one of the lists. - 3) All PCBs in the tcp_listen_pcbs list is in LISTEN state. - 4) All PCBs in the tcp_tw_pcbs list is in TIME-WAIT state. -*/ -/* Define two macros, TCP_REG and TCP_RMV that registers a TCP PCB - with a PCB list or removes a PCB from a list, respectively. */ -#ifndef TCP_DEBUG_PCB_LISTS -#define TCP_DEBUG_PCB_LISTS 0 -#endif -#if TCP_DEBUG_PCB_LISTS -#define TCP_REG(pcbs, npcb) do {\ - struct tcp_pcb *tcp_tmp_pcb; \ - LWIP_DEBUGF(TCP_DEBUG, ("TCP_REG %p local port %d\n", (npcb), (npcb)->local_port)); \ - for (tcp_tmp_pcb = *(pcbs); \ - tcp_tmp_pcb != NULL; \ - tcp_tmp_pcb = tcp_tmp_pcb->next) { \ - LWIP_ASSERT("TCP_REG: already registered\n", tcp_tmp_pcb != (npcb)); \ - } \ - LWIP_ASSERT("TCP_REG: pcb->state != CLOSED", ((pcbs) == &tcp_bound_pcbs) || ((npcb)->state != CLOSED)); \ - (npcb)->next = *(pcbs); \ - LWIP_ASSERT("TCP_REG: npcb->next != npcb", (npcb)->next != (npcb)); \ - *(pcbs) = (npcb); \ - LWIP_ASSERT("TCP_RMV: tcp_pcbs sane", tcp_pcbs_sane()); \ - tcp_timer_needed(); \ - } while(0) -#define TCP_RMV(pcbs, npcb) do { \ - struct tcp_pcb *tcp_tmp_pcb; \ - LWIP_ASSERT("TCP_RMV: pcbs != NULL", *(pcbs) != NULL); \ - LWIP_DEBUGF(TCP_DEBUG, ("TCP_RMV: removing %p from %p\n", (npcb), *(pcbs))); \ - if(*(pcbs) == (npcb)) { \ - *(pcbs) = (*pcbs)->next; \ - } else for (tcp_tmp_pcb = *(pcbs); tcp_tmp_pcb != NULL; tcp_tmp_pcb = tcp_tmp_pcb->next) { \ - if(tcp_tmp_pcb->next == (npcb)) { \ - tcp_tmp_pcb->next = (npcb)->next; \ - break; \ - } \ - } \ - (npcb)->next = NULL; \ - LWIP_ASSERT("TCP_RMV: tcp_pcbs sane", tcp_pcbs_sane()); \ - LWIP_DEBUGF(TCP_DEBUG, ("TCP_RMV: removed %p from %p\n", (npcb), *(pcbs))); \ - } while(0) - -#else /* LWIP_DEBUG */ - -#define TCP_REG(pcbs, npcb) \ - do { \ - (npcb)->next = *pcbs; \ - *(pcbs) = (npcb); \ - tcp_timer_needed(); \ - } while (0) - -#define TCP_RMV(pcbs, npcb) \ - do { \ - if(*(pcbs) == (npcb)) { \ - (*(pcbs)) = (*pcbs)->next; \ - } \ - else { \ - struct tcp_pcb *tcp_tmp_pcb; \ - for (tcp_tmp_pcb = *pcbs; \ - tcp_tmp_pcb != NULL; \ - tcp_tmp_pcb = tcp_tmp_pcb->next) { \ - if(tcp_tmp_pcb->next == (npcb)) { \ - tcp_tmp_pcb->next = (npcb)->next; \ - break; \ - } \ - } \ - } \ - (npcb)->next = NULL; \ - } while(0) - -#endif /* LWIP_DEBUG */ - -#define TCP_REG_ACTIVE(npcb) \ - do { \ - TCP_REG(&tcp_active_pcbs, npcb); \ - tcp_active_pcbs_changed = 1; \ - } while (0) - -#define TCP_RMV_ACTIVE(npcb) \ - do { \ - TCP_RMV(&tcp_active_pcbs, npcb); \ - tcp_active_pcbs_changed = 1; \ - } while (0) - -#define TCP_PCB_REMOVE_ACTIVE(pcb) \ - do { \ - tcp_pcb_remove(&tcp_active_pcbs, pcb); \ - tcp_active_pcbs_changed = 1; \ - } while (0) - - -/* Internal functions: */ -struct tcp_pcb *tcp_pcb_copy(struct tcp_pcb *pcb); -void tcp_pcb_purge(struct tcp_pcb *pcb); -void tcp_pcb_remove(struct tcp_pcb **pcblist, struct tcp_pcb *pcb); - -void tcp_segs_free(struct tcp_seg *seg); -void tcp_seg_free(struct tcp_seg *seg); -struct tcp_seg *tcp_seg_copy(struct tcp_seg *seg); - -#define tcp_ack(pcb) \ - do { \ - if((pcb)->flags & TF_ACK_DELAY) { \ - (pcb)->flags &= ~TF_ACK_DELAY; \ - (pcb)->flags |= TF_ACK_NOW; \ - } \ - else { \ - (pcb)->flags |= TF_ACK_DELAY; \ - } \ - } while (0) - -#define tcp_ack_now(pcb) \ - do { \ - (pcb)->flags |= TF_ACK_NOW; \ - } while (0) - -err_t tcp_send_fin(struct tcp_pcb *pcb); -err_t tcp_enqueue_flags(struct tcp_pcb *pcb, u8_t flags); - -void tcp_rexmit_seg(struct tcp_pcb *pcb, struct tcp_seg *seg); - -void tcp_rst(u32_t seqno, u32_t ackno, - const ip_addr_t *local_ip, const ip_addr_t *remote_ip, - u16_t local_port, u16_t remote_port); - -u32_t tcp_next_iss(struct tcp_pcb *pcb); - -err_t tcp_keepalive(struct tcp_pcb *pcb); -err_t tcp_zero_window_probe(struct tcp_pcb *pcb); -void tcp_trigger_input_pcb_close(void); - -#if TCP_CALCULATE_EFF_SEND_MSS -u16_t tcp_eff_send_mss_impl(u16_t sendmss, const ip_addr_t *dest -#if LWIP_IPV6 || LWIP_IPV4_SRC_ROUTING - , const ip_addr_t *src -#endif /* LWIP_IPV6 || LWIP_IPV4_SRC_ROUTING */ - ); -#if LWIP_IPV6 || LWIP_IPV4_SRC_ROUTING -#define tcp_eff_send_mss(sendmss, src, dest) tcp_eff_send_mss_impl(sendmss, dest, src) -#else /* LWIP_IPV6 || LWIP_IPV4_SRC_ROUTING */ -#define tcp_eff_send_mss(sendmss, src, dest) tcp_eff_send_mss_impl(sendmss, dest) -#endif /* LWIP_IPV6 || LWIP_IPV4_SRC_ROUTING */ -#endif /* TCP_CALCULATE_EFF_SEND_MSS */ - -#if LWIP_CALLBACK_API -err_t tcp_recv_null(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err); -#endif /* LWIP_CALLBACK_API */ - -#if TCP_DEBUG || TCP_INPUT_DEBUG || TCP_OUTPUT_DEBUG -void tcp_debug_print(struct tcp_hdr *tcphdr); -void tcp_debug_print_flags(u8_t flags); -void tcp_debug_print_state(enum tcp_state s); -void tcp_debug_print_pcbs(void); -s16_t tcp_pcbs_sane(void); -#else -# define tcp_debug_print(tcphdr) -# define tcp_debug_print_flags(flags) -# define tcp_debug_print_state(s) -# define tcp_debug_print_pcbs() -# define tcp_pcbs_sane() 1 -#endif /* TCP_DEBUG */ - -/** External function (implemented in timers.c), called when TCP detects - * that a timer is needed (i.e. active- or time-wait-pcb found). */ -void tcp_timer_needed(void); - -void tcp_netif_ip_addr_changed(const ip_addr_t* old_addr, const ip_addr_t* new_addr); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_TCP */ - -#endif /* LWIP_HDR_TCP_PRIV_H */ diff --git a/tools/sdk/include/lwip/lwip/priv/tcpip_priv.h b/tools/sdk/include/lwip/lwip/priv/tcpip_priv.h deleted file mode 100644 index 630efb14022..00000000000 --- a/tools/sdk/include/lwip/lwip/priv/tcpip_priv.h +++ /dev/null @@ -1,160 +0,0 @@ -/** - * @file - * TCPIP API internal implementations (do not use in application code) - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_TCPIP_PRIV_H -#define LWIP_HDR_TCPIP_PRIV_H - -#include "lwip/opt.h" - -#if !NO_SYS /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/tcpip.h" -#include "lwip/sys.h" -#include "lwip/timeouts.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct pbuf; -struct netif; - -#if LWIP_MPU_COMPATIBLE -#define API_VAR_REF(name) (*(name)) -#define API_VAR_DECLARE(type, name) type * name -#define API_VAR_ALLOC(type, pool, name, errorval) do { \ - name = (type *)memp_malloc(pool); \ - if (name == NULL) { \ - return errorval; \ - } \ - } while(0) -#define API_VAR_ALLOC_POOL(type, pool, name, errorval) do { \ - name = (type *)LWIP_MEMPOOL_ALLOC(pool); \ - if (name == NULL) { \ - return errorval; \ - } \ - } while(0) -#define API_VAR_FREE(pool, name) memp_free(pool, name) -#define API_VAR_FREE_POOL(pool, name) LWIP_MEMPOOL_FREE(pool, name) -#define API_EXPR_REF(expr) (&(expr)) -#if LWIP_NETCONN_SEM_PER_THREAD -#define API_EXPR_REF_SEM(expr) (expr) -#else -#define API_EXPR_REF_SEM(expr) API_EXPR_REF(expr) -#endif -#define API_EXPR_DEREF(expr) expr -#define API_MSG_M_DEF(m) m -#define API_MSG_M_DEF_C(t, m) t m -#else /* LWIP_MPU_COMPATIBLE */ -#define API_VAR_REF(name) name -#define API_VAR_DECLARE(type, name) type name -#define API_VAR_ALLOC(type, pool, name, errorval) -#define API_VAR_ALLOC_POOL(type, pool, name, errorval) -#define API_VAR_FREE(pool, name) -#define API_VAR_FREE_POOL(pool, name) -#define API_EXPR_REF(expr) expr -#define API_EXPR_REF_SEM(expr) API_EXPR_REF(expr) -#define API_EXPR_DEREF(expr) (*(expr)) -#define API_MSG_M_DEF(m) *m -#define API_MSG_M_DEF_C(t, m) const t * m -#endif /* LWIP_MPU_COMPATIBLE */ - -err_t tcpip_send_msg_wait_sem(tcpip_callback_fn fn, void *apimsg, sys_sem_t* sem); - -struct tcpip_api_call_data -{ -#if !LWIP_TCPIP_CORE_LOCKING - err_t err; -#if !LWIP_NETCONN_SEM_PER_THREAD - sys_sem_t sem; -#endif /* LWIP_NETCONN_SEM_PER_THREAD */ -#else /* !LWIP_TCPIP_CORE_LOCKING */ - u8_t dummy; /* avoid empty struct :-( */ -#endif /* !LWIP_TCPIP_CORE_LOCKING */ -}; -typedef err_t (*tcpip_api_call_fn)(struct tcpip_api_call_data* call); -err_t tcpip_api_call(tcpip_api_call_fn fn, struct tcpip_api_call_data *call); - -enum tcpip_msg_type { - TCPIP_MSG_API, - TCPIP_MSG_API_CALL, - TCPIP_MSG_INPKT, -#if LWIP_TCPIP_TIMEOUT && LWIP_TIMERS - TCPIP_MSG_TIMEOUT, - TCPIP_MSG_UNTIMEOUT, -#endif /* LWIP_TCPIP_TIMEOUT && LWIP_TIMERS */ - TCPIP_MSG_CALLBACK, - TCPIP_MSG_CALLBACK_STATIC -}; - -struct tcpip_msg { - enum tcpip_msg_type type; - union { - struct { - tcpip_callback_fn function; - void* msg; - } api_msg; - struct { - tcpip_api_call_fn function; - struct tcpip_api_call_data *arg; - sys_sem_t *sem; - } api_call; - struct { - struct pbuf *p; - struct netif *netif; - netif_input_fn input_fn; - } inp; - struct { - tcpip_callback_fn function; - void *ctx; - } cb; -#if LWIP_TCPIP_TIMEOUT && LWIP_TIMERS - struct { - u32_t msecs; - sys_timeout_handler h; - void *arg; - } tmo; -#endif /* LWIP_TCPIP_TIMEOUT && LWIP_TIMERS */ - } msg; -}; - -#ifdef __cplusplus -} -#endif - -#endif /* !NO_SYS */ - -#endif /* LWIP_HDR_TCPIP_PRIV_H */ diff --git a/tools/sdk/include/lwip/lwip/prot/autoip.h b/tools/sdk/include/lwip/lwip/prot/autoip.h deleted file mode 100644 index 96f93f57809..00000000000 --- a/tools/sdk/include/lwip/lwip/prot/autoip.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @file - * AutoIP protocol definitions - */ - -/* - * - * Copyright (c) 2007 Dominik Spies - * All rights reserved. - * - * 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. - * - * Author: Dominik Spies - * - * This is a AutoIP implementation for the lwIP TCP/IP stack. It aims to conform - * with RFC 3927. - * - */ - -#ifndef LWIP_HDR_PROT_AUTOIP_H -#define LWIP_HDR_PROT_AUTOIP_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* 169.254.0.0 */ -#define AUTOIP_NET 0xA9FE0000 -/* 169.254.1.0 */ -#define AUTOIP_RANGE_START (AUTOIP_NET | 0x0100) -/* 169.254.254.255 */ -#define AUTOIP_RANGE_END (AUTOIP_NET | 0xFEFF) - -/* RFC 3927 Constants */ -#define PROBE_WAIT 1 /* second (initial random delay) */ -#define PROBE_MIN 1 /* second (minimum delay till repeated probe) */ -#define PROBE_MAX 2 /* seconds (maximum delay till repeated probe) */ -#define PROBE_NUM 3 /* (number of probe packets) */ -#define ANNOUNCE_NUM 2 /* (number of announcement packets) */ -#define ANNOUNCE_INTERVAL 2 /* seconds (time between announcement packets) */ -#define ANNOUNCE_WAIT 2 /* seconds (delay before announcing) */ -#if ESP_LWIP -#define MAX_CONFLICTS LWIP_AUTOIP_MAX_CONFLICTS /* (max conflicts before rate limiting) */ -#define RATE_LIMIT_INTERVAL LWIP_AUTOIP_RATE_LIMIT_INTERVAL /* seconds (delay between successive attempts) */ -#else -#define MAX_CONFLICTS 10 /* (max conflicts before rate limiting) */ -#define RATE_LIMIT_INTERVAL 60 /* seconds (delay between successive attempts) */ -#endif -#define DEFEND_INTERVAL 10 /* seconds (min. wait between defensive ARPs) */ - -/* AutoIP client states */ -typedef enum { - AUTOIP_STATE_OFF = 0, - AUTOIP_STATE_PROBING = 1, - AUTOIP_STATE_ANNOUNCING = 2, - AUTOIP_STATE_BOUND = 3 -} autoip_state_enum_t; - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_PROT_AUTOIP_H */ diff --git a/tools/sdk/include/lwip/lwip/prot/dhcp.h b/tools/sdk/include/lwip/lwip/prot/dhcp.h deleted file mode 100644 index 036a33a895d..00000000000 --- a/tools/sdk/include/lwip/lwip/prot/dhcp.h +++ /dev/null @@ -1,195 +0,0 @@ -/** - * @file - * DHCP protocol definitions - */ - -/* - * Copyright (c) 2001-2004 Leon Woestenberg - * Copyright (c) 2001-2004 Axon Digital Design B.V., The Netherlands. - * All rights reserved. - * - * 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: Leon Woestenberg - * - */ -#ifndef LWIP_HDR_PROT_DHCP_H -#define LWIP_HDR_PROT_DHCP_H - -#include "lwip/opt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define DHCP_CLIENT_PORT 68 -#define DHCP_SERVER_PORT 67 - - - /* DHCP message item offsets and length */ -#define DHCP_CHADDR_LEN 16U -#define DHCP_SNAME_OFS 44U -#define DHCP_SNAME_LEN 64U -#define DHCP_FILE_OFS 108U -#define DHCP_FILE_LEN 128U -#define DHCP_MSG_LEN 236U -#define DHCP_OPTIONS_OFS (DHCP_MSG_LEN + 4U) /* 4 byte: cookie */ - -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -/** minimum set of fields of any DHCP message */ -struct dhcp_msg -{ - PACK_STRUCT_FLD_8(u8_t op); - PACK_STRUCT_FLD_8(u8_t htype); - PACK_STRUCT_FLD_8(u8_t hlen); - PACK_STRUCT_FLD_8(u8_t hops); - PACK_STRUCT_FIELD(u32_t xid); - PACK_STRUCT_FIELD(u16_t secs); - PACK_STRUCT_FIELD(u16_t flags); - PACK_STRUCT_FLD_S(ip4_addr_p_t ciaddr); - PACK_STRUCT_FLD_S(ip4_addr_p_t yiaddr); - PACK_STRUCT_FLD_S(ip4_addr_p_t siaddr); - PACK_STRUCT_FLD_S(ip4_addr_p_t giaddr); - PACK_STRUCT_FLD_8(u8_t chaddr[DHCP_CHADDR_LEN]); - PACK_STRUCT_FLD_8(u8_t sname[DHCP_SNAME_LEN]); - PACK_STRUCT_FLD_8(u8_t file[DHCP_FILE_LEN]); - PACK_STRUCT_FIELD(u32_t cookie); -#define DHCP_MIN_OPTIONS_LEN 68U -/** make sure user does not configure this too small */ -#if ((defined(DHCP_OPTIONS_LEN)) && (DHCP_OPTIONS_LEN < DHCP_MIN_OPTIONS_LEN)) -# undef DHCP_OPTIONS_LEN -#endif -/** allow this to be configured in lwipopts.h, but not too small */ -#if (!defined(DHCP_OPTIONS_LEN)) -/** set this to be sufficient for your options in outgoing DHCP msgs */ -# define DHCP_OPTIONS_LEN DHCP_MIN_OPTIONS_LEN -#endif - PACK_STRUCT_FLD_8(u8_t options[DHCP_OPTIONS_LEN]); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - - -/* DHCP client states */ -typedef enum { - DHCP_STATE_OFF = 0, - DHCP_STATE_REQUESTING = 1, - DHCP_STATE_INIT = 2, - DHCP_STATE_REBOOTING = 3, - DHCP_STATE_REBINDING = 4, - DHCP_STATE_RENEWING = 5, - DHCP_STATE_SELECTING = 6, - DHCP_STATE_INFORMING = 7, - DHCP_STATE_CHECKING = 8, - DHCP_STATE_PERMANENT = 9, /* not yet implemented */ - DHCP_STATE_BOUND = 10, - DHCP_STATE_RELEASING = 11, /* not yet implemented */ - DHCP_STATE_BACKING_OFF = 12 -} dhcp_state_enum_t; - -/* DHCP op codes */ -#define DHCP_BOOTREQUEST 1 -#define DHCP_BOOTREPLY 2 - -/* DHCP message types */ -#define DHCP_DISCOVER 1 -#define DHCP_OFFER 2 -#define DHCP_REQUEST 3 -#define DHCP_DECLINE 4 -#define DHCP_ACK 5 -#define DHCP_NAK 6 -#define DHCP_RELEASE 7 -#define DHCP_INFORM 8 - -/** DHCP hardware type, currently only ethernet is supported */ -#define DHCP_HTYPE_ETH 1 - -#define DHCP_MAGIC_COOKIE 0x63825363UL - -/* This is a list of options for BOOTP and DHCP, see RFC 2132 for descriptions */ - -/* BootP options */ -#define DHCP_OPTION_PAD 0 -#define DHCP_OPTION_SUBNET_MASK 1 /* RFC 2132 3.3 */ -#define DHCP_OPTION_ROUTER 3 -#define DHCP_OPTION_DNS_SERVER 6 -#define DHCP_OPTION_HOSTNAME 12 -#define DHCP_OPTION_IP_TTL 23 -#define DHCP_OPTION_MTU 26 -#define DHCP_OPTION_BROADCAST 28 -#define DHCP_OPTION_TCP_TTL 37 -#define DHCP_OPTION_NTP 42 -#define DHCP_OPTION_END 255 - -#if ESP_LWIP -/**add options for support more router by liuHan**/ -#define DHCP_OPTION_DOMAIN_NAME 15 -#define DHCP_OPTION_PRD 31 -#define DHCP_OPTION_STATIC_ROUTER 33 -#define DHCP_OPTION_VSN 43 -#define DHCP_OPTION_NB_TINS 44 -#define DHCP_OPTION_NB_TINT 46 -#define DHCP_OPTION_NB_TIS 47 -#define DHCP_OPTION_CLASSLESS_STATIC_ROUTER 121 -#endif - -/* DHCP options */ -#define DHCP_OPTION_REQUESTED_IP 50 /* RFC 2132 9.1, requested IP address */ -#define DHCP_OPTION_LEASE_TIME 51 /* RFC 2132 9.2, time in seconds, in 4 bytes */ -#define DHCP_OPTION_OVERLOAD 52 /* RFC2132 9.3, use file and/or sname field for options */ - -#define DHCP_OPTION_MESSAGE_TYPE 53 /* RFC 2132 9.6, important for DHCP */ -#define DHCP_OPTION_MESSAGE_TYPE_LEN 1 - -#define DHCP_OPTION_SERVER_ID 54 /* RFC 2132 9.7, server IP address */ -#define DHCP_OPTION_PARAMETER_REQUEST_LIST 55 /* RFC 2132 9.8, requested option types */ - -#define DHCP_OPTION_MAX_MSG_SIZE 57 /* RFC 2132 9.10, message size accepted >= 576 */ -#define DHCP_OPTION_MAX_MSG_SIZE_LEN 2 - -#define DHCP_OPTION_T1 58 /* T1 renewal time */ -#define DHCP_OPTION_T2 59 /* T2 rebinding time */ -#define DHCP_OPTION_US 60 -#define DHCP_OPTION_CLIENT_ID 61 -#define DHCP_OPTION_TFTP_SERVERNAME 66 -#define DHCP_OPTION_BOOTFILE 67 - -/* possible combinations of overloading the file and sname fields with options */ -#define DHCP_OVERLOAD_NONE 0 -#define DHCP_OVERLOAD_FILE 1 -#define DHCP_OVERLOAD_SNAME 2 -#define DHCP_OVERLOAD_SNAME_FILE 3 - - -#ifdef __cplusplus -} -#endif - -#endif /*LWIP_HDR_PROT_DHCP_H*/ diff --git a/tools/sdk/include/lwip/lwip/prot/dns.h b/tools/sdk/include/lwip/lwip/prot/dns.h deleted file mode 100644 index 94782d6e9c1..00000000000 --- a/tools/sdk/include/lwip/lwip/prot/dns.h +++ /dev/null @@ -1,140 +0,0 @@ -/** - * @file - * DNS - host name to IP address resolver. - */ - -/* - * Port to lwIP from uIP - * by Jim Pettinato April 2007 - * - * security fixes and more by Simon Goldschmidt - * - * uIP version Copyright (c) 2002-2003, Adam Dunkels. - * All rights reserved. - * - * 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. - */ - -#ifndef LWIP_HDR_PROT_DNS_H -#define LWIP_HDR_PROT_DNS_H - -#include "lwip/arch.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** DNS server port address */ -#ifndef DNS_SERVER_PORT -#define DNS_SERVER_PORT 53 -#endif - -/* DNS field TYPE used for "Resource Records" */ -#define DNS_RRTYPE_A 1 /* a host address */ -#define DNS_RRTYPE_NS 2 /* an authoritative name server */ -#define DNS_RRTYPE_MD 3 /* a mail destination (Obsolete - use MX) */ -#define DNS_RRTYPE_MF 4 /* a mail forwarder (Obsolete - use MX) */ -#define DNS_RRTYPE_CNAME 5 /* the canonical name for an alias */ -#define DNS_RRTYPE_SOA 6 /* marks the start of a zone of authority */ -#define DNS_RRTYPE_MB 7 /* a mailbox domain name (EXPERIMENTAL) */ -#define DNS_RRTYPE_MG 8 /* a mail group member (EXPERIMENTAL) */ -#define DNS_RRTYPE_MR 9 /* a mail rename domain name (EXPERIMENTAL) */ -#define DNS_RRTYPE_NULL 10 /* a null RR (EXPERIMENTAL) */ -#define DNS_RRTYPE_WKS 11 /* a well known service description */ -#define DNS_RRTYPE_PTR 12 /* a domain name pointer */ -#define DNS_RRTYPE_HINFO 13 /* host information */ -#define DNS_RRTYPE_MINFO 14 /* mailbox or mail list information */ -#define DNS_RRTYPE_MX 15 /* mail exchange */ -#define DNS_RRTYPE_TXT 16 /* text strings */ -#define DNS_RRTYPE_AAAA 28 /* IPv6 address */ -#define DNS_RRTYPE_SRV 33 /* service location */ -#define DNS_RRTYPE_ANY 255 /* any type */ - -/* DNS field CLASS used for "Resource Records" */ -#define DNS_RRCLASS_IN 1 /* the Internet */ -#define DNS_RRCLASS_CS 2 /* the CSNET class (Obsolete - used only for examples in some obsolete RFCs) */ -#define DNS_RRCLASS_CH 3 /* the CHAOS class */ -#define DNS_RRCLASS_HS 4 /* Hesiod [Dyer 87] */ -#define DNS_RRCLASS_ANY 255 /* any class */ -#define DNS_RRCLASS_FLUSH 0x800 /* Flush bit */ - -/* DNS protocol flags */ -#define DNS_FLAG1_RESPONSE 0x80 -#define DNS_FLAG1_OPCODE_STATUS 0x10 -#define DNS_FLAG1_OPCODE_INVERSE 0x08 -#define DNS_FLAG1_OPCODE_STANDARD 0x00 -#define DNS_FLAG1_AUTHORATIVE 0x04 -#define DNS_FLAG1_TRUNC 0x02 -#define DNS_FLAG1_RD 0x01 -#define DNS_FLAG2_RA 0x80 -#define DNS_FLAG2_ERR_MASK 0x0f -#define DNS_FLAG2_ERR_NONE 0x00 -#define DNS_FLAG2_ERR_NAME 0x03 - -#define DNS_HDR_GET_OPCODE(hdr) ((((hdr)->flags1) >> 3) & 0xF) - -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -/** DNS message header */ -struct dns_hdr { - PACK_STRUCT_FIELD(u16_t id); - PACK_STRUCT_FLD_8(u8_t flags1); - PACK_STRUCT_FLD_8(u8_t flags2); - PACK_STRUCT_FIELD(u16_t numquestions); - PACK_STRUCT_FIELD(u16_t numanswers); - PACK_STRUCT_FIELD(u16_t numauthrr); - PACK_STRUCT_FIELD(u16_t numextrarr); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif -#define SIZEOF_DNS_HDR 12 - - -/* Multicast DNS definitions */ - -/** UDP port for multicast DNS queries */ -#ifndef DNS_MQUERY_PORT -#define DNS_MQUERY_PORT 5353 -#endif - -/* IPv4 group for multicast DNS queries: 224.0.0.251 */ -#ifndef DNS_MQUERY_IPV4_GROUP_INIT -#define DNS_MQUERY_IPV4_GROUP_INIT IPADDR4_INIT_BYTES(224,0,0,251) -#endif - -/* IPv6 group for multicast DNS queries: FF02::FB */ -#ifndef DNS_MQUERY_IPV6_GROUP_INIT -#define DNS_MQUERY_IPV6_GROUP_INIT IPADDR6_INIT_HOST(0xFF020000,0,0,0xFB) -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_PROT_DNS_H */ diff --git a/tools/sdk/include/lwip/lwip/prot/etharp.h b/tools/sdk/include/lwip/lwip/prot/etharp.h deleted file mode 100644 index ec78305b822..00000000000 --- a/tools/sdk/include/lwip/lwip/prot/etharp.h +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @file - * ARP protocol definitions - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_PROT_ETHARP_H -#define LWIP_HDR_PROT_ETHARP_H - -#include "lwip/arch.h" -#include "lwip/prot/ethernet.h" -#include "lwip/ip4_addr.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef ETHARP_HWADDR_LEN -#define ETHARP_HWADDR_LEN ETH_HWADDR_LEN -#endif - -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -/** the ARP message, see RFC 826 ("Packet format") */ -struct etharp_hdr { - PACK_STRUCT_FIELD(u16_t hwtype); - PACK_STRUCT_FIELD(u16_t proto); - PACK_STRUCT_FLD_8(u8_t hwlen); - PACK_STRUCT_FLD_8(u8_t protolen); - PACK_STRUCT_FIELD(u16_t opcode); - PACK_STRUCT_FLD_S(struct eth_addr shwaddr); - PACK_STRUCT_FLD_S(struct ip4_addr2 sipaddr); - PACK_STRUCT_FLD_S(struct eth_addr dhwaddr); - PACK_STRUCT_FLD_S(struct ip4_addr2 dipaddr); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -#define SIZEOF_ETHARP_HDR 28 - -/* ARP hwtype values */ -enum etharp_hwtype { - HWTYPE_ETHERNET = 1 - /* others not used */ -}; - -/* ARP message types (opcodes) */ -enum etharp_opcode { - ARP_REQUEST = 1, - ARP_REPLY = 2 -}; - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_PROT_ETHARP_H */ diff --git a/tools/sdk/include/lwip/lwip/prot/ethernet.h b/tools/sdk/include/lwip/lwip/prot/ethernet.h deleted file mode 100644 index e4baa29dc4d..00000000000 --- a/tools/sdk/include/lwip/lwip/prot/ethernet.h +++ /dev/null @@ -1,170 +0,0 @@ -/** - * @file - * Ethernet protocol definitions - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_PROT_ETHERNET_H -#define LWIP_HDR_PROT_ETHERNET_H - -#include "lwip/arch.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef ETH_HWADDR_LEN -#ifdef ETHARP_HWADDR_LEN -#define ETH_HWADDR_LEN ETHARP_HWADDR_LEN /* compatibility mode */ -#else -#define ETH_HWADDR_LEN 6 -#endif -#endif - -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct eth_addr { - PACK_STRUCT_FLD_8(u8_t addr[ETH_HWADDR_LEN]); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -/** Ethernet header */ -struct eth_hdr { -#if ETH_PAD_SIZE - PACK_STRUCT_FLD_8(u8_t padding[ETH_PAD_SIZE]); -#endif - PACK_STRUCT_FLD_S(struct eth_addr dest); - PACK_STRUCT_FLD_S(struct eth_addr src); - PACK_STRUCT_FIELD(u16_t type); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -#define SIZEOF_ETH_HDR (14 + ETH_PAD_SIZE) - -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -/** VLAN header inserted between ethernet header and payload - * if 'type' in ethernet header is ETHTYPE_VLAN. - * See IEEE802.Q */ -struct eth_vlan_hdr { - PACK_STRUCT_FIELD(u16_t prio_vid); - PACK_STRUCT_FIELD(u16_t tpid); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -#define SIZEOF_VLAN_HDR 4 -#define VLAN_ID(vlan_hdr) (lwip_htons((vlan_hdr)->prio_vid) & 0xFFF) - -/** - * @ingroup ethernet - * A list of often ethtypes (although lwIP does not use all of them): */ -enum eth_type { - /** Internet protocol v4 */ - ETHTYPE_IP = 0x0800U, - /** Address resolution protocol */ - ETHTYPE_ARP = 0x0806U, - /** Wake on lan */ - ETHTYPE_WOL = 0x0842U, - /** RARP */ - ETHTYPE_RARP = 0x8035U, - /** Virtual local area network */ - ETHTYPE_VLAN = 0x8100U, - /** Internet protocol v6 */ - ETHTYPE_IPV6 = 0x86DDU, - /** PPP Over Ethernet Discovery Stage */ - ETHTYPE_PPPOEDISC = 0x8863U, - /** PPP Over Ethernet Session Stage */ - ETHTYPE_PPPOE = 0x8864U, - /** Jumbo Frames */ - ETHTYPE_JUMBO = 0x8870U, - /** Process field network */ - ETHTYPE_PROFINET = 0x8892U, - /** Ethernet for control automation technology */ - ETHTYPE_ETHERCAT = 0x88A4U, - /** Link layer discovery protocol */ - ETHTYPE_LLDP = 0x88CCU, - /** Serial real-time communication system */ - ETHTYPE_SERCOS = 0x88CDU, - /** Media redundancy protocol */ - ETHTYPE_MRP = 0x88E3U, - /** Precision time protocol */ - ETHTYPE_PTP = 0x88F7U, - /** Q-in-Q, 802.1ad */ - ETHTYPE_QINQ = 0x9100U -}; - -/** The 24-bit IANA IPv4-multicast OUI is 01-00-5e: */ -#define LL_IP4_MULTICAST_ADDR_0 0x01 -#define LL_IP4_MULTICAST_ADDR_1 0x00 -#define LL_IP4_MULTICAST_ADDR_2 0x5e - -/** IPv6 multicast uses this prefix */ -#define LL_IP6_MULTICAST_ADDR_0 0x33 -#define LL_IP6_MULTICAST_ADDR_1 0x33 - -/** MEMCPY-like macro to copy to/from struct eth_addr's that are local variables - * or known to be 32-bit aligned within the protocol header. */ -#ifndef ETHADDR32_COPY -#define ETHADDR32_COPY(dst, src) SMEMCPY(dst, src, ETH_HWADDR_LEN) -#endif - -/** MEMCPY-like macro to copy to/from struct eth_addr's that are no local - * variables and known to be 16-bit aligned within the protocol header. */ -#ifndef ETHADDR16_COPY -#define ETHADDR16_COPY(dst, src) SMEMCPY(dst, src, ETH_HWADDR_LEN) -#endif - -#define eth_addr_cmp(addr1, addr2) (memcmp((addr1)->addr, (addr2)->addr, ETH_HWADDR_LEN) == 0) - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_PROT_ETHERNET_H */ diff --git a/tools/sdk/include/lwip/lwip/prot/icmp.h b/tools/sdk/include/lwip/lwip/prot/icmp.h deleted file mode 100644 index 7d19385c729..00000000000 --- a/tools/sdk/include/lwip/lwip/prot/icmp.h +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @file - * ICMP protocol definitions - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_PROT_ICMP_H -#define LWIP_HDR_PROT_ICMP_H - -#include "lwip/arch.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ICMP_ER 0 /* echo reply */ -#define ICMP_DUR 3 /* destination unreachable */ -#define ICMP_SQ 4 /* source quench */ -#define ICMP_RD 5 /* redirect */ -#define ICMP_ECHO 8 /* echo */ -#define ICMP_TE 11 /* time exceeded */ -#define ICMP_PP 12 /* parameter problem */ -#define ICMP_TS 13 /* timestamp */ -#define ICMP_TSR 14 /* timestamp reply */ -#define ICMP_IRQ 15 /* information request */ -#define ICMP_IR 16 /* information reply */ -#define ICMP_AM 17 /* address mask request */ -#define ICMP_AMR 18 /* address mask reply */ - -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -/** This is the standard ICMP header only that the u32_t data - * is split to two u16_t like ICMP echo needs it. - * This header is also used for other ICMP types that do not - * use the data part. - */ -PACK_STRUCT_BEGIN -struct icmp_echo_hdr { - PACK_STRUCT_FLD_8(u8_t type); - PACK_STRUCT_FLD_8(u8_t code); - PACK_STRUCT_FIELD(u16_t chksum); - PACK_STRUCT_FIELD(u16_t id); - PACK_STRUCT_FIELD(u16_t seqno); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -/* Compatibility defines, old versions used to combine type and code to an u16_t */ -#define ICMPH_TYPE(hdr) ((hdr)->type) -#define ICMPH_CODE(hdr) ((hdr)->code) -#define ICMPH_TYPE_SET(hdr, t) ((hdr)->type = (t)) -#define ICMPH_CODE_SET(hdr, c) ((hdr)->code = (c)) - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_PROT_ICMP_H */ diff --git a/tools/sdk/include/lwip/lwip/prot/icmp6.h b/tools/sdk/include/lwip/lwip/prot/icmp6.h deleted file mode 100644 index 3461120421e..00000000000 --- a/tools/sdk/include/lwip/lwip/prot/icmp6.h +++ /dev/null @@ -1,170 +0,0 @@ -/** - * @file - * ICMP6 protocol definitions - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_PROT_ICMP6_H -#define LWIP_HDR_PROT_ICMP6_H - -#include "lwip/arch.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** ICMP type */ -enum icmp6_type { - /** Destination unreachable */ - ICMP6_TYPE_DUR = 1, - /** Packet too big */ - ICMP6_TYPE_PTB = 2, - /** Time exceeded */ - ICMP6_TYPE_TE = 3, - /** Parameter problem */ - ICMP6_TYPE_PP = 4, - /** Private experimentation */ - ICMP6_TYPE_PE1 = 100, - /** Private experimentation */ - ICMP6_TYPE_PE2 = 101, - /** Reserved for expansion of error messages */ - ICMP6_TYPE_RSV_ERR = 127, - - /** Echo request */ - ICMP6_TYPE_EREQ = 128, - /** Echo reply */ - ICMP6_TYPE_EREP = 129, - /** Multicast listener query */ - ICMP6_TYPE_MLQ = 130, - /** Multicast listener report */ - ICMP6_TYPE_MLR = 131, - /** Multicast listener done */ - ICMP6_TYPE_MLD = 132, - /** Router solicitation */ - ICMP6_TYPE_RS = 133, - /** Router advertisement */ - ICMP6_TYPE_RA = 134, - /** Neighbor solicitation */ - ICMP6_TYPE_NS = 135, - /** Neighbor advertisement */ - ICMP6_TYPE_NA = 136, - /** Redirect */ - ICMP6_TYPE_RD = 137, - /** Multicast router advertisement */ - ICMP6_TYPE_MRA = 151, - /** Multicast router solicitation */ - ICMP6_TYPE_MRS = 152, - /** Multicast router termination */ - ICMP6_TYPE_MRT = 153, - /** Private experimentation */ - ICMP6_TYPE_PE3 = 200, - /** Private experimentation */ - ICMP6_TYPE_PE4 = 201, - /** Reserved for expansion of informational messages */ - ICMP6_TYPE_RSV_INF = 255 -}; - -/** ICMP destination unreachable codes */ -enum icmp6_dur_code { - /** No route to destination */ - ICMP6_DUR_NO_ROUTE = 0, - /** Communication with destination administratively prohibited */ - ICMP6_DUR_PROHIBITED = 1, - /** Beyond scope of source address */ - ICMP6_DUR_SCOPE = 2, - /** Address unreachable */ - ICMP6_DUR_ADDRESS = 3, - /** Port unreachable */ - ICMP6_DUR_PORT = 4, - /** Source address failed ingress/egress policy */ - ICMP6_DUR_POLICY = 5, - /** Reject route to destination */ - ICMP6_DUR_REJECT_ROUTE = 6 -}; - -/** ICMP time exceeded codes */ -enum icmp6_te_code { - /** Hop limit exceeded in transit */ - ICMP6_TE_HL = 0, - /** Fragment reassembly time exceeded */ - ICMP6_TE_FRAG = 1 -}; - -/** ICMP parameter code */ -enum icmp6_pp_code { - /** Erroneous header field encountered */ - ICMP6_PP_FIELD = 0, - /** Unrecognized next header type encountered */ - ICMP6_PP_HEADER = 1, - /** Unrecognized IPv6 option encountered */ - ICMP6_PP_OPTION = 2 -}; - -/** This is the standard ICMP6 header. */ -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct icmp6_hdr { - PACK_STRUCT_FLD_8(u8_t type); - PACK_STRUCT_FLD_8(u8_t code); - PACK_STRUCT_FIELD(u16_t chksum); - PACK_STRUCT_FIELD(u32_t data); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -/** This is the ICMP6 header adapted for echo req/resp. */ -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct icmp6_echo_hdr { - PACK_STRUCT_FLD_8(u8_t type); - PACK_STRUCT_FLD_8(u8_t code); - PACK_STRUCT_FIELD(u16_t chksum); - PACK_STRUCT_FIELD(u16_t id); - PACK_STRUCT_FIELD(u16_t seqno); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_PROT_ICMP6_H */ diff --git a/tools/sdk/include/lwip/lwip/prot/igmp.h b/tools/sdk/include/lwip/lwip/prot/igmp.h deleted file mode 100644 index d60cb31ee7c..00000000000 --- a/tools/sdk/include/lwip/lwip/prot/igmp.h +++ /dev/null @@ -1,90 +0,0 @@ -/** - * @file - * IGMP protocol definitions - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_PROT_IGMP_H -#define LWIP_HDR_PROT_IGMP_H - -#include "lwip/arch.h" -#include "lwip/ip4_addr.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * IGMP constants - */ -#define IGMP_TTL 1 -#define IGMP_MINLEN 8 -#define ROUTER_ALERT 0x9404U -#define ROUTER_ALERTLEN 4 - -/* - * IGMP message types, including version number. - */ -#define IGMP_MEMB_QUERY 0x11 /* Membership query */ -#define IGMP_V1_MEMB_REPORT 0x12 /* Ver. 1 membership report */ -#define IGMP_V2_MEMB_REPORT 0x16 /* Ver. 2 membership report */ -#define IGMP_LEAVE_GROUP 0x17 /* Leave-group message */ - -/* Group membership states */ -#define IGMP_GROUP_NON_MEMBER 0 -#define IGMP_GROUP_DELAYING_MEMBER 1 -#define IGMP_GROUP_IDLE_MEMBER 2 - -/** - * IGMP packet format. - */ -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct igmp_msg { - PACK_STRUCT_FLD_8(u8_t igmp_msgtype); - PACK_STRUCT_FLD_8(u8_t igmp_maxresp); - PACK_STRUCT_FIELD(u16_t igmp_checksum); - PACK_STRUCT_FLD_S(ip4_addr_p_t igmp_group_address); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_PROT_IGMP_H */ diff --git a/tools/sdk/include/lwip/lwip/prot/ip.h b/tools/sdk/include/lwip/lwip/prot/ip.h deleted file mode 100644 index bbfae367527..00000000000 --- a/tools/sdk/include/lwip/lwip/prot/ip.h +++ /dev/null @@ -1,51 +0,0 @@ -/** - * @file - * IP protocol definitions - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_PROT_IP_H -#define LWIP_HDR_PROT_IP_H - -#include "lwip/arch.h" - -#define IP_PROTO_ICMP 1 -#define IP_PROTO_IGMP 2 -#define IP_PROTO_UDP 17 -#define IP_PROTO_UDPLITE 136 -#define IP_PROTO_TCP 6 - -/** This operates on a void* by loading the first byte */ -#define IP_HDR_GET_VERSION(ptr) ((*(u8_t*)(ptr)) >> 4) - -#endif /* LWIP_HDR_PROT_IP_H */ diff --git a/tools/sdk/include/lwip/lwip/prot/ip4.h b/tools/sdk/include/lwip/lwip/prot/ip4.h deleted file mode 100644 index bd442c6892c..00000000000 --- a/tools/sdk/include/lwip/lwip/prot/ip4.h +++ /dev/null @@ -1,127 +0,0 @@ -/** - * @file - * IPv4 protocol definitions - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_PROT_IP4_H -#define LWIP_HDR_PROT_IP4_H - -#include "lwip/arch.h" -#include "lwip/ip4_addr.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** This is the packed version of ip4_addr_t, - used in network headers that are itself packed */ -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct ip4_addr_packed { - PACK_STRUCT_FIELD(u32_t addr); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -typedef struct ip4_addr_packed ip4_addr_p_t; - -/* Size of the IPv4 header. Same as 'sizeof(struct ip_hdr)'. */ -#define IP_HLEN 20 - -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -/* The IPv4 header */ -struct ip_hdr { - /* version / header length */ - PACK_STRUCT_FLD_8(u8_t _v_hl); - /* type of service */ - PACK_STRUCT_FLD_8(u8_t _tos); - /* total length */ - PACK_STRUCT_FIELD(u16_t _len); - /* identification */ - PACK_STRUCT_FIELD(u16_t _id); - /* fragment offset field */ - PACK_STRUCT_FIELD(u16_t _offset); -#define IP_RF 0x8000U /* reserved fragment flag */ -#define IP_DF 0x4000U /* don't fragment flag */ -#define IP_MF 0x2000U /* more fragments flag */ -#define IP_OFFMASK 0x1fffU /* mask for fragmenting bits */ - /* time to live */ - PACK_STRUCT_FLD_8(u8_t _ttl); - /* protocol*/ - PACK_STRUCT_FLD_8(u8_t _proto); - /* checksum */ - PACK_STRUCT_FIELD(u16_t _chksum); - /* source and destination IP addresses */ - PACK_STRUCT_FLD_S(ip4_addr_p_t src); - PACK_STRUCT_FLD_S(ip4_addr_p_t dest); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -/* Macros to get struct ip_hdr fields: */ -#define IPH_V(hdr) ((hdr)->_v_hl >> 4) -#define IPH_HL(hdr) ((hdr)->_v_hl & 0x0f) -#define IPH_TOS(hdr) ((hdr)->_tos) -#define IPH_LEN(hdr) ((hdr)->_len) -#define IPH_ID(hdr) ((hdr)->_id) -#define IPH_OFFSET(hdr) ((hdr)->_offset) -#define IPH_TTL(hdr) ((hdr)->_ttl) -#define IPH_PROTO(hdr) ((hdr)->_proto) -#define IPH_CHKSUM(hdr) ((hdr)->_chksum) - -/* Macros to set struct ip_hdr fields: */ -#define IPH_VHL_SET(hdr, v, hl) (hdr)->_v_hl = (u8_t)((((v) << 4) | (hl))) -#define IPH_TOS_SET(hdr, tos) (hdr)->_tos = (tos) -#define IPH_LEN_SET(hdr, len) (hdr)->_len = (len) -#define IPH_ID_SET(hdr, id) (hdr)->_id = (id) -#define IPH_OFFSET_SET(hdr, off) (hdr)->_offset = (off) -#define IPH_TTL_SET(hdr, ttl) (hdr)->_ttl = (u8_t)(ttl) -#define IPH_PROTO_SET(hdr, proto) (hdr)->_proto = (u8_t)(proto) -#define IPH_CHKSUM_SET(hdr, chksum) (hdr)->_chksum = (chksum) - - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_PROT_IP4_H */ diff --git a/tools/sdk/include/lwip/lwip/prot/ip6.h b/tools/sdk/include/lwip/lwip/prot/ip6.h deleted file mode 100644 index 6e1e2632bfc..00000000000 --- a/tools/sdk/include/lwip/lwip/prot/ip6.h +++ /dev/null @@ -1,169 +0,0 @@ -/** - * @file - * IPv6 protocol definitions - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_PROT_IP6_H -#define LWIP_HDR_PROT_IP6_H - -#include "lwip/arch.h" -#include "lwip/ip6_addr.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** This is the packed version of ip6_addr_t, - used in network headers that are itself packed */ -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct ip6_addr_packed { - PACK_STRUCT_FIELD(u32_t addr[4]); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif -typedef struct ip6_addr_packed ip6_addr_p_t; - -#define IP6_HLEN 40 - -#define IP6_NEXTH_HOPBYHOP 0 -#define IP6_NEXTH_TCP 6 -#define IP6_NEXTH_UDP 17 -#define IP6_NEXTH_ENCAPS 41 -#define IP6_NEXTH_ROUTING 43 -#define IP6_NEXTH_FRAGMENT 44 -#define IP6_NEXTH_ICMP6 58 -#define IP6_NEXTH_NONE 59 -#define IP6_NEXTH_DESTOPTS 60 -#define IP6_NEXTH_UDPLITE 136 - -/** The IPv6 header. */ -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct ip6_hdr { - /** version / traffic class / flow label */ - PACK_STRUCT_FIELD(u32_t _v_tc_fl); - /** payload length */ - PACK_STRUCT_FIELD(u16_t _plen); - /** next header */ - PACK_STRUCT_FLD_8(u8_t _nexth); - /** hop limit */ - PACK_STRUCT_FLD_8(u8_t _hoplim); - /** source and destination IP addresses */ - PACK_STRUCT_FLD_S(ip6_addr_p_t src); - PACK_STRUCT_FLD_S(ip6_addr_p_t dest); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -/* Hop-by-hop router alert option. */ -#define IP6_HBH_HLEN 8 -#define IP6_PAD1_OPTION 0 -#define IP6_PADN_ALERT_OPTION 1 -#define IP6_ROUTER_ALERT_OPTION 5 -#define IP6_ROUTER_ALERT_VALUE_MLD 0 -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct ip6_hbh_hdr { - /* next header */ - PACK_STRUCT_FLD_8(u8_t _nexth); - /* header length */ - PACK_STRUCT_FLD_8(u8_t _hlen); - /* router alert option type */ - PACK_STRUCT_FLD_8(u8_t _ra_opt_type); - /* router alert option data len */ - PACK_STRUCT_FLD_8(u8_t _ra_opt_dlen); - /* router alert option data */ - PACK_STRUCT_FIELD(u16_t _ra_opt_data); - /* PadN option type */ - PACK_STRUCT_FLD_8(u8_t _padn_opt_type); - /* PadN option data len */ - PACK_STRUCT_FLD_8(u8_t _padn_opt_dlen); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -/* Fragment header. */ -#define IP6_FRAG_HLEN 8 -#define IP6_FRAG_OFFSET_MASK 0xfff8 -#define IP6_FRAG_MORE_FLAG 0x0001 -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct ip6_frag_hdr { - /* next header */ - PACK_STRUCT_FLD_8(u8_t _nexth); - /* reserved */ - PACK_STRUCT_FLD_8(u8_t reserved); - /* fragment offset */ - PACK_STRUCT_FIELD(u16_t _fragment_offset); - /* fragmented packet identification */ - PACK_STRUCT_FIELD(u32_t _identification); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -#define IP6H_V(hdr) ((lwip_ntohl((hdr)->_v_tc_fl) >> 28) & 0x0f) -#define IP6H_TC(hdr) ((lwip_ntohl((hdr)->_v_tc_fl) >> 20) & 0xff) -#define IP6H_FL(hdr) (lwip_ntohl((hdr)->_v_tc_fl) & 0x000fffff) -#define IP6H_PLEN(hdr) (lwip_ntohs((hdr)->_plen)) -#define IP6H_NEXTH(hdr) ((hdr)->_nexth) -#define IP6H_NEXTH_P(hdr) ((u8_t *)(hdr) + 6) -#define IP6H_HOPLIM(hdr) ((hdr)->_hoplim) - -#define IP6H_VTCFL_SET(hdr, v, tc, fl) (hdr)->_v_tc_fl = (lwip_htonl((((u32_t)(v)) << 28) | (((u32_t)(tc)) << 20) | (fl))) -#define IP6H_PLEN_SET(hdr, plen) (hdr)->_plen = lwip_htons(plen) -#define IP6H_NEXTH_SET(hdr, nexth) (hdr)->_nexth = (nexth) -#define IP6H_HOPLIM_SET(hdr, hl) (hdr)->_hoplim = (u8_t)(hl) - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_PROT_IP6_H */ diff --git a/tools/sdk/include/lwip/lwip/prot/mld6.h b/tools/sdk/include/lwip/lwip/prot/mld6.h deleted file mode 100644 index be3a006af25..00000000000 --- a/tools/sdk/include/lwip/lwip/prot/mld6.h +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @file - * MLD6 protocol definitions - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_PROT_MLD6_H -#define LWIP_HDR_PROT_MLD6_H - -#include "lwip/arch.h" -#include "lwip/prot/ip6.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** Multicast listener report/query/done message header. */ -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct mld_header { - PACK_STRUCT_FLD_8(u8_t type); - PACK_STRUCT_FLD_8(u8_t code); - PACK_STRUCT_FIELD(u16_t chksum); - PACK_STRUCT_FIELD(u16_t max_resp_delay); - PACK_STRUCT_FIELD(u16_t reserved); - PACK_STRUCT_FLD_S(ip6_addr_p_t multicast_address); - /* Options follow. */ -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_PROT_MLD6_H */ diff --git a/tools/sdk/include/lwip/lwip/prot/nd6.h b/tools/sdk/include/lwip/lwip/prot/nd6.h deleted file mode 100644 index 2d4903d15b6..00000000000 --- a/tools/sdk/include/lwip/lwip/prot/nd6.h +++ /dev/null @@ -1,277 +0,0 @@ -/** - * @file - * ND6 protocol definitions - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_PROT_ND6_H -#define LWIP_HDR_PROT_ND6_H - -#include "lwip/arch.h" -#include "lwip/ip6_addr.h" -#include "lwip/prot/ip6.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** Neighbor solicitation message header. */ -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct ns_header { - PACK_STRUCT_FLD_8(u8_t type); - PACK_STRUCT_FLD_8(u8_t code); - PACK_STRUCT_FIELD(u16_t chksum); - PACK_STRUCT_FIELD(u32_t reserved); - PACK_STRUCT_FLD_S(ip6_addr_p_t target_address); - /* Options follow. */ -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -/** Neighbor advertisement message header. */ -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct na_header { - PACK_STRUCT_FLD_8(u8_t type); - PACK_STRUCT_FLD_8(u8_t code); - PACK_STRUCT_FIELD(u16_t chksum); - PACK_STRUCT_FLD_8(u8_t flags); - PACK_STRUCT_FLD_8(u8_t reserved[3]); - PACK_STRUCT_FLD_S(ip6_addr_p_t target_address); - /* Options follow. */ -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif -#define ND6_FLAG_ROUTER (0x80) -#define ND6_FLAG_SOLICITED (0x40) -#define ND6_FLAG_OVERRIDE (0x20) - -/** Router solicitation message header. */ -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct rs_header { - PACK_STRUCT_FLD_8(u8_t type); - PACK_STRUCT_FLD_8(u8_t code); - PACK_STRUCT_FIELD(u16_t chksum); - PACK_STRUCT_FIELD(u32_t reserved); - /* Options follow. */ -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -/** Router advertisement message header. */ -#define ND6_RA_FLAG_MANAGED_ADDR_CONFIG (0x80) -#define ND6_RA_FLAG_OTHER_CONFIG (0x40) -#define ND6_RA_FLAG_HOME_AGENT (0x20) -#define ND6_RA_PREFERENCE_MASK (0x18) -#define ND6_RA_PREFERENCE_HIGH (0x08) -#define ND6_RA_PREFERENCE_MEDIUM (0x00) -#define ND6_RA_PREFERENCE_LOW (0x18) -#define ND6_RA_PREFERENCE_DISABLED (0x10) -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct ra_header { - PACK_STRUCT_FLD_8(u8_t type); - PACK_STRUCT_FLD_8(u8_t code); - PACK_STRUCT_FIELD(u16_t chksum); - PACK_STRUCT_FLD_8(u8_t current_hop_limit); - PACK_STRUCT_FLD_8(u8_t flags); - PACK_STRUCT_FIELD(u16_t router_lifetime); - PACK_STRUCT_FIELD(u32_t reachable_time); - PACK_STRUCT_FIELD(u32_t retrans_timer); - /* Options follow. */ -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -/** Redirect message header. */ -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct redirect_header { - PACK_STRUCT_FLD_8(u8_t type); - PACK_STRUCT_FLD_8(u8_t code); - PACK_STRUCT_FIELD(u16_t chksum); - PACK_STRUCT_FIELD(u32_t reserved); - PACK_STRUCT_FLD_S(ip6_addr_p_t target_address); - PACK_STRUCT_FLD_S(ip6_addr_p_t destination_address); - /* Options follow. */ -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -/** Link-layer address option. */ -#define ND6_OPTION_TYPE_SOURCE_LLADDR (0x01) -#define ND6_OPTION_TYPE_TARGET_LLADDR (0x02) -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct lladdr_option { - PACK_STRUCT_FLD_8(u8_t type); - PACK_STRUCT_FLD_8(u8_t length); - PACK_STRUCT_FLD_8(u8_t addr[NETIF_MAX_HWADDR_LEN]); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -/** Prefix information option. */ -#define ND6_OPTION_TYPE_PREFIX_INFO (0x03) -#define ND6_PREFIX_FLAG_ON_LINK (0x80) -#define ND6_PREFIX_FLAG_AUTONOMOUS (0x40) -#define ND6_PREFIX_FLAG_ROUTER_ADDRESS (0x20) -#define ND6_PREFIX_FLAG_SITE_PREFIX (0x10) -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct prefix_option { - PACK_STRUCT_FLD_8(u8_t type); - PACK_STRUCT_FLD_8(u8_t length); - PACK_STRUCT_FLD_8(u8_t prefix_length); - PACK_STRUCT_FLD_8(u8_t flags); - PACK_STRUCT_FIELD(u32_t valid_lifetime); - PACK_STRUCT_FIELD(u32_t preferred_lifetime); - PACK_STRUCT_FLD_8(u8_t reserved2[3]); - PACK_STRUCT_FLD_8(u8_t site_prefix_length); - PACK_STRUCT_FLD_S(ip6_addr_p_t prefix); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -/** Redirected header option. */ -#define ND6_OPTION_TYPE_REDIR_HDR (0x04) -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct redirected_header_option { - PACK_STRUCT_FLD_8(u8_t type); - PACK_STRUCT_FLD_8(u8_t length); - PACK_STRUCT_FLD_8(u8_t reserved[6]); - /* Portion of redirected packet follows. */ - /* PACK_STRUCT_FLD_8(u8_t redirected[8]); */ -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -/** MTU option. */ -#define ND6_OPTION_TYPE_MTU (0x05) -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct mtu_option { - PACK_STRUCT_FLD_8(u8_t type); - PACK_STRUCT_FLD_8(u8_t length); - PACK_STRUCT_FIELD(u16_t reserved); - PACK_STRUCT_FIELD(u32_t mtu); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -/** Route information option. */ -#define ND6_OPTION_TYPE_ROUTE_INFO (24) -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct route_option { - PACK_STRUCT_FLD_8(u8_t type); - PACK_STRUCT_FLD_8(u8_t length); - PACK_STRUCT_FLD_8(u8_t prefix_length); - PACK_STRUCT_FLD_8(u8_t preference); - PACK_STRUCT_FIELD(u32_t route_lifetime); - PACK_STRUCT_FLD_S(ip6_addr_p_t prefix); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -/** Recursive DNS Server Option. */ -#if LWIP_ND6_RDNSS_MAX_DNS_SERVERS -#define LWIP_RDNSS_OPTION_MAX_SERVERS LWIP_ND6_RDNSS_MAX_DNS_SERVERS -#else -#define LWIP_RDNSS_OPTION_MAX_SERVERS 1 -#endif -#define ND6_OPTION_TYPE_RDNSS (25) -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct rdnss_option { - PACK_STRUCT_FLD_8(u8_t type); - PACK_STRUCT_FLD_8(u8_t length); - PACK_STRUCT_FIELD(u16_t reserved); - PACK_STRUCT_FIELD(u32_t lifetime); - PACK_STRUCT_FLD_S(ip6_addr_p_t rdnss_address[LWIP_RDNSS_OPTION_MAX_SERVERS]); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_PROT_ND6_H */ diff --git a/tools/sdk/include/lwip/lwip/prot/tcp.h b/tools/sdk/include/lwip/lwip/prot/tcp.h deleted file mode 100644 index 67fe7b9e5fc..00000000000 --- a/tools/sdk/include/lwip/lwip/prot/tcp.h +++ /dev/null @@ -1,97 +0,0 @@ -/** - * @file - * TCP protocol definitions - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_PROT_TCP_H -#define LWIP_HDR_PROT_TCP_H - -#include "lwip/arch.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Length of the TCP header, excluding options. */ -#define TCP_HLEN 20 - -/* Fields are (of course) in network byte order. - * Some fields are converted to host byte order in tcp_input(). - */ -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct tcp_hdr { - PACK_STRUCT_FIELD(u16_t src); - PACK_STRUCT_FIELD(u16_t dest); - PACK_STRUCT_FIELD(u32_t seqno); - PACK_STRUCT_FIELD(u32_t ackno); - PACK_STRUCT_FIELD(u16_t _hdrlen_rsvd_flags); - PACK_STRUCT_FIELD(u16_t wnd); - PACK_STRUCT_FIELD(u16_t chksum); - PACK_STRUCT_FIELD(u16_t urgp); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -/* TCP header flags bits */ -#define TCP_FIN 0x01U -#define TCP_SYN 0x02U -#define TCP_RST 0x04U -#define TCP_PSH 0x08U -#define TCP_ACK 0x10U -#define TCP_URG 0x20U -#define TCP_ECE 0x40U -#define TCP_CWR 0x80U -/* Valid TCP header flags */ -#define TCP_FLAGS 0x3fU - -#define TCPH_HDRLEN(phdr) ((u16_t)(lwip_ntohs((phdr)->_hdrlen_rsvd_flags) >> 12)) -#define TCPH_FLAGS(phdr) ((u16_t)(lwip_ntohs((phdr)->_hdrlen_rsvd_flags) & TCP_FLAGS)) - -#define TCPH_HDRLEN_SET(phdr, len) (phdr)->_hdrlen_rsvd_flags = lwip_htons(((len) << 12) | TCPH_FLAGS(phdr)) -#define TCPH_FLAGS_SET(phdr, flags) (phdr)->_hdrlen_rsvd_flags = (((phdr)->_hdrlen_rsvd_flags & PP_HTONS(~TCP_FLAGS)) | lwip_htons(flags)) -#define TCPH_HDRLEN_FLAGS_SET(phdr, len, flags) (phdr)->_hdrlen_rsvd_flags = (u16_t)(lwip_htons((u16_t)((len) << 12) | (flags))) - -#define TCPH_SET_FLAG(phdr, flags ) (phdr)->_hdrlen_rsvd_flags = ((phdr)->_hdrlen_rsvd_flags | lwip_htons(flags)) -#define TCPH_UNSET_FLAG(phdr, flags) (phdr)->_hdrlen_rsvd_flags = ((phdr)->_hdrlen_rsvd_flags & ~lwip_htons(flags)) - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_PROT_TCP_H */ diff --git a/tools/sdk/include/lwip/lwip/prot/udp.h b/tools/sdk/include/lwip/lwip/prot/udp.h deleted file mode 100644 index 664f19a3e7b..00000000000 --- a/tools/sdk/include/lwip/lwip/prot/udp.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - * @file - * UDP protocol definitions - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_PROT_UDP_H -#define LWIP_HDR_PROT_UDP_H - -#include "lwip/arch.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define UDP_HLEN 8 - -/* Fields are (of course) in network byte order. */ -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct udp_hdr { - PACK_STRUCT_FIELD(u16_t src); - PACK_STRUCT_FIELD(u16_t dest); /* src/dest UDP ports */ - PACK_STRUCT_FIELD(u16_t len); - PACK_STRUCT_FIELD(u16_t chksum); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_PROT_UDP_H */ diff --git a/tools/sdk/include/lwip/lwip/raw.h b/tools/sdk/include/lwip/lwip/raw.h deleted file mode 100644 index 30aa1471096..00000000000 --- a/tools/sdk/include/lwip/lwip/raw.h +++ /dev/null @@ -1,118 +0,0 @@ -/** - * @file - * raw API (to be used from TCPIP thread)\n - * See also @ref raw_raw - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_RAW_H -#define LWIP_HDR_RAW_H - -#include "lwip/opt.h" - -#if LWIP_RAW /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/pbuf.h" -#include "lwip/def.h" -#include "lwip/ip.h" -#include "lwip/ip_addr.h" -#include "lwip/ip6_addr.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct raw_pcb; - -/** Function prototype for raw pcb receive callback functions. - * @param arg user supplied argument (raw_pcb.recv_arg) - * @param pcb the raw_pcb which received data - * @param p the packet buffer that was received - * @param addr the remote IP address from which the packet was received - * @return 1 if the packet was 'eaten' (aka. deleted), - * 0 if the packet lives on - * If returning 1, the callback is responsible for freeing the pbuf - * if it's not used any more. - */ -typedef u8_t (*raw_recv_fn)(void *arg, struct raw_pcb *pcb, struct pbuf *p, - const ip_addr_t *addr); - -/** the RAW protocol control block */ -struct raw_pcb { - /* Common members of all PCB types */ - IP_PCB; - - struct raw_pcb *next; - - u8_t protocol; - - /** receive callback function */ - raw_recv_fn recv; - /* user-supplied argument for the recv callback */ - void *recv_arg; -#if LWIP_IPV6 - /* fields for handling checksum computations as per RFC3542. */ - u16_t chksum_offset; - u8_t chksum_reqd; -#endif -}; - -/* The following functions is the application layer interface to the - RAW code. */ -struct raw_pcb * raw_new (u8_t proto); -struct raw_pcb * raw_new_ip_type(u8_t type, u8_t proto); -void raw_remove (struct raw_pcb *pcb); -err_t raw_bind (struct raw_pcb *pcb, const ip_addr_t *ipaddr); -err_t raw_connect (struct raw_pcb *pcb, const ip_addr_t *ipaddr); - -err_t raw_sendto (struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *ipaddr); -err_t raw_send (struct raw_pcb *pcb, struct pbuf *p); - -void raw_recv (struct raw_pcb *pcb, raw_recv_fn recv, void *recv_arg); - -/* The following functions are the lower layer interface to RAW. */ -u8_t raw_input (struct pbuf *p, struct netif *inp); -#define raw_init() /* Compatibility define, no init needed. */ - -void raw_netif_ip_addr_changed(const ip_addr_t* old_addr, const ip_addr_t* new_addr); - -/* for compatibility with older implementation */ -#define raw_new_ip6(proto) raw_new_ip_type(IPADDR_TYPE_V6, proto) - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_RAW */ - -#endif /* LWIP_HDR_RAW_H */ diff --git a/tools/sdk/include/lwip/lwip/sio.h b/tools/sdk/include/lwip/lwip/sio.h deleted file mode 100644 index 7643e195697..00000000000 --- a/tools/sdk/include/lwip/lwip/sio.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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. - */ - -/* - * This is the interface to the platform specific serial IO module - * It needs to be implemented by those platforms which need SLIP or PPP - */ - -#ifndef SIO_H -#define SIO_H - -#include "lwip/arch.h" -#include "lwip/opt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* If you want to define sio_fd_t elsewhere or differently, - define this in your cc.h file. */ -#ifndef __sio_fd_t_defined -typedef void * sio_fd_t; -#endif - -/* The following functions can be defined to something else in your cc.h file - or be implemented in your custom sio.c file. */ - -#ifndef sio_open -/** - * Opens a serial device for communication. - * - * @param devnum device number - * @return handle to serial device if successful, NULL otherwise - */ -sio_fd_t sio_open(u8_t devnum); -#endif - -#ifndef sio_send -/** - * Sends a single character to the serial device. - * - * @param c character to send - * @param fd serial device handle - * - * @note This function will block until the character can be sent. - */ -void sio_send(u8_t c, sio_fd_t fd); -#endif - -#ifndef sio_recv -/** - * Receives a single character from the serial device. - * - * @param fd serial device handle - * - * @note This function will block until a character is received. - */ -u8_t sio_recv(sio_fd_t fd); -#endif - -#ifndef sio_read -/** - * Reads from the serial device. - * - * @param fd serial device handle - * @param data pointer to data buffer for receiving - * @param len maximum length (in bytes) of data to receive - * @return number of bytes actually received - may be 0 if aborted by sio_read_abort - * - * @note This function will block until data can be received. The blocking - * can be cancelled by calling sio_read_abort(). - */ -u32_t sio_read(sio_fd_t fd, u8_t *data, u32_t len); -#endif - -#ifndef sio_tryread -/** - * Tries to read from the serial device. Same as sio_read but returns - * immediately if no data is available and never blocks. - * - * @param fd serial device handle - * @param data pointer to data buffer for receiving - * @param len maximum length (in bytes) of data to receive - * @return number of bytes actually received - */ -u32_t sio_tryread(sio_fd_t fd, u8_t *data, u32_t len); -#endif - -#ifndef sio_write -/** - * Writes to the serial device. - * - * @param fd serial device handle - * @param data pointer to data to send - * @param len length (in bytes) of data to send - * @return number of bytes actually sent - * - * @note This function will block until all data can be sent. - */ -u32_t sio_write(sio_fd_t fd, u8_t *data, u32_t len); -#endif - -#ifndef sio_read_abort -/** - * Aborts a blocking sio_read() call. - * - * @param fd serial device handle - */ -void sio_read_abort(sio_fd_t fd); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* SIO_H */ diff --git a/tools/sdk/include/lwip/lwip/snmp.h b/tools/sdk/include/lwip/lwip/snmp.h deleted file mode 100644 index 8704d0b4d29..00000000000 --- a/tools/sdk/include/lwip/lwip/snmp.h +++ /dev/null @@ -1,213 +0,0 @@ -/** - * @file - * SNMP support API for implementing netifs and statitics for MIB2 - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Dirk Ziegelmeier - * - */ -#ifndef LWIP_HDR_SNMP_H -#define LWIP_HDR_SNMP_H - -#include "lwip/opt.h" -#include "lwip/ip_addr.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct udp_pcb; -struct netif; - -/** - * @defgroup netif_mib2 MIB2 statistics - * @ingroup netif - */ - -/* MIB2 statistics functions */ -#if MIB2_STATS /* don't build if not configured for use in lwipopts.h */ -/** - * @ingroup netif_mib2 - * @see RFC1213, "MIB-II, 6. Definitions" - */ -enum snmp_ifType { - snmp_ifType_other=1, /* none of the following */ - snmp_ifType_regular1822, - snmp_ifType_hdh1822, - snmp_ifType_ddn_x25, - snmp_ifType_rfc877_x25, - snmp_ifType_ethernet_csmacd, - snmp_ifType_iso88023_csmacd, - snmp_ifType_iso88024_tokenBus, - snmp_ifType_iso88025_tokenRing, - snmp_ifType_iso88026_man, - snmp_ifType_starLan, - snmp_ifType_proteon_10Mbit, - snmp_ifType_proteon_80Mbit, - snmp_ifType_hyperchannel, - snmp_ifType_fddi, - snmp_ifType_lapb, - snmp_ifType_sdlc, - snmp_ifType_ds1, /* T-1 */ - snmp_ifType_e1, /* european equiv. of T-1 */ - snmp_ifType_basicISDN, - snmp_ifType_primaryISDN, /* proprietary serial */ - snmp_ifType_propPointToPointSerial, - snmp_ifType_ppp, - snmp_ifType_softwareLoopback, - snmp_ifType_eon, /* CLNP over IP [11] */ - snmp_ifType_ethernet_3Mbit, - snmp_ifType_nsip, /* XNS over IP */ - snmp_ifType_slip, /* generic SLIP */ - snmp_ifType_ultra, /* ULTRA technologies */ - snmp_ifType_ds3, /* T-3 */ - snmp_ifType_sip, /* SMDS */ - snmp_ifType_frame_relay -}; - -/** This macro has a precision of ~49 days because sys_now returns u32_t. \#define your own if you want ~490 days. */ -#ifndef MIB2_COPY_SYSUPTIME_TO -#define MIB2_COPY_SYSUPTIME_TO(ptrToVal) (*(ptrToVal) = (sys_now() / 10)) -#endif - -/** - * @ingroup netif_mib2 - * Increment stats member for SNMP MIB2 stats (struct stats_mib2_netif_ctrs) - */ -#define MIB2_STATS_NETIF_INC(n, x) do { ++(n)->mib2_counters.x; } while(0) -/** - * @ingroup netif_mib2 - * Add value to stats member for SNMP MIB2 stats (struct stats_mib2_netif_ctrs) - */ -#define MIB2_STATS_NETIF_ADD(n, x, val) do { (n)->mib2_counters.x += (val); } while(0) - -/** - * @ingroup netif_mib2 - * Init MIB2 statistic counters in netif - * @param netif Netif to init - * @param type one of enum @ref snmp_ifType - * @param speed your link speed here (units: bits per second) - */ -#define MIB2_INIT_NETIF(netif, type, speed) do { \ - (netif)->link_type = (type); \ - (netif)->link_speed = (speed);\ - (netif)->ts = 0; \ - (netif)->mib2_counters.ifinoctets = 0; \ - (netif)->mib2_counters.ifinucastpkts = 0; \ - (netif)->mib2_counters.ifinnucastpkts = 0; \ - (netif)->mib2_counters.ifindiscards = 0; \ - (netif)->mib2_counters.ifinerrors = 0; \ - (netif)->mib2_counters.ifinunknownprotos = 0; \ - (netif)->mib2_counters.ifoutoctets = 0; \ - (netif)->mib2_counters.ifoutucastpkts = 0; \ - (netif)->mib2_counters.ifoutnucastpkts = 0; \ - (netif)->mib2_counters.ifoutdiscards = 0; \ - (netif)->mib2_counters.ifouterrors = 0; } while(0) -#else /* MIB2_STATS */ -#ifndef MIB2_COPY_SYSUPTIME_TO -#define MIB2_COPY_SYSUPTIME_TO(ptrToVal) -#endif -#define MIB2_INIT_NETIF(netif, type, speed) -#define MIB2_STATS_NETIF_INC(n, x) -#define MIB2_STATS_NETIF_ADD(n, x, val) -#endif /* MIB2_STATS */ - -/* LWIP MIB2 callbacks */ -#if LWIP_MIB2_CALLBACKS /* don't build if not configured for use in lwipopts.h */ -/* network interface */ -void mib2_netif_added(struct netif *ni); -void mib2_netif_removed(struct netif *ni); - -#if LWIP_IPV4 && LWIP_ARP -/* ARP (for atTable and ipNetToMediaTable) */ -void mib2_add_arp_entry(struct netif *ni, ip4_addr_t *ip); -void mib2_remove_arp_entry(struct netif *ni, ip4_addr_t *ip); -#else /* LWIP_IPV4 && LWIP_ARP */ -#define mib2_add_arp_entry(ni,ip) -#define mib2_remove_arp_entry(ni,ip) -#endif /* LWIP_IPV4 && LWIP_ARP */ - -/* IP */ -#if LWIP_IPV4 -void mib2_add_ip4(struct netif *ni); -void mib2_remove_ip4(struct netif *ni); -void mib2_add_route_ip4(u8_t dflt, struct netif *ni); -void mib2_remove_route_ip4(u8_t dflt, struct netif *ni); -#endif /* LWIP_IPV4 */ - -/* UDP */ -#if LWIP_UDP -void mib2_udp_bind(struct udp_pcb *pcb); -void mib2_udp_unbind(struct udp_pcb *pcb); -#endif /* LWIP_UDP */ - -#else /* LWIP_MIB2_CALLBACKS */ -/* LWIP_MIB2_CALLBACKS support not available */ -/* define everything to be empty */ - -/* network interface */ -#define mib2_netif_added(ni) -#define mib2_netif_removed(ni) - -/* ARP */ -#define mib2_add_arp_entry(ni,ip) -#define mib2_remove_arp_entry(ni,ip) - -/* IP */ -#define mib2_add_ip4(ni) -#define mib2_remove_ip4(ni) -#define mib2_add_route_ip4(dflt, ni) -#define mib2_remove_route_ip4(dflt, ni) - -/* UDP */ -#define mib2_udp_bind(pcb) -#define mib2_udp_unbind(pcb) -#endif /* LWIP_MIB2_CALLBACKS */ - -/* for source-code compatibility reasons only, can be removed (not used internally) */ -#define NETIF_INIT_SNMP MIB2_INIT_NETIF -#define snmp_add_ifinoctets(ni,value) MIB2_STATS_NETIF_ADD(ni, ifinoctets, value) -#define snmp_inc_ifinucastpkts(ni) MIB2_STATS_NETIF_INC(ni, ifinucastpkts) -#define snmp_inc_ifinnucastpkts(ni) MIB2_STATS_NETIF_INC(ni, ifinnucastpkts) -#define snmp_inc_ifindiscards(ni) MIB2_STATS_NETIF_INC(ni, ifindiscards) -#define snmp_inc_ifinerrors(ni) MIB2_STATS_NETIF_INC(ni, ifinerrors) -#define snmp_inc_ifinunknownprotos(ni) MIB2_STATS_NETIF_INC(ni, ifinunknownprotos) -#define snmp_add_ifoutoctets(ni,value) MIB2_STATS_NETIF_ADD(ni, ifoutoctets, value) -#define snmp_inc_ifoutucastpkts(ni) MIB2_STATS_NETIF_INC(ni, ifoutucastpkts) -#define snmp_inc_ifoutnucastpkts(ni) MIB2_STATS_NETIF_INC(ni, ifoutnucastpkts) -#define snmp_inc_ifoutdiscards(ni) MIB2_STATS_NETIF_INC(ni, ifoutdiscards) -#define snmp_inc_ifouterrors(ni) MIB2_STATS_NETIF_INC(ni, ifouterrors) - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_SNMP_H */ diff --git a/tools/sdk/include/lwip/lwip/sockets.h b/tools/sdk/include/lwip/lwip/sockets.h deleted file mode 100644 index eff3b42e46c..00000000000 --- a/tools/sdk/include/lwip/lwip/sockets.h +++ /dev/null @@ -1,738 +0,0 @@ -/** - * @file - * Socket API (to be used from non-TCPIP threads) - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ - - -#ifndef LWIP_HDR_SOCKETS_H -#define LWIP_HDR_SOCKETS_H - -#include "lwip/opt.h" - -#if LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/ip_addr.h" -#include "lwip/err.h" -#include "lwip/inet.h" -#include "lwip/errno.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* If your port already typedef's sa_family_t, define SA_FAMILY_T_DEFINED - to prevent this code from redefining it. */ -#if !defined(sa_family_t) && !defined(SA_FAMILY_T_DEFINED) -typedef u8_t sa_family_t; -#endif -/* If your port already typedef's in_port_t, define IN_PORT_T_DEFINED - to prevent this code from redefining it. */ -#if !defined(in_port_t) && !defined(IN_PORT_T_DEFINED) -typedef u16_t in_port_t; -#endif - -#if LWIP_IPV4 -/* members are in network byte order */ -struct sockaddr_in { - u8_t sin_len; - sa_family_t sin_family; - in_port_t sin_port; - struct in_addr sin_addr; -#define SIN_ZERO_LEN 8 - char sin_zero[SIN_ZERO_LEN]; -}; -#endif /* LWIP_IPV4 */ - -#if LWIP_IPV6 -struct sockaddr_in6 { - u8_t sin6_len; /* length of this structure */ - sa_family_t sin6_family; /* AF_INET6 */ - in_port_t sin6_port; /* Transport layer port # */ - u32_t sin6_flowinfo; /* IPv6 flow information */ - struct in6_addr sin6_addr; /* IPv6 address */ - u32_t sin6_scope_id; /* Set of interfaces for scope */ -}; -#endif /* LWIP_IPV6 */ - -struct sockaddr { - u8_t sa_len; - sa_family_t sa_family; - char sa_data[14]; -}; - -struct sockaddr_storage { - u8_t s2_len; - sa_family_t ss_family; - char s2_data1[2]; - u32_t s2_data2[3]; -#if LWIP_IPV6 - u32_t s2_data3[3]; -#endif /* LWIP_IPV6 */ -}; - -/* If your port already typedef's socklen_t, define SOCKLEN_T_DEFINED - to prevent this code from redefining it. */ -#if !defined(socklen_t) && !defined(SOCKLEN_T_DEFINED) -typedef u32_t socklen_t; -#endif - -struct lwip_sock; - -#if !LWIP_TCPIP_CORE_LOCKING -/** Maximum optlen used by setsockopt/getsockopt */ -#define LWIP_SETGETSOCKOPT_MAXOPTLEN 16 - -/** This struct is used to pass data to the set/getsockopt_internal - * functions running in tcpip_thread context (only a void* is allowed) */ -struct lwip_setgetsockopt_data { - /** socket index for which to change options */ - int s; - /** level of the option to process */ - int level; - /** name of the option to process */ - int optname; - /** set: value to set the option to - * get: value of the option is stored here */ -#if LWIP_MPU_COMPATIBLE - u8_t optval[LWIP_SETGETSOCKOPT_MAXOPTLEN]; -#else - union { - void *p; - const void *pc; - } optval; -#endif - /** size of *optval */ - socklen_t optlen; - /** if an error occurs, it is temporarily stored here */ - err_t err; - /** semaphore to wake up the calling task */ - void* completed_sem; -}; -#endif /* !LWIP_TCPIP_CORE_LOCKING */ - -#if !defined(iovec) -struct iovec { - void *iov_base; - size_t iov_len; -}; -#endif - -struct msghdr { - void *msg_name; - socklen_t msg_namelen; - struct iovec *msg_iov; - int msg_iovlen; - void *msg_control; - socklen_t msg_controllen; - int msg_flags; -}; - -/* Socket protocol types (TCP/UDP/RAW) */ -#define SOCK_STREAM 1 -#define SOCK_DGRAM 2 -#define SOCK_RAW 3 - -/* - * Option flags per-socket. These must match the SOF_ flags in ip.h (checked in init.c) - */ -#define SO_REUSEADDR 0x0004 /* Allow local address reuse */ -#define SO_KEEPALIVE 0x0008 /* keep connections alive */ -#define SO_BROADCAST 0x0020 /* permit to send and to receive broadcast messages (see IP_SOF_BROADCAST option) */ - - -/* - * Additional options, not kept in so_options. - */ -#define SO_DEBUG 0x0001 /* Unimplemented: turn on debugging info recording */ -#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */ -#define SO_DONTROUTE 0x0010 /* Unimplemented: just use interface addresses */ -#define SO_USELOOPBACK 0x0040 /* Unimplemented: bypass hardware when possible */ -#define SO_LINGER 0x0080 /* linger on close if data present */ -#define SO_DONTLINGER ((int)(~SO_LINGER)) -#define SO_OOBINLINE 0x0100 /* Unimplemented: leave received OOB data in line */ -#define SO_REUSEPORT 0x0200 /* Unimplemented: allow local address & port reuse */ -#define SO_SNDBUF 0x1001 /* Unimplemented: send buffer size */ -#define SO_RCVBUF 0x1002 /* receive buffer size */ -#define SO_SNDLOWAT 0x1003 /* Unimplemented: send low-water mark */ -#define SO_RCVLOWAT 0x1004 /* Unimplemented: receive low-water mark */ -#define SO_SNDTIMEO 0x1005 /* send timeout */ -#define SO_RCVTIMEO 0x1006 /* receive timeout */ -#define SO_ERROR 0x1007 /* get error status and clear */ -#define SO_TYPE 0x1008 /* get socket type */ -#define SO_CONTIMEO 0x1009 /* Unimplemented: connect timeout */ -#define SO_NO_CHECK 0x100a /* don't create UDP checksum */ - - -/* - * Structure used for manipulating linger option. - */ -struct linger { - int l_onoff; /* option on/off */ - int l_linger; /* linger time in seconds */ -}; - -/* - * Level number for (get/set)sockopt() to apply to socket itself. - */ -#define SOL_SOCKET 0xfff /* options for socket level */ - - -#define AF_UNSPEC 0 -#define AF_INET 2 -#if LWIP_IPV6 -#define AF_INET6 10 -#else /* LWIP_IPV6 */ -#define AF_INET6 AF_UNSPEC -#endif /* LWIP_IPV6 */ -#define PF_INET AF_INET -#define PF_INET6 AF_INET6 -#define PF_UNSPEC AF_UNSPEC - -#define IPPROTO_IP 0 -#define IPPROTO_ICMP 1 -#define IPPROTO_TCP 6 -#define IPPROTO_UDP 17 -#if LWIP_IPV6 -#define IPPROTO_IPV6 41 -#define IPPROTO_ICMPV6 58 -#endif /* LWIP_IPV6 */ -#define IPPROTO_UDPLITE 136 -#define IPPROTO_RAW 255 - -/* Flags we can use with send and recv. */ -#define MSG_PEEK 0x01 /* Peeks at an incoming message */ -#define MSG_WAITALL 0x02 /* Unimplemented: Requests that the function block until the full amount of data requested can be returned */ -#define MSG_OOB 0x04 /* Unimplemented: Requests out-of-band data. The significance and semantics of out-of-band data are protocol-specific */ -#define MSG_DONTWAIT 0x08 /* Nonblocking i/o for this operation only */ -#define MSG_MORE 0x10 /* Sender will send more */ - - -/* - * Options for level IPPROTO_IP - */ -#define IP_TOS 1 -#define IP_TTL 2 - -#if LWIP_TCP -/* - * Options for level IPPROTO_TCP - */ -#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ -#define TCP_KEEPALIVE 0x02 /* send KEEPALIVE probes when idle for pcb->keep_idle milliseconds */ -#define TCP_KEEPIDLE 0x03 /* set pcb->keep_idle - Same as TCP_KEEPALIVE, but use seconds for get/setsockopt */ -#define TCP_KEEPINTVL 0x04 /* set pcb->keep_intvl - Use seconds for get/setsockopt */ -#define TCP_KEEPCNT 0x05 /* set pcb->keep_cnt - Use number of probes sent for get/setsockopt */ -#endif /* LWIP_TCP */ - -#if LWIP_IPV6 -/* - * Options for level IPPROTO_IPV6 - */ -#define IPV6_CHECKSUM 7 /* RFC3542: calculate and insert the ICMPv6 checksum for raw sockets. */ -#define IPV6_V6ONLY 27 /* RFC3493: boolean control to restrict AF_INET6 sockets to IPv6 communications only. */ - -#if ESP_LWIP -#if LWIP_IPV6_MLD -/* Socket options for IPV6 multicast, uses the MLD interface to manage group memberships. RFC2133. */ -#define IPV6_MULTICAST_IF 0x300 -#define IPV6_MULTICAST_HOPS 0x301 -#define IPV6_MULTICAST_LOOP 0x302 -#define IPV6_ADD_MEMBERSHIP 0x303 -#define IPV6_DROP_MEMBERSHIP 0x304 - -/* Structure used for IPV6_ADD/DROP_MEMBERSHIP */ -typedef struct ip6_mreq { - struct in6_addr ipv6mr_multiaddr; /* IPv6 multicast addr */ - struct in6_addr ipv6mr_interface; /* local IP address of interface */ -} ip6_mreq; - -/* Commonly used synonyms for these options */ -#define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP -#define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP - -#endif /* LWIP_IPV6_MLD */ -#endif - -#endif /* LWIP_IPV6 */ - -#if LWIP_UDP && LWIP_UDPLITE -/* - * Options for level IPPROTO_UDPLITE - */ -#define UDPLITE_SEND_CSCOV 0x01 /* sender checksum coverage */ -#define UDPLITE_RECV_CSCOV 0x02 /* minimal receiver checksum coverage */ -#endif /* LWIP_UDP && LWIP_UDPLITE*/ - - -#if LWIP_MULTICAST_TX_OPTIONS -/* - * Options and types for UDP multicast traffic handling - */ -#define IP_MULTICAST_TTL 5 -#define IP_MULTICAST_IF 6 -#define IP_MULTICAST_LOOP 7 -#endif /* LWIP_MULTICAST_TX_OPTIONS */ - -#if LWIP_IGMP -/* - * Options and types related to multicast membership - */ -#define IP_ADD_MEMBERSHIP 3 -#define IP_DROP_MEMBERSHIP 4 - -typedef struct ip_mreq { - struct in_addr imr_multiaddr; /* IP multicast address of group */ - struct in_addr imr_interface; /* local IP address of interface */ -} ip_mreq; -#endif /* LWIP_IGMP */ - -/* - * The Type of Service provides an indication of the abstract - * parameters of the quality of service desired. These parameters are - * to be used to guide the selection of the actual service parameters - * when transmitting a datagram through a particular network. Several - * networks offer service precedence, which somehow treats high - * precedence traffic as more important than other traffic (generally - * by accepting only traffic above a certain precedence at time of high - * load). The major choice is a three way tradeoff between low-delay, - * high-reliability, and high-throughput. - * The use of the Delay, Throughput, and Reliability indications may - * increase the cost (in some sense) of the service. In many networks - * better performance for one of these parameters is coupled with worse - * performance on another. Except for very unusual cases at most two - * of these three indications should be set. - */ -#define IPTOS_TOS_MASK 0x1E -#define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK) -#define IPTOS_LOWDELAY 0x10 -#define IPTOS_THROUGHPUT 0x08 -#define IPTOS_RELIABILITY 0x04 -#define IPTOS_LOWCOST 0x02 -#define IPTOS_MINCOST IPTOS_LOWCOST - -/* - * The Network Control precedence designation is intended to be used - * within a network only. The actual use and control of that - * designation is up to each network. The Internetwork Control - * designation is intended for use by gateway control originators only. - * If the actual use of these precedence designations is of concern to - * a particular network, it is the responsibility of that network to - * control the access to, and use of, those precedence designations. - */ -#define IPTOS_PREC_MASK 0xe0 -#define IPTOS_PREC(tos) ((tos) & IPTOS_PREC_MASK) -#define IPTOS_PREC_NETCONTROL 0xe0 -#define IPTOS_PREC_INTERNETCONTROL 0xc0 -#define IPTOS_PREC_CRITIC_ECP 0xa0 -#define IPTOS_PREC_FLASHOVERRIDE 0x80 -#define IPTOS_PREC_FLASH 0x60 -#define IPTOS_PREC_IMMEDIATE 0x40 -#define IPTOS_PREC_PRIORITY 0x20 -#define IPTOS_PREC_ROUTINE 0x00 - - -/* - * Commands for ioctlsocket(), taken from the BSD file fcntl.h. - * lwip_ioctl only supports FIONREAD and FIONBIO, for now - * - * Ioctl's have the command encoded in the lower word, - * and the size of any in or out parameters in the upper - * word. The high 2 bits of the upper word are used - * to encode the in/out status of the parameter; for now - * we restrict parameters to at most 128 bytes. - */ -#if !defined(FIONREAD) || !defined(FIONBIO) -#define IOCPARM_MASK 0x7fU /* parameters must be < 128 bytes */ -#define IOC_VOID 0x20000000UL /* no parameters */ -#define IOC_OUT 0x40000000UL /* copy out parameters */ -#define IOC_IN 0x80000000UL /* copy in parameters */ -#define IOC_INOUT (IOC_IN|IOC_OUT) - /* 0x20000000 distinguishes new & - old ioctl's */ -#define _IO(x,y) (IOC_VOID|((x)<<8)|(y)) - -#define _IOR(x,y,t) (IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y)) - -#define _IOW(x,y,t) (IOC_IN|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y)) -#endif /* !defined(FIONREAD) || !defined(FIONBIO) */ - -#ifndef FIONREAD -#define FIONREAD _IOR('f', 127, unsigned long) /* get # bytes to read */ -#endif -#ifndef FIONBIO -#define FIONBIO _IOW('f', 126, unsigned long) /* set/clear non-blocking i/o */ -#endif - -/* Socket I/O Controls: unimplemented */ -#ifndef SIOCSHIWAT -#define SIOCSHIWAT _IOW('s', 0, unsigned long) /* set high watermark */ -#define SIOCGHIWAT _IOR('s', 1, unsigned long) /* get high watermark */ -#define SIOCSLOWAT _IOW('s', 2, unsigned long) /* set low watermark */ -#define SIOCGLOWAT _IOR('s', 3, unsigned long) /* get low watermark */ -#define SIOCATMARK _IOR('s', 7, unsigned long) /* at oob mark? */ -#endif - -/* commands for fnctl */ -#ifndef F_GETFL -#define F_GETFL 3 -#endif -#ifndef F_SETFL -#define F_SETFL 4 -#endif - -/* File status flags and file access modes for fnctl, - these are bits in an int. */ -#ifndef O_NONBLOCK -#define O_NONBLOCK 1 /* nonblocking I/O */ -#endif -#ifndef O_NDELAY -#define O_NDELAY 1 /* same as O_NONBLOCK, for compatibility */ -#endif - -#ifndef SHUT_RD - #define SHUT_RD 0 - #define SHUT_WR 1 - #define SHUT_RDWR 2 -#endif - -/* FD_SET used for lwip_select */ -#ifndef FD_SET -#undef FD_SETSIZE -/* Make FD_SETSIZE match NUM_SOCKETS in socket.c */ -#define FD_SETSIZE MEMP_NUM_NETCONN -#define FDSETSAFESET(n, code) do { \ - if (((n) - LWIP_SOCKET_OFFSET < MEMP_NUM_NETCONN) && (((int)(n) - LWIP_SOCKET_OFFSET) >= 0)) { \ - code; }} while(0) -#define FDSETSAFEGET(n, code) (((n) - LWIP_SOCKET_OFFSET < MEMP_NUM_NETCONN) && (((int)(n) - LWIP_SOCKET_OFFSET) >= 0) ?\ - (code) : 0) -#define FD_SET(n, p) FDSETSAFESET(n, (p)->fd_bits[((n)-LWIP_SOCKET_OFFSET)/8] |= (1 << (((n)-LWIP_SOCKET_OFFSET) & 7))) -#define FD_CLR(n, p) FDSETSAFESET(n, (p)->fd_bits[((n)-LWIP_SOCKET_OFFSET)/8] &= ~(1 << (((n)-LWIP_SOCKET_OFFSET) & 7))) -#define FD_ISSET(n,p) FDSETSAFEGET(n, (p)->fd_bits[((n)-LWIP_SOCKET_OFFSET)/8] & (1 << (((n)-LWIP_SOCKET_OFFSET) & 7))) -#define FD_ZERO(p) memset((void*)(p), 0, sizeof(*(p))) - -typedef struct fd_set -{ - unsigned char fd_bits [(FD_SETSIZE+7)/8]; -} fd_set; - -#endif /* FD_SET */ - -/** LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided - * by your system, set this to 0 and include in cc.h */ -#ifndef LWIP_TIMEVAL_PRIVATE -#define LWIP_TIMEVAL_PRIVATE 1 -#endif - -#if LWIP_TIMEVAL_PRIVATE -struct timeval { - long tv_sec; /* seconds */ - long tv_usec; /* and microseconds */ -}; -#endif /* LWIP_TIMEVAL_PRIVATE */ - -#define lwip_socket_init() /* Compatibility define, no init needed. */ -void lwip_socket_thread_init(void); /* LWIP_NETCONN_SEM_PER_THREAD==1: initialize thread-local semaphore */ -void lwip_socket_thread_cleanup(void); /* LWIP_NETCONN_SEM_PER_THREAD==1: destroy thread-local semaphore */ - -#if LWIP_COMPAT_SOCKETS == 2 -/* This helps code parsers/code completion by not having the COMPAT functions as defines */ -#define lwip_accept accept -#define lwip_bind bind -#define lwip_shutdown shutdown -#define lwip_getpeername getpeername -#define lwip_getsockname getsockname -#define lwip_setsockopt setsockopt -#define lwip_getsockopt getsockopt -#define lwip_close closesocket -#define lwip_connect connect -#define lwip_listen listen -#define lwip_recv recv -#define lwip_recvfrom recvfrom -#define lwip_send send -#define lwip_sendmsg sendmsg -#define lwip_sendto sendto -#define lwip_socket socket -#define lwip_select select -#define lwip_ioctlsocket ioctl - -#if LWIP_POSIX_SOCKETS_IO_NAMES -#define lwip_read read -#define lwip_write write -#define lwip_writev writev -#undef lwip_close -#define lwip_close close -#define closesocket(s) close(s) -#define lwip_fcntl fcntl -#define lwip_ioctl ioctl -#endif /* LWIP_POSIX_SOCKETS_IO_NAMES */ -#endif /* LWIP_COMPAT_SOCKETS == 2 */ - -int lwip_accept(int s, struct sockaddr *addr, socklen_t *addrlen); -int lwip_bind(int s, const struct sockaddr *name, socklen_t namelen); -int lwip_shutdown(int s, int how); -int lwip_getpeername (int s, struct sockaddr *name, socklen_t *namelen); -int lwip_getsockname (int s, struct sockaddr *name, socklen_t *namelen); -int lwip_getsockopt (int s, int level, int optname, void *optval, socklen_t *optlen); -int lwip_setsockopt (int s, int level, int optname, const void *optval, socklen_t optlen); -int lwip_close(int s); -int lwip_connect(int s, const struct sockaddr *name, socklen_t namelen); -int lwip_listen(int s, int backlog); -int lwip_recv(int s, void *mem, size_t len, int flags); -int lwip_read(int s, void *mem, size_t len); -int lwip_recvfrom(int s, void *mem, size_t len, int flags, - struct sockaddr *from, socklen_t *fromlen); -int lwip_send(int s, const void *dataptr, size_t size, int flags); -int lwip_sendmsg(int s, const struct msghdr *message, int flags); -int lwip_sendto(int s, const void *dataptr, size_t size, int flags, - const struct sockaddr *to, socklen_t tolen); -int lwip_socket(int domain, int type, int protocol); -int lwip_write(int s, const void *dataptr, size_t size); -int lwip_writev(int s, const struct iovec *iov, int iovcnt); -int lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset, - struct timeval *timeout); -int lwip_ioctl(int s, long cmd, void *argp); -int lwip_fcntl(int s, int cmd, int val); - -#if LWIP_COMPAT_SOCKETS -#if LWIP_COMPAT_SOCKETS != 2 - -#if ESP_THREAD_SAFE - -int lwip_accept_r(int s, struct sockaddr *addr, socklen_t *addrlen); -int lwip_bind_r(int s, const struct sockaddr *name, socklen_t namelen); -int lwip_shutdown_r(int s, int how); -int lwip_getpeername_r (int s, struct sockaddr *name, socklen_t *namelen); -int lwip_getsockname_r (int s, struct sockaddr *name, socklen_t *namelen); -int lwip_getsockopt_r (int s, int level, int optname, void *optval, socklen_t *optlen); -int lwip_setsockopt_r (int s, int level, int optname, const void *optval, socklen_t optlen); -int lwip_close_r(int s); -int lwip_connect_r(int s, const struct sockaddr *name, socklen_t namelen); -int lwip_listen_r(int s, int backlog); -int lwip_recvmsg_r(int s, struct msghdr *message, int flags); -int lwip_recv_r(int s, void *mem, size_t len, int flags); -int lwip_read_r(int s, void *mem, size_t len); -int lwip_recvfrom_r(int s, void *mem, size_t len, int flags, - struct sockaddr *from, socklen_t *fromlen); -int lwip_send_r(int s, const void *dataptr, size_t size, int flags); -int lwip_sendmsg_r(int s, const struct msghdr *message, int flags); -int lwip_sendto_r(int s, const void *dataptr, size_t size, int flags, - const struct sockaddr *to, socklen_t tolen); -int lwip_socket(int domain, int type, int protocol); -int lwip_write_r(int s, const void *dataptr, size_t size); -int lwip_writev_r(int s, const struct iovec *iov, int iovcnt); -int lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset, - struct timeval *timeout); -int lwip_ioctl_r(int s, long cmd, void *argp); -int lwip_fcntl_r(int s, int cmd, int val); - -static inline int accept(int s,struct sockaddr *addr,socklen_t *addrlen) -{ return lwip_accept_r(s,addr,addrlen); } -static inline int bind(int s,const struct sockaddr *name, socklen_t namelen) -{ return lwip_bind_r(s,name,namelen); } -static inline int shutdown(int s,int how) -{ return lwip_shutdown_r(s,how); } -static inline int getpeername(int s,struct sockaddr *name,socklen_t *namelen) -{ return lwip_getpeername_r(s,name,namelen); } -static inline int getsockname(int s,struct sockaddr *name,socklen_t *namelen) -{ return lwip_getsockname_r(s,name,namelen); } -static inline int setsockopt(int s,int level,int optname,const void *opval,socklen_t optlen) -{ return lwip_setsockopt_r(s,level,optname,opval,optlen); } -static inline int getsockopt(int s,int level,int optname,void *opval,socklen_t *optlen) -{ return lwip_getsockopt_r(s,level,optname,opval,optlen); } -static inline int closesocket(int s) -{ return lwip_close_r(s); } -static inline int connect(int s,const struct sockaddr *name,socklen_t namelen) -{ return lwip_connect_r(s,name,namelen); } -static inline int listen(int s,int backlog) -{ return lwip_listen_r(s,backlog); } -static inline int recvmsg(int sockfd, struct msghdr *msg, int flags) -{ return lwip_recvmsg_r(sockfd, msg, flags); } -static inline int recv(int s,void *mem,size_t len,int flags) -{ return lwip_recv_r(s,mem,len,flags); } -static inline int recvfrom(int s,void *mem,size_t len,int flags,struct sockaddr *from,socklen_t *fromlen) -{ return lwip_recvfrom_r(s,mem,len,flags,from,fromlen); } -static inline int send(int s,const void *dataptr,size_t size,int flags) -{ return lwip_send_r(s,dataptr,size,flags); } -static inline int sendmsg(int s,const struct msghdr *message,int flags) -{ return lwip_sendmsg_r(s,message,flags); } -static inline int sendto(int s,const void *dataptr,size_t size,int flags,const struct sockaddr *to,socklen_t tolen) -{ return lwip_sendto_r(s,dataptr,size,flags,to,tolen); } -static inline int socket(int domain,int type,int protocol) -{ return lwip_socket(domain,type,protocol); } -#ifndef ESP_HAS_SELECT -static inline int select(int maxfdp1,fd_set *readset,fd_set *writeset,fd_set *exceptset,struct timeval *timeout) -{ return lwip_select(maxfdp1,readset,writeset,exceptset,timeout); } -#endif /* ESP_HAS_SELECT */ -static inline int ioctlsocket(int s,long cmd,void *argp) -{ return lwip_ioctl_r(s,cmd,argp); } - -#if LWIP_POSIX_SOCKETS_IO_NAMES -static inline int read(int s,void *mem,size_t len) -{ return lwip_read_r(s,mem,len); } -static inline int write(int s,const void *dataptr,size_t len) -{ return lwip_write_r(s,dataptr,len); } -static inline int writev(int s,const struct iovec *iov,int iovcnt) -{ return lwip_writev_r(s,iov,iovcnt); } -static inline int close(int s) -{ return lwip_close_r(s); } -static inline int fcntl(int s,int cmd,int val) -{ return lwip_fcntl_r(s,cmd,val); } -static inline int ioctl(int s,long cmd,void *argp) -{ return lwip_ioctl_r(s,cmd,argp); } -#endif /* LWIP_POSIX_SOCKETS_IO_NAMES */ - -#else - -/** @ingroup socket */ -#define accept(s,addr,addrlen) lwip_accept(s,addr,addrlen) -/** @ingroup socket */ -#define bind(s,name,namelen) lwip_bind(s,name,namelen) -/** @ingroup socket */ -#define shutdown(s,how) lwip_shutdown(s,how) -/** @ingroup socket */ -#define getpeername(s,name,namelen) lwip_getpeername(s,name,namelen) -/** @ingroup socket */ -#define getsockname(s,name,namelen) lwip_getsockname(s,name,namelen) -/** @ingroup socket */ -#define setsockopt(s,level,optname,opval,optlen) lwip_setsockopt(s,level,optname,opval,optlen) -/** @ingroup socket */ -#define getsockopt(s,level,optname,opval,optlen) lwip_getsockopt(s,level,optname,opval,optlen) -/** @ingroup socket */ -#define closesocket(s) lwip_close(s) -/** @ingroup socket */ -#define connect(s,name,namelen) lwip_connect(s,name,namelen) -/** @ingroup socket */ -#define listen(s,backlog) lwip_listen(s,backlog) -/** @ingroup socket */ -#define recv(s,mem,len,flags) lwip_recv(s,mem,len,flags) -/** @ingroup socket */ -#define recvfrom(s,mem,len,flags,from,fromlen) lwip_recvfrom(s,mem,len,flags,from,fromlen) -/** @ingroup socket */ -#define send(s,dataptr,size,flags) lwip_send(s,dataptr,size,flags) -/** @ingroup socket */ -#define sendmsg(s,message,flags) lwip_sendmsg(s,message,flags) -/** @ingroup socket */ -#define sendto(s,dataptr,size,flags,to,tolen) lwip_sendto(s,dataptr,size,flags,to,tolen) -/** @ingroup socket */ -#define socket(domain,type,protocol) lwip_socket(domain,type,protocol) -/** @ingroup socket */ -#define select(maxfdp1,readset,writeset,exceptset,timeout) lwip_select(maxfdp1,readset,writeset,exceptset,timeout) -/** @ingroup socket */ -#define ioctlsocket(s,cmd,argp) lwip_ioctl(s,cmd,argp) - -#if LWIP_POSIX_SOCKETS_IO_NAMES -/** @ingroup socket */ -#define read(s,mem,len) lwip_read(s,mem,len) -/** @ingroup socket */ -#define write(s,dataptr,len) lwip_write(s,dataptr,len) -/** @ingroup socket */ -#define writev(s,iov,iovcnt) lwip_writev(s,iov,iovcnt) -/** @ingroup socket */ -#define close(s) lwip_close(s) -/** @ingroup socket */ -#define fcntl(s,cmd,val) lwip_fcntl(s,cmd,val) -/** @ingroup socket */ -#define ioctl(s,cmd,argp) lwip_ioctl(s,cmd,argp) -#endif /* LWIP_POSIX_SOCKETS_IO_NAMES */ - -#endif /* ESP_THREAD_SAFE */ -#endif /* LWIP_COMPAT_SOCKETS != 2 */ - -#if ESP_LWIP -#if LWIP_IPV4 && LWIP_IPV6 -#define lwip_inet_ntop(af,src,dst,size) \ - (((af) == AF_INET6) ? ip6addr_ntoa_r((const ip6_addr_t*)(src),(dst),(size)) \ - : (((af) == AF_INET) ? ip4addr_ntoa_r((const ip4_addr_t*)(src),(dst),(size)) : NULL)) -#define lwip_inet_pton(af,src,dst) \ - (((af) == AF_INET6) ? ip6addr_aton((src),(ip6_addr_t*)(dst)) \ - : (((af) == AF_INET) ? ip4addr_aton((src),(ip4_addr_t*)(dst)) : 0)) -#elif LWIP_IPV4 /* LWIP_IPV4 && LWIP_IPV6 */ -#define lwip_inet_ntop(af,src,dst,size) \ - (((af) == AF_INET) ? ip4addr_ntoa_r((const ip4_addr_t*)(src),(dst),(size)) : NULL) -#define lwip_inet_pton(af,src,dst) \ - (((af) == AF_INET) ? ip4addr_aton((src),(ip4_addr_t*)(dst)) : 0) -#else /* LWIP_IPV4 && LWIP_IPV6 */ -#define lwip_inet_ntop(af,src,dst,size) \ - (((af) == AF_INET6) ? ip6addr_ntoa_r((const ip6_addr_t*)(src),(dst),(size)) : NULL) -#define lwip_inet_pton(af,src,dst) \ - (((af) == AF_INET6) ? ip6addr_aton((src),(ip6_addr_t*)(dst)) : 0) -#endif /* LWIP_IPV4 && LWIP_IPV6 */ - -#if LWIP_COMPAT_SOCKET_INET == 1 -/* Some libraries have problems with inet_... being macros, so please use this define - to declare normal functions */ -static inline const char *inet_ntop(int af, const void *src, char *dst, socklen_t size) -{ lwip_inet_ntop(af, src, dst, size); return dst; } -static inline int inet_pton(int af, const char *src, void *dst) -{ lwip_inet_pton(af, src, dst); return 1; } -#else -/* By default fall back to original inet_... macros */ -# define inet_ntop(a,b,c,d) lwip_inet_ntop(a,b,c,d) -# define inet_pton(a,b,c) lwip_inet_pton(a,b,c) -#endif /* LWIP_COMPAT_SOCKET_INET */ - -#else /* ESP_LWIP*/ - -#if LWIP_IPV4 && LWIP_IPV6 -/** @ingroup socket */ -#define inet_ntop(af,src,dst,size) \ - (((af) == AF_INET6) ? ip6addr_ntoa_r((const ip6_addr_t*)(src),(dst),(size)) \ - : (((af) == AF_INET) ? ip4addr_ntoa_r((const ip4_addr_t*)(src),(dst),(size)) : NULL)) -/** @ingroup socket */ -#define inet_pton(af,src,dst) \ - (((af) == AF_INET6) ? ip6addr_aton((src),(ip6_addr_t*)(dst)) \ - : (((af) == AF_INET) ? ip4addr_aton((src),(ip4_addr_t*)(dst)) : 0)) -#elif LWIP_IPV4 /* LWIP_IPV4 && LWIP_IPV6 */ -#define inet_ntop(af,src,dst,size) \ - (((af) == AF_INET) ? ip4addr_ntoa_r((const ip4_addr_t*)(src),(dst),(size)) : NULL) -#define inet_pton(af,src,dst) \ - (((af) == AF_INET) ? ip4addr_aton((src),(ip4_addr_t*)(dst)) : 0) -#else /* LWIP_IPV4 && LWIP_IPV6 */ -#define inet_ntop(af,src,dst,size) \ - (((af) == AF_INET6) ? ip6addr_ntoa_r((const ip6_addr_t*)(src),(dst),(size)) : NULL) -#define inet_pton(af,src,dst) \ - (((af) == AF_INET6) ? ip6addr_aton((src),(ip6_addr_t*)(dst)) : 0) -#endif /* LWIP_IPV4 && LWIP_IPV6 */ - -#endif /* ESP_LWIP */ -#endif /* LWIP_COMPAT_SOCKETS */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_SOCKET */ - -#endif /* LWIP_HDR_SOCKETS_H */ diff --git a/tools/sdk/include/lwip/lwip/stats.h b/tools/sdk/include/lwip/lwip/stats.h deleted file mode 100644 index e883383feff..00000000000 --- a/tools/sdk/include/lwip/lwip/stats.h +++ /dev/null @@ -1,530 +0,0 @@ -/** - * @file - * Statistics API (to be used from TCPIP thread) - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_STATS_H -#define LWIP_HDR_STATS_H - -#include "lwip/opt.h" - -#include "lwip/mem.h" -#include "lwip/memp.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if LWIP_STATS - -#ifndef LWIP_STATS_LARGE -#define LWIP_STATS_LARGE 0 -#endif - -#if LWIP_STATS_LARGE -#define STAT_COUNTER u32_t -#define STAT_COUNTER_F U32_F -#else -#define STAT_COUNTER u16_t -#define STAT_COUNTER_F U16_F -#endif - -/** Protocol related stats */ -struct stats_proto { - STAT_COUNTER xmit; /* Transmitted packets. */ - STAT_COUNTER recv; /* Received packets. */ - STAT_COUNTER fw; /* Forwarded packets. */ - STAT_COUNTER drop; /* Dropped packets. */ - STAT_COUNTER chkerr; /* Checksum error. */ - STAT_COUNTER lenerr; /* Invalid length error. */ - STAT_COUNTER memerr; /* Out of memory error. */ - STAT_COUNTER rterr; /* Routing error. */ - STAT_COUNTER proterr; /* Protocol error. */ - STAT_COUNTER opterr; /* Error in options. */ - STAT_COUNTER err; /* Misc error. */ - STAT_COUNTER cachehit; -}; - -/** IGMP stats */ -struct stats_igmp { - STAT_COUNTER xmit; /* Transmitted packets. */ - STAT_COUNTER recv; /* Received packets. */ - STAT_COUNTER drop; /* Dropped packets. */ - STAT_COUNTER chkerr; /* Checksum error. */ - STAT_COUNTER lenerr; /* Invalid length error. */ - STAT_COUNTER memerr; /* Out of memory error. */ - STAT_COUNTER proterr; /* Protocol error. */ - STAT_COUNTER rx_v1; /* Received v1 frames. */ - STAT_COUNTER rx_group; /* Received group-specific queries. */ - STAT_COUNTER rx_general; /* Received general queries. */ - STAT_COUNTER rx_report; /* Received reports. */ - STAT_COUNTER tx_join; /* Sent joins. */ - STAT_COUNTER tx_leave; /* Sent leaves. */ - STAT_COUNTER tx_report; /* Sent reports. */ -}; - -/** Memory stats */ -struct stats_mem { -#if defined(LWIP_DEBUG) || LWIP_STATS_DISPLAY - const char *name; -#endif /* defined(LWIP_DEBUG) || LWIP_STATS_DISPLAY */ - STAT_COUNTER err; - mem_size_t avail; - mem_size_t used; - mem_size_t max; - STAT_COUNTER illegal; -}; - -/** System element stats */ -struct stats_syselem { - STAT_COUNTER used; - STAT_COUNTER max; - STAT_COUNTER err; -}; - -/** System stats */ -struct stats_sys { - struct stats_syselem sem; - struct stats_syselem mutex; - struct stats_syselem mbox; -}; - -/** SNMP MIB2 stats */ -struct stats_mib2 { - /* IP */ - u32_t ipinhdrerrors; - u32_t ipinaddrerrors; - u32_t ipinunknownprotos; - u32_t ipindiscards; - u32_t ipindelivers; - u32_t ipoutrequests; - u32_t ipoutdiscards; - u32_t ipoutnoroutes; - u32_t ipreasmoks; - u32_t ipreasmfails; - u32_t ipfragoks; - u32_t ipfragfails; - u32_t ipfragcreates; - u32_t ipreasmreqds; - u32_t ipforwdatagrams; - u32_t ipinreceives; - - /* TCP */ - u32_t tcpactiveopens; - u32_t tcppassiveopens; - u32_t tcpattemptfails; - u32_t tcpestabresets; - u32_t tcpoutsegs; - u32_t tcpretranssegs; - u32_t tcpinsegs; - u32_t tcpinerrs; - u32_t tcpoutrsts; - - /* UDP */ - u32_t udpindatagrams; - u32_t udpnoports; - u32_t udpinerrors; - u32_t udpoutdatagrams; - - /* ICMP */ - u32_t icmpinmsgs; - u32_t icmpinerrors; - u32_t icmpindestunreachs; - u32_t icmpintimeexcds; - u32_t icmpinparmprobs; - u32_t icmpinsrcquenchs; - u32_t icmpinredirects; - u32_t icmpinechos; - u32_t icmpinechoreps; - u32_t icmpintimestamps; - u32_t icmpintimestampreps; - u32_t icmpinaddrmasks; - u32_t icmpinaddrmaskreps; - u32_t icmpoutmsgs; - u32_t icmpouterrors; - u32_t icmpoutdestunreachs; - u32_t icmpouttimeexcds; - u32_t icmpoutechos; /* can be incremented by user application ('ping') */ - u32_t icmpoutechoreps; -}; - -/** - * @ingroup netif_mib2 - * SNMP MIB2 interface stats - */ -struct stats_mib2_netif_ctrs { - /** The total number of octets received on the interface, including framing characters */ - u32_t ifinoctets; - /** The number of packets, delivered by this sub-layer to a higher (sub-)layer, which were - * not addressed to a multicast or broadcast address at this sub-layer */ - u32_t ifinucastpkts; - /** The number of packets, delivered by this sub-layer to a higher (sub-)layer, which were - * addressed to a multicast or broadcast address at this sub-layer */ - u32_t ifinnucastpkts; - /** The number of inbound packets which were chosen to be discarded even though no errors had - * been detected to prevent their being deliverable to a higher-layer protocol. One possible - * reason for discarding such a packet could be to free up buffer space */ - u32_t ifindiscards; - /** For packet-oriented interfaces, the number of inbound packets that contained errors - * preventing them from being deliverable to a higher-layer protocol. For character- - * oriented or fixed-length interfaces, the number of inbound transmission units that - * contained errors preventing them from being deliverable to a higher-layer protocol. */ - u32_t ifinerrors; - /** For packet-oriented interfaces, the number of packets received via the interface which - * were discarded because of an unknown or unsupported protocol. For character-oriented - * or fixed-length interfaces that support protocol multiplexing the number of transmission - * units received via the interface which were discarded because of an unknown or unsupported - * protocol. For any interface that does not support protocol multiplexing, this counter will - * always be 0 */ - u32_t ifinunknownprotos; - /** The total number of octets transmitted out of the interface, including framing characters. */ - u32_t ifoutoctets; - /** The total number of packets that higher-level protocols requested be transmitted, and - * which were not addressed to a multicast or broadcast address at this sub-layer, including - * those that were discarded or not sent. */ - u32_t ifoutucastpkts; - /** The total number of packets that higher-level protocols requested be transmitted, and which - * were addressed to a multicast or broadcast address at this sub-layer, including - * those that were discarded or not sent. */ - u32_t ifoutnucastpkts; - /** The number of outbound packets which were chosen to be discarded even though no errors had - * been detected to prevent their being transmitted. One possible reason for discarding - * such a packet could be to free up buffer space. */ - u32_t ifoutdiscards; - /** For packet-oriented interfaces, the number of outbound packets that could not be transmitted - * because of errors. For character-oriented or fixed-length interfaces, the number of outbound - * transmission units that could not be transmitted because of errors. */ - u32_t ifouterrors; -}; - -#if ESP_STATS_DROP -struct stats_esp { - /* mbox post fail stats */ - u32_t rx_rawmbox_post_fail; - u32_t rx_udpmbox_post_fail; - u32_t rx_tcpmbox_post_fail; - u32_t err_tcp_rxmbox_post_fail; - u32_t err_tcp_acceptmbox_post_fail; - u32_t acceptmbox_post_fail; - u32_t free_mbox_post_fail; - u32_t tcpip_inpkt_post_fail; - u32_t tcpip_cb_post_fail; - - /* memory malloc/free/failed stats */ - u32_t wlanif_input_pbuf_fail; - u32_t wlanif_outut_pbuf_fail; -}; -#endif - -/** lwIP stats container */ -struct stats_ { -#if LINK_STATS - /** Link level */ - struct stats_proto link; -#endif -#if ETHARP_STATS - /** ARP */ - struct stats_proto etharp; -#endif -#if IPFRAG_STATS - /** Fragmentation */ - struct stats_proto ip_frag; -#endif -#if IP_STATS - /** IP */ - struct stats_proto ip; -#endif -#if ICMP_STATS - /** ICMP */ - struct stats_proto icmp; -#endif -#if IGMP_STATS - /** IGMP */ - struct stats_igmp igmp; -#endif -#if UDP_STATS - /** UDP */ - struct stats_proto udp; -#endif -#if TCP_STATS - /** TCP */ - struct stats_proto tcp; -#endif -#if MEM_STATS - /** Heap */ - struct stats_mem mem; -#endif -#if MEMP_STATS - /** Internal memory pools */ - struct stats_mem *memp[MEMP_MAX]; -#endif -#if SYS_STATS - /** System */ - struct stats_sys sys; -#endif -#if IP6_STATS - /** IPv6 */ - struct stats_proto ip6; -#endif -#if ICMP6_STATS - /** ICMP6 */ - struct stats_proto icmp6; -#endif -#if IP6_FRAG_STATS - /** IPv6 fragmentation */ - struct stats_proto ip6_frag; -#endif -#if MLD6_STATS - /** Multicast listener discovery */ - struct stats_igmp mld6; -#endif -#if ND6_STATS - /** Neighbor discovery */ - struct stats_proto nd6; -#endif -#if MIB2_STATS - /** SNMP MIB2 */ - struct stats_mib2 mib2; -#endif - -#if ESP_STATS_DROP - struct stats_esp esp; -#endif -}; - -/** Global variable containing lwIP internal statistics. Add this to your debugger's watchlist. */ -extern struct stats_ lwip_stats; - -/** Init statistics */ -void stats_init(void); - -#define STATS_INC(x) ++lwip_stats.x -#define STATS_DEC(x) --lwip_stats.x -#define STATS_INC_USED(x, y) do { lwip_stats.x.used += y; \ - if (lwip_stats.x.max < lwip_stats.x.used) { \ - lwip_stats.x.max = lwip_stats.x.used; \ - } \ - } while(0) -#define STATS_GET(x) lwip_stats.x -#else /* LWIP_STATS */ -#define stats_init() -#define STATS_INC(x) -#define STATS_DEC(x) -#define STATS_INC_USED(x) -#endif /* LWIP_STATS */ - -#if TCP_STATS -#define TCP_STATS_INC(x) STATS_INC(x) -#define TCP_STATS_DISPLAY() stats_display_proto(&lwip_stats.tcp, "TCP") -#else -#define TCP_STATS_INC(x) -#define TCP_STATS_DISPLAY() -#endif - -#if UDP_STATS -#define UDP_STATS_INC(x) STATS_INC(x) -#define UDP_STATS_DISPLAY() stats_display_proto(&lwip_stats.udp, "UDP") -#else -#define UDP_STATS_INC(x) -#define UDP_STATS_DISPLAY() -#endif - -#if ICMP_STATS -#define ICMP_STATS_INC(x) STATS_INC(x) -#define ICMP_STATS_DISPLAY() stats_display_proto(&lwip_stats.icmp, "ICMP") -#else -#define ICMP_STATS_INC(x) -#define ICMP_STATS_DISPLAY() -#endif - -#if IGMP_STATS -#define IGMP_STATS_INC(x) STATS_INC(x) -#define IGMP_STATS_DISPLAY() stats_display_igmp(&lwip_stats.igmp, "IGMP") -#else -#define IGMP_STATS_INC(x) -#define IGMP_STATS_DISPLAY() -#endif - -#if IP_STATS -#define IP_STATS_INC(x) STATS_INC(x) -#define IP_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip, "IP") -#else -#define IP_STATS_INC(x) -#define IP_STATS_DISPLAY() -#endif - -#if IPFRAG_STATS -#define IPFRAG_STATS_INC(x) STATS_INC(x) -#define IPFRAG_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip_frag, "IP_FRAG") -#else -#define IPFRAG_STATS_INC(x) -#define IPFRAG_STATS_DISPLAY() -#endif - -#if ETHARP_STATS -#define ETHARP_STATS_INC(x) STATS_INC(x) -#define ETHARP_STATS_DISPLAY() stats_display_proto(&lwip_stats.etharp, "ETHARP") -#else -#define ETHARP_STATS_INC(x) -#define ETHARP_STATS_DISPLAY() -#endif - -#if LINK_STATS -#define LINK_STATS_INC(x) STATS_INC(x) -#define LINK_STATS_DISPLAY() stats_display_proto(&lwip_stats.link, "LINK") -#else -#define LINK_STATS_INC(x) -#define LINK_STATS_DISPLAY() -#endif - -#if MEM_STATS -#define MEM_STATS_AVAIL(x, y) lwip_stats.mem.x = y -#define MEM_STATS_INC(x) SYS_ARCH_INC(lwip_stats.mem.x, 1) -#define MEM_STATS_INC_USED(x, y) SYS_ARCH_INC(lwip_stats.mem.x, y) -#define MEM_STATS_DEC_USED(x, y) SYS_ARCH_DEC(lwip_stats.mem.x, y) -#define MEM_STATS_DISPLAY() stats_display_mem(&lwip_stats.mem, "HEAP") -#else -#define MEM_STATS_AVAIL(x, y) -#define MEM_STATS_INC(x) -#define MEM_STATS_INC_USED(x, y) -#define MEM_STATS_DEC_USED(x, y) -#define MEM_STATS_DISPLAY() -#endif - - #if MEMP_STATS -#define MEMP_STATS_DEC(x, i) STATS_DEC(memp[i]->x) -#define MEMP_STATS_DISPLAY(i) stats_display_memp(lwip_stats.memp[i], i) -#define MEMP_STATS_GET(x, i) STATS_GET(memp[i]->x) - #else -#define MEMP_STATS_DEC(x, i) -#define MEMP_STATS_DISPLAY(i) -#define MEMP_STATS_GET(x, i) 0 -#endif - -#if SYS_STATS -#define SYS_STATS_INC(x) STATS_INC(sys.x) -#define SYS_STATS_DEC(x) STATS_DEC(sys.x) -#define SYS_STATS_INC_USED(x) STATS_INC_USED(sys.x, 1) -#define SYS_STATS_DISPLAY() stats_display_sys(&lwip_stats.sys) -#else -#define SYS_STATS_INC(x) -#define SYS_STATS_DEC(x) -#define SYS_STATS_INC_USED(x) -#define SYS_STATS_DISPLAY() -#endif - -#if IP6_STATS -#define IP6_STATS_INC(x) STATS_INC(x) -#define IP6_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip6, "IPv6") -#else -#define IP6_STATS_INC(x) -#define IP6_STATS_DISPLAY() -#endif - -#if ICMP6_STATS -#define ICMP6_STATS_INC(x) STATS_INC(x) -#define ICMP6_STATS_DISPLAY() stats_display_proto(&lwip_stats.icmp6, "ICMPv6") -#else -#define ICMP6_STATS_INC(x) -#define ICMP6_STATS_DISPLAY() -#endif - -#if IP6_FRAG_STATS -#define IP6_FRAG_STATS_INC(x) STATS_INC(x) -#define IP6_FRAG_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip6_frag, "IPv6 FRAG") -#else -#define IP6_FRAG_STATS_INC(x) -#define IP6_FRAG_STATS_DISPLAY() -#endif - -#if MLD6_STATS -#define MLD6_STATS_INC(x) STATS_INC(x) -#define MLD6_STATS_DISPLAY() stats_display_igmp(&lwip_stats.mld6, "MLDv1") -#else -#define MLD6_STATS_INC(x) -#define MLD6_STATS_DISPLAY() -#endif - -#if ND6_STATS -#define ND6_STATS_INC(x) STATS_INC(x) -#define ND6_STATS_DISPLAY() stats_display_proto(&lwip_stats.nd6, "ND") -#else -#define ND6_STATS_INC(x) -#define ND6_STATS_DISPLAY() -#endif - -#if MIB2_STATS -#define MIB2_STATS_INC(x) STATS_INC(x) -#else -#define MIB2_STATS_INC(x) -#endif - -#if ESP_STATS_DROP -#define ESP_STATS_DROP_INC(x) STATS_INC(x) -#define ESP_STATS_DROP_DISPLAY() stats_display_esp(&lwip_stats.esp); -#else -#define ESP_STATS_DROP_INC(x) -#define ESP_STATS_DROP_DISPLAY() -#endif - -/* Display of statistics */ -#if LWIP_STATS_DISPLAY -void stats_display(void); -void stats_display_proto(struct stats_proto *proto, const char *name); -void stats_display_igmp(struct stats_igmp *igmp, const char *name); -void stats_display_mem(struct stats_mem *mem, const char *name); -void stats_display_memp(struct stats_mem *mem, int index); -void stats_display_sys(struct stats_sys *sys); -#if ESP_STATS_DROP -void stats_display_esp(struct stats_esp *esp); -#endif - -#else /* LWIP_STATS_DISPLAY */ -#define stats_display() -#define stats_display_proto(proto, name) -#define stats_display_igmp(igmp, name) -#define stats_display_mem(mem, name) -#define stats_display_memp(mem, index) -#define stats_display_sys(sys) -#if ESP_STATS_DROP -#define stats_display_esp(esp) -#endif - -#endif /* LWIP_STATS_DISPLAY */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_STATS_H */ diff --git a/tools/sdk/include/lwip/lwip/sys.h b/tools/sdk/include/lwip/lwip/sys.h deleted file mode 100644 index 695cae49dca..00000000000 --- a/tools/sdk/include/lwip/lwip/sys.h +++ /dev/null @@ -1,474 +0,0 @@ -/** - * @file - * OS abstraction layer - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - */ - -#ifndef LWIP_HDR_SYS_H -#define LWIP_HDR_SYS_H - -#include "lwip/opt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if NO_SYS - -/* For a totally minimal and standalone system, we provide null - definitions of the sys_ functions. */ -typedef u8_t sys_sem_t; -typedef u8_t sys_mutex_t; -typedef u8_t sys_mbox_t; - -#define sys_sem_new(s, c) ERR_OK -#define sys_sem_signal(s) -#define sys_sem_wait(s) -#define sys_arch_sem_wait(s,t) -#define sys_sem_free(s) -#define sys_sem_valid(s) 0 -#define sys_sem_valid_val(s) 0 -#define sys_sem_set_invalid(s) -#define sys_sem_set_invalid_val(s) -#define sys_mutex_new(mu) ERR_OK -#define sys_mutex_lock(mu) -#define sys_mutex_unlock(mu) -#define sys_mutex_free(mu) -#define sys_mutex_valid(mu) 0 -#define sys_mutex_set_invalid(mu) -#define sys_mbox_new(m, s) ERR_OK -#define sys_mbox_fetch(m,d) -#define sys_mbox_tryfetch(m,d) -#define sys_mbox_post(m,d) -#define sys_mbox_trypost(m,d) -#define sys_mbox_free(m) -#define sys_mbox_valid(m) -#define sys_mbox_valid_val(m) -#define sys_mbox_set_invalid(m) -#define sys_mbox_set_invalid_val(m) - -#define sys_thread_new(n,t,a,s,p) - -#define sys_msleep(t) - -#else /* NO_SYS */ - -/** Return code for timeouts from sys_arch_mbox_fetch and sys_arch_sem_wait */ -#define SYS_ARCH_TIMEOUT 0xffffffffUL - -/** sys_mbox_tryfetch() returns SYS_MBOX_EMPTY if appropriate. - * For now we use the same magic value, but we allow this to change in future. - */ -#define SYS_MBOX_EMPTY SYS_ARCH_TIMEOUT - -#include "lwip/err.h" -#include "arch/sys_arch.h" - -/** Function prototype for thread functions */ -typedef void (*lwip_thread_fn)(void *arg); - -/* Function prototypes for functions to be implemented by platform ports - (in sys_arch.c) */ - -/* Mutex functions: */ - -/** Define LWIP_COMPAT_MUTEX if the port has no mutexes and binary semaphores - should be used instead */ -#ifndef LWIP_COMPAT_MUTEX -#define LWIP_COMPAT_MUTEX 0 -#endif - -#if LWIP_COMPAT_MUTEX -/* for old ports that don't have mutexes: define them to binary semaphores */ -#define sys_mutex_t sys_sem_t -#define sys_mutex_new(mutex) sys_sem_new(mutex, 1) -#define sys_mutex_lock(mutex) sys_sem_wait(mutex) -#define sys_mutex_unlock(mutex) sys_sem_signal(mutex) -#define sys_mutex_free(mutex) sys_sem_free(mutex) -#define sys_mutex_valid(mutex) sys_sem_valid(mutex) -#define sys_mutex_set_invalid(mutex) sys_sem_set_invalid(mutex) - -#else /* LWIP_COMPAT_MUTEX */ - -/** - * @ingroup sys_mutex - * Create a new mutex. - * Note that mutexes are expected to not be taken recursively by the lwIP code, - * so both implementation types (recursive or non-recursive) should work. - * @param mutex pointer to the mutex to create - * @return ERR_OK if successful, another err_t otherwise - */ -err_t sys_mutex_new(sys_mutex_t *mutex); -/** - * @ingroup sys_mutex - * Lock a mutex - * @param mutex the mutex to lock - */ -void sys_mutex_lock(sys_mutex_t *mutex); -/** - * @ingroup sys_mutex - * Unlock a mutex - * @param mutex the mutex to unlock - */ -void sys_mutex_unlock(sys_mutex_t *mutex); -/** - * @ingroup sys_mutex - * Delete a semaphore - * @param mutex the mutex to delete - */ -void sys_mutex_free(sys_mutex_t *mutex); -#ifndef sys_mutex_valid -/** - * @ingroup sys_mutex - * Check if a mutex is valid/allocated: return 1 for valid, 0 for invalid - */ -int sys_mutex_valid(sys_mutex_t *mutex); -#endif -#ifndef sys_mutex_set_invalid -/** - * @ingroup sys_mutex - * Set a mutex invalid so that sys_mutex_valid returns 0 - */ -void sys_mutex_set_invalid(sys_mutex_t *mutex); -#endif -#endif /* LWIP_COMPAT_MUTEX */ - -/* Semaphore functions: */ - -/** - * @ingroup sys_sem - * Create a new semaphore - * @param sem pointer to the semaphore to create - * @param count initial count of the semaphore - * @return ERR_OK if successful, another err_t otherwise - */ -err_t sys_sem_new(sys_sem_t *sem, u8_t count); -/** - * @ingroup sys_sem - * Signals a semaphore - * @param sem the semaphore to signal - */ -void sys_sem_signal(sys_sem_t *sem); - -#if ESP_LWIP -/** Signals a semaphore (ISR version) - * @param sem the semaphore to signal - * @return non-zero if a higher priority task has been woken */ -int sys_sem_signal_isr(sys_sem_t *sem); -#endif - -/** - * @ingroup sys_sem - * Wait for a semaphore for the specified timeout - * @param sem the semaphore to wait for - * @param timeout timeout in milliseconds to wait (0 = wait forever) - * @return time (in milliseconds) waited for the semaphore - * or SYS_ARCH_TIMEOUT on timeout - */ -u32_t sys_arch_sem_wait(sys_sem_t *sem, u32_t timeout); -/** - * @ingroup sys_sem - * Delete a semaphore - * @param sem semaphore to delete - */ -void sys_sem_free(sys_sem_t *sem); -/** Wait for a semaphore - forever/no timeout */ -#define sys_sem_wait(sem) sys_arch_sem_wait(sem, 0) -#ifndef sys_sem_valid -/** - * @ingroup sys_sem - * Check if a semaphore is valid/allocated: return 1 for valid, 0 for invalid - */ -int sys_sem_valid(sys_sem_t *sem); -#endif -#ifndef sys_sem_set_invalid -/** - * @ingroup sys_sem - * Set a semaphore invalid so that sys_sem_valid returns 0 - */ -void sys_sem_set_invalid(sys_sem_t *sem); -#endif -#ifndef sys_sem_valid_val -/** - * Same as sys_sem_valid() but taking a value, not a pointer - */ -#define sys_sem_valid_val(sem) sys_sem_valid(&(sem)) -#endif -#ifndef sys_sem_set_invalid_val -/** - * Same as sys_sem_set_invalid() but taking a value, not a pointer - */ -#define sys_sem_set_invalid_val(sem) sys_sem_set_invalid(&(sem)) -#endif - -#ifndef sys_msleep -/** - * @ingroup sys_misc - * Sleep for specified number of ms - */ -void sys_msleep(u32_t ms); /* only has a (close to) 1 ms resolution. */ -#endif - -/* Mailbox functions. */ - -/** - * @ingroup sys_mbox - * Create a new mbox of specified size - * @param mbox pointer to the mbox to create - * @param size (minimum) number of messages in this mbox - * @return ERR_OK if successful, another err_t otherwise - */ -err_t sys_mbox_new(sys_mbox_t *mbox, int size); -/** - * @ingroup sys_mbox - * Post a message to an mbox - may not fail - * -> blocks if full, only used from tasks not from ISR - * @param mbox mbox to posts the message - * @param msg message to post (ATTENTION: can be NULL) - */ -void sys_mbox_post(sys_mbox_t *mbox, void *msg); -/** - * @ingroup sys_mbox - * Try to post a message to an mbox - may fail if full or ISR - * @param mbox mbox to posts the message - * @param msg message to post (ATTENTION: can be NULL) - */ -err_t sys_mbox_trypost(sys_mbox_t *mbox, void *msg); -/** - * @ingroup sys_mbox - * Wait for a new message to arrive in the mbox - * @param mbox mbox to get a message from - * @param msg pointer where the message is stored - * @param timeout maximum time (in milliseconds) to wait for a message (0 = wait forever) - * @return time (in milliseconds) waited for a message, may be 0 if not waited - or SYS_ARCH_TIMEOUT on timeout - * The returned time has to be accurate to prevent timer jitter! - */ -u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout); - -#if ESP_THREAD_SAFE -/** - * @ingroup sys_mbox - * Set the owner of the mbox - * @param mbox mbox to set the owner - * @param owner the owner of the mbox, it's a pointer to struct netconn - */ -void sys_mbox_set_owner(sys_mbox_t *mbox, void *owner); -#endif - -/* Allow port to override with a macro, e.g. special timeout for sys_arch_mbox_fetch() */ -#ifndef sys_arch_mbox_tryfetch -/** - * @ingroup sys_mbox - * Wait for a new message to arrive in the mbox - * @param mbox mbox to get a message from - * @param msg pointer where the message is stored - * @return 0 (milliseconds) if a message has been received - * or SYS_MBOX_EMPTY if the mailbox is empty - */ -u32_t sys_arch_mbox_tryfetch(sys_mbox_t *mbox, void **msg); -#endif -/** - * For now, we map straight to sys_arch implementation. - */ -#define sys_mbox_tryfetch(mbox, msg) sys_arch_mbox_tryfetch(mbox, msg) -/** - * @ingroup sys_mbox - * Delete an mbox - * @param mbox mbox to delete - */ -void sys_mbox_free(sys_mbox_t *mbox); -#define sys_mbox_fetch(mbox, msg) sys_arch_mbox_fetch(mbox, msg, 0) -#ifndef sys_mbox_valid -/** - * @ingroup sys_mbox - * Check if an mbox is valid/allocated: return 1 for valid, 0 for invalid - */ -int sys_mbox_valid(sys_mbox_t *mbox); -#endif -#ifndef sys_mbox_set_invalid -/** - * @ingroup sys_mbox - * Set an mbox invalid so that sys_mbox_valid returns 0 - */ -void sys_mbox_set_invalid(sys_mbox_t *mbox); -#endif -#ifndef sys_mbox_valid_val -/** - * Same as sys_mbox_valid() but taking a value, not a pointer - */ -#define sys_mbox_valid_val(mbox) sys_mbox_valid(&(mbox)) -#endif -#ifndef sys_mbox_set_invalid_val -/** - * Same as sys_mbox_set_invalid() but taking a value, not a pointer - */ -#define sys_mbox_set_invalid_val(mbox) sys_mbox_set_invalid(&(mbox)) -#endif - - -/** - * @ingroup sys_misc - * The only thread function: - * Creates a new thread - * ATTENTION: although this function returns a value, it MUST NOT FAIL (ports have to assert this!) - * @param name human-readable name for the thread (used for debugging purposes) - * @param thread thread-function - * @param arg parameter passed to 'thread' - * @param stacksize stack size in bytes for the new thread (may be ignored by ports) - * @param prio priority of the new thread (may be ignored by ports) */ -sys_thread_t sys_thread_new(const char *name, lwip_thread_fn thread, void *arg, int stacksize, int prio); - -#endif /* NO_SYS */ - -/* sys_init() must be called before anything else. */ -void sys_init(void); - -#ifndef sys_jiffies -/** - * Ticks/jiffies since power up. - */ -u32_t sys_jiffies(void); -#endif - -/** - * @ingroup sys_time - * Returns the current time in milliseconds, - * may be the same as sys_jiffies or at least based on it. - */ -u32_t sys_now(void); - -/* Critical Region Protection */ -/* These functions must be implemented in the sys_arch.c file. - In some implementations they can provide a more light-weight protection - mechanism than using semaphores. Otherwise semaphores can be used for - implementation */ -#ifndef SYS_ARCH_PROTECT -/** SYS_LIGHTWEIGHT_PROT - * define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection - * for certain critical regions during buffer allocation, deallocation and memory - * allocation and deallocation. - */ -#if SYS_LIGHTWEIGHT_PROT - -/** - * @ingroup sys_prot - * SYS_ARCH_DECL_PROTECT - * declare a protection variable. This macro will default to defining a variable of - * type sys_prot_t. If a particular port needs a different implementation, then - * this macro may be defined in sys_arch.h. - */ -#define SYS_ARCH_DECL_PROTECT(lev) sys_prot_t lev -/** - * @ingroup sys_prot - * SYS_ARCH_PROTECT - * Perform a "fast" protect. This could be implemented by - * disabling interrupts for an embedded system or by using a semaphore or - * mutex. The implementation should allow calling SYS_ARCH_PROTECT when - * already protected. The old protection level is returned in the variable - * "lev". This macro will default to calling the sys_arch_protect() function - * which should be implemented in sys_arch.c. If a particular port needs a - * different implementation, then this macro may be defined in sys_arch.h - */ -#define SYS_ARCH_PROTECT(lev) lev = sys_arch_protect() -/** - * @ingroup sys_prot - * SYS_ARCH_UNPROTECT - * Perform a "fast" set of the protection level to "lev". This could be - * implemented by setting the interrupt level to "lev" within the MACRO or by - * using a semaphore or mutex. This macro will default to calling the - * sys_arch_unprotect() function which should be implemented in - * sys_arch.c. If a particular port needs a different implementation, then - * this macro may be defined in sys_arch.h - */ -#define SYS_ARCH_UNPROTECT(lev) sys_arch_unprotect(lev) -sys_prot_t sys_arch_protect(void); -void sys_arch_unprotect(sys_prot_t pval); - -#else - -#define SYS_ARCH_DECL_PROTECT(lev) -#define SYS_ARCH_PROTECT(lev) -#define SYS_ARCH_UNPROTECT(lev) - -#endif /* SYS_LIGHTWEIGHT_PROT */ - -#endif /* SYS_ARCH_PROTECT */ - -/* - * Macros to set/get and increase/decrease variables in a thread-safe way. - * Use these for accessing variable that are used from more than one thread. - */ - -#ifndef SYS_ARCH_INC -#define SYS_ARCH_INC(var, val) do { \ - SYS_ARCH_DECL_PROTECT(old_level); \ - SYS_ARCH_PROTECT(old_level); \ - var += val; \ - SYS_ARCH_UNPROTECT(old_level); \ - } while(0) -#endif /* SYS_ARCH_INC */ - -#ifndef SYS_ARCH_DEC -#define SYS_ARCH_DEC(var, val) do { \ - SYS_ARCH_DECL_PROTECT(old_level); \ - SYS_ARCH_PROTECT(old_level); \ - var -= val; \ - SYS_ARCH_UNPROTECT(old_level); \ - } while(0) -#endif /* SYS_ARCH_DEC */ - -#ifndef SYS_ARCH_GET -#define SYS_ARCH_GET(var, ret) do { \ - SYS_ARCH_DECL_PROTECT(old_level); \ - SYS_ARCH_PROTECT(old_level); \ - ret = var; \ - SYS_ARCH_UNPROTECT(old_level); \ - } while(0) -#endif /* SYS_ARCH_GET */ - -#ifndef SYS_ARCH_SET -#define SYS_ARCH_SET(var, val) do { \ - SYS_ARCH_DECL_PROTECT(old_level); \ - SYS_ARCH_PROTECT(old_level); \ - var = val; \ - SYS_ARCH_UNPROTECT(old_level); \ - } while(0) -#endif /* SYS_ARCH_SET */ - - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_SYS_H */ diff --git a/tools/sdk/include/lwip/lwip/tcp.h b/tools/sdk/include/lwip/lwip/tcp.h deleted file mode 100644 index 30dbf147608..00000000000 --- a/tools/sdk/include/lwip/lwip/tcp.h +++ /dev/null @@ -1,454 +0,0 @@ -/** - * @file - * TCP API (to be used from TCPIP thread)\n - * See also @ref tcp_raw - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_TCP_H -#define LWIP_HDR_TCP_H - -#include "lwip/opt.h" - -#if LWIP_TCP /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/mem.h" -#include "lwip/pbuf.h" -#include "lwip/ip.h" -#include "lwip/icmp.h" -#include "lwip/err.h" -#include "lwip/ip6.h" -#include "lwip/ip6_addr.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct tcp_pcb; - -/** Function prototype for tcp accept callback functions. Called when a new - * connection can be accepted on a listening pcb. - * - * @param arg Additional argument to pass to the callback function (@see tcp_arg()) - * @param newpcb The new connection pcb - * @param err An error code if there has been an error accepting. - * Only return ERR_ABRT if you have called tcp_abort from within the - * callback function! - */ -typedef err_t (*tcp_accept_fn)(void *arg, struct tcp_pcb *newpcb, err_t err); - -/** Function prototype for tcp receive callback functions. Called when data has - * been received. - * - * @param arg Additional argument to pass to the callback function (@see tcp_arg()) - * @param tpcb The connection pcb which received data - * @param p The received data (or NULL when the connection has been closed!) - * @param err An error code if there has been an error receiving - * Only return ERR_ABRT if you have called tcp_abort from within the - * callback function! - */ -typedef err_t (*tcp_recv_fn)(void *arg, struct tcp_pcb *tpcb, - struct pbuf *p, err_t err); - -/** Function prototype for tcp sent callback functions. Called when sent data has - * been acknowledged by the remote side. Use it to free corresponding resources. - * This also means that the pcb has now space available to send new data. - * - * @param arg Additional argument to pass to the callback function (@see tcp_arg()) - * @param tpcb The connection pcb for which data has been acknowledged - * @param len The amount of bytes acknowledged - * @return ERR_OK: try to send some data by calling tcp_output - * Only return ERR_ABRT if you have called tcp_abort from within the - * callback function! - */ -typedef err_t (*tcp_sent_fn)(void *arg, struct tcp_pcb *tpcb, - u16_t len); - -/** Function prototype for tcp poll callback functions. Called periodically as - * specified by @see tcp_poll. - * - * @param arg Additional argument to pass to the callback function (@see tcp_arg()) - * @param tpcb tcp pcb - * @return ERR_OK: try to send some data by calling tcp_output - * Only return ERR_ABRT if you have called tcp_abort from within the - * callback function! - */ -typedef err_t (*tcp_poll_fn)(void *arg, struct tcp_pcb *tpcb); - -/** Function prototype for tcp error callback functions. Called when the pcb - * receives a RST or is unexpectedly closed for any other reason. - * - * @note The corresponding pcb is already freed when this callback is called! - * - * @param arg Additional argument to pass to the callback function (@see tcp_arg()) - * @param err Error code to indicate why the pcb has been closed - * ERR_ABRT: aborted through tcp_abort or by a TCP timer - * ERR_RST: the connection was reset by the remote host - */ -typedef void (*tcp_err_fn)(void *arg, err_t err); - -/** Function prototype for tcp connected callback functions. Called when a pcb - * is connected to the remote side after initiating a connection attempt by - * calling tcp_connect(). - * - * @param arg Additional argument to pass to the callback function (@see tcp_arg()) - * @param tpcb The connection pcb which is connected - * @param err An unused error code, always ERR_OK currently ;-) @todo! - * Only return ERR_ABRT if you have called tcp_abort from within the - * callback function! - * - * @note When a connection attempt fails, the error callback is currently called! - */ -typedef err_t (*tcp_connected_fn)(void *arg, struct tcp_pcb *tpcb, err_t err); - -#if LWIP_WND_SCALE -#define RCV_WND_SCALE(pcb, wnd) (((wnd) >> (pcb)->rcv_scale)) -#define SND_WND_SCALE(pcb, wnd) (((wnd) << (pcb)->snd_scale)) -#define TCPWND16(x) ((u16_t)LWIP_MIN((x), 0xFFFF)) -#define TCP_WND_MAX(pcb) ((tcpwnd_size_t)(((pcb)->flags & TF_WND_SCALE) ? TCP_WND : TCPWND16(TCP_WND))) -typedef u32_t tcpwnd_size_t; -#else -#define RCV_WND_SCALE(pcb, wnd) (wnd) -#define SND_WND_SCALE(pcb, wnd) (wnd) -#define TCPWND16(x) (x) -#define TCP_WND_MAX(pcb) TCP_WND -typedef u16_t tcpwnd_size_t; -#endif - -#if LWIP_WND_SCALE || TCP_LISTEN_BACKLOG || LWIP_TCP_TIMESTAMPS -typedef u16_t tcpflags_t; -#else -typedef u8_t tcpflags_t; -#endif - -enum tcp_state { - CLOSED = 0, - LISTEN = 1, - SYN_SENT = 2, - SYN_RCVD = 3, - ESTABLISHED = 4, - FIN_WAIT_1 = 5, - FIN_WAIT_2 = 6, - CLOSE_WAIT = 7, - CLOSING = 8, - LAST_ACK = 9, - TIME_WAIT = 10 -}; - -/** - * members common to struct tcp_pcb and struct tcp_listen_pcb - */ -#define TCP_PCB_COMMON(type) \ - type *next; /* for the linked list */ \ - void *callback_arg; \ - enum tcp_state state; /* TCP state */ \ - u8_t prio; \ - /* ports are in host byte order */ \ - u16_t local_port - - -/** the TCP protocol control block for listening pcbs */ -struct tcp_pcb_listen { -/** Common members of all PCB types */ - IP_PCB; -/** Protocol specific PCB members */ - TCP_PCB_COMMON(struct tcp_pcb_listen); - -#if LWIP_CALLBACK_API - /* Function to call when a listener has been connected. */ - tcp_accept_fn accept; -#endif /* LWIP_CALLBACK_API */ - -#if TCP_LISTEN_BACKLOG - u8_t backlog; - u8_t accepts_pending; -#endif /* TCP_LISTEN_BACKLOG */ -}; - - -/** the TCP protocol control block */ -struct tcp_pcb { -/** common PCB members */ - IP_PCB; -/** protocol specific PCB members */ - TCP_PCB_COMMON(struct tcp_pcb); - - /* ports are in host byte order */ - u16_t remote_port; - - tcpflags_t flags; -#define TF_ACK_DELAY 0x01U /* Delayed ACK. */ -#define TF_ACK_NOW 0x02U /* Immediate ACK. */ -#define TF_INFR 0x04U /* In fast recovery. */ -#define TF_CLOSEPEND 0x08U /* If this is set, tcp_close failed to enqueue the FIN (retried in tcp_tmr) */ -#define TF_RXCLOSED 0x10U /* rx closed by tcp_shutdown */ -#define TF_FIN 0x20U /* Connection was closed locally (FIN segment enqueued). */ -#define TF_NODELAY 0x40U /* Disable Nagle algorithm */ -#define TF_NAGLEMEMERR 0x80U /* nagle enabled, memerr, try to output to prevent delayed ACK to happen */ -#if LWIP_WND_SCALE -#define TF_WND_SCALE 0x0100U /* Window Scale option enabled */ -#endif -#if TCP_LISTEN_BACKLOG -#define TF_BACKLOGPEND 0x0200U /* If this is set, a connection pcb has increased the backlog on its listener */ -#endif -#if LWIP_TCP_TIMESTAMPS -#define TF_TIMESTAMP 0x0400U /* Timestamp option enabled */ -#endif - - /* the rest of the fields are in host byte order - as we have to do some math with them */ - - /* Timers */ - u8_t polltmr, pollinterval; - u8_t last_timer; - u32_t tmr; - - /* receiver variables */ - u32_t rcv_nxt; /* next seqno expected */ - tcpwnd_size_t rcv_wnd; /* receiver window available */ - tcpwnd_size_t rcv_ann_wnd; /* receiver window to announce */ - u32_t rcv_ann_right_edge; /* announced right edge of window */ - - /* Retransmission timer. */ - s16_t rtime; - - u16_t mss; /* maximum segment size */ - - /* RTT (round trip time) estimation variables */ - u32_t rttest; /* RTT estimate in 500ms ticks */ - u32_t rtseq; /* sequence number being timed */ - s16_t sa, sv; /* @todo document this */ - - s16_t rto; /* retransmission time-out */ - u8_t nrtx; /* number of retransmissions */ - - /* fast retransmit/recovery */ - u8_t dupacks; - u32_t lastack; /* Highest acknowledged seqno. */ - - /* congestion avoidance/control variables */ - tcpwnd_size_t cwnd; - tcpwnd_size_t ssthresh; - - /* sender variables */ - u32_t snd_nxt; /* next new seqno to be sent */ - u32_t snd_wl1, snd_wl2; /* Sequence and acknowledgement numbers of last - window update. */ - u32_t snd_lbb; /* Sequence number of next byte to be buffered. */ - tcpwnd_size_t snd_wnd; /* sender window */ - tcpwnd_size_t snd_wnd_max; /* the maximum sender window announced by the remote host */ - - tcpwnd_size_t snd_buf; /* Available buffer space for sending (in bytes). */ -#define TCP_SNDQUEUELEN_OVERFLOW (0xffffU-3) - u16_t snd_queuelen; /* Number of pbufs currently in the send buffer. */ - -#if TCP_OVERSIZE - /* Extra bytes available at the end of the last pbuf in unsent. */ - u16_t unsent_oversize; -#endif /* TCP_OVERSIZE */ - - /* These are ordered by sequence number: */ - struct tcp_seg *unsent; /* Unsent (queued) segments. */ - struct tcp_seg *unacked; /* Sent but unacknowledged segments. */ -#if TCP_QUEUE_OOSEQ - struct tcp_seg *ooseq; /* Received out of sequence segments. */ -#endif /* TCP_QUEUE_OOSEQ */ - - struct pbuf *refused_data; /* Data previously received but not yet taken by upper layer */ - -#if LWIP_CALLBACK_API || TCP_LISTEN_BACKLOG - struct tcp_pcb_listen* listener; -#endif /* LWIP_CALLBACK_API || TCP_LISTEN_BACKLOG */ - -#if LWIP_CALLBACK_API - /* Function to be called when more send buffer space is available. */ - tcp_sent_fn sent; - /* Function to be called when (in-sequence) data has arrived. */ - tcp_recv_fn recv; - /* Function to be called when a connection has been set up. */ - tcp_connected_fn connected; - /* Function which is called periodically. */ - tcp_poll_fn poll; - /* Function to be called whenever a fatal error occurs. */ - tcp_err_fn errf; -#endif /* LWIP_CALLBACK_API */ - -#if LWIP_TCP_TIMESTAMPS - u32_t ts_lastacksent; - u32_t ts_recent; -#endif /* LWIP_TCP_TIMESTAMPS */ - - /* idle time before KEEPALIVE is sent */ - u32_t keep_idle; -#if LWIP_TCP_KEEPALIVE - u32_t keep_intvl; - u32_t keep_cnt; -#endif /* LWIP_TCP_KEEPALIVE */ - - /* Persist timer counter */ - u8_t persist_cnt; - /* Persist timer back-off */ - u8_t persist_backoff; - - /* KEEPALIVE counter */ - u8_t keep_cnt_sent; - -#if LWIP_WND_SCALE - u8_t snd_scale; - u8_t rcv_scale; -#endif - -#if ESP_STATS_TCP -#define ESP_STATS_TCP_ARRAY_SIZE 20 - u16_t retry_cnt[TCP_MAXRTX]; - u16_t rto_cnt[ESP_STATS_TCP_ARRAY_SIZE]; -#endif -}; - -#if ESP_STATS_TCP -#define ESP_STATS_TCP_PCB(_pcb) do {\ - if ((_pcb)->unacked) {\ - (_pcb)->retry_cnt[(_pcb)->nrtx]++;\ - if ((_pcb)->rto < ESP_STATS_TCP_ARRAY_SIZE) {\ - (_pcb)->rto_cnt[(_pcb)->rto]++;\ - } else {\ - (_pcb)->rto_cnt[ESP_STATS_TCP_ARRAY_SIZE-1] ++;\ - }\ - }\ -} while(0) -#else -#define ESP_STATS_TCP_PCB(pcb) -#endif - -#if LWIP_EVENT_API - -enum lwip_event { - LWIP_EVENT_ACCEPT, - LWIP_EVENT_SENT, - LWIP_EVENT_RECV, - LWIP_EVENT_CONNECTED, - LWIP_EVENT_POLL, - LWIP_EVENT_ERR -}; - -err_t lwip_tcp_event(void *arg, struct tcp_pcb *pcb, - enum lwip_event, - struct pbuf *p, - u16_t size, - err_t err); - -#endif /* LWIP_EVENT_API */ - -/* Application program's interface: */ -struct tcp_pcb * tcp_new (void); -struct tcp_pcb * tcp_new_ip_type (u8_t type); - -void tcp_arg (struct tcp_pcb *pcb, void *arg); -#if LWIP_CALLBACK_API -void tcp_recv (struct tcp_pcb *pcb, tcp_recv_fn recv); -void tcp_sent (struct tcp_pcb *pcb, tcp_sent_fn sent); -void tcp_err (struct tcp_pcb *pcb, tcp_err_fn err); -void tcp_accept (struct tcp_pcb *pcb, tcp_accept_fn accept); -#endif /* LWIP_CALLBACK_API */ -void tcp_poll (struct tcp_pcb *pcb, tcp_poll_fn poll, u8_t interval); - -#if LWIP_TCP_TIMESTAMPS -#define tcp_mss(pcb) (((pcb)->flags & TF_TIMESTAMP) ? ((pcb)->mss - 12) : (pcb)->mss) -#else /* LWIP_TCP_TIMESTAMPS */ -#define tcp_mss(pcb) ((pcb)->mss) -#endif /* LWIP_TCP_TIMESTAMPS */ -#define tcp_sndbuf(pcb) (TCPWND16((pcb)->snd_buf)) -#define tcp_sndqueuelen(pcb) ((pcb)->snd_queuelen) -/** @ingroup tcp_raw */ -#define tcp_nagle_disable(pcb) ((pcb)->flags |= TF_NODELAY) -/** @ingroup tcp_raw */ -#define tcp_nagle_enable(pcb) ((pcb)->flags = (tcpflags_t)((pcb)->flags & ~TF_NODELAY)) -/** @ingroup tcp_raw */ -#define tcp_nagle_disabled(pcb) (((pcb)->flags & TF_NODELAY) != 0) - -#if TCP_LISTEN_BACKLOG -#define tcp_backlog_set(pcb, new_backlog) do { \ - LWIP_ASSERT("pcb->state == LISTEN (called for wrong pcb?)", (pcb)->state == LISTEN); \ - ((struct tcp_pcb_listen *)(pcb))->backlog = ((new_backlog) ? (new_backlog) : 1); } while(0) -void tcp_backlog_delayed(struct tcp_pcb* pcb); -void tcp_backlog_accepted(struct tcp_pcb* pcb); -#else /* TCP_LISTEN_BACKLOG */ -#define tcp_backlog_set(pcb, new_backlog) -#define tcp_backlog_delayed(pcb) -#define tcp_backlog_accepted(pcb) -#endif /* TCP_LISTEN_BACKLOG */ -#define tcp_accepted(pcb) /* compatibility define, not needed any more */ - -void tcp_recved (struct tcp_pcb *pcb, u16_t len); -err_t tcp_bind (struct tcp_pcb *pcb, const ip_addr_t *ipaddr, - u16_t port); -err_t tcp_connect (struct tcp_pcb *pcb, const ip_addr_t *ipaddr, - u16_t port, tcp_connected_fn connected); - -struct tcp_pcb * tcp_listen_with_backlog_and_err(struct tcp_pcb *pcb, u8_t backlog, err_t *err); -struct tcp_pcb * tcp_listen_with_backlog(struct tcp_pcb *pcb, u8_t backlog); -/** @ingroup tcp_raw */ -#define tcp_listen(pcb) tcp_listen_with_backlog(pcb, TCP_DEFAULT_LISTEN_BACKLOG) - -void tcp_abort (struct tcp_pcb *pcb); -err_t tcp_close (struct tcp_pcb *pcb); -err_t tcp_shutdown(struct tcp_pcb *pcb, int shut_rx, int shut_tx); - -/* Flags for "apiflags" parameter in tcp_write */ -#define TCP_WRITE_FLAG_COPY 0x01 -#define TCP_WRITE_FLAG_MORE 0x02 - -err_t tcp_write (struct tcp_pcb *pcb, const void *dataptr, u16_t len, - u8_t apiflags); - -void tcp_setprio (struct tcp_pcb *pcb, u8_t prio); - -#define TCP_PRIO_MIN 1 -#define TCP_PRIO_NORMAL 64 -#define TCP_PRIO_MAX 127 - -err_t tcp_output (struct tcp_pcb *pcb); - - -const char* tcp_debug_state_str(enum tcp_state s); - -/* for compatibility with older implementation */ -#define tcp_new_ip6() tcp_new_ip_type(IPADDR_TYPE_V6) - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_TCP */ - -#endif /* LWIP_HDR_TCP_H */ diff --git a/tools/sdk/include/lwip/lwip/tcpip.h b/tools/sdk/include/lwip/lwip/tcpip.h deleted file mode 100644 index f2f6b469f16..00000000000 --- a/tools/sdk/include/lwip/lwip/tcpip.h +++ /dev/null @@ -1,106 +0,0 @@ -/** - * @file - * Functions to sync with TCPIP thread - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_TCPIP_H -#define LWIP_HDR_TCPIP_H - -#include "lwip/opt.h" - -#if !NO_SYS /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/err.h" -#include "lwip/timeouts.h" -#include "lwip/netif.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if LWIP_TCPIP_CORE_LOCKING -/** The global semaphore to lock the stack. */ -extern sys_mutex_t lock_tcpip_core; -/** Lock lwIP core mutex (needs @ref LWIP_TCPIP_CORE_LOCKING 1) */ -#define LOCK_TCPIP_CORE() sys_mutex_lock(&lock_tcpip_core) -/** Unlock lwIP core mutex (needs @ref LWIP_TCPIP_CORE_LOCKING 1) */ -#define UNLOCK_TCPIP_CORE() sys_mutex_unlock(&lock_tcpip_core) -#else /* LWIP_TCPIP_CORE_LOCKING */ -#define LOCK_TCPIP_CORE() -#define UNLOCK_TCPIP_CORE() -#endif /* LWIP_TCPIP_CORE_LOCKING */ - -struct pbuf; -struct netif; - -/** Function prototype for the init_done function passed to tcpip_init */ -typedef void (*tcpip_init_done_fn)(void *arg); -/** Function prototype for functions passed to tcpip_callback() */ -typedef void (*tcpip_callback_fn)(void *ctx); - -/* Forward declarations */ -struct tcpip_callback_msg; - -void tcpip_init(tcpip_init_done_fn tcpip_init_done, void *arg); - -err_t tcpip_inpkt(struct pbuf *p, struct netif *inp, netif_input_fn input_fn); -err_t tcpip_input(struct pbuf *p, struct netif *inp); - -err_t tcpip_callback_with_block(tcpip_callback_fn function, void *ctx, u8_t block); -/** - * @ingroup lwip_os - * @see tcpip_callback_with_block - */ -#define tcpip_callback(f, ctx) tcpip_callback_with_block(f, ctx, 1) - -struct tcpip_callback_msg* tcpip_callbackmsg_new(tcpip_callback_fn function, void *ctx); -void tcpip_callbackmsg_delete(struct tcpip_callback_msg* msg); -err_t tcpip_trycallback(struct tcpip_callback_msg* msg); - -/* free pbufs or heap memory from another context without blocking */ -err_t pbuf_free_callback(struct pbuf *p); -err_t mem_free_callback(void *m); - -#if LWIP_TCPIP_TIMEOUT && LWIP_TIMERS -err_t tcpip_timeout(u32_t msecs, sys_timeout_handler h, void *arg); -err_t tcpip_untimeout(sys_timeout_handler h, void *arg); -#endif /* LWIP_TCPIP_TIMEOUT && LWIP_TIMERS */ - -#ifdef __cplusplus -} -#endif - -#endif /* !NO_SYS */ - -#endif /* LWIP_HDR_TCPIP_H */ diff --git a/tools/sdk/include/lwip/lwip/timeouts.h b/tools/sdk/include/lwip/lwip/timeouts.h deleted file mode 100644 index c9b93aa02ac..00000000000 --- a/tools/sdk/include/lwip/lwip/timeouts.h +++ /dev/null @@ -1,121 +0,0 @@ -/** - * @file - * Timer implementations - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * Simon Goldschmidt - * - */ -#ifndef LWIP_HDR_TIMEOUTS_H -#define LWIP_HDR_TIMEOUTS_H - -#include "lwip/opt.h" -#include "lwip/err.h" -#if !NO_SYS -#include "lwip/sys.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef LWIP_DEBUG_TIMERNAMES -#ifdef LWIP_DEBUG -#define LWIP_DEBUG_TIMERNAMES SYS_DEBUG -#else /* LWIP_DEBUG */ -#define LWIP_DEBUG_TIMERNAMES 0 -#endif /* LWIP_DEBUG*/ -#endif - -/** Function prototype for a stack-internal timer function that has to be - * called at a defined interval */ -typedef void (* lwip_cyclic_timer_handler)(void); - -/** This struct contains information about a stack-internal timer function - that has to be called at a defined interval */ -struct lwip_cyclic_timer { - u32_t interval_ms; - lwip_cyclic_timer_handler handler; -#if LWIP_DEBUG_TIMERNAMES - const char* handler_name; -#endif /* LWIP_DEBUG_TIMERNAMES */ -}; - -/** This array contains all stack-internal cyclic timers. To get the number of - * timers, use LWIP_ARRAYSIZE() */ -extern const struct lwip_cyclic_timer lwip_cyclic_timers[]; - -#if LWIP_TIMERS - -/** Function prototype for a timeout callback function. Register such a function - * using sys_timeout(). - * - * @param arg Additional argument to pass to the function - set up by sys_timeout() - */ -typedef void (* sys_timeout_handler)(void *arg); - -struct sys_timeo { - struct sys_timeo *next; - u32_t time; - sys_timeout_handler h; - void *arg; -#if LWIP_DEBUG_TIMERNAMES - const char* handler_name; -#endif /* LWIP_DEBUG_TIMERNAMES */ -}; - -void sys_timeouts_init(void); - -#if LWIP_DEBUG_TIMERNAMES -void sys_timeout_debug(u32_t msecs, sys_timeout_handler handler, void *arg, const char* handler_name); -#define sys_timeout(msecs, handler, arg) sys_timeout_debug(msecs, handler, arg, #handler) -#else /* LWIP_DEBUG_TIMERNAMES */ -void sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg); -#endif /* LWIP_DEBUG_TIMERNAMES */ - -void sys_untimeout(sys_timeout_handler handler, void *arg); -void sys_restart_timeouts(void); -#if NO_SYS -void sys_check_timeouts(void); -u32_t sys_timeouts_sleeptime(void); -#else /* NO_SYS */ -void sys_timeouts_mbox_fetch(sys_mbox_t *mbox, void **msg); -#endif /* NO_SYS */ - - -#endif /* LWIP_TIMERS */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_TIMEOUTS_H */ diff --git a/tools/sdk/include/lwip/lwip/udp.h b/tools/sdk/include/lwip/lwip/udp.h deleted file mode 100644 index b679a82ddc4..00000000000 --- a/tools/sdk/include/lwip/lwip/udp.h +++ /dev/null @@ -1,190 +0,0 @@ -/** - * @file - * UDP API (to be used from TCPIP thread)\n - * See also @ref udp_raw - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ -#ifndef LWIP_HDR_UDP_H -#define LWIP_HDR_UDP_H - -#include "lwip/opt.h" - -#if LWIP_UDP /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/pbuf.h" -#include "lwip/netif.h" -#include "lwip/ip_addr.h" -#include "lwip/ip.h" -#include "lwip/ip6_addr.h" -#include "lwip/prot/udp.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define UDP_FLAGS_NOCHKSUM 0x01U -#define UDP_FLAGS_UDPLITE 0x02U -#define UDP_FLAGS_CONNECTED 0x04U -#define UDP_FLAGS_MULTICAST_LOOP 0x08U - -struct udp_pcb; - -/** Function prototype for udp pcb receive callback functions - * addr and port are in same byte order as in the pcb - * The callback is responsible for freeing the pbuf - * if it's not used any more. - * - * ATTENTION: Be aware that 'addr' might point into the pbuf 'p' so freeing this pbuf - * can make 'addr' invalid, too. - * - * @param arg user supplied argument (udp_pcb.recv_arg) - * @param pcb the udp_pcb which received data - * @param p the packet buffer that was received - * @param addr the remote IP address from which the packet was received - * @param port the remote port from which the packet was received - */ -typedef void (*udp_recv_fn)(void *arg, struct udp_pcb *pcb, struct pbuf *p, - const ip_addr_t *addr, u16_t port); - -/** the UDP protocol control block */ -struct udp_pcb { -/** Common members of all PCB types */ - IP_PCB; - -/* Protocol specific PCB members */ - - struct udp_pcb *next; - - u8_t flags; - /** ports are in host byte order */ - u16_t local_port, remote_port; - -#if LWIP_MULTICAST_TX_OPTIONS - /** outgoing network interface for multicast packets */ - ip_addr_t multicast_ip; - /** TTL for outgoing multicast packets */ - u8_t mcast_ttl; -#endif /* LWIP_MULTICAST_TX_OPTIONS */ - -#if LWIP_UDPLITE - /** used for UDP_LITE only */ - u16_t chksum_len_rx, chksum_len_tx; -#endif /* LWIP_UDPLITE */ - - /** receive callback function */ - udp_recv_fn recv; - /** user-supplied argument for the recv callback */ - void *recv_arg; -}; -/* udp_pcbs export for external reference (e.g. SNMP agent) */ -extern struct udp_pcb *udp_pcbs; - -/* The following functions is the application layer interface to the - UDP code. */ -struct udp_pcb * udp_new (void); -struct udp_pcb * udp_new_ip_type(u8_t type); -void udp_remove (struct udp_pcb *pcb); -err_t udp_bind (struct udp_pcb *pcb, const ip_addr_t *ipaddr, - u16_t port); -err_t udp_connect (struct udp_pcb *pcb, const ip_addr_t *ipaddr, - u16_t port); -void udp_disconnect (struct udp_pcb *pcb); -void udp_recv (struct udp_pcb *pcb, udp_recv_fn recv, - void *recv_arg); -err_t udp_sendto_if (struct udp_pcb *pcb, struct pbuf *p, - const ip_addr_t *dst_ip, u16_t dst_port, - struct netif *netif); -err_t udp_sendto_if_src(struct udp_pcb *pcb, struct pbuf *p, - const ip_addr_t *dst_ip, u16_t dst_port, - struct netif *netif, const ip_addr_t *src_ip); -err_t udp_sendto (struct udp_pcb *pcb, struct pbuf *p, - const ip_addr_t *dst_ip, u16_t dst_port); -err_t udp_send (struct udp_pcb *pcb, struct pbuf *p); - -#if LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP -err_t udp_sendto_if_chksum(struct udp_pcb *pcb, struct pbuf *p, - const ip_addr_t *dst_ip, u16_t dst_port, - struct netif *netif, u8_t have_chksum, - u16_t chksum); -err_t udp_sendto_chksum(struct udp_pcb *pcb, struct pbuf *p, - const ip_addr_t *dst_ip, u16_t dst_port, - u8_t have_chksum, u16_t chksum); -err_t udp_send_chksum(struct udp_pcb *pcb, struct pbuf *p, - u8_t have_chksum, u16_t chksum); -err_t udp_sendto_if_src_chksum(struct udp_pcb *pcb, struct pbuf *p, - const ip_addr_t *dst_ip, u16_t dst_port, struct netif *netif, - u8_t have_chksum, u16_t chksum, const ip_addr_t *src_ip); -#endif /* LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP */ - -#define udp_flags(pcb) ((pcb)->flags) -#define udp_setflags(pcb, f) ((pcb)->flags = (f)) - -/* The following functions are the lower layer interface to UDP. */ -void udp_input (struct pbuf *p, struct netif *inp); - -void udp_init (void); - -/* for compatibility with older implementation */ -#define udp_new_ip6() udp_new_ip_type(IPADDR_TYPE_V6) - -#if LWIP_MULTICAST_TX_OPTIONS -#define udp_set_multicast_netif_addr(pcb, ip4addr) ip_addr_copy_from_ip4((pcb)->multicast_ip, *(ip4addr)) -#define udp_get_multicast_netif_addr(pcb) ip_2_ip4(&(pcb)->multicast_ip) -#define udp_set_multicast_ttl(pcb, value) do { (pcb)->mcast_ttl = value; } while(0) -#define udp_get_multicast_ttl(pcb) ((pcb)->mcast_ttl) - -#if ESP_LWIP -#if LWIP_IPV6_MLD -#define udp_set_multicast_netif_ip6addr(pcb, ip6addr) ip_addr_copy_from_ip6((pcb)->multicast_ip, *(ip6addr)) -#define udp_get_multicast_netif_ip6addr(pcb) ip_2_ip6(&(pcb)->multicast_ip) -#endif -#endif - -#endif /* LWIP_MULTICAST_TX_OPTIONS */ - -#if UDP_DEBUG -void udp_debug_print(struct udp_hdr *udphdr); -#else -#define udp_debug_print(udphdr) -#endif - -void udp_netif_ip_addr_changed(const ip_addr_t* old_addr, const ip_addr_t* new_addr); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_UDP */ - -#endif /* LWIP_HDR_UDP_H */ diff --git a/tools/sdk/include/lwip/lwipopts.h b/tools/sdk/include/lwip/lwipopts.h deleted file mode 100644 index 13a3632d43a..00000000000 --- a/tools/sdk/include/lwip/lwipopts.h +++ /dev/null @@ -1,848 +0,0 @@ -/* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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 - * - */ -#ifndef __LWIPOPTS_H__ -#define __LWIPOPTS_H__ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "esp_task.h" -#include "esp_system.h" -#include "sdkconfig.h" - -#include "netif/dhcp_state.h" - -/* Enable all Espressif-only options */ - -/* - ----------------------------------------------- - ---------- Platform specific locking ---------- - ----------------------------------------------- -*/ -/** - * SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain - * critical regions during buffer allocation, deallocation and memory - * allocation and deallocation. - */ -#define SYS_LIGHTWEIGHT_PROT 1 - -/** - * MEMCPY: override this if you have a faster implementation at hand than the - * one included in your C library - */ -#define MEMCPY(dst,src,len) memcpy(dst,src,len) - -/** - * SMEMCPY: override this with care! Some compilers (e.g. gcc) can inline a - * call to memcpy() if the length is known at compile time and is small. - */ -#define SMEMCPY(dst,src,len) memcpy(dst,src,len) - -#define LWIP_RAND esp_random - -/* - ------------------------------------ - ---------- Memory options ---------- - ------------------------------------ -*/ -/** - * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library - * instead of the lwip internal allocator. Can save code size if you - * already use it. - */ -#define MEM_LIBC_MALLOC 1 - -/** -* MEMP_MEM_MALLOC==1: Use mem_malloc/mem_free instead of the lwip pool allocator. -* Especially useful with MEM_LIBC_MALLOC but handle with care regarding execution -* speed and usage from interrupts! -*/ -#define MEMP_MEM_MALLOC 1 - -/** - * MEM_ALIGNMENT: should be set to the alignment of the CPU - * 4 byte alignment -> #define MEM_ALIGNMENT 4 - * 2 byte alignment -> #define MEM_ALIGNMENT 2 - */ -#define MEM_ALIGNMENT 4 - -/* - ------------------------------------------------ - ---------- Internal Memory Pool Sizes ---------- - ------------------------------------------------ -*/ - -/** - * MEMP_NUM_NETCONN: the number of struct netconns. - * (only needed if you use the sequential API, like api_lib.c) - */ -#define MEMP_NUM_NETCONN CONFIG_LWIP_MAX_SOCKETS - -/** - * MEMP_NUM_RAW_PCB: Number of raw connection PCBs - * (requires the LWIP_RAW option) - */ -#define MEMP_NUM_RAW_PCB CONFIG_LWIP_MAX_RAW_PCBS - -/** - * MEMP_NUM_TCP_PCB: the number of simultaneously active TCP connections. - * (requires the LWIP_TCP option) - */ -#define MEMP_NUM_TCP_PCB CONFIG_LWIP_MAX_ACTIVE_TCP - -/** - * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections. - * (requires the LWIP_TCP option) - */ -#define MEMP_NUM_TCP_PCB_LISTEN CONFIG_LWIP_MAX_LISTENING_TCP - -/** - * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One - * per active UDP "connection". - * (requires the LWIP_UDP option) - */ -#define MEMP_NUM_UDP_PCB CONFIG_LWIP_MAX_UDP_PCBS - -/* - -------------------------------- - ---------- ARP options ------- - -------------------------------- -*/ -/** - * ARP_QUEUEING==1: Multiple outgoing packets are queued during hardware address - * resolution. By default, only the most recent packet is queued per IP address. - * This is sufficient for most protocols and mainly reduces TCP connection - * startup time. Set this to 1 if you know your application sends more than one - * packet in a row to an IP address that is not in the ARP cache. - */ -#define ARP_QUEUEING 1 - -/* - -------------------------------- - ---------- IP options ---------- - -------------------------------- -*/ -/** - * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that - * this option does not affect outgoing packet sizes, which can be controlled - * via IP_FRAG. - */ -#define IP_REASSEMBLY CONFIG_LWIP_IP_REASSEMBLY - -/** - * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note - * that this option does not affect incoming packet sizes, which can be - * controlled via IP_REASSEMBLY. - */ -#define IP_FRAG CONFIG_LWIP_IP_FRAG - -/** - * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally) - * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived - * in this time, the whole packet is discarded. - */ -#define IP_REASS_MAXAGE 3 - -/** - * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled. - * Since the received pbufs are enqueued, be sure to configure - * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive - * packets even if the maximum amount of fragments is enqueued for reassembly! - */ -#define IP_REASS_MAX_PBUFS 10 - -/* - ---------------------------------- - ---------- ICMP options ---------- - ---------------------------------- -*/ - -#define LWIP_BROADCAST_PING CONFIG_LWIP_BROADCAST_PING - -#define LWIP_MULTICAST_PING CONFIG_LWIP_MULTICAST_PING - -/* - --------------------------------- - ---------- RAW options ---------- - --------------------------------- -*/ -/** - * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. - */ -#define LWIP_RAW 1 - -/* - ---------------------------------- - ---------- DHCP options ---------- - ---------------------------------- -*/ -/** - * LWIP_DHCP==1: Enable DHCP module. - */ -#define LWIP_DHCP 1 - -#define DHCP_MAXRTX 0 - -/** - * DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address. - */ -#define DHCP_DOES_ARP_CHECK CONFIG_LWIP_DHCP_DOES_ARP_CHECK - - -/** - * CONFIG_LWIP_DHCP_RESTORE_LAST_IP==1: Last valid IP address obtained from DHCP server - * is restored after reset/power-up. - */ -#if CONFIG_LWIP_DHCP_RESTORE_LAST_IP - -#define LWIP_DHCP_IP_ADDR_RESTORE() dhcp_ip_addr_restore(netif) -#define LWIP_DHCP_IP_ADDR_STORE() dhcp_ip_addr_store(netif) -#define LWIP_DHCP_IP_ADDR_ERASE() dhcp_ip_addr_erase(esp_netif[tcpip_if]) - -#endif - -/* - ------------------------------------ - ---------- AUTOIP options ---------- - ------------------------------------ -*/ -#ifdef CONFIG_LWIP_AUTOIP -#define LWIP_AUTOIP 1 - -/** -* LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on -* the same interface at the same time. -*/ -#define LWIP_DHCP_AUTOIP_COOP 1 - -/** -* LWIP_DHCP_AUTOIP_COOP_TRIES: Set to the number of DHCP DISCOVER probes -* that should be sent before falling back on AUTOIP. This can be set -* as low as 1 to get an AutoIP address very quickly, but you should -* be prepared to handle a changing IP address when DHCP overrides -* AutoIP. -*/ -#define LWIP_DHCP_AUTOIP_COOP_TRIES CONFIG_LWIP_AUTOIP_TRIES - -#define LWIP_AUTOIP_MAX_CONFLICTS CONFIG_LWIP_AUTOIP_MAX_CONFLICTS - -#define LWIP_AUTOIP_RATE_LIMIT_INTERVAL CONFIG_LWIP_AUTOIP_RATE_LIMIT_INTERVAL - -#endif /* CONFIG_LWIP_AUTOIP */ - -/* - ---------------------------------- - ---------- SNMP options ---------- - ---------------------------------- -*/ -/* - ---------------------------------- - ---------- IGMP options ---------- - ---------------------------------- -*/ -/** - * LWIP_IGMP==1: Turn on IGMP module. - */ -#define LWIP_IGMP 1 - -/* - ---------------------------------- - ---------- DNS options ----------- - ---------------------------------- -*/ -/** - * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS - * transport. - */ -#define LWIP_DNS 1 - -#define DNS_MAX_SERVERS 3 -#define DNS_FALLBACK_SERVER_INDEX (DNS_MAX_SERVERS - 1) - -/* - --------------------------------- - ---------- UDP options ---------- - --------------------------------- -*/ -/* - --------------------------------- - ---------- TCP options ---------- - --------------------------------- -*/ - - -/** - * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order. - * Define to 0 if your device is low on memory. - */ -#define TCP_QUEUE_OOSEQ CONFIG_TCP_QUEUE_OOSEQ - -/** - * ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES==1: Keep TCP connection when IP changed - * scenario happens: 192.168.0.2 -> 0.0.0.0 -> 192.168.0.2 or 192.168.0.2 -> 0.0.0.0 - */ - -#define ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES -/* - * LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all - * events (accept, sent, etc) that happen in the system. - * LWIP_CALLBACK_API==1: The PCB callback function is called directly - * for the event. This is the default. -*/ -#define TCP_MSS CONFIG_TCP_MSS - -/** - * TCP_MSL: The maximum segment lifetime in milliseconds - */ -#define TCP_MSL CONFIG_TCP_MSL - -/** - * TCP_MAXRTX: Maximum number of retransmissions of data segments. - */ -#define TCP_MAXRTX CONFIG_TCP_MAXRTX - -/** - * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments. - */ -#define TCP_SYNMAXRTX CONFIG_TCP_SYNMAXRTX - -/** - * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb. - */ -#define TCP_LISTEN_BACKLOG 1 - - -/** - * TCP_OVERSIZE: The maximum number of bytes that tcp_write may - * allocate ahead of time - */ -#ifdef CONFIG_TCP_OVERSIZE_MSS -#define TCP_OVERSIZE TCP_MSS -#endif -#ifdef CONFIG_TCP_OVERSIZE_QUARTER_MSS -#define TCP_OVERSIZE (TCP_MSS/4) -#endif -#ifdef CONFIG_TCP_OVERSIZE_DISABLE -#define TCP_OVERSIZE 0 -#endif -#ifndef TCP_OVERSIZE -#error "One of CONFIG_TCP_OVERSIZE_xxx options should be set by sdkconfig" -#endif - -/** - * LWIP_WND_SCALE and TCP_RCV_SCALE: - * Set LWIP_WND_SCALE to 1 to enable window scaling. - * Set TCP_RCV_SCALE to the desired scaling factor (shift count in the - * range of [0..14]). - * When LWIP_WND_SCALE is enabled but TCP_RCV_SCALE is 0, we can use a large - * send window while having a small receive window only. - */ -#ifdef CONFIG_LWIP_WND_SCALE -#define LWIP_WND_SCALE 1 -#define TCP_RCV_SCALE CONFIG_TCP_RCV_SCALE -#endif - -/* - ---------------------------------- - ---------- Pbuf options ---------- - ---------------------------------- -*/ - -/* - ------------------------------------------------ - ---------- Network Interfaces options ---------- - ------------------------------------------------ -*/ - -/** - * LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname - * field. - */ -#define LWIP_NETIF_HOSTNAME 1 - -/** - * LWIP_NETIF_TX_SINGLE_PBUF: if this is set to 1, lwIP tries to put all data - * to be sent into one single pbuf. This is for compatibility with DMA-enabled - * MACs that do not support scatter-gather. - * Beware that this might involve CPU-memcpy before transmitting that would not - * be needed without this flag! Use this only if you need to! - * - * @todo: TCP and IP-frag do not work with this, yet: - */ -#define LWIP_NETIF_TX_SINGLE_PBUF 1 - -/* - ------------------------------------ - ---------- LOOPIF options ---------- - ------------------------------------ -*/ -#ifdef CONFIG_LWIP_NETIF_LOOPBACK -/** - * LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP - * address equal to the netif IP address, looping them back up the stack. - */ -#define LWIP_NETIF_LOOPBACK 1 - -/** - * LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback - * sending for each netif (0 = disabled) - */ -#define LWIP_LOOPBACK_MAX_PBUFS CONFIG_LWIP_LOOPBACK_MAX_PBUFS -#endif - -/* - ------------------------------------ - ---------- SLIPIF options ---------- - ------------------------------------ -*/ - -/* - ------------------------------------ - ---------- Thread options ---------- - ------------------------------------ -*/ -/** - * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread. - */ -#define TCPIP_THREAD_NAME "tiT" - -/** - * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread. - * The stack size value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#define TCPIP_THREAD_STACKSIZE ESP_TASK_TCPIP_STACK - -/** - * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread. - * The priority value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#define TCPIP_THREAD_PRIO ESP_TASK_TCPIP_PRIO - -/** - * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages - * The queue size value itself is platform-dependent, but is passed to - * sys_mbox_new() when tcpip_init is called. - */ -#define TCPIP_MBOX_SIZE CONFIG_TCPIP_RECVMBOX_SIZE - -/** - * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a - * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed - * to sys_mbox_new() when the recvmbox is created. - */ -#define DEFAULT_UDP_RECVMBOX_SIZE CONFIG_UDP_RECVMBOX_SIZE - -/** - * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a - * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed - * to sys_mbox_new() when the recvmbox is created. - */ -#define DEFAULT_TCP_RECVMBOX_SIZE CONFIG_TCP_RECVMBOX_SIZE - -/** - * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections. - * The queue size value itself is platform-dependent, but is passed to - * sys_mbox_new() when the acceptmbox is created. - */ -#define DEFAULT_ACCEPTMBOX_SIZE 6 - -/** - * DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread. - * The stack size value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#define DEFAULT_THREAD_STACKSIZE TCPIP_THREAD_STACKSIZE - -/** - * DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread. - * The priority value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#define DEFAULT_THREAD_PRIO TCPIP_THREAD_PRIO - -/** - * DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a - * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed - * to sys_mbox_new() when the recvmbox is created. - */ -#define DEFAULT_RAW_RECVMBOX_SIZE 6 - -/* - ---------------------------------------------- - ---------- Sequential layer options ---------- - ---------------------------------------------- -*/ -/** - * LWIP_TCPIP_CORE_LOCKING: (EXPERIMENTAL!) - * Don't use it if you're not an active lwIP project member - */ -#define LWIP_TCPIP_CORE_LOCKING 0 - -/* - ------------------------------------ - ---------- Socket options ---------- - ------------------------------------ -*/ -/** - * LWIP_SO_SNDTIMEO==1: Enable send timeout for sockets/netconns and - * SO_SNDTIMEO processing. - */ -#define LWIP_SO_SNDTIMEO 1 - -/** - * LWIP_SO_RCVTIMEO==1: Enable receive timeout for sockets/netconns and - * SO_RCVTIMEO processing. - */ -#define LWIP_SO_RCVTIMEO 1 - -/** - * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT - * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set - * in seconds. (does not require sockets.c, and will affect tcp.c) - */ -#define LWIP_TCP_KEEPALIVE 1 - -/** - * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing. - */ -#define LWIP_SO_RCVBUF CONFIG_LWIP_SO_RCVBUF - -/** - * SO_REUSE==1: Enable SO_REUSEADDR option. - * This option is set via menuconfig. - */ -#define SO_REUSE CONFIG_LWIP_SO_REUSE - -/** - * SO_REUSE_RXTOALL==1: Pass a copy of incoming broadcast/multicast packets - * to all local matches if SO_REUSEADDR is turned on. - * WARNING: Adds a memcpy for every packet if passing to more than one pcb! - */ -#define SO_REUSE_RXTOALL CONFIG_LWIP_SO_REUSE_RXTOALL - -/* - ---------------------------------------- - ---------- Statistics options ---------- - ---------------------------------------- -*/ - -/** - * LWIP_STATS==1: Enable statistics collection in lwip_stats. - */ -#define LWIP_STATS CONFIG_LWIP_STATS - -#if LWIP_STATS - -/** - * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions. - */ -#define LWIP_STATS_DISPLAY CONFIG_LWIP_STATS -#endif - - -/* - --------------------------------- - ---------- PPP options ---------- - --------------------------------- -*/ - -/** - * PPP_SUPPORT==1: Enable PPP. - */ -#define PPP_SUPPORT CONFIG_PPP_SUPPORT - -#if PPP_SUPPORT - -/** - * PAP_SUPPORT==1: Support PAP. - */ -#define PAP_SUPPORT CONFIG_PPP_PAP_SUPPORT - -/** - * CHAP_SUPPORT==1: Support CHAP. - */ -#define CHAP_SUPPORT CONFIG_PPP_CHAP_SUPPORT - -/** - * MSCHAP_SUPPORT==1: Support MSCHAP. - */ -#define MSCHAP_SUPPORT CONFIG_PPP_MSCHAP_SUPPORT - -/** - * CCP_SUPPORT==1: Support CCP. - */ -#define MPPE_SUPPORT CONFIG_PPP_MPPE_SUPPORT - -/** - * PPP_MAXIDLEFLAG: Max Xmit idle time (in ms) before resend flag char. - * TODO: If PPP_MAXIDLEFLAG > 0 and next package is send during PPP_MAXIDLEFLAG time, - * then 0x7E is not added at the begining of PPP package but 0x7E termination - * is always at the end. This behaviour brokes PPP dial with GSM (PPPoS). - * The PPP package should always start and end with 0x7E. - */ - -#define PPP_MAXIDLEFLAG 0 - -/** - * PPP_DEBUG: Enable debugging for PPP. - */ -#define PPP_DEBUG_ON CONFIG_PPP_DEBUG_ON - -#if PPP_DEBUG_ON -#define PPP_DEBUG LWIP_DBG_ON -#else -#define PPP_DEBUG LWIP_DBG_OFF -#endif - -#endif - -/* - -------------------------------------- - ---------- Checksum options ---------- - -------------------------------------- -*/ - -/* - --------------------------------------- - ---------- IPv6 options --------------- - --------------------------------------- -*/ -/** - * LWIP_IPV6==1: Enable IPv6 - */ -#define LWIP_IPV6 1 - -/* - --------------------------------------- - ---------- Hook options --------------- - --------------------------------------- -*/ -#define LWIP_HOOK_IP4_ROUTE_SRC ip4_route_src_hook -/* - --------------------------------------- - ---------- Debugging options ---------- - --------------------------------------- -*/ -/** - * ETHARP_DEBUG: Enable debugging in etharp.c. - */ -#define ETHARP_DEBUG LWIP_DBG_OFF - -/** - * NETIF_DEBUG: Enable debugging in netif.c. - */ -#define NETIF_DEBUG LWIP_DBG_OFF - -/** - * PBUF_DEBUG: Enable debugging in pbuf.c. - */ -#define PBUF_DEBUG LWIP_DBG_OFF - -/** - * API_LIB_DEBUG: Enable debugging in api_lib.c. - */ -#define API_LIB_DEBUG LWIP_DBG_OFF - -/** - * SOCKETS_DEBUG: Enable debugging in sockets.c. - */ -#define SOCKETS_DEBUG LWIP_DBG_OFF - -/** - * ICMP_DEBUG: Enable debugging in icmp.c. - */ -#define ICMP_DEBUG LWIP_DBG_OFF - -/** - * IP_DEBUG: Enable debugging for IP. - */ -#define IP_DEBUG LWIP_DBG_OFF - -/** - * MEMP_DEBUG: Enable debugging in memp.c. - */ -#define MEMP_DEBUG LWIP_DBG_OFF - -/** - * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug. - */ -#define TCP_INPUT_DEBUG LWIP_DBG_OFF - -/** - * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions. - */ -#define TCP_OUTPUT_DEBUG LWIP_DBG_OFF - -/** - * TCPIP_DEBUG: Enable debugging in tcpip.c. - */ -#define TCPIP_DEBUG LWIP_DBG_OFF - -/** - * ETHARP_TRUST_IP_MAC==1: Incoming IP packets cause the ARP table to be - * updated with the source MAC and IP addresses supplied in the packet. - * You may want to disable this if you do not trust LAN peers to have the - * correct addresses, or as a limited approach to attempt to handle - * spoofing. If disabled, lwIP will need to make a new ARP request if - * the peer is not already in the ARP table, adding a little latency. - * The peer *is* in the ARP table if it requested our address before. - * Also notice that this slows down input processing of every IP packet! - */ -#define ETHARP_TRUST_IP_MAC CONFIG_LWIP_ETHARP_TRUST_IP_MAC - - -/** - * POSIX I/O functions are mapped to LWIP via the VFS layer - * (see port/vfs_lwip.c) - */ -#define LWIP_POSIX_SOCKETS_IO_NAMES 0 - -/** - * FD_SETSIZE from sys/types.h is the maximum number of supported file - * descriptors and CONFIG_LWIP_MAX_SOCKETS defines the number of sockets; - * LWIP_SOCKET_OFFSET is configured to use the largest numbers of file - * descriptors for sockets. File descriptors from 0 to LWIP_SOCKET_OFFSET-1 - * are non-socket descriptors and from LWIP_SOCKET_OFFSET to FD_SETSIZE are - * socket descriptors. - */ -#define LWIP_SOCKET_OFFSET (FD_SETSIZE - CONFIG_LWIP_MAX_SOCKETS) - -/* Enable all Espressif-only options */ - -#define ESP_LWIP 1 -#define ESP_LWIP_ARP 1 -#define ESP_PER_SOC_TCP_WND 0 -#define ESP_THREAD_SAFE 1 -#define ESP_THREAD_SAFE_DEBUG LWIP_DBG_OFF -#define ESP_DHCP 1 -#define ESP_DNS 1 -#define ESP_IPV6_AUTOCONFIG 1 -#define ESP_PERF 0 -#define ESP_RANDOM_TCP_PORT 1 -#define ESP_IP4_ATON 1 -#define ESP_LIGHT_SLEEP 1 -#define ESP_L2_TO_L3_COPY CONFIG_L2_TO_L3_COPY -#define ESP_STATS_MEM CONFIG_LWIP_STATS -#define ESP_STATS_DROP CONFIG_LWIP_STATS -#define ESP_STATS_TCP 0 -#define ESP_DHCP_TIMER 1 -#define ESP_DHCPS_TIMER 1 -#define ESP_LWIP_LOGI(...) ESP_LOGI("lwip", __VA_ARGS__) -#define ESP_PING 1 -#define ESP_HAS_SELECT 1 -#define ESP_AUTO_RECV 1 -#define ESP_GRATUITOUS_ARP CONFIG_ESP_GRATUITOUS_ARP - -#if CONFIG_LWIP_IRAM_OPTIMIZATION -#define ESP_IRAM_ATTR IRAM_ATTR -#else -#define ESP_IRAM_ATTR -#endif - -#if ESP_PERF -#define DBG_PERF_PATH_SET(dir, point) -#define DBG_PERF_FILTER_LEN 1000 - -enum { - DBG_PERF_DIR_RX = 0, - DBG_PERF_DIR_TX, -}; - -enum { - DBG_PERF_POINT_INT = 0, - DBG_PERF_POINT_WIFI_IN = 1, - DBG_PERF_POINT_WIFI_OUT = 2, - DBG_PERF_POINT_LWIP_IN = 3, - DBG_PERF_POINT_LWIP_OUT = 4, - DBG_PERF_POINT_SOC_IN = 5, - DBG_PERF_POINT_SOC_OUT = 6, -}; - -#else -#define DBG_PERF_PATH_SET(dir, point) -#define DBG_PERF_FILTER_LEN 1000 -#endif - -#define TCP_SND_BUF CONFIG_TCP_SND_BUF_DEFAULT -#define TCP_WND CONFIG_TCP_WND_DEFAULT - -#if ESP_PER_SOC_TCP_WND -#define TCP_WND_DEFAULT CONFIG_TCP_WND_DEFAULT -#define TCP_SND_BUF_DEFAULT CONFIG_TCP_SND_BUF_DEFAULT -#define TCP_WND(pcb) (pcb->per_soc_tcp_wnd) -#define TCP_SND_BUF(pcb) (pcb->per_soc_tcp_snd_buf) -#define TCP_SND_QUEUELEN(pcb) ((4 * (TCP_SND_BUF((pcb))) + (TCP_MSS - 1))/(TCP_MSS)) -#define TCP_SNDLOWAT(pcb) LWIP_MIN(LWIP_MAX(((TCP_SND_BUF((pcb)))/2), (2 * TCP_MSS) + 1), (TCP_SND_BUF((pcb))) - 1) -#define TCP_SNDQUEUELOWAT(pcb) LWIP_MAX(((TCP_SND_QUEUELEN((pcb)))/2), 5) -#define TCP_WND_UPDATE_THRESHOLD(pcb) LWIP_MIN((TCP_WND((pcb)) / 4), (TCP_MSS * 4)) -#endif - -/** - * DHCP_DEBUG: Enable debugging in dhcp.c. - */ -#define DHCP_DEBUG LWIP_DBG_OFF -#define LWIP_DEBUG LWIP_DBG_OFF -#define TCP_DEBUG LWIP_DBG_OFF - -#define CHECKSUM_CHECK_UDP 0 -#define CHECKSUM_CHECK_IP 0 - -#define LWIP_NETCONN_FULLDUPLEX 1 -#define LWIP_NETCONN_SEM_PER_THREAD 1 - -#define LWIP_DHCP_MAX_NTP_SERVERS CONFIG_LWIP_DHCP_MAX_NTP_SERVERS -#define LWIP_TIMEVAL_PRIVATE 0 - -#define SNTP_SET_SYSTEM_TIME_US(sec, us) \ - do { \ - struct timeval tv = { .tv_sec = sec, .tv_usec = us }; \ - settimeofday(&tv, NULL); \ - } while (0); - -#define SNTP_GET_SYSTEM_TIME(sec, us) \ - do { \ - struct timeval tv = { .tv_sec = 0, .tv_usec = 0 }; \ - gettimeofday(&tv, NULL); \ - (sec) = tv.tv_sec; \ - (us) = tv.tv_usec; \ - } while (0); - -#define SOC_SEND_LOG //printf - -#endif /* __LWIPOPTS_H__ */ diff --git a/tools/sdk/include/lwip/netdb.h b/tools/sdk/include/lwip/netdb.h deleted file mode 100644 index 363154f6889..00000000000 --- a/tools/sdk/include/lwip/netdb.h +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @file - * This file is a posix wrapper for lwip/netdb.h. - */ - -/* - * 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. - * - */ - -#include "lwip/netdb.h" - -#ifdef ESP_PLATFORM -int getnameinfo(const struct sockaddr *addr, socklen_t addrlen, - char *host, socklen_t hostlen, - char *serv, socklen_t servlen, int flags); - -#endif diff --git a/tools/sdk/include/lwip/netif/dhcp_state.h b/tools/sdk/include/lwip/netif/dhcp_state.h deleted file mode 100644 index ffea1164011..00000000000 --- a/tools/sdk/include/lwip/netif/dhcp_state.h +++ /dev/null @@ -1,33 +0,0 @@ -// 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. - - -#ifndef _DHCP_STATE_H_ -#define _DHCP_STATE_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -bool dhcp_ip_addr_restore(void *netif); - -void dhcp_ip_addr_store(void *netif); - -void dhcp_ip_addr_erase(void *netif); - -#ifdef __cplusplus -} -#endif - -#endif /* _DHCP_STATE_H_ */ \ No newline at end of file diff --git a/tools/sdk/include/lwip/netif/etharp.h b/tools/sdk/include/lwip/netif/etharp.h deleted file mode 100644 index b536fd280fa..00000000000 --- a/tools/sdk/include/lwip/netif/etharp.h +++ /dev/null @@ -1,3 +0,0 @@ -/* ARP has been moved to core/ipv4, provide this #include for compatibility only */ -#include "lwip/etharp.h" -#include "netif/ethernet.h" diff --git a/tools/sdk/include/lwip/netif/ethernet.h b/tools/sdk/include/lwip/netif/ethernet.h deleted file mode 100644 index 49649cbf8b2..00000000000 --- a/tools/sdk/include/lwip/netif/ethernet.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @file - * Ethernet input function - handles INCOMING ethernet level traffic - * To be used in most low-level netif implementations - */ - -/* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * Copyright (c) 2003-2004 Leon Woestenberg - * Copyright (c) 2003-2004 Axon Digital Design B.V., The Netherlands. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ - -#ifndef LWIP_HDR_NETIF_ETHERNET_H -#define LWIP_HDR_NETIF_ETHERNET_H - -#include "lwip/opt.h" - -#include "lwip/pbuf.h" -#include "lwip/netif.h" -#include "lwip/prot/ethernet.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if LWIP_ARP || LWIP_ETHERNET - -/** Define this to 1 and define LWIP_ARP_FILTER_NETIF_FN(pbuf, netif, type) - * to a filter function that returns the correct netif when using multiple - * netifs on one hardware interface where the netif's low-level receive - * routine cannot decide for the correct netif (e.g. when mapping multiple - * IP addresses to one hardware interface). - */ -#ifndef LWIP_ARP_FILTER_NETIF -#define LWIP_ARP_FILTER_NETIF 0 -#endif - -err_t ethernet_input(struct pbuf *p, struct netif *netif); -err_t ethernet_output(struct netif* netif, struct pbuf* p, const struct eth_addr* src, const struct eth_addr* dst, u16_t eth_type); - -extern const struct eth_addr ethbroadcast, ethzero; - -#endif /* LWIP_ARP || LWIP_ETHERNET */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_NETIF_ETHERNET_H */ diff --git a/tools/sdk/include/lwip/netif/ethernetif.h b/tools/sdk/include/lwip/netif/ethernetif.h deleted file mode 100644 index 134e8eb5fe1..00000000000 --- a/tools/sdk/include/lwip/netif/ethernetif.h +++ /dev/null @@ -1,35 +0,0 @@ -// 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. - - -#ifndef _ETH_LWIP_IF_H_ -#define _ETH_LWIP_IF_H_ - -#include "lwip/err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -err_t ethernetif_init(struct netif *netif); - -void ethernetif_input(struct netif *netif, void *buffer, u16_t len); - -void netif_reg_addr_change_cb(void* cb); - -#ifdef __cplusplus -} -#endif - -#endif /* _ETH_LWIP_IF_H_ */ diff --git a/tools/sdk/include/lwip/netif/lowpan6.h b/tools/sdk/include/lwip/netif/lowpan6.h deleted file mode 100644 index 4174644bb36..00000000000 --- a/tools/sdk/include/lwip/netif/lowpan6.h +++ /dev/null @@ -1,86 +0,0 @@ -/** - * @file - * - * 6LowPAN output for IPv6. Uses ND tables for link-layer addressing. Fragments packets to 6LowPAN units. - */ - -/* - * Copyright (c) 2015 Inico Technologies Ltd. - * All rights reserved. - * - * 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: Ivan Delamer - * - * - * Please coordinate changes and requests with Ivan Delamer - * - */ - -#ifndef LWIP_HDR_LOWPAN6_H -#define LWIP_HDR_LOWPAN6_H - -#include "netif/lowpan6_opts.h" - -#if LWIP_IPV6 && LWIP_6LOWPAN /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/pbuf.h" -#include "lwip/ip.h" -#include "lwip/ip_addr.h" -#include "lwip/netif.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** 1 second period */ -#define LOWPAN6_TMR_INTERVAL 1000 - -void lowpan6_tmr(void); - -err_t lowpan6_set_context(u8_t index, const ip6_addr_t * context); -err_t lowpan6_set_short_addr(u8_t addr_high, u8_t addr_low); - -#if LWIP_IPV4 -err_t lowpan4_output(struct netif *netif, struct pbuf *q, const ip4_addr_t *ipaddr); -#endif /* LWIP_IPV4 */ -err_t lowpan6_output(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr); -err_t lowpan6_input(struct pbuf * p, struct netif *netif); -err_t lowpan6_if_init(struct netif *netif); - -/* pan_id in network byte order. */ -err_t lowpan6_set_pan_id(u16_t pan_id); - -#if !NO_SYS -err_t tcpip_6lowpan_input(struct pbuf *p, struct netif *inp); -#endif /* !NO_SYS */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_IPV6 && LWIP_6LOWPAN */ - -#endif /* LWIP_HDR_LOWPAN6_H */ diff --git a/tools/sdk/include/lwip/netif/lowpan6_opts.h b/tools/sdk/include/lwip/netif/lowpan6_opts.h deleted file mode 100644 index fb93ea05de6..00000000000 --- a/tools/sdk/include/lwip/netif/lowpan6_opts.h +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @file - * 6LowPAN options list - */ - -/* - * Copyright (c) 2015 Inico Technologies Ltd. - * All rights reserved. - * - * 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: Ivan Delamer - * - * - * Please coordinate changes and requests with Ivan Delamer - * - */ - -#ifndef LWIP_HDR_LOWPAN6_OPTS_H -#define LWIP_HDR_LOWPAN6_OPTS_H - -#include "lwip/opt.h" - -#ifndef LWIP_6LOWPAN -#define LWIP_6LOWPAN 0 -#endif - -#ifndef LWIP_6LOWPAN_NUM_CONTEXTS -#define LWIP_6LOWPAN_NUM_CONTEXTS 10 -#endif - -#ifndef LWIP_6LOWPAN_INFER_SHORT_ADDRESS -#define LWIP_6LOWPAN_INFER_SHORT_ADDRESS 1 -#endif - -#ifndef LWIP_6LOWPAN_IPHC -#define LWIP_6LOWPAN_IPHC 1 -#endif - -#ifndef LWIP_6LOWPAN_HW_CRC -#define LWIP_6LOWPAN_HW_CRC 1 -#endif - -#ifndef LOWPAN6_DEBUG -#define LOWPAN6_DEBUG LWIP_DBG_OFF -#endif - -#endif /* LWIP_HDR_LOWPAN6_OPTS_H */ diff --git a/tools/sdk/include/lwip/netif/ppp/ccp.h b/tools/sdk/include/lwip/netif/ppp/ccp.h deleted file mode 100644 index 14dd65962c7..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/ccp.h +++ /dev/null @@ -1,156 +0,0 @@ -/* - * ccp.h - Definitions for PPP Compression Control Protocol. - * - * Copyright (c) 1994-2002 Paul Mackerras. All rights reserved. - * - * 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. The name(s) of the authors of this software must not be used to - * endorse or promote products derived from this software without - * prior written permission. - * - * 3. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by Paul Mackerras - * ". - * - * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * $Id: ccp.h,v 1.12 2004/11/04 10:02:26 paulus Exp $ - */ - -#include "netif/ppp/ppp_opts.h" -#if PPP_SUPPORT && CCP_SUPPORT /* don't build if not configured for use in lwipopts.h */ - -#ifndef CCP_H -#define CCP_H - -/* - * CCP codes. - */ - -#define CCP_CONFREQ 1 -#define CCP_CONFACK 2 -#define CCP_TERMREQ 5 -#define CCP_TERMACK 6 -#define CCP_RESETREQ 14 -#define CCP_RESETACK 15 - -/* - * Max # bytes for a CCP option - */ - -#define CCP_MAX_OPTION_LENGTH 32 - -/* - * Parts of a CCP packet. - */ - -#define CCP_CODE(dp) ((dp)[0]) -#define CCP_ID(dp) ((dp)[1]) -#define CCP_LENGTH(dp) (((dp)[2] << 8) + (dp)[3]) -#define CCP_HDRLEN 4 - -#define CCP_OPT_CODE(dp) ((dp)[0]) -#define CCP_OPT_LENGTH(dp) ((dp)[1]) -#define CCP_OPT_MINLEN 2 - -#if BSDCOMPRESS_SUPPORT -/* - * Definitions for BSD-Compress. - */ - -#define CI_BSD_COMPRESS 21 /* config. option for BSD-Compress */ -#define CILEN_BSD_COMPRESS 3 /* length of config. option */ - -/* Macros for handling the 3rd byte of the BSD-Compress config option. */ -#define BSD_NBITS(x) ((x) & 0x1F) /* number of bits requested */ -#define BSD_VERSION(x) ((x) >> 5) /* version of option format */ -#define BSD_CURRENT_VERSION 1 /* current version number */ -#define BSD_MAKE_OPT(v, n) (((v) << 5) | (n)) - -#define BSD_MIN_BITS 9 /* smallest code size supported */ -#define BSD_MAX_BITS 15 /* largest code size supported */ -#endif /* BSDCOMPRESS_SUPPORT */ - -#if DEFLATE_SUPPORT -/* - * Definitions for Deflate. - */ - -#define CI_DEFLATE 26 /* config option for Deflate */ -#define CI_DEFLATE_DRAFT 24 /* value used in original draft RFC */ -#define CILEN_DEFLATE 4 /* length of its config option */ - -#define DEFLATE_MIN_SIZE 9 -#define DEFLATE_MAX_SIZE 15 -#define DEFLATE_METHOD_VAL 8 -#define DEFLATE_SIZE(x) (((x) >> 4) + 8) -#define DEFLATE_METHOD(x) ((x) & 0x0F) -#define DEFLATE_MAKE_OPT(w) ((((w) - 8) << 4) + DEFLATE_METHOD_VAL) -#define DEFLATE_CHK_SEQUENCE 0 -#endif /* DEFLATE_SUPPORT */ - -#if MPPE_SUPPORT -/* - * Definitions for MPPE. - */ - -#define CI_MPPE 18 /* config option for MPPE */ -#define CILEN_MPPE 6 /* length of config option */ -#endif /* MPPE_SUPPORT */ - -#if PREDICTOR_SUPPORT -/* - * Definitions for other, as yet unsupported, compression methods. - */ - -#define CI_PREDICTOR_1 1 /* config option for Predictor-1 */ -#define CILEN_PREDICTOR_1 2 /* length of its config option */ -#define CI_PREDICTOR_2 2 /* config option for Predictor-2 */ -#define CILEN_PREDICTOR_2 2 /* length of its config option */ -#endif /* PREDICTOR_SUPPORT */ - -typedef struct ccp_options { -#if DEFLATE_SUPPORT - unsigned int deflate :1; /* do Deflate? */ - unsigned int deflate_correct :1; /* use correct code for deflate? */ - unsigned int deflate_draft :1; /* use draft RFC code for deflate? */ -#endif /* DEFLATE_SUPPORT */ -#if BSDCOMPRESS_SUPPORT - unsigned int bsd_compress :1; /* do BSD Compress? */ -#endif /* BSDCOMPRESS_SUPPORT */ -#if PREDICTOR_SUPPORT - unsigned int predictor_1 :1; /* do Predictor-1? */ - unsigned int predictor_2 :1; /* do Predictor-2? */ -#endif /* PREDICTOR_SUPPORT */ - -#if MPPE_SUPPORT - u8_t mppe; /* MPPE bitfield */ -#endif /* MPPE_SUPPORT */ -#if BSDCOMPRESS_SUPPORT - u_short bsd_bits; /* # bits/code for BSD Compress */ -#endif /* BSDCOMPRESS_SUPPORT */ -#if DEFLATE_SUPPORT - u_short deflate_size; /* lg(window size) for Deflate */ -#endif /* DEFLATE_SUPPORT */ - u8_t method; /* code for chosen compression method */ -} ccp_options; - -extern const struct protent ccp_protent; - -void ccp_resetrequest(ppp_pcb *pcb); /* Issue a reset-request. */ - -#endif /* CCP_H */ -#endif /* PPP_SUPPORT && CCP_SUPPORT */ diff --git a/tools/sdk/include/lwip/netif/ppp/chap-md5.h b/tools/sdk/include/lwip/netif/ppp/chap-md5.h deleted file mode 100644 index eb0269fe508..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/chap-md5.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * chap-md5.h - New CHAP/MD5 implementation. - * - * Copyright (c) 2003 Paul Mackerras. All rights reserved. - * - * 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. The name(s) of the authors of this software must not be used to - * endorse or promote products derived from this software without - * prior written permission. - * - * 3. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by Paul Mackerras - * ". - * - * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "netif/ppp/ppp_opts.h" -#if PPP_SUPPORT && CHAP_SUPPORT /* don't build if not configured for use in lwipopts.h */ - -extern const struct chap_digest_type md5_digest; - -#endif /* PPP_SUPPORT && CHAP_SUPPORT */ diff --git a/tools/sdk/include/lwip/netif/ppp/chap-new.h b/tools/sdk/include/lwip/netif/ppp/chap-new.h deleted file mode 100644 index 64eae322029..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/chap-new.h +++ /dev/null @@ -1,192 +0,0 @@ -/* - * chap-new.c - New CHAP implementation. - * - * Copyright (c) 2003 Paul Mackerras. All rights reserved. - * - * 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. The name(s) of the authors of this software must not be used to - * endorse or promote products derived from this software without - * prior written permission. - * - * 3. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by Paul Mackerras - * ". - * - * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "netif/ppp/ppp_opts.h" -#if PPP_SUPPORT && CHAP_SUPPORT /* don't build if not configured for use in lwipopts.h */ - -#ifndef CHAP_H -#define CHAP_H - -#include "ppp.h" - -/* - * CHAP packets begin with a standard header with code, id, len (2 bytes). - */ -#define CHAP_HDRLEN 4 - -/* - * Values for the code field. - */ -#define CHAP_CHALLENGE 1 -#define CHAP_RESPONSE 2 -#define CHAP_SUCCESS 3 -#define CHAP_FAILURE 4 - -/* - * CHAP digest codes. - */ -#define CHAP_MD5 5 -#if MSCHAP_SUPPORT -#define CHAP_MICROSOFT 0x80 -#define CHAP_MICROSOFT_V2 0x81 -#endif /* MSCHAP_SUPPORT */ - -/* - * Semi-arbitrary limits on challenge and response fields. - */ -#define MAX_CHALLENGE_LEN 64 -#define MAX_RESPONSE_LEN 64 - -/* - * These limits apply to challenge and response packets we send. - * The +4 is the +1 that we actually need rounded up. - */ -#define CHAL_MAX_PKTLEN (PPP_HDRLEN + CHAP_HDRLEN + 4 + MAX_CHALLENGE_LEN + MAXNAMELEN) -#define RESP_MAX_PKTLEN (PPP_HDRLEN + CHAP_HDRLEN + 4 + MAX_RESPONSE_LEN + MAXNAMELEN) - -/* bitmask of supported algorithms */ -#if MSCHAP_SUPPORT -#define MDTYPE_MICROSOFT_V2 0x1 -#define MDTYPE_MICROSOFT 0x2 -#endif /* MSCHAP_SUPPORT */ -#define MDTYPE_MD5 0x4 -#define MDTYPE_NONE 0 - -#if MSCHAP_SUPPORT -/* Return the digest alg. ID for the most preferred digest type. */ -#define CHAP_DIGEST(mdtype) \ - ((mdtype) & MDTYPE_MD5)? CHAP_MD5: \ - ((mdtype) & MDTYPE_MICROSOFT_V2)? CHAP_MICROSOFT_V2: \ - ((mdtype) & MDTYPE_MICROSOFT)? CHAP_MICROSOFT: \ - 0 -#else /* !MSCHAP_SUPPORT */ -#define CHAP_DIGEST(mdtype) \ - ((mdtype) & MDTYPE_MD5)? CHAP_MD5: \ - 0 -#endif /* MSCHAP_SUPPORT */ - -/* Return the bit flag (lsb set) for our most preferred digest type. */ -#define CHAP_MDTYPE(mdtype) ((mdtype) ^ ((mdtype) - 1)) & (mdtype) - -/* Return the bit flag for a given digest algorithm ID. */ -#if MSCHAP_SUPPORT -#define CHAP_MDTYPE_D(digest) \ - ((digest) == CHAP_MICROSOFT_V2)? MDTYPE_MICROSOFT_V2: \ - ((digest) == CHAP_MICROSOFT)? MDTYPE_MICROSOFT: \ - ((digest) == CHAP_MD5)? MDTYPE_MD5: \ - 0 -#else /* !MSCHAP_SUPPORT */ -#define CHAP_MDTYPE_D(digest) \ - ((digest) == CHAP_MD5)? MDTYPE_MD5: \ - 0 -#endif /* MSCHAP_SUPPORT */ - -/* Can we do the requested digest? */ -#if MSCHAP_SUPPORT -#define CHAP_CANDIGEST(mdtype, digest) \ - ((digest) == CHAP_MICROSOFT_V2)? (mdtype) & MDTYPE_MICROSOFT_V2: \ - ((digest) == CHAP_MICROSOFT)? (mdtype) & MDTYPE_MICROSOFT: \ - ((digest) == CHAP_MD5)? (mdtype) & MDTYPE_MD5: \ - 0 -#else /* !MSCHAP_SUPPORT */ -#define CHAP_CANDIGEST(mdtype, digest) \ - ((digest) == CHAP_MD5)? (mdtype) & MDTYPE_MD5: \ - 0 -#endif /* MSCHAP_SUPPORT */ - -/* - * The code for each digest type has to supply one of these. - */ -struct chap_digest_type { - int code; - -#if PPP_SERVER - /* - * Note: challenge and response arguments below are formatted as - * a length byte followed by the actual challenge/response data. - */ - void (*generate_challenge)(ppp_pcb *pcb, unsigned char *challenge); - int (*verify_response)(ppp_pcb *pcb, int id, const char *name, - const unsigned char *secret, int secret_len, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space); -#endif /* PPP_SERVER */ - void (*make_response)(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name, - const unsigned char *challenge, const char *secret, int secret_len, - unsigned char *priv); - int (*check_success)(ppp_pcb *pcb, unsigned char *pkt, int len, unsigned char *priv); - void (*handle_failure)(ppp_pcb *pcb, unsigned char *pkt, int len); -}; - -/* - * Each interface is described by chap structure. - */ -#if CHAP_SUPPORT -typedef struct chap_client_state { - u8_t flags; - const char *name; - const struct chap_digest_type *digest; - unsigned char priv[64]; /* private area for digest's use */ -} chap_client_state; - -#if PPP_SERVER -typedef struct chap_server_state { - u8_t flags; - u8_t id; - const char *name; - const struct chap_digest_type *digest; - int challenge_xmits; - int challenge_pktlen; - unsigned char challenge[CHAL_MAX_PKTLEN]; -} chap_server_state; -#endif /* PPP_SERVER */ -#endif /* CHAP_SUPPORT */ - -#if 0 /* UNUSED */ -/* Hook for a plugin to validate CHAP challenge */ -extern int (*chap_verify_hook)(char *name, char *ourname, int id, - const struct chap_digest_type *digest, - unsigned char *challenge, unsigned char *response, - char *message, int message_space); -#endif /* UNUSED */ - -#if PPP_SERVER -/* Called by authentication code to start authenticating the peer. */ -extern void chap_auth_peer(ppp_pcb *pcb, const char *our_name, int digest_code); -#endif /* PPP_SERVER */ - -/* Called by auth. code to start authenticating us to the peer. */ -extern void chap_auth_with_peer(ppp_pcb *pcb, const char *our_name, int digest_code); - -/* Represents the CHAP protocol to the main pppd code */ -extern const struct protent chap_protent; - -#endif /* CHAP_H */ -#endif /* PPP_SUPPORT && CHAP_SUPPORT */ diff --git a/tools/sdk/include/lwip/netif/ppp/chap_ms.h b/tools/sdk/include/lwip/netif/ppp/chap_ms.h deleted file mode 100644 index 0795291158f..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/chap_ms.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * chap_ms.h - Challenge Handshake Authentication Protocol definitions. - * - * Copyright (c) 1995 Eric Rosenquist. All rights reserved. - * - * 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(s) of the authors of this software must not be used to - * endorse or promote products derived from this software without - * prior written permission. - * - * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * $Id: chap_ms.h,v 1.13 2004/11/15 22:13:26 paulus Exp $ - */ - -#include "netif/ppp/ppp_opts.h" -#if PPP_SUPPORT && MSCHAP_SUPPORT /* don't build if not configured for use in lwipopts.h */ - -#ifndef CHAPMS_INCLUDE -#define CHAPMS_INCLUDE - -extern const struct chap_digest_type chapms_digest; -extern const struct chap_digest_type chapms2_digest; - -#endif /* CHAPMS_INCLUDE */ - -#endif /* PPP_SUPPORT && MSCHAP_SUPPORT */ diff --git a/tools/sdk/include/lwip/netif/ppp/eap.h b/tools/sdk/include/lwip/netif/ppp/eap.h deleted file mode 100644 index 3ee9aaf81ae..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/eap.h +++ /dev/null @@ -1,169 +0,0 @@ -/* - * eap.h - Extensible Authentication Protocol for PPP (RFC 2284) - * - * Copyright (c) 2001 by Sun Microsystems, Inc. - * All rights reserved. - * - * Non-exclusive rights to redistribute, modify, translate, and use - * this software in source and binary forms, in whole or in part, is - * hereby granted, provided that the above copyright notice is - * duplicated in any source form, and that neither the name of the - * copyright holder nor the author is used to endorse or promote - * products derived from this software. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * Original version by James Carlson - * - * $Id: eap.h,v 1.2 2003/06/11 23:56:26 paulus Exp $ - */ - -#include "netif/ppp/ppp_opts.h" -#if PPP_SUPPORT && EAP_SUPPORT /* don't build if not configured for use in lwipopts.h */ - -#ifndef PPP_EAP_H -#define PPP_EAP_H - -#include "ppp.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Packet header = Code, id, length. - */ -#define EAP_HEADERLEN 4 - - -/* EAP message codes. */ -#define EAP_REQUEST 1 -#define EAP_RESPONSE 2 -#define EAP_SUCCESS 3 -#define EAP_FAILURE 4 - -/* EAP types */ -#define EAPT_IDENTITY 1 -#define EAPT_NOTIFICATION 2 -#define EAPT_NAK 3 /* (response only) */ -#define EAPT_MD5CHAP 4 -#define EAPT_OTP 5 /* One-Time Password; RFC 1938 */ -#define EAPT_TOKEN 6 /* Generic Token Card */ -/* 7 and 8 are unassigned. */ -#define EAPT_RSA 9 /* RSA Public Key Authentication */ -#define EAPT_DSS 10 /* DSS Unilateral */ -#define EAPT_KEA 11 /* KEA */ -#define EAPT_KEA_VALIDATE 12 /* KEA-VALIDATE */ -#define EAPT_TLS 13 /* EAP-TLS */ -#define EAPT_DEFENDER 14 /* Defender Token (AXENT) */ -#define EAPT_W2K 15 /* Windows 2000 EAP */ -#define EAPT_ARCOT 16 /* Arcot Systems */ -#define EAPT_CISCOWIRELESS 17 /* Cisco Wireless */ -#define EAPT_NOKIACARD 18 /* Nokia IP smart card */ -#define EAPT_SRP 19 /* Secure Remote Password */ -/* 20 is deprecated */ - -/* EAP SRP-SHA1 Subtypes */ -#define EAPSRP_CHALLENGE 1 /* Request 1 - Challenge */ -#define EAPSRP_CKEY 1 /* Response 1 - Client Key */ -#define EAPSRP_SKEY 2 /* Request 2 - Server Key */ -#define EAPSRP_CVALIDATOR 2 /* Response 2 - Client Validator */ -#define EAPSRP_SVALIDATOR 3 /* Request 3 - Server Validator */ -#define EAPSRP_ACK 3 /* Response 3 - final ack */ -#define EAPSRP_LWRECHALLENGE 4 /* Req/resp 4 - Lightweight rechal */ - -#define SRPVAL_EBIT 0x00000001 /* Use shared key for ECP */ - -#define SRP_PSEUDO_ID "pseudo_" -#define SRP_PSEUDO_LEN 7 - -#define MD5_SIGNATURE_SIZE 16 -#define EAP_MIN_CHALLENGE_LENGTH 17 -#define EAP_MAX_CHALLENGE_LENGTH 24 -#define EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH 3 /* 2^3-1 = 7, 17+7 = 24 */ - -#define EAP_STATES \ - "Initial", "Pending", "Closed", "Listen", "Identify", \ - "SRP1", "SRP2", "SRP3", "MD5Chall", "Open", "SRP4", "BadAuth" - -#define eap_client_active(pcb) ((pcb)->eap.es_client.ea_state == eapListen) -#if PPP_SERVER -#define eap_server_active(pcb) \ - ((pcb)->eap.es_server.ea_state >= eapIdentify && \ - (pcb)->eap.es_server.ea_state <= eapMD5Chall) -#endif /* PPP_SERVER */ - -/* - * Complete EAP state for one PPP session. - */ -enum eap_state_code { - eapInitial = 0, /* No EAP authentication yet requested */ - eapPending, /* Waiting for LCP (no timer) */ - eapClosed, /* Authentication not in use */ - eapListen, /* Client ready (and timer running) */ - eapIdentify, /* EAP Identify sent */ - eapSRP1, /* Sent EAP SRP-SHA1 Subtype 1 */ - eapSRP2, /* Sent EAP SRP-SHA1 Subtype 2 */ - eapSRP3, /* Sent EAP SRP-SHA1 Subtype 3 */ - eapMD5Chall, /* Sent MD5-Challenge */ - eapOpen, /* Completed authentication */ - eapSRP4, /* Sent EAP SRP-SHA1 Subtype 4 */ - eapBadAuth /* Failed authentication */ -}; - -struct eap_auth { - const char *ea_name; /* Our name */ - char ea_peer[MAXNAMELEN +1]; /* Peer's name */ - void *ea_session; /* Authentication library linkage */ - u_char *ea_skey; /* Shared encryption key */ - u_short ea_namelen; /* Length of our name */ - u_short ea_peerlen; /* Length of peer's name */ - enum eap_state_code ea_state; - u_char ea_id; /* Current id */ - u_char ea_requests; /* Number of Requests sent/received */ - u_char ea_responses; /* Number of Responses */ - u_char ea_type; /* One of EAPT_* */ - u32_t ea_keyflags; /* SRP shared key usage flags */ -}; - -#ifndef EAP_MAX_CHALLENGE_LENGTH -#define EAP_MAX_CHALLENGE_LENGTH 24 -#endif -typedef struct eap_state { - struct eap_auth es_client; /* Client (authenticatee) data */ -#if PPP_SERVER - struct eap_auth es_server; /* Server (authenticator) data */ -#endif /* PPP_SERVER */ - int es_savedtime; /* Saved timeout */ - int es_rechallenge; /* EAP rechallenge interval */ - int es_lwrechallenge; /* SRP lightweight rechallenge inter */ - u8_t es_usepseudo; /* Use SRP Pseudonym if offered one */ - int es_usedpseudo; /* Set if we already sent PN */ - int es_challen; /* Length of challenge string */ - u_char es_challenge[EAP_MAX_CHALLENGE_LENGTH]; -} eap_state; - -/* - * Timeouts. - */ -#if 0 /* moved to ppp_opts.h */ -#define EAP_DEFTIMEOUT 3 /* Timeout (seconds) for rexmit */ -#define EAP_DEFTRANSMITS 10 /* max # times to transmit */ -#define EAP_DEFREQTIME 20 /* Time to wait for peer request */ -#define EAP_DEFALLOWREQ 20 /* max # times to accept requests */ -#endif /* moved to ppp_opts.h */ - -void eap_authwithpeer(ppp_pcb *pcb, const char *localname); -void eap_authpeer(ppp_pcb *pcb, const char *localname); - -extern const struct protent eap_protent; - -#ifdef __cplusplus -} -#endif - -#endif /* PPP_EAP_H */ - -#endif /* PPP_SUPPORT && EAP_SUPPORT */ diff --git a/tools/sdk/include/lwip/netif/ppp/ecp.h b/tools/sdk/include/lwip/netif/ppp/ecp.h deleted file mode 100644 index 5cdce29d5b2..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/ecp.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * ecp.h - Definitions for PPP Encryption Control Protocol. - * - * Copyright (c) 2002 Google, Inc. - * All rights reserved. - * - * 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(s) of the authors of this software must not be used to - * endorse or promote products derived from this software without - * prior written permission. - * - * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * $Id: ecp.h,v 1.2 2003/01/10 07:12:36 fcusack Exp $ - */ - -#include "netif/ppp/ppp_opts.h" -#if PPP_SUPPORT && ECP_SUPPORT /* don't build if not configured for use in lwipopts.h */ - -typedef struct ecp_options { - bool required; /* Is ECP required? */ - unsigned enctype; /* Encryption type */ -} ecp_options; - -extern fsm ecp_fsm[]; -extern ecp_options ecp_wantoptions[]; -extern ecp_options ecp_gotoptions[]; -extern ecp_options ecp_allowoptions[]; -extern ecp_options ecp_hisoptions[]; - -extern const struct protent ecp_protent; - -#endif /* PPP_SUPPORT && ECP_SUPPORT */ diff --git a/tools/sdk/include/lwip/netif/ppp/eui64.h b/tools/sdk/include/lwip/netif/ppp/eui64.h deleted file mode 100644 index 20ac22eede7..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/eui64.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * eui64.h - EUI64 routines for IPv6CP. - * - * Copyright (c) 1999 Tommi Komulainen. All rights reserved. - * - * 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(s) of the authors of this software must not be used to - * endorse or promote products derived from this software without - * prior written permission. - * - * 4. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by Tommi Komulainen - * ". - * - * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * $Id: eui64.h,v 1.6 2002/12/04 23:03:32 paulus Exp $ -*/ - -#include "netif/ppp/ppp_opts.h" -#if PPP_SUPPORT && PPP_IPV6_SUPPORT /* don't build if not configured for use in lwipopts.h */ - -#ifndef EUI64_H -#define EUI64_H - -/* - * @todo: - * - * Maybe this should be done by processing struct in6_addr directly... - */ -typedef union -{ - u8_t e8[8]; - u16_t e16[4]; - u32_t e32[2]; -} eui64_t; - -#define eui64_iszero(e) (((e).e32[0] | (e).e32[1]) == 0) -#define eui64_equals(e, o) (((e).e32[0] == (o).e32[0]) && \ - ((e).e32[1] == (o).e32[1])) -#define eui64_zero(e) (e).e32[0] = (e).e32[1] = 0; - -#define eui64_copy(s, d) memcpy(&(d), &(s), sizeof(eui64_t)) - -#define eui64_magic(e) do { \ - (e).e32[0] = magic(); \ - (e).e32[1] = magic(); \ - (e).e8[0] &= ~2; \ - } while (0) -#define eui64_magic_nz(x) do { \ - eui64_magic(x); \ - } while (eui64_iszero(x)) -#define eui64_magic_ne(x, y) do { \ - eui64_magic(x); \ - } while (eui64_equals(x, y)) - -#define eui64_get(ll, cp) do { \ - eui64_copy((*cp), (ll)); \ - (cp) += sizeof(eui64_t); \ - } while (0) - -#define eui64_put(ll, cp) do { \ - eui64_copy((ll), (*cp)); \ - (cp) += sizeof(eui64_t); \ - } while (0) - -#define eui64_set32(e, l) do { \ - (e).e32[0] = 0; \ - (e).e32[1] = lwip_htonl(l); \ - } while (0) -#define eui64_setlo32(e, l) eui64_set32(e, l) - -char *eui64_ntoa(eui64_t); /* Returns ascii representation of id */ - -#endif /* EUI64_H */ -#endif /* PPP_SUPPORT && PPP_IPV6_SUPPORT */ diff --git a/tools/sdk/include/lwip/netif/ppp/fsm.h b/tools/sdk/include/lwip/netif/ppp/fsm.h deleted file mode 100644 index b6915d3b807..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/fsm.h +++ /dev/null @@ -1,175 +0,0 @@ -/* - * fsm.h - {Link, IP} Control Protocol Finite State Machine definitions. - * - * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved. - * - * 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 "Carnegie Mellon University" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For permission or any legal - * details, please contact - * Office of Technology Transfer - * Carnegie Mellon University - * 5000 Forbes Avenue - * Pittsburgh, PA 15213-3890 - * (412) 268-4387, fax: (412) 268-7395 - * tech-transfer@andrew.cmu.edu - * - * 4. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by Computing Services - * at Carnegie Mellon University (http://www.cmu.edu/computing/)." - * - * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE - * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * $Id: fsm.h,v 1.10 2004/11/13 02:28:15 paulus Exp $ - */ - -#include "netif/ppp/ppp_opts.h" -#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ - -#ifndef FSM_H -#define FSM_H - -#include "ppp.h" - -/* - * Packet header = Code, id, length. - */ -#define HEADERLEN 4 - - -/* - * CP (LCP, IPCP, etc.) codes. - */ -#define CONFREQ 1 /* Configuration Request */ -#define CONFACK 2 /* Configuration Ack */ -#define CONFNAK 3 /* Configuration Nak */ -#define CONFREJ 4 /* Configuration Reject */ -#define TERMREQ 5 /* Termination Request */ -#define TERMACK 6 /* Termination Ack */ -#define CODEREJ 7 /* Code Reject */ - - -/* - * Each FSM is described by an fsm structure and fsm callbacks. - */ -typedef struct fsm { - ppp_pcb *pcb; /* PPP Interface */ - const struct fsm_callbacks *callbacks; /* Callback routines */ - const char *term_reason; /* Reason for closing protocol */ - u8_t seen_ack; /* Have received valid Ack/Nak/Rej to Req */ - /* -- This is our only flag, we might use u_int :1 if we have more flags */ - u16_t protocol; /* Data Link Layer Protocol field value */ - u8_t state; /* State */ - u8_t flags; /* Contains option bits */ - u8_t id; /* Current id */ - u8_t reqid; /* Current request id */ - u8_t retransmits; /* Number of retransmissions left */ - u8_t nakloops; /* Number of nak loops since last ack */ - u8_t rnakloops; /* Number of naks received */ - u8_t maxnakloops; /* Maximum number of nak loops tolerated - (necessary because IPCP require a custom large max nak loops value) */ - u8_t term_reason_len; /* Length of term_reason */ -} fsm; - - -typedef struct fsm_callbacks { - void (*resetci) /* Reset our Configuration Information */ - (fsm *); - int (*cilen) /* Length of our Configuration Information */ - (fsm *); - void (*addci) /* Add our Configuration Information */ - (fsm *, u_char *, int *); - int (*ackci) /* ACK our Configuration Information */ - (fsm *, u_char *, int); - int (*nakci) /* NAK our Configuration Information */ - (fsm *, u_char *, int, int); - int (*rejci) /* Reject our Configuration Information */ - (fsm *, u_char *, int); - int (*reqci) /* Request peer's Configuration Information */ - (fsm *, u_char *, int *, int); - void (*up) /* Called when fsm reaches PPP_FSM_OPENED state */ - (fsm *); - void (*down) /* Called when fsm leaves PPP_FSM_OPENED state */ - (fsm *); - void (*starting) /* Called when we want the lower layer */ - (fsm *); - void (*finished) /* Called when we don't want the lower layer */ - (fsm *); - void (*protreject) /* Called when Protocol-Reject received */ - (int); - void (*retransmit) /* Retransmission is necessary */ - (fsm *); - int (*extcode) /* Called when unknown code received */ - (fsm *, int, int, u_char *, int); - const char *proto_name; /* String name for protocol (for messages) */ -} fsm_callbacks; - - -/* - * Link states. - */ -#define PPP_FSM_INITIAL 0 /* Down, hasn't been opened */ -#define PPP_FSM_STARTING 1 /* Down, been opened */ -#define PPP_FSM_CLOSED 2 /* Up, hasn't been opened */ -#define PPP_FSM_STOPPED 3 /* Open, waiting for down event */ -#define PPP_FSM_CLOSING 4 /* Terminating the connection, not open */ -#define PPP_FSM_STOPPING 5 /* Terminating, but open */ -#define PPP_FSM_REQSENT 6 /* We've sent a Config Request */ -#define PPP_FSM_ACKRCVD 7 /* We've received a Config Ack */ -#define PPP_FSM_ACKSENT 8 /* We've sent a Config Ack */ -#define PPP_FSM_OPENED 9 /* Connection available */ - - -/* - * Flags - indicate options controlling FSM operation - */ -#define OPT_PASSIVE 1 /* Don't die if we don't get a response */ -#define OPT_RESTART 2 /* Treat 2nd OPEN as DOWN, UP */ -#define OPT_SILENT 4 /* Wait for peer to speak first */ - - -/* - * Timeouts. - */ -#if 0 /* moved to ppp_opts.h */ -#define DEFTIMEOUT 3 /* Timeout time in seconds */ -#define DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */ -#define DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */ -#define DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */ -#endif /* moved to ppp_opts.h */ - - -/* - * Prototypes - */ -void fsm_init(fsm *f); -void fsm_lowerup(fsm *f); -void fsm_lowerdown(fsm *f); -void fsm_open(fsm *f); -void fsm_close(fsm *f, const char *reason); -void fsm_input(fsm *f, u_char *inpacket, int l); -void fsm_protreject(fsm *f); -void fsm_sdata(fsm *f, u_char code, u_char id, const u_char *data, int datalen); - - -#endif /* FSM_H */ -#endif /* PPP_SUPPORT */ diff --git a/tools/sdk/include/lwip/netif/ppp/ipcp.h b/tools/sdk/include/lwip/netif/ppp/ipcp.h deleted file mode 100644 index 45f46b31ff6..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/ipcp.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * ipcp.h - IP Control Protocol definitions. - * - * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved. - * - * 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 "Carnegie Mellon University" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For permission or any legal - * details, please contact - * Office of Technology Transfer - * Carnegie Mellon University - * 5000 Forbes Avenue - * Pittsburgh, PA 15213-3890 - * (412) 268-4387, fax: (412) 268-7395 - * tech-transfer@andrew.cmu.edu - * - * 4. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by Computing Services - * at Carnegie Mellon University (http://www.cmu.edu/computing/)." - * - * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE - * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * $Id: ipcp.h,v 1.14 2002/12/04 23:03:32 paulus Exp $ - */ - -#include "netif/ppp/ppp_opts.h" -#if PPP_SUPPORT && PPP_IPV4_SUPPORT /* don't build if not configured for use in lwipopts.h */ - -#ifndef IPCP_H -#define IPCP_H - -/* - * Options. - */ -#define CI_ADDRS 1 /* IP Addresses */ -#if VJ_SUPPORT -#define CI_COMPRESSTYPE 2 /* Compression Type */ -#endif /* VJ_SUPPORT */ -#define CI_ADDR 3 - -#if LWIP_DNS -#define CI_MS_DNS1 129 /* Primary DNS value */ -#define CI_MS_DNS2 131 /* Secondary DNS value */ -#endif /* LWIP_DNS */ -#if 0 /* UNUSED - WINS */ -#define CI_MS_WINS1 130 /* Primary WINS value */ -#define CI_MS_WINS2 132 /* Secondary WINS value */ -#endif /* UNUSED - WINS */ - -#if VJ_SUPPORT -#define MAX_STATES 16 /* from slcompress.h */ - -#define IPCP_VJMODE_OLD 1 /* "old" mode (option # = 0x0037) */ -#define IPCP_VJMODE_RFC1172 2 /* "old-rfc"mode (option # = 0x002d) */ -#define IPCP_VJMODE_RFC1332 3 /* "new-rfc"mode (option # = 0x002d, */ - /* maxslot and slot number compression) */ - -#define IPCP_VJ_COMP 0x002d /* current value for VJ compression option*/ -#define IPCP_VJ_COMP_OLD 0x0037 /* "old" (i.e, broken) value for VJ */ - /* compression option*/ -#endif /* VJ_SUPPORT */ - -typedef struct ipcp_options { - unsigned int neg_addr :1; /* Negotiate IP Address? */ - unsigned int old_addrs :1; /* Use old (IP-Addresses) option? */ - unsigned int req_addr :1; /* Ask peer to send IP address? */ -#if 0 /* UNUSED */ - unsigned int default_route :1; /* Assign default route through interface? */ - unsigned int replace_default_route :1; /* Replace default route through interface? */ -#endif /* UNUSED */ -#if 0 /* UNUSED - PROXY ARP */ - unsigned int proxy_arp :1; /* Make proxy ARP entry for peer? */ -#endif /* UNUSED - PROXY ARP */ -#if VJ_SUPPORT - unsigned int neg_vj :1; /* Van Jacobson Compression? */ - unsigned int old_vj :1; /* use old (short) form of VJ option? */ - unsigned int cflag :1; -#endif /* VJ_SUPPORT */ - unsigned int accept_local :1; /* accept peer's value for ouraddr */ - unsigned int accept_remote :1; /* accept peer's value for hisaddr */ -#if LWIP_DNS - unsigned int req_dns1 :1; /* Ask peer to send primary DNS address? */ - unsigned int req_dns2 :1; /* Ask peer to send secondary DNS address? */ -#endif /* LWIP_DNS */ - - u32_t ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */ -#if LWIP_DNS - u32_t dnsaddr[2]; /* Primary and secondary MS DNS entries */ -#endif /* LWIP_DNS */ -#if 0 /* UNUSED - WINS */ - u32_t winsaddr[2]; /* Primary and secondary MS WINS entries */ -#endif /* UNUSED - WINS */ - -#if VJ_SUPPORT - u16_t vj_protocol; /* protocol value to use in VJ option */ - u8_t maxslotindex; /* values for RFC1332 VJ compression neg. */ -#endif /* VJ_SUPPORT */ -} ipcp_options; - -#if 0 /* UNUSED, already defined by lwIP */ -char *ip_ntoa (u32_t); -#endif /* UNUSED, already defined by lwIP */ - -extern const struct protent ipcp_protent; - -#endif /* IPCP_H */ -#endif /* PPP_SUPPORT && PPP_IPV4_SUPPORT */ diff --git a/tools/sdk/include/lwip/netif/ppp/ipv6cp.h b/tools/sdk/include/lwip/netif/ppp/ipv6cp.h deleted file mode 100644 index 07d1ae31867..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/ipv6cp.h +++ /dev/null @@ -1,183 +0,0 @@ -/* - * ipv6cp.h - PPP IPV6 Control Protocol. - * - * Copyright (c) 1999 Tommi Komulainen. All rights reserved. - * - * 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(s) of the authors of this software must not be used to - * endorse or promote products derived from this software without - * prior written permission. - * - * 4. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by Tommi Komulainen - * ". - * - * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - */ - -/* Original version, based on RFC2023 : - - Copyright (c) 1995, 1996, 1997 Francis.Dupont@inria.fr, INRIA Rocquencourt, - Alain.Durand@imag.fr, IMAG, - Jean-Luc.Richier@imag.fr, IMAG-LSR. - - Copyright (c) 1998, 1999 Francis.Dupont@inria.fr, GIE DYADE, - Alain.Durand@imag.fr, IMAG, - Jean-Luc.Richier@imag.fr, IMAG-LSR. - - Ce travail a été fait au sein du GIE DYADE (Groupement d'Intérêt - Économique ayant pour membres BULL S.A. et l'INRIA). - - Ce logiciel informatique est disponible aux conditions - usuelles dans la recherche, c'est-à-dire qu'il peut - être utilisé, copié, modifié, distribué à l'unique - condition que ce texte soit conservé afin que - l'origine de ce logiciel soit reconnue. - - Le nom de l'Institut National de Recherche en Informatique - et en Automatique (INRIA), de l'IMAG, ou d'une personne morale - ou physique ayant participé à l'élaboration de ce logiciel ne peut - être utilisé sans son accord préalable explicite. - - Ce logiciel est fourni tel quel sans aucune garantie, - support ou responsabilité d'aucune sorte. - Ce logiciel est dérivé de sources d'origine - "University of California at Berkeley" et - "Digital Equipment Corporation" couvertes par des copyrights. - - L'Institut d'Informatique et de Mathématiques Appliquées de Grenoble (IMAG) - est une fédération d'unités mixtes de recherche du CNRS, de l'Institut National - Polytechnique de Grenoble et de l'Université Joseph Fourier regroupant - sept laboratoires dont le laboratoire Logiciels, Systèmes, Réseaux (LSR). - - This work has been done in the context of GIE DYADE (joint R & D venture - between BULL S.A. and INRIA). - - This software is available with usual "research" terms - with the aim of retain credits of the software. - Permission to use, copy, modify and distribute this software for any - purpose and without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies, - and the name of INRIA, IMAG, or any contributor not be used in advertising - or publicity pertaining to this material without the prior explicit - permission. The software is provided "as is" without any - warranties, support or liabilities of any kind. - This software is derived from source code from - "University of California at Berkeley" and - "Digital Equipment Corporation" protected by copyrights. - - Grenoble's Institute of Computer Science and Applied Mathematics (IMAG) - is a federation of seven research units funded by the CNRS, National - Polytechnic Institute of Grenoble and University Joseph Fourier. - The research unit in Software, Systems, Networks (LSR) is member of IMAG. -*/ - -/* - * Derived from : - * - * - * ipcp.h - IP Control Protocol definitions. - * - * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved. - * - * 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 "Carnegie Mellon University" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For permission or any legal - * details, please contact - * Office of Technology Transfer - * Carnegie Mellon University - * 5000 Forbes Avenue - * Pittsburgh, PA 15213-3890 - * (412) 268-4387, fax: (412) 268-7395 - * tech-transfer@andrew.cmu.edu - * - * 4. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by Computing Services - * at Carnegie Mellon University (http://www.cmu.edu/computing/)." - * - * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE - * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * $Id: ipv6cp.h,v 1.7 2002/12/04 23:03:32 paulus Exp $ - */ - -#include "netif/ppp/ppp_opts.h" -#if PPP_SUPPORT && PPP_IPV6_SUPPORT /* don't build if not configured for use in lwipopts.h */ - -#ifndef IPV6CP_H -#define IPV6CP_H - -#include "eui64.h" - -/* - * Options. - */ -#define CI_IFACEID 1 /* Interface Identifier */ -#ifdef IPV6CP_COMP -#define CI_COMPRESSTYPE 2 /* Compression Type */ -#endif /* IPV6CP_COMP */ - -/* No compression types yet defined. - *#define IPV6CP_COMP 0x004f - */ -typedef struct ipv6cp_options { - unsigned int neg_ifaceid :1; /* Negotiate interface identifier? */ - unsigned int req_ifaceid :1; /* Ask peer to send interface identifier? */ - unsigned int accept_local :1; /* accept peer's value for iface id? */ - unsigned int opt_local :1; /* ourtoken set by option */ - unsigned int opt_remote :1; /* histoken set by option */ - unsigned int use_ip :1; /* use IP as interface identifier */ -#if 0 - unsigned int use_persistent :1; /* use uniquely persistent value for address */ -#endif -#ifdef IPV6CP_COMP - unsigned int neg_vj :1; /* Van Jacobson Compression? */ -#endif /* IPV6CP_COMP */ - -#ifdef IPV6CP_COMP - u_short vj_protocol; /* protocol value to use in VJ option */ -#endif /* IPV6CP_COMP */ - eui64_t ourid, hisid; /* Interface identifiers */ -} ipv6cp_options; - -extern const struct protent ipv6cp_protent; - -#endif /* IPV6CP_H */ -#endif /* PPP_SUPPORT && PPP_IPV6_SUPPORT */ diff --git a/tools/sdk/include/lwip/netif/ppp/lcp.h b/tools/sdk/include/lwip/netif/ppp/lcp.h deleted file mode 100644 index 12e2a05fc90..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/lcp.h +++ /dev/null @@ -1,171 +0,0 @@ -/* - * lcp.h - Link Control Protocol definitions. - * - * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved. - * - * 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 "Carnegie Mellon University" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For permission or any legal - * details, please contact - * Office of Technology Transfer - * Carnegie Mellon University - * 5000 Forbes Avenue - * Pittsburgh, PA 15213-3890 - * (412) 268-4387, fax: (412) 268-7395 - * tech-transfer@andrew.cmu.edu - * - * 4. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by Computing Services - * at Carnegie Mellon University (http://www.cmu.edu/computing/)." - * - * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE - * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * $Id: lcp.h,v 1.20 2004/11/14 22:53:42 carlsonj Exp $ - */ - -#include "netif/ppp/ppp_opts.h" -#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ - -#ifndef LCP_H -#define LCP_H - -#include "ppp.h" - -/* - * Options. - */ -#define CI_VENDOR 0 /* Vendor Specific */ -#define CI_MRU 1 /* Maximum Receive Unit */ -#define CI_ASYNCMAP 2 /* Async Control Character Map */ -#define CI_AUTHTYPE 3 /* Authentication Type */ -#define CI_QUALITY 4 /* Quality Protocol */ -#define CI_MAGICNUMBER 5 /* Magic Number */ -#define CI_PCOMPRESSION 7 /* Protocol Field Compression */ -#define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */ -#define CI_FCSALTERN 9 /* FCS-Alternatives */ -#define CI_SDP 10 /* Self-Describing-Pad */ -#define CI_NUMBERED 11 /* Numbered-Mode */ -#define CI_CALLBACK 13 /* callback */ -#define CI_MRRU 17 /* max reconstructed receive unit; multilink */ -#define CI_SSNHF 18 /* short sequence numbers for multilink */ -#define CI_EPDISC 19 /* endpoint discriminator */ -#define CI_MPPLUS 22 /* Multi-Link-Plus-Procedure */ -#define CI_LDISC 23 /* Link-Discriminator */ -#define CI_LCPAUTH 24 /* LCP Authentication */ -#define CI_COBS 25 /* Consistent Overhead Byte Stuffing */ -#define CI_PREFELIS 26 /* Prefix Elision */ -#define CI_MPHDRFMT 27 /* MP Header Format */ -#define CI_I18N 28 /* Internationalization */ -#define CI_SDL 29 /* Simple Data Link */ - -/* - * LCP-specific packet types (code numbers). - */ -#define PROTREJ 8 /* Protocol Reject */ -#define ECHOREQ 9 /* Echo Request */ -#define ECHOREP 10 /* Echo Reply */ -#define DISCREQ 11 /* Discard Request */ -#define IDENTIF 12 /* Identification */ -#define TIMEREM 13 /* Time Remaining */ - -/* Value used as data for CI_CALLBACK option */ -#define CBCP_OPT 6 /* Use callback control protocol */ - -#if 0 /* moved to ppp_opts.h */ -#define DEFMRU 1500 /* Try for this */ -#define MINMRU 128 /* No MRUs below this */ -#define MAXMRU 16384 /* Normally limit MRU to this */ -#endif /* moved to ppp_opts.h */ - -/* An endpoint discriminator, used with multilink. */ -#define MAX_ENDP_LEN 20 /* maximum length of discriminator value */ -struct epdisc { - unsigned char class_; /* -- The word "class" is reserved in C++. */ - unsigned char length; - unsigned char value[MAX_ENDP_LEN]; -}; - -/* - * The state of options is described by an lcp_options structure. - */ -typedef struct lcp_options { - unsigned int passive :1; /* Don't die if we don't get a response */ - unsigned int silent :1; /* Wait for the other end to start first */ -#if 0 /* UNUSED */ - unsigned int restart :1; /* Restart vs. exit after close */ -#endif /* UNUSED */ - unsigned int neg_mru :1; /* Negotiate the MRU? */ - unsigned int neg_asyncmap :1; /* Negotiate the async map? */ -#if PAP_SUPPORT - unsigned int neg_upap :1; /* Ask for UPAP authentication? */ -#endif /* PAP_SUPPORT */ -#if CHAP_SUPPORT - unsigned int neg_chap :1; /* Ask for CHAP authentication? */ -#endif /* CHAP_SUPPORT */ -#if EAP_SUPPORT - unsigned int neg_eap :1; /* Ask for EAP authentication? */ -#endif /* EAP_SUPPORT */ - unsigned int neg_magicnumber :1; /* Ask for magic number? */ - unsigned int neg_pcompression :1; /* HDLC Protocol Field Compression? */ - unsigned int neg_accompression :1; /* HDLC Address/Control Field Compression? */ -#if LQR_SUPPORT - unsigned int neg_lqr :1; /* Negotiate use of Link Quality Reports */ -#endif /* LQR_SUPPORT */ - unsigned int neg_cbcp :1; /* Negotiate use of CBCP */ -#ifdef HAVE_MULTILINK - unsigned int neg_mrru :1; /* negotiate multilink MRRU */ -#endif /* HAVE_MULTILINK */ - unsigned int neg_ssnhf :1; /* negotiate short sequence numbers */ - unsigned int neg_endpoint :1; /* negotiate endpoint discriminator */ - - u16_t mru; /* Value of MRU */ -#ifdef HAVE_MULTILINK - u16_t mrru; /* Value of MRRU, and multilink enable */ -#endif /* MULTILINK */ -#if CHAP_SUPPORT - u8_t chap_mdtype; /* which MD types (hashing algorithm) */ -#endif /* CHAP_SUPPORT */ - u32_t asyncmap; /* Value of async map */ - u32_t magicnumber; - u8_t numloops; /* Number of loops during magic number neg. */ -#if LQR_SUPPORT - u32_t lqr_period; /* Reporting period for LQR 1/100ths second */ -#endif /* LQR_SUPPORT */ - struct epdisc endpoint; /* endpoint discriminator */ -} lcp_options; - -void lcp_open(ppp_pcb *pcb); -void lcp_close(ppp_pcb *pcb, const char *reason); -void lcp_lowerup(ppp_pcb *pcb); -void lcp_lowerdown(ppp_pcb *pcb); -void lcp_sprotrej(ppp_pcb *pcb, u_char *p, int len); /* send protocol reject */ - -extern const struct protent lcp_protent; - -#if 0 /* moved to ppp_opts.h */ -/* Default number of times we receive our magic number from the peer - before deciding the link is looped-back. */ -#define DEFLOOPBACKFAIL 10 -#endif /* moved to ppp_opts.h */ - -#endif /* LCP_H */ -#endif /* PPP_SUPPORT */ diff --git a/tools/sdk/include/lwip/netif/ppp/magic.h b/tools/sdk/include/lwip/netif/ppp/magic.h deleted file mode 100644 index a2a9b530e58..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/magic.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - * magic.h - PPP Magic Number definitions. - * - * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved. - * - * 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 "Carnegie Mellon University" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For permission or any legal - * details, please contact - * Office of Technology Transfer - * Carnegie Mellon University - * 5000 Forbes Avenue - * Pittsburgh, PA 15213-3890 - * (412) 268-4387, fax: (412) 268-7395 - * tech-transfer@andrew.cmu.edu - * - * 4. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by Computing Services - * at Carnegie Mellon University (http://www.cmu.edu/computing/)." - * - * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE - * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * $Id: magic.h,v 1.5 2003/06/11 23:56:26 paulus Exp $ - */ -/***************************************************************************** -* randm.h - Random number generator header file. -* -* Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc. -* Copyright (c) 1998 Global Election Systems Inc. -* -* The authors hereby grant permission to use, copy, modify, distribute, -* and license this software and its documentation for any purpose, provided -* that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any -* distributions. No written agreement, license, or royalty fee is required -* for any of the authorized uses. -* -* THIS SOFTWARE IS PROVIDED BY THE 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 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. -* -****************************************************************************** -* REVISION HISTORY -* -* 03-01-01 Marc Boucher -* Ported to lwIP. -* 98-05-29 Guy Lancaster , Global Election Systems Inc. -* Extracted from avos. -*****************************************************************************/ - -#include "netif/ppp/ppp_opts.h" -#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ - -#ifndef MAGIC_H -#define MAGIC_H - -/*********************** -*** PUBLIC FUNCTIONS *** -***********************/ - -/* - * Initialize the random number generator. - */ -void magic_init(void); - -/* - * Randomize our random seed value. To be called for truely random events - * such as user operations and network traffic. - */ -void magic_randomize(void); - -/* - * Return a new random number. - */ -u32_t magic(void); /* Returns the next magic number */ - -/* - * Fill buffer with random bytes - * - * Use the random pool to generate random data. This degrades to pseudo - * random when used faster than randomness is supplied using magic_churnrand(). - * Thus it's important to make sure that the results of this are not - * published directly because one could predict the next result to at - * least some degree. Also, it's important to get a good seed before - * the first use. - */ -void magic_random_bytes(unsigned char *buf, u32_t buf_len); - -/* - * Return a new random number between 0 and (2^pow)-1 included. - */ -u32_t magic_pow(u8_t pow); - -#endif /* MAGIC_H */ - -#endif /* PPP_SUPPORT */ diff --git a/tools/sdk/include/lwip/netif/ppp/mppe.h b/tools/sdk/include/lwip/netif/ppp/mppe.h deleted file mode 100644 index 1ae8a5d9247..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/mppe.h +++ /dev/null @@ -1,173 +0,0 @@ -/* - * mppe.h - Definitions for MPPE - * - * Copyright (c) 2008 Paul Mackerras. All rights reserved. - * - * 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(s) of the authors of this software must not be used to - * endorse or promote products derived from this software without - * prior written permission. - * - * 4. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by Paul Mackerras - * ". - * - * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "netif/ppp/ppp_opts.h" -#if PPP_SUPPORT && MPPE_SUPPORT /* don't build if not configured for use in lwipopts.h */ - -#ifndef MPPE_H -#define MPPE_H - -#include "netif/ppp/pppcrypt.h" - -#define MPPE_PAD 4 /* MPPE growth per frame */ -#define MPPE_MAX_KEY_LEN 16 /* largest key length (128-bit) */ - -/* option bits for ccp_options.mppe */ -#define MPPE_OPT_40 0x01 /* 40 bit */ -#define MPPE_OPT_128 0x02 /* 128 bit */ -#define MPPE_OPT_STATEFUL 0x04 /* stateful mode */ -/* unsupported opts */ -#define MPPE_OPT_56 0x08 /* 56 bit */ -#define MPPE_OPT_MPPC 0x10 /* MPPC compression */ -#define MPPE_OPT_D 0x20 /* Unknown */ -#define MPPE_OPT_UNSUPPORTED (MPPE_OPT_56|MPPE_OPT_MPPC|MPPE_OPT_D) -#define MPPE_OPT_UNKNOWN 0x40 /* Bits !defined in RFC 3078 were set */ - -/* - * This is not nice ... the alternative is a bitfield struct though. - * And unfortunately, we cannot share the same bits for the option - * names above since C and H are the same bit. We could do a u_int32 - * but then we have to do a lwip_htonl() all the time and/or we still need - * to know which octet is which. - */ -#define MPPE_C_BIT 0x01 /* MPPC */ -#define MPPE_D_BIT 0x10 /* Obsolete, usage unknown */ -#define MPPE_L_BIT 0x20 /* 40-bit */ -#define MPPE_S_BIT 0x40 /* 128-bit */ -#define MPPE_M_BIT 0x80 /* 56-bit, not supported */ -#define MPPE_H_BIT 0x01 /* Stateless (in a different byte) */ - -/* Does not include H bit; used for least significant octet only. */ -#define MPPE_ALL_BITS (MPPE_D_BIT|MPPE_L_BIT|MPPE_S_BIT|MPPE_M_BIT|MPPE_H_BIT) - -/* Build a CI from mppe opts (see RFC 3078) */ -#define MPPE_OPTS_TO_CI(opts, ci) \ - do { \ - u_char *ptr = ci; /* u_char[4] */ \ - \ - /* H bit */ \ - if (opts & MPPE_OPT_STATEFUL) \ - *ptr++ = 0x0; \ - else \ - *ptr++ = MPPE_H_BIT; \ - *ptr++ = 0; \ - *ptr++ = 0; \ - \ - /* S,L bits */ \ - *ptr = 0; \ - if (opts & MPPE_OPT_128) \ - *ptr |= MPPE_S_BIT; \ - if (opts & MPPE_OPT_40) \ - *ptr |= MPPE_L_BIT; \ - /* M,D,C bits not supported */ \ - } while (/* CONSTCOND */ 0) - -/* The reverse of the above */ -#define MPPE_CI_TO_OPTS(ci, opts) \ - do { \ - const u_char *ptr = ci; /* u_char[4] */ \ - \ - opts = 0; \ - \ - /* H bit */ \ - if (!(ptr[0] & MPPE_H_BIT)) \ - opts |= MPPE_OPT_STATEFUL; \ - \ - /* S,L bits */ \ - if (ptr[3] & MPPE_S_BIT) \ - opts |= MPPE_OPT_128; \ - if (ptr[3] & MPPE_L_BIT) \ - opts |= MPPE_OPT_40; \ - \ - /* M,D,C bits */ \ - if (ptr[3] & MPPE_M_BIT) \ - opts |= MPPE_OPT_56; \ - if (ptr[3] & MPPE_D_BIT) \ - opts |= MPPE_OPT_D; \ - if (ptr[3] & MPPE_C_BIT) \ - opts |= MPPE_OPT_MPPC; \ - \ - /* Other bits */ \ - if (ptr[0] & ~MPPE_H_BIT) \ - opts |= MPPE_OPT_UNKNOWN; \ - if (ptr[1] || ptr[2]) \ - opts |= MPPE_OPT_UNKNOWN; \ - if (ptr[3] & ~MPPE_ALL_BITS) \ - opts |= MPPE_OPT_UNKNOWN; \ - } while (/* CONSTCOND */ 0) - -/* Shared MPPE padding between MSCHAP and MPPE */ -#define SHA1_PAD_SIZE 40 - -static const u8_t mppe_sha1_pad1[SHA1_PAD_SIZE] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; -static const u8_t mppe_sha1_pad2[SHA1_PAD_SIZE] = { - 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, - 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, - 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, - 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2 -}; - -/* - * State for an MPPE (de)compressor. - */ -typedef struct ppp_mppe_state { - lwip_arc4_context arc4; - u8_t master_key[MPPE_MAX_KEY_LEN]; - u8_t session_key[MPPE_MAX_KEY_LEN]; - u8_t keylen; /* key length in bytes */ - /* NB: 128-bit == 16, 40-bit == 8! - * If we want to support 56-bit, the unit has to change to bits - */ - u8_t bits; /* MPPE control bits */ - u16_t ccount; /* 12-bit coherency count (seqno) */ - u16_t sanity_errors; /* take down LCP if too many */ - unsigned int stateful :1; /* stateful mode flag */ - unsigned int discard :1; /* stateful mode packet loss flag */ -} ppp_mppe_state; - -void mppe_set_key(ppp_pcb *pcb, ppp_mppe_state *state, u8_t *key); -void mppe_init(ppp_pcb *pcb, ppp_mppe_state *state, u8_t options); -void mppe_comp_reset(ppp_pcb *pcb, ppp_mppe_state *state); -err_t mppe_compress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb, u16_t protocol); -void mppe_decomp_reset(ppp_pcb *pcb, ppp_mppe_state *state); -err_t mppe_decompress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb); - -#endif /* MPPE_H */ -#endif /* PPP_SUPPORT && MPPE_SUPPORT */ diff --git a/tools/sdk/include/lwip/netif/ppp/polarssl/arc4.h b/tools/sdk/include/lwip/netif/ppp/polarssl/arc4.h deleted file mode 100644 index 4af724cd900..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/polarssl/arc4.h +++ /dev/null @@ -1,81 +0,0 @@ -/** - * \file arc4.h - * - * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine - * - * Copyright (C) 2009 Paul Bakker - * - * All rights reserved. - * - * 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 names of PolarSSL or XySSL 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. - */ - -#include "netif/ppp/ppp_opts.h" -#if LWIP_INCLUDED_POLARSSL_ARC4 - -#ifndef LWIP_INCLUDED_POLARSSL_ARC4_H -#define LWIP_INCLUDED_POLARSSL_ARC4_H - -/** - * \brief ARC4 context structure - */ -typedef struct -{ - int x; /*!< permutation index */ - int y; /*!< permutation index */ - unsigned char m[256]; /*!< permutation table */ -} -arc4_context; - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief ARC4 key schedule - * - * \param ctx ARC4 context to be initialized - * \param key the secret key - * \param keylen length of the key - */ -void arc4_setup( arc4_context *ctx, unsigned char *key, int keylen ); - -/** - * \brief ARC4 cipher function - * - * \param ctx ARC4 context - * \param buf buffer to be processed - * \param buflen amount of data in buf - */ -void arc4_crypt( arc4_context *ctx, unsigned char *buf, int buflen ); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_INCLUDED_POLARSSL_ARC4_H */ - -#endif /* LWIP_INCLUDED_POLARSSL_ARC4 */ diff --git a/tools/sdk/include/lwip/netif/ppp/polarssl/des.h b/tools/sdk/include/lwip/netif/ppp/polarssl/des.h deleted file mode 100644 index e893890ed76..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/polarssl/des.h +++ /dev/null @@ -1,92 +0,0 @@ -/** - * \file des.h - * - * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine - * - * Copyright (C) 2009 Paul Bakker - * - * All rights reserved. - * - * 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 names of PolarSSL or XySSL 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. - */ - -#include "netif/ppp/ppp_opts.h" -#if LWIP_INCLUDED_POLARSSL_DES - -#ifndef LWIP_INCLUDED_POLARSSL_DES_H -#define LWIP_INCLUDED_POLARSSL_DES_H - -#define DES_ENCRYPT 1 -#define DES_DECRYPT 0 - -/** - * \brief DES context structure - */ -typedef struct -{ - int mode; /*!< encrypt/decrypt */ - unsigned long sk[32]; /*!< DES subkeys */ -} -des_context; - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief DES key schedule (56-bit, encryption) - * - * \param ctx DES context to be initialized - * \param key 8-byte secret key - */ -void des_setkey_enc( des_context *ctx, unsigned char key[8] ); - -/** - * \brief DES key schedule (56-bit, decryption) - * - * \param ctx DES context to be initialized - * \param key 8-byte secret key - */ -void des_setkey_dec( des_context *ctx, unsigned char key[8] ); - -/** - * \brief DES-ECB block encryption/decryption - * - * \param ctx DES context - * \param input 64-bit input block - * \param output 64-bit output block - */ -void des_crypt_ecb( des_context *ctx, - const unsigned char input[8], - unsigned char output[8] ); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_INCLUDED_POLARSSL_DES_H */ - -#endif /* LWIP_INCLUDED_POLARSSL_DES */ diff --git a/tools/sdk/include/lwip/netif/ppp/polarssl/md4.h b/tools/sdk/include/lwip/netif/ppp/polarssl/md4.h deleted file mode 100644 index 570445687e1..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/polarssl/md4.h +++ /dev/null @@ -1,97 +0,0 @@ -/** - * \file md4.h - * - * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine - * - * Copyright (C) 2009 Paul Bakker - * - * All rights reserved. - * - * 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 names of PolarSSL or XySSL 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. - */ - -#include "netif/ppp/ppp_opts.h" -#if LWIP_INCLUDED_POLARSSL_MD4 - -#ifndef LWIP_INCLUDED_POLARSSL_MD4_H -#define LWIP_INCLUDED_POLARSSL_MD4_H - -/** - * \brief MD4 context structure - */ -typedef struct -{ - unsigned long total[2]; /*!< number of bytes processed */ - unsigned long state[4]; /*!< intermediate digest state */ - unsigned char buffer[64]; /*!< data block being processed */ -} -md4_context; - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief MD4 context setup - * - * \param ctx context to be initialized - */ -void md4_starts( md4_context *ctx ); - -/** - * \brief MD4 process buffer - * - * \param ctx MD4 context - * \param input buffer holding the data - * \param ilen length of the input data - */ -void md4_update( md4_context *ctx, const unsigned char *input, int ilen ); - -/** - * \brief MD4 final digest - * - * \param ctx MD4 context - * \param output MD4 checksum result - */ -void md4_finish( md4_context *ctx, unsigned char output[16] ); - -/** - * \brief Output = MD4( input buffer ) - * - * \param input buffer holding the data - * \param ilen length of the input data - * \param output MD4 checksum result - */ -void md4( unsigned char *input, int ilen, unsigned char output[16] ); - - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_INCLUDED_POLARSSL_MD4_H */ - -#endif /* LWIP_INCLUDED_POLARSSL_MD4 */ diff --git a/tools/sdk/include/lwip/netif/ppp/polarssl/md5.h b/tools/sdk/include/lwip/netif/ppp/polarssl/md5.h deleted file mode 100644 index 12440118906..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/polarssl/md5.h +++ /dev/null @@ -1,96 +0,0 @@ -/** - * \file md5.h - * - * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine - * - * Copyright (C) 2009 Paul Bakker - * - * All rights reserved. - * - * 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 names of PolarSSL or XySSL 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. - */ - -#include "netif/ppp/ppp_opts.h" -#if LWIP_INCLUDED_POLARSSL_MD5 - -#ifndef LWIP_INCLUDED_POLARSSL_MD5_H -#define LWIP_INCLUDED_POLARSSL_MD5_H - -/** - * \brief MD5 context structure - */ -typedef struct -{ - unsigned long total[2]; /*!< number of bytes processed */ - unsigned long state[4]; /*!< intermediate digest state */ - unsigned char buffer[64]; /*!< data block being processed */ -} -md5_context; - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief MD5 context setup - * - * \param ctx context to be initialized - */ -void md5_starts( md5_context *ctx ); - -/** - * \brief MD5 process buffer - * - * \param ctx MD5 context - * \param input buffer holding the data - * \param ilen length of the input data - */ -void md5_update( md5_context *ctx, const unsigned char *input, int ilen ); - -/** - * \brief MD5 final digest - * - * \param ctx MD5 context - * \param output MD5 checksum result - */ -void md5_finish( md5_context *ctx, unsigned char output[16] ); - -/** - * \brief Output = MD5( input buffer ) - * - * \param input buffer holding the data - * \param ilen length of the input data - * \param output MD5 checksum result - */ -void md5( unsigned char *input, int ilen, unsigned char output[16] ); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_INCLUDED_POLARSSL_MD5_H */ - -#endif /* LWIP_INCLUDED_POLARSSL_MD5 */ diff --git a/tools/sdk/include/lwip/netif/ppp/polarssl/sha1.h b/tools/sdk/include/lwip/netif/ppp/polarssl/sha1.h deleted file mode 100644 index a4c53e07c50..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/polarssl/sha1.h +++ /dev/null @@ -1,96 +0,0 @@ -/** - * \file sha1.h - * - * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine - * - * Copyright (C) 2009 Paul Bakker - * - * All rights reserved. - * - * 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 names of PolarSSL or XySSL 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. - */ - -#include "netif/ppp/ppp_opts.h" -#if LWIP_INCLUDED_POLARSSL_SHA1 - -#ifndef LWIP_INCLUDED_POLARSSL_SHA1_H -#define LWIP_INCLUDED_POLARSSL_SHA1_H - -/** - * \brief SHA-1 context structure - */ -typedef struct -{ - unsigned long total[2]; /*!< number of bytes processed */ - unsigned long state[5]; /*!< intermediate digest state */ - unsigned char buffer[64]; /*!< data block being processed */ -} -sha1_context; - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief SHA-1 context setup - * - * \param ctx context to be initialized - */ -void sha1_starts( sha1_context *ctx ); - -/** - * \brief SHA-1 process buffer - * - * \param ctx SHA-1 context - * \param input buffer holding the data - * \param ilen length of the input data - */ -void sha1_update( sha1_context *ctx, const unsigned char *input, int ilen ); - -/** - * \brief SHA-1 final digest - * - * \param ctx SHA-1 context - * \param output SHA-1 checksum result - */ -void sha1_finish( sha1_context *ctx, unsigned char output[20] ); - -/** - * \brief Output = SHA-1( input buffer ) - * - * \param input buffer holding the data - * \param ilen length of the input data - * \param output SHA-1 checksum result - */ -void sha1( unsigned char *input, int ilen, unsigned char output[20] ); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_INCLUDED_POLARSSL_SHA1_H */ - -#endif /* LWIP_INCLUDED_POLARSSL_SHA1 */ diff --git a/tools/sdk/include/lwip/netif/ppp/ppp.h b/tools/sdk/include/lwip/netif/ppp/ppp.h deleted file mode 100644 index d9ea097efdb..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/ppp.h +++ /dev/null @@ -1,690 +0,0 @@ -/***************************************************************************** -* ppp.h - Network Point to Point Protocol header file. -* -* Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc. -* portions Copyright (c) 1997 Global Election Systems Inc. -* -* The authors hereby grant permission to use, copy, modify, distribute, -* and license this software and its documentation for any purpose, provided -* that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any -* distributions. No written agreement, license, or royalty fee is required -* for any of the authorized uses. -* -* THIS SOFTWARE IS PROVIDED BY THE 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 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. -* -****************************************************************************** -* REVISION HISTORY -* -* 03-01-01 Marc Boucher -* Ported to lwIP. -* 97-11-05 Guy Lancaster , Global Election Systems Inc. -* Original derived from BSD codes. -*****************************************************************************/ - -#include "netif/ppp/ppp_opts.h" -#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ - -#ifndef PPP_H -#define PPP_H - -#include "lwip/def.h" -#include "lwip/stats.h" -#include "lwip/mem.h" -#include "lwip/netif.h" -#include "lwip/sys.h" -#include "lwip/timeouts.h" -#if PPP_IPV6_SUPPORT -#include "lwip/ip6_addr.h" -#endif /* PPP_IPV6_SUPPORT */ - -/* Disable non-working or rarely used PPP feature, so rarely that we don't want to bloat ppp_opts.h with them */ -#ifndef PPP_OPTIONS -#define PPP_OPTIONS 0 -#endif - -#ifndef PPP_NOTIFY -#define PPP_NOTIFY 0 -#endif - -#ifndef PPP_REMOTENAME -#define PPP_REMOTENAME 0 -#endif - -#ifndef PPP_IDLETIMELIMIT -#define PPP_IDLETIMELIMIT 0 -#endif - -#ifndef PPP_LCP_ADAPTIVE -#define PPP_LCP_ADAPTIVE 0 -#endif - -#ifndef PPP_MAXCONNECT -#define PPP_MAXCONNECT 0 -#endif - -#ifndef PPP_ALLOWED_ADDRS -#define PPP_ALLOWED_ADDRS 0 -#endif - -#ifndef PPP_PROTOCOLNAME -#define PPP_PROTOCOLNAME 0 -#endif - -#ifndef PPP_STATS_SUPPORT -#define PPP_STATS_SUPPORT 0 -#endif - -#ifndef DEFLATE_SUPPORT -#define DEFLATE_SUPPORT 0 -#endif - -#ifndef BSDCOMPRESS_SUPPORT -#define BSDCOMPRESS_SUPPORT 0 -#endif - -#ifndef PREDICTOR_SUPPORT -#define PREDICTOR_SUPPORT 0 -#endif - -/************************* -*** PUBLIC DEFINITIONS *** -*************************/ - -/* - * The basic PPP frame. - */ -#define PPP_HDRLEN 4 /* octets for standard ppp header */ -#define PPP_FCSLEN 2 /* octets for FCS */ - -/* - * Values for phase. - */ -#define PPP_PHASE_DEAD 0 -#define PPP_PHASE_MASTER 1 -#define PPP_PHASE_HOLDOFF 2 -#define PPP_PHASE_INITIALIZE 3 -#define PPP_PHASE_SERIALCONN 4 -#define PPP_PHASE_DORMANT 5 -#define PPP_PHASE_ESTABLISH 6 -#define PPP_PHASE_AUTHENTICATE 7 -#define PPP_PHASE_CALLBACK 8 -#define PPP_PHASE_NETWORK 9 -#define PPP_PHASE_RUNNING 10 -#define PPP_PHASE_TERMINATE 11 -#define PPP_PHASE_DISCONNECT 12 - -/* Error codes. */ -#define PPPERR_NONE 0 /* No error. */ -#define PPPERR_PARAM 1 /* Invalid parameter. */ -#define PPPERR_OPEN 2 /* Unable to open PPP session. */ -#define PPPERR_DEVICE 3 /* Invalid I/O device for PPP. */ -#define PPPERR_ALLOC 4 /* Unable to allocate resources. */ -#define PPPERR_USER 5 /* User interrupt. */ -#define PPPERR_CONNECT 6 /* Connection lost. */ -#define PPPERR_AUTHFAIL 7 /* Failed authentication challenge. */ -#define PPPERR_PROTOCOL 8 /* Failed to meet protocol. */ -#define PPPERR_PEERDEAD 9 /* Connection timeout */ -#define PPPERR_IDLETIMEOUT 10 /* Idle Timeout */ -#define PPPERR_CONNECTTIME 11 /* Max connect time reached */ -#define PPPERR_LOOPBACK 12 /* Loopback detected */ - -/* Whether auth support is enabled at all */ -#define PPP_AUTH_SUPPORT (PAP_SUPPORT || CHAP_SUPPORT || EAP_SUPPORT) - -/************************ -*** PUBLIC DATA TYPES *** -************************/ - -/* - * Other headers require ppp_pcb definition for prototypes, but ppp_pcb - * require some structure definition from other headers as well, we are - * fixing the dependency loop here by declaring the ppp_pcb type then - * by including headers containing necessary struct definition for ppp_pcb - */ -typedef struct ppp_pcb_s ppp_pcb; - -/* Type definitions for BSD code. */ -#ifndef __u_char_defined -typedef unsigned long u_long; -typedef unsigned int u_int; -typedef unsigned short u_short; -typedef unsigned char u_char; -#endif - -#include "fsm.h" -#include "lcp.h" -#if CCP_SUPPORT -#include "ccp.h" -#endif /* CCP_SUPPORT */ -#if MPPE_SUPPORT -#include "mppe.h" -#endif /* MPPE_SUPPORT */ -#if PPP_IPV4_SUPPORT -#include "ipcp.h" -#endif /* PPP_IPV4_SUPPORT */ -#if PPP_IPV6_SUPPORT -#include "ipv6cp.h" -#endif /* PPP_IPV6_SUPPORT */ -#if PAP_SUPPORT -#include "upap.h" -#endif /* PAP_SUPPORT */ -#if CHAP_SUPPORT -#include "chap-new.h" -#endif /* CHAP_SUPPORT */ -#if EAP_SUPPORT -#include "eap.h" -#endif /* EAP_SUPPORT */ -#if VJ_SUPPORT -#include "vj.h" -#endif /* VJ_SUPPORT */ - -/* Link status callback function prototype */ -typedef void (*ppp_link_status_cb_fn)(ppp_pcb *pcb, int err_code, void *ctx); - -/* - * PPP configuration. - */ -typedef struct ppp_settings_s { - -#if PPP_SERVER && PPP_AUTH_SUPPORT - unsigned int auth_required :1; /* Peer is required to authenticate */ - unsigned int null_login :1; /* Username of "" and a password of "" are acceptable */ -#endif /* PPP_SERVER && PPP_AUTH_SUPPORT */ -#if PPP_REMOTENAME - unsigned int explicit_remote :1; /* remote_name specified with remotename opt */ -#endif /* PPP_REMOTENAME */ -#if PAP_SUPPORT - unsigned int refuse_pap :1; /* Don't proceed auth. with PAP */ -#endif /* PAP_SUPPORT */ -#if CHAP_SUPPORT - unsigned int refuse_chap :1; /* Don't proceed auth. with CHAP */ -#endif /* CHAP_SUPPORT */ -#if MSCHAP_SUPPORT - unsigned int refuse_mschap :1; /* Don't proceed auth. with MS-CHAP */ - unsigned int refuse_mschap_v2 :1; /* Don't proceed auth. with MS-CHAPv2 */ -#endif /* MSCHAP_SUPPORT */ -#if EAP_SUPPORT - unsigned int refuse_eap :1; /* Don't proceed auth. with EAP */ -#endif /* EAP_SUPPORT */ -#if LWIP_DNS - unsigned int usepeerdns :1; /* Ask peer for DNS adds */ -#endif /* LWIP_DNS */ - unsigned int persist :1; /* Persist mode, always try to open the connection */ -#if PRINTPKT_SUPPORT - unsigned int hide_password :1; /* Hide password in dumped packets */ -#endif /* PRINTPKT_SUPPORT */ - unsigned int noremoteip :1; /* Let him have no IP address */ - unsigned int lax_recv :1; /* accept control chars in asyncmap */ - unsigned int noendpoint :1; /* don't send/accept endpoint discriminator */ -#if PPP_LCP_ADAPTIVE - unsigned int lcp_echo_adaptive :1; /* request echo only if the link was idle */ -#endif /* PPP_LCP_ADAPTIVE */ -#if MPPE_SUPPORT - unsigned int require_mppe :1; /* Require MPPE (Microsoft Point to Point Encryption) */ - unsigned int refuse_mppe_40 :1; /* Allow MPPE 40-bit mode? */ - unsigned int refuse_mppe_128 :1; /* Allow MPPE 128-bit mode? */ - unsigned int refuse_mppe_stateful :1; /* Allow MPPE stateful mode? */ -#endif /* MPPE_SUPPORT */ - - u16_t listen_time; /* time to listen first (ms), waiting for peer to send LCP packet */ - -#if PPP_IDLETIMELIMIT - u16_t idle_time_limit; /* Disconnect if idle for this many seconds */ -#endif /* PPP_IDLETIMELIMIT */ -#if PPP_MAXCONNECT - u32_t maxconnect; /* Maximum connect time (seconds) */ -#endif /* PPP_MAXCONNECT */ - -#if PPP_AUTH_SUPPORT - /* auth data */ - const char *user; /* Username for PAP */ - const char *passwd; /* Password for PAP, secret for CHAP */ -#if PPP_REMOTENAME - char remote_name[MAXNAMELEN + 1]; /* Peer's name for authentication */ -#endif /* PPP_REMOTENAME */ - -#if PAP_SUPPORT - u8_t pap_timeout_time; /* Timeout (seconds) for auth-req retrans. */ - u8_t pap_max_transmits; /* Number of auth-reqs sent */ -#if PPP_SERVER - u8_t pap_req_timeout; /* Time to wait for auth-req from peer */ -#endif /* PPP_SERVER */ -#endif /* PAP_SUPPPORT */ - -#if CHAP_SUPPORT - u8_t chap_timeout_time; /* Timeout (seconds) for retransmitting req */ - u8_t chap_max_transmits; /* max # times to send challenge */ -#if PPP_SERVER - u8_t chap_rechallenge_time; /* Time to wait for auth-req from peer */ -#endif /* PPP_SERVER */ -#endif /* CHAP_SUPPPORT */ - -#if EAP_SUPPORT - u8_t eap_req_time; /* Time to wait (for retransmit/fail) */ - u8_t eap_allow_req; /* Max Requests allowed */ -#if PPP_SERVER - u8_t eap_timeout_time; /* Time to wait (for retransmit/fail) */ - u8_t eap_max_transmits; /* Max Requests allowed */ -#endif /* PPP_SERVER */ -#endif /* EAP_SUPPORT */ - -#endif /* PPP_AUTH_SUPPORT */ - - u8_t fsm_timeout_time; /* Timeout time in seconds */ - u8_t fsm_max_conf_req_transmits; /* Maximum Configure-Request transmissions */ - u8_t fsm_max_term_transmits; /* Maximum Terminate-Request transmissions */ - u8_t fsm_max_nak_loops; /* Maximum number of nak loops tolerated */ - - u8_t lcp_loopbackfail; /* Number of times we receive our magic number from the peer - before deciding the link is looped-back. */ - u8_t lcp_echo_interval; /* Interval between LCP echo-requests */ - u8_t lcp_echo_fails; /* Tolerance to unanswered echo-requests */ - -} ppp_settings; - -#if PPP_SERVER -struct ppp_addrs { -#if PPP_IPV4_SUPPORT - ip4_addr_t our_ipaddr, his_ipaddr, netmask; -#if LWIP_DNS - ip4_addr_t dns1, dns2; -#endif /* LWIP_DNS */ -#endif /* PPP_IPV4_SUPPORT */ -#if PPP_IPV6_SUPPORT - ip6_addr_t our6_ipaddr, his6_ipaddr; -#endif /* PPP_IPV6_SUPPORT */ -}; -#endif /* PPP_SERVER */ - -/* - * PPP interface control block. - */ -struct ppp_pcb_s { - ppp_settings settings; - const struct link_callbacks *link_cb; - void *link_ctx_cb; - void (*link_status_cb)(ppp_pcb *pcb, int err_code, void *ctx); /* Status change callback */ -#if PPP_NOTIFY_PHASE - void (*notify_phase_cb)(ppp_pcb *pcb, u8_t phase, void *ctx); /* Notify phase callback */ -#endif /* PPP_NOTIFY_PHASE */ - void *ctx_cb; /* Callbacks optional pointer */ - struct netif *netif; /* PPP interface */ - u8_t phase; /* where the link is at */ - u8_t err_code; /* Code indicating why interface is down. */ - - /* flags */ -#if PPP_IPV4_SUPPORT - unsigned int ask_for_local :1; /* request our address from peer */ - unsigned int ipcp_is_open :1; /* haven't called np_finished() */ - unsigned int ipcp_is_up :1; /* have called ipcp_up() */ - unsigned int if4_up :1; /* True when the IPv4 interface is up. */ -#if 0 /* UNUSED - PROXY ARP */ - unsigned int proxy_arp_set :1; /* Have created proxy arp entry */ -#endif /* UNUSED - PROXY ARP */ -#endif /* PPP_IPV4_SUPPORT */ -#if PPP_IPV6_SUPPORT - unsigned int ipv6cp_is_up :1; /* have called ip6cp_up() */ - unsigned int if6_up :1; /* True when the IPv6 interface is up. */ -#endif /* PPP_IPV6_SUPPORT */ - unsigned int lcp_echo_timer_running :1; /* set if a timer is running */ -#if VJ_SUPPORT - unsigned int vj_enabled :1; /* Flag indicating VJ compression enabled. */ -#endif /* VJ_SUPPORT */ -#if CCP_SUPPORT - unsigned int ccp_all_rejected :1; /* we rejected all peer's options */ -#endif /* CCP_SUPPORT */ -#if MPPE_SUPPORT - unsigned int mppe_keys_set :1; /* Have the MPPE keys been set? */ -#endif /* MPPE_SUPPORT */ - -#if PPP_AUTH_SUPPORT - /* auth data */ -#if PPP_SERVER && defined(HAVE_MULTILINK) - char peer_authname[MAXNAMELEN + 1]; /* The name by which the peer authenticated itself to us. */ -#endif /* PPP_SERVER && defined(HAVE_MULTILINK) */ - u16_t auth_pending; /* Records which authentication operations haven't completed yet. */ - u16_t auth_done; /* Records which authentication operations have been completed. */ - -#if PAP_SUPPORT - upap_state upap; /* PAP data */ -#endif /* PAP_SUPPORT */ - -#if CHAP_SUPPORT - chap_client_state chap_client; /* CHAP client data */ -#if PPP_SERVER - chap_server_state chap_server; /* CHAP server data */ -#endif /* PPP_SERVER */ -#endif /* CHAP_SUPPORT */ - -#if EAP_SUPPORT - eap_state eap; /* EAP data */ -#endif /* EAP_SUPPORT */ -#endif /* PPP_AUTH_SUPPORT */ - - fsm lcp_fsm; /* LCP fsm structure */ - lcp_options lcp_wantoptions; /* Options that we want to request */ - lcp_options lcp_gotoptions; /* Options that peer ack'd */ - lcp_options lcp_allowoptions; /* Options we allow peer to request */ - lcp_options lcp_hisoptions; /* Options that we ack'd */ - u16_t peer_mru; /* currently negotiated peer MRU */ - u8_t lcp_echos_pending; /* Number of outstanding echo msgs */ - u8_t lcp_echo_number; /* ID number of next echo frame */ - - u8_t num_np_open; /* Number of network protocols which we have opened. */ - u8_t num_np_up; /* Number of network protocols which have come up. */ - -#if VJ_SUPPORT - struct vjcompress vj_comp; /* Van Jacobson compression header. */ -#endif /* VJ_SUPPORT */ - -#if CCP_SUPPORT - fsm ccp_fsm; /* CCP fsm structure */ - ccp_options ccp_wantoptions; /* what to request the peer to use */ - ccp_options ccp_gotoptions; /* what the peer agreed to do */ - ccp_options ccp_allowoptions; /* what we'll agree to do */ - ccp_options ccp_hisoptions; /* what we agreed to do */ - u8_t ccp_localstate; /* Local state (mainly for handling reset-reqs and reset-acks). */ - u8_t ccp_receive_method; /* Method chosen on receive path */ - u8_t ccp_transmit_method; /* Method chosen on transmit path */ -#if MPPE_SUPPORT - ppp_mppe_state mppe_comp; /* MPPE "compressor" structure */ - ppp_mppe_state mppe_decomp; /* MPPE "decompressor" structure */ -#endif /* MPPE_SUPPORT */ -#endif /* CCP_SUPPORT */ - -#if PPP_IPV4_SUPPORT - fsm ipcp_fsm; /* IPCP fsm structure */ - ipcp_options ipcp_wantoptions; /* Options that we want to request */ - ipcp_options ipcp_gotoptions; /* Options that peer ack'd */ - ipcp_options ipcp_allowoptions; /* Options we allow peer to request */ - ipcp_options ipcp_hisoptions; /* Options that we ack'd */ -#endif /* PPP_IPV4_SUPPORT */ - -#if PPP_IPV6_SUPPORT - fsm ipv6cp_fsm; /* IPV6CP fsm structure */ - ipv6cp_options ipv6cp_wantoptions; /* Options that we want to request */ - ipv6cp_options ipv6cp_gotoptions; /* Options that peer ack'd */ - ipv6cp_options ipv6cp_allowoptions; /* Options we allow peer to request */ - ipv6cp_options ipv6cp_hisoptions; /* Options that we ack'd */ -#endif /* PPP_IPV6_SUPPORT */ -}; - -/************************ - *** PUBLIC FUNCTIONS *** - ************************/ - -/* - * WARNING: For multi-threads environment, all ppp_set_* functions most - * only be called while the PPP is in the dead phase (i.e. disconnected). - */ - -#if PPP_AUTH_SUPPORT -/* - * Set PPP authentication. - * - * Warning: Using PPPAUTHTYPE_ANY might have security consequences. - * RFC 1994 says: - * - * In practice, within or associated with each PPP server, there is a - * database which associates "user" names with authentication - * information ("secrets"). It is not anticipated that a particular - * named user would be authenticated by multiple methods. This would - * make the user vulnerable to attacks which negotiate the least secure - * method from among a set (such as PAP rather than CHAP). If the same - * secret was used, PAP would reveal the secret to be used later with - * CHAP. - * - * Instead, for each user name there should be an indication of exactly - * one method used to authenticate that user name. If a user needs to - * make use of different authentication methods under different - * circumstances, then distinct user names SHOULD be employed, each of - * which identifies exactly one authentication method. - * - * Default is none auth type, unset (NULL) user and passwd. - */ -#define PPPAUTHTYPE_NONE 0x00 -#define PPPAUTHTYPE_PAP 0x01 -#define PPPAUTHTYPE_CHAP 0x02 -#define PPPAUTHTYPE_MSCHAP 0x04 -#define PPPAUTHTYPE_MSCHAP_V2 0x08 -#define PPPAUTHTYPE_EAP 0x10 -#define PPPAUTHTYPE_ANY 0xff -void ppp_set_auth(ppp_pcb *pcb, u8_t authtype, const char *user, const char *passwd); - -/* - * If set, peer is required to authenticate. This is mostly necessary for PPP server support. - * - * Default is false. - */ -#define ppp_set_auth_required(ppp, boolval) (ppp->settings.auth_required = boolval) -#endif /* PPP_AUTH_SUPPORT */ - -#if PPP_IPV4_SUPPORT -/* - * Set PPP interface "our" and "his" IPv4 addresses. This is mostly necessary for PPP server - * support but it can also be used on a PPP link where each side choose its own IP address. - * - * Default is unset (0.0.0.0). - */ -#define ppp_set_ipcp_ouraddr(ppp, addr) do { ppp->ipcp_wantoptions.ouraddr = ip4_addr_get_u32(addr); \ - ppp->ask_for_local = ppp->ipcp_wantoptions.ouraddr != 0; } while(0) -#define ppp_set_ipcp_hisaddr(ppp, addr) (ppp->ipcp_wantoptions.hisaddr = ip4_addr_get_u32(addr)) -#if LWIP_DNS -/* - * Set DNS server addresses that are sent if the peer asks for them. This is mostly necessary - * for PPP server support. - * - * Default is unset (0.0.0.0). - */ -#define ppp_set_ipcp_dnsaddr(ppp, index, addr) (ppp->ipcp_allowoptions.dnsaddr[index] = ip4_addr_get_u32(addr)) - -/* - * If set, we ask the peer for up to 2 DNS server addresses. Received DNS server addresses are - * registered using the dns_setserver() function. - * - * Default is false. - */ -#define ppp_set_usepeerdns(ppp, boolval) (ppp->settings.usepeerdns = boolval) -#endif /* LWIP_DNS */ -#endif /* PPP_IPV4_SUPPORT */ - -#if MPPE_SUPPORT -/* Disable MPPE (Microsoft Point to Point Encryption). This parameter is exclusive. */ -#define PPP_MPPE_DISABLE 0x00 -/* Require the use of MPPE (Microsoft Point to Point Encryption). */ -#define PPP_MPPE_ENABLE 0x01 -/* Allow MPPE to use stateful mode. Stateless mode is still attempted first. */ -#define PPP_MPPE_ALLOW_STATEFUL 0x02 -/* Refuse the use of MPPE with 40-bit encryption. Conflict with PPP_MPPE_REFUSE_128. */ -#define PPP_MPPE_REFUSE_40 0x04 -/* Refuse the use of MPPE with 128-bit encryption. Conflict with PPP_MPPE_REFUSE_40. */ -#define PPP_MPPE_REFUSE_128 0x08 -/* - * Set MPPE configuration - * - * Default is disabled. - */ -void ppp_set_mppe(ppp_pcb *pcb, u8_t flags); -#endif /* MPPE_SUPPORT */ - -/* - * Wait for up to intval milliseconds for a valid PPP packet from the peer. - * At the end of this time, or when a valid PPP packet is received from the - * peer, we commence negotiation by sending our first LCP packet. - * - * Default is 0. - */ -#define ppp_set_listen_time(ppp, intval) (ppp->settings.listen_time = intval) - -/* - * If set, we will attempt to initiate a connection but if no reply is received from - * the peer, we will then just wait passively for a valid LCP packet from the peer. - * - * Default is false. - */ -#define ppp_set_passive(ppp, boolval) (ppp->lcp_wantoptions.passive = boolval) - -/* - * If set, we will not transmit LCP packets to initiate a connection until a valid - * LCP packet is received from the peer. This is what we usually call the server mode. - * - * Default is false. - */ -#define ppp_set_silent(ppp, boolval) (ppp->lcp_wantoptions.silent = boolval) - -/* - * If set, enable protocol field compression negotiation in both the receive and - * the transmit direction. - * - * Default is true. - */ -#define ppp_set_neg_pcomp(ppp, boolval) (ppp->lcp_wantoptions.neg_pcompression = \ - ppp->lcp_allowoptions.neg_pcompression = boolval) - -/* - * If set, enable Address/Control compression in both the receive and the transmit - * direction. - * - * Default is true. - */ -#define ppp_set_neg_accomp(ppp, boolval) (ppp->lcp_wantoptions.neg_accompression = \ - ppp->lcp_allowoptions.neg_accompression = boolval) - -/* - * If set, enable asyncmap negotiation. Otherwise forcing all control characters to - * be escaped for both the transmit and the receive direction. - * - * Default is true. - */ -#define ppp_set_neg_asyncmap(ppp, boolval) (ppp->lcp_wantoptions.neg_asyncmap = \ - ppp->lcp_allowoptions.neg_asyncmap = boolval) - -/* - * This option sets the Async-Control-Character-Map (ACCM) for this end of the link. - * The ACCM is a set of 32 bits, one for each of the ASCII control characters with - * values from 0 to 31, where a 1 bit indicates that the corresponding control - * character should not be used in PPP packets sent to this system. The map is - * an unsigned 32 bits integer where the least significant bit (00000001) represents - * character 0 and the most significant bit (80000000) represents character 31. - * We will then ask the peer to send these characters as a 2-byte escape sequence. - * - * Default is 0. - */ -#define ppp_set_asyncmap(ppp, intval) (ppp->lcp_wantoptions.asyncmap = intval) - -/* - * Set a PPP interface as the default network interface - * (used to output all packets for which no specific route is found). - */ -#define ppp_set_default(ppp) netif_set_default(ppp->netif) - -#if PPP_NOTIFY_PHASE -/* - * Set a PPP notify phase callback. - * - * This can be used for example to set a LED pattern depending on the - * current phase of the PPP session. - */ -typedef void (*ppp_notify_phase_cb_fn)(ppp_pcb *pcb, u8_t phase, void *ctx); -void ppp_set_notify_phase_callback(ppp_pcb *pcb, ppp_notify_phase_cb_fn notify_phase_cb); -#endif /* PPP_NOTIFY_PHASE */ - -/* - * Initiate a PPP connection. - * - * This can only be called if PPP is in the dead phase. - * - * Holdoff is the time to wait (in seconds) before initiating - * the connection. - * - * If this port connects to a modem, the modem connection must be - * established before calling this. - */ -err_t ppp_connect(ppp_pcb *pcb, u16_t holdoff); - -#if PPP_SERVER -/* - * Listen for an incoming PPP connection. - * - * This can only be called if PPP is in the dead phase. - * - * If this port connects to a modem, the modem connection must be - * established before calling this. - */ -err_t ppp_listen(ppp_pcb *pcb); -#endif /* PPP_SERVER */ - -/* - * Initiate the end of a PPP connection. - * Any outstanding packets in the queues are dropped. - * - * Setting nocarrier to 1 close the PPP connection without initiating the - * shutdown procedure. Always using nocarrier = 0 is still recommended, - * this is going to take a little longer time if your link is down, but - * is a safer choice for the PPP state machine. - * - * Return 0 on success, an error code on failure. - */ -err_t ppp_close(ppp_pcb *pcb, u8_t nocarrier); - -/* - * Release the control block. - * - * This can only be called if PPP is in the dead phase. - * - * You must use ppp_close() before if you wish to terminate - * an established PPP session. - * - * Return 0 on success, an error code on failure. - */ -err_t ppp_free(ppp_pcb *pcb); - -/* - * PPP IOCTL commands. - * - * Get the up status - 0 for down, non-zero for up. The argument must - * point to an int. - */ -#define PPPCTLG_UPSTATUS 0 - -/* - * Get the PPP error code. The argument must point to an int. - * Returns a PPPERR_* value. - */ -#define PPPCTLG_ERRCODE 1 - -/* - * Get the fd associated with a PPP over serial - */ -#define PPPCTLG_FD 2 - -/* - * Get and set parameters for the given connection. - * Return 0 on success, an error code on failure. - */ -err_t ppp_ioctl(ppp_pcb *pcb, u8_t cmd, void *arg); - -/* Get the PPP netif interface */ -#define ppp_netif(ppp) (ppp->netif) - -/* Set an lwIP-style status-callback for the selected PPP device */ -#define ppp_set_netif_statuscallback(ppp, status_cb) \ - netif_set_status_callback(ppp->netif, status_cb); - -/* Set an lwIP-style link-callback for the selected PPP device */ -#define ppp_set_netif_linkcallback(ppp, link_cb) \ - netif_set_link_callback(ppp->netif, link_cb); - -#endif /* PPP_H */ - -#endif /* PPP_SUPPORT */ diff --git a/tools/sdk/include/lwip/netif/ppp/ppp_impl.h b/tools/sdk/include/lwip/netif/ppp/ppp_impl.h deleted file mode 100644 index 1d4c7742f35..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/ppp_impl.h +++ /dev/null @@ -1,629 +0,0 @@ -/***************************************************************************** -* ppp.h - Network Point to Point Protocol header file. -* -* Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc. -* portions Copyright (c) 1997 Global Election Systems Inc. -* -* The authors hereby grant permission to use, copy, modify, distribute, -* and license this software and its documentation for any purpose, provided -* that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any -* distributions. No written agreement, license, or royalty fee is required -* for any of the authorized uses. -* -* THIS SOFTWARE IS PROVIDED BY THE 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 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. -* -****************************************************************************** -* REVISION HISTORY -* -* 03-01-01 Marc Boucher -* Ported to lwIP. -* 97-11-05 Guy Lancaster , Global Election Systems Inc. -* Original derived from BSD codes. -*****************************************************************************/ -#ifndef LWIP_HDR_PPP_IMPL_H -#define LWIP_HDR_PPP_IMPL_H - -#include "netif/ppp/ppp_opts.h" - -#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ - -#ifdef PPP_INCLUDE_SETTINGS_HEADER -#include "ppp_settings.h" -#endif - -#include /* formats */ -#include -#include -#include /* strtol() */ - -#include "lwip/netif.h" -#include "lwip/def.h" -#include "lwip/timeouts.h" - -#include "ppp.h" -#include "pppdebug.h" - -/* - * Memory used for control packets. - * - * PPP_CTRL_PBUF_MAX_SIZE is the amount of memory we allocate when we - * cannot figure out how much we are going to use before filling the buffer. - */ -#if PPP_USE_PBUF_RAM -#define PPP_CTRL_PBUF_TYPE PBUF_RAM -#define PPP_CTRL_PBUF_MAX_SIZE 512 -#else /* PPP_USE_PBUF_RAM */ -#define PPP_CTRL_PBUF_TYPE PBUF_POOL -#define PPP_CTRL_PBUF_MAX_SIZE PBUF_POOL_BUFSIZE -#endif /* PPP_USE_PBUF_RAM */ - -/* - * The basic PPP frame. - */ -#define PPP_ADDRESS(p) (((u_char *)(p))[0]) -#define PPP_CONTROL(p) (((u_char *)(p))[1]) -#define PPP_PROTOCOL(p) ((((u_char *)(p))[2] << 8) + ((u_char *)(p))[3]) - -/* - * Significant octet values. - */ -#define PPP_ALLSTATIONS 0xff /* All-Stations broadcast address */ -#define PPP_UI 0x03 /* Unnumbered Information */ -#define PPP_FLAG 0x7e /* Flag Sequence */ -#define PPP_ESCAPE 0x7d /* Asynchronous Control Escape */ -#define PPP_TRANS 0x20 /* Asynchronous transparency modifier */ - -/* - * Protocol field values. - */ -#define PPP_IP 0x21 /* Internet Protocol */ -#if 0 /* UNUSED */ -#define PPP_AT 0x29 /* AppleTalk Protocol */ -#define PPP_IPX 0x2b /* IPX protocol */ -#endif /* UNUSED */ -#if VJ_SUPPORT -#define PPP_VJC_COMP 0x2d /* VJ compressed TCP */ -#define PPP_VJC_UNCOMP 0x2f /* VJ uncompressed TCP */ -#endif /* VJ_SUPPORT */ -#if PPP_IPV6_SUPPORT -#define PPP_IPV6 0x57 /* Internet Protocol Version 6 */ -#endif /* PPP_IPV6_SUPPORT */ -#if CCP_SUPPORT -#define PPP_COMP 0xfd /* compressed packet */ -#endif /* CCP_SUPPORT */ -#define PPP_IPCP 0x8021 /* IP Control Protocol */ -#if 0 /* UNUSED */ -#define PPP_ATCP 0x8029 /* AppleTalk Control Protocol */ -#define PPP_IPXCP 0x802b /* IPX Control Protocol */ -#endif /* UNUSED */ -#if PPP_IPV6_SUPPORT -#define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */ -#endif /* PPP_IPV6_SUPPORT */ -#if CCP_SUPPORT -#define PPP_CCP 0x80fd /* Compression Control Protocol */ -#endif /* CCP_SUPPORT */ -#if ECP_SUPPORT -#define PPP_ECP 0x8053 /* Encryption Control Protocol */ -#endif /* ECP_SUPPORT */ -#define PPP_LCP 0xc021 /* Link Control Protocol */ -#if PAP_SUPPORT -#define PPP_PAP 0xc023 /* Password Authentication Protocol */ -#endif /* PAP_SUPPORT */ -#if LQR_SUPPORT -#define PPP_LQR 0xc025 /* Link Quality Report protocol */ -#endif /* LQR_SUPPORT */ -#if CHAP_SUPPORT -#define PPP_CHAP 0xc223 /* Cryptographic Handshake Auth. Protocol */ -#endif /* CHAP_SUPPORT */ -#if CBCP_SUPPORT -#define PPP_CBCP 0xc029 /* Callback Control Protocol */ -#endif /* CBCP_SUPPORT */ -#if EAP_SUPPORT -#define PPP_EAP 0xc227 /* Extensible Authentication Protocol */ -#endif /* EAP_SUPPORT */ - -/* - * The following struct gives the addresses of procedures to call - * for a particular lower link level protocol. - */ -struct link_callbacks { - /* Start a connection (e.g. Initiate discovery phase) */ - void (*connect) (ppp_pcb *pcb, void *ctx); -#if PPP_SERVER - /* Listen for an incoming connection (Passive mode) */ - void (*listen) (ppp_pcb *pcb, void *ctx); -#endif /* PPP_SERVER */ - /* End a connection (i.e. initiate disconnect phase) */ - void (*disconnect) (ppp_pcb *pcb, void *ctx); - /* Free lower protocol control block */ - err_t (*free) (ppp_pcb *pcb, void *ctx); - /* Write a pbuf to a ppp link, only used from PPP functions to send PPP packets. */ - err_t (*write)(ppp_pcb *pcb, void *ctx, struct pbuf *p); - /* Send a packet from lwIP core (IPv4 or IPv6) */ - err_t (*netif_output)(ppp_pcb *pcb, void *ctx, struct pbuf *p, u_short protocol); - /* configure the transmit-side characteristics of the PPP interface */ - void (*send_config)(ppp_pcb *pcb, void *ctx, u32_t accm, int pcomp, int accomp); - /* confire the receive-side characteristics of the PPP interface */ - void (*recv_config)(ppp_pcb *pcb, void *ctx, u32_t accm, int pcomp, int accomp); -}; - -/* - * What to do with network protocol (NP) packets. - */ -enum NPmode { - NPMODE_PASS, /* pass the packet through */ - NPMODE_DROP, /* silently drop the packet */ - NPMODE_ERROR, /* return an error */ - NPMODE_QUEUE /* save it up for later. */ -}; - -/* - * Statistics. - */ -#if PPP_STATS_SUPPORT -struct pppstat { - unsigned int ppp_ibytes; /* bytes received */ - unsigned int ppp_ipackets; /* packets received */ - unsigned int ppp_ierrors; /* receive errors */ - unsigned int ppp_obytes; /* bytes sent */ - unsigned int ppp_opackets; /* packets sent */ - unsigned int ppp_oerrors; /* transmit errors */ -}; - -#if VJ_SUPPORT -struct vjstat { - unsigned int vjs_packets; /* outbound packets */ - unsigned int vjs_compressed; /* outbound compressed packets */ - unsigned int vjs_searches; /* searches for connection state */ - unsigned int vjs_misses; /* times couldn't find conn. state */ - unsigned int vjs_uncompressedin; /* inbound uncompressed packets */ - unsigned int vjs_compressedin; /* inbound compressed packets */ - unsigned int vjs_errorin; /* inbound unknown type packets */ - unsigned int vjs_tossed; /* inbound packets tossed because of error */ -}; -#endif /* VJ_SUPPORT */ - -struct ppp_stats { - struct pppstat p; /* basic PPP statistics */ -#if VJ_SUPPORT - struct vjstat vj; /* VJ header compression statistics */ -#endif /* VJ_SUPPORT */ -}; - -#if CCP_SUPPORT -struct compstat { - unsigned int unc_bytes; /* total uncompressed bytes */ - unsigned int unc_packets; /* total uncompressed packets */ - unsigned int comp_bytes; /* compressed bytes */ - unsigned int comp_packets; /* compressed packets */ - unsigned int inc_bytes; /* incompressible bytes */ - unsigned int inc_packets; /* incompressible packets */ - unsigned int ratio; /* recent compression ratio << 8 */ -}; - -struct ppp_comp_stats { - struct compstat c; /* packet compression statistics */ - struct compstat d; /* packet decompression statistics */ -}; -#endif /* CCP_SUPPORT */ - -#endif /* PPP_STATS_SUPPORT */ - -#if PPP_IDLETIMELIMIT -/* - * The following structure records the time in seconds since - * the last NP packet was sent or received. - */ -struct ppp_idle { - time_t xmit_idle; /* time since last NP packet sent */ - time_t recv_idle; /* time since last NP packet received */ -}; -#endif /* PPP_IDLETIMELIMIT */ - -/* values for epdisc.class */ -#define EPD_NULL 0 /* null discriminator, no data */ -#define EPD_LOCAL 1 -#define EPD_IP 2 -#define EPD_MAC 3 -#define EPD_MAGIC 4 -#define EPD_PHONENUM 5 - -/* - * Global variables. - */ -#ifdef HAVE_MULTILINK -extern u8_t multilink; /* enable multilink operation */ -extern u8_t doing_multilink; -extern u8_t multilink_master; -extern u8_t bundle_eof; -extern u8_t bundle_terminating; -#endif - -#ifdef MAXOCTETS -extern unsigned int maxoctets; /* Maximum octetes per session (in bytes) */ -extern int maxoctets_dir; /* Direction : - 0 - in+out (default) - 1 - in - 2 - out - 3 - max(in,out) */ -extern int maxoctets_timeout; /* Timeout for check of octets limit */ -#define PPP_OCTETS_DIRECTION_SUM 0 -#define PPP_OCTETS_DIRECTION_IN 1 -#define PPP_OCTETS_DIRECTION_OUT 2 -#define PPP_OCTETS_DIRECTION_MAXOVERAL 3 -/* same as previos, but little different on RADIUS side */ -#define PPP_OCTETS_DIRECTION_MAXSESSION 4 -#endif - -/* Data input may be used by CCP and ECP, remove this entry - * from struct protent to save some flash - */ -#define PPP_DATAINPUT 0 - -/* - * The following struct gives the addresses of procedures to call - * for a particular protocol. - */ -struct protent { - u_short protocol; /* PPP protocol number */ - /* Initialization procedure */ - void (*init) (ppp_pcb *pcb); - /* Process a received packet */ - void (*input) (ppp_pcb *pcb, u_char *pkt, int len); - /* Process a received protocol-reject */ - void (*protrej) (ppp_pcb *pcb); - /* Lower layer has come up */ - void (*lowerup) (ppp_pcb *pcb); - /* Lower layer has gone down */ - void (*lowerdown) (ppp_pcb *pcb); - /* Open the protocol */ - void (*open) (ppp_pcb *pcb); - /* Close the protocol */ - void (*close) (ppp_pcb *pcb, const char *reason); -#if PRINTPKT_SUPPORT - /* Print a packet in readable form */ - int (*printpkt) (const u_char *pkt, int len, - void (*printer) (void *, const char *, ...), - void *arg); -#endif /* PRINTPKT_SUPPORT */ -#if PPP_DATAINPUT - /* Process a received data packet */ - void (*datainput) (ppp_pcb *pcb, u_char *pkt, int len); -#endif /* PPP_DATAINPUT */ -#if PRINTPKT_SUPPORT - const char *name; /* Text name of protocol */ - const char *data_name; /* Text name of corresponding data protocol */ -#endif /* PRINTPKT_SUPPORT */ -#if PPP_OPTIONS - option_t *options; /* List of command-line options */ - /* Check requested options, assign defaults */ - void (*check_options) (void); -#endif /* PPP_OPTIONS */ -#if DEMAND_SUPPORT - /* Configure interface for demand-dial */ - int (*demand_conf) (int unit); - /* Say whether to bring up link for this pkt */ - int (*active_pkt) (u_char *pkt, int len); -#endif /* DEMAND_SUPPORT */ -}; - -/* Table of pointers to supported protocols */ -extern const struct protent* const protocols[]; - - -/* Values for auth_pending, auth_done */ -#if PAP_SUPPORT -#define PAP_WITHPEER 0x1 -#define PAP_PEER 0x2 -#endif /* PAP_SUPPORT */ -#if CHAP_SUPPORT -#define CHAP_WITHPEER 0x4 -#define CHAP_PEER 0x8 -#endif /* CHAP_SUPPORT */ -#if EAP_SUPPORT -#define EAP_WITHPEER 0x10 -#define EAP_PEER 0x20 -#endif /* EAP_SUPPORT */ - -/* Values for auth_done only */ -#if CHAP_SUPPORT -#define CHAP_MD5_WITHPEER 0x40 -#define CHAP_MD5_PEER 0x80 -#if MSCHAP_SUPPORT -#define CHAP_MS_SHIFT 8 /* LSB position for MS auths */ -#define CHAP_MS_WITHPEER 0x100 -#define CHAP_MS_PEER 0x200 -#define CHAP_MS2_WITHPEER 0x400 -#define CHAP_MS2_PEER 0x800 -#endif /* MSCHAP_SUPPORT */ -#endif /* CHAP_SUPPORT */ - -/* Supported CHAP protocols */ -#if CHAP_SUPPORT - -#if MSCHAP_SUPPORT -#define CHAP_MDTYPE_SUPPORTED (MDTYPE_MICROSOFT_V2 | MDTYPE_MICROSOFT | MDTYPE_MD5) -#else /* MSCHAP_SUPPORT */ -#define CHAP_MDTYPE_SUPPORTED (MDTYPE_MD5) -#endif /* MSCHAP_SUPPORT */ - -#else /* CHAP_SUPPORT */ -#define CHAP_MDTYPE_SUPPORTED (MDTYPE_NONE) -#endif /* CHAP_SUPPORT */ - -#if PPP_STATS_SUPPORT -/* - * PPP statistics structure - */ -struct pppd_stats { - unsigned int bytes_in; - unsigned int bytes_out; - unsigned int pkts_in; - unsigned int pkts_out; -}; -#endif /* PPP_STATS_SUPPORT */ - - -/* - * PPP private functions - */ - - -/* - * Functions called from lwIP core. - */ - -/* initialize the PPP subsystem */ -int ppp_init(void); - -/* - * Functions called from PPP link protocols. - */ - -/* Create a new PPP control block */ -ppp_pcb *ppp_new(struct netif *pppif, const struct link_callbacks *callbacks, void *link_ctx_cb, - ppp_link_status_cb_fn link_status_cb, void *ctx_cb); - -/* Initiate LCP open request */ -void ppp_start(ppp_pcb *pcb); - -/* Called when link failed to setup */ -void ppp_link_failed(ppp_pcb *pcb); - -/* Called when link is normally down (i.e. it was asked to end) */ -void ppp_link_end(ppp_pcb *pcb); - -/* function called to process input packet */ -void ppp_input(ppp_pcb *pcb, struct pbuf *pb); - -/* helper function, merge a pbuf chain into one pbuf */ -struct pbuf *ppp_singlebuf(struct pbuf *p); - - -/* - * Functions called by PPP protocols. - */ - -/* function called by all PPP subsystems to send packets */ -err_t ppp_write(ppp_pcb *pcb, struct pbuf *p); - -/* functions called by auth.c link_terminated() */ -void ppp_link_terminated(ppp_pcb *pcb); - -void new_phase(ppp_pcb *pcb, int p); - -int ppp_send_config(ppp_pcb *pcb, int mtu, u32_t accm, int pcomp, int accomp); -int ppp_recv_config(ppp_pcb *pcb, int mru, u32_t accm, int pcomp, int accomp); - -#if PPP_IPV4_SUPPORT -int sifaddr(ppp_pcb *pcb, u32_t our_adr, u32_t his_adr, u32_t netmask); -int cifaddr(ppp_pcb *pcb, u32_t our_adr, u32_t his_adr); -#if 0 /* UNUSED - PROXY ARP */ -int sifproxyarp(ppp_pcb *pcb, u32_t his_adr); -int cifproxyarp(ppp_pcb *pcb, u32_t his_adr); -#endif /* UNUSED - PROXY ARP */ -#if LWIP_DNS -int sdns(ppp_pcb *pcb, u32_t ns1, u32_t ns2); -int cdns(ppp_pcb *pcb, u32_t ns1, u32_t ns2); -#endif /* LWIP_DNS */ -#if VJ_SUPPORT -int sifvjcomp(ppp_pcb *pcb, int vjcomp, int cidcomp, int maxcid); -#endif /* VJ_SUPPORT */ -int sifup(ppp_pcb *pcb); -int sifdown (ppp_pcb *pcb); -u32_t get_mask(u32_t addr); -#endif /* PPP_IPV4_SUPPORT */ - -#if PPP_IPV6_SUPPORT -int sif6addr(ppp_pcb *pcb, eui64_t our_eui64, eui64_t his_eui64); -int cif6addr(ppp_pcb *pcb, eui64_t our_eui64, eui64_t his_eui64); -int sif6up(ppp_pcb *pcb); -int sif6down (ppp_pcb *pcb); -#endif /* PPP_IPV6_SUPPORT */ - -#if DEMAND_SUPPORT -int sifnpmode(ppp_pcb *pcb, int proto, enum NPmode mode); -#endif /* DEMAND_SUPPORt */ - -void netif_set_mtu(ppp_pcb *pcb, int mtu); -int netif_get_mtu(ppp_pcb *pcb); - -#if CCP_SUPPORT -#if 0 /* unused */ -int ccp_test(ppp_pcb *pcb, u_char *opt_ptr, int opt_len, int for_transmit); -#endif /* unused */ -void ccp_set(ppp_pcb *pcb, u8_t isopen, u8_t isup, u8_t receive_method, u8_t transmit_method); -void ccp_reset_comp(ppp_pcb *pcb); -void ccp_reset_decomp(ppp_pcb *pcb); -#if 0 /* unused */ -int ccp_fatal_error(ppp_pcb *pcb); -#endif /* unused */ -#endif /* CCP_SUPPORT */ - -#if PPP_IDLETIMELIMIT -int get_idle_time(ppp_pcb *pcb, struct ppp_idle *ip); -#endif /* PPP_IDLETIMELIMIT */ - -#if DEMAND_SUPPORT -int get_loop_output(void); -#endif /* DEMAND_SUPPORT */ - -/* Optional protocol names list, to make our messages a little more informative. */ -#if PPP_PROTOCOLNAME -const char * protocol_name(int proto); -#endif /* PPP_PROTOCOLNAME */ - -/* Optional stats support, to get some statistics on the PPP interface */ -#if PPP_STATS_SUPPORT -void print_link_stats(void); /* Print stats, if available */ -void reset_link_stats(int u); /* Reset (init) stats when link goes up */ -void update_link_stats(int u); /* Get stats at link termination */ -#endif /* PPP_STATS_SUPPORT */ - - - -/* - * Inline versions of get/put char/short/long. - * Pointer is advanced; we assume that both arguments - * are lvalues and will already be in registers. - * cp MUST be u_char *. - */ -#define GETCHAR(c, cp) { \ - (c) = *(cp)++; \ -} -#define PUTCHAR(c, cp) { \ - *(cp)++ = (u_char) (c); \ -} -#define GETSHORT(s, cp) { \ - (s) = *(cp)++ << 8; \ - (s) |= *(cp)++; \ -} -#define PUTSHORT(s, cp) { \ - *(cp)++ = (u_char) ((s) >> 8); \ - *(cp)++ = (u_char) (s); \ -} -#define GETLONG(l, cp) { \ - (l) = *(cp)++ << 8; \ - (l) |= *(cp)++; (l) <<= 8; \ - (l) |= *(cp)++; (l) <<= 8; \ - (l) |= *(cp)++; \ -} -#define PUTLONG(l, cp) { \ - *(cp)++ = (u_char) ((l) >> 24); \ - *(cp)++ = (u_char) ((l) >> 16); \ - *(cp)++ = (u_char) ((l) >> 8); \ - *(cp)++ = (u_char) (l); \ -} - -#define INCPTR(n, cp) ((cp) += (n)) -#define DECPTR(n, cp) ((cp) -= (n)) - -/* - * System dependent definitions for user-level 4.3BSD UNIX implementation. - */ -#define TIMEOUT(f, a, t) do { sys_untimeout((f), (a)); sys_timeout((t)*1000, (f), (a)); } while(0) -#define TIMEOUTMS(f, a, t) do { sys_untimeout((f), (a)); sys_timeout((t), (f), (a)); } while(0) -#define UNTIMEOUT(f, a) sys_untimeout((f), (a)) - -#define BZERO(s, n) memset(s, 0, n) -#define BCMP(s1, s2, l) memcmp(s1, s2, l) - -#define PRINTMSG(m, l) { ppp_info("Remote message: %0.*v", l, m); } - -/* - * MAKEHEADER - Add Header fields to a packet. - */ -#define MAKEHEADER(p, t) { \ - PUTCHAR(PPP_ALLSTATIONS, p); \ - PUTCHAR(PPP_UI, p); \ - PUTSHORT(t, p); } - -/* Procedures exported from auth.c */ -void link_required(ppp_pcb *pcb); /* we are starting to use the link */ -void link_terminated(ppp_pcb *pcb); /* we are finished with the link */ -void link_down(ppp_pcb *pcb); /* the LCP layer has left the Opened state */ -void upper_layers_down(ppp_pcb *pcb); /* take all NCPs down */ -void link_established(ppp_pcb *pcb); /* the link is up; authenticate now */ -void start_networks(ppp_pcb *pcb); /* start all the network control protos */ -void continue_networks(ppp_pcb *pcb); /* start network [ip, etc] control protos */ -#if PPP_AUTH_SUPPORT -#if PPP_SERVER -int auth_check_passwd(ppp_pcb *pcb, char *auser, int userlen, char *apasswd, int passwdlen, const char **msg, int *msglen); - /* check the user name and passwd against configuration */ -void auth_peer_fail(ppp_pcb *pcb, int protocol); - /* peer failed to authenticate itself */ -void auth_peer_success(ppp_pcb *pcb, int protocol, int prot_flavor, const char *name, int namelen); - /* peer successfully authenticated itself */ -#endif /* PPP_SERVER */ -void auth_withpeer_fail(ppp_pcb *pcb, int protocol); - /* we failed to authenticate ourselves */ -void auth_withpeer_success(ppp_pcb *pcb, int protocol, int prot_flavor); - /* we successfully authenticated ourselves */ -#endif /* PPP_AUTH_SUPPORT */ -void np_up(ppp_pcb *pcb, int proto); /* a network protocol has come up */ -void np_down(ppp_pcb *pcb, int proto); /* a network protocol has gone down */ -void np_finished(ppp_pcb *pcb, int proto); /* a network protocol no longer needs link */ -#if PPP_AUTH_SUPPORT -int get_secret(ppp_pcb *pcb, const char *client, const char *server, char *secret, int *secret_len, int am_server); - /* get "secret" for chap */ -#endif /* PPP_AUTH_SUPPORT */ - -/* Procedures exported from ipcp.c */ -/* int parse_dotted_ip (char *, u32_t *); */ - -/* Procedures exported from demand.c */ -#if DEMAND_SUPPORT -void demand_conf (void); /* config interface(s) for demand-dial */ -void demand_block (void); /* set all NPs to queue up packets */ -void demand_unblock (void); /* set all NPs to pass packets */ -void demand_discard (void); /* set all NPs to discard packets */ -void demand_rexmit (int, u32_t); /* retransmit saved frames for an NP*/ -int loop_chars (unsigned char *, int); /* process chars from loopback */ -int loop_frame (unsigned char *, int); /* should we bring link up? */ -#endif /* DEMAND_SUPPORT */ - -/* Procedures exported from multilink.c */ -#ifdef HAVE_MULTILINK -void mp_check_options (void); /* Check multilink-related options */ -int mp_join_bundle (void); /* join our link to an appropriate bundle */ -void mp_exit_bundle (void); /* have disconnected our link from bundle */ -void mp_bundle_terminated (void); -char *epdisc_to_str (struct epdisc *); /* string from endpoint discrim. */ -int str_to_epdisc (struct epdisc *, char *); /* endpt disc. from str */ -#else -#define mp_bundle_terminated() /* nothing */ -#define mp_exit_bundle() /* nothing */ -#define doing_multilink 0 -#define multilink_master 0 -#endif - -/* Procedures exported from utils.c. */ -void ppp_print_string(const u_char *p, int len, void (*printer) (void *, const char *, ...), void *arg); /* Format a string for output */ -int ppp_slprintf(char *buf, int buflen, const char *fmt, ...); /* sprintf++ */ -int ppp_vslprintf(char *buf, int buflen, const char *fmt, va_list args); /* vsprintf++ */ -size_t ppp_strlcpy(char *dest, const char *src, size_t len); /* safe strcpy */ -size_t ppp_strlcat(char *dest, const char *src, size_t len); /* safe strncpy */ -void ppp_dbglog(const char *fmt, ...); /* log a debug message */ -void ppp_info(const char *fmt, ...); /* log an informational message */ -void ppp_notice(const char *fmt, ...); /* log a notice-level message */ -void ppp_warn(const char *fmt, ...); /* log a warning message */ -void ppp_error(const char *fmt, ...); /* log an error message */ -void ppp_fatal(const char *fmt, ...); /* log an error message and die(1) */ -#if PRINTPKT_SUPPORT -void ppp_dump_packet(ppp_pcb *pcb, const char *tag, unsigned char *p, int len); - /* dump packet to debug log if interesting */ -#endif /* PRINTPKT_SUPPORT */ - - -#endif /* PPP_SUPPORT */ -#endif /* LWIP_HDR_PPP_IMPL_H */ diff --git a/tools/sdk/include/lwip/netif/ppp/ppp_opts.h b/tools/sdk/include/lwip/netif/ppp/ppp_opts.h deleted file mode 100644 index fa79c090f25..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/ppp_opts.h +++ /dev/null @@ -1,593 +0,0 @@ -/* - * 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. - * - */ - -#ifndef LWIP_PPP_OPTS_H -#define LWIP_PPP_OPTS_H - -#include "lwip/opt.h" - -/** - * PPP_SUPPORT==1: Enable PPP. - */ -#ifndef PPP_SUPPORT -#define PPP_SUPPORT 0 -#endif - -/** - * PPPOE_SUPPORT==1: Enable PPP Over Ethernet - */ -#ifndef PPPOE_SUPPORT -#define PPPOE_SUPPORT 0 -#endif - -/** - * PPPOL2TP_SUPPORT==1: Enable PPP Over L2TP - */ -#ifndef PPPOL2TP_SUPPORT -#define PPPOL2TP_SUPPORT 0 -#endif - -/** - * PPPOL2TP_AUTH_SUPPORT==1: Enable PPP Over L2TP Auth (enable MD5 support) - */ -#ifndef PPPOL2TP_AUTH_SUPPORT -#define PPPOL2TP_AUTH_SUPPORT PPPOL2TP_SUPPORT -#endif - -/** - * PPPOS_SUPPORT==1: Enable PPP Over Serial - */ -#ifndef PPPOS_SUPPORT -#define PPPOS_SUPPORT PPP_SUPPORT -#endif - -/** - * LWIP_PPP_API==1: Enable PPP API (in pppapi.c) - */ -#ifndef LWIP_PPP_API -#define LWIP_PPP_API (PPP_SUPPORT && (NO_SYS == 0)) -#endif - -/** - * MEMP_NUM_PPP_PCB: the number of simultaneously active PPP - * connections (requires the PPP_SUPPORT option) - */ -#ifndef MEMP_NUM_PPP_PCB -#define MEMP_NUM_PPP_PCB 1 -#endif - -#if PPP_SUPPORT - -/** - * MEMP_NUM_PPPOS_INTERFACES: the number of concurrently active PPPoS - * interfaces (only used with PPPOS_SUPPORT==1) - */ -#ifndef MEMP_NUM_PPPOS_INTERFACES -#define MEMP_NUM_PPPOS_INTERFACES MEMP_NUM_PPP_PCB -#endif - -/** - * MEMP_NUM_PPPOE_INTERFACES: the number of concurrently active PPPoE - * interfaces (only used with PPPOE_SUPPORT==1) - */ -#ifndef MEMP_NUM_PPPOE_INTERFACES -#define MEMP_NUM_PPPOE_INTERFACES 1 -#endif - -/** - * MEMP_NUM_PPPOL2TP_INTERFACES: the number of concurrently active PPPoL2TP - * interfaces (only used with PPPOL2TP_SUPPORT==1) - */ -#ifndef MEMP_NUM_PPPOL2TP_INTERFACES -#define MEMP_NUM_PPPOL2TP_INTERFACES 1 -#endif - -/** - * MEMP_NUM_PPP_API_MSG: Number of concurrent PPP API messages (in pppapi.c) - */ -#ifndef MEMP_NUM_PPP_API_MSG -#define MEMP_NUM_PPP_API_MSG 5 -#endif - -/** - * PPP_DEBUG: Enable debugging for PPP. - */ -#ifndef PPP_DEBUG -#define PPP_DEBUG LWIP_DBG_OFF -#endif - -/** - * PPP_INPROC_IRQ_SAFE==1 call pppos_input() using tcpip_callback(). - * - * Please read the "PPPoS input path" chapter in the PPP documentation about this option. - */ -#ifndef PPP_INPROC_IRQ_SAFE -#define PPP_INPROC_IRQ_SAFE 0 -#endif - -/** - * PRINTPKT_SUPPORT==1: Enable PPP print packet support - * - * Mandatory for debugging, it displays exchanged packet content in debug trace. - */ -#ifndef PRINTPKT_SUPPORT -#define PRINTPKT_SUPPORT 0 -#endif - -/** - * PPP_IPV4_SUPPORT==1: Enable PPP IPv4 support - */ -#ifndef PPP_IPV4_SUPPORT -#define PPP_IPV4_SUPPORT (LWIP_IPV4) -#endif - -/** - * PPP_IPV6_SUPPORT==1: Enable PPP IPv6 support - */ -#ifndef PPP_IPV6_SUPPORT -#define PPP_IPV6_SUPPORT (LWIP_IPV6) -#endif - -/** - * PPP_NOTIFY_PHASE==1: Support PPP notify phase support - * - * PPP notify phase support allows you to set a callback which is - * called on change of the internal PPP state machine. - * - * This can be used for example to set a LED pattern depending on the - * current phase of the PPP session. - */ -#ifndef PPP_NOTIFY_PHASE -#define PPP_NOTIFY_PHASE 0 -#endif - -/** - * pbuf_type PPP is using for LCP, PAP, CHAP, EAP, CCP, IPCP and IP6CP packets. - * - * Memory allocated must be single buffered for PPP to works, it requires pbuf - * that are not going to be chained when allocated. This requires setting - * PBUF_POOL_BUFSIZE to at least 512 bytes, which is quite huge for small systems. - * - * Setting PPP_USE_PBUF_RAM to 1 makes PPP use memory from heap where continuous - * buffers are required, allowing you to use a smaller PBUF_POOL_BUFSIZE. - */ -#ifndef PPP_USE_PBUF_RAM -#define PPP_USE_PBUF_RAM 0 -#endif - -/** - * PPP_FCS_TABLE: Keep a 256*2 byte table to speed up FCS calculation for PPPoS - */ -#ifndef PPP_FCS_TABLE -#define PPP_FCS_TABLE 1 -#endif - -/** - * PAP_SUPPORT==1: Support PAP. - */ -#ifndef PAP_SUPPORT -#define PAP_SUPPORT 0 -#endif - -/** - * CHAP_SUPPORT==1: Support CHAP. - */ -#ifndef CHAP_SUPPORT -#define CHAP_SUPPORT 0 -#endif - -/** - * MSCHAP_SUPPORT==1: Support MSCHAP. - */ -#ifndef MSCHAP_SUPPORT -#define MSCHAP_SUPPORT 0 -#endif -#if MSCHAP_SUPPORT -/* MSCHAP requires CHAP support */ -#undef CHAP_SUPPORT -#define CHAP_SUPPORT 1 -#endif /* MSCHAP_SUPPORT */ - -/** - * EAP_SUPPORT==1: Support EAP. - */ -#ifndef EAP_SUPPORT -#define EAP_SUPPORT 0 -#endif - -/** - * CCP_SUPPORT==1: Support CCP. - */ -#ifndef CCP_SUPPORT -#define CCP_SUPPORT 0 -#endif - -/** - * MPPE_SUPPORT==1: Support MPPE. - */ -#ifndef MPPE_SUPPORT -#define MPPE_SUPPORT 0 -#endif -#if MPPE_SUPPORT -/* MPPE requires CCP support */ -#undef CCP_SUPPORT -#define CCP_SUPPORT 1 -/* MPPE requires MSCHAP support */ -#undef MSCHAP_SUPPORT -#define MSCHAP_SUPPORT 1 -/* MSCHAP requires CHAP support */ -#undef CHAP_SUPPORT -#define CHAP_SUPPORT 1 -#endif /* MPPE_SUPPORT */ - -/** - * CBCP_SUPPORT==1: Support CBCP. CURRENTLY NOT SUPPORTED! DO NOT SET! - */ -#ifndef CBCP_SUPPORT -#define CBCP_SUPPORT 0 -#endif - -/** - * ECP_SUPPORT==1: Support ECP. CURRENTLY NOT SUPPORTED! DO NOT SET! - */ -#ifndef ECP_SUPPORT -#define ECP_SUPPORT 0 -#endif - -/** - * DEMAND_SUPPORT==1: Support dial on demand. CURRENTLY NOT SUPPORTED! DO NOT SET! - */ -#ifndef DEMAND_SUPPORT -#define DEMAND_SUPPORT 0 -#endif - -/** - * LQR_SUPPORT==1: Support Link Quality Report. Do nothing except exchanging some LCP packets. - */ -#ifndef LQR_SUPPORT -#define LQR_SUPPORT 0 -#endif - -/** - * PPP_SERVER==1: Enable PPP server support (waiting for incoming PPP session). - * - * Currently only supported for PPPoS. - */ -#ifndef PPP_SERVER -#define PPP_SERVER 0 -#endif - -#if PPP_SERVER -/* - * PPP_OUR_NAME: Our name for authentication purposes - */ -#ifndef PPP_OUR_NAME -#define PPP_OUR_NAME "lwIP" -#endif -#endif /* PPP_SERVER */ - -/** - * VJ_SUPPORT==1: Support VJ header compression. - */ -#ifndef VJ_SUPPORT -#define VJ_SUPPORT 1 -#endif -/* VJ compression is only supported for TCP over IPv4 over PPPoS. */ -#if !PPPOS_SUPPORT || !PPP_IPV4_SUPPORT || !LWIP_TCP -#undef VJ_SUPPORT -#define VJ_SUPPORT 0 -#endif /* !PPPOS_SUPPORT */ - -/** - * PPP_MD5_RANDM==1: Use MD5 for better randomness. - * Enabled by default if CHAP, EAP, or L2TP AUTH support is enabled. - */ -#ifndef PPP_MD5_RANDM -#define PPP_MD5_RANDM (CHAP_SUPPORT || EAP_SUPPORT || PPPOL2TP_AUTH_SUPPORT) -#endif - -/** - * PolarSSL embedded library - * - * - * lwIP contains some files fetched from the latest BSD release of - * the PolarSSL project (PolarSSL 0.10.1-bsd) for ciphers and encryption - * methods we need for lwIP PPP support. - * - * The PolarSSL files were cleaned to contain only the necessary struct - * fields and functions needed for lwIP. - * - * The PolarSSL API was not changed at all, so if you are already using - * PolarSSL you can choose to skip the compilation of the included PolarSSL - * library into lwIP. - * - * If you are not using the embedded copy you must include external - * libraries into your arch/cc.h port file. - * - * Beware of the stack requirements which can be a lot larger if you are not - * using our cleaned PolarSSL library. - */ - -/** - * LWIP_USE_EXTERNAL_POLARSSL: Use external PolarSSL library - */ -#ifndef LWIP_USE_EXTERNAL_POLARSSL -#define LWIP_USE_EXTERNAL_POLARSSL 0 -#endif - -/** - * LWIP_USE_EXTERNAL_MBEDTLS: Use external mbed TLS library - */ -#ifndef LWIP_USE_EXTERNAL_MBEDTLS -#define LWIP_USE_EXTERNAL_MBEDTLS 0 -#endif - -/* - * PPP Timeouts - */ - -/** - * FSM_DEFTIMEOUT: Timeout time in seconds - */ -#ifndef FSM_DEFTIMEOUT -#define FSM_DEFTIMEOUT 6 -#endif - -/** - * FSM_DEFMAXTERMREQS: Maximum Terminate-Request transmissions - */ -#ifndef FSM_DEFMAXTERMREQS -#define FSM_DEFMAXTERMREQS 2 -#endif - -/** - * FSM_DEFMAXCONFREQS: Maximum Configure-Request transmissions - */ -#ifndef FSM_DEFMAXCONFREQS -#define FSM_DEFMAXCONFREQS 10 -#endif - -/** - * FSM_DEFMAXNAKLOOPS: Maximum number of nak loops - */ -#ifndef FSM_DEFMAXNAKLOOPS -#define FSM_DEFMAXNAKLOOPS 5 -#endif - -/** - * UPAP_DEFTIMEOUT: Timeout (seconds) for retransmitting req - */ -#ifndef UPAP_DEFTIMEOUT -#define UPAP_DEFTIMEOUT 6 -#endif - -/** - * UPAP_DEFTRANSMITS: Maximum number of auth-reqs to send - */ -#ifndef UPAP_DEFTRANSMITS -#define UPAP_DEFTRANSMITS 10 -#endif - -#if PPP_SERVER -/** - * UPAP_DEFREQTIME: Time to wait for auth-req from peer - */ -#ifndef UPAP_DEFREQTIME -#define UPAP_DEFREQTIME 30 -#endif -#endif /* PPP_SERVER */ - -/** - * CHAP_DEFTIMEOUT: Timeout (seconds) for retransmitting req - */ -#ifndef CHAP_DEFTIMEOUT -#define CHAP_DEFTIMEOUT 6 -#endif - -/** - * CHAP_DEFTRANSMITS: max # times to send challenge - */ -#ifndef CHAP_DEFTRANSMITS -#define CHAP_DEFTRANSMITS 10 -#endif - -#if PPP_SERVER -/** - * CHAP_DEFRECHALLENGETIME: If this option is > 0, rechallenge the peer every n seconds - */ -#ifndef CHAP_DEFRECHALLENGETIME -#define CHAP_DEFRECHALLENGETIME 0 -#endif -#endif /* PPP_SERVER */ - -/** - * EAP_DEFREQTIME: Time to wait for peer request - */ -#ifndef EAP_DEFREQTIME -#define EAP_DEFREQTIME 6 -#endif - -/** - * EAP_DEFALLOWREQ: max # times to accept requests - */ -#ifndef EAP_DEFALLOWREQ -#define EAP_DEFALLOWREQ 10 -#endif - -#if PPP_SERVER -/** - * EAP_DEFTIMEOUT: Timeout (seconds) for rexmit - */ -#ifndef EAP_DEFTIMEOUT -#define EAP_DEFTIMEOUT 6 -#endif - -/** - * EAP_DEFTRANSMITS: max # times to transmit - */ -#ifndef EAP_DEFTRANSMITS -#define EAP_DEFTRANSMITS 10 -#endif -#endif /* PPP_SERVER */ - -/** - * LCP_DEFLOOPBACKFAIL: Default number of times we receive our magic number from the peer - * before deciding the link is looped-back. - */ -#ifndef LCP_DEFLOOPBACKFAIL -#define LCP_DEFLOOPBACKFAIL 10 -#endif - -/** - * LCP_ECHOINTERVAL: Interval in seconds between keepalive echo requests, 0 to disable. - */ -#ifndef LCP_ECHOINTERVAL -#define LCP_ECHOINTERVAL 0 -#endif - -/** - * LCP_MAXECHOFAILS: Number of unanswered echo requests before failure. - */ -#ifndef LCP_MAXECHOFAILS -#define LCP_MAXECHOFAILS 3 -#endif - -/** - * PPP_MAXIDLEFLAG: Max Xmit idle time (in ms) before resend flag char. - */ -#ifndef PPP_MAXIDLEFLAG -#define PPP_MAXIDLEFLAG 100 -#endif - -/** - * PPP Packet sizes - */ - -/** - * PPP_MRU: Default MRU - */ -#ifndef PPP_MRU -#define PPP_MRU 1500 -#endif - -/** - * PPP_DEFMRU: Default MRU to try - */ -#ifndef PPP_DEFMRU -#define PPP_DEFMRU 1500 -#endif - -/** - * PPP_MAXMRU: Normally limit MRU to this (pppd default = 16384) - */ -#ifndef PPP_MAXMRU -#define PPP_MAXMRU 1500 -#endif - -/** - * PPP_MINMRU: No MRUs below this - */ -#ifndef PPP_MINMRU -#define PPP_MINMRU 128 -#endif - -/** - * PPPOL2TP_DEFMRU: Default MTU and MRU for L2TP - * Default = 1500 - PPPoE(6) - PPP Protocol(2) - IPv4 header(20) - UDP Header(8) - * - L2TP Header(6) - HDLC Header(2) - PPP Protocol(2) - MPPE Header(2) - PPP Protocol(2) - */ -#if PPPOL2TP_SUPPORT -#ifndef PPPOL2TP_DEFMRU -#define PPPOL2TP_DEFMRU 1450 -#endif -#endif /* PPPOL2TP_SUPPORT */ - -/** - * MAXNAMELEN: max length of hostname or name for auth - */ -#ifndef MAXNAMELEN -#define MAXNAMELEN 256 -#endif - -/** - * MAXSECRETLEN: max length of password or secret - */ -#ifndef MAXSECRETLEN -#define MAXSECRETLEN 256 -#endif - -/* ------------------------------------------------------------------------- */ - -/* - * Build triggers for embedded PolarSSL - */ -#if !LWIP_USE_EXTERNAL_POLARSSL && !LWIP_USE_EXTERNAL_MBEDTLS - -/* CHAP, EAP, L2TP AUTH and MD5 Random require MD5 support */ -#if CHAP_SUPPORT || EAP_SUPPORT || PPPOL2TP_AUTH_SUPPORT || PPP_MD5_RANDM -#define LWIP_INCLUDED_POLARSSL_MD5 1 -#endif /* CHAP_SUPPORT || EAP_SUPPORT || PPPOL2TP_AUTH_SUPPORT || PPP_MD5_RANDM */ - -#if MSCHAP_SUPPORT - -/* MSCHAP require MD4 support */ -#define LWIP_INCLUDED_POLARSSL_MD4 1 -/* MSCHAP require SHA1 support */ -#define LWIP_INCLUDED_POLARSSL_SHA1 1 -/* MSCHAP require DES support */ -#define LWIP_INCLUDED_POLARSSL_DES 1 - -/* MS-CHAP support is required for MPPE */ -#if MPPE_SUPPORT -/* MPPE require ARC4 support */ -#define LWIP_INCLUDED_POLARSSL_ARC4 1 -#endif /* MPPE_SUPPORT */ - -#endif /* MSCHAP_SUPPORT */ - -#endif /* !LWIP_USE_EXTERNAL_POLARSSL && !LWIP_USE_EXTERNAL_MBEDTLS */ - -/* Default value if unset */ -#ifndef LWIP_INCLUDED_POLARSSL_MD4 -#define LWIP_INCLUDED_POLARSSL_MD4 0 -#endif /* LWIP_INCLUDED_POLARSSL_MD4 */ -#ifndef LWIP_INCLUDED_POLARSSL_MD5 -#define LWIP_INCLUDED_POLARSSL_MD5 0 -#endif /* LWIP_INCLUDED_POLARSSL_MD5 */ -#ifndef LWIP_INCLUDED_POLARSSL_SHA1 -#define LWIP_INCLUDED_POLARSSL_SHA1 0 -#endif /* LWIP_INCLUDED_POLARSSL_SHA1 */ -#ifndef LWIP_INCLUDED_POLARSSL_DES -#define LWIP_INCLUDED_POLARSSL_DES 0 -#endif /* LWIP_INCLUDED_POLARSSL_DES */ -#ifndef LWIP_INCLUDED_POLARSSL_ARC4 -#define LWIP_INCLUDED_POLARSSL_ARC4 0 -#endif /* LWIP_INCLUDED_POLARSSL_ARC4 */ - -#endif /* PPP_SUPPORT */ - -#endif /* LWIP_PPP_OPTS_H */ diff --git a/tools/sdk/include/lwip/netif/ppp/pppapi.h b/tools/sdk/include/lwip/netif/ppp/pppapi.h deleted file mode 100644 index 9bda2a8cfd7..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/pppapi.h +++ /dev/null @@ -1,147 +0,0 @@ -/* - * 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. - * - */ - -#ifndef LWIP_PPPAPI_H -#define LWIP_PPPAPI_H - -#include "netif/ppp/ppp_opts.h" - -#if LWIP_PPP_API /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/sys.h" -#include "lwip/netif.h" -#include "lwip/priv/tcpip_priv.h" -#include "netif/ppp/ppp.h" -#if PPPOS_SUPPORT -#include "netif/ppp/pppos.h" -#endif /* PPPOS_SUPPORT */ - -#ifdef __cplusplus -extern "C" { -#endif - -struct pppapi_msg_msg { - ppp_pcb *ppp; - union { -#if ESP_LWIP - struct { - u8_t authtype; - const char *user; - const char *passwd; - } setauth; -#endif -#if PPP_NOTIFY_PHASE - struct { - ppp_notify_phase_cb_fn notify_phase_cb; - } setnotifyphasecb; -#endif /* PPP_NOTIFY_PHASE */ -#if PPPOS_SUPPORT - struct { - struct netif *pppif; - pppos_output_cb_fn output_cb; - ppp_link_status_cb_fn link_status_cb; - void *ctx_cb; - } serialcreate; -#endif /* PPPOS_SUPPORT */ -#if PPPOE_SUPPORT - struct { - struct netif *pppif; - struct netif *ethif; - const char *service_name; - const char *concentrator_name; - ppp_link_status_cb_fn link_status_cb; - void *ctx_cb; - } ethernetcreate; -#endif /* PPPOE_SUPPORT */ -#if PPPOL2TP_SUPPORT - struct { - struct netif *pppif; - struct netif *netif; - API_MSG_M_DEF_C(ip_addr_t, ipaddr); - u16_t port; -#if PPPOL2TP_AUTH_SUPPORT - const u8_t *secret; - u8_t secret_len; -#endif /* PPPOL2TP_AUTH_SUPPORT */ - ppp_link_status_cb_fn link_status_cb; - void *ctx_cb; - } l2tpcreate; -#endif /* PPPOL2TP_SUPPORT */ - struct { - u16_t holdoff; - } connect; - struct { - u8_t nocarrier; - } close; - struct { - u8_t cmd; - void *arg; - } ioctl; - } msg; -}; - -struct pppapi_msg { - struct tcpip_api_call_data call; - struct pppapi_msg_msg msg; -}; - -/* API for application */ -err_t pppapi_set_default(ppp_pcb *pcb); -#if ESP_LWIP -void pppapi_set_auth(ppp_pcb *pcb, u8_t authtype, const char *user, const char *passwd); -#endif -#if PPP_NOTIFY_PHASE -err_t pppapi_set_notify_phase_callback(ppp_pcb *pcb, ppp_notify_phase_cb_fn notify_phase_cb); -#endif /* PPP_NOTIFY_PHASE */ -#if PPPOS_SUPPORT -ppp_pcb *pppapi_pppos_create(struct netif *pppif, pppos_output_cb_fn output_cb, ppp_link_status_cb_fn link_status_cb, void *ctx_cb); -#endif /* PPPOS_SUPPORT */ -#if PPPOE_SUPPORT -ppp_pcb *pppapi_pppoe_create(struct netif *pppif, struct netif *ethif, const char *service_name, - const char *concentrator_name, ppp_link_status_cb_fn link_status_cb, - void *ctx_cb); -#endif /* PPPOE_SUPPORT */ -#if PPPOL2TP_SUPPORT -ppp_pcb *pppapi_pppol2tp_create(struct netif *pppif, struct netif *netif, ip_addr_t *ipaddr, u16_t port, - const u8_t *secret, u8_t secret_len, - ppp_link_status_cb_fn link_status_cb, void *ctx_cb); -#endif /* PPPOL2TP_SUPPORT */ -err_t pppapi_connect(ppp_pcb *pcb, u16_t holdoff); -#if PPP_SERVER -err_t pppapi_listen(ppp_pcb *pcb); -#endif /* PPP_SERVER */ -err_t pppapi_close(ppp_pcb *pcb, u8_t nocarrier); -err_t pppapi_free(ppp_pcb *pcb); -err_t pppapi_ioctl(ppp_pcb *pcb, u8_t cmd, void *arg); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_PPP_API */ - -#endif /* LWIP_PPPAPI_H */ diff --git a/tools/sdk/include/lwip/netif/ppp/pppcrypt.h b/tools/sdk/include/lwip/netif/ppp/pppcrypt.h deleted file mode 100644 index a7b2099f25e..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/pppcrypt.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * pppcrypt.c - PPP/DES linkage for MS-CHAP and EAP SRP-SHA1 - * - * Extracted from chap_ms.c by James Carlson. - * - * Copyright (c) 1995 Eric Rosenquist. All rights reserved. - * - * 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(s) of the authors of this software must not be used to - * endorse or promote products derived from this software without - * prior written permission. - * - * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "netif/ppp/ppp_opts.h" -#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ - -/* This header file is included in all PPP modules needing hashes and/or ciphers */ - -#ifndef PPPCRYPT_H -#define PPPCRYPT_H - -/* - * If included PolarSSL copy is not used, user is expected to include - * external libraries in arch/cc.h (which is included by lwip/arch.h). - */ -#include "lwip/arch.h" - -/* - * Map hashes and ciphers functions to PolarSSL - */ -#if !LWIP_USE_EXTERNAL_MBEDTLS - -#include "netif/ppp/polarssl/md4.h" -#define lwip_md4_context md4_context -#define lwip_md4_init(context) -#define lwip_md4_starts md4_starts -#define lwip_md4_update md4_update -#define lwip_md4_finish md4_finish -#define lwip_md4_free(context) - -#include "netif/ppp/polarssl/md5.h" -#define lwip_md5_context md5_context -#define lwip_md5_init(context) -#define lwip_md5_starts md5_starts -#define lwip_md5_update md5_update -#define lwip_md5_finish md5_finish -#define lwip_md5_free(context) - -#include "netif/ppp/polarssl/sha1.h" -#define lwip_sha1_context sha1_context -#define lwip_sha1_init(context) -#define lwip_sha1_starts sha1_starts -#define lwip_sha1_update sha1_update -#define lwip_sha1_finish sha1_finish -#define lwip_sha1_free(context) - -#include "netif/ppp/polarssl/des.h" -#define lwip_des_context des_context -#define lwip_des_init(context) -#define lwip_des_setkey_enc des_setkey_enc -#define lwip_des_crypt_ecb des_crypt_ecb -#define lwip_des_free(context) - -#include "netif/ppp/polarssl/arc4.h" -#define lwip_arc4_context arc4_context -#define lwip_arc4_init(context) -#define lwip_arc4_setup arc4_setup -#define lwip_arc4_crypt arc4_crypt -#define lwip_arc4_free(context) - -#endif /* !LWIP_USE_EXTERNAL_MBEDTLS */ - -/* - * Map hashes and ciphers functions to mbed TLS - */ -#if LWIP_USE_EXTERNAL_MBEDTLS - -#define lwip_md4_context mbedtls_md4_context -#define lwip_md4_init mbedtls_md4_init -#define lwip_md4_starts mbedtls_md4_starts -#define lwip_md4_update mbedtls_md4_update -#define lwip_md4_finish mbedtls_md4_finish -#define lwip_md4_free mbedtls_md4_free - -#define lwip_md5_context mbedtls_md5_context -#define lwip_md5_init mbedtls_md5_init -#define lwip_md5_starts mbedtls_md5_starts -#define lwip_md5_update mbedtls_md5_update -#define lwip_md5_finish mbedtls_md5_finish -#define lwip_md5_free mbedtls_md5_free - -#define lwip_sha1_context mbedtls_sha1_context -#define lwip_sha1_init mbedtls_sha1_init -#define lwip_sha1_starts mbedtls_sha1_starts -#define lwip_sha1_update mbedtls_sha1_update -#define lwip_sha1_finish mbedtls_sha1_finish -#define lwip_sha1_free mbedtls_sha1_free - -#define lwip_des_context mbedtls_des_context -#define lwip_des_init mbedtls_des_init -#define lwip_des_setkey_enc mbedtls_des_setkey_enc -#define lwip_des_crypt_ecb mbedtls_des_crypt_ecb -#define lwip_des_free mbedtls_des_free - -#define lwip_arc4_context mbedtls_arc4_context -#define lwip_arc4_init mbedtls_arc4_init -#define lwip_arc4_setup mbedtls_arc4_setup -#define lwip_arc4_crypt(context, buffer, length) mbedtls_arc4_crypt(context, length, buffer, buffer) -#define lwip_arc4_free mbedtls_arc4_free - -#endif /* LWIP_USE_EXTERNAL_MBEDTLS */ - -void pppcrypt_56_to_64_bit_key(u_char *key, u_char *des_key); - -#endif /* PPPCRYPT_H */ - -#endif /* PPP_SUPPORT */ diff --git a/tools/sdk/include/lwip/netif/ppp/pppdebug.h b/tools/sdk/include/lwip/netif/ppp/pppdebug.h deleted file mode 100644 index 7ead0459104..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/pppdebug.h +++ /dev/null @@ -1,80 +0,0 @@ -/***************************************************************************** -* pppdebug.h - System debugging utilities. -* -* Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc. -* portions Copyright (c) 1998 Global Election Systems Inc. -* portions Copyright (c) 2001 by Cognizant Pty Ltd. -* -* The authors hereby grant permission to use, copy, modify, distribute, -* and license this software and its documentation for any purpose, provided -* that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any -* distributions. No written agreement, license, or royalty fee is required -* for any of the authorized uses. -* -* THIS SOFTWARE IS PROVIDED BY THE 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 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. -* -****************************************************************************** -* REVISION HISTORY (please don't use tabs!) -* -* 03-01-01 Marc Boucher -* Ported to lwIP. -* 98-07-29 Guy Lancaster , Global Election Systems Inc. -* Original. -* -***************************************************************************** -*/ - -#include "netif/ppp/ppp_opts.h" -#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ - -#ifndef PPPDEBUG_H -#define PPPDEBUG_H - -/* Trace levels. */ -#define LOG_CRITICAL (PPP_DEBUG | LWIP_DBG_LEVEL_SEVERE) -#define LOG_ERR (PPP_DEBUG | LWIP_DBG_LEVEL_SEVERE) -#define LOG_NOTICE (PPP_DEBUG | LWIP_DBG_LEVEL_WARNING) -#define LOG_WARNING (PPP_DEBUG | LWIP_DBG_LEVEL_WARNING) -#define LOG_INFO (PPP_DEBUG) -#define LOG_DETAIL (PPP_DEBUG) -#define LOG_DEBUG (PPP_DEBUG) - -#if PPP_DEBUG - -#define MAINDEBUG(a) LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a) -#define SYSDEBUG(a) LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a) -#define FSMDEBUG(a) LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a) -#define LCPDEBUG(a) LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a) -#define IPCPDEBUG(a) LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a) -#define IPV6CPDEBUG(a) LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a) -#define UPAPDEBUG(a) LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a) -#define CHAPDEBUG(a) LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a) -#define PPPDEBUG(a, b) LWIP_DEBUGF(a, b) - -#else /* PPP_DEBUG */ - -#define MAINDEBUG(a) -#define SYSDEBUG(a) -#define FSMDEBUG(a) -#define LCPDEBUG(a) -#define IPCPDEBUG(a) -#define IPV6CPDEBUG(a) -#define UPAPDEBUG(a) -#define CHAPDEBUG(a) -#define PPPDEBUG(a, b) - -#endif /* PPP_DEBUG */ - -#endif /* PPPDEBUG_H */ - -#endif /* PPP_SUPPORT */ diff --git a/tools/sdk/include/lwip/netif/ppp/pppoe.h b/tools/sdk/include/lwip/netif/ppp/pppoe.h deleted file mode 100644 index 9f8f2892b43..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/pppoe.h +++ /dev/null @@ -1,179 +0,0 @@ -/***************************************************************************** -* pppoe.h - PPP Over Ethernet implementation for lwIP. -* -* Copyright (c) 2006 by Marc Boucher, Services Informatiques (MBSI) inc. -* -* The authors hereby grant permission to use, copy, modify, distribute, -* and license this software and its documentation for any purpose, provided -* that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any -* distributions. No written agreement, license, or royalty fee is required -* for any of the authorized uses. -* -* THIS SOFTWARE IS PROVIDED BY THE 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 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. -* -****************************************************************************** -* REVISION HISTORY -* -* 06-01-01 Marc Boucher -* Ported to lwIP. -*****************************************************************************/ - - - -/* based on NetBSD: if_pppoe.c,v 1.64 2006/01/31 23:50:15 martin Exp */ - -/*- - * Copyright (c) 2002 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Martin Husemann . - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. - */ -#include "netif/ppp/ppp_opts.h" -#if PPP_SUPPORT && PPPOE_SUPPORT /* don't build if not configured for use in lwipopts.h */ - -#ifndef PPP_OE_H -#define PPP_OE_H - -#include "ppp.h" -#include "lwip/etharp.h" - -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct pppoehdr { - PACK_STRUCT_FLD_8(u8_t vertype); - PACK_STRUCT_FLD_8(u8_t code); - PACK_STRUCT_FIELD(u16_t session); - PACK_STRUCT_FIELD(u16_t plen); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct pppoetag { - PACK_STRUCT_FIELD(u16_t tag); - PACK_STRUCT_FIELD(u16_t len); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - - -#define PPPOE_STATE_INITIAL 0 -#define PPPOE_STATE_PADI_SENT 1 -#define PPPOE_STATE_PADR_SENT 2 -#define PPPOE_STATE_SESSION 3 -/* passive */ -#define PPPOE_STATE_PADO_SENT 1 - -#define PPPOE_HEADERLEN sizeof(struct pppoehdr) -#define PPPOE_VERTYPE 0x11 /* VER=1, TYPE = 1 */ - -#define PPPOE_TAG_EOL 0x0000 /* end of list */ -#define PPPOE_TAG_SNAME 0x0101 /* service name */ -#define PPPOE_TAG_ACNAME 0x0102 /* access concentrator name */ -#define PPPOE_TAG_HUNIQUE 0x0103 /* host unique */ -#define PPPOE_TAG_ACCOOKIE 0x0104 /* AC cookie */ -#define PPPOE_TAG_VENDOR 0x0105 /* vendor specific */ -#define PPPOE_TAG_RELAYSID 0x0110 /* relay session id */ -#define PPPOE_TAG_SNAME_ERR 0x0201 /* service name error */ -#define PPPOE_TAG_ACSYS_ERR 0x0202 /* AC system error */ -#define PPPOE_TAG_GENERIC_ERR 0x0203 /* gerneric error */ - -#define PPPOE_CODE_PADI 0x09 /* Active Discovery Initiation */ -#define PPPOE_CODE_PADO 0x07 /* Active Discovery Offer */ -#define PPPOE_CODE_PADR 0x19 /* Active Discovery Request */ -#define PPPOE_CODE_PADS 0x65 /* Active Discovery Session confirmation */ -#define PPPOE_CODE_PADT 0xA7 /* Active Discovery Terminate */ - -#ifndef PPPOE_MAX_AC_COOKIE_LEN -#define PPPOE_MAX_AC_COOKIE_LEN 64 -#endif - -struct pppoe_softc { - struct pppoe_softc *next; - struct netif *sc_ethif; /* ethernet interface we are using */ - ppp_pcb *pcb; /* PPP PCB */ - - struct eth_addr sc_dest; /* hardware address of concentrator */ - u16_t sc_session; /* PPPoE session id */ - u8_t sc_state; /* discovery phase or session connected */ - -#ifdef PPPOE_TODO - u8_t *sc_service_name; /* if != NULL: requested name of service */ - u8_t *sc_concentrator_name; /* if != NULL: requested concentrator id */ -#endif /* PPPOE_TODO */ - u8_t sc_ac_cookie[PPPOE_MAX_AC_COOKIE_LEN]; /* content of AC cookie we must echo back */ - u8_t sc_ac_cookie_len; /* length of cookie data */ -#ifdef PPPOE_SERVER - u8_t *sc_hunique; /* content of host unique we must echo back */ - u8_t sc_hunique_len; /* length of host unique */ -#endif - u8_t sc_padi_retried; /* number of PADI retries already done */ - u8_t sc_padr_retried; /* number of PADR retries already done */ -}; - - -#define pppoe_init() /* compatibility define, no initialization needed */ - -ppp_pcb *pppoe_create(struct netif *pppif, - struct netif *ethif, - const char *service_name, const char *concentrator_name, - ppp_link_status_cb_fn link_status_cb, void *ctx_cb); - -/* - * Functions called from lwIP - * DO NOT CALL FROM lwIP USER APPLICATION. - */ -void pppoe_disc_input(struct netif *netif, struct pbuf *p); -void pppoe_data_input(struct netif *netif, struct pbuf *p); - -#endif /* PPP_OE_H */ - -#endif /* PPP_SUPPORT && PPPOE_SUPPORT */ diff --git a/tools/sdk/include/lwip/netif/ppp/pppol2tp.h b/tools/sdk/include/lwip/netif/ppp/pppol2tp.h deleted file mode 100644 index f03950e65df..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/pppol2tp.h +++ /dev/null @@ -1,201 +0,0 @@ -/** - * @file - * Network Point to Point Protocol over Layer 2 Tunneling Protocol header file. - * - */ - -/* - * 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. - * - */ - -#include "netif/ppp/ppp_opts.h" -#if PPP_SUPPORT && PPPOL2TP_SUPPORT /* don't build if not configured for use in lwipopts.h */ - -#ifndef PPPOL2TP_H -#define PPPOL2TP_H - -#include "ppp.h" - -/* Timeout */ -#define PPPOL2TP_CONTROL_TIMEOUT (5*1000) /* base for quick timeout calculation */ -#define PPPOL2TP_SLOW_RETRY (60*1000) /* persistent retry interval */ - -#define PPPOL2TP_MAXSCCRQ 4 /* retry SCCRQ four times (quickly) */ -#define PPPOL2TP_MAXICRQ 4 /* retry IRCQ four times */ -#define PPPOL2TP_MAXICCN 4 /* retry ICCN four times */ - -/* L2TP header flags */ -#define PPPOL2TP_HEADERFLAG_CONTROL 0x8000 -#define PPPOL2TP_HEADERFLAG_LENGTH 0x4000 -#define PPPOL2TP_HEADERFLAG_SEQUENCE 0x0800 -#define PPPOL2TP_HEADERFLAG_OFFSET 0x0200 -#define PPPOL2TP_HEADERFLAG_PRIORITY 0x0100 -#define PPPOL2TP_HEADERFLAG_VERSION 0x0002 - -/* Mandatory bits for control: Control, Length, Sequence, Version 2 */ -#define PPPOL2TP_HEADERFLAG_CONTROL_MANDATORY (PPPOL2TP_HEADERFLAG_CONTROL|PPPOL2TP_HEADERFLAG_LENGTH|PPPOL2TP_HEADERFLAG_SEQUENCE|PPPOL2TP_HEADERFLAG_VERSION) -/* Forbidden bits for control: Offset, Priority */ -#define PPPOL2TP_HEADERFLAG_CONTROL_FORBIDDEN (PPPOL2TP_HEADERFLAG_OFFSET|PPPOL2TP_HEADERFLAG_PRIORITY) - -/* Mandatory bits for data: Version 2 */ -#define PPPOL2TP_HEADERFLAG_DATA_MANDATORY (PPPOL2TP_HEADERFLAG_VERSION) - -/* AVP (Attribute Value Pair) header */ -#define PPPOL2TP_AVPHEADERFLAG_MANDATORY 0x8000 -#define PPPOL2TP_AVPHEADERFLAG_HIDDEN 0x4000 -#define PPPOL2TP_AVPHEADERFLAG_LENGTHMASK 0x03ff - -/* -- AVP - Message type */ -#define PPPOL2TP_AVPTYPE_MESSAGE 0 /* Message type */ - -/* Control Connection Management */ -#define PPPOL2TP_MESSAGETYPE_SCCRQ 1 /* Start Control Connection Request */ -#define PPPOL2TP_MESSAGETYPE_SCCRP 2 /* Start Control Connection Reply */ -#define PPPOL2TP_MESSAGETYPE_SCCCN 3 /* Start Control Connection Connected */ -#define PPPOL2TP_MESSAGETYPE_STOPCCN 4 /* Stop Control Connection Notification */ -#define PPPOL2TP_MESSAGETYPE_HELLO 6 /* Hello */ -/* Call Management */ -#define PPPOL2TP_MESSAGETYPE_OCRQ 7 /* Outgoing Call Request */ -#define PPPOL2TP_MESSAGETYPE_OCRP 8 /* Outgoing Call Reply */ -#define PPPOL2TP_MESSAGETYPE_OCCN 9 /* Outgoing Call Connected */ -#define PPPOL2TP_MESSAGETYPE_ICRQ 10 /* Incoming Call Request */ -#define PPPOL2TP_MESSAGETYPE_ICRP 11 /* Incoming Call Reply */ -#define PPPOL2TP_MESSAGETYPE_ICCN 12 /* Incoming Call Connected */ -#define PPPOL2TP_MESSAGETYPE_CDN 14 /* Call Disconnect Notify */ -/* Error reporting */ -#define PPPOL2TP_MESSAGETYPE_WEN 15 /* WAN Error Notify */ -/* PPP Session Control */ -#define PPPOL2TP_MESSAGETYPE_SLI 16 /* Set Link Info */ - -/* -- AVP - Result code */ -#define PPPOL2TP_AVPTYPE_RESULTCODE 1 /* Result code */ -#define PPPOL2TP_RESULTCODE 1 /* General request to clear control connection */ - -/* -- AVP - Protocol version (!= L2TP Header version) */ -#define PPPOL2TP_AVPTYPE_VERSION 2 -#define PPPOL2TP_VERSION 0x0100 /* L2TP Protocol version 1, revision 0 */ - -/* -- AVP - Framing capabilities */ -#define PPPOL2TP_AVPTYPE_FRAMINGCAPABILITIES 3 /* Bearer capabilities */ -#define PPPOL2TP_FRAMINGCAPABILITIES 0x00000003 /* Async + Sync framing */ - -/* -- AVP - Bearer capabilities */ -#define PPPOL2TP_AVPTYPE_BEARERCAPABILITIES 4 /* Bearer capabilities */ -#define PPPOL2TP_BEARERCAPABILITIES 0x00000003 /* Analog + Digital Access */ - -/* -- AVP - Tie breaker */ -#define PPPOL2TP_AVPTYPE_TIEBREAKER 5 - -/* -- AVP - Host name */ -#define PPPOL2TP_AVPTYPE_HOSTNAME 7 /* Host name */ -#define PPPOL2TP_HOSTNAME "lwIP" /* FIXME: make it configurable */ - -/* -- AVP - Vendor name */ -#define PPPOL2TP_AVPTYPE_VENDORNAME 8 /* Vendor name */ -#define PPPOL2TP_VENDORNAME "lwIP" /* FIXME: make it configurable */ - -/* -- AVP - Assign tunnel ID */ -#define PPPOL2TP_AVPTYPE_TUNNELID 9 /* Assign Tunnel ID */ - -/* -- AVP - Receive window size */ -#define PPPOL2TP_AVPTYPE_RECEIVEWINDOWSIZE 10 /* Receive window size */ -#define PPPOL2TP_RECEIVEWINDOWSIZE 8 /* FIXME: make it configurable */ - -/* -- AVP - Challenge */ -#define PPPOL2TP_AVPTYPE_CHALLENGE 11 /* Challenge */ - -/* -- AVP - Cause code */ -#define PPPOL2TP_AVPTYPE_CAUSECODE 12 /* Cause code*/ - -/* -- AVP - Challenge response */ -#define PPPOL2TP_AVPTYPE_CHALLENGERESPONSE 13 /* Challenge response */ -#define PPPOL2TP_AVPTYPE_CHALLENGERESPONSE_SIZE 16 - -/* -- AVP - Assign session ID */ -#define PPPOL2TP_AVPTYPE_SESSIONID 14 /* Assign Session ID */ - -/* -- AVP - Call serial number */ -#define PPPOL2TP_AVPTYPE_CALLSERIALNUMBER 15 /* Call Serial Number */ - -/* -- AVP - Framing type */ -#define PPPOL2TP_AVPTYPE_FRAMINGTYPE 19 /* Framing Type */ -#define PPPOL2TP_FRAMINGTYPE 0x00000001 /* Sync framing */ - -/* -- AVP - TX Connect Speed */ -#define PPPOL2TP_AVPTYPE_TXCONNECTSPEED 24 /* TX Connect Speed */ -#define PPPOL2TP_TXCONNECTSPEED 100000000 /* Connect speed: 100 Mbits/s */ - -/* L2TP Session state */ -#define PPPOL2TP_STATE_INITIAL 0 -#define PPPOL2TP_STATE_SCCRQ_SENT 1 -#define PPPOL2TP_STATE_ICRQ_SENT 2 -#define PPPOL2TP_STATE_ICCN_SENT 3 -#define PPPOL2TP_STATE_DATA 4 - -#define PPPOL2TP_OUTPUT_DATA_HEADER_LEN 6 /* Our data header len */ - -/* - * PPPoL2TP interface control block. - */ -typedef struct pppol2tp_pcb_s pppol2tp_pcb; -struct pppol2tp_pcb_s { - ppp_pcb *ppp; /* PPP PCB */ - u8_t phase; /* L2TP phase */ - struct udp_pcb *udp; /* UDP L2TP Socket */ - struct netif *netif; /* Output interface, used as a default route */ - ip_addr_t remote_ip; /* LNS IP Address */ - u16_t remote_port; /* LNS port */ -#if PPPOL2TP_AUTH_SUPPORT - const u8_t *secret; /* Secret string */ - u8_t secret_len; /* Secret string length */ - u8_t secret_rv[16]; /* Random vector */ - u8_t challenge_hash[16]; /* Challenge response */ - u8_t send_challenge; /* Boolean whether the next sent packet should contains a challenge response */ -#endif /* PPPOL2TP_AUTH_SUPPORT */ - - u16_t tunnel_port; /* Tunnel port */ - u16_t our_ns; /* NS to peer */ - u16_t peer_nr; /* NR from peer */ - u16_t peer_ns; /* NS from peer */ - u16_t source_tunnel_id; /* Tunnel ID assigned by peer */ - u16_t remote_tunnel_id; /* Tunnel ID assigned to peer */ - u16_t source_session_id; /* Session ID assigned by peer */ - u16_t remote_session_id; /* Session ID assigned to peer */ - - u8_t sccrq_retried; /* number of SCCRQ retries already done */ - u8_t icrq_retried; /* number of ICRQ retries already done */ - u8_t iccn_retried; /* number of ICCN retries already done */ -}; - - -/* Create a new L2TP session. */ -ppp_pcb *pppol2tp_create(struct netif *pppif, - struct netif *netif, const ip_addr_t *ipaddr, u16_t port, - const u8_t *secret, u8_t secret_len, - ppp_link_status_cb_fn link_status_cb, void *ctx_cb); - -#endif /* PPPOL2TP_H */ -#endif /* PPP_SUPPORT && PPPOL2TP_SUPPORT */ diff --git a/tools/sdk/include/lwip/netif/ppp/pppos.h b/tools/sdk/include/lwip/netif/ppp/pppos.h deleted file mode 100644 index d924a9fc7ea..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/pppos.h +++ /dev/null @@ -1,118 +0,0 @@ -/** - * @file - * Network Point to Point Protocol over Serial header file. - * - */ - -/* - * 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. - * - */ - -#include "netif/ppp/ppp_opts.h" -#if PPP_SUPPORT && PPPOS_SUPPORT /* don't build if not configured for use in lwipopts.h */ - -#ifndef PPPOS_H -#define PPPOS_H - -#include "lwip/sys.h" - -#include "ppp.h" -#include "vj.h" - -/* PPP packet parser states. Current state indicates operation yet to be - * completed. */ -enum { - PDIDLE = 0, /* Idle state - waiting. */ - PDSTART, /* Process start flag. */ - PDADDRESS, /* Process address field. */ - PDCONTROL, /* Process control field. */ - PDPROTOCOL1, /* Process protocol field 1. */ - PDPROTOCOL2, /* Process protocol field 2. */ - PDDATA /* Process data byte. */ -}; - -/* PPPoS serial output callback function prototype */ -typedef u32_t (*pppos_output_cb_fn)(ppp_pcb *pcb, u8_t *data, u32_t len, void *ctx); - -/* - * Extended asyncmap - allows any character to be escaped. - */ -typedef u8_t ext_accm[32]; - -/* - * PPPoS interface control block. - */ -typedef struct pppos_pcb_s pppos_pcb; -struct pppos_pcb_s { - /* -- below are data that will NOT be cleared between two sessions */ - ppp_pcb *ppp; /* PPP PCB */ - pppos_output_cb_fn output_cb; /* PPP serial output callback */ - - /* -- below are data that will be cleared between two sessions - * - * last_xmit must be the first member of cleared members, because it is - * used to know which part must not be cleared. - */ - u32_t last_xmit; /* Time of last transmission. */ - ext_accm out_accm; /* Async-Ctl-Char-Map for output. */ - - /* flags */ - unsigned int open :1; /* Set if PPPoS is open */ - unsigned int pcomp :1; /* Does peer accept protocol compression? */ - unsigned int accomp :1; /* Does peer accept addr/ctl compression? */ - - /* PPPoS rx */ - ext_accm in_accm; /* Async-Ctl-Char-Map for input. */ - struct pbuf *in_head, *in_tail; /* The input packet. */ - u16_t in_protocol; /* The input protocol code. */ - u16_t in_fcs; /* Input Frame Check Sequence value. */ - u8_t in_state; /* The input process state. */ - u8_t in_escaped; /* Escape next character. */ -}; - -/* Create a new PPPoS session. */ -ppp_pcb *pppos_create(struct netif *pppif, pppos_output_cb_fn output_cb, - ppp_link_status_cb_fn link_status_cb, void *ctx_cb); - -#if !NO_SYS && !PPP_INPROC_IRQ_SAFE -/* Pass received raw characters to PPPoS to be decoded through lwIP TCPIP thread. */ -err_t pppos_input_tcpip(ppp_pcb *ppp, u8_t *s, int l); -#endif /* !NO_SYS && !PPP_INPROC_IRQ_SAFE */ - -/* PPP over Serial: this is the input function to be called for received data. */ -void pppos_input(ppp_pcb *ppp, u8_t* data, int len); - - -/* - * Functions called from lwIP - * DO NOT CALL FROM lwIP USER APPLICATION. - */ -#if !NO_SYS && !PPP_INPROC_IRQ_SAFE -err_t pppos_input_sys(struct pbuf *p, struct netif *inp); -#endif /* !NO_SYS && !PPP_INPROC_IRQ_SAFE */ - -#endif /* PPPOS_H */ -#endif /* PPP_SUPPORT && PPPOL2TP_SUPPORT */ diff --git a/tools/sdk/include/lwip/netif/ppp/upap.h b/tools/sdk/include/lwip/netif/ppp/upap.h deleted file mode 100644 index 7da792ecc72..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/upap.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * upap.h - User/Password Authentication Protocol definitions. - * - * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved. - * - * 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 "Carnegie Mellon University" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For permission or any legal - * details, please contact - * Office of Technology Transfer - * Carnegie Mellon University - * 5000 Forbes Avenue - * Pittsburgh, PA 15213-3890 - * (412) 268-4387, fax: (412) 268-7395 - * tech-transfer@andrew.cmu.edu - * - * 4. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by Computing Services - * at Carnegie Mellon University (http://www.cmu.edu/computing/)." - * - * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE - * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * $Id: upap.h,v 1.8 2002/12/04 23:03:33 paulus Exp $ - */ - -#include "netif/ppp/ppp_opts.h" -#if PPP_SUPPORT && PAP_SUPPORT /* don't build if not configured for use in lwipopts.h */ - -#ifndef UPAP_H -#define UPAP_H - -#include "ppp.h" - -/* - * Packet header = Code, id, length. - */ -#define UPAP_HEADERLEN 4 - - -/* - * UPAP codes. - */ -#define UPAP_AUTHREQ 1 /* Authenticate-Request */ -#define UPAP_AUTHACK 2 /* Authenticate-Ack */ -#define UPAP_AUTHNAK 3 /* Authenticate-Nak */ - - -/* - * Client states. - */ -#define UPAPCS_INITIAL 0 /* Connection down */ -#define UPAPCS_CLOSED 1 /* Connection up, haven't requested auth */ -#define UPAPCS_PENDING 2 /* Connection down, have requested auth */ -#define UPAPCS_AUTHREQ 3 /* We've sent an Authenticate-Request */ -#define UPAPCS_OPEN 4 /* We've received an Ack */ -#define UPAPCS_BADAUTH 5 /* We've received a Nak */ - -/* - * Server states. - */ -#define UPAPSS_INITIAL 0 /* Connection down */ -#define UPAPSS_CLOSED 1 /* Connection up, haven't requested auth */ -#define UPAPSS_PENDING 2 /* Connection down, have requested auth */ -#define UPAPSS_LISTEN 3 /* Listening for an Authenticate */ -#define UPAPSS_OPEN 4 /* We've sent an Ack */ -#define UPAPSS_BADAUTH 5 /* We've sent a Nak */ - - -/* - * Timeouts. - */ -#if 0 /* moved to ppp_opts.h */ -#define UPAP_DEFTIMEOUT 3 /* Timeout (seconds) for retransmitting req */ -#define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */ -#endif /* moved to ppp_opts.h */ - -/* - * Each interface is described by upap structure. - */ -#if PAP_SUPPORT -typedef struct upap_state { - const char *us_user; /* User */ - u8_t us_userlen; /* User length */ - const char *us_passwd; /* Password */ - u8_t us_passwdlen; /* Password length */ - u8_t us_clientstate; /* Client state */ -#if PPP_SERVER - u8_t us_serverstate; /* Server state */ -#endif /* PPP_SERVER */ - u8_t us_id; /* Current id */ - u8_t us_transmits; /* Number of auth-reqs sent */ -} upap_state; -#endif /* PAP_SUPPORT */ - - -void upap_authwithpeer(ppp_pcb *pcb, const char *user, const char *password); -#if PPP_SERVER -void upap_authpeer(ppp_pcb *pcb); -#endif /* PPP_SERVER */ - -extern const struct protent pap_protent; - -#endif /* UPAP_H */ -#endif /* PPP_SUPPORT && PAP_SUPPORT */ diff --git a/tools/sdk/include/lwip/netif/ppp/vj.h b/tools/sdk/include/lwip/netif/ppp/vj.h deleted file mode 100644 index 7f389c846f7..00000000000 --- a/tools/sdk/include/lwip/netif/ppp/vj.h +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Definitions for tcp compression routines. - * - * $Id: vj.h,v 1.7 2010/02/22 17:52:09 goldsimon Exp $ - * - * Copyright (c) 1989 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * Van Jacobson (van@helios.ee.lbl.gov), Dec 31, 1989: - * - Initial distribution. - */ - -#include "netif/ppp/ppp_opts.h" -#if PPP_SUPPORT && VJ_SUPPORT /* don't build if not configured for use in lwipopts.h */ - -#ifndef VJ_H -#define VJ_H - -#include "lwip/ip.h" -#include "lwip/priv/tcp_priv.h" - -#define MAX_SLOTS 16 /* must be > 2 and < 256 */ -#define MAX_HDR 128 - -/* - * Compressed packet format: - * - * The first octet contains the packet type (top 3 bits), TCP - * 'push' bit, and flags that indicate which of the 4 TCP sequence - * numbers have changed (bottom 5 bits). The next octet is a - * conversation number that associates a saved IP/TCP header with - * the compressed packet. The next two octets are the TCP checksum - * from the original datagram. The next 0 to 15 octets are - * sequence number changes, one change per bit set in the header - * (there may be no changes and there are two special cases where - * the receiver implicitly knows what changed -- see below). - * - * There are 5 numbers which can change (they are always inserted - * in the following order): TCP urgent pointer, window, - * acknowlegement, sequence number and IP ID. (The urgent pointer - * is different from the others in that its value is sent, not the - * change in value.) Since typical use of SLIP links is biased - * toward small packets (see comments on MTU/MSS below), changes - * use a variable length coding with one octet for numbers in the - * range 1 - 255 and 3 octets (0, MSB, LSB) for numbers in the - * range 256 - 65535 or 0. (If the change in sequence number or - * ack is more than 65535, an uncompressed packet is sent.) - */ - -/* - * Packet types (must not conflict with IP protocol version) - * - * The top nibble of the first octet is the packet type. There are - * three possible types: IP (not proto TCP or tcp with one of the - * control flags set); uncompressed TCP (a normal IP/TCP packet but - * with the 8-bit protocol field replaced by an 8-bit connection id -- - * this type of packet syncs the sender & receiver); and compressed - * TCP (described above). - * - * LSB of 4-bit field is TCP "PUSH" bit (a worthless anachronism) and - * is logically part of the 4-bit "changes" field that follows. Top - * three bits are actual packet type. For backward compatibility - * and in the interest of conserving bits, numbers are chosen so the - * IP protocol version number (4) which normally appears in this nibble - * means "IP packet". - */ - -/* packet types */ -#define TYPE_IP 0x40 -#define TYPE_UNCOMPRESSED_TCP 0x70 -#define TYPE_COMPRESSED_TCP 0x80 -#define TYPE_ERROR 0x00 - -/* Bits in first octet of compressed packet */ -#define NEW_C 0x40 /* flag bits for what changed in a packet */ -#define NEW_I 0x20 -#define NEW_S 0x08 -#define NEW_A 0x04 -#define NEW_W 0x02 -#define NEW_U 0x01 - -/* reserved, special-case values of above */ -#define SPECIAL_I (NEW_S|NEW_W|NEW_U) /* echoed interactive traffic */ -#define SPECIAL_D (NEW_S|NEW_A|NEW_W|NEW_U) /* unidirectional data */ -#define SPECIALS_MASK (NEW_S|NEW_A|NEW_W|NEW_U) - -#define TCP_PUSH_BIT 0x10 - - -/* - * "state" data for each active tcp conversation on the wire. This is - * basically a copy of the entire IP/TCP header from the last packet - * we saw from the conversation together with a small identifier - * the transmit & receive ends of the line use to locate saved header. - */ -struct cstate { - struct cstate *cs_next; /* next most recently used state (xmit only) */ - u16_t cs_hlen; /* size of hdr (receive only) */ - u8_t cs_id; /* connection # associated with this state */ - u8_t cs_filler; - union { - char csu_hdr[MAX_HDR]; - struct ip_hdr csu_ip; /* ip/tcp hdr from most recent packet */ - } vjcs_u; -}; -#define cs_ip vjcs_u.csu_ip -#define cs_hdr vjcs_u.csu_hdr - - -struct vjstat { - u32_t vjs_packets; /* outbound packets */ - u32_t vjs_compressed; /* outbound compressed packets */ - u32_t vjs_searches; /* searches for connection state */ - u32_t vjs_misses; /* times couldn't find conn. state */ - u32_t vjs_uncompressedin; /* inbound uncompressed packets */ - u32_t vjs_compressedin; /* inbound compressed packets */ - u32_t vjs_errorin; /* inbound unknown type packets */ - u32_t vjs_tossed; /* inbound packets tossed because of error */ -}; - -/* - * all the state data for one serial line (we need one of these per line). - */ -struct vjcompress { - struct cstate *last_cs; /* most recently used tstate */ - u8_t last_recv; /* last rcvd conn. id */ - u8_t last_xmit; /* last sent conn. id */ - u16_t flags; - u8_t maxSlotIndex; - u8_t compressSlot; /* Flag indicating OK to compress slot ID. */ -#if LINK_STATS - struct vjstat stats; -#endif - struct cstate tstate[MAX_SLOTS]; /* xmit connection states */ - struct cstate rstate[MAX_SLOTS]; /* receive connection states */ -}; - -/* flag values */ -#define VJF_TOSS 1U /* tossing rcvd frames because of input err */ - -extern void vj_compress_init (struct vjcompress *comp); -extern u8_t vj_compress_tcp (struct vjcompress *comp, struct pbuf **pb); -extern void vj_uncompress_err (struct vjcompress *comp); -extern int vj_uncompress_uncomp(struct pbuf *nb, struct vjcompress *comp); -extern int vj_uncompress_tcp (struct pbuf **nb, struct vjcompress *comp); - -#endif /* VJ_H */ - -#endif /* PPP_SUPPORT && VJ_SUPPORT */ diff --git a/tools/sdk/include/lwip/netif/slipif.h b/tools/sdk/include/lwip/netif/slipif.h deleted file mode 100644 index 65ba31f835b..00000000000 --- a/tools/sdk/include/lwip/netif/slipif.h +++ /dev/null @@ -1,87 +0,0 @@ -/** - * @file - * - * SLIP netif API - */ - -/* - * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. - * - * 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. Neither the name of the Institute 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 INSTITUTE 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 INSTITUTE 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. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef LWIP_HDR_NETIF_SLIPIF_H -#define LWIP_HDR_NETIF_SLIPIF_H - -#include "lwip/opt.h" -#include "lwip/netif.h" - -/** Set this to 1 to start a thread that blocks reading on the serial line - * (using sio_read()). - */ -#ifndef SLIP_USE_RX_THREAD -#define SLIP_USE_RX_THREAD !NO_SYS -#endif - -/** Set this to 1 to enable functions to pass in RX bytes from ISR context. - * If enabled, slipif_received_byte[s]() process incoming bytes and put assembled - * packets on a queue, which is fed into lwIP from slipif_poll(). - * If disabled, slipif_poll() polls the serial line (using sio_tryread()). - */ -#ifndef SLIP_RX_FROM_ISR -#define SLIP_RX_FROM_ISR 0 -#endif - -/** Set this to 1 (default for SLIP_RX_FROM_ISR) to queue incoming packets - * received by slipif_received_byte[s]() as long as PBUF_POOL pbufs are available. - * If disabled, packets will be dropped if more than one packet is received. - */ -#ifndef SLIP_RX_QUEUE -#define SLIP_RX_QUEUE SLIP_RX_FROM_ISR -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -err_t slipif_init(struct netif * netif); -void slipif_poll(struct netif *netif); -#if SLIP_RX_FROM_ISR -void slipif_process_rxqueue(struct netif *netif); -void slipif_received_byte(struct netif *netif, u8_t data); -void slipif_received_bytes(struct netif *netif, u8_t *data, u8_t len); -#endif /* SLIP_RX_FROM_ISR */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_HDR_NETIF_SLIPIF_H */ - diff --git a/tools/sdk/include/lwip/netif/wlanif.h b/tools/sdk/include/lwip/netif/wlanif.h deleted file mode 100644 index 9c79f5b0aff..00000000000 --- a/tools/sdk/include/lwip/netif/wlanif.h +++ /dev/null @@ -1,42 +0,0 @@ -// 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. - - -#ifndef _WLAN_LWIP_IF_H_ -#define _WLAN_LWIP_IF_H_ - -#include "esp_wifi.h" - -#include "esp_wifi_internal.h" - -#include "lwip/err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -err_t wlanif_init_ap(struct netif *netif); -err_t wlanif_init_sta(struct netif *netif); - -void wlanif_input(struct netif *netif, void *buffer, u16_t len, void* eb); - -wifi_interface_t wifi_get_interface(void *dev); - -void netif_reg_addr_change_cb(void* cb); - -#ifdef __cplusplus -} -#endif - -#endif /* _WLAN_LWIP_IF_H_ */ diff --git a/tools/sdk/include/lwip/netinet/in.h b/tools/sdk/include/lwip/netinet/in.h deleted file mode 100644 index 7eaec63342f..00000000000 --- a/tools/sdk/include/lwip/netinet/in.h +++ /dev/null @@ -1,22 +0,0 @@ -// 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. - -#ifndef IN_H_ -#define IN_H_ - -#include "lwip/inet.h" - -#define IN6_IS_ADDR_MULTICAST(a) IN_MULTICAST(a) - -#endif /* IN_H_ */ diff --git a/tools/sdk/include/lwip/perf.h b/tools/sdk/include/lwip/perf.h deleted file mode 100644 index 089facac1df..00000000000 --- a/tools/sdk/include/lwip/perf.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. - * - * 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. Neither the name of the Institute 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 INSTITUTE 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 INSTITUTE 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. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __PERF_H__ -#define __PERF_H__ - -#define PERF_START /* null definition */ -#define PERF_STOP(x) /* null definition */ - -#endif /* __PERF_H__ */ diff --git a/tools/sdk/include/lwip/ping/ping.h b/tools/sdk/include/lwip/ping/ping.h deleted file mode 100644 index 6e8eb24b2ad..00000000000 --- a/tools/sdk/include/lwip/ping/ping.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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. - * - */ - -#ifndef LWIP_PING_H -#define LWIP_PING_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * PING_USE_SOCKETS: Set to 1 to use sockets, otherwise the raw api is used - */ -#ifndef PING_USE_SOCKETS -#define PING_USE_SOCKETS LWIP_SOCKET -#endif - - -int ping_init(void); - -#ifdef ESP_PING -void ping_deinit(void); -#endif - -#if !PING_USE_SOCKETS -void ping_send_now(void); -#endif /* !PING_USE_SOCKETS */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_PING_H */ diff --git a/tools/sdk/include/lwip/posix/errno.h b/tools/sdk/include/lwip/posix/errno.h deleted file mode 100644 index 5917c75e24a..00000000000 --- a/tools/sdk/include/lwip/posix/errno.h +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @file - * This file is a posix wrapper for lwip/errno.h. - */ - -/* - * 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. - * - */ - -#include "lwip/errno.h" diff --git a/tools/sdk/include/lwip/posix/netdb.h b/tools/sdk/include/lwip/posix/netdb.h deleted file mode 100644 index 363154f6889..00000000000 --- a/tools/sdk/include/lwip/posix/netdb.h +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @file - * This file is a posix wrapper for lwip/netdb.h. - */ - -/* - * 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. - * - */ - -#include "lwip/netdb.h" - -#ifdef ESP_PLATFORM -int getnameinfo(const struct sockaddr *addr, socklen_t addrlen, - char *host, socklen_t hostlen, - char *serv, socklen_t servlen, int flags); - -#endif diff --git a/tools/sdk/include/lwip/posix/sys/socket.h b/tools/sdk/include/lwip/posix/sys/socket.h deleted file mode 100644 index 0ed9baf3d9f..00000000000 --- a/tools/sdk/include/lwip/posix/sys/socket.h +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @file - * This file is a posix wrapper for lwip/sockets.h. - */ - -/* - * 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. - * - */ - -#include "lwip/sockets.h" diff --git a/tools/sdk/include/lwip/sys/socket.h b/tools/sdk/include/lwip/sys/socket.h deleted file mode 100644 index 0ed9baf3d9f..00000000000 --- a/tools/sdk/include/lwip/sys/socket.h +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @file - * This file is a posix wrapper for lwip/sockets.h. - */ - -/* - * 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. - * - */ - -#include "lwip/sockets.h" diff --git a/tools/sdk/include/lwip/sys_arch.h b/tools/sdk/include/lwip/sys_arch.h deleted file mode 100644 index 9638fdfd621..00000000000 --- a/tools/sdk/include/lwip/sys_arch.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * 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: Adam Dunkels - * - */ - -#ifndef __SYS_ARCH_H__ -#define __SYS_ARCH_H__ - -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "freertos/queue.h" -#include "freertos/semphr.h" -#include "arch/vfs_lwip.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef xSemaphoreHandle sys_sem_t; -typedef xSemaphoreHandle sys_mutex_t; -typedef xTaskHandle sys_thread_t; - -typedef struct sys_mbox_s { - xQueueHandle os_mbox; - void *owner; -}* sys_mbox_t; - - -#define LWIP_COMPAT_MUTEX 0 - -#if !LWIP_COMPAT_MUTEX -#define sys_mutex_valid( x ) ( ( ( *x ) == NULL) ? pdFALSE : pdTRUE ) -#define sys_mutex_set_invalid( x ) ( ( *x ) = NULL ) -#endif - -#define sys_mbox_valid( x ) ( ( ( *x ) == NULL) ? pdFALSE : pdTRUE ) - -/* Define the sys_mbox_set_invalid() to empty to support lock-free mbox in ESP LWIP. - * - * The basic idea about the lock-free mbox is that the mbox should always be valid unless - * no socket APIs are using the socket and the socket is closed. ESP LWIP achieves this by - * following two changes to official LWIP: - * 1. Postpone the deallocation of mbox to netconn_free(), in other words, free the mbox when - * no one is using the socket. - * 2. Define the sys_mbox_set_invalid() to empty if the mbox is not actually freed. - - * The second change is necessary. Consider a common scenario: the application task calls - * recv() to receive packets from the socket, the sys_mbox_valid() returns true. Because there - * is no lock for the mbox, the LWIP CORE can call sys_mbox_set_invalid() to set the mbox at - * anytime and the thread-safe issue may happen. - * - * However, if the sys_mbox_set_invalid() is not called after sys_mbox_free(), e.g. in netconn_alloc(), - * we need to initialize the mbox to invalid explicitly since sys_mbox_set_invalid() now is empty. - */ -#define sys_mbox_set_invalid( x ) - -#define sys_sem_valid( x ) ( ( ( *x ) == NULL) ? pdFALSE : pdTRUE ) -#define sys_sem_set_invalid( x ) ( ( *x ) = NULL ) - -void sys_delay_ms(uint32_t ms); -sys_sem_t* sys_thread_sem_init(void); -void sys_thread_sem_deinit(void); -sys_sem_t* sys_thread_sem_get(void); - -#ifdef __cplusplus -} -#endif - -#endif /* __SYS_ARCH_H__ */ - diff --git a/tools/sdk/include/lwip/vfs_lwip.h b/tools/sdk/include/lwip/vfs_lwip.h deleted file mode 100644 index 1957304b9f2..00000000000 --- a/tools/sdk/include/lwip/vfs_lwip.h +++ /dev/null @@ -1,23 +0,0 @@ -// 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. - -#ifdef __cplusplus -extern "C" { -#endif - -void esp_vfs_lwip_sockets_register(); - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/mbedtls/aes_alt.h b/tools/sdk/include/mbedtls/aes_alt.h deleted file mode 100644 index cf87ea5c152..00000000000 --- a/tools/sdk/include/mbedtls/aes_alt.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - * \file aes_alt.h - * - * \brief AES block cipher - * - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * - */ -#ifndef AES_ALT_H -#define AES_ALT_H - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(MBEDTLS_AES_ALT) -#include "hwcrypto/aes.h" - -typedef esp_aes_context mbedtls_aes_context; - -#define mbedtls_aes_init esp_aes_init -#define mbedtls_aes_free esp_aes_free -#define mbedtls_aes_setkey_enc esp_aes_setkey -#define mbedtls_aes_setkey_dec esp_aes_setkey -#define mbedtls_aes_crypt_ecb esp_aes_crypt_ecb -#if defined(MBEDTLS_CIPHER_MODE_CBC) -#define mbedtls_aes_crypt_cbc esp_aes_crypt_cbc -#endif -#if defined(MBEDTLS_CIPHER_MODE_CFB) -#define mbedtls_aes_crypt_cfb128 esp_aes_crypt_cfb128 -#define mbedtls_aes_crypt_cfb8 esp_aes_crypt_cfb8 -#endif -#if defined(MBEDTLS_CIPHER_MODE_CTR) -#define mbedtls_aes_crypt_ctr esp_aes_crypt_ctr -#endif -#if defined(MBEDTLS_CIPHER_MODE_XTS) -typedef esp_aes_xts_context mbedtls_aes_xts_context; -#define mbedtls_aes_xts_init esp_aes_xts_init -#define mbedtls_aes_xts_free esp_aes_xts_free -#define mbedtls_aes_xts_setkey_enc esp_aes_xts_setkey_enc -#define mbedtls_aes_xts_setkey_dec esp_aes_xts_setkey_dec -#define mbedtls_aes_crypt_xts esp_aes_crypt_xts -#endif -#define mbedtls_internal_aes_encrypt esp_internal_aes_encrypt -#define mbedtls_internal_aes_decrypt esp_internal_aes_decrypt -#endif /* MBEDTLS_AES_ALT */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/mbedtls/esp_mem.h b/tools/sdk/include/mbedtls/esp_mem.h deleted file mode 100644 index da740830478..00000000000 --- a/tools/sdk/include/mbedtls/esp_mem.h +++ /dev/null @@ -1,20 +0,0 @@ -// 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. - -#pragma once - -#include - -void *esp_mbedtls_mem_calloc(size_t n, size_t size); -void esp_mbedtls_mem_free(void *ptr); diff --git a/tools/sdk/include/mbedtls/mbedtls/aes.h b/tools/sdk/include/mbedtls/mbedtls/aes.h deleted file mode 100644 index 4c8dab31519..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/aes.h +++ /dev/null @@ -1,626 +0,0 @@ -/** - * \file aes.h - * - * \brief This file contains AES definitions and functions. - * - * The Advanced Encryption Standard (AES) specifies a FIPS-approved - * cryptographic algorithm that can be used to protect electronic - * data. - * - * The AES algorithm is a symmetric block cipher that can - * encrypt and decrypt information. For more information, see - * FIPS Publication 197: Advanced Encryption Standard and - * ISO/IEC 18033-2:2006: Information technology -- Security - * techniques -- Encryption algorithms -- Part 2: Asymmetric - * ciphers. - * - * The AES-XTS block mode is standardized by NIST SP 800-38E - * - * and described in detail by IEEE P1619 - * . - */ - -/* Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_AES_H -#define MBEDTLS_AES_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -/* padlock.c and aesni.c rely on these values! */ -#define MBEDTLS_AES_ENCRYPT 1 /**< AES encryption. */ -#define MBEDTLS_AES_DECRYPT 0 /**< AES decryption. */ - -/* Error codes in range 0x0020-0x0022 */ -#define MBEDTLS_ERR_AES_INVALID_KEY_LENGTH -0x0020 /**< Invalid key length. */ -#define MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH -0x0022 /**< Invalid data input length. */ - -/* Error codes in range 0x0021-0x0025 */ -#define MBEDTLS_ERR_AES_BAD_INPUT_DATA -0x0021 /**< Invalid input data. */ -#define MBEDTLS_ERR_AES_FEATURE_UNAVAILABLE -0x0023 /**< Feature not available. For example, an unsupported AES key size. */ -#define MBEDTLS_ERR_AES_HW_ACCEL_FAILED -0x0025 /**< AES hardware accelerator failed. */ - -#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ - !defined(inline) && !defined(__cplusplus) -#define inline __inline -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_AES_ALT) -// Regular implementation -// - -/** - * \brief The AES context-type definition. - */ -typedef struct mbedtls_aes_context -{ - int nr; /*!< The number of rounds. */ - uint32_t *rk; /*!< AES round keys. */ - uint32_t buf[68]; /*!< Unaligned data buffer. This buffer can - hold 32 extra Bytes, which can be used for - one of the following purposes: -
  • Alignment if VIA padlock is - used.
  • -
  • Simplifying key expansion in the 256-bit - case by generating an extra round key. -
*/ -} -mbedtls_aes_context; - -#if defined(MBEDTLS_CIPHER_MODE_XTS) -/** - * \brief The AES XTS context-type definition. - */ -typedef struct mbedtls_aes_xts_context -{ - mbedtls_aes_context crypt; /*!< The AES context to use for AES block - encryption or decryption. */ - mbedtls_aes_context tweak; /*!< The AES context used for tweak - computation. */ -} mbedtls_aes_xts_context; -#endif /* MBEDTLS_CIPHER_MODE_XTS */ - -#else /* MBEDTLS_AES_ALT */ -#include "aes_alt.h" -#endif /* MBEDTLS_AES_ALT */ - -/** - * \brief This function initializes the specified AES context. - * - * It must be the first API called before using - * the context. - * - * \param ctx The AES context to initialize. - */ -void mbedtls_aes_init( mbedtls_aes_context *ctx ); - -/** - * \brief This function releases and clears the specified AES context. - * - * \param ctx The AES context to clear. - */ -void mbedtls_aes_free( mbedtls_aes_context *ctx ); - -#if defined(MBEDTLS_CIPHER_MODE_XTS) -/** - * \brief This function initializes the specified AES XTS context. - * - * It must be the first API called before using - * the context. - * - * \param ctx The AES XTS context to initialize. - */ -void mbedtls_aes_xts_init( mbedtls_aes_xts_context *ctx ); - -/** - * \brief This function releases and clears the specified AES XTS context. - * - * \param ctx The AES XTS context to clear. - */ -void mbedtls_aes_xts_free( mbedtls_aes_xts_context *ctx ); -#endif /* MBEDTLS_CIPHER_MODE_XTS */ - -/** - * \brief This function sets the encryption key. - * - * \param ctx The AES context to which the key should be bound. - * \param key The encryption key. - * \param keybits The size of data passed in bits. Valid options are: - *
  • 128 bits
  • - *
  • 192 bits
  • - *
  • 256 bits
- * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_AES_INVALID_KEY_LENGTH on failure. - */ -int mbedtls_aes_setkey_enc( mbedtls_aes_context *ctx, const unsigned char *key, - unsigned int keybits ); - -/** - * \brief This function sets the decryption key. - * - * \param ctx The AES context to which the key should be bound. - * \param key The decryption key. - * \param keybits The size of data passed. Valid options are: - *
  • 128 bits
  • - *
  • 192 bits
  • - *
  • 256 bits
- * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_AES_INVALID_KEY_LENGTH on failure. - */ -int mbedtls_aes_setkey_dec( mbedtls_aes_context *ctx, const unsigned char *key, - unsigned int keybits ); - -#if defined(MBEDTLS_CIPHER_MODE_XTS) -/** - * \brief This function prepares an XTS context for encryption and - * sets the encryption key. - * - * \param ctx The AES XTS context to which the key should be bound. - * \param key The encryption key. This is comprised of the XTS key1 - * concatenated with the XTS key2. - * \param keybits The size of \p key passed in bits. Valid options are: - *
  • 256 bits (each of key1 and key2 is a 128-bit key)
  • - *
  • 512 bits (each of key1 and key2 is a 256-bit key)
- * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_AES_INVALID_KEY_LENGTH on failure. - */ -int mbedtls_aes_xts_setkey_enc( mbedtls_aes_xts_context *ctx, - const unsigned char *key, - unsigned int keybits ); - -/** - * \brief This function prepares an XTS context for decryption and - * sets the decryption key. - * - * \param ctx The AES XTS context to which the key should be bound. - * \param key The decryption key. This is comprised of the XTS key1 - * concatenated with the XTS key2. - * \param keybits The size of \p key passed in bits. Valid options are: - *
  • 256 bits (each of key1 and key2 is a 128-bit key)
  • - *
  • 512 bits (each of key1 and key2 is a 256-bit key)
- * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_AES_INVALID_KEY_LENGTH on failure. - */ -int mbedtls_aes_xts_setkey_dec( mbedtls_aes_xts_context *ctx, - const unsigned char *key, - unsigned int keybits ); -#endif /* MBEDTLS_CIPHER_MODE_XTS */ - -/** - * \brief This function performs an AES single-block encryption or - * decryption operation. - * - * It performs the operation defined in the \p mode parameter - * (encrypt or decrypt), on the input data buffer defined in - * the \p input parameter. - * - * mbedtls_aes_init(), and either mbedtls_aes_setkey_enc() or - * mbedtls_aes_setkey_dec() must be called before the first - * call to this API with the same context. - * - * \param ctx The AES context to use for encryption or decryption. - * \param mode The AES operation: #MBEDTLS_AES_ENCRYPT or - * #MBEDTLS_AES_DECRYPT. - * \param input The 16-Byte buffer holding the input data. - * \param output The 16-Byte buffer holding the output data. - - * \return \c 0 on success. - */ -int mbedtls_aes_crypt_ecb( mbedtls_aes_context *ctx, - int mode, - const unsigned char input[16], - unsigned char output[16] ); - -#if defined(MBEDTLS_CIPHER_MODE_CBC) -/** - * \brief This function performs an AES-CBC encryption or decryption operation - * on full blocks. - * - * It performs the operation defined in the \p mode - * parameter (encrypt/decrypt), on the input data buffer defined in - * the \p input parameter. - * - * It can be called as many times as needed, until all the input - * data is processed. mbedtls_aes_init(), and either - * mbedtls_aes_setkey_enc() or mbedtls_aes_setkey_dec() must be called - * before the first call to this API with the same context. - * - * \note This function operates on aligned blocks, that is, the input size - * must be a multiple of the AES block size of 16 Bytes. - * - * \note Upon exit, the content of the IV is updated so that you can - * call the same function again on the next - * block(s) of data and get the same result as if it was - * encrypted in one call. This allows a "streaming" usage. - * If you need to retain the contents of the IV, you should - * either save it manually or use the cipher module instead. - * - * - * \param ctx The AES context to use for encryption or decryption. - * \param mode The AES operation: #MBEDTLS_AES_ENCRYPT or - * #MBEDTLS_AES_DECRYPT. - * \param length The length of the input data in Bytes. This must be a - * multiple of the block size (16 Bytes). - * \param iv Initialization vector (updated after use). - * \param input The buffer holding the input data. - * \param output The buffer holding the output data. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH - * on failure. - */ -int mbedtls_aes_crypt_cbc( mbedtls_aes_context *ctx, - int mode, - size_t length, - unsigned char iv[16], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_CBC */ - -#if defined(MBEDTLS_CIPHER_MODE_XTS) -/** - * \brief This function performs an AES-XTS encryption or decryption - * operation for an entire XTS data unit. - * - * AES-XTS encrypts or decrypts blocks based on their location as - * defined by a data unit number. The data unit number must be - * provided by \p data_unit. - * - * NIST SP 800-38E limits the maximum size of a data unit to 2^20 - * AES blocks. If the data unit is larger than this, this function - * returns #MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH. - * - * \param ctx The AES XTS context to use for AES XTS operations. - * \param mode The AES operation: #MBEDTLS_AES_ENCRYPT or - * #MBEDTLS_AES_DECRYPT. - * \param length The length of a data unit in bytes. This can be any - * length between 16 bytes and 2^24 bytes inclusive - * (between 1 and 2^20 block cipher blocks). - * \param data_unit The address of the data unit encoded as an array of 16 - * bytes in little-endian format. For disk encryption, this - * is typically the index of the block device sector that - * contains the data. - * \param input The buffer holding the input data (which is an entire - * data unit). This function reads \p length bytes from \p - * input. - * \param output The buffer holding the output data (which is an entire - * data unit). This function writes \p length bytes to \p - * output. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH if \p length is - * smaller than an AES block in size (16 bytes) or if \p - * length is larger than 2^20 blocks (16 MiB). - */ -int mbedtls_aes_crypt_xts( mbedtls_aes_xts_context *ctx, - int mode, - size_t length, - const unsigned char data_unit[16], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_XTS */ - -#if defined(MBEDTLS_CIPHER_MODE_CFB) -/** - * \brief This function performs an AES-CFB128 encryption or decryption - * operation. - * - * It performs the operation defined in the \p mode - * parameter (encrypt or decrypt), on the input data buffer - * defined in the \p input parameter. - * - * For CFB, you must set up the context with mbedtls_aes_setkey_enc(), - * regardless of whether you are performing an encryption or decryption - * operation, that is, regardless of the \p mode parameter. This is - * because CFB mode uses the same key schedule for encryption and - * decryption. - * - * \note Upon exit, the content of the IV is updated so that you can - * call the same function again on the next - * block(s) of data and get the same result as if it was - * encrypted in one call. This allows a "streaming" usage. - * If you need to retain the contents of the - * IV, you must either save it manually or use the cipher - * module instead. - * - * - * \param ctx The AES context to use for encryption or decryption. - * \param mode The AES operation: #MBEDTLS_AES_ENCRYPT or - * #MBEDTLS_AES_DECRYPT. - * \param length The length of the input data. - * \param iv_off The offset in IV (updated after use). - * \param iv The initialization vector (updated after use). - * \param input The buffer holding the input data. - * \param output The buffer holding the output data. - * - * \return \c 0 on success. - */ -int mbedtls_aes_crypt_cfb128( mbedtls_aes_context *ctx, - int mode, - size_t length, - size_t *iv_off, - unsigned char iv[16], - const unsigned char *input, - unsigned char *output ); - -/** - * \brief This function performs an AES-CFB8 encryption or decryption - * operation. - * - * It performs the operation defined in the \p mode - * parameter (encrypt/decrypt), on the input data buffer defined - * in the \p input parameter. - * - * Due to the nature of CFB, you must use the same key schedule for - * both encryption and decryption operations. Therefore, you must - * use the context initialized with mbedtls_aes_setkey_enc() for - * both #MBEDTLS_AES_ENCRYPT and #MBEDTLS_AES_DECRYPT. - * - * \note Upon exit, the content of the IV is updated so that you can - * call the same function again on the next - * block(s) of data and get the same result as if it was - * encrypted in one call. This allows a "streaming" usage. - * If you need to retain the contents of the - * IV, you should either save it manually or use the cipher - * module instead. - * - * - * \param ctx The AES context to use for encryption or decryption. - * \param mode The AES operation: #MBEDTLS_AES_ENCRYPT or - * #MBEDTLS_AES_DECRYPT - * \param length The length of the input data. - * \param iv The initialization vector (updated after use). - * \param input The buffer holding the input data. - * \param output The buffer holding the output data. - * - * \return \c 0 on success. - */ -int mbedtls_aes_crypt_cfb8( mbedtls_aes_context *ctx, - int mode, - size_t length, - unsigned char iv[16], - const unsigned char *input, - unsigned char *output ); -#endif /*MBEDTLS_CIPHER_MODE_CFB */ - -#if defined(MBEDTLS_CIPHER_MODE_OFB) -/** - * \brief This function performs an AES-OFB (Output Feedback Mode) - * encryption or decryption operation. - * - * For OFB, you must set up the context with - * mbedtls_aes_setkey_enc(), regardless of whether you are - * performing an encryption or decryption operation. This is - * because OFB mode uses the same key schedule for encryption and - * decryption. - * - * The OFB operation is identical for encryption or decryption, - * therefore no operation mode needs to be specified. - * - * \note Upon exit, the content of iv, the Initialisation Vector, is - * updated so that you can call the same function again on the next - * block(s) of data and get the same result as if it was encrypted - * in one call. This allows a "streaming" usage, by initialising - * iv_off to 0 before the first call, and preserving its value - * between calls. - * - * For non-streaming use, the iv should be initialised on each call - * to a unique value, and iv_off set to 0 on each call. - * - * If you need to retain the contents of the initialisation vector, - * you must either save it manually or use the cipher module - * instead. - * - * \warning For the OFB mode, the initialisation vector must be unique - * every encryption operation. Reuse of an initialisation vector - * will compromise security. - * - * \param ctx The AES context to use for encryption or decryption. - * \param length The length of the input data. - * \param iv_off The offset in IV (updated after use). - * \param iv The initialization vector (updated after use). - * \param input The buffer holding the input data. - * \param output The buffer holding the output data. - * - * \return \c 0 on success. - */ -int mbedtls_aes_crypt_ofb( mbedtls_aes_context *ctx, - size_t length, - size_t *iv_off, - unsigned char iv[16], - const unsigned char *input, - unsigned char *output ); - -#endif /* MBEDTLS_CIPHER_MODE_OFB */ - -#if defined(MBEDTLS_CIPHER_MODE_CTR) -/** - * \brief This function performs an AES-CTR encryption or decryption - * operation. - * - * This function performs the operation defined in the \p mode - * parameter (encrypt/decrypt), on the input data buffer - * defined in the \p input parameter. - * - * Due to the nature of CTR, you must use the same key schedule - * for both encryption and decryption operations. Therefore, you - * must use the context initialized with mbedtls_aes_setkey_enc() - * for both #MBEDTLS_AES_ENCRYPT and #MBEDTLS_AES_DECRYPT. - * - * \warning You must never reuse a nonce value with the same key. Doing so - * would void the encryption for the two messages encrypted with - * the same nonce and key. - * - * There are two common strategies for managing nonces with CTR: - * - * 1. You can handle everything as a single message processed over - * successive calls to this function. In that case, you want to - * set \p nonce_counter and \p nc_off to 0 for the first call, and - * then preserve the values of \p nonce_counter, \p nc_off and \p - * stream_block across calls to this function as they will be - * updated by this function. - * - * With this strategy, you must not encrypt more than 2**128 - * blocks of data with the same key. - * - * 2. You can encrypt separate messages by dividing the \p - * nonce_counter buffer in two areas: the first one used for a - * per-message nonce, handled by yourself, and the second one - * updated by this function internally. - * - * For example, you might reserve the first 12 bytes for the - * per-message nonce, and the last 4 bytes for internal use. In that - * case, before calling this function on a new message you need to - * set the first 12 bytes of \p nonce_counter to your chosen nonce - * value, the last 4 to 0, and \p nc_off to 0 (which will cause \p - * stream_block to be ignored). That way, you can encrypt at most - * 2**96 messages of up to 2**32 blocks each with the same key. - * - * The per-message nonce (or information sufficient to reconstruct - * it) needs to be communicated with the ciphertext and must be unique. - * The recommended way to ensure uniqueness is to use a message - * counter. An alternative is to generate random nonces, but this - * limits the number of messages that can be securely encrypted: - * for example, with 96-bit random nonces, you should not encrypt - * more than 2**32 messages with the same key. - * - * Note that for both stategies, sizes are measured in blocks and - * that an AES block is 16 bytes. - * - * \warning Upon return, \p stream_block contains sensitive data. Its - * content must not be written to insecure storage and should be - * securely discarded as soon as it's no longer needed. - * - * \param ctx The AES context to use for encryption or decryption. - * \param length The length of the input data. - * \param nc_off The offset in the current \p stream_block, for - * resuming within the current cipher stream. The - * offset pointer should be 0 at the start of a stream. - * \param nonce_counter The 128-bit nonce and counter. - * \param stream_block The saved stream block for resuming. This is - * overwritten by the function. - * \param input The buffer holding the input data. - * \param output The buffer holding the output data. - * - * \return \c 0 on success. - */ -int mbedtls_aes_crypt_ctr( mbedtls_aes_context *ctx, - size_t length, - size_t *nc_off, - unsigned char nonce_counter[16], - unsigned char stream_block[16], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_CTR */ - -/** - * \brief Internal AES block encryption function. This is only - * exposed to allow overriding it using - * \c MBEDTLS_AES_ENCRYPT_ALT. - * - * \param ctx The AES context to use for encryption. - * \param input The plaintext block. - * \param output The output (ciphertext) block. - * - * \return \c 0 on success. - */ -int mbedtls_internal_aes_encrypt( mbedtls_aes_context *ctx, - const unsigned char input[16], - unsigned char output[16] ); - -/** - * \brief Internal AES block decryption function. This is only - * exposed to allow overriding it using see - * \c MBEDTLS_AES_DECRYPT_ALT. - * - * \param ctx The AES context to use for decryption. - * \param input The ciphertext block. - * \param output The output (plaintext) block. - * - * \return \c 0 on success. - */ -int mbedtls_internal_aes_decrypt( mbedtls_aes_context *ctx, - const unsigned char input[16], - unsigned char output[16] ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief Deprecated internal AES block encryption function - * without return value. - * - * \deprecated Superseded by mbedtls_aes_encrypt_ext() in 2.5.0. - * - * \param ctx The AES context to use for encryption. - * \param input Plaintext block. - * \param output Output (ciphertext) block. - */ -MBEDTLS_DEPRECATED void mbedtls_aes_encrypt( mbedtls_aes_context *ctx, - const unsigned char input[16], - unsigned char output[16] ); - -/** - * \brief Deprecated internal AES block decryption function - * without return value. - * - * \deprecated Superseded by mbedtls_aes_decrypt_ext() in 2.5.0. - * - * \param ctx The AES context to use for decryption. - * \param input Ciphertext block. - * \param output Output (plaintext) block. - */ -MBEDTLS_DEPRECATED void mbedtls_aes_decrypt( mbedtls_aes_context *ctx, - const unsigned char input[16], - unsigned char output[16] ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief Checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_aes_self_test( int verbose ); - -#ifdef __cplusplus -} -#endif - -#endif /* aes.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/aesni.h b/tools/sdk/include/mbedtls/mbedtls/aesni.h deleted file mode 100644 index 746baa0e17f..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/aesni.h +++ /dev/null @@ -1,112 +0,0 @@ -/** - * \file aesni.h - * - * \brief AES-NI for hardware AES acceleration on some Intel processors - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_AESNI_H -#define MBEDTLS_AESNI_H - -#include "aes.h" - -#define MBEDTLS_AESNI_AES 0x02000000u -#define MBEDTLS_AESNI_CLMUL 0x00000002u - -#if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && \ - ( defined(__amd64__) || defined(__x86_64__) ) && \ - ! defined(MBEDTLS_HAVE_X86_64) -#define MBEDTLS_HAVE_X86_64 -#endif - -#if defined(MBEDTLS_HAVE_X86_64) - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief AES-NI features detection routine - * - * \param what The feature to detect - * (MBEDTLS_AESNI_AES or MBEDTLS_AESNI_CLMUL) - * - * \return 1 if CPU has support for the feature, 0 otherwise - */ -int mbedtls_aesni_has_support( unsigned int what ); - -/** - * \brief AES-NI AES-ECB block en(de)cryption - * - * \param ctx AES context - * \param mode MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT - * \param input 16-byte input block - * \param output 16-byte output block - * - * \return 0 on success (cannot fail) - */ -int mbedtls_aesni_crypt_ecb( mbedtls_aes_context *ctx, - int mode, - const unsigned char input[16], - unsigned char output[16] ); - -/** - * \brief GCM multiplication: c = a * b in GF(2^128) - * - * \param c Result - * \param a First operand - * \param b Second operand - * - * \note Both operands and result are bit strings interpreted as - * elements of GF(2^128) as per the GCM spec. - */ -void mbedtls_aesni_gcm_mult( unsigned char c[16], - const unsigned char a[16], - const unsigned char b[16] ); - -/** - * \brief Compute decryption round keys from encryption round keys - * - * \param invkey Round keys for the equivalent inverse cipher - * \param fwdkey Original round keys (for encryption) - * \param nr Number of rounds (that is, number of round keys minus one) - */ -void mbedtls_aesni_inverse_key( unsigned char *invkey, - const unsigned char *fwdkey, int nr ); - -/** - * \brief Perform key expansion (for encryption) - * - * \param rk Destination buffer where the round keys are written - * \param key Encryption key - * \param bits Key size in bits (must be 128, 192 or 256) - * - * \return 0 if successful, or MBEDTLS_ERR_AES_INVALID_KEY_LENGTH - */ -int mbedtls_aesni_setkey_enc( unsigned char *rk, - const unsigned char *key, - size_t bits ); - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_HAVE_X86_64 */ - -#endif /* MBEDTLS_AESNI_H */ diff --git a/tools/sdk/include/mbedtls/mbedtls/arc4.h b/tools/sdk/include/mbedtls/mbedtls/arc4.h deleted file mode 100644 index 83a7461f3f2..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/arc4.h +++ /dev/null @@ -1,141 +0,0 @@ -/** - * \file arc4.h - * - * \brief The ARCFOUR stream cipher - * - * \warning ARC4 is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers instead. - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - * - */ -#ifndef MBEDTLS_ARC4_H -#define MBEDTLS_ARC4_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include - -#define MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED -0x0019 /**< ARC4 hardware accelerator failed. */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_ARC4_ALT) -// Regular implementation -// - -/** - * \brief ARC4 context structure - * - * \warning ARC4 is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers instead. - * - */ -typedef struct mbedtls_arc4_context -{ - int x; /*!< permutation index */ - int y; /*!< permutation index */ - unsigned char m[256]; /*!< permutation table */ -} -mbedtls_arc4_context; - -#else /* MBEDTLS_ARC4_ALT */ -#include "arc4_alt.h" -#endif /* MBEDTLS_ARC4_ALT */ - -/** - * \brief Initialize ARC4 context - * - * \param ctx ARC4 context to be initialized - * - * \warning ARC4 is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - * - */ -void mbedtls_arc4_init( mbedtls_arc4_context *ctx ); - -/** - * \brief Clear ARC4 context - * - * \param ctx ARC4 context to be cleared - * - * \warning ARC4 is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - * - */ -void mbedtls_arc4_free( mbedtls_arc4_context *ctx ); - -/** - * \brief ARC4 key schedule - * - * \param ctx ARC4 context to be setup - * \param key the secret key - * \param keylen length of the key, in bytes - * - * \warning ARC4 is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - * - */ -void mbedtls_arc4_setup( mbedtls_arc4_context *ctx, const unsigned char *key, - unsigned int keylen ); - -/** - * \brief ARC4 cipher function - * - * \param ctx ARC4 context - * \param length length of the input data - * \param input buffer holding the input data - * \param output buffer for the output data - * - * \return 0 if successful - * - * \warning ARC4 is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - * - */ -int mbedtls_arc4_crypt( mbedtls_arc4_context *ctx, size_t length, const unsigned char *input, - unsigned char *output ); - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - * - * \warning ARC4 is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - * - */ -int mbedtls_arc4_self_test( int verbose ); - -#ifdef __cplusplus -} -#endif - -#endif /* arc4.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/aria.h b/tools/sdk/include/mbedtls/mbedtls/aria.h deleted file mode 100644 index 4a79c13872e..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/aria.h +++ /dev/null @@ -1,331 +0,0 @@ -/** - * \file aria.h - * - * \brief ARIA block cipher - * - * The ARIA algorithm is a symmetric block cipher that can encrypt and - * decrypt information. It is defined by the Korean Agency for - * Technology and Standards (KATS) in KS X 1213:2004 (in - * Korean, but see http://210.104.33.10/ARIA/index-e.html in English) - * and also described by the IETF in RFC 5794. - */ -/* Copyright (C) 2006-2018, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_ARIA_H -#define MBEDTLS_ARIA_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -#define MBEDTLS_ARIA_ENCRYPT 1 /**< ARIA encryption. */ -#define MBEDTLS_ARIA_DECRYPT 0 /**< ARIA decryption. */ - -#define MBEDTLS_ARIA_BLOCKSIZE 16 /**< ARIA block size in bytes. */ -#define MBEDTLS_ARIA_MAX_ROUNDS 16 /**< Maxiumum number of rounds in ARIA. */ -#define MBEDTLS_ARIA_MAX_KEYSIZE 32 /**< Maximum size of an ARIA key in bytes. */ - -#define MBEDTLS_ERR_ARIA_INVALID_KEY_LENGTH -0x005C /**< Invalid key length. */ -#define MBEDTLS_ERR_ARIA_INVALID_INPUT_LENGTH -0x005E /**< Invalid data input length. */ -#define MBEDTLS_ERR_ARIA_FEATURE_UNAVAILABLE -0x005A /**< Feature not available. For example, an unsupported ARIA key size. */ -#define MBEDTLS_ERR_ARIA_HW_ACCEL_FAILED -0x0058 /**< ARIA hardware accelerator failed. */ - -#if !defined(MBEDTLS_ARIA_ALT) -// Regular implementation -// - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief The ARIA context-type definition. - */ -typedef struct mbedtls_aria_context -{ - unsigned char nr; /*!< The number of rounds (12, 14 or 16) */ - /*! The ARIA round keys. */ - uint32_t rk[MBEDTLS_ARIA_MAX_ROUNDS + 1][MBEDTLS_ARIA_BLOCKSIZE / 4]; -} -mbedtls_aria_context; - -#else /* MBEDTLS_ARIA_ALT */ -#include "aria_alt.h" -#endif /* MBEDTLS_ARIA_ALT */ - -/** - * \brief This function initializes the specified ARIA context. - * - * It must be the first API called before using - * the context. - * - * \param ctx The ARIA context to initialize. - */ -void mbedtls_aria_init( mbedtls_aria_context *ctx ); - -/** - * \brief This function releases and clears the specified ARIA context. - * - * \param ctx The ARIA context to clear. - */ -void mbedtls_aria_free( mbedtls_aria_context *ctx ); - -/** - * \brief This function sets the encryption key. - * - * \param ctx The ARIA context to which the key should be bound. - * \param key The encryption key. - * \param keybits The size of data passed in bits. Valid options are: - *
  • 128 bits
  • - *
  • 192 bits
  • - *
  • 256 bits
- * - * \return \c 0 on success or #MBEDTLS_ERR_ARIA_INVALID_KEY_LENGTH - * on failure. - */ -int mbedtls_aria_setkey_enc( mbedtls_aria_context *ctx, - const unsigned char *key, - unsigned int keybits ); - -/** - * \brief This function sets the decryption key. - * - * \param ctx The ARIA context to which the key should be bound. - * \param key The decryption key. - * \param keybits The size of data passed. Valid options are: - *
  • 128 bits
  • - *
  • 192 bits
  • - *
  • 256 bits
- * - * \return \c 0 on success, or #MBEDTLS_ERR_ARIA_INVALID_KEY_LENGTH on failure. - */ -int mbedtls_aria_setkey_dec( mbedtls_aria_context *ctx, - const unsigned char *key, - unsigned int keybits ); - -/** - * \brief This function performs an ARIA single-block encryption or - * decryption operation. - * - * It performs encryption or decryption (depending on whether - * the key was set for encryption on decryption) on the input - * data buffer defined in the \p input parameter. - * - * mbedtls_aria_init(), and either mbedtls_aria_setkey_enc() or - * mbedtls_aria_setkey_dec() must be called before the first - * call to this API with the same context. - * - * \param ctx The ARIA context to use for encryption or decryption. - * \param input The 16-Byte buffer holding the input data. - * \param output The 16-Byte buffer holding the output data. - - * \return \c 0 on success. - */ -int mbedtls_aria_crypt_ecb( mbedtls_aria_context *ctx, - const unsigned char input[MBEDTLS_ARIA_BLOCKSIZE], - unsigned char output[MBEDTLS_ARIA_BLOCKSIZE] ); - -#if defined(MBEDTLS_CIPHER_MODE_CBC) -/** - * \brief This function performs an ARIA-CBC encryption or decryption operation - * on full blocks. - * - * It performs the operation defined in the \p mode - * parameter (encrypt/decrypt), on the input data buffer defined in - * the \p input parameter. - * - * It can be called as many times as needed, until all the input - * data is processed. mbedtls_aria_init(), and either - * mbedtls_aria_setkey_enc() or mbedtls_aria_setkey_dec() must be called - * before the first call to this API with the same context. - * - * \note This function operates on aligned blocks, that is, the input size - * must be a multiple of the ARIA block size of 16 Bytes. - * - * \note Upon exit, the content of the IV is updated so that you can - * call the same function again on the next - * block(s) of data and get the same result as if it was - * encrypted in one call. This allows a "streaming" usage. - * If you need to retain the contents of the IV, you should - * either save it manually or use the cipher module instead. - * - * - * \param ctx The ARIA context to use for encryption or decryption. - * \param mode The ARIA operation: #MBEDTLS_ARIA_ENCRYPT or - * #MBEDTLS_ARIA_DECRYPT. - * \param length The length of the input data in Bytes. This must be a - * multiple of the block size (16 Bytes). - * \param iv Initialization vector (updated after use). - * \param input The buffer holding the input data. - * \param output The buffer holding the output data. - * - * \return \c 0 on success, or #MBEDTLS_ERR_ARIA_INVALID_INPUT_LENGTH - * on failure. - */ -int mbedtls_aria_crypt_cbc( mbedtls_aria_context *ctx, - int mode, - size_t length, - unsigned char iv[MBEDTLS_ARIA_BLOCKSIZE], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_CBC */ - -#if defined(MBEDTLS_CIPHER_MODE_CFB) -/** - * \brief This function performs an ARIA-CFB128 encryption or decryption - * operation. - * - * It performs the operation defined in the \p mode - * parameter (encrypt or decrypt), on the input data buffer - * defined in the \p input parameter. - * - * For CFB, you must set up the context with mbedtls_aria_setkey_enc(), - * regardless of whether you are performing an encryption or decryption - * operation, that is, regardless of the \p mode parameter. This is - * because CFB mode uses the same key schedule for encryption and - * decryption. - * - * \note Upon exit, the content of the IV is updated so that you can - * call the same function again on the next - * block(s) of data and get the same result as if it was - * encrypted in one call. This allows a "streaming" usage. - * If you need to retain the contents of the - * IV, you must either save it manually or use the cipher - * module instead. - * - * - * \param ctx The ARIA context to use for encryption or decryption. - * \param mode The ARIA operation: #MBEDTLS_ARIA_ENCRYPT or - * #MBEDTLS_ARIA_DECRYPT. - * \param length The length of the input data. - * \param iv_off The offset in IV (updated after use). - * \param iv The initialization vector (updated after use). - * \param input The buffer holding the input data. - * \param output The buffer holding the output data. - * - * \return \c 0 on success. - */ -int mbedtls_aria_crypt_cfb128( mbedtls_aria_context *ctx, - int mode, - size_t length, - size_t *iv_off, - unsigned char iv[MBEDTLS_ARIA_BLOCKSIZE], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_CFB */ - -#if defined(MBEDTLS_CIPHER_MODE_CTR) -/** - * \brief This function performs an ARIA-CTR encryption or decryption - * operation. - * - * This function performs the operation defined in the \p mode - * parameter (encrypt/decrypt), on the input data buffer - * defined in the \p input parameter. - * - * Due to the nature of CTR, you must use the same key schedule - * for both encryption and decryption operations. Therefore, you - * must use the context initialized with mbedtls_aria_setkey_enc() - * for both #MBEDTLS_ARIA_ENCRYPT and #MBEDTLS_ARIA_DECRYPT. - * - * \warning You must never reuse a nonce value with the same key. Doing so - * would void the encryption for the two messages encrypted with - * the same nonce and key. - * - * There are two common strategies for managing nonces with CTR: - * - * 1. You can handle everything as a single message processed over - * successive calls to this function. In that case, you want to - * set \p nonce_counter and \p nc_off to 0 for the first call, and - * then preserve the values of \p nonce_counter, \p nc_off and \p - * stream_block across calls to this function as they will be - * updated by this function. - * - * With this strategy, you must not encrypt more than 2**128 - * blocks of data with the same key. - * - * 2. You can encrypt separate messages by dividing the \p - * nonce_counter buffer in two areas: the first one used for a - * per-message nonce, handled by yourself, and the second one - * updated by this function internally. - * - * For example, you might reserve the first 12 bytes for the - * per-message nonce, and the last 4 bytes for internal use. In that - * case, before calling this function on a new message you need to - * set the first 12 bytes of \p nonce_counter to your chosen nonce - * value, the last 4 to 0, and \p nc_off to 0 (which will cause \p - * stream_block to be ignored). That way, you can encrypt at most - * 2**96 messages of up to 2**32 blocks each with the same key. - * - * The per-message nonce (or information sufficient to reconstruct - * it) needs to be communicated with the ciphertext and must be unique. - * The recommended way to ensure uniqueness is to use a message - * counter. An alternative is to generate random nonces, but this - * limits the number of messages that can be securely encrypted: - * for example, with 96-bit random nonces, you should not encrypt - * more than 2**32 messages with the same key. - * - * Note that for both stategies, sizes are measured in blocks and - * that an ARIA block is 16 bytes. - * - * \warning Upon return, \p stream_block contains sensitive data. Its - * content must not be written to insecure storage and should be - * securely discarded as soon as it's no longer needed. - * - * \param ctx The ARIA context to use for encryption or decryption. - * \param length The length of the input data. - * \param nc_off The offset in the current \p stream_block, for - * resuming within the current cipher stream. The - * offset pointer should be 0 at the start of a stream. - * \param nonce_counter The 128-bit nonce and counter. - * \param stream_block The saved stream block for resuming. This is - * overwritten by the function. - * \param input The buffer holding the input data. - * \param output The buffer holding the output data. - * - * \return \c 0 on success. - */ -int mbedtls_aria_crypt_ctr( mbedtls_aria_context *ctx, - size_t length, - size_t *nc_off, - unsigned char nonce_counter[MBEDTLS_ARIA_BLOCKSIZE], - unsigned char stream_block[MBEDTLS_ARIA_BLOCKSIZE], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_CTR */ - -#if defined(MBEDTLS_SELF_TEST) -/** - * \brief Checkup routine. - * - * \return \c 0 on success, or \c 1 on failure. - */ -int mbedtls_aria_self_test( int verbose ); -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* aria.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/asn1.h b/tools/sdk/include/mbedtls/mbedtls/asn1.h deleted file mode 100644 index 96c1c9a8ab2..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/asn1.h +++ /dev/null @@ -1,358 +0,0 @@ -/** - * \file asn1.h - * - * \brief Generic ASN.1 parsing - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_ASN1_H -#define MBEDTLS_ASN1_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include - -#if defined(MBEDTLS_BIGNUM_C) -#include "bignum.h" -#endif - -/** - * \addtogroup asn1_module - * \{ - */ - -/** - * \name ASN1 Error codes - * These error codes are OR'ed to X509 error codes for - * higher error granularity. - * ASN1 is a standard to specify data structures. - * \{ - */ -#define MBEDTLS_ERR_ASN1_OUT_OF_DATA -0x0060 /**< Out of data when parsing an ASN1 data structure. */ -#define MBEDTLS_ERR_ASN1_UNEXPECTED_TAG -0x0062 /**< ASN1 tag was of an unexpected value. */ -#define MBEDTLS_ERR_ASN1_INVALID_LENGTH -0x0064 /**< Error when trying to determine the length or invalid length. */ -#define MBEDTLS_ERR_ASN1_LENGTH_MISMATCH -0x0066 /**< Actual length differs from expected length. */ -#define MBEDTLS_ERR_ASN1_INVALID_DATA -0x0068 /**< Data is invalid. (not used) */ -#define MBEDTLS_ERR_ASN1_ALLOC_FAILED -0x006A /**< Memory allocation failed */ -#define MBEDTLS_ERR_ASN1_BUF_TOO_SMALL -0x006C /**< Buffer too small when writing ASN.1 data structure. */ - -/* \} name */ - -/** - * \name DER constants - * These constants comply with the DER encoded ASN.1 type tags. - * DER encoding uses hexadecimal representation. - * An example DER sequence is:\n - * - 0x02 -- tag indicating INTEGER - * - 0x01 -- length in octets - * - 0x05 -- value - * Such sequences are typically read into \c ::mbedtls_x509_buf. - * \{ - */ -#define MBEDTLS_ASN1_BOOLEAN 0x01 -#define MBEDTLS_ASN1_INTEGER 0x02 -#define MBEDTLS_ASN1_BIT_STRING 0x03 -#define MBEDTLS_ASN1_OCTET_STRING 0x04 -#define MBEDTLS_ASN1_NULL 0x05 -#define MBEDTLS_ASN1_OID 0x06 -#define MBEDTLS_ASN1_UTF8_STRING 0x0C -#define MBEDTLS_ASN1_SEQUENCE 0x10 -#define MBEDTLS_ASN1_SET 0x11 -#define MBEDTLS_ASN1_PRINTABLE_STRING 0x13 -#define MBEDTLS_ASN1_T61_STRING 0x14 -#define MBEDTLS_ASN1_IA5_STRING 0x16 -#define MBEDTLS_ASN1_UTC_TIME 0x17 -#define MBEDTLS_ASN1_GENERALIZED_TIME 0x18 -#define MBEDTLS_ASN1_UNIVERSAL_STRING 0x1C -#define MBEDTLS_ASN1_BMP_STRING 0x1E -#define MBEDTLS_ASN1_PRIMITIVE 0x00 -#define MBEDTLS_ASN1_CONSTRUCTED 0x20 -#define MBEDTLS_ASN1_CONTEXT_SPECIFIC 0x80 - -/* - * Bit masks for each of the components of an ASN.1 tag as specified in - * ITU X.690 (08/2015), section 8.1 "General rules for encoding", - * paragraph 8.1.2.2: - * - * Bit 8 7 6 5 1 - * +-------+-----+------------+ - * | Class | P/C | Tag number | - * +-------+-----+------------+ - */ -#define MBEDTLS_ASN1_TAG_CLASS_MASK 0xC0 -#define MBEDTLS_ASN1_TAG_PC_MASK 0x20 -#define MBEDTLS_ASN1_TAG_VALUE_MASK 0x1F - -/* \} name */ -/* \} addtogroup asn1_module */ - -/** Returns the size of the binary string, without the trailing \\0 */ -#define MBEDTLS_OID_SIZE(x) (sizeof(x) - 1) - -/** - * Compares an mbedtls_asn1_buf structure to a reference OID. - * - * Only works for 'defined' oid_str values (MBEDTLS_OID_HMAC_SHA1), you cannot use a - * 'unsigned char *oid' here! - */ -#define MBEDTLS_OID_CMP(oid_str, oid_buf) \ - ( ( MBEDTLS_OID_SIZE(oid_str) != (oid_buf)->len ) || \ - memcmp( (oid_str), (oid_buf)->p, (oid_buf)->len) != 0 ) - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \name Functions to parse ASN.1 data structures - * \{ - */ - -/** - * Type-length-value structure that allows for ASN1 using DER. - */ -typedef struct mbedtls_asn1_buf -{ - int tag; /**< ASN1 type, e.g. MBEDTLS_ASN1_UTF8_STRING. */ - size_t len; /**< ASN1 length, in octets. */ - unsigned char *p; /**< ASN1 data, e.g. in ASCII. */ -} -mbedtls_asn1_buf; - -/** - * Container for ASN1 bit strings. - */ -typedef struct mbedtls_asn1_bitstring -{ - size_t len; /**< ASN1 length, in octets. */ - unsigned char unused_bits; /**< Number of unused bits at the end of the string */ - unsigned char *p; /**< Raw ASN1 data for the bit string */ -} -mbedtls_asn1_bitstring; - -/** - * Container for a sequence of ASN.1 items - */ -typedef struct mbedtls_asn1_sequence -{ - mbedtls_asn1_buf buf; /**< Buffer containing the given ASN.1 item. */ - struct mbedtls_asn1_sequence *next; /**< The next entry in the sequence. */ -} -mbedtls_asn1_sequence; - -/** - * Container for a sequence or list of 'named' ASN.1 data items - */ -typedef struct mbedtls_asn1_named_data -{ - mbedtls_asn1_buf oid; /**< The object identifier. */ - mbedtls_asn1_buf val; /**< The named value. */ - struct mbedtls_asn1_named_data *next; /**< The next entry in the sequence. */ - unsigned char next_merged; /**< Merge next item into the current one? */ -} -mbedtls_asn1_named_data; - -/** - * \brief Get the length of an ASN.1 element. - * Updates the pointer to immediately behind the length. - * - * \param p The position in the ASN.1 data - * \param end End of data - * \param len The variable that will receive the value - * - * \return 0 if successful, MBEDTLS_ERR_ASN1_OUT_OF_DATA on reaching - * end of data, MBEDTLS_ERR_ASN1_INVALID_LENGTH if length is - * unparseable. - */ -int mbedtls_asn1_get_len( unsigned char **p, - const unsigned char *end, - size_t *len ); - -/** - * \brief Get the tag and length of the tag. Check for the requested tag. - * Updates the pointer to immediately behind the tag and length. - * - * \param p The position in the ASN.1 data - * \param end End of data - * \param len The variable that will receive the length - * \param tag The expected tag - * - * \return 0 if successful, MBEDTLS_ERR_ASN1_UNEXPECTED_TAG if tag did - * not match requested tag, or another specific ASN.1 error code. - */ -int mbedtls_asn1_get_tag( unsigned char **p, - const unsigned char *end, - size_t *len, int tag ); - -/** - * \brief Retrieve a boolean ASN.1 tag and its value. - * Updates the pointer to immediately behind the full tag. - * - * \param p The position in the ASN.1 data - * \param end End of data - * \param val The variable that will receive the value - * - * \return 0 if successful or a specific ASN.1 error code. - */ -int mbedtls_asn1_get_bool( unsigned char **p, - const unsigned char *end, - int *val ); - -/** - * \brief Retrieve an integer ASN.1 tag and its value. - * Updates the pointer to immediately behind the full tag. - * - * \param p The position in the ASN.1 data - * \param end End of data - * \param val The variable that will receive the value - * - * \return 0 if successful or a specific ASN.1 error code. - */ -int mbedtls_asn1_get_int( unsigned char **p, - const unsigned char *end, - int *val ); - -/** - * \brief Retrieve a bitstring ASN.1 tag and its value. - * Updates the pointer to immediately behind the full tag. - * - * \param p The position in the ASN.1 data - * \param end End of data - * \param bs The variable that will receive the value - * - * \return 0 if successful or a specific ASN.1 error code. - */ -int mbedtls_asn1_get_bitstring( unsigned char **p, const unsigned char *end, - mbedtls_asn1_bitstring *bs); - -/** - * \brief Retrieve a bitstring ASN.1 tag without unused bits and its - * value. - * Updates the pointer to the beginning of the bit/octet string. - * - * \param p The position in the ASN.1 data - * \param end End of data - * \param len Length of the actual bit/octect string in bytes - * - * \return 0 if successful or a specific ASN.1 error code. - */ -int mbedtls_asn1_get_bitstring_null( unsigned char **p, const unsigned char *end, - size_t *len ); - -/** - * \brief Parses and splits an ASN.1 "SEQUENCE OF " - * Updated the pointer to immediately behind the full sequence tag. - * - * \param p The position in the ASN.1 data - * \param end End of data - * \param cur First variable in the chain to fill - * \param tag Type of sequence - * - * \return 0 if successful or a specific ASN.1 error code. - */ -int mbedtls_asn1_get_sequence_of( unsigned char **p, - const unsigned char *end, - mbedtls_asn1_sequence *cur, - int tag); - -#if defined(MBEDTLS_BIGNUM_C) -/** - * \brief Retrieve a MPI value from an integer ASN.1 tag. - * Updates the pointer to immediately behind the full tag. - * - * \param p The position in the ASN.1 data - * \param end End of data - * \param X The MPI that will receive the value - * - * \return 0 if successful or a specific ASN.1 or MPI error code. - */ -int mbedtls_asn1_get_mpi( unsigned char **p, - const unsigned char *end, - mbedtls_mpi *X ); -#endif /* MBEDTLS_BIGNUM_C */ - -/** - * \brief Retrieve an AlgorithmIdentifier ASN.1 sequence. - * Updates the pointer to immediately behind the full - * AlgorithmIdentifier. - * - * \param p The position in the ASN.1 data - * \param end End of data - * \param alg The buffer to receive the OID - * \param params The buffer to receive the params (if any) - * - * \return 0 if successful or a specific ASN.1 or MPI error code. - */ -int mbedtls_asn1_get_alg( unsigned char **p, - const unsigned char *end, - mbedtls_asn1_buf *alg, mbedtls_asn1_buf *params ); - -/** - * \brief Retrieve an AlgorithmIdentifier ASN.1 sequence with NULL or no - * params. - * Updates the pointer to immediately behind the full - * AlgorithmIdentifier. - * - * \param p The position in the ASN.1 data - * \param end End of data - * \param alg The buffer to receive the OID - * - * \return 0 if successful or a specific ASN.1 or MPI error code. - */ -int mbedtls_asn1_get_alg_null( unsigned char **p, - const unsigned char *end, - mbedtls_asn1_buf *alg ); - -/** - * \brief Find a specific named_data entry in a sequence or list based on - * the OID. - * - * \param list The list to seek through - * \param oid The OID to look for - * \param len Size of the OID - * - * \return NULL if not found, or a pointer to the existing entry. - */ -mbedtls_asn1_named_data *mbedtls_asn1_find_named_data( mbedtls_asn1_named_data *list, - const char *oid, size_t len ); - -/** - * \brief Free a mbedtls_asn1_named_data entry - * - * \param entry The named data entry to free - */ -void mbedtls_asn1_free_named_data( mbedtls_asn1_named_data *entry ); - -/** - * \brief Free all entries in a mbedtls_asn1_named_data list - * Head will be set to NULL - * - * \param head Pointer to the head of the list of named data entries to free - */ -void mbedtls_asn1_free_named_data_list( mbedtls_asn1_named_data **head ); - -#ifdef __cplusplus -} -#endif - -#endif /* asn1.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/asn1write.h b/tools/sdk/include/mbedtls/mbedtls/asn1write.h deleted file mode 100644 index f76fc807d07..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/asn1write.h +++ /dev/null @@ -1,240 +0,0 @@ -/** - * \file asn1write.h - * - * \brief ASN.1 buffer writing functionality - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_ASN1_WRITE_H -#define MBEDTLS_ASN1_WRITE_H - -#include "asn1.h" - -#define MBEDTLS_ASN1_CHK_ADD(g, f) do { if( ( ret = f ) < 0 ) return( ret ); else \ - g += ret; } while( 0 ) - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Write a length field in ASN.1 format - * Note: function works backwards in data buffer - * - * \param p reference to current position pointer - * \param start start of the buffer (for bounds-checking) - * \param len the length to write - * - * \return the length written or a negative error code - */ -int mbedtls_asn1_write_len( unsigned char **p, unsigned char *start, size_t len ); - -/** - * \brief Write a ASN.1 tag in ASN.1 format - * Note: function works backwards in data buffer - * - * \param p reference to current position pointer - * \param start start of the buffer (for bounds-checking) - * \param tag the tag to write - * - * \return the length written or a negative error code - */ -int mbedtls_asn1_write_tag( unsigned char **p, unsigned char *start, - unsigned char tag ); - -/** - * \brief Write raw buffer data - * Note: function works backwards in data buffer - * - * \param p reference to current position pointer - * \param start start of the buffer (for bounds-checking) - * \param buf data buffer to write - * \param size length of the data buffer - * - * \return the length written or a negative error code - */ -int mbedtls_asn1_write_raw_buffer( unsigned char **p, unsigned char *start, - const unsigned char *buf, size_t size ); - -#if defined(MBEDTLS_BIGNUM_C) -/** - * \brief Write a big number (MBEDTLS_ASN1_INTEGER) in ASN.1 format - * Note: function works backwards in data buffer - * - * \param p reference to current position pointer - * \param start start of the buffer (for bounds-checking) - * \param X the MPI to write - * - * \return the length written or a negative error code - */ -int mbedtls_asn1_write_mpi( unsigned char **p, unsigned char *start, const mbedtls_mpi *X ); -#endif /* MBEDTLS_BIGNUM_C */ - -/** - * \brief Write a NULL tag (MBEDTLS_ASN1_NULL) with zero data in ASN.1 format - * Note: function works backwards in data buffer - * - * \param p reference to current position pointer - * \param start start of the buffer (for bounds-checking) - * - * \return the length written or a negative error code - */ -int mbedtls_asn1_write_null( unsigned char **p, unsigned char *start ); - -/** - * \brief Write an OID tag (MBEDTLS_ASN1_OID) and data in ASN.1 format - * Note: function works backwards in data buffer - * - * \param p reference to current position pointer - * \param start start of the buffer (for bounds-checking) - * \param oid the OID to write - * \param oid_len length of the OID - * - * \return the length written or a negative error code - */ -int mbedtls_asn1_write_oid( unsigned char **p, unsigned char *start, - const char *oid, size_t oid_len ); - -/** - * \brief Write an AlgorithmIdentifier sequence in ASN.1 format - * Note: function works backwards in data buffer - * - * \param p reference to current position pointer - * \param start start of the buffer (for bounds-checking) - * \param oid the OID of the algorithm - * \param oid_len length of the OID - * \param par_len length of parameters, which must be already written. - * If 0, NULL parameters are added - * - * \return the length written or a negative error code - */ -int mbedtls_asn1_write_algorithm_identifier( unsigned char **p, unsigned char *start, - const char *oid, size_t oid_len, - size_t par_len ); - -/** - * \brief Write a boolean tag (MBEDTLS_ASN1_BOOLEAN) and value in ASN.1 format - * Note: function works backwards in data buffer - * - * \param p reference to current position pointer - * \param start start of the buffer (for bounds-checking) - * \param boolean 0 or 1 - * - * \return the length written or a negative error code - */ -int mbedtls_asn1_write_bool( unsigned char **p, unsigned char *start, int boolean ); - -/** - * \brief Write an int tag (MBEDTLS_ASN1_INTEGER) and value in ASN.1 format - * Note: function works backwards in data buffer - * - * \param p reference to current position pointer - * \param start start of the buffer (for bounds-checking) - * \param val the integer value - * - * \return the length written or a negative error code - */ -int mbedtls_asn1_write_int( unsigned char **p, unsigned char *start, int val ); - -/** - * \brief Write a printable string tag (MBEDTLS_ASN1_PRINTABLE_STRING) and - * value in ASN.1 format - * Note: function works backwards in data buffer - * - * \param p reference to current position pointer - * \param start start of the buffer (for bounds-checking) - * \param text the text to write - * \param text_len length of the text - * - * \return the length written or a negative error code - */ -int mbedtls_asn1_write_printable_string( unsigned char **p, unsigned char *start, - const char *text, size_t text_len ); - -/** - * \brief Write an IA5 string tag (MBEDTLS_ASN1_IA5_STRING) and - * value in ASN.1 format - * Note: function works backwards in data buffer - * - * \param p reference to current position pointer - * \param start start of the buffer (for bounds-checking) - * \param text the text to write - * \param text_len length of the text - * - * \return the length written or a negative error code - */ -int mbedtls_asn1_write_ia5_string( unsigned char **p, unsigned char *start, - const char *text, size_t text_len ); - -/** - * \brief Write a bitstring tag (MBEDTLS_ASN1_BIT_STRING) and - * value in ASN.1 format - * Note: function works backwards in data buffer - * - * \param p reference to current position pointer - * \param start start of the buffer (for bounds-checking) - * \param buf the bitstring - * \param bits the total number of bits in the bitstring - * - * \return the length written or a negative error code - */ -int mbedtls_asn1_write_bitstring( unsigned char **p, unsigned char *start, - const unsigned char *buf, size_t bits ); - -/** - * \brief Write an octet string tag (MBEDTLS_ASN1_OCTET_STRING) and - * value in ASN.1 format - * Note: function works backwards in data buffer - * - * \param p reference to current position pointer - * \param start start of the buffer (for bounds-checking) - * \param buf data buffer to write - * \param size length of the data buffer - * - * \return the length written or a negative error code - */ -int mbedtls_asn1_write_octet_string( unsigned char **p, unsigned char *start, - const unsigned char *buf, size_t size ); - -/** - * \brief Create or find a specific named_data entry for writing in a - * sequence or list based on the OID. If not already in there, - * a new entry is added to the head of the list. - * Warning: Destructive behaviour for the val data! - * - * \param list Pointer to the location of the head of the list to seek - * through (will be updated in case of a new entry) - * \param oid The OID to look for - * \param oid_len Size of the OID - * \param val Data to store (can be NULL if you want to fill it by hand) - * \param val_len Minimum length of the data buffer needed - * - * \return NULL if if there was a memory allocation error, or a pointer - * to the new / existing entry. - */ -mbedtls_asn1_named_data *mbedtls_asn1_store_named_data( mbedtls_asn1_named_data **list, - const char *oid, size_t oid_len, - const unsigned char *val, - size_t val_len ); - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_ASN1_WRITE_H */ diff --git a/tools/sdk/include/mbedtls/mbedtls/base64.h b/tools/sdk/include/mbedtls/mbedtls/base64.h deleted file mode 100644 index 7a64f521635..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/base64.h +++ /dev/null @@ -1,89 +0,0 @@ -/** - * \file base64.h - * - * \brief RFC 1521 base64 encoding/decoding - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_BASE64_H -#define MBEDTLS_BASE64_H - -#include - -#define MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL -0x002A /**< Output buffer too small. */ -#define MBEDTLS_ERR_BASE64_INVALID_CHARACTER -0x002C /**< Invalid character in input. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Encode a buffer into base64 format - * - * \param dst destination buffer - * \param dlen size of the destination buffer - * \param olen number of bytes written - * \param src source buffer - * \param slen amount of data to be encoded - * - * \return 0 if successful, or MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL. - * *olen is always updated to reflect the amount - * of data that has (or would have) been written. - * If that length cannot be represented, then no data is - * written to the buffer and *olen is set to the maximum - * length representable as a size_t. - * - * \note Call this function with dlen = 0 to obtain the - * required buffer size in *olen - */ -int mbedtls_base64_encode( unsigned char *dst, size_t dlen, size_t *olen, - const unsigned char *src, size_t slen ); - -/** - * \brief Decode a base64-formatted buffer - * - * \param dst destination buffer (can be NULL for checking size) - * \param dlen size of the destination buffer - * \param olen number of bytes written - * \param src source buffer - * \param slen amount of data to be decoded - * - * \return 0 if successful, MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL, or - * MBEDTLS_ERR_BASE64_INVALID_CHARACTER if the input data is - * not correct. *olen is always updated to reflect the amount - * of data that has (or would have) been written. - * - * \note Call this function with *dst = NULL or dlen = 0 to obtain - * the required buffer size in *olen - */ -int mbedtls_base64_decode( unsigned char *dst, size_t dlen, size_t *olen, - const unsigned char *src, size_t slen ); - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - */ -int mbedtls_base64_self_test( int verbose ); - -#ifdef __cplusplus -} -#endif - -#endif /* base64.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/bignum.h b/tools/sdk/include/mbedtls/mbedtls/bignum.h deleted file mode 100644 index b267b23e926..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/bignum.h +++ /dev/null @@ -1,777 +0,0 @@ -/** - * \file bignum.h - * - * \brief Multi-precision integer library - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_BIGNUM_H -#define MBEDTLS_BIGNUM_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -#if defined(MBEDTLS_FS_IO) -#include -#endif - -#define MBEDTLS_ERR_MPI_FILE_IO_ERROR -0x0002 /**< An error occurred while reading from or writing to a file. */ -#define MBEDTLS_ERR_MPI_BAD_INPUT_DATA -0x0004 /**< Bad input parameters to function. */ -#define MBEDTLS_ERR_MPI_INVALID_CHARACTER -0x0006 /**< There is an invalid character in the digit string. */ -#define MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL -0x0008 /**< The buffer is too small to write to. */ -#define MBEDTLS_ERR_MPI_NEGATIVE_VALUE -0x000A /**< The input arguments are negative or result in illegal output. */ -#define MBEDTLS_ERR_MPI_DIVISION_BY_ZERO -0x000C /**< The input argument for division is zero, which is not allowed. */ -#define MBEDTLS_ERR_MPI_NOT_ACCEPTABLE -0x000E /**< The input arguments are not acceptable. */ -#define MBEDTLS_ERR_MPI_ALLOC_FAILED -0x0010 /**< Memory allocation failed. */ - -#define MBEDTLS_MPI_CHK(f) do { if( ( ret = f ) != 0 ) goto cleanup; } while( 0 ) - -/* - * Maximum size MPIs are allowed to grow to in number of limbs. - */ -#define MBEDTLS_MPI_MAX_LIMBS 10000 - -#if !defined(MBEDTLS_MPI_WINDOW_SIZE) -/* - * Maximum window size used for modular exponentiation. Default: 6 - * Minimum value: 1. Maximum value: 6. - * - * Result is an array of ( 2 << MBEDTLS_MPI_WINDOW_SIZE ) MPIs used - * for the sliding window calculation. (So 64 by default) - * - * Reduction in size, reduces speed. - */ -#define MBEDTLS_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */ -#endif /* !MBEDTLS_MPI_WINDOW_SIZE */ - -#if !defined(MBEDTLS_MPI_MAX_SIZE) -/* - * Maximum size of MPIs allowed in bits and bytes for user-MPIs. - * ( Default: 512 bytes => 4096 bits, Maximum tested: 2048 bytes => 16384 bits ) - * - * Note: Calculations can temporarily result in larger MPIs. So the number - * of limbs required (MBEDTLS_MPI_MAX_LIMBS) is higher. - */ -#define MBEDTLS_MPI_MAX_SIZE 1024 /**< Maximum number of bytes for usable MPIs. */ -#endif /* !MBEDTLS_MPI_MAX_SIZE */ - -#define MBEDTLS_MPI_MAX_BITS ( 8 * MBEDTLS_MPI_MAX_SIZE ) /**< Maximum number of bits for usable MPIs. */ - -/* - * When reading from files with mbedtls_mpi_read_file() and writing to files with - * mbedtls_mpi_write_file() the buffer should have space - * for a (short) label, the MPI (in the provided radix), the newline - * characters and the '\0'. - * - * By default we assume at least a 10 char label, a minimum radix of 10 - * (decimal) and a maximum of 4096 bit numbers (1234 decimal chars). - * Autosized at compile time for at least a 10 char label, a minimum radix - * of 10 (decimal) for a number of MBEDTLS_MPI_MAX_BITS size. - * - * This used to be statically sized to 1250 for a maximum of 4096 bit - * numbers (1234 decimal chars). - * - * Calculate using the formula: - * MBEDTLS_MPI_RW_BUFFER_SIZE = ceil(MBEDTLS_MPI_MAX_BITS / ln(10) * ln(2)) + - * LabelSize + 6 - */ -#define MBEDTLS_MPI_MAX_BITS_SCALE100 ( 100 * MBEDTLS_MPI_MAX_BITS ) -#define MBEDTLS_LN_2_DIV_LN_10_SCALE100 332 -#define MBEDTLS_MPI_RW_BUFFER_SIZE ( ((MBEDTLS_MPI_MAX_BITS_SCALE100 + MBEDTLS_LN_2_DIV_LN_10_SCALE100 - 1) / MBEDTLS_LN_2_DIV_LN_10_SCALE100) + 10 + 6 ) - -#if !defined(MBEDTLS_BIGNUM_ALT) - -/* - * Define the base integer type, architecture-wise. - * - * 32 or 64-bit integer types can be forced regardless of the underlying - * architecture by defining MBEDTLS_HAVE_INT32 or MBEDTLS_HAVE_INT64 - * respectively and undefining MBEDTLS_HAVE_ASM. - * - * Double-width integers (e.g. 128-bit in 64-bit architectures) can be - * disabled by defining MBEDTLS_NO_UDBL_DIVISION. - */ -#if !defined(MBEDTLS_HAVE_INT32) - #if defined(_MSC_VER) && defined(_M_AMD64) - /* Always choose 64-bit when using MSC */ - #if !defined(MBEDTLS_HAVE_INT64) - #define MBEDTLS_HAVE_INT64 - #endif /* !MBEDTLS_HAVE_INT64 */ - typedef int64_t mbedtls_mpi_sint; - typedef uint64_t mbedtls_mpi_uint; - #elif defined(__GNUC__) && ( \ - defined(__amd64__) || defined(__x86_64__) || \ - defined(__ppc64__) || defined(__powerpc64__) || \ - defined(__ia64__) || defined(__alpha__) || \ - ( defined(__sparc__) && defined(__arch64__) ) || \ - defined(__s390x__) || defined(__mips64) ) - #if !defined(MBEDTLS_HAVE_INT64) - #define MBEDTLS_HAVE_INT64 - #endif /* MBEDTLS_HAVE_INT64 */ - typedef int64_t mbedtls_mpi_sint; - typedef uint64_t mbedtls_mpi_uint; - #if !defined(MBEDTLS_NO_UDBL_DIVISION) - /* mbedtls_t_udbl defined as 128-bit unsigned int */ - typedef unsigned int mbedtls_t_udbl __attribute__((mode(TI))); - #define MBEDTLS_HAVE_UDBL - #endif /* !MBEDTLS_NO_UDBL_DIVISION */ - #elif defined(__ARMCC_VERSION) && defined(__aarch64__) - /* - * __ARMCC_VERSION is defined for both armcc and armclang and - * __aarch64__ is only defined by armclang when compiling 64-bit code - */ - #if !defined(MBEDTLS_HAVE_INT64) - #define MBEDTLS_HAVE_INT64 - #endif /* !MBEDTLS_HAVE_INT64 */ - typedef int64_t mbedtls_mpi_sint; - typedef uint64_t mbedtls_mpi_uint; - #if !defined(MBEDTLS_NO_UDBL_DIVISION) - /* mbedtls_t_udbl defined as 128-bit unsigned int */ - typedef __uint128_t mbedtls_t_udbl; - #define MBEDTLS_HAVE_UDBL - #endif /* !MBEDTLS_NO_UDBL_DIVISION */ - #elif defined(MBEDTLS_HAVE_INT64) - /* Force 64-bit integers with unknown compiler */ - typedef int64_t mbedtls_mpi_sint; - typedef uint64_t mbedtls_mpi_uint; - #endif -#endif /* !MBEDTLS_HAVE_INT32 */ - -#if !defined(MBEDTLS_HAVE_INT64) - /* Default to 32-bit compilation */ - #if !defined(MBEDTLS_HAVE_INT32) - #define MBEDTLS_HAVE_INT32 - #endif /* !MBEDTLS_HAVE_INT32 */ - typedef int32_t mbedtls_mpi_sint; - typedef uint32_t mbedtls_mpi_uint; - #if !defined(MBEDTLS_NO_UDBL_DIVISION) - typedef uint64_t mbedtls_t_udbl; - #define MBEDTLS_HAVE_UDBL - #endif /* !MBEDTLS_NO_UDBL_DIVISION */ -#endif /* !MBEDTLS_HAVE_INT64 */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief MPI structure - */ -typedef struct mbedtls_mpi -{ - int s; /*!< integer sign */ - size_t n; /*!< total # of limbs */ - mbedtls_mpi_uint *p; /*!< pointer to limbs */ -} -mbedtls_mpi; - -/** - * \brief Initialize one MPI (make internal references valid) - * This just makes it ready to be set or freed, - * but does not define a value for the MPI. - * - * \param X One MPI to initialize. - */ -void mbedtls_mpi_init( mbedtls_mpi *X ); - -/** - * \brief Unallocate one MPI - * - * \param X One MPI to unallocate. - */ -void mbedtls_mpi_free( mbedtls_mpi *X ); - -/** - * \brief Enlarge to the specified number of limbs - * - * This function does nothing if the MPI is already large enough. - * - * \param X MPI to grow - * \param nblimbs The target number of limbs - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed - */ -int mbedtls_mpi_grow( mbedtls_mpi *X, size_t nblimbs ); - -/** - * \brief Resize down, keeping at least the specified number of limbs - * - * If \c X is smaller than \c nblimbs, it is resized up - * instead. - * - * \param X MPI to shrink - * \param nblimbs The minimum number of limbs to keep - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed - * (this can only happen when resizing up). - */ -int mbedtls_mpi_shrink( mbedtls_mpi *X, size_t nblimbs ); - -/** - * \brief Copy the contents of Y into X - * - * \param X Destination MPI. It is enlarged if necessary. - * \param Y Source MPI. - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed - */ -int mbedtls_mpi_copy( mbedtls_mpi *X, const mbedtls_mpi *Y ); - -/** - * \brief Swap the contents of X and Y - * - * \param X First MPI value - * \param Y Second MPI value - */ -void mbedtls_mpi_swap( mbedtls_mpi *X, mbedtls_mpi *Y ); - -/** - * \brief Safe conditional assignement X = Y if assign is 1 - * - * \param X MPI to conditionally assign to - * \param Y Value to be assigned - * \param assign 1: perform the assignment, 0: keep X's original value - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed, - * - * \note This function is equivalent to - * if( assign ) mbedtls_mpi_copy( X, Y ); - * except that it avoids leaking any information about whether - * the assignment was done or not (the above code may leak - * information through branch prediction and/or memory access - * patterns analysis). - */ -int mbedtls_mpi_safe_cond_assign( mbedtls_mpi *X, const mbedtls_mpi *Y, unsigned char assign ); - -/** - * \brief Safe conditional swap X <-> Y if swap is 1 - * - * \param X First mbedtls_mpi value - * \param Y Second mbedtls_mpi value - * \param assign 1: perform the swap, 0: keep X and Y's original values - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed, - * - * \note This function is equivalent to - * if( assign ) mbedtls_mpi_swap( X, Y ); - * except that it avoids leaking any information about whether - * the assignment was done or not (the above code may leak - * information through branch prediction and/or memory access - * patterns analysis). - */ -int mbedtls_mpi_safe_cond_swap( mbedtls_mpi *X, mbedtls_mpi *Y, unsigned char assign ); - -/** - * \brief Set value from integer - * - * \param X MPI to set - * \param z Value to use - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed - */ -int mbedtls_mpi_lset( mbedtls_mpi *X, mbedtls_mpi_sint z ); - -/** - * \brief Get a specific bit from X - * - * \param X MPI to use - * \param pos Zero-based index of the bit in X - * - * \return Either a 0 or a 1 - */ -int mbedtls_mpi_get_bit( const mbedtls_mpi *X, size_t pos ); - -/** - * \brief Set a bit of X to a specific value of 0 or 1 - * - * \note Will grow X if necessary to set a bit to 1 in a not yet - * existing limb. Will not grow if bit should be set to 0 - * - * \param X MPI to use - * \param pos Zero-based index of the bit in X - * \param val The value to set the bit to (0 or 1) - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed, - * MBEDTLS_ERR_MPI_BAD_INPUT_DATA if val is not 0 or 1 - */ -int mbedtls_mpi_set_bit( mbedtls_mpi *X, size_t pos, unsigned char val ); - -/** - * \brief Return the number of zero-bits before the least significant - * '1' bit - * - * Note: Thus also the zero-based index of the least significant '1' bit - * - * \param X MPI to use - */ -size_t mbedtls_mpi_lsb( const mbedtls_mpi *X ); - -/** - * \brief Return the number of bits up to and including the most - * significant '1' bit' - * - * Note: Thus also the one-based index of the most significant '1' bit - * - * \param X MPI to use - */ -size_t mbedtls_mpi_bitlen( const mbedtls_mpi *X ); - -/** - * \brief Return the total size in bytes - * - * \param X MPI to use - */ -size_t mbedtls_mpi_size( const mbedtls_mpi *X ); - -/** - * \brief Import from an ASCII string - * - * \param X Destination MPI - * \param radix Input numeric base - * \param s Null-terminated string buffer - * - * \return 0 if successful, or a MBEDTLS_ERR_MPI_XXX error code - */ -int mbedtls_mpi_read_string( mbedtls_mpi *X, int radix, const char *s ); - -/** - * \brief Export into an ASCII string - * - * \param X Source MPI - * \param radix Output numeric base - * \param buf Buffer to write the string to - * \param buflen Length of buf - * \param olen Length of the string written, including final NUL byte - * - * \return 0 if successful, or a MBEDTLS_ERR_MPI_XXX error code. - * *olen is always updated to reflect the amount - * of data that has (or would have) been written. - * - * \note Call this function with buflen = 0 to obtain the - * minimum required buffer size in *olen. - */ -int mbedtls_mpi_write_string( const mbedtls_mpi *X, int radix, - char *buf, size_t buflen, size_t *olen ); - -#if defined(MBEDTLS_FS_IO) -/** - * \brief Read MPI from a line in an opened file - * - * \param X Destination MPI - * \param radix Input numeric base - * \param fin Input file handle - * - * \return 0 if successful, MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if - * the file read buffer is too small or a - * MBEDTLS_ERR_MPI_XXX error code - * - * \note On success, this function advances the file stream - * to the end of the current line or to EOF. - * - * The function returns 0 on an empty line. - * - * Leading whitespaces are ignored, as is a - * '0x' prefix for radix 16. - * - */ -int mbedtls_mpi_read_file( mbedtls_mpi *X, int radix, FILE *fin ); - -/** - * \brief Write X into an opened file, or stdout if fout is NULL - * - * \param p Prefix, can be NULL - * \param X Source MPI - * \param radix Output numeric base - * \param fout Output file handle (can be NULL) - * - * \return 0 if successful, or a MBEDTLS_ERR_MPI_XXX error code - * - * \note Set fout == NULL to print X on the console. - */ -int mbedtls_mpi_write_file( const char *p, const mbedtls_mpi *X, int radix, FILE *fout ); -#endif /* MBEDTLS_FS_IO */ - -/** - * \brief Import X from unsigned binary data, big endian - * - * \param X Destination MPI - * \param buf Input buffer - * \param buflen Input buffer size - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed - */ -int mbedtls_mpi_read_binary( mbedtls_mpi *X, const unsigned char *buf, size_t buflen ); - -/** - * \brief Export X into unsigned binary data, big endian. - * Always fills the whole buffer, which will start with zeros - * if the number is smaller. - * - * \param X Source MPI - * \param buf Output buffer - * \param buflen Output buffer size - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if buf isn't large enough - */ -int mbedtls_mpi_write_binary( const mbedtls_mpi *X, unsigned char *buf, size_t buflen ); - -/** - * \brief Left-shift: X <<= count - * - * \param X MPI to shift - * \param count Amount to shift - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed - */ -int mbedtls_mpi_shift_l( mbedtls_mpi *X, size_t count ); - -/** - * \brief Right-shift: X >>= count - * - * \param X MPI to shift - * \param count Amount to shift - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed - */ -int mbedtls_mpi_shift_r( mbedtls_mpi *X, size_t count ); - -/** - * \brief Compare unsigned values - * - * \param X Left-hand MPI - * \param Y Right-hand MPI - * - * \return 1 if |X| is greater than |Y|, - * -1 if |X| is lesser than |Y| or - * 0 if |X| is equal to |Y| - */ -int mbedtls_mpi_cmp_abs( const mbedtls_mpi *X, const mbedtls_mpi *Y ); - -/** - * \brief Compare signed values - * - * \param X Left-hand MPI - * \param Y Right-hand MPI - * - * \return 1 if X is greater than Y, - * -1 if X is lesser than Y or - * 0 if X is equal to Y - */ -int mbedtls_mpi_cmp_mpi( const mbedtls_mpi *X, const mbedtls_mpi *Y ); - -/** - * \brief Compare signed values - * - * \param X Left-hand MPI - * \param z The integer value to compare to - * - * \return 1 if X is greater than z, - * -1 if X is lesser than z or - * 0 if X is equal to z - */ -int mbedtls_mpi_cmp_int( const mbedtls_mpi *X, mbedtls_mpi_sint z ); - -/** - * \brief Unsigned addition: X = |A| + |B| - * - * \param X Destination MPI - * \param A Left-hand MPI - * \param B Right-hand MPI - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed - */ -int mbedtls_mpi_add_abs( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *B ); - -/** - * \brief Unsigned subtraction: X = |A| - |B| - * - * \param X Destination MPI - * \param A Left-hand MPI - * \param B Right-hand MPI - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_NEGATIVE_VALUE if B is greater than A - */ -int mbedtls_mpi_sub_abs( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *B ); - -/** - * \brief Signed addition: X = A + B - * - * \param X Destination MPI - * \param A Left-hand MPI - * \param B Right-hand MPI - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed - */ -int mbedtls_mpi_add_mpi( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *B ); - -/** - * \brief Signed subtraction: X = A - B - * - * \param X Destination MPI - * \param A Left-hand MPI - * \param B Right-hand MPI - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed - */ -int mbedtls_mpi_sub_mpi( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *B ); - -/** - * \brief Signed addition: X = A + b - * - * \param X Destination MPI - * \param A Left-hand MPI - * \param b The integer value to add - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed - */ -int mbedtls_mpi_add_int( mbedtls_mpi *X, const mbedtls_mpi *A, mbedtls_mpi_sint b ); - -/** - * \brief Signed subtraction: X = A - b - * - * \param X Destination MPI - * \param A Left-hand MPI - * \param b The integer value to subtract - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed - */ -int mbedtls_mpi_sub_int( mbedtls_mpi *X, const mbedtls_mpi *A, mbedtls_mpi_sint b ); - -/** - * \brief Baseline multiplication: X = A * B - * - * \param X Destination MPI - * \param A Left-hand MPI - * \param B Right-hand MPI - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed - */ -int mbedtls_mpi_mul_mpi( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *B ); - -/** - * \brief Baseline multiplication: X = A * b - * - * \param X Destination MPI - * \param A Left-hand MPI - * \param b The unsigned integer value to multiply with - * - * \note b is unsigned - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed - */ -int mbedtls_mpi_mul_int( mbedtls_mpi *X, const mbedtls_mpi *A, mbedtls_mpi_uint b ); - -/** - * \brief Division by mbedtls_mpi: A = Q * B + R - * - * \param Q Destination MPI for the quotient - * \param R Destination MPI for the rest value - * \param A Left-hand MPI - * \param B Right-hand MPI - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed, - * MBEDTLS_ERR_MPI_DIVISION_BY_ZERO if B == 0 - * - * \note Either Q or R can be NULL. - */ -int mbedtls_mpi_div_mpi( mbedtls_mpi *Q, mbedtls_mpi *R, const mbedtls_mpi *A, const mbedtls_mpi *B ); - -/** - * \brief Division by int: A = Q * b + R - * - * \param Q Destination MPI for the quotient - * \param R Destination MPI for the rest value - * \param A Left-hand MPI - * \param b Integer to divide by - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed, - * MBEDTLS_ERR_MPI_DIVISION_BY_ZERO if b == 0 - * - * \note Either Q or R can be NULL. - */ -int mbedtls_mpi_div_int( mbedtls_mpi *Q, mbedtls_mpi *R, const mbedtls_mpi *A, mbedtls_mpi_sint b ); - -/** - * \brief Modulo: R = A mod B - * - * \param R Destination MPI for the rest value - * \param A Left-hand MPI - * \param B Right-hand MPI - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed, - * MBEDTLS_ERR_MPI_DIVISION_BY_ZERO if B == 0, - * MBEDTLS_ERR_MPI_NEGATIVE_VALUE if B < 0 - */ -int mbedtls_mpi_mod_mpi( mbedtls_mpi *R, const mbedtls_mpi *A, const mbedtls_mpi *B ); - -/** - * \brief Modulo: r = A mod b - * - * \param r Destination mbedtls_mpi_uint - * \param A Left-hand MPI - * \param b Integer to divide by - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed, - * MBEDTLS_ERR_MPI_DIVISION_BY_ZERO if b == 0, - * MBEDTLS_ERR_MPI_NEGATIVE_VALUE if b < 0 - */ -int mbedtls_mpi_mod_int( mbedtls_mpi_uint *r, const mbedtls_mpi *A, mbedtls_mpi_sint b ); - -/** - * \brief Sliding-window exponentiation: X = A^E mod N - * - * \param X Destination MPI - * \param A Left-hand MPI - * \param E Exponent MPI - * \param N Modular MPI - * \param _RR Speed-up MPI used for recalculations - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed, - * MBEDTLS_ERR_MPI_BAD_INPUT_DATA if N is negative or even or - * if E is negative - * - * \note _RR is used to avoid re-computing R*R mod N across - * multiple calls, which speeds up things a bit. It can - * be set to NULL if the extra performance is unneeded. - */ -int mbedtls_mpi_exp_mod( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *E, const mbedtls_mpi *N, mbedtls_mpi *_RR ); - -/** - * \brief Fill an MPI X with size bytes of random - * - * \param X Destination MPI - * \param size Size in bytes - * \param f_rng RNG function - * \param p_rng RNG parameter - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed - * - * \note The bytes obtained from the PRNG are interpreted - * as a big-endian representation of an MPI; this can - * be relevant in applications like deterministic ECDSA. - */ -int mbedtls_mpi_fill_random( mbedtls_mpi *X, size_t size, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief Greatest common divisor: G = gcd(A, B) - * - * \param G Destination MPI - * \param A Left-hand MPI - * \param B Right-hand MPI - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed - */ -int mbedtls_mpi_gcd( mbedtls_mpi *G, const mbedtls_mpi *A, const mbedtls_mpi *B ); - -/** - * \brief Modular inverse: X = A^-1 mod N - * - * \param X Destination MPI - * \param A Left-hand MPI - * \param N Right-hand MPI - * - * \return 0 if successful, - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed, - * MBEDTLS_ERR_MPI_BAD_INPUT_DATA if N is <= 1, - MBEDTLS_ERR_MPI_NOT_ACCEPTABLE if A has no inverse mod N. - */ -int mbedtls_mpi_inv_mod( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *N ); - -/** - * \brief Miller-Rabin primality test - * - * \param X MPI to check - * \param f_rng RNG function - * \param p_rng RNG parameter - * - * \return 0 if successful (probably prime), - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed, - * MBEDTLS_ERR_MPI_NOT_ACCEPTABLE if X is not prime - */ -int mbedtls_mpi_is_prime( const mbedtls_mpi *X, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief Prime number generation - * - * \param X Destination MPI - * \param nbits Required size of X in bits - * ( 3 <= nbits <= MBEDTLS_MPI_MAX_BITS ) - * \param dh_flag If 1, then (X-1)/2 will be prime too - * \param f_rng RNG function - * \param p_rng RNG parameter - * - * \return 0 if successful (probably prime), - * MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed, - * MBEDTLS_ERR_MPI_BAD_INPUT_DATA if nbits is < 3 - */ -int mbedtls_mpi_gen_prime( mbedtls_mpi *X, size_t nbits, int dh_flag, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); -#else /* MBEDTLS_BIGNUM_ALT */ -#include "bignum_alt.h" -#endif /* MBEDTLS_BIGNUM_ALT */ - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - */ -int mbedtls_mpi_self_test( int verbose ); - -#ifdef __cplusplus -} -#endif - -#endif /* bignum.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/blowfish.h b/tools/sdk/include/mbedtls/mbedtls/blowfish.h deleted file mode 100644 index eea6882f75d..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/blowfish.h +++ /dev/null @@ -1,244 +0,0 @@ -/** - * \file blowfish.h - * - * \brief Blowfish block cipher - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_BLOWFISH_H -#define MBEDTLS_BLOWFISH_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -#define MBEDTLS_BLOWFISH_ENCRYPT 1 -#define MBEDTLS_BLOWFISH_DECRYPT 0 -#define MBEDTLS_BLOWFISH_MAX_KEY_BITS 448 -#define MBEDTLS_BLOWFISH_MIN_KEY_BITS 32 -#define MBEDTLS_BLOWFISH_ROUNDS 16 /**< Rounds to use. When increasing this value, make sure to extend the initialisation vectors */ -#define MBEDTLS_BLOWFISH_BLOCKSIZE 8 /* Blowfish uses 64 bit blocks */ - -#define MBEDTLS_ERR_BLOWFISH_INVALID_KEY_LENGTH -0x0016 /**< Invalid key length. */ -#define MBEDTLS_ERR_BLOWFISH_HW_ACCEL_FAILED -0x0017 /**< Blowfish hardware accelerator failed. */ -#define MBEDTLS_ERR_BLOWFISH_INVALID_INPUT_LENGTH -0x0018 /**< Invalid data input length. */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_BLOWFISH_ALT) -// Regular implementation -// - -/** - * \brief Blowfish context structure - */ -typedef struct mbedtls_blowfish_context -{ - uint32_t P[MBEDTLS_BLOWFISH_ROUNDS + 2]; /*!< Blowfish round keys */ - uint32_t S[4][256]; /*!< key dependent S-boxes */ -} -mbedtls_blowfish_context; - -#else /* MBEDTLS_BLOWFISH_ALT */ -#include "blowfish_alt.h" -#endif /* MBEDTLS_BLOWFISH_ALT */ - -/** - * \brief Initialize Blowfish context - * - * \param ctx Blowfish context to be initialized - */ -void mbedtls_blowfish_init( mbedtls_blowfish_context *ctx ); - -/** - * \brief Clear Blowfish context - * - * \param ctx Blowfish context to be cleared - */ -void mbedtls_blowfish_free( mbedtls_blowfish_context *ctx ); - -/** - * \brief Blowfish key schedule - * - * \param ctx Blowfish context to be initialized - * \param key encryption key - * \param keybits must be between 32 and 448 bits - * - * \return 0 if successful, or MBEDTLS_ERR_BLOWFISH_INVALID_KEY_LENGTH - */ -int mbedtls_blowfish_setkey( mbedtls_blowfish_context *ctx, const unsigned char *key, - unsigned int keybits ); - -/** - * \brief Blowfish-ECB block encryption/decryption - * - * \param ctx Blowfish context - * \param mode MBEDTLS_BLOWFISH_ENCRYPT or MBEDTLS_BLOWFISH_DECRYPT - * \param input 8-byte input block - * \param output 8-byte output block - * - * \return 0 if successful - */ -int mbedtls_blowfish_crypt_ecb( mbedtls_blowfish_context *ctx, - int mode, - const unsigned char input[MBEDTLS_BLOWFISH_BLOCKSIZE], - unsigned char output[MBEDTLS_BLOWFISH_BLOCKSIZE] ); - -#if defined(MBEDTLS_CIPHER_MODE_CBC) -/** - * \brief Blowfish-CBC buffer encryption/decryption - * Length should be a multiple of the block - * size (8 bytes) - * - * \note Upon exit, the content of the IV is updated so that you can - * call the function same function again on the following - * block(s) of data and get the same result as if it was - * encrypted in one call. This allows a "streaming" usage. - * If on the other hand you need to retain the contents of the - * IV, you should either save it manually or use the cipher - * module instead. - * - * \param ctx Blowfish context - * \param mode MBEDTLS_BLOWFISH_ENCRYPT or MBEDTLS_BLOWFISH_DECRYPT - * \param length length of the input data - * \param iv initialization vector (updated after use) - * \param input buffer holding the input data - * \param output buffer holding the output data - * - * \return 0 if successful, or - * MBEDTLS_ERR_BLOWFISH_INVALID_INPUT_LENGTH - */ -int mbedtls_blowfish_crypt_cbc( mbedtls_blowfish_context *ctx, - int mode, - size_t length, - unsigned char iv[MBEDTLS_BLOWFISH_BLOCKSIZE], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_CBC */ - -#if defined(MBEDTLS_CIPHER_MODE_CFB) -/** - * \brief Blowfish CFB buffer encryption/decryption. - * - * \note Upon exit, the content of the IV is updated so that you can - * call the function same function again on the following - * block(s) of data and get the same result as if it was - * encrypted in one call. This allows a "streaming" usage. - * If on the other hand you need to retain the contents of the - * IV, you should either save it manually or use the cipher - * module instead. - * - * \param ctx Blowfish context - * \param mode MBEDTLS_BLOWFISH_ENCRYPT or MBEDTLS_BLOWFISH_DECRYPT - * \param length length of the input data - * \param iv_off offset in IV (updated after use) - * \param iv initialization vector (updated after use) - * \param input buffer holding the input data - * \param output buffer holding the output data - * - * \return 0 if successful - */ -int mbedtls_blowfish_crypt_cfb64( mbedtls_blowfish_context *ctx, - int mode, - size_t length, - size_t *iv_off, - unsigned char iv[MBEDTLS_BLOWFISH_BLOCKSIZE], - const unsigned char *input, - unsigned char *output ); -#endif /*MBEDTLS_CIPHER_MODE_CFB */ - -#if defined(MBEDTLS_CIPHER_MODE_CTR) -/** - * \brief Blowfish-CTR buffer encryption/decryption - * - * \warning You must never reuse a nonce value with the same key. Doing so - * would void the encryption for the two messages encrypted with - * the same nonce and key. - * - * There are two common strategies for managing nonces with CTR: - * - * 1. You can handle everything as a single message processed over - * successive calls to this function. In that case, you want to - * set \p nonce_counter and \p nc_off to 0 for the first call, and - * then preserve the values of \p nonce_counter, \p nc_off and \p - * stream_block across calls to this function as they will be - * updated by this function. - * - * With this strategy, you must not encrypt more than 2**64 - * blocks of data with the same key. - * - * 2. You can encrypt separate messages by dividing the \p - * nonce_counter buffer in two areas: the first one used for a - * per-message nonce, handled by yourself, and the second one - * updated by this function internally. - * - * For example, you might reserve the first 4 bytes for the - * per-message nonce, and the last 4 bytes for internal use. In that - * case, before calling this function on a new message you need to - * set the first 4 bytes of \p nonce_counter to your chosen nonce - * value, the last 4 to 0, and \p nc_off to 0 (which will cause \p - * stream_block to be ignored). That way, you can encrypt at most - * 2**32 messages of up to 2**32 blocks each with the same key. - * - * The per-message nonce (or information sufficient to reconstruct - * it) needs to be communicated with the ciphertext and must be unique. - * The recommended way to ensure uniqueness is to use a message - * counter. - * - * Note that for both stategies, sizes are measured in blocks and - * that a Blowfish block is 8 bytes. - * - * \warning Upon return, \p stream_block contains sensitive data. Its - * content must not be written to insecure storage and should be - * securely discarded as soon as it's no longer needed. - * - * \param ctx Blowfish context - * \param length The length of the data - * \param nc_off The offset in the current stream_block (for resuming - * within current cipher stream). The offset pointer to - * should be 0 at the start of a stream. - * \param nonce_counter The 64-bit nonce and counter. - * \param stream_block The saved stream-block for resuming. Is overwritten - * by the function. - * \param input The input data stream - * \param output The output data stream - * - * \return 0 if successful - */ -int mbedtls_blowfish_crypt_ctr( mbedtls_blowfish_context *ctx, - size_t length, - size_t *nc_off, - unsigned char nonce_counter[MBEDTLS_BLOWFISH_BLOCKSIZE], - unsigned char stream_block[MBEDTLS_BLOWFISH_BLOCKSIZE], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_CTR */ - -#ifdef __cplusplus -} -#endif - -#endif /* blowfish.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/bn_mul.h b/tools/sdk/include/mbedtls/mbedtls/bn_mul.h deleted file mode 100644 index b587317d959..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/bn_mul.h +++ /dev/null @@ -1,893 +0,0 @@ -/** - * \file bn_mul.h - * - * \brief Multi-precision integer library - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -/* - * Multiply source vector [s] with b, add result - * to destination vector [d] and set carry c. - * - * Currently supports: - * - * . IA-32 (386+) . AMD64 / EM64T - * . IA-32 (SSE2) . Motorola 68000 - * . PowerPC, 32-bit . MicroBlaze - * . PowerPC, 64-bit . TriCore - * . SPARC v8 . ARM v3+ - * . Alpha . MIPS32 - * . C, longlong . C, generic - */ -#ifndef MBEDTLS_BN_MUL_H -#define MBEDTLS_BN_MUL_H - -#include "bignum.h" - -#if defined(MBEDTLS_HAVE_ASM) - -#ifndef asm -#define asm __asm -#endif - -/* armcc5 --gnu defines __GNUC__ but doesn't support GNU's extended asm */ -#if defined(__GNUC__) && \ - ( !defined(__ARMCC_VERSION) || __ARMCC_VERSION >= 6000000 ) - -/* - * Disable use of the i386 assembly code below if option -O0, to disable all - * compiler optimisations, is passed, detected with __OPTIMIZE__ - * This is done as the number of registers used in the assembly code doesn't - * work with the -O0 option. - */ -#if defined(__i386__) && defined(__OPTIMIZE__) - -#define MULADDC_INIT \ - asm( \ - "movl %%ebx, %0 \n\t" \ - "movl %5, %%esi \n\t" \ - "movl %6, %%edi \n\t" \ - "movl %7, %%ecx \n\t" \ - "movl %8, %%ebx \n\t" - -#define MULADDC_CORE \ - "lodsl \n\t" \ - "mull %%ebx \n\t" \ - "addl %%ecx, %%eax \n\t" \ - "adcl $0, %%edx \n\t" \ - "addl (%%edi), %%eax \n\t" \ - "adcl $0, %%edx \n\t" \ - "movl %%edx, %%ecx \n\t" \ - "stosl \n\t" - -#if defined(MBEDTLS_HAVE_SSE2) - -#define MULADDC_HUIT \ - "movd %%ecx, %%mm1 \n\t" \ - "movd %%ebx, %%mm0 \n\t" \ - "movd (%%edi), %%mm3 \n\t" \ - "paddq %%mm3, %%mm1 \n\t" \ - "movd (%%esi), %%mm2 \n\t" \ - "pmuludq %%mm0, %%mm2 \n\t" \ - "movd 4(%%esi), %%mm4 \n\t" \ - "pmuludq %%mm0, %%mm4 \n\t" \ - "movd 8(%%esi), %%mm6 \n\t" \ - "pmuludq %%mm0, %%mm6 \n\t" \ - "movd 12(%%esi), %%mm7 \n\t" \ - "pmuludq %%mm0, %%mm7 \n\t" \ - "paddq %%mm2, %%mm1 \n\t" \ - "movd 4(%%edi), %%mm3 \n\t" \ - "paddq %%mm4, %%mm3 \n\t" \ - "movd 8(%%edi), %%mm5 \n\t" \ - "paddq %%mm6, %%mm5 \n\t" \ - "movd 12(%%edi), %%mm4 \n\t" \ - "paddq %%mm4, %%mm7 \n\t" \ - "movd %%mm1, (%%edi) \n\t" \ - "movd 16(%%esi), %%mm2 \n\t" \ - "pmuludq %%mm0, %%mm2 \n\t" \ - "psrlq $32, %%mm1 \n\t" \ - "movd 20(%%esi), %%mm4 \n\t" \ - "pmuludq %%mm0, %%mm4 \n\t" \ - "paddq %%mm3, %%mm1 \n\t" \ - "movd 24(%%esi), %%mm6 \n\t" \ - "pmuludq %%mm0, %%mm6 \n\t" \ - "movd %%mm1, 4(%%edi) \n\t" \ - "psrlq $32, %%mm1 \n\t" \ - "movd 28(%%esi), %%mm3 \n\t" \ - "pmuludq %%mm0, %%mm3 \n\t" \ - "paddq %%mm5, %%mm1 \n\t" \ - "movd 16(%%edi), %%mm5 \n\t" \ - "paddq %%mm5, %%mm2 \n\t" \ - "movd %%mm1, 8(%%edi) \n\t" \ - "psrlq $32, %%mm1 \n\t" \ - "paddq %%mm7, %%mm1 \n\t" \ - "movd 20(%%edi), %%mm5 \n\t" \ - "paddq %%mm5, %%mm4 \n\t" \ - "movd %%mm1, 12(%%edi) \n\t" \ - "psrlq $32, %%mm1 \n\t" \ - "paddq %%mm2, %%mm1 \n\t" \ - "movd 24(%%edi), %%mm5 \n\t" \ - "paddq %%mm5, %%mm6 \n\t" \ - "movd %%mm1, 16(%%edi) \n\t" \ - "psrlq $32, %%mm1 \n\t" \ - "paddq %%mm4, %%mm1 \n\t" \ - "movd 28(%%edi), %%mm5 \n\t" \ - "paddq %%mm5, %%mm3 \n\t" \ - "movd %%mm1, 20(%%edi) \n\t" \ - "psrlq $32, %%mm1 \n\t" \ - "paddq %%mm6, %%mm1 \n\t" \ - "movd %%mm1, 24(%%edi) \n\t" \ - "psrlq $32, %%mm1 \n\t" \ - "paddq %%mm3, %%mm1 \n\t" \ - "movd %%mm1, 28(%%edi) \n\t" \ - "addl $32, %%edi \n\t" \ - "addl $32, %%esi \n\t" \ - "psrlq $32, %%mm1 \n\t" \ - "movd %%mm1, %%ecx \n\t" - -#define MULADDC_STOP \ - "emms \n\t" \ - "movl %4, %%ebx \n\t" \ - "movl %%ecx, %1 \n\t" \ - "movl %%edi, %2 \n\t" \ - "movl %%esi, %3 \n\t" \ - : "=m" (t), "=m" (c), "=m" (d), "=m" (s) \ - : "m" (t), "m" (s), "m" (d), "m" (c), "m" (b) \ - : "eax", "ebx", "ecx", "edx", "esi", "edi" \ - ); - -#else - -#define MULADDC_STOP \ - "movl %4, %%ebx \n\t" \ - "movl %%ecx, %1 \n\t" \ - "movl %%edi, %2 \n\t" \ - "movl %%esi, %3 \n\t" \ - : "=m" (t), "=m" (c), "=m" (d), "=m" (s) \ - : "m" (t), "m" (s), "m" (d), "m" (c), "m" (b) \ - : "eax", "ebx", "ecx", "edx", "esi", "edi" \ - ); -#endif /* SSE2 */ -#endif /* i386 */ - -#if defined(__amd64__) || defined (__x86_64__) - -#define MULADDC_INIT \ - asm( \ - "xorq %%r8, %%r8 \n\t" - -#define MULADDC_CORE \ - "movq (%%rsi), %%rax \n\t" \ - "mulq %%rbx \n\t" \ - "addq $8, %%rsi \n\t" \ - "addq %%rcx, %%rax \n\t" \ - "movq %%r8, %%rcx \n\t" \ - "adcq $0, %%rdx \n\t" \ - "nop \n\t" \ - "addq %%rax, (%%rdi) \n\t" \ - "adcq %%rdx, %%rcx \n\t" \ - "addq $8, %%rdi \n\t" - -#define MULADDC_STOP \ - : "+c" (c), "+D" (d), "+S" (s) \ - : "b" (b) \ - : "rax", "rdx", "r8" \ - ); - -#endif /* AMD64 */ - -#if defined(__mc68020__) || defined(__mcpu32__) - -#define MULADDC_INIT \ - asm( \ - "movl %3, %%a2 \n\t" \ - "movl %4, %%a3 \n\t" \ - "movl %5, %%d3 \n\t" \ - "movl %6, %%d2 \n\t" \ - "moveq #0, %%d0 \n\t" - -#define MULADDC_CORE \ - "movel %%a2@+, %%d1 \n\t" \ - "mulul %%d2, %%d4:%%d1 \n\t" \ - "addl %%d3, %%d1 \n\t" \ - "addxl %%d0, %%d4 \n\t" \ - "moveq #0, %%d3 \n\t" \ - "addl %%d1, %%a3@+ \n\t" \ - "addxl %%d4, %%d3 \n\t" - -#define MULADDC_STOP \ - "movl %%d3, %0 \n\t" \ - "movl %%a3, %1 \n\t" \ - "movl %%a2, %2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "d0", "d1", "d2", "d3", "d4", "a2", "a3" \ - ); - -#define MULADDC_HUIT \ - "movel %%a2@+, %%d1 \n\t" \ - "mulul %%d2, %%d4:%%d1 \n\t" \ - "addxl %%d3, %%d1 \n\t" \ - "addxl %%d0, %%d4 \n\t" \ - "addl %%d1, %%a3@+ \n\t" \ - "movel %%a2@+, %%d1 \n\t" \ - "mulul %%d2, %%d3:%%d1 \n\t" \ - "addxl %%d4, %%d1 \n\t" \ - "addxl %%d0, %%d3 \n\t" \ - "addl %%d1, %%a3@+ \n\t" \ - "movel %%a2@+, %%d1 \n\t" \ - "mulul %%d2, %%d4:%%d1 \n\t" \ - "addxl %%d3, %%d1 \n\t" \ - "addxl %%d0, %%d4 \n\t" \ - "addl %%d1, %%a3@+ \n\t" \ - "movel %%a2@+, %%d1 \n\t" \ - "mulul %%d2, %%d3:%%d1 \n\t" \ - "addxl %%d4, %%d1 \n\t" \ - "addxl %%d0, %%d3 \n\t" \ - "addl %%d1, %%a3@+ \n\t" \ - "movel %%a2@+, %%d1 \n\t" \ - "mulul %%d2, %%d4:%%d1 \n\t" \ - "addxl %%d3, %%d1 \n\t" \ - "addxl %%d0, %%d4 \n\t" \ - "addl %%d1, %%a3@+ \n\t" \ - "movel %%a2@+, %%d1 \n\t" \ - "mulul %%d2, %%d3:%%d1 \n\t" \ - "addxl %%d4, %%d1 \n\t" \ - "addxl %%d0, %%d3 \n\t" \ - "addl %%d1, %%a3@+ \n\t" \ - "movel %%a2@+, %%d1 \n\t" \ - "mulul %%d2, %%d4:%%d1 \n\t" \ - "addxl %%d3, %%d1 \n\t" \ - "addxl %%d0, %%d4 \n\t" \ - "addl %%d1, %%a3@+ \n\t" \ - "movel %%a2@+, %%d1 \n\t" \ - "mulul %%d2, %%d3:%%d1 \n\t" \ - "addxl %%d4, %%d1 \n\t" \ - "addxl %%d0, %%d3 \n\t" \ - "addl %%d1, %%a3@+ \n\t" \ - "addxl %%d0, %%d3 \n\t" - -#endif /* MC68000 */ - -#if defined(__powerpc64__) || defined(__ppc64__) - -#if defined(__MACH__) && defined(__APPLE__) - -#define MULADDC_INIT \ - asm( \ - "ld r3, %3 \n\t" \ - "ld r4, %4 \n\t" \ - "ld r5, %5 \n\t" \ - "ld r6, %6 \n\t" \ - "addi r3, r3, -8 \n\t" \ - "addi r4, r4, -8 \n\t" \ - "addic r5, r5, 0 \n\t" - -#define MULADDC_CORE \ - "ldu r7, 8(r3) \n\t" \ - "mulld r8, r7, r6 \n\t" \ - "mulhdu r9, r7, r6 \n\t" \ - "adde r8, r8, r5 \n\t" \ - "ld r7, 8(r4) \n\t" \ - "addze r5, r9 \n\t" \ - "addc r8, r8, r7 \n\t" \ - "stdu r8, 8(r4) \n\t" - -#define MULADDC_STOP \ - "addze r5, r5 \n\t" \ - "addi r4, r4, 8 \n\t" \ - "addi r3, r3, 8 \n\t" \ - "std r5, %0 \n\t" \ - "std r4, %1 \n\t" \ - "std r3, %2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "r3", "r4", "r5", "r6", "r7", "r8", "r9" \ - ); - - -#else /* __MACH__ && __APPLE__ */ - -#define MULADDC_INIT \ - asm( \ - "ld %%r3, %3 \n\t" \ - "ld %%r4, %4 \n\t" \ - "ld %%r5, %5 \n\t" \ - "ld %%r6, %6 \n\t" \ - "addi %%r3, %%r3, -8 \n\t" \ - "addi %%r4, %%r4, -8 \n\t" \ - "addic %%r5, %%r5, 0 \n\t" - -#define MULADDC_CORE \ - "ldu %%r7, 8(%%r3) \n\t" \ - "mulld %%r8, %%r7, %%r6 \n\t" \ - "mulhdu %%r9, %%r7, %%r6 \n\t" \ - "adde %%r8, %%r8, %%r5 \n\t" \ - "ld %%r7, 8(%%r4) \n\t" \ - "addze %%r5, %%r9 \n\t" \ - "addc %%r8, %%r8, %%r7 \n\t" \ - "stdu %%r8, 8(%%r4) \n\t" - -#define MULADDC_STOP \ - "addze %%r5, %%r5 \n\t" \ - "addi %%r4, %%r4, 8 \n\t" \ - "addi %%r3, %%r3, 8 \n\t" \ - "std %%r5, %0 \n\t" \ - "std %%r4, %1 \n\t" \ - "std %%r3, %2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "r3", "r4", "r5", "r6", "r7", "r8", "r9" \ - ); - -#endif /* __MACH__ && __APPLE__ */ - -#elif defined(__powerpc__) || defined(__ppc__) /* end PPC64/begin PPC32 */ - -#if defined(__MACH__) && defined(__APPLE__) - -#define MULADDC_INIT \ - asm( \ - "lwz r3, %3 \n\t" \ - "lwz r4, %4 \n\t" \ - "lwz r5, %5 \n\t" \ - "lwz r6, %6 \n\t" \ - "addi r3, r3, -4 \n\t" \ - "addi r4, r4, -4 \n\t" \ - "addic r5, r5, 0 \n\t" - -#define MULADDC_CORE \ - "lwzu r7, 4(r3) \n\t" \ - "mullw r8, r7, r6 \n\t" \ - "mulhwu r9, r7, r6 \n\t" \ - "adde r8, r8, r5 \n\t" \ - "lwz r7, 4(r4) \n\t" \ - "addze r5, r9 \n\t" \ - "addc r8, r8, r7 \n\t" \ - "stwu r8, 4(r4) \n\t" - -#define MULADDC_STOP \ - "addze r5, r5 \n\t" \ - "addi r4, r4, 4 \n\t" \ - "addi r3, r3, 4 \n\t" \ - "stw r5, %0 \n\t" \ - "stw r4, %1 \n\t" \ - "stw r3, %2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "r3", "r4", "r5", "r6", "r7", "r8", "r9" \ - ); - -#else /* __MACH__ && __APPLE__ */ - -#define MULADDC_INIT \ - asm( \ - "lwz %%r3, %3 \n\t" \ - "lwz %%r4, %4 \n\t" \ - "lwz %%r5, %5 \n\t" \ - "lwz %%r6, %6 \n\t" \ - "addi %%r3, %%r3, -4 \n\t" \ - "addi %%r4, %%r4, -4 \n\t" \ - "addic %%r5, %%r5, 0 \n\t" - -#define MULADDC_CORE \ - "lwzu %%r7, 4(%%r3) \n\t" \ - "mullw %%r8, %%r7, %%r6 \n\t" \ - "mulhwu %%r9, %%r7, %%r6 \n\t" \ - "adde %%r8, %%r8, %%r5 \n\t" \ - "lwz %%r7, 4(%%r4) \n\t" \ - "addze %%r5, %%r9 \n\t" \ - "addc %%r8, %%r8, %%r7 \n\t" \ - "stwu %%r8, 4(%%r4) \n\t" - -#define MULADDC_STOP \ - "addze %%r5, %%r5 \n\t" \ - "addi %%r4, %%r4, 4 \n\t" \ - "addi %%r3, %%r3, 4 \n\t" \ - "stw %%r5, %0 \n\t" \ - "stw %%r4, %1 \n\t" \ - "stw %%r3, %2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "r3", "r4", "r5", "r6", "r7", "r8", "r9" \ - ); - -#endif /* __MACH__ && __APPLE__ */ - -#endif /* PPC32 */ - -/* - * The Sparc(64) assembly is reported to be broken. - * Disable it for now, until we're able to fix it. - */ -#if 0 && defined(__sparc__) -#if defined(__sparc64__) - -#define MULADDC_INIT \ - asm( \ - "ldx %3, %%o0 \n\t" \ - "ldx %4, %%o1 \n\t" \ - "ld %5, %%o2 \n\t" \ - "ld %6, %%o3 \n\t" - -#define MULADDC_CORE \ - "ld [%%o0], %%o4 \n\t" \ - "inc 4, %%o0 \n\t" \ - "ld [%%o1], %%o5 \n\t" \ - "umul %%o3, %%o4, %%o4 \n\t" \ - "addcc %%o4, %%o2, %%o4 \n\t" \ - "rd %%y, %%g1 \n\t" \ - "addx %%g1, 0, %%g1 \n\t" \ - "addcc %%o4, %%o5, %%o4 \n\t" \ - "st %%o4, [%%o1] \n\t" \ - "addx %%g1, 0, %%o2 \n\t" \ - "inc 4, %%o1 \n\t" - - #define MULADDC_STOP \ - "st %%o2, %0 \n\t" \ - "stx %%o1, %1 \n\t" \ - "stx %%o0, %2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "g1", "o0", "o1", "o2", "o3", "o4", \ - "o5" \ - ); - -#else /* __sparc64__ */ - -#define MULADDC_INIT \ - asm( \ - "ld %3, %%o0 \n\t" \ - "ld %4, %%o1 \n\t" \ - "ld %5, %%o2 \n\t" \ - "ld %6, %%o3 \n\t" - -#define MULADDC_CORE \ - "ld [%%o0], %%o4 \n\t" \ - "inc 4, %%o0 \n\t" \ - "ld [%%o1], %%o5 \n\t" \ - "umul %%o3, %%o4, %%o4 \n\t" \ - "addcc %%o4, %%o2, %%o4 \n\t" \ - "rd %%y, %%g1 \n\t" \ - "addx %%g1, 0, %%g1 \n\t" \ - "addcc %%o4, %%o5, %%o4 \n\t" \ - "st %%o4, [%%o1] \n\t" \ - "addx %%g1, 0, %%o2 \n\t" \ - "inc 4, %%o1 \n\t" - -#define MULADDC_STOP \ - "st %%o2, %0 \n\t" \ - "st %%o1, %1 \n\t" \ - "st %%o0, %2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "g1", "o0", "o1", "o2", "o3", "o4", \ - "o5" \ - ); - -#endif /* __sparc64__ */ -#endif /* __sparc__ */ - -#if defined(__microblaze__) || defined(microblaze) - -#define MULADDC_INIT \ - asm( \ - "lwi r3, %3 \n\t" \ - "lwi r4, %4 \n\t" \ - "lwi r5, %5 \n\t" \ - "lwi r6, %6 \n\t" \ - "andi r7, r6, 0xffff \n\t" \ - "bsrli r6, r6, 16 \n\t" - -#define MULADDC_CORE \ - "lhui r8, r3, 0 \n\t" \ - "addi r3, r3, 2 \n\t" \ - "lhui r9, r3, 0 \n\t" \ - "addi r3, r3, 2 \n\t" \ - "mul r10, r9, r6 \n\t" \ - "mul r11, r8, r7 \n\t" \ - "mul r12, r9, r7 \n\t" \ - "mul r13, r8, r6 \n\t" \ - "bsrli r8, r10, 16 \n\t" \ - "bsrli r9, r11, 16 \n\t" \ - "add r13, r13, r8 \n\t" \ - "add r13, r13, r9 \n\t" \ - "bslli r10, r10, 16 \n\t" \ - "bslli r11, r11, 16 \n\t" \ - "add r12, r12, r10 \n\t" \ - "addc r13, r13, r0 \n\t" \ - "add r12, r12, r11 \n\t" \ - "addc r13, r13, r0 \n\t" \ - "lwi r10, r4, 0 \n\t" \ - "add r12, r12, r10 \n\t" \ - "addc r13, r13, r0 \n\t" \ - "add r12, r12, r5 \n\t" \ - "addc r5, r13, r0 \n\t" \ - "swi r12, r4, 0 \n\t" \ - "addi r4, r4, 4 \n\t" - -#define MULADDC_STOP \ - "swi r5, %0 \n\t" \ - "swi r4, %1 \n\t" \ - "swi r3, %2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "r3", "r4", "r5", "r6", "r7", "r8", \ - "r9", "r10", "r11", "r12", "r13" \ - ); - -#endif /* MicroBlaze */ - -#if defined(__tricore__) - -#define MULADDC_INIT \ - asm( \ - "ld.a %%a2, %3 \n\t" \ - "ld.a %%a3, %4 \n\t" \ - "ld.w %%d4, %5 \n\t" \ - "ld.w %%d1, %6 \n\t" \ - "xor %%d5, %%d5 \n\t" - -#define MULADDC_CORE \ - "ld.w %%d0, [%%a2+] \n\t" \ - "madd.u %%e2, %%e4, %%d0, %%d1 \n\t" \ - "ld.w %%d0, [%%a3] \n\t" \ - "addx %%d2, %%d2, %%d0 \n\t" \ - "addc %%d3, %%d3, 0 \n\t" \ - "mov %%d4, %%d3 \n\t" \ - "st.w [%%a3+], %%d2 \n\t" - -#define MULADDC_STOP \ - "st.w %0, %%d4 \n\t" \ - "st.a %1, %%a3 \n\t" \ - "st.a %2, %%a2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "d0", "d1", "e2", "d4", "a2", "a3" \ - ); - -#endif /* TriCore */ - -/* - * gcc -O0 by default uses r7 for the frame pointer, so it complains about our - * use of r7 below, unless -fomit-frame-pointer is passed. Unfortunately, - * passing that option is not easy when building with yotta. - * - * On the other hand, -fomit-frame-pointer is implied by any -Ox options with - * x !=0, which we can detect using __OPTIMIZE__ (which is also defined by - * clang and armcc5 under the same conditions). - * - * So, only use the optimized assembly below for optimized build, which avoids - * the build error and is pretty reasonable anyway. - */ -#if defined(__GNUC__) && !defined(__OPTIMIZE__) -#define MULADDC_CANNOT_USE_R7 -#endif - -#if defined(__arm__) && !defined(MULADDC_CANNOT_USE_R7) - -#if defined(__thumb__) && !defined(__thumb2__) - -#define MULADDC_INIT \ - asm( \ - "ldr r0, %3 \n\t" \ - "ldr r1, %4 \n\t" \ - "ldr r2, %5 \n\t" \ - "ldr r3, %6 \n\t" \ - "lsr r7, r3, #16 \n\t" \ - "mov r9, r7 \n\t" \ - "lsl r7, r3, #16 \n\t" \ - "lsr r7, r7, #16 \n\t" \ - "mov r8, r7 \n\t" - -#define MULADDC_CORE \ - "ldmia r0!, {r6} \n\t" \ - "lsr r7, r6, #16 \n\t" \ - "lsl r6, r6, #16 \n\t" \ - "lsr r6, r6, #16 \n\t" \ - "mov r4, r8 \n\t" \ - "mul r4, r6 \n\t" \ - "mov r3, r9 \n\t" \ - "mul r6, r3 \n\t" \ - "mov r5, r9 \n\t" \ - "mul r5, r7 \n\t" \ - "mov r3, r8 \n\t" \ - "mul r7, r3 \n\t" \ - "lsr r3, r6, #16 \n\t" \ - "add r5, r5, r3 \n\t" \ - "lsr r3, r7, #16 \n\t" \ - "add r5, r5, r3 \n\t" \ - "add r4, r4, r2 \n\t" \ - "mov r2, #0 \n\t" \ - "adc r5, r2 \n\t" \ - "lsl r3, r6, #16 \n\t" \ - "add r4, r4, r3 \n\t" \ - "adc r5, r2 \n\t" \ - "lsl r3, r7, #16 \n\t" \ - "add r4, r4, r3 \n\t" \ - "adc r5, r2 \n\t" \ - "ldr r3, [r1] \n\t" \ - "add r4, r4, r3 \n\t" \ - "adc r2, r5 \n\t" \ - "stmia r1!, {r4} \n\t" - -#define MULADDC_STOP \ - "str r2, %0 \n\t" \ - "str r1, %1 \n\t" \ - "str r0, %2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "r0", "r1", "r2", "r3", "r4", "r5", \ - "r6", "r7", "r8", "r9", "cc" \ - ); - -#else - -#define MULADDC_INIT \ - asm( \ - "ldr r0, %3 \n\t" \ - "ldr r1, %4 \n\t" \ - "ldr r2, %5 \n\t" \ - "ldr r3, %6 \n\t" - -#define MULADDC_CORE \ - "ldr r4, [r0], #4 \n\t" \ - "mov r5, #0 \n\t" \ - "ldr r6, [r1] \n\t" \ - "umlal r2, r5, r3, r4 \n\t" \ - "adds r7, r6, r2 \n\t" \ - "adc r2, r5, #0 \n\t" \ - "str r7, [r1], #4 \n\t" - -#define MULADDC_STOP \ - "str r2, %0 \n\t" \ - "str r1, %1 \n\t" \ - "str r0, %2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "r0", "r1", "r2", "r3", "r4", "r5", \ - "r6", "r7", "cc" \ - ); - -#endif /* Thumb */ - -#endif /* ARMv3 */ - -#if defined(__alpha__) - -#define MULADDC_INIT \ - asm( \ - "ldq $1, %3 \n\t" \ - "ldq $2, %4 \n\t" \ - "ldq $3, %5 \n\t" \ - "ldq $4, %6 \n\t" - -#define MULADDC_CORE \ - "ldq $6, 0($1) \n\t" \ - "addq $1, 8, $1 \n\t" \ - "mulq $6, $4, $7 \n\t" \ - "umulh $6, $4, $6 \n\t" \ - "addq $7, $3, $7 \n\t" \ - "cmpult $7, $3, $3 \n\t" \ - "ldq $5, 0($2) \n\t" \ - "addq $7, $5, $7 \n\t" \ - "cmpult $7, $5, $5 \n\t" \ - "stq $7, 0($2) \n\t" \ - "addq $2, 8, $2 \n\t" \ - "addq $6, $3, $3 \n\t" \ - "addq $5, $3, $3 \n\t" - -#define MULADDC_STOP \ - "stq $3, %0 \n\t" \ - "stq $2, %1 \n\t" \ - "stq $1, %2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "$1", "$2", "$3", "$4", "$5", "$6", "$7" \ - ); -#endif /* Alpha */ - -#if defined(__mips__) && !defined(__mips64) - -#define MULADDC_INIT \ - asm( \ - "lw $10, %3 \n\t" \ - "lw $11, %4 \n\t" \ - "lw $12, %5 \n\t" \ - "lw $13, %6 \n\t" - -#define MULADDC_CORE \ - "lw $14, 0($10) \n\t" \ - "multu $13, $14 \n\t" \ - "addi $10, $10, 4 \n\t" \ - "mflo $14 \n\t" \ - "mfhi $9 \n\t" \ - "addu $14, $12, $14 \n\t" \ - "lw $15, 0($11) \n\t" \ - "sltu $12, $14, $12 \n\t" \ - "addu $15, $14, $15 \n\t" \ - "sltu $14, $15, $14 \n\t" \ - "addu $12, $12, $9 \n\t" \ - "sw $15, 0($11) \n\t" \ - "addu $12, $12, $14 \n\t" \ - "addi $11, $11, 4 \n\t" - -#define MULADDC_STOP \ - "sw $12, %0 \n\t" \ - "sw $11, %1 \n\t" \ - "sw $10, %2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "$9", "$10", "$11", "$12", "$13", "$14", "$15" \ - ); - -#endif /* MIPS */ -#endif /* GNUC */ - -#if (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__) - -#define MULADDC_INIT \ - __asm mov esi, s \ - __asm mov edi, d \ - __asm mov ecx, c \ - __asm mov ebx, b - -#define MULADDC_CORE \ - __asm lodsd \ - __asm mul ebx \ - __asm add eax, ecx \ - __asm adc edx, 0 \ - __asm add eax, [edi] \ - __asm adc edx, 0 \ - __asm mov ecx, edx \ - __asm stosd - -#if defined(MBEDTLS_HAVE_SSE2) - -#define EMIT __asm _emit - -#define MULADDC_HUIT \ - EMIT 0x0F EMIT 0x6E EMIT 0xC9 \ - EMIT 0x0F EMIT 0x6E EMIT 0xC3 \ - EMIT 0x0F EMIT 0x6E EMIT 0x1F \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCB \ - EMIT 0x0F EMIT 0x6E EMIT 0x16 \ - EMIT 0x0F EMIT 0xF4 EMIT 0xD0 \ - EMIT 0x0F EMIT 0x6E EMIT 0x66 EMIT 0x04 \ - EMIT 0x0F EMIT 0xF4 EMIT 0xE0 \ - EMIT 0x0F EMIT 0x6E EMIT 0x76 EMIT 0x08 \ - EMIT 0x0F EMIT 0xF4 EMIT 0xF0 \ - EMIT 0x0F EMIT 0x6E EMIT 0x7E EMIT 0x0C \ - EMIT 0x0F EMIT 0xF4 EMIT 0xF8 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCA \ - EMIT 0x0F EMIT 0x6E EMIT 0x5F EMIT 0x04 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xDC \ - EMIT 0x0F EMIT 0x6E EMIT 0x6F EMIT 0x08 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xEE \ - EMIT 0x0F EMIT 0x6E EMIT 0x67 EMIT 0x0C \ - EMIT 0x0F EMIT 0xD4 EMIT 0xFC \ - EMIT 0x0F EMIT 0x7E EMIT 0x0F \ - EMIT 0x0F EMIT 0x6E EMIT 0x56 EMIT 0x10 \ - EMIT 0x0F EMIT 0xF4 EMIT 0xD0 \ - EMIT 0x0F EMIT 0x73 EMIT 0xD1 EMIT 0x20 \ - EMIT 0x0F EMIT 0x6E EMIT 0x66 EMIT 0x14 \ - EMIT 0x0F EMIT 0xF4 EMIT 0xE0 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCB \ - EMIT 0x0F EMIT 0x6E EMIT 0x76 EMIT 0x18 \ - EMIT 0x0F EMIT 0xF4 EMIT 0xF0 \ - EMIT 0x0F EMIT 0x7E EMIT 0x4F EMIT 0x04 \ - EMIT 0x0F EMIT 0x73 EMIT 0xD1 EMIT 0x20 \ - EMIT 0x0F EMIT 0x6E EMIT 0x5E EMIT 0x1C \ - EMIT 0x0F EMIT 0xF4 EMIT 0xD8 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCD \ - EMIT 0x0F EMIT 0x6E EMIT 0x6F EMIT 0x10 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xD5 \ - EMIT 0x0F EMIT 0x7E EMIT 0x4F EMIT 0x08 \ - EMIT 0x0F EMIT 0x73 EMIT 0xD1 EMIT 0x20 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCF \ - EMIT 0x0F EMIT 0x6E EMIT 0x6F EMIT 0x14 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xE5 \ - EMIT 0x0F EMIT 0x7E EMIT 0x4F EMIT 0x0C \ - EMIT 0x0F EMIT 0x73 EMIT 0xD1 EMIT 0x20 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCA \ - EMIT 0x0F EMIT 0x6E EMIT 0x6F EMIT 0x18 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xF5 \ - EMIT 0x0F EMIT 0x7E EMIT 0x4F EMIT 0x10 \ - EMIT 0x0F EMIT 0x73 EMIT 0xD1 EMIT 0x20 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCC \ - EMIT 0x0F EMIT 0x6E EMIT 0x6F EMIT 0x1C \ - EMIT 0x0F EMIT 0xD4 EMIT 0xDD \ - EMIT 0x0F EMIT 0x7E EMIT 0x4F EMIT 0x14 \ - EMIT 0x0F EMIT 0x73 EMIT 0xD1 EMIT 0x20 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCE \ - EMIT 0x0F EMIT 0x7E EMIT 0x4F EMIT 0x18 \ - EMIT 0x0F EMIT 0x73 EMIT 0xD1 EMIT 0x20 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCB \ - EMIT 0x0F EMIT 0x7E EMIT 0x4F EMIT 0x1C \ - EMIT 0x83 EMIT 0xC7 EMIT 0x20 \ - EMIT 0x83 EMIT 0xC6 EMIT 0x20 \ - EMIT 0x0F EMIT 0x73 EMIT 0xD1 EMIT 0x20 \ - EMIT 0x0F EMIT 0x7E EMIT 0xC9 - -#define MULADDC_STOP \ - EMIT 0x0F EMIT 0x77 \ - __asm mov c, ecx \ - __asm mov d, edi \ - __asm mov s, esi \ - -#else - -#define MULADDC_STOP \ - __asm mov c, ecx \ - __asm mov d, edi \ - __asm mov s, esi \ - -#endif /* SSE2 */ -#endif /* MSVC */ - -#endif /* MBEDTLS_HAVE_ASM */ - -#if !defined(MULADDC_CORE) -#if defined(MBEDTLS_HAVE_UDBL) - -#define MULADDC_INIT \ -{ \ - mbedtls_t_udbl r; \ - mbedtls_mpi_uint r0, r1; - -#define MULADDC_CORE \ - r = *(s++) * (mbedtls_t_udbl) b; \ - r0 = (mbedtls_mpi_uint) r; \ - r1 = (mbedtls_mpi_uint)( r >> biL ); \ - r0 += c; r1 += (r0 < c); \ - r0 += *d; r1 += (r0 < *d); \ - c = r1; *(d++) = r0; - -#define MULADDC_STOP \ -} - -#else -#define MULADDC_INIT \ -{ \ - mbedtls_mpi_uint s0, s1, b0, b1; \ - mbedtls_mpi_uint r0, r1, rx, ry; \ - b0 = ( b << biH ) >> biH; \ - b1 = ( b >> biH ); - -#define MULADDC_CORE \ - s0 = ( *s << biH ) >> biH; \ - s1 = ( *s >> biH ); s++; \ - rx = s0 * b1; r0 = s0 * b0; \ - ry = s1 * b0; r1 = s1 * b1; \ - r1 += ( rx >> biH ); \ - r1 += ( ry >> biH ); \ - rx <<= biH; ry <<= biH; \ - r0 += rx; r1 += (r0 < rx); \ - r0 += ry; r1 += (r0 < ry); \ - r0 += c; r1 += (r0 < c); \ - r0 += *d; r1 += (r0 < *d); \ - c = r1; *(d++) = r0; - -#define MULADDC_STOP \ -} - -#endif /* C (generic) */ -#endif /* C (longlong) */ - -#endif /* bn_mul.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/camellia.h b/tools/sdk/include/mbedtls/mbedtls/camellia.h deleted file mode 100644 index fa1e05ee7fb..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/camellia.h +++ /dev/null @@ -1,271 +0,0 @@ -/** - * \file camellia.h - * - * \brief Camellia block cipher - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_CAMELLIA_H -#define MBEDTLS_CAMELLIA_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -#define MBEDTLS_CAMELLIA_ENCRYPT 1 -#define MBEDTLS_CAMELLIA_DECRYPT 0 - -#define MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH -0x0024 /**< Invalid key length. */ -#define MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH -0x0026 /**< Invalid data input length. */ -#define MBEDTLS_ERR_CAMELLIA_HW_ACCEL_FAILED -0x0027 /**< Camellia hardware accelerator failed. */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_CAMELLIA_ALT) -// Regular implementation -// - -/** - * \brief CAMELLIA context structure - */ -typedef struct mbedtls_camellia_context -{ - int nr; /*!< number of rounds */ - uint32_t rk[68]; /*!< CAMELLIA round keys */ -} -mbedtls_camellia_context; - -#else /* MBEDTLS_CAMELLIA_ALT */ -#include "camellia_alt.h" -#endif /* MBEDTLS_CAMELLIA_ALT */ - -/** - * \brief Initialize CAMELLIA context - * - * \param ctx CAMELLIA context to be initialized - */ -void mbedtls_camellia_init( mbedtls_camellia_context *ctx ); - -/** - * \brief Clear CAMELLIA context - * - * \param ctx CAMELLIA context to be cleared - */ -void mbedtls_camellia_free( mbedtls_camellia_context *ctx ); - -/** - * \brief CAMELLIA key schedule (encryption) - * - * \param ctx CAMELLIA context to be initialized - * \param key encryption key - * \param keybits must be 128, 192 or 256 - * - * \return 0 if successful, or MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH - */ -int mbedtls_camellia_setkey_enc( mbedtls_camellia_context *ctx, const unsigned char *key, - unsigned int keybits ); - -/** - * \brief CAMELLIA key schedule (decryption) - * - * \param ctx CAMELLIA context to be initialized - * \param key decryption key - * \param keybits must be 128, 192 or 256 - * - * \return 0 if successful, or MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH - */ -int mbedtls_camellia_setkey_dec( mbedtls_camellia_context *ctx, const unsigned char *key, - unsigned int keybits ); - -/** - * \brief CAMELLIA-ECB block encryption/decryption - * - * \param ctx CAMELLIA context - * \param mode MBEDTLS_CAMELLIA_ENCRYPT or MBEDTLS_CAMELLIA_DECRYPT - * \param input 16-byte input block - * \param output 16-byte output block - * - * \return 0 if successful - */ -int mbedtls_camellia_crypt_ecb( mbedtls_camellia_context *ctx, - int mode, - const unsigned char input[16], - unsigned char output[16] ); - -#if defined(MBEDTLS_CIPHER_MODE_CBC) -/** - * \brief CAMELLIA-CBC buffer encryption/decryption - * Length should be a multiple of the block - * size (16 bytes) - * - * \note Upon exit, the content of the IV is updated so that you can - * call the function same function again on the following - * block(s) of data and get the same result as if it was - * encrypted in one call. This allows a "streaming" usage. - * If on the other hand you need to retain the contents of the - * IV, you should either save it manually or use the cipher - * module instead. - * - * \param ctx CAMELLIA context - * \param mode MBEDTLS_CAMELLIA_ENCRYPT or MBEDTLS_CAMELLIA_DECRYPT - * \param length length of the input data - * \param iv initialization vector (updated after use) - * \param input buffer holding the input data - * \param output buffer holding the output data - * - * \return 0 if successful, or - * MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH - */ -int mbedtls_camellia_crypt_cbc( mbedtls_camellia_context *ctx, - int mode, - size_t length, - unsigned char iv[16], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_CBC */ - -#if defined(MBEDTLS_CIPHER_MODE_CFB) -/** - * \brief CAMELLIA-CFB128 buffer encryption/decryption - * - * Note: Due to the nature of CFB you should use the same key schedule for - * both encryption and decryption. So a context initialized with - * mbedtls_camellia_setkey_enc() for both MBEDTLS_CAMELLIA_ENCRYPT and CAMELLIE_DECRYPT. - * - * \note Upon exit, the content of the IV is updated so that you can - * call the function same function again on the following - * block(s) of data and get the same result as if it was - * encrypted in one call. This allows a "streaming" usage. - * If on the other hand you need to retain the contents of the - * IV, you should either save it manually or use the cipher - * module instead. - * - * \param ctx CAMELLIA context - * \param mode MBEDTLS_CAMELLIA_ENCRYPT or MBEDTLS_CAMELLIA_DECRYPT - * \param length length of the input data - * \param iv_off offset in IV (updated after use) - * \param iv initialization vector (updated after use) - * \param input buffer holding the input data - * \param output buffer holding the output data - * - * \return 0 if successful, or - * MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH - */ -int mbedtls_camellia_crypt_cfb128( mbedtls_camellia_context *ctx, - int mode, - size_t length, - size_t *iv_off, - unsigned char iv[16], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_CFB */ - -#if defined(MBEDTLS_CIPHER_MODE_CTR) -/** - * \brief CAMELLIA-CTR buffer encryption/decryption - * - * Note: Due to the nature of CTR you should use the same key schedule for - * both encryption and decryption. So a context initialized with - * mbedtls_camellia_setkey_enc() for both MBEDTLS_CAMELLIA_ENCRYPT and MBEDTLS_CAMELLIA_DECRYPT. - * - * \warning You must never reuse a nonce value with the same key. Doing so - * would void the encryption for the two messages encrypted with - * the same nonce and key. - * - * There are two common strategies for managing nonces with CTR: - * - * 1. You can handle everything as a single message processed over - * successive calls to this function. In that case, you want to - * set \p nonce_counter and \p nc_off to 0 for the first call, and - * then preserve the values of \p nonce_counter, \p nc_off and \p - * stream_block across calls to this function as they will be - * updated by this function. - * - * With this strategy, you must not encrypt more than 2**128 - * blocks of data with the same key. - * - * 2. You can encrypt separate messages by dividing the \p - * nonce_counter buffer in two areas: the first one used for a - * per-message nonce, handled by yourself, and the second one - * updated by this function internally. - * - * For example, you might reserve the first 12 bytes for the - * per-message nonce, and the last 4 bytes for internal use. In that - * case, before calling this function on a new message you need to - * set the first 12 bytes of \p nonce_counter to your chosen nonce - * value, the last 4 to 0, and \p nc_off to 0 (which will cause \p - * stream_block to be ignored). That way, you can encrypt at most - * 2**96 messages of up to 2**32 blocks each with the same key. - * - * The per-message nonce (or information sufficient to reconstruct - * it) needs to be communicated with the ciphertext and must be unique. - * The recommended way to ensure uniqueness is to use a message - * counter. An alternative is to generate random nonces, but this - * limits the number of messages that can be securely encrypted: - * for example, with 96-bit random nonces, you should not encrypt - * more than 2**32 messages with the same key. - * - * Note that for both stategies, sizes are measured in blocks and - * that a CAMELLIA block is 16 bytes. - * - * \warning Upon return, \p stream_block contains sensitive data. Its - * content must not be written to insecure storage and should be - * securely discarded as soon as it's no longer needed. - * - * \param ctx CAMELLIA context - * \param length The length of the data - * \param nc_off The offset in the current stream_block (for resuming - * within current cipher stream). The offset pointer to - * should be 0 at the start of a stream. - * \param nonce_counter The 128-bit nonce and counter. - * \param stream_block The saved stream-block for resuming. Is overwritten - * by the function. - * \param input The input data stream - * \param output The output data stream - * - * \return 0 if successful - */ -int mbedtls_camellia_crypt_ctr( mbedtls_camellia_context *ctx, - size_t length, - size_t *nc_off, - unsigned char nonce_counter[16], - unsigned char stream_block[16], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_CTR */ - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - */ -int mbedtls_camellia_self_test( int verbose ); - -#ifdef __cplusplus -} -#endif - -#endif /* camellia.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/ccm.h b/tools/sdk/include/mbedtls/mbedtls/ccm.h deleted file mode 100644 index e1dc124b89f..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/ccm.h +++ /dev/null @@ -1,272 +0,0 @@ -/** - * \file ccm.h - * - * \brief This file provides an API for the CCM authenticated encryption - * mode for block ciphers. - * - * CCM combines Counter mode encryption with CBC-MAC authentication - * for 128-bit block ciphers. - * - * Input to CCM includes the following elements: - *
  • Payload - data that is both authenticated and encrypted.
  • - *
  • Associated data (Adata) - data that is authenticated but not - * encrypted, For example, a header.
  • - *
  • Nonce - A unique value that is assigned to the payload and the - * associated data.
- * - * Definition of CCM: - * http://csrc.nist.gov/publications/nistpubs/800-38C/SP800-38C_updated-July20_2007.pdf - * RFC 3610 "Counter with CBC-MAC (CCM)" - * - * Related: - * RFC 5116 "An Interface and Algorithms for Authenticated Encryption" - * - * Definition of CCM*: - * IEEE 802.15.4 - IEEE Standard for Local and metropolitan area networks - * Integer representation is fixed most-significant-octet-first order and - * the representation of octets is most-significant-bit-first order. This is - * consistent with RFC 3610. - */ -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_CCM_H -#define MBEDTLS_CCM_H - -#include "cipher.h" - -#define MBEDTLS_ERR_CCM_BAD_INPUT -0x000D /**< Bad input parameters to the function. */ -#define MBEDTLS_ERR_CCM_AUTH_FAILED -0x000F /**< Authenticated decryption failed. */ -#define MBEDTLS_ERR_CCM_HW_ACCEL_FAILED -0x0011 /**< CCM hardware accelerator failed. */ - - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_CCM_ALT) -// Regular implementation -// - -/** - * \brief The CCM context-type definition. The CCM context is passed - * to the APIs called. - */ -typedef struct mbedtls_ccm_context -{ - mbedtls_cipher_context_t cipher_ctx; /*!< The cipher context used. */ -} -mbedtls_ccm_context; - -#else /* MBEDTLS_CCM_ALT */ -#include "ccm_alt.h" -#endif /* MBEDTLS_CCM_ALT */ - -/** - * \brief This function initializes the specified CCM context, - * to make references valid, and prepare the context - * for mbedtls_ccm_setkey() or mbedtls_ccm_free(). - * - * \param ctx The CCM context to initialize. - */ -void mbedtls_ccm_init( mbedtls_ccm_context *ctx ); - -/** - * \brief This function initializes the CCM context set in the - * \p ctx parameter and sets the encryption key. - * - * \param ctx The CCM context to initialize. - * \param cipher The 128-bit block cipher to use. - * \param key The encryption key. - * \param keybits The key size in bits. This must be acceptable by the cipher. - * - * \return \c 0 on success. - * \return A CCM or cipher-specific error code on failure. - */ -int mbedtls_ccm_setkey( mbedtls_ccm_context *ctx, - mbedtls_cipher_id_t cipher, - const unsigned char *key, - unsigned int keybits ); - -/** - * \brief This function releases and clears the specified CCM context - * and underlying cipher sub-context. - * - * \param ctx The CCM context to clear. - */ -void mbedtls_ccm_free( mbedtls_ccm_context *ctx ); - -/** - * \brief This function encrypts a buffer using CCM. - * - * \note The tag is written to a separate buffer. To concatenate - * the \p tag with the \p output, as done in RFC-3610: - * Counter with CBC-MAC (CCM), use - * \p tag = \p output + \p length, and make sure that the - * output buffer is at least \p length + \p tag_len wide. - * - * \param ctx The CCM context to use for encryption. - * \param length The length of the input data in Bytes. - * \param iv Initialization vector (nonce). - * \param iv_len The length of the nonce in Bytes: 7, 8, 9, 10, 11, 12, - * or 13. The length L of the message length field is - * 15 - \p iv_len. - * \param add The additional data field. - * \param add_len The length of additional data in Bytes. - * Must be less than 2^16 - 2^8. - * \param input The buffer holding the input data. - * \param output The buffer holding the output data. - * Must be at least \p length Bytes wide. - * \param tag The buffer holding the authentication field. - * \param tag_len The length of the authentication field to generate in Bytes: - * 4, 6, 8, 10, 12, 14 or 16. - * - * \return \c 0 on success. - * \return A CCM or cipher-specific error code on failure. - */ -int mbedtls_ccm_encrypt_and_tag( mbedtls_ccm_context *ctx, size_t length, - const unsigned char *iv, size_t iv_len, - const unsigned char *add, size_t add_len, - const unsigned char *input, unsigned char *output, - unsigned char *tag, size_t tag_len ); - -/** - * \brief This function encrypts a buffer using CCM*. - * - * \note The tag is written to a separate buffer. To concatenate - * the \p tag with the \p output, as done in RFC-3610: - * Counter with CBC-MAC (CCM), use - * \p tag = \p output + \p length, and make sure that the - * output buffer is at least \p length + \p tag_len wide. - * - * \note When using this function in a variable tag length context, - * the tag length has to be encoded into the \p iv passed to - * this function. - * - * \param ctx The CCM context to use for encryption. - * \param length The length of the input data in Bytes. - * \param iv Initialization vector (nonce). - * \param iv_len The length of the nonce in Bytes: 7, 8, 9, 10, 11, 12, - * or 13. The length L of the message length field is - * 15 - \p iv_len. - * \param add The additional data field. - * \param add_len The length of additional data in Bytes. - * Must be less than 2^16 - 2^8. - * \param input The buffer holding the input data. - * \param output The buffer holding the output data. - * Must be at least \p length Bytes wide. - * \param tag The buffer holding the authentication field. - * \param tag_len The length of the authentication field to generate in Bytes: - * 0, 4, 6, 8, 10, 12, 14 or 16. - * - * \warning Passing 0 as \p tag_len means that the message is no - * longer authenticated. - * - * \return \c 0 on success. - * \return A CCM or cipher-specific error code on failure. - */ -int mbedtls_ccm_star_encrypt_and_tag( mbedtls_ccm_context *ctx, size_t length, - const unsigned char *iv, size_t iv_len, - const unsigned char *add, size_t add_len, - const unsigned char *input, unsigned char *output, - unsigned char *tag, size_t tag_len ); - -/** - * \brief This function performs a CCM authenticated decryption of a - * buffer. - * - * \param ctx The CCM context to use for decryption. - * \param length The length of the input data in Bytes. - * \param iv Initialization vector (nonce). - * \param iv_len The length of the nonce in Bytes: 7, 8, 9, 10, 11, 12, - * or 13. The length L of the message length field is - * 15 - \p iv_len. - * \param add The additional data field. - * \param add_len The length of additional data in Bytes. - * Must be less than 2^16 - 2^8. - * \param input The buffer holding the input data. - * \param output The buffer holding the output data. - * Must be at least \p length Bytes wide. - * \param tag The buffer holding the authentication field. - * \param tag_len The length of the authentication field in Bytes. - * 4, 6, 8, 10, 12, 14 or 16. - * - * \return \c 0 on success. This indicates that the message is authentic. - * \return #MBEDTLS_ERR_CCM_AUTH_FAILED if the tag does not match. - * \return A cipher-specific error code on calculation failure. - */ -int mbedtls_ccm_auth_decrypt( mbedtls_ccm_context *ctx, size_t length, - const unsigned char *iv, size_t iv_len, - const unsigned char *add, size_t add_len, - const unsigned char *input, unsigned char *output, - const unsigned char *tag, size_t tag_len ); - -/** - * \brief This function performs a CCM* authenticated decryption of a - * buffer. - * - * \note When using this function in a variable tag length context, - * the tag length has to be decoded from \p iv and passed to - * this function as \p tag_len. (\p tag needs to be adjusted - * accordingly.) - * - * \param ctx The CCM context to use for decryption. - * \param length The length of the input data in Bytes. - * \param iv Initialization vector (nonce). - * \param iv_len The length of the nonce in Bytes: 7, 8, 9, 10, 11, 12, - * or 13. The length L of the message length field is - * 15 - \p iv_len. - * \param add The additional data field. - * \param add_len The length of additional data in Bytes. - * Must be less than 2^16 - 2^8. - * \param input The buffer holding the input data. - * \param output The buffer holding the output data. - * Must be at least \p length Bytes wide. - * \param tag The buffer holding the authentication field. - * \param tag_len The length of the authentication field in Bytes. - * 0, 4, 6, 8, 10, 12, 14 or 16. - * - * \warning Passing 0 as \p tag_len means that the message is no - * longer authenticated. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CCM_AUTH_FAILED if the tag does not match. - * \return A cipher-specific error code on calculation failure. - */ -int mbedtls_ccm_star_auth_decrypt( mbedtls_ccm_context *ctx, size_t length, - const unsigned char *iv, size_t iv_len, - const unsigned char *add, size_t add_len, - const unsigned char *input, unsigned char *output, - const unsigned char *tag, size_t tag_len ); - -#if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_AES_C) -/** - * \brief The CCM checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_ccm_self_test( int verbose ); -#endif /* MBEDTLS_SELF_TEST && MBEDTLS_AES_C */ - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_CCM_H */ diff --git a/tools/sdk/include/mbedtls/mbedtls/certs.h b/tools/sdk/include/mbedtls/mbedtls/certs.h deleted file mode 100644 index 8dab7b5ce8c..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/certs.h +++ /dev/null @@ -1,100 +0,0 @@ -/** - * \file certs.h - * - * \brief Sample certificates and DHM parameters for testing - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_CERTS_H -#define MBEDTLS_CERTS_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(MBEDTLS_PEM_PARSE_C) -/* Concatenation of all CA certificates in PEM format if available */ -extern const char mbedtls_test_cas_pem[]; -extern const size_t mbedtls_test_cas_pem_len; -#endif - -/* List of all CA certificates, terminated by NULL */ -extern const char * mbedtls_test_cas[]; -extern const size_t mbedtls_test_cas_len[]; - -/* - * Convenience for users who just want a certificate: - * RSA by default, or ECDSA if RSA is not available - */ -extern const char * mbedtls_test_ca_crt; -extern const size_t mbedtls_test_ca_crt_len; -extern const char * mbedtls_test_ca_key; -extern const size_t mbedtls_test_ca_key_len; -extern const char * mbedtls_test_ca_pwd; -extern const size_t mbedtls_test_ca_pwd_len; -extern const char * mbedtls_test_srv_crt; -extern const size_t mbedtls_test_srv_crt_len; -extern const char * mbedtls_test_srv_key; -extern const size_t mbedtls_test_srv_key_len; -extern const char * mbedtls_test_cli_crt; -extern const size_t mbedtls_test_cli_crt_len; -extern const char * mbedtls_test_cli_key; -extern const size_t mbedtls_test_cli_key_len; - -#if defined(MBEDTLS_ECDSA_C) -extern const char mbedtls_test_ca_crt_ec[]; -extern const size_t mbedtls_test_ca_crt_ec_len; -extern const char mbedtls_test_ca_key_ec[]; -extern const size_t mbedtls_test_ca_key_ec_len; -extern const char mbedtls_test_ca_pwd_ec[]; -extern const size_t mbedtls_test_ca_pwd_ec_len; -extern const char mbedtls_test_srv_crt_ec[]; -extern const size_t mbedtls_test_srv_crt_ec_len; -extern const char mbedtls_test_srv_key_ec[]; -extern const size_t mbedtls_test_srv_key_ec_len; -extern const char mbedtls_test_cli_crt_ec[]; -extern const size_t mbedtls_test_cli_crt_ec_len; -extern const char mbedtls_test_cli_key_ec[]; -extern const size_t mbedtls_test_cli_key_ec_len; -#endif - -#if defined(MBEDTLS_RSA_C) -extern const char mbedtls_test_ca_crt_rsa[]; -extern const size_t mbedtls_test_ca_crt_rsa_len; -extern const char mbedtls_test_ca_key_rsa[]; -extern const size_t mbedtls_test_ca_key_rsa_len; -extern const char mbedtls_test_ca_pwd_rsa[]; -extern const size_t mbedtls_test_ca_pwd_rsa_len; -extern const char mbedtls_test_srv_crt_rsa[]; -extern const size_t mbedtls_test_srv_crt_rsa_len; -extern const char mbedtls_test_srv_key_rsa[]; -extern const size_t mbedtls_test_srv_key_rsa_len; -extern const char mbedtls_test_cli_crt_rsa[]; -extern const size_t mbedtls_test_cli_crt_rsa_len; -extern const char mbedtls_test_cli_key_rsa[]; -extern const size_t mbedtls_test_cli_key_rsa_len; -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* certs.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/chacha20.h b/tools/sdk/include/mbedtls/mbedtls/chacha20.h deleted file mode 100644 index cfea40a5740..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/chacha20.h +++ /dev/null @@ -1,212 +0,0 @@ -/** - * \file chacha20.h - * - * \brief This file contains ChaCha20 definitions and functions. - * - * ChaCha20 is a stream cipher that can encrypt and decrypt - * information. ChaCha was created by Daniel Bernstein as a variant of - * its Salsa cipher https://cr.yp.to/chacha/chacha-20080128.pdf - * ChaCha20 is the variant with 20 rounds, that was also standardized - * in RFC 7539. - * - * \author Daniel King - */ - -/* Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_CHACHA20_H -#define MBEDTLS_CHACHA20_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -#define MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA -0x0051 /**< Invalid input parameter(s). */ -#define MBEDTLS_ERR_CHACHA20_FEATURE_UNAVAILABLE -0x0053 /**< Feature not available. For example, s part of the API is not implemented. */ -#define MBEDTLS_ERR_CHACHA20_HW_ACCEL_FAILED -0x0055 /**< Chacha20 hardware accelerator failed. */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_CHACHA20_ALT) - -typedef struct mbedtls_chacha20_context -{ - uint32_t state[16]; /*! The state (before round operations). */ - uint8_t keystream8[64]; /*! Leftover keystream bytes. */ - size_t keystream_bytes_used; /*! Number of keystream bytes already used. */ -} -mbedtls_chacha20_context; - -#else /* MBEDTLS_CHACHA20_ALT */ -#include "chacha20_alt.h" -#endif /* MBEDTLS_CHACHA20_ALT */ - -/** - * \brief This function initializes the specified ChaCha20 context. - * - * It must be the first API called before using - * the context. - * - * It is usually followed by calls to - * \c mbedtls_chacha20_setkey() and - * \c mbedtls_chacha20_starts(), then one or more calls to - * to \c mbedtls_chacha20_update(), and finally to - * \c mbedtls_chacha20_free(). - * - * \param ctx The ChaCha20 context to initialize. - */ -void mbedtls_chacha20_init( mbedtls_chacha20_context *ctx ); - -/** - * \brief This function releases and clears the specified ChaCha20 context. - * - * \param ctx The ChaCha20 context to clear. - */ -void mbedtls_chacha20_free( mbedtls_chacha20_context *ctx ); - -/** - * \brief This function sets the encryption/decryption key. - * - * \note After using this function, you must also call - * \c mbedtls_chacha20_starts() to set a nonce before you - * start encrypting/decrypting data with - * \c mbedtls_chacha_update(). - * - * \param ctx The ChaCha20 context to which the key should be bound. - * \param key The encryption/decryption key. Must be 32 bytes in length. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA if ctx or key is NULL. - */ -int mbedtls_chacha20_setkey( mbedtls_chacha20_context *ctx, - const unsigned char key[32] ); - -/** - * \brief This function sets the nonce and initial counter value. - * - * \note A ChaCha20 context can be re-used with the same key by - * calling this function to change the nonce. - * - * \warning You must never use the same nonce twice with the same key. - * This would void any confidentiality guarantees for the - * messages encrypted with the same nonce and key. - * - * \param ctx The ChaCha20 context to which the nonce should be bound. - * \param nonce The nonce. Must be 12 bytes in size. - * \param counter The initial counter value. This is usually 0. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA if ctx or nonce is - * NULL. - */ -int mbedtls_chacha20_starts( mbedtls_chacha20_context* ctx, - const unsigned char nonce[12], - uint32_t counter ); - -/** - * \brief This function encrypts or decrypts data. - * - * Since ChaCha20 is a stream cipher, the same operation is - * used for encrypting and decrypting data. - * - * \note The \p input and \p output pointers must either be equal or - * point to non-overlapping buffers. - * - * \note \c mbedtls_chacha20_setkey() and - * \c mbedtls_chacha20_starts() must be called at least once - * to setup the context before this function can be called. - * - * \note This function can be called multiple times in a row in - * order to encrypt of decrypt data piecewise with the same - * key and nonce. - * - * \param ctx The ChaCha20 context to use for encryption or decryption. - * \param size The length of the input data in bytes. - * \param input The buffer holding the input data. - * This pointer can be NULL if size == 0. - * \param output The buffer holding the output data. - * Must be able to hold \p size bytes. - * This pointer can be NULL if size == 0. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA if the ctx, input, or - * output pointers are NULL. - */ -int mbedtls_chacha20_update( mbedtls_chacha20_context *ctx, - size_t size, - const unsigned char *input, - unsigned char *output ); - -/** - * \brief This function encrypts or decrypts data with ChaCha20 and - * the given key and nonce. - * - * Since ChaCha20 is a stream cipher, the same operation is - * used for encrypting and decrypting data. - * - * \warning You must never use the same (key, nonce) pair more than - * once. This would void any confidentiality guarantees for - * the messages encrypted with the same nonce and key. - * - * \note The \p input and \p output pointers must either be equal or - * point to non-overlapping buffers. - * - * \param key The encryption/decryption key. Must be 32 bytes in length. - * \param nonce The nonce. Must be 12 bytes in size. - * \param counter The initial counter value. This is usually 0. - * \param size The length of the input data in bytes. - * \param input The buffer holding the input data. - * This pointer can be NULL if size == 0. - * \param output The buffer holding the output data. - * Must be able to hold \p size bytes. - * This pointer can be NULL if size == 0. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA if key, nonce, input, - * or output is NULL. - */ -int mbedtls_chacha20_crypt( const unsigned char key[32], - const unsigned char nonce[12], - uint32_t counter, - size_t size, - const unsigned char* input, - unsigned char* output ); - -#if defined(MBEDTLS_SELF_TEST) -/** - * \brief The ChaCha20 checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_chacha20_self_test( int verbose ); -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_CHACHA20_H */ diff --git a/tools/sdk/include/mbedtls/mbedtls/chachapoly.h b/tools/sdk/include/mbedtls/mbedtls/chachapoly.h deleted file mode 100644 index 7de6f4e8c63..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/chachapoly.h +++ /dev/null @@ -1,355 +0,0 @@ -/** - * \file chachapoly.h - * - * \brief This file contains the AEAD-ChaCha20-Poly1305 definitions and - * functions. - * - * ChaCha20-Poly1305 is an algorithm for Authenticated Encryption - * with Associated Data (AEAD) that can be used to encrypt and - * authenticate data. It is based on ChaCha20 and Poly1305 by Daniel - * Bernstein and was standardized in RFC 7539. - * - * \author Daniel King - */ - -/* Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_CHACHAPOLY_H -#define MBEDTLS_CHACHAPOLY_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -/* for shared error codes */ -#include "poly1305.h" - -#define MBEDTLS_ERR_CHACHAPOLY_BAD_STATE -0x0054 /**< The requested operation is not permitted in the current state. */ -#define MBEDTLS_ERR_CHACHAPOLY_AUTH_FAILED -0x0056 /**< Authenticated decryption failed: data was not authentic. */ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum -{ - MBEDTLS_CHACHAPOLY_ENCRYPT, /**< The mode value for performing encryption. */ - MBEDTLS_CHACHAPOLY_DECRYPT /**< The mode value for performing decryption. */ -} -mbedtls_chachapoly_mode_t; - -#if !defined(MBEDTLS_CHACHAPOLY_ALT) - -#include "chacha20.h" - -typedef struct mbedtls_chachapoly_context -{ - mbedtls_chacha20_context chacha20_ctx; /**< The ChaCha20 context. */ - mbedtls_poly1305_context poly1305_ctx; /**< The Poly1305 context. */ - uint64_t aad_len; /**< The length (bytes) of the Additional Authenticated Data. */ - uint64_t ciphertext_len; /**< The length (bytes) of the ciphertext. */ - int state; /**< The current state of the context. */ - mbedtls_chachapoly_mode_t mode; /**< Cipher mode (encrypt or decrypt). */ -} -mbedtls_chachapoly_context; - -#else /* !MBEDTLS_CHACHAPOLY_ALT */ -#include "chachapoly_alt.h" -#endif /* !MBEDTLS_CHACHAPOLY_ALT */ - -/** - * \brief This function initializes the specified ChaCha20-Poly1305 context. - * - * It must be the first API called before using - * the context. It must be followed by a call to - * \c mbedtls_chachapoly_setkey() before any operation can be - * done, and to \c mbedtls_chachapoly_free() once all - * operations with that context have been finished. - * - * In order to encrypt or decrypt full messages at once, for - * each message you should make a single call to - * \c mbedtls_chachapoly_crypt_and_tag() or - * \c mbedtls_chachapoly_auth_decrypt(). - * - * In order to encrypt messages piecewise, for each - * message you should make a call to - * \c mbedtls_chachapoly_starts(), then 0 or more calls to - * \c mbedtls_chachapoly_update_aad(), then 0 or more calls to - * \c mbedtls_chachapoly_update(), then one call to - * \c mbedtls_chachapoly_finish(). - * - * \warning Decryption with the piecewise API is discouraged! Always - * use \c mbedtls_chachapoly_auth_decrypt() when possible! - * - * If however this is not possible because the data is too - * large to fit in memory, you need to: - * - * - call \c mbedtls_chachapoly_starts() and (if needed) - * \c mbedtls_chachapoly_update_aad() as above, - * - call \c mbedtls_chachapoly_update() multiple times and - * ensure its output (the plaintext) is NOT used in any other - * way than placing it in temporary storage at this point, - * - call \c mbedtls_chachapoly_finish() to compute the - * authentication tag and compared it in constant time to the - * tag received with the ciphertext. - * - * If the tags are not equal, you must immediately discard - * all previous outputs of \c mbedtls_chachapoly_update(), - * otherwise you can now safely use the plaintext. - * - * \param ctx The ChachaPoly context to initialize. - */ -void mbedtls_chachapoly_init( mbedtls_chachapoly_context *ctx ); - -/** - * \brief This function releases and clears the specified ChaCha20-Poly1305 context. - * - * \param ctx The ChachaPoly context to clear. - */ -void mbedtls_chachapoly_free( mbedtls_chachapoly_context *ctx ); - -/** - * \brief This function sets the ChaCha20-Poly1305 symmetric encryption key. - * - * \param ctx The ChaCha20-Poly1305 context to which the key should be - * bound. - * \param key The 256-bit (32 bytes) key. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA - * if \p ctx or \p key are NULL. - */ -int mbedtls_chachapoly_setkey( mbedtls_chachapoly_context *ctx, - const unsigned char key[32] ); - -/** - * \brief This function starts a ChaCha20-Poly1305 encryption or - * decryption operation. - * - * \warning You must never use the same nonce twice with the same key. - * This would void any confidentiality and authenticity - * guarantees for the messages encrypted with the same nonce - * and key. - * - * \note If the context is being used for AAD only (no data to - * encrypt or decrypt) then \p mode can be set to any value. - * - * \warning Decryption with the piecewise API is discouraged, see the - * warning on \c mbedtls_chachapoly_init(). - * - * \param ctx The ChaCha20-Poly1305 context. - * \param nonce The nonce/IV to use for the message. Must be 12 bytes. - * \param mode The operation to perform: #MBEDTLS_CHACHAPOLY_ENCRYPT or - * #MBEDTLS_CHACHAPOLY_DECRYPT (discouraged, see warning). - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA - * if \p ctx or \p mac are NULL. - */ -int mbedtls_chachapoly_starts( mbedtls_chachapoly_context *ctx, - const unsigned char nonce[12], - mbedtls_chachapoly_mode_t mode ); - -/** - * \brief This function feeds additional data to be authenticated - * into an ongoing ChaCha20-Poly1305 operation. - * - * The Additional Authenticated Data (AAD), also called - * Associated Data (AD) is only authenticated but not - * encrypted nor included in the encrypted output. It is - * usually transmitted separately from the ciphertext or - * computed locally by each party. - * - * \note This function is called before data is encrypted/decrypted. - * I.e. call this function to process the AAD before calling - * \c mbedtls_chachapoly_update(). - * - * You may call this function multiple times to process - * an arbitrary amount of AAD. It is permitted to call - * this function 0 times, if no AAD is used. - * - * This function cannot be called any more if data has - * been processed by \c mbedtls_chachapoly_update(), - * or if the context has been finished. - * - * \warning Decryption with the piecewise API is discouraged, see the - * warning on \c mbedtls_chachapoly_init(). - * - * \param ctx The ChaCha20-Poly1305 context to use. - * \param aad_len The length (in bytes) of the AAD. The length has no - * restrictions. - * \param aad Buffer containing the AAD. - * This pointer can be NULL if aad_len == 0. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA - * if \p ctx or \p aad are NULL. - * \return #MBEDTLS_ERR_CHACHAPOLY_BAD_STATE - * if the operations has not been started or has been - * finished, or if the AAD has been finished. - */ -int mbedtls_chachapoly_update_aad( mbedtls_chachapoly_context *ctx, - const unsigned char *aad, - size_t aad_len ); - -/** - * \brief Thus function feeds data to be encrypted or decrypted - * into an on-going ChaCha20-Poly1305 - * operation. - * - * The direction (encryption or decryption) depends on the - * mode that was given when calling - * \c mbedtls_chachapoly_starts(). - * - * You may call this function multiple times to process - * an arbitrary amount of data. It is permitted to call - * this function 0 times, if no data is to be encrypted - * or decrypted. - * - * \warning Decryption with the piecewise API is discouraged, see the - * warning on \c mbedtls_chachapoly_init(). - * - * \param ctx The ChaCha20-Poly1305 context to use. - * \param len The length (in bytes) of the data to encrypt or decrypt. - * \param input The buffer containing the data to encrypt or decrypt. - * This pointer can be NULL if len == 0. - * \param output The buffer to where the encrypted or decrypted data is written. - * Must be able to hold \p len bytes. - * This pointer can be NULL if len == 0. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA - * if \p ctx, \p input, or \p output are NULL. - * \return #MBEDTLS_ERR_CHACHAPOLY_BAD_STATE - * if the operation has not been started or has been - * finished. - */ -int mbedtls_chachapoly_update( mbedtls_chachapoly_context *ctx, - size_t len, - const unsigned char *input, - unsigned char *output ); - -/** - * \brief This function finished the ChaCha20-Poly1305 operation and - * generates the MAC (authentication tag). - * - * \param ctx The ChaCha20-Poly1305 context to use. - * \param mac The buffer to where the 128-bit (16 bytes) MAC is written. - * - * \warning Decryption with the piecewise API is discouraged, see the - * warning on \c mbedtls_chachapoly_init(). - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA - * if \p ctx or \p mac are NULL. - * \return #MBEDTLS_ERR_CHACHAPOLY_BAD_STATE - * if the operation has not been started or has been - * finished. - */ -int mbedtls_chachapoly_finish( mbedtls_chachapoly_context *ctx, - unsigned char mac[16] ); - -/** - * \brief This function performs a complete ChaCha20-Poly1305 - * authenticated encryption with the previously-set key. - * - * \note Before using this function, you must set the key with - * \c mbedtls_chachapoly_setkey(). - * - * \warning You must never use the same nonce twice with the same key. - * This would void any confidentiality and authenticity - * guarantees for the messages encrypted with the same nonce - * and key. - * - * \param ctx The ChaCha20-Poly1305 context to use (holds the key). - * \param length The length (in bytes) of the data to encrypt or decrypt. - * \param nonce The 96-bit (12 bytes) nonce/IV to use. - * \param aad The buffer containing the additional authenticated data (AAD). - * This pointer can be NULL if aad_len == 0. - * \param aad_len The length (in bytes) of the AAD data to process. - * \param input The buffer containing the data to encrypt or decrypt. - * This pointer can be NULL if ilen == 0. - * \param output The buffer to where the encrypted or decrypted data is written. - * This pointer can be NULL if ilen == 0. - * \param tag The buffer to where the computed 128-bit (16 bytes) MAC is written. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA - * if one or more of the required parameters are NULL. - */ -int mbedtls_chachapoly_encrypt_and_tag( mbedtls_chachapoly_context *ctx, - size_t length, - const unsigned char nonce[12], - const unsigned char *aad, - size_t aad_len, - const unsigned char *input, - unsigned char *output, - unsigned char tag[16] ); - -/** - * \brief This function performs a complete ChaCha20-Poly1305 - * authenticated decryption with the previously-set key. - * - * \note Before using this function, you must set the key with - * \c mbedtls_chachapoly_setkey(). - * - * \param ctx The ChaCha20-Poly1305 context to use (holds the key). - * \param length The length (in bytes) of the data to decrypt. - * \param nonce The 96-bit (12 bytes) nonce/IV to use. - * \param aad The buffer containing the additional authenticated data (AAD). - * This pointer can be NULL if aad_len == 0. - * \param aad_len The length (in bytes) of the AAD data to process. - * \param tag The buffer holding the authentication tag. - * \param input The buffer containing the data to decrypt. - * This pointer can be NULL if ilen == 0. - * \param output The buffer to where the decrypted data is written. - * This pointer can be NULL if ilen == 0. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA - * if one or more of the required parameters are NULL. - * \return #MBEDTLS_ERR_CHACHAPOLY_AUTH_FAILED - * if the data was not authentic. - */ -int mbedtls_chachapoly_auth_decrypt( mbedtls_chachapoly_context *ctx, - size_t length, - const unsigned char nonce[12], - const unsigned char *aad, - size_t aad_len, - const unsigned char tag[16], - const unsigned char *input, - unsigned char *output ); - -#if defined(MBEDTLS_SELF_TEST) -/** - * \brief The ChaCha20-Poly1305 checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_chachapoly_self_test( int verbose ); -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_CHACHAPOLY_H */ diff --git a/tools/sdk/include/mbedtls/mbedtls/check_config.h b/tools/sdk/include/mbedtls/mbedtls/check_config.h deleted file mode 100644 index 9e6bb8a46aa..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/check_config.h +++ /dev/null @@ -1,683 +0,0 @@ -/** - * \file check_config.h - * - * \brief Consistency checks for configuration options - */ -/* - * Copyright (C) 2006-2018, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ - -/* - * It is recommended to include this file from your config.h - * in order to catch dependency issues early. - */ - -#ifndef MBEDTLS_CHECK_CONFIG_H -#define MBEDTLS_CHECK_CONFIG_H - -/* - * We assume CHAR_BIT is 8 in many places. In practice, this is true on our - * target platforms, so not an issue, but let's just be extra sure. - */ -#include -#if CHAR_BIT != 8 -#error "mbed TLS requires a platform with 8-bit chars" -#endif - -#if defined(_WIN32) -#if !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_C is required on Windows" -#endif - -/* Fix the config here. Not convenient to put an #ifdef _WIN32 in config.h as - * it would confuse config.pl. */ -#if !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && \ - !defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) -#define MBEDTLS_PLATFORM_SNPRINTF_ALT -#endif -#endif /* _WIN32 */ - -#if defined(TARGET_LIKE_MBED) && \ - ( defined(MBEDTLS_NET_C) || defined(MBEDTLS_TIMING_C) ) -#error "The NET and TIMING modules are not available for mbed OS - please use the network and timing functions provided by mbed OS" -#endif - -#if defined(MBEDTLS_DEPRECATED_WARNING) && \ - !defined(__GNUC__) && !defined(__clang__) -#error "MBEDTLS_DEPRECATED_WARNING only works with GCC and Clang" -#endif - -#if defined(MBEDTLS_HAVE_TIME_DATE) && !defined(MBEDTLS_HAVE_TIME) -#error "MBEDTLS_HAVE_TIME_DATE without MBEDTLS_HAVE_TIME does not make sense" -#endif - -#if defined(MBEDTLS_AESNI_C) && !defined(MBEDTLS_HAVE_ASM) -#error "MBEDTLS_AESNI_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_CTR_DRBG_C) && !defined(MBEDTLS_AES_C) -#error "MBEDTLS_CTR_DRBG_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_DHM_C) && !defined(MBEDTLS_BIGNUM_C) -#error "MBEDTLS_DHM_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT) && !defined(MBEDTLS_SSL_TRUNCATED_HMAC) -#error "MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_CMAC_C) && \ - !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_DES_C) -#error "MBEDTLS_CMAC_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_NIST_KW_C) && \ - ( !defined(MBEDTLS_AES_C) || !defined(MBEDTLS_CIPHER_C) ) -#error "MBEDTLS_NIST_KW_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECDH_C) && !defined(MBEDTLS_ECP_C) -#error "MBEDTLS_ECDH_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECDSA_C) && \ - ( !defined(MBEDTLS_ECP_C) || \ - !defined(MBEDTLS_ASN1_PARSE_C) || \ - !defined(MBEDTLS_ASN1_WRITE_C) ) -#error "MBEDTLS_ECDSA_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECJPAKE_C) && \ - ( !defined(MBEDTLS_ECP_C) || !defined(MBEDTLS_MD_C) ) -#error "MBEDTLS_ECJPAKE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECDSA_DETERMINISTIC) && !defined(MBEDTLS_HMAC_DRBG_C) -#error "MBEDTLS_ECDSA_DETERMINISTIC defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_C) && ( !defined(MBEDTLS_BIGNUM_C) || ( \ - !defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_BP256R1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_BP384R1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_BP512R1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) ) ) -#error "MBEDTLS_ECP_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ENTROPY_C) && (!defined(MBEDTLS_SHA512_C) && \ - !defined(MBEDTLS_SHA256_C)) -#error "MBEDTLS_ENTROPY_C defined, but not all prerequisites" -#endif -#if defined(MBEDTLS_ENTROPY_C) && defined(MBEDTLS_SHA512_C) && \ - defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 64) -#error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high" -#endif -#if defined(MBEDTLS_ENTROPY_C) && \ - ( !defined(MBEDTLS_SHA512_C) || defined(MBEDTLS_ENTROPY_FORCE_SHA256) ) \ - && defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 32) -#error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high" -#endif -#if defined(MBEDTLS_ENTROPY_C) && \ - defined(MBEDTLS_ENTROPY_FORCE_SHA256) && !defined(MBEDTLS_SHA256_C) -#error "MBEDTLS_ENTROPY_FORCE_SHA256 defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_TEST_NULL_ENTROPY) && \ - ( !defined(MBEDTLS_ENTROPY_C) || !defined(MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES) ) -#error "MBEDTLS_TEST_NULL_ENTROPY defined, but not all prerequisites" -#endif -#if defined(MBEDTLS_TEST_NULL_ENTROPY) && \ - ( defined(MBEDTLS_ENTROPY_NV_SEED) || defined(MBEDTLS_ENTROPY_HARDWARE_ALT) || \ - defined(MBEDTLS_HAVEGE_C) ) -#error "MBEDTLS_TEST_NULL_ENTROPY defined, but entropy sources too" -#endif - -#if defined(MBEDTLS_GCM_C) && ( \ - !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_CAMELLIA_C) ) -#error "MBEDTLS_GCM_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) -#error "MBEDTLS_ECP_RANDOMIZE_JAC_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_ADD_MIXED_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) -#error "MBEDTLS_ECP_ADD_MIXED_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_DOUBLE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) -#error "MBEDTLS_ECP_DOUBLE_JAC_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) -#error "MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) -#error "MBEDTLS_ECP_NORMALIZE_JAC_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) -#error "MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) -#error "MBEDTLS_ECP_RANDOMIZE_MXZ_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) -#error "MBEDTLS_ECP_NORMALIZE_MXZ_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_HAVEGE_C) && !defined(MBEDTLS_TIMING_C) -#error "MBEDTLS_HAVEGE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_HKDF_C) && !defined(MBEDTLS_MD_C) -#error "MBEDTLS_HKDF_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_HMAC_DRBG_C) && !defined(MBEDTLS_MD_C) -#error "MBEDTLS_HMAC_DRBG_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) && \ - ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) ) -#error "MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) && \ - ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) ) -#error "MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(MBEDTLS_DHM_C) -#error "MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) && \ - !defined(MBEDTLS_ECDH_C) -#error "MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) && \ - ( !defined(MBEDTLS_DHM_C) || !defined(MBEDTLS_RSA_C) || \ - !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_PKCS1_V15) ) -#error "MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \ - ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_RSA_C) || \ - !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_PKCS1_V15) ) -#error "MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \ - ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_ECDSA_C) || \ - !defined(MBEDTLS_X509_CRT_PARSE_C) ) -#error "MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) && \ - ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \ - !defined(MBEDTLS_PKCS1_V15) ) -#error "MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) && \ - ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \ - !defined(MBEDTLS_PKCS1_V15) ) -#error "MBEDTLS_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) && \ - ( !defined(MBEDTLS_ECJPAKE_C) || !defined(MBEDTLS_SHA256_C) || \ - !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) ) -#error "MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) && \ - ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) -#error "MBEDTLS_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PADLOCK_C) && !defined(MBEDTLS_HAVE_ASM) -#error "MBEDTLS_PADLOCK_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PEM_PARSE_C) && !defined(MBEDTLS_BASE64_C) -#error "MBEDTLS_PEM_PARSE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PEM_WRITE_C) && !defined(MBEDTLS_BASE64_C) -#error "MBEDTLS_PEM_WRITE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PK_C) && \ - ( !defined(MBEDTLS_RSA_C) && !defined(MBEDTLS_ECP_C) ) -#error "MBEDTLS_PK_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_PK_C) -#error "MBEDTLS_PK_PARSE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PK_WRITE_C) && !defined(MBEDTLS_PK_C) -#error "MBEDTLS_PK_WRITE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PKCS11_C) && !defined(MBEDTLS_PK_C) -#error "MBEDTLS_PKCS11_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_EXIT_ALT) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_EXIT_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_EXIT_MACRO) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_EXIT_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_EXIT_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_EXIT) ||\ - defined(MBEDTLS_PLATFORM_EXIT_ALT) ) -#error "MBEDTLS_PLATFORM_EXIT_MACRO and MBEDTLS_PLATFORM_STD_EXIT/MBEDTLS_PLATFORM_EXIT_ALT cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_TIME_ALT) &&\ - ( !defined(MBEDTLS_PLATFORM_C) ||\ - !defined(MBEDTLS_HAVE_TIME) ) -#error "MBEDTLS_PLATFORM_TIME_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\ - ( !defined(MBEDTLS_PLATFORM_C) ||\ - !defined(MBEDTLS_HAVE_TIME) ) -#error "MBEDTLS_PLATFORM_TIME_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\ - ( !defined(MBEDTLS_PLATFORM_C) ||\ - !defined(MBEDTLS_HAVE_TIME) ) -#error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\ - defined(MBEDTLS_PLATFORM_TIME_ALT) ) -#error "MBEDTLS_PLATFORM_TIME_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\ - defined(MBEDTLS_PLATFORM_TIME_ALT) ) -#error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_FPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_FPRINTF_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_FPRINTF_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_FPRINTF) ||\ - defined(MBEDTLS_PLATFORM_FPRINTF_ALT) ) -#error "MBEDTLS_PLATFORM_FPRINTF_MACRO and MBEDTLS_PLATFORM_STD_FPRINTF/MBEDTLS_PLATFORM_FPRINTF_ALT cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\ - ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) -#error "MBEDTLS_PLATFORM_FREE_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\ - defined(MBEDTLS_PLATFORM_STD_FREE) -#error "MBEDTLS_PLATFORM_FREE_MACRO and MBEDTLS_PLATFORM_STD_FREE cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_FREE_MACRO) && !defined(MBEDTLS_PLATFORM_CALLOC_MACRO) -#error "MBEDTLS_PLATFORM_CALLOC_MACRO must be defined if MBEDTLS_PLATFORM_FREE_MACRO is" -#endif - -#if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\ - ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) -#error "MBEDTLS_PLATFORM_CALLOC_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\ - defined(MBEDTLS_PLATFORM_STD_CALLOC) -#error "MBEDTLS_PLATFORM_CALLOC_MACRO and MBEDTLS_PLATFORM_STD_CALLOC cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) && !defined(MBEDTLS_PLATFORM_FREE_MACRO) -#error "MBEDTLS_PLATFORM_FREE_MACRO must be defined if MBEDTLS_PLATFORM_CALLOC_MACRO is" -#endif - -#if defined(MBEDTLS_PLATFORM_MEMORY) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_MEMORY defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_PRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_PRINTF_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_PRINTF_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_PRINTF) ||\ - defined(MBEDTLS_PLATFORM_PRINTF_ALT) ) -#error "MBEDTLS_PLATFORM_PRINTF_MACRO and MBEDTLS_PLATFORM_STD_PRINTF/MBEDTLS_PLATFORM_PRINTF_ALT cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_SNPRINTF_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_SNPRINTF_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_SNPRINTF) ||\ - defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) ) -#error "MBEDTLS_PLATFORM_SNPRINTF_MACRO and MBEDTLS_PLATFORM_STD_SNPRINTF/MBEDTLS_PLATFORM_SNPRINTF_ALT cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_MEM_HDR) &&\ - !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) -#error "MBEDTLS_PLATFORM_STD_MEM_HDR defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY) -#error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY) -#error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_FREE) && !defined(MBEDTLS_PLATFORM_MEMORY) -#error "MBEDTLS_PLATFORM_STD_FREE defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_EXIT) &&\ - !defined(MBEDTLS_PLATFORM_EXIT_ALT) -#error "MBEDTLS_PLATFORM_STD_EXIT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_TIME) &&\ - ( !defined(MBEDTLS_PLATFORM_TIME_ALT) ||\ - !defined(MBEDTLS_HAVE_TIME) ) -#error "MBEDTLS_PLATFORM_STD_TIME defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_FPRINTF) &&\ - !defined(MBEDTLS_PLATFORM_FPRINTF_ALT) -#error "MBEDTLS_PLATFORM_STD_FPRINTF defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_PRINTF) &&\ - !defined(MBEDTLS_PLATFORM_PRINTF_ALT) -#error "MBEDTLS_PLATFORM_STD_PRINTF defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_SNPRINTF) &&\ - !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) -#error "MBEDTLS_PLATFORM_STD_SNPRINTF defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ENTROPY_NV_SEED) &&\ - ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_ENTROPY_C) ) -#error "MBEDTLS_ENTROPY_NV_SEED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_NV_SEED_ALT) &&\ - !defined(MBEDTLS_ENTROPY_NV_SEED) -#error "MBEDTLS_PLATFORM_NV_SEED_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) &&\ - !defined(MBEDTLS_PLATFORM_NV_SEED_ALT) -#error "MBEDTLS_PLATFORM_STD_NV_SEED_READ defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) &&\ - !defined(MBEDTLS_PLATFORM_NV_SEED_ALT) -#error "MBEDTLS_PLATFORM_STD_NV_SEED_WRITE defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_NV_SEED_READ_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) ||\ - defined(MBEDTLS_PLATFORM_NV_SEED_ALT) ) -#error "MBEDTLS_PLATFORM_NV_SEED_READ_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_READ cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) ||\ - defined(MBEDTLS_PLATFORM_NV_SEED_ALT) ) -#error "MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_WRITE cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ - !defined(MBEDTLS_OID_C) ) -#error "MBEDTLS_RSA_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_PKCS1_V21) && \ - !defined(MBEDTLS_PKCS1_V15) ) -#error "MBEDTLS_RSA_C defined, but none of the PKCS1 versions enabled" -#endif - -#if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT) && \ - ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_PKCS1_V21) ) -#error "MBEDTLS_X509_RSASSA_PSS_SUPPORT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_PROTO_SSL3) && ( !defined(MBEDTLS_MD5_C) || \ - !defined(MBEDTLS_SHA1_C) ) -#error "MBEDTLS_SSL_PROTO_SSL3 defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_PROTO_TLS1) && ( !defined(MBEDTLS_MD5_C) || \ - !defined(MBEDTLS_SHA1_C) ) -#error "MBEDTLS_SSL_PROTO_TLS1 defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_PROTO_TLS1_1) && ( !defined(MBEDTLS_MD5_C) || \ - !defined(MBEDTLS_SHA1_C) ) -#error "MBEDTLS_SSL_PROTO_TLS1_1 defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && ( !defined(MBEDTLS_SHA1_C) && \ - !defined(MBEDTLS_SHA256_C) && !defined(MBEDTLS_SHA512_C) ) -#error "MBEDTLS_SSL_PROTO_TLS1_2 defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_PROTO_DTLS) && \ - !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \ - !defined(MBEDTLS_SSL_PROTO_TLS1_2) -#error "MBEDTLS_SSL_PROTO_DTLS defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_CLI_C) && !defined(MBEDTLS_SSL_TLS_C) -#error "MBEDTLS_SSL_CLI_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_TLS_C) && ( !defined(MBEDTLS_CIPHER_C) || \ - !defined(MBEDTLS_MD_C) ) -#error "MBEDTLS_SSL_TLS_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_SRV_C) && !defined(MBEDTLS_SSL_TLS_C) -#error "MBEDTLS_SSL_SRV_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_TLS_C) && (!defined(MBEDTLS_SSL_PROTO_SSL3) && \ - !defined(MBEDTLS_SSL_PROTO_TLS1) && !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \ - !defined(MBEDTLS_SSL_PROTO_TLS1_2)) -#error "MBEDTLS_SSL_TLS_C defined, but no protocols are active" -#endif - -#if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_SSL3) && \ - defined(MBEDTLS_SSL_PROTO_TLS1_1) && !defined(MBEDTLS_SSL_PROTO_TLS1)) -#error "Illegal protocol selection" -#endif - -#if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_TLS1) && \ - defined(MBEDTLS_SSL_PROTO_TLS1_2) && !defined(MBEDTLS_SSL_PROTO_TLS1_1)) -#error "Illegal protocol selection" -#endif - -#if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_SSL3) && \ - defined(MBEDTLS_SSL_PROTO_TLS1_2) && (!defined(MBEDTLS_SSL_PROTO_TLS1) || \ - !defined(MBEDTLS_SSL_PROTO_TLS1_1))) -#error "Illegal protocol selection" -#endif - -#if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) && !defined(MBEDTLS_SSL_PROTO_DTLS) -#error "MBEDTLS_SSL_DTLS_HELLO_VERIFY defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE) && \ - !defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) -#error "MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) && \ - ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) ) -#error "MBEDTLS_SSL_DTLS_ANTI_REPLAY defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT) && \ - ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) ) -#error "MBEDTLS_SSL_DTLS_BADMAC_LIMIT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) && \ - !defined(MBEDTLS_SSL_PROTO_TLS1) && \ - !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \ - !defined(MBEDTLS_SSL_PROTO_TLS1_2) -#error "MBEDTLS_SSL_ENCRYPT_THEN_MAC defined, but not all prerequsites" -#endif - -#if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET) && \ - !defined(MBEDTLS_SSL_PROTO_TLS1) && \ - !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \ - !defined(MBEDTLS_SSL_PROTO_TLS1_2) -#error "MBEDTLS_SSL_EXTENDED_MASTER_SECRET defined, but not all prerequsites" -#endif - -#if defined(MBEDTLS_SSL_TICKET_C) && !defined(MBEDTLS_CIPHER_C) -#error "MBEDTLS_SSL_TICKET_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_CBC_RECORD_SPLITTING) && \ - !defined(MBEDTLS_SSL_PROTO_SSL3) && !defined(MBEDTLS_SSL_PROTO_TLS1) -#error "MBEDTLS_SSL_CBC_RECORD_SPLITTING defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) && \ - !defined(MBEDTLS_X509_CRT_PARSE_C) -#error "MBEDTLS_SSL_SERVER_NAME_INDICATION defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_THREADING_PTHREAD) -#if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL) -#error "MBEDTLS_THREADING_PTHREAD defined, but not all prerequisites" -#endif -#define MBEDTLS_THREADING_IMPL -#endif - -#if defined(MBEDTLS_THREADING_ALT) -#if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL) -#error "MBEDTLS_THREADING_ALT defined, but not all prerequisites" -#endif -#define MBEDTLS_THREADING_IMPL -#endif - -#if defined(MBEDTLS_THREADING_C) && !defined(MBEDTLS_THREADING_IMPL) -#error "MBEDTLS_THREADING_C defined, single threading implementation required" -#endif -#undef MBEDTLS_THREADING_IMPL - -#if defined(MBEDTLS_VERSION_FEATURES) && !defined(MBEDTLS_VERSION_C) -#error "MBEDTLS_VERSION_FEATURES defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_X509_USE_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ - !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_PARSE_C) || \ - !defined(MBEDTLS_PK_PARSE_C) ) -#error "MBEDTLS_X509_USE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_X509_CREATE_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ - !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_WRITE_C) || \ - !defined(MBEDTLS_PK_WRITE_C) ) -#error "MBEDTLS_X509_CREATE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_X509_CRT_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) ) -#error "MBEDTLS_X509_CRT_PARSE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_X509_CRL_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) ) -#error "MBEDTLS_X509_CRL_PARSE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_X509_CSR_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) ) -#error "MBEDTLS_X509_CSR_PARSE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_X509_CRT_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) ) -#error "MBEDTLS_X509_CRT_WRITE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_X509_CSR_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) ) -#error "MBEDTLS_X509_CSR_WRITE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_HAVE_INT32) && defined(MBEDTLS_HAVE_INT64) -#error "MBEDTLS_HAVE_INT32 and MBEDTLS_HAVE_INT64 cannot be defined simultaneously" -#endif /* MBEDTLS_HAVE_INT32 && MBEDTLS_HAVE_INT64 */ - -#if ( defined(MBEDTLS_HAVE_INT32) || defined(MBEDTLS_HAVE_INT64) ) && \ - defined(MBEDTLS_HAVE_ASM) -#error "MBEDTLS_HAVE_INT32/MBEDTLS_HAVE_INT64 and MBEDTLS_HAVE_ASM cannot be defined simultaneously" -#endif /* (MBEDTLS_HAVE_INT32 || MBEDTLS_HAVE_INT64) && MBEDTLS_HAVE_ASM */ - -/* - * Avoid warning from -pedantic. This is a convenient place for this - * workaround since this is included by every single file before the - * #if defined(MBEDTLS_xxx_C) that results in emtpy translation units. - */ -typedef int mbedtls_iso_c_forbids_empty_translation_units; - -#endif /* MBEDTLS_CHECK_CONFIG_H */ diff --git a/tools/sdk/include/mbedtls/mbedtls/cipher.h b/tools/sdk/include/mbedtls/mbedtls/cipher.h deleted file mode 100644 index dfb1541103c..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/cipher.h +++ /dev/null @@ -1,806 +0,0 @@ -/** - * \file cipher.h - * - * \brief This file contains an abstraction interface for use with the cipher - * primitives provided by the library. It provides a common interface to all of - * the available cipher operations. - * - * \author Adriaan de Jong - */ -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_CIPHER_H -#define MBEDTLS_CIPHER_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include - -#if defined(MBEDTLS_GCM_C) || defined(MBEDTLS_CCM_C) || defined(MBEDTLS_CHACHAPOLY_C) -#define MBEDTLS_CIPHER_MODE_AEAD -#endif - -#if defined(MBEDTLS_CIPHER_MODE_CBC) -#define MBEDTLS_CIPHER_MODE_WITH_PADDING -#endif - -#if defined(MBEDTLS_ARC4_C) || defined(MBEDTLS_CIPHER_NULL_CIPHER) || \ - defined(MBEDTLS_CHACHA20_C) -#define MBEDTLS_CIPHER_MODE_STREAM -#endif - -#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ - !defined(inline) && !defined(__cplusplus) -#define inline __inline -#endif - -#define MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE -0x6080 /**< The selected feature is not available. */ -#define MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA -0x6100 /**< Bad input parameters. */ -#define MBEDTLS_ERR_CIPHER_ALLOC_FAILED -0x6180 /**< Failed to allocate memory. */ -#define MBEDTLS_ERR_CIPHER_INVALID_PADDING -0x6200 /**< Input data contains invalid padding and is rejected. */ -#define MBEDTLS_ERR_CIPHER_FULL_BLOCK_EXPECTED -0x6280 /**< Decryption of block requires a full block. */ -#define MBEDTLS_ERR_CIPHER_AUTH_FAILED -0x6300 /**< Authentication failed (for AEAD modes). */ -#define MBEDTLS_ERR_CIPHER_INVALID_CONTEXT -0x6380 /**< The context is invalid. For example, because it was freed. */ -#define MBEDTLS_ERR_CIPHER_HW_ACCEL_FAILED -0x6400 /**< Cipher hardware accelerator failed. */ - -#define MBEDTLS_CIPHER_VARIABLE_IV_LEN 0x01 /**< Cipher accepts IVs of variable length. */ -#define MBEDTLS_CIPHER_VARIABLE_KEY_LEN 0x02 /**< Cipher accepts keys of variable length. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Supported cipher types. - * - * \warning RC4 and DES are considered weak ciphers and their use - * constitutes a security risk. Arm recommends considering stronger - * ciphers instead. - */ -typedef enum { - MBEDTLS_CIPHER_ID_NONE = 0, /**< Placeholder to mark the end of cipher ID lists. */ - MBEDTLS_CIPHER_ID_NULL, /**< The identity cipher, treated as a stream cipher. */ - MBEDTLS_CIPHER_ID_AES, /**< The AES cipher. */ - MBEDTLS_CIPHER_ID_DES, /**< The DES cipher. */ - MBEDTLS_CIPHER_ID_3DES, /**< The Triple DES cipher. */ - MBEDTLS_CIPHER_ID_CAMELLIA, /**< The Camellia cipher. */ - MBEDTLS_CIPHER_ID_BLOWFISH, /**< The Blowfish cipher. */ - MBEDTLS_CIPHER_ID_ARC4, /**< The RC4 cipher. */ - MBEDTLS_CIPHER_ID_ARIA, /**< The Aria cipher. */ - MBEDTLS_CIPHER_ID_CHACHA20, /**< The ChaCha20 cipher. */ -} mbedtls_cipher_id_t; - -/** - * \brief Supported {cipher type, cipher mode} pairs. - * - * \warning RC4 and DES are considered weak ciphers and their use - * constitutes a security risk. Arm recommends considering stronger - * ciphers instead. - */ -typedef enum { - MBEDTLS_CIPHER_NONE = 0, /**< Placeholder to mark the end of cipher-pair lists. */ - MBEDTLS_CIPHER_NULL, /**< The identity stream cipher. */ - MBEDTLS_CIPHER_AES_128_ECB, /**< AES cipher with 128-bit ECB mode. */ - MBEDTLS_CIPHER_AES_192_ECB, /**< AES cipher with 192-bit ECB mode. */ - MBEDTLS_CIPHER_AES_256_ECB, /**< AES cipher with 256-bit ECB mode. */ - MBEDTLS_CIPHER_AES_128_CBC, /**< AES cipher with 128-bit CBC mode. */ - MBEDTLS_CIPHER_AES_192_CBC, /**< AES cipher with 192-bit CBC mode. */ - MBEDTLS_CIPHER_AES_256_CBC, /**< AES cipher with 256-bit CBC mode. */ - MBEDTLS_CIPHER_AES_128_CFB128, /**< AES cipher with 128-bit CFB128 mode. */ - MBEDTLS_CIPHER_AES_192_CFB128, /**< AES cipher with 192-bit CFB128 mode. */ - MBEDTLS_CIPHER_AES_256_CFB128, /**< AES cipher with 256-bit CFB128 mode. */ - MBEDTLS_CIPHER_AES_128_CTR, /**< AES cipher with 128-bit CTR mode. */ - MBEDTLS_CIPHER_AES_192_CTR, /**< AES cipher with 192-bit CTR mode. */ - MBEDTLS_CIPHER_AES_256_CTR, /**< AES cipher with 256-bit CTR mode. */ - MBEDTLS_CIPHER_AES_128_GCM, /**< AES cipher with 128-bit GCM mode. */ - MBEDTLS_CIPHER_AES_192_GCM, /**< AES cipher with 192-bit GCM mode. */ - MBEDTLS_CIPHER_AES_256_GCM, /**< AES cipher with 256-bit GCM mode. */ - MBEDTLS_CIPHER_CAMELLIA_128_ECB, /**< Camellia cipher with 128-bit ECB mode. */ - MBEDTLS_CIPHER_CAMELLIA_192_ECB, /**< Camellia cipher with 192-bit ECB mode. */ - MBEDTLS_CIPHER_CAMELLIA_256_ECB, /**< Camellia cipher with 256-bit ECB mode. */ - MBEDTLS_CIPHER_CAMELLIA_128_CBC, /**< Camellia cipher with 128-bit CBC mode. */ - MBEDTLS_CIPHER_CAMELLIA_192_CBC, /**< Camellia cipher with 192-bit CBC mode. */ - MBEDTLS_CIPHER_CAMELLIA_256_CBC, /**< Camellia cipher with 256-bit CBC mode. */ - MBEDTLS_CIPHER_CAMELLIA_128_CFB128, /**< Camellia cipher with 128-bit CFB128 mode. */ - MBEDTLS_CIPHER_CAMELLIA_192_CFB128, /**< Camellia cipher with 192-bit CFB128 mode. */ - MBEDTLS_CIPHER_CAMELLIA_256_CFB128, /**< Camellia cipher with 256-bit CFB128 mode. */ - MBEDTLS_CIPHER_CAMELLIA_128_CTR, /**< Camellia cipher with 128-bit CTR mode. */ - MBEDTLS_CIPHER_CAMELLIA_192_CTR, /**< Camellia cipher with 192-bit CTR mode. */ - MBEDTLS_CIPHER_CAMELLIA_256_CTR, /**< Camellia cipher with 256-bit CTR mode. */ - MBEDTLS_CIPHER_CAMELLIA_128_GCM, /**< Camellia cipher with 128-bit GCM mode. */ - MBEDTLS_CIPHER_CAMELLIA_192_GCM, /**< Camellia cipher with 192-bit GCM mode. */ - MBEDTLS_CIPHER_CAMELLIA_256_GCM, /**< Camellia cipher with 256-bit GCM mode. */ - MBEDTLS_CIPHER_DES_ECB, /**< DES cipher with ECB mode. */ - MBEDTLS_CIPHER_DES_CBC, /**< DES cipher with CBC mode. */ - MBEDTLS_CIPHER_DES_EDE_ECB, /**< DES cipher with EDE ECB mode. */ - MBEDTLS_CIPHER_DES_EDE_CBC, /**< DES cipher with EDE CBC mode. */ - MBEDTLS_CIPHER_DES_EDE3_ECB, /**< DES cipher with EDE3 ECB mode. */ - MBEDTLS_CIPHER_DES_EDE3_CBC, /**< DES cipher with EDE3 CBC mode. */ - MBEDTLS_CIPHER_BLOWFISH_ECB, /**< Blowfish cipher with ECB mode. */ - MBEDTLS_CIPHER_BLOWFISH_CBC, /**< Blowfish cipher with CBC mode. */ - MBEDTLS_CIPHER_BLOWFISH_CFB64, /**< Blowfish cipher with CFB64 mode. */ - MBEDTLS_CIPHER_BLOWFISH_CTR, /**< Blowfish cipher with CTR mode. */ - MBEDTLS_CIPHER_ARC4_128, /**< RC4 cipher with 128-bit mode. */ - MBEDTLS_CIPHER_AES_128_CCM, /**< AES cipher with 128-bit CCM mode. */ - MBEDTLS_CIPHER_AES_192_CCM, /**< AES cipher with 192-bit CCM mode. */ - MBEDTLS_CIPHER_AES_256_CCM, /**< AES cipher with 256-bit CCM mode. */ - MBEDTLS_CIPHER_CAMELLIA_128_CCM, /**< Camellia cipher with 128-bit CCM mode. */ - MBEDTLS_CIPHER_CAMELLIA_192_CCM, /**< Camellia cipher with 192-bit CCM mode. */ - MBEDTLS_CIPHER_CAMELLIA_256_CCM, /**< Camellia cipher with 256-bit CCM mode. */ - MBEDTLS_CIPHER_ARIA_128_ECB, /**< Aria cipher with 128-bit key and ECB mode. */ - MBEDTLS_CIPHER_ARIA_192_ECB, /**< Aria cipher with 192-bit key and ECB mode. */ - MBEDTLS_CIPHER_ARIA_256_ECB, /**< Aria cipher with 256-bit key and ECB mode. */ - MBEDTLS_CIPHER_ARIA_128_CBC, /**< Aria cipher with 128-bit key and CBC mode. */ - MBEDTLS_CIPHER_ARIA_192_CBC, /**< Aria cipher with 192-bit key and CBC mode. */ - MBEDTLS_CIPHER_ARIA_256_CBC, /**< Aria cipher with 256-bit key and CBC mode. */ - MBEDTLS_CIPHER_ARIA_128_CFB128, /**< Aria cipher with 128-bit key and CFB-128 mode. */ - MBEDTLS_CIPHER_ARIA_192_CFB128, /**< Aria cipher with 192-bit key and CFB-128 mode. */ - MBEDTLS_CIPHER_ARIA_256_CFB128, /**< Aria cipher with 256-bit key and CFB-128 mode. */ - MBEDTLS_CIPHER_ARIA_128_CTR, /**< Aria cipher with 128-bit key and CTR mode. */ - MBEDTLS_CIPHER_ARIA_192_CTR, /**< Aria cipher with 192-bit key and CTR mode. */ - MBEDTLS_CIPHER_ARIA_256_CTR, /**< Aria cipher with 256-bit key and CTR mode. */ - MBEDTLS_CIPHER_ARIA_128_GCM, /**< Aria cipher with 128-bit key and GCM mode. */ - MBEDTLS_CIPHER_ARIA_192_GCM, /**< Aria cipher with 192-bit key and GCM mode. */ - MBEDTLS_CIPHER_ARIA_256_GCM, /**< Aria cipher with 256-bit key and GCM mode. */ - MBEDTLS_CIPHER_ARIA_128_CCM, /**< Aria cipher with 128-bit key and CCM mode. */ - MBEDTLS_CIPHER_ARIA_192_CCM, /**< Aria cipher with 192-bit key and CCM mode. */ - MBEDTLS_CIPHER_ARIA_256_CCM, /**< Aria cipher with 256-bit key and CCM mode. */ - MBEDTLS_CIPHER_AES_128_OFB, /**< AES 128-bit cipher in OFB mode. */ - MBEDTLS_CIPHER_AES_192_OFB, /**< AES 192-bit cipher in OFB mode. */ - MBEDTLS_CIPHER_AES_256_OFB, /**< AES 256-bit cipher in OFB mode. */ - MBEDTLS_CIPHER_AES_128_XTS, /**< AES 128-bit cipher in XTS block mode. */ - MBEDTLS_CIPHER_AES_256_XTS, /**< AES 256-bit cipher in XTS block mode. */ - MBEDTLS_CIPHER_CHACHA20, /**< ChaCha20 stream cipher. */ - MBEDTLS_CIPHER_CHACHA20_POLY1305, /**< ChaCha20-Poly1305 AEAD cipher. */ -} mbedtls_cipher_type_t; - -/** Supported cipher modes. */ -typedef enum { - MBEDTLS_MODE_NONE = 0, /**< None. */ - MBEDTLS_MODE_ECB, /**< The ECB cipher mode. */ - MBEDTLS_MODE_CBC, /**< The CBC cipher mode. */ - MBEDTLS_MODE_CFB, /**< The CFB cipher mode. */ - MBEDTLS_MODE_OFB, /**< The OFB cipher mode. */ - MBEDTLS_MODE_CTR, /**< The CTR cipher mode. */ - MBEDTLS_MODE_GCM, /**< The GCM cipher mode. */ - MBEDTLS_MODE_STREAM, /**< The stream cipher mode. */ - MBEDTLS_MODE_CCM, /**< The CCM cipher mode. */ - MBEDTLS_MODE_XTS, /**< The XTS cipher mode. */ - MBEDTLS_MODE_CHACHAPOLY, /**< The ChaCha-Poly cipher mode. */ -} mbedtls_cipher_mode_t; - -/** Supported cipher padding types. */ -typedef enum { - MBEDTLS_PADDING_PKCS7 = 0, /**< PKCS7 padding (default). */ - MBEDTLS_PADDING_ONE_AND_ZEROS, /**< ISO/IEC 7816-4 padding. */ - MBEDTLS_PADDING_ZEROS_AND_LEN, /**< ANSI X.923 padding. */ - MBEDTLS_PADDING_ZEROS, /**< Zero padding (not reversible). */ - MBEDTLS_PADDING_NONE, /**< Never pad (full blocks only). */ -} mbedtls_cipher_padding_t; - -/** Type of operation. */ -typedef enum { - MBEDTLS_OPERATION_NONE = -1, - MBEDTLS_DECRYPT = 0, - MBEDTLS_ENCRYPT, -} mbedtls_operation_t; - -enum { - /** Undefined key length. */ - MBEDTLS_KEY_LENGTH_NONE = 0, - /** Key length, in bits (including parity), for DES keys. */ - MBEDTLS_KEY_LENGTH_DES = 64, - /** Key length in bits, including parity, for DES in two-key EDE. */ - MBEDTLS_KEY_LENGTH_DES_EDE = 128, - /** Key length in bits, including parity, for DES in three-key EDE. */ - MBEDTLS_KEY_LENGTH_DES_EDE3 = 192, -}; - -/** Maximum length of any IV, in Bytes. */ -#define MBEDTLS_MAX_IV_LENGTH 16 -/** Maximum block size of any cipher, in Bytes. */ -#define MBEDTLS_MAX_BLOCK_LENGTH 16 - -/** - * Base cipher information (opaque struct). - */ -typedef struct mbedtls_cipher_base_t mbedtls_cipher_base_t; - -/** - * CMAC context (opaque struct). - */ -typedef struct mbedtls_cmac_context_t mbedtls_cmac_context_t; - -/** - * Cipher information. Allows calling cipher functions - * in a generic way. - */ -typedef struct mbedtls_cipher_info_t -{ - /** Full cipher identifier. For example, - * MBEDTLS_CIPHER_AES_256_CBC. - */ - mbedtls_cipher_type_t type; - - /** The cipher mode. For example, MBEDTLS_MODE_CBC. */ - mbedtls_cipher_mode_t mode; - - /** The cipher key length, in bits. This is the - * default length for variable sized ciphers. - * Includes parity bits for ciphers like DES. - */ - unsigned int key_bitlen; - - /** Name of the cipher. */ - const char * name; - - /** IV or nonce size, in Bytes. - * For ciphers that accept variable IV sizes, - * this is the recommended size. - */ - unsigned int iv_size; - - /** Bitflag comprised of MBEDTLS_CIPHER_VARIABLE_IV_LEN and - * MBEDTLS_CIPHER_VARIABLE_KEY_LEN indicating whether the - * cipher supports variable IV or variable key sizes, respectively. - */ - int flags; - - /** The block size, in Bytes. */ - unsigned int block_size; - - /** Struct for base cipher information and functions. */ - const mbedtls_cipher_base_t *base; - -} mbedtls_cipher_info_t; - -/** - * Generic cipher context. - */ -typedef struct mbedtls_cipher_context_t -{ - /** Information about the associated cipher. */ - const mbedtls_cipher_info_t *cipher_info; - - /** Key length to use. */ - int key_bitlen; - - /** Operation that the key of the context has been - * initialized for. - */ - mbedtls_operation_t operation; - -#if defined(MBEDTLS_CIPHER_MODE_WITH_PADDING) - /** Padding functions to use, if relevant for - * the specific cipher mode. - */ - void (*add_padding)( unsigned char *output, size_t olen, size_t data_len ); - int (*get_padding)( unsigned char *input, size_t ilen, size_t *data_len ); -#endif - - /** Buffer for input that has not been processed yet. */ - unsigned char unprocessed_data[MBEDTLS_MAX_BLOCK_LENGTH]; - - /** Number of Bytes that have not been processed yet. */ - size_t unprocessed_len; - - /** Current IV or NONCE_COUNTER for CTR-mode, data unit (or sector) number - * for XTS-mode. */ - unsigned char iv[MBEDTLS_MAX_IV_LENGTH]; - - /** IV size in Bytes, for ciphers with variable-length IVs. */ - size_t iv_size; - - /** The cipher-specific context. */ - void *cipher_ctx; - -#if defined(MBEDTLS_CMAC_C) - /** CMAC-specific context. */ - mbedtls_cmac_context_t *cmac_ctx; -#endif -} mbedtls_cipher_context_t; - -/** - * \brief This function retrieves the list of ciphers supported by the generic - * cipher module. - * - * \return A statically-allocated array of ciphers. The last entry - * is zero. - */ -const int *mbedtls_cipher_list( void ); - -/** - * \brief This function retrieves the cipher-information - * structure associated with the given cipher name. - * - * \param cipher_name Name of the cipher to search for. - * - * \return The cipher information structure associated with the - * given \p cipher_name. - * \return NULL if the associated cipher information is not found. - */ -const mbedtls_cipher_info_t *mbedtls_cipher_info_from_string( const char *cipher_name ); - -/** - * \brief This function retrieves the cipher-information - * structure associated with the given cipher type. - * - * \param cipher_type Type of the cipher to search for. - * - * \return The cipher information structure associated with the - * given \p cipher_type. - * \return NULL if the associated cipher information is not found. - */ -const mbedtls_cipher_info_t *mbedtls_cipher_info_from_type( const mbedtls_cipher_type_t cipher_type ); - -/** - * \brief This function retrieves the cipher-information - * structure associated with the given cipher ID, - * key size and mode. - * - * \param cipher_id The ID of the cipher to search for. For example, - * #MBEDTLS_CIPHER_ID_AES. - * \param key_bitlen The length of the key in bits. - * \param mode The cipher mode. For example, #MBEDTLS_MODE_CBC. - * - * \return The cipher information structure associated with the - * given \p cipher_id. - * \return NULL if the associated cipher information is not found. - */ -const mbedtls_cipher_info_t *mbedtls_cipher_info_from_values( const mbedtls_cipher_id_t cipher_id, - int key_bitlen, - const mbedtls_cipher_mode_t mode ); - -/** - * \brief This function initializes a \p cipher_context as NONE. - */ -void mbedtls_cipher_init( mbedtls_cipher_context_t *ctx ); - -/** - * \brief This function frees and clears the cipher-specific - * context of \p ctx. Freeing \p ctx itself remains the - * responsibility of the caller. - */ -void mbedtls_cipher_free( mbedtls_cipher_context_t *ctx ); - - -/** - * \brief This function initializes and fills the cipher-context - * structure with the appropriate values. It also clears - * the structure. - * - * \param ctx The context to initialize. May not be NULL. - * \param cipher_info The cipher to use. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on - * parameter-verification failure. - * \return #MBEDTLS_ERR_CIPHER_ALLOC_FAILED if allocation of the - * cipher-specific context fails. - * - * \internal Currently, the function also clears the structure. - * In future versions, the caller will be required to call - * mbedtls_cipher_init() on the structure first. - */ -int mbedtls_cipher_setup( mbedtls_cipher_context_t *ctx, const mbedtls_cipher_info_t *cipher_info ); - -/** - * \brief This function returns the block size of the given cipher. - * - * \param ctx The context of the cipher. Must be initialized. - * - * \return The size of the blocks of the cipher. - * \return 0 if \p ctx has not been initialized. - */ -static inline unsigned int mbedtls_cipher_get_block_size( const mbedtls_cipher_context_t *ctx ) -{ - if( NULL == ctx || NULL == ctx->cipher_info ) - return 0; - - return ctx->cipher_info->block_size; -} - -/** - * \brief This function returns the mode of operation for - * the cipher. For example, MBEDTLS_MODE_CBC. - * - * \param ctx The context of the cipher. Must be initialized. - * - * \return The mode of operation. - * \return #MBEDTLS_MODE_NONE if \p ctx has not been initialized. - */ -static inline mbedtls_cipher_mode_t mbedtls_cipher_get_cipher_mode( const mbedtls_cipher_context_t *ctx ) -{ - if( NULL == ctx || NULL == ctx->cipher_info ) - return MBEDTLS_MODE_NONE; - - return ctx->cipher_info->mode; -} - -/** - * \brief This function returns the size of the IV or nonce - * of the cipher, in Bytes. - * - * \param ctx The context of the cipher. Must be initialized. - * - * \return The recommended IV size if no IV has been set. - * \return \c 0 for ciphers not using an IV or a nonce. - * \return The actual size if an IV has been set. - */ -static inline int mbedtls_cipher_get_iv_size( const mbedtls_cipher_context_t *ctx ) -{ - if( NULL == ctx || NULL == ctx->cipher_info ) - return 0; - - if( ctx->iv_size != 0 ) - return (int) ctx->iv_size; - - return (int) ctx->cipher_info->iv_size; -} - -/** - * \brief This function returns the type of the given cipher. - * - * \param ctx The context of the cipher. Must be initialized. - * - * \return The type of the cipher. - * \return #MBEDTLS_CIPHER_NONE if \p ctx has not been initialized. - */ -static inline mbedtls_cipher_type_t mbedtls_cipher_get_type( const mbedtls_cipher_context_t *ctx ) -{ - if( NULL == ctx || NULL == ctx->cipher_info ) - return MBEDTLS_CIPHER_NONE; - - return ctx->cipher_info->type; -} - -/** - * \brief This function returns the name of the given cipher - * as a string. - * - * \param ctx The context of the cipher. Must be initialized. - * - * \return The name of the cipher. - * \return NULL if \p ctx has not been not initialized. - */ -static inline const char *mbedtls_cipher_get_name( const mbedtls_cipher_context_t *ctx ) -{ - if( NULL == ctx || NULL == ctx->cipher_info ) - return 0; - - return ctx->cipher_info->name; -} - -/** - * \brief This function returns the key length of the cipher. - * - * \param ctx The context of the cipher. Must be initialized. - * - * \return The key length of the cipher in bits. - * \return #MBEDTLS_KEY_LENGTH_NONE if ctx \p has not been - * initialized. - */ -static inline int mbedtls_cipher_get_key_bitlen( const mbedtls_cipher_context_t *ctx ) -{ - if( NULL == ctx || NULL == ctx->cipher_info ) - return MBEDTLS_KEY_LENGTH_NONE; - - return (int) ctx->cipher_info->key_bitlen; -} - -/** - * \brief This function returns the operation of the given cipher. - * - * \param ctx The context of the cipher. Must be initialized. - * - * \return The type of operation: #MBEDTLS_ENCRYPT or #MBEDTLS_DECRYPT. - * \return #MBEDTLS_OPERATION_NONE if \p ctx has not been initialized. - */ -static inline mbedtls_operation_t mbedtls_cipher_get_operation( const mbedtls_cipher_context_t *ctx ) -{ - if( NULL == ctx || NULL == ctx->cipher_info ) - return MBEDTLS_OPERATION_NONE; - - return ctx->operation; -} - -/** - * \brief This function sets the key to use with the given context. - * - * \param ctx The generic cipher context. May not be NULL. Must have - * been initialized using mbedtls_cipher_info_from_type() - * or mbedtls_cipher_info_from_string(). - * \param key The key to use. - * \param key_bitlen The key length to use, in bits. - * \param operation The operation that the key will be used for: - * #MBEDTLS_ENCRYPT or #MBEDTLS_DECRYPT. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on - * parameter-verification failure. - * \return A cipher-specific error code on failure. - */ -int mbedtls_cipher_setkey( mbedtls_cipher_context_t *ctx, const unsigned char *key, - int key_bitlen, const mbedtls_operation_t operation ); - -#if defined(MBEDTLS_CIPHER_MODE_WITH_PADDING) -/** - * \brief This function sets the padding mode, for cipher modes - * that use padding. - * - * The default passing mode is PKCS7 padding. - * - * \param ctx The generic cipher context. - * \param mode The padding mode. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE - * if the selected padding mode is not supported. - * \return #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA if the cipher mode - * does not support padding. - */ -int mbedtls_cipher_set_padding_mode( mbedtls_cipher_context_t *ctx, mbedtls_cipher_padding_t mode ); -#endif /* MBEDTLS_CIPHER_MODE_WITH_PADDING */ - -/** - * \brief This function sets the initialization vector (IV) - * or nonce. - * - * \note Some ciphers do not use IVs nor nonce. For these - * ciphers, this function has no effect. - * - * \param ctx The generic cipher context. - * \param iv The IV to use, or NONCE_COUNTER for CTR-mode ciphers. - * \param iv_len The IV length for ciphers with variable-size IV. - * This parameter is discarded by ciphers with fixed-size IV. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on - * parameter-verification failure. - */ -int mbedtls_cipher_set_iv( mbedtls_cipher_context_t *ctx, - const unsigned char *iv, size_t iv_len ); - -/** - * \brief This function resets the cipher state. - * - * \param ctx The generic cipher context. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on - * parameter-verification failure. - */ -int mbedtls_cipher_reset( mbedtls_cipher_context_t *ctx ); - -#if defined(MBEDTLS_GCM_C) || defined(MBEDTLS_CHACHAPOLY_C) -/** - * \brief This function adds additional data for AEAD ciphers. - * Currently supported with GCM and ChaCha20+Poly1305. - * Must be called exactly once, after mbedtls_cipher_reset(). - * - * \param ctx The generic cipher context. - * \param ad The additional data to use. - * \param ad_len the Length of \p ad. - * - * \return \c 0 on success. - * \return A specific error code on failure. - */ -int mbedtls_cipher_update_ad( mbedtls_cipher_context_t *ctx, - const unsigned char *ad, size_t ad_len ); -#endif /* MBEDTLS_GCM_C || MBEDTLS_CHACHAPOLY_C */ - -/** - * \brief The generic cipher update function. It encrypts or - * decrypts using the given cipher context. Writes as - * many block-sized blocks of data as possible to output. - * Any data that cannot be written immediately is either - * added to the next block, or flushed when - * mbedtls_cipher_finish() is called. - * Exception: For MBEDTLS_MODE_ECB, expects a single block - * in size. For example, 16 Bytes for AES. - * - * \note If the underlying cipher is used in GCM mode, all calls - * to this function, except for the last one before - * mbedtls_cipher_finish(), must have \p ilen as a - * multiple of the block size of the cipher. - * - * \param ctx The generic cipher context. - * \param input The buffer holding the input data. - * \param ilen The length of the input data. - * \param output The buffer for the output data. Must be able to hold at - * least \p ilen + block_size. Must not be the same buffer - * as input. - * \param olen The length of the output data, to be updated with the - * actual number of Bytes written. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on - * parameter-verification failure. - * \return #MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE on an - * unsupported mode for a cipher. - * \return A cipher-specific error code on failure. - */ -int mbedtls_cipher_update( mbedtls_cipher_context_t *ctx, const unsigned char *input, - size_t ilen, unsigned char *output, size_t *olen ); - -/** - * \brief The generic cipher finalization function. If data still - * needs to be flushed from an incomplete block, the data - * contained in it is padded to the size of - * the last block, and written to the \p output buffer. - * - * \param ctx The generic cipher context. - * \param output The buffer to write data to. Needs block_size available. - * \param olen The length of the data written to the \p output buffer. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on - * parameter-verification failure. - * \return #MBEDTLS_ERR_CIPHER_FULL_BLOCK_EXPECTED on decryption - * expecting a full block but not receiving one. - * \return #MBEDTLS_ERR_CIPHER_INVALID_PADDING on invalid padding - * while decrypting. - * \return A cipher-specific error code on failure. - */ -int mbedtls_cipher_finish( mbedtls_cipher_context_t *ctx, - unsigned char *output, size_t *olen ); - -#if defined(MBEDTLS_GCM_C) || defined(MBEDTLS_CHACHAPOLY_C) -/** - * \brief This function writes a tag for AEAD ciphers. - * Currently supported with GCM and ChaCha20+Poly1305. - * Must be called after mbedtls_cipher_finish(). - * - * \param ctx The generic cipher context. - * \param tag The buffer to write the tag to. - * \param tag_len The length of the tag to write. - * - * \return \c 0 on success. - * \return A specific error code on failure. - */ -int mbedtls_cipher_write_tag( mbedtls_cipher_context_t *ctx, - unsigned char *tag, size_t tag_len ); - -/** - * \brief This function checks the tag for AEAD ciphers. - * Currently supported with GCM and ChaCha20+Poly1305. - * Must be called after mbedtls_cipher_finish(). - * - * \param ctx The generic cipher context. - * \param tag The buffer holding the tag. - * \param tag_len The length of the tag to check. - * - * \return \c 0 on success. - * \return A specific error code on failure. - */ -int mbedtls_cipher_check_tag( mbedtls_cipher_context_t *ctx, - const unsigned char *tag, size_t tag_len ); -#endif /* MBEDTLS_GCM_C || MBEDTLS_CHACHAPOLY_C */ - -/** - * \brief The generic all-in-one encryption/decryption function, - * for all ciphers except AEAD constructs. - * - * \param ctx The generic cipher context. - * \param iv The IV to use, or NONCE_COUNTER for CTR-mode ciphers. - * \param iv_len The IV length for ciphers with variable-size IV. - * This parameter is discarded by ciphers with fixed-size - * IV. - * \param input The buffer holding the input data. - * \param ilen The length of the input data. - * \param output The buffer for the output data. Must be able to hold at - * least \p ilen + block_size. Must not be the same buffer - * as input. - * \param olen The length of the output data, to be updated with the - * actual number of Bytes written. - * - * \note Some ciphers do not use IVs nor nonce. For these - * ciphers, use \p iv = NULL and \p iv_len = 0. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on - * parameter-verification failure. - * \return #MBEDTLS_ERR_CIPHER_FULL_BLOCK_EXPECTED on decryption - * expecting a full block but not receiving one. - * \return #MBEDTLS_ERR_CIPHER_INVALID_PADDING on invalid padding - * while decrypting. - * \return A cipher-specific error code on failure. - */ -int mbedtls_cipher_crypt( mbedtls_cipher_context_t *ctx, - const unsigned char *iv, size_t iv_len, - const unsigned char *input, size_t ilen, - unsigned char *output, size_t *olen ); - -#if defined(MBEDTLS_CIPHER_MODE_AEAD) -/** - * \brief The generic autenticated encryption (AEAD) function. - * - * \param ctx The generic cipher context. - * \param iv The IV to use, or NONCE_COUNTER for CTR-mode ciphers. - * \param iv_len The IV length for ciphers with variable-size IV. - * This parameter is discarded by ciphers with fixed-size IV. - * \param ad The additional data to authenticate. - * \param ad_len The length of \p ad. - * \param input The buffer holding the input data. - * \param ilen The length of the input data. - * \param output The buffer for the output data. - * Must be able to hold at least \p ilen. - * \param olen The length of the output data, to be updated with the - * actual number of Bytes written. - * \param tag The buffer for the authentication tag. - * \param tag_len The desired length of the authentication tag. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on - * parameter-verification failure. - * \return A cipher-specific error code on failure. - */ -int mbedtls_cipher_auth_encrypt( mbedtls_cipher_context_t *ctx, - const unsigned char *iv, size_t iv_len, - const unsigned char *ad, size_t ad_len, - const unsigned char *input, size_t ilen, - unsigned char *output, size_t *olen, - unsigned char *tag, size_t tag_len ); - -/** - * \brief The generic autenticated decryption (AEAD) function. - * - * \note If the data is not authentic, then the output buffer - * is zeroed out to prevent the unauthentic plaintext being - * used, making this interface safer. - * - * \param ctx The generic cipher context. - * \param iv The IV to use, or NONCE_COUNTER for CTR-mode ciphers. - * \param iv_len The IV length for ciphers with variable-size IV. - * This parameter is discarded by ciphers with fixed-size IV. - * \param ad The additional data to be authenticated. - * \param ad_len The length of \p ad. - * \param input The buffer holding the input data. - * \param ilen The length of the input data. - * \param output The buffer for the output data. - * Must be able to hold at least \p ilen. - * \param olen The length of the output data, to be updated with the - * actual number of Bytes written. - * \param tag The buffer holding the authentication tag. - * \param tag_len The length of the authentication tag. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on - * parameter-verification failure. - * \return #MBEDTLS_ERR_CIPHER_AUTH_FAILED if data is not authentic. - * \return A cipher-specific error code on failure. - */ -int mbedtls_cipher_auth_decrypt( mbedtls_cipher_context_t *ctx, - const unsigned char *iv, size_t iv_len, - const unsigned char *ad, size_t ad_len, - const unsigned char *input, size_t ilen, - unsigned char *output, size_t *olen, - const unsigned char *tag, size_t tag_len ); -#endif /* MBEDTLS_CIPHER_MODE_AEAD */ - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_CIPHER_H */ diff --git a/tools/sdk/include/mbedtls/mbedtls/cipher_internal.h b/tools/sdk/include/mbedtls/mbedtls/cipher_internal.h deleted file mode 100644 index c6def0bef75..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/cipher_internal.h +++ /dev/null @@ -1,125 +0,0 @@ -/** - * \file cipher_internal.h - * - * \brief Cipher wrappers. - * - * \author Adriaan de Jong - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_CIPHER_WRAP_H -#define MBEDTLS_CIPHER_WRAP_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "cipher.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Base cipher information. The non-mode specific functions and values. - */ -struct mbedtls_cipher_base_t -{ - /** Base Cipher type (e.g. MBEDTLS_CIPHER_ID_AES) */ - mbedtls_cipher_id_t cipher; - - /** Encrypt using ECB */ - int (*ecb_func)( void *ctx, mbedtls_operation_t mode, - const unsigned char *input, unsigned char *output ); - -#if defined(MBEDTLS_CIPHER_MODE_CBC) - /** Encrypt using CBC */ - int (*cbc_func)( void *ctx, mbedtls_operation_t mode, size_t length, - unsigned char *iv, const unsigned char *input, - unsigned char *output ); -#endif - -#if defined(MBEDTLS_CIPHER_MODE_CFB) - /** Encrypt using CFB (Full length) */ - int (*cfb_func)( void *ctx, mbedtls_operation_t mode, size_t length, size_t *iv_off, - unsigned char *iv, const unsigned char *input, - unsigned char *output ); -#endif - -#if defined(MBEDTLS_CIPHER_MODE_OFB) - /** Encrypt using OFB (Full length) */ - int (*ofb_func)( void *ctx, size_t length, size_t *iv_off, - unsigned char *iv, - const unsigned char *input, - unsigned char *output ); -#endif - -#if defined(MBEDTLS_CIPHER_MODE_CTR) - /** Encrypt using CTR */ - int (*ctr_func)( void *ctx, size_t length, size_t *nc_off, - unsigned char *nonce_counter, unsigned char *stream_block, - const unsigned char *input, unsigned char *output ); -#endif - -#if defined(MBEDTLS_CIPHER_MODE_XTS) - /** Encrypt or decrypt using XTS. */ - int (*xts_func)( void *ctx, mbedtls_operation_t mode, size_t length, - const unsigned char data_unit[16], - const unsigned char *input, unsigned char *output ); -#endif - -#if defined(MBEDTLS_CIPHER_MODE_STREAM) - /** Encrypt using STREAM */ - int (*stream_func)( void *ctx, size_t length, - const unsigned char *input, unsigned char *output ); -#endif - - /** Set key for encryption purposes */ - int (*setkey_enc_func)( void *ctx, const unsigned char *key, - unsigned int key_bitlen ); - - /** Set key for decryption purposes */ - int (*setkey_dec_func)( void *ctx, const unsigned char *key, - unsigned int key_bitlen); - - /** Allocate a new context */ - void * (*ctx_alloc_func)( void ); - - /** Free the given context */ - void (*ctx_free_func)( void *ctx ); - -}; - -typedef struct -{ - mbedtls_cipher_type_t type; - const mbedtls_cipher_info_t *info; -} mbedtls_cipher_definition_t; - -extern const mbedtls_cipher_definition_t mbedtls_cipher_definitions[]; - -extern int mbedtls_cipher_supported[]; - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_CIPHER_WRAP_H */ diff --git a/tools/sdk/include/mbedtls/mbedtls/cmac.h b/tools/sdk/include/mbedtls/mbedtls/cmac.h deleted file mode 100644 index a4fd5525655..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/cmac.h +++ /dev/null @@ -1,206 +0,0 @@ -/** - * \file cmac.h - * - * \brief This file contains CMAC definitions and functions. - * - * The Cipher-based Message Authentication Code (CMAC) Mode for - * Authentication is defined in RFC-4493: The AES-CMAC Algorithm. - */ -/* - * Copyright (C) 2015-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_CMAC_H -#define MBEDTLS_CMAC_H - -#include "cipher.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define MBEDTLS_ERR_CMAC_HW_ACCEL_FAILED -0x007A /**< CMAC hardware accelerator failed. */ - -#define MBEDTLS_AES_BLOCK_SIZE 16 -#define MBEDTLS_DES3_BLOCK_SIZE 8 - -#if defined(MBEDTLS_AES_C) -#define MBEDTLS_CIPHER_BLKSIZE_MAX 16 /**< The longest block used by CMAC is that of AES. */ -#else -#define MBEDTLS_CIPHER_BLKSIZE_MAX 8 /**< The longest block used by CMAC is that of 3DES. */ -#endif - -#if !defined(MBEDTLS_CMAC_ALT) - -/** - * The CMAC context structure. - */ -struct mbedtls_cmac_context_t -{ - /** The internal state of the CMAC algorithm. */ - unsigned char state[MBEDTLS_CIPHER_BLKSIZE_MAX]; - - /** Unprocessed data - either data that was not block aligned and is still - * pending processing, or the final block. */ - unsigned char unprocessed_block[MBEDTLS_CIPHER_BLKSIZE_MAX]; - - /** The length of data pending processing. */ - size_t unprocessed_len; -}; - -#else /* !MBEDTLS_CMAC_ALT */ -#include "cmac_alt.h" -#endif /* !MBEDTLS_CMAC_ALT */ - -/** - * \brief This function sets the CMAC key, and prepares to authenticate - * the input data. - * Must be called with an initialized cipher context. - * - * \param ctx The cipher context used for the CMAC operation, initialized - * as one of the following types: MBEDTLS_CIPHER_AES_128_ECB, - * MBEDTLS_CIPHER_AES_192_ECB, MBEDTLS_CIPHER_AES_256_ECB, - * or MBEDTLS_CIPHER_DES_EDE3_ECB. - * \param key The CMAC key. - * \param keybits The length of the CMAC key in bits. - * Must be supported by the cipher. - * - * \return \c 0 on success. - * \return A cipher-specific error code on failure. - */ -int mbedtls_cipher_cmac_starts( mbedtls_cipher_context_t *ctx, - const unsigned char *key, size_t keybits ); - -/** - * \brief This function feeds an input buffer into an ongoing CMAC - * computation. - * - * It is called between mbedtls_cipher_cmac_starts() or - * mbedtls_cipher_cmac_reset(), and mbedtls_cipher_cmac_finish(). - * Can be called repeatedly. - * - * \param ctx The cipher context used for the CMAC operation. - * \param input The buffer holding the input data. - * \param ilen The length of the input data. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA - * if parameter verification fails. - */ -int mbedtls_cipher_cmac_update( mbedtls_cipher_context_t *ctx, - const unsigned char *input, size_t ilen ); - -/** - * \brief This function finishes the CMAC operation, and writes - * the result to the output buffer. - * - * It is called after mbedtls_cipher_cmac_update(). - * It can be followed by mbedtls_cipher_cmac_reset() and - * mbedtls_cipher_cmac_update(), or mbedtls_cipher_free(). - * - * \param ctx The cipher context used for the CMAC operation. - * \param output The output buffer for the CMAC checksum result. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA - * if parameter verification fails. - */ -int mbedtls_cipher_cmac_finish( mbedtls_cipher_context_t *ctx, - unsigned char *output ); - -/** - * \brief This function prepares the authentication of another - * message with the same key as the previous CMAC - * operation. - * - * It is called after mbedtls_cipher_cmac_finish() - * and before mbedtls_cipher_cmac_update(). - * - * \param ctx The cipher context used for the CMAC operation. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA - * if parameter verification fails. - */ -int mbedtls_cipher_cmac_reset( mbedtls_cipher_context_t *ctx ); - -/** - * \brief This function calculates the full generic CMAC - * on the input buffer with the provided key. - * - * The function allocates the context, performs the - * calculation, and frees the context. - * - * The CMAC result is calculated as - * output = generic CMAC(cmac key, input buffer). - * - * - * \param cipher_info The cipher information. - * \param key The CMAC key. - * \param keylen The length of the CMAC key in bits. - * \param input The buffer holding the input data. - * \param ilen The length of the input data. - * \param output The buffer for the generic CMAC result. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA - * if parameter verification fails. - */ -int mbedtls_cipher_cmac( const mbedtls_cipher_info_t *cipher_info, - const unsigned char *key, size_t keylen, - const unsigned char *input, size_t ilen, - unsigned char *output ); - -#if defined(MBEDTLS_AES_C) -/** - * \brief This function implements the AES-CMAC-PRF-128 pseudorandom - * function, as defined in - * RFC-4615: The Advanced Encryption Standard-Cipher-based - * Message Authentication Code-Pseudo-Random Function-128 - * (AES-CMAC-PRF-128) Algorithm for the Internet Key - * Exchange Protocol (IKE). - * - * \param key The key to use. - * \param key_len The key length in Bytes. - * \param input The buffer holding the input data. - * \param in_len The length of the input data in Bytes. - * \param output The buffer holding the generated 16 Bytes of - * pseudorandom output. - * - * \return \c 0 on success. - */ -int mbedtls_aes_cmac_prf_128( const unsigned char *key, size_t key_len, - const unsigned char *input, size_t in_len, - unsigned char output[16] ); -#endif /* MBEDTLS_AES_C */ - -#if defined(MBEDTLS_SELF_TEST) && ( defined(MBEDTLS_AES_C) || defined(MBEDTLS_DES_C) ) -/** - * \brief The CMAC checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_cmac_self_test( int verbose ); -#endif /* MBEDTLS_SELF_TEST && ( MBEDTLS_AES_C || MBEDTLS_DES_C ) */ - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_CMAC_H */ diff --git a/tools/sdk/include/mbedtls/mbedtls/compat-1.3.h b/tools/sdk/include/mbedtls/mbedtls/compat-1.3.h deleted file mode 100644 index 213b6914035..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/compat-1.3.h +++ /dev/null @@ -1,2525 +0,0 @@ -/** - * \file compat-1.3.h - * - * \brief Compatibility definitions for using mbed TLS with client code written - * for the PolarSSL naming conventions. - * - * \deprecated Use the new names directly instead - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ - -#if ! defined(MBEDTLS_DEPRECATED_REMOVED) - -#if defined(MBEDTLS_DEPRECATED_WARNING) -#warning "Including compat-1.3.h is deprecated" -#endif - -#ifndef MBEDTLS_COMPAT13_H -#define MBEDTLS_COMPAT13_H - -/* - * config.h options - */ -#if defined MBEDTLS_AESNI_C -#define POLARSSL_AESNI_C MBEDTLS_AESNI_C -#endif -#if defined MBEDTLS_AES_ALT -#define POLARSSL_AES_ALT MBEDTLS_AES_ALT -#endif -#if defined MBEDTLS_AES_C -#define POLARSSL_AES_C MBEDTLS_AES_C -#endif -#if defined MBEDTLS_AES_ROM_TABLES -#define POLARSSL_AES_ROM_TABLES MBEDTLS_AES_ROM_TABLES -#endif -#if defined MBEDTLS_ARC4_ALT -#define POLARSSL_ARC4_ALT MBEDTLS_ARC4_ALT -#endif -#if defined MBEDTLS_ARC4_C -#define POLARSSL_ARC4_C MBEDTLS_ARC4_C -#endif -#if defined MBEDTLS_ASN1_PARSE_C -#define POLARSSL_ASN1_PARSE_C MBEDTLS_ASN1_PARSE_C -#endif -#if defined MBEDTLS_ASN1_WRITE_C -#define POLARSSL_ASN1_WRITE_C MBEDTLS_ASN1_WRITE_C -#endif -#if defined MBEDTLS_BASE64_C -#define POLARSSL_BASE64_C MBEDTLS_BASE64_C -#endif -#if defined MBEDTLS_BIGNUM_C -#define POLARSSL_BIGNUM_C MBEDTLS_BIGNUM_C -#endif -#if defined MBEDTLS_BLOWFISH_ALT -#define POLARSSL_BLOWFISH_ALT MBEDTLS_BLOWFISH_ALT -#endif -#if defined MBEDTLS_BLOWFISH_C -#define POLARSSL_BLOWFISH_C MBEDTLS_BLOWFISH_C -#endif -#if defined MBEDTLS_CAMELLIA_ALT -#define POLARSSL_CAMELLIA_ALT MBEDTLS_CAMELLIA_ALT -#endif -#if defined MBEDTLS_CAMELLIA_C -#define POLARSSL_CAMELLIA_C MBEDTLS_CAMELLIA_C -#endif -#if defined MBEDTLS_CAMELLIA_SMALL_MEMORY -#define POLARSSL_CAMELLIA_SMALL_MEMORY MBEDTLS_CAMELLIA_SMALL_MEMORY -#endif -#if defined MBEDTLS_CCM_C -#define POLARSSL_CCM_C MBEDTLS_CCM_C -#endif -#if defined MBEDTLS_CERTS_C -#define POLARSSL_CERTS_C MBEDTLS_CERTS_C -#endif -#if defined MBEDTLS_CIPHER_C -#define POLARSSL_CIPHER_C MBEDTLS_CIPHER_C -#endif -#if defined MBEDTLS_CIPHER_MODE_CBC -#define POLARSSL_CIPHER_MODE_CBC MBEDTLS_CIPHER_MODE_CBC -#endif -#if defined MBEDTLS_CIPHER_MODE_CFB -#define POLARSSL_CIPHER_MODE_CFB MBEDTLS_CIPHER_MODE_CFB -#endif -#if defined MBEDTLS_CIPHER_MODE_CTR -#define POLARSSL_CIPHER_MODE_CTR MBEDTLS_CIPHER_MODE_CTR -#endif -#if defined MBEDTLS_CIPHER_NULL_CIPHER -#define POLARSSL_CIPHER_NULL_CIPHER MBEDTLS_CIPHER_NULL_CIPHER -#endif -#if defined MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS -#define POLARSSL_CIPHER_PADDING_ONE_AND_ZEROS MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS -#endif -#if defined MBEDTLS_CIPHER_PADDING_PKCS7 -#define POLARSSL_CIPHER_PADDING_PKCS7 MBEDTLS_CIPHER_PADDING_PKCS7 -#endif -#if defined MBEDTLS_CIPHER_PADDING_ZEROS -#define POLARSSL_CIPHER_PADDING_ZEROS MBEDTLS_CIPHER_PADDING_ZEROS -#endif -#if defined MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN -#define POLARSSL_CIPHER_PADDING_ZEROS_AND_LEN MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN -#endif -#if defined MBEDTLS_CTR_DRBG_C -#define POLARSSL_CTR_DRBG_C MBEDTLS_CTR_DRBG_C -#endif -#if defined MBEDTLS_DEBUG_C -#define POLARSSL_DEBUG_C MBEDTLS_DEBUG_C -#endif -#if defined MBEDTLS_DEPRECATED_REMOVED -#define POLARSSL_DEPRECATED_REMOVED MBEDTLS_DEPRECATED_REMOVED -#endif -#if defined MBEDTLS_DEPRECATED_WARNING -#define POLARSSL_DEPRECATED_WARNING MBEDTLS_DEPRECATED_WARNING -#endif -#if defined MBEDTLS_DES_ALT -#define POLARSSL_DES_ALT MBEDTLS_DES_ALT -#endif -#if defined MBEDTLS_DES_C -#define POLARSSL_DES_C MBEDTLS_DES_C -#endif -#if defined MBEDTLS_DHM_C -#define POLARSSL_DHM_C MBEDTLS_DHM_C -#endif -#if defined MBEDTLS_ECDH_C -#define POLARSSL_ECDH_C MBEDTLS_ECDH_C -#endif -#if defined MBEDTLS_ECDSA_C -#define POLARSSL_ECDSA_C MBEDTLS_ECDSA_C -#endif -#if defined MBEDTLS_ECDSA_DETERMINISTIC -#define POLARSSL_ECDSA_DETERMINISTIC MBEDTLS_ECDSA_DETERMINISTIC -#endif -#if defined MBEDTLS_ECP_C -#define POLARSSL_ECP_C MBEDTLS_ECP_C -#endif -#if defined MBEDTLS_ECP_DP_BP256R1_ENABLED -#define POLARSSL_ECP_DP_BP256R1_ENABLED MBEDTLS_ECP_DP_BP256R1_ENABLED -#endif -#if defined MBEDTLS_ECP_DP_BP384R1_ENABLED -#define POLARSSL_ECP_DP_BP384R1_ENABLED MBEDTLS_ECP_DP_BP384R1_ENABLED -#endif -#if defined MBEDTLS_ECP_DP_BP512R1_ENABLED -#define POLARSSL_ECP_DP_BP512R1_ENABLED MBEDTLS_ECP_DP_BP512R1_ENABLED -#endif -#if defined MBEDTLS_ECP_DP_CURVE25519_ENABLED -#define POLARSSL_ECP_DP_M255_ENABLED MBEDTLS_ECP_DP_CURVE25519_ENABLED -#endif -#if defined MBEDTLS_ECP_DP_SECP192K1_ENABLED -#define POLARSSL_ECP_DP_SECP192K1_ENABLED MBEDTLS_ECP_DP_SECP192K1_ENABLED -#endif -#if defined MBEDTLS_ECP_DP_SECP192R1_ENABLED -#define POLARSSL_ECP_DP_SECP192R1_ENABLED MBEDTLS_ECP_DP_SECP192R1_ENABLED -#endif -#if defined MBEDTLS_ECP_DP_SECP224K1_ENABLED -#define POLARSSL_ECP_DP_SECP224K1_ENABLED MBEDTLS_ECP_DP_SECP224K1_ENABLED -#endif -#if defined MBEDTLS_ECP_DP_SECP224R1_ENABLED -#define POLARSSL_ECP_DP_SECP224R1_ENABLED MBEDTLS_ECP_DP_SECP224R1_ENABLED -#endif -#if defined MBEDTLS_ECP_DP_SECP256K1_ENABLED -#define POLARSSL_ECP_DP_SECP256K1_ENABLED MBEDTLS_ECP_DP_SECP256K1_ENABLED -#endif -#if defined MBEDTLS_ECP_DP_SECP256R1_ENABLED -#define POLARSSL_ECP_DP_SECP256R1_ENABLED MBEDTLS_ECP_DP_SECP256R1_ENABLED -#endif -#if defined MBEDTLS_ECP_DP_SECP384R1_ENABLED -#define POLARSSL_ECP_DP_SECP384R1_ENABLED MBEDTLS_ECP_DP_SECP384R1_ENABLED -#endif -#if defined MBEDTLS_ECP_DP_SECP521R1_ENABLED -#define POLARSSL_ECP_DP_SECP521R1_ENABLED MBEDTLS_ECP_DP_SECP521R1_ENABLED -#endif -#if defined MBEDTLS_ECP_FIXED_POINT_OPTIM -#define POLARSSL_ECP_FIXED_POINT_OPTIM MBEDTLS_ECP_FIXED_POINT_OPTIM -#endif -#if defined MBEDTLS_ECP_MAX_BITS -#define POLARSSL_ECP_MAX_BITS MBEDTLS_ECP_MAX_BITS -#endif -#if defined MBEDTLS_ECP_NIST_OPTIM -#define POLARSSL_ECP_NIST_OPTIM MBEDTLS_ECP_NIST_OPTIM -#endif -#if defined MBEDTLS_ECP_WINDOW_SIZE -#define POLARSSL_ECP_WINDOW_SIZE MBEDTLS_ECP_WINDOW_SIZE -#endif -#if defined MBEDTLS_ENABLE_WEAK_CIPHERSUITES -#define POLARSSL_ENABLE_WEAK_CIPHERSUITES MBEDTLS_ENABLE_WEAK_CIPHERSUITES -#endif -#if defined MBEDTLS_ENTROPY_C -#define POLARSSL_ENTROPY_C MBEDTLS_ENTROPY_C -#endif -#if defined MBEDTLS_ENTROPY_FORCE_SHA256 -#define POLARSSL_ENTROPY_FORCE_SHA256 MBEDTLS_ENTROPY_FORCE_SHA256 -#endif -#if defined MBEDTLS_ERROR_C -#define POLARSSL_ERROR_C MBEDTLS_ERROR_C -#endif -#if defined MBEDTLS_ERROR_STRERROR_DUMMY -#define POLARSSL_ERROR_STRERROR_DUMMY MBEDTLS_ERROR_STRERROR_DUMMY -#endif -#if defined MBEDTLS_FS_IO -#define POLARSSL_FS_IO MBEDTLS_FS_IO -#endif -#if defined MBEDTLS_GCM_C -#define POLARSSL_GCM_C MBEDTLS_GCM_C -#endif -#if defined MBEDTLS_GENPRIME -#define POLARSSL_GENPRIME MBEDTLS_GENPRIME -#endif -#if defined MBEDTLS_HAVEGE_C -#define POLARSSL_HAVEGE_C MBEDTLS_HAVEGE_C -#endif -#if defined MBEDTLS_HAVE_ASM -#define POLARSSL_HAVE_ASM MBEDTLS_HAVE_ASM -#endif -#if defined MBEDTLS_HAVE_SSE2 -#define POLARSSL_HAVE_SSE2 MBEDTLS_HAVE_SSE2 -#endif -#if defined MBEDTLS_HAVE_TIME -#define POLARSSL_HAVE_TIME MBEDTLS_HAVE_TIME -#endif -#if defined MBEDTLS_HMAC_DRBG_C -#define POLARSSL_HMAC_DRBG_C MBEDTLS_HMAC_DRBG_C -#endif -#if defined MBEDTLS_HMAC_DRBG_MAX_INPUT -#define POLARSSL_HMAC_DRBG_MAX_INPUT MBEDTLS_HMAC_DRBG_MAX_INPUT -#endif -#if defined MBEDTLS_HMAC_DRBG_MAX_REQUEST -#define POLARSSL_HMAC_DRBG_MAX_REQUEST MBEDTLS_HMAC_DRBG_MAX_REQUEST -#endif -#if defined MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT -#define POLARSSL_HMAC_DRBG_MAX_SEED_INPUT MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT -#endif -#if defined MBEDTLS_HMAC_DRBG_RESEED_INTERVAL -#define POLARSSL_HMAC_DRBG_RESEED_INTERVAL MBEDTLS_HMAC_DRBG_RESEED_INTERVAL -#endif -#if defined MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED -#define POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED -#endif -#if defined MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED -#define POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED -#endif -#if defined MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED -#define POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED -#endif -#if defined MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED -#define POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED -#endif -#if defined MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED -#define POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED -#endif -#if defined MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED -#define POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED -#endif -#if defined MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED -#define POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED -#endif -#if defined MBEDTLS_KEY_EXCHANGE_PSK_ENABLED -#define POLARSSL_KEY_EXCHANGE_PSK_ENABLED MBEDTLS_KEY_EXCHANGE_PSK_ENABLED -#endif -#if defined MBEDTLS_KEY_EXCHANGE_RSA_ENABLED -#define POLARSSL_KEY_EXCHANGE_RSA_ENABLED MBEDTLS_KEY_EXCHANGE_RSA_ENABLED -#endif -#if defined MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED -#define POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED -#endif -#if defined MBEDTLS_MD2_ALT -#define POLARSSL_MD2_ALT MBEDTLS_MD2_ALT -#endif -#if defined MBEDTLS_MD2_C -#define POLARSSL_MD2_C MBEDTLS_MD2_C -#endif -#if defined MBEDTLS_MD2_PROCESS_ALT -#define POLARSSL_MD2_PROCESS_ALT MBEDTLS_MD2_PROCESS_ALT -#endif -#if defined MBEDTLS_MD4_ALT -#define POLARSSL_MD4_ALT MBEDTLS_MD4_ALT -#endif -#if defined MBEDTLS_MD4_C -#define POLARSSL_MD4_C MBEDTLS_MD4_C -#endif -#if defined MBEDTLS_MD4_PROCESS_ALT -#define POLARSSL_MD4_PROCESS_ALT MBEDTLS_MD4_PROCESS_ALT -#endif -#if defined MBEDTLS_MD5_ALT -#define POLARSSL_MD5_ALT MBEDTLS_MD5_ALT -#endif -#if defined MBEDTLS_MD5_C -#define POLARSSL_MD5_C MBEDTLS_MD5_C -#endif -#if defined MBEDTLS_MD5_PROCESS_ALT -#define POLARSSL_MD5_PROCESS_ALT MBEDTLS_MD5_PROCESS_ALT -#endif -#if defined MBEDTLS_MD_C -#define POLARSSL_MD_C MBEDTLS_MD_C -#endif -#if defined MBEDTLS_MEMORY_ALIGN_MULTIPLE -#define POLARSSL_MEMORY_ALIGN_MULTIPLE MBEDTLS_MEMORY_ALIGN_MULTIPLE -#endif -#if defined MBEDTLS_MEMORY_BACKTRACE -#define POLARSSL_MEMORY_BACKTRACE MBEDTLS_MEMORY_BACKTRACE -#endif -#if defined MBEDTLS_MEMORY_BUFFER_ALLOC_C -#define POLARSSL_MEMORY_BUFFER_ALLOC_C MBEDTLS_MEMORY_BUFFER_ALLOC_C -#endif -#if defined MBEDTLS_MEMORY_DEBUG -#define POLARSSL_MEMORY_DEBUG MBEDTLS_MEMORY_DEBUG -#endif -#if defined MBEDTLS_MPI_MAX_SIZE -#define POLARSSL_MPI_MAX_SIZE MBEDTLS_MPI_MAX_SIZE -#endif -#if defined MBEDTLS_MPI_WINDOW_SIZE -#define POLARSSL_MPI_WINDOW_SIZE MBEDTLS_MPI_WINDOW_SIZE -#endif -#if defined MBEDTLS_NET_C -#define POLARSSL_NET_C MBEDTLS_NET_C -#endif -#if defined MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES -#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES -#endif -#if defined MBEDTLS_NO_PLATFORM_ENTROPY -#define POLARSSL_NO_PLATFORM_ENTROPY MBEDTLS_NO_PLATFORM_ENTROPY -#endif -#if defined MBEDTLS_OID_C -#define POLARSSL_OID_C MBEDTLS_OID_C -#endif -#if defined MBEDTLS_PADLOCK_C -#define POLARSSL_PADLOCK_C MBEDTLS_PADLOCK_C -#endif -#if defined MBEDTLS_PEM_PARSE_C -#define POLARSSL_PEM_PARSE_C MBEDTLS_PEM_PARSE_C -#endif -#if defined MBEDTLS_PEM_WRITE_C -#define POLARSSL_PEM_WRITE_C MBEDTLS_PEM_WRITE_C -#endif -#if defined MBEDTLS_PKCS11_C -#define POLARSSL_PKCS11_C MBEDTLS_PKCS11_C -#endif -#if defined MBEDTLS_PKCS12_C -#define POLARSSL_PKCS12_C MBEDTLS_PKCS12_C -#endif -#if defined MBEDTLS_PKCS1_V15 -#define POLARSSL_PKCS1_V15 MBEDTLS_PKCS1_V15 -#endif -#if defined MBEDTLS_PKCS1_V21 -#define POLARSSL_PKCS1_V21 MBEDTLS_PKCS1_V21 -#endif -#if defined MBEDTLS_PKCS5_C -#define POLARSSL_PKCS5_C MBEDTLS_PKCS5_C -#endif -#if defined MBEDTLS_PK_C -#define POLARSSL_PK_C MBEDTLS_PK_C -#endif -#if defined MBEDTLS_PK_PARSE_C -#define POLARSSL_PK_PARSE_C MBEDTLS_PK_PARSE_C -#endif -#if defined MBEDTLS_PK_PARSE_EC_EXTENDED -#define POLARSSL_PK_PARSE_EC_EXTENDED MBEDTLS_PK_PARSE_EC_EXTENDED -#endif -#if defined MBEDTLS_PK_RSA_ALT_SUPPORT -#define POLARSSL_PK_RSA_ALT_SUPPORT MBEDTLS_PK_RSA_ALT_SUPPORT -#endif -#if defined MBEDTLS_PK_WRITE_C -#define POLARSSL_PK_WRITE_C MBEDTLS_PK_WRITE_C -#endif -#if defined MBEDTLS_PLATFORM_C -#define POLARSSL_PLATFORM_C MBEDTLS_PLATFORM_C -#endif -#if defined MBEDTLS_PLATFORM_EXIT_ALT -#define POLARSSL_PLATFORM_EXIT_ALT MBEDTLS_PLATFORM_EXIT_ALT -#endif -#if defined MBEDTLS_PLATFORM_EXIT_MACRO -#define POLARSSL_PLATFORM_EXIT_MACRO MBEDTLS_PLATFORM_EXIT_MACRO -#endif -#if defined MBEDTLS_PLATFORM_FPRINTF_ALT -#define POLARSSL_PLATFORM_FPRINTF_ALT MBEDTLS_PLATFORM_FPRINTF_ALT -#endif -#if defined MBEDTLS_PLATFORM_FPRINTF_MACRO -#define POLARSSL_PLATFORM_FPRINTF_MACRO MBEDTLS_PLATFORM_FPRINTF_MACRO -#endif -#if defined MBEDTLS_PLATFORM_FREE_MACRO -#define POLARSSL_PLATFORM_FREE_MACRO MBEDTLS_PLATFORM_FREE_MACRO -#endif -#if defined MBEDTLS_PLATFORM_MEMORY -#define POLARSSL_PLATFORM_MEMORY MBEDTLS_PLATFORM_MEMORY -#endif -#if defined MBEDTLS_PLATFORM_NO_STD_FUNCTIONS -#define POLARSSL_PLATFORM_NO_STD_FUNCTIONS MBEDTLS_PLATFORM_NO_STD_FUNCTIONS -#endif -#if defined MBEDTLS_PLATFORM_PRINTF_ALT -#define POLARSSL_PLATFORM_PRINTF_ALT MBEDTLS_PLATFORM_PRINTF_ALT -#endif -#if defined MBEDTLS_PLATFORM_PRINTF_MACRO -#define POLARSSL_PLATFORM_PRINTF_MACRO MBEDTLS_PLATFORM_PRINTF_MACRO -#endif -#if defined MBEDTLS_PLATFORM_SNPRINTF_ALT -#define POLARSSL_PLATFORM_SNPRINTF_ALT MBEDTLS_PLATFORM_SNPRINTF_ALT -#endif -#if defined MBEDTLS_PLATFORM_SNPRINTF_MACRO -#define POLARSSL_PLATFORM_SNPRINTF_MACRO MBEDTLS_PLATFORM_SNPRINTF_MACRO -#endif -#if defined MBEDTLS_PLATFORM_STD_EXIT -#define POLARSSL_PLATFORM_STD_EXIT MBEDTLS_PLATFORM_STD_EXIT -#endif -#if defined MBEDTLS_PLATFORM_STD_FPRINTF -#define POLARSSL_PLATFORM_STD_FPRINTF MBEDTLS_PLATFORM_STD_FPRINTF -#endif -#if defined MBEDTLS_PLATFORM_STD_FREE -#define POLARSSL_PLATFORM_STD_FREE MBEDTLS_PLATFORM_STD_FREE -#endif -#if defined MBEDTLS_PLATFORM_STD_MEM_HDR -#define POLARSSL_PLATFORM_STD_MEM_HDR MBEDTLS_PLATFORM_STD_MEM_HDR -#endif -#if defined MBEDTLS_PLATFORM_STD_PRINTF -#define POLARSSL_PLATFORM_STD_PRINTF MBEDTLS_PLATFORM_STD_PRINTF -#endif -#if defined MBEDTLS_PLATFORM_STD_SNPRINTF -#define POLARSSL_PLATFORM_STD_SNPRINTF MBEDTLS_PLATFORM_STD_SNPRINTF -#endif -#if defined MBEDTLS_PSK_MAX_LEN -#define POLARSSL_PSK_MAX_LEN MBEDTLS_PSK_MAX_LEN -#endif -#if defined MBEDTLS_REMOVE_ARC4_CIPHERSUITES -#define POLARSSL_REMOVE_ARC4_CIPHERSUITES MBEDTLS_REMOVE_ARC4_CIPHERSUITES -#endif -#if defined MBEDTLS_RIPEMD160_ALT -#define POLARSSL_RIPEMD160_ALT MBEDTLS_RIPEMD160_ALT -#endif -#if defined MBEDTLS_RIPEMD160_C -#define POLARSSL_RIPEMD160_C MBEDTLS_RIPEMD160_C -#endif -#if defined MBEDTLS_RIPEMD160_PROCESS_ALT -#define POLARSSL_RIPEMD160_PROCESS_ALT MBEDTLS_RIPEMD160_PROCESS_ALT -#endif -#if defined MBEDTLS_RSA_C -#define POLARSSL_RSA_C MBEDTLS_RSA_C -#endif -#if defined MBEDTLS_RSA_NO_CRT -#define POLARSSL_RSA_NO_CRT MBEDTLS_RSA_NO_CRT -#endif -#if defined MBEDTLS_SELF_TEST -#define POLARSSL_SELF_TEST MBEDTLS_SELF_TEST -#endif -#if defined MBEDTLS_SHA1_ALT -#define POLARSSL_SHA1_ALT MBEDTLS_SHA1_ALT -#endif -#if defined MBEDTLS_SHA1_C -#define POLARSSL_SHA1_C MBEDTLS_SHA1_C -#endif -#if defined MBEDTLS_SHA1_PROCESS_ALT -#define POLARSSL_SHA1_PROCESS_ALT MBEDTLS_SHA1_PROCESS_ALT -#endif -#if defined MBEDTLS_SHA256_ALT -#define POLARSSL_SHA256_ALT MBEDTLS_SHA256_ALT -#endif -#if defined MBEDTLS_SHA256_C -#define POLARSSL_SHA256_C MBEDTLS_SHA256_C -#endif -#if defined MBEDTLS_SHA256_PROCESS_ALT -#define POLARSSL_SHA256_PROCESS_ALT MBEDTLS_SHA256_PROCESS_ALT -#endif -#if defined MBEDTLS_SHA512_ALT -#define POLARSSL_SHA512_ALT MBEDTLS_SHA512_ALT -#endif -#if defined MBEDTLS_SHA512_C -#define POLARSSL_SHA512_C MBEDTLS_SHA512_C -#endif -#if defined MBEDTLS_SHA512_PROCESS_ALT -#define POLARSSL_SHA512_PROCESS_ALT MBEDTLS_SHA512_PROCESS_ALT -#endif -#if defined MBEDTLS_SSL_ALL_ALERT_MESSAGES -#define POLARSSL_SSL_ALL_ALERT_MESSAGES MBEDTLS_SSL_ALL_ALERT_MESSAGES -#endif -#if defined MBEDTLS_SSL_ALPN -#define POLARSSL_SSL_ALPN MBEDTLS_SSL_ALPN -#endif -#if defined MBEDTLS_SSL_CACHE_C -#define POLARSSL_SSL_CACHE_C MBEDTLS_SSL_CACHE_C -#endif -#if defined MBEDTLS_SSL_CBC_RECORD_SPLITTING -#define POLARSSL_SSL_CBC_RECORD_SPLITTING MBEDTLS_SSL_CBC_RECORD_SPLITTING -#endif -#if defined MBEDTLS_SSL_CLI_C -#define POLARSSL_SSL_CLI_C MBEDTLS_SSL_CLI_C -#endif -#if defined MBEDTLS_SSL_COOKIE_C -#define POLARSSL_SSL_COOKIE_C MBEDTLS_SSL_COOKIE_C -#endif -#if defined MBEDTLS_SSL_COOKIE_TIMEOUT -#define POLARSSL_SSL_COOKIE_TIMEOUT MBEDTLS_SSL_COOKIE_TIMEOUT -#endif -#if defined MBEDTLS_SSL_DEBUG_ALL -#define POLARSSL_SSL_DEBUG_ALL MBEDTLS_SSL_DEBUG_ALL -#endif -#if defined MBEDTLS_SSL_DTLS_ANTI_REPLAY -#define POLARSSL_SSL_DTLS_ANTI_REPLAY MBEDTLS_SSL_DTLS_ANTI_REPLAY -#endif -#if defined MBEDTLS_SSL_DTLS_BADMAC_LIMIT -#define POLARSSL_SSL_DTLS_BADMAC_LIMIT MBEDTLS_SSL_DTLS_BADMAC_LIMIT -#endif -#if defined MBEDTLS_SSL_DTLS_HELLO_VERIFY -#define POLARSSL_SSL_DTLS_HELLO_VERIFY MBEDTLS_SSL_DTLS_HELLO_VERIFY -#endif -#if defined MBEDTLS_SSL_ENCRYPT_THEN_MAC -#define POLARSSL_SSL_ENCRYPT_THEN_MAC MBEDTLS_SSL_ENCRYPT_THEN_MAC -#endif -#if defined MBEDTLS_SSL_EXTENDED_MASTER_SECRET -#define POLARSSL_SSL_EXTENDED_MASTER_SECRET MBEDTLS_SSL_EXTENDED_MASTER_SECRET -#endif -#if defined MBEDTLS_SSL_FALLBACK_SCSV -#define POLARSSL_SSL_FALLBACK_SCSV MBEDTLS_SSL_FALLBACK_SCSV -#endif -#if defined MBEDTLS_SSL_HW_RECORD_ACCEL -#define POLARSSL_SSL_HW_RECORD_ACCEL MBEDTLS_SSL_HW_RECORD_ACCEL -#endif -#if defined MBEDTLS_SSL_MAX_FRAGMENT_LENGTH -#define POLARSSL_SSL_MAX_FRAGMENT_LENGTH MBEDTLS_SSL_MAX_FRAGMENT_LENGTH -#endif -#if defined MBEDTLS_SSL_PROTO_DTLS -#define POLARSSL_SSL_PROTO_DTLS MBEDTLS_SSL_PROTO_DTLS -#endif -#if defined MBEDTLS_SSL_PROTO_SSL3 -#define POLARSSL_SSL_PROTO_SSL3 MBEDTLS_SSL_PROTO_SSL3 -#endif -#if defined MBEDTLS_SSL_PROTO_TLS1 -#define POLARSSL_SSL_PROTO_TLS1 MBEDTLS_SSL_PROTO_TLS1 -#endif -#if defined MBEDTLS_SSL_PROTO_TLS1_1 -#define POLARSSL_SSL_PROTO_TLS1_1 MBEDTLS_SSL_PROTO_TLS1_1 -#endif -#if defined MBEDTLS_SSL_PROTO_TLS1_2 -#define POLARSSL_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_2 -#endif -#if defined MBEDTLS_SSL_RENEGOTIATION -#define POLARSSL_SSL_RENEGOTIATION MBEDTLS_SSL_RENEGOTIATION -#endif -#if defined MBEDTLS_SSL_SERVER_NAME_INDICATION -#define POLARSSL_SSL_SERVER_NAME_INDICATION MBEDTLS_SSL_SERVER_NAME_INDICATION -#endif -#if defined MBEDTLS_SSL_SESSION_TICKETS -#define POLARSSL_SSL_SESSION_TICKETS MBEDTLS_SSL_SESSION_TICKETS -#endif -#if defined MBEDTLS_SSL_SRV_C -#define POLARSSL_SSL_SRV_C MBEDTLS_SSL_SRV_C -#endif -#if defined MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE -#define POLARSSL_SSL_SRV_RESPECT_CLIENT_PREFERENCE MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE -#endif -#if defined MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO -#define POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO -#endif -#if defined MBEDTLS_SSL_TLS_C -#define POLARSSL_SSL_TLS_C MBEDTLS_SSL_TLS_C -#endif -#if defined MBEDTLS_SSL_TRUNCATED_HMAC -#define POLARSSL_SSL_TRUNCATED_HMAC MBEDTLS_SSL_TRUNCATED_HMAC -#endif -#if defined MBEDTLS_THREADING_ALT -#define POLARSSL_THREADING_ALT MBEDTLS_THREADING_ALT -#endif -#if defined MBEDTLS_THREADING_C -#define POLARSSL_THREADING_C MBEDTLS_THREADING_C -#endif -#if defined MBEDTLS_THREADING_PTHREAD -#define POLARSSL_THREADING_PTHREAD MBEDTLS_THREADING_PTHREAD -#endif -#if defined MBEDTLS_TIMING_ALT -#define POLARSSL_TIMING_ALT MBEDTLS_TIMING_ALT -#endif -#if defined MBEDTLS_TIMING_C -#define POLARSSL_TIMING_C MBEDTLS_TIMING_C -#endif -#if defined MBEDTLS_VERSION_C -#define POLARSSL_VERSION_C MBEDTLS_VERSION_C -#endif -#if defined MBEDTLS_VERSION_FEATURES -#define POLARSSL_VERSION_FEATURES MBEDTLS_VERSION_FEATURES -#endif -#if defined MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 -#define POLARSSL_X509_ALLOW_EXTENSIONS_NON_V3 MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 -#endif -#if defined MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION -#define POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION -#endif -#if defined MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE -#define POLARSSL_X509_CHECK_EXTENDED_KEY_USAGE MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE -#endif -#if defined MBEDTLS_X509_CHECK_KEY_USAGE -#define POLARSSL_X509_CHECK_KEY_USAGE MBEDTLS_X509_CHECK_KEY_USAGE -#endif -#if defined MBEDTLS_X509_CREATE_C -#define POLARSSL_X509_CREATE_C MBEDTLS_X509_CREATE_C -#endif -#if defined MBEDTLS_X509_CRL_PARSE_C -#define POLARSSL_X509_CRL_PARSE_C MBEDTLS_X509_CRL_PARSE_C -#endif -#if defined MBEDTLS_X509_CRT_PARSE_C -#define POLARSSL_X509_CRT_PARSE_C MBEDTLS_X509_CRT_PARSE_C -#endif -#if defined MBEDTLS_X509_CRT_WRITE_C -#define POLARSSL_X509_CRT_WRITE_C MBEDTLS_X509_CRT_WRITE_C -#endif -#if defined MBEDTLS_X509_CSR_PARSE_C -#define POLARSSL_X509_CSR_PARSE_C MBEDTLS_X509_CSR_PARSE_C -#endif -#if defined MBEDTLS_X509_CSR_WRITE_C -#define POLARSSL_X509_CSR_WRITE_C MBEDTLS_X509_CSR_WRITE_C -#endif -#if defined MBEDTLS_X509_MAX_INTERMEDIATE_CA -#define POLARSSL_X509_MAX_INTERMEDIATE_CA MBEDTLS_X509_MAX_INTERMEDIATE_CA -#endif -#if defined MBEDTLS_X509_RSASSA_PSS_SUPPORT -#define POLARSSL_X509_RSASSA_PSS_SUPPORT MBEDTLS_X509_RSASSA_PSS_SUPPORT -#endif -#if defined MBEDTLS_X509_USE_C -#define POLARSSL_X509_USE_C MBEDTLS_X509_USE_C -#endif -#if defined MBEDTLS_XTEA_ALT -#define POLARSSL_XTEA_ALT MBEDTLS_XTEA_ALT -#endif -#if defined MBEDTLS_XTEA_C -#define POLARSSL_XTEA_C MBEDTLS_XTEA_C -#endif -#if defined MBEDTLS_ZLIB_SUPPORT -#define POLARSSL_ZLIB_SUPPORT MBEDTLS_ZLIB_SUPPORT -#endif - -/* - * Misc names (macros, types, functions, enum constants...) - */ -#define AES_DECRYPT MBEDTLS_AES_DECRYPT -#define AES_ENCRYPT MBEDTLS_AES_ENCRYPT -#define ASN1_BIT_STRING MBEDTLS_ASN1_BIT_STRING -#define ASN1_BMP_STRING MBEDTLS_ASN1_BMP_STRING -#define ASN1_BOOLEAN MBEDTLS_ASN1_BOOLEAN -#define ASN1_CHK_ADD MBEDTLS_ASN1_CHK_ADD -#define ASN1_CONSTRUCTED MBEDTLS_ASN1_CONSTRUCTED -#define ASN1_CONTEXT_SPECIFIC MBEDTLS_ASN1_CONTEXT_SPECIFIC -#define ASN1_GENERALIZED_TIME MBEDTLS_ASN1_GENERALIZED_TIME -#define ASN1_IA5_STRING MBEDTLS_ASN1_IA5_STRING -#define ASN1_INTEGER MBEDTLS_ASN1_INTEGER -#define ASN1_NULL MBEDTLS_ASN1_NULL -#define ASN1_OCTET_STRING MBEDTLS_ASN1_OCTET_STRING -#define ASN1_OID MBEDTLS_ASN1_OID -#define ASN1_PRIMITIVE MBEDTLS_ASN1_PRIMITIVE -#define ASN1_PRINTABLE_STRING MBEDTLS_ASN1_PRINTABLE_STRING -#define ASN1_SEQUENCE MBEDTLS_ASN1_SEQUENCE -#define ASN1_SET MBEDTLS_ASN1_SET -#define ASN1_T61_STRING MBEDTLS_ASN1_T61_STRING -#define ASN1_UNIVERSAL_STRING MBEDTLS_ASN1_UNIVERSAL_STRING -#define ASN1_UTC_TIME MBEDTLS_ASN1_UTC_TIME -#define ASN1_UTF8_STRING MBEDTLS_ASN1_UTF8_STRING -#define BADCERT_CN_MISMATCH MBEDTLS_X509_BADCERT_CN_MISMATCH -#define BADCERT_EXPIRED MBEDTLS_X509_BADCERT_EXPIRED -#define BADCERT_FUTURE MBEDTLS_X509_BADCERT_FUTURE -#define BADCERT_MISSING MBEDTLS_X509_BADCERT_MISSING -#define BADCERT_NOT_TRUSTED MBEDTLS_X509_BADCERT_NOT_TRUSTED -#define BADCERT_OTHER MBEDTLS_X509_BADCERT_OTHER -#define BADCERT_REVOKED MBEDTLS_X509_BADCERT_REVOKED -#define BADCERT_SKIP_VERIFY MBEDTLS_X509_BADCERT_SKIP_VERIFY -#define BADCRL_EXPIRED MBEDTLS_X509_BADCRL_EXPIRED -#define BADCRL_FUTURE MBEDTLS_X509_BADCRL_FUTURE -#define BADCRL_NOT_TRUSTED MBEDTLS_X509_BADCRL_NOT_TRUSTED -#define BLOWFISH_BLOCKSIZE MBEDTLS_BLOWFISH_BLOCKSIZE -#define BLOWFISH_DECRYPT MBEDTLS_BLOWFISH_DECRYPT -#define BLOWFISH_ENCRYPT MBEDTLS_BLOWFISH_ENCRYPT -#define BLOWFISH_MAX_KEY MBEDTLS_BLOWFISH_MAX_KEY_BITS -#define BLOWFISH_MIN_KEY MBEDTLS_BLOWFISH_MIN_KEY_BITS -#define BLOWFISH_ROUNDS MBEDTLS_BLOWFISH_ROUNDS -#define CAMELLIA_DECRYPT MBEDTLS_CAMELLIA_DECRYPT -#define CAMELLIA_ENCRYPT MBEDTLS_CAMELLIA_ENCRYPT -#define COLLECT_SIZE MBEDTLS_HAVEGE_COLLECT_SIZE -#define CTR_DRBG_BLOCKSIZE MBEDTLS_CTR_DRBG_BLOCKSIZE -#define CTR_DRBG_ENTROPY_LEN MBEDTLS_CTR_DRBG_ENTROPY_LEN -#define CTR_DRBG_KEYBITS MBEDTLS_CTR_DRBG_KEYBITS -#define CTR_DRBG_KEYSIZE MBEDTLS_CTR_DRBG_KEYSIZE -#define CTR_DRBG_MAX_INPUT MBEDTLS_CTR_DRBG_MAX_INPUT -#define CTR_DRBG_MAX_REQUEST MBEDTLS_CTR_DRBG_MAX_REQUEST -#define CTR_DRBG_MAX_SEED_INPUT MBEDTLS_CTR_DRBG_MAX_SEED_INPUT -#define CTR_DRBG_PR_OFF MBEDTLS_CTR_DRBG_PR_OFF -#define CTR_DRBG_PR_ON MBEDTLS_CTR_DRBG_PR_ON -#define CTR_DRBG_RESEED_INTERVAL MBEDTLS_CTR_DRBG_RESEED_INTERVAL -#define CTR_DRBG_SEEDLEN MBEDTLS_CTR_DRBG_SEEDLEN -#define DEPRECATED MBEDTLS_DEPRECATED -#define DES_DECRYPT MBEDTLS_DES_DECRYPT -#define DES_ENCRYPT MBEDTLS_DES_ENCRYPT -#define DES_KEY_SIZE MBEDTLS_DES_KEY_SIZE -#define ENTROPY_BLOCK_SIZE MBEDTLS_ENTROPY_BLOCK_SIZE -#define ENTROPY_MAX_GATHER MBEDTLS_ENTROPY_MAX_GATHER -#define ENTROPY_MAX_SEED_SIZE MBEDTLS_ENTROPY_MAX_SEED_SIZE -#define ENTROPY_MAX_SOURCES MBEDTLS_ENTROPY_MAX_SOURCES -#define ENTROPY_MIN_HARDCLOCK MBEDTLS_ENTROPY_MIN_HARDCLOCK -#define ENTROPY_MIN_HAVEGE MBEDTLS_ENTROPY_MIN_HAVEGE -#define ENTROPY_MIN_PLATFORM MBEDTLS_ENTROPY_MIN_PLATFORM -#define ENTROPY_SOURCE_MANUAL MBEDTLS_ENTROPY_SOURCE_MANUAL -#define EXT_AUTHORITY_KEY_IDENTIFIER MBEDTLS_X509_EXT_AUTHORITY_KEY_IDENTIFIER -#define EXT_BASIC_CONSTRAINTS MBEDTLS_X509_EXT_BASIC_CONSTRAINTS -#define EXT_CERTIFICATE_POLICIES MBEDTLS_X509_EXT_CERTIFICATE_POLICIES -#define EXT_CRL_DISTRIBUTION_POINTS MBEDTLS_X509_EXT_CRL_DISTRIBUTION_POINTS -#define EXT_EXTENDED_KEY_USAGE MBEDTLS_X509_EXT_EXTENDED_KEY_USAGE -#define EXT_FRESHEST_CRL MBEDTLS_X509_EXT_FRESHEST_CRL -#define EXT_INIHIBIT_ANYPOLICY MBEDTLS_X509_EXT_INIHIBIT_ANYPOLICY -#define EXT_ISSUER_ALT_NAME MBEDTLS_X509_EXT_ISSUER_ALT_NAME -#define EXT_KEY_USAGE MBEDTLS_X509_EXT_KEY_USAGE -#define EXT_NAME_CONSTRAINTS MBEDTLS_X509_EXT_NAME_CONSTRAINTS -#define EXT_NS_CERT_TYPE MBEDTLS_X509_EXT_NS_CERT_TYPE -#define EXT_POLICY_CONSTRAINTS MBEDTLS_X509_EXT_POLICY_CONSTRAINTS -#define EXT_POLICY_MAPPINGS MBEDTLS_X509_EXT_POLICY_MAPPINGS -#define EXT_SUBJECT_ALT_NAME MBEDTLS_X509_EXT_SUBJECT_ALT_NAME -#define EXT_SUBJECT_DIRECTORY_ATTRS MBEDTLS_X509_EXT_SUBJECT_DIRECTORY_ATTRS -#define EXT_SUBJECT_KEY_IDENTIFIER MBEDTLS_X509_EXT_SUBJECT_KEY_IDENTIFIER -#define GCM_DECRYPT MBEDTLS_GCM_DECRYPT -#define GCM_ENCRYPT MBEDTLS_GCM_ENCRYPT -#define KU_CRL_SIGN MBEDTLS_X509_KU_CRL_SIGN -#define KU_DATA_ENCIPHERMENT MBEDTLS_X509_KU_DATA_ENCIPHERMENT -#define KU_DIGITAL_SIGNATURE MBEDTLS_X509_KU_DIGITAL_SIGNATURE -#define KU_KEY_AGREEMENT MBEDTLS_X509_KU_KEY_AGREEMENT -#define KU_KEY_CERT_SIGN MBEDTLS_X509_KU_KEY_CERT_SIGN -#define KU_KEY_ENCIPHERMENT MBEDTLS_X509_KU_KEY_ENCIPHERMENT -#define KU_NON_REPUDIATION MBEDTLS_X509_KU_NON_REPUDIATION -#define LN_2_DIV_LN_10_SCALE100 MBEDTLS_LN_2_DIV_LN_10_SCALE100 -#define MEMORY_VERIFY_ALLOC MBEDTLS_MEMORY_VERIFY_ALLOC -#define MEMORY_VERIFY_ALWAYS MBEDTLS_MEMORY_VERIFY_ALWAYS -#define MEMORY_VERIFY_FREE MBEDTLS_MEMORY_VERIFY_FREE -#define MEMORY_VERIFY_NONE MBEDTLS_MEMORY_VERIFY_NONE -#define MPI_CHK MBEDTLS_MPI_CHK -#define NET_PROTO_TCP MBEDTLS_NET_PROTO_TCP -#define NET_PROTO_UDP MBEDTLS_NET_PROTO_UDP -#define NS_CERT_TYPE_EMAIL MBEDTLS_X509_NS_CERT_TYPE_EMAIL -#define NS_CERT_TYPE_EMAIL_CA MBEDTLS_X509_NS_CERT_TYPE_EMAIL_CA -#define NS_CERT_TYPE_OBJECT_SIGNING MBEDTLS_X509_NS_CERT_TYPE_OBJECT_SIGNING -#define NS_CERT_TYPE_OBJECT_SIGNING_CA MBEDTLS_X509_NS_CERT_TYPE_OBJECT_SIGNING_CA -#define NS_CERT_TYPE_RESERVED MBEDTLS_X509_NS_CERT_TYPE_RESERVED -#define NS_CERT_TYPE_SSL_CA MBEDTLS_X509_NS_CERT_TYPE_SSL_CA -#define NS_CERT_TYPE_SSL_CLIENT MBEDTLS_X509_NS_CERT_TYPE_SSL_CLIENT -#define NS_CERT_TYPE_SSL_SERVER MBEDTLS_X509_NS_CERT_TYPE_SSL_SERVER -#define OID_ANSI_X9_62 MBEDTLS_OID_ANSI_X9_62 -#define OID_ANSI_X9_62_FIELD_TYPE MBEDTLS_OID_ANSI_X9_62_FIELD_TYPE -#define OID_ANSI_X9_62_PRIME_FIELD MBEDTLS_OID_ANSI_X9_62_PRIME_FIELD -#define OID_ANSI_X9_62_SIG MBEDTLS_OID_ANSI_X9_62_SIG -#define OID_ANSI_X9_62_SIG_SHA2 MBEDTLS_OID_ANSI_X9_62_SIG_SHA2 -#define OID_ANY_EXTENDED_KEY_USAGE MBEDTLS_OID_ANY_EXTENDED_KEY_USAGE -#define OID_AT MBEDTLS_OID_AT -#define OID_AT_CN MBEDTLS_OID_AT_CN -#define OID_AT_COUNTRY MBEDTLS_OID_AT_COUNTRY -#define OID_AT_DN_QUALIFIER MBEDTLS_OID_AT_DN_QUALIFIER -#define OID_AT_GENERATION_QUALIFIER MBEDTLS_OID_AT_GENERATION_QUALIFIER -#define OID_AT_GIVEN_NAME MBEDTLS_OID_AT_GIVEN_NAME -#define OID_AT_INITIALS MBEDTLS_OID_AT_INITIALS -#define OID_AT_LOCALITY MBEDTLS_OID_AT_LOCALITY -#define OID_AT_ORGANIZATION MBEDTLS_OID_AT_ORGANIZATION -#define OID_AT_ORG_UNIT MBEDTLS_OID_AT_ORG_UNIT -#define OID_AT_POSTAL_ADDRESS MBEDTLS_OID_AT_POSTAL_ADDRESS -#define OID_AT_POSTAL_CODE MBEDTLS_OID_AT_POSTAL_CODE -#define OID_AT_PSEUDONYM MBEDTLS_OID_AT_PSEUDONYM -#define OID_AT_SERIAL_NUMBER MBEDTLS_OID_AT_SERIAL_NUMBER -#define OID_AT_STATE MBEDTLS_OID_AT_STATE -#define OID_AT_SUR_NAME MBEDTLS_OID_AT_SUR_NAME -#define OID_AT_TITLE MBEDTLS_OID_AT_TITLE -#define OID_AT_UNIQUE_IDENTIFIER MBEDTLS_OID_AT_UNIQUE_IDENTIFIER -#define OID_AUTHORITY_KEY_IDENTIFIER MBEDTLS_OID_AUTHORITY_KEY_IDENTIFIER -#define OID_BASIC_CONSTRAINTS MBEDTLS_OID_BASIC_CONSTRAINTS -#define OID_CERTICOM MBEDTLS_OID_CERTICOM -#define OID_CERTIFICATE_POLICIES MBEDTLS_OID_CERTIFICATE_POLICIES -#define OID_CLIENT_AUTH MBEDTLS_OID_CLIENT_AUTH -#define OID_CMP MBEDTLS_OID_CMP -#define OID_CODE_SIGNING MBEDTLS_OID_CODE_SIGNING -#define OID_COUNTRY_US MBEDTLS_OID_COUNTRY_US -#define OID_CRL_DISTRIBUTION_POINTS MBEDTLS_OID_CRL_DISTRIBUTION_POINTS -#define OID_CRL_NUMBER MBEDTLS_OID_CRL_NUMBER -#define OID_DES_CBC MBEDTLS_OID_DES_CBC -#define OID_DES_EDE3_CBC MBEDTLS_OID_DES_EDE3_CBC -#define OID_DIGEST_ALG_MD2 MBEDTLS_OID_DIGEST_ALG_MD2 -#define OID_DIGEST_ALG_MD4 MBEDTLS_OID_DIGEST_ALG_MD4 -#define OID_DIGEST_ALG_MD5 MBEDTLS_OID_DIGEST_ALG_MD5 -#define OID_DIGEST_ALG_SHA1 MBEDTLS_OID_DIGEST_ALG_SHA1 -#define OID_DIGEST_ALG_SHA224 MBEDTLS_OID_DIGEST_ALG_SHA224 -#define OID_DIGEST_ALG_SHA256 MBEDTLS_OID_DIGEST_ALG_SHA256 -#define OID_DIGEST_ALG_SHA384 MBEDTLS_OID_DIGEST_ALG_SHA384 -#define OID_DIGEST_ALG_SHA512 MBEDTLS_OID_DIGEST_ALG_SHA512 -#define OID_DOMAIN_COMPONENT MBEDTLS_OID_DOMAIN_COMPONENT -#define OID_ECDSA_SHA1 MBEDTLS_OID_ECDSA_SHA1 -#define OID_ECDSA_SHA224 MBEDTLS_OID_ECDSA_SHA224 -#define OID_ECDSA_SHA256 MBEDTLS_OID_ECDSA_SHA256 -#define OID_ECDSA_SHA384 MBEDTLS_OID_ECDSA_SHA384 -#define OID_ECDSA_SHA512 MBEDTLS_OID_ECDSA_SHA512 -#define OID_EC_ALG_ECDH MBEDTLS_OID_EC_ALG_ECDH -#define OID_EC_ALG_UNRESTRICTED MBEDTLS_OID_EC_ALG_UNRESTRICTED -#define OID_EC_BRAINPOOL_V1 MBEDTLS_OID_EC_BRAINPOOL_V1 -#define OID_EC_GRP_BP256R1 MBEDTLS_OID_EC_GRP_BP256R1 -#define OID_EC_GRP_BP384R1 MBEDTLS_OID_EC_GRP_BP384R1 -#define OID_EC_GRP_BP512R1 MBEDTLS_OID_EC_GRP_BP512R1 -#define OID_EC_GRP_SECP192K1 MBEDTLS_OID_EC_GRP_SECP192K1 -#define OID_EC_GRP_SECP192R1 MBEDTLS_OID_EC_GRP_SECP192R1 -#define OID_EC_GRP_SECP224K1 MBEDTLS_OID_EC_GRP_SECP224K1 -#define OID_EC_GRP_SECP224R1 MBEDTLS_OID_EC_GRP_SECP224R1 -#define OID_EC_GRP_SECP256K1 MBEDTLS_OID_EC_GRP_SECP256K1 -#define OID_EC_GRP_SECP256R1 MBEDTLS_OID_EC_GRP_SECP256R1 -#define OID_EC_GRP_SECP384R1 MBEDTLS_OID_EC_GRP_SECP384R1 -#define OID_EC_GRP_SECP521R1 MBEDTLS_OID_EC_GRP_SECP521R1 -#define OID_EMAIL_PROTECTION MBEDTLS_OID_EMAIL_PROTECTION -#define OID_EXTENDED_KEY_USAGE MBEDTLS_OID_EXTENDED_KEY_USAGE -#define OID_FRESHEST_CRL MBEDTLS_OID_FRESHEST_CRL -#define OID_GOV MBEDTLS_OID_GOV -#define OID_HMAC_SHA1 MBEDTLS_OID_HMAC_SHA1 -#define OID_ID_CE MBEDTLS_OID_ID_CE -#define OID_INIHIBIT_ANYPOLICY MBEDTLS_OID_INIHIBIT_ANYPOLICY -#define OID_ISO_CCITT_DS MBEDTLS_OID_ISO_CCITT_DS -#define OID_ISO_IDENTIFIED_ORG MBEDTLS_OID_ISO_IDENTIFIED_ORG -#define OID_ISO_ITU_COUNTRY MBEDTLS_OID_ISO_ITU_COUNTRY -#define OID_ISO_ITU_US_ORG MBEDTLS_OID_ISO_ITU_US_ORG -#define OID_ISO_MEMBER_BODIES MBEDTLS_OID_ISO_MEMBER_BODIES -#define OID_ISSUER_ALT_NAME MBEDTLS_OID_ISSUER_ALT_NAME -#define OID_KEY_USAGE MBEDTLS_OID_KEY_USAGE -#define OID_KP MBEDTLS_OID_KP -#define OID_MGF1 MBEDTLS_OID_MGF1 -#define OID_NAME_CONSTRAINTS MBEDTLS_OID_NAME_CONSTRAINTS -#define OID_NETSCAPE MBEDTLS_OID_NETSCAPE -#define OID_NS_BASE_URL MBEDTLS_OID_NS_BASE_URL -#define OID_NS_CA_POLICY_URL MBEDTLS_OID_NS_CA_POLICY_URL -#define OID_NS_CA_REVOCATION_URL MBEDTLS_OID_NS_CA_REVOCATION_URL -#define OID_NS_CERT MBEDTLS_OID_NS_CERT -#define OID_NS_CERT_SEQUENCE MBEDTLS_OID_NS_CERT_SEQUENCE -#define OID_NS_CERT_TYPE MBEDTLS_OID_NS_CERT_TYPE -#define OID_NS_COMMENT MBEDTLS_OID_NS_COMMENT -#define OID_NS_DATA_TYPE MBEDTLS_OID_NS_DATA_TYPE -#define OID_NS_RENEWAL_URL MBEDTLS_OID_NS_RENEWAL_URL -#define OID_NS_REVOCATION_URL MBEDTLS_OID_NS_REVOCATION_URL -#define OID_NS_SSL_SERVER_NAME MBEDTLS_OID_NS_SSL_SERVER_NAME -#define OID_OCSP_SIGNING MBEDTLS_OID_OCSP_SIGNING -#define OID_OIW_SECSIG MBEDTLS_OID_OIW_SECSIG -#define OID_OIW_SECSIG_ALG MBEDTLS_OID_OIW_SECSIG_ALG -#define OID_OIW_SECSIG_SHA1 MBEDTLS_OID_OIW_SECSIG_SHA1 -#define OID_ORGANIZATION MBEDTLS_OID_ORGANIZATION -#define OID_ORG_ANSI_X9_62 MBEDTLS_OID_ORG_ANSI_X9_62 -#define OID_ORG_CERTICOM MBEDTLS_OID_ORG_CERTICOM -#define OID_ORG_DOD MBEDTLS_OID_ORG_DOD -#define OID_ORG_GOV MBEDTLS_OID_ORG_GOV -#define OID_ORG_NETSCAPE MBEDTLS_OID_ORG_NETSCAPE -#define OID_ORG_OIW MBEDTLS_OID_ORG_OIW -#define OID_ORG_RSA_DATA_SECURITY MBEDTLS_OID_ORG_RSA_DATA_SECURITY -#define OID_ORG_TELETRUST MBEDTLS_OID_ORG_TELETRUST -#define OID_PKCS MBEDTLS_OID_PKCS -#define OID_PKCS1 MBEDTLS_OID_PKCS1 -#define OID_PKCS12 MBEDTLS_OID_PKCS12 -#define OID_PKCS12_PBE MBEDTLS_OID_PKCS12_PBE -#define OID_PKCS12_PBE_SHA1_DES2_EDE_CBC MBEDTLS_OID_PKCS12_PBE_SHA1_DES2_EDE_CBC -#define OID_PKCS12_PBE_SHA1_DES3_EDE_CBC MBEDTLS_OID_PKCS12_PBE_SHA1_DES3_EDE_CBC -#define OID_PKCS12_PBE_SHA1_RC2_128_CBC MBEDTLS_OID_PKCS12_PBE_SHA1_RC2_128_CBC -#define OID_PKCS12_PBE_SHA1_RC2_40_CBC MBEDTLS_OID_PKCS12_PBE_SHA1_RC2_40_CBC -#define OID_PKCS12_PBE_SHA1_RC4_128 MBEDTLS_OID_PKCS12_PBE_SHA1_RC4_128 -#define OID_PKCS12_PBE_SHA1_RC4_40 MBEDTLS_OID_PKCS12_PBE_SHA1_RC4_40 -#define OID_PKCS1_MD2 MBEDTLS_OID_PKCS1_MD2 -#define OID_PKCS1_MD4 MBEDTLS_OID_PKCS1_MD4 -#define OID_PKCS1_MD5 MBEDTLS_OID_PKCS1_MD5 -#define OID_PKCS1_RSA MBEDTLS_OID_PKCS1_RSA -#define OID_PKCS1_SHA1 MBEDTLS_OID_PKCS1_SHA1 -#define OID_PKCS1_SHA224 MBEDTLS_OID_PKCS1_SHA224 -#define OID_PKCS1_SHA256 MBEDTLS_OID_PKCS1_SHA256 -#define OID_PKCS1_SHA384 MBEDTLS_OID_PKCS1_SHA384 -#define OID_PKCS1_SHA512 MBEDTLS_OID_PKCS1_SHA512 -#define OID_PKCS5 MBEDTLS_OID_PKCS5 -#define OID_PKCS5_PBES2 MBEDTLS_OID_PKCS5_PBES2 -#define OID_PKCS5_PBE_MD2_DES_CBC MBEDTLS_OID_PKCS5_PBE_MD2_DES_CBC -#define OID_PKCS5_PBE_MD2_RC2_CBC MBEDTLS_OID_PKCS5_PBE_MD2_RC2_CBC -#define OID_PKCS5_PBE_MD5_DES_CBC MBEDTLS_OID_PKCS5_PBE_MD5_DES_CBC -#define OID_PKCS5_PBE_MD5_RC2_CBC MBEDTLS_OID_PKCS5_PBE_MD5_RC2_CBC -#define OID_PKCS5_PBE_SHA1_DES_CBC MBEDTLS_OID_PKCS5_PBE_SHA1_DES_CBC -#define OID_PKCS5_PBE_SHA1_RC2_CBC MBEDTLS_OID_PKCS5_PBE_SHA1_RC2_CBC -#define OID_PKCS5_PBKDF2 MBEDTLS_OID_PKCS5_PBKDF2 -#define OID_PKCS5_PBMAC1 MBEDTLS_OID_PKCS5_PBMAC1 -#define OID_PKCS9 MBEDTLS_OID_PKCS9 -#define OID_PKCS9_CSR_EXT_REQ MBEDTLS_OID_PKCS9_CSR_EXT_REQ -#define OID_PKCS9_EMAIL MBEDTLS_OID_PKCS9_EMAIL -#define OID_PKIX MBEDTLS_OID_PKIX -#define OID_POLICY_CONSTRAINTS MBEDTLS_OID_POLICY_CONSTRAINTS -#define OID_POLICY_MAPPINGS MBEDTLS_OID_POLICY_MAPPINGS -#define OID_PRIVATE_KEY_USAGE_PERIOD MBEDTLS_OID_PRIVATE_KEY_USAGE_PERIOD -#define OID_RSASSA_PSS MBEDTLS_OID_RSASSA_PSS -#define OID_RSA_COMPANY MBEDTLS_OID_RSA_COMPANY -#define OID_RSA_SHA_OBS MBEDTLS_OID_RSA_SHA_OBS -#define OID_SERVER_AUTH MBEDTLS_OID_SERVER_AUTH -#define OID_SIZE MBEDTLS_OID_SIZE -#define OID_SUBJECT_ALT_NAME MBEDTLS_OID_SUBJECT_ALT_NAME -#define OID_SUBJECT_DIRECTORY_ATTRS MBEDTLS_OID_SUBJECT_DIRECTORY_ATTRS -#define OID_SUBJECT_KEY_IDENTIFIER MBEDTLS_OID_SUBJECT_KEY_IDENTIFIER -#define OID_TELETRUST MBEDTLS_OID_TELETRUST -#define OID_TIME_STAMPING MBEDTLS_OID_TIME_STAMPING -#define PADLOCK_ACE MBEDTLS_PADLOCK_ACE -#define PADLOCK_ALIGN16 MBEDTLS_PADLOCK_ALIGN16 -#define PADLOCK_PHE MBEDTLS_PADLOCK_PHE -#define PADLOCK_PMM MBEDTLS_PADLOCK_PMM -#define PADLOCK_RNG MBEDTLS_PADLOCK_RNG -#define PKCS12_DERIVE_IV MBEDTLS_PKCS12_DERIVE_IV -#define PKCS12_DERIVE_KEY MBEDTLS_PKCS12_DERIVE_KEY -#define PKCS12_DERIVE_MAC_KEY MBEDTLS_PKCS12_DERIVE_MAC_KEY -#define PKCS12_PBE_DECRYPT MBEDTLS_PKCS12_PBE_DECRYPT -#define PKCS12_PBE_ENCRYPT MBEDTLS_PKCS12_PBE_ENCRYPT -#define PKCS5_DECRYPT MBEDTLS_PKCS5_DECRYPT -#define PKCS5_ENCRYPT MBEDTLS_PKCS5_ENCRYPT -#define POLARSSL_AESNI_AES MBEDTLS_AESNI_AES -#define POLARSSL_AESNI_CLMUL MBEDTLS_AESNI_CLMUL -#define POLARSSL_AESNI_H MBEDTLS_AESNI_H -#define POLARSSL_AES_H MBEDTLS_AES_H -#define POLARSSL_ARC4_H MBEDTLS_ARC4_H -#define POLARSSL_ASN1_H MBEDTLS_ASN1_H -#define POLARSSL_ASN1_WRITE_H MBEDTLS_ASN1_WRITE_H -#define POLARSSL_BASE64_H MBEDTLS_BASE64_H -#define POLARSSL_BIGNUM_H MBEDTLS_BIGNUM_H -#define POLARSSL_BLOWFISH_H MBEDTLS_BLOWFISH_H -#define POLARSSL_BN_MUL_H MBEDTLS_BN_MUL_H -#define POLARSSL_CAMELLIA_H MBEDTLS_CAMELLIA_H -#define POLARSSL_CCM_H MBEDTLS_CCM_H -#define POLARSSL_CERTS_H MBEDTLS_CERTS_H -#define POLARSSL_CHECK_CONFIG_H MBEDTLS_CHECK_CONFIG_H -#define POLARSSL_CIPHERSUITE_NODTLS MBEDTLS_CIPHERSUITE_NODTLS -#define POLARSSL_CIPHERSUITE_SHORT_TAG MBEDTLS_CIPHERSUITE_SHORT_TAG -#define POLARSSL_CIPHERSUITE_WEAK MBEDTLS_CIPHERSUITE_WEAK -#define POLARSSL_CIPHER_AES_128_CBC MBEDTLS_CIPHER_AES_128_CBC -#define POLARSSL_CIPHER_AES_128_CCM MBEDTLS_CIPHER_AES_128_CCM -#define POLARSSL_CIPHER_AES_128_CFB128 MBEDTLS_CIPHER_AES_128_CFB128 -#define POLARSSL_CIPHER_AES_128_CTR MBEDTLS_CIPHER_AES_128_CTR -#define POLARSSL_CIPHER_AES_128_ECB MBEDTLS_CIPHER_AES_128_ECB -#define POLARSSL_CIPHER_AES_128_GCM MBEDTLS_CIPHER_AES_128_GCM -#define POLARSSL_CIPHER_AES_192_CBC MBEDTLS_CIPHER_AES_192_CBC -#define POLARSSL_CIPHER_AES_192_CCM MBEDTLS_CIPHER_AES_192_CCM -#define POLARSSL_CIPHER_AES_192_CFB128 MBEDTLS_CIPHER_AES_192_CFB128 -#define POLARSSL_CIPHER_AES_192_CTR MBEDTLS_CIPHER_AES_192_CTR -#define POLARSSL_CIPHER_AES_192_ECB MBEDTLS_CIPHER_AES_192_ECB -#define POLARSSL_CIPHER_AES_192_GCM MBEDTLS_CIPHER_AES_192_GCM -#define POLARSSL_CIPHER_AES_256_CBC MBEDTLS_CIPHER_AES_256_CBC -#define POLARSSL_CIPHER_AES_256_CCM MBEDTLS_CIPHER_AES_256_CCM -#define POLARSSL_CIPHER_AES_256_CFB128 MBEDTLS_CIPHER_AES_256_CFB128 -#define POLARSSL_CIPHER_AES_256_CTR MBEDTLS_CIPHER_AES_256_CTR -#define POLARSSL_CIPHER_AES_256_ECB MBEDTLS_CIPHER_AES_256_ECB -#define POLARSSL_CIPHER_AES_256_GCM MBEDTLS_CIPHER_AES_256_GCM -#define POLARSSL_CIPHER_ARC4_128 MBEDTLS_CIPHER_ARC4_128 -#define POLARSSL_CIPHER_BLOWFISH_CBC MBEDTLS_CIPHER_BLOWFISH_CBC -#define POLARSSL_CIPHER_BLOWFISH_CFB64 MBEDTLS_CIPHER_BLOWFISH_CFB64 -#define POLARSSL_CIPHER_BLOWFISH_CTR MBEDTLS_CIPHER_BLOWFISH_CTR -#define POLARSSL_CIPHER_BLOWFISH_ECB MBEDTLS_CIPHER_BLOWFISH_ECB -#define POLARSSL_CIPHER_CAMELLIA_128_CBC MBEDTLS_CIPHER_CAMELLIA_128_CBC -#define POLARSSL_CIPHER_CAMELLIA_128_CCM MBEDTLS_CIPHER_CAMELLIA_128_CCM -#define POLARSSL_CIPHER_CAMELLIA_128_CFB128 MBEDTLS_CIPHER_CAMELLIA_128_CFB128 -#define POLARSSL_CIPHER_CAMELLIA_128_CTR MBEDTLS_CIPHER_CAMELLIA_128_CTR -#define POLARSSL_CIPHER_CAMELLIA_128_ECB MBEDTLS_CIPHER_CAMELLIA_128_ECB -#define POLARSSL_CIPHER_CAMELLIA_128_GCM MBEDTLS_CIPHER_CAMELLIA_128_GCM -#define POLARSSL_CIPHER_CAMELLIA_192_CBC MBEDTLS_CIPHER_CAMELLIA_192_CBC -#define POLARSSL_CIPHER_CAMELLIA_192_CCM MBEDTLS_CIPHER_CAMELLIA_192_CCM -#define POLARSSL_CIPHER_CAMELLIA_192_CFB128 MBEDTLS_CIPHER_CAMELLIA_192_CFB128 -#define POLARSSL_CIPHER_CAMELLIA_192_CTR MBEDTLS_CIPHER_CAMELLIA_192_CTR -#define POLARSSL_CIPHER_CAMELLIA_192_ECB MBEDTLS_CIPHER_CAMELLIA_192_ECB -#define POLARSSL_CIPHER_CAMELLIA_192_GCM MBEDTLS_CIPHER_CAMELLIA_192_GCM -#define POLARSSL_CIPHER_CAMELLIA_256_CBC MBEDTLS_CIPHER_CAMELLIA_256_CBC -#define POLARSSL_CIPHER_CAMELLIA_256_CCM MBEDTLS_CIPHER_CAMELLIA_256_CCM -#define POLARSSL_CIPHER_CAMELLIA_256_CFB128 MBEDTLS_CIPHER_CAMELLIA_256_CFB128 -#define POLARSSL_CIPHER_CAMELLIA_256_CTR MBEDTLS_CIPHER_CAMELLIA_256_CTR -#define POLARSSL_CIPHER_CAMELLIA_256_ECB MBEDTLS_CIPHER_CAMELLIA_256_ECB -#define POLARSSL_CIPHER_CAMELLIA_256_GCM MBEDTLS_CIPHER_CAMELLIA_256_GCM -#define POLARSSL_CIPHER_DES_CBC MBEDTLS_CIPHER_DES_CBC -#define POLARSSL_CIPHER_DES_ECB MBEDTLS_CIPHER_DES_ECB -#define POLARSSL_CIPHER_DES_EDE3_CBC MBEDTLS_CIPHER_DES_EDE3_CBC -#define POLARSSL_CIPHER_DES_EDE3_ECB MBEDTLS_CIPHER_DES_EDE3_ECB -#define POLARSSL_CIPHER_DES_EDE_CBC MBEDTLS_CIPHER_DES_EDE_CBC -#define POLARSSL_CIPHER_DES_EDE_ECB MBEDTLS_CIPHER_DES_EDE_ECB -#define POLARSSL_CIPHER_H MBEDTLS_CIPHER_H -#define POLARSSL_CIPHER_ID_3DES MBEDTLS_CIPHER_ID_3DES -#define POLARSSL_CIPHER_ID_AES MBEDTLS_CIPHER_ID_AES -#define POLARSSL_CIPHER_ID_ARC4 MBEDTLS_CIPHER_ID_ARC4 -#define POLARSSL_CIPHER_ID_BLOWFISH MBEDTLS_CIPHER_ID_BLOWFISH -#define POLARSSL_CIPHER_ID_CAMELLIA MBEDTLS_CIPHER_ID_CAMELLIA -#define POLARSSL_CIPHER_ID_DES MBEDTLS_CIPHER_ID_DES -#define POLARSSL_CIPHER_ID_NONE MBEDTLS_CIPHER_ID_NONE -#define POLARSSL_CIPHER_ID_NULL MBEDTLS_CIPHER_ID_NULL -#define POLARSSL_CIPHER_MODE_AEAD MBEDTLS_CIPHER_MODE_AEAD -#define POLARSSL_CIPHER_MODE_STREAM MBEDTLS_CIPHER_MODE_STREAM -#define POLARSSL_CIPHER_MODE_WITH_PADDING MBEDTLS_CIPHER_MODE_WITH_PADDING -#define POLARSSL_CIPHER_NONE MBEDTLS_CIPHER_NONE -#define POLARSSL_CIPHER_NULL MBEDTLS_CIPHER_NULL -#define POLARSSL_CIPHER_VARIABLE_IV_LEN MBEDTLS_CIPHER_VARIABLE_IV_LEN -#define POLARSSL_CIPHER_VARIABLE_KEY_LEN MBEDTLS_CIPHER_VARIABLE_KEY_LEN -#define POLARSSL_CIPHER_WRAP_H MBEDTLS_CIPHER_WRAP_H -#define POLARSSL_CONFIG_H MBEDTLS_CONFIG_H -#define POLARSSL_CTR_DRBG_H MBEDTLS_CTR_DRBG_H -#define POLARSSL_DEBUG_H MBEDTLS_DEBUG_H -#define POLARSSL_DECRYPT MBEDTLS_DECRYPT -#define POLARSSL_DES_H MBEDTLS_DES_H -#define POLARSSL_DHM_H MBEDTLS_DHM_H -#define POLARSSL_DHM_RFC3526_MODP_2048_G MBEDTLS_DHM_RFC3526_MODP_2048_G -#define POLARSSL_DHM_RFC3526_MODP_2048_P MBEDTLS_DHM_RFC3526_MODP_2048_P -#define POLARSSL_DHM_RFC3526_MODP_3072_G MBEDTLS_DHM_RFC3526_MODP_3072_G -#define POLARSSL_DHM_RFC3526_MODP_3072_P MBEDTLS_DHM_RFC3526_MODP_3072_P -#define POLARSSL_DHM_RFC5114_MODP_2048_G MBEDTLS_DHM_RFC5114_MODP_2048_G -#define POLARSSL_DHM_RFC5114_MODP_2048_P MBEDTLS_DHM_RFC5114_MODP_2048_P -#define POLARSSL_ECDH_H MBEDTLS_ECDH_H -#define POLARSSL_ECDH_OURS MBEDTLS_ECDH_OURS -#define POLARSSL_ECDH_THEIRS MBEDTLS_ECDH_THEIRS -#define POLARSSL_ECDSA_H MBEDTLS_ECDSA_H -#define POLARSSL_ECP_DP_BP256R1 MBEDTLS_ECP_DP_BP256R1 -#define POLARSSL_ECP_DP_BP384R1 MBEDTLS_ECP_DP_BP384R1 -#define POLARSSL_ECP_DP_BP512R1 MBEDTLS_ECP_DP_BP512R1 -#define POLARSSL_ECP_DP_M255 MBEDTLS_ECP_DP_CURVE25519 -#define POLARSSL_ECP_DP_MAX MBEDTLS_ECP_DP_MAX -#define POLARSSL_ECP_DP_NONE MBEDTLS_ECP_DP_NONE -#define POLARSSL_ECP_DP_SECP192K1 MBEDTLS_ECP_DP_SECP192K1 -#define POLARSSL_ECP_DP_SECP192R1 MBEDTLS_ECP_DP_SECP192R1 -#define POLARSSL_ECP_DP_SECP224K1 MBEDTLS_ECP_DP_SECP224K1 -#define POLARSSL_ECP_DP_SECP224R1 MBEDTLS_ECP_DP_SECP224R1 -#define POLARSSL_ECP_DP_SECP256K1 MBEDTLS_ECP_DP_SECP256K1 -#define POLARSSL_ECP_DP_SECP256R1 MBEDTLS_ECP_DP_SECP256R1 -#define POLARSSL_ECP_DP_SECP384R1 MBEDTLS_ECP_DP_SECP384R1 -#define POLARSSL_ECP_DP_SECP521R1 MBEDTLS_ECP_DP_SECP521R1 -#define POLARSSL_ECP_H MBEDTLS_ECP_H -#define POLARSSL_ECP_MAX_BYTES MBEDTLS_ECP_MAX_BYTES -#define POLARSSL_ECP_MAX_PT_LEN MBEDTLS_ECP_MAX_PT_LEN -#define POLARSSL_ECP_PF_COMPRESSED MBEDTLS_ECP_PF_COMPRESSED -#define POLARSSL_ECP_PF_UNCOMPRESSED MBEDTLS_ECP_PF_UNCOMPRESSED -#define POLARSSL_ECP_TLS_NAMED_CURVE MBEDTLS_ECP_TLS_NAMED_CURVE -#define POLARSSL_ENCRYPT MBEDTLS_ENCRYPT -#define POLARSSL_ENTROPY_H MBEDTLS_ENTROPY_H -#define POLARSSL_ENTROPY_POLL_H MBEDTLS_ENTROPY_POLL_H -#define POLARSSL_ENTROPY_SHA256_ACCUMULATOR MBEDTLS_ENTROPY_SHA256_ACCUMULATOR -#define POLARSSL_ENTROPY_SHA512_ACCUMULATOR MBEDTLS_ENTROPY_SHA512_ACCUMULATOR -#define POLARSSL_ERROR_H MBEDTLS_ERROR_H -#define POLARSSL_ERR_AES_INVALID_INPUT_LENGTH MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH -#define POLARSSL_ERR_AES_INVALID_KEY_LENGTH MBEDTLS_ERR_AES_INVALID_KEY_LENGTH -#define POLARSSL_ERR_ASN1_BUF_TOO_SMALL MBEDTLS_ERR_ASN1_BUF_TOO_SMALL -#define POLARSSL_ERR_ASN1_INVALID_DATA MBEDTLS_ERR_ASN1_INVALID_DATA -#define POLARSSL_ERR_ASN1_INVALID_LENGTH MBEDTLS_ERR_ASN1_INVALID_LENGTH -#define POLARSSL_ERR_ASN1_LENGTH_MISMATCH MBEDTLS_ERR_ASN1_LENGTH_MISMATCH -#define POLARSSL_ERR_ASN1_MALLOC_FAILED MBEDTLS_ERR_ASN1_ALLOC_FAILED -#define POLARSSL_ERR_ASN1_OUT_OF_DATA MBEDTLS_ERR_ASN1_OUT_OF_DATA -#define POLARSSL_ERR_ASN1_UNEXPECTED_TAG MBEDTLS_ERR_ASN1_UNEXPECTED_TAG -#define POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL -#define POLARSSL_ERR_BASE64_INVALID_CHARACTER MBEDTLS_ERR_BASE64_INVALID_CHARACTER -#define POLARSSL_ERR_BLOWFISH_INVALID_INPUT_LENGTH MBEDTLS_ERR_BLOWFISH_INVALID_INPUT_LENGTH -#define POLARSSL_ERR_BLOWFISH_INVALID_KEY_LENGTH MBEDTLS_ERR_BLOWFISH_INVALID_KEY_LENGTH -#define POLARSSL_ERR_CAMELLIA_INVALID_INPUT_LENGTH MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH -#define POLARSSL_ERR_CAMELLIA_INVALID_KEY_LENGTH MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH -#define POLARSSL_ERR_CCM_AUTH_FAILED MBEDTLS_ERR_CCM_AUTH_FAILED -#define POLARSSL_ERR_CCM_BAD_INPUT MBEDTLS_ERR_CCM_BAD_INPUT -#define POLARSSL_ERR_CIPHER_ALLOC_FAILED MBEDTLS_ERR_CIPHER_ALLOC_FAILED -#define POLARSSL_ERR_CIPHER_AUTH_FAILED MBEDTLS_ERR_CIPHER_AUTH_FAILED -#define POLARSSL_ERR_CIPHER_BAD_INPUT_DATA MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA -#define POLARSSL_ERR_CIPHER_FEATURE_UNAVAILABLE MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE -#define POLARSSL_ERR_CIPHER_FULL_BLOCK_EXPECTED MBEDTLS_ERR_CIPHER_FULL_BLOCK_EXPECTED -#define POLARSSL_ERR_CIPHER_INVALID_PADDING MBEDTLS_ERR_CIPHER_INVALID_PADDING -#define POLARSSL_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED -#define POLARSSL_ERR_CTR_DRBG_FILE_IO_ERROR MBEDTLS_ERR_CTR_DRBG_FILE_IO_ERROR -#define POLARSSL_ERR_CTR_DRBG_INPUT_TOO_BIG MBEDTLS_ERR_CTR_DRBG_INPUT_TOO_BIG -#define POLARSSL_ERR_CTR_DRBG_REQUEST_TOO_BIG MBEDTLS_ERR_CTR_DRBG_REQUEST_TOO_BIG -#define POLARSSL_ERR_DES_INVALID_INPUT_LENGTH MBEDTLS_ERR_DES_INVALID_INPUT_LENGTH -#define POLARSSL_ERR_DHM_BAD_INPUT_DATA MBEDTLS_ERR_DHM_BAD_INPUT_DATA -#define POLARSSL_ERR_DHM_CALC_SECRET_FAILED MBEDTLS_ERR_DHM_CALC_SECRET_FAILED -#define POLARSSL_ERR_DHM_FILE_IO_ERROR MBEDTLS_ERR_DHM_FILE_IO_ERROR -#define POLARSSL_ERR_DHM_INVALID_FORMAT MBEDTLS_ERR_DHM_INVALID_FORMAT -#define POLARSSL_ERR_DHM_MAKE_PARAMS_FAILED MBEDTLS_ERR_DHM_MAKE_PARAMS_FAILED -#define POLARSSL_ERR_DHM_MAKE_PUBLIC_FAILED MBEDTLS_ERR_DHM_MAKE_PUBLIC_FAILED -#define POLARSSL_ERR_DHM_MALLOC_FAILED MBEDTLS_ERR_DHM_ALLOC_FAILED -#define POLARSSL_ERR_DHM_READ_PARAMS_FAILED MBEDTLS_ERR_DHM_READ_PARAMS_FAILED -#define POLARSSL_ERR_DHM_READ_PUBLIC_FAILED MBEDTLS_ERR_DHM_READ_PUBLIC_FAILED -#define POLARSSL_ERR_ECP_BAD_INPUT_DATA MBEDTLS_ERR_ECP_BAD_INPUT_DATA -#define POLARSSL_ERR_ECP_BUFFER_TOO_SMALL MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL -#define POLARSSL_ERR_ECP_FEATURE_UNAVAILABLE MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE -#define POLARSSL_ERR_ECP_INVALID_KEY MBEDTLS_ERR_ECP_INVALID_KEY -#define POLARSSL_ERR_ECP_MALLOC_FAILED MBEDTLS_ERR_ECP_ALLOC_FAILED -#define POLARSSL_ERR_ECP_RANDOM_FAILED MBEDTLS_ERR_ECP_RANDOM_FAILED -#define POLARSSL_ERR_ECP_SIG_LEN_MISMATCH MBEDTLS_ERR_ECP_SIG_LEN_MISMATCH -#define POLARSSL_ERR_ECP_VERIFY_FAILED MBEDTLS_ERR_ECP_VERIFY_FAILED -#define POLARSSL_ERR_ENTROPY_FILE_IO_ERROR MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR -#define POLARSSL_ERR_ENTROPY_MAX_SOURCES MBEDTLS_ERR_ENTROPY_MAX_SOURCES -#define POLARSSL_ERR_ENTROPY_NO_SOURCES_DEFINED MBEDTLS_ERR_ENTROPY_NO_SOURCES_DEFINED -#define POLARSSL_ERR_ENTROPY_SOURCE_FAILED MBEDTLS_ERR_ENTROPY_SOURCE_FAILED -#define POLARSSL_ERR_GCM_AUTH_FAILED MBEDTLS_ERR_GCM_AUTH_FAILED -#define POLARSSL_ERR_GCM_BAD_INPUT MBEDTLS_ERR_GCM_BAD_INPUT -#define POLARSSL_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED -#define POLARSSL_ERR_HMAC_DRBG_FILE_IO_ERROR MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR -#define POLARSSL_ERR_HMAC_DRBG_INPUT_TOO_BIG MBEDTLS_ERR_HMAC_DRBG_INPUT_TOO_BIG -#define POLARSSL_ERR_HMAC_DRBG_REQUEST_TOO_BIG MBEDTLS_ERR_HMAC_DRBG_REQUEST_TOO_BIG -#define POLARSSL_ERR_MD_ALLOC_FAILED MBEDTLS_ERR_MD_ALLOC_FAILED -#define POLARSSL_ERR_MD_BAD_INPUT_DATA MBEDTLS_ERR_MD_BAD_INPUT_DATA -#define POLARSSL_ERR_MD_FEATURE_UNAVAILABLE MBEDTLS_ERR_MD_FEATURE_UNAVAILABLE -#define POLARSSL_ERR_MD_FILE_IO_ERROR MBEDTLS_ERR_MD_FILE_IO_ERROR -#define POLARSSL_ERR_MPI_BAD_INPUT_DATA MBEDTLS_ERR_MPI_BAD_INPUT_DATA -#define POLARSSL_ERR_MPI_BUFFER_TOO_SMALL MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL -#define POLARSSL_ERR_MPI_DIVISION_BY_ZERO MBEDTLS_ERR_MPI_DIVISION_BY_ZERO -#define POLARSSL_ERR_MPI_FILE_IO_ERROR MBEDTLS_ERR_MPI_FILE_IO_ERROR -#define POLARSSL_ERR_MPI_INVALID_CHARACTER MBEDTLS_ERR_MPI_INVALID_CHARACTER -#define POLARSSL_ERR_MPI_MALLOC_FAILED MBEDTLS_ERR_MPI_ALLOC_FAILED -#define POLARSSL_ERR_MPI_NEGATIVE_VALUE MBEDTLS_ERR_MPI_NEGATIVE_VALUE -#define POLARSSL_ERR_MPI_NOT_ACCEPTABLE MBEDTLS_ERR_MPI_NOT_ACCEPTABLE -#define POLARSSL_ERR_NET_ACCEPT_FAILED MBEDTLS_ERR_NET_ACCEPT_FAILED -#define POLARSSL_ERR_NET_BIND_FAILED MBEDTLS_ERR_NET_BIND_FAILED -#define POLARSSL_ERR_NET_CONNECT_FAILED MBEDTLS_ERR_NET_CONNECT_FAILED -#define POLARSSL_ERR_NET_CONN_RESET MBEDTLS_ERR_NET_CONN_RESET -#define POLARSSL_ERR_NET_LISTEN_FAILED MBEDTLS_ERR_NET_LISTEN_FAILED -#define POLARSSL_ERR_NET_RECV_FAILED MBEDTLS_ERR_NET_RECV_FAILED -#define POLARSSL_ERR_NET_SEND_FAILED MBEDTLS_ERR_NET_SEND_FAILED -#define POLARSSL_ERR_NET_SOCKET_FAILED MBEDTLS_ERR_NET_SOCKET_FAILED -#define POLARSSL_ERR_NET_TIMEOUT MBEDTLS_ERR_SSL_TIMEOUT -#define POLARSSL_ERR_NET_UNKNOWN_HOST MBEDTLS_ERR_NET_UNKNOWN_HOST -#define POLARSSL_ERR_NET_WANT_READ MBEDTLS_ERR_SSL_WANT_READ -#define POLARSSL_ERR_NET_WANT_WRITE MBEDTLS_ERR_SSL_WANT_WRITE -#define POLARSSL_ERR_OID_BUF_TOO_SMALL MBEDTLS_ERR_OID_BUF_TOO_SMALL -#define POLARSSL_ERR_OID_NOT_FOUND MBEDTLS_ERR_OID_NOT_FOUND -#define POLARSSL_ERR_PADLOCK_DATA_MISALIGNED MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED -#define POLARSSL_ERR_PEM_BAD_INPUT_DATA MBEDTLS_ERR_PEM_BAD_INPUT_DATA -#define POLARSSL_ERR_PEM_FEATURE_UNAVAILABLE MBEDTLS_ERR_PEM_FEATURE_UNAVAILABLE -#define POLARSSL_ERR_PEM_INVALID_DATA MBEDTLS_ERR_PEM_INVALID_DATA -#define POLARSSL_ERR_PEM_INVALID_ENC_IV MBEDTLS_ERR_PEM_INVALID_ENC_IV -#define POLARSSL_ERR_PEM_MALLOC_FAILED MBEDTLS_ERR_PEM_ALLOC_FAILED -#define POLARSSL_ERR_PEM_NO_HEADER_FOOTER_PRESENT MBEDTLS_ERR_PEM_NO_HEADER_FOOTER_PRESENT -#define POLARSSL_ERR_PEM_PASSWORD_MISMATCH MBEDTLS_ERR_PEM_PASSWORD_MISMATCH -#define POLARSSL_ERR_PEM_PASSWORD_REQUIRED MBEDTLS_ERR_PEM_PASSWORD_REQUIRED -#define POLARSSL_ERR_PEM_UNKNOWN_ENC_ALG MBEDTLS_ERR_PEM_UNKNOWN_ENC_ALG -#define POLARSSL_ERR_PKCS12_BAD_INPUT_DATA MBEDTLS_ERR_PKCS12_BAD_INPUT_DATA -#define POLARSSL_ERR_PKCS12_FEATURE_UNAVAILABLE MBEDTLS_ERR_PKCS12_FEATURE_UNAVAILABLE -#define POLARSSL_ERR_PKCS12_PASSWORD_MISMATCH MBEDTLS_ERR_PKCS12_PASSWORD_MISMATCH -#define POLARSSL_ERR_PKCS12_PBE_INVALID_FORMAT MBEDTLS_ERR_PKCS12_PBE_INVALID_FORMAT -#define POLARSSL_ERR_PKCS5_BAD_INPUT_DATA MBEDTLS_ERR_PKCS5_BAD_INPUT_DATA -#define POLARSSL_ERR_PKCS5_FEATURE_UNAVAILABLE MBEDTLS_ERR_PKCS5_FEATURE_UNAVAILABLE -#define POLARSSL_ERR_PKCS5_INVALID_FORMAT MBEDTLS_ERR_PKCS5_INVALID_FORMAT -#define POLARSSL_ERR_PKCS5_PASSWORD_MISMATCH MBEDTLS_ERR_PKCS5_PASSWORD_MISMATCH -#define POLARSSL_ERR_PK_BAD_INPUT_DATA MBEDTLS_ERR_PK_BAD_INPUT_DATA -#define POLARSSL_ERR_PK_FEATURE_UNAVAILABLE MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE -#define POLARSSL_ERR_PK_FILE_IO_ERROR MBEDTLS_ERR_PK_FILE_IO_ERROR -#define POLARSSL_ERR_PK_INVALID_ALG MBEDTLS_ERR_PK_INVALID_ALG -#define POLARSSL_ERR_PK_INVALID_PUBKEY MBEDTLS_ERR_PK_INVALID_PUBKEY -#define POLARSSL_ERR_PK_KEY_INVALID_FORMAT MBEDTLS_ERR_PK_KEY_INVALID_FORMAT -#define POLARSSL_ERR_PK_KEY_INVALID_VERSION MBEDTLS_ERR_PK_KEY_INVALID_VERSION -#define POLARSSL_ERR_PK_MALLOC_FAILED MBEDTLS_ERR_PK_ALLOC_FAILED -#define POLARSSL_ERR_PK_PASSWORD_MISMATCH MBEDTLS_ERR_PK_PASSWORD_MISMATCH -#define POLARSSL_ERR_PK_PASSWORD_REQUIRED MBEDTLS_ERR_PK_PASSWORD_REQUIRED -#define POLARSSL_ERR_PK_SIG_LEN_MISMATCH MBEDTLS_ERR_PK_SIG_LEN_MISMATCH -#define POLARSSL_ERR_PK_TYPE_MISMATCH MBEDTLS_ERR_PK_TYPE_MISMATCH -#define POLARSSL_ERR_PK_UNKNOWN_NAMED_CURVE MBEDTLS_ERR_PK_UNKNOWN_NAMED_CURVE -#define POLARSSL_ERR_PK_UNKNOWN_PK_ALG MBEDTLS_ERR_PK_UNKNOWN_PK_ALG -#define POLARSSL_ERR_RSA_BAD_INPUT_DATA MBEDTLS_ERR_RSA_BAD_INPUT_DATA -#define POLARSSL_ERR_RSA_INVALID_PADDING MBEDTLS_ERR_RSA_INVALID_PADDING -#define POLARSSL_ERR_RSA_KEY_CHECK_FAILED MBEDTLS_ERR_RSA_KEY_CHECK_FAILED -#define POLARSSL_ERR_RSA_KEY_GEN_FAILED MBEDTLS_ERR_RSA_KEY_GEN_FAILED -#define POLARSSL_ERR_RSA_OUTPUT_TOO_LARGE MBEDTLS_ERR_RSA_OUTPUT_TOO_LARGE -#define POLARSSL_ERR_RSA_PRIVATE_FAILED MBEDTLS_ERR_RSA_PRIVATE_FAILED -#define POLARSSL_ERR_RSA_PUBLIC_FAILED MBEDTLS_ERR_RSA_PUBLIC_FAILED -#define POLARSSL_ERR_RSA_RNG_FAILED MBEDTLS_ERR_RSA_RNG_FAILED -#define POLARSSL_ERR_RSA_VERIFY_FAILED MBEDTLS_ERR_RSA_VERIFY_FAILED -#define POLARSSL_ERR_SSL_BAD_HS_CERTIFICATE MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE -#define POLARSSL_ERR_SSL_BAD_HS_CERTIFICATE_REQUEST MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_REQUEST -#define POLARSSL_ERR_SSL_BAD_HS_CERTIFICATE_VERIFY MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_VERIFY -#define POLARSSL_ERR_SSL_BAD_HS_CHANGE_CIPHER_SPEC MBEDTLS_ERR_SSL_BAD_HS_CHANGE_CIPHER_SPEC -#define POLARSSL_ERR_SSL_BAD_HS_CLIENT_HELLO MBEDTLS_ERR_SSL_BAD_HS_CLIENT_HELLO -#define POLARSSL_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE -#define POLARSSL_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_CS MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_CS -#define POLARSSL_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_RP MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_RP -#define POLARSSL_ERR_SSL_BAD_HS_FINISHED MBEDTLS_ERR_SSL_BAD_HS_FINISHED -#define POLARSSL_ERR_SSL_BAD_HS_NEW_SESSION_TICKET MBEDTLS_ERR_SSL_BAD_HS_NEW_SESSION_TICKET -#define POLARSSL_ERR_SSL_BAD_HS_PROTOCOL_VERSION MBEDTLS_ERR_SSL_BAD_HS_PROTOCOL_VERSION -#define POLARSSL_ERR_SSL_BAD_HS_SERVER_HELLO MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO -#define POLARSSL_ERR_SSL_BAD_HS_SERVER_HELLO_DONE MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO_DONE -#define POLARSSL_ERR_SSL_BAD_HS_SERVER_KEY_EXCHANGE MBEDTLS_ERR_SSL_BAD_HS_SERVER_KEY_EXCHANGE -#define POLARSSL_ERR_SSL_BAD_INPUT_DATA MBEDTLS_ERR_SSL_BAD_INPUT_DATA -#define POLARSSL_ERR_SSL_BUFFER_TOO_SMALL MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL -#define POLARSSL_ERR_SSL_CA_CHAIN_REQUIRED MBEDTLS_ERR_SSL_CA_CHAIN_REQUIRED -#define POLARSSL_ERR_SSL_CERTIFICATE_REQUIRED MBEDTLS_ERR_SSL_CERTIFICATE_REQUIRED -#define POLARSSL_ERR_SSL_CERTIFICATE_TOO_LARGE MBEDTLS_ERR_SSL_CERTIFICATE_TOO_LARGE -#define POLARSSL_ERR_SSL_COMPRESSION_FAILED MBEDTLS_ERR_SSL_COMPRESSION_FAILED -#define POLARSSL_ERR_SSL_CONN_EOF MBEDTLS_ERR_SSL_CONN_EOF -#define POLARSSL_ERR_SSL_COUNTER_WRAPPING MBEDTLS_ERR_SSL_COUNTER_WRAPPING -#define POLARSSL_ERR_SSL_FATAL_ALERT_MESSAGE MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE -#define POLARSSL_ERR_SSL_FEATURE_UNAVAILABLE MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE -#define POLARSSL_ERR_SSL_HELLO_VERIFY_REQUIRED MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED -#define POLARSSL_ERR_SSL_HW_ACCEL_FAILED MBEDTLS_ERR_SSL_HW_ACCEL_FAILED -#define POLARSSL_ERR_SSL_HW_ACCEL_FALLTHROUGH MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH -#define POLARSSL_ERR_SSL_INTERNAL_ERROR MBEDTLS_ERR_SSL_INTERNAL_ERROR -#define POLARSSL_ERR_SSL_INVALID_MAC MBEDTLS_ERR_SSL_INVALID_MAC -#define POLARSSL_ERR_SSL_INVALID_RECORD MBEDTLS_ERR_SSL_INVALID_RECORD -#define POLARSSL_ERR_SSL_MALLOC_FAILED MBEDTLS_ERR_SSL_ALLOC_FAILED -#define POLARSSL_ERR_SSL_NO_CIPHER_CHOSEN MBEDTLS_ERR_SSL_NO_CIPHER_CHOSEN -#define POLARSSL_ERR_SSL_NO_CLIENT_CERTIFICATE MBEDTLS_ERR_SSL_NO_CLIENT_CERTIFICATE -#define POLARSSL_ERR_SSL_NO_RNG MBEDTLS_ERR_SSL_NO_RNG -#define POLARSSL_ERR_SSL_NO_USABLE_CIPHERSUITE MBEDTLS_ERR_SSL_NO_USABLE_CIPHERSUITE -#define POLARSSL_ERR_SSL_PEER_CLOSE_NOTIFY MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY -#define POLARSSL_ERR_SSL_PEER_VERIFY_FAILED MBEDTLS_ERR_SSL_PEER_VERIFY_FAILED -#define POLARSSL_ERR_SSL_PK_TYPE_MISMATCH MBEDTLS_ERR_SSL_PK_TYPE_MISMATCH -#define POLARSSL_ERR_SSL_PRIVATE_KEY_REQUIRED MBEDTLS_ERR_SSL_PRIVATE_KEY_REQUIRED -#define POLARSSL_ERR_SSL_SESSION_TICKET_EXPIRED MBEDTLS_ERR_SSL_SESSION_TICKET_EXPIRED -#define POLARSSL_ERR_SSL_UNEXPECTED_MESSAGE MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE -#define POLARSSL_ERR_SSL_UNKNOWN_CIPHER MBEDTLS_ERR_SSL_UNKNOWN_CIPHER -#define POLARSSL_ERR_SSL_UNKNOWN_IDENTITY MBEDTLS_ERR_SSL_UNKNOWN_IDENTITY -#define POLARSSL_ERR_SSL_WAITING_SERVER_HELLO_RENEGO MBEDTLS_ERR_SSL_WAITING_SERVER_HELLO_RENEGO -#define POLARSSL_ERR_THREADING_BAD_INPUT_DATA MBEDTLS_ERR_THREADING_BAD_INPUT_DATA -#define POLARSSL_ERR_THREADING_FEATURE_UNAVAILABLE MBEDTLS_ERR_THREADING_FEATURE_UNAVAILABLE -#define POLARSSL_ERR_THREADING_MUTEX_ERROR MBEDTLS_ERR_THREADING_MUTEX_ERROR -#define POLARSSL_ERR_X509_BAD_INPUT_DATA MBEDTLS_ERR_X509_BAD_INPUT_DATA -#define POLARSSL_ERR_X509_CERT_UNKNOWN_FORMAT MBEDTLS_ERR_X509_CERT_UNKNOWN_FORMAT -#define POLARSSL_ERR_X509_CERT_VERIFY_FAILED MBEDTLS_ERR_X509_CERT_VERIFY_FAILED -#define POLARSSL_ERR_X509_FEATURE_UNAVAILABLE MBEDTLS_ERR_X509_FEATURE_UNAVAILABLE -#define POLARSSL_ERR_X509_FILE_IO_ERROR MBEDTLS_ERR_X509_FILE_IO_ERROR -#define POLARSSL_ERR_X509_INVALID_ALG MBEDTLS_ERR_X509_INVALID_ALG -#define POLARSSL_ERR_X509_INVALID_DATE MBEDTLS_ERR_X509_INVALID_DATE -#define POLARSSL_ERR_X509_INVALID_EXTENSIONS MBEDTLS_ERR_X509_INVALID_EXTENSIONS -#define POLARSSL_ERR_X509_INVALID_FORMAT MBEDTLS_ERR_X509_INVALID_FORMAT -#define POLARSSL_ERR_X509_INVALID_NAME MBEDTLS_ERR_X509_INVALID_NAME -#define POLARSSL_ERR_X509_INVALID_SERIAL MBEDTLS_ERR_X509_INVALID_SERIAL -#define POLARSSL_ERR_X509_INVALID_SIGNATURE MBEDTLS_ERR_X509_INVALID_SIGNATURE -#define POLARSSL_ERR_X509_INVALID_VERSION MBEDTLS_ERR_X509_INVALID_VERSION -#define POLARSSL_ERR_X509_MALLOC_FAILED MBEDTLS_ERR_X509_ALLOC_FAILED -#define POLARSSL_ERR_X509_SIG_MISMATCH MBEDTLS_ERR_X509_SIG_MISMATCH -#define POLARSSL_ERR_X509_UNKNOWN_OID MBEDTLS_ERR_X509_UNKNOWN_OID -#define POLARSSL_ERR_X509_UNKNOWN_SIG_ALG MBEDTLS_ERR_X509_UNKNOWN_SIG_ALG -#define POLARSSL_ERR_X509_UNKNOWN_VERSION MBEDTLS_ERR_X509_UNKNOWN_VERSION -#define POLARSSL_ERR_XTEA_INVALID_INPUT_LENGTH MBEDTLS_ERR_XTEA_INVALID_INPUT_LENGTH -#define POLARSSL_GCM_H MBEDTLS_GCM_H -#define POLARSSL_HAVEGE_H MBEDTLS_HAVEGE_H -#define POLARSSL_HAVE_INT32 MBEDTLS_HAVE_INT32 -#define POLARSSL_HAVE_INT64 MBEDTLS_HAVE_INT64 -#define POLARSSL_HAVE_UDBL MBEDTLS_HAVE_UDBL -#define POLARSSL_HAVE_X86 MBEDTLS_HAVE_X86 -#define POLARSSL_HAVE_X86_64 MBEDTLS_HAVE_X86_64 -#define POLARSSL_HMAC_DRBG_H MBEDTLS_HMAC_DRBG_H -#define POLARSSL_HMAC_DRBG_PR_OFF MBEDTLS_HMAC_DRBG_PR_OFF -#define POLARSSL_HMAC_DRBG_PR_ON MBEDTLS_HMAC_DRBG_PR_ON -#define POLARSSL_KEY_EXCHANGE_DHE_PSK MBEDTLS_KEY_EXCHANGE_DHE_PSK -#define POLARSSL_KEY_EXCHANGE_DHE_RSA MBEDTLS_KEY_EXCHANGE_DHE_RSA -#define POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA -#define POLARSSL_KEY_EXCHANGE_ECDHE_PSK MBEDTLS_KEY_EXCHANGE_ECDHE_PSK -#define POLARSSL_KEY_EXCHANGE_ECDHE_RSA MBEDTLS_KEY_EXCHANGE_ECDHE_RSA -#define POLARSSL_KEY_EXCHANGE_ECDH_ECDSA MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA -#define POLARSSL_KEY_EXCHANGE_ECDH_RSA MBEDTLS_KEY_EXCHANGE_ECDH_RSA -#define POLARSSL_KEY_EXCHANGE_NONE MBEDTLS_KEY_EXCHANGE_NONE -#define POLARSSL_KEY_EXCHANGE_PSK MBEDTLS_KEY_EXCHANGE_PSK -#define POLARSSL_KEY_EXCHANGE_RSA MBEDTLS_KEY_EXCHANGE_RSA -#define POLARSSL_KEY_EXCHANGE_RSA_PSK MBEDTLS_KEY_EXCHANGE_RSA_PSK -#define POLARSSL_KEY_EXCHANGE__SOME__ECDHE_ENABLED MBEDTLS_KEY_EXCHANGE__SOME__ECDHE_ENABLED -#define POLARSSL_KEY_EXCHANGE__SOME__PSK_ENABLED MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED -#define POLARSSL_KEY_EXCHANGE__WITH_CERT__ENABLED MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED -#define POLARSSL_KEY_LENGTH_DES MBEDTLS_KEY_LENGTH_DES -#define POLARSSL_KEY_LENGTH_DES_EDE MBEDTLS_KEY_LENGTH_DES_EDE -#define POLARSSL_KEY_LENGTH_DES_EDE3 MBEDTLS_KEY_LENGTH_DES_EDE3 -#define POLARSSL_KEY_LENGTH_NONE MBEDTLS_KEY_LENGTH_NONE -#define POLARSSL_MAX_BLOCK_LENGTH MBEDTLS_MAX_BLOCK_LENGTH -#define POLARSSL_MAX_IV_LENGTH MBEDTLS_MAX_IV_LENGTH -#define POLARSSL_MD2_H MBEDTLS_MD2_H -#define POLARSSL_MD4_H MBEDTLS_MD4_H -#define POLARSSL_MD5_H MBEDTLS_MD5_H -#define POLARSSL_MD_H MBEDTLS_MD_H -#define POLARSSL_MD_MAX_SIZE MBEDTLS_MD_MAX_SIZE -#define POLARSSL_MD_MD2 MBEDTLS_MD_MD2 -#define POLARSSL_MD_MD4 MBEDTLS_MD_MD4 -#define POLARSSL_MD_MD5 MBEDTLS_MD_MD5 -#define POLARSSL_MD_NONE MBEDTLS_MD_NONE -#define POLARSSL_MD_RIPEMD160 MBEDTLS_MD_RIPEMD160 -#define POLARSSL_MD_SHA1 MBEDTLS_MD_SHA1 -#define POLARSSL_MD_SHA224 MBEDTLS_MD_SHA224 -#define POLARSSL_MD_SHA256 MBEDTLS_MD_SHA256 -#define POLARSSL_MD_SHA384 MBEDTLS_MD_SHA384 -#define POLARSSL_MD_SHA512 MBEDTLS_MD_SHA512 -#define POLARSSL_MD_WRAP_H MBEDTLS_MD_WRAP_H -#define POLARSSL_MEMORY_BUFFER_ALLOC_H MBEDTLS_MEMORY_BUFFER_ALLOC_H -#define POLARSSL_MODE_CBC MBEDTLS_MODE_CBC -#define POLARSSL_MODE_CCM MBEDTLS_MODE_CCM -#define POLARSSL_MODE_CFB MBEDTLS_MODE_CFB -#define POLARSSL_MODE_CTR MBEDTLS_MODE_CTR -#define POLARSSL_MODE_ECB MBEDTLS_MODE_ECB -#define POLARSSL_MODE_GCM MBEDTLS_MODE_GCM -#define POLARSSL_MODE_NONE MBEDTLS_MODE_NONE -#define POLARSSL_MODE_OFB MBEDTLS_MODE_OFB -#define POLARSSL_MODE_STREAM MBEDTLS_MODE_STREAM -#define POLARSSL_MPI_MAX_BITS MBEDTLS_MPI_MAX_BITS -#define POLARSSL_MPI_MAX_BITS_SCALE100 MBEDTLS_MPI_MAX_BITS_SCALE100 -#define POLARSSL_MPI_MAX_LIMBS MBEDTLS_MPI_MAX_LIMBS -#define POLARSSL_MPI_RW_BUFFER_SIZE MBEDTLS_MPI_RW_BUFFER_SIZE -#define POLARSSL_NET_H MBEDTLS_NET_SOCKETS_H -#define POLARSSL_NET_LISTEN_BACKLOG MBEDTLS_NET_LISTEN_BACKLOG -#define POLARSSL_OID_H MBEDTLS_OID_H -#define POLARSSL_OPERATION_NONE MBEDTLS_OPERATION_NONE -#define POLARSSL_PADDING_NONE MBEDTLS_PADDING_NONE -#define POLARSSL_PADDING_ONE_AND_ZEROS MBEDTLS_PADDING_ONE_AND_ZEROS -#define POLARSSL_PADDING_PKCS7 MBEDTLS_PADDING_PKCS7 -#define POLARSSL_PADDING_ZEROS MBEDTLS_PADDING_ZEROS -#define POLARSSL_PADDING_ZEROS_AND_LEN MBEDTLS_PADDING_ZEROS_AND_LEN -#define POLARSSL_PADLOCK_H MBEDTLS_PADLOCK_H -#define POLARSSL_PEM_H MBEDTLS_PEM_H -#define POLARSSL_PKCS11_H MBEDTLS_PKCS11_H -#define POLARSSL_PKCS12_H MBEDTLS_PKCS12_H -#define POLARSSL_PKCS5_H MBEDTLS_PKCS5_H -#define POLARSSL_PK_DEBUG_ECP MBEDTLS_PK_DEBUG_ECP -#define POLARSSL_PK_DEBUG_MAX_ITEMS MBEDTLS_PK_DEBUG_MAX_ITEMS -#define POLARSSL_PK_DEBUG_MPI MBEDTLS_PK_DEBUG_MPI -#define POLARSSL_PK_DEBUG_NONE MBEDTLS_PK_DEBUG_NONE -#define POLARSSL_PK_ECDSA MBEDTLS_PK_ECDSA -#define POLARSSL_PK_ECKEY MBEDTLS_PK_ECKEY -#define POLARSSL_PK_ECKEY_DH MBEDTLS_PK_ECKEY_DH -#define POLARSSL_PK_H MBEDTLS_PK_H -#define POLARSSL_PK_NONE MBEDTLS_PK_NONE -#define POLARSSL_PK_RSA MBEDTLS_PK_RSA -#define POLARSSL_PK_RSASSA_PSS MBEDTLS_PK_RSASSA_PSS -#define POLARSSL_PK_RSA_ALT MBEDTLS_PK_RSA_ALT -#define POLARSSL_PK_WRAP_H MBEDTLS_PK_WRAP_H -#define POLARSSL_PLATFORM_H MBEDTLS_PLATFORM_H -#define POLARSSL_PREMASTER_SIZE MBEDTLS_PREMASTER_SIZE -#define POLARSSL_RIPEMD160_H MBEDTLS_RIPEMD160_H -#define POLARSSL_RSA_H MBEDTLS_RSA_H -#define POLARSSL_SHA1_H MBEDTLS_SHA1_H -#define POLARSSL_SHA256_H MBEDTLS_SHA256_H -#define POLARSSL_SHA512_H MBEDTLS_SHA512_H -#define POLARSSL_SSL_CACHE_H MBEDTLS_SSL_CACHE_H -#define POLARSSL_SSL_CIPHERSUITES_H MBEDTLS_SSL_CIPHERSUITES_H -#define POLARSSL_SSL_COOKIE_H MBEDTLS_SSL_COOKIE_H -#define POLARSSL_SSL_H MBEDTLS_SSL_H -#define POLARSSL_THREADING_H MBEDTLS_THREADING_H -#define POLARSSL_THREADING_IMPL MBEDTLS_THREADING_IMPL -#define POLARSSL_TIMING_H MBEDTLS_TIMING_H -#define POLARSSL_VERSION_H MBEDTLS_VERSION_H -#define POLARSSL_VERSION_MAJOR MBEDTLS_VERSION_MAJOR -#define POLARSSL_VERSION_MINOR MBEDTLS_VERSION_MINOR -#define POLARSSL_VERSION_NUMBER MBEDTLS_VERSION_NUMBER -#define POLARSSL_VERSION_PATCH MBEDTLS_VERSION_PATCH -#define POLARSSL_VERSION_STRING MBEDTLS_VERSION_STRING -#define POLARSSL_VERSION_STRING_FULL MBEDTLS_VERSION_STRING_FULL -#define POLARSSL_X509_CRL_H MBEDTLS_X509_CRL_H -#define POLARSSL_X509_CRT_H MBEDTLS_X509_CRT_H -#define POLARSSL_X509_CSR_H MBEDTLS_X509_CSR_H -#define POLARSSL_X509_H MBEDTLS_X509_H -#define POLARSSL_XTEA_H MBEDTLS_XTEA_H -#define RSA_CRYPT MBEDTLS_RSA_CRYPT -#define RSA_PKCS_V15 MBEDTLS_RSA_PKCS_V15 -#define RSA_PKCS_V21 MBEDTLS_RSA_PKCS_V21 -#define RSA_PRIVATE MBEDTLS_RSA_PRIVATE -#define RSA_PUBLIC MBEDTLS_RSA_PUBLIC -#define RSA_SALT_LEN_ANY MBEDTLS_RSA_SALT_LEN_ANY -#define RSA_SIGN MBEDTLS_RSA_SIGN -#define SSL_ALERT_LEVEL_FATAL MBEDTLS_SSL_ALERT_LEVEL_FATAL -#define SSL_ALERT_LEVEL_WARNING MBEDTLS_SSL_ALERT_LEVEL_WARNING -#define SSL_ALERT_MSG_ACCESS_DENIED MBEDTLS_SSL_ALERT_MSG_ACCESS_DENIED -#define SSL_ALERT_MSG_BAD_CERT MBEDTLS_SSL_ALERT_MSG_BAD_CERT -#define SSL_ALERT_MSG_BAD_RECORD_MAC MBEDTLS_SSL_ALERT_MSG_BAD_RECORD_MAC -#define SSL_ALERT_MSG_CERT_EXPIRED MBEDTLS_SSL_ALERT_MSG_CERT_EXPIRED -#define SSL_ALERT_MSG_CERT_REVOKED MBEDTLS_SSL_ALERT_MSG_CERT_REVOKED -#define SSL_ALERT_MSG_CERT_UNKNOWN MBEDTLS_SSL_ALERT_MSG_CERT_UNKNOWN -#define SSL_ALERT_MSG_CLOSE_NOTIFY MBEDTLS_SSL_ALERT_MSG_CLOSE_NOTIFY -#define SSL_ALERT_MSG_DECODE_ERROR MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR -#define SSL_ALERT_MSG_DECOMPRESSION_FAILURE MBEDTLS_SSL_ALERT_MSG_DECOMPRESSION_FAILURE -#define SSL_ALERT_MSG_DECRYPTION_FAILED MBEDTLS_SSL_ALERT_MSG_DECRYPTION_FAILED -#define SSL_ALERT_MSG_DECRYPT_ERROR MBEDTLS_SSL_ALERT_MSG_DECRYPT_ERROR -#define SSL_ALERT_MSG_EXPORT_RESTRICTION MBEDTLS_SSL_ALERT_MSG_EXPORT_RESTRICTION -#define SSL_ALERT_MSG_HANDSHAKE_FAILURE MBEDTLS_SSL_ALERT_MSG_HANDSHAKE_FAILURE -#define SSL_ALERT_MSG_ILLEGAL_PARAMETER MBEDTLS_SSL_ALERT_MSG_ILLEGAL_PARAMETER -#define SSL_ALERT_MSG_INAPROPRIATE_FALLBACK MBEDTLS_SSL_ALERT_MSG_INAPROPRIATE_FALLBACK -#define SSL_ALERT_MSG_INSUFFICIENT_SECURITY MBEDTLS_SSL_ALERT_MSG_INSUFFICIENT_SECURITY -#define SSL_ALERT_MSG_INTERNAL_ERROR MBEDTLS_SSL_ALERT_MSG_INTERNAL_ERROR -#define SSL_ALERT_MSG_NO_APPLICATION_PROTOCOL MBEDTLS_SSL_ALERT_MSG_NO_APPLICATION_PROTOCOL -#define SSL_ALERT_MSG_NO_CERT MBEDTLS_SSL_ALERT_MSG_NO_CERT -#define SSL_ALERT_MSG_NO_RENEGOTIATION MBEDTLS_SSL_ALERT_MSG_NO_RENEGOTIATION -#define SSL_ALERT_MSG_PROTOCOL_VERSION MBEDTLS_SSL_ALERT_MSG_PROTOCOL_VERSION -#define SSL_ALERT_MSG_RECORD_OVERFLOW MBEDTLS_SSL_ALERT_MSG_RECORD_OVERFLOW -#define SSL_ALERT_MSG_UNEXPECTED_MESSAGE MBEDTLS_SSL_ALERT_MSG_UNEXPECTED_MESSAGE -#define SSL_ALERT_MSG_UNKNOWN_CA MBEDTLS_SSL_ALERT_MSG_UNKNOWN_CA -#define SSL_ALERT_MSG_UNKNOWN_PSK_IDENTITY MBEDTLS_SSL_ALERT_MSG_UNKNOWN_PSK_IDENTITY -#define SSL_ALERT_MSG_UNRECOGNIZED_NAME MBEDTLS_SSL_ALERT_MSG_UNRECOGNIZED_NAME -#define SSL_ALERT_MSG_UNSUPPORTED_CERT MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT -#define SSL_ALERT_MSG_UNSUPPORTED_EXT MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_EXT -#define SSL_ALERT_MSG_USER_CANCELED MBEDTLS_SSL_ALERT_MSG_USER_CANCELED -#define SSL_ANTI_REPLAY_DISABLED MBEDTLS_SSL_ANTI_REPLAY_DISABLED -#define SSL_ANTI_REPLAY_ENABLED MBEDTLS_SSL_ANTI_REPLAY_ENABLED -#define SSL_ARC4_DISABLED MBEDTLS_SSL_ARC4_DISABLED -#define SSL_ARC4_ENABLED MBEDTLS_SSL_ARC4_ENABLED -#define SSL_BUFFER_LEN ( ( ( MBEDTLS_SSL_IN_BUFFER_LEN ) < ( MBEDTLS_SSL_OUT_BUFFER_LEN ) ) \ - ? ( MBEDTLS_SSL_IN_BUFFER_LEN ) : ( MBEDTLS_SSL_OUT_BUFFER_LEN ) ) -#define SSL_CACHE_DEFAULT_MAX_ENTRIES MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES -#define SSL_CACHE_DEFAULT_TIMEOUT MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT -#define SSL_CBC_RECORD_SPLITTING_DISABLED MBEDTLS_SSL_CBC_RECORD_SPLITTING_DISABLED -#define SSL_CBC_RECORD_SPLITTING_ENABLED MBEDTLS_SSL_CBC_RECORD_SPLITTING_ENABLED -#define SSL_CERTIFICATE_REQUEST MBEDTLS_SSL_CERTIFICATE_REQUEST -#define SSL_CERTIFICATE_VERIFY MBEDTLS_SSL_CERTIFICATE_VERIFY -#define SSL_CERT_TYPE_ECDSA_SIGN MBEDTLS_SSL_CERT_TYPE_ECDSA_SIGN -#define SSL_CERT_TYPE_RSA_SIGN MBEDTLS_SSL_CERT_TYPE_RSA_SIGN -#define SSL_CHANNEL_INBOUND MBEDTLS_SSL_CHANNEL_INBOUND -#define SSL_CHANNEL_OUTBOUND MBEDTLS_SSL_CHANNEL_OUTBOUND -#define SSL_CIPHERSUITES MBEDTLS_SSL_CIPHERSUITES -#define SSL_CLIENT_CERTIFICATE MBEDTLS_SSL_CLIENT_CERTIFICATE -#define SSL_CLIENT_CHANGE_CIPHER_SPEC MBEDTLS_SSL_CLIENT_CHANGE_CIPHER_SPEC -#define SSL_CLIENT_FINISHED MBEDTLS_SSL_CLIENT_FINISHED -#define SSL_CLIENT_HELLO MBEDTLS_SSL_CLIENT_HELLO -#define SSL_CLIENT_KEY_EXCHANGE MBEDTLS_SSL_CLIENT_KEY_EXCHANGE -#define SSL_COMPRESSION_ADD MBEDTLS_SSL_COMPRESSION_ADD -#define SSL_COMPRESS_DEFLATE MBEDTLS_SSL_COMPRESS_DEFLATE -#define SSL_COMPRESS_NULL MBEDTLS_SSL_COMPRESS_NULL -#define SSL_DEBUG_BUF MBEDTLS_SSL_DEBUG_BUF -#define SSL_DEBUG_CRT MBEDTLS_SSL_DEBUG_CRT -#define SSL_DEBUG_ECP MBEDTLS_SSL_DEBUG_ECP -#define SSL_DEBUG_MPI MBEDTLS_SSL_DEBUG_MPI -#define SSL_DEBUG_MSG MBEDTLS_SSL_DEBUG_MSG -#define SSL_DEBUG_RET MBEDTLS_SSL_DEBUG_RET -#define SSL_DEFAULT_TICKET_LIFETIME MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME -#define SSL_DTLS_TIMEOUT_DFL_MAX MBEDTLS_SSL_DTLS_TIMEOUT_DFL_MAX -#define SSL_DTLS_TIMEOUT_DFL_MIN MBEDTLS_SSL_DTLS_TIMEOUT_DFL_MIN -#define SSL_EMPTY_RENEGOTIATION_INFO MBEDTLS_SSL_EMPTY_RENEGOTIATION_INFO -#define SSL_ETM_DISABLED MBEDTLS_SSL_ETM_DISABLED -#define SSL_ETM_ENABLED MBEDTLS_SSL_ETM_ENABLED -#define SSL_EXTENDED_MS_DISABLED MBEDTLS_SSL_EXTENDED_MS_DISABLED -#define SSL_EXTENDED_MS_ENABLED MBEDTLS_SSL_EXTENDED_MS_ENABLED -#define SSL_FALLBACK_SCSV MBEDTLS_SSL_FALLBACK_SCSV -#define SSL_FLUSH_BUFFERS MBEDTLS_SSL_FLUSH_BUFFERS -#define SSL_HANDSHAKE_OVER MBEDTLS_SSL_HANDSHAKE_OVER -#define SSL_HANDSHAKE_WRAPUP MBEDTLS_SSL_HANDSHAKE_WRAPUP -#define SSL_HASH_MD5 MBEDTLS_SSL_HASH_MD5 -#define SSL_HASH_NONE MBEDTLS_SSL_HASH_NONE -#define SSL_HASH_SHA1 MBEDTLS_SSL_HASH_SHA1 -#define SSL_HASH_SHA224 MBEDTLS_SSL_HASH_SHA224 -#define SSL_HASH_SHA256 MBEDTLS_SSL_HASH_SHA256 -#define SSL_HASH_SHA384 MBEDTLS_SSL_HASH_SHA384 -#define SSL_HASH_SHA512 MBEDTLS_SSL_HASH_SHA512 -#define SSL_HELLO_REQUEST MBEDTLS_SSL_HELLO_REQUEST -#define SSL_HS_CERTIFICATE MBEDTLS_SSL_HS_CERTIFICATE -#define SSL_HS_CERTIFICATE_REQUEST MBEDTLS_SSL_HS_CERTIFICATE_REQUEST -#define SSL_HS_CERTIFICATE_VERIFY MBEDTLS_SSL_HS_CERTIFICATE_VERIFY -#define SSL_HS_CLIENT_HELLO MBEDTLS_SSL_HS_CLIENT_HELLO -#define SSL_HS_CLIENT_KEY_EXCHANGE MBEDTLS_SSL_HS_CLIENT_KEY_EXCHANGE -#define SSL_HS_FINISHED MBEDTLS_SSL_HS_FINISHED -#define SSL_HS_HELLO_REQUEST MBEDTLS_SSL_HS_HELLO_REQUEST -#define SSL_HS_HELLO_VERIFY_REQUEST MBEDTLS_SSL_HS_HELLO_VERIFY_REQUEST -#define SSL_HS_NEW_SESSION_TICKET MBEDTLS_SSL_HS_NEW_SESSION_TICKET -#define SSL_HS_SERVER_HELLO MBEDTLS_SSL_HS_SERVER_HELLO -#define SSL_HS_SERVER_HELLO_DONE MBEDTLS_SSL_HS_SERVER_HELLO_DONE -#define SSL_HS_SERVER_KEY_EXCHANGE MBEDTLS_SSL_HS_SERVER_KEY_EXCHANGE -#define SSL_INITIAL_HANDSHAKE MBEDTLS_SSL_INITIAL_HANDSHAKE -#define SSL_IS_CLIENT MBEDTLS_SSL_IS_CLIENT -#define SSL_IS_FALLBACK MBEDTLS_SSL_IS_FALLBACK -#define SSL_IS_NOT_FALLBACK MBEDTLS_SSL_IS_NOT_FALLBACK -#define SSL_IS_SERVER MBEDTLS_SSL_IS_SERVER -#define SSL_LEGACY_ALLOW_RENEGOTIATION MBEDTLS_SSL_LEGACY_ALLOW_RENEGOTIATION -#define SSL_LEGACY_BREAK_HANDSHAKE MBEDTLS_SSL_LEGACY_BREAK_HANDSHAKE -#define SSL_LEGACY_NO_RENEGOTIATION MBEDTLS_SSL_LEGACY_NO_RENEGOTIATION -#define SSL_LEGACY_RENEGOTIATION MBEDTLS_SSL_LEGACY_RENEGOTIATION -#define SSL_MAC_ADD MBEDTLS_SSL_MAC_ADD -#define SSL_MAJOR_VERSION_3 MBEDTLS_SSL_MAJOR_VERSION_3 -#define SSL_MAX_CONTENT_LEN MBEDTLS_SSL_MAX_CONTENT_LEN -#define SSL_MAX_FRAG_LEN_1024 MBEDTLS_SSL_MAX_FRAG_LEN_1024 -#define SSL_MAX_FRAG_LEN_2048 MBEDTLS_SSL_MAX_FRAG_LEN_2048 -#define SSL_MAX_FRAG_LEN_4096 MBEDTLS_SSL_MAX_FRAG_LEN_4096 -#define SSL_MAX_FRAG_LEN_512 MBEDTLS_SSL_MAX_FRAG_LEN_512 -#define SSL_MAX_FRAG_LEN_INVALID MBEDTLS_SSL_MAX_FRAG_LEN_INVALID -#define SSL_MAX_FRAG_LEN_NONE MBEDTLS_SSL_MAX_FRAG_LEN_NONE -#define SSL_MAX_MAJOR_VERSION MBEDTLS_SSL_MAX_MAJOR_VERSION -#define SSL_MAX_MINOR_VERSION MBEDTLS_SSL_MAX_MINOR_VERSION -#define SSL_MINOR_VERSION_0 MBEDTLS_SSL_MINOR_VERSION_0 -#define SSL_MINOR_VERSION_1 MBEDTLS_SSL_MINOR_VERSION_1 -#define SSL_MINOR_VERSION_2 MBEDTLS_SSL_MINOR_VERSION_2 -#define SSL_MINOR_VERSION_3 MBEDTLS_SSL_MINOR_VERSION_3 -#define SSL_MIN_MAJOR_VERSION MBEDTLS_SSL_MIN_MAJOR_VERSION -#define SSL_MIN_MINOR_VERSION MBEDTLS_SSL_MIN_MINOR_VERSION -#define SSL_MSG_ALERT MBEDTLS_SSL_MSG_ALERT -#define SSL_MSG_APPLICATION_DATA MBEDTLS_SSL_MSG_APPLICATION_DATA -#define SSL_MSG_CHANGE_CIPHER_SPEC MBEDTLS_SSL_MSG_CHANGE_CIPHER_SPEC -#define SSL_MSG_HANDSHAKE MBEDTLS_SSL_MSG_HANDSHAKE -#define SSL_PADDING_ADD MBEDTLS_SSL_PADDING_ADD -#define SSL_RENEGOTIATION MBEDTLS_SSL_RENEGOTIATION -#define SSL_RENEGOTIATION_DISABLED MBEDTLS_SSL_RENEGOTIATION_DISABLED -#define SSL_RENEGOTIATION_DONE MBEDTLS_SSL_RENEGOTIATION_DONE -#define SSL_RENEGOTIATION_ENABLED MBEDTLS_SSL_RENEGOTIATION_ENABLED -#define SSL_RENEGOTIATION_NOT_ENFORCED MBEDTLS_SSL_RENEGOTIATION_NOT_ENFORCED -#define SSL_RENEGOTIATION_PENDING MBEDTLS_SSL_RENEGOTIATION_PENDING -#define SSL_RENEGO_MAX_RECORDS_DEFAULT MBEDTLS_SSL_RENEGO_MAX_RECORDS_DEFAULT -#define SSL_RETRANS_FINISHED MBEDTLS_SSL_RETRANS_FINISHED -#define SSL_RETRANS_PREPARING MBEDTLS_SSL_RETRANS_PREPARING -#define SSL_RETRANS_SENDING MBEDTLS_SSL_RETRANS_SENDING -#define SSL_RETRANS_WAITING MBEDTLS_SSL_RETRANS_WAITING -#define SSL_SECURE_RENEGOTIATION MBEDTLS_SSL_SECURE_RENEGOTIATION -#define SSL_SERVER_CERTIFICATE MBEDTLS_SSL_SERVER_CERTIFICATE -#define SSL_SERVER_CHANGE_CIPHER_SPEC MBEDTLS_SSL_SERVER_CHANGE_CIPHER_SPEC -#define SSL_SERVER_FINISHED MBEDTLS_SSL_SERVER_FINISHED -#define SSL_SERVER_HELLO MBEDTLS_SSL_SERVER_HELLO -#define SSL_SERVER_HELLO_DONE MBEDTLS_SSL_SERVER_HELLO_DONE -#define SSL_SERVER_HELLO_VERIFY_REQUEST_SENT MBEDTLS_SSL_SERVER_HELLO_VERIFY_REQUEST_SENT -#define SSL_SERVER_KEY_EXCHANGE MBEDTLS_SSL_SERVER_KEY_EXCHANGE -#define SSL_SERVER_NEW_SESSION_TICKET MBEDTLS_SSL_SERVER_NEW_SESSION_TICKET -#define SSL_SESSION_TICKETS_DISABLED MBEDTLS_SSL_SESSION_TICKETS_DISABLED -#define SSL_SESSION_TICKETS_ENABLED MBEDTLS_SSL_SESSION_TICKETS_ENABLED -#define SSL_SIG_ANON MBEDTLS_SSL_SIG_ANON -#define SSL_SIG_ECDSA MBEDTLS_SSL_SIG_ECDSA -#define SSL_SIG_RSA MBEDTLS_SSL_SIG_RSA -#define SSL_TRANSPORT_DATAGRAM MBEDTLS_SSL_TRANSPORT_DATAGRAM -#define SSL_TRANSPORT_STREAM MBEDTLS_SSL_TRANSPORT_STREAM -#define SSL_TRUNCATED_HMAC_LEN MBEDTLS_SSL_TRUNCATED_HMAC_LEN -#define SSL_TRUNC_HMAC_DISABLED MBEDTLS_SSL_TRUNC_HMAC_DISABLED -#define SSL_TRUNC_HMAC_ENABLED MBEDTLS_SSL_TRUNC_HMAC_ENABLED -#define SSL_VERIFY_DATA_MAX_LEN MBEDTLS_SSL_VERIFY_DATA_MAX_LEN -#define SSL_VERIFY_NONE MBEDTLS_SSL_VERIFY_NONE -#define SSL_VERIFY_OPTIONAL MBEDTLS_SSL_VERIFY_OPTIONAL -#define SSL_VERIFY_REQUIRED MBEDTLS_SSL_VERIFY_REQUIRED -#define TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA -#define TLS_DHE_PSK_WITH_AES_128_CBC_SHA MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA -#define TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 -#define TLS_DHE_PSK_WITH_AES_128_CCM MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM -#define TLS_DHE_PSK_WITH_AES_128_CCM_8 MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM_8 -#define TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 -#define TLS_DHE_PSK_WITH_AES_256_CBC_SHA MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA -#define TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 -#define TLS_DHE_PSK_WITH_AES_256_CCM MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM -#define TLS_DHE_PSK_WITH_AES_256_CCM_8 MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM_8 -#define TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 -#define TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 -#define TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 -#define TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 -#define TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 -#define TLS_DHE_PSK_WITH_NULL_SHA MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA -#define TLS_DHE_PSK_WITH_NULL_SHA256 MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256 -#define TLS_DHE_PSK_WITH_NULL_SHA384 MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384 -#define TLS_DHE_PSK_WITH_RC4_128_SHA MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA -#define TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA -#define TLS_DHE_RSA_WITH_AES_128_CBC_SHA MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA -#define TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 -#define TLS_DHE_RSA_WITH_AES_128_CCM MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM -#define TLS_DHE_RSA_WITH_AES_128_CCM_8 MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM_8 -#define TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 -#define TLS_DHE_RSA_WITH_AES_256_CBC_SHA MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA -#define TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 -#define TLS_DHE_RSA_WITH_AES_256_CCM MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM -#define TLS_DHE_RSA_WITH_AES_256_CCM_8 MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM_8 -#define TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 -#define TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA -#define TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 -#define TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 -#define TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA -#define TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 -#define TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 -#define TLS_DHE_RSA_WITH_DES_CBC_SHA MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA -#define TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA -#define TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA -#define TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 -#define TLS_ECDHE_ECDSA_WITH_AES_128_CCM MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM -#define TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 -#define TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 -#define TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA -#define TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 -#define TLS_ECDHE_ECDSA_WITH_AES_256_CCM MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM -#define TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 -#define TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 -#define TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 -#define TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 -#define TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 -#define TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 -#define TLS_ECDHE_ECDSA_WITH_NULL_SHA MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA -#define TLS_ECDHE_ECDSA_WITH_RC4_128_SHA MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA -#define TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA -#define TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA -#define TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 -#define TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA -#define TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 -#define TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 -#define TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 -#define TLS_ECDHE_PSK_WITH_NULL_SHA MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA -#define TLS_ECDHE_PSK_WITH_NULL_SHA256 MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256 -#define TLS_ECDHE_PSK_WITH_NULL_SHA384 MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384 -#define TLS_ECDHE_PSK_WITH_RC4_128_SHA MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA -#define TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA -#define TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA -#define TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 -#define TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 -#define TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA -#define TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 -#define TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 -#define TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 -#define TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 -#define TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 -#define TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 -#define TLS_ECDHE_RSA_WITH_NULL_SHA MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA -#define TLS_ECDHE_RSA_WITH_RC4_128_SHA MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA -#define TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA -#define TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA -#define TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 -#define TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 -#define TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA -#define TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 -#define TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 -#define TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 -#define TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 -#define TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 -#define TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 -#define TLS_ECDH_ECDSA_WITH_NULL_SHA MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA -#define TLS_ECDH_ECDSA_WITH_RC4_128_SHA MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA -#define TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA -#define TLS_ECDH_RSA_WITH_AES_128_CBC_SHA MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA -#define TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 -#define TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 -#define TLS_ECDH_RSA_WITH_AES_256_CBC_SHA MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA -#define TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 -#define TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 -#define TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 -#define TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 -#define TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 -#define TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 -#define TLS_ECDH_RSA_WITH_NULL_SHA MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA -#define TLS_ECDH_RSA_WITH_RC4_128_SHA MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA -#define TLS_EXT_ALPN MBEDTLS_TLS_EXT_ALPN -#define TLS_EXT_ENCRYPT_THEN_MAC MBEDTLS_TLS_EXT_ENCRYPT_THEN_MAC -#define TLS_EXT_EXTENDED_MASTER_SECRET MBEDTLS_TLS_EXT_EXTENDED_MASTER_SECRET -#define TLS_EXT_MAX_FRAGMENT_LENGTH MBEDTLS_TLS_EXT_MAX_FRAGMENT_LENGTH -#define TLS_EXT_RENEGOTIATION_INFO MBEDTLS_TLS_EXT_RENEGOTIATION_INFO -#define TLS_EXT_SERVERNAME MBEDTLS_TLS_EXT_SERVERNAME -#define TLS_EXT_SERVERNAME_HOSTNAME MBEDTLS_TLS_EXT_SERVERNAME_HOSTNAME -#define TLS_EXT_SESSION_TICKET MBEDTLS_TLS_EXT_SESSION_TICKET -#define TLS_EXT_SIG_ALG MBEDTLS_TLS_EXT_SIG_ALG -#define TLS_EXT_SUPPORTED_ELLIPTIC_CURVES MBEDTLS_TLS_EXT_SUPPORTED_ELLIPTIC_CURVES -#define TLS_EXT_SUPPORTED_POINT_FORMATS MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS -#define TLS_EXT_SUPPORTED_POINT_FORMATS_PRESENT MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS_PRESENT -#define TLS_EXT_TRUNCATED_HMAC MBEDTLS_TLS_EXT_TRUNCATED_HMAC -#define TLS_PSK_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA -#define TLS_PSK_WITH_AES_128_CBC_SHA MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA -#define TLS_PSK_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256 -#define TLS_PSK_WITH_AES_128_CCM MBEDTLS_TLS_PSK_WITH_AES_128_CCM -#define TLS_PSK_WITH_AES_128_CCM_8 MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8 -#define TLS_PSK_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256 -#define TLS_PSK_WITH_AES_256_CBC_SHA MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA -#define TLS_PSK_WITH_AES_256_CBC_SHA384 MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384 -#define TLS_PSK_WITH_AES_256_CCM MBEDTLS_TLS_PSK_WITH_AES_256_CCM -#define TLS_PSK_WITH_AES_256_CCM_8 MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8 -#define TLS_PSK_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384 -#define TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 -#define TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 -#define TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 -#define TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 -#define TLS_PSK_WITH_NULL_SHA MBEDTLS_TLS_PSK_WITH_NULL_SHA -#define TLS_PSK_WITH_NULL_SHA256 MBEDTLS_TLS_PSK_WITH_NULL_SHA256 -#define TLS_PSK_WITH_NULL_SHA384 MBEDTLS_TLS_PSK_WITH_NULL_SHA384 -#define TLS_PSK_WITH_RC4_128_SHA MBEDTLS_TLS_PSK_WITH_RC4_128_SHA -#define TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA -#define TLS_RSA_PSK_WITH_AES_128_CBC_SHA MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA -#define TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 -#define TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 -#define TLS_RSA_PSK_WITH_AES_256_CBC_SHA MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA -#define TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 -#define TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 -#define TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 -#define TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 -#define TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 -#define TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 -#define TLS_RSA_PSK_WITH_NULL_SHA MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA -#define TLS_RSA_PSK_WITH_NULL_SHA256 MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256 -#define TLS_RSA_PSK_WITH_NULL_SHA384 MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384 -#define TLS_RSA_PSK_WITH_RC4_128_SHA MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA -#define TLS_RSA_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA -#define TLS_RSA_WITH_AES_128_CBC_SHA MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA -#define TLS_RSA_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256 -#define TLS_RSA_WITH_AES_128_CCM MBEDTLS_TLS_RSA_WITH_AES_128_CCM -#define TLS_RSA_WITH_AES_128_CCM_8 MBEDTLS_TLS_RSA_WITH_AES_128_CCM_8 -#define TLS_RSA_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256 -#define TLS_RSA_WITH_AES_256_CBC_SHA MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA -#define TLS_RSA_WITH_AES_256_CBC_SHA256 MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256 -#define TLS_RSA_WITH_AES_256_CCM MBEDTLS_TLS_RSA_WITH_AES_256_CCM -#define TLS_RSA_WITH_AES_256_CCM_8 MBEDTLS_TLS_RSA_WITH_AES_256_CCM_8 -#define TLS_RSA_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384 -#define TLS_RSA_WITH_CAMELLIA_128_CBC_SHA MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA -#define TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 -#define TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 -#define TLS_RSA_WITH_CAMELLIA_256_CBC_SHA MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA -#define TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 -#define TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 -#define TLS_RSA_WITH_DES_CBC_SHA MBEDTLS_TLS_RSA_WITH_DES_CBC_SHA -#define TLS_RSA_WITH_NULL_MD5 MBEDTLS_TLS_RSA_WITH_NULL_MD5 -#define TLS_RSA_WITH_NULL_SHA MBEDTLS_TLS_RSA_WITH_NULL_SHA -#define TLS_RSA_WITH_NULL_SHA256 MBEDTLS_TLS_RSA_WITH_NULL_SHA256 -#define TLS_RSA_WITH_RC4_128_MD5 MBEDTLS_TLS_RSA_WITH_RC4_128_MD5 -#define TLS_RSA_WITH_RC4_128_SHA MBEDTLS_TLS_RSA_WITH_RC4_128_SHA -#define X509_CRT_VERSION_1 MBEDTLS_X509_CRT_VERSION_1 -#define X509_CRT_VERSION_2 MBEDTLS_X509_CRT_VERSION_2 -#define X509_CRT_VERSION_3 MBEDTLS_X509_CRT_VERSION_3 -#define X509_FORMAT_DER MBEDTLS_X509_FORMAT_DER -#define X509_FORMAT_PEM MBEDTLS_X509_FORMAT_PEM -#define X509_MAX_DN_NAME_SIZE MBEDTLS_X509_MAX_DN_NAME_SIZE -#define X509_RFC5280_MAX_SERIAL_LEN MBEDTLS_X509_RFC5280_MAX_SERIAL_LEN -#define X509_RFC5280_UTC_TIME_LEN MBEDTLS_X509_RFC5280_UTC_TIME_LEN -#define XTEA_DECRYPT MBEDTLS_XTEA_DECRYPT -#define XTEA_ENCRYPT MBEDTLS_XTEA_ENCRYPT -#define _asn1_bitstring mbedtls_asn1_bitstring -#define _asn1_buf mbedtls_asn1_buf -#define _asn1_named_data mbedtls_asn1_named_data -#define _asn1_sequence mbedtls_asn1_sequence -#define _ssl_cache_context mbedtls_ssl_cache_context -#define _ssl_cache_entry mbedtls_ssl_cache_entry -#define _ssl_ciphersuite_t mbedtls_ssl_ciphersuite_t -#define _ssl_context mbedtls_ssl_context -#define _ssl_flight_item mbedtls_ssl_flight_item -#define _ssl_handshake_params mbedtls_ssl_handshake_params -#define _ssl_key_cert mbedtls_ssl_key_cert -#define _ssl_premaster_secret mbedtls_ssl_premaster_secret -#define _ssl_session mbedtls_ssl_session -#define _ssl_transform mbedtls_ssl_transform -#define _x509_crl mbedtls_x509_crl -#define _x509_crl_entry mbedtls_x509_crl_entry -#define _x509_crt mbedtls_x509_crt -#define _x509_csr mbedtls_x509_csr -#define _x509_time mbedtls_x509_time -#define _x509write_cert mbedtls_x509write_cert -#define _x509write_csr mbedtls_x509write_csr -#define aes_context mbedtls_aes_context -#define aes_crypt_cbc mbedtls_aes_crypt_cbc -#define aes_crypt_cfb128 mbedtls_aes_crypt_cfb128 -#define aes_crypt_cfb8 mbedtls_aes_crypt_cfb8 -#define aes_crypt_ctr mbedtls_aes_crypt_ctr -#define aes_crypt_ecb mbedtls_aes_crypt_ecb -#define aes_free mbedtls_aes_free -#define aes_init mbedtls_aes_init -#define aes_self_test mbedtls_aes_self_test -#define aes_setkey_dec mbedtls_aes_setkey_dec -#define aes_setkey_enc mbedtls_aes_setkey_enc -#define aesni_crypt_ecb mbedtls_aesni_crypt_ecb -#define aesni_gcm_mult mbedtls_aesni_gcm_mult -#define aesni_inverse_key mbedtls_aesni_inverse_key -#define aesni_setkey_enc mbedtls_aesni_setkey_enc -#define aesni_supports mbedtls_aesni_has_support -#define alarmed mbedtls_timing_alarmed -#define arc4_context mbedtls_arc4_context -#define arc4_crypt mbedtls_arc4_crypt -#define arc4_free mbedtls_arc4_free -#define arc4_init mbedtls_arc4_init -#define arc4_self_test mbedtls_arc4_self_test -#define arc4_setup mbedtls_arc4_setup -#define asn1_bitstring mbedtls_asn1_bitstring -#define asn1_buf mbedtls_asn1_buf -#define asn1_find_named_data mbedtls_asn1_find_named_data -#define asn1_free_named_data mbedtls_asn1_free_named_data -#define asn1_free_named_data_list mbedtls_asn1_free_named_data_list -#define asn1_get_alg mbedtls_asn1_get_alg -#define asn1_get_alg_null mbedtls_asn1_get_alg_null -#define asn1_get_bitstring mbedtls_asn1_get_bitstring -#define asn1_get_bitstring_null mbedtls_asn1_get_bitstring_null -#define asn1_get_bool mbedtls_asn1_get_bool -#define asn1_get_int mbedtls_asn1_get_int -#define asn1_get_len mbedtls_asn1_get_len -#define asn1_get_mpi mbedtls_asn1_get_mpi -#define asn1_get_sequence_of mbedtls_asn1_get_sequence_of -#define asn1_get_tag mbedtls_asn1_get_tag -#define asn1_named_data mbedtls_asn1_named_data -#define asn1_sequence mbedtls_asn1_sequence -#define asn1_store_named_data mbedtls_asn1_store_named_data -#define asn1_write_algorithm_identifier mbedtls_asn1_write_algorithm_identifier -#define asn1_write_bitstring mbedtls_asn1_write_bitstring -#define asn1_write_bool mbedtls_asn1_write_bool -#define asn1_write_ia5_string mbedtls_asn1_write_ia5_string -#define asn1_write_int mbedtls_asn1_write_int -#define asn1_write_len mbedtls_asn1_write_len -#define asn1_write_mpi mbedtls_asn1_write_mpi -#define asn1_write_null mbedtls_asn1_write_null -#define asn1_write_octet_string mbedtls_asn1_write_octet_string -#define asn1_write_oid mbedtls_asn1_write_oid -#define asn1_write_printable_string mbedtls_asn1_write_printable_string -#define asn1_write_raw_buffer mbedtls_asn1_write_raw_buffer -#define asn1_write_tag mbedtls_asn1_write_tag -#define base64_decode mbedtls_base64_decode -#define base64_encode mbedtls_base64_encode -#define base64_self_test mbedtls_base64_self_test -#define blowfish_context mbedtls_blowfish_context -#define blowfish_crypt_cbc mbedtls_blowfish_crypt_cbc -#define blowfish_crypt_cfb64 mbedtls_blowfish_crypt_cfb64 -#define blowfish_crypt_ctr mbedtls_blowfish_crypt_ctr -#define blowfish_crypt_ecb mbedtls_blowfish_crypt_ecb -#define blowfish_free mbedtls_blowfish_free -#define blowfish_init mbedtls_blowfish_init -#define blowfish_setkey mbedtls_blowfish_setkey -#define camellia_context mbedtls_camellia_context -#define camellia_crypt_cbc mbedtls_camellia_crypt_cbc -#define camellia_crypt_cfb128 mbedtls_camellia_crypt_cfb128 -#define camellia_crypt_ctr mbedtls_camellia_crypt_ctr -#define camellia_crypt_ecb mbedtls_camellia_crypt_ecb -#define camellia_free mbedtls_camellia_free -#define camellia_init mbedtls_camellia_init -#define camellia_self_test mbedtls_camellia_self_test -#define camellia_setkey_dec mbedtls_camellia_setkey_dec -#define camellia_setkey_enc mbedtls_camellia_setkey_enc -#define ccm_auth_decrypt mbedtls_ccm_auth_decrypt -#define ccm_context mbedtls_ccm_context -#define ccm_encrypt_and_tag mbedtls_ccm_encrypt_and_tag -#define ccm_free mbedtls_ccm_free -#define ccm_init mbedtls_ccm_init -#define ccm_self_test mbedtls_ccm_self_test -#define cipher_auth_decrypt mbedtls_cipher_auth_decrypt -#define cipher_auth_encrypt mbedtls_cipher_auth_encrypt -#define cipher_base_t mbedtls_cipher_base_t -#define cipher_check_tag mbedtls_cipher_check_tag -#define cipher_context_t mbedtls_cipher_context_t -#define cipher_crypt mbedtls_cipher_crypt -#define cipher_definition_t mbedtls_cipher_definition_t -#define cipher_definitions mbedtls_cipher_definitions -#define cipher_finish mbedtls_cipher_finish -#define cipher_free mbedtls_cipher_free -#define cipher_get_block_size mbedtls_cipher_get_block_size -#define cipher_get_cipher_mode mbedtls_cipher_get_cipher_mode -#define cipher_get_iv_size mbedtls_cipher_get_iv_size -#define cipher_get_key_size mbedtls_cipher_get_key_bitlen -#define cipher_get_name mbedtls_cipher_get_name -#define cipher_get_operation mbedtls_cipher_get_operation -#define cipher_get_type mbedtls_cipher_get_type -#define cipher_id_t mbedtls_cipher_id_t -#define cipher_info_from_string mbedtls_cipher_info_from_string -#define cipher_info_from_type mbedtls_cipher_info_from_type -#define cipher_info_from_values mbedtls_cipher_info_from_values -#define cipher_info_t mbedtls_cipher_info_t -#define cipher_init mbedtls_cipher_init -#define cipher_init_ctx mbedtls_cipher_setup -#define cipher_list mbedtls_cipher_list -#define cipher_mode_t mbedtls_cipher_mode_t -#define cipher_padding_t mbedtls_cipher_padding_t -#define cipher_reset mbedtls_cipher_reset -#define cipher_set_iv mbedtls_cipher_set_iv -#define cipher_set_padding_mode mbedtls_cipher_set_padding_mode -#define cipher_setkey mbedtls_cipher_setkey -#define cipher_type_t mbedtls_cipher_type_t -#define cipher_update mbedtls_cipher_update -#define cipher_update_ad mbedtls_cipher_update_ad -#define cipher_write_tag mbedtls_cipher_write_tag -#define ctr_drbg_context mbedtls_ctr_drbg_context -#define ctr_drbg_free mbedtls_ctr_drbg_free -#define ctr_drbg_init mbedtls_ctr_drbg_init -#define ctr_drbg_random mbedtls_ctr_drbg_random -#define ctr_drbg_random_with_add mbedtls_ctr_drbg_random_with_add -#define ctr_drbg_reseed mbedtls_ctr_drbg_reseed -#define ctr_drbg_self_test mbedtls_ctr_drbg_self_test -#define ctr_drbg_set_entropy_len mbedtls_ctr_drbg_set_entropy_len -#define ctr_drbg_set_prediction_resistance mbedtls_ctr_drbg_set_prediction_resistance -#define ctr_drbg_set_reseed_interval mbedtls_ctr_drbg_set_reseed_interval -#define ctr_drbg_update mbedtls_ctr_drbg_update -#define ctr_drbg_update_seed_file mbedtls_ctr_drbg_update_seed_file -#define ctr_drbg_write_seed_file mbedtls_ctr_drbg_write_seed_file -#define debug_print_buf mbedtls_debug_print_buf -#define debug_print_crt mbedtls_debug_print_crt -#define debug_print_ecp mbedtls_debug_print_ecp -#define debug_print_mpi mbedtls_debug_print_mpi -#define debug_print_msg mbedtls_debug_print_msg -#define debug_print_ret mbedtls_debug_print_ret -#define debug_set_threshold mbedtls_debug_set_threshold -#define des3_context mbedtls_des3_context -#define des3_crypt_cbc mbedtls_des3_crypt_cbc -#define des3_crypt_ecb mbedtls_des3_crypt_ecb -#define des3_free mbedtls_des3_free -#define des3_init mbedtls_des3_init -#define des3_set2key_dec mbedtls_des3_set2key_dec -#define des3_set2key_enc mbedtls_des3_set2key_enc -#define des3_set3key_dec mbedtls_des3_set3key_dec -#define des3_set3key_enc mbedtls_des3_set3key_enc -#define des_context mbedtls_des_context -#define des_crypt_cbc mbedtls_des_crypt_cbc -#define des_crypt_ecb mbedtls_des_crypt_ecb -#define des_free mbedtls_des_free -#define des_init mbedtls_des_init -#define des_key_check_key_parity mbedtls_des_key_check_key_parity -#define des_key_check_weak mbedtls_des_key_check_weak -#define des_key_set_parity mbedtls_des_key_set_parity -#define des_self_test mbedtls_des_self_test -#define des_setkey_dec mbedtls_des_setkey_dec -#define des_setkey_enc mbedtls_des_setkey_enc -#define dhm_calc_secret mbedtls_dhm_calc_secret -#define dhm_context mbedtls_dhm_context -#define dhm_free mbedtls_dhm_free -#define dhm_init mbedtls_dhm_init -#define dhm_make_params mbedtls_dhm_make_params -#define dhm_make_public mbedtls_dhm_make_public -#define dhm_parse_dhm mbedtls_dhm_parse_dhm -#define dhm_parse_dhmfile mbedtls_dhm_parse_dhmfile -#define dhm_read_params mbedtls_dhm_read_params -#define dhm_read_public mbedtls_dhm_read_public -#define dhm_self_test mbedtls_dhm_self_test -#define ecdh_calc_secret mbedtls_ecdh_calc_secret -#define ecdh_compute_shared mbedtls_ecdh_compute_shared -#define ecdh_context mbedtls_ecdh_context -#define ecdh_free mbedtls_ecdh_free -#define ecdh_gen_public mbedtls_ecdh_gen_public -#define ecdh_get_params mbedtls_ecdh_get_params -#define ecdh_init mbedtls_ecdh_init -#define ecdh_make_params mbedtls_ecdh_make_params -#define ecdh_make_public mbedtls_ecdh_make_public -#define ecdh_read_params mbedtls_ecdh_read_params -#define ecdh_read_public mbedtls_ecdh_read_public -#define ecdh_side mbedtls_ecdh_side -#define ecdsa_context mbedtls_ecdsa_context -#define ecdsa_free mbedtls_ecdsa_free -#define ecdsa_from_keypair mbedtls_ecdsa_from_keypair -#define ecdsa_genkey mbedtls_ecdsa_genkey -#define ecdsa_info mbedtls_ecdsa_info -#define ecdsa_init mbedtls_ecdsa_init -#define ecdsa_read_signature mbedtls_ecdsa_read_signature -#define ecdsa_sign mbedtls_ecdsa_sign -#define ecdsa_sign_det mbedtls_ecdsa_sign_det -#define ecdsa_verify mbedtls_ecdsa_verify -#define ecdsa_write_signature mbedtls_ecdsa_write_signature -#define ecdsa_write_signature_det mbedtls_ecdsa_write_signature_det -#define eckey_info mbedtls_eckey_info -#define eckeydh_info mbedtls_eckeydh_info -#define ecp_check_privkey mbedtls_ecp_check_privkey -#define ecp_check_pub_priv mbedtls_ecp_check_pub_priv -#define ecp_check_pubkey mbedtls_ecp_check_pubkey -#define ecp_copy mbedtls_ecp_copy -#define ecp_curve_info mbedtls_ecp_curve_info -#define ecp_curve_info_from_grp_id mbedtls_ecp_curve_info_from_grp_id -#define ecp_curve_info_from_name mbedtls_ecp_curve_info_from_name -#define ecp_curve_info_from_tls_id mbedtls_ecp_curve_info_from_tls_id -#define ecp_curve_list mbedtls_ecp_curve_list -#define ecp_gen_key mbedtls_ecp_gen_key -#define ecp_gen_keypair mbedtls_ecp_gen_keypair -#define ecp_group mbedtls_ecp_group -#define ecp_group_copy mbedtls_ecp_group_copy -#define ecp_group_free mbedtls_ecp_group_free -#define ecp_group_id mbedtls_ecp_group_id -#define ecp_group_init mbedtls_ecp_group_init -#define ecp_grp_id_list mbedtls_ecp_grp_id_list -#define ecp_is_zero mbedtls_ecp_is_zero -#define ecp_keypair mbedtls_ecp_keypair -#define ecp_keypair_free mbedtls_ecp_keypair_free -#define ecp_keypair_init mbedtls_ecp_keypair_init -#define ecp_mul mbedtls_ecp_mul -#define ecp_point mbedtls_ecp_point -#define ecp_point_free mbedtls_ecp_point_free -#define ecp_point_init mbedtls_ecp_point_init -#define ecp_point_read_binary mbedtls_ecp_point_read_binary -#define ecp_point_read_string mbedtls_ecp_point_read_string -#define ecp_point_write_binary mbedtls_ecp_point_write_binary -#define ecp_self_test mbedtls_ecp_self_test -#define ecp_set_zero mbedtls_ecp_set_zero -#define ecp_tls_read_group mbedtls_ecp_tls_read_group -#define ecp_tls_read_point mbedtls_ecp_tls_read_point -#define ecp_tls_write_group mbedtls_ecp_tls_write_group -#define ecp_tls_write_point mbedtls_ecp_tls_write_point -#define ecp_use_known_dp mbedtls_ecp_group_load -#define entropy_add_source mbedtls_entropy_add_source -#define entropy_context mbedtls_entropy_context -#define entropy_free mbedtls_entropy_free -#define entropy_func mbedtls_entropy_func -#define entropy_gather mbedtls_entropy_gather -#define entropy_init mbedtls_entropy_init -#define entropy_self_test mbedtls_entropy_self_test -#define entropy_update_manual mbedtls_entropy_update_manual -#define entropy_update_seed_file mbedtls_entropy_update_seed_file -#define entropy_write_seed_file mbedtls_entropy_write_seed_file -#define error_strerror mbedtls_strerror -#define f_source_ptr mbedtls_entropy_f_source_ptr -#define gcm_auth_decrypt mbedtls_gcm_auth_decrypt -#define gcm_context mbedtls_gcm_context -#define gcm_crypt_and_tag mbedtls_gcm_crypt_and_tag -#define gcm_finish mbedtls_gcm_finish -#define gcm_free mbedtls_gcm_free -#define gcm_init mbedtls_gcm_init -#define gcm_self_test mbedtls_gcm_self_test -#define gcm_starts mbedtls_gcm_starts -#define gcm_update mbedtls_gcm_update -#define get_timer mbedtls_timing_get_timer -#define hardclock mbedtls_timing_hardclock -#define hardclock_poll mbedtls_hardclock_poll -#define havege_free mbedtls_havege_free -#define havege_init mbedtls_havege_init -#define havege_poll mbedtls_havege_poll -#define havege_random mbedtls_havege_random -#define havege_state mbedtls_havege_state -#define hmac_drbg_context mbedtls_hmac_drbg_context -#define hmac_drbg_free mbedtls_hmac_drbg_free -#define hmac_drbg_init mbedtls_hmac_drbg_init -#define hmac_drbg_random mbedtls_hmac_drbg_random -#define hmac_drbg_random_with_add mbedtls_hmac_drbg_random_with_add -#define hmac_drbg_reseed mbedtls_hmac_drbg_reseed -#define hmac_drbg_self_test mbedtls_hmac_drbg_self_test -#define hmac_drbg_set_entropy_len mbedtls_hmac_drbg_set_entropy_len -#define hmac_drbg_set_prediction_resistance mbedtls_hmac_drbg_set_prediction_resistance -#define hmac_drbg_set_reseed_interval mbedtls_hmac_drbg_set_reseed_interval -#define hmac_drbg_update mbedtls_hmac_drbg_update -#define hmac_drbg_update_seed_file mbedtls_hmac_drbg_update_seed_file -#define hmac_drbg_write_seed_file mbedtls_hmac_drbg_write_seed_file -#define hr_time mbedtls_timing_hr_time -#define key_exchange_type_t mbedtls_key_exchange_type_t -#define md mbedtls_md -#define md2 mbedtls_md2 -#define md2_context mbedtls_md2_context -#define md2_finish mbedtls_md2_finish -#define md2_free mbedtls_md2_free -#define md2_info mbedtls_md2_info -#define md2_init mbedtls_md2_init -#define md2_process mbedtls_md2_process -#define md2_self_test mbedtls_md2_self_test -#define md2_starts mbedtls_md2_starts -#define md2_update mbedtls_md2_update -#define md4 mbedtls_md4 -#define md4_context mbedtls_md4_context -#define md4_finish mbedtls_md4_finish -#define md4_free mbedtls_md4_free -#define md4_info mbedtls_md4_info -#define md4_init mbedtls_md4_init -#define md4_process mbedtls_md4_process -#define md4_self_test mbedtls_md4_self_test -#define md4_starts mbedtls_md4_starts -#define md4_update mbedtls_md4_update -#define md5 mbedtls_md5 -#define md5_context mbedtls_md5_context -#define md5_finish mbedtls_md5_finish -#define md5_free mbedtls_md5_free -#define md5_info mbedtls_md5_info -#define md5_init mbedtls_md5_init -#define md5_process mbedtls_md5_process -#define md5_self_test mbedtls_md5_self_test -#define md5_starts mbedtls_md5_starts -#define md5_update mbedtls_md5_update -#define md_context_t mbedtls_md_context_t -#define md_file mbedtls_md_file -#define md_finish mbedtls_md_finish -#define md_free mbedtls_md_free -#define md_get_name mbedtls_md_get_name -#define md_get_size mbedtls_md_get_size -#define md_get_type mbedtls_md_get_type -#define md_hmac mbedtls_md_hmac -#define md_hmac_finish mbedtls_md_hmac_finish -#define md_hmac_reset mbedtls_md_hmac_reset -#define md_hmac_starts mbedtls_md_hmac_starts -#define md_hmac_update mbedtls_md_hmac_update -#define md_info_from_string mbedtls_md_info_from_string -#define md_info_from_type mbedtls_md_info_from_type -#define md_info_t mbedtls_md_info_t -#define md_init mbedtls_md_init -#define md_init_ctx mbedtls_md_init_ctx -#define md_list mbedtls_md_list -#define md_process mbedtls_md_process -#define md_starts mbedtls_md_starts -#define md_type_t mbedtls_md_type_t -#define md_update mbedtls_md_update -#define memory_buffer_alloc_cur_get mbedtls_memory_buffer_alloc_cur_get -#define memory_buffer_alloc_free mbedtls_memory_buffer_alloc_free -#define memory_buffer_alloc_init mbedtls_memory_buffer_alloc_init -#define memory_buffer_alloc_max_get mbedtls_memory_buffer_alloc_max_get -#define memory_buffer_alloc_max_reset mbedtls_memory_buffer_alloc_max_reset -#define memory_buffer_alloc_self_test mbedtls_memory_buffer_alloc_self_test -#define memory_buffer_alloc_status mbedtls_memory_buffer_alloc_status -#define memory_buffer_alloc_verify mbedtls_memory_buffer_alloc_verify -#define memory_buffer_set_verify mbedtls_memory_buffer_set_verify -#define mpi mbedtls_mpi -#define mpi_add_abs mbedtls_mpi_add_abs -#define mpi_add_int mbedtls_mpi_add_int -#define mpi_add_mpi mbedtls_mpi_add_mpi -#define mpi_cmp_abs mbedtls_mpi_cmp_abs -#define mpi_cmp_int mbedtls_mpi_cmp_int -#define mpi_cmp_mpi mbedtls_mpi_cmp_mpi -#define mpi_copy mbedtls_mpi_copy -#define mpi_div_int mbedtls_mpi_div_int -#define mpi_div_mpi mbedtls_mpi_div_mpi -#define mpi_exp_mod mbedtls_mpi_exp_mod -#define mpi_fill_random mbedtls_mpi_fill_random -#define mpi_free mbedtls_mpi_free -#define mpi_gcd mbedtls_mpi_gcd -#define mpi_gen_prime mbedtls_mpi_gen_prime -#define mpi_get_bit mbedtls_mpi_get_bit -#define mpi_grow mbedtls_mpi_grow -#define mpi_init mbedtls_mpi_init -#define mpi_inv_mod mbedtls_mpi_inv_mod -#define mpi_is_prime mbedtls_mpi_is_prime -#define mpi_lsb mbedtls_mpi_lsb -#define mpi_lset mbedtls_mpi_lset -#define mpi_mod_int mbedtls_mpi_mod_int -#define mpi_mod_mpi mbedtls_mpi_mod_mpi -#define mpi_msb mbedtls_mpi_bitlen -#define mpi_mul_int mbedtls_mpi_mul_int -#define mpi_mul_mpi mbedtls_mpi_mul_mpi -#define mpi_read_binary mbedtls_mpi_read_binary -#define mpi_read_file mbedtls_mpi_read_file -#define mpi_read_string mbedtls_mpi_read_string -#define mpi_safe_cond_assign mbedtls_mpi_safe_cond_assign -#define mpi_safe_cond_swap mbedtls_mpi_safe_cond_swap -#define mpi_self_test mbedtls_mpi_self_test -#define mpi_set_bit mbedtls_mpi_set_bit -#define mpi_shift_l mbedtls_mpi_shift_l -#define mpi_shift_r mbedtls_mpi_shift_r -#define mpi_shrink mbedtls_mpi_shrink -#define mpi_size mbedtls_mpi_size -#define mpi_sub_abs mbedtls_mpi_sub_abs -#define mpi_sub_int mbedtls_mpi_sub_int -#define mpi_sub_mpi mbedtls_mpi_sub_mpi -#define mpi_swap mbedtls_mpi_swap -#define mpi_write_binary mbedtls_mpi_write_binary -#define mpi_write_file mbedtls_mpi_write_file -#define mpi_write_string mbedtls_mpi_write_string -#define net_accept mbedtls_net_accept -#define net_bind mbedtls_net_bind -#define net_close mbedtls_net_free -#define net_connect mbedtls_net_connect -#define net_recv mbedtls_net_recv -#define net_recv_timeout mbedtls_net_recv_timeout -#define net_send mbedtls_net_send -#define net_set_block mbedtls_net_set_block -#define net_set_nonblock mbedtls_net_set_nonblock -#define net_usleep mbedtls_net_usleep -#define oid_descriptor_t mbedtls_oid_descriptor_t -#define oid_get_attr_short_name mbedtls_oid_get_attr_short_name -#define oid_get_cipher_alg mbedtls_oid_get_cipher_alg -#define oid_get_ec_grp mbedtls_oid_get_ec_grp -#define oid_get_extended_key_usage mbedtls_oid_get_extended_key_usage -#define oid_get_md_alg mbedtls_oid_get_md_alg -#define oid_get_numeric_string mbedtls_oid_get_numeric_string -#define oid_get_oid_by_ec_grp mbedtls_oid_get_oid_by_ec_grp -#define oid_get_oid_by_md mbedtls_oid_get_oid_by_md -#define oid_get_oid_by_pk_alg mbedtls_oid_get_oid_by_pk_alg -#define oid_get_oid_by_sig_alg mbedtls_oid_get_oid_by_sig_alg -#define oid_get_pk_alg mbedtls_oid_get_pk_alg -#define oid_get_pkcs12_pbe_alg mbedtls_oid_get_pkcs12_pbe_alg -#define oid_get_sig_alg mbedtls_oid_get_sig_alg -#define oid_get_sig_alg_desc mbedtls_oid_get_sig_alg_desc -#define oid_get_x509_ext_type mbedtls_oid_get_x509_ext_type -#define operation_t mbedtls_operation_t -#define padlock_supports mbedtls_padlock_has_support -#define padlock_xcryptcbc mbedtls_padlock_xcryptcbc -#define padlock_xcryptecb mbedtls_padlock_xcryptecb -#define pem_context mbedtls_pem_context -#define pem_free mbedtls_pem_free -#define pem_init mbedtls_pem_init -#define pem_read_buffer mbedtls_pem_read_buffer -#define pem_write_buffer mbedtls_pem_write_buffer -#define pk_can_do mbedtls_pk_can_do -#define pk_check_pair mbedtls_pk_check_pair -#define pk_context mbedtls_pk_context -#define pk_debug mbedtls_pk_debug -#define pk_debug_item mbedtls_pk_debug_item -#define pk_debug_type mbedtls_pk_debug_type -#define pk_decrypt mbedtls_pk_decrypt -#define pk_ec mbedtls_pk_ec -#define pk_encrypt mbedtls_pk_encrypt -#define pk_free mbedtls_pk_free -#define pk_get_len mbedtls_pk_get_len -#define pk_get_name mbedtls_pk_get_name -#define pk_get_size mbedtls_pk_get_bitlen -#define pk_get_type mbedtls_pk_get_type -#define pk_info_from_type mbedtls_pk_info_from_type -#define pk_info_t mbedtls_pk_info_t -#define pk_init mbedtls_pk_init -#define pk_init_ctx mbedtls_pk_setup -#define pk_init_ctx_rsa_alt mbedtls_pk_setup_rsa_alt -#define pk_load_file mbedtls_pk_load_file -#define pk_parse_key mbedtls_pk_parse_key -#define pk_parse_keyfile mbedtls_pk_parse_keyfile -#define pk_parse_public_key mbedtls_pk_parse_public_key -#define pk_parse_public_keyfile mbedtls_pk_parse_public_keyfile -#define pk_parse_subpubkey mbedtls_pk_parse_subpubkey -#define pk_rsa mbedtls_pk_rsa -#define pk_rsa_alt_decrypt_func mbedtls_pk_rsa_alt_decrypt_func -#define pk_rsa_alt_key_len_func mbedtls_pk_rsa_alt_key_len_func -#define pk_rsa_alt_sign_func mbedtls_pk_rsa_alt_sign_func -#define pk_rsassa_pss_options mbedtls_pk_rsassa_pss_options -#define pk_sign mbedtls_pk_sign -#define pk_type_t mbedtls_pk_type_t -#define pk_verify mbedtls_pk_verify -#define pk_verify_ext mbedtls_pk_verify_ext -#define pk_write_key_der mbedtls_pk_write_key_der -#define pk_write_key_pem mbedtls_pk_write_key_pem -#define pk_write_pubkey mbedtls_pk_write_pubkey -#define pk_write_pubkey_der mbedtls_pk_write_pubkey_der -#define pk_write_pubkey_pem mbedtls_pk_write_pubkey_pem -#define pkcs11_context mbedtls_pkcs11_context -#define pkcs11_decrypt mbedtls_pkcs11_decrypt -#define pkcs11_priv_key_free mbedtls_pkcs11_priv_key_free -#define pkcs11_priv_key_init mbedtls_pkcs11_priv_key_bind -#define pkcs11_sign mbedtls_pkcs11_sign -#define pkcs11_x509_cert_init mbedtls_pkcs11_x509_cert_bind -#define pkcs12_derivation mbedtls_pkcs12_derivation -#define pkcs12_pbe mbedtls_pkcs12_pbe -#define pkcs12_pbe_sha1_rc4_128 mbedtls_pkcs12_pbe_sha1_rc4_128 -#define pkcs5_pbes2 mbedtls_pkcs5_pbes2 -#define pkcs5_pbkdf2_hmac mbedtls_pkcs5_pbkdf2_hmac -#define pkcs5_self_test mbedtls_pkcs5_self_test -#define platform_entropy_poll mbedtls_platform_entropy_poll -#define platform_set_exit mbedtls_platform_set_exit -#define platform_set_fprintf mbedtls_platform_set_fprintf -#define platform_set_printf mbedtls_platform_set_printf -#define platform_set_snprintf mbedtls_platform_set_snprintf -#define polarssl_exit mbedtls_exit -#define polarssl_fprintf mbedtls_fprintf -#define polarssl_free mbedtls_free -#define polarssl_mutex_free mbedtls_mutex_free -#define polarssl_mutex_init mbedtls_mutex_init -#define polarssl_mutex_lock mbedtls_mutex_lock -#define polarssl_mutex_unlock mbedtls_mutex_unlock -#define polarssl_printf mbedtls_printf -#define polarssl_snprintf mbedtls_snprintf -#define polarssl_strerror mbedtls_strerror -#define ripemd160 mbedtls_ripemd160 -#define ripemd160_context mbedtls_ripemd160_context -#define ripemd160_finish mbedtls_ripemd160_finish -#define ripemd160_free mbedtls_ripemd160_free -#define ripemd160_info mbedtls_ripemd160_info -#define ripemd160_init mbedtls_ripemd160_init -#define ripemd160_process mbedtls_ripemd160_process -#define ripemd160_self_test mbedtls_ripemd160_self_test -#define ripemd160_starts mbedtls_ripemd160_starts -#define ripemd160_update mbedtls_ripemd160_update -#define rsa_alt_context mbedtls_rsa_alt_context -#define rsa_alt_info mbedtls_rsa_alt_info -#define rsa_check_privkey mbedtls_rsa_check_privkey -#define rsa_check_pub_priv mbedtls_rsa_check_pub_priv -#define rsa_check_pubkey mbedtls_rsa_check_pubkey -#define rsa_context mbedtls_rsa_context -#define rsa_copy mbedtls_rsa_copy -#define rsa_free mbedtls_rsa_free -#define rsa_gen_key mbedtls_rsa_gen_key -#define rsa_info mbedtls_rsa_info -#define rsa_init mbedtls_rsa_init -#define rsa_pkcs1_decrypt mbedtls_rsa_pkcs1_decrypt -#define rsa_pkcs1_encrypt mbedtls_rsa_pkcs1_encrypt -#define rsa_pkcs1_sign mbedtls_rsa_pkcs1_sign -#define rsa_pkcs1_verify mbedtls_rsa_pkcs1_verify -#define rsa_private mbedtls_rsa_private -#define rsa_public mbedtls_rsa_public -#define rsa_rsaes_oaep_decrypt mbedtls_rsa_rsaes_oaep_decrypt -#define rsa_rsaes_oaep_encrypt mbedtls_rsa_rsaes_oaep_encrypt -#define rsa_rsaes_pkcs1_v15_decrypt mbedtls_rsa_rsaes_pkcs1_v15_decrypt -#define rsa_rsaes_pkcs1_v15_encrypt mbedtls_rsa_rsaes_pkcs1_v15_encrypt -#define rsa_rsassa_pkcs1_v15_sign mbedtls_rsa_rsassa_pkcs1_v15_sign -#define rsa_rsassa_pkcs1_v15_verify mbedtls_rsa_rsassa_pkcs1_v15_verify -#define rsa_rsassa_pss_sign mbedtls_rsa_rsassa_pss_sign -#define rsa_rsassa_pss_verify mbedtls_rsa_rsassa_pss_verify -#define rsa_rsassa_pss_verify_ext mbedtls_rsa_rsassa_pss_verify_ext -#define rsa_self_test mbedtls_rsa_self_test -#define rsa_set_padding mbedtls_rsa_set_padding -#define safer_memcmp mbedtls_ssl_safer_memcmp -#define set_alarm mbedtls_set_alarm -#define sha1 mbedtls_sha1 -#define sha1_context mbedtls_sha1_context -#define sha1_finish mbedtls_sha1_finish -#define sha1_free mbedtls_sha1_free -#define sha1_info mbedtls_sha1_info -#define sha1_init mbedtls_sha1_init -#define sha1_process mbedtls_sha1_process -#define sha1_self_test mbedtls_sha1_self_test -#define sha1_starts mbedtls_sha1_starts -#define sha1_update mbedtls_sha1_update -#define sha224_info mbedtls_sha224_info -#define sha256 mbedtls_sha256 -#define sha256_context mbedtls_sha256_context -#define sha256_finish mbedtls_sha256_finish -#define sha256_free mbedtls_sha256_free -#define sha256_info mbedtls_sha256_info -#define sha256_init mbedtls_sha256_init -#define sha256_process mbedtls_sha256_process -#define sha256_self_test mbedtls_sha256_self_test -#define sha256_starts mbedtls_sha256_starts -#define sha256_update mbedtls_sha256_update -#define sha384_info mbedtls_sha384_info -#define sha512 mbedtls_sha512 -#define sha512_context mbedtls_sha512_context -#define sha512_finish mbedtls_sha512_finish -#define sha512_free mbedtls_sha512_free -#define sha512_info mbedtls_sha512_info -#define sha512_init mbedtls_sha512_init -#define sha512_process mbedtls_sha512_process -#define sha512_self_test mbedtls_sha512_self_test -#define sha512_starts mbedtls_sha512_starts -#define sha512_update mbedtls_sha512_update -#define source_state mbedtls_entropy_source_state -#define ssl_cache_context mbedtls_ssl_cache_context -#define ssl_cache_entry mbedtls_ssl_cache_entry -#define ssl_cache_free mbedtls_ssl_cache_free -#define ssl_cache_get mbedtls_ssl_cache_get -#define ssl_cache_init mbedtls_ssl_cache_init -#define ssl_cache_set mbedtls_ssl_cache_set -#define ssl_cache_set_max_entries mbedtls_ssl_cache_set_max_entries -#define ssl_cache_set_timeout mbedtls_ssl_cache_set_timeout -#define ssl_check_cert_usage mbedtls_ssl_check_cert_usage -#define ssl_ciphersuite_from_id mbedtls_ssl_ciphersuite_from_id -#define ssl_ciphersuite_from_string mbedtls_ssl_ciphersuite_from_string -#define ssl_ciphersuite_t mbedtls_ssl_ciphersuite_t -#define ssl_ciphersuite_uses_ec mbedtls_ssl_ciphersuite_uses_ec -#define ssl_ciphersuite_uses_psk mbedtls_ssl_ciphersuite_uses_psk -#define ssl_close_notify mbedtls_ssl_close_notify -#define ssl_context mbedtls_ssl_context -#define ssl_cookie_check mbedtls_ssl_cookie_check -#define ssl_cookie_check_t mbedtls_ssl_cookie_check_t -#define ssl_cookie_ctx mbedtls_ssl_cookie_ctx -#define ssl_cookie_free mbedtls_ssl_cookie_free -#define ssl_cookie_init mbedtls_ssl_cookie_init -#define ssl_cookie_set_timeout mbedtls_ssl_cookie_set_timeout -#define ssl_cookie_setup mbedtls_ssl_cookie_setup -#define ssl_cookie_write mbedtls_ssl_cookie_write -#define ssl_cookie_write_t mbedtls_ssl_cookie_write_t -#define ssl_derive_keys mbedtls_ssl_derive_keys -#define ssl_dtls_replay_check mbedtls_ssl_dtls_replay_check -#define ssl_dtls_replay_update mbedtls_ssl_dtls_replay_update -#define ssl_fetch_input mbedtls_ssl_fetch_input -#define ssl_flight_item mbedtls_ssl_flight_item -#define ssl_flush_output mbedtls_ssl_flush_output -#define ssl_free mbedtls_ssl_free -#define ssl_get_alpn_protocol mbedtls_ssl_get_alpn_protocol -#define ssl_get_bytes_avail mbedtls_ssl_get_bytes_avail -#define ssl_get_ciphersuite mbedtls_ssl_get_ciphersuite -#define ssl_get_ciphersuite_id mbedtls_ssl_get_ciphersuite_id -#define ssl_get_ciphersuite_name mbedtls_ssl_get_ciphersuite_name -#define ssl_get_ciphersuite_sig_pk_alg mbedtls_ssl_get_ciphersuite_sig_pk_alg -#define ssl_get_peer_cert mbedtls_ssl_get_peer_cert -#define ssl_get_record_expansion mbedtls_ssl_get_record_expansion -#define ssl_get_session mbedtls_ssl_get_session -#define ssl_get_verify_result mbedtls_ssl_get_verify_result -#define ssl_get_version mbedtls_ssl_get_version -#define ssl_handshake mbedtls_ssl_handshake -#define ssl_handshake_client_step mbedtls_ssl_handshake_client_step -#define ssl_handshake_free mbedtls_ssl_handshake_free -#define ssl_handshake_params mbedtls_ssl_handshake_params -#define ssl_handshake_server_step mbedtls_ssl_handshake_server_step -#define ssl_handshake_step mbedtls_ssl_handshake_step -#define ssl_handshake_wrapup mbedtls_ssl_handshake_wrapup -#define ssl_hdr_len mbedtls_ssl_hdr_len -#define ssl_hs_hdr_len mbedtls_ssl_hs_hdr_len -#define ssl_hw_record_activate mbedtls_ssl_hw_record_activate -#define ssl_hw_record_finish mbedtls_ssl_hw_record_finish -#define ssl_hw_record_init mbedtls_ssl_hw_record_init -#define ssl_hw_record_read mbedtls_ssl_hw_record_read -#define ssl_hw_record_reset mbedtls_ssl_hw_record_reset -#define ssl_hw_record_write mbedtls_ssl_hw_record_write -#define ssl_init mbedtls_ssl_init -#define ssl_key_cert mbedtls_ssl_key_cert -#define ssl_legacy_renegotiation mbedtls_ssl_conf_legacy_renegotiation -#define ssl_list_ciphersuites mbedtls_ssl_list_ciphersuites -#define ssl_md_alg_from_hash mbedtls_ssl_md_alg_from_hash -#define ssl_optimize_checksum mbedtls_ssl_optimize_checksum -#define ssl_own_cert mbedtls_ssl_own_cert -#define ssl_own_key mbedtls_ssl_own_key -#define ssl_parse_certificate mbedtls_ssl_parse_certificate -#define ssl_parse_change_cipher_spec mbedtls_ssl_parse_change_cipher_spec -#define ssl_parse_finished mbedtls_ssl_parse_finished -#define ssl_pk_alg_from_sig mbedtls_ssl_pk_alg_from_sig -#define ssl_pkcs11_decrypt mbedtls_ssl_pkcs11_decrypt -#define ssl_pkcs11_key_len mbedtls_ssl_pkcs11_key_len -#define ssl_pkcs11_sign mbedtls_ssl_pkcs11_sign -#define ssl_psk_derive_premaster mbedtls_ssl_psk_derive_premaster -#define ssl_read mbedtls_ssl_read -#define ssl_read_record mbedtls_ssl_read_record -#define ssl_read_version mbedtls_ssl_read_version -#define ssl_recv_flight_completed mbedtls_ssl_recv_flight_completed -#define ssl_renegotiate mbedtls_ssl_renegotiate -#define ssl_resend mbedtls_ssl_resend -#define ssl_reset_checksum mbedtls_ssl_reset_checksum -#define ssl_send_alert_message mbedtls_ssl_send_alert_message -#define ssl_send_fatal_handshake_failure mbedtls_ssl_send_fatal_handshake_failure -#define ssl_send_flight_completed mbedtls_ssl_send_flight_completed -#define ssl_session mbedtls_ssl_session -#define ssl_session_free mbedtls_ssl_session_free -#define ssl_session_init mbedtls_ssl_session_init -#define ssl_session_reset mbedtls_ssl_session_reset -#define ssl_set_alpn_protocols mbedtls_ssl_conf_alpn_protocols -#define ssl_set_arc4_support mbedtls_ssl_conf_arc4_support -#define ssl_set_authmode mbedtls_ssl_conf_authmode -#define ssl_set_bio mbedtls_ssl_set_bio -#define ssl_set_ca_chain mbedtls_ssl_conf_ca_chain -#define ssl_set_cbc_record_splitting mbedtls_ssl_conf_cbc_record_splitting -#define ssl_set_ciphersuites mbedtls_ssl_conf_ciphersuites -#define ssl_set_ciphersuites_for_version mbedtls_ssl_conf_ciphersuites_for_version -#define ssl_set_client_transport_id mbedtls_ssl_set_client_transport_id -#define ssl_set_curves mbedtls_ssl_conf_curves -#define ssl_set_dbg mbedtls_ssl_conf_dbg -#define ssl_set_dh_param mbedtls_ssl_conf_dh_param -#define ssl_set_dh_param_ctx mbedtls_ssl_conf_dh_param_ctx -#define ssl_set_dtls_anti_replay mbedtls_ssl_conf_dtls_anti_replay -#define ssl_set_dtls_badmac_limit mbedtls_ssl_conf_dtls_badmac_limit -#define ssl_set_dtls_cookies mbedtls_ssl_conf_dtls_cookies -#define ssl_set_encrypt_then_mac mbedtls_ssl_conf_encrypt_then_mac -#define ssl_set_endpoint mbedtls_ssl_conf_endpoint -#define ssl_set_extended_master_secret mbedtls_ssl_conf_extended_master_secret -#define ssl_set_fallback mbedtls_ssl_conf_fallback -#define ssl_set_handshake_timeout mbedtls_ssl_conf_handshake_timeout -#define ssl_set_hostname mbedtls_ssl_set_hostname -#define ssl_set_max_frag_len mbedtls_ssl_conf_max_frag_len -#define ssl_set_max_version mbedtls_ssl_conf_max_version -#define ssl_set_min_version mbedtls_ssl_conf_min_version -#define ssl_set_own_cert mbedtls_ssl_conf_own_cert -#define ssl_set_psk mbedtls_ssl_conf_psk -#define ssl_set_psk_cb mbedtls_ssl_conf_psk_cb -#define ssl_set_renegotiation mbedtls_ssl_conf_renegotiation -#define ssl_set_renegotiation_enforced mbedtls_ssl_conf_renegotiation_enforced -#define ssl_set_renegotiation_period mbedtls_ssl_conf_renegotiation_period -#define ssl_set_rng mbedtls_ssl_conf_rng -#define ssl_set_session mbedtls_ssl_set_session -#define ssl_set_session_cache mbedtls_ssl_conf_session_cache -#define ssl_set_session_tickets mbedtls_ssl_conf_session_tickets -#define ssl_set_sni mbedtls_ssl_conf_sni -#define ssl_set_transport mbedtls_ssl_conf_transport -#define ssl_set_truncated_hmac mbedtls_ssl_conf_truncated_hmac -#define ssl_set_verify mbedtls_ssl_conf_verify -#define ssl_sig_from_pk mbedtls_ssl_sig_from_pk -#define ssl_states mbedtls_ssl_states -#define ssl_transform mbedtls_ssl_transform -#define ssl_transform_free mbedtls_ssl_transform_free -#define ssl_write mbedtls_ssl_write -#define ssl_write_certificate mbedtls_ssl_write_certificate -#define ssl_write_change_cipher_spec mbedtls_ssl_write_change_cipher_spec -#define ssl_write_finished mbedtls_ssl_write_finished -#define ssl_write_record mbedtls_ssl_write_record -#define ssl_write_version mbedtls_ssl_write_version -#define supported_ciphers mbedtls_cipher_supported -#define t_sint mbedtls_mpi_sint -#define t_udbl mbedtls_t_udbl -#define t_uint mbedtls_mpi_uint -#define test_ca_crt mbedtls_test_ca_crt -#define test_ca_crt_ec mbedtls_test_ca_crt_ec -#define test_ca_crt_rsa mbedtls_test_ca_crt_rsa -#define test_ca_key mbedtls_test_ca_key -#define test_ca_key_ec mbedtls_test_ca_key_ec -#define test_ca_key_rsa mbedtls_test_ca_key_rsa -#define test_ca_list mbedtls_test_cas_pem -#define test_ca_pwd mbedtls_test_ca_pwd -#define test_ca_pwd_ec mbedtls_test_ca_pwd_ec -#define test_ca_pwd_rsa mbedtls_test_ca_pwd_rsa -#define test_cli_crt mbedtls_test_cli_crt -#define test_cli_crt_ec mbedtls_test_cli_crt_ec -#define test_cli_crt_rsa mbedtls_test_cli_crt_rsa -#define test_cli_key mbedtls_test_cli_key -#define test_cli_key_ec mbedtls_test_cli_key_ec -#define test_cli_key_rsa mbedtls_test_cli_key_rsa -#define test_srv_crt mbedtls_test_srv_crt -#define test_srv_crt_ec mbedtls_test_srv_crt_ec -#define test_srv_crt_rsa mbedtls_test_srv_crt_rsa -#define test_srv_key mbedtls_test_srv_key -#define test_srv_key_ec mbedtls_test_srv_key_ec -#define test_srv_key_rsa mbedtls_test_srv_key_rsa -#define threading_mutex_t mbedtls_threading_mutex_t -#define threading_set_alt mbedtls_threading_set_alt -#define timing_self_test mbedtls_timing_self_test -#define version_check_feature mbedtls_version_check_feature -#define version_get_number mbedtls_version_get_number -#define version_get_string mbedtls_version_get_string -#define version_get_string_full mbedtls_version_get_string_full -#define x509_bitstring mbedtls_x509_bitstring -#define x509_buf mbedtls_x509_buf -#define x509_crl mbedtls_x509_crl -#define x509_crl_entry mbedtls_x509_crl_entry -#define x509_crl_free mbedtls_x509_crl_free -#define x509_crl_info mbedtls_x509_crl_info -#define x509_crl_init mbedtls_x509_crl_init -#define x509_crl_parse mbedtls_x509_crl_parse -#define x509_crl_parse_der mbedtls_x509_crl_parse_der -#define x509_crl_parse_file mbedtls_x509_crl_parse_file -#define x509_crt mbedtls_x509_crt -#define x509_crt_check_extended_key_usage mbedtls_x509_crt_check_extended_key_usage -#define x509_crt_check_key_usage mbedtls_x509_crt_check_key_usage -#define x509_crt_free mbedtls_x509_crt_free -#define x509_crt_info mbedtls_x509_crt_info -#define x509_crt_init mbedtls_x509_crt_init -#define x509_crt_parse mbedtls_x509_crt_parse -#define x509_crt_parse_der mbedtls_x509_crt_parse_der -#define x509_crt_parse_file mbedtls_x509_crt_parse_file -#define x509_crt_parse_path mbedtls_x509_crt_parse_path -#define x509_crt_revoked mbedtls_x509_crt_is_revoked -#define x509_crt_verify mbedtls_x509_crt_verify -#define x509_csr mbedtls_x509_csr -#define x509_csr_free mbedtls_x509_csr_free -#define x509_csr_info mbedtls_x509_csr_info -#define x509_csr_init mbedtls_x509_csr_init -#define x509_csr_parse mbedtls_x509_csr_parse -#define x509_csr_parse_der mbedtls_x509_csr_parse_der -#define x509_csr_parse_file mbedtls_x509_csr_parse_file -#define x509_dn_gets mbedtls_x509_dn_gets -#define x509_get_alg mbedtls_x509_get_alg -#define x509_get_alg_null mbedtls_x509_get_alg_null -#define x509_get_ext mbedtls_x509_get_ext -#define x509_get_name mbedtls_x509_get_name -#define x509_get_rsassa_pss_params mbedtls_x509_get_rsassa_pss_params -#define x509_get_serial mbedtls_x509_get_serial -#define x509_get_sig mbedtls_x509_get_sig -#define x509_get_sig_alg mbedtls_x509_get_sig_alg -#define x509_get_time mbedtls_x509_get_time -#define x509_key_size_helper mbedtls_x509_key_size_helper -#define x509_name mbedtls_x509_name -#define x509_self_test mbedtls_x509_self_test -#define x509_sequence mbedtls_x509_sequence -#define x509_serial_gets mbedtls_x509_serial_gets -#define x509_set_extension mbedtls_x509_set_extension -#define x509_sig_alg_gets mbedtls_x509_sig_alg_gets -#define x509_string_to_names mbedtls_x509_string_to_names -#define x509_time mbedtls_x509_time -#define x509_time_expired mbedtls_x509_time_is_past -#define x509_time_future mbedtls_x509_time_is_future -#define x509_write_extensions mbedtls_x509_write_extensions -#define x509_write_names mbedtls_x509_write_names -#define x509_write_sig mbedtls_x509_write_sig -#define x509write_cert mbedtls_x509write_cert -#define x509write_crt_der mbedtls_x509write_crt_der -#define x509write_crt_free mbedtls_x509write_crt_free -#define x509write_crt_init mbedtls_x509write_crt_init -#define x509write_crt_pem mbedtls_x509write_crt_pem -#define x509write_crt_set_authority_key_identifier mbedtls_x509write_crt_set_authority_key_identifier -#define x509write_crt_set_basic_constraints mbedtls_x509write_crt_set_basic_constraints -#define x509write_crt_set_extension mbedtls_x509write_crt_set_extension -#define x509write_crt_set_issuer_key mbedtls_x509write_crt_set_issuer_key -#define x509write_crt_set_issuer_name mbedtls_x509write_crt_set_issuer_name -#define x509write_crt_set_key_usage mbedtls_x509write_crt_set_key_usage -#define x509write_crt_set_md_alg mbedtls_x509write_crt_set_md_alg -#define x509write_crt_set_ns_cert_type mbedtls_x509write_crt_set_ns_cert_type -#define x509write_crt_set_serial mbedtls_x509write_crt_set_serial -#define x509write_crt_set_subject_key mbedtls_x509write_crt_set_subject_key -#define x509write_crt_set_subject_key_identifier mbedtls_x509write_crt_set_subject_key_identifier -#define x509write_crt_set_subject_name mbedtls_x509write_crt_set_subject_name -#define x509write_crt_set_validity mbedtls_x509write_crt_set_validity -#define x509write_crt_set_version mbedtls_x509write_crt_set_version -#define x509write_csr mbedtls_x509write_csr -#define x509write_csr_der mbedtls_x509write_csr_der -#define x509write_csr_free mbedtls_x509write_csr_free -#define x509write_csr_init mbedtls_x509write_csr_init -#define x509write_csr_pem mbedtls_x509write_csr_pem -#define x509write_csr_set_extension mbedtls_x509write_csr_set_extension -#define x509write_csr_set_key mbedtls_x509write_csr_set_key -#define x509write_csr_set_key_usage mbedtls_x509write_csr_set_key_usage -#define x509write_csr_set_md_alg mbedtls_x509write_csr_set_md_alg -#define x509write_csr_set_ns_cert_type mbedtls_x509write_csr_set_ns_cert_type -#define x509write_csr_set_subject_name mbedtls_x509write_csr_set_subject_name -#define xtea_context mbedtls_xtea_context -#define xtea_crypt_cbc mbedtls_xtea_crypt_cbc -#define xtea_crypt_ecb mbedtls_xtea_crypt_ecb -#define xtea_free mbedtls_xtea_free -#define xtea_init mbedtls_xtea_init -#define xtea_self_test mbedtls_xtea_self_test -#define xtea_setup mbedtls_xtea_setup - -#endif /* compat-1.3.h */ -#endif /* MBEDTLS_DEPRECATED_REMOVED */ diff --git a/tools/sdk/include/mbedtls/mbedtls/config.h b/tools/sdk/include/mbedtls/mbedtls/config.h deleted file mode 100644 index 81438c5b1b9..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/config.h +++ /dev/null @@ -1,3155 +0,0 @@ -/** - * \file config.h - * - * \brief Configuration options (set of defines) - * - * This set of compile-time options may be used to enable - * or disable features selectively, and reduce the global - * memory footprint. - */ -/* - * Copyright (C) 2006-2018, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_CONFIG_H -#define MBEDTLS_CONFIG_H - -#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) -#define _CRT_SECURE_NO_DEPRECATE 1 -#endif - -/** - * \name SECTION: System support - * - * This section sets system specific settings. - * \{ - */ - -/** - * \def MBEDTLS_HAVE_ASM - * - * The compiler has support for asm(). - * - * Requires support for asm() in compiler. - * - * Used in: - * library/aria.c - * library/timing.c - * include/mbedtls/bn_mul.h - * - * Required by: - * MBEDTLS_AESNI_C - * MBEDTLS_PADLOCK_C - * - * Comment to disable the use of assembly code. - */ -#define MBEDTLS_HAVE_ASM - -/** - * \def MBEDTLS_NO_UDBL_DIVISION - * - * The platform lacks support for double-width integer division (64-bit - * division on a 32-bit platform, 128-bit division on a 64-bit platform). - * - * Used in: - * include/mbedtls/bignum.h - * library/bignum.c - * - * The bignum code uses double-width division to speed up some operations. - * Double-width division is often implemented in software that needs to - * be linked with the program. The presence of a double-width integer - * type is usually detected automatically through preprocessor macros, - * but the automatic detection cannot know whether the code needs to - * and can be linked with an implementation of division for that type. - * By default division is assumed to be usable if the type is present. - * Uncomment this option to prevent the use of double-width division. - * - * Note that division for the native integer type is always required. - * Furthermore, a 64-bit type is always required even on a 32-bit - * platform, but it need not support multiplication or division. In some - * cases it is also desirable to disable some double-width operations. For - * example, if double-width division is implemented in software, disabling - * it can reduce code size in some embedded targets. - */ -//#define MBEDTLS_NO_UDBL_DIVISION - -/** - * \def MBEDTLS_NO_64BIT_MULTIPLICATION - * - * The platform lacks support for 32x32 -> 64-bit multiplication. - * - * Used in: - * library/poly1305.c - * - * Some parts of the library may use multiplication of two unsigned 32-bit - * operands with a 64-bit result in order to speed up computations. On some - * platforms, this is not available in hardware and has to be implemented in - * software, usually in a library provided by the toolchain. - * - * Sometimes it is not desirable to have to link to that library. This option - * removes the dependency of that library on platforms that lack a hardware - * 64-bit multiplier by embedding a software implementation in Mbed TLS. - * - * Note that depending on the compiler, this may decrease performance compared - * to using the library function provided by the toolchain. - */ -//#define MBEDTLS_NO_64BIT_MULTIPLICATION - -/** - * \def MBEDTLS_HAVE_SSE2 - * - * CPU supports SSE2 instruction set. - * - * Uncomment if the CPU supports SSE2 (IA-32 specific). - */ -//#define MBEDTLS_HAVE_SSE2 - -/** - * \def MBEDTLS_HAVE_TIME - * - * System has time.h and time(). - * The time does not need to be correct, only time differences are used, - * by contrast with MBEDTLS_HAVE_TIME_DATE - * - * Defining MBEDTLS_HAVE_TIME allows you to specify MBEDTLS_PLATFORM_TIME_ALT, - * MBEDTLS_PLATFORM_TIME_MACRO, MBEDTLS_PLATFORM_TIME_TYPE_MACRO and - * MBEDTLS_PLATFORM_STD_TIME. - * - * Comment if your system does not support time functions - */ -#define MBEDTLS_HAVE_TIME - -/** - * \def MBEDTLS_HAVE_TIME_DATE - * - * System has time.h, time(), and an implementation for - * mbedtls_platform_gmtime_r() (see below). - * The time needs to be correct (not necesarily very accurate, but at least - * the date should be correct). This is used to verify the validity period of - * X.509 certificates. - * - * Comment if your system does not have a correct clock. - * - * \note mbedtls_platform_gmtime_r() is an abstraction in platform_util.h that - * behaves similarly to the gmtime_r() function from the C standard. Refer to - * the documentation for mbedtls_platform_gmtime_r() for more information. - * - * \note It is possible to configure an implementation for - * mbedtls_platform_gmtime_r() at compile-time by using the macro - * MBEDTLS_PLATFORM_GMTIME_R_ALT. - */ -#define MBEDTLS_HAVE_TIME_DATE - -/** - * \def MBEDTLS_PLATFORM_MEMORY - * - * Enable the memory allocation layer. - * - * By default mbed TLS uses the system-provided calloc() and free(). - * This allows different allocators (self-implemented or provided) to be - * provided to the platform abstraction layer. - * - * Enabling MBEDTLS_PLATFORM_MEMORY without the - * MBEDTLS_PLATFORM_{FREE,CALLOC}_MACROs will provide - * "mbedtls_platform_set_calloc_free()" allowing you to set an alternative calloc() and - * free() function pointer at runtime. - * - * Enabling MBEDTLS_PLATFORM_MEMORY and specifying - * MBEDTLS_PLATFORM_{CALLOC,FREE}_MACROs will allow you to specify the - * alternate function at compile time. - * - * Requires: MBEDTLS_PLATFORM_C - * - * Enable this layer to allow use of alternative memory allocators. - */ -//#define MBEDTLS_PLATFORM_MEMORY - -/** - * \def MBEDTLS_PLATFORM_NO_STD_FUNCTIONS - * - * Do not assign standard functions in the platform layer (e.g. calloc() to - * MBEDTLS_PLATFORM_STD_CALLOC and printf() to MBEDTLS_PLATFORM_STD_PRINTF) - * - * This makes sure there are no linking errors on platforms that do not support - * these functions. You will HAVE to provide alternatives, either at runtime - * via the platform_set_xxx() functions or at compile time by setting - * the MBEDTLS_PLATFORM_STD_XXX defines, or enabling a - * MBEDTLS_PLATFORM_XXX_MACRO. - * - * Requires: MBEDTLS_PLATFORM_C - * - * Uncomment to prevent default assignment of standard functions in the - * platform layer. - */ -//#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS - -/** - * \def MBEDTLS_PLATFORM_EXIT_ALT - * - * MBEDTLS_PLATFORM_XXX_ALT: Uncomment a macro to let mbed TLS support the - * function in the platform abstraction layer. - * - * Example: In case you uncomment MBEDTLS_PLATFORM_PRINTF_ALT, mbed TLS will - * provide a function "mbedtls_platform_set_printf()" that allows you to set an - * alternative printf function pointer. - * - * All these define require MBEDTLS_PLATFORM_C to be defined! - * - * \note MBEDTLS_PLATFORM_SNPRINTF_ALT is required on Windows; - * it will be enabled automatically by check_config.h - * - * \warning MBEDTLS_PLATFORM_XXX_ALT cannot be defined at the same time as - * MBEDTLS_PLATFORM_XXX_MACRO! - * - * Requires: MBEDTLS_PLATFORM_TIME_ALT requires MBEDTLS_HAVE_TIME - * - * Uncomment a macro to enable alternate implementation of specific base - * platform function - */ -//#define MBEDTLS_PLATFORM_EXIT_ALT -//#define MBEDTLS_PLATFORM_TIME_ALT -//#define MBEDTLS_PLATFORM_FPRINTF_ALT -//#define MBEDTLS_PLATFORM_PRINTF_ALT -//#define MBEDTLS_PLATFORM_SNPRINTF_ALT -//#define MBEDTLS_PLATFORM_NV_SEED_ALT -//#define MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT - -/** - * \def MBEDTLS_DEPRECATED_WARNING - * - * Mark deprecated functions so that they generate a warning if used. - * Functions deprecated in one version will usually be removed in the next - * version. You can enable this to help you prepare the transition to a new - * major version by making sure your code is not using these functions. - * - * This only works with GCC and Clang. With other compilers, you may want to - * use MBEDTLS_DEPRECATED_REMOVED - * - * Uncomment to get warnings on using deprecated functions. - */ -//#define MBEDTLS_DEPRECATED_WARNING - -/** - * \def MBEDTLS_DEPRECATED_REMOVED - * - * Remove deprecated functions so that they generate an error if used. - * Functions deprecated in one version will usually be removed in the next - * version. You can enable this to help you prepare the transition to a new - * major version by making sure your code is not using these functions. - * - * Uncomment to get errors on using deprecated functions. - */ -//#define MBEDTLS_DEPRECATED_REMOVED - -/* \} name SECTION: System support */ - -/** - * \name SECTION: mbed TLS feature support - * - * This section sets support for features that are or are not needed - * within the modules that are enabled. - * \{ - */ - -/** - * \def MBEDTLS_TIMING_ALT - * - * Uncomment to provide your own alternate implementation for mbedtls_timing_hardclock(), - * mbedtls_timing_get_timer(), mbedtls_set_alarm(), mbedtls_set/get_delay() - * - * Only works if you have MBEDTLS_TIMING_C enabled. - * - * You will need to provide a header "timing_alt.h" and an implementation at - * compile time. - */ -//#define MBEDTLS_TIMING_ALT - -/** - * \def MBEDTLS_AES_ALT - * - * MBEDTLS__MODULE_NAME__ALT: Uncomment a macro to let mbed TLS use your - * alternate core implementation of a symmetric crypto, an arithmetic or hash - * module (e.g. platform specific assembly optimized implementations). Keep - * in mind that the function prototypes should remain the same. - * - * This replaces the whole module. If you only want to replace one of the - * functions, use one of the MBEDTLS__FUNCTION_NAME__ALT flags. - * - * Example: In case you uncomment MBEDTLS_AES_ALT, mbed TLS will no longer - * provide the "struct mbedtls_aes_context" definition and omit the base - * function declarations and implementations. "aes_alt.h" will be included from - * "aes.h" to include the new function definitions. - * - * Uncomment a macro to enable alternate implementation of the corresponding - * module. - * - * \warning MD2, MD4, MD5, ARC4, DES and SHA-1 are considered weak and their - * use constitutes a security risk. If possible, we recommend - * avoiding dependencies on them, and considering stronger message - * digests and ciphers instead. - * - */ -//#define MBEDTLS_AES_ALT -//#define MBEDTLS_ARC4_ALT -//#define MBEDTLS_ARIA_ALT -//#define MBEDTLS_BLOWFISH_ALT -//#define MBEDTLS_CAMELLIA_ALT -//#define MBEDTLS_CCM_ALT -//#define MBEDTLS_CHACHA20_ALT -//#define MBEDTLS_CHACHAPOLY_ALT -//#define MBEDTLS_CMAC_ALT -//#define MBEDTLS_DES_ALT -//#define MBEDTLS_DHM_ALT -//#define MBEDTLS_ECJPAKE_ALT -//#define MBEDTLS_GCM_ALT -//#define MBEDTLS_NIST_KW_ALT -//#define MBEDTLS_MD2_ALT -//#define MBEDTLS_MD4_ALT -//#define MBEDTLS_MD5_ALT -//#define MBEDTLS_POLY1305_ALT -//#define MBEDTLS_RIPEMD160_ALT -//#define MBEDTLS_RSA_ALT -//#define MBEDTLS_SHA1_ALT -//#define MBEDTLS_SHA256_ALT -//#define MBEDTLS_SHA512_ALT -//#define MBEDTLS_XTEA_ALT - -/* - * When replacing the elliptic curve module, pleace consider, that it is - * implemented with two .c files: - * - ecp.c - * - ecp_curves.c - * You can replace them very much like all the other MBEDTLS__MODULE_NAME__ALT - * macros as described above. The only difference is that you have to make sure - * that you provide functionality for both .c files. - */ -//#define MBEDTLS_ECP_ALT - -/** - * \def MBEDTLS_MD2_PROCESS_ALT - * - * MBEDTLS__FUNCTION_NAME__ALT: Uncomment a macro to let mbed TLS use you - * alternate core implementation of symmetric crypto or hash function. Keep in - * mind that function prototypes should remain the same. - * - * This replaces only one function. The header file from mbed TLS is still - * used, in contrast to the MBEDTLS__MODULE_NAME__ALT flags. - * - * Example: In case you uncomment MBEDTLS_SHA256_PROCESS_ALT, mbed TLS will - * no longer provide the mbedtls_sha1_process() function, but it will still provide - * the other function (using your mbedtls_sha1_process() function) and the definition - * of mbedtls_sha1_context, so your implementation of mbedtls_sha1_process must be compatible - * with this definition. - * - * \note Because of a signature change, the core AES encryption and decryption routines are - * currently named mbedtls_aes_internal_encrypt and mbedtls_aes_internal_decrypt, - * respectively. When setting up alternative implementations, these functions should - * be overriden, but the wrapper functions mbedtls_aes_decrypt and mbedtls_aes_encrypt - * must stay untouched. - * - * \note If you use the AES_xxx_ALT macros, then is is recommended to also set - * MBEDTLS_AES_ROM_TABLES in order to help the linker garbage-collect the AES - * tables. - * - * Uncomment a macro to enable alternate implementation of the corresponding - * function. - * - * \warning MD2, MD4, MD5, DES and SHA-1 are considered weak and their use - * constitutes a security risk. If possible, we recommend avoiding - * dependencies on them, and considering stronger message digests - * and ciphers instead. - * - */ -//#define MBEDTLS_MD2_PROCESS_ALT -//#define MBEDTLS_MD4_PROCESS_ALT -//#define MBEDTLS_MD5_PROCESS_ALT -//#define MBEDTLS_RIPEMD160_PROCESS_ALT -//#define MBEDTLS_SHA1_PROCESS_ALT -//#define MBEDTLS_SHA256_PROCESS_ALT -//#define MBEDTLS_SHA512_PROCESS_ALT -//#define MBEDTLS_DES_SETKEY_ALT -//#define MBEDTLS_DES_CRYPT_ECB_ALT -//#define MBEDTLS_DES3_CRYPT_ECB_ALT -//#define MBEDTLS_AES_SETKEY_ENC_ALT -//#define MBEDTLS_AES_SETKEY_DEC_ALT -//#define MBEDTLS_AES_ENCRYPT_ALT -//#define MBEDTLS_AES_DECRYPT_ALT -//#define MBEDTLS_ECDH_GEN_PUBLIC_ALT -//#define MBEDTLS_ECDH_COMPUTE_SHARED_ALT -//#define MBEDTLS_ECDSA_VERIFY_ALT -//#define MBEDTLS_ECDSA_SIGN_ALT -//#define MBEDTLS_ECDSA_GENKEY_ALT - -/** - * \def MBEDTLS_ECP_INTERNAL_ALT - * - * Expose a part of the internal interface of the Elliptic Curve Point module. - * - * MBEDTLS_ECP__FUNCTION_NAME__ALT: Uncomment a macro to let mbed TLS use your - * alternative core implementation of elliptic curve arithmetic. Keep in mind - * that function prototypes should remain the same. - * - * This partially replaces one function. The header file from mbed TLS is still - * used, in contrast to the MBEDTLS_ECP_ALT flag. The original implementation - * is still present and it is used for group structures not supported by the - * alternative. - * - * Any of these options become available by defining MBEDTLS_ECP_INTERNAL_ALT - * and implementing the following functions: - * unsigned char mbedtls_internal_ecp_grp_capable( - * const mbedtls_ecp_group *grp ) - * int mbedtls_internal_ecp_init( const mbedtls_ecp_group *grp ) - * void mbedtls_internal_ecp_deinit( const mbedtls_ecp_group *grp ) - * The mbedtls_internal_ecp_grp_capable function should return 1 if the - * replacement functions implement arithmetic for the given group and 0 - * otherwise. - * The functions mbedtls_internal_ecp_init and mbedtls_internal_ecp_deinit are - * called before and after each point operation and provide an opportunity to - * implement optimized set up and tear down instructions. - * - * Example: In case you uncomment MBEDTLS_ECP_INTERNAL_ALT and - * MBEDTLS_ECP_DOUBLE_JAC_ALT, mbed TLS will still provide the ecp_double_jac - * function, but will use your mbedtls_internal_ecp_double_jac if the group is - * supported (your mbedtls_internal_ecp_grp_capable function returns 1 when - * receives it as an argument). If the group is not supported then the original - * implementation is used. The other functions and the definition of - * mbedtls_ecp_group and mbedtls_ecp_point will not change, so your - * implementation of mbedtls_internal_ecp_double_jac and - * mbedtls_internal_ecp_grp_capable must be compatible with this definition. - * - * Uncomment a macro to enable alternate implementation of the corresponding - * function. - */ -/* Required for all the functions in this section */ -//#define MBEDTLS_ECP_INTERNAL_ALT -/* Support for Weierstrass curves with Jacobi representation */ -//#define MBEDTLS_ECP_RANDOMIZE_JAC_ALT -//#define MBEDTLS_ECP_ADD_MIXED_ALT -//#define MBEDTLS_ECP_DOUBLE_JAC_ALT -//#define MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT -//#define MBEDTLS_ECP_NORMALIZE_JAC_ALT -/* Support for curves with Montgomery arithmetic */ -//#define MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT -//#define MBEDTLS_ECP_RANDOMIZE_MXZ_ALT -//#define MBEDTLS_ECP_NORMALIZE_MXZ_ALT - -/** - * \def MBEDTLS_TEST_NULL_ENTROPY - * - * Enables testing and use of mbed TLS without any configured entropy sources. - * This permits use of the library on platforms before an entropy source has - * been integrated (see for example the MBEDTLS_ENTROPY_HARDWARE_ALT or the - * MBEDTLS_ENTROPY_NV_SEED switches). - * - * WARNING! This switch MUST be disabled in production builds, and is suitable - * only for development. - * Enabling the switch negates any security provided by the library. - * - * Requires MBEDTLS_ENTROPY_C, MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES - * - */ -//#define MBEDTLS_TEST_NULL_ENTROPY - -/** - * \def MBEDTLS_ENTROPY_HARDWARE_ALT - * - * Uncomment this macro to let mbed TLS use your own implementation of a - * hardware entropy collector. - * - * Your function must be called \c mbedtls_hardware_poll(), have the same - * prototype as declared in entropy_poll.h, and accept NULL as first argument. - * - * Uncomment to use your own hardware entropy collector. - */ -//#define MBEDTLS_ENTROPY_HARDWARE_ALT - -/** - * \def MBEDTLS_AES_ROM_TABLES - * - * Use precomputed AES tables stored in ROM. - * - * Uncomment this macro to use precomputed AES tables stored in ROM. - * Comment this macro to generate AES tables in RAM at runtime. - * - * Tradeoff: Using precomputed ROM tables reduces RAM usage by ~8kb - * (or ~2kb if \c MBEDTLS_AES_FEWER_TABLES is used) and reduces the - * initialization time before the first AES operation can be performed. - * It comes at the cost of additional ~8kb ROM use (resp. ~2kb if \c - * MBEDTLS_AES_FEWER_TABLES below is used), and potentially degraded - * performance if ROM access is slower than RAM access. - * - * This option is independent of \c MBEDTLS_AES_FEWER_TABLES. - * - */ -//#define MBEDTLS_AES_ROM_TABLES - -/** - * \def MBEDTLS_AES_FEWER_TABLES - * - * Use less ROM/RAM for AES tables. - * - * Uncommenting this macro omits 75% of the AES tables from - * ROM / RAM (depending on the value of \c MBEDTLS_AES_ROM_TABLES) - * by computing their values on the fly during operations - * (the tables are entry-wise rotations of one another). - * - * Tradeoff: Uncommenting this reduces the RAM / ROM footprint - * by ~6kb but at the cost of more arithmetic operations during - * runtime. Specifically, one has to compare 4 accesses within - * different tables to 4 accesses with additional arithmetic - * operations within the same table. The performance gain/loss - * depends on the system and memory details. - * - * This option is independent of \c MBEDTLS_AES_ROM_TABLES. - * - */ -//#define MBEDTLS_AES_FEWER_TABLES - -/** - * \def MBEDTLS_CAMELLIA_SMALL_MEMORY - * - * Use less ROM for the Camellia implementation (saves about 768 bytes). - * - * Uncomment this macro to use less memory for Camellia. - */ -//#define MBEDTLS_CAMELLIA_SMALL_MEMORY - -/** - * \def MBEDTLS_CIPHER_MODE_CBC - * - * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers. - */ -#define MBEDTLS_CIPHER_MODE_CBC - -/** - * \def MBEDTLS_CIPHER_MODE_CFB - * - * Enable Cipher Feedback mode (CFB) for symmetric ciphers. - */ -#define MBEDTLS_CIPHER_MODE_CFB - -/** - * \def MBEDTLS_CIPHER_MODE_CTR - * - * Enable Counter Block Cipher mode (CTR) for symmetric ciphers. - */ -#define MBEDTLS_CIPHER_MODE_CTR - -/** - * \def MBEDTLS_CIPHER_MODE_OFB - * - * Enable Output Feedback mode (OFB) for symmetric ciphers. - */ -#define MBEDTLS_CIPHER_MODE_OFB - -/** - * \def MBEDTLS_CIPHER_MODE_XTS - * - * Enable Xor-encrypt-xor with ciphertext stealing mode (XTS) for AES. - */ -#define MBEDTLS_CIPHER_MODE_XTS - -/** - * \def MBEDTLS_CIPHER_NULL_CIPHER - * - * Enable NULL cipher. - * Warning: Only do so when you know what you are doing. This allows for - * encryption or channels without any security! - * - * Requires MBEDTLS_ENABLE_WEAK_CIPHERSUITES as well to enable - * the following ciphersuites: - * MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA - * MBEDTLS_TLS_RSA_WITH_NULL_SHA256 - * MBEDTLS_TLS_RSA_WITH_NULL_SHA - * MBEDTLS_TLS_RSA_WITH_NULL_MD5 - * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA - * MBEDTLS_TLS_PSK_WITH_NULL_SHA384 - * MBEDTLS_TLS_PSK_WITH_NULL_SHA256 - * MBEDTLS_TLS_PSK_WITH_NULL_SHA - * - * Uncomment this macro to enable the NULL cipher and ciphersuites - */ -//#define MBEDTLS_CIPHER_NULL_CIPHER - -/** - * \def MBEDTLS_CIPHER_PADDING_PKCS7 - * - * MBEDTLS_CIPHER_PADDING_XXX: Uncomment or comment macros to add support for - * specific padding modes in the cipher layer with cipher modes that support - * padding (e.g. CBC) - * - * If you disable all padding modes, only full blocks can be used with CBC. - * - * Enable padding modes in the cipher layer. - */ -#define MBEDTLS_CIPHER_PADDING_PKCS7 -#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS -#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN -#define MBEDTLS_CIPHER_PADDING_ZEROS - -/** - * \def MBEDTLS_ENABLE_WEAK_CIPHERSUITES - * - * Enable weak ciphersuites in SSL / TLS. - * Warning: Only do so when you know what you are doing. This allows for - * channels with virtually no security at all! - * - * This enables the following ciphersuites: - * MBEDTLS_TLS_RSA_WITH_DES_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA - * - * Uncomment this macro to enable weak ciphersuites - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers instead. - */ -//#define MBEDTLS_ENABLE_WEAK_CIPHERSUITES - -/** - * \def MBEDTLS_REMOVE_ARC4_CIPHERSUITES - * - * Remove RC4 ciphersuites by default in SSL / TLS. - * This flag removes the ciphersuites based on RC4 from the default list as - * returned by mbedtls_ssl_list_ciphersuites(). However, it is still possible to - * enable (some of) them with mbedtls_ssl_conf_ciphersuites() by including them - * explicitly. - * - * Uncomment this macro to remove RC4 ciphersuites by default. - */ -#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES - -/** - * \def MBEDTLS_ECP_DP_SECP192R1_ENABLED - * - * MBEDTLS_ECP_XXXX_ENABLED: Enables specific curves within the Elliptic Curve - * module. By default all supported curves are enabled. - * - * Comment macros to disable the curve and functions for it - */ -#define MBEDTLS_ECP_DP_SECP192R1_ENABLED -#define MBEDTLS_ECP_DP_SECP224R1_ENABLED -#define MBEDTLS_ECP_DP_SECP256R1_ENABLED -#define MBEDTLS_ECP_DP_SECP384R1_ENABLED -#define MBEDTLS_ECP_DP_SECP521R1_ENABLED -#define MBEDTLS_ECP_DP_SECP192K1_ENABLED -#define MBEDTLS_ECP_DP_SECP224K1_ENABLED -#define MBEDTLS_ECP_DP_SECP256K1_ENABLED -#define MBEDTLS_ECP_DP_BP256R1_ENABLED -#define MBEDTLS_ECP_DP_BP384R1_ENABLED -#define MBEDTLS_ECP_DP_BP512R1_ENABLED -#define MBEDTLS_ECP_DP_CURVE25519_ENABLED -#define MBEDTLS_ECP_DP_CURVE448_ENABLED - -/** - * \def MBEDTLS_ECP_NIST_OPTIM - * - * Enable specific 'modulo p' routines for each NIST prime. - * Depending on the prime and architecture, makes operations 4 to 8 times - * faster on the corresponding curve. - * - * Comment this macro to disable NIST curves optimisation. - */ -#define MBEDTLS_ECP_NIST_OPTIM - -/** - * \def MBEDTLS_ECDSA_DETERMINISTIC - * - * Enable deterministic ECDSA (RFC 6979). - * Standard ECDSA is "fragile" in the sense that lack of entropy when signing - * may result in a compromise of the long-term signing key. This is avoided by - * the deterministic variant. - * - * Requires: MBEDTLS_HMAC_DRBG_C - * - * Comment this macro to disable deterministic ECDSA. - */ -#define MBEDTLS_ECDSA_DETERMINISTIC - -/** - * \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED - * - * Enable the PSK based ciphersuite modes in SSL / TLS. - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_RC4_128_SHA - */ -#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED - * - * Enable the DHE-PSK based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_DHM_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA - * - * \warning Using DHE constitutes a security risk as it - * is not possible to validate custom DH parameters. - * If possible, it is recommended users should consider - * preferring other methods of key exchange. - * See dhm.h for more details. - * - */ -#define MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED - * - * Enable the ECDHE-PSK based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA - */ -#define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED - * - * Enable the RSA-PSK based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA - */ -#define MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_RSA_ENABLED - * - * Enable the RSA-only based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_RSA_WITH_RC4_128_MD5 - */ -#define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED - * - * Enable the DHE-RSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_DHM_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA - * - * \warning Using DHE constitutes a security risk as it - * is not possible to validate custom DH parameters. - * If possible, it is recommended users should consider - * preferring other methods of key exchange. - * See dhm.h for more details. - * - */ -#define MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED - * - * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA - */ -#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED - * - * Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C, MBEDTLS_ECDSA_C, MBEDTLS_X509_CRT_PARSE_C, - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA - */ -#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED - * - * Enable the ECDH-ECDSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C, MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 - */ -#define MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED - * - * Enable the ECDH-RSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C, MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 - */ -#define MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED - * - * Enable the ECJPAKE based ciphersuite modes in SSL / TLS. - * - * \warning This is currently experimental. EC J-PAKE support is based on the - * Thread v1.0.0 specification; incompatible changes to the specification - * might still happen. For this reason, this is disabled by default. - * - * Requires: MBEDTLS_ECJPAKE_C - * MBEDTLS_SHA256_C - * MBEDTLS_ECP_DP_SECP256R1_ENABLED - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 - */ -//#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED - -/** - * \def MBEDTLS_PK_PARSE_EC_EXTENDED - * - * Enhance support for reading EC keys using variants of SEC1 not allowed by - * RFC 5915 and RFC 5480. - * - * Currently this means parsing the SpecifiedECDomain choice of EC - * parameters (only known groups are supported, not arbitrary domains, to - * avoid validation issues). - * - * Disable if you only need to support RFC 5915 + 5480 key formats. - */ -#define MBEDTLS_PK_PARSE_EC_EXTENDED - -/** - * \def MBEDTLS_ERROR_STRERROR_DUMMY - * - * Enable a dummy error function to make use of mbedtls_strerror() in - * third party libraries easier when MBEDTLS_ERROR_C is disabled - * (no effect when MBEDTLS_ERROR_C is enabled). - * - * You can safely disable this if MBEDTLS_ERROR_C is enabled, or if you're - * not using mbedtls_strerror() or error_strerror() in your application. - * - * Disable if you run into name conflicts and want to really remove the - * mbedtls_strerror() - */ -#define MBEDTLS_ERROR_STRERROR_DUMMY - -/** - * \def MBEDTLS_GENPRIME - * - * Enable the prime-number generation code. - * - * Requires: MBEDTLS_BIGNUM_C - */ -#define MBEDTLS_GENPRIME - -/** - * \def MBEDTLS_FS_IO - * - * Enable functions that use the filesystem. - */ -#define MBEDTLS_FS_IO - -/** - * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES - * - * Do not add default entropy sources. These are the platform specific, - * mbedtls_timing_hardclock and HAVEGE based poll functions. - * - * This is useful to have more control over the added entropy sources in an - * application. - * - * Uncomment this macro to prevent loading of default entropy functions. - */ -//#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES - -/** - * \def MBEDTLS_NO_PLATFORM_ENTROPY - * - * Do not use built-in platform entropy functions. - * This is useful if your platform does not support - * standards like the /dev/urandom or Windows CryptoAPI. - * - * Uncomment this macro to disable the built-in platform entropy functions. - */ -//#define MBEDTLS_NO_PLATFORM_ENTROPY - -/** - * \def MBEDTLS_ENTROPY_FORCE_SHA256 - * - * Force the entropy accumulator to use a SHA-256 accumulator instead of the - * default SHA-512 based one (if both are available). - * - * Requires: MBEDTLS_SHA256_C - * - * On 32-bit systems SHA-256 can be much faster than SHA-512. Use this option - * if you have performance concerns. - * - * This option is only useful if both MBEDTLS_SHA256_C and - * MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used. - */ -//#define MBEDTLS_ENTROPY_FORCE_SHA256 - -/** - * \def MBEDTLS_ENTROPY_NV_SEED - * - * Enable the non-volatile (NV) seed file-based entropy source. - * (Also enables the NV seed read/write functions in the platform layer) - * - * This is crucial (if not required) on systems that do not have a - * cryptographic entropy source (in hardware or kernel) available. - * - * Requires: MBEDTLS_ENTROPY_C, MBEDTLS_PLATFORM_C - * - * \note The read/write functions that are used by the entropy source are - * determined in the platform layer, and can be modified at runtime and/or - * compile-time depending on the flags (MBEDTLS_PLATFORM_NV_SEED_*) used. - * - * \note If you use the default implementation functions that read a seedfile - * with regular fopen(), please make sure you make a seedfile with the - * proper name (defined in MBEDTLS_PLATFORM_STD_NV_SEED_FILE) and at - * least MBEDTLS_ENTROPY_BLOCK_SIZE bytes in size that can be read from - * and written to or you will get an entropy source error! The default - * implementation will only use the first MBEDTLS_ENTROPY_BLOCK_SIZE - * bytes from the file. - * - * \note The entropy collector will write to the seed file before entropy is - * given to an external source, to update it. - */ -//#define MBEDTLS_ENTROPY_NV_SEED - -/** - * \def MBEDTLS_MEMORY_DEBUG - * - * Enable debugging of buffer allocator memory issues. Automatically prints - * (to stderr) all (fatal) messages on memory allocation issues. Enables - * function for 'debug output' of allocated memory. - * - * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C - * - * Uncomment this macro to let the buffer allocator print out error messages. - */ -//#define MBEDTLS_MEMORY_DEBUG - -/** - * \def MBEDTLS_MEMORY_BACKTRACE - * - * Include backtrace information with each allocated block. - * - * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C - * GLIBC-compatible backtrace() an backtrace_symbols() support - * - * Uncomment this macro to include backtrace information - */ -//#define MBEDTLS_MEMORY_BACKTRACE - -/** - * \def MBEDTLS_PK_RSA_ALT_SUPPORT - * - * Support external private RSA keys (eg from a HSM) in the PK layer. - * - * Comment this macro to disable support for external private RSA keys. - */ -#define MBEDTLS_PK_RSA_ALT_SUPPORT - -/** - * \def MBEDTLS_PKCS1_V15 - * - * Enable support for PKCS#1 v1.5 encoding. - * - * Requires: MBEDTLS_RSA_C - * - * This enables support for PKCS#1 v1.5 operations. - */ -#define MBEDTLS_PKCS1_V15 - -/** - * \def MBEDTLS_PKCS1_V21 - * - * Enable support for PKCS#1 v2.1 encoding. - * - * Requires: MBEDTLS_MD_C, MBEDTLS_RSA_C - * - * This enables support for RSAES-OAEP and RSASSA-PSS operations. - */ -#define MBEDTLS_PKCS1_V21 - -/** - * \def MBEDTLS_RSA_NO_CRT - * - * Do not use the Chinese Remainder Theorem - * for the RSA private operation. - * - * Uncomment this macro to disable the use of CRT in RSA. - * - */ -//#define MBEDTLS_RSA_NO_CRT - -/** - * \def MBEDTLS_SELF_TEST - * - * Enable the checkup functions (*_self_test). - */ -#define MBEDTLS_SELF_TEST - -/** - * \def MBEDTLS_SHA256_SMALLER - * - * Enable an implementation of SHA-256 that has lower ROM footprint but also - * lower performance. - * - * The default implementation is meant to be a reasonnable compromise between - * performance and size. This version optimizes more aggressively for size at - * the expense of performance. Eg on Cortex-M4 it reduces the size of - * mbedtls_sha256_process() from ~2KB to ~0.5KB for a performance hit of about - * 30%. - * - * Uncomment to enable the smaller implementation of SHA256. - */ -//#define MBEDTLS_SHA256_SMALLER - -/** - * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES - * - * Enable sending of alert messages in case of encountered errors as per RFC. - * If you choose not to send the alert messages, mbed TLS can still communicate - * with other servers, only debugging of failures is harder. - * - * The advantage of not sending alert messages, is that no information is given - * about reasons for failures thus preventing adversaries of gaining intel. - * - * Enable sending of all alert messages - */ -#define MBEDTLS_SSL_ALL_ALERT_MESSAGES - -/** - * \def MBEDTLS_SSL_ASYNC_PRIVATE - * - * Enable asynchronous external private key operations in SSL. This allows - * you to configure an SSL connection to call an external cryptographic - * module to perform private key operations instead of performing the - * operation inside the library. - * - */ -//#define MBEDTLS_SSL_ASYNC_PRIVATE - -/** - * \def MBEDTLS_SSL_DEBUG_ALL - * - * Enable the debug messages in SSL module for all issues. - * Debug messages have been disabled in some places to prevent timing - * attacks due to (unbalanced) debugging function calls. - * - * If you need all error reporting you should enable this during debugging, - * but remove this for production servers that should log as well. - * - * Uncomment this macro to report all debug messages on errors introducing - * a timing side-channel. - * - */ -//#define MBEDTLS_SSL_DEBUG_ALL - -/** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC - * - * Enable support for Encrypt-then-MAC, RFC 7366. - * - * This allows peers that both support it to use a more robust protection for - * ciphersuites using CBC, providing deep resistance against timing attacks - * on the padding or underlying cipher. - * - * This only affects CBC ciphersuites, and is useless if none is defined. - * - * Requires: MBEDTLS_SSL_PROTO_TLS1 or - * MBEDTLS_SSL_PROTO_TLS1_1 or - * MBEDTLS_SSL_PROTO_TLS1_2 - * - * Comment this macro to disable support for Encrypt-then-MAC - */ -#define MBEDTLS_SSL_ENCRYPT_THEN_MAC - -/** \def MBEDTLS_SSL_EXTENDED_MASTER_SECRET - * - * Enable support for Extended Master Secret, aka Session Hash - * (draft-ietf-tls-session-hash-02). - * - * This was introduced as "the proper fix" to the Triple Handshake familiy of - * attacks, but it is recommended to always use it (even if you disable - * renegotiation), since it actually fixes a more fundamental issue in the - * original SSL/TLS design, and has implications beyond Triple Handshake. - * - * Requires: MBEDTLS_SSL_PROTO_TLS1 or - * MBEDTLS_SSL_PROTO_TLS1_1 or - * MBEDTLS_SSL_PROTO_TLS1_2 - * - * Comment this macro to disable support for Extended Master Secret. - */ -#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET - -/** - * \def MBEDTLS_SSL_FALLBACK_SCSV - * - * Enable support for FALLBACK_SCSV (draft-ietf-tls-downgrade-scsv-00). - * - * For servers, it is recommended to always enable this, unless you support - * only one version of TLS, or know for sure that none of your clients - * implements a fallback strategy. - * - * For clients, you only need this if you're using a fallback strategy, which - * is not recommended in the first place, unless you absolutely need it to - * interoperate with buggy (version-intolerant) servers. - * - * Comment this macro to disable support for FALLBACK_SCSV - */ -#define MBEDTLS_SSL_FALLBACK_SCSV - -/** - * \def MBEDTLS_SSL_HW_RECORD_ACCEL - * - * Enable hooking functions in SSL module for hardware acceleration of - * individual records. - * - * Uncomment this macro to enable hooking functions. - */ -//#define MBEDTLS_SSL_HW_RECORD_ACCEL - -/** - * \def MBEDTLS_SSL_CBC_RECORD_SPLITTING - * - * Enable 1/n-1 record splitting for CBC mode in SSLv3 and TLS 1.0. - * - * This is a countermeasure to the BEAST attack, which also minimizes the risk - * of interoperability issues compared to sending 0-length records. - * - * Comment this macro to disable 1/n-1 record splitting. - */ -#define MBEDTLS_SSL_CBC_RECORD_SPLITTING - -/** - * \def MBEDTLS_SSL_RENEGOTIATION - * - * Disable support for TLS renegotiation. - * - * The two main uses of renegotiation are (1) refresh keys on long-lived - * connections and (2) client authentication after the initial handshake. - * If you don't need renegotiation, it's probably better to disable it, since - * it has been associated with security issues in the past and is easy to - * misuse/misunderstand. - * - * Comment this to disable support for renegotiation. - * - * \note Even if this option is disabled, both client and server are aware - * of the Renegotiation Indication Extension (RFC 5746) used to - * prevent the SSL renegotiation attack (see RFC 5746 Sect. 1). - * (See \c mbedtls_ssl_conf_legacy_renegotiation for the - * configuration of this extension). - * - */ -#define MBEDTLS_SSL_RENEGOTIATION - -/** - * \def MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO - * - * Enable support for receiving and parsing SSLv2 Client Hello messages for the - * SSL Server module (MBEDTLS_SSL_SRV_C). - * - * Uncomment this macro to enable support for SSLv2 Client Hello messages. - */ -//#define MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO - -/** - * \def MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE - * - * Pick the ciphersuite according to the client's preferences rather than ours - * in the SSL Server module (MBEDTLS_SSL_SRV_C). - * - * Uncomment this macro to respect client's ciphersuite order - */ -//#define MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE - -/** - * \def MBEDTLS_SSL_MAX_FRAGMENT_LENGTH - * - * Enable support for RFC 6066 max_fragment_length extension in SSL. - * - * Comment this macro to disable support for the max_fragment_length extension - */ -#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH - -/** - * \def MBEDTLS_SSL_PROTO_SSL3 - * - * Enable support for SSL 3.0. - * - * Requires: MBEDTLS_MD5_C - * MBEDTLS_SHA1_C - * - * Comment this macro to disable support for SSL 3.0 - */ -//#define MBEDTLS_SSL_PROTO_SSL3 - -/** - * \def MBEDTLS_SSL_PROTO_TLS1 - * - * Enable support for TLS 1.0. - * - * Requires: MBEDTLS_MD5_C - * MBEDTLS_SHA1_C - * - * Comment this macro to disable support for TLS 1.0 - */ -#define MBEDTLS_SSL_PROTO_TLS1 - -/** - * \def MBEDTLS_SSL_PROTO_TLS1_1 - * - * Enable support for TLS 1.1 (and DTLS 1.0 if DTLS is enabled). - * - * Requires: MBEDTLS_MD5_C - * MBEDTLS_SHA1_C - * - * Comment this macro to disable support for TLS 1.1 / DTLS 1.0 - */ -#define MBEDTLS_SSL_PROTO_TLS1_1 - -/** - * \def MBEDTLS_SSL_PROTO_TLS1_2 - * - * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled). - * - * Requires: MBEDTLS_SHA1_C or MBEDTLS_SHA256_C or MBEDTLS_SHA512_C - * (Depends on ciphersuites) - * - * Comment this macro to disable support for TLS 1.2 / DTLS 1.2 - */ -#define MBEDTLS_SSL_PROTO_TLS1_2 - -/** - * \def MBEDTLS_SSL_PROTO_DTLS - * - * Enable support for DTLS (all available versions). - * - * Enable this and MBEDTLS_SSL_PROTO_TLS1_1 to enable DTLS 1.0, - * and/or this and MBEDTLS_SSL_PROTO_TLS1_2 to enable DTLS 1.2. - * - * Requires: MBEDTLS_SSL_PROTO_TLS1_1 - * or MBEDTLS_SSL_PROTO_TLS1_2 - * - * Comment this macro to disable support for DTLS - */ -#define MBEDTLS_SSL_PROTO_DTLS - -/** - * \def MBEDTLS_SSL_ALPN - * - * Enable support for RFC 7301 Application Layer Protocol Negotiation. - * - * Comment this macro to disable support for ALPN. - */ -#define MBEDTLS_SSL_ALPN - -/** - * \def MBEDTLS_SSL_DTLS_ANTI_REPLAY - * - * Enable support for the anti-replay mechanism in DTLS. - * - * Requires: MBEDTLS_SSL_TLS_C - * MBEDTLS_SSL_PROTO_DTLS - * - * \warning Disabling this is often a security risk! - * See mbedtls_ssl_conf_dtls_anti_replay() for details. - * - * Comment this to disable anti-replay in DTLS. - */ -#define MBEDTLS_SSL_DTLS_ANTI_REPLAY - -/** - * \def MBEDTLS_SSL_DTLS_HELLO_VERIFY - * - * Enable support for HelloVerifyRequest on DTLS servers. - * - * This feature is highly recommended to prevent DTLS servers being used as - * amplifiers in DoS attacks against other hosts. It should always be enabled - * unless you know for sure amplification cannot be a problem in the - * environment in which your server operates. - * - * \warning Disabling this can ba a security risk! (see above) - * - * Requires: MBEDTLS_SSL_PROTO_DTLS - * - * Comment this to disable support for HelloVerifyRequest. - */ -#define MBEDTLS_SSL_DTLS_HELLO_VERIFY - -/** - * \def MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE - * - * Enable server-side support for clients that reconnect from the same port. - * - * Some clients unexpectedly close the connection and try to reconnect using the - * same source port. This needs special support from the server to handle the - * new connection securely, as described in section 4.2.8 of RFC 6347. This - * flag enables that support. - * - * Requires: MBEDTLS_SSL_DTLS_HELLO_VERIFY - * - * Comment this to disable support for clients reusing the source port. - */ -#define MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE - -/** - * \def MBEDTLS_SSL_DTLS_BADMAC_LIMIT - * - * Enable support for a limit of records with bad MAC. - * - * See mbedtls_ssl_conf_dtls_badmac_limit(). - * - * Requires: MBEDTLS_SSL_PROTO_DTLS - */ -#define MBEDTLS_SSL_DTLS_BADMAC_LIMIT - -/** - * \def MBEDTLS_SSL_SESSION_TICKETS - * - * Enable support for RFC 5077 session tickets in SSL. - * Client-side, provides full support for session tickets (maintainance of a - * session store remains the responsibility of the application, though). - * Server-side, you also need to provide callbacks for writing and parsing - * tickets, including authenticated encryption and key management. Example - * callbacks are provided by MBEDTLS_SSL_TICKET_C. - * - * Comment this macro to disable support for SSL session tickets - */ -#define MBEDTLS_SSL_SESSION_TICKETS - -/** - * \def MBEDTLS_SSL_EXPORT_KEYS - * - * Enable support for exporting key block and master secret. - * This is required for certain users of TLS, e.g. EAP-TLS. - * - * Comment this macro to disable support for key export - */ -#define MBEDTLS_SSL_EXPORT_KEYS - -/** - * \def MBEDTLS_SSL_SERVER_NAME_INDICATION - * - * Enable support for RFC 6066 server name indication (SNI) in SSL. - * - * Requires: MBEDTLS_X509_CRT_PARSE_C - * - * Comment this macro to disable support for server name indication in SSL - */ -#define MBEDTLS_SSL_SERVER_NAME_INDICATION - -/** - * \def MBEDTLS_SSL_TRUNCATED_HMAC - * - * Enable support for RFC 6066 truncated HMAC in SSL. - * - * Comment this macro to disable support for truncated HMAC in SSL - */ -#define MBEDTLS_SSL_TRUNCATED_HMAC - -/** - * \def MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT - * - * Fallback to old (pre-2.7), non-conforming implementation of the truncated - * HMAC extension which also truncates the HMAC key. Note that this option is - * only meant for a transitory upgrade period and is likely to be removed in - * a future version of the library. - * - * \warning The old implementation is non-compliant and has a security weakness - * (2^80 brute force attack on the HMAC key used for a single, - * uninterrupted connection). This should only be enabled temporarily - * when (1) the use of truncated HMAC is essential in order to save - * bandwidth, and (2) the peer is an Mbed TLS stack that doesn't use - * the fixed implementation yet (pre-2.7). - * - * \deprecated This option is deprecated and will likely be removed in a - * future version of Mbed TLS. - * - * Uncomment to fallback to old, non-compliant truncated HMAC implementation. - * - * Requires: MBEDTLS_SSL_TRUNCATED_HMAC - */ -//#define MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT - -/** - * \def MBEDTLS_THREADING_ALT - * - * Provide your own alternate threading implementation. - * - * Requires: MBEDTLS_THREADING_C - * - * Uncomment this to allow your own alternate threading implementation. - */ -//#define MBEDTLS_THREADING_ALT - -/** - * \def MBEDTLS_THREADING_PTHREAD - * - * Enable the pthread wrapper layer for the threading layer. - * - * Requires: MBEDTLS_THREADING_C - * - * Uncomment this to enable pthread mutexes. - */ -//#define MBEDTLS_THREADING_PTHREAD - -/** - * \def MBEDTLS_VERSION_FEATURES - * - * Allow run-time checking of compile-time enabled features. Thus allowing users - * to check at run-time if the library is for instance compiled with threading - * support via mbedtls_version_check_feature(). - * - * Requires: MBEDTLS_VERSION_C - * - * Comment this to disable run-time checking and save ROM space - */ -#define MBEDTLS_VERSION_FEATURES - -/** - * \def MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 - * - * If set, the X509 parser will not break-off when parsing an X509 certificate - * and encountering an extension in a v1 or v2 certificate. - * - * Uncomment to prevent an error. - */ -//#define MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 - -/** - * \def MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION - * - * If set, the X509 parser will not break-off when parsing an X509 certificate - * and encountering an unknown critical extension. - * - * \warning Depending on your PKI use, enabling this can be a security risk! - * - * Uncomment to prevent an error. - */ -//#define MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION - -/** - * \def MBEDTLS_X509_CHECK_KEY_USAGE - * - * Enable verification of the keyUsage extension (CA and leaf certificates). - * - * Disabling this avoids problems with mis-issued and/or misused - * (intermediate) CA and leaf certificates. - * - * \warning Depending on your PKI use, disabling this can be a security risk! - * - * Comment to skip keyUsage checking for both CA and leaf certificates. - */ -#define MBEDTLS_X509_CHECK_KEY_USAGE - -/** - * \def MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE - * - * Enable verification of the extendedKeyUsage extension (leaf certificates). - * - * Disabling this avoids problems with mis-issued and/or misused certificates. - * - * \warning Depending on your PKI use, disabling this can be a security risk! - * - * Comment to skip extendedKeyUsage checking for certificates. - */ -#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE - -/** - * \def MBEDTLS_X509_RSASSA_PSS_SUPPORT - * - * Enable parsing and verification of X.509 certificates, CRLs and CSRS - * signed with RSASSA-PSS (aka PKCS#1 v2.1). - * - * Comment this macro to disallow using RSASSA-PSS in certificates. - */ -#define MBEDTLS_X509_RSASSA_PSS_SUPPORT - -/** - * \def MBEDTLS_ZLIB_SUPPORT - * - * If set, the SSL/TLS module uses ZLIB to support compression and - * decompression of packet data. - * - * \warning TLS-level compression MAY REDUCE SECURITY! See for example the - * CRIME attack. Before enabling this option, you should examine with care if - * CRIME or similar exploits may be a applicable to your use case. - * - * \note Currently compression can't be used with DTLS. - * - * \deprecated This feature is deprecated and will be removed - * in the next major revision of the library. - * - * Used in: library/ssl_tls.c - * library/ssl_cli.c - * library/ssl_srv.c - * - * This feature requires zlib library and headers to be present. - * - * Uncomment to enable use of ZLIB - */ -//#define MBEDTLS_ZLIB_SUPPORT -/* \} name SECTION: mbed TLS feature support */ - -/** - * \name SECTION: mbed TLS modules - * - * This section enables or disables entire modules in mbed TLS - * \{ - */ - -/** - * \def MBEDTLS_AESNI_C - * - * Enable AES-NI support on x86-64. - * - * Module: library/aesni.c - * Caller: library/aes.c - * - * Requires: MBEDTLS_HAVE_ASM - * - * This modules adds support for the AES-NI instructions on x86-64 - */ -#define MBEDTLS_AESNI_C - -/** - * \def MBEDTLS_AES_C - * - * Enable the AES block cipher. - * - * Module: library/aes.c - * Caller: library/cipher.c - * library/pem.c - * library/ctr_drbg.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA - * - * PEM_PARSE uses AES for decrypting encrypted keys. - */ -#define MBEDTLS_AES_C - -/** - * \def MBEDTLS_ARC4_C - * - * Enable the ARCFOUR stream cipher. - * - * Module: library/arc4.c - * Caller: library/cipher.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA - * MBEDTLS_TLS_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_RSA_WITH_RC4_128_MD5 - * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA - * MBEDTLS_TLS_PSK_WITH_RC4_128_SHA - * - * \warning ARC4 is considered a weak cipher and its use constitutes a - * security risk. If possible, we recommend avoidng dependencies on - * it, and considering stronger ciphers instead. - * - */ -#define MBEDTLS_ARC4_C - -/** - * \def MBEDTLS_ASN1_PARSE_C - * - * Enable the generic ASN1 parser. - * - * Module: library/asn1.c - * Caller: library/x509.c - * library/dhm.c - * library/pkcs12.c - * library/pkcs5.c - * library/pkparse.c - */ -#define MBEDTLS_ASN1_PARSE_C - -/** - * \def MBEDTLS_ASN1_WRITE_C - * - * Enable the generic ASN1 writer. - * - * Module: library/asn1write.c - * Caller: library/ecdsa.c - * library/pkwrite.c - * library/x509_create.c - * library/x509write_crt.c - * library/x509write_csr.c - */ -#define MBEDTLS_ASN1_WRITE_C - -/** - * \def MBEDTLS_BASE64_C - * - * Enable the Base64 module. - * - * Module: library/base64.c - * Caller: library/pem.c - * - * This module is required for PEM support (required by X.509). - */ -#define MBEDTLS_BASE64_C - -/** - * \def MBEDTLS_BIGNUM_C - * - * Enable the multi-precision integer library. - * - * Module: library/bignum.c - * Caller: library/dhm.c - * library/ecp.c - * library/ecdsa.c - * library/rsa.c - * library/rsa_internal.c - * library/ssl_tls.c - * - * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support. - */ -#define MBEDTLS_BIGNUM_C - -/** - * \def MBEDTLS_BLOWFISH_C - * - * Enable the Blowfish block cipher. - * - * Module: library/blowfish.c - */ -#define MBEDTLS_BLOWFISH_C - -/** - * \def MBEDTLS_CAMELLIA_C - * - * Enable the Camellia block cipher. - * - * Module: library/camellia.c - * Caller: library/cipher.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 - */ -#define MBEDTLS_CAMELLIA_C - -/** - * \def MBEDTLS_ARIA_C - * - * Enable the ARIA block cipher. - * - * Module: library/aria.c - * Caller: library/cipher.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * - * MBEDTLS_TLS_RSA_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384 - */ -//#define MBEDTLS_ARIA_C - -/** - * \def MBEDTLS_CCM_C - * - * Enable the Counter with CBC-MAC (CCM) mode for 128-bit block cipher. - * - * Module: library/ccm.c - * - * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C - * - * This module enables the AES-CCM ciphersuites, if other requisites are - * enabled as well. - */ -#define MBEDTLS_CCM_C - -/** - * \def MBEDTLS_CERTS_C - * - * Enable the test certificates. - * - * Module: library/certs.c - * Caller: - * - * This module is used for testing (ssl_client/server). - */ -#define MBEDTLS_CERTS_C - -/** - * \def MBEDTLS_CHACHA20_C - * - * Enable the ChaCha20 stream cipher. - * - * Module: library/chacha20.c - */ -#define MBEDTLS_CHACHA20_C - -/** - * \def MBEDTLS_CHACHAPOLY_C - * - * Enable the ChaCha20-Poly1305 AEAD algorithm. - * - * Module: library/chachapoly.c - * - * This module requires: MBEDTLS_CHACHA20_C, MBEDTLS_POLY1305_C - */ -#define MBEDTLS_CHACHAPOLY_C - -/** - * \def MBEDTLS_CIPHER_C - * - * Enable the generic cipher layer. - * - * Module: library/cipher.c - * Caller: library/ssl_tls.c - * - * Uncomment to enable generic cipher wrappers. - */ -#define MBEDTLS_CIPHER_C - -/** - * \def MBEDTLS_CMAC_C - * - * Enable the CMAC (Cipher-based Message Authentication Code) mode for block - * ciphers. - * - * Module: library/cmac.c - * - * Requires: MBEDTLS_AES_C or MBEDTLS_DES_C - * - */ -//#define MBEDTLS_CMAC_C - -/** - * \def MBEDTLS_CTR_DRBG_C - * - * Enable the CTR_DRBG AES-256-based random generator. - * - * Module: library/ctr_drbg.c - * Caller: - * - * Requires: MBEDTLS_AES_C - * - * This module provides the CTR_DRBG AES-256 random number generator. - */ -#define MBEDTLS_CTR_DRBG_C - -/** - * \def MBEDTLS_DEBUG_C - * - * Enable the debug functions. - * - * Module: library/debug.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * - * This module provides debugging functions. - */ -#define MBEDTLS_DEBUG_C - -/** - * \def MBEDTLS_DES_C - * - * Enable the DES block cipher. - * - * Module: library/des.c - * Caller: library/pem.c - * library/cipher.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA - * - * PEM_PARSE uses DES/3DES for decrypting encrypted keys. - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers instead. - */ -#define MBEDTLS_DES_C - -/** - * \def MBEDTLS_DHM_C - * - * Enable the Diffie-Hellman-Merkle module. - * - * Module: library/dhm.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * - * This module is used by the following key exchanges: - * DHE-RSA, DHE-PSK - * - * \warning Using DHE constitutes a security risk as it - * is not possible to validate custom DH parameters. - * If possible, it is recommended users should consider - * preferring other methods of key exchange. - * See dhm.h for more details. - * - */ -#define MBEDTLS_DHM_C - -/** - * \def MBEDTLS_ECDH_C - * - * Enable the elliptic curve Diffie-Hellman library. - * - * Module: library/ecdh.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * - * This module is used by the following key exchanges: - * ECDHE-ECDSA, ECDHE-RSA, DHE-PSK - * - * Requires: MBEDTLS_ECP_C - */ -#define MBEDTLS_ECDH_C - -/** - * \def MBEDTLS_ECDSA_C - * - * Enable the elliptic curve DSA library. - * - * Module: library/ecdsa.c - * Caller: - * - * This module is used by the following key exchanges: - * ECDHE-ECDSA - * - * Requires: MBEDTLS_ECP_C, MBEDTLS_ASN1_WRITE_C, MBEDTLS_ASN1_PARSE_C - */ -#define MBEDTLS_ECDSA_C - -/** - * \def MBEDTLS_ECJPAKE_C - * - * Enable the elliptic curve J-PAKE library. - * - * \warning This is currently experimental. EC J-PAKE support is based on the - * Thread v1.0.0 specification; incompatible changes to the specification - * might still happen. For this reason, this is disabled by default. - * - * Module: library/ecjpake.c - * Caller: - * - * This module is used by the following key exchanges: - * ECJPAKE - * - * Requires: MBEDTLS_ECP_C, MBEDTLS_MD_C - */ -//#define MBEDTLS_ECJPAKE_C - -/** - * \def MBEDTLS_ECP_C - * - * Enable the elliptic curve over GF(p) library. - * - * Module: library/ecp.c - * Caller: library/ecdh.c - * library/ecdsa.c - * library/ecjpake.c - * - * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED - */ -#define MBEDTLS_ECP_C - -/** - * \def MBEDTLS_ENTROPY_C - * - * Enable the platform-specific entropy code. - * - * Module: library/entropy.c - * Caller: - * - * Requires: MBEDTLS_SHA512_C or MBEDTLS_SHA256_C - * - * This module provides a generic entropy pool - */ -#define MBEDTLS_ENTROPY_C - -/** - * \def MBEDTLS_ERROR_C - * - * Enable error code to error string conversion. - * - * Module: library/error.c - * Caller: - * - * This module enables mbedtls_strerror(). - */ -#define MBEDTLS_ERROR_C - -/** - * \def MBEDTLS_GCM_C - * - * Enable the Galois/Counter Mode (GCM) for AES. - * - * Module: library/gcm.c - * - * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C - * - * This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other - * requisites are enabled as well. - */ -#define MBEDTLS_GCM_C - -/** - * \def MBEDTLS_HAVEGE_C - * - * Enable the HAVEGE random generator. - * - * Warning: the HAVEGE random generator is not suitable for virtualized - * environments - * - * Warning: the HAVEGE random generator is dependent on timing and specific - * processor traits. It is therefore not advised to use HAVEGE as - * your applications primary random generator or primary entropy pool - * input. As a secondary input to your entropy pool, it IS able add - * the (limited) extra entropy it provides. - * - * Module: library/havege.c - * Caller: - * - * Requires: MBEDTLS_TIMING_C - * - * Uncomment to enable the HAVEGE random generator. - */ -//#define MBEDTLS_HAVEGE_C - -/** - * \def MBEDTLS_HKDF_C - * - * Enable the HKDF algorithm (RFC 5869). - * - * Module: library/hkdf.c - * Caller: - * - * Requires: MBEDTLS_MD_C - * - * This module adds support for the Hashed Message Authentication Code - * (HMAC)-based key derivation function (HKDF). - */ -#define MBEDTLS_HKDF_C - -/** - * \def MBEDTLS_HMAC_DRBG_C - * - * Enable the HMAC_DRBG random generator. - * - * Module: library/hmac_drbg.c - * Caller: - * - * Requires: MBEDTLS_MD_C - * - * Uncomment to enable the HMAC_DRBG random number geerator. - */ -#define MBEDTLS_HMAC_DRBG_C - -/** - * \def MBEDTLS_NIST_KW_C - * - * Enable the Key Wrapping mode for 128-bit block ciphers, - * as defined in NIST SP 800-38F. Only KW and KWP modes - * are supported. At the moment, only AES is approved by NIST. - * - * Module: library/nist_kw.c - * - * Requires: MBEDTLS_AES_C and MBEDTLS_CIPHER_C - */ -//#define MBEDTLS_NIST_KW_C - -/** - * \def MBEDTLS_MD_C - * - * Enable the generic message digest layer. - * - * Module: library/md.c - * Caller: - * - * Uncomment to enable generic message digest wrappers. - */ -#define MBEDTLS_MD_C - -/** - * \def MBEDTLS_MD2_C - * - * Enable the MD2 hash algorithm. - * - * Module: library/md2.c - * Caller: - * - * Uncomment to enable support for (rare) MD2-signed X.509 certs. - * - * \warning MD2 is considered a weak message digest and its use constitutes a - * security risk. If possible, we recommend avoiding dependencies on - * it, and considering stronger message digests instead. - * - */ -//#define MBEDTLS_MD2_C - -/** - * \def MBEDTLS_MD4_C - * - * Enable the MD4 hash algorithm. - * - * Module: library/md4.c - * Caller: - * - * Uncomment to enable support for (rare) MD4-signed X.509 certs. - * - * \warning MD4 is considered a weak message digest and its use constitutes a - * security risk. If possible, we recommend avoiding dependencies on - * it, and considering stronger message digests instead. - * - */ -//#define MBEDTLS_MD4_C - -/** - * \def MBEDTLS_MD5_C - * - * Enable the MD5 hash algorithm. - * - * Module: library/md5.c - * Caller: library/md.c - * library/pem.c - * library/ssl_tls.c - * - * This module is required for SSL/TLS up to version 1.1, and for TLS 1.2 - * depending on the handshake parameters. Further, it is used for checking - * MD5-signed certificates, and for PBKDF1 when decrypting PEM-encoded - * encrypted keys. - * - * \warning MD5 is considered a weak message digest and its use constitutes a - * security risk. If possible, we recommend avoiding dependencies on - * it, and considering stronger message digests instead. - * - */ -#define MBEDTLS_MD5_C - -/** - * \def MBEDTLS_MEMORY_BUFFER_ALLOC_C - * - * Enable the buffer allocator implementation that makes use of a (stack) - * based buffer to 'allocate' dynamic memory. (replaces calloc() and free() - * calls) - * - * Module: library/memory_buffer_alloc.c - * - * Requires: MBEDTLS_PLATFORM_C - * MBEDTLS_PLATFORM_MEMORY (to use it within mbed TLS) - * - * Enable this module to enable the buffer memory allocator. - */ -//#define MBEDTLS_MEMORY_BUFFER_ALLOC_C - -/** - * \def MBEDTLS_NET_C - * - * Enable the TCP and UDP over IPv6/IPv4 networking routines. - * - * \note This module only works on POSIX/Unix (including Linux, BSD and OS X) - * and Windows. For other platforms, you'll want to disable it, and write your - * own networking callbacks to be passed to \c mbedtls_ssl_set_bio(). - * - * \note See also our Knowledge Base article about porting to a new - * environment: - * https://tls.mbed.org/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS - * - * Module: library/net_sockets.c - * - * This module provides networking routines. - */ -#define MBEDTLS_NET_C - -/** - * \def MBEDTLS_OID_C - * - * Enable the OID database. - * - * Module: library/oid.c - * Caller: library/asn1write.c - * library/pkcs5.c - * library/pkparse.c - * library/pkwrite.c - * library/rsa.c - * library/x509.c - * library/x509_create.c - * library/x509_crl.c - * library/x509_crt.c - * library/x509_csr.c - * library/x509write_crt.c - * library/x509write_csr.c - * - * This modules translates between OIDs and internal values. - */ -#define MBEDTLS_OID_C - -/** - * \def MBEDTLS_PADLOCK_C - * - * Enable VIA Padlock support on x86. - * - * Module: library/padlock.c - * Caller: library/aes.c - * - * Requires: MBEDTLS_HAVE_ASM - * - * This modules adds support for the VIA PadLock on x86. - */ -#define MBEDTLS_PADLOCK_C - -/** - * \def MBEDTLS_PEM_PARSE_C - * - * Enable PEM decoding / parsing. - * - * Module: library/pem.c - * Caller: library/dhm.c - * library/pkparse.c - * library/x509_crl.c - * library/x509_crt.c - * library/x509_csr.c - * - * Requires: MBEDTLS_BASE64_C - * - * This modules adds support for decoding / parsing PEM files. - */ -#define MBEDTLS_PEM_PARSE_C - -/** - * \def MBEDTLS_PEM_WRITE_C - * - * Enable PEM encoding / writing. - * - * Module: library/pem.c - * Caller: library/pkwrite.c - * library/x509write_crt.c - * library/x509write_csr.c - * - * Requires: MBEDTLS_BASE64_C - * - * This modules adds support for encoding / writing PEM files. - */ -#define MBEDTLS_PEM_WRITE_C - -/** - * \def MBEDTLS_PK_C - * - * Enable the generic public (asymetric) key layer. - * - * Module: library/pk.c - * Caller: library/ssl_tls.c - * library/ssl_cli.c - * library/ssl_srv.c - * - * Requires: MBEDTLS_RSA_C or MBEDTLS_ECP_C - * - * Uncomment to enable generic public key wrappers. - */ -#define MBEDTLS_PK_C - -/** - * \def MBEDTLS_PK_PARSE_C - * - * Enable the generic public (asymetric) key parser. - * - * Module: library/pkparse.c - * Caller: library/x509_crt.c - * library/x509_csr.c - * - * Requires: MBEDTLS_PK_C - * - * Uncomment to enable generic public key parse functions. - */ -#define MBEDTLS_PK_PARSE_C - -/** - * \def MBEDTLS_PK_WRITE_C - * - * Enable the generic public (asymetric) key writer. - * - * Module: library/pkwrite.c - * Caller: library/x509write.c - * - * Requires: MBEDTLS_PK_C - * - * Uncomment to enable generic public key write functions. - */ -#define MBEDTLS_PK_WRITE_C - -/** - * \def MBEDTLS_PKCS5_C - * - * Enable PKCS#5 functions. - * - * Module: library/pkcs5.c - * - * Requires: MBEDTLS_MD_C - * - * This module adds support for the PKCS#5 functions. - */ -#define MBEDTLS_PKCS5_C - -/** - * \def MBEDTLS_PKCS11_C - * - * Enable wrapper for PKCS#11 smartcard support. - * - * Module: library/pkcs11.c - * Caller: library/pk.c - * - * Requires: MBEDTLS_PK_C - * - * This module enables SSL/TLS PKCS #11 smartcard support. - * Requires the presence of the PKCS#11 helper library (libpkcs11-helper) - */ -//#define MBEDTLS_PKCS11_C - -/** - * \def MBEDTLS_PKCS12_C - * - * Enable PKCS#12 PBE functions. - * Adds algorithms for parsing PKCS#8 encrypted private keys - * - * Module: library/pkcs12.c - * Caller: library/pkparse.c - * - * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_CIPHER_C, MBEDTLS_MD_C - * Can use: MBEDTLS_ARC4_C - * - * This module enables PKCS#12 functions. - */ -#define MBEDTLS_PKCS12_C - -/** - * \def MBEDTLS_PLATFORM_C - * - * Enable the platform abstraction layer that allows you to re-assign - * functions like calloc(), free(), snprintf(), printf(), fprintf(), exit(). - * - * Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT - * or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned - * above to be specified at runtime or compile time respectively. - * - * \note This abstraction layer must be enabled on Windows (including MSYS2) - * as other module rely on it for a fixed snprintf implementation. - * - * Module: library/platform.c - * Caller: Most other .c files - * - * This module enables abstraction of common (libc) functions. - */ -#define MBEDTLS_PLATFORM_C - -/** - * \def MBEDTLS_POLY1305_C - * - * Enable the Poly1305 MAC algorithm. - * - * Module: library/poly1305.c - * Caller: library/chachapoly.c - */ -#define MBEDTLS_POLY1305_C - -/** - * \def MBEDTLS_RIPEMD160_C - * - * Enable the RIPEMD-160 hash algorithm. - * - * Module: library/ripemd160.c - * Caller: library/md.c - * - */ -#define MBEDTLS_RIPEMD160_C - -/** - * \def MBEDTLS_RSA_C - * - * Enable the RSA public-key cryptosystem. - * - * Module: library/rsa.c - * library/rsa_internal.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * library/x509.c - * - * This module is used by the following key exchanges: - * RSA, DHE-RSA, ECDHE-RSA, RSA-PSK - * - * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C - */ -#define MBEDTLS_RSA_C - -/** - * \def MBEDTLS_SHA1_C - * - * Enable the SHA1 cryptographic hash algorithm. - * - * Module: library/sha1.c - * Caller: library/md.c - * library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * library/x509write_crt.c - * - * This module is required for SSL/TLS up to version 1.1, for TLS 1.2 - * depending on the handshake parameters, and for SHA1-signed certificates. - * - * \warning SHA-1 is considered a weak message digest and its use constitutes - * a security risk. If possible, we recommend avoiding dependencies - * on it, and considering stronger message digests instead. - * - */ -#define MBEDTLS_SHA1_C - -/** - * \def MBEDTLS_SHA256_C - * - * Enable the SHA-224 and SHA-256 cryptographic hash algorithms. - * - * Module: library/sha256.c - * Caller: library/entropy.c - * library/md.c - * library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * - * This module adds support for SHA-224 and SHA-256. - * This module is required for the SSL/TLS 1.2 PRF function. - */ -#define MBEDTLS_SHA256_C - -/** - * \def MBEDTLS_SHA512_C - * - * Enable the SHA-384 and SHA-512 cryptographic hash algorithms. - * - * Module: library/sha512.c - * Caller: library/entropy.c - * library/md.c - * library/ssl_cli.c - * library/ssl_srv.c - * - * This module adds support for SHA-384 and SHA-512. - */ -#define MBEDTLS_SHA512_C - -/** - * \def MBEDTLS_SSL_CACHE_C - * - * Enable simple SSL cache implementation. - * - * Module: library/ssl_cache.c - * Caller: - * - * Requires: MBEDTLS_SSL_CACHE_C - */ -#define MBEDTLS_SSL_CACHE_C - -/** - * \def MBEDTLS_SSL_COOKIE_C - * - * Enable basic implementation of DTLS cookies for hello verification. - * - * Module: library/ssl_cookie.c - * Caller: - */ -#define MBEDTLS_SSL_COOKIE_C - -/** - * \def MBEDTLS_SSL_TICKET_C - * - * Enable an implementation of TLS server-side callbacks for session tickets. - * - * Module: library/ssl_ticket.c - * Caller: - * - * Requires: MBEDTLS_CIPHER_C - */ -#define MBEDTLS_SSL_TICKET_C - -/** - * \def MBEDTLS_SSL_CLI_C - * - * Enable the SSL/TLS client code. - * - * Module: library/ssl_cli.c - * Caller: - * - * Requires: MBEDTLS_SSL_TLS_C - * - * This module is required for SSL/TLS client support. - */ -#define MBEDTLS_SSL_CLI_C - -/** - * \def MBEDTLS_SSL_SRV_C - * - * Enable the SSL/TLS server code. - * - * Module: library/ssl_srv.c - * Caller: - * - * Requires: MBEDTLS_SSL_TLS_C - * - * This module is required for SSL/TLS server support. - */ -#define MBEDTLS_SSL_SRV_C - -/** - * \def MBEDTLS_SSL_TLS_C - * - * Enable the generic SSL/TLS code. - * - * Module: library/ssl_tls.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * - * Requires: MBEDTLS_CIPHER_C, MBEDTLS_MD_C - * and at least one of the MBEDTLS_SSL_PROTO_XXX defines - * - * This module is required for SSL/TLS. - */ -#define MBEDTLS_SSL_TLS_C - -/** - * \def MBEDTLS_THREADING_C - * - * Enable the threading abstraction layer. - * By default mbed TLS assumes it is used in a non-threaded environment or that - * contexts are not shared between threads. If you do intend to use contexts - * between threads, you will need to enable this layer to prevent race - * conditions. See also our Knowledge Base article about threading: - * https://tls.mbed.org/kb/development/thread-safety-and-multi-threading - * - * Module: library/threading.c - * - * This allows different threading implementations (self-implemented or - * provided). - * - * You will have to enable either MBEDTLS_THREADING_ALT or - * MBEDTLS_THREADING_PTHREAD. - * - * Enable this layer to allow use of mutexes within mbed TLS - */ -//#define MBEDTLS_THREADING_C - -/** - * \def MBEDTLS_TIMING_C - * - * Enable the semi-portable timing interface. - * - * \note The provided implementation only works on POSIX/Unix (including Linux, - * BSD and OS X) and Windows. On other platforms, you can either disable that - * module and provide your own implementations of the callbacks needed by - * \c mbedtls_ssl_set_timer_cb() for DTLS, or leave it enabled and provide - * your own implementation of the whole module by setting - * \c MBEDTLS_TIMING_ALT in the current file. - * - * \note See also our Knowledge Base article about porting to a new - * environment: - * https://tls.mbed.org/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS - * - * Module: library/timing.c - * Caller: library/havege.c - * - * This module is used by the HAVEGE random number generator. - */ -#define MBEDTLS_TIMING_C - -/** - * \def MBEDTLS_VERSION_C - * - * Enable run-time version information. - * - * Module: library/version.c - * - * This module provides run-time version information. - */ -#define MBEDTLS_VERSION_C - -/** - * \def MBEDTLS_X509_USE_C - * - * Enable X.509 core for using certificates. - * - * Module: library/x509.c - * Caller: library/x509_crl.c - * library/x509_crt.c - * library/x509_csr.c - * - * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, - * MBEDTLS_PK_PARSE_C - * - * This module is required for the X.509 parsing modules. - */ -#define MBEDTLS_X509_USE_C - -/** - * \def MBEDTLS_X509_CRT_PARSE_C - * - * Enable X.509 certificate parsing. - * - * Module: library/x509_crt.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * - * Requires: MBEDTLS_X509_USE_C - * - * This module is required for X.509 certificate parsing. - */ -#define MBEDTLS_X509_CRT_PARSE_C - -/** - * \def MBEDTLS_X509_CRL_PARSE_C - * - * Enable X.509 CRL parsing. - * - * Module: library/x509_crl.c - * Caller: library/x509_crt.c - * - * Requires: MBEDTLS_X509_USE_C - * - * This module is required for X.509 CRL parsing. - */ -#define MBEDTLS_X509_CRL_PARSE_C - -/** - * \def MBEDTLS_X509_CSR_PARSE_C - * - * Enable X.509 Certificate Signing Request (CSR) parsing. - * - * Module: library/x509_csr.c - * Caller: library/x509_crt_write.c - * - * Requires: MBEDTLS_X509_USE_C - * - * This module is used for reading X.509 certificate request. - */ -#define MBEDTLS_X509_CSR_PARSE_C - -/** - * \def MBEDTLS_X509_CREATE_C - * - * Enable X.509 core for creating certificates. - * - * Module: library/x509_create.c - * - * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, MBEDTLS_PK_WRITE_C - * - * This module is the basis for creating X.509 certificates and CSRs. - */ -#define MBEDTLS_X509_CREATE_C - -/** - * \def MBEDTLS_X509_CRT_WRITE_C - * - * Enable creating X.509 certificates. - * - * Module: library/x509_crt_write.c - * - * Requires: MBEDTLS_X509_CREATE_C - * - * This module is required for X.509 certificate creation. - */ -#define MBEDTLS_X509_CRT_WRITE_C - -/** - * \def MBEDTLS_X509_CSR_WRITE_C - * - * Enable creating X.509 Certificate Signing Requests (CSR). - * - * Module: library/x509_csr_write.c - * - * Requires: MBEDTLS_X509_CREATE_C - * - * This module is required for X.509 certificate request writing. - */ -#define MBEDTLS_X509_CSR_WRITE_C - -/** - * \def MBEDTLS_XTEA_C - * - * Enable the XTEA block cipher. - * - * Module: library/xtea.c - * Caller: - */ -#define MBEDTLS_XTEA_C - -/* \} name SECTION: mbed TLS modules */ - -/** - * \name SECTION: Module configuration options - * - * This section allows for the setting of module specific sizes and - * configuration options. The default values are already present in the - * relevant header files and should suffice for the regular use cases. - * - * Our advice is to enable options and change their values here - * only if you have a good reason and know the consequences. - * - * Please check the respective header file for documentation on these - * parameters (to prevent duplicate documentation). - * \{ - */ - -/* MPI / BIGNUM options */ -//#define MBEDTLS_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */ -//#define MBEDTLS_MPI_MAX_SIZE 1024 /**< Maximum number of bytes for usable MPIs. */ - -/* CTR_DRBG options */ -//#define MBEDTLS_CTR_DRBG_ENTROPY_LEN 48 /**< Amount of entropy used per seed by default (48 with SHA-512, 32 with SHA-256) */ -//#define MBEDTLS_CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */ -//#define MBEDTLS_CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */ -//#define MBEDTLS_CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */ -//#define MBEDTLS_CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */ - -/* HMAC_DRBG options */ -//#define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */ -//#define MBEDTLS_HMAC_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */ -//#define MBEDTLS_HMAC_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */ -//#define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */ - -/* ECP options */ -//#define MBEDTLS_ECP_MAX_BITS 521 /**< Maximum bit size of groups */ -//#define MBEDTLS_ECP_WINDOW_SIZE 6 /**< Maximum window size used */ -//#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 /**< Enable fixed-point speed-up */ - -/* Entropy options */ -//#define MBEDTLS_ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */ -//#define MBEDTLS_ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */ -//#define MBEDTLS_ENTROPY_MIN_HARDWARE 32 /**< Default minimum number of bytes required for the hardware entropy source mbedtls_hardware_poll() before entropy is released */ - -/* Memory buffer allocator options */ -//#define MBEDTLS_MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */ - -/* Platform options */ -//#define MBEDTLS_PLATFORM_STD_MEM_HDR /**< Header to include if MBEDTLS_PLATFORM_NO_STD_FUNCTIONS is defined. Don't define if no header is needed. */ -//#define MBEDTLS_PLATFORM_STD_CALLOC calloc /**< Default allocator to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_FREE free /**< Default free to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_EXIT exit /**< Default exit to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_TIME time /**< Default time to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */ -//#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**< Default fprintf to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_PRINTF printf /**< Default printf to use, can be undefined */ -/* Note: your snprintf must correclty zero-terminate the buffer! */ -//#define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf /**< Default snprintf to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS 0 /**< Default exit value to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE 1 /**< Default exit value to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_NV_SEED_READ mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_NV_SEED_FILE "seedfile" /**< Seed file to read/write with default implementation */ - -/* To Use Function Macros MBEDTLS_PLATFORM_C must be enabled */ -/* MBEDTLS_PLATFORM_XXX_MACRO and MBEDTLS_PLATFORM_XXX_ALT cannot both be defined */ -//#define MBEDTLS_PLATFORM_CALLOC_MACRO calloc /**< Default allocator macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_FREE_MACRO free /**< Default free macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_EXIT_MACRO exit /**< Default exit macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_TIME_MACRO time /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */ -//#define MBEDTLS_PLATFORM_TIME_TYPE_MACRO time_t /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */ -//#define MBEDTLS_PLATFORM_FPRINTF_MACRO fprintf /**< Default fprintf macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_PRINTF_MACRO printf /**< Default printf macro to use, can be undefined */ -/* Note: your snprintf must correclty zero-terminate the buffer! */ -//#define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf /**< Default snprintf macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_NV_SEED_READ_MACRO mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */ -//#define MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */ - -/* SSL Cache options */ -//#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */ -//#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */ - -/* SSL options */ - -/** \def MBEDTLS_SSL_MAX_CONTENT_LEN - * - * Maximum fragment length in bytes. - * - * Determines the size of both the incoming and outgoing TLS I/O buffers. - * - * Uncommenting MBEDTLS_SSL_IN_CONTENT_LEN and/or MBEDTLS_SSL_OUT_CONTENT_LEN - * will override this length by setting maximum incoming and/or outgoing - * fragment length, respectively. - */ -//#define MBEDTLS_SSL_MAX_CONTENT_LEN 16384 - -/** \def MBEDTLS_SSL_IN_CONTENT_LEN - * - * Maximum incoming fragment length in bytes. - * - * Uncomment to set the size of the inward TLS buffer independently of the - * outward buffer. - */ -//#define MBEDTLS_SSL_IN_CONTENT_LEN 16384 - -/** \def MBEDTLS_SSL_OUT_CONTENT_LEN - * - * Maximum outgoing fragment length in bytes. - * - * Uncomment to set the size of the outward TLS buffer independently of the - * inward buffer. - * - * It is possible to save RAM by setting a smaller outward buffer, while keeping - * the default inward 16384 byte buffer to conform to the TLS specification. - * - * The minimum required outward buffer size is determined by the handshake - * protocol's usage. Handshaking will fail if the outward buffer is too small. - * The specific size requirement depends on the configured ciphers and any - * certificate data which is sent during the handshake. - * - * For absolute minimum RAM usage, it's best to enable - * MBEDTLS_SSL_MAX_FRAGMENT_LENGTH and reduce MBEDTLS_SSL_MAX_CONTENT_LEN. This - * reduces both incoming and outgoing buffer sizes. However this is only - * guaranteed if the other end of the connection also supports the TLS - * max_fragment_len extension. Otherwise the connection may fail. - */ -//#define MBEDTLS_SSL_OUT_CONTENT_LEN 16384 - -/** \def MBEDTLS_SSL_DTLS_MAX_BUFFERING - * - * Maximum number of heap-allocated bytes for the purpose of - * DTLS handshake message reassembly and future message buffering. - * - * This should be at least 9/8 * MBEDTLSSL_IN_CONTENT_LEN - * to account for a reassembled handshake message of maximum size, - * together with its reassembly bitmap. - * - * A value of 2 * MBEDTLS_SSL_IN_CONTENT_LEN (32768 by default) - * should be sufficient for all practical situations as it allows - * to reassembly a large handshake message (such as a certificate) - * while buffering multiple smaller handshake messages. - * - */ -//#define MBEDTLS_SSL_DTLS_MAX_BUFFERING 32768 - -//#define MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */ -//#define MBEDTLS_PSK_MAX_LEN 32 /**< Max size of TLS pre-shared keys, in bytes (default 256 bits) */ -//#define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */ - -/** - * Complete list of ciphersuites to use, in order of preference. - * - * \warning No dependency checking is done on that field! This option can only - * be used to restrict the set of available ciphersuites. It is your - * responsibility to make sure the needed modules are active. - * - * Use this to save a few hundred bytes of ROM (default ordering of all - * available ciphersuites) and a few to a few hundred bytes of RAM. - * - * The value below is only an example, not the default. - */ -//#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 - -/* X509 options */ -//#define MBEDTLS_X509_MAX_INTERMEDIATE_CA 8 /**< Maximum number of intermediate CAs in a verification chain. */ -//#define MBEDTLS_X509_MAX_FILE_PATH_LEN 512 /**< Maximum length of a path/filename string in bytes including the null terminator character ('\0'). */ - -/** - * Allow SHA-1 in the default TLS configuration for certificate signing. - * Without this build-time option, SHA-1 support must be activated explicitly - * through mbedtls_ssl_conf_cert_profile. Turning on this option is not - * recommended because of it is possible to generate SHA-1 collisions, however - * this may be safe for legacy infrastructure where additional controls apply. - * - * \warning SHA-1 is considered a weak message digest and its use constitutes - * a security risk. If possible, we recommend avoiding dependencies - * on it, and considering stronger message digests instead. - * - */ -// #define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES - -/** - * Allow SHA-1 in the default TLS configuration for TLS 1.2 handshake - * signature and ciphersuite selection. Without this build-time option, SHA-1 - * support must be activated explicitly through mbedtls_ssl_conf_sig_hashes. - * The use of SHA-1 in TLS <= 1.1 and in HMAC-SHA-1 is always allowed by - * default. At the time of writing, there is no practical attack on the use - * of SHA-1 in handshake signatures, hence this option is turned on by default - * to preserve compatibility with existing peers, but the general - * warning applies nonetheless: - * - * \warning SHA-1 is considered a weak message digest and its use constitutes - * a security risk. If possible, we recommend avoiding dependencies - * on it, and considering stronger message digests instead. - * - */ -#define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE - -/** - * Uncomment the macro to let mbed TLS use your alternate implementation of - * mbedtls_platform_zeroize(). This replaces the default implementation in - * platform_util.c. - * - * mbedtls_platform_zeroize() is a widely used function across the library to - * zero a block of memory. The implementation is expected to be secure in the - * sense that it has been written to prevent the compiler from removing calls - * to mbedtls_platform_zeroize() as part of redundant code elimination - * optimizations. However, it is difficult to guarantee that calls to - * mbedtls_platform_zeroize() will not be optimized by the compiler as older - * versions of the C language standards do not provide a secure implementation - * of memset(). Therefore, MBEDTLS_PLATFORM_ZEROIZE_ALT enables users to - * configure their own implementation of mbedtls_platform_zeroize(), for - * example by using directives specific to their compiler, features from newer - * C standards (e.g using memset_s() in C11) or calling a secure memset() from - * their system (e.g explicit_bzero() in BSD). - */ -//#define MBEDTLS_PLATFORM_ZEROIZE_ALT - -/** - * Uncomment the macro to let Mbed TLS use your alternate implementation of - * mbedtls_platform_gmtime_r(). This replaces the default implementation in - * platform_util.c. - * - * gmtime() is not a thread-safe function as defined in the C standard. The - * library will try to use safer implementations of this function, such as - * gmtime_r() when available. However, if Mbed TLS cannot identify the target - * system, the implementation of mbedtls_platform_gmtime_r() will default to - * using the standard gmtime(). In this case, calls from the library to - * gmtime() will be guarded by the global mutex mbedtls_threading_gmtime_mutex - * if MBEDTLS_THREADING_C is enabled. We recommend that calls from outside the - * library are also guarded with this mutex to avoid race conditions. However, - * if the macro MBEDTLS_PLATFORM_GMTIME_R_ALT is defined, Mbed TLS will - * unconditionally use the implementation for mbedtls_platform_gmtime_r() - * supplied at compile time. - */ -//#define MBEDTLS_PLATFORM_GMTIME_R_ALT - -/* \} name SECTION: Customisation configuration options */ - -/* Target and application specific configurations */ -//#define YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE "target_config.h" - -#if defined(TARGET_LIKE_MBED) && defined(YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE) -#include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE -#endif - -/* - * Allow user to override any previous default. - * - * Use two macro names for that, as: - * - with yotta the prefix YOTTA_CFG_ is forced - * - without yotta is looks weird to have a YOTTA prefix. - */ -#if defined(YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE) -#include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE -#elif defined(MBEDTLS_USER_CONFIG_FILE) -#include MBEDTLS_USER_CONFIG_FILE -#endif - -#include "check_config.h" - -#endif /* MBEDTLS_CONFIG_H */ diff --git a/tools/sdk/include/mbedtls/mbedtls/ctr_drbg.h b/tools/sdk/include/mbedtls/mbedtls/ctr_drbg.h deleted file mode 100644 index 3a4b7f3f13d..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/ctr_drbg.h +++ /dev/null @@ -1,330 +0,0 @@ -/** - * \file ctr_drbg.h - * - * \brief This file contains CTR_DRBG definitions and functions. - * - * CTR_DRBG is a standardized way of building a PRNG from a block-cipher - * in counter mode operation, as defined in NIST SP 800-90A: - * Recommendation for Random Number Generation Using Deterministic Random - * Bit Generators. - * - * The Mbed TLS implementation of CTR_DRBG uses AES-256 as the underlying - * block cipher. - */ -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_CTR_DRBG_H -#define MBEDTLS_CTR_DRBG_H - -#include "aes.h" - -#if defined(MBEDTLS_THREADING_C) -#include "threading.h" -#endif - -#define MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED -0x0034 /**< The entropy source failed. */ -#define MBEDTLS_ERR_CTR_DRBG_REQUEST_TOO_BIG -0x0036 /**< The requested random buffer length is too big. */ -#define MBEDTLS_ERR_CTR_DRBG_INPUT_TOO_BIG -0x0038 /**< The input (entropy + additional data) is too large. */ -#define MBEDTLS_ERR_CTR_DRBG_FILE_IO_ERROR -0x003A /**< Read or write error in file. */ - -#define MBEDTLS_CTR_DRBG_BLOCKSIZE 16 /**< The block size used by the cipher. */ -#define MBEDTLS_CTR_DRBG_KEYSIZE 32 /**< The key size used by the cipher. */ -#define MBEDTLS_CTR_DRBG_KEYBITS ( MBEDTLS_CTR_DRBG_KEYSIZE * 8 ) /**< The key size for the DRBG operation, in bits. */ -#define MBEDTLS_CTR_DRBG_SEEDLEN ( MBEDTLS_CTR_DRBG_KEYSIZE + MBEDTLS_CTR_DRBG_BLOCKSIZE ) /**< The seed length, calculated as (counter + AES key). */ - -/** - * \name SECTION: Module settings - * - * The configuration options you can set for this module are in this section. - * Either change them in config.h or define them using the compiler command - * line. - * \{ - */ - -#if !defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) -#if defined(MBEDTLS_SHA512_C) && !defined(MBEDTLS_ENTROPY_FORCE_SHA256) -#define MBEDTLS_CTR_DRBG_ENTROPY_LEN 48 -/**< The amount of entropy used per seed by default: - *
  • 48 with SHA-512.
  • - *
  • 32 with SHA-256.
- */ -#else -#define MBEDTLS_CTR_DRBG_ENTROPY_LEN 32 -/**< Amount of entropy used per seed by default: - *
  • 48 with SHA-512.
  • - *
  • 32 with SHA-256.
- */ -#endif -#endif - -#if !defined(MBEDTLS_CTR_DRBG_RESEED_INTERVAL) -#define MBEDTLS_CTR_DRBG_RESEED_INTERVAL 10000 -/**< The interval before reseed is performed by default. */ -#endif - -#if !defined(MBEDTLS_CTR_DRBG_MAX_INPUT) -#define MBEDTLS_CTR_DRBG_MAX_INPUT 256 -/**< The maximum number of additional input Bytes. */ -#endif - -#if !defined(MBEDTLS_CTR_DRBG_MAX_REQUEST) -#define MBEDTLS_CTR_DRBG_MAX_REQUEST 1024 -/**< The maximum number of requested Bytes per call. */ -#endif - -#if !defined(MBEDTLS_CTR_DRBG_MAX_SEED_INPUT) -#define MBEDTLS_CTR_DRBG_MAX_SEED_INPUT 384 -/**< The maximum size of seed or reseed buffer. */ -#endif - -/* \} name SECTION: Module settings */ - -#define MBEDTLS_CTR_DRBG_PR_OFF 0 -/**< Prediction resistance is disabled. */ -#define MBEDTLS_CTR_DRBG_PR_ON 1 -/**< Prediction resistance is enabled. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief The CTR_DRBG context structure. - */ -typedef struct mbedtls_ctr_drbg_context -{ - unsigned char counter[16]; /*!< The counter (V). */ - int reseed_counter; /*!< The reseed counter. */ - int prediction_resistance; /*!< This determines whether prediction - resistance is enabled, that is - whether to systematically reseed before - each random generation. */ - size_t entropy_len; /*!< The amount of entropy grabbed on each - seed or reseed operation. */ - int reseed_interval; /*!< The reseed interval. */ - - mbedtls_aes_context aes_ctx; /*!< The AES context. */ - - /* - * Callbacks (Entropy) - */ - int (*f_entropy)(void *, unsigned char *, size_t); - /*!< The entropy callback function. */ - - void *p_entropy; /*!< The context for the entropy function. */ - -#if defined(MBEDTLS_THREADING_C) - mbedtls_threading_mutex_t mutex; -#endif -} -mbedtls_ctr_drbg_context; - -/** - * \brief This function initializes the CTR_DRBG context, - * and prepares it for mbedtls_ctr_drbg_seed() - * or mbedtls_ctr_drbg_free(). - * - * \param ctx The CTR_DRBG context to initialize. - */ -void mbedtls_ctr_drbg_init( mbedtls_ctr_drbg_context *ctx ); - -/** - * \brief This function seeds and sets up the CTR_DRBG - * entropy source for future reseeds. - * - * \note Personalization data can be provided in addition to the more generic - * entropy source, to make this instantiation as unique as possible. - * - * \param ctx The CTR_DRBG context to seed. - * \param f_entropy The entropy callback, taking as arguments the - * \p p_entropy context, the buffer to fill, and the - length of the buffer. - * \param p_entropy The entropy context. - * \param custom Personalization data, that is device-specific - identifiers. Can be NULL. - * \param len The length of the personalization data. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED on failure. - */ -int mbedtls_ctr_drbg_seed( mbedtls_ctr_drbg_context *ctx, - int (*f_entropy)(void *, unsigned char *, size_t), - void *p_entropy, - const unsigned char *custom, - size_t len ); - -/** - * \brief This function clears CTR_CRBG context data. - * - * \param ctx The CTR_DRBG context to clear. - */ -void mbedtls_ctr_drbg_free( mbedtls_ctr_drbg_context *ctx ); - -/** - * \brief This function turns prediction resistance on or off. - * The default value is off. - * - * \note If enabled, entropy is gathered at the beginning of - * every call to mbedtls_ctr_drbg_random_with_add(). - * Only use this if your entropy source has sufficient - * throughput. - * - * \param ctx The CTR_DRBG context. - * \param resistance #MBEDTLS_CTR_DRBG_PR_ON or #MBEDTLS_CTR_DRBG_PR_OFF. - */ -void mbedtls_ctr_drbg_set_prediction_resistance( mbedtls_ctr_drbg_context *ctx, - int resistance ); - -/** - * \brief This function sets the amount of entropy grabbed on each - * seed or reseed. The default value is - * #MBEDTLS_CTR_DRBG_ENTROPY_LEN. - * - * \param ctx The CTR_DRBG context. - * \param len The amount of entropy to grab. - */ -void mbedtls_ctr_drbg_set_entropy_len( mbedtls_ctr_drbg_context *ctx, - size_t len ); - -/** - * \brief This function sets the reseed interval. - * The default value is #MBEDTLS_CTR_DRBG_RESEED_INTERVAL. - * - * \param ctx The CTR_DRBG context. - * \param interval The reseed interval. - */ -void mbedtls_ctr_drbg_set_reseed_interval( mbedtls_ctr_drbg_context *ctx, - int interval ); - -/** - * \brief This function reseeds the CTR_DRBG context, that is - * extracts data from the entropy source. - * - * \param ctx The CTR_DRBG context. - * \param additional Additional data to add to the state. Can be NULL. - * \param len The length of the additional data. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED on failure. - */ -int mbedtls_ctr_drbg_reseed( mbedtls_ctr_drbg_context *ctx, - const unsigned char *additional, size_t len ); - -/** - * \brief This function updates the state of the CTR_DRBG context. - * - * \note If \p add_len is greater than - * #MBEDTLS_CTR_DRBG_MAX_SEED_INPUT, only the first - * #MBEDTLS_CTR_DRBG_MAX_SEED_INPUT Bytes are used. - * The remaining Bytes are silently discarded. - * - * \param ctx The CTR_DRBG context. - * \param additional The data to update the state with. - * \param add_len Length of \p additional data. - * - */ -void mbedtls_ctr_drbg_update( mbedtls_ctr_drbg_context *ctx, - const unsigned char *additional, size_t add_len ); - -/** - * \brief This function updates a CTR_DRBG instance with additional - * data and uses it to generate random data. - * - * \note The function automatically reseeds if the reseed counter is exceeded. - * - * \param p_rng The CTR_DRBG context. This must be a pointer to a - * #mbedtls_ctr_drbg_context structure. - * \param output The buffer to fill. - * \param output_len The length of the buffer. - * \param additional Additional data to update. Can be NULL. - * \param add_len The length of the additional data. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED or - * #MBEDTLS_ERR_CTR_DRBG_REQUEST_TOO_BIG on failure. - */ -int mbedtls_ctr_drbg_random_with_add( void *p_rng, - unsigned char *output, size_t output_len, - const unsigned char *additional, size_t add_len ); - -/** - * \brief This function uses CTR_DRBG to generate random data. - * - * \note The function automatically reseeds if the reseed counter is exceeded. - * - * \param p_rng The CTR_DRBG context. This must be a pointer to a - * #mbedtls_ctr_drbg_context structure. - * \param output The buffer to fill. - * \param output_len The length of the buffer. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED or - * #MBEDTLS_ERR_CTR_DRBG_REQUEST_TOO_BIG on failure. - */ -int mbedtls_ctr_drbg_random( void *p_rng, - unsigned char *output, size_t output_len ); - -#if defined(MBEDTLS_FS_IO) -/** - * \brief This function writes a seed file. - * - * \param ctx The CTR_DRBG context. - * \param path The name of the file. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CTR_DRBG_FILE_IO_ERROR on file error. - * \return #MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED on - * failure. - */ -int mbedtls_ctr_drbg_write_seed_file( mbedtls_ctr_drbg_context *ctx, const char *path ); - -/** - * \brief This function reads and updates a seed file. The seed - * is added to this instance. - * - * \param ctx The CTR_DRBG context. - * \param path The name of the file. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CTR_DRBG_FILE_IO_ERROR on file error. - * \return #MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED or - * #MBEDTLS_ERR_CTR_DRBG_INPUT_TOO_BIG on failure. - */ -int mbedtls_ctr_drbg_update_seed_file( mbedtls_ctr_drbg_context *ctx, const char *path ); -#endif /* MBEDTLS_FS_IO */ - -/** - * \brief The CTR_DRBG checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_ctr_drbg_self_test( int verbose ); - -/* Internal functions (do not call directly) */ -int mbedtls_ctr_drbg_seed_entropy_len( mbedtls_ctr_drbg_context *, - int (*)(void *, unsigned char *, size_t), void *, - const unsigned char *, size_t, size_t ); - -#ifdef __cplusplus -} -#endif - -#endif /* ctr_drbg.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/debug.h b/tools/sdk/include/mbedtls/mbedtls/debug.h deleted file mode 100644 index ef8db67ff11..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/debug.h +++ /dev/null @@ -1,229 +0,0 @@ -/** - * \file debug.h - * - * \brief Functions for controlling and providing debug output from the library. - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_DEBUG_H -#define MBEDTLS_DEBUG_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "ssl.h" - -#if defined(MBEDTLS_ECP_C) -#include "ecp.h" -#endif - -#if defined(MBEDTLS_DEBUG_C) - -#define MBEDTLS_DEBUG_STRIP_PARENS( ... ) __VA_ARGS__ - -#define MBEDTLS_SSL_DEBUG_MSG( level, args ) \ - mbedtls_debug_print_msg( ssl, level, __FILE__, __LINE__, \ - MBEDTLS_DEBUG_STRIP_PARENS args ) - -#define MBEDTLS_SSL_DEBUG_RET( level, text, ret ) \ - mbedtls_debug_print_ret( ssl, level, __FILE__, __LINE__, text, ret ) - -#define MBEDTLS_SSL_DEBUG_BUF( level, text, buf, len ) \ - mbedtls_debug_print_buf( ssl, level, __FILE__, __LINE__, text, buf, len ) - -#if defined(MBEDTLS_BIGNUM_C) -#define MBEDTLS_SSL_DEBUG_MPI( level, text, X ) \ - mbedtls_debug_print_mpi( ssl, level, __FILE__, __LINE__, text, X ) -#endif - -#if defined(MBEDTLS_ECP_C) -#define MBEDTLS_SSL_DEBUG_ECP( level, text, X ) \ - mbedtls_debug_print_ecp( ssl, level, __FILE__, __LINE__, text, X ) -#endif - -#if defined(MBEDTLS_X509_CRT_PARSE_C) -#define MBEDTLS_SSL_DEBUG_CRT( level, text, crt ) \ - mbedtls_debug_print_crt( ssl, level, __FILE__, __LINE__, text, crt ) -#endif - -#else /* MBEDTLS_DEBUG_C */ - -#define MBEDTLS_SSL_DEBUG_MSG( level, args ) do { } while( 0 ) -#define MBEDTLS_SSL_DEBUG_RET( level, text, ret ) do { } while( 0 ) -#define MBEDTLS_SSL_DEBUG_BUF( level, text, buf, len ) do { } while( 0 ) -#define MBEDTLS_SSL_DEBUG_MPI( level, text, X ) do { } while( 0 ) -#define MBEDTLS_SSL_DEBUG_ECP( level, text, X ) do { } while( 0 ) -#define MBEDTLS_SSL_DEBUG_CRT( level, text, crt ) do { } while( 0 ) - -#endif /* MBEDTLS_DEBUG_C */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Set the threshold error level to handle globally all debug output. - * Debug messages that have a level over the threshold value are - * discarded. - * (Default value: 0 = No debug ) - * - * \param threshold theshold level of messages to filter on. Messages at a - * higher level will be discarded. - * - Debug levels - * - 0 No debug - * - 1 Error - * - 2 State change - * - 3 Informational - * - 4 Verbose - */ -void mbedtls_debug_set_threshold( int threshold ); - -/** - * \brief Print a message to the debug output. This function is always used - * through the MBEDTLS_SSL_DEBUG_MSG() macro, which supplies the ssl - * context, file and line number parameters. - * - * \param ssl SSL context - * \param level error level of the debug message - * \param file file the message has occurred in - * \param line line number the message has occurred at - * \param format format specifier, in printf format - * \param ... variables used by the format specifier - * - * \attention This function is intended for INTERNAL usage within the - * library only. - */ -void mbedtls_debug_print_msg( const mbedtls_ssl_context *ssl, int level, - const char *file, int line, - const char *format, ... ); - -/** - * \brief Print the return value of a function to the debug output. This - * function is always used through the MBEDTLS_SSL_DEBUG_RET() macro, - * which supplies the ssl context, file and line number parameters. - * - * \param ssl SSL context - * \param level error level of the debug message - * \param file file the error has occurred in - * \param line line number the error has occurred in - * \param text the name of the function that returned the error - * \param ret the return code value - * - * \attention This function is intended for INTERNAL usage within the - * library only. - */ -void mbedtls_debug_print_ret( const mbedtls_ssl_context *ssl, int level, - const char *file, int line, - const char *text, int ret ); - -/** - * \brief Output a buffer of size len bytes to the debug output. This function - * is always used through the MBEDTLS_SSL_DEBUG_BUF() macro, - * which supplies the ssl context, file and line number parameters. - * - * \param ssl SSL context - * \param level error level of the debug message - * \param file file the error has occurred in - * \param line line number the error has occurred in - * \param text a name or label for the buffer being dumped. Normally the - * variable or buffer name - * \param buf the buffer to be outputted - * \param len length of the buffer - * - * \attention This function is intended for INTERNAL usage within the - * library only. - */ -void mbedtls_debug_print_buf( const mbedtls_ssl_context *ssl, int level, - const char *file, int line, const char *text, - const unsigned char *buf, size_t len ); - -#if defined(MBEDTLS_BIGNUM_C) -/** - * \brief Print a MPI variable to the debug output. This function is always - * used through the MBEDTLS_SSL_DEBUG_MPI() macro, which supplies the - * ssl context, file and line number parameters. - * - * \param ssl SSL context - * \param level error level of the debug message - * \param file file the error has occurred in - * \param line line number the error has occurred in - * \param text a name or label for the MPI being output. Normally the - * variable name - * \param X the MPI variable - * - * \attention This function is intended for INTERNAL usage within the - * library only. - */ -void mbedtls_debug_print_mpi( const mbedtls_ssl_context *ssl, int level, - const char *file, int line, - const char *text, const mbedtls_mpi *X ); -#endif - -#if defined(MBEDTLS_ECP_C) -/** - * \brief Print an ECP point to the debug output. This function is always - * used through the MBEDTLS_SSL_DEBUG_ECP() macro, which supplies the - * ssl context, file and line number parameters. - * - * \param ssl SSL context - * \param level error level of the debug message - * \param file file the error has occurred in - * \param line line number the error has occurred in - * \param text a name or label for the ECP point being output. Normally the - * variable name - * \param X the ECP point - * - * \attention This function is intended for INTERNAL usage within the - * library only. - */ -void mbedtls_debug_print_ecp( const mbedtls_ssl_context *ssl, int level, - const char *file, int line, - const char *text, const mbedtls_ecp_point *X ); -#endif - -#if defined(MBEDTLS_X509_CRT_PARSE_C) -/** - * \brief Print a X.509 certificate structure to the debug output. This - * function is always used through the MBEDTLS_SSL_DEBUG_CRT() macro, - * which supplies the ssl context, file and line number parameters. - * - * \param ssl SSL context - * \param level error level of the debug message - * \param file file the error has occurred in - * \param line line number the error has occurred in - * \param text a name or label for the certificate being output - * \param crt X.509 certificate structure - * - * \attention This function is intended for INTERNAL usage within the - * library only. - */ -void mbedtls_debug_print_crt( const mbedtls_ssl_context *ssl, int level, - const char *file, int line, - const char *text, const mbedtls_x509_crt *crt ); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* debug.h */ - diff --git a/tools/sdk/include/mbedtls/mbedtls/des.h b/tools/sdk/include/mbedtls/mbedtls/des.h deleted file mode 100644 index 91d16b6fb48..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/des.h +++ /dev/null @@ -1,350 +0,0 @@ -/** - * \file des.h - * - * \brief DES block cipher - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - * - */ -#ifndef MBEDTLS_DES_H -#define MBEDTLS_DES_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -#define MBEDTLS_DES_ENCRYPT 1 -#define MBEDTLS_DES_DECRYPT 0 - -#define MBEDTLS_ERR_DES_INVALID_INPUT_LENGTH -0x0032 /**< The data input has an invalid length. */ -#define MBEDTLS_ERR_DES_HW_ACCEL_FAILED -0x0033 /**< DES hardware accelerator failed. */ - -#define MBEDTLS_DES_KEY_SIZE 8 - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_DES_ALT) -// Regular implementation -// - -/** - * \brief DES context structure - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - */ -typedef struct mbedtls_des_context -{ - uint32_t sk[32]; /*!< DES subkeys */ -} -mbedtls_des_context; - -/** - * \brief Triple-DES context structure - */ -typedef struct mbedtls_des3_context -{ - uint32_t sk[96]; /*!< 3DES subkeys */ -} -mbedtls_des3_context; - -#else /* MBEDTLS_DES_ALT */ -#include "des_alt.h" -#endif /* MBEDTLS_DES_ALT */ - -/** - * \brief Initialize DES context - * - * \param ctx DES context to be initialized - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - */ -void mbedtls_des_init( mbedtls_des_context *ctx ); - -/** - * \brief Clear DES context - * - * \param ctx DES context to be cleared - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - */ -void mbedtls_des_free( mbedtls_des_context *ctx ); - -/** - * \brief Initialize Triple-DES context - * - * \param ctx DES3 context to be initialized - */ -void mbedtls_des3_init( mbedtls_des3_context *ctx ); - -/** - * \brief Clear Triple-DES context - * - * \param ctx DES3 context to be cleared - */ -void mbedtls_des3_free( mbedtls_des3_context *ctx ); - -/** - * \brief Set key parity on the given key to odd. - * - * DES keys are 56 bits long, but each byte is padded with - * a parity bit to allow verification. - * - * \param key 8-byte secret key - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - */ -void mbedtls_des_key_set_parity( unsigned char key[MBEDTLS_DES_KEY_SIZE] ); - -/** - * \brief Check that key parity on the given key is odd. - * - * DES keys are 56 bits long, but each byte is padded with - * a parity bit to allow verification. - * - * \param key 8-byte secret key - * - * \return 0 is parity was ok, 1 if parity was not correct. - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - */ -int mbedtls_des_key_check_key_parity( const unsigned char key[MBEDTLS_DES_KEY_SIZE] ); - -/** - * \brief Check that key is not a weak or semi-weak DES key - * - * \param key 8-byte secret key - * - * \return 0 if no weak key was found, 1 if a weak key was identified. - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - */ -int mbedtls_des_key_check_weak( const unsigned char key[MBEDTLS_DES_KEY_SIZE] ); - -/** - * \brief DES key schedule (56-bit, encryption) - * - * \param ctx DES context to be initialized - * \param key 8-byte secret key - * - * \return 0 - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - */ -int mbedtls_des_setkey_enc( mbedtls_des_context *ctx, const unsigned char key[MBEDTLS_DES_KEY_SIZE] ); - -/** - * \brief DES key schedule (56-bit, decryption) - * - * \param ctx DES context to be initialized - * \param key 8-byte secret key - * - * \return 0 - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - */ -int mbedtls_des_setkey_dec( mbedtls_des_context *ctx, const unsigned char key[MBEDTLS_DES_KEY_SIZE] ); - -/** - * \brief Triple-DES key schedule (112-bit, encryption) - * - * \param ctx 3DES context to be initialized - * \param key 16-byte secret key - * - * \return 0 - */ -int mbedtls_des3_set2key_enc( mbedtls_des3_context *ctx, - const unsigned char key[MBEDTLS_DES_KEY_SIZE * 2] ); - -/** - * \brief Triple-DES key schedule (112-bit, decryption) - * - * \param ctx 3DES context to be initialized - * \param key 16-byte secret key - * - * \return 0 - */ -int mbedtls_des3_set2key_dec( mbedtls_des3_context *ctx, - const unsigned char key[MBEDTLS_DES_KEY_SIZE * 2] ); - -/** - * \brief Triple-DES key schedule (168-bit, encryption) - * - * \param ctx 3DES context to be initialized - * \param key 24-byte secret key - * - * \return 0 - */ -int mbedtls_des3_set3key_enc( mbedtls_des3_context *ctx, - const unsigned char key[MBEDTLS_DES_KEY_SIZE * 3] ); - -/** - * \brief Triple-DES key schedule (168-bit, decryption) - * - * \param ctx 3DES context to be initialized - * \param key 24-byte secret key - * - * \return 0 - */ -int mbedtls_des3_set3key_dec( mbedtls_des3_context *ctx, - const unsigned char key[MBEDTLS_DES_KEY_SIZE * 3] ); - -/** - * \brief DES-ECB block encryption/decryption - * - * \param ctx DES context - * \param input 64-bit input block - * \param output 64-bit output block - * - * \return 0 if successful - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - */ -int mbedtls_des_crypt_ecb( mbedtls_des_context *ctx, - const unsigned char input[8], - unsigned char output[8] ); - -#if defined(MBEDTLS_CIPHER_MODE_CBC) -/** - * \brief DES-CBC buffer encryption/decryption - * - * \note Upon exit, the content of the IV is updated so that you can - * call the function same function again on the following - * block(s) of data and get the same result as if it was - * encrypted in one call. This allows a "streaming" usage. - * If on the other hand you need to retain the contents of the - * IV, you should either save it manually or use the cipher - * module instead. - * - * \param ctx DES context - * \param mode MBEDTLS_DES_ENCRYPT or MBEDTLS_DES_DECRYPT - * \param length length of the input data - * \param iv initialization vector (updated after use) - * \param input buffer holding the input data - * \param output buffer holding the output data - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - */ -int mbedtls_des_crypt_cbc( mbedtls_des_context *ctx, - int mode, - size_t length, - unsigned char iv[8], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_CBC */ - -/** - * \brief 3DES-ECB block encryption/decryption - * - * \param ctx 3DES context - * \param input 64-bit input block - * \param output 64-bit output block - * - * \return 0 if successful - */ -int mbedtls_des3_crypt_ecb( mbedtls_des3_context *ctx, - const unsigned char input[8], - unsigned char output[8] ); - -#if defined(MBEDTLS_CIPHER_MODE_CBC) -/** - * \brief 3DES-CBC buffer encryption/decryption - * - * \note Upon exit, the content of the IV is updated so that you can - * call the function same function again on the following - * block(s) of data and get the same result as if it was - * encrypted in one call. This allows a "streaming" usage. - * If on the other hand you need to retain the contents of the - * IV, you should either save it manually or use the cipher - * module instead. - * - * \param ctx 3DES context - * \param mode MBEDTLS_DES_ENCRYPT or MBEDTLS_DES_DECRYPT - * \param length length of the input data - * \param iv initialization vector (updated after use) - * \param input buffer holding the input data - * \param output buffer holding the output data - * - * \return 0 if successful, or MBEDTLS_ERR_DES_INVALID_INPUT_LENGTH - */ -int mbedtls_des3_crypt_cbc( mbedtls_des3_context *ctx, - int mode, - size_t length, - unsigned char iv[8], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_CBC */ - -/** - * \brief Internal function for key expansion. - * (Only exposed to allow overriding it, - * see MBEDTLS_DES_SETKEY_ALT) - * - * \param SK Round keys - * \param key Base key - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - */ -void mbedtls_des_setkey( uint32_t SK[32], - const unsigned char key[MBEDTLS_DES_KEY_SIZE] ); - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - */ -int mbedtls_des_self_test( int verbose ); - -#ifdef __cplusplus -} -#endif - -#endif /* des.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/dhm.h b/tools/sdk/include/mbedtls/mbedtls/dhm.h deleted file mode 100644 index 3e1178940a4..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/dhm.h +++ /dev/null @@ -1,1063 +0,0 @@ -/** - * \file dhm.h - * - * \brief This file contains Diffie-Hellman-Merkle (DHM) key exchange - * definitions and functions. - * - * Diffie-Hellman-Merkle (DHM) key exchange is defined in - * RFC-2631: Diffie-Hellman Key Agreement Method and - * Public-Key Cryptography Standards (PKCS) #3: Diffie - * Hellman Key Agreement Standard. - * - * RFC-3526: More Modular Exponential (MODP) Diffie-Hellman groups for - * Internet Key Exchange (IKE) defines a number of standardized - * Diffie-Hellman groups for IKE. - * - * RFC-5114: Additional Diffie-Hellman Groups for Use with IETF - * Standards defines a number of standardized Diffie-Hellman - * groups that can be used. - * - * \warning The security of the DHM key exchange relies on the proper choice - * of prime modulus - optimally, it should be a safe prime. The usage - * of non-safe primes both decreases the difficulty of the underlying - * discrete logarithm problem and can lead to small subgroup attacks - * leaking private exponent bits when invalid public keys are used - * and not detected. This is especially relevant if the same DHM - * parameters are reused for multiple key exchanges as in static DHM, - * while the criticality of small-subgroup attacks is lower for - * ephemeral DHM. - * - * \warning For performance reasons, the code does neither perform primality - * nor safe primality tests, nor the expensive checks for invalid - * subgroups. Moreover, even if these were performed, non-standardized - * primes cannot be trusted because of the possibility of backdoors - * that can't be effectively checked for. - * - * \warning Diffie-Hellman-Merkle is therefore a security risk when not using - * standardized primes generated using a trustworthy ("nothing up - * my sleeve") method, such as the RFC 3526 / 7919 primes. In the TLS - * protocol, DH parameters need to be negotiated, so using the default - * primes systematically is not always an option. If possible, use - * Elliptic Curve Diffie-Hellman (ECDH), which has better performance, - * and for which the TLS protocol mandates the use of standard - * parameters. - * - */ -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_DHM_H -#define MBEDTLS_DHM_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif -#include "bignum.h" - -/* - * DHM Error codes - */ -#define MBEDTLS_ERR_DHM_BAD_INPUT_DATA -0x3080 /**< Bad input parameters. */ -#define MBEDTLS_ERR_DHM_READ_PARAMS_FAILED -0x3100 /**< Reading of the DHM parameters failed. */ -#define MBEDTLS_ERR_DHM_MAKE_PARAMS_FAILED -0x3180 /**< Making of the DHM parameters failed. */ -#define MBEDTLS_ERR_DHM_READ_PUBLIC_FAILED -0x3200 /**< Reading of the public values failed. */ -#define MBEDTLS_ERR_DHM_MAKE_PUBLIC_FAILED -0x3280 /**< Making of the public value failed. */ -#define MBEDTLS_ERR_DHM_CALC_SECRET_FAILED -0x3300 /**< Calculation of the DHM secret failed. */ -#define MBEDTLS_ERR_DHM_INVALID_FORMAT -0x3380 /**< The ASN.1 data is not formatted correctly. */ -#define MBEDTLS_ERR_DHM_ALLOC_FAILED -0x3400 /**< Allocation of memory failed. */ -#define MBEDTLS_ERR_DHM_FILE_IO_ERROR -0x3480 /**< Read or write of file failed. */ -#define MBEDTLS_ERR_DHM_HW_ACCEL_FAILED -0x3500 /**< DHM hardware accelerator failed. */ -#define MBEDTLS_ERR_DHM_SET_GROUP_FAILED -0x3580 /**< Setting the modulus and generator failed. */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_DHM_ALT) - -/** - * \brief The DHM context structure. - */ -typedef struct mbedtls_dhm_context -{ - size_t len; /*!< The size of \p P in Bytes. */ - mbedtls_mpi P; /*!< The prime modulus. */ - mbedtls_mpi G; /*!< The generator. */ - mbedtls_mpi X; /*!< Our secret value. */ - mbedtls_mpi GX; /*!< Our public key = \c G^X mod \c P. */ - mbedtls_mpi GY; /*!< The public key of the peer = \c G^Y mod \c P. */ - mbedtls_mpi K; /*!< The shared secret = \c G^(XY) mod \c P. */ - mbedtls_mpi RP; /*!< The cached value = \c R^2 mod \c P. */ - mbedtls_mpi Vi; /*!< The blinding value. */ - mbedtls_mpi Vf; /*!< The unblinding value. */ - mbedtls_mpi pX; /*!< The previous \c X. */ -} -mbedtls_dhm_context; - -#else /* MBEDTLS_DHM_ALT */ -#include "dhm_alt.h" -#endif /* MBEDTLS_DHM_ALT */ - -/** - * \brief This function initializes the DHM context. - * - * \param ctx The DHM context to initialize. - */ -void mbedtls_dhm_init( mbedtls_dhm_context *ctx ); - -/** - * \brief This function parses the ServerKeyExchange parameters. - * - * \param ctx The DHM context. - * \param p On input, *p must be the start of the input buffer. - * On output, *p is updated to point to the end of the data - * that has been read. On success, this is the first byte - * past the end of the ServerKeyExchange parameters. - * On error, this is the point at which an error has been - * detected, which is usually not useful except to debug - * failures. - * \param end The end of the input buffer. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_DHM_XXX error code on failure. - */ -int mbedtls_dhm_read_params( mbedtls_dhm_context *ctx, - unsigned char **p, - const unsigned char *end ); - -/** - * \brief This function sets up and writes the ServerKeyExchange - * parameters. - * - * \note The destination buffer must be large enough to hold - * the reduced binary presentation of the modulus, the generator - * and the public key, each wrapped with a 2-byte length field. - * It is the responsibility of the caller to ensure that enough - * space is available. Refer to \c mbedtls_mpi_size to computing - * the byte-size of an MPI. - * - * \note This function assumes that \c ctx->P and \c ctx->G - * have already been properly set. For that, use - * mbedtls_dhm_set_group() below in conjunction with - * mbedtls_mpi_read_binary() and mbedtls_mpi_read_string(). - * - * \param ctx The DHM context. - * \param x_size The private key size in Bytes. - * \param olen The number of characters written. - * \param output The destination buffer. - * \param f_rng The RNG function. - * \param p_rng The RNG context. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_DHM_XXX error code on failure. - */ -int mbedtls_dhm_make_params( mbedtls_dhm_context *ctx, int x_size, - unsigned char *output, size_t *olen, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief This function sets the prime modulus and generator. - * - * \note This function can be used to set \p P, \p G - * in preparation for mbedtls_dhm_make_params(). - * - * \param ctx The DHM context. - * \param P The MPI holding the DHM prime modulus. - * \param G The MPI holding the DHM generator. - * - * \return \c 0 if successful. - * \return An \c MBEDTLS_ERR_DHM_XXX error code on failure. - */ -int mbedtls_dhm_set_group( mbedtls_dhm_context *ctx, - const mbedtls_mpi *P, - const mbedtls_mpi *G ); - -/** - * \brief This function imports the public value of the peer, G^Y. - * - * \param ctx The DHM context. - * \param input The input buffer containing the G^Y value of the peer. - * \param ilen The size of the input buffer. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_DHM_XXX error code on failure. - */ -int mbedtls_dhm_read_public( mbedtls_dhm_context *ctx, - const unsigned char *input, size_t ilen ); - -/** - * \brief This function creates its own private key, \c X, and - * exports \c G^X. - * - * \note The destination buffer is always fully written - * so as to contain a big-endian representation of G^X mod P. - * If it is larger than ctx->len, it is padded accordingly - * with zero-bytes at the beginning. - * - * \param ctx The DHM context. - * \param x_size The private key size in Bytes. - * \param output The destination buffer. - * \param olen The length of the destination buffer. Must be at least - * equal to ctx->len (the size of \c P). - * \param f_rng The RNG function. - * \param p_rng The RNG context. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_DHM_XXX error code on failure. - */ -int mbedtls_dhm_make_public( mbedtls_dhm_context *ctx, int x_size, - unsigned char *output, size_t olen, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief This function derives and exports the shared secret - * \c (G^Y)^X mod \c P. - * - * \note If \p f_rng is not NULL, it is used to blind the input as - * a countermeasure against timing attacks. Blinding is used - * only if our private key \c X is re-used, and not used - * otherwise. We recommend always passing a non-NULL - * \p f_rng argument. - * - * \param ctx The DHM context. - * \param output The destination buffer. - * \param output_size The size of the destination buffer. Must be at least - * the size of ctx->len (the size of \c P). - * \param olen On exit, holds the actual number of Bytes written. - * \param f_rng The RNG function, for blinding purposes. - * \param p_rng The RNG context. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_DHM_XXX error code on failure. - */ -int mbedtls_dhm_calc_secret( mbedtls_dhm_context *ctx, - unsigned char *output, size_t output_size, size_t *olen, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief This function frees and clears the components of a DHM context. - * - * \param ctx The DHM context to free and clear. - */ -void mbedtls_dhm_free( mbedtls_dhm_context *ctx ); - -#if defined(MBEDTLS_ASN1_PARSE_C) -/** \ingroup x509_module */ -/** - * \brief This function parses DHM parameters in PEM or DER format. - * - * \param dhm The DHM context to initialize. - * \param dhmin The input buffer. - * \param dhminlen The size of the buffer, including the terminating null - * Byte for PEM data. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_DHM_XXX or \c MBEDTLS_ERR_PEM_XXX error code - * error code on failure. - */ -int mbedtls_dhm_parse_dhm( mbedtls_dhm_context *dhm, const unsigned char *dhmin, - size_t dhminlen ); - -#if defined(MBEDTLS_FS_IO) -/** \ingroup x509_module */ -/** - * \brief This function loads and parses DHM parameters from a file. - * - * \param dhm The DHM context to load the parameters to. - * \param path The filename to read the DHM parameters from. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_DHM_XXX or \c MBEDTLS_ERR_PEM_XXX error code - * error code on failure. - */ -int mbedtls_dhm_parse_dhmfile( mbedtls_dhm_context *dhm, const char *path ); -#endif /* MBEDTLS_FS_IO */ -#endif /* MBEDTLS_ASN1_PARSE_C */ - -/** - * \brief The DMH checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_dhm_self_test( int verbose ); - -#ifdef __cplusplus -} -#endif - -/** - * RFC 3526, RFC 5114 and RFC 7919 standardize a number of - * Diffie-Hellman groups, some of which are included here - * for use within the SSL/TLS module and the user's convenience - * when configuring the Diffie-Hellman parameters by hand - * through \c mbedtls_ssl_conf_dh_param. - * - * The following lists the source of the above groups in the standards: - * - RFC 5114 section 2.2: 2048-bit MODP Group with 224-bit Prime Order Subgroup - * - RFC 3526 section 3: 2048-bit MODP Group - * - RFC 3526 section 4: 3072-bit MODP Group - * - RFC 3526 section 5: 4096-bit MODP Group - * - RFC 7919 section A.1: ffdhe2048 - * - RFC 7919 section A.2: ffdhe3072 - * - RFC 7919 section A.3: ffdhe4096 - * - RFC 7919 section A.4: ffdhe6144 - * - RFC 7919 section A.5: ffdhe8192 - * - * The constants with suffix "_p" denote the chosen prime moduli, while - * the constants with suffix "_g" denote the chosen generator - * of the associated prime field. - * - * The constants further suffixed with "_bin" are provided in binary format, - * while all other constants represent null-terminated strings holding the - * hexadecimal presentation of the respective numbers. - * - * The primes from RFC 3526 and RFC 7919 have been generating by the following - * trust-worthy procedure: - * - Fix N in { 2048, 3072, 4096, 6144, 8192 } and consider the N-bit number - * the first and last 64 bits are all 1, and the remaining N - 128 bits of - * which are 0x7ff...ff. - * - Add the smallest multiple of the first N - 129 bits of the binary expansion - * of pi (for RFC 5236) or e (for RFC 7919) to this intermediate bit-string - * such that the resulting integer is a safe-prime. - * - The result is the respective RFC 3526 / 7919 prime, and the corresponding - * generator is always chosen to be 2 (which is a square for these prime, - * hence the corresponding subgroup has order (p-1)/2 and avoids leaking a - * bit in the private exponent). - * - */ - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) - -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -MBEDTLS_DEPRECATED typedef char const * mbedtls_deprecated_constant_t; -#define MBEDTLS_DEPRECATED_STRING_CONSTANT( VAL ) \ - ( (mbedtls_deprecated_constant_t) ( VAL ) ) -#else -#define MBEDTLS_DEPRECATED_STRING_CONSTANT( VAL ) VAL -#endif /* ! MBEDTLS_DEPRECATED_WARNING */ - -/** - * \warning The origin of the primes in RFC 5114 is not documented and - * their use therefore constitutes a security risk! - * - * \deprecated The hex-encoded primes from RFC 5114 are deprecated and are - * likely to be removed in a future version of the library without - * replacement. - */ - -/** - * The hexadecimal presentation of the prime underlying the - * 2048-bit MODP Group with 224-bit Prime Order Subgroup, as defined - * in RFC-5114: Additional Diffie-Hellman Groups for Use with - * IETF Standards. - */ -#define MBEDTLS_DHM_RFC5114_MODP_2048_P \ - MBEDTLS_DEPRECATED_STRING_CONSTANT( \ - "AD107E1E9123A9D0D660FAA79559C51FA20D64E5683B9FD1" \ - "B54B1597B61D0A75E6FA141DF95A56DBAF9A3C407BA1DF15" \ - "EB3D688A309C180E1DE6B85A1274A0A66D3F8152AD6AC212" \ - "9037C9EDEFDA4DF8D91E8FEF55B7394B7AD5B7D0B6C12207" \ - "C9F98D11ED34DBF6C6BA0B2C8BBC27BE6A00E0A0B9C49708" \ - "B3BF8A317091883681286130BC8985DB1602E714415D9330" \ - "278273C7DE31EFDC7310F7121FD5A07415987D9ADC0A486D" \ - "CDF93ACC44328387315D75E198C641A480CD86A1B9E587E8" \ - "BE60E69CC928B2B9C52172E413042E9B23F10B0E16E79763" \ - "C9B53DCF4BA80A29E3FB73C16B8E75B97EF363E2FFA31F71" \ - "CF9DE5384E71B81C0AC4DFFE0C10E64F" ) - -/** - * The hexadecimal presentation of the chosen generator of the 2048-bit MODP - * Group with 224-bit Prime Order Subgroup, as defined in RFC-5114: - * Additional Diffie-Hellman Groups for Use with IETF Standards. - */ -#define MBEDTLS_DHM_RFC5114_MODP_2048_G \ - MBEDTLS_DEPRECATED_STRING_CONSTANT( \ - "AC4032EF4F2D9AE39DF30B5C8FFDAC506CDEBE7B89998CAF" \ - "74866A08CFE4FFE3A6824A4E10B9A6F0DD921F01A70C4AFA" \ - "AB739D7700C29F52C57DB17C620A8652BE5E9001A8D66AD7" \ - "C17669101999024AF4D027275AC1348BB8A762D0521BC98A" \ - "E247150422EA1ED409939D54DA7460CDB5F6C6B250717CBE" \ - "F180EB34118E98D119529A45D6F834566E3025E316A330EF" \ - "BB77A86F0C1AB15B051AE3D428C8F8ACB70A8137150B8EEB" \ - "10E183EDD19963DDD9E263E4770589EF6AA21E7F5F2FF381" \ - "B539CCE3409D13CD566AFBB48D6C019181E1BCFE94B30269" \ - "EDFE72FE9B6AA4BD7B5A0F1C71CFFF4C19C418E1F6EC0179" \ - "81BC087F2A7065B384B890D3191F2BFA" ) - -/** - * The hexadecimal presentation of the prime underlying the 2048-bit MODP - * Group, as defined in RFC-3526: More Modular Exponential (MODP) - * Diffie-Hellman groups for Internet Key Exchange (IKE). - * - * \deprecated The hex-encoded primes from RFC 3625 are deprecated and - * superseded by the corresponding macros providing them as - * binary constants. Their hex-encoded constants are likely - * to be removed in a future version of the library. - * - */ -#define MBEDTLS_DHM_RFC3526_MODP_2048_P \ - MBEDTLS_DEPRECATED_STRING_CONSTANT( \ - "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" \ - "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" \ - "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" \ - "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" \ - "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" \ - "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" \ - "83655D23DCA3AD961C62F356208552BB9ED529077096966D" \ - "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" \ - "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" \ - "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" \ - "15728E5A8AACAA68FFFFFFFFFFFFFFFF" ) - -/** - * The hexadecimal presentation of the chosen generator of the 2048-bit MODP - * Group, as defined in RFC-3526: More Modular Exponential (MODP) - * Diffie-Hellman groups for Internet Key Exchange (IKE). - */ -#define MBEDTLS_DHM_RFC3526_MODP_2048_G \ - MBEDTLS_DEPRECATED_STRING_CONSTANT( "02" ) - -/** - * The hexadecimal presentation of the prime underlying the 3072-bit MODP - * Group, as defined in RFC-3072: More Modular Exponential (MODP) - * Diffie-Hellman groups for Internet Key Exchange (IKE). - */ -#define MBEDTLS_DHM_RFC3526_MODP_3072_P \ - MBEDTLS_DEPRECATED_STRING_CONSTANT( \ - "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" \ - "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" \ - "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" \ - "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" \ - "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" \ - "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" \ - "83655D23DCA3AD961C62F356208552BB9ED529077096966D" \ - "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" \ - "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" \ - "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" \ - "15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64" \ - "ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7" \ - "ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B" \ - "F12FFA06D98A0864D87602733EC86A64521F2B18177B200C" \ - "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31" \ - "43DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF" ) - -/** - * The hexadecimal presentation of the chosen generator of the 3072-bit MODP - * Group, as defined in RFC-3526: More Modular Exponential (MODP) - * Diffie-Hellman groups for Internet Key Exchange (IKE). - */ -#define MBEDTLS_DHM_RFC3526_MODP_3072_G \ - MBEDTLS_DEPRECATED_STRING_CONSTANT( "02" ) - -/** - * The hexadecimal presentation of the prime underlying the 4096-bit MODP - * Group, as defined in RFC-3526: More Modular Exponential (MODP) - * Diffie-Hellman groups for Internet Key Exchange (IKE). - */ -#define MBEDTLS_DHM_RFC3526_MODP_4096_P \ - MBEDTLS_DEPRECATED_STRING_CONSTANT( \ - "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" \ - "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" \ - "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" \ - "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" \ - "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" \ - "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" \ - "83655D23DCA3AD961C62F356208552BB9ED529077096966D" \ - "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" \ - "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" \ - "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" \ - "15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64" \ - "ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7" \ - "ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B" \ - "F12FFA06D98A0864D87602733EC86A64521F2B18177B200C" \ - "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31" \ - "43DB5BFCE0FD108E4B82D120A92108011A723C12A787E6D7" \ - "88719A10BDBA5B2699C327186AF4E23C1A946834B6150BDA" \ - "2583E9CA2AD44CE8DBBBC2DB04DE8EF92E8EFC141FBECAA6" \ - "287C59474E6BC05D99B2964FA090C3A2233BA186515BE7ED" \ - "1F612970CEE2D7AFB81BDD762170481CD0069127D5B05AA9" \ - "93B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934063199" \ - "FFFFFFFFFFFFFFFF" ) - -/** - * The hexadecimal presentation of the chosen generator of the 4096-bit MODP - * Group, as defined in RFC-3526: More Modular Exponential (MODP) - * Diffie-Hellman groups for Internet Key Exchange (IKE). - */ -#define MBEDTLS_DHM_RFC3526_MODP_4096_G \ - MBEDTLS_DEPRECATED_STRING_CONSTANT( "02" ) - -#endif /* MBEDTLS_DEPRECATED_REMOVED */ - -/* - * Trustworthy DHM parameters in binary form - */ - -#define MBEDTLS_DHM_RFC3526_MODP_2048_P_BIN { \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ - 0xC9, 0x0F, 0xDA, 0xA2, 0x21, 0x68, 0xC2, 0x34, \ - 0xC4, 0xC6, 0x62, 0x8B, 0x80, 0xDC, 0x1C, 0xD1, \ - 0x29, 0x02, 0x4E, 0x08, 0x8A, 0x67, 0xCC, 0x74, \ - 0x02, 0x0B, 0xBE, 0xA6, 0x3B, 0x13, 0x9B, 0x22, \ - 0x51, 0x4A, 0x08, 0x79, 0x8E, 0x34, 0x04, 0xDD, \ - 0xEF, 0x95, 0x19, 0xB3, 0xCD, 0x3A, 0x43, 0x1B, \ - 0x30, 0x2B, 0x0A, 0x6D, 0xF2, 0x5F, 0x14, 0x37, \ - 0x4F, 0xE1, 0x35, 0x6D, 0x6D, 0x51, 0xC2, 0x45, \ - 0xE4, 0x85, 0xB5, 0x76, 0x62, 0x5E, 0x7E, 0xC6, \ - 0xF4, 0x4C, 0x42, 0xE9, 0xA6, 0x37, 0xED, 0x6B, \ - 0x0B, 0xFF, 0x5C, 0xB6, 0xF4, 0x06, 0xB7, 0xED, \ - 0xEE, 0x38, 0x6B, 0xFB, 0x5A, 0x89, 0x9F, 0xA5, \ - 0xAE, 0x9F, 0x24, 0x11, 0x7C, 0x4B, 0x1F, 0xE6, \ - 0x49, 0x28, 0x66, 0x51, 0xEC, 0xE4, 0x5B, 0x3D, \ - 0xC2, 0x00, 0x7C, 0xB8, 0xA1, 0x63, 0xBF, 0x05, \ - 0x98, 0xDA, 0x48, 0x36, 0x1C, 0x55, 0xD3, 0x9A, \ - 0x69, 0x16, 0x3F, 0xA8, 0xFD, 0x24, 0xCF, 0x5F, \ - 0x83, 0x65, 0x5D, 0x23, 0xDC, 0xA3, 0xAD, 0x96, \ - 0x1C, 0x62, 0xF3, 0x56, 0x20, 0x85, 0x52, 0xBB, \ - 0x9E, 0xD5, 0x29, 0x07, 0x70, 0x96, 0x96, 0x6D, \ - 0x67, 0x0C, 0x35, 0x4E, 0x4A, 0xBC, 0x98, 0x04, \ - 0xF1, 0x74, 0x6C, 0x08, 0xCA, 0x18, 0x21, 0x7C, \ - 0x32, 0x90, 0x5E, 0x46, 0x2E, 0x36, 0xCE, 0x3B, \ - 0xE3, 0x9E, 0x77, 0x2C, 0x18, 0x0E, 0x86, 0x03, \ - 0x9B, 0x27, 0x83, 0xA2, 0xEC, 0x07, 0xA2, 0x8F, \ - 0xB5, 0xC5, 0x5D, 0xF0, 0x6F, 0x4C, 0x52, 0xC9, \ - 0xDE, 0x2B, 0xCB, 0xF6, 0x95, 0x58, 0x17, 0x18, \ - 0x39, 0x95, 0x49, 0x7C, 0xEA, 0x95, 0x6A, 0xE5, \ - 0x15, 0xD2, 0x26, 0x18, 0x98, 0xFA, 0x05, 0x10, \ - 0x15, 0x72, 0x8E, 0x5A, 0x8A, 0xAC, 0xAA, 0x68, \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF } - -#define MBEDTLS_DHM_RFC3526_MODP_2048_G_BIN { 0x02 } - -#define MBEDTLS_DHM_RFC3526_MODP_3072_P_BIN { \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ - 0xC9, 0x0F, 0xDA, 0xA2, 0x21, 0x68, 0xC2, 0x34, \ - 0xC4, 0xC6, 0x62, 0x8B, 0x80, 0xDC, 0x1C, 0xD1, \ - 0x29, 0x02, 0x4E, 0x08, 0x8A, 0x67, 0xCC, 0x74, \ - 0x02, 0x0B, 0xBE, 0xA6, 0x3B, 0x13, 0x9B, 0x22, \ - 0x51, 0x4A, 0x08, 0x79, 0x8E, 0x34, 0x04, 0xDD, \ - 0xEF, 0x95, 0x19, 0xB3, 0xCD, 0x3A, 0x43, 0x1B, \ - 0x30, 0x2B, 0x0A, 0x6D, 0xF2, 0x5F, 0x14, 0x37, \ - 0x4F, 0xE1, 0x35, 0x6D, 0x6D, 0x51, 0xC2, 0x45, \ - 0xE4, 0x85, 0xB5, 0x76, 0x62, 0x5E, 0x7E, 0xC6, \ - 0xF4, 0x4C, 0x42, 0xE9, 0xA6, 0x37, 0xED, 0x6B, \ - 0x0B, 0xFF, 0x5C, 0xB6, 0xF4, 0x06, 0xB7, 0xED, \ - 0xEE, 0x38, 0x6B, 0xFB, 0x5A, 0x89, 0x9F, 0xA5, \ - 0xAE, 0x9F, 0x24, 0x11, 0x7C, 0x4B, 0x1F, 0xE6, \ - 0x49, 0x28, 0x66, 0x51, 0xEC, 0xE4, 0x5B, 0x3D, \ - 0xC2, 0x00, 0x7C, 0xB8, 0xA1, 0x63, 0xBF, 0x05, \ - 0x98, 0xDA, 0x48, 0x36, 0x1C, 0x55, 0xD3, 0x9A, \ - 0x69, 0x16, 0x3F, 0xA8, 0xFD, 0x24, 0xCF, 0x5F, \ - 0x83, 0x65, 0x5D, 0x23, 0xDC, 0xA3, 0xAD, 0x96, \ - 0x1C, 0x62, 0xF3, 0x56, 0x20, 0x85, 0x52, 0xBB, \ - 0x9E, 0xD5, 0x29, 0x07, 0x70, 0x96, 0x96, 0x6D, \ - 0x67, 0x0C, 0x35, 0x4E, 0x4A, 0xBC, 0x98, 0x04, \ - 0xF1, 0x74, 0x6C, 0x08, 0xCA, 0x18, 0x21, 0x7C, \ - 0x32, 0x90, 0x5E, 0x46, 0x2E, 0x36, 0xCE, 0x3B, \ - 0xE3, 0x9E, 0x77, 0x2C, 0x18, 0x0E, 0x86, 0x03, \ - 0x9B, 0x27, 0x83, 0xA2, 0xEC, 0x07, 0xA2, 0x8F, \ - 0xB5, 0xC5, 0x5D, 0xF0, 0x6F, 0x4C, 0x52, 0xC9, \ - 0xDE, 0x2B, 0xCB, 0xF6, 0x95, 0x58, 0x17, 0x18, \ - 0x39, 0x95, 0x49, 0x7C, 0xEA, 0x95, 0x6A, 0xE5, \ - 0x15, 0xD2, 0x26, 0x18, 0x98, 0xFA, 0x05, 0x10, \ - 0x15, 0x72, 0x8E, 0x5A, 0x8A, 0xAA, 0xC4, 0x2D, \ - 0xAD, 0x33, 0x17, 0x0D, 0x04, 0x50, 0x7A, 0x33, \ - 0xA8, 0x55, 0x21, 0xAB, 0xDF, 0x1C, 0xBA, 0x64, \ - 0xEC, 0xFB, 0x85, 0x04, 0x58, 0xDB, 0xEF, 0x0A, \ - 0x8A, 0xEA, 0x71, 0x57, 0x5D, 0x06, 0x0C, 0x7D, \ - 0xB3, 0x97, 0x0F, 0x85, 0xA6, 0xE1, 0xE4, 0xC7, \ - 0xAB, 0xF5, 0xAE, 0x8C, 0xDB, 0x09, 0x33, 0xD7, \ - 0x1E, 0x8C, 0x94, 0xE0, 0x4A, 0x25, 0x61, 0x9D, \ - 0xCE, 0xE3, 0xD2, 0x26, 0x1A, 0xD2, 0xEE, 0x6B, \ - 0xF1, 0x2F, 0xFA, 0x06, 0xD9, 0x8A, 0x08, 0x64, \ - 0xD8, 0x76, 0x02, 0x73, 0x3E, 0xC8, 0x6A, 0x64, \ - 0x52, 0x1F, 0x2B, 0x18, 0x17, 0x7B, 0x20, 0x0C, \ - 0xBB, 0xE1, 0x17, 0x57, 0x7A, 0x61, 0x5D, 0x6C, \ - 0x77, 0x09, 0x88, 0xC0, 0xBA, 0xD9, 0x46, 0xE2, \ - 0x08, 0xE2, 0x4F, 0xA0, 0x74, 0xE5, 0xAB, 0x31, \ - 0x43, 0xDB, 0x5B, 0xFC, 0xE0, 0xFD, 0x10, 0x8E, \ - 0x4B, 0x82, 0xD1, 0x20, 0xA9, 0x3A, 0xD2, 0xCA, \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF } - -#define MBEDTLS_DHM_RFC3526_MODP_3072_G_BIN { 0x02 } - -#define MBEDTLS_DHM_RFC3526_MODP_4096_P_BIN { \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ - 0xC9, 0x0F, 0xDA, 0xA2, 0x21, 0x68, 0xC2, 0x34, \ - 0xC4, 0xC6, 0x62, 0x8B, 0x80, 0xDC, 0x1C, 0xD1, \ - 0x29, 0x02, 0x4E, 0x08, 0x8A, 0x67, 0xCC, 0x74, \ - 0x02, 0x0B, 0xBE, 0xA6, 0x3B, 0x13, 0x9B, 0x22, \ - 0x51, 0x4A, 0x08, 0x79, 0x8E, 0x34, 0x04, 0xDD, \ - 0xEF, 0x95, 0x19, 0xB3, 0xCD, 0x3A, 0x43, 0x1B, \ - 0x30, 0x2B, 0x0A, 0x6D, 0xF2, 0x5F, 0x14, 0x37, \ - 0x4F, 0xE1, 0x35, 0x6D, 0x6D, 0x51, 0xC2, 0x45, \ - 0xE4, 0x85, 0xB5, 0x76, 0x62, 0x5E, 0x7E, 0xC6, \ - 0xF4, 0x4C, 0x42, 0xE9, 0xA6, 0x37, 0xED, 0x6B, \ - 0x0B, 0xFF, 0x5C, 0xB6, 0xF4, 0x06, 0xB7, 0xED, \ - 0xEE, 0x38, 0x6B, 0xFB, 0x5A, 0x89, 0x9F, 0xA5, \ - 0xAE, 0x9F, 0x24, 0x11, 0x7C, 0x4B, 0x1F, 0xE6, \ - 0x49, 0x28, 0x66, 0x51, 0xEC, 0xE4, 0x5B, 0x3D, \ - 0xC2, 0x00, 0x7C, 0xB8, 0xA1, 0x63, 0xBF, 0x05, \ - 0x98, 0xDA, 0x48, 0x36, 0x1C, 0x55, 0xD3, 0x9A, \ - 0x69, 0x16, 0x3F, 0xA8, 0xFD, 0x24, 0xCF, 0x5F, \ - 0x83, 0x65, 0x5D, 0x23, 0xDC, 0xA3, 0xAD, 0x96, \ - 0x1C, 0x62, 0xF3, 0x56, 0x20, 0x85, 0x52, 0xBB, \ - 0x9E, 0xD5, 0x29, 0x07, 0x70, 0x96, 0x96, 0x6D, \ - 0x67, 0x0C, 0x35, 0x4E, 0x4A, 0xBC, 0x98, 0x04, \ - 0xF1, 0x74, 0x6C, 0x08, 0xCA, 0x18, 0x21, 0x7C, \ - 0x32, 0x90, 0x5E, 0x46, 0x2E, 0x36, 0xCE, 0x3B, \ - 0xE3, 0x9E, 0x77, 0x2C, 0x18, 0x0E, 0x86, 0x03, \ - 0x9B, 0x27, 0x83, 0xA2, 0xEC, 0x07, 0xA2, 0x8F, \ - 0xB5, 0xC5, 0x5D, 0xF0, 0x6F, 0x4C, 0x52, 0xC9, \ - 0xDE, 0x2B, 0xCB, 0xF6, 0x95, 0x58, 0x17, 0x18, \ - 0x39, 0x95, 0x49, 0x7C, 0xEA, 0x95, 0x6A, 0xE5, \ - 0x15, 0xD2, 0x26, 0x18, 0x98, 0xFA, 0x05, 0x10, \ - 0x15, 0x72, 0x8E, 0x5A, 0x8A, 0xAA, 0xC4, 0x2D, \ - 0xAD, 0x33, 0x17, 0x0D, 0x04, 0x50, 0x7A, 0x33, \ - 0xA8, 0x55, 0x21, 0xAB, 0xDF, 0x1C, 0xBA, 0x64, \ - 0xEC, 0xFB, 0x85, 0x04, 0x58, 0xDB, 0xEF, 0x0A, \ - 0x8A, 0xEA, 0x71, 0x57, 0x5D, 0x06, 0x0C, 0x7D, \ - 0xB3, 0x97, 0x0F, 0x85, 0xA6, 0xE1, 0xE4, 0xC7, \ - 0xAB, 0xF5, 0xAE, 0x8C, 0xDB, 0x09, 0x33, 0xD7, \ - 0x1E, 0x8C, 0x94, 0xE0, 0x4A, 0x25, 0x61, 0x9D, \ - 0xCE, 0xE3, 0xD2, 0x26, 0x1A, 0xD2, 0xEE, 0x6B, \ - 0xF1, 0x2F, 0xFA, 0x06, 0xD9, 0x8A, 0x08, 0x64, \ - 0xD8, 0x76, 0x02, 0x73, 0x3E, 0xC8, 0x6A, 0x64, \ - 0x52, 0x1F, 0x2B, 0x18, 0x17, 0x7B, 0x20, 0x0C, \ - 0xBB, 0xE1, 0x17, 0x57, 0x7A, 0x61, 0x5D, 0x6C, \ - 0x77, 0x09, 0x88, 0xC0, 0xBA, 0xD9, 0x46, 0xE2, \ - 0x08, 0xE2, 0x4F, 0xA0, 0x74, 0xE5, 0xAB, 0x31, \ - 0x43, 0xDB, 0x5B, 0xFC, 0xE0, 0xFD, 0x10, 0x8E, \ - 0x4B, 0x82, 0xD1, 0x20, 0xA9, 0x21, 0x08, 0x01, \ - 0x1A, 0x72, 0x3C, 0x12, 0xA7, 0x87, 0xE6, 0xD7, \ - 0x88, 0x71, 0x9A, 0x10, 0xBD, 0xBA, 0x5B, 0x26, \ - 0x99, 0xC3, 0x27, 0x18, 0x6A, 0xF4, 0xE2, 0x3C, \ - 0x1A, 0x94, 0x68, 0x34, 0xB6, 0x15, 0x0B, 0xDA, \ - 0x25, 0x83, 0xE9, 0xCA, 0x2A, 0xD4, 0x4C, 0xE8, \ - 0xDB, 0xBB, 0xC2, 0xDB, 0x04, 0xDE, 0x8E, 0xF9, \ - 0x2E, 0x8E, 0xFC, 0x14, 0x1F, 0xBE, 0xCA, 0xA6, \ - 0x28, 0x7C, 0x59, 0x47, 0x4E, 0x6B, 0xC0, 0x5D, \ - 0x99, 0xB2, 0x96, 0x4F, 0xA0, 0x90, 0xC3, 0xA2, \ - 0x23, 0x3B, 0xA1, 0x86, 0x51, 0x5B, 0xE7, 0xED, \ - 0x1F, 0x61, 0x29, 0x70, 0xCE, 0xE2, 0xD7, 0xAF, \ - 0xB8, 0x1B, 0xDD, 0x76, 0x21, 0x70, 0x48, 0x1C, \ - 0xD0, 0x06, 0x91, 0x27, 0xD5, 0xB0, 0x5A, 0xA9, \ - 0x93, 0xB4, 0xEA, 0x98, 0x8D, 0x8F, 0xDD, 0xC1, \ - 0x86, 0xFF, 0xB7, 0xDC, 0x90, 0xA6, 0xC0, 0x8F, \ - 0x4D, 0xF4, 0x35, 0xC9, 0x34, 0x06, 0x31, 0x99, \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF } - -#define MBEDTLS_DHM_RFC3526_MODP_4096_G_BIN { 0x02 } - -#define MBEDTLS_DHM_RFC7919_FFDHE2048_P_BIN { \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ - 0xAD, 0xF8, 0x54, 0x58, 0xA2, 0xBB, 0x4A, 0x9A, \ - 0xAF, 0xDC, 0x56, 0x20, 0x27, 0x3D, 0x3C, 0xF1, \ - 0xD8, 0xB9, 0xC5, 0x83, 0xCE, 0x2D, 0x36, 0x95, \ - 0xA9, 0xE1, 0x36, 0x41, 0x14, 0x64, 0x33, 0xFB, \ - 0xCC, 0x93, 0x9D, 0xCE, 0x24, 0x9B, 0x3E, 0xF9, \ - 0x7D, 0x2F, 0xE3, 0x63, 0x63, 0x0C, 0x75, 0xD8, \ - 0xF6, 0x81, 0xB2, 0x02, 0xAE, 0xC4, 0x61, 0x7A, \ - 0xD3, 0xDF, 0x1E, 0xD5, 0xD5, 0xFD, 0x65, 0x61, \ - 0x24, 0x33, 0xF5, 0x1F, 0x5F, 0x06, 0x6E, 0xD0, \ - 0x85, 0x63, 0x65, 0x55, 0x3D, 0xED, 0x1A, 0xF3, \ - 0xB5, 0x57, 0x13, 0x5E, 0x7F, 0x57, 0xC9, 0x35, \ - 0x98, 0x4F, 0x0C, 0x70, 0xE0, 0xE6, 0x8B, 0x77, \ - 0xE2, 0xA6, 0x89, 0xDA, 0xF3, 0xEF, 0xE8, 0x72, \ - 0x1D, 0xF1, 0x58, 0xA1, 0x36, 0xAD, 0xE7, 0x35, \ - 0x30, 0xAC, 0xCA, 0x4F, 0x48, 0x3A, 0x79, 0x7A, \ - 0xBC, 0x0A, 0xB1, 0x82, 0xB3, 0x24, 0xFB, 0x61, \ - 0xD1, 0x08, 0xA9, 0x4B, 0xB2, 0xC8, 0xE3, 0xFB, \ - 0xB9, 0x6A, 0xDA, 0xB7, 0x60, 0xD7, 0xF4, 0x68, \ - 0x1D, 0x4F, 0x42, 0xA3, 0xDE, 0x39, 0x4D, 0xF4, \ - 0xAE, 0x56, 0xED, 0xE7, 0x63, 0x72, 0xBB, 0x19, \ - 0x0B, 0x07, 0xA7, 0xC8, 0xEE, 0x0A, 0x6D, 0x70, \ - 0x9E, 0x02, 0xFC, 0xE1, 0xCD, 0xF7, 0xE2, 0xEC, \ - 0xC0, 0x34, 0x04, 0xCD, 0x28, 0x34, 0x2F, 0x61, \ - 0x91, 0x72, 0xFE, 0x9C, 0xE9, 0x85, 0x83, 0xFF, \ - 0x8E, 0x4F, 0x12, 0x32, 0xEE, 0xF2, 0x81, 0x83, \ - 0xC3, 0xFE, 0x3B, 0x1B, 0x4C, 0x6F, 0xAD, 0x73, \ - 0x3B, 0xB5, 0xFC, 0xBC, 0x2E, 0xC2, 0x20, 0x05, \ - 0xC5, 0x8E, 0xF1, 0x83, 0x7D, 0x16, 0x83, 0xB2, \ - 0xC6, 0xF3, 0x4A, 0x26, 0xC1, 0xB2, 0xEF, 0xFA, \ - 0x88, 0x6B, 0x42, 0x38, 0x61, 0x28, 0x5C, 0x97, \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, } - -#define MBEDTLS_DHM_RFC7919_FFDHE2048_G_BIN { 0x02 } - -#define MBEDTLS_DHM_RFC7919_FFDHE3072_P_BIN { \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ - 0xAD, 0xF8, 0x54, 0x58, 0xA2, 0xBB, 0x4A, 0x9A, \ - 0xAF, 0xDC, 0x56, 0x20, 0x27, 0x3D, 0x3C, 0xF1, \ - 0xD8, 0xB9, 0xC5, 0x83, 0xCE, 0x2D, 0x36, 0x95, \ - 0xA9, 0xE1, 0x36, 0x41, 0x14, 0x64, 0x33, 0xFB, \ - 0xCC, 0x93, 0x9D, 0xCE, 0x24, 0x9B, 0x3E, 0xF9, \ - 0x7D, 0x2F, 0xE3, 0x63, 0x63, 0x0C, 0x75, 0xD8, \ - 0xF6, 0x81, 0xB2, 0x02, 0xAE, 0xC4, 0x61, 0x7A, \ - 0xD3, 0xDF, 0x1E, 0xD5, 0xD5, 0xFD, 0x65, 0x61, \ - 0x24, 0x33, 0xF5, 0x1F, 0x5F, 0x06, 0x6E, 0xD0, \ - 0x85, 0x63, 0x65, 0x55, 0x3D, 0xED, 0x1A, 0xF3, \ - 0xB5, 0x57, 0x13, 0x5E, 0x7F, 0x57, 0xC9, 0x35, \ - 0x98, 0x4F, 0x0C, 0x70, 0xE0, 0xE6, 0x8B, 0x77, \ - 0xE2, 0xA6, 0x89, 0xDA, 0xF3, 0xEF, 0xE8, 0x72, \ - 0x1D, 0xF1, 0x58, 0xA1, 0x36, 0xAD, 0xE7, 0x35, \ - 0x30, 0xAC, 0xCA, 0x4F, 0x48, 0x3A, 0x79, 0x7A, \ - 0xBC, 0x0A, 0xB1, 0x82, 0xB3, 0x24, 0xFB, 0x61, \ - 0xD1, 0x08, 0xA9, 0x4B, 0xB2, 0xC8, 0xE3, 0xFB, \ - 0xB9, 0x6A, 0xDA, 0xB7, 0x60, 0xD7, 0xF4, 0x68, \ - 0x1D, 0x4F, 0x42, 0xA3, 0xDE, 0x39, 0x4D, 0xF4, \ - 0xAE, 0x56, 0xED, 0xE7, 0x63, 0x72, 0xBB, 0x19, \ - 0x0B, 0x07, 0xA7, 0xC8, 0xEE, 0x0A, 0x6D, 0x70, \ - 0x9E, 0x02, 0xFC, 0xE1, 0xCD, 0xF7, 0xE2, 0xEC, \ - 0xC0, 0x34, 0x04, 0xCD, 0x28, 0x34, 0x2F, 0x61, \ - 0x91, 0x72, 0xFE, 0x9C, 0xE9, 0x85, 0x83, 0xFF, \ - 0x8E, 0x4F, 0x12, 0x32, 0xEE, 0xF2, 0x81, 0x83, \ - 0xC3, 0xFE, 0x3B, 0x1B, 0x4C, 0x6F, 0xAD, 0x73, \ - 0x3B, 0xB5, 0xFC, 0xBC, 0x2E, 0xC2, 0x20, 0x05, \ - 0xC5, 0x8E, 0xF1, 0x83, 0x7D, 0x16, 0x83, 0xB2, \ - 0xC6, 0xF3, 0x4A, 0x26, 0xC1, 0xB2, 0xEF, 0xFA, \ - 0x88, 0x6B, 0x42, 0x38, 0x61, 0x1F, 0xCF, 0xDC, \ - 0xDE, 0x35, 0x5B, 0x3B, 0x65, 0x19, 0x03, 0x5B, \ - 0xBC, 0x34, 0xF4, 0xDE, 0xF9, 0x9C, 0x02, 0x38, \ - 0x61, 0xB4, 0x6F, 0xC9, 0xD6, 0xE6, 0xC9, 0x07, \ - 0x7A, 0xD9, 0x1D, 0x26, 0x91, 0xF7, 0xF7, 0xEE, \ - 0x59, 0x8C, 0xB0, 0xFA, 0xC1, 0x86, 0xD9, 0x1C, \ - 0xAE, 0xFE, 0x13, 0x09, 0x85, 0x13, 0x92, 0x70, \ - 0xB4, 0x13, 0x0C, 0x93, 0xBC, 0x43, 0x79, 0x44, \ - 0xF4, 0xFD, 0x44, 0x52, 0xE2, 0xD7, 0x4D, 0xD3, \ - 0x64, 0xF2, 0xE2, 0x1E, 0x71, 0xF5, 0x4B, 0xFF, \ - 0x5C, 0xAE, 0x82, 0xAB, 0x9C, 0x9D, 0xF6, 0x9E, \ - 0xE8, 0x6D, 0x2B, 0xC5, 0x22, 0x36, 0x3A, 0x0D, \ - 0xAB, 0xC5, 0x21, 0x97, 0x9B, 0x0D, 0xEA, 0xDA, \ - 0x1D, 0xBF, 0x9A, 0x42, 0xD5, 0xC4, 0x48, 0x4E, \ - 0x0A, 0xBC, 0xD0, 0x6B, 0xFA, 0x53, 0xDD, 0xEF, \ - 0x3C, 0x1B, 0x20, 0xEE, 0x3F, 0xD5, 0x9D, 0x7C, \ - 0x25, 0xE4, 0x1D, 0x2B, 0x66, 0xC6, 0x2E, 0x37, \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF } - -#define MBEDTLS_DHM_RFC7919_FFDHE3072_G_BIN { 0x02 } - -#define MBEDTLS_DHM_RFC7919_FFDHE4096_P_BIN { \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ - 0xAD, 0xF8, 0x54, 0x58, 0xA2, 0xBB, 0x4A, 0x9A, \ - 0xAF, 0xDC, 0x56, 0x20, 0x27, 0x3D, 0x3C, 0xF1, \ - 0xD8, 0xB9, 0xC5, 0x83, 0xCE, 0x2D, 0x36, 0x95, \ - 0xA9, 0xE1, 0x36, 0x41, 0x14, 0x64, 0x33, 0xFB, \ - 0xCC, 0x93, 0x9D, 0xCE, 0x24, 0x9B, 0x3E, 0xF9, \ - 0x7D, 0x2F, 0xE3, 0x63, 0x63, 0x0C, 0x75, 0xD8, \ - 0xF6, 0x81, 0xB2, 0x02, 0xAE, 0xC4, 0x61, 0x7A, \ - 0xD3, 0xDF, 0x1E, 0xD5, 0xD5, 0xFD, 0x65, 0x61, \ - 0x24, 0x33, 0xF5, 0x1F, 0x5F, 0x06, 0x6E, 0xD0, \ - 0x85, 0x63, 0x65, 0x55, 0x3D, 0xED, 0x1A, 0xF3, \ - 0xB5, 0x57, 0x13, 0x5E, 0x7F, 0x57, 0xC9, 0x35, \ - 0x98, 0x4F, 0x0C, 0x70, 0xE0, 0xE6, 0x8B, 0x77, \ - 0xE2, 0xA6, 0x89, 0xDA, 0xF3, 0xEF, 0xE8, 0x72, \ - 0x1D, 0xF1, 0x58, 0xA1, 0x36, 0xAD, 0xE7, 0x35, \ - 0x30, 0xAC, 0xCA, 0x4F, 0x48, 0x3A, 0x79, 0x7A, \ - 0xBC, 0x0A, 0xB1, 0x82, 0xB3, 0x24, 0xFB, 0x61, \ - 0xD1, 0x08, 0xA9, 0x4B, 0xB2, 0xC8, 0xE3, 0xFB, \ - 0xB9, 0x6A, 0xDA, 0xB7, 0x60, 0xD7, 0xF4, 0x68, \ - 0x1D, 0x4F, 0x42, 0xA3, 0xDE, 0x39, 0x4D, 0xF4, \ - 0xAE, 0x56, 0xED, 0xE7, 0x63, 0x72, 0xBB, 0x19, \ - 0x0B, 0x07, 0xA7, 0xC8, 0xEE, 0x0A, 0x6D, 0x70, \ - 0x9E, 0x02, 0xFC, 0xE1, 0xCD, 0xF7, 0xE2, 0xEC, \ - 0xC0, 0x34, 0x04, 0xCD, 0x28, 0x34, 0x2F, 0x61, \ - 0x91, 0x72, 0xFE, 0x9C, 0xE9, 0x85, 0x83, 0xFF, \ - 0x8E, 0x4F, 0x12, 0x32, 0xEE, 0xF2, 0x81, 0x83, \ - 0xC3, 0xFE, 0x3B, 0x1B, 0x4C, 0x6F, 0xAD, 0x73, \ - 0x3B, 0xB5, 0xFC, 0xBC, 0x2E, 0xC2, 0x20, 0x05, \ - 0xC5, 0x8E, 0xF1, 0x83, 0x7D, 0x16, 0x83, 0xB2, \ - 0xC6, 0xF3, 0x4A, 0x26, 0xC1, 0xB2, 0xEF, 0xFA, \ - 0x88, 0x6B, 0x42, 0x38, 0x61, 0x1F, 0xCF, 0xDC, \ - 0xDE, 0x35, 0x5B, 0x3B, 0x65, 0x19, 0x03, 0x5B, \ - 0xBC, 0x34, 0xF4, 0xDE, 0xF9, 0x9C, 0x02, 0x38, \ - 0x61, 0xB4, 0x6F, 0xC9, 0xD6, 0xE6, 0xC9, 0x07, \ - 0x7A, 0xD9, 0x1D, 0x26, 0x91, 0xF7, 0xF7, 0xEE, \ - 0x59, 0x8C, 0xB0, 0xFA, 0xC1, 0x86, 0xD9, 0x1C, \ - 0xAE, 0xFE, 0x13, 0x09, 0x85, 0x13, 0x92, 0x70, \ - 0xB4, 0x13, 0x0C, 0x93, 0xBC, 0x43, 0x79, 0x44, \ - 0xF4, 0xFD, 0x44, 0x52, 0xE2, 0xD7, 0x4D, 0xD3, \ - 0x64, 0xF2, 0xE2, 0x1E, 0x71, 0xF5, 0x4B, 0xFF, \ - 0x5C, 0xAE, 0x82, 0xAB, 0x9C, 0x9D, 0xF6, 0x9E, \ - 0xE8, 0x6D, 0x2B, 0xC5, 0x22, 0x36, 0x3A, 0x0D, \ - 0xAB, 0xC5, 0x21, 0x97, 0x9B, 0x0D, 0xEA, 0xDA, \ - 0x1D, 0xBF, 0x9A, 0x42, 0xD5, 0xC4, 0x48, 0x4E, \ - 0x0A, 0xBC, 0xD0, 0x6B, 0xFA, 0x53, 0xDD, 0xEF, \ - 0x3C, 0x1B, 0x20, 0xEE, 0x3F, 0xD5, 0x9D, 0x7C, \ - 0x25, 0xE4, 0x1D, 0x2B, 0x66, 0x9E, 0x1E, 0xF1, \ - 0x6E, 0x6F, 0x52, 0xC3, 0x16, 0x4D, 0xF4, 0xFB, \ - 0x79, 0x30, 0xE9, 0xE4, 0xE5, 0x88, 0x57, 0xB6, \ - 0xAC, 0x7D, 0x5F, 0x42, 0xD6, 0x9F, 0x6D, 0x18, \ - 0x77, 0x63, 0xCF, 0x1D, 0x55, 0x03, 0x40, 0x04, \ - 0x87, 0xF5, 0x5B, 0xA5, 0x7E, 0x31, 0xCC, 0x7A, \ - 0x71, 0x35, 0xC8, 0x86, 0xEF, 0xB4, 0x31, 0x8A, \ - 0xED, 0x6A, 0x1E, 0x01, 0x2D, 0x9E, 0x68, 0x32, \ - 0xA9, 0x07, 0x60, 0x0A, 0x91, 0x81, 0x30, 0xC4, \ - 0x6D, 0xC7, 0x78, 0xF9, 0x71, 0xAD, 0x00, 0x38, \ - 0x09, 0x29, 0x99, 0xA3, 0x33, 0xCB, 0x8B, 0x7A, \ - 0x1A, 0x1D, 0xB9, 0x3D, 0x71, 0x40, 0x00, 0x3C, \ - 0x2A, 0x4E, 0xCE, 0xA9, 0xF9, 0x8D, 0x0A, 0xCC, \ - 0x0A, 0x82, 0x91, 0xCD, 0xCE, 0xC9, 0x7D, 0xCF, \ - 0x8E, 0xC9, 0xB5, 0x5A, 0x7F, 0x88, 0xA4, 0x6B, \ - 0x4D, 0xB5, 0xA8, 0x51, 0xF4, 0x41, 0x82, 0xE1, \ - 0xC6, 0x8A, 0x00, 0x7E, 0x5E, 0x65, 0x5F, 0x6A, \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF } - -#define MBEDTLS_DHM_RFC7919_FFDHE4096_G_BIN { 0x02 } - -#define MBEDTLS_DHM_RFC7919_FFDHE6144_P_BIN { \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ - 0xAD, 0xF8, 0x54, 0x58, 0xA2, 0xBB, 0x4A, 0x9A, \ - 0xAF, 0xDC, 0x56, 0x20, 0x27, 0x3D, 0x3C, 0xF1, \ - 0xD8, 0xB9, 0xC5, 0x83, 0xCE, 0x2D, 0x36, 0x95, \ - 0xA9, 0xE1, 0x36, 0x41, 0x14, 0x64, 0x33, 0xFB, \ - 0xCC, 0x93, 0x9D, 0xCE, 0x24, 0x9B, 0x3E, 0xF9, \ - 0x7D, 0x2F, 0xE3, 0x63, 0x63, 0x0C, 0x75, 0xD8, \ - 0xF6, 0x81, 0xB2, 0x02, 0xAE, 0xC4, 0x61, 0x7A, \ - 0xD3, 0xDF, 0x1E, 0xD5, 0xD5, 0xFD, 0x65, 0x61, \ - 0x24, 0x33, 0xF5, 0x1F, 0x5F, 0x06, 0x6E, 0xD0, \ - 0x85, 0x63, 0x65, 0x55, 0x3D, 0xED, 0x1A, 0xF3, \ - 0xB5, 0x57, 0x13, 0x5E, 0x7F, 0x57, 0xC9, 0x35, \ - 0x98, 0x4F, 0x0C, 0x70, 0xE0, 0xE6, 0x8B, 0x77, \ - 0xE2, 0xA6, 0x89, 0xDA, 0xF3, 0xEF, 0xE8, 0x72, \ - 0x1D, 0xF1, 0x58, 0xA1, 0x36, 0xAD, 0xE7, 0x35, \ - 0x30, 0xAC, 0xCA, 0x4F, 0x48, 0x3A, 0x79, 0x7A, \ - 0xBC, 0x0A, 0xB1, 0x82, 0xB3, 0x24, 0xFB, 0x61, \ - 0xD1, 0x08, 0xA9, 0x4B, 0xB2, 0xC8, 0xE3, 0xFB, \ - 0xB9, 0x6A, 0xDA, 0xB7, 0x60, 0xD7, 0xF4, 0x68, \ - 0x1D, 0x4F, 0x42, 0xA3, 0xDE, 0x39, 0x4D, 0xF4, \ - 0xAE, 0x56, 0xED, 0xE7, 0x63, 0x72, 0xBB, 0x19, \ - 0x0B, 0x07, 0xA7, 0xC8, 0xEE, 0x0A, 0x6D, 0x70, \ - 0x9E, 0x02, 0xFC, 0xE1, 0xCD, 0xF7, 0xE2, 0xEC, \ - 0xC0, 0x34, 0x04, 0xCD, 0x28, 0x34, 0x2F, 0x61, \ - 0x91, 0x72, 0xFE, 0x9C, 0xE9, 0x85, 0x83, 0xFF, \ - 0x8E, 0x4F, 0x12, 0x32, 0xEE, 0xF2, 0x81, 0x83, \ - 0xC3, 0xFE, 0x3B, 0x1B, 0x4C, 0x6F, 0xAD, 0x73, \ - 0x3B, 0xB5, 0xFC, 0xBC, 0x2E, 0xC2, 0x20, 0x05, \ - 0xC5, 0x8E, 0xF1, 0x83, 0x7D, 0x16, 0x83, 0xB2, \ - 0xC6, 0xF3, 0x4A, 0x26, 0xC1, 0xB2, 0xEF, 0xFA, \ - 0x88, 0x6B, 0x42, 0x38, 0x61, 0x1F, 0xCF, 0xDC, \ - 0xDE, 0x35, 0x5B, 0x3B, 0x65, 0x19, 0x03, 0x5B, \ - 0xBC, 0x34, 0xF4, 0xDE, 0xF9, 0x9C, 0x02, 0x38, \ - 0x61, 0xB4, 0x6F, 0xC9, 0xD6, 0xE6, 0xC9, 0x07, \ - 0x7A, 0xD9, 0x1D, 0x26, 0x91, 0xF7, 0xF7, 0xEE, \ - 0x59, 0x8C, 0xB0, 0xFA, 0xC1, 0x86, 0xD9, 0x1C, \ - 0xAE, 0xFE, 0x13, 0x09, 0x85, 0x13, 0x92, 0x70, \ - 0xB4, 0x13, 0x0C, 0x93, 0xBC, 0x43, 0x79, 0x44, \ - 0xF4, 0xFD, 0x44, 0x52, 0xE2, 0xD7, 0x4D, 0xD3, \ - 0x64, 0xF2, 0xE2, 0x1E, 0x71, 0xF5, 0x4B, 0xFF, \ - 0x5C, 0xAE, 0x82, 0xAB, 0x9C, 0x9D, 0xF6, 0x9E, \ - 0xE8, 0x6D, 0x2B, 0xC5, 0x22, 0x36, 0x3A, 0x0D, \ - 0xAB, 0xC5, 0x21, 0x97, 0x9B, 0x0D, 0xEA, 0xDA, \ - 0x1D, 0xBF, 0x9A, 0x42, 0xD5, 0xC4, 0x48, 0x4E, \ - 0x0A, 0xBC, 0xD0, 0x6B, 0xFA, 0x53, 0xDD, 0xEF, \ - 0x3C, 0x1B, 0x20, 0xEE, 0x3F, 0xD5, 0x9D, 0x7C, \ - 0x25, 0xE4, 0x1D, 0x2B, 0x66, 0x9E, 0x1E, 0xF1, \ - 0x6E, 0x6F, 0x52, 0xC3, 0x16, 0x4D, 0xF4, 0xFB, \ - 0x79, 0x30, 0xE9, 0xE4, 0xE5, 0x88, 0x57, 0xB6, \ - 0xAC, 0x7D, 0x5F, 0x42, 0xD6, 0x9F, 0x6D, 0x18, \ - 0x77, 0x63, 0xCF, 0x1D, 0x55, 0x03, 0x40, 0x04, \ - 0x87, 0xF5, 0x5B, 0xA5, 0x7E, 0x31, 0xCC, 0x7A, \ - 0x71, 0x35, 0xC8, 0x86, 0xEF, 0xB4, 0x31, 0x8A, \ - 0xED, 0x6A, 0x1E, 0x01, 0x2D, 0x9E, 0x68, 0x32, \ - 0xA9, 0x07, 0x60, 0x0A, 0x91, 0x81, 0x30, 0xC4, \ - 0x6D, 0xC7, 0x78, 0xF9, 0x71, 0xAD, 0x00, 0x38, \ - 0x09, 0x29, 0x99, 0xA3, 0x33, 0xCB, 0x8B, 0x7A, \ - 0x1A, 0x1D, 0xB9, 0x3D, 0x71, 0x40, 0x00, 0x3C, \ - 0x2A, 0x4E, 0xCE, 0xA9, 0xF9, 0x8D, 0x0A, 0xCC, \ - 0x0A, 0x82, 0x91, 0xCD, 0xCE, 0xC9, 0x7D, 0xCF, \ - 0x8E, 0xC9, 0xB5, 0x5A, 0x7F, 0x88, 0xA4, 0x6B, \ - 0x4D, 0xB5, 0xA8, 0x51, 0xF4, 0x41, 0x82, 0xE1, \ - 0xC6, 0x8A, 0x00, 0x7E, 0x5E, 0x0D, 0xD9, 0x02, \ - 0x0B, 0xFD, 0x64, 0xB6, 0x45, 0x03, 0x6C, 0x7A, \ - 0x4E, 0x67, 0x7D, 0x2C, 0x38, 0x53, 0x2A, 0x3A, \ - 0x23, 0xBA, 0x44, 0x42, 0xCA, 0xF5, 0x3E, 0xA6, \ - 0x3B, 0xB4, 0x54, 0x32, 0x9B, 0x76, 0x24, 0xC8, \ - 0x91, 0x7B, 0xDD, 0x64, 0xB1, 0xC0, 0xFD, 0x4C, \ - 0xB3, 0x8E, 0x8C, 0x33, 0x4C, 0x70, 0x1C, 0x3A, \ - 0xCD, 0xAD, 0x06, 0x57, 0xFC, 0xCF, 0xEC, 0x71, \ - 0x9B, 0x1F, 0x5C, 0x3E, 0x4E, 0x46, 0x04, 0x1F, \ - 0x38, 0x81, 0x47, 0xFB, 0x4C, 0xFD, 0xB4, 0x77, \ - 0xA5, 0x24, 0x71, 0xF7, 0xA9, 0xA9, 0x69, 0x10, \ - 0xB8, 0x55, 0x32, 0x2E, 0xDB, 0x63, 0x40, 0xD8, \ - 0xA0, 0x0E, 0xF0, 0x92, 0x35, 0x05, 0x11, 0xE3, \ - 0x0A, 0xBE, 0xC1, 0xFF, 0xF9, 0xE3, 0xA2, 0x6E, \ - 0x7F, 0xB2, 0x9F, 0x8C, 0x18, 0x30, 0x23, 0xC3, \ - 0x58, 0x7E, 0x38, 0xDA, 0x00, 0x77, 0xD9, 0xB4, \ - 0x76, 0x3E, 0x4E, 0x4B, 0x94, 0xB2, 0xBB, 0xC1, \ - 0x94, 0xC6, 0x65, 0x1E, 0x77, 0xCA, 0xF9, 0x92, \ - 0xEE, 0xAA, 0xC0, 0x23, 0x2A, 0x28, 0x1B, 0xF6, \ - 0xB3, 0xA7, 0x39, 0xC1, 0x22, 0x61, 0x16, 0x82, \ - 0x0A, 0xE8, 0xDB, 0x58, 0x47, 0xA6, 0x7C, 0xBE, \ - 0xF9, 0xC9, 0x09, 0x1B, 0x46, 0x2D, 0x53, 0x8C, \ - 0xD7, 0x2B, 0x03, 0x74, 0x6A, 0xE7, 0x7F, 0x5E, \ - 0x62, 0x29, 0x2C, 0x31, 0x15, 0x62, 0xA8, 0x46, \ - 0x50, 0x5D, 0xC8, 0x2D, 0xB8, 0x54, 0x33, 0x8A, \ - 0xE4, 0x9F, 0x52, 0x35, 0xC9, 0x5B, 0x91, 0x17, \ - 0x8C, 0xCF, 0x2D, 0xD5, 0xCA, 0xCE, 0xF4, 0x03, \ - 0xEC, 0x9D, 0x18, 0x10, 0xC6, 0x27, 0x2B, 0x04, \ - 0x5B, 0x3B, 0x71, 0xF9, 0xDC, 0x6B, 0x80, 0xD6, \ - 0x3F, 0xDD, 0x4A, 0x8E, 0x9A, 0xDB, 0x1E, 0x69, \ - 0x62, 0xA6, 0x95, 0x26, 0xD4, 0x31, 0x61, 0xC1, \ - 0xA4, 0x1D, 0x57, 0x0D, 0x79, 0x38, 0xDA, 0xD4, \ - 0xA4, 0x0E, 0x32, 0x9C, 0xD0, 0xE4, 0x0E, 0x65, \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF } - -#define MBEDTLS_DHM_RFC7919_FFDHE6144_G_BIN { 0x02 } - -#define MBEDTLS_DHM_RFC7919_FFDHE8192_P_BIN { \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ - 0xAD, 0xF8, 0x54, 0x58, 0xA2, 0xBB, 0x4A, 0x9A, \ - 0xAF, 0xDC, 0x56, 0x20, 0x27, 0x3D, 0x3C, 0xF1, \ - 0xD8, 0xB9, 0xC5, 0x83, 0xCE, 0x2D, 0x36, 0x95, \ - 0xA9, 0xE1, 0x36, 0x41, 0x14, 0x64, 0x33, 0xFB, \ - 0xCC, 0x93, 0x9D, 0xCE, 0x24, 0x9B, 0x3E, 0xF9, \ - 0x7D, 0x2F, 0xE3, 0x63, 0x63, 0x0C, 0x75, 0xD8, \ - 0xF6, 0x81, 0xB2, 0x02, 0xAE, 0xC4, 0x61, 0x7A, \ - 0xD3, 0xDF, 0x1E, 0xD5, 0xD5, 0xFD, 0x65, 0x61, \ - 0x24, 0x33, 0xF5, 0x1F, 0x5F, 0x06, 0x6E, 0xD0, \ - 0x85, 0x63, 0x65, 0x55, 0x3D, 0xED, 0x1A, 0xF3, \ - 0xB5, 0x57, 0x13, 0x5E, 0x7F, 0x57, 0xC9, 0x35, \ - 0x98, 0x4F, 0x0C, 0x70, 0xE0, 0xE6, 0x8B, 0x77, \ - 0xE2, 0xA6, 0x89, 0xDA, 0xF3, 0xEF, 0xE8, 0x72, \ - 0x1D, 0xF1, 0x58, 0xA1, 0x36, 0xAD, 0xE7, 0x35, \ - 0x30, 0xAC, 0xCA, 0x4F, 0x48, 0x3A, 0x79, 0x7A, \ - 0xBC, 0x0A, 0xB1, 0x82, 0xB3, 0x24, 0xFB, 0x61, \ - 0xD1, 0x08, 0xA9, 0x4B, 0xB2, 0xC8, 0xE3, 0xFB, \ - 0xB9, 0x6A, 0xDA, 0xB7, 0x60, 0xD7, 0xF4, 0x68, \ - 0x1D, 0x4F, 0x42, 0xA3, 0xDE, 0x39, 0x4D, 0xF4, \ - 0xAE, 0x56, 0xED, 0xE7, 0x63, 0x72, 0xBB, 0x19, \ - 0x0B, 0x07, 0xA7, 0xC8, 0xEE, 0x0A, 0x6D, 0x70, \ - 0x9E, 0x02, 0xFC, 0xE1, 0xCD, 0xF7, 0xE2, 0xEC, \ - 0xC0, 0x34, 0x04, 0xCD, 0x28, 0x34, 0x2F, 0x61, \ - 0x91, 0x72, 0xFE, 0x9C, 0xE9, 0x85, 0x83, 0xFF, \ - 0x8E, 0x4F, 0x12, 0x32, 0xEE, 0xF2, 0x81, 0x83, \ - 0xC3, 0xFE, 0x3B, 0x1B, 0x4C, 0x6F, 0xAD, 0x73, \ - 0x3B, 0xB5, 0xFC, 0xBC, 0x2E, 0xC2, 0x20, 0x05, \ - 0xC5, 0x8E, 0xF1, 0x83, 0x7D, 0x16, 0x83, 0xB2, \ - 0xC6, 0xF3, 0x4A, 0x26, 0xC1, 0xB2, 0xEF, 0xFA, \ - 0x88, 0x6B, 0x42, 0x38, 0x61, 0x1F, 0xCF, 0xDC, \ - 0xDE, 0x35, 0x5B, 0x3B, 0x65, 0x19, 0x03, 0x5B, \ - 0xBC, 0x34, 0xF4, 0xDE, 0xF9, 0x9C, 0x02, 0x38, \ - 0x61, 0xB4, 0x6F, 0xC9, 0xD6, 0xE6, 0xC9, 0x07, \ - 0x7A, 0xD9, 0x1D, 0x26, 0x91, 0xF7, 0xF7, 0xEE, \ - 0x59, 0x8C, 0xB0, 0xFA, 0xC1, 0x86, 0xD9, 0x1C, \ - 0xAE, 0xFE, 0x13, 0x09, 0x85, 0x13, 0x92, 0x70, \ - 0xB4, 0x13, 0x0C, 0x93, 0xBC, 0x43, 0x79, 0x44, \ - 0xF4, 0xFD, 0x44, 0x52, 0xE2, 0xD7, 0x4D, 0xD3, \ - 0x64, 0xF2, 0xE2, 0x1E, 0x71, 0xF5, 0x4B, 0xFF, \ - 0x5C, 0xAE, 0x82, 0xAB, 0x9C, 0x9D, 0xF6, 0x9E, \ - 0xE8, 0x6D, 0x2B, 0xC5, 0x22, 0x36, 0x3A, 0x0D, \ - 0xAB, 0xC5, 0x21, 0x97, 0x9B, 0x0D, 0xEA, 0xDA, \ - 0x1D, 0xBF, 0x9A, 0x42, 0xD5, 0xC4, 0x48, 0x4E, \ - 0x0A, 0xBC, 0xD0, 0x6B, 0xFA, 0x53, 0xDD, 0xEF, \ - 0x3C, 0x1B, 0x20, 0xEE, 0x3F, 0xD5, 0x9D, 0x7C, \ - 0x25, 0xE4, 0x1D, 0x2B, 0x66, 0x9E, 0x1E, 0xF1, \ - 0x6E, 0x6F, 0x52, 0xC3, 0x16, 0x4D, 0xF4, 0xFB, \ - 0x79, 0x30, 0xE9, 0xE4, 0xE5, 0x88, 0x57, 0xB6, \ - 0xAC, 0x7D, 0x5F, 0x42, 0xD6, 0x9F, 0x6D, 0x18, \ - 0x77, 0x63, 0xCF, 0x1D, 0x55, 0x03, 0x40, 0x04, \ - 0x87, 0xF5, 0x5B, 0xA5, 0x7E, 0x31, 0xCC, 0x7A, \ - 0x71, 0x35, 0xC8, 0x86, 0xEF, 0xB4, 0x31, 0x8A, \ - 0xED, 0x6A, 0x1E, 0x01, 0x2D, 0x9E, 0x68, 0x32, \ - 0xA9, 0x07, 0x60, 0x0A, 0x91, 0x81, 0x30, 0xC4, \ - 0x6D, 0xC7, 0x78, 0xF9, 0x71, 0xAD, 0x00, 0x38, \ - 0x09, 0x29, 0x99, 0xA3, 0x33, 0xCB, 0x8B, 0x7A, \ - 0x1A, 0x1D, 0xB9, 0x3D, 0x71, 0x40, 0x00, 0x3C, \ - 0x2A, 0x4E, 0xCE, 0xA9, 0xF9, 0x8D, 0x0A, 0xCC, \ - 0x0A, 0x82, 0x91, 0xCD, 0xCE, 0xC9, 0x7D, 0xCF, \ - 0x8E, 0xC9, 0xB5, 0x5A, 0x7F, 0x88, 0xA4, 0x6B, \ - 0x4D, 0xB5, 0xA8, 0x51, 0xF4, 0x41, 0x82, 0xE1, \ - 0xC6, 0x8A, 0x00, 0x7E, 0x5E, 0x0D, 0xD9, 0x02, \ - 0x0B, 0xFD, 0x64, 0xB6, 0x45, 0x03, 0x6C, 0x7A, \ - 0x4E, 0x67, 0x7D, 0x2C, 0x38, 0x53, 0x2A, 0x3A, \ - 0x23, 0xBA, 0x44, 0x42, 0xCA, 0xF5, 0x3E, 0xA6, \ - 0x3B, 0xB4, 0x54, 0x32, 0x9B, 0x76, 0x24, 0xC8, \ - 0x91, 0x7B, 0xDD, 0x64, 0xB1, 0xC0, 0xFD, 0x4C, \ - 0xB3, 0x8E, 0x8C, 0x33, 0x4C, 0x70, 0x1C, 0x3A, \ - 0xCD, 0xAD, 0x06, 0x57, 0xFC, 0xCF, 0xEC, 0x71, \ - 0x9B, 0x1F, 0x5C, 0x3E, 0x4E, 0x46, 0x04, 0x1F, \ - 0x38, 0x81, 0x47, 0xFB, 0x4C, 0xFD, 0xB4, 0x77, \ - 0xA5, 0x24, 0x71, 0xF7, 0xA9, 0xA9, 0x69, 0x10, \ - 0xB8, 0x55, 0x32, 0x2E, 0xDB, 0x63, 0x40, 0xD8, \ - 0xA0, 0x0E, 0xF0, 0x92, 0x35, 0x05, 0x11, 0xE3, \ - 0x0A, 0xBE, 0xC1, 0xFF, 0xF9, 0xE3, 0xA2, 0x6E, \ - 0x7F, 0xB2, 0x9F, 0x8C, 0x18, 0x30, 0x23, 0xC3, \ - 0x58, 0x7E, 0x38, 0xDA, 0x00, 0x77, 0xD9, 0xB4, \ - 0x76, 0x3E, 0x4E, 0x4B, 0x94, 0xB2, 0xBB, 0xC1, \ - 0x94, 0xC6, 0x65, 0x1E, 0x77, 0xCA, 0xF9, 0x92, \ - 0xEE, 0xAA, 0xC0, 0x23, 0x2A, 0x28, 0x1B, 0xF6, \ - 0xB3, 0xA7, 0x39, 0xC1, 0x22, 0x61, 0x16, 0x82, \ - 0x0A, 0xE8, 0xDB, 0x58, 0x47, 0xA6, 0x7C, 0xBE, \ - 0xF9, 0xC9, 0x09, 0x1B, 0x46, 0x2D, 0x53, 0x8C, \ - 0xD7, 0x2B, 0x03, 0x74, 0x6A, 0xE7, 0x7F, 0x5E, \ - 0x62, 0x29, 0x2C, 0x31, 0x15, 0x62, 0xA8, 0x46, \ - 0x50, 0x5D, 0xC8, 0x2D, 0xB8, 0x54, 0x33, 0x8A, \ - 0xE4, 0x9F, 0x52, 0x35, 0xC9, 0x5B, 0x91, 0x17, \ - 0x8C, 0xCF, 0x2D, 0xD5, 0xCA, 0xCE, 0xF4, 0x03, \ - 0xEC, 0x9D, 0x18, 0x10, 0xC6, 0x27, 0x2B, 0x04, \ - 0x5B, 0x3B, 0x71, 0xF9, 0xDC, 0x6B, 0x80, 0xD6, \ - 0x3F, 0xDD, 0x4A, 0x8E, 0x9A, 0xDB, 0x1E, 0x69, \ - 0x62, 0xA6, 0x95, 0x26, 0xD4, 0x31, 0x61, 0xC1, \ - 0xA4, 0x1D, 0x57, 0x0D, 0x79, 0x38, 0xDA, 0xD4, \ - 0xA4, 0x0E, 0x32, 0x9C, 0xCF, 0xF4, 0x6A, 0xAA, \ - 0x36, 0xAD, 0x00, 0x4C, 0xF6, 0x00, 0xC8, 0x38, \ - 0x1E, 0x42, 0x5A, 0x31, 0xD9, 0x51, 0xAE, 0x64, \ - 0xFD, 0xB2, 0x3F, 0xCE, 0xC9, 0x50, 0x9D, 0x43, \ - 0x68, 0x7F, 0xEB, 0x69, 0xED, 0xD1, 0xCC, 0x5E, \ - 0x0B, 0x8C, 0xC3, 0xBD, 0xF6, 0x4B, 0x10, 0xEF, \ - 0x86, 0xB6, 0x31, 0x42, 0xA3, 0xAB, 0x88, 0x29, \ - 0x55, 0x5B, 0x2F, 0x74, 0x7C, 0x93, 0x26, 0x65, \ - 0xCB, 0x2C, 0x0F, 0x1C, 0xC0, 0x1B, 0xD7, 0x02, \ - 0x29, 0x38, 0x88, 0x39, 0xD2, 0xAF, 0x05, 0xE4, \ - 0x54, 0x50, 0x4A, 0xC7, 0x8B, 0x75, 0x82, 0x82, \ - 0x28, 0x46, 0xC0, 0xBA, 0x35, 0xC3, 0x5F, 0x5C, \ - 0x59, 0x16, 0x0C, 0xC0, 0x46, 0xFD, 0x82, 0x51, \ - 0x54, 0x1F, 0xC6, 0x8C, 0x9C, 0x86, 0xB0, 0x22, \ - 0xBB, 0x70, 0x99, 0x87, 0x6A, 0x46, 0x0E, 0x74, \ - 0x51, 0xA8, 0xA9, 0x31, 0x09, 0x70, 0x3F, 0xEE, \ - 0x1C, 0x21, 0x7E, 0x6C, 0x38, 0x26, 0xE5, 0x2C, \ - 0x51, 0xAA, 0x69, 0x1E, 0x0E, 0x42, 0x3C, 0xFC, \ - 0x99, 0xE9, 0xE3, 0x16, 0x50, 0xC1, 0x21, 0x7B, \ - 0x62, 0x48, 0x16, 0xCD, 0xAD, 0x9A, 0x95, 0xF9, \ - 0xD5, 0xB8, 0x01, 0x94, 0x88, 0xD9, 0xC0, 0xA0, \ - 0xA1, 0xFE, 0x30, 0x75, 0xA5, 0x77, 0xE2, 0x31, \ - 0x83, 0xF8, 0x1D, 0x4A, 0x3F, 0x2F, 0xA4, 0x57, \ - 0x1E, 0xFC, 0x8C, 0xE0, 0xBA, 0x8A, 0x4F, 0xE8, \ - 0xB6, 0x85, 0x5D, 0xFE, 0x72, 0xB0, 0xA6, 0x6E, \ - 0xDE, 0xD2, 0xFB, 0xAB, 0xFB, 0xE5, 0x8A, 0x30, \ - 0xFA, 0xFA, 0xBE, 0x1C, 0x5D, 0x71, 0xA8, 0x7E, \ - 0x2F, 0x74, 0x1E, 0xF8, 0xC1, 0xFE, 0x86, 0xFE, \ - 0xA6, 0xBB, 0xFD, 0xE5, 0x30, 0x67, 0x7F, 0x0D, \ - 0x97, 0xD1, 0x1D, 0x49, 0xF7, 0xA8, 0x44, 0x3D, \ - 0x08, 0x22, 0xE5, 0x06, 0xA9, 0xF4, 0x61, 0x4E, \ - 0x01, 0x1E, 0x2A, 0x94, 0x83, 0x8F, 0xF8, 0x8C, \ - 0xD6, 0x8C, 0x8B, 0xB7, 0xC5, 0xC6, 0x42, 0x4C, \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF } - -#define MBEDTLS_DHM_RFC7919_FFDHE8192_G_BIN { 0x02 } - -#endif /* dhm.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/ecdh.h b/tools/sdk/include/mbedtls/mbedtls/ecdh.h deleted file mode 100644 index 95f39805c6d..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/ecdh.h +++ /dev/null @@ -1,280 +0,0 @@ -/** - * \file ecdh.h - * - * \brief This file contains ECDH definitions and functions. - * - * The Elliptic Curve Diffie-Hellman (ECDH) protocol is an anonymous - * key agreement protocol allowing two parties to establish a shared - * secret over an insecure channel. Each party must have an - * elliptic-curve public–private key pair. - * - * For more information, see NIST SP 800-56A Rev. 2: Recommendation for - * Pair-Wise Key Establishment Schemes Using Discrete Logarithm - * Cryptography. - */ -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_ECDH_H -#define MBEDTLS_ECDH_H - -#include "ecp.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Defines the source of the imported EC key. - */ -typedef enum -{ - MBEDTLS_ECDH_OURS, /**< Our key. */ - MBEDTLS_ECDH_THEIRS, /**< The key of the peer. */ -} mbedtls_ecdh_side; - -/** - * \brief The ECDH context structure. - */ -typedef struct mbedtls_ecdh_context -{ - mbedtls_ecp_group grp; /*!< The elliptic curve used. */ - mbedtls_mpi d; /*!< The private key. */ - mbedtls_ecp_point Q; /*!< The public key. */ - mbedtls_ecp_point Qp; /*!< The value of the public key of the peer. */ - mbedtls_mpi z; /*!< The shared secret. */ - int point_format; /*!< The format of point export in TLS messages. */ - mbedtls_ecp_point Vi; /*!< The blinding value. */ - mbedtls_ecp_point Vf; /*!< The unblinding value. */ - mbedtls_mpi _d; /*!< The previous \p d. */ -} -mbedtls_ecdh_context; - -/** - * \brief This function generates an ECDH keypair on an elliptic - * curve. - * - * This function performs the first of two core computations - * implemented during the ECDH key exchange. The second core - * computation is performed by mbedtls_ecdh_compute_shared(). - * - * \see ecp.h - * - * \param grp The ECP group. - * \param d The destination MPI (private key). - * \param Q The destination point (public key). - * \param f_rng The RNG function. - * \param p_rng The RNG context. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX or - * \c MBEDTLS_MPI_XXX error code on failure. - * - */ -int mbedtls_ecdh_gen_public( mbedtls_ecp_group *grp, mbedtls_mpi *d, mbedtls_ecp_point *Q, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief This function computes the shared secret. - * - * This function performs the second of two core computations - * implemented during the ECDH key exchange. The first core - * computation is performed by mbedtls_ecdh_gen_public(). - * - * \see ecp.h - * - * \note If \p f_rng is not NULL, it is used to implement - * countermeasures against side-channel attacks. - * For more information, see mbedtls_ecp_mul(). - * - * \param grp The ECP group. - * \param z The destination MPI (shared secret). - * \param Q The public key from another party. - * \param d Our secret exponent (private key). - * \param f_rng The RNG function. - * \param p_rng The RNG context. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX or - * \c MBEDTLS_MPI_XXX error code on failure. - */ -int mbedtls_ecdh_compute_shared( mbedtls_ecp_group *grp, mbedtls_mpi *z, - const mbedtls_ecp_point *Q, const mbedtls_mpi *d, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief This function initializes an ECDH context. - * - * \param ctx The ECDH context to initialize. - */ -void mbedtls_ecdh_init( mbedtls_ecdh_context *ctx ); - -/** - * \brief This function frees a context. - * - * \param ctx The context to free. - */ -void mbedtls_ecdh_free( mbedtls_ecdh_context *ctx ); - -/** - * \brief This function generates a public key and a TLS - * ServerKeyExchange payload. - * - * This is the first function used by a TLS server for ECDHE - * ciphersuites. - * - * \note This function assumes that the ECP group (grp) of the - * \p ctx context has already been properly set, - * for example, using mbedtls_ecp_group_load(). - * - * \see ecp.h - * - * \param ctx The ECDH context. - * \param olen The number of characters written. - * \param buf The destination buffer. - * \param blen The length of the destination buffer. - * \param f_rng The RNG function. - * \param p_rng The RNG context. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX error code on failure. - */ -int mbedtls_ecdh_make_params( mbedtls_ecdh_context *ctx, size_t *olen, - unsigned char *buf, size_t blen, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief This function parses and processes a TLS ServerKeyExhange - * payload. - * - * This is the first function used by a TLS client for ECDHE - * ciphersuites. - * - * \see ecp.h - * - * \param ctx The ECDH context. - * \param buf The pointer to the start of the input buffer. - * \param end The address for one Byte past the end of the buffer. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX error code on failure. - * - */ -int mbedtls_ecdh_read_params( mbedtls_ecdh_context *ctx, - const unsigned char **buf, const unsigned char *end ); - -/** - * \brief This function sets up an ECDH context from an EC key. - * - * It is used by clients and servers in place of the - * ServerKeyEchange for static ECDH, and imports ECDH - * parameters from the EC key information of a certificate. - * - * \see ecp.h - * - * \param ctx The ECDH context to set up. - * \param key The EC key to use. - * \param side Defines the source of the key: 1: Our key, or - * 0: The key of the peer. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX error code on failure. - * - */ -int mbedtls_ecdh_get_params( mbedtls_ecdh_context *ctx, const mbedtls_ecp_keypair *key, - mbedtls_ecdh_side side ); - -/** - * \brief This function generates a public key and a TLS - * ClientKeyExchange payload. - * - * This is the second function used by a TLS client for ECDH(E) - * ciphersuites. - * - * \see ecp.h - * - * \param ctx The ECDH context. - * \param olen The number of Bytes written. - * \param buf The destination buffer. - * \param blen The size of the destination buffer. - * \param f_rng The RNG function. - * \param p_rng The RNG context. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX error code on failure. - */ -int mbedtls_ecdh_make_public( mbedtls_ecdh_context *ctx, size_t *olen, - unsigned char *buf, size_t blen, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief This function parses and processes a TLS ClientKeyExchange - * payload. - * - * This is the second function used by a TLS server for ECDH(E) - * ciphersuites. - * - * \see ecp.h - * - * \param ctx The ECDH context. - * \param buf The start of the input buffer. - * \param blen The length of the input buffer. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX error code on failure. - */ -int mbedtls_ecdh_read_public( mbedtls_ecdh_context *ctx, - const unsigned char *buf, size_t blen ); - -/** - * \brief This function derives and exports the shared secret. - * - * This is the last function used by both TLS client - * and servers. - * - * \note If \p f_rng is not NULL, it is used to implement - * countermeasures against side-channel attacks. - * For more information, see mbedtls_ecp_mul(). - * - * \see ecp.h - * - * \param ctx The ECDH context. - * \param olen The number of Bytes written. - * \param buf The destination buffer. - * \param blen The length of the destination buffer. - * \param f_rng The RNG function. - * \param p_rng The RNG context. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX error code on failure. - */ -int mbedtls_ecdh_calc_secret( mbedtls_ecdh_context *ctx, size_t *olen, - unsigned char *buf, size_t blen, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -#ifdef __cplusplus -} -#endif - -#endif /* ecdh.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/ecdsa.h b/tools/sdk/include/mbedtls/mbedtls/ecdsa.h deleted file mode 100644 index ce1a03d7913..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/ecdsa.h +++ /dev/null @@ -1,339 +0,0 @@ -/** - * \file ecdsa.h - * - * \brief This file contains ECDSA definitions and functions. - * - * The Elliptic Curve Digital Signature Algorithm (ECDSA) is defined in - * Standards for Efficient Cryptography Group (SECG): - * SEC1 Elliptic Curve Cryptography. - * The use of ECDSA for TLS is defined in RFC-4492: Elliptic Curve - * Cryptography (ECC) Cipher Suites for Transport Layer Security (TLS). - * - */ -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_ECDSA_H -#define MBEDTLS_ECDSA_H - -#include "ecp.h" -#include "md.h" - -/* - * RFC-4492 page 20: - * - * Ecdsa-Sig-Value ::= SEQUENCE { - * r INTEGER, - * s INTEGER - * } - * - * Size is at most - * 1 (tag) + 1 (len) + 1 (initial 0) + ECP_MAX_BYTES for each of r and s, - * twice that + 1 (tag) + 2 (len) for the sequence - * (assuming ECP_MAX_BYTES is less than 126 for r and s, - * and less than 124 (total len <= 255) for the sequence) - */ -#if MBEDTLS_ECP_MAX_BYTES > 124 -#error "MBEDTLS_ECP_MAX_BYTES bigger than expected, please fix MBEDTLS_ECDSA_MAX_LEN" -#endif -/** The maximal size of an ECDSA signature in Bytes. */ -#define MBEDTLS_ECDSA_MAX_LEN ( 3 + 2 * ( 3 + MBEDTLS_ECP_MAX_BYTES ) ) - -/** - * \brief The ECDSA context structure. - */ -typedef mbedtls_ecp_keypair mbedtls_ecdsa_context; - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief This function computes the ECDSA signature of a - * previously-hashed message. - * - * \note The deterministic version is usually preferred. - * - * \note If the bitlength of the message hash is larger than the - * bitlength of the group order, then the hash is truncated - * as defined in Standards for Efficient Cryptography Group - * (SECG): SEC1 Elliptic Curve Cryptography, section - * 4.1.3, step 5. - * - * \see ecp.h - * - * \param grp The ECP group. - * \param r The first output integer. - * \param s The second output integer. - * \param d The private signing key. - * \param buf The message hash. - * \param blen The length of \p buf. - * \param f_rng The RNG function. - * \param p_rng The RNG context. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX - * or \c MBEDTLS_MPI_XXX error code on failure. - */ -int mbedtls_ecdsa_sign( mbedtls_ecp_group *grp, mbedtls_mpi *r, mbedtls_mpi *s, - const mbedtls_mpi *d, const unsigned char *buf, size_t blen, - int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ); - -#if defined(MBEDTLS_ECDSA_DETERMINISTIC) -/** - * \brief This function computes the ECDSA signature of a - * previously-hashed message, deterministic version. - * - * For more information, see RFC-6979: Deterministic - * Usage of the Digital Signature Algorithm (DSA) and Elliptic - * Curve Digital Signature Algorithm (ECDSA). - * - * \note If the bitlength of the message hash is larger than the - * bitlength of the group order, then the hash is truncated as - * defined in Standards for Efficient Cryptography Group - * (SECG): SEC1 Elliptic Curve Cryptography, section - * 4.1.3, step 5. - * - * \see ecp.h - * - * \param grp The ECP group. - * \param r The first output integer. - * \param s The second output integer. - * \param d The private signing key. - * \param buf The message hash. - * \param blen The length of \p buf. - * \param md_alg The MD algorithm used to hash the message. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX - * error code on failure. - */ -int mbedtls_ecdsa_sign_det( mbedtls_ecp_group *grp, mbedtls_mpi *r, mbedtls_mpi *s, - const mbedtls_mpi *d, const unsigned char *buf, size_t blen, - mbedtls_md_type_t md_alg ); -#endif /* MBEDTLS_ECDSA_DETERMINISTIC */ - -/** - * \brief This function verifies the ECDSA signature of a - * previously-hashed message. - * - * \note If the bitlength of the message hash is larger than the - * bitlength of the group order, then the hash is truncated as - * defined in Standards for Efficient Cryptography Group - * (SECG): SEC1 Elliptic Curve Cryptography, section - * 4.1.4, step 3. - * - * \see ecp.h - * - * \param grp The ECP group. - * \param buf The message hash. - * \param blen The length of \p buf. - * \param Q The public key to use for verification. - * \param r The first integer of the signature. - * \param s The second integer of the signature. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if the signature - * is invalid. - * \return An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX - * error code on failure for any other reason. - */ -int mbedtls_ecdsa_verify( mbedtls_ecp_group *grp, - const unsigned char *buf, size_t blen, - const mbedtls_ecp_point *Q, const mbedtls_mpi *r, const mbedtls_mpi *s); - -/** - * \brief This function computes the ECDSA signature and writes it - * to a buffer, serialized as defined in RFC-4492: - * Elliptic Curve Cryptography (ECC) Cipher Suites for - * Transport Layer Security (TLS). - * - * \warning It is not thread-safe to use the same context in - * multiple threads. - * - * \note The deterministic version is used if - * #MBEDTLS_ECDSA_DETERMINISTIC is defined. For more - * information, see RFC-6979: Deterministic Usage - * of the Digital Signature Algorithm (DSA) and Elliptic - * Curve Digital Signature Algorithm (ECDSA). - * - * \note The \p sig buffer must be at least twice as large as the - * size of the curve used, plus 9. For example, 73 Bytes if - * a 256-bit curve is used. A buffer length of - * #MBEDTLS_ECDSA_MAX_LEN is always safe. - * - * \note If the bitlength of the message hash is larger than the - * bitlength of the group order, then the hash is truncated as - * defined in Standards for Efficient Cryptography Group - * (SECG): SEC1 Elliptic Curve Cryptography, section - * 4.1.3, step 5. - * - * \see ecp.h - * - * \param ctx The ECDSA context. - * \param md_alg The message digest that was used to hash the message. - * \param hash The message hash. - * \param hlen The length of the hash. - * \param sig The buffer that holds the signature. - * \param slen The length of the signature written. - * \param f_rng The RNG function. - * \param p_rng The RNG context. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX, \c MBEDTLS_ERR_MPI_XXX or - * \c MBEDTLS_ERR_ASN1_XXX error code on failure. - */ -int mbedtls_ecdsa_write_signature( mbedtls_ecdsa_context *ctx, mbedtls_md_type_t md_alg, - const unsigned char *hash, size_t hlen, - unsigned char *sig, size_t *slen, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -#if defined(MBEDTLS_ECDSA_DETERMINISTIC) -#if ! defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief This function computes an ECDSA signature and writes - * it to a buffer, serialized as defined in RFC-4492: - * Elliptic Curve Cryptography (ECC) Cipher Suites for - * Transport Layer Security (TLS). - * - * The deterministic version is defined in RFC-6979: - * Deterministic Usage of the Digital Signature Algorithm (DSA) - * and Elliptic Curve Digital Signature Algorithm (ECDSA). - * - * \warning It is not thread-safe to use the same context in - * multiple threads. - * - * \note The \p sig buffer must be at least twice as large as the - * size of the curve used, plus 9. For example, 73 Bytes if a - * 256-bit curve is used. A buffer length of - * #MBEDTLS_ECDSA_MAX_LEN is always safe. - * - * \note If the bitlength of the message hash is larger than the - * bitlength of the group order, then the hash is truncated as - * defined in Standards for Efficient Cryptography Group - * (SECG): SEC1 Elliptic Curve Cryptography, section - * 4.1.3, step 5. - * - * \see ecp.h - * - * \deprecated Superseded by mbedtls_ecdsa_write_signature() in - * Mbed TLS version 2.0 and later. - * - * \param ctx The ECDSA context. - * \param hash The message hash. - * \param hlen The length of the hash. - * \param sig The buffer that holds the signature. - * \param slen The length of the signature written. - * \param md_alg The MD algorithm used to hash the message. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX, \c MBEDTLS_ERR_MPI_XXX or - * \c MBEDTLS_ERR_ASN1_XXX error code on failure. - */ -int mbedtls_ecdsa_write_signature_det( mbedtls_ecdsa_context *ctx, - const unsigned char *hash, size_t hlen, - unsigned char *sig, size_t *slen, - mbedtls_md_type_t md_alg ) MBEDTLS_DEPRECATED; -#undef MBEDTLS_DEPRECATED -#endif /* MBEDTLS_DEPRECATED_REMOVED */ -#endif /* MBEDTLS_ECDSA_DETERMINISTIC */ - -/** - * \brief This function reads and verifies an ECDSA signature. - * - * \note If the bitlength of the message hash is larger than the - * bitlength of the group order, then the hash is truncated as - * defined in Standards for Efficient Cryptography Group - * (SECG): SEC1 Elliptic Curve Cryptography, section - * 4.1.4, step 3. - * - * \see ecp.h - * - * \param ctx The ECDSA context. - * \param hash The message hash. - * \param hlen The size of the hash. - * \param sig The signature to read and verify. - * \param slen The size of \p sig. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if signature is invalid. - * \return #MBEDTLS_ERR_ECP_SIG_LEN_MISMATCH if there is a valid - * signature in \p sig, but its length is less than \p siglen. - * \return An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_ERR_MPI_XXX - * error code on failure for any other reason. - */ -int mbedtls_ecdsa_read_signature( mbedtls_ecdsa_context *ctx, - const unsigned char *hash, size_t hlen, - const unsigned char *sig, size_t slen ); - -/** - * \brief This function generates an ECDSA keypair on the given curve. - * - * \see ecp.h - * - * \param ctx The ECDSA context to store the keypair in. - * \param gid The elliptic curve to use. One of the various - * \c MBEDTLS_ECP_DP_XXX macros depending on configuration. - * \param f_rng The RNG function. - * \param p_rng The RNG context. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX code on failure. - */ -int mbedtls_ecdsa_genkey( mbedtls_ecdsa_context *ctx, mbedtls_ecp_group_id gid, - int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ); - -/** - * \brief This function sets an ECDSA context from an EC key pair. - * - * \see ecp.h - * - * \param ctx The ECDSA context to set. - * \param key The EC key to use. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX code on failure. - */ -int mbedtls_ecdsa_from_keypair( mbedtls_ecdsa_context *ctx, const mbedtls_ecp_keypair *key ); - -/** - * \brief This function initializes an ECDSA context. - * - * \param ctx The ECDSA context to initialize. - */ -void mbedtls_ecdsa_init( mbedtls_ecdsa_context *ctx ); - -/** - * \brief This function frees an ECDSA context. - * - * \param ctx The ECDSA context to free. - */ -void mbedtls_ecdsa_free( mbedtls_ecdsa_context *ctx ); - -#ifdef __cplusplus -} -#endif - -#endif /* ecdsa.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/ecjpake.h b/tools/sdk/include/mbedtls/mbedtls/ecjpake.h deleted file mode 100644 index 59d12f080fd..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/ecjpake.h +++ /dev/null @@ -1,249 +0,0 @@ -/** - * \file ecjpake.h - * - * \brief Elliptic curve J-PAKE - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_ECJPAKE_H -#define MBEDTLS_ECJPAKE_H - -/* - * J-PAKE is a password-authenticated key exchange that allows deriving a - * strong shared secret from a (potentially low entropy) pre-shared - * passphrase, with forward secrecy and mutual authentication. - * https://en.wikipedia.org/wiki/Password_Authenticated_Key_Exchange_by_Juggling - * - * This file implements the Elliptic Curve variant of J-PAKE, - * as defined in Chapter 7.4 of the Thread v1.0 Specification, - * available to members of the Thread Group http://threadgroup.org/ - * - * As the J-PAKE algorithm is inherently symmetric, so is our API. - * Each party needs to send its first round message, in any order, to the - * other party, then each sends its second round message, in any order. - * The payloads are serialized in a way suitable for use in TLS, but could - * also be use outside TLS. - */ - -#include "ecp.h" -#include "md.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Roles in the EC J-PAKE exchange - */ -typedef enum { - MBEDTLS_ECJPAKE_CLIENT = 0, /**< Client */ - MBEDTLS_ECJPAKE_SERVER, /**< Server */ -} mbedtls_ecjpake_role; - -#if !defined(MBEDTLS_ECJPAKE_ALT) -/** - * EC J-PAKE context structure. - * - * J-PAKE is a symmetric protocol, except for the identifiers used in - * Zero-Knowledge Proofs, and the serialization of the second message - * (KeyExchange) as defined by the Thread spec. - * - * In order to benefit from this symmetry, we choose a different naming - * convetion from the Thread v1.0 spec. Correspondance is indicated in the - * description as a pair C: client name, S: server name - */ -typedef struct mbedtls_ecjpake_context -{ - const mbedtls_md_info_t *md_info; /**< Hash to use */ - mbedtls_ecp_group grp; /**< Elliptic curve */ - mbedtls_ecjpake_role role; /**< Are we client or server? */ - int point_format; /**< Format for point export */ - - mbedtls_ecp_point Xm1; /**< My public key 1 C: X1, S: X3 */ - mbedtls_ecp_point Xm2; /**< My public key 2 C: X2, S: X4 */ - mbedtls_ecp_point Xp1; /**< Peer public key 1 C: X3, S: X1 */ - mbedtls_ecp_point Xp2; /**< Peer public key 2 C: X4, S: X2 */ - mbedtls_ecp_point Xp; /**< Peer public key C: Xs, S: Xc */ - - mbedtls_mpi xm1; /**< My private key 1 C: x1, S: x3 */ - mbedtls_mpi xm2; /**< My private key 2 C: x2, S: x4 */ - - mbedtls_mpi s; /**< Pre-shared secret (passphrase) */ -} mbedtls_ecjpake_context; - -#else /* MBEDTLS_ECJPAKE_ALT */ -#include "ecjpake_alt.h" -#endif /* MBEDTLS_ECJPAKE_ALT */ - -/** - * \brief Initialize a context - * (just makes it ready for setup() or free()). - * - * \param ctx context to initialize - */ -void mbedtls_ecjpake_init( mbedtls_ecjpake_context *ctx ); - -/** - * \brief Set up a context for use - * - * \note Currently the only values for hash/curve allowed by the - * standard are MBEDTLS_MD_SHA256/MBEDTLS_ECP_DP_SECP256R1. - * - * \param ctx context to set up - * \param role Our role: client or server - * \param hash hash function to use (MBEDTLS_MD_XXX) - * \param curve elliptic curve identifier (MBEDTLS_ECP_DP_XXX) - * \param secret pre-shared secret (passphrase) - * \param len length of the shared secret - * - * \return 0 if successfull, - * a negative error code otherwise - */ -int mbedtls_ecjpake_setup( mbedtls_ecjpake_context *ctx, - mbedtls_ecjpake_role role, - mbedtls_md_type_t hash, - mbedtls_ecp_group_id curve, - const unsigned char *secret, - size_t len ); - -/** - * \brief Check if a context is ready for use - * - * \param ctx Context to check - * - * \return 0 if the context is ready for use, - * MBEDTLS_ERR_ECP_BAD_INPUT_DATA otherwise - */ -int mbedtls_ecjpake_check( const mbedtls_ecjpake_context *ctx ); - -/** - * \brief Generate and write the first round message - * (TLS: contents of the Client/ServerHello extension, - * excluding extension type and length bytes) - * - * \param ctx Context to use - * \param buf Buffer to write the contents to - * \param len Buffer size - * \param olen Will be updated with the number of bytes written - * \param f_rng RNG function - * \param p_rng RNG parameter - * - * \return 0 if successfull, - * a negative error code otherwise - */ -int mbedtls_ecjpake_write_round_one( mbedtls_ecjpake_context *ctx, - unsigned char *buf, size_t len, size_t *olen, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief Read and process the first round message - * (TLS: contents of the Client/ServerHello extension, - * excluding extension type and length bytes) - * - * \param ctx Context to use - * \param buf Pointer to extension contents - * \param len Extension length - * - * \return 0 if successfull, - * a negative error code otherwise - */ -int mbedtls_ecjpake_read_round_one( mbedtls_ecjpake_context *ctx, - const unsigned char *buf, - size_t len ); - -/** - * \brief Generate and write the second round message - * (TLS: contents of the Client/ServerKeyExchange) - * - * \param ctx Context to use - * \param buf Buffer to write the contents to - * \param len Buffer size - * \param olen Will be updated with the number of bytes written - * \param f_rng RNG function - * \param p_rng RNG parameter - * - * \return 0 if successfull, - * a negative error code otherwise - */ -int mbedtls_ecjpake_write_round_two( mbedtls_ecjpake_context *ctx, - unsigned char *buf, size_t len, size_t *olen, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief Read and process the second round message - * (TLS: contents of the Client/ServerKeyExchange) - * - * \param ctx Context to use - * \param buf Pointer to the message - * \param len Message length - * - * \return 0 if successfull, - * a negative error code otherwise - */ -int mbedtls_ecjpake_read_round_two( mbedtls_ecjpake_context *ctx, - const unsigned char *buf, - size_t len ); - -/** - * \brief Derive the shared secret - * (TLS: Pre-Master Secret) - * - * \param ctx Context to use - * \param buf Buffer to write the contents to - * \param len Buffer size - * \param olen Will be updated with the number of bytes written - * \param f_rng RNG function - * \param p_rng RNG parameter - * - * \return 0 if successfull, - * a negative error code otherwise - */ -int mbedtls_ecjpake_derive_secret( mbedtls_ecjpake_context *ctx, - unsigned char *buf, size_t len, size_t *olen, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief Free a context's content - * - * \param ctx context to free - */ -void mbedtls_ecjpake_free( mbedtls_ecjpake_context *ctx ); - - - -#if defined(MBEDTLS_SELF_TEST) - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if a test failed - */ -int mbedtls_ecjpake_self_test( int verbose ); - -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - - -#endif /* ecjpake.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/ecp.h b/tools/sdk/include/mbedtls/mbedtls/ecp.h deleted file mode 100644 index ed1b9d73681..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/ecp.h +++ /dev/null @@ -1,764 +0,0 @@ -/** - * \file ecp.h - * - * \brief This file provides an API for Elliptic Curves over GF(P) (ECP). - * - * The use of ECP in cryptography and TLS is defined in - * Standards for Efficient Cryptography Group (SECG): SEC1 - * Elliptic Curve Cryptography and - * RFC-4492: Elliptic Curve Cryptography (ECC) Cipher Suites - * for Transport Layer Security (TLS). - * - * RFC-2409: The Internet Key Exchange (IKE) defines ECP - * group types. - * - */ - -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_ECP_H -#define MBEDTLS_ECP_H - -#include "bignum.h" - -/* - * ECP error codes - */ -#define MBEDTLS_ERR_ECP_BAD_INPUT_DATA -0x4F80 /**< Bad input parameters to function. */ -#define MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL -0x4F00 /**< The buffer is too small to write to. */ -#define MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE -0x4E80 /**< The requested feature is not available, for example, the requested curve is not supported. */ -#define MBEDTLS_ERR_ECP_VERIFY_FAILED -0x4E00 /**< The signature is not valid. */ -#define MBEDTLS_ERR_ECP_ALLOC_FAILED -0x4D80 /**< Memory allocation failed. */ -#define MBEDTLS_ERR_ECP_RANDOM_FAILED -0x4D00 /**< Generation of random value, such as ephemeral key, failed. */ -#define MBEDTLS_ERR_ECP_INVALID_KEY -0x4C80 /**< Invalid private or public key. */ -#define MBEDTLS_ERR_ECP_SIG_LEN_MISMATCH -0x4C00 /**< The buffer contains a valid signature followed by more data. */ -#define MBEDTLS_ERR_ECP_HW_ACCEL_FAILED -0x4B80 /**< The ECP hardware accelerator failed. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Domain-parameter identifiers: curve, subgroup, and generator. - * - * \note Only curves over prime fields are supported. - * - * \warning This library does not support validation of arbitrary domain - * parameters. Therefore, only standardized domain parameters from trusted - * sources should be used. See mbedtls_ecp_group_load(). - */ -typedef enum -{ - MBEDTLS_ECP_DP_NONE = 0, /*!< Curve not defined. */ - MBEDTLS_ECP_DP_SECP192R1, /*!< Domain parameters for the 192-bit curve defined by FIPS 186-4 and SEC1. */ - MBEDTLS_ECP_DP_SECP224R1, /*!< Domain parameters for the 224-bit curve defined by FIPS 186-4 and SEC1. */ - MBEDTLS_ECP_DP_SECP256R1, /*!< Domain parameters for the 256-bit curve defined by FIPS 186-4 and SEC1. */ - MBEDTLS_ECP_DP_SECP384R1, /*!< Domain parameters for the 384-bit curve defined by FIPS 186-4 and SEC1. */ - MBEDTLS_ECP_DP_SECP521R1, /*!< Domain parameters for the 521-bit curve defined by FIPS 186-4 and SEC1. */ - MBEDTLS_ECP_DP_BP256R1, /*!< Domain parameters for 256-bit Brainpool curve. */ - MBEDTLS_ECP_DP_BP384R1, /*!< Domain parameters for 384-bit Brainpool curve. */ - MBEDTLS_ECP_DP_BP512R1, /*!< Domain parameters for 512-bit Brainpool curve. */ - MBEDTLS_ECP_DP_CURVE25519, /*!< Domain parameters for Curve25519. */ - MBEDTLS_ECP_DP_SECP192K1, /*!< Domain parameters for 192-bit "Koblitz" curve. */ - MBEDTLS_ECP_DP_SECP224K1, /*!< Domain parameters for 224-bit "Koblitz" curve. */ - MBEDTLS_ECP_DP_SECP256K1, /*!< Domain parameters for 256-bit "Koblitz" curve. */ - MBEDTLS_ECP_DP_CURVE448, /*!< Domain parameters for Curve448. */ -} mbedtls_ecp_group_id; - -/** - * The number of supported curves, plus one for #MBEDTLS_ECP_DP_NONE. - * - * \note Montgomery curves are currently excluded. - */ -#define MBEDTLS_ECP_DP_MAX 12 - -/** - * Curve information, for use by other modules. - */ -typedef struct mbedtls_ecp_curve_info -{ - mbedtls_ecp_group_id grp_id; /*!< An internal identifier. */ - uint16_t tls_id; /*!< The TLS NamedCurve identifier. */ - uint16_t bit_size; /*!< The curve size in bits. */ - const char *name; /*!< A human-friendly name. */ -} mbedtls_ecp_curve_info; - -/** - * \brief The ECP point structure, in Jacobian coordinates. - * - * \note All functions expect and return points satisfying - * the following condition: Z == 0 or - * Z == 1. Other values of \p Z are - * used only by internal functions. - * The point is zero, or "at infinity", if Z == 0. - * Otherwise, \p X and \p Y are its standard (affine) - * coordinates. - */ -typedef struct mbedtls_ecp_point -{ - mbedtls_mpi X; /*!< The X coordinate of the ECP point. */ - mbedtls_mpi Y; /*!< The Y coordinate of the ECP point. */ - mbedtls_mpi Z; /*!< The Z coordinate of the ECP point. */ -} -mbedtls_ecp_point; - -#if !defined(MBEDTLS_ECP_ALT) -/* - * default mbed TLS elliptic curve arithmetic implementation - * - * (in case MBEDTLS_ECP_ALT is defined then the developer has to provide an - * alternative implementation for the whole module and it will replace this - * one.) - */ - -/** - * \brief The ECP group structure. - * - * We consider two types of curve equations: - *
  • Short Weierstrass: y^2 = x^3 + A x + B mod P - * (SEC1 + RFC-4492)
  • - *
  • Montgomery: y^2 = x^3 + A x^2 + x mod P (Curve25519, - * Curve448)
- * In both cases, the generator (\p G) for a prime-order subgroup is fixed. - * - * For Short Weierstrass, this subgroup is the whole curve, and its - * cardinality is denoted by \p N. Our code requires that \p N is an - * odd prime as mbedtls_ecp_mul() requires an odd number, and - * mbedtls_ecdsa_sign() requires that it is prime for blinding purposes. - * - * For Montgomery curves, we do not store \p A, but (A + 2) / 4, - * which is the quantity used in the formulas. Additionally, \p nbits is - * not the size of \p N but the required size for private keys. - * - * If \p modp is NULL, reduction modulo \p P is done using a generic algorithm. - * Otherwise, \p modp must point to a function that takes an \p mbedtls_mpi in the - * range of 0..2^(2*pbits)-1, and transforms it in-place to an integer - * which is congruent mod \p P to the given MPI, and is close enough to \p pbits - * in size, so that it may be efficiently brought in the 0..P-1 range by a few - * additions or subtractions. Therefore, it is only an approximative modular - * reduction. It must return 0 on success and non-zero on failure. - * - */ -typedef struct mbedtls_ecp_group -{ - mbedtls_ecp_group_id id; /*!< An internal group identifier. */ - mbedtls_mpi P; /*!< The prime modulus of the base field. */ - mbedtls_mpi A; /*!< For Short Weierstrass: \p A in the equation. For - Montgomery curves: (A + 2) / 4. */ - mbedtls_mpi B; /*!< For Short Weierstrass: \p B in the equation. - For Montgomery curves: unused. */ - mbedtls_ecp_point G; /*!< The generator of the subgroup used. */ - mbedtls_mpi N; /*!< The order of \p G. */ - size_t pbits; /*!< The number of bits in \p P.*/ - size_t nbits; /*!< For Short Weierstrass: The number of bits in \p P. - For Montgomery curves: the number of bits in the - private keys. */ - unsigned int h; /*!< \internal 1 if the constants are static. */ - int (*modp)(mbedtls_mpi *); /*!< The function for fast pseudo-reduction - mod \p P (see above).*/ - int (*t_pre)(mbedtls_ecp_point *, void *); /*!< Unused. */ - int (*t_post)(mbedtls_ecp_point *, void *); /*!< Unused. */ - void *t_data; /*!< Unused. */ - mbedtls_ecp_point *T; /*!< Pre-computed points for ecp_mul_comb(). */ - size_t T_size; /*!< The number of pre-computed points. */ -} -mbedtls_ecp_group; - -/** - * \name SECTION: Module settings - * - * The configuration options you can set for this module are in this section. - * Either change them in config.h, or define them using the compiler command line. - * \{ - */ - -#if !defined(MBEDTLS_ECP_MAX_BITS) -/** - * The maximum size of the groups, that is, of \c N and \c P. - */ -#define MBEDTLS_ECP_MAX_BITS 521 /**< The maximum size of groups, in bits. */ -#endif - -#define MBEDTLS_ECP_MAX_BYTES ( ( MBEDTLS_ECP_MAX_BITS + 7 ) / 8 ) -#define MBEDTLS_ECP_MAX_PT_LEN ( 2 * MBEDTLS_ECP_MAX_BYTES + 1 ) - -#if !defined(MBEDTLS_ECP_WINDOW_SIZE) -/* - * Maximum "window" size used for point multiplication. - * Default: 6. - * Minimum value: 2. Maximum value: 7. - * - * Result is an array of at most ( 1 << ( MBEDTLS_ECP_WINDOW_SIZE - 1 ) ) - * points used for point multiplication. This value is directly tied to EC - * peak memory usage, so decreasing it by one should roughly cut memory usage - * by two (if large curves are in use). - * - * Reduction in size may reduce speed, but larger curves are impacted first. - * Sample performances (in ECDHE handshakes/s, with FIXED_POINT_OPTIM = 1): - * w-size: 6 5 4 3 2 - * 521 145 141 135 120 97 - * 384 214 209 198 177 146 - * 256 320 320 303 262 226 - * 224 475 475 453 398 342 - * 192 640 640 633 587 476 - */ -#define MBEDTLS_ECP_WINDOW_SIZE 6 /**< The maximum window size used. */ -#endif /* MBEDTLS_ECP_WINDOW_SIZE */ - -#if !defined(MBEDTLS_ECP_FIXED_POINT_OPTIM) -/* - * Trade memory for speed on fixed-point multiplication. - * - * This speeds up repeated multiplication of the generator (that is, the - * multiplication in ECDSA signatures, and half of the multiplications in - * ECDSA verification and ECDHE) by a factor roughly 3 to 4. - * - * The cost is increasing EC peak memory usage by a factor roughly 2. - * - * Change this value to 0 to reduce peak memory usage. - */ -#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 /**< Enable fixed-point speed-up. */ -#endif /* MBEDTLS_ECP_FIXED_POINT_OPTIM */ - -/* \} name SECTION: Module settings */ - -#else /* MBEDTLS_ECP_ALT */ -#include "ecp_alt.h" -#endif /* MBEDTLS_ECP_ALT */ - -/** - * \brief The ECP key-pair structure. - * - * A generic key-pair that may be used for ECDSA and fixed ECDH, for example. - * - * \note Members are deliberately in the same order as in the - * ::mbedtls_ecdsa_context structure. - */ -typedef struct mbedtls_ecp_keypair -{ - mbedtls_ecp_group grp; /*!< Elliptic curve and base point */ - mbedtls_mpi d; /*!< our secret value */ - mbedtls_ecp_point Q; /*!< our public value */ -} -mbedtls_ecp_keypair; - -/* - * Point formats, from RFC 4492's enum ECPointFormat - */ -#define MBEDTLS_ECP_PF_UNCOMPRESSED 0 /**< Uncompressed point format. */ -#define MBEDTLS_ECP_PF_COMPRESSED 1 /**< Compressed point format. */ - -/* - * Some other constants from RFC 4492 - */ -#define MBEDTLS_ECP_TLS_NAMED_CURVE 3 /**< The named_curve of ECCurveType. */ - -/** - * \brief This function retrieves the information defined in - * mbedtls_ecp_curve_info() for all supported curves in order - * of preference. - * - * \return A statically allocated array. The last entry is 0. - */ -const mbedtls_ecp_curve_info *mbedtls_ecp_curve_list( void ); - -/** - * \brief This function retrieves the list of internal group - * identifiers of all supported curves in the order of - * preference. - * - * \return A statically allocated array, - * terminated with MBEDTLS_ECP_DP_NONE. - */ -const mbedtls_ecp_group_id *mbedtls_ecp_grp_id_list( void ); - -/** - * \brief This function retrieves curve information from an internal - * group identifier. - * - * \param grp_id An \c MBEDTLS_ECP_DP_XXX value. - * - * \return The associated curve information on success. - * \return NULL on failure. - */ -const mbedtls_ecp_curve_info *mbedtls_ecp_curve_info_from_grp_id( mbedtls_ecp_group_id grp_id ); - -/** - * \brief This function retrieves curve information from a TLS - * NamedCurve value. - * - * \param tls_id An \c MBEDTLS_ECP_DP_XXX value. - * - * \return The associated curve information on success. - * \return NULL on failure. - */ -const mbedtls_ecp_curve_info *mbedtls_ecp_curve_info_from_tls_id( uint16_t tls_id ); - -/** - * \brief This function retrieves curve information from a - * human-readable name. - * - * \param name The human-readable name. - * - * \return The associated curve information on success. - * \return NULL on failure. - */ -const mbedtls_ecp_curve_info *mbedtls_ecp_curve_info_from_name( const char *name ); - -/** - * \brief This function initializes a point as zero. - * - * \param pt The point to initialize. - */ -void mbedtls_ecp_point_init( mbedtls_ecp_point *pt ); - -/** - * \brief This function initializes an ECP group context - * without loading any domain parameters. - * - * \note After this function is called, domain parameters - * for various ECP groups can be loaded through the - * mbedtls_ecp_load() or mbedtls_ecp_tls_read_group() - * functions. - */ -void mbedtls_ecp_group_init( mbedtls_ecp_group *grp ); - -/** - * \brief This function initializes a key pair as an invalid one. - * - * \param key The key pair to initialize. - */ -void mbedtls_ecp_keypair_init( mbedtls_ecp_keypair *key ); - -/** - * \brief This function frees the components of a point. - * - * \param pt The point to free. - */ -void mbedtls_ecp_point_free( mbedtls_ecp_point *pt ); - -/** - * \brief This function frees the components of an ECP group. - * \param grp The group to free. - */ -void mbedtls_ecp_group_free( mbedtls_ecp_group *grp ); - -/** - * \brief This function frees the components of a key pair. - * \param key The key pair to free. - */ -void mbedtls_ecp_keypair_free( mbedtls_ecp_keypair *key ); - -/** - * \brief This function copies the contents of point \p Q into - * point \p P. - * - * \param P The destination point. - * \param Q The source point. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure. - */ -int mbedtls_ecp_copy( mbedtls_ecp_point *P, const mbedtls_ecp_point *Q ); - -/** - * \brief This function copies the contents of group \p src into - * group \p dst. - * - * \param dst The destination group. - * \param src The source group. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure. - */ -int mbedtls_ecp_group_copy( mbedtls_ecp_group *dst, const mbedtls_ecp_group *src ); - -/** - * \brief This function sets a point to zero. - * - * \param pt The point to set. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure. - */ -int mbedtls_ecp_set_zero( mbedtls_ecp_point *pt ); - -/** - * \brief This function checks if a point is zero. - * - * \param pt The point to test. - * - * \return \c 1 if the point is zero. - * \return \c 0 if the point is non-zero. - */ -int mbedtls_ecp_is_zero( mbedtls_ecp_point *pt ); - -/** - * \brief This function compares two points. - * - * \note This assumes that the points are normalized. Otherwise, - * they may compare as "not equal" even if they are. - * - * \param P The first point to compare. - * \param Q The second point to compare. - * - * \return \c 0 if the points are equal. - * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if the points are not equal. - */ -int mbedtls_ecp_point_cmp( const mbedtls_ecp_point *P, - const mbedtls_ecp_point *Q ); - -/** - * \brief This function imports a non-zero point from two ASCII - * strings. - * - * \param P The destination point. - * \param radix The numeric base of the input. - * \param x The first affine coordinate, as a null-terminated string. - * \param y The second affine coordinate, as a null-terminated string. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_MPI_XXX error code on failure. - */ -int mbedtls_ecp_point_read_string( mbedtls_ecp_point *P, int radix, - const char *x, const char *y ); - -/** - * \brief This function exports a point into unsigned binary data. - * - * \param grp The group to which the point should belong. - * \param P The point to export. - * \param format The point format. Should be an \c MBEDTLS_ECP_PF_XXX macro. - * \param olen The length of the output. - * \param buf The output buffer. - * \param buflen The length of the output buffer. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA - * or #MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL on failure. - */ -int mbedtls_ecp_point_write_binary( const mbedtls_ecp_group *grp, const mbedtls_ecp_point *P, - int format, size_t *olen, - unsigned char *buf, size_t buflen ); - -/** - * \brief This function imports a point from unsigned binary data. - * - * \note This function does not check that the point actually - * belongs to the given group, see mbedtls_ecp_check_pubkey() - * for that. - * - * \param grp The group to which the point should belong. - * \param P The point to import. - * \param buf The input buffer. - * \param ilen The length of the input. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if input is invalid. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure. - * \return #MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE if the point format - * is not implemented. - * - */ -int mbedtls_ecp_point_read_binary( const mbedtls_ecp_group *grp, mbedtls_ecp_point *P, - const unsigned char *buf, size_t ilen ); - -/** - * \brief This function imports a point from a TLS ECPoint record. - * - * \note On function return, \p buf is updated to point to immediately - * after the ECPoint record. - * - * \param grp The ECP group used. - * \param pt The destination point. - * \param buf The address of the pointer to the start of the input buffer. - * \param len The length of the buffer. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_MPI_XXX error code on initialization failure. - * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if input is invalid. - */ -int mbedtls_ecp_tls_read_point( const mbedtls_ecp_group *grp, mbedtls_ecp_point *pt, - const unsigned char **buf, size_t len ); - -/** - * \brief This function exports a point as a TLS ECPoint record. - * - * \param grp The ECP group used. - * \param pt The point format to export to. The point format is an - * \c MBEDTLS_ECP_PF_XXX constant. - * \param format The export format. - * \param olen The length of the data written. - * \param buf The buffer to write to. - * \param blen The length of the buffer. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA or - * #MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL on failure. - */ -int mbedtls_ecp_tls_write_point( const mbedtls_ecp_group *grp, const mbedtls_ecp_point *pt, - int format, size_t *olen, - unsigned char *buf, size_t blen ); - -/** - * \brief This function sets a group using standardized domain parameters. - * - * \note The index should be a value of the NamedCurve enum, - * as defined in RFC-4492: Elliptic Curve Cryptography - * (ECC) Cipher Suites for Transport Layer Security (TLS), - * usually in the form of an \c MBEDTLS_ECP_DP_XXX macro. - * - * \param grp The destination group. - * \param id The identifier of the domain parameter set to load. - * - * \return \c 0 on success, - * \return An \c MBEDTLS_ERR_MPI_XXX error code on initialization failure. - * \return #MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE for unkownn groups. - - */ -int mbedtls_ecp_group_load( mbedtls_ecp_group *grp, mbedtls_ecp_group_id id ); - -/** - * \brief This function sets a group from a TLS ECParameters record. - * - * \note \p buf is updated to point right after the ECParameters record - * on exit. - * - * \param grp The destination group. - * \param buf The address of the pointer to the start of the input buffer. - * \param len The length of the buffer. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_MPI_XXX error code on initialization failure. - * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if input is invalid. - */ -int mbedtls_ecp_tls_read_group( mbedtls_ecp_group *grp, const unsigned char **buf, size_t len ); - -/** - * \brief This function writes the TLS ECParameters record for a group. - * - * \param grp The ECP group used. - * \param olen The number of Bytes written. - * \param buf The buffer to write to. - * \param blen The length of the buffer. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL on failure. - */ -int mbedtls_ecp_tls_write_group( const mbedtls_ecp_group *grp, size_t *olen, - unsigned char *buf, size_t blen ); - -/** - * \brief This function performs multiplication of a point by - * an integer: \p R = \p m * \p P. - * - * It is not thread-safe to use same group in multiple threads. - * - * \note To prevent timing attacks, this function - * executes the exact same sequence of base-field - * operations for any valid \p m. It avoids any if-branch or - * array index depending on the value of \p m. - * - * \note If \p f_rng is not NULL, it is used to randomize - * intermediate results to prevent potential timing attacks - * targeting these results. We recommend always providing - * a non-NULL \p f_rng. The overhead is negligible. - * - * \param grp The ECP group. - * \param R The destination point. - * \param m The integer by which to multiply. - * \param P The point to multiply. - * \param f_rng The RNG function. - * \param p_rng The RNG context. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_INVALID_KEY if \p m is not a valid private - * key, or \p P is not a valid public key. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure. - */ -int mbedtls_ecp_mul( mbedtls_ecp_group *grp, mbedtls_ecp_point *R, - const mbedtls_mpi *m, const mbedtls_ecp_point *P, - int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ); - -/** - * \brief This function performs multiplication and addition of two - * points by integers: \p R = \p m * \p P + \p n * \p Q - * - * It is not thread-safe to use same group in multiple threads. - * - * \note In contrast to mbedtls_ecp_mul(), this function does not - * guarantee a constant execution flow and timing. - * - * \param grp The ECP group. - * \param R The destination point. - * \param m The integer by which to multiply \p P. - * \param P The point to multiply by \p m. - * \param n The integer by which to multiply \p Q. - * \param Q The point to be multiplied by \p n. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_INVALID_KEY if \p m or \p n are not - * valid private keys, or \p P or \p Q are not valid public - * keys. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure. - */ -int mbedtls_ecp_muladd( mbedtls_ecp_group *grp, mbedtls_ecp_point *R, - const mbedtls_mpi *m, const mbedtls_ecp_point *P, - const mbedtls_mpi *n, const mbedtls_ecp_point *Q ); - -/** - * \brief This function checks that a point is a valid public key - * on this curve. - * - * It only checks that the point is non-zero, has - * valid coordinates and lies on the curve. It does not verify - * that it is indeed a multiple of \p G. This additional - * check is computationally more expensive, is not required - * by standards, and should not be necessary if the group - * used has a small cofactor. In particular, it is useless for - * the NIST groups which all have a cofactor of 1. - * - * \note This function uses bare components rather than an - * ::mbedtls_ecp_keypair structure, to ease use with other - * structures, such as ::mbedtls_ecdh_context or - * ::mbedtls_ecdsa_context. - * - * \param grp The curve the point should lie on. - * \param pt The point to check. - * - * \return \c 0 if the point is a valid public key. - * \return #MBEDTLS_ERR_ECP_INVALID_KEY on failure. - */ -int mbedtls_ecp_check_pubkey( const mbedtls_ecp_group *grp, const mbedtls_ecp_point *pt ); - -/** - * \brief This function checks that an \p mbedtls_mpi is a valid private - * key for this curve. - * - * \note This function uses bare components rather than an - * ::mbedtls_ecp_keypair structure to ease use with other - * structures, such as ::mbedtls_ecdh_context or - * ::mbedtls_ecdsa_context. - * - * \param grp The group used. - * \param d The integer to check. - * - * \return \c 0 if the point is a valid private key. - * \return #MBEDTLS_ERR_ECP_INVALID_KEY on failure. - */ -int mbedtls_ecp_check_privkey( const mbedtls_ecp_group *grp, const mbedtls_mpi *d ); - -/** - * \brief This function generates a keypair with a configurable base - * point. - * - * \note This function uses bare components rather than an - * ::mbedtls_ecp_keypair structure to ease use with other - * structures, such as ::mbedtls_ecdh_context or - * ::mbedtls_ecdsa_context. - * - * \param grp The ECP group. - * \param G The chosen base point. - * \param d The destination MPI (secret part). - * \param Q The destination point (public part). - * \param f_rng The RNG function. - * \param p_rng The RNG context. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX error code - * on failure. - */ -int mbedtls_ecp_gen_keypair_base( mbedtls_ecp_group *grp, - const mbedtls_ecp_point *G, - mbedtls_mpi *d, mbedtls_ecp_point *Q, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief This function generates an ECP keypair. - * - * \note This function uses bare components rather than an - * ::mbedtls_ecp_keypair structure to ease use with other - * structures, such as ::mbedtls_ecdh_context or - * ::mbedtls_ecdsa_context. - * - * \param grp The ECP group. - * \param d The destination MPI (secret part). - * \param Q The destination point (public part). - * \param f_rng The RNG function. - * \param p_rng The RNG context. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX error code - * on failure. - */ -int mbedtls_ecp_gen_keypair( mbedtls_ecp_group *grp, mbedtls_mpi *d, mbedtls_ecp_point *Q, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief This function generates an ECP key. - * - * \param grp_id The ECP group identifier. - * \param key The destination key. - * \param f_rng The RNG function. - * \param p_rng The RNG context. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX error code - * on failure. - */ -int mbedtls_ecp_gen_key( mbedtls_ecp_group_id grp_id, mbedtls_ecp_keypair *key, - int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ); - -/** - * \brief This function checks that the keypair objects - * \p pub and \p prv have the same group and the - * same public point, and that the private key in - * \p prv is consistent with the public key. - * - * \param pub The keypair structure holding the public key. - * If it contains a private key, that part is ignored. - * \param prv The keypair structure holding the full keypair. - * - * \return \c 0 on success, meaning that the keys are valid and match. - * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if the keys are invalid or do not match. - * \return An \c MBEDTLS_ERR_ECP_XXX or an \c MBEDTLS_ERR_MPI_XXX - * error code on calculation failure. - */ -int mbedtls_ecp_check_pub_priv( const mbedtls_ecp_keypair *pub, const mbedtls_ecp_keypair *prv ); - -#if defined(MBEDTLS_SELF_TEST) - -/** - * \brief The ECP checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_ecp_self_test( int verbose ); - -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* ecp.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/ecp_internal.h b/tools/sdk/include/mbedtls/mbedtls/ecp_internal.h deleted file mode 100644 index 18040697adf..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/ecp_internal.h +++ /dev/null @@ -1,293 +0,0 @@ -/** - * \file ecp_internal.h - * - * \brief Function declarations for alternative implementation of elliptic curve - * point arithmetic. - */ -/* - * Copyright (C) 2016, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ - -/* - * References: - * - * [1] BERNSTEIN, Daniel J. Curve25519: new Diffie-Hellman speed records. - * - * - * [2] CORON, Jean-S'ebastien. Resistance against differential power analysis - * for elliptic curve cryptosystems. In : Cryptographic Hardware and - * Embedded Systems. Springer Berlin Heidelberg, 1999. p. 292-302. - * - * - * [3] HEDABOU, Mustapha, PINEL, Pierre, et B'EN'ETEAU, Lucien. A comb method to - * render ECC resistant against Side Channel Attacks. IACR Cryptology - * ePrint Archive, 2004, vol. 2004, p. 342. - * - * - * [4] Certicom Research. SEC 2: Recommended Elliptic Curve Domain Parameters. - * - * - * [5] HANKERSON, Darrel, MENEZES, Alfred J., VANSTONE, Scott. Guide to Elliptic - * Curve Cryptography. - * - * [6] Digital Signature Standard (DSS), FIPS 186-4. - * - * - * [7] Elliptic Curve Cryptography (ECC) Cipher Suites for Transport Layer - * Security (TLS), RFC 4492. - * - * - * [8] - * - * [9] COHEN, Henri. A Course in Computational Algebraic Number Theory. - * Springer Science & Business Media, 1 Aug 2000 - */ - -#ifndef MBEDTLS_ECP_INTERNAL_H -#define MBEDTLS_ECP_INTERNAL_H - -#if defined(MBEDTLS_ECP_INTERNAL_ALT) - -/** - * \brief Indicate if the Elliptic Curve Point module extension can - * handle the group. - * - * \param grp The pointer to the elliptic curve group that will be the - * basis of the cryptographic computations. - * - * \return Non-zero if successful. - */ -unsigned char mbedtls_internal_ecp_grp_capable( const mbedtls_ecp_group *grp ); - -/** - * \brief Initialise the Elliptic Curve Point module extension. - * - * If mbedtls_internal_ecp_grp_capable returns true for a - * group, this function has to be able to initialise the - * module for it. - * - * This module can be a driver to a crypto hardware - * accelerator, for which this could be an initialise function. - * - * \param grp The pointer to the group the module needs to be - * initialised for. - * - * \return 0 if successful. - */ -int mbedtls_internal_ecp_init( const mbedtls_ecp_group *grp ); - -/** - * \brief Frees and deallocates the Elliptic Curve Point module - * extension. - * - * \param grp The pointer to the group the module was initialised for. - */ -void mbedtls_internal_ecp_free( const mbedtls_ecp_group *grp ); - -#if defined(ECP_SHORTWEIERSTRASS) - -#if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT) -/** - * \brief Randomize jacobian coordinates: - * (X, Y, Z) -> (l^2 X, l^3 Y, l Z) for random l. - * - * \param grp Pointer to the group representing the curve. - * - * \param pt The point on the curve to be randomised, given with Jacobian - * coordinates. - * - * \param f_rng A function pointer to the random number generator. - * - * \param p_rng A pointer to the random number generator state. - * - * \return 0 if successful. - */ -int mbedtls_internal_ecp_randomize_jac( const mbedtls_ecp_group *grp, - mbedtls_ecp_point *pt, int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); -#endif - -#if defined(MBEDTLS_ECP_ADD_MIXED_ALT) -/** - * \brief Addition: R = P + Q, mixed affine-Jacobian coordinates. - * - * The coordinates of Q must be normalized (= affine), - * but those of P don't need to. R is not normalized. - * - * This function is used only as a subrutine of - * ecp_mul_comb(). - * - * Special cases: (1) P or Q is zero, (2) R is zero, - * (3) P == Q. - * None of these cases can happen as intermediate step in - * ecp_mul_comb(): - * - at each step, P, Q and R are multiples of the base - * point, the factor being less than its order, so none of - * them is zero; - * - Q is an odd multiple of the base point, P an even - * multiple, due to the choice of precomputed points in the - * modified comb method. - * So branches for these cases do not leak secret information. - * - * We accept Q->Z being unset (saving memory in tables) as - * meaning 1. - * - * Cost in field operations if done by [5] 3.22: - * 1A := 8M + 3S - * - * \param grp Pointer to the group representing the curve. - * - * \param R Pointer to a point structure to hold the result. - * - * \param P Pointer to the first summand, given with Jacobian - * coordinates - * - * \param Q Pointer to the second summand, given with affine - * coordinates. - * - * \return 0 if successful. - */ -int mbedtls_internal_ecp_add_mixed( const mbedtls_ecp_group *grp, - mbedtls_ecp_point *R, const mbedtls_ecp_point *P, - const mbedtls_ecp_point *Q ); -#endif - -/** - * \brief Point doubling R = 2 P, Jacobian coordinates. - * - * Cost: 1D := 3M + 4S (A == 0) - * 4M + 4S (A == -3) - * 3M + 6S + 1a otherwise - * when the implementation is based on the "dbl-1998-cmo-2" - * doubling formulas in [8] and standard optimizations are - * applied when curve parameter A is one of { 0, -3 }. - * - * \param grp Pointer to the group representing the curve. - * - * \param R Pointer to a point structure to hold the result. - * - * \param P Pointer to the point that has to be doubled, given with - * Jacobian coordinates. - * - * \return 0 if successful. - */ -#if defined(MBEDTLS_ECP_DOUBLE_JAC_ALT) -int mbedtls_internal_ecp_double_jac( const mbedtls_ecp_group *grp, - mbedtls_ecp_point *R, const mbedtls_ecp_point *P ); -#endif - -/** - * \brief Normalize jacobian coordinates of an array of (pointers to) - * points. - * - * Using Montgomery's trick to perform only one inversion mod P - * the cost is: - * 1N(t) := 1I + (6t - 3)M + 1S - * (See for example Algorithm 10.3.4. in [9]) - * - * This function is used only as a subrutine of - * ecp_mul_comb(). - * - * Warning: fails (returning an error) if one of the points is - * zero! - * This should never happen, see choice of w in ecp_mul_comb(). - * - * \param grp Pointer to the group representing the curve. - * - * \param T Array of pointers to the points to normalise. - * - * \param t_len Number of elements in the array. - * - * \return 0 if successful, - * an error if one of the points is zero. - */ -#if defined(MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT) -int mbedtls_internal_ecp_normalize_jac_many( const mbedtls_ecp_group *grp, - mbedtls_ecp_point *T[], size_t t_len ); -#endif - -/** - * \brief Normalize jacobian coordinates so that Z == 0 || Z == 1. - * - * Cost in field operations if done by [5] 3.2.1: - * 1N := 1I + 3M + 1S - * - * \param grp Pointer to the group representing the curve. - * - * \param pt pointer to the point to be normalised. This is an - * input/output parameter. - * - * \return 0 if successful. - */ -#if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT) -int mbedtls_internal_ecp_normalize_jac( const mbedtls_ecp_group *grp, - mbedtls_ecp_point *pt ); -#endif - -#endif /* ECP_SHORTWEIERSTRASS */ - -#if defined(ECP_MONTGOMERY) - -#if defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT) -int mbedtls_internal_ecp_double_add_mxz( const mbedtls_ecp_group *grp, - mbedtls_ecp_point *R, mbedtls_ecp_point *S, const mbedtls_ecp_point *P, - const mbedtls_ecp_point *Q, const mbedtls_mpi *d ); -#endif - -/** - * \brief Randomize projective x/z coordinates: - * (X, Z) -> (l X, l Z) for random l - * - * \param grp pointer to the group representing the curve - * - * \param P the point on the curve to be randomised given with - * projective coordinates. This is an input/output parameter. - * - * \param f_rng a function pointer to the random number generator - * - * \param p_rng a pointer to the random number generator state - * - * \return 0 if successful - */ -#if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT) -int mbedtls_internal_ecp_randomize_mxz( const mbedtls_ecp_group *grp, - mbedtls_ecp_point *P, int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); -#endif - -/** - * \brief Normalize Montgomery x/z coordinates: X = X/Z, Z = 1. - * - * \param grp pointer to the group representing the curve - * - * \param P pointer to the point to be normalised. This is an - * input/output parameter. - * - * \return 0 if successful - */ -#if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT) -int mbedtls_internal_ecp_normalize_mxz( const mbedtls_ecp_group *grp, - mbedtls_ecp_point *P ); -#endif - -#endif /* ECP_MONTGOMERY */ - -#endif /* MBEDTLS_ECP_INTERNAL_ALT */ - -#endif /* ecp_internal.h */ - diff --git a/tools/sdk/include/mbedtls/mbedtls/entropy.h b/tools/sdk/include/mbedtls/mbedtls/entropy.h deleted file mode 100644 index ca06dc3c58e..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/entropy.h +++ /dev/null @@ -1,289 +0,0 @@ -/** - * \file entropy.h - * - * \brief Entropy accumulator implementation - */ -/* - * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_ENTROPY_H -#define MBEDTLS_ENTROPY_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include - -#if defined(MBEDTLS_SHA512_C) && !defined(MBEDTLS_ENTROPY_FORCE_SHA256) -#include "sha512.h" -#define MBEDTLS_ENTROPY_SHA512_ACCUMULATOR -#else -#if defined(MBEDTLS_SHA256_C) -#define MBEDTLS_ENTROPY_SHA256_ACCUMULATOR -#include "sha256.h" -#endif -#endif - -#if defined(MBEDTLS_THREADING_C) -#include "threading.h" -#endif - -#if defined(MBEDTLS_HAVEGE_C) -#include "havege.h" -#endif - -#define MBEDTLS_ERR_ENTROPY_SOURCE_FAILED -0x003C /**< Critical entropy source failure. */ -#define MBEDTLS_ERR_ENTROPY_MAX_SOURCES -0x003E /**< No more sources can be added. */ -#define MBEDTLS_ERR_ENTROPY_NO_SOURCES_DEFINED -0x0040 /**< No sources have been added to poll. */ -#define MBEDTLS_ERR_ENTROPY_NO_STRONG_SOURCE -0x003D /**< No strong sources have been added to poll. */ -#define MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR -0x003F /**< Read/write error in file. */ - -/** - * \name SECTION: Module settings - * - * The configuration options you can set for this module are in this section. - * Either change them in config.h or define them on the compiler command line. - * \{ - */ - -#if !defined(MBEDTLS_ENTROPY_MAX_SOURCES) -#define MBEDTLS_ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */ -#endif - -#if !defined(MBEDTLS_ENTROPY_MAX_GATHER) -#define MBEDTLS_ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */ -#endif - -/* \} name SECTION: Module settings */ - -#if defined(MBEDTLS_ENTROPY_SHA512_ACCUMULATOR) -#define MBEDTLS_ENTROPY_BLOCK_SIZE 64 /**< Block size of entropy accumulator (SHA-512) */ -#else -#define MBEDTLS_ENTROPY_BLOCK_SIZE 32 /**< Block size of entropy accumulator (SHA-256) */ -#endif - -#define MBEDTLS_ENTROPY_MAX_SEED_SIZE 1024 /**< Maximum size of seed we read from seed file */ -#define MBEDTLS_ENTROPY_SOURCE_MANUAL MBEDTLS_ENTROPY_MAX_SOURCES - -#define MBEDTLS_ENTROPY_SOURCE_STRONG 1 /**< Entropy source is strong */ -#define MBEDTLS_ENTROPY_SOURCE_WEAK 0 /**< Entropy source is weak */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Entropy poll callback pointer - * - * \param data Callback-specific data pointer - * \param output Data to fill - * \param len Maximum size to provide - * \param olen The actual amount of bytes put into the buffer (Can be 0) - * - * \return 0 if no critical failures occurred, - * MBEDTLS_ERR_ENTROPY_SOURCE_FAILED otherwise - */ -typedef int (*mbedtls_entropy_f_source_ptr)(void *data, unsigned char *output, size_t len, - size_t *olen); - -/** - * \brief Entropy source state - */ -typedef struct mbedtls_entropy_source_state -{ - mbedtls_entropy_f_source_ptr f_source; /**< The entropy source callback */ - void * p_source; /**< The callback data pointer */ - size_t size; /**< Amount received in bytes */ - size_t threshold; /**< Minimum bytes required before release */ - int strong; /**< Is the source strong? */ -} -mbedtls_entropy_source_state; - -/** - * \brief Entropy context structure - */ -typedef struct mbedtls_entropy_context -{ - int accumulator_started; -#if defined(MBEDTLS_ENTROPY_SHA512_ACCUMULATOR) - mbedtls_sha512_context accumulator; -#else - mbedtls_sha256_context accumulator; -#endif - int source_count; - mbedtls_entropy_source_state source[MBEDTLS_ENTROPY_MAX_SOURCES]; -#if defined(MBEDTLS_HAVEGE_C) - mbedtls_havege_state havege_data; -#endif -#if defined(MBEDTLS_THREADING_C) - mbedtls_threading_mutex_t mutex; /*!< mutex */ -#endif -#if defined(MBEDTLS_ENTROPY_NV_SEED) - int initial_entropy_run; -#endif -} -mbedtls_entropy_context; - -/** - * \brief Initialize the context - * - * \param ctx Entropy context to initialize - */ -void mbedtls_entropy_init( mbedtls_entropy_context *ctx ); - -/** - * \brief Free the data in the context - * - * \param ctx Entropy context to free - */ -void mbedtls_entropy_free( mbedtls_entropy_context *ctx ); - -/** - * \brief Adds an entropy source to poll - * (Thread-safe if MBEDTLS_THREADING_C is enabled) - * - * \param ctx Entropy context - * \param f_source Entropy function - * \param p_source Function data - * \param threshold Minimum required from source before entropy is released - * ( with mbedtls_entropy_func() ) (in bytes) - * \param strong MBEDTLS_ENTROPY_SOURCE_STRONG or - * MBEDTLS_ENTROPY_SOURCE_WEAK. - * At least one strong source needs to be added. - * Weaker sources (such as the cycle counter) can be used as - * a complement. - * - * \return 0 if successful or MBEDTLS_ERR_ENTROPY_MAX_SOURCES - */ -int mbedtls_entropy_add_source( mbedtls_entropy_context *ctx, - mbedtls_entropy_f_source_ptr f_source, void *p_source, - size_t threshold, int strong ); - -/** - * \brief Trigger an extra gather poll for the accumulator - * (Thread-safe if MBEDTLS_THREADING_C is enabled) - * - * \param ctx Entropy context - * - * \return 0 if successful, or MBEDTLS_ERR_ENTROPY_SOURCE_FAILED - */ -int mbedtls_entropy_gather( mbedtls_entropy_context *ctx ); - -/** - * \brief Retrieve entropy from the accumulator - * (Maximum length: MBEDTLS_ENTROPY_BLOCK_SIZE) - * (Thread-safe if MBEDTLS_THREADING_C is enabled) - * - * \param data Entropy context - * \param output Buffer to fill - * \param len Number of bytes desired, must be at most MBEDTLS_ENTROPY_BLOCK_SIZE - * - * \return 0 if successful, or MBEDTLS_ERR_ENTROPY_SOURCE_FAILED - */ -int mbedtls_entropy_func( void *data, unsigned char *output, size_t len ); - -/** - * \brief Add data to the accumulator manually - * (Thread-safe if MBEDTLS_THREADING_C is enabled) - * - * \param ctx Entropy context - * \param data Data to add - * \param len Length of data - * - * \return 0 if successful - */ -int mbedtls_entropy_update_manual( mbedtls_entropy_context *ctx, - const unsigned char *data, size_t len ); - -#if defined(MBEDTLS_ENTROPY_NV_SEED) -/** - * \brief Trigger an update of the seed file in NV by using the - * current entropy pool. - * - * \param ctx Entropy context - * - * \return 0 if successful - */ -int mbedtls_entropy_update_nv_seed( mbedtls_entropy_context *ctx ); -#endif /* MBEDTLS_ENTROPY_NV_SEED */ - -#if defined(MBEDTLS_FS_IO) -/** - * \brief Write a seed file - * - * \param ctx Entropy context - * \param path Name of the file - * - * \return 0 if successful, - * MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR on file error, or - * MBEDTLS_ERR_ENTROPY_SOURCE_FAILED - */ -int mbedtls_entropy_write_seed_file( mbedtls_entropy_context *ctx, const char *path ); - -/** - * \brief Read and update a seed file. Seed is added to this - * instance. No more than MBEDTLS_ENTROPY_MAX_SEED_SIZE bytes are - * read from the seed file. The rest is ignored. - * - * \param ctx Entropy context - * \param path Name of the file - * - * \return 0 if successful, - * MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR on file error, - * MBEDTLS_ERR_ENTROPY_SOURCE_FAILED - */ -int mbedtls_entropy_update_seed_file( mbedtls_entropy_context *ctx, const char *path ); -#endif /* MBEDTLS_FS_IO */ - -#if defined(MBEDTLS_SELF_TEST) -/** - * \brief Checkup routine - * - * This module self-test also calls the entropy self-test, - * mbedtls_entropy_source_self_test(); - * - * \return 0 if successful, or 1 if a test failed - */ -int mbedtls_entropy_self_test( int verbose ); - -#if defined(MBEDTLS_ENTROPY_HARDWARE_ALT) -/** - * \brief Checkup routine - * - * Verifies the integrity of the hardware entropy source - * provided by the function 'mbedtls_hardware_poll()'. - * - * Note this is the only hardware entropy source that is known - * at link time, and other entropy sources configured - * dynamically at runtime by the function - * mbedtls_entropy_add_source() will not be tested. - * - * \return 0 if successful, or 1 if a test failed - */ -int mbedtls_entropy_source_self_test( int verbose ); -#endif /* MBEDTLS_ENTROPY_HARDWARE_ALT */ -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* entropy.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/entropy_poll.h b/tools/sdk/include/mbedtls/mbedtls/entropy_poll.h deleted file mode 100644 index 94dd657eb95..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/entropy_poll.h +++ /dev/null @@ -1,110 +0,0 @@ -/** - * \file entropy_poll.h - * - * \brief Platform-specific and custom entropy polling functions - */ -/* - * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_ENTROPY_POLL_H -#define MBEDTLS_ENTROPY_POLL_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Default thresholds for built-in sources, in bytes - */ -#define MBEDTLS_ENTROPY_MIN_PLATFORM 32 /**< Minimum for platform source */ -#define MBEDTLS_ENTROPY_MIN_HAVEGE 32 /**< Minimum for HAVEGE */ -#define MBEDTLS_ENTROPY_MIN_HARDCLOCK 4 /**< Minimum for mbedtls_timing_hardclock() */ -#if !defined(MBEDTLS_ENTROPY_MIN_HARDWARE) -#define MBEDTLS_ENTROPY_MIN_HARDWARE 32 /**< Minimum for the hardware source */ -#endif - -/** - * \brief Entropy poll callback that provides 0 entropy. - */ -#if defined(MBEDTLS_TEST_NULL_ENTROPY) - int mbedtls_null_entropy_poll( void *data, - unsigned char *output, size_t len, size_t *olen ); -#endif - -#if !defined(MBEDTLS_NO_PLATFORM_ENTROPY) -/** - * \brief Platform-specific entropy poll callback - */ -int mbedtls_platform_entropy_poll( void *data, - unsigned char *output, size_t len, size_t *olen ); -#endif - -#if defined(MBEDTLS_HAVEGE_C) -/** - * \brief HAVEGE based entropy poll callback - * - * Requires an HAVEGE state as its data pointer. - */ -int mbedtls_havege_poll( void *data, - unsigned char *output, size_t len, size_t *olen ); -#endif - -#if defined(MBEDTLS_TIMING_C) -/** - * \brief mbedtls_timing_hardclock-based entropy poll callback - */ -int mbedtls_hardclock_poll( void *data, - unsigned char *output, size_t len, size_t *olen ); -#endif - -#if defined(MBEDTLS_ENTROPY_HARDWARE_ALT) -/** - * \brief Entropy poll callback for a hardware source - * - * \warning This is not provided by mbed TLS! - * See \c MBEDTLS_ENTROPY_HARDWARE_ALT in config.h. - * - * \note This must accept NULL as its first argument. - */ -int mbedtls_hardware_poll( void *data, - unsigned char *output, size_t len, size_t *olen ); -#endif - -#if defined(MBEDTLS_ENTROPY_NV_SEED) -/** - * \brief Entropy poll callback for a non-volatile seed file - * - * \note This must accept NULL as its first argument. - */ -int mbedtls_nv_seed_poll( void *data, - unsigned char *output, size_t len, size_t *olen ); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* entropy_poll.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/error.h b/tools/sdk/include/mbedtls/mbedtls/error.h deleted file mode 100644 index 6b82d4fbbe8..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/error.h +++ /dev/null @@ -1,122 +0,0 @@ -/** - * \file error.h - * - * \brief Error to string translation - */ -/* - * Copyright (C) 2006-2018, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_ERROR_H -#define MBEDTLS_ERROR_H - -#include - -/** - * Error code layout. - * - * Currently we try to keep all error codes within the negative space of 16 - * bits signed integers to support all platforms (-0x0001 - -0x7FFF). In - * addition we'd like to give two layers of information on the error if - * possible. - * - * For that purpose the error codes are segmented in the following manner: - * - * 16 bit error code bit-segmentation - * - * 1 bit - Unused (sign bit) - * 3 bits - High level module ID - * 5 bits - Module-dependent error code - * 7 bits - Low level module errors - * - * For historical reasons, low-level error codes are divided in even and odd, - * even codes were assigned first, and -1 is reserved for other errors. - * - * Low-level module errors (0x0002-0x007E, 0x0003-0x007F) - * - * Module Nr Codes assigned - * MPI 7 0x0002-0x0010 - * GCM 3 0x0012-0x0014 0x0013-0x0013 - * BLOWFISH 3 0x0016-0x0018 0x0017-0x0017 - * THREADING 3 0x001A-0x001E - * AES 5 0x0020-0x0022 0x0021-0x0025 - * CAMELLIA 3 0x0024-0x0026 0x0027-0x0027 - * XTEA 2 0x0028-0x0028 0x0029-0x0029 - * BASE64 2 0x002A-0x002C - * OID 1 0x002E-0x002E 0x000B-0x000B - * PADLOCK 1 0x0030-0x0030 - * DES 2 0x0032-0x0032 0x0033-0x0033 - * CTR_DBRG 4 0x0034-0x003A - * ENTROPY 3 0x003C-0x0040 0x003D-0x003F - * NET 13 0x0042-0x0052 0x0043-0x0049 - * ARIA 4 0x0058-0x005E - * ASN1 7 0x0060-0x006C - * CMAC 1 0x007A-0x007A - * PBKDF2 1 0x007C-0x007C - * HMAC_DRBG 4 0x0003-0x0009 - * CCM 3 0x000D-0x0011 - * ARC4 1 0x0019-0x0019 - * MD2 1 0x002B-0x002B - * MD4 1 0x002D-0x002D - * MD5 1 0x002F-0x002F - * RIPEMD160 1 0x0031-0x0031 - * SHA1 1 0x0035-0x0035 - * SHA256 1 0x0037-0x0037 - * SHA512 1 0x0039-0x0039 - * CHACHA20 3 0x0051-0x0055 - * POLY1305 3 0x0057-0x005B - * CHACHAPOLY 2 0x0054-0x0056 - * - * High-level module nr (3 bits - 0x0...-0x7...) - * Name ID Nr of Errors - * PEM 1 9 - * PKCS#12 1 4 (Started from top) - * X509 2 20 - * PKCS5 2 4 (Started from top) - * DHM 3 11 - * PK 3 15 (Started from top) - * RSA 4 11 - * ECP 4 9 (Started from top) - * MD 5 5 - * HKDF 5 1 (Started from top) - * CIPHER 6 8 - * SSL 6 22 (Started from top) - * SSL 7 31 - * - * Module dependent error code (5 bits 0x.00.-0x.F8.) - */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Translate a mbed TLS error code into a string representation, - * Result is truncated if necessary and always includes a terminating - * null byte. - * - * \param errnum error code - * \param buffer buffer to place representation in - * \param buflen length of the buffer - */ -void mbedtls_strerror( int errnum, char *buffer, size_t buflen ); - -#ifdef __cplusplus -} -#endif - -#endif /* error.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/esp_config.h b/tools/sdk/include/mbedtls/mbedtls/esp_config.h deleted file mode 100644 index 89cdef8927c..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/esp_config.h +++ /dev/null @@ -1,2719 +0,0 @@ -/** - * - * \brief Default mbedTLS configuration options for esp-idf - * - * This set of compile-time options may be used to enable - * or disable features selectively, and reduce the global - * memory footprint. - * - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_CONFIG_H -#define MBEDTLS_CONFIG_H - -#include "sdkconfig.h" - -#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) -#define _CRT_SECURE_NO_DEPRECATE 1 -#endif - -/** - * \name SECTION: System support - * - * This section sets system specific settings. - * \{ - */ - -/** - * \def MBEDTLS_HAVE_ASM - * - * The compiler has support for asm(). - * - * Requires support for asm() in compiler. - * - * Used in: - * library/timing.c - * library/padlock.c - * include/mbedtls/bn_mul.h - * - * Comment to disable the use of assembly code. - */ -#define MBEDTLS_HAVE_ASM - -/** - * \def MBEDTLS_HAVE_SSE2 - * - * CPU supports SSE2 instruction set. - * - * Uncomment if the CPU supports SSE2 (IA-32 specific). - */ -//#define MBEDTLS_HAVE_SSE2 - -/** - * \def MBEDTLS_HAVE_TIME - * - * System has time.h and time(). - * The time does not need to be correct, only time differences are used, - * by contrast with MBEDTLS_HAVE_TIME_DATE - * - * Comment if your system does not support time functions - */ -#ifdef CONFIG_MBEDTLS_HAVE_TIME -#define MBEDTLS_HAVE_TIME -#endif - -/** - * \def MBEDTLS_HAVE_TIME_DATE - * - * System has time.h and time(), gmtime() and the clock is correct. - * The time needs to be correct (not necesarily very accurate, but at least - * the date should be correct). This is used to verify the validity period of - * X.509 certificates. - * - * Comment if your system does not have a correct clock. - */ -#ifdef CONFIG_MBEDTLS_HAVE_TIME_DATE -#define MBEDTLS_HAVE_TIME_DATE -#endif - -/** - * \def MBEDTLS_PLATFORM_MEMORY - * - * Enable the memory allocation layer. - * - * By default mbed TLS uses the system-provided calloc() and free(). - * This allows different allocators (self-implemented or provided) to be - * provided to the platform abstraction layer. - * - * Enabling MBEDTLS_PLATFORM_MEMORY without the - * MBEDTLS_PLATFORM_{FREE,CALLOC}_MACROs will provide - * "mbedtls_platform_set_calloc_free()" allowing you to set an alternative calloc() and - * free() function pointer at runtime. - * - * Enabling MBEDTLS_PLATFORM_MEMORY and specifying - * MBEDTLS_PLATFORM_{CALLOC,FREE}_MACROs will allow you to specify the - * alternate function at compile time. - * - * Requires: MBEDTLS_PLATFORM_C - * - * Enable this layer to allow use of alternative memory allocators. - */ -#define MBEDTLS_PLATFORM_MEMORY - -/** Override calloc(), free() except for case where memory allocation scheme is not set to custom */ -#ifndef CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC -#include "esp_mem.h" -#define MBEDTLS_PLATFORM_STD_CALLOC esp_mbedtls_mem_calloc -#define MBEDTLS_PLATFORM_STD_FREE esp_mbedtls_mem_free -#endif - -/** - * \def MBEDTLS_PLATFORM_NO_STD_FUNCTIONS - * - * Do not assign standard functions in the platform layer (e.g. calloc() to - * MBEDTLS_PLATFORM_STD_CALLOC and printf() to MBEDTLS_PLATFORM_STD_PRINTF) - * - * This makes sure there are no linking errors on platforms that do not support - * these functions. You will HAVE to provide alternatives, either at runtime - * via the platform_set_xxx() functions or at compile time by setting - * the MBEDTLS_PLATFORM_STD_XXX defines, or enabling a - * MBEDTLS_PLATFORM_XXX_MACRO. - * - * Requires: MBEDTLS_PLATFORM_C - * - * Uncomment to prevent default assignment of standard functions in the - * platform layer. - */ -//#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS - -/** - * \def MBEDTLS_PLATFORM_EXIT_ALT - * - * MBEDTLS_PLATFORM_XXX_ALT: Uncomment a macro to let mbed TLS support the - * function in the platform abstraction layer. - * - * Example: In case you uncomment MBEDTLS_PLATFORM_PRINTF_ALT, mbed TLS will - * provide a function "mbedtls_platform_set_printf()" that allows you to set an - * alternative printf function pointer. - * - * All these define require MBEDTLS_PLATFORM_C to be defined! - * - * \note MBEDTLS_PLATFORM_SNPRINTF_ALT is required on Windows; - * it will be enabled automatically by check_config.h - * - * \warning MBEDTLS_PLATFORM_XXX_ALT cannot be defined at the same time as - * MBEDTLS_PLATFORM_XXX_MACRO! - * - * Uncomment a macro to enable alternate implementation of specific base - * platform function - */ -//#define MBEDTLS_PLATFORM_EXIT_ALT -//#define MBEDTLS_PLATFORM_FPRINTF_ALT -//#define MBEDTLS_PLATFORM_PRINTF_ALT -//#define MBEDTLS_PLATFORM_SNPRINTF_ALT - -/** - * \def MBEDTLS_DEPRECATED_WARNING - * - * Mark deprecated functions so that they generate a warning if used. - * Functions deprecated in one version will usually be removed in the next - * version. You can enable this to help you prepare the transition to a new - * major version by making sure your code is not using these functions. - * - * This only works with GCC and Clang. With other compilers, you may want to - * use MBEDTLS_DEPRECATED_REMOVED - * - * Uncomment to get warnings on using deprecated functions. - */ -//#define MBEDTLS_DEPRECATED_WARNING - -/** - * \def MBEDTLS_DEPRECATED_REMOVED - * - * Remove deprecated functions so that they generate an error if used. - * Functions deprecated in one version will usually be removed in the next - * version. You can enable this to help you prepare the transition to a new - * major version by making sure your code is not using these functions. - * - * Uncomment to get errors on using deprecated functions. - */ -//#define MBEDTLS_DEPRECATED_REMOVED - -/* \} name SECTION: System support */ - -/** - * \name SECTION: mbed TLS feature support - * - * This section sets support for features that are or are not needed - * within the modules that are enabled. - * \{ - */ - -/** - * \def MBEDTLS_TIMING_ALT - * - * Uncomment to provide your own alternate implementation for mbedtls_timing_hardclock(), - * mbedtls_timing_get_timer(), mbedtls_set_alarm(), mbedtls_set/get_delay() - * - * Only works if you have MBEDTLS_TIMING_C enabled. - * - * You will need to provide a header "timing_alt.h" and an implementation at - * compile time. - */ -//#define MBEDTLS_TIMING_ALT - -/** - * \def MBEDTLS_AES_ALT - * - * MBEDTLS__MODULE_NAME__ALT: Uncomment a macro to let mbed TLS use your - * alternate core implementation of a symmetric crypto or hash module (e.g. - * platform specific assembly optimized implementations). Keep in mind that - * the function prototypes should remain the same. - * - * This replaces the whole module. If you only want to replace one of the - * functions, use one of the MBEDTLS__FUNCTION_NAME__ALT flags. - * - * Example: In case you uncomment MBEDTLS_AES_ALT, mbed TLS will no longer - * provide the "struct mbedtls_aes_context" definition and omit the base function - * declarations and implementations. "aes_alt.h" will be included from - * "aes.h" to include the new function definitions. - * - * Uncomment a macro to enable alternate implementation of the corresponding - * module. - */ -//#define MBEDTLS_ARC4_ALT -//#define MBEDTLS_BLOWFISH_ALT -//#define MBEDTLS_CAMELLIA_ALT -//#define MBEDTLS_DES_ALT -//#define MBEDTLS_XTEA_ALT -//#define MBEDTLS_MD2_ALT -//#define MBEDTLS_MD4_ALT -//#define MBEDTLS_MD5_ALT -//#define MBEDTLS_RIPEMD160_ALT - -/* The following units have ESP32 hardware support, - uncommenting each _ALT macro will use the - hardware-accelerated implementation. */ -#ifdef CONFIG_MBEDTLS_HARDWARE_AES -#define MBEDTLS_AES_ALT -#endif - -/* MBEDTLS_SHAxx_ALT to enable hardware SHA support - with software fallback. -*/ -#ifdef CONFIG_MBEDTLS_HARDWARE_SHA -#define MBEDTLS_SHA1_ALT -#define MBEDTLS_SHA256_ALT -#define MBEDTLS_SHA512_ALT -#endif - -/* The following MPI (bignum) functions have ESP32 hardware support, - Uncommenting these macros will use the hardware-accelerated - implementations. -*/ -#ifdef CONFIG_MBEDTLS_HARDWARE_MPI -#define MBEDTLS_MPI_EXP_MOD_ALT -#define MBEDTLS_MPI_MUL_MPI_ALT -#endif - -/** - * \def MBEDTLS_MD2_PROCESS_ALT - * - * MBEDTLS__FUNCTION_NAME__ALT: Uncomment a macro to let mbed TLS use you - * alternate core implementation of symmetric crypto or hash function. Keep in - * mind that function prototypes should remain the same. - * - * This replaces only one function. The header file from mbed TLS is still - * used, in contrast to the MBEDTLS__MODULE_NAME__ALT flags. - * - * Example: In case you uncomment MBEDTLS_SHA256_PROCESS_ALT, mbed TLS will - * no longer provide the mbedtls_sha1_process() function, but it will still provide - * the other function (using your mbedtls_sha1_process() function) and the definition - * of mbedtls_sha1_context, so your implementation of mbedtls_sha1_process must be compatible - * with this definition. - * - * Note: if you use the AES_xxx_ALT macros, then is is recommended to also set - * MBEDTLS_AES_ROM_TABLES in order to help the linker garbage-collect the AES - * tables. - * - * Uncomment a macro to enable alternate implementation of the corresponding - * function. - */ -//#define MBEDTLS_MD2_PROCESS_ALT -//#define MBEDTLS_MD4_PROCESS_ALT -//#define MBEDTLS_MD5_PROCESS_ALT -//#define MBEDTLS_RIPEMD160_PROCESS_ALT -//#define MBEDTLS_SHA1_PROCESS_ALT -//#define MBEDTLS_SHA256_PROCESS_ALT -//#define MBEDTLS_SHA512_PROCESS_ALT -//#define MBEDTLS_DES_SETKEY_ALT -//#define MBEDTLS_DES_CRYPT_ECB_ALT -//#define MBEDTLS_DES3_CRYPT_ECB_ALT -//#define MBEDTLS_AES_SETKEY_ENC_ALT -//#define MBEDTLS_AES_SETKEY_DEC_ALT -//#define MBEDTLS_AES_ENCRYPT_ALT -//#define MBEDTLS_AES_DECRYPT_ALT - -/** - * \def MBEDTLS_ENTROPY_HARDWARE_ALT - * - * Uncomment this macro to let mbed TLS use your own implementation of a - * hardware entropy collector. - * - * Your function must be called \c mbedtls_hardware_poll(), have the same - * prototype as declared in entropy_poll.h, and accept NULL as first argument. - * - * Uncomment to use your own hardware entropy collector. - */ -#define MBEDTLS_ENTROPY_HARDWARE_ALT - -/** - * \def MBEDTLS_AES_ROM_TABLES - * - * Store the AES tables in ROM. - * - * Uncomment this macro to store the AES tables in ROM. - */ -#define MBEDTLS_AES_ROM_TABLES - -/** - * \def MBEDTLS_CAMELLIA_SMALL_MEMORY - * - * Use less ROM for the Camellia implementation (saves about 768 bytes). - * - * Uncomment this macro to use less memory for Camellia. - */ -//#define MBEDTLS_CAMELLIA_SMALL_MEMORY - -/** - * \def MBEDTLS_CIPHER_MODE_CBC - * - * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers. - */ -#define MBEDTLS_CIPHER_MODE_CBC - -/** - * \def MBEDTLS_CIPHER_MODE_CFB - * - * Enable Cipher Feedback mode (CFB) for symmetric ciphers. - */ -#define MBEDTLS_CIPHER_MODE_CFB - -/** - * \def MBEDTLS_CIPHER_MODE_CTR - * - * Enable Counter Block Cipher mode (CTR) for symmetric ciphers. - */ -#define MBEDTLS_CIPHER_MODE_CTR - -/** - * \def MBEDTLS_CIPHER_MODE_XTS - * - * Enable Xor-encrypt-xor with ciphertext stealing mode (XTS) for AES. - */ -#define MBEDTLS_CIPHER_MODE_XTS - -/** - * \def MBEDTLS_CIPHER_NULL_CIPHER - * - * Enable NULL cipher. - * Warning: Only do so when you know what you are doing. This allows for - * encryption or channels without any security! - * - * Requires MBEDTLS_ENABLE_WEAK_CIPHERSUITES as well to enable - * the following ciphersuites: - * MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA - * MBEDTLS_TLS_RSA_WITH_NULL_SHA256 - * MBEDTLS_TLS_RSA_WITH_NULL_SHA - * MBEDTLS_TLS_RSA_WITH_NULL_MD5 - * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA - * MBEDTLS_TLS_PSK_WITH_NULL_SHA384 - * MBEDTLS_TLS_PSK_WITH_NULL_SHA256 - * MBEDTLS_TLS_PSK_WITH_NULL_SHA - * - * Uncomment this macro to enable the NULL cipher and ciphersuites - */ -//#define MBEDTLS_CIPHER_NULL_CIPHER - -/** - * \def MBEDTLS_CIPHER_PADDING_PKCS7 - * - * MBEDTLS_CIPHER_PADDING_XXX: Uncomment or comment macros to add support for - * specific padding modes in the cipher layer with cipher modes that support - * padding (e.g. CBC) - * - * If you disable all padding modes, only full blocks can be used with CBC. - * - * Enable padding modes in the cipher layer. - */ -#define MBEDTLS_CIPHER_PADDING_PKCS7 -#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS -#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN -#define MBEDTLS_CIPHER_PADDING_ZEROS - -/** - * \def MBEDTLS_ENABLE_WEAK_CIPHERSUITES - * - * Enable weak ciphersuites in SSL / TLS. - * Warning: Only do so when you know what you are doing. This allows for - * channels with virtually no security at all! - * - * This enables the following ciphersuites: - * MBEDTLS_TLS_RSA_WITH_DES_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA - * - * Uncomment this macro to enable weak ciphersuites - */ -//#define MBEDTLS_ENABLE_WEAK_CIPHERSUITES - -/** - * \def MBEDTLS_REMOVE_ARC4_CIPHERSUITES - * - * Remove RC4 ciphersuites by default in SSL / TLS. - * This flag removes the ciphersuites based on RC4 from the default list as - * returned by mbedtls_ssl_list_ciphersuites(). However, it is still possible to - * enable (some of) them with mbedtls_ssl_conf_ciphersuites() by including them - * explicitly. - * - * Uncomment this macro to remove RC4 ciphersuites by default. - */ -#ifdef CONFIG_MBEDTLS_RC4_ENABLED -#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES -#endif - -/** - * \def MBEDTLS_ECP_DP_SECP192R1_ENABLED - * - * MBEDTLS_ECP_XXXX_ENABLED: Enables specific curves within the Elliptic Curve - * module. By default all supported curves are enabled. - * - * Comment macros to disable the curve and functions for it - */ -#ifdef CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED -#define MBEDTLS_ECP_DP_SECP192R1_ENABLED -#endif -#ifdef CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED -#define MBEDTLS_ECP_DP_SECP224R1_ENABLED -#endif -#ifdef CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED -#define MBEDTLS_ECP_DP_SECP256R1_ENABLED -#endif -#ifdef CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED -#define MBEDTLS_ECP_DP_SECP384R1_ENABLED -#endif -#ifdef CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED -#define MBEDTLS_ECP_DP_SECP521R1_ENABLED -#endif -#ifdef CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED -#define MBEDTLS_ECP_DP_SECP192K1_ENABLED -#endif -#ifdef CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED -#define MBEDTLS_ECP_DP_SECP224K1_ENABLED -#endif -#ifdef CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED -#define MBEDTLS_ECP_DP_SECP256K1_ENABLED -#endif -#ifdef CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED -#define MBEDTLS_ECP_DP_BP256R1_ENABLED -#endif -#ifdef CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED -#define MBEDTLS_ECP_DP_BP384R1_ENABLED -#endif -#ifdef CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED -#define MBEDTLS_ECP_DP_BP512R1_ENABLED -#endif -#ifdef CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED -#define MBEDTLS_ECP_DP_CURVE25519_ENABLED -#endif - -/** - * \def MBEDTLS_ECP_NIST_OPTIM - * - * Enable specific 'modulo p' routines for each NIST prime. - * Depending on the prime and architecture, makes operations 4 to 8 times - * faster on the corresponding curve. - * - * Comment this macro to disable NIST curves optimisation. - */ -#ifdef CONFIG_MBEDTLS_ECP_NIST_OPTIM -#define MBEDTLS_ECP_NIST_OPTIM -#endif - -/** - * \def MBEDTLS_ECDSA_DETERMINISTIC - * - * Enable deterministic ECDSA (RFC 6979). - * Standard ECDSA is "fragile" in the sense that lack of entropy when signing - * may result in a compromise of the long-term signing key. This is avoided by - * the deterministic variant. - * - * Requires: MBEDTLS_HMAC_DRBG_C - * - * Comment this macro to disable deterministic ECDSA. - */ -#define MBEDTLS_ECDSA_DETERMINISTIC - -/** - * \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED - * - * Enable the PSK based ciphersuite modes in SSL / TLS. - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_RC4_128_SHA - */ -#ifdef CONFIG_MBEDTLS_KEY_EXCHANGE_PSK -#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED -#endif - -/** - * \def MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED - * - * Enable the DHE-PSK based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_DHM_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA - */ -#ifdef CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_PSK -#define MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED -#endif - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED - * - * Enable the ECDHE-PSK based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA - */ -#ifdef CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK -#define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED -#endif - -/** - * \def MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED - * - * Enable the RSA-PSK based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA - */ -#ifdef CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_PSK -#define MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED -#endif - -/** - * \def MBEDTLS_KEY_EXCHANGE_RSA_ENABLED - * - * Enable the RSA-only based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_RSA_WITH_RC4_128_MD5 - */ -#ifdef CONFIG_MBEDTLS_KEY_EXCHANGE_RSA -#define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED -#endif - -/** - * \def MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED - * - * Enable the DHE-RSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_DHM_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA - */ -#ifdef CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA -#define MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED -#endif - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED - * - * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA - */ -#ifdef CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA -#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED -#endif - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED - * - * Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C, MBEDTLS_ECDSA_C, MBEDTLS_X509_CRT_PARSE_C, - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA - */ -#ifdef CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA -#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED -#endif - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED - * - * Enable the ECDH-ECDSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C, MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 - */ -#ifdef CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA -#define MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED -#endif - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED - * - * Enable the ECDH-RSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C, MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 - */ -#ifdef CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA -#define MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED -#endif - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED - * - * Enable the ECJPAKE based ciphersuite modes in SSL / TLS. - * - * \warning This is currently experimental. EC J-PAKE support is based on the - * Thread v1.0.0 specification; incompatible changes to the specification - * might still happen. For this reason, this is disabled by default. - * - * Requires: MBEDTLS_ECJPAKE_C - * MBEDTLS_SHA256_C - * MBEDTLS_ECP_DP_SECP256R1_ENABLED - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 - */ -//#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED - -/** - * \def MBEDTLS_PK_PARSE_EC_EXTENDED - * - * Enhance support for reading EC keys using variants of SEC1 not allowed by - * RFC 5915 and RFC 5480. - * - * Currently this means parsing the SpecifiedECDomain choice of EC - * parameters (only known groups are supported, not arbitrary domains, to - * avoid validation issues). - * - * Disable if you only need to support RFC 5915 + 5480 key formats. - */ -#define MBEDTLS_PK_PARSE_EC_EXTENDED - -/** - * \def MBEDTLS_ERROR_STRERROR_DUMMY - * - * Enable a dummy error function to make use of mbedtls_strerror() in - * third party libraries easier when MBEDTLS_ERROR_C is disabled - * (no effect when MBEDTLS_ERROR_C is enabled). - * - * You can safely disable this if MBEDTLS_ERROR_C is enabled, or if you're - * not using mbedtls_strerror() or error_strerror() in your application. - * - * Disable if you run into name conflicts and want to really remove the - * mbedtls_strerror() - */ -#define MBEDTLS_ERROR_STRERROR_DUMMY - -/** - * \def MBEDTLS_GENPRIME - * - * Enable the prime-number generation code. - * - * Requires: MBEDTLS_BIGNUM_C - */ -#define MBEDTLS_GENPRIME - -/** - * \def MBEDTLS_FS_IO - * - * Enable functions that use the filesystem. - */ -#define MBEDTLS_FS_IO - -/** - * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES - * - * Do not add default entropy sources. These are the platform specific, - * mbedtls_timing_hardclock and HAVEGE based poll functions. - * - * This is useful to have more control over the added entropy sources in an - * application. - * - * Uncomment this macro to prevent loading of default entropy functions. - */ -//#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES - -/** - * \def MBEDTLS_NO_PLATFORM_ENTROPY - * - * Do not use built-in platform entropy functions. - * This is useful if your platform does not support - * standards like the /dev/urandom or Windows CryptoAPI. - * - * Uncomment this macro to disable the built-in platform entropy functions. - */ -#define MBEDTLS_NO_PLATFORM_ENTROPY - -/** - * \def MBEDTLS_ENTROPY_FORCE_SHA256 - * - * Force the entropy accumulator to use a SHA-256 accumulator instead of the - * default SHA-512 based one (if both are available). - * - * Requires: MBEDTLS_SHA256_C - * - * On 32-bit systems SHA-256 can be much faster than SHA-512. Use this option - * if you have performance concerns. - * - * This option is only useful if both MBEDTLS_SHA256_C and - * MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used. - */ -//#define MBEDTLS_ENTROPY_FORCE_SHA256 - -/** - * \def MBEDTLS_MEMORY_DEBUG - * - * Enable debugging of buffer allocator memory issues. Automatically prints - * (to stderr) all (fatal) messages on memory allocation issues. Enables - * function for 'debug output' of allocated memory. - * - * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C - * - * Uncomment this macro to let the buffer allocator print out error messages. - */ -//#define MBEDTLS_MEMORY_DEBUG - -/** - * \def MBEDTLS_MEMORY_BACKTRACE - * - * Include backtrace information with each allocated block. - * - * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C - * GLIBC-compatible backtrace() an backtrace_symbols() support - * - * Uncomment this macro to include backtrace information - */ -//#define MBEDTLS_MEMORY_BACKTRACE - -/** - * \def MBEDTLS_PK_RSA_ALT_SUPPORT - * - * Support external private RSA keys (eg from a HSM) in the PK layer. - * - * Comment this macro to disable support for external private RSA keys. - */ -#define MBEDTLS_PK_RSA_ALT_SUPPORT - -/** - * \def MBEDTLS_PKCS1_V15 - * - * Enable support for PKCS#1 v1.5 encoding. - * - * Requires: MBEDTLS_RSA_C - * - * This enables support for PKCS#1 v1.5 operations. - */ -#define MBEDTLS_PKCS1_V15 - -/** - * \def MBEDTLS_PKCS1_V21 - * - * Enable support for PKCS#1 v2.1 encoding. - * - * Requires: MBEDTLS_MD_C, MBEDTLS_RSA_C - * - * This enables support for RSAES-OAEP and RSASSA-PSS operations. - */ -#define MBEDTLS_PKCS1_V21 - -/** - * \def MBEDTLS_RSA_NO_CRT - * - * Do not use the Chinese Remainder Theorem for the RSA private operation. - * - * Uncomment this macro to disable the use of CRT in RSA. - * - */ -//#define MBEDTLS_RSA_NO_CRT - -/** - * \def MBEDTLS_SELF_TEST - * - * Enable the checkup functions (*_self_test). - */ -#define MBEDTLS_SELF_TEST - -/** - * \def MBEDTLS_SHA256_SMALLER - * - * Enable an implementation of SHA-256 that has lower ROM footprint but also - * lower performance. - * - * The default implementation is meant to be a reasonnable compromise between - * performance and size. This version optimizes more aggressively for size at - * the expense of performance. Eg on Cortex-M4 it reduces the size of - * mbedtls_sha256_process() from ~2KB to ~0.5KB for a performance hit of about - * 30%. - * - * Uncomment to enable the smaller implementation of SHA256. - */ -//#define MBEDTLS_SHA256_SMALLER - -/** - * \def MBEDTLS_SSL_AEAD_RANDOM_IV - * - * Generate a random IV rather than using the record sequence number as a - * nonce for ciphersuites using and AEAD algorithm (GCM or CCM). - * - * Using the sequence number is generally recommended. - * - * Uncomment this macro to always use random IVs with AEAD ciphersuites. - */ -//#define MBEDTLS_SSL_AEAD_RANDOM_IV - -/** - * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES - * - * Enable sending of alert messages in case of encountered errors as per RFC. - * If you choose not to send the alert messages, mbed TLS can still communicate - * with other servers, only debugging of failures is harder. - * - * The advantage of not sending alert messages, is that no information is given - * about reasons for failures thus preventing adversaries of gaining intel. - * - * Enable sending of all alert messages - */ -#define MBEDTLS_SSL_ALL_ALERT_MESSAGES - -/** - * \def MBEDTLS_SSL_DEBUG_ALL - * - * Enable the debug messages in SSL module for all issues. - * Debug messages have been disabled in some places to prevent timing - * attacks due to (unbalanced) debugging function calls. - * - * If you need all error reporting you should enable this during debugging, - * but remove this for production servers that should log as well. - * - * Uncomment this macro to report all debug messages on errors introducing - * a timing side-channel. - * - */ -//#define MBEDTLS_SSL_DEBUG_ALL - -/** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC - * - * Enable support for Encrypt-then-MAC, RFC 7366. - * - * This allows peers that both support it to use a more robust protection for - * ciphersuites using CBC, providing deep resistance against timing attacks - * on the padding or underlying cipher. - * - * This only affects CBC ciphersuites, and is useless if none is defined. - * - * Requires: MBEDTLS_SSL_PROTO_TLS1 or - * MBEDTLS_SSL_PROTO_TLS1_1 or - * MBEDTLS_SSL_PROTO_TLS1_2 - * - * Comment this macro to disable support for Encrypt-then-MAC - */ -#ifdef CONFIG_MBEDTLS_TLS_ENABLED -#define MBEDTLS_SSL_ENCRYPT_THEN_MAC -#endif - -/** \def MBEDTLS_SSL_EXTENDED_MASTER_SECRET - * - * Enable support for Extended Master Secret, aka Session Hash - * (draft-ietf-tls-session-hash-02). - * - * This was introduced as "the proper fix" to the Triple Handshake familiy of - * attacks, but it is recommended to always use it (even if you disable - * renegotiation), since it actually fixes a more fundamental issue in the - * original SSL/TLS design, and has implications beyond Triple Handshake. - * - * Requires: MBEDTLS_SSL_PROTO_TLS1 or - * MBEDTLS_SSL_PROTO_TLS1_1 or - * MBEDTLS_SSL_PROTO_TLS1_2 - * - * Comment this macro to disable support for Extended Master Secret. - */ -#ifdef CONFIG_MBEDTLS_TLS_ENABLED -#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET -#endif - -/** - * \def MBEDTLS_SSL_FALLBACK_SCSV - * - * Enable support for FALLBACK_SCSV (draft-ietf-tls-downgrade-scsv-00). - * - * For servers, it is recommended to always enable this, unless you support - * only one version of TLS, or know for sure that none of your clients - * implements a fallback strategy. - * - * For clients, you only need this if you're using a fallback strategy, which - * is not recommended in the first place, unless you absolutely need it to - * interoperate with buggy (version-intolerant) servers. - * - * Comment this macro to disable support for FALLBACK_SCSV - */ -#define MBEDTLS_SSL_FALLBACK_SCSV - -/** - * \def MBEDTLS_SSL_HW_RECORD_ACCEL - * - * Enable hooking functions in SSL module for hardware acceleration of - * individual records. - * - * Uncomment this macro to enable hooking functions. - */ -//#define MBEDTLS_SSL_HW_RECORD_ACCEL - -/** - * \def MBEDTLS_SSL_CBC_RECORD_SPLITTING - * - * Enable 1/n-1 record splitting for CBC mode in SSLv3 and TLS 1.0. - * - * This is a countermeasure to the BEAST attack, which also minimizes the risk - * of interoperability issues compared to sending 0-length records. - * - * Comment this macro to disable 1/n-1 record splitting. - */ -#if defined(MBEDTLS_SSL_PROTO_SSL3) || defined(MBEDTLS_SSL_PROTO_TLS1) -#define MBEDTLS_SSL_CBC_RECORD_SPLITTING -#endif - -/** - * \def MBEDTLS_SSL_RENEGOTIATION - * - * Disable support for TLS renegotiation. - * - * The two main uses of renegotiation are (1) refresh keys on long-lived - * connections and (2) client authentication after the initial handshake. - * If you don't need renegotiation, it's probably better to disable it, since - * it has been associated with security issues in the past and is easy to - * misuse/misunderstand. - * - * Comment this to disable support for renegotiation. - */ -#ifdef CONFIG_MBEDTLS_SSL_RENEGOTIATION -#define MBEDTLS_SSL_RENEGOTIATION -#endif - -/** - * \def MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO - * - * Enable support for receiving and parsing SSLv2 Client Hello messages for the - * SSL Server module (MBEDTLS_SSL_SRV_C). - * - * Uncomment this macro to enable support for SSLv2 Client Hello messages. - */ -//#define MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO - -/** - * \def MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE - * - * Pick the ciphersuite according to the client's preferences rather than ours - * in the SSL Server module (MBEDTLS_SSL_SRV_C). - * - * Uncomment this macro to respect client's ciphersuite order - */ -//#define MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE - -/** - * \def MBEDTLS_SSL_MAX_FRAGMENT_LENGTH - * - * Enable support for RFC 6066 max_fragment_length extension in SSL. - * - * Comment this macro to disable support for the max_fragment_length extension - */ -#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH - -/** - * \def MBEDTLS_SSL_PROTO_SSL3 - * - * Enable support for SSL 3.0. - * - * Requires: MBEDTLS_MD5_C - * MBEDTLS_SHA1_C - * - * Comment this macro to disable support for SSL 3.0 - */ -#ifdef CONFIG_MBEDTLS_SSL_PROTO_SSL3 -#define MBEDTLS_SSL_PROTO_SSL3 -#endif - -/** - * \def MBEDTLS_SSL_PROTO_TLS1 - * - * Enable support for TLS 1.0. - * - * Requires: MBEDTLS_MD5_C - * MBEDTLS_SHA1_C - * - * Comment this macro to disable support for TLS 1.0 - */ -#ifdef CONFIG_MBEDTLS_SSL_PROTO_TLS1 -#define MBEDTLS_SSL_PROTO_TLS1 -#endif - -/** - * \def MBEDTLS_SSL_PROTO_TLS1_1 - * - * Enable support for TLS 1.1 (and DTLS 1.0 if DTLS is enabled). - * - * Requires: MBEDTLS_MD5_C - * MBEDTLS_SHA1_C - * - * Comment this macro to disable support for TLS 1.1 / DTLS 1.0 - */ -#ifdef CONFIG_MBEDTLS_SSL_PROTO_TLS1_1 -#define MBEDTLS_SSL_PROTO_TLS1_1 -#endif - -/** - * \def MBEDTLS_SSL_PROTO_TLS1_2 - * - * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled). - * - * Requires: MBEDTLS_SHA1_C or MBEDTLS_SHA256_C or MBEDTLS_SHA512_C - * (Depends on ciphersuites) - * - * Comment this macro to disable support for TLS 1.2 / DTLS 1.2 - */ -#ifdef CONFIG_MBEDTLS_SSL_PROTO_TLS1_2 -#define MBEDTLS_SSL_PROTO_TLS1_2 -#endif - -/** - * \def MBEDTLS_SSL_PROTO_DTLS - * - * Enable support for DTLS (all available versions). - * - * Enable this and MBEDTLS_SSL_PROTO_TLS1_1 to enable DTLS 1.0, - * and/or this and MBEDTLS_SSL_PROTO_TLS1_2 to enable DTLS 1.2. - * - * Requires: MBEDTLS_SSL_PROTO_TLS1_1 - * or MBEDTLS_SSL_PROTO_TLS1_2 - * - * Comment this macro to disable support for DTLS - */ -#ifdef CONFIG_MBEDTLS_SSL_PROTO_DTLS -#define MBEDTLS_SSL_PROTO_DTLS -#endif - -/** - * \def MBEDTLS_SSL_ALPN - * - * Enable support for RFC 7301 Application Layer Protocol Negotiation. - * - * Comment this macro to disable support for ALPN. - */ -#ifdef CONFIG_MBEDTLS_SSL_ALPN -#define MBEDTLS_SSL_ALPN -#endif - -/** - * \def MBEDTLS_SSL_DTLS_ANTI_REPLAY - * - * Enable support for the anti-replay mechanism in DTLS. - * - * Requires: MBEDTLS_SSL_TLS_C - * MBEDTLS_SSL_PROTO_DTLS - * - * \warning Disabling this is often a security risk! - * See mbedtls_ssl_conf_dtls_anti_replay() for details. - * - * Comment this to disable anti-replay in DTLS. - */ -#ifdef CONFIG_MBEDTLS_SSL_PROTO_DTLS -#define MBEDTLS_SSL_DTLS_ANTI_REPLAY -#endif - -/** - * \def MBEDTLS_SSL_DTLS_HELLO_VERIFY - * - * Enable support for HelloVerifyRequest on DTLS servers. - * - * This feature is highly recommended to prevent DTLS servers being used as - * amplifiers in DoS attacks against other hosts. It should always be enabled - * unless you know for sure amplification cannot be a problem in the - * environment in which your server operates. - * - * \warning Disabling this can ba a security risk! (see above) - * - * Requires: MBEDTLS_SSL_PROTO_DTLS - * - * Comment this to disable support for HelloVerifyRequest. - */ -#ifdef CONFIG_MBEDTLS_SSL_PROTO_DTLS -#define MBEDTLS_SSL_DTLS_HELLO_VERIFY -#endif - -/** - * \def MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE - * - * Enable server-side support for clients that reconnect from the same port. - * - * Some clients unexpectedly close the connection and try to reconnect using the - * same source port. This needs special support from the server to handle the - * new connection securely, as described in section 4.2.8 of RFC 6347. This - * flag enables that support. - * - * Requires: MBEDTLS_SSL_DTLS_HELLO_VERIFY - * - * Comment this to disable support for clients reusing the source port. - */ -#ifdef CONFIG_MBEDTLS_SSL_PROTO_DTLS -#define MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE -#endif - -/** - * \def MBEDTLS_SSL_DTLS_BADMAC_LIMIT - * - * Enable support for a limit of records with bad MAC. - * - * See mbedtls_ssl_conf_dtls_badmac_limit(). - * - * Requires: MBEDTLS_SSL_PROTO_DTLS - */ -#ifdef CONFIG_MBEDTLS_SSL_PROTO_DTLS -#define MBEDTLS_SSL_DTLS_BADMAC_LIMIT -#endif - -/** - * \def MBEDTLS_SSL_SESSION_TICKETS - * - * Enable support for RFC 5077 session tickets in SSL. - * Client-side, provides full support for session tickets (maintainance of a - * session store remains the responsibility of the application, though). - * Server-side, you also need to provide callbacks for writing and parsing - * tickets, including authenticated encryption and key management. Example - * callbacks are provided by MBEDTLS_SSL_TICKET_C. - * - * Comment this macro to disable support for SSL session tickets - */ -#ifdef CONFIG_MBEDTLS_SSL_SESSION_TICKETS -#define MBEDTLS_SSL_SESSION_TICKETS -#endif - -/** - * \def MBEDTLS_SSL_EXPORT_KEYS - * - * Enable support for exporting key block and master secret. - * This is required for certain users of TLS, e.g. EAP-TLS. - * - * Comment this macro to disable support for key export - */ -#define MBEDTLS_SSL_EXPORT_KEYS - -/** - * \def MBEDTLS_SSL_SERVER_NAME_INDICATION - * - * Enable support for RFC 6066 server name indication (SNI) in SSL. - * - * Requires: MBEDTLS_X509_CRT_PARSE_C - * - * Comment this macro to disable support for server name indication in SSL - */ -#define MBEDTLS_SSL_SERVER_NAME_INDICATION - -/** - * \def MBEDTLS_SSL_TRUNCATED_HMAC - * - * Enable support for RFC 6066 truncated HMAC in SSL. - * - * Comment this macro to disable support for truncated HMAC in SSL - */ -#define MBEDTLS_SSL_TRUNCATED_HMAC - -/** - * \def MBEDTLS_THREADING_ALT - * - * Provide your own alternate threading implementation. - * - * Requires: MBEDTLS_THREADING_C - * - * Uncomment this to allow your own alternate threading implementation. - */ -//#define MBEDTLS_THREADING_ALT - -/** - * \def MBEDTLS_THREADING_PTHREAD - * - * Enable the pthread wrapper layer for the threading layer. - * - * Requires: MBEDTLS_THREADING_C - * - * Uncomment this to enable pthread mutexes. - */ -//#define MBEDTLS_THREADING_PTHREAD - -/** - * \def MBEDTLS_VERSION_FEATURES - * - * Allow run-time checking of compile-time enabled features. Thus allowing users - * to check at run-time if the library is for instance compiled with threading - * support via mbedtls_version_check_feature(). - * - * Requires: MBEDTLS_VERSION_C - * - * Comment this to disable run-time checking and save ROM space - */ -#define MBEDTLS_VERSION_FEATURES - -/** - * \def MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 - * - * If set, the X509 parser will not break-off when parsing an X509 certificate - * and encountering an extension in a v1 or v2 certificate. - * - * Uncomment to prevent an error. - */ -//#define MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 - -/** - * \def MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION - * - * If set, the X509 parser will not break-off when parsing an X509 certificate - * and encountering an unknown critical extension. - * - * \warning Depending on your PKI use, enabling this can be a security risk! - * - * Uncomment to prevent an error. - */ -//#define MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION - -/** - * \def MBEDTLS_X509_CHECK_KEY_USAGE - * - * Enable verification of the keyUsage extension (CA and leaf certificates). - * - * Disabling this avoids problems with mis-issued and/or misused - * (intermediate) CA and leaf certificates. - * - * \warning Depending on your PKI use, disabling this can be a security risk! - * - * Comment to skip keyUsage checking for both CA and leaf certificates. - */ -#define MBEDTLS_X509_CHECK_KEY_USAGE - -/** - * \def MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE - * - * Enable verification of the extendedKeyUsage extension (leaf certificates). - * - * Disabling this avoids problems with mis-issued and/or misused certificates. - * - * \warning Depending on your PKI use, disabling this can be a security risk! - * - * Comment to skip extendedKeyUsage checking for certificates. - */ -#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE - -/** - * \def MBEDTLS_X509_RSASSA_PSS_SUPPORT - * - * Enable parsing and verification of X.509 certificates, CRLs and CSRS - * signed with RSASSA-PSS (aka PKCS#1 v2.1). - * - * Comment this macro to disallow using RSASSA-PSS in certificates. - */ -#define MBEDTLS_X509_RSASSA_PSS_SUPPORT - -/** - * \def MBEDTLS_ZLIB_SUPPORT - * - * If set, the SSL/TLS module uses ZLIB to support compression and - * decompression of packet data. - * - * \warning TLS-level compression MAY REDUCE SECURITY! See for example the - * CRIME attack. Before enabling this option, you should examine with care if - * CRIME or similar exploits may be a applicable to your use case. - * - * \note Currently compression can't be used with DTLS. - * - * Used in: library/ssl_tls.c - * library/ssl_cli.c - * library/ssl_srv.c - * - * This feature requires zlib library and headers to be present. - * - * Uncomment to enable use of ZLIB - */ -//#define MBEDTLS_ZLIB_SUPPORT -/* \} name SECTION: mbed TLS feature support */ - -/** - * \name SECTION: mbed TLS modules - * - * This section enables or disables entire modules in mbed TLS - * \{ - */ - -/** - * \def MBEDTLS_AESNI_C - * - * Enable AES-NI support on x86-64. - * - * Module: library/aesni.c - * Caller: library/aes.c - * - * Requires: MBEDTLS_HAVE_ASM - * - * This modules adds support for the AES-NI instructions on x86-64 - */ -#define MBEDTLS_AESNI_C - -/** - * \def MBEDTLS_AES_C - * - * Enable the AES block cipher. - * - * Module: library/aes.c - * Caller: library/ssl_tls.c - * library/pem.c - * library/ctr_drbg.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA - * - * PEM_PARSE uses AES for decrypting encrypted keys. - */ -#ifdef CONFIG_MBEDTLS_AES_C -#define MBEDTLS_AES_C -#endif - -/** - * \def MBEDTLS_ARC4_C - * - * Enable the ARCFOUR stream cipher. - * - * Module: library/arc4.c - * Caller: library/ssl_tls.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA - * MBEDTLS_TLS_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_RSA_WITH_RC4_128_MD5 - * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA - * MBEDTLS_TLS_PSK_WITH_RC4_128_SHA - */ -#if defined(CONFIG_MBEDTLS_RC4_ENABLED_NO_DEFAULT) || defined(CONFIG_MBEDTLS_RC4_ENABLED) -#define MBEDTLS_ARC4_C -#endif - -/** - * \def MBEDTLS_ASN1_PARSE_C - * - * Enable the generic ASN1 parser. - * - * Module: library/asn1.c - * Caller: library/x509.c - * library/dhm.c - * library/pkcs12.c - * library/pkcs5.c - * library/pkparse.c - */ -#define MBEDTLS_ASN1_PARSE_C - -/** - * \def MBEDTLS_ASN1_WRITE_C - * - * Enable the generic ASN1 writer. - * - * Module: library/asn1write.c - * Caller: library/ecdsa.c - * library/pkwrite.c - * library/x509_create.c - * library/x509write_crt.c - * library/mbedtls_x509write_csr.c - */ -#define MBEDTLS_ASN1_WRITE_C - -/** - * \def MBEDTLS_BASE64_C - * - * Enable the Base64 module. - * - * Module: library/base64.c - * Caller: library/pem.c - * - * This module is required for PEM support (required by X.509). - */ -#define MBEDTLS_BASE64_C - -/** - * \def MBEDTLS_BIGNUM_C - * - * Enable the multi-precision integer library. - * - * Module: library/bignum.c - * Caller: library/dhm.c - * library/ecp.c - * library/ecdsa.c - * library/rsa.c - * library/ssl_tls.c - * - * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support. - */ -#define MBEDTLS_BIGNUM_C - -/** - * \def MBEDTLS_BLOWFISH_C - * - * Enable the Blowfish block cipher. - * - * Module: library/blowfish.c - */ -#ifdef CONFIG_MBEDTLS_BLOWFISH_C -#define MBEDTLS_BLOWFISH_C -#endif - -/** - * \def MBEDTLS_CAMELLIA_C - * - * Enable the Camellia block cipher. - * - * Module: library/camellia.c - * Caller: library/ssl_tls.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 - */ -#ifdef CONFIG_MBEDTLS_CAMELLIA_C -#define MBEDTLS_CAMELLIA_C -#endif - -/** - * \def MBEDTLS_CCM_C - * - * Enable the Counter with CBC-MAC (CCM) mode for 128-bit block cipher. - * - * Module: library/ccm.c - * - * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C - * - * This module enables the AES-CCM ciphersuites, if other requisites are - * enabled as well. - */ -#ifdef CONFIG_MBEDTLS_CCM_C -#define MBEDTLS_CCM_C -#endif - -/** - * \def MBEDTLS_CERTS_C - * - * Enable the test certificates. - * - * Module: library/certs.c - * Caller: - * - * This module is used for testing (ssl_client/server). - */ -#define MBEDTLS_CERTS_C - -/** - * \def MBEDTLS_CIPHER_C - * - * Enable the generic cipher layer. - * - * Module: library/cipher.c - * Caller: library/ssl_tls.c - * - * Uncomment to enable generic cipher wrappers. - */ -#define MBEDTLS_CIPHER_C - -/** - * \def MBEDTLS_CTR_DRBG_C - * - * Enable the CTR_DRBG AES-256-based random generator. - * - * Module: library/ctr_drbg.c - * Caller: - * - * Requires: MBEDTLS_AES_C - * - * This module provides the CTR_DRBG AES-256 random number generator. - */ -#define MBEDTLS_CTR_DRBG_C - -/** - * \def MBEDTLS_DEBUG_C - * - * Enable the debug functions. - * - * Module: library/debug.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * - * This module provides debugging functions. - */ -#if CONFIG_MBEDTLS_DEBUG -#define MBEDTLS_DEBUG_C -#endif - -/** - * \def MBEDTLS_DES_C - * - * Enable the DES block cipher. - * - * Module: library/des.c - * Caller: library/pem.c - * library/ssl_tls.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA - * - * PEM_PARSE uses DES/3DES for decrypting encrypted keys. - */ -#ifdef CONFIG_MBEDTLS_DES_C -#define MBEDTLS_DES_C -#endif - -/** - * \def MBEDTLS_DHM_C - * - * Enable the Diffie-Hellman-Merkle module. - * - * Module: library/dhm.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * - * This module is used by the following key exchanges: - * DHE-RSA, DHE-PSK - */ -#define MBEDTLS_DHM_C - -/** - * \def MBEDTLS_ECDH_C - * - * Enable the elliptic curve Diffie-Hellman library. - * - * Module: library/ecdh.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * - * This module is used by the following key exchanges: - * ECDHE-ECDSA, ECDHE-RSA, DHE-PSK - * - * Requires: MBEDTLS_ECP_C - */ -#ifdef CONFIG_MBEDTLS_ECDH_C -#define MBEDTLS_ECDH_C -#endif - -/** - * \def MBEDTLS_ECDSA_C - * - * Enable the elliptic curve DSA library. - * - * Module: library/ecdsa.c - * Caller: - * - * This module is used by the following key exchanges: - * ECDHE-ECDSA - * - * Requires: MBEDTLS_ECP_C, MBEDTLS_ASN1_WRITE_C, MBEDTLS_ASN1_PARSE_C - */ -#ifdef CONFIG_MBEDTLS_ECDSA_C -#define MBEDTLS_ECDSA_C -#endif - -/** - * \def MBEDTLS_ECJPAKE_C - * - * Enable the elliptic curve J-PAKE library. - * - * \warning This is currently experimental. EC J-PAKE support is based on the - * Thread v1.0.0 specification; incompatible changes to the specification - * might still happen. For this reason, this is disabled by default. - * - * Module: library/ecjpake.c - * Caller: - * - * This module is used by the following key exchanges: - * ECJPAKE - * - * Requires: MBEDTLS_ECP_C, MBEDTLS_MD_C - */ -//#define MBEDTLS_ECJPAKE_C - -/** - * \def MBEDTLS_ECP_C - * - * Enable the elliptic curve over GF(p) library. - * - * Module: library/ecp.c - * Caller: library/ecdh.c - * library/ecdsa.c - * library/ecjpake.c - * - * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED - */ -#ifdef CONFIG_MBEDTLS_ECP_C -#define MBEDTLS_ECP_C -#endif - -/** - * \def MBEDTLS_ENTROPY_C - * - * Enable the platform-specific entropy code. - * - * Module: library/entropy.c - * Caller: - * - * Requires: MBEDTLS_SHA512_C or MBEDTLS_SHA256_C - * - * This module provides a generic entropy pool - */ -#define MBEDTLS_ENTROPY_C - -/** - * \def MBEDTLS_ERROR_C - * - * Enable error code to error string conversion. - * - * Module: library/error.c - * Caller: - * - * This module enables mbedtls_strerror(). - */ -#define MBEDTLS_ERROR_C - -/** - * \def MBEDTLS_GCM_C - * - * Enable the Galois/Counter Mode (GCM) for AES. - * - * Module: library/gcm.c - * - * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C - * - * This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other - * requisites are enabled as well. - */ -#ifdef CONFIG_MBEDTLS_GCM_C -#define MBEDTLS_GCM_C -#endif - -/** - * \def MBEDTLS_HAVEGE_C - * - * Enable the HAVEGE random generator. - * - * Warning: the HAVEGE random generator is not suitable for virtualized - * environments - * - * Warning: the HAVEGE random generator is dependent on timing and specific - * processor traits. It is therefore not advised to use HAVEGE as - * your applications primary random generator or primary entropy pool - * input. As a secondary input to your entropy pool, it IS able add - * the (limited) extra entropy it provides. - * - * Module: library/havege.c - * Caller: - * - * Requires: MBEDTLS_TIMING_C - * - * Uncomment to enable the HAVEGE random generator. - */ -//#define MBEDTLS_HAVEGE_C - -/** - * \def MBEDTLS_HMAC_DRBG_C - * - * Enable the HMAC_DRBG random generator. - * - * Module: library/hmac_drbg.c - * Caller: - * - * Requires: MBEDTLS_MD_C - * - * Uncomment to enable the HMAC_DRBG random number geerator. - */ -#define MBEDTLS_HMAC_DRBG_C - -/** - * \def MBEDTLS_MD_C - * - * Enable the generic message digest layer. - * - * Module: library/mbedtls_md.c - * Caller: - * - * Uncomment to enable generic message digest wrappers. - */ -#define MBEDTLS_MD_C - -/** - * \def MBEDTLS_MD2_C - * - * Enable the MD2 hash algorithm. - * - * Module: library/mbedtls_md2.c - * Caller: - * - * Uncomment to enable support for (rare) MD2-signed X.509 certs. - */ -//#define MBEDTLS_MD2_C - -/** - * \def MBEDTLS_MD4_C - * - * Enable the MD4 hash algorithm. - * - * Module: library/mbedtls_md4.c - * Caller: - * - * Uncomment to enable support for (rare) MD4-signed X.509 certs. - */ -//#define MBEDTLS_MD4_C - -/** - * \def MBEDTLS_MD5_C - * - * Enable the MD5 hash algorithm. - * - * Module: library/mbedtls_md5.c - * Caller: library/mbedtls_md.c - * library/pem.c - * library/ssl_tls.c - * - * This module is required for SSL/TLS and X.509. - * PEM_PARSE uses MD5 for decrypting encrypted keys. - */ -#define MBEDTLS_MD5_C - -/** - * \def MBEDTLS_MEMORY_BUFFER_ALLOC_C - * - * Enable the buffer allocator implementation that makes use of a (stack) - * based buffer to 'allocate' dynamic memory. (replaces calloc() and free() - * calls) - * - * Module: library/memory_buffer_alloc.c - * - * Requires: MBEDTLS_PLATFORM_C - * MBEDTLS_PLATFORM_MEMORY (to use it within mbed TLS) - * - * Enable this module to enable the buffer memory allocator. - */ -//#define MBEDTLS_MEMORY_BUFFER_ALLOC_C - -/** - * \def MBEDTLS_NET_C - * - * Enable the TCP/IP networking routines. - * - * Module: library/net.c - * - * This module provides TCP/IP networking routines. - */ -//#define MBEDTLS_NET_C - -/** - * \def MBEDTLS_OID_C - * - * Enable the OID database. - * - * Module: library/oid.c - * Caller: library/asn1write.c - * library/pkcs5.c - * library/pkparse.c - * library/pkwrite.c - * library/rsa.c - * library/x509.c - * library/x509_create.c - * library/mbedtls_x509_crl.c - * library/mbedtls_x509_crt.c - * library/mbedtls_x509_csr.c - * library/x509write_crt.c - * library/mbedtls_x509write_csr.c - * - * This modules translates between OIDs and internal values. - */ -#define MBEDTLS_OID_C - -/** - * \def MBEDTLS_PADLOCK_C - * - * Enable VIA Padlock support on x86. - * - * Module: library/padlock.c - * Caller: library/aes.c - * - * Requires: MBEDTLS_HAVE_ASM - * - * This modules adds support for the VIA PadLock on x86. - */ -#define MBEDTLS_PADLOCK_C - -/** - * \def MBEDTLS_PEM_PARSE_C - * - * Enable PEM decoding / parsing. - * - * Module: library/pem.c - * Caller: library/dhm.c - * library/pkparse.c - * library/mbedtls_x509_crl.c - * library/mbedtls_x509_crt.c - * library/mbedtls_x509_csr.c - * - * Requires: MBEDTLS_BASE64_C - * - * This modules adds support for decoding / parsing PEM files. - */ -#ifdef CONFIG_MBEDTLS_PEM_PARSE_C -#define MBEDTLS_PEM_PARSE_C -#endif - -/** - * \def MBEDTLS_PEM_WRITE_C - * - * Enable PEM encoding / writing. - * - * Module: library/pem.c - * Caller: library/pkwrite.c - * library/x509write_crt.c - * library/mbedtls_x509write_csr.c - * - * Requires: MBEDTLS_BASE64_C - * - * This modules adds support for encoding / writing PEM files. - */ -#ifdef CONFIG_MBEDTLS_PEM_WRITE_C -#define MBEDTLS_PEM_WRITE_C -#endif - -/** - * \def MBEDTLS_PK_C - * - * Enable the generic public (asymetric) key layer. - * - * Module: library/pk.c - * Caller: library/ssl_tls.c - * library/ssl_cli.c - * library/ssl_srv.c - * - * Requires: MBEDTLS_RSA_C or MBEDTLS_ECP_C - * - * Uncomment to enable generic public key wrappers. - */ -#define MBEDTLS_PK_C - -/** - * \def MBEDTLS_PK_PARSE_C - * - * Enable the generic public (asymetric) key parser. - * - * Module: library/pkparse.c - * Caller: library/mbedtls_x509_crt.c - * library/mbedtls_x509_csr.c - * - * Requires: MBEDTLS_PK_C - * - * Uncomment to enable generic public key parse functions. - */ -#define MBEDTLS_PK_PARSE_C - -/** - * \def MBEDTLS_PK_WRITE_C - * - * Enable the generic public (asymetric) key writer. - * - * Module: library/pkwrite.c - * Caller: library/x509write.c - * - * Requires: MBEDTLS_PK_C - * - * Uncomment to enable generic public key write functions. - */ -#define MBEDTLS_PK_WRITE_C - -/** - * \def MBEDTLS_PKCS5_C - * - * Enable PKCS#5 functions. - * - * Module: library/pkcs5.c - * - * Requires: MBEDTLS_MD_C - * - * This module adds support for the PKCS#5 functions. - */ -#define MBEDTLS_PKCS5_C - -/** - * \def MBEDTLS_PKCS11_C - * - * Enable wrapper for PKCS#11 smartcard support. - * - * Module: library/pkcs11.c - * Caller: library/pk.c - * - * Requires: MBEDTLS_PK_C - * - * This module enables SSL/TLS PKCS #11 smartcard support. - * Requires the presence of the PKCS#11 helper library (libpkcs11-helper) - */ -//#define MBEDTLS_PKCS11_C - -/** - * \def MBEDTLS_PKCS12_C - * - * Enable PKCS#12 PBE functions. - * Adds algorithms for parsing PKCS#8 encrypted private keys - * - * Module: library/pkcs12.c - * Caller: library/pkparse.c - * - * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_CIPHER_C, MBEDTLS_MD_C - * Can use: MBEDTLS_ARC4_C - * - * This module enables PKCS#12 functions. - */ -#define MBEDTLS_PKCS12_C - -/** - * \def MBEDTLS_PLATFORM_C - * - * Enable the platform abstraction layer that allows you to re-assign - * functions like calloc(), free(), snprintf(), printf(), fprintf(), exit(). - * - * Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT - * or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned - * above to be specified at runtime or compile time respectively. - * - * \note This abstraction layer must be enabled on Windows (including MSYS2) - * as other module rely on it for a fixed snprintf implementation. - * - * Module: library/platform.c - * Caller: Most other .c files - * - * This module enables abstraction of common (libc) functions. - */ -#define MBEDTLS_PLATFORM_C - -/** - * \def MBEDTLS_RIPEMD160_C - * - * Enable the RIPEMD-160 hash algorithm. - * - * Module: library/mbedtls_ripemd160.c - * Caller: library/mbedtls_md.c - * - */ -#ifdef CONFIG_MBEDTLS_RIPEMD160_C -#define MBEDTLS_RIPEMD160_C -#endif - -/** - * \def MBEDTLS_RSA_C - * - * Enable the RSA public-key cryptosystem. - * - * Module: library/rsa.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * library/x509.c - * - * This module is used by the following key exchanges: - * RSA, DHE-RSA, ECDHE-RSA, RSA-PSK - * - * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C - */ -#define MBEDTLS_RSA_C - -/** - * \def MBEDTLS_SHA1_C - * - * Enable the SHA1 cryptographic hash algorithm. - * - * Module: library/mbedtls_sha1.c - * Caller: library/mbedtls_md.c - * library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * library/x509write_crt.c - * - * This module is required for SSL/TLS and SHA1-signed certificates. - */ -#define MBEDTLS_SHA1_C - -/** - * \def MBEDTLS_SHA256_C - * - * Enable the SHA-224 and SHA-256 cryptographic hash algorithms. - * - * Module: library/mbedtls_sha256.c - * Caller: library/entropy.c - * library/mbedtls_md.c - * library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * - * This module adds support for SHA-224 and SHA-256. - * This module is required for the SSL/TLS 1.2 PRF function. - */ -#define MBEDTLS_SHA256_C - -/** - * \def MBEDTLS_SHA512_C - * - * Enable the SHA-384 and SHA-512 cryptographic hash algorithms. - * - * Module: library/mbedtls_sha512.c - * Caller: library/entropy.c - * library/mbedtls_md.c - * library/ssl_cli.c - * library/ssl_srv.c - * - * This module adds support for SHA-384 and SHA-512. - */ -#define MBEDTLS_SHA512_C - -/** - * \def MBEDTLS_SSL_CACHE_C - * - * Enable simple SSL cache implementation. - * - * Module: library/ssl_cache.c - * Caller: - * - * Requires: MBEDTLS_SSL_CACHE_C - */ -#define MBEDTLS_SSL_CACHE_C - -/** - * \def MBEDTLS_SSL_COOKIE_C - * - * Enable basic implementation of DTLS cookies for hello verification. - * - * Module: library/ssl_cookie.c - * Caller: - */ -#define MBEDTLS_SSL_COOKIE_C - -/** - * \def MBEDTLS_SSL_TICKET_C - * - * Enable an implementation of TLS server-side callbacks for session tickets. - * - * Module: library/ssl_ticket.c - * Caller: - * - * Requires: MBEDTLS_CIPHER_C - */ -#define MBEDTLS_SSL_TICKET_C - -/** - * \def MBEDTLS_SSL_CLI_C - * - * Enable the SSL/TLS client code. - * - * Module: library/ssl_cli.c - * Caller: - * - * Requires: MBEDTLS_SSL_TLS_C - * - * This module is required for SSL/TLS client support. - */ -#ifdef CONFIG_MBEDTLS_TLS_CLIENT -#define MBEDTLS_SSL_CLI_C -#endif - -/** - * \def MBEDTLS_SSL_SRV_C - * - * Enable the SSL/TLS server code. - * - * Module: library/ssl_srv.c - * Caller: - * - * Requires: MBEDTLS_SSL_TLS_C - * - * This module is required for SSL/TLS server support. - */ -#ifdef CONFIG_MBEDTLS_TLS_SERVER -#define MBEDTLS_SSL_SRV_C -#endif - -/** - * \def MBEDTLS_SSL_TLS_C - * - * Enable the generic SSL/TLS code. - * - * Module: library/ssl_tls.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * - * Requires: MBEDTLS_CIPHER_C, MBEDTLS_MD_C - * and at least one of the MBEDTLS_SSL_PROTO_XXX defines - * - * This module is required for SSL/TLS. - */ -#ifdef CONFIG_MBEDTLS_TLS_ENABLED -#define MBEDTLS_SSL_TLS_C -#endif - -/** - * \def MBEDTLS_THREADING_C - * - * Enable the threading abstraction layer. - * By default mbed TLS assumes it is used in a non-threaded environment or that - * contexts are not shared between threads. If you do intend to use contexts - * between threads, you will need to enable this layer to prevent race - * conditions. - * - * Module: library/threading.c - * - * This allows different threading implementations (self-implemented or - * provided). - * - * You will have to enable either MBEDTLS_THREADING_ALT or - * MBEDTLS_THREADING_PTHREAD. - * - * Enable this layer to allow use of mutexes within mbed TLS - */ -//#define MBEDTLS_THREADING_C - -/** - * \def MBEDTLS_TIMING_C - * - * Enable the portable timing interface. - * - * Module: library/timing.c - * Caller: library/havege.c - * - * This module is used by the HAVEGE random number generator. - */ -//#define MBEDTLS_TIMING_C - -/** - * \def MBEDTLS_VERSION_C - * - * Enable run-time version information. - * - * Module: library/version.c - * - * This module provides run-time version information. - */ -#define MBEDTLS_VERSION_C - -/** - * \def MBEDTLS_X509_USE_C - * - * Enable X.509 core for using certificates. - * - * Module: library/x509.c - * Caller: library/mbedtls_x509_crl.c - * library/mbedtls_x509_crt.c - * library/mbedtls_x509_csr.c - * - * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, - * MBEDTLS_PK_PARSE_C - * - * This module is required for the X.509 parsing modules. - */ -#define MBEDTLS_X509_USE_C - -/** - * \def MBEDTLS_X509_CRT_PARSE_C - * - * Enable X.509 certificate parsing. - * - * Module: library/mbedtls_x509_crt.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * - * Requires: MBEDTLS_X509_USE_C - * - * This module is required for X.509 certificate parsing. - */ -#define MBEDTLS_X509_CRT_PARSE_C - -/** - * \def MBEDTLS_X509_CRL_PARSE_C - * - * Enable X.509 CRL parsing. - * - * Module: library/mbedtls_x509_crl.c - * Caller: library/mbedtls_x509_crt.c - * - * Requires: MBEDTLS_X509_USE_C - * - * This module is required for X.509 CRL parsing. - */ -#ifdef CONFIG_MBEDTLS_X509_CRL_PARSE_C -#define MBEDTLS_X509_CRL_PARSE_C -#endif - -/** - * \def MBEDTLS_X509_CSR_PARSE_C - * - * Enable X.509 Certificate Signing Request (CSR) parsing. - * - * Module: library/mbedtls_x509_csr.c - * Caller: library/x509_crt_write.c - * - * Requires: MBEDTLS_X509_USE_C - * - * This module is used for reading X.509 certificate request. - */ -#ifdef CONFIG_MBEDTLS_X509_CSR_PARSE_C -#define MBEDTLS_X509_CSR_PARSE_C -#endif - -/** - * \def MBEDTLS_X509_CREATE_C - * - * Enable X.509 core for creating certificates. - * - * Module: library/x509_create.c - * - * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, MBEDTLS_PK_WRITE_C - * - * This module is the basis for creating X.509 certificates and CSRs. - */ -#define MBEDTLS_X509_CREATE_C - -/** - * \def MBEDTLS_X509_CRT_WRITE_C - * - * Enable creating X.509 certificates. - * - * Module: library/x509_crt_write.c - * - * Requires: MBEDTLS_X509_CREATE_C - * - * This module is required for X.509 certificate creation. - */ -#define MBEDTLS_X509_CRT_WRITE_C - -/** - * \def MBEDTLS_X509_CSR_WRITE_C - * - * Enable creating X.509 Certificate Signing Requests (CSR). - * - * Module: library/x509_csr_write.c - * - * Requires: MBEDTLS_X509_CREATE_C - * - * This module is required for X.509 certificate request writing. - */ -#define MBEDTLS_X509_CSR_WRITE_C - -/** - * \def MBEDTLS_XTEA_C - * - * Enable the XTEA block cipher. - * - * Module: library/xtea.c - * Caller: - */ -#ifdef CONFIG_MBEDTLS_XTEA_C -#define MBEDTLS_XTEA_C -#endif - -/* \} name SECTION: mbed TLS modules */ - -/** - * \name SECTION: Module configuration options - * - * This section allows for the setting of module specific sizes and - * configuration options. The default values are already present in the - * relevant header files and should suffice for the regular use cases. - * - * Our advice is to enable options and change their values here - * only if you have a good reason and know the consequences. - * - * Please check the respective header file for documentation on these - * parameters (to prevent duplicate documentation). - * \{ - */ - -/* MPI / BIGNUM options */ -//#define MBEDTLS_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */ -//#define MBEDTLS_MPI_MAX_SIZE 1024 /**< Maximum number of bytes for usable MPIs. */ - -/* CTR_DRBG options */ -//#define MBEDTLS_CTR_DRBG_ENTROPY_LEN 48 /**< Amount of entropy used per seed by default (48 with SHA-512, 32 with SHA-256) */ -//#define MBEDTLS_CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */ -//#define MBEDTLS_CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */ -//#define MBEDTLS_CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */ -//#define MBEDTLS_CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */ - -/* HMAC_DRBG options */ -//#define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */ -//#define MBEDTLS_HMAC_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */ -//#define MBEDTLS_HMAC_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */ -//#define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */ - -/* ECP options */ -//#define MBEDTLS_ECP_MAX_BITS 521 /**< Maximum bit size of groups */ -//#define MBEDTLS_ECP_WINDOW_SIZE 6 /**< Maximum window size used */ -//#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 /**< Enable fixed-point speed-up */ - -/* Entropy options */ -//#define MBEDTLS_ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */ -//#define MBEDTLS_ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */ - -/* Memory buffer allocator options */ -//#define MBEDTLS_MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */ - -/* Platform options */ -//#define MBEDTLS_PLATFORM_STD_MEM_HDR /**< Header to include if MBEDTLS_PLATFORM_NO_STD_FUNCTIONS is defined. Don't define if no header is needed. */ -//#define MBEDTLS_PLATFORM_STD_CALLOC calloc /**< Default allocator to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_FREE free /**< Default free to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_EXIT exit /**< Default exit to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**< Default fprintf to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_PRINTF printf /**< Default printf to use, can be undefined */ -/* Note: your snprintf must correclty zero-terminate the buffer! */ -//#define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf /**< Default snprintf to use, can be undefined */ - -/* To Use Function Macros MBEDTLS_PLATFORM_C must be enabled */ -/* MBEDTLS_PLATFORM_XXX_MACRO and MBEDTLS_PLATFORM_XXX_ALT cannot both be defined */ -//#define MBEDTLS_PLATFORM_CALLOC_MACRO calloc /**< Default allocator macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_FREE_MACRO free /**< Default free macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_EXIT_MACRO exit /**< Default exit macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_FPRINTF_MACRO fprintf /**< Default fprintf macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_PRINTF_MACRO printf /**< Default printf macro to use, can be undefined */ -/* Note: your snprintf must correclty zero-terminate the buffer! */ -//#define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf /**< Default snprintf macro to use, can be undefined */ - -/* SSL Cache options */ -//#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */ -//#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */ - -/* SSL options */ -#ifndef CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN - -#define MBEDTLS_SSL_MAX_CONTENT_LEN CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN /**< Maxium fragment length in bytes, determines the size of each of the two internal I/O buffers */ - -#else - -/** \def MBEDTLS_SSL_IN_CONTENT_LEN - * - * Maximum incoming fragment length in bytes. - * - * Uncomment to set the size of the inward TLS buffer independently of the - * outward buffer. - */ -#define MBEDTLS_SSL_IN_CONTENT_LEN CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN - -/** \def MBEDTLS_SSL_OUT_CONTENT_LEN - * - * Maximum outgoing fragment length in bytes. - * - * Uncomment to set the size of the outward TLS buffer independently of the - * inward buffer. - * - * It is possible to save RAM by setting a smaller outward buffer, while keeping - * the default inward 16384 byte buffer to conform to the TLS specification. - * - * The minimum required outward buffer size is determined by the handshake - * protocol's usage. Handshaking will fail if the outward buffer is too small. - * The specific size requirement depends on the configured ciphers and any - * certificate data which is sent during the handshake. - * - * For absolute minimum RAM usage, it's best to enable - * MBEDTLS_SSL_MAX_FRAGMENT_LENGTH and reduce MBEDTLS_SSL_MAX_CONTENT_LEN. This - * reduces both incoming and outgoing buffer sizes. However this is only - * guaranteed if the other end of the connection also supports the TLS - * max_fragment_len extension. Otherwise the connection may fail. - */ -#define MBEDTLS_SSL_OUT_CONTENT_LEN CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN - -#endif /* !CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN */ - -//#define MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */ -//#define MBEDTLS_PSK_MAX_LEN 32 /**< Max size of TLS pre-shared keys, in bytes (default 256 bits) */ -//#define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */ - -/** - * Complete list of ciphersuites to use, in order of preference. - * - * \warning No dependency checking is done on that field! This option can only - * be used to restrict the set of available ciphersuites. It is your - * responsibility to make sure the needed modules are active. - * - * Use this to save a few hundred bytes of ROM (default ordering of all - * available ciphersuites) and a few to a few hundred bytes of RAM. - * - * The value below is only an example, not the default. - */ -//#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 - -/* X509 options */ -//#define MBEDTLS_X509_MAX_INTERMEDIATE_CA 8 /**< Maximum number of intermediate CAs in a verification chain. */ - -/** - * Allow SHA-1 in the default TLS configuration for TLS 1.2 handshake - * signature and ciphersuite selection. Without this build-time option, SHA-1 - * support must be activated explicitly through mbedtls_ssl_conf_sig_hashes. - * The use of SHA-1 in TLS <= 1.1 and in HMAC-SHA-1 is always allowed by - * default. At the time of writing, there is no practical attack on the use - * of SHA-1 in handshake signatures, hence this option is turned on by default - * for compatibility with existing peers. - */ -#define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE - -/* \} name SECTION: Module configuration options */ - -#if defined(TARGET_LIKE_MBED) -#include "mbedtls/target_config.h" -#endif - -/* - * Allow user to override any previous default. - * - * Use two macro names for that, as: - * - with yotta the prefix YOTTA_CFG_ is forced - * - without yotta is looks weird to have a YOTTA prefix. - */ -#if defined(YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE) -#include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE -#elif defined(MBEDTLS_USER_CONFIG_FILE) -#include MBEDTLS_USER_CONFIG_FILE -#endif - -#include "mbedtls/check_config.h" - -#endif /* MBEDTLS_CONFIG_H */ diff --git a/tools/sdk/include/mbedtls/mbedtls/esp_debug.h b/tools/sdk/include/mbedtls/mbedtls/esp_debug.h deleted file mode 100644 index 8e23a5ea322..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/esp_debug.h +++ /dev/null @@ -1,57 +0,0 @@ -// 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. -#ifndef _ESP_DEBUG_H_ -#define _ESP_DEBUG_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "sdkconfig.h" -#ifdef CONFIG_MBEDTLS_DEBUG - -/** @brief Enable mbedTLS debug logging via the esp_log mechanism. - * - * mbedTLS internal debugging is filtered from a specified mbedTLS - * threshold level to esp_log level at runtime: - * - * - 1 - Warning - * - 2 - Info - * - 3 - Debug - * - 4 - Verbose - * - * (Note that mbedTLS debug thresholds are not always consistently used.) - * - * This function will set the esp log level for "mbedtls" to the specified mbedTLS - * threshold level that matches. However, the overall max ESP log level must be set high - * enough in menuconfig, or some messages may be filtered at compile time. - * - * @param conf mbedtls_ssl_config structure - * @param mbedTLS debug threshold, 0-4. Messages are filtered at runtime. - */ -void mbedtls_esp_enable_debug_log(mbedtls_ssl_config *conf, int threshold); - -/** @brief Disable mbedTLS debug logging via the esp_log mechanism. - * - */ -void mbedtls_esp_disable_debug_log(mbedtls_ssl_config *conf); - - -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_DEBUG_H__ */ diff --git a/tools/sdk/include/mbedtls/mbedtls/gcm.h b/tools/sdk/include/mbedtls/mbedtls/gcm.h deleted file mode 100644 index d2098eb9f90..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/gcm.h +++ /dev/null @@ -1,291 +0,0 @@ -/** - * \file gcm.h - * - * \brief This file contains GCM definitions and functions. - * - * The Galois/Counter Mode (GCM) for 128-bit block ciphers is defined - * in D. McGrew, J. Viega, The Galois/Counter Mode of Operation - * (GCM), Natl. Inst. Stand. Technol. - * - * For more information on GCM, see NIST SP 800-38D: Recommendation for - * Block Cipher Modes of Operation: Galois/Counter Mode (GCM) and GMAC. - * - */ -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_GCM_H -#define MBEDTLS_GCM_H - -#include "cipher.h" - -#include - -#define MBEDTLS_GCM_ENCRYPT 1 -#define MBEDTLS_GCM_DECRYPT 0 - -#define MBEDTLS_ERR_GCM_AUTH_FAILED -0x0012 /**< Authenticated decryption failed. */ -#define MBEDTLS_ERR_GCM_HW_ACCEL_FAILED -0x0013 /**< GCM hardware accelerator failed. */ -#define MBEDTLS_ERR_GCM_BAD_INPUT -0x0014 /**< Bad input parameters to function. */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_GCM_ALT) - -/** - * \brief The GCM context structure. - */ -typedef struct mbedtls_gcm_context -{ - mbedtls_cipher_context_t cipher_ctx; /*!< The cipher context used. */ - uint64_t HL[16]; /*!< Precalculated HTable low. */ - uint64_t HH[16]; /*!< Precalculated HTable high. */ - uint64_t len; /*!< The total length of the encrypted data. */ - uint64_t add_len; /*!< The total length of the additional data. */ - unsigned char base_ectr[16]; /*!< The first ECTR for tag. */ - unsigned char y[16]; /*!< The Y working value. */ - unsigned char buf[16]; /*!< The buf working value. */ - int mode; /*!< The operation to perform: - #MBEDTLS_GCM_ENCRYPT or - #MBEDTLS_GCM_DECRYPT. */ -} -mbedtls_gcm_context; - -#else /* !MBEDTLS_GCM_ALT */ -#include "gcm_alt.h" -#endif /* !MBEDTLS_GCM_ALT */ - -/** - * \brief This function initializes the specified GCM context, - * to make references valid, and prepares the context - * for mbedtls_gcm_setkey() or mbedtls_gcm_free(). - * - * The function does not bind the GCM context to a particular - * cipher, nor set the key. For this purpose, use - * mbedtls_gcm_setkey(). - * - * \param ctx The GCM context to initialize. - */ -void mbedtls_gcm_init( mbedtls_gcm_context *ctx ); - -/** - * \brief This function associates a GCM context with a - * cipher algorithm and a key. - * - * \param ctx The GCM context to initialize. - * \param cipher The 128-bit block cipher to use. - * \param key The encryption key. - * \param keybits The key size in bits. Valid options are: - *
  • 128 bits
  • - *
  • 192 bits
  • - *
  • 256 bits
- * - * \return \c 0 on success. - * \return A cipher-specific error code on failure. - */ -int mbedtls_gcm_setkey( mbedtls_gcm_context *ctx, - mbedtls_cipher_id_t cipher, - const unsigned char *key, - unsigned int keybits ); - -/** - * \brief This function performs GCM encryption or decryption of a buffer. - * - * \note For encryption, the output buffer can be the same as the - * input buffer. For decryption, the output buffer cannot be - * the same as input buffer. If the buffers overlap, the output - * buffer must trail at least 8 Bytes behind the input buffer. - * - * \warning When this function performs a decryption, it outputs the - * authentication tag and does not verify that the data is - * authentic. You should use this function to perform encryption - * only. For decryption, use mbedtls_gcm_auth_decrypt() instead. - * - * \param ctx The GCM context to use for encryption or decryption. - * \param mode The operation to perform: - * - #MBEDTLS_GCM_ENCRYPT to perform authenticated encryption. - * The ciphertext is written to \p output and the - * authentication tag is written to \p tag. - * - #MBEDTLS_GCM_DECRYPT to perform decryption. - * The plaintext is written to \p output and the - * authentication tag is written to \p tag. - * Note that this mode is not recommended, because it does - * not verify the authenticity of the data. For this reason, - * you should use mbedtls_gcm_auth_decrypt() instead of - * calling this function in decryption mode. - * \param length The length of the input data, which is equal to the length - * of the output data. - * \param iv The initialization vector. - * \param iv_len The length of the IV. - * \param add The buffer holding the additional data. - * \param add_len The length of the additional data. - * \param input The buffer holding the input data. Its size is \b length. - * \param output The buffer for holding the output data. It must have room - * for \b length bytes. - * \param tag_len The length of the tag to generate. - * \param tag The buffer for holding the tag. - * - * \return \c 0 if the encryption or decryption was performed - * successfully. Note that in #MBEDTLS_GCM_DECRYPT mode, - * this does not indicate that the data is authentic. - * \return #MBEDTLS_ERR_GCM_BAD_INPUT if the lengths are not valid. - * \return #MBEDTLS_ERR_GCM_HW_ACCEL_FAILED or a cipher-specific - * error code if the encryption or decryption failed. - */ -int mbedtls_gcm_crypt_and_tag( mbedtls_gcm_context *ctx, - int mode, - size_t length, - const unsigned char *iv, - size_t iv_len, - const unsigned char *add, - size_t add_len, - const unsigned char *input, - unsigned char *output, - size_t tag_len, - unsigned char *tag ); - -/** - * \brief This function performs a GCM authenticated decryption of a - * buffer. - * - * \note For decryption, the output buffer cannot be the same as - * input buffer. If the buffers overlap, the output buffer - * must trail at least 8 Bytes behind the input buffer. - * - * \param ctx The GCM context. - * \param length The length of the ciphertext to decrypt, which is also - * the length of the decrypted plaintext. - * \param iv The initialization vector. - * \param iv_len The length of the IV. - * \param add The buffer holding the additional data. - * \param add_len The length of the additional data. - * \param tag The buffer holding the tag to verify. - * \param tag_len The length of the tag to verify. - * \param input The buffer holding the ciphertext. Its size is \b length. - * \param output The buffer for holding the decrypted plaintext. It must - * have room for \b length bytes. - * - * \return \c 0 if successful and authenticated. - * \return #MBEDTLS_ERR_GCM_AUTH_FAILED if the tag does not match. - * \return #MBEDTLS_ERR_GCM_BAD_INPUT if the lengths are not valid. - * \return #MBEDTLS_ERR_GCM_HW_ACCEL_FAILED or a cipher-specific - * error code if the decryption failed. - */ -int mbedtls_gcm_auth_decrypt( mbedtls_gcm_context *ctx, - size_t length, - const unsigned char *iv, - size_t iv_len, - const unsigned char *add, - size_t add_len, - const unsigned char *tag, - size_t tag_len, - const unsigned char *input, - unsigned char *output ); - -/** - * \brief This function starts a GCM encryption or decryption - * operation. - * - * \param ctx The GCM context. - * \param mode The operation to perform: #MBEDTLS_GCM_ENCRYPT or - * #MBEDTLS_GCM_DECRYPT. - * \param iv The initialization vector. - * \param iv_len The length of the IV. - * \param add The buffer holding the additional data, or NULL - * if \p add_len is 0. - * \param add_len The length of the additional data. If 0, - * \p add is NULL. - * - * \return \c 0 on success. - */ -int mbedtls_gcm_starts( mbedtls_gcm_context *ctx, - int mode, - const unsigned char *iv, - size_t iv_len, - const unsigned char *add, - size_t add_len ); - -/** - * \brief This function feeds an input buffer into an ongoing GCM - * encryption or decryption operation. - * - * ` The function expects input to be a multiple of 16 - * Bytes. Only the last call before calling - * mbedtls_gcm_finish() can be less than 16 Bytes. - * - * \note For decryption, the output buffer cannot be the same as - * input buffer. If the buffers overlap, the output buffer - * must trail at least 8 Bytes behind the input buffer. - * - * \param ctx The GCM context. - * \param length The length of the input data. This must be a multiple of - * 16 except in the last call before mbedtls_gcm_finish(). - * \param input The buffer holding the input data. - * \param output The buffer for holding the output data. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_GCM_BAD_INPUT on failure. - */ -int mbedtls_gcm_update( mbedtls_gcm_context *ctx, - size_t length, - const unsigned char *input, - unsigned char *output ); - -/** - * \brief This function finishes the GCM operation and generates - * the authentication tag. - * - * It wraps up the GCM stream, and generates the - * tag. The tag can have a maximum length of 16 Bytes. - * - * \param ctx The GCM context. - * \param tag The buffer for holding the tag. - * \param tag_len The length of the tag to generate. Must be at least four. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_GCM_BAD_INPUT on failure. - */ -int mbedtls_gcm_finish( mbedtls_gcm_context *ctx, - unsigned char *tag, - size_t tag_len ); - -/** - * \brief This function clears a GCM context and the underlying - * cipher sub-context. - * - * \param ctx The GCM context to clear. - */ -void mbedtls_gcm_free( mbedtls_gcm_context *ctx ); - -/** - * \brief The GCM checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_gcm_self_test( int verbose ); - -#ifdef __cplusplus -} -#endif - - -#endif /* gcm.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/havege.h b/tools/sdk/include/mbedtls/mbedtls/havege.h deleted file mode 100644 index 57e8c409431..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/havege.h +++ /dev/null @@ -1,75 +0,0 @@ -/** - * \file havege.h - * - * \brief HAVEGE: HArdware Volatile Entropy Gathering and Expansion - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_HAVEGE_H -#define MBEDTLS_HAVEGE_H - -#include - -#define MBEDTLS_HAVEGE_COLLECT_SIZE 1024 - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief HAVEGE state structure - */ -typedef struct mbedtls_havege_state -{ - int PT1, PT2, offset[2]; - int pool[MBEDTLS_HAVEGE_COLLECT_SIZE]; - int WALK[8192]; -} -mbedtls_havege_state; - -/** - * \brief HAVEGE initialization - * - * \param hs HAVEGE state to be initialized - */ -void mbedtls_havege_init( mbedtls_havege_state *hs ); - -/** - * \brief Clear HAVEGE state - * - * \param hs HAVEGE state to be cleared - */ -void mbedtls_havege_free( mbedtls_havege_state *hs ); - -/** - * \brief HAVEGE rand function - * - * \param p_rng A HAVEGE state - * \param output Buffer to fill - * \param len Length of buffer - * - * \return 0 - */ -int mbedtls_havege_random( void *p_rng, unsigned char *output, size_t len ); - -#ifdef __cplusplus -} -#endif - -#endif /* havege.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/hkdf.h b/tools/sdk/include/mbedtls/mbedtls/hkdf.h deleted file mode 100644 index e6ed7cde97c..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/hkdf.h +++ /dev/null @@ -1,135 +0,0 @@ -/** - * \file hkdf.h - * - * \brief This file contains the HKDF interface. - * - * The HMAC-based Extract-and-Expand Key Derivation Function (HKDF) is - * specified by RFC 5869. - */ -/* - * Copyright (C) 2016-2018, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_HKDF_H -#define MBEDTLS_HKDF_H - -#include "md.h" - -/** - * \name HKDF Error codes - * \{ - */ -#define MBEDTLS_ERR_HKDF_BAD_INPUT_DATA -0x5F80 /**< Bad input parameters to function. */ -/* \} name */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief This is the HMAC-based Extract-and-Expand Key Derivation Function - * (HKDF). - * - * \param md A hash function; md.size denotes the length of the hash - * function output in bytes. - * \param salt An optional salt value (a non-secret random value); - * if the salt is not provided, a string of all zeros of - * md.size length is used as the salt. - * \param salt_len The length in bytes of the optional \p salt. - * \param ikm The input keying material. - * \param ikm_len The length in bytes of \p ikm. - * \param info An optional context and application specific information - * string. This can be a zero-length string. - * \param info_len The length of \p info in bytes. - * \param okm The output keying material of \p okm_len bytes. - * \param okm_len The length of the output keying material in bytes. This - * must be less than or equal to 255 * md.size bytes. - * - * \return 0 on success. - * \return #MBEDTLS_ERR_HKDF_BAD_INPUT_DATA when the parameters are invalid. - * \return An MBEDTLS_ERR_MD_* error for errors returned from the underlying - * MD layer. - */ -int mbedtls_hkdf( const mbedtls_md_info_t *md, const unsigned char *salt, - size_t salt_len, const unsigned char *ikm, size_t ikm_len, - const unsigned char *info, size_t info_len, - unsigned char *okm, size_t okm_len ); - -/** - * \brief Take the input keying material \p ikm and extract from it a - * fixed-length pseudorandom key \p prk. - * - * \warning This function should only be used if the security of it has been - * studied and established in that particular context (eg. TLS 1.3 - * key schedule). For standard HKDF security guarantees use - * \c mbedtls_hkdf instead. - * - * \param md A hash function; md.size denotes the length of the - * hash function output in bytes. - * \param salt An optional salt value (a non-secret random value); - * if the salt is not provided, a string of all zeros - * of md.size length is used as the salt. - * \param salt_len The length in bytes of the optional \p salt. - * \param ikm The input keying material. - * \param ikm_len The length in bytes of \p ikm. - * \param[out] prk A pseudorandom key of at least md.size bytes. - * - * \return 0 on success. - * \return #MBEDTLS_ERR_HKDF_BAD_INPUT_DATA when the parameters are invalid. - * \return An MBEDTLS_ERR_MD_* error for errors returned from the underlying - * MD layer. - */ -int mbedtls_hkdf_extract( const mbedtls_md_info_t *md, - const unsigned char *salt, size_t salt_len, - const unsigned char *ikm, size_t ikm_len, - unsigned char *prk ); - -/** - * \brief Expand the supplied \p prk into several additional pseudorandom - * keys, which is the output of the HKDF. - * - * \warning This function should only be used if the security of it has been - * studied and established in that particular context (eg. TLS 1.3 - * key schedule). For standard HKDF security guarantees use - * \c mbedtls_hkdf instead. - * - * \param md A hash function; md.size denotes the length of the hash - * function output in bytes. - * \param prk A pseudorandom key of at least md.size bytes. \p prk is - * usually the output from the HKDF extract step. - * \param prk_len The length in bytes of \p prk. - * \param info An optional context and application specific information - * string. This can be a zero-length string. - * \param info_len The length of \p info in bytes. - * \param okm The output keying material of \p okm_len bytes. - * \param okm_len The length of the output keying material in bytes. This - * must be less than or equal to 255 * md.size bytes. - * - * \return 0 on success. - * \return #MBEDTLS_ERR_HKDF_BAD_INPUT_DATA when the parameters are invalid. - * \return An MBEDTLS_ERR_MD_* error for errors returned from the underlying - * MD layer. - */ -int mbedtls_hkdf_expand( const mbedtls_md_info_t *md, const unsigned char *prk, - size_t prk_len, const unsigned char *info, - size_t info_len, unsigned char *okm, size_t okm_len ); - -#ifdef __cplusplus -} -#endif - -#endif /* hkdf.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/hmac_drbg.h b/tools/sdk/include/mbedtls/mbedtls/hmac_drbg.h deleted file mode 100644 index 3bc675ec7c7..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/hmac_drbg.h +++ /dev/null @@ -1,300 +0,0 @@ -/** - * \file hmac_drbg.h - * - * \brief HMAC_DRBG (NIST SP 800-90A) - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_HMAC_DRBG_H -#define MBEDTLS_HMAC_DRBG_H - -#include "md.h" - -#if defined(MBEDTLS_THREADING_C) -#include "threading.h" -#endif - -/* - * Error codes - */ -#define MBEDTLS_ERR_HMAC_DRBG_REQUEST_TOO_BIG -0x0003 /**< Too many random requested in single call. */ -#define MBEDTLS_ERR_HMAC_DRBG_INPUT_TOO_BIG -0x0005 /**< Input too large (Entropy + additional). */ -#define MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR -0x0007 /**< Read/write error in file. */ -#define MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED -0x0009 /**< The entropy source failed. */ - -/** - * \name SECTION: Module settings - * - * The configuration options you can set for this module are in this section. - * Either change them in config.h or define them on the compiler command line. - * \{ - */ - -#if !defined(MBEDTLS_HMAC_DRBG_RESEED_INTERVAL) -#define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */ -#endif - -#if !defined(MBEDTLS_HMAC_DRBG_MAX_INPUT) -#define MBEDTLS_HMAC_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */ -#endif - -#if !defined(MBEDTLS_HMAC_DRBG_MAX_REQUEST) -#define MBEDTLS_HMAC_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */ -#endif - -#if !defined(MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT) -#define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */ -#endif - -/* \} name SECTION: Module settings */ - -#define MBEDTLS_HMAC_DRBG_PR_OFF 0 /**< No prediction resistance */ -#define MBEDTLS_HMAC_DRBG_PR_ON 1 /**< Prediction resistance enabled */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * HMAC_DRBG context. - */ -typedef struct mbedtls_hmac_drbg_context -{ - /* Working state: the key K is not stored explicitely, - * but is implied by the HMAC context */ - mbedtls_md_context_t md_ctx; /*!< HMAC context (inc. K) */ - unsigned char V[MBEDTLS_MD_MAX_SIZE]; /*!< V in the spec */ - int reseed_counter; /*!< reseed counter */ - - /* Administrative state */ - size_t entropy_len; /*!< entropy bytes grabbed on each (re)seed */ - int prediction_resistance; /*!< enable prediction resistance (Automatic - reseed before every random generation) */ - int reseed_interval; /*!< reseed interval */ - - /* Callbacks */ - int (*f_entropy)(void *, unsigned char *, size_t); /*!< entropy function */ - void *p_entropy; /*!< context for the entropy function */ - -#if defined(MBEDTLS_THREADING_C) - mbedtls_threading_mutex_t mutex; -#endif -} mbedtls_hmac_drbg_context; - -/** - * \brief HMAC_DRBG context initialization - * Makes the context ready for mbedtls_hmac_drbg_seed(), - * mbedtls_hmac_drbg_seed_buf() or - * mbedtls_hmac_drbg_free(). - * - * \param ctx HMAC_DRBG context to be initialized - */ -void mbedtls_hmac_drbg_init( mbedtls_hmac_drbg_context *ctx ); - -/** - * \brief HMAC_DRBG initial seeding - * Seed and setup entropy source for future reseeds. - * - * \param ctx HMAC_DRBG context to be seeded - * \param md_info MD algorithm to use for HMAC_DRBG - * \param f_entropy Entropy callback (p_entropy, buffer to fill, buffer - * length) - * \param p_entropy Entropy context - * \param custom Personalization data (Device specific identifiers) - * (Can be NULL) - * \param len Length of personalization data - * - * \note The "security strength" as defined by NIST is set to: - * 128 bits if md_alg is SHA-1, - * 192 bits if md_alg is SHA-224, - * 256 bits if md_alg is SHA-256 or higher. - * Note that SHA-256 is just as efficient as SHA-224. - * - * \return 0 if successful, or - * MBEDTLS_ERR_MD_BAD_INPUT_DATA, or - * MBEDTLS_ERR_MD_ALLOC_FAILED, or - * MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED. - */ -int mbedtls_hmac_drbg_seed( mbedtls_hmac_drbg_context *ctx, - const mbedtls_md_info_t * md_info, - int (*f_entropy)(void *, unsigned char *, size_t), - void *p_entropy, - const unsigned char *custom, - size_t len ); - -/** - * \brief Initilisation of simpified HMAC_DRBG (never reseeds). - * (For use with deterministic ECDSA.) - * - * \param ctx HMAC_DRBG context to be initialised - * \param md_info MD algorithm to use for HMAC_DRBG - * \param data Concatenation of entropy string and additional data - * \param data_len Length of data in bytes - * - * \return 0 if successful, or - * MBEDTLS_ERR_MD_BAD_INPUT_DATA, or - * MBEDTLS_ERR_MD_ALLOC_FAILED. - */ -int mbedtls_hmac_drbg_seed_buf( mbedtls_hmac_drbg_context *ctx, - const mbedtls_md_info_t * md_info, - const unsigned char *data, size_t data_len ); - -/** - * \brief Enable / disable prediction resistance (Default: Off) - * - * Note: If enabled, entropy is used for ctx->entropy_len before each call! - * Only use this if you have ample supply of good entropy! - * - * \param ctx HMAC_DRBG context - * \param resistance MBEDTLS_HMAC_DRBG_PR_ON or MBEDTLS_HMAC_DRBG_PR_OFF - */ -void mbedtls_hmac_drbg_set_prediction_resistance( mbedtls_hmac_drbg_context *ctx, - int resistance ); - -/** - * \brief Set the amount of entropy grabbed on each reseed - * (Default: given by the security strength, which - * depends on the hash used, see \c mbedtls_hmac_drbg_init() ) - * - * \param ctx HMAC_DRBG context - * \param len Amount of entropy to grab, in bytes - */ -void mbedtls_hmac_drbg_set_entropy_len( mbedtls_hmac_drbg_context *ctx, - size_t len ); - -/** - * \brief Set the reseed interval - * (Default: MBEDTLS_HMAC_DRBG_RESEED_INTERVAL) - * - * \param ctx HMAC_DRBG context - * \param interval Reseed interval - */ -void mbedtls_hmac_drbg_set_reseed_interval( mbedtls_hmac_drbg_context *ctx, - int interval ); - -/** - * \brief HMAC_DRBG update state - * - * \param ctx HMAC_DRBG context - * \param additional Additional data to update state with, or NULL - * \param add_len Length of additional data, or 0 - * - * \note Additional data is optional, pass NULL and 0 as second - * third argument if no additional data is being used. - */ -void mbedtls_hmac_drbg_update( mbedtls_hmac_drbg_context *ctx, - const unsigned char *additional, size_t add_len ); - -/** - * \brief HMAC_DRBG reseeding (extracts data from entropy source) - * - * \param ctx HMAC_DRBG context - * \param additional Additional data to add to state (Can be NULL) - * \param len Length of additional data - * - * \return 0 if successful, or - * MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED - */ -int mbedtls_hmac_drbg_reseed( mbedtls_hmac_drbg_context *ctx, - const unsigned char *additional, size_t len ); - -/** - * \brief HMAC_DRBG generate random with additional update input - * - * Note: Automatically reseeds if reseed_counter is reached or PR is enabled. - * - * \param p_rng HMAC_DRBG context - * \param output Buffer to fill - * \param output_len Length of the buffer - * \param additional Additional data to update with (can be NULL) - * \param add_len Length of additional data (can be 0) - * - * \return 0 if successful, or - * MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED, or - * MBEDTLS_ERR_HMAC_DRBG_REQUEST_TOO_BIG, or - * MBEDTLS_ERR_HMAC_DRBG_INPUT_TOO_BIG. - */ -int mbedtls_hmac_drbg_random_with_add( void *p_rng, - unsigned char *output, size_t output_len, - const unsigned char *additional, - size_t add_len ); - -/** - * \brief HMAC_DRBG generate random - * - * Note: Automatically reseeds if reseed_counter is reached or PR is enabled. - * - * \param p_rng HMAC_DRBG context - * \param output Buffer to fill - * \param out_len Length of the buffer - * - * \return 0 if successful, or - * MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED, or - * MBEDTLS_ERR_HMAC_DRBG_REQUEST_TOO_BIG - */ -int mbedtls_hmac_drbg_random( void *p_rng, unsigned char *output, size_t out_len ); - -/** - * \brief Free an HMAC_DRBG context - * - * \param ctx HMAC_DRBG context to free. - */ -void mbedtls_hmac_drbg_free( mbedtls_hmac_drbg_context *ctx ); - -#if defined(MBEDTLS_FS_IO) -/** - * \brief Write a seed file - * - * \param ctx HMAC_DRBG context - * \param path Name of the file - * - * \return 0 if successful, 1 on file error, or - * MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED - */ -int mbedtls_hmac_drbg_write_seed_file( mbedtls_hmac_drbg_context *ctx, const char *path ); - -/** - * \brief Read and update a seed file. Seed is added to this - * instance - * - * \param ctx HMAC_DRBG context - * \param path Name of the file - * - * \return 0 if successful, 1 on file error, - * MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED or - * MBEDTLS_ERR_HMAC_DRBG_INPUT_TOO_BIG - */ -int mbedtls_hmac_drbg_update_seed_file( mbedtls_hmac_drbg_context *ctx, const char *path ); -#endif /* MBEDTLS_FS_IO */ - - -#if defined(MBEDTLS_SELF_TEST) -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - */ -int mbedtls_hmac_drbg_self_test( int verbose ); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* hmac_drbg.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/md.h b/tools/sdk/include/mbedtls/mbedtls/md.h deleted file mode 100644 index bf29524983c..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/md.h +++ /dev/null @@ -1,466 +0,0 @@ - /** - * \file md.h - * - * \brief This file contains the generic message-digest wrapper. - * - * \author Adriaan de Jong - */ -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_MD_H -#define MBEDTLS_MD_H - -#include - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#define MBEDTLS_ERR_MD_FEATURE_UNAVAILABLE -0x5080 /**< The selected feature is not available. */ -#define MBEDTLS_ERR_MD_BAD_INPUT_DATA -0x5100 /**< Bad input parameters to function. */ -#define MBEDTLS_ERR_MD_ALLOC_FAILED -0x5180 /**< Failed to allocate memory. */ -#define MBEDTLS_ERR_MD_FILE_IO_ERROR -0x5200 /**< Opening or reading of file failed. */ -#define MBEDTLS_ERR_MD_HW_ACCEL_FAILED -0x5280 /**< MD hardware accelerator failed. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Supported message digests. - * - * \warning MD2, MD4, MD5 and SHA-1 are considered weak message digests and - * their use constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -typedef enum { - MBEDTLS_MD_NONE=0, /**< None. */ - MBEDTLS_MD_MD2, /**< The MD2 message digest. */ - MBEDTLS_MD_MD4, /**< The MD4 message digest. */ - MBEDTLS_MD_MD5, /**< The MD5 message digest. */ - MBEDTLS_MD_SHA1, /**< The SHA-1 message digest. */ - MBEDTLS_MD_SHA224, /**< The SHA-224 message digest. */ - MBEDTLS_MD_SHA256, /**< The SHA-256 message digest. */ - MBEDTLS_MD_SHA384, /**< The SHA-384 message digest. */ - MBEDTLS_MD_SHA512, /**< The SHA-512 message digest. */ - MBEDTLS_MD_RIPEMD160, /**< The RIPEMD-160 message digest. */ -} mbedtls_md_type_t; - -#if defined(MBEDTLS_SHA512_C) -#define MBEDTLS_MD_MAX_SIZE 64 /* longest known is SHA512 */ -#else -#define MBEDTLS_MD_MAX_SIZE 32 /* longest known is SHA256 or less */ -#endif - -/** - * Opaque struct defined in md_internal.h. - */ -typedef struct mbedtls_md_info_t mbedtls_md_info_t; - -/** - * The generic message-digest context. - */ -typedef struct mbedtls_md_context_t -{ - /** Information about the associated message digest. */ - const mbedtls_md_info_t *md_info; - - /** The digest-specific context. */ - void *md_ctx; - - /** The HMAC part of the context. */ - void *hmac_ctx; -} mbedtls_md_context_t; - -/** - * \brief This function returns the list of digests supported by the - * generic digest module. - * - * \return A statically allocated array of digests. Each element - * in the returned list is an integer belonging to the - * message-digest enumeration #mbedtls_md_type_t. - * The last entry is 0. - */ -const int *mbedtls_md_list( void ); - -/** - * \brief This function returns the message-digest information - * associated with the given digest name. - * - * \param md_name The name of the digest to search for. - * - * \return The message-digest information associated with \p md_name. - * \return NULL if the associated message-digest information is not found. - */ -const mbedtls_md_info_t *mbedtls_md_info_from_string( const char *md_name ); - -/** - * \brief This function returns the message-digest information - * associated with the given digest type. - * - * \param md_type The type of digest to search for. - * - * \return The message-digest information associated with \p md_type. - * \return NULL if the associated message-digest information is not found. - */ -const mbedtls_md_info_t *mbedtls_md_info_from_type( mbedtls_md_type_t md_type ); - -/** - * \brief This function initializes a message-digest context without - * binding it to a particular message-digest algorithm. - * - * This function should always be called first. It prepares the - * context for mbedtls_md_setup() for binding it to a - * message-digest algorithm. - */ -void mbedtls_md_init( mbedtls_md_context_t *ctx ); - -/** - * \brief This function clears the internal structure of \p ctx and - * frees any embedded internal structure, but does not free - * \p ctx itself. - * - * If you have called mbedtls_md_setup() on \p ctx, you must - * call mbedtls_md_free() when you are no longer using the - * context. - * Calling this function if you have previously - * called mbedtls_md_init() and nothing else is optional. - * You must not call this function if you have not called - * mbedtls_md_init(). - */ -void mbedtls_md_free( mbedtls_md_context_t *ctx ); - -#if ! defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief This function selects the message digest algorithm to use, - * and allocates internal structures. - * - * It should be called after mbedtls_md_init() or mbedtls_md_free(). - * Makes it necessary to call mbedtls_md_free() later. - * - * \deprecated Superseded by mbedtls_md_setup() in 2.0.0 - * - * \param ctx The context to set up. - * \param md_info The information structure of the message-digest algorithm - * to use. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification - * failure. - * \return #MBEDTLS_ERR_MD_ALLOC_FAILED on memory-allocation failure. - */ -int mbedtls_md_init_ctx( mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info ) MBEDTLS_DEPRECATED; -#undef MBEDTLS_DEPRECATED -#endif /* MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief This function selects the message digest algorithm to use, - * and allocates internal structures. - * - * It should be called after mbedtls_md_init() or - * mbedtls_md_free(). Makes it necessary to call - * mbedtls_md_free() later. - * - * \param ctx The context to set up. - * \param md_info The information structure of the message-digest algorithm - * to use. - * \param hmac Defines if HMAC is used. 0: HMAC is not used (saves some memory), - * or non-zero: HMAC is used with this context. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification - * failure. - * \return #MBEDTLS_ERR_MD_ALLOC_FAILED on memory-allocation failure. - */ -int mbedtls_md_setup( mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info, int hmac ); - -/** - * \brief This function clones the state of an message-digest - * context. - * - * \note You must call mbedtls_md_setup() on \c dst before calling - * this function. - * - * \note The two contexts must have the same type, - * for example, both are SHA-256. - * - * \warning This function clones the message-digest state, not the - * HMAC state. - * - * \param dst The destination context. - * \param src The context to be cloned. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification failure. - */ -int mbedtls_md_clone( mbedtls_md_context_t *dst, - const mbedtls_md_context_t *src ); - -/** - * \brief This function extracts the message-digest size from the - * message-digest information structure. - * - * \param md_info The information structure of the message-digest algorithm - * to use. - * - * \return The size of the message-digest output in Bytes. - */ -unsigned char mbedtls_md_get_size( const mbedtls_md_info_t *md_info ); - -/** - * \brief This function extracts the message-digest type from the - * message-digest information structure. - * - * \param md_info The information structure of the message-digest algorithm - * to use. - * - * \return The type of the message digest. - */ -mbedtls_md_type_t mbedtls_md_get_type( const mbedtls_md_info_t *md_info ); - -/** - * \brief This function extracts the message-digest name from the - * message-digest information structure. - * - * \param md_info The information structure of the message-digest algorithm - * to use. - * - * \return The name of the message digest. - */ -const char *mbedtls_md_get_name( const mbedtls_md_info_t *md_info ); - -/** - * \brief This function starts a message-digest computation. - * - * You must call this function after setting up the context - * with mbedtls_md_setup(), and before passing data with - * mbedtls_md_update(). - * - * \param ctx The generic message-digest context. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification - * failure. - */ -int mbedtls_md_starts( mbedtls_md_context_t *ctx ); - -/** - * \brief This function feeds an input buffer into an ongoing - * message-digest computation. - * - * You must call mbedtls_md_starts() before calling this - * function. You may call this function multiple times. - * Afterwards, call mbedtls_md_finish(). - * - * \param ctx The generic message-digest context. - * \param input The buffer holding the input data. - * \param ilen The length of the input data. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification - * failure. - */ -int mbedtls_md_update( mbedtls_md_context_t *ctx, const unsigned char *input, size_t ilen ); - -/** - * \brief This function finishes the digest operation, - * and writes the result to the output buffer. - * - * Call this function after a call to mbedtls_md_starts(), - * followed by any number of calls to mbedtls_md_update(). - * Afterwards, you may either clear the context with - * mbedtls_md_free(), or call mbedtls_md_starts() to reuse - * the context for another digest operation with the same - * algorithm. - * - * \param ctx The generic message-digest context. - * \param output The buffer for the generic message-digest checksum result. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification - * failure. - */ -int mbedtls_md_finish( mbedtls_md_context_t *ctx, unsigned char *output ); - -/** - * \brief This function calculates the message-digest of a buffer, - * with respect to a configurable message-digest algorithm - * in a single call. - * - * The result is calculated as - * Output = message_digest(input buffer). - * - * \param md_info The information structure of the message-digest algorithm - * to use. - * \param input The buffer holding the data. - * \param ilen The length of the input data. - * \param output The generic message-digest checksum result. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification - * failure. - */ -int mbedtls_md( const mbedtls_md_info_t *md_info, const unsigned char *input, size_t ilen, - unsigned char *output ); - -#if defined(MBEDTLS_FS_IO) -/** - * \brief This function calculates the message-digest checksum - * result of the contents of the provided file. - * - * The result is calculated as - * Output = message_digest(file contents). - * - * \param md_info The information structure of the message-digest algorithm - * to use. - * \param path The input file name. - * \param output The generic message-digest checksum result. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_FILE_IO_ERROR on an I/O error accessing - * the file pointed by \p path. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA if \p md_info was NULL. - */ -int mbedtls_md_file( const mbedtls_md_info_t *md_info, const char *path, - unsigned char *output ); -#endif /* MBEDTLS_FS_IO */ - -/** - * \brief This function sets the HMAC key and prepares to - * authenticate a new message. - * - * Call this function after mbedtls_md_setup(), to use - * the MD context for an HMAC calculation, then call - * mbedtls_md_hmac_update() to provide the input data, and - * mbedtls_md_hmac_finish() to get the HMAC value. - * - * \param ctx The message digest context containing an embedded HMAC - * context. - * \param key The HMAC secret key. - * \param keylen The length of the HMAC key in Bytes. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification - * failure. - */ -int mbedtls_md_hmac_starts( mbedtls_md_context_t *ctx, const unsigned char *key, - size_t keylen ); - -/** - * \brief This function feeds an input buffer into an ongoing HMAC - * computation. - * - * Call mbedtls_md_hmac_starts() or mbedtls_md_hmac_reset() - * before calling this function. - * You may call this function multiple times to pass the - * input piecewise. - * Afterwards, call mbedtls_md_hmac_finish(). - * - * \param ctx The message digest context containing an embedded HMAC - * context. - * \param input The buffer holding the input data. - * \param ilen The length of the input data. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification - * failure. - */ -int mbedtls_md_hmac_update( mbedtls_md_context_t *ctx, const unsigned char *input, - size_t ilen ); - -/** - * \brief This function finishes the HMAC operation, and writes - * the result to the output buffer. - * - * Call this function after mbedtls_md_hmac_starts() and - * mbedtls_md_hmac_update() to get the HMAC value. Afterwards - * you may either call mbedtls_md_free() to clear the context, - * or call mbedtls_md_hmac_reset() to reuse the context with - * the same HMAC key. - * - * \param ctx The message digest context containing an embedded HMAC - * context. - * \param output The generic HMAC checksum result. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification - * failure. - */ -int mbedtls_md_hmac_finish( mbedtls_md_context_t *ctx, unsigned char *output); - -/** - * \brief This function prepares to authenticate a new message with - * the same key as the previous HMAC operation. - * - * You may call this function after mbedtls_md_hmac_finish(). - * Afterwards call mbedtls_md_hmac_update() to pass the new - * input. - * - * \param ctx The message digest context containing an embedded HMAC - * context. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification - * failure. - */ -int mbedtls_md_hmac_reset( mbedtls_md_context_t *ctx ); - -/** - * \brief This function calculates the full generic HMAC - * on the input buffer with the provided key. - * - * The function allocates the context, performs the - * calculation, and frees the context. - * - * The HMAC result is calculated as - * output = generic HMAC(hmac key, input buffer). - * - * \param md_info The information structure of the message-digest algorithm - * to use. - * \param key The HMAC secret key. - * \param keylen The length of the HMAC secret key in Bytes. - * \param input The buffer holding the input data. - * \param ilen The length of the input data. - * \param output The generic HMAC result. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification - * failure. - */ -int mbedtls_md_hmac( const mbedtls_md_info_t *md_info, const unsigned char *key, size_t keylen, - const unsigned char *input, size_t ilen, - unsigned char *output ); - -/* Internal use */ -int mbedtls_md_process( mbedtls_md_context_t *ctx, const unsigned char *data ); - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_MD_H */ diff --git a/tools/sdk/include/mbedtls/mbedtls/md2.h b/tools/sdk/include/mbedtls/mbedtls/md2.h deleted file mode 100644 index a46bddb74b1..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/md2.h +++ /dev/null @@ -1,301 +0,0 @@ -/** - * \file md2.h - * - * \brief MD2 message digest algorithm (hash function) - * - * \warning MD2 is considered a weak message digest and its use constitutes a - * security risk. We recommend considering stronger message digests - * instead. - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - * - */ -#ifndef MBEDTLS_MD2_H -#define MBEDTLS_MD2_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include - -#define MBEDTLS_ERR_MD2_HW_ACCEL_FAILED -0x002B /**< MD2 hardware accelerator failed */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_MD2_ALT) -// Regular implementation -// - -/** - * \brief MD2 context structure - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -typedef struct mbedtls_md2_context -{ - unsigned char cksum[16]; /*!< checksum of the data block */ - unsigned char state[48]; /*!< intermediate digest state */ - unsigned char buffer[16]; /*!< data block being processed */ - size_t left; /*!< amount of data in buffer */ -} -mbedtls_md2_context; - -#else /* MBEDTLS_MD2_ALT */ -#include "md2_alt.h" -#endif /* MBEDTLS_MD2_ALT */ - -/** - * \brief Initialize MD2 context - * - * \param ctx MD2 context to be initialized - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -void mbedtls_md2_init( mbedtls_md2_context *ctx ); - -/** - * \brief Clear MD2 context - * - * \param ctx MD2 context to be cleared - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -void mbedtls_md2_free( mbedtls_md2_context *ctx ); - -/** - * \brief Clone (the state of) an MD2 context - * - * \param dst The destination context - * \param src The context to be cloned - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -void mbedtls_md2_clone( mbedtls_md2_context *dst, - const mbedtls_md2_context *src ); - -/** - * \brief MD2 context setup - * - * \param ctx context to be initialized - * - * \return 0 if successful - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md2_starts_ret( mbedtls_md2_context *ctx ); - -/** - * \brief MD2 process buffer - * - * \param ctx MD2 context - * \param input buffer holding the data - * \param ilen length of the input data - * - * \return 0 if successful - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md2_update_ret( mbedtls_md2_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief MD2 final digest - * - * \param ctx MD2 context - * \param output MD2 checksum result - * - * \return 0 if successful - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md2_finish_ret( mbedtls_md2_context *ctx, - unsigned char output[16] ); - -/** - * \brief MD2 process data block (internal use only) - * - * \param ctx MD2 context - * - * \return 0 if successful - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_internal_md2_process( mbedtls_md2_context *ctx ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief MD2 context setup - * - * \deprecated Superseded by mbedtls_md2_starts_ret() in 2.7.0 - * - * \param ctx context to be initialized - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md2_starts( mbedtls_md2_context *ctx ); - -/** - * \brief MD2 process buffer - * - * \deprecated Superseded by mbedtls_md2_update_ret() in 2.7.0 - * - * \param ctx MD2 context - * \param input buffer holding the data - * \param ilen length of the input data - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md2_update( mbedtls_md2_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief MD2 final digest - * - * \deprecated Superseded by mbedtls_md2_finish_ret() in 2.7.0 - * - * \param ctx MD2 context - * \param output MD2 checksum result - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md2_finish( mbedtls_md2_context *ctx, - unsigned char output[16] ); - -/** - * \brief MD2 process data block (internal use only) - * - * \deprecated Superseded by mbedtls_internal_md2_process() in 2.7.0 - * - * \param ctx MD2 context - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md2_process( mbedtls_md2_context *ctx ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief Output = MD2( input buffer ) - * - * \param input buffer holding the data - * \param ilen length of the input data - * \param output MD2 checksum result - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md2_ret( const unsigned char *input, - size_t ilen, - unsigned char output[16] ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief Output = MD2( input buffer ) - * - * \deprecated Superseded by mbedtls_md2_ret() in 2.7.0 - * - * \param input buffer holding the data - * \param ilen length of the input data - * \param output MD2 checksum result - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md2( const unsigned char *input, - size_t ilen, - unsigned char output[16] ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md2_self_test( int verbose ); - -#ifdef __cplusplus -} -#endif - -#endif /* mbedtls_md2.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/md4.h b/tools/sdk/include/mbedtls/mbedtls/md4.h deleted file mode 100644 index 1672e9074ef..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/md4.h +++ /dev/null @@ -1,306 +0,0 @@ -/** - * \file md4.h - * - * \brief MD4 message digest algorithm (hash function) - * - * \warning MD4 is considered a weak message digest and its use constitutes a - * security risk. We recommend considering stronger message digests - * instead. - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - * - */ -#ifndef MBEDTLS_MD4_H -#define MBEDTLS_MD4_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -#define MBEDTLS_ERR_MD4_HW_ACCEL_FAILED -0x002D /**< MD4 hardware accelerator failed */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_MD4_ALT) -// Regular implementation -// - -/** - * \brief MD4 context structure - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -typedef struct mbedtls_md4_context -{ - uint32_t total[2]; /*!< number of bytes processed */ - uint32_t state[4]; /*!< intermediate digest state */ - unsigned char buffer[64]; /*!< data block being processed */ -} -mbedtls_md4_context; - -#else /* MBEDTLS_MD4_ALT */ -#include "md4_alt.h" -#endif /* MBEDTLS_MD4_ALT */ - -/** - * \brief Initialize MD4 context - * - * \param ctx MD4 context to be initialized - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -void mbedtls_md4_init( mbedtls_md4_context *ctx ); - -/** - * \brief Clear MD4 context - * - * \param ctx MD4 context to be cleared - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -void mbedtls_md4_free( mbedtls_md4_context *ctx ); - -/** - * \brief Clone (the state of) an MD4 context - * - * \param dst The destination context - * \param src The context to be cloned - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -void mbedtls_md4_clone( mbedtls_md4_context *dst, - const mbedtls_md4_context *src ); - -/** - * \brief MD4 context setup - * - * \param ctx context to be initialized - * - * \return 0 if successful - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - */ -int mbedtls_md4_starts_ret( mbedtls_md4_context *ctx ); - -/** - * \brief MD4 process buffer - * - * \param ctx MD4 context - * \param input buffer holding the data - * \param ilen length of the input data - * - * \return 0 if successful - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md4_update_ret( mbedtls_md4_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief MD4 final digest - * - * \param ctx MD4 context - * \param output MD4 checksum result - * - * \return 0 if successful - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md4_finish_ret( mbedtls_md4_context *ctx, - unsigned char output[16] ); - -/** - * \brief MD4 process data block (internal use only) - * - * \param ctx MD4 context - * \param data buffer holding one block of data - * - * \return 0 if successful - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_internal_md4_process( mbedtls_md4_context *ctx, - const unsigned char data[64] ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief MD4 context setup - * - * \deprecated Superseded by mbedtls_md4_starts_ret() in 2.7.0 - * - * \param ctx context to be initialized - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md4_starts( mbedtls_md4_context *ctx ); - -/** - * \brief MD4 process buffer - * - * \deprecated Superseded by mbedtls_md4_update_ret() in 2.7.0 - * - * \param ctx MD4 context - * \param input buffer holding the data - * \param ilen length of the input data - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md4_update( mbedtls_md4_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief MD4 final digest - * - * \deprecated Superseded by mbedtls_md4_finish_ret() in 2.7.0 - * - * \param ctx MD4 context - * \param output MD4 checksum result - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md4_finish( mbedtls_md4_context *ctx, - unsigned char output[16] ); - -/** - * \brief MD4 process data block (internal use only) - * - * \deprecated Superseded by mbedtls_internal_md4_process() in 2.7.0 - * - * \param ctx MD4 context - * \param data buffer holding one block of data - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md4_process( mbedtls_md4_context *ctx, - const unsigned char data[64] ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief Output = MD4( input buffer ) - * - * \param input buffer holding the data - * \param ilen length of the input data - * \param output MD4 checksum result - * - * \return 0 if successful - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md4_ret( const unsigned char *input, - size_t ilen, - unsigned char output[16] ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief Output = MD4( input buffer ) - * - * \deprecated Superseded by mbedtls_md4_ret() in 2.7.0 - * - * \param input buffer holding the data - * \param ilen length of the input data - * \param output MD4 checksum result - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md4( const unsigned char *input, - size_t ilen, - unsigned char output[16] ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md4_self_test( int verbose ); - -#ifdef __cplusplus -} -#endif - -#endif /* mbedtls_md4.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/md5.h b/tools/sdk/include/mbedtls/mbedtls/md5.h deleted file mode 100644 index 4c9509010b6..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/md5.h +++ /dev/null @@ -1,306 +0,0 @@ -/** - * \file md5.h - * - * \brief MD5 message digest algorithm (hash function) - * - * \warning MD5 is considered a weak message digest and its use constitutes a - * security risk. We recommend considering stronger message - * digests instead. - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_MD5_H -#define MBEDTLS_MD5_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -#define MBEDTLS_ERR_MD5_HW_ACCEL_FAILED -0x002F /**< MD5 hardware accelerator failed */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_MD5_ALT) -// Regular implementation -// - -/** - * \brief MD5 context structure - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -typedef struct mbedtls_md5_context -{ - uint32_t total[2]; /*!< number of bytes processed */ - uint32_t state[4]; /*!< intermediate digest state */ - unsigned char buffer[64]; /*!< data block being processed */ -} -mbedtls_md5_context; - -#else /* MBEDTLS_MD5_ALT */ -#include "md5_alt.h" -#endif /* MBEDTLS_MD5_ALT */ - -/** - * \brief Initialize MD5 context - * - * \param ctx MD5 context to be initialized - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -void mbedtls_md5_init( mbedtls_md5_context *ctx ); - -/** - * \brief Clear MD5 context - * - * \param ctx MD5 context to be cleared - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -void mbedtls_md5_free( mbedtls_md5_context *ctx ); - -/** - * \brief Clone (the state of) an MD5 context - * - * \param dst The destination context - * \param src The context to be cloned - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -void mbedtls_md5_clone( mbedtls_md5_context *dst, - const mbedtls_md5_context *src ); - -/** - * \brief MD5 context setup - * - * \param ctx context to be initialized - * - * \return 0 if successful - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md5_starts_ret( mbedtls_md5_context *ctx ); - -/** - * \brief MD5 process buffer - * - * \param ctx MD5 context - * \param input buffer holding the data - * \param ilen length of the input data - * - * \return 0 if successful - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md5_update_ret( mbedtls_md5_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief MD5 final digest - * - * \param ctx MD5 context - * \param output MD5 checksum result - * - * \return 0 if successful - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md5_finish_ret( mbedtls_md5_context *ctx, - unsigned char output[16] ); - -/** - * \brief MD5 process data block (internal use only) - * - * \param ctx MD5 context - * \param data buffer holding one block of data - * - * \return 0 if successful - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_internal_md5_process( mbedtls_md5_context *ctx, - const unsigned char data[64] ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief MD5 context setup - * - * \deprecated Superseded by mbedtls_md5_starts_ret() in 2.7.0 - * - * \param ctx context to be initialized - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md5_starts( mbedtls_md5_context *ctx ); - -/** - * \brief MD5 process buffer - * - * \deprecated Superseded by mbedtls_md5_update_ret() in 2.7.0 - * - * \param ctx MD5 context - * \param input buffer holding the data - * \param ilen length of the input data - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md5_update( mbedtls_md5_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief MD5 final digest - * - * \deprecated Superseded by mbedtls_md5_finish_ret() in 2.7.0 - * - * \param ctx MD5 context - * \param output MD5 checksum result - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md5_finish( mbedtls_md5_context *ctx, - unsigned char output[16] ); - -/** - * \brief MD5 process data block (internal use only) - * - * \deprecated Superseded by mbedtls_internal_md5_process() in 2.7.0 - * - * \param ctx MD5 context - * \param data buffer holding one block of data - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md5_process( mbedtls_md5_context *ctx, - const unsigned char data[64] ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief Output = MD5( input buffer ) - * - * \param input buffer holding the data - * \param ilen length of the input data - * \param output MD5 checksum result - * - * \return 0 if successful - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md5_ret( const unsigned char *input, - size_t ilen, - unsigned char output[16] ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief Output = MD5( input buffer ) - * - * \deprecated Superseded by mbedtls_md5_ret() in 2.7.0 - * - * \param input buffer holding the data - * \param ilen length of the input data - * \param output MD5 checksum result - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md5( const unsigned char *input, - size_t ilen, - unsigned char output[16] ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md5_self_test( int verbose ); - -#ifdef __cplusplus -} -#endif - -#endif /* mbedtls_md5.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/md_internal.h b/tools/sdk/include/mbedtls/mbedtls/md_internal.h deleted file mode 100644 index 04de4829184..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/md_internal.h +++ /dev/null @@ -1,115 +0,0 @@ -/** - * \file md_internal.h - * - * \brief Message digest wrappers. - * - * \warning This in an internal header. Do not include directly. - * - * \author Adriaan de Jong - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_MD_WRAP_H -#define MBEDTLS_MD_WRAP_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "md.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Message digest information. - * Allows message digest functions to be called in a generic way. - */ -struct mbedtls_md_info_t -{ - /** Digest identifier */ - mbedtls_md_type_t type; - - /** Name of the message digest */ - const char * name; - - /** Output length of the digest function in bytes */ - int size; - - /** Block length of the digest function in bytes */ - int block_size; - - /** Digest initialisation function */ - int (*starts_func)( void *ctx ); - - /** Digest update function */ - int (*update_func)( void *ctx, const unsigned char *input, size_t ilen ); - - /** Digest finalisation function */ - int (*finish_func)( void *ctx, unsigned char *output ); - - /** Generic digest function */ - int (*digest_func)( const unsigned char *input, size_t ilen, - unsigned char *output ); - - /** Allocate a new context */ - void * (*ctx_alloc_func)( void ); - - /** Free the given context */ - void (*ctx_free_func)( void *ctx ); - - /** Clone state from a context */ - void (*clone_func)( void *dst, const void *src ); - - /** Internal use only */ - int (*process_func)( void *ctx, const unsigned char *input ); -}; - -#if defined(MBEDTLS_MD2_C) -extern const mbedtls_md_info_t mbedtls_md2_info; -#endif -#if defined(MBEDTLS_MD4_C) -extern const mbedtls_md_info_t mbedtls_md4_info; -#endif -#if defined(MBEDTLS_MD5_C) -extern const mbedtls_md_info_t mbedtls_md5_info; -#endif -#if defined(MBEDTLS_RIPEMD160_C) -extern const mbedtls_md_info_t mbedtls_ripemd160_info; -#endif -#if defined(MBEDTLS_SHA1_C) -extern const mbedtls_md_info_t mbedtls_sha1_info; -#endif -#if defined(MBEDTLS_SHA256_C) -extern const mbedtls_md_info_t mbedtls_sha224_info; -extern const mbedtls_md_info_t mbedtls_sha256_info; -#endif -#if defined(MBEDTLS_SHA512_C) -extern const mbedtls_md_info_t mbedtls_sha384_info; -extern const mbedtls_md_info_t mbedtls_sha512_info; -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_MD_WRAP_H */ diff --git a/tools/sdk/include/mbedtls/mbedtls/memory_buffer_alloc.h b/tools/sdk/include/mbedtls/mbedtls/memory_buffer_alloc.h deleted file mode 100644 index 705f9a63690..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/memory_buffer_alloc.h +++ /dev/null @@ -1,151 +0,0 @@ -/** - * \file memory_buffer_alloc.h - * - * \brief Buffer-based memory allocator - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_MEMORY_BUFFER_ALLOC_H -#define MBEDTLS_MEMORY_BUFFER_ALLOC_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include - -/** - * \name SECTION: Module settings - * - * The configuration options you can set for this module are in this section. - * Either change them in config.h or define them on the compiler command line. - * \{ - */ - -#if !defined(MBEDTLS_MEMORY_ALIGN_MULTIPLE) -#define MBEDTLS_MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */ -#endif - -/* \} name SECTION: Module settings */ - -#define MBEDTLS_MEMORY_VERIFY_NONE 0 -#define MBEDTLS_MEMORY_VERIFY_ALLOC (1 << 0) -#define MBEDTLS_MEMORY_VERIFY_FREE (1 << 1) -#define MBEDTLS_MEMORY_VERIFY_ALWAYS (MBEDTLS_MEMORY_VERIFY_ALLOC | MBEDTLS_MEMORY_VERIFY_FREE) - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Initialize use of stack-based memory allocator. - * The stack-based allocator does memory management inside the - * presented buffer and does not call calloc() and free(). - * It sets the global mbedtls_calloc() and mbedtls_free() pointers - * to its own functions. - * (Provided mbedtls_calloc() and mbedtls_free() are thread-safe if - * MBEDTLS_THREADING_C is defined) - * - * \note This code is not optimized and provides a straight-forward - * implementation of a stack-based memory allocator. - * - * \param buf buffer to use as heap - * \param len size of the buffer - */ -void mbedtls_memory_buffer_alloc_init( unsigned char *buf, size_t len ); - -/** - * \brief Free the mutex for thread-safety and clear remaining memory - */ -void mbedtls_memory_buffer_alloc_free( void ); - -/** - * \brief Determine when the allocator should automatically verify the state - * of the entire chain of headers / meta-data. - * (Default: MBEDTLS_MEMORY_VERIFY_NONE) - * - * \param verify One of MBEDTLS_MEMORY_VERIFY_NONE, MBEDTLS_MEMORY_VERIFY_ALLOC, - * MBEDTLS_MEMORY_VERIFY_FREE or MBEDTLS_MEMORY_VERIFY_ALWAYS - */ -void mbedtls_memory_buffer_set_verify( int verify ); - -#if defined(MBEDTLS_MEMORY_DEBUG) -/** - * \brief Print out the status of the allocated memory (primarily for use - * after a program should have de-allocated all memory) - * Prints out a list of 'still allocated' blocks and their stack - * trace if MBEDTLS_MEMORY_BACKTRACE is defined. - */ -void mbedtls_memory_buffer_alloc_status( void ); - -/** - * \brief Get the peak heap usage so far - * - * \param max_used Peak number of bytes in use or committed. This - * includes bytes in allocated blocks too small to split - * into smaller blocks but larger than the requested size. - * \param max_blocks Peak number of blocks in use, including free and used - */ -void mbedtls_memory_buffer_alloc_max_get( size_t *max_used, size_t *max_blocks ); - -/** - * \brief Reset peak statistics - */ -void mbedtls_memory_buffer_alloc_max_reset( void ); - -/** - * \brief Get the current heap usage - * - * \param cur_used Current number of bytes in use or committed. This - * includes bytes in allocated blocks too small to split - * into smaller blocks but larger than the requested size. - * \param cur_blocks Current number of blocks in use, including free and used - */ -void mbedtls_memory_buffer_alloc_cur_get( size_t *cur_used, size_t *cur_blocks ); -#endif /* MBEDTLS_MEMORY_DEBUG */ - -/** - * \brief Verifies that all headers in the memory buffer are correct - * and contain sane values. Helps debug buffer-overflow errors. - * - * Prints out first failure if MBEDTLS_MEMORY_DEBUG is defined. - * Prints out full header information if MBEDTLS_MEMORY_DEBUG - * is defined. (Includes stack trace information for each block if - * MBEDTLS_MEMORY_BACKTRACE is defined as well). - * - * \return 0 if verified, 1 otherwise - */ -int mbedtls_memory_buffer_alloc_verify( void ); - -#if defined(MBEDTLS_SELF_TEST) -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if a test failed - */ -int mbedtls_memory_buffer_alloc_self_test( int verbose ); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* memory_buffer_alloc.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/net.h b/tools/sdk/include/mbedtls/mbedtls/net.h deleted file mode 100644 index 6c13b53fb93..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/net.h +++ /dev/null @@ -1,32 +0,0 @@ -/** - * \file net.h - * - * \brief Deprecated header file that includes net_sockets.h - * - * \deprecated Superseded by mbedtls/net_sockets.h - */ -/* - * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#include "net_sockets.h" -#if defined(MBEDTLS_DEPRECATED_WARNING) -#warning "Deprecated header file: Superseded by mbedtls/net_sockets.h" -#endif /* MBEDTLS_DEPRECATED_WARNING */ -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ diff --git a/tools/sdk/include/mbedtls/mbedtls/net_sockets.h b/tools/sdk/include/mbedtls/mbedtls/net_sockets.h deleted file mode 100644 index 4c7ef00fe66..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/net_sockets.h +++ /dev/null @@ -1,271 +0,0 @@ -/** - * \file net_sockets.h - * - * \brief Network sockets abstraction layer to integrate Mbed TLS into a - * BSD-style sockets API. - * - * The network sockets module provides an example integration of the - * Mbed TLS library into a BSD sockets implementation. The module is - * intended to be an example of how Mbed TLS can be integrated into a - * networking stack, as well as to be Mbed TLS's network integration - * for its supported platforms. - * - * The module is intended only to be used with the Mbed TLS library and - * is not intended to be used by third party application software - * directly. - * - * The supported platforms are as follows: - * * Microsoft Windows and Windows CE - * * POSIX/Unix platforms including Linux, OS X - * - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_NET_SOCKETS_H -#define MBEDTLS_NET_SOCKETS_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "ssl.h" - -#include -#include - -#define MBEDTLS_ERR_NET_SOCKET_FAILED -0x0042 /**< Failed to open a socket. */ -#define MBEDTLS_ERR_NET_CONNECT_FAILED -0x0044 /**< The connection to the given server / port failed. */ -#define MBEDTLS_ERR_NET_BIND_FAILED -0x0046 /**< Binding of the socket failed. */ -#define MBEDTLS_ERR_NET_LISTEN_FAILED -0x0048 /**< Could not listen on the socket. */ -#define MBEDTLS_ERR_NET_ACCEPT_FAILED -0x004A /**< Could not accept the incoming connection. */ -#define MBEDTLS_ERR_NET_RECV_FAILED -0x004C /**< Reading information from the socket failed. */ -#define MBEDTLS_ERR_NET_SEND_FAILED -0x004E /**< Sending information through the socket failed. */ -#define MBEDTLS_ERR_NET_CONN_RESET -0x0050 /**< Connection was reset by peer. */ -#define MBEDTLS_ERR_NET_UNKNOWN_HOST -0x0052 /**< Failed to get an IP address for the given hostname. */ -#define MBEDTLS_ERR_NET_BUFFER_TOO_SMALL -0x0043 /**< Buffer is too small to hold the data. */ -#define MBEDTLS_ERR_NET_INVALID_CONTEXT -0x0045 /**< The context is invalid, eg because it was free()ed. */ -#define MBEDTLS_ERR_NET_POLL_FAILED -0x0047 /**< Polling the net context failed. */ -#define MBEDTLS_ERR_NET_BAD_INPUT_DATA -0x0049 /**< Input invalid. */ - -#define MBEDTLS_NET_LISTEN_BACKLOG 10 /**< The backlog that listen() should use. */ - -#define MBEDTLS_NET_PROTO_TCP 0 /**< The TCP transport protocol */ -#define MBEDTLS_NET_PROTO_UDP 1 /**< The UDP transport protocol */ - -#define MBEDTLS_NET_POLL_READ 1 /**< Used in \c mbedtls_net_poll to check for pending data */ -#define MBEDTLS_NET_POLL_WRITE 2 /**< Used in \c mbedtls_net_poll to check if write possible */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Wrapper type for sockets. - * - * Currently backed by just a file descriptor, but might be more in the future - * (eg two file descriptors for combined IPv4 + IPv6 support, or additional - * structures for hand-made UDP demultiplexing). - */ -typedef struct mbedtls_net_context -{ - int fd; /**< The underlying file descriptor */ -} -mbedtls_net_context; - -/** - * \brief Initialize a context - * Just makes the context ready to be used or freed safely. - * - * \param ctx Context to initialize - */ -void mbedtls_net_init( mbedtls_net_context *ctx ); - -/** - * \brief Initiate a connection with host:port in the given protocol - * - * \param ctx Socket to use - * \param host Host to connect to - * \param port Port to connect to - * \param proto Protocol: MBEDTLS_NET_PROTO_TCP or MBEDTLS_NET_PROTO_UDP - * - * \return 0 if successful, or one of: - * MBEDTLS_ERR_NET_SOCKET_FAILED, - * MBEDTLS_ERR_NET_UNKNOWN_HOST, - * MBEDTLS_ERR_NET_CONNECT_FAILED - * - * \note Sets the socket in connected mode even with UDP. - */ -int mbedtls_net_connect( mbedtls_net_context *ctx, const char *host, const char *port, int proto ); - -/** - * \brief Create a receiving socket on bind_ip:port in the chosen - * protocol. If bind_ip == NULL, all interfaces are bound. - * - * \param ctx Socket to use - * \param bind_ip IP to bind to, can be NULL - * \param port Port number to use - * \param proto Protocol: MBEDTLS_NET_PROTO_TCP or MBEDTLS_NET_PROTO_UDP - * - * \return 0 if successful, or one of: - * MBEDTLS_ERR_NET_SOCKET_FAILED, - * MBEDTLS_ERR_NET_BIND_FAILED, - * MBEDTLS_ERR_NET_LISTEN_FAILED - * - * \note Regardless of the protocol, opens the sockets and binds it. - * In addition, make the socket listening if protocol is TCP. - */ -int mbedtls_net_bind( mbedtls_net_context *ctx, const char *bind_ip, const char *port, int proto ); - -/** - * \brief Accept a connection from a remote client - * - * \param bind_ctx Relevant socket - * \param client_ctx Will contain the connected client socket - * \param client_ip Will contain the client IP address, can be NULL - * \param buf_size Size of the client_ip buffer - * \param ip_len Will receive the size of the client IP written, - * can be NULL if client_ip is null - * - * \return 0 if successful, or - * MBEDTLS_ERR_NET_ACCEPT_FAILED, or - * MBEDTLS_ERR_NET_BUFFER_TOO_SMALL if buf_size is too small, - * MBEDTLS_ERR_SSL_WANT_READ if bind_fd was set to - * non-blocking and accept() would block. - */ -int mbedtls_net_accept( mbedtls_net_context *bind_ctx, - mbedtls_net_context *client_ctx, - void *client_ip, size_t buf_size, size_t *ip_len ); - -/** - * \brief Check and wait for the context to be ready for read/write - * - * \param ctx Socket to check - * \param rw Bitflag composed of MBEDTLS_NET_POLL_READ and - * MBEDTLS_NET_POLL_WRITE specifying the events - * to wait for: - * - If MBEDTLS_NET_POLL_READ is set, the function - * will return as soon as the net context is available - * for reading. - * - If MBEDTLS_NET_POLL_WRITE is set, the function - * will return as soon as the net context is available - * for writing. - * \param timeout Maximal amount of time to wait before returning, - * in milliseconds. If \c timeout is zero, the - * function returns immediately. If \c timeout is - * -1u, the function blocks potentially indefinitely. - * - * \return Bitmask composed of MBEDTLS_NET_POLL_READ/WRITE - * on success or timeout, or a negative return code otherwise. - */ -int mbedtls_net_poll( mbedtls_net_context *ctx, uint32_t rw, uint32_t timeout ); - -/** - * \brief Set the socket blocking - * - * \param ctx Socket to set - * - * \return 0 if successful, or a non-zero error code - */ -int mbedtls_net_set_block( mbedtls_net_context *ctx ); - -/** - * \brief Set the socket non-blocking - * - * \param ctx Socket to set - * - * \return 0 if successful, or a non-zero error code - */ -int mbedtls_net_set_nonblock( mbedtls_net_context *ctx ); - -/** - * \brief Portable usleep helper - * - * \param usec Amount of microseconds to sleep - * - * \note Real amount of time slept will not be less than - * select()'s timeout granularity (typically, 10ms). - */ -void mbedtls_net_usleep( unsigned long usec ); - -/** - * \brief Read at most 'len' characters. If no error occurs, - * the actual amount read is returned. - * - * \param ctx Socket - * \param buf The buffer to write to - * \param len Maximum length of the buffer - * - * \return the number of bytes received, - * or a non-zero error code; with a non-blocking socket, - * MBEDTLS_ERR_SSL_WANT_READ indicates read() would block. - */ -int mbedtls_net_recv( void *ctx, unsigned char *buf, size_t len ); - -/** - * \brief Write at most 'len' characters. If no error occurs, - * the actual amount read is returned. - * - * \param ctx Socket - * \param buf The buffer to read from - * \param len The length of the buffer - * - * \return the number of bytes sent, - * or a non-zero error code; with a non-blocking socket, - * MBEDTLS_ERR_SSL_WANT_WRITE indicates write() would block. - */ -int mbedtls_net_send( void *ctx, const unsigned char *buf, size_t len ); - -/** - * \brief Read at most 'len' characters, blocking for at most - * 'timeout' seconds. If no error occurs, the actual amount - * read is returned. - * - * \param ctx Socket - * \param buf The buffer to write to - * \param len Maximum length of the buffer - * \param timeout Maximum number of milliseconds to wait for data - * 0 means no timeout (wait forever) - * - * \return the number of bytes received, - * or a non-zero error code: - * MBEDTLS_ERR_SSL_TIMEOUT if the operation timed out, - * MBEDTLS_ERR_SSL_WANT_READ if interrupted by a signal. - * - * \note This function will block (until data becomes available or - * timeout is reached) even if the socket is set to - * non-blocking. Handling timeouts with non-blocking reads - * requires a different strategy. - */ -int mbedtls_net_recv_timeout( void *ctx, unsigned char *buf, size_t len, - uint32_t timeout ); - -/** - * \brief Gracefully shutdown the connection and free associated data - * - * \param ctx The context to free - */ -void mbedtls_net_free( mbedtls_net_context *ctx ); - -#ifdef __cplusplus -} -#endif - -#endif /* net_sockets.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/nist_kw.h b/tools/sdk/include/mbedtls/mbedtls/nist_kw.h deleted file mode 100644 index 5a0f656a8f5..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/nist_kw.h +++ /dev/null @@ -1,178 +0,0 @@ -/** - * \file nist_kw.h - * - * \brief This file provides an API for key wrapping (KW) and key wrapping with - * padding (KWP) as defined in NIST SP 800-38F. - * https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38F.pdf - * - * Key wrapping specifies a deterministic authenticated-encryption mode - * of operation, according to NIST SP 800-38F: Recommendation for - * Block Cipher Modes of Operation: Methods for Key Wrapping. Its - * purpose is to protect cryptographic keys. - * - * Its equivalent is RFC 3394 for KW, and RFC 5649 for KWP. - * https://tools.ietf.org/html/rfc3394 - * https://tools.ietf.org/html/rfc5649 - * - */ -/* - * Copyright (C) 2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_NIST_KW_H -#define MBEDTLS_NIST_KW_H - -#include "cipher.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum -{ - MBEDTLS_KW_MODE_KW = 0, - MBEDTLS_KW_MODE_KWP = 1 -} mbedtls_nist_kw_mode_t; - -#if !defined(MBEDTLS_NIST_KW_ALT) -// Regular implementation -// - -/** - * \brief The key wrapping context-type definition. The key wrapping context is passed - * to the APIs called. - * - * \note The definition of this type may change in future library versions. - * Don't make any assumptions on this context! - */ -typedef struct { - mbedtls_cipher_context_t cipher_ctx; /*!< The cipher context used. */ -} mbedtls_nist_kw_context; - -#else /* MBEDTLS_NIST_key wrapping_ALT */ -#include "nist_kw_alt.h" -#endif /* MBEDTLS_NIST_KW_ALT */ - -/** - * \brief This function initializes the specified key wrapping context - * to make references valid and prepare the context - * for mbedtls_nist_kw_setkey() or mbedtls_nist_kw_free(). - * - * \param ctx The key wrapping context to initialize. - * - */ -void mbedtls_nist_kw_init( mbedtls_nist_kw_context *ctx ); - -/** - * \brief This function initializes the key wrapping context set in the - * \p ctx parameter and sets the encryption key. - * - * \param ctx The key wrapping context. - * \param cipher The 128-bit block cipher to use. Only AES is supported. - * \param key The Key Encryption Key (KEK). - * \param keybits The KEK size in bits. This must be acceptable by the cipher. - * \param is_wrap Specify whether the operation within the context is wrapping or unwrapping - * - * \return \c 0 on success. - * \return \c MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA for any invalid input. - * \return \c MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE for 128-bit block ciphers - * which are not supported. - * \return cipher-specific error code on failure of the underlying cipher. - */ -int mbedtls_nist_kw_setkey( mbedtls_nist_kw_context *ctx, - mbedtls_cipher_id_t cipher, - const unsigned char *key, - unsigned int keybits, - const int is_wrap ); - -/** - * \brief This function releases and clears the specified key wrapping context - * and underlying cipher sub-context. - * - * \param ctx The key wrapping context to clear. - */ -void mbedtls_nist_kw_free( mbedtls_nist_kw_context *ctx ); - -/** - * \brief This function encrypts a buffer using key wrapping. - * - * \param ctx The key wrapping context to use for encryption. - * \param mode The key wrapping mode to use (MBEDTLS_KW_MODE_KW or MBEDTLS_KW_MODE_KWP) - * \param input The buffer holding the input data. - * \param in_len The length of the input data in Bytes. - * The input uses units of 8 Bytes called semiblocks. - *
  • For KW mode: a multiple of 8 bytes between 16 and 2^57-8 inclusive.
  • - *
  • For KWP mode: any length between 1 and 2^32-1 inclusive.
- * \param[out] output The buffer holding the output data. - *
  • For KW mode: Must be at least 8 bytes larger than \p in_len.
  • - *
  • For KWP mode: Must be at least 8 bytes larger rounded up to a multiple of - * 8 bytes for KWP (15 bytes at most).
- * \param[out] out_len The number of bytes written to the output buffer. \c 0 on failure. - * \param[in] out_size The capacity of the output buffer. - * - * \return \c 0 on success. - * \return \c MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA for invalid input length. - * \return cipher-specific error code on failure of the underlying cipher. - */ -int mbedtls_nist_kw_wrap( mbedtls_nist_kw_context *ctx, mbedtls_nist_kw_mode_t mode, - const unsigned char *input, size_t in_len, - unsigned char *output, size_t* out_len, size_t out_size ); - -/** - * \brief This function decrypts a buffer using key wrapping. - * - * \param ctx The key wrapping context to use for decryption. - * \param mode The key wrapping mode to use (MBEDTLS_KW_MODE_KW or MBEDTLS_KW_MODE_KWP) - * \param input The buffer holding the input data. - * \param in_len The length of the input data in Bytes. - * The input uses units of 8 Bytes called semiblocks. - * The input must be a multiple of semiblocks. - *
  • For KW mode: a multiple of 8 bytes between 24 and 2^57 inclusive.
  • - *
  • For KWP mode: a multiple of 8 bytes between 16 and 2^32 inclusive.
- * \param[out] output The buffer holding the output data. - * The output buffer's minimal length is 8 bytes shorter than \p in_len. - * \param[out] out_len The number of bytes written to the output buffer. \c 0 on failure. - * For KWP mode, the length could be up to 15 bytes shorter than \p in_len, - * depending on how much padding was added to the data. - * \param[in] out_size The capacity of the output buffer. - * - * \return \c 0 on success. - * \return \c MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA for invalid input length. - * \return \c MBEDTLS_ERR_CIPHER_AUTH_FAILED for verification failure of the ciphertext. - * \return cipher-specific error code on failure of the underlying cipher. - */ -int mbedtls_nist_kw_unwrap( mbedtls_nist_kw_context *ctx, mbedtls_nist_kw_mode_t mode, - const unsigned char *input, size_t in_len, - unsigned char *output, size_t* out_len, size_t out_size); - - -#if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_AES_C) -/** - * \brief The key wrapping checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_nist_kw_self_test( int verbose ); -#endif /* MBEDTLS_SELF_TEST && MBEDTLS_AES_C */ - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_NIST_KW_H */ diff --git a/tools/sdk/include/mbedtls/mbedtls/oid.h b/tools/sdk/include/mbedtls/mbedtls/oid.h deleted file mode 100644 index 6fbd018aaa1..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/oid.h +++ /dev/null @@ -1,605 +0,0 @@ -/** - * \file oid.h - * - * \brief Object Identifier (OID) database - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_OID_H -#define MBEDTLS_OID_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "asn1.h" -#include "pk.h" - -#include - -#if defined(MBEDTLS_CIPHER_C) -#include "cipher.h" -#endif - -#if defined(MBEDTLS_MD_C) -#include "md.h" -#endif - -#if defined(MBEDTLS_X509_USE_C) || defined(MBEDTLS_X509_CREATE_C) -#include "x509.h" -#endif - -#define MBEDTLS_ERR_OID_NOT_FOUND -0x002E /**< OID is not found. */ -#define MBEDTLS_ERR_OID_BUF_TOO_SMALL -0x000B /**< output buffer is too small */ - -/* - * Top level OID tuples - */ -#define MBEDTLS_OID_ISO_MEMBER_BODIES "\x2a" /* {iso(1) member-body(2)} */ -#define MBEDTLS_OID_ISO_IDENTIFIED_ORG "\x2b" /* {iso(1) identified-organization(3)} */ -#define MBEDTLS_OID_ISO_CCITT_DS "\x55" /* {joint-iso-ccitt(2) ds(5)} */ -#define MBEDTLS_OID_ISO_ITU_COUNTRY "\x60" /* {joint-iso-itu-t(2) country(16)} */ - -/* - * ISO Member bodies OID parts - */ -#define MBEDTLS_OID_COUNTRY_US "\x86\x48" /* {us(840)} */ -#define MBEDTLS_OID_ORG_RSA_DATA_SECURITY "\x86\xf7\x0d" /* {rsadsi(113549)} */ -#define MBEDTLS_OID_RSA_COMPANY MBEDTLS_OID_ISO_MEMBER_BODIES MBEDTLS_OID_COUNTRY_US \ - MBEDTLS_OID_ORG_RSA_DATA_SECURITY /* {iso(1) member-body(2) us(840) rsadsi(113549)} */ -#define MBEDTLS_OID_ORG_ANSI_X9_62 "\xce\x3d" /* ansi-X9-62(10045) */ -#define MBEDTLS_OID_ANSI_X9_62 MBEDTLS_OID_ISO_MEMBER_BODIES MBEDTLS_OID_COUNTRY_US \ - MBEDTLS_OID_ORG_ANSI_X9_62 - -/* - * ISO Identified organization OID parts - */ -#define MBEDTLS_OID_ORG_DOD "\x06" /* {dod(6)} */ -#define MBEDTLS_OID_ORG_OIW "\x0e" -#define MBEDTLS_OID_OIW_SECSIG MBEDTLS_OID_ORG_OIW "\x03" -#define MBEDTLS_OID_OIW_SECSIG_ALG MBEDTLS_OID_OIW_SECSIG "\x02" -#define MBEDTLS_OID_OIW_SECSIG_SHA1 MBEDTLS_OID_OIW_SECSIG_ALG "\x1a" -#define MBEDTLS_OID_ORG_CERTICOM "\x81\x04" /* certicom(132) */ -#define MBEDTLS_OID_CERTICOM MBEDTLS_OID_ISO_IDENTIFIED_ORG MBEDTLS_OID_ORG_CERTICOM -#define MBEDTLS_OID_ORG_TELETRUST "\x24" /* teletrust(36) */ -#define MBEDTLS_OID_TELETRUST MBEDTLS_OID_ISO_IDENTIFIED_ORG MBEDTLS_OID_ORG_TELETRUST - -/* - * ISO ITU OID parts - */ -#define MBEDTLS_OID_ORGANIZATION "\x01" /* {organization(1)} */ -#define MBEDTLS_OID_ISO_ITU_US_ORG MBEDTLS_OID_ISO_ITU_COUNTRY MBEDTLS_OID_COUNTRY_US MBEDTLS_OID_ORGANIZATION /* {joint-iso-itu-t(2) country(16) us(840) organization(1)} */ - -#define MBEDTLS_OID_ORG_GOV "\x65" /* {gov(101)} */ -#define MBEDTLS_OID_GOV MBEDTLS_OID_ISO_ITU_US_ORG MBEDTLS_OID_ORG_GOV /* {joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101)} */ - -#define MBEDTLS_OID_ORG_NETSCAPE "\x86\xF8\x42" /* {netscape(113730)} */ -#define MBEDTLS_OID_NETSCAPE MBEDTLS_OID_ISO_ITU_US_ORG MBEDTLS_OID_ORG_NETSCAPE /* Netscape OID {joint-iso-itu-t(2) country(16) us(840) organization(1) netscape(113730)} */ - -/* ISO arc for standard certificate and CRL extensions */ -#define MBEDTLS_OID_ID_CE MBEDTLS_OID_ISO_CCITT_DS "\x1D" /**< id-ce OBJECT IDENTIFIER ::= {joint-iso-ccitt(2) ds(5) 29} */ - -#define MBEDTLS_OID_NIST_ALG MBEDTLS_OID_GOV "\x03\x04" /** { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistAlgorithm(4) */ - -/** - * Private Internet Extensions - * { iso(1) identified-organization(3) dod(6) internet(1) - * security(5) mechanisms(5) pkix(7) } - */ -#define MBEDTLS_OID_PKIX MBEDTLS_OID_ISO_IDENTIFIED_ORG MBEDTLS_OID_ORG_DOD "\x01\x05\x05\x07" - -/* - * Arc for standard naming attributes - */ -#define MBEDTLS_OID_AT MBEDTLS_OID_ISO_CCITT_DS "\x04" /**< id-at OBJECT IDENTIFIER ::= {joint-iso-ccitt(2) ds(5) 4} */ -#define MBEDTLS_OID_AT_CN MBEDTLS_OID_AT "\x03" /**< id-at-commonName AttributeType:= {id-at 3} */ -#define MBEDTLS_OID_AT_SUR_NAME MBEDTLS_OID_AT "\x04" /**< id-at-surName AttributeType:= {id-at 4} */ -#define MBEDTLS_OID_AT_SERIAL_NUMBER MBEDTLS_OID_AT "\x05" /**< id-at-serialNumber AttributeType:= {id-at 5} */ -#define MBEDTLS_OID_AT_COUNTRY MBEDTLS_OID_AT "\x06" /**< id-at-countryName AttributeType:= {id-at 6} */ -#define MBEDTLS_OID_AT_LOCALITY MBEDTLS_OID_AT "\x07" /**< id-at-locality AttributeType:= {id-at 7} */ -#define MBEDTLS_OID_AT_STATE MBEDTLS_OID_AT "\x08" /**< id-at-state AttributeType:= {id-at 8} */ -#define MBEDTLS_OID_AT_ORGANIZATION MBEDTLS_OID_AT "\x0A" /**< id-at-organizationName AttributeType:= {id-at 10} */ -#define MBEDTLS_OID_AT_ORG_UNIT MBEDTLS_OID_AT "\x0B" /**< id-at-organizationalUnitName AttributeType:= {id-at 11} */ -#define MBEDTLS_OID_AT_TITLE MBEDTLS_OID_AT "\x0C" /**< id-at-title AttributeType:= {id-at 12} */ -#define MBEDTLS_OID_AT_POSTAL_ADDRESS MBEDTLS_OID_AT "\x10" /**< id-at-postalAddress AttributeType:= {id-at 16} */ -#define MBEDTLS_OID_AT_POSTAL_CODE MBEDTLS_OID_AT "\x11" /**< id-at-postalCode AttributeType:= {id-at 17} */ -#define MBEDTLS_OID_AT_GIVEN_NAME MBEDTLS_OID_AT "\x2A" /**< id-at-givenName AttributeType:= {id-at 42} */ -#define MBEDTLS_OID_AT_INITIALS MBEDTLS_OID_AT "\x2B" /**< id-at-initials AttributeType:= {id-at 43} */ -#define MBEDTLS_OID_AT_GENERATION_QUALIFIER MBEDTLS_OID_AT "\x2C" /**< id-at-generationQualifier AttributeType:= {id-at 44} */ -#define MBEDTLS_OID_AT_UNIQUE_IDENTIFIER MBEDTLS_OID_AT "\x2D" /**< id-at-uniqueIdentifier AttributType:= {id-at 45} */ -#define MBEDTLS_OID_AT_DN_QUALIFIER MBEDTLS_OID_AT "\x2E" /**< id-at-dnQualifier AttributeType:= {id-at 46} */ -#define MBEDTLS_OID_AT_PSEUDONYM MBEDTLS_OID_AT "\x41" /**< id-at-pseudonym AttributeType:= {id-at 65} */ - -#define MBEDTLS_OID_DOMAIN_COMPONENT "\x09\x92\x26\x89\x93\xF2\x2C\x64\x01\x19" /** id-domainComponent AttributeType:= {itu-t(0) data(9) pss(2342) ucl(19200300) pilot(100) pilotAttributeType(1) domainComponent(25)} */ - -/* - * OIDs for standard certificate extensions - */ -#define MBEDTLS_OID_AUTHORITY_KEY_IDENTIFIER MBEDTLS_OID_ID_CE "\x23" /**< id-ce-authorityKeyIdentifier OBJECT IDENTIFIER ::= { id-ce 35 } */ -#define MBEDTLS_OID_SUBJECT_KEY_IDENTIFIER MBEDTLS_OID_ID_CE "\x0E" /**< id-ce-subjectKeyIdentifier OBJECT IDENTIFIER ::= { id-ce 14 } */ -#define MBEDTLS_OID_KEY_USAGE MBEDTLS_OID_ID_CE "\x0F" /**< id-ce-keyUsage OBJECT IDENTIFIER ::= { id-ce 15 } */ -#define MBEDTLS_OID_CERTIFICATE_POLICIES MBEDTLS_OID_ID_CE "\x20" /**< id-ce-certificatePolicies OBJECT IDENTIFIER ::= { id-ce 32 } */ -#define MBEDTLS_OID_POLICY_MAPPINGS MBEDTLS_OID_ID_CE "\x21" /**< id-ce-policyMappings OBJECT IDENTIFIER ::= { id-ce 33 } */ -#define MBEDTLS_OID_SUBJECT_ALT_NAME MBEDTLS_OID_ID_CE "\x11" /**< id-ce-subjectAltName OBJECT IDENTIFIER ::= { id-ce 17 } */ -#define MBEDTLS_OID_ISSUER_ALT_NAME MBEDTLS_OID_ID_CE "\x12" /**< id-ce-issuerAltName OBJECT IDENTIFIER ::= { id-ce 18 } */ -#define MBEDTLS_OID_SUBJECT_DIRECTORY_ATTRS MBEDTLS_OID_ID_CE "\x09" /**< id-ce-subjectDirectoryAttributes OBJECT IDENTIFIER ::= { id-ce 9 } */ -#define MBEDTLS_OID_BASIC_CONSTRAINTS MBEDTLS_OID_ID_CE "\x13" /**< id-ce-basicConstraints OBJECT IDENTIFIER ::= { id-ce 19 } */ -#define MBEDTLS_OID_NAME_CONSTRAINTS MBEDTLS_OID_ID_CE "\x1E" /**< id-ce-nameConstraints OBJECT IDENTIFIER ::= { id-ce 30 } */ -#define MBEDTLS_OID_POLICY_CONSTRAINTS MBEDTLS_OID_ID_CE "\x24" /**< id-ce-policyConstraints OBJECT IDENTIFIER ::= { id-ce 36 } */ -#define MBEDTLS_OID_EXTENDED_KEY_USAGE MBEDTLS_OID_ID_CE "\x25" /**< id-ce-extKeyUsage OBJECT IDENTIFIER ::= { id-ce 37 } */ -#define MBEDTLS_OID_CRL_DISTRIBUTION_POINTS MBEDTLS_OID_ID_CE "\x1F" /**< id-ce-cRLDistributionPoints OBJECT IDENTIFIER ::= { id-ce 31 } */ -#define MBEDTLS_OID_INIHIBIT_ANYPOLICY MBEDTLS_OID_ID_CE "\x36" /**< id-ce-inhibitAnyPolicy OBJECT IDENTIFIER ::= { id-ce 54 } */ -#define MBEDTLS_OID_FRESHEST_CRL MBEDTLS_OID_ID_CE "\x2E" /**< id-ce-freshestCRL OBJECT IDENTIFIER ::= { id-ce 46 } */ - -/* - * Netscape certificate extensions - */ -#define MBEDTLS_OID_NS_CERT MBEDTLS_OID_NETSCAPE "\x01" -#define MBEDTLS_OID_NS_CERT_TYPE MBEDTLS_OID_NS_CERT "\x01" -#define MBEDTLS_OID_NS_BASE_URL MBEDTLS_OID_NS_CERT "\x02" -#define MBEDTLS_OID_NS_REVOCATION_URL MBEDTLS_OID_NS_CERT "\x03" -#define MBEDTLS_OID_NS_CA_REVOCATION_URL MBEDTLS_OID_NS_CERT "\x04" -#define MBEDTLS_OID_NS_RENEWAL_URL MBEDTLS_OID_NS_CERT "\x07" -#define MBEDTLS_OID_NS_CA_POLICY_URL MBEDTLS_OID_NS_CERT "\x08" -#define MBEDTLS_OID_NS_SSL_SERVER_NAME MBEDTLS_OID_NS_CERT "\x0C" -#define MBEDTLS_OID_NS_COMMENT MBEDTLS_OID_NS_CERT "\x0D" -#define MBEDTLS_OID_NS_DATA_TYPE MBEDTLS_OID_NETSCAPE "\x02" -#define MBEDTLS_OID_NS_CERT_SEQUENCE MBEDTLS_OID_NS_DATA_TYPE "\x05" - -/* - * OIDs for CRL extensions - */ -#define MBEDTLS_OID_PRIVATE_KEY_USAGE_PERIOD MBEDTLS_OID_ID_CE "\x10" -#define MBEDTLS_OID_CRL_NUMBER MBEDTLS_OID_ID_CE "\x14" /**< id-ce-cRLNumber OBJECT IDENTIFIER ::= { id-ce 20 } */ - -/* - * X.509 v3 Extended key usage OIDs - */ -#define MBEDTLS_OID_ANY_EXTENDED_KEY_USAGE MBEDTLS_OID_EXTENDED_KEY_USAGE "\x00" /**< anyExtendedKeyUsage OBJECT IDENTIFIER ::= { id-ce-extKeyUsage 0 } */ - -#define MBEDTLS_OID_KP MBEDTLS_OID_PKIX "\x03" /**< id-kp OBJECT IDENTIFIER ::= { id-pkix 3 } */ -#define MBEDTLS_OID_SERVER_AUTH MBEDTLS_OID_KP "\x01" /**< id-kp-serverAuth OBJECT IDENTIFIER ::= { id-kp 1 } */ -#define MBEDTLS_OID_CLIENT_AUTH MBEDTLS_OID_KP "\x02" /**< id-kp-clientAuth OBJECT IDENTIFIER ::= { id-kp 2 } */ -#define MBEDTLS_OID_CODE_SIGNING MBEDTLS_OID_KP "\x03" /**< id-kp-codeSigning OBJECT IDENTIFIER ::= { id-kp 3 } */ -#define MBEDTLS_OID_EMAIL_PROTECTION MBEDTLS_OID_KP "\x04" /**< id-kp-emailProtection OBJECT IDENTIFIER ::= { id-kp 4 } */ -#define MBEDTLS_OID_TIME_STAMPING MBEDTLS_OID_KP "\x08" /**< id-kp-timeStamping OBJECT IDENTIFIER ::= { id-kp 8 } */ -#define MBEDTLS_OID_OCSP_SIGNING MBEDTLS_OID_KP "\x09" /**< id-kp-OCSPSigning OBJECT IDENTIFIER ::= { id-kp 9 } */ - -/* - * PKCS definition OIDs - */ - -#define MBEDTLS_OID_PKCS MBEDTLS_OID_RSA_COMPANY "\x01" /**< pkcs OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) 1 } */ -#define MBEDTLS_OID_PKCS1 MBEDTLS_OID_PKCS "\x01" /**< pkcs-1 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 1 } */ -#define MBEDTLS_OID_PKCS5 MBEDTLS_OID_PKCS "\x05" /**< pkcs-5 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 5 } */ -#define MBEDTLS_OID_PKCS9 MBEDTLS_OID_PKCS "\x09" /**< pkcs-9 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 9 } */ -#define MBEDTLS_OID_PKCS12 MBEDTLS_OID_PKCS "\x0c" /**< pkcs-12 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 12 } */ - -/* - * PKCS#1 OIDs - */ -#define MBEDTLS_OID_PKCS1_RSA MBEDTLS_OID_PKCS1 "\x01" /**< rsaEncryption OBJECT IDENTIFIER ::= { pkcs-1 1 } */ -#define MBEDTLS_OID_PKCS1_MD2 MBEDTLS_OID_PKCS1 "\x02" /**< md2WithRSAEncryption ::= { pkcs-1 2 } */ -#define MBEDTLS_OID_PKCS1_MD4 MBEDTLS_OID_PKCS1 "\x03" /**< md4WithRSAEncryption ::= { pkcs-1 3 } */ -#define MBEDTLS_OID_PKCS1_MD5 MBEDTLS_OID_PKCS1 "\x04" /**< md5WithRSAEncryption ::= { pkcs-1 4 } */ -#define MBEDTLS_OID_PKCS1_SHA1 MBEDTLS_OID_PKCS1 "\x05" /**< sha1WithRSAEncryption ::= { pkcs-1 5 } */ -#define MBEDTLS_OID_PKCS1_SHA224 MBEDTLS_OID_PKCS1 "\x0e" /**< sha224WithRSAEncryption ::= { pkcs-1 14 } */ -#define MBEDTLS_OID_PKCS1_SHA256 MBEDTLS_OID_PKCS1 "\x0b" /**< sha256WithRSAEncryption ::= { pkcs-1 11 } */ -#define MBEDTLS_OID_PKCS1_SHA384 MBEDTLS_OID_PKCS1 "\x0c" /**< sha384WithRSAEncryption ::= { pkcs-1 12 } */ -#define MBEDTLS_OID_PKCS1_SHA512 MBEDTLS_OID_PKCS1 "\x0d" /**< sha512WithRSAEncryption ::= { pkcs-1 13 } */ - -#define MBEDTLS_OID_RSA_SHA_OBS "\x2B\x0E\x03\x02\x1D" - -#define MBEDTLS_OID_PKCS9_EMAIL MBEDTLS_OID_PKCS9 "\x01" /**< emailAddress AttributeType ::= { pkcs-9 1 } */ - -/* RFC 4055 */ -#define MBEDTLS_OID_RSASSA_PSS MBEDTLS_OID_PKCS1 "\x0a" /**< id-RSASSA-PSS ::= { pkcs-1 10 } */ -#define MBEDTLS_OID_MGF1 MBEDTLS_OID_PKCS1 "\x08" /**< id-mgf1 ::= { pkcs-1 8 } */ - -/* - * Digest algorithms - */ -#define MBEDTLS_OID_DIGEST_ALG_MD2 MBEDTLS_OID_RSA_COMPANY "\x02\x02" /**< id-mbedtls_md2 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 2 } */ -#define MBEDTLS_OID_DIGEST_ALG_MD4 MBEDTLS_OID_RSA_COMPANY "\x02\x04" /**< id-mbedtls_md4 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 4 } */ -#define MBEDTLS_OID_DIGEST_ALG_MD5 MBEDTLS_OID_RSA_COMPANY "\x02\x05" /**< id-mbedtls_md5 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 5 } */ -#define MBEDTLS_OID_DIGEST_ALG_SHA1 MBEDTLS_OID_ISO_IDENTIFIED_ORG MBEDTLS_OID_OIW_SECSIG_SHA1 /**< id-mbedtls_sha1 OBJECT IDENTIFIER ::= { iso(1) identified-organization(3) oiw(14) secsig(3) algorithms(2) 26 } */ -#define MBEDTLS_OID_DIGEST_ALG_SHA224 MBEDTLS_OID_NIST_ALG "\x02\x04" /**< id-sha224 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistalgorithm(4) hashalgs(2) 4 } */ -#define MBEDTLS_OID_DIGEST_ALG_SHA256 MBEDTLS_OID_NIST_ALG "\x02\x01" /**< id-mbedtls_sha256 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistalgorithm(4) hashalgs(2) 1 } */ - -#define MBEDTLS_OID_DIGEST_ALG_SHA384 MBEDTLS_OID_NIST_ALG "\x02\x02" /**< id-sha384 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistalgorithm(4) hashalgs(2) 2 } */ - -#define MBEDTLS_OID_DIGEST_ALG_SHA512 MBEDTLS_OID_NIST_ALG "\x02\x03" /**< id-mbedtls_sha512 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistalgorithm(4) hashalgs(2) 3 } */ - -#define MBEDTLS_OID_HMAC_SHA1 MBEDTLS_OID_RSA_COMPANY "\x02\x07" /**< id-hmacWithSHA1 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 7 } */ - -#define MBEDTLS_OID_HMAC_SHA224 MBEDTLS_OID_RSA_COMPANY "\x02\x08" /**< id-hmacWithSHA224 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 8 } */ - -#define MBEDTLS_OID_HMAC_SHA256 MBEDTLS_OID_RSA_COMPANY "\x02\x09" /**< id-hmacWithSHA256 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 9 } */ - -#define MBEDTLS_OID_HMAC_SHA384 MBEDTLS_OID_RSA_COMPANY "\x02\x0A" /**< id-hmacWithSHA384 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 10 } */ - -#define MBEDTLS_OID_HMAC_SHA512 MBEDTLS_OID_RSA_COMPANY "\x02\x0B" /**< id-hmacWithSHA512 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 11 } */ - -/* - * Encryption algorithms - */ -#define MBEDTLS_OID_DES_CBC MBEDTLS_OID_ISO_IDENTIFIED_ORG MBEDTLS_OID_OIW_SECSIG_ALG "\x07" /**< desCBC OBJECT IDENTIFIER ::= { iso(1) identified-organization(3) oiw(14) secsig(3) algorithms(2) 7 } */ -#define MBEDTLS_OID_DES_EDE3_CBC MBEDTLS_OID_RSA_COMPANY "\x03\x07" /**< des-ede3-cbc OBJECT IDENTIFIER ::= { iso(1) member-body(2) -- us(840) rsadsi(113549) encryptionAlgorithm(3) 7 } */ -#define MBEDTLS_OID_AES MBEDTLS_OID_NIST_ALG "\x01" /** aes OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistAlgorithm(4) 1 } */ - -/* - * Key Wrapping algorithms - */ -/* - * RFC 5649 - */ -#define MBEDTLS_OID_AES128_KW MBEDTLS_OID_AES "\x05" /** id-aes128-wrap OBJECT IDENTIFIER ::= { aes 5 } */ -#define MBEDTLS_OID_AES128_KWP MBEDTLS_OID_AES "\x08" /** id-aes128-wrap-pad OBJECT IDENTIFIER ::= { aes 8 } */ -#define MBEDTLS_OID_AES192_KW MBEDTLS_OID_AES "\x19" /** id-aes192-wrap OBJECT IDENTIFIER ::= { aes 25 } */ -#define MBEDTLS_OID_AES192_KWP MBEDTLS_OID_AES "\x1c" /** id-aes192-wrap-pad OBJECT IDENTIFIER ::= { aes 28 } */ -#define MBEDTLS_OID_AES256_KW MBEDTLS_OID_AES "\x2d" /** id-aes256-wrap OBJECT IDENTIFIER ::= { aes 45 } */ -#define MBEDTLS_OID_AES256_KWP MBEDTLS_OID_AES "\x30" /** id-aes256-wrap-pad OBJECT IDENTIFIER ::= { aes 48 } */ -/* - * PKCS#5 OIDs - */ -#define MBEDTLS_OID_PKCS5_PBKDF2 MBEDTLS_OID_PKCS5 "\x0c" /**< id-PBKDF2 OBJECT IDENTIFIER ::= {pkcs-5 12} */ -#define MBEDTLS_OID_PKCS5_PBES2 MBEDTLS_OID_PKCS5 "\x0d" /**< id-PBES2 OBJECT IDENTIFIER ::= {pkcs-5 13} */ -#define MBEDTLS_OID_PKCS5_PBMAC1 MBEDTLS_OID_PKCS5 "\x0e" /**< id-PBMAC1 OBJECT IDENTIFIER ::= {pkcs-5 14} */ - -/* - * PKCS#5 PBES1 algorithms - */ -#define MBEDTLS_OID_PKCS5_PBE_MD2_DES_CBC MBEDTLS_OID_PKCS5 "\x01" /**< pbeWithMD2AndDES-CBC OBJECT IDENTIFIER ::= {pkcs-5 1} */ -#define MBEDTLS_OID_PKCS5_PBE_MD2_RC2_CBC MBEDTLS_OID_PKCS5 "\x04" /**< pbeWithMD2AndRC2-CBC OBJECT IDENTIFIER ::= {pkcs-5 4} */ -#define MBEDTLS_OID_PKCS5_PBE_MD5_DES_CBC MBEDTLS_OID_PKCS5 "\x03" /**< pbeWithMD5AndDES-CBC OBJECT IDENTIFIER ::= {pkcs-5 3} */ -#define MBEDTLS_OID_PKCS5_PBE_MD5_RC2_CBC MBEDTLS_OID_PKCS5 "\x06" /**< pbeWithMD5AndRC2-CBC OBJECT IDENTIFIER ::= {pkcs-5 6} */ -#define MBEDTLS_OID_PKCS5_PBE_SHA1_DES_CBC MBEDTLS_OID_PKCS5 "\x0a" /**< pbeWithSHA1AndDES-CBC OBJECT IDENTIFIER ::= {pkcs-5 10} */ -#define MBEDTLS_OID_PKCS5_PBE_SHA1_RC2_CBC MBEDTLS_OID_PKCS5 "\x0b" /**< pbeWithSHA1AndRC2-CBC OBJECT IDENTIFIER ::= {pkcs-5 11} */ - -/* - * PKCS#8 OIDs - */ -#define MBEDTLS_OID_PKCS9_CSR_EXT_REQ MBEDTLS_OID_PKCS9 "\x0e" /**< extensionRequest OBJECT IDENTIFIER ::= {pkcs-9 14} */ - -/* - * PKCS#12 PBE OIDs - */ -#define MBEDTLS_OID_PKCS12_PBE MBEDTLS_OID_PKCS12 "\x01" /**< pkcs-12PbeIds OBJECT IDENTIFIER ::= {pkcs-12 1} */ - -#define MBEDTLS_OID_PKCS12_PBE_SHA1_RC4_128 MBEDTLS_OID_PKCS12_PBE "\x01" /**< pbeWithSHAAnd128BitRC4 OBJECT IDENTIFIER ::= {pkcs-12PbeIds 1} */ -#define MBEDTLS_OID_PKCS12_PBE_SHA1_RC4_40 MBEDTLS_OID_PKCS12_PBE "\x02" /**< pbeWithSHAAnd40BitRC4 OBJECT IDENTIFIER ::= {pkcs-12PbeIds 2} */ -#define MBEDTLS_OID_PKCS12_PBE_SHA1_DES3_EDE_CBC MBEDTLS_OID_PKCS12_PBE "\x03" /**< pbeWithSHAAnd3-KeyTripleDES-CBC OBJECT IDENTIFIER ::= {pkcs-12PbeIds 3} */ -#define MBEDTLS_OID_PKCS12_PBE_SHA1_DES2_EDE_CBC MBEDTLS_OID_PKCS12_PBE "\x04" /**< pbeWithSHAAnd2-KeyTripleDES-CBC OBJECT IDENTIFIER ::= {pkcs-12PbeIds 4} */ -#define MBEDTLS_OID_PKCS12_PBE_SHA1_RC2_128_CBC MBEDTLS_OID_PKCS12_PBE "\x05" /**< pbeWithSHAAnd128BitRC2-CBC OBJECT IDENTIFIER ::= {pkcs-12PbeIds 5} */ -#define MBEDTLS_OID_PKCS12_PBE_SHA1_RC2_40_CBC MBEDTLS_OID_PKCS12_PBE "\x06" /**< pbeWithSHAAnd40BitRC2-CBC OBJECT IDENTIFIER ::= {pkcs-12PbeIds 6} */ - -/* - * EC key algorithms from RFC 5480 - */ - -/* id-ecPublicKey OBJECT IDENTIFIER ::= { - * iso(1) member-body(2) us(840) ansi-X9-62(10045) keyType(2) 1 } */ -#define MBEDTLS_OID_EC_ALG_UNRESTRICTED MBEDTLS_OID_ANSI_X9_62 "\x02\01" - -/* id-ecDH OBJECT IDENTIFIER ::= { - * iso(1) identified-organization(3) certicom(132) - * schemes(1) ecdh(12) } */ -#define MBEDTLS_OID_EC_ALG_ECDH MBEDTLS_OID_CERTICOM "\x01\x0c" - -/* - * ECParameters namedCurve identifiers, from RFC 5480, RFC 5639, and SEC2 - */ - -/* secp192r1 OBJECT IDENTIFIER ::= { - * iso(1) member-body(2) us(840) ansi-X9-62(10045) curves(3) prime(1) 1 } */ -#define MBEDTLS_OID_EC_GRP_SECP192R1 MBEDTLS_OID_ANSI_X9_62 "\x03\x01\x01" - -/* secp224r1 OBJECT IDENTIFIER ::= { - * iso(1) identified-organization(3) certicom(132) curve(0) 33 } */ -#define MBEDTLS_OID_EC_GRP_SECP224R1 MBEDTLS_OID_CERTICOM "\x00\x21" - -/* secp256r1 OBJECT IDENTIFIER ::= { - * iso(1) member-body(2) us(840) ansi-X9-62(10045) curves(3) prime(1) 7 } */ -#define MBEDTLS_OID_EC_GRP_SECP256R1 MBEDTLS_OID_ANSI_X9_62 "\x03\x01\x07" - -/* secp384r1 OBJECT IDENTIFIER ::= { - * iso(1) identified-organization(3) certicom(132) curve(0) 34 } */ -#define MBEDTLS_OID_EC_GRP_SECP384R1 MBEDTLS_OID_CERTICOM "\x00\x22" - -/* secp521r1 OBJECT IDENTIFIER ::= { - * iso(1) identified-organization(3) certicom(132) curve(0) 35 } */ -#define MBEDTLS_OID_EC_GRP_SECP521R1 MBEDTLS_OID_CERTICOM "\x00\x23" - -/* secp192k1 OBJECT IDENTIFIER ::= { - * iso(1) identified-organization(3) certicom(132) curve(0) 31 } */ -#define MBEDTLS_OID_EC_GRP_SECP192K1 MBEDTLS_OID_CERTICOM "\x00\x1f" - -/* secp224k1 OBJECT IDENTIFIER ::= { - * iso(1) identified-organization(3) certicom(132) curve(0) 32 } */ -#define MBEDTLS_OID_EC_GRP_SECP224K1 MBEDTLS_OID_CERTICOM "\x00\x20" - -/* secp256k1 OBJECT IDENTIFIER ::= { - * iso(1) identified-organization(3) certicom(132) curve(0) 10 } */ -#define MBEDTLS_OID_EC_GRP_SECP256K1 MBEDTLS_OID_CERTICOM "\x00\x0a" - -/* RFC 5639 4.1 - * ecStdCurvesAndGeneration OBJECT IDENTIFIER::= {iso(1) - * identified-organization(3) teletrust(36) algorithm(3) signature- - * algorithm(3) ecSign(2) 8} - * ellipticCurve OBJECT IDENTIFIER ::= {ecStdCurvesAndGeneration 1} - * versionOne OBJECT IDENTIFIER ::= {ellipticCurve 1} */ -#define MBEDTLS_OID_EC_BRAINPOOL_V1 MBEDTLS_OID_TELETRUST "\x03\x03\x02\x08\x01\x01" - -/* brainpoolP256r1 OBJECT IDENTIFIER ::= {versionOne 7} */ -#define MBEDTLS_OID_EC_GRP_BP256R1 MBEDTLS_OID_EC_BRAINPOOL_V1 "\x07" - -/* brainpoolP384r1 OBJECT IDENTIFIER ::= {versionOne 11} */ -#define MBEDTLS_OID_EC_GRP_BP384R1 MBEDTLS_OID_EC_BRAINPOOL_V1 "\x0B" - -/* brainpoolP512r1 OBJECT IDENTIFIER ::= {versionOne 13} */ -#define MBEDTLS_OID_EC_GRP_BP512R1 MBEDTLS_OID_EC_BRAINPOOL_V1 "\x0D" - -/* - * SEC1 C.1 - * - * prime-field OBJECT IDENTIFIER ::= { id-fieldType 1 } - * id-fieldType OBJECT IDENTIFIER ::= { ansi-X9-62 fieldType(1)} - */ -#define MBEDTLS_OID_ANSI_X9_62_FIELD_TYPE MBEDTLS_OID_ANSI_X9_62 "\x01" -#define MBEDTLS_OID_ANSI_X9_62_PRIME_FIELD MBEDTLS_OID_ANSI_X9_62_FIELD_TYPE "\x01" - -/* - * ECDSA signature identifiers, from RFC 5480 - */ -#define MBEDTLS_OID_ANSI_X9_62_SIG MBEDTLS_OID_ANSI_X9_62 "\x04" /* signatures(4) */ -#define MBEDTLS_OID_ANSI_X9_62_SIG_SHA2 MBEDTLS_OID_ANSI_X9_62_SIG "\x03" /* ecdsa-with-SHA2(3) */ - -/* ecdsa-with-SHA1 OBJECT IDENTIFIER ::= { - * iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4) 1 } */ -#define MBEDTLS_OID_ECDSA_SHA1 MBEDTLS_OID_ANSI_X9_62_SIG "\x01" - -/* ecdsa-with-SHA224 OBJECT IDENTIFIER ::= { - * iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4) - * ecdsa-with-SHA2(3) 1 } */ -#define MBEDTLS_OID_ECDSA_SHA224 MBEDTLS_OID_ANSI_X9_62_SIG_SHA2 "\x01" - -/* ecdsa-with-SHA256 OBJECT IDENTIFIER ::= { - * iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4) - * ecdsa-with-SHA2(3) 2 } */ -#define MBEDTLS_OID_ECDSA_SHA256 MBEDTLS_OID_ANSI_X9_62_SIG_SHA2 "\x02" - -/* ecdsa-with-SHA384 OBJECT IDENTIFIER ::= { - * iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4) - * ecdsa-with-SHA2(3) 3 } */ -#define MBEDTLS_OID_ECDSA_SHA384 MBEDTLS_OID_ANSI_X9_62_SIG_SHA2 "\x03" - -/* ecdsa-with-SHA512 OBJECT IDENTIFIER ::= { - * iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4) - * ecdsa-with-SHA2(3) 4 } */ -#define MBEDTLS_OID_ECDSA_SHA512 MBEDTLS_OID_ANSI_X9_62_SIG_SHA2 "\x04" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Base OID descriptor structure - */ -typedef struct mbedtls_oid_descriptor_t -{ - const char *asn1; /*!< OID ASN.1 representation */ - size_t asn1_len; /*!< length of asn1 */ - const char *name; /*!< official name (e.g. from RFC) */ - const char *description; /*!< human friendly description */ -} mbedtls_oid_descriptor_t; - -/** - * \brief Translate an ASN.1 OID into its numeric representation - * (e.g. "\x2A\x86\x48\x86\xF7\x0D" into "1.2.840.113549") - * - * \param buf buffer to put representation in - * \param size size of the buffer - * \param oid OID to translate - * - * \return Length of the string written (excluding final NULL) or - * MBEDTLS_ERR_OID_BUF_TOO_SMALL in case of error - */ -int mbedtls_oid_get_numeric_string( char *buf, size_t size, const mbedtls_asn1_buf *oid ); - -#if defined(MBEDTLS_X509_USE_C) || defined(MBEDTLS_X509_CREATE_C) -/** - * \brief Translate an X.509 extension OID into local values - * - * \param oid OID to use - * \param ext_type place to store the extension type - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_x509_ext_type( const mbedtls_asn1_buf *oid, int *ext_type ); -#endif - -/** - * \brief Translate an X.509 attribute type OID into the short name - * (e.g. the OID for an X520 Common Name into "CN") - * - * \param oid OID to use - * \param short_name place to store the string pointer - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_attr_short_name( const mbedtls_asn1_buf *oid, const char **short_name ); - -/** - * \brief Translate PublicKeyAlgorithm OID into pk_type - * - * \param oid OID to use - * \param pk_alg place to store public key algorithm - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_pk_alg( const mbedtls_asn1_buf *oid, mbedtls_pk_type_t *pk_alg ); - -/** - * \brief Translate pk_type into PublicKeyAlgorithm OID - * - * \param pk_alg Public key type to look for - * \param oid place to store ASN.1 OID string pointer - * \param olen length of the OID - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_oid_by_pk_alg( mbedtls_pk_type_t pk_alg, - const char **oid, size_t *olen ); - -#if defined(MBEDTLS_ECP_C) -/** - * \brief Translate NamedCurve OID into an EC group identifier - * - * \param oid OID to use - * \param grp_id place to store group id - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_ec_grp( const mbedtls_asn1_buf *oid, mbedtls_ecp_group_id *grp_id ); - -/** - * \brief Translate EC group identifier into NamedCurve OID - * - * \param grp_id EC group identifier - * \param oid place to store ASN.1 OID string pointer - * \param olen length of the OID - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_oid_by_ec_grp( mbedtls_ecp_group_id grp_id, - const char **oid, size_t *olen ); -#endif /* MBEDTLS_ECP_C */ - -#if defined(MBEDTLS_MD_C) -/** - * \brief Translate SignatureAlgorithm OID into md_type and pk_type - * - * \param oid OID to use - * \param md_alg place to store message digest algorithm - * \param pk_alg place to store public key algorithm - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_sig_alg( const mbedtls_asn1_buf *oid, - mbedtls_md_type_t *md_alg, mbedtls_pk_type_t *pk_alg ); - -/** - * \brief Translate SignatureAlgorithm OID into description - * - * \param oid OID to use - * \param desc place to store string pointer - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_sig_alg_desc( const mbedtls_asn1_buf *oid, const char **desc ); - -/** - * \brief Translate md_type and pk_type into SignatureAlgorithm OID - * - * \param md_alg message digest algorithm - * \param pk_alg public key algorithm - * \param oid place to store ASN.1 OID string pointer - * \param olen length of the OID - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_oid_by_sig_alg( mbedtls_pk_type_t pk_alg, mbedtls_md_type_t md_alg, - const char **oid, size_t *olen ); - -/** - * \brief Translate hash algorithm OID into md_type - * - * \param oid OID to use - * \param md_alg place to store message digest algorithm - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_md_alg( const mbedtls_asn1_buf *oid, mbedtls_md_type_t *md_alg ); - -/** - * \brief Translate hmac algorithm OID into md_type - * - * \param oid OID to use - * \param md_hmac place to store message hmac algorithm - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_md_hmac( const mbedtls_asn1_buf *oid, mbedtls_md_type_t *md_hmac ); -#endif /* MBEDTLS_MD_C */ - -/** - * \brief Translate Extended Key Usage OID into description - * - * \param oid OID to use - * \param desc place to store string pointer - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_extended_key_usage( const mbedtls_asn1_buf *oid, const char **desc ); - -/** - * \brief Translate md_type into hash algorithm OID - * - * \param md_alg message digest algorithm - * \param oid place to store ASN.1 OID string pointer - * \param olen length of the OID - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_oid_by_md( mbedtls_md_type_t md_alg, const char **oid, size_t *olen ); - -#if defined(MBEDTLS_CIPHER_C) -/** - * \brief Translate encryption algorithm OID into cipher_type - * - * \param oid OID to use - * \param cipher_alg place to store cipher algorithm - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_cipher_alg( const mbedtls_asn1_buf *oid, mbedtls_cipher_type_t *cipher_alg ); -#endif /* MBEDTLS_CIPHER_C */ - -#if defined(MBEDTLS_PKCS12_C) -/** - * \brief Translate PKCS#12 PBE algorithm OID into md_type and - * cipher_type - * - * \param oid OID to use - * \param md_alg place to store message digest algorithm - * \param cipher_alg place to store cipher algorithm - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_pkcs12_pbe_alg( const mbedtls_asn1_buf *oid, mbedtls_md_type_t *md_alg, - mbedtls_cipher_type_t *cipher_alg ); -#endif /* MBEDTLS_PKCS12_C */ - -#ifdef __cplusplus -} -#endif - -#endif /* oid.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/padlock.h b/tools/sdk/include/mbedtls/mbedtls/padlock.h deleted file mode 100644 index 677936ebf86..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/padlock.h +++ /dev/null @@ -1,108 +0,0 @@ -/** - * \file padlock.h - * - * \brief VIA PadLock ACE for HW encryption/decryption supported by some - * processors - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_PADLOCK_H -#define MBEDTLS_PADLOCK_H - -#include "aes.h" - -#define MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED -0x0030 /**< Input data should be aligned. */ - -#if defined(__has_feature) -#if __has_feature(address_sanitizer) -#define MBEDTLS_HAVE_ASAN -#endif -#endif - -/* Some versions of ASan result in errors about not enough registers */ -#if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && defined(__i386__) && \ - !defined(MBEDTLS_HAVE_ASAN) - -#ifndef MBEDTLS_HAVE_X86 -#define MBEDTLS_HAVE_X86 -#endif - -#include - -#define MBEDTLS_PADLOCK_RNG 0x000C -#define MBEDTLS_PADLOCK_ACE 0x00C0 -#define MBEDTLS_PADLOCK_PHE 0x0C00 -#define MBEDTLS_PADLOCK_PMM 0x3000 - -#define MBEDTLS_PADLOCK_ALIGN16(x) (uint32_t *) (16 + ((int32_t) x & ~15)) - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief PadLock detection routine - * - * \param feature The feature to detect - * - * \return 1 if CPU has support for the feature, 0 otherwise - */ -int mbedtls_padlock_has_support( int feature ); - -/** - * \brief PadLock AES-ECB block en(de)cryption - * - * \param ctx AES context - * \param mode MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT - * \param input 16-byte input block - * \param output 16-byte output block - * - * \return 0 if success, 1 if operation failed - */ -int mbedtls_padlock_xcryptecb( mbedtls_aes_context *ctx, - int mode, - const unsigned char input[16], - unsigned char output[16] ); - -/** - * \brief PadLock AES-CBC buffer en(de)cryption - * - * \param ctx AES context - * \param mode MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT - * \param length length of the input data - * \param iv initialization vector (updated after use) - * \param input buffer holding the input data - * \param output buffer holding the output data - * - * \return 0 if success, 1 if operation failed - */ -int mbedtls_padlock_xcryptcbc( mbedtls_aes_context *ctx, - int mode, - size_t length, - unsigned char iv[16], - const unsigned char *input, - unsigned char *output ); - -#ifdef __cplusplus -} -#endif - -#endif /* HAVE_X86 */ - -#endif /* padlock.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/pem.h b/tools/sdk/include/mbedtls/mbedtls/pem.h deleted file mode 100644 index fa82f7bdbd8..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/pem.h +++ /dev/null @@ -1,130 +0,0 @@ -/** - * \file pem.h - * - * \brief Privacy Enhanced Mail (PEM) decoding - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_PEM_H -#define MBEDTLS_PEM_H - -#include - -/** - * \name PEM Error codes - * These error codes are returned in case of errors reading the - * PEM data. - * \{ - */ -#define MBEDTLS_ERR_PEM_NO_HEADER_FOOTER_PRESENT -0x1080 /**< No PEM header or footer found. */ -#define MBEDTLS_ERR_PEM_INVALID_DATA -0x1100 /**< PEM string is not as expected. */ -#define MBEDTLS_ERR_PEM_ALLOC_FAILED -0x1180 /**< Failed to allocate memory. */ -#define MBEDTLS_ERR_PEM_INVALID_ENC_IV -0x1200 /**< RSA IV is not in hex-format. */ -#define MBEDTLS_ERR_PEM_UNKNOWN_ENC_ALG -0x1280 /**< Unsupported key encryption algorithm. */ -#define MBEDTLS_ERR_PEM_PASSWORD_REQUIRED -0x1300 /**< Private key password can't be empty. */ -#define MBEDTLS_ERR_PEM_PASSWORD_MISMATCH -0x1380 /**< Given private key password does not allow for correct decryption. */ -#define MBEDTLS_ERR_PEM_FEATURE_UNAVAILABLE -0x1400 /**< Unavailable feature, e.g. hashing/encryption combination. */ -#define MBEDTLS_ERR_PEM_BAD_INPUT_DATA -0x1480 /**< Bad input parameters to function. */ -/* \} name */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(MBEDTLS_PEM_PARSE_C) -/** - * \brief PEM context structure - */ -typedef struct mbedtls_pem_context -{ - unsigned char *buf; /*!< buffer for decoded data */ - size_t buflen; /*!< length of the buffer */ - unsigned char *info; /*!< buffer for extra header information */ -} -mbedtls_pem_context; - -/** - * \brief PEM context setup - * - * \param ctx context to be initialized - */ -void mbedtls_pem_init( mbedtls_pem_context *ctx ); - -/** - * \brief Read a buffer for PEM information and store the resulting - * data into the specified context buffers. - * - * \param ctx context to use - * \param header header string to seek and expect - * \param footer footer string to seek and expect - * \param data source data to look in (must be nul-terminated) - * \param pwd password for decryption (can be NULL) - * \param pwdlen length of password - * \param use_len destination for total length used (set after header is - * correctly read, so unless you get - * MBEDTLS_ERR_PEM_BAD_INPUT_DATA or - * MBEDTLS_ERR_PEM_NO_HEADER_FOOTER_PRESENT, use_len is - * the length to skip) - * - * \note Attempts to check password correctness by verifying if - * the decrypted text starts with an ASN.1 sequence of - * appropriate length - * - * \return 0 on success, or a specific PEM error code - */ -int mbedtls_pem_read_buffer( mbedtls_pem_context *ctx, const char *header, const char *footer, - const unsigned char *data, - const unsigned char *pwd, - size_t pwdlen, size_t *use_len ); - -/** - * \brief PEM context memory freeing - * - * \param ctx context to be freed - */ -void mbedtls_pem_free( mbedtls_pem_context *ctx ); -#endif /* MBEDTLS_PEM_PARSE_C */ - -#if defined(MBEDTLS_PEM_WRITE_C) -/** - * \brief Write a buffer of PEM information from a DER encoded - * buffer. - * - * \param header header string to write - * \param footer footer string to write - * \param der_data DER data to write - * \param der_len length of the DER data - * \param buf buffer to write to - * \param buf_len length of output buffer - * \param olen total length written / required (if buf_len is not enough) - * - * \return 0 on success, or a specific PEM or BASE64 error code. On - * MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL olen is the required - * size. - */ -int mbedtls_pem_write_buffer( const char *header, const char *footer, - const unsigned char *der_data, size_t der_len, - unsigned char *buf, size_t buf_len, size_t *olen ); -#endif /* MBEDTLS_PEM_WRITE_C */ - -#ifdef __cplusplus -} -#endif - -#endif /* pem.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/pk.h b/tools/sdk/include/mbedtls/mbedtls/pk.h deleted file mode 100644 index db54c6a6ef5..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/pk.h +++ /dev/null @@ -1,618 +0,0 @@ -/** - * \file pk.h - * - * \brief Public Key abstraction layer - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_PK_H -#define MBEDTLS_PK_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "md.h" - -#if defined(MBEDTLS_RSA_C) -#include "rsa.h" -#endif - -#if defined(MBEDTLS_ECP_C) -#include "ecp.h" -#endif - -#if defined(MBEDTLS_ECDSA_C) -#include "ecdsa.h" -#endif - -#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ - !defined(inline) && !defined(__cplusplus) -#define inline __inline -#endif - -#define MBEDTLS_ERR_PK_ALLOC_FAILED -0x3F80 /**< Memory allocation failed. */ -#define MBEDTLS_ERR_PK_TYPE_MISMATCH -0x3F00 /**< Type mismatch, eg attempt to encrypt with an ECDSA key */ -#define MBEDTLS_ERR_PK_BAD_INPUT_DATA -0x3E80 /**< Bad input parameters to function. */ -#define MBEDTLS_ERR_PK_FILE_IO_ERROR -0x3E00 /**< Read/write of file failed. */ -#define MBEDTLS_ERR_PK_KEY_INVALID_VERSION -0x3D80 /**< Unsupported key version */ -#define MBEDTLS_ERR_PK_KEY_INVALID_FORMAT -0x3D00 /**< Invalid key tag or value. */ -#define MBEDTLS_ERR_PK_UNKNOWN_PK_ALG -0x3C80 /**< Key algorithm is unsupported (only RSA and EC are supported). */ -#define MBEDTLS_ERR_PK_PASSWORD_REQUIRED -0x3C00 /**< Private key password can't be empty. */ -#define MBEDTLS_ERR_PK_PASSWORD_MISMATCH -0x3B80 /**< Given private key password does not allow for correct decryption. */ -#define MBEDTLS_ERR_PK_INVALID_PUBKEY -0x3B00 /**< The pubkey tag or value is invalid (only RSA and EC are supported). */ -#define MBEDTLS_ERR_PK_INVALID_ALG -0x3A80 /**< The algorithm tag or value is invalid. */ -#define MBEDTLS_ERR_PK_UNKNOWN_NAMED_CURVE -0x3A00 /**< Elliptic curve is unsupported (only NIST curves are supported). */ -#define MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE -0x3980 /**< Unavailable feature, e.g. RSA disabled for RSA key. */ -#define MBEDTLS_ERR_PK_SIG_LEN_MISMATCH -0x3900 /**< The buffer contains a valid signature followed by more data. */ -#define MBEDTLS_ERR_PK_HW_ACCEL_FAILED -0x3880 /**< PK hardware accelerator failed. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Public key types - */ -typedef enum { - MBEDTLS_PK_NONE=0, - MBEDTLS_PK_RSA, - MBEDTLS_PK_ECKEY, - MBEDTLS_PK_ECKEY_DH, - MBEDTLS_PK_ECDSA, - MBEDTLS_PK_RSA_ALT, - MBEDTLS_PK_RSASSA_PSS, -} mbedtls_pk_type_t; - -/** - * \brief Options for RSASSA-PSS signature verification. - * See \c mbedtls_rsa_rsassa_pss_verify_ext() - */ -typedef struct mbedtls_pk_rsassa_pss_options -{ - mbedtls_md_type_t mgf1_hash_id; - int expected_salt_len; - -} mbedtls_pk_rsassa_pss_options; - -/** - * \brief Types for interfacing with the debug module - */ -typedef enum -{ - MBEDTLS_PK_DEBUG_NONE = 0, - MBEDTLS_PK_DEBUG_MPI, - MBEDTLS_PK_DEBUG_ECP, -} mbedtls_pk_debug_type; - -/** - * \brief Item to send to the debug module - */ -typedef struct mbedtls_pk_debug_item -{ - mbedtls_pk_debug_type type; - const char *name; - void *value; -} mbedtls_pk_debug_item; - -/** Maximum number of item send for debugging, plus 1 */ -#define MBEDTLS_PK_DEBUG_MAX_ITEMS 3 - -/** - * \brief Public key information and operations - */ -typedef struct mbedtls_pk_info_t mbedtls_pk_info_t; - -/** - * \brief Public key container - */ -typedef struct mbedtls_pk_context -{ - const mbedtls_pk_info_t * pk_info; /**< Public key informations */ - void * pk_ctx; /**< Underlying public key context */ -} mbedtls_pk_context; - -#if defined(MBEDTLS_RSA_C) -/** - * Quick access to an RSA context inside a PK context. - * - * \warning You must make sure the PK context actually holds an RSA context - * before using this function! - */ -static inline mbedtls_rsa_context *mbedtls_pk_rsa( const mbedtls_pk_context pk ) -{ - return( (mbedtls_rsa_context *) (pk).pk_ctx ); -} -#endif /* MBEDTLS_RSA_C */ - -#if defined(MBEDTLS_ECP_C) -/** - * Quick access to an EC context inside a PK context. - * - * \warning You must make sure the PK context actually holds an EC context - * before using this function! - */ -static inline mbedtls_ecp_keypair *mbedtls_pk_ec( const mbedtls_pk_context pk ) -{ - return( (mbedtls_ecp_keypair *) (pk).pk_ctx ); -} -#endif /* MBEDTLS_ECP_C */ - -#if defined(MBEDTLS_PK_RSA_ALT_SUPPORT) -/** - * \brief Types for RSA-alt abstraction - */ -typedef int (*mbedtls_pk_rsa_alt_decrypt_func)( void *ctx, int mode, size_t *olen, - const unsigned char *input, unsigned char *output, - size_t output_max_len ); -typedef int (*mbedtls_pk_rsa_alt_sign_func)( void *ctx, - int (*f_rng)(void *, unsigned char *, size_t), void *p_rng, - int mode, mbedtls_md_type_t md_alg, unsigned int hashlen, - const unsigned char *hash, unsigned char *sig ); -typedef size_t (*mbedtls_pk_rsa_alt_key_len_func)( void *ctx ); -#endif /* MBEDTLS_PK_RSA_ALT_SUPPORT */ - -/** - * \brief Return information associated with the given PK type - * - * \param pk_type PK type to search for. - * - * \return The PK info associated with the type or NULL if not found. - */ -const mbedtls_pk_info_t *mbedtls_pk_info_from_type( mbedtls_pk_type_t pk_type ); - -/** - * \brief Initialize a mbedtls_pk_context (as NONE) - */ -void mbedtls_pk_init( mbedtls_pk_context *ctx ); - -/** - * \brief Free a mbedtls_pk_context - */ -void mbedtls_pk_free( mbedtls_pk_context *ctx ); - -/** - * \brief Initialize a PK context with the information given - * and allocates the type-specific PK subcontext. - * - * \param ctx Context to initialize. Must be empty (type NONE). - * \param info Information to use - * - * \return 0 on success, - * MBEDTLS_ERR_PK_BAD_INPUT_DATA on invalid input, - * MBEDTLS_ERR_PK_ALLOC_FAILED on allocation failure. - * - * \note For contexts holding an RSA-alt key, use - * \c mbedtls_pk_setup_rsa_alt() instead. - */ -int mbedtls_pk_setup( mbedtls_pk_context *ctx, const mbedtls_pk_info_t *info ); - -#if defined(MBEDTLS_PK_RSA_ALT_SUPPORT) -/** - * \brief Initialize an RSA-alt context - * - * \param ctx Context to initialize. Must be empty (type NONE). - * \param key RSA key pointer - * \param decrypt_func Decryption function - * \param sign_func Signing function - * \param key_len_func Function returning key length in bytes - * - * \return 0 on success, or MBEDTLS_ERR_PK_BAD_INPUT_DATA if the - * context wasn't already initialized as RSA_ALT. - * - * \note This function replaces \c mbedtls_pk_setup() for RSA-alt. - */ -int mbedtls_pk_setup_rsa_alt( mbedtls_pk_context *ctx, void * key, - mbedtls_pk_rsa_alt_decrypt_func decrypt_func, - mbedtls_pk_rsa_alt_sign_func sign_func, - mbedtls_pk_rsa_alt_key_len_func key_len_func ); -#endif /* MBEDTLS_PK_RSA_ALT_SUPPORT */ - -/** - * \brief Get the size in bits of the underlying key - * - * \param ctx Context to use - * - * \return Key size in bits, or 0 on error - */ -size_t mbedtls_pk_get_bitlen( const mbedtls_pk_context *ctx ); - -/** - * \brief Get the length in bytes of the underlying key - * \param ctx Context to use - * - * \return Key length in bytes, or 0 on error - */ -static inline size_t mbedtls_pk_get_len( const mbedtls_pk_context *ctx ) -{ - return( ( mbedtls_pk_get_bitlen( ctx ) + 7 ) / 8 ); -} - -/** - * \brief Tell if a context can do the operation given by type - * - * \param ctx Context to test - * \param type Target type - * - * \return 0 if context can't do the operations, - * 1 otherwise. - */ -int mbedtls_pk_can_do( const mbedtls_pk_context *ctx, mbedtls_pk_type_t type ); - -/** - * \brief Verify signature (including padding if relevant). - * - * \param ctx PK context to use - * \param md_alg Hash algorithm used (see notes) - * \param hash Hash of the message to sign - * \param hash_len Hash length or 0 (see notes) - * \param sig Signature to verify - * \param sig_len Signature length - * - * \return 0 on success (signature is valid), - * #MBEDTLS_ERR_PK_SIG_LEN_MISMATCH if there is a valid - * signature in sig but its length is less than \p siglen, - * or a specific error code. - * - * \note For RSA keys, the default padding type is PKCS#1 v1.5. - * Use \c mbedtls_pk_verify_ext( MBEDTLS_PK_RSASSA_PSS, ... ) - * to verify RSASSA_PSS signatures. - * - * \note If hash_len is 0, then the length associated with md_alg - * is used instead, or an error returned if it is invalid. - * - * \note md_alg may be MBEDTLS_MD_NONE, only if hash_len != 0 - */ -int mbedtls_pk_verify( mbedtls_pk_context *ctx, mbedtls_md_type_t md_alg, - const unsigned char *hash, size_t hash_len, - const unsigned char *sig, size_t sig_len ); - -/** - * \brief Verify signature, with options. - * (Includes verification of the padding depending on type.) - * - * \param type Signature type (inc. possible padding type) to verify - * \param options Pointer to type-specific options, or NULL - * \param ctx PK context to use - * \param md_alg Hash algorithm used (see notes) - * \param hash Hash of the message to sign - * \param hash_len Hash length or 0 (see notes) - * \param sig Signature to verify - * \param sig_len Signature length - * - * \return 0 on success (signature is valid), - * #MBEDTLS_ERR_PK_TYPE_MISMATCH if the PK context can't be - * used for this type of signatures, - * #MBEDTLS_ERR_PK_SIG_LEN_MISMATCH if there is a valid - * signature in sig but its length is less than \p siglen, - * or a specific error code. - * - * \note If hash_len is 0, then the length associated with md_alg - * is used instead, or an error returned if it is invalid. - * - * \note md_alg may be MBEDTLS_MD_NONE, only if hash_len != 0 - * - * \note If type is MBEDTLS_PK_RSASSA_PSS, then options must point - * to a mbedtls_pk_rsassa_pss_options structure, - * otherwise it must be NULL. - */ -int mbedtls_pk_verify_ext( mbedtls_pk_type_t type, const void *options, - mbedtls_pk_context *ctx, mbedtls_md_type_t md_alg, - const unsigned char *hash, size_t hash_len, - const unsigned char *sig, size_t sig_len ); - -/** - * \brief Make signature, including padding if relevant. - * - * \param ctx PK context to use - must hold a private key - * \param md_alg Hash algorithm used (see notes) - * \param hash Hash of the message to sign - * \param hash_len Hash length or 0 (see notes) - * \param sig Place to write the signature - * \param sig_len Number of bytes written - * \param f_rng RNG function - * \param p_rng RNG parameter - * - * \return 0 on success, or a specific error code. - * - * \note For RSA keys, the default padding type is PKCS#1 v1.5. - * There is no interface in the PK module to make RSASSA-PSS - * signatures yet. - * - * \note If hash_len is 0, then the length associated with md_alg - * is used instead, or an error returned if it is invalid. - * - * \note For RSA, md_alg may be MBEDTLS_MD_NONE if hash_len != 0. - * For ECDSA, md_alg may never be MBEDTLS_MD_NONE. - */ -int mbedtls_pk_sign( mbedtls_pk_context *ctx, mbedtls_md_type_t md_alg, - const unsigned char *hash, size_t hash_len, - unsigned char *sig, size_t *sig_len, - int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ); - -/** - * \brief Decrypt message (including padding if relevant). - * - * \param ctx PK context to use - must hold a private key - * \param input Input to decrypt - * \param ilen Input size - * \param output Decrypted output - * \param olen Decrypted message length - * \param osize Size of the output buffer - * \param f_rng RNG function - * \param p_rng RNG parameter - * - * \note For RSA keys, the default padding type is PKCS#1 v1.5. - * - * \return 0 on success, or a specific error code. - */ -int mbedtls_pk_decrypt( mbedtls_pk_context *ctx, - const unsigned char *input, size_t ilen, - unsigned char *output, size_t *olen, size_t osize, - int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ); - -/** - * \brief Encrypt message (including padding if relevant). - * - * \param ctx PK context to use - * \param input Message to encrypt - * \param ilen Message size - * \param output Encrypted output - * \param olen Encrypted output length - * \param osize Size of the output buffer - * \param f_rng RNG function - * \param p_rng RNG parameter - * - * \note For RSA keys, the default padding type is PKCS#1 v1.5. - * - * \return 0 on success, or a specific error code. - */ -int mbedtls_pk_encrypt( mbedtls_pk_context *ctx, - const unsigned char *input, size_t ilen, - unsigned char *output, size_t *olen, size_t osize, - int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ); - -/** - * \brief Check if a public-private pair of keys matches. - * - * \param pub Context holding a public key. - * \param prv Context holding a private (and public) key. - * - * \return 0 on success or MBEDTLS_ERR_PK_BAD_INPUT_DATA - */ -int mbedtls_pk_check_pair( const mbedtls_pk_context *pub, const mbedtls_pk_context *prv ); - -/** - * \brief Export debug information - * - * \param ctx Context to use - * \param items Place to write debug items - * - * \return 0 on success or MBEDTLS_ERR_PK_BAD_INPUT_DATA - */ -int mbedtls_pk_debug( const mbedtls_pk_context *ctx, mbedtls_pk_debug_item *items ); - -/** - * \brief Access the type name - * - * \param ctx Context to use - * - * \return Type name on success, or "invalid PK" - */ -const char * mbedtls_pk_get_name( const mbedtls_pk_context *ctx ); - -/** - * \brief Get the key type - * - * \param ctx Context to use - * - * \return Type on success, or MBEDTLS_PK_NONE - */ -mbedtls_pk_type_t mbedtls_pk_get_type( const mbedtls_pk_context *ctx ); - -#if defined(MBEDTLS_PK_PARSE_C) -/** \ingroup pk_module */ -/** - * \brief Parse a private key in PEM or DER format - * - * \param ctx key to be initialized - * \param key input buffer - * \param keylen size of the buffer - * (including the terminating null byte for PEM data) - * \param pwd password for decryption (optional) - * \param pwdlen size of the password - * - * \note On entry, ctx must be empty, either freshly initialised - * with mbedtls_pk_init() or reset with mbedtls_pk_free(). If you need a - * specific key type, check the result with mbedtls_pk_can_do(). - * - * \note The key is also checked for correctness. - * - * \return 0 if successful, or a specific PK or PEM error code - */ -int mbedtls_pk_parse_key( mbedtls_pk_context *ctx, - const unsigned char *key, size_t keylen, - const unsigned char *pwd, size_t pwdlen ); - -/** \ingroup pk_module */ -/** - * \brief Parse a public key in PEM or DER format - * - * \param ctx key to be initialized - * \param key input buffer - * \param keylen size of the buffer - * (including the terminating null byte for PEM data) - * - * \note On entry, ctx must be empty, either freshly initialised - * with mbedtls_pk_init() or reset with mbedtls_pk_free(). If you need a - * specific key type, check the result with mbedtls_pk_can_do(). - * - * \note The key is also checked for correctness. - * - * \return 0 if successful, or a specific PK or PEM error code - */ -int mbedtls_pk_parse_public_key( mbedtls_pk_context *ctx, - const unsigned char *key, size_t keylen ); - -#if defined(MBEDTLS_FS_IO) -/** \ingroup pk_module */ -/** - * \brief Load and parse a private key - * - * \param ctx key to be initialized - * \param path filename to read the private key from - * \param password password to decrypt the file (can be NULL) - * - * \note On entry, ctx must be empty, either freshly initialised - * with mbedtls_pk_init() or reset with mbedtls_pk_free(). If you need a - * specific key type, check the result with mbedtls_pk_can_do(). - * - * \note The key is also checked for correctness. - * - * \return 0 if successful, or a specific PK or PEM error code - */ -int mbedtls_pk_parse_keyfile( mbedtls_pk_context *ctx, - const char *path, const char *password ); - -/** \ingroup pk_module */ -/** - * \brief Load and parse a public key - * - * \param ctx key to be initialized - * \param path filename to read the public key from - * - * \note On entry, ctx must be empty, either freshly initialised - * with mbedtls_pk_init() or reset with mbedtls_pk_free(). If - * you need a specific key type, check the result with - * mbedtls_pk_can_do(). - * - * \note The key is also checked for correctness. - * - * \return 0 if successful, or a specific PK or PEM error code - */ -int mbedtls_pk_parse_public_keyfile( mbedtls_pk_context *ctx, const char *path ); -#endif /* MBEDTLS_FS_IO */ -#endif /* MBEDTLS_PK_PARSE_C */ - -#if defined(MBEDTLS_PK_WRITE_C) -/** - * \brief Write a private key to a PKCS#1 or SEC1 DER structure - * Note: data is written at the end of the buffer! Use the - * return value to determine where you should start - * using the buffer - * - * \param ctx private to write away - * \param buf buffer to write to - * \param size size of the buffer - * - * \return length of data written if successful, or a specific - * error code - */ -int mbedtls_pk_write_key_der( mbedtls_pk_context *ctx, unsigned char *buf, size_t size ); - -/** - * \brief Write a public key to a SubjectPublicKeyInfo DER structure - * Note: data is written at the end of the buffer! Use the - * return value to determine where you should start - * using the buffer - * - * \param ctx public key to write away - * \param buf buffer to write to - * \param size size of the buffer - * - * \return length of data written if successful, or a specific - * error code - */ -int mbedtls_pk_write_pubkey_der( mbedtls_pk_context *ctx, unsigned char *buf, size_t size ); - -#if defined(MBEDTLS_PEM_WRITE_C) -/** - * \brief Write a public key to a PEM string - * - * \param ctx public key to write away - * \param buf buffer to write to - * \param size size of the buffer - * - * \return 0 if successful, or a specific error code - */ -int mbedtls_pk_write_pubkey_pem( mbedtls_pk_context *ctx, unsigned char *buf, size_t size ); - -/** - * \brief Write a private key to a PKCS#1 or SEC1 PEM string - * - * \param ctx private to write away - * \param buf buffer to write to - * \param size size of the buffer - * - * \return 0 if successful, or a specific error code - */ -int mbedtls_pk_write_key_pem( mbedtls_pk_context *ctx, unsigned char *buf, size_t size ); -#endif /* MBEDTLS_PEM_WRITE_C */ -#endif /* MBEDTLS_PK_WRITE_C */ - -/* - * WARNING: Low-level functions. You probably do not want to use these unless - * you are certain you do ;) - */ - -#if defined(MBEDTLS_PK_PARSE_C) -/** - * \brief Parse a SubjectPublicKeyInfo DER structure - * - * \param p the position in the ASN.1 data - * \param end end of the buffer - * \param pk the key to fill - * - * \return 0 if successful, or a specific PK error code - */ -int mbedtls_pk_parse_subpubkey( unsigned char **p, const unsigned char *end, - mbedtls_pk_context *pk ); -#endif /* MBEDTLS_PK_PARSE_C */ - -#if defined(MBEDTLS_PK_WRITE_C) -/** - * \brief Write a subjectPublicKey to ASN.1 data - * Note: function works backwards in data buffer - * - * \param p reference to current position pointer - * \param start start of the buffer (for bounds-checking) - * \param key public key to write away - * - * \return the length written or a negative error code - */ -int mbedtls_pk_write_pubkey( unsigned char **p, unsigned char *start, - const mbedtls_pk_context *key ); -#endif /* MBEDTLS_PK_WRITE_C */ - -/* - * Internal module functions. You probably do not want to use these unless you - * know you do. - */ -#if defined(MBEDTLS_FS_IO) -int mbedtls_pk_load_file( const char *path, unsigned char **buf, size_t *n ); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_PK_H */ diff --git a/tools/sdk/include/mbedtls/mbedtls/pk_internal.h b/tools/sdk/include/mbedtls/mbedtls/pk_internal.h deleted file mode 100644 index 3dae0fc5b27..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/pk_internal.h +++ /dev/null @@ -1,115 +0,0 @@ -/** - * \file pk_internal.h - * - * \brief Public Key abstraction layer: wrapper functions - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_PK_WRAP_H -#define MBEDTLS_PK_WRAP_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "pk.h" - -struct mbedtls_pk_info_t -{ - /** Public key type */ - mbedtls_pk_type_t type; - - /** Type name */ - const char *name; - - /** Get key size in bits */ - size_t (*get_bitlen)( const void * ); - - /** Tell if the context implements this type (e.g. ECKEY can do ECDSA) */ - int (*can_do)( mbedtls_pk_type_t type ); - - /** Verify signature */ - int (*verify_func)( void *ctx, mbedtls_md_type_t md_alg, - const unsigned char *hash, size_t hash_len, - const unsigned char *sig, size_t sig_len ); - - /** Make signature */ - int (*sign_func)( void *ctx, mbedtls_md_type_t md_alg, - const unsigned char *hash, size_t hash_len, - unsigned char *sig, size_t *sig_len, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - - /** Decrypt message */ - int (*decrypt_func)( void *ctx, const unsigned char *input, size_t ilen, - unsigned char *output, size_t *olen, size_t osize, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - - /** Encrypt message */ - int (*encrypt_func)( void *ctx, const unsigned char *input, size_t ilen, - unsigned char *output, size_t *olen, size_t osize, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - - /** Check public-private key pair */ - int (*check_pair_func)( const void *pub, const void *prv ); - - /** Allocate a new context */ - void * (*ctx_alloc_func)( void ); - - /** Free the given context */ - void (*ctx_free_func)( void *ctx ); - - /** Interface with the debug module */ - void (*debug_func)( const void *ctx, mbedtls_pk_debug_item *items ); - -}; -#if defined(MBEDTLS_PK_RSA_ALT_SUPPORT) -/* Container for RSA-alt */ -typedef struct -{ - void *key; - mbedtls_pk_rsa_alt_decrypt_func decrypt_func; - mbedtls_pk_rsa_alt_sign_func sign_func; - mbedtls_pk_rsa_alt_key_len_func key_len_func; -} mbedtls_rsa_alt_context; -#endif - -#if defined(MBEDTLS_RSA_C) -extern const mbedtls_pk_info_t mbedtls_rsa_info; -#endif - -#if defined(MBEDTLS_ECP_C) -extern const mbedtls_pk_info_t mbedtls_eckey_info; -extern const mbedtls_pk_info_t mbedtls_eckeydh_info; -#endif - -#if defined(MBEDTLS_ECDSA_C) -extern const mbedtls_pk_info_t mbedtls_ecdsa_info; -#endif - -#if defined(MBEDTLS_PK_RSA_ALT_SUPPORT) -extern const mbedtls_pk_info_t mbedtls_rsa_alt_info; -#endif - -#endif /* MBEDTLS_PK_WRAP_H */ diff --git a/tools/sdk/include/mbedtls/mbedtls/pkcs11.h b/tools/sdk/include/mbedtls/mbedtls/pkcs11.h deleted file mode 100644 index 02427ddc1e9..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/pkcs11.h +++ /dev/null @@ -1,175 +0,0 @@ -/** - * \file pkcs11.h - * - * \brief Wrapper for PKCS#11 library libpkcs11-helper - * - * \author Adriaan de Jong - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_PKCS11_H -#define MBEDTLS_PKCS11_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#if defined(MBEDTLS_PKCS11_C) - -#include "x509_crt.h" - -#include - -#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ - !defined(inline) && !defined(__cplusplus) -#define inline __inline -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Context for PKCS #11 private keys. - */ -typedef struct mbedtls_pkcs11_context -{ - pkcs11h_certificate_t pkcs11h_cert; - int len; -} mbedtls_pkcs11_context; - -/** - * Initialize a mbedtls_pkcs11_context. - * (Just making memory references valid.) - */ -void mbedtls_pkcs11_init( mbedtls_pkcs11_context *ctx ); - -/** - * Fill in a mbed TLS certificate, based on the given PKCS11 helper certificate. - * - * \param cert X.509 certificate to fill - * \param pkcs11h_cert PKCS #11 helper certificate - * - * \return 0 on success. - */ -int mbedtls_pkcs11_x509_cert_bind( mbedtls_x509_crt *cert, pkcs11h_certificate_t pkcs11h_cert ); - -/** - * Set up a mbedtls_pkcs11_context storing the given certificate. Note that the - * mbedtls_pkcs11_context will take over control of the certificate, freeing it when - * done. - * - * \param priv_key Private key structure to fill. - * \param pkcs11_cert PKCS #11 helper certificate - * - * \return 0 on success - */ -int mbedtls_pkcs11_priv_key_bind( mbedtls_pkcs11_context *priv_key, - pkcs11h_certificate_t pkcs11_cert ); - -/** - * Free the contents of the given private key context. Note that the structure - * itself is not freed. - * - * \param priv_key Private key structure to cleanup - */ -void mbedtls_pkcs11_priv_key_free( mbedtls_pkcs11_context *priv_key ); - -/** - * \brief Do an RSA private key decrypt, then remove the message - * padding - * - * \param ctx PKCS #11 context - * \param mode must be MBEDTLS_RSA_PRIVATE, for compatibility with rsa.c's signature - * \param input buffer holding the encrypted data - * \param output buffer that will hold the plaintext - * \param olen will contain the plaintext length - * \param output_max_len maximum length of the output buffer - * - * \return 0 if successful, or an MBEDTLS_ERR_RSA_XXX error code - * - * \note The output buffer must be as large as the size - * of ctx->N (eg. 128 bytes if RSA-1024 is used) otherwise - * an error is thrown. - */ -int mbedtls_pkcs11_decrypt( mbedtls_pkcs11_context *ctx, - int mode, size_t *olen, - const unsigned char *input, - unsigned char *output, - size_t output_max_len ); - -/** - * \brief Do a private RSA to sign a message digest - * - * \param ctx PKCS #11 context - * \param mode must be MBEDTLS_RSA_PRIVATE, for compatibility with rsa.c's signature - * \param md_alg a MBEDTLS_MD_XXX (use MBEDTLS_MD_NONE for signing raw data) - * \param hashlen message digest length (for MBEDTLS_MD_NONE only) - * \param hash buffer holding the message digest - * \param sig buffer that will hold the ciphertext - * - * \return 0 if the signing operation was successful, - * or an MBEDTLS_ERR_RSA_XXX error code - * - * \note The "sig" buffer must be as large as the size - * of ctx->N (eg. 128 bytes if RSA-1024 is used). - */ -int mbedtls_pkcs11_sign( mbedtls_pkcs11_context *ctx, - int mode, - mbedtls_md_type_t md_alg, - unsigned int hashlen, - const unsigned char *hash, - unsigned char *sig ); - -/** - * SSL/TLS wrappers for PKCS#11 functions - */ -static inline int mbedtls_ssl_pkcs11_decrypt( void *ctx, int mode, size_t *olen, - const unsigned char *input, unsigned char *output, - size_t output_max_len ) -{ - return mbedtls_pkcs11_decrypt( (mbedtls_pkcs11_context *) ctx, mode, olen, input, output, - output_max_len ); -} - -static inline int mbedtls_ssl_pkcs11_sign( void *ctx, - int (*f_rng)(void *, unsigned char *, size_t), void *p_rng, - int mode, mbedtls_md_type_t md_alg, unsigned int hashlen, - const unsigned char *hash, unsigned char *sig ) -{ - ((void) f_rng); - ((void) p_rng); - return mbedtls_pkcs11_sign( (mbedtls_pkcs11_context *) ctx, mode, md_alg, - hashlen, hash, sig ); -} - -static inline size_t mbedtls_ssl_pkcs11_key_len( void *ctx ) -{ - return ( (mbedtls_pkcs11_context *) ctx )->len; -} - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_PKCS11_C */ - -#endif /* MBEDTLS_PKCS11_H */ diff --git a/tools/sdk/include/mbedtls/mbedtls/pkcs12.h b/tools/sdk/include/mbedtls/mbedtls/pkcs12.h deleted file mode 100644 index a621ef5b15e..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/pkcs12.h +++ /dev/null @@ -1,120 +0,0 @@ -/** - * \file pkcs12.h - * - * \brief PKCS#12 Personal Information Exchange Syntax - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_PKCS12_H -#define MBEDTLS_PKCS12_H - -#include "md.h" -#include "cipher.h" -#include "asn1.h" - -#include - -#define MBEDTLS_ERR_PKCS12_BAD_INPUT_DATA -0x1F80 /**< Bad input parameters to function. */ -#define MBEDTLS_ERR_PKCS12_FEATURE_UNAVAILABLE -0x1F00 /**< Feature not available, e.g. unsupported encryption scheme. */ -#define MBEDTLS_ERR_PKCS12_PBE_INVALID_FORMAT -0x1E80 /**< PBE ASN.1 data not as expected. */ -#define MBEDTLS_ERR_PKCS12_PASSWORD_MISMATCH -0x1E00 /**< Given private key password does not allow for correct decryption. */ - -#define MBEDTLS_PKCS12_DERIVE_KEY 1 /**< encryption/decryption key */ -#define MBEDTLS_PKCS12_DERIVE_IV 2 /**< initialization vector */ -#define MBEDTLS_PKCS12_DERIVE_MAC_KEY 3 /**< integrity / MAC key */ - -#define MBEDTLS_PKCS12_PBE_DECRYPT 0 -#define MBEDTLS_PKCS12_PBE_ENCRYPT 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief PKCS12 Password Based function (encryption / decryption) - * for pbeWithSHAAnd128BitRC4 - * - * \param pbe_params an ASN1 buffer containing the pkcs-12PbeParams structure - * \param mode either MBEDTLS_PKCS12_PBE_ENCRYPT or MBEDTLS_PKCS12_PBE_DECRYPT - * \param pwd the password used (may be NULL if no password is used) - * \param pwdlen length of the password (may be 0) - * \param input the input data - * \param len data length - * \param output the output buffer - * - * \return 0 if successful, or a MBEDTLS_ERR_XXX code - */ -int mbedtls_pkcs12_pbe_sha1_rc4_128( mbedtls_asn1_buf *pbe_params, int mode, - const unsigned char *pwd, size_t pwdlen, - const unsigned char *input, size_t len, - unsigned char *output ); - -/** - * \brief PKCS12 Password Based function (encryption / decryption) - * for cipher-based and mbedtls_md-based PBE's - * - * \param pbe_params an ASN1 buffer containing the pkcs-12PbeParams structure - * \param mode either MBEDTLS_PKCS12_PBE_ENCRYPT or MBEDTLS_PKCS12_PBE_DECRYPT - * \param cipher_type the cipher used - * \param md_type the mbedtls_md used - * \param pwd the password used (may be NULL if no password is used) - * \param pwdlen length of the password (may be 0) - * \param input the input data - * \param len data length - * \param output the output buffer - * - * \return 0 if successful, or a MBEDTLS_ERR_XXX code - */ -int mbedtls_pkcs12_pbe( mbedtls_asn1_buf *pbe_params, int mode, - mbedtls_cipher_type_t cipher_type, mbedtls_md_type_t md_type, - const unsigned char *pwd, size_t pwdlen, - const unsigned char *input, size_t len, - unsigned char *output ); - -/** - * \brief The PKCS#12 derivation function uses a password and a salt - * to produce pseudo-random bits for a particular "purpose". - * - * Depending on the given id, this function can produce an - * encryption/decryption key, an nitialization vector or an - * integrity key. - * - * \param data buffer to store the derived data in - * \param datalen length to fill - * \param pwd password to use (may be NULL if no password is used) - * \param pwdlen length of the password (may be 0) - * \param salt salt buffer to use - * \param saltlen length of the salt - * \param mbedtls_md mbedtls_md type to use during the derivation - * \param id id that describes the purpose (can be MBEDTLS_PKCS12_DERIVE_KEY, - * MBEDTLS_PKCS12_DERIVE_IV or MBEDTLS_PKCS12_DERIVE_MAC_KEY) - * \param iterations number of iterations - * - * \return 0 if successful, or a MD, BIGNUM type error. - */ -int mbedtls_pkcs12_derivation( unsigned char *data, size_t datalen, - const unsigned char *pwd, size_t pwdlen, - const unsigned char *salt, size_t saltlen, - mbedtls_md_type_t mbedtls_md, int id, int iterations ); - -#ifdef __cplusplus -} -#endif - -#endif /* pkcs12.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/pkcs5.h b/tools/sdk/include/mbedtls/mbedtls/pkcs5.h deleted file mode 100644 index 9a3c9fddcc9..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/pkcs5.h +++ /dev/null @@ -1,95 +0,0 @@ -/** - * \file pkcs5.h - * - * \brief PKCS#5 functions - * - * \author Mathias Olsson - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_PKCS5_H -#define MBEDTLS_PKCS5_H - -#include "asn1.h" -#include "md.h" - -#include -#include - -#define MBEDTLS_ERR_PKCS5_BAD_INPUT_DATA -0x2f80 /**< Bad input parameters to function. */ -#define MBEDTLS_ERR_PKCS5_INVALID_FORMAT -0x2f00 /**< Unexpected ASN.1 data. */ -#define MBEDTLS_ERR_PKCS5_FEATURE_UNAVAILABLE -0x2e80 /**< Requested encryption or digest alg not available. */ -#define MBEDTLS_ERR_PKCS5_PASSWORD_MISMATCH -0x2e00 /**< Given private key password does not allow for correct decryption. */ - -#define MBEDTLS_PKCS5_DECRYPT 0 -#define MBEDTLS_PKCS5_ENCRYPT 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief PKCS#5 PBES2 function - * - * \param pbe_params the ASN.1 algorithm parameters - * \param mode either MBEDTLS_PKCS5_DECRYPT or MBEDTLS_PKCS5_ENCRYPT - * \param pwd password to use when generating key - * \param pwdlen length of password - * \param data data to process - * \param datalen length of data - * \param output output buffer - * - * \returns 0 on success, or a MBEDTLS_ERR_XXX code if verification fails. - */ -int mbedtls_pkcs5_pbes2( const mbedtls_asn1_buf *pbe_params, int mode, - const unsigned char *pwd, size_t pwdlen, - const unsigned char *data, size_t datalen, - unsigned char *output ); - -/** - * \brief PKCS#5 PBKDF2 using HMAC - * - * \param ctx Generic HMAC context - * \param password Password to use when generating key - * \param plen Length of password - * \param salt Salt to use when generating key - * \param slen Length of salt - * \param iteration_count Iteration count - * \param key_length Length of generated key in bytes - * \param output Generated key. Must be at least as big as key_length - * - * \returns 0 on success, or a MBEDTLS_ERR_XXX code if verification fails. - */ -int mbedtls_pkcs5_pbkdf2_hmac( mbedtls_md_context_t *ctx, const unsigned char *password, - size_t plen, const unsigned char *salt, size_t slen, - unsigned int iteration_count, - uint32_t key_length, unsigned char *output ); - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - */ -int mbedtls_pkcs5_self_test( int verbose ); - -#ifdef __cplusplus -} -#endif - -#endif /* pkcs5.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/platform.h b/tools/sdk/include/mbedtls/mbedtls/platform.h deleted file mode 100644 index a40a64f9c6b..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/platform.h +++ /dev/null @@ -1,364 +0,0 @@ -/** - * \file platform.h - * - * \brief This file contains the definitions and functions of the - * Mbed TLS platform abstraction layer. - * - * The platform abstraction layer removes the need for the library - * to directly link to standard C library functions or operating - * system services, making the library easier to port and embed. - * Application developers and users of the library can provide their own - * implementations of these functions, or implementations specific to - * their platform, which can be statically linked to the library or - * dynamically configured at runtime. - */ -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_PLATFORM_H -#define MBEDTLS_PLATFORM_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#if defined(MBEDTLS_HAVE_TIME) -#include "platform_time.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \name SECTION: Module settings - * - * The configuration options you can set for this module are in this section. - * Either change them in config.h or define them on the compiler command line. - * \{ - */ - -#if !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) -#include -#include -#include -#if !defined(MBEDTLS_PLATFORM_STD_SNPRINTF) -#if defined(_WIN32) -#define MBEDTLS_PLATFORM_STD_SNPRINTF mbedtls_platform_win32_snprintf /**< The default \c snprintf function to use. */ -#else -#define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf /**< The default \c snprintf function to use. */ -#endif -#endif -#if !defined(MBEDTLS_PLATFORM_STD_PRINTF) -#define MBEDTLS_PLATFORM_STD_PRINTF printf /**< The default \c printf function to use. */ -#endif -#if !defined(MBEDTLS_PLATFORM_STD_FPRINTF) -#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**< The default \c fprintf function to use. */ -#endif -#if !defined(MBEDTLS_PLATFORM_STD_CALLOC) -#define MBEDTLS_PLATFORM_STD_CALLOC calloc /**< The default \c calloc function to use. */ -#endif -#if !defined(MBEDTLS_PLATFORM_STD_FREE) -#define MBEDTLS_PLATFORM_STD_FREE free /**< The default \c free function to use. */ -#endif -#if !defined(MBEDTLS_PLATFORM_STD_EXIT) -#define MBEDTLS_PLATFORM_STD_EXIT exit /**< The default \c exit function to use. */ -#endif -#if !defined(MBEDTLS_PLATFORM_STD_TIME) -#define MBEDTLS_PLATFORM_STD_TIME time /**< The default \c time function to use. */ -#endif -#if !defined(MBEDTLS_PLATFORM_STD_EXIT_SUCCESS) -#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS EXIT_SUCCESS /**< The default exit value to use. */ -#endif -#if !defined(MBEDTLS_PLATFORM_STD_EXIT_FAILURE) -#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE EXIT_FAILURE /**< The default exit value to use. */ -#endif -#if defined(MBEDTLS_FS_IO) -#if !defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) -#define MBEDTLS_PLATFORM_STD_NV_SEED_READ mbedtls_platform_std_nv_seed_read -#endif -#if !defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) -#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE mbedtls_platform_std_nv_seed_write -#endif -#if !defined(MBEDTLS_PLATFORM_STD_NV_SEED_FILE) -#define MBEDTLS_PLATFORM_STD_NV_SEED_FILE "seedfile" -#endif -#endif /* MBEDTLS_FS_IO */ -#else /* MBEDTLS_PLATFORM_NO_STD_FUNCTIONS */ -#if defined(MBEDTLS_PLATFORM_STD_MEM_HDR) -#include MBEDTLS_PLATFORM_STD_MEM_HDR -#endif -#endif /* MBEDTLS_PLATFORM_NO_STD_FUNCTIONS */ - - -/* \} name SECTION: Module settings */ - -/* - * The function pointers for calloc and free. - */ -#if defined(MBEDTLS_PLATFORM_MEMORY) -#if defined(MBEDTLS_PLATFORM_FREE_MACRO) && \ - defined(MBEDTLS_PLATFORM_CALLOC_MACRO) -#define mbedtls_free MBEDTLS_PLATFORM_FREE_MACRO -#define mbedtls_calloc MBEDTLS_PLATFORM_CALLOC_MACRO -#else -/* For size_t */ -#include -extern void *mbedtls_calloc( size_t n, size_t size ); -extern void mbedtls_free( void *ptr ); - -/** - * \brief This function dynamically sets the memory-management - * functions used by the library, during runtime. - * - * \param calloc_func The \c calloc function implementation. - * \param free_func The \c free function implementation. - * - * \return \c 0. - */ -int mbedtls_platform_set_calloc_free( void * (*calloc_func)( size_t, size_t ), - void (*free_func)( void * ) ); -#endif /* MBEDTLS_PLATFORM_FREE_MACRO && MBEDTLS_PLATFORM_CALLOC_MACRO */ -#else /* !MBEDTLS_PLATFORM_MEMORY */ -#define mbedtls_free free -#define mbedtls_calloc calloc -#endif /* MBEDTLS_PLATFORM_MEMORY && !MBEDTLS_PLATFORM_{FREE,CALLOC}_MACRO */ - -/* - * The function pointers for fprintf - */ -#if defined(MBEDTLS_PLATFORM_FPRINTF_ALT) -/* We need FILE * */ -#include -extern int (*mbedtls_fprintf)( FILE *stream, const char *format, ... ); - -/** - * \brief This function dynamically configures the fprintf - * function that is called when the - * mbedtls_fprintf() function is invoked by the library. - * - * \param fprintf_func The \c fprintf function implementation. - * - * \return \c 0. - */ -int mbedtls_platform_set_fprintf( int (*fprintf_func)( FILE *stream, const char *, - ... ) ); -#else -#if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) -#define mbedtls_fprintf MBEDTLS_PLATFORM_FPRINTF_MACRO -#else -#define mbedtls_fprintf fprintf -#endif /* MBEDTLS_PLATFORM_FPRINTF_MACRO */ -#endif /* MBEDTLS_PLATFORM_FPRINTF_ALT */ - -/* - * The function pointers for printf - */ -#if defined(MBEDTLS_PLATFORM_PRINTF_ALT) -extern int (*mbedtls_printf)( const char *format, ... ); - -/** - * \brief This function dynamically configures the snprintf - * function that is called when the mbedtls_snprintf() - * function is invoked by the library. - * - * \param printf_func The \c printf function implementation. - * - * \return \c 0 on success. - */ -int mbedtls_platform_set_printf( int (*printf_func)( const char *, ... ) ); -#else /* !MBEDTLS_PLATFORM_PRINTF_ALT */ -#if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) -#define mbedtls_printf MBEDTLS_PLATFORM_PRINTF_MACRO -#else -#define mbedtls_printf printf -#endif /* MBEDTLS_PLATFORM_PRINTF_MACRO */ -#endif /* MBEDTLS_PLATFORM_PRINTF_ALT */ - -/* - * The function pointers for snprintf - * - * The snprintf implementation should conform to C99: - * - it *must* always correctly zero-terminate the buffer - * (except when n == 0, then it must leave the buffer untouched) - * - however it is acceptable to return -1 instead of the required length when - * the destination buffer is too short. - */ -#if defined(_WIN32) -/* For Windows (inc. MSYS2), we provide our own fixed implementation */ -int mbedtls_platform_win32_snprintf( char *s, size_t n, const char *fmt, ... ); -#endif - -#if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) -extern int (*mbedtls_snprintf)( char * s, size_t n, const char * format, ... ); - -/** - * \brief This function allows configuring a custom - * \c snprintf function pointer. - * - * \param snprintf_func The \c snprintf function implementation. - * - * \return \c 0 on success. - */ -int mbedtls_platform_set_snprintf( int (*snprintf_func)( char * s, size_t n, - const char * format, ... ) ); -#else /* MBEDTLS_PLATFORM_SNPRINTF_ALT */ -#if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) -#define mbedtls_snprintf MBEDTLS_PLATFORM_SNPRINTF_MACRO -#else -#define mbedtls_snprintf MBEDTLS_PLATFORM_STD_SNPRINTF -#endif /* MBEDTLS_PLATFORM_SNPRINTF_MACRO */ -#endif /* MBEDTLS_PLATFORM_SNPRINTF_ALT */ - -/* - * The function pointers for exit - */ -#if defined(MBEDTLS_PLATFORM_EXIT_ALT) -extern void (*mbedtls_exit)( int status ); - -/** - * \brief This function dynamically configures the exit - * function that is called when the mbedtls_exit() - * function is invoked by the library. - * - * \param exit_func The \c exit function implementation. - * - * \return \c 0 on success. - */ -int mbedtls_platform_set_exit( void (*exit_func)( int status ) ); -#else -#if defined(MBEDTLS_PLATFORM_EXIT_MACRO) -#define mbedtls_exit MBEDTLS_PLATFORM_EXIT_MACRO -#else -#define mbedtls_exit exit -#endif /* MBEDTLS_PLATFORM_EXIT_MACRO */ -#endif /* MBEDTLS_PLATFORM_EXIT_ALT */ - -/* - * The default exit values - */ -#if defined(MBEDTLS_PLATFORM_STD_EXIT_SUCCESS) -#define MBEDTLS_EXIT_SUCCESS MBEDTLS_PLATFORM_STD_EXIT_SUCCESS -#else -#define MBEDTLS_EXIT_SUCCESS 0 -#endif -#if defined(MBEDTLS_PLATFORM_STD_EXIT_FAILURE) -#define MBEDTLS_EXIT_FAILURE MBEDTLS_PLATFORM_STD_EXIT_FAILURE -#else -#define MBEDTLS_EXIT_FAILURE 1 -#endif - -/* - * The function pointers for reading from and writing a seed file to - * Non-Volatile storage (NV) in a platform-independent way - * - * Only enabled when the NV seed entropy source is enabled - */ -#if defined(MBEDTLS_ENTROPY_NV_SEED) -#if !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) && defined(MBEDTLS_FS_IO) -/* Internal standard platform definitions */ -int mbedtls_platform_std_nv_seed_read( unsigned char *buf, size_t buf_len ); -int mbedtls_platform_std_nv_seed_write( unsigned char *buf, size_t buf_len ); -#endif - -#if defined(MBEDTLS_PLATFORM_NV_SEED_ALT) -extern int (*mbedtls_nv_seed_read)( unsigned char *buf, size_t buf_len ); -extern int (*mbedtls_nv_seed_write)( unsigned char *buf, size_t buf_len ); - -/** - * \brief This function allows configuring custom seed file writing and - * reading functions. - * - * \param nv_seed_read_func The seed reading function implementation. - * \param nv_seed_write_func The seed writing function implementation. - * - * \return \c 0 on success. - */ -int mbedtls_platform_set_nv_seed( - int (*nv_seed_read_func)( unsigned char *buf, size_t buf_len ), - int (*nv_seed_write_func)( unsigned char *buf, size_t buf_len ) - ); -#else -#if defined(MBEDTLS_PLATFORM_NV_SEED_READ_MACRO) && \ - defined(MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO) -#define mbedtls_nv_seed_read MBEDTLS_PLATFORM_NV_SEED_READ_MACRO -#define mbedtls_nv_seed_write MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO -#else -#define mbedtls_nv_seed_read mbedtls_platform_std_nv_seed_read -#define mbedtls_nv_seed_write mbedtls_platform_std_nv_seed_write -#endif -#endif /* MBEDTLS_PLATFORM_NV_SEED_ALT */ -#endif /* MBEDTLS_ENTROPY_NV_SEED */ - -#if !defined(MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT) - -/** - * \brief The platform context structure. - * - * \note This structure may be used to assist platform-specific - * setup or teardown operations. - */ -typedef struct mbedtls_platform_context -{ - char dummy; /**< A placeholder member, as empty structs are not portable. */ -} -mbedtls_platform_context; - -#else -#include "platform_alt.h" -#endif /* !MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT */ - -/** - * \brief This function performs any platform-specific initialization - * operations. - * - * \note This function should be called before any other library functions. - * - * Its implementation is platform-specific, and unless - * platform-specific code is provided, it does nothing. - * - * \note The usage and necessity of this function is dependent on the platform. - * - * \param ctx The platform context. - * - * \return \c 0 on success. - */ -int mbedtls_platform_setup( mbedtls_platform_context *ctx ); -/** - * \brief This function performs any platform teardown operations. - * - * \note This function should be called after every other Mbed TLS module - * has been correctly freed using the appropriate free function. - * - * Its implementation is platform-specific, and unless - * platform-specific code is provided, it does nothing. - * - * \note The usage and necessity of this function is dependent on the platform. - * - * \param ctx The platform context. - * - */ -void mbedtls_platform_teardown( mbedtls_platform_context *ctx ); - -#ifdef __cplusplus -} -#endif - -#endif /* platform.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/platform_time.h b/tools/sdk/include/mbedtls/mbedtls/platform_time.h deleted file mode 100644 index 2ed36f56c9e..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/platform_time.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - * \file platform_time.h - * - * \brief mbed TLS Platform time abstraction - */ -/* - * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_PLATFORM_TIME_H -#define MBEDTLS_PLATFORM_TIME_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \name SECTION: Module settings - * - * The configuration options you can set for this module are in this section. - * Either change them in config.h or define them on the compiler command line. - * \{ - */ - -/* - * The time_t datatype - */ -#if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) -typedef MBEDTLS_PLATFORM_TIME_TYPE_MACRO mbedtls_time_t; -#else -/* For time_t */ -#include -typedef time_t mbedtls_time_t; -#endif /* MBEDTLS_PLATFORM_TIME_TYPE_MACRO */ - -/* - * The function pointers for time - */ -#if defined(MBEDTLS_PLATFORM_TIME_ALT) -extern mbedtls_time_t (*mbedtls_time)( mbedtls_time_t* time ); - -/** - * \brief Set your own time function pointer - * - * \param time_func the time function implementation - * - * \return 0 - */ -int mbedtls_platform_set_time( mbedtls_time_t (*time_func)( mbedtls_time_t* time ) ); -#else -#if defined(MBEDTLS_PLATFORM_TIME_MACRO) -#define mbedtls_time MBEDTLS_PLATFORM_TIME_MACRO -#else -#define mbedtls_time time -#endif /* MBEDTLS_PLATFORM_TIME_MACRO */ -#endif /* MBEDTLS_PLATFORM_TIME_ALT */ - -#ifdef __cplusplus -} -#endif - -#endif /* platform_time.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/platform_util.h b/tools/sdk/include/mbedtls/mbedtls/platform_util.h deleted file mode 100644 index 164a1a05f9d..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/platform_util.h +++ /dev/null @@ -1,103 +0,0 @@ -/** - * \file platform_util.h - * - * \brief Common and shared functions used by multiple modules in the Mbed TLS - * library. - */ -/* - * Copyright (C) 2018, Arm Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_PLATFORM_UTIL_H -#define MBEDTLS_PLATFORM_UTIL_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#if defined(MBEDTLS_HAVE_TIME_DATE) -#include "mbedtls/platform_time.h" -#include -#endif /* MBEDTLS_HAVE_TIME_DATE */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Securely zeroize a buffer - * - * The function is meant to wipe the data contained in a buffer so - * that it can no longer be recovered even if the program memory - * is later compromised. Call this function on sensitive data - * stored on the stack before returning from a function, and on - * sensitive data stored on the heap before freeing the heap - * object. - * - * It is extremely difficult to guarantee that calls to - * mbedtls_platform_zeroize() are not removed by aggressive - * compiler optimizations in a portable way. For this reason, Mbed - * TLS provides the configuration option - * MBEDTLS_PLATFORM_ZEROIZE_ALT, which allows users to configure - * mbedtls_platform_zeroize() to use a suitable implementation for - * their platform and needs - * - * \param buf Buffer to be zeroized - * \param len Length of the buffer in bytes - * - */ -void mbedtls_platform_zeroize( void *buf, size_t len ); - -#if defined(MBEDTLS_HAVE_TIME_DATE) -/** - * \brief Platform-specific implementation of gmtime_r() - * - * The function is a thread-safe abstraction that behaves - * similarly to the gmtime_r() function from Unix/POSIX. - * - * Mbed TLS will try to identify the underlying platform and - * make use of an appropriate underlying implementation (e.g. - * gmtime_r() for POSIX and gmtime_s() for Windows). If this is - * not possible, then gmtime() will be used. In this case, calls - * from the library to gmtime() will be guarded by the mutex - * mbedtls_threading_gmtime_mutex if MBEDTLS_THREADING_C is - * enabled. It is recommended that calls from outside the library - * are also guarded by this mutex. - * - * If MBEDTLS_PLATFORM_GMTIME_R_ALT is defined, then Mbed TLS will - * unconditionally use the alternative implementation for - * mbedtls_platform_gmtime_r() supplied by the user at compile time. - * - * \param tt Pointer to an object containing time (in seconds) since the - * epoch to be converted - * \param tm_buf Pointer to an object where the results will be stored - * - * \return Pointer to an object of type struct tm on success, otherwise - * NULL - */ -struct tm *mbedtls_platform_gmtime_r( const mbedtls_time_t *tt, - struct tm *tm_buf ); -#endif /* MBEDTLS_HAVE_TIME_DATE */ - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_PLATFORM_UTIL_H */ diff --git a/tools/sdk/include/mbedtls/mbedtls/poly1305.h b/tools/sdk/include/mbedtls/mbedtls/poly1305.h deleted file mode 100644 index c490cdf2bd1..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/poly1305.h +++ /dev/null @@ -1,181 +0,0 @@ -/** - * \file poly1305.h - * - * \brief This file contains Poly1305 definitions and functions. - * - * Poly1305 is a one-time message authenticator that can be used to - * authenticate messages. Poly1305-AES was created by Daniel - * Bernstein https://cr.yp.to/mac/poly1305-20050329.pdf The generic - * Poly1305 algorithm (not tied to AES) was also standardized in RFC - * 7539. - * - * \author Daniel King - */ - -/* Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_POLY1305_H -#define MBEDTLS_POLY1305_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -#define MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA -0x0057 /**< Invalid input parameter(s). */ -#define MBEDTLS_ERR_POLY1305_FEATURE_UNAVAILABLE -0x0059 /**< Feature not available. For example, s part of the API is not implemented. */ -#define MBEDTLS_ERR_POLY1305_HW_ACCEL_FAILED -0x005B /**< Poly1305 hardware accelerator failed. */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_POLY1305_ALT) - -typedef struct mbedtls_poly1305_context -{ - uint32_t r[4]; /** The value for 'r' (low 128 bits of the key). */ - uint32_t s[4]; /** The value for 's' (high 128 bits of the key). */ - uint32_t acc[5]; /** The accumulator number. */ - uint8_t queue[16]; /** The current partial block of data. */ - size_t queue_len; /** The number of bytes stored in 'queue'. */ -} -mbedtls_poly1305_context; - -#else /* MBEDTLS_POLY1305_ALT */ -#include "poly1305_alt.h" -#endif /* MBEDTLS_POLY1305_ALT */ - -/** - * \brief This function initializes the specified Poly1305 context. - * - * It must be the first API called before using - * the context. - * - * It is usually followed by a call to - * \c mbedtls_poly1305_starts(), then one or more calls to - * \c mbedtls_poly1305_update(), then one call to - * \c mbedtls_poly1305_finish(), then finally - * \c mbedtls_poly1305_free(). - * - * \param ctx The Poly1305 context to initialize. - */ -void mbedtls_poly1305_init( mbedtls_poly1305_context *ctx ); - -/** - * \brief This function releases and clears the specified Poly1305 context. - * - * \param ctx The Poly1305 context to clear. - */ -void mbedtls_poly1305_free( mbedtls_poly1305_context *ctx ); - -/** - * \brief This function sets the one-time authentication key. - * - * \warning The key must be unique and unpredictable for each - * invocation of Poly1305. - * - * \param ctx The Poly1305 context to which the key should be bound. - * \param key The buffer containing the 256-bit key. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA - * if ctx or key are NULL. - */ -int mbedtls_poly1305_starts( mbedtls_poly1305_context *ctx, - const unsigned char key[32] ); - -/** - * \brief This functions feeds an input buffer into an ongoing - * Poly1305 computation. - * - * It is called between \c mbedtls_cipher_poly1305_starts() and - * \c mbedtls_cipher_poly1305_finish(). - * It can be called repeatedly to process a stream of data. - * - * \param ctx The Poly1305 context to use for the Poly1305 operation. - * \param ilen The length of the input data (in bytes). Any value is accepted. - * \param input The buffer holding the input data. - * This pointer can be NULL if ilen == 0. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA - * if ctx or input are NULL. - */ -int mbedtls_poly1305_update( mbedtls_poly1305_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief This function generates the Poly1305 Message - * Authentication Code (MAC). - * - * \param ctx The Poly1305 context to use for the Poly1305 operation. - * \param mac The buffer to where the MAC is written. Must be big enough - * to hold the 16-byte MAC. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA - * if ctx or mac are NULL. - */ -int mbedtls_poly1305_finish( mbedtls_poly1305_context *ctx, - unsigned char mac[16] ); - -/** - * \brief This function calculates the Poly1305 MAC of the input - * buffer with the provided key. - * - * \warning The key must be unique and unpredictable for each - * invocation of Poly1305. - * - * \param key The buffer containing the 256-bit key. - * \param ilen The length of the input data (in bytes). Any value is accepted. - * \param input The buffer holding the input data. - * This pointer can be NULL if ilen == 0. - * \param mac The buffer to where the MAC is written. Must be big enough - * to hold the 16-byte MAC. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA - * if key, input, or mac are NULL. - */ -int mbedtls_poly1305_mac( const unsigned char key[32], - const unsigned char *input, - size_t ilen, - unsigned char mac[16] ); - -#if defined(MBEDTLS_SELF_TEST) -/** - * \brief The Poly1305 checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_poly1305_self_test( int verbose ); -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_POLY1305_H */ diff --git a/tools/sdk/include/mbedtls/mbedtls/ripemd160.h b/tools/sdk/include/mbedtls/mbedtls/ripemd160.h deleted file mode 100644 index 0c8e568b9ec..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/ripemd160.h +++ /dev/null @@ -1,231 +0,0 @@ -/** - * \file ripemd160.h - * - * \brief RIPE MD-160 message digest - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_RIPEMD160_H -#define MBEDTLS_RIPEMD160_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -#define MBEDTLS_ERR_RIPEMD160_HW_ACCEL_FAILED -0x0031 /**< RIPEMD160 hardware accelerator failed */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_RIPEMD160_ALT) -// Regular implementation -// - -/** - * \brief RIPEMD-160 context structure - */ -typedef struct mbedtls_ripemd160_context -{ - uint32_t total[2]; /*!< number of bytes processed */ - uint32_t state[5]; /*!< intermediate digest state */ - unsigned char buffer[64]; /*!< data block being processed */ -} -mbedtls_ripemd160_context; - -#else /* MBEDTLS_RIPEMD160_ALT */ -#include "ripemd160.h" -#endif /* MBEDTLS_RIPEMD160_ALT */ - -/** - * \brief Initialize RIPEMD-160 context - * - * \param ctx RIPEMD-160 context to be initialized - */ -void mbedtls_ripemd160_init( mbedtls_ripemd160_context *ctx ); - -/** - * \brief Clear RIPEMD-160 context - * - * \param ctx RIPEMD-160 context to be cleared - */ -void mbedtls_ripemd160_free( mbedtls_ripemd160_context *ctx ); - -/** - * \brief Clone (the state of) an RIPEMD-160 context - * - * \param dst The destination context - * \param src The context to be cloned - */ -void mbedtls_ripemd160_clone( mbedtls_ripemd160_context *dst, - const mbedtls_ripemd160_context *src ); - -/** - * \brief RIPEMD-160 context setup - * - * \param ctx context to be initialized - * - * \return 0 if successful - */ -int mbedtls_ripemd160_starts_ret( mbedtls_ripemd160_context *ctx ); - -/** - * \brief RIPEMD-160 process buffer - * - * \param ctx RIPEMD-160 context - * \param input buffer holding the data - * \param ilen length of the input data - * - * \return 0 if successful - */ -int mbedtls_ripemd160_update_ret( mbedtls_ripemd160_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief RIPEMD-160 final digest - * - * \param ctx RIPEMD-160 context - * \param output RIPEMD-160 checksum result - * - * \return 0 if successful - */ -int mbedtls_ripemd160_finish_ret( mbedtls_ripemd160_context *ctx, - unsigned char output[20] ); - -/** - * \brief RIPEMD-160 process data block (internal use only) - * - * \param ctx RIPEMD-160 context - * \param data buffer holding one block of data - * - * \return 0 if successful - */ -int mbedtls_internal_ripemd160_process( mbedtls_ripemd160_context *ctx, - const unsigned char data[64] ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief RIPEMD-160 context setup - * - * \deprecated Superseded by mbedtls_ripemd160_starts_ret() in 2.7.0 - * - * \param ctx context to be initialized - */ -MBEDTLS_DEPRECATED void mbedtls_ripemd160_starts( - mbedtls_ripemd160_context *ctx ); - -/** - * \brief RIPEMD-160 process buffer - * - * \deprecated Superseded by mbedtls_ripemd160_update_ret() in 2.7.0 - * - * \param ctx RIPEMD-160 context - * \param input buffer holding the data - * \param ilen length of the input data - */ -MBEDTLS_DEPRECATED void mbedtls_ripemd160_update( - mbedtls_ripemd160_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief RIPEMD-160 final digest - * - * \deprecated Superseded by mbedtls_ripemd160_finish_ret() in 2.7.0 - * - * \param ctx RIPEMD-160 context - * \param output RIPEMD-160 checksum result - */ -MBEDTLS_DEPRECATED void mbedtls_ripemd160_finish( - mbedtls_ripemd160_context *ctx, - unsigned char output[20] ); - -/** - * \brief RIPEMD-160 process data block (internal use only) - * - * \deprecated Superseded by mbedtls_internal_ripemd160_process() in 2.7.0 - * - * \param ctx RIPEMD-160 context - * \param data buffer holding one block of data - */ -MBEDTLS_DEPRECATED void mbedtls_ripemd160_process( - mbedtls_ripemd160_context *ctx, - const unsigned char data[64] ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief Output = RIPEMD-160( input buffer ) - * - * \param input buffer holding the data - * \param ilen length of the input data - * \param output RIPEMD-160 checksum result - * - * \return 0 if successful - */ -int mbedtls_ripemd160_ret( const unsigned char *input, - size_t ilen, - unsigned char output[20] ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief Output = RIPEMD-160( input buffer ) - * - * \deprecated Superseded by mbedtls_ripemd160_ret() in 2.7.0 - * - * \param input buffer holding the data - * \param ilen length of the input data - * \param output RIPEMD-160 checksum result - */ -MBEDTLS_DEPRECATED void mbedtls_ripemd160( const unsigned char *input, - size_t ilen, - unsigned char output[20] ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - */ -int mbedtls_ripemd160_self_test( int verbose ); - -#ifdef __cplusplus -} -#endif - -#endif /* mbedtls_ripemd160.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/rsa.h b/tools/sdk/include/mbedtls/mbedtls/rsa.h deleted file mode 100644 index 6eea5af2f09..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/rsa.h +++ /dev/null @@ -1,1131 +0,0 @@ -/** - * \file rsa.h - * - * \brief This file provides an API for the RSA public-key cryptosystem. - * - * The RSA public-key cryptosystem is defined in Public-Key - * Cryptography Standards (PKCS) #1 v1.5: RSA Encryption - * and Public-Key Cryptography Standards (PKCS) #1 v2.1: - * RSA Cryptography Specifications. - * - */ -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_RSA_H -#define MBEDTLS_RSA_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "bignum.h" -#include "md.h" - -#if defined(MBEDTLS_THREADING_C) -#include "threading.h" -#endif - -/* - * RSA Error codes - */ -#define MBEDTLS_ERR_RSA_BAD_INPUT_DATA -0x4080 /**< Bad input parameters to function. */ -#define MBEDTLS_ERR_RSA_INVALID_PADDING -0x4100 /**< Input data contains invalid padding and is rejected. */ -#define MBEDTLS_ERR_RSA_KEY_GEN_FAILED -0x4180 /**< Something failed during generation of a key. */ -#define MBEDTLS_ERR_RSA_KEY_CHECK_FAILED -0x4200 /**< Key failed to pass the validity check of the library. */ -#define MBEDTLS_ERR_RSA_PUBLIC_FAILED -0x4280 /**< The public key operation failed. */ -#define MBEDTLS_ERR_RSA_PRIVATE_FAILED -0x4300 /**< The private key operation failed. */ -#define MBEDTLS_ERR_RSA_VERIFY_FAILED -0x4380 /**< The PKCS#1 verification failed. */ -#define MBEDTLS_ERR_RSA_OUTPUT_TOO_LARGE -0x4400 /**< The output buffer for decryption is not large enough. */ -#define MBEDTLS_ERR_RSA_RNG_FAILED -0x4480 /**< The random generator failed to generate non-zeros. */ -#define MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION -0x4500 /**< The implementation does not offer the requested operation, for example, because of security violations or lack of functionality. */ -#define MBEDTLS_ERR_RSA_HW_ACCEL_FAILED -0x4580 /**< RSA hardware accelerator failed. */ - -/* - * RSA constants - */ -#define MBEDTLS_RSA_PUBLIC 0 /**< Request private key operation. */ -#define MBEDTLS_RSA_PRIVATE 1 /**< Request public key operation. */ - -#define MBEDTLS_RSA_PKCS_V15 0 /**< Use PKCS#1 v1.5 encoding. */ -#define MBEDTLS_RSA_PKCS_V21 1 /**< Use PKCS#1 v2.1 encoding. */ - -#define MBEDTLS_RSA_SIGN 1 /**< Identifier for RSA signature operations. */ -#define MBEDTLS_RSA_CRYPT 2 /**< Identifier for RSA encryption and decryption operations. */ - -#define MBEDTLS_RSA_SALT_LEN_ANY -1 - -/* - * The above constants may be used even if the RSA module is compile out, - * eg for alternative (PKCS#11) RSA implemenations in the PK layers. - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_RSA_ALT) -// Regular implementation -// - -/** - * \brief The RSA context structure. - * - * \note Direct manipulation of the members of this structure - * is deprecated. All manipulation should instead be done through - * the public interface functions. - */ -typedef struct mbedtls_rsa_context -{ - int ver; /*!< Always 0.*/ - size_t len; /*!< The size of \p N in Bytes. */ - - mbedtls_mpi N; /*!< The public modulus. */ - mbedtls_mpi E; /*!< The public exponent. */ - - mbedtls_mpi D; /*!< The private exponent. */ - mbedtls_mpi P; /*!< The first prime factor. */ - mbedtls_mpi Q; /*!< The second prime factor. */ - - mbedtls_mpi DP; /*!< D % (P - 1). */ - mbedtls_mpi DQ; /*!< D % (Q - 1). */ - mbedtls_mpi QP; /*!< 1 / (Q % P). */ - - mbedtls_mpi RN; /*!< cached R^2 mod N. */ - - mbedtls_mpi RP; /*!< cached R^2 mod P. */ - mbedtls_mpi RQ; /*!< cached R^2 mod Q. */ - - mbedtls_mpi Vi; /*!< The cached blinding value. */ - mbedtls_mpi Vf; /*!< The cached un-blinding value. */ - - int padding; /*!< Selects padding mode: - #MBEDTLS_RSA_PKCS_V15 for 1.5 padding and - #MBEDTLS_RSA_PKCS_V21 for OAEP or PSS. */ - int hash_id; /*!< Hash identifier of mbedtls_md_type_t type, - as specified in md.h for use in the MGF - mask generating function used in the - EME-OAEP and EMSA-PSS encodings. */ -#if defined(MBEDTLS_THREADING_C) - mbedtls_threading_mutex_t mutex; /*!< Thread-safety mutex. */ -#endif -} -mbedtls_rsa_context; - -#else /* MBEDTLS_RSA_ALT */ -#include "rsa_alt.h" -#endif /* MBEDTLS_RSA_ALT */ - -/** - * \brief This function initializes an RSA context. - * - * \note Set padding to #MBEDTLS_RSA_PKCS_V21 for the RSAES-OAEP - * encryption scheme and the RSASSA-PSS signature scheme. - * - * \note The \p hash_id parameter is ignored when using - * #MBEDTLS_RSA_PKCS_V15 padding. - * - * \note The choice of padding mode is strictly enforced for private key - * operations, since there might be security concerns in - * mixing padding modes. For public key operations it is - * a default value, which can be overriden by calling specific - * \c rsa_rsaes_xxx or \c rsa_rsassa_xxx functions. - * - * \note The hash selected in \p hash_id is always used for OEAP - * encryption. For PSS signatures, it is always used for - * making signatures, but can be overriden for verifying them. - * If set to #MBEDTLS_MD_NONE, it is always overriden. - * - * \param ctx The RSA context to initialize. - * \param padding Selects padding mode: #MBEDTLS_RSA_PKCS_V15 or - * #MBEDTLS_RSA_PKCS_V21. - * \param hash_id The hash identifier of #mbedtls_md_type_t type, if - * \p padding is #MBEDTLS_RSA_PKCS_V21. - */ -void mbedtls_rsa_init( mbedtls_rsa_context *ctx, - int padding, - int hash_id); - -/** - * \brief This function imports a set of core parameters into an - * RSA context. - * - * \note This function can be called multiple times for successive - * imports, if the parameters are not simultaneously present. - * - * Any sequence of calls to this function should be followed - * by a call to mbedtls_rsa_complete(), which checks and - * completes the provided information to a ready-for-use - * public or private RSA key. - * - * \note See mbedtls_rsa_complete() for more information on which - * parameters are necessary to set up a private or public - * RSA key. - * - * \note The imported parameters are copied and need not be preserved - * for the lifetime of the RSA context being set up. - * - * \param ctx The initialized RSA context to store the parameters in. - * \param N The RSA modulus, or NULL. - * \param P The first prime factor of \p N, or NULL. - * \param Q The second prime factor of \p N, or NULL. - * \param D The private exponent, or NULL. - * \param E The public exponent, or NULL. - * - * \return \c 0 on success. - * \return A non-zero error code on failure. - */ -int mbedtls_rsa_import( mbedtls_rsa_context *ctx, - const mbedtls_mpi *N, - const mbedtls_mpi *P, const mbedtls_mpi *Q, - const mbedtls_mpi *D, const mbedtls_mpi *E ); - -/** - * \brief This function imports core RSA parameters, in raw big-endian - * binary format, into an RSA context. - * - * \note This function can be called multiple times for successive - * imports, if the parameters are not simultaneously present. - * - * Any sequence of calls to this function should be followed - * by a call to mbedtls_rsa_complete(), which checks and - * completes the provided information to a ready-for-use - * public or private RSA key. - * - * \note See mbedtls_rsa_complete() for more information on which - * parameters are necessary to set up a private or public - * RSA key. - * - * \note The imported parameters are copied and need not be preserved - * for the lifetime of the RSA context being set up. - * - * \param ctx The initialized RSA context to store the parameters in. - * \param N The RSA modulus, or NULL. - * \param N_len The Byte length of \p N, ignored if \p N == NULL. - * \param P The first prime factor of \p N, or NULL. - * \param P_len The Byte length of \p P, ignored if \p P == NULL. - * \param Q The second prime factor of \p N, or NULL. - * \param Q_len The Byte length of \p Q, ignored if \p Q == NULL. - * \param D The private exponent, or NULL. - * \param D_len The Byte length of \p D, ignored if \p D == NULL. - * \param E The public exponent, or NULL. - * \param E_len The Byte length of \p E, ignored if \p E == NULL. - * - * \return \c 0 on success. - * \return A non-zero error code on failure. - */ -int mbedtls_rsa_import_raw( mbedtls_rsa_context *ctx, - unsigned char const *N, size_t N_len, - unsigned char const *P, size_t P_len, - unsigned char const *Q, size_t Q_len, - unsigned char const *D, size_t D_len, - unsigned char const *E, size_t E_len ); - -/** - * \brief This function completes an RSA context from - * a set of imported core parameters. - * - * To setup an RSA public key, precisely \p N and \p E - * must have been imported. - * - * To setup an RSA private key, sufficient information must - * be present for the other parameters to be derivable. - * - * The default implementation supports the following: - *
  • Derive \p P, \p Q from \p N, \p D, \p E.
  • - *
  • Derive \p N, \p D from \p P, \p Q, \p E.
- * Alternative implementations need not support these. - * - * If this function runs successfully, it guarantees that - * the RSA context can be used for RSA operations without - * the risk of failure or crash. - * - * \warning This function need not perform consistency checks - * for the imported parameters. In particular, parameters that - * are not needed by the implementation might be silently - * discarded and left unchecked. To check the consistency - * of the key material, see mbedtls_rsa_check_privkey(). - * - * \param ctx The initialized RSA context holding imported parameters. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_RSA_BAD_INPUT_DATA if the attempted derivations - * failed. - * - */ -int mbedtls_rsa_complete( mbedtls_rsa_context *ctx ); - -/** - * \brief This function exports the core parameters of an RSA key. - * - * If this function runs successfully, the non-NULL buffers - * pointed to by \p N, \p P, \p Q, \p D, and \p E are fully - * written, with additional unused space filled leading by - * zero Bytes. - * - * Possible reasons for returning - * #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION:
    - *
  • An alternative RSA implementation is in use, which - * stores the key externally, and either cannot or should - * not export it into RAM.
  • - *
  • A SW or HW implementation might not support a certain - * deduction. For example, \p P, \p Q from \p N, \p D, - * and \p E if the former are not part of the - * implementation.
- * - * If the function fails due to an unsupported operation, - * the RSA context stays intact and remains usable. - * - * \param ctx The initialized RSA context. - * \param N The MPI to hold the RSA modulus, or NULL. - * \param P The MPI to hold the first prime factor of \p N, or NULL. - * \param Q The MPI to hold the second prime factor of \p N, or NULL. - * \param D The MPI to hold the private exponent, or NULL. - * \param E The MPI to hold the public exponent, or NULL. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION if exporting the - * requested parameters cannot be done due to missing - * functionality or because of security policies. - * \return A non-zero return code on any other failure. - * - */ -int mbedtls_rsa_export( const mbedtls_rsa_context *ctx, - mbedtls_mpi *N, mbedtls_mpi *P, mbedtls_mpi *Q, - mbedtls_mpi *D, mbedtls_mpi *E ); - -/** - * \brief This function exports core parameters of an RSA key - * in raw big-endian binary format. - * - * If this function runs successfully, the non-NULL buffers - * pointed to by \p N, \p P, \p Q, \p D, and \p E are fully - * written, with additional unused space filled leading by - * zero Bytes. - * - * Possible reasons for returning - * #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION:
    - *
  • An alternative RSA implementation is in use, which - * stores the key externally, and either cannot or should - * not export it into RAM.
  • - *
  • A SW or HW implementation might not support a certain - * deduction. For example, \p P, \p Q from \p N, \p D, - * and \p E if the former are not part of the - * implementation.
- * If the function fails due to an unsupported operation, - * the RSA context stays intact and remains usable. - * - * \note The length parameters are ignored if the corresponding - * buffer pointers are NULL. - * - * \param ctx The initialized RSA context. - * \param N The Byte array to store the RSA modulus, or NULL. - * \param N_len The size of the buffer for the modulus. - * \param P The Byte array to hold the first prime factor of \p N, or - * NULL. - * \param P_len The size of the buffer for the first prime factor. - * \param Q The Byte array to hold the second prime factor of \p N, or - * NULL. - * \param Q_len The size of the buffer for the second prime factor. - * \param D The Byte array to hold the private exponent, or NULL. - * \param D_len The size of the buffer for the private exponent. - * \param E The Byte array to hold the public exponent, or NULL. - * \param E_len The size of the buffer for the public exponent. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION if exporting the - * requested parameters cannot be done due to missing - * functionality or because of security policies. - * \return A non-zero return code on any other failure. - */ -int mbedtls_rsa_export_raw( const mbedtls_rsa_context *ctx, - unsigned char *N, size_t N_len, - unsigned char *P, size_t P_len, - unsigned char *Q, size_t Q_len, - unsigned char *D, size_t D_len, - unsigned char *E, size_t E_len ); - -/** - * \brief This function exports CRT parameters of a private RSA key. - * - * \note Alternative RSA implementations not using CRT-parameters - * internally can implement this function based on - * mbedtls_rsa_deduce_opt(). - * - * \param ctx The initialized RSA context. - * \param DP The MPI to hold D modulo P-1, or NULL. - * \param DQ The MPI to hold D modulo Q-1, or NULL. - * \param QP The MPI to hold modular inverse of Q modulo P, or NULL. - * - * \return \c 0 on success. - * \return A non-zero error code on failure. - * - */ -int mbedtls_rsa_export_crt( const mbedtls_rsa_context *ctx, - mbedtls_mpi *DP, mbedtls_mpi *DQ, mbedtls_mpi *QP ); - -/** - * \brief This function sets padding for an already initialized RSA - * context. See mbedtls_rsa_init() for details. - * - * \param ctx The RSA context to be set. - * \param padding Selects padding mode: #MBEDTLS_RSA_PKCS_V15 or - * #MBEDTLS_RSA_PKCS_V21. - * \param hash_id The #MBEDTLS_RSA_PKCS_V21 hash identifier. - */ -void mbedtls_rsa_set_padding( mbedtls_rsa_context *ctx, int padding, - int hash_id); - -/** - * \brief This function retrieves the length of RSA modulus in Bytes. - * - * \param ctx The initialized RSA context. - * - * \return The length of the RSA modulus in Bytes. - * - */ -size_t mbedtls_rsa_get_len( const mbedtls_rsa_context *ctx ); - -/** - * \brief This function generates an RSA keypair. - * - * \note mbedtls_rsa_init() must be called before this function, - * to set up the RSA context. - * - * \param ctx The RSA context used to hold the key. - * \param f_rng The RNG function. - * \param p_rng The RNG context. - * \param nbits The size of the public key in bits. - * \param exponent The public exponent. For example, 65537. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_gen_key( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - unsigned int nbits, int exponent ); - -/** - * \brief This function checks if a context contains at least an RSA - * public key. - * - * If the function runs successfully, it is guaranteed that - * enough information is present to perform an RSA public key - * operation using mbedtls_rsa_public(). - * - * \param ctx The RSA context to check. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - * - */ -int mbedtls_rsa_check_pubkey( const mbedtls_rsa_context *ctx ); - -/** - * \brief This function checks if a context contains an RSA private key - * and perform basic consistency checks. - * - * \note The consistency checks performed by this function not only - * ensure that mbedtls_rsa_private() can be called successfully - * on the given context, but that the various parameters are - * mutually consistent with high probability, in the sense that - * mbedtls_rsa_public() and mbedtls_rsa_private() are inverses. - * - * \warning This function should catch accidental misconfigurations - * like swapping of parameters, but it cannot establish full - * trust in neither the quality nor the consistency of the key - * material that was used to setup the given RSA context: - *
  • Consistency: Imported parameters that are irrelevant - * for the implementation might be silently dropped. If dropped, - * the current function does not have access to them, - * and therefore cannot check them. See mbedtls_rsa_complete(). - * If you want to check the consistency of the entire - * content of an PKCS1-encoded RSA private key, for example, you - * should use mbedtls_rsa_validate_params() before setting - * up the RSA context. - * Additionally, if the implementation performs empirical checks, - * these checks substantiate but do not guarantee consistency.
  • - *
  • Quality: This function is not expected to perform - * extended quality assessments like checking that the prime - * factors are safe. Additionally, it is the responsibility of the - * user to ensure the trustworthiness of the source of his RSA - * parameters, which goes beyond what is effectively checkable - * by the library.
- * - * \param ctx The RSA context to check. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_check_privkey( const mbedtls_rsa_context *ctx ); - -/** - * \brief This function checks a public-private RSA key pair. - * - * It checks each of the contexts, and makes sure they match. - * - * \param pub The RSA context holding the public key. - * \param prv The RSA context holding the private key. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_check_pub_priv( const mbedtls_rsa_context *pub, - const mbedtls_rsa_context *prv ); - -/** - * \brief This function performs an RSA public key operation. - * - * \note This function does not handle message padding. - * - * \note Make sure to set \p input[0] = 0 or ensure that - * input is smaller than \p N. - * - * \note The input and output buffers must be large - * enough. For example, 128 Bytes if RSA-1024 is used. - * - * \param ctx The RSA context. - * \param input The input buffer. - * \param output The output buffer. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_public( mbedtls_rsa_context *ctx, - const unsigned char *input, - unsigned char *output ); - -/** - * \brief This function performs an RSA private key operation. - * - * \note The input and output buffers must be large - * enough. For example, 128 Bytes if RSA-1024 is used. - * - * \note Blinding is used if and only if a PRNG is provided. - * - * \note If blinding is used, both the base of exponentation - * and the exponent are blinded, providing protection - * against some side-channel attacks. - * - * \warning It is deprecated and a security risk to not provide - * a PRNG here and thereby prevent the use of blinding. - * Future versions of the library may enforce the presence - * of a PRNG. - * - * \param ctx The RSA context. - * \param f_rng The RNG function. Needed for blinding. - * \param p_rng The RNG context. - * \param input The input buffer. - * \param output The output buffer. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - * - */ -int mbedtls_rsa_private( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - const unsigned char *input, - unsigned char *output ); - -/** - * \brief This function adds the message padding, then performs an RSA - * operation. - * - * It is the generic wrapper for performing a PKCS#1 encryption - * operation using the \p mode from the context. - * - * \note The input and output buffers must be as large as the size - * of \p ctx->N. For example, 128 Bytes if RSA-1024 is used. - * - * \deprecated It is deprecated and discouraged to call this function - * in #MBEDTLS_RSA_PRIVATE mode. Future versions of the library - * are likely to remove the \p mode argument and have it - * implicitly set to #MBEDTLS_RSA_PUBLIC. - * - * \note Alternative implementations of RSA need not support - * mode being set to #MBEDTLS_RSA_PRIVATE and might instead - * return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION. - * - * \param ctx The RSA context. - * \param f_rng The RNG function. Needed for padding, PKCS#1 v2.1 - * encoding, and #MBEDTLS_RSA_PRIVATE. - * \param p_rng The RNG context. - * \param mode #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE. - * \param ilen The length of the plaintext. - * \param input The buffer holding the data to encrypt. - * \param output The buffer used to hold the ciphertext. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_pkcs1_encrypt( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, size_t ilen, - const unsigned char *input, - unsigned char *output ); - -/** - * \brief This function performs a PKCS#1 v1.5 encryption operation - * (RSAES-PKCS1-v1_5-ENCRYPT). - * - * \note The output buffer must be as large as the size - * of \p ctx->N. For example, 128 Bytes if RSA-1024 is used. - * - * \deprecated It is deprecated and discouraged to call this function - * in #MBEDTLS_RSA_PRIVATE mode. Future versions of the library - * are likely to remove the \p mode argument and have it - * implicitly set to #MBEDTLS_RSA_PUBLIC. - * - * \note Alternative implementations of RSA need not support - * mode being set to #MBEDTLS_RSA_PRIVATE and might instead - * return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION. - * - * \param ctx The RSA context. - * \param f_rng The RNG function. Needed for padding and - * #MBEDTLS_RSA_PRIVATE. - * \param p_rng The RNG context. - * \param mode #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE. - * \param ilen The length of the plaintext. - * \param input The buffer holding the data to encrypt. - * \param output The buffer used to hold the ciphertext. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_rsaes_pkcs1_v15_encrypt( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, size_t ilen, - const unsigned char *input, - unsigned char *output ); - -/** - * \brief This function performs a PKCS#1 v2.1 OAEP encryption - * operation (RSAES-OAEP-ENCRYPT). - * - * \note The output buffer must be as large as the size - * of ctx->N. For example, 128 Bytes if RSA-1024 is used. - * - * \deprecated It is deprecated and discouraged to call this function - * in #MBEDTLS_RSA_PRIVATE mode. Future versions of the library - * are likely to remove the \p mode argument and have it - * implicitly set to #MBEDTLS_RSA_PUBLIC. - * - * \note Alternative implementations of RSA need not support - * mode being set to #MBEDTLS_RSA_PRIVATE and might instead - * return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION. - * - * \param ctx The RSA context. - * \param f_rng The RNG function. Needed for padding and PKCS#1 v2.1 - * encoding and #MBEDTLS_RSA_PRIVATE. - * \param p_rng The RNG context. - * \param mode #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE. - * \param label The buffer holding the custom label to use. - * \param label_len The length of the label. - * \param ilen The length of the plaintext. - * \param input The buffer holding the data to encrypt. - * \param output The buffer used to hold the ciphertext. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_rsaes_oaep_encrypt( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, - const unsigned char *label, size_t label_len, - size_t ilen, - const unsigned char *input, - unsigned char *output ); - -/** - * \brief This function performs an RSA operation, then removes the - * message padding. - * - * It is the generic wrapper for performing a PKCS#1 decryption - * operation using the \p mode from the context. - * - * \note The output buffer length \c output_max_len should be - * as large as the size \p ctx->len of \p ctx->N (for example, - * 128 Bytes if RSA-1024 is used) to be able to hold an - * arbitrary decrypted message. If it is not large enough to - * hold the decryption of the particular ciphertext provided, - * the function returns \c MBEDTLS_ERR_RSA_OUTPUT_TOO_LARGE. - * - * \note The input buffer must be as large as the size - * of \p ctx->N. For example, 128 Bytes if RSA-1024 is used. - * - * \deprecated It is deprecated and discouraged to call this function - * in #MBEDTLS_RSA_PUBLIC mode. Future versions of the library - * are likely to remove the \p mode argument and have it - * implicitly set to #MBEDTLS_RSA_PRIVATE. - * - * \note Alternative implementations of RSA need not support - * mode being set to #MBEDTLS_RSA_PUBLIC and might instead - * return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION. - * - * \param ctx The RSA context. - * \param f_rng The RNG function. Only needed for #MBEDTLS_RSA_PRIVATE. - * \param p_rng The RNG context. - * \param mode #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE. - * \param olen The length of the plaintext. - * \param input The buffer holding the encrypted data. - * \param output The buffer used to hold the plaintext. - * \param output_max_len The maximum length of the output buffer. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_pkcs1_decrypt( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, size_t *olen, - const unsigned char *input, - unsigned char *output, - size_t output_max_len ); - -/** - * \brief This function performs a PKCS#1 v1.5 decryption - * operation (RSAES-PKCS1-v1_5-DECRYPT). - * - * \note The output buffer length \c output_max_len should be - * as large as the size \p ctx->len of \p ctx->N, for example, - * 128 Bytes if RSA-1024 is used, to be able to hold an - * arbitrary decrypted message. If it is not large enough to - * hold the decryption of the particular ciphertext provided, - * the function returns #MBEDTLS_ERR_RSA_OUTPUT_TOO_LARGE. - * - * \note The input buffer must be as large as the size - * of \p ctx->N. For example, 128 Bytes if RSA-1024 is used. - * - * \deprecated It is deprecated and discouraged to call this function - * in #MBEDTLS_RSA_PUBLIC mode. Future versions of the library - * are likely to remove the \p mode argument and have it - * implicitly set to #MBEDTLS_RSA_PRIVATE. - * - * \note Alternative implementations of RSA need not support - * mode being set to #MBEDTLS_RSA_PUBLIC and might instead - * return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION. - * - * \param ctx The RSA context. - * \param f_rng The RNG function. Only needed for #MBEDTLS_RSA_PRIVATE. - * \param p_rng The RNG context. - * \param mode #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE. - * \param olen The length of the plaintext. - * \param input The buffer holding the encrypted data. - * \param output The buffer to hold the plaintext. - * \param output_max_len The maximum length of the output buffer. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - * - */ -int mbedtls_rsa_rsaes_pkcs1_v15_decrypt( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, size_t *olen, - const unsigned char *input, - unsigned char *output, - size_t output_max_len ); - -/** - * \brief This function performs a PKCS#1 v2.1 OAEP decryption - * operation (RSAES-OAEP-DECRYPT). - * - * \note The output buffer length \c output_max_len should be - * as large as the size \p ctx->len of \p ctx->N, for - * example, 128 Bytes if RSA-1024 is used, to be able to - * hold an arbitrary decrypted message. If it is not - * large enough to hold the decryption of the particular - * ciphertext provided, the function returns - * #MBEDTLS_ERR_RSA_OUTPUT_TOO_LARGE. - * - * \note The input buffer must be as large as the size - * of \p ctx->N. For example, 128 Bytes if RSA-1024 is used. - * - * \deprecated It is deprecated and discouraged to call this function - * in #MBEDTLS_RSA_PUBLIC mode. Future versions of the library - * are likely to remove the \p mode argument and have it - * implicitly set to #MBEDTLS_RSA_PRIVATE. - * - * \note Alternative implementations of RSA need not support - * mode being set to #MBEDTLS_RSA_PUBLIC and might instead - * return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION. - * - * \param ctx The RSA context. - * \param f_rng The RNG function. Only needed for #MBEDTLS_RSA_PRIVATE. - * \param p_rng The RNG context. - * \param mode #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE. - * \param label The buffer holding the custom label to use. - * \param label_len The length of the label. - * \param olen The length of the plaintext. - * \param input The buffer holding the encrypted data. - * \param output The buffer to hold the plaintext. - * \param output_max_len The maximum length of the output buffer. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_rsaes_oaep_decrypt( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, - const unsigned char *label, size_t label_len, - size_t *olen, - const unsigned char *input, - unsigned char *output, - size_t output_max_len ); - -/** - * \brief This function performs a private RSA operation to sign - * a message digest using PKCS#1. - * - * It is the generic wrapper for performing a PKCS#1 - * signature using the \p mode from the context. - * - * \note The \p sig buffer must be as large as the size - * of \p ctx->N. For example, 128 Bytes if RSA-1024 is used. - * - * \note For PKCS#1 v2.1 encoding, see comments on - * mbedtls_rsa_rsassa_pss_sign() for details on - * \p md_alg and \p hash_id. - * - * \deprecated It is deprecated and discouraged to call this function - * in #MBEDTLS_RSA_PUBLIC mode. Future versions of the library - * are likely to remove the \p mode argument and have it - * implicitly set to #MBEDTLS_RSA_PRIVATE. - * - * \note Alternative implementations of RSA need not support - * mode being set to #MBEDTLS_RSA_PUBLIC and might instead - * return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION. - * - * \param ctx The RSA context. - * \param f_rng The RNG function. Needed for PKCS#1 v2.1 encoding and for - * #MBEDTLS_RSA_PRIVATE. - * \param p_rng The RNG context. - * \param mode #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE. - * \param md_alg The message-digest algorithm used to hash the original data. - * Use #MBEDTLS_MD_NONE for signing raw data. - * \param hashlen The length of the message digest. Only used if \p md_alg is #MBEDTLS_MD_NONE. - * \param hash The buffer holding the message digest. - * \param sig The buffer to hold the ciphertext. - * - * \return \c 0 if the signing operation was successful. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_pkcs1_sign( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, - mbedtls_md_type_t md_alg, - unsigned int hashlen, - const unsigned char *hash, - unsigned char *sig ); - -/** - * \brief This function performs a PKCS#1 v1.5 signature - * operation (RSASSA-PKCS1-v1_5-SIGN). - * - * \note The \p sig buffer must be as large as the size - * of \p ctx->N. For example, 128 Bytes if RSA-1024 is used. - * - * \deprecated It is deprecated and discouraged to call this function - * in #MBEDTLS_RSA_PUBLIC mode. Future versions of the library - * are likely to remove the \p mode argument and have it - * implicitly set to #MBEDTLS_RSA_PRIVATE. - * - * \note Alternative implementations of RSA need not support - * mode being set to #MBEDTLS_RSA_PUBLIC and might instead - * return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION. - * - * \param ctx The RSA context. - * \param f_rng The RNG function. Only needed for #MBEDTLS_RSA_PRIVATE. - * \param p_rng The RNG context. - * \param mode #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE. - * \param md_alg The message-digest algorithm used to hash the original data. - * Use #MBEDTLS_MD_NONE for signing raw data. - * \param hashlen The length of the message digest. Only used if \p md_alg is #MBEDTLS_MD_NONE. - * \param hash The buffer holding the message digest. - * \param sig The buffer to hold the ciphertext. - * - * \return \c 0 if the signing operation was successful. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_rsassa_pkcs1_v15_sign( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, - mbedtls_md_type_t md_alg, - unsigned int hashlen, - const unsigned char *hash, - unsigned char *sig ); - -/** - * \brief This function performs a PKCS#1 v2.1 PSS signature - * operation (RSASSA-PSS-SIGN). - * - * \note The \p sig buffer must be as large as the size - * of \p ctx->N. For example, 128 Bytes if RSA-1024 is used. - * - * \note The \p hash_id in the RSA context is the one used for the - * encoding. \p md_alg in the function call is the type of hash - * that is encoded. According to RFC-3447: Public-Key - * Cryptography Standards (PKCS) #1 v2.1: RSA Cryptography - * Specifications it is advised to keep both hashes the - * same. - * - * \deprecated It is deprecated and discouraged to call this function - * in #MBEDTLS_RSA_PUBLIC mode. Future versions of the library - * are likely to remove the \p mode argument and have it - * implicitly set to #MBEDTLS_RSA_PRIVATE. - * - * \note Alternative implementations of RSA need not support - * mode being set to #MBEDTLS_RSA_PUBLIC and might instead - * return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION. - * - * \param ctx The RSA context. - * \param f_rng The RNG function. Needed for PKCS#1 v2.1 encoding and for - * #MBEDTLS_RSA_PRIVATE. - * \param p_rng The RNG context. - * \param mode #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE. - * \param md_alg The message-digest algorithm used to hash the original data. - * Use #MBEDTLS_MD_NONE for signing raw data. - * \param hashlen The length of the message digest. Only used if \p md_alg is #MBEDTLS_MD_NONE. - * \param hash The buffer holding the message digest. - * \param sig The buffer to hold the ciphertext. - * - * \return \c 0 if the signing operation was successful. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_rsassa_pss_sign( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, - mbedtls_md_type_t md_alg, - unsigned int hashlen, - const unsigned char *hash, - unsigned char *sig ); - -/** - * \brief This function performs a public RSA operation and checks - * the message digest. - * - * This is the generic wrapper for performing a PKCS#1 - * verification using the mode from the context. - * - * \note The \p sig buffer must be as large as the size - * of \p ctx->N. For example, 128 Bytes if RSA-1024 is used. - * - * \note For PKCS#1 v2.1 encoding, see comments on - * mbedtls_rsa_rsassa_pss_verify() about \p md_alg and - * \p hash_id. - * - * \deprecated It is deprecated and discouraged to call this function - * in #MBEDTLS_RSA_PRIVATE mode. Future versions of the library - * are likely to remove the \p mode argument and have it - * set to #MBEDTLS_RSA_PUBLIC. - * - * \note Alternative implementations of RSA need not support - * mode being set to #MBEDTLS_RSA_PRIVATE and might instead - * return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION. - * - * \param ctx The RSA public key context. - * \param f_rng The RNG function. Only needed for #MBEDTLS_RSA_PRIVATE. - * \param p_rng The RNG context. - * \param mode #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE. - * \param md_alg The message-digest algorithm used to hash the original data. - * Use #MBEDTLS_MD_NONE for signing raw data. - * \param hashlen The length of the message digest. Only used if \p md_alg is #MBEDTLS_MD_NONE. - * \param hash The buffer holding the message digest. - * \param sig The buffer holding the ciphertext. - * - * \return \c 0 if the verify operation was successful. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_pkcs1_verify( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, - mbedtls_md_type_t md_alg, - unsigned int hashlen, - const unsigned char *hash, - const unsigned char *sig ); - -/** - * \brief This function performs a PKCS#1 v1.5 verification - * operation (RSASSA-PKCS1-v1_5-VERIFY). - * - * \note The \p sig buffer must be as large as the size - * of \p ctx->N. For example, 128 Bytes if RSA-1024 is used. - * - * \deprecated It is deprecated and discouraged to call this function - * in #MBEDTLS_RSA_PRIVATE mode. Future versions of the library - * are likely to remove the \p mode argument and have it - * set to #MBEDTLS_RSA_PUBLIC. - * - * \note Alternative implementations of RSA need not support - * mode being set to #MBEDTLS_RSA_PRIVATE and might instead - * return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION. - * - * \param ctx The RSA public key context. - * \param f_rng The RNG function. Only needed for #MBEDTLS_RSA_PRIVATE. - * \param p_rng The RNG context. - * \param mode #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE. - * \param md_alg The message-digest algorithm used to hash the original data. - * Use #MBEDTLS_MD_NONE for signing raw data. - * \param hashlen The length of the message digest. Only used if \p md_alg is #MBEDTLS_MD_NONE. - * \param hash The buffer holding the message digest. - * \param sig The buffer holding the ciphertext. - * - * \return \c 0 if the verify operation was successful. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_rsassa_pkcs1_v15_verify( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, - mbedtls_md_type_t md_alg, - unsigned int hashlen, - const unsigned char *hash, - const unsigned char *sig ); - -/** - * \brief This function performs a PKCS#1 v2.1 PSS verification - * operation (RSASSA-PSS-VERIFY). - * - * The hash function for the MGF mask generating function - * is that specified in the RSA context. - * - * \note The \p sig buffer must be as large as the size - * of \p ctx->N. For example, 128 Bytes if RSA-1024 is used. - * - * \note The \p hash_id in the RSA context is the one used for the - * verification. \p md_alg in the function call is the type of - * hash that is verified. According to RFC-3447: Public-Key - * Cryptography Standards (PKCS) #1 v2.1: RSA Cryptography - * Specifications it is advised to keep both hashes the - * same. If \p hash_id in the RSA context is unset, - * the \p md_alg from the function call is used. - * - * \deprecated It is deprecated and discouraged to call this function - * in #MBEDTLS_RSA_PRIVATE mode. Future versions of the library - * are likely to remove the \p mode argument and have it - * implicitly set to #MBEDTLS_RSA_PUBLIC. - * - * \note Alternative implementations of RSA need not support - * mode being set to #MBEDTLS_RSA_PRIVATE and might instead - * return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION. - * - * \param ctx The RSA public key context. - * \param f_rng The RNG function. Only needed for #MBEDTLS_RSA_PRIVATE. - * \param p_rng The RNG context. - * \param mode #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE. - * \param md_alg The message-digest algorithm used to hash the original data. - * Use #MBEDTLS_MD_NONE for signing raw data. - * \param hashlen The length of the message digest. Only used if \p md_alg is #MBEDTLS_MD_NONE. - * \param hash The buffer holding the message digest. - * \param sig The buffer holding the ciphertext. - * - * \return \c 0 if the verify operation was successful. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_rsassa_pss_verify( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, - mbedtls_md_type_t md_alg, - unsigned int hashlen, - const unsigned char *hash, - const unsigned char *sig ); - -/** - * \brief This function performs a PKCS#1 v2.1 PSS verification - * operation (RSASSA-PSS-VERIFY). - * - * The hash function for the MGF mask generating function - * is that specified in \p mgf1_hash_id. - * - * \note The \p sig buffer must be as large as the size - * of \p ctx->N. For example, 128 Bytes if RSA-1024 is used. - * - * \note The \p hash_id in the RSA context is ignored. - * - * \param ctx The RSA public key context. - * \param f_rng The RNG function. Only needed for #MBEDTLS_RSA_PRIVATE. - * \param p_rng The RNG context. - * \param mode #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE. - * \param md_alg The message-digest algorithm used to hash the original data. - * Use #MBEDTLS_MD_NONE for signing raw data. - * \param hashlen The length of the message digest. Only used if \p md_alg is - * #MBEDTLS_MD_NONE. - * \param hash The buffer holding the message digest. - * \param mgf1_hash_id The message digest used for mask generation. - * \param expected_salt_len The length of the salt used in padding. Use - * #MBEDTLS_RSA_SALT_LEN_ANY to accept any salt length. - * \param sig The buffer holding the ciphertext. - * - * \return \c 0 if the verify operation was successful. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_rsassa_pss_verify_ext( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, - mbedtls_md_type_t md_alg, - unsigned int hashlen, - const unsigned char *hash, - mbedtls_md_type_t mgf1_hash_id, - int expected_salt_len, - const unsigned char *sig ); - -/** - * \brief This function copies the components of an RSA context. - * - * \param dst The destination context. - * \param src The source context. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory allocation failure. - */ -int mbedtls_rsa_copy( mbedtls_rsa_context *dst, const mbedtls_rsa_context *src ); - -/** - * \brief This function frees the components of an RSA key. - * - * \param ctx The RSA Context to free. - */ -void mbedtls_rsa_free( mbedtls_rsa_context *ctx ); - -/** - * \brief The RSA checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_rsa_self_test( int verbose ); - -#ifdef __cplusplus -} -#endif - -#endif /* rsa.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/rsa_internal.h b/tools/sdk/include/mbedtls/mbedtls/rsa_internal.h deleted file mode 100644 index 53abd3c5b0e..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/rsa_internal.h +++ /dev/null @@ -1,226 +0,0 @@ -/** - * \file rsa_internal.h - * - * \brief Context-independent RSA helper functions - * - * This module declares some RSA-related helper functions useful when - * implementing the RSA interface. These functions are provided in a separate - * compilation unit in order to make it easy for designers of alternative RSA - * implementations to use them in their own code, as it is conceived that the - * functionality they provide will be necessary for most complete - * implementations. - * - * End-users of Mbed TLS who are not providing their own alternative RSA - * implementations should not use these functions directly, and should instead - * use only the functions declared in rsa.h. - * - * The interface provided by this module will be maintained through LTS (Long - * Term Support) branches of Mbed TLS, but may otherwise be subject to change, - * and must be considered an internal interface of the library. - * - * There are two classes of helper functions: - * - * (1) Parameter-generating helpers. These are: - * - mbedtls_rsa_deduce_primes - * - mbedtls_rsa_deduce_private_exponent - * - mbedtls_rsa_deduce_crt - * Each of these functions takes a set of core RSA parameters and - * generates some other, or CRT related parameters. - * - * (2) Parameter-checking helpers. These are: - * - mbedtls_rsa_validate_params - * - mbedtls_rsa_validate_crt - * They take a set of core or CRT related RSA parameters and check their - * validity. - * - */ -/* - * Copyright (C) 2006-2017, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - * - */ - -#ifndef MBEDTLS_RSA_INTERNAL_H -#define MBEDTLS_RSA_INTERNAL_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "bignum.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -/** - * \brief Compute RSA prime moduli P, Q from public modulus N=PQ - * and a pair of private and public key. - * - * \note This is a 'static' helper function not operating on - * an RSA context. Alternative implementations need not - * overwrite it. - * - * \param N RSA modulus N = PQ, with P, Q to be found - * \param E RSA public exponent - * \param D RSA private exponent - * \param P Pointer to MPI holding first prime factor of N on success - * \param Q Pointer to MPI holding second prime factor of N on success - * - * \return - * - 0 if successful. In this case, P and Q constitute a - * factorization of N. - * - A non-zero error code otherwise. - * - * \note It is neither checked that P, Q are prime nor that - * D, E are modular inverses wrt. P-1 and Q-1. For that, - * use the helper function \c mbedtls_rsa_validate_params. - * - */ -int mbedtls_rsa_deduce_primes( mbedtls_mpi const *N, mbedtls_mpi const *E, - mbedtls_mpi const *D, - mbedtls_mpi *P, mbedtls_mpi *Q ); - -/** - * \brief Compute RSA private exponent from - * prime moduli and public key. - * - * \note This is a 'static' helper function not operating on - * an RSA context. Alternative implementations need not - * overwrite it. - * - * \param P First prime factor of RSA modulus - * \param Q Second prime factor of RSA modulus - * \param E RSA public exponent - * \param D Pointer to MPI holding the private exponent on success. - * - * \return - * - 0 if successful. In this case, D is set to a simultaneous - * modular inverse of E modulo both P-1 and Q-1. - * - A non-zero error code otherwise. - * - * \note This function does not check whether P and Q are primes. - * - */ -int mbedtls_rsa_deduce_private_exponent( mbedtls_mpi const *P, - mbedtls_mpi const *Q, - mbedtls_mpi const *E, - mbedtls_mpi *D ); - - -/** - * \brief Generate RSA-CRT parameters - * - * \note This is a 'static' helper function not operating on - * an RSA context. Alternative implementations need not - * overwrite it. - * - * \param P First prime factor of N - * \param Q Second prime factor of N - * \param D RSA private exponent - * \param DP Output variable for D modulo P-1 - * \param DQ Output variable for D modulo Q-1 - * \param QP Output variable for the modular inverse of Q modulo P. - * - * \return 0 on success, non-zero error code otherwise. - * - * \note This function does not check whether P, Q are - * prime and whether D is a valid private exponent. - * - */ -int mbedtls_rsa_deduce_crt( const mbedtls_mpi *P, const mbedtls_mpi *Q, - const mbedtls_mpi *D, mbedtls_mpi *DP, - mbedtls_mpi *DQ, mbedtls_mpi *QP ); - - -/** - * \brief Check validity of core RSA parameters - * - * \note This is a 'static' helper function not operating on - * an RSA context. Alternative implementations need not - * overwrite it. - * - * \param N RSA modulus N = PQ - * \param P First prime factor of N - * \param Q Second prime factor of N - * \param D RSA private exponent - * \param E RSA public exponent - * \param f_rng PRNG to be used for primality check, or NULL - * \param p_rng PRNG context for f_rng, or NULL - * - * \return - * - 0 if the following conditions are satisfied - * if all relevant parameters are provided: - * - P prime if f_rng != NULL (%) - * - Q prime if f_rng != NULL (%) - * - 1 < N = P * Q - * - 1 < D, E < N - * - D and E are modular inverses modulo P-1 and Q-1 - * (%) This is only done if MBEDTLS_GENPRIME is defined. - * - A non-zero error code otherwise. - * - * \note The function can be used with a restricted set of arguments - * to perform specific checks only. E.g., calling it with - * (-,P,-,-,-) and a PRNG amounts to a primality check for P. - */ -int mbedtls_rsa_validate_params( const mbedtls_mpi *N, const mbedtls_mpi *P, - const mbedtls_mpi *Q, const mbedtls_mpi *D, - const mbedtls_mpi *E, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief Check validity of RSA CRT parameters - * - * \note This is a 'static' helper function not operating on - * an RSA context. Alternative implementations need not - * overwrite it. - * - * \param P First prime factor of RSA modulus - * \param Q Second prime factor of RSA modulus - * \param D RSA private exponent - * \param DP MPI to check for D modulo P-1 - * \param DQ MPI to check for D modulo P-1 - * \param QP MPI to check for the modular inverse of Q modulo P. - * - * \return - * - 0 if the following conditions are satisfied: - * - D = DP mod P-1 if P, D, DP != NULL - * - Q = DQ mod P-1 if P, D, DQ != NULL - * - QP = Q^-1 mod P if P, Q, QP != NULL - * - \c MBEDTLS_ERR_RSA_KEY_CHECK_FAILED if check failed, - * potentially including \c MBEDTLS_ERR_MPI_XXX if some - * MPI calculations failed. - * - \c MBEDTLS_ERR_RSA_BAD_INPUT_DATA if insufficient - * data was provided to check DP, DQ or QP. - * - * \note The function can be used with a restricted set of arguments - * to perform specific checks only. E.g., calling it with the - * parameters (P, -, D, DP, -, -) will check DP = D mod P-1. - */ -int mbedtls_rsa_validate_crt( const mbedtls_mpi *P, const mbedtls_mpi *Q, - const mbedtls_mpi *D, const mbedtls_mpi *DP, - const mbedtls_mpi *DQ, const mbedtls_mpi *QP ); - -#ifdef __cplusplus -} -#endif - -#endif /* rsa_internal.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/sha1.h b/tools/sdk/include/mbedtls/mbedtls/sha1.h deleted file mode 100644 index 7a19da0a485..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/sha1.h +++ /dev/null @@ -1,324 +0,0 @@ -/** - * \file sha1.h - * - * \brief This file contains SHA-1 definitions and functions. - * - * The Secure Hash Algorithm 1 (SHA-1) cryptographic hash function is defined in - * FIPS 180-4: Secure Hash Standard (SHS). - * - * \warning SHA-1 is considered a weak message digest and its use constitutes - * a security risk. We recommend considering stronger message - * digests instead. - */ -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_SHA1_H -#define MBEDTLS_SHA1_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -#define MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED -0x0035 /**< SHA-1 hardware accelerator failed */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_SHA1_ALT) -// Regular implementation -// - -/** - * \brief The SHA-1 context structure. - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -typedef struct mbedtls_sha1_context -{ - uint32_t total[2]; /*!< The number of Bytes processed. */ - uint32_t state[5]; /*!< The intermediate digest state. */ - unsigned char buffer[64]; /*!< The data block being processed. */ -} -mbedtls_sha1_context; - -#else /* MBEDTLS_SHA1_ALT */ -#include "sha1_alt.h" -#endif /* MBEDTLS_SHA1_ALT */ - -/** - * \brief This function initializes a SHA-1 context. - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \param ctx The SHA-1 context to initialize. - * - */ -void mbedtls_sha1_init( mbedtls_sha1_context *ctx ); - -/** - * \brief This function clears a SHA-1 context. - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \param ctx The SHA-1 context to clear. - * - */ -void mbedtls_sha1_free( mbedtls_sha1_context *ctx ); - -/** - * \brief This function clones the state of a SHA-1 context. - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \param dst The SHA-1 context to clone to. - * \param src The SHA-1 context to clone from. - * - */ -void mbedtls_sha1_clone( mbedtls_sha1_context *dst, - const mbedtls_sha1_context *src ); - -/** - * \brief This function starts a SHA-1 checksum calculation. - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \param ctx The SHA-1 context to initialize. - * - * \return \c 0 on success. - * - */ -int mbedtls_sha1_starts_ret( mbedtls_sha1_context *ctx ); - -/** - * \brief This function feeds an input buffer into an ongoing SHA-1 - * checksum calculation. - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \param ctx The SHA-1 context. - * \param input The buffer holding the input data. - * \param ilen The length of the input data. - * - * \return \c 0 on success. - */ -int mbedtls_sha1_update_ret( mbedtls_sha1_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief This function finishes the SHA-1 operation, and writes - * the result to the output buffer. - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \param ctx The SHA-1 context. - * \param output The SHA-1 checksum result. - * - * \return \c 0 on success. - */ -int mbedtls_sha1_finish_ret( mbedtls_sha1_context *ctx, - unsigned char output[20] ); - -/** - * \brief SHA-1 process data block (internal use only). - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \param ctx The SHA-1 context. - * \param data The data block being processed. - * - * \return \c 0 on success. - * - */ -int mbedtls_internal_sha1_process( mbedtls_sha1_context *ctx, - const unsigned char data[64] ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief This function starts a SHA-1 checksum calculation. - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \deprecated Superseded by mbedtls_sha1_starts_ret() in 2.7.0. - * - * \param ctx The SHA-1 context to initialize. - * - */ -MBEDTLS_DEPRECATED void mbedtls_sha1_starts( mbedtls_sha1_context *ctx ); - -/** - * \brief This function feeds an input buffer into an ongoing SHA-1 - * checksum calculation. - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \deprecated Superseded by mbedtls_sha1_update_ret() in 2.7.0. - * - * \param ctx The SHA-1 context. - * \param input The buffer holding the input data. - * \param ilen The length of the input data. - * - */ -MBEDTLS_DEPRECATED void mbedtls_sha1_update( mbedtls_sha1_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief This function finishes the SHA-1 operation, and writes - * the result to the output buffer. - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \deprecated Superseded by mbedtls_sha1_finish_ret() in 2.7.0. - * - * \param ctx The SHA-1 context. - * \param output The SHA-1 checksum result. - * - */ -MBEDTLS_DEPRECATED void mbedtls_sha1_finish( mbedtls_sha1_context *ctx, - unsigned char output[20] ); - -/** - * \brief SHA-1 process data block (internal use only). - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \deprecated Superseded by mbedtls_internal_sha1_process() in 2.7.0. - * - * \param ctx The SHA-1 context. - * \param data The data block being processed. - * - */ -MBEDTLS_DEPRECATED void mbedtls_sha1_process( mbedtls_sha1_context *ctx, - const unsigned char data[64] ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief This function calculates the SHA-1 checksum of a buffer. - * - * The function allocates the context, performs the - * calculation, and frees the context. - * - * The SHA-1 result is calculated as - * output = SHA-1(input buffer). - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \param input The buffer holding the input data. - * \param ilen The length of the input data. - * \param output The SHA-1 checksum result. - * - * \return \c 0 on success. - * - */ -int mbedtls_sha1_ret( const unsigned char *input, - size_t ilen, - unsigned char output[20] ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief This function calculates the SHA-1 checksum of a buffer. - * - * The function allocates the context, performs the - * calculation, and frees the context. - * - * The SHA-1 result is calculated as - * output = SHA-1(input buffer). - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \deprecated Superseded by mbedtls_sha1_ret() in 2.7.0 - * - * \param input The buffer holding the input data. - * \param ilen The length of the input data. - * \param output The SHA-1 checksum result. - * - */ -MBEDTLS_DEPRECATED void mbedtls_sha1( const unsigned char *input, - size_t ilen, - unsigned char output[20] ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief The SHA-1 checkup routine. - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \return \c 0 on success. - * \return \c 1 on failure. - * - */ -int mbedtls_sha1_self_test( int verbose ); - -#ifdef __cplusplus -} -#endif - -#endif /* mbedtls_sha1.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/sha256.h b/tools/sdk/include/mbedtls/mbedtls/sha256.h deleted file mode 100644 index 33aff28314a..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/sha256.h +++ /dev/null @@ -1,272 +0,0 @@ -/** - * \file sha256.h - * - * \brief This file contains SHA-224 and SHA-256 definitions and functions. - * - * The Secure Hash Algorithms 224 and 256 (SHA-224 and SHA-256) cryptographic - * hash functions are defined in FIPS 180-4: Secure Hash Standard (SHS). - */ -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_SHA256_H -#define MBEDTLS_SHA256_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -#define MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED -0x0037 /**< SHA-256 hardware accelerator failed */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_SHA256_ALT) -// Regular implementation -// - -/** - * \brief The SHA-256 context structure. - * - * The structure is used both for SHA-256 and for SHA-224 - * checksum calculations. The choice between these two is - * made in the call to mbedtls_sha256_starts_ret(). - */ -typedef struct mbedtls_sha256_context -{ - uint32_t total[2]; /*!< The number of Bytes processed. */ - uint32_t state[8]; /*!< The intermediate digest state. */ - unsigned char buffer[64]; /*!< The data block being processed. */ - int is224; /*!< Determines which function to use: - 0: Use SHA-256, or 1: Use SHA-224. */ -} -mbedtls_sha256_context; - -#else /* MBEDTLS_SHA256_ALT */ -#include "sha256_alt.h" -#endif /* MBEDTLS_SHA256_ALT */ - -/** - * \brief This function initializes a SHA-256 context. - * - * \param ctx The SHA-256 context to initialize. - */ -void mbedtls_sha256_init( mbedtls_sha256_context *ctx ); - -/** - * \brief This function clears a SHA-256 context. - * - * \param ctx The SHA-256 context to clear. - */ -void mbedtls_sha256_free( mbedtls_sha256_context *ctx ); - -/** - * \brief This function clones the state of a SHA-256 context. - * - * \param dst The destination context. - * \param src The context to clone. - */ -void mbedtls_sha256_clone( mbedtls_sha256_context *dst, - const mbedtls_sha256_context *src ); - -/** - * \brief This function starts a SHA-224 or SHA-256 checksum - * calculation. - * - * \param ctx The context to initialize. - * \param is224 Determines which function to use: - * 0: Use SHA-256, or 1: Use SHA-224. - * - * \return \c 0 on success. - */ -int mbedtls_sha256_starts_ret( mbedtls_sha256_context *ctx, int is224 ); - -/** - * \brief This function feeds an input buffer into an ongoing - * SHA-256 checksum calculation. - * - * \param ctx The SHA-256 context. - * \param input The buffer holding the data. - * \param ilen The length of the input data. - * - * \return \c 0 on success. - */ -int mbedtls_sha256_update_ret( mbedtls_sha256_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief This function finishes the SHA-256 operation, and writes - * the result to the output buffer. - * - * \param ctx The SHA-256 context. - * \param output The SHA-224 or SHA-256 checksum result. - * - * \return \c 0 on success. - */ -int mbedtls_sha256_finish_ret( mbedtls_sha256_context *ctx, - unsigned char output[32] ); - -/** - * \brief This function processes a single data block within - * the ongoing SHA-256 computation. This function is for - * internal use only. - * - * \param ctx The SHA-256 context. - * \param data The buffer holding one block of data. - * - * \return \c 0 on success. - */ -int mbedtls_internal_sha256_process( mbedtls_sha256_context *ctx, - const unsigned char data[64] ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief This function starts a SHA-224 or SHA-256 checksum - * calculation. - * - * - * \deprecated Superseded by mbedtls_sha256_starts_ret() in 2.7.0. - * - * \param ctx The context to initialize. - * \param is224 Determines which function to use: - * 0: Use SHA-256, or 1: Use SHA-224. - */ -MBEDTLS_DEPRECATED void mbedtls_sha256_starts( mbedtls_sha256_context *ctx, - int is224 ); - -/** - * \brief This function feeds an input buffer into an ongoing - * SHA-256 checksum calculation. - * - * \deprecated Superseded by mbedtls_sha256_update_ret() in 2.7.0. - * - * \param ctx The SHA-256 context to initialize. - * \param input The buffer holding the data. - * \param ilen The length of the input data. - */ -MBEDTLS_DEPRECATED void mbedtls_sha256_update( mbedtls_sha256_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief This function finishes the SHA-256 operation, and writes - * the result to the output buffer. - * - * \deprecated Superseded by mbedtls_sha256_finish_ret() in 2.7.0. - * - * \param ctx The SHA-256 context. - * \param output The SHA-224 or SHA-256 checksum result. - */ -MBEDTLS_DEPRECATED void mbedtls_sha256_finish( mbedtls_sha256_context *ctx, - unsigned char output[32] ); - -/** - * \brief This function processes a single data block within - * the ongoing SHA-256 computation. This function is for - * internal use only. - * - * \deprecated Superseded by mbedtls_internal_sha256_process() in 2.7.0. - * - * \param ctx The SHA-256 context. - * \param data The buffer holding one block of data. - */ -MBEDTLS_DEPRECATED void mbedtls_sha256_process( mbedtls_sha256_context *ctx, - const unsigned char data[64] ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief This function calculates the SHA-224 or SHA-256 - * checksum of a buffer. - * - * The function allocates the context, performs the - * calculation, and frees the context. - * - * The SHA-256 result is calculated as - * output = SHA-256(input buffer). - * - * \param input The buffer holding the input data. - * \param ilen The length of the input data. - * \param output The SHA-224 or SHA-256 checksum result. - * \param is224 Determines which function to use: - * 0: Use SHA-256, or 1: Use SHA-224. - */ -int mbedtls_sha256_ret( const unsigned char *input, - size_t ilen, - unsigned char output[32], - int is224 ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif - -/** - * \brief This function calculates the SHA-224 or SHA-256 checksum - * of a buffer. - * - * The function allocates the context, performs the - * calculation, and frees the context. - * - * The SHA-256 result is calculated as - * output = SHA-256(input buffer). - * - * \deprecated Superseded by mbedtls_sha256_ret() in 2.7.0. - * - * \param input The buffer holding the data. - * \param ilen The length of the input data. - * \param output The SHA-224 or SHA-256 checksum result. - * \param is224 Determines which function to use: - * 0: Use SHA-256, or 1: Use SHA-224. - */ -MBEDTLS_DEPRECATED void mbedtls_sha256( const unsigned char *input, - size_t ilen, - unsigned char output[32], - int is224 ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief The SHA-224 and SHA-256 checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_sha256_self_test( int verbose ); - -#ifdef __cplusplus -} -#endif - -#endif /* mbedtls_sha256.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/sha512.h b/tools/sdk/include/mbedtls/mbedtls/sha512.h deleted file mode 100644 index 0145890424f..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/sha512.h +++ /dev/null @@ -1,270 +0,0 @@ -/** - * \file sha512.h - * \brief This file contains SHA-384 and SHA-512 definitions and functions. - * - * The Secure Hash Algorithms 384 and 512 (SHA-384 and SHA-512) cryptographic - * hash functions are defined in FIPS 180-4: Secure Hash Standard (SHS). - */ -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_SHA512_H -#define MBEDTLS_SHA512_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -#define MBEDTLS_ERR_SHA512_HW_ACCEL_FAILED -0x0039 /**< SHA-512 hardware accelerator failed */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_SHA512_ALT) -// Regular implementation -// - -/** - * \brief The SHA-512 context structure. - * - * The structure is used both for SHA-384 and for SHA-512 - * checksum calculations. The choice between these two is - * made in the call to mbedtls_sha512_starts_ret(). - */ -typedef struct mbedtls_sha512_context -{ - uint64_t total[2]; /*!< The number of Bytes processed. */ - uint64_t state[8]; /*!< The intermediate digest state. */ - unsigned char buffer[128]; /*!< The data block being processed. */ - int is384; /*!< Determines which function to use: - 0: Use SHA-512, or 1: Use SHA-384. */ -} -mbedtls_sha512_context; - -#else /* MBEDTLS_SHA512_ALT */ -#include "sha512_alt.h" -#endif /* MBEDTLS_SHA512_ALT */ - -/** - * \brief This function initializes a SHA-512 context. - * - * \param ctx The SHA-512 context to initialize. - */ -void mbedtls_sha512_init( mbedtls_sha512_context *ctx ); - -/** - * \brief This function clears a SHA-512 context. - * - * \param ctx The SHA-512 context to clear. - */ -void mbedtls_sha512_free( mbedtls_sha512_context *ctx ); - -/** - * \brief This function clones the state of a SHA-512 context. - * - * \param dst The destination context. - * \param src The context to clone. - */ -void mbedtls_sha512_clone( mbedtls_sha512_context *dst, - const mbedtls_sha512_context *src ); - -/** - * \brief This function starts a SHA-384 or SHA-512 checksum - * calculation. - * - * \param ctx The SHA-512 context to initialize. - * \param is384 Determines which function to use: - * 0: Use SHA-512, or 1: Use SHA-384. - * - * \return \c 0 on success. - */ -int mbedtls_sha512_starts_ret( mbedtls_sha512_context *ctx, int is384 ); - -/** - * \brief This function feeds an input buffer into an ongoing - * SHA-512 checksum calculation. - * - * \param ctx The SHA-512 context. - * \param input The buffer holding the input data. - * \param ilen The length of the input data. - * - * \return \c 0 on success. - */ -int mbedtls_sha512_update_ret( mbedtls_sha512_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief This function finishes the SHA-512 operation, and writes - * the result to the output buffer. This function is for - * internal use only. - * - * \param ctx The SHA-512 context. - * \param output The SHA-384 or SHA-512 checksum result. - * - * \return \c 0 on success. - */ -int mbedtls_sha512_finish_ret( mbedtls_sha512_context *ctx, - unsigned char output[64] ); - -/** - * \brief This function processes a single data block within - * the ongoing SHA-512 computation. - * - * \param ctx The SHA-512 context. - * \param data The buffer holding one block of data. - * - * \return \c 0 on success. - */ -int mbedtls_internal_sha512_process( mbedtls_sha512_context *ctx, - const unsigned char data[128] ); -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief This function starts a SHA-384 or SHA-512 checksum - * calculation. - * - * \deprecated Superseded by mbedtls_sha512_starts_ret() in 2.7.0 - * - * \param ctx The SHA-512 context to initialize. - * \param is384 Determines which function to use: - * 0: Use SHA-512, or 1: Use SHA-384. - */ -MBEDTLS_DEPRECATED void mbedtls_sha512_starts( mbedtls_sha512_context *ctx, - int is384 ); - -/** - * \brief This function feeds an input buffer into an ongoing - * SHA-512 checksum calculation. - * - * \deprecated Superseded by mbedtls_sha512_update_ret() in 2.7.0. - * - * \param ctx The SHA-512 context. - * \param input The buffer holding the data. - * \param ilen The length of the input data. - */ -MBEDTLS_DEPRECATED void mbedtls_sha512_update( mbedtls_sha512_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief This function finishes the SHA-512 operation, and writes - * the result to the output buffer. - * - * \deprecated Superseded by mbedtls_sha512_finish_ret() in 2.7.0. - * - * \param ctx The SHA-512 context. - * \param output The SHA-384 or SHA-512 checksum result. - */ -MBEDTLS_DEPRECATED void mbedtls_sha512_finish( mbedtls_sha512_context *ctx, - unsigned char output[64] ); - -/** - * \brief This function processes a single data block within - * the ongoing SHA-512 computation. This function is for - * internal use only. - * - * \deprecated Superseded by mbedtls_internal_sha512_process() in 2.7.0. - * - * \param ctx The SHA-512 context. - * \param data The buffer holding one block of data. - */ -MBEDTLS_DEPRECATED void mbedtls_sha512_process( - mbedtls_sha512_context *ctx, - const unsigned char data[128] ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief This function calculates the SHA-512 or SHA-384 - * checksum of a buffer. - * - * The function allocates the context, performs the - * calculation, and frees the context. - * - * The SHA-512 result is calculated as - * output = SHA-512(input buffer). - * - * \param input The buffer holding the input data. - * \param ilen The length of the input data. - * \param output The SHA-384 or SHA-512 checksum result. - * \param is384 Determines which function to use: - * 0: Use SHA-512, or 1: Use SHA-384. - * - * \return \c 0 on success. - */ -int mbedtls_sha512_ret( const unsigned char *input, - size_t ilen, - unsigned char output[64], - int is384 ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief This function calculates the SHA-512 or SHA-384 - * checksum of a buffer. - * - * The function allocates the context, performs the - * calculation, and frees the context. - * - * The SHA-512 result is calculated as - * output = SHA-512(input buffer). - * - * \deprecated Superseded by mbedtls_sha512_ret() in 2.7.0 - * - * \param input The buffer holding the data. - * \param ilen The length of the input data. - * \param output The SHA-384 or SHA-512 checksum result. - * \param is384 Determines which function to use: - * 0: Use SHA-512, or 1: Use SHA-384. - */ -MBEDTLS_DEPRECATED void mbedtls_sha512( const unsigned char *input, - size_t ilen, - unsigned char output[64], - int is384 ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - /** - * \brief The SHA-384 or SHA-512 checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_sha512_self_test( int verbose ); - -#ifdef __cplusplus -} -#endif - -#endif /* mbedtls_sha512.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/ssl.h b/tools/sdk/include/mbedtls/mbedtls/ssl.h deleted file mode 100644 index 83849a56450..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/ssl.h +++ /dev/null @@ -1,3193 +0,0 @@ -/** - * \file ssl.h - * - * \brief SSL/TLS functions. - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_SSL_H -#define MBEDTLS_SSL_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "bignum.h" -#include "ecp.h" - -#include "ssl_ciphersuites.h" - -#if defined(MBEDTLS_X509_CRT_PARSE_C) -#include "x509_crt.h" -#include "x509_crl.h" -#endif - -#if defined(MBEDTLS_DHM_C) -#include "dhm.h" -#endif - -#if defined(MBEDTLS_ECDH_C) -#include "ecdh.h" -#endif - -#if defined(MBEDTLS_ZLIB_SUPPORT) - -#if defined(MBEDTLS_DEPRECATED_WARNING) -#warning "Record compression support via MBEDTLS_ZLIB_SUPPORT is deprecated and will be removed in the next major revision of the library" -#endif - -#if defined(MBEDTLS_DEPRECATED_REMOVED) -#error "Record compression support via MBEDTLS_ZLIB_SUPPORT is deprecated and cannot be used if MBEDTLS_DEPRECATED_REMOVED is set" -#endif - -#include "zlib.h" -#endif - -#if defined(MBEDTLS_HAVE_TIME) -#include "platform_time.h" -#endif - -/* - * SSL Error codes - */ -#define MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE -0x7080 /**< The requested feature is not available. */ -#define MBEDTLS_ERR_SSL_BAD_INPUT_DATA -0x7100 /**< Bad input parameters to function. */ -#define MBEDTLS_ERR_SSL_INVALID_MAC -0x7180 /**< Verification of the message MAC failed. */ -#define MBEDTLS_ERR_SSL_INVALID_RECORD -0x7200 /**< An invalid SSL record was received. */ -#define MBEDTLS_ERR_SSL_CONN_EOF -0x7280 /**< The connection indicated an EOF. */ -#define MBEDTLS_ERR_SSL_UNKNOWN_CIPHER -0x7300 /**< An unknown cipher was received. */ -#define MBEDTLS_ERR_SSL_NO_CIPHER_CHOSEN -0x7380 /**< The server has no ciphersuites in common with the client. */ -#define MBEDTLS_ERR_SSL_NO_RNG -0x7400 /**< No RNG was provided to the SSL module. */ -#define MBEDTLS_ERR_SSL_NO_CLIENT_CERTIFICATE -0x7480 /**< No client certification received from the client, but required by the authentication mode. */ -#define MBEDTLS_ERR_SSL_CERTIFICATE_TOO_LARGE -0x7500 /**< Our own certificate(s) is/are too large to send in an SSL message. */ -#define MBEDTLS_ERR_SSL_CERTIFICATE_REQUIRED -0x7580 /**< The own certificate is not set, but needed by the server. */ -#define MBEDTLS_ERR_SSL_PRIVATE_KEY_REQUIRED -0x7600 /**< The own private key or pre-shared key is not set, but needed. */ -#define MBEDTLS_ERR_SSL_CA_CHAIN_REQUIRED -0x7680 /**< No CA Chain is set, but required to operate. */ -#define MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE -0x7700 /**< An unexpected message was received from our peer. */ -#define MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE -0x7780 /**< A fatal alert message was received from our peer. */ -#define MBEDTLS_ERR_SSL_PEER_VERIFY_FAILED -0x7800 /**< Verification of our peer failed. */ -#define MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY -0x7880 /**< The peer notified us that the connection is going to be closed. */ -#define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_HELLO -0x7900 /**< Processing of the ClientHello handshake message failed. */ -#define MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO -0x7980 /**< Processing of the ServerHello handshake message failed. */ -#define MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE -0x7A00 /**< Processing of the Certificate handshake message failed. */ -#define MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_REQUEST -0x7A80 /**< Processing of the CertificateRequest handshake message failed. */ -#define MBEDTLS_ERR_SSL_BAD_HS_SERVER_KEY_EXCHANGE -0x7B00 /**< Processing of the ServerKeyExchange handshake message failed. */ -#define MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO_DONE -0x7B80 /**< Processing of the ServerHelloDone handshake message failed. */ -#define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE -0x7C00 /**< Processing of the ClientKeyExchange handshake message failed. */ -#define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_RP -0x7C80 /**< Processing of the ClientKeyExchange handshake message failed in DHM / ECDH Read Public. */ -#define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_CS -0x7D00 /**< Processing of the ClientKeyExchange handshake message failed in DHM / ECDH Calculate Secret. */ -#define MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_VERIFY -0x7D80 /**< Processing of the CertificateVerify handshake message failed. */ -#define MBEDTLS_ERR_SSL_BAD_HS_CHANGE_CIPHER_SPEC -0x7E00 /**< Processing of the ChangeCipherSpec handshake message failed. */ -#define MBEDTLS_ERR_SSL_BAD_HS_FINISHED -0x7E80 /**< Processing of the Finished handshake message failed. */ -#define MBEDTLS_ERR_SSL_ALLOC_FAILED -0x7F00 /**< Memory allocation failed */ -#define MBEDTLS_ERR_SSL_HW_ACCEL_FAILED -0x7F80 /**< Hardware acceleration function returned with error */ -#define MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH -0x6F80 /**< Hardware acceleration function skipped / left alone data */ -#define MBEDTLS_ERR_SSL_COMPRESSION_FAILED -0x6F00 /**< Processing of the compression / decompression failed */ -#define MBEDTLS_ERR_SSL_BAD_HS_PROTOCOL_VERSION -0x6E80 /**< Handshake protocol not within min/max boundaries */ -#define MBEDTLS_ERR_SSL_BAD_HS_NEW_SESSION_TICKET -0x6E00 /**< Processing of the NewSessionTicket handshake message failed. */ -#define MBEDTLS_ERR_SSL_SESSION_TICKET_EXPIRED -0x6D80 /**< Session ticket has expired. */ -#define MBEDTLS_ERR_SSL_PK_TYPE_MISMATCH -0x6D00 /**< Public key type mismatch (eg, asked for RSA key exchange and presented EC key) */ -#define MBEDTLS_ERR_SSL_UNKNOWN_IDENTITY -0x6C80 /**< Unknown identity received (eg, PSK identity) */ -#define MBEDTLS_ERR_SSL_INTERNAL_ERROR -0x6C00 /**< Internal error (eg, unexpected failure in lower-level module) */ -#define MBEDTLS_ERR_SSL_COUNTER_WRAPPING -0x6B80 /**< A counter would wrap (eg, too many messages exchanged). */ -#define MBEDTLS_ERR_SSL_WAITING_SERVER_HELLO_RENEGO -0x6B00 /**< Unexpected message at ServerHello in renegotiation. */ -#define MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED -0x6A80 /**< DTLS client must retry for hello verification */ -#define MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL -0x6A00 /**< A buffer is too small to receive or write a message */ -#define MBEDTLS_ERR_SSL_NO_USABLE_CIPHERSUITE -0x6980 /**< None of the common ciphersuites is usable (eg, no suitable certificate, see debug messages). */ -#define MBEDTLS_ERR_SSL_WANT_READ -0x6900 /**< No data of requested type currently available on underlying transport. */ -#define MBEDTLS_ERR_SSL_WANT_WRITE -0x6880 /**< Connection requires a write call. */ -#define MBEDTLS_ERR_SSL_TIMEOUT -0x6800 /**< The operation timed out. */ -#define MBEDTLS_ERR_SSL_CLIENT_RECONNECT -0x6780 /**< The client initiated a reconnect from the same port. */ -#define MBEDTLS_ERR_SSL_UNEXPECTED_RECORD -0x6700 /**< Record header looks valid but is not expected. */ -#define MBEDTLS_ERR_SSL_NON_FATAL -0x6680 /**< The alert message received indicates a non-fatal error. */ -#define MBEDTLS_ERR_SSL_INVALID_VERIFY_HASH -0x6600 /**< Couldn't set the hash for verifying CertificateVerify */ -#define MBEDTLS_ERR_SSL_CONTINUE_PROCESSING -0x6580 /**< Internal-only message signaling that further message-processing should be done */ -#define MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS -0x6500 /**< The asynchronous operation is not completed yet. */ -#define MBEDTLS_ERR_SSL_EARLY_MESSAGE -0x6480 /**< Internal-only message signaling that a message arrived early. */ - -/* - * Various constants - */ -#define MBEDTLS_SSL_MAJOR_VERSION_3 3 -#define MBEDTLS_SSL_MINOR_VERSION_0 0 /*!< SSL v3.0 */ -#define MBEDTLS_SSL_MINOR_VERSION_1 1 /*!< TLS v1.0 */ -#define MBEDTLS_SSL_MINOR_VERSION_2 2 /*!< TLS v1.1 */ -#define MBEDTLS_SSL_MINOR_VERSION_3 3 /*!< TLS v1.2 */ - -#define MBEDTLS_SSL_TRANSPORT_STREAM 0 /*!< TLS */ -#define MBEDTLS_SSL_TRANSPORT_DATAGRAM 1 /*!< DTLS */ - -#define MBEDTLS_SSL_MAX_HOST_NAME_LEN 255 /*!< Maximum host name defined in RFC 1035 */ - -/* RFC 6066 section 4, see also mfl_code_to_length in ssl_tls.c - * NONE must be zero so that memset()ing structure to zero works */ -#define MBEDTLS_SSL_MAX_FRAG_LEN_NONE 0 /*!< don't use this extension */ -#define MBEDTLS_SSL_MAX_FRAG_LEN_512 1 /*!< MaxFragmentLength 2^9 */ -#define MBEDTLS_SSL_MAX_FRAG_LEN_1024 2 /*!< MaxFragmentLength 2^10 */ -#define MBEDTLS_SSL_MAX_FRAG_LEN_2048 3 /*!< MaxFragmentLength 2^11 */ -#define MBEDTLS_SSL_MAX_FRAG_LEN_4096 4 /*!< MaxFragmentLength 2^12 */ -#define MBEDTLS_SSL_MAX_FRAG_LEN_INVALID 5 /*!< first invalid value */ - -#define MBEDTLS_SSL_IS_CLIENT 0 -#define MBEDTLS_SSL_IS_SERVER 1 - -#define MBEDTLS_SSL_IS_NOT_FALLBACK 0 -#define MBEDTLS_SSL_IS_FALLBACK 1 - -#define MBEDTLS_SSL_EXTENDED_MS_DISABLED 0 -#define MBEDTLS_SSL_EXTENDED_MS_ENABLED 1 - -#define MBEDTLS_SSL_ETM_DISABLED 0 -#define MBEDTLS_SSL_ETM_ENABLED 1 - -#define MBEDTLS_SSL_COMPRESS_NULL 0 -#define MBEDTLS_SSL_COMPRESS_DEFLATE 1 - -#define MBEDTLS_SSL_VERIFY_NONE 0 -#define MBEDTLS_SSL_VERIFY_OPTIONAL 1 -#define MBEDTLS_SSL_VERIFY_REQUIRED 2 -#define MBEDTLS_SSL_VERIFY_UNSET 3 /* Used only for sni_authmode */ - -#define MBEDTLS_SSL_LEGACY_RENEGOTIATION 0 -#define MBEDTLS_SSL_SECURE_RENEGOTIATION 1 - -#define MBEDTLS_SSL_RENEGOTIATION_DISABLED 0 -#define MBEDTLS_SSL_RENEGOTIATION_ENABLED 1 - -#define MBEDTLS_SSL_ANTI_REPLAY_DISABLED 0 -#define MBEDTLS_SSL_ANTI_REPLAY_ENABLED 1 - -#define MBEDTLS_SSL_RENEGOTIATION_NOT_ENFORCED -1 -#define MBEDTLS_SSL_RENEGO_MAX_RECORDS_DEFAULT 16 - -#define MBEDTLS_SSL_LEGACY_NO_RENEGOTIATION 0 -#define MBEDTLS_SSL_LEGACY_ALLOW_RENEGOTIATION 1 -#define MBEDTLS_SSL_LEGACY_BREAK_HANDSHAKE 2 - -#define MBEDTLS_SSL_TRUNC_HMAC_DISABLED 0 -#define MBEDTLS_SSL_TRUNC_HMAC_ENABLED 1 -#define MBEDTLS_SSL_TRUNCATED_HMAC_LEN 10 /* 80 bits, rfc 6066 section 7 */ - -#define MBEDTLS_SSL_SESSION_TICKETS_DISABLED 0 -#define MBEDTLS_SSL_SESSION_TICKETS_ENABLED 1 - -#define MBEDTLS_SSL_CBC_RECORD_SPLITTING_DISABLED 0 -#define MBEDTLS_SSL_CBC_RECORD_SPLITTING_ENABLED 1 - -#define MBEDTLS_SSL_ARC4_ENABLED 0 -#define MBEDTLS_SSL_ARC4_DISABLED 1 - -#define MBEDTLS_SSL_PRESET_DEFAULT 0 -#define MBEDTLS_SSL_PRESET_SUITEB 2 - -#define MBEDTLS_SSL_CERT_REQ_CA_LIST_ENABLED 1 -#define MBEDTLS_SSL_CERT_REQ_CA_LIST_DISABLED 0 - -/* - * Default range for DTLS retransmission timer value, in milliseconds. - * RFC 6347 4.2.4.1 says from 1 second to 60 seconds. - */ -#define MBEDTLS_SSL_DTLS_TIMEOUT_DFL_MIN 1000 -#define MBEDTLS_SSL_DTLS_TIMEOUT_DFL_MAX 60000 - -/** - * \name SECTION: Module settings - * - * The configuration options you can set for this module are in this section. - * Either change them in config.h or define them on the compiler command line. - * \{ - */ - -#if !defined(MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME) -#define MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */ -#endif - -/* - * Maximum fragment length in bytes, - * determines the size of each of the two internal I/O buffers. - * - * Note: the RFC defines the default size of SSL / TLS messages. If you - * change the value here, other clients / servers may not be able to - * communicate with you anymore. Only change this value if you control - * both sides of the connection and have it reduced at both sides, or - * if you're using the Max Fragment Length extension and you know all your - * peers are using it too! - */ -#if !defined(MBEDTLS_SSL_MAX_CONTENT_LEN) -#define MBEDTLS_SSL_MAX_CONTENT_LEN 16384 /**< Size of the input / output buffer */ -#endif - -#if !defined(MBEDTLS_SSL_IN_CONTENT_LEN) -#define MBEDTLS_SSL_IN_CONTENT_LEN MBEDTLS_SSL_MAX_CONTENT_LEN -#endif - -#if !defined(MBEDTLS_SSL_OUT_CONTENT_LEN) -#define MBEDTLS_SSL_OUT_CONTENT_LEN MBEDTLS_SSL_MAX_CONTENT_LEN -#endif - -/* - * Maximum number of heap-allocated bytes for the purpose of - * DTLS handshake message reassembly and future message buffering. - */ -#if !defined(MBEDTLS_SSL_DTLS_MAX_BUFFERING) -#define MBEDTLS_SSL_DTLS_MAX_BUFFERING 32768 -#endif - -/* \} name SECTION: Module settings */ - -/* - * Length of the verify data for secure renegotiation - */ -#if defined(MBEDTLS_SSL_PROTO_SSL3) -#define MBEDTLS_SSL_VERIFY_DATA_MAX_LEN 36 -#else -#define MBEDTLS_SSL_VERIFY_DATA_MAX_LEN 12 -#endif - -/* - * Signaling ciphersuite values (SCSV) - */ -#define MBEDTLS_SSL_EMPTY_RENEGOTIATION_INFO 0xFF /**< renegotiation info ext */ -#define MBEDTLS_SSL_FALLBACK_SCSV_VALUE 0x5600 /**< RFC 7507 section 2 */ - -/* - * Supported Signature and Hash algorithms (For TLS 1.2) - * RFC 5246 section 7.4.1.4.1 - */ -#define MBEDTLS_SSL_HASH_NONE 0 -#define MBEDTLS_SSL_HASH_MD5 1 -#define MBEDTLS_SSL_HASH_SHA1 2 -#define MBEDTLS_SSL_HASH_SHA224 3 -#define MBEDTLS_SSL_HASH_SHA256 4 -#define MBEDTLS_SSL_HASH_SHA384 5 -#define MBEDTLS_SSL_HASH_SHA512 6 - -#define MBEDTLS_SSL_SIG_ANON 0 -#define MBEDTLS_SSL_SIG_RSA 1 -#define MBEDTLS_SSL_SIG_ECDSA 3 - -/* - * Client Certificate Types - * RFC 5246 section 7.4.4 plus RFC 4492 section 5.5 - */ -#define MBEDTLS_SSL_CERT_TYPE_RSA_SIGN 1 -#define MBEDTLS_SSL_CERT_TYPE_ECDSA_SIGN 64 - -/* - * Message, alert and handshake types - */ -#define MBEDTLS_SSL_MSG_CHANGE_CIPHER_SPEC 20 -#define MBEDTLS_SSL_MSG_ALERT 21 -#define MBEDTLS_SSL_MSG_HANDSHAKE 22 -#define MBEDTLS_SSL_MSG_APPLICATION_DATA 23 - -#define MBEDTLS_SSL_ALERT_LEVEL_WARNING 1 -#define MBEDTLS_SSL_ALERT_LEVEL_FATAL 2 - -#define MBEDTLS_SSL_ALERT_MSG_CLOSE_NOTIFY 0 /* 0x00 */ -#define MBEDTLS_SSL_ALERT_MSG_UNEXPECTED_MESSAGE 10 /* 0x0A */ -#define MBEDTLS_SSL_ALERT_MSG_BAD_RECORD_MAC 20 /* 0x14 */ -#define MBEDTLS_SSL_ALERT_MSG_DECRYPTION_FAILED 21 /* 0x15 */ -#define MBEDTLS_SSL_ALERT_MSG_RECORD_OVERFLOW 22 /* 0x16 */ -#define MBEDTLS_SSL_ALERT_MSG_DECOMPRESSION_FAILURE 30 /* 0x1E */ -#define MBEDTLS_SSL_ALERT_MSG_HANDSHAKE_FAILURE 40 /* 0x28 */ -#define MBEDTLS_SSL_ALERT_MSG_NO_CERT 41 /* 0x29 */ -#define MBEDTLS_SSL_ALERT_MSG_BAD_CERT 42 /* 0x2A */ -#define MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT 43 /* 0x2B */ -#define MBEDTLS_SSL_ALERT_MSG_CERT_REVOKED 44 /* 0x2C */ -#define MBEDTLS_SSL_ALERT_MSG_CERT_EXPIRED 45 /* 0x2D */ -#define MBEDTLS_SSL_ALERT_MSG_CERT_UNKNOWN 46 /* 0x2E */ -#define MBEDTLS_SSL_ALERT_MSG_ILLEGAL_PARAMETER 47 /* 0x2F */ -#define MBEDTLS_SSL_ALERT_MSG_UNKNOWN_CA 48 /* 0x30 */ -#define MBEDTLS_SSL_ALERT_MSG_ACCESS_DENIED 49 /* 0x31 */ -#define MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR 50 /* 0x32 */ -#define MBEDTLS_SSL_ALERT_MSG_DECRYPT_ERROR 51 /* 0x33 */ -#define MBEDTLS_SSL_ALERT_MSG_EXPORT_RESTRICTION 60 /* 0x3C */ -#define MBEDTLS_SSL_ALERT_MSG_PROTOCOL_VERSION 70 /* 0x46 */ -#define MBEDTLS_SSL_ALERT_MSG_INSUFFICIENT_SECURITY 71 /* 0x47 */ -#define MBEDTLS_SSL_ALERT_MSG_INTERNAL_ERROR 80 /* 0x50 */ -#define MBEDTLS_SSL_ALERT_MSG_INAPROPRIATE_FALLBACK 86 /* 0x56 */ -#define MBEDTLS_SSL_ALERT_MSG_USER_CANCELED 90 /* 0x5A */ -#define MBEDTLS_SSL_ALERT_MSG_NO_RENEGOTIATION 100 /* 0x64 */ -#define MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_EXT 110 /* 0x6E */ -#define MBEDTLS_SSL_ALERT_MSG_UNRECOGNIZED_NAME 112 /* 0x70 */ -#define MBEDTLS_SSL_ALERT_MSG_UNKNOWN_PSK_IDENTITY 115 /* 0x73 */ -#define MBEDTLS_SSL_ALERT_MSG_NO_APPLICATION_PROTOCOL 120 /* 0x78 */ - -#define MBEDTLS_SSL_HS_HELLO_REQUEST 0 -#define MBEDTLS_SSL_HS_CLIENT_HELLO 1 -#define MBEDTLS_SSL_HS_SERVER_HELLO 2 -#define MBEDTLS_SSL_HS_HELLO_VERIFY_REQUEST 3 -#define MBEDTLS_SSL_HS_NEW_SESSION_TICKET 4 -#define MBEDTLS_SSL_HS_CERTIFICATE 11 -#define MBEDTLS_SSL_HS_SERVER_KEY_EXCHANGE 12 -#define MBEDTLS_SSL_HS_CERTIFICATE_REQUEST 13 -#define MBEDTLS_SSL_HS_SERVER_HELLO_DONE 14 -#define MBEDTLS_SSL_HS_CERTIFICATE_VERIFY 15 -#define MBEDTLS_SSL_HS_CLIENT_KEY_EXCHANGE 16 -#define MBEDTLS_SSL_HS_FINISHED 20 - -/* - * TLS extensions - */ -#define MBEDTLS_TLS_EXT_SERVERNAME 0 -#define MBEDTLS_TLS_EXT_SERVERNAME_HOSTNAME 0 - -#define MBEDTLS_TLS_EXT_MAX_FRAGMENT_LENGTH 1 - -#define MBEDTLS_TLS_EXT_TRUNCATED_HMAC 4 - -#define MBEDTLS_TLS_EXT_SUPPORTED_ELLIPTIC_CURVES 10 -#define MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS 11 - -#define MBEDTLS_TLS_EXT_SIG_ALG 13 - -#define MBEDTLS_TLS_EXT_ALPN 16 - -#define MBEDTLS_TLS_EXT_ENCRYPT_THEN_MAC 22 /* 0x16 */ -#define MBEDTLS_TLS_EXT_EXTENDED_MASTER_SECRET 0x0017 /* 23 */ - -#define MBEDTLS_TLS_EXT_SESSION_TICKET 35 - -#define MBEDTLS_TLS_EXT_ECJPAKE_KKPP 256 /* experimental */ - -#define MBEDTLS_TLS_EXT_RENEGOTIATION_INFO 0xFF01 - -/* - * Size defines - */ -#if !defined(MBEDTLS_PSK_MAX_LEN) -#define MBEDTLS_PSK_MAX_LEN 32 /* 256 bits */ -#endif - -/* Dummy type used only for its size */ -union mbedtls_ssl_premaster_secret -{ -#if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) - unsigned char _pms_rsa[48]; /* RFC 5246 8.1.1 */ -#endif -#if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) - unsigned char _pms_dhm[MBEDTLS_MPI_MAX_SIZE]; /* RFC 5246 8.1.2 */ -#endif -#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) - unsigned char _pms_ecdh[MBEDTLS_ECP_MAX_BYTES]; /* RFC 4492 5.10 */ -#endif -#if defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) - unsigned char _pms_psk[4 + 2 * MBEDTLS_PSK_MAX_LEN]; /* RFC 4279 2 */ -#endif -#if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) - unsigned char _pms_dhe_psk[4 + MBEDTLS_MPI_MAX_SIZE - + MBEDTLS_PSK_MAX_LEN]; /* RFC 4279 3 */ -#endif -#if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) - unsigned char _pms_rsa_psk[52 + MBEDTLS_PSK_MAX_LEN]; /* RFC 4279 4 */ -#endif -#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) - unsigned char _pms_ecdhe_psk[4 + MBEDTLS_ECP_MAX_BYTES - + MBEDTLS_PSK_MAX_LEN]; /* RFC 5489 2 */ -#endif -#if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) - unsigned char _pms_ecjpake[32]; /* Thread spec: SHA-256 output */ -#endif -}; - -#define MBEDTLS_PREMASTER_SIZE sizeof( union mbedtls_ssl_premaster_secret ) - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * SSL state machine - */ -typedef enum -{ - MBEDTLS_SSL_HELLO_REQUEST, - MBEDTLS_SSL_CLIENT_HELLO, - MBEDTLS_SSL_SERVER_HELLO, - MBEDTLS_SSL_SERVER_CERTIFICATE, - MBEDTLS_SSL_SERVER_KEY_EXCHANGE, - MBEDTLS_SSL_CERTIFICATE_REQUEST, - MBEDTLS_SSL_SERVER_HELLO_DONE, - MBEDTLS_SSL_CLIENT_CERTIFICATE, - MBEDTLS_SSL_CLIENT_KEY_EXCHANGE, - MBEDTLS_SSL_CERTIFICATE_VERIFY, - MBEDTLS_SSL_CLIENT_CHANGE_CIPHER_SPEC, - MBEDTLS_SSL_CLIENT_FINISHED, - MBEDTLS_SSL_SERVER_CHANGE_CIPHER_SPEC, - MBEDTLS_SSL_SERVER_FINISHED, - MBEDTLS_SSL_FLUSH_BUFFERS, - MBEDTLS_SSL_HANDSHAKE_WRAPUP, - MBEDTLS_SSL_HANDSHAKE_OVER, - MBEDTLS_SSL_SERVER_NEW_SESSION_TICKET, - MBEDTLS_SSL_SERVER_HELLO_VERIFY_REQUEST_SENT, -} -mbedtls_ssl_states; - -/** - * \brief Callback type: send data on the network. - * - * \note That callback may be either blocking or non-blocking. - * - * \param ctx Context for the send callback (typically a file descriptor) - * \param buf Buffer holding the data to send - * \param len Length of the data to send - * - * \return The callback must return the number of bytes sent if any, - * or a non-zero error code. - * If performing non-blocking I/O, \c MBEDTLS_ERR_SSL_WANT_WRITE - * must be returned when the operation would block. - * - * \note The callback is allowed to send fewer bytes than requested. - * It must always return the number of bytes actually sent. - */ -typedef int mbedtls_ssl_send_t( void *ctx, - const unsigned char *buf, - size_t len ); - -/** - * \brief Callback type: receive data from the network. - * - * \note That callback may be either blocking or non-blocking. - * - * \param ctx Context for the receive callback (typically a file - * descriptor) - * \param buf Buffer to write the received data to - * \param len Length of the receive buffer - * - * \return The callback must return the number of bytes received, - * or a non-zero error code. - * If performing non-blocking I/O, \c MBEDTLS_ERR_SSL_WANT_READ - * must be returned when the operation would block. - * - * \note The callback may receive fewer bytes than the length of the - * buffer. It must always return the number of bytes actually - * received and written to the buffer. - */ -typedef int mbedtls_ssl_recv_t( void *ctx, - unsigned char *buf, - size_t len ); - -/** - * \brief Callback type: receive data from the network, with timeout - * - * \note That callback must block until data is received, or the - * timeout delay expires, or the operation is interrupted by a - * signal. - * - * \param ctx Context for the receive callback (typically a file descriptor) - * \param buf Buffer to write the received data to - * \param len Length of the receive buffer - * \param timeout Maximum nomber of millisecondes to wait for data - * 0 means no timeout (potentially waiting forever) - * - * \return The callback must return the number of bytes received, - * or a non-zero error code: - * \c MBEDTLS_ERR_SSL_TIMEOUT if the operation timed out, - * \c MBEDTLS_ERR_SSL_WANT_READ if interrupted by a signal. - * - * \note The callback may receive fewer bytes than the length of the - * buffer. It must always return the number of bytes actually - * received and written to the buffer. - */ -typedef int mbedtls_ssl_recv_timeout_t( void *ctx, - unsigned char *buf, - size_t len, - uint32_t timeout ); -/** - * \brief Callback type: set a pair of timers/delays to watch - * - * \param ctx Context pointer - * \param int_ms Intermediate delay in milliseconds - * \param fin_ms Final delay in milliseconds - * 0 cancels the current timer. - * - * \note This callback must at least store the necessary information - * for the associated \c mbedtls_ssl_get_timer_t callback to - * return correct information. - * - * \note If using a event-driven style of programming, an event must - * be generated when the final delay is passed. The event must - * cause a call to \c mbedtls_ssl_handshake() with the proper - * SSL context to be scheduled. Care must be taken to ensure - * that at most one such call happens at a time. - * - * \note Only one timer at a time must be running. Calling this - * function while a timer is running must cancel it. Cancelled - * timers must not generate any event. - */ -typedef void mbedtls_ssl_set_timer_t( void * ctx, - uint32_t int_ms, - uint32_t fin_ms ); - -/** - * \brief Callback type: get status of timers/delays - * - * \param ctx Context pointer - * - * \return This callback must return: - * -1 if cancelled (fin_ms == 0), - * 0 if none of the delays have passed, - * 1 if only the intermediate delay has passed, - * 2 if the final delay has passed. - */ -typedef int mbedtls_ssl_get_timer_t( void * ctx ); - -/* Defined below */ -typedef struct mbedtls_ssl_session mbedtls_ssl_session; -typedef struct mbedtls_ssl_context mbedtls_ssl_context; -typedef struct mbedtls_ssl_config mbedtls_ssl_config; - -/* Defined in ssl_internal.h */ -typedef struct mbedtls_ssl_transform mbedtls_ssl_transform; -typedef struct mbedtls_ssl_handshake_params mbedtls_ssl_handshake_params; -typedef struct mbedtls_ssl_sig_hash_set_t mbedtls_ssl_sig_hash_set_t; -#if defined(MBEDTLS_X509_CRT_PARSE_C) -typedef struct mbedtls_ssl_key_cert mbedtls_ssl_key_cert; -#endif -#if defined(MBEDTLS_SSL_PROTO_DTLS) -typedef struct mbedtls_ssl_flight_item mbedtls_ssl_flight_item; -#endif - -#if defined(MBEDTLS_SSL_ASYNC_PRIVATE) -#if defined(MBEDTLS_X509_CRT_PARSE_C) -/** - * \brief Callback type: start external signature operation. - * - * This callback is called during an SSL handshake to start - * a signature decryption operation using an - * external processor. The parameter \p cert contains - * the public key; it is up to the callback function to - * determine how to access the associated private key. - * - * This function typically sends or enqueues a request, and - * does not wait for the operation to complete. This allows - * the handshake step to be non-blocking. - * - * The parameters \p ssl and \p cert are guaranteed to remain - * valid throughout the handshake. On the other hand, this - * function must save the contents of \p hash if the value - * is needed for later processing, because the \p hash buffer - * is no longer valid after this function returns. - * - * This function may call mbedtls_ssl_set_async_operation_data() - * to store an operation context for later retrieval - * by the resume or cancel callback. - * - * \note For RSA signatures, this function must produce output - * that is consistent with PKCS#1 v1.5 in the same way as - * mbedtls_rsa_pkcs1_sign(). Before the private key operation, - * apply the padding steps described in RFC 8017, section 9.2 - * "EMSA-PKCS1-v1_5" as follows. - * - If \p md_alg is #MBEDTLS_MD_NONE, apply the PKCS#1 v1.5 - * encoding, treating \p hash as the DigestInfo to be - * padded. In other words, apply EMSA-PKCS1-v1_5 starting - * from step 3, with `T = hash` and `tLen = hash_len`. - * - If `md_alg != MBEDTLS_MD_NONE`, apply the PKCS#1 v1.5 - * encoding, treating \p hash as the hash to be encoded and - * padded. In other words, apply EMSA-PKCS1-v1_5 starting - * from step 2, with `digestAlgorithm` obtained by calling - * mbedtls_oid_get_oid_by_md() on \p md_alg. - * - * \note For ECDSA signatures, the output format is the DER encoding - * `Ecdsa-Sig-Value` defined in - * [RFC 4492 section 5.4](https://tools.ietf.org/html/rfc4492#section-5.4). - * - * \param ssl The SSL connection instance. It should not be - * modified other than via - * mbedtls_ssl_set_async_operation_data(). - * \param cert Certificate containing the public key. - * In simple cases, this is one of the pointers passed to - * mbedtls_ssl_conf_own_cert() when configuring the SSL - * connection. However, if other callbacks are used, this - * property may not hold. For example, if an SNI callback - * is registered with mbedtls_ssl_conf_sni(), then - * this callback determines what certificate is used. - * \param md_alg Hash algorithm. - * \param hash Buffer containing the hash. This buffer is - * no longer valid when the function returns. - * \param hash_len Size of the \c hash buffer in bytes. - * - * \return 0 if the operation was started successfully and the SSL - * stack should call the resume callback immediately. - * \return #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS if the operation - * was started successfully and the SSL stack should return - * immediately without calling the resume callback yet. - * \return #MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH if the external - * processor does not support this key. The SSL stack will - * use the private key object instead. - * \return Any other error indicates a fatal failure and is - * propagated up the call chain. The callback should - * use \c MBEDTLS_ERR_PK_xxx error codes, and must not - * use \c MBEDTLS_ERR_SSL_xxx error codes except as - * directed in the documentation of this callback. - */ -typedef int mbedtls_ssl_async_sign_t( mbedtls_ssl_context *ssl, - mbedtls_x509_crt *cert, - mbedtls_md_type_t md_alg, - const unsigned char *hash, - size_t hash_len ); - -/** - * \brief Callback type: start external decryption operation. - * - * This callback is called during an SSL handshake to start - * an RSA decryption operation using an - * external processor. The parameter \p cert contains - * the public key; it is up to the callback function to - * determine how to access the associated private key. - * - * This function typically sends or enqueues a request, and - * does not wait for the operation to complete. This allows - * the handshake step to be non-blocking. - * - * The parameters \p ssl and \p cert are guaranteed to remain - * valid throughout the handshake. On the other hand, this - * function must save the contents of \p input if the value - * is needed for later processing, because the \p input buffer - * is no longer valid after this function returns. - * - * This function may call mbedtls_ssl_set_async_operation_data() - * to store an operation context for later retrieval - * by the resume or cancel callback. - * - * \warning RSA decryption as used in TLS is subject to a potential - * timing side channel attack first discovered by Bleichenbacher - * in 1998. This attack can be remotely exploitable - * in practice. To avoid this attack, you must ensure that - * if the callback performs an RSA decryption, the time it - * takes to execute and return the result does not depend - * on whether the RSA decryption succeeded or reported - * invalid padding. - * - * \param ssl The SSL connection instance. It should not be - * modified other than via - * mbedtls_ssl_set_async_operation_data(). - * \param cert Certificate containing the public key. - * In simple cases, this is one of the pointers passed to - * mbedtls_ssl_conf_own_cert() when configuring the SSL - * connection. However, if other callbacks are used, this - * property may not hold. For example, if an SNI callback - * is registered with mbedtls_ssl_conf_sni(), then - * this callback determines what certificate is used. - * \param input Buffer containing the input ciphertext. This buffer - * is no longer valid when the function returns. - * \param input_len Size of the \p input buffer in bytes. - * - * \return 0 if the operation was started successfully and the SSL - * stack should call the resume callback immediately. - * \return #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS if the operation - * was started successfully and the SSL stack should return - * immediately without calling the resume callback yet. - * \return #MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH if the external - * processor does not support this key. The SSL stack will - * use the private key object instead. - * \return Any other error indicates a fatal failure and is - * propagated up the call chain. The callback should - * use \c MBEDTLS_ERR_PK_xxx error codes, and must not - * use \c MBEDTLS_ERR_SSL_xxx error codes except as - * directed in the documentation of this callback. - */ -typedef int mbedtls_ssl_async_decrypt_t( mbedtls_ssl_context *ssl, - mbedtls_x509_crt *cert, - const unsigned char *input, - size_t input_len ); -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - -/** - * \brief Callback type: resume external operation. - * - * This callback is called during an SSL handshake to resume - * an external operation started by the - * ::mbedtls_ssl_async_sign_t or - * ::mbedtls_ssl_async_decrypt_t callback. - * - * This function typically checks the status of a pending - * request or causes the request queue to make progress, and - * does not wait for the operation to complete. This allows - * the handshake step to be non-blocking. - * - * This function may call mbedtls_ssl_get_async_operation_data() - * to retrieve an operation context set by the start callback. - * It may call mbedtls_ssl_set_async_operation_data() to modify - * this context. - * - * Note that when this function returns a status other than - * #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS, it must free any - * resources associated with the operation. - * - * \param ssl The SSL connection instance. It should not be - * modified other than via - * mbedtls_ssl_set_async_operation_data(). - * \param output Buffer containing the output (signature or decrypted - * data) on success. - * \param output_len On success, number of bytes written to \p output. - * \param output_size Size of the \p output buffer in bytes. - * - * \return 0 if output of the operation is available in the - * \p output buffer. - * \return #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS if the operation - * is still in progress. Subsequent requests for progress - * on the SSL connection will call the resume callback - * again. - * \return Any other error means that the operation is aborted. - * The SSL handshake is aborted. The callback should - * use \c MBEDTLS_ERR_PK_xxx error codes, and must not - * use \c MBEDTLS_ERR_SSL_xxx error codes except as - * directed in the documentation of this callback. - */ -typedef int mbedtls_ssl_async_resume_t( mbedtls_ssl_context *ssl, - unsigned char *output, - size_t *output_len, - size_t output_size ); - -/** - * \brief Callback type: cancel external operation. - * - * This callback is called if an SSL connection is closed - * while an asynchronous operation is in progress. Note that - * this callback is not called if the - * ::mbedtls_ssl_async_resume_t callback has run and has - * returned a value other than - * #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS, since in that case - * the asynchronous operation has already completed. - * - * This function may call mbedtls_ssl_get_async_operation_data() - * to retrieve an operation context set by the start callback. - * - * \param ssl The SSL connection instance. It should not be - * modified. - */ -typedef void mbedtls_ssl_async_cancel_t( mbedtls_ssl_context *ssl ); -#endif /* MBEDTLS_SSL_ASYNC_PRIVATE */ - -/* - * This structure is used for storing current session data. - */ -struct mbedtls_ssl_session -{ -#if defined(MBEDTLS_HAVE_TIME) - mbedtls_time_t start; /*!< starting time */ -#endif - int ciphersuite; /*!< chosen ciphersuite */ - int compression; /*!< chosen compression */ - size_t id_len; /*!< session id length */ - unsigned char id[32]; /*!< session identifier */ - unsigned char master[48]; /*!< the master secret */ - -#if defined(MBEDTLS_X509_CRT_PARSE_C) - mbedtls_x509_crt *peer_cert; /*!< peer X.509 cert chain */ -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - uint32_t verify_result; /*!< verification result */ - -#if defined(MBEDTLS_SSL_SESSION_TICKETS) && defined(MBEDTLS_SSL_CLI_C) - unsigned char *ticket; /*!< RFC 5077 session ticket */ - size_t ticket_len; /*!< session ticket length */ - uint32_t ticket_lifetime; /*!< ticket lifetime hint */ -#endif /* MBEDTLS_SSL_SESSION_TICKETS && MBEDTLS_SSL_CLI_C */ - -#if defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH) - unsigned char mfl_code; /*!< MaxFragmentLength negotiated by peer */ -#endif /* MBEDTLS_SSL_MAX_FRAGMENT_LENGTH */ - -#if defined(MBEDTLS_SSL_TRUNCATED_HMAC) - int trunc_hmac; /*!< flag for truncated hmac activation */ -#endif /* MBEDTLS_SSL_TRUNCATED_HMAC */ - -#if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) - int encrypt_then_mac; /*!< flag for EtM activation */ -#endif -}; - -/** - * SSL/TLS configuration to be shared between mbedtls_ssl_context structures. - */ -struct mbedtls_ssl_config -{ - /* Group items by size (largest first) to minimize padding overhead */ - - /* - * Pointers - */ - - const int *ciphersuite_list[4]; /*!< allowed ciphersuites per version */ - - /** Callback for printing debug output */ - void (*f_dbg)(void *, int, const char *, int, const char *); - void *p_dbg; /*!< context for the debug function */ - - /** Callback for getting (pseudo-)random numbers */ - int (*f_rng)(void *, unsigned char *, size_t); - void *p_rng; /*!< context for the RNG function */ - - /** Callback to retrieve a session from the cache */ - int (*f_get_cache)(void *, mbedtls_ssl_session *); - /** Callback to store a session into the cache */ - int (*f_set_cache)(void *, const mbedtls_ssl_session *); - void *p_cache; /*!< context for cache callbacks */ - -#if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) - /** Callback for setting cert according to SNI extension */ - int (*f_sni)(void *, mbedtls_ssl_context *, const unsigned char *, size_t); - void *p_sni; /*!< context for SNI callback */ -#endif - -#if defined(MBEDTLS_X509_CRT_PARSE_C) - /** Callback to customize X.509 certificate chain verification */ - int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *); - void *p_vrfy; /*!< context for X.509 verify calllback */ -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED) - /** Callback to retrieve PSK key from identity */ - int (*f_psk)(void *, mbedtls_ssl_context *, const unsigned char *, size_t); - void *p_psk; /*!< context for PSK callback */ -#endif - -#if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) && defined(MBEDTLS_SSL_SRV_C) - /** Callback to create & write a cookie for ClientHello veirifcation */ - int (*f_cookie_write)( void *, unsigned char **, unsigned char *, - const unsigned char *, size_t ); - /** Callback to verify validity of a ClientHello cookie */ - int (*f_cookie_check)( void *, const unsigned char *, size_t, - const unsigned char *, size_t ); - void *p_cookie; /*!< context for the cookie callbacks */ -#endif - -#if defined(MBEDTLS_SSL_SESSION_TICKETS) && defined(MBEDTLS_SSL_SRV_C) - /** Callback to create & write a session ticket */ - int (*f_ticket_write)( void *, const mbedtls_ssl_session *, - unsigned char *, const unsigned char *, size_t *, uint32_t * ); - /** Callback to parse a session ticket into a session structure */ - int (*f_ticket_parse)( void *, mbedtls_ssl_session *, unsigned char *, size_t); - void *p_ticket; /*!< context for the ticket callbacks */ -#endif /* MBEDTLS_SSL_SESSION_TICKETS && MBEDTLS_SSL_SRV_C */ - -#if defined(MBEDTLS_SSL_EXPORT_KEYS) - /** Callback to export key block and master secret */ - int (*f_export_keys)( void *, const unsigned char *, - const unsigned char *, size_t, size_t, size_t ); - void *p_export_keys; /*!< context for key export callback */ -#endif - -#if defined(MBEDTLS_X509_CRT_PARSE_C) - const mbedtls_x509_crt_profile *cert_profile; /*!< verification profile */ - mbedtls_ssl_key_cert *key_cert; /*!< own certificate/key pair(s) */ - mbedtls_x509_crt *ca_chain; /*!< trusted CAs */ - mbedtls_x509_crl *ca_crl; /*!< trusted CAs CRLs */ -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - -#if defined(MBEDTLS_SSL_ASYNC_PRIVATE) -#if defined(MBEDTLS_X509_CRT_PARSE_C) - mbedtls_ssl_async_sign_t *f_async_sign_start; /*!< start asynchronous signature operation */ - mbedtls_ssl_async_decrypt_t *f_async_decrypt_start; /*!< start asynchronous decryption operation */ -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - mbedtls_ssl_async_resume_t *f_async_resume; /*!< resume asynchronous operation */ - mbedtls_ssl_async_cancel_t *f_async_cancel; /*!< cancel asynchronous operation */ - void *p_async_config_data; /*!< Configuration data set by mbedtls_ssl_conf_async_private_cb(). */ -#endif /* MBEDTLS_SSL_ASYNC_PRIVATE */ - -#if defined(MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED) - const int *sig_hashes; /*!< allowed signature hashes */ -#endif - -#if defined(MBEDTLS_ECP_C) - const mbedtls_ecp_group_id *curve_list; /*!< allowed curves */ -#endif - -#if defined(MBEDTLS_DHM_C) - mbedtls_mpi dhm_P; /*!< prime modulus for DHM */ - mbedtls_mpi dhm_G; /*!< generator for DHM */ -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED) - unsigned char *psk; /*!< pre-shared key. This field should - only be set via - mbedtls_ssl_conf_psk() */ - size_t psk_len; /*!< length of the pre-shared key. This - field should only be set via - mbedtls_ssl_conf_psk() */ - unsigned char *psk_identity; /*!< identity for PSK negotiation. This - field should only be set via - mbedtls_ssl_conf_psk() */ - size_t psk_identity_len;/*!< length of identity. This field should - only be set via - mbedtls_ssl_conf_psk() */ -#endif - -#if defined(MBEDTLS_SSL_ALPN) - const char **alpn_list; /*!< ordered list of protocols */ -#endif - - /* - * Numerical settings (int then char) - */ - - uint32_t read_timeout; /*!< timeout for mbedtls_ssl_read (ms) */ - -#if defined(MBEDTLS_SSL_PROTO_DTLS) - uint32_t hs_timeout_min; /*!< initial value of the handshake - retransmission timeout (ms) */ - uint32_t hs_timeout_max; /*!< maximum value of the handshake - retransmission timeout (ms) */ -#endif - -#if defined(MBEDTLS_SSL_RENEGOTIATION) - int renego_max_records; /*!< grace period for renegotiation */ - unsigned char renego_period[8]; /*!< value of the record counters - that triggers renegotiation */ -#endif - -#if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT) - unsigned int badmac_limit; /*!< limit of records with a bad MAC */ -#endif - -#if defined(MBEDTLS_DHM_C) && defined(MBEDTLS_SSL_CLI_C) - unsigned int dhm_min_bitlen; /*!< min. bit length of the DHM prime */ -#endif - - unsigned char max_major_ver; /*!< max. major version used */ - unsigned char max_minor_ver; /*!< max. minor version used */ - unsigned char min_major_ver; /*!< min. major version used */ - unsigned char min_minor_ver; /*!< min. minor version used */ - - /* - * Flags (bitfields) - */ - - unsigned int endpoint : 1; /*!< 0: client, 1: server */ - unsigned int transport : 1; /*!< stream (TLS) or datagram (DTLS) */ - unsigned int authmode : 2; /*!< MBEDTLS_SSL_VERIFY_XXX */ - /* needed even with renego disabled for LEGACY_BREAK_HANDSHAKE */ - unsigned int allow_legacy_renegotiation : 2 ; /*!< MBEDTLS_LEGACY_XXX */ -#if defined(MBEDTLS_ARC4_C) - unsigned int arc4_disabled : 1; /*!< blacklist RC4 ciphersuites? */ -#endif -#if defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH) - unsigned int mfl_code : 3; /*!< desired fragment length */ -#endif -#if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) - unsigned int encrypt_then_mac : 1 ; /*!< negotiate encrypt-then-mac? */ -#endif -#if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET) - unsigned int extended_ms : 1; /*!< negotiate extended master secret? */ -#endif -#if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) - unsigned int anti_replay : 1; /*!< detect and prevent replay? */ -#endif -#if defined(MBEDTLS_SSL_CBC_RECORD_SPLITTING) - unsigned int cbc_record_splitting : 1; /*!< do cbc record splitting */ -#endif -#if defined(MBEDTLS_SSL_RENEGOTIATION) - unsigned int disable_renegotiation : 1; /*!< disable renegotiation? */ -#endif -#if defined(MBEDTLS_SSL_TRUNCATED_HMAC) - unsigned int trunc_hmac : 1; /*!< negotiate truncated hmac? */ -#endif -#if defined(MBEDTLS_SSL_SESSION_TICKETS) - unsigned int session_tickets : 1; /*!< use session tickets? */ -#endif -#if defined(MBEDTLS_SSL_FALLBACK_SCSV) && defined(MBEDTLS_SSL_CLI_C) - unsigned int fallback : 1; /*!< is this a fallback? */ -#endif -#if defined(MBEDTLS_SSL_SRV_C) - unsigned int cert_req_ca_list : 1; /*!< enable sending CA list in - Certificate Request messages? */ -#endif -}; - - -struct mbedtls_ssl_context -{ - const mbedtls_ssl_config *conf; /*!< configuration information */ - - /* - * Miscellaneous - */ - int state; /*!< SSL handshake: current state */ -#if defined(MBEDTLS_SSL_RENEGOTIATION) - int renego_status; /*!< Initial, in progress, pending? */ - int renego_records_seen; /*!< Records since renego request, or with DTLS, - number of retransmissions of request if - renego_max_records is < 0 */ -#endif /* MBEDTLS_SSL_RENEGOTIATION */ - - int major_ver; /*!< equal to MBEDTLS_SSL_MAJOR_VERSION_3 */ - int minor_ver; /*!< either 0 (SSL3) or 1 (TLS1.0) */ - -#if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT) - unsigned badmac_seen; /*!< records with a bad MAC received */ -#endif /* MBEDTLS_SSL_DTLS_BADMAC_LIMIT */ - - mbedtls_ssl_send_t *f_send; /*!< Callback for network send */ - mbedtls_ssl_recv_t *f_recv; /*!< Callback for network receive */ - mbedtls_ssl_recv_timeout_t *f_recv_timeout; - /*!< Callback for network receive with timeout */ - - void *p_bio; /*!< context for I/O operations */ - - /* - * Session layer - */ - mbedtls_ssl_session *session_in; /*!< current session data (in) */ - mbedtls_ssl_session *session_out; /*!< current session data (out) */ - mbedtls_ssl_session *session; /*!< negotiated session data */ - mbedtls_ssl_session *session_negotiate; /*!< session data in negotiation */ - - mbedtls_ssl_handshake_params *handshake; /*!< params required only during - the handshake process */ - - /* - * Record layer transformations - */ - mbedtls_ssl_transform *transform_in; /*!< current transform params (in) */ - mbedtls_ssl_transform *transform_out; /*!< current transform params (in) */ - mbedtls_ssl_transform *transform; /*!< negotiated transform params */ - mbedtls_ssl_transform *transform_negotiate; /*!< transform params in negotiation */ - - /* - * Timers - */ - void *p_timer; /*!< context for the timer callbacks */ - - mbedtls_ssl_set_timer_t *f_set_timer; /*!< set timer callback */ - mbedtls_ssl_get_timer_t *f_get_timer; /*!< get timer callback */ - - /* - * Record layer (incoming data) - */ - unsigned char *in_buf; /*!< input buffer */ - unsigned char *in_ctr; /*!< 64-bit incoming message counter - TLS: maintained by us - DTLS: read from peer */ - unsigned char *in_hdr; /*!< start of record header */ - unsigned char *in_len; /*!< two-bytes message length field */ - unsigned char *in_iv; /*!< ivlen-byte IV */ - unsigned char *in_msg; /*!< message contents (in_iv+ivlen) */ - unsigned char *in_offt; /*!< read offset in application data */ - - int in_msgtype; /*!< record header: message type */ - size_t in_msglen; /*!< record header: message length */ - size_t in_left; /*!< amount of data read so far */ -#if defined(MBEDTLS_SSL_PROTO_DTLS) - uint16_t in_epoch; /*!< DTLS epoch for incoming records */ - size_t next_record_offset; /*!< offset of the next record in datagram - (equal to in_left if none) */ -#endif /* MBEDTLS_SSL_PROTO_DTLS */ -#if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) - uint64_t in_window_top; /*!< last validated record seq_num */ - uint64_t in_window; /*!< bitmask for replay detection */ -#endif /* MBEDTLS_SSL_DTLS_ANTI_REPLAY */ - - size_t in_hslen; /*!< current handshake message length, - including the handshake header */ - int nb_zero; /*!< # of 0-length encrypted messages */ - - int keep_current_message; /*!< drop or reuse current message - on next call to record layer? */ - -#if defined(MBEDTLS_SSL_PROTO_DTLS) - uint8_t disable_datagram_packing; /*!< Disable packing multiple records - * within a single datagram. */ -#endif /* MBEDTLS_SSL_PROTO_DTLS */ - - /* - * Record layer (outgoing data) - */ - unsigned char *out_buf; /*!< output buffer */ - unsigned char *out_ctr; /*!< 64-bit outgoing message counter */ - unsigned char *out_hdr; /*!< start of record header */ - unsigned char *out_len; /*!< two-bytes message length field */ - unsigned char *out_iv; /*!< ivlen-byte IV */ - unsigned char *out_msg; /*!< message contents (out_iv+ivlen) */ - - int out_msgtype; /*!< record header: message type */ - size_t out_msglen; /*!< record header: message length */ - size_t out_left; /*!< amount of data not yet written */ - - unsigned char cur_out_ctr[8]; /*!< Outgoing record sequence number. */ - -#if defined(MBEDTLS_SSL_PROTO_DTLS) - uint16_t mtu; /*!< path mtu, used to fragment outgoing messages */ -#endif /* MBEDTLS_SSL_PROTO_DTLS */ - -#if defined(MBEDTLS_ZLIB_SUPPORT) - unsigned char *compress_buf; /*!< zlib data buffer */ -#endif /* MBEDTLS_ZLIB_SUPPORT */ -#if defined(MBEDTLS_SSL_CBC_RECORD_SPLITTING) - signed char split_done; /*!< current record already splitted? */ -#endif /* MBEDTLS_SSL_CBC_RECORD_SPLITTING */ - - /* - * PKI layer - */ - int client_auth; /*!< flag for client auth. */ - - /* - * User settings - */ -#if defined(MBEDTLS_X509_CRT_PARSE_C) - char *hostname; /*!< expected peer CN for verification - (and SNI if available) */ -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - -#if defined(MBEDTLS_SSL_ALPN) - const char *alpn_chosen; /*!< negotiated protocol */ -#endif /* MBEDTLS_SSL_ALPN */ - - /* - * Information for DTLS hello verify - */ -#if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) && defined(MBEDTLS_SSL_SRV_C) - unsigned char *cli_id; /*!< transport-level ID of the client */ - size_t cli_id_len; /*!< length of cli_id */ -#endif /* MBEDTLS_SSL_DTLS_HELLO_VERIFY && MBEDTLS_SSL_SRV_C */ - - /* - * Secure renegotiation - */ - /* needed to know when to send extension on server */ - int secure_renegotiation; /*!< does peer support legacy or - secure renegotiation */ -#if defined(MBEDTLS_SSL_RENEGOTIATION) - size_t verify_data_len; /*!< length of verify data stored */ - char own_verify_data[MBEDTLS_SSL_VERIFY_DATA_MAX_LEN]; /*!< previous handshake verify data */ - char peer_verify_data[MBEDTLS_SSL_VERIFY_DATA_MAX_LEN]; /*!< previous handshake verify data */ -#endif /* MBEDTLS_SSL_RENEGOTIATION */ -}; - -#if defined(MBEDTLS_SSL_HW_RECORD_ACCEL) - -#define MBEDTLS_SSL_CHANNEL_OUTBOUND 0 -#define MBEDTLS_SSL_CHANNEL_INBOUND 1 - -extern int (*mbedtls_ssl_hw_record_init)(mbedtls_ssl_context *ssl, - const unsigned char *key_enc, const unsigned char *key_dec, - size_t keylen, - const unsigned char *iv_enc, const unsigned char *iv_dec, - size_t ivlen, - const unsigned char *mac_enc, const unsigned char *mac_dec, - size_t maclen); -extern int (*mbedtls_ssl_hw_record_activate)(mbedtls_ssl_context *ssl, int direction); -extern int (*mbedtls_ssl_hw_record_reset)(mbedtls_ssl_context *ssl); -extern int (*mbedtls_ssl_hw_record_write)(mbedtls_ssl_context *ssl); -extern int (*mbedtls_ssl_hw_record_read)(mbedtls_ssl_context *ssl); -extern int (*mbedtls_ssl_hw_record_finish)(mbedtls_ssl_context *ssl); -#endif /* MBEDTLS_SSL_HW_RECORD_ACCEL */ - -/** - * \brief Return the name of the ciphersuite associated with the - * given ID - * - * \param ciphersuite_id SSL ciphersuite ID - * - * \return a string containing the ciphersuite name - */ -const char *mbedtls_ssl_get_ciphersuite_name( const int ciphersuite_id ); - -/** - * \brief Return the ID of the ciphersuite associated with the - * given name - * - * \param ciphersuite_name SSL ciphersuite name - * - * \return the ID with the ciphersuite or 0 if not found - */ -int mbedtls_ssl_get_ciphersuite_id( const char *ciphersuite_name ); - -/** - * \brief Initialize an SSL context - * Just makes the context ready for mbedtls_ssl_setup() or - * mbedtls_ssl_free() - * - * \param ssl SSL context - */ -void mbedtls_ssl_init( mbedtls_ssl_context *ssl ); - -/** - * \brief Set up an SSL context for use - * - * \note No copy of the configuration context is made, it can be - * shared by many mbedtls_ssl_context structures. - * - * \warning The conf structure will be accessed during the session. - * It must not be modified or freed as long as the session - * is active. - * - * \warning This function must be called exactly once per context. - * Calling mbedtls_ssl_setup again is not supported, even - * if no session is active. - * - * \param ssl SSL context - * \param conf SSL configuration to use - * - * \return 0 if successful, or MBEDTLS_ERR_SSL_ALLOC_FAILED if - * memory allocation failed - */ -int mbedtls_ssl_setup( mbedtls_ssl_context *ssl, - const mbedtls_ssl_config *conf ); - -/** - * \brief Reset an already initialized SSL context for re-use - * while retaining application-set variables, function - * pointers and data. - * - * \param ssl SSL context - * \return 0 if successful, or MBEDTLS_ERR_SSL_ALLOC_FAILED, - MBEDTLS_ERR_SSL_HW_ACCEL_FAILED or - * MBEDTLS_ERR_SSL_COMPRESSION_FAILED - */ -int mbedtls_ssl_session_reset( mbedtls_ssl_context *ssl ); - -/** - * \brief Set the current endpoint type - * - * \param conf SSL configuration - * \param endpoint must be MBEDTLS_SSL_IS_CLIENT or MBEDTLS_SSL_IS_SERVER - */ -void mbedtls_ssl_conf_endpoint( mbedtls_ssl_config *conf, int endpoint ); - -/** - * \brief Set the transport type (TLS or DTLS). - * Default: TLS - * - * \note For DTLS, you must either provide a recv callback that - * doesn't block, or one that handles timeouts, see - * \c mbedtls_ssl_set_bio(). You also need to provide timer - * callbacks with \c mbedtls_ssl_set_timer_cb(). - * - * \param conf SSL configuration - * \param transport transport type: - * MBEDTLS_SSL_TRANSPORT_STREAM for TLS, - * MBEDTLS_SSL_TRANSPORT_DATAGRAM for DTLS. - */ -void mbedtls_ssl_conf_transport( mbedtls_ssl_config *conf, int transport ); - -/** - * \brief Set the certificate verification mode - * Default: NONE on server, REQUIRED on client - * - * \param conf SSL configuration - * \param authmode can be: - * - * MBEDTLS_SSL_VERIFY_NONE: peer certificate is not checked - * (default on server) - * (insecure on client) - * - * MBEDTLS_SSL_VERIFY_OPTIONAL: peer certificate is checked, however the - * handshake continues even if verification failed; - * mbedtls_ssl_get_verify_result() can be called after the - * handshake is complete. - * - * MBEDTLS_SSL_VERIFY_REQUIRED: peer *must* present a valid certificate, - * handshake is aborted if verification failed. - * (default on client) - * - * \note On client, MBEDTLS_SSL_VERIFY_REQUIRED is the recommended mode. - * With MBEDTLS_SSL_VERIFY_OPTIONAL, the user needs to call mbedtls_ssl_get_verify_result() at - * the right time(s), which may not be obvious, while REQUIRED always perform - * the verification as soon as possible. For example, REQUIRED was protecting - * against the "triple handshake" attack even before it was found. - */ -void mbedtls_ssl_conf_authmode( mbedtls_ssl_config *conf, int authmode ); - -#if defined(MBEDTLS_X509_CRT_PARSE_C) -/** - * \brief Set the verification callback (Optional). - * - * If set, the verify callback is called for each - * certificate in the chain. For implementation - * information, please see \c mbedtls_x509_crt_verify() - * - * \param conf SSL configuration - * \param f_vrfy verification function - * \param p_vrfy verification parameter - */ -void mbedtls_ssl_conf_verify( mbedtls_ssl_config *conf, - int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *), - void *p_vrfy ); -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - -/** - * \brief Set the random number generator callback - * - * \param conf SSL configuration - * \param f_rng RNG function - * \param p_rng RNG parameter - */ -void mbedtls_ssl_conf_rng( mbedtls_ssl_config *conf, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief Set the debug callback - * - * The callback has the following argument: - * void * opaque context for the callback - * int debug level - * const char * file name - * int line number - * const char * message - * - * \param conf SSL configuration - * \param f_dbg debug function - * \param p_dbg debug parameter - */ -void mbedtls_ssl_conf_dbg( mbedtls_ssl_config *conf, - void (*f_dbg)(void *, int, const char *, int, const char *), - void *p_dbg ); - -/** - * \brief Set the underlying BIO callbacks for write, read and - * read-with-timeout. - * - * \param ssl SSL context - * \param p_bio parameter (context) shared by BIO callbacks - * \param f_send write callback - * \param f_recv read callback - * \param f_recv_timeout blocking read callback with timeout. - * - * \note One of f_recv or f_recv_timeout can be NULL, in which case - * the other is used. If both are non-NULL, f_recv_timeout is - * used and f_recv is ignored (as if it were NULL). - * - * \note The two most common use cases are: - * - non-blocking I/O, f_recv != NULL, f_recv_timeout == NULL - * - blocking I/O, f_recv == NULL, f_recv_timout != NULL - * - * \note For DTLS, you need to provide either a non-NULL - * f_recv_timeout callback, or a f_recv that doesn't block. - * - * \note See the documentations of \c mbedtls_ssl_sent_t, - * \c mbedtls_ssl_recv_t and \c mbedtls_ssl_recv_timeout_t for - * the conventions those callbacks must follow. - * - * \note On some platforms, net_sockets.c provides - * \c mbedtls_net_send(), \c mbedtls_net_recv() and - * \c mbedtls_net_recv_timeout() that are suitable to be used - * here. - */ -void mbedtls_ssl_set_bio( mbedtls_ssl_context *ssl, - void *p_bio, - mbedtls_ssl_send_t *f_send, - mbedtls_ssl_recv_t *f_recv, - mbedtls_ssl_recv_timeout_t *f_recv_timeout ); - -#if defined(MBEDTLS_SSL_PROTO_DTLS) -/** - * \brief Set the Maximum Tranport Unit (MTU). - * Special value: 0 means unset (no limit). - * This represents the maximum size of a datagram payload - * handled by the transport layer (usually UDP) as determined - * by the network link and stack. In practice, this controls - * the maximum size datagram the DTLS layer will pass to the - * \c f_send() callback set using \c mbedtls_ssl_set_bio(). - * - * \note The limit on datagram size is converted to a limit on - * record payload by subtracting the current overhead of - * encapsulation and encryption/authentication if any. - * - * \note This can be called at any point during the connection, for - * example when a Path Maximum Transfer Unit (PMTU) - * estimate becomes available from other sources, - * such as lower (or higher) protocol layers. - * - * \note This setting only controls the size of the packets we send, - * and does not restrict the size of the datagrams we're - * willing to receive. Client-side, you can request the - * server to use smaller records with \c - * mbedtls_ssl_conf_max_frag_len(). - * - * \note If both a MTU and a maximum fragment length have been - * configured (or negotiated with the peer), the resulting - * lower limit on record payload (see first note) is used. - * - * \note This can only be used to decrease the maximum size - * of datagrams (hence records, see first note) sent. It - * cannot be used to increase the maximum size of records over - * the limit set by #MBEDTLS_SSL_OUT_CONTENT_LEN. - * - * \note Values lower than the current record layer expansion will - * result in an error when trying to send data. - * - * \note Using record compression together with a non-zero MTU value - * will result in an error when trying to send data. - * - * \param ssl SSL context - * \param mtu Value of the path MTU in bytes - */ -void mbedtls_ssl_set_mtu( mbedtls_ssl_context *ssl, uint16_t mtu ); -#endif /* MBEDTLS_SSL_PROTO_DTLS */ - -/** - * \brief Set the timeout period for mbedtls_ssl_read() - * (Default: no timeout.) - * - * \param conf SSL configuration context - * \param timeout Timeout value in milliseconds. - * Use 0 for no timeout (default). - * - * \note With blocking I/O, this will only work if a non-NULL - * \c f_recv_timeout was set with \c mbedtls_ssl_set_bio(). - * With non-blocking I/O, this will only work if timer - * callbacks were set with \c mbedtls_ssl_set_timer_cb(). - * - * \note With non-blocking I/O, you may also skip this function - * altogether and handle timeouts at the application layer. - */ -void mbedtls_ssl_conf_read_timeout( mbedtls_ssl_config *conf, uint32_t timeout ); - -/** - * \brief Set the timer callbacks (Mandatory for DTLS.) - * - * \param ssl SSL context - * \param p_timer parameter (context) shared by timer callbacks - * \param f_set_timer set timer callback - * \param f_get_timer get timer callback. Must return: - * - * \note See the documentation of \c mbedtls_ssl_set_timer_t and - * \c mbedtls_ssl_get_timer_t for the conventions this pair of - * callbacks must follow. - * - * \note On some platforms, timing.c provides - * \c mbedtls_timing_set_delay() and - * \c mbedtls_timing_get_delay() that are suitable for using - * here, except if using an event-driven style. - * - * \note See also the "DTLS tutorial" article in our knowledge base. - * https://tls.mbed.org/kb/how-to/dtls-tutorial - */ -void mbedtls_ssl_set_timer_cb( mbedtls_ssl_context *ssl, - void *p_timer, - mbedtls_ssl_set_timer_t *f_set_timer, - mbedtls_ssl_get_timer_t *f_get_timer ); - -/** - * \brief Callback type: generate and write session ticket - * - * \note This describes what a callback implementation should do. - * This callback should generate an encrypted and - * authenticated ticket for the session and write it to the - * output buffer. Here, ticket means the opaque ticket part - * of the NewSessionTicket structure of RFC 5077. - * - * \param p_ticket Context for the callback - * \param session SSL session to be written in the ticket - * \param start Start of the output buffer - * \param end End of the output buffer - * \param tlen On exit, holds the length written - * \param lifetime On exit, holds the lifetime of the ticket in seconds - * - * \return 0 if successful, or - * a specific MBEDTLS_ERR_XXX code. - */ -typedef int mbedtls_ssl_ticket_write_t( void *p_ticket, - const mbedtls_ssl_session *session, - unsigned char *start, - const unsigned char *end, - size_t *tlen, - uint32_t *lifetime ); - -#if defined(MBEDTLS_SSL_EXPORT_KEYS) -/** - * \brief Callback type: Export key block and master secret - * - * \note This is required for certain uses of TLS, e.g. EAP-TLS - * (RFC 5216) and Thread. The key pointers are ephemeral and - * therefore must not be stored. The master secret and keys - * should not be used directly except as an input to a key - * derivation function. - * - * \param p_expkey Context for the callback - * \param ms Pointer to master secret (fixed length: 48 bytes) - * \param kb Pointer to key block, see RFC 5246 section 6.3 - * (variable length: 2 * maclen + 2 * keylen + 2 * ivlen). - * \param maclen MAC length - * \param keylen Key length - * \param ivlen IV length - * - * \return 0 if successful, or - * a specific MBEDTLS_ERR_XXX code. - */ -typedef int mbedtls_ssl_export_keys_t( void *p_expkey, - const unsigned char *ms, - const unsigned char *kb, - size_t maclen, - size_t keylen, - size_t ivlen ); -#endif /* MBEDTLS_SSL_EXPORT_KEYS */ - -/** - * \brief Callback type: parse and load session ticket - * - * \note This describes what a callback implementation should do. - * This callback should parse a session ticket as generated - * by the corresponding mbedtls_ssl_ticket_write_t function, - * and, if the ticket is authentic and valid, load the - * session. - * - * \note The implementation is allowed to modify the first len - * bytes of the input buffer, eg to use it as a temporary - * area for the decrypted ticket contents. - * - * \param p_ticket Context for the callback - * \param session SSL session to be loaded - * \param buf Start of the buffer containing the ticket - * \param len Length of the ticket. - * - * \return 0 if successful, or - * MBEDTLS_ERR_SSL_INVALID_MAC if not authentic, or - * MBEDTLS_ERR_SSL_SESSION_TICKET_EXPIRED if expired, or - * any other non-zero code for other failures. - */ -typedef int mbedtls_ssl_ticket_parse_t( void *p_ticket, - mbedtls_ssl_session *session, - unsigned char *buf, - size_t len ); - -#if defined(MBEDTLS_SSL_SESSION_TICKETS) && defined(MBEDTLS_SSL_SRV_C) -/** - * \brief Configure SSL session ticket callbacks (server only). - * (Default: none.) - * - * \note On server, session tickets are enabled by providing - * non-NULL callbacks. - * - * \note On client, use \c mbedtls_ssl_conf_session_tickets(). - * - * \param conf SSL configuration context - * \param f_ticket_write Callback for writing a ticket - * \param f_ticket_parse Callback for parsing a ticket - * \param p_ticket Context shared by the two callbacks - */ -void mbedtls_ssl_conf_session_tickets_cb( mbedtls_ssl_config *conf, - mbedtls_ssl_ticket_write_t *f_ticket_write, - mbedtls_ssl_ticket_parse_t *f_ticket_parse, - void *p_ticket ); -#endif /* MBEDTLS_SSL_SESSION_TICKETS && MBEDTLS_SSL_SRV_C */ - -#if defined(MBEDTLS_SSL_EXPORT_KEYS) -/** - * \brief Configure key export callback. - * (Default: none.) - * - * \note See \c mbedtls_ssl_export_keys_t. - * - * \param conf SSL configuration context - * \param f_export_keys Callback for exporting keys - * \param p_export_keys Context for the callback - */ -void mbedtls_ssl_conf_export_keys_cb( mbedtls_ssl_config *conf, - mbedtls_ssl_export_keys_t *f_export_keys, - void *p_export_keys ); -#endif /* MBEDTLS_SSL_EXPORT_KEYS */ - -#if defined(MBEDTLS_SSL_ASYNC_PRIVATE) -/** - * \brief Configure asynchronous private key operation callbacks. - * - * \param conf SSL configuration context - * \param f_async_sign Callback to start a signature operation. See - * the description of ::mbedtls_ssl_async_sign_t - * for more information. This may be \c NULL if the - * external processor does not support any signature - * operation; in this case the private key object - * associated with the certificate will be used. - * \param f_async_decrypt Callback to start a decryption operation. See - * the description of ::mbedtls_ssl_async_decrypt_t - * for more information. This may be \c NULL if the - * external processor does not support any decryption - * operation; in this case the private key object - * associated with the certificate will be used. - * \param f_async_resume Callback to resume an asynchronous operation. See - * the description of ::mbedtls_ssl_async_resume_t - * for more information. This may not be \c NULL unless - * \p f_async_sign and \p f_async_decrypt are both - * \c NULL. - * \param f_async_cancel Callback to cancel an asynchronous operation. See - * the description of ::mbedtls_ssl_async_cancel_t - * for more information. This may be \c NULL if - * no cleanup is needed. - * \param config_data A pointer to configuration data which can be - * retrieved with - * mbedtls_ssl_conf_get_async_config_data(). The - * library stores this value without dereferencing it. - */ -void mbedtls_ssl_conf_async_private_cb( mbedtls_ssl_config *conf, - mbedtls_ssl_async_sign_t *f_async_sign, - mbedtls_ssl_async_decrypt_t *f_async_decrypt, - mbedtls_ssl_async_resume_t *f_async_resume, - mbedtls_ssl_async_cancel_t *f_async_cancel, - void *config_data ); - -/** - * \brief Retrieve the configuration data set by - * mbedtls_ssl_conf_async_private_cb(). - * - * \param conf SSL configuration context - * \return The configuration data set by - * mbedtls_ssl_conf_async_private_cb(). - */ -void *mbedtls_ssl_conf_get_async_config_data( const mbedtls_ssl_config *conf ); - -/** - * \brief Retrieve the asynchronous operation user context. - * - * \note This function may only be called while a handshake - * is in progress. - * - * \param ssl The SSL context to access. - * - * \return The asynchronous operation user context that was last - * set during the current handshake. If - * mbedtls_ssl_set_async_operation_data() has not yet been - * called during the current handshake, this function returns - * \c NULL. - */ -void *mbedtls_ssl_get_async_operation_data( const mbedtls_ssl_context *ssl ); - -/** - * \brief Retrieve the asynchronous operation user context. - * - * \note This function may only be called while a handshake - * is in progress. - * - * \param ssl The SSL context to access. - * \param ctx The new value of the asynchronous operation user context. - * Call mbedtls_ssl_get_async_operation_data() later during the - * same handshake to retrieve this value. - */ -void mbedtls_ssl_set_async_operation_data( mbedtls_ssl_context *ssl, - void *ctx ); -#endif /* MBEDTLS_SSL_ASYNC_PRIVATE */ - -/** - * \brief Callback type: generate a cookie - * - * \param ctx Context for the callback - * \param p Buffer to write to, - * must be updated to point right after the cookie - * \param end Pointer to one past the end of the output buffer - * \param info Client ID info that was passed to - * \c mbedtls_ssl_set_client_transport_id() - * \param ilen Length of info in bytes - * - * \return The callback must return 0 on success, - * or a negative error code. - */ -typedef int mbedtls_ssl_cookie_write_t( void *ctx, - unsigned char **p, unsigned char *end, - const unsigned char *info, size_t ilen ); - -/** - * \brief Callback type: verify a cookie - * - * \param ctx Context for the callback - * \param cookie Cookie to verify - * \param clen Length of cookie - * \param info Client ID info that was passed to - * \c mbedtls_ssl_set_client_transport_id() - * \param ilen Length of info in bytes - * - * \return The callback must return 0 if cookie is valid, - * or a negative error code. - */ -typedef int mbedtls_ssl_cookie_check_t( void *ctx, - const unsigned char *cookie, size_t clen, - const unsigned char *info, size_t ilen ); - -#if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) && defined(MBEDTLS_SSL_SRV_C) -/** - * \brief Register callbacks for DTLS cookies - * (Server only. DTLS only.) - * - * Default: dummy callbacks that fail, in order to force you to - * register working callbacks (and initialize their context). - * - * To disable HelloVerifyRequest, register NULL callbacks. - * - * \warning Disabling hello verification allows your server to be used - * for amplification in DoS attacks against other hosts. - * Only disable if you known this can't happen in your - * particular environment. - * - * \note See comments on \c mbedtls_ssl_handshake() about handling - * the MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED that is expected - * on the first handshake attempt when this is enabled. - * - * \note This is also necessary to handle client reconnection from - * the same port as described in RFC 6347 section 4.2.8 (only - * the variant with cookies is supported currently). See - * comments on \c mbedtls_ssl_read() for details. - * - * \param conf SSL configuration - * \param f_cookie_write Cookie write callback - * \param f_cookie_check Cookie check callback - * \param p_cookie Context for both callbacks - */ -void mbedtls_ssl_conf_dtls_cookies( mbedtls_ssl_config *conf, - mbedtls_ssl_cookie_write_t *f_cookie_write, - mbedtls_ssl_cookie_check_t *f_cookie_check, - void *p_cookie ); - -/** - * \brief Set client's transport-level identification info. - * (Server only. DTLS only.) - * - * This is usually the IP address (and port), but could be - * anything identify the client depending on the underlying - * network stack. Used for HelloVerifyRequest with DTLS. - * This is *not* used to route the actual packets. - * - * \param ssl SSL context - * \param info Transport-level info identifying the client (eg IP + port) - * \param ilen Length of info in bytes - * - * \note An internal copy is made, so the info buffer can be reused. - * - * \return 0 on success, - * MBEDTLS_ERR_SSL_BAD_INPUT_DATA if used on client, - * MBEDTLS_ERR_SSL_ALLOC_FAILED if out of memory. - */ -int mbedtls_ssl_set_client_transport_id( mbedtls_ssl_context *ssl, - const unsigned char *info, - size_t ilen ); - -#endif /* MBEDTLS_SSL_DTLS_HELLO_VERIFY && MBEDTLS_SSL_SRV_C */ - -#if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) -/** - * \brief Enable or disable anti-replay protection for DTLS. - * (DTLS only, no effect on TLS.) - * Default: enabled. - * - * \param conf SSL configuration - * \param mode MBEDTLS_SSL_ANTI_REPLAY_ENABLED or MBEDTLS_SSL_ANTI_REPLAY_DISABLED. - * - * \warning Disabling this is a security risk unless the application - * protocol handles duplicated packets in a safe way. You - * should not disable this without careful consideration. - * However, if your application already detects duplicated - * packets and needs information about them to adjust its - * transmission strategy, then you'll want to disable this. - */ -void mbedtls_ssl_conf_dtls_anti_replay( mbedtls_ssl_config *conf, char mode ); -#endif /* MBEDTLS_SSL_DTLS_ANTI_REPLAY */ - -#if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT) -/** - * \brief Set a limit on the number of records with a bad MAC - * before terminating the connection. - * (DTLS only, no effect on TLS.) - * Default: 0 (disabled). - * - * \param conf SSL configuration - * \param limit Limit, or 0 to disable. - * - * \note If the limit is N, then the connection is terminated when - * the Nth non-authentic record is seen. - * - * \note Records with an invalid header are not counted, only the - * ones going through the authentication-decryption phase. - * - * \note This is a security trade-off related to the fact that it's - * often relatively easy for an active attacker ot inject UDP - * datagrams. On one hand, setting a low limit here makes it - * easier for such an attacker to forcibly terminated a - * connection. On the other hand, a high limit or no limit - * might make us waste resources checking authentication on - * many bogus packets. - */ -void mbedtls_ssl_conf_dtls_badmac_limit( mbedtls_ssl_config *conf, unsigned limit ); -#endif /* MBEDTLS_SSL_DTLS_BADMAC_LIMIT */ - -#if defined(MBEDTLS_SSL_PROTO_DTLS) - -/** - * \brief Allow or disallow packing of multiple handshake records - * within a single datagram. - * - * \param ssl The SSL context to configure. - * \param allow_packing This determines whether datagram packing may - * be used or not. A value of \c 0 means that every - * record will be sent in a separate datagram; a - * value of \c 1 means that, if space permits, - * multiple handshake messages (including CCS) belonging to - * a single flight may be packed within a single datagram. - * - * \note This is enabled by default and should only be disabled - * for test purposes, or if datagram packing causes - * interoperability issues with peers that don't support it. - * - * \note Allowing datagram packing reduces the network load since - * there's less overhead if multiple messages share the same - * datagram. Also, it increases the handshake efficiency - * since messages belonging to a single datagram will not - * be reordered in transit, and so future message buffering - * or flight retransmission (if no buffering is used) as - * means to deal with reordering are needed less frequently. - * - * \note Application records are not affected by this option and - * are currently always sent in separate datagrams. - * - */ -void mbedtls_ssl_set_datagram_packing( mbedtls_ssl_context *ssl, - unsigned allow_packing ); - -/** - * \brief Set retransmit timeout values for the DTLS handshake. - * (DTLS only, no effect on TLS.) - * - * \param conf SSL configuration - * \param min Initial timeout value in milliseconds. - * Default: 1000 (1 second). - * \param max Maximum timeout value in milliseconds. - * Default: 60000 (60 seconds). - * - * \note Default values are from RFC 6347 section 4.2.4.1. - * - * \note The 'min' value should typically be slightly above the - * expected round-trip time to your peer, plus whatever time - * it takes for the peer to process the message. For example, - * if your RTT is about 600ms and you peer needs up to 1s to - * do the cryptographic operations in the handshake, then you - * should set 'min' slightly above 1600. Lower values of 'min' - * might cause spurious resends which waste network resources, - * while larger value of 'min' will increase overall latency - * on unreliable network links. - * - * \note The more unreliable your network connection is, the larger - * your max / min ratio needs to be in order to achieve - * reliable handshakes. - * - * \note Messages are retransmitted up to log2(ceil(max/min)) times. - * For example, if min = 1s and max = 5s, the retransmit plan - * goes: send ... 1s -> resend ... 2s -> resend ... 4s -> - * resend ... 5s -> give up and return a timeout error. - */ -void mbedtls_ssl_conf_handshake_timeout( mbedtls_ssl_config *conf, uint32_t min, uint32_t max ); -#endif /* MBEDTLS_SSL_PROTO_DTLS */ - -#if defined(MBEDTLS_SSL_SRV_C) -/** - * \brief Set the session cache callbacks (server-side only) - * If not set, no session resuming is done (except if session - * tickets are enabled too). - * - * The session cache has the responsibility to check for stale - * entries based on timeout. See RFC 5246 for recommendations. - * - * Warning: session.peer_cert is cleared by the SSL/TLS layer on - * connection shutdown, so do not cache the pointer! Either set - * it to NULL or make a full copy of the certificate. - * - * The get callback is called once during the initial handshake - * to enable session resuming. The get function has the - * following parameters: (void *parameter, mbedtls_ssl_session *session) - * If a valid entry is found, it should fill the master of - * the session object with the cached values and return 0, - * return 1 otherwise. Optionally peer_cert can be set as well - * if it is properly present in cache entry. - * - * The set callback is called once during the initial handshake - * to enable session resuming after the entire handshake has - * been finished. The set function has the following parameters: - * (void *parameter, const mbedtls_ssl_session *session). The function - * should create a cache entry for future retrieval based on - * the data in the session structure and should keep in mind - * that the mbedtls_ssl_session object presented (and all its referenced - * data) is cleared by the SSL/TLS layer when the connection is - * terminated. It is recommended to add metadata to determine if - * an entry is still valid in the future. Return 0 if - * successfully cached, return 1 otherwise. - * - * \param conf SSL configuration - * \param p_cache parmater (context) for both callbacks - * \param f_get_cache session get callback - * \param f_set_cache session set callback - */ -void mbedtls_ssl_conf_session_cache( mbedtls_ssl_config *conf, - void *p_cache, - int (*f_get_cache)(void *, mbedtls_ssl_session *), - int (*f_set_cache)(void *, const mbedtls_ssl_session *) ); -#endif /* MBEDTLS_SSL_SRV_C */ - -#if defined(MBEDTLS_SSL_CLI_C) -/** - * \brief Request resumption of session (client-side only) - * Session data is copied from presented session structure. - * - * \param ssl SSL context - * \param session session context - * - * \return 0 if successful, - * MBEDTLS_ERR_SSL_ALLOC_FAILED if memory allocation failed, - * MBEDTLS_ERR_SSL_BAD_INPUT_DATA if used server-side or - * arguments are otherwise invalid - * - * \sa mbedtls_ssl_get_session() - */ -int mbedtls_ssl_set_session( mbedtls_ssl_context *ssl, const mbedtls_ssl_session *session ); -#endif /* MBEDTLS_SSL_CLI_C */ - -/** - * \brief Set the list of allowed ciphersuites and the preference - * order. First in the list has the highest preference. - * (Overrides all version-specific lists) - * - * The ciphersuites array is not copied, and must remain - * valid for the lifetime of the ssl_config. - * - * Note: The server uses its own preferences - * over the preference of the client unless - * MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE is defined! - * - * \param conf SSL configuration - * \param ciphersuites 0-terminated list of allowed ciphersuites - */ -void mbedtls_ssl_conf_ciphersuites( mbedtls_ssl_config *conf, - const int *ciphersuites ); - -/** - * \brief Set the list of allowed ciphersuites and the - * preference order for a specific version of the protocol. - * (Only useful on the server side) - * - * The ciphersuites array is not copied, and must remain - * valid for the lifetime of the ssl_config. - * - * \param conf SSL configuration - * \param ciphersuites 0-terminated list of allowed ciphersuites - * \param major Major version number (only MBEDTLS_SSL_MAJOR_VERSION_3 - * supported) - * \param minor Minor version number (MBEDTLS_SSL_MINOR_VERSION_0, - * MBEDTLS_SSL_MINOR_VERSION_1 and MBEDTLS_SSL_MINOR_VERSION_2, - * MBEDTLS_SSL_MINOR_VERSION_3 supported) - * - * \note With DTLS, use MBEDTLS_SSL_MINOR_VERSION_2 for DTLS 1.0 - * and MBEDTLS_SSL_MINOR_VERSION_3 for DTLS 1.2 - */ -void mbedtls_ssl_conf_ciphersuites_for_version( mbedtls_ssl_config *conf, - const int *ciphersuites, - int major, int minor ); - -#if defined(MBEDTLS_X509_CRT_PARSE_C) -/** - * \brief Set the X.509 security profile used for verification - * - * \note The restrictions are enforced for all certificates in the - * chain. However, signatures in the handshake are not covered - * by this setting but by \b mbedtls_ssl_conf_sig_hashes(). - * - * \param conf SSL configuration - * \param profile Profile to use - */ -void mbedtls_ssl_conf_cert_profile( mbedtls_ssl_config *conf, - const mbedtls_x509_crt_profile *profile ); - -/** - * \brief Set the data required to verify peer certificate - * - * \note See \c mbedtls_x509_crt_verify() for notes regarding the - * parameters ca_chain (maps to trust_ca for that function) - * and ca_crl. - * - * \param conf SSL configuration - * \param ca_chain trusted CA chain (meaning all fully trusted top-level CAs) - * \param ca_crl trusted CA CRLs - */ -void mbedtls_ssl_conf_ca_chain( mbedtls_ssl_config *conf, - mbedtls_x509_crt *ca_chain, - mbedtls_x509_crl *ca_crl ); - -/** - * \brief Set own certificate chain and private key - * - * \note own_cert should contain in order from the bottom up your - * certificate chain. The top certificate (self-signed) - * can be omitted. - * - * \note On server, this function can be called multiple times to - * provision more than one cert/key pair (eg one ECDSA, one - * RSA with SHA-256, one RSA with SHA-1). An adequate - * certificate will be selected according to the client's - * advertised capabilities. In case mutliple certificates are - * adequate, preference is given to the one set by the first - * call to this function, then second, etc. - * - * \note On client, only the first call has any effect. That is, - * only one client certificate can be provisioned. The - * server's preferences in its CertficateRequest message will - * be ignored and our only cert will be sent regardless of - * whether it matches those preferences - the server can then - * decide what it wants to do with it. - * - * \param conf SSL configuration - * \param own_cert own public certificate chain - * \param pk_key own private key - * - * \return 0 on success or MBEDTLS_ERR_SSL_ALLOC_FAILED - */ -int mbedtls_ssl_conf_own_cert( mbedtls_ssl_config *conf, - mbedtls_x509_crt *own_cert, - mbedtls_pk_context *pk_key ); -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - -#if defined(MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED) -/** - * \brief Set the Pre Shared Key (PSK) and the expected identity name - * - * \note This is mainly useful for clients. Servers will usually - * want to use \c mbedtls_ssl_conf_psk_cb() instead. - * - * \note Currently clients can only register one pre-shared key. - * In other words, the servers' identity hint is ignored. - * Support for setting multiple PSKs on clients and selecting - * one based on the identity hint is not a planned feature but - * feedback is welcomed. - * - * \param conf SSL configuration - * \param psk pointer to the pre-shared key - * \param psk_len pre-shared key length - * \param psk_identity pointer to the pre-shared key identity - * \param psk_identity_len identity key length - * - * \return 0 if successful or MBEDTLS_ERR_SSL_ALLOC_FAILED - */ -int mbedtls_ssl_conf_psk( mbedtls_ssl_config *conf, - const unsigned char *psk, size_t psk_len, - const unsigned char *psk_identity, size_t psk_identity_len ); - - -/** - * \brief Set the Pre Shared Key (PSK) for the current handshake - * - * \note This should only be called inside the PSK callback, - * ie the function passed to \c mbedtls_ssl_conf_psk_cb(). - * - * \param ssl SSL context - * \param psk pointer to the pre-shared key - * \param psk_len pre-shared key length - * - * \return 0 if successful or MBEDTLS_ERR_SSL_ALLOC_FAILED - */ -int mbedtls_ssl_set_hs_psk( mbedtls_ssl_context *ssl, - const unsigned char *psk, size_t psk_len ); - -/** - * \brief Set the PSK callback (server-side only). - * - * If set, the PSK callback is called for each - * handshake where a PSK ciphersuite was negotiated. - * The caller provides the identity received and wants to - * receive the actual PSK data and length. - * - * The callback has the following parameters: (void *parameter, - * mbedtls_ssl_context *ssl, const unsigned char *psk_identity, - * size_t identity_len) - * If a valid PSK identity is found, the callback should use - * \c mbedtls_ssl_set_hs_psk() on the ssl context to set the - * correct PSK and return 0. - * Any other return value will result in a denied PSK identity. - * - * \note If you set a PSK callback using this function, then you - * don't need to set a PSK key and identity using - * \c mbedtls_ssl_conf_psk(). - * - * \param conf SSL configuration - * \param f_psk PSK identity function - * \param p_psk PSK identity parameter - */ -void mbedtls_ssl_conf_psk_cb( mbedtls_ssl_config *conf, - int (*f_psk)(void *, mbedtls_ssl_context *, const unsigned char *, - size_t), - void *p_psk ); -#endif /* MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED */ - -#if defined(MBEDTLS_DHM_C) && defined(MBEDTLS_SSL_SRV_C) - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) - -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif - -/** - * \brief Set the Diffie-Hellman public P and G values, - * read as hexadecimal strings (server-side only) - * (Default values: MBEDTLS_DHM_RFC3526_MODP_2048_[PG]) - * - * \param conf SSL configuration - * \param dhm_P Diffie-Hellman-Merkle modulus - * \param dhm_G Diffie-Hellman-Merkle generator - * - * \deprecated Superseded by \c mbedtls_ssl_conf_dh_param_bin. - * - * \return 0 if successful - */ -MBEDTLS_DEPRECATED int mbedtls_ssl_conf_dh_param( mbedtls_ssl_config *conf, - const char *dhm_P, - const char *dhm_G ); - -#endif /* MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief Set the Diffie-Hellman public P and G values - * from big-endian binary presentations. - * (Default values: MBEDTLS_DHM_RFC3526_MODP_2048_[PG]_BIN) - * - * \param conf SSL configuration - * \param dhm_P Diffie-Hellman-Merkle modulus in big-endian binary form - * \param P_len Length of DHM modulus - * \param dhm_G Diffie-Hellman-Merkle generator in big-endian binary form - * \param G_len Length of DHM generator - * - * \return 0 if successful - */ -int mbedtls_ssl_conf_dh_param_bin( mbedtls_ssl_config *conf, - const unsigned char *dhm_P, size_t P_len, - const unsigned char *dhm_G, size_t G_len ); - -/** - * \brief Set the Diffie-Hellman public P and G values, - * read from existing context (server-side only) - * - * \param conf SSL configuration - * \param dhm_ctx Diffie-Hellman-Merkle context - * - * \return 0 if successful - */ -int mbedtls_ssl_conf_dh_param_ctx( mbedtls_ssl_config *conf, mbedtls_dhm_context *dhm_ctx ); -#endif /* MBEDTLS_DHM_C && defined(MBEDTLS_SSL_SRV_C) */ - -#if defined(MBEDTLS_DHM_C) && defined(MBEDTLS_SSL_CLI_C) -/** - * \brief Set the minimum length for Diffie-Hellman parameters. - * (Client-side only.) - * (Default: 1024 bits.) - * - * \param conf SSL configuration - * \param bitlen Minimum bit length of the DHM prime - */ -void mbedtls_ssl_conf_dhm_min_bitlen( mbedtls_ssl_config *conf, - unsigned int bitlen ); -#endif /* MBEDTLS_DHM_C && MBEDTLS_SSL_CLI_C */ - -#if defined(MBEDTLS_ECP_C) -/** - * \brief Set the allowed curves in order of preference. - * (Default: all defined curves.) - * - * On server: this only affects selection of the ECDHE curve; - * the curves used for ECDH and ECDSA are determined by the - * list of available certificates instead. - * - * On client: this affects the list of curves offered for any - * use. The server can override our preference order. - * - * Both sides: limits the set of curves accepted for use in - * ECDHE and in the peer's end-entity certificate. - * - * \note This has no influence on which curves are allowed inside the - * certificate chains, see \c mbedtls_ssl_conf_cert_profile() - * for that. For the end-entity certificate however, the key - * will be accepted only if it is allowed both by this list - * and by the cert profile. - * - * \note This list should be ordered by decreasing preference - * (preferred curve first). - * - * \param conf SSL configuration - * \param curves Ordered list of allowed curves, - * terminated by MBEDTLS_ECP_DP_NONE. - */ -void mbedtls_ssl_conf_curves( mbedtls_ssl_config *conf, - const mbedtls_ecp_group_id *curves ); -#endif /* MBEDTLS_ECP_C */ - -#if defined(MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED) -/** - * \brief Set the allowed hashes for signatures during the handshake. - * (Default: all available hashes except MD5.) - * - * \note This only affects which hashes are offered and can be used - * for signatures during the handshake. Hashes for message - * authentication and the TLS PRF are controlled by the - * ciphersuite, see \c mbedtls_ssl_conf_ciphersuites(). Hashes - * used for certificate signature are controlled by the - * verification profile, see \c mbedtls_ssl_conf_cert_profile(). - * - * \note This list should be ordered by decreasing preference - * (preferred hash first). - * - * \param conf SSL configuration - * \param hashes Ordered list of allowed signature hashes, - * terminated by \c MBEDTLS_MD_NONE. - */ -void mbedtls_ssl_conf_sig_hashes( mbedtls_ssl_config *conf, - const int *hashes ); -#endif /* MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED */ - -#if defined(MBEDTLS_X509_CRT_PARSE_C) -/** - * \brief Set or reset the hostname to check against the received - * server certificate. It sets the ServerName TLS extension, - * too, if that extension is enabled. (client-side only) - * - * \param ssl SSL context - * \param hostname the server hostname, may be NULL to clear hostname - - * \note Maximum hostname length MBEDTLS_SSL_MAX_HOST_NAME_LEN. - * - * \return 0 if successful, MBEDTLS_ERR_SSL_ALLOC_FAILED on - * allocation failure, MBEDTLS_ERR_SSL_BAD_INPUT_DATA on - * too long input hostname. - * - * Hostname set to the one provided on success (cleared - * when NULL). On allocation failure hostname is cleared. - * On too long input failure, old hostname is unchanged. - */ -int mbedtls_ssl_set_hostname( mbedtls_ssl_context *ssl, const char *hostname ); -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - -#if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) -/** - * \brief Set own certificate and key for the current handshake - * - * \note Same as \c mbedtls_ssl_conf_own_cert() but for use within - * the SNI callback. - * - * \param ssl SSL context - * \param own_cert own public certificate chain - * \param pk_key own private key - * - * \return 0 on success or MBEDTLS_ERR_SSL_ALLOC_FAILED - */ -int mbedtls_ssl_set_hs_own_cert( mbedtls_ssl_context *ssl, - mbedtls_x509_crt *own_cert, - mbedtls_pk_context *pk_key ); - -/** - * \brief Set the data required to verify peer certificate for the - * current handshake - * - * \note Same as \c mbedtls_ssl_conf_ca_chain() but for use within - * the SNI callback. - * - * \param ssl SSL context - * \param ca_chain trusted CA chain (meaning all fully trusted top-level CAs) - * \param ca_crl trusted CA CRLs - */ -void mbedtls_ssl_set_hs_ca_chain( mbedtls_ssl_context *ssl, - mbedtls_x509_crt *ca_chain, - mbedtls_x509_crl *ca_crl ); - -/** - * \brief Set authmode for the current handshake. - * - * \note Same as \c mbedtls_ssl_conf_authmode() but for use within - * the SNI callback. - * - * \param ssl SSL context - * \param authmode MBEDTLS_SSL_VERIFY_NONE, MBEDTLS_SSL_VERIFY_OPTIONAL or - * MBEDTLS_SSL_VERIFY_REQUIRED - */ -void mbedtls_ssl_set_hs_authmode( mbedtls_ssl_context *ssl, - int authmode ); - -/** - * \brief Set server side ServerName TLS extension callback - * (optional, server-side only). - * - * If set, the ServerName callback is called whenever the - * server receives a ServerName TLS extension from the client - * during a handshake. The ServerName callback has the - * following parameters: (void *parameter, mbedtls_ssl_context *ssl, - * const unsigned char *hostname, size_t len). If a suitable - * certificate is found, the callback must set the - * certificate(s) and key(s) to use with \c - * mbedtls_ssl_set_hs_own_cert() (can be called repeatedly), - * and may optionally adjust the CA and associated CRL with \c - * mbedtls_ssl_set_hs_ca_chain() as well as the client - * authentication mode with \c mbedtls_ssl_set_hs_authmode(), - * then must return 0. If no matching name is found, the - * callback must either set a default cert, or - * return non-zero to abort the handshake at this point. - * - * \param conf SSL configuration - * \param f_sni verification function - * \param p_sni verification parameter - */ -void mbedtls_ssl_conf_sni( mbedtls_ssl_config *conf, - int (*f_sni)(void *, mbedtls_ssl_context *, const unsigned char *, - size_t), - void *p_sni ); -#endif /* MBEDTLS_SSL_SERVER_NAME_INDICATION */ - -#if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) -/** - * \brief Set the EC J-PAKE password for current handshake. - * - * \note An internal copy is made, and destroyed as soon as the - * handshake is completed, or when the SSL context is reset or - * freed. - * - * \note The SSL context needs to be already set up. The right place - * to call this function is between \c mbedtls_ssl_setup() or - * \c mbedtls_ssl_reset() and \c mbedtls_ssl_handshake(). - * - * \param ssl SSL context - * \param pw EC J-PAKE password (pre-shared secret) - * \param pw_len length of pw in bytes - * - * \return 0 on success, or a negative error code. - */ -int mbedtls_ssl_set_hs_ecjpake_password( mbedtls_ssl_context *ssl, - const unsigned char *pw, - size_t pw_len ); -#endif /*MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED */ - -#if defined(MBEDTLS_SSL_ALPN) -/** - * \brief Set the supported Application Layer Protocols. - * - * \param conf SSL configuration - * \param protos Pointer to a NULL-terminated list of supported protocols, - * in decreasing preference order. The pointer to the list is - * recorded by the library for later reference as required, so - * the lifetime of the table must be atleast as long as the - * lifetime of the SSL configuration structure. - * - * \return 0 on success, or MBEDTLS_ERR_SSL_BAD_INPUT_DATA. - */ -int mbedtls_ssl_conf_alpn_protocols( mbedtls_ssl_config *conf, const char **protos ); - -/** - * \brief Get the name of the negotiated Application Layer Protocol. - * This function should be called after the handshake is - * completed. - * - * \param ssl SSL context - * - * \return Protcol name, or NULL if no protocol was negotiated. - */ -const char *mbedtls_ssl_get_alpn_protocol( const mbedtls_ssl_context *ssl ); -#endif /* MBEDTLS_SSL_ALPN */ - -/** - * \brief Set the maximum supported version sent from the client side - * and/or accepted at the server side - * (Default: MBEDTLS_SSL_MAX_MAJOR_VERSION, MBEDTLS_SSL_MAX_MINOR_VERSION) - * - * \note This ignores ciphersuites from higher versions. - * - * \note With DTLS, use MBEDTLS_SSL_MINOR_VERSION_2 for DTLS 1.0 and - * MBEDTLS_SSL_MINOR_VERSION_3 for DTLS 1.2 - * - * \param conf SSL configuration - * \param major Major version number (only MBEDTLS_SSL_MAJOR_VERSION_3 supported) - * \param minor Minor version number (MBEDTLS_SSL_MINOR_VERSION_0, - * MBEDTLS_SSL_MINOR_VERSION_1 and MBEDTLS_SSL_MINOR_VERSION_2, - * MBEDTLS_SSL_MINOR_VERSION_3 supported) - */ -void mbedtls_ssl_conf_max_version( mbedtls_ssl_config *conf, int major, int minor ); - -/** - * \brief Set the minimum accepted SSL/TLS protocol version - * (Default: TLS 1.0) - * - * \note Input outside of the SSL_MAX_XXXXX_VERSION and - * SSL_MIN_XXXXX_VERSION range is ignored. - * - * \note MBEDTLS_SSL_MINOR_VERSION_0 (SSL v3) should be avoided. - * - * \note With DTLS, use MBEDTLS_SSL_MINOR_VERSION_2 for DTLS 1.0 and - * MBEDTLS_SSL_MINOR_VERSION_3 for DTLS 1.2 - * - * \param conf SSL configuration - * \param major Major version number (only MBEDTLS_SSL_MAJOR_VERSION_3 supported) - * \param minor Minor version number (MBEDTLS_SSL_MINOR_VERSION_0, - * MBEDTLS_SSL_MINOR_VERSION_1 and MBEDTLS_SSL_MINOR_VERSION_2, - * MBEDTLS_SSL_MINOR_VERSION_3 supported) - */ -void mbedtls_ssl_conf_min_version( mbedtls_ssl_config *conf, int major, int minor ); - -#if defined(MBEDTLS_SSL_FALLBACK_SCSV) && defined(MBEDTLS_SSL_CLI_C) -/** - * \brief Set the fallback flag (client-side only). - * (Default: MBEDTLS_SSL_IS_NOT_FALLBACK). - * - * \note Set to MBEDTLS_SSL_IS_FALLBACK when preparing a fallback - * connection, that is a connection with max_version set to a - * lower value than the value you're willing to use. Such - * fallback connections are not recommended but are sometimes - * necessary to interoperate with buggy (version-intolerant) - * servers. - * - * \warning You should NOT set this to MBEDTLS_SSL_IS_FALLBACK for - * non-fallback connections! This would appear to work for a - * while, then cause failures when the server is upgraded to - * support a newer TLS version. - * - * \param conf SSL configuration - * \param fallback MBEDTLS_SSL_IS_NOT_FALLBACK or MBEDTLS_SSL_IS_FALLBACK - */ -void mbedtls_ssl_conf_fallback( mbedtls_ssl_config *conf, char fallback ); -#endif /* MBEDTLS_SSL_FALLBACK_SCSV && MBEDTLS_SSL_CLI_C */ - -#if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) -/** - * \brief Enable or disable Encrypt-then-MAC - * (Default: MBEDTLS_SSL_ETM_ENABLED) - * - * \note This should always be enabled, it is a security - * improvement, and should not cause any interoperability - * issue (used only if the peer supports it too). - * - * \param conf SSL configuration - * \param etm MBEDTLS_SSL_ETM_ENABLED or MBEDTLS_SSL_ETM_DISABLED - */ -void mbedtls_ssl_conf_encrypt_then_mac( mbedtls_ssl_config *conf, char etm ); -#endif /* MBEDTLS_SSL_ENCRYPT_THEN_MAC */ - -#if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET) -/** - * \brief Enable or disable Extended Master Secret negotiation. - * (Default: MBEDTLS_SSL_EXTENDED_MS_ENABLED) - * - * \note This should always be enabled, it is a security fix to the - * protocol, and should not cause any interoperability issue - * (used only if the peer supports it too). - * - * \param conf SSL configuration - * \param ems MBEDTLS_SSL_EXTENDED_MS_ENABLED or MBEDTLS_SSL_EXTENDED_MS_DISABLED - */ -void mbedtls_ssl_conf_extended_master_secret( mbedtls_ssl_config *conf, char ems ); -#endif /* MBEDTLS_SSL_EXTENDED_MASTER_SECRET */ - -#if defined(MBEDTLS_ARC4_C) -/** - * \brief Disable or enable support for RC4 - * (Default: MBEDTLS_SSL_ARC4_DISABLED) - * - * \warning Use of RC4 in DTLS/TLS has been prohibited by RFC 7465 - * for security reasons. Use at your own risk. - * - * \note This function is deprecated and will likely be removed in - * a future version of the library. - * RC4 is disabled by default at compile time and needs to be - * actively enabled for use with legacy systems. - * - * \param conf SSL configuration - * \param arc4 MBEDTLS_SSL_ARC4_ENABLED or MBEDTLS_SSL_ARC4_DISABLED - */ -void mbedtls_ssl_conf_arc4_support( mbedtls_ssl_config *conf, char arc4 ); -#endif /* MBEDTLS_ARC4_C */ - -#if defined(MBEDTLS_SSL_SRV_C) -/** - * \brief Whether to send a list of acceptable CAs in - * CertificateRequest messages. - * (Default: do send) - * - * \param conf SSL configuration - * \param cert_req_ca_list MBEDTLS_SSL_CERT_REQ_CA_LIST_ENABLED or - * MBEDTLS_SSL_CERT_REQ_CA_LIST_DISABLED - */ -void mbedtls_ssl_conf_cert_req_ca_list( mbedtls_ssl_config *conf, - char cert_req_ca_list ); -#endif /* MBEDTLS_SSL_SRV_C */ - -#if defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH) -/** - * \brief Set the maximum fragment length to emit and/or negotiate - * (Default: the smaller of MBEDTLS_SSL_IN_CONTENT_LEN and - * MBEDTLS_SSL_OUT_CONTENT_LEN, usually 2^14 bytes) - * (Server: set maximum fragment length to emit, - * usually negotiated by the client during handshake - * (Client: set maximum fragment length to emit *and* - * negotiate with the server during handshake) - * - * \note With TLS, this currently only affects ApplicationData (sent - * with \c mbedtls_ssl_read()), not handshake messages. - * With DTLS, this affects both ApplicationData and handshake. - * - * \note This sets the maximum length for a record's payload, - * excluding record overhead that will be added to it, see - * \c mbedtls_ssl_get_record_expansion(). - * - * \note For DTLS, it is also possible to set a limit for the total - * size of daragrams passed to the transport layer, including - * record overhead, see \c mbedtls_ssl_set_mtu(). - * - * \param conf SSL configuration - * \param mfl_code Code for maximum fragment length (allowed values: - * MBEDTLS_SSL_MAX_FRAG_LEN_512, MBEDTLS_SSL_MAX_FRAG_LEN_1024, - * MBEDTLS_SSL_MAX_FRAG_LEN_2048, MBEDTLS_SSL_MAX_FRAG_LEN_4096) - * - * \return 0 if successful or MBEDTLS_ERR_SSL_BAD_INPUT_DATA - */ -int mbedtls_ssl_conf_max_frag_len( mbedtls_ssl_config *conf, unsigned char mfl_code ); -#endif /* MBEDTLS_SSL_MAX_FRAGMENT_LENGTH */ - -#if defined(MBEDTLS_SSL_TRUNCATED_HMAC) -/** - * \brief Activate negotiation of truncated HMAC - * (Default: MBEDTLS_SSL_TRUNC_HMAC_DISABLED) - * - * \param conf SSL configuration - * \param truncate Enable or disable (MBEDTLS_SSL_TRUNC_HMAC_ENABLED or - * MBEDTLS_SSL_TRUNC_HMAC_DISABLED) - */ -void mbedtls_ssl_conf_truncated_hmac( mbedtls_ssl_config *conf, int truncate ); -#endif /* MBEDTLS_SSL_TRUNCATED_HMAC */ - -#if defined(MBEDTLS_SSL_CBC_RECORD_SPLITTING) -/** - * \brief Enable / Disable 1/n-1 record splitting - * (Default: MBEDTLS_SSL_CBC_RECORD_SPLITTING_ENABLED) - * - * \note Only affects SSLv3 and TLS 1.0, not higher versions. - * Does not affect non-CBC ciphersuites in any version. - * - * \param conf SSL configuration - * \param split MBEDTLS_SSL_CBC_RECORD_SPLITTING_ENABLED or - * MBEDTLS_SSL_CBC_RECORD_SPLITTING_DISABLED - */ -void mbedtls_ssl_conf_cbc_record_splitting( mbedtls_ssl_config *conf, char split ); -#endif /* MBEDTLS_SSL_CBC_RECORD_SPLITTING */ - -#if defined(MBEDTLS_SSL_SESSION_TICKETS) && defined(MBEDTLS_SSL_CLI_C) -/** - * \brief Enable / Disable session tickets (client only). - * (Default: MBEDTLS_SSL_SESSION_TICKETS_ENABLED.) - * - * \note On server, use \c mbedtls_ssl_conf_session_tickets_cb(). - * - * \param conf SSL configuration - * \param use_tickets Enable or disable (MBEDTLS_SSL_SESSION_TICKETS_ENABLED or - * MBEDTLS_SSL_SESSION_TICKETS_DISABLED) - */ -void mbedtls_ssl_conf_session_tickets( mbedtls_ssl_config *conf, int use_tickets ); -#endif /* MBEDTLS_SSL_SESSION_TICKETS && MBEDTLS_SSL_CLI_C */ - -#if defined(MBEDTLS_SSL_RENEGOTIATION) -/** - * \brief Enable / Disable renegotiation support for connection when - * initiated by peer - * (Default: MBEDTLS_SSL_RENEGOTIATION_DISABLED) - * - * \warning It is recommended to always disable renegotation unless you - * know you need it and you know what you're doing. In the - * past, there have been several issues associated with - * renegotiation or a poor understanding of its properties. - * - * \note Server-side, enabling renegotiation also makes the server - * susceptible to a resource DoS by a malicious client. - * - * \param conf SSL configuration - * \param renegotiation Enable or disable (MBEDTLS_SSL_RENEGOTIATION_ENABLED or - * MBEDTLS_SSL_RENEGOTIATION_DISABLED) - */ -void mbedtls_ssl_conf_renegotiation( mbedtls_ssl_config *conf, int renegotiation ); -#endif /* MBEDTLS_SSL_RENEGOTIATION */ - -/** - * \brief Prevent or allow legacy renegotiation. - * (Default: MBEDTLS_SSL_LEGACY_NO_RENEGOTIATION) - * - * MBEDTLS_SSL_LEGACY_NO_RENEGOTIATION allows connections to - * be established even if the peer does not support - * secure renegotiation, but does not allow renegotiation - * to take place if not secure. - * (Interoperable and secure option) - * - * MBEDTLS_SSL_LEGACY_ALLOW_RENEGOTIATION allows renegotiations - * with non-upgraded peers. Allowing legacy renegotiation - * makes the connection vulnerable to specific man in the - * middle attacks. (See RFC 5746) - * (Most interoperable and least secure option) - * - * MBEDTLS_SSL_LEGACY_BREAK_HANDSHAKE breaks off connections - * if peer does not support secure renegotiation. Results - * in interoperability issues with non-upgraded peers - * that do not support renegotiation altogether. - * (Most secure option, interoperability issues) - * - * \param conf SSL configuration - * \param allow_legacy Prevent or allow (SSL_NO_LEGACY_RENEGOTIATION, - * SSL_ALLOW_LEGACY_RENEGOTIATION or - * MBEDTLS_SSL_LEGACY_BREAK_HANDSHAKE) - */ -void mbedtls_ssl_conf_legacy_renegotiation( mbedtls_ssl_config *conf, int allow_legacy ); - -#if defined(MBEDTLS_SSL_RENEGOTIATION) -/** - * \brief Enforce renegotiation requests. - * (Default: enforced, max_records = 16) - * - * When we request a renegotiation, the peer can comply or - * ignore the request. This function allows us to decide - * whether to enforce our renegotiation requests by closing - * the connection if the peer doesn't comply. - * - * However, records could already be in transit from the peer - * when the request is emitted. In order to increase - * reliability, we can accept a number of records before the - * expected handshake records. - * - * The optimal value is highly dependent on the specific usage - * scenario. - * - * \note With DTLS and server-initiated renegotiation, the - * HelloRequest is retransmited every time mbedtls_ssl_read() times - * out or receives Application Data, until: - * - max_records records have beens seen, if it is >= 0, or - * - the number of retransmits that would happen during an - * actual handshake has been reached. - * Please remember the request might be lost a few times - * if you consider setting max_records to a really low value. - * - * \warning On client, the grace period can only happen during - * mbedtls_ssl_read(), as opposed to mbedtls_ssl_write() and mbedtls_ssl_renegotiate() - * which always behave as if max_record was 0. The reason is, - * if we receive application data from the server, we need a - * place to write it, which only happens during mbedtls_ssl_read(). - * - * \param conf SSL configuration - * \param max_records Use MBEDTLS_SSL_RENEGOTIATION_NOT_ENFORCED if you don't want to - * enforce renegotiation, or a non-negative value to enforce - * it but allow for a grace period of max_records records. - */ -void mbedtls_ssl_conf_renegotiation_enforced( mbedtls_ssl_config *conf, int max_records ); - -/** - * \brief Set record counter threshold for periodic renegotiation. - * (Default: 2^48 - 1) - * - * Renegotiation is automatically triggered when a record - * counter (outgoing or ingoing) crosses the defined - * threshold. The default value is meant to prevent the - * connection from being closed when the counter is about to - * reached its maximal value (it is not allowed to wrap). - * - * Lower values can be used to enforce policies such as "keys - * must be refreshed every N packets with cipher X". - * - * The renegotiation period can be disabled by setting - * conf->disable_renegotiation to - * MBEDTLS_SSL_RENEGOTIATION_DISABLED. - * - * \note When the configured transport is - * MBEDTLS_SSL_TRANSPORT_DATAGRAM the maximum renegotiation - * period is 2^48 - 1, and for MBEDTLS_SSL_TRANSPORT_STREAM, - * the maximum renegotiation period is 2^64 - 1. - * - * \param conf SSL configuration - * \param period The threshold value: a big-endian 64-bit number. - */ -void mbedtls_ssl_conf_renegotiation_period( mbedtls_ssl_config *conf, - const unsigned char period[8] ); -#endif /* MBEDTLS_SSL_RENEGOTIATION */ - -/** - * \brief Check if there is data already read from the - * underlying transport but not yet processed. - * - * \param ssl SSL context - * - * \return 0 if nothing's pending, 1 otherwise. - * - * \note This is different in purpose and behaviour from - * \c mbedtls_ssl_get_bytes_avail in that it considers - * any kind of unprocessed data, not only unread - * application data. If \c mbedtls_ssl_get_bytes - * returns a non-zero value, this function will - * also signal pending data, but the converse does - * not hold. For example, in DTLS there might be - * further records waiting to be processed from - * the current underlying transport's datagram. - * - * \note If this function returns 1 (data pending), this - * does not imply that a subsequent call to - * \c mbedtls_ssl_read will provide any data; - * e.g., the unprocessed data might turn out - * to be an alert or a handshake message. - * - * \note This function is useful in the following situation: - * If the SSL/TLS module successfully returns from an - * operation - e.g. a handshake or an application record - * read - and you're awaiting incoming data next, you - * must not immediately idle on the underlying transport - * to have data ready, but you need to check the value - * of this function first. The reason is that the desired - * data might already be read but not yet processed. - * If, in contrast, a previous call to the SSL/TLS module - * returned MBEDTLS_ERR_SSL_WANT_READ, it is not necessary - * to call this function, as the latter error code entails - * that all internal data has been processed. - * - */ -int mbedtls_ssl_check_pending( const mbedtls_ssl_context *ssl ); - -/** - * \brief Return the number of application data bytes - * remaining to be read from the current record. - * - * \param ssl SSL context - * - * \return How many bytes are available in the application - * data record read buffer. - * - * \note When working over a datagram transport, this is - * useful to detect the current datagram's boundary - * in case \c mbedtls_ssl_read has written the maximal - * amount of data fitting into the input buffer. - * - */ -size_t mbedtls_ssl_get_bytes_avail( const mbedtls_ssl_context *ssl ); - -/** - * \brief Return the result of the certificate verification - * - * \param ssl SSL context - * - * \return 0 if successful, - * -1 if result is not available (eg because the handshake was - * aborted too early), or - * a combination of BADCERT_xxx and BADCRL_xxx flags, see - * x509.h - */ -uint32_t mbedtls_ssl_get_verify_result( const mbedtls_ssl_context *ssl ); - -/** - * \brief Return the name of the current ciphersuite - * - * \param ssl SSL context - * - * \return a string containing the ciphersuite name - */ -const char *mbedtls_ssl_get_ciphersuite( const mbedtls_ssl_context *ssl ); - -/** - * \brief Return the current SSL version (SSLv3/TLSv1/etc) - * - * \param ssl SSL context - * - * \return a string containing the SSL version - */ -const char *mbedtls_ssl_get_version( const mbedtls_ssl_context *ssl ); - -/** - * \brief Return the (maximum) number of bytes added by the record - * layer: header + encryption/MAC overhead (inc. padding) - * - * \note This function is not available (always returns an error) - * when record compression is enabled. - * - * \param ssl SSL context - * - * \return Current maximum record expansion in bytes, or - * MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE if compression is - * enabled, which makes expansion much less predictable - */ -int mbedtls_ssl_get_record_expansion( const mbedtls_ssl_context *ssl ); - -#if defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH) -/** - * \brief Return the maximum fragment length (payload, in bytes). - * This is the value negotiated with peer if any, - * or the locally configured value. - * - * \sa mbedtls_ssl_conf_max_frag_len() - * \sa mbedtls_ssl_get_max_record_payload() - * - * \param ssl SSL context - * - * \return Current maximum fragment length. - */ -size_t mbedtls_ssl_get_max_frag_len( const mbedtls_ssl_context *ssl ); -#endif /* MBEDTLS_SSL_MAX_FRAGMENT_LENGTH */ - -/** - * \brief Return the current maximum outgoing record payload in bytes. - * This takes into account the config.h setting \c - * MBEDTLS_SSL_OUT_CONTENT_LEN, the configured and negotiated - * max fragment length extension if used, and for DTLS the - * path MTU as configured and current record expansion. - * - * \note With DTLS, \c mbedtls_ssl_write() will return an error if - * called with a larger length value. - * With TLS, \c mbedtls_ssl_write() will fragment the input if - * necessary and return the number of bytes written; it is up - * to the caller to call \c mbedtls_ssl_write() again in - * order to send the remaining bytes if any. - * - * \note This function is not available (always returns an error) - * when record compression is enabled. - * - * \sa mbedtls_ssl_set_mtu() - * \sa mbedtls_ssl_get_max_frag_len() - * \sa mbedtls_ssl_get_record_expansion() - * - * \param ssl SSL context - * - * \return Current maximum payload for an outgoing record, - * or a negative error code. - */ -int mbedtls_ssl_get_max_out_record_payload( const mbedtls_ssl_context *ssl ); - -#if defined(MBEDTLS_X509_CRT_PARSE_C) -/** - * \brief Return the peer certificate from the current connection - * - * Note: Can be NULL in case no certificate was sent during - * the handshake. Different calls for the same connection can - * return the same or different pointers for the same - * certificate and even a different certificate altogether. - * The peer cert CAN change in a single connection if - * renegotiation is performed. - * - * \param ssl SSL context - * - * \return the current peer certificate - */ -const mbedtls_x509_crt *mbedtls_ssl_get_peer_cert( const mbedtls_ssl_context *ssl ); -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - -#if defined(MBEDTLS_SSL_CLI_C) -/** - * \brief Save session in order to resume it later (client-side only) - * Session data is copied to presented session structure. - * - * - * \param ssl SSL context - * \param session session context - * - * \return 0 if successful, - * MBEDTLS_ERR_SSL_ALLOC_FAILED if memory allocation failed, - * MBEDTLS_ERR_SSL_BAD_INPUT_DATA if used server-side or - * arguments are otherwise invalid. - * - * \note Only the server certificate is copied, and not the full chain, - * so you should not attempt to validate the certificate again - * by calling \c mbedtls_x509_crt_verify() on it. - * Instead, you should use the results from the verification - * in the original handshake by calling \c mbedtls_ssl_get_verify_result() - * after loading the session again into a new SSL context - * using \c mbedtls_ssl_set_session(). - * - * \note Once the session object is not needed anymore, you should - * free it by calling \c mbedtls_ssl_session_free(). - * - * \sa mbedtls_ssl_set_session() - */ -int mbedtls_ssl_get_session( const mbedtls_ssl_context *ssl, mbedtls_ssl_session *session ); -#endif /* MBEDTLS_SSL_CLI_C */ - -/** - * \brief Perform the SSL handshake - * - * \param ssl SSL context - * - * \return 0 if successful, or - * MBEDTLS_ERR_SSL_WANT_READ or MBEDTLS_ERR_SSL_WANT_WRITE, or - * MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED (see below), or - * a specific SSL error code. - * - * If this function returns MBEDTLS_ERR_SSL_WANT_READ, the - * handshake is unfinished and no further data is available - * from the underlying transport. In this case, you must call - * the function again at some later stage. - * - * \note Remarks regarding event-driven DTLS: - * If the function returns MBEDTLS_ERR_SSL_WANT_READ, no datagram - * from the underlying transport layer is currently being processed, - * and it is safe to idle until the timer or the underlying transport - * signal a new event. This is not true for a successful handshake, - * in which case the datagram of the underlying transport that is - * currently being processed might or might not contain further - * DTLS records. - * - * \note If this function returns something other than 0 or - * MBEDTLS_ERR_SSL_WANT_READ/WRITE, you must stop using - * the SSL context for reading or writing, and either free it or - * call \c mbedtls_ssl_session_reset() on it before re-using it - * for a new connection; the current connection must be closed. - * - * \note If DTLS is in use, then you may choose to handle - * MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED specially for logging - * purposes, as it is an expected return value rather than an - * actual error, but you still need to reset/free the context. - */ -int mbedtls_ssl_handshake( mbedtls_ssl_context *ssl ); - -/** - * \brief Perform a single step of the SSL handshake - * - * \note The state of the context (ssl->state) will be at - * the next state after execution of this function. Do not - * call this function if state is MBEDTLS_SSL_HANDSHAKE_OVER. - * - * \note If this function returns something other than 0 or - * MBEDTLS_ERR_SSL_WANT_READ/WRITE, you must stop using - * the SSL context for reading or writing, and either free it or - * call \c mbedtls_ssl_session_reset() on it before re-using it - * for a new connection; the current connection must be closed. - * - * \param ssl SSL context - * - * \return 0 if successful, or - * MBEDTLS_ERR_SSL_WANT_READ or MBEDTLS_ERR_SSL_WANT_WRITE, or - * a specific SSL error code. - */ -int mbedtls_ssl_handshake_step( mbedtls_ssl_context *ssl ); - -#if defined(MBEDTLS_SSL_RENEGOTIATION) -/** - * \brief Initiate an SSL renegotiation on the running connection. - * Client: perform the renegotiation right now. - * Server: request renegotiation, which will be performed - * during the next call to mbedtls_ssl_read() if honored by - * client. - * - * \param ssl SSL context - * - * \return 0 if successful, or any mbedtls_ssl_handshake() return - * value. - * - * \note If this function returns something other than 0 or - * MBEDTLS_ERR_SSL_WANT_READ/WRITE, you must stop using - * the SSL context for reading or writing, and either free it or - * call \c mbedtls_ssl_session_reset() on it before re-using it - * for a new connection; the current connection must be closed. - */ -int mbedtls_ssl_renegotiate( mbedtls_ssl_context *ssl ); -#endif /* MBEDTLS_SSL_RENEGOTIATION */ - -/** - * \brief Read at most 'len' application data bytes - * - * \param ssl SSL context - * \param buf buffer that will hold the data - * \param len maximum number of bytes to read - * - * \return One of the following: - * - 0 if the read end of the underlying transport was closed, - * - the (positive) number of bytes read, or - * - a negative error code on failure. - * - * If MBEDTLS_ERR_SSL_WANT_READ is returned, no application data - * is available from the underlying transport. In this case, - * the function needs to be called again at some later stage. - * - * If MBEDTLS_ERR_SSL_WANT_WRITE is returned, a write is pending - * but the underlying transport isn't available for writing. In this - * case, the function needs to be called again at some later stage. - * - * When this function return MBEDTLS_ERR_SSL_CLIENT_RECONNECT - * (which can only happen server-side), it means that a client - * is initiating a new connection using the same source port. - * You can either treat that as a connection close and wait - * for the client to resend a ClientHello, or directly - * continue with \c mbedtls_ssl_handshake() with the same - * context (as it has beeen reset internally). Either way, you - * should make sure this is seen by the application as a new - * connection: application state, if any, should be reset, and - * most importantly the identity of the client must be checked - * again. WARNING: not validating the identity of the client - * again, or not transmitting the new identity to the - * application layer, would allow authentication bypass! - * - * \note If this function returns something other than a positive value - * or MBEDTLS_ERR_SSL_WANT_READ/WRITE or MBEDTLS_ERR_SSL_CLIENT_RECONNECT, - * you must stop using the SSL context for reading or writing, - * and either free it or call \c mbedtls_ssl_session_reset() on it - * before re-using it for a new connection; the current connection - * must be closed. - * - * \note Remarks regarding event-driven DTLS: - * - If the function returns MBEDTLS_ERR_SSL_WANT_READ, no datagram - * from the underlying transport layer is currently being processed, - * and it is safe to idle until the timer or the underlying transport - * signal a new event. - * - This function may return MBEDTLS_ERR_SSL_WANT_READ even if data was - * initially available on the underlying transport, as this data may have - * been only e.g. duplicated messages or a renegotiation request. - * Therefore, you must be prepared to receive MBEDTLS_ERR_SSL_WANT_READ even - * when reacting to an incoming-data event from the underlying transport. - * - On success, the datagram of the underlying transport that is currently - * being processed may contain further DTLS records. You should call - * \c mbedtls_ssl_check_pending to check for remaining records. - * - */ -int mbedtls_ssl_read( mbedtls_ssl_context *ssl, unsigned char *buf, size_t len ); - -/** - * \brief Try to write exactly 'len' application data bytes - * - * \warning This function will do partial writes in some cases. If the - * return value is non-negative but less than length, the - * function must be called again with updated arguments: - * buf + ret, len - ret (if ret is the return value) until - * it returns a value equal to the last 'len' argument. - * - * \param ssl SSL context - * \param buf buffer holding the data - * \param len how many bytes must be written - * - * \return the number of bytes actually written (may be less than len), - * or MBEDTLS_ERR_SSL_WANT_WRITE or MBEDTLS_ERR_SSL_WANT_READ, - * or another negative error code. - * - * \note If this function returns something other than 0, a positive - * value or MBEDTLS_ERR_SSL_WANT_READ/WRITE, you must stop - * using the SSL context for reading or writing, and either - * free it or call \c mbedtls_ssl_session_reset() on it before - * re-using it for a new connection; the current connection - * must be closed. - * - * \note When this function returns MBEDTLS_ERR_SSL_WANT_WRITE/READ, - * it must be called later with the *same* arguments, - * until it returns a value greater that or equal to 0. When - * the function returns MBEDTLS_ERR_SSL_WANT_WRITE there may be - * some partial data in the output buffer, however this is not - * yet sent. - * - * \note If the requested length is greater than the maximum - * fragment length (either the built-in limit or the one set - * or negotiated with the peer), then: - * - with TLS, less bytes than requested are written. - * - with DTLS, MBEDTLS_ERR_SSL_BAD_INPUT_DATA is returned. - * \c mbedtls_ssl_get_max_frag_len() may be used to query the - * active maximum fragment length. - * - * \note Attempting to write 0 bytes will result in an empty TLS - * application record being sent. - */ -int mbedtls_ssl_write( mbedtls_ssl_context *ssl, const unsigned char *buf, size_t len ); - -/** - * \brief Send an alert message - * - * \param ssl SSL context - * \param level The alert level of the message - * (MBEDTLS_SSL_ALERT_LEVEL_WARNING or MBEDTLS_SSL_ALERT_LEVEL_FATAL) - * \param message The alert message (SSL_ALERT_MSG_*) - * - * \return 0 if successful, or a specific SSL error code. - * - * \note If this function returns something other than 0 or - * MBEDTLS_ERR_SSL_WANT_READ/WRITE, you must stop using - * the SSL context for reading or writing, and either free it or - * call \c mbedtls_ssl_session_reset() on it before re-using it - * for a new connection; the current connection must be closed. - */ -int mbedtls_ssl_send_alert_message( mbedtls_ssl_context *ssl, - unsigned char level, - unsigned char message ); -/** - * \brief Notify the peer that the connection is being closed - * - * \param ssl SSL context - * - * \return 0 if successful, or a specific SSL error code. - * - * \note If this function returns something other than 0 or - * MBEDTLS_ERR_SSL_WANT_READ/WRITE, you must stop using - * the SSL context for reading or writing, and either free it or - * call \c mbedtls_ssl_session_reset() on it before re-using it - * for a new connection; the current connection must be closed. - */ -int mbedtls_ssl_close_notify( mbedtls_ssl_context *ssl ); - -/** - * \brief Free referenced items in an SSL context and clear memory - * - * \param ssl SSL context - */ -void mbedtls_ssl_free( mbedtls_ssl_context *ssl ); - -/** - * \brief Initialize an SSL configuration context - * Just makes the context ready for - * mbedtls_ssl_config_defaults() or mbedtls_ssl_config_free(). - * - * \note You need to call mbedtls_ssl_config_defaults() unless you - * manually set all of the relevent fields yourself. - * - * \param conf SSL configuration context - */ -void mbedtls_ssl_config_init( mbedtls_ssl_config *conf ); - -/** - * \brief Load reasonnable default SSL configuration values. - * (You need to call mbedtls_ssl_config_init() first.) - * - * \param conf SSL configuration context - * \param endpoint MBEDTLS_SSL_IS_CLIENT or MBEDTLS_SSL_IS_SERVER - * \param transport MBEDTLS_SSL_TRANSPORT_STREAM for TLS, or - * MBEDTLS_SSL_TRANSPORT_DATAGRAM for DTLS - * \param preset a MBEDTLS_SSL_PRESET_XXX value - * - * \note See \c mbedtls_ssl_conf_transport() for notes on DTLS. - * - * \return 0 if successful, or - * MBEDTLS_ERR_XXX_ALLOC_FAILED on memory allocation error. - */ -int mbedtls_ssl_config_defaults( mbedtls_ssl_config *conf, - int endpoint, int transport, int preset ); - -/** - * \brief Free an SSL configuration context - * - * \param conf SSL configuration context - */ -void mbedtls_ssl_config_free( mbedtls_ssl_config *conf ); - -/** - * \brief Initialize SSL session structure - * - * \param session SSL session - */ -void mbedtls_ssl_session_init( mbedtls_ssl_session *session ); - -/** - * \brief Free referenced items in an SSL session including the - * peer certificate and clear memory - * - * \note A session object can be freed even if the SSL context - * that was used to retrieve the session is still in use. - * - * \param session SSL session - */ -void mbedtls_ssl_session_free( mbedtls_ssl_session *session ); - -#ifdef __cplusplus -} -#endif - -#endif /* ssl.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/ssl_cache.h b/tools/sdk/include/mbedtls/mbedtls/ssl_cache.h deleted file mode 100644 index ec081e6d244..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/ssl_cache.h +++ /dev/null @@ -1,144 +0,0 @@ -/** - * \file ssl_cache.h - * - * \brief SSL session cache implementation - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_SSL_CACHE_H -#define MBEDTLS_SSL_CACHE_H - -#include "ssl.h" - -#if defined(MBEDTLS_THREADING_C) -#include "threading.h" -#endif - -/** - * \name SECTION: Module settings - * - * The configuration options you can set for this module are in this section. - * Either change them in config.h or define them on the compiler command line. - * \{ - */ - -#if !defined(MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT) -#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400 /*!< 1 day */ -#endif - -#if !defined(MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES) -#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /*!< Maximum entries in cache */ -#endif - -/* \} name SECTION: Module settings */ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct mbedtls_ssl_cache_context mbedtls_ssl_cache_context; -typedef struct mbedtls_ssl_cache_entry mbedtls_ssl_cache_entry; - -/** - * \brief This structure is used for storing cache entries - */ -struct mbedtls_ssl_cache_entry -{ -#if defined(MBEDTLS_HAVE_TIME) - mbedtls_time_t timestamp; /*!< entry timestamp */ -#endif - mbedtls_ssl_session session; /*!< entry session */ -#if defined(MBEDTLS_X509_CRT_PARSE_C) - mbedtls_x509_buf peer_cert; /*!< entry peer_cert */ -#endif - mbedtls_ssl_cache_entry *next; /*!< chain pointer */ -}; - -/** - * \brief Cache context - */ -struct mbedtls_ssl_cache_context -{ - mbedtls_ssl_cache_entry *chain; /*!< start of the chain */ - int timeout; /*!< cache entry timeout */ - int max_entries; /*!< maximum entries */ -#if defined(MBEDTLS_THREADING_C) - mbedtls_threading_mutex_t mutex; /*!< mutex */ -#endif -}; - -/** - * \brief Initialize an SSL cache context - * - * \param cache SSL cache context - */ -void mbedtls_ssl_cache_init( mbedtls_ssl_cache_context *cache ); - -/** - * \brief Cache get callback implementation - * (Thread-safe if MBEDTLS_THREADING_C is enabled) - * - * \param data SSL cache context - * \param session session to retrieve entry for - */ -int mbedtls_ssl_cache_get( void *data, mbedtls_ssl_session *session ); - -/** - * \brief Cache set callback implementation - * (Thread-safe if MBEDTLS_THREADING_C is enabled) - * - * \param data SSL cache context - * \param session session to store entry for - */ -int mbedtls_ssl_cache_set( void *data, const mbedtls_ssl_session *session ); - -#if defined(MBEDTLS_HAVE_TIME) -/** - * \brief Set the cache timeout - * (Default: MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT (1 day)) - * - * A timeout of 0 indicates no timeout. - * - * \param cache SSL cache context - * \param timeout cache entry timeout in seconds - */ -void mbedtls_ssl_cache_set_timeout( mbedtls_ssl_cache_context *cache, int timeout ); -#endif /* MBEDTLS_HAVE_TIME */ - -/** - * \brief Set the maximum number of cache entries - * (Default: MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES (50)) - * - * \param cache SSL cache context - * \param max cache entry maximum - */ -void mbedtls_ssl_cache_set_max_entries( mbedtls_ssl_cache_context *cache, int max ); - -/** - * \brief Free referenced items in a cache context and clear memory - * - * \param cache SSL cache context - */ -void mbedtls_ssl_cache_free( mbedtls_ssl_cache_context *cache ); - -#ifdef __cplusplus -} -#endif - -#endif /* ssl_cache.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/ssl_ciphersuites.h b/tools/sdk/include/mbedtls/mbedtls/ssl_ciphersuites.h deleted file mode 100644 index cda8b4835b6..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/ssl_ciphersuites.h +++ /dev/null @@ -1,534 +0,0 @@ -/** - * \file ssl_ciphersuites.h - * - * \brief SSL Ciphersuites for mbed TLS - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_SSL_CIPHERSUITES_H -#define MBEDTLS_SSL_CIPHERSUITES_H - -#include "pk.h" -#include "cipher.h" -#include "md.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Supported ciphersuites (Official IANA names) - */ -#define MBEDTLS_TLS_RSA_WITH_NULL_MD5 0x01 /**< Weak! */ -#define MBEDTLS_TLS_RSA_WITH_NULL_SHA 0x02 /**< Weak! */ - -#define MBEDTLS_TLS_RSA_WITH_RC4_128_MD5 0x04 -#define MBEDTLS_TLS_RSA_WITH_RC4_128_SHA 0x05 -#define MBEDTLS_TLS_RSA_WITH_DES_CBC_SHA 0x09 /**< Weak! Not in TLS 1.2 */ - -#define MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA 0x0A - -#define MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA 0x15 /**< Weak! Not in TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA 0x16 - -#define MBEDTLS_TLS_PSK_WITH_NULL_SHA 0x2C /**< Weak! */ -#define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA 0x2D /**< Weak! */ -#define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA 0x2E /**< Weak! */ -#define MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA 0x2F - -#define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA 0x33 -#define MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA 0x35 -#define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA 0x39 - -#define MBEDTLS_TLS_RSA_WITH_NULL_SHA256 0x3B /**< Weak! */ -#define MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256 0x3C /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256 0x3D /**< TLS 1.2 */ - -#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA 0x41 -#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA 0x45 - -#define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 0x67 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 0x6B /**< TLS 1.2 */ - -#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA 0x84 -#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA 0x88 - -#define MBEDTLS_TLS_PSK_WITH_RC4_128_SHA 0x8A -#define MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA 0x8B -#define MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA 0x8C -#define MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA 0x8D - -#define MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA 0x8E -#define MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA 0x8F -#define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA 0x90 -#define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA 0x91 - -#define MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA 0x92 -#define MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA 0x93 -#define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA 0x94 -#define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA 0x95 - -#define MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256 0x9C /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384 0x9D /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 0x9E /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 0x9F /**< TLS 1.2 */ - -#define MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256 0xA8 /**< TLS 1.2 */ -#define MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384 0xA9 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 0xAA /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 0xAB /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 0xAC /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 0xAD /**< TLS 1.2 */ - -#define MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256 0xAE -#define MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384 0xAF -#define MBEDTLS_TLS_PSK_WITH_NULL_SHA256 0xB0 /**< Weak! */ -#define MBEDTLS_TLS_PSK_WITH_NULL_SHA384 0xB1 /**< Weak! */ - -#define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 0xB2 -#define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 0xB3 -#define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256 0xB4 /**< Weak! */ -#define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384 0xB5 /**< Weak! */ - -#define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 0xB6 -#define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 0xB7 -#define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256 0xB8 /**< Weak! */ -#define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384 0xB9 /**< Weak! */ - -#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xBA /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xBE /**< TLS 1.2 */ - -#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 0xC0 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 0xC4 /**< TLS 1.2 */ - -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA 0xC001 /**< Weak! */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA 0xC002 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA 0xC003 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA 0xC004 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA 0xC005 /**< Not in SSL3! */ - -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA 0xC006 /**< Weak! */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA 0xC007 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA 0xC008 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA 0xC009 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA 0xC00A /**< Not in SSL3! */ - -#define MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA 0xC00B /**< Weak! */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA 0xC00C /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA 0xC00D /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA 0xC00E /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA 0xC00F /**< Not in SSL3! */ - -#define MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA 0xC010 /**< Weak! */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA 0xC011 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA 0xC012 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA 0xC013 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA 0xC014 /**< Not in SSL3! */ - -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 0xC023 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 0xC024 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 0xC025 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 0xC026 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 0xC027 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 0xC028 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 0xC029 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 0xC02A /**< TLS 1.2 */ - -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 0xC02B /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 0xC02C /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 0xC02D /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 0xC02E /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 0xC02F /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 0xC030 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 0xC031 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 0xC032 /**< TLS 1.2 */ - -#define MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA 0xC033 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA 0xC034 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA 0xC035 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA 0xC036 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 0xC037 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 0xC038 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA 0xC039 /**< Weak! No SSL3! */ -#define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256 0xC03A /**< Weak! No SSL3! */ -#define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384 0xC03B /**< Weak! No SSL3! */ - -#define MBEDTLS_TLS_RSA_WITH_ARIA_128_CBC_SHA256 0xC03C /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_WITH_ARIA_256_CBC_SHA384 0xC03D /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256 0xC044 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384 0xC045 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256 0xC048 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384 0xC049 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256 0xC04A /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384 0xC04B /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256 0xC04C /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384 0xC04D /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256 0xC04E /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384 0xC04F /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_WITH_ARIA_128_GCM_SHA256 0xC050 /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_WITH_ARIA_256_GCM_SHA384 0xC051 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256 0xC052 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384 0xC053 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 0xC05C /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 0xC05D /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256 0xC05E /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384 0xC05F /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256 0xC060 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384 0xC061 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256 0xC062 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384 0xC063 /**< TLS 1.2 */ -#define MBEDTLS_TLS_PSK_WITH_ARIA_128_CBC_SHA256 0xC064 /**< TLS 1.2 */ -#define MBEDTLS_TLS_PSK_WITH_ARIA_256_CBC_SHA384 0xC065 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256 0xC066 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384 0xC067 /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256 0xC068 /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384 0xC069 /**< TLS 1.2 */ -#define MBEDTLS_TLS_PSK_WITH_ARIA_128_GCM_SHA256 0xC06A /**< TLS 1.2 */ -#define MBEDTLS_TLS_PSK_WITH_ARIA_256_GCM_SHA384 0xC06B /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256 0xC06C /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384 0xC06D /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256 0xC06E /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384 0xC06F /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256 0xC070 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384 0xC071 /**< TLS 1.2 */ - -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 0xC072 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 0xC073 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 0xC074 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 0xC075 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xC076 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 0xC077 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xC078 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 0xC079 /**< Not in SSL3! */ - -#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 0xC07A /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 0xC07B /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 0xC07C /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 0xC07D /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 0xC086 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 0xC087 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 0xC088 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 0xC089 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 0xC08A /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 0xC08B /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 0xC08C /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 0xC08D /**< TLS 1.2 */ - -#define MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 0xC08E /**< TLS 1.2 */ -#define MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 0xC08F /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 0xC090 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 0xC091 /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 0xC092 /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 0xC093 /**< TLS 1.2 */ - -#define MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC094 -#define MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC095 -#define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC096 -#define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC097 -#define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC098 -#define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC099 -#define MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC09A /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC09B /**< Not in SSL3! */ - -#define MBEDTLS_TLS_RSA_WITH_AES_128_CCM 0xC09C /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_WITH_AES_256_CCM 0xC09D /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM 0xC09E /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM 0xC09F /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_WITH_AES_128_CCM_8 0xC0A0 /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_WITH_AES_256_CCM_8 0xC0A1 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM_8 0xC0A2 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM_8 0xC0A3 /**< TLS 1.2 */ -#define MBEDTLS_TLS_PSK_WITH_AES_128_CCM 0xC0A4 /**< TLS 1.2 */ -#define MBEDTLS_TLS_PSK_WITH_AES_256_CCM 0xC0A5 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM 0xC0A6 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM 0xC0A7 /**< TLS 1.2 */ -#define MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8 0xC0A8 /**< TLS 1.2 */ -#define MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8 0xC0A9 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM_8 0xC0AA /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM_8 0xC0AB /**< TLS 1.2 */ -/* The last two are named with PSK_DHE in the RFC, which looks like a typo */ - -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM 0xC0AC /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM 0xC0AD /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 0xC0AE /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 0xC0AF /**< TLS 1.2 */ - -#define MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 0xC0FF /**< experimental */ - -/* RFC 7905 */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 0xCCA8 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 0xCCA9 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256 0xCCAA /**< TLS 1.2 */ -#define MBEDTLS_TLS_PSK_WITH_CHACHA20_POLY1305_SHA256 0xCCAB /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 0xCCAC /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256 0xCCAD /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256 0xCCAE /**< TLS 1.2 */ - -/* Reminder: update mbedtls_ssl_premaster_secret when adding a new key exchange. - * Reminder: update MBEDTLS_KEY_EXCHANGE__xxx below - */ -typedef enum { - MBEDTLS_KEY_EXCHANGE_NONE = 0, - MBEDTLS_KEY_EXCHANGE_RSA, - MBEDTLS_KEY_EXCHANGE_DHE_RSA, - MBEDTLS_KEY_EXCHANGE_ECDHE_RSA, - MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA, - MBEDTLS_KEY_EXCHANGE_PSK, - MBEDTLS_KEY_EXCHANGE_DHE_PSK, - MBEDTLS_KEY_EXCHANGE_RSA_PSK, - MBEDTLS_KEY_EXCHANGE_ECDHE_PSK, - MBEDTLS_KEY_EXCHANGE_ECDH_RSA, - MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA, - MBEDTLS_KEY_EXCHANGE_ECJPAKE, -} mbedtls_key_exchange_type_t; - -/* Key exchanges using a certificate */ -#if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) -#define MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED -#endif - -/* Key exchanges allowing client certificate requests */ -#if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) -#define MBEDTLS_KEY_EXCHANGE__CERT_REQ_ALLOWED__ENABLED -#endif - -/* Key exchanges involving server signature in ServerKeyExchange */ -#if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) -#define MBEDTLS_KEY_EXCHANGE__WITH_SERVER_SIGNATURE__ENABLED -#endif - -/* Key exchanges using ECDH */ -#if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) -#define MBEDTLS_KEY_EXCHANGE__SOME__ECDH_ENABLED -#endif - -/* Key exchanges that don't involve ephemeral keys */ -#if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE__SOME__ECDH_ENABLED) -#define MBEDTLS_KEY_EXCHANGE__SOME_NON_PFS__ENABLED -#endif - -/* Key exchanges that involve ephemeral keys */ -#if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) -#define MBEDTLS_KEY_EXCHANGE__SOME_PFS__ENABLED -#endif - -/* Key exchanges using a PSK */ -#if defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) -#define MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED -#endif - -/* Key exchanges using DHE */ -#if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) -#define MBEDTLS_KEY_EXCHANGE__SOME__DHE_ENABLED -#endif - -/* Key exchanges using ECDHE */ -#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) -#define MBEDTLS_KEY_EXCHANGE__SOME__ECDHE_ENABLED -#endif - -typedef struct mbedtls_ssl_ciphersuite_t mbedtls_ssl_ciphersuite_t; - -#define MBEDTLS_CIPHERSUITE_WEAK 0x01 /**< Weak ciphersuite flag */ -#define MBEDTLS_CIPHERSUITE_SHORT_TAG 0x02 /**< Short authentication tag, - eg for CCM_8 */ -#define MBEDTLS_CIPHERSUITE_NODTLS 0x04 /**< Can't be used with DTLS */ - -/** - * \brief This structure is used for storing ciphersuite information - */ -struct mbedtls_ssl_ciphersuite_t -{ - int id; - const char * name; - - mbedtls_cipher_type_t cipher; - mbedtls_md_type_t mac; - mbedtls_key_exchange_type_t key_exchange; - - int min_major_ver; - int min_minor_ver; - int max_major_ver; - int max_minor_ver; - - unsigned char flags; -}; - -const int *mbedtls_ssl_list_ciphersuites( void ); - -const mbedtls_ssl_ciphersuite_t *mbedtls_ssl_ciphersuite_from_string( const char *ciphersuite_name ); -const mbedtls_ssl_ciphersuite_t *mbedtls_ssl_ciphersuite_from_id( int ciphersuite_id ); - -#if defined(MBEDTLS_PK_C) -mbedtls_pk_type_t mbedtls_ssl_get_ciphersuite_sig_pk_alg( const mbedtls_ssl_ciphersuite_t *info ); -mbedtls_pk_type_t mbedtls_ssl_get_ciphersuite_sig_alg( const mbedtls_ssl_ciphersuite_t *info ); -#endif - -int mbedtls_ssl_ciphersuite_uses_ec( const mbedtls_ssl_ciphersuite_t *info ); -int mbedtls_ssl_ciphersuite_uses_psk( const mbedtls_ssl_ciphersuite_t *info ); - -#if defined(MBEDTLS_KEY_EXCHANGE__SOME_PFS__ENABLED) -static inline int mbedtls_ssl_ciphersuite_has_pfs( const mbedtls_ssl_ciphersuite_t *info ) -{ - switch( info->key_exchange ) - { - case MBEDTLS_KEY_EXCHANGE_DHE_RSA: - case MBEDTLS_KEY_EXCHANGE_DHE_PSK: - case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA: - case MBEDTLS_KEY_EXCHANGE_ECDHE_PSK: - case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA: - case MBEDTLS_KEY_EXCHANGE_ECJPAKE: - return( 1 ); - - default: - return( 0 ); - } -} -#endif /* MBEDTLS_KEY_EXCHANGE__SOME_PFS__ENABLED */ - -#if defined(MBEDTLS_KEY_EXCHANGE__SOME_NON_PFS__ENABLED) -static inline int mbedtls_ssl_ciphersuite_no_pfs( const mbedtls_ssl_ciphersuite_t *info ) -{ - switch( info->key_exchange ) - { - case MBEDTLS_KEY_EXCHANGE_ECDH_RSA: - case MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA: - case MBEDTLS_KEY_EXCHANGE_RSA: - case MBEDTLS_KEY_EXCHANGE_PSK: - case MBEDTLS_KEY_EXCHANGE_RSA_PSK: - return( 1 ); - - default: - return( 0 ); - } -} -#endif /* MBEDTLS_KEY_EXCHANGE__SOME_NON_PFS__ENABLED */ - -#if defined(MBEDTLS_KEY_EXCHANGE__SOME__ECDH_ENABLED) -static inline int mbedtls_ssl_ciphersuite_uses_ecdh( const mbedtls_ssl_ciphersuite_t *info ) -{ - switch( info->key_exchange ) - { - case MBEDTLS_KEY_EXCHANGE_ECDH_RSA: - case MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA: - return( 1 ); - - default: - return( 0 ); - } -} -#endif /* MBEDTLS_KEY_EXCHANGE__SOME__ECDH_ENABLED */ - -static inline int mbedtls_ssl_ciphersuite_cert_req_allowed( const mbedtls_ssl_ciphersuite_t *info ) -{ - switch( info->key_exchange ) - { - case MBEDTLS_KEY_EXCHANGE_RSA: - case MBEDTLS_KEY_EXCHANGE_DHE_RSA: - case MBEDTLS_KEY_EXCHANGE_ECDH_RSA: - case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA: - case MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA: - case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA: - return( 1 ); - - default: - return( 0 ); - } -} - -#if defined(MBEDTLS_KEY_EXCHANGE__SOME__DHE_ENABLED) -static inline int mbedtls_ssl_ciphersuite_uses_dhe( const mbedtls_ssl_ciphersuite_t *info ) -{ - switch( info->key_exchange ) - { - case MBEDTLS_KEY_EXCHANGE_DHE_RSA: - case MBEDTLS_KEY_EXCHANGE_DHE_PSK: - return( 1 ); - - default: - return( 0 ); - } -} -#endif /* MBEDTLS_KEY_EXCHANGE__SOME__DHE_ENABLED) */ - -#if defined(MBEDTLS_KEY_EXCHANGE__SOME__ECDHE_ENABLED) -static inline int mbedtls_ssl_ciphersuite_uses_ecdhe( const mbedtls_ssl_ciphersuite_t *info ) -{ - switch( info->key_exchange ) - { - case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA: - case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA: - case MBEDTLS_KEY_EXCHANGE_ECDHE_PSK: - return( 1 ); - - default: - return( 0 ); - } -} -#endif /* MBEDTLS_KEY_EXCHANGE__SOME__ECDHE_ENABLED) */ - -#if defined(MBEDTLS_KEY_EXCHANGE__WITH_SERVER_SIGNATURE__ENABLED) -static inline int mbedtls_ssl_ciphersuite_uses_server_signature( const mbedtls_ssl_ciphersuite_t *info ) -{ - switch( info->key_exchange ) - { - case MBEDTLS_KEY_EXCHANGE_DHE_RSA: - case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA: - case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA: - return( 1 ); - - default: - return( 0 ); - } -} -#endif /* MBEDTLS_KEY_EXCHANGE__WITH_SERVER_SIGNATURE__ENABLED */ - -#ifdef __cplusplus -} -#endif - -#endif /* ssl_ciphersuites.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/ssl_cookie.h b/tools/sdk/include/mbedtls/mbedtls/ssl_cookie.h deleted file mode 100644 index 6a0ad4fa96d..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/ssl_cookie.h +++ /dev/null @@ -1,109 +0,0 @@ -/** - * \file ssl_cookie.h - * - * \brief DTLS cookie callbacks implementation - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_SSL_COOKIE_H -#define MBEDTLS_SSL_COOKIE_H - -#include "ssl.h" - -#if defined(MBEDTLS_THREADING_C) -#include "threading.h" -#endif - -/** - * \name SECTION: Module settings - * - * The configuration options you can set for this module are in this section. - * Either change them in config.h or define them on the compiler command line. - * \{ - */ -#ifndef MBEDTLS_SSL_COOKIE_TIMEOUT -#define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */ -#endif - -/* \} name SECTION: Module settings */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Context for the default cookie functions. - */ -typedef struct mbedtls_ssl_cookie_ctx -{ - mbedtls_md_context_t hmac_ctx; /*!< context for the HMAC portion */ -#if !defined(MBEDTLS_HAVE_TIME) - unsigned long serial; /*!< serial number for expiration */ -#endif - unsigned long timeout; /*!< timeout delay, in seconds if HAVE_TIME, - or in number of tickets issued */ - -#if defined(MBEDTLS_THREADING_C) - mbedtls_threading_mutex_t mutex; -#endif -} mbedtls_ssl_cookie_ctx; - -/** - * \brief Initialize cookie context - */ -void mbedtls_ssl_cookie_init( mbedtls_ssl_cookie_ctx *ctx ); - -/** - * \brief Setup cookie context (generate keys) - */ -int mbedtls_ssl_cookie_setup( mbedtls_ssl_cookie_ctx *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief Set expiration delay for cookies - * (Default MBEDTLS_SSL_COOKIE_TIMEOUT) - * - * \param ctx Cookie contex - * \param delay Delay, in seconds if HAVE_TIME, or in number of cookies - * issued in the meantime. - * 0 to disable expiration (NOT recommended) - */ -void mbedtls_ssl_cookie_set_timeout( mbedtls_ssl_cookie_ctx *ctx, unsigned long delay ); - -/** - * \brief Free cookie context - */ -void mbedtls_ssl_cookie_free( mbedtls_ssl_cookie_ctx *ctx ); - -/** - * \brief Generate cookie, see \c mbedtls_ssl_cookie_write_t - */ -mbedtls_ssl_cookie_write_t mbedtls_ssl_cookie_write; - -/** - * \brief Verify cookie, see \c mbedtls_ssl_cookie_write_t - */ -mbedtls_ssl_cookie_check_t mbedtls_ssl_cookie_check; - -#ifdef __cplusplus -} -#endif - -#endif /* ssl_cookie.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/ssl_internal.h b/tools/sdk/include/mbedtls/mbedtls/ssl_internal.h deleted file mode 100644 index 4b4417a5fae..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/ssl_internal.h +++ /dev/null @@ -1,757 +0,0 @@ -/** - * \file ssl_internal.h - * - * \brief Internal functions shared by the SSL modules - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_SSL_INTERNAL_H -#define MBEDTLS_SSL_INTERNAL_H - -#include "ssl.h" -#include "cipher.h" - -#if defined(MBEDTLS_MD5_C) -#include "md5.h" -#endif - -#if defined(MBEDTLS_SHA1_C) -#include "sha1.h" -#endif - -#if defined(MBEDTLS_SHA256_C) -#include "sha256.h" -#endif - -#if defined(MBEDTLS_SHA512_C) -#include "sha512.h" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) -#include "ecjpake.h" -#endif - -#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ - !defined(inline) && !defined(__cplusplus) -#define inline __inline -#endif - -/* Determine minimum supported version */ -#define MBEDTLS_SSL_MIN_MAJOR_VERSION MBEDTLS_SSL_MAJOR_VERSION_3 - -#if defined(MBEDTLS_SSL_PROTO_SSL3) -#define MBEDTLS_SSL_MIN_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_0 -#else -#if defined(MBEDTLS_SSL_PROTO_TLS1) -#define MBEDTLS_SSL_MIN_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_1 -#else -#if defined(MBEDTLS_SSL_PROTO_TLS1_1) -#define MBEDTLS_SSL_MIN_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_2 -#else -#if defined(MBEDTLS_SSL_PROTO_TLS1_2) -#define MBEDTLS_SSL_MIN_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_3 -#endif /* MBEDTLS_SSL_PROTO_TLS1_2 */ -#endif /* MBEDTLS_SSL_PROTO_TLS1_1 */ -#endif /* MBEDTLS_SSL_PROTO_TLS1 */ -#endif /* MBEDTLS_SSL_PROTO_SSL3 */ - -#define MBEDTLS_SSL_MIN_VALID_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_1 -#define MBEDTLS_SSL_MIN_VALID_MAJOR_VERSION MBEDTLS_SSL_MAJOR_VERSION_3 - -/* Determine maximum supported version */ -#define MBEDTLS_SSL_MAX_MAJOR_VERSION MBEDTLS_SSL_MAJOR_VERSION_3 - -#if defined(MBEDTLS_SSL_PROTO_TLS1_2) -#define MBEDTLS_SSL_MAX_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_3 -#else -#if defined(MBEDTLS_SSL_PROTO_TLS1_1) -#define MBEDTLS_SSL_MAX_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_2 -#else -#if defined(MBEDTLS_SSL_PROTO_TLS1) -#define MBEDTLS_SSL_MAX_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_1 -#else -#if defined(MBEDTLS_SSL_PROTO_SSL3) -#define MBEDTLS_SSL_MAX_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_0 -#endif /* MBEDTLS_SSL_PROTO_SSL3 */ -#endif /* MBEDTLS_SSL_PROTO_TLS1 */ -#endif /* MBEDTLS_SSL_PROTO_TLS1_1 */ -#endif /* MBEDTLS_SSL_PROTO_TLS1_2 */ - -#define MBEDTLS_SSL_INITIAL_HANDSHAKE 0 -#define MBEDTLS_SSL_RENEGOTIATION_IN_PROGRESS 1 /* In progress */ -#define MBEDTLS_SSL_RENEGOTIATION_DONE 2 /* Done or aborted */ -#define MBEDTLS_SSL_RENEGOTIATION_PENDING 3 /* Requested (server only) */ - -/* - * DTLS retransmission states, see RFC 6347 4.2.4 - * - * The SENDING state is merged in PREPARING for initial sends, - * but is distinct for resends. - * - * Note: initial state is wrong for server, but is not used anyway. - */ -#define MBEDTLS_SSL_RETRANS_PREPARING 0 -#define MBEDTLS_SSL_RETRANS_SENDING 1 -#define MBEDTLS_SSL_RETRANS_WAITING 2 -#define MBEDTLS_SSL_RETRANS_FINISHED 3 - -/* - * Allow extra bytes for record, authentication and encryption overhead: - * counter (8) + header (5) + IV(16) + MAC (16-48) + padding (0-256) - * and allow for a maximum of 1024 of compression expansion if - * enabled. - */ -#if defined(MBEDTLS_ZLIB_SUPPORT) -#define MBEDTLS_SSL_COMPRESSION_ADD 1024 -#else -#define MBEDTLS_SSL_COMPRESSION_ADD 0 -#endif - -#if defined(MBEDTLS_ARC4_C) || defined(MBEDTLS_CIPHER_MODE_CBC) -/* Ciphersuites using HMAC */ -#if defined(MBEDTLS_SHA512_C) -#define MBEDTLS_SSL_MAC_ADD 48 /* SHA-384 used for HMAC */ -#elif defined(MBEDTLS_SHA256_C) -#define MBEDTLS_SSL_MAC_ADD 32 /* SHA-256 used for HMAC */ -#else -#define MBEDTLS_SSL_MAC_ADD 20 /* SHA-1 used for HMAC */ -#endif -#else -/* AEAD ciphersuites: GCM and CCM use a 128 bits tag */ -#define MBEDTLS_SSL_MAC_ADD 16 -#endif - -#if defined(MBEDTLS_CIPHER_MODE_CBC) -#define MBEDTLS_SSL_PADDING_ADD 256 -#else -#define MBEDTLS_SSL_PADDING_ADD 0 -#endif - -#define MBEDTLS_SSL_PAYLOAD_OVERHEAD ( MBEDTLS_SSL_COMPRESSION_ADD + \ - MBEDTLS_MAX_IV_LENGTH + \ - MBEDTLS_SSL_MAC_ADD + \ - MBEDTLS_SSL_PADDING_ADD \ - ) - -#define MBEDTLS_SSL_IN_PAYLOAD_LEN ( MBEDTLS_SSL_PAYLOAD_OVERHEAD + \ - ( MBEDTLS_SSL_IN_CONTENT_LEN ) ) - -#define MBEDTLS_SSL_OUT_PAYLOAD_LEN ( MBEDTLS_SSL_PAYLOAD_OVERHEAD + \ - ( MBEDTLS_SSL_OUT_CONTENT_LEN ) ) - -/* The maximum number of buffered handshake messages. */ -#define MBEDTLS_SSL_MAX_BUFFERED_HS 4 - -/* Maximum length we can advertise as our max content length for - RFC 6066 max_fragment_length extension negotiation purposes - (the lesser of both sizes, if they are unequal.) - */ -#define MBEDTLS_TLS_EXT_ADV_CONTENT_LEN ( \ - (MBEDTLS_SSL_IN_CONTENT_LEN > MBEDTLS_SSL_OUT_CONTENT_LEN) \ - ? ( MBEDTLS_SSL_OUT_CONTENT_LEN ) \ - : ( MBEDTLS_SSL_IN_CONTENT_LEN ) \ - ) - -/* - * Check that we obey the standard's message size bounds - */ - -#if MBEDTLS_SSL_MAX_CONTENT_LEN > 16384 -#error "Bad configuration - record content too large." -#endif - -#if MBEDTLS_SSL_IN_CONTENT_LEN > MBEDTLS_SSL_MAX_CONTENT_LEN -#error "Bad configuration - incoming record content should not be larger than MBEDTLS_SSL_MAX_CONTENT_LEN." -#endif - -#if MBEDTLS_SSL_OUT_CONTENT_LEN > MBEDTLS_SSL_MAX_CONTENT_LEN -#error "Bad configuration - outgoing record content should not be larger than MBEDTLS_SSL_MAX_CONTENT_LEN." -#endif - -#if MBEDTLS_SSL_IN_PAYLOAD_LEN > MBEDTLS_SSL_MAX_CONTENT_LEN + 2048 -#error "Bad configuration - incoming protected record payload too large." -#endif - -#if MBEDTLS_SSL_OUT_PAYLOAD_LEN > MBEDTLS_SSL_MAX_CONTENT_LEN + 2048 -#error "Bad configuration - outgoing protected record payload too large." -#endif - -/* Calculate buffer sizes */ - -/* Note: Even though the TLS record header is only 5 bytes - long, we're internally using 8 bytes to store the - implicit sequence number. */ -#define MBEDTLS_SSL_HEADER_LEN 13 - -#define MBEDTLS_SSL_IN_BUFFER_LEN \ - ( ( MBEDTLS_SSL_HEADER_LEN ) + ( MBEDTLS_SSL_IN_PAYLOAD_LEN ) ) - -#define MBEDTLS_SSL_OUT_BUFFER_LEN \ - ( ( MBEDTLS_SSL_HEADER_LEN ) + ( MBEDTLS_SSL_OUT_PAYLOAD_LEN ) ) - -#ifdef MBEDTLS_ZLIB_SUPPORT -/* Compression buffer holds both IN and OUT buffers, so should be size of the larger */ -#define MBEDTLS_SSL_COMPRESS_BUFFER_LEN ( \ - ( MBEDTLS_SSL_IN_BUFFER_LEN > MBEDTLS_SSL_OUT_BUFFER_LEN ) \ - ? MBEDTLS_SSL_IN_BUFFER_LEN \ - : MBEDTLS_SSL_OUT_BUFFER_LEN \ - ) -#endif - -/* - * TLS extension flags (for extensions with outgoing ServerHello content - * that need it (e.g. for RENEGOTIATION_INFO the server already knows because - * of state of the renegotiation flag, so no indicator is required) - */ -#define MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS_PRESENT (1 << 0) -#define MBEDTLS_TLS_EXT_ECJPAKE_KKPP_OK (1 << 1) - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \ - defined(MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED) -/* - * Abstraction for a grid of allowed signature-hash-algorithm pairs. - */ -struct mbedtls_ssl_sig_hash_set_t -{ - /* At the moment, we only need to remember a single suitable - * hash algorithm per signature algorithm. As long as that's - * the case - and we don't need a general lookup function - - * we can implement the sig-hash-set as a map from signatures - * to hash algorithms. */ - mbedtls_md_type_t rsa; - mbedtls_md_type_t ecdsa; -}; -#endif /* MBEDTLS_SSL_PROTO_TLS1_2 && - MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED */ - -/* - * This structure contains the parameters only needed during handshake. - */ -struct mbedtls_ssl_handshake_params -{ - /* - * Handshake specific crypto variables - */ - -#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \ - defined(MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED) - mbedtls_ssl_sig_hash_set_t hash_algs; /*!< Set of suitable sig-hash pairs */ -#endif -#if defined(MBEDTLS_DHM_C) - mbedtls_dhm_context dhm_ctx; /*!< DHM key exchange */ -#endif -#if defined(MBEDTLS_ECDH_C) - mbedtls_ecdh_context ecdh_ctx; /*!< ECDH key exchange */ -#endif -#if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) - mbedtls_ecjpake_context ecjpake_ctx; /*!< EC J-PAKE key exchange */ -#if defined(MBEDTLS_SSL_CLI_C) - unsigned char *ecjpake_cache; /*!< Cache for ClientHello ext */ - size_t ecjpake_cache_len; /*!< Length of cached data */ -#endif -#endif /* MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED */ -#if defined(MBEDTLS_ECDH_C) || defined(MBEDTLS_ECDSA_C) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) - const mbedtls_ecp_curve_info **curves; /*!< Supported elliptic curves */ -#endif -#if defined(MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED) - unsigned char *psk; /*!< PSK from the callback */ - size_t psk_len; /*!< Length of PSK from callback */ -#endif -#if defined(MBEDTLS_X509_CRT_PARSE_C) - mbedtls_ssl_key_cert *key_cert; /*!< chosen key/cert pair (server) */ -#if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) - int sni_authmode; /*!< authmode from SNI callback */ - mbedtls_ssl_key_cert *sni_key_cert; /*!< key/cert list from SNI */ - mbedtls_x509_crt *sni_ca_chain; /*!< trusted CAs from SNI callback */ - mbedtls_x509_crl *sni_ca_crl; /*!< trusted CAs CRLs from SNI */ -#endif /* MBEDTLS_SSL_SERVER_NAME_INDICATION */ -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - -#if defined(MBEDTLS_SSL_PROTO_DTLS) - unsigned int out_msg_seq; /*!< Outgoing handshake sequence number */ - unsigned int in_msg_seq; /*!< Incoming handshake sequence number */ - - unsigned char *verify_cookie; /*!< Cli: HelloVerifyRequest cookie - Srv: unused */ - unsigned char verify_cookie_len; /*!< Cli: cookie length - Srv: flag for sending a cookie */ - - uint32_t retransmit_timeout; /*!< Current value of timeout */ - unsigned char retransmit_state; /*!< Retransmission state */ - mbedtls_ssl_flight_item *flight; /*!< Current outgoing flight */ - mbedtls_ssl_flight_item *cur_msg; /*!< Current message in flight */ - unsigned char *cur_msg_p; /*!< Position in current message */ - unsigned int in_flight_start_seq; /*!< Minimum message sequence in the - flight being received */ - mbedtls_ssl_transform *alt_transform_out; /*!< Alternative transform for - resending messages */ - unsigned char alt_out_ctr[8]; /*!< Alternative record epoch/counter - for resending messages */ - - struct - { - size_t total_bytes_buffered; /*!< Cumulative size of heap allocated - * buffers used for message buffering. */ - - uint8_t seen_ccs; /*!< Indicates if a CCS message has - * been seen in the current flight. */ - - struct mbedtls_ssl_hs_buffer - { - unsigned is_valid : 1; - unsigned is_fragmented : 1; - unsigned is_complete : 1; - unsigned char *data; - size_t data_len; - } hs[MBEDTLS_SSL_MAX_BUFFERED_HS]; - - struct - { - unsigned char *data; - size_t len; - unsigned epoch; - } future_record; - - } buffering; - - uint16_t mtu; /*!< Handshake mtu, used to fragment outgoing messages */ -#endif /* MBEDTLS_SSL_PROTO_DTLS */ - - /* - * Checksum contexts - */ -#if defined(MBEDTLS_SSL_PROTO_SSL3) || defined(MBEDTLS_SSL_PROTO_TLS1) || \ - defined(MBEDTLS_SSL_PROTO_TLS1_1) - mbedtls_md5_context fin_md5; - mbedtls_sha1_context fin_sha1; -#endif -#if defined(MBEDTLS_SSL_PROTO_TLS1_2) -#if defined(MBEDTLS_SHA256_C) - mbedtls_sha256_context fin_sha256; -#endif -#if defined(MBEDTLS_SHA512_C) - mbedtls_sha512_context fin_sha512; -#endif -#endif /* MBEDTLS_SSL_PROTO_TLS1_2 */ - - void (*update_checksum)(mbedtls_ssl_context *, const unsigned char *, size_t); - void (*calc_verify)(mbedtls_ssl_context *, unsigned char *); - void (*calc_finished)(mbedtls_ssl_context *, unsigned char *, int); - int (*tls_prf)(const unsigned char *, size_t, const char *, - const unsigned char *, size_t, - unsigned char *, size_t); - - size_t pmslen; /*!< premaster length */ - - unsigned char randbytes[64]; /*!< random bytes */ - unsigned char premaster[MBEDTLS_PREMASTER_SIZE]; - /*!< premaster secret */ - - int resume; /*!< session resume indicator*/ - int max_major_ver; /*!< max. major version client*/ - int max_minor_ver; /*!< max. minor version client*/ - int cli_exts; /*!< client extension presence*/ - -#if defined(MBEDTLS_SSL_SESSION_TICKETS) - int new_session_ticket; /*!< use NewSessionTicket? */ -#endif /* MBEDTLS_SSL_SESSION_TICKETS */ -#if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET) - int extended_ms; /*!< use Extended Master Secret? */ -#endif - -#if defined(MBEDTLS_SSL_ASYNC_PRIVATE) - unsigned int async_in_progress : 1; /*!< an asynchronous operation is in progress */ -#endif /* MBEDTLS_SSL_ASYNC_PRIVATE */ - -#if defined(MBEDTLS_SSL_ASYNC_PRIVATE) - /** Asynchronous operation context. This field is meant for use by the - * asynchronous operation callbacks (mbedtls_ssl_config::f_async_sign_start, - * mbedtls_ssl_config::f_async_decrypt_start, - * mbedtls_ssl_config::f_async_resume, mbedtls_ssl_config::f_async_cancel). - * The library does not use it internally. */ - void *user_async_ctx; -#endif /* MBEDTLS_SSL_ASYNC_PRIVATE */ -}; - -typedef struct mbedtls_ssl_hs_buffer mbedtls_ssl_hs_buffer; - -/* - * This structure contains a full set of runtime transform parameters - * either in negotiation or active. - */ -struct mbedtls_ssl_transform -{ - /* - * Session specific crypto layer - */ - const mbedtls_ssl_ciphersuite_t *ciphersuite_info; - /*!< Chosen cipersuite_info */ - unsigned int keylen; /*!< symmetric key length (bytes) */ - size_t minlen; /*!< min. ciphertext length */ - size_t ivlen; /*!< IV length */ - size_t fixed_ivlen; /*!< Fixed part of IV (AEAD) */ - size_t maclen; /*!< MAC length */ - - unsigned char iv_enc[16]; /*!< IV (encryption) */ - unsigned char iv_dec[16]; /*!< IV (decryption) */ - -#if defined(MBEDTLS_SSL_PROTO_SSL3) - /* Needed only for SSL v3.0 secret */ - unsigned char mac_enc[20]; /*!< SSL v3.0 secret (enc) */ - unsigned char mac_dec[20]; /*!< SSL v3.0 secret (dec) */ -#endif /* MBEDTLS_SSL_PROTO_SSL3 */ - - mbedtls_md_context_t md_ctx_enc; /*!< MAC (encryption) */ - mbedtls_md_context_t md_ctx_dec; /*!< MAC (decryption) */ - - mbedtls_cipher_context_t cipher_ctx_enc; /*!< encryption context */ - mbedtls_cipher_context_t cipher_ctx_dec; /*!< decryption context */ - - /* - * Session specific compression layer - */ -#if defined(MBEDTLS_ZLIB_SUPPORT) - z_stream ctx_deflate; /*!< compression context */ - z_stream ctx_inflate; /*!< decompression context */ -#endif -}; - -#if defined(MBEDTLS_X509_CRT_PARSE_C) -/* - * List of certificate + private key pairs - */ -struct mbedtls_ssl_key_cert -{ - mbedtls_x509_crt *cert; /*!< cert */ - mbedtls_pk_context *key; /*!< private key */ - mbedtls_ssl_key_cert *next; /*!< next key/cert pair */ -}; -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - -#if defined(MBEDTLS_SSL_PROTO_DTLS) -/* - * List of handshake messages kept around for resending - */ -struct mbedtls_ssl_flight_item -{ - unsigned char *p; /*!< message, including handshake headers */ - size_t len; /*!< length of p */ - unsigned char type; /*!< type of the message: handshake or CCS */ - mbedtls_ssl_flight_item *next; /*!< next handshake message(s) */ -}; -#endif /* MBEDTLS_SSL_PROTO_DTLS */ - -#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \ - defined(MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED) - -/* Find an entry in a signature-hash set matching a given hash algorithm. */ -mbedtls_md_type_t mbedtls_ssl_sig_hash_set_find( mbedtls_ssl_sig_hash_set_t *set, - mbedtls_pk_type_t sig_alg ); -/* Add a signature-hash-pair to a signature-hash set */ -void mbedtls_ssl_sig_hash_set_add( mbedtls_ssl_sig_hash_set_t *set, - mbedtls_pk_type_t sig_alg, - mbedtls_md_type_t md_alg ); -/* Allow exactly one hash algorithm for each signature. */ -void mbedtls_ssl_sig_hash_set_const_hash( mbedtls_ssl_sig_hash_set_t *set, - mbedtls_md_type_t md_alg ); - -/* Setup an empty signature-hash set */ -static inline void mbedtls_ssl_sig_hash_set_init( mbedtls_ssl_sig_hash_set_t *set ) -{ - mbedtls_ssl_sig_hash_set_const_hash( set, MBEDTLS_MD_NONE ); -} - -#endif /* MBEDTLS_SSL_PROTO_TLS1_2) && - MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED */ - -/** - * \brief Free referenced items in an SSL transform context and clear - * memory - * - * \param transform SSL transform context - */ -void mbedtls_ssl_transform_free( mbedtls_ssl_transform *transform ); - -/** - * \brief Free referenced items in an SSL handshake context and clear - * memory - * - * \param ssl SSL context - */ -void mbedtls_ssl_handshake_free( mbedtls_ssl_context *ssl ); - -int mbedtls_ssl_handshake_client_step( mbedtls_ssl_context *ssl ); -int mbedtls_ssl_handshake_server_step( mbedtls_ssl_context *ssl ); -void mbedtls_ssl_handshake_wrapup( mbedtls_ssl_context *ssl ); - -int mbedtls_ssl_send_fatal_handshake_failure( mbedtls_ssl_context *ssl ); - -void mbedtls_ssl_reset_checksum( mbedtls_ssl_context *ssl ); -int mbedtls_ssl_derive_keys( mbedtls_ssl_context *ssl ); - -int mbedtls_ssl_handle_message_type( mbedtls_ssl_context *ssl ); -int mbedtls_ssl_prepare_handshake_record( mbedtls_ssl_context *ssl ); -void mbedtls_ssl_update_handshake_status( mbedtls_ssl_context *ssl ); - -/** - * \brief Update record layer - * - * This function roughly separates the implementation - * of the logic of (D)TLS from the implementation - * of the secure transport. - * - * \param ssl The SSL context to use. - * \param update_hs_digest This indicates if the handshake digest - * should be automatically updated in case - * a handshake message is found. - * - * \return 0 or non-zero error code. - * - * \note A clarification on what is called 'record layer' here - * is in order, as many sensible definitions are possible: - * - * The record layer takes as input an untrusted underlying - * transport (stream or datagram) and transforms it into - * a serially multiplexed, secure transport, which - * conceptually provides the following: - * - * (1) Three datagram based, content-agnostic transports - * for handshake, alert and CCS messages. - * (2) One stream- or datagram-based transport - * for application data. - * (3) Functionality for changing the underlying transform - * securing the contents. - * - * The interface to this functionality is given as follows: - * - * a Updating - * [Currently implemented by mbedtls_ssl_read_record] - * - * Check if and on which of the four 'ports' data is pending: - * Nothing, a controlling datagram of type (1), or application - * data (2). In any case data is present, internal buffers - * provide access to the data for the user to process it. - * Consumption of type (1) datagrams is done automatically - * on the next update, invalidating that the internal buffers - * for previous datagrams, while consumption of application - * data (2) is user-controlled. - * - * b Reading of application data - * [Currently manual adaption of ssl->in_offt pointer] - * - * As mentioned in the last paragraph, consumption of data - * is different from the automatic consumption of control - * datagrams (1) because application data is treated as a stream. - * - * c Tracking availability of application data - * [Currently manually through decreasing ssl->in_msglen] - * - * For efficiency and to retain datagram semantics for - * application data in case of DTLS, the record layer - * provides functionality for checking how much application - * data is still available in the internal buffer. - * - * d Changing the transformation securing the communication. - * - * Given an opaque implementation of the record layer in the - * above sense, it should be possible to implement the logic - * of (D)TLS on top of it without the need to know anything - * about the record layer's internals. This is done e.g. - * in all the handshake handling functions, and in the - * application data reading function mbedtls_ssl_read. - * - * \note The above tries to give a conceptual picture of the - * record layer, but the current implementation deviates - * from it in some places. For example, our implementation of - * the update functionality through mbedtls_ssl_read_record - * discards datagrams depending on the current state, which - * wouldn't fall under the record layer's responsibility - * following the above definition. - * - */ -int mbedtls_ssl_read_record( mbedtls_ssl_context *ssl, - unsigned update_hs_digest ); -int mbedtls_ssl_fetch_input( mbedtls_ssl_context *ssl, size_t nb_want ); - -int mbedtls_ssl_write_handshake_msg( mbedtls_ssl_context *ssl ); -int mbedtls_ssl_write_record( mbedtls_ssl_context *ssl, uint8_t force_flush ); -int mbedtls_ssl_flush_output( mbedtls_ssl_context *ssl ); - -int mbedtls_ssl_parse_certificate( mbedtls_ssl_context *ssl ); -int mbedtls_ssl_write_certificate( mbedtls_ssl_context *ssl ); - -int mbedtls_ssl_parse_change_cipher_spec( mbedtls_ssl_context *ssl ); -int mbedtls_ssl_write_change_cipher_spec( mbedtls_ssl_context *ssl ); - -int mbedtls_ssl_parse_finished( mbedtls_ssl_context *ssl ); -int mbedtls_ssl_write_finished( mbedtls_ssl_context *ssl ); - -void mbedtls_ssl_optimize_checksum( mbedtls_ssl_context *ssl, - const mbedtls_ssl_ciphersuite_t *ciphersuite_info ); - -#if defined(MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED) -int mbedtls_ssl_psk_derive_premaster( mbedtls_ssl_context *ssl, mbedtls_key_exchange_type_t key_ex ); -#endif - -#if defined(MBEDTLS_PK_C) -unsigned char mbedtls_ssl_sig_from_pk( mbedtls_pk_context *pk ); -unsigned char mbedtls_ssl_sig_from_pk_alg( mbedtls_pk_type_t type ); -mbedtls_pk_type_t mbedtls_ssl_pk_alg_from_sig( unsigned char sig ); -#endif - -mbedtls_md_type_t mbedtls_ssl_md_alg_from_hash( unsigned char hash ); -unsigned char mbedtls_ssl_hash_from_md_alg( int md ); -int mbedtls_ssl_set_calc_verify_md( mbedtls_ssl_context *ssl, int md ); - -#if defined(MBEDTLS_ECP_C) -int mbedtls_ssl_check_curve( const mbedtls_ssl_context *ssl, mbedtls_ecp_group_id grp_id ); -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED) -int mbedtls_ssl_check_sig_hash( const mbedtls_ssl_context *ssl, - mbedtls_md_type_t md ); -#endif - -#if defined(MBEDTLS_X509_CRT_PARSE_C) -static inline mbedtls_pk_context *mbedtls_ssl_own_key( mbedtls_ssl_context *ssl ) -{ - mbedtls_ssl_key_cert *key_cert; - - if( ssl->handshake != NULL && ssl->handshake->key_cert != NULL ) - key_cert = ssl->handshake->key_cert; - else - key_cert = ssl->conf->key_cert; - - return( key_cert == NULL ? NULL : key_cert->key ); -} - -static inline mbedtls_x509_crt *mbedtls_ssl_own_cert( mbedtls_ssl_context *ssl ) -{ - mbedtls_ssl_key_cert *key_cert; - - if( ssl->handshake != NULL && ssl->handshake->key_cert != NULL ) - key_cert = ssl->handshake->key_cert; - else - key_cert = ssl->conf->key_cert; - - return( key_cert == NULL ? NULL : key_cert->cert ); -} - -/* - * Check usage of a certificate wrt extensions: - * keyUsage, extendedKeyUsage (later), and nSCertType (later). - * - * Warning: cert_endpoint is the endpoint of the cert (ie, of our peer when we - * check a cert we received from them)! - * - * Return 0 if everything is OK, -1 if not. - */ -int mbedtls_ssl_check_cert_usage( const mbedtls_x509_crt *cert, - const mbedtls_ssl_ciphersuite_t *ciphersuite, - int cert_endpoint, - uint32_t *flags ); -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - -void mbedtls_ssl_write_version( int major, int minor, int transport, - unsigned char ver[2] ); -void mbedtls_ssl_read_version( int *major, int *minor, int transport, - const unsigned char ver[2] ); - -static inline size_t mbedtls_ssl_hdr_len( const mbedtls_ssl_context *ssl ) -{ -#if defined(MBEDTLS_SSL_PROTO_DTLS) - if( ssl->conf->transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM ) - return( 13 ); -#else - ((void) ssl); -#endif - return( 5 ); -} - -static inline size_t mbedtls_ssl_hs_hdr_len( const mbedtls_ssl_context *ssl ) -{ -#if defined(MBEDTLS_SSL_PROTO_DTLS) - if( ssl->conf->transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM ) - return( 12 ); -#else - ((void) ssl); -#endif - return( 4 ); -} - -#if defined(MBEDTLS_SSL_PROTO_DTLS) -void mbedtls_ssl_send_flight_completed( mbedtls_ssl_context *ssl ); -void mbedtls_ssl_recv_flight_completed( mbedtls_ssl_context *ssl ); -int mbedtls_ssl_resend( mbedtls_ssl_context *ssl ); -int mbedtls_ssl_flight_transmit( mbedtls_ssl_context *ssl ); -#endif - -/* Visible for testing purposes only */ -#if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) -int mbedtls_ssl_dtls_replay_check( mbedtls_ssl_context *ssl ); -void mbedtls_ssl_dtls_replay_update( mbedtls_ssl_context *ssl ); -#endif - -/* constant-time buffer comparison */ -static inline int mbedtls_ssl_safer_memcmp( const void *a, const void *b, size_t n ) -{ - size_t i; - volatile const unsigned char *A = (volatile const unsigned char *) a; - volatile const unsigned char *B = (volatile const unsigned char *) b; - volatile unsigned char diff = 0; - - for( i = 0; i < n; i++ ) - { - /* Read volatile data in order before computing diff. - * This avoids IAR compiler warning: - * 'the order of volatile accesses is undefined ..' */ - unsigned char x = A[i], y = B[i]; - diff |= x ^ y; - } - - return( diff ); -} - -#if defined(MBEDTLS_SSL_PROTO_SSL3) || defined(MBEDTLS_SSL_PROTO_TLS1) || \ - defined(MBEDTLS_SSL_PROTO_TLS1_1) -int mbedtls_ssl_get_key_exchange_md_ssl_tls( mbedtls_ssl_context *ssl, - unsigned char *output, - unsigned char *data, size_t data_len ); -#endif /* MBEDTLS_SSL_PROTO_SSL3 || MBEDTLS_SSL_PROTO_TLS1 || \ - MBEDTLS_SSL_PROTO_TLS1_1 */ - -#if defined(MBEDTLS_SSL_PROTO_TLS1) || defined(MBEDTLS_SSL_PROTO_TLS1_1) || \ - defined(MBEDTLS_SSL_PROTO_TLS1_2) -int mbedtls_ssl_get_key_exchange_md_tls1_2( mbedtls_ssl_context *ssl, - unsigned char *hash, size_t *hashlen, - unsigned char *data, size_t data_len, - mbedtls_md_type_t md_alg ); -#endif /* MBEDTLS_SSL_PROTO_TLS1 || MBEDTLS_SSL_PROTO_TLS1_1 || \ - MBEDTLS_SSL_PROTO_TLS1_2 */ - -#ifdef __cplusplus -} -#endif - -#endif /* ssl_internal.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/ssl_ticket.h b/tools/sdk/include/mbedtls/mbedtls/ssl_ticket.h deleted file mode 100644 index b2686df09f4..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/ssl_ticket.h +++ /dev/null @@ -1,136 +0,0 @@ -/** - * \file ssl_ticket.h - * - * \brief TLS server ticket callbacks implementation - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_SSL_TICKET_H -#define MBEDTLS_SSL_TICKET_H - -/* - * This implementation of the session ticket callbacks includes key - * management, rotating the keys periodically in order to preserve forward - * secrecy, when MBEDTLS_HAVE_TIME is defined. - */ - -#include "ssl.h" -#include "cipher.h" - -#if defined(MBEDTLS_THREADING_C) -#include "threading.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Information for session ticket protection - */ -typedef struct mbedtls_ssl_ticket_key -{ - unsigned char name[4]; /*!< random key identifier */ - uint32_t generation_time; /*!< key generation timestamp (seconds) */ - mbedtls_cipher_context_t ctx; /*!< context for auth enc/decryption */ -} -mbedtls_ssl_ticket_key; - -/** - * \brief Context for session ticket handling functions - */ -typedef struct mbedtls_ssl_ticket_context -{ - mbedtls_ssl_ticket_key keys[2]; /*!< ticket protection keys */ - unsigned char active; /*!< index of the currently active key */ - - uint32_t ticket_lifetime; /*!< lifetime of tickets in seconds */ - - /** Callback for getting (pseudo-)random numbers */ - int (*f_rng)(void *, unsigned char *, size_t); - void *p_rng; /*!< context for the RNG function */ - -#if defined(MBEDTLS_THREADING_C) - mbedtls_threading_mutex_t mutex; -#endif -} -mbedtls_ssl_ticket_context; - -/** - * \brief Initialize a ticket context. - * (Just make it ready for mbedtls_ssl_ticket_setup() - * or mbedtls_ssl_ticket_free().) - * - * \param ctx Context to be initialized - */ -void mbedtls_ssl_ticket_init( mbedtls_ssl_ticket_context *ctx ); - -/** - * \brief Prepare context to be actually used - * - * \param ctx Context to be set up - * \param f_rng RNG callback function - * \param p_rng RNG callback context - * \param cipher AEAD cipher to use for ticket protection. - * Recommended value: MBEDTLS_CIPHER_AES_256_GCM. - * \param lifetime Tickets lifetime in seconds - * Recommended value: 86400 (one day). - * - * \note It is highly recommended to select a cipher that is at - * least as strong as the the strongest ciphersuite - * supported. Usually that means a 256-bit key. - * - * \note The lifetime of the keys is twice the lifetime of tickets. - * It is recommended to pick a reasonnable lifetime so as not - * to negate the benefits of forward secrecy. - * - * \return 0 if successful, - * or a specific MBEDTLS_ERR_XXX error code - */ -int mbedtls_ssl_ticket_setup( mbedtls_ssl_ticket_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), void *p_rng, - mbedtls_cipher_type_t cipher, - uint32_t lifetime ); - -/** - * \brief Implementation of the ticket write callback - * - * \note See \c mbedlts_ssl_ticket_write_t for description - */ -mbedtls_ssl_ticket_write_t mbedtls_ssl_ticket_write; - -/** - * \brief Implementation of the ticket parse callback - * - * \note See \c mbedlts_ssl_ticket_parse_t for description - */ -mbedtls_ssl_ticket_parse_t mbedtls_ssl_ticket_parse; - -/** - * \brief Free a context's content and zeroize it. - * - * \param ctx Context to be cleaned up - */ -void mbedtls_ssl_ticket_free( mbedtls_ssl_ticket_context *ctx ); - -#ifdef __cplusplus -} -#endif - -#endif /* ssl_ticket.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/threading.h b/tools/sdk/include/mbedtls/mbedtls/threading.h deleted file mode 100644 index 75298bf8a38..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/threading.h +++ /dev/null @@ -1,119 +0,0 @@ -/** - * \file threading.h - * - * \brief Threading abstraction layer - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_THREADING_H -#define MBEDTLS_THREADING_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define MBEDTLS_ERR_THREADING_FEATURE_UNAVAILABLE -0x001A /**< The selected feature is not available. */ -#define MBEDTLS_ERR_THREADING_BAD_INPUT_DATA -0x001C /**< Bad input parameters to function. */ -#define MBEDTLS_ERR_THREADING_MUTEX_ERROR -0x001E /**< Locking / unlocking / free failed with error code. */ - -#if defined(MBEDTLS_THREADING_PTHREAD) -#include -typedef struct mbedtls_threading_mutex_t -{ - pthread_mutex_t mutex; - char is_valid; -} mbedtls_threading_mutex_t; -#endif - -#if defined(MBEDTLS_THREADING_ALT) -/* You should define the mbedtls_threading_mutex_t type in your header */ -#include "threading_alt.h" - -/** - * \brief Set your alternate threading implementation function - * pointers and initialize global mutexes. If used, this - * function must be called once in the main thread before any - * other mbed TLS function is called, and - * mbedtls_threading_free_alt() must be called once in the main - * thread after all other mbed TLS functions. - * - * \note mutex_init() and mutex_free() don't return a status code. - * If mutex_init() fails, it should leave its argument (the - * mutex) in a state such that mutex_lock() will fail when - * called with this argument. - * - * \param mutex_init the init function implementation - * \param mutex_free the free function implementation - * \param mutex_lock the lock function implementation - * \param mutex_unlock the unlock function implementation - */ -void mbedtls_threading_set_alt( void (*mutex_init)( mbedtls_threading_mutex_t * ), - void (*mutex_free)( mbedtls_threading_mutex_t * ), - int (*mutex_lock)( mbedtls_threading_mutex_t * ), - int (*mutex_unlock)( mbedtls_threading_mutex_t * ) ); - -/** - * \brief Free global mutexes. - */ -void mbedtls_threading_free_alt( void ); -#endif /* MBEDTLS_THREADING_ALT */ - -#if defined(MBEDTLS_THREADING_C) -/* - * The function pointers for mutex_init, mutex_free, mutex_ and mutex_unlock - * - * All these functions are expected to work or the result will be undefined. - */ -extern void (*mbedtls_mutex_init)( mbedtls_threading_mutex_t *mutex ); -extern void (*mbedtls_mutex_free)( mbedtls_threading_mutex_t *mutex ); -extern int (*mbedtls_mutex_lock)( mbedtls_threading_mutex_t *mutex ); -extern int (*mbedtls_mutex_unlock)( mbedtls_threading_mutex_t *mutex ); - -/* - * Global mutexes - */ -#if defined(MBEDTLS_FS_IO) -extern mbedtls_threading_mutex_t mbedtls_threading_readdir_mutex; -#endif - -#if defined(MBEDTLS_HAVE_TIME_DATE) && !defined(MBEDTLS_PLATFORM_GMTIME_R_ALT) -/* This mutex may or may not be used in the default definition of - * mbedtls_platform_gmtime_r(), but in order to determine that, - * we need to check POSIX features, hence modify _POSIX_C_SOURCE. - * With the current approach, this declaration is orphaned, lacking - * an accompanying definition, in case mbedtls_platform_gmtime_r() - * doesn't need it, but that's not a problem. */ -extern mbedtls_threading_mutex_t mbedtls_threading_gmtime_mutex; -#endif /* MBEDTLS_HAVE_TIME_DATE && !MBEDTLS_PLATFORM_GMTIME_R_ALT */ - -#endif /* MBEDTLS_THREADING_C */ - -#ifdef __cplusplus -} -#endif - -#endif /* threading.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/timing.h b/tools/sdk/include/mbedtls/mbedtls/timing.h deleted file mode 100644 index a965fe0d355..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/timing.h +++ /dev/null @@ -1,153 +0,0 @@ -/** - * \file timing.h - * - * \brief Portable interface to timeouts and to the CPU cycle counter - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_TIMING_H -#define MBEDTLS_TIMING_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_TIMING_ALT) -// Regular implementation -// - -/** - * \brief timer structure - */ -struct mbedtls_timing_hr_time -{ - unsigned char opaque[32]; -}; - -/** - * \brief Context for mbedtls_timing_set/get_delay() - */ -typedef struct mbedtls_timing_delay_context -{ - struct mbedtls_timing_hr_time timer; - uint32_t int_ms; - uint32_t fin_ms; -} mbedtls_timing_delay_context; - -#else /* MBEDTLS_TIMING_ALT */ -#include "timing_alt.h" -#endif /* MBEDTLS_TIMING_ALT */ - -extern volatile int mbedtls_timing_alarmed; - -/** - * \brief Return the CPU cycle counter value - * - * \warning This is only a best effort! Do not rely on this! - * In particular, it is known to be unreliable on virtual - * machines. - * - * \note This value starts at an unspecified origin and - * may wrap around. - */ -unsigned long mbedtls_timing_hardclock( void ); - -/** - * \brief Return the elapsed time in milliseconds - * - * \param val points to a timer structure - * \param reset If 0, query the elapsed time. Otherwise (re)start the timer. - * - * \return Elapsed time since the previous reset in ms. When - * restarting, this is always 0. - * - * \note To initialize a timer, call this function with reset=1. - * - * Determining the elapsed time and resetting the timer is not - * atomic on all platforms, so after the sequence - * `{ get_timer(1); ...; time1 = get_timer(1); ...; time2 = - * get_timer(0) }` the value time1+time2 is only approximately - * the delay since the first reset. - */ -unsigned long mbedtls_timing_get_timer( struct mbedtls_timing_hr_time *val, int reset ); - -/** - * \brief Setup an alarm clock - * - * \param seconds delay before the "mbedtls_timing_alarmed" flag is set - * (must be >=0) - * - * \warning Only one alarm at a time is supported. In a threaded - * context, this means one for the whole process, not one per - * thread. - */ -void mbedtls_set_alarm( int seconds ); - -/** - * \brief Set a pair of delays to watch - * (See \c mbedtls_timing_get_delay().) - * - * \param data Pointer to timing data. - * Must point to a valid \c mbedtls_timing_delay_context struct. - * \param int_ms First (intermediate) delay in milliseconds. - * The effect if int_ms > fin_ms is unspecified. - * \param fin_ms Second (final) delay in milliseconds. - * Pass 0 to cancel the current delay. - * - * \note To set a single delay, either use \c mbedtls_timing_set_timer - * directly or use this function with int_ms == fin_ms. - */ -void mbedtls_timing_set_delay( void *data, uint32_t int_ms, uint32_t fin_ms ); - -/** - * \brief Get the status of delays - * (Memory helper: number of delays passed.) - * - * \param data Pointer to timing data - * Must point to a valid \c mbedtls_timing_delay_context struct. - * - * \return -1 if cancelled (fin_ms = 0), - * 0 if none of the delays are passed, - * 1 if only the intermediate delay is passed, - * 2 if the final delay is passed. - */ -int mbedtls_timing_get_delay( void *data ); - -#if defined(MBEDTLS_SELF_TEST) -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if a test failed - */ -int mbedtls_timing_self_test( int verbose ); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* timing.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/version.h b/tools/sdk/include/mbedtls/mbedtls/version.h deleted file mode 100644 index 326b8bd4516..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/version.h +++ /dev/null @@ -1,112 +0,0 @@ -/** - * \file version.h - * - * \brief Run-time version information - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -/* - * This set of compile-time defines and run-time variables can be used to - * determine the version number of the mbed TLS library used. - */ -#ifndef MBEDTLS_VERSION_H -#define MBEDTLS_VERSION_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -/** - * The version number x.y.z is split into three parts. - * Major, Minor, Patchlevel - */ -#define MBEDTLS_VERSION_MAJOR 2 -#define MBEDTLS_VERSION_MINOR 13 -#define MBEDTLS_VERSION_PATCH 1 - -/** - * The single version number has the following structure: - * MMNNPP00 - * Major version | Minor version | Patch version - */ -#define MBEDTLS_VERSION_NUMBER 0x020D0100 -#define MBEDTLS_VERSION_STRING "2.13.1" -#define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.13.1" - -#if defined(MBEDTLS_VERSION_C) - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Get the version number. - * - * \return The constructed version number in the format - * MMNNPP00 (Major, Minor, Patch). - */ -unsigned int mbedtls_version_get_number( void ); - -/** - * Get the version string ("x.y.z"). - * - * \param string The string that will receive the value. - * (Should be at least 9 bytes in size) - */ -void mbedtls_version_get_string( char *string ); - -/** - * Get the full version string ("mbed TLS x.y.z"). - * - * \param string The string that will receive the value. The mbed TLS version - * string will use 18 bytes AT MOST including a terminating - * null byte. - * (So the buffer should be at least 18 bytes to receive this - * version string). - */ -void mbedtls_version_get_string_full( char *string ); - -/** - * \brief Check if support for a feature was compiled into this - * mbed TLS binary. This allows you to see at runtime if the - * library was for instance compiled with or without - * Multi-threading support. - * - * \note only checks against defines in the sections "System - * support", "mbed TLS modules" and "mbed TLS feature - * support" in config.h - * - * \param feature The string for the define to check (e.g. "MBEDTLS_AES_C") - * - * \return 0 if the feature is present, - * -1 if the feature is not present and - * -2 if support for feature checking as a whole was not - * compiled in. - */ -int mbedtls_version_check_feature( const char *feature ); - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_VERSION_C */ - -#endif /* version.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/x509.h b/tools/sdk/include/mbedtls/mbedtls/x509.h deleted file mode 100644 index d6db9c6e373..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/x509.h +++ /dev/null @@ -1,333 +0,0 @@ -/** - * \file x509.h - * - * \brief X.509 generic defines and structures - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_X509_H -#define MBEDTLS_X509_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "asn1.h" -#include "pk.h" - -#if defined(MBEDTLS_RSA_C) -#include "rsa.h" -#endif - -/** - * \addtogroup x509_module - * \{ - */ - -#if !defined(MBEDTLS_X509_MAX_INTERMEDIATE_CA) -/** - * Maximum number of intermediate CAs in a verification chain. - * That is, maximum length of the chain, excluding the end-entity certificate - * and the trusted root certificate. - * - * Set this to a low value to prevent an adversary from making you waste - * resources verifying an overlong certificate chain. - */ -#define MBEDTLS_X509_MAX_INTERMEDIATE_CA 8 -#endif - -/** - * \name X509 Error codes - * \{ - */ -#define MBEDTLS_ERR_X509_FEATURE_UNAVAILABLE -0x2080 /**< Unavailable feature, e.g. RSA hashing/encryption combination. */ -#define MBEDTLS_ERR_X509_UNKNOWN_OID -0x2100 /**< Requested OID is unknown. */ -#define MBEDTLS_ERR_X509_INVALID_FORMAT -0x2180 /**< The CRT/CRL/CSR format is invalid, e.g. different type expected. */ -#define MBEDTLS_ERR_X509_INVALID_VERSION -0x2200 /**< The CRT/CRL/CSR version element is invalid. */ -#define MBEDTLS_ERR_X509_INVALID_SERIAL -0x2280 /**< The serial tag or value is invalid. */ -#define MBEDTLS_ERR_X509_INVALID_ALG -0x2300 /**< The algorithm tag or value is invalid. */ -#define MBEDTLS_ERR_X509_INVALID_NAME -0x2380 /**< The name tag or value is invalid. */ -#define MBEDTLS_ERR_X509_INVALID_DATE -0x2400 /**< The date tag or value is invalid. */ -#define MBEDTLS_ERR_X509_INVALID_SIGNATURE -0x2480 /**< The signature tag or value invalid. */ -#define MBEDTLS_ERR_X509_INVALID_EXTENSIONS -0x2500 /**< The extension tag or value is invalid. */ -#define MBEDTLS_ERR_X509_UNKNOWN_VERSION -0x2580 /**< CRT/CRL/CSR has an unsupported version number. */ -#define MBEDTLS_ERR_X509_UNKNOWN_SIG_ALG -0x2600 /**< Signature algorithm (oid) is unsupported. */ -#define MBEDTLS_ERR_X509_SIG_MISMATCH -0x2680 /**< Signature algorithms do not match. (see \c ::mbedtls_x509_crt sig_oid) */ -#define MBEDTLS_ERR_X509_CERT_VERIFY_FAILED -0x2700 /**< Certificate verification failed, e.g. CRL, CA or signature check failed. */ -#define MBEDTLS_ERR_X509_CERT_UNKNOWN_FORMAT -0x2780 /**< Format not recognized as DER or PEM. */ -#define MBEDTLS_ERR_X509_BAD_INPUT_DATA -0x2800 /**< Input invalid. */ -#define MBEDTLS_ERR_X509_ALLOC_FAILED -0x2880 /**< Allocation of memory failed. */ -#define MBEDTLS_ERR_X509_FILE_IO_ERROR -0x2900 /**< Read/write of file failed. */ -#define MBEDTLS_ERR_X509_BUFFER_TOO_SMALL -0x2980 /**< Destination buffer is too small. */ -#define MBEDTLS_ERR_X509_FATAL_ERROR -0x3000 /**< A fatal error occured, eg the chain is too long or the vrfy callback failed. */ -/* \} name */ - -/** - * \name X509 Verify codes - * \{ - */ -/* Reminder: update x509_crt_verify_strings[] in library/x509_crt.c */ -#define MBEDTLS_X509_BADCERT_EXPIRED 0x01 /**< The certificate validity has expired. */ -#define MBEDTLS_X509_BADCERT_REVOKED 0x02 /**< The certificate has been revoked (is on a CRL). */ -#define MBEDTLS_X509_BADCERT_CN_MISMATCH 0x04 /**< The certificate Common Name (CN) does not match with the expected CN. */ -#define MBEDTLS_X509_BADCERT_NOT_TRUSTED 0x08 /**< The certificate is not correctly signed by the trusted CA. */ -#define MBEDTLS_X509_BADCRL_NOT_TRUSTED 0x10 /**< The CRL is not correctly signed by the trusted CA. */ -#define MBEDTLS_X509_BADCRL_EXPIRED 0x20 /**< The CRL is expired. */ -#define MBEDTLS_X509_BADCERT_MISSING 0x40 /**< Certificate was missing. */ -#define MBEDTLS_X509_BADCERT_SKIP_VERIFY 0x80 /**< Certificate verification was skipped. */ -#define MBEDTLS_X509_BADCERT_OTHER 0x0100 /**< Other reason (can be used by verify callback) */ -#define MBEDTLS_X509_BADCERT_FUTURE 0x0200 /**< The certificate validity starts in the future. */ -#define MBEDTLS_X509_BADCRL_FUTURE 0x0400 /**< The CRL is from the future */ -#define MBEDTLS_X509_BADCERT_KEY_USAGE 0x0800 /**< Usage does not match the keyUsage extension. */ -#define MBEDTLS_X509_BADCERT_EXT_KEY_USAGE 0x1000 /**< Usage does not match the extendedKeyUsage extension. */ -#define MBEDTLS_X509_BADCERT_NS_CERT_TYPE 0x2000 /**< Usage does not match the nsCertType extension. */ -#define MBEDTLS_X509_BADCERT_BAD_MD 0x4000 /**< The certificate is signed with an unacceptable hash. */ -#define MBEDTLS_X509_BADCERT_BAD_PK 0x8000 /**< The certificate is signed with an unacceptable PK alg (eg RSA vs ECDSA). */ -#define MBEDTLS_X509_BADCERT_BAD_KEY 0x010000 /**< The certificate is signed with an unacceptable key (eg bad curve, RSA too short). */ -#define MBEDTLS_X509_BADCRL_BAD_MD 0x020000 /**< The CRL is signed with an unacceptable hash. */ -#define MBEDTLS_X509_BADCRL_BAD_PK 0x040000 /**< The CRL is signed with an unacceptable PK alg (eg RSA vs ECDSA). */ -#define MBEDTLS_X509_BADCRL_BAD_KEY 0x080000 /**< The CRL is signed with an unacceptable key (eg bad curve, RSA too short). */ - -/* \} name */ -/* \} addtogroup x509_module */ - -/* - * X.509 v3 Key Usage Extension flags - * Reminder: update x509_info_key_usage() when adding new flags. - */ -#define MBEDTLS_X509_KU_DIGITAL_SIGNATURE (0x80) /* bit 0 */ -#define MBEDTLS_X509_KU_NON_REPUDIATION (0x40) /* bit 1 */ -#define MBEDTLS_X509_KU_KEY_ENCIPHERMENT (0x20) /* bit 2 */ -#define MBEDTLS_X509_KU_DATA_ENCIPHERMENT (0x10) /* bit 3 */ -#define MBEDTLS_X509_KU_KEY_AGREEMENT (0x08) /* bit 4 */ -#define MBEDTLS_X509_KU_KEY_CERT_SIGN (0x04) /* bit 5 */ -#define MBEDTLS_X509_KU_CRL_SIGN (0x02) /* bit 6 */ -#define MBEDTLS_X509_KU_ENCIPHER_ONLY (0x01) /* bit 7 */ -#define MBEDTLS_X509_KU_DECIPHER_ONLY (0x8000) /* bit 8 */ - -/* - * Netscape certificate types - * (http://www.mozilla.org/projects/security/pki/nss/tech-notes/tn3.html) - */ - -#define MBEDTLS_X509_NS_CERT_TYPE_SSL_CLIENT (0x80) /* bit 0 */ -#define MBEDTLS_X509_NS_CERT_TYPE_SSL_SERVER (0x40) /* bit 1 */ -#define MBEDTLS_X509_NS_CERT_TYPE_EMAIL (0x20) /* bit 2 */ -#define MBEDTLS_X509_NS_CERT_TYPE_OBJECT_SIGNING (0x10) /* bit 3 */ -#define MBEDTLS_X509_NS_CERT_TYPE_RESERVED (0x08) /* bit 4 */ -#define MBEDTLS_X509_NS_CERT_TYPE_SSL_CA (0x04) /* bit 5 */ -#define MBEDTLS_X509_NS_CERT_TYPE_EMAIL_CA (0x02) /* bit 6 */ -#define MBEDTLS_X509_NS_CERT_TYPE_OBJECT_SIGNING_CA (0x01) /* bit 7 */ - -/* - * X.509 extension types - * - * Comments refer to the status for using certificates. Status can be - * different for writing certificates or reading CRLs or CSRs. - */ -#define MBEDTLS_X509_EXT_AUTHORITY_KEY_IDENTIFIER (1 << 0) -#define MBEDTLS_X509_EXT_SUBJECT_KEY_IDENTIFIER (1 << 1) -#define MBEDTLS_X509_EXT_KEY_USAGE (1 << 2) -#define MBEDTLS_X509_EXT_CERTIFICATE_POLICIES (1 << 3) -#define MBEDTLS_X509_EXT_POLICY_MAPPINGS (1 << 4) -#define MBEDTLS_X509_EXT_SUBJECT_ALT_NAME (1 << 5) /* Supported (DNS) */ -#define MBEDTLS_X509_EXT_ISSUER_ALT_NAME (1 << 6) -#define MBEDTLS_X509_EXT_SUBJECT_DIRECTORY_ATTRS (1 << 7) -#define MBEDTLS_X509_EXT_BASIC_CONSTRAINTS (1 << 8) /* Supported */ -#define MBEDTLS_X509_EXT_NAME_CONSTRAINTS (1 << 9) -#define MBEDTLS_X509_EXT_POLICY_CONSTRAINTS (1 << 10) -#define MBEDTLS_X509_EXT_EXTENDED_KEY_USAGE (1 << 11) -#define MBEDTLS_X509_EXT_CRL_DISTRIBUTION_POINTS (1 << 12) -#define MBEDTLS_X509_EXT_INIHIBIT_ANYPOLICY (1 << 13) -#define MBEDTLS_X509_EXT_FRESHEST_CRL (1 << 14) - -#define MBEDTLS_X509_EXT_NS_CERT_TYPE (1 << 16) - -/* - * Storage format identifiers - * Recognized formats: PEM and DER - */ -#define MBEDTLS_X509_FORMAT_DER 1 -#define MBEDTLS_X509_FORMAT_PEM 2 - -#define MBEDTLS_X509_MAX_DN_NAME_SIZE 256 /**< Maximum value size of a DN entry */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \addtogroup x509_module - * \{ */ - -/** - * \name Structures for parsing X.509 certificates, CRLs and CSRs - * \{ - */ - -/** - * Type-length-value structure that allows for ASN1 using DER. - */ -typedef mbedtls_asn1_buf mbedtls_x509_buf; - -/** - * Container for ASN1 bit strings. - */ -typedef mbedtls_asn1_bitstring mbedtls_x509_bitstring; - -/** - * Container for ASN1 named information objects. - * It allows for Relative Distinguished Names (e.g. cn=localhost,ou=code,etc.). - */ -typedef mbedtls_asn1_named_data mbedtls_x509_name; - -/** - * Container for a sequence of ASN.1 items - */ -typedef mbedtls_asn1_sequence mbedtls_x509_sequence; - -/** Container for date and time (precision in seconds). */ -typedef struct mbedtls_x509_time -{ - int year, mon, day; /**< Date. */ - int hour, min, sec; /**< Time. */ -} -mbedtls_x509_time; - -/** \} name Structures for parsing X.509 certificates, CRLs and CSRs */ -/** \} addtogroup x509_module */ - -/** - * \brief Store the certificate DN in printable form into buf; - * no more than size characters will be written. - * - * \param buf Buffer to write to - * \param size Maximum size of buffer - * \param dn The X509 name to represent - * - * \return The length of the string written (not including the - * terminated nul byte), or a negative error code. - */ -int mbedtls_x509_dn_gets( char *buf, size_t size, const mbedtls_x509_name *dn ); - -/** - * \brief Store the certificate serial in printable form into buf; - * no more than size characters will be written. - * - * \param buf Buffer to write to - * \param size Maximum size of buffer - * \param serial The X509 serial to represent - * - * \return The length of the string written (not including the - * terminated nul byte), or a negative error code. - */ -int mbedtls_x509_serial_gets( char *buf, size_t size, const mbedtls_x509_buf *serial ); - -/** - * \brief Check a given mbedtls_x509_time against the system time - * and tell if it's in the past. - * - * \note Intended usage is "if( is_past( valid_to ) ) ERROR". - * Hence the return value of 1 if on internal errors. - * - * \param to mbedtls_x509_time to check - * - * \return 1 if the given time is in the past or an error occured, - * 0 otherwise. - */ -int mbedtls_x509_time_is_past( const mbedtls_x509_time *to ); - -/** - * \brief Check a given mbedtls_x509_time against the system time - * and tell if it's in the future. - * - * \note Intended usage is "if( is_future( valid_from ) ) ERROR". - * Hence the return value of 1 if on internal errors. - * - * \param from mbedtls_x509_time to check - * - * \return 1 if the given time is in the future or an error occured, - * 0 otherwise. - */ -int mbedtls_x509_time_is_future( const mbedtls_x509_time *from ); - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - */ -int mbedtls_x509_self_test( int verbose ); - -/* - * Internal module functions. You probably do not want to use these unless you - * know you do. - */ -int mbedtls_x509_get_name( unsigned char **p, const unsigned char *end, - mbedtls_x509_name *cur ); -int mbedtls_x509_get_alg_null( unsigned char **p, const unsigned char *end, - mbedtls_x509_buf *alg ); -int mbedtls_x509_get_alg( unsigned char **p, const unsigned char *end, - mbedtls_x509_buf *alg, mbedtls_x509_buf *params ); -#if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT) -int mbedtls_x509_get_rsassa_pss_params( const mbedtls_x509_buf *params, - mbedtls_md_type_t *md_alg, mbedtls_md_type_t *mgf_md, - int *salt_len ); -#endif -int mbedtls_x509_get_sig( unsigned char **p, const unsigned char *end, mbedtls_x509_buf *sig ); -int mbedtls_x509_get_sig_alg( const mbedtls_x509_buf *sig_oid, const mbedtls_x509_buf *sig_params, - mbedtls_md_type_t *md_alg, mbedtls_pk_type_t *pk_alg, - void **sig_opts ); -int mbedtls_x509_get_time( unsigned char **p, const unsigned char *end, - mbedtls_x509_time *t ); -int mbedtls_x509_get_serial( unsigned char **p, const unsigned char *end, - mbedtls_x509_buf *serial ); -int mbedtls_x509_get_ext( unsigned char **p, const unsigned char *end, - mbedtls_x509_buf *ext, int tag ); -int mbedtls_x509_sig_alg_gets( char *buf, size_t size, const mbedtls_x509_buf *sig_oid, - mbedtls_pk_type_t pk_alg, mbedtls_md_type_t md_alg, - const void *sig_opts ); -int mbedtls_x509_key_size_helper( char *buf, size_t buf_size, const char *name ); -int mbedtls_x509_string_to_names( mbedtls_asn1_named_data **head, const char *name ); -int mbedtls_x509_set_extension( mbedtls_asn1_named_data **head, const char *oid, size_t oid_len, - int critical, const unsigned char *val, - size_t val_len ); -int mbedtls_x509_write_extensions( unsigned char **p, unsigned char *start, - mbedtls_asn1_named_data *first ); -int mbedtls_x509_write_names( unsigned char **p, unsigned char *start, - mbedtls_asn1_named_data *first ); -int mbedtls_x509_write_sig( unsigned char **p, unsigned char *start, - const char *oid, size_t oid_len, - unsigned char *sig, size_t size ); - -#define MBEDTLS_X509_SAFE_SNPRINTF \ - do { \ - if( ret < 0 || (size_t) ret >= n ) \ - return( MBEDTLS_ERR_X509_BUFFER_TOO_SMALL ); \ - \ - n -= (size_t) ret; \ - p += (size_t) ret; \ - } while( 0 ) - -#ifdef __cplusplus -} -#endif - -#endif /* x509.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/x509_crl.h b/tools/sdk/include/mbedtls/mbedtls/x509_crl.h deleted file mode 100644 index 08a4283a674..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/x509_crl.h +++ /dev/null @@ -1,174 +0,0 @@ -/** - * \file x509_crl.h - * - * \brief X.509 certificate revocation list parsing - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_X509_CRL_H -#define MBEDTLS_X509_CRL_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "x509.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \addtogroup x509_module - * \{ */ - -/** - * \name Structures and functions for parsing CRLs - * \{ - */ - -/** - * Certificate revocation list entry. - * Contains the CA-specific serial numbers and revocation dates. - */ -typedef struct mbedtls_x509_crl_entry -{ - mbedtls_x509_buf raw; - - mbedtls_x509_buf serial; - - mbedtls_x509_time revocation_date; - - mbedtls_x509_buf entry_ext; - - struct mbedtls_x509_crl_entry *next; -} -mbedtls_x509_crl_entry; - -/** - * Certificate revocation list structure. - * Every CRL may have multiple entries. - */ -typedef struct mbedtls_x509_crl -{ - mbedtls_x509_buf raw; /**< The raw certificate data (DER). */ - mbedtls_x509_buf tbs; /**< The raw certificate body (DER). The part that is To Be Signed. */ - - int version; /**< CRL version (1=v1, 2=v2) */ - mbedtls_x509_buf sig_oid; /**< CRL signature type identifier */ - - mbedtls_x509_buf issuer_raw; /**< The raw issuer data (DER). */ - - mbedtls_x509_name issuer; /**< The parsed issuer data (named information object). */ - - mbedtls_x509_time this_update; - mbedtls_x509_time next_update; - - mbedtls_x509_crl_entry entry; /**< The CRL entries containing the certificate revocation times for this CA. */ - - mbedtls_x509_buf crl_ext; - - mbedtls_x509_buf sig_oid2; - mbedtls_x509_buf sig; - mbedtls_md_type_t sig_md; /**< Internal representation of the MD algorithm of the signature algorithm, e.g. MBEDTLS_MD_SHA256 */ - mbedtls_pk_type_t sig_pk; /**< Internal representation of the Public Key algorithm of the signature algorithm, e.g. MBEDTLS_PK_RSA */ - void *sig_opts; /**< Signature options to be passed to mbedtls_pk_verify_ext(), e.g. for RSASSA-PSS */ - - struct mbedtls_x509_crl *next; -} -mbedtls_x509_crl; - -/** - * \brief Parse a DER-encoded CRL and append it to the chained list - * - * \param chain points to the start of the chain - * \param buf buffer holding the CRL data in DER format - * \param buflen size of the buffer - * (including the terminating null byte for PEM data) - * - * \return 0 if successful, or a specific X509 or PEM error code - */ -int mbedtls_x509_crl_parse_der( mbedtls_x509_crl *chain, - const unsigned char *buf, size_t buflen ); -/** - * \brief Parse one or more CRLs and append them to the chained list - * - * \note Mutliple CRLs are accepted only if using PEM format - * - * \param chain points to the start of the chain - * \param buf buffer holding the CRL data in PEM or DER format - * \param buflen size of the buffer - * (including the terminating null byte for PEM data) - * - * \return 0 if successful, or a specific X509 or PEM error code - */ -int mbedtls_x509_crl_parse( mbedtls_x509_crl *chain, const unsigned char *buf, size_t buflen ); - -#if defined(MBEDTLS_FS_IO) -/** - * \brief Load one or more CRLs and append them to the chained list - * - * \note Mutliple CRLs are accepted only if using PEM format - * - * \param chain points to the start of the chain - * \param path filename to read the CRLs from (in PEM or DER encoding) - * - * \return 0 if successful, or a specific X509 or PEM error code - */ -int mbedtls_x509_crl_parse_file( mbedtls_x509_crl *chain, const char *path ); -#endif /* MBEDTLS_FS_IO */ - -/** - * \brief Returns an informational string about the CRL. - * - * \param buf Buffer to write to - * \param size Maximum size of buffer - * \param prefix A line prefix - * \param crl The X509 CRL to represent - * - * \return The length of the string written (not including the - * terminated nul byte), or a negative error code. - */ -int mbedtls_x509_crl_info( char *buf, size_t size, const char *prefix, - const mbedtls_x509_crl *crl ); - -/** - * \brief Initialize a CRL (chain) - * - * \param crl CRL chain to initialize - */ -void mbedtls_x509_crl_init( mbedtls_x509_crl *crl ); - -/** - * \brief Unallocate all CRL data - * - * \param crl CRL chain to free - */ -void mbedtls_x509_crl_free( mbedtls_x509_crl *crl ); - -/* \} name */ -/* \} addtogroup x509_module */ - -#ifdef __cplusplus -} -#endif - -#endif /* mbedtls_x509_crl.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/x509_crt.h b/tools/sdk/include/mbedtls/mbedtls/x509_crt.h deleted file mode 100644 index d41ec93a66e..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/x509_crt.h +++ /dev/null @@ -1,670 +0,0 @@ -/** - * \file x509_crt.h - * - * \brief X.509 certificate parsing and writing - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_X509_CRT_H -#define MBEDTLS_X509_CRT_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "x509.h" -#include "x509_crl.h" - -/** - * \addtogroup x509_module - * \{ - */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \name Structures and functions for parsing and writing X.509 certificates - * \{ - */ - -/** - * Container for an X.509 certificate. The certificate may be chained. - */ -typedef struct mbedtls_x509_crt -{ - mbedtls_x509_buf raw; /**< The raw certificate data (DER). */ - mbedtls_x509_buf tbs; /**< The raw certificate body (DER). The part that is To Be Signed. */ - - int version; /**< The X.509 version. (1=v1, 2=v2, 3=v3) */ - mbedtls_x509_buf serial; /**< Unique id for certificate issued by a specific CA. */ - mbedtls_x509_buf sig_oid; /**< Signature algorithm, e.g. sha1RSA */ - - mbedtls_x509_buf issuer_raw; /**< The raw issuer data (DER). Used for quick comparison. */ - mbedtls_x509_buf subject_raw; /**< The raw subject data (DER). Used for quick comparison. */ - - mbedtls_x509_name issuer; /**< The parsed issuer data (named information object). */ - mbedtls_x509_name subject; /**< The parsed subject data (named information object). */ - - mbedtls_x509_time valid_from; /**< Start time of certificate validity. */ - mbedtls_x509_time valid_to; /**< End time of certificate validity. */ - - mbedtls_pk_context pk; /**< Container for the public key context. */ - - mbedtls_x509_buf issuer_id; /**< Optional X.509 v2/v3 issuer unique identifier. */ - mbedtls_x509_buf subject_id; /**< Optional X.509 v2/v3 subject unique identifier. */ - mbedtls_x509_buf v3_ext; /**< Optional X.509 v3 extensions. */ - mbedtls_x509_sequence subject_alt_names; /**< Optional list of Subject Alternative Names (Only dNSName supported). */ - - int ext_types; /**< Bit string containing detected and parsed extensions */ - int ca_istrue; /**< Optional Basic Constraint extension value: 1 if this certificate belongs to a CA, 0 otherwise. */ - int max_pathlen; /**< Optional Basic Constraint extension value: The maximum path length to the root certificate. Path length is 1 higher than RFC 5280 'meaning', so 1+ */ - - unsigned int key_usage; /**< Optional key usage extension value: See the values in x509.h */ - - mbedtls_x509_sequence ext_key_usage; /**< Optional list of extended key usage OIDs. */ - - unsigned char ns_cert_type; /**< Optional Netscape certificate type extension value: See the values in x509.h */ - - mbedtls_x509_buf sig; /**< Signature: hash of the tbs part signed with the private key. */ - mbedtls_md_type_t sig_md; /**< Internal representation of the MD algorithm of the signature algorithm, e.g. MBEDTLS_MD_SHA256 */ - mbedtls_pk_type_t sig_pk; /**< Internal representation of the Public Key algorithm of the signature algorithm, e.g. MBEDTLS_PK_RSA */ - void *sig_opts; /**< Signature options to be passed to mbedtls_pk_verify_ext(), e.g. for RSASSA-PSS */ - - struct mbedtls_x509_crt *next; /**< Next certificate in the CA-chain. */ -} -mbedtls_x509_crt; - -/** - * Build flag from an algorithm/curve identifier (pk, md, ecp) - * Since 0 is always XXX_NONE, ignore it. - */ -#define MBEDTLS_X509_ID_FLAG( id ) ( 1 << ( id - 1 ) ) - -/** - * Security profile for certificate verification. - * - * All lists are bitfields, built by ORing flags from MBEDTLS_X509_ID_FLAG(). - */ -typedef struct mbedtls_x509_crt_profile -{ - uint32_t allowed_mds; /**< MDs for signatures */ - uint32_t allowed_pks; /**< PK algs for signatures */ - uint32_t allowed_curves; /**< Elliptic curves for ECDSA */ - uint32_t rsa_min_bitlen; /**< Minimum size for RSA keys */ -} -mbedtls_x509_crt_profile; - -#define MBEDTLS_X509_CRT_VERSION_1 0 -#define MBEDTLS_X509_CRT_VERSION_2 1 -#define MBEDTLS_X509_CRT_VERSION_3 2 - -#define MBEDTLS_X509_RFC5280_MAX_SERIAL_LEN 32 -#define MBEDTLS_X509_RFC5280_UTC_TIME_LEN 15 - -#if !defined( MBEDTLS_X509_MAX_FILE_PATH_LEN ) -#define MBEDTLS_X509_MAX_FILE_PATH_LEN 512 -#endif - -/** - * Container for writing a certificate (CRT) - */ -typedef struct mbedtls_x509write_cert -{ - int version; - mbedtls_mpi serial; - mbedtls_pk_context *subject_key; - mbedtls_pk_context *issuer_key; - mbedtls_asn1_named_data *subject; - mbedtls_asn1_named_data *issuer; - mbedtls_md_type_t md_alg; - char not_before[MBEDTLS_X509_RFC5280_UTC_TIME_LEN + 1]; - char not_after[MBEDTLS_X509_RFC5280_UTC_TIME_LEN + 1]; - mbedtls_asn1_named_data *extensions; -} -mbedtls_x509write_cert; - -#if defined(MBEDTLS_X509_CRT_PARSE_C) -/** - * Default security profile. Should provide a good balance between security - * and compatibility with current deployments. - */ -extern const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_default; - -/** - * Expected next default profile. Recommended for new deployments. - * Currently targets a 128-bit security level, except for RSA-2048. - */ -extern const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_next; - -/** - * NSA Suite B profile. - */ -extern const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_suiteb; - -/** - * \brief Parse a single DER formatted certificate and add it - * to the chained list. - * - * \param chain points to the start of the chain - * \param buf buffer holding the certificate DER data - * \param buflen size of the buffer - * - * \return 0 if successful, or a specific X509 or PEM error code - */ -int mbedtls_x509_crt_parse_der( mbedtls_x509_crt *chain, const unsigned char *buf, - size_t buflen ); - -/** - * \brief Parse one or more certificates and add them - * to the chained list. Parses permissively. If some - * certificates can be parsed, the result is the number - * of failed certificates it encountered. If none complete - * correctly, the first error is returned. - * - * \param chain points to the start of the chain - * \param buf buffer holding the certificate data in PEM or DER format - * \param buflen size of the buffer - * (including the terminating null byte for PEM data) - * - * \return 0 if all certificates parsed successfully, a positive number - * if partly successful or a specific X509 or PEM error code - */ -int mbedtls_x509_crt_parse( mbedtls_x509_crt *chain, const unsigned char *buf, size_t buflen ); - -#if defined(MBEDTLS_FS_IO) -/** - * \brief Load one or more certificates and add them - * to the chained list. Parses permissively. If some - * certificates can be parsed, the result is the number - * of failed certificates it encountered. If none complete - * correctly, the first error is returned. - * - * \param chain points to the start of the chain - * \param path filename to read the certificates from - * - * \return 0 if all certificates parsed successfully, a positive number - * if partly successful or a specific X509 or PEM error code - */ -int mbedtls_x509_crt_parse_file( mbedtls_x509_crt *chain, const char *path ); - -/** - * \brief Load one or more certificate files from a path and add them - * to the chained list. Parses permissively. If some - * certificates can be parsed, the result is the number - * of failed certificates it encountered. If none complete - * correctly, the first error is returned. - * - * \param chain points to the start of the chain - * \param path directory / folder to read the certificate files from - * - * \return 0 if all certificates parsed successfully, a positive number - * if partly successful or a specific X509 or PEM error code - */ -int mbedtls_x509_crt_parse_path( mbedtls_x509_crt *chain, const char *path ); -#endif /* MBEDTLS_FS_IO */ - -/** - * \brief Returns an informational string about the - * certificate. - * - * \param buf Buffer to write to - * \param size Maximum size of buffer - * \param prefix A line prefix - * \param crt The X509 certificate to represent - * - * \return The length of the string written (not including the - * terminated nul byte), or a negative error code. - */ -int mbedtls_x509_crt_info( char *buf, size_t size, const char *prefix, - const mbedtls_x509_crt *crt ); - -/** - * \brief Returns an informational string about the - * verification status of a certificate. - * - * \param buf Buffer to write to - * \param size Maximum size of buffer - * \param prefix A line prefix - * \param flags Verification flags created by mbedtls_x509_crt_verify() - * - * \return The length of the string written (not including the - * terminated nul byte), or a negative error code. - */ -int mbedtls_x509_crt_verify_info( char *buf, size_t size, const char *prefix, - uint32_t flags ); - -/** - * \brief Verify the certificate signature - * - * The verify callback is a user-supplied callback that - * can clear / modify / add flags for a certificate. If set, - * the verification callback is called for each - * certificate in the chain (from the trust-ca down to the - * presented crt). The parameters for the callback are: - * (void *parameter, mbedtls_x509_crt *crt, int certificate_depth, - * int *flags). With the flags representing current flags for - * that specific certificate and the certificate depth from - * the bottom (Peer cert depth = 0). - * - * All flags left after returning from the callback - * are also returned to the application. The function should - * return 0 for anything (including invalid certificates) - * other than fatal error, as a non-zero return code - * immediately aborts the verification process. For fatal - * errors, a specific error code should be used (different - * from MBEDTLS_ERR_X509_CERT_VERIFY_FAILED which should not - * be returned at this point), or MBEDTLS_ERR_X509_FATAL_ERROR - * can be used if no better code is available. - * - * \note In case verification failed, the results can be displayed - * using \c mbedtls_x509_crt_verify_info() - * - * \note Same as \c mbedtls_x509_crt_verify_with_profile() with the - * default security profile. - * - * \note It is your responsibility to provide up-to-date CRLs for - * all trusted CAs. If no CRL is provided for the CA that was - * used to sign the certificate, CRL verification is skipped - * silently, that is *without* setting any flag. - * - * \note The \c trust_ca list can contain two types of certificates: - * (1) those of trusted root CAs, so that certificates - * chaining up to those CAs will be trusted, and (2) - * self-signed end-entity certificates to be trusted (for - * specific peers you know) - in that case, the self-signed - * certificate doesn't need to have the CA bit set. - * - * \param crt a certificate (chain) to be verified - * \param trust_ca the list of trusted CAs (see note above) - * \param ca_crl the list of CRLs for trusted CAs (see note above) - * \param cn expected Common Name (can be set to - * NULL if the CN must not be verified) - * \param flags result of the verification - * \param f_vrfy verification function - * \param p_vrfy verification parameter - * - * \return 0 (and flags set to 0) if the chain was verified and valid, - * MBEDTLS_ERR_X509_CERT_VERIFY_FAILED if the chain was verified - * but found to be invalid, in which case *flags will have one - * or more MBEDTLS_X509_BADCERT_XXX or MBEDTLS_X509_BADCRL_XXX - * flags set, or another error (and flags set to 0xffffffff) - * in case of a fatal error encountered during the - * verification process. - */ -int mbedtls_x509_crt_verify( mbedtls_x509_crt *crt, - mbedtls_x509_crt *trust_ca, - mbedtls_x509_crl *ca_crl, - const char *cn, uint32_t *flags, - int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *), - void *p_vrfy ); - -/** - * \brief Verify the certificate signature according to profile - * - * \note Same as \c mbedtls_x509_crt_verify(), but with explicit - * security profile. - * - * \note The restrictions on keys (RSA minimum size, allowed curves - * for ECDSA) apply to all certificates: trusted root, - * intermediate CAs if any, and end entity certificate. - * - * \param crt a certificate (chain) to be verified - * \param trust_ca the list of trusted CAs - * \param ca_crl the list of CRLs for trusted CAs - * \param profile security profile for verification - * \param cn expected Common Name (can be set to - * NULL if the CN must not be verified) - * \param flags result of the verification - * \param f_vrfy verification function - * \param p_vrfy verification parameter - * - * \return 0 if successful or MBEDTLS_ERR_X509_CERT_VERIFY_FAILED - * in which case *flags will have one or more - * MBEDTLS_X509_BADCERT_XXX or MBEDTLS_X509_BADCRL_XXX flags - * set, - * or another error in case of a fatal error encountered - * during the verification process. - */ -int mbedtls_x509_crt_verify_with_profile( mbedtls_x509_crt *crt, - mbedtls_x509_crt *trust_ca, - mbedtls_x509_crl *ca_crl, - const mbedtls_x509_crt_profile *profile, - const char *cn, uint32_t *flags, - int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *), - void *p_vrfy ); - -#if defined(MBEDTLS_X509_CHECK_KEY_USAGE) -/** - * \brief Check usage of certificate against keyUsage extension. - * - * \param crt Leaf certificate used. - * \param usage Intended usage(s) (eg MBEDTLS_X509_KU_KEY_ENCIPHERMENT - * before using the certificate to perform an RSA key - * exchange). - * - * \note Except for decipherOnly and encipherOnly, a bit set in the - * usage argument means this bit MUST be set in the - * certificate. For decipherOnly and encipherOnly, it means - * that bit MAY be set. - * - * \return 0 is these uses of the certificate are allowed, - * MBEDTLS_ERR_X509_BAD_INPUT_DATA if the keyUsage extension - * is present but does not match the usage argument. - * - * \note You should only call this function on leaf certificates, on - * (intermediate) CAs the keyUsage extension is automatically - * checked by \c mbedtls_x509_crt_verify(). - */ -int mbedtls_x509_crt_check_key_usage( const mbedtls_x509_crt *crt, - unsigned int usage ); -#endif /* MBEDTLS_X509_CHECK_KEY_USAGE) */ - -#if defined(MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE) -/** - * \brief Check usage of certificate against extendedKeyUsage. - * - * \param crt Leaf certificate used. - * \param usage_oid Intended usage (eg MBEDTLS_OID_SERVER_AUTH or - * MBEDTLS_OID_CLIENT_AUTH). - * \param usage_len Length of usage_oid (eg given by MBEDTLS_OID_SIZE()). - * - * \return 0 if this use of the certificate is allowed, - * MBEDTLS_ERR_X509_BAD_INPUT_DATA if not. - * - * \note Usually only makes sense on leaf certificates. - */ -int mbedtls_x509_crt_check_extended_key_usage( const mbedtls_x509_crt *crt, - const char *usage_oid, - size_t usage_len ); -#endif /* MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE */ - -#if defined(MBEDTLS_X509_CRL_PARSE_C) -/** - * \brief Verify the certificate revocation status - * - * \param crt a certificate to be verified - * \param crl the CRL to verify against - * - * \return 1 if the certificate is revoked, 0 otherwise - * - */ -int mbedtls_x509_crt_is_revoked( const mbedtls_x509_crt *crt, const mbedtls_x509_crl *crl ); -#endif /* MBEDTLS_X509_CRL_PARSE_C */ - -/** - * \brief Initialize a certificate (chain) - * - * \param crt Certificate chain to initialize - */ -void mbedtls_x509_crt_init( mbedtls_x509_crt *crt ); - -/** - * \brief Unallocate all certificate data - * - * \param crt Certificate chain to free - */ -void mbedtls_x509_crt_free( mbedtls_x509_crt *crt ); -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - -/* \} name */ -/* \} addtogroup x509_module */ - -#if defined(MBEDTLS_X509_CRT_WRITE_C) -/** - * \brief Initialize a CRT writing context - * - * \param ctx CRT context to initialize - */ -void mbedtls_x509write_crt_init( mbedtls_x509write_cert *ctx ); - -/** - * \brief Set the verion for a Certificate - * Default: MBEDTLS_X509_CRT_VERSION_3 - * - * \param ctx CRT context to use - * \param version version to set (MBEDTLS_X509_CRT_VERSION_1, MBEDTLS_X509_CRT_VERSION_2 or - * MBEDTLS_X509_CRT_VERSION_3) - */ -void mbedtls_x509write_crt_set_version( mbedtls_x509write_cert *ctx, int version ); - -/** - * \brief Set the serial number for a Certificate. - * - * \param ctx CRT context to use - * \param serial serial number to set - * - * \return 0 if successful - */ -int mbedtls_x509write_crt_set_serial( mbedtls_x509write_cert *ctx, const mbedtls_mpi *serial ); - -/** - * \brief Set the validity period for a Certificate - * Timestamps should be in string format for UTC timezone - * i.e. "YYYYMMDDhhmmss" - * e.g. "20131231235959" for December 31st 2013 - * at 23:59:59 - * - * \param ctx CRT context to use - * \param not_before not_before timestamp - * \param not_after not_after timestamp - * - * \return 0 if timestamp was parsed successfully, or - * a specific error code - */ -int mbedtls_x509write_crt_set_validity( mbedtls_x509write_cert *ctx, const char *not_before, - const char *not_after ); - -/** - * \brief Set the issuer name for a Certificate - * Issuer names should contain a comma-separated list - * of OID types and values: - * e.g. "C=UK,O=ARM,CN=mbed TLS CA" - * - * \param ctx CRT context to use - * \param issuer_name issuer name to set - * - * \return 0 if issuer name was parsed successfully, or - * a specific error code - */ -int mbedtls_x509write_crt_set_issuer_name( mbedtls_x509write_cert *ctx, - const char *issuer_name ); - -/** - * \brief Set the subject name for a Certificate - * Subject names should contain a comma-separated list - * of OID types and values: - * e.g. "C=UK,O=ARM,CN=mbed TLS Server 1" - * - * \param ctx CRT context to use - * \param subject_name subject name to set - * - * \return 0 if subject name was parsed successfully, or - * a specific error code - */ -int mbedtls_x509write_crt_set_subject_name( mbedtls_x509write_cert *ctx, - const char *subject_name ); - -/** - * \brief Set the subject public key for the certificate - * - * \param ctx CRT context to use - * \param key public key to include - */ -void mbedtls_x509write_crt_set_subject_key( mbedtls_x509write_cert *ctx, mbedtls_pk_context *key ); - -/** - * \brief Set the issuer key used for signing the certificate - * - * \param ctx CRT context to use - * \param key private key to sign with - */ -void mbedtls_x509write_crt_set_issuer_key( mbedtls_x509write_cert *ctx, mbedtls_pk_context *key ); - -/** - * \brief Set the MD algorithm to use for the signature - * (e.g. MBEDTLS_MD_SHA1) - * - * \param ctx CRT context to use - * \param md_alg MD algorithm to use - */ -void mbedtls_x509write_crt_set_md_alg( mbedtls_x509write_cert *ctx, mbedtls_md_type_t md_alg ); - -/** - * \brief Generic function to add to or replace an extension in the - * CRT - * - * \param ctx CRT context to use - * \param oid OID of the extension - * \param oid_len length of the OID - * \param critical if the extension is critical (per the RFC's definition) - * \param val value of the extension OCTET STRING - * \param val_len length of the value data - * - * \return 0 if successful, or a MBEDTLS_ERR_X509_ALLOC_FAILED - */ -int mbedtls_x509write_crt_set_extension( mbedtls_x509write_cert *ctx, - const char *oid, size_t oid_len, - int critical, - const unsigned char *val, size_t val_len ); - -/** - * \brief Set the basicConstraints extension for a CRT - * - * \param ctx CRT context to use - * \param is_ca is this a CA certificate - * \param max_pathlen maximum length of certificate chains below this - * certificate (only for CA certificates, -1 is - * inlimited) - * - * \return 0 if successful, or a MBEDTLS_ERR_X509_ALLOC_FAILED - */ -int mbedtls_x509write_crt_set_basic_constraints( mbedtls_x509write_cert *ctx, - int is_ca, int max_pathlen ); - -#if defined(MBEDTLS_SHA1_C) -/** - * \brief Set the subjectKeyIdentifier extension for a CRT - * Requires that mbedtls_x509write_crt_set_subject_key() has been - * called before - * - * \param ctx CRT context to use - * - * \return 0 if successful, or a MBEDTLS_ERR_X509_ALLOC_FAILED - */ -int mbedtls_x509write_crt_set_subject_key_identifier( mbedtls_x509write_cert *ctx ); - -/** - * \brief Set the authorityKeyIdentifier extension for a CRT - * Requires that mbedtls_x509write_crt_set_issuer_key() has been - * called before - * - * \param ctx CRT context to use - * - * \return 0 if successful, or a MBEDTLS_ERR_X509_ALLOC_FAILED - */ -int mbedtls_x509write_crt_set_authority_key_identifier( mbedtls_x509write_cert *ctx ); -#endif /* MBEDTLS_SHA1_C */ - -/** - * \brief Set the Key Usage Extension flags - * (e.g. MBEDTLS_X509_KU_DIGITAL_SIGNATURE | MBEDTLS_X509_KU_KEY_CERT_SIGN) - * - * \param ctx CRT context to use - * \param key_usage key usage flags to set - * - * \return 0 if successful, or MBEDTLS_ERR_X509_ALLOC_FAILED - */ -int mbedtls_x509write_crt_set_key_usage( mbedtls_x509write_cert *ctx, - unsigned int key_usage ); - -/** - * \brief Set the Netscape Cert Type flags - * (e.g. MBEDTLS_X509_NS_CERT_TYPE_SSL_CLIENT | MBEDTLS_X509_NS_CERT_TYPE_EMAIL) - * - * \param ctx CRT context to use - * \param ns_cert_type Netscape Cert Type flags to set - * - * \return 0 if successful, or MBEDTLS_ERR_X509_ALLOC_FAILED - */ -int mbedtls_x509write_crt_set_ns_cert_type( mbedtls_x509write_cert *ctx, - unsigned char ns_cert_type ); - -/** - * \brief Free the contents of a CRT write context - * - * \param ctx CRT context to free - */ -void mbedtls_x509write_crt_free( mbedtls_x509write_cert *ctx ); - -/** - * \brief Write a built up certificate to a X509 DER structure - * Note: data is written at the end of the buffer! Use the - * return value to determine where you should start - * using the buffer - * - * \param ctx certificate to write away - * \param buf buffer to write to - * \param size size of the buffer - * \param f_rng RNG function (for signature, see note) - * \param p_rng RNG parameter - * - * \return length of data written if successful, or a specific - * error code - * - * \note f_rng may be NULL if RSA is used for signature and the - * signature is made offline (otherwise f_rng is desirable - * for countermeasures against timing attacks). - * ECDSA signatures always require a non-NULL f_rng. - */ -int mbedtls_x509write_crt_der( mbedtls_x509write_cert *ctx, unsigned char *buf, size_t size, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -#if defined(MBEDTLS_PEM_WRITE_C) -/** - * \brief Write a built up certificate to a X509 PEM string - * - * \param ctx certificate to write away - * \param buf buffer to write to - * \param size size of the buffer - * \param f_rng RNG function (for signature, see note) - * \param p_rng RNG parameter - * - * \return 0 if successful, or a specific error code - * - * \note f_rng may be NULL if RSA is used for signature and the - * signature is made offline (otherwise f_rng is desirable - * for countermeasures against timing attacks). - * ECDSA signatures always require a non-NULL f_rng. - */ -int mbedtls_x509write_crt_pem( mbedtls_x509write_cert *ctx, unsigned char *buf, size_t size, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); -#endif /* MBEDTLS_PEM_WRITE_C */ -#endif /* MBEDTLS_X509_CRT_WRITE_C */ - -#ifdef __cplusplus -} -#endif - -#endif /* mbedtls_x509_crt.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/x509_csr.h b/tools/sdk/include/mbedtls/mbedtls/x509_csr.h deleted file mode 100644 index 0c6ccad78da..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/x509_csr.h +++ /dev/null @@ -1,299 +0,0 @@ -/** - * \file x509_csr.h - * - * \brief X.509 certificate signing request parsing and writing - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_X509_CSR_H -#define MBEDTLS_X509_CSR_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "x509.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \addtogroup x509_module - * \{ */ - -/** - * \name Structures and functions for X.509 Certificate Signing Requests (CSR) - * \{ - */ - -/** - * Certificate Signing Request (CSR) structure. - */ -typedef struct mbedtls_x509_csr -{ - mbedtls_x509_buf raw; /**< The raw CSR data (DER). */ - mbedtls_x509_buf cri; /**< The raw CertificateRequestInfo body (DER). */ - - int version; /**< CSR version (1=v1). */ - - mbedtls_x509_buf subject_raw; /**< The raw subject data (DER). */ - mbedtls_x509_name subject; /**< The parsed subject data (named information object). */ - - mbedtls_pk_context pk; /**< Container for the public key context. */ - - mbedtls_x509_buf sig_oid; - mbedtls_x509_buf sig; - mbedtls_md_type_t sig_md; /**< Internal representation of the MD algorithm of the signature algorithm, e.g. MBEDTLS_MD_SHA256 */ - mbedtls_pk_type_t sig_pk; /**< Internal representation of the Public Key algorithm of the signature algorithm, e.g. MBEDTLS_PK_RSA */ - void *sig_opts; /**< Signature options to be passed to mbedtls_pk_verify_ext(), e.g. for RSASSA-PSS */ -} -mbedtls_x509_csr; - -/** - * Container for writing a CSR - */ -typedef struct mbedtls_x509write_csr -{ - mbedtls_pk_context *key; - mbedtls_asn1_named_data *subject; - mbedtls_md_type_t md_alg; - mbedtls_asn1_named_data *extensions; -} -mbedtls_x509write_csr; - -#if defined(MBEDTLS_X509_CSR_PARSE_C) -/** - * \brief Load a Certificate Signing Request (CSR) in DER format - * - * \note CSR attributes (if any) are currently silently ignored. - * - * \param csr CSR context to fill - * \param buf buffer holding the CRL data - * \param buflen size of the buffer - * - * \return 0 if successful, or a specific X509 error code - */ -int mbedtls_x509_csr_parse_der( mbedtls_x509_csr *csr, - const unsigned char *buf, size_t buflen ); - -/** - * \brief Load a Certificate Signing Request (CSR), DER or PEM format - * - * \note See notes for \c mbedtls_x509_csr_parse_der() - * - * \param csr CSR context to fill - * \param buf buffer holding the CRL data - * \param buflen size of the buffer - * (including the terminating null byte for PEM data) - * - * \return 0 if successful, or a specific X509 or PEM error code - */ -int mbedtls_x509_csr_parse( mbedtls_x509_csr *csr, const unsigned char *buf, size_t buflen ); - -#if defined(MBEDTLS_FS_IO) -/** - * \brief Load a Certificate Signing Request (CSR) - * - * \note See notes for \c mbedtls_x509_csr_parse() - * - * \param csr CSR context to fill - * \param path filename to read the CSR from - * - * \return 0 if successful, or a specific X509 or PEM error code - */ -int mbedtls_x509_csr_parse_file( mbedtls_x509_csr *csr, const char *path ); -#endif /* MBEDTLS_FS_IO */ - -/** - * \brief Returns an informational string about the - * CSR. - * - * \param buf Buffer to write to - * \param size Maximum size of buffer - * \param prefix A line prefix - * \param csr The X509 CSR to represent - * - * \return The length of the string written (not including the - * terminated nul byte), or a negative error code. - */ -int mbedtls_x509_csr_info( char *buf, size_t size, const char *prefix, - const mbedtls_x509_csr *csr ); - -/** - * \brief Initialize a CSR - * - * \param csr CSR to initialize - */ -void mbedtls_x509_csr_init( mbedtls_x509_csr *csr ); - -/** - * \brief Unallocate all CSR data - * - * \param csr CSR to free - */ -void mbedtls_x509_csr_free( mbedtls_x509_csr *csr ); -#endif /* MBEDTLS_X509_CSR_PARSE_C */ - -/* \} name */ -/* \} addtogroup x509_module */ - -#if defined(MBEDTLS_X509_CSR_WRITE_C) -/** - * \brief Initialize a CSR context - * - * \param ctx CSR context to initialize - */ -void mbedtls_x509write_csr_init( mbedtls_x509write_csr *ctx ); - -/** - * \brief Set the subject name for a CSR - * Subject names should contain a comma-separated list - * of OID types and values: - * e.g. "C=UK,O=ARM,CN=mbed TLS Server 1" - * - * \param ctx CSR context to use - * \param subject_name subject name to set - * - * \return 0 if subject name was parsed successfully, or - * a specific error code - */ -int mbedtls_x509write_csr_set_subject_name( mbedtls_x509write_csr *ctx, - const char *subject_name ); - -/** - * \brief Set the key for a CSR (public key will be included, - * private key used to sign the CSR when writing it) - * - * \param ctx CSR context to use - * \param key Asymetric key to include - */ -void mbedtls_x509write_csr_set_key( mbedtls_x509write_csr *ctx, mbedtls_pk_context *key ); - -/** - * \brief Set the MD algorithm to use for the signature - * (e.g. MBEDTLS_MD_SHA1) - * - * \param ctx CSR context to use - * \param md_alg MD algorithm to use - */ -void mbedtls_x509write_csr_set_md_alg( mbedtls_x509write_csr *ctx, mbedtls_md_type_t md_alg ); - -/** - * \brief Set the Key Usage Extension flags - * (e.g. MBEDTLS_X509_KU_DIGITAL_SIGNATURE | MBEDTLS_X509_KU_KEY_CERT_SIGN) - * - * \param ctx CSR context to use - * \param key_usage key usage flags to set - * - * \return 0 if successful, or MBEDTLS_ERR_X509_ALLOC_FAILED - */ -int mbedtls_x509write_csr_set_key_usage( mbedtls_x509write_csr *ctx, unsigned char key_usage ); - -/** - * \brief Set the Netscape Cert Type flags - * (e.g. MBEDTLS_X509_NS_CERT_TYPE_SSL_CLIENT | MBEDTLS_X509_NS_CERT_TYPE_EMAIL) - * - * \param ctx CSR context to use - * \param ns_cert_type Netscape Cert Type flags to set - * - * \return 0 if successful, or MBEDTLS_ERR_X509_ALLOC_FAILED - */ -int mbedtls_x509write_csr_set_ns_cert_type( mbedtls_x509write_csr *ctx, - unsigned char ns_cert_type ); - -/** - * \brief Generic function to add to or replace an extension in the - * CSR - * - * \param ctx CSR context to use - * \param oid OID of the extension - * \param oid_len length of the OID - * \param val value of the extension OCTET STRING - * \param val_len length of the value data - * - * \return 0 if successful, or a MBEDTLS_ERR_X509_ALLOC_FAILED - */ -int mbedtls_x509write_csr_set_extension( mbedtls_x509write_csr *ctx, - const char *oid, size_t oid_len, - const unsigned char *val, size_t val_len ); - -/** - * \brief Free the contents of a CSR context - * - * \param ctx CSR context to free - */ -void mbedtls_x509write_csr_free( mbedtls_x509write_csr *ctx ); - -/** - * \brief Write a CSR (Certificate Signing Request) to a - * DER structure - * Note: data is written at the end of the buffer! Use the - * return value to determine where you should start - * using the buffer - * - * \param ctx CSR to write away - * \param buf buffer to write to - * \param size size of the buffer - * \param f_rng RNG function (for signature, see note) - * \param p_rng RNG parameter - * - * \return length of data written if successful, or a specific - * error code - * - * \note f_rng may be NULL if RSA is used for signature and the - * signature is made offline (otherwise f_rng is desirable - * for countermeasures against timing attacks). - * ECDSA signatures always require a non-NULL f_rng. - */ -int mbedtls_x509write_csr_der( mbedtls_x509write_csr *ctx, unsigned char *buf, size_t size, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -#if defined(MBEDTLS_PEM_WRITE_C) -/** - * \brief Write a CSR (Certificate Signing Request) to a - * PEM string - * - * \param ctx CSR to write away - * \param buf buffer to write to - * \param size size of the buffer - * \param f_rng RNG function (for signature, see note) - * \param p_rng RNG parameter - * - * \return 0 if successful, or a specific error code - * - * \note f_rng may be NULL if RSA is used for signature and the - * signature is made offline (otherwise f_rng is desirable - * for countermeasures against timing attacks). - * ECDSA signatures always require a non-NULL f_rng. - */ -int mbedtls_x509write_csr_pem( mbedtls_x509write_csr *ctx, unsigned char *buf, size_t size, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); -#endif /* MBEDTLS_PEM_WRITE_C */ -#endif /* MBEDTLS_X509_CSR_WRITE_C */ - -#ifdef __cplusplus -} -#endif - -#endif /* mbedtls_x509_csr.h */ diff --git a/tools/sdk/include/mbedtls/mbedtls/xtea.h b/tools/sdk/include/mbedtls/mbedtls/xtea.h deleted file mode 100644 index c70c3fe2654..00000000000 --- a/tools/sdk/include/mbedtls/mbedtls/xtea.h +++ /dev/null @@ -1,133 +0,0 @@ -/** - * \file xtea.h - * - * \brief XTEA block cipher (32-bit) - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_XTEA_H -#define MBEDTLS_XTEA_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -#define MBEDTLS_XTEA_ENCRYPT 1 -#define MBEDTLS_XTEA_DECRYPT 0 - -#define MBEDTLS_ERR_XTEA_INVALID_INPUT_LENGTH -0x0028 /**< The data input has an invalid length. */ -#define MBEDTLS_ERR_XTEA_HW_ACCEL_FAILED -0x0029 /**< XTEA hardware accelerator failed. */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_XTEA_ALT) -// Regular implementation -// - -/** - * \brief XTEA context structure - */ -typedef struct mbedtls_xtea_context -{ - uint32_t k[4]; /*!< key */ -} -mbedtls_xtea_context; - -#else /* MBEDTLS_XTEA_ALT */ -#include "xtea_alt.h" -#endif /* MBEDTLS_XTEA_ALT */ - -/** - * \brief Initialize XTEA context - * - * \param ctx XTEA context to be initialized - */ -void mbedtls_xtea_init( mbedtls_xtea_context *ctx ); - -/** - * \brief Clear XTEA context - * - * \param ctx XTEA context to be cleared - */ -void mbedtls_xtea_free( mbedtls_xtea_context *ctx ); - -/** - * \brief XTEA key schedule - * - * \param ctx XTEA context to be initialized - * \param key the secret key - */ -void mbedtls_xtea_setup( mbedtls_xtea_context *ctx, const unsigned char key[16] ); - -/** - * \brief XTEA cipher function - * - * \param ctx XTEA context - * \param mode MBEDTLS_XTEA_ENCRYPT or MBEDTLS_XTEA_DECRYPT - * \param input 8-byte input block - * \param output 8-byte output block - * - * \return 0 if successful - */ -int mbedtls_xtea_crypt_ecb( mbedtls_xtea_context *ctx, - int mode, - const unsigned char input[8], - unsigned char output[8] ); - -#if defined(MBEDTLS_CIPHER_MODE_CBC) -/** - * \brief XTEA CBC cipher function - * - * \param ctx XTEA context - * \param mode MBEDTLS_XTEA_ENCRYPT or MBEDTLS_XTEA_DECRYPT - * \param length the length of input, multiple of 8 - * \param iv initialization vector for CBC mode - * \param input input block - * \param output output block - * - * \return 0 if successful, - * MBEDTLS_ERR_XTEA_INVALID_INPUT_LENGTH if the length % 8 != 0 - */ -int mbedtls_xtea_crypt_cbc( mbedtls_xtea_context *ctx, - int mode, - size_t length, - unsigned char iv[8], - const unsigned char *input, - unsigned char *output); -#endif /* MBEDTLS_CIPHER_MODE_CBC */ - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - */ -int mbedtls_xtea_self_test( int verbose ); - -#ifdef __cplusplus -} -#endif - -#endif /* xtea.h */ diff --git a/tools/sdk/include/mbedtls/sha1_alt.h b/tools/sdk/include/mbedtls/sha1_alt.h deleted file mode 100644 index 54b77408780..00000000000 --- a/tools/sdk/include/mbedtls/sha1_alt.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * SHA-1 implementation with hardware ESP32 support added. - * Uses mbedTLS software implementation for failover when concurrent - * SHA operations are in use. - * - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * Additions Copyright (C) 2016, Espressif Systems (Shanghai) PTE LTD - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - */ -#ifndef _SHA1_ALT_H_ -#define _SHA1_ALT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(MBEDTLS_SHA1_ALT) - -typedef enum { - ESP_MBEDTLS_SHA1_UNUSED, /* first block hasn't been processed yet */ - ESP_MBEDTLS_SHA1_HARDWARE, /* using hardware SHA engine */ - ESP_MBEDTLS_SHA1_SOFTWARE, /* using software SHA */ -} esp_mbedtls_sha1_mode; - -/** - * \brief SHA-1 context structure - */ -typedef struct -{ - uint32_t total[2]; /*!< number of bytes processed */ - uint32_t state[5]; /*!< intermediate digest state */ - unsigned char buffer[64]; /*!< data block being processed */ - esp_mbedtls_sha1_mode mode; -} -mbedtls_sha1_context; - -#endif - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/tools/sdk/include/mbedtls/sha256_alt.h b/tools/sdk/include/mbedtls/sha256_alt.h deleted file mode 100644 index 436f5324c8c..00000000000 --- a/tools/sdk/include/mbedtls/sha256_alt.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * SHA-256 implementation with hardware ESP32 support added. - * Uses mbedTLS software implementation for failover when concurrent - * SHA operations are in use. - * - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * Additions Copyright (C) 2016, Espressif Systems (Shanghai) PTE LTD - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - */ -#ifndef _SHA256_ALT_H_ -#define _SHA256_ALT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(MBEDTLS_SHA256_ALT) - -typedef enum { - ESP_MBEDTLS_SHA256_UNUSED, /* first block hasn't been processed yet */ - ESP_MBEDTLS_SHA256_HARDWARE, /* using hardware SHA engine */ - ESP_MBEDTLS_SHA256_SOFTWARE, /* using software SHA */ -} esp_mbedtls_sha256_mode; - -/** - * \brief SHA-256 context structure - */ -typedef struct -{ - uint32_t total[2]; /*!< number of bytes processed */ - uint32_t state[8]; /*!< intermediate digest state */ - unsigned char buffer[64]; /*!< data block being processed */ - int is224; /*!< 0 => SHA-256, else SHA-224 */ - esp_mbedtls_sha256_mode mode; -} -mbedtls_sha256_context; - -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/mbedtls/sha512_alt.h b/tools/sdk/include/mbedtls/sha512_alt.h deleted file mode 100644 index 36b8fc9d244..00000000000 --- a/tools/sdk/include/mbedtls/sha512_alt.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * SHA-512 implementation with hardware ESP32 support added. - * Uses mbedTLS software implementation for failover when concurrent - * SHA operations are in use. - * - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * Additions Copyright (C) 2016, Espressif Systems (Shanghai) PTE LTD - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - */ -#ifndef _SHA512_ALT_H_ -#define _SHA512_ALT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(MBEDTLS_SHA512_ALT) - -typedef enum { - ESP_MBEDTLS_SHA512_UNUSED, /* first block hasn't been processed yet */ - ESP_MBEDTLS_SHA512_HARDWARE, /* using hardware SHA engine */ - ESP_MBEDTLS_SHA512_SOFTWARE, /* using software SHA */ -} esp_mbedtls_sha512_mode; - -/** - * \brief SHA-512 context structure - */ -typedef struct -{ - uint64_t total[2]; /*!< number of bytes processed */ - uint64_t state[8]; /*!< intermediate digest state */ - unsigned char buffer[128]; /*!< data block being processed */ - int is384; /*!< 0 => SHA-512, else SHA-384 */ - esp_mbedtls_sha512_mode mode; -} -mbedtls_sha512_context; - -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/mdns/mdns.h b/tools/sdk/include/mdns/mdns.h deleted file mode 100644 index a5ebb809f6b..00000000000 --- a/tools/sdk/include/mdns/mdns.h +++ /dev/null @@ -1,362 +0,0 @@ -// 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. -#ifndef ESP_MDNS_H_ -#define ESP_MDNS_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include "esp_event.h" - -#define MDNS_TYPE_A 0x0001 -#define MDNS_TYPE_PTR 0x000C -#define MDNS_TYPE_TXT 0x0010 -#define MDNS_TYPE_AAAA 0x001C -#define MDNS_TYPE_SRV 0x0021 -#define MDNS_TYPE_OPT 0x0029 -#define MDNS_TYPE_NSEC 0x002F -#define MDNS_TYPE_ANY 0x00FF - -/** - * @brief mDNS enum to specify the ip_protocol type - */ -typedef enum { - MDNS_IP_PROTOCOL_V4, - MDNS_IP_PROTOCOL_V6, - MDNS_IP_PROTOCOL_MAX -} mdns_ip_protocol_t; - -/** - * @brief mDNS basic text item structure - * Used in mdns_service_add() - */ -typedef struct { - char * key; /*!< item key name */ - char * value; /*!< item value string */ -} mdns_txt_item_t; - -/** - * @brief mDNS query linked list IP item - */ -typedef struct mdns_ip_addr_s { - ip_addr_t addr; /*!< IP address */ - struct mdns_ip_addr_s * next; /*!< next IP, or NULL for the last IP in the list */ -} mdns_ip_addr_t; - -/** - * @brief mDNS query result structure - */ -typedef struct mdns_result_s { - struct mdns_result_s * next; /*!< next result, or NULL for the last result in the list */ - - tcpip_adapter_if_t tcpip_if; /*!< interface on which the result came (AP/STA/ETH) */ - mdns_ip_protocol_t ip_protocol; /*!< ip_protocol type of the interface (v4/v6) */ - // PTR - char * instance_name; /*!< instance name */ - // SRV - char * hostname; /*!< hostname */ - uint16_t port; /*!< service port */ - // TXT - mdns_txt_item_t * txt; /*!< txt record */ - size_t txt_count; /*!< number of txt items */ - // A and AAAA - mdns_ip_addr_t * addr; /*!< linked list of IP addreses found */ -} mdns_result_t; - -/** - * @brief Initialize mDNS on given interface - * - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_ARG when bad tcpip_if is given - * - ESP_ERR_INVALID_STATE when the network returned error - * - ESP_ERR_NO_MEM on memory error - * - ESP_ERR_WIFI_NOT_INIT when WiFi is not initialized by eps_wifi_init - */ -esp_err_t mdns_init(); - -/** - * @brief Stop and free mDNS server - * - */ -void mdns_free(); - -/** - * @brief Set the hostname for mDNS server - * required if you want to advertise services - * - * @param hostname Hostname to set - * - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_ERR_NO_MEM memory error - */ -esp_err_t mdns_hostname_set(const char * hostname); - -/** - * @brief Set the default instance name for mDNS server - * - * @param instance_name Instance name to set - * - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_ERR_NO_MEM memory error - */ -esp_err_t mdns_instance_name_set(const char * instance_name); - -/** - * @brief Add service to mDNS server - * - * @param instance_name instance name to set. If NULL, - * global instance name or hostname will be used - * @param service_type service type (_http, _ftp, etc) - * @param proto service protocol (_tcp, _udp) - * @param port service port - * @param num_items number of items in TXT data - * @param txt string array of TXT data (eg. {{"var","val"},{"other","2"}}) - * - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_ERR_NO_MEM memory error - */ -esp_err_t mdns_service_add(const char * instance_name, const char * service_type, const char * proto, uint16_t port, mdns_txt_item_t txt[], size_t num_items); - -/** - * @brief Remove service from mDNS server - * - * @param service_type service type (_http, _ftp, etc) - * @param proto service protocol (_tcp, _udp) - * - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_ERR_NOT_FOUND Service not found - * - ESP_FAIL unknown error - */ -esp_err_t mdns_service_remove(const char * service_type, const char * proto); - -/** - * @brief Set instance name for service - * - * @param service_type service type (_http, _ftp, etc) - * @param proto service protocol (_tcp, _udp) - * @param instance_name instance name to set - * - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_ERR_NOT_FOUND Service not found - * - ESP_ERR_NO_MEM memory error - */ -esp_err_t mdns_service_instance_name_set(const char * service_type, const char * proto, const char * instance_name); - -/** - * @brief Set service port - * - * @param service_type service type (_http, _ftp, etc) - * @param proto service protocol (_tcp, _udp) - * @param port service port - * - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_ERR_NOT_FOUND Service not found - */ -esp_err_t mdns_service_port_set(const char * service_type, const char * proto, uint16_t port); - -/** - * @brief Replace all TXT items for service - * - * @param service_type service type (_http, _ftp, etc) - * @param proto service protocol (_tcp, _udp) - * @param num_items number of items in TXT data - * @param txt array of TXT data (eg. {{"var","val"},{"other","2"}}) - * - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_ERR_NOT_FOUND Service not found - * - ESP_ERR_NO_MEM memory error - */ -esp_err_t mdns_service_txt_set(const char * service_type, const char * proto, mdns_txt_item_t txt[], uint8_t num_items); - -/** - * @brief Set/Add TXT item for service TXT record - * - * @param service_type service type (_http, _ftp, etc) - * @param proto service protocol (_tcp, _udp) - * @param key the key that you want to add/update - * @param value the new value of the key - * - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_ERR_NOT_FOUND Service not found - * - ESP_ERR_NO_MEM memory error - */ -esp_err_t mdns_service_txt_item_set(const char * service_type, const char * proto, const char * key, const char * value); - -/** - * @brief Remove TXT item for service TXT record - * - * @param service_type service type (_http, _ftp, etc) - * @param proto service protocol (_tcp, _udp) - * @param key the key that you want to remove - * - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_ARG Parameter error - * - ESP_ERR_NOT_FOUND Service not found - * - ESP_ERR_NO_MEM memory error - */ -esp_err_t mdns_service_txt_item_remove(const char * service_type, const char * proto, const char * key); - -/** - * @brief Remove and free all services from mDNS server - * - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t mdns_service_remove_all(); - -/** - * @brief Query mDNS for host or service - * All following query methods are derived from this one - * - * @param name service instance or host name (NULL for PTR queries) - * @param service_type service type (_http, _arduino, _ftp etc.) (NULL for host queries) - * @param proto service protocol (_tcp, _udp, etc.) (NULL for host queries) - * @param type type of query (MDNS_TYPE_*) - * @param timeout time in milliseconds to wait for answers. - * @param max_results maximum results to be collected - * @param results pointer to the results of the query - * results must be freed using mdns_query_results_free below - * - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_STATE mDNS is not running - * - ESP_ERR_NO_MEM memory error - * - ESP_ERR_INVALID_ARG timeout was not given - */ -esp_err_t mdns_query(const char * name, const char * service_type, const char * proto, uint16_t type, uint32_t timeout, size_t max_results, mdns_result_t ** results); - -/** - * @brief Free query results - * - * @param results linked list of results to be freed - */ -void mdns_query_results_free(mdns_result_t * results); - -/** - * @brief Query mDNS for service - * - * @param service_type service type (_http, _arduino, _ftp etc.) - * @param proto service protocol (_tcp, _udp, etc.) - * @param timeout time in milliseconds to wait for answer. - * @param max_results maximum results to be collected - * @param results pointer to the results of the query - * - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_STATE mDNS is not running - * - ESP_ERR_NO_MEM memory error - * - ESP_ERR_INVALID_ARG parameter error - */ -esp_err_t mdns_query_ptr(const char * service_type, const char * proto, uint32_t timeout, size_t max_results, mdns_result_t ** results); - -/** - * @brief Query mDNS for SRV record - * - * @param instance_name service instance name - * @param service_type service type (_http, _arduino, _ftp etc.) - * @param proto service protocol (_tcp, _udp, etc.) - * @param timeout time in milliseconds to wait for answer. - * @param result pointer to the result of the query - * - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_STATE mDNS is not running - * - ESP_ERR_NO_MEM memory error - * - ESP_ERR_INVALID_ARG parameter error - */ -esp_err_t mdns_query_srv(const char * instance_name, const char * service_type, const char * proto, uint32_t timeout, mdns_result_t ** result); - -/** - * @brief Query mDNS for TXT record - * - * @param instance_name service instance name - * @param service_type service type (_http, _arduino, _ftp etc.) - * @param proto service protocol (_tcp, _udp, etc.) - * @param timeout time in milliseconds to wait for answer. - * @param result pointer to the result of the query - * - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_STATE mDNS is not running - * - ESP_ERR_NO_MEM memory error - * - ESP_ERR_INVALID_ARG parameter error - */ -esp_err_t mdns_query_txt(const char * instance_name, const char * service_type, const char * proto, uint32_t timeout, mdns_result_t ** result); - -/** - * @brief Query mDNS for A record - * - * @param host_name host name to look for - * @param timeout time in milliseconds to wait for answer. - * @param addr pointer to the resulting IP4 address - * - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_STATE mDNS is not running - * - ESP_ERR_NO_MEM memory error - * - ESP_ERR_INVALID_ARG parameter error - */ -esp_err_t mdns_query_a(const char * host_name, uint32_t timeout, ip4_addr_t * addr); - -/** - * @brief Query mDNS for A record - * - * @param host_name host name to look for - * @param timeout time in milliseconds to wait for answer. If 0, max_results needs to be defined - * @param addr pointer to the resulting IP6 address - * - * @return - * - ESP_OK success - * - ESP_ERR_INVALID_STATE mDNS is not running - * - ESP_ERR_NO_MEM memory error - * - ESP_ERR_INVALID_ARG parameter error - */ -esp_err_t mdns_query_aaaa(const char * host_name, uint32_t timeout, ip6_addr_t * addr); - -/** - * @brief System event handler - * This method controls the service state on all active interfaces and applications are required - * to call it from the system event handler for normal operation of mDNS service. - * - * @param ctx The system event context - * @param event The system event - */ -esp_err_t mdns_handle_system_event(void *ctx, system_event_t *event); - -#ifdef __cplusplus -} -#endif - -#endif /* ESP_MDNS_H_ */ diff --git a/tools/sdk/include/mdns/mdns_console.h b/tools/sdk/include/mdns/mdns_console.h deleted file mode 100644 index 5c8b0b5a49e..00000000000 --- a/tools/sdk/include/mdns/mdns_console.h +++ /dev/null @@ -1,22 +0,0 @@ -// 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. -#ifndef _MDNS_CONSOLE_H_ -#define _MDNS_CONSOLE_H_ - -/** - * @brief Register MDNS functions with the console component - */ -void mdns_console_register(); - -#endif /* _MDNS_CONSOLE_H_ */ diff --git a/tools/sdk/include/micro-ecc/types.h b/tools/sdk/include/micro-ecc/types.h deleted file mode 100644 index 9ee81438fac..00000000000 --- a/tools/sdk/include/micro-ecc/types.h +++ /dev/null @@ -1,108 +0,0 @@ -/* Copyright 2015, Kenneth MacKay. Licensed under the BSD 2-clause license. */ - -#ifndef _UECC_TYPES_H_ -#define _UECC_TYPES_H_ - -#ifndef uECC_PLATFORM - #if __AVR__ - #define uECC_PLATFORM uECC_avr - #elif defined(__thumb2__) || defined(_M_ARMT) /* I think MSVC only supports Thumb-2 targets */ - #define uECC_PLATFORM uECC_arm_thumb2 - #elif defined(__thumb__) - #define uECC_PLATFORM uECC_arm_thumb - #elif defined(__arm__) || defined(_M_ARM) - #define uECC_PLATFORM uECC_arm - #elif defined(__aarch64__) - #define uECC_PLATFORM uECC_arm64 - #elif defined(__i386__) || defined(_M_IX86) || defined(_X86_) || defined(__I86__) - #define uECC_PLATFORM uECC_x86 - #elif defined(__amd64__) || defined(_M_X64) - #define uECC_PLATFORM uECC_x86_64 - #else - #define uECC_PLATFORM uECC_arch_other - #endif -#endif - -#ifndef uECC_ARM_USE_UMAAL - #if (uECC_PLATFORM == uECC_arm) && (__ARM_ARCH >= 6) - #define uECC_ARM_USE_UMAAL 1 - #elif (uECC_PLATFORM == uECC_arm_thumb2) && (__ARM_ARCH >= 6) && !__ARM_ARCH_7M__ - #define uECC_ARM_USE_UMAAL 1 - #else - #define uECC_ARM_USE_UMAAL 0 - #endif -#endif - -#ifndef uECC_WORD_SIZE - #if uECC_PLATFORM == uECC_avr - #define uECC_WORD_SIZE 1 - #elif (uECC_PLATFORM == uECC_x86_64 || uECC_PLATFORM == uECC_arm64) - #define uECC_WORD_SIZE 8 - #else - #define uECC_WORD_SIZE 4 - #endif -#endif - -#if (uECC_WORD_SIZE != 1) && (uECC_WORD_SIZE != 4) && (uECC_WORD_SIZE != 8) - #error "Unsupported value for uECC_WORD_SIZE" -#endif - -#if ((uECC_PLATFORM == uECC_avr) && (uECC_WORD_SIZE != 1)) - #pragma message ("uECC_WORD_SIZE must be 1 for AVR") - #undef uECC_WORD_SIZE - #define uECC_WORD_SIZE 1 -#endif - -#if ((uECC_PLATFORM == uECC_arm || uECC_PLATFORM == uECC_arm_thumb || \ - uECC_PLATFORM == uECC_arm_thumb2) && \ - (uECC_WORD_SIZE != 4)) - #pragma message ("uECC_WORD_SIZE must be 4 for ARM") - #undef uECC_WORD_SIZE - #define uECC_WORD_SIZE 4 -#endif - -#if defined(__SIZEOF_INT128__) || ((__clang_major__ * 100 + __clang_minor__) >= 302) - #define SUPPORTS_INT128 1 -#else - #define SUPPORTS_INT128 0 -#endif - -typedef int8_t wordcount_t; -typedef int16_t bitcount_t; -typedef int8_t cmpresult_t; - -#if (uECC_WORD_SIZE == 1) - -typedef uint8_t uECC_word_t; -typedef uint16_t uECC_dword_t; - -#define HIGH_BIT_SET 0x80 -#define uECC_WORD_BITS 8 -#define uECC_WORD_BITS_SHIFT 3 -#define uECC_WORD_BITS_MASK 0x07 - -#elif (uECC_WORD_SIZE == 4) - -typedef uint32_t uECC_word_t; -typedef uint64_t uECC_dword_t; - -#define HIGH_BIT_SET 0x80000000 -#define uECC_WORD_BITS 32 -#define uECC_WORD_BITS_SHIFT 5 -#define uECC_WORD_BITS_MASK 0x01F - -#elif (uECC_WORD_SIZE == 8) - -typedef uint64_t uECC_word_t; -#if SUPPORTS_INT128 -typedef unsigned __int128 uECC_dword_t; -#endif - -#define HIGH_BIT_SET 0x8000000000000000ull -#define uECC_WORD_BITS 64 -#define uECC_WORD_BITS_SHIFT 6 -#define uECC_WORD_BITS_MASK 0x03F - -#endif /* uECC_WORD_SIZE */ - -#endif /* _UECC_TYPES_H_ */ diff --git a/tools/sdk/include/micro-ecc/uECC.h b/tools/sdk/include/micro-ecc/uECC.h deleted file mode 100644 index 43a19d63cb2..00000000000 --- a/tools/sdk/include/micro-ecc/uECC.h +++ /dev/null @@ -1,365 +0,0 @@ -/* Copyright 2014, Kenneth MacKay. Licensed under the BSD 2-clause license. */ - -#ifndef _UECC_H_ -#define _UECC_H_ - -#include - -/* Platform selection options. -If uECC_PLATFORM is not defined, the code will try to guess it based on compiler macros. -Possible values for uECC_PLATFORM are defined below: */ -#define uECC_arch_other 0 -#define uECC_x86 1 -#define uECC_x86_64 2 -#define uECC_arm 3 -#define uECC_arm_thumb 4 -#define uECC_arm_thumb2 5 -#define uECC_arm64 6 -#define uECC_avr 7 - -/* If desired, you can define uECC_WORD_SIZE as appropriate for your platform (1, 4, or 8 bytes). -If uECC_WORD_SIZE is not explicitly defined then it will be automatically set based on your -platform. */ - -/* Optimization level; trade speed for code size. - Larger values produce code that is faster but larger. - Currently supported values are 0 - 4; 0 is unusably slow for most applications. - Optimization level 4 currently only has an effect ARM platforms where more than one - curve is enabled. */ -#ifndef uECC_OPTIMIZATION_LEVEL - #define uECC_OPTIMIZATION_LEVEL 2 -#endif - -/* uECC_SQUARE_FUNC - If enabled (defined as nonzero), this will cause a specific function to be -used for (scalar) squaring instead of the generic multiplication function. This can make things -faster somewhat faster, but increases the code size. */ -#ifndef uECC_SQUARE_FUNC - #define uECC_SQUARE_FUNC 0 -#endif - -/* uECC_VLI_NATIVE_LITTLE_ENDIAN - If enabled (defined as nonzero), this will switch to native -little-endian format for *all* arrays passed in and out of the public API. This includes public -and private keys, shared secrets, signatures and message hashes. -Using this switch reduces the amount of call stack memory used by uECC, since less intermediate -translations are required. -Note that this will *only* work on native little-endian processors and it will treat the uint8_t -arrays passed into the public API as word arrays, therefore requiring the provided byte arrays -to be word aligned on architectures that do not support unaligned accesses. -IMPORTANT: Keys and signatures generated with uECC_VLI_NATIVE_LITTLE_ENDIAN=1 are incompatible -with keys and signatures generated with uECC_VLI_NATIVE_LITTLE_ENDIAN=0; all parties must use -the same endianness. */ -#ifndef uECC_VLI_NATIVE_LITTLE_ENDIAN - #define uECC_VLI_NATIVE_LITTLE_ENDIAN 0 -#endif - -/* Curve support selection. Set to 0 to remove that curve. */ -#ifndef uECC_SUPPORTS_secp160r1 - #define uECC_SUPPORTS_secp160r1 1 -#endif -#ifndef uECC_SUPPORTS_secp192r1 - #define uECC_SUPPORTS_secp192r1 1 -#endif -#ifndef uECC_SUPPORTS_secp224r1 - #define uECC_SUPPORTS_secp224r1 1 -#endif -#ifndef uECC_SUPPORTS_secp256r1 - #define uECC_SUPPORTS_secp256r1 1 -#endif -#ifndef uECC_SUPPORTS_secp256k1 - #define uECC_SUPPORTS_secp256k1 1 -#endif - -/* Specifies whether compressed point format is supported. - Set to 0 to disable point compression/decompression functions. */ -#ifndef uECC_SUPPORT_COMPRESSED_POINT - #define uECC_SUPPORT_COMPRESSED_POINT 1 -#endif - -struct uECC_Curve_t; -typedef const struct uECC_Curve_t * uECC_Curve; - -#ifdef __cplusplus -extern "C" -{ -#endif - -#if uECC_SUPPORTS_secp160r1 -uECC_Curve uECC_secp160r1(void); -#endif -#if uECC_SUPPORTS_secp192r1 -uECC_Curve uECC_secp192r1(void); -#endif -#if uECC_SUPPORTS_secp224r1 -uECC_Curve uECC_secp224r1(void); -#endif -#if uECC_SUPPORTS_secp256r1 -uECC_Curve uECC_secp256r1(void); -#endif -#if uECC_SUPPORTS_secp256k1 -uECC_Curve uECC_secp256k1(void); -#endif - -/* uECC_RNG_Function type -The RNG function should fill 'size' random bytes into 'dest'. It should return 1 if -'dest' was filled with random data, or 0 if the random data could not be generated. -The filled-in values should be either truly random, or from a cryptographically-secure PRNG. - -A correctly functioning RNG function must be set (using uECC_set_rng()) before calling -uECC_make_key() or uECC_sign(). - -Setting a correctly functioning RNG function improves the resistance to side-channel attacks -for uECC_shared_secret() and uECC_sign_deterministic(). - -A correct RNG function is set by default when building for Windows, Linux, or OS X. -If you are building on another POSIX-compliant system that supports /dev/random or /dev/urandom, -you can define uECC_POSIX to use the predefined RNG. For embedded platforms there is no predefined -RNG function; you must provide your own. -*/ -typedef int (*uECC_RNG_Function)(uint8_t *dest, unsigned size); - -/* uECC_set_rng() function. -Set the function that will be used to generate random bytes. The RNG function should -return 1 if the random data was generated, or 0 if the random data could not be generated. - -On platforms where there is no predefined RNG function (eg embedded platforms), this must -be called before uECC_make_key() or uECC_sign() are used. - -Inputs: - rng_function - The function that will be used to generate random bytes. -*/ -void uECC_set_rng(uECC_RNG_Function rng_function); - -/* uECC_get_rng() function. - -Returns the function that will be used to generate random bytes. -*/ -uECC_RNG_Function uECC_get_rng(void); - -/* uECC_curve_private_key_size() function. - -Returns the size of a private key for the curve in bytes. -*/ -int uECC_curve_private_key_size(uECC_Curve curve); - -/* uECC_curve_public_key_size() function. - -Returns the size of a public key for the curve in bytes. -*/ -int uECC_curve_public_key_size(uECC_Curve curve); - -/* uECC_make_key() function. -Create a public/private key pair. - -Outputs: - public_key - Will be filled in with the public key. Must be at least 2 * the curve size - (in bytes) long. For example, if the curve is secp256r1, public_key must be 64 - bytes long. - private_key - Will be filled in with the private key. Must be as long as the curve order; this - is typically the same as the curve size, except for secp160r1. For example, if the - curve is secp256r1, private_key must be 32 bytes long. - - For secp160r1, private_key must be 21 bytes long! Note that the first byte will - almost always be 0 (there is about a 1 in 2^80 chance of it being non-zero). - -Returns 1 if the key pair was generated successfully, 0 if an error occurred. -*/ -int uECC_make_key(uint8_t *public_key, uint8_t *private_key, uECC_Curve curve); - -/* uECC_shared_secret() function. -Compute a shared secret given your secret key and someone else's public key. -Note: It is recommended that you hash the result of uECC_shared_secret() before using it for -symmetric encryption or HMAC. - -Inputs: - public_key - The public key of the remote party. - private_key - Your private key. - -Outputs: - secret - Will be filled in with the shared secret value. Must be the same size as the - curve size; for example, if the curve is secp256r1, secret must be 32 bytes long. - -Returns 1 if the shared secret was generated successfully, 0 if an error occurred. -*/ -int uECC_shared_secret(const uint8_t *public_key, - const uint8_t *private_key, - uint8_t *secret, - uECC_Curve curve); - -#if uECC_SUPPORT_COMPRESSED_POINT -/* uECC_compress() function. -Compress a public key. - -Inputs: - public_key - The public key to compress. - -Outputs: - compressed - Will be filled in with the compressed public key. Must be at least - (curve size + 1) bytes long; for example, if the curve is secp256r1, - compressed must be 33 bytes long. -*/ -void uECC_compress(const uint8_t *public_key, uint8_t *compressed, uECC_Curve curve); - -/* uECC_decompress() function. -Decompress a compressed public key. - -Inputs: - compressed - The compressed public key. - -Outputs: - public_key - Will be filled in with the decompressed public key. -*/ -void uECC_decompress(const uint8_t *compressed, uint8_t *public_key, uECC_Curve curve); -#endif /* uECC_SUPPORT_COMPRESSED_POINT */ - -/* uECC_valid_public_key() function. -Check to see if a public key is valid. - -Note that you are not required to check for a valid public key before using any other uECC -functions. However, you may wish to avoid spending CPU time computing a shared secret or -verifying a signature using an invalid public key. - -Inputs: - public_key - The public key to check. - -Returns 1 if the public key is valid, 0 if it is invalid. -*/ -int uECC_valid_public_key(const uint8_t *public_key, uECC_Curve curve); - -/* uECC_compute_public_key() function. -Compute the corresponding public key for a private key. - -Inputs: - private_key - The private key to compute the public key for - -Outputs: - public_key - Will be filled in with the corresponding public key - -Returns 1 if the key was computed successfully, 0 if an error occurred. -*/ -int uECC_compute_public_key(const uint8_t *private_key, uint8_t *public_key, uECC_Curve curve); - -/* uECC_sign() function. -Generate an ECDSA signature for a given hash value. - -Usage: Compute a hash of the data you wish to sign (SHA-2 is recommended) and pass it in to -this function along with your private key. - -Inputs: - private_key - Your private key. - message_hash - The hash of the message to sign. - hash_size - The size of message_hash in bytes. - -Outputs: - signature - Will be filled in with the signature value. Must be at least 2 * curve size long. - For example, if the curve is secp256r1, signature must be 64 bytes long. - -Returns 1 if the signature generated successfully, 0 if an error occurred. -*/ -int uECC_sign(const uint8_t *private_key, - const uint8_t *message_hash, - unsigned hash_size, - uint8_t *signature, - uECC_Curve curve); - -/* uECC_HashContext structure. -This is used to pass in an arbitrary hash function to uECC_sign_deterministic(). -The structure will be used for multiple hash computations; each time a new hash -is computed, init_hash() will be called, followed by one or more calls to -update_hash(), and finally a call to finish_hash() to produce the resulting hash. - -The intention is that you will create a structure that includes uECC_HashContext -followed by any hash-specific data. For example: - -typedef struct SHA256_HashContext { - uECC_HashContext uECC; - SHA256_CTX ctx; -} SHA256_HashContext; - -void init_SHA256(uECC_HashContext *base) { - SHA256_HashContext *context = (SHA256_HashContext *)base; - SHA256_Init(&context->ctx); -} - -void update_SHA256(uECC_HashContext *base, - const uint8_t *message, - unsigned message_size) { - SHA256_HashContext *context = (SHA256_HashContext *)base; - SHA256_Update(&context->ctx, message, message_size); -} - -void finish_SHA256(uECC_HashContext *base, uint8_t *hash_result) { - SHA256_HashContext *context = (SHA256_HashContext *)base; - SHA256_Final(hash_result, &context->ctx); -} - -... when signing ... -{ - uint8_t tmp[32 + 32 + 64]; - SHA256_HashContext ctx = {{&init_SHA256, &update_SHA256, &finish_SHA256, 64, 32, tmp}}; - uECC_sign_deterministic(key, message_hash, &ctx.uECC, signature); -} -*/ -typedef struct uECC_HashContext { - void (*init_hash)(const struct uECC_HashContext *context); - void (*update_hash)(const struct uECC_HashContext *context, - const uint8_t *message, - unsigned message_size); - void (*finish_hash)(const struct uECC_HashContext *context, uint8_t *hash_result); - unsigned block_size; /* Hash function block size in bytes, eg 64 for SHA-256. */ - unsigned result_size; /* Hash function result size in bytes, eg 32 for SHA-256. */ - uint8_t *tmp; /* Must point to a buffer of at least (2 * result_size + block_size) bytes. */ -} uECC_HashContext; - -/* uECC_sign_deterministic() function. -Generate an ECDSA signature for a given hash value, using a deterministic algorithm -(see RFC 6979). You do not need to set the RNG using uECC_set_rng() before calling -this function; however, if the RNG is defined it will improve resistance to side-channel -attacks. - -Usage: Compute a hash of the data you wish to sign (SHA-2 is recommended) and pass it to -this function along with your private key and a hash context. Note that the message_hash -does not need to be computed with the same hash function used by hash_context. - -Inputs: - private_key - Your private key. - message_hash - The hash of the message to sign. - hash_size - The size of message_hash in bytes. - hash_context - A hash context to use. - -Outputs: - signature - Will be filled in with the signature value. - -Returns 1 if the signature generated successfully, 0 if an error occurred. -*/ -int uECC_sign_deterministic(const uint8_t *private_key, - const uint8_t *message_hash, - unsigned hash_size, - const uECC_HashContext *hash_context, - uint8_t *signature, - uECC_Curve curve); - -/* uECC_verify() function. -Verify an ECDSA signature. - -Usage: Compute the hash of the signed data using the same hash as the signer and -pass it to this function along with the signer's public key and the signature values (r and s). - -Inputs: - public_key - The signer's public key. - message_hash - The hash of the signed data. - hash_size - The size of message_hash in bytes. - signature - The signature value. - -Returns 1 if the signature is valid, 0 if it is invalid. -*/ -int uECC_verify(const uint8_t *public_key, - const uint8_t *message_hash, - unsigned hash_size, - const uint8_t *signature, - uECC_Curve curve); - -#ifdef __cplusplus -} /* end of extern "C" */ -#endif - -#endif /* _UECC_H_ */ diff --git a/tools/sdk/include/micro-ecc/uECC_vli.h b/tools/sdk/include/micro-ecc/uECC_vli.h deleted file mode 100644 index 864cc333569..00000000000 --- a/tools/sdk/include/micro-ecc/uECC_vli.h +++ /dev/null @@ -1,172 +0,0 @@ -/* Copyright 2015, Kenneth MacKay. Licensed under the BSD 2-clause license. */ - -#ifndef _UECC_VLI_H_ -#define _UECC_VLI_H_ - -#include "uECC.h" -#include "types.h" - -/* Functions for raw large-integer manipulation. These are only available - if uECC.c is compiled with uECC_ENABLE_VLI_API defined to 1. */ -#ifndef uECC_ENABLE_VLI_API - #define uECC_ENABLE_VLI_API 0 -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif - -#if uECC_ENABLE_VLI_API - -void uECC_vli_clear(uECC_word_t *vli, wordcount_t num_words); - -/* Constant-time comparison to zero - secure way to compare long integers */ -/* Returns 1 if vli == 0, 0 otherwise. */ -uECC_word_t uECC_vli_isZero(const uECC_word_t *vli, wordcount_t num_words); - -/* Returns nonzero if bit 'bit' of vli is set. */ -uECC_word_t uECC_vli_testBit(const uECC_word_t *vli, bitcount_t bit); - -/* Counts the number of bits required to represent vli. */ -bitcount_t uECC_vli_numBits(const uECC_word_t *vli, const wordcount_t max_words); - -/* Sets dest = src. */ -void uECC_vli_set(uECC_word_t *dest, const uECC_word_t *src, wordcount_t num_words); - -/* Constant-time comparison function - secure way to compare long integers */ -/* Returns one if left == right, zero otherwise */ -uECC_word_t uECC_vli_equal(const uECC_word_t *left, - const uECC_word_t *right, - wordcount_t num_words); - -/* Constant-time comparison function - secure way to compare long integers */ -/* Returns sign of left - right, in constant time. */ -cmpresult_t uECC_vli_cmp(const uECC_word_t *left, const uECC_word_t *right, wordcount_t num_words); - -/* Computes vli = vli >> 1. */ -void uECC_vli_rshift1(uECC_word_t *vli, wordcount_t num_words); - -/* Computes result = left + right, returning carry. Can modify in place. */ -uECC_word_t uECC_vli_add(uECC_word_t *result, - const uECC_word_t *left, - const uECC_word_t *right, - wordcount_t num_words); - -/* Computes result = left - right, returning borrow. Can modify in place. */ -uECC_word_t uECC_vli_sub(uECC_word_t *result, - const uECC_word_t *left, - const uECC_word_t *right, - wordcount_t num_words); - -/* Computes result = left * right. Result must be 2 * num_words long. */ -void uECC_vli_mult(uECC_word_t *result, - const uECC_word_t *left, - const uECC_word_t *right, - wordcount_t num_words); - -/* Computes result = left^2. Result must be 2 * num_words long. */ -void uECC_vli_square(uECC_word_t *result, const uECC_word_t *left, wordcount_t num_words); - -/* Computes result = (left + right) % mod. - Assumes that left < mod and right < mod, and that result does not overlap mod. */ -void uECC_vli_modAdd(uECC_word_t *result, - const uECC_word_t *left, - const uECC_word_t *right, - const uECC_word_t *mod, - wordcount_t num_words); - -/* Computes result = (left - right) % mod. - Assumes that left < mod and right < mod, and that result does not overlap mod. */ -void uECC_vli_modSub(uECC_word_t *result, - const uECC_word_t *left, - const uECC_word_t *right, - const uECC_word_t *mod, - wordcount_t num_words); - -/* Computes result = product % mod, where product is 2N words long. - Currently only designed to work for mod == curve->p or curve_n. */ -void uECC_vli_mmod(uECC_word_t *result, - uECC_word_t *product, - const uECC_word_t *mod, - wordcount_t num_words); - -/* Calculates result = product (mod curve->p), where product is up to - 2 * curve->num_words long. */ -void uECC_vli_mmod_fast(uECC_word_t *result, uECC_word_t *product, uECC_Curve curve); - -/* Computes result = (left * right) % mod. - Currently only designed to work for mod == curve->p or curve_n. */ -void uECC_vli_modMult(uECC_word_t *result, - const uECC_word_t *left, - const uECC_word_t *right, - const uECC_word_t *mod, - wordcount_t num_words); - -/* Computes result = (left * right) % curve->p. */ -void uECC_vli_modMult_fast(uECC_word_t *result, - const uECC_word_t *left, - const uECC_word_t *right, - uECC_Curve curve); - -/* Computes result = left^2 % mod. - Currently only designed to work for mod == curve->p or curve_n. */ -void uECC_vli_modSquare(uECC_word_t *result, - const uECC_word_t *left, - const uECC_word_t *mod, - wordcount_t num_words); - -/* Computes result = left^2 % curve->p. */ -void uECC_vli_modSquare_fast(uECC_word_t *result, const uECC_word_t *left, uECC_Curve curve); - -/* Computes result = (1 / input) % mod.*/ -void uECC_vli_modInv(uECC_word_t *result, - const uECC_word_t *input, - const uECC_word_t *mod, - wordcount_t num_words); - -#if uECC_SUPPORT_COMPRESSED_POINT -/* Calculates a = sqrt(a) (mod curve->p) */ -void uECC_vli_mod_sqrt(uECC_word_t *a, uECC_Curve curve); -#endif - -/* Converts an integer in uECC native format to big-endian bytes. */ -void uECC_vli_nativeToBytes(uint8_t *bytes, int num_bytes, const uECC_word_t *native); -/* Converts big-endian bytes to an integer in uECC native format. */ -void uECC_vli_bytesToNative(uECC_word_t *native, const uint8_t *bytes, int num_bytes); - -unsigned uECC_curve_num_words(uECC_Curve curve); -unsigned uECC_curve_num_bytes(uECC_Curve curve); -unsigned uECC_curve_num_bits(uECC_Curve curve); -unsigned uECC_curve_num_n_words(uECC_Curve curve); -unsigned uECC_curve_num_n_bytes(uECC_Curve curve); -unsigned uECC_curve_num_n_bits(uECC_Curve curve); - -const uECC_word_t *uECC_curve_p(uECC_Curve curve); -const uECC_word_t *uECC_curve_n(uECC_Curve curve); -const uECC_word_t *uECC_curve_G(uECC_Curve curve); -const uECC_word_t *uECC_curve_b(uECC_Curve curve); - -int uECC_valid_point(const uECC_word_t *point, uECC_Curve curve); - -/* Multiplies a point by a scalar. Points are represented by the X coordinate followed by - the Y coordinate in the same array, both coordinates are curve->num_words long. Note - that scalar must be curve->num_n_words long (NOT curve->num_words). */ -void uECC_point_mult(uECC_word_t *result, - const uECC_word_t *point, - const uECC_word_t *scalar, - uECC_Curve curve); - -/* Generates a random integer in the range 0 < random < top. - Both random and top have num_words words. */ -int uECC_generate_random_int(uECC_word_t *random, - const uECC_word_t *top, - wordcount_t num_words); - -#endif /* uECC_ENABLE_VLI_API */ - -#ifdef __cplusplus -} /* end of extern "C" */ -#endif - -#endif /* _UECC_VLI_H_ */ diff --git a/tools/sdk/include/mqtt/mqtt_client.h b/tools/sdk/include/mqtt/mqtt_client.h deleted file mode 100644 index cb061328406..00000000000 --- a/tools/sdk/include/mqtt/mqtt_client.h +++ /dev/null @@ -1,244 +0,0 @@ -/* - * This file is subject to the terms and conditions defined in - * file 'LICENSE', which is part of this source code package. - * Tuan PM - */ - -#ifndef _MQTT_CLIENT_H_ -#define _MQTT_CLIENT_H_ - -#include -#include -#include -#include "esp_err.h" - -#include "mqtt_config.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct esp_mqtt_client *esp_mqtt_client_handle_t; - -/** - * @brief MQTT event types. - * - * User event handler receives context data in `esp_mqtt_event_t` structure with - * - `user_context` - user data from `esp_mqtt_client_config_t` - * - `client` - mqtt client handle - * - various other data depending on event type - * - */ -typedef enum { - MQTT_EVENT_ERROR = 0, - MQTT_EVENT_CONNECTED, /*!< connected event, additional context: session_present flag */ - MQTT_EVENT_DISCONNECTED, /*!< disconnected event */ - MQTT_EVENT_SUBSCRIBED, /*!< subscribed event, additional context: msg_id */ - MQTT_EVENT_UNSUBSCRIBED, /*!< unsubscribed event */ - MQTT_EVENT_PUBLISHED, /*!< published event, additional context: msg_id */ - MQTT_EVENT_DATA, /*!< data event, additional context: - - msg_id message id - - topic pointer to the received topic - - topic_len length of the topic - - data pointer to the received data - - data_len length of the data for this event - - current_data_offset offset of the current data for this event - - total_data_len total length of the data received - Note: Multiple MQTT_EVENT_DATA could be fired for one message, if it is - longer than internal buffer. In that case only first event contains topic - pointer and length, other contain data only with current data length - and current data offset updating. - */ - MQTT_EVENT_BEFORE_CONNECT, /*!< The event occurs before connecting */ -} esp_mqtt_event_id_t; - -typedef enum { - MQTT_TRANSPORT_UNKNOWN = 0x0, - MQTT_TRANSPORT_OVER_TCP, /*!< MQTT over TCP, using scheme: ``mqtt`` */ - MQTT_TRANSPORT_OVER_SSL, /*!< MQTT over SSL, using scheme: ``mqtts`` */ - MQTT_TRANSPORT_OVER_WS, /*!< MQTT over Websocket, using scheme:: ``ws`` */ - MQTT_TRANSPORT_OVER_WSS /*!< MQTT over Websocket Secure, using scheme: ``wss`` */ -} esp_mqtt_transport_t; - -/** - * MQTT event configuration structure - */ -typedef struct { - esp_mqtt_event_id_t event_id; /*!< MQTT event type */ - esp_mqtt_client_handle_t client; /*!< MQTT client handle for this event */ - void *user_context; /*!< User context passed from MQTT client config */ - char *data; /*!< Data asociated with this event */ - int data_len; /*!< Lenght of the data for this event */ - int total_data_len; /*!< Total length of the data (longer data are supplied with multiple events) */ - int current_data_offset; /*!< Actual offset for the data asociated with this event */ - char *topic; /*!< Topic asociated with this event */ - int topic_len; /*!< Length of the topic for this event asociated with this event */ - int msg_id; /*!< MQTT messaged id of message */ - int session_present; /*!< MQTT session_present flag for connection event */ -} esp_mqtt_event_t; - -typedef esp_mqtt_event_t *esp_mqtt_event_handle_t; - -typedef esp_err_t (* mqtt_event_callback_t)(esp_mqtt_event_handle_t event); - -/** - * MQTT client configuration structure - */ -typedef struct { - mqtt_event_callback_t event_handle; /*!< handle for MQTT events */ - const char *host; /*!< MQTT server domain (ipv4 as string) */ - const char *uri; /*!< Complete MQTT broker URI */ - uint32_t port; /*!< MQTT server port */ - const char *client_id; /*!< default client id is ``ESP32_%CHIPID%`` where %CHIPID% are last 3 bytes of MAC address in hex format */ - const char *username; /*!< MQTT username */ - const char *password; /*!< MQTT password */ - const char *lwt_topic; /*!< LWT (Last Will and Testament) message topic (NULL by default) */ - const char *lwt_msg; /*!< LWT message (NULL by default) */ - int lwt_qos; /*!< LWT message qos */ - int lwt_retain; /*!< LWT retained message flag */ - int lwt_msg_len; /*!< LWT message length */ - int disable_clean_session; /*!< mqtt clean session, default clean_session is true */ - int keepalive; /*!< mqtt keepalive, default is 120 seconds */ - bool disable_auto_reconnect; /*!< this mqtt client will reconnect to server (when errors/disconnect). Set disable_auto_reconnect=true to disable */ - void *user_context; /*!< pass user context to this option, then can receive that context in ``event->user_context`` */ - int task_prio; /*!< MQTT task priority, default is 5, can be changed in ``make menuconfig`` */ - int task_stack; /*!< MQTT task stack size, default is 6144 bytes, can be changed in ``make menuconfig`` */ - int buffer_size; /*!< size of MQTT send/receive buffer, default is 1024 */ - const char *cert_pem; /*!< Pointer to certificate data in PEM format for server verify (with SSL), default is NULL, not required to verify the server */ - const char *client_cert_pem; /*!< Pointer to certificate data in PEM format for SSL mutual authentication, default is NULL, not required if mutual authentication is not needed. If it is not NULL, also `client_key_pem` has to be provided. */ - const char *client_key_pem; /*!< Pointer to private key data in PEM format for SSL mutual authentication, default is NULL, not required if mutual authentication is not needed. If it is not NULL, also `client_cert_pem` has to be provided. */ - esp_mqtt_transport_t transport; /*!< overrides URI transport */ - int refresh_connection_after_ms; /*!< Refresh connection after this value (in milliseconds) */ -} esp_mqtt_client_config_t; - -/** - * @brief Creates mqtt client handle based on the configuration - * - * @param config mqtt configuration structure - * - * @return mqtt_client_handle if successfully created, NULL on error - */ -esp_mqtt_client_handle_t esp_mqtt_client_init(const esp_mqtt_client_config_t *config); - -/** - * @brief Sets mqtt connection URI. This API is usually used to overrides the URI - * configured in esp_mqtt_client_init - * - * @param client mqtt client hanlde - * @param uri - * - * @return ESP_FAIL if URI parse error, ESP_OK on success - */ -esp_err_t esp_mqtt_client_set_uri(esp_mqtt_client_handle_t client, const char *uri); - -/** - * @brief Starts mqtt client with already created client handle - * - * @param client mqtt client handle - * - * @return ESP_OK on success - * ESP_ERR_INVALID_ARG on wrong initialization - * ESP_FAIL on other error - */ -esp_err_t esp_mqtt_client_start(esp_mqtt_client_handle_t client); - -/** - * @brief This api is typically used to force reconnection upon a specific event - * - * @param client mqtt client handle - * - * @return ESP_OK on success - * ESP_FAIL if client is in invalid state - */ -esp_err_t esp_mqtt_client_reconnect(esp_mqtt_client_handle_t client); - -/** - * @brief Stops mqtt client tasks - * - * @param client mqtt client handle - * - * @return ESP_OK on success - * ESP_FAIL if client is in invalid state - */ -esp_err_t esp_mqtt_client_stop(esp_mqtt_client_handle_t client); - -/** - * @brief Subscribe the client to defined topic with defined qos - * - * Notes: - * - Client must be connected to send subscribe message - * - This API is could be executed from a user task or - * from a mqtt event callback i.e. internal mqtt task - * (API is protected by internal mutex, so it might block - * if a longer data receive operation is in progress. - * - * @param client mqtt client handle - * @param topic - * @param qos - * - * @return message_id of the subscribe message on success - * -1 on failure - */ -int esp_mqtt_client_subscribe(esp_mqtt_client_handle_t client, const char *topic, int qos); - -/** - * @brief Unsubscribe the client from defined topic - * - * Notes: - * - Client must be connected to send unsubscribe message - * - It is thread safe, please refer to `esp_mqtt_client_subscribe` for details - * - * @param client mqtt client handle - * @param topic - * - * @return message_id of the subscribe message on success - * -1 on failure - */ -int esp_mqtt_client_unsubscribe(esp_mqtt_client_handle_t client, const char *topic); - -/** - * @brief Client to send a publish message to the broker - * - * Notes: - * - Client doesn't have to be connected to send publish message - * (although it would drop all qos=0 messages, qos>1 messages would be enqueued) - * - It is thread safe, please refer to `esp_mqtt_client_subscribe` for details - * - * @param client mqtt client handle - * @param topic topic string - * @param data payload string (set to NULL, sending empty payload message) - * @param len data length, if set to 0, length is calculated from payload string - * @param qos qos of publish message - * @param retain ratain flag - * - * @return message_id of the subscribe message on success - * 0 if cannot publish - */ -int esp_mqtt_client_publish(esp_mqtt_client_handle_t client, const char *topic, const char *data, int len, int qos, int retain); - -/** - * @brief Destroys the client handle - * - * @param client mqtt client handle - * - * @return ESP_OK - */ -esp_err_t esp_mqtt_client_destroy(esp_mqtt_client_handle_t client); - -/** - * @brief Set configuration structure, typically used when updating the config (i.e. on "before_connect" event - * - * @param client mqtt client handle - * - * @param config mqtt configuration structure - * - * @return ESP_ERR_NO_MEM if failed to allocate - * ESP_OK on success - */ -esp_err_t esp_mqtt_set_config(esp_mqtt_client_handle_t client, const esp_mqtt_client_config_t *config); - -#ifdef __cplusplus -} -#endif //__cplusplus - -#endif diff --git a/tools/sdk/include/mqtt/mqtt_config.h b/tools/sdk/include/mqtt/mqtt_config.h deleted file mode 100644 index 033fc0a732a..00000000000 --- a/tools/sdk/include/mqtt/mqtt_config.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * This file is subject to the terms and conditions defined in - * file 'LICENSE', which is part of this source code package. - * Tuan PM - */ -#ifndef _MQTT_CONFIG_H_ -#define _MQTT_CONFIG_H_ - -#include "sdkconfig.h" - -#define MQTT_PROTOCOL_311 CONFIG_MQTT_PROTOCOL_311 -#define MQTT_RECONNECT_TIMEOUT_MS (10*1000) -#define MQTT_POLL_READ_TIMEOUT_MS (1000) - -#if CONFIG_MQTT_BUFFER_SIZE -#define MQTT_BUFFER_SIZE_BYTE CONFIG_MQTT_BUFFER_SIZE -#else -#define MQTT_BUFFER_SIZE_BYTE 1024 -#endif - -#define MQTT_MAX_HOST_LEN 64 -#define MQTT_MAX_CLIENT_LEN 32 -#define MQTT_MAX_USERNAME_LEN 32 -#define MQTT_MAX_PASSWORD_LEN 65 -#define MQTT_MAX_LWT_TOPIC 32 -#define MQTT_MAX_LWT_MSG 128 -#define MQTT_TASK_PRIORITY 5 - -#if CONFIG_MQTT_TASK_STACK_SIZE -#define MQTT_TASK_STACK CONFIG_MQTT_TASK_STACK_SIZE -#else -#define MQTT_TASK_STACK (6*1024) -#endif - -#define MQTT_KEEPALIVE_TICK (120) -#define MQTT_CMD_QUEUE_SIZE (10) -#define MQTT_NETWORK_TIMEOUT_MS (10000) - -#ifdef CONFIG_MQTT_TCP_DEFAULT_PORT -#define MQTT_TCP_DEFAULT_PORT CONFIG_MQTT_TCP_DEFAULT_PORT -#else -#define MQTT_TCP_DEFAULT_PORT 1883 -#endif - -#ifdef CONFIG_MQTT_SSL_DEFAULT_PORT -#define MQTT_SSL_DEFAULT_PORT CONFIG_MQTT_SSL_DEFAULT_PORT -#else -#define MQTT_SSL_DEFAULT_PORT 8883 -#endif - -#ifdef CONFIG_MQTT_WS_DEFAULT_PORT -#define MQTT_WS_DEFAULT_PORT CONFIG_MQTT_WS_DEFAULT_PORT -#else -#define MQTT_WS_DEFAULT_PORT 80 -#endif - -#ifdef MQTT_WSS_DEFAULT_PORT -#define MQTT_WSS_DEFAULT_PORT CONFIG_MQTT_WSS_DEFAULT_PORT -#else -#define MQTT_WSS_DEFAULT_PORT 443 -#endif - -#define MQTT_CORE_SELECTION_ENABLED CONFIG_MQTT_TASK_CORE_SELECTION_ENABLED - -#ifdef CONFIG_MQTT_DISABLE_API_LOCKS -#define MQTT_DISABLE_API_LOCKS CONFIG_MQTT_DISABLE_API_LOCKS -#endif - -#ifdef CONFIG_MQTT_USE_CORE_0 -#define MQTT_TASK_CORE 0 -#else -#ifdef CONFIG_MQTT_USE_CORE_1 -#define MQTT_TASK_CORE 1 -#else -#define MQTT_TASK_CORE 0 -#endif -#endif - - -#define MQTT_ENABLE_SSL CONFIG_MQTT_TRANSPORT_SSL -#define MQTT_ENABLE_WS CONFIG_MQTT_TRANSPORT_WEBSOCKET -#define MQTT_ENABLE_WSS CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE - -#define OUTBOX_EXPIRED_TIMEOUT_MS (30*1000) -#define OUTBOX_MAX_SIZE (4*1024) -#endif diff --git a/tools/sdk/include/newlib/_ansi.h b/tools/sdk/include/newlib/_ansi.h deleted file mode 100644 index 5fb99070096..00000000000 --- a/tools/sdk/include/newlib/_ansi.h +++ /dev/null @@ -1,140 +0,0 @@ -/* Provide support for both ANSI and non-ANSI environments. */ - -/* Some ANSI environments are "broken" in the sense that __STDC__ cannot be - relied upon to have it's intended meaning. Therefore we must use our own - concoction: _HAVE_STDC. Always use _HAVE_STDC instead of __STDC__ in newlib - sources! - - To get a strict ANSI C environment, define macro __STRICT_ANSI__. This will - "comment out" the non-ANSI parts of the ANSI header files (non-ANSI header - files aren't affected). */ - -#ifndef _ANSIDECL_H_ -#define _ANSIDECL_H_ - -#include -#include - -/* First try to figure out whether we really are in an ANSI C environment. */ -/* FIXME: This probably needs some work. Perhaps sys/config.h can be - prevailed upon to give us a clue. */ - -#ifdef __STDC__ -#define _HAVE_STDC -#endif - -/* ISO C++. */ - -#ifdef __cplusplus -#if !(defined(_BEGIN_STD_C) && defined(_END_STD_C)) -#ifdef _HAVE_STD_CXX -#define _BEGIN_STD_C namespace std { extern "C" { -#define _END_STD_C } } -#else -#define _BEGIN_STD_C extern "C" { -#define _END_STD_C } -#endif -#if __GNUC_PREREQ (3, 3) -#define _NOTHROW __attribute__ ((__nothrow__)) -#else -#define _NOTHROW throw() -#endif -#endif -#else -#define _BEGIN_STD_C -#define _END_STD_C -#define _NOTHROW -#endif - -#ifdef _HAVE_STDC -#define _PTR void * -#define _AND , -#define _NOARGS void -#define _CONST const -#define _VOLATILE volatile -#define _SIGNED signed -#define _DOTS , ... -#define _VOID void -#ifdef __CYGWIN__ -#define _EXFUN_NOTHROW(name, proto) __cdecl name proto _NOTHROW -#define _EXFUN(name, proto) __cdecl name proto -#define _EXPARM(name, proto) (* __cdecl name) proto -#define _EXFNPTR(name, proto) (__cdecl * name) proto -#else -#define _EXFUN_NOTHROW(name, proto) name proto _NOTHROW -#define _EXFUN(name, proto) name proto -#define _EXPARM(name, proto) (* name) proto -#define _EXFNPTR(name, proto) (* name) proto -#endif -#define _DEFUN(name, arglist, args) name(args) -#define _DEFUN_VOID(name) name(_NOARGS) -#define _CAST_VOID (void) -#ifndef _LONG_DOUBLE -#define _LONG_DOUBLE long double -#endif -#ifndef _PARAMS -#define _PARAMS(paramlist) paramlist -#endif -#else -#define _PTR char * -#define _AND ; -#define _NOARGS -#define _CONST -#define _VOLATILE -#define _SIGNED -#define _DOTS -#define _VOID void -#define _EXFUN(name, proto) name() -#define _EXFUN_NOTHROW(name, proto) name() -#define _DEFUN(name, arglist, args) name arglist args; -#define _DEFUN_VOID(name) name() -#define _CAST_VOID -#define _LONG_DOUBLE double -#ifndef _PARAMS -#define _PARAMS(paramlist) () -#endif -#endif - -/* Support gcc's __attribute__ facility. */ - -#ifdef __GNUC__ -#define _ATTRIBUTE(attrs) __attribute__ (attrs) -#else -#define _ATTRIBUTE(attrs) -#endif - -/* The traditional meaning of 'extern inline' for GCC is not - to emit the function body unless the address is explicitly - taken. However this behaviour is changing to match the C99 - standard, which uses 'extern inline' to indicate that the - function body *must* be emitted. Likewise, a function declared - without either 'extern' or 'static' defaults to extern linkage - (C99 6.2.2p5), and the compiler may choose whether to use the - inline version or call the extern linkage version (6.7.4p6). - If we are using GCC, but do not have the new behaviour, we need - to use extern inline; if we are using a new GCC with the - C99-compatible behaviour, or a non-GCC compiler (which we will - have to hope is C99, since there is no other way to achieve the - effect of omitting the function if it isn't referenced) we use - 'static inline', which c99 defines to mean more-or-less the same - as the Gnu C 'extern inline'. */ -#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__) -/* We're using GCC, but without the new C99-compatible behaviour. */ -#define _ELIDABLE_INLINE extern __inline__ _ATTRIBUTE ((__always_inline__)) -#else -/* We're using GCC in C99 mode, or an unknown compiler which - we just have to hope obeys the C99 semantics of inline. */ -#define _ELIDABLE_INLINE static __inline__ -#endif - -#if __GNUC_PREREQ (3, 1) -#define _NOINLINE __attribute__ ((__noinline__)) -#define _NOINLINE_STATIC _NOINLINE static -#else -/* On non-GNU compilers and GCC prior to version 3.1 the compiler can't be - trusted not to inline if it is static. */ -#define _NOINLINE -#define _NOINLINE_STATIC -#endif - -#endif /* _ANSIDECL_H_ */ diff --git a/tools/sdk/include/newlib/_syslist.h b/tools/sdk/include/newlib/_syslist.h deleted file mode 100644 index 271644efa93..00000000000 --- a/tools/sdk/include/newlib/_syslist.h +++ /dev/null @@ -1,40 +0,0 @@ -/* internal use only -- mapping of "system calls" for libraries that lose - and only provide C names, so that we end up in violation of ANSI */ -#ifndef __SYSLIST_H -#define __SYSLIST_H - -#ifdef MISSING_SYSCALL_NAMES -#define _close close -#define _execve execve -#define _fcntl fcntl -#define _fork fork -#define _fstat fstat -#define _getpid getpid -#define _gettimeofday gettimeofday -#define _isatty isatty -#define _kill kill -#define _link link -#define _lseek lseek -#define _mkdir mkdir -#define _open open -#define _read read -#define _sbrk sbrk -#define _stat stat -#define _times times -#define _unlink unlink -#define _wait wait -#define _write write -#endif /* MISSING_SYSCALL_NAMES */ - -#if defined MISSING_SYSCALL_NAMES || !defined HAVE_OPENDIR -/* If the system call interface is missing opendir, readdir, and - closedir, there is an implementation of these functions in - libc/posix that is implemented using open, getdents, and close. - Note, these functions are currently not in the libc/syscalls - directory. */ -#define _opendir opendir -#define _readdir readdir -#define _closedir closedir -#endif /* MISSING_SYSCALL_NAMES || !HAVE_OPENDIR */ - -#endif /* !__SYSLIST_H_ */ diff --git a/tools/sdk/include/newlib/alloca.h b/tools/sdk/include/newlib/alloca.h deleted file mode 100644 index 2ea0fd9b37a..00000000000 --- a/tools/sdk/include/newlib/alloca.h +++ /dev/null @@ -1,21 +0,0 @@ -/* libc/include/alloca.h - Allocate memory on stack */ - -/* Written 2000 by Werner Almesberger */ -/* Rearranged for general inclusion by stdlib.h. - 2001, Corinna Vinschen */ - -#ifndef _NEWLIB_ALLOCA_H -#define _NEWLIB_ALLOCA_H - -#include "_ansi.h" -#include - -#undef alloca - -#ifdef __GNUC__ -#define alloca(size) __builtin_alloca(size) -#else -void * _EXFUN(alloca,(size_t)); -#endif - -#endif diff --git a/tools/sdk/include/newlib/ar.h b/tools/sdk/include/newlib/ar.h deleted file mode 100644 index ac2e4ca920d..00000000000 --- a/tools/sdk/include/newlib/ar.h +++ /dev/null @@ -1,69 +0,0 @@ -/* $NetBSD: ar.h,v 1.4 1994/10/26 00:55:43 cgd Exp $ */ - -/*- - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * (c) UNIX System Laboratories, Inc. - * All or some portions of this file are derived from material licensed - * to the University of California by American Telephone and Telegraph - * Co. or Unix System Laboratories, Inc. and are reproduced herein with - * the permission of UNIX System Laboratories, Inc. - * - * This code is derived from software contributed to Berkeley by - * Hugh Smith at The University of Guelph. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. - * - * @(#)ar.h 8.2 (Berkeley) 1/21/94 - */ - -#ifndef _AR_H_ -#define _AR_H_ - -/* Pre-4BSD archives had these magic numbers in them. */ -#define OARMAG1 0177555 -#define OARMAG2 0177545 - -#define ARMAG "!\n" /* ar "magic number" */ -#define SARMAG 8 /* strlen(ARMAG); */ - -#define AR_EFMT1 "#1/" /* extended format #1 */ - -struct ar_hdr { - char ar_name[16]; /* name */ - char ar_date[12]; /* modification time */ - char ar_uid[6]; /* user id */ - char ar_gid[6]; /* group id */ - char ar_mode[8]; /* octal file permissions */ - char ar_size[10]; /* size in bytes */ -#define ARFMAG "`\n" - char ar_fmag[2]; /* consistency check */ -}; - -#endif /* !_AR_H_ */ diff --git a/tools/sdk/include/newlib/argz.h b/tools/sdk/include/newlib/argz.h deleted file mode 100644 index 02c9adbf3f9..00000000000 --- a/tools/sdk/include/newlib/argz.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#ifndef _ARGZ_H_ -#define _ARGZ_H_ - -#include -#include - -#include "_ansi.h" - -_BEGIN_STD_C - -/* The newlib implementation of these functions assumes that sizeof(char) == 1. */ -error_t argz_create (char *const argv[], char **argz, size_t *argz_len); -error_t argz_create_sep (const char *string, int sep, char **argz, size_t *argz_len); -size_t argz_count (const char *argz, size_t argz_len); -void argz_extract (char *argz, size_t argz_len, char **argv); -void argz_stringify (char *argz, size_t argz_len, int sep); -error_t argz_add (char **argz, size_t *argz_len, const char *str); -error_t argz_add_sep (char **argz, size_t *argz_len, const char *str, int sep); -error_t argz_append (char **argz, size_t *argz_len, const char *buf, size_t buf_len); -error_t argz_delete (char **argz, size_t *argz_len, char *entry); -error_t argz_insert (char **argz, size_t *argz_len, char *before, const char *entry); -char * argz_next (char *argz, size_t argz_len, const char *entry); -error_t argz_replace (char **argz, size_t *argz_len, const char *str, const char *with, unsigned *replace_count); - -_END_STD_C - -#endif /* _ARGZ_H_ */ diff --git a/tools/sdk/include/newlib/assert.h b/tools/sdk/include/newlib/assert.h deleted file mode 100644 index df46c030b28..00000000000 --- a/tools/sdk/include/newlib/assert.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - assert.h -*/ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "_ansi.h" - -#undef assert - -#ifdef NDEBUG /* required by ANSI standard */ -# define assert(__e) ((void) sizeof(__e)) -#else -# define assert(__e) ((__e) ? (void)0 : __assert_func (__FILE__, __LINE__, \ - __ASSERT_FUNC, #__e)) - -# ifndef __ASSERT_FUNC - /* Use g++'s demangled names in C++. */ -# if defined __cplusplus && defined __GNUC__ -# define __ASSERT_FUNC __PRETTY_FUNCTION__ - - /* C99 requires the use of __func__. */ -# elif __STDC_VERSION__ >= 199901L -# define __ASSERT_FUNC __func__ - - /* Older versions of gcc don't have __func__ but can use __FUNCTION__. */ -# elif __GNUC__ >= 2 -# define __ASSERT_FUNC __FUNCTION__ - - /* failed to detect __func__ support. */ -# else -# define __ASSERT_FUNC ((char *) 0) -# endif -# endif /* !__ASSERT_FUNC */ -#endif /* !NDEBUG */ - -void _EXFUN(__assert, (const char *, int, const char *) - _ATTRIBUTE ((__noreturn__))); -void _EXFUN(__assert_func, (const char *, int, const char *, const char *) - _ATTRIBUTE ((__noreturn__))); - -#if __STDC_VERSION__ >= 201112L && !defined __cplusplus -# define static_assert _Static_assert -#endif - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/newlib/complex.h b/tools/sdk/include/newlib/complex.h deleted file mode 100644 index 969b20e5f9a..00000000000 --- a/tools/sdk/include/newlib/complex.h +++ /dev/null @@ -1,124 +0,0 @@ -/* $NetBSD: complex.h,v 1.3 2010/09/15 16:11:30 christos Exp $ */ - -/* - * Written by Matthias Drochner. - * Public domain. - */ - -#ifndef _COMPLEX_H -#define _COMPLEX_H - -#define complex _Complex -#define _Complex_I 1.0fi -#define I _Complex_I - -#include - -__BEGIN_DECLS - -/* 7.3.5 Trigonometric functions */ -/* 7.3.5.1 The cacos functions */ -double complex cacos(double complex); -float complex cacosf(float complex); - -/* 7.3.5.2 The casin functions */ -double complex casin(double complex); -float complex casinf(float complex); - -/* 7.3.5.1 The catan functions */ -double complex catan(double complex); -float complex catanf(float complex); - -/* 7.3.5.1 The ccos functions */ -double complex ccos(double complex); -float complex ccosf(float complex); - -/* 7.3.5.1 The csin functions */ -double complex csin(double complex); -float complex csinf(float complex); - -/* 7.3.5.1 The ctan functions */ -double complex ctan(double complex); -float complex ctanf(float complex); - -/* 7.3.6 Hyperbolic functions */ -/* 7.3.6.1 The cacosh functions */ -double complex cacosh(double complex); -float complex cacoshf(float complex); - -/* 7.3.6.2 The casinh functions */ -double complex casinh(double complex); -float complex casinhf(float complex); - -/* 7.3.6.3 The catanh functions */ -double complex catanh(double complex); -float complex catanhf(float complex); - -/* 7.3.6.4 The ccosh functions */ -double complex ccosh(double complex); -float complex ccoshf(float complex); - -/* 7.3.6.5 The csinh functions */ -double complex csinh(double complex); -float complex csinhf(float complex); - -/* 7.3.6.6 The ctanh functions */ -double complex ctanh(double complex); -float complex ctanhf(float complex); - -/* 7.3.7 Exponential and logarithmic functions */ -/* 7.3.7.1 The cexp functions */ -double complex cexp(double complex); -float complex cexpf(float complex); - -/* 7.3.7.2 The clog functions */ -double complex clog(double complex); -float complex clogf(float complex); - -/* 7.3.8 Power and absolute-value functions */ -/* 7.3.8.1 The cabs functions */ -/*#ifndef __LIBM0_SOURCE__ */ -/* avoid conflict with historical cabs(struct complex) */ -/* double cabs(double complex) __RENAME(__c99_cabs); - float cabsf(float complex) __RENAME(__c99_cabsf); - #endif -*/ -double cabs(double complex) ; -float cabsf(float complex) ; - -/* 7.3.8.2 The cpow functions */ -double complex cpow(double complex, double complex); -float complex cpowf(float complex, float complex); - -/* 7.3.8.3 The csqrt functions */ -double complex csqrt(double complex); -float complex csqrtf(float complex); - -/* 7.3.9 Manipulation functions */ -/* 7.3.9.1 The carg functions */ -double carg(double complex); -float cargf(float complex); - -/* 7.3.9.2 The cimag functions */ -double cimag(double complex); -float cimagf(float complex); -/*long double cimagl(long double complex); */ - -/* 7.3.9.3 The conj functions */ -double complex conj(double complex); -float complex conjf(float complex); -/*long double complex conjl(long double complex); */ - -/* 7.3.9.4 The cproj functions */ -double complex cproj(double complex); -float complex cprojf(float complex); -/*long double complex cprojl(long double complex); */ - -/* 7.3.9.5 The creal functions */ -double creal(double complex); -float crealf(float complex); -/*long double creall(long double complex); */ - -__END_DECLS - -#endif /* ! _COMPLEX_H */ diff --git a/tools/sdk/include/newlib/config.h b/tools/sdk/include/newlib/config.h deleted file mode 100644 index 69d49adf95b..00000000000 --- a/tools/sdk/include/newlib/config.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef __SYS_CONFIG_H__ -#define __SYS_CONFIG_H__ - -#include /* floating point macros */ -#include /* POSIX defs */ - -#ifndef __EXPORT -#define __EXPORT -#endif - -#ifndef __IMPORT -#define __IMPORT -#endif - -/* Define return type of read/write routines. In POSIX, the return type - for read()/write() is "ssize_t" but legacy newlib code has been using - "int" for some time. If not specified, "int" is defaulted. */ -#ifndef _READ_WRITE_RETURN_TYPE -#define _READ_WRITE_RETURN_TYPE int -#endif -/* Define `count' parameter of read/write routines. In POSIX, the `count' - parameter is "size_t" but legacy newlib code has been using "int" for some - time. If not specified, "int" is defaulted. */ -#ifndef _READ_WRITE_BUFSIZE_TYPE -#define _READ_WRITE_BUFSIZE_TYPE int -#endif - -#endif /* __SYS_CONFIG_H__ */ diff --git a/tools/sdk/include/newlib/ctype.h b/tools/sdk/include/newlib/ctype.h deleted file mode 100644 index 1eb3f787f88..00000000000 --- a/tools/sdk/include/newlib/ctype.h +++ /dev/null @@ -1,113 +0,0 @@ -#ifndef _CTYPE_H_ -#define _CTYPE_H_ - -#include "_ansi.h" - -_BEGIN_STD_C - -int _EXFUN(isalnum, (int __c)); -int _EXFUN(isalpha, (int __c)); -int _EXFUN(iscntrl, (int __c)); -int _EXFUN(isdigit, (int __c)); -int _EXFUN(isgraph, (int __c)); -int _EXFUN(islower, (int __c)); -int _EXFUN(isprint, (int __c)); -int _EXFUN(ispunct, (int __c)); -int _EXFUN(isspace, (int __c)); -int _EXFUN(isupper, (int __c)); -int _EXFUN(isxdigit,(int __c)); -int _EXFUN(tolower, (int __c)); -int _EXFUN(toupper, (int __c)); - -#if !defined(__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L -int _EXFUN(isblank, (int __c)); -#endif - -#ifndef __STRICT_ANSI__ -int _EXFUN(isascii, (int __c)); -int _EXFUN(toascii, (int __c)); -#define _tolower(__c) ((unsigned char)(__c) - 'A' + 'a') -#define _toupper(__c) ((unsigned char)(__c) - 'a' + 'A') -#endif - -#define _U 01 -#define _L 02 -#define _N 04 -#define _S 010 -#define _P 020 -#define _C 040 -#define _X 0100 -#define _B 0200 - -#ifndef _MB_CAPABLE -_CONST -#endif -extern __IMPORT char * _CONST __ctype_ptr__; - -#ifndef __cplusplus -/* These macros are intentionally written in a manner that will trigger - a gcc -Wall warning if the user mistakenly passes a 'char' instead - of an int containing an 'unsigned char'. Note that the sizeof will - always be 1, which is what we want for mapping EOF to __ctype_ptr__[0]; - the use of a raw index inside the sizeof triggers the gcc warning if - __c was of type char, and sizeof masks side effects of the extra __c. - Meanwhile, the real index to __ctype_ptr__+1 must be cast to int, - since isalpha(0x100000001LL) must equal isalpha(1), rather than being - an out-of-bounds reference on a 64-bit machine. */ -#define __ctype_lookup(__c) ((__ctype_ptr__+sizeof(""[__c]))[(int)(__c)]) - -#define isalpha(__c) (__ctype_lookup(__c)&(_U|_L)) -#define isupper(__c) ((__ctype_lookup(__c)&(_U|_L))==_U) -#define islower(__c) ((__ctype_lookup(__c)&(_U|_L))==_L) -#define isdigit(__c) (__ctype_lookup(__c)&_N) -#define isxdigit(__c) (__ctype_lookup(__c)&(_X|_N)) -#define isspace(__c) (__ctype_lookup(__c)&_S) -#define ispunct(__c) (__ctype_lookup(__c)&_P) -#define isalnum(__c) (__ctype_lookup(__c)&(_U|_L|_N)) -#define isprint(__c) (__ctype_lookup(__c)&(_P|_U|_L|_N|_B)) -#define isgraph(__c) (__ctype_lookup(__c)&(_P|_U|_L|_N)) -#define iscntrl(__c) (__ctype_lookup(__c)&_C) - -#if defined(__GNUC__) && \ - (!defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901L) -#define isblank(__c) \ - __extension__ ({ __typeof__ (__c) __x = (__c); \ - (__ctype_lookup(__x)&_B) || (int) (__x) == '\t';}) -#endif - - -/* Non-gcc versions will get the library versions, and will be - slightly slower. These macros are not NLS-aware so they are - disabled if the system supports the extended character sets. */ -# if defined(__GNUC__) -# if !defined (_MB_EXTENDED_CHARSETS_ISO) && !defined (_MB_EXTENDED_CHARSETS_WINDOWS) -# define toupper(__c) \ - __extension__ ({ __typeof__ (__c) __x = (__c); \ - islower (__x) ? (int) __x - 'a' + 'A' : (int) __x;}) -# define tolower(__c) \ - __extension__ ({ __typeof__ (__c) __x = (__c); \ - isupper (__x) ? (int) __x - 'A' + 'a' : (int) __x;}) -# else /* _MB_EXTENDED_CHARSETS* */ -/* Allow a gcc warning if the user passed 'char', but defer to the - function. */ -# define toupper(__c) \ - __extension__ ({ __typeof__ (__c) __x = (__c); \ - (void) __ctype_ptr__[__x]; (toupper) (__x);}) -# define tolower(__c) \ - __extension__ ({ __typeof__ (__c) __x = (__c); \ - (void) __ctype_ptr__[__x]; (tolower) (__x);}) -# endif /* _MB_EXTENDED_CHARSETS* */ -# endif /* __GNUC__ */ -#endif /* !__cplusplus */ - -#ifndef __STRICT_ANSI__ -#define isascii(__c) ((unsigned)(__c)<=0177) -#define toascii(__c) ((__c)&0177) -#endif - -/* For C++ backward-compatibility only. */ -extern __IMPORT _CONST char _ctype_[]; - -_END_STD_C - -#endif /* _CTYPE_H_ */ diff --git a/tools/sdk/include/newlib/dirent.h b/tools/sdk/include/newlib/dirent.h deleted file mode 100644 index 6fefc03cbdc..00000000000 --- a/tools/sdk/include/newlib/dirent.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef _DIRENT_H_ -#define _DIRENT_H_ -#ifdef __cplusplus -extern "C" { -#endif -#include - -#if !defined(MAXNAMLEN) && !defined(_POSIX_SOURCE) -#define MAXNAMLEN 1024 -#endif - -#ifdef __cplusplus -} -#endif -#endif /*_DIRENT_H_*/ diff --git a/tools/sdk/include/newlib/envlock.h b/tools/sdk/include/newlib/envlock.h deleted file mode 100644 index 9bb6a813ea5..00000000000 --- a/tools/sdk/include/newlib/envlock.h +++ /dev/null @@ -1,15 +0,0 @@ -/* envlock.h -- header file for env routines. */ - -#ifndef _INCLUDE_ENVLOCK_H_ -#define _INCLUDE_ENVLOCK_H_ - -#include <_ansi.h> -#include - -#define ENV_LOCK __env_lock(reent_ptr) -#define ENV_UNLOCK __env_unlock(reent_ptr) - -void _EXFUN(__env_lock,(struct _reent *reent)); -void _EXFUN(__env_unlock,(struct _reent *reent)); - -#endif /* _INCLUDE_ENVLOCK_H_ */ diff --git a/tools/sdk/include/newlib/envz.h b/tools/sdk/include/newlib/envz.h deleted file mode 100644 index e6a31c31d65..00000000000 --- a/tools/sdk/include/newlib/envz.h +++ /dev/null @@ -1,16 +0,0 @@ -/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#include -#include - -/* The newlib implementation of these functions assumes that sizeof(char) == 1. */ -char * envz_entry (const char *envz, size_t envz_len, const char *name); -char * envz_get (const char *envz, size_t envz_len, const char *name); -error_t envz_add (char **envz, size_t *envz_len, const char *name, const char *value); -error_t envz_merge (char **envz, size_t *envz_len, const char *envz2, size_t envz2_len, int override); -void envz_remove(char **envz, size_t *envz_len, const char *name); -void envz_strip (char **envz, size_t *envz_len); diff --git a/tools/sdk/include/newlib/errno.h b/tools/sdk/include/newlib/errno.h deleted file mode 100644 index 7cc2ca86f84..00000000000 --- a/tools/sdk/include/newlib/errno.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __ERRNO_H__ -#define __ERRNO_H__ - -#ifndef __error_t_defined -typedef int error_t; -#define __error_t_defined 1 -#endif - -#include - -#endif /* !__ERRNO_H__ */ diff --git a/tools/sdk/include/newlib/esp_newlib.h b/tools/sdk/include/newlib/esp_newlib.h deleted file mode 100644 index 31adf7d8473..00000000000 --- a/tools/sdk/include/newlib/esp_newlib.h +++ /dev/null @@ -1,46 +0,0 @@ -// 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. - -#ifndef __ESP_NEWLIB_H__ -#define __ESP_NEWLIB_H__ - -#include - -/** - * Replacement for newlib's _REENT_INIT_PTR and __sinit. - * - * Called from startup code and FreeRTOS, not intended to be called from - * application code. - */ -void esp_reent_init(struct _reent* r); - -/** - * Function which sets up syscall table used by newlib functions in ROM. - * - * Called from the startup code, not intended to be called from application - * code. - */ -void esp_setup_syscall_table(); - -/** - * Update current microsecond time from RTC - */ -void esp_set_time_from_rtc(); - -/* - * Sync counters RTC and FRC. Update boot_time. - */ -void esp_sync_counters_rtc_and_frc(); - -#endif //__ESP_NEWLIB_H__ diff --git a/tools/sdk/include/newlib/fastmath.h b/tools/sdk/include/newlib/fastmath.h deleted file mode 100644 index 95eea5f3421..00000000000 --- a/tools/sdk/include/newlib/fastmath.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _FASTMATH_H_ -#ifdef __cplusplus -extern "C" { -#endif -#define _FASTMATH_H_ - -#include -#include - -#ifdef __cplusplus -} -#endif -#endif /* _FASTMATH_H_ */ diff --git a/tools/sdk/include/newlib/fcntl.h b/tools/sdk/include/newlib/fcntl.h deleted file mode 100644 index 86a9167757a..00000000000 --- a/tools/sdk/include/newlib/fcntl.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/tools/sdk/include/newlib/fenv.h b/tools/sdk/include/newlib/fenv.h deleted file mode 100644 index 2fa76f758da..00000000000 --- a/tools/sdk/include/newlib/fenv.h +++ /dev/null @@ -1,88 +0,0 @@ -/* Copyright (c) 2011 Tensilica Inc. ALL RIGHTS RESERVED. - - 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. - - 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 - TENSILICA INCORPORATED 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 _FENV_H -#define _FENV_H - -#ifdef __cplusplus -extern "C" { -#endif - -typedef unsigned long fenv_t; -typedef unsigned long fexcept_t; - -#define FE_DIVBYZERO 0x08 -#define FE_INEXACT 0x01 -#define FE_INVALID 0x10 -#define FE_OVERFLOW 0x04 -#define FE_UNDERFLOW 0x02 - -#define FE_ALL_EXCEPT \ - (FE_DIVBYZERO | \ - FE_INEXACT | \ - FE_INVALID | \ - FE_OVERFLOW | \ - FE_UNDERFLOW) - -#define FE_DOWNWARD 0x3 -#define FE_TONEAREST 0x0 -#define FE_TOWARDZERO 0x1 -#define FE_UPWARD 0x2 - -#define FE_DFL_ENV ((const fenv_t *) 0) - -int feclearexcept(int); -int fegetexceptflag(fexcept_t *, int); -int feraiseexcept(int); -int fesetexceptflag(const fexcept_t *, int); -int fetestexcept(int); -int fegetround(void); -int fesetround(int); -int fegetenv(fenv_t *); -int feholdexcept(fenv_t *); -int fesetenv(const fenv_t *); -int feupdateenv(const fenv_t *); - -/* glibc extensions */ -int feenableexcept(int excepts); -int fedisableexcept(int excepts); -int fegetexcept(void); - -#define _FE_EXCEPTION_FLAGS_OFFSET 7 -#define _FE_EXCEPTION_FLAG_MASK (FE_ALL_EXCEPT << _FE_EXCEPTION_FLAGS_OFFSET) -#define _FE_EXCEPTION_ENABLE_OFFSET 2 -#define _FE_EXCEPTION_ENABLE_MASK (FE_ALL_EXCEPT << _FE_EXCEPTION_ENABLE_OFFSET) -#define _FE_ROUND_MODE_OFFSET 0 -#define _FE_ROUND_MODE_MASK (0x3 << _FE_ROUND_MODE_OFFSET) -#define _FE_FLOATING_ENV_MASK (_FE_EXCEPTION_FLAG_MASK | _FE_EXCEPTION_ENABLE_MASK | _FE_ROUND_MODE_MASK) - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/newlib/fnmatch.h b/tools/sdk/include/newlib/fnmatch.h deleted file mode 100644 index 06311fc4b11..00000000000 --- a/tools/sdk/include/newlib/fnmatch.h +++ /dev/null @@ -1,55 +0,0 @@ -/*- - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * 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. - * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. - * - * $FreeBSD: src/include/fnmatch.h,v 1.10 2002/03/23 17:24:53 imp Exp $ - * @(#)fnmatch.h 8.1 (Berkeley) 6/2/93 - */ - -#ifndef _FNMATCH_H_ -#define _FNMATCH_H_ - -#define FNM_NOMATCH 1 /* Match failed. */ - -#define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */ -#define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */ -#define FNM_PERIOD 0x04 /* Period must be matched by period. */ - -#if defined(_GNU_SOURCE) || !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) -#define FNM_LEADING_DIR 0x08 /* Ignore / after Imatch. */ -#define FNM_CASEFOLD 0x10 /* Case insensitive search. */ -#define FNM_IGNORECASE FNM_CASEFOLD -#define FNM_FILE_NAME FNM_PATHNAME -#endif - -#include - -__BEGIN_DECLS -int fnmatch(const char *, const char *, int); -__END_DECLS - -#endif /* !_FNMATCH_H_ */ diff --git a/tools/sdk/include/newlib/getopt.h b/tools/sdk/include/newlib/getopt.h deleted file mode 100644 index e12d253d47b..00000000000 --- a/tools/sdk/include/newlib/getopt.h +++ /dev/null @@ -1,190 +0,0 @@ -/**************************************************************************** - -getopt.h - Read command line options - -AUTHOR: Gregory Pietsch -CREATED Thu Jan 09 22:37:00 1997 - -DESCRIPTION: - -The getopt() function parses the command line arguments. Its arguments argc -and argv are the argument count and array as passed to the main() function -on program invocation. The argument optstring is a list of available option -characters. If such a character is followed by a colon (`:'), the option -takes an argument, which is placed in optarg. If such a character is -followed by two colons, the option takes an optional argument, which is -placed in optarg. If the option does not take an argument, optarg is NULL. - -The external variable optind is the index of the next array element of argv -to be processed; it communicates from one call to the next which element to -process. - -The getopt_long() function works like getopt() except that it also accepts -long options started by two dashes `--'. If these take values, it is either -in the form - ---arg=value - - or - ---arg value - -It takes the additional arguments longopts which is a pointer to the first -element of an array of type GETOPT_LONG_OPTION_T, defined below. The last -element of the array has to be filled with NULL for the name field. - -The longind pointer points to the index of the current long option relative -to longopts if it is non-NULL. - -The getopt() function returns the option character if the option was found -successfully, `:' if there was a missing parameter for one of the options, -`?' for an unknown option character, and EOF for the end of the option list. - -The getopt_long() function's return value is described below. - -The function getopt_long_only() is identical to getopt_long(), except that a -plus sign `+' can introduce long options as well as `--'. - -Describe how to deal with options that follow non-option ARGV-elements. - -If the caller did not specify anything, the default is REQUIRE_ORDER if the -environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. - -REQUIRE_ORDER means don't recognize them as options; stop option processing -when the first non-option is seen. This is what Unix does. This mode of -operation is selected by either setting the environment variable -POSIXLY_CORRECT, or using `+' as the first character of the optstring -parameter. - -PERMUTE is the default. We permute the contents of ARGV as we scan, so that -eventually all the non-options are at the end. This allows options to be -given in any order, even with programs that were not written to expect this. - -RETURN_IN_ORDER is an option available to programs that were written to -expect options and other ARGV-elements in any order and that care about the -ordering of the two. We describe each non-option ARGV-element as if it were -the argument of an option with character code 1. Using `-' as the first -character of the optstring parameter selects this mode of operation. - -The special argument `--' forces an end of option-scanning regardless of the -value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause -getopt() and friends to return EOF with optind != argc. - -COPYRIGHT NOTICE AND DISCLAIMER: - -Copyright (C) 1997 Gregory Pietsch - -This file and the accompanying getopt.c implementation file are hereby -placed in the public domain without restrictions. Just give the author -credit, don't claim you wrote it or prevent anyone else from using it. - -Gregory Pietsch's current e-mail address: -gpietsch@comcast.net -****************************************************************************/ - -/* This is a glibc-extension header file. */ - -#ifndef GETOPT_H -#define GETOPT_H - -#include <_ansi.h> - -/* include files needed by this include file */ - -#define no_argument 0 -#define required_argument 1 -#define optional_argument 2 - -#ifdef __cplusplus -extern "C" -{ - -#endif /* __cplusplus */ - -/* types defined by this include file */ - struct option - { - const char *name; /* the name of the long option */ - int has_arg; /* one of the above macros */ - int *flag; /* determines if getopt_long() returns a - * value for a long option; if it is - * non-NULL, 0 is returned as a function - * value and the value of val is stored in - * the area pointed to by flag. Otherwise, - * val is returned. */ - int val; /* determines the value to return if flag is - * NULL. */ - - }; - -/* While getopt.h is a glibc extension, the following are newlib extensions. - * They are optionally included via the __need_getopt_newlib flag. */ - -#ifdef __need_getopt_newlib - - /* macros defined by this include file */ - #define NO_ARG no_argument - #define REQUIRED_ARG required_argument - #define OPTIONAL_ARG optional_argument - - /* The GETOPT_DATA_INITIALIZER macro is used to initialize a statically- - allocated variable of type struct getopt_data. */ - #define GETOPT_DATA_INITIALIZER {0,0,0,0,0} - - /* These #defines are to make accessing the reentrant functions easier. */ - #define getopt_r __getopt_r - #define getopt_long_r __getopt_long_r - #define getopt_long_only_r __getopt_long_only_r - - /* The getopt_data structure is for reentrancy. Its members are similar to - the externally-defined variables. */ - typedef struct getopt_data - { - char *optarg; - int optind, opterr, optopt, optwhere; - } getopt_data; - -#endif /* __need_getopt_newlib */ - - /* externally-defined variables */ - extern char *optarg; - extern int optind; - extern int opterr; - extern int optopt; - - /* function prototypes */ - int _EXFUN (getopt, - (int __argc, char *const __argv[], const char *__optstring)); - - int _EXFUN (getopt_long, - (int __argc, char *const __argv[], const char *__shortopts, - const struct option * __longopts, int *__longind)); - - int _EXFUN (getopt_long_only, - (int __argc, char *const __argv[], const char *__shortopts, - const struct option * __longopts, int *__longind)); - -#ifdef __need_getopt_newlib - int _EXFUN (__getopt_r, - (int __argc, char *const __argv[], const char *__optstring, - struct getopt_data * __data)); - - int _EXFUN (__getopt_long_r, - (int __argc, char *const __argv[], const char *__shortopts, - const struct option * __longopts, int *__longind, - struct getopt_data * __data)); - - int _EXFUN (__getopt_long_only_r, - (int __argc, char *const __argv[], const char *__shortopts, - const struct option * __longopts, int *__longind, - struct getopt_data * __data)); -#endif /* __need_getopt_newlib */ - -#ifdef __cplusplus -}; - -#endif /* __cplusplus */ - -#endif /* GETOPT_H */ - -/* END OF FILE getopt.h */ diff --git a/tools/sdk/include/newlib/glob.h b/tools/sdk/include/newlib/glob.h deleted file mode 100644 index 7a300e69d46..00000000000 --- a/tools/sdk/include/newlib/glob.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 1989, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Guido van Rossum. - * - * 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. - * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. - * - * @(#)glob.h 8.1 (Berkeley) 6/2/93 - * $FreeBSD: src/include/glob.h,v 1.6 2002/03/23 17:24:53 imp Exp $ - */ - -#ifndef _GLOB_H_ -#define _GLOB_H_ - -#include - -struct stat; -typedef struct { - int gl_pathc; /* Count of total paths so far. */ - int gl_matchc; /* Count of paths matching pattern. */ - int gl_offs; /* Reserved at beginning of gl_pathv. */ - int gl_flags; /* Copy of flags parameter to glob. */ - char **gl_pathv; /* List of paths matching pattern. */ - /* Copy of errfunc parameter to glob. */ - int (*gl_errfunc)(const char *, int); - - /* - * Alternate filesystem access methods for glob; replacement - * versions of closedir(3), readdir(3), opendir(3), stat(2) - * and lstat(2). - */ - void (*gl_closedir)(void *); - struct dirent *(*gl_readdir)(void *); - void *(*gl_opendir)(const char *); - int (*gl_lstat)(const char *, struct stat *); - int (*gl_stat)(const char *, struct stat *); -} glob_t; - -#define GLOB_APPEND 0x0001 /* Append to output from previous call. */ -#define GLOB_DOOFFS 0x0002 /* Use gl_offs. */ -#define GLOB_ERR 0x0004 /* Return on error. */ -#define GLOB_MARK 0x0008 /* Append / to matching directories. */ -#define GLOB_NOCHECK 0x0010 /* Return pattern itself if nothing matches. */ -#define GLOB_NOSORT 0x0020 /* Don't sort. */ - -#define GLOB_ALTDIRFUNC 0x0040 /* Use alternately specified directory funcs. */ -#define GLOB_BRACE 0x0080 /* Expand braces ala csh. */ -#define GLOB_MAGCHAR 0x0100 /* Pattern had globbing characters. */ -#define GLOB_NOMAGIC 0x0200 /* GLOB_NOCHECK without magic chars (csh). */ -#define GLOB_QUOTE 0x0400 /* Quote special chars with \. */ -#define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */ -#define GLOB_LIMIT 0x1000 /* limit number of returned paths */ - -/* backwards compatibility, this is the old name for this option */ -#define GLOB_MAXPATH GLOB_LIMIT - -#define GLOB_NOSPACE (-1) /* Malloc call failed. */ -#define GLOB_ABEND (-2) /* Unignored error. */ - -__BEGIN_DECLS -int glob(const char *__restrict, int, int (*)(const char *, int), - glob_t *__restrict); -void globfree(glob_t *); -__END_DECLS - -#endif /* !_GLOB_H_ */ diff --git a/tools/sdk/include/newlib/grp.h b/tools/sdk/include/newlib/grp.h deleted file mode 100644 index c3a5a676c89..00000000000 --- a/tools/sdk/include/newlib/grp.h +++ /dev/null @@ -1,95 +0,0 @@ -/* $NetBSD: grp.h,v 1.7 1995/04/29 05:30:40 cgd Exp $ */ - -/*- - * Copyright (c) 1989, 1993 - * The Regents of the University of California. All rights reserved. - * (c) UNIX System Laboratories, Inc. - * All or some portions of this file are derived from material licensed - * to the University of California by American Telephone and Telegraph - * Co. or Unix System Laboratories, Inc. and are reproduced herein with - * the permission of UNIX System Laboratories, Inc. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. - * - * @(#)grp.h 8.2 (Berkeley) 1/21/94 - */ - -#ifndef _GRP_H_ -#define _GRP_H_ - -#include -#include -#ifdef __CYGWIN__ -#include -#endif - -#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) -#define _PATH_GROUP "/etc/group" -#endif - -struct group { - char *gr_name; /* group name */ - char *gr_passwd; /* group password */ - gid_t gr_gid; /* group id */ - char **gr_mem; /* group members */ -}; - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef __INSIDE_CYGWIN__ -struct group *getgrgid (gid_t); -struct group *getgrnam (const char *); -int getgrnam_r (const char *, struct group *, - char *, size_t, struct group **); -int getgrgid_r (gid_t, struct group *, - char *, size_t, struct group **); -#ifndef _POSIX_SOURCE -struct group *getgrent (void); -void setgrent (void); -void endgrent (void); -#ifndef __CYGWIN__ -void setgrfile (const char *); -#endif /* !__CYGWIN__ */ -#ifndef _XOPEN_SOURCE -#ifndef __CYGWIN__ -char *group_from_gid (gid_t, int); -int setgroupent (int); -#endif /* !__CYGWIN__ */ -int initgroups (const char *, gid_t); -#endif /* !_XOPEN_SOURCE */ -#endif /* !_POSIX_SOURCE */ -#endif /* !__INSIDE_CYGWIN__ */ - -#ifdef __cplusplus -} -#endif - -#endif /* !_GRP_H_ */ diff --git a/tools/sdk/include/newlib/iconv.h b/tools/sdk/include/newlib/iconv.h deleted file mode 100644 index 4c023e9df77..00000000000 --- a/tools/sdk/include/newlib/iconv.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2003-2004, Artem B. Bityuckiy, SoftMine Corporation. - * Rights transferred to Franklin Electronic Publishers. - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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 _ICONV_H_ -#define _ICONV_H_ - -#include <_ansi.h> -#include -#include -#include - -/* iconv_t: charset conversion descriptor type */ -typedef _iconv_t iconv_t; - -_BEGIN_STD_C - -#ifndef _REENT_ONLY -iconv_t -_EXFUN(iconv_open, (_CONST char *, _CONST char *)); - -size_t -_EXFUN(iconv, (iconv_t, char **__restrict, size_t *__restrict, - char **__restrict, size_t *__restrict)); - -int -_EXFUN(iconv_close, (iconv_t)); -#endif - -iconv_t -_EXFUN(_iconv_open_r, (struct _reent *, _CONST char *, _CONST char *)); - -size_t -_EXFUN(_iconv_r, (struct _reent *, iconv_t, _CONST char **, - size_t *, char **, size_t *)); - -int -_EXFUN(_iconv_close_r, (struct _reent *, iconv_t)); - -_END_STD_C - -#endif /* #ifndef _ICONV_H_ */ diff --git a/tools/sdk/include/newlib/ieeefp.h b/tools/sdk/include/newlib/ieeefp.h deleted file mode 100644 index 0b06fb7861e..00000000000 --- a/tools/sdk/include/newlib/ieeefp.h +++ /dev/null @@ -1,256 +0,0 @@ -#ifndef _IEEE_FP_H_ -#define _IEEE_FP_H_ - -#include "_ansi.h" - -#include - -_BEGIN_STD_C - -/* FIXME FIXME FIXME: - Neither of __ieee_{float,double}_shape_tape seem to be used anywhere - except in libm/test. If that is the case, please delete these from here. - If that is not the case, please insert documentation here describing why - they're needed. */ - -#ifdef __IEEE_BIG_ENDIAN - -typedef union -{ - double value; - struct - { - unsigned int sign : 1; - unsigned int exponent: 11; - unsigned int fraction0:4; - unsigned int fraction1:16; - unsigned int fraction2:16; - unsigned int fraction3:16; - - } number; - struct - { - unsigned int sign : 1; - unsigned int exponent: 11; - unsigned int quiet:1; - unsigned int function0:3; - unsigned int function1:16; - unsigned int function2:16; - unsigned int function3:16; - } nan; - struct - { - unsigned long msw; - unsigned long lsw; - } parts; - long aslong[2]; -} __ieee_double_shape_type; - -#endif - -#ifdef __IEEE_LITTLE_ENDIAN - -typedef union -{ - double value; - struct - { -#ifdef __SMALL_BITFIELDS - unsigned int fraction3:16; - unsigned int fraction2:16; - unsigned int fraction1:16; - unsigned int fraction0: 4; -#else - unsigned int fraction1:32; - unsigned int fraction0:20; -#endif - unsigned int exponent :11; - unsigned int sign : 1; - } number; - struct - { -#ifdef __SMALL_BITFIELDS - unsigned int function3:16; - unsigned int function2:16; - unsigned int function1:16; - unsigned int function0:3; -#else - unsigned int function1:32; - unsigned int function0:19; -#endif - unsigned int quiet:1; - unsigned int exponent: 11; - unsigned int sign : 1; - } nan; - struct - { - unsigned long lsw; - unsigned long msw; - } parts; - - long aslong[2]; - -} __ieee_double_shape_type; - -#endif - -#ifdef __IEEE_BIG_ENDIAN - -typedef union -{ - float value; - struct - { - unsigned int sign : 1; - unsigned int exponent: 8; - unsigned int fraction0: 7; - unsigned int fraction1: 16; - } number; - struct - { - unsigned int sign:1; - unsigned int exponent:8; - unsigned int quiet:1; - unsigned int function0:6; - unsigned int function1:16; - } nan; - long p1; - -} __ieee_float_shape_type; - -#endif - -#ifdef __IEEE_LITTLE_ENDIAN - -typedef union -{ - float value; - struct - { - unsigned int fraction0: 7; - unsigned int fraction1: 16; - unsigned int exponent: 8; - unsigned int sign : 1; - } number; - struct - { - unsigned int function1:16; - unsigned int function0:6; - unsigned int quiet:1; - unsigned int exponent:8; - unsigned int sign:1; - } nan; - long p1; - -} __ieee_float_shape_type; - -#endif - - - - - -/* FLOATING ROUNDING */ - -typedef int fp_rnd; -#define FP_RN 0 /* Round to nearest */ -#define FP_RM 1 /* Round down */ -#define FP_RP 2 /* Round up */ -#define FP_RZ 3 /* Round to zero (trunate) */ - -fp_rnd _EXFUN(fpgetround,(void)); -fp_rnd _EXFUN(fpsetround, (fp_rnd)); - -/* EXCEPTIONS */ - -typedef int fp_except; -#define FP_X_INV 0x10 /* Invalid operation */ -#define FP_X_DX 0x80 /* Divide by zero */ -#define FP_X_OFL 0x04 /* Overflow exception */ -#define FP_X_UFL 0x02 /* Underflow exception */ -#define FP_X_IMP 0x01 /* imprecise exception */ - -fp_except _EXFUN(fpgetmask,(void)); -fp_except _EXFUN(fpsetmask,(fp_except)); -fp_except _EXFUN(fpgetsticky,(void)); -fp_except _EXFUN(fpsetsticky, (fp_except)); - -/* INTEGER ROUNDING */ - -typedef int fp_rdi; -#define FP_RDI_TOZ 0 /* Round to Zero */ -#define FP_RDI_RD 1 /* Follow float mode */ - -fp_rdi _EXFUN(fpgetroundtoi,(void)); -fp_rdi _EXFUN(fpsetroundtoi,(fp_rdi)); - -#undef isnan -#undef isinf - -int _EXFUN(isnan, (double)); -int _EXFUN(isinf, (double)); -int _EXFUN(finite, (double)); - - - -int _EXFUN(isnanf, (float)); -int _EXFUN(isinff, (float)); -int _EXFUN(finitef, (float)); - -#define __IEEE_DBL_EXPBIAS 1023 -#define __IEEE_FLT_EXPBIAS 127 - -#define __IEEE_DBL_EXPLEN 11 -#define __IEEE_FLT_EXPLEN 8 - - -#define __IEEE_DBL_FRACLEN (64 - (__IEEE_DBL_EXPLEN + 1)) -#define __IEEE_FLT_FRACLEN (32 - (__IEEE_FLT_EXPLEN + 1)) - -#define __IEEE_DBL_MAXPOWTWO ((double)(1L << 32 - 2) * (1L << (32-11) - 32 + 1)) -#define __IEEE_FLT_MAXPOWTWO ((float)(1L << (32-8) - 1)) - -#define __IEEE_DBL_NAN_EXP 0x7ff -#define __IEEE_FLT_NAN_EXP 0xff - -#ifndef __ieeefp_isnanf -#define __ieeefp_isnanf(x) (((*(long *)&(x) & 0x7f800000L)==0x7f800000L) && \ - ((*(long *)&(x) & 0x007fffffL)!=0000000000L)) -#endif -#define isnanf(x) __ieeefp_isnanf(x) - -#ifndef __ieeefp_isinff -#define __ieeefp_isinff(x) (((*(long *)&(x) & 0x7f800000L)==0x7f800000L) && \ - ((*(long *)&(x) & 0x007fffffL)==0000000000L)) -#endif -#define isinff(x) __ieeefp_isinff(x) - -#ifndef __ieeefp_finitef -#define __ieeefp_finitef(x) (((*(long *)&(x) & 0x7f800000L)!=0x7f800000L)) -#endif -#define finitef(x) __ieeefp_finitef(x) - -#ifdef _DOUBLE_IS_32BITS -#undef __IEEE_DBL_EXPBIAS -#define __IEEE_DBL_EXPBIAS __IEEE_FLT_EXPBIAS - -#undef __IEEE_DBL_EXPLEN -#define __IEEE_DBL_EXPLEN __IEEE_FLT_EXPLEN - -#undef __IEEE_DBL_FRACLEN -#define __IEEE_DBL_FRACLEN __IEEE_FLT_FRACLEN - -#undef __IEEE_DBL_MAXPOWTWO -#define __IEEE_DBL_MAXPOWTWO __IEEE_FLT_MAXPOWTWO - -#undef __IEEE_DBL_NAN_EXP -#define __IEEE_DBL_NAN_EXP __IEEE_FLT_NAN_EXP - -#undef __ieee_double_shape_type -#define __ieee_double_shape_type __ieee_float_shape_type - -#endif /* _DOUBLE_IS_32BITS */ - -_END_STD_C - -#endif /* _IEEE_FP_H_ */ diff --git a/tools/sdk/include/newlib/inttypes.h b/tools/sdk/include/newlib/inttypes.h deleted file mode 100644 index 39bf1351131..00000000000 --- a/tools/sdk/include/newlib/inttypes.h +++ /dev/null @@ -1,319 +0,0 @@ -/* - * Copyright (c) 2004, 2005 by - * Ralf Corsepius, Ulm/Germany. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -/** - * @file inttypes.h - */ - -#ifndef _INTTYPES_H -#define _INTTYPES_H - -#include -#include -#include -#define __need_wchar_t -#include - -#define __STRINGIFY(a) #a - -/* 8-bit types */ -#define __PRI8(x) __STRINGIFY(x) - -/* NOTICE: scanning 8-bit types requires use of the hh specifier - * which is only supported on newlib platforms that - * are built with C99 I/O format support enabled. If the flag in - * newlib.h hasn't been set during configuration to indicate this, the 8-bit - * scanning format macros are disabled here as they result in undefined - * behaviour which can include memory overwrite. Overriding the flag after the - * library has been built is not recommended as it will expose the underlying - * undefined behaviour. - */ - -#if defined(_WANT_IO_C99_FORMATS) - #define __SCN8(x) __STRINGIFY(hh##x) -#endif /* _WANT_IO_C99_FORMATS */ - - -#define PRId8 __PRI8(d) -#define PRIi8 __PRI8(i) -#define PRIo8 __PRI8(o) -#define PRIu8 __PRI8(u) -#define PRIx8 __PRI8(x) -#define PRIX8 __PRI8(X) - -/* Macros below are only enabled for a newlib built with C99 I/O format support. */ -#if defined(_WANT_IO_C99_FORMATS) - -#define SCNd8 __SCN8(d) -#define SCNi8 __SCN8(i) -#define SCNo8 __SCN8(o) -#define SCNu8 __SCN8(u) -#define SCNx8 __SCN8(x) - -#endif /* _WANT_IO_C99_FORMATS */ - - -#define PRIdLEAST8 __PRI8(d) -#define PRIiLEAST8 __PRI8(i) -#define PRIoLEAST8 __PRI8(o) -#define PRIuLEAST8 __PRI8(u) -#define PRIxLEAST8 __PRI8(x) -#define PRIXLEAST8 __PRI8(X) - -/* Macros below are only enabled for a newlib built with C99 I/O format support. */ -#if defined(_WANT_IO_C99_FORMATS) - - #define SCNdLEAST8 __SCN8(d) - #define SCNiLEAST8 __SCN8(i) - #define SCNoLEAST8 __SCN8(o) - #define SCNuLEAST8 __SCN8(u) - #define SCNxLEAST8 __SCN8(x) - -#endif /* _WANT_IO_C99_FORMATS */ - -#define PRIdFAST8 __PRI8(d) -#define PRIiFAST8 __PRI8(i) -#define PRIoFAST8 __PRI8(o) -#define PRIuFAST8 __PRI8(u) -#define PRIxFAST8 __PRI8(x) -#define PRIXFAST8 __PRI8(X) - -/* Macros below are only enabled for a newlib built with C99 I/O format support. */ -#if defined(_WANT_IO_C99_FORMATS) - - #define SCNdFAST8 __SCN8(d) - #define SCNiFAST8 __SCN8(i) - #define SCNoFAST8 __SCN8(o) - #define SCNuFAST8 __SCN8(u) - #define SCNxFAST8 __SCN8(x) - -#endif /* _WANT_IO_C99_FORMATS */ - -/* 16-bit types */ -#define __PRI16(x) __STRINGIFY(x) -#define __SCN16(x) __STRINGIFY(h##x) - - -#define PRId16 __PRI16(d) -#define PRIi16 __PRI16(i) -#define PRIo16 __PRI16(o) -#define PRIu16 __PRI16(u) -#define PRIx16 __PRI16(x) -#define PRIX16 __PRI16(X) - -#define SCNd16 __SCN16(d) -#define SCNi16 __SCN16(i) -#define SCNo16 __SCN16(o) -#define SCNu16 __SCN16(u) -#define SCNx16 __SCN16(x) - - -#define PRIdLEAST16 __PRI16(d) -#define PRIiLEAST16 __PRI16(i) -#define PRIoLEAST16 __PRI16(o) -#define PRIuLEAST16 __PRI16(u) -#define PRIxLEAST16 __PRI16(x) -#define PRIXLEAST16 __PRI16(X) - -#define SCNdLEAST16 __SCN16(d) -#define SCNiLEAST16 __SCN16(i) -#define SCNoLEAST16 __SCN16(o) -#define SCNuLEAST16 __SCN16(u) -#define SCNxLEAST16 __SCN16(x) - - -#define PRIdFAST16 __PRI16(d) -#define PRIiFAST16 __PRI16(i) -#define PRIoFAST16 __PRI16(o) -#define PRIuFAST16 __PRI16(u) -#define PRIxFAST16 __PRI16(x) -#define PRIXFAST16 __PRI16(X) - -#define SCNdFAST16 __SCN16(d) -#define SCNiFAST16 __SCN16(i) -#define SCNoFAST16 __SCN16(o) -#define SCNuFAST16 __SCN16(u) -#define SCNxFAST16 __SCN16(x) - -/* 32-bit types */ -#if __have_long32 -#define __PRI32(x) __STRINGIFY(l##x) -#define __SCN32(x) __STRINGIFY(l##x) -#else -#define __PRI32(x) __STRINGIFY(x) -#define __SCN32(x) __STRINGIFY(x) -#endif - -#define PRId32 __PRI32(d) -#define PRIi32 __PRI32(i) -#define PRIo32 __PRI32(o) -#define PRIu32 __PRI32(u) -#define PRIx32 __PRI32(x) -#define PRIX32 __PRI32(X) - -#define SCNd32 __SCN32(d) -#define SCNi32 __SCN32(i) -#define SCNo32 __SCN32(o) -#define SCNu32 __SCN32(u) -#define SCNx32 __SCN32(x) - - -#define PRIdLEAST32 __PRI32(d) -#define PRIiLEAST32 __PRI32(i) -#define PRIoLEAST32 __PRI32(o) -#define PRIuLEAST32 __PRI32(u) -#define PRIxLEAST32 __PRI32(x) -#define PRIXLEAST32 __PRI32(X) - -#define SCNdLEAST32 __SCN32(d) -#define SCNiLEAST32 __SCN32(i) -#define SCNoLEAST32 __SCN32(o) -#define SCNuLEAST32 __SCN32(u) -#define SCNxLEAST32 __SCN32(x) - - -#define PRIdFAST32 __PRI32(d) -#define PRIiFAST32 __PRI32(i) -#define PRIoFAST32 __PRI32(o) -#define PRIuFAST32 __PRI32(u) -#define PRIxFAST32 __PRI32(x) -#define PRIXFAST32 __PRI32(X) - -#define SCNdFAST32 __SCN32(d) -#define SCNiFAST32 __SCN32(i) -#define SCNoFAST32 __SCN32(o) -#define SCNuFAST32 __SCN32(u) -#define SCNxFAST32 __SCN32(x) - - -/* 64-bit types */ -#if __have_long64 -#define __PRI64(x) __STRINGIFY(l##x) -#define __SCN64(x) __STRINGIFY(l##x) -#elif __have_longlong64 -#define __PRI64(x) __STRINGIFY(ll##x) -#define __SCN64(x) __STRINGIFY(ll##x) -#else -#define __PRI64(x) __STRINGIFY(x) -#define __SCN64(x) __STRINGIFY(x) -#endif - -#define PRId64 __PRI64(d) -#define PRIi64 __PRI64(i) -#define PRIo64 __PRI64(o) -#define PRIu64 __PRI64(u) -#define PRIx64 __PRI64(x) -#define PRIX64 __PRI64(X) - -#define SCNd64 __SCN64(d) -#define SCNi64 __SCN64(i) -#define SCNo64 __SCN64(o) -#define SCNu64 __SCN64(u) -#define SCNx64 __SCN64(x) - -#if __int64_t_defined -#define PRIdLEAST64 __PRI64(d) -#define PRIiLEAST64 __PRI64(i) -#define PRIoLEAST64 __PRI64(o) -#define PRIuLEAST64 __PRI64(u) -#define PRIxLEAST64 __PRI64(x) -#define PRIXLEAST64 __PRI64(X) - -#define SCNdLEAST64 __SCN64(d) -#define SCNiLEAST64 __SCN64(i) -#define SCNoLEAST64 __SCN64(o) -#define SCNuLEAST64 __SCN64(u) -#define SCNxLEAST64 __SCN64(x) - - -#define PRIdFAST64 __PRI64(d) -#define PRIiFAST64 __PRI64(i) -#define PRIoFAST64 __PRI64(o) -#define PRIuFAST64 __PRI64(u) -#define PRIxFAST64 __PRI64(x) -#define PRIXFAST64 __PRI64(X) - -#define SCNdFAST64 __SCN64(d) -#define SCNiFAST64 __SCN64(i) -#define SCNoFAST64 __SCN64(o) -#define SCNuFAST64 __SCN64(u) -#define SCNxFAST64 __SCN64(x) -#endif - -/* max-bit types */ -#if __have_long64 -#define __PRIMAX(x) __STRINGIFY(l##x) -#define __SCNMAX(x) __STRINGIFY(l##x) -#elif __have_longlong64 -#define __PRIMAX(x) __STRINGIFY(ll##x) -#define __SCNMAX(x) __STRINGIFY(ll##x) -#else -#define __PRIMAX(x) __STRINGIFY(x) -#define __SCNMAX(x) __STRINGIFY(x) -#endif - -#define PRIdMAX __PRIMAX(d) -#define PRIiMAX __PRIMAX(i) -#define PRIoMAX __PRIMAX(o) -#define PRIuMAX __PRIMAX(u) -#define PRIxMAX __PRIMAX(x) -#define PRIXMAX __PRIMAX(X) - -#define SCNdMAX __SCNMAX(d) -#define SCNiMAX __SCNMAX(i) -#define SCNoMAX __SCNMAX(o) -#define SCNuMAX __SCNMAX(u) -#define SCNxMAX __SCNMAX(x) - -/* ptr types */ -#if defined(_UINTPTR_EQ_ULONGLONG) -# define __PRIPTR(x) __STRINGIFY(ll##x) -# define __SCNPTR(x) __STRINGIFY(ll##x) -#elif defined(_UINTPTR_EQ_ULONG) -# define __PRIPTR(x) __STRINGIFY(l##x) -# define __SCNPTR(x) __STRINGIFY(l##x) -#else -# define __PRIPTR(x) __STRINGIFY(x) -# define __SCNPTR(x) __STRINGIFY(x) -#endif - -#define PRIdPTR __PRIPTR(d) -#define PRIiPTR __PRIPTR(i) -#define PRIoPTR __PRIPTR(o) -#define PRIuPTR __PRIPTR(u) -#define PRIxPTR __PRIPTR(x) -#define PRIXPTR __PRIPTR(X) - -#define SCNdPTR __SCNPTR(d) -#define SCNiPTR __SCNPTR(i) -#define SCNoPTR __SCNPTR(o) -#define SCNuPTR __SCNPTR(u) -#define SCNxPTR __SCNPTR(x) - - -typedef struct { - intmax_t quot; - intmax_t rem; -} imaxdiv_t; - -#ifdef __cplusplus -extern "C" { -#endif - -extern intmax_t imaxabs(intmax_t j); -extern imaxdiv_t imaxdiv(intmax_t numer, intmax_t denomer); -extern intmax_t strtoimax(const char *__restrict, char **__restrict, int); -extern uintmax_t strtoumax(const char *__restrict, char **__restrict, int); -extern intmax_t wcstoimax(const wchar_t *__restrict, wchar_t **__restrict, int); -extern uintmax_t wcstoumax(const wchar_t *__restrict, wchar_t **__restrict, int); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/newlib/langinfo.h b/tools/sdk/include/newlib/langinfo.h deleted file mode 100644 index 9040adeff5e..00000000000 --- a/tools/sdk/include/newlib/langinfo.h +++ /dev/null @@ -1,316 +0,0 @@ -/*- - * Copyright (c) 2001 Alexey Zelkin - * All rights reserved. - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - * - * $FreeBSD: src/include/langinfo.h,v 1.5 2002/03/23 17:24:53 imp Exp $ - */ - -#ifndef _LANGINFO_H_ -#define _LANGINFO_H_ - -#include -#include -#include - -typedef int nl_item; - -enum __nl_item -{ - /* POSIX and BSD defined items have to stick to the original values - to maintain backward compatibility. */ - _NL_CTYPE_CODESET_NAME = 0, /* codeset name */ -#define CODESET _NL_CTYPE_CODESET_NAME - D_T_FMT, /* string for formatting date and time */ -#define D_T_FMT D_T_FMT - D_FMT, /* date format string */ -#define D_FMT D_FMT - T_FMT, /* time format string */ -#define T_FMT T_FMT - T_FMT_AMPM, /* a.m. or p.m. time formatting string */ -#define T_FMT_AMPM T_FMT_AMPM - AM_STR, /* Ante Meridian affix */ -#define AM_STR AM_STR - PM_STR, /* Post Meridian affix */ -#define PM_STR PM_STR - -/* week day names */ - DAY_1, -#define DAY_1 DAY_1 - DAY_2, -#define DAY_2 DAY_2 - DAY_3, -#define DAY_3 DAY_3 - DAY_4, -#define DAY_4 DAY_4 - DAY_5, -#define DAY_5 DAY_5 - DAY_6, -#define DAY_6 DAY_6 - DAY_7, -#define DAY_7 DAY_7 - -/* abbreviated week day names */ - ABDAY_1, -#define ABDAY_1 ABDAY_1 - ABDAY_2, -#define ABDAY_2 ABDAY_2 - ABDAY_3, -#define ABDAY_3 ABDAY_3 - ABDAY_4, -#define ABDAY_4 ABDAY_4 - ABDAY_5, -#define ABDAY_5 ABDAY_5 - ABDAY_6, -#define ABDAY_6 ABDAY_6 - ABDAY_7, -#define ABDAY_7 ABDAY_7 - -/* month names */ - MON_1, -#define MON_1 MON_1 - MON_2, -#define MON_2 MON_2 - MON_3, -#define MON_3 MON_3 - MON_4, -#define MON_4 MON_4 - MON_5, -#define MON_5 MON_5 - MON_6, -#define MON_6 MON_6 - MON_7, -#define MON_7 MON_7 - MON_8, -#define MON_8 MON_8 - MON_9, -#define MON_9 MON_9 - MON_10, -#define MON_10 MON_10 - MON_11, -#define MON_11 MON_11 - MON_12, -#define MON_12 MON_12 - -/* abbreviated month names */ - ABMON_1, -#define ABMON_1 ABMON_1 - ABMON_2, -#define ABMON_2 ABMON_2 - ABMON_3, -#define ABMON_3 ABMON_3 - ABMON_4, -#define ABMON_4 ABMON_4 - ABMON_5, -#define ABMON_5 ABMON_5 - ABMON_6, -#define ABMON_6 ABMON_6 - ABMON_7, -#define ABMON_7 ABMON_7 - ABMON_8, -#define ABMON_8 ABMON_8 - ABMON_9, -#define ABMON_9 ABMON_9 - ABMON_10, -#define ABMON_10 ABMON_10 - ABMON_11, -#define ABMON_11 ABMON_11 - ABMON_12, -#define ABMON_12 ABMON_12 - - ERA, /* era description segments */ -#define ERA ERA - ERA_D_FMT, /* era date format string */ -#define ERA_D_FMT ERA_D_FMT - ERA_D_T_FMT, /* era date and time format string */ -#define ERA_D_T_FMT ERA_D_T_FMT - ERA_T_FMT, /* era time format string */ -#define ERA_T_FMT ERA_T_FMT - ALT_DIGITS, /* alternative symbols for digits */ -#define ALT_DIGITS ALT_DIGITS - - RADIXCHAR, /* radix char */ -#define RADIXCHAR RADIXCHAR - THOUSEP, /* separator for thousands */ -#define THOUSEP THOUSEP - - YESEXPR, /* affirmative response expression */ -#define YESEXPR YESEXPR - NOEXPR, /* negative response expression */ -#define NOEXPR NOEXPR - YESSTR, /* affirmative response for yes/no queries */ -#define YESSTR YESSTR - NOSTR, /* negative response for yes/no queries */ -#define NOSTR NOSTR - - CRNCYSTR, /* currency symbol */ -#define CRNCYSTR CRNCYSTR - - D_MD_ORDER, /* month/day order (BSD extension) */ -#define D_MD_ORDER D_MD_ORDER - - _NL_TIME_DATE_FMT = 84, /* date fmt used by date(1) (GNU extension) */ -#define _DATE_FMT _NL_TIME_DATE_FMT - -#ifdef __HAVE_LOCALE_INFO__ - _NL_CTYPE_MB_CUR_MAX, - _NL_MESSAGES_CODESET, - -#ifdef __HAVE_LOCALE_INFO_EXTENDED__ - - /* NOTE: - - Always maintain the order and position of existing entries! - Always append new entry to the list, prior to the definition - of _NL_LOCALE_EXTENDED_LAST_ENTRY. */ - - _NL_LOCALE_EXTENDED_FIRST_ENTRY, - - _NL_CTYPE_OUTDIGITS0_MB, - _NL_CTYPE_OUTDIGITS1_MB, - _NL_CTYPE_OUTDIGITS2_MB, - _NL_CTYPE_OUTDIGITS3_MB, - _NL_CTYPE_OUTDIGITS4_MB, - _NL_CTYPE_OUTDIGITS5_MB, - _NL_CTYPE_OUTDIGITS6_MB, - _NL_CTYPE_OUTDIGITS7_MB, - _NL_CTYPE_OUTDIGITS8_MB, - _NL_CTYPE_OUTDIGITS9_MB, - _NL_CTYPE_OUTDIGITS0_WC, - _NL_CTYPE_OUTDIGITS1_WC, - _NL_CTYPE_OUTDIGITS2_WC, - _NL_CTYPE_OUTDIGITS3_WC, - _NL_CTYPE_OUTDIGITS4_WC, - _NL_CTYPE_OUTDIGITS5_WC, - _NL_CTYPE_OUTDIGITS6_WC, - _NL_CTYPE_OUTDIGITS7_WC, - _NL_CTYPE_OUTDIGITS8_WC, - _NL_CTYPE_OUTDIGITS9_WC, - - _NL_TIME_CODESET, - _NL_TIME_WMON_1, - _NL_TIME_WMON_2, - _NL_TIME_WMON_3, - _NL_TIME_WMON_4, - _NL_TIME_WMON_5, - _NL_TIME_WMON_6, - _NL_TIME_WMON_7, - _NL_TIME_WMON_8, - _NL_TIME_WMON_9, - _NL_TIME_WMON_10, - _NL_TIME_WMON_11, - _NL_TIME_WMON_12, - _NL_TIME_WMONTH_1, - _NL_TIME_WMONTH_2, - _NL_TIME_WMONTH_3, - _NL_TIME_WMONTH_4, - _NL_TIME_WMONTH_5, - _NL_TIME_WMONTH_6, - _NL_TIME_WMONTH_7, - _NL_TIME_WMONTH_8, - _NL_TIME_WMONTH_9, - _NL_TIME_WMONTH_10, - _NL_TIME_WMONTH_11, - _NL_TIME_WMONTH_12, - _NL_TIME_WWDAY_1, - _NL_TIME_WWDAY_2, - _NL_TIME_WWDAY_3, - _NL_TIME_WWDAY_4, - _NL_TIME_WWDAY_5, - _NL_TIME_WWDAY_6, - _NL_TIME_WWDAY_7, - _NL_TIME_WWEEKDAY_1, - _NL_TIME_WWEEKDAY_2, - _NL_TIME_WWEEKDAY_3, - _NL_TIME_WWEEKDAY_4, - _NL_TIME_WWEEKDAY_5, - _NL_TIME_WWEEKDAY_6, - _NL_TIME_WWEEKDAY_7, - _NL_TIME_WT_FMT, - _NL_TIME_WD_FMT, - _NL_TIME_WD_T_FMT, - _NL_TIME_WAM_STR, - _NL_TIME_WPM_STR, - _NL_TIME_WDATE_FMT, - _NL_TIME_WT_FMT_AMPM, - _NL_TIME_WERA, - _NL_TIME_WERA_D_FMT, - _NL_TIME_WERA_D_T_FMT, - _NL_TIME_WERA_T_FMT, - _NL_TIME_WALT_DIGITS, - - _NL_NUMERIC_CODESET, - _NL_NUMERIC_GROUPING, - _NL_NUMERIC_DECIMAL_POINT_WC, - _NL_NUMERIC_THOUSANDS_SEP_WC, - - _NL_MONETARY_INT_CURR_SYMBOL, - _NL_MONETARY_CURRENCY_SYMBOL, - _NL_MONETARY_MON_DECIMAL_POINT, - _NL_MONETARY_MON_THOUSANDS_SEP, - _NL_MONETARY_MON_GROUPING, - _NL_MONETARY_POSITIVE_SIGN, - _NL_MONETARY_NEGATIVE_SIGN, - _NL_MONETARY_INT_FRAC_DIGITS, - _NL_MONETARY_FRAC_DIGITS, - _NL_MONETARY_P_CS_PRECEDES, - _NL_MONETARY_P_SEP_BY_SPACE, - _NL_MONETARY_N_CS_PRECEDES, - _NL_MONETARY_N_SEP_BY_SPACE, - _NL_MONETARY_P_SIGN_POSN, - _NL_MONETARY_N_SIGN_POSN, - _NL_MONETARY_INT_P_CS_PRECEDES, - _NL_MONETARY_INT_P_SEP_BY_SPACE, - _NL_MONETARY_INT_N_CS_PRECEDES, - _NL_MONETARY_INT_N_SEP_BY_SPACE, - _NL_MONETARY_INT_P_SIGN_POSN, - _NL_MONETARY_INT_N_SIGN_POSN, - _NL_MONETARY_CODESET, - _NL_MONETARY_WINT_CURR_SYMBOL, - _NL_MONETARY_WCURRENCY_SYMBOL, - _NL_MONETARY_WMON_DECIMAL_POINT, - _NL_MONETARY_WMON_THOUSANDS_SEP, - _NL_MONETARY_WPOSITIVE_SIGN, - _NL_MONETARY_WNEGATIVE_SIGN, - - _NL_MESSAGES_WYESEXPR, - _NL_MESSAGES_WNOEXPR, - _NL_MESSAGES_WYESSTR, - _NL_MESSAGES_WNOSTR, - - _NL_COLLATE_CODESET, - - /* This MUST be the last entry since it's used to check for an array - index in nl_langinfo(). */ - _NL_LOCALE_EXTENDED_LAST_ENTRY - -#endif /* __HAVE_LOCALE_INFO_EXTENDED__ */ -#endif /* __HAVE_LOCALE_INFO__ */ - -}; - -__BEGIN_DECLS -char *nl_langinfo(nl_item); -__END_DECLS - -#endif /* !_LANGINFO_H_ */ diff --git a/tools/sdk/include/newlib/libgen.h b/tools/sdk/include/newlib/libgen.h deleted file mode 100644 index abfab0e5c72..00000000000 --- a/tools/sdk/include/newlib/libgen.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * libgen.h - defined by XPG4 - */ - -#ifndef _LIBGEN_H_ -#define _LIBGEN_H_ - -#include "_ansi.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -char *_EXFUN(basename, (char *)); -char *_EXFUN(dirname, (char *)); - -#ifdef __cplusplus -} -#endif - -#endif /* _LIBGEN_H_ */ - diff --git a/tools/sdk/include/newlib/limits.h b/tools/sdk/include/newlib/limits.h deleted file mode 100644 index 633b44593eb..00000000000 --- a/tools/sdk/include/newlib/limits.h +++ /dev/null @@ -1,146 +0,0 @@ -#ifndef _LIBC_LIMITS_H_ -# define _LIBC_LIMITS_H_ 1 - -#include - -# ifdef _MB_LEN_MAX -# define MB_LEN_MAX _MB_LEN_MAX -# else -# define MB_LEN_MAX 1 -# endif - -/* Maximum number of positional arguments, if _WANT_IO_POS_ARGS. */ -# ifndef NL_ARGMAX -# define NL_ARGMAX 32 -# endif - -/* if do not have #include_next support, then we - have to define the limits here. */ -# if !defined __GNUC__ || __GNUC__ < 2 - -# ifndef _LIMITS_H -# define _LIMITS_H 1 - -# include - -/* Number of bits in a `char'. */ -# undef CHAR_BIT -# define CHAR_BIT 8 - -/* Minimum and maximum values a `signed char' can hold. */ -# undef SCHAR_MIN -# define SCHAR_MIN (-128) -# undef SCHAR_MAX -# define SCHAR_MAX 127 - -/* Maximum value an `unsigned char' can hold. (Minimum is 0). */ -# undef UCHAR_MAX -# define UCHAR_MAX 255 - -/* Minimum and maximum values a `char' can hold. */ -# ifdef __CHAR_UNSIGNED__ -# undef CHAR_MIN -# define CHAR_MIN 0 -# undef CHAR_MAX -# define CHAR_MAX 255 -# else -# undef CHAR_MIN -# define CHAR_MIN (-128) -# undef CHAR_MAX -# define CHAR_MAX 127 -# endif - -/* Minimum and maximum values a `signed short int' can hold. */ -# undef SHRT_MIN -/* For the sake of 16 bit hosts, we may not use -32768 */ -# define SHRT_MIN (-32767-1) -# undef SHRT_MAX -# define SHRT_MAX 32767 - -/* Maximum value an `unsigned short int' can hold. (Minimum is 0). */ -# undef USHRT_MAX -# define USHRT_MAX 65535 - -/* Minimum and maximum values a `signed int' can hold. */ -# ifndef __INT_MAX__ -# define __INT_MAX__ 2147483647 -# endif -# undef INT_MIN -# define INT_MIN (-INT_MAX-1) -# undef INT_MAX -# define INT_MAX __INT_MAX__ - -/* Maximum value an `unsigned int' can hold. (Minimum is 0). */ -# undef UINT_MAX -# define UINT_MAX (INT_MAX * 2U + 1) - -/* Minimum and maximum values a `signed long int' can hold. - (Same as `int'). */ -# ifndef __LONG_MAX__ -# if defined (__alpha__) || (defined (__sparc__) && defined(__arch64__)) || defined (__sparcv9) -# define __LONG_MAX__ 9223372036854775807L -# else -# define __LONG_MAX__ 2147483647L -# endif /* __alpha__ || sparc64 */ -# endif -# undef LONG_MIN -# define LONG_MIN (-LONG_MAX-1) -# undef LONG_MAX -# define LONG_MAX __LONG_MAX__ - -/* Maximum value an `unsigned long int' can hold. (Minimum is 0). */ -# undef ULONG_MAX -# define ULONG_MAX (LONG_MAX * 2UL + 1) - -# ifndef __LONG_LONG_MAX__ -# define __LONG_LONG_MAX__ 9223372036854775807LL -# endif - -# if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ - (defined(__cplusplus) && __cplusplus >= 201103L) -/* Minimum and maximum values a `signed long long int' can hold. */ -# undef LLONG_MIN -# define LLONG_MIN (-LLONG_MAX-1) -# undef LLONG_MAX -# define LLONG_MAX __LONG_LONG_MAX__ - -/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */ -# undef ULLONG_MAX -# define ULLONG_MAX (LLONG_MAX * 2ULL + 1) -# endif - -# if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__) -/* Minimum and maximum values a `signed long long int' can hold. */ -# undef LONG_LONG_MIN -# define LONG_LONG_MIN (-LONG_LONG_MAX-1) -# undef LONG_LONG_MAX -# define LONG_LONG_MAX __LONG_LONG_MAX__ - -/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */ -# undef ULONG_LONG_MAX -# define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1) -# endif - -# endif /* _LIMITS_H */ -# endif /* GCC 2. */ - -#endif /* !_LIBC_LIMITS_H_ */ - -#if defined __GNUC__ && !defined _GCC_LIMITS_H_ -/* `_GCC_LIMITS_H_' is what GCC's file defines. */ -# include_next -#endif /* __GNUC__ && !_GCC_LIMITS_H_ */ - -#ifndef _POSIX2_RE_DUP_MAX -/* The maximum number of repeated occurrences of a regular expression - * permitted when using the interval notation `\{M,N\}'. */ -#define _POSIX2_RE_DUP_MAX 255 -#endif /* _POSIX2_RE_DUP_MAX */ - -#ifndef ARG_MAX -#define ARG_MAX 4096 -#endif - -#ifndef PATH_MAX -#define PATH_MAX 1024 -#endif diff --git a/tools/sdk/include/newlib/locale.h b/tools/sdk/include/newlib/locale.h deleted file mode 100644 index cbd658e410c..00000000000 --- a/tools/sdk/include/newlib/locale.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - locale.h - Values appropriate for the formatting of monetary and other - numberic quantities. -*/ - -#ifndef _LOCALE_H_ -#define _LOCALE_H_ - -#include "_ansi.h" - -#define __need_NULL -#include - -#define LC_ALL 0 -#define LC_COLLATE 1 -#define LC_CTYPE 2 -#define LC_MONETARY 3 -#define LC_NUMERIC 4 -#define LC_TIME 5 -#define LC_MESSAGES 6 - -_BEGIN_STD_C - -struct lconv -{ - char *decimal_point; - char *thousands_sep; - char *grouping; - char *int_curr_symbol; - char *currency_symbol; - char *mon_decimal_point; - char *mon_thousands_sep; - char *mon_grouping; - char *positive_sign; - char *negative_sign; - char int_frac_digits; - char frac_digits; - char p_cs_precedes; - char p_sep_by_space; - char n_cs_precedes; - char n_sep_by_space; - char p_sign_posn; - char n_sign_posn; - char int_n_cs_precedes; - char int_n_sep_by_space; - char int_n_sign_posn; - char int_p_cs_precedes; - char int_p_sep_by_space; - char int_p_sign_posn; -}; - -#ifndef _REENT_ONLY -char *_EXFUN(setlocale,(int category, const char *locale)); -struct lconv *_EXFUN(localeconv,(void)); -#endif - -struct _reent; -char *_EXFUN(_setlocale_r,(struct _reent *, int category, const char *locale)); -struct lconv *_EXFUN(_localeconv_r,(struct _reent *)); - -_END_STD_C - -#endif /* _LOCALE_H_ */ diff --git a/tools/sdk/include/newlib/machine/_default_types.h b/tools/sdk/include/newlib/machine/_default_types.h deleted file mode 100644 index 03bdc523e3c..00000000000 --- a/tools/sdk/include/newlib/machine/_default_types.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * _default_types implementation for xtensa lx106 arch - * - * Simplified version of generic _default_types.h, ignores gcc - * built-in standard types. - */ - -#ifndef _MACHINE__DEFAULT_TYPES_H -#define _MACHINE__DEFAULT_TYPES_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef signed char __int8_t ; -typedef unsigned char __uint8_t ; -#define ___int8_t_defined 1 - -typedef signed short __int16_t; -typedef unsigned short __uint16_t; -#define ___int16_t_defined 1 - -typedef signed int __int32_t; -typedef unsigned int __uint32_t; -#define ___int32_t_defined 1 - -typedef signed long long __int64_t; -typedef unsigned long long __uint64_t; -#define ___int64_t_defined 1 - -typedef __int8_t __int_least8_t; -typedef __uint8_t __uint_least8_t; -#define ___int_least8_t_defined - -typedef __int16_t __int_least16_t; -typedef __uint16_t __uint_least16_t; -#define ___int_least16_t_defined - -typedef __int32_t __int_least32_t; -typedef __uint32_t __uint_least32_t; -#define ___int_least32_t_defined - -typedef __int64_t __int_least64_t; -typedef __uint64_t __uint_least64_t; -#define ___int_least64_t_defined - -typedef __INTPTR_TYPE__ __intptr_t; -typedef __UINTPTR_TYPE__ __uintptr_t; - -#ifdef __cplusplus -} -#endif - -#endif /* _MACHINE__DEFAULT_TYPES_H */ diff --git a/tools/sdk/include/newlib/machine/_types.h b/tools/sdk/include/newlib/machine/_types.h deleted file mode 100644 index 17e6d51e3da..00000000000 --- a/tools/sdk/include/newlib/machine/_types.h +++ /dev/null @@ -1,8 +0,0 @@ -/* - * $Id$ - */ - -#ifndef _MACHINE__TYPES_H -#define _MACHINE__TYPES_H -#include -#endif diff --git a/tools/sdk/include/newlib/machine/ansi.h b/tools/sdk/include/newlib/machine/ansi.h deleted file mode 100644 index 737b6d06666..00000000000 --- a/tools/sdk/include/newlib/machine/ansi.h +++ /dev/null @@ -1 +0,0 @@ -/* dummy header file to support BSD compiler */ diff --git a/tools/sdk/include/newlib/machine/endian.h b/tools/sdk/include/newlib/machine/endian.h deleted file mode 100644 index 07ebc8f63a3..00000000000 --- a/tools/sdk/include/newlib/machine/endian.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef __MACHINE_ENDIAN_H__ - -#include - -#ifndef BIG_ENDIAN -#define BIG_ENDIAN 4321 -#endif -#ifndef LITTLE_ENDIAN -#define LITTLE_ENDIAN 1234 -#endif - -#ifndef BYTE_ORDER -#if defined(__IEEE_LITTLE_ENDIAN) || defined(__IEEE_BYTES_LITTLE_ENDIAN) -#define BYTE_ORDER LITTLE_ENDIAN -#else -#define BYTE_ORDER BIG_ENDIAN -#endif -#endif - -#endif /* __MACHINE_ENDIAN_H__ */ diff --git a/tools/sdk/include/newlib/machine/fastmath.h b/tools/sdk/include/newlib/machine/fastmath.h deleted file mode 100644 index b13befa228b..00000000000 --- a/tools/sdk/include/newlib/machine/fastmath.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifdef __sysvnecv70_target -double EXFUN(fast_sin,(double)); -double EXFUN(fast_cos,(double)); -double EXFUN(fast_tan,(double)); - -double EXFUN(fast_asin,(double)); -double EXFUN(fast_acos,(double)); -double EXFUN(fast_atan,(double)); - -double EXFUN(fast_sinh,(double)); -double EXFUN(fast_cosh,(double)); -double EXFUN(fast_tanh,(double)); - -double EXFUN(fast_asinh,(double)); -double EXFUN(fast_acosh,(double)); -double EXFUN(fast_atanh,(double)); - -double EXFUN(fast_abs,(double)); -double EXFUN(fast_sqrt,(double)); -double EXFUN(fast_exp2,(double)); -double EXFUN(fast_exp10,(double)); -double EXFUN(fast_expe,(double)); -double EXFUN(fast_log10,(double)); -double EXFUN(fast_log2,(double)); -double EXFUN(fast_loge,(double)); - - -#define sin(x) fast_sin(x) -#define cos(x) fast_cos(x) -#define tan(x) fast_tan(x) -#define asin(x) fast_asin(x) -#define acos(x) fast_acos(x) -#define atan(x) fast_atan(x) -#define sinh(x) fast_sinh(x) -#define cosh(x) fast_cosh(x) -#define tanh(x) fast_tanh(x) -#define asinh(x) fast_asinh(x) -#define acosh(x) fast_acosh(x) -#define atanh(x) fast_atanh(x) -#define abs(x) fast_abs(x) -#define sqrt(x) fast_sqrt(x) -#define exp2(x) fast_exp2(x) -#define exp10(x) fast_exp10(x) -#define expe(x) fast_expe(x) -#define log10(x) fast_log10(x) -#define log2(x) fast_log2(x) -#define loge(x) fast_loge(x) - -#ifdef _HAVE_STDC -/* These functions are in assembler, they really do take floats. This - can only be used with a real ANSI compiler */ - -float EXFUN(fast_sinf,(float)); -float EXFUN(fast_cosf,(float)); -float EXFUN(fast_tanf,(float)); - -float EXFUN(fast_asinf,(float)); -float EXFUN(fast_acosf,(float)); -float EXFUN(fast_atanf,(float)); - -float EXFUN(fast_sinhf,(float)); -float EXFUN(fast_coshf,(float)); -float EXFUN(fast_tanhf,(float)); - -float EXFUN(fast_asinhf,(float)); -float EXFUN(fast_acoshf,(float)); -float EXFUN(fast_atanhf,(float)); - -float EXFUN(fast_absf,(float)); -float EXFUN(fast_sqrtf,(float)); -float EXFUN(fast_exp2f,(float)); -float EXFUN(fast_exp10f,(float)); -float EXFUN(fast_expef,(float)); -float EXFUN(fast_log10f,(float)); -float EXFUN(fast_log2f,(float)); -float EXFUN(fast_logef,(float)); -#define sinf(x) fast_sinf(x) -#define cosf(x) fast_cosf(x) -#define tanf(x) fast_tanf(x) -#define asinf(x) fast_asinf(x) -#define acosf(x) fast_acosf(x) -#define atanf(x) fast_atanf(x) -#define sinhf(x) fast_sinhf(x) -#define coshf(x) fast_coshf(x) -#define tanhf(x) fast_tanhf(x) -#define asinhf(x) fast_asinhf(x) -#define acoshf(x) fast_acoshf(x) -#define atanhf(x) fast_atanhf(x) -#define absf(x) fast_absf(x) -#define sqrtf(x) fast_sqrtf(x) -#define exp2f(x) fast_exp2f(x) -#define exp10f(x) fast_exp10f(x) -#define expef(x) fast_expef(x) -#define log10f(x) fast_log10f(x) -#define log2f(x) fast_log2f(x) -#define logef(x) fast_logef(x) -#endif -/* Override the functions defined in math.h */ -#endif /* __sysvnecv70_target */ - diff --git a/tools/sdk/include/newlib/machine/ieeefp.h b/tools/sdk/include/newlib/machine/ieeefp.h deleted file mode 100644 index f11dc053535..00000000000 --- a/tools/sdk/include/newlib/machine/ieeefp.h +++ /dev/null @@ -1,434 +0,0 @@ -#ifndef __IEEE_BIG_ENDIAN -#ifndef __IEEE_LITTLE_ENDIAN - -/* This file can define macros to choose variations of the IEEE float - format: - - _FLT_LARGEST_EXPONENT_IS_NORMAL - - Defined if the float format uses the largest exponent for finite - numbers rather than NaN and infinity representations. Such a - format cannot represent NaNs or infinities at all, but it's FLT_MAX - is twice the IEEE value. - - _FLT_NO_DENORMALS - - Defined if the float format does not support IEEE denormals. Every - float with a zero exponent is taken to be a zero representation. - - ??? At the moment, there are no equivalent macros above for doubles and - the macros are not fully supported by --enable-newlib-hw-fp. - - __IEEE_BIG_ENDIAN - - Defined if the float format is big endian. This is mutually exclusive - with __IEEE_LITTLE_ENDIAN. - - __IEEE_LITTLE_ENDIAN - - Defined if the float format is little endian. This is mutually exclusive - with __IEEE_BIG_ENDIAN. - - Note that one of __IEEE_BIG_ENDIAN or __IEEE_LITTLE_ENDIAN must be specified for a - platform or error will occur. - - __IEEE_BYTES_LITTLE_ENDIAN - - This flag is used in conjunction with __IEEE_BIG_ENDIAN to describe a situation - whereby multiple words of an IEEE floating point are in big endian order, but the - words themselves are little endian with respect to the bytes. - - _DOUBLE_IS_32BITS - - This is used on platforms that support double by using the 32-bit IEEE - float type. - - _FLOAT_ARG - - This represents what type a float arg is passed as. It is used when the type is - not promoted to double. - -*/ - -#if (defined(__arm__) || defined(__thumb__)) && !defined(__MAVERICK__) -/* ARM traditionally used big-endian words; and within those words the - byte ordering was big or little endian depending upon the target. - Modern floating-point formats are naturally ordered; in this case - __VFP_FP__ will be defined, even if soft-float. */ -#ifdef __VFP_FP__ -# ifdef __ARMEL__ -# define __IEEE_LITTLE_ENDIAN -# else -# define __IEEE_BIG_ENDIAN -# endif -#else -# define __IEEE_BIG_ENDIAN -# ifdef __ARMEL__ -# define __IEEE_BYTES_LITTLE_ENDIAN -# endif -#endif -#endif - -#if defined (__aarch64__) -#if defined (__AARCH64EL__) -#define __IEEE_LITTLE_ENDIAN -#else -#define __IEEE_BIG_ENDIAN -#endif -#endif - -#ifdef __epiphany__ -#define __IEEE_LITTLE_ENDIAN -#define Sudden_Underflow 1 -#endif - -#ifdef __hppa__ -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef __nds32__ -#ifdef __big_endian__ -#define __IEEE_BIG_ENDIAN -#else -#define __IEEE_LITTLE_ENDIAN -#endif -#endif - -#ifdef __SPU__ -#define __IEEE_BIG_ENDIAN - -#define isfinite(__y) \ - (__extension__ ({int __cy; \ - (sizeof (__y) == sizeof (float)) ? (1) : \ - (__cy = fpclassify(__y)) != FP_INFINITE && __cy != FP_NAN;})) - -#define isinf(__x) ((sizeof (__x) == sizeof (float)) ? (0) : __isinfd(__x)) -#define isnan(__x) ((sizeof (__x) == sizeof (float)) ? (0) : __isnand(__x)) - -/* - * Macros for use in ieeefp.h. We can't just define the real ones here - * (like those above) as we have name space issues when this is *not* - * included via generic the ieeefp.h. - */ -#define __ieeefp_isnanf(x) 0 -#define __ieeefp_isinff(x) 0 -#define __ieeefp_finitef(x) 1 -#endif - -#ifdef __sparc__ -#ifdef __LITTLE_ENDIAN_DATA__ -#define __IEEE_LITTLE_ENDIAN -#else -#define __IEEE_BIG_ENDIAN -#endif -#endif - -#if defined(__m68k__) || defined(__mc68000__) -#define __IEEE_BIG_ENDIAN -#endif - -#if defined(__mc68hc11__) || defined(__mc68hc12__) || defined(__mc68hc1x__) -#define __IEEE_BIG_ENDIAN -#ifdef __HAVE_SHORT_DOUBLE__ -# define _DOUBLE_IS_32BITS -#endif -#endif - -#if defined (__H8300__) || defined (__H8300H__) || defined (__H8300S__) || defined (__H8500__) || defined (__H8300SX__) -#define __IEEE_BIG_ENDIAN -#define _FLOAT_ARG float -#define _DOUBLE_IS_32BITS -#endif - -#if defined (__xc16x__) || defined (__xc16xL__) || defined (__xc16xS__) -#define __IEEE_LITTLE_ENDIAN -#define _FLOAT_ARG float -#define _DOUBLE_IS_32BITS -#endif - - -#ifdef __sh__ -#ifdef __LITTLE_ENDIAN__ -#define __IEEE_LITTLE_ENDIAN -#else -#define __IEEE_BIG_ENDIAN -#endif -#if defined(__SH2E__) || defined(__SH3E__) || defined(__SH4_SINGLE_ONLY__) || defined(__SH2A_SINGLE_ONLY__) -#define _DOUBLE_IS_32BITS -#endif -#endif - -#ifdef _AM29K -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef _WIN32 -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifdef __i386__ -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifdef __i960__ -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifdef __lm32__ -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef __M32R__ -#define __IEEE_BIG_ENDIAN -#endif - -#if defined(_C4x) || defined(_C3x) -#define __IEEE_BIG_ENDIAN -#define _DOUBLE_IS_32BITS -#endif - -#ifdef __TMS320C6X__ -#ifdef _BIG_ENDIAN -#define __IEEE_BIG_ENDIAN -#else -#define __IEEE_LITTLE_ENDIAN -#endif -#endif - -#ifdef __TIC80__ -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifdef __MIPSEL__ -#define __IEEE_LITTLE_ENDIAN -#endif -#ifdef __MIPSEB__ -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef __MMIX__ -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef __D30V__ -#define __IEEE_BIG_ENDIAN -#endif - -/* necv70 was __IEEE_LITTLE_ENDIAN. */ - -#ifdef __W65__ -#define __IEEE_LITTLE_ENDIAN -#define _DOUBLE_IS_32BITS -#endif - -#if defined(__Z8001__) || defined(__Z8002__) -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef __m88k__ -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef __mn10300__ -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifdef __mn10200__ -#define __IEEE_LITTLE_ENDIAN -#define _DOUBLE_IS_32BITS -#endif - -#ifdef __v800 -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifdef __v850 -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifdef __D10V__ -#define __IEEE_BIG_ENDIAN -#if __DOUBLE__ == 32 -#define _DOUBLE_IS_32BITS -#endif -#endif - -#ifdef __PPC__ -#if (defined(_BIG_ENDIAN) && _BIG_ENDIAN) || (defined(_AIX) && _AIX) -#define __IEEE_BIG_ENDIAN -#else -#if (defined(_LITTLE_ENDIAN) && _LITTLE_ENDIAN) || (defined(__sun__) && __sun__) || (defined(_WIN32) && _WIN32) -#define __IEEE_LITTLE_ENDIAN -#endif -#endif -#endif - -#ifdef __xstormy16__ -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifdef __arc__ -#ifdef __big_endian__ -#define __IEEE_BIG_ENDIAN -#else -#define __IEEE_LITTLE_ENDIAN -#endif -#endif - -#ifdef __CRX__ -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifdef __fr30__ -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef __mcore__ -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef __mt__ -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef __frv__ -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef __moxie__ -#ifdef __MOXIE_BIG_ENDIAN__ -#define __IEEE_BIG_ENDIAN -#else -#define __IEEE_LITTLE_ENDIAN -#endif -#endif - -#ifdef __ia64__ -#ifdef __BIG_ENDIAN__ -#define __IEEE_BIG_ENDIAN -#else -#define __IEEE_LITTLE_ENDIAN -#endif -#endif - -#ifdef __AVR__ -#define __IEEE_LITTLE_ENDIAN -#define _DOUBLE_IS_32BITS -#endif - -#if defined(__or1k__) || defined(__OR1K__) || defined(__OR1KND__) -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef __IP2K__ -#define __IEEE_BIG_ENDIAN -#define __SMALL_BITFIELDS -#define _DOUBLE_IS_32BITS -#endif - -#ifdef __iq2000__ -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef __MAVERICK__ -#ifdef __ARMEL__ -# define __IEEE_LITTLE_ENDIAN -#else /* must be __ARMEB__ */ -# define __IEEE_BIG_ENDIAN -#endif /* __ARMEL__ */ -#endif /* __MAVERICK__ */ - -#ifdef __m32c__ -#define __IEEE_LITTLE_ENDIAN -#define __SMALL_BITFIELDS -#endif - -#ifdef __CRIS__ -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifdef __BFIN__ -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifdef __x86_64__ -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifdef __mep__ -#ifdef __LITTLE_ENDIAN__ -#define __IEEE_LITTLE_ENDIAN -#else -#define __IEEE_BIG_ENDIAN -#endif -#endif - -#ifdef __MICROBLAZE__ -#ifndef __MICROBLAZEEL__ -#define __IEEE_BIG_ENDIAN -#else -#define __IEEE_LITTLE_ENDIAN -#endif -#endif - -#ifdef __MSP430__ -#define __IEEE_LITTLE_ENDIAN -#define __SMALL_BITFIELDS /* 16 Bit INT */ -#endif - -#ifdef __RL78__ -#define __IEEE_LITTLE_ENDIAN -#define __SMALL_BITFIELDS /* 16 Bit INT */ -#ifndef __RL78_64BIT_DOUBLES__ -#define _DOUBLE_IS_32BITS -#endif -#endif - -#ifdef __RX__ - -#ifdef __RX_BIG_ENDIAN__ -#define __IEEE_BIG_ENDIAN -#else -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifndef __RX_64BIT_DOUBLES__ -#define _DOUBLE_IS_32BITS -#endif - -#ifdef __RX_16BIT_INTS__ -#define __SMALL_BITFIELDS -#endif - -#endif - -#if (defined(__CR16__) || defined(__CR16C__) ||defined(__CR16CP__)) -#define __IEEE_LITTLE_ENDIAN -#define __SMALL_BITFIELDS /* 16 Bit INT */ -#endif - -#ifdef __NIOS2__ -# ifdef __nios2_big_endian__ -# define __IEEE_BIG_ENDIAN -# else -# define __IEEE_LITTLE_ENDIAN -# endif -#endif - -#if (defined(__XTENSA__)) -# ifdef __XTENSA_EB__ -# define __IEEE_BIG_ENDIAN -# else -# define __IEEE_LITTLE_ENDIAN -# endif -#endif - -#ifndef __IEEE_BIG_ENDIAN -#ifndef __IEEE_LITTLE_ENDIAN -#error Endianess not declared!! -#endif /* not __IEEE_LITTLE_ENDIAN */ -#endif /* not __IEEE_BIG_ENDIAN */ - -#endif /* not __IEEE_LITTLE_ENDIAN */ -#endif /* not __IEEE_BIG_ENDIAN */ - diff --git a/tools/sdk/include/newlib/machine/malloc.h b/tools/sdk/include/newlib/machine/malloc.h deleted file mode 100644 index fdada9ed7f2..00000000000 --- a/tools/sdk/include/newlib/machine/malloc.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _MACHMALLOC_H_ -#define _MACHMALLOC_H_ - -/* place holder so platforms may add malloc.h extensions */ - -#endif /* _MACHMALLOC_H_ */ - - diff --git a/tools/sdk/include/newlib/machine/param.h b/tools/sdk/include/newlib/machine/param.h deleted file mode 100644 index bdf8bf70f51..00000000000 --- a/tools/sdk/include/newlib/machine/param.h +++ /dev/null @@ -1 +0,0 @@ -/* Place holder for machine-specific param.h. */ diff --git a/tools/sdk/include/newlib/machine/setjmp-dj.h b/tools/sdk/include/newlib/machine/setjmp-dj.h deleted file mode 100644 index 6ca5e65269f..00000000000 --- a/tools/sdk/include/newlib/machine/setjmp-dj.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 1991 DJ Delorie - * All rights reserved. - * - * Redistribution, modification, and use in source and binary forms is permitted - * provided that the above copyright notice and following paragraph are - * duplicated in all such forms. - * - * This file is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* Modified to use SETJMP_DJ_H rather than SETJMP_H to avoid - conflicting with setjmp.h. Ian Taylor, Cygnus support, April, - 1993. */ - -#ifndef _SETJMP_DJ_H_ -#define _SETJMP_DJ_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { - unsigned long eax; - unsigned long ebx; - unsigned long ecx; - unsigned long edx; - unsigned long esi; - unsigned long edi; - unsigned long ebp; - unsigned long esp; - unsigned long eip; -} jmp_buf[1]; - -extern int setjmp(jmp_buf); -extern void longjmp(jmp_buf, int); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/newlib/machine/setjmp.h b/tools/sdk/include/newlib/machine/setjmp.h deleted file mode 100644 index 9f9d9e49b53..00000000000 --- a/tools/sdk/include/newlib/machine/setjmp.h +++ /dev/null @@ -1,453 +0,0 @@ - -_BEGIN_STD_C - -#if defined(__or1k__) || defined(__or1knd__) -#define _JBLEN 31 /* 32 GPRs - r0 */ -#define _JBTYPE unsigned long -#endif - -#if defined(__arm__) || defined(__thumb__) -/* - * All callee preserved registers: - * v1 - v7, fp, ip, sp, lr, f4, f5, f6, f7 - */ -#define _JBLEN 23 -#endif - -#if defined(__aarch64__) -#define _JBLEN 22 -#define _JBTYPE long long -#endif - -#if defined(__AVR__) -#define _JBLEN 24 -#endif - -#ifdef __sparc__ -/* - * onsstack,sigmask,sp,pc,npc,psr,g1,o0,wbcnt (sigcontext). - * All else recovered by under/over(flow) handling. - */ -#define _JBLEN 13 -#endif - -#ifdef __BFIN__ -#define _JBLEN 40 -#endif - -#ifdef __epiphany__ -/* All callee preserved registers: r4-r10,fp, sp, lr,r15, r32-r39 */ -#define _JBTYPE long long -#define _JBLEN 10 -#endif - -/* necv70 was 9 as well. */ - -#if defined(__m68k__) || defined(__mc68000__) -/* - * onsstack,sigmask,sp,pc,psl,d2-d7,a2-a6, - * fp2-fp7 for 68881. - * All else recovered by under/over(flow) handling. - */ -#define _JBLEN 34 -#endif - -#if defined(__mc68hc11__) || defined(__mc68hc12__) || defined(__mc68hc1x__) -/* - * D, X, Y are not saved. - * Only take into account the pseudo soft registers (max 32). - */ -#define _JBLEN 32 -#endif - -#ifdef __nds32__ -/* 17 words for GPRs, - 1 word for $fpcfg.freg and 30 words for FPUs - Reserved 2 words for aligement-adjustment. When storeing double-precision - floating-point register into memory, the address has to be - double-word-aligned. - Check libc/machine/nds32/setjmp.S for more information. */ -#if __NDS32_EXT_FPU_SP__ || __NDS32_EXT_FPU_DP__ -#define _JBLEN 50 -#else -#define _JBLEN 18 -#endif -#endif - -#if defined(__Z8001__) || defined(__Z8002__) -/* 16 regs + pc */ -#define _JBLEN 20 -#endif - -#ifdef _AM29K -/* - * onsstack,sigmask,sp,pc,npc,psr,g1,o0,wbcnt (sigcontext). - * All else recovered by under/over(flow) handling. - */ -#define _JBLEN 9 -#endif - -#ifdef __i386__ -# if defined(__CYGWIN__) && !defined (_JBLEN) -# define _JBLEN (13 * 4) -# elif defined(__unix__) || defined(__rtems__) -# define _JBLEN 9 -# else -# include "setjmp-dj.h" -# endif -#endif - -#ifdef __x86_64__ -# ifdef __CYGWIN__ -# define _JBTYPE long -# define _JBLEN 32 -# else -# define _JBTYPE long long -# define _JBLEN 8 -# endif -#endif - -#ifdef __i960__ -#define _JBLEN 35 -#endif - -#ifdef __M32R__ -/* Only 8 words are currently needed. 10 gives us some slop if we need - to expand. */ -#define _JBLEN 10 -#endif - -#ifdef __mips__ -# if defined(__mips64) -# define _JBTYPE long long -# endif -# ifdef __mips_soft_float -# define _JBLEN 11 -# else -# define _JBLEN 23 -# endif -#endif - -#ifdef __m88000__ -#define _JBLEN 21 -#endif - -#ifdef __H8300__ -#define _JBLEN 5 -#define _JBTYPE int -#endif - -#ifdef __H8300H__ -/* same as H8/300 but registers are twice as big */ -#define _JBLEN 5 -#define _JBTYPE long -#endif - -#if defined (__H8300S__) || defined (__H8300SX__) -/* same as H8/300 but registers are twice as big */ -#define _JBLEN 5 -#define _JBTYPE long -#endif - -#ifdef __H8500__ -#define _JBLEN 4 -#endif - -#ifdef __sh__ -#if __SH5__ -#define _JBLEN 50 -#define _JBTYPE long long -#else -#define _JBLEN 20 -#endif /* __SH5__ */ -#endif - -#ifdef __v800 -#define _JBLEN 28 -#endif - -#ifdef __PPC__ -#ifdef __ALTIVEC__ -#define _JBLEN 64 -#else -#define _JBLEN 32 -#endif -#define _JBTYPE double -#endif - -#ifdef __MICROBLAZE__ -#define _JBLEN 20 -#define _JBTYPE unsigned int -#endif - -#ifdef __hppa__ -/* %r30, %r2-%r18, %r27, pad, %fr12-%fr15. - Note space exists for the FP registers, but they are not - saved. */ -#define _JBLEN 28 -#endif - -#if defined(__mn10300__) || defined(__mn10200__) -#ifdef __AM33_2__ -#define _JBLEN 26 -#else -/* A guess */ -#define _JBLEN 10 -#endif -#endif - -#ifdef __v850 -/* I think our setjmp is saving 15 regs at the moment. Gives us one word - slop if we need to expand. */ -#define _JBLEN 16 -#endif - -#if defined(_C4x) -#define _JBLEN 10 -#endif -#if defined(_C3x) -#define _JBLEN 9 -#endif - -#ifdef __TMS320C6X__ -#define _JBLEN 13 -#endif - -#ifdef __TIC80__ -#define _JBLEN 13 -#endif - -#ifdef __D10V__ -#define _JBLEN 8 -#endif - -#ifdef __D30V__ -#define _JBLEN ((64 /* GPR */ + (2*2) /* ACs */ + 18 /* CRs */) / 2) -#define _JBTYPE double -#endif - -#ifdef __frv__ -#define _JBLEN (68/2) /* room for 68 32-bit regs */ -#define _JBTYPE double -#endif - -#ifdef __moxie__ -#define _JBLEN 16 -#endif - -#ifdef __CRX__ -#define _JBLEN 9 -#endif - -#if (defined(__CR16__) || defined(__CR16C__) ||defined(__CR16CP__)) -/* r6, r7, r8, r9, r10, r11, r12 (r12L, r12H), - * r13 (r13L, r13H), ra(raL, raH), sp(spL, spH) */ -#define _JBLEN 14 -#define _JBTYPE unsigned short -#endif - -#ifdef __fr30__ -#define _JBLEN 10 -#endif - -#ifdef __iq2000__ -#define _JBLEN 32 -#endif - -#ifdef __mcore__ -#define _JBLEN 16 -#endif - -#ifdef __MMIX__ -/* Using a layout compatible with GCC's built-in. */ -#define _JBLEN 5 -#define _JBTYPE unsigned long -#endif - -#ifdef __mt__ -#define _JBLEN 16 -#endif - -#ifdef __SPU__ -#define _JBLEN 50 -#define _JBTYPE __vector signed int -#endif - -#ifdef __xstormy16__ -/* 4 GPRs plus SP plus PC. */ -#define _JBLEN 8 -#endif - -#ifdef __XTENSA__ -#if __XTENSA_WINDOWED_ABI__ - -/* The jmp_buf structure for Xtensa windowed ABI holds the following - (where "proc" is the procedure that calls setjmp): 4-12 registers - from the window of proc, the 4 words from the save area at proc's $sp - (in case a subsequent alloca in proc moves $sp), and the return - address within proc. Everything else is saved on the stack in the - normal save areas. The jmp_buf structure is: - - struct jmp_buf { - int regs[12]; - int save[4]; - void *return_address; - } - - See the setjmp code for details. */ - -#define _JBLEN 17 /* 12 + 4 + 1 */ - -#else /* __XTENSA_CALL0_ABI__ */ - -#define _JBLEN 6 /* a0, a1, a12, a13, a14, a15 */ - -#endif /* __XTENSA_CALL0_ABI__ */ -#endif /* __XTENSA__ */ - -#ifdef __mep__ -/* 16 GPRs, pc, hi, lo */ -#define _JBLEN 19 -#endif - -#ifdef __CRIS__ -#define _JBLEN 18 -#endif - -#ifdef __lm32__ -#define _JBLEN 19 -#endif - -#ifdef __m32c__ -#if defined(__r8c_cpu__) || defined(__m16c_cpu__) -#define _JBLEN (22/2) -#else -#define _JBLEN (34/2) -#endif -#define _JBTYPE unsigned short -#endif /* __m32c__ */ - -#ifdef __MSP430__ -#define _JBLEN 9 - -#ifdef __MSP430X_LARGE__ -#define _JBTYPE unsigned long -#else -#define _JBTYPE unsigned short -#endif -#endif - -#ifdef __RL78__ -/* Three banks of registers, SP, CS, ES, PC */ -#define _JBLEN (8*3+8) -#define _JBTYPE unsigned char -#endif - -/* - * There are two versions of setjmp()/longjmp(): - * 1) Compiler (gcc) built-in versions. - * 2) Function-call versions. - * - * The built-in versions are used most of the time. When used, gcc replaces - * calls to setjmp()/longjmp() with inline assembly code. The built-in - * versions save/restore a variable number of registers. - - * _JBLEN is set to 40 to be ultra-safe with the built-in versions. - * It only needs to be 12 for the function-call versions - * but this data structure is used by both versions. - */ -#ifdef __NIOS2__ -#define _JBLEN 40 -#define _JBTYPE unsigned long -#endif - -#ifdef __RX__ -#define _JBLEN 0x44 -#endif - -#ifdef _JBLEN -#ifdef _JBTYPE -typedef _JBTYPE jmp_buf[_JBLEN]; -#else -typedef int jmp_buf[_JBLEN]; -#endif -#endif - -_END_STD_C - -#if defined(__CYGWIN__) || defined(__rtems__) -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* POSIX sigsetjmp/siglongjmp macros */ -#ifdef _JBTYPE -typedef _JBTYPE sigjmp_buf[_JBLEN+1+((sizeof (_JBTYPE) + sizeof (sigset_t) - 1) - /sizeof (_JBTYPE))]; -#else -typedef int sigjmp_buf[_JBLEN+1+(sizeof (sigset_t)/sizeof (int))]; -#endif - -#define _SAVEMASK _JBLEN -#define _SIGMASK (_JBLEN+1) - -#ifdef __CYGWIN__ -# define _CYGWIN_WORKING_SIGSETJMP -#endif - -#ifdef _POSIX_THREADS -#define __SIGMASK_FUNC pthread_sigmask -#else -#define __SIGMASK_FUNC sigprocmask -#endif - -#if defined(__GNUC__) - -#define sigsetjmp(env, savemask) \ - __extension__ \ - ({ \ - sigjmp_buf *_sjbuf = &(env); \ - ((*_sjbuf)[_SAVEMASK] = savemask,\ - __SIGMASK_FUNC (SIG_SETMASK, 0, (sigset_t *)((*_sjbuf) + _SIGMASK)),\ - setjmp (*_sjbuf)); \ - }) - -#define siglongjmp(env, val) \ - __extension__ \ - ({ \ - sigjmp_buf *_sjbuf = &(env); \ - ((((*_sjbuf)[_SAVEMASK]) ? \ - __SIGMASK_FUNC (SIG_SETMASK, (sigset_t *)((*_sjbuf) + _SIGMASK), 0)\ - : 0), \ - longjmp (*_sjbuf, val)); \ - }) - -#else /* !__GNUC__ */ - -#define sigsetjmp(env, savemask) ((env)[_SAVEMASK] = savemask,\ - __SIGMASK_FUNC (SIG_SETMASK, 0, (sigset_t *) ((env) + _SIGMASK)),\ - setjmp (env)) - -#define siglongjmp(env, val) ((((env)[_SAVEMASK])?\ - __SIGMASK_FUNC (SIG_SETMASK, (sigset_t *) ((env) + _SIGMASK), 0):0),\ - longjmp (env, val)) - -#endif - -/* POSIX _setjmp/_longjmp, maintained for XSI compatibility. These - are equivalent to sigsetjmp/siglongjmp when not saving the signal mask. - New applications should use sigsetjmp/siglongjmp instead. */ -#ifdef __CYGWIN__ -extern void _longjmp(jmp_buf, int); -extern int _setjmp(jmp_buf); -#else -#define _setjmp(env) sigsetjmp ((env), 0) -#define _longjmp(env, val) siglongjmp ((env), (val)) -#endif - -#ifdef __cplusplus -} -#endif -#endif /* __CYGWIN__ or __rtems__ */ diff --git a/tools/sdk/include/newlib/machine/stdlib.h b/tools/sdk/include/newlib/machine/stdlib.h deleted file mode 100644 index fa3f3a1390d..00000000000 --- a/tools/sdk/include/newlib/machine/stdlib.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _MACHSTDLIB_H_ -#define _MACHSTDLIB_H_ - -/* place holder so platforms may add stdlib.h extensions */ - -#endif /* _MACHSTDLIB_H_ */ - - diff --git a/tools/sdk/include/newlib/machine/termios.h b/tools/sdk/include/newlib/machine/termios.h deleted file mode 100644 index 41fd459385c..00000000000 --- a/tools/sdk/include/newlib/machine/termios.h +++ /dev/null @@ -1 +0,0 @@ -#define __MAX_BAUD B4000000 diff --git a/tools/sdk/include/newlib/machine/time.h b/tools/sdk/include/newlib/machine/time.h deleted file mode 100644 index 06e2ccffb15..00000000000 --- a/tools/sdk/include/newlib/machine/time.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef _MACHTIME_H_ -#define _MACHTIME_H_ - -#if defined(__rtems__) -#define _CLOCKS_PER_SEC_ sysconf(_SC_CLK_TCK) -#else /* !__rtems__ */ -#if defined(__aarch64__) || defined(__arm__) || defined(__thumb__) -#define _CLOCKS_PER_SEC_ 100 -#endif -#endif /* !__rtems__ */ - -#ifdef __SPU__ -#include -int nanosleep (const struct timespec *, struct timespec *); -#endif - -#endif /* _MACHTIME_H_ */ - - diff --git a/tools/sdk/include/newlib/machine/types.h b/tools/sdk/include/newlib/machine/types.h deleted file mode 100644 index 40a75faa5bf..00000000000 --- a/tools/sdk/include/newlib/machine/types.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef _MACHTYPES_H_ -#define _MACHTYPES_H_ - -/* - * The following section is RTEMS specific and is needed to more - * closely match the types defined in the BSD machine/types.h. - * This is needed to let the RTEMS/BSD TCP/IP stack compile. - */ -#if defined(__rtems__) -#include -#endif - -#define _CLOCK_T_ unsigned long /* clock() */ -#define _TIME_T_ long /* time() */ -#define _CLOCKID_T_ unsigned long -#define _TIMER_T_ unsigned long - -#ifndef _HAVE_SYSTYPES -typedef long int __off_t; -typedef int __pid_t; -#ifdef __GNUC__ -__extension__ typedef long long int __loff_t; -#else -typedef long int __loff_t; -#endif -#endif - -#endif /* _MACHTYPES_H_ */ - - diff --git a/tools/sdk/include/newlib/malloc.h b/tools/sdk/include/newlib/malloc.h deleted file mode 100644 index 41b5efdc0a1..00000000000 --- a/tools/sdk/include/newlib/malloc.h +++ /dev/null @@ -1,169 +0,0 @@ -/* malloc.h -- header file for memory routines. */ - -#ifndef _INCLUDE_MALLOC_H_ -#define _INCLUDE_MALLOC_H_ - -#include <_ansi.h> -#include - -#define __need_size_t -#include - -/* include any machine-specific extensions */ -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* This version of struct mallinfo must match the one in - libc/stdlib/mallocr.c. */ - -struct mallinfo { - size_t arena; /* total space allocated from system */ - size_t ordblks; /* number of non-inuse chunks */ - size_t smblks; /* unused -- always zero */ - size_t hblks; /* number of mmapped regions */ - size_t hblkhd; /* total space in mmapped regions */ - size_t usmblks; /* unused -- always zero */ - size_t fsmblks; /* unused -- always zero */ - size_t uordblks; /* total allocated space */ - size_t fordblks; /* total non-inuse space */ - size_t keepcost; /* top-most, releasable (via malloc_trim) space */ -}; - -/* The routines. */ - -extern _PTR malloc _PARAMS ((size_t)); -#ifdef __CYGWIN__ -#undef _malloc_r -#define _malloc_r(r, s) malloc (s) -#else -extern _PTR _malloc_r _PARAMS ((struct _reent *, size_t)); -#endif - -extern _VOID free _PARAMS ((_PTR)); -#ifdef __CYGWIN__ -#undef _free_r -#define _free_r(r, p) free (p) -#else -extern _VOID _free_r _PARAMS ((struct _reent *, _PTR)); -#endif - -extern _PTR realloc _PARAMS ((_PTR, size_t)); -#ifdef __CYGWIN__ -#undef _realloc_r -#define _realloc_r(r, p, s) realloc (p, s) -#else -extern _PTR _realloc_r _PARAMS ((struct _reent *, _PTR, size_t)); -#endif - -extern _PTR calloc _PARAMS ((size_t, size_t)); -#ifdef __CYGWIN__ -#undef _calloc_r -#define _calloc_r(r, s1, s2) calloc (s1, s2); -#else -extern _PTR _calloc_r _PARAMS ((struct _reent *, size_t, size_t)); -#endif - -extern _PTR memalign _PARAMS ((size_t, size_t)); -#ifdef __CYGWIN__ -#undef _memalign_r -#define _memalign_r(r, s1, s2) memalign (s1, s2); -#else -extern _PTR _memalign_r _PARAMS ((struct _reent *, size_t, size_t)); -#endif - -extern struct mallinfo mallinfo _PARAMS ((void)); -#ifdef __CYGWIN__ -#undef _mallinfo_r -#define _mallinfo_r(r) mallinfo () -#else -extern struct mallinfo _mallinfo_r _PARAMS ((struct _reent *)); -#endif - -extern void malloc_stats _PARAMS ((void)); -#ifdef __CYGWIN__ -#undef _malloc_stats_r -#define _malloc_stats_r(r) malloc_stats () -#else -extern void _malloc_stats_r _PARAMS ((struct _reent *)); -#endif - -extern int mallopt _PARAMS ((int, int)); -#ifdef __CYGWIN__ -#undef _mallopt_r -#define _mallopt_r(i1, i2) mallopt (i1, i2) -#else -extern int _mallopt_r _PARAMS ((struct _reent *, int, int)); -#endif - -extern size_t malloc_usable_size _PARAMS ((_PTR)); -#ifdef __CYGWIN__ -#undef _malloc_usable_size_r -#define _malloc_usable_size_r(r, p) malloc_usable_size (p) -#else -extern size_t _malloc_usable_size_r _PARAMS ((struct _reent *, _PTR)); -#endif - -/* These aren't too useful on an embedded system, but we define them - anyhow. */ - -extern _PTR valloc _PARAMS ((size_t)); -#ifdef __CYGWIN__ -#undef _valloc_r -#define _valloc_r(r, s) valloc (s) -#else -extern _PTR _valloc_r _PARAMS ((struct _reent *, size_t)); -#endif - -extern _PTR pvalloc _PARAMS ((size_t)); -#ifdef __CYGWIN__ -#undef _pvalloc_r -#define _pvalloc_r(r, s) pvalloc (s) -#else -extern _PTR _pvalloc_r _PARAMS ((struct _reent *, size_t)); -#endif - -extern int malloc_trim _PARAMS ((size_t)); -#ifdef __CYGWIN__ -#undef _malloc_trim_r -#define _malloc_trim_r(r, s) malloc_trim (s) -#else -extern int _malloc_trim_r _PARAMS ((struct _reent *, size_t)); -#endif - -/* A compatibility routine for an earlier version of the allocator. */ - -extern _VOID mstats _PARAMS ((char *)); -#ifdef __CYGWIN__ -#undef _mstats_r -#define _mstats_r(r, p) mstats (p) -#else -extern _VOID _mstats_r _PARAMS ((struct _reent *, char *)); -#endif - -/* SVID2/XPG mallopt options */ - -#define M_MXFAST 1 /* UNUSED in this malloc */ -#define M_NLBLKS 2 /* UNUSED in this malloc */ -#define M_GRAIN 3 /* UNUSED in this malloc */ -#define M_KEEP 4 /* UNUSED in this malloc */ - -/* mallopt options that actually do something */ - -#define M_TRIM_THRESHOLD -1 -#define M_TOP_PAD -2 -#define M_MMAP_THRESHOLD -3 -#define M_MMAP_MAX -4 - -#ifndef __CYGWIN__ -/* Some systems provide this, so do too for compatibility. */ -extern void cfree _PARAMS ((_PTR)); -#endif /* __CYGWIN__ */ - -#ifdef __cplusplus -} -#endif - -#endif /* _INCLUDE_MALLOC_H_ */ diff --git a/tools/sdk/include/newlib/math.h b/tools/sdk/include/newlib/math.h deleted file mode 100644 index d16ce30741d..00000000000 --- a/tools/sdk/include/newlib/math.h +++ /dev/null @@ -1,615 +0,0 @@ -#ifndef _MATH_H_ - -#define _MATH_H_ - -#include -#include -#include "_ansi.h" - -_BEGIN_STD_C - -/* __dmath, __fmath, and __ldmath are only here for backwards compatibility - * in case any code used them. They are no longer used by Newlib, itself, - * other than legacy. */ -union __dmath -{ - double d; - __ULong i[2]; -}; - -union __fmath -{ - float f; - __ULong i[1]; -}; - -#if defined(_HAVE_LONG_DOUBLE) -union __ldmath -{ - long double ld; - __ULong i[4]; -}; -#endif - -/* Natural log of 2 */ -#define _M_LN2 0.693147180559945309417 - -#if __GNUC_PREREQ (3, 3) - /* gcc >= 3.3 implicitly defines builtins for HUGE_VALx values. */ - -# ifndef HUGE_VAL -# define HUGE_VAL (__builtin_huge_val()) -# endif - -# ifndef HUGE_VALF -# define HUGE_VALF (__builtin_huge_valf()) -# endif - -# ifndef HUGE_VALL -# define HUGE_VALL (__builtin_huge_vall()) -# endif - -# ifndef INFINITY -# define INFINITY (__builtin_inff()) -# endif - -# ifndef NAN -# define NAN (__builtin_nanf("")) -# endif - -#else /* !gcc >= 3.3 */ - - /* No builtins. Use fixed defines instead. (All 3 HUGE plus the INFINITY - * and NAN macros are required to be constant expressions. Using a variable-- - * even a static const--does not meet this requirement, as it cannot be - * evaluated at translation time.) - * The infinities are done using numbers that are far in excess of - * something that would be expected to be encountered in a floating-point - * implementation. (A more certain way uses values from float.h, but that is - * avoided because system includes are not supposed to include each other.) - * This method might produce warnings from some compilers. (It does in - * newer GCCs, but not for ones that would hit this #else.) If this happens, - * please report details to the Newlib mailing list. */ - - #ifndef HUGE_VAL - #define HUGE_VAL (1.0e999999999) - #endif - - #ifndef HUGE_VALF - #define HUGE_VALF (1.0e999999999F) - #endif - - #if !defined(HUGE_VALL) && defined(_HAVE_LONG_DOUBLE) - #define HUGE_VALL (1.0e999999999L) - #endif - - #if !defined(INFINITY) - #define INFINITY (HUGE_VALF) - #endif - - #if !defined(NAN) - #if defined(__GNUC__) && defined(__cplusplus) - /* Exception: older g++ versions warn about the divide by 0 used in the - * normal case (even though older gccs do not). This trick suppresses the - * warning, but causes errors for plain gcc, so is only used in the one - * special case. */ - static const union { __ULong __i[1]; float __d; } __Nanf = {0x7FC00000}; - #define NAN (__Nanf.__d) - #else - #define NAN (0.0F/0.0F) - #endif - #endif - -#endif /* !gcc >= 3.3 */ - -/* Reentrant ANSI C functions. */ - -#ifndef __math_68881 -extern double atan _PARAMS((double)); -extern double cos _PARAMS((double)); -extern double sin _PARAMS((double)); -extern double tan _PARAMS((double)); -extern double tanh _PARAMS((double)); -extern double frexp _PARAMS((double, int *)); -extern double modf _PARAMS((double, double *)); -extern double ceil _PARAMS((double)); -extern double fabs _PARAMS((double)); -extern double floor _PARAMS((double)); -#endif /* ! defined (__math_68881) */ - -/* Non reentrant ANSI C functions. */ - -#ifndef _REENT_ONLY -#ifndef __math_68881 -extern double acos _PARAMS((double)); -extern double asin _PARAMS((double)); -extern double atan2 _PARAMS((double, double)); -extern double cosh _PARAMS((double)); -extern double sinh _PARAMS((double)); -extern double exp _PARAMS((double)); -extern double ldexp _PARAMS((double, int)); -extern double log _PARAMS((double)); -extern double log10 _PARAMS((double)); -extern double pow _PARAMS((double, double)); -extern double sqrt _PARAMS((double)); -extern double fmod _PARAMS((double, double)); -#endif /* ! defined (__math_68881) */ -#endif /* ! defined (_REENT_ONLY) */ - -#if !defined(__STRICT_ANSI__) || defined(__cplusplus) || \ - (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) - -/* ISO C99 types and macros. */ - -/* FIXME: FLT_EVAL_METHOD should somehow be gotten from float.h (which is hard, - * considering that the standard says the includes it defines should not - * include other includes that it defines) and that value used. (This can be - * solved, but autoconf has a bug which makes the solution more difficult, so - * it has been skipped for now.) */ -#if !defined(FLT_EVAL_METHOD) && defined(__FLT_EVAL_METHOD__) - #define FLT_EVAL_METHOD __FLT_EVAL_METHOD__ - #define __TMP_FLT_EVAL_METHOD -#endif /* FLT_EVAL_METHOD */ -#if defined FLT_EVAL_METHOD - #if FLT_EVAL_METHOD == 0 - typedef float float_t; - typedef double double_t; - #elif FLT_EVAL_METHOD == 1 - typedef double float_t; - typedef double double_t; - #elif FLT_EVAL_METHOD == 2 - typedef long double float_t; - typedef long double double_t; - #else - /* Implementation-defined. Assume float_t and double_t have been - * defined previously for this configuration (e.g. config.h). */ - #endif -#else - /* Assume basic definitions. */ - typedef float float_t; - typedef double double_t; -#endif -#if defined(__TMP_FLT_EVAL_METHOD) - #undef FLT_EVAL_METHOD -#endif - -#define FP_NAN 0 -#define FP_INFINITE 1 -#define FP_ZERO 2 -#define FP_SUBNORMAL 3 -#define FP_NORMAL 4 - -#ifndef FP_ILOGB0 -# define FP_ILOGB0 (-INT_MAX) -#endif -#ifndef FP_ILOGBNAN -# define FP_ILOGBNAN INT_MAX -#endif - -#ifndef MATH_ERRNO -# define MATH_ERRNO 1 -#endif -#ifndef MATH_ERREXCEPT -# define MATH_ERREXCEPT 2 -#endif -#ifndef math_errhandling -# define math_errhandling MATH_ERRNO -#endif - -extern int __isinff (float x); -extern int __isinfd (double x); -extern int __isnanf (float x); -extern int __isnand (double x); -extern int __fpclassifyf (float x); -extern int __fpclassifyd (double x); -extern int __signbitf (float x); -extern int __signbitd (double x); - -#define fpclassify(__x) \ - ((sizeof(__x) == sizeof(float)) ? __fpclassifyf(__x) : \ - __fpclassifyd(__x)) - -#ifndef isfinite - #define isfinite(__y) \ - (__extension__ ({int __cy = fpclassify(__y); \ - __cy != FP_INFINITE && __cy != FP_NAN;})) -#endif - -/* Note: isinf and isnan were once functions in newlib that took double - * arguments. C99 specifies that these names are reserved for macros - * supporting multiple floating point types. Thus, they are - * now defined as macros. Implementations of the old functions - * taking double arguments still exist for compatibility purposes - * (prototypes for them are in ). */ -#ifndef isinf - #define isinf(y) (fpclassify(y) == FP_INFINITE) -#endif - -#ifndef isnan - #define isnan(y) (fpclassify(y) == FP_NAN) -#endif - -#define isnormal(y) (fpclassify(y) == FP_NORMAL) -#define signbit(__x) \ - ((sizeof(__x) == sizeof(float)) ? __signbitf(__x) : \ - __signbitd(__x)) - -#define isgreater(x,y) \ - (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ - !isunordered(__x,__y) && (__x > __y);})) -#define isgreaterequal(x,y) \ - (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ - !isunordered(__x,__y) && (__x >= __y);})) -#define isless(x,y) \ - (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ - !isunordered(__x,__y) && (__x < __y);})) -#define islessequal(x,y) \ - (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ - !isunordered(__x,__y) && (__x <= __y);})) -#define islessgreater(x,y) \ - (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ - !isunordered(__x,__y) && (__x < __y || __x > __y);})) - -#define isunordered(a,b) \ - (__extension__ ({__typeof__(a) __a = (a); __typeof__(b) __b = (b); \ - fpclassify(__a) == FP_NAN || fpclassify(__b) == FP_NAN;})) - -/* Non ANSI double precision functions. */ - -extern double infinity _PARAMS((void)); -extern double nan _PARAMS((const char *)); -extern int finite _PARAMS((double)); -extern double copysign _PARAMS((double, double)); -extern double logb _PARAMS((double)); -extern int ilogb _PARAMS((double)); - -extern double asinh _PARAMS((double)); -extern double cbrt _PARAMS((double)); -extern double nextafter _PARAMS((double, double)); -extern double rint _PARAMS((double)); -extern double scalbn _PARAMS((double, int)); - -extern double exp2 _PARAMS((double)); -extern double scalbln _PARAMS((double, long int)); -extern double tgamma _PARAMS((double)); -extern double nearbyint _PARAMS((double)); -extern long int lrint _PARAMS((double)); -extern long long int llrint _PARAMS((double)); -extern double round _PARAMS((double)); -extern long int lround _PARAMS((double)); -extern long long int llround _PARAMS((double)); -extern double trunc _PARAMS((double)); -extern double remquo _PARAMS((double, double, int *)); -extern double fdim _PARAMS((double, double)); -extern double fmax _PARAMS((double, double)); -extern double fmin _PARAMS((double, double)); -extern double fma _PARAMS((double, double, double)); - -#ifndef __math_68881 -extern double log1p _PARAMS((double)); -extern double expm1 _PARAMS((double)); -#endif /* ! defined (__math_68881) */ - -#ifndef _REENT_ONLY -extern double acosh _PARAMS((double)); -extern double atanh _PARAMS((double)); -extern double remainder _PARAMS((double, double)); -extern double gamma _PARAMS((double)); -extern double lgamma _PARAMS((double)); -extern double erf _PARAMS((double)); -extern double erfc _PARAMS((double)); -extern double log2 _PARAMS((double)); -#if !defined(__cplusplus) -#define log2(x) (log (x) / _M_LN2) -#endif - -#ifndef __math_68881 -extern double hypot _PARAMS((double, double)); -#endif - -#endif /* ! defined (_REENT_ONLY) */ - -/* Single precision versions of ANSI functions. */ - -extern float atanf _PARAMS((float)); -extern float cosf _PARAMS((float)); -extern float sinf _PARAMS((float)); -extern float tanf _PARAMS((float)); -extern float tanhf _PARAMS((float)); -extern float frexpf _PARAMS((float, int *)); -extern float modff _PARAMS((float, float *)); -extern float ceilf _PARAMS((float)); -extern float fabsf _PARAMS((float)); -extern float floorf _PARAMS((float)); - -#ifndef _REENT_ONLY -extern float acosf _PARAMS((float)); -extern float asinf _PARAMS((float)); -extern float atan2f _PARAMS((float, float)); -extern float coshf _PARAMS((float)); -extern float sinhf _PARAMS((float)); -extern float expf _PARAMS((float)); -extern float ldexpf _PARAMS((float, int)); -extern float logf _PARAMS((float)); -extern float log10f _PARAMS((float)); -extern float powf _PARAMS((float, float)); -extern float sqrtf _PARAMS((float)); -extern float fmodf _PARAMS((float, float)); -#endif /* ! defined (_REENT_ONLY) */ - -/* Other single precision functions. */ - -extern float exp2f _PARAMS((float)); -extern float scalblnf _PARAMS((float, long int)); -extern float tgammaf _PARAMS((float)); -extern float nearbyintf _PARAMS((float)); -extern long int lrintf _PARAMS((float)); -extern long long int llrintf _PARAMS((float)); -extern float roundf _PARAMS((float)); -extern long int lroundf _PARAMS((float)); -extern long long int llroundf _PARAMS((float)); -extern float truncf _PARAMS((float)); -extern float remquof _PARAMS((float, float, int *)); -extern float fdimf _PARAMS((float, float)); -extern float fmaxf _PARAMS((float, float)); -extern float fminf _PARAMS((float, float)); -extern float fmaf _PARAMS((float, float, float)); - -extern float infinityf _PARAMS((void)); -extern float nanf _PARAMS((const char *)); -extern int finitef _PARAMS((float)); -extern float copysignf _PARAMS((float, float)); -extern float logbf _PARAMS((float)); -extern int ilogbf _PARAMS((float)); - -extern float asinhf _PARAMS((float)); -extern float cbrtf _PARAMS((float)); -extern float nextafterf _PARAMS((float, float)); -extern float rintf _PARAMS((float)); -extern float scalbnf _PARAMS((float, int)); -extern float log1pf _PARAMS((float)); -extern float expm1f _PARAMS((float)); - -#ifndef _REENT_ONLY -extern float acoshf _PARAMS((float)); -extern float atanhf _PARAMS((float)); -extern float remainderf _PARAMS((float, float)); -extern float gammaf _PARAMS((float)); -extern float lgammaf _PARAMS((float)); -extern float erff _PARAMS((float)); -extern float erfcf _PARAMS((float)); -extern float log2f _PARAMS((float)); -extern float hypotf _PARAMS((float, float)); -#endif /* ! defined (_REENT_ONLY) */ - -/* On platforms where long double equals double. */ -#ifdef _LDBL_EQ_DBL -/* Reentrant ANSI C functions. */ -#ifndef __math_68881 -extern long double atanl _PARAMS((long double)); -extern long double cosl _PARAMS((long double)); -extern long double sinl _PARAMS((long double)); -extern long double tanl _PARAMS((long double)); -extern long double tanhl _PARAMS((long double)); -extern long double frexpl _PARAMS((long double, int *)); -extern long double modfl _PARAMS((long double, long double *)); -extern long double ceill _PARAMS((long double)); -extern long double fabsl _PARAMS((long double)); -extern long double floorl _PARAMS((long double)); -extern long double log1pl _PARAMS((long double)); -extern long double expm1l _PARAMS((long double)); -#endif /* ! defined (__math_68881) */ -/* Non reentrant ANSI C functions. */ -#ifndef _REENT_ONLY -#ifndef __math_68881 -extern long double acosl _PARAMS((long double)); -extern long double asinl _PARAMS((long double)); -extern long double atan2l _PARAMS((long double, long double)); -extern long double coshl _PARAMS((long double)); -extern long double sinhl _PARAMS((long double)); -extern long double expl _PARAMS((long double)); -extern long double ldexpl _PARAMS((long double, int)); -extern long double logl _PARAMS((long double)); -extern long double log10l _PARAMS((long double)); -extern long double powl _PARAMS((long double, long double)); -extern long double sqrtl _PARAMS((long double)); -extern long double fmodl _PARAMS((long double, long double)); -extern long double hypotl _PARAMS((long double, long double)); -#endif /* ! defined (__math_68881) */ -#endif /* ! defined (_REENT_ONLY) */ -extern long double copysignl _PARAMS((long double, long double)); -extern long double nanl _PARAMS((const char *)); -extern int ilogbl _PARAMS((long double)); -extern long double asinhl _PARAMS((long double)); -extern long double cbrtl _PARAMS((long double)); -extern long double nextafterl _PARAMS((long double, long double)); -extern float nexttowardf _PARAMS((float, long double)); -extern double nexttoward _PARAMS((double, long double)); -extern long double nexttowardl _PARAMS((long double, long double)); -extern long double logbl _PARAMS((long double)); -extern long double log2l _PARAMS((long double)); -extern long double rintl _PARAMS((long double)); -extern long double scalbnl _PARAMS((long double, int)); -extern long double exp2l _PARAMS((long double)); -extern long double scalblnl _PARAMS((long double, long)); -extern long double tgammal _PARAMS((long double)); -extern long double nearbyintl _PARAMS((long double)); -extern long int lrintl _PARAMS((long double)); -extern long long int llrintl _PARAMS((long double)); -extern long double roundl _PARAMS((long double)); -extern long lroundl _PARAMS((long double)); -extern long long int llroundl _PARAMS((long double)); -extern long double truncl _PARAMS((long double)); -extern long double remquol _PARAMS((long double, long double, int *)); -extern long double fdiml _PARAMS((long double, long double)); -extern long double fmaxl _PARAMS((long double, long double)); -extern long double fminl _PARAMS((long double, long double)); -extern long double fmal _PARAMS((long double, long double, long double)); -#ifndef _REENT_ONLY -extern long double acoshl _PARAMS((long double)); -extern long double atanhl _PARAMS((long double)); -extern long double remainderl _PARAMS((long double, long double)); -extern long double lgammal _PARAMS((long double)); -extern long double erfl _PARAMS((long double)); -extern long double erfcl _PARAMS((long double)); -#endif /* ! defined (_REENT_ONLY) */ -#else /* !_LDBL_EQ_DBL */ -#ifdef __i386__ -/* Other long double precision functions. */ -extern _LONG_DOUBLE rintl _PARAMS((_LONG_DOUBLE)); -extern long int lrintl _PARAMS((_LONG_DOUBLE)); -extern long long int llrintl _PARAMS((_LONG_DOUBLE)); -#endif /* __i386__ */ -#endif /* !_LDBL_EQ_DBL */ - -#endif /* !defined (__STRICT_ANSI__) || defined(__cplusplus) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) */ - -#if !defined (__STRICT_ANSI__) || defined(__cplusplus) - -extern double drem _PARAMS((double, double)); -extern void sincos _PARAMS((double, double *, double *)); -extern double gamma_r _PARAMS((double, int *)); -extern double lgamma_r _PARAMS((double, int *)); - -extern double y0 _PARAMS((double)); -extern double y1 _PARAMS((double)); -extern double yn _PARAMS((int, double)); -extern double j0 _PARAMS((double)); -extern double j1 _PARAMS((double)); -extern double jn _PARAMS((int, double)); - -extern float dremf _PARAMS((float, float)); -extern void sincosf _PARAMS((float, float *, float *)); -extern float gammaf_r _PARAMS((float, int *)); -extern float lgammaf_r _PARAMS((float, int *)); - -extern float y0f _PARAMS((float)); -extern float y1f _PARAMS((float)); -extern float ynf _PARAMS((int, float)); -extern float j0f _PARAMS((float)); -extern float j1f _PARAMS((float)); -extern float jnf _PARAMS((int, float)); - -/* GNU extensions */ -# ifndef exp10 -extern double exp10 _PARAMS((double)); -# endif -# ifndef pow10 -extern double pow10 _PARAMS((double)); -# endif -# ifndef exp10f -extern float exp10f _PARAMS((float)); -# endif -# ifndef pow10f -extern float pow10f _PARAMS((float)); -# endif - -#endif /* !defined (__STRICT_ANSI__) || defined(__cplusplus) */ - -#ifndef __STRICT_ANSI__ - -/* The gamma functions use a global variable, signgam. */ -#ifndef _REENT_ONLY -#define signgam (*__signgam()) -extern int *__signgam _PARAMS((void)); -#endif /* ! defined (_REENT_ONLY) */ - -#define __signgam_r(ptr) _REENT_SIGNGAM(ptr) - -/* The exception structure passed to the matherr routine. */ -/* We have a problem when using C++ since `exception' is a reserved - name in C++. */ -#ifdef __cplusplus -struct __exception -#else -struct exception -#endif -{ - int type; - char *name; - double arg1; - double arg2; - double retval; - int err; -}; - -#ifdef __cplusplus -extern int matherr _PARAMS((struct __exception *e)); -#else -extern int matherr _PARAMS((struct exception *e)); -#endif - -/* Values for the type field of struct exception. */ - -#define DOMAIN 1 -#define SING 2 -#define OVERFLOW 3 -#define UNDERFLOW 4 -#define TLOSS 5 -#define PLOSS 6 - -#endif /* ! defined (__STRICT_ANSI__) */ - -/* Useful constants. */ - -#if !defined(__STRICT_ANSI__) || ((_XOPEN_SOURCE - 0) >= 500) - -#define MAXFLOAT 3.40282347e+38F - -#define M_E 2.7182818284590452354 -#define M_LOG2E 1.4426950408889634074 -#define M_LOG10E 0.43429448190325182765 -#define M_LN2 _M_LN2 -#define M_LN10 2.30258509299404568402 -#define M_PI 3.14159265358979323846 -#define M_PI_2 1.57079632679489661923 -#define M_PI_4 0.78539816339744830962 -#define M_1_PI 0.31830988618379067154 -#define M_2_PI 0.63661977236758134308 -#define M_2_SQRTPI 1.12837916709551257390 -#define M_SQRT2 1.41421356237309504880 -#define M_SQRT1_2 0.70710678118654752440 - -#endif - -#ifndef __STRICT_ANSI__ - -#define M_TWOPI (M_PI * 2.0) -#define M_3PI_4 2.3561944901923448370E0 -#define M_SQRTPI 1.77245385090551602792981 -#define M_LN2LO 1.9082149292705877000E-10 -#define M_LN2HI 6.9314718036912381649E-1 -#define M_SQRT3 1.73205080756887719000 -#define M_IVLN10 0.43429448190325182765 /* 1 / log(10) */ -#define M_LOG2_E _M_LN2 -#define M_INVLN2 1.4426950408889633870E0 /* 1 / log(2) */ - -/* Global control over fdlibm error handling. */ - -enum __fdlibm_version -{ - __fdlibm_ieee = -1, - __fdlibm_svid, - __fdlibm_xopen, - __fdlibm_posix -}; - -#define _LIB_VERSION_TYPE enum __fdlibm_version -#define _LIB_VERSION __fdlib_version - -extern __IMPORT _LIB_VERSION_TYPE _LIB_VERSION; - -#define _IEEE_ __fdlibm_ieee -#define _SVID_ __fdlibm_svid -#define _XOPEN_ __fdlibm_xopen -#define _POSIX_ __fdlibm_posix - -#endif /* ! defined (__STRICT_ANSI__) */ - -_END_STD_C - -#ifdef __FAST_MATH__ -#include -#endif - -#endif /* _MATH_H_ */ diff --git a/tools/sdk/include/newlib/net/if.h b/tools/sdk/include/newlib/net/if.h deleted file mode 100644 index 8760bb156ee..00000000000 --- a/tools/sdk/include/newlib/net/if.h +++ /dev/null @@ -1,45 +0,0 @@ -// 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. -#ifndef _ESP_PLATFORM_NET_IF_H_ -#define _ESP_PLATFORM_NET_IF_H_ - -#define MSG_DONTROUTE 0x4 /* send without using routing tables */ -#define SOCK_SEQPACKET 5 /* sequenced packet stream */ -#define MSG_EOR 0x8 /* data completes record */ -#define SOCK_SEQPACKET 5 /* sequenced packet stream */ -#define SOMAXCONN 128 - -#define IF_NAMESIZE 16 - -#define IPV6_UNICAST_HOPS 4 /* int; IP6 hops */ - -#define NI_MAXHOST 1025 -#define NI_MAXSERV 32 -#define NI_NUMERICSERV 0x00000008 -#define NI_DGRAM 0x00000010 - - -struct ipv6_mreq { - struct in6_addr ipv6mr_multiaddr; - unsigned int ipv6mr_interface; -}; - -typedef u32_t socklen_t; - - -unsigned int if_nametoindex(const char *ifname); - -char *if_indextoname(unsigned int ifindex, char *ifname); - -#endif // _ESP_PLATFORM_NET_IF_H_ diff --git a/tools/sdk/include/newlib/newlib.h b/tools/sdk/include/newlib/newlib.h deleted file mode 100644 index e9bf5664561..00000000000 --- a/tools/sdk/include/newlib/newlib.h +++ /dev/null @@ -1,201 +0,0 @@ -/* newlib.h. Generated from newlib.hin by configure. */ -/* newlib.hin. Manually edited from the output of autoheader to - remove all PACKAGE_ macros which will collide with any user - package using newlib header files and having its own package name, - version, etc... */ -#ifndef __NEWLIB_H__ - -#define __NEWLIB_H__ 1 - -/* EL/IX level */ -/* #undef _ELIX_LEVEL */ - -/* Newlib version */ -#define _NEWLIB_VERSION "2.2.0" - -/* C99 formats support (such as %a, %zu, ...) in IO functions like - * printf/scanf enabled */ -/* #undef _WANT_IO_C99_FORMATS */ - -/* long long type support in IO functions like printf/scanf enabled */ -/* #undef _WANT_IO_LONG_LONG */ - -/* Register application finalization function using atexit. */ -/* #undef _WANT_REGISTER_FINI */ - -/* long double type support in IO functions like printf/scanf enabled */ -/* #undef _WANT_IO_LONG_DOUBLE */ - -/* Positional argument support in printf functions enabled. */ -/* #undef _WANT_IO_POS_ARGS */ - -/* Optional reentrant struct support. Used mostly on platforms with - very restricted storage. */ -#define _WANT_REENT_SMALL 1 - -/* Multibyte supported */ -/* #undef _MB_CAPABLE */ - -/* MB_LEN_MAX */ -#define _MB_LEN_MAX 1 - -/* ICONV enabled */ -/* #undef _ICONV_ENABLED */ - -/* Enable ICONV external CCS files loading capabilities */ -/* #undef _ICONV_ENABLE_EXTERNAL_CCS */ - -/* Define if the linker supports .preinit_array/.init_array/.fini_array - * sections. */ -#define HAVE_INITFINI_ARRAY 1 - -/* True if atexit() may dynamically allocate space for cleanup - functions. */ -#define _ATEXIT_DYNAMIC_ALLOC 1 - -/* True if long double supported. */ -#define _HAVE_LONG_DOUBLE 1 - -/* Define if compiler supports -fno-tree-loop-distribute-patterns. */ -#define _HAVE_CC_INHIBIT_LOOP_TO_LIBCALL 1 - -/* True if long double supported and it is equal to double. */ -#define _LDBL_EQ_DBL 1 - -/* Define if uintptr_t is unsigned long on this architecture */ -/* #undef _UINTPTR_EQ_ULONG */ - -/* Define if uintptr_t is unsigned long long on this architecture */ -/* #undef _UINTPTR_EQ_ULONGLONG */ - -/* Define if ivo supported in streamio. */ -#define _FVWRITE_IN_STREAMIO 1 - -/* Define if fseek functions support seek optimization. */ -#define _FSEEK_OPTIMIZATION 1 - -/* Define if wide char orientation is supported. */ -#define _WIDE_ORIENT 1 - -/* Define if unbuffered stream file optimization is supported. */ -#define _UNBUF_STREAM_OPT 1 - -/* Define if lite version of exit supported. */ -/* #undef _LITE_EXIT */ - -/* Define if declare atexit data as global. */ -/* #undef _REENT_GLOBAL_ATEXIT */ - -/* Define if small footprint nano-formatted-IO implementation used. */ -#define _NANO_FORMATTED_IO 1 - -/* - * Iconv encodings enabled ("to" direction) - */ -/* #undef _ICONV_TO_ENCODING_BIG5 */ -/* #undef _ICONV_TO_ENCODING_CP775 */ -/* #undef _ICONV_TO_ENCODING_CP850 */ -/* #undef _ICONV_TO_ENCODING_CP852 */ -/* #undef _ICONV_TO_ENCODING_CP855 */ -/* #undef _ICONV_TO_ENCODING_CP866 */ -/* #undef _ICONV_TO_ENCODING_EUC_JP */ -/* #undef _ICONV_TO_ENCODING_EUC_TW */ -/* #undef _ICONV_TO_ENCODING_EUC_KR */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_1 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_10 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_11 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_13 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_14 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_15 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_2 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_3 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_4 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_5 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_6 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_7 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_8 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_9 */ -/* #undef _ICONV_TO_ENCODING_ISO_IR_111 */ -/* #undef _ICONV_TO_ENCODING_KOI8_R */ -/* #undef _ICONV_TO_ENCODING_KOI8_RU */ -/* #undef _ICONV_TO_ENCODING_KOI8_U */ -/* #undef _ICONV_TO_ENCODING_KOI8_UNI */ -/* #undef _ICONV_TO_ENCODING_UCS_2 */ -/* #undef _ICONV_TO_ENCODING_UCS_2_INTERNAL */ -/* #undef _ICONV_TO_ENCODING_UCS_2BE */ -/* #undef _ICONV_TO_ENCODING_UCS_2LE */ -/* #undef _ICONV_TO_ENCODING_UCS_4 */ -/* #undef _ICONV_TO_ENCODING_UCS_4_INTERNAL */ -/* #undef _ICONV_TO_ENCODING_UCS_4BE */ -/* #undef _ICONV_TO_ENCODING_UCS_4LE */ -/* #undef _ICONV_TO_ENCODING_US_ASCII */ -/* #undef _ICONV_TO_ENCODING_UTF_16 */ -/* #undef _ICONV_TO_ENCODING_UTF_16BE */ -/* #undef _ICONV_TO_ENCODING_UTF_16LE */ -/* #undef _ICONV_TO_ENCODING_UTF_8 */ -/* #undef _ICONV_TO_ENCODING_WIN_1250 */ -/* #undef _ICONV_TO_ENCODING_WIN_1251 */ -/* #undef _ICONV_TO_ENCODING_WIN_1252 */ -/* #undef _ICONV_TO_ENCODING_WIN_1253 */ -/* #undef _ICONV_TO_ENCODING_WIN_1254 */ -/* #undef _ICONV_TO_ENCODING_WIN_1255 */ -/* #undef _ICONV_TO_ENCODING_WIN_1256 */ -/* #undef _ICONV_TO_ENCODING_WIN_1257 */ -/* #undef _ICONV_TO_ENCODING_WIN_1258 */ - -/* - * Iconv encodings enabled ("from" direction) - */ -/* #undef _ICONV_FROM_ENCODING_BIG5 */ -/* #undef _ICONV_FROM_ENCODING_CP775 */ -/* #undef _ICONV_FROM_ENCODING_CP850 */ -/* #undef _ICONV_FROM_ENCODING_CP852 */ -/* #undef _ICONV_FROM_ENCODING_CP855 */ -/* #undef _ICONV_FROM_ENCODING_CP866 */ -/* #undef _ICONV_FROM_ENCODING_EUC_JP */ -/* #undef _ICONV_FROM_ENCODING_EUC_TW */ -/* #undef _ICONV_FROM_ENCODING_EUC_KR */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_1 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_10 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_11 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_13 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_14 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_15 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_2 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_3 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_4 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_5 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_6 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_7 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_8 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_9 */ -/* #undef _ICONV_FROM_ENCODING_ISO_IR_111 */ -/* #undef _ICONV_FROM_ENCODING_KOI8_R */ -/* #undef _ICONV_FROM_ENCODING_KOI8_RU */ -/* #undef _ICONV_FROM_ENCODING_KOI8_U */ -/* #undef _ICONV_FROM_ENCODING_KOI8_UNI */ -/* #undef _ICONV_FROM_ENCODING_UCS_2 */ -/* #undef _ICONV_FROM_ENCODING_UCS_2_INTERNAL */ -/* #undef _ICONV_FROM_ENCODING_UCS_2BE */ -/* #undef _ICONV_FROM_ENCODING_UCS_2LE */ -/* #undef _ICONV_FROM_ENCODING_UCS_4 */ -/* #undef _ICONV_FROM_ENCODING_UCS_4_INTERNAL */ -/* #undef _ICONV_FROM_ENCODING_UCS_4BE */ -/* #undef _ICONV_FROM_ENCODING_UCS_4LE */ -/* #undef _ICONV_FROM_ENCODING_US_ASCII */ -/* #undef _ICONV_FROM_ENCODING_UTF_16 */ -/* #undef _ICONV_FROM_ENCODING_UTF_16BE */ -/* #undef _ICONV_FROM_ENCODING_UTF_16LE */ -/* #undef _ICONV_FROM_ENCODING_UTF_8 */ -/* #undef _ICONV_FROM_ENCODING_WIN_1250 */ -/* #undef _ICONV_FROM_ENCODING_WIN_1251 */ -/* #undef _ICONV_FROM_ENCODING_WIN_1252 */ -/* #undef _ICONV_FROM_ENCODING_WIN_1253 */ -/* #undef _ICONV_FROM_ENCODING_WIN_1254 */ -/* #undef _ICONV_FROM_ENCODING_WIN_1255 */ -/* #undef _ICONV_FROM_ENCODING_WIN_1256 */ -/* #undef _ICONV_FROM_ENCODING_WIN_1257 */ -/* #undef _ICONV_FROM_ENCODING_WIN_1258 */ - -#endif /* !__NEWLIB_H__ */ - diff --git a/tools/sdk/include/newlib/paths.h b/tools/sdk/include/newlib/paths.h deleted file mode 100644 index b1c70f588a5..00000000000 --- a/tools/sdk/include/newlib/paths.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _PATHS_H_ -#define _PATHS_H_ - -#define _PATH_DEV "/dev/" -#define _PATH_DEVNULL "/dev/null" -#define _PATH_DEVZERO "/dev/zero" -#define _PATH_BSHELL "/bin/sh" - -#endif /* _PATHS_H_ */ diff --git a/tools/sdk/include/newlib/pthread.h b/tools/sdk/include/newlib/pthread.h deleted file mode 100644 index db1f9c1ca3c..00000000000 --- a/tools/sdk/include/newlib/pthread.h +++ /dev/null @@ -1,431 +0,0 @@ -/* pthread.h - * - * Written by Joel Sherrill . - * - * COPYRIGHT (c) 1989-2013. - * On-Line Applications Research Corporation (OAR). - * - * Permission to use, copy, modify, and distribute this software for any - * purpose without fee is hereby granted, provided that this entire notice - * is included in all copies of any software which is or includes a copy - * or modification of this software. - * - * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTY. IN PARTICULAR, THE AUTHOR MAKES NO REPRESENTATION - * OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS - * SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. - * - * $Id$ - */ - -#ifndef __PTHREAD_h -#define __PTHREAD_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#if defined(_POSIX_THREADS) - -#include -#include -#include -#include - -struct _pthread_cleanup_context { - void (*_routine)(void *); - void *_arg; - int _canceltype; - struct _pthread_cleanup_context *_previous; -}; - -/* Register Fork Handlers */ -int _EXFUN(pthread_atfork,(void (*prepare)(void), void (*parent)(void), - void (*child)(void))); - -/* Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81 */ - -int _EXFUN(pthread_mutexattr_init, (pthread_mutexattr_t *__attr)); -int _EXFUN(pthread_mutexattr_destroy, (pthread_mutexattr_t *__attr)); -int _EXFUN(pthread_mutexattr_getpshared, - (_CONST pthread_mutexattr_t *__attr, int *__pshared)); -int _EXFUN(pthread_mutexattr_setpshared, - (pthread_mutexattr_t *__attr, int __pshared)); - -#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) - -/* Single UNIX Specification 2 Mutex Attributes types */ - -int _EXFUN(pthread_mutexattr_gettype, - (_CONST pthread_mutexattr_t *__attr, int *__kind)); -int _EXFUN(pthread_mutexattr_settype, - (pthread_mutexattr_t *__attr, int __kind)); - -#endif - -/* Initializing and Destroying a Mutex, P1003.1c/Draft 10, p. 87 */ - -int _EXFUN(pthread_mutex_init, - (pthread_mutex_t *__mutex, _CONST pthread_mutexattr_t *__attr)); -int _EXFUN(pthread_mutex_destroy, (pthread_mutex_t *__mutex)); - -/* This is used to statically initialize a pthread_mutex_t. Example: - - pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; - */ - -#define PTHREAD_MUTEX_INITIALIZER ((pthread_mutex_t) 0xFFFFFFFF) - -/* Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93 - NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29 */ - -int _EXFUN(pthread_mutex_lock, (pthread_mutex_t *__mutex)); -int _EXFUN(pthread_mutex_trylock, (pthread_mutex_t *__mutex)); -int _EXFUN(pthread_mutex_unlock, (pthread_mutex_t *__mutex)); - -#if defined(_POSIX_TIMEOUTS) - -int _EXFUN(pthread_mutex_timedlock, - (pthread_mutex_t *__mutex, _CONST struct timespec *__timeout)); - -#endif /* _POSIX_TIMEOUTS */ - -/* Condition Variable Initialization Attributes, P1003.1c/Draft 10, p. 96 */ - -int _EXFUN(pthread_condattr_init, (pthread_condattr_t *__attr)); -int _EXFUN(pthread_condattr_destroy, (pthread_condattr_t *__attr)); -int _EXFUN(pthread_condattr_getpshared, - (_CONST pthread_condattr_t *__attr, int *__pshared)); -int _EXFUN(pthread_condattr_setpshared, - (pthread_condattr_t *__attr, int __pshared)); - -/* Initializing and Destroying a Condition Variable, P1003.1c/Draft 10, p. 87 */ - -int _EXFUN(pthread_cond_init, - (pthread_cond_t *__cond, _CONST pthread_condattr_t *__attr)); -int _EXFUN(pthread_cond_destroy, (pthread_cond_t *__mutex)); - -/* This is used to statically initialize a pthread_cond_t. Example: - - pthread_cond_t cond = PTHREAD_COND_INITIALIZER; - */ - -#define PTHREAD_COND_INITIALIZER ((pthread_cond_t) 0xFFFFFFFF) - -/* Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101 */ - -int _EXFUN(pthread_cond_signal, (pthread_cond_t *__cond)); -int _EXFUN(pthread_cond_broadcast, (pthread_cond_t *__cond)); - -/* Waiting on a Condition, P1003.1c/Draft 10, p. 105 */ - -int _EXFUN(pthread_cond_wait, - (pthread_cond_t *__cond, pthread_mutex_t *__mutex)); - -int _EXFUN(pthread_cond_timedwait, - (pthread_cond_t *__cond, pthread_mutex_t *__mutex, - _CONST struct timespec *__abstime)); - -#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) - -/* Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120 */ - -int _EXFUN(pthread_attr_setscope, - (pthread_attr_t *__attr, int __contentionscope)); -int _EXFUN(pthread_attr_getscope, - (_CONST pthread_attr_t *__attr, int *__contentionscope)); -int _EXFUN(pthread_attr_setinheritsched, - (pthread_attr_t *__attr, int __inheritsched)); -int _EXFUN(pthread_attr_getinheritsched, - (_CONST pthread_attr_t *__attr, int *__inheritsched)); -int _EXFUN(pthread_attr_setschedpolicy, - (pthread_attr_t *__attr, int __policy)); -int _EXFUN(pthread_attr_getschedpolicy, - (_CONST pthread_attr_t *__attr, int *__policy)); - -#endif /* defined(_POSIX_THREAD_PRIORITY_SCHEDULING) */ - -int _EXFUN(pthread_attr_setschedparam, - (pthread_attr_t *__attr, _CONST struct sched_param *__param)); -int _EXFUN(pthread_attr_getschedparam, - (_CONST pthread_attr_t *__attr, struct sched_param *__param)); - -#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) - -/* Dynamic Thread Scheduling Parameters Access, P1003.1c/Draft 10, p. 124 */ - -int _EXFUN(pthread_getschedparam, - (pthread_t __pthread, int *__policy, struct sched_param *__param)); -int _EXFUN(pthread_setschedparam, - (pthread_t __pthread, int __policy, struct sched_param *__param)); - -#endif /* defined(_POSIX_THREAD_PRIORITY_SCHEDULING) */ - -#if defined(_POSIX_THREAD_PRIO_INHERIT) || defined(_POSIX_THREAD_PRIO_PROTECT) - -/* Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128 */ - -int _EXFUN(pthread_mutexattr_setprotocol, - (pthread_mutexattr_t *__attr, int __protocol)); -int _EXFUN(pthread_mutexattr_getprotocol, - (_CONST pthread_mutexattr_t *__attr, int *__protocol)); -int _EXFUN(pthread_mutexattr_setprioceiling, - (pthread_mutexattr_t *__attr, int __prioceiling)); -int _EXFUN(pthread_mutexattr_getprioceiling, - (_CONST pthread_mutexattr_t *__attr, int *__prioceiling)); - -#endif /* _POSIX_THREAD_PRIO_INHERIT || _POSIX_THREAD_PRIO_PROTECT */ - -#if defined(_POSIX_THREAD_PRIO_PROTECT) - -/* Change the Priority Ceiling of a Mutex, P1003.1c/Draft 10, p. 131 */ - -int _EXFUN(pthread_mutex_setprioceiling, - (pthread_mutex_t *__mutex, int __prioceiling, int *__old_ceiling)); -int _EXFUN(pthread_mutex_getprioceiling, - (pthread_mutex_t *__mutex, int *__prioceiling)); - -#endif /* _POSIX_THREAD_PRIO_PROTECT */ - -/* Thread Creation Attributes, P1003.1c/Draft 10, p, 140 */ - -int _EXFUN(pthread_attr_init, (pthread_attr_t *__attr)); -int _EXFUN(pthread_attr_destroy, (pthread_attr_t *__attr)); -int _EXFUN(pthread_attr_setstack, (pthread_attr_t *attr, - void *__stackaddr, size_t __stacksize)); -int _EXFUN(pthread_attr_getstack, (_CONST pthread_attr_t *attr, - void **__stackaddr, size_t *__stacksize)); -int _EXFUN(pthread_attr_getstacksize, - (_CONST pthread_attr_t *__attr, size_t *__stacksize)); -int _EXFUN(pthread_attr_setstacksize, - (pthread_attr_t *__attr, size_t __stacksize)); -int _EXFUN(pthread_attr_getstackaddr, - (_CONST pthread_attr_t *__attr, void **__stackaddr)); -int _EXFUN(pthread_attr_setstackaddr, - (pthread_attr_t *__attr, void *__stackaddr)); -int _EXFUN(pthread_attr_getdetachstate, - (_CONST pthread_attr_t *__attr, int *__detachstate)); -int _EXFUN(pthread_attr_setdetachstate, - (pthread_attr_t *__attr, int __detachstate)); -int _EXFUN(pthread_attr_getguardsize, - (_CONST pthread_attr_t *__attr, size_t *__guardsize)); -int _EXFUN(pthread_attr_setguardsize, - (pthread_attr_t *__attr, size_t __guardsize)); - -/* POSIX thread APIs beyond the POSIX standard but provided - * in GNU/Linux. They may be provided by other OSes for - * compatibility. - */ -#if defined(__GNU_VISIBLE) -#if defined(__rtems__) -int _EXFUN(pthread_attr_setaffinity_np, - (pthread_attr_t *__attr, size_t __cpusetsize, - const cpu_set_t *__cpuset)); -int _EXFUN(pthread_attr_getaffinity_np, - (const pthread_attr_t *__attr, size_t __cpusetsize, - cpu_set_t *__cpuset)); - -int _EXFUN(pthread_setaffinity_np, - (pthread_t __id, size_t __cpusetsize, const cpu_set_t *__cpuset)); -int _EXFUN(pthread_getaffinity_np, - (const pthread_t __id, size_t __cpusetsize, cpu_set_t *__cpuset)); - -int _EXFUN(pthread_getattr_np, - (pthread_t __id, pthread_attr_t *__attr)); -#endif /* defined(__rtems__) */ -#endif /* defined(__GNU_VISIBLE) */ - -/* Thread Creation, P1003.1c/Draft 10, p. 144 */ - -int _EXFUN(pthread_create, - (pthread_t *__pthread, _CONST pthread_attr_t *__attr, - void *(*__start_routine)( void * ), void *__arg)); - -/* Wait for Thread Termination, P1003.1c/Draft 10, p. 147 */ - -int _EXFUN(pthread_join, (pthread_t __pthread, void **__value_ptr)); - -/* Detaching a Thread, P1003.1c/Draft 10, p. 149 */ - -int _EXFUN(pthread_detach, (pthread_t __pthread)); - -/* Thread Termination, p1003.1c/Draft 10, p. 150 */ - -void _EXFUN(pthread_exit, (void *__value_ptr)); - -/* Get Calling Thread's ID, p1003.1c/Draft 10, p. XXX */ - -pthread_t _EXFUN(pthread_self, (void)); - -/* Compare Thread IDs, p1003.1c/Draft 10, p. 153 */ - -int _EXFUN(pthread_equal, (pthread_t __t1, pthread_t __t2)); - -/* Dynamic Package Initialization */ - -/* This is used to statically initialize a pthread_once_t. Example: - - pthread_once_t once = PTHREAD_ONCE_INIT; - - NOTE: This is named inconsistently -- it should be INITIALIZER. */ - -#define PTHREAD_ONCE_INIT { 1, 0 } /* is initialized and not run */ - -int _EXFUN(pthread_once, - (pthread_once_t *__once_control, void (*__init_routine)(void))); - -/* Thread-Specific Data Key Create, P1003.1c/Draft 10, p. 163 */ - -int _EXFUN(pthread_key_create, - (pthread_key_t *__key, void (*__destructor)( void * ))); - -/* Thread-Specific Data Management, P1003.1c/Draft 10, p. 165 */ - -int _EXFUN(pthread_setspecific, - (pthread_key_t __key, _CONST void *__value)); -void * _EXFUN(pthread_getspecific, (pthread_key_t __key)); - -/* Thread-Specific Data Key Deletion, P1003.1c/Draft 10, p. 167 */ - -int _EXFUN(pthread_key_delete, (pthread_key_t __key)); - -/* Execution of a Thread, P1003.1c/Draft 10, p. 181 */ - -#define PTHREAD_CANCEL_ENABLE 0 -#define PTHREAD_CANCEL_DISABLE 1 - -#define PTHREAD_CANCEL_DEFERRED 0 -#define PTHREAD_CANCEL_ASYNCHRONOUS 1 - -#define PTHREAD_CANCELED ((void *) -1) - -int _EXFUN(pthread_cancel, (pthread_t __pthread)); - -/* Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ - -int _EXFUN(pthread_setcancelstate, (int __state, int *__oldstate)); -int _EXFUN(pthread_setcanceltype, (int __type, int *__oldtype)); -void _EXFUN(pthread_testcancel, (void)); - -/* Establishing Cancellation Handlers, P1003.1c/Draft 10, p. 184 */ - -void _EXFUN(_pthread_cleanup_push, - (struct _pthread_cleanup_context *_context, - void (*_routine)(void *), void *_arg)); - -void _EXFUN(_pthread_cleanup_pop, - (struct _pthread_cleanup_context *_context, - int _execute)); - -/* It is intentional to open and close the scope in two different macros */ -#define pthread_cleanup_push(_routine, _arg) \ - do { \ - struct _pthread_cleanup_context _pthread_clup_ctx; \ - _pthread_cleanup_push(&_pthread_clup_ctx, (_routine), (_arg)) - -#define pthread_cleanup_pop(_execute) \ - _pthread_cleanup_pop(&_pthread_clup_ctx, (_execute)); \ - } while (0) - -#if defined(_GNU_SOURCE) -void _EXFUN(_pthread_cleanup_push_defer, - (struct _pthread_cleanup_context *_context, - void (*_routine)(void *), void *_arg)); - -void _EXFUN(_pthread_cleanup_pop_restore, - (struct _pthread_cleanup_context *_context, - int _execute)); - -/* It is intentional to open and close the scope in two different macros */ -#define pthread_cleanup_push_defer_np(_routine, _arg) \ - do { \ - struct _pthread_cleanup_context _pthread_clup_ctx; \ - _pthread_cleanup_push_defer(&_pthread_clup_ctx, (_routine), (_arg)) - -#define pthread_cleanup_pop_restore_np(_execute) \ - _pthread_cleanup_pop_restore(&_pthread_clup_ctx, (_execute)); \ - } while (0) -#endif /* defined(_GNU_SOURCE) */ - -#if defined(_POSIX_THREAD_CPUTIME) - -/* Accessing a Thread CPU-time Clock, P1003.4b/D8, p. 58 */ - -int _EXFUN(pthread_getcpuclockid, - (pthread_t __pthread_id, clockid_t *__clock_id)); - -#endif /* defined(_POSIX_THREAD_CPUTIME) */ - - -#endif /* defined(_POSIX_THREADS) */ - -#if defined(_POSIX_BARRIERS) - -int _EXFUN(pthread_barrierattr_init, (pthread_barrierattr_t *__attr)); -int _EXFUN(pthread_barrierattr_destroy, (pthread_barrierattr_t *__attr)); -int _EXFUN(pthread_barrierattr_getpshared, - (_CONST pthread_barrierattr_t *__attr, int *__pshared)); -int _EXFUN(pthread_barrierattr_setpshared, - (pthread_barrierattr_t *__attr, int __pshared)); - -#define PTHREAD_BARRIER_SERIAL_THREAD -1 - -int _EXFUN(pthread_barrier_init, - (pthread_barrier_t *__barrier, - _CONST pthread_barrierattr_t *__attr, unsigned __count)); -int _EXFUN(pthread_barrier_destroy, (pthread_barrier_t *__barrier)); -int _EXFUN(pthread_barrier_wait,(pthread_barrier_t *__barrier)); - -#endif /* defined(_POSIX_BARRIERS) */ - -#if defined(_POSIX_SPIN_LOCKS) - -int _EXFUN(pthread_spin_init, - (pthread_spinlock_t *__spinlock, int __pshared)); -int _EXFUN(pthread_spin_destroy, (pthread_spinlock_t *__spinlock)); -int _EXFUN(pthread_spin_lock, (pthread_spinlock_t *__spinlock)); -int _EXFUN(pthread_spin_trylock, (pthread_spinlock_t *__spinlock)); -int _EXFUN(pthread_spin_unlock, (pthread_spinlock_t *__spinlock)); - -#endif /* defined(_POSIX_SPIN_LOCKS) */ - -#if defined(_POSIX_READER_WRITER_LOCKS) - -/* This is used to statically initialize a pthread_rwlock_t. Example: - - pthread_mutex_t mutex = PTHREAD_RWLOCK_INITIALIZER; - */ - -#define PTHREAD_RWLOCK_INITIALIZER ((pthread_rwlock_t) 0xFFFFFFFF) - -int _EXFUN(pthread_rwlockattr_init, (pthread_rwlockattr_t *__attr)); -int _EXFUN(pthread_rwlockattr_destroy, (pthread_rwlockattr_t *__attr)); -int _EXFUN(pthread_rwlockattr_getpshared, - (_CONST pthread_rwlockattr_t *__attr, int *__pshared)); -int _EXFUN(pthread_rwlockattr_setpshared, - (pthread_rwlockattr_t *__attr, int __pshared)); - -int _EXFUN(pthread_rwlock_init, - (pthread_rwlock_t *__rwlock, _CONST pthread_rwlockattr_t *__attr)); -int _EXFUN(pthread_rwlock_destroy, (pthread_rwlock_t *__rwlock)); -int _EXFUN(pthread_rwlock_rdlock,(pthread_rwlock_t *__rwlock)); -int _EXFUN(pthread_rwlock_tryrdlock,(pthread_rwlock_t *__rwlock)); -int _EXFUN(pthread_rwlock_timedrdlock, - (pthread_rwlock_t *__rwlock, _CONST struct timespec *__abstime)); -int _EXFUN(pthread_rwlock_unlock,(pthread_rwlock_t *__rwlock)); -int _EXFUN(pthread_rwlock_wrlock,(pthread_rwlock_t *__rwlock)); -int _EXFUN(pthread_rwlock_trywrlock,(pthread_rwlock_t *__rwlock)); -int _EXFUN(pthread_rwlock_timedwrlock, - (pthread_rwlock_t *__rwlock, _CONST struct timespec *__abstime)); - -#endif /* defined(_POSIX_READER_WRITER_LOCKS) */ - - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ diff --git a/tools/sdk/include/newlib/pwd.h b/tools/sdk/include/newlib/pwd.h deleted file mode 100644 index 3dea4ee2d1a..00000000000 --- a/tools/sdk/include/newlib/pwd.h +++ /dev/null @@ -1,87 +0,0 @@ -/*- - * Copyright (c) 1989 The Regents of the University of California. - * All rights reserved. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. - * - * @(#)pwd.h 5.13 (Berkeley) 5/28/91 - */ - -#ifndef _PWD_H_ -#ifdef __cplusplus -extern "C" { -#endif -#define _PWD_H_ - -#include -#include - -#if __BSD_VISIBLE -#define _PATH_PASSWD "/etc/passwd" - -#define _PASSWORD_LEN 128 /* max length, not counting NULL */ -#endif - -struct passwd { - char *pw_name; /* user name */ - char *pw_passwd; /* encrypted password */ - uid_t pw_uid; /* user uid */ - gid_t pw_gid; /* user gid */ - char *pw_comment; /* comment */ - char *pw_gecos; /* Honeywell login info */ - char *pw_dir; /* home directory */ - char *pw_shell; /* default shell */ -}; - -#ifndef __INSIDE_CYGWIN__ -struct passwd *getpwuid (uid_t); -struct passwd *getpwnam (const char *); - -#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 500 -int getpwnam_r (const char *, struct passwd *, - char *, size_t , struct passwd **); -int getpwuid_r (uid_t, struct passwd *, char *, - size_t, struct passwd **); -#endif - -#if __XSI_VISIBLE >= 500 -struct passwd *getpwent (void); -void setpwent (void); -void endpwent (void); -#endif - -#if __BSD_VISIBLE -int setpassent (int); -#endif -#endif /*!__INSIDE_CYGWIN__*/ - -#ifdef __cplusplus -} -#endif -#endif /* _PWD_H_ */ diff --git a/tools/sdk/include/newlib/reent.h b/tools/sdk/include/newlib/reent.h deleted file mode 100644 index 861be71d353..00000000000 --- a/tools/sdk/include/newlib/reent.h +++ /dev/null @@ -1,189 +0,0 @@ -/* This header file provides the reentrancy. */ - -/* The reentrant system calls here serve two purposes: - - 1) Provide reentrant versions of the system calls the ANSI C library - requires. - 2) Provide these system calls in a namespace clean way. - - It is intended that *all* system calls that the ANSI C library needs - be declared here. It documents them all in one place. All library access - to the system is via some form of these functions. - - The target may provide the needed syscalls by any of the following: - - 1) Define the reentrant versions of the syscalls directly. - (eg: _open_r, _close_r, etc.). Please keep the namespace clean. - When you do this, set "syscall_dir" to "syscalls" and add - -DREENTRANT_SYSCALLS_PROVIDED to newlib_cflags in configure.host. - - 2) Define namespace clean versions of the system calls by prefixing - them with '_' (eg: _open, _close, etc.). Technically, there won't be - true reentrancy at the syscall level, but the library will be namespace - clean. - When you do this, set "syscall_dir" to "syscalls" in configure.host. - - 3) Define or otherwise provide the regular versions of the syscalls - (eg: open, close, etc.). The library won't be reentrant nor namespace - clean, but at least it will work. - When you do this, add -DMISSING_SYSCALL_NAMES to newlib_cflags in - configure.host. - - 4) Define or otherwise provide the regular versions of the syscalls, - and do not supply functional interfaces for any of the reentrant - calls. With this method, the reentrant syscalls are redefined to - directly call the regular system call without the reentrancy argument. - When you do this, specify both -DREENTRANT_SYSCALLS_PROVIDED and - -DMISSING_SYSCALL_NAMES via newlib_cflags in configure.host and do - not specify "syscall_dir". - - Stubs of the reentrant versions of the syscalls exist in the libc/reent - source directory and are provided if REENTRANT_SYSCALLS_PROVIDED isn't - defined. These stubs call the native system calls: _open, _close, etc. - if MISSING_SYSCALL_NAMES is *not* defined, otherwise they call the - non-underscored versions: open, close, etc. when MISSING_SYSCALL_NAMES - *is* defined. - - By default, newlib functions call the reentrant syscalls internally, - passing a reentrancy structure as an argument. This reentrancy structure - contains data that is thread-specific. For example, the errno value is - kept in the reentrancy structure. If multiple threads exist, each will - keep a separate errno value which is intuitive since the application flow - cannot check for failure reliably otherwise. - - The reentrant syscalls are either provided by the platform, by the - libc/reent stubs, or in the case of both MISSING_SYSCALL_NAMES and - REENTRANT_SYSCALLS_PROVIDED being defined, the calls are redefined to - simply call the regular syscalls with no reentrancy struct argument. - - A single-threaded application does not need to worry about the reentrancy - structure. It is used internally. - - A multi-threaded application needs either to manually manage reentrancy - structures or use dynamic reentrancy. - - Manually managing reentrancy structures entails calling special reentrant - versions of newlib functions that have an additional reentrancy argument. - For example, _printf_r. By convention, the first argument is the - reentrancy structure. By default, the normal version of the function - uses the default reentrancy structure: _REENT. The reentrancy structure - is passed internally, eventually to the reentrant syscalls themselves. - How the structures are stored and accessed in this model is up to the - application. - - Dynamic reentrancy is specified by the __DYNAMIC_REENT__ flag. This - flag denotes setting up a macro to replace _REENT with a function call - to __getreent(). This function needs to be implemented by the platform - and it is meant to return the reentrancy structure for the current - thread. When the regular C functions (e.g. printf) go to call internal - routines with the default _REENT structure, they end up calling with - the reentrancy structure for the thread. Thus, application code does not - need to call the _r routines nor worry about reentrancy structures. */ - -/* WARNING: All identifiers here must begin with an underscore. This file is - included by stdio.h and others and we therefore must only use identifiers - in the namespace allotted to us. */ - -#ifndef _REENT_H_ -#ifdef __cplusplus -extern "C" { -#endif -#define _REENT_H_ - -#include -#include -#include - -#define __need_size_t -#define __need_ptrdiff_t -#include - -/* FIXME: not namespace clean */ -struct stat; -struct tms; -struct timeval; -struct timezone; - -#if defined(REENTRANT_SYSCALLS_PROVIDED) && defined(MISSING_SYSCALL_NAMES) - -#define _close_r(__reent, __fd) close(__fd) -#define _execve_r(__reent, __f, __arg, __env) execve(__f, __arg, __env) -#define _fcntl_r(__reent, __fd, __cmd, __arg) fcntl(__fd, __cmd, __arg) -#define _fork_r(__reent) fork() -#define _fstat_r(__reent, __fdes, __stat) fstat(__fdes, __stat) -#define _getpid_r(__reent) getpid() -#define _isatty_r(__reent, __desc) isatty(__desc) -#define _kill_r(__reent, __pid, __signal) kill(__pid, __signal) -#define _link_r(__reent, __oldpath, __newpath) link(__oldpath, __newpath) -#define _lseek_r(__reent, __fdes, __off, __w) lseek(__fdes, __off, __w) -#define _mkdir_r(__reent, __path, __m) mkdir(__path, __m) -#define _open_r(__reent, __path, __flag, __m) open(__path, __flag, __m) -#define _read_r(__reent, __fd, __buff, __cnt) read(__fd, __buff, __cnt) -#define _rename_r(__reent, __old, __new) rename(__old, __new) -#define _sbrk_r(__reent, __incr) sbrk(__incr) -#define _stat_r(__reent, __path, __buff) stat(__path, __buff) -#define _times_r(__reent, __time) times(__time) -#define _unlink_r(__reent, __path) unlink(__path) -#define _wait_r(__reent, __status) wait(__status) -#define _write_r(__reent, __fd, __buff, __cnt) write(__fd, __buff, __cnt) -#define _gettimeofday_r(__reent, __tp, __tzp) gettimeofday(__tp, __tzp) - -#ifdef __LARGE64_FILES -#define _lseek64_r(__reent, __fd, __off, __w) lseek64(__fd, __off, __w) -#define _fstat64_r(__reent, __fd, __buff) fstat64(__fd, __buff) -#define _open64_r(__reent, __path, __flag, __m) open64(__path, __flag, __m) -#endif - -#else -/* Reentrant versions of system calls. */ - -extern int _close_r _PARAMS ((struct _reent *, int)); -extern int _execve_r _PARAMS ((struct _reent *, const char *, char *const *, char *const *)); -extern int _fcntl_r _PARAMS ((struct _reent *, int, int, int)); -extern int _fork_r _PARAMS ((struct _reent *)); -extern int _fstat_r _PARAMS ((struct _reent *, int, struct stat *)); -extern int _getpid_r _PARAMS ((struct _reent *)); -extern int _isatty_r _PARAMS ((struct _reent *, int)); -extern int _kill_r _PARAMS ((struct _reent *, int, int)); -extern int _link_r _PARAMS ((struct _reent *, const char *, const char *)); -extern _off_t _lseek_r _PARAMS ((struct _reent *, int, _off_t, int)); -extern int _mkdir_r _PARAMS ((struct _reent *, const char *, int)); -extern int _open_r _PARAMS ((struct _reent *, const char *, int, int)); -extern _ssize_t _read_r _PARAMS ((struct _reent *, int, void *, size_t)); -extern int _rename_r _PARAMS ((struct _reent *, const char *, const char *)); -extern void *_sbrk_r _PARAMS ((struct _reent *, ptrdiff_t)); -extern int _stat_r _PARAMS ((struct _reent *, const char *, struct stat *)); -extern _CLOCK_T_ _times_r _PARAMS ((struct _reent *, struct tms *)); -extern int _unlink_r _PARAMS ((struct _reent *, const char *)); -extern int _wait_r _PARAMS ((struct _reent *, int *)); -extern _ssize_t _write_r _PARAMS ((struct _reent *, int, const void *, size_t)); - -/* This one is not guaranteed to be available on all targets. */ -extern int _gettimeofday_r _PARAMS ((struct _reent *, struct timeval *__tp, void *__tzp)); - -#ifdef __LARGE64_FILES - - -#if defined(__CYGWIN__) -#define stat64 stat -#endif -struct stat64; - -extern _off64_t _lseek64_r _PARAMS ((struct _reent *, int, _off64_t, int)); -extern int _fstat64_r _PARAMS ((struct _reent *, int, struct stat64 *)); -extern int _open64_r _PARAMS ((struct _reent *, const char *, int, int)); -extern int _stat64_r _PARAMS ((struct _reent *, const char *, struct stat64 *)); - -/* Don't pollute namespace if not building newlib. */ -#if defined (__CYGWIN__) && !defined (_COMPILING_NEWLIB) -#undef stat64 -#endif - -#endif - -#endif - -#ifdef __cplusplus -} -#endif -#endif /* _REENT_H_ */ diff --git a/tools/sdk/include/newlib/regdef.h b/tools/sdk/include/newlib/regdef.h deleted file mode 100644 index 8cf144b85f3..00000000000 --- a/tools/sdk/include/newlib/regdef.h +++ /dev/null @@ -1,7 +0,0 @@ -/* regdef.h -- define register names. */ - -/* This is a standard include file for MIPS targets. Other target - probably don't define it, and attempts to include this file will - fail. */ - -#include diff --git a/tools/sdk/include/newlib/regex.h b/tools/sdk/include/newlib/regex.h deleted file mode 100644 index fa3e26879ae..00000000000 --- a/tools/sdk/include/newlib/regex.h +++ /dev/null @@ -1,103 +0,0 @@ -/*- - * Copyright (c) 1992 Henry Spencer. - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Henry Spencer of the University of Toronto. - * - * 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. - * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. - * - * @(#)regex.h 8.2 (Berkeley) 1/3/94 - * $FreeBSD: src/include/regex.h,v 1.4 2002/03/23 17:24:53 imp Exp $ - */ - -#ifndef _REGEX_H_ -#define _REGEX_H_ - -#include - -/* types */ -typedef off_t regoff_t; - -typedef struct { - int re_magic; - size_t re_nsub; /* number of parenthesized subexpressions */ - __const char *re_endp; /* end pointer for REG_PEND */ - struct re_guts *re_g; /* none of your business :-) */ -} regex_t; - -typedef struct { - regoff_t rm_so; /* start of match */ - regoff_t rm_eo; /* end of match */ -} regmatch_t; - -/* regcomp() flags */ -#define REG_BASIC 0000 -#define REG_EXTENDED 0001 -#define REG_ICASE 0002 -#define REG_NOSUB 0004 -#define REG_NEWLINE 0010 -#define REG_NOSPEC 0020 -#define REG_PEND 0040 -#define REG_DUMP 0200 - -/* regerror() flags */ -#define REG_NOMATCH 1 -#define REG_BADPAT 2 -#define REG_ECOLLATE 3 -#define REG_ECTYPE 4 -#define REG_EESCAPE 5 -#define REG_ESUBREG 6 -#define REG_EBRACK 7 -#define REG_EPAREN 8 -#define REG_EBRACE 9 -#define REG_BADBR 10 -#define REG_ERANGE 11 -#define REG_ESPACE 12 -#define REG_BADRPT 13 -#define REG_EMPTY 14 -#define REG_ASSERT 15 -#define REG_INVARG 16 -#define REG_ATOI 255 /* convert name to number (!) */ -#define REG_ITOA 0400 /* convert number to name (!) */ - -/* regexec() flags */ -#define REG_NOTBOL 00001 -#define REG_NOTEOL 00002 -#define REG_STARTEND 00004 -#define REG_TRACE 00400 /* tracing of execution */ -#define REG_LARGE 01000 /* force large representation */ -#define REG_BACKR 02000 /* force use of backref code */ - -__BEGIN_DECLS -int regcomp(regex_t *__restrict, const char *__restrict, int); -size_t regerror(int, const regex_t *__restrict, char *__restrict, size_t); -int regexec(const regex_t *__restrict, const char *__restrict, - size_t, regmatch_t [__restrict], int); -void regfree(regex_t *); -__END_DECLS - -#endif /* !_REGEX_H_ */ diff --git a/tools/sdk/include/newlib/sched.h b/tools/sdk/include/newlib/sched.h deleted file mode 100644 index 504ad5274a4..00000000000 --- a/tools/sdk/include/newlib/sched.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Written by Joel Sherrill . - * - * COPYRIGHT (c) 1989-2010. - * On-Line Applications Research Corporation (OAR). - * - * Permission to use, copy, modify, and distribute this software for any - * purpose without fee is hereby granted, provided that this entire notice - * is included in all copies of any software which is or includes a copy - * or modification of this software. - * - * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTY. IN PARTICULAR, THE AUTHOR MAKES NO REPRESENTATION - * OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS - * SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. - * - * $Id$ - */ - -#ifndef _SCHED_H_ -#define _SCHED_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(_POSIX_PRIORITY_SCHEDULING) -/* - * XBD 13 - Set Scheduling Parameters, P1003.1b-2008, p. 1803 - */ -int sched_setparam( - pid_t __pid, - const struct sched_param *__param -); - -/* - * XBD 13 - Set Scheduling Parameters, P1003.1b-2008, p. 1800 - */ -int sched_getparam( - pid_t __pid, - struct sched_param *__param -); - -/* - * XBD 13 - Set Scheduling Policy and Scheduling Parameters, - * P1003.1b-2008, p. 1805 - */ -int sched_setscheduler( - pid_t __pid, - int __policy, - const struct sched_param *__param -); - -/* - * XBD 13 - Get Scheduling Policy, P1003.1b-2008, p. 1801 - */ -int sched_getscheduler( - pid_t __pid -); - -/* - * XBD 13 - Get Scheduling Parameter Limits, P1003.1b-2008, p. 1799 - */ -int sched_get_priority_max( - int __policy -); - -int sched_get_priority_min( - int __policy -); - -/* - * XBD 13 - Get Scheduling Parameter Limits, P1003.1b-2008, p. 1802 - */ -int sched_rr_get_interval( - pid_t __pid, - struct timespec *__interval -); -#endif /* _POSIX_PRIORITY_SCHEDULING */ - -#if defined(_POSIX_THREADS) || defined(_POSIX_PRIORITY_SCHEDULING) - -/* - * XBD 13 - Yield Processor, P1003.1b-2008, p. 1807 - */ -int sched_yield( void ); - -#endif /* _POSIX_THREADS or _POSIX_PRIORITY_SCHEDULING */ - -#ifdef __cplusplus -} -#endif - -#endif /* _SCHED_H_ */ diff --git a/tools/sdk/include/newlib/search.h b/tools/sdk/include/newlib/search.h deleted file mode 100644 index ed321b0f645..00000000000 --- a/tools/sdk/include/newlib/search.h +++ /dev/null @@ -1,64 +0,0 @@ -/* $NetBSD: search.h,v 1.12 1999/02/22 10:34:28 christos Exp $ */ -/* $FreeBSD: src/include/search.h,v 1.4 2002/03/23 17:24:53 imp Exp $ */ - -/* - * Written by J.T. Conklin - * Public domain. - */ - -#ifndef _SEARCH_H_ -#define _SEARCH_H_ - -#include -#include -#include - -typedef struct entry { - char *key; - void *data; -} ENTRY; - -typedef enum { - FIND, ENTER -} ACTION; - -typedef enum { - preorder, - postorder, - endorder, - leaf -} VISIT; - -#ifdef _SEARCH_PRIVATE -typedef struct node { - char *key; - struct node *llink, *rlink; -} node_t; -#endif - -struct hsearch_data -{ - struct internal_head *htable; - size_t htablesize; -}; - -#ifndef __compar_fn_t_defined -#define __compar_fn_t_defined -typedef int (*__compar_fn_t) (const void *, const void *); -#endif - -__BEGIN_DECLS -int hcreate(size_t); -void hdestroy(void); -ENTRY *hsearch(ENTRY, ACTION); -int hcreate_r(size_t, struct hsearch_data *); -void hdestroy_r(struct hsearch_data *); -int hsearch_r(ENTRY, ACTION, ENTRY **, struct hsearch_data *); -void *tdelete(const void *__restrict, void **__restrict, __compar_fn_t); -void tdestroy (void *, void (*)(void *)); -void *tfind(const void *, void **, __compar_fn_t); -void *tsearch(const void *, void **, __compar_fn_t); -void twalk(const void *, void (*)(const void *, VISIT, int)); -__END_DECLS - -#endif /* !_SEARCH_H_ */ diff --git a/tools/sdk/include/newlib/setjmp.h b/tools/sdk/include/newlib/setjmp.h deleted file mode 100644 index 3d815d9b9b3..00000000000 --- a/tools/sdk/include/newlib/setjmp.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - setjmp.h - stubs for future use. -*/ - -#ifndef _SETJMP_H_ -#define _SETJMP_H_ - -#include "_ansi.h" -#include - -_BEGIN_STD_C - -#ifdef __GNUC__ -void _EXFUN(longjmp,(jmp_buf __jmpb, int __retval)) - __attribute__ ((__noreturn__)); -#else -void _EXFUN(longjmp,(jmp_buf __jmpb, int __retval)); -#endif -int _EXFUN(setjmp,(jmp_buf __jmpb)); -#define setjmp(env) setjmp(env) - - -_END_STD_C - -#endif /* _SETJMP_H_ */ - diff --git a/tools/sdk/include/newlib/signal.h b/tools/sdk/include/newlib/signal.h deleted file mode 100644 index 8c50a2eb30c..00000000000 --- a/tools/sdk/include/newlib/signal.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef _SIGNAL_H_ -#define _SIGNAL_H_ - -#include "_ansi.h" -#include - -_BEGIN_STD_C - -typedef int sig_atomic_t; /* Atomic entity type (ANSI) */ -#ifndef _POSIX_SOURCE -typedef _sig_func_ptr sig_t; /* BSD naming */ -typedef _sig_func_ptr sighandler_t; /* glibc naming */ -#endif /* !_POSIX_SOURCE */ - -#define SIG_DFL ((_sig_func_ptr)0) /* Default action */ -#define SIG_IGN ((_sig_func_ptr)1) /* Ignore action */ -#define SIG_ERR ((_sig_func_ptr)-1) /* Error return */ - -struct _reent; - -_sig_func_ptr _EXFUN(_signal_r, (struct _reent *, int, _sig_func_ptr)); -int _EXFUN(_raise_r, (struct _reent *, int)); - -#ifndef _REENT_ONLY -_sig_func_ptr _EXFUN(signal, (int, _sig_func_ptr)); -int _EXFUN(raise, (int)); -void _EXFUN(psignal, (int, const char *)); -#endif - -_END_STD_C - -#endif /* _SIGNAL_H_ */ diff --git a/tools/sdk/include/newlib/spawn.h b/tools/sdk/include/newlib/spawn.h deleted file mode 100644 index 5a6692f1155..00000000000 --- a/tools/sdk/include/newlib/spawn.h +++ /dev/null @@ -1,119 +0,0 @@ -/*- - * Copyright (c) 2008 Ed Schouten - * All rights reserved. - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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 _SPAWN_H_ -#define _SPAWN_H_ - -#include <_ansi.h> -#include -#include -#include -#define __need_sigset_t -#include - -struct sched_param; - -typedef struct __posix_spawnattr *posix_spawnattr_t; -typedef struct __posix_spawn_file_actions *posix_spawn_file_actions_t; - -#define POSIX_SPAWN_RESETIDS 0x01 -#define POSIX_SPAWN_SETPGROUP 0x02 -#define POSIX_SPAWN_SETSCHEDPARAM 0x04 -#define POSIX_SPAWN_SETSCHEDULER 0x08 -#define POSIX_SPAWN_SETSIGDEF 0x10 -#define POSIX_SPAWN_SETSIGMASK 0x20 - -_BEGIN_STD_C -/* - * Spawn routines - * - * XXX both arrays should be __restrict, but this does not work when GCC - * is invoked with -std=c99. - */ -int _EXFUN(posix_spawn, (pid_t * __restrict, const char * __restrict, - const posix_spawn_file_actions_t *, const posix_spawnattr_t * __restrict, - char * const [], char * const []) -); -int _EXFUN(posix_spawnp, (pid_t * __restrict, const char * __restrict, - const posix_spawn_file_actions_t *, const posix_spawnattr_t * __restrict, - char * const [], char * const []) -); - -/* - * File descriptor actions - */ -int _EXFUN(posix_spawn_file_actions_init, (posix_spawn_file_actions_t *)); -int _EXFUN(posix_spawn_file_actions_destroy, (posix_spawn_file_actions_t *)); - -int _EXFUN(posix_spawn_file_actions_addopen, - (posix_spawn_file_actions_t * __restrict, int, const char * __restrict, int, mode_t) -); -int _EXFUN(posix_spawn_file_actions_adddup2, - (posix_spawn_file_actions_t *, int, int) -); -int _EXFUN(posix_spawn_file_actions_addclose, - (posix_spawn_file_actions_t *, int) -); - -/* - * Spawn attributes - */ -int _EXFUN(posix_spawnattr_init, (posix_spawnattr_t *)); -int _EXFUN(posix_spawnattr_destroy, (posix_spawnattr_t *)); - -int _EXFUN(posix_spawnattr_getflags, - (const posix_spawnattr_t * __restrict, short * __restrict) -); -int _EXFUN(posix_spawnattr_getpgroup, - (const posix_spawnattr_t * __restrict, pid_t * __restrict)); -int _EXFUN(posix_spawnattr_getschedparam, - (const posix_spawnattr_t * __restrict, struct sched_param * __restrict) -); -int _EXFUN(posix_spawnattr_getschedpolicy, - (const posix_spawnattr_t * __restrict, int * __restrict) -); -int _EXFUN(posix_spawnattr_getsigdefault, - (const posix_spawnattr_t * __restrict, sigset_t * __restrict) -); -int _EXFUN(posix_spawnattr_getsigmask, - (const posix_spawnattr_t * __restrict, sigset_t * __restrict) -); - -int _EXFUN(posix_spawnattr_setflags, (posix_spawnattr_t *, short)); -int _EXFUN(posix_spawnattr_setpgroup, (posix_spawnattr_t *, pid_t)); -int _EXFUN(posix_spawnattr_setschedparam, - (posix_spawnattr_t * __restrict, const struct sched_param * __restrict) -); -int _EXFUN(posix_spawnattr_setschedpolicy, (posix_spawnattr_t *, int)); -int _EXFUN(posix_spawnattr_setsigdefault, - (posix_spawnattr_t * __restrict, const sigset_t * __restrict) -); -int _EXFUN(posix_spawnattr_setsigmask, - (posix_spawnattr_t * __restrict, const sigset_t * __restrict) -); -_END_STD_C - -#endif /* !_SPAWN_H_ */ diff --git a/tools/sdk/include/newlib/stdatomic.h b/tools/sdk/include/newlib/stdatomic.h deleted file mode 100644 index beba325b1a2..00000000000 --- a/tools/sdk/include/newlib/stdatomic.h +++ /dev/null @@ -1,414 +0,0 @@ -/*- - * Copyright (c) 2011 Ed Schouten - * David Chisnall - * All rights reserved. - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - * - * $FreeBSD$ - */ - -#ifndef _STDATOMIC_H_ -#define _STDATOMIC_H_ - -#include -#include -#include - -#if __has_extension(c_atomic) || __has_extension(cxx_atomic) -#define __CLANG_ATOMICS -#elif __GNUC_PREREQ__(4, 7) -#define __GNUC_ATOMICS -#elif defined(__GNUC__) -#define __SYNC_ATOMICS -#else -#error "stdatomic.h does not support your compiler" -#endif - -/* - * 7.17.1 Atomic lock-free macros. - */ - -#ifdef __GCC_ATOMIC_BOOL_LOCK_FREE -#define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE -#endif -#ifdef __GCC_ATOMIC_CHAR_LOCK_FREE -#define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE -#endif -#ifdef __GCC_ATOMIC_CHAR16_T_LOCK_FREE -#define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE -#endif -#ifdef __GCC_ATOMIC_CHAR32_T_LOCK_FREE -#define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE -#endif -#ifdef __GCC_ATOMIC_WCHAR_T_LOCK_FREE -#define ATOMIC_WCHAR_T_LOCK_FREE __GCC_ATOMIC_WCHAR_T_LOCK_FREE -#endif -#ifdef __GCC_ATOMIC_SHORT_LOCK_FREE -#define ATOMIC_SHORT_LOCK_FREE __GCC_ATOMIC_SHORT_LOCK_FREE -#endif -#ifdef __GCC_ATOMIC_INT_LOCK_FREE -#define ATOMIC_INT_LOCK_FREE __GCC_ATOMIC_INT_LOCK_FREE -#endif -#ifdef __GCC_ATOMIC_LONG_LOCK_FREE -#define ATOMIC_LONG_LOCK_FREE __GCC_ATOMIC_LONG_LOCK_FREE -#endif -#ifdef __GCC_ATOMIC_LLONG_LOCK_FREE -#define ATOMIC_LLONG_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE -#endif -#ifdef __GCC_ATOMIC_POINTER_LOCK_FREE -#define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE -#endif - -/* - * 7.17.2 Initialization. - */ - -#if defined(__CLANG_ATOMICS) -#define ATOMIC_VAR_INIT(value) (value) -#define atomic_init(obj, value) __c11_atomic_init(obj, value) -#else -#define ATOMIC_VAR_INIT(value) { .__val = (value) } -#define atomic_init(obj, value) ((void)((obj)->__val = (value))) -#endif - -/* - * Clang and recent GCC both provide predefined macros for the memory - * orderings. If we are using a compiler that doesn't define them, use the - * clang values - these will be ignored in the fallback path. - */ - -#ifndef __ATOMIC_RELAXED -#define __ATOMIC_RELAXED 0 -#endif -#ifndef __ATOMIC_CONSUME -#define __ATOMIC_CONSUME 1 -#endif -#ifndef __ATOMIC_ACQUIRE -#define __ATOMIC_ACQUIRE 2 -#endif -#ifndef __ATOMIC_RELEASE -#define __ATOMIC_RELEASE 3 -#endif -#ifndef __ATOMIC_ACQ_REL -#define __ATOMIC_ACQ_REL 4 -#endif -#ifndef __ATOMIC_SEQ_CST -#define __ATOMIC_SEQ_CST 5 -#endif - -/* - * 7.17.3 Order and consistency. - * - * The memory_order_* constants that denote the barrier behaviour of the - * atomic operations. - */ - -typedef enum { - memory_order_relaxed = __ATOMIC_RELAXED, - memory_order_consume = __ATOMIC_CONSUME, - memory_order_acquire = __ATOMIC_ACQUIRE, - memory_order_release = __ATOMIC_RELEASE, - memory_order_acq_rel = __ATOMIC_ACQ_REL, - memory_order_seq_cst = __ATOMIC_SEQ_CST -} memory_order; - -/* - * 7.17.4 Fences. - */ - -static __inline void -atomic_thread_fence(memory_order __order __unused) -{ - -#ifdef __CLANG_ATOMICS - __c11_atomic_thread_fence(__order); -#elif defined(__GNUC_ATOMICS) - __atomic_thread_fence(__order); -#else - __sync_synchronize(); -#endif -} - -static __inline void -atomic_signal_fence(memory_order __order __unused) -{ - -#ifdef __CLANG_ATOMICS - __c11_atomic_signal_fence(__order); -#elif defined(__GNUC_ATOMICS) - __atomic_signal_fence(__order); -#else - __asm volatile ("" ::: "memory"); -#endif -} - -/* - * 7.17.5 Lock-free property. - */ - -#if defined(_KERNEL) -/* Atomics in kernelspace are always lock-free. */ -#define atomic_is_lock_free(obj) \ - ((void)(obj), (_Bool)1) -#elif defined(__CLANG_ATOMICS) -#define atomic_is_lock_free(obj) \ - __atomic_is_lock_free(sizeof(*(obj)), obj) -#elif defined(__GNUC_ATOMICS) -#define atomic_is_lock_free(obj) \ - __atomic_is_lock_free(sizeof((obj)->__val), &(obj)->__val) -#else -#define atomic_is_lock_free(obj) \ - ((void)(obj), sizeof((obj)->__val) <= sizeof(void *)) -#endif - -/* - * 7.17.6 Atomic integer types. - */ - -typedef _Atomic(_Bool) atomic_bool; -typedef _Atomic(char) atomic_char; -typedef _Atomic(signed char) atomic_schar; -typedef _Atomic(unsigned char) atomic_uchar; -typedef _Atomic(short) atomic_short; -typedef _Atomic(unsigned short) atomic_ushort; -typedef _Atomic(int) atomic_int; -typedef _Atomic(unsigned int) atomic_uint; -typedef _Atomic(long) atomic_long; -typedef _Atomic(unsigned long) atomic_ulong; -typedef _Atomic(long long) atomic_llong; -typedef _Atomic(unsigned long long) atomic_ullong; -#if 0 -typedef _Atomic(__char16_t) atomic_char16_t; -typedef _Atomic(__char32_t) atomic_char32_t; -#endif -typedef _Atomic(wchar_t) atomic_wchar_t; -typedef _Atomic(int_least8_t) atomic_int_least8_t; -typedef _Atomic(uint_least8_t) atomic_uint_least8_t; -typedef _Atomic(int_least16_t) atomic_int_least16_t; -typedef _Atomic(uint_least16_t) atomic_uint_least16_t; -typedef _Atomic(int_least32_t) atomic_int_least32_t; -typedef _Atomic(uint_least32_t) atomic_uint_least32_t; -typedef _Atomic(int_least64_t) atomic_int_least64_t; -typedef _Atomic(uint_least64_t) atomic_uint_least64_t; -typedef _Atomic(int_fast8_t) atomic_int_fast8_t; -typedef _Atomic(uint_fast8_t) atomic_uint_fast8_t; -typedef _Atomic(int_fast16_t) atomic_int_fast16_t; -typedef _Atomic(uint_fast16_t) atomic_uint_fast16_t; -typedef _Atomic(int_fast32_t) atomic_int_fast32_t; -typedef _Atomic(uint_fast32_t) atomic_uint_fast32_t; -typedef _Atomic(int_fast64_t) atomic_int_fast64_t; -typedef _Atomic(uint_fast64_t) atomic_uint_fast64_t; -typedef _Atomic(intptr_t) atomic_intptr_t; -typedef _Atomic(uintptr_t) atomic_uintptr_t; -typedef _Atomic(size_t) atomic_size_t; -typedef _Atomic(ptrdiff_t) atomic_ptrdiff_t; -typedef _Atomic(intmax_t) atomic_intmax_t; -typedef _Atomic(uintmax_t) atomic_uintmax_t; - -/* - * 7.17.7 Operations on atomic types. - */ - -/* - * Compiler-specific operations. - */ - -#if defined(__CLANG_ATOMICS) -#define atomic_compare_exchange_strong_explicit(object, expected, \ - desired, success, failure) \ - __c11_atomic_compare_exchange_strong(object, expected, desired, \ - success, failure) -#define atomic_compare_exchange_weak_explicit(object, expected, \ - desired, success, failure) \ - __c11_atomic_compare_exchange_weak(object, expected, desired, \ - success, failure) -#define atomic_exchange_explicit(object, desired, order) \ - __c11_atomic_exchange(object, desired, order) -#define atomic_fetch_add_explicit(object, operand, order) \ - __c11_atomic_fetch_add(object, operand, order) -#define atomic_fetch_and_explicit(object, operand, order) \ - __c11_atomic_fetch_and(object, operand, order) -#define atomic_fetch_or_explicit(object, operand, order) \ - __c11_atomic_fetch_or(object, operand, order) -#define atomic_fetch_sub_explicit(object, operand, order) \ - __c11_atomic_fetch_sub(object, operand, order) -#define atomic_fetch_xor_explicit(object, operand, order) \ - __c11_atomic_fetch_xor(object, operand, order) -#define atomic_load_explicit(object, order) \ - __c11_atomic_load(object, order) -#define atomic_store_explicit(object, desired, order) \ - __c11_atomic_store(object, desired, order) -#elif defined(__GNUC_ATOMICS) -#define atomic_compare_exchange_strong_explicit(object, expected, \ - desired, success, failure) \ - __atomic_compare_exchange_n(&(object)->__val, expected, \ - desired, 0, success, failure) -#define atomic_compare_exchange_weak_explicit(object, expected, \ - desired, success, failure) \ - __atomic_compare_exchange_n(&(object)->__val, expected, \ - desired, 1, success, failure) -#define atomic_exchange_explicit(object, desired, order) \ - __atomic_exchange_n(&(object)->__val, desired, order) -#define atomic_fetch_add_explicit(object, operand, order) \ - __atomic_fetch_add(&(object)->__val, operand, order) -#define atomic_fetch_and_explicit(object, operand, order) \ - __atomic_fetch_and(&(object)->__val, operand, order) -#define atomic_fetch_or_explicit(object, operand, order) \ - __atomic_fetch_or(&(object)->__val, operand, order) -#define atomic_fetch_sub_explicit(object, operand, order) \ - __atomic_fetch_sub(&(object)->__val, operand, order) -#define atomic_fetch_xor_explicit(object, operand, order) \ - __atomic_fetch_xor(&(object)->__val, operand, order) -#define atomic_load_explicit(object, order) \ - __atomic_load_n(&(object)->__val, order) -#define atomic_store_explicit(object, desired, order) \ - __atomic_store_n(&(object)->__val, desired, order) -#else -#define __atomic_apply_stride(object, operand) \ - (((__typeof__((object)->__val))0) + (operand)) -#define atomic_compare_exchange_strong_explicit(object, expected, \ - desired, success, failure) __extension__ ({ \ - __typeof__(expected) __ep = (expected); \ - __typeof__(*__ep) __e = *__ep; \ - (void)(success); (void)(failure); \ - (_Bool)((*__ep = __sync_val_compare_and_swap(&(object)->__val, \ - __e, desired)) == __e); \ -}) -#define atomic_compare_exchange_weak_explicit(object, expected, \ - desired, success, failure) \ - atomic_compare_exchange_strong_explicit(object, expected, \ - desired, success, failure) -#if __has_builtin(__sync_swap) -/* Clang provides a full-barrier atomic exchange - use it if available. */ -#define atomic_exchange_explicit(object, desired, order) \ - ((void)(order), __sync_swap(&(object)->__val, desired)) -#else -/* - * __sync_lock_test_and_set() is only an acquire barrier in theory (although in - * practice it is usually a full barrier) so we need an explicit barrier before - * it. - */ -#define atomic_exchange_explicit(object, desired, order) \ -__extension__ ({ \ - __typeof__(object) __o = (object); \ - __typeof__(desired) __d = (desired); \ - (void)(order); \ - __sync_synchronize(); \ - __sync_lock_test_and_set(&(__o)->__val, __d); \ -}) -#endif -#define atomic_fetch_add_explicit(object, operand, order) \ - ((void)(order), __sync_fetch_and_add(&(object)->__val, \ - __atomic_apply_stride(object, operand))) -#define atomic_fetch_and_explicit(object, operand, order) \ - ((void)(order), __sync_fetch_and_and(&(object)->__val, operand)) -#define atomic_fetch_or_explicit(object, operand, order) \ - ((void)(order), __sync_fetch_and_or(&(object)->__val, operand)) -#define atomic_fetch_sub_explicit(object, operand, order) \ - ((void)(order), __sync_fetch_and_sub(&(object)->__val, \ - __atomic_apply_stride(object, operand))) -#define atomic_fetch_xor_explicit(object, operand, order) \ - ((void)(order), __sync_fetch_and_xor(&(object)->__val, operand)) -#define atomic_load_explicit(object, order) \ - ((void)(order), __sync_fetch_and_add(&(object)->__val, 0)) -#define atomic_store_explicit(object, desired, order) \ - ((void)atomic_exchange_explicit(object, desired, order)) -#endif - -/* - * Convenience functions. - * - * Don't provide these in kernel space. In kernel space, we should be - * disciplined enough to always provide explicit barriers. - */ - -#ifndef _KERNEL -#define atomic_compare_exchange_strong(object, expected, desired) \ - atomic_compare_exchange_strong_explicit(object, expected, \ - desired, memory_order_seq_cst, memory_order_seq_cst) -#define atomic_compare_exchange_weak(object, expected, desired) \ - atomic_compare_exchange_weak_explicit(object, expected, \ - desired, memory_order_seq_cst, memory_order_seq_cst) -#define atomic_exchange(object, desired) \ - atomic_exchange_explicit(object, desired, memory_order_seq_cst) -#define atomic_fetch_add(object, operand) \ - atomic_fetch_add_explicit(object, operand, memory_order_seq_cst) -#define atomic_fetch_and(object, operand) \ - atomic_fetch_and_explicit(object, operand, memory_order_seq_cst) -#define atomic_fetch_or(object, operand) \ - atomic_fetch_or_explicit(object, operand, memory_order_seq_cst) -#define atomic_fetch_sub(object, operand) \ - atomic_fetch_sub_explicit(object, operand, memory_order_seq_cst) -#define atomic_fetch_xor(object, operand) \ - atomic_fetch_xor_explicit(object, operand, memory_order_seq_cst) -#define atomic_load(object) \ - atomic_load_explicit(object, memory_order_seq_cst) -#define atomic_store(object, desired) \ - atomic_store_explicit(object, desired, memory_order_seq_cst) -#endif /* !_KERNEL */ - -/* - * 7.17.8 Atomic flag type and operations. - * - * XXX: Assume atomic_bool can be used as an atomic_flag. Is there some - * kind of compiler built-in type we could use? - */ - -typedef struct { - atomic_bool __flag; -} atomic_flag; - -#define ATOMIC_FLAG_INIT { ATOMIC_VAR_INIT(0) } - -static __inline _Bool -atomic_flag_test_and_set_explicit(volatile atomic_flag *__object, - memory_order __order) -{ - return (atomic_exchange_explicit(&__object->__flag, 1, __order)); -} - -static __inline void -atomic_flag_clear_explicit(volatile atomic_flag *__object, memory_order __order) -{ - - atomic_store_explicit(&__object->__flag, 0, __order); -} - -#ifndef _KERNEL -static __inline _Bool -atomic_flag_test_and_set(volatile atomic_flag *__object) -{ - - return (atomic_flag_test_and_set_explicit(__object, - memory_order_seq_cst)); -} - -static __inline void -atomic_flag_clear(volatile atomic_flag *__object) -{ - - atomic_flag_clear_explicit(__object, memory_order_seq_cst); -} -#endif /* !_KERNEL */ - -#endif /* !_STDATOMIC_H_ */ diff --git a/tools/sdk/include/newlib/stdint.h b/tools/sdk/include/newlib/stdint.h deleted file mode 100644 index 7386164b9da..00000000000 --- a/tools/sdk/include/newlib/stdint.h +++ /dev/null @@ -1,511 +0,0 @@ -/* - * Copyright (c) 2004, 2005 by - * Ralf Corsepius, Ulm/Germany. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#ifndef _STDINT_H -#define _STDINT_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef ___int8_t_defined -typedef __int8_t int8_t ; -typedef __uint8_t uint8_t ; -#define __int8_t_defined 1 -#endif - -#ifdef ___int_least8_t_defined -typedef __int_least8_t int_least8_t; -typedef __uint_least8_t uint_least8_t; -#define __int_least8_t_defined 1 -#endif - -#ifdef ___int16_t_defined -typedef __int16_t int16_t ; -typedef __uint16_t uint16_t ; -#define __int16_t_defined 1 -#endif - -#ifdef ___int_least16_t_defined -typedef __int_least16_t int_least16_t; -typedef __uint_least16_t uint_least16_t; -#define __int_least16_t_defined 1 -#endif - -#ifdef ___int32_t_defined -typedef __int32_t int32_t ; -typedef __uint32_t uint32_t ; -#define __int32_t_defined 1 -#endif - -#ifdef ___int_least32_t_defined -typedef __int_least32_t int_least32_t; -typedef __uint_least32_t uint_least32_t; -#define __int_least32_t_defined 1 -#endif - -#ifdef ___int64_t_defined -typedef __int64_t int64_t ; -typedef __uint64_t uint64_t ; -#define __int64_t_defined 1 -#endif - -#ifdef ___int_least64_t_defined -typedef __int_least64_t int_least64_t; -typedef __uint_least64_t uint_least64_t; -#define __int_least64_t_defined 1 -#endif - -/* - * Fastest minimum-width integer types - * - * Assume int to be the fastest type for all types with a width - * less than __INT_MAX__ rsp. INT_MAX - */ -#ifdef __INT_FAST8_TYPE__ - typedef __INT_FAST8_TYPE__ int_fast8_t; - typedef __UINT_FAST8_TYPE__ uint_fast8_t; -#define __int_fast8_t_defined 1 -#elif __STDINT_EXP(INT_MAX) >= 0x7f - typedef signed int int_fast8_t; - typedef unsigned int uint_fast8_t; -#define __int_fast8_t_defined 1 -#endif - -#ifdef __INT_FAST16_TYPE__ - typedef __INT_FAST16_TYPE__ int_fast16_t; - typedef __UINT_FAST16_TYPE__ uint_fast16_t; -#define __int_fast16_t_defined 1 -#elif __STDINT_EXP(INT_MAX) >= 0x7fff - typedef signed int int_fast16_t; - typedef unsigned int uint_fast16_t; -#define __int_fast16_t_defined 1 -#endif - -#ifdef __INT_FAST32_TYPE__ - typedef __INT_FAST32_TYPE__ int_fast32_t; - typedef __UINT_FAST32_TYPE__ uint_fast32_t; -#define __int_fast32_t_defined 1 -#elif __STDINT_EXP(INT_MAX) >= 0x7fffffff - typedef signed int int_fast32_t; - typedef unsigned int uint_fast32_t; -#define __int_fast32_t_defined 1 -#endif - -#ifdef __INT_FAST64_TYPE__ - typedef __INT_FAST64_TYPE__ int_fast64_t; - typedef __UINT_FAST64_TYPE__ uint_fast64_t; -#define __int_fast64_t_defined 1 -#elif __STDINT_EXP(INT_MAX) > 0x7fffffff - typedef signed int int_fast64_t; - typedef unsigned int uint_fast64_t; -#define __int_fast64_t_defined 1 -#endif - -/* - * Fall back to [u]int_least_t for [u]int_fast_t types - * not having been defined, yet. - * Leave undefined, if [u]int_least_t should not be available. - */ -#if !__int_fast8_t_defined -#if __int_least8_t_defined - typedef int_least8_t int_fast8_t; - typedef uint_least8_t uint_fast8_t; -#define __int_fast8_t_defined 1 -#endif -#endif - -#if !__int_fast16_t_defined -#if __int_least16_t_defined - typedef int_least16_t int_fast16_t; - typedef uint_least16_t uint_fast16_t; -#define __int_fast16_t_defined 1 -#endif -#endif - -#if !__int_fast32_t_defined -#if __int_least32_t_defined - typedef int_least32_t int_fast32_t; - typedef uint_least32_t uint_fast32_t; -#define __int_fast32_t_defined 1 -#endif -#endif - -#if !__int_fast64_t_defined -#if __int_least64_t_defined - typedef int_least64_t int_fast64_t; - typedef uint_least64_t uint_fast64_t; -#define __int_fast64_t_defined 1 -#endif -#endif - -/* Greatest-width integer types */ -/* Modern GCCs provide __INTMAX_TYPE__ */ -#if defined(__INTMAX_TYPE__) - typedef __INTMAX_TYPE__ intmax_t; -#elif __have_longlong64 - typedef signed long long intmax_t; -#else - typedef signed long intmax_t; -#endif - -/* Modern GCCs provide __UINTMAX_TYPE__ */ -#if defined(__UINTMAX_TYPE__) - typedef __UINTMAX_TYPE__ uintmax_t; -#elif __have_longlong64 - typedef unsigned long long uintmax_t; -#else - typedef unsigned long uintmax_t; -#endif - -typedef __intptr_t intptr_t; -typedef __uintptr_t uintptr_t; - -#ifdef __INTPTR_TYPE__ -#define INTPTR_MIN (-__INTPTR_MAX__ - 1) -#define INTPTR_MAX __INTPTR_MAX__ -#define UINTPTR_MAX __UINTPTR_MAX__ -#elif defined(__PTRDIFF_TYPE__) -#define INTPTR_MAX PTRDIFF_MAX -#define INTPTR_MIN PTRDIFF_MIN -#ifdef __UINTPTR_MAX__ -#define UINTPTR_MAX __UINTPTR_MAX__ -#else -#define UINTPTR_MAX (2UL * PTRDIFF_MAX + 1) -#endif -#else -/* - * Fallback to hardcoded values, - * should be valid on cpu's with 32bit int/32bit void* - */ -#define INTPTR_MAX __STDINT_EXP(LONG_MAX) -#define INTPTR_MIN (-__STDINT_EXP(LONG_MAX) - 1) -#define UINTPTR_MAX (__STDINT_EXP(LONG_MAX) * 2UL + 1) -#endif - -/* Limits of Specified-Width Integer Types */ - -#ifdef __INT8_MAX__ -#define INT8_MIN (-__INT8_MAX__ - 1) -#define INT8_MAX __INT8_MAX__ -#define UINT8_MAX __UINT8_MAX__ -#elif defined(__int8_t_defined) -#define INT8_MIN -128 -#define INT8_MAX 127 -#define UINT8_MAX 255 -#endif - -#ifdef __INT_LEAST8_MAX__ -#define INT_LEAST8_MIN (-__INT_LEAST8_MAX__ - 1) -#define INT_LEAST8_MAX __INT_LEAST8_MAX__ -#define UINT_LEAST8_MAX __UINT_LEAST8_MAX__ -#elif defined(__int_least8_t_defined) -#define INT_LEAST8_MIN -128 -#define INT_LEAST8_MAX 127 -#define UINT_LEAST8_MAX 255 -#else -#error required type int_least8_t missing -#endif - -#ifdef __INT16_MAX__ -#define INT16_MIN (-__INT16_MAX__ - 1) -#define INT16_MAX __INT16_MAX__ -#define UINT16_MAX __UINT16_MAX__ -#elif defined(__int16_t_defined) -#define INT16_MIN -32768 -#define INT16_MAX 32767 -#define UINT16_MAX 65535 -#endif - -#ifdef __INT_LEAST16_MAX__ -#define INT_LEAST16_MIN (-__INT_LEAST16_MAX__ - 1) -#define INT_LEAST16_MAX __INT_LEAST16_MAX__ -#define UINT_LEAST16_MAX __UINT_LEAST16_MAX__ -#elif defined(__int_least16_t_defined) -#define INT_LEAST16_MIN -32768 -#define INT_LEAST16_MAX 32767 -#define UINT_LEAST16_MAX 65535 -#else -#error required type int_least16_t missing -#endif - -#ifdef __INT32_MAX__ -#define INT32_MIN (-__INT32_MAX__ - 1) -#define INT32_MAX __INT32_MAX__ -#define UINT32_MAX __UINT32_MAX__ -#elif defined(__int32_t_defined) -#if __have_long32 -#define INT32_MIN (-2147483647L-1) -#define INT32_MAX 2147483647L -#define UINT32_MAX 4294967295UL -#else -#define INT32_MIN (-2147483647-1) -#define INT32_MAX 2147483647 -#define UINT32_MAX 4294967295U -#endif -#endif - -#ifdef __INT_LEAST32_MAX__ -#define INT_LEAST32_MIN (-__INT_LEAST32_MAX__ - 1) -#define INT_LEAST32_MAX __INT_LEAST32_MAX__ -#define UINT_LEAST32_MAX __UINT_LEAST32_MAX__ -#elif defined(__int_least32_t_defined) -#if __have_long32 -#define INT_LEAST32_MIN (-2147483647L-1) -#define INT_LEAST32_MAX 2147483647L -#define UINT_LEAST32_MAX 4294967295UL -#else -#define INT_LEAST32_MIN (-2147483647-1) -#define INT_LEAST32_MAX 2147483647 -#define UINT_LEAST32_MAX 4294967295U -#endif -#else -#error required type int_least32_t missing -#endif - -#ifdef __INT64_MAX__ -#define INT64_MIN (-__INT64_MAX__ - 1) -#define INT64_MAX __INT64_MAX__ -#define UINT64_MAX __UINT64_MAX__ -#elif defined(__int64_t_defined) -#if __have_long64 -#define INT64_MIN (-9223372036854775807L-1L) -#define INT64_MAX 9223372036854775807L -#define UINT64_MAX 18446744073709551615U -#elif __have_longlong64 -#define INT64_MIN (-9223372036854775807LL-1LL) -#define INT64_MAX 9223372036854775807LL -#define UINT64_MAX 18446744073709551615ULL -#endif -#endif - -#ifdef __INT_LEAST64_MAX__ -#define INT_LEAST64_MIN (-__INT_LEAST64_MAX__ - 1) -#define INT_LEAST64_MAX __INT_LEAST64_MAX__ -#define UINT_LEAST64_MAX __UINT_LEAST64_MAX__ -#elif defined(__int_least64_t_defined) -#if __have_long64 -#define INT_LEAST64_MIN (-9223372036854775807L-1L) -#define INT_LEAST64_MAX 9223372036854775807L -#define UINT_LEAST64_MAX 18446744073709551615U -#elif __have_longlong64 -#define INT_LEAST64_MIN (-9223372036854775807LL-1LL) -#define INT_LEAST64_MAX 9223372036854775807LL -#define UINT_LEAST64_MAX 18446744073709551615ULL -#endif -#endif - -#ifdef __INT_FAST8_MAX__ -#define INT_FAST8_MIN (-__INT_FAST8_MAX__ - 1) -#define INT_FAST8_MAX __INT_FAST8_MAX__ -#define UINT_FAST8_MAX __UINT_FAST8_MAX__ -#elif defined(__int_fast8_t_defined) -#if __STDINT_EXP(INT_MAX) >= 0x7f -#define INT_FAST8_MIN (-__STDINT_EXP(INT_MAX)-1) -#define INT_FAST8_MAX __STDINT_EXP(INT_MAX) -#define UINT_FAST8_MAX (__STDINT_EXP(INT_MAX)*2U+1U) -#else -#define INT_FAST8_MIN INT_LEAST8_MIN -#define INT_FAST8_MAX INT_LEAST8_MAX -#define UINT_FAST8_MAX UINT_LEAST8_MAX -#endif -#endif - -#ifdef __INT_FAST16_MAX__ -#define INT_FAST16_MIN (-__INT_FAST16_MAX__ - 1) -#define INT_FAST16_MAX __INT_FAST16_MAX__ -#define UINT_FAST16_MAX __UINT_FAST16_MAX__ -#elif defined(__int_fast16_t_defined) -#if __STDINT_EXP(INT_MAX) >= 0x7fff -#define INT_FAST16_MIN (-__STDINT_EXP(INT_MAX)-1) -#define INT_FAST16_MAX __STDINT_EXP(INT_MAX) -#define UINT_FAST16_MAX (__STDINT_EXP(INT_MAX)*2U+1U) -#else -#define INT_FAST16_MIN INT_LEAST16_MIN -#define INT_FAST16_MAX INT_LEAST16_MAX -#define UINT_FAST16_MAX UINT_LEAST16_MAX -#endif -#endif - -#ifdef __INT_FAST32_MAX__ -#define INT_FAST32_MIN (-__INT_FAST32_MAX__ - 1) -#define INT_FAST32_MAX __INT_FAST32_MAX__ -#define UINT_FAST32_MAX __UINT_FAST32_MAX__ -#elif defined(__int_fast32_t_defined) -#if __STDINT_EXP(INT_MAX) >= 0x7fffffff -#define INT_FAST32_MIN (-__STDINT_EXP(INT_MAX)-1) -#define INT_FAST32_MAX __STDINT_EXP(INT_MAX) -#define UINT_FAST32_MAX (__STDINT_EXP(INT_MAX)*2U+1U) -#else -#define INT_FAST32_MIN INT_LEAST32_MIN -#define INT_FAST32_MAX INT_LEAST32_MAX -#define UINT_FAST32_MAX UINT_LEAST32_MAX -#endif -#endif - -#ifdef __INT_FAST64_MAX__ -#define INT_FAST64_MIN (-__INT_FAST64_MAX__ - 1) -#define INT_FAST64_MAX __INT_FAST64_MAX__ -#define UINT_FAST64_MAX __UINT_FAST64_MAX__ -#elif defined(__int_fast64_t_defined) -#if __STDINT_EXP(INT_MAX) > 0x7fffffff -#define INT_FAST64_MIN (-__STDINT_EXP(INT_MAX)-1) -#define INT_FAST64_MAX __STDINT_EXP(INT_MAX) -#define UINT_FAST64_MAX (__STDINT_EXP(INT_MAX)*2U+1U) -#else -#define INT_FAST64_MIN INT_LEAST64_MIN -#define INT_FAST64_MAX INT_LEAST64_MAX -#define UINT_FAST64_MAX UINT_LEAST64_MAX -#endif -#endif - -#ifdef __INTMAX_MAX__ -#define INTMAX_MAX __INTMAX_MAX__ -#define INTMAX_MIN (-INTMAX_MAX - 1) -#elif defined(__INTMAX_TYPE__) -/* All relevant GCC versions prefer long to long long for intmax_t. */ -#define INTMAX_MAX INT64_MAX -#define INTMAX_MIN INT64_MIN -#endif - -#ifdef __UINTMAX_MAX__ -#define UINTMAX_MAX __UINTMAX_MAX__ -#elif defined(__UINTMAX_TYPE__) -/* All relevant GCC versions prefer long to long long for intmax_t. */ -#define UINTMAX_MAX UINT64_MAX -#endif - -/* This must match size_t in stddef.h, currently long unsigned int */ -#ifdef __SIZE_MAX__ -#define SIZE_MAX __SIZE_MAX__ -#else -#define SIZE_MAX (__STDINT_EXP(LONG_MAX) * 2UL + 1) -#endif - -/* This must match sig_atomic_t in (currently int) */ -#define SIG_ATOMIC_MIN (-__STDINT_EXP(INT_MAX) - 1) -#define SIG_ATOMIC_MAX __STDINT_EXP(INT_MAX) - -/* This must match ptrdiff_t in (currently long int) */ -#ifdef __PTRDIFF_MAX__ -#define PTRDIFF_MAX __PTRDIFF_MAX__ -#else -#define PTRDIFF_MAX __STDINT_EXP(LONG_MAX) -#endif -#define PTRDIFF_MIN (-PTRDIFF_MAX - 1) - -/* This must match definition in */ -#ifndef WCHAR_MIN -#ifdef __WCHAR_MIN__ -#define WCHAR_MIN __WCHAR_MIN__ -#elif defined(__WCHAR_UNSIGNED__) || (L'\0' - 1 > 0) -#define WCHAR_MIN (0 + L'\0') -#else -#define WCHAR_MIN (-0x7fffffff - 1 + L'\0') -#endif -#endif - -/* This must match definition in */ -#ifndef WCHAR_MAX -#ifdef __WCHAR_MAX__ -#define WCHAR_MAX __WCHAR_MAX__ -#elif defined(__WCHAR_UNSIGNED__) || (L'\0' - 1 > 0) -#define WCHAR_MAX (0xffffffffu + L'\0') -#else -#define WCHAR_MAX (0x7fffffff + L'\0') -#endif -#endif - -/* wint_t is unsigned int on almost all GCC targets. */ -#ifdef __WINT_MAX__ -#define WINT_MAX __WINT_MAX__ -#else -#define WINT_MAX (__STDINT_EXP(INT_MAX) * 2U + 1U) -#endif -#ifdef __WINT_MIN__ -#define WINT_MIN __WINT_MIN__ -#else -#define WINT_MIN 0U -#endif - -/** Macros for minimum-width integer constant expressions */ -#ifdef __INT8_C -#define INT8_C(x) __INT8_C(x) -#define UINT8_C(x) __UINT8_C(x) -#else -#define INT8_C(x) x -#if __STDINT_EXP(INT_MAX) > 0x7f -#define UINT8_C(x) x -#else -#define UINT8_C(x) x##U -#endif -#endif - -#ifdef __INT16_C -#define INT16_C(x) __INT16_C(x) -#define UINT16_C(x) __UINT16_C(x) -#else -#define INT16_C(x) x -#if __STDINT_EXP(INT_MAX) > 0x7fff -#define UINT16_C(x) x -#else -#define UINT16_C(x) x##U -#endif -#endif - -#ifdef __INT32_C -#define INT32_C(x) __INT32_C(x) -#define UINT32_C(x) __UINT32_C(x) -#else -#if __have_long32 -#define INT32_C(x) x##L -#define UINT32_C(x) x##UL -#else -#define INT32_C(x) x -#define UINT32_C(x) x##U -#endif -#endif - -#ifdef __INT64_C -#define INT64_C(x) __INT64_C(x) -#define UINT64_C(x) __UINT64_C(x) -#else -#if __int64_t_defined -#if __have_long64 -#define INT64_C(x) x##L -#define UINT64_C(x) x##UL -#else -#define INT64_C(x) x##LL -#define UINT64_C(x) x##ULL -#endif -#endif -#endif - -/** Macros for greatest-width integer constant expression */ -#ifdef __INTMAX_C -#define INTMAX_C(x) __INTMAX_C(x) -#define UINTMAX_C(x) __UINTMAX_C(x) -#else -#if __have_long64 -#define INTMAX_C(x) x##L -#define UINTMAX_C(x) x##UL -#else -#define INTMAX_C(x) x##LL -#define UINTMAX_C(x) x##ULL -#endif -#endif - - -#ifdef __cplusplus -} -#endif - -#endif /* _STDINT_H */ diff --git a/tools/sdk/include/newlib/stdio.h b/tools/sdk/include/newlib/stdio.h deleted file mode 100644 index e336ee6ebab..00000000000 --- a/tools/sdk/include/newlib/stdio.h +++ /dev/null @@ -1,727 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * @(#)stdio.h 5.3 (Berkeley) 3/15/86 - */ - -/* - * NB: to fit things in six character monocase externals, the - * stdio code uses the prefix `__s' for stdio objects, typically - * followed by a three-character attempt at a mnemonic. - */ - -#ifndef _STDIO_H_ -#define _STDIO_H_ - -#include "_ansi.h" - -#define _FSTDIO /* ``function stdio'' */ - -#define __need_size_t -#define __need_NULL -#include -#include - -#define __need___va_list -#include - -/* - * defines __FILE, _fpos_t. - * They must be defined there because struct _reent needs them (and we don't - * want reent.h to include this file. - */ - -#include -#include - -_BEGIN_STD_C - -typedef __FILE FILE; - -#ifdef __CYGWIN__ -typedef _fpos64_t fpos_t; -#else -typedef _fpos_t fpos_t; -#ifdef __LARGE64_FILES -typedef _fpos64_t fpos64_t; -#endif -#endif /* !__CYGWIN__ */ - -#include - -#define __SLBF 0x0001 /* line buffered */ -#define __SNBF 0x0002 /* unbuffered */ -#define __SRD 0x0004 /* OK to read */ -#define __SWR 0x0008 /* OK to write */ - /* RD and WR are never simultaneously asserted */ -#define __SRW 0x0010 /* open for reading & writing */ -#define __SEOF 0x0020 /* found EOF */ -#define __SERR 0x0040 /* found error */ -#define __SMBF 0x0080 /* _buf is from malloc */ -#define __SAPP 0x0100 /* fdopen()ed in append mode - so must write to end */ -#define __SSTR 0x0200 /* this is an sprintf/snprintf string */ -#define __SOPT 0x0400 /* do fseek() optimisation */ -#define __SNPT 0x0800 /* do not do fseek() optimisation */ -#define __SOFF 0x1000 /* set iff _offset is in fact correct */ -#define __SORD 0x2000 /* true => stream orientation (byte/wide) decided */ -#if defined(__CYGWIN__) -# define __SCLE 0x4000 /* convert line endings CR/LF <-> NL */ -#endif -#define __SL64 0x8000 /* is 64-bit offset large file */ - -/* _flags2 flags */ -#define __SNLK 0x0001 /* stdio functions do not lock streams themselves */ -#define __SWID 0x2000 /* true => stream orientation wide, false => byte, only valid if __SORD in _flags is true */ - -/* - * The following three definitions are for ANSI C, which took them - * from System V, which stupidly took internal interface macros and - * made them official arguments to setvbuf(), without renaming them. - * Hence, these ugly _IOxxx names are *supposed* to appear in user code. - * - * Although these happen to match their counterparts above, the - * implementation does not rely on that (so these could be renumbered). - */ -#define _IOFBF 0 /* setvbuf should set fully buffered */ -#define _IOLBF 1 /* setvbuf should set line buffered */ -#define _IONBF 2 /* setvbuf should set unbuffered */ - -#define EOF (-1) - -#ifdef __BUFSIZ__ -#define BUFSIZ __BUFSIZ__ -#else -#define BUFSIZ 1024 -#endif - -#ifdef __FOPEN_MAX__ -#define FOPEN_MAX __FOPEN_MAX__ -#else -#define FOPEN_MAX 20 -#endif - -#ifdef __FILENAME_MAX__ -#define FILENAME_MAX __FILENAME_MAX__ -#else -#define FILENAME_MAX 1024 -#endif - -#ifdef __L_tmpnam__ -#define L_tmpnam __L_tmpnam__ -#else -#define L_tmpnam FILENAME_MAX -#endif - -#ifndef __STRICT_ANSI__ -#define P_tmpdir "/tmp" -#endif - -#ifndef SEEK_SET -#define SEEK_SET 0 /* set file offset to offset */ -#endif -#ifndef SEEK_CUR -#define SEEK_CUR 1 /* set file offset to current plus offset */ -#endif -#ifndef SEEK_END -#define SEEK_END 2 /* set file offset to EOF plus offset */ -#endif - -#define TMP_MAX 26 - -#define stdin (_REENT->_stdin) -#define stdout (_REENT->_stdout) -#define stderr (_REENT->_stderr) - -#define _stdin_r(x) ((x)->_stdin) -#define _stdout_r(x) ((x)->_stdout) -#define _stderr_r(x) ((x)->_stderr) - -/* - * Functions defined in ANSI C standard. - */ - -#ifndef __VALIST -#ifdef __GNUC__ -#define __VALIST __gnuc_va_list -#else -#define __VALIST char* -#endif -#endif - -FILE * _EXFUN(tmpfile, (void)); -char * _EXFUN(tmpnam, (char *)); -#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 -char * _EXFUN(tempnam, (const char *, const char *)); -#endif -int _EXFUN(fclose, (FILE *)); -int _EXFUN(fflush, (FILE *)); -FILE * _EXFUN(freopen, (const char *__restrict, const char *__restrict, FILE *__restrict)); -void _EXFUN(setbuf, (FILE *__restrict, char *__restrict)); -int _EXFUN(setvbuf, (FILE *__restrict, char *__restrict, int, size_t)); -int _EXFUN(fprintf, (FILE *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -int _EXFUN(fscanf, (FILE *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); -int _EXFUN(printf, (const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 1, 2)))); -int _EXFUN(scanf, (const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__scanf__, 1, 2)))); -int _EXFUN(sscanf, (const char *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); -int _EXFUN(vfprintf, (FILE *__restrict, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -int _EXFUN(vprintf, (const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 1, 0)))); -int _EXFUN(vsprintf, (char *__restrict, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -int _EXFUN(fgetc, (FILE *)); -char * _EXFUN(fgets, (char *__restrict, int, FILE *__restrict)); -int _EXFUN(fputc, (int, FILE *)); -int _EXFUN(fputs, (const char *__restrict, FILE *__restrict)); -int _EXFUN(getc, (FILE *)); -int _EXFUN(getchar, (void)); -char * _EXFUN(gets, (char *)); -int _EXFUN(putc, (int, FILE *)); -int _EXFUN(putchar, (int)); -int _EXFUN(puts, (const char *)); -int _EXFUN(ungetc, (int, FILE *)); -size_t _EXFUN(fread, (_PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); -size_t _EXFUN(fwrite, (const _PTR __restrict , size_t _size, size_t _n, FILE *)); -#ifdef _COMPILING_NEWLIB -int _EXFUN(fgetpos, (FILE *, _fpos_t *)); -#else -int _EXFUN(fgetpos, (FILE *__restrict, fpos_t *__restrict)); -#endif -int _EXFUN(fseek, (FILE *, long, int)); -#ifdef _COMPILING_NEWLIB -int _EXFUN(fsetpos, (FILE *, const _fpos_t *)); -#else -int _EXFUN(fsetpos, (FILE *, const fpos_t *)); -#endif -long _EXFUN(ftell, ( FILE *)); -void _EXFUN(rewind, (FILE *)); -void _EXFUN(clearerr, (FILE *)); -int _EXFUN(feof, (FILE *)); -int _EXFUN(ferror, (FILE *)); -void _EXFUN(perror, (const char *)); -#ifndef _REENT_ONLY -FILE * _EXFUN(fopen, (const char *__restrict _name, const char *__restrict _type)); -int _EXFUN(sprintf, (char *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -int _EXFUN(remove, (const char *)); -int _EXFUN(rename, (const char *, const char *)); -#ifdef _COMPILING_NEWLIB -int _EXFUN(_rename, (const char *, const char *)); -#endif -#endif -#if !defined(__STRICT_ANSI__) || defined(__USE_XOPEN2K) -#ifdef _COMPILING_NEWLIB -int _EXFUN(fseeko, (FILE *, _off_t, int)); -_off_t _EXFUN(ftello, ( FILE *)); -#else -int _EXFUN(fseeko, (FILE *, off_t, int)); -off_t _EXFUN(ftello, ( FILE *)); -#endif -#endif -#if __GNU_VISIBLE -int _EXFUN(fcloseall, (_VOID)); -#endif -#if !defined(__STRICT_ANSI__) || (__STDC_VERSION__ >= 199901L) || (__cplusplus >= 201103L) -#ifndef _REENT_ONLY -int _EXFUN(asiprintf, (char **, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -char * _EXFUN(asniprintf, (char *, size_t *, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -char * _EXFUN(asnprintf, (char *__restrict, size_t *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(asprintf, (char **__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -#ifndef diprintf -int _EXFUN(diprintf, (int, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -#endif -int _EXFUN(fiprintf, (FILE *, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -int _EXFUN(fiscanf, (FILE *, const char *, ...) - _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); -int _EXFUN(iprintf, (const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 1, 2)))); -int _EXFUN(iscanf, (const char *, ...) - _ATTRIBUTE ((__format__ (__scanf__, 1, 2)))); -int _EXFUN(siprintf, (char *, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -int _EXFUN(siscanf, (const char *, const char *, ...) - _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); -int _EXFUN(snprintf, (char *__restrict, size_t, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(sniprintf, (char *, size_t, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(vasiprintf, (char **, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -char * _EXFUN(vasniprintf, (char *, size_t *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -char * _EXFUN(vasnprintf, (char *, size_t *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(vasprintf, (char **, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -int _EXFUN(vdiprintf, (int, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -int _EXFUN(vfiprintf, (FILE *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -int _EXFUN(vfiscanf, (FILE *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 2, 0)))); -int _EXFUN(vfscanf, (FILE *__restrict, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 2, 0)))); -int _EXFUN(viprintf, (const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 1, 0)))); -int _EXFUN(viscanf, (const char *, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 1, 0)))); -int _EXFUN(vscanf, (const char *, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 1, 0)))); -int _EXFUN(vsiprintf, (char *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -int _EXFUN(vsiscanf, (const char *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 2, 0)))); -int _EXFUN(vsniprintf, (char *, size_t, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(vsnprintf, (char *__restrict, size_t, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(vsscanf, (const char *__restrict, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 2, 0)))); -#endif /* !_REENT_ONLY */ -#endif /* !__STRICT_ANSI__ */ - -/* - * Routines in POSIX 1003.1:2001. - */ - -#ifndef __STRICT_ANSI__ -#ifndef _REENT_ONLY -FILE * _EXFUN(fdopen, (int, const char *)); -#endif -int _EXFUN(fileno, (FILE *)); -int _EXFUN(getw, (FILE *)); -int _EXFUN(pclose, (FILE *)); -FILE * _EXFUN(popen, (const char *, const char *)); -int _EXFUN(putw, (int, FILE *)); -void _EXFUN(setbuffer, (FILE *, char *, int)); -int _EXFUN(setlinebuf, (FILE *)); -int _EXFUN(getc_unlocked, (FILE *)); -int _EXFUN(getchar_unlocked, (void)); -void _EXFUN(flockfile, (FILE *)); -int _EXFUN(ftrylockfile, (FILE *)); -void _EXFUN(funlockfile, (FILE *)); -int _EXFUN(putc_unlocked, (int, FILE *)); -int _EXFUN(putchar_unlocked, (int)); -#endif /* ! __STRICT_ANSI__ */ - -/* - * Routines in POSIX 1003.1:200x. - */ - -#ifndef __STRICT_ANSI__ -# ifndef _REENT_ONLY -# ifndef dprintf -int _EXFUN(dprintf, (int, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -# endif -FILE * _EXFUN(fmemopen, (void *__restrict, size_t, const char *__restrict)); -/* getdelim - see __getdelim for now */ -/* getline - see __getline for now */ -FILE * _EXFUN(open_memstream, (char **, size_t *)); -#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 -int _EXFUN(renameat, (int, const char *, int, const char *)); -#endif -int _EXFUN(vdprintf, (int, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -# endif -#endif - -/* - * Recursive versions of the above. - */ - -int _EXFUN(_asiprintf_r, (struct _reent *, char **, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -char * _EXFUN(_asniprintf_r, (struct _reent *, char *, size_t *, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 4, 5)))); -char * _EXFUN(_asnprintf_r, (struct _reent *, char *__restrict, size_t *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 4, 5)))); -int _EXFUN(_asprintf_r, (struct _reent *, char **__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(_diprintf_r, (struct _reent *, int, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(_dprintf_r, (struct _reent *, int, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(_fclose_r, (struct _reent *, FILE *)); -int _EXFUN(_fcloseall_r, (struct _reent *)); -FILE * _EXFUN(_fdopen_r, (struct _reent *, int, const char *)); -int _EXFUN(_fflush_r, (struct _reent *, FILE *)); -int _EXFUN(_fgetc_r, (struct _reent *, FILE *)); -int _EXFUN(_fgetc_unlocked_r, (struct _reent *, FILE *)); -char * _EXFUN(_fgets_r, (struct _reent *, char *__restrict, int, FILE *__restrict)); -char * _EXFUN(_fgets_unlocked_r, (struct _reent *, char *__restrict, int, FILE *__restrict)); -#ifdef _COMPILING_NEWLIB -int _EXFUN(_fgetpos_r, (struct _reent *, FILE *__restrict, _fpos_t *__restrict)); -int _EXFUN(_fsetpos_r, (struct _reent *, FILE *, const _fpos_t *)); -#else -int _EXFUN(_fgetpos_r, (struct _reent *, FILE *, fpos_t *)); -int _EXFUN(_fsetpos_r, (struct _reent *, FILE *, const fpos_t *)); -#endif -int _EXFUN(_fiprintf_r, (struct _reent *, FILE *, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(_fiscanf_r, (struct _reent *, FILE *, const char *, ...) - _ATTRIBUTE ((__format__ (__scanf__, 3, 4)))); -FILE * _EXFUN(_fmemopen_r, (struct _reent *, void *__restrict, size_t, const char *__restrict)); -FILE * _EXFUN(_fopen_r, (struct _reent *, const char *__restrict, const char *__restrict)); -FILE * _EXFUN(_freopen_r, (struct _reent *, const char *__restrict, const char *__restrict, FILE *__restrict)); -int _EXFUN(_fprintf_r, (struct _reent *, FILE *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(_fpurge_r, (struct _reent *, FILE *)); -int _EXFUN(_fputc_r, (struct _reent *, int, FILE *)); -int _EXFUN(_fputc_unlocked_r, (struct _reent *, int, FILE *)); -int _EXFUN(_fputs_r, (struct _reent *, const char *__restrict, FILE *__restrict)); -int _EXFUN(_fputs_unlocked_r, (struct _reent *, const char *__restrict, FILE *__restrict)); -size_t _EXFUN(_fread_r, (struct _reent *, _PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); -size_t _EXFUN(_fread_unlocked_r, (struct _reent *, _PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); -int _EXFUN(_fscanf_r, (struct _reent *, FILE *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__scanf__, 3, 4)))); -int _EXFUN(_fseek_r, (struct _reent *, FILE *, long, int)); -int _EXFUN(_fseeko_r,(struct _reent *, FILE *, _off_t, int)); -long _EXFUN(_ftell_r, (struct _reent *, FILE *)); -_off_t _EXFUN(_ftello_r,(struct _reent *, FILE *)); -void _EXFUN(_rewind_r, (struct _reent *, FILE *)); -size_t _EXFUN(_fwrite_r, (struct _reent *, const _PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); -size_t _EXFUN(_fwrite_unlocked_r, (struct _reent *, const _PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); -int _EXFUN(_getc_r, (struct _reent *, FILE *)); -int _EXFUN(_getc_unlocked_r, (struct _reent *, FILE *)); -int _EXFUN(_getchar_r, (struct _reent *)); -int _EXFUN(_getchar_unlocked_r, (struct _reent *)); -char * _EXFUN(_gets_r, (struct _reent *, char *)); -int _EXFUN(_iprintf_r, (struct _reent *, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -int _EXFUN(_iscanf_r, (struct _reent *, const char *, ...) - _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); -FILE * _EXFUN(_open_memstream_r, (struct _reent *, char **, size_t *)); -void _EXFUN(_perror_r, (struct _reent *, const char *)); -int _EXFUN(_printf_r, (struct _reent *, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -int _EXFUN(_putc_r, (struct _reent *, int, FILE *)); -int _EXFUN(_putc_unlocked_r, (struct _reent *, int, FILE *)); -int _EXFUN(_putchar_unlocked_r, (struct _reent *, int)); -int _EXFUN(_putchar_r, (struct _reent *, int)); -int _EXFUN(_puts_r, (struct _reent *, const char *)); -int _EXFUN(_remove_r, (struct _reent *, const char *)); -int _EXFUN(_rename_r, (struct _reent *, - const char *_old, const char *_new)); -int _EXFUN(_scanf_r, (struct _reent *, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); -int _EXFUN(_siprintf_r, (struct _reent *, char *, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(_siscanf_r, (struct _reent *, const char *, const char *, ...) - _ATTRIBUTE ((__format__ (__scanf__, 3, 4)))); -int _EXFUN(_sniprintf_r, (struct _reent *, char *, size_t, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 4, 5)))); -int _EXFUN(_snprintf_r, (struct _reent *, char *__restrict, size_t, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 4, 5)))); -int _EXFUN(_sprintf_r, (struct _reent *, char *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(_sscanf_r, (struct _reent *, const char *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__scanf__, 3, 4)))); -char * _EXFUN(_tempnam_r, (struct _reent *, const char *, const char *)); -FILE * _EXFUN(_tmpfile_r, (struct _reent *)); -char * _EXFUN(_tmpnam_r, (struct _reent *, char *)); -int _EXFUN(_ungetc_r, (struct _reent *, int, FILE *)); -int _EXFUN(_vasiprintf_r, (struct _reent *, char **, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -char * _EXFUN(_vasniprintf_r, (struct _reent*, char *, size_t *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 4, 0)))); -char * _EXFUN(_vasnprintf_r, (struct _reent*, char *, size_t *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 4, 0)))); -int _EXFUN(_vasprintf_r, (struct _reent *, char **, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_vdiprintf_r, (struct _reent *, int, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_vdprintf_r, (struct _reent *, int, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_vfiprintf_r, (struct _reent *, FILE *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_vfiscanf_r, (struct _reent *, FILE *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 3, 0)))); -int _EXFUN(_vfprintf_r, (struct _reent *, FILE *__restrict, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_vfscanf_r, (struct _reent *, FILE *__restrict, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 3, 0)))); -int _EXFUN(_viprintf_r, (struct _reent *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -int _EXFUN(_viscanf_r, (struct _reent *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 2, 0)))); -int _EXFUN(_vprintf_r, (struct _reent *, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -int _EXFUN(_vscanf_r, (struct _reent *, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 2, 0)))); -int _EXFUN(_vsiprintf_r, (struct _reent *, char *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_vsiscanf_r, (struct _reent *, const char *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 3, 0)))); -int _EXFUN(_vsniprintf_r, (struct _reent *, char *, size_t, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 4, 0)))); -int _EXFUN(_vsnprintf_r, (struct _reent *, char *__restrict, size_t, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 4, 0)))); -int _EXFUN(_vsprintf_r, (struct _reent *, char *__restrict, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_vsscanf_r, (struct _reent *, const char *__restrict, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 3, 0)))); - -/* Other extensions. */ - -int _EXFUN(fpurge, (FILE *)); -ssize_t _EXFUN(__getdelim, (char **, size_t *, int, FILE *)); -ssize_t _EXFUN(__getline, (char **, size_t *, FILE *)); - -#if __BSD_VISIBLE -void _EXFUN(clearerr_unlocked, (FILE *)); -int _EXFUN(feof_unlocked, (FILE *)); -int _EXFUN(ferror_unlocked, (FILE *)); -int _EXFUN(fileno_unlocked, (FILE *)); -int _EXFUN(fflush_unlocked, (FILE *)); -int _EXFUN(fgetc_unlocked, (FILE *)); -int _EXFUN(fputc_unlocked, (int, FILE *)); -size_t _EXFUN(fread_unlocked, (_PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); -size_t _EXFUN(fwrite_unlocked, (const _PTR __restrict , size_t _size, size_t _n, FILE *)); -#endif - -#if __GNU_VISIBLE -char * _EXFUN(fgets_unlocked, (char *__restrict, int, FILE *__restrict)); -int _EXFUN(fputs_unlocked, (const char *__restrict, FILE *__restrict)); -#endif - -#ifdef __LARGE64_FILES -#if !defined(__CYGWIN__) || defined(_COMPILING_NEWLIB) -FILE * _EXFUN(fdopen64, (int, const char *)); -FILE * _EXFUN(fopen64, (const char *, const char *)); -FILE * _EXFUN(freopen64, (_CONST char *, _CONST char *, FILE *)); -_off64_t _EXFUN(ftello64, (FILE *)); -_off64_t _EXFUN(fseeko64, (FILE *, _off64_t, int)); -int _EXFUN(fgetpos64, (FILE *, _fpos64_t *)); -int _EXFUN(fsetpos64, (FILE *, const _fpos64_t *)); -FILE * _EXFUN(tmpfile64, (void)); - -FILE * _EXFUN(_fdopen64_r, (struct _reent *, int, const char *)); -FILE * _EXFUN(_fopen64_r, (struct _reent *,const char *, const char *)); -FILE * _EXFUN(_freopen64_r, (struct _reent *, _CONST char *, _CONST char *, FILE *)); -_off64_t _EXFUN(_ftello64_r, (struct _reent *, FILE *)); -_off64_t _EXFUN(_fseeko64_r, (struct _reent *, FILE *, _off64_t, int)); -int _EXFUN(_fgetpos64_r, (struct _reent *, FILE *, _fpos64_t *)); -int _EXFUN(_fsetpos64_r, (struct _reent *, FILE *, const _fpos64_t *)); -FILE * _EXFUN(_tmpfile64_r, (struct _reent *)); -#endif /* !__CYGWIN__ */ -#endif /* __LARGE64_FILES */ - -/* - * Routines internal to the implementation. - */ - -int _EXFUN(__srget_r, (struct _reent *, FILE *)); -int _EXFUN(__swbuf_r, (struct _reent *, int, FILE *)); - -/* - * Stdio function-access interface. - */ - -#ifndef __STRICT_ANSI__ -# ifdef __LARGE64_FILES -FILE *_EXFUN(funopen,(const _PTR __cookie, - int (*__readfn)(_PTR __c, char *__buf, - _READ_WRITE_BUFSIZE_TYPE __n), - int (*__writefn)(_PTR __c, const char *__buf, - _READ_WRITE_BUFSIZE_TYPE __n), - _fpos64_t (*__seekfn)(_PTR __c, _fpos64_t __off, int __whence), - int (*__closefn)(_PTR __c))); -FILE *_EXFUN(_funopen_r,(struct _reent *, const _PTR __cookie, - int (*__readfn)(_PTR __c, char *__buf, - _READ_WRITE_BUFSIZE_TYPE __n), - int (*__writefn)(_PTR __c, const char *__buf, - _READ_WRITE_BUFSIZE_TYPE __n), - _fpos64_t (*__seekfn)(_PTR __c, _fpos64_t __off, int __whence), - int (*__closefn)(_PTR __c))); -# else -FILE *_EXFUN(funopen,(const _PTR __cookie, - int (*__readfn)(_PTR __cookie, char *__buf, - _READ_WRITE_BUFSIZE_TYPE __n), - int (*__writefn)(_PTR __cookie, const char *__buf, - _READ_WRITE_BUFSIZE_TYPE __n), - fpos_t (*__seekfn)(_PTR __cookie, fpos_t __off, int __whence), - int (*__closefn)(_PTR __cookie))); -FILE *_EXFUN(_funopen_r,(struct _reent *, const _PTR __cookie, - int (*__readfn)(_PTR __cookie, char *__buf, - _READ_WRITE_BUFSIZE_TYPE __n), - int (*__writefn)(_PTR __cookie, const char *__buf, - _READ_WRITE_BUFSIZE_TYPE __n), - fpos_t (*__seekfn)(_PTR __cookie, fpos_t __off, int __whence), - int (*__closefn)(_PTR __cookie))); -# endif /* !__LARGE64_FILES */ - -# define fropen(__cookie, __fn) funopen(__cookie, __fn, (int (*)())0, \ - (fpos_t (*)())0, (int (*)())0) -# define fwopen(__cookie, __fn) funopen(__cookie, (int (*)())0, __fn, \ - (fpos_t (*)())0, (int (*)())0) - -typedef ssize_t cookie_read_function_t(void *__cookie, char *__buf, size_t __n); -typedef ssize_t cookie_write_function_t(void *__cookie, const char *__buf, - size_t __n); -# ifdef __LARGE64_FILES -typedef int cookie_seek_function_t(void *__cookie, _off64_t *__off, - int __whence); -# else -typedef int cookie_seek_function_t(void *__cookie, off_t *__off, int __whence); -# endif /* !__LARGE64_FILES */ -typedef int cookie_close_function_t(void *__cookie); -typedef struct -{ - /* These four struct member names are dictated by Linux; hopefully, - they don't conflict with any macros. */ - cookie_read_function_t *read; - cookie_write_function_t *write; - cookie_seek_function_t *seek; - cookie_close_function_t *close; -} cookie_io_functions_t; -FILE *_EXFUN(fopencookie,(void *__cookie, - const char *__mode, cookie_io_functions_t __functions)); -FILE *_EXFUN(_fopencookie_r,(struct _reent *, void *__cookie, - const char *__mode, cookie_io_functions_t __functions)); -#endif /* ! __STRICT_ANSI__ */ - -#ifndef __CUSTOM_FILE_IO__ -/* - * The __sfoo macros are here so that we can - * define function versions in the C library. - */ -#define __sgetc_raw_r(__ptr, __f) (--(__f)->_r < 0 ? __srget_r(__ptr, __f) : (int)(*(__f)->_p++)) - -#ifdef __SCLE -/* For a platform with CR/LF, additional logic is required by - __sgetc_r which would otherwise simply be a macro; therefore we - use an inlined function. The function is only meant to be inlined - in place as used and the function body should never be emitted. - - There are two possible means to this end when compiling with GCC, - one when compiling with a standard C99 compiler, and for other - compilers we're just stuck. At the moment, this issue only - affects the Cygwin target, so we'll most likely be using GCC. */ - -_ELIDABLE_INLINE int __sgetc_r(struct _reent *__ptr, FILE *__p); - -_ELIDABLE_INLINE int __sgetc_r(struct _reent *__ptr, FILE *__p) - { - int __c = __sgetc_raw_r(__ptr, __p); - if ((__p->_flags & __SCLE) && (__c == '\r')) - { - int __c2 = __sgetc_raw_r(__ptr, __p); - if (__c2 == '\n') - __c = __c2; - else - ungetc(__c2, __p); - } - return __c; - } -#else -#define __sgetc_r(__ptr, __p) __sgetc_raw_r(__ptr, __p) -#endif - -#ifdef _never /* __GNUC__ */ -/* If this inline is actually used, then systems using coff debugging - info get hopelessly confused. 21sept93 rich@cygnus.com. */ -_ELIDABLE_INLINE int __sputc_r(struct _reent *_ptr, int _c, FILE *_p) { - if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n')) - return (*_p->_p++ = _c); - else - return (__swbuf_r(_ptr, _c, _p)); -} -#else -/* - * This has been tuned to generate reasonable code on the vax using pcc - */ -#define __sputc_raw_r(__ptr, __c, __p) \ - (--(__p)->_w < 0 ? \ - (__p)->_w >= (__p)->_lbfsize ? \ - (*(__p)->_p = (__c)), *(__p)->_p != '\n' ? \ - (int)*(__p)->_p++ : \ - __swbuf_r(__ptr, '\n', __p) : \ - __swbuf_r(__ptr, (int)(__c), __p) : \ - (*(__p)->_p = (__c), (int)*(__p)->_p++)) -#ifdef __SCLE -#define __sputc_r(__ptr, __c, __p) \ - ((((__p)->_flags & __SCLE) && ((__c) == '\n')) \ - ? __sputc_raw_r(__ptr, '\r', (__p)) : 0 , \ - __sputc_raw_r((__ptr), (__c), (__p))) -#else -#define __sputc_r(__ptr, __c, __p) __sputc_raw_r(__ptr, __c, __p) -#endif -#endif - -#define __sfeof(p) ((int)(((p)->_flags & __SEOF) != 0)) -#define __sferror(p) ((int)(((p)->_flags & __SERR) != 0)) -#define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF))) -#define __sfileno(p) ((p)->_file) - -#ifndef _REENT_SMALL -#define feof(p) __sfeof(p) -#define ferror(p) __sferror(p) -#define clearerr(p) __sclearerr(p) - -#if __BSD_VISIBLE -#define feof_unlocked(p) __sfeof(p) -#define ferror_unlocked(p) __sferror(p) -#define clearerr_unlocked(p) __sclearerr(p) -#endif /* __BSD_VISIBLE */ -#endif /* _REENT_SMALL */ - -#if 0 /*ndef __STRICT_ANSI__ - FIXME: must initialize stdio first, use fn */ -#define fileno(p) __sfileno(p) -#endif - -#ifndef __CYGWIN__ -#ifndef lint -#define getc(fp) __sgetc_r(_REENT, fp) -#define putc(x, fp) __sputc_r(_REENT, x, fp) -#endif /* lint */ -#endif /* __CYGWIN__ */ - -#ifndef __STRICT_ANSI__ -/* fast always-buffered version, true iff error */ -#define fast_putc(x,p) (--(p)->_w < 0 ? \ - __swbuf_r(_REENT, (int)(x), p) == EOF : (*(p)->_p = (x), (p)->_p++, 0)) - -#define L_cuserid 9 /* posix says it goes in stdio.h :( */ -#ifdef __CYGWIN__ -#define L_ctermid 16 -#endif -#endif - -#endif /* !__CUSTOM_FILE_IO__ */ - -#define getchar() getc(stdin) -#define putchar(x) putc(x, stdout) - -#ifndef __STRICT_ANSI__ -#define getchar_unlocked() getc_unlocked(stdin) -#define putchar_unlocked(x) putc_unlocked(x, stdout) -#endif - -_END_STD_C - -#endif /* _STDIO_H_ */ diff --git a/tools/sdk/include/newlib/stdio_ext.h b/tools/sdk/include/newlib/stdio_ext.h deleted file mode 100644 index 029ab025353..00000000000 --- a/tools/sdk/include/newlib/stdio_ext.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * stdio_ext.h - * - * Definitions for I/O internal operations, originally from Solaris. - */ - -#ifndef _STDIO_EXT_H_ -#define _STDIO_EXT_H_ - -#ifdef __rtems__ -#error " not supported" -#endif - -#include - -#define FSETLOCKING_QUERY 0 -#define FSETLOCKING_INTERNAL 1 -#define FSETLOCKING_BYCALLER 2 - -_BEGIN_STD_C - -void _EXFUN(__fpurge,(FILE *)); -int _EXFUN(__fsetlocking,(FILE *, int)); - -/* TODO: - - void _flushlbf (void); -*/ - -#ifdef __GNUC__ - -_ELIDABLE_INLINE size_t -__fbufsize (FILE *__fp) { return (size_t) __fp->_bf._size; } - -_ELIDABLE_INLINE int -__freading (FILE *__fp) { return (__fp->_flags & __SRD) != 0; } - -_ELIDABLE_INLINE int -__fwriting (FILE *__fp) { return (__fp->_flags & __SWR) != 0; } - -_ELIDABLE_INLINE int -__freadable (FILE *__fp) { return (__fp->_flags & (__SRD | __SRW)) != 0; } - -_ELIDABLE_INLINE int -__fwritable (FILE *__fp) { return (__fp->_flags & (__SWR | __SRW)) != 0; } - -_ELIDABLE_INLINE int -__flbf (FILE *__fp) { return (__fp->_flags & __SLBF) != 0; } - -_ELIDABLE_INLINE size_t -__fpending (FILE *__fp) { return __fp->_p - __fp->_bf._base; } - -#else - -size_t _EXFUN(__fbufsize,(FILE *)); -int _EXFUN(__freading,(FILE *)); -int _EXFUN(__fwriting,(FILE *)); -int _EXFUN(__freadable,(FILE *)); -int _EXFUN(__fwritable,(FILE *)); -int _EXFUN(__flbf,(FILE *)); -size_t _EXFUN(__fpending,(FILE *)); - -#ifndef __cplusplus - -#define __fbufsize(__fp) ((size_t) (__fp)->_bf._size) -#define __freading(__fp) (((__fp)->_flags & __SRD) != 0) -#define __fwriting(__fp) (((__fp)->_flags & __SWR) != 0) -#define __freadable(__fp) (((__fp)->_flags & (__SRD | __SRW)) != 0) -#define __fwritable(__fp) (((__fp)->_flags & (__SWR | __SRW)) != 0) -#define __flbf(__fp) (((__fp)->_flags & __SLBF) != 0) -#define __fpending(__fp) ((size_t) ((__fp)->_p - (__fp)->_bf._base)) - -#endif /* __cplusplus */ - -#endif /* __GNUC__ */ - -_END_STD_C - -#endif /* _STDIO_EXT_H_ */ diff --git a/tools/sdk/include/newlib/stdlib.h b/tools/sdk/include/newlib/stdlib.h deleted file mode 100644 index 254ddd71f7b..00000000000 --- a/tools/sdk/include/newlib/stdlib.h +++ /dev/null @@ -1,297 +0,0 @@ -/* - * stdlib.h - * - * Definitions for common types, variables, and functions. - */ - -#ifndef _STDLIB_H_ -#define _STDLIB_H_ - -#include -#include "_ansi.h" - -#define __need_size_t -#define __need_wchar_t -#define __need_NULL -#include - -#include -#include -#include -#ifndef __STRICT_ANSI__ -#include -#endif - -#ifdef __CYGWIN__ -#include -#endif - -_BEGIN_STD_C - -typedef struct -{ - int quot; /* quotient */ - int rem; /* remainder */ -} div_t; - -typedef struct -{ - long quot; /* quotient */ - long rem; /* remainder */ -} ldiv_t; - -#if !defined(__STRICT_ANSI__) || \ - (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ - (defined(__cplusplus) && __cplusplus >= 201103L) -typedef struct -{ - long long int quot; /* quotient */ - long long int rem; /* remainder */ -} lldiv_t; -#endif - -#ifndef __compar_fn_t_defined -#define __compar_fn_t_defined -typedef int (*__compar_fn_t) (const _PTR, const _PTR); -#endif - -#ifndef NULL -#define NULL 0 -#endif - -#define EXIT_FAILURE 1 -#define EXIT_SUCCESS 0 - -#define RAND_MAX __RAND_MAX - -int _EXFUN(__locale_mb_cur_max,(_VOID)); - -#define MB_CUR_MAX __locale_mb_cur_max() - -_VOID _EXFUN(abort,(_VOID) _ATTRIBUTE ((__noreturn__))); -int _EXFUN(abs,(int)); -int _EXFUN(atexit,(_VOID (*__func)(_VOID))); -double _EXFUN(atof,(const char *__nptr)); -#ifndef __STRICT_ANSI__ -float _EXFUN(atoff,(const char *__nptr)); -#endif -int _EXFUN(atoi,(const char *__nptr)); -int _EXFUN(_atoi_r,(struct _reent *, const char *__nptr)); -long _EXFUN(atol,(const char *__nptr)); -long _EXFUN(_atol_r,(struct _reent *, const char *__nptr)); -_PTR _EXFUN(bsearch,(const _PTR __key, - const _PTR __base, - size_t __nmemb, - size_t __size, - __compar_fn_t _compar)); -_PTR _EXFUN_NOTHROW(calloc,(size_t __nmemb, size_t __size)); -div_t _EXFUN(div,(int __numer, int __denom)); -_VOID _EXFUN(exit,(int __status) _ATTRIBUTE ((__noreturn__))); -_VOID _EXFUN_NOTHROW(free,(_PTR)); -char * _EXFUN(getenv,(const char *__string)); -char * _EXFUN(_getenv_r,(struct _reent *, const char *__string)); -char * _EXFUN(_findenv,(_CONST char *, int *)); -char * _EXFUN(_findenv_r,(struct _reent *, _CONST char *, int *)); -#ifndef __STRICT_ANSI__ -extern char *suboptarg; /* getsubopt(3) external variable */ -int _EXFUN(getsubopt,(char **, char * const *, char **)); -#endif -long _EXFUN(labs,(long)); -ldiv_t _EXFUN(ldiv,(long __numer, long __denom)); -_PTR _EXFUN_NOTHROW(malloc,(size_t __size)); -int _EXFUN(mblen,(const char *, size_t)); -int _EXFUN(_mblen_r,(struct _reent *, const char *, size_t, _mbstate_t *)); -int _EXFUN(mbtowc,(wchar_t *__restrict, const char *__restrict, size_t)); -int _EXFUN(_mbtowc_r,(struct _reent *, wchar_t *__restrict, const char *__restrict, size_t, _mbstate_t *)); -int _EXFUN(wctomb,(char *, wchar_t)); -int _EXFUN(_wctomb_r,(struct _reent *, char *, wchar_t, _mbstate_t *)); -size_t _EXFUN(mbstowcs,(wchar_t *__restrict, const char *__restrict, size_t)); -size_t _EXFUN(_mbstowcs_r,(struct _reent *, wchar_t *__restrict, const char *__restrict, size_t, _mbstate_t *)); -size_t _EXFUN(wcstombs,(char *__restrict, const wchar_t *__restrict, size_t)); -size_t _EXFUN(_wcstombs_r,(struct _reent *, char *__restrict, const wchar_t *__restrict, size_t, _mbstate_t *)); -#ifndef __STRICT_ANSI__ -#ifndef _REENT_ONLY -char * _EXFUN(mkdtemp,(char *)); -int _EXFUN(mkostemp,(char *, int)); -int _EXFUN(mkostemps,(char *, int, int)); -int _EXFUN(mkstemp,(char *)); -int _EXFUN(mkstemps,(char *, int)); -#if (__GNUC__ < 4) || defined(__XTENSA__) -char * _EXFUN(mktemp,(char *)); -#else -char * _EXFUN(mktemp,(char *) _ATTRIBUTE ((__warning__ ("the use of `mktemp' is dangerous; use `mkstemp' instead")))); -#endif -#endif -char * _EXFUN(_mkdtemp_r, (struct _reent *, char *)); -int _EXFUN(_mkostemp_r, (struct _reent *, char *, int)); -int _EXFUN(_mkostemps_r, (struct _reent *, char *, int, int)); -int _EXFUN(_mkstemp_r, (struct _reent *, char *)); -int _EXFUN(_mkstemps_r, (struct _reent *, char *, int)); -#if (__GNUC__ < 4) || defined(__XTENSA__) -char * _EXFUN(_mktemp_r, (struct _reent *, char *)); -#else -char * _EXFUN(_mktemp_r, (struct _reent *, char *) _ATTRIBUTE ((__warning__ ("the use of `mktemp' is dangerous; use `mkstemp' instead")))); -#endif -#endif -_VOID _EXFUN(qsort,(_PTR __base, size_t __nmemb, size_t __size, __compar_fn_t _compar)); -int _EXFUN(rand,(_VOID)); -_PTR _EXFUN_NOTHROW(realloc,(_PTR __r, size_t __size)); -#ifndef __STRICT_ANSI__ -_PTR _EXFUN(reallocf,(_PTR __r, size_t __size)); -char * _EXFUN(realpath, (const char *__restrict path, char *__restrict resolved_path)); -#endif -_VOID _EXFUN(srand,(unsigned __seed)); -double _EXFUN(strtod,(const char *__restrict __n, char **__restrict __end_PTR)); -double _EXFUN(_strtod_r,(struct _reent *,const char *__restrict __n, char **__restrict __end_PTR)); -#if !defined(__STRICT_ANSI__) || \ - (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ - (defined(__cplusplus) && __cplusplus >= 201103L) -float _EXFUN(strtof,(const char *__restrict __n, char **__restrict __end_PTR)); -#endif -#ifndef __STRICT_ANSI__ -/* the following strtodf interface is deprecated...use strtof instead */ -# ifndef strtodf -# define strtodf strtof -# endif -#endif -long _EXFUN(strtol,(const char *__restrict __n, char **__restrict __end_PTR, int __base)); -long _EXFUN(_strtol_r,(struct _reent *,const char *__restrict __n, char **__restrict __end_PTR, int __base)); -unsigned long _EXFUN(strtoul,(const char *__restrict __n, char **__restrict __end_PTR, int __base)); -unsigned long _EXFUN(_strtoul_r,(struct _reent *,const char *__restrict __n, char **__restrict __end_PTR, int __base)); - -int _EXFUN(system,(const char *__string)); - -#ifndef __STRICT_ANSI__ -long _EXFUN(a64l,(const char *__input)); -char * _EXFUN(l64a,(long __input)); -char * _EXFUN(_l64a_r,(struct _reent *,long __input)); -int _EXFUN(on_exit,(_VOID (*__func)(int, _PTR),_PTR __arg)); -#endif /* ! __STRICT_ANSI__ */ -#if !defined(__STRICT_ANSI__) || \ - (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ - (defined(__cplusplus) && __cplusplus >= 201103L) -_VOID _EXFUN(_Exit,(int __status) _ATTRIBUTE ((__noreturn__))); -#endif -#ifndef __STRICT_ANSI__ -int _EXFUN(putenv,(char *__string)); -int _EXFUN(_putenv_r,(struct _reent *, char *__string)); -_PTR _EXFUN(_reallocf_r,(struct _reent *, _PTR, size_t)); -int _EXFUN(setenv,(const char *__string, const char *__value, int __overwrite)); -int _EXFUN(_setenv_r,(struct _reent *, const char *__string, const char *__value, int __overwrite)); - -char * _EXFUN(gcvt,(double,int,char *)); -char * _EXFUN(gcvtf,(float,int,char *)); -char * _EXFUN(fcvt,(double,int,int *,int *)); -char * _EXFUN(fcvtf,(float,int,int *,int *)); -char * _EXFUN(ecvt,(double,int,int *,int *)); -char * _EXFUN(ecvtbuf,(double, int, int*, int*, char *)); -char * _EXFUN(fcvtbuf,(double, int, int*, int*, char *)); -char * _EXFUN(ecvtf,(float,int,int *,int *)); -char * _EXFUN(dtoa,(double, int, int, int *, int*, char**)); -#endif -char * _EXFUN(__itoa,(int, char *, int)); -char * _EXFUN(__utoa,(unsigned, char *, int)); -#ifndef __STRICT_ANSI__ -char * _EXFUN(itoa,(int, char *, int)); -char * _EXFUN(utoa,(unsigned, char *, int)); -int _EXFUN(rand_r,(unsigned *__seed)); - -double _EXFUN(drand48,(_VOID)); -double _EXFUN(_drand48_r,(struct _reent *)); -double _EXFUN(erand48,(unsigned short [3])); -double _EXFUN(_erand48_r,(struct _reent *, unsigned short [3])); -long _EXFUN(jrand48,(unsigned short [3])); -long _EXFUN(_jrand48_r,(struct _reent *, unsigned short [3])); -_VOID _EXFUN(lcong48,(unsigned short [7])); -_VOID _EXFUN(_lcong48_r,(struct _reent *, unsigned short [7])); -long _EXFUN(lrand48,(_VOID)); -long _EXFUN(_lrand48_r,(struct _reent *)); -long _EXFUN(mrand48,(_VOID)); -long _EXFUN(_mrand48_r,(struct _reent *)); -long _EXFUN(nrand48,(unsigned short [3])); -long _EXFUN(_nrand48_r,(struct _reent *, unsigned short [3])); -unsigned short * - _EXFUN(seed48,(unsigned short [3])); -unsigned short * - _EXFUN(_seed48_r,(struct _reent *, unsigned short [3])); -_VOID _EXFUN(srand48,(long)); -_VOID _EXFUN(_srand48_r,(struct _reent *, long)); -#endif /* ! __STRICT_ANSI__ */ -#if !defined(__STRICT_ANSI__) || \ - (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ - (defined(__cplusplus) && __cplusplus >= 201103L) -long long _EXFUN(atoll,(const char *__nptr)); -#endif -#ifndef __STRICT_ANSI__ -long long _EXFUN(_atoll_r,(struct _reent *, const char *__nptr)); -#endif /* ! __STRICT_ANSI__ */ -#if !defined(__STRICT_ANSI__) || \ - (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ - (defined(__cplusplus) && __cplusplus >= 201103L) -long long _EXFUN(llabs,(long long)); -lldiv_t _EXFUN(lldiv,(long long __numer, long long __denom)); -long long _EXFUN(strtoll,(const char *__restrict __n, char **__restrict __end_PTR, int __base)); -#endif -#ifndef __STRICT_ANSI__ -long long _EXFUN(_strtoll_r,(struct _reent *, const char *__restrict __n, char **__restrict __end_PTR, int __base)); -#endif /* ! __STRICT_ANSI__ */ -#if !defined(__STRICT_ANSI__) || \ - (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ - (defined(__cplusplus) && __cplusplus >= 201103L) -unsigned long long _EXFUN(strtoull,(const char *__restrict __n, char **__restrict __end_PTR, int __base)); -#endif -#ifndef __STRICT_ANSI__ -unsigned long long _EXFUN(_strtoull_r,(struct _reent *, const char *__restrict __n, char **__restrict __end_PTR, int __base)); - -#ifndef __CYGWIN__ -_VOID _EXFUN(cfree,(_PTR)); -int _EXFUN(unsetenv,(const char *__string)); -int _EXFUN(_unsetenv_r,(struct _reent *, const char *__string)); -#endif - -#ifdef __rtems__ -int _EXFUN(posix_memalign,(void **, size_t, size_t)); -#endif - -#endif /* ! __STRICT_ANSI__ */ - -char * _EXFUN(_dtoa_r,(struct _reent *, double, int, int, int *, int*, char**)); -#ifndef __CYGWIN__ -_PTR _EXFUN_NOTHROW(_malloc_r,(struct _reent *, size_t)); -_PTR _EXFUN_NOTHROW(_calloc_r,(struct _reent *, size_t, size_t)); -_VOID _EXFUN_NOTHROW(_free_r,(struct _reent *, _PTR)); -_PTR _EXFUN_NOTHROW(_realloc_r,(struct _reent *, _PTR, size_t)); -_VOID _EXFUN(_mstats_r,(struct _reent *, char *)); -#endif -int _EXFUN(_system_r,(struct _reent *, const char *)); - -_VOID _EXFUN(__eprintf,(const char *, const char *, unsigned int, const char *)); - -/* There are two common qsort_r variants. If you request - _BSD_SOURCE, you get the BSD version; otherwise you get the GNU - version. We want that #undef qsort_r will still let you - invoke the underlying function, but that requires gcc support. */ -#ifdef _BSD_SOURCE -# ifdef __GNUC__ -_VOID _EXFUN(qsort_r,(_PTR __base, size_t __nmemb, size_t __size, _PTR __thunk, int (*_compar)(_PTR, const _PTR, const _PTR))) - __asm__ (__ASMNAME ("__bsd_qsort_r")); -# else -_VOID _EXFUN(__bsd_qsort_r,(_PTR __base, size_t __nmemb, size_t __size, _PTR __thunk, int (*_compar)(_PTR, const _PTR, const _PTR))); -# define qsort_r __bsd_qsort_r -# endif -#elif __GNU_VISIBLE -_VOID _EXFUN(qsort_r,(_PTR __base, size_t __nmemb, size_t __size, int (*_compar)(const _PTR, const _PTR, _PTR), _PTR __thunk)); -#endif - -/* On platforms where long double equals double. */ -#ifdef _HAVE_LONG_DOUBLE -#if !defined(__STRICT_ANSI__) || \ - (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ - (defined(__cplusplus) && __cplusplus >= 201103L) -extern long double strtold (const char *__restrict, char **__restrict); -#endif -#endif /* _HAVE_LONG_DOUBLE */ - -_END_STD_C - -#endif /* _STDLIB_H_ */ diff --git a/tools/sdk/include/newlib/string.h b/tools/sdk/include/newlib/string.h deleted file mode 100644 index af5c9da4d1d..00000000000 --- a/tools/sdk/include/newlib/string.h +++ /dev/null @@ -1,167 +0,0 @@ -/* - * string.h - * - * Definitions for memory and string functions. - */ - -#ifndef _STRING_H_ -#define _STRING_H_ - -#include "_ansi.h" -#include -#include -#include - -#define __need_size_t -#define __need_NULL -#include - -_BEGIN_STD_C - -_PTR _EXFUN(memchr,(const _PTR, int, size_t)); -int _EXFUN(memcmp,(const _PTR, const _PTR, size_t)); -_PTR _EXFUN(memcpy,(_PTR __restrict, const _PTR __restrict, size_t)); -_PTR _EXFUN(memmove,(_PTR, const _PTR, size_t)); -_PTR _EXFUN(memset,(_PTR, int, size_t)); -char *_EXFUN(strcat,(char *__restrict, const char *__restrict)); -char *_EXFUN(strchr,(const char *, int)); -int _EXFUN(strcmp,(const char *, const char *)); -int _EXFUN(strcoll,(const char *, const char *)); -char *_EXFUN(strcpy,(char *__restrict, const char *__restrict)); -size_t _EXFUN(strcspn,(const char *, const char *)); -char *_EXFUN(strerror,(int)); -size_t _EXFUN(strlen,(const char *)); -char *_EXFUN(strncat,(char *__restrict, const char *__restrict, size_t)); -int _EXFUN(strncmp,(const char *, const char *, size_t)); -char *_EXFUN(strncpy,(char *__restrict, const char *__restrict, size_t)); -char *_EXFUN(strpbrk,(const char *, const char *)); -char *_EXFUN(strrchr,(const char *, int)); -size_t _EXFUN(strspn,(const char *, const char *)); -char *_EXFUN(strstr,(const char *, const char *)); -#ifndef _REENT_ONLY -char *_EXFUN(strtok,(char *__restrict, const char *__restrict)); -#endif -size_t _EXFUN(strxfrm,(char *__restrict, const char *__restrict, size_t)); - -#if __POSIX_VISIBLE -char *_EXFUN(strtok_r,(char *__restrict, const char *__restrict, char **__restrict)); -#endif -#if __BSD_VISIBLE -int _EXFUN(bcmp,(const void *, const void *, size_t)); -void _EXFUN(bcopy,(const void *, void *, size_t)); -void _EXFUN(bzero,(void *, size_t)); -int _EXFUN(ffs,(int)); -char *_EXFUN(index,(const char *, int)); -#endif -#if __BSD_VISIBLE || __XSI_VISIBLE -_PTR _EXFUN(memccpy,(_PTR __restrict, const _PTR __restrict, int, size_t)); -#endif -#if __GNU_VISIBLE -_PTR _EXFUN(mempcpy,(_PTR, const _PTR, size_t)); -_PTR _EXFUN(memmem, (const _PTR, size_t, const _PTR, size_t)); -#endif -_PTR _EXFUN(memrchr,(const _PTR, int, size_t)); -#if __GNU_VISIBLE -_PTR _EXFUN(rawmemchr,(const _PTR, int)); -#endif -#if __BSD_VISIBLE -char *_EXFUN(rindex,(const char *, int)); -#endif -char *_EXFUN(stpcpy,(char *__restrict, const char *__restrict)); -char *_EXFUN(stpncpy,(char *__restrict, const char *__restrict, size_t)); -#if __BSD_VISIBLE || __POSIX_VISIBLE -int _EXFUN(strcasecmp,(const char *, const char *)); -#endif -#if __GNU_VISIBLE -char *_EXFUN(strcasestr,(const char *, const char *)); -char *_EXFUN(strchrnul,(const char *, int)); -#endif -#if __XSI_VISIBLE >= 500 -char *_EXFUN(strdup,(const char *)); -#endif -#ifndef __STRICT_ANSI__ -char *_EXFUN(_strdup_r,(struct _reent *, const char *)); -#endif -#if __XSI_VISIBLE >= 700 -char *_EXFUN(strndup,(const char *, size_t)); -#endif - -#ifndef __STRICT_ANSI__ -char *_EXFUN(_strndup_r,(struct _reent *, const char *, size_t)); -#endif - -#if __GNU_VISIBLE -int _EXFUN(ffsl,(long)); -int _EXFUN(ffsll, (long long)); -#endif - -/* There are two common strerror_r variants. If you request - _GNU_SOURCE, you get the GNU version; otherwise you get the POSIX - version. POSIX requires that #undef strerror_r will still let you - invoke the underlying function, but that requires gcc support. */ -#if __GNU_VISIBLE -char *_EXFUN(strerror_r,(int, char *, size_t)); -#else -# ifdef __GNUC__ -int _EXFUN(strerror_r,(int, char *, size_t)) - __asm__ (__ASMNAME ("__xpg_strerror_r")); -# else -int _EXFUN(__xpg_strerror_r,(int, char *, size_t)); -# define strerror_r __xpg_strerror_r -# endif -#endif - -/* Reentrant version of strerror. */ -char * _EXFUN(_strerror_r, (struct _reent *, int, int, int *)); - -#if __BSD_VISIBLE -size_t _EXFUN(strlcat,(char *, const char *, size_t)); -size_t _EXFUN(strlcpy,(char *, const char *, size_t)); -#endif -#if __BSD_VISIBLE || __POSIX_VISIBLE -int _EXFUN(strncasecmp,(const char *, const char *, size_t)); -#endif -#if !defined(__STRICT_ANSI__) || __POSIX_VISIBLE >= 200809 || \ - __XSI_VISIBLE >= 700 -size_t _EXFUN(strnlen,(const char *, size_t)); -#endif -#if __BSD_VISIBLE -char *_EXFUN(strsep,(char **, const char *)); -#endif - -/* - * The origin of these is unknown to me so I am conditionalizing them - * on __STRICT_ANSI__. Finetuning this is definitely needed. --joel - */ -#if !defined(__STRICT_ANSI__) -char *_EXFUN(strlwr,(char *)); -char *_EXFUN(strupr,(char *)); -#endif - -#ifndef DEFS_H /* Kludge to work around problem compiling in gdb */ -char *_EXFUN(strsignal, (int __signo)); -#endif - -#ifdef __CYGWIN__ -int _EXFUN(strtosigno, (const char *__name)); -#endif - -#if defined _GNU_SOURCE && defined __GNUC__ -#define strdupa(__s) \ - (__extension__ ({const char *__in = (__s); \ - size_t __len = strlen (__in) + 1; \ - char * __out = (char *) __builtin_alloca (__len); \ - (char *) memcpy (__out, __in, __len);})) -#define strndupa(__s, __n) \ - (__extension__ ({const char *__in = (__s); \ - size_t __len = strnlen (__in, (__n)) + 1; \ - char *__out = (char *) __builtin_alloca (__len); \ - __out[__len-1] = '\0'; \ - (char *) memcpy (__out, __in, __len-1);})) -#endif /* _GNU_SOURCE && __GNUC__ */ - -#include - -_END_STD_C - -#endif /* _STRING_H_ */ diff --git a/tools/sdk/include/newlib/strings.h b/tools/sdk/include/newlib/strings.h deleted file mode 100644 index 131d81d20c4..00000000000 --- a/tools/sdk/include/newlib/strings.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * strings.h - * - * Definitions for string operations. - */ - -#ifndef _STRINGS_H_ -#define _STRINGS_H_ - -#include "_ansi.h" -#include - -#include /* for size_t */ - -_BEGIN_STD_C - -#if !defined __STRICT_ANSI__ && _POSIX_VERSION < 200809L -/* - * Marked LEGACY in Open Group Base Specifications Issue 6/IEEE Std 1003.1-2004 - * Removed from Open Group Base Specifications Issue 7/IEEE Std 1003.1-2008 - */ -int _EXFUN(bcmp,(const void *, const void *, size_t)); -void _EXFUN(bcopy,(const void *, void *, size_t)); -void _EXFUN(bzero,(void *, size_t)); -char *_EXFUN(index,(const char *, int)); -char *_EXFUN(rindex,(const char *, int)); -#endif /* ! __STRICT_ANSI__ */ - -int _EXFUN(ffs,(int)); -int _EXFUN(strcasecmp,(const char *, const char *)); -int _EXFUN(strncasecmp,(const char *, const char *, size_t)); - -_END_STD_C - -#endif /* _STRINGS_H_ */ diff --git a/tools/sdk/include/newlib/sys/_default_fcntl.h b/tools/sdk/include/newlib/sys/_default_fcntl.h deleted file mode 100644 index eb674ae7975..00000000000 --- a/tools/sdk/include/newlib/sys/_default_fcntl.h +++ /dev/null @@ -1,213 +0,0 @@ - -#ifndef _SYS__DEFAULT_FCNTL_H_ -#ifdef __cplusplus -extern "C" { -#endif -#define _SYS__DEFAULT_FCNTL_H_ -#include <_ansi.h> -#include -#define _FOPEN (-1) /* from sys/file.h, kernel use only */ -#define _FREAD 0x0001 /* read enabled */ -#define _FWRITE 0x0002 /* write enabled */ -#define _FAPPEND 0x0008 /* append (writes guaranteed at the end) */ -#define _FMARK 0x0010 /* internal; mark during gc() */ -#define _FDEFER 0x0020 /* internal; defer for next gc pass */ -#define _FASYNC 0x0040 /* signal pgrp when data ready */ -#define _FSHLOCK 0x0080 /* BSD flock() shared lock present */ -#define _FEXLOCK 0x0100 /* BSD flock() exclusive lock present */ -#define _FCREAT 0x0200 /* open with file create */ -#define _FTRUNC 0x0400 /* open with truncation */ -#define _FEXCL 0x0800 /* error on open if file exists */ -#define _FNBIO 0x1000 /* non blocking I/O (sys5 style) */ -#define _FSYNC 0x2000 /* do all writes synchronously */ -#define _FNONBLOCK 0x4000 /* non blocking I/O (POSIX style) */ -#define _FNDELAY _FNONBLOCK /* non blocking I/O (4.2 style) */ -#define _FNOCTTY 0x8000 /* don't assign a ctty on this open */ - -#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) - -/* - * Flag values for open(2) and fcntl(2) - * The kernel adds 1 to the open modes to turn it into some - * combination of FREAD and FWRITE. - */ -#define O_RDONLY 0 /* +1 == FREAD */ -#define O_WRONLY 1 /* +1 == FWRITE */ -#define O_RDWR 2 /* +1 == FREAD|FWRITE */ -#define O_APPEND _FAPPEND -#define O_CREAT _FCREAT -#define O_TRUNC _FTRUNC -#define O_EXCL _FEXCL -#define O_SYNC _FSYNC -/* O_NDELAY _FNDELAY set in include/fcntl.h */ -/* O_NDELAY _FNBIO set in include/fcntl.h */ -#define O_NONBLOCK _FNONBLOCK -#define O_NOCTTY _FNOCTTY -/* For machines which care - */ -#if defined (__CYGWIN__) -#define _FBINARY 0x10000 -#define _FTEXT 0x20000 -#define _FNOINHERIT 0x40000 -#define _FDIRECT 0x80000 -#define _FNOFOLLOW 0x100000 -#define _FDIRECTORY 0x200000 -#define _FEXECSRCH 0x400000 - -#define O_BINARY _FBINARY -#define O_TEXT _FTEXT -#define O_CLOEXEC _FNOINHERIT -#define O_DIRECT _FDIRECT -#define O_NOFOLLOW _FNOFOLLOW -#define O_DSYNC _FSYNC -#define O_RSYNC _FSYNC -#define O_DIRECTORY _FDIRECTORY -#define O_EXEC _FEXECSRCH -#define O_SEARCH _FEXECSRCH -#endif - -#ifndef _POSIX_SOURCE - -/* - * Flags that work for fcntl(fd, F_SETFL, FXXXX) - */ -#define FAPPEND _FAPPEND -#define FSYNC _FSYNC -#define FASYNC _FASYNC -#define FNBIO _FNBIO -#define FNONBIO _FNONBLOCK /* XXX fix to be NONBLOCK everywhere */ -#define FNDELAY _FNDELAY - -/* - * Flags that are disallowed for fcntl's (FCNTLCANT); - * used for opens, internal state, or locking. - */ -#define FREAD _FREAD -#define FWRITE _FWRITE -#define FMARK _FMARK -#define FDEFER _FDEFER -#define FSHLOCK _FSHLOCK -#define FEXLOCK _FEXLOCK - -/* - * The rest of the flags, used only for opens - */ -#define FOPEN _FOPEN -#define FCREAT _FCREAT -#define FTRUNC _FTRUNC -#define FEXCL _FEXCL -#define FNOCTTY _FNOCTTY - -#endif /* !_POSIX_SOURCE */ - -/* XXX close on exec request; must match UF_EXCLOSE in user.h */ -#define FD_CLOEXEC 1 /* posix */ - -/* fcntl(2) requests */ -#define F_DUPFD 0 /* Duplicate fildes */ -#define F_GETFD 1 /* Get fildes flags (close on exec) */ -#define F_SETFD 2 /* Set fildes flags (close on exec) */ -#define F_GETFL 3 /* Get file flags */ -#define F_SETFL 4 /* Set file flags */ -#ifndef _POSIX_SOURCE -#define F_GETOWN 5 /* Get owner - for ASYNC */ -#define F_SETOWN 6 /* Set owner - for ASYNC */ -#endif /* !_POSIX_SOURCE */ -#define F_GETLK 7 /* Get record-locking information */ -#define F_SETLK 8 /* Set or Clear a record-lock (Non-Blocking) */ -#define F_SETLKW 9 /* Set or Clear a record-lock (Blocking) */ -#ifndef _POSIX_SOURCE -#define F_RGETLK 10 /* Test a remote lock to see if it is blocked */ -#define F_RSETLK 11 /* Set or unlock a remote lock */ -#define F_CNVT 12 /* Convert a fhandle to an open fd */ -#define F_RSETLKW 13 /* Set or Clear remote record-lock(Blocking) */ -#endif /* !_POSIX_SOURCE */ -#ifdef __CYGWIN__ -#define F_DUPFD_CLOEXEC 14 /* As F_DUPFD, but set close-on-exec flag */ -#endif - -/* fcntl(2) flags (l_type field of flock structure) */ -#define F_RDLCK 1 /* read lock */ -#define F_WRLCK 2 /* write lock */ -#define F_UNLCK 3 /* remove lock(s) */ -#ifndef _POSIX_SOURCE -#define F_UNLKSYS 4 /* remove remote locks for a given system */ -#endif /* !_POSIX_SOURCE */ - -#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 || defined(__CYGWIN__) -/* Special descriptor value to denote the cwd in calls to openat(2) etc. */ -#define AT_FDCWD -2 - -/* Flag values for faccessat2) et al. */ -#define AT_EACCESS 1 -#define AT_SYMLINK_NOFOLLOW 2 -#define AT_SYMLINK_FOLLOW 4 -#define AT_REMOVEDIR 8 -#endif - -#if __BSD_VISIBLE -/* lock operations for flock(2) */ -#define LOCK_SH 0x01 /* shared file lock */ -#define LOCK_EX 0x02 /* exclusive file lock */ -#define LOCK_NB 0x04 /* don't block when locking */ -#define LOCK_UN 0x08 /* unlock file */ -#endif - -/*#include */ - -#ifndef __CYGWIN__ -/* file segment locking set data type - information passed to system by user */ -struct flock { - short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */ - short l_whence; /* flag to choose starting offset */ - long l_start; /* relative offset, in bytes */ - long l_len; /* length, in bytes; 0 means lock to EOF */ - short l_pid; /* returned with F_GETLK */ - short l_xxx; /* reserved for future use */ -}; -#endif /* __CYGWIN__ */ - -#ifndef _POSIX_SOURCE -/* extended file segment locking set data type */ -struct eflock { - short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */ - short l_whence; /* flag to choose starting offset */ - long l_start; /* relative offset, in bytes */ - long l_len; /* length, in bytes; 0 means lock to EOF */ - short l_pid; /* returned with F_GETLK */ - short l_xxx; /* reserved for future use */ - long l_rpid; /* Remote process id wanting this lock */ - long l_rsys; /* Remote system id wanting this lock */ -}; -#endif /* !_POSIX_SOURCE */ - -#include -#include /* sigh. for the mode bits for open/creat */ - -extern int open _PARAMS ((const char *, int, ...)); -#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 || defined(__CYGWIN__) -extern int openat _PARAMS ((int, const char *, int, ...)); -#endif -extern int creat _PARAMS ((const char *, mode_t)); -extern int fcntl _PARAMS ((int, int, ...)); -#if __BSD_VISIBLE -extern int flock _PARAMS ((int, int)); -#endif -#ifdef __CYGWIN__ -#include -extern int futimesat _PARAMS ((int, const char *, const struct timeval *)); -#endif - -/* Provide _ prototypes for functions provided by some versions - of newlib. */ -#ifdef _COMPILING_NEWLIB -extern int _open _PARAMS ((const char *, int, ...)); -extern int _fcntl _PARAMS ((int, int, ...)); -#ifdef __LARGE64_FILES -extern int _open64 _PARAMS ((const char *, int, ...)); -#endif -#endif - -#ifdef __cplusplus -} -#endif -#endif /* !_SYS__DEFAULT_FCNTL_H_ */ diff --git a/tools/sdk/include/newlib/sys/_intsup.h b/tools/sdk/include/newlib/sys/_intsup.h deleted file mode 100644 index fa78426c520..00000000000 --- a/tools/sdk/include/newlib/sys/_intsup.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2004, 2005 by - * Ralf Corsepius, Ulm/Germany. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - * - * Modified for xtensa arch & non-long int32_t, removes automatic setting of __have_long32. - */ - -#ifndef _SYS__INTSUP_H -#define _SYS__INTSUP_H - -#include - -#define __STDINT_EXP(x) __##x##__ - -#define __have_longlong64 1 - -#endif /* _SYS__INTSUP_H */ diff --git a/tools/sdk/include/newlib/sys/_types.h b/tools/sdk/include/newlib/sys/_types.h deleted file mode 100644 index 07bc27675af..00000000000 --- a/tools/sdk/include/newlib/sys/_types.h +++ /dev/null @@ -1,91 +0,0 @@ -/* ANSI C namespace clean utility typedefs */ - -/* This file defines various typedefs needed by the system calls that support - the C library. Basically, they're just the POSIX versions with an '_' - prepended. This file lives in the `sys' directory so targets can provide - their own if desired (or they can put target dependant conditionals here). -*/ - -#ifndef _SYS__TYPES_H -#define _SYS__TYPES_H - -#include -#include - -#ifndef __off_t_defined -typedef long _off_t; -#endif - -#ifndef __dev_t_defined -typedef short __dev_t; -#endif - -#ifndef __uid_t_defined -typedef unsigned short __uid_t; -#endif -#ifndef __gid_t_defined -typedef unsigned short __gid_t; -#endif - -#ifndef __off64_t_defined -__extension__ typedef long long _off64_t; -#endif - -/* - * We need fpos_t for the following, but it doesn't have a leading "_", - * so we use _fpos_t instead. - */ -#ifndef __fpos_t_defined -typedef long _fpos_t; /* XXX must match off_t in */ - /* (and must be `long' for now) */ -#endif - -#ifdef __LARGE64_FILES -#ifndef __fpos64_t_defined -typedef _off64_t _fpos64_t; -#endif -#endif - -#ifndef __ssize_t_defined -#ifdef __SIZE_TYPE__ -/* If __SIZE_TYPE__ is defined (gcc) we define ssize_t based on size_t. - We simply change "unsigned" to "signed" for this single definition - to make sure ssize_t and size_t only differ by their signedness. */ -#define unsigned signed -typedef __SIZE_TYPE__ _ssize_t; -#undef unsigned -#else -#if defined(__INT_MAX__) && __INT_MAX__ == 2147483647 -typedef int _ssize_t; -#else -typedef long _ssize_t; -#endif -#endif -#endif - -#define __need_wint_t -#include - -#ifndef __mbstate_t_defined -/* Conversion state information. */ -typedef struct -{ - int __count; - union - { - wint_t __wch; - unsigned char __wchb[4]; - } __value; /* Value so far. */ -} _mbstate_t; -#endif - -#ifndef __flock_t_defined -typedef _LOCK_RECURSIVE_T _flock_t; -#endif - -#ifndef __iconv_t_defined -/* Iconv descriptor type */ -typedef void *_iconv_t; -#endif - -#endif /* _SYS__TYPES_H */ diff --git a/tools/sdk/include/newlib/sys/cdefs.h b/tools/sdk/include/newlib/sys/cdefs.h deleted file mode 100644 index a5e613c63ca..00000000000 --- a/tools/sdk/include/newlib/sys/cdefs.h +++ /dev/null @@ -1,710 +0,0 @@ -/* libc/sys/linux/sys/cdefs.h - Helper macros for K&R vs. ANSI C compat. */ - -/* Written 2000 by Werner Almesberger */ - -/*- - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Berkeley Software Design, Inc. - * - * 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. - * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. - * - * @(#)cdefs.h 8.8 (Berkeley) 1/9/95 - * $FreeBSD$ - */ - -#ifndef _SYS_CDEFS_H_ -#define _SYS_CDEFS_H_ - -#include -#include -#include - -#define __PMT(args) args -#define __DOTS , ... -#define __THROW - -#ifdef __GNUC__ -# define __ASMNAME(cname) __XSTRING (__USER_LABEL_PREFIX__) cname -#endif - -#define __ptr_t void * -#define __long_double_t long double - -#define __attribute_malloc__ -#define __attribute_pure__ -#define __attribute_format_strfmon__(a,b) -#define __flexarr [0] - -#ifndef __BOUNDED_POINTERS__ -# define __bounded /* nothing */ -# define __unbounded /* nothing */ -# define __ptrvalue /* nothing */ -#endif - -/* - * Testing against Clang-specific extensions. - */ - -#ifndef __has_extension -#define __has_extension __has_feature -#endif -#ifndef __has_feature -#define __has_feature(x) 0 -#endif -#ifndef __has_include -#define __has_include(x) 0 -#endif -#ifndef __has_builtin -#define __has_builtin(x) 0 -#endif - -#if defined(__cplusplus) -#define __BEGIN_DECLS extern "C" { -#define __END_DECLS } -#else -#define __BEGIN_DECLS -#define __END_DECLS -#endif - -/* - * This code has been put in place to help reduce the addition of - * compiler specific defines in FreeBSD code. It helps to aid in - * having a compiler-agnostic source tree. - */ - -#if defined(__GNUC__) || defined(__INTEL_COMPILER) - -#if __GNUC__ >= 3 || defined(__INTEL_COMPILER) -#define __GNUCLIKE_ASM 3 -#define __GNUCLIKE_MATH_BUILTIN_CONSTANTS -#else -#define __GNUCLIKE_ASM 2 -#endif -#define __GNUCLIKE___TYPEOF 1 -#define __GNUCLIKE___OFFSETOF 1 -#define __GNUCLIKE___SECTION 1 - -#ifndef __INTEL_COMPILER -# define __GNUCLIKE_CTOR_SECTION_HANDLING 1 -#endif - -#define __GNUCLIKE_BUILTIN_CONSTANT_P 1 -# if defined(__INTEL_COMPILER) && defined(__cplusplus) \ - && __INTEL_COMPILER < 800 -# undef __GNUCLIKE_BUILTIN_CONSTANT_P -# endif - -#if (__GNUC_MINOR__ > 95 || __GNUC__ >= 3) && !defined(__INTEL_COMPILER) -# define __GNUCLIKE_BUILTIN_VARARGS 1 -# define __GNUCLIKE_BUILTIN_STDARG 1 -# define __GNUCLIKE_BUILTIN_VAALIST 1 -#endif - -#if defined(__GNUC__) -# define __GNUC_VA_LIST_COMPATIBILITY 1 -#endif - -/* - * Compiler memory barriers, specific to gcc and clang. - */ -#if defined(__GNUC__) -#define __compiler_membar() __asm __volatile(" " : : : "memory") -#endif - -#ifndef __INTEL_COMPILER -# define __GNUCLIKE_BUILTIN_NEXT_ARG 1 -# define __GNUCLIKE_MATH_BUILTIN_RELOPS -#endif - -#define __GNUCLIKE_BUILTIN_MEMCPY 1 - -/* XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced */ -#define __CC_SUPPORTS_INLINE 1 -#define __CC_SUPPORTS___INLINE 1 -#define __CC_SUPPORTS___INLINE__ 1 - -#define __CC_SUPPORTS___FUNC__ 1 -#define __CC_SUPPORTS_WARNING 1 - -#define __CC_SUPPORTS_VARADIC_XXX 1 /* see varargs.h */ - -#define __CC_SUPPORTS_DYNAMIC_ARRAY_INIT 1 - -#endif /* __GNUC__ || __INTEL_COMPILER */ - -/* - * The __CONCAT macro is used to concatenate parts of symbol names, e.g. - * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. - * The __CONCAT macro is a bit tricky to use if it must work in non-ANSI - * mode -- there must be no spaces between its arguments, and for nested - * __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also - * concatenate double-quoted strings produced by the __STRING macro, but - * this only works with ANSI C. - * - * __XSTRING is like __STRING, but it expands any macros in its argument - * first. It is only available with ANSI C. - */ -#if defined(__STDC__) || defined(__cplusplus) -#define __P(protos) protos /* full-blown ANSI C */ -#define __CONCAT1(x,y) x ## y -#define __CONCAT(x,y) __CONCAT1(x,y) -#define __STRING(x) #x /* stringify without expanding x */ -#define __XSTRING(x) __STRING(x) /* expand x, then stringify */ - -#define __const const /* define reserved names to standard */ -#define __signed signed -#define __volatile volatile -#if defined(__cplusplus) -#define __inline inline /* convert to C++ keyword */ -#else -#if !(defined(__CC_SUPPORTS___INLINE)) -#define __inline /* delete GCC keyword */ -#endif /* ! __CC_SUPPORTS___INLINE */ -#endif /* !__cplusplus */ - -#else /* !(__STDC__ || __cplusplus) */ -#define __P(protos) () /* traditional C preprocessor */ -#define __CONCAT(x,y) x/**/y -#define __STRING(x) "x" - -#if !defined(__CC_SUPPORTS___INLINE) -#define __const /* delete pseudo-ANSI C keywords */ -#define __inline -#define __signed -#define __volatile -/* - * In non-ANSI C environments, new programs will want ANSI-only C keywords - * deleted from the program and old programs will want them left alone. - * When using a compiler other than gcc, programs using the ANSI C keywords - * const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS. - * When using "gcc -traditional", we assume that this is the intent; if - * __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone. - */ -#ifndef NO_ANSI_KEYWORDS -#define const /* delete ANSI C keywords */ -#define inline -#define signed -#define volatile -#endif /* !NO_ANSI_KEYWORDS */ -#endif /* !__CC_SUPPORTS___INLINE */ -#endif /* !(__STDC__ || __cplusplus) */ - -/* - * Compiler-dependent macros to help declare dead (non-returning) and - * pure (no side effects) functions, and unused variables. They are - * null except for versions of gcc that are known to support the features - * properly (old versions of gcc-2 supported the dead and pure features - * in a different (wrong) way). If we do not provide an implementation - * for a given compiler, let the compile fail if it is told to use - * a feature that we cannot live without. - */ -#ifdef lint -#define __dead2 -#define __pure2 -#define __unused -#define __packed -#define __aligned(x) -#define __section(x) -#else -#if !__GNUC_PREREQ__(2, 5) && !defined(__INTEL_COMPILER) -#define __dead2 -#define __pure2 -#define __unused -#endif -#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 && !defined(__INTEL_COMPILER) -#define __dead2 __attribute__((__noreturn__)) -#define __pure2 __attribute__((__const__)) -#define __unused -/* XXX Find out what to do for __packed, __aligned and __section */ -#endif -#if __GNUC_PREREQ__(2, 7) -#define __dead2 __attribute__((__noreturn__)) -#define __pure2 __attribute__((__const__)) -#define __unused __attribute__((__unused__)) -#define __used __attribute__((__used__)) -#define __packed __attribute__((__packed__)) -#define __aligned(x) __attribute__((__aligned__(x))) -#define __section(x) __attribute__((__section__(x))) -#endif -#if defined(__INTEL_COMPILER) -#define __dead2 __attribute__((__noreturn__)) -#define __pure2 __attribute__((__const__)) -#define __unused __attribute__((__unused__)) -#define __used __attribute__((__used__)) -#define __packed __attribute__((__packed__)) -#define __aligned(x) __attribute__((__aligned__(x))) -#define __section(x) __attribute__((__section__(x))) -#endif -#endif - -#if !__GNUC_PREREQ__(2, 95) -#define __alignof(x) __offsetof(struct { char __a; x __b; }, __b) -#endif - -/* - * Keywords added in C11. - */ - -#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L - -#if !__has_extension(c_alignas) -#if (defined(__cplusplus) && __cplusplus >= 201103L) || \ - __has_extension(cxx_alignas) -#define _Alignas(x) alignas(x) -#else -/* XXX: Only emulates _Alignas(constant-expression); not _Alignas(type-name). */ -#define _Alignas(x) __aligned(x) -#endif -#endif - -#if defined(__cplusplus) && __cplusplus >= 201103L -#define _Alignof(x) alignof(x) -#else -#define _Alignof(x) __alignof(x) -#endif - -#if !__has_extension(c_atomic) && !__has_extension(cxx_atomic) -/* - * No native support for _Atomic(). Place object in structure to prevent - * most forms of direct non-atomic access. - */ -#define _Atomic(T) struct { T volatile __val; } -#endif - -#if defined(__cplusplus) && __cplusplus >= 201103L -#define _Noreturn [[noreturn]] -#else -#define _Noreturn __dead2 -#endif - -#if __GNUC_PREREQ__(4, 6) && !defined(__cplusplus) -/* Do nothing: _Static_assert() works as per C11 */ -#elif !__has_extension(c_static_assert) -#if (defined(__cplusplus) && __cplusplus >= 201103L) || \ - __has_extension(cxx_static_assert) -#define _Static_assert(x, y) static_assert(x, y) -#elif defined(__COUNTER__) -#define _Static_assert(x, y) __Static_assert(x, __COUNTER__) -#define __Static_assert(x, y) ___Static_assert(x, y) -#define ___Static_assert(x, y) typedef char __assert_ ## y[(x) ? 1 : -1] -#else -#define _Static_assert(x, y) struct __hack -#endif -#endif - -#if !__has_extension(c_thread_local) -/* XXX: Change this to test against C++11 when clang in base supports it. */ -#if /* (defined(__cplusplus) && __cplusplus >= 201103L) || */ \ - __has_extension(cxx_thread_local) -#define _Thread_local thread_local -#else -#define _Thread_local __thread -#endif -#endif - -#endif /* __STDC_VERSION__ || __STDC_VERSION__ < 201112L */ - -/* - * Emulation of C11 _Generic(). Unlike the previously defined C11 - * keywords, it is not possible to implement this using exactly the same - * syntax. Therefore implement something similar under the name - * __generic(). Unlike _Generic(), this macro can only distinguish - * between a single type, so it requires nested invocations to - * distinguish multiple cases. - */ - -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L -#define __generic(expr, t, yes, no) \ - _Generic(expr, t: yes, default: no) -#elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus) -#define __generic(expr, t, yes, no) \ - __builtin_choose_expr( \ - __builtin_types_compatible_p(__typeof(expr), t), yes, no) -#endif - -#if __GNUC_PREREQ__(2, 96) -#define __malloc_like __attribute__((__malloc__)) -#define __pure __attribute__((__pure__)) -#else -#define __malloc_like -#define __pure -#endif - -#if __GNUC_PREREQ__(3, 1) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800) -#define __always_inline __attribute__((__always_inline__)) -#else -#define __always_inline -#endif - -#if __GNUC_PREREQ__(3, 1) -#define __noinline __attribute__ ((__noinline__)) -#else -#define __noinline -#endif - -#if __GNUC_PREREQ__(3, 3) -#define __nonnull(x) __attribute__((__nonnull__(x))) -#else -#define __nonnull(x) -#endif - -#if __GNUC_PREREQ__(3, 4) -#define __fastcall __attribute__((__fastcall__)) -#else -#define __fastcall -#endif - -#if __GNUC_PREREQ__(4, 1) -#define __returns_twice __attribute__((__returns_twice__)) -#else -#define __returns_twice -#endif - -/* XXX: should use `#if __STDC_VERSION__ < 199901'. */ -#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER) -#define __func__ NULL -#endif - -/* - * GCC 2.95 provides `__restrict' as an extension to C90 to support the - * C99-specific `restrict' type qualifier. We happen to use `__restrict' as - * a way to define the `restrict' type qualifier without disturbing older - * software that is unaware of C99 keywords. - */ -#if !(__GNUC__ == 2 && __GNUC_MINOR__ == 95) -#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901 || defined(lint) -#define __restrict -#else -#define __restrict restrict -#endif -#endif - -/* - * GNU C version 2.96 adds explicit branch prediction so that - * the CPU back-end can hint the processor and also so that - * code blocks can be reordered such that the predicted path - * sees a more linear flow, thus improving cache behavior, etc. - * - * The following two macros provide us with a way to utilize this - * compiler feature. Use __predict_true() if you expect the expression - * to evaluate to true, and __predict_false() if you expect the - * expression to evaluate to false. - * - * A few notes about usage: - * - * * Generally, __predict_false() error condition checks (unless - * you have some _strong_ reason to do otherwise, in which case - * document it), and/or __predict_true() `no-error' condition - * checks, assuming you want to optimize for the no-error case. - * - * * Other than that, if you don't know the likelihood of a test - * succeeding from empirical or other `hard' evidence, don't - * make predictions. - * - * * These are meant to be used in places that are run `a lot'. - * It is wasteful to make predictions in code that is run - * seldomly (e.g. at subsystem initialization time) as the - * basic block reordering that this affects can often generate - * larger code. - */ -#if __GNUC_PREREQ__(2, 96) -#define __predict_true(exp) __builtin_expect((exp), 1) -#define __predict_false(exp) __builtin_expect((exp), 0) -#else -#define __predict_true(exp) (exp) -#define __predict_false(exp) (exp) -#endif - -#if __GNUC_PREREQ__(4, 2) -#define __hidden __attribute__((__visibility__("hidden"))) -#define __exported __attribute__((__visibility__("default"))) -#else -#define __hidden -#define __exported -#endif - -#define __offsetof(type, field) offsetof(type, field) -#define __rangeof(type, start, end) \ - (__offsetof(type, end) - __offsetof(type, start)) - -/* - * Given the pointer x to the member m of the struct s, return - * a pointer to the containing structure. When using GCC, we first - * assign pointer x to a local variable, to check that its type is - * compatible with member m. - */ -#if __GNUC_PREREQ__(3, 1) -#define __containerof(x, s, m) ({ \ - const volatile __typeof__(((s *)0)->m) *__x = (x); \ - __DEQUALIFY(s *, (const volatile char *)__x - __offsetof(s, m));\ -}) -#else -#define __containerof(x, s, m) \ - __DEQUALIFY(s *, (const volatile char *)(x) - __offsetof(s, m)) -#endif - -/* - * Compiler-dependent macros to declare that functions take printf-like - * or scanf-like arguments. They are null except for versions of gcc - * that are known to support the features properly (old versions of gcc-2 - * didn't permit keeping the keywords out of the application namespace). - */ -#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER) -#define __printflike(fmtarg, firstvararg) -#define __scanflike(fmtarg, firstvararg) -#define __format_arg(fmtarg) -#define __strfmonlike(fmtarg, firstvararg) -#define __strftimelike(fmtarg, firstvararg) -#else -#define __printflike(fmtarg, firstvararg) \ - __attribute__((__format__ (__printf__, fmtarg, firstvararg))) -#define __scanflike(fmtarg, firstvararg) \ - __attribute__((__format__ (__scanf__, fmtarg, firstvararg))) -#define __format_arg(fmtarg) __attribute__((__format_arg__ (fmtarg))) -#define __strfmonlike(fmtarg, firstvararg) \ - __attribute__((__format__ (__strfmon__, fmtarg, firstvararg))) -#define __strftimelike(fmtarg, firstvararg) \ - __attribute__((__format__ (__strftime__, fmtarg, firstvararg))) -#endif - -/* Compiler-dependent macros that rely on FreeBSD-specific extensions. */ -#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 && \ - defined(__GNUC__) && !defined(__INTEL_COMPILER) -#define __printf0like(fmtarg, firstvararg) \ - __attribute__((__format__ (__printf0__, fmtarg, firstvararg))) -#else -#define __printf0like(fmtarg, firstvararg) -#endif - -#if defined(__GNUC__) || defined(__INTEL_COMPILER) -#ifndef __INTEL_COMPILER -#define __strong_reference(sym,aliassym) \ - extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym))) -#endif -#ifdef __ELF__ -#ifdef __STDC__ -#define __weak_reference(sym,alias) \ - __asm__(".weak " #alias); \ - __asm__(".equ " #alias ", " #sym) -#define __warn_references(sym,msg) \ - __asm__(".section .gnu.warning." #sym); \ - __asm__(".asciz \"" msg "\""); \ - __asm__(".previous") -#define __sym_compat(sym,impl,verid) \ - __asm__(".symver " #impl ", " #sym "@" #verid) -#define __sym_default(sym,impl,verid) \ - __asm__(".symver " #impl ", " #sym "@@" #verid) -#else -#define __weak_reference(sym,alias) \ - __asm__(".weak alias"); \ - __asm__(".equ alias, sym") -#define __warn_references(sym,msg) \ - __asm__(".section .gnu.warning.sym"); \ - __asm__(".asciz \"msg\""); \ - __asm__(".previous") -#define __sym_compat(sym,impl,verid) \ - __asm__(".symver impl, sym@verid") -#define __sym_default(impl,sym,verid) \ - __asm__(".symver impl, sym@@verid") -#endif /* __STDC__ */ -#else /* !__ELF__ */ -#ifdef __STDC__ -#define __weak_reference(sym,alias) \ - __asm__(".stabs \"_" #alias "\",11,0,0,0"); \ - __asm__(".stabs \"_" #sym "\",1,0,0,0") -#define __warn_references(sym,msg) \ - __asm__(".stabs \"" msg "\",30,0,0,0"); \ - __asm__(".stabs \"_" #sym "\",1,0,0,0") -#else -#define __weak_reference(sym,alias) \ - __asm__(".stabs \"_/**/alias\",11,0,0,0"); \ - __asm__(".stabs \"_/**/sym\",1,0,0,0") -#define __warn_references(sym,msg) \ - __asm__(".stabs msg,30,0,0,0"); \ - __asm__(".stabs \"_/**/sym\",1,0,0,0") -#endif /* __STDC__ */ -#endif /* __ELF__ */ -#endif /* __GNUC__ || __INTEL_COMPILER */ - -#ifndef __FBSDID -#define __FBSDID(s) struct __hack -#endif - -#ifndef __RCSID -#define __RCSID(s) struct __hack -#endif - -#ifndef __RCSID_SOURCE -#define __RCSID_SOURCE(s) struct __hack -#endif - -#ifndef __SCCSID -#define __SCCSID(s) struct __hack -#endif - -#ifndef __COPYRIGHT -#define __COPYRIGHT(s) struct __hack -#endif - -#ifndef __DECONST -#define __DECONST(type, var) ((type)(__uintptr_t)(const void *)(var)) -#endif - -#ifndef __DEVOLATILE -#define __DEVOLATILE(type, var) ((type)(__uintptr_t)(volatile void *)(var)) -#endif - -#ifndef __DEQUALIFY -#define __DEQUALIFY(type, var) ((type)(__uintptr_t)(const volatile void *)(var)) -#endif - -/*- - * The following definitions are an extension of the behavior originally - * implemented in , but with a different level of granularity. - * POSIX.1 requires that the macros we test be defined before any standard - * header file is included. - * - * Here's a quick run-down of the versions: - * defined(_POSIX_SOURCE) 1003.1-1988 - * _POSIX_C_SOURCE == 1 1003.1-1990 - * _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option - * _POSIX_C_SOURCE == 199309 1003.1b-1993 - * _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, - * and the omnibus ISO/IEC 9945-1: 1996 - * _POSIX_C_SOURCE == 200112 1003.1-2001 - * _POSIX_C_SOURCE == 200809 1003.1-2008 - * - * In addition, the X/Open Portability Guide, which is now the Single UNIX - * Specification, defines a feature-test macro which indicates the version of - * that specification, and which subsumes _POSIX_C_SOURCE. - * - * Our macros begin with two underscores to avoid namespace screwage. - */ - -/* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */ -#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1 -#undef _POSIX_C_SOURCE /* Probably illegal, but beyond caring now. */ -#define _POSIX_C_SOURCE 199009 -#endif - -/* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */ -#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2 -#undef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 199209 -#endif - -/* Deal with various X/Open Portability Guides and Single UNIX Spec. */ -#ifdef _XOPEN_SOURCE -#if _XOPEN_SOURCE - 0 >= 700 -#define __XSI_VISIBLE 700 -#undef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 200809 -#elif _XOPEN_SOURCE - 0 >= 600 -#define __XSI_VISIBLE 600 -#undef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 200112 -#elif _XOPEN_SOURCE - 0 >= 500 -#define __XSI_VISIBLE 500 -#undef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 199506 -#endif -#endif - -/* - * Deal with all versions of POSIX. The ordering relative to the tests above is - * important. - */ -#if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) -#define _POSIX_C_SOURCE 198808 -#endif -#ifdef _POSIX_C_SOURCE -#if _POSIX_C_SOURCE >= 200809 -#define __POSIX_VISIBLE 200809 -#define __ISO_C_VISIBLE 1999 -#elif _POSIX_C_SOURCE >= 200112 -#define __POSIX_VISIBLE 200112 -#define __ISO_C_VISIBLE 1999 -#elif _POSIX_C_SOURCE >= 199506 -#define __POSIX_VISIBLE 199506 -#define __ISO_C_VISIBLE 1990 -#elif _POSIX_C_SOURCE >= 199309 -#define __POSIX_VISIBLE 199309 -#define __ISO_C_VISIBLE 1990 -#elif _POSIX_C_SOURCE >= 199209 -#define __POSIX_VISIBLE 199209 -#define __ISO_C_VISIBLE 1990 -#elif _POSIX_C_SOURCE >= 199009 -#define __POSIX_VISIBLE 199009 -#define __ISO_C_VISIBLE 1990 -#else -#define __POSIX_VISIBLE 198808 -#define __ISO_C_VISIBLE 0 -#endif /* _POSIX_C_SOURCE */ -#else -/*- - * Deal with _ANSI_SOURCE: - * If it is defined, and no other compilation environment is explicitly - * requested, then define our internal feature-test macros to zero. This - * makes no difference to the preprocessor (undefined symbols in preprocessing - * expressions are defined to have value zero), but makes it more convenient for - * a test program to print out the values. - * - * If a program mistakenly defines _ANSI_SOURCE and some other macro such as - * _POSIX_C_SOURCE, we will assume that it wants the broader compilation - * environment (and in fact we will never get here). - */ -#if defined(_ANSI_SOURCE) /* Hide almost everything. */ -#define __POSIX_VISIBLE 0 -#define __XSI_VISIBLE 0 -#define __BSD_VISIBLE 0 -#define __ISO_C_VISIBLE 1990 -#elif defined(_C99_SOURCE) /* Localism to specify strict C99 env. */ -#define __POSIX_VISIBLE 0 -#define __XSI_VISIBLE 0 -#define __BSD_VISIBLE 0 -#define __ISO_C_VISIBLE 1999 -#elif defined(_C11_SOURCE) /* Localism to specify strict C11 env. */ -#define __POSIX_VISIBLE 0 -#define __XSI_VISIBLE 0 -#define __BSD_VISIBLE 0 -#define __ISO_C_VISIBLE 2011 -#elif defined(_GNU_SOURCE) /* Everything and the kitchen sink. */ -#define __POSIX_VISIBLE 200809 -#define __XSI_VISIBLE 700 -#define __BSD_VISIBLE 1 -#define __ISO_C_VISIBLE 2011 -#define __GNU_VISIBLE 1 -#else /* Default: everything except __GNU_VISIBLE. */ -#define __POSIX_VISIBLE 200809 -#define __XSI_VISIBLE 700 -#define __BSD_VISIBLE 1 -#define __ISO_C_VISIBLE 2011 -#endif -#endif - -#endif /* !_SYS_CDEFS_H_ */ diff --git a/tools/sdk/include/newlib/sys/config.h b/tools/sdk/include/newlib/sys/config.h deleted file mode 100644 index b5adfe1025a..00000000000 --- a/tools/sdk/include/newlib/sys/config.h +++ /dev/null @@ -1,300 +0,0 @@ -#ifndef __SYS_CONFIG_H__ -#define __SYS_CONFIG_H__ - -#include /* floating point macros */ -#include /* POSIX defs */ - -#ifdef __aarch64__ -#define MALLOC_ALIGNMENT 16 -#endif - -/* exceptions first */ -#if defined(__H8500__) || defined(__W65__) -#define __SMALL_BITFIELDS -/* ??? This conditional is true for the h8500 and the w65, defining H8300 - in those cases probably isn't the right thing to do. */ -#define H8300 1 -#endif - -/* 16 bit integer machines */ -#if defined(__Z8001__) || defined(__Z8002__) || defined(__H8500__) || defined(__W65__) || defined (__mn10200__) || defined (__AVR__) - -#undef INT_MAX -#undef UINT_MAX -#define INT_MAX 32767 -#define UINT_MAX 65535 -#endif - -#if defined (__H8300__) || defined (__H8300H__) || defined(__H8300S__) || defined (__H8300SX__) -#define __SMALL_BITFIELDS -#define H8300 1 -#undef INT_MAX -#undef UINT_MAX -#define INT_MAX __INT_MAX__ -#define UINT_MAX (__INT_MAX__ * 2U + 1) -#endif - -#if (defined(__CR16__) || defined(__CR16C__) ||defined(__CR16CP__)) -#ifndef __INT32__ -#define __SMALL_BITFIELDS -#undef INT_MAX -#undef UINT_MAX -#define INT_MAX 32767 -#define UINT_MAX (__INT_MAX__ * 2U + 1) -#else /* INT32 */ -#undef INT_MAX -#undef UINT_MAX -#define INT_MAX 2147483647 -#define UINT_MAX (__INT_MAX__ * 2U + 1) -#endif /* INT32 */ - -#endif /* CR16C */ - -#if defined (__xc16x__) || defined (__xc16xL__) || defined (__xc16xS__) -#define __SMALL_BITFIELDS -#endif - -#ifdef __W65__ -#define __SMALL_BITFIELDS -#endif - -#if defined(__D10V__) -#define __SMALL_BITFIELDS -#undef INT_MAX -#undef UINT_MAX -#define INT_MAX __INT_MAX__ -#define UINT_MAX (__INT_MAX__ * 2U + 1) -#define _POINTER_INT short -#endif - -#if defined(__mc68hc11__) || defined(__mc68hc12__) || defined(__mc68hc1x__) -#undef INT_MAX -#undef UINT_MAX -#define INT_MAX __INT_MAX__ -#define UINT_MAX (__INT_MAX__ * 2U + 1) -#define _POINTER_INT short -#endif - -#if defined(__m68k__) || defined(__mc68000__) -#define _READ_WRITE_RETURN_TYPE _ssize_t -#endif - -#ifdef ___AM29K__ -#define _FLOAT_RET double -#endif - -#ifdef __i386__ -#ifndef __unix__ -/* in other words, go32 */ -#define _FLOAT_RET double -#endif -#if defined(__linux__) || defined(__RDOS__) -/* we want the reentrancy structure to be returned by a function */ -#define __DYNAMIC_REENT__ -#define HAVE_GETDATE -#define _HAVE_SYSTYPES -#define _READ_WRITE_RETURN_TYPE _ssize_t -#define __LARGE64_FILES 1 -/* we use some glibc header files so turn on glibc large file feature */ -#define _LARGEFILE64_SOURCE 1 -#endif -#endif - -#ifdef __mn10200__ -#define __SMALL_BITFIELDS -#endif - -#ifdef __AVR__ -#define __SMALL_BITFIELDS -#define _POINTER_INT short -#endif - -#ifdef __v850 -#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__sda__)) -#endif - -/* For the PowerPC eabi, force the _impure_ptr to be in .sdata */ -#if defined(__PPC__) -#if defined(_CALL_SYSV) -#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata"))) -#endif -#ifdef __SPE__ -#define _LONG_DOUBLE double -#endif -#endif - -/* Configure small REENT structure for Xilinx MicroBlaze platforms */ -#if defined (__MICROBLAZE__) -#ifndef _REENT_SMALL -#define _REENT_SMALL -#endif -/* Xilinx XMK uses Unix98 mutex */ -#ifdef __XMK__ -#define _UNIX98_THREAD_MUTEX_ATTRIBUTES -#endif -#endif - -#if defined(__mips__) && !defined(__rtems__) -#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata"))) -#endif - -#ifdef __xstormy16__ -#define __SMALL_BITFIELDS -#undef INT_MAX -#undef UINT_MAX -#define INT_MAX __INT_MAX__ -#define UINT_MAX (__INT_MAX__ * 2U + 1) -#define MALLOC_ALIGNMENT 8 -#define _POINTER_INT short -#define __BUFSIZ__ 16 -#define _REENT_SMALL -#endif - -#if defined __MSP430__ -#ifndef _REENT_SMALL -#define _REENT_SMALL -#endif - -#define __SMALL_BITFIELDS - -#ifdef __MSP430X_LARGE__ -#define _POINTER_INT long -#else -#define _POINTER_INT int -#endif -#endif - -#ifdef __m32c__ -#define __SMALL_BITFIELDS -#undef INT_MAX -#undef UINT_MAX -#define INT_MAX __INT_MAX__ -#define UINT_MAX (__INT_MAX__ * 2U + 1) -#define MALLOC_ALIGNMENT 8 -#if defined(__r8c_cpu__) || defined(__m16c_cpu__) -#define _POINTER_INT short -#else -#define _POINTER_INT long -#endif -#define __BUFSIZ__ 16 -#define _REENT_SMALL -#endif /* __m32c__ */ - -#ifdef __SPU__ -#define MALLOC_ALIGNMENT 16 -#define __CUSTOM_FILE_IO__ -#endif - -#ifdef __XTENSA__ -#include -#define MALLOC_ALIGNMENT ((XCHAL_DATA_WIDTH) < 16 ? 16 : (XCHAL_DATA_WIDTH)) -/* esp8266-specific: shrink the default fd buffer size */ -#define __BUFSIZ__ 128 -#ifndef __DYNAMIC_REENT__ -#define __DYNAMIC_REENT__ -#endif -#ifndef _REENT_SMALL -#define _REENT_SMALL -#endif -#define HAVE_GETOPT -#endif - -/* This block should be kept in sync with GCC's limits.h. The point - of having these definitions here is to not include limits.h, which - would pollute the user namespace, while still using types of the - the correct widths when deciding how to define __int32_t and - __int64_t. */ -#ifndef __INT_MAX__ -# ifdef INT_MAX -# define __INT_MAX__ INT_MAX -# else -# define __INT_MAX__ 2147483647 -# endif -#endif - -#ifndef __LONG_MAX__ -# ifdef LONG_MAX -# define __LONG_MAX__ LONG_MAX -# else -# if defined (__alpha__) || (defined (__sparc__) && defined(__arch64__)) \ - || defined (__sparcv9) -# define __LONG_MAX__ 9223372036854775807L -# else -# define __LONG_MAX__ 2147483647L -# endif /* __alpha__ || sparc64 */ -# endif -#endif -/* End of block that should be kept in sync with GCC's limits.h. */ - -#ifndef _POINTER_INT -#define _POINTER_INT long -#endif - -#ifdef __frv__ -#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata"))) -#endif -#undef __RAND_MAX -#if __INT_MAX__ == 32767 -#define __RAND_MAX 32767 -#else -#define __RAND_MAX 0x7fffffff -#endif - -#if defined(__CYGWIN__) -#include -#if !defined (__STRICT_ANSI__) || (__STDC_VERSION__ >= 199901L) -#define __USE_XOPEN2K 1 -#endif -#endif - -#if defined(__rtems__) -#define __FILENAME_MAX__ 255 -#define _READ_WRITE_RETURN_TYPE _ssize_t -#define __DYNAMIC_REENT__ -#define _REENT_GLOBAL_ATEXIT -#endif - -#ifndef __EXPORT -#define __EXPORT -#endif - -#ifndef __IMPORT -#define __IMPORT -#endif - -/* Define return type of read/write routines. In POSIX, the return type - for read()/write() is "ssize_t" but legacy newlib code has been using - "int" for some time. If not specified, "int" is defaulted. */ -#ifndef _READ_WRITE_RETURN_TYPE -#define _READ_WRITE_RETURN_TYPE int -#endif -/* Define `count' parameter of read/write routines. In POSIX, the `count' - parameter is "size_t" but legacy newlib code has been using "int" for some - time. If not specified, "int" is defaulted. */ -#ifndef _READ_WRITE_BUFSIZE_TYPE -#define _READ_WRITE_BUFSIZE_TYPE int -#endif - -#ifndef __WCHAR_MAX__ -#if __INT_MAX__ == 32767 || defined (_WIN32) -#define __WCHAR_MAX__ 0xffffu -#endif -#endif - -/* See if small reent asked for at configuration time and - is not chosen by the platform by default. */ -#ifdef _WANT_REENT_SMALL -#ifndef _REENT_SMALL -#define _REENT_SMALL -#endif -#endif - -/* If _MB_EXTENDED_CHARSETS_ALL is set, we want all of the extended - charsets. The extended charsets add a few functions and a couple - of tables of a few K each. */ -#ifdef _MB_EXTENDED_CHARSETS_ALL -#define _MB_EXTENDED_CHARSETS_ISO 1 -#define _MB_EXTENDED_CHARSETS_WINDOWS 1 -#endif - -#endif /* __SYS_CONFIG_H__ */ diff --git a/tools/sdk/include/newlib/sys/custom_file.h b/tools/sdk/include/newlib/sys/custom_file.h deleted file mode 100644 index 96314fb9168..00000000000 --- a/tools/sdk/include/newlib/sys/custom_file.h +++ /dev/null @@ -1,2 +0,0 @@ -#error System-specific custom_file.h is missing. - diff --git a/tools/sdk/include/newlib/sys/dir.h b/tools/sdk/include/newlib/sys/dir.h deleted file mode 100644 index 220150dc952..00000000000 --- a/tools/sdk/include/newlib/sys/dir.h +++ /dev/null @@ -1,10 +0,0 @@ -/* BSD predecessor of POSIX.1 and struct dirent */ - -#ifndef _SYS_DIR_H_ -#define _SYS_DIR_H_ - -#include - -#define direct dirent - -#endif /*_SYS_DIR_H_*/ diff --git a/tools/sdk/include/newlib/sys/errno.h b/tools/sdk/include/newlib/sys/errno.h deleted file mode 100644 index a72c37320a7..00000000000 --- a/tools/sdk/include/newlib/sys/errno.h +++ /dev/null @@ -1,192 +0,0 @@ -/* errno is not a global variable, because that would make using it - non-reentrant. Instead, its address is returned by the function - __errno. */ - -#ifndef _SYS_ERRNO_H_ -#ifdef __cplusplus -extern "C" { -#endif -#define _SYS_ERRNO_H_ - -#include - -#ifndef _REENT_ONLY -#define errno (*__errno()) -extern int *__errno _PARAMS ((void)); -#endif - -/* Please don't use these variables directly. - Use strerror instead. */ -extern __IMPORT _CONST char * _CONST _sys_errlist[]; -extern __IMPORT int _sys_nerr; -#ifdef __CYGWIN__ -extern __IMPORT const char * const sys_errlist[]; -extern __IMPORT int sys_nerr; -extern __IMPORT char *program_invocation_name; -extern __IMPORT char *program_invocation_short_name; -#endif - -#define __errno_r(ptr) ((ptr)->_errno) - -#define EPERM 1 /* Not owner */ -#define ENOENT 2 /* No such file or directory */ -#define ESRCH 3 /* No such process */ -#define EINTR 4 /* Interrupted system call */ -#define EIO 5 /* I/O error */ -#define ENXIO 6 /* No such device or address */ -#define E2BIG 7 /* Arg list too long */ -#define ENOEXEC 8 /* Exec format error */ -#define EBADF 9 /* Bad file number */ -#define ECHILD 10 /* No children */ -#define EAGAIN 11 /* No more processes */ -#define ENOMEM 12 /* Not enough space */ -#define EACCES 13 /* Permission denied */ -#define EFAULT 14 /* Bad address */ -#ifdef __LINUX_ERRNO_EXTENSIONS__ -#define ENOTBLK 15 /* Block device required */ -#endif -#define EBUSY 16 /* Device or resource busy */ -#define EEXIST 17 /* File exists */ -#define EXDEV 18 /* Cross-device link */ -#define ENODEV 19 /* No such device */ -#define ENOTDIR 20 /* Not a directory */ -#define EISDIR 21 /* Is a directory */ -#define EINVAL 22 /* Invalid argument */ -#define ENFILE 23 /* Too many open files in system */ -#define EMFILE 24 /* File descriptor value too large */ -#define ENOTTY 25 /* Not a character device */ -#define ETXTBSY 26 /* Text file busy */ -#define EFBIG 27 /* File too large */ -#define ENOSPC 28 /* No space left on device */ -#define ESPIPE 29 /* Illegal seek */ -#define EROFS 30 /* Read-only file system */ -#define EMLINK 31 /* Too many links */ -#define EPIPE 32 /* Broken pipe */ -#define EDOM 33 /* Mathematics argument out of domain of function */ -#define ERANGE 34 /* Result too large */ -#define ENOMSG 35 /* No message of desired type */ -#define EIDRM 36 /* Identifier removed */ -#ifdef __LINUX_ERRNO_EXTENSIONS__ -#define ECHRNG 37 /* Channel number out of range */ -#define EL2NSYNC 38 /* Level 2 not synchronized */ -#define EL3HLT 39 /* Level 3 halted */ -#define EL3RST 40 /* Level 3 reset */ -#define ELNRNG 41 /* Link number out of range */ -#define EUNATCH 42 /* Protocol driver not attached */ -#define ENOCSI 43 /* No CSI structure available */ -#define EL2HLT 44 /* Level 2 halted */ -#endif -#define EDEADLK 45 /* Deadlock */ -#define ENOLCK 46 /* No lock */ -#ifdef __LINUX_ERRNO_EXTENSIONS__ -#define EBADE 50 /* Invalid exchange */ -#define EBADR 51 /* Invalid request descriptor */ -#define EXFULL 52 /* Exchange full */ -#define ENOANO 53 /* No anode */ -#define EBADRQC 54 /* Invalid request code */ -#define EBADSLT 55 /* Invalid slot */ -#define EDEADLOCK 56 /* File locking deadlock error */ -#define EBFONT 57 /* Bad font file fmt */ -#endif -#define ENOSTR 60 /* Not a stream */ -#define ENODATA 61 /* No data (for no delay io) */ -#define ETIME 62 /* Stream ioctl timeout */ -#define ENOSR 63 /* No stream resources */ -#ifdef __LINUX_ERRNO_EXTENSIONS__ -#define ENONET 64 /* Machine is not on the network */ -#define ENOPKG 65 /* Package not installed */ -#define EREMOTE 66 /* The object is remote */ -#endif -#define ENOLINK 67 /* Virtual circuit is gone */ -#ifdef __LINUX_ERRNO_EXTENSIONS__ -#define EADV 68 /* Advertise error */ -#define ESRMNT 69 /* Srmount error */ -#define ECOMM 70 /* Communication error on send */ -#endif -#define EPROTO 71 /* Protocol error */ -#define EMULTIHOP 74 /* Multihop attempted */ -#ifdef __LINUX_ERRNO_EXTENSIONS__ -#define ELBIN 75 /* Inode is remote (not really error) */ -#define EDOTDOT 76 /* Cross mount point (not really error) */ -#endif -#define EBADMSG 77 /* Bad message */ -#define EFTYPE 79 /* Inappropriate file type or format */ -#ifdef __LINUX_ERRNO_EXTENSIONS__ -#define ENOTUNIQ 80 /* Given log. name not unique */ -#define EBADFD 81 /* f.d. invalid for this operation */ -#define EREMCHG 82 /* Remote address changed */ -#define ELIBACC 83 /* Can't access a needed shared lib */ -#define ELIBBAD 84 /* Accessing a corrupted shared lib */ -#define ELIBSCN 85 /* .lib section in a.out corrupted */ -#define ELIBMAX 86 /* Attempting to link in too many libs */ -#define ELIBEXEC 87 /* Attempting to exec a shared library */ -#endif -#define ENOSYS 88 /* Function not implemented */ -#ifdef __CYGWIN__ -#define ENMFILE 89 /* No more files */ -#endif -#define ENOTEMPTY 90 /* Directory not empty */ -#define ENAMETOOLONG 91 /* File or path name too long */ -#define ELOOP 92 /* Too many symbolic links */ -#define EOPNOTSUPP 95 /* Operation not supported on socket */ -#define EPFNOSUPPORT 96 /* Protocol family not supported */ -#define ECONNRESET 104 /* Connection reset by peer */ -#define ENOBUFS 105 /* No buffer space available */ -#define EAFNOSUPPORT 106 /* Address family not supported by protocol family */ -#define EPROTOTYPE 107 /* Protocol wrong type for socket */ -#define ENOTSOCK 108 /* Socket operation on non-socket */ -#define ENOPROTOOPT 109 /* Protocol not available */ -#ifdef __LINUX_ERRNO_EXTENSIONS__ -#define ESHUTDOWN 110 /* Can't send after socket shutdown */ -#endif -#define ECONNREFUSED 111 /* Connection refused */ -#define EADDRINUSE 112 /* Address already in use */ -#define ECONNABORTED 113 /* Software caused connection abort */ -#define ENETUNREACH 114 /* Network is unreachable */ -#define ENETDOWN 115 /* Network interface is not configured */ -#define ETIMEDOUT 116 /* Connection timed out */ -#define EHOSTDOWN 117 /* Host is down */ -#define EHOSTUNREACH 118 /* Host is unreachable */ -#define EINPROGRESS 119 /* Connection already in progress */ -#define EALREADY 120 /* Socket already connected */ -#define EDESTADDRREQ 121 /* Destination address required */ -#define EMSGSIZE 122 /* Message too long */ -#define EPROTONOSUPPORT 123 /* Unknown protocol */ -#ifdef __LINUX_ERRNO_EXTENSIONS__ -#define ESOCKTNOSUPPORT 124 /* Socket type not supported */ -#endif -#define EADDRNOTAVAIL 125 /* Address not available */ -#define ENETRESET 126 /* Connection aborted by network */ -#define EISCONN 127 /* Socket is already connected */ -#define ENOTCONN 128 /* Socket is not connected */ -#define ETOOMANYREFS 129 -#ifdef __LINUX_ERRNO_EXTENSIONS__ -#define EPROCLIM 130 -#define EUSERS 131 -#endif -#define EDQUOT 132 -#define ESTALE 133 -#define ENOTSUP 134 /* Not supported */ -#ifdef __LINUX_ERRNO_EXTENSIONS__ -#define ENOMEDIUM 135 /* No medium (in tape drive) */ -#endif -#ifdef __CYGWIN__ -#define ENOSHARE 136 /* No such host or network path */ -#define ECASECLASH 137 /* Filename exists with different case */ -#endif -#define EILSEQ 138 /* Illegal byte sequence */ -#define EOVERFLOW 139 /* Value too large for defined data type */ -#define ECANCELED 140 /* Operation canceled */ -#define ENOTRECOVERABLE 141 /* State not recoverable */ -#define EOWNERDEAD 142 /* Previous owner died */ -#ifdef __LINUX_ERRNO_EXTENSIONS__ -#define ESTRPIPE 143 /* Streams pipe error */ -#endif -#define EWOULDBLOCK EAGAIN /* Operation would block */ - -#define __ELASTERROR 2000 /* Users can add values starting here */ - -#ifdef __cplusplus -} -#endif -#endif /* _SYS_ERRNO_H */ diff --git a/tools/sdk/include/newlib/sys/fcntl.h b/tools/sdk/include/newlib/sys/fcntl.h deleted file mode 100644 index be85f40c1b8..00000000000 --- a/tools/sdk/include/newlib/sys/fcntl.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef _SYS_FCNTL_H_ -#define _SYS_FCNTL_H_ -#include -#endif diff --git a/tools/sdk/include/newlib/sys/features.h b/tools/sdk/include/newlib/sys/features.h deleted file mode 100644 index 87f3314fd95..00000000000 --- a/tools/sdk/include/newlib/sys/features.h +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Written by Joel Sherrill . - * - * COPYRIGHT (c) 1989-2000. - * - * On-Line Applications Research Corporation (OAR). - * - * Permission to use, copy, modify, and distribute this software for any - * purpose without fee is hereby granted, provided that this entire notice - * is included in all copies of any software which is or includes a copy - * or modification of this software. - * - * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTY. IN PARTICULAR, THE AUTHOR MAKES NO REPRESENTATION - * OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS - * SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. - * - * $Id$ - */ - -#ifndef _SYS_FEATURES_H -#define _SYS_FEATURES_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* Macros to determine that newlib is being used. Put in this header to - * be similar to where glibc stores its version of these macros. - */ -#define __NEWLIB__ 2 -#define __NEWLIB_MINOR__ 1 - -/* Macro to test version of GCC. Returns 0 for non-GCC or too old GCC. */ -#ifndef __GNUC_PREREQ -# if defined __GNUC__ && defined __GNUC_MINOR__ -# define __GNUC_PREREQ(maj, min) \ - ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) -# else -# define __GNUC_PREREQ(maj, min) 0 -# endif -#endif /* __GNUC_PREREQ */ -/* Version with trailing underscores for BSD compatibility. */ -#define __GNUC_PREREQ__(ma, mi) __GNUC_PREREQ(ma, mi) - -/* RTEMS adheres to POSIX -- 1003.1b with some features from annexes. */ - -#ifdef __rtems__ -#define _POSIX_JOB_CONTROL 1 -#define _POSIX_SAVED_IDS 1 -#define _POSIX_VERSION 199309L -#define _POSIX_ASYNCHRONOUS_IO 1 -#define _POSIX_FSYNC 1 -#define _POSIX_MAPPED_FILES 1 -#define _POSIX_MEMLOCK 1 -#define _POSIX_MEMLOCK_RANGE 1 -#define _POSIX_MEMORY_PROTECTION 1 -#define _POSIX_MESSAGE_PASSING 1 -#define _POSIX_MONOTONIC_CLOCK 200112L -#define _POSIX_PRIORITIZED_IO 1 -#define _POSIX_PRIORITY_SCHEDULING 1 -#define _POSIX_REALTIME_SIGNALS 1 -#define _POSIX_SEMAPHORES 1 -/* #define _POSIX_SHARED_MEMORY_OBJECTS 1 */ -#define _POSIX_SYNCHRONIZED_IO 1 -#define _POSIX_TIMERS 1 -#define _POSIX_BARRIERS 200112L -#define _POSIX_READER_WRITER_LOCKS 200112L -#define _POSIX_SPIN_LOCKS 200112L - - -/* In P1003.1b but defined by drafts at least as early as P1003.1c/D10 */ -#define _POSIX_THREADS 1 -#define _POSIX_THREAD_ATTR_STACKADDR 1 -#define _POSIX_THREAD_ATTR_STACKSIZE 1 -#define _POSIX_THREAD_PRIORITY_SCHEDULING 1 -#define _POSIX_THREAD_PRIO_INHERIT 1 -#define _POSIX_THREAD_PRIO_PROTECT 1 -#define _POSIX_THREAD_PROCESS_SHARED 1 -#define _POSIX_THREAD_SAFE_FUNCTIONS 1 - -/* P1003.4b/D8 defines the constants below this comment. */ -#define _POSIX_SPAWN 1 -#define _POSIX_TIMEOUTS 1 -#define _POSIX_CPUTIME 1 -#define _POSIX_THREAD_CPUTIME 1 -#define _POSIX_SPORADIC_SERVER 1 -#define _POSIX_THREAD_SPORADIC_SERVER 1 -#define _POSIX_DEVICE_CONTROL 1 -#define _POSIX_DEVCTL_DIRECTION 1 -#define _POSIX_INTERRUPT_CONTROL 1 -#define _POSIX_ADVISORY_INFO 1 - -/* UNIX98 added some new pthread mutex attributes */ -#define _UNIX98_THREAD_MUTEX_ATTRIBUTES 1 - -#endif - -/* XMK loosely adheres to POSIX -- 1003.1 */ -#ifdef __XMK__ -#define _POSIX_THREADS 1 -#define _POSIX_THREAD_PRIORITY_SCHEDULING 1 -#endif - - -#ifdef __svr4__ -# define _POSIX_JOB_CONTROL 1 -# define _POSIX_SAVED_IDS 1 -# define _POSIX_VERSION 199009L -#endif - -#ifdef __CYGWIN__ - -#if !defined(__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L -#define _POSIX_VERSION 200112L -#define _POSIX2_VERSION 200112L -#define _XOPEN_VERSION 600 - -#define _POSIX_ADVISORY_INFO 200112L -/* #define _POSIX_ASYNCHRONOUS_IO -1 */ -/* #define _POSIX_BARRIERS -1 */ -#define _POSIX_CHOWN_RESTRICTED 1 -#define _POSIX_CLOCK_SELECTION 200112L -#define _POSIX_CPUTIME 200112L -#define _POSIX_FSYNC 200112L -#define _POSIX_IPV6 200112L -#define _POSIX_JOB_CONTROL 1 -#define _POSIX_MAPPED_FILES 200112L -/* #define _POSIX_MEMLOCK -1 */ -#define _POSIX_MEMLOCK_RANGE 200112L -#define _POSIX_MEMORY_PROTECTION 200112L -#define _POSIX_MESSAGE_PASSING 200112L -#define _POSIX_MONOTONIC_CLOCK 200112L -#define _POSIX_NO_TRUNC 1 -/* #define _POSIX_PRIORITIZED_IO -1 */ -#define _POSIX_PRIORITY_SCHEDULING 200112L -#define _POSIX_RAW_SOCKETS 200112L -#define _POSIX_READER_WRITER_LOCKS 200112L -#define _POSIX_REALTIME_SIGNALS 200112L -#define _POSIX_REGEXP 1 -#define _POSIX_SAVED_IDS 1 -#define _POSIX_SEMAPHORES 200112L -#define _POSIX_SHARED_MEMORY_OBJECTS 200112L -#define _POSIX_SHELL 1 -/* #define _POSIX_SPAWN -1 */ -#define _POSIX_SPIN_LOCKS 200112L -/* #define _POSIX_SPORADIC_SERVER -1 */ -#define _POSIX_SYNCHRONIZED_IO 200112L -#define _POSIX_THREAD_ATTR_STACKADDR 200112L -#define _POSIX_THREAD_ATTR_STACKSIZE 200112L -#define _POSIX_THREAD_CPUTIME 200112L -/* #define _POSIX_THREAD_PRIO_INHERIT -1 */ -/* #define _POSIX_THREAD_PRIO_PROTECT -1 */ -#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L -#define _POSIX_THREAD_PROCESS_SHARED 200112L -#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L -/* #define _POSIX_THREAD_SPORADIC_SERVER -1 */ -#define _POSIX_THREADS 200112L -/* #define _POSIX_TIMEOUTS -1 */ -#define _POSIX_TIMERS 1 -/* #define _POSIX_TRACE -1 */ -/* #define _POSIX_TRACE_EVENT_FILTER -1 */ -/* #define _POSIX_TRACE_INHERIT -1 */ -/* #define _POSIX_TRACE_LOG -1 */ -/* #define _POSIX_TYPED_MEMORY_OBJECTS -1 */ -#define _POSIX_VDISABLE '\0' -#define _POSIX2_C_BIND 200112L -#define _POSIX2_C_DEV 200112L -#define _POSIX2_CHAR_TERM 200112L -/* #define _POSIX2_FORT_DEV -1 */ -/* #define _POSIX2_FORT_RUN -1 */ -/* #define _POSIX2_LOCALEDEF -1 */ -/* #define _POSIX2_PBS -1 */ -/* #define _POSIX2_PBS_ACCOUNTING -1 */ -/* #define _POSIX2_PBS_CHECKPOINT -1 */ -/* #define _POSIX2_PBS_LOCATE -1 */ -/* #define _POSIX2_PBS_MESSAGE -1 */ -/* #define _POSIX2_PBS_TRACK -1 */ -#define _POSIX2_SW_DEV 200112L -#define _POSIX2_UPE 200112L -#define _POSIX_V6_ILP32_OFF32 -1 -#ifdef __LP64__ -#define _POSIX_V6_ILP32_OFFBIG -1 -#define _POSIX_V6_LP64_OFF64 1 -#define _POSIX_V6_LPBIG_OFFBIG 1 -#else -#define _POSIX_V6_ILP32_OFFBIG 1 -#define _POSIX_V6_LP64_OFF64 -1 -#define _POSIX_V6_LPBIG_OFFBIG -1 -#endif -#define _XBS5_ILP32_OFF32 _POSIX_V6_ILP32_OFF32 -#define _XBS5_ILP32_OFFBIG _POSIX_V6_ILP32_OFFBIG -#define _XBS5_LP64_OFF64 _POSIX_V6_LP64_OFF64 -#define _XBS5_LPBIG_OFFBIG _POSIX_V6_LPBIG_OFFBIG -#define _XOPEN_CRYPT 1 -#define _XOPEN_ENH_I18N 1 -/* #define _XOPEN_LEGACY -1 */ -/* #define _XOPEN_REALTIME -1 */ -/* #define _XOPEN_REALTIME_THREADS -1 */ -#define _XOPEN_SHM 1 -/* #define _XOPEN_STREAMS -1 */ -/* #define _XOPEN_UNIX -1 */ - -#endif /* !__STRICT_ANSI__ || __cplusplus || __STDC_VERSION__ >= 199901L */ - -/* The value corresponds to UNICODE version 4.0, which is the version - supported by XP. Newlib supports 5.2 (2011) but so far Cygwin needs - the MS conversions for double-byte charsets. */ -#define __STDC_ISO_10646__ 200305L - -#endif /* __CYGWIN__ */ - -/* ESP-IDF-specific: enable pthreads support */ -#ifdef __XTENSA__ -#define _POSIX_THREADS 1 -#define _UNIX98_THREAD_MUTEX_ATTRIBUTES 1 -#endif - -/* Per the permission given in POSIX.1-2008 section 2.2.1, define - * _POSIX_C_SOURCE if _XOPEN_SOURCE is defined and _POSIX_C_SOURCE is not. - * (_XOPEN_SOURCE indicates that XSI extensions are desired by an application.) - * This permission is first granted in 2008, but use it for older ones, also. - * Allow for _XOPEN_SOURCE to be empty (from the earliest form of it, before it - * was required to have specific values). - */ -#if !defined(_POSIX_C_SOURCE) && defined(_XOPEN_SOURCE) - #if (_XOPEN_SOURCE - 0) == 700 /* POSIX.1-2008 */ - #define _POSIX_C_SOURCE 200809L - #elif (_XOPEN_SOURCE - 0) == 600 /* POSIX.1-2001 or 2004 */ - #define _POSIX_C_SOURCE 200112L - #elif (_XOPEN_SOURCE - 0) == 500 /* POSIX.1-1995 */ - #define _POSIX_C_SOURCE 199506L - #elif (_XOPEN_SOURCE - 0) < 500 /* really old */ - #define _POSIX_C_SOURCE 2 - #endif -#endif - -#ifdef __cplusplus -} -#endif -#endif /* _SYS_FEATURES_H */ diff --git a/tools/sdk/include/newlib/sys/file.h b/tools/sdk/include/newlib/sys/file.h deleted file mode 100644 index be88c6a5ad6..00000000000 --- a/tools/sdk/include/newlib/sys/file.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (c) 2005-2006 Tensilica Inc. ALL RIGHTS RESERVED. - - 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. - - 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 TENSILICA - INCORPORATED 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. */ - -#include - -/* Alternate names for values for the WHENCE argument to `lseek'. - These are the same as SEEK_SET, SEEK_CUR, and SEEK_END, respectively. */ -#ifndef L_SET -#define L_SET 0 /* Seek from beginning of file. */ -#define L_INCR 1 /* Seek from current position. */ -#define L_XTND 2 /* Seek from end of file. */ -#endif diff --git a/tools/sdk/include/newlib/sys/iconvnls.h b/tools/sdk/include/newlib/sys/iconvnls.h deleted file mode 100644 index 09ea1831634..00000000000 --- a/tools/sdk/include/newlib/sys/iconvnls.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2003-2004, Artem B. Bityuckiy. - * Rights transferred to Franklin Electronic Publishers. - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - */ - -/* - * Funtions, macros, etc implimented in iconv library but used by other - * NLS-related subsystems too. - */ -#ifndef __SYS_ICONVNLS_H__ -#define __SYS_ICONVNLS_H__ - -#include <_ansi.h> -#include -#include -#include - -/* Iconv data path environment variable name */ -#define NLS_ENVVAR_NAME "NLSPATH" -/* Default NLSPATH value */ -#define ICONV_DEFAULT_NLSPATH "/usr/locale" -/* Direction markers */ -#define ICONV_NLS_FROM 0 -#define ICONV_NLS_TO 1 - -_VOID -_EXFUN(_iconv_nls_get_state, (iconv_t cd, mbstate_t *ps, int direction)); - -int -_EXFUN(_iconv_nls_set_state, (iconv_t cd, mbstate_t *ps, int direction)); - -int -_EXFUN(_iconv_nls_is_stateful, (iconv_t cd, int direction)); - -int -_EXFUN(_iconv_nls_get_mb_cur_max, (iconv_t cd, int direction)); - -size_t -_EXFUN(_iconv_nls_conv, (struct _reent *rptr, iconv_t cd, - _CONST char **inbuf, size_t *inbytesleft, - char **outbuf, size_t *outbytesleft)); - -_CONST char * -_EXFUN(_iconv_nls_construct_filename, (struct _reent *rptr, _CONST char *file, - _CONST char *dir, _CONST char *ext)); - - -int -_EXFUN(_iconv_nls_open, (struct _reent *rptr, _CONST char *encoding, - iconv_t *towc, iconv_t *fromwc, int flag)); - -char * -_EXFUN(_iconv_resolve_encoding_name, (struct _reent *rptr, _CONST char *ca)); - -#endif /* __SYS_ICONVNLS_H__ */ - diff --git a/tools/sdk/include/newlib/sys/lock.h b/tools/sdk/include/newlib/sys/lock.h deleted file mode 100644 index 0ff3475836f..00000000000 --- a/tools/sdk/include/newlib/sys/lock.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef _XTENSA_LOCK_H__ -#define _XTENSA_LOCK_H__ - -/* generic lock implementation. - - Weak linked stub _lock functions in lock.c, can be - replaced with a lock implementation at link time. - - */ - -typedef int _lock_t; -typedef _lock_t _LOCK_RECURSIVE_T; -typedef _lock_t _LOCK_T; - -#include <_ansi.h> - -/* NOTE: some parts of newlib statically initialise locks via - __LOCK_INIT, some initialise at runtime via __lock_init. So need to - support possibility that a _lock_t is null during first call to - _lock_acquire or _lock_try_acquire. - - Lock functions all take a pointer to the _lock_t entry, so the - value stored there can be manipulated. -*/ -#define __LOCK_INIT(CLASS,NAME) CLASS _lock_t NAME = 0; -#define __LOCK_INIT_RECURSIVE(CLASS,NAME) CLASS _lock_t NAME = 0; - -void _lock_init(_lock_t *lock); -void _lock_init_recursive(_lock_t *lock); -void _lock_close(_lock_t *lock); -void _lock_close_recursive(_lock_t *lock); -void _lock_acquire(_lock_t *lock); -void _lock_acquire_recursive(_lock_t *lock); -int _lock_try_acquire(_lock_t *lock); -int _lock_try_acquire_recursive(_lock_t *lock); -void _lock_release(_lock_t *lock); -void _lock_release_recursive(_lock_t *lock); - -#define __lock_init(lock) _lock_init(&(lock)) -#define __lock_init_recursive(lock) _lock_init_recursive(&(lock)) -#define __lock_close(lock) _lock_close(&(lock)) -#define __lock_close_recursive(lock) _lock_close_recursive(&(lock)) -#define __lock_acquire(lock) _lock_acquire(&(lock)) -#define __lock_acquire_recursive(lock) _lock_acquire_recursive(&(lock)) -#define __lock_try_acquire(lock) _lock_try_acquire(&(lock)) -#define __lock_try_acquire_recursive(lock) _lock_try_acquire_recursive(&(lock)) -#define __lock_release(lock) _lock_release(&(lock)) -#define __lock_release_recursive(lock) _lock_release_recursive(&(lock)) - -#endif /* _XTENSA_LOCK_H__ */ diff --git a/tools/sdk/include/newlib/sys/param.h b/tools/sdk/include/newlib/sys/param.h deleted file mode 100644 index ef203d3ecff..00000000000 --- a/tools/sdk/include/newlib/sys/param.h +++ /dev/null @@ -1,28 +0,0 @@ -/* This is a dummy file, not customized for any - particular system. If there is a param.h in libc/sys/SYSDIR/sys, - it will override this one. */ - -#ifndef _SYS_PARAM_H -# define _SYS_PARAM_H - -#include -#include -#include -#include - -#ifndef HZ -# define HZ (60) -#endif -#ifndef NOFILE -# define NOFILE (60) -#endif -#ifndef PATHSIZE -# define PATHSIZE (1024) -#endif - -#define MAXPATHLEN PATH_MAX - -#define MAX(a,b) ((a) > (b) ? (a) : (b)) -#define MIN(a,b) ((a) < (b) ? (a) : (b)) - -#endif diff --git a/tools/sdk/include/newlib/sys/poll.h b/tools/sdk/include/newlib/sys/poll.h deleted file mode 100644 index 030da6bf480..00000000000 --- a/tools/sdk/include/newlib/sys/poll.h +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2018-2019 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. - -#ifndef _ESP_PLATFORM_SYS_POLL_H_ -#define _ESP_PLATFORM_SYS_POLL_H_ - -#define POLLIN (1u << 0) /* data other than high-priority may be read without blocking */ -#define POLLRDNORM (1u << 1) /* normal data may be read without blocking */ -#define POLLRDBAND (1u << 2) /* priority data may be read without blocking */ -#define POLLPRI (POLLRDBAND) /* high-priority data may be read without blocking */ -// Note: POLLPRI is made equivalent to POLLRDBAND in order to fit all these events into one byte -#define POLLOUT (1u << 3) /* normal data may be written without blocking */ -#define POLLWRNORM (POLLOUT) /* equivalent to POLLOUT */ -#define POLLWRBAND (1u << 4) /* priority data my be written */ -#define POLLERR (1u << 5) /* some poll error occurred */ -#define POLLHUP (1u << 6) /* file descriptor was "hung up" */ -#define POLLNVAL (1u << 7) /* the specified file descriptor is invalid */ - -#ifdef __cplusplus -extern "C" { -#endif - -struct pollfd { - int fd; /* The descriptor. */ - short events; /* The event(s) is/are specified here. */ - short revents; /* Events found are returned here. */ -}; - -typedef unsigned int nfds_t; - -int poll(struct pollfd *fds, nfds_t nfds, int timeout); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _ESP_PLATFORM_SYS_POLL_H_ diff --git a/tools/sdk/include/newlib/sys/queue.h b/tools/sdk/include/newlib/sys/queue.h deleted file mode 100644 index 4bc7dac0efa..00000000000 --- a/tools/sdk/include/newlib/sys/queue.h +++ /dev/null @@ -1,691 +0,0 @@ -/*- - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * 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. - * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. - * - * @(#)queue.h 8.5 (Berkeley) 8/20/94 - * $FreeBSD$ - */ - -#ifndef _SYS_QUEUE_H_ -#define _SYS_QUEUE_H_ - -#include - -/* - * This file defines four types of data structures: singly-linked lists, - * singly-linked tail queues, lists and tail queues. - * - * A singly-linked list is headed by a single forward pointer. The elements - * are singly linked for minimum space and pointer manipulation overhead at - * the expense of O(n) removal for arbitrary elements. New elements can be - * added to the list after an existing element or at the head of the list. - * Elements being removed from the head of the list should use the explicit - * macro for this purpose for optimum efficiency. A singly-linked list may - * only be traversed in the forward direction. Singly-linked lists are ideal - * for applications with large datasets and few or no removals or for - * implementing a LIFO queue. - * - * A singly-linked tail queue is headed by a pair of pointers, one to the - * head of the list and the other to the tail of the list. The elements are - * singly linked for minimum space and pointer manipulation overhead at the - * expense of O(n) removal for arbitrary elements. New elements can be added - * to the list after an existing element, at the head of the list, or at the - * end of the list. Elements being removed from the head of the tail queue - * should use the explicit macro for this purpose for optimum efficiency. - * A singly-linked tail queue may only be traversed in the forward direction. - * Singly-linked tail queues are ideal for applications with large datasets - * and few or no removals or for implementing a FIFO queue. - * - * A list is headed by a single forward pointer (or an array of forward - * pointers for a hash table header). The elements are doubly linked - * so that an arbitrary element can be removed without a need to - * traverse the list. New elements can be added to the list before - * or after an existing element or at the head of the list. A list - * may be traversed in either direction. - * - * A tail queue is headed by a pair of pointers, one to the head of the - * list and the other to the tail of the list. The elements are doubly - * linked so that an arbitrary element can be removed without a need to - * traverse the list. New elements can be added to the list before or - * after an existing element, at the head of the list, or at the end of - * the list. A tail queue may be traversed in either direction. - * - * For details on the use of these macros, see the queue(3) manual page. - * - * - * SLIST LIST STAILQ TAILQ - * _HEAD + + + + - * _HEAD_INITIALIZER + + + + - * _ENTRY + + + + - * _INIT + + + + - * _EMPTY + + + + - * _FIRST + + + + - * _NEXT + + + + - * _PREV - + - + - * _LAST - - + + - * _FOREACH + + + + - * _FOREACH_SAFE + + + + - * _FOREACH_REVERSE - - - + - * _FOREACH_REVERSE_SAFE - - - + - * _INSERT_HEAD + + + + - * _INSERT_BEFORE - + - + - * _INSERT_AFTER + + + + - * _INSERT_TAIL - - + + - * _CONCAT - - + + - * _REMOVE_AFTER + - + - - * _REMOVE_HEAD + - + - - * _REMOVE + + + + - * _SWAP + + + + - * - */ -#ifdef QUEUE_MACRO_DEBUG -/* Store the last 2 places the queue element or head was altered */ -struct qm_trace { - unsigned long lastline; - unsigned long prevline; - const char *lastfile; - const char *prevfile; -}; - -#define TRACEBUF struct qm_trace trace; -#define TRACEBUF_INITIALIZER { __FILE__, __LINE__, NULL, 0 } , -#define TRASHIT(x) do {(x) = (void *)-1;} while (0) -#define QMD_SAVELINK(name, link) void **name = (void *)&(link) - -#define QMD_TRACE_HEAD(head) do { \ - (head)->trace.prevline = (head)->trace.lastline; \ - (head)->trace.prevfile = (head)->trace.lastfile; \ - (head)->trace.lastline = __LINE__; \ - (head)->trace.lastfile = __FILE__; \ -} while (0) - -#define QMD_TRACE_ELEM(elem) do { \ - (elem)->trace.prevline = (elem)->trace.lastline; \ - (elem)->trace.prevfile = (elem)->trace.lastfile; \ - (elem)->trace.lastline = __LINE__; \ - (elem)->trace.lastfile = __FILE__; \ -} while (0) - -#else -#define QMD_TRACE_ELEM(elem) -#define QMD_TRACE_HEAD(head) -#define QMD_SAVELINK(name, link) -#define TRACEBUF -#define TRACEBUF_INITIALIZER -#define TRASHIT(x) -#endif /* QUEUE_MACRO_DEBUG */ - -/* - * Singly-linked List declarations. - */ -#define SLIST_HEAD(name, type) \ -struct name { \ - struct type *slh_first; /* first element */ \ -} - -#define SLIST_HEAD_INITIALIZER(head) \ - { NULL } - -#define SLIST_ENTRY(type) \ -struct { \ - struct type *sle_next; /* next element */ \ -} - -/* - * Singly-linked List functions. - */ -#define SLIST_EMPTY(head) ((head)->slh_first == NULL) - -#define SLIST_FIRST(head) ((head)->slh_first) - -#define SLIST_FOREACH(var, head, field) \ - for ((var) = SLIST_FIRST((head)); \ - (var); \ - (var) = SLIST_NEXT((var), field)) - -#define SLIST_FOREACH_SAFE(var, head, field, tvar) \ - for ((var) = SLIST_FIRST((head)); \ - (var) && ((tvar) = SLIST_NEXT((var), field), 1); \ - (var) = (tvar)) - -#define SLIST_FOREACH_PREVPTR(var, varp, head, field) \ - for ((varp) = &SLIST_FIRST((head)); \ - ((var) = *(varp)) != NULL; \ - (varp) = &SLIST_NEXT((var), field)) - -#define SLIST_INIT(head) do { \ - SLIST_FIRST((head)) = NULL; \ -} while (0) - -#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ - SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); \ - SLIST_NEXT((slistelm), field) = (elm); \ -} while (0) - -#define SLIST_INSERT_HEAD(head, elm, field) do { \ - SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \ - SLIST_FIRST((head)) = (elm); \ -} while (0) - -#define SLIST_NEXT(elm, field) ((elm)->field.sle_next) - -#define SLIST_REMOVE(head, elm, type, field) do { \ - QMD_SAVELINK(oldnext, (elm)->field.sle_next); \ - if (SLIST_FIRST((head)) == (elm)) { \ - SLIST_REMOVE_HEAD((head), field); \ - } \ - else { \ - struct type *curelm = SLIST_FIRST((head)); \ - while (SLIST_NEXT(curelm, field) != (elm)) \ - curelm = SLIST_NEXT(curelm, field); \ - SLIST_REMOVE_AFTER(curelm, field); \ - } \ - TRASHIT(*oldnext); \ -} while (0) - -#define SLIST_REMOVE_AFTER(elm, field) do { \ - SLIST_NEXT(elm, field) = \ - SLIST_NEXT(SLIST_NEXT(elm, field), field); \ -} while (0) - -#define SLIST_REMOVE_HEAD(head, field) do { \ - SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \ -} while (0) - -#define SLIST_SWAP(head1, head2, type) do { \ - struct type *swap_first = SLIST_FIRST(head1); \ - SLIST_FIRST(head1) = SLIST_FIRST(head2); \ - SLIST_FIRST(head2) = swap_first; \ -} while (0) - -/* - * Singly-linked Tail queue declarations. - */ -#define STAILQ_HEAD(name, type) \ -struct name { \ - struct type *stqh_first;/* first element */ \ - struct type **stqh_last;/* addr of last next element */ \ -} - -#define STAILQ_HEAD_INITIALIZER(head) \ - { NULL, &(head).stqh_first } - -#define STAILQ_ENTRY(type) \ -struct { \ - struct type *stqe_next; /* next element */ \ -} - -/* - * Singly-linked Tail queue functions. - */ -#define STAILQ_CONCAT(head1, head2) do { \ - if (!STAILQ_EMPTY((head2))) { \ - *(head1)->stqh_last = (head2)->stqh_first; \ - (head1)->stqh_last = (head2)->stqh_last; \ - STAILQ_INIT((head2)); \ - } \ -} while (0) - -#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) - -#define STAILQ_FIRST(head) ((head)->stqh_first) - -#define STAILQ_FOREACH(var, head, field) \ - for((var) = STAILQ_FIRST((head)); \ - (var); \ - (var) = STAILQ_NEXT((var), field)) - - -#define STAILQ_FOREACH_SAFE(var, head, field, tvar) \ - for ((var) = STAILQ_FIRST((head)); \ - (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \ - (var) = (tvar)) - -#define STAILQ_INIT(head) do { \ - STAILQ_FIRST((head)) = NULL; \ - (head)->stqh_last = &STAILQ_FIRST((head)); \ -} while (0) - -#define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \ - if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\ - (head)->stqh_last = &STAILQ_NEXT((elm), field); \ - STAILQ_NEXT((tqelm), field) = (elm); \ -} while (0) - -#define STAILQ_INSERT_HEAD(head, elm, field) do { \ - if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \ - (head)->stqh_last = &STAILQ_NEXT((elm), field); \ - STAILQ_FIRST((head)) = (elm); \ -} while (0) - -#define STAILQ_INSERT_TAIL(head, elm, field) do { \ - STAILQ_NEXT((elm), field) = NULL; \ - *(head)->stqh_last = (elm); \ - (head)->stqh_last = &STAILQ_NEXT((elm), field); \ -} while (0) - -#define STAILQ_LAST(head, type, field) \ - (STAILQ_EMPTY((head)) ? NULL : \ - __containerof((head)->stqh_last, struct type, field.stqe_next)) - -#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) - -#define STAILQ_REMOVE(head, elm, type, field) do { \ - QMD_SAVELINK(oldnext, (elm)->field.stqe_next); \ - if (STAILQ_FIRST((head)) == (elm)) { \ - STAILQ_REMOVE_HEAD((head), field); \ - } \ - else { \ - struct type *curelm = STAILQ_FIRST((head)); \ - while (STAILQ_NEXT(curelm, field) != (elm)) \ - curelm = STAILQ_NEXT(curelm, field); \ - STAILQ_REMOVE_AFTER(head, curelm, field); \ - } \ - TRASHIT(*oldnext); \ -} while (0) - -#define STAILQ_REMOVE_AFTER(head, elm, field) do { \ - if ((STAILQ_NEXT(elm, field) = \ - STAILQ_NEXT(STAILQ_NEXT(elm, field), field)) == NULL) \ - (head)->stqh_last = &STAILQ_NEXT((elm), field); \ -} while (0) - -#define STAILQ_REMOVE_HEAD(head, field) do { \ - if ((STAILQ_FIRST((head)) = \ - STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \ - (head)->stqh_last = &STAILQ_FIRST((head)); \ -} while (0) - -#define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do { \ - if ((STAILQ_FIRST((head)) = STAILQ_NEXT((elm), field)) == NULL) \ - (head)->stqh_last = &STAILQ_FIRST((head)); \ -} while (0) - -#define STAILQ_SWAP(head1, head2, type) do { \ - struct type *swap_first = STAILQ_FIRST(head1); \ - struct type **swap_last = (head1)->stqh_last; \ - STAILQ_FIRST(head1) = STAILQ_FIRST(head2); \ - (head1)->stqh_last = (head2)->stqh_last; \ - STAILQ_FIRST(head2) = swap_first; \ - (head2)->stqh_last = swap_last; \ - if (STAILQ_EMPTY(head1)) \ - (head1)->stqh_last = &STAILQ_FIRST(head1); \ - if (STAILQ_EMPTY(head2)) \ - (head2)->stqh_last = &STAILQ_FIRST(head2); \ -} while (0) - - -/* - * List declarations. - */ -#define LIST_HEAD(name, type) \ -struct name { \ - struct type *lh_first; /* first element */ \ -} - -#define LIST_HEAD_INITIALIZER(head) \ - { NULL } - -#define LIST_ENTRY(type) \ -struct { \ - struct type *le_next; /* next element */ \ - struct type **le_prev; /* address of previous next element */ \ -} - -/* - * List functions. - */ - -#if (defined(_KERNEL) && defined(INVARIANTS)) -#define QMD_LIST_CHECK_HEAD(head, field) do { \ - if (LIST_FIRST((head)) != NULL && \ - LIST_FIRST((head))->field.le_prev != \ - &LIST_FIRST((head))) \ - panic("Bad list head %p first->prev != head", (head)); \ -} while (0) - -#define QMD_LIST_CHECK_NEXT(elm, field) do { \ - if (LIST_NEXT((elm), field) != NULL && \ - LIST_NEXT((elm), field)->field.le_prev != \ - &((elm)->field.le_next)) \ - panic("Bad link elm %p next->prev != elm", (elm)); \ -} while (0) - -#define QMD_LIST_CHECK_PREV(elm, field) do { \ - if (*(elm)->field.le_prev != (elm)) \ - panic("Bad link elm %p prev->next != elm", (elm)); \ -} while (0) -#else -#define QMD_LIST_CHECK_HEAD(head, field) -#define QMD_LIST_CHECK_NEXT(elm, field) -#define QMD_LIST_CHECK_PREV(elm, field) -#endif /* (_KERNEL && INVARIANTS) */ - -#define LIST_EMPTY(head) ((head)->lh_first == NULL) - -#define LIST_FIRST(head) ((head)->lh_first) - -#define LIST_FOREACH(var, head, field) \ - for ((var) = LIST_FIRST((head)); \ - (var); \ - (var) = LIST_NEXT((var), field)) - -#define LIST_FOREACH_SAFE(var, head, field, tvar) \ - for ((var) = LIST_FIRST((head)); \ - (var) && ((tvar) = LIST_NEXT((var), field), 1); \ - (var) = (tvar)) - -#define LIST_INIT(head) do { \ - LIST_FIRST((head)) = NULL; \ -} while (0) - -#define LIST_INSERT_AFTER(listelm, elm, field) do { \ - QMD_LIST_CHECK_NEXT(listelm, field); \ - if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\ - LIST_NEXT((listelm), field)->field.le_prev = \ - &LIST_NEXT((elm), field); \ - LIST_NEXT((listelm), field) = (elm); \ - (elm)->field.le_prev = &LIST_NEXT((listelm), field); \ -} while (0) - -#define LIST_INSERT_BEFORE(listelm, elm, field) do { \ - QMD_LIST_CHECK_PREV(listelm, field); \ - (elm)->field.le_prev = (listelm)->field.le_prev; \ - LIST_NEXT((elm), field) = (listelm); \ - *(listelm)->field.le_prev = (elm); \ - (listelm)->field.le_prev = &LIST_NEXT((elm), field); \ -} while (0) - -#define LIST_INSERT_HEAD(head, elm, field) do { \ - QMD_LIST_CHECK_HEAD((head), field); \ - if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \ - LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\ - LIST_FIRST((head)) = (elm); \ - (elm)->field.le_prev = &LIST_FIRST((head)); \ -} while (0) - -#define LIST_NEXT(elm, field) ((elm)->field.le_next) - -#define LIST_PREV(elm, head, type, field) \ - ((elm)->field.le_prev == &LIST_FIRST((head)) ? NULL : \ - __containerof((elm)->field.le_prev, struct type, field.le_next)) - -#define LIST_REMOVE(elm, field) do { \ - QMD_SAVELINK(oldnext, (elm)->field.le_next); \ - QMD_SAVELINK(oldprev, (elm)->field.le_prev); \ - QMD_LIST_CHECK_NEXT(elm, field); \ - QMD_LIST_CHECK_PREV(elm, field); \ - if (LIST_NEXT((elm), field) != NULL) \ - LIST_NEXT((elm), field)->field.le_prev = \ - (elm)->field.le_prev; \ - *(elm)->field.le_prev = LIST_NEXT((elm), field); \ - TRASHIT(*oldnext); \ - TRASHIT(*oldprev); \ -} while (0) - -#define LIST_SWAP(head1, head2, type, field) do { \ - struct type *swap_tmp = LIST_FIRST((head1)); \ - LIST_FIRST((head1)) = LIST_FIRST((head2)); \ - LIST_FIRST((head2)) = swap_tmp; \ - if ((swap_tmp = LIST_FIRST((head1))) != NULL) \ - swap_tmp->field.le_prev = &LIST_FIRST((head1)); \ - if ((swap_tmp = LIST_FIRST((head2))) != NULL) \ - swap_tmp->field.le_prev = &LIST_FIRST((head2)); \ -} while (0) - -/* - * Tail queue declarations. - */ -#define TAILQ_HEAD(name, type) \ -struct name { \ - struct type *tqh_first; /* first element */ \ - struct type **tqh_last; /* addr of last next element */ \ - TRACEBUF \ -} - -#define TAILQ_HEAD_INITIALIZER(head) \ - { NULL, &(head).tqh_first, TRACEBUF_INITIALIZER } - -#define TAILQ_ENTRY(type) \ -struct { \ - struct type *tqe_next; /* next element */ \ - struct type **tqe_prev; /* address of previous next element */ \ - TRACEBUF \ -} - -/* - * Tail queue functions. - */ -#if (defined(_KERNEL) && defined(INVARIANTS)) -#define QMD_TAILQ_CHECK_HEAD(head, field) do { \ - if (!TAILQ_EMPTY(head) && \ - TAILQ_FIRST((head))->field.tqe_prev != \ - &TAILQ_FIRST((head))) \ - panic("Bad tailq head %p first->prev != head", (head)); \ -} while (0) - -#define QMD_TAILQ_CHECK_TAIL(head, field) do { \ - if (*(head)->tqh_last != NULL) \ - panic("Bad tailq NEXT(%p->tqh_last) != NULL", (head)); \ -} while (0) - -#define QMD_TAILQ_CHECK_NEXT(elm, field) do { \ - if (TAILQ_NEXT((elm), field) != NULL && \ - TAILQ_NEXT((elm), field)->field.tqe_prev != \ - &((elm)->field.tqe_next)) \ - panic("Bad link elm %p next->prev != elm", (elm)); \ -} while (0) - -#define QMD_TAILQ_CHECK_PREV(elm, field) do { \ - if (*(elm)->field.tqe_prev != (elm)) \ - panic("Bad link elm %p prev->next != elm", (elm)); \ -} while (0) -#else -#define QMD_TAILQ_CHECK_HEAD(head, field) -#define QMD_TAILQ_CHECK_TAIL(head, headname) -#define QMD_TAILQ_CHECK_NEXT(elm, field) -#define QMD_TAILQ_CHECK_PREV(elm, field) -#endif /* (_KERNEL && INVARIANTS) */ - -#define TAILQ_CONCAT(head1, head2, field) do { \ - if (!TAILQ_EMPTY(head2)) { \ - *(head1)->tqh_last = (head2)->tqh_first; \ - (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \ - (head1)->tqh_last = (head2)->tqh_last; \ - TAILQ_INIT((head2)); \ - QMD_TRACE_HEAD(head1); \ - QMD_TRACE_HEAD(head2); \ - } \ -} while (0) - -#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) - -#define TAILQ_FIRST(head) ((head)->tqh_first) - -#define TAILQ_FOREACH(var, head, field) \ - for ((var) = TAILQ_FIRST((head)); \ - (var); \ - (var) = TAILQ_NEXT((var), field)) - -#define TAILQ_FOREACH_SAFE(var, head, field, tvar) \ - for ((var) = TAILQ_FIRST((head)); \ - (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \ - (var) = (tvar)) - -#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ - for ((var) = TAILQ_LAST((head), headname); \ - (var); \ - (var) = TAILQ_PREV((var), headname, field)) - -#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \ - for ((var) = TAILQ_LAST((head), headname); \ - (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \ - (var) = (tvar)) - -#define TAILQ_INIT(head) do { \ - TAILQ_FIRST((head)) = NULL; \ - (head)->tqh_last = &TAILQ_FIRST((head)); \ - QMD_TRACE_HEAD(head); \ -} while (0) - -#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ - QMD_TAILQ_CHECK_NEXT(listelm, field); \ - if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\ - TAILQ_NEXT((elm), field)->field.tqe_prev = \ - &TAILQ_NEXT((elm), field); \ - else { \ - (head)->tqh_last = &TAILQ_NEXT((elm), field); \ - QMD_TRACE_HEAD(head); \ - } \ - TAILQ_NEXT((listelm), field) = (elm); \ - (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); \ - QMD_TRACE_ELEM(&(elm)->field); \ - QMD_TRACE_ELEM(&listelm->field); \ -} while (0) - -#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ - QMD_TAILQ_CHECK_PREV(listelm, field); \ - (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ - TAILQ_NEXT((elm), field) = (listelm); \ - *(listelm)->field.tqe_prev = (elm); \ - (listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \ - QMD_TRACE_ELEM(&(elm)->field); \ - QMD_TRACE_ELEM(&listelm->field); \ -} while (0) - -#define TAILQ_INSERT_HEAD(head, elm, field) do { \ - QMD_TAILQ_CHECK_HEAD(head, field); \ - if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \ - TAILQ_FIRST((head))->field.tqe_prev = \ - &TAILQ_NEXT((elm), field); \ - else \ - (head)->tqh_last = &TAILQ_NEXT((elm), field); \ - TAILQ_FIRST((head)) = (elm); \ - (elm)->field.tqe_prev = &TAILQ_FIRST((head)); \ - QMD_TRACE_HEAD(head); \ - QMD_TRACE_ELEM(&(elm)->field); \ -} while (0) - -#define TAILQ_INSERT_TAIL(head, elm, field) do { \ - QMD_TAILQ_CHECK_TAIL(head, field); \ - TAILQ_NEXT((elm), field) = NULL; \ - (elm)->field.tqe_prev = (head)->tqh_last; \ - *(head)->tqh_last = (elm); \ - (head)->tqh_last = &TAILQ_NEXT((elm), field); \ - QMD_TRACE_HEAD(head); \ - QMD_TRACE_ELEM(&(elm)->field); \ -} while (0) - -#define TAILQ_LAST(head, headname) \ - (*(((struct headname *)((head)->tqh_last))->tqh_last)) - -#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) - -#define TAILQ_PREV(elm, headname, field) \ - (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) - -#define TAILQ_REMOVE(head, elm, field) do { \ - QMD_SAVELINK(oldnext, (elm)->field.tqe_next); \ - QMD_SAVELINK(oldprev, (elm)->field.tqe_prev); \ - QMD_TAILQ_CHECK_NEXT(elm, field); \ - QMD_TAILQ_CHECK_PREV(elm, field); \ - if ((TAILQ_NEXT((elm), field)) != NULL) \ - TAILQ_NEXT((elm), field)->field.tqe_prev = \ - (elm)->field.tqe_prev; \ - else { \ - (head)->tqh_last = (elm)->field.tqe_prev; \ - QMD_TRACE_HEAD(head); \ - } \ - *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \ - TRASHIT(*oldnext); \ - TRASHIT(*oldprev); \ - QMD_TRACE_ELEM(&(elm)->field); \ -} while (0) - -#define TAILQ_SWAP(head1, head2, type, field) do { \ - struct type *swap_first = (head1)->tqh_first; \ - struct type **swap_last = (head1)->tqh_last; \ - (head1)->tqh_first = (head2)->tqh_first; \ - (head1)->tqh_last = (head2)->tqh_last; \ - (head2)->tqh_first = swap_first; \ - (head2)->tqh_last = swap_last; \ - if ((swap_first = (head1)->tqh_first) != NULL) \ - swap_first->field.tqe_prev = &(head1)->tqh_first; \ - else \ - (head1)->tqh_last = &(head1)->tqh_first; \ - if ((swap_first = (head2)->tqh_first) != NULL) \ - swap_first->field.tqe_prev = &(head2)->tqh_first; \ - else \ - (head2)->tqh_last = &(head2)->tqh_first; \ -} while (0) - -#ifdef _KERNEL - -/* - * XXX insque() and remque() are an old way of handling certain queues. - * They bogusly assumes that all queue heads look alike. - */ - -struct quehead { - struct quehead *qh_link; - struct quehead *qh_rlink; -}; - -#ifdef __GNUC__ - -static __inline void -insque(void *a, void *b) -{ - struct quehead *element = (struct quehead *)a, - *head = (struct quehead *)b; - - element->qh_link = head->qh_link; - element->qh_rlink = head; - head->qh_link = element; - element->qh_link->qh_rlink = element; -} - -static __inline void -remque(void *a) -{ - struct quehead *element = (struct quehead *)a; - - element->qh_link->qh_rlink = element->qh_rlink; - element->qh_rlink->qh_link = element->qh_link; - element->qh_rlink = 0; -} - -#else /* !__GNUC__ */ - -void insque(void *a, void *b); -void remque(void *a); - -#endif /* __GNUC__ */ - -#endif /* _KERNEL */ - -#endif /* !_SYS_QUEUE_H_ */ diff --git a/tools/sdk/include/newlib/sys/random.h b/tools/sdk/include/newlib/sys/random.h deleted file mode 100644 index afbf4dfd036..00000000000 --- a/tools/sdk/include/newlib/sys/random.h +++ /dev/null @@ -1,30 +0,0 @@ -// 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. - -#ifndef __SYS_RANDOM__ -#define __SYS_RANDOM__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -ssize_t getrandom(void *buf, size_t buflen, unsigned int flags); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif //__SYS_RANDOM__ diff --git a/tools/sdk/include/newlib/sys/reent.h b/tools/sdk/include/newlib/sys/reent.h deleted file mode 100644 index b35595a7d4a..00000000000 --- a/tools/sdk/include/newlib/sys/reent.h +++ /dev/null @@ -1,798 +0,0 @@ -/* This header file provides the reentrancy. */ - -/* WARNING: All identifiers here must begin with an underscore. This file is - included by stdio.h and others and we therefore must only use identifiers - in the namespace allotted to us. */ - -#ifndef _SYS_REENT_H_ -#ifdef __cplusplus -extern "C" { -#endif -#define _SYS_REENT_H_ - -#include <_ansi.h> -#include -#include - -#define _NULL 0 - -#ifndef __Long -#if __LONG_MAX__ == 2147483647L -#define __Long long -typedef unsigned __Long __ULong; -#elif __INT_MAX__ == 2147483647 -#define __Long int -typedef unsigned __Long __ULong; -#endif -#endif - -#if !defined( __Long) -#include -#endif - -#ifndef __Long -#define __Long __int32_t -typedef __uint32_t __ULong; -#endif - -struct _reent; - -/* - * If _REENT_SMALL is defined, we make struct _reent as small as possible, - * by having nearly everything possible allocated at first use. - */ - -struct _Bigint -{ - struct _Bigint *_next; - int _k, _maxwds, _sign, _wds; - __ULong _x[1]; -}; - -/* needed by reentrant structure */ -struct __tm -{ - int __tm_sec; - int __tm_min; - int __tm_hour; - int __tm_mday; - int __tm_mon; - int __tm_year; - int __tm_wday; - int __tm_yday; - int __tm_isdst; -}; - -/* - * atexit() support. - */ - -#define _ATEXIT_SIZE 32 /* must be at least 32 to guarantee ANSI conformance */ - -struct _on_exit_args { - void * _fnargs[_ATEXIT_SIZE]; /* user fn args */ - void * _dso_handle[_ATEXIT_SIZE]; - /* Bitmask is set if user function takes arguments. */ - __ULong _fntypes; /* type of exit routine - - Must have at least _ATEXIT_SIZE bits */ - /* Bitmask is set if function was registered via __cxa_atexit. */ - __ULong _is_cxa; -}; - -#ifdef _REENT_SMALL -struct _atexit { - struct _atexit *_next; /* next in list */ - int _ind; /* next index in this table */ - void (*_fns[_ATEXIT_SIZE])(void); /* the table itself */ - struct _on_exit_args * _on_exit_args_ptr; -}; -# define _ATEXIT_INIT {_NULL, 0, {_NULL}, _NULL} -#else -struct _atexit { - struct _atexit *_next; /* next in list */ - int _ind; /* next index in this table */ - /* Some entries may already have been called, and will be NULL. */ - void (*_fns[_ATEXIT_SIZE])(void); /* the table itself */ - struct _on_exit_args _on_exit_args; -}; -# define _ATEXIT_INIT {_NULL, 0, {_NULL}, {{_NULL}, {_NULL}, 0, 0}} -#endif - -#ifdef _REENT_GLOBAL_ATEXIT -# define _REENT_INIT_ATEXIT -#else -# define _REENT_INIT_ATEXIT \ - _NULL, _ATEXIT_INIT, -#endif - -/* - * Stdio buffers. - * - * This and __FILE are defined here because we need them for struct _reent, - * but we don't want stdio.h included when stdlib.h is. - */ - -struct __sbuf { - unsigned char *_base; - int _size; -}; - -/* - * Stdio state variables. - * - * The following always hold: - * - * if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR), - * _lbfsize is -_bf._size, else _lbfsize is 0 - * if _flags&__SRD, _w is 0 - * if _flags&__SWR, _r is 0 - * - * This ensures that the getc and putc macros (or inline functions) never - * try to write or read from a file that is in `read' or `write' mode. - * (Moreover, they can, and do, automatically switch from read mode to - * write mode, and back, on "r+" and "w+" files.) - * - * _lbfsize is used only to make the inline line-buffered output stream - * code as compact as possible. - * - * _ub, _up, and _ur are used when ungetc() pushes back more characters - * than fit in the current _bf, or when ungetc() pushes back a character - * that does not match the previous one in _bf. When this happens, - * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff - * _ub._base!=NULL) and _up and _ur save the current values of _p and _r. - */ - -#ifdef _REENT_SMALL -/* - * struct __sFILE_fake is the start of a struct __sFILE, with only the - * minimal fields allocated. In __sinit() we really allocate the 3 - * standard streams, etc., and point away from this fake. - */ -struct __sFILE_fake { - unsigned char *_p; /* current position in (some) buffer */ - int _r; /* read space left for getc() */ - int _w; /* write space left for putc() */ - short _flags; /* flags, below; this FILE is free if 0 */ - short _file; /* fileno, if Unix descriptor, else -1 */ - struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */ - int _lbfsize; /* 0 or -_bf._size, for inline putc */ - - struct _reent *_data; -}; - -/* Following is needed both in libc/stdio and libc/stdlib so we put it - * here instead of libc/stdio/local.h where it was previously. */ - -extern _VOID _EXFUN(__sinit,(struct _reent *)); - -# define _REENT_SMALL_CHECK_INIT(ptr) \ - do \ - { \ - if ((ptr) && !(ptr)->__sdidinit) \ - __sinit (ptr); \ - } \ - while (0) -#else -# define _REENT_SMALL_CHECK_INIT(ptr) /* nothing */ -#endif - -struct __sFILE { - unsigned char *_p; /* current position in (some) buffer */ - int _r; /* read space left for getc() */ - int _w; /* write space left for putc() */ - short _flags; /* flags, below; this FILE is free if 0 */ - short _file; /* fileno, if Unix descriptor, else -1 */ - struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */ - int _lbfsize; /* 0 or -_bf._size, for inline putc */ - -#ifdef _REENT_SMALL - struct _reent *_data; -#endif - - /* operations */ - _PTR _cookie; /* cookie passed to io functions */ - - _READ_WRITE_RETURN_TYPE _EXFNPTR(_read, (struct _reent *, _PTR, - char *, _READ_WRITE_BUFSIZE_TYPE)); - _READ_WRITE_RETURN_TYPE _EXFNPTR(_write, (struct _reent *, _PTR, - const char *, - _READ_WRITE_BUFSIZE_TYPE)); - _fpos_t _EXFNPTR(_seek, (struct _reent *, _PTR, _fpos_t, int)); - int _EXFNPTR(_close, (struct _reent *, _PTR)); - - /* separate buffer for long sequences of ungetc() */ - struct __sbuf _ub; /* ungetc buffer */ - unsigned char *_up; /* saved _p when _p is doing ungetc data */ - int _ur; /* saved _r when _r is counting ungetc data */ - - /* tricks to meet minimum requirements even when malloc() fails */ - unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */ - unsigned char _nbuf[1]; /* guarantee a getc() buffer */ - - /* separate buffer for fgetline() when line crosses buffer boundary */ - struct __sbuf _lb; /* buffer for fgetline() */ - - /* Unix stdio files get aligned to block boundaries on fseek() */ - int _blksize; /* stat.st_blksize (may be != _bf._size) */ - _off_t _offset; /* current lseek offset */ - -#ifndef _REENT_SMALL - struct _reent *_data; /* Here for binary compatibility? Remove? */ -#endif - -#ifndef __SINGLE_THREAD__ - _flock_t _lock; /* for thread-safety locking */ -#endif - _mbstate_t _mbstate; /* for wide char stdio functions. */ - int _flags2; /* for future use */ -}; - -#ifdef __CUSTOM_FILE_IO__ - -/* Get custom _FILE definition. */ -#include - -#else /* !__CUSTOM_FILE_IO__ */ -#ifdef __LARGE64_FILES -struct __sFILE64 { - unsigned char *_p; /* current position in (some) buffer */ - int _r; /* read space left for getc() */ - int _w; /* write space left for putc() */ - short _flags; /* flags, below; this FILE is free if 0 */ - short _file; /* fileno, if Unix descriptor, else -1 */ - struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */ - int _lbfsize; /* 0 or -_bf._size, for inline putc */ - - struct _reent *_data; - - /* operations */ - _PTR _cookie; /* cookie passed to io functions */ - - _READ_WRITE_RETURN_TYPE _EXFNPTR(_read, (struct _reent *, _PTR, - char *, _READ_WRITE_BUFSIZE_TYPE)); - _READ_WRITE_RETURN_TYPE _EXFNPTR(_write, (struct _reent *, _PTR, - const char *, - _READ_WRITE_BUFSIZE_TYPE)); - _fpos_t _EXFNPTR(_seek, (struct _reent *, _PTR, _fpos_t, int)); - int _EXFNPTR(_close, (struct _reent *, _PTR)); - - /* separate buffer for long sequences of ungetc() */ - struct __sbuf _ub; /* ungetc buffer */ - unsigned char *_up; /* saved _p when _p is doing ungetc data */ - int _ur; /* saved _r when _r is counting ungetc data */ - - /* tricks to meet minimum requirements even when malloc() fails */ - unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */ - unsigned char _nbuf[1]; /* guarantee a getc() buffer */ - - /* separate buffer for fgetline() when line crosses buffer boundary */ - struct __sbuf _lb; /* buffer for fgetline() */ - - /* Unix stdio files get aligned to block boundaries on fseek() */ - int _blksize; /* stat.st_blksize (may be != _bf._size) */ - int _flags2; /* for future use */ - - _off64_t _offset; /* current lseek offset */ - _fpos64_t _EXFNPTR(_seek64, (struct _reent *, _PTR, _fpos64_t, int)); - -#ifndef __SINGLE_THREAD__ - _flock_t _lock; /* for thread-safety locking */ -#endif - _mbstate_t _mbstate; /* for wide char stdio functions. */ -}; -typedef struct __sFILE64 __FILE; -#else -typedef struct __sFILE __FILE; -#endif /* __LARGE64_FILES */ -#endif /* !__CUSTOM_FILE_IO__ */ - -struct _glue -{ - struct _glue *_next; - int _niobs; - __FILE *_iobs; -}; - -/* - * rand48 family support - * - * Copyright (c) 1993 Martin Birgmeier - * All rights reserved. - * - * You may redistribute unmodified or modified versions of this source - * code provided that the above copyright notice and this and the - * following conditions are retained. - * - * This software is provided ``as is'', and comes with no warranties - * of any kind. I shall in no event be liable for anything that happens - * to anyone/anything when using this software. - */ -#define _RAND48_SEED_0 (0x330e) -#define _RAND48_SEED_1 (0xabcd) -#define _RAND48_SEED_2 (0x1234) -#define _RAND48_MULT_0 (0xe66d) -#define _RAND48_MULT_1 (0xdeec) -#define _RAND48_MULT_2 (0x0005) -#define _RAND48_ADD (0x000b) -struct _rand48 { - unsigned short _seed[3]; - unsigned short _mult[3]; - unsigned short _add; -#ifdef _REENT_SMALL - /* Put this in here as well, for good luck. */ - __extension__ unsigned long long _rand_next; -#endif -}; - -/* How big the some arrays are. */ -#define _REENT_EMERGENCY_SIZE 25 -#define _REENT_ASCTIME_SIZE 26 -#define _REENT_SIGNAL_SIZE 24 - -/* - * struct _reent - * - * This structure contains *all* globals needed by the library. - * It's raison d'etre is to facilitate threads by making all library routines - * reentrant. IE: All state information is contained here. - */ - -#ifdef _REENT_SMALL - -struct _mprec -{ - /* used by mprec routines */ - struct _Bigint *_result; - int _result_k; - struct _Bigint *_p5s; - struct _Bigint **_freelist; -}; - - -struct _misc_reent -{ - /* miscellaneous reentrant data */ - char *_strtok_last; - _mbstate_t _mblen_state; - _mbstate_t _wctomb_state; - _mbstate_t _mbtowc_state; - char _l64a_buf[8]; - int _getdate_err; - _mbstate_t _mbrlen_state; - _mbstate_t _mbrtowc_state; - _mbstate_t _mbsrtowcs_state; - _mbstate_t _wcrtomb_state; - _mbstate_t _wcsrtombs_state; -}; - -/* This version of _reent is laid out with "int"s in pairs, to help - * ports with 16-bit int's but 32-bit pointers, align nicely. */ -struct _reent -{ - /* As an exception to the above put _errno first for binary - compatibility with non _REENT_SMALL targets. */ - int _errno; /* local copy of errno */ - - /* FILE is a big struct and may change over time. To try to achieve binary - compatibility with future versions, put stdin,stdout,stderr here. - These are pointers into member __sf defined below. */ - __FILE *_stdin, *_stdout, *_stderr; /* XXX */ - - int _inc; /* used by tmpnam */ - - char *_emergency; - - int __sdidinit; /* 1 means stdio has been init'd */ - - int _current_category; /* unused */ - _CONST char *_current_locale; /* unused */ - - struct _mprec *_mp; - - void _EXFNPTR(__cleanup, (struct _reent *)); - - int _gamma_signgam; - - /* used by some fp conversion routines */ - int _cvtlen; /* should be size_t */ - char *_cvtbuf; - - struct _rand48 *_r48; - struct __tm *_localtime_buf; - char *_asctime_buf; - - /* signal info */ - void (**_sig_func)(int); - -# ifndef _REENT_GLOBAL_ATEXIT - /* atexit stuff */ - struct _atexit *_atexit; - struct _atexit _atexit0; -# endif - - struct _glue __sglue; /* root of glue chain */ - __FILE *__sf; /* file descriptors */ - struct _misc_reent *_misc; /* strtok, multibyte states */ - char *_signal_buf; /* strsignal */ -}; - -extern const struct __sFILE_fake __sf_fake_stdin; -extern const struct __sFILE_fake __sf_fake_stdout; -extern const struct __sFILE_fake __sf_fake_stderr; - -# define _REENT_INIT(var) \ - { 0, \ - (__FILE *)&__sf_fake_stdin, \ - (__FILE *)&__sf_fake_stdout, \ - (__FILE *)&__sf_fake_stderr, \ - 0, \ - _NULL, \ - 0, \ - 0, \ - "C", \ - _NULL, \ - _NULL, \ - 0, \ - 0, \ - _NULL, \ - _NULL, \ - _NULL, \ - _NULL, \ - _NULL, \ - _REENT_INIT_ATEXIT \ - {_NULL, 0, _NULL}, \ - _NULL, \ - _NULL, \ - _NULL \ - } - -#ifndef ESP_PLATFORM -#define _REENT_INIT_PTR(var) \ - { memset((var), 0, sizeof(*(var))); \ - (var)->_stdin = (__FILE *)&__sf_fake_stdin; \ - (var)->_stdout = (__FILE *)&__sf_fake_stdout; \ - (var)->_stderr = (__FILE *)&__sf_fake_stderr; \ - (var)->_current_locale = "C"; \ - } -#else -extern void esp_reent_init(struct _reent* reent); -#define _REENT_INIT_PTR(var) esp_reent_init(var) -#endif - -/* Only built the assert() calls if we are built with debugging. */ -#if DEBUG -#include -#define __reent_assert(x) assert(x) -#else -#define __reent_assert(x) ((void)0) -#endif - -#ifdef __CUSTOM_FILE_IO__ -#error Custom FILE I/O and _REENT_SMALL not currently supported. -#endif - -/* Generic _REENT check macro. */ -#define _REENT_CHECK(var, what, type, size, init) do { \ - struct _reent *_r = (var); \ - if (_r->what == NULL) { \ - _r->what = (type)malloc(size); \ - __reent_assert(_r->what); \ - init; \ - } \ -} while (0) - -#define _REENT_CHECK_TM(var) \ - _REENT_CHECK(var, _localtime_buf, struct __tm *, sizeof *((var)->_localtime_buf), \ - /* nothing */) - -#define _REENT_CHECK_ASCTIME_BUF(var) \ - _REENT_CHECK(var, _asctime_buf, char *, _REENT_ASCTIME_SIZE, \ - memset((var)->_asctime_buf, 0, _REENT_ASCTIME_SIZE)) - -/* Handle the dynamically allocated rand48 structure. */ -#define _REENT_INIT_RAND48(var) do { \ - struct _reent *_r = (var); \ - _r->_r48->_seed[0] = _RAND48_SEED_0; \ - _r->_r48->_seed[1] = _RAND48_SEED_1; \ - _r->_r48->_seed[2] = _RAND48_SEED_2; \ - _r->_r48->_mult[0] = _RAND48_MULT_0; \ - _r->_r48->_mult[1] = _RAND48_MULT_1; \ - _r->_r48->_mult[2] = _RAND48_MULT_2; \ - _r->_r48->_add = _RAND48_ADD; \ - _r->_r48->_rand_next = 1; \ -} while (0) -#define _REENT_CHECK_RAND48(var) \ - _REENT_CHECK(var, _r48, struct _rand48 *, sizeof *((var)->_r48), _REENT_INIT_RAND48((var))) - -#define _REENT_INIT_MP(var) do { \ - struct _reent *_r = (var); \ - _r->_mp->_result_k = 0; \ - _r->_mp->_result = _r->_mp->_p5s = _NULL; \ - _r->_mp->_freelist = _NULL; \ -} while (0) -#define _REENT_CHECK_MP(var) \ - _REENT_CHECK(var, _mp, struct _mprec *, sizeof *((var)->_mp), _REENT_INIT_MP(var)) - -#define _REENT_CHECK_EMERGENCY(var) \ - _REENT_CHECK(var, _emergency, char *, _REENT_EMERGENCY_SIZE, /* nothing */) - -#define _REENT_INIT_MISC(var) do { \ - struct _reent *_r = (var); \ - _r->_misc->_strtok_last = _NULL; \ - _r->_misc->_mblen_state.__count = 0; \ - _r->_misc->_mblen_state.__value.__wch = 0; \ - _r->_misc->_wctomb_state.__count = 0; \ - _r->_misc->_wctomb_state.__value.__wch = 0; \ - _r->_misc->_mbtowc_state.__count = 0; \ - _r->_misc->_mbtowc_state.__value.__wch = 0; \ - _r->_misc->_mbrlen_state.__count = 0; \ - _r->_misc->_mbrlen_state.__value.__wch = 0; \ - _r->_misc->_mbrtowc_state.__count = 0; \ - _r->_misc->_mbrtowc_state.__value.__wch = 0; \ - _r->_misc->_mbsrtowcs_state.__count = 0; \ - _r->_misc->_mbsrtowcs_state.__value.__wch = 0; \ - _r->_misc->_wcrtomb_state.__count = 0; \ - _r->_misc->_wcrtomb_state.__value.__wch = 0; \ - _r->_misc->_wcsrtombs_state.__count = 0; \ - _r->_misc->_wcsrtombs_state.__value.__wch = 0; \ - _r->_misc->_l64a_buf[0] = '\0'; \ - _r->_misc->_getdate_err = 0; \ -} while (0) -#define _REENT_CHECK_MISC(var) \ - _REENT_CHECK(var, _misc, struct _misc_reent *, sizeof *((var)->_misc), _REENT_INIT_MISC(var)) - -#define _REENT_CHECK_SIGNAL_BUF(var) \ - _REENT_CHECK(var, _signal_buf, char *, _REENT_SIGNAL_SIZE, /* nothing */) - -#define _REENT_SIGNGAM(ptr) ((ptr)->_gamma_signgam) -#define _REENT_RAND_NEXT(ptr) ((ptr)->_r48->_rand_next) -#define _REENT_RAND48_SEED(ptr) ((ptr)->_r48->_seed) -#define _REENT_RAND48_MULT(ptr) ((ptr)->_r48->_mult) -#define _REENT_RAND48_ADD(ptr) ((ptr)->_r48->_add) -#define _REENT_MP_RESULT(ptr) ((ptr)->_mp->_result) -#define _REENT_MP_RESULT_K(ptr) ((ptr)->_mp->_result_k) -#define _REENT_MP_P5S(ptr) ((ptr)->_mp->_p5s) -#define _REENT_MP_FREELIST(ptr) ((ptr)->_mp->_freelist) -#define _REENT_ASCTIME_BUF(ptr) ((ptr)->_asctime_buf) -#define _REENT_TM(ptr) ((ptr)->_localtime_buf) -#define _REENT_EMERGENCY(ptr) ((ptr)->_emergency) -#define _REENT_STRTOK_LAST(ptr) ((ptr)->_misc->_strtok_last) -#define _REENT_MBLEN_STATE(ptr) ((ptr)->_misc->_mblen_state) -#define _REENT_MBTOWC_STATE(ptr)((ptr)->_misc->_mbtowc_state) -#define _REENT_WCTOMB_STATE(ptr)((ptr)->_misc->_wctomb_state) -#define _REENT_MBRLEN_STATE(ptr) ((ptr)->_misc->_mbrlen_state) -#define _REENT_MBRTOWC_STATE(ptr) ((ptr)->_misc->_mbrtowc_state) -#define _REENT_MBSRTOWCS_STATE(ptr) ((ptr)->_misc->_mbsrtowcs_state) -#define _REENT_WCRTOMB_STATE(ptr) ((ptr)->_misc->_wcrtomb_state) -#define _REENT_WCSRTOMBS_STATE(ptr) ((ptr)->_misc->_wcsrtombs_state) -#define _REENT_L64A_BUF(ptr) ((ptr)->_misc->_l64a_buf) -#define _REENT_GETDATE_ERR_P(ptr) (&((ptr)->_misc->_getdate_err)) -#define _REENT_SIGNAL_BUF(ptr) ((ptr)->_signal_buf) - -#else /* !_REENT_SMALL */ - -struct _reent -{ - int _errno; /* local copy of errno */ - - /* FILE is a big struct and may change over time. To try to achieve binary - compatibility with future versions, put stdin,stdout,stderr here. - These are pointers into member __sf defined below. */ - __FILE *_stdin, *_stdout, *_stderr; - - int _inc; /* used by tmpnam */ - char _emergency[_REENT_EMERGENCY_SIZE]; - - int _current_category; /* used by setlocale */ - _CONST char *_current_locale; - - int __sdidinit; /* 1 means stdio has been init'd */ - - void _EXFNPTR(__cleanup, (struct _reent *)); - - /* used by mprec routines */ - struct _Bigint *_result; - int _result_k; - struct _Bigint *_p5s; - struct _Bigint **_freelist; - - /* used by some fp conversion routines */ - int _cvtlen; /* should be size_t */ - char *_cvtbuf; - - union - { - struct - { - unsigned int _unused_rand; - char * _strtok_last; - char _asctime_buf[_REENT_ASCTIME_SIZE]; - struct __tm _localtime_buf; - int _gamma_signgam; - __extension__ unsigned long long _rand_next; - struct _rand48 _r48; - _mbstate_t _mblen_state; - _mbstate_t _mbtowc_state; - _mbstate_t _wctomb_state; - char _l64a_buf[8]; - char _signal_buf[_REENT_SIGNAL_SIZE]; - int _getdate_err; - _mbstate_t _mbrlen_state; - _mbstate_t _mbrtowc_state; - _mbstate_t _mbsrtowcs_state; - _mbstate_t _wcrtomb_state; - _mbstate_t _wcsrtombs_state; - int _h_errno; - } _reent; - /* Two next two fields were once used by malloc. They are no longer - used. They are used to preserve the space used before so as to - allow addition of new reent fields and keep binary compatibility. */ - struct - { -#define _N_LISTS 30 - unsigned char * _nextf[_N_LISTS]; - unsigned int _nmalloc[_N_LISTS]; - } _unused; - } _new; - -# ifndef _REENT_GLOBAL_ATEXIT - /* atexit stuff */ - struct _atexit *_atexit; /* points to head of LIFO stack */ - struct _atexit _atexit0; /* one guaranteed table, required by ANSI */ -# endif - - /* signal info */ - void (**(_sig_func))(int); - - /* These are here last so that __FILE can grow without changing the offsets - of the above members (on the off chance that future binary compatibility - would be broken otherwise). */ - struct _glue __sglue; /* root of glue chain */ - __FILE __sf[3]; /* first three file descriptors */ -}; - -#define _REENT_INIT(var) \ - { 0, \ - &(var).__sf[0], \ - &(var).__sf[1], \ - &(var).__sf[2], \ - 0, \ - "", \ - 0, \ - "C", \ - 0, \ - _NULL, \ - _NULL, \ - 0, \ - _NULL, \ - _NULL, \ - 0, \ - _NULL, \ - { \ - { \ - 0, \ - _NULL, \ - "", \ - {0, 0, 0, 0, 0, 0, 0, 0, 0}, \ - 0, \ - 1, \ - { \ - {_RAND48_SEED_0, _RAND48_SEED_1, _RAND48_SEED_2}, \ - {_RAND48_MULT_0, _RAND48_MULT_1, _RAND48_MULT_2}, \ - _RAND48_ADD \ - }, \ - {0, {0}}, \ - {0, {0}}, \ - {0, {0}}, \ - "", \ - "", \ - 0, \ - {0, {0}}, \ - {0, {0}}, \ - {0, {0}}, \ - {0, {0}}, \ - {0, {0}} \ - } \ - }, \ - _REENT_INIT_ATEXIT \ - _NULL, \ - {_NULL, 0, _NULL} \ - } - -#define _REENT_INIT_PTR(var) \ - { memset((var), 0, sizeof(*(var))); \ - (var)->_stdin = &(var)->__sf[0]; \ - (var)->_stdout = &(var)->__sf[1]; \ - (var)->_stderr = &(var)->__sf[2]; \ - (var)->_current_locale = "C"; \ - (var)->_new._reent._rand_next = 1; \ - (var)->_new._reent._r48._seed[0] = _RAND48_SEED_0; \ - (var)->_new._reent._r48._seed[1] = _RAND48_SEED_1; \ - (var)->_new._reent._r48._seed[2] = _RAND48_SEED_2; \ - (var)->_new._reent._r48._mult[0] = _RAND48_MULT_0; \ - (var)->_new._reent._r48._mult[1] = _RAND48_MULT_1; \ - (var)->_new._reent._r48._mult[2] = _RAND48_MULT_2; \ - (var)->_new._reent._r48._add = _RAND48_ADD; \ - } - -#define _REENT_CHECK_RAND48(ptr) /* nothing */ -#define _REENT_CHECK_MP(ptr) /* nothing */ -#define _REENT_CHECK_TM(ptr) /* nothing */ -#define _REENT_CHECK_ASCTIME_BUF(ptr) /* nothing */ -#define _REENT_CHECK_EMERGENCY(ptr) /* nothing */ -#define _REENT_CHECK_MISC(ptr) /* nothing */ -#define _REENT_CHECK_SIGNAL_BUF(ptr) /* nothing */ - -#define _REENT_SIGNGAM(ptr) ((ptr)->_new._reent._gamma_signgam) -#define _REENT_RAND_NEXT(ptr) ((ptr)->_new._reent._rand_next) -#define _REENT_RAND48_SEED(ptr) ((ptr)->_new._reent._r48._seed) -#define _REENT_RAND48_MULT(ptr) ((ptr)->_new._reent._r48._mult) -#define _REENT_RAND48_ADD(ptr) ((ptr)->_new._reent._r48._add) -#define _REENT_MP_RESULT(ptr) ((ptr)->_result) -#define _REENT_MP_RESULT_K(ptr) ((ptr)->_result_k) -#define _REENT_MP_P5S(ptr) ((ptr)->_p5s) -#define _REENT_MP_FREELIST(ptr) ((ptr)->_freelist) -#define _REENT_ASCTIME_BUF(ptr) ((ptr)->_new._reent._asctime_buf) -#define _REENT_TM(ptr) (&(ptr)->_new._reent._localtime_buf) -#define _REENT_EMERGENCY(ptr) ((ptr)->_emergency) -#define _REENT_STRTOK_LAST(ptr) ((ptr)->_new._reent._strtok_last) -#define _REENT_MBLEN_STATE(ptr) ((ptr)->_new._reent._mblen_state) -#define _REENT_MBTOWC_STATE(ptr)((ptr)->_new._reent._mbtowc_state) -#define _REENT_WCTOMB_STATE(ptr)((ptr)->_new._reent._wctomb_state) -#define _REENT_MBRLEN_STATE(ptr)((ptr)->_new._reent._mbrlen_state) -#define _REENT_MBRTOWC_STATE(ptr)((ptr)->_new._reent._mbrtowc_state) -#define _REENT_MBSRTOWCS_STATE(ptr)((ptr)->_new._reent._mbsrtowcs_state) -#define _REENT_WCRTOMB_STATE(ptr)((ptr)->_new._reent._wcrtomb_state) -#define _REENT_WCSRTOMBS_STATE(ptr)((ptr)->_new._reent._wcsrtombs_state) -#define _REENT_L64A_BUF(ptr) ((ptr)->_new._reent._l64a_buf) -#define _REENT_SIGNAL_BUF(ptr) ((ptr)->_new._reent._signal_buf) -#define _REENT_GETDATE_ERR_P(ptr) (&((ptr)->_new._reent._getdate_err)) - -#endif /* !_REENT_SMALL */ - -/* This value is used in stdlib/misc.c. reent/reent.c has to know it - as well to make sure the freelist is correctly free'd. Therefore - we define it here, rather than in stdlib/misc.c, as before. */ -#define _Kmax (sizeof (size_t) << 3) - -/* - * All references to struct _reent are via this pointer. - * Internally, newlib routines that need to reference it should use _REENT. - */ - -#ifndef __ATTRIBUTE_IMPURE_PTR__ -#define __ATTRIBUTE_IMPURE_PTR__ -#endif - -#if !defined(__DYNAMIC_REENT__) || defined(__SINGLE_THREAD__) -extern struct _reent *_impure_ptr __ATTRIBUTE_IMPURE_PTR__; -#endif - -extern struct _reent *_global_impure_ptr __ATTRIBUTE_IMPURE_PTR__; - -void _reclaim_reent _PARAMS ((struct _reent *)); - -/* #define _REENT_ONLY define this to get only reentrant routines */ - -#if defined(__DYNAMIC_REENT__) && !defined(__SINGLE_THREAD__) -#ifndef __getreent - struct _reent * _EXFUN(__getreent, (void)); -#endif -# define _REENT (__getreent()) -#else /* __SINGLE_THREAD__ || !__DYNAMIC_REENT__ */ -# define _REENT _impure_ptr -#endif /* __SINGLE_THREAD__ || !__DYNAMIC_REENT__ */ - -#define _GLOBAL_REENT _global_impure_ptr - -#ifdef _REENT_GLOBAL_ATEXIT -extern struct _atexit *_global_atexit; /* points to head of LIFO stack */ -# define _GLOBAL_ATEXIT _global_atexit -#else -# define _GLOBAL_ATEXIT (_GLOBAL_REENT->_atexit) -#endif - -#ifdef __cplusplus -} -#endif -#endif /* _SYS_REENT_H_ */ diff --git a/tools/sdk/include/newlib/sys/resource.h b/tools/sdk/include/newlib/sys/resource.h deleted file mode 100644 index c35ac2a465e..00000000000 --- a/tools/sdk/include/newlib/sys/resource.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _SYS_RESOURCE_H_ -#define _SYS_RESOURCE_H_ - -#include - -#define RUSAGE_SELF 0 /* calling process */ -#define RUSAGE_CHILDREN -1 /* terminated child processes */ - -struct rusage { - struct timeval ru_utime; /* user time used */ - struct timeval ru_stime; /* system time used */ -}; - -int _EXFUN(getrusage, (int, struct rusage*)); - -#endif - diff --git a/tools/sdk/include/newlib/sys/sched.h b/tools/sdk/include/newlib/sys/sched.h deleted file mode 100644 index 8554fc2b92e..00000000000 --- a/tools/sdk/include/newlib/sys/sched.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Written by Joel Sherrill . - * - * COPYRIGHT (c) 1989-2010. - * On-Line Applications Research Corporation (OAR). - * - * Permission to use, copy, modify, and distribute this software for any - * purpose without fee is hereby granted, provided that this entire notice - * is included in all copies of any software which is or includes a copy - * or modification of this software. - * - * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTY. IN PARTICULAR, THE AUTHOR MAKES NO REPRESENTATION - * OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS - * SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. - * - * $Id$ - */ - - -#ifndef _SYS_SCHED_H_ -#define _SYS_SCHED_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Scheduling Policies */ -/* Open Group Specifications Issue 6 */ -#if defined(__CYGWIN__) -#define SCHED_OTHER 3 -#else -#define SCHED_OTHER 0 -#endif - -#define SCHED_FIFO 1 -#define SCHED_RR 2 - -#if defined(_POSIX_SPORADIC_SERVER) -#define SCHED_SPORADIC 4 -#endif - -/* Scheduling Parameters */ -/* Open Group Specifications Issue 6 */ - -struct sched_param { - int sched_priority; /* Process execution scheduling priority */ - -#if defined(_POSIX_SPORADIC_SERVER) || defined(_POSIX_THREAD_SPORADIC_SERVER) - int sched_ss_low_priority; /* Low scheduling priority for sporadic */ - /* server */ - struct timespec sched_ss_repl_period; - /* Replenishment period for sporadic server */ - struct timespec sched_ss_init_budget; - /* Initial budget for sporadic server */ - int sched_ss_max_repl; /* Maximum pending replenishments for */ - /* sporadic server */ -#endif -}; - -int sched_yield( void ); - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ - diff --git a/tools/sdk/include/newlib/sys/select.h b/tools/sdk/include/newlib/sys/select.h deleted file mode 100644 index 199d48144d3..00000000000 --- a/tools/sdk/include/newlib/sys/select.h +++ /dev/null @@ -1,31 +0,0 @@ -// 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. - -#ifndef __ESP_SYS_SELECT_H__ -#define __ESP_SYS_SELECT_H__ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *timeout); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif //__ESP_SYS_SELECT_H__ diff --git a/tools/sdk/include/newlib/sys/signal.h b/tools/sdk/include/newlib/sys/signal.h deleted file mode 100644 index a29f525c1f6..00000000000 --- a/tools/sdk/include/newlib/sys/signal.h +++ /dev/null @@ -1,357 +0,0 @@ -/* sys/signal.h */ - -#ifndef _SYS_SIGNAL_H -#define _SYS_SIGNAL_H -#ifdef __cplusplus -extern "C" { -#endif - -#include "_ansi.h" -#include -#include - -/* #ifndef __STRICT_ANSI__*/ - -/* Cygwin defines it's own sigset_t in include/cygwin/signal.h */ -#ifndef __CYGWIN__ -typedef unsigned long sigset_t; -#endif - -#if defined(__rtems__) - -#if defined(_POSIX_REALTIME_SIGNALS) - -/* sigev_notify values - NOTE: P1003.1c/D10, p. 34 adds SIGEV_THREAD. */ - -#define SIGEV_NONE 1 /* No asynchronous notification shall be delivered */ - /* when the event of interest occurs. */ -#define SIGEV_SIGNAL 2 /* A queued signal, with an application defined */ - /* value, shall be delivered when the event of */ - /* interest occurs. */ -#define SIGEV_THREAD 3 /* A notification function shall be called to */ - /* perform notification. */ - -/* Signal Generation and Delivery, P1003.1b-1993, p. 63 - NOTE: P1003.1c/D10, p. 34 adds sigev_notify_function and - sigev_notify_attributes to the sigevent structure. */ - -union sigval { - int sival_int; /* Integer signal value */ - void *sival_ptr; /* Pointer signal value */ -}; - -struct sigevent { - int sigev_notify; /* Notification type */ - int sigev_signo; /* Signal number */ - union sigval sigev_value; /* Signal value */ - -#if defined(_POSIX_THREADS) - void (*sigev_notify_function)( union sigval ); - /* Notification function */ - pthread_attr_t *sigev_notify_attributes; /* Notification Attributes */ -#endif -}; - -/* Signal Actions, P1003.1b-1993, p. 64 */ -/* si_code values, p. 66 */ - -#define SI_USER 1 /* Sent by a user. kill(), abort(), etc */ -#define SI_QUEUE 2 /* Sent by sigqueue() */ -#define SI_TIMER 3 /* Sent by expiration of a timer_settime() timer */ -#define SI_ASYNCIO 4 /* Indicates completion of asycnhronous IO */ -#define SI_MESGQ 5 /* Indicates arrival of a message at an empty queue */ - -typedef struct { - int si_signo; /* Signal number */ - int si_code; /* Cause of the signal */ - union sigval si_value; /* Signal value */ -} siginfo_t; -#endif - -/* 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76 */ - -#define SA_NOCLDSTOP 0x1 /* Do not generate SIGCHLD when children stop */ -#define SA_SIGINFO 0x2 /* Invoke the signal catching function with */ - /* three arguments instead of one. */ -#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 -#define SA_ONSTACK 0x4 /* Signal delivery will be on a separate stack. */ -#endif - -/* struct sigaction notes from POSIX: - * - * (1) Routines stored in sa_handler should take a single int as - * their argument although the POSIX standard does not require this. - * This is not longer true since at least POSIX.1-2008 - * (2) The fields sa_handler and sa_sigaction may overlap, and a conforming - * application should not use both simultaneously. - */ - -typedef void (*_sig_func_ptr)(int); - -struct sigaction { - int sa_flags; /* Special flags to affect behavior of signal */ - sigset_t sa_mask; /* Additional set of signals to be blocked */ - /* during execution of signal-catching */ - /* function. */ - union { - _sig_func_ptr _handler; /* SIG_DFL, SIG_IGN, or pointer to a function */ -#if defined(_POSIX_REALTIME_SIGNALS) - void (*_sigaction)( int, siginfo_t *, void * ); -#endif - } _signal_handlers; -}; - -#define sa_handler _signal_handlers._handler -#if defined(_POSIX_REALTIME_SIGNALS) -#define sa_sigaction _signal_handlers._sigaction -#endif - -#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 -/* - * Minimum and default signal stack constants. Allow for target overrides - * from . - */ -#ifndef MINSIGSTKSZ -#define MINSIGSTKSZ 2048 -#endif -#ifndef SIGSTKSZ -#define SIGSTKSZ 8192 -#endif - -/* - * Possible values for ss_flags in stack_t below. - */ -#define SS_ONSTACK 0x1 -#define SS_DISABLE 0x2 - -/* - * Structure used in sigaltstack call. - */ -typedef struct sigaltstack { - void *ss_sp; /* Stack base or pointer. */ - int ss_flags; /* Flags. */ - size_t ss_size; /* Stack size. */ -} stack_t; -#endif - -#elif defined(__CYGWIN__) -#include -#else -#define SA_NOCLDSTOP 1 /* only value supported now for sa_flags */ - -typedef void (*_sig_func_ptr)(int); - -struct sigaction -{ - _sig_func_ptr sa_handler; - sigset_t sa_mask; - int sa_flags; -}; -#endif /* defined(__rtems__) */ - -#define SIG_SETMASK 0 /* set mask with sigprocmask() */ -#define SIG_BLOCK 1 /* set of signals to block */ -#define SIG_UNBLOCK 2 /* set of signals to, well, unblock */ - -/* These depend upon the type of sigset_t, which right now - is always a long.. They're in the POSIX namespace, but - are not ANSI. */ -#define sigaddset(what,sig) (*(what) |= (1<<(sig)), 0) -#define sigdelset(what,sig) (*(what) &= ~(1<<(sig)), 0) -#define sigemptyset(what) (*(what) = 0, 0) -#define sigfillset(what) (*(what) = ~(0), 0) -#define sigismember(what,sig) (((*(what)) & (1<<(sig))) != 0) - -int _EXFUN(sigprocmask, (int how, const sigset_t *set, sigset_t *oset)); - -#if defined(_POSIX_THREADS) -int _EXFUN(pthread_sigmask, (int how, const sigset_t *set, sigset_t *oset)); -#endif - -#if defined(__CYGWIN__) || defined(__rtems__) -#undef sigaddset -#undef sigdelset -#undef sigemptyset -#undef sigfillset -#undef sigismember - -#ifdef _COMPILING_NEWLIB -int _EXFUN(_kill, (pid_t, int)); -#endif /* _COMPILING_NEWLIB */ -#endif /* __CYGWIN__ || __rtems__ */ -#if defined(__CYGWIN__) || defined(__rtems__) || defined(__SPU__) -int _EXFUN(kill, (pid_t, int)); -#endif /* __CYGWIN__ || __rtems__ || __SPU__ */ -#if defined(__CYGWIN__) || defined(__rtems__) -int _EXFUN(killpg, (pid_t, int)); -int _EXFUN(sigaction, (int, const struct sigaction *, struct sigaction *)); -int _EXFUN(sigaddset, (sigset_t *, const int)); -int _EXFUN(sigdelset, (sigset_t *, const int)); -int _EXFUN(sigismember, (const sigset_t *, int)); -int _EXFUN(sigfillset, (sigset_t *)); -int _EXFUN(sigemptyset, (sigset_t *)); -int _EXFUN(sigpending, (sigset_t *)); -int _EXFUN(sigsuspend, (const sigset_t *)); -int _EXFUN(sigpause, (int)); - -#ifdef __rtems__ -#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 -int _EXFUN(sigaltstack, (const stack_t *__restrict, stack_t *__restrict)); -#endif -#endif - -#if defined(_POSIX_THREADS) -#ifdef __CYGWIN__ -# ifndef _CYGWIN_TYPES_H -# error You need the winsup sources or a cygwin installation to compile the cygwin version of newlib. -# endif -#endif -int _EXFUN(pthread_kill, (pthread_t thread, int sig)); -#endif - -#if defined(_POSIX_REALTIME_SIGNALS) - -/* 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76 - NOTE: P1003.1c/D10, p. 39 adds sigwait(). */ - -int _EXFUN(sigwaitinfo, (const sigset_t *set, siginfo_t *info)); -int _EXFUN(sigtimedwait, - (const sigset_t *set, siginfo_t *info, const struct timespec *timeout) -); -int _EXFUN(sigwait, (const sigset_t *set, int *sig)); - -/* 3.3.9 Queue a Signal to a Process, P1003.1b-1993, p. 78 */ -int _EXFUN(sigqueue, (pid_t pid, int signo, const union sigval value)); - -#endif /* defined(_POSIX_REALTIME_SIGNALS) */ - -#endif /* defined(__CYGWIN__) || defined(__rtems__) */ - -/* #endif __STRICT_ANSI__ */ - -#if defined(___AM29K__) -/* These all need to be defined for ANSI C, but I don't think they are - meaningful. */ -#define SIGABRT 1 -#define SIGFPE 1 -#define SIGILL 1 -#define SIGINT 1 -#define SIGSEGV 1 -#define SIGTERM 1 -/* These need to be defined for POSIX, and some others do too. */ -#define SIGHUP 1 -#define SIGQUIT 1 -#define NSIG 2 -#elif defined(__GO32__) -#define SIGINT 1 -#define SIGKILL 2 -#define SIGPIPE 3 -#define SIGFPE 4 -#define SIGHUP 5 -#define SIGTERM 6 -#define SIGSEGV 7 -#define SIGTSTP 8 -#define SIGQUIT 9 -#define SIGTRAP 10 -#define SIGILL 11 -#define SIGEMT 12 -#define SIGALRM 13 -#define SIGBUS 14 -#define SIGLOST 15 -#define SIGSTOP 16 -#define SIGABRT 17 -#define SIGUSR1 18 -#define SIGUSR2 19 -#define NSIG 20 -#elif !defined(SIGTRAP) -#define SIGHUP 1 /* hangup */ -#define SIGINT 2 /* interrupt */ -#define SIGQUIT 3 /* quit */ -#define SIGILL 4 /* illegal instruction (not reset when caught) */ -#define SIGTRAP 5 /* trace trap (not reset when caught) */ -#define SIGIOT 6 /* IOT instruction */ -#define SIGABRT 6 /* used by abort, replace SIGIOT in the future */ -#define SIGEMT 7 /* EMT instruction */ -#define SIGFPE 8 /* floating point exception */ -#define SIGKILL 9 /* kill (cannot be caught or ignored) */ -#define SIGBUS 10 /* bus error */ -#define SIGSEGV 11 /* segmentation violation */ -#define SIGSYS 12 /* bad argument to system call */ -#define SIGPIPE 13 /* write on a pipe with no one to read it */ -#define SIGALRM 14 /* alarm clock */ -#define SIGTERM 15 /* software termination signal from kill */ - -#if defined(__rtems__) -#define SIGURG 16 /* urgent condition on IO channel */ -#define SIGSTOP 17 /* sendable stop signal not from tty */ -#define SIGTSTP 18 /* stop signal from tty */ -#define SIGCONT 19 /* continue a stopped process */ -#define SIGCHLD 20 /* to parent on child stop or exit */ -#define SIGCLD 20 /* System V name for SIGCHLD */ -#define SIGTTIN 21 /* to readers pgrp upon background tty read */ -#define SIGTTOU 22 /* like TTIN for output if (tp->t_local<OSTOP) */ -#define SIGIO 23 /* input/output possible signal */ -#define SIGPOLL SIGIO /* System V name for SIGIO */ -#define SIGWINCH 24 /* window changed */ -#define SIGUSR1 25 /* user defined signal 1 */ -#define SIGUSR2 26 /* user defined signal 2 */ - -/* Real-Time Signals Range, P1003.1b-1993, p. 61 - NOTE: By P1003.1b-1993, this should be at least RTSIG_MAX - (which is a minimum of 8) signals. - */ -#define SIGRTMIN 27 -#define SIGRTMAX 31 -#define __SIGFIRSTNOTRT SIGHUP -#define __SIGLASTNOTRT SIGUSR2 - -#define NSIG 32 /* signal 0 implied */ - -#elif defined(__svr4__) -/* svr4 specifics. different signals above 15, and sigaction. */ -#define SIGUSR1 16 -#define SIGUSR2 17 -#define SIGCLD 18 -#define SIGPWR 19 -#define SIGWINCH 20 -#define SIGPOLL 22 /* 20 for x.out binaries!!!! */ -#define SIGSTOP 23 /* sendable stop signal not from tty */ -#define SIGTSTP 24 /* stop signal from tty */ -#define SIGCONT 25 /* continue a stopped process */ -#define SIGTTIN 26 /* to readers pgrp upon background tty read */ -#define SIGTTOU 27 /* like TTIN for output if (tp->t_local<OSTOP) */ -#define NSIG 28 -#else -#define SIGURG 16 /* urgent condition on IO channel */ -#define SIGSTOP 17 /* sendable stop signal not from tty */ -#define SIGTSTP 18 /* stop signal from tty */ -#define SIGCONT 19 /* continue a stopped process */ -#define SIGCHLD 20 /* to parent on child stop or exit */ -#define SIGCLD 20 /* System V name for SIGCHLD */ -#define SIGTTIN 21 /* to readers pgrp upon background tty read */ -#define SIGTTOU 22 /* like TTIN for output if (tp->t_local<OSTOP) */ -#define SIGIO 23 /* input/output possible signal */ -#define SIGPOLL SIGIO /* System V name for SIGIO */ -#define SIGXCPU 24 /* exceeded CPU time limit */ -#define SIGXFSZ 25 /* exceeded file size limit */ -#define SIGVTALRM 26 /* virtual time alarm */ -#define SIGPROF 27 /* profiling time alarm */ -#define SIGWINCH 28 /* window changed */ -#define SIGLOST 29 /* resource lost (eg, record-lock lost) */ -#define SIGUSR1 30 /* user defined signal 1 */ -#define SIGUSR2 31 /* user defined signal 2 */ -#define NSIG 32 /* signal 0 implied */ -#endif -#endif - -#ifdef __cplusplus -} -#endif - -#ifndef _SIGNAL_H_ -/* Some applications take advantage of the fact that - * and are equivalent in glibc. Allow for that here. */ -#include -#endif -#endif /* _SYS_SIGNAL_H */ diff --git a/tools/sdk/include/newlib/sys/stat.h b/tools/sdk/include/newlib/sys/stat.h deleted file mode 100644 index 11b9d8080f4..00000000000 --- a/tools/sdk/include/newlib/sys/stat.h +++ /dev/null @@ -1,192 +0,0 @@ -#ifndef _SYS_STAT_H -#define _SYS_STAT_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include <_ansi.h> -#include -#include -#include - -/* dj's stat defines _STAT_H_ */ -#ifndef _STAT_H_ - -/* It is intended that the layout of this structure not change when the - sizes of any of the basic types change (short, int, long) [via a compile - time option]. */ - -#ifdef __CYGWIN__ -#include -#ifdef _COMPILING_NEWLIB -#define stat64 stat -#endif -#else -struct stat -{ - dev_t st_dev; - ino_t st_ino; - mode_t st_mode; - nlink_t st_nlink; - uid_t st_uid; - gid_t st_gid; - dev_t st_rdev; - off_t st_size; -#if defined(__rtems__) - struct timespec st_atim; - struct timespec st_mtim; - struct timespec st_ctim; - blksize_t st_blksize; - blkcnt_t st_blocks; -#else - /* SysV/sco doesn't have the rest... But Solaris, eabi does. */ -#if defined(__svr4__) && !defined(__PPC__) && !defined(__sun__) - time_t st_atime; - time_t st_mtime; - time_t st_ctime; -#else - time_t st_atime; - long st_spare1; - time_t st_mtime; - long st_spare2; - time_t st_ctime; - long st_spare3; - long st_blksize; - long st_blocks; - long st_spare4[2]; -#endif -#endif -}; - -#if defined(__rtems__) -#define st_atime st_atim.tv_sec -#define st_ctime st_ctim.tv_sec -#define st_mtime st_mtim.tv_sec -#endif - -#endif - -#define _IFMT 0170000 /* type of file */ -#define _IFDIR 0040000 /* directory */ -#define _IFCHR 0020000 /* character special */ -#define _IFBLK 0060000 /* block special */ -#define _IFREG 0100000 /* regular */ -#define _IFLNK 0120000 /* symbolic link */ -#define _IFSOCK 0140000 /* socket */ -#define _IFIFO 0010000 /* fifo */ - -#define S_BLKSIZE 1024 /* size of a block */ - -#define S_ISUID 0004000 /* set user id on execution */ -#define S_ISGID 0002000 /* set group id on execution */ -#define S_ISVTX 0001000 /* save swapped text even after use */ -#ifndef _POSIX_SOURCE -#define S_IREAD 0000400 /* read permission, owner */ -#define S_IWRITE 0000200 /* write permission, owner */ -#define S_IEXEC 0000100 /* execute/search permission, owner */ -#define S_ENFMT 0002000 /* enforcement-mode locking */ -#endif /* !_POSIX_SOURCE */ - -#define S_IFMT _IFMT -#define S_IFDIR _IFDIR -#define S_IFCHR _IFCHR -#define S_IFBLK _IFBLK -#define S_IFREG _IFREG -#define S_IFLNK _IFLNK -#define S_IFSOCK _IFSOCK -#define S_IFIFO _IFIFO - -#ifdef _WIN32 -/* The Windows header files define _S_ forms of these, so we do too - for easier portability. */ -#define _S_IFMT _IFMT -#define _S_IFDIR _IFDIR -#define _S_IFCHR _IFCHR -#define _S_IFIFO _IFIFO -#define _S_IFREG _IFREG -#define _S_IREAD 0000400 -#define _S_IWRITE 0000200 -#define _S_IEXEC 0000100 -#endif - -#define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) -#define S_IRUSR 0000400 /* read permission, owner */ -#define S_IWUSR 0000200 /* write permission, owner */ -#define S_IXUSR 0000100/* execute/search permission, owner */ -#define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP) -#define S_IRGRP 0000040 /* read permission, group */ -#define S_IWGRP 0000020 /* write permission, grougroup */ -#define S_IXGRP 0000010/* execute/search permission, group */ -#define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) -#define S_IROTH 0000004 /* read permission, other */ -#define S_IWOTH 0000002 /* write permission, other */ -#define S_IXOTH 0000001/* execute/search permission, other */ - -#ifndef _POSIX_SOURCE -#define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO) /* 0777 */ -#define ALLPERMS (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO) /* 07777 */ -#define DEFFILEMODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) /* 0666 */ -#endif - -#define S_ISBLK(m) (((m)&_IFMT) == _IFBLK) -#define S_ISCHR(m) (((m)&_IFMT) == _IFCHR) -#define S_ISDIR(m) (((m)&_IFMT) == _IFDIR) -#define S_ISFIFO(m) (((m)&_IFMT) == _IFIFO) -#define S_ISREG(m) (((m)&_IFMT) == _IFREG) -#define S_ISLNK(m) (((m)&_IFMT) == _IFLNK) -#define S_ISSOCK(m) (((m)&_IFMT) == _IFSOCK) - -#if defined(__CYGWIN__) -/* Special tv_nsec values for futimens(2) and utimensat(2). */ -#define UTIME_NOW -2L -#define UTIME_OMIT -1L -#endif - -int _EXFUN(chmod,( const char *__path, mode_t __mode )); -int _EXFUN(fchmod,(int __fd, mode_t __mode)); -int _EXFUN(fstat,( int __fd, struct stat *__sbuf )); -int _EXFUN(mkdir,( const char *_path, mode_t __mode )); -int _EXFUN(mkfifo,( const char *__path, mode_t __mode )); -int _EXFUN(stat,( const char *__restrict __path, struct stat *__restrict __sbuf )); -mode_t _EXFUN(umask,( mode_t __mask )); - -#if defined (__SPU__) || defined(__rtems__) || defined(__CYGWIN__) && !defined(__INSIDE_CYGWIN__) -int _EXFUN(lstat,( const char *__restrict __path, struct stat *__restrict __buf )); -int _EXFUN(mknod,( const char *__path, mode_t __mode, dev_t __dev )); -#endif - -#if (__POSIX_VISIBLE >= 200809 || defined (__CYGWIN__)) && !defined(__INSIDE_CYGWIN__) -int _EXFUN(fchmodat, (int, const char *, mode_t, int)); -#endif -#if (__BSD_VISIBLE || __POSIX_VISIBLE >= 200809 || defined (__CYGWIN__)) && !defined(__INSIDE_CYGWIN__) -int _EXFUN(fstatat, (int, const char *__restrict , struct stat *__restrict, int)); -int _EXFUN(mkdirat, (int, const char *, mode_t)); -int _EXFUN(mkfifoat, (int, const char *, mode_t)); -#endif -#if (__BSD_VISIBLE || __XSI_VISIBLE >= 700 || defined (__CYGWIN__)) && !defined(__INSIDE_CYGWIN__) -int _EXFUN(mknodat, (int, const char *, mode_t, dev_t)); -#endif -#if (__BSD_VISIBLE || __POSIX_VISIBLE >= 200809 || defined (__CYGWIN__)) && !defined(__INSIDE_CYGWIN__) -int _EXFUN(utimensat, (int, const char *, const struct timespec *, int)); -int _EXFUN(futimens, (int, const struct timespec *)); -#endif - -/* Provide prototypes for most of the _ names that are - provided in newlib for some compilers. */ -#ifdef _COMPILING_NEWLIB -int _EXFUN(_fstat,( int __fd, struct stat *__sbuf )); -int _EXFUN(_stat,( const char *__restrict __path, struct stat *__restrict __sbuf )); -int _EXFUN(_mkdir,( const char *_path, mode_t __mode )); -#ifdef __LARGE64_FILES -struct stat64; -int _EXFUN(_stat64,( const char *__restrict __path, struct stat64 *__restrict __sbuf )); -int _EXFUN(_fstat64,( int __fd, struct stat64 *__sbuf )); -#endif -#endif - -#endif /* !_STAT_H_ */ -#ifdef __cplusplus -} -#endif -#endif /* _SYS_STAT_H */ diff --git a/tools/sdk/include/newlib/sys/stdio.h b/tools/sdk/include/newlib/sys/stdio.h deleted file mode 100644 index 0918fe157de..00000000000 --- a/tools/sdk/include/newlib/sys/stdio.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef _NEWLIB_STDIO_H -#define _NEWLIB_STDIO_H - -#include -#include - -/* Internal locking macros, used to protect stdio functions. In the - general case, expand to nothing. Use __SSTR flag in FILE _flags to - detect if FILE is private to sprintf/sscanf class of functions; if - set then do nothing as lock is not initialised. */ -#if !defined(_flockfile) -#ifndef __SINGLE_THREAD__ -# define _flockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_acquire_recursive((fp)->_lock)) -#else -# define _flockfile(fp) (_CAST_VOID 0) -#endif -#endif - -#if !defined(_funlockfile) -#ifndef __SINGLE_THREAD__ -# define _funlockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_release_recursive((fp)->_lock)) -#else -# define _funlockfile(fp) (_CAST_VOID 0) -#endif -#endif - -#endif /* _NEWLIB_STDIO_H */ diff --git a/tools/sdk/include/newlib/sys/string.h b/tools/sdk/include/newlib/sys/string.h deleted file mode 100644 index ceedf4be10c..00000000000 --- a/tools/sdk/include/newlib/sys/string.h +++ /dev/null @@ -1,2 +0,0 @@ -/* This is a dummy used as a placeholder for - systems that need to have a special header file. */ diff --git a/tools/sdk/include/newlib/sys/syslimits.h b/tools/sdk/include/newlib/sys/syslimits.h deleted file mode 100644 index c0bb3a2ce09..00000000000 --- a/tools/sdk/include/newlib/sys/syslimits.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 1988, 1993 - * The Regents of the University of California. All rights reserved. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. - * - * @(#)syslimits.h 8.1 (Berkeley) 6/2/93 - * $FreeBSD: src/sys/sys/syslimits.h,v 1.10 2001/06/18 20:24:54 wollman Exp $ - */ - -#ifndef _SYS_SYSLIMITS_H_ -#define _SYS_SYSLIMITS_H_ - -#define ARG_MAX 4096 /* max bytes for an exec function */ -#ifndef CHILD_MAX -#define CHILD_MAX 40 /* max simultaneous processes */ -#endif -#define LINK_MAX 32767 /* max file link count */ -#define MAX_CANON 255 /* max bytes in term canon input line */ -#define MAX_INPUT 255 /* max bytes in terminal input */ -#define NAME_MAX 255 /* max bytes in a file name */ -#define NGROUPS_MAX 16 /* max supplemental group id's */ -#ifndef OPEN_MAX -#define OPEN_MAX 64 /* max open files per process */ -#endif -#define PATH_MAX 1024 /* max bytes in pathname */ -#define PIPE_BUF 512 /* max bytes for atomic pipe writes */ -#define IOV_MAX 1024 /* max elements in i/o vector */ - -#define BC_BASE_MAX 99 /* max ibase/obase values in bc(1) */ -#define BC_DIM_MAX 2048 /* max array elements in bc(1) */ -#define BC_SCALE_MAX 99 /* max scale value in bc(1) */ -#define BC_STRING_MAX 1000 /* max const string length in bc(1) */ -#define COLL_WEIGHTS_MAX 0 /* max weights for order keyword */ -#define EXPR_NEST_MAX 32 /* max expressions nested in expr(1) */ -#define LINE_MAX 2048 /* max bytes in an input line */ -#define RE_DUP_MAX 255 /* max RE's in interval notation */ - -#endif diff --git a/tools/sdk/include/newlib/sys/termios.h b/tools/sdk/include/newlib/sys/termios.h deleted file mode 100644 index fd0eb5ca884..00000000000 --- a/tools/sdk/include/newlib/sys/termios.h +++ /dev/null @@ -1,296 +0,0 @@ -// 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. -// -// This header file is based on the termios header of -// "The Single UNIX (r) Specification, Version 2, Copyright (c) 1997 The Open Group". - -#ifndef __ESP_SYS_TERMIOS_H__ -#define __ESP_SYS_TERMIOS_H__ - -// ESP-IDF NOTE: This header provides only a compatibility layer for macros and functions defined in sys/termios.h. -// Not everything has a defined meaning for ESP-IDF (e.g. process leader IDs) and therefore are likely to be stubbed -// in actual implementations. - - -#include -#include -#include "sdkconfig.h" - -#ifdef CONFIG_SUPPORT_TERMIOS - -// subscripts for the array c_cc: -#define VEOF 0 /** EOF character */ -#define VEOL 1 /** EOL character */ -#define VERASE 2 /** ERASE character */ -#define VINTR 3 /** INTR character */ -#define VKILL 4 /** KILL character */ -#define VMIN 5 /** MIN value */ -#define VQUIT 6 /** QUIT character */ -#define VSTART 7 /** START character */ -#define VSTOP 8 /** STOP character */ -#define VSUSP 9 /** SUSP character */ -#define VTIME 10 /** TIME value */ -#define NCCS (VTIME + 1) /** Size of the array c_cc for control characters */ - -// input modes for use as flags in the c_iflag field -#define BRKINT (1u << 0) /** Signal interrupt on break. */ -#define ICRNL (1u << 1) /** Map CR to NL on input. */ -#define IGNBRK (1u << 2) /** Ignore break condition. */ -#define IGNCR (1u << 3) /** Ignore CR. */ -#define IGNPAR (1u << 4) /** Ignore characters with parity errors. */ -#define INLCR (1u << 5) /** Map NL to CR on input. */ -#define INPCK (1u << 6) /** Enable input parity check. */ -#define ISTRIP (1u << 7) /** Strip character. */ -#define IUCLC (1u << 8) /** Map upper-case to lower-case on input (LEGACY). */ -#define IXANY (1u << 9) /** Enable any character to restart output. */ -#define IXOFF (1u << 10) /** Enable start/stop input control. */ -#define IXON (1u << 11) /** Enable start/stop output control. */ -#define PARMRK (1u << 12) /** Mark parity errors. */ - -// output Modes for use as flags in the c_oflag field -#define OPOST (1u << 0) /** Post-process output */ -#define OLCUC (1u << 1) /** Map lower-case to upper-case on output (LEGACY). */ -#define ONLCR (1u << 2) /** Map NL to CR-NL on output. */ -#define OCRNL (1u << 3) /** Map CR to NL on output. */ -#define ONOCR (1u << 4) /** No CR output at column 0. */ -#define ONLRET (1u << 5) /** NL performs CR function. */ -#define OFILL (1u << 6) /** Use fill characters for delay. */ -#define NLDLY (1u << 7) /** Select newline delays: */ -#define NL0 (0u << 7) /** Newline character type 0. */ -#define NL1 (1u << 7) /** Newline character type 1. */ -#define CRDLY (3u << 8) /** Select carriage-return delays: */ -#define CR0 (0u << 8) /** Carriage-return delay type 0. */ -#define CR1 (1u << 8) /** Carriage-return delay type 1. */ -#define CR2 (2u << 8) /** Carriage-return delay type 2. */ -#define CR3 (3u << 8) /** Carriage-return delay type 3. */ -#define TABDLY (3u << 10) /** Select horizontal-tab delays: */ -#define TAB0 (0u << 10) /** Horizontal-tab delay type 0. */ -#define TAB1 (1u << 10) /** Horizontal-tab delay type 1. */ -#define TAB2 (2u << 10) /** Horizontal-tab delay type 2. */ -#define TAB3 (3u << 10) /** Expand tabs to spaces. */ -#define BSDLY (1u << 12) /** Select backspace delays: */ -#define BS0 (0u << 12) /** Backspace-delay type 0. */ -#define BS1 (1u << 12) /** Backspace-delay type 1. */ -#define VTDLY (1u << 13) /** Select vertical-tab delays: */ -#define VT0 (0u << 13) /** Vertical-tab delay type 0. */ -#define VT1 (1u << 13) /** Vertical-tab delay type 1. */ -#define FFDLY (1u << 14) /** Select form-feed delays: */ -#define FF0 (0u << 14) /** Form-feed delay type 0. */ -#define FF1 (1u << 14) /** Form-feed delay type 1. */ - -// Baud Rate Selection. Valid values for objects of type speed_t: -// CBAUD range B0 - B38400 -#define B0 0 /** Hang up */ -#define B50 1 -#define B75 2 -#define B110 3 -#define B134 4 -#define B150 5 -#define B200 6 -#define B300 7 -#define B600 8 -#define B1200 9 -#define B1800 10 -#define B2400 11 -#define B4800 12 -#define B9600 13 -#define B19200 14 -#define B38400 15 -// CBAUDEX range B57600 - B4000000 -#define B57600 16 -#define B115200 17 -#define B230400 18 -#define B460800 19 -#define B500000 20 -#define B576000 21 -#define B921600 22 -#define B1000000 23 -#define B1152000 24 -#define B1500000 25 -#define B2000000 26 -#define B2500000 27 -#define B3000000 28 -#define B3500000 29 -#define B4000000 30 - -// Control Modes for the c_cflag field: -#define CSIZE (3u << 0) /* Character size: */ -#define CS5 (0u << 0) /** 5 bits. */ -#define CS6 (1u << 0) /** 6 bits. */ -#define CS7 (2u << 0) /** 7 bits. */ -#define CS8 (3u << 0) /** 8 bits. */ -#define CSTOPB (1u << 2) /** Send two stop bits, else one. */ -#define CREAD (1u << 3) /** Enable receiver. */ -#define PARENB (1u << 4) /** Parity enable. */ -#define PARODD (1u << 5) /** Odd parity, else even. */ -#define HUPCL (1u << 6) /** Hang up on last close. */ -#define CLOCAL (1u << 7) /** Ignore modem status lines. */ -#define CBAUD (1u << 8) /** Use baud rates defined by B0-B38400 macros. */ -#define CBAUDEX (1u << 9) /** Use baud rates defined by B57600-B4000000 macros. */ -#define BOTHER (1u << 10) /** Use custom baud rates */ - -// Local Modes for c_lflag field: -#define ECHO (1u << 0) /** Enable echo. */ -#define ECHOE (1u << 1) /** Echo erase character as error-correcting backspace. */ -#define ECHOK (1u << 2) /** Echo KILL. */ -#define ECHONL (1u << 3) /** Echo NL. */ -#define ICANON (1u << 4) /** Canonical input (erase and kill processing). */ -#define IEXTEN (1u << 5) /** Enable extended input character processing. */ -#define ISIG (1u << 6) /** Enable signals. */ -#define NOFLSH (1u << 7) /** Disable flush after interrupt or quit. */ -#define TOSTOP (1u << 8) /** Send SIGTTOU for background output. */ -#define XCASE (1u << 9) /** Canonical upper/lower presentation (LEGACY). */ - -// Attribute Selection constants for use with tcsetattr(): -#define TCSANOW 0 /** Change attributes immediately. */ -#define TCSADRAIN 1 /** Change attributes when output has drained. */ -#define TCSAFLUSH 2 /** Change attributes when output has drained; also flush pending input. */ - -// Line Control constants for use with tcflush(): -#define TCIFLUSH 0 /** Flush pending input. Flush untransmitted output. */ -#define TCIOFLUSH 1 /** Flush both pending input and untransmitted output. */ -#define TCOFLUSH 2 /** Flush untransmitted output. */ - -// constants for use with tcflow(): -#define TCIOFF 0 /** Transmit a STOP character, intended to suspend input data. */ -#define TCION 1 /** Transmit a START character, intended to restart input data. */ -#define TCOOFF 2 /** Suspend output. */ -#define TCOON 3 /** Restart output. */ - -typedef uint8_t cc_t; -typedef uint32_t speed_t; -typedef uint16_t tcflag_t; - -struct termios -{ - tcflag_t c_iflag; /** Input modes */ - tcflag_t c_oflag; /** Output modes */ - tcflag_t c_cflag; /** Control modes */ - tcflag_t c_lflag; /** Local modes */ - cc_t c_cc[NCCS]; /** Control characters */ - speed_t c_ispeed; /** input baud rate */ - speed_t c_ospeed; /** output baud rate */ -}; - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Extracts the input baud rate from the input structure exactly (without interpretation). - * - * @param p input termios structure - * @return input baud rate - */ -speed_t cfgetispeed(const struct termios *p); - -/** - * @brief Extracts the output baud rate from the input structure exactly (without interpretation). - * - * @param p input termios structure - * @return output baud rate - */ -speed_t cfgetospeed(const struct termios *p); - -/** - * @brief Set input baud rate in the termios structure - * - * There is no effect in hardware until a subsequent call of tcsetattr(). - * - * @param p input termios structure - * @param sp input baud rate - * @return 0 when successful, -1 otherwise with errno set - */ -int cfsetispeed(struct termios *p, speed_t sp); - -/** - * @brief Set output baud rate in the termios structure - * - * There is no effect in hardware until a subsequent call of tcsetattr(). - * - * @param p input termios structure - * @param sp output baud rate - * @return 0 when successful, -1 otherwise with errno set - */ -int cfsetospeed(struct termios *p, speed_t sp); - -/** - * @brief Wait for transmission of output - * - * @param fd file descriptor of the terminal - * @return 0 when successful, -1 otherwise with errno set - */ -int tcdrain(int fd); - -/** - * @brief Suspend or restart the transmission or reception of data - * - * @param fd file descriptor of the terminal - * @param action selects actions to do - * @return 0 when successful, -1 otherwise with errno set - */ -int tcflow(int fd, int action); - -/** - * @brief Flush non-transmitted output data and non-read input data - * - * @param fd file descriptor of the terminal - * @param select selects what should be flushed - * @return 0 when successful, -1 otherwise with errno set - */ -int tcflush(int fd, int select); - -/** - * @brief Gets the parameters of the terminal - * - * @param fd file descriptor of the terminal - * @param p output termios structure - * @return 0 when successful, -1 otherwise with errno set - */ -int tcgetattr(int fd, struct termios *p); - -/** - * @brief Get process group ID for session leader for controlling terminal - * - * @param fd file descriptor of the terminal - * @return process group ID when successful, -1 otherwise with errno set - */ -pid_t tcgetsid(int fd); - -/** - * @brief Send a break for a specific duration - * - * @param fd file descriptor of the terminal - * @param duration duration of break - * @return 0 when successful, -1 otherwise with errno set - */ -int tcsendbreak(int fd, int duration); - -/** - * @brief Sets the parameters of the terminal - * - * @param fd file descriptor of the terminal - * @param optional_actions optional actions - * @param p input termios structure - * @return 0 when successful, -1 otherwise with errno set - */ -int tcsetattr(int fd, int optional_actions, const struct termios *p); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // CONFIG_SUPPORT_TERMIOS - -#endif //__ESP_SYS_TERMIOS_H__ diff --git a/tools/sdk/include/newlib/sys/time.h b/tools/sdk/include/newlib/sys/time.h deleted file mode 100644 index 8e3ef80881b..00000000000 --- a/tools/sdk/include/newlib/sys/time.h +++ /dev/null @@ -1,91 +0,0 @@ -/* time.h -- An implementation of the standard Unix file. - Written by Geoffrey Noer - Public domain; no rights reserved. */ - -#ifndef _SYS_TIME_H_ -#define _SYS_TIME_H_ - -#include <_ansi.h> -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _TIMEVAL_DEFINED -#define _TIMEVAL_DEFINED -struct timeval { - time_t tv_sec; - suseconds_t tv_usec; -}; - -/* BSD time macros used by RTEMS code */ -#if defined (__rtems__) || defined (__CYGWIN__) || defined(__XTENSA__) - -/* Convenience macros for operations on timevals. - NOTE: `timercmp' does not work for >= or <=. */ -#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) -#define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) -#define timercmp(a, b, CMP) \ - (((a)->tv_sec == (b)->tv_sec) ? \ - ((a)->tv_usec CMP (b)->tv_usec) : \ - ((a)->tv_sec CMP (b)->tv_sec)) -#define timeradd(a, b, result) \ - do { \ - (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \ - (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \ - if ((result)->tv_usec >= 1000000) \ - { \ - ++(result)->tv_sec; \ - (result)->tv_usec -= 1000000; \ - } \ - } while (0) -#define timersub(a, b, result) \ - do { \ - (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ - (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ - if ((result)->tv_usec < 0) { \ - --(result)->tv_sec; \ - (result)->tv_usec += 1000000; \ - } \ - } while (0) -#endif /* defined (__rtems__) || defined (__CYGWIN__) */ -#endif /* !_TIMEVAL_DEFINED */ - -struct timezone { - int tz_minuteswest; - int tz_dsttime; -}; - -#ifdef __CYGWIN__ -#include -#endif /* __CYGWIN__ */ - -#define ITIMER_REAL 0 -#define ITIMER_VIRTUAL 1 -#define ITIMER_PROF 2 - -struct itimerval { - struct timeval it_interval; - struct timeval it_value; -}; - -#ifdef _COMPILING_NEWLIB -int _EXFUN(_gettimeofday, (struct timeval *__p, void *__tz)); -#endif - -int _EXFUN(gettimeofday, (struct timeval *__restrict __p, - void *__restrict __tz)); -#if __BSD_VISIBLE -int _EXFUN(settimeofday, (const struct timeval *, const struct timezone *)); -int _EXFUN(adjtime, (const struct timeval *, struct timeval *)); -#endif -int _EXFUN(utimes, (const char *__path, const struct timeval *__tvp)); -int _EXFUN(getitimer, (int __which, struct itimerval *__value)); -int _EXFUN(setitimer, (int __which, const struct itimerval *__restrict __value, - struct itimerval *__restrict __ovalue)); - -#ifdef __cplusplus -} -#endif -#endif /* _SYS_TIME_H_ */ diff --git a/tools/sdk/include/newlib/sys/timeb.h b/tools/sdk/include/newlib/sys/timeb.h deleted file mode 100644 index 0a2c3de8bdd..00000000000 --- a/tools/sdk/include/newlib/sys/timeb.h +++ /dev/null @@ -1,39 +0,0 @@ -/* timeb.h -- An implementation of the standard Unix file. - Written by Ian Lance Taylor - Public domain; no rights reserved. - - declares the structure used by the ftime function, as - well as the ftime function itself. Newlib does not provide an - implementation of ftime. */ - -#ifndef _SYS_TIMEB_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define _SYS_TIMEB_H - -#include <_ansi.h> -#include - -#ifndef __time_t_defined -typedef _TIME_T_ time_t; -#define __time_t_defined -#endif - -struct timeb -{ - time_t time; - unsigned short millitm; - short timezone; - short dstflag; -}; - -extern int ftime _PARAMS ((struct timeb *)); - -#ifdef __cplusplus -} -#endif - -#endif /* ! defined (_SYS_TIMEB_H) */ diff --git a/tools/sdk/include/newlib/sys/times.h b/tools/sdk/include/newlib/sys/times.h deleted file mode 100644 index 927812cb858..00000000000 --- a/tools/sdk/include/newlib/sys/times.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef _SYS_TIMES_H -#ifdef __cplusplus -extern "C" { -#endif -#define _SYS_TIMES_H - -#include <_ansi.h> -#include - -#ifndef __clock_t_defined -typedef _CLOCK_T_ clock_t; -#define __clock_t_defined -#endif - -/* Get Process Times, P1003.1b-1993, p. 92 */ -struct tms { - clock_t tms_utime; /* user time */ - clock_t tms_stime; /* system time */ - clock_t tms_cutime; /* user time, children */ - clock_t tms_cstime; /* system time, children */ -}; - -clock_t _EXFUN(times,(struct tms *)); -#ifdef _COMPILING_NEWLIB -clock_t _EXFUN(_times,(struct tms *)); -#endif - -#ifdef __cplusplus -} -#endif -#endif /* !_SYS_TIMES_H */ diff --git a/tools/sdk/include/newlib/sys/types.h b/tools/sdk/include/newlib/sys/types.h deleted file mode 100644 index ed33e0a617e..00000000000 --- a/tools/sdk/include/newlib/sys/types.h +++ /dev/null @@ -1,521 +0,0 @@ -/* unified sys/types.h: - start with sef's sysvi386 version. - merge go32 version -- a few ifdefs. - h8300hms, h8300xray, and sysvnecv70 disagree on the following types: - - typedef int gid_t; - typedef int uid_t; - typedef int dev_t; - typedef int ino_t; - typedef int mode_t; - typedef int caddr_t; - - however, these aren't "reasonable" values, the sysvi386 ones make far - more sense, and should work sufficiently well (in particular, h8300 - doesn't have a stat, and the necv70 doesn't matter.) -- eichin - */ - -#ifndef _SYS_TYPES_H - -#include <_ansi.h> - -#ifndef __INTTYPES_DEFINED__ -#define __INTTYPES_DEFINED__ - -#include - -#if defined(__rtems__) || defined(__XMK__) -/* - * The following section is RTEMS specific and is needed to more - * closely match the types defined in the BSD sys/types.h. - * This is needed to let the RTEMS/BSD TCP/IP stack compile. - */ - -/* deprecated */ -#if ___int8_t_defined -typedef __uint8_t u_int8_t; -#endif -#if ___int16_t_defined -typedef __uint16_t u_int16_t; -#endif -#if ___int32_t_defined -typedef __uint32_t u_int32_t; -#endif - -#if ___int64_t_defined -typedef __uint64_t u_int64_t; - -/* deprecated */ -typedef __uint64_t u_quad_t; -typedef __int64_t quad_t; -typedef quad_t * qaddr_t; -#endif - -#endif - -#endif /* ! __INTTYPES_DEFINED */ - -#ifndef __need_inttypes - -#define _SYS_TYPES_H -#include - -#ifdef __i386__ -#if defined (GO32) || defined (__MSDOS__) -#define __MS_types__ -#endif -#endif - -# include -# include - -/* To ensure the stat struct's layout doesn't change when sizeof(int), etc. - changes, we assume sizeof short and long never change and have all types - used to define struct stat use them and not int where possible. - Where not possible, _ST_INTxx are used. It would be preferable to not have - such assumptions, but until the extra fluff is necessary, it's avoided. - No 64 bit targets use stat yet. What to do about them is postponed - until necessary. */ -#ifdef __GNUC__ -#define _ST_INT32 __attribute__ ((__mode__ (__SI__))) -#else -#define _ST_INT32 -#endif - -# ifndef _POSIX_SOURCE - -# define physadr physadr_t -# define quad quad_t - -#ifndef _BSDTYPES_DEFINED -/* also defined in mingw/gmon.h and in w32api/winsock[2].h */ -#ifndef __u_char_defined -typedef unsigned char u_char; -#define __u_char_defined -#endif -#ifndef __u_short_defined -typedef unsigned short u_short; -#define __u_short_defined -#endif -#ifndef __u_int_defined -typedef unsigned int u_int; -#define __u_int_defined -#endif -#ifndef __u_long_defined -typedef unsigned long u_long; -#define __u_long_defined -#endif -#define _BSDTYPES_DEFINED -#endif - -typedef unsigned short ushort; /* System V compatibility */ -typedef unsigned int uint; /* System V compatibility */ -typedef unsigned long ulong; /* System V compatibility */ -# endif /*!_POSIX_SOURCE */ - -#ifndef __clock_t_defined -typedef _CLOCK_T_ clock_t; -#define __clock_t_defined -#endif - -#ifndef __time_t_defined -typedef _TIME_T_ time_t; -#define __time_t_defined -#endif - -#ifndef __timespec_defined -#define __timespec_defined -/* Time Value Specification Structures, P1003.1b-1993, p. 261 */ - -struct timespec { - time_t tv_sec; /* Seconds */ - long tv_nsec; /* Nanoseconds */ -}; -#endif - -struct itimerspec { - struct timespec it_interval; /* Timer period */ - struct timespec it_value; /* Timer expiration */ -}; - -#ifndef __daddr_t_defined -typedef long daddr_t; -#define __daddr_t_defined -#endif -#ifndef __caddr_t_defined -typedef char * caddr_t; -#define __caddr_t_defined -#endif - -#ifndef __CYGWIN__ -#if defined(__MS_types__) || defined(__rtems__) || \ - defined(__sparc__) || defined(__SPU__) -typedef unsigned long ino_t; -#else -typedef unsigned short ino_t; -#endif -#endif /*__CYGWIN__*/ - -#ifdef __MS_types__ -typedef unsigned long vm_offset_t; -typedef unsigned long vm_size_t; - -#define __BIT_TYPES_DEFINED__ - -typedef signed char int8_t; -typedef unsigned char u_int8_t; -typedef short int16_t; -typedef unsigned short u_int16_t; -typedef int int32_t; -typedef unsigned int u_int32_t; -typedef long long int64_t; -typedef unsigned long long u_int64_t; -typedef int32_t register_t; -#endif /* __MS_types__ */ - -/* - * All these should be machine specific - right now they are all broken. - * However, for all of Cygnus' embedded targets, we want them to all be - * the same. Otherwise things like sizeof (struct stat) might depend on - * how the file was compiled (e.g. -mint16 vs -mint32, etc.). - */ - -#ifndef __CYGWIN__ /* which defines these types in it's own types.h. */ -typedef _off_t off_t; -typedef __dev_t dev_t; -typedef __uid_t uid_t; -typedef __gid_t gid_t; -#endif - -#if defined(__XMK__) -typedef signed char pid_t; -#else -typedef int pid_t; -#endif - -#if defined(__rtems__) -typedef _mode_t mode_t; -#endif - -#ifndef __CYGWIN__ -typedef long key_t; -#endif -typedef _ssize_t ssize_t; - -#if !defined(__CYGWIN__) && !defined(__rtems__) -#ifdef __MS_types__ -typedef char * addr_t; -typedef int mode_t; -#else -#if defined (__sparc__) && !defined (__sparc_v9__) -#ifdef __svr4__ -typedef unsigned long mode_t; -#else -typedef unsigned short mode_t; -#endif -#else -typedef unsigned int mode_t _ST_INT32; -#endif -#endif /* ! __MS_types__ */ -#endif /*__CYGWIN__*/ - -typedef unsigned short nlink_t; - -/* We don't define fd_set and friends if we are compiling POSIX - source, or if we have included (or may include as indicated - by __USE_W32_SOCKETS) the W32api winsock[2].h header which - defines Windows versions of them. Note that a program which - includes the W32api winsock[2].h header must know what it is doing; - it must not call the cygwin32 select function. -*/ -# if !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS)) -# define _SYS_TYPES_FD_SET -# define NBBY 8 /* number of bits in a byte */ -/* - * Select uses bit masks of file descriptors in longs. - * These macros manipulate such bit fields (the filesystem macros use chars). - * FD_SETSIZE may be defined by the user, but the default here - * should be >= NOFILE (param.h). - */ -# ifndef FD_SETSIZE -# define FD_SETSIZE 64 -# endif - -typedef long fd_mask; -# define NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */ -# ifndef howmany -# define howmany(x,y) (((x)+((y)-1))/(y)) -# endif - -/* We use a macro for fd_set so that including Sockets.h afterwards - can work. */ -typedef struct _types_fd_set { - fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; -} _types_fd_set; - -#define fd_set _types_fd_set - -# define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1L << ((n) % NFDBITS))) -# define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1L << ((n) % NFDBITS))) -# define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS))) -# define FD_ZERO(p) (__extension__ (void)({ \ - size_t __i; \ - char *__tmp = (char *)p; \ - for (__i = 0; __i < sizeof (*(p)); ++__i) \ - *__tmp++ = 0; \ -})) - -# endif /* !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS)) */ - -#undef __MS_types__ -#undef _ST_INT32 - - -#ifndef __clockid_t_defined -typedef _CLOCKID_T_ clockid_t; -#define __clockid_t_defined -#endif - -#ifndef __timer_t_defined -typedef _TIMER_T_ timer_t; -#define __timer_t_defined -#endif - -typedef unsigned long useconds_t; -typedef long suseconds_t; - -#include - - -/* Cygwin will probably never have full posix compliance due to little things - * like an inability to set the stackaddress. Cygwin is also using void * - * pointers rather than structs to ensure maximum binary compatability with - * previous releases. - * This means that we don't use the types defined here, but rather in - * - */ -#if defined(_POSIX_THREADS) && !defined(__CYGWIN__) - -#include - -/* - * 2.5 Primitive System Data Types, P1003.1c/D10, p. 19. - */ - -#if defined(__XMK__) -typedef unsigned int pthread_t; /* identify a thread */ -#else -typedef __uint32_t pthread_t; /* identify a thread */ -#endif - -/* P1003.1c/D10, p. 118-119 */ -#define PTHREAD_SCOPE_PROCESS 0 -#define PTHREAD_SCOPE_SYSTEM 1 - -/* P1003.1c/D10, p. 111 */ -#define PTHREAD_INHERIT_SCHED 1 /* scheduling policy and associated */ - /* attributes are inherited from */ - /* the calling thread. */ -#define PTHREAD_EXPLICIT_SCHED 2 /* set from provided attribute object */ - -/* P1003.1c/D10, p. 141 */ -#define PTHREAD_CREATE_DETACHED 0 -#define PTHREAD_CREATE_JOINABLE 1 - -#if defined(__rtems__) - #include -#endif - -#if defined(__XMK__) -typedef struct pthread_attr_s { - int contentionscope; - struct sched_param schedparam; - int detachstate; - void *stackaddr; - size_t stacksize; -} pthread_attr_t; - -#define PTHREAD_STACK_MIN 200 - -#else /* !defined(__XMK__) */ -typedef struct { - int is_initialized; - void *stackaddr; - int stacksize; - int contentionscope; - int inheritsched; - int schedpolicy; - struct sched_param schedparam; -#if defined(__rtems__) - size_t guardsize; -#endif - - /* P1003.4b/D8, p. 54 adds cputime_clock_allowed attribute. */ -#if defined(_POSIX_THREAD_CPUTIME) - int cputime_clock_allowed; /* see time.h */ -#endif - int detachstate; -#if defined(__rtems__) - size_t affinitysetsize; - cpu_set_t *affinityset; - cpu_set_t affinitysetpreallocated; -#endif -} pthread_attr_t; - -#endif /* !defined(__XMK__) */ - -#if defined(_POSIX_THREAD_PROCESS_SHARED) -/* NOTE: P1003.1c/D10, p. 81 defines following values for process_shared. */ - -#define PTHREAD_PROCESS_PRIVATE 0 /* visible within only the creating process */ -#define PTHREAD_PROCESS_SHARED 1 /* visible too all processes with access to */ - /* the memory where the resource is */ - /* located */ -#endif - -#if defined(_POSIX_THREAD_PRIO_PROTECT) -/* Mutexes */ - -/* Values for blocking protocol. */ - -#define PTHREAD_PRIO_NONE 0 -#define PTHREAD_PRIO_INHERIT 1 -#define PTHREAD_PRIO_PROTECT 2 -#endif - -#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) - -/* Values for mutex type */ - -/* The following defines are part of the X/Open System Interface (XSI). */ - -/* - * This type of mutex does not detect deadlock. A thread attempting to - * relock this mutex without first unlocking it shall deadlock. Attempting - * to unlock a mutex locked by a different thread results in undefined - * behavior. Attempting to unlock an unlocked mutex results in undefined - * behavior. - */ -#define PTHREAD_MUTEX_NORMAL 0 - -/* - * A thread attempting to relock this mutex without first unlocking - * it shall succeed in locking the mutex. The relocking deadlock which - * can occur with mutexes of type PTHREAD_MUTEX_NORMAL cannot occur with - * this type of mutex. Multiple locks of this mutex shall require the - * same number of unlocks to release the mutex before another thread can - * acquire the mutex. A thread attempting to unlock a mutex which another - * thread has locked shall return with an error. A thread attempting to - * unlock an unlocked mutex shall return with an error. - */ -#define PTHREAD_MUTEX_RECURSIVE 1 - -/* - * This type of mutex provides error checking. A thread attempting - * to relock this mutex without first unlocking it shall return with an - * error. A thread attempting to unlock a mutex which another thread has - * locked shall return with an error. A thread attempting to unlock an - * unlocked mutex shall return with an error. - */ -#define PTHREAD_MUTEX_ERRORCHECK 2 - -/* - * Attempting to recursively lock a mutex of this type results - * in undefined behavior. Attempting to unlock a mutex of this type - * which was not locked by the calling thread results in undefined - * behavior. Attempting to unlock a mutex of this type which is not locked - * results in undefined behavior. An implementation may map this mutex to - * one of the other mutex types. - */ -#define PTHREAD_MUTEX_DEFAULT 3 - -#endif /* !defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) */ - -#if defined(__XMK__) -typedef unsigned int pthread_mutex_t; /* identify a mutex */ - -typedef struct { - int type; -} pthread_mutexattr_t; - -#else /* !defined(__XMK__) */ -typedef __uint32_t pthread_mutex_t; /* identify a mutex */ - -typedef struct { - int is_initialized; -#if defined(_POSIX_THREAD_PROCESS_SHARED) - int process_shared; /* allow mutex to be shared amongst processes */ -#endif -#if defined(_POSIX_THREAD_PRIO_PROTECT) - int prio_ceiling; - int protocol; -#endif -#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) - int type; -#endif - int recursive; -} pthread_mutexattr_t; -#endif /* !defined(__XMK__) */ - -/* Condition Variables */ - -typedef __uint32_t pthread_cond_t; /* identify a condition variable */ - -typedef struct { - int is_initialized; -#if defined(_POSIX_THREAD_PROCESS_SHARED) - int process_shared; /* allow this to be shared amongst processes */ -#endif -} pthread_condattr_t; /* a condition attribute object */ - -/* Keys */ - -typedef __uint32_t pthread_key_t; /* thread-specific data keys */ - -typedef struct { - int is_initialized; /* is this structure initialized? */ - int init_executed; /* has the initialization routine been run? */ -} pthread_once_t; /* dynamic package initialization */ -#else -#if defined (__CYGWIN__) -#include -#endif -#endif /* defined(_POSIX_THREADS) */ - -/* POSIX Barrier Types */ - -#if defined(_POSIX_BARRIERS) -typedef __uint32_t pthread_barrier_t; /* POSIX Barrier Object */ -typedef struct { - int is_initialized; /* is this structure initialized? */ -#if defined(_POSIX_THREAD_PROCESS_SHARED) - int process_shared; /* allow this to be shared amongst processes */ -#endif -} pthread_barrierattr_t; -#endif /* defined(_POSIX_BARRIERS) */ - -/* POSIX Spin Lock Types */ - -#if !defined (__CYGWIN__) -#if defined(_POSIX_SPIN_LOCKS) -typedef __uint32_t pthread_spinlock_t; /* POSIX Spin Lock Object */ -#endif /* defined(_POSIX_SPIN_LOCKS) */ - -/* POSIX Reader/Writer Lock Types */ - -#if defined(_POSIX_READER_WRITER_LOCKS) -typedef __uint32_t pthread_rwlock_t; /* POSIX RWLock Object */ -typedef struct { - int is_initialized; /* is this structure initialized? */ -#if defined(_POSIX_THREAD_PROCESS_SHARED) - int process_shared; /* allow this to be shared amongst processes */ -#endif -} pthread_rwlockattr_t; -#endif /* defined(_POSIX_READER_WRITER_LOCKS) */ -#endif /* __CYGWIN__ */ - -#endif /* !__need_inttypes */ - -#undef __need_inttypes - -#endif /* _SYS_TYPES_H */ diff --git a/tools/sdk/include/newlib/sys/uio.h b/tools/sdk/include/newlib/sys/uio.h deleted file mode 100644 index ede27b23513..00000000000 --- a/tools/sdk/include/newlib/sys/uio.h +++ /dev/null @@ -1,21 +0,0 @@ -// 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. -#ifndef _ESP_PLATFORM_SYS_UIO_H_ -#define _ESP_PLATFORM_SYS_UIO_H_ - -int writev(int s, const struct iovec *iov, int iovcnt); - -ssize_t readv(int fd, const struct iovec *iov, int iovcnt); - -#endif // _ESP_PLATFORM_SYS_UIO_H_ diff --git a/tools/sdk/include/newlib/sys/un.h b/tools/sdk/include/newlib/sys/un.h deleted file mode 100644 index a99b1832593..00000000000 --- a/tools/sdk/include/newlib/sys/un.h +++ /dev/null @@ -1,24 +0,0 @@ -// 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. -#ifndef _ESP_PLATFORM_SYS_UN_H_ -#define _ESP_PLATFORM_SYS_UN_H_ - -#define AF_UNIX 1 /* local to host (pipes) */ - -struct sockaddr_un { - short sun_family; /*AF_UNIX*/ - char sun_path[108]; /*path name */ -}; - -#endif // _ESP_PLATFORM_SYS_UN_H_ diff --git a/tools/sdk/include/newlib/sys/unistd.h b/tools/sdk/include/newlib/sys/unistd.h deleted file mode 100644 index a741383d069..00000000000 --- a/tools/sdk/include/newlib/sys/unistd.h +++ /dev/null @@ -1,516 +0,0 @@ -#ifndef _SYS_UNISTD_H -#define _SYS_UNISTD_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include <_ansi.h> -#define __need_size_t -#define __need_ptrdiff_t -#include -#include -#include -#include - -extern char **environ; - -void _EXFUN(_exit, (int __status ) _ATTRIBUTE ((__noreturn__))); - -int _EXFUN(access,(const char *__path, int __amode )); -unsigned _EXFUN(alarm, (unsigned __secs )); -int _EXFUN(chdir, (const char *__path )); -int _EXFUN(chmod, (const char *__path, mode_t __mode )); -#if !defined(__INSIDE_CYGWIN__) -int _EXFUN(chown, (const char *__path, uid_t __owner, gid_t __group )); -#endif -#if defined(__CYGWIN__) || defined(__rtems__) -int _EXFUN(chroot, (const char *__path )); -#endif -int _EXFUN(close, (int __fildes )); -#if defined(__CYGWIN__) -size_t _EXFUN(confstr, (int __name, char *__buf, size_t __len)); -#endif -char * _EXFUN(ctermid, (char *__s )); -char * _EXFUN(cuserid, (char *__s )); -#if defined(__CYGWIN__) -int _EXFUN(daemon, (int nochdir, int noclose)); -#endif -int _EXFUN(dup, (int __fildes )); -int _EXFUN(dup2, (int __fildes, int __fildes2 )); -#if defined(__CYGWIN__) -int _EXFUN(dup3, (int __fildes, int __fildes2, int flags)); -int _EXFUN(eaccess, (const char *__path, int __mode)); -void _EXFUN(endusershell, (void)); -int _EXFUN(euidaccess, (const char *__path, int __mode)); -#endif -int _EXFUN(execl, (const char *__path, const char *, ... )); -int _EXFUN(execle, (const char *__path, const char *, ... )); -int _EXFUN(execlp, (const char *__file, const char *, ... )); -#if defined(__CYGWIN__) -int _EXFUN(execlpe, (const char *__file, const char *, ... )); -#endif -int _EXFUN(execv, (const char *__path, char * const __argv[] )); -int _EXFUN(execve, (const char *__path, char * const __argv[], char * const __envp[] )); -int _EXFUN(execvp, (const char *__file, char * const __argv[] )); -#if defined(__CYGWIN__) -int _EXFUN(execvpe, (const char *__file, char * const __argv[], char * const __envp[] )); -#endif -#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE || defined(__CYGWIN__) -int _EXFUN(faccessat, (int __dirfd, const char *__path, int __mode, int __flags)); -#endif -#if defined(__CYGWIN__) || defined(__rtems__) || defined(__SPU__) -int _EXFUN(fchdir, (int __fildes)); -#endif -int _EXFUN(fchmod, (int __fildes, mode_t __mode )); -#if !defined(__INSIDE_CYGWIN__) -int _EXFUN(fchown, (int __fildes, uid_t __owner, gid_t __group )); -#endif -#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE || defined(__CYGWIN__) -int _EXFUN(fchownat, (int __dirfd, const char *__path, uid_t __owner, gid_t __group, int __flags)); -#endif -#if defined(__CYGWIN__) -int _EXFUN(fexecve, (int __fd, char * const __argv[], char * const __envp[] )); -#endif -pid_t _EXFUN(fork, (void )); -long _EXFUN(fpathconf, (int __fd, int __name )); -int _EXFUN(fsync, (int __fd)); -int _EXFUN(fdatasync, (int __fd)); -#if defined(__CYGWIN__) -char * _EXFUN(get_current_dir_name, (void)); -#endif -char * _EXFUN(getcwd, (char *__buf, size_t __size )); -#if defined(__CYGWIN__) -int _EXFUN(getdomainname ,(char *__name, size_t __len)); -#endif -#if !defined(__INSIDE_CYGWIN__) -gid_t _EXFUN(getegid, (void )); -uid_t _EXFUN(geteuid, (void )); -gid_t _EXFUN(getgid, (void )); -#endif -int _EXFUN(getgroups, (int __gidsetsize, gid_t __grouplist[] )); -#if defined(__CYGWIN__) -long _EXFUN(gethostid, (void)); -#endif -char * _EXFUN(getlogin, (void )); -#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) -int _EXFUN(getlogin_r, (char *name, size_t namesize) ); -#endif -char * _EXFUN(getpass, (const char *__prompt)); -int _EXFUN(getpagesize, (void)); -#if defined(__CYGWIN__) -int _EXFUN(getpeereid, (int, uid_t *, gid_t *)); -#endif -pid_t _EXFUN(getpgid, (pid_t)); -pid_t _EXFUN(getpgrp, (void )); -pid_t _EXFUN(getpid, (void )); -pid_t _EXFUN(getppid, (void )); -#if defined(__CYGWIN__) || defined(__rtems__) -pid_t _EXFUN(getsid, (pid_t)); -#endif -#if !defined(__INSIDE_CYGWIN__) -uid_t _EXFUN(getuid, (void )); -#endif -#ifdef __CYGWIN__ -char * _EXFUN(getusershell, (void)); -char * _EXFUN(getwd, (char *__buf )); -int _EXFUN(iruserok, (unsigned long raddr, int superuser, const char *ruser, const char *luser)); -#endif -int _EXFUN(isatty, (int __fildes )); -#if !defined(__INSIDE_CYGWIN__) -int _EXFUN(lchown, (const char *__path, uid_t __owner, gid_t __group )); -#endif -int _EXFUN(link, (const char *__path1, const char *__path2 )); -#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE || defined(__CYGWIN__) -int _EXFUN(linkat, (int __dirfd1, const char *__path1, int __dirfd2, const char *__path2, int __flags )); -#endif -int _EXFUN(nice, (int __nice_value )); -#if !defined(__INSIDE_CYGWIN__) -off_t _EXFUN(lseek, (int __fildes, off_t __offset, int __whence )); -#endif -#if defined(__SPU__) || defined(__CYGWIN__) -#define F_ULOCK 0 -#define F_LOCK 1 -#define F_TLOCK 2 -#define F_TEST 3 -int _EXFUN(lockf, (int __fd, int __cmd, off_t __len)); -#endif -long _EXFUN(pathconf, (const char *__path, int __name )); -int _EXFUN(pause, (void )); -#ifdef __CYGWIN__ -int _EXFUN(pthread_atfork, (void (*)(void), void (*)(void), void (*)(void))); -#endif -int _EXFUN(pipe, (int __fildes[2] )); -#ifdef __CYGWIN__ -int _EXFUN(pipe2, (int __fildes[2], int flags)); -#endif -ssize_t _EXFUN(pread, (int __fd, void *__buf, size_t __nbytes, off_t __offset)); -ssize_t _EXFUN(pwrite, (int __fd, const void *__buf, size_t __nbytes, off_t __offset)); -_READ_WRITE_RETURN_TYPE _EXFUN(read, (int __fd, void *__buf, size_t __nbyte )); -#if defined(__CYGWIN__) -int _EXFUN(rresvport, (int *__alport)); -int _EXFUN(revoke, (char *__path)); -#endif -int _EXFUN(rmdir, (const char *__path )); -#if defined(__CYGWIN__) -int _EXFUN(ruserok, (const char *rhost, int superuser, const char *ruser, const char *luser)); -#endif -void * _EXFUN(sbrk, (ptrdiff_t __incr)); -#if !defined(__INSIDE_CYGWIN__) -#if defined(__CYGWIN__) || defined(__rtems__) -int _EXFUN(setegid, (gid_t __gid )); -int _EXFUN(seteuid, (uid_t __uid )); -#endif -int _EXFUN(setgid, (gid_t __gid )); -#endif -#if defined(__CYGWIN__) -int _EXFUN(setgroups, (int ngroups, const gid_t *grouplist )); -#endif -#if __BSD_VISIBLE || (defined(_XOPEN_SOURCE) && __XSI_VISIBLE < 500) -int _EXFUN(sethostname, (const char *, size_t)); -#endif -int _EXFUN(setpgid, (pid_t __pid, pid_t __pgid )); -int _EXFUN(setpgrp, (void )); -#if defined(__CYGWIN__) && !defined(__INSIDE_CYGWIN__) -int _EXFUN(setregid, (gid_t __rgid, gid_t __egid)); -int _EXFUN(setreuid, (uid_t __ruid, uid_t __euid)); -#endif -pid_t _EXFUN(setsid, (void )); -#if !defined(__INSIDE_CYGWIN__) -int _EXFUN(setuid, (uid_t __uid )); -#endif -#if defined(__CYGWIN__) -void _EXFUN(setusershell, (void)); -#endif -unsigned _EXFUN(sleep, (unsigned int __seconds )); -void _EXFUN(swab, (const void *__restrict, void *__restrict, ssize_t)); -long _EXFUN(sysconf, (int __name )); -pid_t _EXFUN(tcgetpgrp, (int __fildes )); -int _EXFUN(tcsetpgrp, (int __fildes, pid_t __pgrp_id )); -char * _EXFUN(ttyname, (int __fildes )); -#if defined(__CYGWIN__) || defined(__rtems__) -int _EXFUN(ttyname_r, (int, char *, size_t)); -#endif -int _EXFUN(unlink, (const char *__path )); -int _EXFUN(usleep, (useconds_t __useconds)); -int _EXFUN(vhangup, (void )); -_READ_WRITE_RETURN_TYPE _EXFUN(write, (int __fd, const void *__buf, size_t __nbyte )); - -#ifdef __CYGWIN__ -# define __UNISTD_GETOPT__ -# include -# undef __UNISTD_GETOPT__ -#else -extern char *optarg; /* getopt(3) external variables */ -extern int optind, opterr, optopt; -int getopt(int, char * const [], const char *); -extern int optreset; /* getopt(3) external variable */ -#endif - -#ifndef _POSIX_SOURCE -pid_t _EXFUN(vfork, (void )); -#endif /* _POSIX_SOURCE */ - -#ifdef _COMPILING_NEWLIB -/* Provide prototypes for most of the _ names that are - provided in newlib for some compilers. */ -int _EXFUN(_close, (int __fildes )); -pid_t _EXFUN(_fork, (void )); -pid_t _EXFUN(_getpid, (void )); -int _EXFUN(_isatty, (int __fildes )); -int _EXFUN(_link, (const char *__path1, const char *__path2 )); -_off_t _EXFUN(_lseek, (int __fildes, _off_t __offset, int __whence )); -#ifdef __LARGE64_FILES -_off64_t _EXFUN(_lseek64, (int __filedes, _off64_t __offset, int __whence )); -#endif -_READ_WRITE_RETURN_TYPE _EXFUN(_read, (int __fd, void *__buf, size_t __nbyte )); -void * _EXFUN(_sbrk, (ptrdiff_t __incr)); -int _EXFUN(_unlink, (const char *__path )); -_READ_WRITE_RETURN_TYPE _EXFUN(_write, (int __fd, const void *__buf, size_t __nbyte )); -int _EXFUN(_execve, (const char *__path, char * const __argv[], char * const __envp[] )); -#endif - -#if defined(__CYGWIN__) || defined(__rtems__) || defined(__aarch64__) || defined (__arm__) || defined(__sh__) || defined(__SPU__) -#if !defined(__INSIDE_CYGWIN__) -int _EXFUN(ftruncate, (int __fd, off_t __length)); -int _EXFUN(truncate, (const char *, off_t __length)); -#endif -#endif - -#if defined(__CYGWIN__) || defined(__rtems__) -int _EXFUN(getdtablesize, (void)); -int _EXFUN(setdtablesize, (int)); -useconds_t _EXFUN(ualarm, (useconds_t __useconds, useconds_t __interval)); -#if !(defined (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS)) -/* winsock[2].h defines as __stdcall, and with int as 2nd arg */ - int _EXFUN(gethostname, (char *__name, size_t __len)); -#endif -char * _EXFUN(mktemp, (char *)); -#endif - -#if defined(__CYGWIN__) || defined(__SPU__) || defined(__rtems__) -void _EXFUN(sync, (void)); -#endif - -ssize_t _EXFUN(readlink, (const char *__restrict __path, - char *__restrict __buf, size_t __buflen)); -#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE || defined(__CYGWIN__) -ssize_t _EXFUN(readlinkat, (int __dirfd1, const char *__restrict __path, - char *__restrict __buf, size_t __buflen)); -#endif -int _EXFUN(symlink, (const char *__name1, const char *__name2)); -#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE || defined(__CYGWIN__) -int _EXFUN(symlinkat, (const char *, int, const char *)); -int _EXFUN(unlinkat, (int, const char *, int)); -#endif - -#define F_OK 0 -#define R_OK 4 -#define W_OK 2 -#define X_OK 1 - -# define SEEK_SET 0 -# define SEEK_CUR 1 -# define SEEK_END 2 - -#include - -#define STDIN_FILENO 0 /* standard input file descriptor */ -#define STDOUT_FILENO 1 /* standard output file descriptor */ -#define STDERR_FILENO 2 /* standard error file descriptor */ - -/* - * sysconf values per IEEE Std 1003.1, 2008 Edition - */ - -#define _SC_ARG_MAX 0 -#define _SC_CHILD_MAX 1 -#define _SC_CLK_TCK 2 -#define _SC_NGROUPS_MAX 3 -#define _SC_OPEN_MAX 4 -#define _SC_JOB_CONTROL 5 -#define _SC_SAVED_IDS 6 -#define _SC_VERSION 7 -#define _SC_PAGESIZE 8 -#define _SC_PAGE_SIZE _SC_PAGESIZE -/* These are non-POSIX values we accidentally introduced in 2000 without - guarding them. Keeping them unguarded for backward compatibility. */ -#define _SC_NPROCESSORS_CONF 9 -#define _SC_NPROCESSORS_ONLN 10 -#define _SC_PHYS_PAGES 11 -#define _SC_AVPHYS_PAGES 12 -/* End of non-POSIX values. */ -#define _SC_MQ_OPEN_MAX 13 -#define _SC_MQ_PRIO_MAX 14 -#define _SC_RTSIG_MAX 15 -#define _SC_SEM_NSEMS_MAX 16 -#define _SC_SEM_VALUE_MAX 17 -#define _SC_SIGQUEUE_MAX 18 -#define _SC_TIMER_MAX 19 -#define _SC_TZNAME_MAX 20 -#define _SC_ASYNCHRONOUS_IO 21 -#define _SC_FSYNC 22 -#define _SC_MAPPED_FILES 23 -#define _SC_MEMLOCK 24 -#define _SC_MEMLOCK_RANGE 25 -#define _SC_MEMORY_PROTECTION 26 -#define _SC_MESSAGE_PASSING 27 -#define _SC_PRIORITIZED_IO 28 -#define _SC_REALTIME_SIGNALS 29 -#define _SC_SEMAPHORES 30 -#define _SC_SHARED_MEMORY_OBJECTS 31 -#define _SC_SYNCHRONIZED_IO 32 -#define _SC_TIMERS 33 -#define _SC_AIO_LISTIO_MAX 34 -#define _SC_AIO_MAX 35 -#define _SC_AIO_PRIO_DELTA_MAX 36 -#define _SC_DELAYTIMER_MAX 37 -#define _SC_THREAD_KEYS_MAX 38 -#define _SC_THREAD_STACK_MIN 39 -#define _SC_THREAD_THREADS_MAX 40 -#define _SC_TTY_NAME_MAX 41 -#define _SC_THREADS 42 -#define _SC_THREAD_ATTR_STACKADDR 43 -#define _SC_THREAD_ATTR_STACKSIZE 44 -#define _SC_THREAD_PRIORITY_SCHEDULING 45 -#define _SC_THREAD_PRIO_INHERIT 46 -/* _SC_THREAD_PRIO_PROTECT was _SC_THREAD_PRIO_CEILING in early drafts */ -#define _SC_THREAD_PRIO_PROTECT 47 -#define _SC_THREAD_PRIO_CEILING _SC_THREAD_PRIO_PROTECT -#define _SC_THREAD_PROCESS_SHARED 48 -#define _SC_THREAD_SAFE_FUNCTIONS 49 -#define _SC_GETGR_R_SIZE_MAX 50 -#define _SC_GETPW_R_SIZE_MAX 51 -#define _SC_LOGIN_NAME_MAX 52 -#define _SC_THREAD_DESTRUCTOR_ITERATIONS 53 -#define _SC_ADVISORY_INFO 54 -#define _SC_ATEXIT_MAX 55 -#define _SC_BARRIERS 56 -#define _SC_BC_BASE_MAX 57 -#define _SC_BC_DIM_MAX 58 -#define _SC_BC_SCALE_MAX 59 -#define _SC_BC_STRING_MAX 60 -#define _SC_CLOCK_SELECTION 61 -#define _SC_COLL_WEIGHTS_MAX 62 -#define _SC_CPUTIME 63 -#define _SC_EXPR_NEST_MAX 64 -#define _SC_HOST_NAME_MAX 65 -#define _SC_IOV_MAX 66 -#define _SC_IPV6 67 -#define _SC_LINE_MAX 68 -#define _SC_MONOTONIC_CLOCK 69 -#define _SC_RAW_SOCKETS 70 -#define _SC_READER_WRITER_LOCKS 71 -#define _SC_REGEXP 72 -#define _SC_RE_DUP_MAX 73 -#define _SC_SHELL 74 -#define _SC_SPAWN 75 -#define _SC_SPIN_LOCKS 76 -#define _SC_SPORADIC_SERVER 77 -#define _SC_SS_REPL_MAX 78 -#define _SC_SYMLOOP_MAX 79 -#define _SC_THREAD_CPUTIME 80 -#define _SC_THREAD_SPORADIC_SERVER 81 -#define _SC_TIMEOUTS 82 -#define _SC_TRACE 83 -#define _SC_TRACE_EVENT_FILTER 84 -#define _SC_TRACE_EVENT_NAME_MAX 85 -#define _SC_TRACE_INHERIT 86 -#define _SC_TRACE_LOG 87 -#define _SC_TRACE_NAME_MAX 88 -#define _SC_TRACE_SYS_MAX 89 -#define _SC_TRACE_USER_EVENT_MAX 90 -#define _SC_TYPED_MEMORY_OBJECTS 91 -#define _SC_V7_ILP32_OFF32 92 -#define _SC_V6_ILP32_OFF32 _SC_V7_ILP32_OFF32 -#define _SC_XBS5_ILP32_OFF32 _SC_V7_ILP32_OFF32 -#define _SC_V7_ILP32_OFFBIG 93 -#define _SC_V6_ILP32_OFFBIG _SC_V7_ILP32_OFFBIG -#define _SC_XBS5_ILP32_OFFBIG _SC_V7_ILP32_OFFBIG -#define _SC_V7_LP64_OFF64 94 -#define _SC_V6_LP64_OFF64 _SC_V7_LP64_OFF64 -#define _SC_XBS5_LP64_OFF64 _SC_V7_LP64_OFF64 -#define _SC_V7_LPBIG_OFFBIG 95 -#define _SC_V6_LPBIG_OFFBIG _SC_V7_LPBIG_OFFBIG -#define _SC_XBS5_LPBIG_OFFBIG _SC_V7_LPBIG_OFFBIG -#define _SC_XOPEN_CRYPT 96 -#define _SC_XOPEN_ENH_I18N 97 -#define _SC_XOPEN_LEGACY 98 -#define _SC_XOPEN_REALTIME 99 -#define _SC_STREAM_MAX 100 -#define _SC_PRIORITY_SCHEDULING 101 -#define _SC_XOPEN_REALTIME_THREADS 102 -#define _SC_XOPEN_SHM 103 -#define _SC_XOPEN_STREAMS 104 -#define _SC_XOPEN_UNIX 105 -#define _SC_XOPEN_VERSION 106 -#define _SC_2_CHAR_TERM 107 -#define _SC_2_C_BIND 108 -#define _SC_2_C_DEV 109 -#define _SC_2_FORT_DEV 110 -#define _SC_2_FORT_RUN 111 -#define _SC_2_LOCALEDEF 112 -#define _SC_2_PBS 113 -#define _SC_2_PBS_ACCOUNTING 114 -#define _SC_2_PBS_CHECKPOINT 115 -#define _SC_2_PBS_LOCATE 116 -#define _SC_2_PBS_MESSAGE 117 -#define _SC_2_PBS_TRACK 118 -#define _SC_2_SW_DEV 119 -#define _SC_2_UPE 120 -#define _SC_2_VERSION 121 -#define _SC_THREAD_ROBUST_PRIO_INHERIT 122 -#define _SC_THREAD_ROBUST_PRIO_PROTECT 123 -#define _SC_XOPEN_UUCP 124 - -/* - * pathconf values per IEEE Std 1003.1, 2008 Edition - */ - -#define _PC_LINK_MAX 0 -#define _PC_MAX_CANON 1 -#define _PC_MAX_INPUT 2 -#define _PC_NAME_MAX 3 -#define _PC_PATH_MAX 4 -#define _PC_PIPE_BUF 5 -#define _PC_CHOWN_RESTRICTED 6 -#define _PC_NO_TRUNC 7 -#define _PC_VDISABLE 8 -#define _PC_ASYNC_IO 9 -#define _PC_PRIO_IO 10 -#define _PC_SYNC_IO 11 -#define _PC_FILESIZEBITS 12 -#define _PC_2_SYMLINKS 13 -#define _PC_SYMLINK_MAX 14 -#define _PC_ALLOC_SIZE_MIN 15 -#define _PC_REC_INCR_XFER_SIZE 16 -#define _PC_REC_MAX_XFER_SIZE 17 -#define _PC_REC_MIN_XFER_SIZE 18 -#define _PC_REC_XFER_ALIGN 19 -#define _PC_TIMESTAMP_RESOLUTION 20 -#ifdef __CYGWIN__ -/* Ask for POSIX permission bits support. */ -#define _PC_POSIX_PERMISSIONS 90 -/* Ask for full POSIX permission support including uid/gid settings. */ -#define _PC_POSIX_SECURITY 91 -#endif - -/* - * confstr values per IEEE Std 1003.1, 2004 Edition - */ - -#ifdef __CYGWIN__ /* Only defined on Cygwin for now. */ -#define _CS_PATH 0 -#define _CS_POSIX_V7_ILP32_OFF32_CFLAGS 1 -#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS _CS_POSIX_V7_ILP32_OFF32_CFLAGS -#define _CS_XBS5_ILP32_OFF32_CFLAGS _CS_POSIX_V7_ILP32_OFF32_CFLAGS -#define _CS_POSIX_V7_ILP32_OFF32_LDFLAGS 2 -#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS _CS_POSIX_V7_ILP32_OFF32_LDFLAGS -#define _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_POSIX_V7_ILP32_OFF32_LDFLAGS -#define _CS_POSIX_V7_ILP32_OFF32_LIBS 3 -#define _CS_POSIX_V6_ILP32_OFF32_LIBS _CS_POSIX_V7_ILP32_OFF32_LIBS -#define _CS_XBS5_ILP32_OFF32_LIBS _CS_POSIX_V7_ILP32_OFF32_LIBS -#define _CS_XBS5_ILP32_OFF32_LINTFLAGS 4 -#define _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS 5 -#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS -#define _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS -#define _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS 6 -#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS -#define _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS -#define _CS_POSIX_V7_ILP32_OFFBIG_LIBS 7 -#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS _CS_POSIX_V7_ILP32_OFFBIG_LIBS -#define _CS_XBS5_ILP32_OFFBIG_LIBS _CS_POSIX_V7_ILP32_OFFBIG_LIBS -#define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS 8 -#define _CS_POSIX_V7_LP64_OFF64_CFLAGS 9 -#define _CS_POSIX_V6_LP64_OFF64_CFLAGS _CS_POSIX_V7_LP64_OFF64_CFLAGS -#define _CS_XBS5_LP64_OFF64_CFLAGS _CS_POSIX_V7_LP64_OFF64_CFLAGS -#define _CS_POSIX_V7_LP64_OFF64_LDFLAGS 10 -#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS _CS_POSIX_V7_LP64_OFF64_LDFLAGS -#define _CS_XBS5_LP64_OFF64_LDFLAGS _CS_POSIX_V7_LP64_OFF64_LDFLAGS -#define _CS_POSIX_V7_LP64_OFF64_LIBS 11 -#define _CS_POSIX_V6_LP64_OFF64_LIBS _CS_POSIX_V7_LP64_OFF64_LIBS -#define _CS_XBS5_LP64_OFF64_LIBS _CS_POSIX_V7_LP64_OFF64_LIBS -#define _CS_XBS5_LP64_OFF64_LINTFLAGS 12 -#define _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS 13 -#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS -#define _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS -#define _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS 14 -#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS -#define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS -#define _CS_POSIX_V7_LPBIG_OFFBIG_LIBS 15 -#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS _CS_POSIX_V7_LPBIG_OFFBIG_LIBS -#define _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_POSIX_V7_LPBIG_OFFBIG_LIBS -#define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS 16 -#define _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS 17 -#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS -#define _CS_XBS5_WIDTH_RESTRICTED_ENVS _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS -#define _CS_POSIX_V7_THREADS_CFLAGS 18 -#define _CS_POSIX_V7_THREADS_LDFLAGS 19 -#define _CS_V7_ENV 20 -#define _CS_V6_ENV _CS_V7_ENV -#endif - -#ifdef __cplusplus -} -#endif -#endif /* _SYS_UNISTD_H */ diff --git a/tools/sdk/include/newlib/sys/utime.h b/tools/sdk/include/newlib/sys/utime.h deleted file mode 100644 index 5e937f10384..00000000000 --- a/tools/sdk/include/newlib/sys/utime.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef _SYS_UTIME_H -#define _SYS_UTIME_H - -/* This is a dummy file, not customized for any - particular system. If there is a utime.h in libc/sys/SYSDIR/sys, - it will override this one. */ - -#ifdef __cplusplus -extern "C" { -#endif - -struct utimbuf -{ - time_t actime; - time_t modtime; -}; - -#ifdef __cplusplus -}; -#endif - -#endif /* _SYS_UTIME_H */ diff --git a/tools/sdk/include/newlib/sys/wait.h b/tools/sdk/include/newlib/sys/wait.h deleted file mode 100644 index 73fe372024f..00000000000 --- a/tools/sdk/include/newlib/sys/wait.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef _SYS_WAIT_H -#define _SYS_WAIT_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#define WNOHANG 1 -#define WUNTRACED 2 - -/* A status looks like: - <2 bytes info> <2 bytes code> - - == 0, child has exited, info is the exit value - == 1..7e, child has exited, info is the signal number. - == 7f, child has stopped, info was the signal number. - == 80, there was a core dump. -*/ - -#define WIFEXITED(w) (((w) & 0xff) == 0) -#define WIFSIGNALED(w) (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f)) -#define WIFSTOPPED(w) (((w) & 0xff) == 0x7f) -#define WEXITSTATUS(w) (((w) >> 8) & 0xff) -#define WTERMSIG(w) ((w) & 0x7f) -#define WSTOPSIG WEXITSTATUS - -pid_t wait (int *); -pid_t waitpid (pid_t, int *, int); - -#ifdef _COMPILING_NEWLIB -pid_t _wait (int *); -#endif - -/* Provide prototypes for most of the _ names that are - provided in newlib for some compilers. */ -pid_t _wait (int *); - -#ifdef __cplusplus -}; -#endif - -#endif diff --git a/tools/sdk/include/newlib/tar.h b/tools/sdk/include/newlib/tar.h deleted file mode 100644 index 07b06dd7fba..00000000000 --- a/tools/sdk/include/newlib/tar.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * tar.h - */ - -#ifndef _TAR_H -#define _TAR_H - -/* General definitions */ -#define TMAGIC "ustar" /* ustar plus null byte. */ -#define TMAGLEN 6 /* Length of the above. */ -#define TVERSION "00" /* 00 without a null byte. */ -#define TVERSLEN 2 /* Length of the above. */ - -/* Typeflag field definitions */ -#define REGTYPE '0' /* Regular file. */ -#define AREGTYPE '\0' /* Regular file. */ -#define LNKTYPE '1' /* Link. */ -#define SYMTYPE '2' /* Symbolic link. */ -#define CHRTYPE '3' /* Character special. */ -#define BLKTYPE '4' /* Block special. */ -#define DIRTYPE '5' /* Directory. */ -#define FIFOTYPE '6' /* FIFO special. */ -#define CONTTYPE '7' /* Reserved. */ - -/* Mode field bit definitions (octal) */ -#define TSUID 04000 /* Set UID on execution. */ -#define TSGID 02000 /* Set GID on execution. */ -#define TSVTX 01000 /* On directories, restricted deletion flag. */ -#define TUREAD 00400 /* Read by owner. */ -#define TUWRITE 00200 /* Write by owner. */ -#define TUEXEC 00100 /* Execute/search by owner. */ -#define TGREAD 00040 /* Read by group. */ -#define TGWRITE 00020 /* Write by group. */ -#define TGEXEC 00010 /* Execute/search by group. */ -#define TOREAD 00004 /* Read by other. */ -#define TOWRITE 00002 /* Write by other. */ -#define TOEXEC 00001 /* Execute/search by other. */ - -#endif diff --git a/tools/sdk/include/newlib/termios.h b/tools/sdk/include/newlib/termios.h deleted file mode 100644 index ee1820ce047..00000000000 --- a/tools/sdk/include/newlib/termios.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifdef __cplusplus -extern "C" { -#endif -#include -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/newlib/tgmath.h b/tools/sdk/include/newlib/tgmath.h deleted file mode 100644 index f9c8311cc3d..00000000000 --- a/tools/sdk/include/newlib/tgmath.h +++ /dev/null @@ -1,184 +0,0 @@ -/* http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/tgmath.h.html */ -/*- - * Copyright (c) 2004 Stefan Farfeleder. - * All rights reserved. - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - * - * $FreeBSD$ - */ - -#ifndef _TGMATH_H_ -#define _TGMATH_H_ - -#include -#include - -#ifdef log2 -#undef log2 -#endif - -/* - * This implementation of requires two implementation-dependent - * macros to be defined: - * __tg_impl_simple(x, y, z, fn, fnf, fnl, ...) - * Invokes fnl() if the corresponding real type of x, y or z is long - * double, fn() if it is double or any has an integer type, and fnf() - * otherwise. - * __tg_impl_full(x, y, z, fn, fnf, fnl, cfn, cfnf, cfnl, ...) - * Invokes [c]fnl() if the corresponding real type of x, y or z is long - * double, [c]fn() if it is double or any has an integer type, and - * [c]fnf() otherwise. The function with the 'c' prefix is called if - * any of x, y or z is a complex number. - * Both macros call the chosen function with all additional arguments passed - * to them, as given by __VA_ARGS__. - * - * Note that these macros cannot be implemented with C's ?: operator, - * because the return type of the whole expression would incorrectly be long - * double complex regardless of the argument types. - */ - -/* requires GCC >= 3.1 */ -#if !__GNUC_PREREQ (3, 1) -#error " not implemented for this compiler" -#endif - -#define __tg_type(__e, __t) \ - __builtin_types_compatible_p(__typeof__(__e), __t) -#define __tg_type3(__e1, __e2, __e3, __t) \ - (__tg_type(__e1, __t) || __tg_type(__e2, __t) || \ - __tg_type(__e3, __t)) -#define __tg_type_corr(__e1, __e2, __e3, __t) \ - (__tg_type3(__e1, __e2, __e3, __t) || \ - __tg_type3(__e1, __e2, __e3, __t _Complex)) -#define __tg_integer(__e1, __e2, __e3) \ - (((__typeof__(__e1))1.5 == 1) || ((__typeof__(__e2))1.5 == 1) || \ - ((__typeof__(__e3))1.5 == 1)) -#define __tg_is_complex(__e1, __e2, __e3) \ - (__tg_type3(__e1, __e2, __e3, float _Complex) || \ - __tg_type3(__e1, __e2, __e3, double _Complex) || \ - __tg_type3(__e1, __e2, __e3, long double _Complex) || \ - __tg_type3(__e1, __e2, __e3, __typeof__(_Complex_I))) - -#ifdef _LDBL_EQ_DBL -#define __tg_impl_simple(x, y, z, fn, fnf, fnl, ...) \ - __builtin_choose_expr(__tg_type_corr(x, y, z, long double), \ - fnl(__VA_ARGS__), __builtin_choose_expr( \ - __tg_type_corr(x, y, z, double) || __tg_integer(x, y, z),\ - fn(__VA_ARGS__), fnf(__VA_ARGS__))) -#else -#define __tg_impl_simple(__x, __y, __z, __fn, __fnf, __fnl, ...) \ - (__tg_type_corr(__x, __y, __z, double) || __tg_integer(__x, __y, __z)) \ - ? __fn(__VA_ARGS__) : __fnf(__VA_ARGS__) -#endif - -#define __tg_impl_full(__x, __y, __z, __fn, __fnf, __fnl, __cfn, __cfnf, __cfnl, ...) \ - __builtin_choose_expr(__tg_is_complex(__x, __y, __z), \ - __tg_impl_simple(__x, __y, __z, __cfn, __cfnf, __cfnl, __VA_ARGS__), \ - __tg_impl_simple(__x, __y, __z, __fn, __fnf, __fnl, __VA_ARGS__)) - -/* Macros to save lots of repetition below */ -#define __tg_simple(__x, __fn) \ - __tg_impl_simple(__x, __x, __x, __fn, __fn##f, __fn##l, __x) -#define __tg_simple2(__x, __y, __fn) \ - __tg_impl_simple(__x, __x, __y, __fn, __fn##f, __fn##l, __x, __y) -#define __tg_simplev(__x, __fn, ...) \ - __tg_impl_simple(__x, __x, __x, __fn, __fn##f, __fn##l, __VA_ARGS__) -#define __tg_full(__x, __fn) \ - __tg_impl_full(__x, __x, __x, __fn, __fn##f, __fn##l, c##__fn, c##__fn##f, c##__fn##l, __x) - -/* 7.22#4 -- These macros expand to real or complex functions, depending on - * the type of their arguments. */ -#define acos(__x) __tg_full(__x, acos) -#define asin(__x) __tg_full(__x, asin) -#define atan(__x) __tg_full(__x, atan) -#define acosh(__x) __tg_full(__x, acosh) -#define asinh(__x) __tg_full(__x, asinh) -#define atanh(__x) __tg_full(__x, atanh) -#define cos(__x) __tg_full(__x, cos) -#define sin(__x) __tg_full(__x, sin) -#define tan(__x) __tg_full(__x, tan) -#define cosh(__x) __tg_full(__x, cosh) -#define sinh(__x) __tg_full(__x, sinh) -#define tanh(__x) __tg_full(__x, tanh) -#define exp(__x) __tg_full(__x, exp) -#define log(__x) __tg_full(__x, log) -#define pow(__x, __y) __tg_impl_full(__x, __x, __y, pow, powf, powl, \ - cpow, cpowf, cpowl, __x, __y) -#define sqrt(__x) __tg_full(__x, sqrt) - -/* "The corresponding type-generic macro for fabs and cabs is fabs." */ -#define fabs(__x) __tg_impl_full(__x, __x, __x, fabs, fabsf, fabsl, \ - cabs, cabsf, cabsl, __x) - -/* 7.22#5 -- These macros are only defined for arguments with real type. */ -#define atan2(__x, __y) __tg_simple2(__x, __y, atan2) -#define cbrt(__x) __tg_simple(__x, cbrt) -#define ceil(__x) __tg_simple(__x, ceil) -#define copysign(__x, __y) __tg_simple2(__x, __y, copysign) -#define erf(__x) __tg_simple(__x, erf) -#define erfc(__x) __tg_simple(__x, erfc) -#define exp2(__x) __tg_simple(__x, exp2) -#define expm1(__x) __tg_simple(__x, expm1) -#define fdim(__x, __y) __tg_simple2(__x, __y, fdim) -#define floor(__x) __tg_simple(__x, floor) -#define fma(__x, __y, __z) __tg_impl_simple(__x, __y, __z, fma, fmaf, fmal, \ - __x, __y, __z) -#define fmax(__x, __y) __tg_simple2(__x, __y, fmax) -#define fmin(__x, __y) __tg_simple2(__x, __y, fmin) -#define fmod(__x, __y) __tg_simple2(__x, __y, fmod) -#define frexp(__x, __y) __tg_simplev(__x, frexp, __x, __y) -#define hypot(__x, __y) __tg_simple2(__x, __y, hypot) -#define ilogb(__x) __tg_simple(__x, ilogb) -#define ldexp(__x, __y) __tg_simplev(__x, ldexp, __x, __y) -#define lgamma(__x) __tg_simple(__x, lgamma) -#define llrint(__x) __tg_simple(__x, llrint) -#define llround(__x) __tg_simple(__x, llround) -#define log10(__x) __tg_simple(__x, log10) -#define log1p(__x) __tg_simple(__x, log1p) -#define log2(__x) __tg_simple(__x, log2) -#define logb(__x) __tg_simple(__x, logb) -#define lrint(__x) __tg_simple(__x, lrint) -#define lround(__x) __tg_simple(__x, lround) -#define nearbyint(__x) __tg_simple(__x, nearbyint) -#define nextafter(__x, __y) __tg_simple2(__x, __y, nextafter) -/* not yet implemented even for _LDBL_EQ_DBL platforms -#define nexttoward(__x, __y) __tg_simplev(__x, nexttoward, __x, __y) -*/ -#define remainder(__x, __y) __tg_simple2(__x, __y, remainder) -#define remquo(__x, __y, __z) __tg_impl_simple(__x, __x, __y, remquo, remquof, \ - remquol, __x, __y, __z) -#define rint(__x) __tg_simple(__x, rint) -#define round(__x) __tg_simple(__x, round) -#define scalbn(__x, __y) __tg_simplev(__x, scalbn, __x, __y) -#define scalbln(__x, __y) __tg_simplev(__x, scalbln, __x, __y) -#define tgamma(__x) __tg_simple(__x, tgamma) -#define trunc(__x) __tg_simple(__x, trunc) - -/* 7.22#6 -- These macros always expand to complex functions. */ -#define carg(__x) __tg_simple(__x, carg) -#define cimag(__x) __tg_simple(__x, cimag) -#define conj(__x) __tg_simple(__x, conj) -#define cproj(__x) __tg_simple(__x, cproj) -#define creal(__x) __tg_simple(__x, creal) - -#endif /* !_TGMATH_H_ */ diff --git a/tools/sdk/include/newlib/time.h b/tools/sdk/include/newlib/time.h deleted file mode 100644 index d7b6612db11..00000000000 --- a/tools/sdk/include/newlib/time.h +++ /dev/null @@ -1,291 +0,0 @@ -/* - * time.h - * - * Struct and function declarations for dealing with time. - */ - -#ifndef _TIME_H_ -#define _TIME_H_ - -#include "_ansi.h" -#include - -#define __need_size_t -#define __need_NULL -#include - -/* Get _CLOCKS_PER_SEC_ */ -#include - -#ifndef _CLOCKS_PER_SEC_ -#define _CLOCKS_PER_SEC_ 1000 -#endif - -#define CLOCKS_PER_SEC _CLOCKS_PER_SEC_ -#define CLK_TCK CLOCKS_PER_SEC - -#include - -_BEGIN_STD_C - -struct tm -{ - int tm_sec; - int tm_min; - int tm_hour; - int tm_mday; - int tm_mon; - int tm_year; - int tm_wday; - int tm_yday; - int tm_isdst; -#ifdef __TM_GMTOFF - long __TM_GMTOFF; -#endif -#ifdef __TM_ZONE - const char *__TM_ZONE; -#endif -}; - -clock_t _EXFUN(clock, (void)); -double _EXFUN(difftime, (time_t _time2, time_t _time1)); -time_t _EXFUN(mktime, (struct tm *_timeptr)); -time_t _EXFUN(time, (time_t *_timer)); -#ifndef _REENT_ONLY -char *_EXFUN(asctime, (const struct tm *_tblock)); -char *_EXFUN(ctime, (const time_t *_time)); -struct tm *_EXFUN(gmtime, (const time_t *_timer)); -struct tm *_EXFUN(localtime,(const time_t *_timer)); -#endif -size_t _EXFUN(strftime, (char *__restrict _s, - size_t _maxsize, const char *__restrict _fmt, - const struct tm *__restrict _t)); - -char *_EXFUN(asctime_r, (const struct tm *__restrict, - char *__restrict)); -char *_EXFUN(ctime_r, (const time_t *, char *)); -struct tm *_EXFUN(gmtime_r, (const time_t *__restrict, - struct tm *__restrict)); -struct tm *_EXFUN(localtime_r, (const time_t *__restrict, - struct tm *__restrict)); - -_END_STD_C - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef __STRICT_ANSI__ -char *_EXFUN(strptime, (const char *__restrict, - const char *__restrict, - struct tm *__restrict)); -_VOID _EXFUN(tzset, (_VOID)); -_VOID _EXFUN(_tzset_r, (struct _reent *)); - -typedef struct __tzrule_struct -{ - char ch; - int m; - int n; - int d; - int s; - time_t change; - long offset; /* Match type of _timezone. */ -} __tzrule_type; - -typedef struct __tzinfo_struct -{ - int __tznorth; - int __tzyear; - __tzrule_type __tzrule[2]; -} __tzinfo_type; - -__tzinfo_type *_EXFUN (__gettzinfo, (_VOID)); - -/* getdate functions */ - -#ifdef HAVE_GETDATE -#ifndef _REENT_ONLY -#define getdate_err (*__getdate_err()) -int *_EXFUN(__getdate_err,(_VOID)); - -struct tm * _EXFUN(getdate, (const char *)); -/* getdate_err is set to one of the following values to indicate the error. - 1 the DATEMSK environment variable is null or undefined, - 2 the template file cannot be opened for reading, - 3 failed to get file status information, - 4 the template file is not a regular file, - 5 an error is encountered while reading the template file, - 6 memory allication failed (not enough memory available), - 7 there is no line in the template that matches the input, - 8 invalid input specification */ -#endif /* !_REENT_ONLY */ - -/* getdate_r returns the error code as above */ -int _EXFUN(getdate_r, (const char *, struct tm *)); -#endif /* HAVE_GETDATE */ - -/* defines for the opengroup specifications Derived from Issue 1 of the SVID. */ -extern __IMPORT long _timezone; -extern __IMPORT int _daylight; -extern __IMPORT char *_tzname[2]; - -/* POSIX defines the external tzname being defined in time.h */ -#ifndef tzname -#define tzname _tzname -#endif -#endif /* !__STRICT_ANSI__ */ - -#ifdef __cplusplus -} -#endif - -#include - -#ifdef __CYGWIN__ -#include -#endif /*__CYGWIN__*/ - -#if defined(_POSIX_TIMERS) - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* Clocks, P1003.1b-1993, p. 263 */ - -int _EXFUN(clock_settime, (clockid_t clock_id, const struct timespec *tp)); -int _EXFUN(clock_gettime, (clockid_t clock_id, struct timespec *tp)); -int _EXFUN(clock_getres, (clockid_t clock_id, struct timespec *res)); - -/* Create a Per-Process Timer, P1003.1b-1993, p. 264 */ - -int _EXFUN(timer_create, - (clockid_t clock_id, - struct sigevent *__restrict evp, - timer_t *__restrict timerid)); - -/* Delete a Per_process Timer, P1003.1b-1993, p. 266 */ - -int _EXFUN(timer_delete, (timer_t timerid)); - -/* Per-Process Timers, P1003.1b-1993, p. 267 */ - -int _EXFUN(timer_settime, - (timer_t timerid, int flags, - const struct itimerspec *__restrict value, - struct itimerspec *__restrict ovalue)); -int _EXFUN(timer_gettime, (timer_t timerid, struct itimerspec *value)); -int _EXFUN(timer_getoverrun, (timer_t timerid)); - -/* High Resolution Sleep, P1003.1b-1993, p. 269 */ - -int _EXFUN(nanosleep, (const struct timespec *rqtp, struct timespec *rmtp)); - -#ifdef __cplusplus -} -#endif -#endif /* _POSIX_TIMERS */ - -#if defined(_POSIX_CLOCK_SELECTION) - -#ifdef __cplusplus -extern "C" { -#endif - -int _EXFUN(clock_nanosleep, - (clockid_t clock_id, int flags, const struct timespec *rqtp, - struct timespec *rmtp)); - -#ifdef __cplusplus -} -#endif - -#endif /* _POSIX_CLOCK_SELECTION */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* CPU-time Clock Attributes, P1003.4b/D8, p. 54 */ - -/* values for the clock enable attribute */ - -#define CLOCK_ENABLED 1 /* clock is enabled, i.e. counting execution time */ -#define CLOCK_DISABLED 0 /* clock is disabled */ - -/* values for the pthread cputime_clock_allowed attribute */ - -#define CLOCK_ALLOWED 1 /* If a thread is created with this value a */ - /* CPU-time clock attached to that thread */ - /* shall be accessible. */ -#define CLOCK_DISALLOWED 0 /* If a thread is created with this value, the */ - /* thread shall not have a CPU-time clock */ - /* accessible. */ - -/* Manifest Constants, P1003.1b-1993, p. 262 */ - -#define CLOCK_REALTIME (clockid_t)1 - -/* Flag indicating time is "absolute" with respect to the clock - associated with a time. */ - -#define TIMER_ABSTIME 4 - -/* Manifest Constants, P1003.4b/D8, p. 55 */ - -#if defined(_POSIX_CPUTIME) - -/* When used in a clock or timer function call, this is interpreted as - the identifier of the CPU_time clock associated with the PROCESS - making the function call. */ - -#define CLOCK_PROCESS_CPUTIME_ID (clockid_t)2 - -#endif - -#if defined(_POSIX_THREAD_CPUTIME) - -/* When used in a clock or timer function call, this is interpreted as - the identifier of the CPU_time clock associated with the THREAD - making the function call. */ - -#define CLOCK_THREAD_CPUTIME_ID (clockid_t)3 - -#endif - -#if defined(_POSIX_MONOTONIC_CLOCK) - -/* The identifier for the system-wide monotonic clock, which is defined - * as a clock whose value cannot be set via clock_settime() and which - * cannot have backward clock jumps. */ - -#define CLOCK_MONOTONIC (clockid_t)4 - -#endif - -#if defined(_POSIX_CPUTIME) - -/* Accessing a Process CPU-time CLock, P1003.4b/D8, p. 55 */ - -int _EXFUN(clock_getcpuclockid, (pid_t pid, clockid_t *clock_id)); - -#endif /* _POSIX_CPUTIME */ - -#if defined(_POSIX_CPUTIME) || defined(_POSIX_THREAD_CPUTIME) - -/* CPU-time Clock Attribute Access, P1003.4b/D8, p. 56 */ - -int _EXFUN(clock_setenable_attr, (clockid_t clock_id, int attr)); -int _EXFUN(clock_getenable_attr, (clockid_t clock_id, int *attr)); - -#endif /* _POSIX_CPUTIME or _POSIX_THREAD_CPUTIME */ - -#ifdef __cplusplus -} -#endif - -#endif /* _TIME_H_ */ - diff --git a/tools/sdk/include/newlib/unctrl.h b/tools/sdk/include/newlib/unctrl.h deleted file mode 100644 index 00407523295..00000000000 --- a/tools/sdk/include/newlib/unctrl.h +++ /dev/null @@ -1,46 +0,0 @@ -/* From curses.h. */ -/* - * Copyright (c) 1981, 1993 - * The Regents of the University of California. All rights reserved. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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 _UNCTRL_H_ -#define _UNCTRL_H_ - -#include <_ansi.h> - -#define unctrl(c) __unctrl[(c) & 0xff] -#define unctrllen(ch) __unctrllen[(ch) & 0xff] - -extern __IMPORT _CONST char * _CONST __unctrl[256]; /* Control strings. */ -extern __IMPORT _CONST char __unctrllen[256]; /* Control strings length. */ - -#endif /* _UNCTRL_H_ */ diff --git a/tools/sdk/include/newlib/unistd.h b/tools/sdk/include/newlib/unistd.h deleted file mode 100644 index 4f6fd29a4db..00000000000 --- a/tools/sdk/include/newlib/unistd.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _UNISTD_H_ -#define _UNISTD_H_ - -# include - -#ifndef L_SET -/* Old BSD names for the same constants; just for compatibility. */ -#define L_SET SEEK_SET -#define L_INCR SEEK_CUR -#define L_XTND SEEK_END -#endif - -#endif /* _UNISTD_H_ */ diff --git a/tools/sdk/include/newlib/utime.h b/tools/sdk/include/newlib/utime.h deleted file mode 100644 index 652891aab15..00000000000 --- a/tools/sdk/include/newlib/utime.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __cplusplus -extern "C" { -#endif - -#include <_ansi.h> - -/* The utime function is defined in libc/sys//sys if it exists. */ -#include - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/newlib/utmp.h b/tools/sdk/include/newlib/utmp.h deleted file mode 100644 index 88cf6f8528f..00000000000 --- a/tools/sdk/include/newlib/utmp.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifdef __cplusplus -extern "C" { -#endif -#include -#ifdef __cplusplus -} -#endif - diff --git a/tools/sdk/include/newlib/wchar.h b/tools/sdk/include/newlib/wchar.h deleted file mode 100644 index 810a6c0e337..00000000000 --- a/tools/sdk/include/newlib/wchar.h +++ /dev/null @@ -1,254 +0,0 @@ -#ifndef _WCHAR_H_ -#define _WCHAR_H_ - -#include <_ansi.h> - -#include - -#define __need_size_t -#define __need_wchar_t -#define __need_wint_t -#define __need_NULL -#include - -#define __need___va_list -#include - -/* For _mbstate_t definition. */ -#include -#include -/* For __STDC_ISO_10646__ */ -#include - -#ifndef WEOF -# define WEOF ((wint_t)-1) -#endif - -/* This must match definition in */ -#ifndef WCHAR_MIN -#ifdef __WCHAR_MIN__ -#define WCHAR_MIN __WCHAR_MIN__ -#elif defined(__WCHAR_UNSIGNED__) || (L'\0' - 1 > 0) -#define WCHAR_MIN (0 + L'\0') -#else -#define WCHAR_MIN (-0x7fffffff - 1 + L'\0') -#endif -#endif - -/* This must match definition in */ -#ifndef WCHAR_MAX -#ifdef __WCHAR_MAX__ -#define WCHAR_MAX __WCHAR_MAX__ -#elif defined(__WCHAR_UNSIGNED__) || (L'\0' - 1 > 0) -#define WCHAR_MAX (0xffffffffu + L'\0') -#else -#define WCHAR_MAX (0x7fffffff + L'\0') -#endif -#endif - -_BEGIN_STD_C - -/* As in stdio.h, defines __FILE. */ -typedef __FILE FILE; - -/* As required by POSIX.1-2008, declare tm as incomplete type. - The actual definition is in time.h. */ -struct tm; - -#ifndef _MBSTATE_T -#define _MBSTATE_T -typedef _mbstate_t mbstate_t; -#endif /* _MBSTATE_T */ - -wint_t _EXFUN(btowc, (int)); -int _EXFUN(wctob, (wint_t)); -size_t _EXFUN(mbrlen, (const char *__restrict, size_t, mbstate_t *__restrict)); -size_t _EXFUN(mbrtowc, (wchar_t *__restrict, const char *__restrict, size_t, - mbstate_t *__restrict)); -size_t _EXFUN(_mbrtowc_r, (struct _reent *, wchar_t * , const char * , - size_t, mbstate_t *)); -int _EXFUN(mbsinit, (const mbstate_t *)); -size_t _EXFUN(mbsnrtowcs, (wchar_t *__restrict, const char **__restrict, - size_t, size_t, mbstate_t *__restrict)); -size_t _EXFUN(_mbsnrtowcs_r, (struct _reent *, wchar_t * , const char ** , - size_t, size_t, mbstate_t *)); -size_t _EXFUN(mbsrtowcs, (wchar_t *__restrict, const char **__restrict, size_t, - mbstate_t *__restrict)); -size_t _EXFUN(_mbsrtowcs_r, (struct _reent *, wchar_t * , const char ** , size_t, mbstate_t *)); -size_t _EXFUN(wcrtomb, (char *__restrict, wchar_t, mbstate_t *__restrict)); -size_t _EXFUN(_wcrtomb_r, (struct _reent *, char * , wchar_t, mbstate_t *)); -size_t _EXFUN(wcsnrtombs, (char *__restrict, const wchar_t **__restrict, - size_t, size_t, mbstate_t *__restrict)); -size_t _EXFUN(_wcsnrtombs_r, (struct _reent *, char * , const wchar_t ** , - size_t, size_t, mbstate_t *)); -size_t _EXFUN(wcsrtombs, (char *__restrict, const wchar_t **__restrict, - size_t, mbstate_t *__restrict)); -size_t _EXFUN(_wcsrtombs_r, (struct _reent *, char * , const wchar_t ** , - size_t, mbstate_t *)); -int _EXFUN(wcscasecmp, (const wchar_t *, const wchar_t *)); -wchar_t *_EXFUN(wcscat, (wchar_t *__restrict, const wchar_t *__restrict)); -wchar_t *_EXFUN(wcschr, (const wchar_t *, wchar_t)); -int _EXFUN(wcscmp, (const wchar_t *, const wchar_t *)); -int _EXFUN(wcscoll, (const wchar_t *, const wchar_t *)); -wchar_t *_EXFUN(wcscpy, (wchar_t *__restrict, const wchar_t *__restrict)); -wchar_t *_EXFUN(wcpcpy, (wchar_t *__restrict, - const wchar_t *__restrict)); -wchar_t *_EXFUN(wcsdup, (const wchar_t *)); -wchar_t *_EXFUN(_wcsdup_r, (struct _reent *, const wchar_t * )); -size_t _EXFUN(wcscspn, (const wchar_t *, const wchar_t *)); -size_t _EXFUN(wcsftime, (wchar_t *__restrict, size_t, - const wchar_t *__restrict, const struct tm *__restrict)); -size_t _EXFUN(wcslcat, (wchar_t *, const wchar_t *, size_t)); -size_t _EXFUN(wcslcpy, (wchar_t *, const wchar_t *, size_t)); -size_t _EXFUN(wcslen, (const wchar_t *)); -int _EXFUN(wcsncasecmp, (const wchar_t *, const wchar_t *, size_t)); -wchar_t *_EXFUN(wcsncat, (wchar_t *__restrict, - const wchar_t *__restrict, size_t)); -int _EXFUN(wcsncmp, (const wchar_t *, const wchar_t *, size_t)); -wchar_t *_EXFUN(wcsncpy, (wchar_t *__restrict, - const wchar_t *__restrict, size_t)); -wchar_t *_EXFUN(wcpncpy, (wchar_t *__restrict, - const wchar_t *__restrict, size_t)); -size_t _EXFUN(wcsnlen, (const wchar_t *, size_t)); -wchar_t *_EXFUN(wcspbrk, (const wchar_t *, const wchar_t *)); -wchar_t *_EXFUN(wcsrchr, (const wchar_t *, wchar_t)); -size_t _EXFUN(wcsspn, (const wchar_t *, const wchar_t *)); -wchar_t *_EXFUN(wcsstr, (const wchar_t *__restrict, - const wchar_t *__restrict)); -wchar_t *_EXFUN(wcstok, (wchar_t *__restrict, const wchar_t *__restrict, - wchar_t **__restrict)); -double _EXFUN(wcstod, (const wchar_t *__restrict, wchar_t **__restrict)); -double _EXFUN(_wcstod_r, (struct _reent *, const wchar_t *, wchar_t **)); -float _EXFUN(wcstof, (const wchar_t *__restrict, wchar_t **__restrict)); -float _EXFUN(_wcstof_r, (struct _reent *, const wchar_t *, wchar_t **)); -#ifdef _LDBL_EQ_DBL -long double _EXFUN(wcstold, (const wchar_t *, wchar_t **)); -#endif /* _LDBL_EQ_DBL */ -int _EXFUN(wcswidth, (const wchar_t *, size_t)); -size_t _EXFUN(wcsxfrm, (wchar_t *__restrict, const wchar_t *__restrict, - size_t)); -int _EXFUN(wcwidth, (const wchar_t)); -wchar_t *_EXFUN(wmemchr, (const wchar_t *, wchar_t, size_t)); -int _EXFUN(wmemcmp, (const wchar_t *, const wchar_t *, size_t)); -wchar_t *_EXFUN(wmemcpy, (wchar_t *__restrict, const wchar_t *__restrict, - size_t)); -wchar_t *_EXFUN(wmemmove, (wchar_t *, const wchar_t *, size_t)); -wchar_t *_EXFUN(wmemset, (wchar_t *, wchar_t, size_t)); - -long _EXFUN(wcstol, (const wchar_t *__restrict, wchar_t **__restrict, int)); -long long _EXFUN(wcstoll, (const wchar_t *__restrict, wchar_t **__restrict, - int)); -unsigned long _EXFUN(wcstoul, (const wchar_t *__restrict, wchar_t **__restrict, - int)); -unsigned long long _EXFUN(wcstoull, (const wchar_t *__restrict, - wchar_t **__restrict, int)); -long _EXFUN(_wcstol_r, (struct _reent *, const wchar_t *, wchar_t **, int)); -long long _EXFUN(_wcstoll_r, (struct _reent *, const wchar_t *, wchar_t **, int)); -unsigned long _EXFUN(_wcstoul_r, (struct _reent *, const wchar_t *, wchar_t **, int)); -unsigned long long _EXFUN(_wcstoull_r, (struct _reent *, const wchar_t *, wchar_t **, int)); -/* On platforms where long double equals double. */ -#ifdef _LDBL_EQ_DBL -long double _EXFUN(wcstold, (const wchar_t *, wchar_t **)); -#endif /* _LDBL_EQ_DBL */ - -wint_t _EXFUN(fgetwc, (__FILE *)); -wchar_t *_EXFUN(fgetws, (wchar_t *__restrict, int, __FILE *__restrict)); -wint_t _EXFUN(fputwc, (wchar_t, __FILE *)); -int _EXFUN(fputws, (const wchar_t *__restrict, __FILE *__restrict)); -int _EXFUN (fwide, (__FILE *, int)); -wint_t _EXFUN (getwc, (__FILE *)); -wint_t _EXFUN (getwchar, (void)); -wint_t _EXFUN(putwc, (wchar_t, __FILE *)); -wint_t _EXFUN(putwchar, (wchar_t)); -wint_t _EXFUN (ungetwc, (wint_t wc, __FILE *)); - -wint_t _EXFUN(_fgetwc_r, (struct _reent *, __FILE *)); -wint_t _EXFUN(_fgetwc_unlocked_r, (struct _reent *, __FILE *)); -wchar_t *_EXFUN(_fgetws_r, (struct _reent *, wchar_t *, int, __FILE *)); -wchar_t *_EXFUN(_fgetws_unlocked_r, (struct _reent *, wchar_t *, int, __FILE *)); -wint_t _EXFUN(_fputwc_r, (struct _reent *, wchar_t, __FILE *)); -wint_t _EXFUN(_fputwc_unlocked_r, (struct _reent *, wchar_t, __FILE *)); -int _EXFUN(_fputws_r, (struct _reent *, const wchar_t *, __FILE *)); -int _EXFUN(_fputws_unlocked_r, (struct _reent *, const wchar_t *, __FILE *)); -int _EXFUN (_fwide_r, (struct _reent *, __FILE *, int)); -wint_t _EXFUN (_getwc_r, (struct _reent *, __FILE *)); -wint_t _EXFUN (_getwc_unlocked_r, (struct _reent *, __FILE *)); -wint_t _EXFUN (_getwchar_r, (struct _reent *ptr)); -wint_t _EXFUN (_getwchar_unlocked_r, (struct _reent *ptr)); -wint_t _EXFUN(_putwc_r, (struct _reent *, wchar_t, __FILE *)); -wint_t _EXFUN(_putwc_unlocked_r, (struct _reent *, wchar_t, __FILE *)); -wint_t _EXFUN(_putwchar_r, (struct _reent *, wchar_t)); -wint_t _EXFUN(_putwchar_unlocked_r, (struct _reent *, wchar_t)); -wint_t _EXFUN (_ungetwc_r, (struct _reent *, wint_t wc, __FILE *)); - -#if __GNU_VISIBLE -wint_t _EXFUN(fgetwc_unlocked, (__FILE *)); -wchar_t *_EXFUN(fgetws_unlocked, (wchar_t *__restrict, int, __FILE *__restrict)); -wint_t _EXFUN(fputwc_unlocked, (wchar_t, __FILE *)); -int _EXFUN(fputws_unlocked, (const wchar_t *__restrict, __FILE *__restrict)); -wint_t _EXFUN(getwc_unlocked, (__FILE *)); -wint_t _EXFUN(getwchar_unlocked, (void)); -wint_t _EXFUN(putwc_unlocked, (wchar_t, __FILE *)); -wint_t _EXFUN(putwchar_unlocked, (wchar_t)); -#endif - -__FILE *_EXFUN (open_wmemstream, (wchar_t **, size_t *)); -__FILE *_EXFUN (_open_wmemstream_r, (struct _reent *, wchar_t **, size_t *)); - -#ifndef __VALIST -#ifdef __GNUC__ -#define __VALIST __gnuc_va_list -#else -#define __VALIST char* -#endif -#endif - -int _EXFUN(fwprintf, (__FILE *__restrict, const wchar_t *__restrict, ...)); -int _EXFUN(swprintf, (wchar_t *__restrict, size_t, - const wchar_t *__restrict, ...)); -int _EXFUN(vfwprintf, (__FILE *__restrict, const wchar_t *__restrict, - __VALIST)); -int _EXFUN(vswprintf, (wchar_t *__restrict, size_t, - const wchar_t *__restrict, __VALIST)); -int _EXFUN(vwprintf, (const wchar_t *__restrict, __VALIST)); -int _EXFUN(wprintf, (const wchar_t *__restrict, ...)); - -int _EXFUN(_fwprintf_r, (struct _reent *, __FILE *, const wchar_t *, ...)); -int _EXFUN(_swprintf_r, (struct _reent *, wchar_t *, size_t, const wchar_t *, ...)); -int _EXFUN(_vfwprintf_r, (struct _reent *, __FILE *, const wchar_t *, __VALIST)); -int _EXFUN(_vswprintf_r, (struct _reent *, wchar_t *, size_t, const wchar_t *, __VALIST)); -int _EXFUN(_vwprintf_r, (struct _reent *, const wchar_t *, __VALIST)); -int _EXFUN(_wprintf_r, (struct _reent *, const wchar_t *, ...)); - -int _EXFUN(fwscanf, (__FILE *__restrict, const wchar_t *__restrict, ...)); -int _EXFUN(swscanf, (const wchar_t *__restrict, - const wchar_t *__restrict, ...)); -int _EXFUN(vfwscanf, (__FILE *__restrict, const wchar_t *__restrict, - __VALIST)); -int _EXFUN(vswscanf, (const wchar_t *__restrict, const wchar_t *__restrict, - __VALIST)); -int _EXFUN(vwscanf, (const wchar_t *__restrict, __VALIST)); -int _EXFUN(wscanf, (const wchar_t *__restrict, ...)); - -int _EXFUN(_fwscanf_r, (struct _reent *, __FILE *, const wchar_t *, ...)); -int _EXFUN(_swscanf_r, (struct _reent *, const wchar_t *, const wchar_t *, ...)); -int _EXFUN(_vfwscanf_r, (struct _reent *, __FILE *, const wchar_t *, __VALIST)); -int _EXFUN(_vswscanf_r, (struct _reent *, const wchar_t *, const wchar_t *, __VALIST)); -int _EXFUN(_vwscanf_r, (struct _reent *, const wchar_t *, __VALIST)); -int _EXFUN(_wscanf_r, (struct _reent *, const wchar_t *, ...)); - -#define getwc(fp) fgetwc(fp) -#define putwc(wc,fp) fputwc((wc), (fp)) -#define getwchar() fgetwc(_REENT->_stdin) -#define putwchar(wc) fputwc((wc), _REENT->_stdout) - -#if __GNU_VISIBLE -#define getwc_unlocked(fp) fgetwc_unlocked(fp) -#define putwc_unlocked(wc,fp) fputwc_unlocked((wc), (fp)) -#define getwchar_unlocked() fgetwc_unlocked(_REENT->_stdin) -#define putwchar_unlocked(wc) fputwc_unlocked((wc), _REENT->_stdout) -#endif - -_END_STD_C - -#endif /* _WCHAR_H_ */ diff --git a/tools/sdk/include/newlib/wctype.h b/tools/sdk/include/newlib/wctype.h deleted file mode 100644 index c72c9decff0..00000000000 --- a/tools/sdk/include/newlib/wctype.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _WCTYPE_H_ -#define _WCTYPE_H_ - -#include <_ansi.h> -#include - -#define __need_wint_t -#include - -#ifndef WEOF -# define WEOF ((wint_t)-1) -#endif - -_BEGIN_STD_C - -#ifndef _WCTYPE_T -#define _WCTYPE_T -typedef int wctype_t; -#endif - -#ifndef _WCTRANS_T -#define _WCTRANS_T -typedef int wctrans_t; -#endif - -int _EXFUN(iswalpha, (wint_t)); -int _EXFUN(iswalnum, (wint_t)); -int _EXFUN(iswblank, (wint_t)); -int _EXFUN(iswcntrl, (wint_t)); -int _EXFUN(iswctype, (wint_t, wctype_t)); -int _EXFUN(iswdigit, (wint_t)); -int _EXFUN(iswgraph, (wint_t)); -int _EXFUN(iswlower, (wint_t)); -int _EXFUN(iswprint, (wint_t)); -int _EXFUN(iswpunct, (wint_t)); -int _EXFUN(iswspace, (wint_t)); -int _EXFUN(iswupper, (wint_t)); -int _EXFUN(iswxdigit, (wint_t)); -wint_t _EXFUN(towctrans, (wint_t, wctrans_t)); -wint_t _EXFUN(towupper, (wint_t)); -wint_t _EXFUN(towlower, (wint_t)); -wctrans_t _EXFUN(wctrans, (const char *)); -wctype_t _EXFUN(wctype, (const char *)); - -_END_STD_C - -#endif /* _WCTYPE_H_ */ diff --git a/tools/sdk/include/newlib/wordexp.h b/tools/sdk/include/newlib/wordexp.h deleted file mode 100644 index 1f09a64c5ed..00000000000 --- a/tools/sdk/include/newlib/wordexp.h +++ /dev/null @@ -1,53 +0,0 @@ -/* Copyright (C) 2002, 2010 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#ifndef _WORDEXP_H_ -#define _WORDEXP_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct _wordexp_t -{ - size_t we_wordc; /* Count of words matched by words. */ - char **we_wordv; /* Pointer to list of expanded words. */ - size_t we_offs; /* Slots to reserve at the beginning of we_wordv. */ -}; - -typedef struct _wordexp_t wordexp_t; - -#define WRDE_DOOFFS 0x0001 /* Use we_offs. */ -#define WRDE_APPEND 0x0002 /* Append to output from previous call. */ -#define WRDE_NOCMD 0x0004 /* Don't perform command substitution. */ -#define WRDE_REUSE 0x0008 /* pwordexp points to a wordexp_t struct returned from - a previous successful call to wordexp. */ -#define WRDE_SHOWERR 0x0010 /* Print error messages to stderr. */ -#define WRDE_UNDEF 0x0020 /* Report attempt to expand undefined shell variable. */ - -enum { - WRDE_SUCCESS, - WRDE_NOSPACE, - WRDE_BADCHAR, - WRDE_BADVAL, - WRDE_CMDSUB, - WRDE_SYNTAX, - WRDE_NOSYS -}; - -/* Note: This implementation of wordexp requires a version of bash - that supports the --wordexp and --protected arguments to be present - on the system. It does not support the WRDE_UNDEF flag. */ -int wordexp(const char *__restrict, wordexp_t *__restrict, int); -void wordfree(wordexp_t *); - -#ifdef __cplusplus -} -#endif - -#endif /* _WORDEXP_H_ */ diff --git a/tools/sdk/include/newlib/xtensa/config/core-isa.h b/tools/sdk/include/newlib/xtensa/config/core-isa.h deleted file mode 100644 index f3f4e45f001..00000000000 --- a/tools/sdk/include/newlib/xtensa/config/core-isa.h +++ /dev/null @@ -1,655 +0,0 @@ -/* - * xtensa/config/core-isa.h -- HAL definitions that are dependent on Xtensa - * processor CORE configuration - * - * See , which includes this file, for more details. - */ - -/* Xtensa processor core configuration information. - - Copyright (c) 1999-2016 Tensilica Inc. - - 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. */ - -#ifndef _XTENSA_CORE_CONFIGURATION_H -#define _XTENSA_CORE_CONFIGURATION_H - - -/**************************************************************************** - Parameters Useful for Any Code, USER or PRIVILEGED - ****************************************************************************/ - -/* - * Note: Macros of the form XCHAL_HAVE_*** have a value of 1 if the option is - * configured, and a value of 0 otherwise. These macros are always defined. - */ - - -/*---------------------------------------------------------------------- - ISA - ----------------------------------------------------------------------*/ - -#define XCHAL_HAVE_BE 0 /* big-endian byte ordering */ -#define XCHAL_HAVE_WINDOWED 1 /* windowed registers option */ -#define XCHAL_NUM_AREGS 64 /* num of physical addr regs */ -#define XCHAL_NUM_AREGS_LOG2 6 /* log2(XCHAL_NUM_AREGS) */ -#define XCHAL_MAX_INSTRUCTION_SIZE 3 /* max instr bytes (3..8) */ -#define XCHAL_HAVE_DEBUG 1 /* debug option */ -#define XCHAL_HAVE_DENSITY 1 /* 16-bit instructions */ -#define XCHAL_HAVE_LOOPS 1 /* zero-overhead loops */ -#define XCHAL_LOOP_BUFFER_SIZE 256 /* zero-ov. loop instr buffer size */ -#define XCHAL_HAVE_NSA 1 /* NSA/NSAU instructions */ -#define XCHAL_HAVE_MINMAX 1 /* MIN/MAX instructions */ -#define XCHAL_HAVE_SEXT 1 /* SEXT instruction */ -#define XCHAL_HAVE_DEPBITS 0 /* DEPBITS instruction */ -#define XCHAL_HAVE_CLAMPS 1 /* CLAMPS instruction */ -#define XCHAL_HAVE_MUL16 1 /* MUL16S/MUL16U instructions */ -#define XCHAL_HAVE_MUL32 1 /* MULL instruction */ -#define XCHAL_HAVE_MUL32_HIGH 1 /* MULUH/MULSH instructions */ -#define XCHAL_HAVE_DIV32 1 /* QUOS/QUOU/REMS/REMU instructions */ -#define XCHAL_HAVE_L32R 1 /* L32R instruction */ -#define XCHAL_HAVE_ABSOLUTE_LITERALS 0 /* non-PC-rel (extended) L32R */ -#define XCHAL_HAVE_CONST16 0 /* CONST16 instruction */ -#define XCHAL_HAVE_ADDX 1 /* ADDX#/SUBX# instructions */ -#define XCHAL_HAVE_WIDE_BRANCHES 0 /* B*.W18 or B*.W15 instr's */ -#define XCHAL_HAVE_PREDICTED_BRANCHES 0 /* B[EQ/EQZ/NE/NEZ]T instr's */ -#define XCHAL_HAVE_CALL4AND12 1 /* (obsolete option) */ -#define XCHAL_HAVE_ABS 1 /* ABS instruction */ -/*#define XCHAL_HAVE_POPC 0*/ /* POPC instruction */ -/*#define XCHAL_HAVE_CRC 0*/ /* CRC instruction */ -#define XCHAL_HAVE_RELEASE_SYNC 1 /* L32AI/S32RI instructions */ -#define XCHAL_HAVE_S32C1I 1 /* S32C1I instruction */ -#define XCHAL_HAVE_SPECULATION 0 /* speculation */ -#define XCHAL_HAVE_FULL_RESET 1 /* all regs/state reset */ -#define XCHAL_NUM_CONTEXTS 1 /* */ -#define XCHAL_NUM_MISC_REGS 4 /* num of scratch regs (0..4) */ -#define XCHAL_HAVE_TAP_MASTER 0 /* JTAG TAP control instr's */ -#define XCHAL_HAVE_PRID 1 /* processor ID register */ -#define XCHAL_HAVE_EXTERN_REGS 1 /* WER/RER instructions */ -#define XCHAL_HAVE_MX 0 /* MX core (Tensilica internal) */ -#define XCHAL_HAVE_MP_INTERRUPTS 0 /* interrupt distributor port */ -#define XCHAL_HAVE_MP_RUNSTALL 0 /* core RunStall control port */ -#define XCHAL_HAVE_PSO 0 /* Power Shut-Off */ -#define XCHAL_HAVE_PSO_CDM 0 /* core/debug/mem pwr domains */ -#define XCHAL_HAVE_PSO_FULL_RETENTION 0 /* all regs preserved on PSO */ -#define XCHAL_HAVE_THREADPTR 1 /* THREADPTR register */ -#define XCHAL_HAVE_BOOLEANS 1 /* boolean registers */ -#define XCHAL_HAVE_CP 1 /* CPENABLE reg (coprocessor) */ -#define XCHAL_CP_MAXCFG 8 /* max allowed cp id plus one */ -#define XCHAL_HAVE_MAC16 1 /* MAC16 package */ - -#define XCHAL_HAVE_FUSION 0 /* Fusion*/ -#define XCHAL_HAVE_FUSION_FP 0 /* Fusion FP option */ -#define XCHAL_HAVE_FUSION_LOW_POWER 0 /* Fusion Low Power option */ -#define XCHAL_HAVE_FUSION_AES 0 /* Fusion BLE/Wifi AES-128 CCM option */ -#define XCHAL_HAVE_FUSION_CONVENC 0 /* Fusion Conv Encode option */ -#define XCHAL_HAVE_FUSION_LFSR_CRC 0 /* Fusion LFSR-CRC option */ -#define XCHAL_HAVE_FUSION_BITOPS 0 /* Fusion Bit Operations Support option */ -#define XCHAL_HAVE_FUSION_AVS 0 /* Fusion AVS option */ -#define XCHAL_HAVE_FUSION_16BIT_BASEBAND 0 /* Fusion 16-bit Baseband option */ -#define XCHAL_HAVE_FUSION_VITERBI 0 /* Fusion Viterbi option */ -#define XCHAL_HAVE_FUSION_SOFTDEMAP 0 /* Fusion Soft Bit Demap option */ -#define XCHAL_HAVE_HIFIPRO 0 /* HiFiPro Audio Engine pkg */ -#define XCHAL_HAVE_HIFI4 0 /* HiFi4 Audio Engine pkg */ -#define XCHAL_HAVE_HIFI4_VFPU 0 /* HiFi4 Audio Engine VFPU option */ -#define XCHAL_HAVE_HIFI3 0 /* HiFi3 Audio Engine pkg */ -#define XCHAL_HAVE_HIFI3_VFPU 0 /* HiFi3 Audio Engine VFPU option */ -#define XCHAL_HAVE_HIFI2 0 /* HiFi2 Audio Engine pkg */ -#define XCHAL_HAVE_HIFI2EP 0 /* HiFi2EP */ -#define XCHAL_HAVE_HIFI_MINI 0 - - -#define XCHAL_HAVE_VECTORFPU2005 0 /* vector or user floating-point pkg */ -#define XCHAL_HAVE_USER_DPFPU 0 /* user DP floating-point pkg */ -#define XCHAL_HAVE_USER_SPFPU 0 /* user DP floating-point pkg */ -#define XCHAL_HAVE_FP 1 /* single prec floating point */ -#define XCHAL_HAVE_FP_DIV 1 /* FP with DIV instructions */ -#define XCHAL_HAVE_FP_RECIP 1 /* FP with RECIP instructions */ -#define XCHAL_HAVE_FP_SQRT 1 /* FP with SQRT instructions */ -#define XCHAL_HAVE_FP_RSQRT 1 /* FP with RSQRT instructions */ -#define XCHAL_HAVE_DFP 0 /* double precision FP pkg */ -#define XCHAL_HAVE_DFP_DIV 0 /* DFP with DIV instructions */ -#define XCHAL_HAVE_DFP_RECIP 0 /* DFP with RECIP instructions*/ -#define XCHAL_HAVE_DFP_SQRT 0 /* DFP with SQRT instructions */ -#define XCHAL_HAVE_DFP_RSQRT 0 /* DFP with RSQRT instructions*/ -#define XCHAL_HAVE_DFP_ACCEL 1 /* double precision FP acceleration pkg */ -#define XCHAL_HAVE_DFP_accel XCHAL_HAVE_DFP_ACCEL /* for backward compatibility */ - -#define XCHAL_HAVE_DFPU_SINGLE_ONLY 1 /* DFPU Coprocessor, single precision only */ -#define XCHAL_HAVE_DFPU_SINGLE_DOUBLE 0 /* DFPU Coprocessor, single and double precision */ -#define XCHAL_HAVE_VECTRA1 0 /* Vectra I pkg */ -#define XCHAL_HAVE_VECTRALX 0 /* Vectra LX pkg */ -#define XCHAL_HAVE_PDX4 0 /* PDX4 */ -#define XCHAL_HAVE_CONNXD2 0 /* ConnX D2 pkg */ -#define XCHAL_HAVE_CONNXD2_DUALLSFLIX 0 /* ConnX D2 & Dual LoadStore Flix */ -#define XCHAL_HAVE_BBE16 0 /* ConnX BBE16 pkg */ -#define XCHAL_HAVE_BBE16_RSQRT 0 /* BBE16 & vector recip sqrt */ -#define XCHAL_HAVE_BBE16_VECDIV 0 /* BBE16 & vector divide */ -#define XCHAL_HAVE_BBE16_DESPREAD 0 /* BBE16 & despread */ -#define XCHAL_HAVE_BBENEP 0 /* ConnX BBENEP pkgs */ -#define XCHAL_HAVE_BSP3 0 /* ConnX BSP3 pkg */ -#define XCHAL_HAVE_BSP3_TRANSPOSE 0 /* BSP3 & transpose32x32 */ -#define XCHAL_HAVE_SSP16 0 /* ConnX SSP16 pkg */ -#define XCHAL_HAVE_SSP16_VITERBI 0 /* SSP16 & viterbi */ -#define XCHAL_HAVE_TURBO16 0 /* ConnX Turbo16 pkg */ -#define XCHAL_HAVE_BBP16 0 /* ConnX BBP16 pkg */ -#define XCHAL_HAVE_FLIX3 0 /* basic 3-way FLIX option */ -#define XCHAL_HAVE_GRIVPEP 0 /* GRIVPEP is General Release of IVPEP */ -#define XCHAL_HAVE_GRIVPEP_HISTOGRAM 0 /* Histogram option on GRIVPEP */ - - -/*---------------------------------------------------------------------- - MISC - ----------------------------------------------------------------------*/ - -#define XCHAL_NUM_LOADSTORE_UNITS 1 /* load/store units */ -#define XCHAL_NUM_WRITEBUFFER_ENTRIES 4 /* size of write buffer */ -#define XCHAL_INST_FETCH_WIDTH 4 /* instr-fetch width in bytes */ -#define XCHAL_DATA_WIDTH 4 /* data width in bytes */ -#define XCHAL_DATA_PIPE_DELAY 2 /* d-side pipeline delay - (1 = 5-stage, 2 = 7-stage) */ -#define XCHAL_CLOCK_GATING_GLOBAL 1 /* global clock gating */ -#define XCHAL_CLOCK_GATING_FUNCUNIT 1 /* funct. unit clock gating */ -/* In T1050, applies to selected core load and store instructions (see ISA): */ -#define XCHAL_UNALIGNED_LOAD_EXCEPTION 0 /* unaligned loads cause exc. */ -#define XCHAL_UNALIGNED_STORE_EXCEPTION 0 /* unaligned stores cause exc.*/ -#define XCHAL_UNALIGNED_LOAD_HW 1 /* unaligned loads work in hw */ -#define XCHAL_UNALIGNED_STORE_HW 1 /* unaligned stores work in hw*/ - -#define XCHAL_SW_VERSION 1100003 /* sw version of this header */ - -#define XCHAL_CORE_ID "esp32_v3_49_prod" /* alphanum core name - (CoreID) set in the Xtensa - Processor Generator */ - -#define XCHAL_BUILD_UNIQUE_ID 0x0005FE96 /* 22-bit sw build ID */ - -/* - * These definitions describe the hardware targeted by this software. - */ -#define XCHAL_HW_CONFIGID0 0xC2BCFFFE /* ConfigID hi 32 bits*/ -#define XCHAL_HW_CONFIGID1 0x1CC5FE96 /* ConfigID lo 32 bits*/ -#define XCHAL_HW_VERSION_NAME "LX6.0.3" /* full version name */ -#define XCHAL_HW_VERSION_MAJOR 2600 /* major ver# of targeted hw */ -#define XCHAL_HW_VERSION_MINOR 3 /* minor ver# of targeted hw */ -#define XCHAL_HW_VERSION 260003 /* major*100+minor */ -#define XCHAL_HW_REL_LX6 1 -#define XCHAL_HW_REL_LX6_0 1 -#define XCHAL_HW_REL_LX6_0_3 1 -#define XCHAL_HW_CONFIGID_RELIABLE 1 -/* If software targets a *range* of hardware versions, these are the bounds: */ -#define XCHAL_HW_MIN_VERSION_MAJOR 2600 /* major v of earliest tgt hw */ -#define XCHAL_HW_MIN_VERSION_MINOR 3 /* minor v of earliest tgt hw */ -#define XCHAL_HW_MIN_VERSION 260003 /* earliest targeted hw */ -#define XCHAL_HW_MAX_VERSION_MAJOR 2600 /* major v of latest tgt hw */ -#define XCHAL_HW_MAX_VERSION_MINOR 3 /* minor v of latest tgt hw */ -#define XCHAL_HW_MAX_VERSION 260003 /* latest targeted hw */ - - -/*---------------------------------------------------------------------- - CACHE - ----------------------------------------------------------------------*/ - -#define XCHAL_ICACHE_LINESIZE 4 /* I-cache line size in bytes */ -#define XCHAL_DCACHE_LINESIZE 4 /* D-cache line size in bytes */ -#define XCHAL_ICACHE_LINEWIDTH 2 /* log2(I line size in bytes) */ -#define XCHAL_DCACHE_LINEWIDTH 2 /* log2(D line size in bytes) */ - -#define XCHAL_ICACHE_SIZE 0 /* I-cache size in bytes or 0 */ -#define XCHAL_DCACHE_SIZE 0 /* D-cache size in bytes or 0 */ - -#define XCHAL_DCACHE_IS_WRITEBACK 0 /* writeback feature */ -#define XCHAL_DCACHE_IS_COHERENT 0 /* MP coherence feature */ - -#define XCHAL_HAVE_PREFETCH 0 /* PREFCTL register */ -#define XCHAL_HAVE_PREFETCH_L1 0 /* prefetch to L1 dcache */ -#define XCHAL_PREFETCH_CASTOUT_LINES 0 /* dcache pref. castout bufsz */ -#define XCHAL_PREFETCH_ENTRIES 0 /* cache prefetch entries */ -#define XCHAL_PREFETCH_BLOCK_ENTRIES 0 /* prefetch block streams */ -#define XCHAL_HAVE_CACHE_BLOCKOPS 0 /* block prefetch for caches */ -#define XCHAL_HAVE_ICACHE_TEST 0 /* Icache test instructions */ -#define XCHAL_HAVE_DCACHE_TEST 0 /* Dcache test instructions */ -#define XCHAL_HAVE_ICACHE_DYN_WAYS 0 /* Icache dynamic way support */ -#define XCHAL_HAVE_DCACHE_DYN_WAYS 0 /* Dcache dynamic way support */ - - - - -/**************************************************************************** - Parameters Useful for PRIVILEGED (Supervisory or Non-Virtualized) Code - ****************************************************************************/ - - -#ifndef XTENSA_HAL_NON_PRIVILEGED_ONLY - -/*---------------------------------------------------------------------- - CACHE - ----------------------------------------------------------------------*/ - -#define XCHAL_HAVE_PIF 1 /* any outbound PIF present */ -#define XCHAL_HAVE_AXI 0 /* AXI bus */ - -#define XCHAL_HAVE_PIF_WR_RESP 0 /* pif write response */ -#define XCHAL_HAVE_PIF_REQ_ATTR 0 /* pif attribute */ - -/* If present, cache size in bytes == (ways * 2^(linewidth + setwidth)). */ - -/* Number of cache sets in log2(lines per way): */ -#define XCHAL_ICACHE_SETWIDTH 0 -#define XCHAL_DCACHE_SETWIDTH 0 - -/* Cache set associativity (number of ways): */ -#define XCHAL_ICACHE_WAYS 1 -#define XCHAL_DCACHE_WAYS 1 - -/* Cache features: */ -#define XCHAL_ICACHE_LINE_LOCKABLE 0 -#define XCHAL_DCACHE_LINE_LOCKABLE 0 -#define XCHAL_ICACHE_ECC_PARITY 0 -#define XCHAL_DCACHE_ECC_PARITY 0 - -/* Cache access size in bytes (affects operation of SICW instruction): */ -#define XCHAL_ICACHE_ACCESS_SIZE 1 -#define XCHAL_DCACHE_ACCESS_SIZE 1 - -#define XCHAL_DCACHE_BANKS 0 /* number of banks */ - -/* Number of encoded cache attr bits (see for decoded bits): */ -#define XCHAL_CA_BITS 4 - - -/*---------------------------------------------------------------------- - INTERNAL I/D RAM/ROMs and XLMI - ----------------------------------------------------------------------*/ - -#define XCHAL_NUM_INSTROM 1 /* number of core instr. ROMs */ -#define XCHAL_NUM_INSTRAM 2 /* number of core instr. RAMs */ -#define XCHAL_NUM_DATAROM 1 /* number of core data ROMs */ -#define XCHAL_NUM_DATARAM 2 /* number of core data RAMs */ -#define XCHAL_NUM_URAM 0 /* number of core unified RAMs*/ -#define XCHAL_NUM_XLMI 1 /* number of core XLMI ports */ - -/* Instruction ROM 0: */ -#define XCHAL_INSTROM0_VADDR 0x40800000 /* virtual address */ -#define XCHAL_INSTROM0_PADDR 0x40800000 /* physical address */ -#define XCHAL_INSTROM0_SIZE 4194304 /* size in bytes */ -#define XCHAL_INSTROM0_ECC_PARITY 0 /* ECC/parity type, 0=none */ - -/* Instruction RAM 0: */ -#define XCHAL_INSTRAM0_VADDR 0x40000000 /* virtual address */ -#define XCHAL_INSTRAM0_PADDR 0x40000000 /* physical address */ -#define XCHAL_INSTRAM0_SIZE 4194304 /* size in bytes */ -#define XCHAL_INSTRAM0_ECC_PARITY 0 /* ECC/parity type, 0=none */ - -/* Instruction RAM 1: */ -#define XCHAL_INSTRAM1_VADDR 0x40400000 /* virtual address */ -#define XCHAL_INSTRAM1_PADDR 0x40400000 /* physical address */ -#define XCHAL_INSTRAM1_SIZE 4194304 /* size in bytes */ -#define XCHAL_INSTRAM1_ECC_PARITY 0 /* ECC/parity type, 0=none */ - -/* Data ROM 0: */ -#define XCHAL_DATAROM0_VADDR 0x3F400000 /* virtual address */ -#define XCHAL_DATAROM0_PADDR 0x3F400000 /* physical address */ -#define XCHAL_DATAROM0_SIZE 4194304 /* size in bytes */ -#define XCHAL_DATAROM0_ECC_PARITY 0 /* ECC/parity type, 0=none */ -#define XCHAL_DATAROM0_BANKS 1 /* number of banks */ - -/* Data RAM 0: */ -#define XCHAL_DATARAM0_VADDR 0x3FF80000 /* virtual address */ -#define XCHAL_DATARAM0_PADDR 0x3FF80000 /* physical address */ -#define XCHAL_DATARAM0_SIZE 524288 /* size in bytes */ -#define XCHAL_DATARAM0_ECC_PARITY 0 /* ECC/parity type, 0=none */ -#define XCHAL_DATARAM0_BANKS 1 /* number of banks */ - -/* Data RAM 1: */ -#define XCHAL_DATARAM1_VADDR 0x3F800000 /* virtual address */ -#define XCHAL_DATARAM1_PADDR 0x3F800000 /* physical address */ -#define XCHAL_DATARAM1_SIZE 4194304 /* size in bytes */ -#define XCHAL_DATARAM1_ECC_PARITY 0 /* ECC/parity type, 0=none */ -#define XCHAL_DATARAM1_BANKS 1 /* number of banks */ - -/* XLMI Port 0: */ -#define XCHAL_XLMI0_VADDR 0x3FF00000 /* virtual address */ -#define XCHAL_XLMI0_PADDR 0x3FF00000 /* physical address */ -#define XCHAL_XLMI0_SIZE 524288 /* size in bytes */ -#define XCHAL_XLMI0_ECC_PARITY 0 /* ECC/parity type, 0=none */ - -#define XCHAL_HAVE_IMEM_LOADSTORE 1 /* can load/store to IROM/IRAM*/ - - -/*---------------------------------------------------------------------- - INTERRUPTS and TIMERS - ----------------------------------------------------------------------*/ - -#define XCHAL_HAVE_INTERRUPTS 1 /* interrupt option */ -#define XCHAL_HAVE_HIGHPRI_INTERRUPTS 1 /* med/high-pri. interrupts */ -#define XCHAL_HAVE_NMI 1 /* non-maskable interrupt */ -#define XCHAL_HAVE_CCOUNT 1 /* CCOUNT reg. (timer option) */ -#define XCHAL_NUM_TIMERS 3 /* number of CCOMPAREn regs */ -#define XCHAL_NUM_INTERRUPTS 32 /* number of interrupts */ -#define XCHAL_NUM_INTERRUPTS_LOG2 5 /* ceil(log2(NUM_INTERRUPTS)) */ -#define XCHAL_NUM_EXTINTERRUPTS 26 /* num of external interrupts */ -#define XCHAL_NUM_INTLEVELS 6 /* number of interrupt levels - (not including level zero) */ -#define XCHAL_EXCM_LEVEL 3 /* level masked by PS.EXCM */ - /* (always 1 in XEA1; levels 2 .. EXCM_LEVEL are "medium priority") */ - -/* Masks of interrupts at each interrupt level: */ -#define XCHAL_INTLEVEL1_MASK 0x000637FF -#define XCHAL_INTLEVEL2_MASK 0x00380000 -#define XCHAL_INTLEVEL3_MASK 0x28C08800 -#define XCHAL_INTLEVEL4_MASK 0x53000000 -#define XCHAL_INTLEVEL5_MASK 0x84010000 -#define XCHAL_INTLEVEL6_MASK 0x00000000 -#define XCHAL_INTLEVEL7_MASK 0x00004000 - -/* Masks of interrupts at each range 1..n of interrupt levels: */ -#define XCHAL_INTLEVEL1_ANDBELOW_MASK 0x000637FF -#define XCHAL_INTLEVEL2_ANDBELOW_MASK 0x003E37FF -#define XCHAL_INTLEVEL3_ANDBELOW_MASK 0x28FEBFFF -#define XCHAL_INTLEVEL4_ANDBELOW_MASK 0x7BFEBFFF -#define XCHAL_INTLEVEL5_ANDBELOW_MASK 0xFFFFBFFF -#define XCHAL_INTLEVEL6_ANDBELOW_MASK 0xFFFFBFFF -#define XCHAL_INTLEVEL7_ANDBELOW_MASK 0xFFFFFFFF - -/* Level of each interrupt: */ -#define XCHAL_INT0_LEVEL 1 -#define XCHAL_INT1_LEVEL 1 -#define XCHAL_INT2_LEVEL 1 -#define XCHAL_INT3_LEVEL 1 -#define XCHAL_INT4_LEVEL 1 -#define XCHAL_INT5_LEVEL 1 -#define XCHAL_INT6_LEVEL 1 -#define XCHAL_INT7_LEVEL 1 -#define XCHAL_INT8_LEVEL 1 -#define XCHAL_INT9_LEVEL 1 -#define XCHAL_INT10_LEVEL 1 -#define XCHAL_INT11_LEVEL 3 -#define XCHAL_INT12_LEVEL 1 -#define XCHAL_INT13_LEVEL 1 -#define XCHAL_INT14_LEVEL 7 -#define XCHAL_INT15_LEVEL 3 -#define XCHAL_INT16_LEVEL 5 -#define XCHAL_INT17_LEVEL 1 -#define XCHAL_INT18_LEVEL 1 -#define XCHAL_INT19_LEVEL 2 -#define XCHAL_INT20_LEVEL 2 -#define XCHAL_INT21_LEVEL 2 -#define XCHAL_INT22_LEVEL 3 -#define XCHAL_INT23_LEVEL 3 -#define XCHAL_INT24_LEVEL 4 -#define XCHAL_INT25_LEVEL 4 -#define XCHAL_INT26_LEVEL 5 -#define XCHAL_INT27_LEVEL 3 -#define XCHAL_INT28_LEVEL 4 -#define XCHAL_INT29_LEVEL 3 -#define XCHAL_INT30_LEVEL 4 -#define XCHAL_INT31_LEVEL 5 -#define XCHAL_DEBUGLEVEL 6 /* debug interrupt level */ -#define XCHAL_HAVE_DEBUG_EXTERN_INT 1 /* OCD external db interrupt */ -#define XCHAL_NMILEVEL 7 /* NMI "level" (for use with - EXCSAVE/EPS/EPC_n, RFI n) */ - -/* Type of each interrupt: */ -#define XCHAL_INT0_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT1_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT2_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT3_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT4_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT5_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT6_TYPE XTHAL_INTTYPE_TIMER -#define XCHAL_INT7_TYPE XTHAL_INTTYPE_SOFTWARE -#define XCHAL_INT8_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT9_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT10_TYPE XTHAL_INTTYPE_EXTERN_EDGE -#define XCHAL_INT11_TYPE XTHAL_INTTYPE_PROFILING -#define XCHAL_INT12_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT13_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT14_TYPE XTHAL_INTTYPE_NMI -#define XCHAL_INT15_TYPE XTHAL_INTTYPE_TIMER -#define XCHAL_INT16_TYPE XTHAL_INTTYPE_TIMER -#define XCHAL_INT17_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT18_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT19_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT20_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT21_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT22_TYPE XTHAL_INTTYPE_EXTERN_EDGE -#define XCHAL_INT23_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT24_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT25_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT26_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT27_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT28_TYPE XTHAL_INTTYPE_EXTERN_EDGE -#define XCHAL_INT29_TYPE XTHAL_INTTYPE_SOFTWARE -#define XCHAL_INT30_TYPE XTHAL_INTTYPE_EXTERN_EDGE -#define XCHAL_INT31_TYPE XTHAL_INTTYPE_EXTERN_LEVEL - -/* Masks of interrupts for each type of interrupt: */ -#define XCHAL_INTTYPE_MASK_UNCONFIGURED 0x00000000 -#define XCHAL_INTTYPE_MASK_SOFTWARE 0x20000080 -#define XCHAL_INTTYPE_MASK_EXTERN_EDGE 0x50400400 -#define XCHAL_INTTYPE_MASK_EXTERN_LEVEL 0x8FBE333F -#define XCHAL_INTTYPE_MASK_TIMER 0x00018040 -#define XCHAL_INTTYPE_MASK_NMI 0x00004000 -#define XCHAL_INTTYPE_MASK_WRITE_ERROR 0x00000000 -#define XCHAL_INTTYPE_MASK_PROFILING 0x00000800 - -/* Interrupt numbers assigned to specific interrupt sources: */ -#define XCHAL_TIMER0_INTERRUPT 6 /* CCOMPARE0 */ -#define XCHAL_TIMER1_INTERRUPT 15 /* CCOMPARE1 */ -#define XCHAL_TIMER2_INTERRUPT 16 /* CCOMPARE2 */ -#define XCHAL_TIMER3_INTERRUPT XTHAL_TIMER_UNCONFIGURED -#define XCHAL_NMI_INTERRUPT 14 /* non-maskable interrupt */ -#define XCHAL_PROFILING_INTERRUPT 11 /* profiling interrupt */ - -/* Interrupt numbers for levels at which only one interrupt is configured: */ -#define XCHAL_INTLEVEL7_NUM 14 -/* (There are many interrupts each at level(s) 1, 2, 3, 4, 5.) */ - - -/* - * External interrupt mapping. - * These macros describe how Xtensa processor interrupt numbers - * (as numbered internally, eg. in INTERRUPT and INTENABLE registers) - * map to external BInterrupt pins, for those interrupts - * configured as external (level-triggered, edge-triggered, or NMI). - * See the Xtensa processor databook for more details. - */ - -/* Core interrupt numbers mapped to each EXTERNAL BInterrupt pin number: */ -#define XCHAL_EXTINT0_NUM 0 /* (intlevel 1) */ -#define XCHAL_EXTINT1_NUM 1 /* (intlevel 1) */ -#define XCHAL_EXTINT2_NUM 2 /* (intlevel 1) */ -#define XCHAL_EXTINT3_NUM 3 /* (intlevel 1) */ -#define XCHAL_EXTINT4_NUM 4 /* (intlevel 1) */ -#define XCHAL_EXTINT5_NUM 5 /* (intlevel 1) */ -#define XCHAL_EXTINT6_NUM 8 /* (intlevel 1) */ -#define XCHAL_EXTINT7_NUM 9 /* (intlevel 1) */ -#define XCHAL_EXTINT8_NUM 10 /* (intlevel 1) */ -#define XCHAL_EXTINT9_NUM 12 /* (intlevel 1) */ -#define XCHAL_EXTINT10_NUM 13 /* (intlevel 1) */ -#define XCHAL_EXTINT11_NUM 14 /* (intlevel 7) */ -#define XCHAL_EXTINT12_NUM 17 /* (intlevel 1) */ -#define XCHAL_EXTINT13_NUM 18 /* (intlevel 1) */ -#define XCHAL_EXTINT14_NUM 19 /* (intlevel 2) */ -#define XCHAL_EXTINT15_NUM 20 /* (intlevel 2) */ -#define XCHAL_EXTINT16_NUM 21 /* (intlevel 2) */ -#define XCHAL_EXTINT17_NUM 22 /* (intlevel 3) */ -#define XCHAL_EXTINT18_NUM 23 /* (intlevel 3) */ -#define XCHAL_EXTINT19_NUM 24 /* (intlevel 4) */ -#define XCHAL_EXTINT20_NUM 25 /* (intlevel 4) */ -#define XCHAL_EXTINT21_NUM 26 /* (intlevel 5) */ -#define XCHAL_EXTINT22_NUM 27 /* (intlevel 3) */ -#define XCHAL_EXTINT23_NUM 28 /* (intlevel 4) */ -#define XCHAL_EXTINT24_NUM 30 /* (intlevel 4) */ -#define XCHAL_EXTINT25_NUM 31 /* (intlevel 5) */ -/* EXTERNAL BInterrupt pin numbers mapped to each core interrupt number: */ -#define XCHAL_INT0_EXTNUM 0 /* (intlevel 1) */ -#define XCHAL_INT1_EXTNUM 1 /* (intlevel 1) */ -#define XCHAL_INT2_EXTNUM 2 /* (intlevel 1) */ -#define XCHAL_INT3_EXTNUM 3 /* (intlevel 1) */ -#define XCHAL_INT4_EXTNUM 4 /* (intlevel 1) */ -#define XCHAL_INT5_EXTNUM 5 /* (intlevel 1) */ -#define XCHAL_INT8_EXTNUM 6 /* (intlevel 1) */ -#define XCHAL_INT9_EXTNUM 7 /* (intlevel 1) */ -#define XCHAL_INT10_EXTNUM 8 /* (intlevel 1) */ -#define XCHAL_INT12_EXTNUM 9 /* (intlevel 1) */ -#define XCHAL_INT13_EXTNUM 10 /* (intlevel 1) */ -#define XCHAL_INT14_EXTNUM 11 /* (intlevel 7) */ -#define XCHAL_INT17_EXTNUM 12 /* (intlevel 1) */ -#define XCHAL_INT18_EXTNUM 13 /* (intlevel 1) */ -#define XCHAL_INT19_EXTNUM 14 /* (intlevel 2) */ -#define XCHAL_INT20_EXTNUM 15 /* (intlevel 2) */ -#define XCHAL_INT21_EXTNUM 16 /* (intlevel 2) */ -#define XCHAL_INT22_EXTNUM 17 /* (intlevel 3) */ -#define XCHAL_INT23_EXTNUM 18 /* (intlevel 3) */ -#define XCHAL_INT24_EXTNUM 19 /* (intlevel 4) */ -#define XCHAL_INT25_EXTNUM 20 /* (intlevel 4) */ -#define XCHAL_INT26_EXTNUM 21 /* (intlevel 5) */ -#define XCHAL_INT27_EXTNUM 22 /* (intlevel 3) */ -#define XCHAL_INT28_EXTNUM 23 /* (intlevel 4) */ -#define XCHAL_INT30_EXTNUM 24 /* (intlevel 4) */ -#define XCHAL_INT31_EXTNUM 25 /* (intlevel 5) */ - - -/*---------------------------------------------------------------------- - EXCEPTIONS and VECTORS - ----------------------------------------------------------------------*/ - -#define XCHAL_XEA_VERSION 2 /* Xtensa Exception Architecture - number: 1 == XEA1 (old) - 2 == XEA2 (new) - 0 == XEAX (extern) or TX */ -#define XCHAL_HAVE_XEA1 0 /* Exception Architecture 1 */ -#define XCHAL_HAVE_XEA2 1 /* Exception Architecture 2 */ -#define XCHAL_HAVE_XEAX 0 /* External Exception Arch. */ -#define XCHAL_HAVE_EXCEPTIONS 1 /* exception option */ -#define XCHAL_HAVE_HALT 0 /* halt architecture option */ -#define XCHAL_HAVE_BOOTLOADER 0 /* boot loader (for TX) */ -#define XCHAL_HAVE_MEM_ECC_PARITY 0 /* local memory ECC/parity */ -#define XCHAL_HAVE_VECTOR_SELECT 1 /* relocatable vectors */ -#define XCHAL_HAVE_VECBASE 1 /* relocatable vectors */ -#define XCHAL_VECBASE_RESET_VADDR 0x40000000 /* VECBASE reset value */ -#define XCHAL_VECBASE_RESET_PADDR 0x40000000 -#define XCHAL_RESET_VECBASE_OVERLAP 0 - -#define XCHAL_RESET_VECTOR0_VADDR 0x50000000 -#define XCHAL_RESET_VECTOR0_PADDR 0x50000000 -#define XCHAL_RESET_VECTOR1_VADDR 0x40000400 -#define XCHAL_RESET_VECTOR1_PADDR 0x40000400 -#define XCHAL_RESET_VECTOR_VADDR 0x40000400 -#define XCHAL_RESET_VECTOR_PADDR 0x40000400 -#define XCHAL_USER_VECOFS 0x00000340 -#define XCHAL_USER_VECTOR_VADDR 0x40000340 -#define XCHAL_USER_VECTOR_PADDR 0x40000340 -#define XCHAL_KERNEL_VECOFS 0x00000300 -#define XCHAL_KERNEL_VECTOR_VADDR 0x40000300 -#define XCHAL_KERNEL_VECTOR_PADDR 0x40000300 -#define XCHAL_DOUBLEEXC_VECOFS 0x000003C0 -#define XCHAL_DOUBLEEXC_VECTOR_VADDR 0x400003C0 -#define XCHAL_DOUBLEEXC_VECTOR_PADDR 0x400003C0 -#define XCHAL_WINDOW_OF4_VECOFS 0x00000000 -#define XCHAL_WINDOW_UF4_VECOFS 0x00000040 -#define XCHAL_WINDOW_OF8_VECOFS 0x00000080 -#define XCHAL_WINDOW_UF8_VECOFS 0x000000C0 -#define XCHAL_WINDOW_OF12_VECOFS 0x00000100 -#define XCHAL_WINDOW_UF12_VECOFS 0x00000140 -#define XCHAL_WINDOW_VECTORS_VADDR 0x40000000 -#define XCHAL_WINDOW_VECTORS_PADDR 0x40000000 -#define XCHAL_INTLEVEL2_VECOFS 0x00000180 -#define XCHAL_INTLEVEL2_VECTOR_VADDR 0x40000180 -#define XCHAL_INTLEVEL2_VECTOR_PADDR 0x40000180 -#define XCHAL_INTLEVEL3_VECOFS 0x000001C0 -#define XCHAL_INTLEVEL3_VECTOR_VADDR 0x400001C0 -#define XCHAL_INTLEVEL3_VECTOR_PADDR 0x400001C0 -#define XCHAL_INTLEVEL4_VECOFS 0x00000200 -#define XCHAL_INTLEVEL4_VECTOR_VADDR 0x40000200 -#define XCHAL_INTLEVEL4_VECTOR_PADDR 0x40000200 -#define XCHAL_INTLEVEL5_VECOFS 0x00000240 -#define XCHAL_INTLEVEL5_VECTOR_VADDR 0x40000240 -#define XCHAL_INTLEVEL5_VECTOR_PADDR 0x40000240 -#define XCHAL_INTLEVEL6_VECOFS 0x00000280 -#define XCHAL_INTLEVEL6_VECTOR_VADDR 0x40000280 -#define XCHAL_INTLEVEL6_VECTOR_PADDR 0x40000280 -#define XCHAL_DEBUG_VECOFS XCHAL_INTLEVEL6_VECOFS -#define XCHAL_DEBUG_VECTOR_VADDR XCHAL_INTLEVEL6_VECTOR_VADDR -#define XCHAL_DEBUG_VECTOR_PADDR XCHAL_INTLEVEL6_VECTOR_PADDR -#define XCHAL_NMI_VECOFS 0x000002C0 -#define XCHAL_NMI_VECTOR_VADDR 0x400002C0 -#define XCHAL_NMI_VECTOR_PADDR 0x400002C0 -#define XCHAL_INTLEVEL7_VECOFS XCHAL_NMI_VECOFS -#define XCHAL_INTLEVEL7_VECTOR_VADDR XCHAL_NMI_VECTOR_VADDR -#define XCHAL_INTLEVEL7_VECTOR_PADDR XCHAL_NMI_VECTOR_PADDR - - -/*---------------------------------------------------------------------- - DEBUG MODULE - ----------------------------------------------------------------------*/ - -/* Misc */ -#define XCHAL_HAVE_DEBUG_ERI 1 /* ERI to debug module */ -#define XCHAL_HAVE_DEBUG_APB 1 /* APB to debug module */ -#define XCHAL_HAVE_DEBUG_JTAG 1 /* JTAG to debug module */ - -/* On-Chip Debug (OCD) */ -#define XCHAL_HAVE_OCD 1 /* OnChipDebug option */ -#define XCHAL_NUM_IBREAK 2 /* number of IBREAKn regs */ -#define XCHAL_NUM_DBREAK 2 /* number of DBREAKn regs */ -#define XCHAL_HAVE_OCD_DIR_ARRAY 0 /* faster OCD option (to LX4) */ -#define XCHAL_HAVE_OCD_LS32DDR 1 /* L32DDR/S32DDR (faster OCD) */ - -/* TRAX (in core) */ -#define XCHAL_HAVE_TRAX 1 /* TRAX in debug module */ -#define XCHAL_TRAX_MEM_SIZE 16384 /* TRAX memory size in bytes */ -#define XCHAL_TRAX_MEM_SHAREABLE 1 /* start/end regs; ready sig. */ -#define XCHAL_TRAX_ATB_WIDTH 32 /* ATB width (bits), 0=no ATB */ -#define XCHAL_TRAX_TIME_WIDTH 0 /* timestamp bitwidth, 0=none */ - -/* Perf counters */ -#define XCHAL_NUM_PERF_COUNTERS 2 /* performance counters */ - - -/*---------------------------------------------------------------------- - MMU - ----------------------------------------------------------------------*/ - -/* See core-matmap.h header file for more details. */ - -#define XCHAL_HAVE_TLBS 1 /* inverse of HAVE_CACHEATTR */ -#define XCHAL_HAVE_SPANNING_WAY 1 /* one way maps I+D 4GB vaddr */ -#define XCHAL_SPANNING_WAY 0 /* TLB spanning way number */ -#define XCHAL_HAVE_IDENTITY_MAP 1 /* vaddr == paddr always */ -#define XCHAL_HAVE_CACHEATTR 0 /* CACHEATTR register present */ -#define XCHAL_HAVE_MIMIC_CACHEATTR 1 /* region protection */ -#define XCHAL_HAVE_XLT_CACHEATTR 0 /* region prot. w/translation */ -#define XCHAL_HAVE_PTP_MMU 0 /* full MMU (with page table - [autorefill] and protection) - usable for an MMU-based OS */ -/* If none of the above last 4 are set, it's a custom TLB configuration. */ - -#define XCHAL_MMU_ASID_BITS 0 /* number of bits in ASIDs */ -#define XCHAL_MMU_RINGS 1 /* number of rings (1..4) */ -#define XCHAL_MMU_RING_BITS 0 /* num of bits in RING field */ - -#endif /* !XTENSA_HAL_NON_PRIVILEGED_ONLY */ - - -#endif /* _XTENSA_CORE_CONFIGURATION_H */ - diff --git a/tools/sdk/include/nghttp/config.h b/tools/sdk/include/nghttp/config.h deleted file mode 100644 index f193b0afcad..00000000000 --- a/tools/sdk/include/nghttp/config.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef __HAVE_CONFIG_H_ -#define __HAVE_CONFIG_H_ - -#define _U_ - -#define SIZEOF_INT_P 2 - -//#define DEBUGBUILD -#include "stdio.h" -#include "stdlib.h" -#include "string.h" - -#if (!defined(nghttp_unlikely)) -#define nghttp_unlikely(Expression) !!(Expression) -#endif - -#define nghttp_ASSERT(Expression) do{if (!(Expression)) printf("%d\n", __LINE__);}while(0) - -#define CU_ASSERT(a) nghttp_ASSERT(a) -#define CU_ASSERT_FATAL(a) nghttp_ASSERT(a) - -#if 1 -#define NGHTTP2_DEBUG_INFO() printf("%s %d\n", __FILE__, __LINE__) -#else -#define NGHTTP2_DEBUG_INFO() -#endif - -#define NGHTTP_PLATFORM_HTONS(_n) ((uint16_t)((((_n) & 0xff) << 8) | (((_n) >> 8) & 0xff))) -#define NGHTTP_PLATFORM_HTONL(_n) ((uint32_t)( (((_n) & 0xff) << 24) | (((_n) & 0xff00) << 8) | (((_n) >> 8) & 0xff00) | (((_n) >> 24) & 0xff) )) - -#define htons(x) NGHTTP_PLATFORM_HTONS(x) -#define ntohs(x) NGHTTP_PLATFORM_HTONS(x) -#define htonl(x) NGHTTP_PLATFORM_HTONL(x) -#define ntohl(x) NGHTTP_PLATFORM_HTONL(x) - -#endif diff --git a/tools/sdk/include/nghttp/http_parser.h b/tools/sdk/include/nghttp/http_parser.h deleted file mode 100644 index 105ae510a8a..00000000000 --- a/tools/sdk/include/nghttp/http_parser.h +++ /dev/null @@ -1,362 +0,0 @@ -/* Copyright Joyent, Inc. and other Node contributors. All rights reserved. - * - * 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. - */ -#ifndef http_parser_h -#define http_parser_h -#ifdef __cplusplus -extern "C" { -#endif - -/* Also update SONAME in the Makefile whenever you change these. */ -#define HTTP_PARSER_VERSION_MAJOR 2 -#define HTTP_PARSER_VERSION_MINOR 7 -#define HTTP_PARSER_VERSION_PATCH 0 - -#include -#if defined(_WIN32) && !defined(__MINGW32__) && \ - (!defined(_MSC_VER) || _MSC_VER<1600) && !defined(__WINE__) -#include -#include -typedef __int8 int8_t; -typedef unsigned __int8 uint8_t; -typedef __int16 int16_t; -typedef unsigned __int16 uint16_t; -typedef __int32 int32_t; -typedef unsigned __int32 uint32_t; -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; -#else -#include -#endif - -/* Compile with -DHTTP_PARSER_STRICT=0 to make less checks, but run - * faster - */ -#ifndef HTTP_PARSER_STRICT -# define HTTP_PARSER_STRICT 1 -#endif - -/* Maximium header size allowed. If the macro is not defined - * before including this header then the default is used. To - * change the maximum header size, define the macro in the build - * environment (e.g. -DHTTP_MAX_HEADER_SIZE=). To remove - * the effective limit on the size of the header, define the macro - * to a very large number (e.g. -DHTTP_MAX_HEADER_SIZE=0x7fffffff) - */ -#ifndef HTTP_MAX_HEADER_SIZE -# define HTTP_MAX_HEADER_SIZE (80*1024) -#endif - -typedef struct http_parser http_parser; -typedef struct http_parser_settings http_parser_settings; - - -/* Callbacks should return non-zero to indicate an error. The parser will - * then halt execution. - * - * The one exception is on_headers_complete. In a HTTP_RESPONSE parser - * returning '1' from on_headers_complete will tell the parser that it - * should not expect a body. This is used when receiving a response to a - * HEAD request which may contain 'Content-Length' or 'Transfer-Encoding: - * chunked' headers that indicate the presence of a body. - * - * Returning `2` from on_headers_complete will tell parser that it should not - * expect neither a body nor any futher responses on this connection. This is - * useful for handling responses to a CONNECT request which may not contain - * `Upgrade` or `Connection: upgrade` headers. - * - * http_data_cb does not return data chunks. It will be called arbitrarily - * many times for each string. E.G. you might get 10 callbacks for "on_url" - * each providing just a few characters more data. - */ -typedef int (*http_data_cb) (http_parser*, const char *at, size_t length); -typedef int (*http_cb) (http_parser*); - - -/* Request Methods */ -#define HTTP_METHOD_MAP(XX) \ - XX(0, DELETE, DELETE) \ - XX(1, GET, GET) \ - XX(2, HEAD, HEAD) \ - XX(3, POST, POST) \ - XX(4, PUT, PUT) \ - /* pathological */ \ - XX(5, CONNECT, CONNECT) \ - XX(6, OPTIONS, OPTIONS) \ - XX(7, TRACE, TRACE) \ - /* WebDAV */ \ - XX(8, COPY, COPY) \ - XX(9, LOCK, LOCK) \ - XX(10, MKCOL, MKCOL) \ - XX(11, MOVE, MOVE) \ - XX(12, PROPFIND, PROPFIND) \ - XX(13, PROPPATCH, PROPPATCH) \ - XX(14, SEARCH, SEARCH) \ - XX(15, UNLOCK, UNLOCK) \ - XX(16, BIND, BIND) \ - XX(17, REBIND, REBIND) \ - XX(18, UNBIND, UNBIND) \ - XX(19, ACL, ACL) \ - /* subversion */ \ - XX(20, REPORT, REPORT) \ - XX(21, MKACTIVITY, MKACTIVITY) \ - XX(22, CHECKOUT, CHECKOUT) \ - XX(23, MERGE, MERGE) \ - /* upnp */ \ - XX(24, MSEARCH, M-SEARCH) \ - XX(25, NOTIFY, NOTIFY) \ - XX(26, SUBSCRIBE, SUBSCRIBE) \ - XX(27, UNSUBSCRIBE, UNSUBSCRIBE) \ - /* RFC-5789 */ \ - XX(28, PATCH, PATCH) \ - XX(29, PURGE, PURGE) \ - /* CalDAV */ \ - XX(30, MKCALENDAR, MKCALENDAR) \ - /* RFC-2068, section 19.6.1.2 */ \ - XX(31, LINK, LINK) \ - XX(32, UNLINK, UNLINK) \ - -enum http_method - { -#define XX(num, name, string) HTTP_##name = num, - HTTP_METHOD_MAP(XX) -#undef XX - }; - - -enum http_parser_type { HTTP_REQUEST, HTTP_RESPONSE, HTTP_BOTH }; - - -/* Flag values for http_parser.flags field */ -enum flags - { F_CHUNKED = 1 << 0 - , F_CONNECTION_KEEP_ALIVE = 1 << 1 - , F_CONNECTION_CLOSE = 1 << 2 - , F_CONNECTION_UPGRADE = 1 << 3 - , F_TRAILING = 1 << 4 - , F_UPGRADE = 1 << 5 - , F_SKIPBODY = 1 << 6 - , F_CONTENTLENGTH = 1 << 7 - }; - - -/* Map for errno-related constants - * - * The provided argument should be a macro that takes 2 arguments. - */ -#define HTTP_ERRNO_MAP(XX) \ - /* No error */ \ - XX(OK, "success") \ - \ - /* Callback-related errors */ \ - XX(CB_message_begin, "the on_message_begin callback failed") \ - XX(CB_url, "the on_url callback failed") \ - XX(CB_header_field, "the on_header_field callback failed") \ - XX(CB_header_value, "the on_header_value callback failed") \ - XX(CB_headers_complete, "the on_headers_complete callback failed") \ - XX(CB_body, "the on_body callback failed") \ - XX(CB_message_complete, "the on_message_complete callback failed") \ - XX(CB_status, "the on_status callback failed") \ - XX(CB_chunk_header, "the on_chunk_header callback failed") \ - XX(CB_chunk_complete, "the on_chunk_complete callback failed") \ - \ - /* Parsing-related errors */ \ - XX(INVALID_EOF_STATE, "stream ended at an unexpected time") \ - XX(HEADER_OVERFLOW, \ - "too many header bytes seen; overflow detected") \ - XX(CLOSED_CONNECTION, \ - "data received after completed connection: close message") \ - XX(INVALID_VERSION, "invalid HTTP version") \ - XX(INVALID_STATUS, "invalid HTTP status code") \ - XX(INVALID_METHOD, "invalid HTTP method") \ - XX(INVALID_URL, "invalid URL") \ - XX(INVALID_HOST, "invalid host") \ - XX(INVALID_PORT, "invalid port") \ - XX(INVALID_PATH, "invalid path") \ - XX(INVALID_QUERY_STRING, "invalid query string") \ - XX(INVALID_FRAGMENT, "invalid fragment") \ - XX(LF_EXPECTED, "LF character expected") \ - XX(INVALID_HEADER_TOKEN, "invalid character in header") \ - XX(INVALID_CONTENT_LENGTH, \ - "invalid character in content-length header") \ - XX(UNEXPECTED_CONTENT_LENGTH, \ - "unexpected content-length header") \ - XX(INVALID_CHUNK_SIZE, \ - "invalid character in chunk size header") \ - XX(INVALID_CONSTANT, "invalid constant string") \ - XX(INVALID_INTERNAL_STATE, "encountered unexpected internal state")\ - XX(STRICT, "strict mode assertion failed") \ - XX(PAUSED, "parser is paused") \ - XX(UNKNOWN, "an unknown error occurred") - - -/* Define HPE_* values for each errno value above */ -#define HTTP_ERRNO_GEN(n, s) HPE_##n, -enum http_errno { - HTTP_ERRNO_MAP(HTTP_ERRNO_GEN) -}; -#undef HTTP_ERRNO_GEN - - -/* Get an http_errno value from an http_parser */ -#define HTTP_PARSER_ERRNO(p) ((enum http_errno) (p)->http_errno) - - -struct http_parser { - /** PRIVATE **/ - unsigned int type : 2; /* enum http_parser_type */ - unsigned int flags : 8; /* F_* values from 'flags' enum; semi-public */ - unsigned int state : 7; /* enum state from http_parser.c */ - unsigned int header_state : 7; /* enum header_state from http_parser.c */ - unsigned int index : 7; /* index into current matcher */ - unsigned int lenient_http_headers : 1; - - uint32_t nread; /* # bytes read in various scenarios */ - uint64_t content_length; /* # bytes in body (0 if no Content-Length header) */ - - /** READ-ONLY **/ - unsigned short http_major; - unsigned short http_minor; - unsigned int status_code : 16; /* responses only */ - unsigned int method : 8; /* requests only */ - unsigned int http_errno : 7; - - /* 1 = Upgrade header was present and the parser has exited because of that. - * 0 = No upgrade header present. - * Should be checked when http_parser_execute() returns in addition to - * error checking. - */ - unsigned int upgrade : 1; - - /** PUBLIC **/ - void *data; /* A pointer to get hook to the "connection" or "socket" object */ -}; - - -struct http_parser_settings { - http_cb on_message_begin; - http_data_cb on_url; - http_data_cb on_status; - http_data_cb on_header_field; - http_data_cb on_header_value; - http_cb on_headers_complete; - http_data_cb on_body; - http_cb on_message_complete; - /* When on_chunk_header is called, the current chunk length is stored - * in parser->content_length. - */ - http_cb on_chunk_header; - http_cb on_chunk_complete; -}; - - -enum http_parser_url_fields - { UF_SCHEMA = 0 - , UF_HOST = 1 - , UF_PORT = 2 - , UF_PATH = 3 - , UF_QUERY = 4 - , UF_FRAGMENT = 5 - , UF_USERINFO = 6 - , UF_MAX = 7 - }; - - -/* Result structure for http_parser_parse_url(). - * - * Callers should index into field_data[] with UF_* values iff field_set - * has the relevant (1 << UF_*) bit set. As a courtesy to clients (and - * because we probably have padding left over), we convert any port to - * a uint16_t. - */ -struct http_parser_url { - uint16_t field_set; /* Bitmask of (1 << UF_*) values */ - uint16_t port; /* Converted UF_PORT string */ - - struct { - uint16_t off; /* Offset into buffer in which field starts */ - uint16_t len; /* Length of run in buffer */ - } field_data[UF_MAX]; -}; - - -/* Returns the library version. Bits 16-23 contain the major version number, - * bits 8-15 the minor version number and bits 0-7 the patch level. - * Usage example: - * - * unsigned long version = http_parser_version(); - * unsigned major = (version >> 16) & 255; - * unsigned minor = (version >> 8) & 255; - * unsigned patch = version & 255; - * printf("http_parser v%u.%u.%u\n", major, minor, patch); - */ -unsigned long http_parser_version(void); - -void http_parser_init(http_parser *parser, enum http_parser_type type); - - -/* Initialize http_parser_settings members to 0 - */ -void http_parser_settings_init(http_parser_settings *settings); - - -/* Executes the parser. Returns number of parsed bytes. Sets - * `parser->http_errno` on error. */ -size_t http_parser_execute(http_parser *parser, - const http_parser_settings *settings, - const char *data, - size_t len); - - -/* If http_should_keep_alive() in the on_headers_complete or - * on_message_complete callback returns 0, then this should be - * the last message on the connection. - * If you are the server, respond with the "Connection: close" header. - * If you are the client, close the connection. - */ -int http_should_keep_alive(const http_parser *parser); - -/* Returns a string version of the HTTP method. */ -const char *http_method_str(enum http_method m); - -/* Return a string name of the given error */ -const char *http_errno_name(enum http_errno err); - -/* Return a string description of the given error */ -const char *http_errno_description(enum http_errno err); - -/* Initialize all http_parser_url members to 0 */ -void http_parser_url_init(struct http_parser_url *u); - -/* Parse a URL; return nonzero on failure */ -int http_parser_parse_url(const char *buf, size_t buflen, - int is_connect, - struct http_parser_url *u); - -/* Pause or un-pause the parser; a nonzero value pauses */ -void http_parser_pause(http_parser *parser, int paused); - -/* Checks if this is the final chunk of the body. */ -int http_body_is_final(const http_parser *parser); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/tools/sdk/include/nghttp/nghttp2/nghttp2.h b/tools/sdk/include/nghttp/nghttp2/nghttp2.h deleted file mode 100644 index 1c74b35c667..00000000000 --- a/tools/sdk/include/nghttp/nghttp2/nghttp2.h +++ /dev/null @@ -1,5296 +0,0 @@ -/* - * nghttp2 - HTTP/2 C Library - * - * Copyright (c) 2013, 2014 Tatsuhiro Tsujikawa - * - * 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. - */ -#ifndef NGHTTP2_H -#define NGHTTP2_H - -/* Define WIN32 when build target is Win32 API (borrowed from - libcurl) */ -#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) -#define WIN32 -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#if defined(_MSC_VER) && (_MSC_VER < 1800) -/* MSVC < 2013 does not have inttypes.h because it is not C99 - compliant. See compiler macros and version number in - https://sourceforge.net/p/predef/wiki/Compilers/ */ -#include -#else /* !defined(_MSC_VER) || (_MSC_VER >= 1800) */ -#include -#endif /* !defined(_MSC_VER) || (_MSC_VER >= 1800) */ -#include -#include - -#include - -#ifdef NGHTTP2_STATICLIB -#define NGHTTP2_EXTERN -#elif defined(WIN32) -#ifdef BUILDING_NGHTTP2 -#define NGHTTP2_EXTERN __declspec(dllexport) -#else /* !BUILDING_NGHTTP2 */ -#define NGHTTP2_EXTERN __declspec(dllimport) -#endif /* !BUILDING_NGHTTP2 */ -#else /* !defined(WIN32) */ -#ifdef BUILDING_NGHTTP2 -#define NGHTTP2_EXTERN __attribute__((visibility("default"))) -#else /* !BUILDING_NGHTTP2 */ -#define NGHTTP2_EXTERN -#endif /* !BUILDING_NGHTTP2 */ -#endif /* !defined(WIN32) */ - -/** - * @macro - * - * The protocol version identification string of this library - * supports. This identifier is used if HTTP/2 is used over TLS. - */ -#define NGHTTP2_PROTO_VERSION_ID "h2" -/** - * @macro - * - * The length of :macro:`NGHTTP2_PROTO_VERSION_ID`. - */ -#define NGHTTP2_PROTO_VERSION_ID_LEN 2 - -/** - * @macro - * - * The serialized form of ALPN protocol identifier this library - * supports. Notice that first byte is the length of following - * protocol identifier. This is the same wire format of `TLS ALPN - * extension `_. This is useful - * to process incoming ALPN tokens in wire format. - */ -#define NGHTTP2_PROTO_ALPN "\x2h2" - -/** - * @macro - * - * The length of :macro:`NGHTTP2_PROTO_ALPN`. - */ -#define NGHTTP2_PROTO_ALPN_LEN (sizeof(NGHTTP2_PROTO_ALPN) - 1) - -/** - * @macro - * - * The protocol version identification string of this library - * supports. This identifier is used if HTTP/2 is used over cleartext - * TCP. - */ -#define NGHTTP2_CLEARTEXT_PROTO_VERSION_ID "h2c" - -/** - * @macro - * - * The length of :macro:`NGHTTP2_CLEARTEXT_PROTO_VERSION_ID`. - */ -#define NGHTTP2_CLEARTEXT_PROTO_VERSION_ID_LEN 3 - -struct nghttp2_session; -/** - * @struct - * - * The primary structure to hold the resources needed for a HTTP/2 - * session. The details of this structure are intentionally hidden - * from the public API. - */ -typedef struct nghttp2_session nghttp2_session; - -/** - * @macro - * - * The age of :type:`nghttp2_info` - */ -#define NGHTTP2_VERSION_AGE 1 - -/** - * @struct - * - * This struct is what `nghttp2_version()` returns. It holds - * information about the particular nghttp2 version. - */ -typedef struct { - /** - * Age of this struct. This instance of nghttp2 sets it to - * :macro:`NGHTTP2_VERSION_AGE` but a future version may bump it and - * add more struct fields at the bottom - */ - int age; - /** - * the :macro:`NGHTTP2_VERSION_NUM` number (since age ==1) - */ - int version_num; - /** - * points to the :macro:`NGHTTP2_VERSION` string (since age ==1) - */ - const char *version_str; - /** - * points to the :macro:`NGHTTP2_PROTO_VERSION_ID` string this - * instance implements (since age ==1) - */ - const char *proto_str; - /* -------- the above fields all exist when age == 1 */ -} nghttp2_info; - -/** - * @macro - * - * The default weight of stream dependency. - */ -#define NGHTTP2_DEFAULT_WEIGHT 16 - -/** - * @macro - * - * The maximum weight of stream dependency. - */ -#define NGHTTP2_MAX_WEIGHT 256 - -/** - * @macro - * - * The minimum weight of stream dependency. - */ -#define NGHTTP2_MIN_WEIGHT 1 - -/** - * @macro - * - * The maximum window size - */ -#define NGHTTP2_MAX_WINDOW_SIZE ((int32_t)((1U << 31) - 1)) - -/** - * @macro - * - * The initial window size for stream level flow control. - */ -#define NGHTTP2_INITIAL_WINDOW_SIZE ((1 << 16) - 1) -/** - * @macro - * - * The initial window size for connection level flow control. - */ -#define NGHTTP2_INITIAL_CONNECTION_WINDOW_SIZE ((1 << 16) - 1) - -/** - * @macro - * - * The default header table size. - */ -#define NGHTTP2_DEFAULT_HEADER_TABLE_SIZE (1 << 12) - -/** - * @macro - * - * The client magic string, which is the first 24 bytes byte string of - * client connection preface. - */ -#define NGHTTP2_CLIENT_MAGIC "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" - -/** - * @macro - * - * The length of :macro:`NGHTTP2_CLIENT_MAGIC`. - */ -#define NGHTTP2_CLIENT_MAGIC_LEN 24 - -/** - * @enum - * - * Error codes used in this library. The code range is [-999, -500], - * inclusive. The following values are defined: - */ -typedef enum { - /** - * Invalid argument passed. - */ - NGHTTP2_ERR_INVALID_ARGUMENT = -501, - /** - * Out of buffer space. - */ - NGHTTP2_ERR_BUFFER_ERROR = -502, - /** - * The specified protocol version is not supported. - */ - NGHTTP2_ERR_UNSUPPORTED_VERSION = -503, - /** - * Used as a return value from :type:`nghttp2_send_callback`, - * :type:`nghttp2_recv_callback` and - * :type:`nghttp2_send_data_callback` to indicate that the operation - * would block. - */ - NGHTTP2_ERR_WOULDBLOCK = -504, - /** - * General protocol error - */ - NGHTTP2_ERR_PROTO = -505, - /** - * The frame is invalid. - */ - NGHTTP2_ERR_INVALID_FRAME = -506, - /** - * The peer performed a shutdown on the connection. - */ - NGHTTP2_ERR_EOF = -507, - /** - * Used as a return value from - * :func:`nghttp2_data_source_read_callback` to indicate that data - * transfer is postponed. See - * :func:`nghttp2_data_source_read_callback` for details. - */ - NGHTTP2_ERR_DEFERRED = -508, - /** - * Stream ID has reached the maximum value. Therefore no stream ID - * is available. - */ - NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE = -509, - /** - * The stream is already closed; or the stream ID is invalid. - */ - NGHTTP2_ERR_STREAM_CLOSED = -510, - /** - * RST_STREAM has been added to the outbound queue. The stream is - * in closing state. - */ - NGHTTP2_ERR_STREAM_CLOSING = -511, - /** - * The transmission is not allowed for this stream (e.g., a frame - * with END_STREAM flag set has already sent). - */ - NGHTTP2_ERR_STREAM_SHUT_WR = -512, - /** - * The stream ID is invalid. - */ - NGHTTP2_ERR_INVALID_STREAM_ID = -513, - /** - * The state of the stream is not valid (e.g., DATA cannot be sent - * to the stream if response HEADERS has not been sent). - */ - NGHTTP2_ERR_INVALID_STREAM_STATE = -514, - /** - * Another DATA frame has already been deferred. - */ - NGHTTP2_ERR_DEFERRED_DATA_EXIST = -515, - /** - * Starting new stream is not allowed (e.g., GOAWAY has been sent - * and/or received). - */ - NGHTTP2_ERR_START_STREAM_NOT_ALLOWED = -516, - /** - * GOAWAY has already been sent. - */ - NGHTTP2_ERR_GOAWAY_ALREADY_SENT = -517, - /** - * The received frame contains the invalid header block (e.g., There - * are duplicate header names; or the header names are not encoded - * in US-ASCII character set and not lower cased; or the header name - * is zero-length string; or the header value contains multiple - * in-sequence NUL bytes). - */ - NGHTTP2_ERR_INVALID_HEADER_BLOCK = -518, - /** - * Indicates that the context is not suitable to perform the - * requested operation. - */ - NGHTTP2_ERR_INVALID_STATE = -519, - /** - * The user callback function failed due to the temporal error. - */ - NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE = -521, - /** - * The length of the frame is invalid, either too large or too small. - */ - NGHTTP2_ERR_FRAME_SIZE_ERROR = -522, - /** - * Header block inflate/deflate error. - */ - NGHTTP2_ERR_HEADER_COMP = -523, - /** - * Flow control error - */ - NGHTTP2_ERR_FLOW_CONTROL = -524, - /** - * Insufficient buffer size given to function. - */ - NGHTTP2_ERR_INSUFF_BUFSIZE = -525, - /** - * Callback was paused by the application - */ - NGHTTP2_ERR_PAUSE = -526, - /** - * There are too many in-flight SETTING frame and no more - * transmission of SETTINGS is allowed. - */ - NGHTTP2_ERR_TOO_MANY_INFLIGHT_SETTINGS = -527, - /** - * The server push is disabled. - */ - NGHTTP2_ERR_PUSH_DISABLED = -528, - /** - * DATA or HEADERS frame for a given stream has been already - * submitted and has not been fully processed yet. Application - * should wait for the transmission of the previously submitted - * frame before submitting another. - */ - NGHTTP2_ERR_DATA_EXIST = -529, - /** - * The current session is closing due to a connection error or - * `nghttp2_session_terminate_session()` is called. - */ - NGHTTP2_ERR_SESSION_CLOSING = -530, - /** - * Invalid HTTP header field was received and stream is going to be - * closed. - */ - NGHTTP2_ERR_HTTP_HEADER = -531, - /** - * Violation in HTTP messaging rule. - */ - NGHTTP2_ERR_HTTP_MESSAGING = -532, - /** - * Stream was refused. - */ - NGHTTP2_ERR_REFUSED_STREAM = -533, - /** - * Unexpected internal error, but recovered. - */ - NGHTTP2_ERR_INTERNAL = -534, - /** - * Indicates that a processing was canceled. - */ - NGHTTP2_ERR_CANCEL = -535, - /** - * The errors < :enum:`NGHTTP2_ERR_FATAL` mean that the library is - * under unexpected condition and processing was terminated (e.g., - * out of memory). If application receives this error code, it must - * stop using that :type:`nghttp2_session` object and only allowed - * operation for that object is deallocate it using - * `nghttp2_session_del()`. - */ - NGHTTP2_ERR_FATAL = -900, - /** - * Out of memory. This is a fatal error. - */ - NGHTTP2_ERR_NOMEM = -901, - /** - * The user callback function failed. This is a fatal error. - */ - NGHTTP2_ERR_CALLBACK_FAILURE = -902, - /** - * Invalid client magic (see :macro:`NGHTTP2_CLIENT_MAGIC`) was - * received and further processing is not possible. - */ - NGHTTP2_ERR_BAD_CLIENT_MAGIC = -903, - /** - * Possible flooding by peer was detected in this HTTP/2 session. - * Flooding is measured by how many PING and SETTINGS frames with - * ACK flag set are queued for transmission. These frames are - * response for the peer initiated frames, and peer can cause memory - * exhaustion on server side to send these frames forever and does - * not read network. - */ - NGHTTP2_ERR_FLOODED = -904 -} nghttp2_error; - -/** - * @struct - * - * The object representing single contiguous buffer. - */ -typedef struct { - /** - * The pointer to the buffer. - */ - uint8_t *base; - /** - * The length of the buffer. - */ - size_t len; -} nghttp2_vec; - -struct nghttp2_rcbuf; - -/** - * @struct - * - * The object representing reference counted buffer. The details of - * this structure are intentionally hidden from the public API. - */ -typedef struct nghttp2_rcbuf nghttp2_rcbuf; - -/** - * @function - * - * Increments the reference count of |rcbuf| by 1. - */ -NGHTTP2_EXTERN void nghttp2_rcbuf_incref(nghttp2_rcbuf *rcbuf); - -/** - * @function - * - * Decrements the reference count of |rcbuf| by 1. If the reference - * count becomes zero, the object pointed by |rcbuf| will be freed. - * In this case, application must not use |rcbuf| again. - */ -NGHTTP2_EXTERN void nghttp2_rcbuf_decref(nghttp2_rcbuf *rcbuf); - -/** - * @function - * - * Returns the underlying buffer managed by |rcbuf|. - */ -NGHTTP2_EXTERN nghttp2_vec nghttp2_rcbuf_get_buf(nghttp2_rcbuf *rcbuf); - -/** - * @enum - * - * The flags for header field name/value pair. - */ -typedef enum { - /** - * No flag set. - */ - NGHTTP2_NV_FLAG_NONE = 0, - /** - * Indicates that this name/value pair must not be indexed ("Literal - * Header Field never Indexed" representation must be used in HPACK - * encoding). Other implementation calls this bit as "sensitive". - */ - NGHTTP2_NV_FLAG_NO_INDEX = 0x01, - /** - * This flag is set solely by application. If this flag is set, the - * library does not make a copy of header field name. This could - * improve performance. - */ - NGHTTP2_NV_FLAG_NO_COPY_NAME = 0x02, - /** - * This flag is set solely by application. If this flag is set, the - * library does not make a copy of header field value. This could - * improve performance. - */ - NGHTTP2_NV_FLAG_NO_COPY_VALUE = 0x04 -} nghttp2_nv_flag; - -/** - * @struct - * - * The name/value pair, which mainly used to represent header fields. - */ -typedef struct { - /** - * The |name| byte string. If this struct is presented from library - * (e.g., :type:`nghttp2_on_frame_recv_callback`), |name| is - * guaranteed to be NULL-terminated. For some callbacks - * (:type:`nghttp2_before_frame_send_callback`, - * :type:`nghttp2_on_frame_send_callback`, and - * :type:`nghttp2_on_frame_not_send_callback`), it may not be - * NULL-terminated if header field is passed from application with - * the flag :enum:`NGHTTP2_NV_FLAG_NO_COPY_NAME`). When application - * is constructing this struct, |name| is not required to be - * NULL-terminated. - */ - uint8_t *name; - /** - * The |value| byte string. If this struct is presented from - * library (e.g., :type:`nghttp2_on_frame_recv_callback`), |value| - * is guaranteed to be NULL-terminated. For some callbacks - * (:type:`nghttp2_before_frame_send_callback`, - * :type:`nghttp2_on_frame_send_callback`, and - * :type:`nghttp2_on_frame_not_send_callback`), it may not be - * NULL-terminated if header field is passed from application with - * the flag :enum:`NGHTTP2_NV_FLAG_NO_COPY_VALUE`). When - * application is constructing this struct, |value| is not required - * to be NULL-terminated. - */ - uint8_t *value; - /** - * The length of the |name|, excluding terminating NULL. - */ - size_t namelen; - /** - * The length of the |value|, excluding terminating NULL. - */ - size_t valuelen; - /** - * Bitwise OR of one or more of :type:`nghttp2_nv_flag`. - */ - uint8_t flags; -} nghttp2_nv; - -/** - * @enum - * - * The frame types in HTTP/2 specification. - */ -typedef enum { - /** - * The DATA frame. - */ - NGHTTP2_DATA = 0, - /** - * The HEADERS frame. - */ - NGHTTP2_HEADERS = 0x01, - /** - * The PRIORITY frame. - */ - NGHTTP2_PRIORITY = 0x02, - /** - * The RST_STREAM frame. - */ - NGHTTP2_RST_STREAM = 0x03, - /** - * The SETTINGS frame. - */ - NGHTTP2_SETTINGS = 0x04, - /** - * The PUSH_PROMISE frame. - */ - NGHTTP2_PUSH_PROMISE = 0x05, - /** - * The PING frame. - */ - NGHTTP2_PING = 0x06, - /** - * The GOAWAY frame. - */ - NGHTTP2_GOAWAY = 0x07, - /** - * The WINDOW_UPDATE frame. - */ - NGHTTP2_WINDOW_UPDATE = 0x08, - /** - * The CONTINUATION frame. This frame type won't be passed to any - * callbacks because the library processes this frame type and its - * preceding HEADERS/PUSH_PROMISE as a single frame. - */ - NGHTTP2_CONTINUATION = 0x09, - /** - * The ALTSVC frame, which is defined in `RFC 7383 - * `_. - */ - NGHTTP2_ALTSVC = 0x0a -} nghttp2_frame_type; - -/** - * @enum - * - * The flags for HTTP/2 frames. This enum defines all flags for all - * frames. - */ -typedef enum { - /** - * No flag set. - */ - NGHTTP2_FLAG_NONE = 0, - /** - * The END_STREAM flag. - */ - NGHTTP2_FLAG_END_STREAM = 0x01, - /** - * The END_HEADERS flag. - */ - NGHTTP2_FLAG_END_HEADERS = 0x04, - /** - * The ACK flag. - */ - NGHTTP2_FLAG_ACK = 0x01, - /** - * The PADDED flag. - */ - NGHTTP2_FLAG_PADDED = 0x08, - /** - * The PRIORITY flag. - */ - NGHTTP2_FLAG_PRIORITY = 0x20 -} nghttp2_flag; - -/** - * @enum - * The SETTINGS ID. - */ -typedef enum { - /** - * SETTINGS_HEADER_TABLE_SIZE - */ - NGHTTP2_SETTINGS_HEADER_TABLE_SIZE = 0x01, - /** - * SETTINGS_ENABLE_PUSH - */ - NGHTTP2_SETTINGS_ENABLE_PUSH = 0x02, - /** - * SETTINGS_MAX_CONCURRENT_STREAMS - */ - NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS = 0x03, - /** - * SETTINGS_INITIAL_WINDOW_SIZE - */ - NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE = 0x04, - /** - * SETTINGS_MAX_FRAME_SIZE - */ - NGHTTP2_SETTINGS_MAX_FRAME_SIZE = 0x05, - /** - * SETTINGS_MAX_HEADER_LIST_SIZE - */ - NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE = 0x06 -} nghttp2_settings_id; -/* Note: If we add SETTINGS, update the capacity of - NGHTTP2_INBOUND_NUM_IV as well */ - -/** - * @macro - * - * .. warning:: - * - * Deprecated. The initial max concurrent streams is 0xffffffffu. - * - * Default maximum number of incoming concurrent streams. Use - * `nghttp2_submit_settings()` with - * :enum:`NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS` to change the - * maximum number of incoming concurrent streams. - * - * .. note:: - * - * The maximum number of outgoing concurrent streams is 100 by - * default. - */ -#define NGHTTP2_INITIAL_MAX_CONCURRENT_STREAMS ((1U << 31) - 1) - -/** - * @enum - * The status codes for the RST_STREAM and GOAWAY frames. - */ -typedef enum { - /** - * No errors. - */ - NGHTTP2_NO_ERROR = 0x00, - /** - * PROTOCOL_ERROR - */ - NGHTTP2_PROTOCOL_ERROR = 0x01, - /** - * INTERNAL_ERROR - */ - NGHTTP2_INTERNAL_ERROR = 0x02, - /** - * FLOW_CONTROL_ERROR - */ - NGHTTP2_FLOW_CONTROL_ERROR = 0x03, - /** - * SETTINGS_TIMEOUT - */ - NGHTTP2_SETTINGS_TIMEOUT = 0x04, - /** - * STREAM_CLOSED - */ - NGHTTP2_STREAM_CLOSED = 0x05, - /** - * FRAME_SIZE_ERROR - */ - NGHTTP2_FRAME_SIZE_ERROR = 0x06, - /** - * REFUSED_STREAM - */ - NGHTTP2_REFUSED_STREAM = 0x07, - /** - * CANCEL - */ - NGHTTP2_CANCEL = 0x08, - /** - * COMPRESSION_ERROR - */ - NGHTTP2_COMPRESSION_ERROR = 0x09, - /** - * CONNECT_ERROR - */ - NGHTTP2_CONNECT_ERROR = 0x0a, - /** - * ENHANCE_YOUR_CALM - */ - NGHTTP2_ENHANCE_YOUR_CALM = 0x0b, - /** - * INADEQUATE_SECURITY - */ - NGHTTP2_INADEQUATE_SECURITY = 0x0c, - /** - * HTTP_1_1_REQUIRED - */ - NGHTTP2_HTTP_1_1_REQUIRED = 0x0d -} nghttp2_error_code; - -/** - * @struct - * The frame header. - */ -typedef struct { - /** - * The length field of this frame, excluding frame header. - */ - size_t length; - /** - * The stream identifier (aka, stream ID) - */ - int32_t stream_id; - /** - * The type of this frame. See `nghttp2_frame_type`. - */ - uint8_t type; - /** - * The flags. - */ - uint8_t flags; - /** - * Reserved bit in frame header. Currently, this is always set to 0 - * and application should not expect something useful in here. - */ - uint8_t reserved; -} nghttp2_frame_hd; - -/** - * @union - * - * This union represents the some kind of data source passed to - * :type:`nghttp2_data_source_read_callback`. - */ -typedef union { - /** - * The integer field, suitable for a file descriptor. - */ - int fd; - /** - * The pointer to an arbitrary object. - */ - void *ptr; -} nghttp2_data_source; - -/** - * @enum - * - * The flags used to set in |data_flags| output parameter in - * :type:`nghttp2_data_source_read_callback`. - */ -typedef enum { - /** - * No flag set. - */ - NGHTTP2_DATA_FLAG_NONE = 0, - /** - * Indicates EOF was sensed. - */ - NGHTTP2_DATA_FLAG_EOF = 0x01, - /** - * Indicates that END_STREAM flag must not be set even if - * NGHTTP2_DATA_FLAG_EOF is set. Usually this flag is used to send - * trailer fields with `nghttp2_submit_request()` or - * `nghttp2_submit_response()`. - */ - NGHTTP2_DATA_FLAG_NO_END_STREAM = 0x02, - /** - * Indicates that application will send complete DATA frame in - * :type:`nghttp2_send_data_callback`. - */ - NGHTTP2_DATA_FLAG_NO_COPY = 0x04 -} nghttp2_data_flag; - -/** - * @functypedef - * - * Callback function invoked when the library wants to read data from - * the |source|. The read data is sent in the stream |stream_id|. - * The implementation of this function must read at most |length| - * bytes of data from |source| (or possibly other places) and store - * them in |buf| and return number of data stored in |buf|. If EOF is - * reached, set :enum:`NGHTTP2_DATA_FLAG_EOF` flag in |*data_flags|. - * - * Sometime it is desirable to avoid copying data into |buf| and let - * application to send data directly. To achieve this, set - * :enum:`NGHTTP2_DATA_FLAG_NO_COPY` to |*data_flags| (and possibly - * other flags, just like when we do copy), and return the number of - * bytes to send without copying data into |buf|. The library, seeing - * :enum:`NGHTTP2_DATA_FLAG_NO_COPY`, will invoke - * :type:`nghttp2_send_data_callback`. The application must send - * complete DATA frame in that callback. - * - * If this callback is set by `nghttp2_submit_request()`, - * `nghttp2_submit_response()` or `nghttp2_submit_headers()` and - * `nghttp2_submit_data()` with flag parameter - * :enum:`NGHTTP2_FLAG_END_STREAM` set, and - * :enum:`NGHTTP2_DATA_FLAG_EOF` flag is set to |*data_flags|, DATA - * frame will have END_STREAM flag set. Usually, this is expected - * behaviour and all are fine. One exception is send trailer fields. - * You cannot send trailer fields after sending frame with END_STREAM - * set. To avoid this problem, one can set - * :enum:`NGHTTP2_DATA_FLAG_NO_END_STREAM` along with - * :enum:`NGHTTP2_DATA_FLAG_EOF` to signal the library not to set - * END_STREAM in DATA frame. Then application can use - * `nghttp2_submit_trailer()` to send trailer fields. - * `nghttp2_submit_trailer()` can be called inside this callback. - * - * If the application wants to postpone DATA frames (e.g., - * asynchronous I/O, or reading data blocks for long time), it is - * achieved by returning :enum:`NGHTTP2_ERR_DEFERRED` without reading - * any data in this invocation. The library removes DATA frame from - * the outgoing queue temporarily. To move back deferred DATA frame - * to outgoing queue, call `nghttp2_session_resume_data()`. - * - * By default, |length| is limited to 16KiB at maximum. If peer - * allows larger frames, application can enlarge transmission buffer - * size. See :type:`nghttp2_data_source_read_length_callback` for - * more details. - * - * If the application just wants to return from - * `nghttp2_session_send()` or `nghttp2_session_mem_send()` without - * sending anything, return :enum:`NGHTTP2_ERR_PAUSE`. - * - * In case of error, there are 2 choices. Returning - * :enum:`NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE` will close the stream - * by issuing RST_STREAM with :enum:`NGHTTP2_INTERNAL_ERROR`. If a - * different error code is desirable, use - * `nghttp2_submit_rst_stream()` with a desired error code and then - * return :enum:`NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. Returning - * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE` will signal the entire session - * failure. - */ -typedef ssize_t (*nghttp2_data_source_read_callback)( - nghttp2_session *session, int32_t stream_id, uint8_t *buf, size_t length, - uint32_t *data_flags, nghttp2_data_source *source, void *user_data); - -/** - * @struct - * - * This struct represents the data source and the way to read a chunk - * of data from it. - */ -typedef struct { - /** - * The data source. - */ - nghttp2_data_source source; - /** - * The callback function to read a chunk of data from the |source|. - */ - nghttp2_data_source_read_callback read_callback; -} nghttp2_data_provider; - -/** - * @struct - * - * The DATA frame. The received data is delivered via - * :type:`nghttp2_on_data_chunk_recv_callback`. - */ -typedef struct { - nghttp2_frame_hd hd; - /** - * The length of the padding in this frame. This includes PAD_HIGH - * and PAD_LOW. - */ - size_t padlen; -} nghttp2_data; - -/** - * @enum - * - * The category of HEADERS, which indicates the role of the frame. In - * HTTP/2 spec, request, response, push response and other arbitrary - * headers (e.g., trailer fields) are all called just HEADERS. To - * give the application the role of incoming HEADERS frame, we define - * several categories. - */ -typedef enum { - /** - * The HEADERS frame is opening new stream, which is analogous to - * SYN_STREAM in SPDY. - */ - NGHTTP2_HCAT_REQUEST = 0, - /** - * The HEADERS frame is the first response headers, which is - * analogous to SYN_REPLY in SPDY. - */ - NGHTTP2_HCAT_RESPONSE = 1, - /** - * The HEADERS frame is the first headers sent against reserved - * stream. - */ - NGHTTP2_HCAT_PUSH_RESPONSE = 2, - /** - * The HEADERS frame which does not apply for the above categories, - * which is analogous to HEADERS in SPDY. If non-final response - * (e.g., status 1xx) is used, final response HEADERS frame will be - * categorized here. - */ - NGHTTP2_HCAT_HEADERS = 3 -} nghttp2_headers_category; - -/** - * @struct - * - * The structure to specify stream dependency. - */ -typedef struct { - /** - * The stream ID of the stream to depend on. Specifying 0 makes - * stream not depend any other stream. - */ - int32_t stream_id; - /** - * The weight of this dependency. - */ - int32_t weight; - /** - * nonzero means exclusive dependency - */ - uint8_t exclusive; -} nghttp2_priority_spec; - -/** - * @struct - * - * The HEADERS frame. It has the following members: - */ -typedef struct { - /** - * The frame header. - */ - nghttp2_frame_hd hd; - /** - * The length of the padding in this frame. This includes PAD_HIGH - * and PAD_LOW. - */ - size_t padlen; - /** - * The priority specification - */ - nghttp2_priority_spec pri_spec; - /** - * The name/value pairs. - */ - nghttp2_nv *nva; - /** - * The number of name/value pairs in |nva|. - */ - size_t nvlen; - /** - * The category of this HEADERS frame. - */ - nghttp2_headers_category cat; -} nghttp2_headers; - -/** - * @struct - * - * The PRIORITY frame. It has the following members: - */ -typedef struct { - /** - * The frame header. - */ - nghttp2_frame_hd hd; - /** - * The priority specification. - */ - nghttp2_priority_spec pri_spec; -} nghttp2_priority; - -/** - * @struct - * - * The RST_STREAM frame. It has the following members: - */ -typedef struct { - /** - * The frame header. - */ - nghttp2_frame_hd hd; - /** - * The error code. See :type:`nghttp2_error_code`. - */ - uint32_t error_code; -} nghttp2_rst_stream; - -/** - * @struct - * - * The SETTINGS ID/Value pair. It has the following members: - */ -typedef struct { - /** - * The SETTINGS ID. See :type:`nghttp2_settings_id`. - */ - int32_t settings_id; - /** - * The value of this entry. - */ - uint32_t value; -} nghttp2_settings_entry; - -/** - * @struct - * - * The SETTINGS frame. It has the following members: - */ -typedef struct { - /** - * The frame header. - */ - nghttp2_frame_hd hd; - /** - * The number of SETTINGS ID/Value pairs in |iv|. - */ - size_t niv; - /** - * The pointer to the array of SETTINGS ID/Value pair. - */ - nghttp2_settings_entry *iv; -} nghttp2_settings; - -/** - * @struct - * - * The PUSH_PROMISE frame. It has the following members: - */ -typedef struct { - /** - * The frame header. - */ - nghttp2_frame_hd hd; - /** - * The length of the padding in this frame. This includes PAD_HIGH - * and PAD_LOW. - */ - size_t padlen; - /** - * The name/value pairs. - */ - nghttp2_nv *nva; - /** - * The number of name/value pairs in |nva|. - */ - size_t nvlen; - /** - * The promised stream ID - */ - int32_t promised_stream_id; - /** - * Reserved bit. Currently this is always set to 0 and application - * should not expect something useful in here. - */ - uint8_t reserved; -} nghttp2_push_promise; - -/** - * @struct - * - * The PING frame. It has the following members: - */ -typedef struct { - /** - * The frame header. - */ - nghttp2_frame_hd hd; - /** - * The opaque data - */ - uint8_t opaque_data[8]; -} nghttp2_ping; - -/** - * @struct - * - * The GOAWAY frame. It has the following members: - */ -typedef struct { - /** - * The frame header. - */ - nghttp2_frame_hd hd; - /** - * The last stream stream ID. - */ - int32_t last_stream_id; - /** - * The error code. See :type:`nghttp2_error_code`. - */ - uint32_t error_code; - /** - * The additional debug data - */ - uint8_t *opaque_data; - /** - * The length of |opaque_data| member. - */ - size_t opaque_data_len; - /** - * Reserved bit. Currently this is always set to 0 and application - * should not expect something useful in here. - */ - uint8_t reserved; -} nghttp2_goaway; - -/** - * @struct - * - * The WINDOW_UPDATE frame. It has the following members: - */ -typedef struct { - /** - * The frame header. - */ - nghttp2_frame_hd hd; - /** - * The window size increment. - */ - int32_t window_size_increment; - /** - * Reserved bit. Currently this is always set to 0 and application - * should not expect something useful in here. - */ - uint8_t reserved; -} nghttp2_window_update; - -/** - * @struct - * - * The extension frame. It has following members: - */ -typedef struct { - /** - * The frame header. - */ - nghttp2_frame_hd hd; - /** - * The pointer to extension payload. The exact pointer type is - * determined by hd.type. - * - * Currently, no extension is supported. This is a place holder for - * the future extensions. - */ - void *payload; -} nghttp2_extension; - -/** - * @union - * - * This union includes all frames to pass them to various function - * calls as nghttp2_frame type. The CONTINUATION frame is omitted - * from here because the library deals with it internally. - */ -typedef union { - /** - * The frame header, which is convenient to inspect frame header. - */ - nghttp2_frame_hd hd; - /** - * The DATA frame. - */ - nghttp2_data data; - /** - * The HEADERS frame. - */ - nghttp2_headers headers; - /** - * The PRIORITY frame. - */ - nghttp2_priority priority; - /** - * The RST_STREAM frame. - */ - nghttp2_rst_stream rst_stream; - /** - * The SETTINGS frame. - */ - nghttp2_settings settings; - /** - * The PUSH_PROMISE frame. - */ - nghttp2_push_promise push_promise; - /** - * The PING frame. - */ - nghttp2_ping ping; - /** - * The GOAWAY frame. - */ - nghttp2_goaway goaway; - /** - * The WINDOW_UPDATE frame. - */ - nghttp2_window_update window_update; - /** - * The extension frame. - */ - nghttp2_extension ext; -} nghttp2_frame; - -/** - * @functypedef - * - * Callback function invoked when |session| wants to send data to the - * remote peer. The implementation of this function must send at most - * |length| bytes of data stored in |data|. The |flags| is currently - * not used and always 0. It must return the number of bytes sent if - * it succeeds. If it cannot send any single byte without blocking, - * it must return :enum:`NGHTTP2_ERR_WOULDBLOCK`. For other errors, - * it must return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. The - * |user_data| pointer is the third argument passed in to the call to - * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`. - * - * This callback is required if the application uses - * `nghttp2_session_send()` to send data to the remote endpoint. If - * the application uses solely `nghttp2_session_mem_send()` instead, - * this callback function is unnecessary. - * - * To set this callback to :type:`nghttp2_session_callbacks`, use - * `nghttp2_session_callbacks_set_send_callback()`. - * - * .. note:: - * - * The |length| may be very small. If that is the case, and - * application disables Nagle algorithm (``TCP_NODELAY``), then just - * writing |data| to the network stack leads to very small packet, - * and it is very inefficient. An application should be responsible - * to buffer up small chunks of data as necessary to avoid this - * situation. - */ -typedef ssize_t (*nghttp2_send_callback)(nghttp2_session *session, - const uint8_t *data, size_t length, - int flags, void *user_data); - -/** - * @functypedef - * - * Callback function invoked when :enum:`NGHTTP2_DATA_FLAG_NO_COPY` is - * used in :type:`nghttp2_data_source_read_callback` to send complete - * DATA frame. - * - * The |frame| is a DATA frame to send. The |framehd| is the - * serialized frame header (9 bytes). The |length| is the length of - * application data to send (this does not include padding). The - * |source| is the same pointer passed to - * :type:`nghttp2_data_source_read_callback`. - * - * The application first must send frame header |framehd| of length 9 - * bytes. If ``frame->data.padlen > 0``, send 1 byte of value - * ``frame->data.padlen - 1``. Then send exactly |length| bytes of - * application data. Finally, if ``frame->data.padlen > 1``, send - * ``frame->data.padlen - 1`` bytes of zero as padding. - * - * The application has to send complete DATA frame in this callback. - * If all data were written successfully, return 0. - * - * If it cannot send any data at all, just return - * :enum:`NGHTTP2_ERR_WOULDBLOCK`; the library will call this callback - * with the same parameters later (It is recommended to send complete - * DATA frame at once in this function to deal with error; if partial - * frame data has already sent, it is impossible to send another data - * in that state, and all we can do is tear down connection). When - * data is fully processed, but application wants to make - * `nghttp2_session_mem_send()` or `nghttp2_session_send()` return - * immediately without processing next frames, return - * :enum:`NGHTTP2_ERR_PAUSE`. If application decided to reset this - * stream, return :enum:`NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`, then - * the library will send RST_STREAM with INTERNAL_ERROR as error code. - * The application can also return - * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`, which will result in - * connection closure. Returning any other value is treated as - * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE` is returned. - */ -typedef int (*nghttp2_send_data_callback)(nghttp2_session *session, - nghttp2_frame *frame, - const uint8_t *framehd, size_t length, - nghttp2_data_source *source, - void *user_data); - -/** - * @functypedef - * - * Callback function invoked when |session| wants to receive data from - * the remote peer. The implementation of this function must read at - * most |length| bytes of data and store it in |buf|. The |flags| is - * currently not used and always 0. It must return the number of - * bytes written in |buf| if it succeeds. If it cannot read any - * single byte without blocking, it must return - * :enum:`NGHTTP2_ERR_WOULDBLOCK`. If it gets EOF before it reads any - * single byte, it must return :enum:`NGHTTP2_ERR_EOF`. For other - * errors, it must return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. - * Returning 0 is treated as :enum:`NGHTTP2_ERR_WOULDBLOCK`. The - * |user_data| pointer is the third argument passed in to the call to - * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`. - * - * This callback is required if the application uses - * `nghttp2_session_recv()` to receive data from the remote endpoint. - * If the application uses solely `nghttp2_session_mem_recv()` - * instead, this callback function is unnecessary. - * - * To set this callback to :type:`nghttp2_session_callbacks`, use - * `nghttp2_session_callbacks_set_recv_callback()`. - */ -typedef ssize_t (*nghttp2_recv_callback)(nghttp2_session *session, uint8_t *buf, - size_t length, int flags, - void *user_data); - -/** - * @functypedef - * - * Callback function invoked by `nghttp2_session_recv()` and - * `nghttp2_session_mem_recv()` when a frame is received. The - * |user_data| pointer is the third argument passed in to the call to - * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`. - * - * If frame is HEADERS or PUSH_PROMISE, the ``nva`` and ``nvlen`` - * member of their data structure are always ``NULL`` and 0 - * respectively. The header name/value pairs are emitted via - * :type:`nghttp2_on_header_callback`. - * - * For HEADERS, PUSH_PROMISE and DATA frames, this callback may be - * called after stream is closed (see - * :type:`nghttp2_on_stream_close_callback`). The application should - * check that stream is still alive using its own stream management or - * :func:`nghttp2_session_get_stream_user_data()`. - * - * Only HEADERS and DATA frame can signal the end of incoming data. - * If ``frame->hd.flags & NGHTTP2_FLAG_END_STREAM`` is nonzero, the - * |frame| is the last frame from the remote peer in this stream. - * - * This callback won't be called for CONTINUATION frames. - * HEADERS/PUSH_PROMISE + CONTINUATIONs are treated as single frame. - * - * The implementation of this function must return 0 if it succeeds. - * If nonzero value is returned, it is treated as fatal error and - * `nghttp2_session_recv()` and `nghttp2_session_mem_recv()` functions - * immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. - * - * To set this callback to :type:`nghttp2_session_callbacks`, use - * `nghttp2_session_callbacks_set_on_frame_recv_callback()`. - */ -typedef int (*nghttp2_on_frame_recv_callback)(nghttp2_session *session, - const nghttp2_frame *frame, - void *user_data); - -/** - * @functypedef - * - * Callback function invoked by `nghttp2_session_recv()` and - * `nghttp2_session_mem_recv()` when an invalid non-DATA frame is - * received. The error is indicated by the |lib_error_code|, which is - * one of the values defined in :type:`nghttp2_error`. When this - * callback function is invoked, the library automatically submits - * either RST_STREAM or GOAWAY frame. The |user_data| pointer is the - * third argument passed in to the call to - * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`. - * - * If frame is HEADERS or PUSH_PROMISE, the ``nva`` and ``nvlen`` - * member of their data structure are always ``NULL`` and 0 - * respectively. - * - * The implementation of this function must return 0 if it succeeds. - * If nonzero is returned, it is treated as fatal error and - * `nghttp2_session_recv()` and `nghttp2_session_mem_recv()` functions - * immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. - * - * To set this callback to :type:`nghttp2_session_callbacks`, use - * `nghttp2_session_callbacks_set_on_invalid_frame_recv_callback()`. - */ -typedef int (*nghttp2_on_invalid_frame_recv_callback)( - nghttp2_session *session, const nghttp2_frame *frame, int lib_error_code, - void *user_data); - -/** - * @functypedef - * - * Callback function invoked when a chunk of data in DATA frame is - * received. The |stream_id| is the stream ID this DATA frame belongs - * to. The |flags| is the flags of DATA frame which this data chunk - * is contained. ``(flags & NGHTTP2_FLAG_END_STREAM) != 0`` does not - * necessarily mean this chunk of data is the last one in the stream. - * You should use :type:`nghttp2_on_frame_recv_callback` to know all - * data frames are received. The |user_data| pointer is the third - * argument passed in to the call to `nghttp2_session_client_new()` or - * `nghttp2_session_server_new()`. - * - * If the application uses `nghttp2_session_mem_recv()`, it can return - * :enum:`NGHTTP2_ERR_PAUSE` to make `nghttp2_session_mem_recv()` - * return without processing further input bytes. The memory by - * pointed by the |data| is retained until - * `nghttp2_session_mem_recv()` or `nghttp2_session_recv()` is called. - * The application must retain the input bytes which was used to - * produce the |data| parameter, because it may refer to the memory - * region included in the input bytes. - * - * The implementation of this function must return 0 if it succeeds. - * If nonzero is returned, it is treated as fatal error, and - * `nghttp2_session_recv()` and `nghttp2_session_mem_recv()` functions - * immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. - * - * To set this callback to :type:`nghttp2_session_callbacks`, use - * `nghttp2_session_callbacks_set_on_data_chunk_recv_callback()`. - */ -typedef int (*nghttp2_on_data_chunk_recv_callback)(nghttp2_session *session, - uint8_t flags, - int32_t stream_id, - const uint8_t *data, - size_t len, void *user_data); - -/** - * @functypedef - * - * Callback function invoked just before the non-DATA frame |frame| is - * sent. The |user_data| pointer is the third argument passed in to - * the call to `nghttp2_session_client_new()` or - * `nghttp2_session_server_new()`. - * - * The implementation of this function must return 0 if it succeeds. - * It can also return :enum:`NGHTTP2_ERR_CANCEL` to cancel the - * transmission of the given frame. - * - * If there is a fatal error while executing this callback, the - * implementation should return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`, - * which makes `nghttp2_session_send()` and - * `nghttp2_session_mem_send()` functions immediately return - * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. - * - * If the other value is returned, it is treated as if - * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE` is returned. But the - * implementation should not rely on this since the library may define - * new return value to extend its capability. - * - * To set this callback to :type:`nghttp2_session_callbacks`, use - * `nghttp2_session_callbacks_set_before_frame_send_callback()`. - */ -typedef int (*nghttp2_before_frame_send_callback)(nghttp2_session *session, - const nghttp2_frame *frame, - void *user_data); - -/** - * @functypedef - * - * Callback function invoked after the frame |frame| is sent. The - * |user_data| pointer is the third argument passed in to the call to - * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`. - * - * The implementation of this function must return 0 if it succeeds. - * If nonzero is returned, it is treated as fatal error and - * `nghttp2_session_send()` and `nghttp2_session_mem_send()` functions - * immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. - * - * To set this callback to :type:`nghttp2_session_callbacks`, use - * `nghttp2_session_callbacks_set_on_frame_send_callback()`. - */ -typedef int (*nghttp2_on_frame_send_callback)(nghttp2_session *session, - const nghttp2_frame *frame, - void *user_data); - -/** - * @functypedef - * - * Callback function invoked after the non-DATA frame |frame| is not - * sent because of the error. The error is indicated by the - * |lib_error_code|, which is one of the values defined in - * :type:`nghttp2_error`. The |user_data| pointer is the third - * argument passed in to the call to `nghttp2_session_client_new()` or - * `nghttp2_session_server_new()`. - * - * The implementation of this function must return 0 if it succeeds. - * If nonzero is returned, it is treated as fatal error and - * `nghttp2_session_send()` and `nghttp2_session_mem_send()` functions - * immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. - * - * `nghttp2_session_get_stream_user_data()` can be used to get - * associated data. - * - * To set this callback to :type:`nghttp2_session_callbacks`, use - * `nghttp2_session_callbacks_set_on_frame_not_send_callback()`. - */ -typedef int (*nghttp2_on_frame_not_send_callback)(nghttp2_session *session, - const nghttp2_frame *frame, - int lib_error_code, - void *user_data); - -/** - * @functypedef - * - * Callback function invoked when the stream |stream_id| is closed. - * The reason of closure is indicated by the |error_code|. The - * |error_code| is usually one of :enum:`nghttp2_error_code`, but that - * is not guaranteed. The stream_user_data, which was specified in - * `nghttp2_submit_request()` or `nghttp2_submit_headers()`, is still - * available in this function. The |user_data| pointer is the third - * argument passed in to the call to `nghttp2_session_client_new()` or - * `nghttp2_session_server_new()`. - * - * This function is also called for a stream in reserved state. - * - * The implementation of this function must return 0 if it succeeds. - * If nonzero is returned, it is treated as fatal error and - * `nghttp2_session_recv()`, `nghttp2_session_mem_recv()`, - * `nghttp2_session_send()`, and `nghttp2_session_mem_send()` - * functions immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. - * - * To set this callback to :type:`nghttp2_session_callbacks`, use - * `nghttp2_session_callbacks_set_on_stream_close_callback()`. - */ -typedef int (*nghttp2_on_stream_close_callback)(nghttp2_session *session, - int32_t stream_id, - uint32_t error_code, - void *user_data); - -/** - * @functypedef - * - * Callback function invoked when the reception of header block in - * HEADERS or PUSH_PROMISE is started. Each header name/value pair - * will be emitted by :type:`nghttp2_on_header_callback`. - * - * The ``frame->hd.flags`` may not have - * :enum:`NGHTTP2_FLAG_END_HEADERS` flag set, which indicates that one - * or more CONTINUATION frames are involved. But the application does - * not need to care about that because the header name/value pairs are - * emitted transparently regardless of CONTINUATION frames. - * - * The server applications probably create an object to store - * information about new stream if ``frame->hd.type == - * NGHTTP2_HEADERS`` and ``frame->headers.cat == - * NGHTTP2_HCAT_REQUEST``. If |session| is configured as server side, - * ``frame->headers.cat`` is either ``NGHTTP2_HCAT_REQUEST`` - * containing request headers or ``NGHTTP2_HCAT_HEADERS`` containing - * trailer fields and never get PUSH_PROMISE in this callback. - * - * For the client applications, ``frame->hd.type`` is either - * ``NGHTTP2_HEADERS`` or ``NGHTTP2_PUSH_PROMISE``. In case of - * ``NGHTTP2_HEADERS``, ``frame->headers.cat == - * NGHTTP2_HCAT_RESPONSE`` means that it is the first response - * headers, but it may be non-final response which is indicated by 1xx - * status code. In this case, there may be zero or more HEADERS frame - * with ``frame->headers.cat == NGHTTP2_HCAT_HEADERS`` which has - * non-final response code and finally client gets exactly one HEADERS - * frame with ``frame->headers.cat == NGHTTP2_HCAT_HEADERS`` - * containing final response headers (non-1xx status code). The - * trailer fields also has ``frame->headers.cat == - * NGHTTP2_HCAT_HEADERS`` which does not contain any status code. - * - * Returning :enum:`NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE` will close - * the stream (promised stream if frame is PUSH_PROMISE) by issuing - * RST_STREAM with :enum:`NGHTTP2_INTERNAL_ERROR`. In this case, - * :type:`nghttp2_on_header_callback` and - * :type:`nghttp2_on_frame_recv_callback` will not be invoked. If a - * different error code is desirable, use - * `nghttp2_submit_rst_stream()` with a desired error code and then - * return :enum:`NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. Again, use - * ``frame->push_promise.promised_stream_id`` as stream_id parameter - * in `nghttp2_submit_rst_stream()` if frame is PUSH_PROMISE. - * - * The implementation of this function must return 0 if it succeeds. - * It can return :enum:`NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE` to - * reset the stream (promised stream if frame is PUSH_PROMISE). For - * critical errors, it must return - * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. If the other value is - * returned, it is treated as if :enum:`NGHTTP2_ERR_CALLBACK_FAILURE` - * is returned. If :enum:`NGHTTP2_ERR_CALLBACK_FAILURE` is returned, - * `nghttp2_session_mem_recv()` function will immediately return - * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. - * - * To set this callback to :type:`nghttp2_session_callbacks`, use - * `nghttp2_session_callbacks_set_on_begin_headers_callback()`. - */ -typedef int (*nghttp2_on_begin_headers_callback)(nghttp2_session *session, - const nghttp2_frame *frame, - void *user_data); - -/** - * @functypedef - * - * Callback function invoked when a header name/value pair is received - * for the |frame|. The |name| of length |namelen| is header name. - * The |value| of length |valuelen| is header value. The |flags| is - * bitwise OR of one or more of :type:`nghttp2_nv_flag`. - * - * If :enum:`NGHTTP2_NV_FLAG_NO_INDEX` is set in |flags|, the receiver - * must not index this name/value pair when forwarding it to the next - * hop. More specifically, "Literal Header Field never Indexed" - * representation must be used in HPACK encoding. - * - * When this callback is invoked, ``frame->hd.type`` is either - * :enum:`NGHTTP2_HEADERS` or :enum:`NGHTTP2_PUSH_PROMISE`. After all - * header name/value pairs are processed with this callback, and no - * error has been detected, :type:`nghttp2_on_frame_recv_callback` - * will be invoked. If there is an error in decompression, - * :type:`nghttp2_on_frame_recv_callback` for the |frame| will not be - * invoked. - * - * Both |name| and |value| are guaranteed to be NULL-terminated. The - * |namelen| and |valuelen| do not include terminal NULL. If - * `nghttp2_option_set_no_http_messaging()` is used with nonzero - * value, NULL character may be included in |name| or |value| before - * terminating NULL. - * - * Please note that unless `nghttp2_option_set_no_http_messaging()` is - * used, nghttp2 library does perform validation against the |name| - * and the |value| using `nghttp2_check_header_name()` and - * `nghttp2_check_header_value()`. In addition to this, nghttp2 - * performs validation based on HTTP Messaging rule, which is briefly - * explained in :ref:`http-messaging` section. - * - * If the application uses `nghttp2_session_mem_recv()`, it can return - * :enum:`NGHTTP2_ERR_PAUSE` to make `nghttp2_session_mem_recv()` - * return without processing further input bytes. The memory pointed - * by |frame|, |name| and |value| parameters are retained until - * `nghttp2_session_mem_recv()` or `nghttp2_session_recv()` is called. - * The application must retain the input bytes which was used to - * produce these parameters, because it may refer to the memory region - * included in the input bytes. - * - * Returning :enum:`NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE` will close - * the stream (promised stream if frame is PUSH_PROMISE) by issuing - * RST_STREAM with :enum:`NGHTTP2_INTERNAL_ERROR`. In this case, - * :type:`nghttp2_on_header_callback` and - * :type:`nghttp2_on_frame_recv_callback` will not be invoked. If a - * different error code is desirable, use - * `nghttp2_submit_rst_stream()` with a desired error code and then - * return :enum:`NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. Again, use - * ``frame->push_promise.promised_stream_id`` as stream_id parameter - * in `nghttp2_submit_rst_stream()` if frame is PUSH_PROMISE. - * - * The implementation of this function must return 0 if it succeeds. - * It may return :enum:`NGHTTP2_ERR_PAUSE` or - * :enum:`NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. For other critical - * failures, it must return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. If - * the other nonzero value is returned, it is treated as - * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. If - * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE` is returned, - * `nghttp2_session_recv()` and `nghttp2_session_mem_recv()` functions - * immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. - * - * To set this callback to :type:`nghttp2_session_callbacks`, use - * `nghttp2_session_callbacks_set_on_header_callback()`. - * - * .. warning:: - * - * Application should properly limit the total buffer size to store - * incoming header fields. Without it, peer may send large number - * of header fields or large header fields to cause out of memory in - * local endpoint. Due to how HPACK works, peer can do this - * effectively without using much memory on their own. - */ -typedef int (*nghttp2_on_header_callback)(nghttp2_session *session, - const nghttp2_frame *frame, - const uint8_t *name, size_t namelen, - const uint8_t *value, size_t valuelen, - uint8_t flags, void *user_data); - -/** - * @functypedef - * - * Callback function invoked when a header name/value pair is received - * for the |frame|. The |name| is header name. The |value| is header - * value. The |flags| is bitwise OR of one or more of - * :type:`nghttp2_nv_flag`. - * - * This callback behaves like :type:`nghttp2_on_header_callback`, - * except that |name| and |value| are stored in reference counted - * buffer. If application wishes to keep these references without - * copying them, use `nghttp2_rcbuf_incref()` to increment their - * reference count. It is the application's responsibility to call - * `nghttp2_rcbuf_decref()` if they called `nghttp2_rcbuf_incref()` so - * as not to leak memory. If the |session| is created by - * `nghttp2_session_server_new3()` or `nghttp2_session_client_new3()`, - * the function to free memory is the one belongs to the mem - * parameter. As long as this free function alives, |name| and - * |value| can live after |session| was destroyed. - */ -typedef int (*nghttp2_on_header_callback2)(nghttp2_session *session, - const nghttp2_frame *frame, - nghttp2_rcbuf *name, - nghttp2_rcbuf *value, uint8_t flags, - void *user_data); - -/** - * @functypedef - * - * Callback function invoked when a invalid header name/value pair is - * received for the |frame|. - * - * The parameter and behaviour are similar to - * :type:`nghttp2_on_header_callback`. The difference is that this - * callback is only invoked when a invalid header name/value pair is - * received which is treated as stream error if this callback is not - * set. Only invalid regular header field are passed to this - * callback. In other words, invalid pseudo header field is not - * passed to this callback. Also header fields which includes upper - * cased latter are also treated as error without passing them to this - * callback. - * - * This callback is only considered if HTTP messaging validation is - * turned on (which is on by default, see - * `nghttp2_option_set_no_http_messaging()`). - * - * With this callback, application inspects the incoming invalid - * field, and it also can reset stream from this callback by returning - * :enum:`NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. By default, the - * error code is :enum:`NGHTTP2_PROTOCOL_ERROR`. To change the error - * code, call `nghttp2_submit_rst_stream()` with the error code of - * choice in addition to returning - * :enum:`NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. - * - * If 0 is returned, the header field is ignored, and the stream is - * not reset. - */ -typedef int (*nghttp2_on_invalid_header_callback)( - nghttp2_session *session, const nghttp2_frame *frame, const uint8_t *name, - size_t namelen, const uint8_t *value, size_t valuelen, uint8_t flags, - void *user_data); - -/** - * @functypedef - * - * Callback function invoked when a invalid header name/value pair is - * received for the |frame|. - * - * The parameter and behaviour are similar to - * :type:`nghttp2_on_header_callback2`. The difference is that this - * callback is only invoked when a invalid header name/value pair is - * received which is silently ignored if this callback is not set. - * Only invalid regular header field are passed to this callback. In - * other words, invalid pseudo header field is not passed to this - * callback. Also header fields which includes upper cased latter are - * also treated as error without passing them to this callback. - * - * This callback is only considered if HTTP messaging validation is - * turned on (which is on by default, see - * `nghttp2_option_set_no_http_messaging()`). - * - * With this callback, application inspects the incoming invalid - * field, and it also can reset stream from this callback by returning - * :enum:`NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. By default, the - * error code is :enum:`NGHTTP2_INTERNAL_ERROR`. To change the error - * code, call `nghttp2_submit_rst_stream()` with the error code of - * choice in addition to returning - * :enum:`NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. - */ -typedef int (*nghttp2_on_invalid_header_callback2)( - nghttp2_session *session, const nghttp2_frame *frame, nghttp2_rcbuf *name, - nghttp2_rcbuf *value, uint8_t flags, void *user_data); - -/** - * @functypedef - * - * Callback function invoked when the library asks application how - * many padding bytes are required for the transmission of the - * |frame|. The application must choose the total length of payload - * including padded bytes in range [frame->hd.length, max_payloadlen], - * inclusive. Choosing number not in this range will be treated as - * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. Returning - * ``frame->hd.length`` means no padding is added. Returning - * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE` will make - * `nghttp2_session_send()` and `nghttp2_session_mem_send()` functions - * immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. - * - * To set this callback to :type:`nghttp2_session_callbacks`, use - * `nghttp2_session_callbacks_set_select_padding_callback()`. - */ -typedef ssize_t (*nghttp2_select_padding_callback)(nghttp2_session *session, - const nghttp2_frame *frame, - size_t max_payloadlen, - void *user_data); - -/** - * @functypedef - * - * Callback function invoked when library wants to get max length of - * data to send data to the remote peer. The implementation of this - * function should return a value in the following range. [1, - * min(|session_remote_window_size|, |stream_remote_window_size|, - * |remote_max_frame_size|)]. If a value greater than this range is - * returned than the max allow value will be used. Returning a value - * smaller than this range is treated as - * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. The |frame_type| is provided - * for future extensibility and identifies the type of frame (see - * :type:`nghttp2_frame_type`) for which to get the length for. - * Currently supported frame types are: :enum:`NGHTTP2_DATA`. - * - * This callback can be used to control the length in bytes for which - * :type:`nghttp2_data_source_read_callback` is allowed to send to the - * remote endpoint. This callback is optional. Returning - * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE` will signal the entire session - * failure. - * - * To set this callback to :type:`nghttp2_session_callbacks`, use - * `nghttp2_session_callbacks_set_data_source_read_length_callback()`. - */ -typedef ssize_t (*nghttp2_data_source_read_length_callback)( - nghttp2_session *session, uint8_t frame_type, int32_t stream_id, - int32_t session_remote_window_size, int32_t stream_remote_window_size, - uint32_t remote_max_frame_size, void *user_data); - -/** - * @functypedef - * - * Callback function invoked when a frame header is received. The - * |hd| points to received frame header. - * - * Unlike :type:`nghttp2_on_frame_recv_callback`, this callback will - * also be called when frame header of CONTINUATION frame is received. - * - * If both :type:`nghttp2_on_begin_frame_callback` and - * :type:`nghttp2_on_begin_headers_callback` are set and HEADERS or - * PUSH_PROMISE is received, :type:`nghttp2_on_begin_frame_callback` - * will be called first. - * - * The implementation of this function must return 0 if it succeeds. - * If nonzero value is returned, it is treated as fatal error and - * `nghttp2_session_recv()` and `nghttp2_session_mem_recv()` functions - * immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. - * - * To set this callback to :type:`nghttp2_session_callbacks`, use - * `nghttp2_session_callbacks_set_on_begin_frame_callback()`. - */ -typedef int (*nghttp2_on_begin_frame_callback)(nghttp2_session *session, - const nghttp2_frame_hd *hd, - void *user_data); - -/** - * @functypedef - * - * Callback function invoked when chunk of extension frame payload is - * received. The |hd| points to frame header. The received - * chunk is |data| of length |len|. - * - * The implementation of this function must return 0 if it succeeds. - * - * To abort processing this extension frame, return - * :enum:`NGHTTP2_ERR_CANCEL`. - * - * If fatal error occurred, application should return - * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. In this case, - * `nghttp2_session_recv()` and `nghttp2_session_mem_recv()` functions - * immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. If the - * other values are returned, currently they are treated as - * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. - */ -typedef int (*nghttp2_on_extension_chunk_recv_callback)( - nghttp2_session *session, const nghttp2_frame_hd *hd, const uint8_t *data, - size_t len, void *user_data); - -/** - * @functypedef - * - * Callback function invoked when library asks the application to - * unpack extension payload from its wire format. The extension - * payload has been passed to the application using - * :type:`nghttp2_on_extension_chunk_recv_callback`. The frame header - * is already unpacked by the library and provided as |hd|. - * - * To receive extension frames, the application must tell desired - * extension frame type to the library using - * `nghttp2_option_set_user_recv_extension_type()`. - * - * The implementation of this function may store the pointer to the - * created object as a result of unpacking in |*payload|, and returns - * 0. The pointer stored in |*payload| is opaque to the library, and - * the library does not own its pointer. |*payload| is initialized as - * ``NULL``. The |*payload| is available as ``frame->ext.payload`` in - * :type:`nghttp2_on_frame_recv_callback`. Therefore if application - * can free that memory inside :type:`nghttp2_on_frame_recv_callback` - * callback. Of course, application has a liberty not ot use - * |*payload|, and do its own mechanism to process extension frames. - * - * To abort processing this extension frame, return - * :enum:`NGHTTP2_ERR_CANCEL`. - * - * If fatal error occurred, application should return - * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. In this case, - * `nghttp2_session_recv()` and `nghttp2_session_mem_recv()` functions - * immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. If the - * other values are returned, currently they are treated as - * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. - */ -typedef int (*nghttp2_unpack_extension_callback)(nghttp2_session *session, - void **payload, - const nghttp2_frame_hd *hd, - void *user_data); - -/** - * @functypedef - * - * Callback function invoked when library asks the application to pack - * extension payload in its wire format. The frame header will be - * packed by library. Application must pack payload only. - * ``frame->ext.payload`` is the object passed to - * `nghttp2_submit_extension()` as payload parameter. Application - * must pack extension payload to the |buf| of its capacity |len| - * bytes. The |len| is at least 16KiB. - * - * The implementation of this function should return the number of - * bytes written into |buf| when it succeeds. - * - * To abort processing this extension frame, return - * :enum:`NGHTTP2_ERR_CANCEL`, and - * :type:`nghttp2_on_frame_not_send_callback` will be invoked. - * - * If fatal error occurred, application should return - * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. In this case, - * `nghttp2_session_send()` and `nghttp2_session_mem_send()` functions - * immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. If the - * other values are returned, currently they are treated as - * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. If the return value is - * strictly larger than |len|, it is treated as - * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. - */ -typedef ssize_t (*nghttp2_pack_extension_callback)(nghttp2_session *session, - uint8_t *buf, size_t len, - const nghttp2_frame *frame, - void *user_data); - -/** - * @functypedef - * - * Callback function invoked when library provides the error message - * intended for human consumption. This callback is solely for - * debugging purpose. The |msg| is typically NULL-terminated string - * of length |len|. |len| does not include the sentinel NULL - * character. - * - * The format of error message may change between nghttp2 library - * versions. The application should not depend on the particular - * format. - * - * Normally, application should return 0 from this callback. If fatal - * error occurred while doing something in this callback, application - * should return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. In this case, - * library will return immediately with return value - * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. Currently, if nonzero value - * is returned from this callback, they are treated as - * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`, but application should not - * rely on this details. - */ -typedef int (*nghttp2_error_callback)(nghttp2_session *session, const char *msg, - size_t len, void *user_data); - -struct nghttp2_session_callbacks; - -/** - * @struct - * - * Callback functions for :type:`nghttp2_session`. The details of - * this structure are intentionally hidden from the public API. - */ -typedef struct nghttp2_session_callbacks nghttp2_session_callbacks; - -/** - * @function - * - * Initializes |*callbacks_ptr| with NULL values. - * - * The initialized object can be used when initializing multiple - * :type:`nghttp2_session` objects. - * - * When the application finished using this object, it can use - * `nghttp2_session_callbacks_del()` to free its memory. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - */ -NGHTTP2_EXTERN int -nghttp2_session_callbacks_new(nghttp2_session_callbacks **callbacks_ptr); - -/** - * @function - * - * Frees any resources allocated for |callbacks|. If |callbacks| is - * ``NULL``, this function does nothing. - */ -NGHTTP2_EXTERN void -nghttp2_session_callbacks_del(nghttp2_session_callbacks *callbacks); - -/** - * @function - * - * Sets callback function invoked when a session wants to send data to - * the remote peer. This callback is not necessary if the application - * uses solely `nghttp2_session_mem_send()` to serialize data to - * transmit. - */ -NGHTTP2_EXTERN void nghttp2_session_callbacks_set_send_callback( - nghttp2_session_callbacks *cbs, nghttp2_send_callback send_callback); - -/** - * @function - * - * Sets callback function invoked when the a session wants to receive - * data from the remote peer. This callback is not necessary if the - * application uses solely `nghttp2_session_mem_recv()` to process - * received data. - */ -NGHTTP2_EXTERN void nghttp2_session_callbacks_set_recv_callback( - nghttp2_session_callbacks *cbs, nghttp2_recv_callback recv_callback); - -/** - * @function - * - * Sets callback function invoked by `nghttp2_session_recv()` and - * `nghttp2_session_mem_recv()` when a frame is received. - */ -NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_frame_recv_callback( - nghttp2_session_callbacks *cbs, - nghttp2_on_frame_recv_callback on_frame_recv_callback); - -/** - * @function - * - * Sets callback function invoked by `nghttp2_session_recv()` and - * `nghttp2_session_mem_recv()` when an invalid non-DATA frame is - * received. - */ -NGHTTP2_EXTERN void -nghttp2_session_callbacks_set_on_invalid_frame_recv_callback( - nghttp2_session_callbacks *cbs, - nghttp2_on_invalid_frame_recv_callback on_invalid_frame_recv_callback); - -/** - * @function - * - * Sets callback function invoked when a chunk of data in DATA frame - * is received. - */ -NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_data_chunk_recv_callback( - nghttp2_session_callbacks *cbs, - nghttp2_on_data_chunk_recv_callback on_data_chunk_recv_callback); - -/** - * @function - * - * Sets callback function invoked before a non-DATA frame is sent. - */ -NGHTTP2_EXTERN void nghttp2_session_callbacks_set_before_frame_send_callback( - nghttp2_session_callbacks *cbs, - nghttp2_before_frame_send_callback before_frame_send_callback); - -/** - * @function - * - * Sets callback function invoked after a frame is sent. - */ -NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_frame_send_callback( - nghttp2_session_callbacks *cbs, - nghttp2_on_frame_send_callback on_frame_send_callback); - -/** - * @function - * - * Sets callback function invoked when a non-DATA frame is not sent - * because of an error. - */ -NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_frame_not_send_callback( - nghttp2_session_callbacks *cbs, - nghttp2_on_frame_not_send_callback on_frame_not_send_callback); - -/** - * @function - * - * Sets callback function invoked when the stream is closed. - */ -NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_stream_close_callback( - nghttp2_session_callbacks *cbs, - nghttp2_on_stream_close_callback on_stream_close_callback); - -/** - * @function - * - * Sets callback function invoked when the reception of header block - * in HEADERS or PUSH_PROMISE is started. - */ -NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_begin_headers_callback( - nghttp2_session_callbacks *cbs, - nghttp2_on_begin_headers_callback on_begin_headers_callback); - -/** - * @function - * - * Sets callback function invoked when a header name/value pair is - * received. If both - * `nghttp2_session_callbacks_set_on_header_callback()` and - * `nghttp2_session_callbacks_set_on_header_callback2()` are used to - * set callbacks, the latter has the precedence. - */ -NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_header_callback( - nghttp2_session_callbacks *cbs, - nghttp2_on_header_callback on_header_callback); - -/** - * @function - * - * Sets callback function invoked when a header name/value pair is - * received. - */ -NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_header_callback2( - nghttp2_session_callbacks *cbs, - nghttp2_on_header_callback2 on_header_callback2); - -/** - * @function - * - * Sets callback function invoked when a invalid header name/value - * pair is received. If both - * `nghttp2_session_callbacks_set_on_invalid_header_callback()` and - * `nghttp2_session_callbacks_set_on_invalid_header_callback2()` are - * used to set callbacks, the latter takes the precedence. - */ -NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_invalid_header_callback( - nghttp2_session_callbacks *cbs, - nghttp2_on_invalid_header_callback on_invalid_header_callback); - -/** - * @function - * - * Sets callback function invoked when a invalid header name/value - * pair is received. - */ -NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_invalid_header_callback2( - nghttp2_session_callbacks *cbs, - nghttp2_on_invalid_header_callback2 on_invalid_header_callback2); - -/** - * @function - * - * Sets callback function invoked when the library asks application - * how many padding bytes are required for the transmission of the - * given frame. - */ -NGHTTP2_EXTERN void nghttp2_session_callbacks_set_select_padding_callback( - nghttp2_session_callbacks *cbs, - nghttp2_select_padding_callback select_padding_callback); - -/** - * @function - * - * Sets callback function determine the length allowed in - * :type:`nghttp2_data_source_read_callback`. - */ -NGHTTP2_EXTERN void -nghttp2_session_callbacks_set_data_source_read_length_callback( - nghttp2_session_callbacks *cbs, - nghttp2_data_source_read_length_callback data_source_read_length_callback); - -/** - * @function - * - * Sets callback function invoked when a frame header is received. - */ -NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_begin_frame_callback( - nghttp2_session_callbacks *cbs, - nghttp2_on_begin_frame_callback on_begin_frame_callback); - -/** - * @function - * - * Sets callback function invoked when - * :enum:`NGHTTP2_DATA_FLAG_NO_COPY` is used in - * :type:`nghttp2_data_source_read_callback` to avoid data copy. - */ -NGHTTP2_EXTERN void nghttp2_session_callbacks_set_send_data_callback( - nghttp2_session_callbacks *cbs, - nghttp2_send_data_callback send_data_callback); - -/** - * @function - * - * Sets callback function invoked when the library asks the - * application to pack extension frame payload in wire format. - */ -NGHTTP2_EXTERN void nghttp2_session_callbacks_set_pack_extension_callback( - nghttp2_session_callbacks *cbs, - nghttp2_pack_extension_callback pack_extension_callback); - -/** - * @function - * - * Sets callback function invoked when the library asks the - * application to unpack extension frame payload from wire format. - */ -NGHTTP2_EXTERN void nghttp2_session_callbacks_set_unpack_extension_callback( - nghttp2_session_callbacks *cbs, - nghttp2_unpack_extension_callback unpack_extension_callback); - -/** - * @function - * - * Sets callback function invoked when chunk of extension frame - * payload is received. - */ -NGHTTP2_EXTERN void -nghttp2_session_callbacks_set_on_extension_chunk_recv_callback( - nghttp2_session_callbacks *cbs, - nghttp2_on_extension_chunk_recv_callback on_extension_chunk_recv_callback); - -/** - * @function - * - * Sets callback function invoked when library tells error message to - * the application. - */ -NGHTTP2_EXTERN void nghttp2_session_callbacks_set_error_callback( - nghttp2_session_callbacks *cbs, nghttp2_error_callback error_callback); - -/** - * @functypedef - * - * Custom memory allocator to replace malloc(). The |mem_user_data| - * is the mem_user_data member of :type:`nghttp2_mem` structure. - */ -typedef void *(*nghttp2_malloc)(size_t size, void *mem_user_data); - -/** - * @functypedef - * - * Custom memory allocator to replace free(). The |mem_user_data| is - * the mem_user_data member of :type:`nghttp2_mem` structure. - */ -typedef void (*nghttp2_free)(void *ptr, void *mem_user_data); - -/** - * @functypedef - * - * Custom memory allocator to replace calloc(). The |mem_user_data| - * is the mem_user_data member of :type:`nghttp2_mem` structure. - */ -typedef void *(*nghttp2_calloc)(size_t nmemb, size_t size, void *mem_user_data); - -/** - * @functypedef - * - * Custom memory allocator to replace realloc(). The |mem_user_data| - * is the mem_user_data member of :type:`nghttp2_mem` structure. - */ -typedef void *(*nghttp2_realloc)(void *ptr, size_t size, void *mem_user_data); - -/** - * @struct - * - * Custom memory allocator functions and user defined pointer. The - * |mem_user_data| member is passed to each allocator function. This - * can be used, for example, to achieve per-session memory pool. - * - * In the following example code, ``my_malloc``, ``my_free``, - * ``my_calloc`` and ``my_realloc`` are the replacement of the - * standard allocators ``malloc``, ``free``, ``calloc`` and - * ``realloc`` respectively:: - * - * void *my_malloc_cb(size_t size, void *mem_user_data) { - * return my_malloc(size); - * } - * - * void my_free_cb(void *ptr, void *mem_user_data) { my_free(ptr); } - * - * void *my_calloc_cb(size_t nmemb, size_t size, void *mem_user_data) { - * return my_calloc(nmemb, size); - * } - * - * void *my_realloc_cb(void *ptr, size_t size, void *mem_user_data) { - * return my_realloc(ptr, size); - * } - * - * void session_new() { - * nghttp2_session *session; - * nghttp2_session_callbacks *callbacks; - * nghttp2_mem mem = {NULL, my_malloc_cb, my_free_cb, my_calloc_cb, - * my_realloc_cb}; - * - * ... - * - * nghttp2_session_client_new3(&session, callbacks, NULL, NULL, &mem); - * - * ... - * } - */ -typedef struct { - /** - * An arbitrary user supplied data. This is passed to each - * allocator function. - */ - void *mem_user_data; - /** - * Custom allocator function to replace malloc(). - */ - nghttp2_malloc malloc; - /** - * Custom allocator function to replace free(). - */ - nghttp2_free free; - /** - * Custom allocator function to replace calloc(). - */ - nghttp2_calloc calloc; - /** - * Custom allocator function to replace realloc(). - */ - nghttp2_realloc realloc; -} nghttp2_mem; - -struct nghttp2_option; - -/** - * @struct - * - * Configuration options for :type:`nghttp2_session`. The details of - * this structure are intentionally hidden from the public API. - */ -typedef struct nghttp2_option nghttp2_option; - -/** - * @function - * - * Initializes |*option_ptr| with default values. - * - * When the application finished using this object, it can use - * `nghttp2_option_del()` to free its memory. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - */ -NGHTTP2_EXTERN int nghttp2_option_new(nghttp2_option **option_ptr); - -/** - * @function - * - * Frees any resources allocated for |option|. If |option| is - * ``NULL``, this function does nothing. - */ -NGHTTP2_EXTERN void nghttp2_option_del(nghttp2_option *option); - -/** - * @function - * - * This option prevents the library from sending WINDOW_UPDATE for a - * connection automatically. If this option is set to nonzero, the - * library won't send WINDOW_UPDATE for DATA until application calls - * `nghttp2_session_consume()` to indicate the consumed amount of - * data. Don't use `nghttp2_submit_window_update()` for this purpose. - * By default, this option is set to zero. - */ -NGHTTP2_EXTERN void -nghttp2_option_set_no_auto_window_update(nghttp2_option *option, int val); - -/** - * @function - * - * This option sets the SETTINGS_MAX_CONCURRENT_STREAMS value of - * remote endpoint as if it is received in SETTINGS frame. Without - * specifying this option, before the local endpoint receives - * SETTINGS_MAX_CONCURRENT_STREAMS in SETTINGS frame from remote - * endpoint, SETTINGS_MAX_CONCURRENT_STREAMS is unlimited. This may - * cause problem if local endpoint submits lots of requests initially - * and sending them at once to the remote peer may lead to the - * rejection of some requests. Specifying this option to the sensible - * value, say 100, may avoid this kind of issue. This value will be - * overwritten if the local endpoint receives - * SETTINGS_MAX_CONCURRENT_STREAMS from the remote endpoint. - */ -NGHTTP2_EXTERN void -nghttp2_option_set_peer_max_concurrent_streams(nghttp2_option *option, - uint32_t val); - -/** - * @function - * - * By default, nghttp2 library, if configured as server, requires - * first 24 bytes of client magic byte string (MAGIC). In most cases, - * this will simplify the implementation of server. But sometimes - * server may want to detect the application protocol based on first - * few bytes on clear text communication. - * - * If this option is used with nonzero |val|, nghttp2 library does not - * handle MAGIC. It still checks following SETTINGS frame. This - * means that applications should deal with MAGIC by themselves. - * - * If this option is not used or used with zero value, if MAGIC does - * not match :macro:`NGHTTP2_CLIENT_MAGIC`, `nghttp2_session_recv()` - * and `nghttp2_session_mem_recv()` will return error - * :enum:`NGHTTP2_ERR_BAD_CLIENT_MAGIC`, which is fatal error. - */ -NGHTTP2_EXTERN void -nghttp2_option_set_no_recv_client_magic(nghttp2_option *option, int val); - -/** - * @function - * - * By default, nghttp2 library enforces subset of HTTP Messaging rules - * described in `HTTP/2 specification, section 8 - * `_. See - * :ref:`http-messaging` section for details. For those applications - * who use nghttp2 library as non-HTTP use, give nonzero to |val| to - * disable this enforcement. Please note that disabling this feature - * does not change the fundamental client and server model of HTTP. - * That is, even if the validation is disabled, only client can send - * requests. - */ -NGHTTP2_EXTERN void nghttp2_option_set_no_http_messaging(nghttp2_option *option, - int val); - -/** - * @function - * - * RFC 7540 does not enforce any limit on the number of incoming - * reserved streams (in RFC 7540 terms, streams in reserved (remote) - * state). This only affects client side, since only server can push - * streams. Malicious server can push arbitrary number of streams, - * and make client's memory exhausted. This option can set the - * maximum number of such incoming streams to avoid possible memory - * exhaustion. If this option is set, and pushed streams are - * automatically closed on reception, without calling user provided - * callback, if they exceed the given limit. The default value is - * 200. If session is configured as server side, this option has no - * effect. Server can control the number of streams to push. - */ -NGHTTP2_EXTERN void -nghttp2_option_set_max_reserved_remote_streams(nghttp2_option *option, - uint32_t val); - -/** - * @function - * - * Sets extension frame type the application is willing to handle with - * user defined callbacks (see - * :type:`nghttp2_on_extension_chunk_recv_callback` and - * :type:`nghttp2_unpack_extension_callback`). The |type| is - * extension frame type, and must be strictly greater than 0x9. - * Otherwise, this function does nothing. The application can call - * this function multiple times to set more than one frame type to - * receive. The application does not have to call this function if it - * just sends extension frames. - */ -NGHTTP2_EXTERN void -nghttp2_option_set_user_recv_extension_type(nghttp2_option *option, - uint8_t type); - -/** - * @function - * - * Sets extension frame type the application is willing to receive - * using builtin handler. The |type| is the extension frame type to - * receive, and must be strictly greater than 0x9. Otherwise, this - * function does nothing. The application can call this function - * multiple times to set more than one frame type to receive. The - * application does not have to call this function if it just sends - * extension frames. - * - * If same frame type is passed to both - * `nghttp2_option_set_builtin_recv_extension_type()` and - * `nghttp2_option_set_user_recv_extension_type()`, the latter takes - * precedence. - */ -NGHTTP2_EXTERN void -nghttp2_option_set_builtin_recv_extension_type(nghttp2_option *option, - uint8_t type); - -/** - * @function - * - * This option prevents the library from sending PING frame with ACK - * flag set automatically when PING frame without ACK flag set is - * received. If this option is set to nonzero, the library won't send - * PING frame with ACK flag set in the response for incoming PING - * frame. The application can send PING frame with ACK flag set using - * `nghttp2_submit_ping()` with :enum:`NGHTTP2_FLAG_ACK` as flags - * parameter. - */ -NGHTTP2_EXTERN void nghttp2_option_set_no_auto_ping_ack(nghttp2_option *option, - int val); - -/** - * @function - * - * This option sets the maximum length of header block (a set of - * header fields per one HEADERS frame) to send. The length of a - * given set of header fields is calculated using - * `nghttp2_hd_deflate_bound()`. The default value is 64KiB. If - * application attempts to send header fields larger than this limit, - * the transmission of the frame fails with error code - * :enum:`NGHTTP2_ERR_FRAME_SIZE_ERROR`. - */ -NGHTTP2_EXTERN void -nghttp2_option_set_max_send_header_block_length(nghttp2_option *option, - size_t val); - -/** - * @function - * - * This option sets the maximum dynamic table size for deflating - * header fields. The default value is 4KiB. In HTTP/2, receiver of - * deflated header block can specify maximum dynamic table size. The - * actual maximum size is the minimum of the size receiver specified - * and this option value. - */ -NGHTTP2_EXTERN void -nghttp2_option_set_max_deflate_dynamic_table_size(nghttp2_option *option, - size_t val); - -/** - * @function - * - * This option prevents the library from retaining closed streams to - * maintain the priority tree. If this option is set to nonzero, - * applications can discard closed stream completely to save memory. - */ -NGHTTP2_EXTERN void nghttp2_option_set_no_closed_streams(nghttp2_option *option, - int val); - -/** - * @function - * - * Initializes |*session_ptr| for client use. The all members of - * |callbacks| are copied to |*session_ptr|. Therefore |*session_ptr| - * does not store |callbacks|. The |user_data| is an arbitrary user - * supplied data, which will be passed to the callback functions. - * - * The :type:`nghttp2_send_callback` must be specified. If the - * application code uses `nghttp2_session_recv()`, the - * :type:`nghttp2_recv_callback` must be specified. The other members - * of |callbacks| can be ``NULL``. - * - * If this function fails, |*session_ptr| is left untouched. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - */ -NGHTTP2_EXTERN int -nghttp2_session_client_new(nghttp2_session **session_ptr, - const nghttp2_session_callbacks *callbacks, - void *user_data); - -/** - * @function - * - * Initializes |*session_ptr| for server use. The all members of - * |callbacks| are copied to |*session_ptr|. Therefore |*session_ptr| - * does not store |callbacks|. The |user_data| is an arbitrary user - * supplied data, which will be passed to the callback functions. - * - * The :type:`nghttp2_send_callback` must be specified. If the - * application code uses `nghttp2_session_recv()`, the - * :type:`nghttp2_recv_callback` must be specified. The other members - * of |callbacks| can be ``NULL``. - * - * If this function fails, |*session_ptr| is left untouched. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - */ -NGHTTP2_EXTERN int -nghttp2_session_server_new(nghttp2_session **session_ptr, - const nghttp2_session_callbacks *callbacks, - void *user_data); - -/** - * @function - * - * Like `nghttp2_session_client_new()`, but with additional options - * specified in the |option|. - * - * The |option| can be ``NULL`` and the call is equivalent to - * `nghttp2_session_client_new()`. - * - * This function does not take ownership |option|. The application is - * responsible for freeing |option| if it finishes using the object. - * - * The library code does not refer to |option| after this function - * returns. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - */ -NGHTTP2_EXTERN int -nghttp2_session_client_new2(nghttp2_session **session_ptr, - const nghttp2_session_callbacks *callbacks, - void *user_data, const nghttp2_option *option); - -/** - * @function - * - * Like `nghttp2_session_server_new()`, but with additional options - * specified in the |option|. - * - * The |option| can be ``NULL`` and the call is equivalent to - * `nghttp2_session_server_new()`. - * - * This function does not take ownership |option|. The application is - * responsible for freeing |option| if it finishes using the object. - * - * The library code does not refer to |option| after this function - * returns. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - */ -NGHTTP2_EXTERN int -nghttp2_session_server_new2(nghttp2_session **session_ptr, - const nghttp2_session_callbacks *callbacks, - void *user_data, const nghttp2_option *option); - -/** - * @function - * - * Like `nghttp2_session_client_new2()`, but with additional custom - * memory allocator specified in the |mem|. - * - * The |mem| can be ``NULL`` and the call is equivalent to - * `nghttp2_session_client_new2()`. - * - * This function does not take ownership |mem|. The application is - * responsible for freeing |mem|. - * - * The library code does not refer to |mem| pointer after this - * function returns, so the application can safely free it. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - */ -NGHTTP2_EXTERN int nghttp2_session_client_new3( - nghttp2_session **session_ptr, const nghttp2_session_callbacks *callbacks, - void *user_data, const nghttp2_option *option, nghttp2_mem *mem); - -/** - * @function - * - * Like `nghttp2_session_server_new2()`, but with additional custom - * memory allocator specified in the |mem|. - * - * The |mem| can be ``NULL`` and the call is equivalent to - * `nghttp2_session_server_new2()`. - * - * This function does not take ownership |mem|. The application is - * responsible for freeing |mem|. - * - * The library code does not refer to |mem| pointer after this - * function returns, so the application can safely free it. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - */ -NGHTTP2_EXTERN int nghttp2_session_server_new3( - nghttp2_session **session_ptr, const nghttp2_session_callbacks *callbacks, - void *user_data, const nghttp2_option *option, nghttp2_mem *mem); - -/** - * @function - * - * Frees any resources allocated for |session|. If |session| is - * ``NULL``, this function does nothing. - */ -NGHTTP2_EXTERN void nghttp2_session_del(nghttp2_session *session); - -/** - * @function - * - * Sends pending frames to the remote peer. - * - * This function retrieves the highest prioritized frame from the - * outbound queue and sends it to the remote peer. It does this as - * many as possible until the user callback - * :type:`nghttp2_send_callback` returns - * :enum:`NGHTTP2_ERR_WOULDBLOCK` or the outbound queue becomes empty. - * This function calls several callback functions which are passed - * when initializing the |session|. Here is the simple time chart - * which tells when each callback is invoked: - * - * 1. Get the next frame to send from outbound queue. - * - * 2. Prepare transmission of the frame. - * - * 3. If the control frame cannot be sent because some preconditions - * are not met (e.g., request HEADERS cannot be sent after GOAWAY), - * :type:`nghttp2_on_frame_not_send_callback` is invoked. Abort - * the following steps. - * - * 4. If the frame is HEADERS, PUSH_PROMISE or DATA, - * :type:`nghttp2_select_padding_callback` is invoked. - * - * 5. If the frame is request HEADERS, the stream is opened here. - * - * 6. :type:`nghttp2_before_frame_send_callback` is invoked. - * - * 7. If :enum:`NGHTTP2_ERR_CANCEL` is returned from - * :type:`nghttp2_before_frame_send_callback`, the current frame - * transmission is canceled, and - * :type:`nghttp2_on_frame_not_send_callback` is invoked. Abort - * the following steps. - * - * 8. :type:`nghttp2_send_callback` is invoked one or more times to - * send the frame. - * - * 9. :type:`nghttp2_on_frame_send_callback` is invoked. - * - * 10. If the transmission of the frame triggers closure of the - * stream, the stream is closed and - * :type:`nghttp2_on_stream_close_callback` is invoked. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE` - * The callback function failed. - */ -NGHTTP2_EXTERN int nghttp2_session_send(nghttp2_session *session); - -/** - * @function - * - * Returns the serialized data to send. - * - * This function behaves like `nghttp2_session_send()` except that it - * does not use :type:`nghttp2_send_callback` to transmit data. - * Instead, it assigns the pointer to the serialized data to the - * |*data_ptr| and returns its length. The other callbacks are called - * in the same way as they are in `nghttp2_session_send()`. - * - * If no data is available to send, this function returns 0. - * - * This function may not return all serialized data in one invocation. - * To get all data, call this function repeatedly until it returns 0 - * or one of negative error codes. - * - * The assigned |*data_ptr| is valid until the next call of - * `nghttp2_session_mem_send()` or `nghttp2_session_send()`. - * - * The caller must send all data before sending the next chunk of - * data. - * - * This function returns the length of the data pointed by the - * |*data_ptr| if it succeeds, or one of the following negative error - * codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * - * .. note:: - * - * This function may produce very small byte string. If that is the - * case, and application disables Nagle algorithm (``TCP_NODELAY``), - * then writing this small chunk leads to very small packet, and it - * is very inefficient. An application should be responsible to - * buffer up small chunks of data as necessary to avoid this - * situation. - */ -NGHTTP2_EXTERN ssize_t nghttp2_session_mem_send(nghttp2_session *session, - const uint8_t **data_ptr); - -/** - * @function - * - * Receives frames from the remote peer. - * - * This function receives as many frames as possible until the user - * callback :type:`nghttp2_recv_callback` returns - * :enum:`NGHTTP2_ERR_WOULDBLOCK`. This function calls several - * callback functions which are passed when initializing the - * |session|. Here is the simple time chart which tells when each - * callback is invoked: - * - * 1. :type:`nghttp2_recv_callback` is invoked one or more times to - * receive frame header. - * - * 2. When frame header is received, - * :type:`nghttp2_on_begin_frame_callback` is invoked. - * - * 3. If the frame is DATA frame: - * - * 1. :type:`nghttp2_recv_callback` is invoked to receive DATA - * payload. For each chunk of data, - * :type:`nghttp2_on_data_chunk_recv_callback` is invoked. - * - * 2. If one DATA frame is completely received, - * :type:`nghttp2_on_frame_recv_callback` is invoked. If the - * reception of the frame triggers the closure of the stream, - * :type:`nghttp2_on_stream_close_callback` is invoked. - * - * 4. If the frame is the control frame: - * - * 1. :type:`nghttp2_recv_callback` is invoked one or more times to - * receive whole frame. - * - * 2. If the received frame is valid, then following actions are - * taken. If the frame is either HEADERS or PUSH_PROMISE, - * :type:`nghttp2_on_begin_headers_callback` is invoked. Then - * :type:`nghttp2_on_header_callback` is invoked for each header - * name/value pair. For invalid header field, - * :type:`nghttp2_on_invalid_header_callback` is called. After - * all name/value pairs are emitted successfully, - * :type:`nghttp2_on_frame_recv_callback` is invoked. For other - * frames, :type:`nghttp2_on_frame_recv_callback` is invoked. - * If the reception of the frame triggers the closure of the - * stream, :type:`nghttp2_on_stream_close_callback` is invoked. - * - * 3. If the received frame is unpacked but is interpreted as - * invalid, :type:`nghttp2_on_invalid_frame_recv_callback` is - * invoked. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_EOF` - * The remote peer did shutdown on the connection. - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE` - * The callback function failed. - * :enum:`NGHTTP2_ERR_BAD_CLIENT_MAGIC` - * Invalid client magic was detected. This error only returns - * when |session| was configured as server and - * `nghttp2_option_set_no_recv_client_magic()` is not used with - * nonzero value. - * :enum:`NGHTTP2_ERR_FLOODED` - * Flooding was detected in this HTTP/2 session, and it must be - * closed. This is most likely caused by misbehaviour of peer. - */ -NGHTTP2_EXTERN int nghttp2_session_recv(nghttp2_session *session); - -/** - * @function - * - * Processes data |in| as an input from the remote endpoint. The - * |inlen| indicates the number of bytes in the |in|. - * - * This function behaves like `nghttp2_session_recv()` except that it - * does not use :type:`nghttp2_recv_callback` to receive data; the - * |in| is the only data for the invocation of this function. If all - * bytes are processed, this function returns. The other callbacks - * are called in the same way as they are in `nghttp2_session_recv()`. - * - * In the current implementation, this function always tries to - * processes all input data unless either an error occurs or - * :enum:`NGHTTP2_ERR_PAUSE` is returned from - * :type:`nghttp2_on_header_callback` or - * :type:`nghttp2_on_data_chunk_recv_callback`. If - * :enum:`NGHTTP2_ERR_PAUSE` is used, the return value includes the - * number of bytes which was used to produce the data or frame for the - * callback. - * - * This function returns the number of processed bytes, or one of the - * following negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE` - * The callback function failed. - * :enum:`NGHTTP2_ERR_BAD_CLIENT_MAGIC` - * Invalid client magic was detected. This error only returns - * when |session| was configured as server and - * `nghttp2_option_set_no_recv_client_magic()` is not used with - * nonzero value. - * :enum:`NGHTTP2_ERR_FLOODED` - * Flooding was detected in this HTTP/2 session, and it must be - * closed. This is most likely caused by misbehaviour of peer. - */ -NGHTTP2_EXTERN ssize_t nghttp2_session_mem_recv(nghttp2_session *session, - const uint8_t *in, - size_t inlen); - -/** - * @function - * - * Puts back previously deferred DATA frame in the stream |stream_id| - * to the outbound queue. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` - * The stream does not exist; or no deferred data exist. - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - */ -NGHTTP2_EXTERN int nghttp2_session_resume_data(nghttp2_session *session, - int32_t stream_id); - -/** - * @function - * - * Returns nonzero value if |session| wants to receive data from the - * remote peer. - * - * If both `nghttp2_session_want_read()` and - * `nghttp2_session_want_write()` return 0, the application should - * drop the connection. - */ -NGHTTP2_EXTERN int nghttp2_session_want_read(nghttp2_session *session); - -/** - * @function - * - * Returns nonzero value if |session| wants to send data to the remote - * peer. - * - * If both `nghttp2_session_want_read()` and - * `nghttp2_session_want_write()` return 0, the application should - * drop the connection. - */ -NGHTTP2_EXTERN int nghttp2_session_want_write(nghttp2_session *session); - -/** - * @function - * - * Returns stream_user_data for the stream |stream_id|. The - * stream_user_data is provided by `nghttp2_submit_request()`, - * `nghttp2_submit_headers()` or - * `nghttp2_session_set_stream_user_data()`. Unless it is set using - * `nghttp2_session_set_stream_user_data()`, if the stream is - * initiated by the remote endpoint, stream_user_data is always - * ``NULL``. If the stream does not exist, this function returns - * ``NULL``. - */ -NGHTTP2_EXTERN void * -nghttp2_session_get_stream_user_data(nghttp2_session *session, - int32_t stream_id); - -/** - * @function - * - * Sets the |stream_user_data| to the stream denoted by the - * |stream_id|. If a stream user data is already set to the stream, - * it is replaced with the |stream_user_data|. It is valid to specify - * ``NULL`` in the |stream_user_data|, which nullifies the associated - * data pointer. - * - * It is valid to set the |stream_user_data| to the stream reserved by - * PUSH_PROMISE frame. - * - * This function returns 0 if it succeeds, or one of following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` - * The stream does not exist - */ -NGHTTP2_EXTERN int -nghttp2_session_set_stream_user_data(nghttp2_session *session, - int32_t stream_id, void *stream_user_data); - -/** - * @function - * - * Returns the number of frames in the outbound queue. This does not - * include the deferred DATA frames. - */ -NGHTTP2_EXTERN size_t -nghttp2_session_get_outbound_queue_size(nghttp2_session *session); - -/** - * @function - * - * Returns the number of DATA payload in bytes received without - * WINDOW_UPDATE transmission for the stream |stream_id|. The local - * (receive) window size can be adjusted by - * `nghttp2_submit_window_update()`. This function takes into account - * that and returns effective data length. In particular, if the - * local window size is reduced by submitting negative - * window_size_increment with `nghttp2_submit_window_update()`, this - * function returns the number of bytes less than actually received. - * - * This function returns -1 if it fails. - */ -NGHTTP2_EXTERN int32_t nghttp2_session_get_stream_effective_recv_data_length( - nghttp2_session *session, int32_t stream_id); - -/** - * @function - * - * Returns the local (receive) window size for the stream |stream_id|. - * The local window size can be adjusted by - * `nghttp2_submit_window_update()`. This function takes into account - * that and returns effective window size. - * - * This function does not take into account the amount of received - * data from the remote endpoint. Use - * `nghttp2_session_get_stream_local_window_size()` to know the amount - * of data the remote endpoint can send without receiving stream level - * WINDOW_UPDATE frame. Note that each stream is still subject to the - * connection level flow control. - * - * This function returns -1 if it fails. - */ -NGHTTP2_EXTERN int32_t nghttp2_session_get_stream_effective_local_window_size( - nghttp2_session *session, int32_t stream_id); - -/** - * @function - * - * Returns the amount of flow-controlled payload (e.g., DATA) that the - * remote endpoint can send without receiving stream level - * WINDOW_UPDATE frame. It is also subject to the connection level - * flow control. So the actual amount of data to send is - * min(`nghttp2_session_get_stream_local_window_size()`, - * `nghttp2_session_get_local_window_size()`). - * - * This function returns -1 if it fails. - */ -NGHTTP2_EXTERN int32_t nghttp2_session_get_stream_local_window_size( - nghttp2_session *session, int32_t stream_id); - -/** - * @function - * - * Returns the number of DATA payload in bytes received without - * WINDOW_UPDATE transmission for a connection. The local (receive) - * window size can be adjusted by `nghttp2_submit_window_update()`. - * This function takes into account that and returns effective data - * length. In particular, if the local window size is reduced by - * submitting negative window_size_increment with - * `nghttp2_submit_window_update()`, this function returns the number - * of bytes less than actually received. - * - * This function returns -1 if it fails. - */ -NGHTTP2_EXTERN int32_t -nghttp2_session_get_effective_recv_data_length(nghttp2_session *session); - -/** - * @function - * - * Returns the local (receive) window size for a connection. The - * local window size can be adjusted by - * `nghttp2_submit_window_update()`. This function takes into account - * that and returns effective window size. - * - * This function does not take into account the amount of received - * data from the remote endpoint. Use - * `nghttp2_session_get_local_window_size()` to know the amount of - * data the remote endpoint can send without receiving - * connection-level WINDOW_UPDATE frame. Note that each stream is - * still subject to the stream level flow control. - * - * This function returns -1 if it fails. - */ -NGHTTP2_EXTERN int32_t -nghttp2_session_get_effective_local_window_size(nghttp2_session *session); - -/** - * @function - * - * Returns the amount of flow-controlled payload (e.g., DATA) that the - * remote endpoint can send without receiving connection level - * WINDOW_UPDATE frame. Note that each stream is still subject to the - * stream level flow control (see - * `nghttp2_session_get_stream_local_window_size()`). - * - * This function returns -1 if it fails. - */ -NGHTTP2_EXTERN int32_t -nghttp2_session_get_local_window_size(nghttp2_session *session); - -/** - * @function - * - * Returns the remote window size for a given stream |stream_id|. - * - * This is the amount of flow-controlled payload (e.g., DATA) that the - * local endpoint can send without stream level WINDOW_UPDATE. There - * is also connection level flow control, so the effective size of - * payload that the local endpoint can actually send is - * min(`nghttp2_session_get_stream_remote_window_size()`, - * `nghttp2_session_get_remote_window_size()`). - * - * This function returns -1 if it fails. - */ -NGHTTP2_EXTERN int32_t nghttp2_session_get_stream_remote_window_size( - nghttp2_session *session, int32_t stream_id); - -/** - * @function - * - * Returns the remote window size for a connection. - * - * This function always succeeds. - */ -NGHTTP2_EXTERN int32_t -nghttp2_session_get_remote_window_size(nghttp2_session *session); - -/** - * @function - * - * Returns 1 if local peer half closed the given stream |stream_id|. - * Returns 0 if it did not. Returns -1 if no such stream exists. - */ -NGHTTP2_EXTERN int -nghttp2_session_get_stream_local_close(nghttp2_session *session, - int32_t stream_id); - -/** - * @function - * - * Returns 1 if remote peer half closed the given stream |stream_id|. - * Returns 0 if it did not. Returns -1 if no such stream exists. - */ -NGHTTP2_EXTERN int -nghttp2_session_get_stream_remote_close(nghttp2_session *session, - int32_t stream_id); - -/** - * @function - * - * Returns the current dynamic table size of HPACK inflater, including - * the overhead 32 bytes per entry described in RFC 7541. - */ -NGHTTP2_EXTERN size_t -nghttp2_session_get_hd_inflate_dynamic_table_size(nghttp2_session *session); - -/** - * @function - * - * Returns the current dynamic table size of HPACK deflater including - * the overhead 32 bytes per entry described in RFC 7541. - */ -NGHTTP2_EXTERN size_t -nghttp2_session_get_hd_deflate_dynamic_table_size(nghttp2_session *session); - -/** - * @function - * - * Signals the session so that the connection should be terminated. - * - * The last stream ID is the minimum value between the stream ID of a - * stream for which :type:`nghttp2_on_frame_recv_callback` was called - * most recently and the last stream ID we have sent to the peer - * previously. - * - * The |error_code| is the error code of this GOAWAY frame. The - * pre-defined error code is one of :enum:`nghttp2_error_code`. - * - * After the transmission, both `nghttp2_session_want_read()` and - * `nghttp2_session_want_write()` return 0. - * - * This function should be called when the connection should be - * terminated after sending GOAWAY. If the remaining streams should - * be processed after GOAWAY, use `nghttp2_submit_goaway()` instead. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - */ -NGHTTP2_EXTERN int nghttp2_session_terminate_session(nghttp2_session *session, - uint32_t error_code); - -/** - * @function - * - * Signals the session so that the connection should be terminated. - * - * This function behaves like `nghttp2_session_terminate_session()`, - * but the last stream ID can be specified by the application for fine - * grained control of stream. The HTTP/2 specification does not allow - * last_stream_id to be increased. So the actual value sent as - * last_stream_id is the minimum value between the given - * |last_stream_id| and the last_stream_id we have previously sent to - * the peer. - * - * The |last_stream_id| is peer's stream ID or 0. So if |session| is - * initialized as client, |last_stream_id| must be even or 0. If - * |session| is initialized as server, |last_stream_id| must be odd or - * 0. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` - * The |last_stream_id| is invalid. - */ -NGHTTP2_EXTERN int nghttp2_session_terminate_session2(nghttp2_session *session, - int32_t last_stream_id, - uint32_t error_code); - -/** - * @function - * - * Signals to the client that the server started graceful shutdown - * procedure. - * - * This function is only usable for server. If this function is - * called with client side session, this function returns - * :enum:`NGHTTP2_ERR_INVALID_STATE`. - * - * To gracefully shutdown HTTP/2 session, server should call this - * function to send GOAWAY with last_stream_id (1u << 31) - 1. And - * after some delay (e.g., 1 RTT), send another GOAWAY with the stream - * ID that the server has some processing using - * `nghttp2_submit_goaway()`. See also - * `nghttp2_session_get_last_proc_stream_id()`. - * - * Unlike `nghttp2_submit_goaway()`, this function just sends GOAWAY - * and does nothing more. This is a mere indication to the client - * that session shutdown is imminent. The application should call - * `nghttp2_submit_goaway()` with appropriate last_stream_id after - * this call. - * - * If one or more GOAWAY frame have been already sent by either - * `nghttp2_submit_goaway()` or `nghttp2_session_terminate_session()`, - * this function has no effect. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_INVALID_STATE` - * The |session| is initialized as client. - */ -NGHTTP2_EXTERN int nghttp2_submit_shutdown_notice(nghttp2_session *session); - -/** - * @function - * - * Returns the value of SETTINGS |id| notified by a remote endpoint. - * The |id| must be one of values defined in - * :enum:`nghttp2_settings_id`. - */ -NGHTTP2_EXTERN uint32_t nghttp2_session_get_remote_settings( - nghttp2_session *session, nghttp2_settings_id id); - -/** - * @function - * - * Returns the value of SETTINGS |id| of local endpoint acknowledged - * by the remote endpoint. The |id| must be one of the values defined - * in :enum:`nghttp2_settings_id`. - */ -NGHTTP2_EXTERN uint32_t nghttp2_session_get_local_settings( - nghttp2_session *session, nghttp2_settings_id id); - -/** - * @function - * - * Tells the |session| that next stream ID is |next_stream_id|. The - * |next_stream_id| must be equal or greater than the value returned - * by `nghttp2_session_get_next_stream_id()`. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` - * The |next_stream_id| is strictly less than the value - * `nghttp2_session_get_next_stream_id()` returns; or - * |next_stream_id| is invalid (e.g., even integer for client, or - * odd integer for server). - */ -NGHTTP2_EXTERN int nghttp2_session_set_next_stream_id(nghttp2_session *session, - int32_t next_stream_id); - -/** - * @function - * - * Returns the next outgoing stream ID. Notice that return type is - * uint32_t. If we run out of stream ID for this session, this - * function returns 1 << 31. - */ -NGHTTP2_EXTERN uint32_t -nghttp2_session_get_next_stream_id(nghttp2_session *session); - -/** - * @function - * - * Tells the |session| that |size| bytes for a stream denoted by - * |stream_id| were consumed by application and are ready to - * WINDOW_UPDATE. The consumed bytes are counted towards both - * connection and stream level WINDOW_UPDATE (see - * `nghttp2_session_consume_connection()` and - * `nghttp2_session_consume_stream()` to update consumption - * independently). This function is intended to be used without - * automatic window update (see - * `nghttp2_option_set_no_auto_window_update()`). - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` - * The |stream_id| is 0. - * :enum:`NGHTTP2_ERR_INVALID_STATE` - * Automatic WINDOW_UPDATE is not disabled. - */ -NGHTTP2_EXTERN int nghttp2_session_consume(nghttp2_session *session, - int32_t stream_id, size_t size); - -/** - * @function - * - * Like `nghttp2_session_consume()`, but this only tells library that - * |size| bytes were consumed only for connection level. Note that - * HTTP/2 maintains connection and stream level flow control windows - * independently. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_INVALID_STATE` - * Automatic WINDOW_UPDATE is not disabled. - */ -NGHTTP2_EXTERN int nghttp2_session_consume_connection(nghttp2_session *session, - size_t size); - -/** - * @function - * - * Like `nghttp2_session_consume()`, but this only tells library that - * |size| bytes were consumed only for stream denoted by |stream_id|. - * Note that HTTP/2 maintains connection and stream level flow control - * windows independently. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` - * The |stream_id| is 0. - * :enum:`NGHTTP2_ERR_INVALID_STATE` - * Automatic WINDOW_UPDATE is not disabled. - */ -NGHTTP2_EXTERN int nghttp2_session_consume_stream(nghttp2_session *session, - int32_t stream_id, - size_t size); - -/** - * @function - * - * Changes priority of existing stream denoted by |stream_id|. The - * new priority specification is |pri_spec|. - * - * The priority is changed silently and instantly, and no PRIORITY - * frame will be sent to notify the peer of this change. This - * function may be useful for server to change the priority of pushed - * stream. - * - * If |session| is initialized as server, and ``pri_spec->stream_id`` - * points to the idle stream, the idle stream is created if it does - * not exist. The created idle stream will depend on root stream - * (stream 0) with weight 16. - * - * Otherwise, if stream denoted by ``pri_spec->stream_id`` is not - * found, we use default priority instead of given |pri_spec|. That - * is make stream depend on root stream with weight 16. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` - * Attempted to depend on itself; or no stream exist for the given - * |stream_id|; or |stream_id| is 0 - */ -NGHTTP2_EXTERN int -nghttp2_session_change_stream_priority(nghttp2_session *session, - int32_t stream_id, - const nghttp2_priority_spec *pri_spec); - -/** - * @function - * - * Creates idle stream with the given |stream_id|, and priority - * |pri_spec|. - * - * The stream creation is done without sending PRIORITY frame, which - * means that peer does not know about the existence of this idle - * stream in the local endpoint. - * - * RFC 7540 does not disallow the use of creation of idle stream with - * odd or even stream ID regardless of client or server. So this - * function can create odd or even stream ID regardless of client or - * server. But probably it is a bit safer to use the stream ID the - * local endpoint can initiate (in other words, use odd stream ID for - * client, and even stream ID for server), to avoid potential - * collision from peer's instruction. Also we can use - * `nghttp2_session_set_next_stream_id()` to avoid to open created - * idle streams accidentally if we follow this recommendation. - * - * If |session| is initialized as server, and ``pri_spec->stream_id`` - * points to the idle stream, the idle stream is created if it does - * not exist. The created idle stream will depend on root stream - * (stream 0) with weight 16. - * - * Otherwise, if stream denoted by ``pri_spec->stream_id`` is not - * found, we use default priority instead of given |pri_spec|. That - * is make stream depend on root stream with weight 16. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` - * Attempted to depend on itself; or stream denoted by |stream_id| - * already exists; or |stream_id| cannot be used to create idle - * stream (in other words, local endpoint has already opened - * stream ID greater than or equal to the given stream ID; or - * |stream_id| is 0 - */ -NGHTTP2_EXTERN int -nghttp2_session_create_idle_stream(nghttp2_session *session, int32_t stream_id, - const nghttp2_priority_spec *pri_spec); - -/** - * @function - * - * Performs post-process of HTTP Upgrade request. This function can - * be called from both client and server, but the behavior is very - * different in each other. - * - * .. warning:: - * - * This function is deprecated in favor of - * `nghttp2_session_upgrade2()`, because this function lacks the - * parameter to tell the library the request method used in the - * original HTTP request. This information is required for client - * to validate actual response body length against content-length - * header field (see `nghttp2_option_set_no_http_messaging()`). If - * HEAD is used in request, the length of response body must be 0 - * regardless of value included in content-length header field. - * - * If called from client side, the |settings_payload| must be the - * value sent in ``HTTP2-Settings`` header field and must be decoded - * by base64url decoder. The |settings_payloadlen| is the length of - * |settings_payload|. The |settings_payload| is unpacked and its - * setting values will be submitted using `nghttp2_submit_settings()`. - * This means that the client application code does not need to submit - * SETTINGS by itself. The stream with stream ID=1 is opened and the - * |stream_user_data| is used for its stream_user_data. The opened - * stream becomes half-closed (local) state. - * - * If called from server side, the |settings_payload| must be the - * value received in ``HTTP2-Settings`` header field and must be - * decoded by base64url decoder. The |settings_payloadlen| is the - * length of |settings_payload|. It is treated as if the SETTINGS - * frame with that payload is received. Thus, callback functions for - * the reception of SETTINGS frame will be invoked. The stream with - * stream ID=1 is opened. The |stream_user_data| is ignored. The - * opened stream becomes half-closed (remote). - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` - * The |settings_payload| is badly formed. - * :enum:`NGHTTP2_ERR_PROTO` - * The stream ID 1 is already used or closed; or is not available. - */ -NGHTTP2_EXTERN int nghttp2_session_upgrade(nghttp2_session *session, - const uint8_t *settings_payload, - size_t settings_payloadlen, - void *stream_user_data); - -/** - * @function - * - * Performs post-process of HTTP Upgrade request. This function can - * be called from both client and server, but the behavior is very - * different in each other. - * - * If called from client side, the |settings_payload| must be the - * value sent in ``HTTP2-Settings`` header field and must be decoded - * by base64url decoder. The |settings_payloadlen| is the length of - * |settings_payload|. The |settings_payload| is unpacked and its - * setting values will be submitted using `nghttp2_submit_settings()`. - * This means that the client application code does not need to submit - * SETTINGS by itself. The stream with stream ID=1 is opened and the - * |stream_user_data| is used for its stream_user_data. The opened - * stream becomes half-closed (local) state. - * - * If called from server side, the |settings_payload| must be the - * value received in ``HTTP2-Settings`` header field and must be - * decoded by base64url decoder. The |settings_payloadlen| is the - * length of |settings_payload|. It is treated as if the SETTINGS - * frame with that payload is received. Thus, callback functions for - * the reception of SETTINGS frame will be invoked. The stream with - * stream ID=1 is opened. The |stream_user_data| is ignored. The - * opened stream becomes half-closed (remote). - * - * If the request method is HEAD, pass nonzero value to - * |head_request|. Otherwise, pass 0. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` - * The |settings_payload| is badly formed. - * :enum:`NGHTTP2_ERR_PROTO` - * The stream ID 1 is already used or closed; or is not available. - */ -NGHTTP2_EXTERN int nghttp2_session_upgrade2(nghttp2_session *session, - const uint8_t *settings_payload, - size_t settings_payloadlen, - int head_request, - void *stream_user_data); - -/** - * @function - * - * Serializes the SETTINGS values |iv| in the |buf|. The size of the - * |buf| is specified by |buflen|. The number of entries in the |iv| - * array is given by |niv|. The required space in |buf| for the |niv| - * entries is ``6*niv`` bytes and if the given buffer is too small, an - * error is returned. This function is used mainly for creating a - * SETTINGS payload to be sent with the ``HTTP2-Settings`` header - * field in an HTTP Upgrade request. The data written in |buf| is NOT - * base64url encoded and the application is responsible for encoding. - * - * This function returns the number of bytes written in |buf|, or one - * of the following negative error codes: - * - * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` - * The |iv| contains duplicate settings ID or invalid value. - * - * :enum:`NGHTTP2_ERR_INSUFF_BUFSIZE` - * The provided |buflen| size is too small to hold the output. - */ -NGHTTP2_EXTERN ssize_t nghttp2_pack_settings_payload( - uint8_t *buf, size_t buflen, const nghttp2_settings_entry *iv, size_t niv); - -/** - * @function - * - * Returns string describing the |lib_error_code|. The - * |lib_error_code| must be one of the :enum:`nghttp2_error`. - */ -NGHTTP2_EXTERN const char *nghttp2_strerror(int lib_error_code); - -/** - * @function - * - * Returns string representation of HTTP/2 error code |error_code| - * (e.g., ``PROTOCOL_ERROR`` is returned if ``error_code == - * NGHTTP2_PROTOCOL_ERROR``). If string representation is unknown for - * given |error_code|, this function returns string ``unknown``. - */ -NGHTTP2_EXTERN const char *nghttp2_http2_strerror(uint32_t error_code); - -/** - * @function - * - * Initializes |pri_spec| with the |stream_id| of the stream to depend - * on with |weight| and its exclusive flag. If |exclusive| is - * nonzero, exclusive flag is set. - * - * The |weight| must be in [:enum:`NGHTTP2_MIN_WEIGHT`, - * :enum:`NGHTTP2_MAX_WEIGHT`], inclusive. - */ -NGHTTP2_EXTERN void nghttp2_priority_spec_init(nghttp2_priority_spec *pri_spec, - int32_t stream_id, - int32_t weight, int exclusive); - -/** - * @function - * - * Initializes |pri_spec| with the default values. The default values - * are: stream_id = 0, weight = :macro:`NGHTTP2_DEFAULT_WEIGHT` and - * exclusive = 0. - */ -NGHTTP2_EXTERN void -nghttp2_priority_spec_default_init(nghttp2_priority_spec *pri_spec); - -/** - * @function - * - * Returns nonzero if the |pri_spec| is filled with default values. - */ -NGHTTP2_EXTERN int -nghttp2_priority_spec_check_default(const nghttp2_priority_spec *pri_spec); - -/** - * @function - * - * Submits HEADERS frame and optionally one or more DATA frames. - * - * The |pri_spec| is priority specification of this request. ``NULL`` - * means the default priority (see - * `nghttp2_priority_spec_default_init()`). To specify the priority, - * use `nghttp2_priority_spec_init()`. If |pri_spec| is not ``NULL``, - * this function will copy its data members. - * - * The ``pri_spec->weight`` must be in [:enum:`NGHTTP2_MIN_WEIGHT`, - * :enum:`NGHTTP2_MAX_WEIGHT`], inclusive. If ``pri_spec->weight`` is - * strictly less than :enum:`NGHTTP2_MIN_WEIGHT`, it becomes - * :enum:`NGHTTP2_MIN_WEIGHT`. If it is strictly greater than - * :enum:`NGHTTP2_MAX_WEIGHT`, it becomes :enum:`NGHTTP2_MAX_WEIGHT`. - * - * The |nva| is an array of name/value pair :type:`nghttp2_nv` with - * |nvlen| elements. The application is responsible to include - * required pseudo-header fields (header field whose name starts with - * ":") in |nva| and must place pseudo-headers before regular header - * fields. - * - * This function creates copies of all name/value pairs in |nva|. It - * also lower-cases all names in |nva|. The order of elements in - * |nva| is preserved. For header fields with - * :enum:`NGHTTP2_NV_FLAG_NO_COPY_NAME` and - * :enum:`NGHTTP2_NV_FLAG_NO_COPY_VALUE` are set, header field name - * and value are not copied respectively. With - * :enum:`NGHTTP2_NV_FLAG_NO_COPY_NAME`, application is responsible to - * pass header field name in lowercase. The application should - * maintain the references to them until - * :type:`nghttp2_on_frame_send_callback` or - * :type:`nghttp2_on_frame_not_send_callback` is called. - * - * HTTP/2 specification has requirement about header fields in the - * request HEADERS. See the specification for more details. - * - * If |data_prd| is not ``NULL``, it provides data which will be sent - * in subsequent DATA frames. In this case, a method that allows - * request message bodies - * (https://tools.ietf.org/html/rfc7231#section-4) must be specified - * with ``:method`` key in |nva| (e.g. ``POST``). This function does - * not take ownership of the |data_prd|. The function copies the - * members of the |data_prd|. If |data_prd| is ``NULL``, HEADERS have - * END_STREAM set. The |stream_user_data| is data associated to the - * stream opened by this request and can be an arbitrary pointer, - * which can be retrieved later by - * `nghttp2_session_get_stream_user_data()`. - * - * This function returns assigned stream ID if it succeeds, or one of - * the following negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE` - * No stream ID is available because maximum stream ID was - * reached. - * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` - * Trying to depend on itself (new stream ID equals - * ``pri_spec->stream_id``). - * :enum:`NGHTTP2_ERR_PROTO` - * The |session| is server session. - * - * .. warning:: - * - * This function returns assigned stream ID if it succeeds. But - * that stream is not opened yet. The application must not submit - * frame to that stream ID before - * :type:`nghttp2_before_frame_send_callback` is called for this - * frame. - * - */ -NGHTTP2_EXTERN int32_t nghttp2_submit_request( - nghttp2_session *session, const nghttp2_priority_spec *pri_spec, - const nghttp2_nv *nva, size_t nvlen, const nghttp2_data_provider *data_prd, - void *stream_user_data); - -/** - * @function - * - * Submits response HEADERS frame and optionally one or more DATA - * frames against the stream |stream_id|. - * - * The |nva| is an array of name/value pair :type:`nghttp2_nv` with - * |nvlen| elements. The application is responsible to include - * required pseudo-header fields (header field whose name starts with - * ":") in |nva| and must place pseudo-headers before regular header - * fields. - * - * This function creates copies of all name/value pairs in |nva|. It - * also lower-cases all names in |nva|. The order of elements in - * |nva| is preserved. For header fields with - * :enum:`NGHTTP2_NV_FLAG_NO_COPY_NAME` and - * :enum:`NGHTTP2_NV_FLAG_NO_COPY_VALUE` are set, header field name - * and value are not copied respectively. With - * :enum:`NGHTTP2_NV_FLAG_NO_COPY_NAME`, application is responsible to - * pass header field name in lowercase. The application should - * maintain the references to them until - * :type:`nghttp2_on_frame_send_callback` or - * :type:`nghttp2_on_frame_not_send_callback` is called. - * - * HTTP/2 specification has requirement about header fields in the - * response HEADERS. See the specification for more details. - * - * If |data_prd| is not ``NULL``, it provides data which will be sent - * in subsequent DATA frames. This function does not take ownership - * of the |data_prd|. The function copies the members of the - * |data_prd|. If |data_prd| is ``NULL``, HEADERS will have - * END_STREAM flag set. - * - * This method can be used as normal HTTP response and push response. - * When pushing a resource using this function, the |session| must be - * configured using `nghttp2_session_server_new()` or its variants and - * the target stream denoted by the |stream_id| must be reserved using - * `nghttp2_submit_push_promise()`. - * - * To send non-final response headers (e.g., HTTP status 101), don't - * use this function because this function half-closes the outbound - * stream. Instead, use `nghttp2_submit_headers()` for this purpose. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` - * The |stream_id| is 0. - * :enum:`NGHTTP2_ERR_DATA_EXIST` - * DATA or HEADERS has been already submitted and not fully - * processed yet. Normally, this does not happen, but when - * application wrongly calls `nghttp2_submit_response()` twice, - * this may happen. - * :enum:`NGHTTP2_ERR_PROTO` - * The |session| is client session. - * - * .. warning:: - * - * Calling this function twice for the same stream ID may lead to - * program crash. It is generally considered to a programming error - * to commit response twice. - */ -NGHTTP2_EXTERN int -nghttp2_submit_response(nghttp2_session *session, int32_t stream_id, - const nghttp2_nv *nva, size_t nvlen, - const nghttp2_data_provider *data_prd); - -/** - * @function - * - * Submits trailer fields HEADERS against the stream |stream_id|. - * - * The |nva| is an array of name/value pair :type:`nghttp2_nv` with - * |nvlen| elements. The application must not include pseudo-header - * fields (headers whose names starts with ":") in |nva|. - * - * This function creates copies of all name/value pairs in |nva|. It - * also lower-cases all names in |nva|. The order of elements in - * |nva| is preserved. For header fields with - * :enum:`NGHTTP2_NV_FLAG_NO_COPY_NAME` and - * :enum:`NGHTTP2_NV_FLAG_NO_COPY_VALUE` are set, header field name - * and value are not copied respectively. With - * :enum:`NGHTTP2_NV_FLAG_NO_COPY_NAME`, application is responsible to - * pass header field name in lowercase. The application should - * maintain the references to them until - * :type:`nghttp2_on_frame_send_callback` or - * :type:`nghttp2_on_frame_not_send_callback` is called. - * - * For server, trailer fields must follow response HEADERS or response - * DATA without END_STREAM flat set. The library does not enforce - * this requirement, and applications should do this for themselves. - * If `nghttp2_submit_trailer()` is called before any response HEADERS - * submission (usually by `nghttp2_submit_response()`), the content of - * |nva| will be sent as response headers, which will result in error. - * - * This function has the same effect with `nghttp2_submit_headers()`, - * with flags = :enum:`NGHTTP2_FLAG_END_STREAM` and both pri_spec and - * stream_user_data to NULL. - * - * To submit trailer fields after `nghttp2_submit_response()` is - * called, the application has to specify - * :type:`nghttp2_data_provider` to `nghttp2_submit_response()`. - * Inside of :type:`nghttp2_data_source_read_callback`, when setting - * :enum:`NGHTTP2_DATA_FLAG_EOF`, also set - * :enum:`NGHTTP2_DATA_FLAG_NO_END_STREAM`. After that, the - * application can send trailer fields using - * `nghttp2_submit_trailer()`. `nghttp2_submit_trailer()` can be used - * inside :type:`nghttp2_data_source_read_callback`. - * - * This function returns 0 if it succeeds and |stream_id| is -1. - * Otherwise, this function returns 0 if it succeeds, or one of the - * following negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` - * The |stream_id| is 0. - */ -NGHTTP2_EXTERN int nghttp2_submit_trailer(nghttp2_session *session, - int32_t stream_id, - const nghttp2_nv *nva, size_t nvlen); - -/** - * @function - * - * Submits HEADERS frame. The |flags| is bitwise OR of the - * following values: - * - * * :enum:`NGHTTP2_FLAG_END_STREAM` - * - * If |flags| includes :enum:`NGHTTP2_FLAG_END_STREAM`, this frame has - * END_STREAM flag set. - * - * The library handles the CONTINUATION frame internally and it - * correctly sets END_HEADERS to the last sequence of the PUSH_PROMISE - * or CONTINUATION frame. - * - * If the |stream_id| is -1, this frame is assumed as request (i.e., - * request HEADERS frame which opens new stream). In this case, the - * assigned stream ID will be returned. Otherwise, specify stream ID - * in |stream_id|. - * - * The |pri_spec| is priority specification of this request. ``NULL`` - * means the default priority (see - * `nghttp2_priority_spec_default_init()`). To specify the priority, - * use `nghttp2_priority_spec_init()`. If |pri_spec| is not ``NULL``, - * this function will copy its data members. - * - * The ``pri_spec->weight`` must be in [:enum:`NGHTTP2_MIN_WEIGHT`, - * :enum:`NGHTTP2_MAX_WEIGHT`], inclusive. If ``pri_spec->weight`` is - * strictly less than :enum:`NGHTTP2_MIN_WEIGHT`, it becomes - * :enum:`NGHTTP2_MIN_WEIGHT`. If it is strictly greater than - * :enum:`NGHTTP2_MAX_WEIGHT`, it becomes :enum:`NGHTTP2_MAX_WEIGHT`. - * - * The |nva| is an array of name/value pair :type:`nghttp2_nv` with - * |nvlen| elements. The application is responsible to include - * required pseudo-header fields (header field whose name starts with - * ":") in |nva| and must place pseudo-headers before regular header - * fields. - * - * This function creates copies of all name/value pairs in |nva|. It - * also lower-cases all names in |nva|. The order of elements in - * |nva| is preserved. For header fields with - * :enum:`NGHTTP2_NV_FLAG_NO_COPY_NAME` and - * :enum:`NGHTTP2_NV_FLAG_NO_COPY_VALUE` are set, header field name - * and value are not copied respectively. With - * :enum:`NGHTTP2_NV_FLAG_NO_COPY_NAME`, application is responsible to - * pass header field name in lowercase. The application should - * maintain the references to them until - * :type:`nghttp2_on_frame_send_callback` or - * :type:`nghttp2_on_frame_not_send_callback` is called. - * - * The |stream_user_data| is a pointer to an arbitrary data which is - * associated to the stream this frame will open. Therefore it is - * only used if this frame opens streams, in other words, it changes - * stream state from idle or reserved to open. - * - * This function is low-level in a sense that the application code can - * specify flags directly. For usual HTTP request, - * `nghttp2_submit_request()` is useful. Likewise, for HTTP response, - * prefer `nghttp2_submit_response()`. - * - * This function returns newly assigned stream ID if it succeeds and - * |stream_id| is -1. Otherwise, this function returns 0 if it - * succeeds, or one of the following negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE` - * No stream ID is available because maximum stream ID was - * reached. - * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` - * The |stream_id| is 0; or trying to depend on itself (stream ID - * equals ``pri_spec->stream_id``). - * :enum:`NGHTTP2_ERR_DATA_EXIST` - * DATA or HEADERS has been already submitted and not fully - * processed yet. This happens if stream denoted by |stream_id| - * is in reserved state. - * :enum:`NGHTTP2_ERR_PROTO` - * The |stream_id| is -1, and |session| is server session. - * - * .. warning:: - * - * This function returns assigned stream ID if it succeeds and - * |stream_id| is -1. But that stream is not opened yet. The - * application must not submit frame to that stream ID before - * :type:`nghttp2_before_frame_send_callback` is called for this - * frame. - * - */ -NGHTTP2_EXTERN int32_t nghttp2_submit_headers( - nghttp2_session *session, uint8_t flags, int32_t stream_id, - const nghttp2_priority_spec *pri_spec, const nghttp2_nv *nva, size_t nvlen, - void *stream_user_data); - -/** - * @function - * - * Submits one or more DATA frames to the stream |stream_id|. The - * data to be sent are provided by |data_prd|. If |flags| contains - * :enum:`NGHTTP2_FLAG_END_STREAM`, the last DATA frame has END_STREAM - * flag set. - * - * This function does not take ownership of the |data_prd|. The - * function copies the members of the |data_prd|. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_DATA_EXIST` - * DATA or HEADERS has been already submitted and not fully - * processed yet. - * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` - * The |stream_id| is 0. - * :enum:`NGHTTP2_ERR_STREAM_CLOSED` - * The stream was already closed; or the |stream_id| is invalid. - * - * .. note:: - * - * Currently, only one DATA or HEADERS is allowed for a stream at a - * time. Submitting these frames more than once before first DATA - * or HEADERS is finished results in :enum:`NGHTTP2_ERR_DATA_EXIST` - * error code. The earliest callback which tells that previous - * frame is done is :type:`nghttp2_on_frame_send_callback`. In side - * that callback, new data can be submitted using - * `nghttp2_submit_data()`. Of course, all data except for last one - * must not have :enum:`NGHTTP2_FLAG_END_STREAM` flag set in - * |flags|. This sounds a bit complicated, and we recommend to use - * `nghttp2_submit_request()` and `nghttp2_submit_response()` to - * avoid this cascading issue. The experience shows that for HTTP - * use, these two functions are enough to implement both client and - * server. - */ -NGHTTP2_EXTERN int nghttp2_submit_data(nghttp2_session *session, uint8_t flags, - int32_t stream_id, - const nghttp2_data_provider *data_prd); - -/** - * @function - * - * Submits PRIORITY frame to change the priority of stream |stream_id| - * to the priority specification |pri_spec|. - * - * The |flags| is currently ignored and should be - * :enum:`NGHTTP2_FLAG_NONE`. - * - * The |pri_spec| is priority specification of this request. ``NULL`` - * is not allowed for this function. To specify the priority, use - * `nghttp2_priority_spec_init()`. This function will copy its data - * members. - * - * The ``pri_spec->weight`` must be in [:enum:`NGHTTP2_MIN_WEIGHT`, - * :enum:`NGHTTP2_MAX_WEIGHT`], inclusive. If ``pri_spec->weight`` is - * strictly less than :enum:`NGHTTP2_MIN_WEIGHT`, it becomes - * :enum:`NGHTTP2_MIN_WEIGHT`. If it is strictly greater than - * :enum:`NGHTTP2_MAX_WEIGHT`, it becomes :enum:`NGHTTP2_MAX_WEIGHT`. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` - * The |stream_id| is 0; or the |pri_spec| is NULL; or trying to - * depend on itself. - */ -NGHTTP2_EXTERN int -nghttp2_submit_priority(nghttp2_session *session, uint8_t flags, - int32_t stream_id, - const nghttp2_priority_spec *pri_spec); - -/** - * @function - * - * Submits RST_STREAM frame to cancel/reject the stream |stream_id| - * with the error code |error_code|. - * - * The pre-defined error code is one of :enum:`nghttp2_error_code`. - * - * The |flags| is currently ignored and should be - * :enum:`NGHTTP2_FLAG_NONE`. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` - * The |stream_id| is 0. - */ -NGHTTP2_EXTERN int nghttp2_submit_rst_stream(nghttp2_session *session, - uint8_t flags, int32_t stream_id, - uint32_t error_code); - -/** - * @function - * - * Stores local settings and submits SETTINGS frame. The |iv| is the - * pointer to the array of :type:`nghttp2_settings_entry`. The |niv| - * indicates the number of :type:`nghttp2_settings_entry`. - * - * The |flags| is currently ignored and should be - * :enum:`NGHTTP2_FLAG_NONE`. - * - * This function does not take ownership of the |iv|. This function - * copies all the elements in the |iv|. - * - * While updating individual stream's local window size, if the window - * size becomes strictly larger than NGHTTP2_MAX_WINDOW_SIZE, - * RST_STREAM is issued against such a stream. - * - * SETTINGS with :enum:`NGHTTP2_FLAG_ACK` is automatically submitted - * by the library and application could not send it at its will. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` - * The |iv| contains invalid value (e.g., initial window size - * strictly greater than (1 << 31) - 1. - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - */ -NGHTTP2_EXTERN int nghttp2_submit_settings(nghttp2_session *session, - uint8_t flags, - const nghttp2_settings_entry *iv, - size_t niv); - -/** - * @function - * - * Submits PUSH_PROMISE frame. - * - * The |flags| is currently ignored. The library handles the - * CONTINUATION frame internally and it correctly sets END_HEADERS to - * the last sequence of the PUSH_PROMISE or CONTINUATION frame. - * - * The |stream_id| must be client initiated stream ID. - * - * The |nva| is an array of name/value pair :type:`nghttp2_nv` with - * |nvlen| elements. The application is responsible to include - * required pseudo-header fields (header field whose name starts with - * ":") in |nva| and must place pseudo-headers before regular header - * fields. - * - * This function creates copies of all name/value pairs in |nva|. It - * also lower-cases all names in |nva|. The order of elements in - * |nva| is preserved. For header fields with - * :enum:`NGHTTP2_NV_FLAG_NO_COPY_NAME` and - * :enum:`NGHTTP2_NV_FLAG_NO_COPY_VALUE` are set, header field name - * and value are not copied respectively. With - * :enum:`NGHTTP2_NV_FLAG_NO_COPY_NAME`, application is responsible to - * pass header field name in lowercase. The application should - * maintain the references to them until - * :type:`nghttp2_on_frame_send_callback` or - * :type:`nghttp2_on_frame_not_send_callback` is called. - * - * The |promised_stream_user_data| is a pointer to an arbitrary data - * which is associated to the promised stream this frame will open and - * make it in reserved state. It is available using - * `nghttp2_session_get_stream_user_data()`. The application can - * access it in :type:`nghttp2_before_frame_send_callback` and - * :type:`nghttp2_on_frame_send_callback` of this frame. - * - * The client side is not allowed to use this function. - * - * To submit response headers and data, use - * `nghttp2_submit_response()`. - * - * This function returns assigned promised stream ID if it succeeds, - * or one of the following negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_PROTO` - * This function was invoked when |session| is initialized as - * client. - * :enum:`NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE` - * No stream ID is available because maximum stream ID was - * reached. - * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` - * The |stream_id| is 0; The |stream_id| does not designate stream - * that peer initiated. - * :enum:`NGHTTP2_ERR_STREAM_CLOSED` - * The stream was already closed; or the |stream_id| is invalid. - * - * .. warning:: - * - * This function returns assigned promised stream ID if it succeeds. - * As of 1.16.0, stream object for pushed resource is created when - * this function succeeds. In that case, the application can submit - * push response for the promised frame. - * - * In 1.15.0 or prior versions, pushed stream is not opened yet when - * this function succeeds. The application must not submit frame to - * that stream ID before :type:`nghttp2_before_frame_send_callback` - * is called for this frame. - * - */ -NGHTTP2_EXTERN int32_t nghttp2_submit_push_promise( - nghttp2_session *session, uint8_t flags, int32_t stream_id, - const nghttp2_nv *nva, size_t nvlen, void *promised_stream_user_data); - -/** - * @function - * - * Submits PING frame. You don't have to send PING back when you - * received PING frame. The library automatically submits PING frame - * in this case. - * - * The |flags| is bitwise OR of 0 or more of the following value. - * - * * :enum:`NGHTTP2_FLAG_ACK` - * - * Unless `nghttp2_option_set_no_auto_ping_ack()` is used, the |flags| - * should be :enum:`NGHTTP2_FLAG_NONE`. - * - * If the |opaque_data| is non ``NULL``, then it should point to the 8 - * bytes array of memory to specify opaque data to send with PING - * frame. If the |opaque_data| is ``NULL``, zero-cleared 8 bytes will - * be sent as opaque data. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - */ -NGHTTP2_EXTERN int nghttp2_submit_ping(nghttp2_session *session, uint8_t flags, - const uint8_t *opaque_data); - -/** - * @function - * - * Submits GOAWAY frame with the last stream ID |last_stream_id| and - * the error code |error_code|. - * - * The pre-defined error code is one of :enum:`nghttp2_error_code`. - * - * The |flags| is currently ignored and should be - * :enum:`NGHTTP2_FLAG_NONE`. - * - * The |last_stream_id| is peer's stream ID or 0. So if |session| is - * initialized as client, |last_stream_id| must be even or 0. If - * |session| is initialized as server, |last_stream_id| must be odd or - * 0. - * - * The HTTP/2 specification says last_stream_id must not be increased - * from the value previously sent. So the actual value sent as - * last_stream_id is the minimum value between the given - * |last_stream_id| and the last_stream_id previously sent to the - * peer. - * - * If the |opaque_data| is not ``NULL`` and |opaque_data_len| is not - * zero, those data will be sent as additional debug data. The - * library makes a copy of the memory region pointed by |opaque_data| - * with the length |opaque_data_len|, so the caller does not need to - * keep this memory after the return of this function. If the - * |opaque_data_len| is 0, the |opaque_data| could be ``NULL``. - * - * After successful transmission of GOAWAY, following things happen. - * All incoming streams having strictly more than |last_stream_id| are - * closed. All incoming HEADERS which starts new stream are simply - * ignored. After all active streams are handled, both - * `nghttp2_session_want_read()` and `nghttp2_session_want_write()` - * return 0 and the application can close session. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` - * The |opaque_data_len| is too large; the |last_stream_id| is - * invalid. - */ -NGHTTP2_EXTERN int nghttp2_submit_goaway(nghttp2_session *session, - uint8_t flags, int32_t last_stream_id, - uint32_t error_code, - const uint8_t *opaque_data, - size_t opaque_data_len); - -/** - * @function - * - * Returns the last stream ID of a stream for which - * :type:`nghttp2_on_frame_recv_callback` was invoked most recently. - * The returned value can be used as last_stream_id parameter for - * `nghttp2_submit_goaway()` and - * `nghttp2_session_terminate_session2()`. - * - * This function always succeeds. - */ -NGHTTP2_EXTERN int32_t -nghttp2_session_get_last_proc_stream_id(nghttp2_session *session); - -/** - * @function - * - * Returns nonzero if new request can be sent from local endpoint. - * - * This function return 0 if request is not allowed for this session. - * There are several reasons why request is not allowed. Some of the - * reasons are: session is server; stream ID has been spent; GOAWAY - * has been sent or received. - * - * The application can call `nghttp2_submit_request()` without - * consulting this function. In that case, `nghttp2_submit_request()` - * may return error. Or, request is failed to sent, and - * :type:`nghttp2_on_stream_close_callback` is called. - */ -NGHTTP2_EXTERN int -nghttp2_session_check_request_allowed(nghttp2_session *session); - -/** - * @function - * - * Returns nonzero if |session| is initialized as server side session. - */ -NGHTTP2_EXTERN int -nghttp2_session_check_server_session(nghttp2_session *session); - -/** - * @function - * - * Submits WINDOW_UPDATE frame. - * - * The |flags| is currently ignored and should be - * :enum:`NGHTTP2_FLAG_NONE`. - * - * The |stream_id| is the stream ID to send this WINDOW_UPDATE. To - * send connection level WINDOW_UPDATE, specify 0 to |stream_id|. - * - * If the |window_size_increment| is positive, the WINDOW_UPDATE with - * that value as window_size_increment is queued. If the - * |window_size_increment| is larger than the received bytes from the - * remote endpoint, the local window size is increased by that - * difference. If the sole purpose is to increase the local window - * size, consider to use `nghttp2_session_set_local_window_size()`. - * - * If the |window_size_increment| is negative, the local window size - * is decreased by -|window_size_increment|. If automatic - * WINDOW_UPDATE is enabled - * (`nghttp2_option_set_no_auto_window_update()`), and the library - * decided that the WINDOW_UPDATE should be submitted, then - * WINDOW_UPDATE is queued with the current received bytes count. If - * the sole purpose is to decrease the local window size, consider to - * use `nghttp2_session_set_local_window_size()`. - * - * If the |window_size_increment| is 0, the function does nothing and - * returns 0. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_FLOW_CONTROL` - * The local window size overflow or gets negative. - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - */ -NGHTTP2_EXTERN int nghttp2_submit_window_update(nghttp2_session *session, - uint8_t flags, - int32_t stream_id, - int32_t window_size_increment); - -/** - * @function - * - * Set local window size (local endpoints's window size) to the given - * |window_size| for the given stream denoted by |stream_id|. To - * change connection level window size, specify 0 to |stream_id|. To - * increase window size, this function may submit WINDOW_UPDATE frame - * to transmission queue. - * - * The |flags| is currently ignored and should be - * :enum:`NGHTTP2_FLAG_NONE`. - * - * This sounds similar to `nghttp2_submit_window_update()`, but there - * are 2 differences. The first difference is that this function - * takes the absolute value of window size to set, rather than the - * delta. To change the window size, this may be easier to use since - * the application just declares the intended window size, rather than - * calculating delta. The second difference is that - * `nghttp2_submit_window_update()` affects the received bytes count - * which has not acked yet. By the specification of - * `nghttp2_submit_window_update()`, to strictly increase the local - * window size, we have to submit delta including all received bytes - * count, which might not be desirable in some cases. On the other - * hand, this function does not affect the received bytes count. It - * just sets the local window size to the given value. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` - * The |stream_id| is negative. - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - */ -NGHTTP2_EXTERN int -nghttp2_session_set_local_window_size(nghttp2_session *session, uint8_t flags, - int32_t stream_id, int32_t window_size); - -/** - * @function - * - * Submits extension frame. - * - * Application can pass arbitrary frame flags and stream ID in |flags| - * and |stream_id| respectively. The |payload| is opaque pointer, and - * it can be accessible though ``frame->ext.payload`` in - * :type:`nghttp2_pack_extension_callback`. The library will not own - * passed |payload| pointer. - * - * The application must set :type:`nghttp2_pack_extension_callback` - * using `nghttp2_session_callbacks_set_pack_extension_callback()`. - * - * The application should retain the memory pointed by |payload| until - * the transmission of extension frame is done (which is indicated by - * :type:`nghttp2_on_frame_send_callback`), or transmission fails - * (which is indicated by :type:`nghttp2_on_frame_not_send_callback`). - * If application does not touch this memory region after packing it - * into a wire format, application can free it inside - * :type:`nghttp2_pack_extension_callback`. - * - * The standard HTTP/2 frame cannot be sent with this function, so - * |type| must be strictly grater than 0x9. Otherwise, this function - * will fail with error code :enum:`NGHTTP2_ERR_INVALID_ARGUMENT`. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_INVALID_STATE` - * If :type:`nghttp2_pack_extension_callback` is not set. - * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` - * If |type| specifies standard HTTP/2 frame type. The frame - * types in the rage [0x0, 0x9], both inclusive, are standard - * HTTP/2 frame type, and cannot be sent using this function. - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory - */ -NGHTTP2_EXTERN int nghttp2_submit_extension(nghttp2_session *session, - uint8_t type, uint8_t flags, - int32_t stream_id, void *payload); - -/** - * @struct - * - * The payload of ALTSVC frame. ALTSVC frame is a non-critical - * extension to HTTP/2. If this frame is received, and - * `nghttp2_option_set_user_recv_extension_type()` is not set, and - * `nghttp2_option_set_builtin_recv_extension_type()` is set for - * :enum:`NGHTTP2_ALTSVC`, ``nghttp2_extension.payload`` will point to - * this struct. - * - * It has the following members: - */ -typedef struct { - /** - * The pointer to origin which this alternative service is - * associated with. This is not necessarily NULL-terminated. - */ - uint8_t *origin; - /** - * The length of the |origin|. - */ - size_t origin_len; - /** - * The pointer to Alt-Svc field value contained in ALTSVC frame. - * This is not necessarily NULL-terminated. - */ - uint8_t *field_value; - /** - * The length of the |field_value|. - */ - size_t field_value_len; -} nghttp2_ext_altsvc; - -/** - * @function - * - * Submits ALTSVC frame. - * - * ALTSVC frame is a non-critical extension to HTTP/2, and defined in - * is defined in `RFC 7383 - * `_. - * - * The |flags| is currently ignored and should be - * :enum:`NGHTTP2_FLAG_NONE`. - * - * The |origin| points to the origin this alternative service is - * associated with. The |origin_len| is the length of the origin. If - * |stream_id| is 0, the origin must be specified. If |stream_id| is - * not zero, the origin must be empty (in other words, |origin_len| - * must be 0). - * - * The ALTSVC frame is only usable from server side. If this function - * is invoked with client side session, this function returns - * :enum:`NGHTTP2_ERR_INVALID_STATE`. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory - * :enum:`NGHTTP2_ERR_INVALID_STATE` - * The function is called from client side session - * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` - * The sum of |origin_len| and |field_value_len| is larger than - * 16382; or |origin_len| is 0 while |stream_id| is 0; or - * |origin_len| is not 0 while |stream_id| is not 0. - */ -NGHTTP2_EXTERN int nghttp2_submit_altsvc(nghttp2_session *session, - uint8_t flags, int32_t stream_id, - const uint8_t *origin, - size_t origin_len, - const uint8_t *field_value, - size_t field_value_len); - -/** - * @function - * - * Compares ``lhs->name`` of length ``lhs->namelen`` bytes and - * ``rhs->name`` of length ``rhs->namelen`` bytes. Returns negative - * integer if ``lhs->name`` is found to be less than ``rhs->name``; or - * returns positive integer if ``lhs->name`` is found to be greater - * than ``rhs->name``; or returns 0 otherwise. - */ -NGHTTP2_EXTERN int nghttp2_nv_compare_name(const nghttp2_nv *lhs, - const nghttp2_nv *rhs); - -/** - * @function - * - * A helper function for dealing with NPN in client side or ALPN in - * server side. The |in| contains peer's protocol list in preferable - * order. The format of |in| is length-prefixed and not - * null-terminated. For example, ``h2`` and - * ``http/1.1`` stored in |in| like this:: - * - * in[0] = 2 - * in[1..2] = "h2" - * in[3] = 8 - * in[4..11] = "http/1.1" - * inlen = 12 - * - * The selection algorithm is as follows: - * - * 1. If peer's list contains HTTP/2 protocol the library supports, - * it is selected and returns 1. The following step is not taken. - * - * 2. If peer's list contains ``http/1.1``, this function selects - * ``http/1.1`` and returns 0. The following step is not taken. - * - * 3. This function selects nothing and returns -1 (So called - * non-overlap case). In this case, |out| and |outlen| are left - * untouched. - * - * Selecting ``h2`` means that ``h2`` is written into |*out| and its - * length (which is 2) is assigned to |*outlen|. - * - * For ALPN, refer to https://tools.ietf.org/html/rfc7301 - * - * See http://technotes.googlecode.com/git/nextprotoneg.html for more - * details about NPN. - * - * For NPN, to use this method you should do something like:: - * - * static int select_next_proto_cb(SSL* ssl, - * unsigned char **out, - * unsigned char *outlen, - * const unsigned char *in, - * unsigned int inlen, - * void *arg) - * { - * int rv; - * rv = nghttp2_select_next_protocol(out, outlen, in, inlen); - * if (rv == -1) { - * return SSL_TLSEXT_ERR_NOACK; - * } - * if (rv == 1) { - * ((MyType*)arg)->http2_selected = 1; - * } - * return SSL_TLSEXT_ERR_OK; - * } - * ... - * SSL_CTX_set_next_proto_select_cb(ssl_ctx, select_next_proto_cb, my_obj); - * - */ -NGHTTP2_EXTERN int nghttp2_select_next_protocol(unsigned char **out, - unsigned char *outlen, - const unsigned char *in, - unsigned int inlen); - -/** - * @function - * - * Returns a pointer to a nghttp2_info struct with version information - * about the run-time library in use. The |least_version| argument - * can be set to a 24 bit numerical value for the least accepted - * version number and if the condition is not met, this function will - * return a ``NULL``. Pass in 0 to skip the version checking. - */ -NGHTTP2_EXTERN nghttp2_info *nghttp2_version(int least_version); - -/** - * @function - * - * Returns nonzero if the :type:`nghttp2_error` library error code - * |lib_error| is fatal. - */ -NGHTTP2_EXTERN int nghttp2_is_fatal(int lib_error_code); - -/** - * @function - * - * Returns nonzero if HTTP header field name |name| of length |len| is - * valid according to http://tools.ietf.org/html/rfc7230#section-3.2 - * - * Because this is a header field name in HTTP2, the upper cased alphabet - * is treated as error. - */ -NGHTTP2_EXTERN int nghttp2_check_header_name(const uint8_t *name, size_t len); - -/** - * @function - * - * Returns nonzero if HTTP header field value |value| of length |len| - * is valid according to - * http://tools.ietf.org/html/rfc7230#section-3.2 - */ -NGHTTP2_EXTERN int nghttp2_check_header_value(const uint8_t *value, size_t len); - -/* HPACK API */ - -struct nghttp2_hd_deflater; - -/** - * @struct - * - * HPACK deflater object. - */ -typedef struct nghttp2_hd_deflater nghttp2_hd_deflater; - -/** - * @function - * - * Initializes |*deflater_ptr| for deflating name/values pairs. - * - * The |max_deflate_dynamic_table_size| is the upper bound of header - * table size the deflater will use. - * - * If this function fails, |*deflater_ptr| is left untouched. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - */ -NGHTTP2_EXTERN int -nghttp2_hd_deflate_new(nghttp2_hd_deflater **deflater_ptr, - size_t max_deflate_dynamic_table_size); - -/** - * @function - * - * Like `nghttp2_hd_deflate_new()`, but with additional custom memory - * allocator specified in the |mem|. - * - * The |mem| can be ``NULL`` and the call is equivalent to - * `nghttp2_hd_deflate_new()`. - * - * This function does not take ownership |mem|. The application is - * responsible for freeing |mem|. - * - * The library code does not refer to |mem| pointer after this - * function returns, so the application can safely free it. - */ -NGHTTP2_EXTERN int -nghttp2_hd_deflate_new2(nghttp2_hd_deflater **deflater_ptr, - size_t max_deflate_dynamic_table_size, - nghttp2_mem *mem); - -/** - * @function - * - * Deallocates any resources allocated for |deflater|. - */ -NGHTTP2_EXTERN void nghttp2_hd_deflate_del(nghttp2_hd_deflater *deflater); - -/** - * @function - * - * Changes header table size of the |deflater| to - * |settings_max_dynamic_table_size| bytes. This may trigger eviction - * in the dynamic table. - * - * The |settings_max_dynamic_table_size| should be the value received - * in SETTINGS_HEADER_TABLE_SIZE. - * - * The deflater never uses more memory than - * ``max_deflate_dynamic_table_size`` bytes specified in - * `nghttp2_hd_deflate_new()`. Therefore, if - * |settings_max_dynamic_table_size| > - * ``max_deflate_dynamic_table_size``, resulting maximum table size - * becomes ``max_deflate_dynamic_table_size``. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - */ -NGHTTP2_EXTERN int -nghttp2_hd_deflate_change_table_size(nghttp2_hd_deflater *deflater, - size_t settings_max_dynamic_table_size); - -/** - * @function - * - * Deflates the |nva|, which has the |nvlen| name/value pairs, into - * the |buf| of length |buflen|. - * - * If |buf| is not large enough to store the deflated header block, - * this function fails with :enum:`NGHTTP2_ERR_INSUFF_BUFSIZE`. The - * caller should use `nghttp2_hd_deflate_bound()` to know the upper - * bound of buffer size required to deflate given header name/value - * pairs. - * - * Once this function fails, subsequent call of this function always - * returns :enum:`NGHTTP2_ERR_HEADER_COMP`. - * - * After this function returns, it is safe to delete the |nva|. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_HEADER_COMP` - * Deflation process has failed. - * :enum:`NGHTTP2_ERR_INSUFF_BUFSIZE` - * The provided |buflen| size is too small to hold the output. - */ -NGHTTP2_EXTERN ssize_t nghttp2_hd_deflate_hd(nghttp2_hd_deflater *deflater, - uint8_t *buf, size_t buflen, - const nghttp2_nv *nva, - size_t nvlen); - -/** - * @function - * - * Deflates the |nva|, which has the |nvlen| name/value pairs, into - * the |veclen| size of buf vector |vec|. The each size of buffer - * must be set in len field of :type:`nghttp2_vec`. If and only if - * one chunk is filled up completely, next chunk will be used. If - * |vec| is not large enough to store the deflated header block, this - * function fails with :enum:`NGHTTP2_ERR_INSUFF_BUFSIZE`. The caller - * should use `nghttp2_hd_deflate_bound()` to know the upper bound of - * buffer size required to deflate given header name/value pairs. - * - * Once this function fails, subsequent call of this function always - * returns :enum:`NGHTTP2_ERR_HEADER_COMP`. - * - * After this function returns, it is safe to delete the |nva|. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_HEADER_COMP` - * Deflation process has failed. - * :enum:`NGHTTP2_ERR_INSUFF_BUFSIZE` - * The provided |buflen| size is too small to hold the output. - */ -NGHTTP2_EXTERN ssize_t nghttp2_hd_deflate_hd_vec(nghttp2_hd_deflater *deflater, - const nghttp2_vec *vec, - size_t veclen, - const nghttp2_nv *nva, - size_t nvlen); - -/** - * @function - * - * Returns an upper bound on the compressed size after deflation of - * |nva| of length |nvlen|. - */ -NGHTTP2_EXTERN size_t nghttp2_hd_deflate_bound(nghttp2_hd_deflater *deflater, - const nghttp2_nv *nva, - size_t nvlen); - -/** - * @function - * - * Returns the number of entries that header table of |deflater| - * contains. This is the sum of the number of static table and - * dynamic table, so the return value is at least 61. - */ -NGHTTP2_EXTERN -size_t nghttp2_hd_deflate_get_num_table_entries(nghttp2_hd_deflater *deflater); - -/** - * @function - * - * Returns the table entry denoted by |idx| from header table of - * |deflater|. The |idx| is 1-based, and idx=1 returns first entry of - * static table. idx=62 returns first entry of dynamic table if it - * exists. Specifying idx=0 is error, and this function returns NULL. - * If |idx| is strictly greater than the number of entries the tables - * contain, this function returns NULL. - */ -NGHTTP2_EXTERN -const nghttp2_nv * -nghttp2_hd_deflate_get_table_entry(nghttp2_hd_deflater *deflater, size_t idx); - -/** - * @function - * - * Returns the used dynamic table size, including the overhead 32 - * bytes per entry described in RFC 7541. - */ -NGHTTP2_EXTERN -size_t nghttp2_hd_deflate_get_dynamic_table_size(nghttp2_hd_deflater *deflater); - -/** - * @function - * - * Returns the maximum dynamic table size. - */ -NGHTTP2_EXTERN -size_t -nghttp2_hd_deflate_get_max_dynamic_table_size(nghttp2_hd_deflater *deflater); - -struct nghttp2_hd_inflater; - -/** - * @struct - * - * HPACK inflater object. - */ -typedef struct nghttp2_hd_inflater nghttp2_hd_inflater; - -/** - * @function - * - * Initializes |*inflater_ptr| for inflating name/values pairs. - * - * If this function fails, |*inflater_ptr| is left untouched. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - */ -NGHTTP2_EXTERN int nghttp2_hd_inflate_new(nghttp2_hd_inflater **inflater_ptr); - -/** - * @function - * - * Like `nghttp2_hd_inflate_new()`, but with additional custom memory - * allocator specified in the |mem|. - * - * The |mem| can be ``NULL`` and the call is equivalent to - * `nghttp2_hd_inflate_new()`. - * - * This function does not take ownership |mem|. The application is - * responsible for freeing |mem|. - * - * The library code does not refer to |mem| pointer after this - * function returns, so the application can safely free it. - */ -NGHTTP2_EXTERN int nghttp2_hd_inflate_new2(nghttp2_hd_inflater **inflater_ptr, - nghttp2_mem *mem); - -/** - * @function - * - * Deallocates any resources allocated for |inflater|. - */ -NGHTTP2_EXTERN void nghttp2_hd_inflate_del(nghttp2_hd_inflater *inflater); - -/** - * @function - * - * Changes header table size in the |inflater|. This may trigger - * eviction in the dynamic table. - * - * The |settings_max_dynamic_table_size| should be the value - * transmitted in SETTINGS_HEADER_TABLE_SIZE. - * - * This function must not be called while header block is being - * inflated. In other words, this function must be called after - * initialization of |inflater|, but before calling - * `nghttp2_hd_inflate_hd2()`, or after - * `nghttp2_hd_inflate_end_headers()`. Otherwise, - * `NGHTTP2_ERR_INVALID_STATE` was returned. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_INVALID_STATE` - * The function is called while header block is being inflated. - * Probably, application missed to call - * `nghttp2_hd_inflate_end_headers()`. - */ -NGHTTP2_EXTERN int -nghttp2_hd_inflate_change_table_size(nghttp2_hd_inflater *inflater, - size_t settings_max_dynamic_table_size); - -/** - * @enum - * - * The flags for header inflation. - */ -typedef enum { - /** - * No flag set. - */ - NGHTTP2_HD_INFLATE_NONE = 0, - /** - * Indicates all headers were inflated. - */ - NGHTTP2_HD_INFLATE_FINAL = 0x01, - /** - * Indicates a header was emitted. - */ - NGHTTP2_HD_INFLATE_EMIT = 0x02 -} nghttp2_hd_inflate_flag; - -/** - * @function - * - * .. warning:: - * - * Deprecated. Use `nghttp2_hd_inflate_hd2()` instead. - * - * Inflates name/value block stored in |in| with length |inlen|. This - * function performs decompression. For each successful emission of - * header name/value pair, :enum:`NGHTTP2_HD_INFLATE_EMIT` is set in - * |*inflate_flags| and name/value pair is assigned to the |nv_out| - * and the function returns. The caller must not free the members of - * |nv_out|. - * - * The |nv_out| may include pointers to the memory region in the |in|. - * The caller must retain the |in| while the |nv_out| is used. - * - * The application should call this function repeatedly until the - * ``(*inflate_flags) & NGHTTP2_HD_INFLATE_FINAL`` is nonzero and - * return value is non-negative. This means the all input values are - * processed successfully. Then the application must call - * `nghttp2_hd_inflate_end_headers()` to prepare for the next header - * block input. - * - * The caller can feed complete compressed header block. It also can - * feed it in several chunks. The caller must set |in_final| to - * nonzero if the given input is the last block of the compressed - * header. - * - * This function returns the number of bytes processed if it succeeds, - * or one of the following negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_HEADER_COMP` - * Inflation process has failed. - * :enum:`NGHTTP2_ERR_BUFFER_ERROR` - * The header field name or value is too large. - * - * Example follows:: - * - * int inflate_header_block(nghttp2_hd_inflater *hd_inflater, - * uint8_t *in, size_t inlen, int final) - * { - * ssize_t rv; - * - * for(;;) { - * nghttp2_nv nv; - * int inflate_flags = 0; - * - * rv = nghttp2_hd_inflate_hd(hd_inflater, &nv, &inflate_flags, - * in, inlen, final); - * - * if(rv < 0) { - * fprintf(stderr, "inflate failed with error code %zd", rv); - * return -1; - * } - * - * in += rv; - * inlen -= rv; - * - * if(inflate_flags & NGHTTP2_HD_INFLATE_EMIT) { - * fwrite(nv.name, nv.namelen, 1, stderr); - * fprintf(stderr, ": "); - * fwrite(nv.value, nv.valuelen, 1, stderr); - * fprintf(stderr, "\n"); - * } - * if(inflate_flags & NGHTTP2_HD_INFLATE_FINAL) { - * nghttp2_hd_inflate_end_headers(hd_inflater); - * break; - * } - * if((inflate_flags & NGHTTP2_HD_INFLATE_EMIT) == 0 && - * inlen == 0) { - * break; - * } - * } - * - * return 0; - * } - * - */ -NGHTTP2_EXTERN ssize_t nghttp2_hd_inflate_hd(nghttp2_hd_inflater *inflater, - nghttp2_nv *nv_out, - int *inflate_flags, uint8_t *in, - size_t inlen, int in_final); - -/** - * @function - * - * Inflates name/value block stored in |in| with length |inlen|. This - * function performs decompression. For each successful emission of - * header name/value pair, :enum:`NGHTTP2_HD_INFLATE_EMIT` is set in - * |*inflate_flags| and name/value pair is assigned to the |nv_out| - * and the function returns. The caller must not free the members of - * |nv_out|. - * - * The |nv_out| may include pointers to the memory region in the |in|. - * The caller must retain the |in| while the |nv_out| is used. - * - * The application should call this function repeatedly until the - * ``(*inflate_flags) & NGHTTP2_HD_INFLATE_FINAL`` is nonzero and - * return value is non-negative. If that happens, all given input - * data (|inlen| bytes) are processed successfully. Then the - * application must call `nghttp2_hd_inflate_end_headers()` to prepare - * for the next header block input. - * - * In other words, if |in_final| is nonzero, and this function returns - * |inlen|, you can assert that :enum:`NGHTTP2_HD_INFLATE_FINAL` is - * set in |*inflate_flags|. - * - * The caller can feed complete compressed header block. It also can - * feed it in several chunks. The caller must set |in_final| to - * nonzero if the given input is the last block of the compressed - * header. - * - * This function returns the number of bytes processed if it succeeds, - * or one of the following negative error codes: - * - * :enum:`NGHTTP2_ERR_NOMEM` - * Out of memory. - * :enum:`NGHTTP2_ERR_HEADER_COMP` - * Inflation process has failed. - * :enum:`NGHTTP2_ERR_BUFFER_ERROR` - * The header field name or value is too large. - * - * Example follows:: - * - * int inflate_header_block(nghttp2_hd_inflater *hd_inflater, - * uint8_t *in, size_t inlen, int final) - * { - * ssize_t rv; - * - * for(;;) { - * nghttp2_nv nv; - * int inflate_flags = 0; - * - * rv = nghttp2_hd_inflate_hd2(hd_inflater, &nv, &inflate_flags, - * in, inlen, final); - * - * if(rv < 0) { - * fprintf(stderr, "inflate failed with error code %zd", rv); - * return -1; - * } - * - * in += rv; - * inlen -= rv; - * - * if(inflate_flags & NGHTTP2_HD_INFLATE_EMIT) { - * fwrite(nv.name, nv.namelen, 1, stderr); - * fprintf(stderr, ": "); - * fwrite(nv.value, nv.valuelen, 1, stderr); - * fprintf(stderr, "\n"); - * } - * if(inflate_flags & NGHTTP2_HD_INFLATE_FINAL) { - * nghttp2_hd_inflate_end_headers(hd_inflater); - * break; - * } - * if((inflate_flags & NGHTTP2_HD_INFLATE_EMIT) == 0 && - * inlen == 0) { - * break; - * } - * } - * - * return 0; - * } - * - */ -NGHTTP2_EXTERN ssize_t nghttp2_hd_inflate_hd2(nghttp2_hd_inflater *inflater, - nghttp2_nv *nv_out, - int *inflate_flags, - const uint8_t *in, size_t inlen, - int in_final); - -/** - * @function - * - * Signals the end of decompression for one header block. - * - * This function returns 0 if it succeeds. Currently this function - * always succeeds. - */ -NGHTTP2_EXTERN int -nghttp2_hd_inflate_end_headers(nghttp2_hd_inflater *inflater); - -/** - * @function - * - * Returns the number of entries that header table of |inflater| - * contains. This is the sum of the number of static table and - * dynamic table, so the return value is at least 61. - */ -NGHTTP2_EXTERN -size_t nghttp2_hd_inflate_get_num_table_entries(nghttp2_hd_inflater *inflater); - -/** - * @function - * - * Returns the table entry denoted by |idx| from header table of - * |inflater|. The |idx| is 1-based, and idx=1 returns first entry of - * static table. idx=62 returns first entry of dynamic table if it - * exists. Specifying idx=0 is error, and this function returns NULL. - * If |idx| is strictly greater than the number of entries the tables - * contain, this function returns NULL. - */ -NGHTTP2_EXTERN -const nghttp2_nv * -nghttp2_hd_inflate_get_table_entry(nghttp2_hd_inflater *inflater, size_t idx); - -/** - * @function - * - * Returns the used dynamic table size, including the overhead 32 - * bytes per entry described in RFC 7541. - */ -NGHTTP2_EXTERN -size_t nghttp2_hd_inflate_get_dynamic_table_size(nghttp2_hd_inflater *inflater); - -/** - * @function - * - * Returns the maximum dynamic table size. - */ -NGHTTP2_EXTERN -size_t -nghttp2_hd_inflate_get_max_dynamic_table_size(nghttp2_hd_inflater *inflater); - -struct nghttp2_stream; - -/** - * @struct - * - * The structure to represent HTTP/2 stream. The details of this - * structure are intentionally hidden from the public API. - */ -typedef struct nghttp2_stream nghttp2_stream; - -/** - * @function - * - * Returns pointer to :type:`nghttp2_stream` object denoted by - * |stream_id|. If stream was not found, returns NULL. - * - * Returns imaginary root stream (see - * `nghttp2_session_get_root_stream()`) if 0 is given in |stream_id|. - * - * Unless |stream_id| == 0, the returned pointer is valid until next - * call of `nghttp2_session_send()`, `nghttp2_session_mem_send()`, - * `nghttp2_session_recv()`, and `nghttp2_session_mem_recv()`. - */ -NGHTTP2_EXTERN nghttp2_stream * -nghttp2_session_find_stream(nghttp2_session *session, int32_t stream_id); - -/** - * @enum - * - * State of stream as described in RFC 7540. - */ -typedef enum { - /** - * idle state. - */ - NGHTTP2_STREAM_STATE_IDLE = 1, - /** - * open state. - */ - NGHTTP2_STREAM_STATE_OPEN, - /** - * reserved (local) state. - */ - NGHTTP2_STREAM_STATE_RESERVED_LOCAL, - /** - * reserved (remote) state. - */ - NGHTTP2_STREAM_STATE_RESERVED_REMOTE, - /** - * half closed (local) state. - */ - NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL, - /** - * half closed (remote) state. - */ - NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE, - /** - * closed state. - */ - NGHTTP2_STREAM_STATE_CLOSED -} nghttp2_stream_proto_state; - -/** - * @function - * - * Returns state of |stream|. The root stream retrieved by - * `nghttp2_session_get_root_stream()` will have stream state - * :enum:`NGHTTP2_STREAM_STATE_IDLE`. - */ -NGHTTP2_EXTERN nghttp2_stream_proto_state -nghttp2_stream_get_state(nghttp2_stream *stream); - -/** - * @function - * - * Returns root of dependency tree, which is imaginary stream with - * stream ID 0. The returned pointer is valid until |session| is - * freed by `nghttp2_session_del()`. - */ -NGHTTP2_EXTERN nghttp2_stream * -nghttp2_session_get_root_stream(nghttp2_session *session); - -/** - * @function - * - * Returns the parent stream of |stream| in dependency tree. Returns - * NULL if there is no such stream. - */ -NGHTTP2_EXTERN nghttp2_stream * -nghttp2_stream_get_parent(nghttp2_stream *stream); - -NGHTTP2_EXTERN int32_t nghttp2_stream_get_stream_id(nghttp2_stream *stream); - -/** - * @function - * - * Returns the next sibling stream of |stream| in dependency tree. - * Returns NULL if there is no such stream. - */ -NGHTTP2_EXTERN nghttp2_stream * -nghttp2_stream_get_next_sibling(nghttp2_stream *stream); - -/** - * @function - * - * Returns the previous sibling stream of |stream| in dependency tree. - * Returns NULL if there is no such stream. - */ -NGHTTP2_EXTERN nghttp2_stream * -nghttp2_stream_get_previous_sibling(nghttp2_stream *stream); - -/** - * @function - * - * Returns the first child stream of |stream| in dependency tree. - * Returns NULL if there is no such stream. - */ -NGHTTP2_EXTERN nghttp2_stream * -nghttp2_stream_get_first_child(nghttp2_stream *stream); - -/** - * @function - * - * Returns dependency weight to the parent stream of |stream|. - */ -NGHTTP2_EXTERN int32_t nghttp2_stream_get_weight(nghttp2_stream *stream); - -/** - * @function - * - * Returns the sum of the weight for |stream|'s children. - */ -NGHTTP2_EXTERN int32_t -nghttp2_stream_get_sum_dependency_weight(nghttp2_stream *stream); - -/** - * @functypedef - * - * Callback function invoked when the library outputs debug logging. - * The function is called with arguments suitable for ``vfprintf(3)`` - * - * The debug output is only enabled if the library is built with - * ``DEBUGBUILD`` macro defined. - */ -typedef void (*nghttp2_debug_vprintf_callback)(const char *format, - va_list args); - -/** - * @function - * - * Sets a debug output callback called by the library when built with - * ``DEBUGBUILD`` macro defined. If this option is not used, debug - * log is written into standard error output. - * - * For builds without ``DEBUGBUILD`` macro defined, this function is - * noop. - * - * Note that building with ``DEBUGBUILD`` may cause significant - * performance penalty to libnghttp2 because of extra processing. It - * should be used for debugging purpose only. - * - * .. Warning:: - * - * Building with ``DEBUGBUILD`` may cause significant performance - * penalty to libnghttp2 because of extra processing. It should be - * used for debugging purpose only. We write this two times because - * this is important. - */ -NGHTTP2_EXTERN void nghttp2_set_debug_vprintf_callback( - nghttp2_debug_vprintf_callback debug_vprintf_callback); - -#ifdef __cplusplus -} -#endif - -#endif /* NGHTTP2_H */ diff --git a/tools/sdk/include/nghttp/nghttp2/nghttp2ver.h b/tools/sdk/include/nghttp/nghttp2/nghttp2ver.h deleted file mode 100644 index ccbbfb3f4af..00000000000 --- a/tools/sdk/include/nghttp/nghttp2/nghttp2ver.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * nghttp2 - HTTP/2 C Library - * - * Copyright (c) 2012, 2013 Tatsuhiro Tsujikawa - * - * 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. - */ -#ifndef NGHTTP2VER_H -#define NGHTTP2VER_H - -/** - * @macro - * Version number of the nghttp2 library release - */ -#define NGHTTP2_VERSION "v1.22.0" - -/** - * @macro - * Numerical representation of the version number of the nghttp2 library - * release. This is a 24 bit number with 8 bits for major number, 8 bits - * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203. - */ -#define NGHTTP2_VERSION_NUM 0x012200 - -#endif /* NGHTTP2VER_H */ diff --git a/tools/sdk/include/nvs_flash/nvs.h b/tools/sdk/include/nvs_flash/nvs.h deleted file mode 100644 index 0cc3ba09a6e..00000000000 --- a/tools/sdk/include/nvs_flash/nvs.h +++ /dev/null @@ -1,458 +0,0 @@ -// 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. -#ifndef ESP_NVS_H -#define ESP_NVS_H - -#include -#include -#include -#include "esp_err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Opaque pointer type representing non-volatile storage handle - */ -typedef uint32_t nvs_handle; - -#define ESP_ERR_NVS_BASE 0x1100 /*!< Starting number of error codes */ -#define ESP_ERR_NVS_NOT_INITIALIZED (ESP_ERR_NVS_BASE + 0x01) /*!< The storage driver is not initialized */ -#define ESP_ERR_NVS_NOT_FOUND (ESP_ERR_NVS_BASE + 0x02) /*!< Id namespace doesn’t exist yet and mode is NVS_READONLY */ -#define ESP_ERR_NVS_TYPE_MISMATCH (ESP_ERR_NVS_BASE + 0x03) /*!< The type of set or get operation doesn't match the type of value stored in NVS */ -#define ESP_ERR_NVS_READ_ONLY (ESP_ERR_NVS_BASE + 0x04) /*!< Storage handle was opened as read only */ -#define ESP_ERR_NVS_NOT_ENOUGH_SPACE (ESP_ERR_NVS_BASE + 0x05) /*!< There is not enough space in the underlying storage to save the value */ -#define ESP_ERR_NVS_INVALID_NAME (ESP_ERR_NVS_BASE + 0x06) /*!< Namespace name doesn’t satisfy constraints */ -#define ESP_ERR_NVS_INVALID_HANDLE (ESP_ERR_NVS_BASE + 0x07) /*!< Handle has been closed or is NULL */ -#define ESP_ERR_NVS_REMOVE_FAILED (ESP_ERR_NVS_BASE + 0x08) /*!< The value wasn’t updated because flash write operation has failed. The value was written however, and update will be finished after re-initialization of nvs, provided that flash operation doesn’t fail again. */ -#define ESP_ERR_NVS_KEY_TOO_LONG (ESP_ERR_NVS_BASE + 0x09) /*!< Key name is too long */ -#define ESP_ERR_NVS_PAGE_FULL (ESP_ERR_NVS_BASE + 0x0a) /*!< Internal error; never returned by nvs API functions */ -#define ESP_ERR_NVS_INVALID_STATE (ESP_ERR_NVS_BASE + 0x0b) /*!< NVS is in an inconsistent state due to a previous error. Call nvs_flash_init and nvs_open again, then retry. */ -#define ESP_ERR_NVS_INVALID_LENGTH (ESP_ERR_NVS_BASE + 0x0c) /*!< String or blob length is not sufficient to store data */ -#define ESP_ERR_NVS_NO_FREE_PAGES (ESP_ERR_NVS_BASE + 0x0d) /*!< NVS partition doesn't contain any empty pages. This may happen if NVS partition was truncated. Erase the whole partition and call nvs_flash_init again. */ -#define ESP_ERR_NVS_VALUE_TOO_LONG (ESP_ERR_NVS_BASE + 0x0e) /*!< String or blob length is longer than supported by the implementation */ -#define ESP_ERR_NVS_PART_NOT_FOUND (ESP_ERR_NVS_BASE + 0x0f) /*!< Partition with specified name is not found in the partition table */ - -#define ESP_ERR_NVS_NEW_VERSION_FOUND (ESP_ERR_NVS_BASE + 0x10) /*!< NVS partition contains data in new format and cannot be recognized by this version of code */ -#define ESP_ERR_NVS_XTS_ENCR_FAILED (ESP_ERR_NVS_BASE + 0x11) /*!< XTS encryption failed while writing NVS entry */ -#define ESP_ERR_NVS_XTS_DECR_FAILED (ESP_ERR_NVS_BASE + 0x12) /*!< XTS decryption failed while reading NVS entry */ -#define ESP_ERR_NVS_XTS_CFG_FAILED (ESP_ERR_NVS_BASE + 0x13) /*!< XTS configuration setting failed */ -#define ESP_ERR_NVS_XTS_CFG_NOT_FOUND (ESP_ERR_NVS_BASE + 0x14) /*!< XTS configuration not found */ -#define ESP_ERR_NVS_ENCR_NOT_SUPPORTED (ESP_ERR_NVS_BASE + 0x15) /*!< NVS encryption is not supported in this version */ -#define ESP_ERR_NVS_KEYS_NOT_INITIALIZED (ESP_ERR_NVS_BASE + 0x16) /*!< NVS key partition is uninitialized */ -#define ESP_ERR_NVS_CORRUPT_KEY_PART (ESP_ERR_NVS_BASE + 0x17) /*!< NVS key partition is corrupt */ - - -#define NVS_DEFAULT_PART_NAME "nvs" /*!< Default partition name of the NVS partition in the partition table */ -/** - * @brief Mode of opening the non-volatile storage - * - */ -typedef enum { - NVS_READONLY, /*!< Read only */ - NVS_READWRITE /*!< Read and write */ -} nvs_open_mode; - -/** - * @brief Open non-volatile storage with a given namespace from the default NVS partition - * - * Multiple internal ESP-IDF and third party application modules can store - * their key-value pairs in the NVS module. In order to reduce possible - * conflicts on key names, each module can use its own namespace. - * The default NVS partition is the one that is labelled "nvs" in the partition - * table. - * - * @param[in] name Namespace name. Maximal length is determined by the - * underlying implementation, but is guaranteed to be - * at least 15 characters. Shouldn't be empty. - * @param[in] open_mode NVS_READWRITE or NVS_READONLY. If NVS_READONLY, will - * open a handle for reading only. All write requests will - * be rejected for this handle. - * @param[out] out_handle If successful (return code is zero), handle will be - * returned in this argument. - * - * @return - * - ESP_OK if storage handle was opened successfully - * - ESP_ERR_NVS_NOT_INITIALIZED if the storage driver is not initialized - * - ESP_ERR_NVS_PART_NOT_FOUND if the partition with label "nvs" is not found - * - ESP_ERR_NVS_NOT_FOUND id namespace doesn't exist yet and - * mode is NVS_READONLY - * - ESP_ERR_NVS_INVALID_NAME if namespace name doesn't satisfy constraints - * - other error codes from the underlying storage driver - */ -esp_err_t nvs_open(const char* name, nvs_open_mode open_mode, nvs_handle *out_handle); - -/** - * @brief Open non-volatile storage with a given namespace from specified partition - * - * The behaviour is same as nvs_open() API. However this API can operate on a specified NVS - * partition instead of default NVS partition. Note that the specified partition must be registered - * with NVS using nvs_flash_init_partition() API. - * - * @param[in] part_name Label (name) of the partition of interest for object read/write/erase - * @param[in] name Namespace name. Maximal length is determined by the - * underlying implementation, but is guaranteed to be - * at least 15 characters. Shouldn't be empty. - * @param[in] open_mode NVS_READWRITE or NVS_READONLY. If NVS_READONLY, will - * open a handle for reading only. All write requests will - * be rejected for this handle. - * @param[out] out_handle If successful (return code is zero), handle will be - * returned in this argument. - * - * @return - * - ESP_OK if storage handle was opened successfully - * - ESP_ERR_NVS_NOT_INITIALIZED if the storage driver is not initialized - * - ESP_ERR_NVS_PART_NOT_FOUND if the partition with specified name is not found - * - ESP_ERR_NVS_NOT_FOUND id namespace doesn't exist yet and - * mode is NVS_READONLY - * - ESP_ERR_NVS_INVALID_NAME if namespace name doesn't satisfy constraints - * - other error codes from the underlying storage driver - */ -esp_err_t nvs_open_from_partition(const char *part_name, const char* name, nvs_open_mode open_mode, nvs_handle *out_handle); - -/**@{*/ -/** - * @brief set value for given key - * - * This family of functions set value for the key, given its name. Note that - * actual storage will not be updated until nvs_commit function is called. - * - * @param[in] handle Handle obtained from nvs_open function. - * Handles that were opened read only cannot be used. - * @param[in] key Key name. Maximal length is determined by the underlying - * implementation, but is guaranteed to be at least - * 15 characters. Shouldn't be empty. - * @param[in] value The value to set. - * For strings, the maximum length (including null character) is - * 4000 bytes. - * - * @return - * - ESP_OK if value was set successfully - * - ESP_ERR_NVS_INVALID_HANDLE if handle has been closed or is NULL - * - ESP_ERR_NVS_READ_ONLY if storage handle was opened as read only - * - ESP_ERR_NVS_INVALID_NAME if key name doesn't satisfy constraints - * - ESP_ERR_NVS_NOT_ENOUGH_SPACE if there is not enough space in the - * underlying storage to save the value - * - ESP_ERR_NVS_REMOVE_FAILED if the value wasn't updated because flash - * write operation has failed. The value was written however, and - * update will be finished after re-initialization of nvs, provided that - * flash operation doesn't fail again. - * - ESP_ERR_NVS_VALUE_TOO_LONG if the string value is too long - */ -esp_err_t nvs_set_i8 (nvs_handle handle, const char* key, int8_t value); -esp_err_t nvs_set_u8 (nvs_handle handle, const char* key, uint8_t value); -esp_err_t nvs_set_i16 (nvs_handle handle, const char* key, int16_t value); -esp_err_t nvs_set_u16 (nvs_handle handle, const char* key, uint16_t value); -esp_err_t nvs_set_i32 (nvs_handle handle, const char* key, int32_t value); -esp_err_t nvs_set_u32 (nvs_handle handle, const char* key, uint32_t value); -esp_err_t nvs_set_i64 (nvs_handle handle, const char* key, int64_t value); -esp_err_t nvs_set_u64 (nvs_handle handle, const char* key, uint64_t value); -esp_err_t nvs_set_str (nvs_handle handle, const char* key, const char* value); -/**@}*/ - -/** - * @brief set variable length binary value for given key - * - * This family of functions set value for the key, given its name. Note that - * actual storage will not be updated until nvs_commit function is called. - * - * @param[in] handle Handle obtained from nvs_open function. - * Handles that were opened read only cannot be used. - * @param[in] key Key name. Maximal length is 15 characters. Shouldn't be empty. - * @param[in] value The value to set. - * @param[in] length length of binary value to set, in bytes; Maximum length is - * 508000 bytes or (97.6% of the partition size - 4000) bytes - * whichever is lower. - * - * @return - * - ESP_OK if value was set successfully - * - ESP_ERR_NVS_INVALID_HANDLE if handle has been closed or is NULL - * - ESP_ERR_NVS_READ_ONLY if storage handle was opened as read only - * - ESP_ERR_NVS_INVALID_NAME if key name doesn't satisfy constraints - * - ESP_ERR_NVS_NOT_ENOUGH_SPACE if there is not enough space in the - * underlying storage to save the value - * - ESP_ERR_NVS_REMOVE_FAILED if the value wasn't updated because flash - * write operation has failed. The value was written however, and - * update will be finished after re-initialization of nvs, provided that - * flash operation doesn't fail again. - * - ESP_ERR_NVS_VALUE_TOO_LONG if the value is too long - */ -esp_err_t nvs_set_blob(nvs_handle handle, const char* key, const void* value, size_t length); - -/**@{*/ -/** - * @brief get value for given key - * - * These functions retrieve value for the key, given its name. If key does not - * exist, or the requested variable type doesn't match the type which was used - * when setting a value, an error is returned. - * - * In case of any error, out_value is not modified. - * - * All functions expect out_value to be a pointer to an already allocated variable - * of the given type. - * - * \code{c} - * // Example of using nvs_get_i32: - * int32_t max_buffer_size = 4096; // default value - * esp_err_t err = nvs_get_i32(my_handle, "max_buffer_size", &max_buffer_size); - * assert(err == ESP_OK || err == ESP_ERR_NVS_NOT_FOUND); - * // if ESP_ERR_NVS_NOT_FOUND was returned, max_buffer_size will still - * // have its default value. - * - * \endcode - * - * @param[in] handle Handle obtained from nvs_open function. - * @param[in] key Key name. Maximal length is determined by the underlying - * implementation, but is guaranteed to be at least - * 15 characters. Shouldn't be empty. - * @param out_value Pointer to the output value. - * May be NULL for nvs_get_str and nvs_get_blob, in this - * case required length will be returned in length argument. - * - * @return - * - ESP_OK if the value was retrieved successfully - * - ESP_ERR_NVS_NOT_FOUND if the requested key doesn't exist - * - ESP_ERR_NVS_INVALID_HANDLE if handle has been closed or is NULL - * - ESP_ERR_NVS_INVALID_NAME if key name doesn't satisfy constraints - * - ESP_ERR_NVS_INVALID_LENGTH if length is not sufficient to store data - */ -esp_err_t nvs_get_i8 (nvs_handle handle, const char* key, int8_t* out_value); -esp_err_t nvs_get_u8 (nvs_handle handle, const char* key, uint8_t* out_value); -esp_err_t nvs_get_i16 (nvs_handle handle, const char* key, int16_t* out_value); -esp_err_t nvs_get_u16 (nvs_handle handle, const char* key, uint16_t* out_value); -esp_err_t nvs_get_i32 (nvs_handle handle, const char* key, int32_t* out_value); -esp_err_t nvs_get_u32 (nvs_handle handle, const char* key, uint32_t* out_value); -esp_err_t nvs_get_i64 (nvs_handle handle, const char* key, int64_t* out_value); -esp_err_t nvs_get_u64 (nvs_handle handle, const char* key, uint64_t* out_value); -/**@}*/ - -/** - * @brief get value for given key - * - * These functions retrieve value for the key, given its name. If key does not - * exist, or the requested variable type doesn't match the type which was used - * when setting a value, an error is returned. - * - * In case of any error, out_value is not modified. - * - * All functions expect out_value to be a pointer to an already allocated variable - * of the given type. - * - * nvs_get_str and nvs_get_blob functions support WinAPI-style length queries. - * To get the size necessary to store the value, call nvs_get_str or nvs_get_blob - * with zero out_value and non-zero pointer to length. Variable pointed to - * by length argument will be set to the required length. For nvs_get_str, - * this length includes the zero terminator. When calling nvs_get_str and - * nvs_get_blob with non-zero out_value, length has to be non-zero and has to - * point to the length available in out_value. - * It is suggested that nvs_get/set_str is used for zero-terminated C strings, and - * nvs_get/set_blob used for arbitrary data structures. - * - * \code{c} - * // Example (without error checking) of using nvs_get_str to get a string into dynamic array: - * size_t required_size; - * nvs_get_str(my_handle, "server_name", NULL, &required_size); - * char* server_name = malloc(required_size); - * nvs_get_str(my_handle, "server_name", server_name, &required_size); - * - * // Example (without error checking) of using nvs_get_blob to get a binary data - * into a static array: - * uint8_t mac_addr[6]; - * size_t size = sizeof(mac_addr); - * nvs_get_blob(my_handle, "dst_mac_addr", mac_addr, &size); - * \endcode - * - * @param[in] handle Handle obtained from nvs_open function. - * @param[in] key Key name. Maximal length is determined by the underlying - * implementation, but is guaranteed to be at least - * 15 characters. Shouldn't be empty. - * @param out_value Pointer to the output value. - * May be NULL for nvs_get_str and nvs_get_blob, in this - * case required length will be returned in length argument. - * @param[inout] length A non-zero pointer to the variable holding the length of out_value. - * In case out_value a zero, will be set to the length - * required to hold the value. In case out_value is not - * zero, will be set to the actual length of the value - * written. For nvs_get_str this includes zero terminator. - * - * @return - * - ESP_OK if the value was retrieved successfully - * - ESP_ERR_NVS_NOT_FOUND if the requested key doesn't exist - * - ESP_ERR_NVS_INVALID_HANDLE if handle has been closed or is NULL - * - ESP_ERR_NVS_INVALID_NAME if key name doesn't satisfy constraints - * - ESP_ERR_NVS_INVALID_LENGTH if length is not sufficient to store data - */ -/**@{*/ -esp_err_t nvs_get_str (nvs_handle handle, const char* key, char* out_value, size_t* length); -esp_err_t nvs_get_blob(nvs_handle handle, const char* key, void* out_value, size_t* length); -/**@}*/ - -/** - * @brief Erase key-value pair with given key name. - * - * Note that actual storage may not be updated until nvs_commit function is called. - * - * @param[in] handle Storage handle obtained with nvs_open. - * Handles that were opened read only cannot be used. - * - * @param[in] key Key name. Maximal length is determined by the underlying - * implementation, but is guaranteed to be at least - * 15 characters. Shouldn't be empty. - * - * @return - * - ESP_OK if erase operation was successful - * - ESP_ERR_NVS_INVALID_HANDLE if handle has been closed or is NULL - * - ESP_ERR_NVS_READ_ONLY if handle was opened as read only - * - ESP_ERR_NVS_NOT_FOUND if the requested key doesn't exist - * - other error codes from the underlying storage driver - */ -esp_err_t nvs_erase_key(nvs_handle handle, const char* key); - -/** - * @brief Erase all key-value pairs in a namespace - * - * Note that actual storage may not be updated until nvs_commit function is called. - * - * @param[in] handle Storage handle obtained with nvs_open. - * Handles that were opened read only cannot be used. - * - * @return - * - ESP_OK if erase operation was successful - * - ESP_ERR_NVS_INVALID_HANDLE if handle has been closed or is NULL - * - ESP_ERR_NVS_READ_ONLY if handle was opened as read only - * - other error codes from the underlying storage driver - */ -esp_err_t nvs_erase_all(nvs_handle handle); - -/** - * @brief Write any pending changes to non-volatile storage - * - * After setting any values, nvs_commit() must be called to ensure changes are written - * to non-volatile storage. Individual implementations may write to storage at other times, - * but this is not guaranteed. - * - * @param[in] handle Storage handle obtained with nvs_open. - * Handles that were opened read only cannot be used. - * - * @return - * - ESP_OK if the changes have been written successfully - * - ESP_ERR_NVS_INVALID_HANDLE if handle has been closed or is NULL - * - other error codes from the underlying storage driver - */ -esp_err_t nvs_commit(nvs_handle handle); - -/** - * @brief Close the storage handle and free any allocated resources - * - * This function should be called for each handle opened with nvs_open once - * the handle is not in use any more. Closing the handle may not automatically - * write the changes to nonvolatile storage. This has to be done explicitly using - * nvs_commit function. - * Once this function is called on a handle, the handle should no longer be used. - * - * @param[in] handle Storage handle to close - */ -void nvs_close(nvs_handle handle); - -/** - * @note Info about storage space NVS. - */ -typedef struct { - size_t used_entries; /**< Amount of used entries. */ - size_t free_entries; /**< Amount of free entries. */ - size_t total_entries; /**< Amount all available entries. */ - size_t namespace_count; /**< Amount name space. */ -} nvs_stats_t; - -/** - * @brief Fill structure nvs_stats_t. It provides info about used memory the partition. - * - * This function calculates to runtime the number of used entries, free entries, total entries, - * and amount namespace in partition. - * - * \code{c} - * // Example of nvs_get_stats() to get the number of used entries and free entries: - * nvs_stats_t nvs_stats; - * nvs_get_stats(NULL, &nvs_stats); - * printf("Count: UsedEntries = (%d), FreeEntries = (%d), AllEntries = (%d)\n", - nvs_stats.used_entries, nvs_stats.free_entries, nvs_stats.total_entries); - * \endcode - * - * @param[in] part_name Partition name NVS in the partition table. - * If pass a NULL than will use NVS_DEFAULT_PART_NAME ("nvs"). - * - * @param[out] nvs_stats Returns filled structure nvs_states_t. - * It provides info about used memory the partition. - * - * - * @return - * - ESP_OK if the changes have been written successfully. - * Return param nvs_stats will be filled. - * - ESP_ERR_NVS_PART_NOT_FOUND if the partition with label "name" is not found. - * Return param nvs_stats will be filled 0. - * - ESP_ERR_NVS_NOT_INITIALIZED if the storage driver is not initialized. - * Return param nvs_stats will be filled 0. - * - ESP_ERR_INVALID_ARG if nvs_stats equal to NULL. - * - ESP_ERR_INVALID_STATE if there is page with the status of INVALID. - * Return param nvs_stats will be filled not with correct values because - * not all pages will be counted. Counting will be interrupted at the first INVALID page. - */ -esp_err_t nvs_get_stats(const char* part_name, nvs_stats_t* nvs_stats); - -/** - * @brief Calculate all entries in a namespace. - * - * Note that to find out the total number of records occupied by the namespace, - * add one to the returned value used_entries (if err is equal to ESP_OK). - * Because the name space entry takes one entry. - * - * \code{c} - * // Example of nvs_get_used_entry_count() to get amount of all key-value pairs in one namespace: - * nvs_handle handle; - * nvs_open("namespace1", NVS_READWRITE, &handle); - * ... - * size_t used_entries; - * size_t total_entries_namespace; - * if(nvs_get_used_entry_count(handle, &used_entries) == ESP_OK){ - * // the total number of records occupied by the namespace - * total_entries_namespace = used_entries + 1; - * } - * \endcode - * - * @param[in] handle Handle obtained from nvs_open function. - * - * @param[out] used_entries Returns amount of used entries from a namespace. - * - * - * @return - * - ESP_OK if the changes have been written successfully. - * Return param used_entries will be filled valid value. - * - ESP_ERR_NVS_NOT_INITIALIZED if the storage driver is not initialized. - * Return param used_entries will be filled 0. - * - ESP_ERR_NVS_INVALID_HANDLE if handle has been closed or is NULL. - * Return param used_entries will be filled 0. - * - ESP_ERR_INVALID_ARG if nvs_stats equal to NULL. - * - Other error codes from the underlying storage driver. - * Return param used_entries will be filled 0. - */ -esp_err_t nvs_get_used_entry_count(nvs_handle handle, size_t* used_entries); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif //ESP_NVS_H - diff --git a/tools/sdk/include/nvs_flash/nvs_flash.h b/tools/sdk/include/nvs_flash/nvs_flash.h deleted file mode 100644 index 55b218ec56e..00000000000 --- a/tools/sdk/include/nvs_flash/nvs_flash.h +++ /dev/null @@ -1,194 +0,0 @@ -// 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. -#ifndef nvs_flash_h -#define nvs_flash_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include "nvs.h" -#include "esp_partition.h" - - -#define NVS_KEY_SIZE 32 // AES-256 - -/** - * @brief Key for encryption and decryption - */ -typedef struct { - uint8_t eky[NVS_KEY_SIZE]; /*!< XTS encryption and decryption key*/ - uint8_t tky[NVS_KEY_SIZE]; /*!< XTS tweak key */ -} nvs_sec_cfg_t; - -/** - * @brief Initialize the default NVS partition. - * - * This API initialises the default NVS partition. The default NVS partition - * is the one that is labeled "nvs" in the partition table. - * - * @return - * - ESP_OK if storage was successfully initialized. - * - ESP_ERR_NVS_NO_FREE_PAGES if the NVS storage contains no empty pages - * (which may happen if NVS partition was truncated) - * - ESP_ERR_NOT_FOUND if no partition with label "nvs" is found in the partition table - * - one of the error codes from the underlying flash storage driver - */ -esp_err_t nvs_flash_init(void); - -/** - * @brief Initialize NVS flash storage for the specified partition. - * - * @param[in] partition_label Label of the partition. Note that internally a reference to - * passed value is kept and it should be accessible for future operations - * - * @return - * - ESP_OK if storage was successfully initialized. - * - ESP_ERR_NVS_NO_FREE_PAGES if the NVS storage contains no empty pages - * (which may happen if NVS partition was truncated) - * - ESP_ERR_NOT_FOUND if specified partition is not found in the partition table - * - one of the error codes from the underlying flash storage driver - */ -esp_err_t nvs_flash_init_partition(const char *partition_label); - -/** - * @brief Deinitialize NVS storage for the default NVS partition - * - * Default NVS partition is the partition with "nvs" label in the partition table. - * - * @return - * - ESP_OK on success (storage was deinitialized) - * - ESP_ERR_NVS_NOT_INITIALIZED if the storage was not initialized prior to this call - */ -esp_err_t nvs_flash_deinit(void); - -/** - * @brief Deinitialize NVS storage for the given NVS partition - * - * @param[in] partition_label Label of the partition - * - * @return - * - ESP_OK on success - * - ESP_ERR_NVS_NOT_INITIALIZED if the storage for given partition was not - * initialized prior to this call - */ -esp_err_t nvs_flash_deinit_partition(const char* partition_label); - -/** - * @brief Erase the default NVS partition - * - * This function erases all contents of the default NVS partition (one with label "nvs") - * - * @return - * - ESP_OK on success - * - ESP_ERR_NOT_FOUND if there is no NVS partition labeled "nvs" in the - * partition table - */ -esp_err_t nvs_flash_erase(void); - -/** - * @brief Erase specified NVS partition - * - * This function erases all contents of specified NVS partition - * - * @param[in] part_name Name (label) of the partition to be erased - * - * @return - * - ESP_OK on success - * - ESP_ERR_NOT_FOUND if there is no NVS partition with the specified name - * in the partition table - */ -esp_err_t nvs_flash_erase_partition(const char *part_name); - - -/** - * @brief Initialize the default NVS partition. - * - * This API initialises the default NVS partition. The default NVS partition - * is the one that is labeled "nvs" in the partition table. - * - * @param[in] cfg Security configuration (keys) to be used for NVS encryption/decryption. - * If cfg is NULL, no encryption is used. - * - * @return - * - ESP_OK if storage was successfully initialized. - * - ESP_ERR_NVS_NO_FREE_PAGES if the NVS storage contains no empty pages - * (which may happen if NVS partition was truncated) - * - ESP_ERR_NOT_FOUND if no partition with label "nvs" is found in the partition table - * - one of the error codes from the underlying flash storage driver - */ -esp_err_t nvs_flash_secure_init(nvs_sec_cfg_t* cfg); - -/** - * @brief Initialize NVS flash storage for the specified partition. - * - * @param[in] partition_label Label of the partition. Note that internally a reference to - * passed value is kept and it should be accessible for future operations - * - * @param[in] cfg Security configuration (keys) to be used for NVS encryption/decryption. - * If cfg is null, no encryption/decryption is used. - * @return - * - ESP_OK if storage was successfully initialized. - * - ESP_ERR_NVS_NO_FREE_PAGES if the NVS storage contains no empty pages - * (which may happen if NVS partition was truncated) - * - ESP_ERR_NOT_FOUND if specified partition is not found in the partition table - * - one of the error codes from the underlying flash storage driver - */ -esp_err_t nvs_flash_secure_init_partition(const char *partition_label, nvs_sec_cfg_t* cfg); - -/** - * @brief Generate and store NVS keys in the provided esp partition - * - * @param[in] partition Pointer to partition structure obtained using - * esp_partition_find_first or esp_partition_get. - * Must be non-NULL. - * @param[out] cfg Pointer to nvs security configuration structure. - * Pointer must be non-NULL. - * Generated keys will be populated in this structure. - * - * - * @return - * -ESP_OK, if cfg was read successfully; - * -or error codes from esp_partition_write/erase APIs. - */ - -esp_err_t nvs_flash_generate_keys(const esp_partition_t* partition, nvs_sec_cfg_t* cfg); - - -/** - * @brief Read NVS security configuration from a partition. - * - * @param[in] partition Pointer to partition structure obtained using - * esp_partition_find_first or esp_partition_get. - * Must be non-NULL. - * @param[out] cfg Pointer to nvs security configuration structure. - * Pointer must be non-NULL. - * - * @note Provided parition is assumed to be marked 'encrypted'. - * - * @return - * -ESP_OK, if cfg was read successfully; - * -ESP_ERR_NVS_KEYS_NOT_INITIALIZED, if the partition is not yet written with keys. - * -ESP_ERR_NVS_CORRUPT_KEY_PART, if the partition containing keys is found to be corrupt - * -or error codes from esp_partition_read API. - */ - -esp_err_t nvs_flash_read_security_cfg(const esp_partition_t* partition, nvs_sec_cfg_t* cfg); - -#ifdef __cplusplus -} -#endif - - -#endif /* nvs_flash_h */ diff --git a/tools/sdk/include/openssl/internal/ssl3.h b/tools/sdk/include/openssl/internal/ssl3.h deleted file mode 100644 index 007b392f3e0..00000000000 --- a/tools/sdk/include/openssl/internal/ssl3.h +++ /dev/null @@ -1,44 +0,0 @@ -// 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. - -#ifndef _SSL3_H_ -#define _SSL3_H_ - -#ifdef __cplusplus - extern "C" { -#endif - -# define SSL3_AD_CLOSE_NOTIFY 0 -# define SSL3_AD_UNEXPECTED_MESSAGE 10/* fatal */ -# define SSL3_AD_BAD_RECORD_MAC 20/* fatal */ -# define SSL3_AD_DECOMPRESSION_FAILURE 30/* fatal */ -# define SSL3_AD_HANDSHAKE_FAILURE 40/* fatal */ -# define SSL3_AD_NO_CERTIFICATE 41 -# define SSL3_AD_BAD_CERTIFICATE 42 -# define SSL3_AD_UNSUPPORTED_CERTIFICATE 43 -# define SSL3_AD_CERTIFICATE_REVOKED 44 -# define SSL3_AD_CERTIFICATE_EXPIRED 45 -# define SSL3_AD_CERTIFICATE_UNKNOWN 46 -# define SSL3_AD_ILLEGAL_PARAMETER 47/* fatal */ - -# define SSL3_AL_WARNING 1 -# define SSL3_AL_FATAL 2 - -#define SSL3_VERSION 0x0300 - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/openssl/internal/ssl_cert.h b/tools/sdk/include/openssl/internal/ssl_cert.h deleted file mode 100644 index 86cf31ad513..00000000000 --- a/tools/sdk/include/openssl/internal/ssl_cert.h +++ /dev/null @@ -1,55 +0,0 @@ -// 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. - -#ifndef _SSL_CERT_H_ -#define _SSL_CERT_H_ - -#ifdef __cplusplus - extern "C" { -#endif - -#include "ssl_types.h" - -/** - * @brief create a certification object include private key object according to input certification - * - * @param ic - input certification point - * - * @return certification object point - */ -CERT *__ssl_cert_new(CERT *ic); - -/** - * @brief create a certification object include private key object - * - * @param none - * - * @return certification object point - */ -CERT* ssl_cert_new(void); - -/** - * @brief free a certification object - * - * @param cert - certification object point - * - * @return none - */ -void ssl_cert_free(CERT *cert); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/openssl/internal/ssl_code.h b/tools/sdk/include/openssl/internal/ssl_code.h deleted file mode 100644 index 80fdbb20f33..00000000000 --- a/tools/sdk/include/openssl/internal/ssl_code.h +++ /dev/null @@ -1,124 +0,0 @@ -// 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. - -#ifndef _SSL_CODE_H_ -#define _SSL_CODE_H_ - -#ifdef __cplusplus - extern "C" { -#endif - -#include "ssl3.h" -#include "tls1.h" -#include "x509_vfy.h" - -/* Used in SSL_set_shutdown()/SSL_get_shutdown(); */ -# define SSL_SENT_SHUTDOWN 1 -# define SSL_RECEIVED_SHUTDOWN 2 - -# define SSL_VERIFY_NONE 0x00 -# define SSL_VERIFY_PEER 0x01 -# define SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02 -# define SSL_VERIFY_CLIENT_ONCE 0x04 - -/* - * The following 3 states are kept in ssl->rlayer.rstate when reads fail, you - * should not need these - */ -# define SSL_ST_READ_HEADER 0xF0 -# define SSL_ST_READ_BODY 0xF1 -# define SSL_ST_READ_DONE 0xF2 - -# define SSL_NOTHING 1 -# define SSL_WRITING 2 -# define SSL_READING 3 -# define SSL_X509_LOOKUP 4 -# define SSL_ASYNC_PAUSED 5 -# define SSL_ASYNC_NO_JOBS 6 - - -# define SSL_ERROR_NONE 0 -# define SSL_ERROR_SSL 1 -# define SSL_ERROR_WANT_READ 2 -# define SSL_ERROR_WANT_WRITE 3 -# define SSL_ERROR_WANT_X509_LOOKUP 4 -# define SSL_ERROR_SYSCALL 5/* look at error stack/return value/errno */ -# define SSL_ERROR_ZERO_RETURN 6 -# define SSL_ERROR_WANT_CONNECT 7 -# define SSL_ERROR_WANT_ACCEPT 8 -# define SSL_ERROR_WANT_ASYNC 9 -# define SSL_ERROR_WANT_ASYNC_JOB 10 - -/* Message flow states */ -typedef enum { - /* No handshake in progress */ - MSG_FLOW_UNINITED, - /* A permanent error with this connection */ - MSG_FLOW_ERROR, - /* We are about to renegotiate */ - MSG_FLOW_RENEGOTIATE, - /* We are reading messages */ - MSG_FLOW_READING, - /* We are writing messages */ - MSG_FLOW_WRITING, - /* Handshake has finished */ - MSG_FLOW_FINISHED -} MSG_FLOW_STATE; - -/* SSL subsystem states */ -typedef enum { - TLS_ST_BEFORE, - TLS_ST_OK, - DTLS_ST_CR_HELLO_VERIFY_REQUEST, - TLS_ST_CR_SRVR_HELLO, - TLS_ST_CR_CERT, - TLS_ST_CR_CERT_STATUS, - TLS_ST_CR_KEY_EXCH, - TLS_ST_CR_CERT_REQ, - TLS_ST_CR_SRVR_DONE, - TLS_ST_CR_SESSION_TICKET, - TLS_ST_CR_CHANGE, - TLS_ST_CR_FINISHED, - TLS_ST_CW_CLNT_HELLO, - TLS_ST_CW_CERT, - TLS_ST_CW_KEY_EXCH, - TLS_ST_CW_CERT_VRFY, - TLS_ST_CW_CHANGE, - TLS_ST_CW_NEXT_PROTO, - TLS_ST_CW_FINISHED, - TLS_ST_SW_HELLO_REQ, - TLS_ST_SR_CLNT_HELLO, - DTLS_ST_SW_HELLO_VERIFY_REQUEST, - TLS_ST_SW_SRVR_HELLO, - TLS_ST_SW_CERT, - TLS_ST_SW_KEY_EXCH, - TLS_ST_SW_CERT_REQ, - TLS_ST_SW_SRVR_DONE, - TLS_ST_SR_CERT, - TLS_ST_SR_KEY_EXCH, - TLS_ST_SR_CERT_VRFY, - TLS_ST_SR_NEXT_PROTO, - TLS_ST_SR_CHANGE, - TLS_ST_SR_FINISHED, - TLS_ST_SW_SESSION_TICKET, - TLS_ST_SW_CERT_STATUS, - TLS_ST_SW_CHANGE, - TLS_ST_SW_FINISHED -} OSSL_HANDSHAKE_STATE; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/openssl/internal/ssl_dbg.h b/tools/sdk/include/openssl/internal/ssl_dbg.h deleted file mode 100644 index 12ba25f99d8..00000000000 --- a/tools/sdk/include/openssl/internal/ssl_dbg.h +++ /dev/null @@ -1,191 +0,0 @@ -// 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. - -#ifndef _SSL_DEBUG_H_ -#define _SSL_DEBUG_H_ - -#include "platform/ssl_opt.h" -#include "platform/ssl_port.h" - -#ifdef __cplusplus - extern "C" { -#endif - -#ifdef CONFIG_OPENSSL_DEBUG_LEVEL - #define SSL_DEBUG_LEVEL CONFIG_OPENSSL_DEBUG_LEVEL -#else - #define SSL_DEBUG_LEVEL 0 -#endif - -#define SSL_DEBUG_ON (SSL_DEBUG_LEVEL + 1) -#define SSL_DEBUG_OFF (SSL_DEBUG_LEVEL - 1) - -#ifdef CONFIG_OPENSSL_DEBUG - #ifndef SSL_DEBUG_LOG - #error "SSL_DEBUG_LOG is not defined" - #endif - - #ifndef SSL_DEBUG_FL - #define SSL_DEBUG_FL "\n" - #endif - - #define SSL_SHOW_LOCATION() \ - SSL_DEBUG_LOG("SSL assert : %s %d\n", \ - __FILE__, __LINE__) - - #define SSL_DEBUG(level, fmt, ...) \ - { \ - if (level > SSL_DEBUG_LEVEL) { \ - SSL_DEBUG_LOG(fmt SSL_DEBUG_FL, ##__VA_ARGS__); \ - } \ - } -#else /* CONFIG_OPENSSL_DEBUG */ - #define SSL_SHOW_LOCATION() - - #define SSL_DEBUG(level, fmt, ...) -#endif /* CONFIG_OPENSSL_DEBUG */ - -/** - * OpenSSL assert function - * - * if select "CONFIG_OPENSSL_ASSERT_DEBUG", SSL_ASSERT* will show error file name and line - * if select "CONFIG_OPENSSL_ASSERT_EXIT", SSL_ASSERT* will just return error code. - * if select "CONFIG_OPENSSL_ASSERT_DEBUG_EXIT" SSL_ASSERT* will show error file name and line, - * then return error code. - * if select "CONFIG_OPENSSL_ASSERT_DEBUG_BLOCK", SSL_ASSERT* will show error file name and line, - * then block here with "while (1)" - * - * SSL_ASSERT1 may will return "-1", so function's return argument is integer. - * SSL_ASSERT2 may will return "NULL", so function's return argument is a point. - * SSL_ASSERT2 may will return nothing, so function's return argument is "void". - */ -#if defined(CONFIG_OPENSSL_ASSERT_DEBUG) - #define SSL_ASSERT1(s) \ - { \ - if (!(s)) { \ - SSL_SHOW_LOCATION(); \ - } \ - } - - #define SSL_ASSERT2(s) \ - { \ - if (!(s)) { \ - SSL_SHOW_LOCATION(); \ - } \ - } - - #define SSL_ASSERT3(s) \ - { \ - if (!(s)) { \ - SSL_SHOW_LOCATION(); \ - } \ - } -#elif defined(CONFIG_OPENSSL_ASSERT_EXIT) - #define SSL_ASSERT1(s) \ - { \ - if (!(s)) { \ - return -1; \ - } \ - } - - #define SSL_ASSERT2(s) \ - { \ - if (!(s)) { \ - return NULL; \ - } \ - } - - #define SSL_ASSERT3(s) \ - { \ - if (!(s)) { \ - return ; \ - } \ - } -#elif defined(CONFIG_OPENSSL_ASSERT_DEBUG_EXIT) - #define SSL_ASSERT1(s) \ - { \ - if (!(s)) { \ - SSL_SHOW_LOCATION(); \ - return -1; \ - } \ - } - - #define SSL_ASSERT2(s) \ - { \ - if (!(s)) { \ - SSL_SHOW_LOCATION(); \ - return NULL; \ - } \ - } - - #define SSL_ASSERT3(s) \ - { \ - if (!(s)) { \ - SSL_SHOW_LOCATION(); \ - return ; \ - } \ - } -#elif defined(CONFIG_OPENSSL_ASSERT_DEBUG_BLOCK) - #define SSL_ASSERT1(s) \ - { \ - if (!(s)) { \ - SSL_SHOW_LOCATION(); \ - while (1); \ - } \ - } - - #define SSL_ASSERT2(s) \ - { \ - if (!(s)) { \ - SSL_SHOW_LOCATION(); \ - while (1); \ - } \ - } - - #define SSL_ASSERT3(s) \ - { \ - if (!(s)) { \ - SSL_SHOW_LOCATION(); \ - while (1); \ - } \ - } -#else - #define SSL_ASSERT1(s) - #define SSL_ASSERT2(s) - #define SSL_ASSERT3(s) -#endif - -#define SSL_PLATFORM_DEBUG_LEVEL SSL_DEBUG_OFF -#define SSL_PLATFORM_ERROR_LEVEL SSL_DEBUG_ON - -#define SSL_CERT_DEBUG_LEVEL SSL_DEBUG_OFF -#define SSL_CERT_ERROR_LEVEL SSL_DEBUG_ON - -#define SSL_PKEY_DEBUG_LEVEL SSL_DEBUG_OFF -#define SSL_PKEY_ERROR_LEVEL SSL_DEBUG_ON - -#define SSL_X509_DEBUG_LEVEL SSL_DEBUG_OFF -#define SSL_X509_ERROR_LEVEL SSL_DEBUG_ON - -#define SSL_LIB_DEBUG_LEVEL SSL_DEBUG_OFF -#define SSL_LIB_ERROR_LEVEL SSL_DEBUG_ON - -#define SSL_STACK_DEBUG_LEVEL SSL_DEBUG_OFF -#define SSL_STACK_ERROR_LEVEL SSL_DEBUG_ON - -#ifdef __cplusplus - } -#endif - -#endif diff --git a/tools/sdk/include/openssl/internal/ssl_lib.h b/tools/sdk/include/openssl/internal/ssl_lib.h deleted file mode 100644 index bf7de22fdf0..00000000000 --- a/tools/sdk/include/openssl/internal/ssl_lib.h +++ /dev/null @@ -1,28 +0,0 @@ -// 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. - -#ifndef _SSL_LIB_H_ -#define _SSL_LIB_H_ - -#ifdef __cplusplus - extern "C" { -#endif - -#include "ssl_types.h" - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/openssl/internal/ssl_methods.h b/tools/sdk/include/openssl/internal/ssl_methods.h deleted file mode 100644 index 17cf9bb6974..00000000000 --- a/tools/sdk/include/openssl/internal/ssl_methods.h +++ /dev/null @@ -1,122 +0,0 @@ -// 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. - -#ifndef _SSL_METHODS_H_ -#define _SSL_METHODS_H_ - -#include "ssl_types.h" - -#ifdef __cplusplus - extern "C" { -#endif - -/** - * TLS method function implement - */ -#define IMPLEMENT_TLS_METHOD_FUNC(func_name, \ - new, free, \ - handshake, shutdown, clear, \ - read, send, pending, \ - set_fd, set_hostname, get_fd, \ - set_bufflen, \ - get_verify_result, \ - get_state) \ - static const SSL_METHOD_FUNC func_name LOCAL_ATRR = { \ - new, \ - free, \ - handshake, \ - shutdown, \ - clear, \ - read, \ - send, \ - pending, \ - set_fd, \ - set_hostname, \ - get_fd, \ - set_bufflen, \ - get_verify_result, \ - get_state \ - }; - -#define IMPLEMENT_TLS_METHOD(ver, mode, fun, func_name) \ - const SSL_METHOD* func_name(void) { \ - static const SSL_METHOD func_name##_data LOCAL_ATRR = { \ - ver, \ - mode, \ - &(fun), \ - }; \ - return &func_name##_data; \ - } - -#define IMPLEMENT_SSL_METHOD(ver, mode, fun, func_name) \ - const SSL_METHOD* func_name(void) { \ - static const SSL_METHOD func_name##_data LOCAL_ATRR = { \ - ver, \ - mode, \ - &(fun), \ - }; \ - return &func_name##_data; \ - } - -#define IMPLEMENT_X509_METHOD(func_name, \ - new, \ - free, \ - load, \ - show_info) \ - const X509_METHOD* func_name(void) { \ - static const X509_METHOD func_name##_data LOCAL_ATRR = { \ - new, \ - free, \ - load, \ - show_info \ - }; \ - return &func_name##_data; \ - } - -#define IMPLEMENT_PKEY_METHOD(func_name, \ - new, \ - free, \ - load) \ - const PKEY_METHOD* func_name(void) { \ - static const PKEY_METHOD func_name##_data LOCAL_ATRR = { \ - new, \ - free, \ - load \ - }; \ - return &func_name##_data; \ - } - -/** - * @brief get X509 object method - * - * @param none - * - * @return X509 object method point - */ -const X509_METHOD* X509_method(void); - -/** - * @brief get private key object method - * - * @param none - * - * @return private key object method point - */ -const PKEY_METHOD* EVP_PKEY_method(void); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/openssl/internal/ssl_pkey.h b/tools/sdk/include/openssl/internal/ssl_pkey.h deleted file mode 100644 index e790fcc995a..00000000000 --- a/tools/sdk/include/openssl/internal/ssl_pkey.h +++ /dev/null @@ -1,86 +0,0 @@ -// 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. - -#ifndef _SSL_PKEY_H_ -#define _SSL_PKEY_H_ - -#ifdef __cplusplus - extern "C" { -#endif - -#include "ssl_types.h" - -/** - * @brief create a private key object according to input private key - * - * @param ipk - input private key point - * - * @return new private key object point - */ -EVP_PKEY* __EVP_PKEY_new(EVP_PKEY *ipk); - -/** - * @brief create a private key object - * - * @param none - * - * @return private key object point - */ -EVP_PKEY* EVP_PKEY_new(void); - -/** - * @brief load a character key context into system context. If '*a' is pointed to the - * private key, then load key into it. Or create a new private key object - * - * @param type - private key type - * @param a - a point pointed to a private key point - * @param pp - a point pointed to the key context memory point - * @param length - key bytes - * - * @return private key object point - */ -EVP_PKEY* d2i_PrivateKey(int type, - EVP_PKEY **a, - const unsigned char **pp, - long length); - -/** - * @brief free a private key object - * - * @param pkey - private key object point - * - * @return none - */ -void EVP_PKEY_free(EVP_PKEY *x); - -/** - * @brief load private key into the SSL - * - * @param type - private key type - * @param ssl - SSL point - * @param len - data bytes - * @param d - data point - * - * @return result - * 0 : failed - * 1 : OK - */ - int SSL_use_PrivateKey_ASN1(int type, SSL *ssl, const unsigned char *d, long len); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/openssl/internal/ssl_stack.h b/tools/sdk/include/openssl/internal/ssl_stack.h deleted file mode 100644 index 7a7051a026b..00000000000 --- a/tools/sdk/include/openssl/internal/ssl_stack.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef _SSL_STACK_H_ -#define _SSL_STACK_H_ - -#ifdef __cplusplus - extern "C" { -#endif - -#include "ssl_types.h" - -#define STACK_OF(type) struct stack_st_##type - -#define SKM_DEFINE_STACK_OF(t1, t2, t3) \ - STACK_OF(t1); \ - static ossl_inline STACK_OF(t1) *sk_##t1##_new_null(void) \ - { \ - return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \ - } \ - -#define DEFINE_STACK_OF(t) SKM_DEFINE_STACK_OF(t, t, t) - -/** - * @brief create a openssl stack object - * - * @param c - stack function - * - * @return openssl stack object point - */ -OPENSSL_STACK* OPENSSL_sk_new(OPENSSL_sk_compfunc c); - -/** - * @brief create a NULL function openssl stack object - * - * @param none - * - * @return openssl stack object point - */ -OPENSSL_STACK *OPENSSL_sk_new_null(void); - -/** - * @brief free openssl stack object - * - * @param openssl stack object point - * - * @return none - */ -void OPENSSL_sk_free(OPENSSL_STACK *stack); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/openssl/internal/ssl_types.h b/tools/sdk/include/openssl/internal/ssl_types.h deleted file mode 100644 index 21ba69f4c7f..00000000000 --- a/tools/sdk/include/openssl/internal/ssl_types.h +++ /dev/null @@ -1,311 +0,0 @@ -// 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. - -#ifndef _SSL_TYPES_H_ -#define _SSL_TYPES_H_ - -#ifdef __cplusplus - extern "C" { -#endif - -#include "ssl_code.h" - -typedef void SSL_CIPHER; - -typedef void X509_STORE_CTX; -typedef void X509_STORE; - -typedef void RSA; - -typedef void STACK; - -#define ossl_inline inline - -#define SSL_METHOD_CALL(f, s, ...) s->method->func->ssl_##f(s, ##__VA_ARGS__) -#define X509_METHOD_CALL(f, x, ...) x->method->x509_##f(x, ##__VA_ARGS__) -#define EVP_PKEY_METHOD_CALL(f, k, ...) k->method->pkey_##f(k, ##__VA_ARGS__) - -typedef int (*OPENSSL_sk_compfunc)(const void *, const void *); - -struct stack_st; -typedef struct stack_st OPENSSL_STACK; - -struct ssl_method_st; -typedef struct ssl_method_st SSL_METHOD; - -struct ssl_method_func_st; -typedef struct ssl_method_func_st SSL_METHOD_FUNC; - -struct record_layer_st; -typedef struct record_layer_st RECORD_LAYER; - -struct ossl_statem_st; -typedef struct ossl_statem_st OSSL_STATEM; - -struct ssl_session_st; -typedef struct ssl_session_st SSL_SESSION; - -struct ssl_ctx_st; -typedef struct ssl_ctx_st SSL_CTX; - -struct ssl_st; -typedef struct ssl_st SSL; - -struct cert_st; -typedef struct cert_st CERT; - -struct x509_st; -typedef struct x509_st X509; - -struct X509_VERIFY_PARAM_st; -typedef struct X509_VERIFY_PARAM_st X509_VERIFY_PARAM; - -struct evp_pkey_st; -typedef struct evp_pkey_st EVP_PKEY; - -struct x509_method_st; -typedef struct x509_method_st X509_METHOD; - -struct pkey_method_st; -typedef struct pkey_method_st PKEY_METHOD; - -struct ssl_alpn_st; -typedef struct ssl_alpn_st SSL_ALPN; - -struct bio_st; -typedef struct bio_st BIO; - -struct stack_st { - - char **data; - - int num_alloc; - - OPENSSL_sk_compfunc c; -}; - -struct evp_pkey_st { - - void *pkey_pm; - - const PKEY_METHOD *method; -}; - -struct x509_st { - - /* X509 certification platform private point */ - void *x509_pm; - - const X509_METHOD *method; - - int ref_counter; -}; - -struct cert_st { - - int sec_level; - - X509 *x509; - - EVP_PKEY *pkey; - -}; - -struct ossl_statem_st { - - MSG_FLOW_STATE state; - - int hand_state; -}; - -struct record_layer_st { - - int rstate; - - int read_ahead; -}; - -struct ssl_session_st { - - long timeout; - - long time; - - X509 *peer; -}; - -struct X509_VERIFY_PARAM_st { - - int depth; - -}; - -struct bio_st { - const unsigned char * data; - int dlen; -}; - -typedef enum { ALPN_INIT, ALPN_ENABLE, ALPN_DISABLE, ALPN_ERROR } ALPN_STATUS; -struct ssl_alpn_st { - ALPN_STATUS alpn_status; - /* This is dynamically allocated */ - char *alpn_string; - /* This only points to the members in the string */ -#define ALPN_LIST_MAX 10 - const char *alpn_list[ALPN_LIST_MAX]; -}; - -struct ssl_ctx_st -{ - int version; - - int references; - - unsigned long options; - - SSL_ALPN ssl_alpn; - - const SSL_METHOD *method; - - CERT *cert; - - X509 *client_CA; - - int verify_mode; - - int (*default_verify_callback) (int ok, X509_STORE_CTX *ctx); - - long session_timeout; - - int read_ahead; - - int read_buffer_len; - - X509_VERIFY_PARAM param; -}; - -struct ssl_st -{ - /* protocol version(one of SSL3.0, TLS1.0, etc.) */ - int version; - - unsigned long options; - - /* shut things down(0x01 : sent, 0x02 : received) */ - int shutdown; - - CERT *cert; - - X509 *client_CA; - - SSL_CTX *ctx; - - const SSL_METHOD *method; - - RECORD_LAYER rlayer; - - /* where we are */ - OSSL_STATEM statem; - - SSL_SESSION *session; - - int verify_mode; - - int (*verify_callback) (int ok, X509_STORE_CTX *ctx); - - int rwstate; - - long verify_result; - - X509_VERIFY_PARAM param; - - int err; - - void (*info_callback) (const SSL *ssl, int type, int val); - - /* SSL low-level system arch point */ - void *ssl_pm; -}; - -struct ssl_method_st { - /* protocol version(one of SSL3.0, TLS1.0, etc.) */ - int version; - - /* SSL mode(client(0) , server(1), not known(-1)) */ - int endpoint; - - const SSL_METHOD_FUNC *func; -}; - -struct ssl_method_func_st { - - int (*ssl_new)(SSL *ssl); - - void (*ssl_free)(SSL *ssl); - - int (*ssl_handshake)(SSL *ssl); - - int (*ssl_shutdown)(SSL *ssl); - - int (*ssl_clear)(SSL *ssl); - - int (*ssl_read)(SSL *ssl, void *buffer, int len); - - int (*ssl_send)(SSL *ssl, const void *buffer, int len); - - int (*ssl_pending)(const SSL *ssl); - - void (*ssl_set_fd)(SSL *ssl, int fd, int mode); - - void (*ssl_set_hostname)(SSL *ssl, const char *hostname); - - int (*ssl_get_fd)(const SSL *ssl, int mode); - - void (*ssl_set_bufflen)(SSL *ssl, int len); - - long (*ssl_get_verify_result)(const SSL *ssl); - - OSSL_HANDSHAKE_STATE (*ssl_get_state)(const SSL *ssl); -}; - -struct x509_method_st { - - int (*x509_new)(X509 *x, X509 *m_x); - - void (*x509_free)(X509 *x); - - int (*x509_load)(X509 *x, const unsigned char *buf, int len); - - int (*x509_show_info)(X509 *x); -}; - -struct pkey_method_st { - - int (*pkey_new)(EVP_PKEY *pkey, EVP_PKEY *m_pkey); - - void (*pkey_free)(EVP_PKEY *pkey); - - int (*pkey_load)(EVP_PKEY *pkey, const unsigned char *buf, int len); -}; - - -typedef int (*next_proto_cb)(SSL *ssl, unsigned char **out, - unsigned char *outlen, const unsigned char *in, - unsigned int inlen, void *arg); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/openssl/internal/ssl_x509.h b/tools/sdk/include/openssl/internal/ssl_x509.h deleted file mode 100644 index 877c4fbb775..00000000000 --- a/tools/sdk/include/openssl/internal/ssl_x509.h +++ /dev/null @@ -1,175 +0,0 @@ -// 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. - -#ifndef _SSL_X509_H_ -#define _SSL_X509_H_ - -#ifdef __cplusplus - extern "C" { -#endif - -#include "ssl_types.h" -#include "ssl_stack.h" - -DEFINE_STACK_OF(X509_NAME) - -/** - * @brief create a X509 certification object according to input X509 certification - * - * @param ix - input X509 certification point - * - * @return new X509 certification object point - */ -X509* __X509_new(X509 *ix); - -/** - * @brief create a X509 certification object - * - * @param none - * - * @return X509 certification object point - */ -X509* X509_new(void); - -/** - * @brief load a character certification context into system context. If '*cert' is pointed to the - * certification, then load certification into it. Or create a new X509 certification object - * - * @param cert - a point pointed to X509 certification - * @param buffer - a point pointed to the certification context memory point - * @param length - certification bytes - * - * @return X509 certification object point - */ -X509* d2i_X509(X509 **cert, const unsigned char *buffer, long len); - -/** - * @brief free a X509 certification object - * - * @param x - X509 certification object point - * - * @return none - */ -void X509_free(X509 *x); - -/** - * @brief set SSL context client CA certification - * - * @param ctx - SSL context point - * @param x - X509 certification point - * - * @return result - * 0 : failed - * 1 : OK - */ -int SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *x); - -/** - * @brief add CA client certification into the SSL - * - * @param ssl - SSL point - * @param x - X509 certification point - * - * @return result - * 0 : failed - * 1 : OK - */ -int SSL_add_client_CA(SSL *ssl, X509 *x); - -/** - * @brief load certification into the SSL - * - * @param ssl - SSL point - * @param len - data bytes - * @param d - data point - * - * @return result - * 0 : failed - * 1 : OK - * - */ -int SSL_use_certificate_ASN1(SSL *ssl, int len, const unsigned char *d); - - -/** - * @brief set SSL context client CA certification - * - * @param store - pointer to X509_STORE - * @param x - pointer to X509 certification point - * - * @return result - * 0 : failed - * 1 : OK - */ -int X509_STORE_add_cert(X509_STORE *store, X509 *x); - -/** - * @brief load data in BIO - * - * Normally BIO_write should append data but that doesn't happen here, and - * 'data' cannot be freed after the function is called, it should remain valid - * until BIO object is in use. - * - * @param b - pointer to BIO - * @param data - pointer to data - * @param dlen - data bytes - * - * @return result - * 0 : failed - * 1 : OK - */ -int BIO_write(BIO *b, const void *data, int dlen); - -/** - * @brief load a character certification context into system context. - * - * If '*cert' is pointed to the certification, then load certification - * into it, or create a new X509 certification object. - * - * @param bp - pointer to BIO - * @param buffer - pointer to the certification context memory - * @param cb - pointer to a callback which queries pass phrase used - for encrypted PEM structure - * @param u - pointer to arbitary data passed by application to callback - * - * @return X509 certification object point - */ -X509 * PEM_read_bio_X509(BIO *bp, X509 **x, void *cb, void *u); - -/** - * @brief create a BIO object - * - * @param method - pointer to BIO_METHOD - * - * @return pointer to BIO object - */ -BIO *BIO_new(void * method); - -/** - * @brief get the memory BIO method function - */ -void *BIO_s_mem(); - -/** - * @brief free a BIO object - * - * @param x - pointer to BIO object - */ -void BIO_free(BIO *b); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/openssl/internal/tls1.h b/tools/sdk/include/openssl/internal/tls1.h deleted file mode 100644 index a9da53e063e..00000000000 --- a/tools/sdk/include/openssl/internal/tls1.h +++ /dev/null @@ -1,55 +0,0 @@ -// 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. - -#ifndef _TLS1_H_ -#define _TLS1_H_ - -#ifdef __cplusplus - extern "C" { -#endif - -# define TLS1_AD_DECRYPTION_FAILED 21 -# define TLS1_AD_RECORD_OVERFLOW 22 -# define TLS1_AD_UNKNOWN_CA 48/* fatal */ -# define TLS1_AD_ACCESS_DENIED 49/* fatal */ -# define TLS1_AD_DECODE_ERROR 50/* fatal */ -# define TLS1_AD_DECRYPT_ERROR 51 -# define TLS1_AD_EXPORT_RESTRICTION 60/* fatal */ -# define TLS1_AD_PROTOCOL_VERSION 70/* fatal */ -# define TLS1_AD_INSUFFICIENT_SECURITY 71/* fatal */ -# define TLS1_AD_INTERNAL_ERROR 80/* fatal */ -# define TLS1_AD_INAPPROPRIATE_FALLBACK 86/* fatal */ -# define TLS1_AD_USER_CANCELLED 90 -# define TLS1_AD_NO_RENEGOTIATION 100 -/* codes 110-114 are from RFC3546 */ -# define TLS1_AD_UNSUPPORTED_EXTENSION 110 -# define TLS1_AD_CERTIFICATE_UNOBTAINABLE 111 -# define TLS1_AD_UNRECOGNIZED_NAME 112 -# define TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE 113 -# define TLS1_AD_BAD_CERTIFICATE_HASH_VALUE 114 -# define TLS1_AD_UNKNOWN_PSK_IDENTITY 115/* fatal */ -# define TLS1_AD_NO_APPLICATION_PROTOCOL 120 /* fatal */ - -/* Special value for method supporting multiple versions */ -#define TLS_ANY_VERSION 0x10000 - -#define TLS1_VERSION 0x0301 -#define TLS1_1_VERSION 0x0302 -#define TLS1_2_VERSION 0x0303 - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/openssl/internal/x509_vfy.h b/tools/sdk/include/openssl/internal/x509_vfy.h deleted file mode 100644 index fec367d5fd8..00000000000 --- a/tools/sdk/include/openssl/internal/x509_vfy.h +++ /dev/null @@ -1,111 +0,0 @@ -// 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. - -#ifndef _X509_VFY_H_ -#define _X509_VFY_H_ - -#ifdef __cplusplus - extern "C" { -#endif - -#define X509_V_OK 0 -#define X509_V_ERR_UNSPECIFIED 1 -#define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT 2 -#define X509_V_ERR_UNABLE_TO_GET_CRL 3 -#define X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE 4 -#define X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE 5 -#define X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY 6 -#define X509_V_ERR_CERT_SIGNATURE_FAILURE 7 -#define X509_V_ERR_CRL_SIGNATURE_FAILURE 8 -#define X509_V_ERR_CERT_NOT_YET_VALID 9 -#define X509_V_ERR_CERT_HAS_EXPIRED 10 -#define X509_V_ERR_CRL_NOT_YET_VALID 11 -#define X509_V_ERR_CRL_HAS_EXPIRED 12 -#define X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD 13 -#define X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD 14 -#define X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD 15 -#define X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD 16 -#define X509_V_ERR_OUT_OF_MEM 17 -#define X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT 18 -#define X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN 19 -#define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY 20 -#define X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE 21 -#define X509_V_ERR_CERT_CHAIN_TOO_LONG 22 -#define X509_V_ERR_CERT_REVOKED 23 -#define X509_V_ERR_INVALID_CA 24 -#define X509_V_ERR_PATH_LENGTH_EXCEEDED 25 -#define X509_V_ERR_INVALID_PURPOSE 26 -#define X509_V_ERR_CERT_UNTRUSTED 27 -#define X509_V_ERR_CERT_REJECTED 28 -/* These are 'informational' when looking for issuer cert */ -#define X509_V_ERR_SUBJECT_ISSUER_MISMATCH 29 -#define X509_V_ERR_AKID_SKID_MISMATCH 30 -#define X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH 31 -#define X509_V_ERR_KEYUSAGE_NO_CERTSIGN 32 -#define X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER 33 -#define X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION 34 -#define X509_V_ERR_KEYUSAGE_NO_CRL_SIGN 35 -#define X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION 36 -#define X509_V_ERR_INVALID_NON_CA 37 -#define X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED 38 -#define X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE 39 -#define X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED 40 -#define X509_V_ERR_INVALID_EXTENSION 41 -#define X509_V_ERR_INVALID_POLICY_EXTENSION 42 -#define X509_V_ERR_NO_EXPLICIT_POLICY 43 -#define X509_V_ERR_DIFFERENT_CRL_SCOPE 44 -#define X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE 45 -#define X509_V_ERR_UNNESTED_RESOURCE 46 -#define X509_V_ERR_PERMITTED_VIOLATION 47 -#define X509_V_ERR_EXCLUDED_VIOLATION 48 -#define X509_V_ERR_SUBTREE_MINMAX 49 -/* The application is not happy */ -#define X509_V_ERR_APPLICATION_VERIFICATION 50 -#define X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE 51 -#define X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX 52 -#define X509_V_ERR_UNSUPPORTED_NAME_SYNTAX 53 -#define X509_V_ERR_CRL_PATH_VALIDATION_ERROR 54 -/* Another issuer check debug option */ -#define X509_V_ERR_PATH_LOOP 55 -/* Suite B mode algorithm violation */ -#define X509_V_ERR_SUITE_B_INVALID_VERSION 56 -#define X509_V_ERR_SUITE_B_INVALID_ALGORITHM 57 -#define X509_V_ERR_SUITE_B_INVALID_CURVE 58 -#define X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM 59 -#define X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED 60 -#define X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256 61 -/* Host, email and IP check errors */ -#define X509_V_ERR_HOSTNAME_MISMATCH 62 -#define X509_V_ERR_EMAIL_MISMATCH 63 -#define X509_V_ERR_IP_ADDRESS_MISMATCH 64 -/* DANE TLSA errors */ -#define X509_V_ERR_DANE_NO_MATCH 65 -/* security level errors */ -#define X509_V_ERR_EE_KEY_TOO_SMALL 66 -#define X509_V_ERR_CA_KEY_TOO_SMALL 67 -#define X509_V_ERR_CA_MD_TOO_WEAK 68 -/* Caller error */ -#define X509_V_ERR_INVALID_CALL 69 -/* Issuer lookup error */ -#define X509_V_ERR_STORE_LOOKUP 70 -/* Certificate transparency */ -#define X509_V_ERR_NO_VALID_SCTS 71 - -#define X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION 72 - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/openssl/openssl/ssl.h b/tools/sdk/include/openssl/openssl/ssl.h deleted file mode 100644 index 88d7bca69dc..00000000000 --- a/tools/sdk/include/openssl/openssl/ssl.h +++ /dev/null @@ -1,1822 +0,0 @@ -// 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. - -#ifndef _SSL_H_ -#define _SSL_H_ - -#ifdef __cplusplus - extern "C" { -#endif - -#include "internal/ssl_x509.h" -#include "internal/ssl_pkey.h" - -/* -{ -*/ - -#define SSL_CB_ALERT 0x4000 - -#define X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT (1 << 0) -#define X509_CHECK_FLAG_NO_WILDCARDS (1 << 1) -#define X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS (1 << 2) -#define X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS (1 << 3) -#define X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS (1 << 4) - -/** - * @brief create a SSL context - * - * @param method - the SSL context method point - * - * @return the context point - */ -SSL_CTX* SSL_CTX_new(const SSL_METHOD *method); - -/** - * @brief free a SSL context - * - * @param method - the SSL context point - * - * @return none - */ -void SSL_CTX_free(SSL_CTX *ctx); - -/** - * @brief create a SSL - * - * @param ctx - the SSL context point - * - * @return the SSL point - */ -SSL* SSL_new(SSL_CTX *ctx); - -/** - * @brief free the SSL - * - * @param ssl - the SSL point - * - * @return none - */ -void SSL_free(SSL *ssl); - -/** - * @brief connect to the remote SSL server - * - * @param ssl - the SSL point - * - * @return result - * 1 : OK - * -1 : failed - */ -int SSL_connect(SSL *ssl); - -/** - * @brief accept the remote connection - * - * @param ssl - the SSL point - * - * @return result - * 1 : OK - * -1 : failed - */ -int SSL_accept(SSL *ssl); - -/** - * @brief read data from to remote - * - * @param ssl - the SSL point which has been connected - * @param buffer - the received data buffer point - * @param len - the received data length - * - * @return result - * > 0 : OK, and return received data bytes - * = 0 : connection is closed - * < 0 : an error catch - */ -int SSL_read(SSL *ssl, void *buffer, int len); - -/** - * @brief send the data to remote - * - * @param ssl - the SSL point which has been connected - * @param buffer - the send data buffer point - * @param len - the send data length - * - * @return result - * > 0 : OK, and return sent data bytes - * = 0 : connection is closed - * < 0 : an error catch - */ -int SSL_write(SSL *ssl, const void *buffer, int len); - -/** - * @brief get the verifying result of the SSL certification - * - * @param ssl - the SSL point - * - * @return the result of verifying - */ -long SSL_get_verify_result(const SSL *ssl); - -/** - * @brief shutdown the connection - * - * @param ssl - the SSL point - * - * @return result - * 1 : OK - * 0 : shutdown is not finished - * -1 : an error catch - */ -int SSL_shutdown(SSL *ssl); - -/** - * @brief bind the socket file description into the SSL - * - * @param ssl - the SSL point - * @param fd - socket handle - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_set_fd(SSL *ssl, int fd); - -/** - * @brief Set the hostname for SNI - * - * @param ssl - the SSL context point - * @param hostname - pointer to the hostname - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_set_tlsext_host_name(SSL* ssl, const char *hostname); - -/** - * @brief These functions load the private key into the SSL_CTX or SSL object - * - * @param ctx - the SSL context point - * @param pkey - private key object point - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey); - -/** - * @brief These functions load the certification into the SSL_CTX or SSL object - * - * @param ctx - the SSL context point - * @param pkey - certification object point - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x); - -/** - * @brief create the target SSL context client method - * - * @param none - * - * @return the SSLV2.3 version SSL context client method - */ -const SSL_METHOD* SSLv23_client_method(void); - -/** - * @brief create the target SSL context client method - * - * @param none - * - * @return the TLSV1.0 version SSL context client method - */ -const SSL_METHOD* TLSv1_client_method(void); - -/** - * @brief create the target SSL context client method - * - * @param none - * - * @return the SSLV1.0 version SSL context client method - */ -const SSL_METHOD* SSLv3_client_method(void); - -/** - * @brief create the target SSL context client method - * - * @param none - * - * @return the TLSV1.1 version SSL context client method - */ -const SSL_METHOD* TLSv1_1_client_method(void); - -/** - * @brief create the target SSL context client method - * - * @param none - * - * @return the TLSV1.2 version SSL context client method - */ -const SSL_METHOD* TLSv1_2_client_method(void); - -/** - * @brief create the target SSL context server method - * - * @param none - * - * @return the TLS any version SSL context client method - */ -const SSL_METHOD* TLS_client_method(void); - -/** - * @brief create the target SSL context server method - * - * @param none - * - * @return the SSLV2.3 version SSL context server method - */ -const SSL_METHOD* SSLv23_server_method(void); - -/** - * @brief create the target SSL context server method - * - * @param none - * - * @return the TLSV1.1 version SSL context server method - */ -const SSL_METHOD* TLSv1_1_server_method(void); - -/** - * @brief create the target SSL context server method - * - * @param none - * - * @return the TLSV1.2 version SSL context server method - */ -const SSL_METHOD* TLSv1_2_server_method(void); - -/** - * @brief create the target SSL context server method - * - * @param none - * - * @return the TLSV1.0 version SSL context server method - */ -const SSL_METHOD* TLSv1_server_method(void); - -/** - * @brief create the target SSL context server method - * - * @param none - * - * @return the SSLV3.0 version SSL context server method - */ -const SSL_METHOD* SSLv3_server_method(void); - -/** - * @brief create the target SSL context server method - * - * @param none - * - * @return the TLS any version SSL context server method - */ -const SSL_METHOD* TLS_server_method(void); - - -/** - * @brief set the SSL context ALPN select callback function - * - * @param ctx - SSL context point - * @param cb - ALPN select callback function - * @param arg - ALPN select callback function entry private data point - * - * @return none - */ -void SSL_CTX_set_alpn_select_cb(SSL_CTX *ctx, - int (*cb) (SSL *ssl, - const unsigned char **out, - unsigned char *outlen, - const unsigned char *in, - unsigned int inlen, - void *arg), - void *arg); - - -/** - * @brief set the SSL context ALPN select protocol - * - * @param ctx - SSL context point - * @param protos - ALPN protocol name - * @param protos_len - ALPN protocol name bytes - * - * @return result - * 0 : OK - * 1 : failed - */ -int SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const unsigned char *protos, unsigned int protos_len); - -/** - * @brief set the SSL context next ALPN select callback function - * - * @param ctx - SSL context point - * @param cb - ALPN select callback function - * @param arg - ALPN select callback function entry private data point - * - * @return none - */ -void SSL_CTX_set_next_proto_select_cb(SSL_CTX *ctx, - int (*cb) (SSL *ssl, - unsigned char **out, - unsigned char *outlen, - const unsigned char *in, - unsigned int inlen, - void *arg), - void *arg); - -/** - * @brief get SSL error code - * - * @param ssl - SSL point - * @param ret_code - SSL return code - * - * @return SSL error number - */ -int SSL_get_error(const SSL *ssl, int ret_code); - -/** - * @brief clear the SSL error code - * - * @param none - * - * @return none - */ -void ERR_clear_error(void); - -/** - * @brief get the current SSL error code - * - * @param none - * - * @return current SSL error number - */ -int ERR_get_error(void); - -/** - * @brief register the SSL error strings - * - * @param none - * - * @return none - */ -void ERR_load_SSL_strings(void); - -/** - * @brief initialize the SSL library - * - * @param none - * - * @return none - */ -void SSL_library_init(void); - -/** - * @brief generates a human-readable string representing the error code e - * and store it into the "ret" point memory - * - * @param e - error code - * @param ret - memory point to store the string - * - * @return the result string point - */ -char *ERR_error_string(unsigned long e, char *ret); - -/** - * @brief add the SSL context option - * - * @param ctx - SSL context point - * @param opt - new SSL context option - * - * @return the SSL context option - */ -unsigned long SSL_CTX_set_options(SSL_CTX *ctx, unsigned long opt); - -/** - * @brief add the SSL context mode - * - * @param ctx - SSL context point - * @param mod - new SSL context mod - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_set_mode(SSL_CTX *ctx, int mod); - -/* -} -*/ - -/** - * @brief perform the SSL handshake - * - * @param ssl - SSL point - * - * @return result - * 1 : OK - * 0 : failed - * -1 : a error catch - */ -int SSL_do_handshake(SSL *ssl); - -/** - * @brief get the SSL current version - * - * @param ssl - SSL point - * - * @return the version string - */ -const char *SSL_get_version(const SSL *ssl); - -/** - * @brief set the SSL context version - * - * @param ctx - SSL context point - * @param meth - SSL method point - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_set_ssl_version(SSL_CTX *ctx, const SSL_METHOD *meth); - -/** - * @brief get the bytes numbers which are to be read - * - * @param ssl - SSL point - * - * @return bytes number - */ -int SSL_pending(const SSL *ssl); - -/** - * @brief check if SSL want nothing - * - * @param ssl - SSL point - * - * @return result - * 0 : false - * 1 : true - */ -int SSL_want_nothing(const SSL *ssl); - -/** - * @brief check if SSL want to read - * - * @param ssl - SSL point - * - * @return result - * 0 : false - * 1 : true - */ -int SSL_want_read(const SSL *ssl); - -/** - * @brief check if SSL want to write - * - * @param ssl - SSL point - * - * @return result - * 0 : false - * 1 : true - */ -int SSL_want_write(const SSL *ssl); - -/** - * @brief get the SSL context current method - * - * @param ctx - SSL context point - * - * @return the SSL context current method - */ -const SSL_METHOD *SSL_CTX_get_ssl_method(SSL_CTX *ctx); - -/** - * @brief get the SSL current method - * - * @param ssl - SSL point - * - * @return the SSL current method - */ -const SSL_METHOD *SSL_get_ssl_method(SSL *ssl); - -/** - * @brief set the SSL method - * - * @param ssl - SSL point - * @param meth - SSL method point - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_set_ssl_method(SSL *ssl, const SSL_METHOD *method); - -/** - * @brief add CA client certification into the SSL - * - * @param ssl - SSL point - * @param x - CA certification point - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_add_client_CA(SSL *ssl, X509 *x); - -/** - * @brief add CA client certification into the SSL context - * - * @param ctx - SSL context point - * @param x - CA certification point - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *x); - -/** - * @brief set the SSL CA certification list - * - * @param ssl - SSL point - * @param name_list - CA certification list - * - * @return none - */ -void SSL_set_client_CA_list(SSL *ssl, STACK_OF(X509_NAME) *name_list); - -/** - * @brief set the SSL context CA certification list - * - * @param ctx - SSL context point - * @param name_list - CA certification list - * - * @return none - */ -void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *name_list); - -/** - * @briefget the SSL CA certification list - * - * @param ssl - SSL point - * - * @return CA certification list - */ -STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *ssl); - -/** - * @brief get the SSL context CA certification list - * - * @param ctx - SSL context point - * - * @return CA certification list - */ -STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(const SSL_CTX *ctx); - -/** - * @brief get the SSL certification point - * - * @param ssl - SSL point - * - * @return SSL certification point - */ -X509 *SSL_get_certificate(const SSL *ssl); - -/** - * @brief get the SSL private key point - * - * @param ssl - SSL point - * - * @return SSL private key point - */ -EVP_PKEY *SSL_get_privatekey(const SSL *ssl); - -/** - * @brief set the SSL information callback function - * - * @param ssl - SSL point - * @param cb - information callback function - * - * @return none - */ -void SSL_set_info_callback(SSL *ssl, void (*cb) (const SSL *ssl, int type, int val)); - -/** - * @brief get the SSL state - * - * @param ssl - SSL point - * - * @return SSL state - */ -OSSL_HANDSHAKE_STATE SSL_get_state(const SSL *ssl); - -/** - * @brief set the SSL context read buffer length - * - * @param ctx - SSL context point - * @param len - read buffer length - * - * @return none - */ -void SSL_CTX_set_default_read_buffer_len(SSL_CTX *ctx, size_t len); - -/** - * @brief set the SSL read buffer length - * - * @param ssl - SSL point - * @param len - read buffer length - * - * @return none - */ -void SSL_set_default_read_buffer_len(SSL *ssl, size_t len); - -/** - * @brief set the SSL security level - * - * @param ssl - SSL point - * @param level - security level - * - * @return none - */ -void SSL_set_security_level(SSL *ssl, int level); - -/** - * @brief get the SSL security level - * - * @param ssl - SSL point - * - * @return security level - */ -int SSL_get_security_level(const SSL *ssl); - -/** - * @brief get the SSL verifying mode of the SSL context - * - * @param ctx - SSL context point - * - * @return verifying mode - */ -int SSL_CTX_get_verify_mode(const SSL_CTX *ctx); - -/** - * @brief get the SSL verifying depth of the SSL context - * - * @param ctx - SSL context point - * - * @return verifying depth - */ -int SSL_CTX_get_verify_depth(const SSL_CTX *ctx); - -/** - * @brief set the SSL context verifying of the SSL context - * - * @param ctx - SSL context point - * @param mode - verifying mode - * @param verify_callback - verifying callback function - * - * @return none - */ -void SSL_CTX_set_verify(SSL_CTX *ctx, int mode, int (*verify_callback)(int, X509_STORE_CTX *)); - -/** - * @brief set the SSL verifying of the SSL context - * - * @param ctx - SSL point - * @param mode - verifying mode - * @param verify_callback - verifying callback function - * - * @return none - */ -void SSL_set_verify(SSL *s, int mode, int (*verify_callback)(int, X509_STORE_CTX *)); - -/** - * @brief set the SSL verify depth of the SSL context - * - * @param ctx - SSL context point - * @param depth - verifying depth - * - * @return none - */ -void SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth); - -/** - * @brief certification verifying callback function - * - * @param preverify_ok - verifying result - * @param x509_ctx - X509 certification point - * - * @return verifying result - */ -int verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx); - -/** - * @brief set the session timeout time - * - * @param ctx - SSL context point - * @param t - new session timeout time - * - * @return old session timeout time - */ -long SSL_CTX_set_timeout(SSL_CTX *ctx, long t); - -/** - * @brief get the session timeout time - * - * @param ctx - SSL context point - * - * @return current session timeout time - */ -long SSL_CTX_get_timeout(const SSL_CTX *ctx); - -/** - * @brief set the SSL context cipher through the list string - * - * @param ctx - SSL context point - * @param str - cipher controller list string - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str); - -/** - * @brief set the SSL cipher through the list string - * - * @param ssl - SSL point - * @param str - cipher controller list string - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_set_cipher_list(SSL *ssl, const char *str); - -/** - * @brief get the SSL cipher list string - * - * @param ssl - SSL point - * - * @return cipher controller list string - */ -const char *SSL_get_cipher_list(const SSL *ssl, int n); - -/** - * @brief get the SSL cipher - * - * @param ssl - SSL point - * - * @return current cipher - */ -const SSL_CIPHER *SSL_get_current_cipher(const SSL *ssl); - -/** - * @brief get the SSL cipher string - * - * @param ssl - SSL point - * - * @return cipher string - */ -const char *SSL_get_cipher(const SSL *ssl); - -/** - * @brief get the SSL context object X509 certification storage - * - * @param ctx - SSL context point - * - * @return x509 certification storage - */ -X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *ctx); - -/** - * @brief set the SSL context object X509 certification store - * - * @param ctx - SSL context point - * @param store - X509 certification store - * - * @return none - */ -void SSL_CTX_set_cert_store(SSL_CTX *ctx, X509_STORE *store); - -/** - * @brief get the SSL specifical statement - * - * @param ssl - SSL point - * - * @return specifical statement - */ -int SSL_want(const SSL *ssl); - -/** - * @brief check if the SSL is SSL_X509_LOOKUP state - * - * @param ssl - SSL point - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_want_x509_lookup(const SSL *ssl); - -/** - * @brief reset the SSL - * - * @param ssl - SSL point - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_clear(SSL *ssl); - -/** - * @brief get the socket handle of the SSL - * - * @param ssl - SSL point - * - * @return result - * >= 0 : yes, and return socket handle - * < 0 : a error catch - */ -int SSL_get_fd(const SSL *ssl); - -/** - * @brief get the read only socket handle of the SSL - * - * @param ssl - SSL point - * - * @return result - * >= 0 : yes, and return socket handle - * < 0 : a error catch - */ -int SSL_get_rfd(const SSL *ssl); - -/** - * @brief get the write only socket handle of the SSL - * - * @param ssl - SSL point - * - * @return result - * >= 0 : yes, and return socket handle - * < 0 : a error catch - */ -int SSL_get_wfd(const SSL *ssl); - -/** - * @brief set the SSL if we can read as many as data - * - * @param ssl - SSL point - * @param yes - enable the function - * - * @return none - */ -void SSL_set_read_ahead(SSL *s, int yes); - -/** - * @brief set the SSL context if we can read as many as data - * - * @param ctx - SSL context point - * @param yes - enbale the function - * - * @return none - */ -void SSL_CTX_set_read_ahead(SSL_CTX *ctx, int yes); - -/** - * @brief get the SSL ahead signal if we can read as many as data - * - * @param ssl - SSL point - * - * @return SSL context ahead signal - */ -int SSL_get_read_ahead(const SSL *ssl); - -/** - * @brief get the SSL context ahead signal if we can read as many as data - * - * @param ctx - SSL context point - * - * @return SSL context ahead signal - */ -long SSL_CTX_get_read_ahead(SSL_CTX *ctx); - -/** - * @brief check if some data can be read - * - * @param ssl - SSL point - * - * @return - * 1 : there are bytes to be read - * 0 : no data - */ -int SSL_has_pending(const SSL *ssl); - -/** - * @brief load the X509 certification into SSL context - * - * @param ctx - SSL context point - * @param x - X509 certification point - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x);//loads the certificate x into ctx - -/** - * @brief load the ASN1 certification into SSL context - * - * @param ctx - SSL context point - * @param len - certification length - * @param d - data point - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, int len, const unsigned char *d); - -/** - * @brief load the certification file into SSL context - * - * @param ctx - SSL context point - * @param file - certification file name - * @param type - certification encoding type - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, int type); - -/** - * @brief load the certification chain file into SSL context - * - * @param ctx - SSL context point - * @param file - certification chain file name - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file); - - -/** - * @brief load the ASN1 private key into SSL context - * - * @param ctx - SSL context point - * @param d - data point - * @param len - private key length - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_use_PrivateKey_ASN1(int pk, SSL_CTX *ctx, const unsigned char *d, long len);//adds the private key of type pk stored at memory location d (length len) to ctx - -/** - * @brief load the private key file into SSL context - * - * @param ctx - SSL context point - * @param file - private key file name - * @param type - private key encoding type - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, int type); - -/** - * @brief load the RSA private key into SSL context - * - * @param ctx - SSL context point - * @param x - RSA private key point - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa); - -/** - * @brief load the RSA ASN1 private key into SSL context - * - * @param ctx - SSL context point - * @param d - data point - * @param len - RSA private key length - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, const unsigned char *d, long len); - -/** - * @brief load the RSA private key file into SSL context - * - * @param ctx - SSL context point - * @param file - RSA private key file name - * @param type - private key encoding type - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, const char *file, int type); - - -/** - * @brief check if the private key and certification is matched - * - * @param ctx - SSL context point - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_check_private_key(const SSL_CTX *ctx); - -/** - * @brief set the SSL context server information - * - * @param ctx - SSL context point - * @param serverinfo - server information string - * @param serverinfo_length - server information length - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_use_serverinfo(SSL_CTX *ctx, const unsigned char *serverinfo, size_t serverinfo_length); - -/** - * @brief load the SSL context server infomation file into SSL context - * - * @param ctx - SSL context point - * @param file - server information file - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_use_serverinfo_file(SSL_CTX *ctx, const char *file); - -/** - * @brief SSL select next function - * - * @param out - point of output data point - * @param outlen - output data length - * @param in - input data - * @param inlen - input data length - * @param client - client data point - * @param client_len -client data length - * - * @return NPN state - * OPENSSL_NPN_UNSUPPORTED : not support - * OPENSSL_NPN_NEGOTIATED : negotiated - * OPENSSL_NPN_NO_OVERLAP : no overlap - */ -int SSL_select_next_proto(unsigned char **out, unsigned char *outlen, - const unsigned char *in, unsigned int inlen, - const unsigned char *client, unsigned int client_len); - -/** - * @brief load the extra certification chain into the SSL context - * - * @param ctx - SSL context point - * @param x509 - X509 certification - * - * @return result - * 1 : OK - * 0 : failed - */ -long SSL_CTX_add_extra_chain_cert(SSL_CTX *ctx, X509 *); - -/** - * @brief control the SSL context - * - * @param ctx - SSL context point - * @param cmd - command - * @param larg - parameter length - * @param parg - parameter point - * - * @return result - * 1 : OK - * 0 : failed - */ -long SSL_CTX_ctrl(SSL_CTX *ctx, int cmd, long larg, char *parg); - -/** - * @brief get the SSL context cipher - * - * @param ctx - SSL context point - * - * @return SSL context cipher - */ -STACK *SSL_CTX_get_ciphers(const SSL_CTX *ctx); - -/** - * @brief check if the SSL context can read as many as data - * - * @param ctx - SSL context point - * - * @return result - * 1 : OK - * 0 : failed - */ -long SSL_CTX_get_default_read_ahead(SSL_CTX *ctx); - -/** - * @brief get the SSL context extra data - * - * @param ctx - SSL context point - * @param idx - index - * - * @return data point - */ -char *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx); - -/** - * @brief get the SSL context quiet shutdown option - * - * @param ctx - SSL context point - * - * @return quiet shutdown option - */ -int SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx); - -/** - * @brief load the SSL context CA file - * - * @param ctx - SSL context point - * @param CAfile - CA certification file - * @param CApath - CA certification file path - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile, const char *CApath); - -/** - * @brief add SSL context reference count by '1' - * - * @param ctx - SSL context point - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_up_ref(SSL_CTX *ctx); - -/** - * @brief set SSL context application private data - * - * @param ctx - SSL context point - * @param arg - private data - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_set_app_data(SSL_CTX *ctx, void *arg); - -/** - * @brief set SSL context client certification callback function - * - * @param ctx - SSL context point - * @param cb - callback function - * - * @return none - */ -void SSL_CTX_set_client_cert_cb(SSL_CTX *ctx, int (*cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey)); - -/** - * @brief set the SSL context if we can read as many as data - * - * @param ctx - SSL context point - * @param m - enable the fuction - * - * @return none - */ -void SSL_CTX_set_default_read_ahead(SSL_CTX *ctx, int m); - -/** - * @brief set SSL context default verifying path - * - * @param ctx - SSL context point - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx); - -/** - * @brief set SSL context default verifying directory - * - * @param ctx - SSL context point - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_set_default_verify_dir(SSL_CTX *ctx); - -/** - * @brief set SSL context default verifying file - * - * @param ctx - SSL context point - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_set_default_verify_file(SSL_CTX *ctx); - -/** - * @brief set SSL context extra data - * - * @param ctx - SSL context point - * @param idx - data index - * @param arg - data point - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_set_ex_data(SSL_CTX *s, int idx, char *arg); - -/** - * @brief clear the SSL context option bit of "op" - * - * @param ctx - SSL context point - * @param op - option - * - * @return SSL context option - */ -unsigned long SSL_CTX_clear_options(SSL_CTX *ctx, unsigned long op); - -/** - * @brief get the SSL context option - * - * @param ctx - SSL context point - * @param op - option - * - * @return SSL context option - */ -unsigned long SSL_CTX_get_options(SSL_CTX *ctx); - -/** - * @brief set the SSL context quiet shutdown mode - * - * @param ctx - SSL context point - * @param mode - mode - * - * @return none - */ -void SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx, int mode); - -/** - * @brief get the SSL context X509 certification - * - * @param ctx - SSL context point - * - * @return X509 certification - */ -X509 *SSL_CTX_get0_certificate(const SSL_CTX *ctx); - -/** - * @brief get the SSL context private key - * - * @param ctx - SSL context point - * - * @return private key - */ -EVP_PKEY *SSL_CTX_get0_privatekey(const SSL_CTX *ctx); - -/** - * @brief set SSL context PSK identity hint - * - * @param ctx - SSL context point - * @param hint - PSK identity hint - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_CTX_use_psk_identity_hint(SSL_CTX *ctx, const char *hint); - -/** - * @brief set SSL context PSK server callback function - * - * @param ctx - SSL context point - * @param callback - callback function - * - * @return none - */ -void SSL_CTX_set_psk_server_callback(SSL_CTX *ctx, - unsigned int (*callback)(SSL *ssl, - const char *identity, - unsigned char *psk, - int max_psk_len)); -/** - * @brief get alert description string - * - * @param value - alert value - * - * @return alert description string - */ -const char *SSL_alert_desc_string(int value); - -/** - * @brief get alert description long string - * - * @param value - alert value - * - * @return alert description long string - */ -const char *SSL_alert_desc_string_long(int value); - -/** - * @brief get alert type string - * - * @param value - alert value - * - * @return alert type string - */ -const char *SSL_alert_type_string(int value); - -/** - * @brief get alert type long string - * - * @param value - alert value - * - * @return alert type long string - */ -const char *SSL_alert_type_string_long(int value); - -/** - * @brief get SSL context of the SSL - * - * @param ssl - SSL point - * - * @return SSL context - */ -SSL_CTX *SSL_get_SSL_CTX(const SSL *ssl); - -/** - * @brief get SSL application data - * - * @param ssl - SSL point - * - * @return application data - */ -char *SSL_get_app_data(SSL *ssl); - -/** - * @brief get SSL cipher bits - * - * @param ssl - SSL point - * @param alg_bits - algorithm bits - * - * @return strength bits - */ -int SSL_get_cipher_bits(const SSL *ssl, int *alg_bits); - -/** - * @brief get SSL cipher name - * - * @param ssl - SSL point - * - * @return SSL cipher name - */ -char *SSL_get_cipher_name(const SSL *ssl); - -/** - * @brief get SSL cipher version - * - * @param ssl - SSL point - * - * @return SSL cipher version - */ -char *SSL_get_cipher_version(const SSL *ssl); - -/** - * @brief get SSL extra data - * - * @param ssl - SSL point - * @param idx - data index - * - * @return extra data - */ -char *SSL_get_ex_data(const SSL *ssl, int idx); - -/** - * @brief get index of the SSL extra data X509 storage context - * - * @param none - * - * @return data index - */ -int SSL_get_ex_data_X509_STORE_CTX_idx(void); - -/** - * @brief get peer certification chain - * - * @param ssl - SSL point - * - * @return certification chain - */ -STACK *SSL_get_peer_cert_chain(const SSL *ssl); - -/** - * @brief get peer certification - * - * @param ssl - SSL point - * - * @return certification - */ -X509 *SSL_get_peer_certificate(const SSL *ssl); - -/** - * @brief get SSL quiet shutdown mode - * - * @param ssl - SSL point - * - * @return quiet shutdown mode - */ -int SSL_get_quiet_shutdown(const SSL *ssl); - -/** - * @brief get SSL read only IO handle - * - * @param ssl - SSL point - * - * @return IO handle - */ -BIO *SSL_get_rbio(const SSL *ssl); - -/** - * @brief get SSL shared ciphers - * - * @param ssl - SSL point - * @param buf - buffer to store the ciphers - * @param len - buffer len - * - * @return shared ciphers - */ -char *SSL_get_shared_ciphers(const SSL *ssl, char *buf, int len); - -/** - * @brief get SSL shutdown mode - * - * @param ssl - SSL point - * - * @return shutdown mode - */ -int SSL_get_shutdown(const SSL *ssl); - -/** - * @brief get SSL session time - * - * @param ssl - SSL point - * - * @return session time - */ -long SSL_get_time(const SSL *ssl); - -/** - * @brief get SSL session timeout time - * - * @param ssl - SSL point - * - * @return session timeout time - */ -long SSL_get_timeout(const SSL *ssl); - -/** - * @brief get SSL verifying mode - * - * @param ssl - SSL point - * - * @return verifying mode - */ -int SSL_get_verify_mode(const SSL *ssl); - -/** - * @brief get SSL verify parameters - * - * @param ssl - SSL point - * - * @return verify parameters - */ -X509_VERIFY_PARAM *SSL_get0_param(SSL *ssl); - -/** - * @brief set expected hostname the peer cert CN should have - * - * @param param - verify parameters from SSL_get0_param() - * - * @param name - the expected hostname - * - * @param namelen - the length of the hostname, or 0 if NUL terminated - * - * @return verify parameters - */ -int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param, - const char *name, size_t namelen); - -/** - * @brief set parameters for X509 host verify action - * - * @param param -verify parameters from SSL_get0_param() - * - * @param flags - bitfield of X509_CHECK_FLAG_... parameters to set - * - * @return 1 for success, 0 for failure - */ -int X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param, - unsigned long flags); - -/** - * @brief clear parameters for X509 host verify action - * - * @param param -verify parameters from SSL_get0_param() - * - * @param flags - bitfield of X509_CHECK_FLAG_... parameters to clear - * - * @return 1 for success, 0 for failure - */ -int X509_VERIFY_PARAM_clear_hostflags(X509_VERIFY_PARAM *param, - unsigned long flags); - -/** - * @brief get SSL write only IO handle - * - * @param ssl - SSL point - * - * @return IO handle - */ -BIO *SSL_get_wbio(const SSL *ssl); - -/** - * @brief load SSL client CA certification file - * - * @param file - file name - * - * @return certification loading object - */ -STACK *SSL_load_client_CA_file(const char *file); - -/** - * @brief add SSL reference by '1' - * - * @param ssl - SSL point - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_up_ref(SSL *ssl); - -/** - * @brief read and put data into buf, but not clear the SSL low-level storage - * - * @param ssl - SSL point - * @param buf - storage buffer point - * @param num - data bytes - * - * @return result - * > 0 : OK, and return read bytes - * = 0 : connect is closed - * < 0 : a error catch - */ -int SSL_peek(SSL *ssl, void *buf, int num); - -/** - * @brief make SSL renegotiate - * - * @param ssl - SSL point - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_renegotiate(SSL *ssl); - -/** - * @brief get the state string where SSL is reading - * - * @param ssl - SSL point - * - * @return state string - */ -const char *SSL_rstate_string(SSL *ssl); - -/** - * @brief get the statement long string where SSL is reading - * - * @param ssl - SSL point - * - * @return statement long string - */ -const char *SSL_rstate_string_long(SSL *ssl); - -/** - * @brief set SSL accept statement - * - * @param ssl - SSL point - * - * @return none - */ -void SSL_set_accept_state(SSL *ssl); - -/** - * @brief set SSL application data - * - * @param ssl - SSL point - * @param arg - SSL application data point - * - * @return none - */ -void SSL_set_app_data(SSL *ssl, char *arg); - -/** - * @brief set SSL BIO - * - * @param ssl - SSL point - * @param rbio - read only IO - * @param wbio - write only IO - * - * @return none - */ -void SSL_set_bio(SSL *ssl, BIO *rbio, BIO *wbio); - -/** - * @brief clear SSL option - * - * @param ssl - SSL point - * @param op - clear option - * - * @return SSL option - */ -unsigned long SSL_clear_options(SSL *ssl, unsigned long op); - -/** - * @brief get SSL option - * - * @param ssl - SSL point - * - * @return SSL option - */ -unsigned long SSL_get_options(SSL *ssl); - -/** - * @brief clear SSL option - * - * @param ssl - SSL point - * @param op - setting option - * - * @return SSL option - */ -unsigned long SSL_set_options(SSL *ssl, unsigned long op); - -/** - * @brief set SSL quiet shutdown mode - * - * @param ssl - SSL point - * @param mode - quiet shutdown mode - * - * @return none - */ -void SSL_set_quiet_shutdown(SSL *ssl, int mode); - -/** - * @brief set SSL shutdown mode - * - * @param ssl - SSL point - * @param mode - shutdown mode - * - * @return none - */ -void SSL_set_shutdown(SSL *ssl, int mode); - -/** - * @brief set SSL session time - * - * @param ssl - SSL point - * @param t - session time - * - * @return session time - */ -void SSL_set_time(SSL *ssl, long t); - -/** - * @brief set SSL session timeout time - * - * @param ssl - SSL point - * @param t - session timeout time - * - * @return session timeout time - */ -void SSL_set_timeout(SSL *ssl, long t); - -/** - * @brief get SSL statement string - * - * @param ssl - SSL point - * - * @return SSL statement string - */ -char *SSL_state_string(const SSL *ssl); - -/** - * @brief get SSL statement long string - * - * @param ssl - SSL point - * - * @return SSL statement long string - */ -char *SSL_state_string_long(const SSL *ssl); - -/** - * @brief get SSL renegotiation count - * - * @param ssl - SSL point - * - * @return renegotiation count - */ -long SSL_total_renegotiations(SSL *ssl); - -/** - * @brief get SSL version - * - * @param ssl - SSL point - * - * @return SSL version - */ -int SSL_version(const SSL *ssl); - -/** - * @brief set SSL PSK identity hint - * - * @param ssl - SSL point - * @param hint - identity hint - * - * @return result - * 1 : OK - * 0 : failed - */ -int SSL_use_psk_identity_hint(SSL *ssl, const char *hint); - -/** - * @brief get SSL PSK identity hint - * - * @param ssl - SSL point - * - * @return identity hint - */ -const char *SSL_get_psk_identity_hint(SSL *ssl); - -/** - * @brief get SSL PSK identity - * - * @param ssl - SSL point - * - * @return identity - */ -const char *SSL_get_psk_identity(SSL *ssl); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/openssl/platform/ssl_opt.h b/tools/sdk/include/openssl/platform/ssl_opt.h deleted file mode 100644 index a9c55e8c469..00000000000 --- a/tools/sdk/include/openssl/platform/ssl_opt.h +++ /dev/null @@ -1,20 +0,0 @@ -// 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. - -#ifndef _SSL_OPT_H_ -#define _SSL_OPT_H_ - -#include "sdkconfig.h" - -#endif diff --git a/tools/sdk/include/openssl/platform/ssl_pm.h b/tools/sdk/include/openssl/platform/ssl_pm.h deleted file mode 100644 index f028a0cee88..00000000000 --- a/tools/sdk/include/openssl/platform/ssl_pm.h +++ /dev/null @@ -1,63 +0,0 @@ -// 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. - -#ifndef _SSL_PM_H_ -#define _SSL_PM_H_ - -#ifdef __cplusplus - extern "C" { -#endif - -#include -#include "ssl_types.h" -#include "ssl_port.h" - -#define LOCAL_ATRR - -int ssl_pm_new(SSL *ssl); -void ssl_pm_free(SSL *ssl); - -int ssl_pm_handshake(SSL *ssl); -int ssl_pm_shutdown(SSL *ssl); -int ssl_pm_clear(SSL *ssl); - -int ssl_pm_read(SSL *ssl, void *buffer, int len); -int ssl_pm_send(SSL *ssl, const void *buffer, int len); -int ssl_pm_pending(const SSL *ssl); - -void ssl_pm_set_fd(SSL *ssl, int fd, int mode); -int ssl_pm_get_fd(const SSL *ssl, int mode); - -void ssl_pm_set_hostname(SSL *ssl, const char *hostname); - -OSSL_HANDSHAKE_STATE ssl_pm_get_state(const SSL *ssl); - -void ssl_pm_set_bufflen(SSL *ssl, int len); - -int x509_pm_show_info(X509 *x); -int x509_pm_new(X509 *x, X509 *m_x); -void x509_pm_free(X509 *x); -int x509_pm_load(X509 *x, const unsigned char *buffer, int len); - -int pkey_pm_new(EVP_PKEY *pk, EVP_PKEY *m_pk); -void pkey_pm_free(EVP_PKEY *pk); -int pkey_pm_load(EVP_PKEY *pk, const unsigned char *buffer, int len); - -long ssl_pm_get_verify_result(const SSL *ssl); - -#ifdef __cplusplus - } -#endif - -#endif diff --git a/tools/sdk/include/openssl/platform/ssl_port.h b/tools/sdk/include/openssl/platform/ssl_port.h deleted file mode 100644 index 492ea405b2e..00000000000 --- a/tools/sdk/include/openssl/platform/ssl_port.h +++ /dev/null @@ -1,45 +0,0 @@ -// 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. - -#ifndef _SSL_PORT_H_ -#define _SSL_PORT_H_ - -#ifdef __cplusplus - extern "C" { -#endif - -#include "esp_types.h" -#include "esp_log.h" -#include "string.h" -#include "malloc.h" - -void *ssl_mem_zalloc(size_t size); - -#define ssl_mem_malloc malloc -#define ssl_mem_free free - -#define ssl_memcpy memcpy -#define ssl_strlen strlen - -#define ssl_speed_up_enter() -#define ssl_speed_up_exit() - -#define SSL_DEBUG_FL -#define SSL_DEBUG_LOG(fmt, ...) ESP_LOGI("openssl", fmt, ##__VA_ARGS__) - -#ifdef __cplusplus - } -#endif - -#endif diff --git a/tools/sdk/include/protobuf-c/protobuf-c/protobuf-c.h b/tools/sdk/include/protobuf-c/protobuf-c/protobuf-c.h deleted file mode 100755 index c8fa4fc2a7c..00000000000 --- a/tools/sdk/include/protobuf-c/protobuf-c/protobuf-c.h +++ /dev/null @@ -1,1106 +0,0 @@ -/* - * Copyright (c) 2008-2017, Dave Benson and the protobuf-c authors. - * All rights reserved. - * - * 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. - * - * 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. - */ - -/*! \file - * \mainpage Introduction - * - * This is [protobuf-c], a C implementation of [Protocol Buffers]. - * - * This file defines the public API for the `libprotobuf-c` support library. - * This API includes interfaces that can be used directly by client code as well - * as the interfaces used by the code generated by the `protoc-c` compiler. - * - * The `libprotobuf-c` support library performs the actual serialization and - * deserialization of Protocol Buffers messages. It interacts with structures, - * definitions, and metadata generated by the `protoc-c` compiler from .proto - * files. - * - * \authors Dave Benson and the `protobuf-c` authors. - * - * \copyright 2008-2014. Licensed under the terms of the [BSD-2-Clause] license. - * - * [protobuf-c]: https://github.com/protobuf-c/protobuf-c - * [Protocol Buffers]: https://developers.google.com/protocol-buffers/ - * [BSD-2-Clause]: http://opensource.org/licenses/BSD-2-Clause - * - * \page gencode Generated Code - * - * For each enum, we generate a C enum. For each message, we generate a C - * structure which can be cast to a `ProtobufCMessage`. - * - * For each enum and message, we generate a descriptor object that allows us to - * implement a kind of reflection on the structures. - * - * First, some naming conventions: - * - * - The name of the type for enums and messages and services is camel case - * (meaning WordsAreCrammedTogether) except that double underscores are used - * to delimit scopes. For example, the following `.proto` file: - * -~~~{.proto} - package foo.bar; - message BazBah { - optional int32 val = 1; - } -~~~ - * - * would generate a C type `Foo__Bar__BazBah`. - * - * - Identifiers for functions and globals are all lowercase, with camel case - * words separated by single underscores. For example, one of the function - * prototypes generated by `protoc-c` for the above example: - * -~~~{.c} -Foo__Bar__BazBah * - foo__bar__baz_bah__unpack - (ProtobufCAllocator *allocator, - size_t len, - const uint8_t *data); -~~~ - * - * - Identifiers for enum values contain an uppercase prefix which embeds the - * package name and the enum type name. - * - * - A double underscore is used to separate further components of identifier - * names. - * - * For example, in the name of the unpack function above, the package name - * `foo.bar` has become `foo__bar`, the message name BazBah has become - * `baz_bah`, and the method name is `unpack`. These are all joined with double - * underscores to form the C identifier `foo__bar__baz_bah__unpack`. - * - * We also generate descriptor objects for messages and enums. These are - * declared in the `.pb-c.h` files: - * -~~~{.c} -extern const ProtobufCMessageDescriptor foo__bar__baz_bah__descriptor; -~~~ - * - * The message structures all begin with `ProtobufCMessageDescriptor *` which is - * sufficient to allow them to be cast to `ProtobufCMessage`. - * - * For each message defined in a `.proto` file, we generate a number of - * functions and macros. Each function name contains a prefix based on the - * package name and message name in order to make it a unique C identifier. - * - * - `INIT`. Statically initializes a message object, initializing its - * descriptor and setting its fields to default values. Uninitialized - * messages cannot be processed by the protobuf-c library. - * -~~~{.c} -#define FOO__BAR__BAZ_BAH__INIT \ - { PROTOBUF_C_MESSAGE_INIT (&foo__bar__baz_bah__descriptor), 0 } -~~~ - * - `init()`. Initializes a message object, initializing its descriptor and - * setting its fields to default values. Uninitialized messages cannot be - * processed by the protobuf-c library. - * -~~~{.c} -void foo__bar__baz_bah__init - (Foo__Bar__BazBah *message); -~~~ - * - `unpack()`. Unpacks data for a particular message format. Note that the - * `allocator` parameter is usually `NULL` to indicate that the system's - * `malloc()` and `free()` functions should be used for dynamically allocating - * memory. - * -~~~{.c} -Foo__Bar__BazBah * - foo__bar__baz_bah__unpack - (ProtobufCAllocator *allocator, - size_t len, - const uint8_t *data); -~~~ - * - * - `free_unpacked()`. Frees a message object obtained with the `unpack()` - * method. Freeing `NULL` is allowed (the same as with `free()`). - * -~~~{.c} -void foo__bar__baz_bah__free_unpacked - (Foo__Bar__BazBah *message, - ProtobufCAllocator *allocator); -~~~ - * - * - `get_packed_size()`. Calculates the length in bytes of the serialized - * representation of the message object. - * -~~~{.c} -size_t foo__bar__baz_bah__get_packed_size - (const Foo__Bar__BazBah *message); -~~~ - * - * - `pack()`. Pack a message object into a preallocated buffer. Assumes that - * the buffer is large enough. (Use `get_packed_size()` first.) - * -~~~{.c} -size_t foo__bar__baz_bah__pack - (const Foo__Bar__BazBah *message, - uint8_t *out); -~~~ - * - * - `pack_to_buffer()`. Packs a message into a "virtual buffer". This is an - * object which defines an "append bytes" callback to consume data as it is - * serialized. - * -~~~{.c} -size_t foo__bar__baz_bah__pack_to_buffer - (const Foo__Bar__BazBah *message, - ProtobufCBuffer *buffer); -~~~ - * - * \page pack Packing and unpacking messages - * - * To pack a message, first compute the packed size of the message with - * protobuf_c_message_get_packed_size(), then allocate a buffer of at least - * that size, then call protobuf_c_message_pack(). - * - * Alternatively, a message can be serialized without calculating the final size - * first. Use the protobuf_c_message_pack_to_buffer() function and provide a - * ProtobufCBuffer object which implements an "append" method that consumes - * data. - * - * To unpack a message, call the protobuf_c_message_unpack() function. The - * result can be cast to an object of the type that matches the descriptor for - * the message. - * - * The result of unpacking a message should be freed with - * protobuf_c_message_free_unpacked(). - */ - -#ifndef PROTOBUF_C_H -#define PROTOBUF_C_H - -#include -#include -#include -#include - -#ifdef __cplusplus -# define PROTOBUF_C__BEGIN_DECLS extern "C" { -# define PROTOBUF_C__END_DECLS } -#else -# define PROTOBUF_C__BEGIN_DECLS -# define PROTOBUF_C__END_DECLS -#endif - -PROTOBUF_C__BEGIN_DECLS - -#if defined(_WIN32) && defined(PROTOBUF_C_USE_SHARED_LIB) -# ifdef PROTOBUF_C_EXPORT -# define PROTOBUF_C__API __declspec(dllexport) -# else -# define PROTOBUF_C__API __declspec(dllimport) -# endif -#else -# define PROTOBUF_C__API -#endif - -#if !defined(PROTOBUF_C__NO_DEPRECATED) && \ - ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) -# define PROTOBUF_C__DEPRECATED __attribute__((__deprecated__)) -#else -# define PROTOBUF_C__DEPRECATED -#endif - -#ifndef PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE - #define PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(enum_name) \ - , _##enum_name##_IS_INT_SIZE = INT_MAX -#endif - -#define PROTOBUF_C__SERVICE_DESCRIPTOR_MAGIC 0x14159bc3 -#define PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC 0x28aaeef9 -#define PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC 0x114315af - -/* Empty string used for initializers */ -extern const char protobuf_c_empty_string[]; - -/** - * \defgroup api Public API - * - * This is the public API for `libprotobuf-c`. These interfaces are stable and - * subject to Semantic Versioning guarantees. - * - * @{ - */ - -/** - * Values for the `flags` word in `ProtobufCFieldDescriptor`. - */ -typedef enum { - /** Set if the field is repeated and marked with the `packed` option. */ - PROTOBUF_C_FIELD_FLAG_PACKED = (1 << 0), - - /** Set if the field is marked with the `deprecated` option. */ - PROTOBUF_C_FIELD_FLAG_DEPRECATED = (1 << 1), - - /** Set if the field is a member of a oneof (union). */ - PROTOBUF_C_FIELD_FLAG_ONEOF = (1 << 2), -} ProtobufCFieldFlag; - -/** - * Message field rules. - * - * \see [Defining A Message Type] in the Protocol Buffers documentation. - * - * [Defining A Message Type]: - * https://developers.google.com/protocol-buffers/docs/proto#simple - */ -typedef enum { - /** A well-formed message must have exactly one of this field. */ - PROTOBUF_C_LABEL_REQUIRED, - - /** - * A well-formed message can have zero or one of this field (but not - * more than one). - */ - PROTOBUF_C_LABEL_OPTIONAL, - - /** - * This field can be repeated any number of times (including zero) in a - * well-formed message. The order of the repeated values will be - * preserved. - */ - PROTOBUF_C_LABEL_REPEATED, - - /** - * This field has no label. This is valid only in proto3 and is - * equivalent to OPTIONAL but no "has" quantifier will be consulted. - */ - PROTOBUF_C_LABEL_NONE, -} ProtobufCLabel; - -/** - * Field value types. - * - * \see [Scalar Value Types] in the Protocol Buffers documentation. - * - * [Scalar Value Types]: - * https://developers.google.com/protocol-buffers/docs/proto#scalar - */ -typedef enum { - PROTOBUF_C_TYPE_INT32, /**< int32 */ - PROTOBUF_C_TYPE_SINT32, /**< signed int32 */ - PROTOBUF_C_TYPE_SFIXED32, /**< signed int32 (4 bytes) */ - PROTOBUF_C_TYPE_INT64, /**< int64 */ - PROTOBUF_C_TYPE_SINT64, /**< signed int64 */ - PROTOBUF_C_TYPE_SFIXED64, /**< signed int64 (8 bytes) */ - PROTOBUF_C_TYPE_UINT32, /**< unsigned int32 */ - PROTOBUF_C_TYPE_FIXED32, /**< unsigned int32 (4 bytes) */ - PROTOBUF_C_TYPE_UINT64, /**< unsigned int64 */ - PROTOBUF_C_TYPE_FIXED64, /**< unsigned int64 (8 bytes) */ - PROTOBUF_C_TYPE_FLOAT, /**< float */ - PROTOBUF_C_TYPE_DOUBLE, /**< double */ - PROTOBUF_C_TYPE_BOOL, /**< boolean */ - PROTOBUF_C_TYPE_ENUM, /**< enumerated type */ - PROTOBUF_C_TYPE_STRING, /**< UTF-8 or ASCII string */ - PROTOBUF_C_TYPE_BYTES, /**< arbitrary byte sequence */ - PROTOBUF_C_TYPE_MESSAGE, /**< nested message */ -} ProtobufCType; - -/** - * Field wire types. - * - * \see [Message Structure] in the Protocol Buffers documentation. - * - * [Message Structure]: - * https://developers.google.com/protocol-buffers/docs/encoding#structure - */ -typedef enum { - PROTOBUF_C_WIRE_TYPE_VARINT = 0, - PROTOBUF_C_WIRE_TYPE_64BIT = 1, - PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED = 2, - /* "Start group" and "end group" wire types are unsupported. */ - PROTOBUF_C_WIRE_TYPE_32BIT = 5, -} ProtobufCWireType; - -struct ProtobufCAllocator; -struct ProtobufCBinaryData; -struct ProtobufCBuffer; -struct ProtobufCBufferSimple; -struct ProtobufCEnumDescriptor; -struct ProtobufCEnumValue; -struct ProtobufCEnumValueIndex; -struct ProtobufCFieldDescriptor; -struct ProtobufCIntRange; -struct ProtobufCMessage; -struct ProtobufCMessageDescriptor; -struct ProtobufCMessageUnknownField; -struct ProtobufCMethodDescriptor; -struct ProtobufCService; -struct ProtobufCServiceDescriptor; - -typedef struct ProtobufCAllocator ProtobufCAllocator; -typedef struct ProtobufCBinaryData ProtobufCBinaryData; -typedef struct ProtobufCBuffer ProtobufCBuffer; -typedef struct ProtobufCBufferSimple ProtobufCBufferSimple; -typedef struct ProtobufCEnumDescriptor ProtobufCEnumDescriptor; -typedef struct ProtobufCEnumValue ProtobufCEnumValue; -typedef struct ProtobufCEnumValueIndex ProtobufCEnumValueIndex; -typedef struct ProtobufCFieldDescriptor ProtobufCFieldDescriptor; -typedef struct ProtobufCIntRange ProtobufCIntRange; -typedef struct ProtobufCMessage ProtobufCMessage; -typedef struct ProtobufCMessageDescriptor ProtobufCMessageDescriptor; -typedef struct ProtobufCMessageUnknownField ProtobufCMessageUnknownField; -typedef struct ProtobufCMethodDescriptor ProtobufCMethodDescriptor; -typedef struct ProtobufCService ProtobufCService; -typedef struct ProtobufCServiceDescriptor ProtobufCServiceDescriptor; - -/** Boolean type. */ -typedef int protobuf_c_boolean; - -typedef void (*ProtobufCClosure)(const ProtobufCMessage *, void *closure_data); -typedef void (*ProtobufCMessageInit)(ProtobufCMessage *); -typedef void (*ProtobufCServiceDestroy)(ProtobufCService *); - -/** - * Structure for defining a custom memory allocator. - */ -struct ProtobufCAllocator { - /** Function to allocate memory. */ - void *(*alloc)(void *allocator_data, size_t size); - - /** Function to free memory. */ - void (*free)(void *allocator_data, void *pointer); - - /** Opaque pointer passed to `alloc` and `free` functions. */ - void *allocator_data; -}; - -/** - * Structure for the protobuf `bytes` scalar type. - * - * The data contained in a `ProtobufCBinaryData` is an arbitrary sequence of - * bytes. It may contain embedded `NUL` characters and is not required to be - * `NUL`-terminated. - */ -struct ProtobufCBinaryData { - size_t len; /**< Number of bytes in the `data` field. */ - uint8_t *data; /**< Data bytes. */ -}; - -/** - * Structure for defining a virtual append-only buffer. Used by - * protobuf_c_message_pack_to_buffer() to abstract the consumption of serialized - * bytes. - * - * `ProtobufCBuffer` "subclasses" may be defined on the stack. For example, to - * write to a `FILE` object: - * -~~~{.c} -typedef struct { - ProtobufCBuffer base; - FILE *fp; -} BufferAppendToFile; - -static void -my_buffer_file_append(ProtobufCBuffer *buffer, - size_t len, - const uint8_t *data) -{ - BufferAppendToFile *file_buf = (BufferAppendToFile *) buffer; - fwrite(data, len, 1, file_buf->fp); // XXX: No error handling! -} -~~~ - * - * To use this new type of ProtobufCBuffer, it could be called as follows: - * -~~~{.c} -... -BufferAppendToFile tmp = {0}; -tmp.base.append = my_buffer_file_append; -tmp.fp = fp; -protobuf_c_message_pack_to_buffer(&message, &tmp); -... -~~~ - */ -struct ProtobufCBuffer { - /** Append function. Consumes the `len` bytes stored at `data`. */ - void (*append)(ProtobufCBuffer *buffer, - size_t len, - const uint8_t *data); -}; - -/** - * Simple buffer "subclass" of `ProtobufCBuffer`. - * - * A `ProtobufCBufferSimple` object is declared on the stack and uses a - * scratch buffer provided by the user for the initial allocation. It performs - * exponential resizing, using dynamically allocated memory. A - * `ProtobufCBufferSimple` object can be created and used as follows: - * -~~~{.c} -uint8_t pad[128]; -ProtobufCBufferSimple simple = PROTOBUF_C_BUFFER_SIMPLE_INIT(pad); -ProtobufCBuffer *buffer = (ProtobufCBuffer *) &simple; -~~~ - * - * `buffer` can now be used with `protobuf_c_message_pack_to_buffer()`. Once a - * message has been serialized to a `ProtobufCBufferSimple` object, the - * serialized data bytes can be accessed from the `.data` field. - * - * To free the memory allocated by a `ProtobufCBufferSimple` object, if any, - * call PROTOBUF_C_BUFFER_SIMPLE_CLEAR() on the object, for example: - * -~~~{.c} -PROTOBUF_C_BUFFER_SIMPLE_CLEAR(&simple); -~~~ - * - * \see PROTOBUF_C_BUFFER_SIMPLE_INIT - * \see PROTOBUF_C_BUFFER_SIMPLE_CLEAR - */ -struct ProtobufCBufferSimple { - /** "Base class". */ - ProtobufCBuffer base; - /** Number of bytes allocated in `data`. */ - size_t alloced; - /** Number of bytes currently stored in `data`. */ - size_t len; - /** Data bytes. */ - uint8_t *data; - /** Whether `data` must be freed. */ - protobuf_c_boolean must_free_data; - /** Allocator to use. May be NULL to indicate the system allocator. */ - ProtobufCAllocator *allocator; -}; - -/** - * Describes an enumeration as a whole, with all of its values. - */ -struct ProtobufCEnumDescriptor { - /** Magic value checked to ensure that the API is used correctly. */ - uint32_t magic; - - /** The qualified name (e.g., "namespace.Type"). */ - const char *name; - /** The unqualified name as given in the .proto file (e.g., "Type"). */ - const char *short_name; - /** Identifier used in generated C code. */ - const char *c_name; - /** The dot-separated namespace. */ - const char *package_name; - - /** Number elements in `values`. */ - unsigned n_values; - /** Array of distinct values, sorted by numeric value. */ - const ProtobufCEnumValue *values; - - /** Number of elements in `values_by_name`. */ - unsigned n_value_names; - /** Array of named values, including aliases, sorted by name. */ - const ProtobufCEnumValueIndex *values_by_name; - - /** Number of elements in `value_ranges`. */ - unsigned n_value_ranges; - /** Value ranges, for faster lookups by numeric value. */ - const ProtobufCIntRange *value_ranges; - - /** Reserved for future use. */ - void *reserved1; - /** Reserved for future use. */ - void *reserved2; - /** Reserved for future use. */ - void *reserved3; - /** Reserved for future use. */ - void *reserved4; -}; - -/** - * Represents a single value of an enumeration. - */ -struct ProtobufCEnumValue { - /** The string identifying this value in the .proto file. */ - const char *name; - - /** The string identifying this value in generated C code. */ - const char *c_name; - - /** The numeric value assigned in the .proto file. */ - int value; -}; - -/** - * Used by `ProtobufCEnumDescriptor` to look up enum values. - */ -struct ProtobufCEnumValueIndex { - /** Name of the enum value. */ - const char *name; - /** Index into values[] array. */ - unsigned index; -}; - -/** - * Describes a single field in a message. - */ -struct ProtobufCFieldDescriptor { - /** Name of the field as given in the .proto file. */ - const char *name; - - /** Tag value of the field as given in the .proto file. */ - uint32_t id; - - /** Whether the field is `REQUIRED`, `OPTIONAL`, or `REPEATED`. */ - ProtobufCLabel label; - - /** The type of the field. */ - ProtobufCType type; - - /** - * The offset in bytes of the message's C structure's quantifier field - * (the `has_MEMBER` field for optional members or the `n_MEMBER` field - * for repeated members or the case enum for oneofs). - */ - unsigned quantifier_offset; - - /** - * The offset in bytes into the message's C structure for the member - * itself. - */ - unsigned offset; - - /** - * A type-specific descriptor. - * - * If `type` is `PROTOBUF_C_TYPE_ENUM`, then `descriptor` points to the - * corresponding `ProtobufCEnumDescriptor`. - * - * If `type` is `PROTOBUF_C_TYPE_MESSAGE`, then `descriptor` points to - * the corresponding `ProtobufCMessageDescriptor`. - * - * Otherwise this field is NULL. - */ - const void *descriptor; /* for MESSAGE and ENUM types */ - - /** The default value for this field, if defined. May be NULL. */ - const void *default_value; - - /** - * A flag word. Zero or more of the bits defined in the - * `ProtobufCFieldFlag` enum may be set. - */ - uint32_t flags; - - /** Reserved for future use. */ - unsigned reserved_flags; - /** Reserved for future use. */ - void *reserved2; - /** Reserved for future use. */ - void *reserved3; -}; - -/** - * Helper structure for optimizing int => index lookups in the case - * where the keys are mostly consecutive values, as they presumably are for - * enums and fields. - * - * The data structures requires that the values in the original array are - * sorted. - */ -struct ProtobufCIntRange { - int start_value; - unsigned orig_index; - /* - * NOTE: the number of values in the range can be inferred by looking - * at the next element's orig_index. A dummy element is added to make - * this simple. - */ -}; - -/** - * An instance of a message. - * - * `ProtobufCMessage` is a light-weight "base class" for all messages. - * - * In particular, `ProtobufCMessage` doesn't have any allocation policy - * associated with it. That's because it's common to create `ProtobufCMessage` - * objects on the stack. In fact, that's what we recommend for sending messages. - * If the object is allocated from the stack, you can't really have a memory - * leak. - * - * This means that calls to functions like protobuf_c_message_unpack() which - * return a `ProtobufCMessage` must be paired with a call to a free function, - * like protobuf_c_message_free_unpacked(). - */ -struct ProtobufCMessage { - /** The descriptor for this message type. */ - const ProtobufCMessageDescriptor *descriptor; - /** The number of elements in `unknown_fields`. */ - unsigned n_unknown_fields; - /** The fields that weren't recognized by the parser. */ - ProtobufCMessageUnknownField *unknown_fields; -}; - -/** - * Describes a message. - */ -struct ProtobufCMessageDescriptor { - /** Magic value checked to ensure that the API is used correctly. */ - uint32_t magic; - - /** The qualified name (e.g., "namespace.Type"). */ - const char *name; - /** The unqualified name as given in the .proto file (e.g., "Type"). */ - const char *short_name; - /** Identifier used in generated C code. */ - const char *c_name; - /** The dot-separated namespace. */ - const char *package_name; - - /** - * Size in bytes of the C structure representing an instance of this - * type of message. - */ - size_t sizeof_message; - - /** Number of elements in `fields`. */ - unsigned n_fields; - /** Field descriptors, sorted by tag number. */ - const ProtobufCFieldDescriptor *fields; - /** Used for looking up fields by name. */ - const unsigned *fields_sorted_by_name; - - /** Number of elements in `field_ranges`. */ - unsigned n_field_ranges; - /** Used for looking up fields by id. */ - const ProtobufCIntRange *field_ranges; - - /** Message initialisation function. */ - ProtobufCMessageInit message_init; - - /** Reserved for future use. */ - void *reserved1; - /** Reserved for future use. */ - void *reserved2; - /** Reserved for future use. */ - void *reserved3; -}; - -/** - * An unknown message field. - */ -struct ProtobufCMessageUnknownField { - /** The tag number. */ - uint32_t tag; - /** The wire type of the field. */ - ProtobufCWireType wire_type; - /** Number of bytes in `data`. */ - size_t len; - /** Field data. */ - uint8_t *data; -}; - -/** - * Method descriptor. - */ -struct ProtobufCMethodDescriptor { - /** Method name. */ - const char *name; - /** Input message descriptor. */ - const ProtobufCMessageDescriptor *input; - /** Output message descriptor. */ - const ProtobufCMessageDescriptor *output; -}; - -/** - * Service. - */ -struct ProtobufCService { - /** Service descriptor. */ - const ProtobufCServiceDescriptor *descriptor; - /** Function to invoke the service. */ - void (*invoke)(ProtobufCService *service, - unsigned method_index, - const ProtobufCMessage *input, - ProtobufCClosure closure, - void *closure_data); - /** Function to destroy the service. */ - void (*destroy)(ProtobufCService *service); -}; - -/** - * Service descriptor. - */ -struct ProtobufCServiceDescriptor { - /** Magic value checked to ensure that the API is used correctly. */ - uint32_t magic; - - /** Service name. */ - const char *name; - /** Short version of service name. */ - const char *short_name; - /** C identifier for the service name. */ - const char *c_name; - /** Package name. */ - const char *package; - /** Number of elements in `methods`. */ - unsigned n_methods; - /** Method descriptors, in the order defined in the .proto file. */ - const ProtobufCMethodDescriptor *methods; - /** Sort index of methods. */ - const unsigned *method_indices_by_name; -}; - -/** - * Get the version of the protobuf-c library. Note that this is the version of - * the library linked against, not the version of the headers compiled against. - * - * \return A string containing the version number of protobuf-c. - */ -PROTOBUF_C__API -const char * -protobuf_c_version(void); - -/** - * Get the version of the protobuf-c library. Note that this is the version of - * the library linked against, not the version of the headers compiled against. - * - * \return A 32 bit unsigned integer containing the version number of - * protobuf-c, represented in base-10 as (MAJOR*1E6) + (MINOR*1E3) + PATCH. - */ -PROTOBUF_C__API -uint32_t -protobuf_c_version_number(void); - -/** - * The version of the protobuf-c headers, represented as a string using the same - * format as protobuf_c_version(). - */ -#define PROTOBUF_C_VERSION "1.3.0" - -/** - * The version of the protobuf-c headers, represented as an integer using the - * same format as protobuf_c_version_number(). - */ -#define PROTOBUF_C_VERSION_NUMBER 1003000 - -/** - * The minimum protoc-c version which works with the current version of the - * protobuf-c headers. - */ -#define PROTOBUF_C_MIN_COMPILER_VERSION 1000000 - -/** - * Look up a `ProtobufCEnumValue` from a `ProtobufCEnumDescriptor` by name. - * - * \param desc - * The `ProtobufCEnumDescriptor` object. - * \param name - * The `name` field from the corresponding `ProtobufCEnumValue` object to - * match. - * \return - * A `ProtobufCEnumValue` object. - * \retval NULL - * If not found or if the optimize_for = CODE_SIZE option was set. - */ -PROTOBUF_C__API -const ProtobufCEnumValue * -protobuf_c_enum_descriptor_get_value_by_name( - const ProtobufCEnumDescriptor *desc, - const char *name); - -/** - * Look up a `ProtobufCEnumValue` from a `ProtobufCEnumDescriptor` by numeric - * value. - * - * \param desc - * The `ProtobufCEnumDescriptor` object. - * \param value - * The `value` field from the corresponding `ProtobufCEnumValue` object to - * match. - * - * \return - * A `ProtobufCEnumValue` object. - * \retval NULL - * If not found. - */ -PROTOBUF_C__API -const ProtobufCEnumValue * -protobuf_c_enum_descriptor_get_value( - const ProtobufCEnumDescriptor *desc, - int value); - -/** - * Look up a `ProtobufCFieldDescriptor` from a `ProtobufCMessageDescriptor` by - * the name of the field. - * - * \param desc - * The `ProtobufCMessageDescriptor` object. - * \param name - * The name of the field. - * \return - * A `ProtobufCFieldDescriptor` object. - * \retval NULL - * If not found or if the optimize_for = CODE_SIZE option was set. - */ -PROTOBUF_C__API -const ProtobufCFieldDescriptor * -protobuf_c_message_descriptor_get_field_by_name( - const ProtobufCMessageDescriptor *desc, - const char *name); - -/** - * Look up a `ProtobufCFieldDescriptor` from a `ProtobufCMessageDescriptor` by - * the tag value of the field. - * - * \param desc - * The `ProtobufCMessageDescriptor` object. - * \param value - * The tag value of the field. - * \return - * A `ProtobufCFieldDescriptor` object. - * \retval NULL - * If not found. - */ -PROTOBUF_C__API -const ProtobufCFieldDescriptor * -protobuf_c_message_descriptor_get_field( - const ProtobufCMessageDescriptor *desc, - unsigned value); - -/** - * Determine the number of bytes required to store the serialised message. - * - * \param message - * The message object to serialise. - * \return - * Number of bytes. - */ -PROTOBUF_C__API -size_t -protobuf_c_message_get_packed_size(const ProtobufCMessage *message); - -/** - * Serialise a message from its in-memory representation. - * - * This function stores the serialised bytes of the message in a pre-allocated - * buffer. - * - * \param message - * The message object to serialise. - * \param[out] out - * Buffer to store the bytes of the serialised message. This buffer must - * have enough space to store the packed message. Use - * protobuf_c_message_get_packed_size() to determine the number of bytes - * required. - * \return - * Number of bytes stored in `out`. - */ -PROTOBUF_C__API -size_t -protobuf_c_message_pack(const ProtobufCMessage *message, uint8_t *out); - -/** - * Serialise a message from its in-memory representation to a virtual buffer. - * - * This function calls the `append` method of a `ProtobufCBuffer` object to - * consume the bytes generated by the serialiser. - * - * \param message - * The message object to serialise. - * \param buffer - * The virtual buffer object. - * \return - * Number of bytes passed to the virtual buffer. - */ -PROTOBUF_C__API -size_t -protobuf_c_message_pack_to_buffer( - const ProtobufCMessage *message, - ProtobufCBuffer *buffer); - -/** - * Unpack a serialised message into an in-memory representation. - * - * \param descriptor - * The message descriptor. - * \param allocator - * `ProtobufCAllocator` to use for memory allocation. May be NULL to - * specify the default allocator. - * \param len - * Length in bytes of the serialised message. - * \param data - * Pointer to the serialised message. - * \return - * An unpacked message object. - * \retval NULL - * If an error occurred during unpacking. - */ -PROTOBUF_C__API -ProtobufCMessage * -protobuf_c_message_unpack( - const ProtobufCMessageDescriptor *descriptor, - ProtobufCAllocator *allocator, - size_t len, - const uint8_t *data); - -/** - * Free an unpacked message object. - * - * This function should be used to deallocate the memory used by a call to - * protobuf_c_message_unpack(). - * - * \param message - * The message object to free. May be NULL. - * \param allocator - * `ProtobufCAllocator` to use for memory deallocation. May be NULL to - * specify the default allocator. - */ -PROTOBUF_C__API -void -protobuf_c_message_free_unpacked( - ProtobufCMessage *message, - ProtobufCAllocator *allocator); - -/** - * Check the validity of a message object. - * - * Makes sure all required fields (`PROTOBUF_C_LABEL_REQUIRED`) are present. - * Recursively checks nested messages. - * - * \retval TRUE - * Message is valid. - * \retval FALSE - * Message is invalid. - */ -PROTOBUF_C__API -protobuf_c_boolean -protobuf_c_message_check(const ProtobufCMessage *); - -/** Message initialiser. */ -#define PROTOBUF_C_MESSAGE_INIT(descriptor) { descriptor, 0, NULL } - -/** - * Initialise a message object from a message descriptor. - * - * \param descriptor - * Message descriptor. - * \param message - * Allocated block of memory of size `descriptor->sizeof_message`. - */ -PROTOBUF_C__API -void -protobuf_c_message_init( - const ProtobufCMessageDescriptor *descriptor, - void *message); - -/** - * Free a service. - * - * \param service - * The service object to free. - */ -PROTOBUF_C__API -void -protobuf_c_service_destroy(ProtobufCService *service); - -/** - * Look up a `ProtobufCMethodDescriptor` by name. - * - * \param desc - * Service descriptor. - * \param name - * Name of the method. - * - * \return - * A `ProtobufCMethodDescriptor` object. - * \retval NULL - * If not found or if the optimize_for = CODE_SIZE option was set. - */ -PROTOBUF_C__API -const ProtobufCMethodDescriptor * -protobuf_c_service_descriptor_get_method_by_name( - const ProtobufCServiceDescriptor *desc, - const char *name); - -/** - * Initialise a `ProtobufCBufferSimple` object. - */ -#define PROTOBUF_C_BUFFER_SIMPLE_INIT(array_of_bytes) \ -{ \ - { protobuf_c_buffer_simple_append }, \ - sizeof(array_of_bytes), \ - 0, \ - (array_of_bytes), \ - 0, \ - NULL \ -} - -/** - * Clear a `ProtobufCBufferSimple` object, freeing any allocated memory. - */ -#define PROTOBUF_C_BUFFER_SIMPLE_CLEAR(simp_buf) \ -do { \ - if ((simp_buf)->must_free_data) { \ - if ((simp_buf)->allocator != NULL) \ - (simp_buf)->allocator->free( \ - (simp_buf)->allocator, \ - (simp_buf)->data); \ - else \ - free((simp_buf)->data); \ - } \ -} while (0) - -/** - * The `append` method for `ProtobufCBufferSimple`. - * - * \param buffer - * The buffer object to append to. Must actually be a - * `ProtobufCBufferSimple` object. - * \param len - * Number of bytes in `data`. - * \param data - * Data to append. - */ -PROTOBUF_C__API -void -protobuf_c_buffer_simple_append( - ProtobufCBuffer *buffer, - size_t len, - const unsigned char *data); - -PROTOBUF_C__API -void -protobuf_c_service_generated_init( - ProtobufCService *service, - const ProtobufCServiceDescriptor *descriptor, - ProtobufCServiceDestroy destroy); - -PROTOBUF_C__API -void -protobuf_c_service_invoke_internal( - ProtobufCService *service, - unsigned method_index, - const ProtobufCMessage *input, - ProtobufCClosure closure, - void *closure_data); - -/**@}*/ - -PROTOBUF_C__END_DECLS - -#endif /* PROTOBUF_C_H */ diff --git a/tools/sdk/include/protobuf-c/protoc-c/c_bytes_field.h b/tools/sdk/include/protobuf-c/protoc-c/c_bytes_field.h deleted file mode 100644 index c4a71e85b47..00000000000 --- a/tools/sdk/include/protobuf-c/protoc-c/c_bytes_field.h +++ /dev/null @@ -1,100 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// 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 Google Inc. 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. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -// Copyright (c) 2008-2013, Dave Benson. All rights reserved. -// -// 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. -// -// 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. - -// Modified to implement C code by Dave Benson. - -#ifndef GOOGLE_PROTOBUF_COMPILER_C_BYTES_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_C_BYTES_FIELD_H__ - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace c { - -class BytesFieldGenerator : public FieldGenerator { - public: - explicit BytesFieldGenerator(const FieldDescriptor* descriptor); - ~BytesFieldGenerator(); - - // implements FieldGenerator --------------------------------------- - void GenerateStructMembers(io::Printer* printer) const; - void GenerateDescriptorInitializer(io::Printer* printer) const; - void GenerateDefaultValueDeclarations(io::Printer* printer) const; - void GenerateDefaultValueImplementations(io::Printer* printer) const; - string GetDefaultValue(void) const; - void GenerateStaticInit(io::Printer* printer) const; - - private: - std::map variables_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(BytesFieldGenerator); -}; - - -} // namespace c -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_C_STRING_FIELD_H__ diff --git a/tools/sdk/include/protobuf-c/protoc-c/c_enum.h b/tools/sdk/include/protobuf-c/protoc-c/c_enum.h deleted file mode 100644 index 9eb9a6679ce..00000000000 --- a/tools/sdk/include/protobuf-c/protoc-c/c_enum.h +++ /dev/null @@ -1,118 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// 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 Google Inc. 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. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -// Copyright (c) 2008-2013, Dave Benson. All rights reserved. -// -// 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. -// -// 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. - -// Modified to implement C code by Dave Benson. - -#ifndef GOOGLE_PROTOBUF_COMPILER_C_ENUM_H__ -#define GOOGLE_PROTOBUF_COMPILER_C_ENUM_H__ - -#include -#include - -namespace google { -namespace protobuf { - namespace io { - class Printer; // printer.h - } -} - -namespace protobuf { -namespace compiler { -namespace c { - -class EnumGenerator { - public: - // See generator.cc for the meaning of dllexport_decl. - explicit EnumGenerator(const EnumDescriptor* descriptor, - const string& dllexport_decl); - ~EnumGenerator(); - - // Header stuff. - - // Generate header code defining the enum. This code should be placed - // within the enum's package namespace, but NOT within any class, even for - // nested enums. - void GenerateDefinition(io::Printer* printer); - - void GenerateDescriptorDeclarations(io::Printer* printer); - - - // Source file stuff. - - // Generate the ProtobufCEnumDescriptor for this enum - void GenerateEnumDescriptor(io::Printer* printer); - - // Generate static initializer for a ProtobufCEnumValue - // given the index of the value in the enum. - void GenerateValueInitializer(io::Printer *printer, int index); - - private: - const EnumDescriptor* descriptor_; - string dllexport_decl_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumGenerator); -}; - -} // namespace c -} // namespace compiler -} // namespace protobuf - -} // namespace google -#endif // GOOGLE_PROTOBUF_COMPILER_C_ENUM_H__ diff --git a/tools/sdk/include/protobuf-c/protoc-c/c_enum_field.h b/tools/sdk/include/protobuf-c/protoc-c/c_enum_field.h deleted file mode 100644 index 11df6824693..00000000000 --- a/tools/sdk/include/protobuf-c/protoc-c/c_enum_field.h +++ /dev/null @@ -1,98 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// 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 Google Inc. 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. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -// Copyright (c) 2008-2013, Dave Benson. All rights reserved. -// -// 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. -// -// 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. - -// Modified to implement C code by Dave Benson. - -#ifndef GOOGLE_PROTOBUF_COMPILER_C_ENUM_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_C_ENUM_FIELD_H__ - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace c { - -class EnumFieldGenerator : public FieldGenerator { - public: - explicit EnumFieldGenerator(const FieldDescriptor* descriptor); - ~EnumFieldGenerator(); - - // implements FieldGenerator --------------------------------------- - void GenerateStructMembers(io::Printer* printer) const; - void GenerateDescriptorInitializer(io::Printer* printer) const; - string GetDefaultValue(void) const; - void GenerateStaticInit(io::Printer* printer) const; - - private: - std::map variables_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumFieldGenerator); -}; - - -} // namespace c -} // namespace compiler -} // namespace protobuf - -} // namespace google -#endif // GOOGLE_PROTOBUF_COMPILER_C_ENUM_FIELD_H__ diff --git a/tools/sdk/include/protobuf-c/protoc-c/c_extension.h b/tools/sdk/include/protobuf-c/protoc-c/c_extension.h deleted file mode 100644 index ddbf270e5a1..00000000000 --- a/tools/sdk/include/protobuf-c/protoc-c/c_extension.h +++ /dev/null @@ -1,110 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// 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 Google Inc. 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. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -// Copyright (c) 2008-2013, Dave Benson. All rights reserved. -// -// 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. -// -// 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. - -// Modified to implement C code by Dave Benson. - -#ifndef GOOGLE_PROTOBUF_COMPILER_C_EXTENSION_H__ -#define GOOGLE_PROTOBUF_COMPILER_C_EXTENSION_H__ - -#include -#include - -namespace google { -namespace protobuf { - class FieldDescriptor; // descriptor.h - namespace io { - class Printer; // printer.h - } -} - -namespace protobuf { -namespace compiler { -namespace c { - -// Generates code for an extension, which may be within the scope of some -// message or may be at file scope. This is much simpler than FieldGenerator -// since extensions are just simple identifiers with interesting types. -class ExtensionGenerator { - public: - // See generator.cc for the meaning of dllexport_decl. - explicit ExtensionGenerator(const FieldDescriptor* descriptor, - const string& dllexport_decl); - ~ExtensionGenerator(); - - // Header stuff. - void GenerateDeclaration(io::Printer* printer); - - // Source file stuff. - void GenerateDefinition(io::Printer* printer); - - private: - const FieldDescriptor* descriptor_; - string type_traits_; - string dllexport_decl_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ExtensionGenerator); -}; - -} // namespace c -} // namespace compiler -} // namespace protobuf - -} // namespace google -#endif // GOOGLE_PROTOBUF_COMPILER_C_MESSAGE_H__ diff --git a/tools/sdk/include/protobuf-c/protoc-c/c_field.h b/tools/sdk/include/protobuf-c/protoc-c/c_field.h deleted file mode 100644 index 91f1a03dafb..00000000000 --- a/tools/sdk/include/protobuf-c/protoc-c/c_field.h +++ /dev/null @@ -1,132 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// 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 Google Inc. 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. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -// Copyright (c) 2008-2013, Dave Benson. All rights reserved. -// -// 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. -// -// 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. - -// Modified to implement C code by Dave Benson. - -#ifndef GOOGLE_PROTOBUF_COMPILER_C_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_C_FIELD_H__ - -#include -#include - -namespace google { -namespace protobuf { - namespace io { - class Printer; // printer.h - } -} - -namespace protobuf { -namespace compiler { -namespace c { - -class FieldGenerator { - public: - explicit FieldGenerator(const FieldDescriptor *descriptor) : descriptor_(descriptor) {} - virtual ~FieldGenerator(); - - // Generate definitions to be included in the structure. - virtual void GenerateStructMembers(io::Printer* printer) const = 0; - - // Generate a static initializer for this field. - virtual void GenerateDescriptorInitializer(io::Printer* printer) const = 0; - - virtual void GenerateDefaultValueDeclarations(io::Printer* printer) const { } - virtual void GenerateDefaultValueImplementations(io::Printer* printer) const { } - virtual string GetDefaultValue() const = 0; - - // Generate members to initialize this field from a static initializer - virtual void GenerateStaticInit(io::Printer* printer) const = 0; - - - protected: - void GenerateDescriptorInitializerGeneric(io::Printer* printer, - bool optional_uses_has, - const string &type_macro, - const string &descriptor_addr) const; - const FieldDescriptor *descriptor_; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldGenerator); -}; - -// Convenience class which constructs FieldGenerators for a Descriptor. -class FieldGeneratorMap { - public: - explicit FieldGeneratorMap(const Descriptor* descriptor); - ~FieldGeneratorMap(); - - const FieldGenerator& get(const FieldDescriptor* field) const; - - private: - const Descriptor* descriptor_; - scoped_array > field_generators_; - - static FieldGenerator* MakeGenerator(const FieldDescriptor* field); - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldGeneratorMap); -}; - -} // namespace c -} // namespace compiler -} // namespace protobuf - -} // namespace google -#endif // GOOGLE_PROTOBUF_COMPILER_C_FIELD_H__ diff --git a/tools/sdk/include/protobuf-c/protoc-c/c_file.h b/tools/sdk/include/protobuf-c/protoc-c/c_file.h deleted file mode 100644 index ed38ce425c3..00000000000 --- a/tools/sdk/include/protobuf-c/protoc-c/c_file.h +++ /dev/null @@ -1,117 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// 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 Google Inc. 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. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -// Copyright (c) 2008-2013, Dave Benson. All rights reserved. -// -// 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. -// -// 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. - -// Modified to implement C code by Dave Benson. - -#ifndef GOOGLE_PROTOBUF_COMPILER_C_FILE_H__ -#define GOOGLE_PROTOBUF_COMPILER_C_FILE_H__ - -#include -#include -#include -#include - -namespace google { -namespace protobuf { - class FileDescriptor; // descriptor.h - namespace io { - class Printer; // printer.h - } -} - -namespace protobuf { -namespace compiler { -namespace c { - -class EnumGenerator; // enum.h -class MessageGenerator; // message.h -class ServiceGenerator; // service.h -class ExtensionGenerator; // extension.h - -class FileGenerator { - public: - // See generator.cc for the meaning of dllexport_decl. - explicit FileGenerator(const FileDescriptor* file, - const string& dllexport_decl); - ~FileGenerator(); - - void GenerateHeader(io::Printer* printer); - void GenerateSource(io::Printer* printer); - - private: - const FileDescriptor* file_; - - scoped_array > message_generators_; - scoped_array > enum_generators_; - scoped_array > service_generators_; - scoped_array > extension_generators_; - - // E.g. if the package is foo.bar, package_parts_ is {"foo", "bar"}. - vector package_parts_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FileGenerator); -}; - -} // namespace c -} // namespace compiler -} // namespace protobuf - -} // namespace google -#endif // GOOGLE_PROTOBUF_COMPILER_C_FILE_H__ diff --git a/tools/sdk/include/protobuf-c/protoc-c/c_generator.h b/tools/sdk/include/protobuf-c/protoc-c/c_generator.h deleted file mode 100644 index f454710b36f..00000000000 --- a/tools/sdk/include/protobuf-c/protoc-c/c_generator.h +++ /dev/null @@ -1,100 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// 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 Google Inc. 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. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -// Copyright (c) 2008-2013, Dave Benson. All rights reserved. -// -// 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. -// -// 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. - -// Modified to implement C code by Dave Benson. - -// Generates C code for a given .proto file. - -#ifndef GOOGLE_PROTOBUF_COMPILER_C_GENERATOR_H__ -#define GOOGLE_PROTOBUF_COMPILER_C_GENERATOR_H__ - -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace c { - -// CodeGenerator implementation which generates a C++ source file and -// header. If you create your own protocol compiler binary and you want -// it to support C++ output, you can do so by registering an instance of this -// CodeGenerator with the CommandLineInterface in your main() function. -class LIBPROTOC_EXPORT CGenerator : public CodeGenerator { - public: - CGenerator(); - ~CGenerator(); - - // implements CodeGenerator ---------------------------------------- - bool Generate(const FileDescriptor* file, - const string& parameter, - OutputDirectory* output_directory, - string* error) const; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CGenerator); -}; - -} // namespace c -} // namespace compiler -} // namespace protobuf - -} // namespace google -#endif // GOOGLE_PROTOBUF_COMPILER_C_GENERATOR_H__ diff --git a/tools/sdk/include/protobuf-c/protoc-c/c_helpers.h b/tools/sdk/include/protobuf-c/protoc-c/c_helpers.h deleted file mode 100644 index 9dc8c5e859c..00000000000 --- a/tools/sdk/include/protobuf-c/protoc-c/c_helpers.h +++ /dev/null @@ -1,197 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// 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 Google Inc. 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. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -// Copyright (c) 2008-2013, Dave Benson. All rights reserved. -// -// 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. -// -// 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. - -// Modified to implement C code by Dave Benson. - -#ifndef GOOGLE_PROTOBUF_COMPILER_C_HELPERS_H__ -#define GOOGLE_PROTOBUF_COMPILER_C_HELPERS_H__ - -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace c { - -// Returns the non-nested type name for the given type. If "qualified" is -// true, prefix the type with the full namespace. For example, if you had: -// package foo.bar; -// message Baz { message Qux {} } -// Then the qualified ClassName for Qux would be: -// Foo__Bar__Baz_Qux -// While the non-qualified version would be: -// Baz_Qux -string ClassName(const Descriptor* descriptor, bool qualified); -string ClassName(const EnumDescriptor* enum_descriptor, bool qualified); - -// --- Borrowed from stubs. --- -template string SimpleItoa(T n) { - std::stringstream stream; - stream << n; - return stream.str(); -} - -string SimpleFtoa(float f); -string SimpleDtoa(double f); -void SplitStringUsing(const string &str, const char *delim, std::vector *out); -string CEscape(const string& src); -string StringReplace(const string& s, const string& oldsub, const string& newsub, bool replace_all); -inline bool HasSuffixString(const string& str, const string& suffix) { return str.size() >= suffix.size() && str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0; } -inline string StripSuffixString(const string& str, const string& suffix) { if (HasSuffixString(str, suffix)) { return str.substr(0, str.size() - suffix.size()); } else { return str; } } -char* FastHexToBuffer(int i, char* buffer); - - -// Get the (unqualified) name that should be used for this field in C code. -// The name is coerced to lower-case to emulate proto1 behavior. People -// should be using lowercase-with-underscores style for proto field names -// anyway, so normally this just returns field->name(). -string FieldName(const FieldDescriptor* field); - -// Get macro string for deprecated field -string FieldDeprecated(const FieldDescriptor* field); - -// Returns the scope where the field was defined (for extensions, this is -// different from the message type to which the field applies). -inline const Descriptor* FieldScope(const FieldDescriptor* field) { - return field->is_extension() ? - field->extension_scope() : field->containing_type(); -} - -// convert a CamelCase class name into an all uppercase affair -// with underscores separating words, e.g. MyClass becomes MY_CLASS. -string CamelToUpper(const string &class_name); -string CamelToLower(const string &class_name); - -// lowercased, underscored name to camel case -string ToCamel(const string &name); - -// lowercase the string -string ToLower(const string &class_name); -string ToUpper(const string &class_name); - -// full_name() to lowercase with underscores -string FullNameToLower(const string &full_name); -string FullNameToUpper(const string &full_name); - -// full_name() to c-typename (with underscores for packages, otherwise camel case) -string FullNameToC(const string &class_name); - -// Splits, indents, formats, and prints comment lines -void PrintComment (io::Printer* printer, string comment); - -// make a string of spaces as long as input -string ConvertToSpaces(const string &input); - -// Strips ".proto" or ".protodevel" from the end of a filename. -string StripProto(const string& filename); - -// Get the C++ type name for a primitive type (e.g. "double", "::google::protobuf::int32", etc.). -// Note: non-built-in type names will be qualified, meaning they will start -// with a ::. If you are using the type as a template parameter, you will -// need to insure there is a space between the < and the ::, because the -// ridiculous C++ standard defines "<:" to be a synonym for "[". -const char* PrimitiveTypeName(FieldDescriptor::CppType type); - -// Get the declared type name in CamelCase format, as is used e.g. for the -// methods of WireFormat. For example, TYPE_INT32 becomes "Int32". -const char* DeclaredTypeMethodName(FieldDescriptor::Type type); - -// Convert a file name into a valid identifier. -string FilenameIdentifier(const string& filename); - -// Return the name of the BuildDescriptors() function for a given file. -string GlobalBuildDescriptorsName(const string& filename); - -// return 'required', 'optional', or 'repeated' -string GetLabelName(FieldDescriptor::Label label); - - -// write IntRanges entries for a bunch of sorted values. -// returns the number of ranges there are to bsearch. -unsigned WriteIntRanges(io::Printer* printer, int n_values, const int *values, const string &name); - -struct NameIndex -{ - unsigned index; - const char *name; -}; -int compare_name_indices_by_name(const void*, const void*); - -// Return the syntax version of the file containing the field. -// This wrapper is needed to be able to compile against protobuf2. -inline int FieldSyntax(const FieldDescriptor* field) { -#ifdef HAVE_PROTO3 - return field->file()->syntax() == FileDescriptor::SYNTAX_PROTO3 ? 3 : 2; -#else - return 2; -#endif -} - -} // namespace c -} // namespace compiler -} // namespace protobuf - -} // namespace google -#endif // GOOGLE_PROTOBUF_COMPILER_C_HELPERS_H__ diff --git a/tools/sdk/include/protobuf-c/protoc-c/c_message.h b/tools/sdk/include/protobuf-c/protoc-c/c_message.h deleted file mode 100644 index 8b115d1c8cb..00000000000 --- a/tools/sdk/include/protobuf-c/protoc-c/c_message.h +++ /dev/null @@ -1,141 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// 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 Google Inc. 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. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -// Copyright (c) 2008-2013, Dave Benson. All rights reserved. -// -// 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. -// -// 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. - -// Modified to implement C code by Dave Benson. - -#ifndef GOOGLE_PROTOBUF_COMPILER_C_MESSAGE_H__ -#define GOOGLE_PROTOBUF_COMPILER_C_MESSAGE_H__ - -#include -#include -#include - -namespace google { -namespace protobuf { - namespace io { - class Printer; // printer.h - } -} - -namespace protobuf { -namespace compiler { -namespace c { - -class EnumGenerator; // enum.h -class ExtensionGenerator; // extension.h - -class MessageGenerator { - public: - // See generator.cc for the meaning of dllexport_decl. - explicit MessageGenerator(const Descriptor* descriptor, - const string& dllexport_decl); - ~MessageGenerator(); - - // Header stuff. - - // Generate typedef. - void GenerateStructTypedef(io::Printer* printer); - - // Generate descriptor prototype - void GenerateDescriptorDeclarations(io::Printer* printer); - - // Generate descriptor prototype - void GenerateClosureTypedef(io::Printer* printer); - - // Generate definitions of all nested enums (must come before class - // definitions because those classes use the enums definitions). - void GenerateEnumDefinitions(io::Printer* printer); - - // Generate definitions for this class and all its nested types. - void GenerateStructDefinition(io::Printer* printer); - - // Generate __INIT macro for populating this structure - void GenerateStructStaticInitMacro(io::Printer* printer); - - // Generate standard helper functions declarations for this message. - void GenerateHelperFunctionDeclarations(io::Printer* printer, bool is_submessage); - - // Source file stuff. - - // Generate code that initializes the global variable storing the message's - // descriptor. - void GenerateMessageDescriptor(io::Printer* printer); - void GenerateHelperFunctionDefinitions(io::Printer* printer, bool is_submessage); - - private: - - string GetDefaultValueC(const FieldDescriptor *fd); - - const Descriptor* descriptor_; - string dllexport_decl_; - FieldGeneratorMap field_generators_; - scoped_array > nested_generators_; - scoped_array > enum_generators_; - scoped_array > extension_generators_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageGenerator); -}; - -} // namespace c -} // namespace compiler -} // namespace protobuf - -} // namespace google -#endif // GOOGLE_PROTOBUF_COMPILER_C_MESSAGE_H__ diff --git a/tools/sdk/include/protobuf-c/protoc-c/c_message_field.h b/tools/sdk/include/protobuf-c/protoc-c/c_message_field.h deleted file mode 100644 index b059fb031b0..00000000000 --- a/tools/sdk/include/protobuf-c/protoc-c/c_message_field.h +++ /dev/null @@ -1,97 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// 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 Google Inc. 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. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -// Copyright (c) 2008-2013, Dave Benson. All rights reserved. -// -// 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. -// -// 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. - -// Modified to implement C code by Dave Benson. - -#ifndef GOOGLE_PROTOBUF_COMPILER_C_MESSAGE_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_C_MESSAGE_FIELD_H__ - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace c { - -class MessageFieldGenerator : public FieldGenerator { - public: - explicit MessageFieldGenerator(const FieldDescriptor* descriptor); - ~MessageFieldGenerator(); - - // implements FieldGenerator --------------------------------------- - void GenerateStructMembers(io::Printer* printer) const; - void GenerateDescriptorInitializer(io::Printer* printer) const; - string GetDefaultValue(void) const; - void GenerateStaticInit(io::Printer* printer) const; - - private: - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageFieldGenerator); -}; - - -} // namespace c -} // namespace compiler -} // namespace protobuf - -} // namespace google -#endif // GOOGLE_PROTOBUF_COMPILER_C_MESSAGE_FIELD_H__ diff --git a/tools/sdk/include/protobuf-c/protoc-c/c_primitive_field.h b/tools/sdk/include/protobuf-c/protoc-c/c_primitive_field.h deleted file mode 100644 index 5ff254c5dd8..00000000000 --- a/tools/sdk/include/protobuf-c/protoc-c/c_primitive_field.h +++ /dev/null @@ -1,96 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// 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 Google Inc. 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. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -// Copyright (c) 2008-2013, Dave Benson. All rights reserved. -// -// 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. -// -// 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. - -// Modified to implement C code by Dave Benson. - -#ifndef GOOGLE_PROTOBUF_COMPILER_C_PRIMITIVE_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_C_PRIMITIVE_FIELD_H__ - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace c { - -class PrimitiveFieldGenerator : public FieldGenerator { - public: - explicit PrimitiveFieldGenerator(const FieldDescriptor* descriptor); - ~PrimitiveFieldGenerator(); - - // implements FieldGenerator --------------------------------------- - void GenerateStructMembers(io::Printer* printer) const; - void GenerateDescriptorInitializer(io::Printer* printer) const; - string GetDefaultValue(void) const; - void GenerateStaticInit(io::Printer* printer) const; - - private: - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(PrimitiveFieldGenerator); -}; - -} // namespace c -} // namespace compiler -} // namespace protobuf - -} // namespace google -#endif // GOOGLE_PROTOBUF_COMPILER_C_PRIMITIVE_FIELD_H__ diff --git a/tools/sdk/include/protobuf-c/protoc-c/c_service.h b/tools/sdk/include/protobuf-c/protoc-c/c_service.h deleted file mode 100644 index 6f1798ca724..00000000000 --- a/tools/sdk/include/protobuf-c/protoc-c/c_service.h +++ /dev/null @@ -1,112 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// 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 Google Inc. 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. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -// Copyright (c) 2008-2013, Dave Benson. All rights reserved. -// -// 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. -// -// 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. - -// Modified to implement C code by Dave Benson. - -#ifndef GOOGLE_PROTOBUF_COMPILER_C_SERVICE_H__ -#define GOOGLE_PROTOBUF_COMPILER_C_SERVICE_H__ - -#include -#include -#include - -namespace google { -namespace protobuf { - namespace io { - class Printer; // printer.h - } -} - -namespace protobuf { -namespace compiler { -namespace c { - -class ServiceGenerator { - public: - // See generator.cc for the meaning of dllexport_decl. - explicit ServiceGenerator(const ServiceDescriptor* descriptor, - const string& dllexport_decl); - ~ServiceGenerator(); - - // Header stuff. - void GenerateMainHFile(io::Printer* printer); - void GenerateVfuncs(io::Printer* printer); - void GenerateInitMacros(io::Printer* printer); - void GenerateDescriptorDeclarations(io::Printer* printer); - void GenerateCallersDeclarations(io::Printer* printer); - - // Source file stuff. - void GenerateCFile(io::Printer* printer); - void GenerateServiceDescriptor(io::Printer* printer); - void GenerateInit(io::Printer* printer); - void GenerateCallersImplementations(io::Printer* printer); - - const ServiceDescriptor* descriptor_; - std::map vars_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ServiceGenerator); -}; - -} // namespace c -} // namespace compiler -} // namespace protobuf - -} // namespace google -#endif // GOOGLE_PROTOBUF_COMPILER_C_SERVICE_H__ diff --git a/tools/sdk/include/protobuf-c/protoc-c/c_string_field.h b/tools/sdk/include/protobuf-c/protoc-c/c_string_field.h deleted file mode 100644 index 68f0d25b7dd..00000000000 --- a/tools/sdk/include/protobuf-c/protoc-c/c_string_field.h +++ /dev/null @@ -1,100 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// 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 Google Inc. 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. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -// Copyright (c) 2008-2013, Dave Benson. All rights reserved. -// -// 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. -// -// 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. - -// Modified to implement C code by Dave Benson. - -#ifndef GOOGLE_PROTOBUF_COMPILER_C_STRING_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_C_STRING_FIELD_H__ - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace c { - -class StringFieldGenerator : public FieldGenerator { - public: - explicit StringFieldGenerator(const FieldDescriptor* descriptor); - ~StringFieldGenerator(); - - // implements FieldGenerator --------------------------------------- - void GenerateStructMembers(io::Printer* printer) const; - void GenerateDescriptorInitializer(io::Printer* printer) const; - void GenerateDefaultValueDeclarations(io::Printer* printer) const; - void GenerateDefaultValueImplementations(io::Printer* printer) const; - string GetDefaultValue(void) const; - void GenerateStaticInit(io::Printer* printer) const; - - private: - std::map variables_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(StringFieldGenerator); -}; - - -} // namespace c -} // namespace compiler -} // namespace protobuf - -} // namespace google -#endif // GOOGLE_PROTOBUF_COMPILER_C_STRING_FIELD_H__ diff --git a/tools/sdk/include/protobuf-c/t/generated-code2/common-test-arrays.h b/tools/sdk/include/protobuf-c/t/generated-code2/common-test-arrays.h deleted file mode 100644 index 1535d38e821..00000000000 --- a/tools/sdk/include/protobuf-c/t/generated-code2/common-test-arrays.h +++ /dev/null @@ -1,62 +0,0 @@ - -/* data included from the c++ packed-data generator, - and from the c test code. */ - -#define THOUSAND 1000 -#define MILLION 1000000 -#define BILLION 1000000000LL -#define TRILLION 1000000000000LL -#define QUADRILLION 1000000000000000LL -#define QUINTILLION 1000000000000000000LL - -int32_t int32_arr0[2] = { -1, 1 }; -int32_t int32_arr1[5] = { 42, 666, -1123123, 0, 47 }; -int32_t int32_arr_min_max[2] = { INT32_MIN, INT32_MAX }; - -uint32_t uint32_roundnumbers[4] = { BILLION, MILLION, 1, 0 }; -uint32_t uint32_0_max[2] = { 0, UINT32_MAX }; - -int64_t int64_roundnumbers[15] = { -QUINTILLION, -QUADRILLION, -TRILLION, - -BILLION, -MILLION, -THOUSAND, - 1, - THOUSAND, MILLION, BILLION, - TRILLION, QUADRILLION, QUINTILLION }; -int64_t int64_min_max[2] = { INT64_MIN, INT64_MAX }; - -uint64_t uint64_roundnumbers[9] = { 1, - THOUSAND, MILLION, BILLION, - TRILLION, QUADRILLION, QUINTILLION }; -uint64_t uint64_0_1_max[3] = { 0, 1, UINT64_MAX }; -uint64_t uint64_random[] = {0, - 666, - 4200000000ULL, - 16ULL * (uint64_t) QUINTILLION + 33 }; - -#define FLOATING_POINT_RANDOM \ --1000.0, -100.0, -42.0, 0, 666, 131313 -float float_random[] = { FLOATING_POINT_RANDOM }; -double double_random[] = { FLOATING_POINT_RANDOM }; - -protobuf_c_boolean boolean_0[] = {0 }; -protobuf_c_boolean boolean_1[] = {1 }; -protobuf_c_boolean boolean_random[] = {0,1,1,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,1,0,1,1,0,1,1,0 }; - -TEST_ENUM_SMALL_TYPE_NAME enum_small_0[] = { TEST_ENUM_SMALL(VALUE) }; -TEST_ENUM_SMALL_TYPE_NAME enum_small_1[] = { TEST_ENUM_SMALL(OTHER_VALUE) }; -#define T(v) (TEST_ENUM_SMALL_TYPE_NAME)(v) -TEST_ENUM_SMALL_TYPE_NAME enum_small_random[] = {T(0),T(1),T(1),T(0),T(0),T(1),T(1),T(1),T(0),T(0),T(0),T(0),T(0),T(1),T(1),T(1),T(1),T(1),T(1),T(0),T(1),T(1),T(0),T(1),T(1),T(0) }; -#undef T - -#define T(v) (TEST_ENUM_TYPE_NAME)(v) -TEST_ENUM_TYPE_NAME enum_0[] = { T(0) }; -TEST_ENUM_TYPE_NAME enum_1[] = { T(1) }; -TEST_ENUM_TYPE_NAME enum_random[] = { - T(0), T(268435455), T(127), T(16384), T(16383), - T(2097152), T(2097151), T(128), T(268435456), - T(0), T(2097152), T(268435455), T(127), T(16383), T(16384) }; -#undef T - -char *repeated_strings_0[] = { (char*)"onestring" }; -char *repeated_strings_1[] = { (char*)"two", (char*)"string" }; -char *repeated_strings_2[] = { (char*)"many", (char*)"tiny", (char*)"little", (char*)"strings", (char*)"should", (char*)"be", (char*)"handled" }; -char *repeated_strings_3[] = { (char*)"one very long strings XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" }; diff --git a/tools/sdk/include/protocomm/protocomm.h b/tools/sdk/include/protocomm/protocomm.h deleted file mode 100644 index 239d71390b2..00000000000 --- a/tools/sdk/include/protocomm/protocomm.h +++ /dev/null @@ -1,235 +0,0 @@ -// 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. - -#pragma once - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Function prototype for protocomm endpoint handler - */ -typedef esp_err_t (*protocomm_req_handler_t)( - uint32_t session_id, /*!< Session ID for identifying protocomm client */ - const uint8_t *inbuf, /*!< Pointer to user provided input data buffer */ - ssize_t inlen, /*!< Length o the input buffer */ - uint8_t **outbuf, /*!< Pointer to output buffer allocated by handler */ - ssize_t *outlen, /*!< Length of the allocated output buffer */ - void *priv_data /*!< Private data passed to the handler (NULL if not used) */ -); - -/** - * @brief This structure corresponds to a unique instance of protocomm - * returned when the API `protocomm_new()` is called. The remaining - * Protocomm APIs require this object as the first parameter. - * - * @note Structure of the protocomm object is kept private - */ -typedef struct protocomm protocomm_t; - -/** - * @brief Create a new protocomm instance - * - * This API will return a new dynamically allocated protocomm instance - * with all elements of the protocomm_t structure initialized to NULL. - * - * @return - * - protocomm_t* : On success - * - NULL : No memory for allocating new instance - */ -protocomm_t *protocomm_new(); - -/** - * @brief Delete a protocomm instance - * - * This API will deallocate a protocomm instance that was created - * using `protocomm_new()`. - * - * @param[in] pc Pointer to the protocomm instance to be deleted - */ -void protocomm_delete(protocomm_t *pc); - -/** - * @brief Add endpoint request handler for a protocomm instance - * - * This API will bind an endpoint handler function to the specified - * endpoint name, along with any private data that needs to be pass to - * the handler at the time of call. - * - * @note - * - An endpoint must be bound to a valid protocomm instance, - * created using `protocomm_new()`. - * - This function internally calls the registered `add_endpoint()` - * function of the selected transport which is a member of the - * protocomm_t instance structure. - * - * @param[in] pc Pointer to the protocomm instance - * @param[in] ep_name Endpoint identifier(name) string - * @param[in] h Endpoint handler function - * @param[in] priv_data Pointer to private data to be passed as a - * parameter to the handler function on call. - * Pass NULL if not needed. - * - * @return - * - ESP_OK : Success - * - ESP_FAIL : Error adding endpoint / Endpoint with this name already exists - * - ESP_ERR_NO_MEM : Error allocating endpoint resource - * - ESP_ERR_INVALID_ARG : Null instance/name/handler arguments - */ -esp_err_t protocomm_add_endpoint(protocomm_t *pc, const char *ep_name, - protocomm_req_handler_t h, void *priv_data); - -/** - * @brief Remove endpoint request handler for a protocomm instance - * - * This API will remove a registered endpoint handler identified by - * an endpoint name. - * - * @note - * - This function internally calls the registered `remove_endpoint()` - * function which is a member of the protocomm_t instance structure. - * - * @param[in] pc Pointer to the protocomm instance - * @param[in] ep_name Endpoint identifier(name) string - * - * @return - * - ESP_OK : Success - * - ESP_ERR_NOT_FOUND : Endpoint with specified name doesn't exist - * - ESP_ERR_INVALID_ARG : Null instance/name arguments - */ -esp_err_t protocomm_remove_endpoint(protocomm_t *pc, const char *ep_name); - -/** - * @brief Calls the registered handler of an endpoint session - * for processing incoming data and generating the response - * - * @note - * - An endpoint must be bound to a valid protocomm instance, - * created using `protocomm_new()`. - * - Resulting output buffer must be deallocated by the caller. - * - * @param[in] pc Pointer to the protocomm instance - * @param[in] ep_name Endpoint identifier(name) string - * @param[in] session_id Unique ID for a communication session - * @param[in] inbuf Input buffer contains input request data which is to be - * processed by the registered handler - * @param[in] inlen Length of the input buffer - * @param[out] outbuf Pointer to internally allocated output buffer, - * where the resulting response data output from - * the registered handler is to be stored - * @param[out] outlen Buffer length of the allocated output buffer - * - * @return - * - ESP_OK : Request handled successfully - * - ESP_FAIL : Internal error in execution of registered handler - * - ESP_ERR_NO_MEM : Error allocating internal resource - * - ESP_ERR_NOT_FOUND : Endpoint with specified name doesn't exist - * - ESP_ERR_INVALID_ARG : Null instance/name arguments - */ -esp_err_t protocomm_req_handle(protocomm_t *pc, const char *ep_name, uint32_t session_id, - const uint8_t *inbuf, ssize_t inlen, - uint8_t **outbuf, ssize_t *outlen); - -/** - * @brief Add endpoint security for a protocomm instance - * - * This API will bind a security session establisher to the specified - * endpoint name, along with any proof of possession that may be required - * for authenticating a session client. - * - * @note - * - An endpoint must be bound to a valid protocomm instance, - * created using `protocomm_new()`. - * - The choice of security can be any `protocomm_security_t` instance. - * Choices `protocomm_security0` and `protocomm_security1` are readily available. - * - * @param[in] pc Pointer to the protocomm instance - * @param[in] ep_name Endpoint identifier(name) string - * @param[in] sec Pointer to endpoint security instance - * @param[in] pop Pointer to proof of possession for authenticating a client - * - * @return - * - ESP_OK : Success - * - ESP_FAIL : Error adding endpoint / Endpoint with this name already exists - * - ESP_ERR_INVALID_STATE : Security endpoint already set - * - ESP_ERR_NO_MEM : Error allocating endpoint resource - * - ESP_ERR_INVALID_ARG : Null instance/name/handler arguments - */ -esp_err_t protocomm_set_security(protocomm_t *pc, const char *ep_name, - const protocomm_security_t *sec, - const protocomm_security_pop_t *pop); - -/** - * @brief Remove endpoint security for a protocomm instance - * - * This API will remove a registered security endpoint identified by - * an endpoint name. - * - * @param[in] pc Pointer to the protocomm instance - * @param[in] ep_name Endpoint identifier(name) string - * - * @return - * - ESP_OK : Success - * - ESP_ERR_NOT_FOUND : Endpoint with specified name doesn't exist - * - ESP_ERR_INVALID_ARG : Null instance/name arguments - */ -esp_err_t protocomm_unset_security(protocomm_t *pc, const char *ep_name); - -/** - * @brief Set endpoint for version verification - * - * This API can be used for setting an application specific protocol - * version which can be verified by clients through the endpoint. - * - * @note - * - An endpoint must be bound to a valid protocomm instance, - * created using `protocomm_new()`. - - * @param[in] pc Pointer to the protocomm instance - * @param[in] ep_name Endpoint identifier(name) string - * @param[in] version Version identifier(name) string - * - * @return - * - ESP_OK : Success - * - ESP_FAIL : Error adding endpoint / Endpoint with this name already exists - * - ESP_ERR_INVALID_STATE : Version endpoint already set - * - ESP_ERR_NO_MEM : Error allocating endpoint resource - * - ESP_ERR_INVALID_ARG : Null instance/name/handler arguments - */ -esp_err_t protocomm_set_version(protocomm_t *pc, const char *ep_name, - const char *version); - -/** - * @brief Remove version verification endpoint from a protocomm instance - * - * This API will remove a registered version endpoint identified by - * an endpoint name. - * - * @param[in] pc Pointer to the protocomm instance - * @param[in] ep_name Endpoint identifier(name) string - * - * @return - * - ESP_OK : Success - * - ESP_ERR_NOT_FOUND : Endpoint with specified name doesn't exist - * - ESP_ERR_INVALID_ARG : Null instance/name arguments - */ -esp_err_t protocomm_unset_version(protocomm_t *pc, const char *ep_name); - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/protocomm/protocomm_ble.h b/tools/sdk/include/protocomm/protocomm_ble.h deleted file mode 100644 index 92714444f0e..00000000000 --- a/tools/sdk/include/protocomm/protocomm_ble.h +++ /dev/null @@ -1,111 +0,0 @@ -// 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. - -#pragma once - -#include - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * BLE device name cannot be larger than this value - * 31 bytes (max scan response size) - 1 byte (length) - 1 byte (type) = 29 bytes - */ -#define MAX_BLE_DEVNAME_LEN (ESP_BLE_SCAN_RSP_DATA_LEN_MAX - 2) - -/** - * @brief This structure maps handler required by protocomm layer to - * UUIDs which are used to uniquely identify BLE characteristics - * from a smartphone or a similar client device. - */ -typedef struct name_uuid { - /** - * Name of the handler, which is passed to protocomm layer - */ - const char *name; - - /** - * UUID to be assigned to the BLE characteristic which is - * mapped to the handler - */ - uint16_t uuid; -} protocomm_ble_name_uuid_t; - -/** - * @brief Config parameters for protocomm BLE service - */ -typedef struct { - /** - * BLE device name being broadcast at the time of provisioning - */ - char device_name[MAX_BLE_DEVNAME_LEN]; - - /** - * 128 bit UUID of the provisioning service - */ - uint8_t service_uuid[ESP_UUID_LEN_128]; - - /** - * Number of entries in the Name-UUID lookup table - */ - ssize_t nu_lookup_count; - - /** - * Pointer to the Name-UUID lookup table - */ - protocomm_ble_name_uuid_t *nu_lookup; -} protocomm_ble_config_t; - -/** - * @brief Start Bluetooth Low Energy based transport layer for provisioning - * - * Initialize and start required BLE service for provisioning. This includes - * the initialization for characteristics/service for BLE. - * - * @param[in] pc Protocomm instance pointer obtained from protocomm_new() - * @param[in] config Pointer to config structure for initializing BLE - * - * @return - * - ESP_OK : Success - * - ESP_FAIL : Simple BLE start error - * - ESP_ERR_NO_MEM : Error allocating memory for internal resources - * - ESP_ERR_INVALID_STATE : Error in ble config - * - ESP_ERR_INVALID_ARG : Null arguments - */ -esp_err_t protocomm_ble_start(protocomm_t *pc, const protocomm_ble_config_t *config); - -/** - * @brief Stop Bluetooth Low Energy based transport layer for provisioning - * - * Stops service/task responsible for BLE based interactions for provisioning - * - * @note You might want to optionally reclaim memory from Bluetooth. - * Refer to the documentation of `esp_bt_mem_release` in that case. - * - * @param[in] pc Same protocomm instance that was passed to protocomm_ble_start() - * - * @return - * - ESP_OK : Success - * - ESP_FAIL : Simple BLE stop error - * - ESP_ERR_INVALID_ARG : Null / incorrect protocomm instance - */ -esp_err_t protocomm_ble_stop(protocomm_t *pc); - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/protocomm/protocomm_console.h b/tools/sdk/include/protocomm/protocomm_console.h deleted file mode 100644 index 767bcd7ca01..00000000000 --- a/tools/sdk/include/protocomm/protocomm_console.h +++ /dev/null @@ -1,67 +0,0 @@ -// 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. - -#pragma once - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define PROTOCOMM_CONSOLE_DEFAULT_CONFIG() { \ - .stack_size = 4096, \ - .task_priority = tskIDLE_PRIORITY + 3, \ -} - -/** - * @brief Config parameters for protocomm console - */ -typedef struct { - size_t stack_size; /*!< Stack size of console task */ - unsigned task_priority; /*!< Priority of console task */ -} protocomm_console_config_t; - -/** - * @brief Start console based protocomm transport - * - * @note This is a singleton. ie. Protocomm can have multiple instances, but only - * one instance can be bound to a console based transport layer. - * - * @param[in] pc Protocomm instance pointer obtained from protocomm_new() - * @param[in] config Config param structure for protocomm console - * - * @return - * - ESP_OK : Success - * - ESP_ERR_INVALID_ARG : Null arguments - * - ESP_ERR_NOT_SUPPORTED : Transport layer bound to another protocomm instance - * - ESP_ERR_INVALID_STATE : Transport layer already bound to this protocomm instance - * - ESP_FAIL : Failed to start console thread - */ -esp_err_t protocomm_console_start(protocomm_t *pc, const protocomm_console_config_t *config); - -/** - * @brief Stop console protocomm transport - * - * @param[in] pc Same protocomm instance that was passed to protocomm_console_start() - * - * @return - * - ESP_OK : Success - * - ESP_ERR_INVALID_ARG : Null / incorrect protocomm instance pointer - */ -esp_err_t protocomm_console_stop(protocomm_t *pc); - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/protocomm/protocomm_httpd.h b/tools/sdk/include/protocomm/protocomm_httpd.h deleted file mode 100644 index 2baf7545512..00000000000 --- a/tools/sdk/include/protocomm/protocomm_httpd.h +++ /dev/null @@ -1,107 +0,0 @@ -// 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. - -#pragma once - -#include - -#define PROTOCOMM_HTTPD_DEFAULT_CONFIG() { \ - .port = 80, \ - .stack_size = 4096, \ - .task_priority = tskIDLE_PRIORITY + 5, \ -} - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Config parameters for protocomm HTTP server - */ -typedef struct { - - uint16_t port; /*!< Port on which the HTTP server will listen */ - - /** - * Stack size of server task, adjusted depending - * upon stack usage of endpoint handler - */ - size_t stack_size; - unsigned task_priority; /*!< Priority of server task */ -} protocomm_http_server_config_t; /*!< HTTP Server Configuration, if HTTP Server has not been started already */ - -/** Protocomm HTTPD Configuration Data - */ -typedef union { - /** HTTP Server Handle, if ext_handle_provided is set to true - */ - void *handle; - - /** HTTP Server Configuration, if a server is not already active - */ - protocomm_http_server_config_t config; -} protocomm_httpd_config_data_t; - -/** - * @brief Config parameters for protocomm HTTP server - */ -typedef struct { - /** Flag to indicate of an external HTTP Server Handle has been provided. - * In such as case, protocomm will use the same HTTP Server and not start - * a new one internally. - */ - bool ext_handle_provided; - /** Protocomm HTTPD Configuration Data */ - protocomm_httpd_config_data_t data; -} protocomm_httpd_config_t; - -/** - * @brief Start HTTPD protocomm transport - * - * This API internally creates a framework to allow endpoint registration and security - * configuration for the protocomm. - * - * @note This is a singleton. ie. Protocomm can have multiple instances, but only - * one instance can be bound to an HTTP transport layer. - * - * @param[in] pc Protocomm instance pointer obtained from protocomm_new() - * @param[in] config Pointer to config structure for initializing HTTP server - * - * @return - * - ESP_OK : Success - * - ESP_ERR_INVALID_ARG : Null arguments - * - ESP_ERR_NOT_SUPPORTED : Transport layer bound to another protocomm instance - * - ESP_ERR_INVALID_STATE : Transport layer already bound to this protocomm instance - * - ESP_ERR_NO_MEM : Memory allocation for server resource failed - * - ESP_ERR_HTTPD_* : HTTP server error on start - */ -esp_err_t protocomm_httpd_start(protocomm_t *pc, const protocomm_httpd_config_t *config); - -/** - * @brief Stop HTTPD protocomm transport - * - * This API cleans up the HTTPD transport protocomm and frees all the handlers registered - * with the protocomm. - * - * @param[in] pc Same protocomm instance that was passed to protocomm_httpd_start() - * - * @return - * - ESP_OK : Success - * - ESP_ERR_INVALID_ARG : Null / incorrect protocomm instance pointer - */ -esp_err_t protocomm_httpd_stop(protocomm_t *pc); - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/protocomm/protocomm_security.h b/tools/sdk/include/protocomm/protocomm_security.h deleted file mode 100644 index 28f43a65742..00000000000 --- a/tools/sdk/include/protocomm/protocomm_security.h +++ /dev/null @@ -1,101 +0,0 @@ -// 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. - -#pragma once - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Proof Of Possession for authenticating a secure session - */ -typedef struct protocomm_security_pop { - /** - * Pointer to buffer containing the proof of possession data - */ - const uint8_t *data; - - /** - * Length (in bytes) of the proof of possession data - */ - uint16_t len; -} protocomm_security_pop_t; - -/** - * @brief Protocomm security object structure. - * - * The member functions are used for implementing secure - * protocomm sessions. - * - * @note This structure should not have any dynamic - * members to allow re-entrancy - */ -typedef struct protocomm_security { - /** - * Unique version number of security implementation - */ - int ver; - - /** - * Function for initializing/allocating security - * infrastructure - */ - esp_err_t (*init)(); - - /** - * Function for deallocating security infrastructure - */ - esp_err_t (*cleanup)(); - - /** - * Starts new secure transport session with specified ID - */ - esp_err_t (*new_transport_session)(uint32_t session_id); - - /** - * Closes a secure transport session with specified ID - */ - esp_err_t (*close_transport_session)(uint32_t session_id); - - /** - * Handler function for authenticating connection - * request and establishing secure session - */ - esp_err_t (*security_req_handler)(const protocomm_security_pop_t *pop, - uint32_t session_id, - const uint8_t *inbuf, ssize_t inlen, - uint8_t **outbuf, ssize_t *outlen, - void *priv_data); - - /** - * Function which implements the encryption algorithm - */ - esp_err_t (*encrypt)(uint32_t session_id, - const uint8_t *inbuf, ssize_t inlen, - uint8_t *outbuf, ssize_t *outlen); - - /** - * Function which implements the decryption algorithm - */ - esp_err_t (*decrypt)(uint32_t session_id, - const uint8_t *inbuf, ssize_t inlen, - uint8_t *outbuf, ssize_t *outlen); -} protocomm_security_t; - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/protocomm/protocomm_security0.h b/tools/sdk/include/protocomm/protocomm_security0.h deleted file mode 100644 index 9ae8744d470..00000000000 --- a/tools/sdk/include/protocomm/protocomm_security0.h +++ /dev/null @@ -1,33 +0,0 @@ -// 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. - -#pragma once - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Protocomm security version 0 implementation - * - * This is a simple implementation to be used when no - * security is required for the protocomm instance - */ -extern const protocomm_security_t protocomm_security0; - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/protocomm/protocomm_security1.h b/tools/sdk/include/protocomm/protocomm_security1.h deleted file mode 100644 index 12a05c322aa..00000000000 --- a/tools/sdk/include/protocomm/protocomm_security1.h +++ /dev/null @@ -1,33 +0,0 @@ -// 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. - -#pragma once - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Protocomm security version 1 implementation - * - * This is a full fledged security implementation using - * Curve25519 key exchange and AES-256-CTR encryption - */ -extern const protocomm_security_t protocomm_security1; - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/pthread/esp_pthread.h b/tools/sdk/include/pthread/esp_pthread.h deleted file mode 100644 index 3ce3703dccb..00000000000 --- a/tools/sdk/include/pthread/esp_pthread.h +++ /dev/null @@ -1,73 +0,0 @@ -// 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. - -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef PTHREAD_STACK_MIN -#define PTHREAD_STACK_MIN CONFIG_PTHREAD_STACK_MIN -#endif - -/** pthread configuration structure that influences pthread creation */ -typedef struct { - size_t stack_size; ///< the stack size of the pthread - size_t prio; ///< the thread's priority - bool inherit_cfg; ///< inherit this configuration further -} esp_pthread_cfg_t; - -/** - * @brief Configure parameters for creating pthread - * - * This API allows you to configure how the subsequent - * pthread_create() call will behave. This call can be used to setup - * configuration parameters like stack size, priority, configuration - * inheritance etc. - * - * If the 'inherit' flag in the configuration structure is enabled, - * then the same configuration is also inherited in the thread - * subtree. - * - * @note Passing non-NULL attributes to pthread_create() will override - * the stack_size parameter set using this API - * - * @param cfg The pthread config parameters - * - * @return - * - ESP_OK if configuration was successfully set - * - ESP_ERR_NO_MEM if out of memory - * - ESP_ERR_INVALID_ARG if stack_size is less than PTHREAD_STACK_MIN - */ -esp_err_t esp_pthread_set_cfg(const esp_pthread_cfg_t *cfg); - -/** - * @brief Get current pthread creation configuration - * - * This will retrieve the current configuration that will be used for - * creating threads. - * - * @param p Pointer to the pthread config structure that will be - * updated with the currently configured parameters - * - * @return - * - ESP_OK if the configuration was available - * - ESP_ERR_NOT_FOUND if a configuration wasn't previously set - */ -esp_err_t esp_pthread_get_cfg(esp_pthread_cfg_t *p); - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/sdmmc/sdmmc_cmd.h b/tools/sdk/include/sdmmc/sdmmc_cmd.h deleted file mode 100644 index aa12a4477a4..00000000000 --- a/tools/sdk/include/sdmmc/sdmmc_cmd.h +++ /dev/null @@ -1,225 +0,0 @@ -// 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. - -#pragma once - -#include -#include "esp_err.h" -#include "driver/sdmmc_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Probe and initialize SD/MMC card using given host - * - * @note Only SD cards (SDSC and SDHC/SDXC) are supported now. - * Support for MMC/eMMC cards will be added later. - * - * @param host pointer to structure defining host controller - * @param out_card pointer to structure which will receive information - * about the card when the function completes - * @return - * - ESP_OK on success - * - One of the error codes from SDMMC host controller - */ -esp_err_t sdmmc_card_init(const sdmmc_host_t* host, - sdmmc_card_t* out_card); - -/** - * @brief Print information about the card to a stream - * @param stream stream obtained using fopen or fdopen - * @param card card information structure initialized using sdmmc_card_init - */ -void sdmmc_card_print_info(FILE* stream, const sdmmc_card_t* card); - -/** - * Write given number of sectors to SD/MMC card - * - * @param card pointer to card information structure previously initialized - * using sdmmc_card_init - * @param src pointer to data buffer to read data from; data size must be - * equal to sector_count * card->csd.sector_size - * @param start_sector sector where to start writing - * @param sector_count number of sectors to write - * @return - * - ESP_OK on success - * - One of the error codes from SDMMC host controller - */ -esp_err_t sdmmc_write_sectors(sdmmc_card_t* card, const void* src, - size_t start_sector, size_t sector_count); - -/** - * Write given number of sectors to SD/MMC card - * - * @param card pointer to card information structure previously initialized - * using sdmmc_card_init - * @param dst pointer to data buffer to write into; buffer size must be - * at least sector_count * card->csd.sector_size - * @param start_sector sector where to start reading - * @param sector_count number of sectors to read - * @return - * - ESP_OK on success - * - One of the error codes from SDMMC host controller - */ -esp_err_t sdmmc_read_sectors(sdmmc_card_t* card, void* dst, - size_t start_sector, size_t sector_count); - -/** - * Read one byte from an SDIO card using IO_RW_DIRECT (CMD52) - * - * @param card pointer to card information structure previously initialized - * using sdmmc_card_init - * @param function IO function number - * @param reg byte address within IO function - * @param[out] out_byte output, receives the value read from the card - * @return - * - ESP_OK on success - * - One of the error codes from SDMMC host controller - */ -esp_err_t sdmmc_io_read_byte(sdmmc_card_t* card, uint32_t function, - uint32_t reg, uint8_t *out_byte); - -/** - * Write one byte to an SDIO card using IO_RW_DIRECT (CMD52) - * - * @param card pointer to card information structure previously initialized - * using sdmmc_card_init - * @param function IO function number - * @param reg byte address within IO function - * @param in_byte value to be written - * @param[out] out_byte if not NULL, receives new byte value read - * from the card (read-after-write). - * @return - * - ESP_OK on success - * - One of the error codes from SDMMC host controller - */ -esp_err_t sdmmc_io_write_byte(sdmmc_card_t* card, uint32_t function, - uint32_t reg, uint8_t in_byte, uint8_t* out_byte); - -/** - * Read multiple bytes from an SDIO card using IO_RW_EXTENDED (CMD53) - * - * This function performs read operation using CMD53 in byte mode. - * For block mode, see sdmmc_io_read_blocks. - * - * @param card pointer to card information structure previously initialized - * using sdmmc_card_init - * @param function IO function number - * @param addr byte address within IO function where reading starts - * @param dst buffer which receives the data read from card - * @param size number of bytes to read - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_SIZE if size exceeds 512 bytes - * - One of the error codes from SDMMC host controller - */ -esp_err_t sdmmc_io_read_bytes(sdmmc_card_t* card, uint32_t function, - uint32_t addr, void* dst, size_t size); - -/** - * Write multiple bytes to an SDIO card using IO_RW_EXTENDED (CMD53) - * - * This function performs write operation using CMD53 in byte mode. - * For block mode, see sdmmc_io_write_blocks. - * - * @param card pointer to card information structure previously initialized - * using sdmmc_card_init - * @param function IO function number - * @param addr byte address within IO function where writing starts - * @param src data to be written - * @param size number of bytes to write - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_SIZE if size exceeds 512 bytes - * - One of the error codes from SDMMC host controller - */ -esp_err_t sdmmc_io_write_bytes(sdmmc_card_t* card, uint32_t function, - uint32_t addr, const void* src, size_t size); - -/** - * Read blocks of data from an SDIO card using IO_RW_EXTENDED (CMD53) - * - * This function performs read operation using CMD53 in block mode. - * For byte mode, see sdmmc_io_read_bytes. - * - * @param card pointer to card information structure previously initialized - * using sdmmc_card_init - * @param function IO function number - * @param addr byte address within IO function where writing starts - * @param dst buffer which receives the data read from card - * @param size number of bytes to read, must be divisible by the card block - * size. - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_SIZE if size is not divisible by 512 bytes - * - One of the error codes from SDMMC host controller - */ -esp_err_t sdmmc_io_read_blocks(sdmmc_card_t* card, uint32_t function, - uint32_t addr, void* dst, size_t size); - -/** - * Write blocks of data to an SDIO card using IO_RW_EXTENDED (CMD53) - * - * This function performs write operation using CMD53 in block mode. - * For byte mode, see sdmmc_io_write_bytes. - * - * @param card pointer to card information structure previously initialized - * using sdmmc_card_init - * @param function IO function number - * @param addr byte address within IO function where writing starts - * @param src data to be written - * @param size number of bytes to read, must be divisible by the card block - * size. - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_SIZE if size is not divisible by 512 bytes - * - One of the error codes from SDMMC host controller - */ -esp_err_t sdmmc_io_write_blocks(sdmmc_card_t* card, uint32_t function, - uint32_t addr, const void* src, size_t size); - -/** - * Enable SDIO interrupt in the SDMMC host - * - * @param card pointer to card information structure previously initialized - * using sdmmc_card_init - * @return - * - ESP_OK on success - * - ESP_ERR_NOT_SUPPORTED if the host controller does not support - * IO interrupts - */ -esp_err_t sdmmc_io_enable_int(sdmmc_card_t* card); - -/** - * Block until an SDIO interrupt is received - * - * Slave uses D1 line to signal interrupt condition to the host. - * This function can be used to wait for the interrupt. - * - * @param card pointer to card information structure previously initialized - * using sdmmc_card_init - * @param timeout_ticks time to wait for the interrupt, in RTOS ticks - * @return - * - ESP_OK if the interrupt is received - * - ESP_ERR_NOT_SUPPORTED if the host controller does not support - * IO interrupts - * - ESP_ERR_TIMEOUT if the interrupt does not happen in timeout_ticks - */ -esp_err_t sdmmc_io_wait_int(sdmmc_card_t* card, TickType_t timeout_ticks); - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/smartconfig_ack/smartconfig_ack.h b/tools/sdk/include/smartconfig_ack/smartconfig_ack.h deleted file mode 100644 index be49fd3bd13..00000000000 --- a/tools/sdk/include/smartconfig_ack/smartconfig_ack.h +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2010-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. - -#ifndef SMARTCONFIG_ACK_H -#define SMARTCONFIG_ACK_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define SC_ACK_TASK_PRIORITY 2 /*!< Priority of sending smartconfig ACK task */ -#define SC_ACK_TASK_STACK_SIZE 2048 /*!< Stack size of sending smartconfig ACK task */ - -#define SC_ACK_TOUCH_SERVER_PORT 18266 /*!< ESP touch UDP port of server on cellphone */ -#define SC_ACK_AIRKISS_SERVER_PORT 10000 /*!< Airkiss UDP port of server on cellphone */ - -#define SC_ACK_TOUCH_LEN 11 /*!< Length of ESP touch ACK context */ -#define SC_ACK_AIRKISS_LEN 7 /*!< Length of Airkiss ACK context */ - -#define SC_ACK_MAX_COUNT 30 /*!< Maximum count of sending smartconfig ACK */ - -/** - * @brief Smartconfig ACK type. - */ -typedef enum { - SC_ACK_TYPE_ESPTOUCH = 0, /*!< ESP touch ACK type */ - SC_ACK_TYPE_AIRKISS, /*!< Airkiss ACK type */ -} sc_ack_type_t; - -/** - * @brief Smartconfig parameters passed to sc_ack_send call. - */ -typedef struct sc_ack { - sc_ack_type_t type; /*!< Smartconfig ACK type */ - uint8_t *link_flag; /*!< Smartconfig link flag */ - sc_callback_t cb; /*!< Smartconfig callback function */ - struct { - uint8_t token; /*!< Smartconfig token to be sent */ - uint8_t mac[6]; /*!< MAC address of station */ - uint8_t ip[4]; /*!< IP address of cellphone */ - } ctx; -} sc_ack_t; - -/** - * @brief Send smartconfig ACK to cellphone. - * - * @attention The API is only used in libsmartconfig.a. - * - * @param param: smartconfig parameters; - */ -void sc_ack_send(sc_ack_t *param); - -/** - * @brief Stop sending smartconfig ACK to cellphone. - * - * @attention The API is only used in libsmartconfig.a. - */ -void sc_ack_send_stop(void); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/tools/sdk/include/soc/soc/adc_channel.h b/tools/sdk/include/soc/soc/adc_channel.h deleted file mode 100644 index e8835d35f8f..00000000000 --- a/tools/sdk/include/soc/soc/adc_channel.h +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2010-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. - -#ifndef _SOC_ADC_CHANNEL_H -#define _SOC_ADC_CHANNEL_H - -#define ADC1_GPIO36_CHANNEL ADC1_CHANNEL_0 -#define ADC1_CHANNEL_0_GPIO_NUM 36 - -#define ADC1_GPIO37_CHANNEL ADC1_CHANNEL_1 -#define ADC1_CHANNEL_1_GPIO_NUM 37 - -#define ADC1_GPIO38_CHANNEL ADC1_CHANNEL_2 -#define ADC1_CHANNEL_2_GPIO_NUM 38 - -#define ADC1_GPIO39_CHANNEL ADC1_CHANNEL_3 -#define ADC1_CHANNEL_3_GPIO_NUM 39 - -#define ADC1_GPIO32_CHANNEL ADC1_CHANNEL_4 -#define ADC1_CHANNEL_4_GPIO_NUM 32 - -#define ADC1_GPIO33_CHANNEL ADC1_CHANNEL_5 -#define ADC1_CHANNEL_5_GPIO_NUM 33 - -#define ADC1_GPIO34_CHANNEL ADC1_CHANNEL_6 -#define ADC1_CHANNEL_6_GPIO_NUM 34 - -#define ADC1_GPIO35_CHANNEL ADC1_CHANNEL_7 -#define ADC1_CHANNEL_7_GPIO_NUM 35 - -#define ADC2_GPIO4_CHANNEL ADC2_CHANNEL_0 -#define ADC2_CHANNEL_0_GPIO_NUM 4 - -#define ADC2_GPIO0_CHANNEL ADC2_CHANNEL_1 -#define ADC2_CHANNEL_1_GPIO_NUM 0 - -#define ADC2_GPIO2_CHANNEL ADC2_CHANNEL_2 -#define ADC2_CHANNEL_2_GPIO_NUM 2 - -#define ADC2_GPIO15_CHANNEL ADC2_CHANNEL_3 -#define ADC2_CHANNEL_3_GPIO_NUM 15 - -#define ADC2_GPIO13_CHANNEL ADC2_CHANNEL_4 -#define ADC2_CHANNEL_4_GPIO_NUM 13 - -#define ADC2_GPIO12_CHANNEL ADC2_CHANNEL_5 -#define ADC2_CHANNEL_5_GPIO_NUM 12 - -#define ADC2_GPIO14_CHANNEL ADC2_CHANNEL_6 -#define ADC2_CHANNEL_6_GPIO_NUM 14 - -#define ADC2_GPIO27_CHANNEL ADC2_CHANNEL_7 -#define ADC2_CHANNEL_7_GPIO_NUM 27 - -#define ADC2_GPIO25_CHANNEL ADC2_CHANNEL_8 -#define ADC2_CHANNEL_8_GPIO_NUM 25 - -#define ADC2_GPIO26_CHANNEL ADC2_CHANNEL_9 -#define ADC2_CHANNEL_9_GPIO_NUM 26 - -#endif diff --git a/tools/sdk/include/soc/soc/apb_ctrl_reg.h b/tools/sdk/include/soc/soc/apb_ctrl_reg.h deleted file mode 100644 index 2e5ea54c4c7..00000000000 --- a/tools/sdk/include/soc/soc/apb_ctrl_reg.h +++ /dev/null @@ -1,294 +0,0 @@ -// 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. -#ifndef _SOC_APB_CTRL_REG_H_ -#define _SOC_APB_CTRL_REG_H_ - -#include "soc.h" -#define APB_CTRL_SYSCLK_CONF_REG (DR_REG_APB_CTRL_BASE + 0x0) -/* APB_CTRL_QUICK_CLK_CHNG : R/W ;bitpos:[13] ;default: 1'b1 ; */ -/*description: */ -#define APB_CTRL_QUICK_CLK_CHNG (BIT(13)) -#define APB_CTRL_QUICK_CLK_CHNG_M (BIT(13)) -#define APB_CTRL_QUICK_CLK_CHNG_V 0x1 -#define APB_CTRL_QUICK_CLK_CHNG_S 13 -/* APB_CTRL_RST_TICK_CNT : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define APB_CTRL_RST_TICK_CNT (BIT(12)) -#define APB_CTRL_RST_TICK_CNT_M (BIT(12)) -#define APB_CTRL_RST_TICK_CNT_V 0x1 -#define APB_CTRL_RST_TICK_CNT_S 12 -/* APB_CTRL_CLK_EN : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define APB_CTRL_CLK_EN (BIT(11)) -#define APB_CTRL_CLK_EN_M (BIT(11)) -#define APB_CTRL_CLK_EN_V 0x1 -#define APB_CTRL_CLK_EN_S 11 -/* APB_CTRL_CLK_320M_EN : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define APB_CTRL_CLK_320M_EN (BIT(10)) -#define APB_CTRL_CLK_320M_EN_M (BIT(10)) -#define APB_CTRL_CLK_320M_EN_V 0x1 -#define APB_CTRL_CLK_320M_EN_S 10 -/* APB_CTRL_PRE_DIV_CNT : R/W ;bitpos:[9:0] ;default: 10'h0 ; */ -/*description: */ -#define APB_CTRL_PRE_DIV_CNT 0x000003FF -#define APB_CTRL_PRE_DIV_CNT_M ((APB_CTRL_PRE_DIV_CNT_V)<<(APB_CTRL_PRE_DIV_CNT_S)) -#define APB_CTRL_PRE_DIV_CNT_V 0x3FF -#define APB_CTRL_PRE_DIV_CNT_S 0 - -#define APB_CTRL_XTAL_TICK_CONF_REG (DR_REG_APB_CTRL_BASE + 0x4) -/* APB_CTRL_XTAL_TICK_NUM : R/W ;bitpos:[7:0] ;default: 8'd39 ; */ -/*description: */ -#define APB_CTRL_XTAL_TICK_NUM 0x000000FF -#define APB_CTRL_XTAL_TICK_NUM_M ((APB_CTRL_XTAL_TICK_NUM_V)<<(APB_CTRL_XTAL_TICK_NUM_S)) -#define APB_CTRL_XTAL_TICK_NUM_V 0xFF -#define APB_CTRL_XTAL_TICK_NUM_S 0 - -#define APB_CTRL_PLL_TICK_CONF_REG (DR_REG_APB_CTRL_BASE + 0x8) -/* APB_CTRL_PLL_TICK_NUM : R/W ;bitpos:[7:0] ;default: 8'd79 ; */ -/*description: */ -#define APB_CTRL_PLL_TICK_NUM 0x000000FF -#define APB_CTRL_PLL_TICK_NUM_M ((APB_CTRL_PLL_TICK_NUM_V)<<(APB_CTRL_PLL_TICK_NUM_S)) -#define APB_CTRL_PLL_TICK_NUM_V 0xFF -#define APB_CTRL_PLL_TICK_NUM_S 0 - -#define APB_CTRL_CK8M_TICK_CONF_REG (DR_REG_APB_CTRL_BASE + 0xC) -/* APB_CTRL_CK8M_TICK_NUM : R/W ;bitpos:[7:0] ;default: 8'd11 ; */ -/*description: */ -#define APB_CTRL_CK8M_TICK_NUM 0x000000FF -#define APB_CTRL_CK8M_TICK_NUM_M ((APB_CTRL_CK8M_TICK_NUM_V)<<(APB_CTRL_CK8M_TICK_NUM_S)) -#define APB_CTRL_CK8M_TICK_NUM_V 0xFF -#define APB_CTRL_CK8M_TICK_NUM_S 0 - -#define APB_CTRL_APB_SARADC_CTRL_REG (DR_REG_APB_CTRL_BASE + 0x10) -/* APB_CTRL_SARADC_DATA_TO_I2S : R/W ;bitpos:[26] ;default: 1'b0 ; */ -/*description: 1: I2S input data is from SAR ADC (for DMA) 0: I2S input data - is from GPIO matrix*/ -#define APB_CTRL_SARADC_DATA_TO_I2S (BIT(26)) -#define APB_CTRL_SARADC_DATA_TO_I2S_M (BIT(26)) -#define APB_CTRL_SARADC_DATA_TO_I2S_V 0x1 -#define APB_CTRL_SARADC_DATA_TO_I2S_S 26 -/* APB_CTRL_SARADC_DATA_SAR_SEL : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: 1: sar_sel will be coded by the MSB of the 16-bit output data - in this case the resolution should not be larger than 11 bits.*/ -#define APB_CTRL_SARADC_DATA_SAR_SEL (BIT(25)) -#define APB_CTRL_SARADC_DATA_SAR_SEL_M (BIT(25)) -#define APB_CTRL_SARADC_DATA_SAR_SEL_V 0x1 -#define APB_CTRL_SARADC_DATA_SAR_SEL_S 25 -/* APB_CTRL_SARADC_SAR2_PATT_P_CLEAR : R/W ;bitpos:[24] ;default: 1'd0 ; */ -/*description: clear the pointer of pattern table for DIG ADC2 CTRL*/ -#define APB_CTRL_SARADC_SAR2_PATT_P_CLEAR (BIT(24)) -#define APB_CTRL_SARADC_SAR2_PATT_P_CLEAR_M (BIT(24)) -#define APB_CTRL_SARADC_SAR2_PATT_P_CLEAR_V 0x1 -#define APB_CTRL_SARADC_SAR2_PATT_P_CLEAR_S 24 -/* APB_CTRL_SARADC_SAR1_PATT_P_CLEAR : R/W ;bitpos:[23] ;default: 1'd0 ; */ -/*description: clear the pointer of pattern table for DIG ADC1 CTRL*/ -#define APB_CTRL_SARADC_SAR1_PATT_P_CLEAR (BIT(23)) -#define APB_CTRL_SARADC_SAR1_PATT_P_CLEAR_M (BIT(23)) -#define APB_CTRL_SARADC_SAR1_PATT_P_CLEAR_V 0x1 -#define APB_CTRL_SARADC_SAR1_PATT_P_CLEAR_S 23 -/* APB_CTRL_SARADC_SAR2_PATT_LEN : R/W ;bitpos:[22:19] ;default: 4'd15 ; */ -/*description: 0 ~ 15 means length 1 ~ 16*/ -#define APB_CTRL_SARADC_SAR2_PATT_LEN 0x0000000F -#define APB_CTRL_SARADC_SAR2_PATT_LEN_M ((APB_CTRL_SARADC_SAR2_PATT_LEN_V)<<(APB_CTRL_SARADC_SAR2_PATT_LEN_S)) -#define APB_CTRL_SARADC_SAR2_PATT_LEN_V 0xF -#define APB_CTRL_SARADC_SAR2_PATT_LEN_S 19 -/* APB_CTRL_SARADC_SAR1_PATT_LEN : R/W ;bitpos:[18:15] ;default: 4'd15 ; */ -/*description: 0 ~ 15 means length 1 ~ 16*/ -#define APB_CTRL_SARADC_SAR1_PATT_LEN 0x0000000F -#define APB_CTRL_SARADC_SAR1_PATT_LEN_M ((APB_CTRL_SARADC_SAR1_PATT_LEN_V)<<(APB_CTRL_SARADC_SAR1_PATT_LEN_S)) -#define APB_CTRL_SARADC_SAR1_PATT_LEN_V 0xF -#define APB_CTRL_SARADC_SAR1_PATT_LEN_S 15 -/* APB_CTRL_SARADC_SAR_CLK_DIV : R/W ;bitpos:[14:7] ;default: 8'd4 ; */ -/*description: SAR clock divider*/ -#define APB_CTRL_SARADC_SAR_CLK_DIV 0x000000FF -#define APB_CTRL_SARADC_SAR_CLK_DIV_M ((APB_CTRL_SARADC_SAR_CLK_DIV_V)<<(APB_CTRL_SARADC_SAR_CLK_DIV_S)) -#define APB_CTRL_SARADC_SAR_CLK_DIV_V 0xFF -#define APB_CTRL_SARADC_SAR_CLK_DIV_S 7 -/* APB_CTRL_SARADC_SAR_CLK_GATED : R/W ;bitpos:[6] ;default: 1'b1 ; */ -/*description: */ -#define APB_CTRL_SARADC_SAR_CLK_GATED (BIT(6)) -#define APB_CTRL_SARADC_SAR_CLK_GATED_M (BIT(6)) -#define APB_CTRL_SARADC_SAR_CLK_GATED_V 0x1 -#define APB_CTRL_SARADC_SAR_CLK_GATED_S 6 -/* APB_CTRL_SARADC_SAR_SEL : R/W ;bitpos:[5] ;default: 1'd0 ; */ -/*description: 0: SAR1 1: SAR2 only work for single SAR mode*/ -#define APB_CTRL_SARADC_SAR_SEL (BIT(5)) -#define APB_CTRL_SARADC_SAR_SEL_M (BIT(5)) -#define APB_CTRL_SARADC_SAR_SEL_V 0x1 -#define APB_CTRL_SARADC_SAR_SEL_S 5 -/* APB_CTRL_SARADC_WORK_MODE : R/W ;bitpos:[4:3] ;default: 2'd0 ; */ -/*description: 0: single mode 1: double mode 2: alternate mode*/ -#define APB_CTRL_SARADC_WORK_MODE 0x00000003 -#define APB_CTRL_SARADC_WORK_MODE_M ((APB_CTRL_SARADC_WORK_MODE_V)<<(APB_CTRL_SARADC_WORK_MODE_S)) -#define APB_CTRL_SARADC_WORK_MODE_V 0x3 -#define APB_CTRL_SARADC_WORK_MODE_S 3 -/* APB_CTRL_SARADC_SAR2_MUX : R/W ;bitpos:[2] ;default: 1'd0 ; */ -/*description: 1: SAR ADC2 is controlled by DIG ADC2 CTRL 0: SAR ADC2 is controlled - by PWDET CTRL*/ -#define APB_CTRL_SARADC_SAR2_MUX (BIT(2)) -#define APB_CTRL_SARADC_SAR2_MUX_M (BIT(2)) -#define APB_CTRL_SARADC_SAR2_MUX_V 0x1 -#define APB_CTRL_SARADC_SAR2_MUX_S 2 -/* APB_CTRL_SARADC_START : R/W ;bitpos:[1] ;default: 1'd0 ; */ -/*description: */ -#define APB_CTRL_SARADC_START (BIT(1)) -#define APB_CTRL_SARADC_START_M (BIT(1)) -#define APB_CTRL_SARADC_START_V 0x1 -#define APB_CTRL_SARADC_START_S 1 -/* APB_CTRL_SARADC_START_FORCE : R/W ;bitpos:[0] ;default: 1'd0 ; */ -/*description: */ -#define APB_CTRL_SARADC_START_FORCE (BIT(0)) -#define APB_CTRL_SARADC_START_FORCE_M (BIT(0)) -#define APB_CTRL_SARADC_START_FORCE_V 0x1 -#define APB_CTRL_SARADC_START_FORCE_S 0 - -#define APB_CTRL_APB_SARADC_CTRL2_REG (DR_REG_APB_CTRL_BASE + 0x14) -/* APB_CTRL_SARADC_SAR2_INV : R/W ;bitpos:[10] ;default: 1'd0 ; */ -/*description: 1: data to DIG ADC2 CTRL is inverted otherwise not*/ -#define APB_CTRL_SARADC_SAR2_INV (BIT(10)) -#define APB_CTRL_SARADC_SAR2_INV_M (BIT(10)) -#define APB_CTRL_SARADC_SAR2_INV_V 0x1 -#define APB_CTRL_SARADC_SAR2_INV_S 10 -/* APB_CTRL_SARADC_SAR1_INV : R/W ;bitpos:[9] ;default: 1'd0 ; */ -/*description: 1: data to DIG ADC1 CTRL is inverted otherwise not*/ -#define APB_CTRL_SARADC_SAR1_INV (BIT(9)) -#define APB_CTRL_SARADC_SAR1_INV_M (BIT(9)) -#define APB_CTRL_SARADC_SAR1_INV_V 0x1 -#define APB_CTRL_SARADC_SAR1_INV_S 9 -/* APB_CTRL_SARADC_MAX_MEAS_NUM : R/W ;bitpos:[8:1] ;default: 8'd255 ; */ -/*description: max conversion number*/ -#define APB_CTRL_SARADC_MAX_MEAS_NUM 0x000000FF -#define APB_CTRL_SARADC_MAX_MEAS_NUM_M ((APB_CTRL_SARADC_MAX_MEAS_NUM_V)<<(APB_CTRL_SARADC_MAX_MEAS_NUM_S)) -#define APB_CTRL_SARADC_MAX_MEAS_NUM_V 0xFF -#define APB_CTRL_SARADC_MAX_MEAS_NUM_S 1 -/* APB_CTRL_SARADC_MEAS_NUM_LIMIT : R/W ;bitpos:[0] ;default: 1'd0 ; */ -/*description: */ -#define APB_CTRL_SARADC_MEAS_NUM_LIMIT (BIT(0)) -#define APB_CTRL_SARADC_MEAS_NUM_LIMIT_M (BIT(0)) -#define APB_CTRL_SARADC_MEAS_NUM_LIMIT_V 0x1 -#define APB_CTRL_SARADC_MEAS_NUM_LIMIT_S 0 - -#define APB_CTRL_APB_SARADC_FSM_REG (DR_REG_APB_CTRL_BASE + 0x18) -/* APB_CTRL_SARADC_SAMPLE_CYCLE : R/W ;bitpos:[31:24] ;default: 8'd2 ; */ -/*description: sample cycles*/ -#define APB_CTRL_SARADC_SAMPLE_CYCLE 0x000000FF -#define APB_CTRL_SARADC_SAMPLE_CYCLE_M ((APB_CTRL_SARADC_SAMPLE_CYCLE_V)<<(APB_CTRL_SARADC_SAMPLE_CYCLE_S)) -#define APB_CTRL_SARADC_SAMPLE_CYCLE_V 0xFF -#define APB_CTRL_SARADC_SAMPLE_CYCLE_S 24 -/* APB_CTRL_SARADC_START_WAIT : R/W ;bitpos:[23:16] ;default: 8'd8 ; */ -/*description: */ -#define APB_CTRL_SARADC_START_WAIT 0x000000FF -#define APB_CTRL_SARADC_START_WAIT_M ((APB_CTRL_SARADC_START_WAIT_V)<<(APB_CTRL_SARADC_START_WAIT_S)) -#define APB_CTRL_SARADC_START_WAIT_V 0xFF -#define APB_CTRL_SARADC_START_WAIT_S 16 -/* APB_CTRL_SARADC_STANDBY_WAIT : R/W ;bitpos:[15:8] ;default: 8'd255 ; */ -/*description: */ -#define APB_CTRL_SARADC_STANDBY_WAIT 0x000000FF -#define APB_CTRL_SARADC_STANDBY_WAIT_M ((APB_CTRL_SARADC_STANDBY_WAIT_V)<<(APB_CTRL_SARADC_STANDBY_WAIT_S)) -#define APB_CTRL_SARADC_STANDBY_WAIT_V 0xFF -#define APB_CTRL_SARADC_STANDBY_WAIT_S 8 -/* APB_CTRL_SARADC_RSTB_WAIT : R/W ;bitpos:[7:0] ;default: 8'd8 ; */ -/*description: */ -#define APB_CTRL_SARADC_RSTB_WAIT 0x000000FF -#define APB_CTRL_SARADC_RSTB_WAIT_M ((APB_CTRL_SARADC_RSTB_WAIT_V)<<(APB_CTRL_SARADC_RSTB_WAIT_S)) -#define APB_CTRL_SARADC_RSTB_WAIT_V 0xFF -#define APB_CTRL_SARADC_RSTB_WAIT_S 0 - -#define APB_CTRL_APB_SARADC_SAR1_PATT_TAB1_REG (DR_REG_APB_CTRL_BASE + 0x1C) -/* APB_CTRL_SARADC_SAR1_PATT_TAB1 : R/W ;bitpos:[31:0] ;default: 32'hf0f0f0f ; */ -/*description: item 0 ~ 3 for pattern table 1 (each item one byte)*/ -#define APB_CTRL_SARADC_SAR1_PATT_TAB1 0xFFFFFFFF -#define APB_CTRL_SARADC_SAR1_PATT_TAB1_M ((APB_CTRL_SARADC_SAR1_PATT_TAB1_V)<<(APB_CTRL_SARADC_SAR1_PATT_TAB1_S)) -#define APB_CTRL_SARADC_SAR1_PATT_TAB1_V 0xFFFFFFFF -#define APB_CTRL_SARADC_SAR1_PATT_TAB1_S 0 - -#define APB_CTRL_APB_SARADC_SAR1_PATT_TAB2_REG (DR_REG_APB_CTRL_BASE + 0x20) -/* APB_CTRL_SARADC_SAR1_PATT_TAB2 : R/W ;bitpos:[31:0] ;default: 32'hf0f0f0f ; */ -/*description: Item 4 ~ 7 for pattern table 1 (each item one byte)*/ -#define APB_CTRL_SARADC_SAR1_PATT_TAB2 0xFFFFFFFF -#define APB_CTRL_SARADC_SAR1_PATT_TAB2_M ((APB_CTRL_SARADC_SAR1_PATT_TAB2_V)<<(APB_CTRL_SARADC_SAR1_PATT_TAB2_S)) -#define APB_CTRL_SARADC_SAR1_PATT_TAB2_V 0xFFFFFFFF -#define APB_CTRL_SARADC_SAR1_PATT_TAB2_S 0 - -#define APB_CTRL_APB_SARADC_SAR1_PATT_TAB3_REG (DR_REG_APB_CTRL_BASE + 0x24) -/* APB_CTRL_SARADC_SAR1_PATT_TAB3 : R/W ;bitpos:[31:0] ;default: 32'hf0f0f0f ; */ -/*description: Item 8 ~ 11 for pattern table 1 (each item one byte)*/ -#define APB_CTRL_SARADC_SAR1_PATT_TAB3 0xFFFFFFFF -#define APB_CTRL_SARADC_SAR1_PATT_TAB3_M ((APB_CTRL_SARADC_SAR1_PATT_TAB3_V)<<(APB_CTRL_SARADC_SAR1_PATT_TAB3_S)) -#define APB_CTRL_SARADC_SAR1_PATT_TAB3_V 0xFFFFFFFF -#define APB_CTRL_SARADC_SAR1_PATT_TAB3_S 0 - -#define APB_CTRL_APB_SARADC_SAR1_PATT_TAB4_REG (DR_REG_APB_CTRL_BASE + 0x28) -/* APB_CTRL_SARADC_SAR1_PATT_TAB4 : R/W ;bitpos:[31:0] ;default: 32'hf0f0f0f ; */ -/*description: Item 12 ~ 15 for pattern table 1 (each item one byte)*/ -#define APB_CTRL_SARADC_SAR1_PATT_TAB4 0xFFFFFFFF -#define APB_CTRL_SARADC_SAR1_PATT_TAB4_M ((APB_CTRL_SARADC_SAR1_PATT_TAB4_V)<<(APB_CTRL_SARADC_SAR1_PATT_TAB4_S)) -#define APB_CTRL_SARADC_SAR1_PATT_TAB4_V 0xFFFFFFFF -#define APB_CTRL_SARADC_SAR1_PATT_TAB4_S 0 - -#define APB_CTRL_APB_SARADC_SAR2_PATT_TAB1_REG (DR_REG_APB_CTRL_BASE + 0x2C) -/* APB_CTRL_SARADC_SAR2_PATT_TAB1 : R/W ;bitpos:[31:0] ;default: 32'hf0f0f0f ; */ -/*description: item 0 ~ 3 for pattern table 2 (each item one byte)*/ -#define APB_CTRL_SARADC_SAR2_PATT_TAB1 0xFFFFFFFF -#define APB_CTRL_SARADC_SAR2_PATT_TAB1_M ((APB_CTRL_SARADC_SAR2_PATT_TAB1_V)<<(APB_CTRL_SARADC_SAR2_PATT_TAB1_S)) -#define APB_CTRL_SARADC_SAR2_PATT_TAB1_V 0xFFFFFFFF -#define APB_CTRL_SARADC_SAR2_PATT_TAB1_S 0 - -#define APB_CTRL_APB_SARADC_SAR2_PATT_TAB2_REG (DR_REG_APB_CTRL_BASE + 0x30) -/* APB_CTRL_SARADC_SAR2_PATT_TAB2 : R/W ;bitpos:[31:0] ;default: 32'hf0f0f0f ; */ -/*description: Item 4 ~ 7 for pattern table 2 (each item one byte)*/ -#define APB_CTRL_SARADC_SAR2_PATT_TAB2 0xFFFFFFFF -#define APB_CTRL_SARADC_SAR2_PATT_TAB2_M ((APB_CTRL_SARADC_SAR2_PATT_TAB2_V)<<(APB_CTRL_SARADC_SAR2_PATT_TAB2_S)) -#define APB_CTRL_SARADC_SAR2_PATT_TAB2_V 0xFFFFFFFF -#define APB_CTRL_SARADC_SAR2_PATT_TAB2_S 0 - -#define APB_CTRL_APB_SARADC_SAR2_PATT_TAB3_REG (DR_REG_APB_CTRL_BASE + 0x34) -/* APB_CTRL_SARADC_SAR2_PATT_TAB3 : R/W ;bitpos:[31:0] ;default: 32'hf0f0f0f ; */ -/*description: Item 8 ~ 11 for pattern table 2 (each item one byte)*/ -#define APB_CTRL_SARADC_SAR2_PATT_TAB3 0xFFFFFFFF -#define APB_CTRL_SARADC_SAR2_PATT_TAB3_M ((APB_CTRL_SARADC_SAR2_PATT_TAB3_V)<<(APB_CTRL_SARADC_SAR2_PATT_TAB3_S)) -#define APB_CTRL_SARADC_SAR2_PATT_TAB3_V 0xFFFFFFFF -#define APB_CTRL_SARADC_SAR2_PATT_TAB3_S 0 - -#define APB_CTRL_APB_SARADC_SAR2_PATT_TAB4_REG (DR_REG_APB_CTRL_BASE + 0x38) -/* APB_CTRL_SARADC_SAR2_PATT_TAB4 : R/W ;bitpos:[31:0] ;default: 32'hf0f0f0f ; */ -/*description: Item 12 ~ 15 for pattern table 2 (each item one byte)*/ -#define APB_CTRL_SARADC_SAR2_PATT_TAB4 0xFFFFFFFF -#define APB_CTRL_SARADC_SAR2_PATT_TAB4_M ((APB_CTRL_SARADC_SAR2_PATT_TAB4_V)<<(APB_CTRL_SARADC_SAR2_PATT_TAB4_S)) -#define APB_CTRL_SARADC_SAR2_PATT_TAB4_V 0xFFFFFFFF -#define APB_CTRL_SARADC_SAR2_PATT_TAB4_S 0 - -#define APB_CTRL_APLL_TICK_CONF_REG (DR_REG_APB_CTRL_BASE + 0x3C) -/* APB_CTRL_APLL_TICK_NUM : R/W ;bitpos:[7:0] ;default: 8'd99 ; */ -/*description: */ -#define APB_CTRL_APLL_TICK_NUM 0x000000FF -#define APB_CTRL_APLL_TICK_NUM_M ((APB_CTRL_APLL_TICK_NUM_V)<<(APB_CTRL_APLL_TICK_NUM_S)) -#define APB_CTRL_APLL_TICK_NUM_V 0xFF -#define APB_CTRL_APLL_TICK_NUM_S 0 - -#define APB_CTRL_DATE_REG (DR_REG_APB_CTRL_BASE + 0x7C) -/* APB_CTRL_DATE : R/W ;bitpos:[31:0] ;default: 32'h16042000 ; */ -/*description: */ -#define APB_CTRL_DATE 0xFFFFFFFF -#define APB_CTRL_DATE_M ((APB_CTRL_DATE_V)<<(APB_CTRL_DATE_S)) -#define APB_CTRL_DATE_V 0xFFFFFFFF -#define APB_CTRL_DATE_S 0 - - - - -#endif /*_SOC_APB_CTRL_REG_H_ */ - - diff --git a/tools/sdk/include/soc/soc/apb_ctrl_struct.h b/tools/sdk/include/soc/soc/apb_ctrl_struct.h deleted file mode 100644 index 0d8e49a42ed..00000000000 --- a/tools/sdk/include/soc/soc/apb_ctrl_struct.h +++ /dev/null @@ -1,130 +0,0 @@ -// 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. -#ifndef _SOC_APB_CTRL_STRUCT_H_ -#define _SOC_APB_CTRL_STRUCT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { - union { - struct { - volatile uint32_t pre_div: 10; - volatile uint32_t clk_320m_en: 1; - volatile uint32_t clk_en: 1; - volatile uint32_t rst_tick: 1; - volatile uint32_t quick_clk_chng: 1; - volatile uint32_t reserved14: 18; - }; - volatile uint32_t val; - }clk_conf; - union { - struct { - volatile uint32_t xtal_tick: 8; - volatile uint32_t reserved8: 24; - }; - volatile uint32_t val; - }xtal_tick_conf; - union { - struct { - volatile uint32_t pll_tick: 8; - volatile uint32_t reserved8: 24; - }; - volatile uint32_t val; - }pll_tick_conf; - union { - struct { - volatile uint32_t ck8m_tick: 8; - volatile uint32_t reserved8: 24; - }; - volatile uint32_t val; - }ck8m_tick_conf; - union { - struct { - volatile uint32_t start_force: 1; - volatile uint32_t start: 1; - volatile uint32_t sar2_mux: 1; /*1: SAR ADC2 is controlled by DIG ADC2 CTRL 0: SAR ADC2 is controlled by PWDET CTRL*/ - volatile uint32_t work_mode: 2; /*0: single mode 1: double mode 2: alternate mode*/ - volatile uint32_t sar_sel: 1; /*0: SAR1 1: SAR2 only work for single SAR mode*/ - volatile uint32_t sar_clk_gated: 1; - volatile uint32_t sar_clk_div: 8; /*SAR clock divider*/ - volatile uint32_t sar1_patt_len: 4; /*0 ~ 15 means length 1 ~ 16*/ - volatile uint32_t sar2_patt_len: 4; /*0 ~ 15 means length 1 ~ 16*/ - volatile uint32_t sar1_patt_p_clear: 1; /*clear the pointer of pattern table for DIG ADC1 CTRL*/ - volatile uint32_t sar2_patt_p_clear: 1; /*clear the pointer of pattern table for DIG ADC2 CTRL*/ - volatile uint32_t data_sar_sel: 1; /*1: sar_sel will be coded by the MSB of the 16-bit output data in this case the resolution should not be larger than 11 bits.*/ - volatile uint32_t data_to_i2s: 1; /*1: I2S input data is from SAR ADC (for DMA) 0: I2S input data is from GPIO matrix*/ - volatile uint32_t reserved27: 5; - }; - volatile uint32_t val; - }saradc_ctrl; - union { - struct { - volatile uint32_t meas_num_limit: 1; - volatile uint32_t max_meas_num: 8; /*max conversion number*/ - volatile uint32_t sar1_inv: 1; /*1: data to DIG ADC1 CTRL is inverted otherwise not*/ - volatile uint32_t sar2_inv: 1; /*1: data to DIG ADC2 CTRL is inverted otherwise not*/ - volatile uint32_t reserved11: 21; - }; - volatile uint32_t val; - }saradc_ctrl2; - union { - struct { - volatile uint32_t rstb_wait: 8; - volatile uint32_t standby_wait: 8; - volatile uint32_t start_wait: 8; - volatile uint32_t sample_cycle: 8; /*sample cycles*/ - }; - volatile uint32_t val; - }saradc_fsm; - volatile uint32_t saradc_sar1_patt_tab1; /*item 0 ~ 3 for pattern table 1 (each item one byte)*/ - volatile uint32_t saradc_sar1_patt_tab2; /*Item 4 ~ 7 for pattern table 1 (each item one byte)*/ - volatile uint32_t saradc_sar1_patt_tab3; /*Item 8 ~ 11 for pattern table 1 (each item one byte)*/ - volatile uint32_t saradc_sar1_patt_tab4; /*Item 12 ~ 15 for pattern table 1 (each item one byte)*/ - volatile uint32_t saradc_sar2_patt_tab1; /*item 0 ~ 3 for pattern table 2 (each item one byte)*/ - volatile uint32_t saradc_sar2_patt_tab2; /*Item 4 ~ 7 for pattern table 2 (each item one byte)*/ - volatile uint32_t saradc_sar2_patt_tab3; /*Item 8 ~ 11 for pattern table 2 (each item one byte)*/ - volatile uint32_t saradc_sar2_patt_tab4; /*Item 12 ~ 15 for pattern table 2 (each item one byte)*/ - union { - struct { - volatile uint32_t apll_tick: 8; - volatile uint32_t reserved8: 24; - }; - volatile uint32_t val; - }apll_tick_conf; - volatile uint32_t reserved_40; - volatile uint32_t reserved_44; - volatile uint32_t reserved_48; - volatile uint32_t reserved_4c; - volatile uint32_t reserved_50; - volatile uint32_t reserved_54; - volatile uint32_t reserved_58; - volatile uint32_t reserved_5c; - volatile uint32_t reserved_60; - volatile uint32_t reserved_64; - volatile uint32_t reserved_68; - volatile uint32_t reserved_6c; - volatile uint32_t reserved_70; - volatile uint32_t reserved_74; - volatile uint32_t reserved_78; - volatile uint32_t date; /**/ -} apb_ctrl_dev_t; - - -#ifdef __cplusplus -} -#endif - -#endif /* _SOC_APB_CTRL_STRUCT_H_ */ diff --git a/tools/sdk/include/soc/soc/bb_reg.h b/tools/sdk/include/soc/soc/bb_reg.h deleted file mode 100644 index 69d2f43d206..00000000000 --- a/tools/sdk/include/soc/soc/bb_reg.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2010-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. - -#ifndef _SOC_BB_REG_H_ -#define _SOC_BB_REG_H_ - -/* Some of the baseband control registers. - * PU/PD fields defined here are used in sleep related functions. - */ - -#define BBPD_CTRL (DR_REG_BB_BASE + 0x0054) -#define BB_FFT_FORCE_PU (BIT(3)) -#define BB_FFT_FORCE_PU_M (BIT(3)) -#define BB_FFT_FORCE_PU_V 1 -#define BB_FFT_FORCE_PU_S 3 -#define BB_FFT_FORCE_PD (BIT(2)) -#define BB_FFT_FORCE_PD_M (BIT(2)) -#define BB_FFT_FORCE_PD_V 1 -#define BB_FFT_FORCE_PD_S 2 -#define BB_DC_EST_FORCE_PU (BIT(1)) -#define BB_DC_EST_FORCE_PU_M (BIT(1)) -#define BB_DC_EST_FORCE_PU_V 1 -#define BB_DC_EST_FORCE_PU_S 1 -#define BB_DC_EST_FORCE_PD (BIT(0)) -#define BB_DC_EST_FORCE_PD_M (BIT(0)) -#define BB_DC_EST_FORCE_PD_V 1 -#define BB_DC_EST_FORCE_PD_S 0 - - -#endif /* _SOC_BB_REG_H_ */ - diff --git a/tools/sdk/include/soc/soc/boot_mode.h b/tools/sdk/include/soc/soc/boot_mode.h deleted file mode 100644 index 5106e10cfbd..00000000000 --- a/tools/sdk/include/soc/soc/boot_mode.h +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright 2010-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. - -#ifndef _SOC_BOOT_MODE_H_ -#define _SOC_BOOT_MODE_H_ - -#include "soc.h" - -/*SPI Boot*/ -#define IS_1XXXX(v) (((v)&0x10)==0x10) - -/*HSPI Boot*/ -#define IS_010XX(v) (((v)&0x1c)==0x08) - -/*Download Boot, SDIO/UART0/UART1*/ -#define IS_00XXX(v) (((v)&0x18)==0x00) - -/*Download Boot, SDIO/UART0/UART1,FEI_FEO V2*/ -#define IS_00X00(v) (((v)&0x1b)==0x00) - -/*Download Boot, SDIO/UART0/UART1,FEI_REO V2*/ -#define IS_00X01(v) (((v)&0x1b)==0x01) - -/*Download Boot, SDIO/UART0/UART1,REI_FEO V2*/ -#define IS_00X10(v) (((v)&0x1b)==0x02) - -/*Download Boot, SDIO/UART0/UART1,REI_FEO V2*/ -#define IS_00X11(v) (((v)&0x1b)==0x03) - -/*ATE/ANALOG Mode*/ -#define IS_01110(v) (((v)&0x1f)==0x0e) - -/*Diagnostic Mode+UART0 download Mode*/ -#define IS_01111(v) (((v)&0x1f)==0x0f) - -/*legacy SPI Boot*/ -#define IS_01100(v) (((v)&0x1f)==0x0c) - -/*SDIO_Slave download Mode V1.1*/ -#define IS_01101(v) (((v)&0x1f)==0x0d) - - - -#define BOOT_MODE_GET() (GPIO_REG_READ(GPIO_STRAP)) - -/*do not include download mode*/ -#define ETS_IS_UART_BOOT() IS_01111(BOOT_MODE_GET()) - -/*all spi boot including spi/hspi/legacy*/ -#define ETS_IS_FLASH_BOOT() (IS_1XXXX(BOOT_MODE_GET()) || IS_010XX(BOOT_MODE_GET()) || IS_01100(BOOT_MODE_GET())) - -/*all faster spi boot including spi/hspi*/ -#define ETS_IS_FAST_FLASH_BOOT() (IS_1XXXX(BOOT_MODE_GET()) || IS_010XX(BOOT_MODE_GET())) - -/*all spi boot including spi/legacy*/ -#define ETS_IS_SPI_FLASH_BOOT() (IS_1XXXX(BOOT_MODE_GET()) || IS_01100(BOOT_MODE_GET())) - -/*all spi boot including hspi/legacy*/ -#define ETS_IS_HSPI_FLASH_BOOT() IS_010XX(BOOT_MODE_GET()) - -/*all sdio V2 of failing edge input, failing edge output*/ -#define ETS_IS_SDIO_FEI_FEO_V2_BOOT() IS_00X00(BOOT_MODE_GET()) - -/*all sdio V2 of failing edge input, raising edge output*/ -#define ETS_IS_SDIO_FEI_REO_V2_BOOT() IS_00X01(BOOT_MODE_GET()) - -/*all sdio V2 of raising edge input, failing edge output*/ -#define ETS_IS_SDIO_REI_FEO_V2_BOOT() IS_00X10(BOOT_MODE_GET()) - -/*all sdio V2 of raising edge input, raising edge output*/ -#define ETS_IS_SDIO_REI_REO_V2_BOOT() IS_00X11(BOOT_MODE_GET()) - -/*all sdio V1 of raising edge input, failing edge output*/ -#define ETS_IS_SDIO_REI_FEO_V1_BOOT() IS_01101(BOOT_MODE_GET()) - -/*do not include download mode*/ -#define ETS_IS_SDIO_BOOT() IS_01101(BOOT_MODE_GET()) - -/*joint download boot*/ -#define ETS_IS_SDIO_UART_BOOT() IS_00XXX(BOOT_MODE_GET()) - -/*ATE mode*/ -#define ETS_IS_ATE_BOOT() IS_01110(BOOT_MODE_GET()) - -/*A bit to control flash boot print*/ -#define ETS_IS_PRINT_BOOT() (BOOT_MODE_GET() & 0x2) - -/*used by ETS_IS_SDIO_UART_BOOT*/ -#define SEL_NO_BOOT 0 -#define SEL_SDIO_BOOT BIT0 -#define SEL_UART_BOOT BIT1 - -#endif /* _SOC_BOOT_MODE_H_ */ diff --git a/tools/sdk/include/soc/soc/can_struct.h b/tools/sdk/include/soc/soc/can_struct.h deleted file mode 100644 index 3f566b135d5..00000000000 --- a/tools/sdk/include/soc/soc/can_struct.h +++ /dev/null @@ -1,211 +0,0 @@ -// 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. -#ifndef _SOC_CAN_STRUCT_H_ -#define _SOC_CAN_STRUCT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* -------------------------- Register Definitions -------------------------- */ - -/* The CAN peripheral's registers are 8bits, however the ESP32 can only access - * peripheral registers every 32bits. Therefore each CAN register is mapped to - * the least significant byte of every 32bits. - */ -typedef union { - struct { - uint32_t byte: 8; /* LSB */ - uint32_t reserved24: 24; /* Internal Reserved */ - }; - uint32_t val; -} can_reg_t; - -typedef union { - struct { - uint32_t reset: 1; /* MOD.0 Reset Mode */ - uint32_t listen_only: 1; /* MOD.1 Listen Only Mode */ - uint32_t self_test: 1; /* MOD.2 Self Test Mode */ - uint32_t acceptance_filter: 1; /* MOD.3 Acceptance Filter Mode */ - uint32_t reserved28: 28; /* Internal Reserved. MOD.4 Sleep Mode not supported */ - }; - uint32_t val; -} can_mode_reg_t; - -typedef union { - struct { - uint32_t tx_req: 1; /* CMR.0 Transmission Request */ - uint32_t abort_tx: 1; /* CMR.1 Abort Transmission */ - uint32_t release_rx_buff: 1; /* CMR.2 Release Receive Buffer */ - uint32_t clear_data_overrun: 1; /* CMR.3 Clear Data Overrun */ - uint32_t self_rx_req: 1; /* CMR.4 Self Reception Request */ - uint32_t reserved27: 27; /* Internal Reserved */ - }; - uint32_t val; -} can_cmd_reg_t; - -typedef union { - struct { - uint32_t rx_buff: 1; /* SR.0 Receive Buffer Status */ - uint32_t data_overrun: 1; /* SR.1 Data Overrun Status */ - uint32_t tx_buff: 1; /* SR.2 Transmit Buffer Status */ - uint32_t tx_complete: 1; /* SR.3 Transmission Complete Status */ - uint32_t rx: 1; /* SR.4 Receive Status */ - uint32_t tx: 1; /* SR.5 Transmit Status */ - uint32_t error: 1; /* SR.6 Error Status */ - uint32_t bus: 1; /* SR.7 Bus Status */ - uint32_t reserved24: 24; /* Internal Reserved */ - }; - uint32_t val; -} can_status_reg_t; - -typedef union { - struct { - uint32_t rx: 1; /* IR.0 Receive Interrupt */ - uint32_t tx: 1; /* IR.1 Transmit Interrupt */ - uint32_t err_warn: 1; /* IR.2 Error Interrupt */ - uint32_t data_overrun: 1; /* IR.3 Data Overrun Interrupt */ - uint32_t reserved1: 1; /* Internal Reserved (Wake-up not supported) */ - uint32_t err_passive: 1; /* IR.5 Error Passive Interrupt */ - uint32_t arb_lost: 1; /* IR.6 Arbitration Lost Interrupt */ - uint32_t bus_err: 1; /* IR.7 Bus Error Interrupt */ - uint32_t reserved24: 24; /* Internal Reserved */ - }; - uint32_t val; -} can_intr_reg_t; - -typedef union { - struct { - uint32_t rx: 1; /* IER.0 Receive Interrupt Enable */ - uint32_t tx: 1; /* IER.1 Transmit Interrupt Enable */ - uint32_t err_warn: 1; /* IER.2 Error Interrupt Enable */ - uint32_t data_overrun: 1; /* IER.3 Data Overrun Interrupt Enable */ - uint32_t reserved1: 1; /* Internal Reserved (Wake-up not supported) */ - uint32_t err_passive: 1; /* IER.5 Error Passive Interrupt Enable */ - uint32_t arb_lost: 1; /* IER.6 Arbitration Lost Interrupt Enable */ - uint32_t bus_err: 1; /* IER.7 Bus Error Interrupt Enable */ - uint32_t reserved24: 24; /* Internal Reserved */ - }; - uint32_t val; -} can_intr_en_reg_t; - -typedef union { - struct { - uint32_t baud_rate_prescaler: 6; /* BTR0[5:0] Baud Rate Prescaler */ - uint32_t sync_jump_width: 2; /* BTR0[7:6] Synchronization Jump Width*/ - uint32_t reserved24: 24; /* Internal Reserved */ - }; - uint32_t val; -} can_bus_tim_0_reg_t; - -typedef union { - struct { - uint32_t time_seg_1: 4; /* BTR1[3:0] Timing Segment 1 */ - uint32_t time_seg_2: 3; /* BTR1[6:4] Timing Segment 2 */ - uint32_t sampling: 1; /* BTR1.7 Sampling*/ - uint32_t reserved24: 24; /* Internal Reserved */ - }; - uint32_t val; -} can_bus_tim_1_reg_t; - -typedef union { - struct { - uint32_t arbitration_lost_capture: 5; /* ALC[4:0] Arbitration lost capture */ - uint32_t reserved27: 27; /* Internal Reserved */ - }; - uint32_t val; -} can_arb_lost_cap_reg_t; - -typedef union { - struct { - uint32_t segment: 5; /* ECC[4:0] Error Code Segment 0 to 5 */ - uint32_t direction: 1; /* ECC.5 Error Direction (TX/RX) */ - uint32_t error_code: 2; /* ECC[7:6] Error Code */ - uint32_t reserved24: 24; /* Internal Reserved */ - }; - uint32_t val; -} can_err_code_cap_reg_t; - -typedef struct { - can_reg_t code_reg[4]; - can_reg_t mask_reg[4]; - uint32_t reserved32[5]; -} can_acc_filter_t; - -typedef union { - struct { - uint32_t rx_message_counter: 5; /* RMC[4:0] RX Message Counter */ - uint32_t reserved27: 27; /* Internal Reserved */ - }; - uint32_t val; -} can_rx_msg_cnt_reg_t; - -typedef union { - struct { - uint32_t clock_divider: 3; /* CDR[2:0] CLKOUT frequency selector based of fOSC */ - uint32_t clock_off: 1; /* CDR.3 CLKOUT enable/disable */ - uint32_t reserved3: 3; /* Internal Reserved. RXINTEN and CBP not supported */ - uint32_t can_mode: 1; /* CDR.7 BasicCAN:0 PeliCAN:1 */ - uint32_t reserved24: 24; /* Internal Reserved */ - }; - uint32_t val; -} can_clk_div_reg_t; - -/* ---------------------------- Register Layout ------------------------------ */ - -typedef volatile struct { - //Configuration and Control Registers - can_mode_reg_t mode_reg; /* Address 0 */ - can_cmd_reg_t command_reg; /* Address 1 */ - can_status_reg_t status_reg; /* Address 2 */ - can_intr_reg_t interrupt_reg; /* Address 3 */ - can_intr_en_reg_t interrupt_enable_reg; /* Address 4 */ - uint32_t reserved_05; /* Address 5 */ - can_bus_tim_0_reg_t bus_timing_0_reg; /* Address 6 */ - can_bus_tim_1_reg_t bus_timing_1_reg; /* Address 7 */ - uint32_t reserved_08; /* Address 8 (Output control not supported) */ - uint32_t reserved_09; /* Address 9 (Test Register not supported) */ - uint32_t reserved_10; /* Address 10 */ - - //Capture and Counter Registers - can_arb_lost_cap_reg_t arbitration_lost_captue_reg; /* Address 11 */ - can_err_code_cap_reg_t error_code_capture_reg; /* Address 12 */ - can_reg_t error_warning_limit_reg; /* EWLR[7:0] Error Warning Limit: Address 13 */ - can_reg_t rx_error_counter_reg; /* RXERR[7:0] Receive Error Counter: Address 14 */ - can_reg_t tx_error_counter_reg; /* TXERR[7:0] Transmit Error Counter: Address 15 */ - - //Shared Registers (TX Buff/RX Buff/Acc Filter) - union { - can_acc_filter_t acceptance_filter; - can_reg_t tx_rx_buffer[13]; - }; /* Address 16-28 TX/RX Buffer and Acc Filter*/; - - //Misc Registers - can_rx_msg_cnt_reg_t rx_message_counter_reg; /* Address 29 */ - can_reg_t reserved_30; /* Address 30 (RX Buffer Start Address not supported) */ - can_clk_div_reg_t clock_divider_reg; /* Address 31 */ - - //Start of RX FIFO -} can_dev_t; - -_Static_assert(sizeof(can_dev_t) == 128, "CAN registers should be 32 * 4 bytes"); - -extern can_dev_t CAN; - -#ifdef __cplusplus -} -#endif - -#endif /* _SOC_CAN_STRUCT_H_ */ - diff --git a/tools/sdk/include/soc/soc/clkout_channel.h b/tools/sdk/include/soc/soc/clkout_channel.h deleted file mode 100644 index 5161e3f0b65..00000000000 --- a/tools/sdk/include/soc/soc/clkout_channel.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2010-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. - -#ifndef _SOC_CLKOUT_CHANNEL_H -#define _SOC_CLKOUT_CHANNEL_H - -//CLKOUT channels -#define CLKOUT_GPIO0_DIRECT_CHANNEL CLKOUT_CHANNEL_1 -#define CLKOUT_CHANNEL_1_DIRECT_GPIO_NUM 0 -#define CLKOUT_GPIO3_DIRECT_CHANNEL CLKOUT_CHANNEL_2 -#define CLKOUT_CHANNEL_2_DIRECT_GPIO_NUM 3 -#define CLKOUT_GPIO1_DIRECT_CHANNEL CLKOUT_CHANNEL_3 -#define CLKOUT_CHANNEL_3_DIRECT_GPIO_NUM 1 - -#endif diff --git a/tools/sdk/include/soc/soc/cpu.h b/tools/sdk/include/soc/soc/cpu.h deleted file mode 100644 index f28feb59fa2..00000000000 --- a/tools/sdk/include/soc/soc/cpu.h +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2010-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. - -#ifndef _SOC_CPU_H -#define _SOC_CPU_H - -#include -#include -#include -#include "xtensa/corebits.h" -#include "xtensa/config/core.h" - -/* C macros for xtensa special register read/write/exchange */ - -#define RSR(reg, curval) asm volatile ("rsr %0, " #reg : "=r" (curval)); -#define WSR(reg, newval) asm volatile ("wsr %0, " #reg : : "r" (newval)); -#define XSR(reg, swapval) asm volatile ("xsr %0, " #reg : "+r" (swapval)); - -/** @brief Read current stack pointer address - * - */ -static inline void *get_sp() -{ - void *sp; - asm volatile ("mov %0, sp;" : "=r" (sp)); - return sp; -} - -/* Functions to set page attributes for Region Protection option in the CPU. - * See Xtensa ISA Reference manual for explanation of arguments (section 4.6.3.2). - */ - -static inline void cpu_write_dtlb(uint32_t vpn, unsigned attr) -{ - asm volatile ("wdtlb %1, %0; dsync\n" :: "r" (vpn), "r" (attr)); -} - - -static inline void cpu_write_itlb(unsigned vpn, unsigned attr) -{ - asm volatile ("witlb %1, %0; isync\n" :: "r" (vpn), "r" (attr)); -} - -static inline void cpu_init_memctl() -{ -#if XCHAL_ERRATUM_572 - uint32_t memctl = XCHAL_CACHE_MEMCTL_DEFAULT; - WSR(MEMCTL, memctl); -#endif // XCHAL_ERRATUM_572 -} - -/** - * @brief Configure memory region protection - * - * Make page 0 access raise an exception. - * Also protect some other unused pages so we can catch weirdness. - * Useful attribute values: - * 0 — cached, RW - * 2 — bypass cache, RWX (default value after CPU reset) - * 15 — no access, raise exception - */ - -static inline void cpu_configure_region_protection() -{ - const uint32_t pages_to_protect[] = {0x00000000, 0x80000000, 0xa0000000, 0xc0000000, 0xe0000000}; - for (int i = 0; i < sizeof(pages_to_protect)/sizeof(pages_to_protect[0]); ++i) { - cpu_write_dtlb(pages_to_protect[i], 0xf); - cpu_write_itlb(pages_to_protect[i], 0xf); - } - cpu_write_dtlb(0x20000000, 0); - cpu_write_itlb(0x20000000, 0); -} - -/** - * @brief Stall CPU using RTC controller - * @param cpu_id ID of the CPU to stall (0 = PRO, 1 = APP) - */ -void esp_cpu_stall(int cpu_id); - -/** - * @brief Un-stall CPU using RTC controller - * @param cpu_id ID of the CPU to un-stall (0 = PRO, 1 = APP) - */ -void esp_cpu_unstall(int cpu_id); - -/** - * @brief Reset CPU using RTC controller - * @param cpu_id ID of the CPU to reset (0 = PRO, 1 = APP) - */ -void esp_cpu_reset(int cpu_id); - - -/** - * @brief Returns true if a JTAG debugger is attached to CPU - * OCD (on chip debug) port. - * - * @note If "Make exception and panic handlers JTAG/OCD aware" - * is disabled, this function always returns false. - */ -bool esp_cpu_in_ocd_debug_mode(); - -#endif diff --git a/tools/sdk/include/soc/soc/dac_channel.h b/tools/sdk/include/soc/soc/dac_channel.h deleted file mode 100644 index 241a067bb24..00000000000 --- a/tools/sdk/include/soc/soc/dac_channel.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2010-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. - -#ifndef _SOC_DAC_CHANNEL_H -#define _SOC_DAC_CHANNEL_H - -#define DAC_GPIO25_CHANNEL DAC_CHANNEL_1 -#define DAC_CHANNEL_1_GPIO_NUM 25 - -#define DAC_GPIO26_CHANNEL DAC_CHANNEL_2 -#define DAC_CHANNEL_2_GPIO_NUM 26 - -#endif diff --git a/tools/sdk/include/soc/soc/dport_access.h b/tools/sdk/include/soc/soc/dport_access.h deleted file mode 100644 index 2639e46ef14..00000000000 --- a/tools/sdk/include/soc/soc/dport_access.h +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright 2010-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. - -#ifndef _DPORT_ACCESS_H_ -#define _DPORT_ACCESS_H_ - -#include -#include "esp_attr.h" -#include "esp_dport_access.h" -#include "soc.h" -#include "uart_reg.h" -#include "xtensa/xtruntime.h" - -#ifdef __cplusplus -extern "C" { -#endif - -//Registers Operation {{ - -// The _DPORT_xxx register read macros access DPORT memory directly (as opposed to -// DPORT_REG_READ which applies SMP-safe protections). -// -// There are several ways to read the DPORT registers: -// 1) Use DPORT_REG_READ versions to be SMP-safe in IDF apps. -// This method uses the pre-read APB implementation(*) without stall other CPU. -// This is beneficial for single readings. -// 2) If you want to make a sequence of DPORT reads to buffer, -// use dport_read_buffer(buff_out, address, num_words), -// it is the faster method and it doesn't stop other CPU. -// 3) If you want to make a sequence of DPORT reads, but you don't want to stop other CPU -// and you want to do it faster then you need use DPORT_SEQUENCE_REG_READ(). -// The difference from the first is that the user himself must disable interrupts while DPORT reading. -// Note that disable interrupt need only if the chip has two cores. -// 4) If you want to make a sequence of DPORT reads, -// use DPORT_STALL_OTHER_CPU_START() macro explicitly -// and then use _DPORT_REG_READ macro while other CPU is stalled. -// After completing read operations, use DPORT_STALL_OTHER_CPU_END(). -// This method uses stall other CPU while reading DPORT registers. -// Useful for compatibility, as well as for large consecutive readings. -// This method is slower, but must be used if ROM functions or -// other code is called which accesses DPORT without any other workaround. -// *) The pre-readable APB register before reading the DPORT register -// helps synchronize the operation of the two CPUs, -// so that reading on different CPUs no longer causes random errors APB register. - -// _DPORT_REG_WRITE & DPORT_REG_WRITE are equivalent. -#define _DPORT_REG_READ(_r) (*(volatile uint32_t *)(_r)) -#define _DPORT_REG_WRITE(_r, _v) (*(volatile uint32_t *)(_r)) = (_v) - -// Write value to DPORT register (does not require protecting) -#define DPORT_REG_WRITE(_r, _v) _DPORT_REG_WRITE((_r), (_v)) - -/** - * @brief Read value from register, SMP-safe version. - * - * This method uses the pre-reading of the APB register before reading the register of the DPORT. - * This implementation is useful for reading DORT registers for single reading without stall other CPU. - * There is disable/enable interrupt. - * - * @param reg Register address - * @return Value - */ -static inline uint32_t IRAM_ATTR DPORT_REG_READ(uint32_t reg) -{ -#if defined(BOOTLOADER_BUILD) || !defined(CONFIG_ESP32_DPORT_WORKAROUND) || !defined(ESP_PLATFORM) - return _DPORT_REG_READ(reg); -#else - return esp_dport_access_reg_read(reg); -#endif -} - -/** - * @brief Read value from register, NOT SMP-safe version. - * - * This method uses the pre-reading of the APB register before reading the register of the DPORT. - * There is not disable/enable interrupt. - * The difference from DPORT_REG_READ() is that the user himself must disable interrupts while DPORT reading. - * This implementation is useful for reading DORT registers in loop without stall other CPU. Note the usage example. - * The recommended way to read registers sequentially without stall other CPU - * is to use the method esp_dport_read_buffer(buff_out, address, num_words). It allows you to read registers in the buffer. - * - * \code{c} - * // This example shows how to use it. - * { // Use curly brackets to limit the visibility of variables in macros DPORT_INTERRUPT_DISABLE/RESTORE. - * DPORT_INTERRUPT_DISABLE(); // Disable interrupt only on current CPU. - * for (i = 0; i < max; ++i) { - * array[i] = DPORT_SEQUENCE_REG_READ(Address + i * 4); // reading DPORT registers - * } - * DPORT_INTERRUPT_RESTORE(); // restore the previous interrupt level - * } - * \endcode - * - * @param reg Register address - * @return Value - */ -static inline uint32_t IRAM_ATTR DPORT_SEQUENCE_REG_READ(uint32_t reg) -{ -#if defined(BOOTLOADER_BUILD) || !defined(CONFIG_ESP32_DPORT_WORKAROUND) || !defined(ESP_PLATFORM) - return _DPORT_REG_READ(reg); -#else - return esp_dport_access_sequence_reg_read(reg); -#endif -} - -//get bit or get bits from register -#define DPORT_REG_GET_BIT(_r, _b) (DPORT_REG_READ(_r) & (_b)) - -//set bit or set bits to register -#define DPORT_REG_SET_BIT(_r, _b) DPORT_REG_WRITE((_r), (DPORT_REG_READ(_r)|(_b))) - -//clear bit or clear bits of register -#define DPORT_REG_CLR_BIT(_r, _b) DPORT_REG_WRITE((_r), (DPORT_REG_READ(_r) & (~(_b)))) - -//set bits of register controlled by mask -#define DPORT_REG_SET_BITS(_r, _b, _m) DPORT_REG_WRITE((_r), ((DPORT_REG_READ(_r) & (~(_m))) | ((_b) & (_m)))) - -//get field from register, uses field _S & _V to determine mask -#define DPORT_REG_GET_FIELD(_r, _f) ((DPORT_REG_READ(_r) >> (_f##_S)) & (_f##_V)) - -//set field to register, used when _f is not left shifted by _f##_S -#define DPORT_REG_SET_FIELD(_r, _f, _v) DPORT_REG_WRITE((_r), ((DPORT_REG_READ(_r) & (~((_f##_V) << (_f##_S))))|(((_v) & (_f##_V))<<(_f##_S)))) - -//get field value from a variable, used when _f is not left shifted by _f##_S -#define DPORT_VALUE_GET_FIELD(_r, _f) (((_r) >> (_f##_S)) & (_f)) - -//get field value from a variable, used when _f is left shifted by _f##_S -#define DPORT_VALUE_GET_FIELD2(_r, _f) (((_r) & (_f))>> (_f##_S)) - -//set field value to a variable, used when _f is not left shifted by _f##_S -#define DPORT_VALUE_SET_FIELD(_r, _f, _v) ((_r)=(((_r) & ~((_f) << (_f##_S)))|((_v)<<(_f##_S)))) - -//set field value to a variable, used when _f is left shifted by _f##_S -#define DPORT_VALUE_SET_FIELD2(_r, _f, _v) ((_r)=(((_r) & ~(_f))|((_v)<<(_f##_S)))) - -//generate a value from a field value, used when _f is not left shifted by _f##_S -#define DPORT_FIELD_TO_VALUE(_f, _v) (((_v)&(_f))<<_f##_S) - -//generate a value from a field value, used when _f is left shifted by _f##_S -#define DPORT_FIELD_TO_VALUE2(_f, _v) (((_v)<<_f##_S) & (_f)) - -//Register read macros with an underscore prefix access DPORT memory directly. In IDF apps, use the non-underscore versions to be SMP-safe. -#define _DPORT_READ_PERI_REG(addr) (*((volatile uint32_t *)(addr))) -#define _DPORT_WRITE_PERI_REG(addr, val) (*((volatile uint32_t *)(addr))) = (uint32_t)(val) -#define _DPORT_REG_SET_BIT(_r, _b) _DPORT_REG_WRITE((_r), (_DPORT_REG_READ(_r)|(_b))) -#define _DPORT_REG_CLR_BIT(_r, _b) _DPORT_REG_WRITE((_r), (_DPORT_REG_READ(_r) & (~(_b)))) - -/** - * @brief Read value from register, SMP-safe version. - * - * This method uses the pre-reading of the APB register before reading the register of the DPORT. - * This implementation is useful for reading DORT registers for single reading without stall other CPU. - * - * @param reg Register address - * @return Value - */ -static inline uint32_t IRAM_ATTR DPORT_READ_PERI_REG(uint32_t reg) -{ -#if defined(BOOTLOADER_BUILD) || !defined(CONFIG_ESP32_DPORT_WORKAROUND) || !defined(ESP_PLATFORM) - return _DPORT_REG_READ(reg); -#else - return esp_dport_access_reg_read(reg); -#endif -} - -//write value to register -#define DPORT_WRITE_PERI_REG(addr, val) _DPORT_WRITE_PERI_REG((addr), (val)) - -//clear bits of register controlled by mask -#define DPORT_CLEAR_PERI_REG_MASK(reg, mask) DPORT_WRITE_PERI_REG((reg), (DPORT_READ_PERI_REG(reg)&(~(mask)))) - -//set bits of register controlled by mask -#define DPORT_SET_PERI_REG_MASK(reg, mask) DPORT_WRITE_PERI_REG((reg), (DPORT_READ_PERI_REG(reg)|(mask))) - -//get bits of register controlled by mask -#define DPORT_GET_PERI_REG_MASK(reg, mask) (DPORT_READ_PERI_REG(reg) & (mask)) - -//get bits of register controlled by highest bit and lowest bit -#define DPORT_GET_PERI_REG_BITS(reg, hipos,lowpos) ((DPORT_READ_PERI_REG(reg)>>(lowpos))&((1<<((hipos)-(lowpos)+1))-1)) - -//set bits of register controlled by mask and shift -#define DPORT_SET_PERI_REG_BITS(reg,bit_map,value,shift) DPORT_WRITE_PERI_REG((reg), ((DPORT_READ_PERI_REG(reg)&(~((bit_map)<<(shift))))|(((value) & bit_map)<<(shift)))) - -//get field of register -#define DPORT_GET_PERI_REG_BITS2(reg, mask,shift) ((DPORT_READ_PERI_REG(reg)>>(shift))&(mask)) -//}} - -#ifdef __cplusplus -} -#endif - -#endif /* _DPORT_ACCESS_H_ */ diff --git a/tools/sdk/include/soc/soc/dport_reg.h b/tools/sdk/include/soc/soc/dport_reg.h deleted file mode 100644 index 9cc3320b39b..00000000000 --- a/tools/sdk/include/soc/soc/dport_reg.h +++ /dev/null @@ -1,4288 +0,0 @@ -// 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. -#ifndef _SOC_DPORT_REG_H_ -#define _SOC_DPORT_REG_H_ - -#include "soc.h" - -#ifndef __ASSEMBLER__ -#include "dport_access.h" -#endif - -/* Registers defined in this header file must be accessed using special macros, - * prefixed with DPORT_. See soc/dport_access.h file for details. - */ - -#define DPORT_PRO_BOOT_REMAP_CTRL_REG (DR_REG_DPORT_BASE + 0x000) -/* DPORT_PRO_BOOT_REMAP : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_BOOT_REMAP (BIT(0)) -#define DPORT_PRO_BOOT_REMAP_M (BIT(0)) -#define DPORT_PRO_BOOT_REMAP_V 0x1 -#define DPORT_PRO_BOOT_REMAP_S 0 - -#define DPORT_APP_BOOT_REMAP_CTRL_REG (DR_REG_DPORT_BASE + 0x004) -/* DPORT_APP_BOOT_REMAP : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_BOOT_REMAP (BIT(0)) -#define DPORT_APP_BOOT_REMAP_M (BIT(0)) -#define DPORT_APP_BOOT_REMAP_V 0x1 -#define DPORT_APP_BOOT_REMAP_S 0 - -#define DPORT_ACCESS_CHECK_REG (DR_REG_DPORT_BASE + 0x008) -/* DPORT_ACCESS_CHECK_APP : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_ACCESS_CHECK_APP (BIT(8)) -#define DPORT_ACCESS_CHECK_APP_M (BIT(8)) -#define DPORT_ACCESS_CHECK_APP_V 0x1 -#define DPORT_ACCESS_CHECK_APP_S 8 -/* DPORT_ACCESS_CHECK_PRO : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_ACCESS_CHECK_PRO (BIT(0)) -#define DPORT_ACCESS_CHECK_PRO_M (BIT(0)) -#define DPORT_ACCESS_CHECK_PRO_V 0x1 -#define DPORT_ACCESS_CHECK_PRO_S 0 - -#define DPORT_PRO_DPORT_APB_MASK0_REG (DR_REG_DPORT_BASE + 0x00C) -/* DPORT_PRODPORT_APB_MASK0 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define DPORT_PRODPORT_APB_MASK0 0xFFFFFFFF -#define DPORT_PRODPORT_APB_MASK0_M ((DPORT_PRODPORT_APB_MASK0_V)<<(DPORT_PRODPORT_APB_MASK0_S)) -#define DPORT_PRODPORT_APB_MASK0_V 0xFFFFFFFF -#define DPORT_PRODPORT_APB_MASK0_S 0 - -#define DPORT_PRO_DPORT_APB_MASK1_REG (DR_REG_DPORT_BASE + 0x010) -/* DPORT_PRODPORT_APB_MASK1 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define DPORT_PRODPORT_APB_MASK1 0xFFFFFFFF -#define DPORT_PRODPORT_APB_MASK1_M ((DPORT_PRODPORT_APB_MASK1_V)<<(DPORT_PRODPORT_APB_MASK1_S)) -#define DPORT_PRODPORT_APB_MASK1_V 0xFFFFFFFF -#define DPORT_PRODPORT_APB_MASK1_S 0 - -#define DPORT_APP_DPORT_APB_MASK0_REG (DR_REG_DPORT_BASE + 0x014) -/* DPORT_APPDPORT_APB_MASK0 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define DPORT_APPDPORT_APB_MASK0 0xFFFFFFFF -#define DPORT_APPDPORT_APB_MASK0_M ((DPORT_APPDPORT_APB_MASK0_V)<<(DPORT_APPDPORT_APB_MASK0_S)) -#define DPORT_APPDPORT_APB_MASK0_V 0xFFFFFFFF -#define DPORT_APPDPORT_APB_MASK0_S 0 - -#define DPORT_APP_DPORT_APB_MASK1_REG (DR_REG_DPORT_BASE + 0x018) -/* DPORT_APPDPORT_APB_MASK1 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define DPORT_APPDPORT_APB_MASK1 0xFFFFFFFF -#define DPORT_APPDPORT_APB_MASK1_M ((DPORT_APPDPORT_APB_MASK1_V)<<(DPORT_APPDPORT_APB_MASK1_S)) -#define DPORT_APPDPORT_APB_MASK1_V 0xFFFFFFFF -#define DPORT_APPDPORT_APB_MASK1_S 0 - -#define DPORT_PERI_CLK_EN_REG (DR_REG_DPORT_BASE + 0x01C) -/* DPORT_PERI_CLK_EN : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define DPORT_PERI_CLK_EN 0xFFFFFFFF -#define DPORT_PERI_CLK_EN_M ((DPORT_PERI_CLK_EN_V)<<(DPORT_PERI_CLK_EN_S)) -#define DPORT_PERI_CLK_EN_V 0xFFFFFFFF -#define DPORT_PERI_CLK_EN_S 0 - -#define DPORT_PERI_RST_EN_REG (DR_REG_DPORT_BASE + 0x020) -/* DPORT_PERI_RST_EN : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define DPORT_PERI_RST_EN 0xFFFFFFFF -#define DPORT_PERI_RST_EN_M ((DPORT_PERI_RST_EN_V)<<(DPORT_PERI_RST_EN_S)) -#define DPORT_PERI_RST_EN_V 0xFFFFFFFF -#define DPORT_PERI_RST_EN_S 0 - -/* The following bits apply to DPORT_PERI_CLK_EN_REG, DPORT_PERI_RST_EN_REG - */ -#define DPORT_PERI_EN_AES (1<<0) -#define DPORT_PERI_EN_SHA (1<<1) -#define DPORT_PERI_EN_RSA (1<<2) -/* NB: Secure boot reset will hold SHA & AES in reset */ -#define DPORT_PERI_EN_SECUREBOOT (1<<3) -/* NB: Digital signature reset will hold AES & RSA in reset */ -#define DPORT_PERI_EN_DIGITAL_SIGNATURE (1<<4) - -#define DPORT_WIFI_BB_CFG_REG (DR_REG_DPORT_BASE + 0x024) -/* DPORT_WIFI_BB_CFG : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define DPORT_WIFI_BB_CFG 0xFFFFFFFF -#define DPORT_WIFI_BB_CFG_M ((DPORT_WIFI_BB_CFG_V)<<(DPORT_WIFI_BB_CFG_S)) -#define DPORT_WIFI_BB_CFG_V 0xFFFFFFFF -#define DPORT_WIFI_BB_CFG_S 0 - -#define DPORT_WIFI_BB_CFG_2_REG (DR_REG_DPORT_BASE + 0x028) -/* DPORT_WIFI_BB_CFG_2 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define DPORT_WIFI_BB_CFG_2 0xFFFFFFFF -#define DPORT_WIFI_BB_CFG_2_M ((DPORT_WIFI_BB_CFG_2_V)<<(DPORT_WIFI_BB_CFG_2_S)) -#define DPORT_WIFI_BB_CFG_2_V 0xFFFFFFFF -#define DPORT_WIFI_BB_CFG_2_S 0 - -#define DPORT_APPCPU_CTRL_A_REG (DR_REG_DPORT_BASE + 0x02C) -/* DPORT_APPCPU_RESETTING : R/W ;bitpos:[0] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_APPCPU_RESETTING (BIT(0)) -#define DPORT_APPCPU_RESETTING_M (BIT(0)) -#define DPORT_APPCPU_RESETTING_V 0x1 -#define DPORT_APPCPU_RESETTING_S 0 - -#define DPORT_APPCPU_CTRL_B_REG (DR_REG_DPORT_BASE + 0x030) -/* DPORT_APPCPU_CLKGATE_EN : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APPCPU_CLKGATE_EN (BIT(0)) -#define DPORT_APPCPU_CLKGATE_EN_M (BIT(0)) -#define DPORT_APPCPU_CLKGATE_EN_V 0x1 -#define DPORT_APPCPU_CLKGATE_EN_S 0 - -#define DPORT_APPCPU_CTRL_C_REG (DR_REG_DPORT_BASE + 0x034) -/* DPORT_APPCPU_RUNSTALL : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APPCPU_RUNSTALL (BIT(0)) -#define DPORT_APPCPU_RUNSTALL_M (BIT(0)) -#define DPORT_APPCPU_RUNSTALL_V 0x1 -#define DPORT_APPCPU_RUNSTALL_S 0 - -#define DPORT_APPCPU_CTRL_D_REG (DR_REG_DPORT_BASE + 0x038) -/* DPORT_APPCPU_BOOT_ADDR : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define DPORT_APPCPU_BOOT_ADDR 0xFFFFFFFF -#define DPORT_APPCPU_BOOT_ADDR_M ((DPORT_APPCPU_BOOT_ADDR_V)<<(DPORT_APPCPU_BOOT_ADDR_S)) -#define DPORT_APPCPU_BOOT_ADDR_V 0xFFFFFFFF -#define DPORT_APPCPU_BOOT_ADDR_S 0 - -#define DPORT_CPU_PER_CONF_REG (DR_REG_DPORT_BASE + 0x03C) -/* DPORT_FAST_CLK_RTC_SEL : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_FAST_CLK_RTC_SEL (BIT(3)) -#define DPORT_FAST_CLK_RTC_SEL_M (BIT(3)) -#define DPORT_FAST_CLK_RTC_SEL_V 0x1 -#define DPORT_FAST_CLK_RTC_SEL_S 3 -/* DPORT_LOWSPEED_CLK_SEL : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_LOWSPEED_CLK_SEL (BIT(2)) -#define DPORT_LOWSPEED_CLK_SEL_M (BIT(2)) -#define DPORT_LOWSPEED_CLK_SEL_V 0x1 -#define DPORT_LOWSPEED_CLK_SEL_S 2 -/* DPORT_CPUPERIOD_SEL : R/W ;bitpos:[1:0] ;default: 2'b0 ; */ -/*description: */ -#define DPORT_CPUPERIOD_SEL 0x00000003 -#define DPORT_CPUPERIOD_SEL_M ((DPORT_CPUPERIOD_SEL_V)<<(DPORT_CPUPERIOD_SEL_S)) -#define DPORT_CPUPERIOD_SEL_V 0x3 -#define DPORT_CPUPERIOD_SEL_S 0 -#define DPORT_CPUPERIOD_SEL_80 0 -#define DPORT_CPUPERIOD_SEL_160 1 -#define DPORT_CPUPERIOD_SEL_240 2 - -#define DPORT_PRO_CACHE_CTRL_REG (DR_REG_DPORT_BASE + 0x040) -/* DPORT_PRO_DRAM_HL : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_DRAM_HL (BIT(16)) -#define DPORT_PRO_DRAM_HL_M (BIT(16)) -#define DPORT_PRO_DRAM_HL_V 0x1 -#define DPORT_PRO_DRAM_HL_S 16 -/* DPORT_SLAVE_REQ : RO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_SLAVE_REQ (BIT(15)) -#define DPORT_SLAVE_REQ_M (BIT(15)) -#define DPORT_SLAVE_REQ_V 0x1 -#define DPORT_SLAVE_REQ_S 15 -/* DPORT_AHB_SPI_REQ : RO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_AHB_SPI_REQ (BIT(14)) -#define DPORT_AHB_SPI_REQ_M (BIT(14)) -#define DPORT_AHB_SPI_REQ_V 0x1 -#define DPORT_AHB_SPI_REQ_S 14 -/* DPORT_PRO_SLAVE_REQ : RO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_SLAVE_REQ (BIT(13)) -#define DPORT_PRO_SLAVE_REQ_M (BIT(13)) -#define DPORT_PRO_SLAVE_REQ_V 0x1 -#define DPORT_PRO_SLAVE_REQ_S 13 -/* DPORT_PRO_AHB_SPI_REQ : RO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_AHB_SPI_REQ (BIT(12)) -#define DPORT_PRO_AHB_SPI_REQ_M (BIT(12)) -#define DPORT_PRO_AHB_SPI_REQ_V 0x1 -#define DPORT_PRO_AHB_SPI_REQ_S 12 -/* DPORT_PRO_DRAM_SPLIT : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_DRAM_SPLIT (BIT(11)) -#define DPORT_PRO_DRAM_SPLIT_M (BIT(11)) -#define DPORT_PRO_DRAM_SPLIT_V 0x1 -#define DPORT_PRO_DRAM_SPLIT_S 11 -/* DPORT_PRO_SINGLE_IRAM_ENA : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_SINGLE_IRAM_ENA (BIT(10)) -#define DPORT_PRO_SINGLE_IRAM_ENA_M (BIT(10)) -#define DPORT_PRO_SINGLE_IRAM_ENA_V 0x1 -#define DPORT_PRO_SINGLE_IRAM_ENA_S 10 -/* DPORT_PRO_CACHE_LOCK_3_EN : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_LOCK_3_EN (BIT(9)) -#define DPORT_PRO_CACHE_LOCK_3_EN_M (BIT(9)) -#define DPORT_PRO_CACHE_LOCK_3_EN_V 0x1 -#define DPORT_PRO_CACHE_LOCK_3_EN_S 9 -/* DPORT_PRO_CACHE_LOCK_2_EN : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_LOCK_2_EN (BIT(8)) -#define DPORT_PRO_CACHE_LOCK_2_EN_M (BIT(8)) -#define DPORT_PRO_CACHE_LOCK_2_EN_V 0x1 -#define DPORT_PRO_CACHE_LOCK_2_EN_S 8 -/* DPORT_PRO_CACHE_LOCK_1_EN : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_LOCK_1_EN (BIT(7)) -#define DPORT_PRO_CACHE_LOCK_1_EN_M (BIT(7)) -#define DPORT_PRO_CACHE_LOCK_1_EN_V 0x1 -#define DPORT_PRO_CACHE_LOCK_1_EN_S 7 -/* DPORT_PRO_CACHE_LOCK_0_EN : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_LOCK_0_EN (BIT(6)) -#define DPORT_PRO_CACHE_LOCK_0_EN_M (BIT(6)) -#define DPORT_PRO_CACHE_LOCK_0_EN_V 0x1 -#define DPORT_PRO_CACHE_LOCK_0_EN_S 6 -/* DPORT_PRO_CACHE_FLUSH_DONE : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_FLUSH_DONE (BIT(5)) -#define DPORT_PRO_CACHE_FLUSH_DONE_M (BIT(5)) -#define DPORT_PRO_CACHE_FLUSH_DONE_V 0x1 -#define DPORT_PRO_CACHE_FLUSH_DONE_S 5 -/* DPORT_PRO_CACHE_FLUSH_ENA : R/W ;bitpos:[4] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_PRO_CACHE_FLUSH_ENA (BIT(4)) -#define DPORT_PRO_CACHE_FLUSH_ENA_M (BIT(4)) -#define DPORT_PRO_CACHE_FLUSH_ENA_V 0x1 -#define DPORT_PRO_CACHE_FLUSH_ENA_S 4 -/* DPORT_PRO_CACHE_ENABLE : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_ENABLE (BIT(3)) -#define DPORT_PRO_CACHE_ENABLE_M (BIT(3)) -#define DPORT_PRO_CACHE_ENABLE_V 0x1 -#define DPORT_PRO_CACHE_ENABLE_S 3 -/* DPORT_PRO_CACHE_MODE : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_MODE (BIT(2)) -#define DPORT_PRO_CACHE_MODE_M (BIT(2)) -#define DPORT_PRO_CACHE_MODE_V 0x1 -#define DPORT_PRO_CACHE_MODE_S 2 - -#define DPORT_PRO_CACHE_CTRL1_REG (DR_REG_DPORT_BASE + 0x044) -/* DPORT_PRO_CACHE_MMU_IA_CLR : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_MMU_IA_CLR (BIT(13)) -#define DPORT_PRO_CACHE_MMU_IA_CLR_M (BIT(13)) -#define DPORT_PRO_CACHE_MMU_IA_CLR_V 0x1 -#define DPORT_PRO_CACHE_MMU_IA_CLR_S 13 -/* DPORT_PRO_CMMU_PD : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_CMMU_PD (BIT(12)) -#define DPORT_PRO_CMMU_PD_M (BIT(12)) -#define DPORT_PRO_CMMU_PD_V 0x1 -#define DPORT_PRO_CMMU_PD_S 12 -/* DPORT_PRO_CMMU_FORCE_ON : R/W ;bitpos:[11] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_PRO_CMMU_FORCE_ON (BIT(11)) -#define DPORT_PRO_CMMU_FORCE_ON_M (BIT(11)) -#define DPORT_PRO_CMMU_FORCE_ON_V 0x1 -#define DPORT_PRO_CMMU_FORCE_ON_S 11 -/* DPORT_PRO_CMMU_FLASH_PAGE_MODE : R/W ;bitpos:[10:9] ;default: 2'b0 ; */ -/*description: */ -#define DPORT_PRO_CMMU_FLASH_PAGE_MODE 0x00000003 -#define DPORT_PRO_CMMU_FLASH_PAGE_MODE_M ((DPORT_PRO_CMMU_FLASH_PAGE_MODE_V)<<(DPORT_PRO_CMMU_FLASH_PAGE_MODE_S)) -#define DPORT_PRO_CMMU_FLASH_PAGE_MODE_V 0x3 -#define DPORT_PRO_CMMU_FLASH_PAGE_MODE_S 9 -/* DPORT_PRO_CMMU_SRAM_PAGE_MODE : R/W ;bitpos:[8:6] ;default: 3'd3 ; */ -/*description: */ -#define DPORT_PRO_CMMU_SRAM_PAGE_MODE 0x00000007 -#define DPORT_PRO_CMMU_SRAM_PAGE_MODE_M ((DPORT_PRO_CMMU_SRAM_PAGE_MODE_V)<<(DPORT_PRO_CMMU_SRAM_PAGE_MODE_S)) -#define DPORT_PRO_CMMU_SRAM_PAGE_MODE_V 0x7 -#define DPORT_PRO_CMMU_SRAM_PAGE_MODE_S 6 -/* DPORT_PRO_CACHE_MASK_OPSDRAM : R/W ;bitpos:[5] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_PRO_CACHE_MASK_OPSDRAM (BIT(5)) -#define DPORT_PRO_CACHE_MASK_OPSDRAM_M (BIT(5)) -#define DPORT_PRO_CACHE_MASK_OPSDRAM_V 0x1 -#define DPORT_PRO_CACHE_MASK_OPSDRAM_S 5 -/* DPORT_PRO_CACHE_MASK_DROM0 : R/W ;bitpos:[4] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_PRO_CACHE_MASK_DROM0 (BIT(4)) -#define DPORT_PRO_CACHE_MASK_DROM0_M (BIT(4)) -#define DPORT_PRO_CACHE_MASK_DROM0_V 0x1 -#define DPORT_PRO_CACHE_MASK_DROM0_S 4 -/* DPORT_PRO_CACHE_MASK_DRAM1 : R/W ;bitpos:[3] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_PRO_CACHE_MASK_DRAM1 (BIT(3)) -#define DPORT_PRO_CACHE_MASK_DRAM1_M (BIT(3)) -#define DPORT_PRO_CACHE_MASK_DRAM1_V 0x1 -#define DPORT_PRO_CACHE_MASK_DRAM1_S 3 -/* DPORT_PRO_CACHE_MASK_IROM0 : R/W ;bitpos:[2] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_PRO_CACHE_MASK_IROM0 (BIT(2)) -#define DPORT_PRO_CACHE_MASK_IROM0_M (BIT(2)) -#define DPORT_PRO_CACHE_MASK_IROM0_V 0x1 -#define DPORT_PRO_CACHE_MASK_IROM0_S 2 -/* DPORT_PRO_CACHE_MASK_IRAM1 : R/W ;bitpos:[1] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_PRO_CACHE_MASK_IRAM1 (BIT(1)) -#define DPORT_PRO_CACHE_MASK_IRAM1_M (BIT(1)) -#define DPORT_PRO_CACHE_MASK_IRAM1_V 0x1 -#define DPORT_PRO_CACHE_MASK_IRAM1_S 1 -/* DPORT_PRO_CACHE_MASK_IRAM0 : R/W ;bitpos:[0] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_PRO_CACHE_MASK_IRAM0 (BIT(0)) -#define DPORT_PRO_CACHE_MASK_IRAM0_M (BIT(0)) -#define DPORT_PRO_CACHE_MASK_IRAM0_V 0x1 -#define DPORT_PRO_CACHE_MASK_IRAM0_S 0 - -#define DPORT_PRO_CACHE_LOCK_0_ADDR_REG (DR_REG_DPORT_BASE + 0x048) -/* DPORT_PRO_CACHE_LOCK_0_ADDR_MAX : R/W ;bitpos:[21:18] ;default: 4'h0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_LOCK_0_ADDR_MAX 0x0000000F -#define DPORT_PRO_CACHE_LOCK_0_ADDR_MAX_M ((DPORT_PRO_CACHE_LOCK_0_ADDR_MAX_V)<<(DPORT_PRO_CACHE_LOCK_0_ADDR_MAX_S)) -#define DPORT_PRO_CACHE_LOCK_0_ADDR_MAX_V 0xF -#define DPORT_PRO_CACHE_LOCK_0_ADDR_MAX_S 18 -/* DPORT_PRO_CACHE_LOCK_0_ADDR_MIN : R/W ;bitpos:[17:14] ;default: 4'h0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_LOCK_0_ADDR_MIN 0x0000000F -#define DPORT_PRO_CACHE_LOCK_0_ADDR_MIN_M ((DPORT_PRO_CACHE_LOCK_0_ADDR_MIN_V)<<(DPORT_PRO_CACHE_LOCK_0_ADDR_MIN_S)) -#define DPORT_PRO_CACHE_LOCK_0_ADDR_MIN_V 0xF -#define DPORT_PRO_CACHE_LOCK_0_ADDR_MIN_S 14 -/* DPORT_PRO_CACHE_LOCK_0_ADDR_PRE : R/W ;bitpos:[13:0] ;default: 14'h0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_LOCK_0_ADDR_PRE 0x00003FFF -#define DPORT_PRO_CACHE_LOCK_0_ADDR_PRE_M ((DPORT_PRO_CACHE_LOCK_0_ADDR_PRE_V)<<(DPORT_PRO_CACHE_LOCK_0_ADDR_PRE_S)) -#define DPORT_PRO_CACHE_LOCK_0_ADDR_PRE_V 0x3FFF -#define DPORT_PRO_CACHE_LOCK_0_ADDR_PRE_S 0 - -#define DPORT_PRO_CACHE_LOCK_1_ADDR_REG (DR_REG_DPORT_BASE + 0x04C) -/* DPORT_PRO_CACHE_LOCK_1_ADDR_MAX : R/W ;bitpos:[21:18] ;default: 4'h0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_LOCK_1_ADDR_MAX 0x0000000F -#define DPORT_PRO_CACHE_LOCK_1_ADDR_MAX_M ((DPORT_PRO_CACHE_LOCK_1_ADDR_MAX_V)<<(DPORT_PRO_CACHE_LOCK_1_ADDR_MAX_S)) -#define DPORT_PRO_CACHE_LOCK_1_ADDR_MAX_V 0xF -#define DPORT_PRO_CACHE_LOCK_1_ADDR_MAX_S 18 -/* DPORT_PRO_CACHE_LOCK_1_ADDR_MIN : R/W ;bitpos:[17:14] ;default: 4'h0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_LOCK_1_ADDR_MIN 0x0000000F -#define DPORT_PRO_CACHE_LOCK_1_ADDR_MIN_M ((DPORT_PRO_CACHE_LOCK_1_ADDR_MIN_V)<<(DPORT_PRO_CACHE_LOCK_1_ADDR_MIN_S)) -#define DPORT_PRO_CACHE_LOCK_1_ADDR_MIN_V 0xF -#define DPORT_PRO_CACHE_LOCK_1_ADDR_MIN_S 14 -/* DPORT_PRO_CACHE_LOCK_1_ADDR_PRE : R/W ;bitpos:[13:0] ;default: 14'h0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_LOCK_1_ADDR_PRE 0x00003FFF -#define DPORT_PRO_CACHE_LOCK_1_ADDR_PRE_M ((DPORT_PRO_CACHE_LOCK_1_ADDR_PRE_V)<<(DPORT_PRO_CACHE_LOCK_1_ADDR_PRE_S)) -#define DPORT_PRO_CACHE_LOCK_1_ADDR_PRE_V 0x3FFF -#define DPORT_PRO_CACHE_LOCK_1_ADDR_PRE_S 0 - -#define DPORT_PRO_CACHE_LOCK_2_ADDR_REG (DR_REG_DPORT_BASE + 0x050) -/* DPORT_PRO_CACHE_LOCK_2_ADDR_MAX : R/W ;bitpos:[21:18] ;default: 4'h0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_LOCK_2_ADDR_MAX 0x0000000F -#define DPORT_PRO_CACHE_LOCK_2_ADDR_MAX_M ((DPORT_PRO_CACHE_LOCK_2_ADDR_MAX_V)<<(DPORT_PRO_CACHE_LOCK_2_ADDR_MAX_S)) -#define DPORT_PRO_CACHE_LOCK_2_ADDR_MAX_V 0xF -#define DPORT_PRO_CACHE_LOCK_2_ADDR_MAX_S 18 -/* DPORT_PRO_CACHE_LOCK_2_ADDR_MIN : R/W ;bitpos:[17:14] ;default: 4'h0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_LOCK_2_ADDR_MIN 0x0000000F -#define DPORT_PRO_CACHE_LOCK_2_ADDR_MIN_M ((DPORT_PRO_CACHE_LOCK_2_ADDR_MIN_V)<<(DPORT_PRO_CACHE_LOCK_2_ADDR_MIN_S)) -#define DPORT_PRO_CACHE_LOCK_2_ADDR_MIN_V 0xF -#define DPORT_PRO_CACHE_LOCK_2_ADDR_MIN_S 14 -/* DPORT_PRO_CACHE_LOCK_2_ADDR_PRE : R/W ;bitpos:[13:0] ;default: 14'h0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_LOCK_2_ADDR_PRE 0x00003FFF -#define DPORT_PRO_CACHE_LOCK_2_ADDR_PRE_M ((DPORT_PRO_CACHE_LOCK_2_ADDR_PRE_V)<<(DPORT_PRO_CACHE_LOCK_2_ADDR_PRE_S)) -#define DPORT_PRO_CACHE_LOCK_2_ADDR_PRE_V 0x3FFF -#define DPORT_PRO_CACHE_LOCK_2_ADDR_PRE_S 0 - -#define DPORT_PRO_CACHE_LOCK_3_ADDR_REG (DR_REG_DPORT_BASE + 0x054) -/* DPORT_PRO_CACHE_LOCK_3_ADDR_MAX : R/W ;bitpos:[21:18] ;default: 4'h0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_LOCK_3_ADDR_MAX 0x0000000F -#define DPORT_PRO_CACHE_LOCK_3_ADDR_MAX_M ((DPORT_PRO_CACHE_LOCK_3_ADDR_MAX_V)<<(DPORT_PRO_CACHE_LOCK_3_ADDR_MAX_S)) -#define DPORT_PRO_CACHE_LOCK_3_ADDR_MAX_V 0xF -#define DPORT_PRO_CACHE_LOCK_3_ADDR_MAX_S 18 -/* DPORT_PRO_CACHE_LOCK_3_ADDR_MIN : R/W ;bitpos:[17:14] ;default: 4'h0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_LOCK_3_ADDR_MIN 0x0000000F -#define DPORT_PRO_CACHE_LOCK_3_ADDR_MIN_M ((DPORT_PRO_CACHE_LOCK_3_ADDR_MIN_V)<<(DPORT_PRO_CACHE_LOCK_3_ADDR_MIN_S)) -#define DPORT_PRO_CACHE_LOCK_3_ADDR_MIN_V 0xF -#define DPORT_PRO_CACHE_LOCK_3_ADDR_MIN_S 14 -/* DPORT_PRO_CACHE_LOCK_3_ADDR_PRE : R/W ;bitpos:[13:0] ;default: 14'h0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_LOCK_3_ADDR_PRE 0x00003FFF -#define DPORT_PRO_CACHE_LOCK_3_ADDR_PRE_M ((DPORT_PRO_CACHE_LOCK_3_ADDR_PRE_V)<<(DPORT_PRO_CACHE_LOCK_3_ADDR_PRE_S)) -#define DPORT_PRO_CACHE_LOCK_3_ADDR_PRE_V 0x3FFF -#define DPORT_PRO_CACHE_LOCK_3_ADDR_PRE_S 0 - -#define DPORT_APP_CACHE_CTRL_REG (DR_REG_DPORT_BASE + 0x058) -/* DPORT_APP_DRAM_HL : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_DRAM_HL (BIT(14)) -#define DPORT_APP_DRAM_HL_M (BIT(14)) -#define DPORT_APP_DRAM_HL_V 0x1 -#define DPORT_APP_DRAM_HL_S 14 -/* DPORT_APP_SLAVE_REQ : RO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_SLAVE_REQ (BIT(13)) -#define DPORT_APP_SLAVE_REQ_M (BIT(13)) -#define DPORT_APP_SLAVE_REQ_V 0x1 -#define DPORT_APP_SLAVE_REQ_S 13 -/* DPORT_APP_AHB_SPI_REQ : RO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_AHB_SPI_REQ (BIT(12)) -#define DPORT_APP_AHB_SPI_REQ_M (BIT(12)) -#define DPORT_APP_AHB_SPI_REQ_V 0x1 -#define DPORT_APP_AHB_SPI_REQ_S 12 -/* DPORT_APP_DRAM_SPLIT : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_DRAM_SPLIT (BIT(11)) -#define DPORT_APP_DRAM_SPLIT_M (BIT(11)) -#define DPORT_APP_DRAM_SPLIT_V 0x1 -#define DPORT_APP_DRAM_SPLIT_S 11 -/* DPORT_APP_SINGLE_IRAM_ENA : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_SINGLE_IRAM_ENA (BIT(10)) -#define DPORT_APP_SINGLE_IRAM_ENA_M (BIT(10)) -#define DPORT_APP_SINGLE_IRAM_ENA_V 0x1 -#define DPORT_APP_SINGLE_IRAM_ENA_S 10 -/* DPORT_APP_CACHE_LOCK_3_EN : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_CACHE_LOCK_3_EN (BIT(9)) -#define DPORT_APP_CACHE_LOCK_3_EN_M (BIT(9)) -#define DPORT_APP_CACHE_LOCK_3_EN_V 0x1 -#define DPORT_APP_CACHE_LOCK_3_EN_S 9 -/* DPORT_APP_CACHE_LOCK_2_EN : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_CACHE_LOCK_2_EN (BIT(8)) -#define DPORT_APP_CACHE_LOCK_2_EN_M (BIT(8)) -#define DPORT_APP_CACHE_LOCK_2_EN_V 0x1 -#define DPORT_APP_CACHE_LOCK_2_EN_S 8 -/* DPORT_APP_CACHE_LOCK_1_EN : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_CACHE_LOCK_1_EN (BIT(7)) -#define DPORT_APP_CACHE_LOCK_1_EN_M (BIT(7)) -#define DPORT_APP_CACHE_LOCK_1_EN_V 0x1 -#define DPORT_APP_CACHE_LOCK_1_EN_S 7 -/* DPORT_APP_CACHE_LOCK_0_EN : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_CACHE_LOCK_0_EN (BIT(6)) -#define DPORT_APP_CACHE_LOCK_0_EN_M (BIT(6)) -#define DPORT_APP_CACHE_LOCK_0_EN_V 0x1 -#define DPORT_APP_CACHE_LOCK_0_EN_S 6 -/* DPORT_APP_CACHE_FLUSH_DONE : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_CACHE_FLUSH_DONE (BIT(5)) -#define DPORT_APP_CACHE_FLUSH_DONE_M (BIT(5)) -#define DPORT_APP_CACHE_FLUSH_DONE_V 0x1 -#define DPORT_APP_CACHE_FLUSH_DONE_S 5 -/* DPORT_APP_CACHE_FLUSH_ENA : R/W ;bitpos:[4] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_APP_CACHE_FLUSH_ENA (BIT(4)) -#define DPORT_APP_CACHE_FLUSH_ENA_M (BIT(4)) -#define DPORT_APP_CACHE_FLUSH_ENA_V 0x1 -#define DPORT_APP_CACHE_FLUSH_ENA_S 4 -/* DPORT_APP_CACHE_ENABLE : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_CACHE_ENABLE (BIT(3)) -#define DPORT_APP_CACHE_ENABLE_M (BIT(3)) -#define DPORT_APP_CACHE_ENABLE_V 0x1 -#define DPORT_APP_CACHE_ENABLE_S 3 -/* DPORT_APP_CACHE_MODE : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_CACHE_MODE (BIT(2)) -#define DPORT_APP_CACHE_MODE_M (BIT(2)) -#define DPORT_APP_CACHE_MODE_V 0x1 -#define DPORT_APP_CACHE_MODE_S 2 - -#define DPORT_APP_CACHE_CTRL1_REG (DR_REG_DPORT_BASE + 0x05C) -/* DPORT_APP_CACHE_MMU_IA_CLR : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_CACHE_MMU_IA_CLR (BIT(13)) -#define DPORT_APP_CACHE_MMU_IA_CLR_M (BIT(13)) -#define DPORT_APP_CACHE_MMU_IA_CLR_V 0x1 -#define DPORT_APP_CACHE_MMU_IA_CLR_S 13 -/* DPORT_APP_CMMU_PD : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_CMMU_PD (BIT(12)) -#define DPORT_APP_CMMU_PD_M (BIT(12)) -#define DPORT_APP_CMMU_PD_V 0x1 -#define DPORT_APP_CMMU_PD_S 12 -/* DPORT_APP_CMMU_FORCE_ON : R/W ;bitpos:[11] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_APP_CMMU_FORCE_ON (BIT(11)) -#define DPORT_APP_CMMU_FORCE_ON_M (BIT(11)) -#define DPORT_APP_CMMU_FORCE_ON_V 0x1 -#define DPORT_APP_CMMU_FORCE_ON_S 11 -/* DPORT_APP_CMMU_FLASH_PAGE_MODE : R/W ;bitpos:[10:9] ;default: 2'b0 ; */ -/*description: */ -#define DPORT_APP_CMMU_FLASH_PAGE_MODE 0x00000003 -#define DPORT_APP_CMMU_FLASH_PAGE_MODE_M ((DPORT_APP_CMMU_FLASH_PAGE_MODE_V)<<(DPORT_APP_CMMU_FLASH_PAGE_MODE_S)) -#define DPORT_APP_CMMU_FLASH_PAGE_MODE_V 0x3 -#define DPORT_APP_CMMU_FLASH_PAGE_MODE_S 9 -/* DPORT_APP_CMMU_SRAM_PAGE_MODE : R/W ;bitpos:[8:6] ;default: 3'd3 ; */ -/*description: */ -#define DPORT_APP_CMMU_SRAM_PAGE_MODE 0x00000007 -#define DPORT_APP_CMMU_SRAM_PAGE_MODE_M ((DPORT_APP_CMMU_SRAM_PAGE_MODE_V)<<(DPORT_APP_CMMU_SRAM_PAGE_MODE_S)) -#define DPORT_APP_CMMU_SRAM_PAGE_MODE_V 0x7 -#define DPORT_APP_CMMU_SRAM_PAGE_MODE_S 6 -/* DPORT_APP_CACHE_MASK_OPSDRAM : R/W ;bitpos:[5] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_APP_CACHE_MASK_OPSDRAM (BIT(5)) -#define DPORT_APP_CACHE_MASK_OPSDRAM_M (BIT(5)) -#define DPORT_APP_CACHE_MASK_OPSDRAM_V 0x1 -#define DPORT_APP_CACHE_MASK_OPSDRAM_S 5 -/* DPORT_APP_CACHE_MASK_DROM0 : R/W ;bitpos:[4] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_APP_CACHE_MASK_DROM0 (BIT(4)) -#define DPORT_APP_CACHE_MASK_DROM0_M (BIT(4)) -#define DPORT_APP_CACHE_MASK_DROM0_V 0x1 -#define DPORT_APP_CACHE_MASK_DROM0_S 4 -/* DPORT_APP_CACHE_MASK_DRAM1 : R/W ;bitpos:[3] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_APP_CACHE_MASK_DRAM1 (BIT(3)) -#define DPORT_APP_CACHE_MASK_DRAM1_M (BIT(3)) -#define DPORT_APP_CACHE_MASK_DRAM1_V 0x1 -#define DPORT_APP_CACHE_MASK_DRAM1_S 3 -/* DPORT_APP_CACHE_MASK_IROM0 : R/W ;bitpos:[2] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_APP_CACHE_MASK_IROM0 (BIT(2)) -#define DPORT_APP_CACHE_MASK_IROM0_M (BIT(2)) -#define DPORT_APP_CACHE_MASK_IROM0_V 0x1 -#define DPORT_APP_CACHE_MASK_IROM0_S 2 -/* DPORT_APP_CACHE_MASK_IRAM1 : R/W ;bitpos:[1] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_APP_CACHE_MASK_IRAM1 (BIT(1)) -#define DPORT_APP_CACHE_MASK_IRAM1_M (BIT(1)) -#define DPORT_APP_CACHE_MASK_IRAM1_V 0x1 -#define DPORT_APP_CACHE_MASK_IRAM1_S 1 -/* DPORT_APP_CACHE_MASK_IRAM0 : R/W ;bitpos:[0] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_APP_CACHE_MASK_IRAM0 (BIT(0)) -#define DPORT_APP_CACHE_MASK_IRAM0_M (BIT(0)) -#define DPORT_APP_CACHE_MASK_IRAM0_V 0x1 -#define DPORT_APP_CACHE_MASK_IRAM0_S 0 - -#define DPORT_APP_CACHE_LOCK_0_ADDR_REG (DR_REG_DPORT_BASE + 0x060) -/* DPORT_APP_CACHE_LOCK_0_ADDR_MAX : R/W ;bitpos:[21:18] ;default: 4'h0 ; */ -/*description: */ -#define DPORT_APP_CACHE_LOCK_0_ADDR_MAX 0x0000000F -#define DPORT_APP_CACHE_LOCK_0_ADDR_MAX_M ((DPORT_APP_CACHE_LOCK_0_ADDR_MAX_V)<<(DPORT_APP_CACHE_LOCK_0_ADDR_MAX_S)) -#define DPORT_APP_CACHE_LOCK_0_ADDR_MAX_V 0xF -#define DPORT_APP_CACHE_LOCK_0_ADDR_MAX_S 18 -/* DPORT_APP_CACHE_LOCK_0_ADDR_MIN : R/W ;bitpos:[17:14] ;default: 4'h0 ; */ -/*description: */ -#define DPORT_APP_CACHE_LOCK_0_ADDR_MIN 0x0000000F -#define DPORT_APP_CACHE_LOCK_0_ADDR_MIN_M ((DPORT_APP_CACHE_LOCK_0_ADDR_MIN_V)<<(DPORT_APP_CACHE_LOCK_0_ADDR_MIN_S)) -#define DPORT_APP_CACHE_LOCK_0_ADDR_MIN_V 0xF -#define DPORT_APP_CACHE_LOCK_0_ADDR_MIN_S 14 -/* DPORT_APP_CACHE_LOCK_0_ADDR_PRE : R/W ;bitpos:[13:0] ;default: 14'h0 ; */ -/*description: */ -#define DPORT_APP_CACHE_LOCK_0_ADDR_PRE 0x00003FFF -#define DPORT_APP_CACHE_LOCK_0_ADDR_PRE_M ((DPORT_APP_CACHE_LOCK_0_ADDR_PRE_V)<<(DPORT_APP_CACHE_LOCK_0_ADDR_PRE_S)) -#define DPORT_APP_CACHE_LOCK_0_ADDR_PRE_V 0x3FFF -#define DPORT_APP_CACHE_LOCK_0_ADDR_PRE_S 0 - -#define DPORT_APP_CACHE_LOCK_1_ADDR_REG (DR_REG_DPORT_BASE + 0x064) -/* DPORT_APP_CACHE_LOCK_1_ADDR_MAX : R/W ;bitpos:[21:18] ;default: 4'h0 ; */ -/*description: */ -#define DPORT_APP_CACHE_LOCK_1_ADDR_MAX 0x0000000F -#define DPORT_APP_CACHE_LOCK_1_ADDR_MAX_M ((DPORT_APP_CACHE_LOCK_1_ADDR_MAX_V)<<(DPORT_APP_CACHE_LOCK_1_ADDR_MAX_S)) -#define DPORT_APP_CACHE_LOCK_1_ADDR_MAX_V 0xF -#define DPORT_APP_CACHE_LOCK_1_ADDR_MAX_S 18 -/* DPORT_APP_CACHE_LOCK_1_ADDR_MIN : R/W ;bitpos:[17:14] ;default: 4'h0 ; */ -/*description: */ -#define DPORT_APP_CACHE_LOCK_1_ADDR_MIN 0x0000000F -#define DPORT_APP_CACHE_LOCK_1_ADDR_MIN_M ((DPORT_APP_CACHE_LOCK_1_ADDR_MIN_V)<<(DPORT_APP_CACHE_LOCK_1_ADDR_MIN_S)) -#define DPORT_APP_CACHE_LOCK_1_ADDR_MIN_V 0xF -#define DPORT_APP_CACHE_LOCK_1_ADDR_MIN_S 14 -/* DPORT_APP_CACHE_LOCK_1_ADDR_PRE : R/W ;bitpos:[13:0] ;default: 14'h0 ; */ -/*description: */ -#define DPORT_APP_CACHE_LOCK_1_ADDR_PRE 0x00003FFF -#define DPORT_APP_CACHE_LOCK_1_ADDR_PRE_M ((DPORT_APP_CACHE_LOCK_1_ADDR_PRE_V)<<(DPORT_APP_CACHE_LOCK_1_ADDR_PRE_S)) -#define DPORT_APP_CACHE_LOCK_1_ADDR_PRE_V 0x3FFF -#define DPORT_APP_CACHE_LOCK_1_ADDR_PRE_S 0 - -#define DPORT_APP_CACHE_LOCK_2_ADDR_REG (DR_REG_DPORT_BASE + 0x068) -/* DPORT_APP_CACHE_LOCK_2_ADDR_MAX : R/W ;bitpos:[21:18] ;default: 4'h0 ; */ -/*description: */ -#define DPORT_APP_CACHE_LOCK_2_ADDR_MAX 0x0000000F -#define DPORT_APP_CACHE_LOCK_2_ADDR_MAX_M ((DPORT_APP_CACHE_LOCK_2_ADDR_MAX_V)<<(DPORT_APP_CACHE_LOCK_2_ADDR_MAX_S)) -#define DPORT_APP_CACHE_LOCK_2_ADDR_MAX_V 0xF -#define DPORT_APP_CACHE_LOCK_2_ADDR_MAX_S 18 -/* DPORT_APP_CACHE_LOCK_2_ADDR_MIN : R/W ;bitpos:[17:14] ;default: 4'h0 ; */ -/*description: */ -#define DPORT_APP_CACHE_LOCK_2_ADDR_MIN 0x0000000F -#define DPORT_APP_CACHE_LOCK_2_ADDR_MIN_M ((DPORT_APP_CACHE_LOCK_2_ADDR_MIN_V)<<(DPORT_APP_CACHE_LOCK_2_ADDR_MIN_S)) -#define DPORT_APP_CACHE_LOCK_2_ADDR_MIN_V 0xF -#define DPORT_APP_CACHE_LOCK_2_ADDR_MIN_S 14 -/* DPORT_APP_CACHE_LOCK_2_ADDR_PRE : R/W ;bitpos:[13:0] ;default: 14'h0 ; */ -/*description: */ -#define DPORT_APP_CACHE_LOCK_2_ADDR_PRE 0x00003FFF -#define DPORT_APP_CACHE_LOCK_2_ADDR_PRE_M ((DPORT_APP_CACHE_LOCK_2_ADDR_PRE_V)<<(DPORT_APP_CACHE_LOCK_2_ADDR_PRE_S)) -#define DPORT_APP_CACHE_LOCK_2_ADDR_PRE_V 0x3FFF -#define DPORT_APP_CACHE_LOCK_2_ADDR_PRE_S 0 - -#define DPORT_APP_CACHE_LOCK_3_ADDR_REG (DR_REG_DPORT_BASE + 0x06C) -/* DPORT_APP_CACHE_LOCK_3_ADDR_MAX : R/W ;bitpos:[21:18] ;default: 4'h0 ; */ -/*description: */ -#define DPORT_APP_CACHE_LOCK_3_ADDR_MAX 0x0000000F -#define DPORT_APP_CACHE_LOCK_3_ADDR_MAX_M ((DPORT_APP_CACHE_LOCK_3_ADDR_MAX_V)<<(DPORT_APP_CACHE_LOCK_3_ADDR_MAX_S)) -#define DPORT_APP_CACHE_LOCK_3_ADDR_MAX_V 0xF -#define DPORT_APP_CACHE_LOCK_3_ADDR_MAX_S 18 -/* DPORT_APP_CACHE_LOCK_3_ADDR_MIN : R/W ;bitpos:[17:14] ;default: 4'h0 ; */ -/*description: */ -#define DPORT_APP_CACHE_LOCK_3_ADDR_MIN 0x0000000F -#define DPORT_APP_CACHE_LOCK_3_ADDR_MIN_M ((DPORT_APP_CACHE_LOCK_3_ADDR_MIN_V)<<(DPORT_APP_CACHE_LOCK_3_ADDR_MIN_S)) -#define DPORT_APP_CACHE_LOCK_3_ADDR_MIN_V 0xF -#define DPORT_APP_CACHE_LOCK_3_ADDR_MIN_S 14 -/* DPORT_APP_CACHE_LOCK_3_ADDR_PRE : R/W ;bitpos:[13:0] ;default: 14'h0 ; */ -/*description: */ -#define DPORT_APP_CACHE_LOCK_3_ADDR_PRE 0x00003FFF -#define DPORT_APP_CACHE_LOCK_3_ADDR_PRE_M ((DPORT_APP_CACHE_LOCK_3_ADDR_PRE_V)<<(DPORT_APP_CACHE_LOCK_3_ADDR_PRE_S)) -#define DPORT_APP_CACHE_LOCK_3_ADDR_PRE_V 0x3FFF -#define DPORT_APP_CACHE_LOCK_3_ADDR_PRE_S 0 - -#define DPORT_TRACEMEM_MUX_MODE_REG (DR_REG_DPORT_BASE + 0x070) -/* DPORT_TRACEMEM_MUX_MODE : R/W ;bitpos:[1:0] ;default: 2'b0 ; */ -/*description: */ -#define DPORT_TRACEMEM_MUX_MODE 0x00000003 -#define DPORT_TRACEMEM_MUX_MODE_M ((DPORT_TRACEMEM_MUX_MODE_V)<<(DPORT_TRACEMEM_MUX_MODE_S)) -#define DPORT_TRACEMEM_MUX_MODE_V 0x3 -#define DPORT_TRACEMEM_MUX_MODE_S 0 - -#define DPORT_PRO_TRACEMEM_ENA_REG (DR_REG_DPORT_BASE + 0x074) -/* DPORT_PRO_TRACEMEM_ENA : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_TRACEMEM_ENA (BIT(0)) -#define DPORT_PRO_TRACEMEM_ENA_M (BIT(0)) -#define DPORT_PRO_TRACEMEM_ENA_V 0x1 -#define DPORT_PRO_TRACEMEM_ENA_S 0 - -#define DPORT_APP_TRACEMEM_ENA_REG (DR_REG_DPORT_BASE + 0x078) -/* DPORT_APP_TRACEMEM_ENA : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_TRACEMEM_ENA (BIT(0)) -#define DPORT_APP_TRACEMEM_ENA_M (BIT(0)) -#define DPORT_APP_TRACEMEM_ENA_V 0x1 -#define DPORT_APP_TRACEMEM_ENA_S 0 - -#define DPORT_CACHE_MUX_MODE_REG (DR_REG_DPORT_BASE + 0x07C) -/* DPORT_CACHE_MUX_MODE : R/W ;bitpos:[1:0] ;default: 2'b0 ; */ -/*description: */ -#define DPORT_CACHE_MUX_MODE 0x00000003 -#define DPORT_CACHE_MUX_MODE_M ((DPORT_CACHE_MUX_MODE_V)<<(DPORT_CACHE_MUX_MODE_S)) -#define DPORT_CACHE_MUX_MODE_V 0x3 -#define DPORT_CACHE_MUX_MODE_S 0 - -#define DPORT_IMMU_PAGE_MODE_REG (DR_REG_DPORT_BASE + 0x080) -/* DPORT_IMMU_PAGE_MODE : R/W ;bitpos:[2:1] ;default: 2'b0 ; */ -/*description: */ -#define DPORT_IMMU_PAGE_MODE 0x00000003 -#define DPORT_IMMU_PAGE_MODE_M ((DPORT_IMMU_PAGE_MODE_V)<<(DPORT_IMMU_PAGE_MODE_S)) -#define DPORT_IMMU_PAGE_MODE_V 0x3 -#define DPORT_IMMU_PAGE_MODE_S 1 -/* DPORT_INTERNAL_SRAM_IMMU_ENA : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_INTERNAL_SRAM_IMMU_ENA (BIT(0)) -#define DPORT_INTERNAL_SRAM_IMMU_ENA_M (BIT(0)) -#define DPORT_INTERNAL_SRAM_IMMU_ENA_V 0x1 -#define DPORT_INTERNAL_SRAM_IMMU_ENA_S 0 - -#define DPORT_DMMU_PAGE_MODE_REG (DR_REG_DPORT_BASE + 0x084) -/* DPORT_DMMU_PAGE_MODE : R/W ;bitpos:[2:1] ;default: 2'b0 ; */ -/*description: */ -#define DPORT_DMMU_PAGE_MODE 0x00000003 -#define DPORT_DMMU_PAGE_MODE_M ((DPORT_DMMU_PAGE_MODE_V)<<(DPORT_DMMU_PAGE_MODE_S)) -#define DPORT_DMMU_PAGE_MODE_V 0x3 -#define DPORT_DMMU_PAGE_MODE_S 1 -/* DPORT_INTERNAL_SRAM_DMMU_ENA : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_INTERNAL_SRAM_DMMU_ENA (BIT(0)) -#define DPORT_INTERNAL_SRAM_DMMU_ENA_M (BIT(0)) -#define DPORT_INTERNAL_SRAM_DMMU_ENA_V 0x1 -#define DPORT_INTERNAL_SRAM_DMMU_ENA_S 0 - -#define DPORT_ROM_MPU_ENA_REG (DR_REG_DPORT_BASE + 0x088) -/* DPORT_APP_ROM_MPU_ENA : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_ROM_MPU_ENA (BIT(2)) -#define DPORT_APP_ROM_MPU_ENA_M (BIT(2)) -#define DPORT_APP_ROM_MPU_ENA_V 0x1 -#define DPORT_APP_ROM_MPU_ENA_S 2 -/* DPORT_PRO_ROM_MPU_ENA : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_ROM_MPU_ENA (BIT(1)) -#define DPORT_PRO_ROM_MPU_ENA_M (BIT(1)) -#define DPORT_PRO_ROM_MPU_ENA_V 0x1 -#define DPORT_PRO_ROM_MPU_ENA_S 1 -/* DPORT_SHARE_ROM_MPU_ENA : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_SHARE_ROM_MPU_ENA (BIT(0)) -#define DPORT_SHARE_ROM_MPU_ENA_M (BIT(0)) -#define DPORT_SHARE_ROM_MPU_ENA_V 0x1 -#define DPORT_SHARE_ROM_MPU_ENA_S 0 - -#define DPORT_MEM_PD_MASK_REG (DR_REG_DPORT_BASE + 0x08C) -/* DPORT_LSLP_MEM_PD_MASK : R/W ;bitpos:[0] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_LSLP_MEM_PD_MASK (BIT(0)) -#define DPORT_LSLP_MEM_PD_MASK_M (BIT(0)) -#define DPORT_LSLP_MEM_PD_MASK_V 0x1 -#define DPORT_LSLP_MEM_PD_MASK_S 0 - -#define DPORT_ROM_PD_CTRL_REG (DR_REG_DPORT_BASE + 0x090) -/* DPORT_SHARE_ROM_PD : R/W ;bitpos:[7:2] ;default: 6'h0 ; */ -/*description: */ -#define DPORT_SHARE_ROM_PD 0x0000003F -#define DPORT_SHARE_ROM_PD_M ((DPORT_SHARE_ROM_PD_V)<<(DPORT_SHARE_ROM_PD_S)) -#define DPORT_SHARE_ROM_PD_V 0x3F -#define DPORT_SHARE_ROM_PD_S 2 -/* DPORT_APP_ROM_PD : R/W ;bitpos:[1] ;default: 1'h0 ; */ -/*description: */ -#define DPORT_APP_ROM_PD (BIT(1)) -#define DPORT_APP_ROM_PD_M (BIT(1)) -#define DPORT_APP_ROM_PD_V 0x1 -#define DPORT_APP_ROM_PD_S 1 -/* DPORT_PRO_ROM_PD : R/W ;bitpos:[0] ;default: 1'h0 ; */ -/*description: */ -#define DPORT_PRO_ROM_PD (BIT(0)) -#define DPORT_PRO_ROM_PD_M (BIT(0)) -#define DPORT_PRO_ROM_PD_V 0x1 -#define DPORT_PRO_ROM_PD_S 0 - -#define DPORT_ROM_FO_CTRL_REG (DR_REG_DPORT_BASE + 0x094) -/* DPORT_SHARE_ROM_FO : R/W ;bitpos:[7:2] ;default: 6'h0 ; */ -/*description: */ -#define DPORT_SHARE_ROM_FO 0x0000003F -#define DPORT_SHARE_ROM_FO_M ((DPORT_SHARE_ROM_FO_V)<<(DPORT_SHARE_ROM_FO_S)) -#define DPORT_SHARE_ROM_FO_V 0x3F -#define DPORT_SHARE_ROM_FO_S 2 -/* DPORT_APP_ROM_FO : R/W ;bitpos:[1] ;default: 1'h1 ; */ -/*description: */ -#define DPORT_APP_ROM_FO (BIT(1)) -#define DPORT_APP_ROM_FO_M (BIT(1)) -#define DPORT_APP_ROM_FO_V 0x1 -#define DPORT_APP_ROM_FO_S 1 -/* DPORT_PRO_ROM_FO : R/W ;bitpos:[0] ;default: 1'h1 ; */ -/*description: */ -#define DPORT_PRO_ROM_FO (BIT(0)) -#define DPORT_PRO_ROM_FO_M (BIT(0)) -#define DPORT_PRO_ROM_FO_V 0x1 -#define DPORT_PRO_ROM_FO_S 0 - -#define DPORT_SRAM_PD_CTRL_0_REG (DR_REG_DPORT_BASE + 0x098) -/* DPORT_SRAM_PD_0 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define DPORT_SRAM_PD_0 0xFFFFFFFF -#define DPORT_SRAM_PD_0_M ((DPORT_SRAM_PD_0_V)<<(DPORT_SRAM_PD_0_S)) -#define DPORT_SRAM_PD_0_V 0xFFFFFFFF -#define DPORT_SRAM_PD_0_S 0 - -#define DPORT_SRAM_PD_CTRL_1_REG (DR_REG_DPORT_BASE + 0x09C) -/* DPORT_SRAM_PD_1 : R/W ;bitpos:[0] ;default: 1'h0 ; */ -/*description: */ -#define DPORT_SRAM_PD_1 (BIT(0)) -#define DPORT_SRAM_PD_1_M (BIT(0)) -#define DPORT_SRAM_PD_1_V 0x1 -#define DPORT_SRAM_PD_1_S 0 - -#define DPORT_SRAM_FO_CTRL_0_REG (DR_REG_DPORT_BASE + 0x0A0) -/* DPORT_SRAM_FO_0 : R/W ;bitpos:[31:0] ;default: 32'hffffffff ; */ -/*description: */ -#define DPORT_SRAM_FO_0 0xFFFFFFFF -#define DPORT_SRAM_FO_0_M ((DPORT_SRAM_FO_0_V)<<(DPORT_SRAM_FO_0_S)) -#define DPORT_SRAM_FO_0_V 0xFFFFFFFF -#define DPORT_SRAM_FO_0_S 0 - -#define DPORT_SRAM_FO_CTRL_1_REG (DR_REG_DPORT_BASE + 0x0A4) -/* DPORT_SRAM_FO_1 : R/W ;bitpos:[0] ;default: 1'h1 ; */ -/*description: */ -#define DPORT_SRAM_FO_1 (BIT(0)) -#define DPORT_SRAM_FO_1_M (BIT(0)) -#define DPORT_SRAM_FO_1_V 0x1 -#define DPORT_SRAM_FO_1_S 0 - -#define DPORT_IRAM_DRAM_AHB_SEL_REG (DR_REG_DPORT_BASE + 0x0A8) -/* DPORT_MAC_DUMP_MODE : R/W ;bitpos:[6:5] ;default: 2'h0 ; */ -/*description: */ -#define DPORT_MAC_DUMP_MODE 0x00000003 -#define DPORT_MAC_DUMP_MODE_M ((DPORT_MAC_DUMP_MODE_V)<<(DPORT_MAC_DUMP_MODE_S)) -#define DPORT_MAC_DUMP_MODE_V 0x3 -#define DPORT_MAC_DUMP_MODE_S 5 -/* DPORT_MASK_AHB : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_MASK_AHB (BIT(4)) -#define DPORT_MASK_AHB_M (BIT(4)) -#define DPORT_MASK_AHB_V 0x1 -#define DPORT_MASK_AHB_S 4 -/* DPORT_MASK_APP_DRAM : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_MASK_APP_DRAM (BIT(3)) -#define DPORT_MASK_APP_DRAM_M (BIT(3)) -#define DPORT_MASK_APP_DRAM_V 0x1 -#define DPORT_MASK_APP_DRAM_S 3 -/* DPORT_MASK_PRO_DRAM : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_MASK_PRO_DRAM (BIT(2)) -#define DPORT_MASK_PRO_DRAM_M (BIT(2)) -#define DPORT_MASK_PRO_DRAM_V 0x1 -#define DPORT_MASK_PRO_DRAM_S 2 -/* DPORT_MASK_APP_IRAM : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_MASK_APP_IRAM (BIT(1)) -#define DPORT_MASK_APP_IRAM_M (BIT(1)) -#define DPORT_MASK_APP_IRAM_V 0x1 -#define DPORT_MASK_APP_IRAM_S 1 -/* DPORT_MASK_PRO_IRAM : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_MASK_PRO_IRAM (BIT(0)) -#define DPORT_MASK_PRO_IRAM_M (BIT(0)) -#define DPORT_MASK_PRO_IRAM_V 0x1 -#define DPORT_MASK_PRO_IRAM_S 0 - -#define DPORT_TAG_FO_CTRL_REG (DR_REG_DPORT_BASE + 0x0AC) -/* DPORT_APP_CACHE_TAG_PD : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_CACHE_TAG_PD (BIT(9)) -#define DPORT_APP_CACHE_TAG_PD_M (BIT(9)) -#define DPORT_APP_CACHE_TAG_PD_V 0x1 -#define DPORT_APP_CACHE_TAG_PD_S 9 -/* DPORT_APP_CACHE_TAG_FORCE_ON : R/W ;bitpos:[8] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_APP_CACHE_TAG_FORCE_ON (BIT(8)) -#define DPORT_APP_CACHE_TAG_FORCE_ON_M (BIT(8)) -#define DPORT_APP_CACHE_TAG_FORCE_ON_V 0x1 -#define DPORT_APP_CACHE_TAG_FORCE_ON_S 8 -/* DPORT_PRO_CACHE_TAG_PD : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_TAG_PD (BIT(1)) -#define DPORT_PRO_CACHE_TAG_PD_M (BIT(1)) -#define DPORT_PRO_CACHE_TAG_PD_V 0x1 -#define DPORT_PRO_CACHE_TAG_PD_S 1 -/* DPORT_PRO_CACHE_TAG_FORCE_ON : R/W ;bitpos:[0] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_PRO_CACHE_TAG_FORCE_ON (BIT(0)) -#define DPORT_PRO_CACHE_TAG_FORCE_ON_M (BIT(0)) -#define DPORT_PRO_CACHE_TAG_FORCE_ON_V 0x1 -#define DPORT_PRO_CACHE_TAG_FORCE_ON_S 0 - -#define DPORT_AHB_LITE_MASK_REG (DR_REG_DPORT_BASE + 0x0B0) -/* DPORT_AHB_LITE_SDHOST_PID_REG : R/W ;bitpos:[13:11] ;default: 3'b0 ; */ -/*description: */ -#define DPORT_AHB_LITE_SDHOST_PID_REG 0x00000007 -#define DPORT_AHB_LITE_SDHOST_PID_REG_M ((DPORT_AHB_LITE_SDHOST_PID_REG_V)<<(DPORT_AHB_LITE_SDHOST_PID_REG_S)) -#define DPORT_AHB_LITE_SDHOST_PID_REG_V 0x7 -#define DPORT_AHB_LITE_SDHOST_PID_REG_S 11 -/* DPORT_AHB_LITE_MASK_APPDPORT : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_AHB_LITE_MASK_APPDPORT (BIT(10)) -#define DPORT_AHB_LITE_MASK_APPDPORT_M (BIT(10)) -#define DPORT_AHB_LITE_MASK_APPDPORT_V 0x1 -#define DPORT_AHB_LITE_MASK_APPDPORT_S 10 -/* DPORT_AHB_LITE_MASK_PRODPORT : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_AHB_LITE_MASK_PRODPORT (BIT(9)) -#define DPORT_AHB_LITE_MASK_PRODPORT_M (BIT(9)) -#define DPORT_AHB_LITE_MASK_PRODPORT_V 0x1 -#define DPORT_AHB_LITE_MASK_PRODPORT_S 9 -/* DPORT_AHB_LITE_MASK_SDIO : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_AHB_LITE_MASK_SDIO (BIT(8)) -#define DPORT_AHB_LITE_MASK_SDIO_M (BIT(8)) -#define DPORT_AHB_LITE_MASK_SDIO_V 0x1 -#define DPORT_AHB_LITE_MASK_SDIO_S 8 -/* DPORT_AHB_LITE_MASK_APP : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_AHB_LITE_MASK_APP (BIT(4)) -#define DPORT_AHB_LITE_MASK_APP_M (BIT(4)) -#define DPORT_AHB_LITE_MASK_APP_V 0x1 -#define DPORT_AHB_LITE_MASK_APP_S 4 -/* DPORT_AHB_LITE_MASK_PRO : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_AHB_LITE_MASK_PRO (BIT(0)) -#define DPORT_AHB_LITE_MASK_PRO_M (BIT(0)) -#define DPORT_AHB_LITE_MASK_PRO_V 0x1 -#define DPORT_AHB_LITE_MASK_PRO_S 0 - -#define DPORT_AHB_MPU_TABLE_0_REG (DR_REG_DPORT_BASE + 0x0B4) -/* DPORT_AHB_ACCESS_GRANT_0 : R/W ;bitpos:[31:0] ;default: 32'hffffffff ; */ -/*description: */ -#define DPORT_AHB_ACCESS_GRANT_0 0xFFFFFFFF -#define DPORT_AHB_ACCESS_GRANT_0_M ((DPORT_AHB_ACCESS_GRANT_0_V)<<(DPORT_AHB_ACCESS_GRANT_0_S)) -#define DPORT_AHB_ACCESS_GRANT_0_V 0xFFFFFFFF -#define DPORT_AHB_ACCESS_GRANT_0_S 0 - -#define DPORT_AHB_MPU_TABLE_1_REG (DR_REG_DPORT_BASE + 0x0B8) -/* DPORT_AHB_ACCESS_GRANT_1 : R/W ;bitpos:[8:0] ;default: 9'h1ff ; */ -/*description: */ -#define DPORT_AHB_ACCESS_GRANT_1 0x000001FF -#define DPORT_AHB_ACCESS_GRANT_1_M ((DPORT_AHB_ACCESS_GRANT_1_V)<<(DPORT_AHB_ACCESS_GRANT_1_S)) -#define DPORT_AHB_ACCESS_GRANT_1_V 0x1FF -#define DPORT_AHB_ACCESS_GRANT_1_S 0 - -#define DPORT_HOST_INF_SEL_REG (DR_REG_DPORT_BASE + 0x0BC) -/* DPORT_LINK_DEVICE_SEL : R/W ;bitpos:[15:8] ;default: 8'h0 ; */ -/*description: */ -#define DPORT_LINK_DEVICE_SEL 0x000000FF -#define DPORT_LINK_DEVICE_SEL_M ((DPORT_LINK_DEVICE_SEL_V)<<(DPORT_LINK_DEVICE_SEL_S)) -#define DPORT_LINK_DEVICE_SEL_V 0xFF -#define DPORT_LINK_DEVICE_SEL_S 8 -/* DPORT_PERI_IO_SWAP : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define DPORT_PERI_IO_SWAP 0x000000FF -#define DPORT_PERI_IO_SWAP_M ((DPORT_PERI_IO_SWAP_V)<<(DPORT_PERI_IO_SWAP_S)) -#define DPORT_PERI_IO_SWAP_V 0xFF -#define DPORT_PERI_IO_SWAP_S 0 - -#define DPORT_PERIP_CLK_EN_REG (DR_REG_DPORT_BASE + 0x0C0) -/* DPORT_PERIP_CLK_EN : R/W ;bitpos:[31:0] ;default: 32'hf9c1e06f ; */ -/*description: */ -#define DPORT_PERIP_CLK_EN 0xFFFFFFFF -#define DPORT_PERIP_CLK_EN_M ((DPORT_PERIP_CLK_EN_V)<<(DPORT_PERIP_CLK_EN_S)) -#define DPORT_PERIP_CLK_EN_V 0xFFFFFFFF -#define DPORT_PERIP_CLK_EN_S 0 - -#define DPORT_PWM3_CLK_EN (BIT(26)) -#define DPORT_PWM2_CLK_EN (BIT(25)) -#define DPORT_UART_MEM_CLK_EN (BIT(24)) -#define DPORT_UART2_CLK_EN (BIT(23)) -#define DPORT_SPI_DMA_CLK_EN (BIT(22)) -#define DPORT_I2S1_CLK_EN (BIT(21)) -#define DPORT_PWM1_CLK_EN (BIT(20)) -#define DPORT_CAN_CLK_EN (BIT(19)) -#define DPORT_I2C_EXT1_CLK_EN (BIT(18)) -#define DPORT_PWM0_CLK_EN (BIT(17)) -#define DPORT_SPI_CLK_EN_2 (BIT(16)) /** Deprecated, please use DPORT_SPI3_CLK_EN **/ -#define DPORT_SPI3_CLK_EN (BIT(16)) -#define DPORT_TIMERGROUP1_CLK_EN (BIT(15)) -#define DPORT_EFUSE_CLK_EN (BIT(14)) -#define DPORT_TIMERGROUP_CLK_EN (BIT(13)) -#define DPORT_UHCI1_CLK_EN (BIT(12)) -#define DPORT_LEDC_CLK_EN (BIT(11)) -#define DPORT_PCNT_CLK_EN (BIT(10)) -#define DPORT_RMT_CLK_EN (BIT(9)) -#define DPORT_UHCI0_CLK_EN (BIT(8)) -#define DPORT_I2C_EXT0_CLK_EN (BIT(7)) -#define DPORT_SPI_CLK_EN (BIT(6)) /** Deprecated, please use DPORT_SPI2_CLK_EN **/ -#define DPORT_SPI2_CLK_EN (BIT(6)) -#define DPORT_UART1_CLK_EN (BIT(5)) -#define DPORT_I2S0_CLK_EN (BIT(4)) -#define DPORT_WDG_CLK_EN (BIT(3)) -#define DPORT_UART_CLK_EN (BIT(2)) -#define DPORT_SPI_CLK_EN_1 (BIT(1)) /** Deprecated, please use DPORT_SPI01_CLK_EN **/ -#define DPORT_SPI01_CLK_EN (BIT(1)) -#define DPORT_TIMERS_CLK_EN (BIT(0)) -#define DPORT_PERIP_RST_EN_REG (DR_REG_DPORT_BASE + 0x0C4) -/* DPORT_PERIP_RST : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define DPORT_PERIP_RST 0xFFFFFFFF -#define DPORT_PERIP_RST_M ((DPORT_PERIP_RST_V)<<(DPORT_PERIP_RST_S)) -#define DPORT_PERIP_RST_V 0xFFFFFFFF -#define DPORT_PERIP_RST_S 0 -#define DPORT_PWM3_RST (BIT(26)) -#define DPORT_PWM2_RST (BIT(25)) -#define DPORT_UART_MEM_RST (BIT(24)) -#define DPORT_UART2_RST (BIT(23)) -#define DPORT_SPI_DMA_RST (BIT(22)) -#define DPORT_I2S1_RST (BIT(21)) -#define DPORT_PWM1_RST (BIT(20)) -#define DPORT_CAN_RST (BIT(19)) -#define DPORT_I2C_EXT1_RST (BIT(18)) -#define DPORT_PWM0_RST (BIT(17)) -#define DPORT_SPI_RST_2 (BIT(16)) /** Deprecated, please use DPORT_SPI3_RST **/ -#define DPORT_SPI3_RST (BIT(16)) -#define DPORT_TIMERGROUP1_RST (BIT(15)) -#define DPORT_EFUSE_RST (BIT(14)) -#define DPORT_TIMERGROUP_RST (BIT(13)) -#define DPORT_UHCI1_RST (BIT(12)) -#define DPORT_LEDC_RST (BIT(11)) -#define DPORT_PCNT_RST (BIT(10)) -#define DPORT_RMT_RST (BIT(9)) -#define DPORT_UHCI0_RST (BIT(8)) -#define DPORT_I2C_EXT0_RST (BIT(7)) -#define DPORT_SPI_RST (BIT(6)) /** Deprecated, please use DPORT_SPI2_RST **/ -#define DPORT_SPI2_RST (BIT(6)) -#define DPORT_UART1_RST (BIT(5)) -#define DPORT_I2S0_RST (BIT(4)) -#define DPORT_WDG_RST (BIT(3)) -#define DPORT_UART_RST (BIT(2)) -#define DPORT_SPI_RST_1 (BIT(1)) /** Deprecated, please use DPORT_SPI01_RST **/ -#define DPORT_SPI01_RST (BIT(1)) -#define DPORT_TIMERS_RST (BIT(0)) -#define DPORT_SLAVE_SPI_CONFIG_REG (DR_REG_DPORT_BASE + 0x0C8) -/* DPORT_SPI_DECRYPT_ENABLE : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_SPI_DECRYPT_ENABLE (BIT(12)) -#define DPORT_SPI_DECRYPT_ENABLE_M (BIT(12)) -#define DPORT_SPI_DECRYPT_ENABLE_V 0x1 -#define DPORT_SPI_DECRYPT_ENABLE_S 12 -/* DPORT_SPI_ENCRYPT_ENABLE : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_SPI_ENCRYPT_ENABLE (BIT(8)) -#define DPORT_SPI_ENCRYPT_ENABLE_M (BIT(8)) -#define DPORT_SPI_ENCRYPT_ENABLE_V 0x1 -#define DPORT_SPI_ENCRYPT_ENABLE_S 8 -/* DPORT_SLAVE_SPI_MASK_APP : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_SLAVE_SPI_MASK_APP (BIT(4)) -#define DPORT_SLAVE_SPI_MASK_APP_M (BIT(4)) -#define DPORT_SLAVE_SPI_MASK_APP_V 0x1 -#define DPORT_SLAVE_SPI_MASK_APP_S 4 -/* DPORT_SLAVE_SPI_MASK_PRO : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_SLAVE_SPI_MASK_PRO (BIT(0)) -#define DPORT_SLAVE_SPI_MASK_PRO_M (BIT(0)) -#define DPORT_SLAVE_SPI_MASK_PRO_V 0x1 -#define DPORT_SLAVE_SPI_MASK_PRO_S 0 - -#define DPORT_WIFI_CLK_EN_REG (DR_REG_DPORT_BASE + 0x0CC) -/* DPORT_WIFI_CLK_EN : R/W ;bitpos:[31:0] ;default: 32'hfffce030 ; */ -/*description: */ -#define DPORT_WIFI_CLK_EN 0xFFFFFFFF -#define DPORT_WIFI_CLK_EN_M ((DPORT_WIFI_CLK_EN_V)<<(DPORT_WIFI_CLK_EN_S)) -#define DPORT_WIFI_CLK_EN_V 0xFFFFFFFF -#define DPORT_WIFI_CLK_EN_S 0 - -/* Mask for all Wifi clock bits - 1, 2, 10 */ -#define DPORT_WIFI_CLK_WIFI_EN 0x00000406 -#define DPORT_WIFI_CLK_WIFI_EN_M ((DPORT_WIFI_CLK_WIFI_EN_V)<<(DPORT_WIFI_CLK_WIFI_EN_S)) -#define DPORT_WIFI_CLK_WIFI_EN_V 0x406 -#define DPORT_WIFI_CLK_WIFI_EN_S 0 -/* Mask for all Bluetooth clock bits - 11, 16, 17 */ -#define DPORT_WIFI_CLK_BT_EN 0x61 -#define DPORT_WIFI_CLK_BT_EN_M ((DPORT_WIFI_CLK_BT_EN_V)<<(DPORT_WIFI_CLK_BT_EN_S)) -#define DPORT_WIFI_CLK_BT_EN_V 0x61 -#define DPORT_WIFI_CLK_BT_EN_S 11 -/* Mask for clock bits used by both WIFI and Bluetooth, bit 0, 3, 6, 7, 8, 9 */ -#define DPORT_WIFI_CLK_WIFI_BT_COMMON_M 0x000003c9 -//bluetooth baseband bit11 -#define DPORT_BT_BASEBAND_EN BIT(11) -//bluetooth LC bit16 and bit17 -#define DPORT_BT_LC_EN (BIT(16)|BIT(17)) - -/* Remaining single bit clock masks */ -#define DPORT_WIFI_CLK_SDIOSLAVE_EN BIT(4) -#define DPORT_WIFI_CLK_UNUSED_BIT5 BIT(5) -#define DPORT_WIFI_CLK_UNUSED_BIT12 BIT(12) -#define DPORT_WIFI_CLK_SDIO_HOST_EN BIT(13) -#define DPORT_WIFI_CLK_EMAC_EN BIT(14) -#define DPORT_WIFI_CLK_RNG_EN BIT(15) - -#define DPORT_CORE_RST_EN_REG (DR_REG_DPORT_BASE + 0x0D0) -/* DPORT_CORE_RST : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define DPORT_RW_BTLP_RST (BIT(10)) -#define DPORT_RW_BTMAC_RST (BIT(9)) -#define DPORT_MACPWR_RST (BIT(8)) -#define DPORT_EMAC_RST (BIT(7)) -#define DPORT_SDIO_HOST_RST (BIT(6)) -#define DPORT_SDIO_RST (BIT(5)) -#define DPORT_BTMAC_RST (BIT(4)) -#define DPORT_BT_RST (BIT(3)) -#define DPORT_MAC_RST (BIT(2)) -#define DPORT_FE_RST (BIT(1)) -#define DPORT_BB_RST (BIT(0)) - -#define DPORT_BT_LPCK_DIV_INT_REG (DR_REG_DPORT_BASE + 0x0D4) -/* DPORT_BTEXTWAKEUP_REQ : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_BTEXTWAKEUP_REQ (BIT(12)) -#define DPORT_BTEXTWAKEUP_REQ_M (BIT(12)) -#define DPORT_BTEXTWAKEUP_REQ_V 0x1 -#define DPORT_BTEXTWAKEUP_REQ_S 12 -/* DPORT_BT_LPCK_DIV_NUM : R/W ;bitpos:[11:0] ;default: 12'd255 ; */ -/*description: */ -#define DPORT_BT_LPCK_DIV_NUM 0x00000FFF -#define DPORT_BT_LPCK_DIV_NUM_M ((DPORT_BT_LPCK_DIV_NUM_V)<<(DPORT_BT_LPCK_DIV_NUM_S)) -#define DPORT_BT_LPCK_DIV_NUM_V 0xFFF -#define DPORT_BT_LPCK_DIV_NUM_S 0 - -#define DPORT_BT_LPCK_DIV_FRAC_REG (DR_REG_DPORT_BASE + 0x0D8) -/* DPORT_LPCLK_SEL_XTAL32K : R/W ;bitpos:[27] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_LPCLK_SEL_XTAL32K (BIT(27)) -#define DPORT_LPCLK_SEL_XTAL32K_M (BIT(27)) -#define DPORT_LPCLK_SEL_XTAL32K_V 0x1 -#define DPORT_LPCLK_SEL_XTAL32K_S 27 -/* DPORT_LPCLK_SEL_XTAL : R/W ;bitpos:[26] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_LPCLK_SEL_XTAL (BIT(26)) -#define DPORT_LPCLK_SEL_XTAL_M (BIT(26)) -#define DPORT_LPCLK_SEL_XTAL_V 0x1 -#define DPORT_LPCLK_SEL_XTAL_S 26 -/* DPORT_LPCLK_SEL_8M : R/W ;bitpos:[25] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_LPCLK_SEL_8M (BIT(25)) -#define DPORT_LPCLK_SEL_8M_M (BIT(25)) -#define DPORT_LPCLK_SEL_8M_V 0x1 -#define DPORT_LPCLK_SEL_8M_S 25 -/* DPORT_LPCLK_SEL_RTC_SLOW : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_LPCLK_SEL_RTC_SLOW (BIT(24)) -#define DPORT_LPCLK_SEL_RTC_SLOW_M (BIT(24)) -#define DPORT_LPCLK_SEL_RTC_SLOW_V 0x1 -#define DPORT_LPCLK_SEL_RTC_SLOW_S 24 -/* DPORT_BT_LPCK_DIV_A : R/W ;bitpos:[23:12] ;default: 12'd1 ; */ -/*description: */ -#define DPORT_BT_LPCK_DIV_A 0x00000FFF -#define DPORT_BT_LPCK_DIV_A_M ((DPORT_BT_LPCK_DIV_A_V)<<(DPORT_BT_LPCK_DIV_A_S)) -#define DPORT_BT_LPCK_DIV_A_V 0xFFF -#define DPORT_BT_LPCK_DIV_A_S 12 -/* DPORT_BT_LPCK_DIV_B : R/W ;bitpos:[11:0] ;default: 12'd1 ; */ -/*description: */ -#define DPORT_BT_LPCK_DIV_B 0x00000FFF -#define DPORT_BT_LPCK_DIV_B_M ((DPORT_BT_LPCK_DIV_B_V)<<(DPORT_BT_LPCK_DIV_B_S)) -#define DPORT_BT_LPCK_DIV_B_V 0xFFF -#define DPORT_BT_LPCK_DIV_B_S 0 - -#define DPORT_CPU_INTR_FROM_CPU_0_REG (DR_REG_DPORT_BASE + 0x0DC) -/* DPORT_CPU_INTR_FROM_CPU_0 : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_CPU_INTR_FROM_CPU_0 (BIT(0)) -#define DPORT_CPU_INTR_FROM_CPU_0_M (BIT(0)) -#define DPORT_CPU_INTR_FROM_CPU_0_V 0x1 -#define DPORT_CPU_INTR_FROM_CPU_0_S 0 - -#define DPORT_CPU_INTR_FROM_CPU_1_REG (DR_REG_DPORT_BASE + 0x0E0) -/* DPORT_CPU_INTR_FROM_CPU_1 : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_CPU_INTR_FROM_CPU_1 (BIT(0)) -#define DPORT_CPU_INTR_FROM_CPU_1_M (BIT(0)) -#define DPORT_CPU_INTR_FROM_CPU_1_V 0x1 -#define DPORT_CPU_INTR_FROM_CPU_1_S 0 - -#define DPORT_CPU_INTR_FROM_CPU_2_REG (DR_REG_DPORT_BASE + 0x0E4) -/* DPORT_CPU_INTR_FROM_CPU_2 : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_CPU_INTR_FROM_CPU_2 (BIT(0)) -#define DPORT_CPU_INTR_FROM_CPU_2_M (BIT(0)) -#define DPORT_CPU_INTR_FROM_CPU_2_V 0x1 -#define DPORT_CPU_INTR_FROM_CPU_2_S 0 - -#define DPORT_CPU_INTR_FROM_CPU_3_REG (DR_REG_DPORT_BASE + 0x0E8) -/* DPORT_CPU_INTR_FROM_CPU_3 : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_CPU_INTR_FROM_CPU_3 (BIT(0)) -#define DPORT_CPU_INTR_FROM_CPU_3_M (BIT(0)) -#define DPORT_CPU_INTR_FROM_CPU_3_V 0x1 -#define DPORT_CPU_INTR_FROM_CPU_3_S 0 - -#define DPORT_PRO_INTR_STATUS_0_REG (DR_REG_DPORT_BASE + 0x0EC) -/* DPORT_PRO_INTR_STATUS_0 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define DPORT_PRO_INTR_STATUS_0 0xFFFFFFFF -#define DPORT_PRO_INTR_STATUS_0_M ((DPORT_PRO_INTR_STATUS_0_V)<<(DPORT_PRO_INTR_STATUS_0_S)) -#define DPORT_PRO_INTR_STATUS_0_V 0xFFFFFFFF -#define DPORT_PRO_INTR_STATUS_0_S 0 - -#define DPORT_PRO_INTR_STATUS_1_REG (DR_REG_DPORT_BASE + 0x0F0) -/* DPORT_PRO_INTR_STATUS_1 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define DPORT_PRO_INTR_STATUS_1 0xFFFFFFFF -#define DPORT_PRO_INTR_STATUS_1_M ((DPORT_PRO_INTR_STATUS_1_V)<<(DPORT_PRO_INTR_STATUS_1_S)) -#define DPORT_PRO_INTR_STATUS_1_V 0xFFFFFFFF -#define DPORT_PRO_INTR_STATUS_1_S 0 - -#define DPORT_PRO_INTR_STATUS_2_REG (DR_REG_DPORT_BASE + 0x0F4) -/* DPORT_PRO_INTR_STATUS_2 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define DPORT_PRO_INTR_STATUS_2 0xFFFFFFFF -#define DPORT_PRO_INTR_STATUS_2_M ((DPORT_PRO_INTR_STATUS_2_V)<<(DPORT_PRO_INTR_STATUS_2_S)) -#define DPORT_PRO_INTR_STATUS_2_V 0xFFFFFFFF -#define DPORT_PRO_INTR_STATUS_2_S 0 - -#define DPORT_APP_INTR_STATUS_0_REG (DR_REG_DPORT_BASE + 0x0F8) -/* DPORT_APP_INTR_STATUS_0 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define DPORT_APP_INTR_STATUS_0 0xFFFFFFFF -#define DPORT_APP_INTR_STATUS_0_M ((DPORT_APP_INTR_STATUS_0_V)<<(DPORT_APP_INTR_STATUS_0_S)) -#define DPORT_APP_INTR_STATUS_0_V 0xFFFFFFFF -#define DPORT_APP_INTR_STATUS_0_S 0 - -#define DPORT_APP_INTR_STATUS_1_REG (DR_REG_DPORT_BASE + 0x0FC) -/* DPORT_APP_INTR_STATUS_1 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define DPORT_APP_INTR_STATUS_1 0xFFFFFFFF -#define DPORT_APP_INTR_STATUS_1_M ((DPORT_APP_INTR_STATUS_1_V)<<(DPORT_APP_INTR_STATUS_1_S)) -#define DPORT_APP_INTR_STATUS_1_V 0xFFFFFFFF -#define DPORT_APP_INTR_STATUS_1_S 0 - -#define DPORT_APP_INTR_STATUS_2_REG (DR_REG_DPORT_BASE + 0x100) -/* DPORT_APP_INTR_STATUS_2 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define DPORT_APP_INTR_STATUS_2 0xFFFFFFFF -#define DPORT_APP_INTR_STATUS_2_M ((DPORT_APP_INTR_STATUS_2_V)<<(DPORT_APP_INTR_STATUS_2_S)) -#define DPORT_APP_INTR_STATUS_2_V 0xFFFFFFFF -#define DPORT_APP_INTR_STATUS_2_S 0 - -#define DPORT_PRO_MAC_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x104) -/* DPORT_PRO_MAC_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_MAC_INTR_MAP 0x0000001F -#define DPORT_PRO_MAC_INTR_MAP_M ((DPORT_PRO_MAC_INTR_MAP_V)<<(DPORT_PRO_MAC_INTR_MAP_S)) -#define DPORT_PRO_MAC_INTR_MAP_V 0x1F -#define DPORT_PRO_MAC_INTR_MAP_S 0 - -#define DPORT_PRO_MAC_NMI_MAP_REG (DR_REG_DPORT_BASE + 0x108) -/* DPORT_PRO_MAC_NMI_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_MAC_NMI_MAP 0x0000001F -#define DPORT_PRO_MAC_NMI_MAP_M ((DPORT_PRO_MAC_NMI_MAP_V)<<(DPORT_PRO_MAC_NMI_MAP_S)) -#define DPORT_PRO_MAC_NMI_MAP_V 0x1F -#define DPORT_PRO_MAC_NMI_MAP_S 0 - -#define DPORT_PRO_BB_INT_MAP_REG (DR_REG_DPORT_BASE + 0x10C) -/* DPORT_PRO_BB_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_BB_INT_MAP 0x0000001F -#define DPORT_PRO_BB_INT_MAP_M ((DPORT_PRO_BB_INT_MAP_V)<<(DPORT_PRO_BB_INT_MAP_S)) -#define DPORT_PRO_BB_INT_MAP_V 0x1F -#define DPORT_PRO_BB_INT_MAP_S 0 - -#define DPORT_PRO_BT_MAC_INT_MAP_REG (DR_REG_DPORT_BASE + 0x110) -/* DPORT_PRO_BT_MAC_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_BT_MAC_INT_MAP 0x0000001F -#define DPORT_PRO_BT_MAC_INT_MAP_M ((DPORT_PRO_BT_MAC_INT_MAP_V)<<(DPORT_PRO_BT_MAC_INT_MAP_S)) -#define DPORT_PRO_BT_MAC_INT_MAP_V 0x1F -#define DPORT_PRO_BT_MAC_INT_MAP_S 0 - -#define DPORT_PRO_BT_BB_INT_MAP_REG (DR_REG_DPORT_BASE + 0x114) -/* DPORT_PRO_BT_BB_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_BT_BB_INT_MAP 0x0000001F -#define DPORT_PRO_BT_BB_INT_MAP_M ((DPORT_PRO_BT_BB_INT_MAP_V)<<(DPORT_PRO_BT_BB_INT_MAP_S)) -#define DPORT_PRO_BT_BB_INT_MAP_V 0x1F -#define DPORT_PRO_BT_BB_INT_MAP_S 0 - -#define DPORT_PRO_BT_BB_NMI_MAP_REG (DR_REG_DPORT_BASE + 0x118) -/* DPORT_PRO_BT_BB_NMI_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_BT_BB_NMI_MAP 0x0000001F -#define DPORT_PRO_BT_BB_NMI_MAP_M ((DPORT_PRO_BT_BB_NMI_MAP_V)<<(DPORT_PRO_BT_BB_NMI_MAP_S)) -#define DPORT_PRO_BT_BB_NMI_MAP_V 0x1F -#define DPORT_PRO_BT_BB_NMI_MAP_S 0 - -#define DPORT_PRO_RWBT_IRQ_MAP_REG (DR_REG_DPORT_BASE + 0x11C) -/* DPORT_PRO_RWBT_IRQ_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_RWBT_IRQ_MAP 0x0000001F -#define DPORT_PRO_RWBT_IRQ_MAP_M ((DPORT_PRO_RWBT_IRQ_MAP_V)<<(DPORT_PRO_RWBT_IRQ_MAP_S)) -#define DPORT_PRO_RWBT_IRQ_MAP_V 0x1F -#define DPORT_PRO_RWBT_IRQ_MAP_S 0 - -#define DPORT_PRO_RWBLE_IRQ_MAP_REG (DR_REG_DPORT_BASE + 0x120) -/* DPORT_PRO_RWBLE_IRQ_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_RWBLE_IRQ_MAP 0x0000001F -#define DPORT_PRO_RWBLE_IRQ_MAP_M ((DPORT_PRO_RWBLE_IRQ_MAP_V)<<(DPORT_PRO_RWBLE_IRQ_MAP_S)) -#define DPORT_PRO_RWBLE_IRQ_MAP_V 0x1F -#define DPORT_PRO_RWBLE_IRQ_MAP_S 0 - -#define DPORT_PRO_RWBT_NMI_MAP_REG (DR_REG_DPORT_BASE + 0x124) -/* DPORT_PRO_RWBT_NMI_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_RWBT_NMI_MAP 0x0000001F -#define DPORT_PRO_RWBT_NMI_MAP_M ((DPORT_PRO_RWBT_NMI_MAP_V)<<(DPORT_PRO_RWBT_NMI_MAP_S)) -#define DPORT_PRO_RWBT_NMI_MAP_V 0x1F -#define DPORT_PRO_RWBT_NMI_MAP_S 0 - -#define DPORT_PRO_RWBLE_NMI_MAP_REG (DR_REG_DPORT_BASE + 0x128) -/* DPORT_PRO_RWBLE_NMI_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_RWBLE_NMI_MAP 0x0000001F -#define DPORT_PRO_RWBLE_NMI_MAP_M ((DPORT_PRO_RWBLE_NMI_MAP_V)<<(DPORT_PRO_RWBLE_NMI_MAP_S)) -#define DPORT_PRO_RWBLE_NMI_MAP_V 0x1F -#define DPORT_PRO_RWBLE_NMI_MAP_S 0 - -#define DPORT_PRO_SLC0_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x12C) -/* DPORT_PRO_SLC0_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_SLC0_INTR_MAP 0x0000001F -#define DPORT_PRO_SLC0_INTR_MAP_M ((DPORT_PRO_SLC0_INTR_MAP_V)<<(DPORT_PRO_SLC0_INTR_MAP_S)) -#define DPORT_PRO_SLC0_INTR_MAP_V 0x1F -#define DPORT_PRO_SLC0_INTR_MAP_S 0 - -#define DPORT_PRO_SLC1_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x130) -/* DPORT_PRO_SLC1_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_SLC1_INTR_MAP 0x0000001F -#define DPORT_PRO_SLC1_INTR_MAP_M ((DPORT_PRO_SLC1_INTR_MAP_V)<<(DPORT_PRO_SLC1_INTR_MAP_S)) -#define DPORT_PRO_SLC1_INTR_MAP_V 0x1F -#define DPORT_PRO_SLC1_INTR_MAP_S 0 - -#define DPORT_PRO_UHCI0_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x134) -/* DPORT_PRO_UHCI0_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_UHCI0_INTR_MAP 0x0000001F -#define DPORT_PRO_UHCI0_INTR_MAP_M ((DPORT_PRO_UHCI0_INTR_MAP_V)<<(DPORT_PRO_UHCI0_INTR_MAP_S)) -#define DPORT_PRO_UHCI0_INTR_MAP_V 0x1F -#define DPORT_PRO_UHCI0_INTR_MAP_S 0 - -#define DPORT_PRO_UHCI1_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x138) -/* DPORT_PRO_UHCI1_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_UHCI1_INTR_MAP 0x0000001F -#define DPORT_PRO_UHCI1_INTR_MAP_M ((DPORT_PRO_UHCI1_INTR_MAP_V)<<(DPORT_PRO_UHCI1_INTR_MAP_S)) -#define DPORT_PRO_UHCI1_INTR_MAP_V 0x1F -#define DPORT_PRO_UHCI1_INTR_MAP_S 0 - -#define DPORT_PRO_TG_T0_LEVEL_INT_MAP_REG (DR_REG_DPORT_BASE + 0x13C) -/* DPORT_PRO_TG_T0_LEVEL_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_TG_T0_LEVEL_INT_MAP 0x0000001F -#define DPORT_PRO_TG_T0_LEVEL_INT_MAP_M ((DPORT_PRO_TG_T0_LEVEL_INT_MAP_V)<<(DPORT_PRO_TG_T0_LEVEL_INT_MAP_S)) -#define DPORT_PRO_TG_T0_LEVEL_INT_MAP_V 0x1F -#define DPORT_PRO_TG_T0_LEVEL_INT_MAP_S 0 - -#define DPORT_PRO_TG_T1_LEVEL_INT_MAP_REG (DR_REG_DPORT_BASE + 0x140) -/* DPORT_PRO_TG_T1_LEVEL_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_TG_T1_LEVEL_INT_MAP 0x0000001F -#define DPORT_PRO_TG_T1_LEVEL_INT_MAP_M ((DPORT_PRO_TG_T1_LEVEL_INT_MAP_V)<<(DPORT_PRO_TG_T1_LEVEL_INT_MAP_S)) -#define DPORT_PRO_TG_T1_LEVEL_INT_MAP_V 0x1F -#define DPORT_PRO_TG_T1_LEVEL_INT_MAP_S 0 - -#define DPORT_PRO_TG_WDT_LEVEL_INT_MAP_REG (DR_REG_DPORT_BASE + 0x144) -/* DPORT_PRO_TG_WDT_LEVEL_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_TG_WDT_LEVEL_INT_MAP 0x0000001F -#define DPORT_PRO_TG_WDT_LEVEL_INT_MAP_M ((DPORT_PRO_TG_WDT_LEVEL_INT_MAP_V)<<(DPORT_PRO_TG_WDT_LEVEL_INT_MAP_S)) -#define DPORT_PRO_TG_WDT_LEVEL_INT_MAP_V 0x1F -#define DPORT_PRO_TG_WDT_LEVEL_INT_MAP_S 0 - -#define DPORT_PRO_TG_LACT_LEVEL_INT_MAP_REG (DR_REG_DPORT_BASE + 0x148) -/* DPORT_PRO_TG_LACT_LEVEL_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_TG_LACT_LEVEL_INT_MAP 0x0000001F -#define DPORT_PRO_TG_LACT_LEVEL_INT_MAP_M ((DPORT_PRO_TG_LACT_LEVEL_INT_MAP_V)<<(DPORT_PRO_TG_LACT_LEVEL_INT_MAP_S)) -#define DPORT_PRO_TG_LACT_LEVEL_INT_MAP_V 0x1F -#define DPORT_PRO_TG_LACT_LEVEL_INT_MAP_S 0 - -#define DPORT_PRO_TG1_T0_LEVEL_INT_MAP_REG (DR_REG_DPORT_BASE + 0x14C) -/* DPORT_PRO_TG1_T0_LEVEL_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_TG1_T0_LEVEL_INT_MAP 0x0000001F -#define DPORT_PRO_TG1_T0_LEVEL_INT_MAP_M ((DPORT_PRO_TG1_T0_LEVEL_INT_MAP_V)<<(DPORT_PRO_TG1_T0_LEVEL_INT_MAP_S)) -#define DPORT_PRO_TG1_T0_LEVEL_INT_MAP_V 0x1F -#define DPORT_PRO_TG1_T0_LEVEL_INT_MAP_S 0 - -#define DPORT_PRO_TG1_T1_LEVEL_INT_MAP_REG (DR_REG_DPORT_BASE + 0x150) -/* DPORT_PRO_TG1_T1_LEVEL_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_TG1_T1_LEVEL_INT_MAP 0x0000001F -#define DPORT_PRO_TG1_T1_LEVEL_INT_MAP_M ((DPORT_PRO_TG1_T1_LEVEL_INT_MAP_V)<<(DPORT_PRO_TG1_T1_LEVEL_INT_MAP_S)) -#define DPORT_PRO_TG1_T1_LEVEL_INT_MAP_V 0x1F -#define DPORT_PRO_TG1_T1_LEVEL_INT_MAP_S 0 - -#define DPORT_PRO_TG1_WDT_LEVEL_INT_MAP_REG (DR_REG_DPORT_BASE + 0x154) -/* DPORT_PRO_TG1_WDT_LEVEL_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_TG1_WDT_LEVEL_INT_MAP 0x0000001F -#define DPORT_PRO_TG1_WDT_LEVEL_INT_MAP_M ((DPORT_PRO_TG1_WDT_LEVEL_INT_MAP_V)<<(DPORT_PRO_TG1_WDT_LEVEL_INT_MAP_S)) -#define DPORT_PRO_TG1_WDT_LEVEL_INT_MAP_V 0x1F -#define DPORT_PRO_TG1_WDT_LEVEL_INT_MAP_S 0 - -#define DPORT_PRO_TG1_LACT_LEVEL_INT_MAP_REG (DR_REG_DPORT_BASE + 0x158) -/* DPORT_PRO_TG1_LACT_LEVEL_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_TG1_LACT_LEVEL_INT_MAP 0x0000001F -#define DPORT_PRO_TG1_LACT_LEVEL_INT_MAP_M ((DPORT_PRO_TG1_LACT_LEVEL_INT_MAP_V)<<(DPORT_PRO_TG1_LACT_LEVEL_INT_MAP_S)) -#define DPORT_PRO_TG1_LACT_LEVEL_INT_MAP_V 0x1F -#define DPORT_PRO_TG1_LACT_LEVEL_INT_MAP_S 0 - -#define DPORT_PRO_GPIO_INTERRUPT_MAP_REG (DR_REG_DPORT_BASE + 0x15C) -/* DPORT_PRO_GPIO_INTERRUPT_PRO_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_GPIO_INTERRUPT_PRO_MAP 0x0000001F -#define DPORT_PRO_GPIO_INTERRUPT_PRO_MAP_M ((DPORT_PRO_GPIO_INTERRUPT_PRO_MAP_V)<<(DPORT_PRO_GPIO_INTERRUPT_PRO_MAP_S)) -#define DPORT_PRO_GPIO_INTERRUPT_PRO_MAP_V 0x1F -#define DPORT_PRO_GPIO_INTERRUPT_PRO_MAP_S 0 - -#define DPORT_PRO_GPIO_INTERRUPT_NMI_MAP_REG (DR_REG_DPORT_BASE + 0x160) -/* DPORT_PRO_GPIO_INTERRUPT_PRO_NMI_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_GPIO_INTERRUPT_PRO_NMI_MAP 0x0000001F -#define DPORT_PRO_GPIO_INTERRUPT_PRO_NMI_MAP_M ((DPORT_PRO_GPIO_INTERRUPT_PRO_NMI_MAP_V)<<(DPORT_PRO_GPIO_INTERRUPT_PRO_NMI_MAP_S)) -#define DPORT_PRO_GPIO_INTERRUPT_PRO_NMI_MAP_V 0x1F -#define DPORT_PRO_GPIO_INTERRUPT_PRO_NMI_MAP_S 0 - -#define DPORT_PRO_CPU_INTR_FROM_CPU_0_MAP_REG (DR_REG_DPORT_BASE + 0x164) -/* DPORT_PRO_CPU_INTR_FROM_CPU_0_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_CPU_INTR_FROM_CPU_0_MAP 0x0000001F -#define DPORT_PRO_CPU_INTR_FROM_CPU_0_MAP_M ((DPORT_PRO_CPU_INTR_FROM_CPU_0_MAP_V)<<(DPORT_PRO_CPU_INTR_FROM_CPU_0_MAP_S)) -#define DPORT_PRO_CPU_INTR_FROM_CPU_0_MAP_V 0x1F -#define DPORT_PRO_CPU_INTR_FROM_CPU_0_MAP_S 0 - -#define DPORT_PRO_CPU_INTR_FROM_CPU_1_MAP_REG (DR_REG_DPORT_BASE + 0x168) -/* DPORT_PRO_CPU_INTR_FROM_CPU_1_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_CPU_INTR_FROM_CPU_1_MAP 0x0000001F -#define DPORT_PRO_CPU_INTR_FROM_CPU_1_MAP_M ((DPORT_PRO_CPU_INTR_FROM_CPU_1_MAP_V)<<(DPORT_PRO_CPU_INTR_FROM_CPU_1_MAP_S)) -#define DPORT_PRO_CPU_INTR_FROM_CPU_1_MAP_V 0x1F -#define DPORT_PRO_CPU_INTR_FROM_CPU_1_MAP_S 0 - -#define DPORT_PRO_CPU_INTR_FROM_CPU_2_MAP_REG (DR_REG_DPORT_BASE + 0x16C) -/* DPORT_PRO_CPU_INTR_FROM_CPU_2_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_CPU_INTR_FROM_CPU_2_MAP 0x0000001F -#define DPORT_PRO_CPU_INTR_FROM_CPU_2_MAP_M ((DPORT_PRO_CPU_INTR_FROM_CPU_2_MAP_V)<<(DPORT_PRO_CPU_INTR_FROM_CPU_2_MAP_S)) -#define DPORT_PRO_CPU_INTR_FROM_CPU_2_MAP_V 0x1F -#define DPORT_PRO_CPU_INTR_FROM_CPU_2_MAP_S 0 - -#define DPORT_PRO_CPU_INTR_FROM_CPU_3_MAP_REG (DR_REG_DPORT_BASE + 0x170) -/* DPORT_PRO_CPU_INTR_FROM_CPU_3_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_CPU_INTR_FROM_CPU_3_MAP 0x0000001F -#define DPORT_PRO_CPU_INTR_FROM_CPU_3_MAP_M ((DPORT_PRO_CPU_INTR_FROM_CPU_3_MAP_V)<<(DPORT_PRO_CPU_INTR_FROM_CPU_3_MAP_S)) -#define DPORT_PRO_CPU_INTR_FROM_CPU_3_MAP_V 0x1F -#define DPORT_PRO_CPU_INTR_FROM_CPU_3_MAP_S 0 - -#define DPORT_PRO_SPI_INTR_0_MAP_REG (DR_REG_DPORT_BASE + 0x174) -/* DPORT_PRO_SPI_INTR_0_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_SPI_INTR_0_MAP 0x0000001F -#define DPORT_PRO_SPI_INTR_0_MAP_M ((DPORT_PRO_SPI_INTR_0_MAP_V)<<(DPORT_PRO_SPI_INTR_0_MAP_S)) -#define DPORT_PRO_SPI_INTR_0_MAP_V 0x1F -#define DPORT_PRO_SPI_INTR_0_MAP_S 0 - -#define DPORT_PRO_SPI_INTR_1_MAP_REG (DR_REG_DPORT_BASE + 0x178) -/* DPORT_PRO_SPI_INTR_1_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_SPI_INTR_1_MAP 0x0000001F -#define DPORT_PRO_SPI_INTR_1_MAP_M ((DPORT_PRO_SPI_INTR_1_MAP_V)<<(DPORT_PRO_SPI_INTR_1_MAP_S)) -#define DPORT_PRO_SPI_INTR_1_MAP_V 0x1F -#define DPORT_PRO_SPI_INTR_1_MAP_S 0 - -#define DPORT_PRO_SPI_INTR_2_MAP_REG (DR_REG_DPORT_BASE + 0x17C) -/* DPORT_PRO_SPI_INTR_2_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_SPI_INTR_2_MAP 0x0000001F -#define DPORT_PRO_SPI_INTR_2_MAP_M ((DPORT_PRO_SPI_INTR_2_MAP_V)<<(DPORT_PRO_SPI_INTR_2_MAP_S)) -#define DPORT_PRO_SPI_INTR_2_MAP_V 0x1F -#define DPORT_PRO_SPI_INTR_2_MAP_S 0 - -#define DPORT_PRO_SPI_INTR_3_MAP_REG (DR_REG_DPORT_BASE + 0x180) -/* DPORT_PRO_SPI_INTR_3_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_SPI_INTR_3_MAP 0x0000001F -#define DPORT_PRO_SPI_INTR_3_MAP_M ((DPORT_PRO_SPI_INTR_3_MAP_V)<<(DPORT_PRO_SPI_INTR_3_MAP_S)) -#define DPORT_PRO_SPI_INTR_3_MAP_V 0x1F -#define DPORT_PRO_SPI_INTR_3_MAP_S 0 - -#define DPORT_PRO_I2S0_INT_MAP_REG (DR_REG_DPORT_BASE + 0x184) -/* DPORT_PRO_I2S0_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_I2S0_INT_MAP 0x0000001F -#define DPORT_PRO_I2S0_INT_MAP_M ((DPORT_PRO_I2S0_INT_MAP_V)<<(DPORT_PRO_I2S0_INT_MAP_S)) -#define DPORT_PRO_I2S0_INT_MAP_V 0x1F -#define DPORT_PRO_I2S0_INT_MAP_S 0 - -#define DPORT_PRO_I2S1_INT_MAP_REG (DR_REG_DPORT_BASE + 0x188) -/* DPORT_PRO_I2S1_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_I2S1_INT_MAP 0x0000001F -#define DPORT_PRO_I2S1_INT_MAP_M ((DPORT_PRO_I2S1_INT_MAP_V)<<(DPORT_PRO_I2S1_INT_MAP_S)) -#define DPORT_PRO_I2S1_INT_MAP_V 0x1F -#define DPORT_PRO_I2S1_INT_MAP_S 0 - -#define DPORT_PRO_UART_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x18C) -/* DPORT_PRO_UART_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_UART_INTR_MAP 0x0000001F -#define DPORT_PRO_UART_INTR_MAP_M ((DPORT_PRO_UART_INTR_MAP_V)<<(DPORT_PRO_UART_INTR_MAP_S)) -#define DPORT_PRO_UART_INTR_MAP_V 0x1F -#define DPORT_PRO_UART_INTR_MAP_S 0 - -#define DPORT_PRO_UART1_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x190) -/* DPORT_PRO_UART1_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_UART1_INTR_MAP 0x0000001F -#define DPORT_PRO_UART1_INTR_MAP_M ((DPORT_PRO_UART1_INTR_MAP_V)<<(DPORT_PRO_UART1_INTR_MAP_S)) -#define DPORT_PRO_UART1_INTR_MAP_V 0x1F -#define DPORT_PRO_UART1_INTR_MAP_S 0 - -#define DPORT_PRO_UART2_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x194) -/* DPORT_PRO_UART2_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_UART2_INTR_MAP 0x0000001F -#define DPORT_PRO_UART2_INTR_MAP_M ((DPORT_PRO_UART2_INTR_MAP_V)<<(DPORT_PRO_UART2_INTR_MAP_S)) -#define DPORT_PRO_UART2_INTR_MAP_V 0x1F -#define DPORT_PRO_UART2_INTR_MAP_S 0 - -#define DPORT_PRO_SDIO_HOST_INTERRUPT_MAP_REG (DR_REG_DPORT_BASE + 0x198) -/* DPORT_PRO_SDIO_HOST_INTERRUPT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_SDIO_HOST_INTERRUPT_MAP 0x0000001F -#define DPORT_PRO_SDIO_HOST_INTERRUPT_MAP_M ((DPORT_PRO_SDIO_HOST_INTERRUPT_MAP_V)<<(DPORT_PRO_SDIO_HOST_INTERRUPT_MAP_S)) -#define DPORT_PRO_SDIO_HOST_INTERRUPT_MAP_V 0x1F -#define DPORT_PRO_SDIO_HOST_INTERRUPT_MAP_S 0 - -#define DPORT_PRO_EMAC_INT_MAP_REG (DR_REG_DPORT_BASE + 0x19C) -/* DPORT_PRO_EMAC_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_EMAC_INT_MAP 0x0000001F -#define DPORT_PRO_EMAC_INT_MAP_M ((DPORT_PRO_EMAC_INT_MAP_V)<<(DPORT_PRO_EMAC_INT_MAP_S)) -#define DPORT_PRO_EMAC_INT_MAP_V 0x1F -#define DPORT_PRO_EMAC_INT_MAP_S 0 - -#define DPORT_PRO_PWM0_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x1A0) -/* DPORT_PRO_PWM0_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_PWM0_INTR_MAP 0x0000001F -#define DPORT_PRO_PWM0_INTR_MAP_M ((DPORT_PRO_PWM0_INTR_MAP_V)<<(DPORT_PRO_PWM0_INTR_MAP_S)) -#define DPORT_PRO_PWM0_INTR_MAP_V 0x1F -#define DPORT_PRO_PWM0_INTR_MAP_S 0 - -#define DPORT_PRO_PWM1_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x1A4) -/* DPORT_PRO_PWM1_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_PWM1_INTR_MAP 0x0000001F -#define DPORT_PRO_PWM1_INTR_MAP_M ((DPORT_PRO_PWM1_INTR_MAP_V)<<(DPORT_PRO_PWM1_INTR_MAP_S)) -#define DPORT_PRO_PWM1_INTR_MAP_V 0x1F -#define DPORT_PRO_PWM1_INTR_MAP_S 0 - -#define DPORT_PRO_PWM2_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x1A8) -/* DPORT_PRO_PWM2_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_PWM2_INTR_MAP 0x0000001F -#define DPORT_PRO_PWM2_INTR_MAP_M ((DPORT_PRO_PWM2_INTR_MAP_V)<<(DPORT_PRO_PWM2_INTR_MAP_S)) -#define DPORT_PRO_PWM2_INTR_MAP_V 0x1F -#define DPORT_PRO_PWM2_INTR_MAP_S 0 - -#define DPORT_PRO_PWM3_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x1AC) -/* DPORT_PRO_PWM3_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_PWM3_INTR_MAP 0x0000001F -#define DPORT_PRO_PWM3_INTR_MAP_M ((DPORT_PRO_PWM3_INTR_MAP_V)<<(DPORT_PRO_PWM3_INTR_MAP_S)) -#define DPORT_PRO_PWM3_INTR_MAP_V 0x1F -#define DPORT_PRO_PWM3_INTR_MAP_S 0 - -#define DPORT_PRO_LEDC_INT_MAP_REG (DR_REG_DPORT_BASE + 0x1B0) -/* DPORT_PRO_LEDC_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_LEDC_INT_MAP 0x0000001F -#define DPORT_PRO_LEDC_INT_MAP_M ((DPORT_PRO_LEDC_INT_MAP_V)<<(DPORT_PRO_LEDC_INT_MAP_S)) -#define DPORT_PRO_LEDC_INT_MAP_V 0x1F -#define DPORT_PRO_LEDC_INT_MAP_S 0 - -#define DPORT_PRO_EFUSE_INT_MAP_REG (DR_REG_DPORT_BASE + 0x1B4) -/* DPORT_PRO_EFUSE_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_EFUSE_INT_MAP 0x0000001F -#define DPORT_PRO_EFUSE_INT_MAP_M ((DPORT_PRO_EFUSE_INT_MAP_V)<<(DPORT_PRO_EFUSE_INT_MAP_S)) -#define DPORT_PRO_EFUSE_INT_MAP_V 0x1F -#define DPORT_PRO_EFUSE_INT_MAP_S 0 - -#define DPORT_PRO_CAN_INT_MAP_REG (DR_REG_DPORT_BASE + 0x1B8) -/* DPORT_PRO_CAN_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_CAN_INT_MAP 0x0000001F -#define DPORT_PRO_CAN_INT_MAP_M ((DPORT_PRO_CAN_INT_MAP_V)<<(DPORT_PRO_CAN_INT_MAP_S)) -#define DPORT_PRO_CAN_INT_MAP_V 0x1F -#define DPORT_PRO_CAN_INT_MAP_S 0 - -#define DPORT_PRO_RTC_CORE_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x1BC) -/* DPORT_PRO_RTC_CORE_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_RTC_CORE_INTR_MAP 0x0000001F -#define DPORT_PRO_RTC_CORE_INTR_MAP_M ((DPORT_PRO_RTC_CORE_INTR_MAP_V)<<(DPORT_PRO_RTC_CORE_INTR_MAP_S)) -#define DPORT_PRO_RTC_CORE_INTR_MAP_V 0x1F -#define DPORT_PRO_RTC_CORE_INTR_MAP_S 0 - -#define DPORT_PRO_RMT_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x1C0) -/* DPORT_PRO_RMT_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_RMT_INTR_MAP 0x0000001F -#define DPORT_PRO_RMT_INTR_MAP_M ((DPORT_PRO_RMT_INTR_MAP_V)<<(DPORT_PRO_RMT_INTR_MAP_S)) -#define DPORT_PRO_RMT_INTR_MAP_V 0x1F -#define DPORT_PRO_RMT_INTR_MAP_S 0 - -#define DPORT_PRO_PCNT_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x1C4) -/* DPORT_PRO_PCNT_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_PCNT_INTR_MAP 0x0000001F -#define DPORT_PRO_PCNT_INTR_MAP_M ((DPORT_PRO_PCNT_INTR_MAP_V)<<(DPORT_PRO_PCNT_INTR_MAP_S)) -#define DPORT_PRO_PCNT_INTR_MAP_V 0x1F -#define DPORT_PRO_PCNT_INTR_MAP_S 0 - -#define DPORT_PRO_I2C_EXT0_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x1C8) -/* DPORT_PRO_I2C_EXT0_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_I2C_EXT0_INTR_MAP 0x0000001F -#define DPORT_PRO_I2C_EXT0_INTR_MAP_M ((DPORT_PRO_I2C_EXT0_INTR_MAP_V)<<(DPORT_PRO_I2C_EXT0_INTR_MAP_S)) -#define DPORT_PRO_I2C_EXT0_INTR_MAP_V 0x1F -#define DPORT_PRO_I2C_EXT0_INTR_MAP_S 0 - -#define DPORT_PRO_I2C_EXT1_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x1CC) -/* DPORT_PRO_I2C_EXT1_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_I2C_EXT1_INTR_MAP 0x0000001F -#define DPORT_PRO_I2C_EXT1_INTR_MAP_M ((DPORT_PRO_I2C_EXT1_INTR_MAP_V)<<(DPORT_PRO_I2C_EXT1_INTR_MAP_S)) -#define DPORT_PRO_I2C_EXT1_INTR_MAP_V 0x1F -#define DPORT_PRO_I2C_EXT1_INTR_MAP_S 0 - -#define DPORT_PRO_RSA_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x1D0) -/* DPORT_PRO_RSA_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_RSA_INTR_MAP 0x0000001F -#define DPORT_PRO_RSA_INTR_MAP_M ((DPORT_PRO_RSA_INTR_MAP_V)<<(DPORT_PRO_RSA_INTR_MAP_S)) -#define DPORT_PRO_RSA_INTR_MAP_V 0x1F -#define DPORT_PRO_RSA_INTR_MAP_S 0 - -#define DPORT_PRO_SPI1_DMA_INT_MAP_REG (DR_REG_DPORT_BASE + 0x1D4) -/* DPORT_PRO_SPI1_DMA_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_SPI1_DMA_INT_MAP 0x0000001F -#define DPORT_PRO_SPI1_DMA_INT_MAP_M ((DPORT_PRO_SPI1_DMA_INT_MAP_V)<<(DPORT_PRO_SPI1_DMA_INT_MAP_S)) -#define DPORT_PRO_SPI1_DMA_INT_MAP_V 0x1F -#define DPORT_PRO_SPI1_DMA_INT_MAP_S 0 - -#define DPORT_PRO_SPI2_DMA_INT_MAP_REG (DR_REG_DPORT_BASE + 0x1D8) -/* DPORT_PRO_SPI2_DMA_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_SPI2_DMA_INT_MAP 0x0000001F -#define DPORT_PRO_SPI2_DMA_INT_MAP_M ((DPORT_PRO_SPI2_DMA_INT_MAP_V)<<(DPORT_PRO_SPI2_DMA_INT_MAP_S)) -#define DPORT_PRO_SPI2_DMA_INT_MAP_V 0x1F -#define DPORT_PRO_SPI2_DMA_INT_MAP_S 0 - -#define DPORT_PRO_SPI3_DMA_INT_MAP_REG (DR_REG_DPORT_BASE + 0x1DC) -/* DPORT_PRO_SPI3_DMA_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_SPI3_DMA_INT_MAP 0x0000001F -#define DPORT_PRO_SPI3_DMA_INT_MAP_M ((DPORT_PRO_SPI3_DMA_INT_MAP_V)<<(DPORT_PRO_SPI3_DMA_INT_MAP_S)) -#define DPORT_PRO_SPI3_DMA_INT_MAP_V 0x1F -#define DPORT_PRO_SPI3_DMA_INT_MAP_S 0 - -#define DPORT_PRO_WDG_INT_MAP_REG (DR_REG_DPORT_BASE + 0x1E0) -/* DPORT_PRO_WDG_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_WDG_INT_MAP 0x0000001F -#define DPORT_PRO_WDG_INT_MAP_M ((DPORT_PRO_WDG_INT_MAP_V)<<(DPORT_PRO_WDG_INT_MAP_S)) -#define DPORT_PRO_WDG_INT_MAP_V 0x1F -#define DPORT_PRO_WDG_INT_MAP_S 0 - -#define DPORT_PRO_TIMER_INT1_MAP_REG (DR_REG_DPORT_BASE + 0x1E4) -/* DPORT_PRO_TIMER_INT1_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_TIMER_INT1_MAP 0x0000001F -#define DPORT_PRO_TIMER_INT1_MAP_M ((DPORT_PRO_TIMER_INT1_MAP_V)<<(DPORT_PRO_TIMER_INT1_MAP_S)) -#define DPORT_PRO_TIMER_INT1_MAP_V 0x1F -#define DPORT_PRO_TIMER_INT1_MAP_S 0 - -#define DPORT_PRO_TIMER_INT2_MAP_REG (DR_REG_DPORT_BASE + 0x1E8) -/* DPORT_PRO_TIMER_INT2_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_TIMER_INT2_MAP 0x0000001F -#define DPORT_PRO_TIMER_INT2_MAP_M ((DPORT_PRO_TIMER_INT2_MAP_V)<<(DPORT_PRO_TIMER_INT2_MAP_S)) -#define DPORT_PRO_TIMER_INT2_MAP_V 0x1F -#define DPORT_PRO_TIMER_INT2_MAP_S 0 - -#define DPORT_PRO_TG_T0_EDGE_INT_MAP_REG (DR_REG_DPORT_BASE + 0x1EC) -/* DPORT_PRO_TG_T0_EDGE_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_TG_T0_EDGE_INT_MAP 0x0000001F -#define DPORT_PRO_TG_T0_EDGE_INT_MAP_M ((DPORT_PRO_TG_T0_EDGE_INT_MAP_V)<<(DPORT_PRO_TG_T0_EDGE_INT_MAP_S)) -#define DPORT_PRO_TG_T0_EDGE_INT_MAP_V 0x1F -#define DPORT_PRO_TG_T0_EDGE_INT_MAP_S 0 - -#define DPORT_PRO_TG_T1_EDGE_INT_MAP_REG (DR_REG_DPORT_BASE + 0x1F0) -/* DPORT_PRO_TG_T1_EDGE_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_TG_T1_EDGE_INT_MAP 0x0000001F -#define DPORT_PRO_TG_T1_EDGE_INT_MAP_M ((DPORT_PRO_TG_T1_EDGE_INT_MAP_V)<<(DPORT_PRO_TG_T1_EDGE_INT_MAP_S)) -#define DPORT_PRO_TG_T1_EDGE_INT_MAP_V 0x1F -#define DPORT_PRO_TG_T1_EDGE_INT_MAP_S 0 - -#define DPORT_PRO_TG_WDT_EDGE_INT_MAP_REG (DR_REG_DPORT_BASE + 0x1F4) -/* DPORT_PRO_TG_WDT_EDGE_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_TG_WDT_EDGE_INT_MAP 0x0000001F -#define DPORT_PRO_TG_WDT_EDGE_INT_MAP_M ((DPORT_PRO_TG_WDT_EDGE_INT_MAP_V)<<(DPORT_PRO_TG_WDT_EDGE_INT_MAP_S)) -#define DPORT_PRO_TG_WDT_EDGE_INT_MAP_V 0x1F -#define DPORT_PRO_TG_WDT_EDGE_INT_MAP_S 0 - -#define DPORT_PRO_TG_LACT_EDGE_INT_MAP_REG (DR_REG_DPORT_BASE + 0x1F8) -/* DPORT_PRO_TG_LACT_EDGE_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_TG_LACT_EDGE_INT_MAP 0x0000001F -#define DPORT_PRO_TG_LACT_EDGE_INT_MAP_M ((DPORT_PRO_TG_LACT_EDGE_INT_MAP_V)<<(DPORT_PRO_TG_LACT_EDGE_INT_MAP_S)) -#define DPORT_PRO_TG_LACT_EDGE_INT_MAP_V 0x1F -#define DPORT_PRO_TG_LACT_EDGE_INT_MAP_S 0 - -#define DPORT_PRO_TG1_T0_EDGE_INT_MAP_REG (DR_REG_DPORT_BASE + 0x1FC) -/* DPORT_PRO_TG1_T0_EDGE_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_TG1_T0_EDGE_INT_MAP 0x0000001F -#define DPORT_PRO_TG1_T0_EDGE_INT_MAP_M ((DPORT_PRO_TG1_T0_EDGE_INT_MAP_V)<<(DPORT_PRO_TG1_T0_EDGE_INT_MAP_S)) -#define DPORT_PRO_TG1_T0_EDGE_INT_MAP_V 0x1F -#define DPORT_PRO_TG1_T0_EDGE_INT_MAP_S 0 - -#define DPORT_PRO_TG1_T1_EDGE_INT_MAP_REG (DR_REG_DPORT_BASE + 0x200) -/* DPORT_PRO_TG1_T1_EDGE_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_TG1_T1_EDGE_INT_MAP 0x0000001F -#define DPORT_PRO_TG1_T1_EDGE_INT_MAP_M ((DPORT_PRO_TG1_T1_EDGE_INT_MAP_V)<<(DPORT_PRO_TG1_T1_EDGE_INT_MAP_S)) -#define DPORT_PRO_TG1_T1_EDGE_INT_MAP_V 0x1F -#define DPORT_PRO_TG1_T1_EDGE_INT_MAP_S 0 - -#define DPORT_PRO_TG1_WDT_EDGE_INT_MAP_REG (DR_REG_DPORT_BASE + 0x204) -/* DPORT_PRO_TG1_WDT_EDGE_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_TG1_WDT_EDGE_INT_MAP 0x0000001F -#define DPORT_PRO_TG1_WDT_EDGE_INT_MAP_M ((DPORT_PRO_TG1_WDT_EDGE_INT_MAP_V)<<(DPORT_PRO_TG1_WDT_EDGE_INT_MAP_S)) -#define DPORT_PRO_TG1_WDT_EDGE_INT_MAP_V 0x1F -#define DPORT_PRO_TG1_WDT_EDGE_INT_MAP_S 0 - -#define DPORT_PRO_TG1_LACT_EDGE_INT_MAP_REG (DR_REG_DPORT_BASE + 0x208) -/* DPORT_PRO_TG1_LACT_EDGE_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_TG1_LACT_EDGE_INT_MAP 0x0000001F -#define DPORT_PRO_TG1_LACT_EDGE_INT_MAP_M ((DPORT_PRO_TG1_LACT_EDGE_INT_MAP_V)<<(DPORT_PRO_TG1_LACT_EDGE_INT_MAP_S)) -#define DPORT_PRO_TG1_LACT_EDGE_INT_MAP_V 0x1F -#define DPORT_PRO_TG1_LACT_EDGE_INT_MAP_S 0 - -#define DPORT_PRO_MMU_IA_INT_MAP_REG (DR_REG_DPORT_BASE + 0x20C) -/* DPORT_PRO_MMU_IA_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_MMU_IA_INT_MAP 0x0000001F -#define DPORT_PRO_MMU_IA_INT_MAP_M ((DPORT_PRO_MMU_IA_INT_MAP_V)<<(DPORT_PRO_MMU_IA_INT_MAP_S)) -#define DPORT_PRO_MMU_IA_INT_MAP_V 0x1F -#define DPORT_PRO_MMU_IA_INT_MAP_S 0 - -#define DPORT_PRO_MPU_IA_INT_MAP_REG (DR_REG_DPORT_BASE + 0x210) -/* DPORT_PRO_MPU_IA_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_MPU_IA_INT_MAP 0x0000001F -#define DPORT_PRO_MPU_IA_INT_MAP_M ((DPORT_PRO_MPU_IA_INT_MAP_V)<<(DPORT_PRO_MPU_IA_INT_MAP_S)) -#define DPORT_PRO_MPU_IA_INT_MAP_V 0x1F -#define DPORT_PRO_MPU_IA_INT_MAP_S 0 - -#define DPORT_PRO_CACHE_IA_INT_MAP_REG (DR_REG_DPORT_BASE + 0x214) -/* DPORT_PRO_CACHE_IA_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_PRO_CACHE_IA_INT_MAP 0x0000001F -#define DPORT_PRO_CACHE_IA_INT_MAP_M ((DPORT_PRO_CACHE_IA_INT_MAP_V)<<(DPORT_PRO_CACHE_IA_INT_MAP_S)) -#define DPORT_PRO_CACHE_IA_INT_MAP_V 0x1F -#define DPORT_PRO_CACHE_IA_INT_MAP_S 0 - -#define DPORT_APP_MAC_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x218) -/* DPORT_APP_MAC_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_MAC_INTR_MAP 0x0000001F -#define DPORT_APP_MAC_INTR_MAP_M ((DPORT_APP_MAC_INTR_MAP_V)<<(DPORT_APP_MAC_INTR_MAP_S)) -#define DPORT_APP_MAC_INTR_MAP_V 0x1F -#define DPORT_APP_MAC_INTR_MAP_S 0 - -#define DPORT_APP_MAC_NMI_MAP_REG (DR_REG_DPORT_BASE + 0x21C) -/* DPORT_APP_MAC_NMI_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_MAC_NMI_MAP 0x0000001F -#define DPORT_APP_MAC_NMI_MAP_M ((DPORT_APP_MAC_NMI_MAP_V)<<(DPORT_APP_MAC_NMI_MAP_S)) -#define DPORT_APP_MAC_NMI_MAP_V 0x1F -#define DPORT_APP_MAC_NMI_MAP_S 0 - -#define DPORT_APP_BB_INT_MAP_REG (DR_REG_DPORT_BASE + 0x220) -/* DPORT_APP_BB_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_BB_INT_MAP 0x0000001F -#define DPORT_APP_BB_INT_MAP_M ((DPORT_APP_BB_INT_MAP_V)<<(DPORT_APP_BB_INT_MAP_S)) -#define DPORT_APP_BB_INT_MAP_V 0x1F -#define DPORT_APP_BB_INT_MAP_S 0 - -#define DPORT_APP_BT_MAC_INT_MAP_REG (DR_REG_DPORT_BASE + 0x224) -/* DPORT_APP_BT_MAC_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_BT_MAC_INT_MAP 0x0000001F -#define DPORT_APP_BT_MAC_INT_MAP_M ((DPORT_APP_BT_MAC_INT_MAP_V)<<(DPORT_APP_BT_MAC_INT_MAP_S)) -#define DPORT_APP_BT_MAC_INT_MAP_V 0x1F -#define DPORT_APP_BT_MAC_INT_MAP_S 0 - -#define DPORT_APP_BT_BB_INT_MAP_REG (DR_REG_DPORT_BASE + 0x228) -/* DPORT_APP_BT_BB_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_BT_BB_INT_MAP 0x0000001F -#define DPORT_APP_BT_BB_INT_MAP_M ((DPORT_APP_BT_BB_INT_MAP_V)<<(DPORT_APP_BT_BB_INT_MAP_S)) -#define DPORT_APP_BT_BB_INT_MAP_V 0x1F -#define DPORT_APP_BT_BB_INT_MAP_S 0 - -#define DPORT_APP_BT_BB_NMI_MAP_REG (DR_REG_DPORT_BASE + 0x22C) -/* DPORT_APP_BT_BB_NMI_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_BT_BB_NMI_MAP 0x0000001F -#define DPORT_APP_BT_BB_NMI_MAP_M ((DPORT_APP_BT_BB_NMI_MAP_V)<<(DPORT_APP_BT_BB_NMI_MAP_S)) -#define DPORT_APP_BT_BB_NMI_MAP_V 0x1F -#define DPORT_APP_BT_BB_NMI_MAP_S 0 - -#define DPORT_APP_RWBT_IRQ_MAP_REG (DR_REG_DPORT_BASE + 0x230) -/* DPORT_APP_RWBT_IRQ_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_RWBT_IRQ_MAP 0x0000001F -#define DPORT_APP_RWBT_IRQ_MAP_M ((DPORT_APP_RWBT_IRQ_MAP_V)<<(DPORT_APP_RWBT_IRQ_MAP_S)) -#define DPORT_APP_RWBT_IRQ_MAP_V 0x1F -#define DPORT_APP_RWBT_IRQ_MAP_S 0 - -#define DPORT_APP_RWBLE_IRQ_MAP_REG (DR_REG_DPORT_BASE + 0x234) -/* DPORT_APP_RWBLE_IRQ_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_RWBLE_IRQ_MAP 0x0000001F -#define DPORT_APP_RWBLE_IRQ_MAP_M ((DPORT_APP_RWBLE_IRQ_MAP_V)<<(DPORT_APP_RWBLE_IRQ_MAP_S)) -#define DPORT_APP_RWBLE_IRQ_MAP_V 0x1F -#define DPORT_APP_RWBLE_IRQ_MAP_S 0 - -#define DPORT_APP_RWBT_NMI_MAP_REG (DR_REG_DPORT_BASE + 0x238) -/* DPORT_APP_RWBT_NMI_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_RWBT_NMI_MAP 0x0000001F -#define DPORT_APP_RWBT_NMI_MAP_M ((DPORT_APP_RWBT_NMI_MAP_V)<<(DPORT_APP_RWBT_NMI_MAP_S)) -#define DPORT_APP_RWBT_NMI_MAP_V 0x1F -#define DPORT_APP_RWBT_NMI_MAP_S 0 - -#define DPORT_APP_RWBLE_NMI_MAP_REG (DR_REG_DPORT_BASE + 0x23C) -/* DPORT_APP_RWBLE_NMI_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_RWBLE_NMI_MAP 0x0000001F -#define DPORT_APP_RWBLE_NMI_MAP_M ((DPORT_APP_RWBLE_NMI_MAP_V)<<(DPORT_APP_RWBLE_NMI_MAP_S)) -#define DPORT_APP_RWBLE_NMI_MAP_V 0x1F -#define DPORT_APP_RWBLE_NMI_MAP_S 0 - -#define DPORT_APP_SLC0_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x240) -/* DPORT_APP_SLC0_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_SLC0_INTR_MAP 0x0000001F -#define DPORT_APP_SLC0_INTR_MAP_M ((DPORT_APP_SLC0_INTR_MAP_V)<<(DPORT_APP_SLC0_INTR_MAP_S)) -#define DPORT_APP_SLC0_INTR_MAP_V 0x1F -#define DPORT_APP_SLC0_INTR_MAP_S 0 - -#define DPORT_APP_SLC1_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x244) -/* DPORT_APP_SLC1_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_SLC1_INTR_MAP 0x0000001F -#define DPORT_APP_SLC1_INTR_MAP_M ((DPORT_APP_SLC1_INTR_MAP_V)<<(DPORT_APP_SLC1_INTR_MAP_S)) -#define DPORT_APP_SLC1_INTR_MAP_V 0x1F -#define DPORT_APP_SLC1_INTR_MAP_S 0 - -#define DPORT_APP_UHCI0_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x248) -/* DPORT_APP_UHCI0_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_UHCI0_INTR_MAP 0x0000001F -#define DPORT_APP_UHCI0_INTR_MAP_M ((DPORT_APP_UHCI0_INTR_MAP_V)<<(DPORT_APP_UHCI0_INTR_MAP_S)) -#define DPORT_APP_UHCI0_INTR_MAP_V 0x1F -#define DPORT_APP_UHCI0_INTR_MAP_S 0 - -#define DPORT_APP_UHCI1_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x24C) -/* DPORT_APP_UHCI1_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_UHCI1_INTR_MAP 0x0000001F -#define DPORT_APP_UHCI1_INTR_MAP_M ((DPORT_APP_UHCI1_INTR_MAP_V)<<(DPORT_APP_UHCI1_INTR_MAP_S)) -#define DPORT_APP_UHCI1_INTR_MAP_V 0x1F -#define DPORT_APP_UHCI1_INTR_MAP_S 0 - -#define DPORT_APP_TG_T0_LEVEL_INT_MAP_REG (DR_REG_DPORT_BASE + 0x250) -/* DPORT_APP_TG_T0_LEVEL_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_TG_T0_LEVEL_INT_MAP 0x0000001F -#define DPORT_APP_TG_T0_LEVEL_INT_MAP_M ((DPORT_APP_TG_T0_LEVEL_INT_MAP_V)<<(DPORT_APP_TG_T0_LEVEL_INT_MAP_S)) -#define DPORT_APP_TG_T0_LEVEL_INT_MAP_V 0x1F -#define DPORT_APP_TG_T0_LEVEL_INT_MAP_S 0 - -#define DPORT_APP_TG_T1_LEVEL_INT_MAP_REG (DR_REG_DPORT_BASE + 0x254) -/* DPORT_APP_TG_T1_LEVEL_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_TG_T1_LEVEL_INT_MAP 0x0000001F -#define DPORT_APP_TG_T1_LEVEL_INT_MAP_M ((DPORT_APP_TG_T1_LEVEL_INT_MAP_V)<<(DPORT_APP_TG_T1_LEVEL_INT_MAP_S)) -#define DPORT_APP_TG_T1_LEVEL_INT_MAP_V 0x1F -#define DPORT_APP_TG_T1_LEVEL_INT_MAP_S 0 - -#define DPORT_APP_TG_WDT_LEVEL_INT_MAP_REG (DR_REG_DPORT_BASE + 0x258) -/* DPORT_APP_TG_WDT_LEVEL_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_TG_WDT_LEVEL_INT_MAP 0x0000001F -#define DPORT_APP_TG_WDT_LEVEL_INT_MAP_M ((DPORT_APP_TG_WDT_LEVEL_INT_MAP_V)<<(DPORT_APP_TG_WDT_LEVEL_INT_MAP_S)) -#define DPORT_APP_TG_WDT_LEVEL_INT_MAP_V 0x1F -#define DPORT_APP_TG_WDT_LEVEL_INT_MAP_S 0 - -#define DPORT_APP_TG_LACT_LEVEL_INT_MAP_REG (DR_REG_DPORT_BASE + 0x25C) -/* DPORT_APP_TG_LACT_LEVEL_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_TG_LACT_LEVEL_INT_MAP 0x0000001F -#define DPORT_APP_TG_LACT_LEVEL_INT_MAP_M ((DPORT_APP_TG_LACT_LEVEL_INT_MAP_V)<<(DPORT_APP_TG_LACT_LEVEL_INT_MAP_S)) -#define DPORT_APP_TG_LACT_LEVEL_INT_MAP_V 0x1F -#define DPORT_APP_TG_LACT_LEVEL_INT_MAP_S 0 - -#define DPORT_APP_TG1_T0_LEVEL_INT_MAP_REG (DR_REG_DPORT_BASE + 0x260) -/* DPORT_APP_TG1_T0_LEVEL_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_TG1_T0_LEVEL_INT_MAP 0x0000001F -#define DPORT_APP_TG1_T0_LEVEL_INT_MAP_M ((DPORT_APP_TG1_T0_LEVEL_INT_MAP_V)<<(DPORT_APP_TG1_T0_LEVEL_INT_MAP_S)) -#define DPORT_APP_TG1_T0_LEVEL_INT_MAP_V 0x1F -#define DPORT_APP_TG1_T0_LEVEL_INT_MAP_S 0 - -#define DPORT_APP_TG1_T1_LEVEL_INT_MAP_REG (DR_REG_DPORT_BASE + 0x264) -/* DPORT_APP_TG1_T1_LEVEL_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_TG1_T1_LEVEL_INT_MAP 0x0000001F -#define DPORT_APP_TG1_T1_LEVEL_INT_MAP_M ((DPORT_APP_TG1_T1_LEVEL_INT_MAP_V)<<(DPORT_APP_TG1_T1_LEVEL_INT_MAP_S)) -#define DPORT_APP_TG1_T1_LEVEL_INT_MAP_V 0x1F -#define DPORT_APP_TG1_T1_LEVEL_INT_MAP_S 0 - -#define DPORT_APP_TG1_WDT_LEVEL_INT_MAP_REG (DR_REG_DPORT_BASE + 0x268) -/* DPORT_APP_TG1_WDT_LEVEL_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_TG1_WDT_LEVEL_INT_MAP 0x0000001F -#define DPORT_APP_TG1_WDT_LEVEL_INT_MAP_M ((DPORT_APP_TG1_WDT_LEVEL_INT_MAP_V)<<(DPORT_APP_TG1_WDT_LEVEL_INT_MAP_S)) -#define DPORT_APP_TG1_WDT_LEVEL_INT_MAP_V 0x1F -#define DPORT_APP_TG1_WDT_LEVEL_INT_MAP_S 0 - -#define DPORT_APP_TG1_LACT_LEVEL_INT_MAP_REG (DR_REG_DPORT_BASE + 0x26C) -/* DPORT_APP_TG1_LACT_LEVEL_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_TG1_LACT_LEVEL_INT_MAP 0x0000001F -#define DPORT_APP_TG1_LACT_LEVEL_INT_MAP_M ((DPORT_APP_TG1_LACT_LEVEL_INT_MAP_V)<<(DPORT_APP_TG1_LACT_LEVEL_INT_MAP_S)) -#define DPORT_APP_TG1_LACT_LEVEL_INT_MAP_V 0x1F -#define DPORT_APP_TG1_LACT_LEVEL_INT_MAP_S 0 - -#define DPORT_APP_GPIO_INTERRUPT_MAP_REG (DR_REG_DPORT_BASE + 0x270) -/* DPORT_APP_GPIO_INTERRUPT_APP_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_GPIO_INTERRUPT_APP_MAP 0x0000001F -#define DPORT_APP_GPIO_INTERRUPT_APP_MAP_M ((DPORT_APP_GPIO_INTERRUPT_APP_MAP_V)<<(DPORT_APP_GPIO_INTERRUPT_APP_MAP_S)) -#define DPORT_APP_GPIO_INTERRUPT_APP_MAP_V 0x1F -#define DPORT_APP_GPIO_INTERRUPT_APP_MAP_S 0 - -#define DPORT_APP_GPIO_INTERRUPT_NMI_MAP_REG (DR_REG_DPORT_BASE + 0x274) -/* DPORT_APP_GPIO_INTERRUPT_APP_NMI_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_GPIO_INTERRUPT_APP_NMI_MAP 0x0000001F -#define DPORT_APP_GPIO_INTERRUPT_APP_NMI_MAP_M ((DPORT_APP_GPIO_INTERRUPT_APP_NMI_MAP_V)<<(DPORT_APP_GPIO_INTERRUPT_APP_NMI_MAP_S)) -#define DPORT_APP_GPIO_INTERRUPT_APP_NMI_MAP_V 0x1F -#define DPORT_APP_GPIO_INTERRUPT_APP_NMI_MAP_S 0 - -#define DPORT_APP_CPU_INTR_FROM_CPU_0_MAP_REG (DR_REG_DPORT_BASE + 0x278) -/* DPORT_APP_CPU_INTR_FROM_CPU_0_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_CPU_INTR_FROM_CPU_0_MAP 0x0000001F -#define DPORT_APP_CPU_INTR_FROM_CPU_0_MAP_M ((DPORT_APP_CPU_INTR_FROM_CPU_0_MAP_V)<<(DPORT_APP_CPU_INTR_FROM_CPU_0_MAP_S)) -#define DPORT_APP_CPU_INTR_FROM_CPU_0_MAP_V 0x1F -#define DPORT_APP_CPU_INTR_FROM_CPU_0_MAP_S 0 - -#define DPORT_APP_CPU_INTR_FROM_CPU_1_MAP_REG (DR_REG_DPORT_BASE + 0x27C) -/* DPORT_APP_CPU_INTR_FROM_CPU_1_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_CPU_INTR_FROM_CPU_1_MAP 0x0000001F -#define DPORT_APP_CPU_INTR_FROM_CPU_1_MAP_M ((DPORT_APP_CPU_INTR_FROM_CPU_1_MAP_V)<<(DPORT_APP_CPU_INTR_FROM_CPU_1_MAP_S)) -#define DPORT_APP_CPU_INTR_FROM_CPU_1_MAP_V 0x1F -#define DPORT_APP_CPU_INTR_FROM_CPU_1_MAP_S 0 - -#define DPORT_APP_CPU_INTR_FROM_CPU_2_MAP_REG (DR_REG_DPORT_BASE + 0x280) -/* DPORT_APP_CPU_INTR_FROM_CPU_2_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_CPU_INTR_FROM_CPU_2_MAP 0x0000001F -#define DPORT_APP_CPU_INTR_FROM_CPU_2_MAP_M ((DPORT_APP_CPU_INTR_FROM_CPU_2_MAP_V)<<(DPORT_APP_CPU_INTR_FROM_CPU_2_MAP_S)) -#define DPORT_APP_CPU_INTR_FROM_CPU_2_MAP_V 0x1F -#define DPORT_APP_CPU_INTR_FROM_CPU_2_MAP_S 0 - -#define DPORT_APP_CPU_INTR_FROM_CPU_3_MAP_REG (DR_REG_DPORT_BASE + 0x284) -/* DPORT_APP_CPU_INTR_FROM_CPU_3_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_CPU_INTR_FROM_CPU_3_MAP 0x0000001F -#define DPORT_APP_CPU_INTR_FROM_CPU_3_MAP_M ((DPORT_APP_CPU_INTR_FROM_CPU_3_MAP_V)<<(DPORT_APP_CPU_INTR_FROM_CPU_3_MAP_S)) -#define DPORT_APP_CPU_INTR_FROM_CPU_3_MAP_V 0x1F -#define DPORT_APP_CPU_INTR_FROM_CPU_3_MAP_S 0 - -#define DPORT_APP_SPI_INTR_0_MAP_REG (DR_REG_DPORT_BASE + 0x288) -/* DPORT_APP_SPI_INTR_0_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_SPI_INTR_0_MAP 0x0000001F -#define DPORT_APP_SPI_INTR_0_MAP_M ((DPORT_APP_SPI_INTR_0_MAP_V)<<(DPORT_APP_SPI_INTR_0_MAP_S)) -#define DPORT_APP_SPI_INTR_0_MAP_V 0x1F -#define DPORT_APP_SPI_INTR_0_MAP_S 0 - -#define DPORT_APP_SPI_INTR_1_MAP_REG (DR_REG_DPORT_BASE + 0x28C) -/* DPORT_APP_SPI_INTR_1_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_SPI_INTR_1_MAP 0x0000001F -#define DPORT_APP_SPI_INTR_1_MAP_M ((DPORT_APP_SPI_INTR_1_MAP_V)<<(DPORT_APP_SPI_INTR_1_MAP_S)) -#define DPORT_APP_SPI_INTR_1_MAP_V 0x1F -#define DPORT_APP_SPI_INTR_1_MAP_S 0 - -#define DPORT_APP_SPI_INTR_2_MAP_REG (DR_REG_DPORT_BASE + 0x290) -/* DPORT_APP_SPI_INTR_2_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_SPI_INTR_2_MAP 0x0000001F -#define DPORT_APP_SPI_INTR_2_MAP_M ((DPORT_APP_SPI_INTR_2_MAP_V)<<(DPORT_APP_SPI_INTR_2_MAP_S)) -#define DPORT_APP_SPI_INTR_2_MAP_V 0x1F -#define DPORT_APP_SPI_INTR_2_MAP_S 0 - -#define DPORT_APP_SPI_INTR_3_MAP_REG (DR_REG_DPORT_BASE + 0x294) -/* DPORT_APP_SPI_INTR_3_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_SPI_INTR_3_MAP 0x0000001F -#define DPORT_APP_SPI_INTR_3_MAP_M ((DPORT_APP_SPI_INTR_3_MAP_V)<<(DPORT_APP_SPI_INTR_3_MAP_S)) -#define DPORT_APP_SPI_INTR_3_MAP_V 0x1F -#define DPORT_APP_SPI_INTR_3_MAP_S 0 - -#define DPORT_APP_I2S0_INT_MAP_REG (DR_REG_DPORT_BASE + 0x298) -/* DPORT_APP_I2S0_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_I2S0_INT_MAP 0x0000001F -#define DPORT_APP_I2S0_INT_MAP_M ((DPORT_APP_I2S0_INT_MAP_V)<<(DPORT_APP_I2S0_INT_MAP_S)) -#define DPORT_APP_I2S0_INT_MAP_V 0x1F -#define DPORT_APP_I2S0_INT_MAP_S 0 - -#define DPORT_APP_I2S1_INT_MAP_REG (DR_REG_DPORT_BASE + 0x29C) -/* DPORT_APP_I2S1_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_I2S1_INT_MAP 0x0000001F -#define DPORT_APP_I2S1_INT_MAP_M ((DPORT_APP_I2S1_INT_MAP_V)<<(DPORT_APP_I2S1_INT_MAP_S)) -#define DPORT_APP_I2S1_INT_MAP_V 0x1F -#define DPORT_APP_I2S1_INT_MAP_S 0 - -#define DPORT_APP_UART_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x2A0) -/* DPORT_APP_UART_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_UART_INTR_MAP 0x0000001F -#define DPORT_APP_UART_INTR_MAP_M ((DPORT_APP_UART_INTR_MAP_V)<<(DPORT_APP_UART_INTR_MAP_S)) -#define DPORT_APP_UART_INTR_MAP_V 0x1F -#define DPORT_APP_UART_INTR_MAP_S 0 - -#define DPORT_APP_UART1_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x2A4) -/* DPORT_APP_UART1_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_UART1_INTR_MAP 0x0000001F -#define DPORT_APP_UART1_INTR_MAP_M ((DPORT_APP_UART1_INTR_MAP_V)<<(DPORT_APP_UART1_INTR_MAP_S)) -#define DPORT_APP_UART1_INTR_MAP_V 0x1F -#define DPORT_APP_UART1_INTR_MAP_S 0 - -#define DPORT_APP_UART2_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x2A8) -/* DPORT_APP_UART2_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_UART2_INTR_MAP 0x0000001F -#define DPORT_APP_UART2_INTR_MAP_M ((DPORT_APP_UART2_INTR_MAP_V)<<(DPORT_APP_UART2_INTR_MAP_S)) -#define DPORT_APP_UART2_INTR_MAP_V 0x1F -#define DPORT_APP_UART2_INTR_MAP_S 0 - -#define DPORT_APP_SDIO_HOST_INTERRUPT_MAP_REG (DR_REG_DPORT_BASE + 0x2AC) -/* DPORT_APP_SDIO_HOST_INTERRUPT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_SDIO_HOST_INTERRUPT_MAP 0x0000001F -#define DPORT_APP_SDIO_HOST_INTERRUPT_MAP_M ((DPORT_APP_SDIO_HOST_INTERRUPT_MAP_V)<<(DPORT_APP_SDIO_HOST_INTERRUPT_MAP_S)) -#define DPORT_APP_SDIO_HOST_INTERRUPT_MAP_V 0x1F -#define DPORT_APP_SDIO_HOST_INTERRUPT_MAP_S 0 - -#define DPORT_APP_EMAC_INT_MAP_REG (DR_REG_DPORT_BASE + 0x2B0) -/* DPORT_APP_EMAC_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_EMAC_INT_MAP 0x0000001F -#define DPORT_APP_EMAC_INT_MAP_M ((DPORT_APP_EMAC_INT_MAP_V)<<(DPORT_APP_EMAC_INT_MAP_S)) -#define DPORT_APP_EMAC_INT_MAP_V 0x1F -#define DPORT_APP_EMAC_INT_MAP_S 0 - -#define DPORT_APP_PWM0_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x2B4) -/* DPORT_APP_PWM0_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_PWM0_INTR_MAP 0x0000001F -#define DPORT_APP_PWM0_INTR_MAP_M ((DPORT_APP_PWM0_INTR_MAP_V)<<(DPORT_APP_PWM0_INTR_MAP_S)) -#define DPORT_APP_PWM0_INTR_MAP_V 0x1F -#define DPORT_APP_PWM0_INTR_MAP_S 0 - -#define DPORT_APP_PWM1_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x2B8) -/* DPORT_APP_PWM1_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_PWM1_INTR_MAP 0x0000001F -#define DPORT_APP_PWM1_INTR_MAP_M ((DPORT_APP_PWM1_INTR_MAP_V)<<(DPORT_APP_PWM1_INTR_MAP_S)) -#define DPORT_APP_PWM1_INTR_MAP_V 0x1F -#define DPORT_APP_PWM1_INTR_MAP_S 0 - -#define DPORT_APP_PWM2_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x2BC) -/* DPORT_APP_PWM2_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_PWM2_INTR_MAP 0x0000001F -#define DPORT_APP_PWM2_INTR_MAP_M ((DPORT_APP_PWM2_INTR_MAP_V)<<(DPORT_APP_PWM2_INTR_MAP_S)) -#define DPORT_APP_PWM2_INTR_MAP_V 0x1F -#define DPORT_APP_PWM2_INTR_MAP_S 0 - -#define DPORT_APP_PWM3_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x2C0) -/* DPORT_APP_PWM3_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_PWM3_INTR_MAP 0x0000001F -#define DPORT_APP_PWM3_INTR_MAP_M ((DPORT_APP_PWM3_INTR_MAP_V)<<(DPORT_APP_PWM3_INTR_MAP_S)) -#define DPORT_APP_PWM3_INTR_MAP_V 0x1F -#define DPORT_APP_PWM3_INTR_MAP_S 0 - -#define DPORT_APP_LEDC_INT_MAP_REG (DR_REG_DPORT_BASE + 0x2C4) -/* DPORT_APP_LEDC_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_LEDC_INT_MAP 0x0000001F -#define DPORT_APP_LEDC_INT_MAP_M ((DPORT_APP_LEDC_INT_MAP_V)<<(DPORT_APP_LEDC_INT_MAP_S)) -#define DPORT_APP_LEDC_INT_MAP_V 0x1F -#define DPORT_APP_LEDC_INT_MAP_S 0 - -#define DPORT_APP_EFUSE_INT_MAP_REG (DR_REG_DPORT_BASE + 0x2C8) -/* DPORT_APP_EFUSE_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_EFUSE_INT_MAP 0x0000001F -#define DPORT_APP_EFUSE_INT_MAP_M ((DPORT_APP_EFUSE_INT_MAP_V)<<(DPORT_APP_EFUSE_INT_MAP_S)) -#define DPORT_APP_EFUSE_INT_MAP_V 0x1F -#define DPORT_APP_EFUSE_INT_MAP_S 0 - -#define DPORT_APP_CAN_INT_MAP_REG (DR_REG_DPORT_BASE + 0x2CC) -/* DPORT_APP_CAN_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_CAN_INT_MAP 0x0000001F -#define DPORT_APP_CAN_INT_MAP_M ((DPORT_APP_CAN_INT_MAP_V)<<(DPORT_APP_CAN_INT_MAP_S)) -#define DPORT_APP_CAN_INT_MAP_V 0x1F -#define DPORT_APP_CAN_INT_MAP_S 0 - -#define DPORT_APP_RTC_CORE_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x2D0) -/* DPORT_APP_RTC_CORE_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_RTC_CORE_INTR_MAP 0x0000001F -#define DPORT_APP_RTC_CORE_INTR_MAP_M ((DPORT_APP_RTC_CORE_INTR_MAP_V)<<(DPORT_APP_RTC_CORE_INTR_MAP_S)) -#define DPORT_APP_RTC_CORE_INTR_MAP_V 0x1F -#define DPORT_APP_RTC_CORE_INTR_MAP_S 0 - -#define DPORT_APP_RMT_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x2D4) -/* DPORT_APP_RMT_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_RMT_INTR_MAP 0x0000001F -#define DPORT_APP_RMT_INTR_MAP_M ((DPORT_APP_RMT_INTR_MAP_V)<<(DPORT_APP_RMT_INTR_MAP_S)) -#define DPORT_APP_RMT_INTR_MAP_V 0x1F -#define DPORT_APP_RMT_INTR_MAP_S 0 - -#define DPORT_APP_PCNT_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x2D8) -/* DPORT_APP_PCNT_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_PCNT_INTR_MAP 0x0000001F -#define DPORT_APP_PCNT_INTR_MAP_M ((DPORT_APP_PCNT_INTR_MAP_V)<<(DPORT_APP_PCNT_INTR_MAP_S)) -#define DPORT_APP_PCNT_INTR_MAP_V 0x1F -#define DPORT_APP_PCNT_INTR_MAP_S 0 - -#define DPORT_APP_I2C_EXT0_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x2DC) -/* DPORT_APP_I2C_EXT0_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_I2C_EXT0_INTR_MAP 0x0000001F -#define DPORT_APP_I2C_EXT0_INTR_MAP_M ((DPORT_APP_I2C_EXT0_INTR_MAP_V)<<(DPORT_APP_I2C_EXT0_INTR_MAP_S)) -#define DPORT_APP_I2C_EXT0_INTR_MAP_V 0x1F -#define DPORT_APP_I2C_EXT0_INTR_MAP_S 0 - -#define DPORT_APP_I2C_EXT1_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x2E0) -/* DPORT_APP_I2C_EXT1_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_I2C_EXT1_INTR_MAP 0x0000001F -#define DPORT_APP_I2C_EXT1_INTR_MAP_M ((DPORT_APP_I2C_EXT1_INTR_MAP_V)<<(DPORT_APP_I2C_EXT1_INTR_MAP_S)) -#define DPORT_APP_I2C_EXT1_INTR_MAP_V 0x1F -#define DPORT_APP_I2C_EXT1_INTR_MAP_S 0 - -#define DPORT_APP_RSA_INTR_MAP_REG (DR_REG_DPORT_BASE + 0x2E4) -/* DPORT_APP_RSA_INTR_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_RSA_INTR_MAP 0x0000001F -#define DPORT_APP_RSA_INTR_MAP_M ((DPORT_APP_RSA_INTR_MAP_V)<<(DPORT_APP_RSA_INTR_MAP_S)) -#define DPORT_APP_RSA_INTR_MAP_V 0x1F -#define DPORT_APP_RSA_INTR_MAP_S 0 - -#define DPORT_APP_SPI1_DMA_INT_MAP_REG (DR_REG_DPORT_BASE + 0x2E8) -/* DPORT_APP_SPI1_DMA_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_SPI1_DMA_INT_MAP 0x0000001F -#define DPORT_APP_SPI1_DMA_INT_MAP_M ((DPORT_APP_SPI1_DMA_INT_MAP_V)<<(DPORT_APP_SPI1_DMA_INT_MAP_S)) -#define DPORT_APP_SPI1_DMA_INT_MAP_V 0x1F -#define DPORT_APP_SPI1_DMA_INT_MAP_S 0 - -#define DPORT_APP_SPI2_DMA_INT_MAP_REG (DR_REG_DPORT_BASE + 0x2EC) -/* DPORT_APP_SPI2_DMA_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_SPI2_DMA_INT_MAP 0x0000001F -#define DPORT_APP_SPI2_DMA_INT_MAP_M ((DPORT_APP_SPI2_DMA_INT_MAP_V)<<(DPORT_APP_SPI2_DMA_INT_MAP_S)) -#define DPORT_APP_SPI2_DMA_INT_MAP_V 0x1F -#define DPORT_APP_SPI2_DMA_INT_MAP_S 0 - -#define DPORT_APP_SPI3_DMA_INT_MAP_REG (DR_REG_DPORT_BASE + 0x2F0) -/* DPORT_APP_SPI3_DMA_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_SPI3_DMA_INT_MAP 0x0000001F -#define DPORT_APP_SPI3_DMA_INT_MAP_M ((DPORT_APP_SPI3_DMA_INT_MAP_V)<<(DPORT_APP_SPI3_DMA_INT_MAP_S)) -#define DPORT_APP_SPI3_DMA_INT_MAP_V 0x1F -#define DPORT_APP_SPI3_DMA_INT_MAP_S 0 - -#define DPORT_APP_WDG_INT_MAP_REG (DR_REG_DPORT_BASE + 0x2F4) -/* DPORT_APP_WDG_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_WDG_INT_MAP 0x0000001F -#define DPORT_APP_WDG_INT_MAP_M ((DPORT_APP_WDG_INT_MAP_V)<<(DPORT_APP_WDG_INT_MAP_S)) -#define DPORT_APP_WDG_INT_MAP_V 0x1F -#define DPORT_APP_WDG_INT_MAP_S 0 - -#define DPORT_APP_TIMER_INT1_MAP_REG (DR_REG_DPORT_BASE + 0x2F8) -/* DPORT_APP_TIMER_INT1_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_TIMER_INT1_MAP 0x0000001F -#define DPORT_APP_TIMER_INT1_MAP_M ((DPORT_APP_TIMER_INT1_MAP_V)<<(DPORT_APP_TIMER_INT1_MAP_S)) -#define DPORT_APP_TIMER_INT1_MAP_V 0x1F -#define DPORT_APP_TIMER_INT1_MAP_S 0 - -#define DPORT_APP_TIMER_INT2_MAP_REG (DR_REG_DPORT_BASE + 0x2FC) -/* DPORT_APP_TIMER_INT2_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_TIMER_INT2_MAP 0x0000001F -#define DPORT_APP_TIMER_INT2_MAP_M ((DPORT_APP_TIMER_INT2_MAP_V)<<(DPORT_APP_TIMER_INT2_MAP_S)) -#define DPORT_APP_TIMER_INT2_MAP_V 0x1F -#define DPORT_APP_TIMER_INT2_MAP_S 0 - -#define DPORT_APP_TG_T0_EDGE_INT_MAP_REG (DR_REG_DPORT_BASE + 0x300) -/* DPORT_APP_TG_T0_EDGE_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_TG_T0_EDGE_INT_MAP 0x0000001F -#define DPORT_APP_TG_T0_EDGE_INT_MAP_M ((DPORT_APP_TG_T0_EDGE_INT_MAP_V)<<(DPORT_APP_TG_T0_EDGE_INT_MAP_S)) -#define DPORT_APP_TG_T0_EDGE_INT_MAP_V 0x1F -#define DPORT_APP_TG_T0_EDGE_INT_MAP_S 0 - -#define DPORT_APP_TG_T1_EDGE_INT_MAP_REG (DR_REG_DPORT_BASE + 0x304) -/* DPORT_APP_TG_T1_EDGE_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_TG_T1_EDGE_INT_MAP 0x0000001F -#define DPORT_APP_TG_T1_EDGE_INT_MAP_M ((DPORT_APP_TG_T1_EDGE_INT_MAP_V)<<(DPORT_APP_TG_T1_EDGE_INT_MAP_S)) -#define DPORT_APP_TG_T1_EDGE_INT_MAP_V 0x1F -#define DPORT_APP_TG_T1_EDGE_INT_MAP_S 0 - -#define DPORT_APP_TG_WDT_EDGE_INT_MAP_REG (DR_REG_DPORT_BASE + 0x308) -/* DPORT_APP_TG_WDT_EDGE_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_TG_WDT_EDGE_INT_MAP 0x0000001F -#define DPORT_APP_TG_WDT_EDGE_INT_MAP_M ((DPORT_APP_TG_WDT_EDGE_INT_MAP_V)<<(DPORT_APP_TG_WDT_EDGE_INT_MAP_S)) -#define DPORT_APP_TG_WDT_EDGE_INT_MAP_V 0x1F -#define DPORT_APP_TG_WDT_EDGE_INT_MAP_S 0 - -#define DPORT_APP_TG_LACT_EDGE_INT_MAP_REG (DR_REG_DPORT_BASE + 0x30C) -/* DPORT_APP_TG_LACT_EDGE_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_TG_LACT_EDGE_INT_MAP 0x0000001F -#define DPORT_APP_TG_LACT_EDGE_INT_MAP_M ((DPORT_APP_TG_LACT_EDGE_INT_MAP_V)<<(DPORT_APP_TG_LACT_EDGE_INT_MAP_S)) -#define DPORT_APP_TG_LACT_EDGE_INT_MAP_V 0x1F -#define DPORT_APP_TG_LACT_EDGE_INT_MAP_S 0 - -#define DPORT_APP_TG1_T0_EDGE_INT_MAP_REG (DR_REG_DPORT_BASE + 0x310) -/* DPORT_APP_TG1_T0_EDGE_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_TG1_T0_EDGE_INT_MAP 0x0000001F -#define DPORT_APP_TG1_T0_EDGE_INT_MAP_M ((DPORT_APP_TG1_T0_EDGE_INT_MAP_V)<<(DPORT_APP_TG1_T0_EDGE_INT_MAP_S)) -#define DPORT_APP_TG1_T0_EDGE_INT_MAP_V 0x1F -#define DPORT_APP_TG1_T0_EDGE_INT_MAP_S 0 - -#define DPORT_APP_TG1_T1_EDGE_INT_MAP_REG (DR_REG_DPORT_BASE + 0x314) -/* DPORT_APP_TG1_T1_EDGE_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_TG1_T1_EDGE_INT_MAP 0x0000001F -#define DPORT_APP_TG1_T1_EDGE_INT_MAP_M ((DPORT_APP_TG1_T1_EDGE_INT_MAP_V)<<(DPORT_APP_TG1_T1_EDGE_INT_MAP_S)) -#define DPORT_APP_TG1_T1_EDGE_INT_MAP_V 0x1F -#define DPORT_APP_TG1_T1_EDGE_INT_MAP_S 0 - -#define DPORT_APP_TG1_WDT_EDGE_INT_MAP_REG (DR_REG_DPORT_BASE + 0x318) -/* DPORT_APP_TG1_WDT_EDGE_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_TG1_WDT_EDGE_INT_MAP 0x0000001F -#define DPORT_APP_TG1_WDT_EDGE_INT_MAP_M ((DPORT_APP_TG1_WDT_EDGE_INT_MAP_V)<<(DPORT_APP_TG1_WDT_EDGE_INT_MAP_S)) -#define DPORT_APP_TG1_WDT_EDGE_INT_MAP_V 0x1F -#define DPORT_APP_TG1_WDT_EDGE_INT_MAP_S 0 - -#define DPORT_APP_TG1_LACT_EDGE_INT_MAP_REG (DR_REG_DPORT_BASE + 0x31C) -/* DPORT_APP_TG1_LACT_EDGE_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_TG1_LACT_EDGE_INT_MAP 0x0000001F -#define DPORT_APP_TG1_LACT_EDGE_INT_MAP_M ((DPORT_APP_TG1_LACT_EDGE_INT_MAP_V)<<(DPORT_APP_TG1_LACT_EDGE_INT_MAP_S)) -#define DPORT_APP_TG1_LACT_EDGE_INT_MAP_V 0x1F -#define DPORT_APP_TG1_LACT_EDGE_INT_MAP_S 0 - -#define DPORT_APP_MMU_IA_INT_MAP_REG (DR_REG_DPORT_BASE + 0x320) -/* DPORT_APP_MMU_IA_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_MMU_IA_INT_MAP 0x0000001F -#define DPORT_APP_MMU_IA_INT_MAP_M ((DPORT_APP_MMU_IA_INT_MAP_V)<<(DPORT_APP_MMU_IA_INT_MAP_S)) -#define DPORT_APP_MMU_IA_INT_MAP_V 0x1F -#define DPORT_APP_MMU_IA_INT_MAP_S 0 - -#define DPORT_APP_MPU_IA_INT_MAP_REG (DR_REG_DPORT_BASE + 0x324) -/* DPORT_APP_MPU_IA_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_MPU_IA_INT_MAP 0x0000001F -#define DPORT_APP_MPU_IA_INT_MAP_M ((DPORT_APP_MPU_IA_INT_MAP_V)<<(DPORT_APP_MPU_IA_INT_MAP_S)) -#define DPORT_APP_MPU_IA_INT_MAP_V 0x1F -#define DPORT_APP_MPU_IA_INT_MAP_S 0 - -#define DPORT_APP_CACHE_IA_INT_MAP_REG (DR_REG_DPORT_BASE + 0x328) -/* DPORT_APP_CACHE_IA_INT_MAP : R/W ;bitpos:[4:0] ;default: 5'd16 ; */ -/*description: */ -#define DPORT_APP_CACHE_IA_INT_MAP 0x0000001F -#define DPORT_APP_CACHE_IA_INT_MAP_M ((DPORT_APP_CACHE_IA_INT_MAP_V)<<(DPORT_APP_CACHE_IA_INT_MAP_S)) -#define DPORT_APP_CACHE_IA_INT_MAP_V 0x1F -#define DPORT_APP_CACHE_IA_INT_MAP_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_UART_REG (DR_REG_DPORT_BASE + 0x32C) -/* DPORT_UART_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_UART_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_UART_ACCESS_GRANT_CONFIG_M ((DPORT_UART_ACCESS_GRANT_CONFIG_V)<<(DPORT_UART_ACCESS_GRANT_CONFIG_S)) -#define DPORT_UART_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_UART_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_SPI1_REG (DR_REG_DPORT_BASE + 0x330) -/* DPORT_SPI1_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_SPI1_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_SPI1_ACCESS_GRANT_CONFIG_M ((DPORT_SPI1_ACCESS_GRANT_CONFIG_V)<<(DPORT_SPI1_ACCESS_GRANT_CONFIG_S)) -#define DPORT_SPI1_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_SPI1_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_SPI0_REG (DR_REG_DPORT_BASE + 0x334) -/* DPORT_SPI0_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_SPI0_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_SPI0_ACCESS_GRANT_CONFIG_M ((DPORT_SPI0_ACCESS_GRANT_CONFIG_V)<<(DPORT_SPI0_ACCESS_GRANT_CONFIG_S)) -#define DPORT_SPI0_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_SPI0_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_GPIO_REG (DR_REG_DPORT_BASE + 0x338) -/* DPORT_GPIO_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_GPIO_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_GPIO_ACCESS_GRANT_CONFIG_M ((DPORT_GPIO_ACCESS_GRANT_CONFIG_V)<<(DPORT_GPIO_ACCESS_GRANT_CONFIG_S)) -#define DPORT_GPIO_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_GPIO_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_FE2_REG (DR_REG_DPORT_BASE + 0x33C) -/* DPORT_FE2_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_FE2_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_FE2_ACCESS_GRANT_CONFIG_M ((DPORT_FE2_ACCESS_GRANT_CONFIG_V)<<(DPORT_FE2_ACCESS_GRANT_CONFIG_S)) -#define DPORT_FE2_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_FE2_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_FE_REG (DR_REG_DPORT_BASE + 0x340) -/* DPORT_FE_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_FE_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_FE_ACCESS_GRANT_CONFIG_M ((DPORT_FE_ACCESS_GRANT_CONFIG_V)<<(DPORT_FE_ACCESS_GRANT_CONFIG_S)) -#define DPORT_FE_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_FE_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_TIMER_REG (DR_REG_DPORT_BASE + 0x344) -/* DPORT_TIMER_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_TIMER_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_TIMER_ACCESS_GRANT_CONFIG_M ((DPORT_TIMER_ACCESS_GRANT_CONFIG_V)<<(DPORT_TIMER_ACCESS_GRANT_CONFIG_S)) -#define DPORT_TIMER_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_TIMER_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_RTC_REG (DR_REG_DPORT_BASE + 0x348) -/* DPORT_RTC_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_RTC_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_RTC_ACCESS_GRANT_CONFIG_M ((DPORT_RTC_ACCESS_GRANT_CONFIG_V)<<(DPORT_RTC_ACCESS_GRANT_CONFIG_S)) -#define DPORT_RTC_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_RTC_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_IO_MUX_REG (DR_REG_DPORT_BASE + 0x34C) -/* DPORT_IOMUX_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_IOMUX_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_IOMUX_ACCESS_GRANT_CONFIG_M ((DPORT_IOMUX_ACCESS_GRANT_CONFIG_V)<<(DPORT_IOMUX_ACCESS_GRANT_CONFIG_S)) -#define DPORT_IOMUX_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_IOMUX_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_WDG_REG (DR_REG_DPORT_BASE + 0x350) -/* DPORT_WDG_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_WDG_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_WDG_ACCESS_GRANT_CONFIG_M ((DPORT_WDG_ACCESS_GRANT_CONFIG_V)<<(DPORT_WDG_ACCESS_GRANT_CONFIG_S)) -#define DPORT_WDG_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_WDG_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_HINF_REG (DR_REG_DPORT_BASE + 0x354) -/* DPORT_HINF_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_HINF_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_HINF_ACCESS_GRANT_CONFIG_M ((DPORT_HINF_ACCESS_GRANT_CONFIG_V)<<(DPORT_HINF_ACCESS_GRANT_CONFIG_S)) -#define DPORT_HINF_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_HINF_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_UHCI1_REG (DR_REG_DPORT_BASE + 0x358) -/* DPORT_UHCI1_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_UHCI1_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_UHCI1_ACCESS_GRANT_CONFIG_M ((DPORT_UHCI1_ACCESS_GRANT_CONFIG_V)<<(DPORT_UHCI1_ACCESS_GRANT_CONFIG_S)) -#define DPORT_UHCI1_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_UHCI1_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_MISC_REG (DR_REG_DPORT_BASE + 0x35C) -/* DPORT_MISC_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_MISC_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_MISC_ACCESS_GRANT_CONFIG_M ((DPORT_MISC_ACCESS_GRANT_CONFIG_V)<<(DPORT_MISC_ACCESS_GRANT_CONFIG_S)) -#define DPORT_MISC_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_MISC_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_I2C_REG (DR_REG_DPORT_BASE + 0x360) -/* DPORT_I2C_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_I2C_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_I2C_ACCESS_GRANT_CONFIG_M ((DPORT_I2C_ACCESS_GRANT_CONFIG_V)<<(DPORT_I2C_ACCESS_GRANT_CONFIG_S)) -#define DPORT_I2C_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_I2C_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_I2S0_REG (DR_REG_DPORT_BASE + 0x364) -/* DPORT_I2S0_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_I2S0_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_I2S0_ACCESS_GRANT_CONFIG_M ((DPORT_I2S0_ACCESS_GRANT_CONFIG_V)<<(DPORT_I2S0_ACCESS_GRANT_CONFIG_S)) -#define DPORT_I2S0_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_I2S0_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_UART1_REG (DR_REG_DPORT_BASE + 0x368) -/* DPORT_UART1_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_UART1_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_UART1_ACCESS_GRANT_CONFIG_M ((DPORT_UART1_ACCESS_GRANT_CONFIG_V)<<(DPORT_UART1_ACCESS_GRANT_CONFIG_S)) -#define DPORT_UART1_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_UART1_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_BT_REG (DR_REG_DPORT_BASE + 0x36C) -/* DPORT_BT_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_BT_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_BT_ACCESS_GRANT_CONFIG_M ((DPORT_BT_ACCESS_GRANT_CONFIG_V)<<(DPORT_BT_ACCESS_GRANT_CONFIG_S)) -#define DPORT_BT_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_BT_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_BT_BUFFER_REG (DR_REG_DPORT_BASE + 0x370) -/* DPORT_BTBUFFER_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_BTBUFFER_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_BTBUFFER_ACCESS_GRANT_CONFIG_M ((DPORT_BTBUFFER_ACCESS_GRANT_CONFIG_V)<<(DPORT_BTBUFFER_ACCESS_GRANT_CONFIG_S)) -#define DPORT_BTBUFFER_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_BTBUFFER_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_I2C_EXT0_REG (DR_REG_DPORT_BASE + 0x374) -/* DPORT_I2CEXT0_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_I2CEXT0_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_I2CEXT0_ACCESS_GRANT_CONFIG_M ((DPORT_I2CEXT0_ACCESS_GRANT_CONFIG_V)<<(DPORT_I2CEXT0_ACCESS_GRANT_CONFIG_S)) -#define DPORT_I2CEXT0_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_I2CEXT0_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_UHCI0_REG (DR_REG_DPORT_BASE + 0x378) -/* DPORT_UHCI0_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_UHCI0_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_UHCI0_ACCESS_GRANT_CONFIG_M ((DPORT_UHCI0_ACCESS_GRANT_CONFIG_V)<<(DPORT_UHCI0_ACCESS_GRANT_CONFIG_S)) -#define DPORT_UHCI0_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_UHCI0_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_SLCHOST_REG (DR_REG_DPORT_BASE + 0x37C) -/* DPORT_SLCHOST_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_SLCHOST_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_SLCHOST_ACCESS_GRANT_CONFIG_M ((DPORT_SLCHOST_ACCESS_GRANT_CONFIG_V)<<(DPORT_SLCHOST_ACCESS_GRANT_CONFIG_S)) -#define DPORT_SLCHOST_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_SLCHOST_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_RMT_REG (DR_REG_DPORT_BASE + 0x380) -/* DPORT_RMT_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_RMT_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_RMT_ACCESS_GRANT_CONFIG_M ((DPORT_RMT_ACCESS_GRANT_CONFIG_V)<<(DPORT_RMT_ACCESS_GRANT_CONFIG_S)) -#define DPORT_RMT_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_RMT_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_PCNT_REG (DR_REG_DPORT_BASE + 0x384) -/* DPORT_PCNT_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_PCNT_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_PCNT_ACCESS_GRANT_CONFIG_M ((DPORT_PCNT_ACCESS_GRANT_CONFIG_V)<<(DPORT_PCNT_ACCESS_GRANT_CONFIG_S)) -#define DPORT_PCNT_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_PCNT_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_SLC_REG (DR_REG_DPORT_BASE + 0x388) -/* DPORT_SLC_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_SLC_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_SLC_ACCESS_GRANT_CONFIG_M ((DPORT_SLC_ACCESS_GRANT_CONFIG_V)<<(DPORT_SLC_ACCESS_GRANT_CONFIG_S)) -#define DPORT_SLC_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_SLC_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_LEDC_REG (DR_REG_DPORT_BASE + 0x38C) -/* DPORT_LEDC_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_LEDC_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_LEDC_ACCESS_GRANT_CONFIG_M ((DPORT_LEDC_ACCESS_GRANT_CONFIG_V)<<(DPORT_LEDC_ACCESS_GRANT_CONFIG_S)) -#define DPORT_LEDC_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_LEDC_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_EFUSE_REG (DR_REG_DPORT_BASE + 0x390) -/* DPORT_EFUSE_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_EFUSE_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_EFUSE_ACCESS_GRANT_CONFIG_M ((DPORT_EFUSE_ACCESS_GRANT_CONFIG_V)<<(DPORT_EFUSE_ACCESS_GRANT_CONFIG_S)) -#define DPORT_EFUSE_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_EFUSE_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_SPI_ENCRYPT_REG (DR_REG_DPORT_BASE + 0x394) -/* DPORT_SPI_ENCRYPY_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_SPI_ENCRYPY_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_SPI_ENCRYPY_ACCESS_GRANT_CONFIG_M ((DPORT_SPI_ENCRYPY_ACCESS_GRANT_CONFIG_V)<<(DPORT_SPI_ENCRYPY_ACCESS_GRANT_CONFIG_S)) -#define DPORT_SPI_ENCRYPY_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_SPI_ENCRYPY_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_BB_REG (DR_REG_DPORT_BASE + 0x398) -/* DPORT_BB_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_BB_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_BB_ACCESS_GRANT_CONFIG_M ((DPORT_BB_ACCESS_GRANT_CONFIG_V)<<(DPORT_BB_ACCESS_GRANT_CONFIG_S)) -#define DPORT_BB_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_BB_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_PWM0_REG (DR_REG_DPORT_BASE + 0x39C) -/* DPORT_PWM0_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_PWM0_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_PWM0_ACCESS_GRANT_CONFIG_M ((DPORT_PWM0_ACCESS_GRANT_CONFIG_V)<<(DPORT_PWM0_ACCESS_GRANT_CONFIG_S)) -#define DPORT_PWM0_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_PWM0_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_TIMERGROUP_REG (DR_REG_DPORT_BASE + 0x3A0) -/* DPORT_TIMERGROUP_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_TIMERGROUP_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_TIMERGROUP_ACCESS_GRANT_CONFIG_M ((DPORT_TIMERGROUP_ACCESS_GRANT_CONFIG_V)<<(DPORT_TIMERGROUP_ACCESS_GRANT_CONFIG_S)) -#define DPORT_TIMERGROUP_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_TIMERGROUP_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_TIMERGROUP1_REG (DR_REG_DPORT_BASE + 0x3A4) -/* DPORT_TIMERGROUP1_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_TIMERGROUP1_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_TIMERGROUP1_ACCESS_GRANT_CONFIG_M ((DPORT_TIMERGROUP1_ACCESS_GRANT_CONFIG_V)<<(DPORT_TIMERGROUP1_ACCESS_GRANT_CONFIG_S)) -#define DPORT_TIMERGROUP1_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_TIMERGROUP1_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_SPI2_REG (DR_REG_DPORT_BASE + 0x3A8) -/* DPORT_SPI2_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_SPI2_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_SPI2_ACCESS_GRANT_CONFIG_M ((DPORT_SPI2_ACCESS_GRANT_CONFIG_V)<<(DPORT_SPI2_ACCESS_GRANT_CONFIG_S)) -#define DPORT_SPI2_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_SPI2_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_SPI3_REG (DR_REG_DPORT_BASE + 0x3AC) -/* DPORT_SPI3_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_SPI3_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_SPI3_ACCESS_GRANT_CONFIG_M ((DPORT_SPI3_ACCESS_GRANT_CONFIG_V)<<(DPORT_SPI3_ACCESS_GRANT_CONFIG_S)) -#define DPORT_SPI3_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_SPI3_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_APB_CTRL_REG (DR_REG_DPORT_BASE + 0x3B0) -/* DPORT_APBCTRL_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_APBCTRL_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_APBCTRL_ACCESS_GRANT_CONFIG_M ((DPORT_APBCTRL_ACCESS_GRANT_CONFIG_V)<<(DPORT_APBCTRL_ACCESS_GRANT_CONFIG_S)) -#define DPORT_APBCTRL_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_APBCTRL_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_I2C_EXT1_REG (DR_REG_DPORT_BASE + 0x3B4) -/* DPORT_I2CEXT1_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_I2CEXT1_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_I2CEXT1_ACCESS_GRANT_CONFIG_M ((DPORT_I2CEXT1_ACCESS_GRANT_CONFIG_V)<<(DPORT_I2CEXT1_ACCESS_GRANT_CONFIG_S)) -#define DPORT_I2CEXT1_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_I2CEXT1_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_SDIO_HOST_REG (DR_REG_DPORT_BASE + 0x3B8) -/* DPORT_SDIOHOST_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_SDIOHOST_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_SDIOHOST_ACCESS_GRANT_CONFIG_M ((DPORT_SDIOHOST_ACCESS_GRANT_CONFIG_V)<<(DPORT_SDIOHOST_ACCESS_GRANT_CONFIG_S)) -#define DPORT_SDIOHOST_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_SDIOHOST_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_EMAC_REG (DR_REG_DPORT_BASE + 0x3BC) -/* DPORT_EMAC_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_EMAC_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_EMAC_ACCESS_GRANT_CONFIG_M ((DPORT_EMAC_ACCESS_GRANT_CONFIG_V)<<(DPORT_EMAC_ACCESS_GRANT_CONFIG_S)) -#define DPORT_EMAC_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_EMAC_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_CAN_REG (DR_REG_DPORT_BASE + 0x3C0) -/* DPORT_CAN_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_CAN_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_CAN_ACCESS_GRANT_CONFIG_M ((DPORT_CAN_ACCESS_GRANT_CONFIG_V)<<(DPORT_CAN_ACCESS_GRANT_CONFIG_S)) -#define DPORT_CAN_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_CAN_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_PWM1_REG (DR_REG_DPORT_BASE + 0x3C4) -/* DPORT_PWM1_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_PWM1_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_PWM1_ACCESS_GRANT_CONFIG_M ((DPORT_PWM1_ACCESS_GRANT_CONFIG_V)<<(DPORT_PWM1_ACCESS_GRANT_CONFIG_S)) -#define DPORT_PWM1_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_PWM1_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_I2S1_REG (DR_REG_DPORT_BASE + 0x3C8) -/* DPORT_I2S1_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_I2S1_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_I2S1_ACCESS_GRANT_CONFIG_M ((DPORT_I2S1_ACCESS_GRANT_CONFIG_V)<<(DPORT_I2S1_ACCESS_GRANT_CONFIG_S)) -#define DPORT_I2S1_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_I2S1_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_UART2_REG (DR_REG_DPORT_BASE + 0x3CC) -/* DPORT_UART2_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_UART2_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_UART2_ACCESS_GRANT_CONFIG_M ((DPORT_UART2_ACCESS_GRANT_CONFIG_V)<<(DPORT_UART2_ACCESS_GRANT_CONFIG_S)) -#define DPORT_UART2_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_UART2_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_PWM2_REG (DR_REG_DPORT_BASE + 0x3D0) -/* DPORT_PWM2_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_PWM2_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_PWM2_ACCESS_GRANT_CONFIG_M ((DPORT_PWM2_ACCESS_GRANT_CONFIG_V)<<(DPORT_PWM2_ACCESS_GRANT_CONFIG_S)) -#define DPORT_PWM2_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_PWM2_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_PWM3_REG (DR_REG_DPORT_BASE + 0x3D4) -/* DPORT_PWM3_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_PWM3_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_PWM3_ACCESS_GRANT_CONFIG_M ((DPORT_PWM3_ACCESS_GRANT_CONFIG_V)<<(DPORT_PWM3_ACCESS_GRANT_CONFIG_S)) -#define DPORT_PWM3_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_PWM3_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_RWBT_REG (DR_REG_DPORT_BASE + 0x3D8) -/* DPORT_RWBT_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_RWBT_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_RWBT_ACCESS_GRANT_CONFIG_M ((DPORT_RWBT_ACCESS_GRANT_CONFIG_V)<<(DPORT_RWBT_ACCESS_GRANT_CONFIG_S)) -#define DPORT_RWBT_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_RWBT_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_BTMAC_REG (DR_REG_DPORT_BASE + 0x3DC) -/* DPORT_BTMAC_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_BTMAC_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_BTMAC_ACCESS_GRANT_CONFIG_M ((DPORT_BTMAC_ACCESS_GRANT_CONFIG_V)<<(DPORT_BTMAC_ACCESS_GRANT_CONFIG_S)) -#define DPORT_BTMAC_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_BTMAC_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_WIFIMAC_REG (DR_REG_DPORT_BASE + 0x3E0) -/* DPORT_WIFIMAC_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_WIFIMAC_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_WIFIMAC_ACCESS_GRANT_CONFIG_M ((DPORT_WIFIMAC_ACCESS_GRANT_CONFIG_V)<<(DPORT_WIFIMAC_ACCESS_GRANT_CONFIG_S)) -#define DPORT_WIFIMAC_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_WIFIMAC_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_AHBLITE_MPU_TABLE_PWR_REG (DR_REG_DPORT_BASE + 0x3E4) -/* DPORT_PWR_ACCESS_GRANT_CONFIG : R/W ;bitpos:[5:0] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_PWR_ACCESS_GRANT_CONFIG 0x0000003F -#define DPORT_PWR_ACCESS_GRANT_CONFIG_M ((DPORT_PWR_ACCESS_GRANT_CONFIG_V)<<(DPORT_PWR_ACCESS_GRANT_CONFIG_S)) -#define DPORT_PWR_ACCESS_GRANT_CONFIG_V 0x3F -#define DPORT_PWR_ACCESS_GRANT_CONFIG_S 0 - -#define DPORT_MEM_ACCESS_DBUG0_REG (DR_REG_DPORT_BASE + 0x3E8) -/* DPORT_INTERNAL_SRAM_MMU_MULTI_HIT : RO ;bitpos:[29:26] ;default: 4'b0 ; */ -/*description: */ -#define DPORT_INTERNAL_SRAM_MMU_MULTI_HIT 0x0000000F -#define DPORT_INTERNAL_SRAM_MMU_MULTI_HIT_M ((DPORT_INTERNAL_SRAM_MMU_MULTI_HIT_V)<<(DPORT_INTERNAL_SRAM_MMU_MULTI_HIT_S)) -#define DPORT_INTERNAL_SRAM_MMU_MULTI_HIT_V 0xF -#define DPORT_INTERNAL_SRAM_MMU_MULTI_HIT_S 26 -/* DPORT_INTERNAL_SRAM_IA : RO ;bitpos:[25:14] ;default: 12'b0 ; */ -/*description: */ -#define DPORT_INTERNAL_SRAM_IA 0x00000FFF -#define DPORT_INTERNAL_SRAM_IA_M ((DPORT_INTERNAL_SRAM_IA_V)<<(DPORT_INTERNAL_SRAM_IA_S)) -#define DPORT_INTERNAL_SRAM_IA_V 0xFFF -#define DPORT_INTERNAL_SRAM_IA_S 14 -/* DPORT_INTERNAL_SRAM_MMU_AD : RO ;bitpos:[13:10] ;default: 4'b0 ; */ -/*description: */ -#define DPORT_INTERNAL_SRAM_MMU_AD 0x0000000F -#define DPORT_INTERNAL_SRAM_MMU_AD_M ((DPORT_INTERNAL_SRAM_MMU_AD_V)<<(DPORT_INTERNAL_SRAM_MMU_AD_S)) -#define DPORT_INTERNAL_SRAM_MMU_AD_V 0xF -#define DPORT_INTERNAL_SRAM_MMU_AD_S 10 -/* DPORT_SHARE_ROM_IA : RO ;bitpos:[9:6] ;default: 4'b0 ; */ -/*description: */ -#define DPORT_SHARE_ROM_IA 0x0000000F -#define DPORT_SHARE_ROM_IA_M ((DPORT_SHARE_ROM_IA_V)<<(DPORT_SHARE_ROM_IA_S)) -#define DPORT_SHARE_ROM_IA_V 0xF -#define DPORT_SHARE_ROM_IA_S 6 -/* DPORT_SHARE_ROM_MPU_AD : RO ;bitpos:[5:4] ;default: 2'b0 ; */ -/*description: */ -#define DPORT_SHARE_ROM_MPU_AD 0x00000003 -#define DPORT_SHARE_ROM_MPU_AD_M ((DPORT_SHARE_ROM_MPU_AD_V)<<(DPORT_SHARE_ROM_MPU_AD_S)) -#define DPORT_SHARE_ROM_MPU_AD_V 0x3 -#define DPORT_SHARE_ROM_MPU_AD_S 4 -/* DPORT_APP_ROM_IA : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_ROM_IA (BIT(3)) -#define DPORT_APP_ROM_IA_M (BIT(3)) -#define DPORT_APP_ROM_IA_V 0x1 -#define DPORT_APP_ROM_IA_S 3 -/* DPORT_APP_ROM_MPU_AD : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_ROM_MPU_AD (BIT(2)) -#define DPORT_APP_ROM_MPU_AD_M (BIT(2)) -#define DPORT_APP_ROM_MPU_AD_V 0x1 -#define DPORT_APP_ROM_MPU_AD_S 2 -/* DPORT_PRO_ROM_IA : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_ROM_IA (BIT(1)) -#define DPORT_PRO_ROM_IA_M (BIT(1)) -#define DPORT_PRO_ROM_IA_V 0x1 -#define DPORT_PRO_ROM_IA_S 1 -/* DPORT_PRO_ROM_MPU_AD : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_ROM_MPU_AD (BIT(0)) -#define DPORT_PRO_ROM_MPU_AD_M (BIT(0)) -#define DPORT_PRO_ROM_MPU_AD_V 0x1 -#define DPORT_PRO_ROM_MPU_AD_S 0 - -#define DPORT_MEM_ACCESS_DBUG1_REG (DR_REG_DPORT_BASE + 0x3EC) -/* DPORT_AHBLITE_IA : RO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_AHBLITE_IA (BIT(10)) -#define DPORT_AHBLITE_IA_M (BIT(10)) -#define DPORT_AHBLITE_IA_V 0x1 -#define DPORT_AHBLITE_IA_S 10 -/* DPORT_AHBLITE_ACCESS_DENY : RO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_AHBLITE_ACCESS_DENY (BIT(9)) -#define DPORT_AHBLITE_ACCESS_DENY_M (BIT(9)) -#define DPORT_AHBLITE_ACCESS_DENY_V 0x1 -#define DPORT_AHBLITE_ACCESS_DENY_S 9 -/* DPORT_AHB_ACCESS_DENY : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_AHB_ACCESS_DENY (BIT(8)) -#define DPORT_AHB_ACCESS_DENY_M (BIT(8)) -#define DPORT_AHB_ACCESS_DENY_V 0x1 -#define DPORT_AHB_ACCESS_DENY_S 8 -/* DPORT_PIDGEN_IA : RO ;bitpos:[7:6] ;default: 2'b0 ; */ -/*description: */ -#define DPORT_PIDGEN_IA 0x00000003 -#define DPORT_PIDGEN_IA_M ((DPORT_PIDGEN_IA_V)<<(DPORT_PIDGEN_IA_S)) -#define DPORT_PIDGEN_IA_V 0x3 -#define DPORT_PIDGEN_IA_S 6 -/* DPORT_ARB_IA : RO ;bitpos:[5:4] ;default: 2'b0 ; */ -/*description: */ -#define DPORT_ARB_IA 0x00000003 -#define DPORT_ARB_IA_M ((DPORT_ARB_IA_V)<<(DPORT_ARB_IA_S)) -#define DPORT_ARB_IA_V 0x3 -#define DPORT_ARB_IA_S 4 -/* DPORT_INTERNAL_SRAM_MMU_MISS : RO ;bitpos:[3:0] ;default: 4'b0 ; */ -/*description: */ -#define DPORT_INTERNAL_SRAM_MMU_MISS 0x0000000F -#define DPORT_INTERNAL_SRAM_MMU_MISS_M ((DPORT_INTERNAL_SRAM_MMU_MISS_V)<<(DPORT_INTERNAL_SRAM_MMU_MISS_S)) -#define DPORT_INTERNAL_SRAM_MMU_MISS_V 0xF -#define DPORT_INTERNAL_SRAM_MMU_MISS_S 0 - -#define DPORT_PRO_DCACHE_DBUG0_REG (DR_REG_DPORT_BASE + 0x3F0) -/* DPORT_PRO_RX_END : RO ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_RX_END (BIT(23)) -#define DPORT_PRO_RX_END_M (BIT(23)) -#define DPORT_PRO_RX_END_V 0x1 -#define DPORT_PRO_RX_END_S 23 -/* DPORT_PRO_SLAVE_WDATA_V : RO ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_SLAVE_WDATA_V (BIT(22)) -#define DPORT_PRO_SLAVE_WDATA_V_M (BIT(22)) -#define DPORT_PRO_SLAVE_WDATA_V_V 0x1 -#define DPORT_PRO_SLAVE_WDATA_V_S 22 -/* DPORT_PRO_SLAVE_WR : RO ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_SLAVE_WR (BIT(21)) -#define DPORT_PRO_SLAVE_WR_M (BIT(21)) -#define DPORT_PRO_SLAVE_WR_V 0x1 -#define DPORT_PRO_SLAVE_WR_S 21 -/* DPORT_PRO_TX_END : RO ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_TX_END (BIT(20)) -#define DPORT_PRO_TX_END_M (BIT(20)) -#define DPORT_PRO_TX_END_V 0x1 -#define DPORT_PRO_TX_END_S 20 -/* DPORT_PRO_WR_BAK_TO_READ : RO ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_WR_BAK_TO_READ (BIT(19)) -#define DPORT_PRO_WR_BAK_TO_READ_M (BIT(19)) -#define DPORT_PRO_WR_BAK_TO_READ_V 0x1 -#define DPORT_PRO_WR_BAK_TO_READ_S 19 -/* DPORT_PRO_CACHE_STATE : RO ;bitpos:[18:7] ;default: 12'b0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_STATE 0x00000FFF -#define DPORT_PRO_CACHE_STATE_M ((DPORT_PRO_CACHE_STATE_V)<<(DPORT_PRO_CACHE_STATE_S)) -#define DPORT_PRO_CACHE_STATE_V 0xFFF -#define DPORT_PRO_CACHE_STATE_S 7 -/* DPORT_PRO_CACHE_IA : RO ;bitpos:[6:1] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_IA 0x0000003F -#define DPORT_PRO_CACHE_IA_M ((DPORT_PRO_CACHE_IA_V)<<(DPORT_PRO_CACHE_IA_S)) -#define DPORT_PRO_CACHE_IA_V 0x3F -#define DPORT_PRO_CACHE_IA_S 1 -/* DPORT_PRO_CACHE_MMU_IA : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_MMU_IA (BIT(0)) -#define DPORT_PRO_CACHE_MMU_IA_M (BIT(0)) -#define DPORT_PRO_CACHE_MMU_IA_V 0x1 -#define DPORT_PRO_CACHE_MMU_IA_S 0 - -#define DPORT_PRO_DCACHE_DBUG1_REG (DR_REG_DPORT_BASE + 0x3F4) -/* DPORT_PRO_CTAG_RAM_RDATA : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define DPORT_PRO_CTAG_RAM_RDATA 0xFFFFFFFF -#define DPORT_PRO_CTAG_RAM_RDATA_M ((DPORT_PRO_CTAG_RAM_RDATA_V)<<(DPORT_PRO_CTAG_RAM_RDATA_S)) -#define DPORT_PRO_CTAG_RAM_RDATA_V 0xFFFFFFFF -#define DPORT_PRO_CTAG_RAM_RDATA_S 0 - -#define DPORT_PRO_DCACHE_DBUG2_REG (DR_REG_DPORT_BASE + 0x3F8) -/* DPORT_PRO_CACHE_VADDR : RO ;bitpos:[26:0] ;default: 27'b0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_VADDR 0x07FFFFFF -#define DPORT_PRO_CACHE_VADDR_M ((DPORT_PRO_CACHE_VADDR_V)<<(DPORT_PRO_CACHE_VADDR_S)) -#define DPORT_PRO_CACHE_VADDR_V 0x7FFFFFF -#define DPORT_PRO_CACHE_VADDR_S 0 - -#define DPORT_PRO_DCACHE_DBUG3_REG (DR_REG_DPORT_BASE + 0x3FC) -/* DPORT_PRO_CACHE_IRAM0_PID_ERROR : RO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_CACHE_IRAM0_PID_ERROR (BIT(15)) -#define DPORT_PRO_CACHE_IRAM0_PID_ERROR_M (BIT(15)) -#define DPORT_PRO_CACHE_IRAM0_PID_ERROR_V 0x1 -#define DPORT_PRO_CACHE_IRAM0_PID_ERROR_S 15 -/* DPORT_PRO_CPU_DISABLED_CACHE_IA : RO ;bitpos:[14:9] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_PRO_CPU_DISABLED_CACHE_IA 0x0000003F -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_M ((DPORT_PRO_CPU_DISABLED_CACHE_IA_V)<<(DPORT_PRO_CPU_DISABLED_CACHE_IA_S)) -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_V 0x3F -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_S 9 -/* This is the contents of DPORT_PRO_CPU_DISABLED_CACHE_IA field expanded */ -/* The following bits will be set upon invalid access for different memory - * regions: */ -/* Port of the APP CPU cache when cache is used in high/low or odd/even mode */ -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_OPPOSITE BIT(9) -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_OPPOSITE_M BIT(9) -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_OPPOSITE_V 1 -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_OPPOSITE_S 9 -/* DRAM1: 0x3F80_0000 ~ 0x3FBF_FFFF(R/W) */ -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_DRAM1 BIT(10) -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_DRAM1_M BIT(10) -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_DRAM1_V 1 -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_DRAM1_S 10 -/* IROM0: 0x4080_0000 ~ 0x40BF_FFFF(RO) */ -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_IROM0 BIT(11) -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_IROM0_M BIT(11) -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_IROM0_V 1 -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_IROM0_S 11 -/* IRAM1: 0x4040_0000 ~ 0x407F_FFFF(RO) */ -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_IRAM1 BIT(12) -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_IRAM1_M BIT(12) -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_IRAM1_V 1 -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_IRAM1_S 12 -/* IRAM0: 0x4080_0000 ~ 0x40BF_FFFF(RO) */ -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_IRAM0 BIT(13) -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_IRAM0_M BIT(13) -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_IRAM0_V 1 -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_IRAM0_S 13 -/* DROM0: 0x3F40_0000 ~ 0x3F7F_FFFF (RO) */ -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_DROM0 BIT(14) -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_DROM0_M BIT(14) -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_DROM0_V 1 -#define DPORT_PRO_CPU_DISABLED_CACHE_IA_DROM0_S 14 - -/* DPORT_PRO_MMU_RDATA : RO ;bitpos:[8:0] ;default: 9'h0 ; */ -/*description: */ -#define DPORT_PRO_MMU_RDATA 0x000001FF -#define DPORT_PRO_MMU_RDATA_M ((DPORT_PRO_MMU_RDATA_V)<<(DPORT_PRO_MMU_RDATA_S)) -#define DPORT_PRO_MMU_RDATA_V 0x1FF -#define DPORT_PRO_MMU_RDATA_S 0 - -#define DPORT_PRO_DCACHE_DBUG4_REG (DR_REG_DPORT_BASE + 0x400) -/* DPORT_PRO_DRAM1ADDR0_IA : RO ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: */ -#define DPORT_PRO_DRAM1ADDR0_IA 0x000FFFFF -#define DPORT_PRO_DRAM1ADDR0_IA_M ((DPORT_PRO_DRAM1ADDR0_IA_V)<<(DPORT_PRO_DRAM1ADDR0_IA_S)) -#define DPORT_PRO_DRAM1ADDR0_IA_V 0xFFFFF -#define DPORT_PRO_DRAM1ADDR0_IA_S 0 - -#define DPORT_PRO_DCACHE_DBUG5_REG (DR_REG_DPORT_BASE + 0x404) -/* DPORT_PRO_DROM0ADDR0_IA : RO ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: */ -#define DPORT_PRO_DROM0ADDR0_IA 0x000FFFFF -#define DPORT_PRO_DROM0ADDR0_IA_M ((DPORT_PRO_DROM0ADDR0_IA_V)<<(DPORT_PRO_DROM0ADDR0_IA_S)) -#define DPORT_PRO_DROM0ADDR0_IA_V 0xFFFFF -#define DPORT_PRO_DROM0ADDR0_IA_S 0 - -#define DPORT_PRO_DCACHE_DBUG6_REG (DR_REG_DPORT_BASE + 0x408) -/* DPORT_PRO_IRAM0ADDR_IA : RO ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: */ -#define DPORT_PRO_IRAM0ADDR_IA 0x000FFFFF -#define DPORT_PRO_IRAM0ADDR_IA_M ((DPORT_PRO_IRAM0ADDR_IA_V)<<(DPORT_PRO_IRAM0ADDR_IA_S)) -#define DPORT_PRO_IRAM0ADDR_IA_V 0xFFFFF -#define DPORT_PRO_IRAM0ADDR_IA_S 0 - -#define DPORT_PRO_DCACHE_DBUG7_REG (DR_REG_DPORT_BASE + 0x40C) -/* DPORT_PRO_IRAM1ADDR_IA : RO ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: */ -#define DPORT_PRO_IRAM1ADDR_IA 0x000FFFFF -#define DPORT_PRO_IRAM1ADDR_IA_M ((DPORT_PRO_IRAM1ADDR_IA_V)<<(DPORT_PRO_IRAM1ADDR_IA_S)) -#define DPORT_PRO_IRAM1ADDR_IA_V 0xFFFFF -#define DPORT_PRO_IRAM1ADDR_IA_S 0 - -#define DPORT_PRO_DCACHE_DBUG8_REG (DR_REG_DPORT_BASE + 0x410) -/* DPORT_PRO_IROM0ADDR_IA : RO ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: */ -#define DPORT_PRO_IROM0ADDR_IA 0x000FFFFF -#define DPORT_PRO_IROM0ADDR_IA_M ((DPORT_PRO_IROM0ADDR_IA_V)<<(DPORT_PRO_IROM0ADDR_IA_S)) -#define DPORT_PRO_IROM0ADDR_IA_V 0xFFFFF -#define DPORT_PRO_IROM0ADDR_IA_S 0 - -#define DPORT_PRO_DCACHE_DBUG9_REG (DR_REG_DPORT_BASE + 0x414) -/* DPORT_PRO_OPSDRAMADDR_IA : RO ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: */ -#define DPORT_PRO_OPSDRAMADDR_IA 0x000FFFFF -#define DPORT_PRO_OPSDRAMADDR_IA_M ((DPORT_PRO_OPSDRAMADDR_IA_V)<<(DPORT_PRO_OPSDRAMADDR_IA_S)) -#define DPORT_PRO_OPSDRAMADDR_IA_V 0xFFFFF -#define DPORT_PRO_OPSDRAMADDR_IA_S 0 - -#define DPORT_APP_DCACHE_DBUG0_REG (DR_REG_DPORT_BASE + 0x418) -/* DPORT_APP_RX_END : RO ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_RX_END (BIT(23)) -#define DPORT_APP_RX_END_M (BIT(23)) -#define DPORT_APP_RX_END_V 0x1 -#define DPORT_APP_RX_END_S 23 -/* DPORT_APP_SLAVE_WDATA_V : RO ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_SLAVE_WDATA_V (BIT(22)) -#define DPORT_APP_SLAVE_WDATA_V_M (BIT(22)) -#define DPORT_APP_SLAVE_WDATA_V_V 0x1 -#define DPORT_APP_SLAVE_WDATA_V_S 22 -/* DPORT_APP_SLAVE_WR : RO ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_SLAVE_WR (BIT(21)) -#define DPORT_APP_SLAVE_WR_M (BIT(21)) -#define DPORT_APP_SLAVE_WR_V 0x1 -#define DPORT_APP_SLAVE_WR_S 21 -/* DPORT_APP_TX_END : RO ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_TX_END (BIT(20)) -#define DPORT_APP_TX_END_M (BIT(20)) -#define DPORT_APP_TX_END_V 0x1 -#define DPORT_APP_TX_END_S 20 -/* DPORT_APP_WR_BAK_TO_READ : RO ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_WR_BAK_TO_READ (BIT(19)) -#define DPORT_APP_WR_BAK_TO_READ_M (BIT(19)) -#define DPORT_APP_WR_BAK_TO_READ_V 0x1 -#define DPORT_APP_WR_BAK_TO_READ_S 19 -/* DPORT_APP_CACHE_STATE : RO ;bitpos:[18:7] ;default: 12'b0 ; */ -/*description: */ -#define DPORT_APP_CACHE_STATE 0x00000FFF -#define DPORT_APP_CACHE_STATE_M ((DPORT_APP_CACHE_STATE_V)<<(DPORT_APP_CACHE_STATE_S)) -#define DPORT_APP_CACHE_STATE_V 0xFFF -#define DPORT_APP_CACHE_STATE_S 7 -/* DPORT_APP_CACHE_IA : RO ;bitpos:[6:1] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_APP_CACHE_IA 0x0000003F -#define DPORT_APP_CACHE_IA_M ((DPORT_APP_CACHE_IA_V)<<(DPORT_APP_CACHE_IA_S)) -#define DPORT_APP_CACHE_IA_V 0x3F -#define DPORT_APP_CACHE_IA_S 1 -/* DPORT_APP_CACHE_MMU_IA : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_CACHE_MMU_IA (BIT(0)) -#define DPORT_APP_CACHE_MMU_IA_M (BIT(0)) -#define DPORT_APP_CACHE_MMU_IA_V 0x1 -#define DPORT_APP_CACHE_MMU_IA_S 0 - -#define DPORT_APP_DCACHE_DBUG1_REG (DR_REG_DPORT_BASE + 0x41C) -/* DPORT_APP_CTAG_RAM_RDATA : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define DPORT_APP_CTAG_RAM_RDATA 0xFFFFFFFF -#define DPORT_APP_CTAG_RAM_RDATA_M ((DPORT_APP_CTAG_RAM_RDATA_V)<<(DPORT_APP_CTAG_RAM_RDATA_S)) -#define DPORT_APP_CTAG_RAM_RDATA_V 0xFFFFFFFF -#define DPORT_APP_CTAG_RAM_RDATA_S 0 - -#define DPORT_APP_DCACHE_DBUG2_REG (DR_REG_DPORT_BASE + 0x420) -/* DPORT_APP_CACHE_VADDR : RO ;bitpos:[26:0] ;default: 27'b0 ; */ -/*description: */ -#define DPORT_APP_CACHE_VADDR 0x07FFFFFF -#define DPORT_APP_CACHE_VADDR_M ((DPORT_APP_CACHE_VADDR_V)<<(DPORT_APP_CACHE_VADDR_S)) -#define DPORT_APP_CACHE_VADDR_V 0x7FFFFFF -#define DPORT_APP_CACHE_VADDR_S 0 - -#define DPORT_APP_DCACHE_DBUG3_REG (DR_REG_DPORT_BASE + 0x424) -/* DPORT_APP_CACHE_IRAM0_PID_ERROR : RO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_CACHE_IRAM0_PID_ERROR (BIT(15)) -#define DPORT_APP_CACHE_IRAM0_PID_ERROR_M (BIT(15)) -#define DPORT_APP_CACHE_IRAM0_PID_ERROR_V 0x1 -#define DPORT_APP_CACHE_IRAM0_PID_ERROR_S 15 -/* DPORT_APP_CPU_DISABLED_CACHE_IA : RO ;bitpos:[14:9] ;default: 6'b0 ; */ -/*description: */ -#define DPORT_APP_CPU_DISABLED_CACHE_IA 0x0000003F -#define DPORT_APP_CPU_DISABLED_CACHE_IA_M ((DPORT_APP_CPU_DISABLED_CACHE_IA_V)<<(DPORT_APP_CPU_DISABLED_CACHE_IA_S)) -#define DPORT_APP_CPU_DISABLED_CACHE_IA_V 0x3F -#define DPORT_APP_CPU_DISABLED_CACHE_IA_S 9 -/* This is the contents of DPORT_APP_CPU_DISABLED_CACHE_IA field expanded */ -/* The following bits will be set upon invalid access for different memory - * regions: */ -/* Port of the PRO CPU cache when cache is used in high/low or odd/even mode */ -#define DPORT_APP_CPU_DISABLED_CACHE_IA_OPPOSITE BIT(9) -#define DPORT_APP_CPU_DISABLED_CACHE_IA_OPPOSITE_M BIT(9) -#define DPORT_APP_CPU_DISABLED_CACHE_IA_OPPOSITE_V 1 -#define DPORT_APP_CPU_DISABLED_CACHE_IA_OPPOSITE_S 9 -/* DRAM1: 0x3F80_0000 ~ 0x3FBF_FFFF(R/W) */ -#define DPORT_APP_CPU_DISABLED_CACHE_IA_DRAM1 BIT(10) -#define DPORT_APP_CPU_DISABLED_CACHE_IA_DRAM1_M BIT(10) -#define DPORT_APP_CPU_DISABLED_CACHE_IA_DRAM1_V 1 -#define DPORT_APP_CPU_DISABLED_CACHE_IA_DRAM1_S 10 -/* IROM0: 0x4080_0000 ~ 0x40BF_FFFF(RO) */ -#define DPORT_APP_CPU_DISABLED_CACHE_IA_IROM0 BIT(11) -#define DPORT_APP_CPU_DISABLED_CACHE_IA_IROM0_M BIT(11) -#define DPORT_APP_CPU_DISABLED_CACHE_IA_IROM0_V 1 -#define DPORT_APP_CPU_DISABLED_CACHE_IA_IROM0_S 11 -/* IRAM1: 0x4040_0000 ~ 0x407F_FFFF(RO) */ -#define DPORT_APP_CPU_DISABLED_CACHE_IA_IRAM1 BIT(12) -#define DPORT_APP_CPU_DISABLED_CACHE_IA_IRAM1_M BIT(12) -#define DPORT_APP_CPU_DISABLED_CACHE_IA_IRAM1_V 1 -#define DPORT_APP_CPU_DISABLED_CACHE_IA_IRAM1_S 12 -/* IRAM0: 0x4080_0000 ~ 0x40BF_FFFF(RO) */ -#define DPORT_APP_CPU_DISABLED_CACHE_IA_IRAM0 BIT(13) -#define DPORT_APP_CPU_DISABLED_CACHE_IA_IRAM0_M BIT(13) -#define DPORT_APP_CPU_DISABLED_CACHE_IA_IRAM0_V 1 -#define DPORT_APP_CPU_DISABLED_CACHE_IA_IRAM0_S 13 -/* DROM0: 0x3F40_0000 ~ 0x3F7F_FFFF (RO) */ -#define DPORT_APP_CPU_DISABLED_CACHE_IA_DROM0 BIT(14) -#define DPORT_APP_CPU_DISABLED_CACHE_IA_DROM0_M BIT(14) -#define DPORT_APP_CPU_DISABLED_CACHE_IA_DROM0_V 1 -#define DPORT_APP_CPU_DISABLED_CACHE_IA_DROM0_S 14 - -/* DPORT_APP_MMU_RDATA : RO ;bitpos:[8:0] ;default: 9'h0 ; */ -/*description: */ -#define DPORT_APP_MMU_RDATA 0x000001FF -#define DPORT_APP_MMU_RDATA_M ((DPORT_APP_MMU_RDATA_V)<<(DPORT_APP_MMU_RDATA_S)) -#define DPORT_APP_MMU_RDATA_V 0x1FF -#define DPORT_APP_MMU_RDATA_S 0 - -#define DPORT_APP_DCACHE_DBUG4_REG (DR_REG_DPORT_BASE + 0x428) -/* DPORT_APP_DRAM1ADDR0_IA : RO ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: */ -#define DPORT_APP_DRAM1ADDR0_IA 0x000FFFFF -#define DPORT_APP_DRAM1ADDR0_IA_M ((DPORT_APP_DRAM1ADDR0_IA_V)<<(DPORT_APP_DRAM1ADDR0_IA_S)) -#define DPORT_APP_DRAM1ADDR0_IA_V 0xFFFFF -#define DPORT_APP_DRAM1ADDR0_IA_S 0 - -#define DPORT_APP_DCACHE_DBUG5_REG (DR_REG_DPORT_BASE + 0x42C) -/* DPORT_APP_DROM0ADDR0_IA : RO ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: */ -#define DPORT_APP_DROM0ADDR0_IA 0x000FFFFF -#define DPORT_APP_DROM0ADDR0_IA_M ((DPORT_APP_DROM0ADDR0_IA_V)<<(DPORT_APP_DROM0ADDR0_IA_S)) -#define DPORT_APP_DROM0ADDR0_IA_V 0xFFFFF -#define DPORT_APP_DROM0ADDR0_IA_S 0 - -#define DPORT_APP_DCACHE_DBUG6_REG (DR_REG_DPORT_BASE + 0x430) -/* DPORT_APP_IRAM0ADDR_IA : RO ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: */ -#define DPORT_APP_IRAM0ADDR_IA 0x000FFFFF -#define DPORT_APP_IRAM0ADDR_IA_M ((DPORT_APP_IRAM0ADDR_IA_V)<<(DPORT_APP_IRAM0ADDR_IA_S)) -#define DPORT_APP_IRAM0ADDR_IA_V 0xFFFFF -#define DPORT_APP_IRAM0ADDR_IA_S 0 - -#define DPORT_APP_DCACHE_DBUG7_REG (DR_REG_DPORT_BASE + 0x434) -/* DPORT_APP_IRAM1ADDR_IA : RO ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: */ -#define DPORT_APP_IRAM1ADDR_IA 0x000FFFFF -#define DPORT_APP_IRAM1ADDR_IA_M ((DPORT_APP_IRAM1ADDR_IA_V)<<(DPORT_APP_IRAM1ADDR_IA_S)) -#define DPORT_APP_IRAM1ADDR_IA_V 0xFFFFF -#define DPORT_APP_IRAM1ADDR_IA_S 0 - -#define DPORT_APP_DCACHE_DBUG8_REG (DR_REG_DPORT_BASE + 0x438) -/* DPORT_APP_IROM0ADDR_IA : RO ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: */ -#define DPORT_APP_IROM0ADDR_IA 0x000FFFFF -#define DPORT_APP_IROM0ADDR_IA_M ((DPORT_APP_IROM0ADDR_IA_V)<<(DPORT_APP_IROM0ADDR_IA_S)) -#define DPORT_APP_IROM0ADDR_IA_V 0xFFFFF -#define DPORT_APP_IROM0ADDR_IA_S 0 - -#define DPORT_APP_DCACHE_DBUG9_REG (DR_REG_DPORT_BASE + 0x43C) -/* DPORT_APP_OPSDRAMADDR_IA : RO ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: */ -#define DPORT_APP_OPSDRAMADDR_IA 0x000FFFFF -#define DPORT_APP_OPSDRAMADDR_IA_M ((DPORT_APP_OPSDRAMADDR_IA_V)<<(DPORT_APP_OPSDRAMADDR_IA_S)) -#define DPORT_APP_OPSDRAMADDR_IA_V 0xFFFFF -#define DPORT_APP_OPSDRAMADDR_IA_S 0 - -#define DPORT_PRO_CPU_RECORD_CTRL_REG (DR_REG_DPORT_BASE + 0x440) -/* DPORT_PRO_CPU_PDEBUG_ENABLE : R/W ;bitpos:[8] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_PRO_CPU_PDEBUG_ENABLE (BIT(8)) -#define DPORT_PRO_CPU_PDEBUG_ENABLE_M (BIT(8)) -#define DPORT_PRO_CPU_PDEBUG_ENABLE_V 0x1 -#define DPORT_PRO_CPU_PDEBUG_ENABLE_S 8 -/* DPORT_PRO_CPU_RECORD_DISABLE : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_CPU_RECORD_DISABLE (BIT(4)) -#define DPORT_PRO_CPU_RECORD_DISABLE_M (BIT(4)) -#define DPORT_PRO_CPU_RECORD_DISABLE_V 0x1 -#define DPORT_PRO_CPU_RECORD_DISABLE_S 4 -/* DPORT_PRO_CPU_RECORD_ENABLE : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_CPU_RECORD_ENABLE (BIT(0)) -#define DPORT_PRO_CPU_RECORD_ENABLE_M (BIT(0)) -#define DPORT_PRO_CPU_RECORD_ENABLE_V 0x1 -#define DPORT_PRO_CPU_RECORD_ENABLE_S 0 - -#define DPORT_PRO_CPU_RECORD_STATUS_REG (DR_REG_DPORT_BASE + 0x444) -/* DPORT_PRO_CPU_RECORDING : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PRO_CPU_RECORDING (BIT(0)) -#define DPORT_PRO_CPU_RECORDING_M (BIT(0)) -#define DPORT_PRO_CPU_RECORDING_V 0x1 -#define DPORT_PRO_CPU_RECORDING_S 0 - -#define DPORT_PRO_CPU_RECORD_PID_REG (DR_REG_DPORT_BASE + 0x448) -/* DPORT_RECORD_PRO_PID : RO ;bitpos:[2:0] ;default: 3'd0 ; */ -/*description: */ -#define DPORT_RECORD_PRO_PID 0x00000007 -#define DPORT_RECORD_PRO_PID_M ((DPORT_RECORD_PRO_PID_V)<<(DPORT_RECORD_PRO_PID_S)) -#define DPORT_RECORD_PRO_PID_V 0x7 -#define DPORT_RECORD_PRO_PID_S 0 - -#define DPORT_PRO_CPU_RECORD_PDEBUGINST_REG (DR_REG_DPORT_BASE + 0x44C) -/* DPORT_RECORD_PRO_PDEBUGINST : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define DPORT_RECORD_PRO_PDEBUGINST 0xFFFFFFFF -#define DPORT_RECORD_PRO_PDEBUGINST_M ((DPORT_RECORD_PRO_PDEBUGINST_V)<<(DPORT_RECORD_PRO_PDEBUGINST_S)) -#define DPORT_RECORD_PRO_PDEBUGINST_V 0xFFFFFFFF -#define DPORT_RECORD_PRO_PDEBUGINST_S 0 -/* register layout: - * SIZE [7..0] : Instructions normally complete in the W stage. The size of the instruction in the W is given - * by this field in number of bytes. If it is 8’b0 in a given cycle the W stage has no completing - * instruction. This is also known as a bubble cycle. Also see DPORT_PRO_CPU_RECORD_PDEBUGSTATUS_REG. - * ISRC [14..12] : Instruction source. -** LOOP [23..20] : Loopback status. -** CINTLEVEL [27..24]: CINTLEVEL. -*/ -#define DPORT_RECORD_PDEBUGINST_SZ_M ((DPORT_RECORD_PDEBUGINST_SZ_V)<<(DPORT_RECORD_PDEBUGINST_SZ_S)) -#define DPORT_RECORD_PDEBUGINST_SZ_V 0xFF -#define DPORT_RECORD_PDEBUGINST_SZ_S 0 -#define DPORT_RECORD_PDEBUGINST_SZ(_r_) (((_r_)>>DPORT_RECORD_PDEBUGINST_SZ_S) & DPORT_RECORD_PDEBUGINST_SZ_V) -#define DPORT_RECORD_PDEBUGINST_ISRC_M ((DPORT_RECORD_PDEBUGINST_ISRC_V)<<(DPORT_RECORD_PDEBUGINST_ISRC_S)) -#define DPORT_RECORD_PDEBUGINST_ISRC_V 0x07 -#define DPORT_RECORD_PDEBUGINST_ISRC_S 12 -#define DPORT_RECORD_PDEBUGINST_ISRC(_r_) (((_r_)>>DPORT_RECORD_PDEBUGINST_ISRC_S) & DPORT_RECORD_PDEBUGINST_ISRC_V) -// #define DPORT_RECORD_PDEBUGINST_LOOP_M ((DPORT_RECORD_PDEBUGINST_LOOP_V)<<(DPORT_RECORD_PDEBUGINST_LOOP_S)) -// #define DPORT_RECORD_PDEBUGINST_LOOP_V 0x0F -// #define DPORT_RECORD_PDEBUGINST_LOOP_S 20 -// #define DPORT_RECORD_PDEBUGINST_LOOP(_r_) (((_r_)>>DPORT_RECORD_PDEBUGINST_LOOP_S) & DPORT_RECORD_PDEBUGINST_LOOP_V) -#define DPORT_RECORD_PDEBUGINST_LOOP_REP (BIT(20)) /* loopback will occur */ -#define DPORT_RECORD_PDEBUGINST_LOOP (BIT(21)) /* last inst of loop */ -#define DPORT_RECORD_PDEBUGINST_CINTL_M ((DPORT_RECORD_PDEBUGINST_CINTL_V)<<(DPORT_RECORD_PDEBUGINST_CINTL_S)) -#define DPORT_RECORD_PDEBUGINST_CINTL_V 0x0F -#define DPORT_RECORD_PDEBUGINST_CINTL_S 24 -#define DPORT_RECORD_PDEBUGINST_CINTL(_r_) (((_r_)>>DPORT_RECORD_PDEBUGINST_CINTL_S) & DPORT_RECORD_PDEBUGINST_CINTL_V) - -#define DPORT_PRO_CPU_RECORD_PDEBUGSTATUS_REG (DR_REG_DPORT_BASE + 0x450) -/* DPORT_RECORD_PRO_PDEBUGSTATUS : RO ;bitpos:[7:0] ;default: 8'b0 ; */ -/*description: */ -#define DPORT_RECORD_PRO_PDEBUGSTATUS 0x000000FF -#define DPORT_RECORD_PRO_PDEBUGSTATUS_M ((DPORT_RECORD_PRO_PDEBUGSTATUS_V)<<(DPORT_RECORD_PRO_PDEBUGSTATUS_S)) -#define DPORT_RECORD_PRO_PDEBUGSTATUS_V 0xFF -#define DPORT_RECORD_PRO_PDEBUGSTATUS_S 0 -/* register layout: - * BBCAUSE [5..0]: Indicates cause for bubble cycle. See below for posible values. When DPORT_RECORD_PDEBUGINST_SZ == 0 - * INSNTYPE[5..0]: Indicates type of instruction retiring in the W stage. See below for posible values. When DPORT_RECORD_PDEBUGINST_SZ > 0 -*/ -#define DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_M ((DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_V)<<(DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_S)) -#define DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_V 0x3F -#define DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_S 0 -#define DPORT_RECORD_PDEBUGSTATUS_BBCAUSE(_r_) (((_r_)>>DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_S) & DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_V) -#define DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_PSO 0x00 /* Power shut off */ -#define DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_DEP 0x02 /* Register dependency or resource conflict. See DPORT_XXX_CPU_RECORD_PDEBUGDATA_REG for extra info. */ -#define DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_CTL 0x04 /* Control transfer bubble */ -#define DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_ICM 0x08 /* I-cache miss (incl uncached miss) */ -#define DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_DCM 0x0C /* D-cache miss (excl uncached miss) */ -#define DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_EXC0 0x10 /* Exception or interrupt (W stage). See DPORT_XXX_CPU_RECORD_PDEBUGDATA_REG for extra info. - The virtual address of the instruction that was killed appears on DPORT_PRO_CPU_RECORD_PDEBUGPC_REG[31:0] */ -#define DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_EXC1 0x11 /* Exception or interrupt (W+1 stage). See DPORT_XXX_CPU_RECORD_PDEBUGDATA_REG for extra info. */ -#define DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_RPL 0x14 /* Instruction replay (other). DPORT_XXX_CPU_RECORD_PDEBUGDATA_REG has the PC of the replaying instruction. */ -#define DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_ITLB 0x18 /* HW ITLB refill. The refill address and data are available on - DPORT_PRO_CPU_RECORD_PDEBUGLS0ADDR_REG and DPORT_PRO_CPU_RECORD_PDEBUGLS0DATA_REG. */ -#define DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_ITLBM 0x1A /* ITLB miss */ -#define DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_DTLB 0x1C /* HW DTLB refill. The refill address and data are available on - DPORT_PRO_CPU_RECORD_PDEBUGLS0ADDR_REG and DPORT_PRO_CPU_RECORD_PDEBUGLS0DATA_REG. */ -#define DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_DTLBM 0x1E /* DTLB miss */ -#define DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_STALL 0x20 /* Stall . The cause of the global stall is further classified in the DPORT_XXX_CPU_RECORD_PDEBUGDATA_REG. */ -#define DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_HWMEC 0x24 /* HW-corrected memory error */ -#define DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_WAITI 0x28 /* WAITI mode */ -#define DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_OTHER 0x3C /* all other bubbles */ -#define DPORT_RECORD_PDEBUGSTATUS_INSNTYPE_M ((DPORT_RECORD_PDEBUGSTATUS_INSNTYPE_V)<<(DPORT_RECORD_PDEBUGSTATUS_INSNTYPE_S)) -#define DPORT_RECORD_PDEBUGSTATUS_INSNTYPE_V 0x3F -#define DPORT_RECORD_PDEBUGSTATUS_INSNTYPE_S 0 -#define DPORT_RECORD_PDEBUGSTATUS_INSNTYPE(_r_) (((_r_)>>DPORT_RECORD_PDEBUGSTATUS_INSNTYPE_S) & DPORT_RECORD_PDEBUGSTATUS_INSNTYPE_V) -#define DPORT_RECORD_PDEBUGSTATUS_INSNTYPE_JX 0x00 /* JX */ -#define DPORT_RECORD_PDEBUGSTATUS_INSNTYPE_CALLX 0x04 /* CALLX */ -#define DPORT_RECORD_PDEBUGSTATUS_INSNTYPE_CRET 0x08 /* All call returns */ -#define DPORT_RECORD_PDEBUGSTATUS_INSNTYPE_ERET 0x0C /* All exception returns */ -#define DPORT_RECORD_PDEBUGSTATUS_INSNTYPE_B 0x10 /* Branch taken or loop not taken */ -#define DPORT_RECORD_PDEBUGSTATUS_INSNTYPE_J 0x14 /* J */ -#define DPORT_RECORD_PDEBUGSTATUS_INSNTYPE_CALL 0x18 /* CALL */ -#define DPORT_RECORD_PDEBUGSTATUS_INSNTYPE_BN 0x1C /* Branch not taken */ -#define DPORT_RECORD_PDEBUGSTATUS_INSNTYPE_LOOP 0x20 /* Loop instruction (taken) */ -#define DPORT_RECORD_PDEBUGSTATUS_INSNTYPE_S32C1I 0x24 /* S32C1I. The address and load data (before the conditional store) are available on the LS signals*/ -#define DPORT_RECORD_PDEBUGSTATUS_INSNTYPE_WXSR2LB 0x28 /* WSR/XSR to LBEGIN */ -#define DPORT_RECORD_PDEBUGSTATUS_INSNTYPE_WSR2MMID 0x2C /* WSR to MMID */ -#define DPORT_RECORD_PDEBUGSTATUS_INSNTYPE_RWXSR 0x30 /* RSR or WSR (except MMID and LBEGIN) or XSR (except LBEGIN) */ -#define DPORT_RECORD_PDEBUGSTATUS_INSNTYPE_RWER 0x34 /* RER or WER */ -#define DPORT_RECORD_PDEBUGSTATUS_INSNTYPE_DEF 0x3C /* Default */ - -#define DPORT_PRO_CPU_RECORD_PDEBUGDATA_REG (DR_REG_DPORT_BASE + 0x454) -/* DPORT_RECORD_PRO_PDEBUGDATA : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define DPORT_RECORD_PRO_PDEBUGDATA 0xFFFFFFFF -#define DPORT_RECORD_PRO_PDEBUGDATA_M ((DPORT_RECORD_PRO_PDEBUGDATA_V)<<(DPORT_RECORD_PRO_PDEBUGDATA_S)) -#define DPORT_RECORD_PRO_PDEBUGDATA_V 0xFFFFFFFF -#define DPORT_RECORD_PRO_PDEBUGDATA_S 0 -/* register layout when bubble cycke cause is DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_DEP: - * - * HALT [17]: HALT instruction (TX only) - * MEMW [16]: MEMW, EXTW or EXCW instruction dependency - * REG [12]: register dependencies or resource (e.g.TIE ports) conflicts - * STR [11]: store release (instruction) dependency - * LSU [8] : various LSU dependencies (MHT access, prefetch, cache access insts, s32c1i, etc) - * OTHER[0] : all other hold dependencies resulting from data or resource dependencies -*/ -#define DPORT_RECORD_PDEBUGDATA_DEP_HALT (BIT(17)) -#define DPORT_RECORD_PDEBUGDATA_DEP_MEMW (BIT(16)) -#define DPORT_RECORD_PDEBUGDATA_DEP_REG (BIT(12)) -#define DPORT_RECORD_PDEBUGDATA_DEP_STR (BIT(11)) -#define DPORT_RECORD_PDEBUGDATA_DEP_LSU (BIT(8)) -#define DPORT_RECORD_PDEBUGDATA_DEP_OTHER (BIT(0)) -/* register layout when bubble cycke cause is DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_EXCn: - * - * EXCCAUSE[21..16]: Processor exception cause - * EXCVEC [4..0] : Encoded Exception Vector -*/ -#define DPORT_RECORD_PDEBUGDATA_EXCCAUSE_M ((DPORT_RECORD_PDEBUGDATA_EXCCAUSE_V)<<(DPORT_RECORD_PDEBUGDATA_EXCCAUSE_S)) -#define DPORT_RECORD_PDEBUGDATA_EXCCAUSE_V 0x3F -#define DPORT_RECORD_PDEBUGDATA_EXCCAUSE_S 16 -#define DPORT_RECORD_PDEBUGDATA_EXCCAUSE(_r_) (((_r_)>>DPORT_RECORD_PDEBUGDATA_EXCCAUSE_S) & DPORT_RECORD_PDEBUGDATA_EXCCAUSE_V) -#define DPORT_RECORD_PDEBUGDATA_EXCVEC_M ((DPORT_RECORD_PDEBUGDATA_EXCCAUSE_V)<<(DPORT_RECORD_PDEBUGDATA_EXCCAUSE_S)) -#define DPORT_RECORD_PDEBUGDATA_EXCVEC_V 0x1F -#define DPORT_RECORD_PDEBUGDATA_EXCVEC_S 0 -#define DPORT_RECORD_PDEBUGDATA_EXCVEC(_r_) (((_r_)>>DPORT_RECORD_PDEBUGDATA_EXCCAUSE_S) & DPORT_RECORD_PDEBUGDATA_EXCCAUSE_V) -#define DPORT_RECORD_PDEBUGDATA_EXCVEC_NONE 0x00 /* no vector */ -#define DPORT_RECORD_PDEBUGDATA_EXCVEC_RST 0x01 /* Reset */ -#define DPORT_RECORD_PDEBUGDATA_EXCVEC_DBG 0x02 /* Debug (repl corresp level “n”) */ -#define DPORT_RECORD_PDEBUGDATA_EXCVEC_NMI 0x03 /* NMI (repl corresp level “n”) */ -#define DPORT_RECORD_PDEBUGDATA_EXCVEC_USR 0x04 /* User */ -#define DPORT_RECORD_PDEBUGDATA_EXCVEC_KRNL 0x05 /* Kernel */ -#define DPORT_RECORD_PDEBUGDATA_EXCVEC_DBL 0x06 /* Double */ -#define DPORT_RECORD_PDEBUGDATA_EXCVEC_EMEM 0x07 /* Memory Error */ -#define DPORT_RECORD_PDEBUGDATA_EXCVEC_OVF4 0x0A /* Window Overflow 4 */ -#define DPORT_RECORD_PDEBUGDATA_EXCVEC_UNF4 0x0B /* Window Underflow 4 */ -#define DPORT_RECORD_PDEBUGDATA_EXCVEC_OVF8 0x0C /* Window Overflow 8 */ -#define DPORT_RECORD_PDEBUGDATA_EXCVEC_UNF8 0x0D /* Window Underflow 8 */ -#define DPORT_RECORD_PDEBUGDATA_EXCVEC_OVF12 0x0E /* Window Overflow 12 */ -#define DPORT_RECORD_PDEBUGDATA_EXCVEC_UNF12 0x0F /* Window Underflow 12 */ -#define DPORT_RECORD_PDEBUGDATA_EXCVEC_INT2 0x10 /* Int Level 2 (n/a if debug/NMI) */ -#define DPORT_RECORD_PDEBUGDATA_EXCVEC_INT3 0x11 /* Int Level 3 (n/a if debug/NMI) */ -#define DPORT_RECORD_PDEBUGDATA_EXCVEC_INT4 0x12 /* Int Level 4 (n/a if debug/NMI) */ -#define DPORT_RECORD_PDEBUGDATA_EXCVEC_INT5 0x13 /* Int Level 5 (n/a if debug/NMI) */ -#define DPORT_RECORD_PDEBUGDATA_EXCVEC_INT6 0x14 /* Int Level 6 (n/a if debug/NMI) */ -/* register layout when bubble cycke cause is DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_STALL: - * - * ITERDIV[19] : Iterative divide stall. - * ITERMUL[18] : Iterative multiply stall. - * BANKCONFL[16]: Bank-conflict stall. - * BPLOAD[15] : Bypass load stall. - * LSPROC[14] : Load/store miss-processing stall. - * L32R[13] : FastL32R stall. - * BPIFETCH[12] : Bypass I fetch stall. - * RUNSTALL[10] : RunStall. - * TIE[9] : TIE port stall. - * IPIF[8] : Instruction RAM inbound-PIF stall. - * IRAMBUSY[7] : Instruction RAM/ROM busy stall. - * ICM[6] : I-cache-miss stall. - * LSU[4] : The LSU will stall the pipeline under various local memory access conflict situations. - * DCM[3] : D-cache-miss stall. - * BUFFCONFL[2] : Store buffer conflict stall. - * BUFF[1] : Store buffer full stall. -*/ -#define DPORT_RECORD_PDEBUGDATA_STALL_ITERDIV (BIT(19)) -#define DPORT_RECORD_PDEBUGDATA_STALL_ITERMUL (BIT(18)) -#define DPORT_RECORD_PDEBUGDATA_STALL_BANKCONFL (BIT(16)) -#define DPORT_RECORD_PDEBUGDATA_STALL_BPLOAD (BIT(15)) -#define DPORT_RECORD_PDEBUGDATA_STALL_LSPROC (BIT(14)) -#define DPORT_RECORD_PDEBUGDATA_STALL_L32R (BIT(13)) -#define DPORT_RECORD_PDEBUGDATA_STALL_BPIFETCH (BIT(12)) -#define DPORT_RECORD_PDEBUGDATA_STALL_RUN (BIT(10)) -#define DPORT_RECORD_PDEBUGDATA_STALL_TIE (BIT(9)) -#define DPORT_RECORD_PDEBUGDATA_STALL_IPIF (BIT(8)) -#define DPORT_RECORD_PDEBUGDATA_STALL_IRAMBUSY (BIT(7)) -#define DPORT_RECORD_PDEBUGDATA_STALL_ICM (BIT(6)) -#define DPORT_RECORD_PDEBUGDATA_STALL_LSU (BIT(4)) -#define DPORT_RECORD_PDEBUGDATA_STALL_DCM (BIT(3)) -#define DPORT_RECORD_PDEBUGDATA_STALL_BUFFCONFL (BIT(2)) -#define DPORT_RECORD_PDEBUGDATA_STALL_BUFF (BIT(1)) -/* register layout for DPORT_RECORD_PDEBUGSTATUS_INSNTYPE_RWXSR: - * - * XSR[10] : XSR Instruction - * WSR[9] : WSR Instruction - * RSR[8] : RSR Instruction - * SR[7..0] : Special Register Number -*/ -#define DPORT_RECORD_PDEBUGDATA_INSNTYPE_XSR (BIT(10)) -#define DPORT_RECORD_PDEBUGDATA_INSNTYPE_WSR (BIT(9)) -#define DPORT_RECORD_PDEBUGDATA_INSNTYPE_RSR (BIT(8)) -#define DPORT_RECORD_PDEBUGDATA_INSNTYPE_SR_M ((DPORT_RECORD_PDEBUGDATA_INSNTYPE_SR_V)<<(DPORT_RECORD_PDEBUGDATA_INSNTYPE_SR_S)) -#define DPORT_RECORD_PDEBUGDATA_INSNTYPE_SR_V 0xFF -#define DPORT_RECORD_PDEBUGDATA_INSNTYPE_SR_S 0 -#define DPORT_RECORD_PDEBUGDATA_INSNTYPE_SR(_r_) (((_r_)>>DPORT_RECORD_PDEBUGDATA_INSNTYPE_SR_S) & DPORT_RECORD_PDEBUGDATA_INSNTYPE_SR_V) -/* register layout for DPORT_RECORD_PDEBUGSTATUS_INSNTYPE_RWER: - * - * ER[13..2]: ER Address - * WER[1] : WER Instruction - * RER[0] : RER Instruction -*/ -#define DPORT_RECORD_PDEBUGDATA_INSNTYPE_ER_M ((DPORT_RECORD_PDEBUGDATA_INSNTYPE_ER_V)<<(DPORT_RECORD_PDEBUGDATA_INSNTYPE_ER_S)) -#define DPORT_RECORD_PDEBUGDATA_INSNTYPE_ER_V 0xFFF -#define DPORT_RECORD_PDEBUGDATA_INSNTYPE_ER_S 2 -#define DPORT_RECORD_PDEBUGDATA_INSNTYPE_ER(_r_) (((_r_)>>DPORT_RECORD_PDEBUGDATA_INSNTYPE_ER_S) & DPORT_RECORD_PDEBUGDATA_INSNTYPE_ER_V) -#define DPORT_RECORD_PDEBUGDATA_INSNTYPE_WER (BIT(1)) -#define DPORT_RECORD_PDEBUGDATA_INSNTYPE_RER (BIT(0)) - - -#define DPORT_PRO_CPU_RECORD_PDEBUGPC_REG (DR_REG_DPORT_BASE + 0x458) -/* DPORT_RECORD_PRO_PDEBUGPC : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define DPORT_RECORD_PRO_PDEBUGPC 0xFFFFFFFF -#define DPORT_RECORD_PRO_PDEBUGPC_M ((DPORT_RECORD_PRO_PDEBUGPC_V)<<(DPORT_RECORD_PRO_PDEBUGPC_S)) -#define DPORT_RECORD_PRO_PDEBUGPC_V 0xFFFFFFFF -#define DPORT_RECORD_PRO_PDEBUGPC_S 0 - -#define DPORT_PRO_CPU_RECORD_PDEBUGLS0STAT_REG (DR_REG_DPORT_BASE + 0x45C) -/* DPORT_RECORD_PRO_PDEBUGLS0STAT : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define DPORT_RECORD_PRO_PDEBUGLS0STAT 0xFFFFFFFF -#define DPORT_RECORD_PRO_PDEBUGLS0STAT_M ((DPORT_RECORD_PRO_PDEBUGLS0STAT_V)<<(DPORT_RECORD_PRO_PDEBUGLS0STAT_S)) -#define DPORT_RECORD_PRO_PDEBUGLS0STAT_V 0xFFFFFFFF -#define DPORT_RECORD_PRO_PDEBUGLS0STAT_S 0 -/* register layout: - * TYPE [3..0] : Type of instruction in LS. - * SZ [7..4] : Operand size. - * DTLBM [8] : Data TLB miss. - * DCM [9] : D-cache miss. - * DCH [10] : D-cache hit. - * UC [12] : Uncached. - * WB [13] : Writeback. - * COH [16] : Coherency. - * STCOH [18..17]: Coherent state. - * TGT [23..20] : Local target. -*/ -#define DPORT_RECORD_PDEBUGLS0STAT_TYPE_M ((DPORT_RECORD_PDEBUGLS0STAT_TYPE_V)<<(DPORT_RECORD_PDEBUGLS0STAT_TYPE_S)) -#define DPORT_RECORD_PDEBUGLS0STAT_TYPE_V 0x0F -#define DPORT_RECORD_PDEBUGLS0STAT_TYPE_S 0 -#define DPORT_RECORD_PDEBUGLS0STAT_TYPE(_r_) (((_r_)>>DPORT_RECORD_PDEBUGLS0STAT_TYPE_S) & DPORT_RECORD_PDEBUGLS0STAT_TYPE_V) -#define DPORT_RECORD_PDEBUGLS0STAT_TYPE_NONE 0x00 /* neither */ -#define DPORT_RECORD_PDEBUGLS0STAT_TYPE_ITLBR 0x01 /* hw itlb refill */ -#define DPORT_RECORD_PDEBUGLS0STAT_TYPE_DTLBR 0x02 /* hw dtlb refill */ -#define DPORT_RECORD_PDEBUGLS0STAT_TYPE_LD 0x05 /* load */ -#define DPORT_RECORD_PDEBUGLS0STAT_TYPE_STR 0x06 /* store */ -#define DPORT_RECORD_PDEBUGLS0STAT_TYPE_L32R 0x08 /* l32r */ -#define DPORT_RECORD_PDEBUGLS0STAT_TYPE_S32CLI1 0x0A /* s32ci1 */ -#define DPORT_RECORD_PDEBUGLS0STAT_TYPE_CTI 0x0C /* cache test inst */ -#define DPORT_RECORD_PDEBUGLS0STAT_TYPE_RWXSR 0x0E /* rsr/wsr/xsr */ -#define DPORT_RECORD_PDEBUGLS0STAT_TYPE_RWER 0x0F /* rer/wer */ -#define DPORT_RECORD_PDEBUGLS0STAT_SZ_M ((DPORT_RECORD_PDEBUGLS0STAT_SZ_V)<<(DPORT_RECORD_PDEBUGLS0STAT_SZ_S)) -#define DPORT_RECORD_PDEBUGLS0STAT_SZ_V 0x0F -#define DPORT_RECORD_PDEBUGLS0STAT_SZ_S 4 -#define DPORT_RECORD_PDEBUGLS0STAT_SZ(_r_) (((_r_)>>DPORT_RECORD_PDEBUGLS0STAT_SZ_S) & DPORT_RECORD_PDEBUGLS0STAT_SZ_V) -#define DPORT_RECORD_PDEBUGLS0STAT_SZB(_r_) ((8<>DPORT_RECORD_PDEBUGLS0STAT_STCOH_S) & DPORT_RECORD_PDEBUGLS0STAT_STCOH_V) -#define DPORT_RECORD_PDEBUGLS0STAT_STCOH_NONE 0x0 /* neither shared nor exclusive nor modified */ -#define DPORT_RECORD_PDEBUGLS0STAT_STCOH_SHARED 0x1 /* shared */ -#define DPORT_RECORD_PDEBUGLS0STAT_STCOH_EXCL 0x2 /* exclusive */ -#define DPORT_RECORD_PDEBUGLS0STAT_STCOH_MOD 0x3 /* modified */ -#define DPORT_RECORD_PDEBUGLS0STAT_TGT_M ((DPORT_RECORD_PDEBUGLS0STAT_TGT_V)<<(DPORT_RECORD_PDEBUGLS0STAT_TGT_S)) -#define DPORT_RECORD_PDEBUGLS0STAT_TGT_V 0x0F -#define DPORT_RECORD_PDEBUGLS0STAT_TGT_S 20 -#define DPORT_RECORD_PDEBUGLS0STAT_TGT(_r_) (((_r_)>>DPORT_RECORD_PDEBUGLS0STAT_TGT_S) & DPORT_RECORD_PDEBUGLS0STAT_TGT_V) -#define DPORT_RECORD_PDEBUGLS0STAT_TGT_EXT 0x0 /* not to local memory */ -#define DPORT_RECORD_PDEBUGLS0STAT_TGT_IRAM0 0x2 /* 001x: InstRAM (0/1) */ -#define DPORT_RECORD_PDEBUGLS0STAT_TGT_IRAM1 0x3 /* 001x: InstRAM (0/1) */ -#define DPORT_RECORD_PDEBUGLS0STAT_TGT_IROM0 0x4 /* 010x: InstROM (0/1) */ -#define DPORT_RECORD_PDEBUGLS0STAT_TGT_IROM1 0x5 /* 010x: InstROM (0/1) */ -#define DPORT_RECORD_PDEBUGLS0STAT_TGT_DRAM0 0x0A /* 101x: DataRAM (0/1) */ -#define DPORT_RECORD_PDEBUGLS0STAT_TGT_DRAM1 0x0B /* 101x: DataRAM (0/1) */ -#define DPORT_RECORD_PDEBUGLS0STAT_TGT_DROM0 0xE /* 111x: DataROM (0/1) */ -#define DPORT_RECORD_PDEBUGLS0STAT_TGT_DROM1 0xF /* 111x: DataROM (0/1) */ -// #define DPORT_RECORD_PDEBUGLS0STAT_TGT_IRAM(_t_) (((_t_)&0xE)=0x2) /* 001x: InstRAM (0/1) */ -// #define DPORT_RECORD_PDEBUGLS0STAT_TGT_IROM(_t_) (((_t_)&0xE)=0x4) /* 010x: InstROM (0/1) */ -// #define DPORT_RECORD_PDEBUGLS0STAT_TGT_DRAM(_t_) (((_t_)&0xE)=0x2) /* 101x: DataRAM (0/1) */ -// #define DPORT_RECORD_PDEBUGLS0STAT_TGT_DROM(_t_) (((_t_)&0xE)=0x2) /* 111x: DataROM (0/1) */ - -#define DPORT_PRO_CPU_RECORD_PDEBUGLS0ADDR_REG (DR_REG_DPORT_BASE + 0x460) -/* DPORT_RECORD_PRO_PDEBUGLS0ADDR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define DPORT_RECORD_PRO_PDEBUGLS0ADDR 0xFFFFFFFF -#define DPORT_RECORD_PRO_PDEBUGLS0ADDR_M ((DPORT_RECORD_PRO_PDEBUGLS0ADDR_V)<<(DPORT_RECORD_PRO_PDEBUGLS0ADDR_S)) -#define DPORT_RECORD_PRO_PDEBUGLS0ADDR_V 0xFFFFFFFF -#define DPORT_RECORD_PRO_PDEBUGLS0ADDR_S 0 - -#define DPORT_PRO_CPU_RECORD_PDEBUGLS0DATA_REG (DR_REG_DPORT_BASE + 0x464) -/* DPORT_RECORD_PRO_PDEBUGLS0DATA : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define DPORT_RECORD_PRO_PDEBUGLS0DATA 0xFFFFFFFF -#define DPORT_RECORD_PRO_PDEBUGLS0DATA_M ((DPORT_RECORD_PRO_PDEBUGLS0DATA_V)<<(DPORT_RECORD_PRO_PDEBUGLS0DATA_S)) -#define DPORT_RECORD_PRO_PDEBUGLS0DATA_V 0xFFFFFFFF -#define DPORT_RECORD_PRO_PDEBUGLS0DATA_S 0 - -#define DPORT_APP_CPU_RECORD_CTRL_REG (DR_REG_DPORT_BASE + 0x468) -/* DPORT_APP_CPU_PDEBUG_ENABLE : R/W ;bitpos:[8] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_APP_CPU_PDEBUG_ENABLE (BIT(8)) -#define DPORT_APP_CPU_PDEBUG_ENABLE_M (BIT(8)) -#define DPORT_APP_CPU_PDEBUG_ENABLE_V 0x1 -#define DPORT_APP_CPU_PDEBUG_ENABLE_S 8 -/* DPORT_APP_CPU_RECORD_DISABLE : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_CPU_RECORD_DISABLE (BIT(4)) -#define DPORT_APP_CPU_RECORD_DISABLE_M (BIT(4)) -#define DPORT_APP_CPU_RECORD_DISABLE_V 0x1 -#define DPORT_APP_CPU_RECORD_DISABLE_S 4 -/* DPORT_APP_CPU_RECORD_ENABLE : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_CPU_RECORD_ENABLE (BIT(0)) -#define DPORT_APP_CPU_RECORD_ENABLE_M (BIT(0)) -#define DPORT_APP_CPU_RECORD_ENABLE_V 0x1 -#define DPORT_APP_CPU_RECORD_ENABLE_S 0 - -#define DPORT_APP_CPU_RECORD_STATUS_REG (DR_REG_DPORT_BASE + 0x46C) -/* DPORT_APP_CPU_RECORDING : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_APP_CPU_RECORDING (BIT(0)) -#define DPORT_APP_CPU_RECORDING_M (BIT(0)) -#define DPORT_APP_CPU_RECORDING_V 0x1 -#define DPORT_APP_CPU_RECORDING_S 0 - -#define DPORT_APP_CPU_RECORD_PID_REG (DR_REG_DPORT_BASE + 0x470) -/* DPORT_RECORD_APP_PID : RO ;bitpos:[2:0] ;default: 3'd0 ; */ -/*description: */ -#define DPORT_RECORD_APP_PID 0x00000007 -#define DPORT_RECORD_APP_PID_M ((DPORT_RECORD_APP_PID_V)<<(DPORT_RECORD_APP_PID_S)) -#define DPORT_RECORD_APP_PID_V 0x7 -#define DPORT_RECORD_APP_PID_S 0 - -#define DPORT_APP_CPU_RECORD_PDEBUGINST_REG (DR_REG_DPORT_BASE + 0x474) -/* DPORT_RECORD_APP_PDEBUGINST : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define DPORT_RECORD_APP_PDEBUGINST 0xFFFFFFFF -#define DPORT_RECORD_APP_PDEBUGINST_M ((DPORT_RECORD_APP_PDEBUGINST_V)<<(DPORT_RECORD_APP_PDEBUGINST_S)) -#define DPORT_RECORD_APP_PDEBUGINST_V 0xFFFFFFFF -#define DPORT_RECORD_APP_PDEBUGINST_S 0 - -#define DPORT_APP_CPU_RECORD_PDEBUGSTATUS_REG (DR_REG_DPORT_BASE + 0x478) -/* DPORT_RECORD_APP_PDEBUGSTATUS : RO ;bitpos:[7:0] ;default: 8'b0 ; */ -/*description: */ -#define DPORT_RECORD_APP_PDEBUGSTATUS 0x000000FF -#define DPORT_RECORD_APP_PDEBUGSTATUS_M ((DPORT_RECORD_APP_PDEBUGSTATUS_V)<<(DPORT_RECORD_APP_PDEBUGSTATUS_S)) -#define DPORT_RECORD_APP_PDEBUGSTATUS_V 0xFF -#define DPORT_RECORD_APP_PDEBUGSTATUS_S 0 - -#define DPORT_APP_CPU_RECORD_PDEBUGDATA_REG (DR_REG_DPORT_BASE + 0x47C) -/* DPORT_RECORD_APP_PDEBUGDATA : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define DPORT_RECORD_APP_PDEBUGDATA 0xFFFFFFFF -#define DPORT_RECORD_APP_PDEBUGDATA_M ((DPORT_RECORD_APP_PDEBUGDATA_V)<<(DPORT_RECORD_APP_PDEBUGDATA_S)) -#define DPORT_RECORD_APP_PDEBUGDATA_V 0xFFFFFFFF -#define DPORT_RECORD_APP_PDEBUGDATA_S 0 - -#define DPORT_APP_CPU_RECORD_PDEBUGPC_REG (DR_REG_DPORT_BASE + 0x480) -/* DPORT_RECORD_APP_PDEBUGPC : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define DPORT_RECORD_APP_PDEBUGPC 0xFFFFFFFF -#define DPORT_RECORD_APP_PDEBUGPC_M ((DPORT_RECORD_APP_PDEBUGPC_V)<<(DPORT_RECORD_APP_PDEBUGPC_S)) -#define DPORT_RECORD_APP_PDEBUGPC_V 0xFFFFFFFF -#define DPORT_RECORD_APP_PDEBUGPC_S 0 - -#define DPORT_APP_CPU_RECORD_PDEBUGLS0STAT_REG (DR_REG_DPORT_BASE + 0x484) -/* DPORT_RECORD_APP_PDEBUGLS0STAT : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define DPORT_RECORD_APP_PDEBUGLS0STAT 0xFFFFFFFF -#define DPORT_RECORD_APP_PDEBUGLS0STAT_M ((DPORT_RECORD_APP_PDEBUGLS0STAT_V)<<(DPORT_RECORD_APP_PDEBUGLS0STAT_S)) -#define DPORT_RECORD_APP_PDEBUGLS0STAT_V 0xFFFFFFFF -#define DPORT_RECORD_APP_PDEBUGLS0STAT_S 0 - -#define DPORT_APP_CPU_RECORD_PDEBUGLS0ADDR_REG (DR_REG_DPORT_BASE + 0x488) -/* DPORT_RECORD_APP_PDEBUGLS0ADDR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define DPORT_RECORD_APP_PDEBUGLS0ADDR 0xFFFFFFFF -#define DPORT_RECORD_APP_PDEBUGLS0ADDR_M ((DPORT_RECORD_APP_PDEBUGLS0ADDR_V)<<(DPORT_RECORD_APP_PDEBUGLS0ADDR_S)) -#define DPORT_RECORD_APP_PDEBUGLS0ADDR_V 0xFFFFFFFF -#define DPORT_RECORD_APP_PDEBUGLS0ADDR_S 0 - -#define DPORT_APP_CPU_RECORD_PDEBUGLS0DATA_REG (DR_REG_DPORT_BASE + 0x48C) -/* DPORT_RECORD_APP_PDEBUGLS0DATA : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define DPORT_RECORD_APP_PDEBUGLS0DATA 0xFFFFFFFF -#define DPORT_RECORD_APP_PDEBUGLS0DATA_M ((DPORT_RECORD_APP_PDEBUGLS0DATA_V)<<(DPORT_RECORD_APP_PDEBUGLS0DATA_S)) -#define DPORT_RECORD_APP_PDEBUGLS0DATA_V 0xFFFFFFFF -#define DPORT_RECORD_APP_PDEBUGLS0DATA_S 0 - -#define DPORT_RSA_PD_CTRL_REG (DR_REG_DPORT_BASE + 0x490) -/* DPORT_RSA_PD : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_RSA_PD (BIT(0)) -#define DPORT_RSA_PD_M (BIT(0)) -#define DPORT_RSA_PD_V 0x1 -#define DPORT_RSA_PD_S 0 - -#define DPORT_ROM_MPU_TABLE0_REG (DR_REG_DPORT_BASE + 0x494) -/* DPORT_ROM_MPU_TABLE0 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_ROM_MPU_TABLE0 0x00000003 -#define DPORT_ROM_MPU_TABLE0_M ((DPORT_ROM_MPU_TABLE0_V)<<(DPORT_ROM_MPU_TABLE0_S)) -#define DPORT_ROM_MPU_TABLE0_V 0x3 -#define DPORT_ROM_MPU_TABLE0_S 0 - -#define DPORT_ROM_MPU_TABLE1_REG (DR_REG_DPORT_BASE + 0x498) -/* DPORT_ROM_MPU_TABLE1 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_ROM_MPU_TABLE1 0x00000003 -#define DPORT_ROM_MPU_TABLE1_M ((DPORT_ROM_MPU_TABLE1_V)<<(DPORT_ROM_MPU_TABLE1_S)) -#define DPORT_ROM_MPU_TABLE1_V 0x3 -#define DPORT_ROM_MPU_TABLE1_S 0 - -#define DPORT_ROM_MPU_TABLE2_REG (DR_REG_DPORT_BASE + 0x49C) -/* DPORT_ROM_MPU_TABLE2 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_ROM_MPU_TABLE2 0x00000003 -#define DPORT_ROM_MPU_TABLE2_M ((DPORT_ROM_MPU_TABLE2_V)<<(DPORT_ROM_MPU_TABLE2_S)) -#define DPORT_ROM_MPU_TABLE2_V 0x3 -#define DPORT_ROM_MPU_TABLE2_S 0 - -#define DPORT_ROM_MPU_TABLE3_REG (DR_REG_DPORT_BASE + 0x4A0) -/* DPORT_ROM_MPU_TABLE3 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_ROM_MPU_TABLE3 0x00000003 -#define DPORT_ROM_MPU_TABLE3_M ((DPORT_ROM_MPU_TABLE3_V)<<(DPORT_ROM_MPU_TABLE3_S)) -#define DPORT_ROM_MPU_TABLE3_V 0x3 -#define DPORT_ROM_MPU_TABLE3_S 0 - -#define DPORT_SHROM_MPU_TABLE0_REG (DR_REG_DPORT_BASE + 0x4A4) -/* DPORT_SHROM_MPU_TABLE0 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_SHROM_MPU_TABLE0 0x00000003 -#define DPORT_SHROM_MPU_TABLE0_M ((DPORT_SHROM_MPU_TABLE0_V)<<(DPORT_SHROM_MPU_TABLE0_S)) -#define DPORT_SHROM_MPU_TABLE0_V 0x3 -#define DPORT_SHROM_MPU_TABLE0_S 0 - -#define DPORT_SHROM_MPU_TABLE1_REG (DR_REG_DPORT_BASE + 0x4A8) -/* DPORT_SHROM_MPU_TABLE1 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_SHROM_MPU_TABLE1 0x00000003 -#define DPORT_SHROM_MPU_TABLE1_M ((DPORT_SHROM_MPU_TABLE1_V)<<(DPORT_SHROM_MPU_TABLE1_S)) -#define DPORT_SHROM_MPU_TABLE1_V 0x3 -#define DPORT_SHROM_MPU_TABLE1_S 0 - -#define DPORT_SHROM_MPU_TABLE2_REG (DR_REG_DPORT_BASE + 0x4AC) -/* DPORT_SHROM_MPU_TABLE2 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_SHROM_MPU_TABLE2 0x00000003 -#define DPORT_SHROM_MPU_TABLE2_M ((DPORT_SHROM_MPU_TABLE2_V)<<(DPORT_SHROM_MPU_TABLE2_S)) -#define DPORT_SHROM_MPU_TABLE2_V 0x3 -#define DPORT_SHROM_MPU_TABLE2_S 0 - -#define DPORT_SHROM_MPU_TABLE3_REG (DR_REG_DPORT_BASE + 0x4B0) -/* DPORT_SHROM_MPU_TABLE3 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_SHROM_MPU_TABLE3 0x00000003 -#define DPORT_SHROM_MPU_TABLE3_M ((DPORT_SHROM_MPU_TABLE3_V)<<(DPORT_SHROM_MPU_TABLE3_S)) -#define DPORT_SHROM_MPU_TABLE3_V 0x3 -#define DPORT_SHROM_MPU_TABLE3_S 0 - -#define DPORT_SHROM_MPU_TABLE4_REG (DR_REG_DPORT_BASE + 0x4B4) -/* DPORT_SHROM_MPU_TABLE4 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_SHROM_MPU_TABLE4 0x00000003 -#define DPORT_SHROM_MPU_TABLE4_M ((DPORT_SHROM_MPU_TABLE4_V)<<(DPORT_SHROM_MPU_TABLE4_S)) -#define DPORT_SHROM_MPU_TABLE4_V 0x3 -#define DPORT_SHROM_MPU_TABLE4_S 0 - -#define DPORT_SHROM_MPU_TABLE5_REG (DR_REG_DPORT_BASE + 0x4B8) -/* DPORT_SHROM_MPU_TABLE5 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_SHROM_MPU_TABLE5 0x00000003 -#define DPORT_SHROM_MPU_TABLE5_M ((DPORT_SHROM_MPU_TABLE5_V)<<(DPORT_SHROM_MPU_TABLE5_S)) -#define DPORT_SHROM_MPU_TABLE5_V 0x3 -#define DPORT_SHROM_MPU_TABLE5_S 0 - -#define DPORT_SHROM_MPU_TABLE6_REG (DR_REG_DPORT_BASE + 0x4BC) -/* DPORT_SHROM_MPU_TABLE6 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_SHROM_MPU_TABLE6 0x00000003 -#define DPORT_SHROM_MPU_TABLE6_M ((DPORT_SHROM_MPU_TABLE6_V)<<(DPORT_SHROM_MPU_TABLE6_S)) -#define DPORT_SHROM_MPU_TABLE6_V 0x3 -#define DPORT_SHROM_MPU_TABLE6_S 0 - -#define DPORT_SHROM_MPU_TABLE7_REG (DR_REG_DPORT_BASE + 0x4C0) -/* DPORT_SHROM_MPU_TABLE7 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_SHROM_MPU_TABLE7 0x00000003 -#define DPORT_SHROM_MPU_TABLE7_M ((DPORT_SHROM_MPU_TABLE7_V)<<(DPORT_SHROM_MPU_TABLE7_S)) -#define DPORT_SHROM_MPU_TABLE7_V 0x3 -#define DPORT_SHROM_MPU_TABLE7_S 0 - -#define DPORT_SHROM_MPU_TABLE8_REG (DR_REG_DPORT_BASE + 0x4C4) -/* DPORT_SHROM_MPU_TABLE8 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_SHROM_MPU_TABLE8 0x00000003 -#define DPORT_SHROM_MPU_TABLE8_M ((DPORT_SHROM_MPU_TABLE8_V)<<(DPORT_SHROM_MPU_TABLE8_S)) -#define DPORT_SHROM_MPU_TABLE8_V 0x3 -#define DPORT_SHROM_MPU_TABLE8_S 0 - -#define DPORT_SHROM_MPU_TABLE9_REG (DR_REG_DPORT_BASE + 0x4C8) -/* DPORT_SHROM_MPU_TABLE9 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_SHROM_MPU_TABLE9 0x00000003 -#define DPORT_SHROM_MPU_TABLE9_M ((DPORT_SHROM_MPU_TABLE9_V)<<(DPORT_SHROM_MPU_TABLE9_S)) -#define DPORT_SHROM_MPU_TABLE9_V 0x3 -#define DPORT_SHROM_MPU_TABLE9_S 0 - -#define DPORT_SHROM_MPU_TABLE10_REG (DR_REG_DPORT_BASE + 0x4CC) -/* DPORT_SHROM_MPU_TABLE10 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_SHROM_MPU_TABLE10 0x00000003 -#define DPORT_SHROM_MPU_TABLE10_M ((DPORT_SHROM_MPU_TABLE10_V)<<(DPORT_SHROM_MPU_TABLE10_S)) -#define DPORT_SHROM_MPU_TABLE10_V 0x3 -#define DPORT_SHROM_MPU_TABLE10_S 0 - -#define DPORT_SHROM_MPU_TABLE11_REG (DR_REG_DPORT_BASE + 0x4D0) -/* DPORT_SHROM_MPU_TABLE11 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_SHROM_MPU_TABLE11 0x00000003 -#define DPORT_SHROM_MPU_TABLE11_M ((DPORT_SHROM_MPU_TABLE11_V)<<(DPORT_SHROM_MPU_TABLE11_S)) -#define DPORT_SHROM_MPU_TABLE11_V 0x3 -#define DPORT_SHROM_MPU_TABLE11_S 0 - -#define DPORT_SHROM_MPU_TABLE12_REG (DR_REG_DPORT_BASE + 0x4D4) -/* DPORT_SHROM_MPU_TABLE12 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_SHROM_MPU_TABLE12 0x00000003 -#define DPORT_SHROM_MPU_TABLE12_M ((DPORT_SHROM_MPU_TABLE12_V)<<(DPORT_SHROM_MPU_TABLE12_S)) -#define DPORT_SHROM_MPU_TABLE12_V 0x3 -#define DPORT_SHROM_MPU_TABLE12_S 0 - -#define DPORT_SHROM_MPU_TABLE13_REG (DR_REG_DPORT_BASE + 0x4D8) -/* DPORT_SHROM_MPU_TABLE13 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_SHROM_MPU_TABLE13 0x00000003 -#define DPORT_SHROM_MPU_TABLE13_M ((DPORT_SHROM_MPU_TABLE13_V)<<(DPORT_SHROM_MPU_TABLE13_S)) -#define DPORT_SHROM_MPU_TABLE13_V 0x3 -#define DPORT_SHROM_MPU_TABLE13_S 0 - -#define DPORT_SHROM_MPU_TABLE14_REG (DR_REG_DPORT_BASE + 0x4DC) -/* DPORT_SHROM_MPU_TABLE14 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_SHROM_MPU_TABLE14 0x00000003 -#define DPORT_SHROM_MPU_TABLE14_M ((DPORT_SHROM_MPU_TABLE14_V)<<(DPORT_SHROM_MPU_TABLE14_S)) -#define DPORT_SHROM_MPU_TABLE14_V 0x3 -#define DPORT_SHROM_MPU_TABLE14_S 0 - -#define DPORT_SHROM_MPU_TABLE15_REG (DR_REG_DPORT_BASE + 0x4E0) -/* DPORT_SHROM_MPU_TABLE15 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_SHROM_MPU_TABLE15 0x00000003 -#define DPORT_SHROM_MPU_TABLE15_M ((DPORT_SHROM_MPU_TABLE15_V)<<(DPORT_SHROM_MPU_TABLE15_S)) -#define DPORT_SHROM_MPU_TABLE15_V 0x3 -#define DPORT_SHROM_MPU_TABLE15_S 0 - -#define DPORT_SHROM_MPU_TABLE16_REG (DR_REG_DPORT_BASE + 0x4E4) -/* DPORT_SHROM_MPU_TABLE16 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_SHROM_MPU_TABLE16 0x00000003 -#define DPORT_SHROM_MPU_TABLE16_M ((DPORT_SHROM_MPU_TABLE16_V)<<(DPORT_SHROM_MPU_TABLE16_S)) -#define DPORT_SHROM_MPU_TABLE16_V 0x3 -#define DPORT_SHROM_MPU_TABLE16_S 0 - -#define DPORT_SHROM_MPU_TABLE17_REG (DR_REG_DPORT_BASE + 0x4E8) -/* DPORT_SHROM_MPU_TABLE17 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_SHROM_MPU_TABLE17 0x00000003 -#define DPORT_SHROM_MPU_TABLE17_M ((DPORT_SHROM_MPU_TABLE17_V)<<(DPORT_SHROM_MPU_TABLE17_S)) -#define DPORT_SHROM_MPU_TABLE17_V 0x3 -#define DPORT_SHROM_MPU_TABLE17_S 0 - -#define DPORT_SHROM_MPU_TABLE18_REG (DR_REG_DPORT_BASE + 0x4EC) -/* DPORT_SHROM_MPU_TABLE18 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_SHROM_MPU_TABLE18 0x00000003 -#define DPORT_SHROM_MPU_TABLE18_M ((DPORT_SHROM_MPU_TABLE18_V)<<(DPORT_SHROM_MPU_TABLE18_S)) -#define DPORT_SHROM_MPU_TABLE18_V 0x3 -#define DPORT_SHROM_MPU_TABLE18_S 0 - -#define DPORT_SHROM_MPU_TABLE19_REG (DR_REG_DPORT_BASE + 0x4F0) -/* DPORT_SHROM_MPU_TABLE19 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_SHROM_MPU_TABLE19 0x00000003 -#define DPORT_SHROM_MPU_TABLE19_M ((DPORT_SHROM_MPU_TABLE19_V)<<(DPORT_SHROM_MPU_TABLE19_S)) -#define DPORT_SHROM_MPU_TABLE19_V 0x3 -#define DPORT_SHROM_MPU_TABLE19_S 0 - -#define DPORT_SHROM_MPU_TABLE20_REG (DR_REG_DPORT_BASE + 0x4F4) -/* DPORT_SHROM_MPU_TABLE20 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_SHROM_MPU_TABLE20 0x00000003 -#define DPORT_SHROM_MPU_TABLE20_M ((DPORT_SHROM_MPU_TABLE20_V)<<(DPORT_SHROM_MPU_TABLE20_S)) -#define DPORT_SHROM_MPU_TABLE20_V 0x3 -#define DPORT_SHROM_MPU_TABLE20_S 0 - -#define DPORT_SHROM_MPU_TABLE21_REG (DR_REG_DPORT_BASE + 0x4F8) -/* DPORT_SHROM_MPU_TABLE21 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_SHROM_MPU_TABLE21 0x00000003 -#define DPORT_SHROM_MPU_TABLE21_M ((DPORT_SHROM_MPU_TABLE21_V)<<(DPORT_SHROM_MPU_TABLE21_S)) -#define DPORT_SHROM_MPU_TABLE21_V 0x3 -#define DPORT_SHROM_MPU_TABLE21_S 0 - -#define DPORT_SHROM_MPU_TABLE22_REG (DR_REG_DPORT_BASE + 0x4FC) -/* DPORT_SHROM_MPU_TABLE22 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_SHROM_MPU_TABLE22 0x00000003 -#define DPORT_SHROM_MPU_TABLE22_M ((DPORT_SHROM_MPU_TABLE22_V)<<(DPORT_SHROM_MPU_TABLE22_S)) -#define DPORT_SHROM_MPU_TABLE22_V 0x3 -#define DPORT_SHROM_MPU_TABLE22_S 0 - -#define DPORT_SHROM_MPU_TABLE23_REG (DR_REG_DPORT_BASE + 0x500) -/* DPORT_SHROM_MPU_TABLE23 : R/W ;bitpos:[1:0] ;default: 2'b1 ; */ -/*description: */ -#define DPORT_SHROM_MPU_TABLE23 0x00000003 -#define DPORT_SHROM_MPU_TABLE23_M ((DPORT_SHROM_MPU_TABLE23_V)<<(DPORT_SHROM_MPU_TABLE23_S)) -#define DPORT_SHROM_MPU_TABLE23_V 0x3 -#define DPORT_SHROM_MPU_TABLE23_S 0 - -#define DPORT_IMMU_TABLE0_REG (DR_REG_DPORT_BASE + 0x504) -/* DPORT_IMMU_TABLE0 : R/W ;bitpos:[6:0] ;default: 7'd0 ; */ -/*description: */ -#define DPORT_IMMU_TABLE0 0x0000007F -#define DPORT_IMMU_TABLE0_M ((DPORT_IMMU_TABLE0_V)<<(DPORT_IMMU_TABLE0_S)) -#define DPORT_IMMU_TABLE0_V 0x7F -#define DPORT_IMMU_TABLE0_S 0 - -#define DPORT_IMMU_TABLE1_REG (DR_REG_DPORT_BASE + 0x508) -/* DPORT_IMMU_TABLE1 : R/W ;bitpos:[6:0] ;default: 7'd1 ; */ -/*description: */ -#define DPORT_IMMU_TABLE1 0x0000007F -#define DPORT_IMMU_TABLE1_M ((DPORT_IMMU_TABLE1_V)<<(DPORT_IMMU_TABLE1_S)) -#define DPORT_IMMU_TABLE1_V 0x7F -#define DPORT_IMMU_TABLE1_S 0 - -#define DPORT_IMMU_TABLE2_REG (DR_REG_DPORT_BASE + 0x50C) -/* DPORT_IMMU_TABLE2 : R/W ;bitpos:[6:0] ;default: 7'd2 ; */ -/*description: */ -#define DPORT_IMMU_TABLE2 0x0000007F -#define DPORT_IMMU_TABLE2_M ((DPORT_IMMU_TABLE2_V)<<(DPORT_IMMU_TABLE2_S)) -#define DPORT_IMMU_TABLE2_V 0x7F -#define DPORT_IMMU_TABLE2_S 0 - -#define DPORT_IMMU_TABLE3_REG (DR_REG_DPORT_BASE + 0x510) -/* DPORT_IMMU_TABLE3 : R/W ;bitpos:[6:0] ;default: 7'd3 ; */ -/*description: */ -#define DPORT_IMMU_TABLE3 0x0000007F -#define DPORT_IMMU_TABLE3_M ((DPORT_IMMU_TABLE3_V)<<(DPORT_IMMU_TABLE3_S)) -#define DPORT_IMMU_TABLE3_V 0x7F -#define DPORT_IMMU_TABLE3_S 0 - -#define DPORT_IMMU_TABLE4_REG (DR_REG_DPORT_BASE + 0x514) -/* DPORT_IMMU_TABLE4 : R/W ;bitpos:[6:0] ;default: 7'd4 ; */ -/*description: */ -#define DPORT_IMMU_TABLE4 0x0000007F -#define DPORT_IMMU_TABLE4_M ((DPORT_IMMU_TABLE4_V)<<(DPORT_IMMU_TABLE4_S)) -#define DPORT_IMMU_TABLE4_V 0x7F -#define DPORT_IMMU_TABLE4_S 0 - -#define DPORT_IMMU_TABLE5_REG (DR_REG_DPORT_BASE + 0x518) -/* DPORT_IMMU_TABLE5 : R/W ;bitpos:[6:0] ;default: 7'd5 ; */ -/*description: */ -#define DPORT_IMMU_TABLE5 0x0000007F -#define DPORT_IMMU_TABLE5_M ((DPORT_IMMU_TABLE5_V)<<(DPORT_IMMU_TABLE5_S)) -#define DPORT_IMMU_TABLE5_V 0x7F -#define DPORT_IMMU_TABLE5_S 0 - -#define DPORT_IMMU_TABLE6_REG (DR_REG_DPORT_BASE + 0x51C) -/* DPORT_IMMU_TABLE6 : R/W ;bitpos:[6:0] ;default: 7'd6 ; */ -/*description: */ -#define DPORT_IMMU_TABLE6 0x0000007F -#define DPORT_IMMU_TABLE6_M ((DPORT_IMMU_TABLE6_V)<<(DPORT_IMMU_TABLE6_S)) -#define DPORT_IMMU_TABLE6_V 0x7F -#define DPORT_IMMU_TABLE6_S 0 - -#define DPORT_IMMU_TABLE7_REG (DR_REG_DPORT_BASE + 0x520) -/* DPORT_IMMU_TABLE7 : R/W ;bitpos:[6:0] ;default: 7'd7 ; */ -/*description: */ -#define DPORT_IMMU_TABLE7 0x0000007F -#define DPORT_IMMU_TABLE7_M ((DPORT_IMMU_TABLE7_V)<<(DPORT_IMMU_TABLE7_S)) -#define DPORT_IMMU_TABLE7_V 0x7F -#define DPORT_IMMU_TABLE7_S 0 - -#define DPORT_IMMU_TABLE8_REG (DR_REG_DPORT_BASE + 0x524) -/* DPORT_IMMU_TABLE8 : R/W ;bitpos:[6:0] ;default: 7'd8 ; */ -/*description: */ -#define DPORT_IMMU_TABLE8 0x0000007F -#define DPORT_IMMU_TABLE8_M ((DPORT_IMMU_TABLE8_V)<<(DPORT_IMMU_TABLE8_S)) -#define DPORT_IMMU_TABLE8_V 0x7F -#define DPORT_IMMU_TABLE8_S 0 - -#define DPORT_IMMU_TABLE9_REG (DR_REG_DPORT_BASE + 0x528) -/* DPORT_IMMU_TABLE9 : R/W ;bitpos:[6:0] ;default: 7'd9 ; */ -/*description: */ -#define DPORT_IMMU_TABLE9 0x0000007F -#define DPORT_IMMU_TABLE9_M ((DPORT_IMMU_TABLE9_V)<<(DPORT_IMMU_TABLE9_S)) -#define DPORT_IMMU_TABLE9_V 0x7F -#define DPORT_IMMU_TABLE9_S 0 - -#define DPORT_IMMU_TABLE10_REG (DR_REG_DPORT_BASE + 0x52C) -/* DPORT_IMMU_TABLE10 : R/W ;bitpos:[6:0] ;default: 7'd10 ; */ -/*description: */ -#define DPORT_IMMU_TABLE10 0x0000007F -#define DPORT_IMMU_TABLE10_M ((DPORT_IMMU_TABLE10_V)<<(DPORT_IMMU_TABLE10_S)) -#define DPORT_IMMU_TABLE10_V 0x7F -#define DPORT_IMMU_TABLE10_S 0 - -#define DPORT_IMMU_TABLE11_REG (DR_REG_DPORT_BASE + 0x530) -/* DPORT_IMMU_TABLE11 : R/W ;bitpos:[6:0] ;default: 7'd11 ; */ -/*description: */ -#define DPORT_IMMU_TABLE11 0x0000007F -#define DPORT_IMMU_TABLE11_M ((DPORT_IMMU_TABLE11_V)<<(DPORT_IMMU_TABLE11_S)) -#define DPORT_IMMU_TABLE11_V 0x7F -#define DPORT_IMMU_TABLE11_S 0 - -#define DPORT_IMMU_TABLE12_REG (DR_REG_DPORT_BASE + 0x534) -/* DPORT_IMMU_TABLE12 : R/W ;bitpos:[6:0] ;default: 7'd12 ; */ -/*description: */ -#define DPORT_IMMU_TABLE12 0x0000007F -#define DPORT_IMMU_TABLE12_M ((DPORT_IMMU_TABLE12_V)<<(DPORT_IMMU_TABLE12_S)) -#define DPORT_IMMU_TABLE12_V 0x7F -#define DPORT_IMMU_TABLE12_S 0 - -#define DPORT_IMMU_TABLE13_REG (DR_REG_DPORT_BASE + 0x538) -/* DPORT_IMMU_TABLE13 : R/W ;bitpos:[6:0] ;default: 7'd13 ; */ -/*description: */ -#define DPORT_IMMU_TABLE13 0x0000007F -#define DPORT_IMMU_TABLE13_M ((DPORT_IMMU_TABLE13_V)<<(DPORT_IMMU_TABLE13_S)) -#define DPORT_IMMU_TABLE13_V 0x7F -#define DPORT_IMMU_TABLE13_S 0 - -#define DPORT_IMMU_TABLE14_REG (DR_REG_DPORT_BASE + 0x53C) -/* DPORT_IMMU_TABLE14 : R/W ;bitpos:[6:0] ;default: 7'd14 ; */ -/*description: */ -#define DPORT_IMMU_TABLE14 0x0000007F -#define DPORT_IMMU_TABLE14_M ((DPORT_IMMU_TABLE14_V)<<(DPORT_IMMU_TABLE14_S)) -#define DPORT_IMMU_TABLE14_V 0x7F -#define DPORT_IMMU_TABLE14_S 0 - -#define DPORT_IMMU_TABLE15_REG (DR_REG_DPORT_BASE + 0x540) -/* DPORT_IMMU_TABLE15 : R/W ;bitpos:[6:0] ;default: 7'd15 ; */ -/*description: */ -#define DPORT_IMMU_TABLE15 0x0000007F -#define DPORT_IMMU_TABLE15_M ((DPORT_IMMU_TABLE15_V)<<(DPORT_IMMU_TABLE15_S)) -#define DPORT_IMMU_TABLE15_V 0x7F -#define DPORT_IMMU_TABLE15_S 0 - -#define DPORT_DMMU_TABLE0_REG (DR_REG_DPORT_BASE + 0x544) -/* DPORT_DMMU_TABLE0 : R/W ;bitpos:[6:0] ;default: 7'd0 ; */ -/*description: */ -#define DPORT_DMMU_TABLE0 0x0000007F -#define DPORT_DMMU_TABLE0_M ((DPORT_DMMU_TABLE0_V)<<(DPORT_DMMU_TABLE0_S)) -#define DPORT_DMMU_TABLE0_V 0x7F -#define DPORT_DMMU_TABLE0_S 0 - -#define DPORT_DMMU_TABLE1_REG (DR_REG_DPORT_BASE + 0x548) -/* DPORT_DMMU_TABLE1 : R/W ;bitpos:[6:0] ;default: 7'd1 ; */ -/*description: */ -#define DPORT_DMMU_TABLE1 0x0000007F -#define DPORT_DMMU_TABLE1_M ((DPORT_DMMU_TABLE1_V)<<(DPORT_DMMU_TABLE1_S)) -#define DPORT_DMMU_TABLE1_V 0x7F -#define DPORT_DMMU_TABLE1_S 0 - -#define DPORT_DMMU_TABLE2_REG (DR_REG_DPORT_BASE + 0x54C) -/* DPORT_DMMU_TABLE2 : R/W ;bitpos:[6:0] ;default: 7'd2 ; */ -/*description: */ -#define DPORT_DMMU_TABLE2 0x0000007F -#define DPORT_DMMU_TABLE2_M ((DPORT_DMMU_TABLE2_V)<<(DPORT_DMMU_TABLE2_S)) -#define DPORT_DMMU_TABLE2_V 0x7F -#define DPORT_DMMU_TABLE2_S 0 - -#define DPORT_DMMU_TABLE3_REG (DR_REG_DPORT_BASE + 0x550) -/* DPORT_DMMU_TABLE3 : R/W ;bitpos:[6:0] ;default: 7'd3 ; */ -/*description: */ -#define DPORT_DMMU_TABLE3 0x0000007F -#define DPORT_DMMU_TABLE3_M ((DPORT_DMMU_TABLE3_V)<<(DPORT_DMMU_TABLE3_S)) -#define DPORT_DMMU_TABLE3_V 0x7F -#define DPORT_DMMU_TABLE3_S 0 - -#define DPORT_DMMU_TABLE4_REG (DR_REG_DPORT_BASE + 0x554) -/* DPORT_DMMU_TABLE4 : R/W ;bitpos:[6:0] ;default: 7'd4 ; */ -/*description: */ -#define DPORT_DMMU_TABLE4 0x0000007F -#define DPORT_DMMU_TABLE4_M ((DPORT_DMMU_TABLE4_V)<<(DPORT_DMMU_TABLE4_S)) -#define DPORT_DMMU_TABLE4_V 0x7F -#define DPORT_DMMU_TABLE4_S 0 - -#define DPORT_DMMU_TABLE5_REG (DR_REG_DPORT_BASE + 0x558) -/* DPORT_DMMU_TABLE5 : R/W ;bitpos:[6:0] ;default: 7'd5 ; */ -/*description: */ -#define DPORT_DMMU_TABLE5 0x0000007F -#define DPORT_DMMU_TABLE5_M ((DPORT_DMMU_TABLE5_V)<<(DPORT_DMMU_TABLE5_S)) -#define DPORT_DMMU_TABLE5_V 0x7F -#define DPORT_DMMU_TABLE5_S 0 - -#define DPORT_DMMU_TABLE6_REG (DR_REG_DPORT_BASE + 0x55C) -/* DPORT_DMMU_TABLE6 : R/W ;bitpos:[6:0] ;default: 7'd6 ; */ -/*description: */ -#define DPORT_DMMU_TABLE6 0x0000007F -#define DPORT_DMMU_TABLE6_M ((DPORT_DMMU_TABLE6_V)<<(DPORT_DMMU_TABLE6_S)) -#define DPORT_DMMU_TABLE6_V 0x7F -#define DPORT_DMMU_TABLE6_S 0 - -#define DPORT_DMMU_TABLE7_REG (DR_REG_DPORT_BASE + 0x560) -/* DPORT_DMMU_TABLE7 : R/W ;bitpos:[6:0] ;default: 7'd7 ; */ -/*description: */ -#define DPORT_DMMU_TABLE7 0x0000007F -#define DPORT_DMMU_TABLE7_M ((DPORT_DMMU_TABLE7_V)<<(DPORT_DMMU_TABLE7_S)) -#define DPORT_DMMU_TABLE7_V 0x7F -#define DPORT_DMMU_TABLE7_S 0 - -#define DPORT_DMMU_TABLE8_REG (DR_REG_DPORT_BASE + 0x564) -/* DPORT_DMMU_TABLE8 : R/W ;bitpos:[6:0] ;default: 7'd8 ; */ -/*description: */ -#define DPORT_DMMU_TABLE8 0x0000007F -#define DPORT_DMMU_TABLE8_M ((DPORT_DMMU_TABLE8_V)<<(DPORT_DMMU_TABLE8_S)) -#define DPORT_DMMU_TABLE8_V 0x7F -#define DPORT_DMMU_TABLE8_S 0 - -#define DPORT_DMMU_TABLE9_REG (DR_REG_DPORT_BASE + 0x568) -/* DPORT_DMMU_TABLE9 : R/W ;bitpos:[6:0] ;default: 7'd9 ; */ -/*description: */ -#define DPORT_DMMU_TABLE9 0x0000007F -#define DPORT_DMMU_TABLE9_M ((DPORT_DMMU_TABLE9_V)<<(DPORT_DMMU_TABLE9_S)) -#define DPORT_DMMU_TABLE9_V 0x7F -#define DPORT_DMMU_TABLE9_S 0 - -#define DPORT_DMMU_TABLE10_REG (DR_REG_DPORT_BASE + 0x56C) -/* DPORT_DMMU_TABLE10 : R/W ;bitpos:[6:0] ;default: 7'd10 ; */ -/*description: */ -#define DPORT_DMMU_TABLE10 0x0000007F -#define DPORT_DMMU_TABLE10_M ((DPORT_DMMU_TABLE10_V)<<(DPORT_DMMU_TABLE10_S)) -#define DPORT_DMMU_TABLE10_V 0x7F -#define DPORT_DMMU_TABLE10_S 0 - -#define DPORT_DMMU_TABLE11_REG (DR_REG_DPORT_BASE + 0x570) -/* DPORT_DMMU_TABLE11 : R/W ;bitpos:[6:0] ;default: 7'd11 ; */ -/*description: */ -#define DPORT_DMMU_TABLE11 0x0000007F -#define DPORT_DMMU_TABLE11_M ((DPORT_DMMU_TABLE11_V)<<(DPORT_DMMU_TABLE11_S)) -#define DPORT_DMMU_TABLE11_V 0x7F -#define DPORT_DMMU_TABLE11_S 0 - -#define DPORT_DMMU_TABLE12_REG (DR_REG_DPORT_BASE + 0x574) -/* DPORT_DMMU_TABLE12 : R/W ;bitpos:[6:0] ;default: 7'd12 ; */ -/*description: */ -#define DPORT_DMMU_TABLE12 0x0000007F -#define DPORT_DMMU_TABLE12_M ((DPORT_DMMU_TABLE12_V)<<(DPORT_DMMU_TABLE12_S)) -#define DPORT_DMMU_TABLE12_V 0x7F -#define DPORT_DMMU_TABLE12_S 0 - -#define DPORT_DMMU_TABLE13_REG (DR_REG_DPORT_BASE + 0x578) -/* DPORT_DMMU_TABLE13 : R/W ;bitpos:[6:0] ;default: 7'd13 ; */ -/*description: */ -#define DPORT_DMMU_TABLE13 0x0000007F -#define DPORT_DMMU_TABLE13_M ((DPORT_DMMU_TABLE13_V)<<(DPORT_DMMU_TABLE13_S)) -#define DPORT_DMMU_TABLE13_V 0x7F -#define DPORT_DMMU_TABLE13_S 0 - -#define DPORT_DMMU_TABLE14_REG (DR_REG_DPORT_BASE + 0x57C) -/* DPORT_DMMU_TABLE14 : R/W ;bitpos:[6:0] ;default: 7'd14 ; */ -/*description: */ -#define DPORT_DMMU_TABLE14 0x0000007F -#define DPORT_DMMU_TABLE14_M ((DPORT_DMMU_TABLE14_V)<<(DPORT_DMMU_TABLE14_S)) -#define DPORT_DMMU_TABLE14_V 0x7F -#define DPORT_DMMU_TABLE14_S 0 - -#define DPORT_DMMU_TABLE15_REG (DR_REG_DPORT_BASE + 0x580) -/* DPORT_DMMU_TABLE15 : R/W ;bitpos:[6:0] ;default: 7'd15 ; */ -/*description: */ -#define DPORT_DMMU_TABLE15 0x0000007F -#define DPORT_DMMU_TABLE15_M ((DPORT_DMMU_TABLE15_V)<<(DPORT_DMMU_TABLE15_S)) -#define DPORT_DMMU_TABLE15_V 0x7F -#define DPORT_DMMU_TABLE15_S 0 - -#define DPORT_PRO_INTRUSION_CTRL_REG (DR_REG_DPORT_BASE + 0x584) -/* DPORT_PRO_INTRUSION_RECORD_RESET_N : R/W ;bitpos:[0] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_PRO_INTRUSION_RECORD_RESET_N (BIT(0)) -#define DPORT_PRO_INTRUSION_RECORD_RESET_N_M (BIT(0)) -#define DPORT_PRO_INTRUSION_RECORD_RESET_N_V 0x1 -#define DPORT_PRO_INTRUSION_RECORD_RESET_N_S 0 - -#define DPORT_PRO_INTRUSION_STATUS_REG (DR_REG_DPORT_BASE + 0x588) -/* DPORT_PRO_INTRUSION_RECORD : RO ;bitpos:[3:0] ;default: 4'b0 ; */ -/*description: */ -#define DPORT_PRO_INTRUSION_RECORD 0x0000000F -#define DPORT_PRO_INTRUSION_RECORD_M ((DPORT_PRO_INTRUSION_RECORD_V)<<(DPORT_PRO_INTRUSION_RECORD_S)) -#define DPORT_PRO_INTRUSION_RECORD_V 0xF -#define DPORT_PRO_INTRUSION_RECORD_S 0 - -#define DPORT_APP_INTRUSION_CTRL_REG (DR_REG_DPORT_BASE + 0x58C) -/* DPORT_APP_INTRUSION_RECORD_RESET_N : R/W ;bitpos:[0] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_APP_INTRUSION_RECORD_RESET_N (BIT(0)) -#define DPORT_APP_INTRUSION_RECORD_RESET_N_M (BIT(0)) -#define DPORT_APP_INTRUSION_RECORD_RESET_N_V 0x1 -#define DPORT_APP_INTRUSION_RECORD_RESET_N_S 0 - -#define DPORT_APP_INTRUSION_STATUS_REG (DR_REG_DPORT_BASE + 0x590) -/* DPORT_APP_INTRUSION_RECORD : RO ;bitpos:[3:0] ;default: 4'b0 ; */ -/*description: */ -#define DPORT_APP_INTRUSION_RECORD 0x0000000F -#define DPORT_APP_INTRUSION_RECORD_M ((DPORT_APP_INTRUSION_RECORD_V)<<(DPORT_APP_INTRUSION_RECORD_S)) -#define DPORT_APP_INTRUSION_RECORD_V 0xF -#define DPORT_APP_INTRUSION_RECORD_S 0 - -#define DPORT_FRONT_END_MEM_PD_REG (DR_REG_DPORT_BASE + 0x594) -/* DPORT_PBUS_MEM_FORCE_PD : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_PBUS_MEM_FORCE_PD (BIT(3)) -#define DPORT_PBUS_MEM_FORCE_PD_M (BIT(3)) -#define DPORT_PBUS_MEM_FORCE_PD_V 0x1 -#define DPORT_PBUS_MEM_FORCE_PD_S 3 -/* DPORT_PBUS_MEM_FORCE_PU : R/W ;bitpos:[2] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_PBUS_MEM_FORCE_PU (BIT(2)) -#define DPORT_PBUS_MEM_FORCE_PU_M (BIT(2)) -#define DPORT_PBUS_MEM_FORCE_PU_V 0x1 -#define DPORT_PBUS_MEM_FORCE_PU_S 2 -/* DPORT_AGC_MEM_FORCE_PD : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_AGC_MEM_FORCE_PD (BIT(1)) -#define DPORT_AGC_MEM_FORCE_PD_M (BIT(1)) -#define DPORT_AGC_MEM_FORCE_PD_V 0x1 -#define DPORT_AGC_MEM_FORCE_PD_S 1 -/* DPORT_AGC_MEM_FORCE_PU : R/W ;bitpos:[0] ;default: 1'b1 ; */ -/*description: */ -#define DPORT_AGC_MEM_FORCE_PU (BIT(0)) -#define DPORT_AGC_MEM_FORCE_PU_M (BIT(0)) -#define DPORT_AGC_MEM_FORCE_PU_V 0x1 -#define DPORT_AGC_MEM_FORCE_PU_S 0 - -#define DPORT_MMU_IA_INT_EN_REG (DR_REG_DPORT_BASE + 0x598) -/* DPORT_MMU_IA_INT_EN : R/W ;bitpos:[23:0] ;default: 24'b0 ; */ -/*description: */ -#define DPORT_MMU_IA_INT_EN 0x00FFFFFF -#define DPORT_MMU_IA_INT_EN_M ((DPORT_MMU_IA_INT_EN_V)<<(DPORT_MMU_IA_INT_EN_S)) -#define DPORT_MMU_IA_INT_EN_V 0xFFFFFF -#define DPORT_MMU_IA_INT_EN_S 0 - -#define DPORT_MPU_IA_INT_EN_REG (DR_REG_DPORT_BASE + 0x59C) -/* DPORT_MPU_IA_INT_EN : R/W ;bitpos:[16:0] ;default: 17'b0 ; */ -/*description: */ -#define DPORT_MPU_IA_INT_EN 0x0001FFFF -#define DPORT_MPU_IA_INT_EN_M ((DPORT_MPU_IA_INT_EN_V)<<(DPORT_MPU_IA_INT_EN_S)) -#define DPORT_MPU_IA_INT_EN_V 0x1FFFF -#define DPORT_MPU_IA_INT_EN_S 0 - -#define DPORT_CACHE_IA_INT_EN_REG (DR_REG_DPORT_BASE + 0x5A0) -/* DPORT_CACHE_IA_INT_EN : R/W ;bitpos:[27:0] ;default: 28'b0 ; */ -/*description: Interrupt enable bits for various invalid cache access reasons*/ -#define DPORT_CACHE_IA_INT_EN 0x0FFFFFFF -#define DPORT_CACHE_IA_INT_EN_M ((DPORT_CACHE_IA_INT_EN_V)<<(DPORT_CACHE_IA_INT_EN_S)) -#define DPORT_CACHE_IA_INT_EN_V 0xFFFFFFF -#define DPORT_CACHE_IA_INT_EN_S 0 -/* Contents of DPORT_CACHE_IA_INT_EN field: */ -/* DPORT_CACHE_IA_INT_PRO_OPPOSITE : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: PRO CPU invalid access to APP CPU cache when cache disabled */ -#define DPORT_CACHE_IA_INT_PRO_OPPOSITE BIT(19) -#define DPORT_CACHE_IA_INT_PRO_OPPOSITE_M BIT(19) -#define DPORT_CACHE_IA_INT_PRO_OPPOSITE_V (1) -#define DPORT_CACHE_IA_INT_PRO_OPPOSITE_S (19) -/* DPORT_CACHE_IA_INT_PRO_DRAM1 : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: PRO CPU invalid access to DRAM1 when cache is disabled */ -#define DPORT_CACHE_IA_INT_PRO_DRAM1 BIT(18) -#define DPORT_CACHE_IA_INT_PRO_DRAM1_M BIT(18) -#define DPORT_CACHE_IA_INT_PRO_DRAM1_V (1) -#define DPORT_CACHE_IA_INT_PRO_DRAM1_S (18) -/* DPORT_CACHE_IA_INT_PRO_IROM0 : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: PRO CPU invalid access to IROM0 when cache is disabled */ -#define DPORT_CACHE_IA_INT_PRO_IROM0 BIT(17) -#define DPORT_CACHE_IA_INT_PRO_IROM0_M BIT(17) -#define DPORT_CACHE_IA_INT_PRO_IROM0_V (1) -#define DPORT_CACHE_IA_INT_PRO_IROM0_S (17) -/* DPORT_CACHE_IA_INT_PRO_IRAM1 : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: PRO CPU invalid access to IRAM1 when cache is disabled */ -#define DPORT_CACHE_IA_INT_PRO_IRAM1 BIT(16) -#define DPORT_CACHE_IA_INT_PRO_IRAM1_M BIT(16) -#define DPORT_CACHE_IA_INT_PRO_IRAM1_V (1) -#define DPORT_CACHE_IA_INT_PRO_IRAM1_S (16) -/* DPORT_CACHE_IA_INT_PRO_IRAM0 : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: PRO CPU invalid access to IRAM0 when cache is disabled */ -#define DPORT_CACHE_IA_INT_PRO_IRAM0 BIT(15) -#define DPORT_CACHE_IA_INT_PRO_IRAM0_M BIT(15) -#define DPORT_CACHE_IA_INT_PRO_IRAM0_V (1) -#define DPORT_CACHE_IA_INT_PRO_IRAM0_S (15) -/* DPORT_CACHE_IA_INT_PRO_DROM0 : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: PRO CPU invalid access to DROM0 when cache is disabled */ -#define DPORT_CACHE_IA_INT_PRO_DROM0 BIT(14) -#define DPORT_CACHE_IA_INT_PRO_DROM0_M BIT(14) -#define DPORT_CACHE_IA_INT_PRO_DROM0_V (1) -#define DPORT_CACHE_IA_INT_PRO_DROM0_S (14) -/* DPORT_CACHE_IA_INT_APP_OPPOSITE : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: APP CPU invalid access to APP CPU cache when cache disabled */ -#define DPORT_CACHE_IA_INT_APP_OPPOSITE BIT(5) -#define DPORT_CACHE_IA_INT_APP_OPPOSITE_M BIT(5) -#define DPORT_CACHE_IA_INT_APP_OPPOSITE_V (1) -#define DPORT_CACHE_IA_INT_APP_OPPOSITE_S (5) -/* DPORT_CACHE_IA_INT_APP_DRAM1 : R/W ;bitpos:43] ;default: 1'b0 ; */ -/*description: APP CPU invalid access to DRAM1 when cache is disabled */ -#define DPORT_CACHE_IA_INT_APP_DRAM1 BIT(4) -#define DPORT_CACHE_IA_INT_APP_DRAM1_M BIT(4) -#define DPORT_CACHE_IA_INT_APP_DRAM1_V (1) -#define DPORT_CACHE_IA_INT_APP_DRAM1_S (4) -/* DPORT_CACHE_IA_INT_APP_IROM0 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: APP CPU invalid access to IROM0 when cache is disabled */ -#define DPORT_CACHE_IA_INT_APP_IROM0 BIT(3) -#define DPORT_CACHE_IA_INT_APP_IROM0_M BIT(3) -#define DPORT_CACHE_IA_INT_APP_IROM0_V (1) -#define DPORT_CACHE_IA_INT_APP_IROM0_S (3) -/* DPORT_CACHE_IA_INT_APP_IRAM1 : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: APP CPU invalid access to IRAM1 when cache is disabled */ -#define DPORT_CACHE_IA_INT_APP_IRAM1 BIT(2) -#define DPORT_CACHE_IA_INT_APP_IRAM1_M BIT(2) -#define DPORT_CACHE_IA_INT_APP_IRAM1_V (1) -#define DPORT_CACHE_IA_INT_APP_IRAM1_S (2) -/* DPORT_CACHE_IA_INT_APP_IRAM0 : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: APP CPU invalid access to IRAM0 when cache is disabled */ -#define DPORT_CACHE_IA_INT_APP_IRAM0 BIT(1) -#define DPORT_CACHE_IA_INT_APP_IRAM0_M BIT(1) -#define DPORT_CACHE_IA_INT_APP_IRAM0_V (1) -#define DPORT_CACHE_IA_INT_APP_IRAM0_S (1) -/* DPORT_CACHE_IA_INT_APP_DROM0 : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: APP CPU invalid access to DROM0 when cache is disabled */ -#define DPORT_CACHE_IA_INT_APP_DROM0 BIT(0) -#define DPORT_CACHE_IA_INT_APP_DROM0_M BIT(0) -#define DPORT_CACHE_IA_INT_APP_DROM0_V (1) -#define DPORT_CACHE_IA_INT_APP_DROM0_S (0) - -#define DPORT_SECURE_BOOT_CTRL_REG (DR_REG_DPORT_BASE + 0x5A4) -/* DPORT_SW_BOOTLOADER_SEL : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define DPORT_SW_BOOTLOADER_SEL (BIT(0)) -#define DPORT_SW_BOOTLOADER_SEL_M (BIT(0)) -#define DPORT_SW_BOOTLOADER_SEL_V 0x1 -#define DPORT_SW_BOOTLOADER_SEL_S 0 - -#define DPORT_SPI_DMA_CHAN_SEL_REG (DR_REG_DPORT_BASE + 0x5A8) -/* DPORT_SPI3_DMA_CHAN_SEL : R/W ;bitpos:[5:4] ;default: 2'b00 ; */ -/*description: */ -#define DPORT_SPI3_DMA_CHAN_SEL 0x00000003 -#define DPORT_SPI3_DMA_CHAN_SEL_M ((DPORT_SPI3_DMA_CHAN_SEL_V)<<(DPORT_SPI3_DMA_CHAN_SEL_S)) -#define DPORT_SPI3_DMA_CHAN_SEL_V 0x3 -#define DPORT_SPI3_DMA_CHAN_SEL_S 4 -/* DPORT_SPI2_DMA_CHAN_SEL : R/W ;bitpos:[3:2] ;default: 2'b00 ; */ -/*description: */ -#define DPORT_SPI2_DMA_CHAN_SEL 0x00000003 -#define DPORT_SPI2_DMA_CHAN_SEL_M ((DPORT_SPI2_DMA_CHAN_SEL_V)<<(DPORT_SPI2_DMA_CHAN_SEL_S)) -#define DPORT_SPI2_DMA_CHAN_SEL_V 0x3 -#define DPORT_SPI2_DMA_CHAN_SEL_S 2 -/* DPORT_SPI1_DMA_CHAN_SEL : R/W ;bitpos:[1:0] ;default: 2'b00 ; */ -/*description: */ -#define DPORT_SPI1_DMA_CHAN_SEL 0x00000003 -#define DPORT_SPI1_DMA_CHAN_SEL_M ((DPORT_SPI1_DMA_CHAN_SEL_V)<<(DPORT_SPI1_DMA_CHAN_SEL_S)) -#define DPORT_SPI1_DMA_CHAN_SEL_V 0x3 -#define DPORT_SPI1_DMA_CHAN_SEL_S 0 - -#define DPORT_PRO_VECBASE_CTRL_REG (DR_REG_DPORT_BASE + 0x5AC) -/* DPORT_PRO_OUT_VECBASE_SEL : R/W ;bitpos:[1:0] ;default: 2'b0 ; */ -/*description: */ -#define DPORT_PRO_OUT_VECBASE_SEL 0x00000003 -#define DPORT_PRO_OUT_VECBASE_SEL_M ((DPORT_PRO_OUT_VECBASE_SEL_V)<<(DPORT_PRO_OUT_VECBASE_SEL_S)) -#define DPORT_PRO_OUT_VECBASE_SEL_V 0x3 -#define DPORT_PRO_OUT_VECBASE_SEL_S 0 - -#define DPORT_PRO_VECBASE_SET_REG (DR_REG_DPORT_BASE + 0x5B0) -/* DPORT_PRO_OUT_VECBASE_REG : R/W ;bitpos:[21:0] ;default: 22'b0 ; */ -/*description: */ -#define DPORT_PRO_OUT_VECBASE_REG 0x003FFFFF -#define DPORT_PRO_OUT_VECBASE_REG_M ((DPORT_PRO_OUT_VECBASE_REG_V)<<(DPORT_PRO_OUT_VECBASE_REG_S)) -#define DPORT_PRO_OUT_VECBASE_REG_V 0x3FFFFF -#define DPORT_PRO_OUT_VECBASE_REG_S 0 - -#define DPORT_APP_VECBASE_CTRL_REG (DR_REG_DPORT_BASE + 0x5B4) -/* DPORT_APP_OUT_VECBASE_SEL : R/W ;bitpos:[1:0] ;default: 2'b0 ; */ -/*description: */ -#define DPORT_APP_OUT_VECBASE_SEL 0x00000003 -#define DPORT_APP_OUT_VECBASE_SEL_M ((DPORT_APP_OUT_VECBASE_SEL_V)<<(DPORT_APP_OUT_VECBASE_SEL_S)) -#define DPORT_APP_OUT_VECBASE_SEL_V 0x3 -#define DPORT_APP_OUT_VECBASE_SEL_S 0 - -#define DPORT_APP_VECBASE_SET_REG (DR_REG_DPORT_BASE + 0x5B8) -/* DPORT_APP_OUT_VECBASE_REG : R/W ;bitpos:[21:0] ;default: 22'b0 ; */ -/*description: */ -#define DPORT_APP_OUT_VECBASE_REG 0x003FFFFF -#define DPORT_APP_OUT_VECBASE_REG_M ((DPORT_APP_OUT_VECBASE_REG_V)<<(DPORT_APP_OUT_VECBASE_REG_S)) -#define DPORT_APP_OUT_VECBASE_REG_V 0x3FFFFF -#define DPORT_APP_OUT_VECBASE_REG_S 0 - -#define DPORT_DATE_REG (DR_REG_DPORT_BASE + 0xFFC) -/* DPORT_DATE : R/W ;bitpos:[27:0] ;default: 28'h1605190 ; */ -/*description: */ -#define DPORT_DATE 0x0FFFFFFF -#define DPORT_DATE_M ((DPORT_DATE_V)<<(DPORT_DATE_S)) -#define DPORT_DATE_V 0xFFFFFFF -#define DPORT_DATE_S 0 -#define DPORT_DPORT_DATE_VERSION 0x1605190 - -/* Flash MMU table for PRO CPU */ -#define DPORT_PRO_FLASH_MMU_TABLE ((volatile uint32_t*) 0x3FF10000) - -/* Flash MMU table for APP CPU */ -#define DPORT_APP_FLASH_MMU_TABLE ((volatile uint32_t*) 0x3FF12000) - -#define DPORT_FLASH_MMU_TABLE_SIZE 0x100 - -#define DPORT_FLASH_MMU_TABLE_INVALID_VAL 0x100 - -#endif /*_SOC_DPORT_REG_H_ */ - - diff --git a/tools/sdk/include/soc/soc/efuse_reg.h b/tools/sdk/include/soc/soc/efuse_reg.h deleted file mode 100644 index a2ee03d3142..00000000000 --- a/tools/sdk/include/soc/soc/efuse_reg.h +++ /dev/null @@ -1,1155 +0,0 @@ -// 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. -#ifndef _SOC_EFUSE_REG_H_ -#define _SOC_EFUSE_REG_H_ - - -#include "soc.h" -#define EFUSE_BLK0_RDATA0_REG (DR_REG_EFUSE_BASE + 0x000) -/* EFUSE_RD_FLASH_CRYPT_CNT : RO ;bitpos:[26:20] ;default: 7'b0 ; */ -/*description: read for flash_crypt_cnt*/ -#define EFUSE_RD_FLASH_CRYPT_CNT 0x0000007F -#define EFUSE_RD_FLASH_CRYPT_CNT_M ((EFUSE_RD_FLASH_CRYPT_CNT_V)<<(EFUSE_RD_FLASH_CRYPT_CNT_S)) -#define EFUSE_RD_FLASH_CRYPT_CNT_V 0x7F -#define EFUSE_RD_FLASH_CRYPT_CNT_S 20 -/* EFUSE_RD_EFUSE_RD_DIS : RO ;bitpos:[19:16] ;default: 4'b0 ; */ -/*description: read for efuse_rd_disable*/ -#define EFUSE_RD_EFUSE_RD_DIS 0x0000000F -#define EFUSE_RD_EFUSE_RD_DIS_M ((EFUSE_RD_EFUSE_RD_DIS_V)<<(EFUSE_RD_EFUSE_RD_DIS_S)) -#define EFUSE_RD_EFUSE_RD_DIS_V 0xF -#define EFUSE_RD_EFUSE_RD_DIS_S 16 - -/* Read disable bits for efuse blocks 1-3 */ -#define EFUSE_RD_DIS_BLK1 (1<<16) -#define EFUSE_RD_DIS_BLK2 (1<<17) -#define EFUSE_RD_DIS_BLK3 (1<<18) -/* Read disable FLASH_CRYPT_CONFIG, CODING_SCHEME & KEY_STATUS - in efuse block 0 -*/ -#define EFUSE_RD_DIS_BLK0_PARTIAL (1<<19) - -/* EFUSE_RD_EFUSE_WR_DIS : RO ;bitpos:[15:0] ;default: 16'b0 ; */ -/*description: read for efuse_wr_disable*/ -#define EFUSE_RD_EFUSE_WR_DIS 0x0000FFFF -#define EFUSE_RD_EFUSE_WR_DIS_M ((EFUSE_RD_EFUSE_WR_DIS_V)<<(EFUSE_RD_EFUSE_WR_DIS_S)) -#define EFUSE_RD_EFUSE_WR_DIS_V 0xFFFF -#define EFUSE_RD_EFUSE_WR_DIS_S 0 - -/* Write disable bits */ -#define EFUSE_WR_DIS_RD_DIS (1<<0) /*< disable writing read disable reg */ -#define EFUSE_WR_DIS_WR_DIS (1<<1) /*< disable writing write disable reg */ -#define EFUSE_WR_DIS_FLASH_CRYPT_CNT (1<<2) -#define EFUSE_WR_DIS_MAC_SPI_CONFIG_HD (1<<3) /*< disable writing MAC & SPI config hd efuses */ -#define EFUSE_WR_DIS_XPD_SDIO (1<<5) /*< disable writing SDIO config efuses */ -#define EFUSE_WR_DIS_SPI_PAD_CONFIG (1<<6) /*< disable writing SPI_PAD_CONFIG efuses */ -#define EFUSE_WR_DIS_BLK1 (1<<7) /*< disable writing BLK1 efuses */ -#define EFUSE_WR_DIS_BLK2 (1<<8) /*< disable writing BLK2 efuses */ -#define EFUSE_WR_DIS_BLK3 (1<<9) /*< disable writing BLK3 efuses */ -#define EFUSE_WR_DIS_FLASH_CRYPT_CODING_SCHEME (1<<10) /*< disable writing FLASH_CRYPT_CONFIG and CODING_SCHEME efuses */ -#define EFUSE_WR_DIS_ABS_DONE_0 (1<<12) /*< disable writing ABS_DONE_0 efuse */ -#define EFUSE_WR_DIS_ABS_DONE_1 (1<<13) /*< disable writing ABS_DONE_1 efuse */ -#define EFUSE_WR_DIS_JTAG_DISABLE (1<<14) /*< disable writing JTAG_DISABLE efuse */ -#define EFUSE_WR_DIS_CONSOLE_DL_DISABLE (1<<15) /*< disable writing CONSOLE_DEBUG_DISABLE, DISABLE_DL_ENCRYPT, DISABLE_DL_DECRYPT and DISABLE_DL_CACHE efuses */ - -#define EFUSE_BLK0_RDATA1_REG (DR_REG_EFUSE_BASE + 0x004) -/* EFUSE_RD_WIFI_MAC_CRC_LOW : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: read for low 32bit WIFI_MAC_Address*/ -#define EFUSE_RD_WIFI_MAC_CRC_LOW 0xFFFFFFFF -#define EFUSE_RD_WIFI_MAC_CRC_LOW_M ((EFUSE_RD_WIFI_MAC_CRC_LOW_V)<<(EFUSE_RD_WIFI_MAC_CRC_LOW_S)) -#define EFUSE_RD_WIFI_MAC_CRC_LOW_V 0xFFFFFFFF -#define EFUSE_RD_WIFI_MAC_CRC_LOW_S 0 - -#define EFUSE_BLK0_RDATA2_REG (DR_REG_EFUSE_BASE + 0x008) -/* EFUSE_RD_WIFI_MAC_CRC_HIGH : RO ;bitpos:[23:0] ;default: 24'b0 ; */ -/*description: read for high 24bit WIFI_MAC_Address*/ -#define EFUSE_RD_WIFI_MAC_CRC_HIGH 0x00FFFFFF -#define EFUSE_RD_WIFI_MAC_CRC_HIGH_M ((EFUSE_RD_WIFI_MAC_CRC_HIGH_V)<<(EFUSE_RD_WIFI_MAC_CRC_HIGH_S)) -#define EFUSE_RD_WIFI_MAC_CRC_HIGH_V 0xFFFFFF -#define EFUSE_RD_WIFI_MAC_CRC_HIGH_S 0 - -#define EFUSE_BLK0_RDATA3_REG (DR_REG_EFUSE_BASE + 0x00c) -/* EFUSE_RD_CHIP_VER_REV1 : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: bit is set to 1 for rev1 silicon*/ -#define EFUSE_RD_CHIP_VER_REV1 (BIT(15)) -#define EFUSE_RD_CHIP_VER_REV1_M ((EFUSE_RD_CHIP_VER_REV1_V)<<(EFUSE_RD_CHIP_VER_REV1_S)) -#define EFUSE_RD_CHIP_VER_REV1_V 0x1 -#define EFUSE_RD_CHIP_VER_REV1_S 15 -/* EFUSE_RD_BLK3_PART_RESERVE : R/W ; bitpos:[14] ; default: 1'b0; */ -/*description: If set, this bit indicates that BLOCK3[143:96] is reserved for internal use*/ -#define EFUSE_RD_BLK3_PART_RESERVE (BIT(14)) -#define EFUSE_RD_BLK3_PART_RESERVE_M ((EFUSE_RD_BLK3_PART_RESERVE_V)<<(EFUSE_RD_BLK3_PART_RESERVE_S)) -#define EFUSE_RD_BLK3_PART_RESERVE_V 0x1 -#define EFUSE_RD_BLK3_PART_RESERVE_S 14 -/* EFUSE_RD_CHIP_CPU_FREQ_RATED : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: If set, the ESP32's maximum CPU frequency has been rated*/ -#define EFUSE_RD_CHIP_CPU_FREQ_RATED (BIT(13)) -#define EFUSE_RD_CHIP_CPU_FREQ_RATED_M ((EFUSE_RD_CHIP_CPU_FREQ_RATED_V)<<(EFUSE_RD_CHIP_CPU_FREQ_RATED_S)) -#define EFUSE_RD_CHIP_CPU_FREQ_RATED_V 0x1 -#define EFUSE_RD_CHIP_CPU_FREQ_RATED_S 13 -/* EFUSE_RD_CHIP_CPU_FREQ_LOW : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: If set alongside EFUSE_RD_CHIP_CPU_FREQ_RATED, the ESP32's max CPU frequency is rated for 160MHz. 240MHz otherwise*/ -#define EFUSE_RD_CHIP_CPU_FREQ_LOW (BIT(12)) -#define EFUSE_RD_CHIP_CPU_FREQ_LOW_M ((EFUSE_RD_CHIP_CPU_FREQ_LOW_V)<<(EFUSE_RD_CHIP_CPU_FREQ_LOW_S)) -#define EFUSE_RD_CHIP_CPU_FREQ_LOW_V 0x1 -#define EFUSE_RD_CHIP_CPU_FREQ_LOW_S 12 -/* EFUSE_RD_CHIP_VER_PKG : R/W ;bitpos:[11:9] ;default: 3'b0 ; */ -/*description: chip package */ -#define EFUSE_RD_CHIP_VER_PKG 0x00000007 -#define EFUSE_RD_CHIP_VER_PKG_M ((EFUSE_RD_CHIP_VER_PKG_V)<<(EFUSE_RD_CHIP_VER_PKG_S)) -#define EFUSE_RD_CHIP_VER_PKG_V 0x7 -#define EFUSE_RD_CHIP_VER_PKG_S 9 -#define EFUSE_RD_CHIP_VER_PKG_ESP32D0WDQ6 0 -#define EFUSE_RD_CHIP_VER_PKG_ESP32D0WDQ5 1 -#define EFUSE_RD_CHIP_VER_PKG_ESP32D2WDQ5 2 -#define EFUSE_RD_CHIP_VER_PKG_ESP32PICOD2 4 -#define EFUSE_RD_CHIP_VER_PKG_ESP32PICOD4 5 -/* EFUSE_RD_SPI_PAD_CONFIG_HD : RO ;bitpos:[8:4] ;default: 5'b0 ; */ -/*description: read for SPI_pad_config_hd*/ -#define EFUSE_RD_SPI_PAD_CONFIG_HD 0x0000001F -#define EFUSE_RD_SPI_PAD_CONFIG_HD_M ((EFUSE_RD_SPI_PAD_CONFIG_HD_V)<<(EFUSE_RD_SPI_PAD_CONFIG_HD_S)) -#define EFUSE_RD_SPI_PAD_CONFIG_HD_V 0x1F -#define EFUSE_RD_SPI_PAD_CONFIG_HD_S 4 -/* EFUSE_RD_CHIP_VER_DIS_CACHE : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define EFUSE_RD_CHIP_VER_DIS_CACHE (BIT(3)) -#define EFUSE_RD_CHIP_VER_DIS_CACHE_M (BIT(3)) -#define EFUSE_RD_CHIP_VER_DIS_CACHE_V 0x1 -#define EFUSE_RD_CHIP_VER_DIS_CACHE_S 3 -/* EFUSE_RD_CHIP_VER_32PAD : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define EFUSE_RD_CHIP_VER_32PAD (BIT(2)) -#define EFUSE_RD_CHIP_VER_32PAD_M (BIT(2)) -#define EFUSE_RD_CHIP_VER_32PAD_V 0x1 -#define EFUSE_RD_CHIP_VER_32PAD_S 2 -/* EFUSE_RD_CHIP_VER_DIS_BT : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define EFUSE_RD_CHIP_VER_DIS_BT (BIT(1)) -#define EFUSE_RD_CHIP_VER_DIS_BT_M (BIT(1)) -#define EFUSE_RD_CHIP_VER_DIS_BT_V 0x1 -#define EFUSE_RD_CHIP_VER_DIS_BT_S 1 -/* EFUSE_RD_CHIP_VER_DIS_APP_CPU : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define EFUSE_RD_CHIP_VER_DIS_APP_CPU (BIT(0)) -#define EFUSE_RD_CHIP_VER_DIS_APP_CPU_M (BIT(0)) -#define EFUSE_RD_CHIP_VER_DIS_APP_CPU_V 0x1 -#define EFUSE_RD_CHIP_VER_DIS_APP_CPU_S 0 - -#define EFUSE_BLK0_RDATA4_REG (DR_REG_EFUSE_BASE + 0x010) -/* EFUSE_RD_SDIO_FORCE : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: read for sdio_force*/ -#define EFUSE_RD_SDIO_FORCE (BIT(16)) -#define EFUSE_RD_SDIO_FORCE_M (BIT(16)) -#define EFUSE_RD_SDIO_FORCE_V 0x1 -#define EFUSE_RD_SDIO_FORCE_S 16 -/* EFUSE_RD_SDIO_TIEH : RO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: read for SDIO_TIEH*/ -#define EFUSE_RD_SDIO_TIEH (BIT(15)) -#define EFUSE_RD_SDIO_TIEH_M (BIT(15)) -#define EFUSE_RD_SDIO_TIEH_V 0x1 -#define EFUSE_RD_SDIO_TIEH_S 15 -/* EFUSE_RD_XPD_SDIO_REG : RO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: read for XPD_SDIO_REG*/ -#define EFUSE_RD_XPD_SDIO_REG (BIT(14)) -#define EFUSE_RD_XPD_SDIO_REG_M (BIT(14)) -#define EFUSE_RD_XPD_SDIO_REG_V 0x1 -#define EFUSE_RD_XPD_SDIO_REG_S 14 -/* EFUSE_RD_ADC_VREF : R/W ;bitpos:[12:8] ;default: 5'b0 ; */ -/*description: True ADC reference voltage */ -#define EFUSE_RD_ADC_VREF 0x0000001F -#define EFUSE_RD_ADC_VREF_M ((EFUSE_RD_ADC_VREF_V)<<(EFUSE_RD_ADC_VREF_S)) -#define EFUSE_RD_ADC_VREF_V 0x1F -#define EFUSE_RD_ADC_VREF_S 8 -/* Note: EFUSE_ADC_VREF and SDIO_DREFH/M/L share the same address space. Newer - * versions of ESP32 come with EFUSE_ADC_VREF already burned, therefore - * SDIO_DREFH/M/L is only available in older versions of ESP32 */ -/* EFUSE_RD_SDIO_DREFL : RO ;bitpos:[13:12] ;default: 2'b0 ; */ -/*description: */ -#define EFUSE_RD_SDIO_DREFL 0x00000003 -#define EFUSE_RD_SDIO_DREFL_M ((EFUSE_RD_SDIO_DREFL_V)<<(EFUSE_RD_SDIO_DREFL_S)) -#define EFUSE_RD_SDIO_DREFL_V 0x3 -#define EFUSE_RD_SDIO_DREFL_S 12 -/* EFUSE_RD_SDIO_DREFM : RO ;bitpos:[11:10] ;default: 2'b0 ; */ -/*description: */ -#define EFUSE_RD_SDIO_DREFM 0x00000003 -#define EFUSE_RD_SDIO_DREFM_M ((EFUSE_RD_SDIO_DREFM_V)<<(EFUSE_RD_SDIO_DREFM_S)) -#define EFUSE_RD_SDIO_DREFM_V 0x3 -#define EFUSE_RD_SDIO_DREFM_S 10 -/* EFUSE_RD_SDIO_DREFH : RO ;bitpos:[9:8] ;default: 2'b0 ; */ -/*description: */ -#define EFUSE_RD_SDIO_DREFH 0x00000003 -#define EFUSE_RD_SDIO_DREFH_M ((EFUSE_RD_SDIO_DREFH_V)<<(EFUSE_RD_SDIO_DREFH_S)) -#define EFUSE_RD_SDIO_DREFH_V 0x3 -#define EFUSE_RD_SDIO_DREFH_S 8 -/* EFUSE_RD_CK8M_FREQ : RO ;bitpos:[7:0] ;default: 8'b0 ; */ -/*description: */ -#define EFUSE_RD_CK8M_FREQ 0x000000FF -#define EFUSE_RD_CK8M_FREQ_M ((EFUSE_RD_CK8M_FREQ_V)<<(EFUSE_RD_CK8M_FREQ_S)) -#define EFUSE_RD_CK8M_FREQ_V 0xFF -#define EFUSE_RD_CK8M_FREQ_S 0 - -#define EFUSE_BLK0_RDATA5_REG (DR_REG_EFUSE_BASE + 0x014) -/* EFUSE_RD_FLASH_CRYPT_CONFIG : RO ;bitpos:[31:28] ;default: 4'b0 ; */ -/*description: read for flash_crypt_config*/ -#define EFUSE_RD_FLASH_CRYPT_CONFIG 0x0000000F -#define EFUSE_RD_FLASH_CRYPT_CONFIG_M ((EFUSE_RD_FLASH_CRYPT_CONFIG_V)<<(EFUSE_RD_FLASH_CRYPT_CONFIG_S)) -#define EFUSE_RD_FLASH_CRYPT_CONFIG_V 0xF -#define EFUSE_RD_FLASH_CRYPT_CONFIG_S 28 -/* EFUSE_RD_INST_CONFIG : RO ;bitpos:[27:20] ;default: 8'b0 ; */ -/*description: */ -#define EFUSE_RD_INST_CONFIG 0x000000FF -#define EFUSE_RD_INST_CONFIG_M ((EFUSE_RD_INST_CONFIG_V)<<(EFUSE_RD_INST_CONFIG_S)) -#define EFUSE_RD_INST_CONFIG_V 0xFF -#define EFUSE_RD_INST_CONFIG_S 20 -/* EFUSE_RD_SPI_PAD_CONFIG_CS0 : RO ;bitpos:[19:15] ;default: 5'b0 ; */ -/*description: read for SPI_pad_config_cs0*/ -#define EFUSE_RD_SPI_PAD_CONFIG_CS0 0x0000001F -#define EFUSE_RD_SPI_PAD_CONFIG_CS0_M ((EFUSE_RD_SPI_PAD_CONFIG_CS0_V)<<(EFUSE_RD_SPI_PAD_CONFIG_CS0_S)) -#define EFUSE_RD_SPI_PAD_CONFIG_CS0_V 0x1F -#define EFUSE_RD_SPI_PAD_CONFIG_CS0_S 15 -/* EFUSE_RD_SPI_PAD_CONFIG_D : RO ;bitpos:[14:10] ;default: 5'b0 ; */ -/*description: read for SPI_pad_config_d*/ -#define EFUSE_RD_SPI_PAD_CONFIG_D 0x0000001F -#define EFUSE_RD_SPI_PAD_CONFIG_D_M ((EFUSE_RD_SPI_PAD_CONFIG_D_V)<<(EFUSE_RD_SPI_PAD_CONFIG_D_S)) -#define EFUSE_RD_SPI_PAD_CONFIG_D_V 0x1F -#define EFUSE_RD_SPI_PAD_CONFIG_D_S 10 -/* EFUSE_RD_SPI_PAD_CONFIG_Q : RO ;bitpos:[9:5] ;default: 5'b0 ; */ -/*description: read for SPI_pad_config_q*/ -#define EFUSE_RD_SPI_PAD_CONFIG_Q 0x0000001F -#define EFUSE_RD_SPI_PAD_CONFIG_Q_M ((EFUSE_RD_SPI_PAD_CONFIG_Q_V)<<(EFUSE_RD_SPI_PAD_CONFIG_Q_S)) -#define EFUSE_RD_SPI_PAD_CONFIG_Q_V 0x1F -#define EFUSE_RD_SPI_PAD_CONFIG_Q_S 5 -/* EFUSE_RD_SPI_PAD_CONFIG_CLK : RO ;bitpos:[4:0] ;default: 5'b0 ; */ -/*description: read for SPI_pad_config_clk*/ -#define EFUSE_RD_SPI_PAD_CONFIG_CLK 0x0000001F -#define EFUSE_RD_SPI_PAD_CONFIG_CLK_M ((EFUSE_RD_SPI_PAD_CONFIG_CLK_V)<<(EFUSE_RD_SPI_PAD_CONFIG_CLK_S)) -#define EFUSE_RD_SPI_PAD_CONFIG_CLK_V 0x1F -#define EFUSE_RD_SPI_PAD_CONFIG_CLK_S 0 - -#define EFUSE_BLK0_RDATA6_REG (DR_REG_EFUSE_BASE + 0x018) -/* EFUSE_RD_KEY_STATUS : RO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: read for key_status*/ -#define EFUSE_RD_KEY_STATUS (BIT(10)) -#define EFUSE_RD_KEY_STATUS_M (BIT(10)) -#define EFUSE_RD_KEY_STATUS_V 0x1 -#define EFUSE_RD_KEY_STATUS_S 10 -/* EFUSE_RD_DISABLE_DL_CACHE : RO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: read for download_dis_cache*/ -#define EFUSE_RD_DISABLE_DL_CACHE (BIT(9)) -#define EFUSE_RD_DISABLE_DL_CACHE_M (BIT(9)) -#define EFUSE_RD_DISABLE_DL_CACHE_V 0x1 -#define EFUSE_RD_DISABLE_DL_CACHE_S 9 -/* EFUSE_RD_DISABLE_DL_DECRYPT : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: read for download_dis_decrypt*/ -#define EFUSE_RD_DISABLE_DL_DECRYPT (BIT(8)) -#define EFUSE_RD_DISABLE_DL_DECRYPT_M (BIT(8)) -#define EFUSE_RD_DISABLE_DL_DECRYPT_V 0x1 -#define EFUSE_RD_DISABLE_DL_DECRYPT_S 8 -/* EFUSE_RD_DISABLE_DL_ENCRYPT : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: read for download_dis_encrypt*/ -#define EFUSE_RD_DISABLE_DL_ENCRYPT (BIT(7)) -#define EFUSE_RD_DISABLE_DL_ENCRYPT_M (BIT(7)) -#define EFUSE_RD_DISABLE_DL_ENCRYPT_V 0x1 -#define EFUSE_RD_DISABLE_DL_ENCRYPT_S 7 -/* EFUSE_RD_DISABLE_JTAG : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: read for JTAG_disable*/ -#define EFUSE_RD_DISABLE_JTAG (BIT(6)) -#define EFUSE_RD_DISABLE_JTAG_M (BIT(6)) -#define EFUSE_RD_DISABLE_JTAG_V 0x1 -#define EFUSE_RD_DISABLE_JTAG_S 6 -/* EFUSE_RD_ABS_DONE_1 : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: read for abstract_done_1*/ -#define EFUSE_RD_ABS_DONE_1 (BIT(5)) -#define EFUSE_RD_ABS_DONE_1_M (BIT(5)) -#define EFUSE_RD_ABS_DONE_1_V 0x1 -#define EFUSE_RD_ABS_DONE_1_S 5 -/* EFUSE_RD_ABS_DONE_0 : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: read for abstract_done_0*/ -#define EFUSE_RD_ABS_DONE_0 (BIT(4)) -#define EFUSE_RD_ABS_DONE_0_M (BIT(4)) -#define EFUSE_RD_ABS_DONE_0_V 0x1 -#define EFUSE_RD_ABS_DONE_0_S 4 -/* EFUSE_RD_DISABLE_SDIO_HOST : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define EFUSE_RD_DISABLE_SDIO_HOST (BIT(3)) -#define EFUSE_RD_DISABLE_SDIO_HOST_M (BIT(3)) -#define EFUSE_RD_DISABLE_SDIO_HOST_V 0x1 -#define EFUSE_RD_DISABLE_SDIO_HOST_S 3 -/* EFUSE_RD_CONSOLE_DEBUG_DISABLE : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: read for console_debug_disable*/ -#define EFUSE_RD_CONSOLE_DEBUG_DISABLE (BIT(2)) -#define EFUSE_RD_CONSOLE_DEBUG_DISABLE_M (BIT(2)) -#define EFUSE_RD_CONSOLE_DEBUG_DISABLE_V 0x1 -#define EFUSE_RD_CONSOLE_DEBUG_DISABLE_S 2 -/* EFUSE_RD_CODING_SCHEME : RO ;bitpos:[1:0] ;default: 2'b0 ; */ -/*description: read for coding_scheme*/ -#define EFUSE_RD_CODING_SCHEME 0x00000003 -#define EFUSE_RD_CODING_SCHEME_M ((EFUSE_RD_CODING_SCHEME_V)<<(EFUSE_RD_CODING_SCHEME_S)) -#define EFUSE_RD_CODING_SCHEME_V 0x3 -#define EFUSE_RD_CODING_SCHEME_S 0 - -#define EFUSE_CODING_SCHEME_VAL_NONE 0x0 -#define EFUSE_CODING_SCHEME_VAL_34 0x1 - -#define EFUSE_BLK0_WDATA0_REG (DR_REG_EFUSE_BASE + 0x01c) -/* EFUSE_FLASH_CRYPT_CNT : R/W ;bitpos:[26:20] ;default: 7'b0 ; */ -/*description: program for flash_crypt_cnt*/ -#define EFUSE_FLASH_CRYPT_CNT 0x0000007F -#define EFUSE_FLASH_CRYPT_CNT_M ((EFUSE_FLASH_CRYPT_CNT_V)<<(EFUSE_FLASH_CRYPT_CNT_S)) -#define EFUSE_FLASH_CRYPT_CNT_V 0x7F -#define EFUSE_FLASH_CRYPT_CNT_S 20 -/* EFUSE_RD_DIS : R/W ;bitpos:[19:16] ;default: 4'b0 ; */ -/*description: program for efuse_rd_disable*/ -#define EFUSE_RD_DIS 0x0000000F -#define EFUSE_RD_DIS_M ((EFUSE_RD_DIS_V)<<(EFUSE_RD_DIS_S)) -#define EFUSE_RD_DIS_V 0xF -#define EFUSE_RD_DIS_S 16 -/* EFUSE_WR_DIS : R/W ;bitpos:[15:0] ;default: 16'b0 ; */ -/*description: program for efuse_wr_disable*/ -#define EFUSE_WR_DIS 0x0000FFFF -#define EFUSE_WR_DIS_M ((EFUSE_WR_DIS_V)<<(EFUSE_WR_DIS_S)) -#define EFUSE_WR_DIS_V 0xFFFF -#define EFUSE_WR_DIS_S 0 - -#define EFUSE_BLK0_WDATA1_REG (DR_REG_EFUSE_BASE + 0x020) -/* EFUSE_WIFI_MAC_CRC_LOW : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: program for low 32bit WIFI_MAC_Address*/ -#define EFUSE_WIFI_MAC_CRC_LOW 0xFFFFFFFF -#define EFUSE_WIFI_MAC_CRC_LOW_M ((EFUSE_WIFI_MAC_CRC_LOW_V)<<(EFUSE_WIFI_MAC_CRC_LOW_S)) -#define EFUSE_WIFI_MAC_CRC_LOW_V 0xFFFFFFFF -#define EFUSE_WIFI_MAC_CRC_LOW_S 0 - -#define EFUSE_BLK0_WDATA2_REG (DR_REG_EFUSE_BASE + 0x024) -/* EFUSE_WIFI_MAC_CRC_HIGH : R/W ;bitpos:[23:0] ;default: 24'b0 ; */ -/*description: program for high 24bit WIFI_MAC_Address*/ -#define EFUSE_WIFI_MAC_CRC_HIGH 0x00FFFFFF -#define EFUSE_WIFI_MAC_CRC_HIGH_M ((EFUSE_WIFI_MAC_CRC_HIGH_V)<<(EFUSE_WIFI_MAC_CRC_HIGH_S)) -#define EFUSE_WIFI_MAC_CRC_HIGH_V 0xFFFFFF -#define EFUSE_WIFI_MAC_CRC_HIGH_S 0 - -#define EFUSE_BLK0_WDATA3_REG (DR_REG_EFUSE_BASE + 0x028) -/* EFUSE_CHIP_VER_REV1 : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define EFUSE_CHIP_VER_REV1 (BIT(15)) -#define EFUSE_CHIP_VER_REV1_M ((EFUSE_CHIP_VER_REV1_V)<<(EFUSE_CHIP_VER_REV1_S)) -#define EFUSE_CHIP_VER_REV1_V 0x1 -#define EFUSE_CHIP_VER_REV1_S 15 -/* EFUSE_BLK3_PART_RESERVE : R/W ; bitpos:[14] ; default: 1'b0; */ -/*description: If set, this bit indicates that BLOCK3[143:96] is reserved for internal use*/ -#define EFUSE_BLK3_PART_RESERVE (BIT(14)) -#define EFUSE_BLK3_PART_RESERVE_M ((EFUSE_BLK3_PART_RESERVE_V)<<(EFUSE_BLK3_PART_RESERVE_S)) -#define EFUSE_BLK3_PART_RESERVE_V 0x1 -#define EFUSE_BLK3_PART_RESERVE_S 14 -/* EFUSE_CHIP_CPU_FREQ_RATED : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: If set, the ESP32's maximum CPU frequency has been rated*/ -#define EFUSE_CHIP_CPU_FREQ_RATED (BIT(13)) -#define EFUSE_CHIP_CPU_FREQ_RATED_M ((EFUSE_CHIP_CPU_FREQ_RATED_V)<<(EFUSE_CHIP_CPU_FREQ_RATED_S)) -#define EFUSE_CHIP_CPU_FREQ_RATED_V 0x1 -#define EFUSE_CHIP_CPU_FREQ_RATED_S 13 -/* EFUSE_CHIP_CPU_FREQ_LOW : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: If set alongside EFUSE_CHIP_CPU_FREQ_RATED, the ESP32's max CPU frequency is rated for 160MHz. 240MHz otherwise*/ -#define EFUSE_CHIP_CPU_FREQ_LOW (BIT(12)) -#define EFUSE_CHIP_CPU_FREQ_LOW_M ((EFUSE_CHIP_CPU_FREQ_LOW_V)<<(EFUSE_CHIP_CPU_FREQ_LOW_S)) -#define EFUSE_CHIP_CPU_FREQ_LOW_V 0x1 -#define EFUSE_CHIP_CPU_FREQ_LOW_S 12 -/* EFUSE_CHIP_VER_PKG : R/W ;bitpos:[11:9] ;default: 3'b0 ; */ -/*description: */ -#define EFUSE_CHIP_VER_PKG 0x00000007 -#define EFUSE_CHIP_VER_PKG_M ((EFUSE_CHIP_VER_PKG_V)<<(EFUSE_CHIP_VER_PKG_S)) -#define EFUSE_CHIP_VER_PKG_V 0x7 -#define EFUSE_CHIP_VER_PKG_S 9 -#define EFUSE_CHIP_VER_PKG_ESP32D0WDQ6 0 -#define EFUSE_CHIP_VER_PKG_ESP32D0WDQ5 1 -#define EFUSE_CHIP_VER_PKG_ESP32D2WDQ5 2 -#define EFUSE_CHIP_VER_PKG_ESP32PICOD2 4 -#define EFUSE_CHIP_VER_PKG_ESP32PICOD4 5 -/* EFUSE_SPI_PAD_CONFIG_HD : R/W ;bitpos:[8:4] ;default: 5'b0 ; */ -/*description: program for SPI_pad_config_hd*/ -#define EFUSE_SPI_PAD_CONFIG_HD 0x0000001F -#define EFUSE_SPI_PAD_CONFIG_HD_M ((EFUSE_SPI_PAD_CONFIG_HD_V)<<(EFUSE_SPI_PAD_CONFIG_HD_S)) -#define EFUSE_SPI_PAD_CONFIG_HD_V 0x1F -#define EFUSE_SPI_PAD_CONFIG_HD_S 4 -/* EFUSE_CHIP_VER_DIS_CACHE : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define EFUSE_CHIP_VER_DIS_CACHE (BIT(3)) -#define EFUSE_CHIP_VER_DIS_CACHE_M (BIT(3)) -#define EFUSE_CHIP_VER_DIS_CACHE_V 0x1 -#define EFUSE_CHIP_VER_DIS_CACHE_S 3 -/* EFUSE_CHIP_VER_32PAD : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define EFUSE_CHIP_VER_32PAD (BIT(2)) -#define EFUSE_CHIP_VER_32PAD_M (BIT(2)) -#define EFUSE_CHIP_VER_32PAD_V 0x1 -#define EFUSE_CHIP_VER_32PAD_S 2 -/* EFUSE_CHIP_VER_DIS_BT : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define EFUSE_CHIP_VER_DIS_BT (BIT(1)) -#define EFUSE_CHIP_VER_DIS_BT_M (BIT(1)) -#define EFUSE_CHIP_VER_DIS_BT_V 0x1 -#define EFUSE_CHIP_VER_DIS_BT_S 1 -/* EFUSE_CHIP_VER_DIS_APP_CPU : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define EFUSE_CHIP_VER_DIS_APP_CPU (BIT(0)) -#define EFUSE_CHIP_VER_DIS_APP_CPU_M (BIT(0)) -#define EFUSE_CHIP_VER_DIS_APP_CPU_V 0x1 -#define EFUSE_CHIP_VER_DIS_APP_CPU_S 0 - -#define EFUSE_BLK0_WDATA4_REG (DR_REG_EFUSE_BASE + 0x02c) -/* EFUSE_SDIO_FORCE : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: program for sdio_force*/ -#define EFUSE_SDIO_FORCE (BIT(16)) -#define EFUSE_SDIO_FORCE_M (BIT(16)) -#define EFUSE_SDIO_FORCE_V 0x1 -#define EFUSE_SDIO_FORCE_S 16 -/* EFUSE_SDIO_TIEH : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: program for SDIO_TIEH*/ -#define EFUSE_SDIO_TIEH (BIT(15)) -#define EFUSE_SDIO_TIEH_M (BIT(15)) -#define EFUSE_SDIO_TIEH_V 0x1 -#define EFUSE_SDIO_TIEH_S 15 -/* EFUSE_XPD_SDIO_REG : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: program for XPD_SDIO_REG*/ -#define EFUSE_XPD_SDIO_REG (BIT(14)) -#define EFUSE_XPD_SDIO_REG_M (BIT(14)) -#define EFUSE_XPD_SDIO_REG_V 0x1 -#define EFUSE_XPD_SDIO_REG_S 14 -/* EFUSE_ADC_VREF : R/W ;bitpos:[12:8] ;default: 5'b0 ; */ -/*description: True ADC reference voltage */ -#define EFUSE_ADC_VREF 0x0000001F -#define EFUSE_ADC_VREF_M ((EFUSE_ADC_VREF_V)<<(EFUSE_ADC_VREF_S)) -#define EFUSE_ADC_VREF_V 0x1F -#define EFUSE_ADC_VREF_S 8 -/* Note: EFUSE_ADC_VREF and SDIO_DREFH/M/L share the same address space. Newer - * versions of ESP32 come with EFUSE_ADC_VREF already burned, therefore - * SDIO_DREFH/M/L is only available in older versions of ESP32 */ -/* EFUSE_SDIO_DREFL : R/W ;bitpos:[13:12] ;default: 2'b0 ; */ -/*description: */ -#define EFUSE_SDIO_DREFL 0x00000003 -#define EFUSE_SDIO_DREFL_M ((EFUSE_SDIO_DREFL_V)<<(EFUSE_SDIO_DREFL_S)) -#define EFUSE_SDIO_DREFL_V 0x3 -#define EFUSE_SDIO_DREFL_S 12 -/* EFUSE_SDIO_DREFM : R/W ;bitpos:[11:10] ;default: 2'b0 ; */ -/*description: */ -#define EFUSE_SDIO_DREFM 0x00000003 -#define EFUSE_SDIO_DREFM_M ((EFUSE_SDIO_DREFM_V)<<(EFUSE_SDIO_DREFM_S)) -#define EFUSE_SDIO_DREFM_V 0x3 -#define EFUSE_SDIO_DREFM_S 10 -/* EFUSE_SDIO_DREFH : R/W ;bitpos:[9:8] ;default: 2'b0 ; */ -/*description: */ -#define EFUSE_SDIO_DREFH 0x00000003 -#define EFUSE_SDIO_DREFH_M ((EFUSE_SDIO_DREFH_V)<<(EFUSE_SDIO_DREFH_S)) -#define EFUSE_SDIO_DREFH_V 0x3 -#define EFUSE_SDIO_DREFH_S 8 -/* EFUSE_CK8M_FREQ : R/W ;bitpos:[7:0] ;default: 8'b0 ; */ -/*description: */ -#define EFUSE_CK8M_FREQ 0x000000FF -#define EFUSE_CK8M_FREQ_M ((EFUSE_CK8M_FREQ_V)<<(EFUSE_CK8M_FREQ_S)) -#define EFUSE_CK8M_FREQ_V 0xFF -#define EFUSE_CK8M_FREQ_S 0 - -#define EFUSE_BLK0_WDATA5_REG (DR_REG_EFUSE_BASE + 0x030) -/* EFUSE_FLASH_CRYPT_CONFIG : R/W ;bitpos:[31:28] ;default: 4'b0 ; */ -/*description: program for flash_crypt_config*/ -#define EFUSE_FLASH_CRYPT_CONFIG 0x0000000F -#define EFUSE_FLASH_CRYPT_CONFIG_M ((EFUSE_FLASH_CRYPT_CONFIG_V)<<(EFUSE_FLASH_CRYPT_CONFIG_S)) -#define EFUSE_FLASH_CRYPT_CONFIG_V 0xF -#define EFUSE_FLASH_CRYPT_CONFIG_S 28 -/* EFUSE_INST_CONFIG : R/W ;bitpos:[27:20] ;default: 8'b0 ; */ -/*description: */ -#define EFUSE_INST_CONFIG 0x000000FF -#define EFUSE_INST_CONFIG_M ((EFUSE_INST_CONFIG_V)<<(EFUSE_INST_CONFIG_S)) -#define EFUSE_INST_CONFIG_V 0xFF -#define EFUSE_INST_CONFIG_S 20 -/* EFUSE_SPI_PAD_CONFIG_CS0 : R/W ;bitpos:[19:15] ;default: 5'b0 ; */ -/*description: program for SPI_pad_config_cs0*/ -#define EFUSE_SPI_PAD_CONFIG_CS0 0x0000001F -#define EFUSE_SPI_PAD_CONFIG_CS0_M ((EFUSE_SPI_PAD_CONFIG_CS0_V)<<(EFUSE_SPI_PAD_CONFIG_CS0_S)) -#define EFUSE_SPI_PAD_CONFIG_CS0_V 0x1F -#define EFUSE_SPI_PAD_CONFIG_CS0_S 15 -/* EFUSE_SPI_PAD_CONFIG_D : R/W ;bitpos:[14:10] ;default: 5'b0 ; */ -/*description: program for SPI_pad_config_d*/ -#define EFUSE_SPI_PAD_CONFIG_D 0x0000001F -#define EFUSE_SPI_PAD_CONFIG_D_M ((EFUSE_SPI_PAD_CONFIG_D_V)<<(EFUSE_SPI_PAD_CONFIG_D_S)) -#define EFUSE_SPI_PAD_CONFIG_D_V 0x1F -#define EFUSE_SPI_PAD_CONFIG_D_S 10 -/* EFUSE_SPI_PAD_CONFIG_Q : R/W ;bitpos:[9:5] ;default: 5'b0 ; */ -/*description: program for SPI_pad_config_q*/ -#define EFUSE_SPI_PAD_CONFIG_Q 0x0000001F -#define EFUSE_SPI_PAD_CONFIG_Q_M ((EFUSE_SPI_PAD_CONFIG_Q_V)<<(EFUSE_SPI_PAD_CONFIG_Q_S)) -#define EFUSE_SPI_PAD_CONFIG_Q_V 0x1F -#define EFUSE_SPI_PAD_CONFIG_Q_S 5 -/* EFUSE_SPI_PAD_CONFIG_CLK : R/W ;bitpos:[4:0] ;default: 5'b0 ; */ -/*description: program for SPI_pad_config_clk*/ -#define EFUSE_SPI_PAD_CONFIG_CLK 0x0000001F -#define EFUSE_SPI_PAD_CONFIG_CLK_M ((EFUSE_SPI_PAD_CONFIG_CLK_V)<<(EFUSE_SPI_PAD_CONFIG_CLK_S)) -#define EFUSE_SPI_PAD_CONFIG_CLK_V 0x1F -#define EFUSE_SPI_PAD_CONFIG_CLK_S 0 - -#define EFUSE_BLK0_WDATA6_REG (DR_REG_EFUSE_BASE + 0x034) -/* EFUSE_KEY_STATUS : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: program for key_status*/ -#define EFUSE_KEY_STATUS (BIT(10)) -#define EFUSE_KEY_STATUS_M (BIT(10)) -#define EFUSE_KEY_STATUS_V 0x1 -#define EFUSE_KEY_STATUS_S 10 -/* EFUSE_DISABLE_DL_CACHE : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: program for download_dis_cache*/ -#define EFUSE_DISABLE_DL_CACHE (BIT(9)) -#define EFUSE_DISABLE_DL_CACHE_M (BIT(9)) -#define EFUSE_DISABLE_DL_CACHE_V 0x1 -#define EFUSE_DISABLE_DL_CACHE_S 9 -/* EFUSE_DISABLE_DL_DECRYPT : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: program for download_dis_decrypt*/ -#define EFUSE_DISABLE_DL_DECRYPT (BIT(8)) -#define EFUSE_DISABLE_DL_DECRYPT_M (BIT(8)) -#define EFUSE_DISABLE_DL_DECRYPT_V 0x1 -#define EFUSE_DISABLE_DL_DECRYPT_S 8 -/* EFUSE_DISABLE_DL_ENCRYPT : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: program for download_dis_encrypt*/ -#define EFUSE_DISABLE_DL_ENCRYPT (BIT(7)) -#define EFUSE_DISABLE_DL_ENCRYPT_M (BIT(7)) -#define EFUSE_DISABLE_DL_ENCRYPT_V 0x1 -#define EFUSE_DISABLE_DL_ENCRYPT_S 7 -/* EFUSE_DISABLE_JTAG : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: program for JTAG_disable*/ -#define EFUSE_DISABLE_JTAG (BIT(6)) -#define EFUSE_DISABLE_JTAG_M (BIT(6)) -#define EFUSE_DISABLE_JTAG_V 0x1 -#define EFUSE_DISABLE_JTAG_S 6 -/* EFUSE_ABS_DONE_1 : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: program for abstract_done_1*/ -#define EFUSE_ABS_DONE_1 (BIT(5)) -#define EFUSE_ABS_DONE_1_M (BIT(5)) -#define EFUSE_ABS_DONE_1_V 0x1 -#define EFUSE_ABS_DONE_1_S 5 -/* EFUSE_ABS_DONE_0 : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: program for abstract_done_0*/ -#define EFUSE_ABS_DONE_0 (BIT(4)) -#define EFUSE_ABS_DONE_0_M (BIT(4)) -#define EFUSE_ABS_DONE_0_V 0x1 -#define EFUSE_ABS_DONE_0_S 4 -/* EFUSE_DISABLE_SDIO_HOST : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define EFUSE_DISABLE_SDIO_HOST (BIT(3)) -#define EFUSE_DISABLE_SDIO_HOST_M (BIT(3)) -#define EFUSE_DISABLE_SDIO_HOST_V 0x1 -#define EFUSE_DISABLE_SDIO_HOST_S 3 -/* EFUSE_CONSOLE_DEBUG_DISABLE : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: program for console_debug_disable*/ -#define EFUSE_CONSOLE_DEBUG_DISABLE (BIT(2)) -#define EFUSE_CONSOLE_DEBUG_DISABLE_M (BIT(2)) -#define EFUSE_CONSOLE_DEBUG_DISABLE_V 0x1 -#define EFUSE_CONSOLE_DEBUG_DISABLE_S 2 -/* EFUSE_CODING_SCHEME : R/W ;bitpos:[1:0] ;default: 2'b0 ; */ -/*description: program for coding_scheme*/ -#define EFUSE_CODING_SCHEME 0x00000003 -#define EFUSE_CODING_SCHEME_M ((EFUSE_CODING_SCHEME_V)<<(EFUSE_CODING_SCHEME_S)) -#define EFUSE_CODING_SCHEME_V 0x3 -#define EFUSE_CODING_SCHEME_S 0 - -#define EFUSE_BLK1_RDATA0_REG (DR_REG_EFUSE_BASE + 0x038) -/* EFUSE_BLK1_DOUT0 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: read for BLOCK1*/ -#define EFUSE_BLK1_DOUT0 0xFFFFFFFF -#define EFUSE_BLK1_DOUT0_M ((EFUSE_BLK1_DOUT0_V)<<(EFUSE_BLK1_DOUT0_S)) -#define EFUSE_BLK1_DOUT0_V 0xFFFFFFFF -#define EFUSE_BLK1_DOUT0_S 0 - -#define EFUSE_BLK1_RDATA1_REG (DR_REG_EFUSE_BASE + 0x03c) -/* EFUSE_BLK1_DOUT1 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: read for BLOCK1*/ -#define EFUSE_BLK1_DOUT1 0xFFFFFFFF -#define EFUSE_BLK1_DOUT1_M ((EFUSE_BLK1_DOUT1_V)<<(EFUSE_BLK1_DOUT1_S)) -#define EFUSE_BLK1_DOUT1_V 0xFFFFFFFF -#define EFUSE_BLK1_DOUT1_S 0 - -#define EFUSE_BLK1_RDATA2_REG (DR_REG_EFUSE_BASE + 0x040) -/* EFUSE_BLK1_DOUT2 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: read for BLOCK1*/ -#define EFUSE_BLK1_DOUT2 0xFFFFFFFF -#define EFUSE_BLK1_DOUT2_M ((EFUSE_BLK1_DOUT2_V)<<(EFUSE_BLK1_DOUT2_S)) -#define EFUSE_BLK1_DOUT2_V 0xFFFFFFFF -#define EFUSE_BLK1_DOUT2_S 0 - -#define EFUSE_BLK1_RDATA3_REG (DR_REG_EFUSE_BASE + 0x044) -/* EFUSE_BLK1_DOUT3 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: read for BLOCK1*/ -#define EFUSE_BLK1_DOUT3 0xFFFFFFFF -#define EFUSE_BLK1_DOUT3_M ((EFUSE_BLK1_DOUT3_V)<<(EFUSE_BLK1_DOUT3_S)) -#define EFUSE_BLK1_DOUT3_V 0xFFFFFFFF -#define EFUSE_BLK1_DOUT3_S 0 - -#define EFUSE_BLK1_RDATA4_REG (DR_REG_EFUSE_BASE + 0x048) -/* EFUSE_BLK1_DOUT4 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: read for BLOCK1*/ -#define EFUSE_BLK1_DOUT4 0xFFFFFFFF -#define EFUSE_BLK1_DOUT4_M ((EFUSE_BLK1_DOUT4_V)<<(EFUSE_BLK1_DOUT4_S)) -#define EFUSE_BLK1_DOUT4_V 0xFFFFFFFF -#define EFUSE_BLK1_DOUT4_S 0 - -#define EFUSE_BLK1_RDATA5_REG (DR_REG_EFUSE_BASE + 0x04c) -/* EFUSE_BLK1_DOUT5 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: read for BLOCK1*/ -#define EFUSE_BLK1_DOUT5 0xFFFFFFFF -#define EFUSE_BLK1_DOUT5_M ((EFUSE_BLK1_DOUT5_V)<<(EFUSE_BLK1_DOUT5_S)) -#define EFUSE_BLK1_DOUT5_V 0xFFFFFFFF -#define EFUSE_BLK1_DOUT5_S 0 - -#define EFUSE_BLK1_RDATA6_REG (DR_REG_EFUSE_BASE + 0x050) -/* EFUSE_BLK1_DOUT6 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: read for BLOCK1*/ -#define EFUSE_BLK1_DOUT6 0xFFFFFFFF -#define EFUSE_BLK1_DOUT6_M ((EFUSE_BLK1_DOUT6_V)<<(EFUSE_BLK1_DOUT6_S)) -#define EFUSE_BLK1_DOUT6_V 0xFFFFFFFF -#define EFUSE_BLK1_DOUT6_S 0 - -#define EFUSE_BLK1_RDATA7_REG (DR_REG_EFUSE_BASE + 0x054) -/* EFUSE_BLK1_DOUT7 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: read for BLOCK1*/ -#define EFUSE_BLK1_DOUT7 0xFFFFFFFF -#define EFUSE_BLK1_DOUT7_M ((EFUSE_BLK1_DOUT7_V)<<(EFUSE_BLK1_DOUT7_S)) -#define EFUSE_BLK1_DOUT7_V 0xFFFFFFFF -#define EFUSE_BLK1_DOUT7_S 0 - -#define EFUSE_BLK2_RDATA0_REG (DR_REG_EFUSE_BASE + 0x058) -/* EFUSE_BLK2_DOUT0 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: read for BLOCK2*/ -#define EFUSE_BLK2_DOUT0 0xFFFFFFFF -#define EFUSE_BLK2_DOUT0_M ((EFUSE_BLK2_DOUT0_V)<<(EFUSE_BLK2_DOUT0_S)) -#define EFUSE_BLK2_DOUT0_V 0xFFFFFFFF -#define EFUSE_BLK2_DOUT0_S 0 - -#define EFUSE_BLK2_RDATA1_REG (DR_REG_EFUSE_BASE + 0x05c) -/* EFUSE_BLK2_DOUT1 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: read for BLOCK2*/ -#define EFUSE_BLK2_DOUT1 0xFFFFFFFF -#define EFUSE_BLK2_DOUT1_M ((EFUSE_BLK2_DOUT1_V)<<(EFUSE_BLK2_DOUT1_S)) -#define EFUSE_BLK2_DOUT1_V 0xFFFFFFFF -#define EFUSE_BLK2_DOUT1_S 0 - -#define EFUSE_BLK2_RDATA2_REG (DR_REG_EFUSE_BASE + 0x060) -/* EFUSE_BLK2_DOUT2 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: read for BLOCK2*/ -#define EFUSE_BLK2_DOUT2 0xFFFFFFFF -#define EFUSE_BLK2_DOUT2_M ((EFUSE_BLK2_DOUT2_V)<<(EFUSE_BLK2_DOUT2_S)) -#define EFUSE_BLK2_DOUT2_V 0xFFFFFFFF -#define EFUSE_BLK2_DOUT2_S 0 - -#define EFUSE_BLK2_RDATA3_REG (DR_REG_EFUSE_BASE + 0x064) -/* EFUSE_BLK2_DOUT3 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: read for BLOCK2*/ -#define EFUSE_BLK2_DOUT3 0xFFFFFFFF -#define EFUSE_BLK2_DOUT3_M ((EFUSE_BLK2_DOUT3_V)<<(EFUSE_BLK2_DOUT3_S)) -#define EFUSE_BLK2_DOUT3_V 0xFFFFFFFF -#define EFUSE_BLK2_DOUT3_S 0 - -#define EFUSE_BLK2_RDATA4_REG (DR_REG_EFUSE_BASE + 0x068) -/* EFUSE_BLK2_DOUT4 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: read for BLOCK2*/ -#define EFUSE_BLK2_DOUT4 0xFFFFFFFF -#define EFUSE_BLK2_DOUT4_M ((EFUSE_BLK2_DOUT4_V)<<(EFUSE_BLK2_DOUT4_S)) -#define EFUSE_BLK2_DOUT4_V 0xFFFFFFFF -#define EFUSE_BLK2_DOUT4_S 0 - -#define EFUSE_BLK2_RDATA5_REG (DR_REG_EFUSE_BASE + 0x06c) -/* EFUSE_BLK2_DOUT5 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: read for BLOCK2*/ -#define EFUSE_BLK2_DOUT5 0xFFFFFFFF -#define EFUSE_BLK2_DOUT5_M ((EFUSE_BLK2_DOUT5_V)<<(EFUSE_BLK2_DOUT5_S)) -#define EFUSE_BLK2_DOUT5_V 0xFFFFFFFF -#define EFUSE_BLK2_DOUT5_S 0 - -#define EFUSE_BLK2_RDATA6_REG (DR_REG_EFUSE_BASE + 0x070) -/* EFUSE_BLK2_DOUT6 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: read for BLOCK2*/ -#define EFUSE_BLK2_DOUT6 0xFFFFFFFF -#define EFUSE_BLK2_DOUT6_M ((EFUSE_BLK2_DOUT6_V)<<(EFUSE_BLK2_DOUT6_S)) -#define EFUSE_BLK2_DOUT6_V 0xFFFFFFFF -#define EFUSE_BLK2_DOUT6_S 0 - -#define EFUSE_BLK2_RDATA7_REG (DR_REG_EFUSE_BASE + 0x074) -/* EFUSE_BLK2_DOUT7 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: read for BLOCK2*/ -#define EFUSE_BLK2_DOUT7 0xFFFFFFFF -#define EFUSE_BLK2_DOUT7_M ((EFUSE_BLK2_DOUT7_V)<<(EFUSE_BLK2_DOUT7_S)) -#define EFUSE_BLK2_DOUT7_V 0xFFFFFFFF -#define EFUSE_BLK2_DOUT7_S 0 - -#define EFUSE_BLK3_RDATA0_REG (DR_REG_EFUSE_BASE + 0x078) -/* EFUSE_BLK3_DOUT0 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: read for BLOCK3*/ -#define EFUSE_BLK3_DOUT0 0xFFFFFFFF -#define EFUSE_BLK3_DOUT0_M ((EFUSE_BLK3_DOUT0_V)<<(EFUSE_BLK3_DOUT0_S)) -#define EFUSE_BLK3_DOUT0_V 0xFFFFFFFF -#define EFUSE_BLK3_DOUT0_S 0 - -#define EFUSE_BLK3_RDATA1_REG (DR_REG_EFUSE_BASE + 0x07c) -/* EFUSE_BLK3_DOUT1 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: read for BLOCK3*/ -#define EFUSE_BLK3_DOUT1 0xFFFFFFFF -#define EFUSE_BLK3_DOUT1_M ((EFUSE_BLK3_DOUT1_V)<<(EFUSE_BLK3_DOUT1_S)) -#define EFUSE_BLK3_DOUT1_V 0xFFFFFFFF -#define EFUSE_BLK3_DOUT1_S 0 - -#define EFUSE_BLK3_RDATA2_REG (DR_REG_EFUSE_BASE + 0x080) -/* EFUSE_BLK3_DOUT2 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: read for BLOCK3*/ -#define EFUSE_BLK3_DOUT2 0xFFFFFFFF -#define EFUSE_BLK3_DOUT2_M ((EFUSE_BLK3_DOUT2_V)<<(EFUSE_BLK3_DOUT2_S)) -#define EFUSE_BLK3_DOUT2_V 0xFFFFFFFF -#define EFUSE_BLK3_DOUT2_S 0 - -/* Note: Newer ESP32s utilize BLK3_DATA3 and parts of BLK3_DATA4 for calibration - * purposes. This usage is indicated by the EFUSE_RD_BLK3_PART_RESERVE bit.*/ -#define EFUSE_BLK3_RDATA3_REG (DR_REG_EFUSE_BASE + 0x084) -/* EFUSE_BLK3_DOUT3 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: read for BLOCK3*/ -#define EFUSE_BLK3_DOUT3 0xFFFFFFFF -#define EFUSE_BLK3_DOUT3_M ((EFUSE_BLK3_DOUT3_V)<<(EFUSE_BLK3_DOUT3_S)) -#define EFUSE_BLK3_DOUT3_V 0xFFFFFFFF -#define EFUSE_BLK3_DOUT3_S 0 -/* EFUSE_RD_ADC2_TP_HIGH : R/W ;bitpos:[31:23] ;default: 9'b0 ; */ -/*description: ADC2 Two Point calibration high point. Only valid if EFUSE_RD_BLK3_PART_RESERVE */ -#define EFUSE_RD_ADC2_TP_HIGH 0x1FF -#define EFUSE_RD_ADC2_TP_HIGH_M ((EFUSE_RD_ADC2_TP_HIGH_V)<<(EFUSE_RD_ADC2_TP_HIGH_S)) -#define EFUSE_RD_ADC2_TP_HIGH_V 0x1FF -#define EFUSE_RD_ADC2_TP_HIGH_S 23 -/* EFUSE_RD_ADC2_TP_LOW : R/W ;bitpos:[22:16] ;default: 7'b0 ; */ -/*description: ADC2 Two Point calibration low point. Only valid if EFUSE_RD_BLK3_PART_RESERVE */ -#define EFUSE_RD_ADC2_TP_LOW 0x7F -#define EFUSE_RD_ADC2_TP_LOW_M ((EFUSE_RD_ADC2_TP_LOW_V)<<(EFUSE_RD_ADC2_TP_LOW_S)) -#define EFUSE_RD_ADC2_TP_LOW_V 0x7F -#define EFUSE_RD_ADC2_TP_LOW_S 16 -/* EFUSE_RD_ADC1_TP_HIGH : R/W ;bitpos:[15:7] ;default: 9'b0 ; */ -/*description: ADC1 Two Point calibration high point. Only valid if EFUSE_RD_BLK3_PART_RESERVE */ -#define EFUSE_RD_ADC1_TP_HIGH 0x1FF -#define EFUSE_RD_ADC1_TP_HIGH_M ((EFUSE_RD_ADC1_TP_HIGH_V)<<(EFUSE_RD_ADC1_TP_HIGH_S)) -#define EFUSE_RD_ADC1_TP_HIGH_V 0x1FF -#define EFUSE_RD_ADC1_TP_HIGH_S 7 -/* EFUSE_RD_ADC1_TP_LOW : R/W ;bitpos:[6:0] ;default: 7'b0 ; */ -/*description: ADC1 Two Point calibration low point. Only valid if EFUSE_RD_BLK3_PART_RESERVE */ -#define EFUSE_RD_ADC1_TP_LOW 0x7F -#define EFUSE_RD_ADC1_TP_LOW_M ((EFUSE_RD_ADC1_TP_LOW_V)<<(EFUSE_RD_ADC1_TP_LOW_S)) -#define EFUSE_RD_ADC1_TP_LOW_V 0x7F -#define EFUSE_RD_ADC1_TP_LOW_S 0 - -#define EFUSE_BLK3_RDATA4_REG (DR_REG_EFUSE_BASE + 0x088) -/* EFUSE_BLK3_DOUT4 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: read for BLOCK3*/ -#define EFUSE_BLK3_DOUT4 0xFFFFFFFF -#define EFUSE_BLK3_DOUT4_M ((EFUSE_BLK3_DOUT4_V)<<(EFUSE_BLK3_DOUT4_S)) -#define EFUSE_BLK3_DOUT4_V 0xFFFFFFFF -#define EFUSE_BLK3_DOUT4_S 0 -/* EFUSE_RD_CAL_RESERVED: R/W ; bitpos:[0:15] ; default : 16'h0 ; */ -/*description: Reserved for future calibration use. Indicated by EFUSE_RD_BLK3_PART_RESERVE */ -#define EFUSE_RD_CAL_RESERVED 0x0000FFFF -#define EFUSE_RD_CAL_RESERVED_M ((EFUSE_RD_CAL_RESERVED_V)<<(EFUSE_RD_CAL_RESERVED_S)) -#define EFUSE_RD_CAL_RESERVED_V 0xFFFF -#define EFUSE_RD_CAL_RESERVED_S 0 - -#define EFUSE_BLK3_RDATA5_REG (DR_REG_EFUSE_BASE + 0x08c) -/* EFUSE_BLK3_DOUT5 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: read for BLOCK3*/ -#define EFUSE_BLK3_DOUT5 0xFFFFFFFF -#define EFUSE_BLK3_DOUT5_M ((EFUSE_BLK3_DOUT5_V)<<(EFUSE_BLK3_DOUT5_S)) -#define EFUSE_BLK3_DOUT5_V 0xFFFFFFFF -#define EFUSE_BLK3_DOUT5_S 0 - -#define EFUSE_BLK3_RDATA6_REG (DR_REG_EFUSE_BASE + 0x090) -/* EFUSE_BLK3_DOUT6 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: read for BLOCK3*/ -#define EFUSE_BLK3_DOUT6 0xFFFFFFFF -#define EFUSE_BLK3_DOUT6_M ((EFUSE_BLK3_DOUT6_V)<<(EFUSE_BLK3_DOUT6_S)) -#define EFUSE_BLK3_DOUT6_V 0xFFFFFFFF -#define EFUSE_BLK3_DOUT6_S 0 - -#define EFUSE_BLK3_RDATA7_REG (DR_REG_EFUSE_BASE + 0x094) -/* EFUSE_BLK3_DOUT7 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: read for BLOCK3*/ -#define EFUSE_BLK3_DOUT7 0xFFFFFFFF -#define EFUSE_BLK3_DOUT7_M ((EFUSE_BLK3_DOUT7_V)<<(EFUSE_BLK3_DOUT7_S)) -#define EFUSE_BLK3_DOUT7_V 0xFFFFFFFF -#define EFUSE_BLK3_DOUT7_S 0 - -#define EFUSE_BLK1_WDATA0_REG (DR_REG_EFUSE_BASE + 0x098) -/* EFUSE_BLK1_DIN0 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: program for BLOCK1*/ -#define EFUSE_BLK1_DIN0 0xFFFFFFFF -#define EFUSE_BLK1_DIN0_M ((EFUSE_BLK1_DIN0_V)<<(EFUSE_BLK1_DIN0_S)) -#define EFUSE_BLK1_DIN0_V 0xFFFFFFFF -#define EFUSE_BLK1_DIN0_S 0 - -#define EFUSE_BLK1_WDATA1_REG (DR_REG_EFUSE_BASE + 0x09c) -/* EFUSE_BLK1_DIN1 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: program for BLOCK1*/ -#define EFUSE_BLK1_DIN1 0xFFFFFFFF -#define EFUSE_BLK1_DIN1_M ((EFUSE_BLK1_DIN1_V)<<(EFUSE_BLK1_DIN1_S)) -#define EFUSE_BLK1_DIN1_V 0xFFFFFFFF -#define EFUSE_BLK1_DIN1_S 0 - -#define EFUSE_BLK1_WDATA2_REG (DR_REG_EFUSE_BASE + 0x0a0) -/* EFUSE_BLK1_DIN2 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: program for BLOCK1*/ -#define EFUSE_BLK1_DIN2 0xFFFFFFFF -#define EFUSE_BLK1_DIN2_M ((EFUSE_BLK1_DIN2_V)<<(EFUSE_BLK1_DIN2_S)) -#define EFUSE_BLK1_DIN2_V 0xFFFFFFFF -#define EFUSE_BLK1_DIN2_S 0 - -#define EFUSE_BLK1_WDATA3_REG (DR_REG_EFUSE_BASE + 0x0a4) -/* EFUSE_BLK1_DIN3 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: program for BLOCK1*/ -#define EFUSE_BLK1_DIN3 0xFFFFFFFF -#define EFUSE_BLK1_DIN3_M ((EFUSE_BLK1_DIN3_V)<<(EFUSE_BLK1_DIN3_S)) -#define EFUSE_BLK1_DIN3_V 0xFFFFFFFF -#define EFUSE_BLK1_DIN3_S 0 - -#define EFUSE_BLK1_WDATA4_REG (DR_REG_EFUSE_BASE + 0x0a8) -/* EFUSE_BLK1_DIN4 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: program for BLOCK1*/ -#define EFUSE_BLK1_DIN4 0xFFFFFFFF -#define EFUSE_BLK1_DIN4_M ((EFUSE_BLK1_DIN4_V)<<(EFUSE_BLK1_DIN4_S)) -#define EFUSE_BLK1_DIN4_V 0xFFFFFFFF -#define EFUSE_BLK1_DIN4_S 0 - -#define EFUSE_BLK1_WDATA5_REG (DR_REG_EFUSE_BASE + 0x0ac) -/* EFUSE_BLK1_DIN5 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: program for BLOCK1*/ -#define EFUSE_BLK1_DIN5 0xFFFFFFFF -#define EFUSE_BLK1_DIN5_M ((EFUSE_BLK1_DIN5_V)<<(EFUSE_BLK1_DIN5_S)) -#define EFUSE_BLK1_DIN5_V 0xFFFFFFFF -#define EFUSE_BLK1_DIN5_S 0 - -#define EFUSE_BLK1_WDATA6_REG (DR_REG_EFUSE_BASE + 0x0b0) -/* EFUSE_BLK1_DIN6 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: program for BLOCK1*/ -#define EFUSE_BLK1_DIN6 0xFFFFFFFF -#define EFUSE_BLK1_DIN6_M ((EFUSE_BLK1_DIN6_V)<<(EFUSE_BLK1_DIN6_S)) -#define EFUSE_BLK1_DIN6_V 0xFFFFFFFF -#define EFUSE_BLK1_DIN6_S 0 - -#define EFUSE_BLK1_WDATA7_REG (DR_REG_EFUSE_BASE + 0x0b4) -/* EFUSE_BLK1_DIN7 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: program for BLOCK1*/ -#define EFUSE_BLK1_DIN7 0xFFFFFFFF -#define EFUSE_BLK1_DIN7_M ((EFUSE_BLK1_DIN7_V)<<(EFUSE_BLK1_DIN7_S)) -#define EFUSE_BLK1_DIN7_V 0xFFFFFFFF -#define EFUSE_BLK1_DIN7_S 0 - -#define EFUSE_BLK2_WDATA0_REG (DR_REG_EFUSE_BASE + 0x0b8) -/* EFUSE_BLK2_DIN0 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: program for BLOCK2*/ -#define EFUSE_BLK2_DIN0 0xFFFFFFFF -#define EFUSE_BLK2_DIN0_M ((EFUSE_BLK2_DIN0_V)<<(EFUSE_BLK2_DIN0_S)) -#define EFUSE_BLK2_DIN0_V 0xFFFFFFFF -#define EFUSE_BLK2_DIN0_S 0 - -#define EFUSE_BLK2_WDATA1_REG (DR_REG_EFUSE_BASE + 0x0bc) -/* EFUSE_BLK2_DIN1 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: program for BLOCK2*/ -#define EFUSE_BLK2_DIN1 0xFFFFFFFF -#define EFUSE_BLK2_DIN1_M ((EFUSE_BLK2_DIN1_V)<<(EFUSE_BLK2_DIN1_S)) -#define EFUSE_BLK2_DIN1_V 0xFFFFFFFF -#define EFUSE_BLK2_DIN1_S 0 - -#define EFUSE_BLK2_WDATA2_REG (DR_REG_EFUSE_BASE + 0x0c0) -/* EFUSE_BLK2_DIN2 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: program for BLOCK2*/ -#define EFUSE_BLK2_DIN2 0xFFFFFFFF -#define EFUSE_BLK2_DIN2_M ((EFUSE_BLK2_DIN2_V)<<(EFUSE_BLK2_DIN2_S)) -#define EFUSE_BLK2_DIN2_V 0xFFFFFFFF -#define EFUSE_BLK2_DIN2_S 0 - -#define EFUSE_BLK2_WDATA3_REG (DR_REG_EFUSE_BASE + 0x0c4) -/* EFUSE_BLK2_DIN3 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: program for BLOCK2*/ -#define EFUSE_BLK2_DIN3 0xFFFFFFFF -#define EFUSE_BLK2_DIN3_M ((EFUSE_BLK2_DIN3_V)<<(EFUSE_BLK2_DIN3_S)) -#define EFUSE_BLK2_DIN3_V 0xFFFFFFFF -#define EFUSE_BLK2_DIN3_S 0 - -#define EFUSE_BLK2_WDATA4_REG (DR_REG_EFUSE_BASE + 0x0c8) -/* EFUSE_BLK2_DIN4 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: program for BLOCK2*/ -#define EFUSE_BLK2_DIN4 0xFFFFFFFF -#define EFUSE_BLK2_DIN4_M ((EFUSE_BLK2_DIN4_V)<<(EFUSE_BLK2_DIN4_S)) -#define EFUSE_BLK2_DIN4_V 0xFFFFFFFF -#define EFUSE_BLK2_DIN4_S 0 - -#define EFUSE_BLK2_WDATA5_REG (DR_REG_EFUSE_BASE + 0x0cc) -/* EFUSE_BLK2_DIN5 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: program for BLOCK2*/ -#define EFUSE_BLK2_DIN5 0xFFFFFFFF -#define EFUSE_BLK2_DIN5_M ((EFUSE_BLK2_DIN5_V)<<(EFUSE_BLK2_DIN5_S)) -#define EFUSE_BLK2_DIN5_V 0xFFFFFFFF -#define EFUSE_BLK2_DIN5_S 0 - -#define EFUSE_BLK2_WDATA6_REG (DR_REG_EFUSE_BASE + 0x0d0) -/* EFUSE_BLK2_DIN6 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: program for BLOCK2*/ -#define EFUSE_BLK2_DIN6 0xFFFFFFFF -#define EFUSE_BLK2_DIN6_M ((EFUSE_BLK2_DIN6_V)<<(EFUSE_BLK2_DIN6_S)) -#define EFUSE_BLK2_DIN6_V 0xFFFFFFFF -#define EFUSE_BLK2_DIN6_S 0 - -#define EFUSE_BLK2_WDATA7_REG (DR_REG_EFUSE_BASE + 0x0d4) -/* EFUSE_BLK2_DIN7 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: program for BLOCK2*/ -#define EFUSE_BLK2_DIN7 0xFFFFFFFF -#define EFUSE_BLK2_DIN7_M ((EFUSE_BLK2_DIN7_V)<<(EFUSE_BLK2_DIN7_S)) -#define EFUSE_BLK2_DIN7_V 0xFFFFFFFF -#define EFUSE_BLK2_DIN7_S 0 - -#define EFUSE_BLK3_WDATA0_REG (DR_REG_EFUSE_BASE + 0x0d8) -/* EFUSE_BLK3_DIN0 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: program for BLOCK3*/ -#define EFUSE_BLK3_DIN0 0xFFFFFFFF -#define EFUSE_BLK3_DIN0_M ((EFUSE_BLK3_DIN0_V)<<(EFUSE_BLK3_DIN0_S)) -#define EFUSE_BLK3_DIN0_V 0xFFFFFFFF -#define EFUSE_BLK3_DIN0_S 0 - -#define EFUSE_BLK3_WDATA1_REG (DR_REG_EFUSE_BASE + 0x0dc) -/* EFUSE_BLK3_DIN1 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: program for BLOCK3*/ -#define EFUSE_BLK3_DIN1 0xFFFFFFFF -#define EFUSE_BLK3_DIN1_M ((EFUSE_BLK3_DIN1_V)<<(EFUSE_BLK3_DIN1_S)) -#define EFUSE_BLK3_DIN1_V 0xFFFFFFFF -#define EFUSE_BLK3_DIN1_S 0 - -#define EFUSE_BLK3_WDATA2_REG (DR_REG_EFUSE_BASE + 0x0e0) -/* EFUSE_BLK3_DIN2 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: program for BLOCK3*/ -#define EFUSE_BLK3_DIN2 0xFFFFFFFF -#define EFUSE_BLK3_DIN2_M ((EFUSE_BLK3_DIN2_V)<<(EFUSE_BLK3_DIN2_S)) -#define EFUSE_BLK3_DIN2_V 0xFFFFFFFF -#define EFUSE_BLK3_DIN2_S 0 - -/* Note: Newer ESP32s utilize BLK3_DATA3 and parts of BLK3_DATA4 for calibration - * purposes. This usage is indicated by the EFUSE_RD_BLK3_PART_RESERVE bit.*/ -#define EFUSE_BLK3_WDATA3_REG (DR_REG_EFUSE_BASE + 0x0e4) -/* EFUSE_BLK3_DIN3 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: program for BLOCK3*/ -#define EFUSE_BLK3_DIN3 0xFFFFFFFF -#define EFUSE_BLK3_DIN3_M ((EFUSE_BLK3_DIN3_V)<<(EFUSE_BLK3_DIN3_S)) -#define EFUSE_BLK3_DIN3_V 0xFFFFFFFF -#define EFUSE_BLK3_DIN3_S 0 -/* EFUSE_ADC2_TP_HIGH : R/W ;bitpos:[31:23] ;default: 9'b0 ; */ -/*description: ADC2 Two Point calibration high point. Only valid if EFUSE_RD_BLK3_PART_RESERVE */ -#define EFUSE_ADC2_TP_HIGH 0x1FF -#define EFUSE_ADC2_TP_HIGH_M ((EFUSE_ADC2_TP_HIGH_V)<<(EFUSE_ADC2_TP_HIGH_S)) -#define EFUSE_ADC2_TP_HIGH_V 0x1FF -#define EFUSE_ADC2_TP_HIGH_S 23 -/* EFUSE_ADC2_TP_LOW : R/W ;bitpos:[22:16] ;default: 7'b0 ; */ -/*description: ADC2 Two Point calibration low point. Only valid if EFUSE_RD_BLK3_PART_RESERVE */ -#define EFUSE_ADC2_TP_LOW 0x7F -#define EFUSE_ADC2_TP_LOW_M ((EFUSE_ADC2_TP_LOW_V)<<(EFUSE_ADC2_TP_LOW_S)) -#define EFUSE_ADC2_TP_LOW_V 0x7F -#define EFUSE_ADC2_TP_LOW_S 16 -/* EFUSE_ADC1_TP_HIGH : R/W ;bitpos:[15:7] ;default: 9'b0 ; */ -/*description: ADC1 Two Point calibration high point. Only valid if EFUSE_RD_BLK3_PART_RESERVE */ -#define EFUSE_ADC1_TP_HIGH 0x1FF -#define EFUSE_ADC1_TP_HIGH_M ((EFUSE_ADC1_TP_HIGH_V)<<(EFUSE_ADC1_TP_HIGH_S)) -#define EFUSE_ADC1_TP_HIGH_V 0x1FF -#define EFUSE_ADC1_TP_HIGH_S 7 -/* EFUSE_ADC1_TP_LOW : R/W ;bitpos:[6:0] ;default: 7'b0 ; */ -/*description: ADC1 Two Point calibration low point. Only valid if EFUSE_RD_BLK3_PART_RESERVE */ -#define EFUSE_ADC1_TP_LOW 0x7F -#define EFUSE_ADC1_TP_LOW_M ((EFUSE_ADC1_TP_LOW_V)<<(EFUSE_ADC1_TP_LOW_S)) -#define EFUSE_ADC1_TP_LOW_V 0x7F -#define EFUSE_ADC1_TP_LOW_S 0 - -#define EFUSE_BLK3_WDATA4_REG (DR_REG_EFUSE_BASE + 0x0e8) -/* EFUSE_BLK3_DIN4 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: program for BLOCK3*/ -#define EFUSE_BLK3_DIN4 0xFFFFFFFF -#define EFUSE_BLK3_DIN4_M ((EFUSE_BLK3_DIN4_V)<<(EFUSE_BLK3_DIN4_S)) -#define EFUSE_BLK3_DIN4_V 0xFFFFFFFF -#define EFUSE_BLK3_DIN4_S 0 -/* EFUSE_CAL_RESERVED: R/W ; bitpos:[0:15] ; default : 16'h0 ; */ -/*description: Reserved for future calibration use. Indicated by EFUSE_BLK3_PART_RESERVE */ -#define EFUSE_CAL_RESERVED 0x0000FFFF -#define EFUSE_CAL_RESERVED_M ((EFUSE_CAL_RESERVED_V)<<(EFUSE_CAL_RESERVED_S)) -#define EFUSE_CAL_RESERVED_V 0xFFFF -#define EFUSE_CAL_RESERVED_S 0 - -#define EFUSE_BLK3_WDATA5_REG (DR_REG_EFUSE_BASE + 0x0ec) -/* EFUSE_BLK3_DIN5 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: program for BLOCK3*/ -#define EFUSE_BLK3_DIN5 0xFFFFFFFF -#define EFUSE_BLK3_DIN5_M ((EFUSE_BLK3_DIN5_V)<<(EFUSE_BLK3_DIN5_S)) -#define EFUSE_BLK3_DIN5_V 0xFFFFFFFF -#define EFUSE_BLK3_DIN5_S 0 - -#define EFUSE_BLK3_WDATA6_REG (DR_REG_EFUSE_BASE + 0x0f0) -/* EFUSE_BLK3_DIN6 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: program for BLOCK3*/ -#define EFUSE_BLK3_DIN6 0xFFFFFFFF -#define EFUSE_BLK3_DIN6_M ((EFUSE_BLK3_DIN6_V)<<(EFUSE_BLK3_DIN6_S)) -#define EFUSE_BLK3_DIN6_V 0xFFFFFFFF -#define EFUSE_BLK3_DIN6_S 0 - -#define EFUSE_BLK3_WDATA7_REG (DR_REG_EFUSE_BASE + 0x0f4) -/* EFUSE_BLK3_DIN7 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: program for BLOCK3*/ -#define EFUSE_BLK3_DIN7 0xFFFFFFFF -#define EFUSE_BLK3_DIN7_M ((EFUSE_BLK3_DIN7_V)<<(EFUSE_BLK3_DIN7_S)) -#define EFUSE_BLK3_DIN7_V 0xFFFFFFFF -#define EFUSE_BLK3_DIN7_S 0 - -#define EFUSE_CLK_REG (DR_REG_EFUSE_BASE + 0x0f8) -/* EFUSE_CLK_EN : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define EFUSE_CLK_EN (BIT(16)) -#define EFUSE_CLK_EN_M (BIT(16)) -#define EFUSE_CLK_EN_V 0x1 -#define EFUSE_CLK_EN_S 16 -/* EFUSE_CLK_SEL1 : R/W ;bitpos:[15:8] ;default: 8'h40 ; */ -/*description: efuse timing configure*/ -#define EFUSE_CLK_SEL1 0x000000FF -#define EFUSE_CLK_SEL1_M ((EFUSE_CLK_SEL1_V)<<(EFUSE_CLK_SEL1_S)) -#define EFUSE_CLK_SEL1_V 0xFF -#define EFUSE_CLK_SEL1_S 8 -/* EFUSE_CLK_SEL0 : R/W ;bitpos:[7:0] ;default: 8'h52 ; */ -/*description: efuse timing configure*/ -#define EFUSE_CLK_SEL0 0x000000FF -#define EFUSE_CLK_SEL0_M ((EFUSE_CLK_SEL0_V)<<(EFUSE_CLK_SEL0_S)) -#define EFUSE_CLK_SEL0_V 0xFF -#define EFUSE_CLK_SEL0_S 0 - -#define EFUSE_CONF_REG (DR_REG_EFUSE_BASE + 0x0fc) -/* EFUSE_FORCE_NO_WR_RD_DIS : R/W ;bitpos:[16] ;default: 1'h1 ; */ -/*description: */ -#define EFUSE_FORCE_NO_WR_RD_DIS (BIT(16)) -#define EFUSE_FORCE_NO_WR_RD_DIS_M (BIT(16)) -#define EFUSE_FORCE_NO_WR_RD_DIS_V 0x1 -#define EFUSE_FORCE_NO_WR_RD_DIS_S 16 -/* EFUSE_OP_CODE : R/W ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: efuse operation code*/ -#define EFUSE_OP_CODE 0x0000FFFF -#define EFUSE_OP_CODE_M ((EFUSE_OP_CODE_V)<<(EFUSE_OP_CODE_S)) -#define EFUSE_OP_CODE_V 0xFFFF -#define EFUSE_OP_CODE_S 0 - -#define EFUSE_STATUS_REG (DR_REG_EFUSE_BASE + 0x100) -/* EFUSE_DEBUG : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define EFUSE_DEBUG 0xFFFFFFFF -#define EFUSE_DEBUG_M ((EFUSE_DEBUG_V)<<(EFUSE_DEBUG_S)) -#define EFUSE_DEBUG_V 0xFFFFFFFF -#define EFUSE_DEBUG_S 0 - -#define EFUSE_CMD_REG (DR_REG_EFUSE_BASE + 0x104) -/* EFUSE_PGM_CMD : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: command for program*/ -#define EFUSE_PGM_CMD (BIT(1)) -#define EFUSE_PGM_CMD_M (BIT(1)) -#define EFUSE_PGM_CMD_V 0x1 -#define EFUSE_PGM_CMD_S 1 -/* EFUSE_READ_CMD : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: command for read*/ -#define EFUSE_READ_CMD (BIT(0)) -#define EFUSE_READ_CMD_M (BIT(0)) -#define EFUSE_READ_CMD_V 0x1 -#define EFUSE_READ_CMD_S 0 - -#define EFUSE_INT_RAW_REG (DR_REG_EFUSE_BASE + 0x108) -/* EFUSE_PGM_DONE_INT_RAW : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: program done interrupt raw status*/ -#define EFUSE_PGM_DONE_INT_RAW (BIT(1)) -#define EFUSE_PGM_DONE_INT_RAW_M (BIT(1)) -#define EFUSE_PGM_DONE_INT_RAW_V 0x1 -#define EFUSE_PGM_DONE_INT_RAW_S 1 -/* EFUSE_READ_DONE_INT_RAW : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: read done interrupt raw status*/ -#define EFUSE_READ_DONE_INT_RAW (BIT(0)) -#define EFUSE_READ_DONE_INT_RAW_M (BIT(0)) -#define EFUSE_READ_DONE_INT_RAW_V 0x1 -#define EFUSE_READ_DONE_INT_RAW_S 0 - -#define EFUSE_INT_ST_REG (DR_REG_EFUSE_BASE + 0x10c) -/* EFUSE_PGM_DONE_INT_ST : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: program done interrupt status*/ -#define EFUSE_PGM_DONE_INT_ST (BIT(1)) -#define EFUSE_PGM_DONE_INT_ST_M (BIT(1)) -#define EFUSE_PGM_DONE_INT_ST_V 0x1 -#define EFUSE_PGM_DONE_INT_ST_S 1 -/* EFUSE_READ_DONE_INT_ST : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: read done interrupt status*/ -#define EFUSE_READ_DONE_INT_ST (BIT(0)) -#define EFUSE_READ_DONE_INT_ST_M (BIT(0)) -#define EFUSE_READ_DONE_INT_ST_V 0x1 -#define EFUSE_READ_DONE_INT_ST_S 0 - -#define EFUSE_INT_ENA_REG (DR_REG_EFUSE_BASE + 0x110) -/* EFUSE_PGM_DONE_INT_ENA : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: program done interrupt enable*/ -#define EFUSE_PGM_DONE_INT_ENA (BIT(1)) -#define EFUSE_PGM_DONE_INT_ENA_M (BIT(1)) -#define EFUSE_PGM_DONE_INT_ENA_V 0x1 -#define EFUSE_PGM_DONE_INT_ENA_S 1 -/* EFUSE_READ_DONE_INT_ENA : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: read done interrupt enable*/ -#define EFUSE_READ_DONE_INT_ENA (BIT(0)) -#define EFUSE_READ_DONE_INT_ENA_M (BIT(0)) -#define EFUSE_READ_DONE_INT_ENA_V 0x1 -#define EFUSE_READ_DONE_INT_ENA_S 0 - -#define EFUSE_INT_CLR_REG (DR_REG_EFUSE_BASE + 0x114) -/* EFUSE_PGM_DONE_INT_CLR : WO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: program done interrupt clear*/ -#define EFUSE_PGM_DONE_INT_CLR (BIT(1)) -#define EFUSE_PGM_DONE_INT_CLR_M (BIT(1)) -#define EFUSE_PGM_DONE_INT_CLR_V 0x1 -#define EFUSE_PGM_DONE_INT_CLR_S 1 -/* EFUSE_READ_DONE_INT_CLR : WO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: read done interrupt clear*/ -#define EFUSE_READ_DONE_INT_CLR (BIT(0)) -#define EFUSE_READ_DONE_INT_CLR_M (BIT(0)) -#define EFUSE_READ_DONE_INT_CLR_V 0x1 -#define EFUSE_READ_DONE_INT_CLR_S 0 - -#define EFUSE_DAC_CONF_REG (DR_REG_EFUSE_BASE + 0x118) -/* EFUSE_DAC_CLK_PAD_SEL : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define EFUSE_DAC_CLK_PAD_SEL (BIT(8)) -#define EFUSE_DAC_CLK_PAD_SEL_M (BIT(8)) -#define EFUSE_DAC_CLK_PAD_SEL_V 0x1 -#define EFUSE_DAC_CLK_PAD_SEL_S 8 -/* EFUSE_DAC_CLK_DIV : R/W ;bitpos:[7:0] ;default: 8'd40 ; */ -/*description: efuse timing configure*/ -#define EFUSE_DAC_CLK_DIV 0x000000FF -#define EFUSE_DAC_CLK_DIV_M ((EFUSE_DAC_CLK_DIV_V)<<(EFUSE_DAC_CLK_DIV_S)) -#define EFUSE_DAC_CLK_DIV_V 0xFF -#define EFUSE_DAC_CLK_DIV_S 0 - -#define EFUSE_DEC_STATUS_REG (DR_REG_EFUSE_BASE + 0x11c) -/* EFUSE_DEC_WARNINGS : RO ;bitpos:[11:0] ;default: 12'b0 ; */ -/*description: the decode result of 3/4 coding scheme has warning*/ -#define EFUSE_DEC_WARNINGS 0x00000FFF -#define EFUSE_DEC_WARNINGS_M ((EFUSE_DEC_WARNINGS_V)<<(EFUSE_DEC_WARNINGS_S)) -#define EFUSE_DEC_WARNINGS_V 0xFFF -#define EFUSE_DEC_WARNINGS_S 0 - -#define EFUSE_DATE_REG (DR_REG_EFUSE_BASE + 0x1FC) -/* EFUSE_DATE : R/W ;bitpos:[31:0] ;default: 32'h16042600 ; */ -/*description: */ -#define EFUSE_DATE 0xFFFFFFFF -#define EFUSE_DATE_M ((EFUSE_DATE_V)<<(EFUSE_DATE_S)) -#define EFUSE_DATE_V 0xFFFFFFFF -#define EFUSE_DATE_S 0 - - - - -#endif /*_SOC_EFUSE_REG_H_ */ - - diff --git a/tools/sdk/include/soc/soc/emac_ex_reg.h b/tools/sdk/include/soc/soc/emac_ex_reg.h deleted file mode 100644 index e43217e0833..00000000000 --- a/tools/sdk/include/soc/soc/emac_ex_reg.h +++ /dev/null @@ -1,161 +0,0 @@ -// 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. -#ifndef _EMAC_EX_H_ -#define _EMAC_EX_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "soc.h" -#define REG_EMAC_EX_BASE (DR_REG_EMAC_BASE + 0x800) - -#define EMAC_EX_CLKOUT_CONF_REG (REG_EMAC_EX_BASE + 0x0000) -#define EMAC_EX_CLK_OUT_DLY_NUM 0x00000003 -#define EMAC_EX_CLK_OUT_DLY_NUM_M (EMAC_EX_CLK_OUT_DLY_NUM_V << EMAC_EX_CLK_OUT_DLY_NUM_S) -#define EMAC_EX_CLK_OUT_DLY_NUM_V 0x00000003 -#define EMAC_EX_CLK_OUT_DLY_NUM_S 8 -#define EMAC_EX_CLK_OUT_H_DIV_NUM 0x0000000F -#define EMAC_EX_CLK_OUT_H_DIV_NUM_M (EMAC_EX_CLK_OUT_H_DIV_NUM_V << EMAC_EX_CLK_OUT_H_DIV_NUM_S) -#define EMAC_EX_CLK_OUT_H_DIV_NUM_V 0x0000000F -#define EMAC_EX_CLK_OUT_H_DIV_NUM_S 4 -#define EMAC_EX_CLK_OUT_DIV_NUM 0x0000000F -#define EMAC_EX_CLK_OUT_DIV_NUM_M (EMAC_EX_CLK_OUT_DIV_NUM_V << EMAC_EX_CLK_OUT_DIV_NUM_S) -#define EMAC_EX_CLK_OUT_DIV_NUM_V 0x0000000F -#define EMAC_EX_CLK_OUT_DIV_NUM_S 0 - -#define EMAC_EX_OSCCLK_CONF_REG (REG_EMAC_EX_BASE + 0x0004) -#define EMAC_EX_OSC_CLK_SEL (BIT(24)) -#define EMAC_EX_OSC_CLK_SEL_M (BIT(24)) -#define EMAC_EX_OSC_CLK_SEL_V 1 -#define EMAC_EX_OSC_CLK_SEL_S 24 -#define EMAC_EX_OSC_H_DIV_NUM_100M 0x0000003F -#define EMAC_EX_OSC_H_DIV_NUM_100M_M (EMAC_EX_OSC_H_DIV_NUM_100M_V << EMAC_EX_OSC_H_DIV_NUM_100M_S) -#define EMAC_EX_OSC_H_DIV_NUM_100M_V 0x0000003F -#define EMAC_EX_OSC_H_DIV_NUM_100M_S 18 -#define EMAC_EX_OSC_DIV_NUM_100M 0x0000003F -#define EMAC_EX_OSC_DIV_NUM_100M_M (EMAC_EX_OSC_DIV_NUM_100M_V << EMAC_EX_OSC_DIV_NUM_100M_S) -#define EMAC_EX_OSC_DIV_NUM_100M_V 0x0000003F -#define EMAC_EX_OSC_DIV_NUM_100M_S 12 -#define EMAC_EX_OSC_H_DIV_NUM_10M 0x0000003F -#define EMAC_EX_OSC_H_DIV_NUM_10M_M (EMAC_EX_OSC_H_DIV_NUM_10M_V << EMAC_EX_OSC_H_DIV_NUM_10M_S) -#define EMAC_EX_OSC_H_DIV_NUM_10M_V 0x0000003F -#define EMAC_EX_OSC_H_DIV_NUM_10M_S 6 -#define EMAC_EX_OSC_DIV_NUM_10M 0x0000003F -#define EMAC_EX_OSC_DIV_NUM_10M_M (EMAC_EX_OSC_DIV_NUM_10M_V << EMAC_EX_OSC_DIV_NUM_10M_S) -#define EMAC_EX_OSC_DIV_NUM_10M_V 0x0000003F -#define EMAC_EX_OSC_DIV_NUM_10M_S 0 - -#define EMAC_EX_CLK_CTRL_REG (REG_EMAC_EX_BASE + 0x0008) -#define EMAC_EX_CLK_EN (BIT(5)) -#define EMAC_EX_CLK_EN_M (BIT(5)) -#define EMAC_EX_CLK_EN_V 1 -#define EMAC_EX_CLK_EN_S 5 -#define EMAC_EX_MII_CLK_RX_EN (BIT(4)) -#define EMAC_EX_MII_CLK_RX_EN_M (BIT(4)) -#define EMAC_EX_MII_CLK_RX_EN_V 1 -#define EMAC_EX_MII_CLK_RX_EN_S 4 -#define EMAC_EX_MII_CLK_TX_EN (BIT(3)) -#define EMAC_EX_MII_CLK_TX_EN_M (BIT(3)) -#define EMAC_EX_MII_CLK_TX_EN_V 1 -#define EMAC_EX_MII_CLK_TX_EN_S 3 -#define EMAC_EX_RX_125_CLK_EN (BIT(2)) -#define EMAC_EX_RX_125_CLK_EN_M (BIT(2)) -#define EMAC_EX_RX_125_CLK_EN_V 1 -#define EMAC_EX_RX_125_CLK_EN_S 2 -#define EMAC_EX_INT_OSC_EN (BIT(1)) -#define EMAC_EX_INT_OSC_EN_M (BIT(1)) -#define EMAC_EX_INT_OSC_EN_V 1 -#define EMAC_EX_INT_OSC_EN_S 1 -#define EMAC_EX_EXT_OSC_EN (BIT(0)) -#define EMAC_EX_EXT_OSC_EN_M (BIT(0)) -#define EMAC_EX_EXT_OSC_EN_V 1 -#define EMAC_EX_EXT_OSC_EN_S 0 - -#define EMAC_EX_PHYINF_CONF_REG (REG_EMAC_EX_BASE + 0x000c) -#define EMAC_EX_TX_ERR_OUT_EN (BIT(20)) -#define EMAC_EX_TX_ERR_OUT_EN_M (BIT(20)) -#define EMAC_EX_TX_ERR_OUT_EN_V 1 -#define EMAC_EX_TX_ERR_OUT_EN_S 20 -#define EMAC_EX_SCR_SMI_DLY_RX_SYNC (BIT(19)) -#define EMAC_EX_SCR_SMI_DLY_RX_SYNC_M (BIT(19)) -#define EMAC_EX_SCR_SMI_DLY_RX_SYNC_V 1 -#define EMAC_EX_SCR_SMI_DLY_RX_SYNC_S 19 -#define EMAC_EX_PMT_CTRL_EN (BIT(18)) -#define EMAC_EX_PMT_CTRL_EN_M (BIT(18)) -#define EMAC_EX_PMT_CTRL_EN_V 1 -#define EMAC_EX_PMT_CTRL_EN_S 18 -#define EMAC_EX_SBD_CLK_GATING_EN (BIT(17)) -#define EMAC_EX_SBD_CLK_GATING_EN_M (BIT(17)) -#define EMAC_EX_SBD_CLK_GATING_EN_V 1 -#define EMAC_EX_SBD_CLK_GATING_EN_S 17 -#define EMAC_EX_SS_MODE (BIT(16)) -#define EMAC_EX_SS_MODE_M (BIT(16)) -#define EMAC_EX_SS_MODE_V 1 -#define EMAC_EX_SS_MODE_S 16 -#define EMAC_EX_PHY_INTF_SEL 0x00000007 -#define EMAC_EX_PHY_INTF_SEL_M (EMAC_EX_PHY_INTF_SEL_V << EMAC_EX_PHY_INTF_SEL_S) -#define EMAC_EX_PHY_INTF_SEL_V 0x00000007 -#define EMAC_EX_PHY_INTF_SEL_S 13 -#define EMAC_EX_REVMII_PHY_ADDR 0x0000001F -#define EMAC_EX_REVMII_PHY_ADDR_M (EMAC_EX_REVMII_PHY_ADDR_V << EMAC_EX_REVMII_PHY_ADDR_S) -#define EMAC_EX_REVMII_PHY_ADDR_V 0x0000001F -#define EMAC_EX_REVMII_PHY_ADDR_S 8 -#define EMAC_EX_CORE_PHY_ADDR 0x0000001F -#define EMAC_EX_CORE_PHY_ADDR_M (EMAC_EX_CORE_PHY_ADDR_V << EMAC_EX_CORE_PHY_ADDR_S) -#define EMAC_EX_CORE_PHY_ADDR_V 0x0000001F -#define EMAC_EX_CORE_PHY_ADDR_S 3 -#define EMAC_EX_SBD_FLOWCTRL (BIT(2)) -#define EMAC_EX_SBD_FLOWCTRL_M (BIT(2)) -#define EMAC_EX_SBD_FLOWCTRL_V 1 -#define EMAC_EX_SBD_FLOWCTRL_S 2 -#define EMAC_EX_EXT_REVMII_RX_CLK_SEL (BIT(1)) -#define EMAC_EX_EXT_REVMII_RX_CLK_SEL_M (BIT(1)) -#define EMAC_EX_EXT_REVMII_RX_CLK_SEL_V 1 -#define EMAC_EX_EXT_REVMII_RX_CLK_SEL_S 1 -#define EMAC_EX_INT_REVMII_RX_CLK_SEL (BIT(0)) -#define EMAC_EX_INT_REVMII_RX_CLK_SEL_M (BIT(0)) -#define EMAC_EX_INT_REVMII_RX_CLK_SEL_V 1 -#define EMAC_EX_INT_REVMII_RX_CLK_SEL_S 0 - -#define EMAC_EX_PHY_INTF_RMII 4 - -#define EMAC_EX_EMAC_PD_SEL_REG (REG_EMAC_EX_BASE + 0x0010) -#define EMAC_EX_RAM_PD_EN 0x00000003 -#define EMAC_EX_RAM_PD_EN_M (EMAC_EX_RAM_PD_EN_V << EMAC_EX_RAM_PD_EN_S) -#define EMAC_EX_RAM_PD_EN_V 0x00000003 -#define EMAC_EX_RAM_PD_EN_S 0 - -#define EMAC_EX_DATE_REG (REG_EMAC_EX_BASE + 0x00fc) -#define EMAC_EX_DATE 0xFFFFFFFF -#define EMAC_EX_DATE_M (EMAC_EX_DATE_V << EMAC_EX_DATE_S) -#define EMAC_EX_DATE_V 0xFFFFFFFF -#define EMAC_EX_DATE_S 0 -#define EMAC_EX_DATE_VERSION 0x16042200 -#define EMAC_EX_DATE_VERSION_M (EMAC_EX_DATE_VERSION_V << EMAC_EX_DATE_VERSION_S) -#define EMAC_EX_DATE_VERSION_V 0x16042200 - -#define EMAC_CLK_EN_REG 0x3ff000cc -#define EMAC_CLK_EN_REG_M (EMAC_CLK_EN_REG_V << EMAC_CLK_EN_REG_S) -#define EMAC_CLK_EN_REG_V 0x3ff000cc -#define EMAC_CLK_EN (BIT(14)) -#define EMAC_CLK_EN_M (BIT(14)) -#define EMAC_CLK_EN_V 1 - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/tools/sdk/include/soc/soc/emac_reg_v2.h b/tools/sdk/include/soc/soc/emac_reg_v2.h deleted file mode 100644 index 72af5bfe365..00000000000 --- a/tools/sdk/include/soc/soc/emac_reg_v2.h +++ /dev/null @@ -1,1460 +0,0 @@ -// 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. -#ifndef _SOC_EMAC_REG_H_ -#define _SOC_EMAC_REG_H_ - - -#ifdef __cplusplus -extern "C" { -#endif -#include "soc.h" -#define EMAC_DMABUSMODE_REG (DR_REG_EMAC_BASE + 0x0000) -/* EMAC_DMAMIXEDBURST : R/W ;bitpos:[26] ;default: 1'h0 ; */ -/*description: When this bit is set high and the FIXED_BURST bit is low the - AHB master interface starts all bursts of a length more than 16 with INCR (undefined burst) whereas it reverts to fixed burst transfers (INCRx and SINGLE) for burst length of 16 and less.*/ -#define EMAC_DMAMIXEDBURST (BIT(26)) -#define EMAC_DMAMIXEDBURST_M (BIT(26)) -#define EMAC_DMAMIXEDBURST_V 0x1 -#define EMAC_DMAMIXEDBURST_S 26 -/* EMAC_DMAADDRALIBEA : R/W ;bitpos:[25] ;default: 1'h0 ; */ -/*description: When this bit is set high and the FIXED_BURST bit is 1 the AHB - interface generates all bursts aligned to the start address LS bits. If the FIXED_BURST bit is 0 the first burst (accessing the start address of data buffer) is not aligned but subsequent bursts are aligned to the address.*/ -#define EMAC_DMAADDRALIBEA (BIT(25)) -#define EMAC_DMAADDRALIBEA_M (BIT(25)) -#define EMAC_DMAADDRALIBEA_V 0x1 -#define EMAC_DMAADDRALIBEA_S 25 -/* EMAC_PBLX8_MODE : R/W ;bitpos:[24] ;default: 1'h0 ; */ -/*description: When set high this bit multiplies the programmed PBL value (Bits[22:17] - and Bits[13:8]) eight times. Therefore the DMA transfers the data in 8 16 32 64 128 and 256 beats depending on the PBL value.*/ -#define EMAC_PBLX8_MODE (BIT(24)) -#define EMAC_PBLX8_MODE_M (BIT(24)) -#define EMAC_PBLX8_MODE_V 0x1 -#define EMAC_PBLX8_MODE_S 24 -/* EMAC_USE_SEP_PBL : R/W ;bitpos:[23] ;default: 1'h0 ; */ -/*description: When set high this bit configures the Rx DMA to use the value - configured in Bits[22:17] as PBL. The PBL value in Bits[13:8] is applicable only to the Tx DMA operations. When reset to low the PBL value in Bits[13:8] is applicable for both DMA engines.*/ -#define EMAC_USE_SEP_PBL (BIT(23)) -#define EMAC_USE_SEP_PBL_M (BIT(23)) -#define EMAC_USE_SEP_PBL_V 0x1 -#define EMAC_USE_SEP_PBL_S 23 -/* EMAC_RX_DMA_PBL : R/W ;bitpos:[22:17] ;default: 6'h1 ; */ -/*description: This field indicates the maximum number of beats to be transferred - in one Rx DMA transaction. This is the maximum value that is used in a single block Read or Write.The Rx DMA always attempts to burst as specified in the RPBL(RX_DMA_PBL) bit each time it starts a burst transfer on the host bus. You can program RPBL with values of 1 2 4 8 16 and 32. Any other value results in undefined behavior. This field is valid and applicable only when USP(USE_SEP_PBL) is set high.*/ -#define EMAC_RX_DMA_PBL 0x0000003F -#define EMAC_RX_DMA_PBL_M ((EMAC_RX_DMA_PBL_V)<<(EMAC_RX_DMA_PBL_S)) -#define EMAC_RX_DMA_PBL_V 0x3F -#define EMAC_RX_DMA_PBL_S 17 -/* EMAC_FIXED_BURST : R/W ;bitpos:[16] ;default: 1'h0 ; */ -/*description: This bit controls whether the AHB master interface performs fixed - burst transfers or not. When set the AHB interface uses only SINGLE INCR4 INCR8 or INCR16 during start of the normal burst transfers. When reset the AHB interface uses SINGLE and INCR burst transfer Operations.*/ -#define EMAC_FIXED_BURST (BIT(16)) -#define EMAC_FIXED_BURST_M (BIT(16)) -#define EMAC_FIXED_BURST_V 0x1 -#define EMAC_FIXED_BURST_S 16 -/* EMAC_PRI_RATIO : R/W ;bitpos:[15:14] ;default: 2'h0 ; */ -/*description: These bits control the priority ratio in the weighted round-robin - arbitration between the Rx DMA and Tx DMA. These bits are valid only when Bit 1 (DA) is reset. The priority ratio Rx:Tx represented by each bit: 2'b00 -- 1: 1 2'b01 -- 2: 0 2'b10 -- 3: 1 2'b11 -- 4: 1*/ -#define EMAC_PRI_RATIO 0x00000003 -#define EMAC_PRI_RATIO_M ((EMAC_PRI_RATIO_V)<<(EMAC_PRI_RATIO_S)) -#define EMAC_PRI_RATIO_V 0x3 -#define EMAC_PRI_RATIO_S 14 -/* EMAC_PROG_BURST_LEN : R/W ;bitpos:[13:8] ;default: 6'h1 ; */ -/*description: These bits indicate the maximum number of beats to be transferred - in one DMA transaction. If the number of beats to be transferred is more than 32 then perform the following steps: 1. Set the PBLx8 mode 2. Set the PBL(PROG_BURST_LEN).*/ -#define EMAC_PROG_BURST_LEN 0x0000003F -#define EMAC_PROG_BURST_LEN_M ((EMAC_PROG_BURST_LEN_V)<<(EMAC_PROG_BURST_LEN_S)) -#define EMAC_PROG_BURST_LEN_V 0x3F -#define EMAC_PROG_BURST_LEN_S 8 -/* EMAC_ALT_DESC_SIZE : R/W ;bitpos:[7] ;default: 1'h0 ; */ -/*description: When set the size of the alternate descriptor increases to 32 bytes.*/ -#define EMAC_ALT_DESC_SIZE (BIT(7)) -#define EMAC_ALT_DESC_SIZE_M (BIT(7)) -#define EMAC_ALT_DESC_SIZE_V 0x1 -#define EMAC_ALT_DESC_SIZE_S 7 -/* EMAC_DESC_SKIP_LEN : R/W ;bitpos:[6:2] ;default: 5'h0 ; */ -/*description: This bit specifies the number of Word to skip between two unchained - descriptors.The address skipping starts from the end of current descriptor to the start of next descriptor. When the DSL(DESC_SKIP_LEN) value is equal to zero the descriptor table is taken as contiguous by the DMA in Ring mode.*/ -#define EMAC_DESC_SKIP_LEN 0x0000001F -#define EMAC_DESC_SKIP_LEN_M ((EMAC_DESC_SKIP_LEN_V)<<(EMAC_DESC_SKIP_LEN_S)) -#define EMAC_DESC_SKIP_LEN_V 0x1F -#define EMAC_DESC_SKIP_LEN_S 2 -/* EMAC_DMA_ARB_SCH : R/W ;bitpos:[1] ;default: 1'h0 ; */ -/*description: This bit specifies the arbitration scheme between the transmit - and receive paths.1'b0: weighted round-robin with RX:TX or TX:RX priority specified in PR (bit[15:14]). 1'b1 Fixed priority (Rx priority to Tx).*/ -#define EMAC_DMA_ARB_SCH (BIT(1)) -#define EMAC_DMA_ARB_SCH_M (BIT(1)) -#define EMAC_DMA_ARB_SCH_V 0x1 -#define EMAC_DMA_ARB_SCH_S 1 -/* EMAC_SW_RST : R_WS_SC ;bitpos:[0] ;default: 1'h1 ; */ -/*description: When this bit is set the MAC DMA Controller resets the logic - and all internal registers of the MAC. It is cleared automatically after the reset operation is complete in all of the ETH_MAC clock domains. Before reprogramming any register of the ETH_MAC you should read a zero (0) value in this bit.*/ -#define EMAC_SW_RST (BIT(0)) -#define EMAC_SW_RST_M (BIT(0)) -#define EMAC_SW_RST_V 0x1 -#define EMAC_SW_RST_S 0 - -#define EMAC_DMATXPOLLDEMAND_REG (DR_REG_EMAC_BASE + 0x0004) -/* EMAC_TRANS_POLL_DEMAND : RO_WT ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: When these bits are written with any value the DMA reads the - current descriptor to which the Register (Current Host Transmit Descriptor Register) is pointing. If that descriptor is not available (owned by the Host) the transmission returns to the suspend state and Bit[2] (TU) of Status Register is asserted. If the descriptor is available the transmission resumes.*/ -#define EMAC_TRANS_POLL_DEMAND 0xFFFFFFFF -#define EMAC_TRANS_POLL_DEMAND_M ((EMAC_TRANS_POLL_DEMAND_V)<<(EMAC_TRANS_POLL_DEMAND_S)) -#define EMAC_TRANS_POLL_DEMAND_V 0xFFFFFFFF -#define EMAC_TRANS_POLL_DEMAND_S 0 - -#define EMAC_DMARXPOLLDEMAND_REG (DR_REG_EMAC_BASE + 0x0008) -/* EMAC_RECV_POLL_DEMAND : RO_WT ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: When these bits are written with any value the DMA reads the - current descriptor to which the Current Host Receive Descriptor Register is pointing. If that descriptor is not available (owned by the Host) the reception returns to the Suspended state and Bit[7] (RU) of Status Register is asserted. If the descriptor is available the Rx DMA returns to the active state.*/ -#define EMAC_RECV_POLL_DEMAND 0xFFFFFFFF -#define EMAC_RECV_POLL_DEMAND_M ((EMAC_RECV_POLL_DEMAND_V)<<(EMAC_RECV_POLL_DEMAND_S)) -#define EMAC_RECV_POLL_DEMAND_V 0xFFFFFFFF -#define EMAC_RECV_POLL_DEMAND_S 0 - -#define EMAC_DMARXBASEADDR_REG (DR_REG_EMAC_BASE + 0x000C) -/* EMAC_START_RECV_LIST : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: This field contains the base address of the first descriptor - in the Receive Descriptor list. The LSB Bits[1:0] are ignored and internally taken as all-zero by the DMA. Therefore these LSB bits are read-only.*/ -#define EMAC_START_RECV_LIST 0xFFFFFFFF -#define EMAC_START_RECV_LIST_M ((EMAC_START_RECV_LIST_V)<<(EMAC_START_RECV_LIST_S)) -#define EMAC_START_RECV_LIST_V 0xFFFFFFFF -#define EMAC_START_RECV_LIST_S 0 - -#define EMAC_DMATXBASEADDR_REG (DR_REG_EMAC_BASE + 0x0010) -/* EMAC_START_TRANS_LIST : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: This field contains the base address of the first descriptor - in the Transmit Descriptor list. The LSB Bits[1:0] are ignored and are internally taken as all-zero by the DMA.Therefore these LSB bits are read-only.*/ -#define EMAC_START_TRANS_LIST 0xFFFFFFFF -#define EMAC_START_TRANS_LIST_M ((EMAC_START_TRANS_LIST_V)<<(EMAC_START_TRANS_LIST_S)) -#define EMAC_START_TRANS_LIST_V 0xFFFFFFFF -#define EMAC_START_TRANS_LIST_S 0 - -#define EMAC_DMASTATUS_REG (DR_REG_EMAC_BASE + 0x0014) -/* EMAC_TS_TRI_INT : RO ;bitpos:[29] ;default: 1'h0 ; */ -/*description: This bit indicates an interrupt event in the Timestamp Generator - block of the ETH_MAC.The software must read the corresponding registers in the ETH_MAC to get the exact cause of the interrupt and clear its source to reset this bit to 1'b0.*/ -#define EMAC_TS_TRI_INT (BIT(29)) -#define EMAC_TS_TRI_INT_M (BIT(29)) -#define EMAC_TS_TRI_INT_V 0x1 -#define EMAC_TS_TRI_INT_S 29 -/* EMAC_PMT_INT : RO ;bitpos:[28] ;default: 1'h0 ; */ -/*description: This bit indicates an interrupt event in the PMT module of the - ETH_MAC. The software must read the PMT Control and Status Register in the MAC to get the exact cause of interrupt and clear its source to reset this bit to 1'b0.*/ -#define EMAC_PMT_INT (BIT(28)) -#define EMAC_PMT_INT_M (BIT(28)) -#define EMAC_PMT_INT_V 0x1 -#define EMAC_PMT_INT_S 28 -/* EMAC_ERROR_BITS : RO ;bitpos:[25:23] ;default: 3'h0 ; */ -/*description: This field indicates the type of error that caused a Bus Error - for example error response on the AHB interface. This field is valid only when Bit[13] (FBI) is set. This field does not generate an interrupt. 3'b000: Error during Rx DMA Write Data Transfer. 3'b011: Error during Tx DMA Read Data Transfer. 3'b100: Error during Rx DMA Descriptor Write Access. 3'b101: Error during Tx DMA Descriptor Write Access. 3'b110: Error during Rx DMA Descriptor Read Access. 3'b111: Error during Tx DMA Descriptor Read Access.*/ -#define EMAC_ERROR_BITS 0x00000007 -#define EMAC_ERROR_BITS_M ((EMAC_ERROR_BITS_V)<<(EMAC_ERROR_BITS_S)) -#define EMAC_ERROR_BITS_V 0x7 -#define EMAC_ERROR_BITS_S 23 -/* EMAC_TRANS_PROC_STATE : RO ;bitpos:[22:20] ;default: 3'h0 ; */ -/*description: This field indicates the Transmit DMA FSM state. This field does - not generate an interrupt. 3'b000: Stopped. Reset or Stop Transmit Command issued. 3'b001: Running. Fetching Transmit Transfer Descriptor. 3'b010: Reserved for future use. 3'b011: Running. Waiting for TX packets. 3'b100: Suspended. Receive Descriptor Unavailable. 3'b101: Running. Closing Transmit Descriptor. 3'b110: TIME_STAMP write state. 3'b111: Running. Transferring the TX packets data from transmit buffer to host memory.*/ -#define EMAC_TRANS_PROC_STATE 0x00000007 -#define EMAC_TRANS_PROC_STATE_M ((EMAC_TRANS_PROC_STATE_V)<<(EMAC_TRANS_PROC_STATE_S)) -#define EMAC_TRANS_PROC_STATE_V 0x7 -#define EMAC_TRANS_PROC_STATE_S 20 -/* EMAC_RECV_PROC_STATE : RO ;bitpos:[19:17] ;default: 3'h0 ; */ -/*description: This field indicates the Receive DMA FSM state. This field does - not generate an interrupt. 3'b000: Stopped. Reset or Stop Receive Command issued. 3'b001: Running. Fetching Receive Transfer Descriptor. 3'b010: Reserved for future use. 3'b011: Running. Waiting for RX packets. 3'b100: Suspended. Receive Descriptor Unavailable. 3'b101: Running. Closing Receive Descriptor. 3'b110: TIME_STAMP write state. 3'b111: Running. Transferring the TX packets data from receive buffer to host memory.*/ -#define EMAC_RECV_PROC_STATE 0x00000007 -#define EMAC_RECV_PROC_STATE_M ((EMAC_RECV_PROC_STATE_V)<<(EMAC_RECV_PROC_STATE_S)) -#define EMAC_RECV_PROC_STATE_V 0x7 -#define EMAC_RECV_PROC_STATE_S 17 -/* EMAC_NORM_INT_SUMM : R_SS_WC ;bitpos:[16] ;default: 1'h0 ; */ -/*description: Normal Interrupt Summary bit value is the logical OR of the following - bits when the corresponding interrupt bits are enabled in Interrupt Enable Register: Bit[0]: Transmit Interrupt. Bit[2]: Transmit Buffer Unavailable. Bit[6]: Receive Interrupt. Bit[14]: Early Receive Interrupt. Only unmasked bits affect the Normal Interrupt Summary bit.This is a sticky bit and must be cleared (by writing 1 to this bit) each time a corresponding bit which causes NIS to be set is cleared.*/ -#define EMAC_NORM_INT_SUMM (BIT(16)) -#define EMAC_NORM_INT_SUMM_M (BIT(16)) -#define EMAC_NORM_INT_SUMM_V 0x1 -#define EMAC_NORM_INT_SUMM_S 16 -/* EMAC_ABN_INT_SUMM : R_SS_WC ;bitpos:[15] ;default: 1'h0 ; */ -/*description: Abnormal Interrupt Summary bit value is the logical OR of the - following when the corresponding interrupt bits are enabled in Interrupt Enable Register: Bit[1]: Transmit Process Stopped. Bit[3]: Transmit Jabber Timeout. Bit[4]: Receive FIFO Overflow. Bit[5]: Transmit Underflow. Bit[7]: Receive Buffer Unavailable. Bit[8]: Receive Process Stopped. Bit[9]: Receive Watchdog Timeout. Bit[10]: Early Transmit Interrupt. Bit[13]: Fatal Bus Error. Only unmasked bits affect the Abnormal Interrupt Summary bit. This is a sticky bit and must be cleared (by writing 1 to this bit) each time a corresponding bit which causes AIS to be set is cleared.*/ -#define EMAC_ABN_INT_SUMM (BIT(15)) -#define EMAC_ABN_INT_SUMM_M (BIT(15)) -#define EMAC_ABN_INT_SUMM_V 0x1 -#define EMAC_ABN_INT_SUMM_S 15 -/* EMAC_EARLY_RECV_INT : R_SS_WC ;bitpos:[14] ;default: 1'h0 ; */ -/*description: This bit indicates that the DMA filled the first data buffer - of the packet. This bit is cleared when the software writes 1 to this bit or when Bit[6] (RI) of this register is set (whichever occurs earlier).*/ -#define EMAC_EARLY_RECV_INT (BIT(14)) -#define EMAC_EARLY_RECV_INT_M (BIT(14)) -#define EMAC_EARLY_RECV_INT_V 0x1 -#define EMAC_EARLY_RECV_INT_S 14 -/* EMAC_FATAL_BUS_ERR_INT : R_SS_WC ;bitpos:[13] ;default: 1'h0 ; */ -/*description: This bit indicates that a bus error occurred as described in - Bits [25:23]. When this bit is set the corresponding DMA engine disables all of its bus accesses.*/ -#define EMAC_FATAL_BUS_ERR_INT (BIT(13)) -#define EMAC_FATAL_BUS_ERR_INT_M (BIT(13)) -#define EMAC_FATAL_BUS_ERR_INT_V 0x1 -#define EMAC_FATAL_BUS_ERR_INT_S 13 -/* EMAC_EARLY_TRANS_INT : R_SS_WC ;bitpos:[10] ;default: 1'h0 ; */ -/*description: This bit indicates that the frame to be transmitted is fully - transferred to the MTL Transmit FIFO.*/ -#define EMAC_EARLY_TRANS_INT (BIT(10)) -#define EMAC_EARLY_TRANS_INT_M (BIT(10)) -#define EMAC_EARLY_TRANS_INT_V 0x1 -#define EMAC_EARLY_TRANS_INT_S 10 -/* EMAC_RECV_WDT_TO : R_SS_WC ;bitpos:[9] ;default: 1'h0 ; */ -/*description: When set this bit indicates that the Receive Watchdog Timer - expired while receiving the current frame and the current frame is truncated after the watchdog timeout.*/ -#define EMAC_RECV_WDT_TO (BIT(9)) -#define EMAC_RECV_WDT_TO_M (BIT(9)) -#define EMAC_RECV_WDT_TO_V 0x1 -#define EMAC_RECV_WDT_TO_S 9 -/* EMAC_RECV_PROC_STOP : R_SS_WC ;bitpos:[8] ;default: 1'h0 ; */ -/*description: This bit is asserted when the Receive Process enters the Stopped state.*/ -#define EMAC_RECV_PROC_STOP (BIT(8)) -#define EMAC_RECV_PROC_STOP_M (BIT(8)) -#define EMAC_RECV_PROC_STOP_V 0x1 -#define EMAC_RECV_PROC_STOP_S 8 -/* EMAC_RECV_BUF_UNAVAIL : R_SS_WC ;bitpos:[7] ;default: 1'h0 ; */ -/*description: This bit indicates that the host owns the Next Descriptor in - the Receive List and the DMA cannot acquire it. The Receive Process is suspended. To resume processing Receive descriptors the host should change the ownership of the descriptor and issue a Receive Poll Demand command. If no Receive Poll Demand is issued the Receive Process resumes when the next recognized incoming frame is received. This bit is set only when the previous Receive Descriptor is owned by the DMA.*/ -#define EMAC_RECV_BUF_UNAVAIL (BIT(7)) -#define EMAC_RECV_BUF_UNAVAIL_M (BIT(7)) -#define EMAC_RECV_BUF_UNAVAIL_V 0x1 -#define EMAC_RECV_BUF_UNAVAIL_S 7 -/* EMAC_RECV_INT : R_SS_WC ;bitpos:[6] ;default: 1'h0 ; */ -/*description: This bit indicates that the frame reception is complete. When - reception is complete the Bit[31] of RDES1 (Disable Interrupt on Completion) is reset in the last Descriptor and the specific frame status information is updated in the descriptor. The reception remains in the Running state.*/ -#define EMAC_RECV_INT (BIT(6)) -#define EMAC_RECV_INT_M (BIT(6)) -#define EMAC_RECV_INT_V 0x1 -#define EMAC_RECV_INT_S 6 -/* EMAC_TRANS_UNDFLOW : R_SS_WC ;bitpos:[5] ;default: 1'h0 ; */ -/*description: This bit indicates that the Transmit Buffer had an Underflow - during frame transmission. Transmission is suspended and an Underflow Error TDES0[1] is set.*/ -#define EMAC_TRANS_UNDFLOW (BIT(5)) -#define EMAC_TRANS_UNDFLOW_M (BIT(5)) -#define EMAC_TRANS_UNDFLOW_V 0x1 -#define EMAC_TRANS_UNDFLOW_S 5 -/* EMAC_RECV_OVFLOW : R_SS_WC ;bitpos:[4] ;default: 1'h0 ; */ -/*description: This bit indicates that the Receive Buffer had an Overflow during - frame reception. If the partial frame is transferred to the application the overflow status is set in RDES0[11].*/ -#define EMAC_RECV_OVFLOW (BIT(4)) -#define EMAC_RECV_OVFLOW_M (BIT(4)) -#define EMAC_RECV_OVFLOW_V 0x1 -#define EMAC_RECV_OVFLOW_S 4 -/* EMAC_TRANS_JABBER_TO : R_SS_WC ;bitpos:[3] ;default: 1'h0 ; */ -/*description: This bit indicates that the Transmit Jabber Timer expired which - happens when the frame size exceeds 2 048 (10 240 bytes when the Jumbo frame is enabled). When the Jabber Timeout occurs the transmission process is aborted and placed in the Stopped state. This causes the Transmit Jabber Timeout TDES0[14] flag to assert.*/ -#define EMAC_TRANS_JABBER_TO (BIT(3)) -#define EMAC_TRANS_JABBER_TO_M (BIT(3)) -#define EMAC_TRANS_JABBER_TO_V 0x1 -#define EMAC_TRANS_JABBER_TO_S 3 -/* EMAC_TRANS_BUF_UNAVAIL : R_SS_WC ;bitpos:[2] ;default: 1'h0 ; */ -/*description: This bit indicates that the host owns the Next Descriptor in - the Transmit List and the DMA cannot acquire it. Transmission is suspended. Bits[22:20] explain the Transmit Process state transitions. To resume processing Transmit descriptors the host should change the ownership of the descriptor by setting TDES0[31] and then issue a Transmit Poll Demand Command.*/ -#define EMAC_TRANS_BUF_UNAVAIL (BIT(2)) -#define EMAC_TRANS_BUF_UNAVAIL_M (BIT(2)) -#define EMAC_TRANS_BUF_UNAVAIL_V 0x1 -#define EMAC_TRANS_BUF_UNAVAIL_S 2 -/* EMAC_TRANS_PROC_STOP : R_SS_WC ;bitpos:[1] ;default: 1'h0 ; */ -/*description: This bit is set when the transmission is stopped.*/ -#define EMAC_TRANS_PROC_STOP (BIT(1)) -#define EMAC_TRANS_PROC_STOP_M (BIT(1)) -#define EMAC_TRANS_PROC_STOP_V 0x1 -#define EMAC_TRANS_PROC_STOP_S 1 -/* EMAC_TRANS_INT : R_SS_WC ;bitpos:[0] ;default: 1'h0 ; */ -/*description: This bit indicates that the frame transmission is complete. When - transmission is complete Bit[31] (OWN) of TDES0 is reset and the specific frame status information is updated in the Descriptor.*/ -#define EMAC_TRANS_INT (BIT(0)) -#define EMAC_TRANS_INT_M (BIT(0)) -#define EMAC_TRANS_INT_V 0x1 -#define EMAC_TRANS_INT_S 0 - -#define EMAC_DMAOPERATION_MODE_REG (DR_REG_EMAC_BASE + 0x0018) -/* EMAC_DIS_DROP_TCPIP_ERR_FRAM : R/W ;bitpos:[26] ;default: 1'h0 ; */ -/*description: When this bit is set the MAC does not drop the frames which - only have errors detected by the Receive Checksum engine.When this bit is reset all error frames are dropped if the Fwd_Err_Frame bit is reset.*/ -#define EMAC_DIS_DROP_TCPIP_ERR_FRAM (BIT(26)) -#define EMAC_DIS_DROP_TCPIP_ERR_FRAM_M (BIT(26)) -#define EMAC_DIS_DROP_TCPIP_ERR_FRAM_V 0x1 -#define EMAC_DIS_DROP_TCPIP_ERR_FRAM_S 26 -/* EMAC_RX_STORE_FORWARD : R/W ;bitpos:[25] ;default: 1'h0 ; */ -/*description: When this bit is set the MTL reads a frame from the Rx FIFO - only after the complete frame has been written to it.*/ -#define EMAC_RX_STORE_FORWARD (BIT(25)) -#define EMAC_RX_STORE_FORWARD_M (BIT(25)) -#define EMAC_RX_STORE_FORWARD_V 0x1 -#define EMAC_RX_STORE_FORWARD_S 25 -/* EMAC_DIS_FLUSH_RECV_FRAMES : R/W ;bitpos:[24] ;default: 1'h0 ; */ -/*description: When this bit is set the Rx DMA does not flush any frames because - of the unavailability of receive descriptors or buffers.*/ -#define EMAC_DIS_FLUSH_RECV_FRAMES (BIT(24)) -#define EMAC_DIS_FLUSH_RECV_FRAMES_M (BIT(24)) -#define EMAC_DIS_FLUSH_RECV_FRAMES_V 0x1 -#define EMAC_DIS_FLUSH_RECV_FRAMES_S 24 -/* EMAC_TX_STR_FWD : R/W ;bitpos:[21] ;default: 1'h0 ; */ -/*description: When this bit is set transmission starts when a full frame resides - in the MTL Transmit FIFO. When this bit is set the Tx_Thresh_Ctrl values specified in Tx_Thresh_Ctrl are ignored.*/ -#define EMAC_TX_STR_FWD (BIT(21)) -#define EMAC_TX_STR_FWD_M (BIT(21)) -#define EMAC_TX_STR_FWD_V 0x1 -#define EMAC_TX_STR_FWD_S 21 -/* EMAC_FLUSH_TX_FIFO : R_WS_SC ;bitpos:[20] ;default: 1'h0 ; */ -/*description: When this bit is set the transmit FIFO controller logic is reset - to its default values and thus all data in the Tx FIFO is lost or flushed. This bit is cleared internally when the flushing operation is complete.*/ -#define EMAC_FLUSH_TX_FIFO (BIT(20)) -#define EMAC_FLUSH_TX_FIFO_M (BIT(20)) -#define EMAC_FLUSH_TX_FIFO_V 0x1 -#define EMAC_FLUSH_TX_FIFO_S 20 -/* EMAC_TX_THRESH_CTRL : R/W ;bitpos:[16:14] ;default: 3'h0 ; */ -/*description: These bits control the threshold level of the MTL Transmit FIFO. - Transmission starts when the frame size within the MTL Transmit FIFO is larger than the threshold. In addition full frames with a length less than the threshold are also transmitted. These bits are used only when Tx_Str_fwd is reset. 3'b000: 64 3'b001: 128 3'b010: 192 3'b011: 256 3'b100: 40 3'b101: 32 3'b110: 24 3'b111: 16 .*/ -#define EMAC_TX_THRESH_CTRL 0x00000007 -#define EMAC_TX_THRESH_CTRL_M ((EMAC_TX_THRESH_CTRL_V)<<(EMAC_TX_THRESH_CTRL_S)) -#define EMAC_TX_THRESH_CTRL_V 0x7 -#define EMAC_TX_THRESH_CTRL_S 14 -/* EMAC_START_STOP_TRANSMISSION_COMMAND : R/W ;bitpos:[13] ;default: 1'h0 ; */ -/*description: When this bit is set transmission is placed in the Running state - and the DMA checks the Transmit List at the current position for a frame to be transmitted.When this bit is reset the transmission process is placed in the Stopped state after completing the transmission of the current frame.*/ -#define EMAC_START_STOP_TRANSMISSION_COMMAND (BIT(13)) -#define EMAC_START_STOP_TRANSMISSION_COMMAND_M (BIT(13)) -#define EMAC_START_STOP_TRANSMISSION_COMMAND_V 0x1 -#define EMAC_START_STOP_TRANSMISSION_COMMAND_S 13 -/* EMAC_FWD_ERR_FRAME : R/W ;bitpos:[7] ;default: 1'h0 ; */ -/*description: When this bit is reset the Rx FIFO drops frames with error status - (CRC error collision error giant frame watchdog timeout or overflow).*/ -#define EMAC_FWD_ERR_FRAME (BIT(7)) -#define EMAC_FWD_ERR_FRAME_M (BIT(7)) -#define EMAC_FWD_ERR_FRAME_V 0x1 -#define EMAC_FWD_ERR_FRAME_S 7 -/* EMAC_FWD_UNDER_GF : R/W ;bitpos:[6] ;default: 1'h0 ; */ -/*description: When set the Rx FIFO forwards Undersized frames (that is frames - with no Error and length less than 64 bytes) including pad-bytes and CRC.*/ -#define EMAC_FWD_UNDER_GF (BIT(6)) -#define EMAC_FWD_UNDER_GF_M (BIT(6)) -#define EMAC_FWD_UNDER_GF_V 0x1 -#define EMAC_FWD_UNDER_GF_S 6 -/* EMAC_DROP_GFRM : R/W ;bitpos:[5] ;default: 1'h0 ; */ -/*description: When set the MAC drops the received giant frames in the Rx FIFO - that is frames that are larger than the computed giant frame limit.*/ -#define EMAC_DROP_GFRM (BIT(5)) -#define EMAC_DROP_GFRM_M (BIT(5)) -#define EMAC_DROP_GFRM_V 0x1 -#define EMAC_DROP_GFRM_S 5 -/* EMAC_RX_THRESH_CTRL : R/W ;bitpos:[4:3] ;default: 2'h0 ; */ -/*description: These two bits control the threshold level of the MTL Receive - FIFO. Transfer (request) to DMA starts when the frame size within the MTL Receive FIFO is larger than the threshold. 2'b00: 64, 2'b01: 32, 2'b10: 96, 2'b11: 128 .*/ -#define EMAC_RX_THRESH_CTRL 0x00000003 -#define EMAC_RX_THRESH_CTRL_M ((EMAC_RX_THRESH_CTRL_V)<<(EMAC_RX_THRESH_CTRL_S)) -#define EMAC_RX_THRESH_CTRL_V 0x3 -#define EMAC_RX_THRESH_CTRL_S 3 -/* EMAC_OPT_SECOND_FRAME : R/W ;bitpos:[2] ;default: 1'h0 ; */ -/*description: When this bit is set it instructs the DMA to process the second - frame of the Transmit data even before the status for the first frame is obtained.*/ -#define EMAC_OPT_SECOND_FRAME (BIT(2)) -#define EMAC_OPT_SECOND_FRAME_M (BIT(2)) -#define EMAC_OPT_SECOND_FRAME_V 0x1 -#define EMAC_OPT_SECOND_FRAME_S 2 -/* EMAC_START_STOP_RX : R/W ;bitpos:[1] ;default: 1'h0 ; */ -/*description: When this bit is set the Receive process is placed in the Running - state. The DMA attempts to acquire the descriptor from the Receive list and processes the incoming frames.When this bit is cleared the Rx DMA operation is stopped after the transfer of the current frame.*/ -#define EMAC_START_STOP_RX (BIT(1)) -#define EMAC_START_STOP_RX_M (BIT(1)) -#define EMAC_START_STOP_RX_V 0x1 -#define EMAC_START_STOP_RX_S 1 - -#define EMAC_DMAIN_EN_REG (DR_REG_EMAC_BASE + 0x001C) -/* EMAC_DMAIN_NISE : R/W ;bitpos:[16] ;default: 1'h0 ; */ -/*description: When this bit is set normal interrupt summary is enabled. When - this bit is reset normal interrupt summary is disabled. This bit enables the following interrupts in Status Register: Bit[0]: Transmit Interrupt. Bit[2]: Transmit Buffer Unavailable. Bit[6]: Receive Interrupt. Bit[14]: Early Receive Interrupt.*/ -#define EMAC_DMAIN_NISE (BIT(16)) -#define EMAC_DMAIN_NISE_M (BIT(16)) -#define EMAC_DMAIN_NISE_V 0x1 -#define EMAC_DMAIN_NISE_S 16 -/* EMAC_DMAIN_AISE : R/W ;bitpos:[15] ;default: 1'h0 ; */ -/*description: When this bit is set abnormal interrupt summary is enabled. - When this bit is reset the abnormal interrupt summary is disabled. This bit enables the following interrupts in Status Register: Bit[1]: Transmit Process Stopped. Bit[3]: Transmit Jabber Timeout. Bit[4]: Receive Overflow. Bit[5]: Transmit Underflow. Bit[7]: Receive Buffer Unavailable. Bit[8]: Receive Process Stopped. Bit[9]: Receive Watchdog Timeout. Bit[10]: Early Transmit Interrupt. Bit[13]: Fatal Bus Error.*/ -#define EMAC_DMAIN_AISE (BIT(15)) -#define EMAC_DMAIN_AISE_M (BIT(15)) -#define EMAC_DMAIN_AISE_V 0x1 -#define EMAC_DMAIN_AISE_S 15 -/* EMAC_DMAIN_ERIE : R/W ;bitpos:[14] ;default: 1'h0 ; */ -/*description: When this bit is set with Normal Interrupt Summary Enable (Bit[16]) - the Early Receive Interrupt is enabled. When this bit is reset the Early Receive Interrupt is disabled.*/ -#define EMAC_DMAIN_ERIE (BIT(14)) -#define EMAC_DMAIN_ERIE_M (BIT(14)) -#define EMAC_DMAIN_ERIE_V 0x1 -#define EMAC_DMAIN_ERIE_S 14 -/* EMAC_DMAIN_FBEE : R/W ;bitpos:[13] ;default: 1'h0 ; */ -/*description: When this bit is set with Abnormal Interrupt Summary Enable (Bit[15]) - the Fatal Bus Error Interrupt is enabled. When this bit is reset the Fatal Bus Error Enable Interrupt is disabled.*/ -#define EMAC_DMAIN_FBEE (BIT(13)) -#define EMAC_DMAIN_FBEE_M (BIT(13)) -#define EMAC_DMAIN_FBEE_V 0x1 -#define EMAC_DMAIN_FBEE_S 13 -/* EMAC_DMAIN_ETIE : R/W ;bitpos:[10] ;default: 1'h0 ; */ -/*description: When this bit is set with an Abnormal Interrupt Summary Enable - (Bit[15]) the Early Transmit Interrupt is enabled. When this bit is reset the Early Transmit Interrupt is disabled.*/ -#define EMAC_DMAIN_ETIE (BIT(10)) -#define EMAC_DMAIN_ETIE_M (BIT(10)) -#define EMAC_DMAIN_ETIE_V 0x1 -#define EMAC_DMAIN_ETIE_S 10 -/* EMAC_DMAIN_RWTE : R/W ;bitpos:[9] ;default: 1'h0 ; */ -/*description: When this bit is set with Abnormal Interrupt Summary Enable (Bit[15]) - the Receive Watchdog Timeout Interrupt is enabled. When this bit is reset the Receive Watchdog Timeout Interrupt is disabled.*/ -#define EMAC_DMAIN_RWTE (BIT(9)) -#define EMAC_DMAIN_RWTE_M (BIT(9)) -#define EMAC_DMAIN_RWTE_V 0x1 -#define EMAC_DMAIN_RWTE_S 9 -/* EMAC_DMAIN_RSE : R/W ;bitpos:[8] ;default: 1'h0 ; */ -/*description: When this bit is set with Abnormal Interrupt Summary Enable (Bit[15]) - the Receive Stopped Interrupt is enabled. When this bit is reset the Receive Stopped Interrupt is disabled.*/ -#define EMAC_DMAIN_RSE (BIT(8)) -#define EMAC_DMAIN_RSE_M (BIT(8)) -#define EMAC_DMAIN_RSE_V 0x1 -#define EMAC_DMAIN_RSE_S 8 -/* EMAC_DMAIN_RBUE : R/W ;bitpos:[7] ;default: 1'h0 ; */ -/*description: When this bit is set with Abnormal Interrupt Summary Enable (Bit[15]) - the Receive Buffer Unavailable Interrupt is enabled. When this bit is reset the Receive Buffer Unavailable Interrupt is disabled.*/ -#define EMAC_DMAIN_RBUE (BIT(7)) -#define EMAC_DMAIN_RBUE_M (BIT(7)) -#define EMAC_DMAIN_RBUE_V 0x1 -#define EMAC_DMAIN_RBUE_S 7 -/* EMAC_DMAIN_RIE : R/W ;bitpos:[6] ;default: 1'h0 ; */ -/*description: When this bit is set with Normal Interrupt Summary Enable (Bit[16]) - the Receive Interrupt is enabled. When this bit is reset the Receive Interrupt is disabled.*/ -#define EMAC_DMAIN_RIE (BIT(6)) -#define EMAC_DMAIN_RIE_M (BIT(6)) -#define EMAC_DMAIN_RIE_V 0x1 -#define EMAC_DMAIN_RIE_S 6 -/* EMAC_DMAIN_UIE : R/W ;bitpos:[5] ;default: 1'h0 ; */ -/*description: When this bit is set with Abnormal Interrupt Summary Enable (Bit[15]) - the Transmit Underflow Interrupt is enabled. When this bit is reset the Underflow Interrupt is disabled.*/ -#define EMAC_DMAIN_UIE (BIT(5)) -#define EMAC_DMAIN_UIE_M (BIT(5)) -#define EMAC_DMAIN_UIE_V 0x1 -#define EMAC_DMAIN_UIE_S 5 -/* EMAC_DMAIN_OIE : R/W ;bitpos:[4] ;default: 1'h0 ; */ -/*description: When this bit is set with Abnormal Interrupt Summary Enable (Bit[15]) - the Receive Overflow Interrupt is enabled. When this bit is reset the Overflow Interrupt is disabled.*/ -#define EMAC_DMAIN_OIE (BIT(4)) -#define EMAC_DMAIN_OIE_M (BIT(4)) -#define EMAC_DMAIN_OIE_V 0x1 -#define EMAC_DMAIN_OIE_S 4 -/* EMAC_DMAIN_TJTE : R/W ;bitpos:[3] ;default: 1'h0 ; */ -/*description: When this bit is set with Abnormal Interrupt Summary Enable (Bit[15]) - the Transmit Jabber Timeout Interrupt is enabled. When this bit is reset the Transmit Jabber Timeout Interrupt is disabled.*/ -#define EMAC_DMAIN_TJTE (BIT(3)) -#define EMAC_DMAIN_TJTE_M (BIT(3)) -#define EMAC_DMAIN_TJTE_V 0x1 -#define EMAC_DMAIN_TJTE_S 3 -/* EMAC_DMAIN_TBUE : R/W ;bitpos:[2] ;default: 1'h0 ; */ -/*description: When this bit is set with Normal Interrupt Summary Enable (Bit - 16) the Transmit Buffer Unavailable Interrupt is enabled. When this bit is reset the Transmit Buffer Unavailable Interrupt is Disabled.*/ -#define EMAC_DMAIN_TBUE (BIT(2)) -#define EMAC_DMAIN_TBUE_M (BIT(2)) -#define EMAC_DMAIN_TBUE_V 0x1 -#define EMAC_DMAIN_TBUE_S 2 -/* EMAC_DMAIN_TSE : R/W ;bitpos:[1] ;default: 1'h0 ; */ -/*description: When this bit is set with Abnormal Interrupt Summary Enable (Bit[15]) - the Transmission Stopped Interrupt is enabled. When this bit is reset the Transmission Stopped Interrupt is disabled.*/ -#define EMAC_DMAIN_TSE (BIT(1)) -#define EMAC_DMAIN_TSE_M (BIT(1)) -#define EMAC_DMAIN_TSE_V 0x1 -#define EMAC_DMAIN_TSE_S 1 -/* EMAC_DMAIN_TIE : R/W ;bitpos:[0] ;default: 1'h0 ; */ -/*description: When this bit is set with Normal Interrupt Summary Enable (Bit[16]) - the Transmit Interrupt is enabled. When this bit is reset the Transmit Interrupt is disabled.*/ -#define EMAC_DMAIN_TIE (BIT(0)) -#define EMAC_DMAIN_TIE_M (BIT(0)) -#define EMAC_DMAIN_TIE_V 0x1 -#define EMAC_DMAIN_TIE_S 0 - -#define EMAC_DMAMISSEDFR_REG (DR_REG_EMAC_BASE + 0x0020) -/* EMAC_OVERFLOW_BFOC : R_SS_RC ;bitpos:[28] ;default: 1'h0 ; */ -/*description: This bit is set every time the Overflow Frame Counter (Bits[27:17]) - overflows that is the Rx FIFO overflows with the overflow frame counter at maximum value. In such a scenario the overflow frame counter is reset to all-zeros and this bit indicates that the rollover happened.*/ -#define EMAC_OVERFLOW_BFOC (BIT(28)) -#define EMAC_OVERFLOW_BFOC_M (BIT(28)) -#define EMAC_OVERFLOW_BFOC_V 0x1 -#define EMAC_OVERFLOW_BFOC_S 28 -/* EMAC_OVERFLOW_FC : R_SS_RC ;bitpos:[27:17] ;default: 11'h0 ; */ -/*description: This field indicates the number of frames missed by the application. - This counter is incremented each time the MTL FIFO overflows. The counter is cleared when this register is read.*/ -#define EMAC_OVERFLOW_FC 0x000007FF -#define EMAC_OVERFLOW_FC_M ((EMAC_OVERFLOW_FC_V)<<(EMAC_OVERFLOW_FC_S)) -#define EMAC_OVERFLOW_FC_V 0x7FF -#define EMAC_OVERFLOW_FC_S 17 -/* EMAC_OVERFLOW_BMFC : R_SS_RC ;bitpos:[16] ;default: 1'h0 ; */ -/*description: This bit is set every time Missed Frame Counter (Bits[15:0]) - overflows that is the DMA discards an incoming frame because of the Host Receive Buffer being unavailable with the missed frame counter at maximum value. In such a scenario the Missed frame counter is reset to all-zeros and this bit indicates that the rollover happened.*/ -#define EMAC_OVERFLOW_BMFC (BIT(16)) -#define EMAC_OVERFLOW_BMFC_M (BIT(16)) -#define EMAC_OVERFLOW_BMFC_V 0x1 -#define EMAC_OVERFLOW_BMFC_S 16 -/* EMAC_MISSED_FC : R_SS_RC ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: This field indicates the number of frames missed by the controller - because of the Host Receive Buffer being unavailable. This counter is incremented each time the DMA discards an incoming frame. The counter is cleared when this register is read.*/ -#define EMAC_MISSED_FC 0x0000FFFF -#define EMAC_MISSED_FC_M ((EMAC_MISSED_FC_V)<<(EMAC_MISSED_FC_S)) -#define EMAC_MISSED_FC_V 0xFFFF -#define EMAC_MISSED_FC_S 0 - -#define EMAC_DMARINTWDTIMER_REG (DR_REG_EMAC_BASE + 0x0024) -/* EMAC_RIWTC : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: This bit indicates the number of system clock cycles multiplied - by 256 for which the watchdog timer is set. The watchdog timer gets triggered with the programmed value after the Rx DMA completes the transfer of a frame for which the RI(RECV_INT) status bit is not set because of the setting in the corresponding descriptor RDES1[31]. When the watchdog timer runs out the RI bit is set and the timer is stopped. The watchdog timer is reset when the RI bit is set high because of automatic setting of RI as per RDES1[31] of any received frame.*/ -#define EMAC_RIWTC 0x000000FF -#define EMAC_RIWTC_M ((EMAC_RIWTC_V)<<(EMAC_RIWTC_S)) -#define EMAC_RIWTC_V 0xFF -#define EMAC_RIWTC_S 0 - -#define EMAC_DMATXCURRDESC_REG (DR_REG_EMAC_BASE + 0x0048) -/* EMAC_TRANS_DSCR_ADDR_PTR : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: The address of the current receive descriptor list. Cleared on - Reset.Pointer updated by the DMA during operation.*/ -#define EMAC_TRANS_DSCR_ADDR_PTR 0xFFFFFFFF -#define EMAC_TRANS_DSCR_ADDR_PTR_M ((EMAC_TRANS_DSCR_ADDR_PTR_V)<<(EMAC_TRANS_DSCR_ADDR_PTR_S)) -#define EMAC_TRANS_DSCR_ADDR_PTR_V 0xFFFFFFFF -#define EMAC_TRANS_DSCR_ADDR_PTR_S 0 - -#define EMAC_DMARXCURRDESC_REG (DR_REG_EMAC_BASE + 0x004C) -/* EMAC_RECV_DSCR_ADDR_PTR : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: The address of the current receive descriptor list. Cleared on - Reset.Pointer updated by the DMA during operation.*/ -#define EMAC_RECV_DSCR_ADDR_PTR 0xFFFFFFFF -#define EMAC_RECV_DSCR_ADDR_PTR_M ((EMAC_RECV_DSCR_ADDR_PTR_V)<<(EMAC_RECV_DSCR_ADDR_PTR_S)) -#define EMAC_RECV_DSCR_ADDR_PTR_V 0xFFFFFFFF -#define EMAC_RECV_DSCR_ADDR_PTR_S 0 - -#define EMAC_DMATXCURRADDR_BUF_REG (DR_REG_EMAC_BASE + 0x0050) -/* EMAC_TRANS_BUFF_ADDR_PTR : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: The address of the current receive descriptor list. Cleared on - Reset.Pointer updated by the DMA during operation.*/ -#define EMAC_TRANS_BUFF_ADDR_PTR 0xFFFFFFFF -#define EMAC_TRANS_BUFF_ADDR_PTR_M ((EMAC_TRANS_BUFF_ADDR_PTR_V)<<(EMAC_TRANS_BUFF_ADDR_PTR_S)) -#define EMAC_TRANS_BUFF_ADDR_PTR_V 0xFFFFFFFF -#define EMAC_TRANS_BUFF_ADDR_PTR_S 0 - -#define EMAC_DMARXCURRADDR_BUF_REG (DR_REG_EMAC_BASE + 0x0054) -/* EMAC_RECV_BUFF_ADDR_PTR : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: The address of the current receive descriptor list. Cleared on - Reset.Pointer updated by the DMA during operation.*/ -#define EMAC_RECV_BUFF_ADDR_PTR 0xFFFFFFFF -#define EMAC_RECV_BUFF_ADDR_PTR_M ((EMAC_RECV_BUFF_ADDR_PTR_V)<<(EMAC_RECV_BUFF_ADDR_PTR_S)) -#define EMAC_RECV_BUFF_ADDR_PTR_V 0xFFFFFFFF -#define EMAC_RECV_BUFF_ADDR_PTR_S 0 - -#define EMAC_GMACCONFIG_REG (DR_REG_EMAC_BASE + 0x1000) -/* EMAC_SAIRC : R/W ;bitpos:[30:28] ;default: 3'h0 ; */ -/*description: This field controls the source address insertion or replacement - for all transmitted frames.Bit[30] specifies which MAC Address register (0 or 1) is used for source address insertion or replacement based on the values of Bits [29:28]: 2'b0x: The input signals mti_sa_ctrl_i and ati_sa_ctrl_i control the SA field generation. 2'b10: If Bit[30] is set to 0 the MAC inserts the content of the MAC Address 0 registers in the SA field of all transmitted frames. If Bit[30] is set to 1 the MAC inserts the content of the MAC Address 1 registers in the SA field of all transmitted frames. 2'b11: If Bit[30] is set to 0 the MAC replaces the content of the MAC Address 0 registers in the SA field of all transmitted frames. If Bit[30] is set to 1 the MAC replaces the content of the MAC Address 1 registers in the SA field of all transmitted frames.*/ -#define EMAC_SAIRC 0x00000007 -#define EMAC_SAIRC_M ((EMAC_SAIRC_V)<<(EMAC_SAIRC_S)) -#define EMAC_SAIRC_V 0x7 -#define EMAC_SAIRC_S 28 -/* EMAC_ASS2KP : R/W ;bitpos:[27] ;default: 1'h0 ; */ -/*description: When set the MAC considers all frames with up to 2 000 bytes - length as normal packets.When Bit[20] (JE) is not set the MAC considers all received frames of size more than 2K bytes as Giant frames. When this bit is reset and Bit[20] (JE) is not set the MAC considers all received frames of size more than 1 518 bytes (1 522 bytes for tagged) as Giant frames. When Bit[20] is set setting this bit has no effect on Giant Frame status.*/ -#define EMAC_ASS2KP (BIT(27)) -#define EMAC_ASS2KP_M (BIT(27)) -#define EMAC_ASS2KP_V 0x1 -#define EMAC_ASS2KP_S 27 -/* EMAC_EMACWATCHDOG : R/W ;bitpos:[23] ;default: 1'h0 ; */ -/*description: When this bit is set the MAC disables the watchdog timer on - the receiver. The MAC can receive frames of up to 16 383 bytes. When this bit is reset the MAC does not allow a receive frame which more than 2 048 bytes (10 240 if JE is set high) or the value programmed in Register (Watchdog Timeout Register). The MAC cuts off any bytes received after the watchdog limit number of bytes.*/ -#define EMAC_EMACWATCHDOG (BIT(23)) -#define EMAC_EMACWATCHDOG_M (BIT(23)) -#define EMAC_EMACWATCHDOG_V 0x1 -#define EMAC_EMACWATCHDOG_S 23 -/* EMAC_EMACJABBER : R/W ;bitpos:[22] ;default: 1'h0 ; */ -/*description: When this bit is set the MAC disables the jabber timer on the - transmitter. The MAC can transfer frames of up to 16 383 bytes. When this bit is reset the MAC cuts off the transmitter if the application sends out more than 2 048 bytes of data (10 240 if JE is set high) during Transmission.*/ -#define EMAC_EMACJABBER (BIT(22)) -#define EMAC_EMACJABBER_M (BIT(22)) -#define EMAC_EMACJABBER_V 0x1 -#define EMAC_EMACJABBER_S 22 -/* EMAC_EMACJUMBOFRAME : R/W ;bitpos:[20] ;default: 1'h0 ; */ -/*description: When this bit is set the MAC allows Jumbo frames of 9 018 bytes - (9 022 bytes for VLAN tagged frames) without reporting a giant frame error in the receive frame status.*/ -#define EMAC_EMACJUMBOFRAME (BIT(20)) -#define EMAC_EMACJUMBOFRAME_M (BIT(20)) -#define EMAC_EMACJUMBOFRAME_V 0x1 -#define EMAC_EMACJUMBOFRAME_S 20 -/* EMAC_EMACINTERFRAMEGAP : R/W ;bitpos:[19:17] ;default: 1'h0 ; */ -/*description: These bits control the minimum IFG between frames during transmission. - 3'b000: 96 bit times. 3'b001: 88 bit times. 3'b010: 80 bit times. 3'b111: 40 bit times. In the half-duplex mode the minimum IFG can be configured only for 64 bit times (IFG = 100). Lower values are not considered.*/ -#define EMAC_EMACINTERFRAMEGAP 0x00000007 -#define EMAC_EMACINTERFRAMEGAP_M ((EMAC_EMACINTERFRAMEGAP_V)<<(EMAC_EMACINTERFRAMEGAP_S)) -#define EMAC_EMACINTERFRAMEGAP_V 0x7 -#define EMAC_EMACINTERFRAMEGAP_S 17 -/* EMAC_EMACDISABLECRS : R/W ;bitpos:[16] ;default: 1'h0 ; */ -/*description: When set high this bit makes the MAC transmitter ignore the - MII CRS signal during frame transmission in the half-duplex mode. This request results in no errors generated because of Loss of Carrier or No Carrier during such transmission. When this bit is low the MAC transmitter generates such errors because of Carrier Sense and can even abort the transmissions.*/ -#define EMAC_EMACDISABLECRS (BIT(16)) -#define EMAC_EMACDISABLECRS_M (BIT(16)) -#define EMAC_EMACDISABLECRS_V 0x1 -#define EMAC_EMACDISABLECRS_S 16 -/* EMAC_EMACMII : R/W ;bitpos:[15] ;default: 1'h0 ; */ -/*description: This bit selects the Ethernet line speed. It should be set to - 1 for 10 or 100 Mbps operations.In 10 or 100 Mbps operations this bit along with FES(EMACFESPEED) bit it selects the exact linespeed. In the 10/100 Mbps-only operations the bit is always 1.*/ -#define EMAC_EMACMII (BIT(15)) -#define EMAC_EMACMII_M (BIT(15)) -#define EMAC_EMACMII_V 0x1 -#define EMAC_EMACMII_S 15 -/* EMAC_EMACFESPEED : R/W ;bitpos:[14] ;default: 1'h0 ; */ -/*description: This bit selects the speed in the MII RMII interface. 0: 10 Mbps. 1: 100 Mbps.*/ -#define EMAC_EMACFESPEED (BIT(14)) -#define EMAC_EMACFESPEED_M (BIT(14)) -#define EMAC_EMACFESPEED_V 0x1 -#define EMAC_EMACFESPEED_S 14 -/* EMAC_EMACRXOWN : R/W ;bitpos:[13] ;default: 1'h0 ; */ -/*description: When this bit is set the MAC disables the reception of frames - when the TX_EN is asserted in the half-duplex mode. When this bit is reset the MAC receives all packets that are given by the PHY while transmitting. This bit is not applicable if the MAC is operating in the full duplex mode.*/ -#define EMAC_EMACRXOWN (BIT(13)) -#define EMAC_EMACRXOWN_M (BIT(13)) -#define EMAC_EMACRXOWN_V 0x1 -#define EMAC_EMACRXOWN_S 13 -/* EMAC_EMACLOOPBACK : R/W ;bitpos:[12] ;default: 1'h0 ; */ -/*description: When this bit is set the MAC operates in the loopback mode MII. - The MII Receive clock input (CLK_RX) is required for the loopback to work properly because the transmit clock is not looped-back internally.*/ -#define EMAC_EMACLOOPBACK (BIT(12)) -#define EMAC_EMACLOOPBACK_M (BIT(12)) -#define EMAC_EMACLOOPBACK_V 0x1 -#define EMAC_EMACLOOPBACK_S 12 -/* EMAC_EMACDUPLEX : R/W ;bitpos:[11] ;default: 1'h0 ; */ -/*description: When this bit is set the MAC operates in the full-duplex mode - where it can transmit and receive simultaneously. This bit is read only with default value of 1'b1 in the full-duplex-mode.*/ -#define EMAC_EMACDUPLEX (BIT(11)) -#define EMAC_EMACDUPLEX_M (BIT(11)) -#define EMAC_EMACDUPLEX_V 0x1 -#define EMAC_EMACDUPLEX_S 11 -/* EMAC_EMACRXIPCOFFLOAD : R/W ;bitpos:[10] ;default: 1'h0 ; */ -/*description: When this bit is set the MAC calculates the 16-bit one's complement - of the one's complement sum of all received Ethernet frame payloads. It also checks whether the IPv4 Header checksum (assumed to be bytes 25/26 or 29/30 (VLAN-tagged) of the received Ethernet frame) is correct for the received frame and gives the status in the receive status word. The MAC also appends the 16-bit checksum calculated for the IP header datagram payload (bytes after the IPv4 header) and appends it to the Ethernet frame transferred to the application (when Type 2 COE is deselected). When this bit is reset this function is disabled.*/ -#define EMAC_EMACRXIPCOFFLOAD (BIT(10)) -#define EMAC_EMACRXIPCOFFLOAD_M (BIT(10)) -#define EMAC_EMACRXIPCOFFLOAD_V 0x1 -#define EMAC_EMACRXIPCOFFLOAD_S 10 -/* EMAC_EMACRETRY : R/W ;bitpos:[9] ;default: 1'h0 ; */ -/*description: When this bit is set the MAC attempts only one transmission. - When a collision occurs on the MII interface the MAC ignores the current frame transmission and reports a Frame Abort with excessive collision error in the transmit frame status. When this bit is reset the MAC attempts retries based on the settings of the BL field (Bits [6:5]). This bit is applicable only in the half-duplex Mode.*/ -#define EMAC_EMACRETRY (BIT(9)) -#define EMAC_EMACRETRY_M (BIT(9)) -#define EMAC_EMACRETRY_V 0x1 -#define EMAC_EMACRETRY_S 9 -/* EMAC_EMACPADCRCSTRIP : R/W ;bitpos:[7] ;default: 1'h0 ; */ -/*description: When this bit is set the MAC strips the Pad or FCS field on - the incoming frames only if the value of the length field is less than 1 536 bytes. All received frames with length field greater than or equal to 1 536 bytes are passed to the application without stripping the Pad or FCS field. When this bit is reset the MAC passes all incoming frames without modifying them to the Host.*/ -#define EMAC_EMACPADCRCSTRIP (BIT(7)) -#define EMAC_EMACPADCRCSTRIP_M (BIT(7)) -#define EMAC_EMACPADCRCSTRIP_V 0x1 -#define EMAC_EMACPADCRCSTRIP_S 7 -/* EMAC_EMACBACKOFFLIMIT : R/W ;bitpos:[6:5] ;default: 2'h0 ; */ -/*description: The Back-Off limit determines the random integer number (r) of - slot time delays (512 bit times for 10/100 Mbps) for which the MAC waits before rescheduling a transmission attempt during retries after a collision. This bit is applicable only in the half-duplex mode. 00: k= min (n 10). 01: k = min (n 8). 10: k = min (n 4). 11: k = min (n 1) n = retransmission attempt. The random integer r takes the value in the Range 0 ~ 2000.*/ -#define EMAC_EMACBACKOFFLIMIT 0x00000003 -#define EMAC_EMACBACKOFFLIMIT_M ((EMAC_EMACBACKOFFLIMIT_V)<<(EMAC_EMACBACKOFFLIMIT_S)) -#define EMAC_EMACBACKOFFLIMIT_V 0x3 -#define EMAC_EMACBACKOFFLIMIT_S 5 -/* EMAC_EMACDEFERRALCHECK : R/W ;bitpos:[4] ;default: 1'h0 ; */ -/*description: Deferral Check.*/ -#define EMAC_EMACDEFERRALCHECK (BIT(4)) -#define EMAC_EMACDEFERRALCHECK_M (BIT(4)) -#define EMAC_EMACDEFERRALCHECK_V 0x1 -#define EMAC_EMACDEFERRALCHECK_S 4 -/* EMAC_EMACTX : R/W ;bitpos:[3] ;default: 1'h0 ; */ -/*description: When this bit is set the transmit state machine of the MAC is - enabled for transmission on the MII. When this bit is reset the MAC transmit state machine is disabled after the completion of the transmission of the current frame and does not transmit any further frames.*/ -#define EMAC_EMACTX (BIT(3)) -#define EMAC_EMACTX_M (BIT(3)) -#define EMAC_EMACTX_V 0x1 -#define EMAC_EMACTX_S 3 -/* EMAC_EMACRX : R/W ;bitpos:[2] ;default: 1'h0 ; */ -/*description: When this bit is set the receiver state machine of the MAC is - enabled for receiving frames from the MII. When this bit is reset the MAC receive state machine is disabled after the completion of the reception of the current frame and does not receive any further frames from the MII.*/ -#define EMAC_EMACRX (BIT(2)) -#define EMAC_EMACRX_M (BIT(2)) -#define EMAC_EMACRX_V 0x1 -#define EMAC_EMACRX_S 2 -/* EMAC_PLTF : R/W ;bitpos:[1:0] ;default: 2'h0 ; */ -/*description: These bits control the number of preamble bytes that are added - to the beginning of every Transmit frame. The preamble reduction occurs only when the MAC is operating in the full-duplex mode.2'b00: 7 bytes of preamble. 2'b01: 5 bytes of preamble. 2'b10: 3 bytes of preamble.*/ -#define EMAC_PLTF 0x00000003 -#define EMAC_PLTF_M ((EMAC_PLTF_V)<<(EMAC_PLTF_S)) -#define EMAC_PLTF_V 0x3 -#define EMAC_PLTF_S 0 - -#define EMAC_GMACFF_REG (DR_REG_EMAC_BASE + 0x1004) -/* EMAC_RECEIVE_ALL : R/W ;bitpos:[31] ;default: 1'h0 ; */ -/*description: When this bit is set the MAC Receiver module passes all received - frames irrespective of whether they pass the address filter or not to the Application. The result of the SA or DA filtering is updated (pass or fail) in the corresponding bits in the Receive Status Word. When this bit is reset the Receiver module passes only those frames to the Application that pass the SA or DA address Filter.*/ -#define EMAC_RECEIVE_ALL (BIT(31)) -#define EMAC_RECEIVE_ALL_M (BIT(31)) -#define EMAC_RECEIVE_ALL_V 0x1 -#define EMAC_RECEIVE_ALL_S 31 -/* EMAC_SAFE : R/W ;bitpos:[9] ;default: 1'h0 ; */ -/*description: When this bit is set the MAC compares the SA field of the received - frames with the values programmed in the enabled SA registers. If the comparison fails the MAC drops the frame. When this bit is reset the MAC forwards the received frame to the application with updated SAF bit of the Rx Status depending on the SA address comparison.*/ -#define EMAC_SAFE (BIT(9)) -#define EMAC_SAFE_M (BIT(9)) -#define EMAC_SAFE_V 0x1 -#define EMAC_SAFE_S 9 -/* EMAC_SAIF : R/W ;bitpos:[8] ;default: 1'h0 ; */ -/*description: When this bit is set the Address Check block operates in inverse - filtering mode for the SA address comparison. The frames whose SA matches the SA registers are marked as failing the SA Address filter. When this bit is reset frames whose SA does not match the SA registers are marked as failing the SA Address filter.*/ -#define EMAC_SAIF (BIT(8)) -#define EMAC_SAIF_M (BIT(8)) -#define EMAC_SAIF_V 0x1 -#define EMAC_SAIF_S 8 -/* EMAC_PCF : R/W ;bitpos:[7:6] ;default: 2'h0 ; */ -/*description: These bits control the forwarding of all control frames (including - unicast and multicast Pause frames). 2'b00: MAC filters all control frames from reaching the application. 2'b01: MAC forwards all control frames except Pause frames to application even if they fail the Address filter. 2'b10: MAC forwards all control frames to application even if they fail the Address Filter. 2'b11: MAC forwards control frames that pass the Address Filter.The following conditions should be true for the Pause frames processing: Condition 1: The MAC is in the full-duplex mode and flow control is enabled by setting Bit 2 (RFE) of Register (Flow Control Register) to 1. Condition 2: The destination address (DA) of the received frame matches the special multicast address or the MAC Address 0 when Bit 3 (UP) of the Register(Flow Control Register) is set. Condition 3: The Type field of the received frame is 0x8808 and the OPCODE field is 0x0001.*/ -#define EMAC_PCF 0x00000003 -#define EMAC_PCF_M ((EMAC_PCF_V)<<(EMAC_PCF_S)) -#define EMAC_PCF_V 0x3 -#define EMAC_PCF_S 6 -/* EMAC_DBF : R/W ;bitpos:[5] ;default: 1'h0 ; */ -/*description: When this bit is set the AFM(Address Filtering Module) module - blocks all incoming broadcast frames. In addition it overrides all other filter settings. When this bit is reset the AFM module passes all received broadcast Frames.*/ -#define EMAC_DBF (BIT(5)) -#define EMAC_DBF_M (BIT(5)) -#define EMAC_DBF_V 0x1 -#define EMAC_DBF_S 5 -/* EMAC_PAM : R/W ;bitpos:[4] ;default: 1'h0 ; */ -/*description: When set this bit indicates that all received frames with a - multicast destination address (first bit in the destination address field is '1') are passed.*/ -#define EMAC_PAM (BIT(4)) -#define EMAC_PAM_M (BIT(4)) -#define EMAC_PAM_V 0x1 -#define EMAC_PAM_S 4 -/* EMAC_DAIF : R/W ;bitpos:[3] ;default: 1'h0 ; */ -/*description: When this bit is set the Address Check block operates in inverse - filtering mode for the DA address comparison for both unicast and multicast frames. When reset normal filtering of frames is performed.*/ -#define EMAC_DAIF (BIT(3)) -#define EMAC_DAIF_M (BIT(3)) -#define EMAC_DAIF_V 0x1 -#define EMAC_DAIF_S 3 -/* EMAC_PMODE : R/W ;bitpos:[0] ;default: 1'h0 ; */ -/*description: When this bit is set the Address Filter module passes all incoming - frames irrespective of the destination or source address. The SA or DA Filter Fails status bits of the Receive Status Word are always cleared when PR(PRI_RATIO) is set.*/ -#define EMAC_PMODE (BIT(0)) -#define EMAC_PMODE_M (BIT(0)) -#define EMAC_PMODE_V 0x1 -#define EMAC_PMODE_S 0 - -#define EMAC_GMIIADDR_REG (DR_REG_EMAC_BASE + 0x1010) -/* EMAC_MIIDEV : R/W ;bitpos:[15:11] ;default: 6'h0 ; */ -/*description: This field indicates which of the 32 possible PHY devices are being accessed.*/ -#define EMAC_MIIDEV 0x0000001F -#define EMAC_MIIDEV_M ((EMAC_MIIDEV_V)<<(EMAC_MIIDEV_S)) -#define EMAC_MIIDEV_V 0x1F -#define EMAC_MIIDEV_S 11 -/* EMAC_MIIREG : R/W ;bitpos:[10:6] ;default: 5'h0 ; */ -/*description: These bits select the desired MII register in the selected PHY device.*/ -#define EMAC_MIIREG 0x0000001F -#define EMAC_MIIREG_M ((EMAC_MIIREG_V)<<(EMAC_MIIREG_S)) -#define EMAC_MIIREG_V 0x1F -#define EMAC_MIIREG_S 6 -/* EMAC_MIICSRCLK : R/W ;bitpos:[5:2] ;default: 5'h0 ; */ -/*description: CSR clock range: 1.0 MHz ~ 2.5 MHz. 4'b0000: When the APB clock - frequency is 80 MHz the MDC clock frequency is APB CLK/42 4'b0000: When the APB clock frequency is 40 MHz the MDC clock frequency is APB CLK/26.*/ -#define EMAC_MIICSRCLK 0x0000000F -#define EMAC_MIICSRCLK_M ((EMAC_MIICSRCLK_V)<<(EMAC_MIICSRCLK_S)) -#define EMAC_MIICSRCLK_V 0xF -#define EMAC_MIICSRCLK_S 2 -/* EMAC_MIIWRITE : R/W ;bitpos:[1] ;default: 1'h0 ; */ -/*description: When set this bit indicates to the PHY that this is a Write - operation using the MII Data register. If this bit is not set it indicates that this is a Read operation that is placing the data in the MII Data register.*/ -#define EMAC_MIIWRITE (BIT(1)) -#define EMAC_MIIWRITE_M (BIT(1)) -#define EMAC_MIIWRITE_V 0x1 -#define EMAC_MIIWRITE_S 1 -/* EMAC_MIIBUSY : R_WS_SC ;bitpos:[0] ;default: 1'h0 ; */ -/*description: This bit should read logic 0 before writing to PHY Addr Register - and PHY data Register.During a PHY register access the software sets this bit to 1'b1 to indicate that a Read or Write access is in progress. PHY data Register is invalid until this bit is cleared by the MAC. Therefore PHY data Register (MII Data) should be kept valid until the MAC clears this bit during a PHY Write operation. Similarly for a read operation the contents of Register 5 are not valid until this bit is cleared. The subsequent read or write operation should happen only after the previous operation is complete. Because there is no acknowledgment from the PHY to MAC after a read or write operation is completed there is no change in the functionality of this bit even when the PHY is not Present.*/ -#define EMAC_MIIBUSY (BIT(0)) -#define EMAC_MIIBUSY_M (BIT(0)) -#define EMAC_MIIBUSY_V 0x1 -#define EMAC_MIIBUSY_S 0 - -#define EMAC_MIIDATA_REG (DR_REG_EMAC_BASE + 0x1014) -/* EMAC_MII_DATA : R/W ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: This field contains the 16-bit data value read from the PHY after - a Management Read operation or the 16-bit data value to be written to the PHY before a Management Write operation.*/ -#define EMAC_MII_DATA 0x0000FFFF -#define EMAC_MII_DATA_M ((EMAC_MII_DATA_V)<<(EMAC_MII_DATA_S)) -#define EMAC_MII_DATA_V 0xFFFF -#define EMAC_MII_DATA_S 0 - -#define EMAC_GMACFC_REG (DR_REG_EMAC_BASE + 0x1018) -/* EMAC_PAUSE_TIME : R/W ;bitpos:[31:16] ;default: 16'h0 ; */ -/*description: This field holds the value to be used in the Pause Time field - in the transmit control frame. If the Pause Time bits is configured to be double-synchronized to the MII clock domain then consecutive writes to this register should be performed only after at least four clock cycles in the destination clock domain.*/ -#define EMAC_PAUSE_TIME 0x0000FFFF -#define EMAC_PAUSE_TIME_M ((EMAC_PAUSE_TIME_V)<<(EMAC_PAUSE_TIME_S)) -#define EMAC_PAUSE_TIME_V 0xFFFF -#define EMAC_PAUSE_TIME_S 16 -/* EMAC_DZPQ : R/W ;bitpos:[7] ;default: 1'h0 ; */ -/*description: When this bit is set it disables the automatic generation of - the Zero-Quanta Pause frames on the de-assertion of the flow-control signal from the FIFO layer. When this bit is reset normal operation with automatic Zero-Quanta Pause frame generation is enabled.*/ -#define EMAC_DZPQ (BIT(7)) -#define EMAC_DZPQ_M (BIT(7)) -#define EMAC_DZPQ_V 0x1 -#define EMAC_DZPQ_S 7 -/* EMAC_PLT : R/W ;bitpos:[5:4] ;default: 2'h0 ; */ -/*description: This field configures the threshold of the Pause timer automatic - retransmission of the Pause frame.The threshold values should be always less than the Pause Time configured in Bits[31:16]. For example if PT = 100H (256 slot-times) and PLT = 01 then a second Pause frame is automatically transmitted at 228 (256-28) slot times after the first Pause frame is transmitted. The following list provides the threshold values for different values: 2'b00: The threshold is Pause time minus 4 slot times (PT-4 slot times). 2'b01: The threshold is Pause time minus 28 slot times (PT-28 slot times). 2'b10: The threshold is Pause time minus 144 slot times (PT-144 slot times). 2'b11: The threshold is Pause time minus 256 slot times (PT-256 slot times). The slot time is defined as the time taken to transmit 512 bits (64 bytes) on the MII interface.*/ -#define EMAC_PLT 0x00000003 -#define EMAC_PLT_M ((EMAC_PLT_V)<<(EMAC_PLT_S)) -#define EMAC_PLT_V 0x3 -#define EMAC_PLT_S 4 -/* EMAC_UPFD : R/W ;bitpos:[3] ;default: 1'h0 ; */ -/*description: A pause frame is processed when it has the unique multicast address - specified in the IEEE Std 802.3. When this bit is set the MAC can also detect Pause frames with unicast address of the station. This unicast address should be as specified in the EMACADDR0 High Register and EMACADDR0 Low Register. When this bit is reset the MAC only detects Pause frames with unique multicast address.*/ -#define EMAC_UPFD (BIT(3)) -#define EMAC_UPFD_M (BIT(3)) -#define EMAC_UPFD_V 0x1 -#define EMAC_UPFD_S 3 -/* EMAC_RFCE : R/W ;bitpos:[2] ;default: 1'h0 ; */ -/*description: When this bit is set the MAC decodes the received Pause frame - and disables its transmitter for a specified (Pause) time. When this bit is reset the decode function of the Pause frame is disabled.*/ -#define EMAC_RFCE (BIT(2)) -#define EMAC_RFCE_M (BIT(2)) -#define EMAC_RFCE_V 0x1 -#define EMAC_RFCE_S 2 -/* EMAC_TFCE : R/W ;bitpos:[1] ;default: 1'h0 ; */ -/*description: In the full-duplex mode when this bit is set the MAC enables - the flow control operation to transmit Pause frames. When this bit is reset the flow control operation in the MAC is disabled and the MAC does not transmit any Pause frames. In the half-duplex mode when this bit is set the MAC enables the backpressure operation. When this bit is reset the backpressure feature is Disabled.*/ -#define EMAC_TFCE (BIT(1)) -#define EMAC_TFCE_M (BIT(1)) -#define EMAC_TFCE_V 0x1 -#define EMAC_TFCE_S 1 -/* EMAC_FCBBA : R_WS_SC(FCB)/R_W(BPA) ;bitpos:[0] ;default: 1'h0 ; */ -/*description: This bit initiates a Pause frame in the full-duplex mode and - activates the backpressure function in the half-duplex mode if the TFCE bit is set. In the full-duplex mode this bit should be read as 1'b0 before writing to the Flow Control register. To initiate a Pause frame the Application must set this bit to 1'b1. During a transfer of the Control Frame this bit continues to be set to signify that a frame transmission is in progress. After the completion of Pause frame transmission the MAC resets this bit to 1'b0. The Flow Control register should not be written to until this bit is cleared. In the half-duplex mode when this bit is set (and TFCE is set) then backpressure is asserted by the MAC. During backpressure when the MAC receives a new frame the transmitter starts sending a JAM pattern resulting in a collision. When the MAC is configured for the full-duplex mode the BPA(backpressure activate) is automatically disabled.*/ -#define EMAC_FCBBA (BIT(0)) -#define EMAC_FCBBA_M (BIT(0)) -#define EMAC_FCBBA_V 0x1 -#define EMAC_FCBBA_S 0 - -#define EMAC_DEBUG_REG (DR_REG_EMAC_BASE + 0x1024) -/* EMAC_MTLTSFFS : RO ;bitpos:[25] ;default: 1'h0 ; */ -/*description: When high this bit indicates that the MTL TxStatus FIFO is full. - Therefore the MTL cannot accept any more frames for transmission.*/ -#define EMAC_MTLTSFFS (BIT(25)) -#define EMAC_MTLTSFFS_M (BIT(25)) -#define EMAC_MTLTSFFS_V 0x1 -#define EMAC_MTLTSFFS_S 25 -/* EMAC_MTLTFNES : RO ;bitpos:[24] ;default: 1'h0 ; */ -/*description: When high this bit indicates that the MTL Tx FIFO is not empty - and some data is left for Transmission.*/ -#define EMAC_MTLTFNES (BIT(24)) -#define EMAC_MTLTFNES_M (BIT(24)) -#define EMAC_MTLTFNES_V 0x1 -#define EMAC_MTLTFNES_S 24 -/* EMAC_MTLTFWCS : RO ;bitpos:[22] ;default: 1'h0 ; */ -/*description: When high this bit indicates that the MTL Tx FIFO Write Controller - is active and is transferring data to the Tx FIFO.*/ -#define EMAC_MTLTFWCS (BIT(22)) -#define EMAC_MTLTFWCS_M (BIT(22)) -#define EMAC_MTLTFWCS_V 0x1 -#define EMAC_MTLTFWCS_S 22 -/* EMAC_MTLTFRCS : RO ;bitpos:[21:20] ;default: 2'h0 ; */ -/*description: This field indicates the state of the Tx FIFO Read Controller: - 2'b00: IDLE state. 2'b01: READ state (transferring data to the MAC transmitter). 2'b10: Waiting for TxStatus from the MAC transmitter. 2'b11: Writing the received TxStatus or flushing the Tx FIFO.*/ -#define EMAC_MTLTFRCS 0x00000003 -#define EMAC_MTLTFRCS_M ((EMAC_MTLTFRCS_V)<<(EMAC_MTLTFRCS_S)) -#define EMAC_MTLTFRCS_V 0x3 -#define EMAC_MTLTFRCS_S 20 -/* EMAC_MACTP : RO ;bitpos:[19] ;default: 1'h0 ; */ -/*description: When high this bit indicates that the MAC transmitter is in - the Pause condition (in the full-duplex-mode) and hence does not schedule any frame for transmission.*/ -#define EMAC_MACTP (BIT(19)) -#define EMAC_MACTP_M (BIT(19)) -#define EMAC_MACTP_V 0x1 -#define EMAC_MACTP_S 19 -/* EMAC_MACTFCS : RO ;bitpos:[18:17] ;default: 2'h0 ; */ -/*description: This field indicates the state of the MAC Transmit Frame Controller - module: 2'b00: IDLE state. 2'b01: Waiting for status of previous frame or IFG or backoff period to be over. 2'b10: Generating and transmitting a Pause frame (in the full-duplex mode). 2'b11: Transferring input frame for transmission.*/ -#define EMAC_MACTFCS 0x00000003 -#define EMAC_MACTFCS_M ((EMAC_MACTFCS_V)<<(EMAC_MACTFCS_S)) -#define EMAC_MACTFCS_V 0x3 -#define EMAC_MACTFCS_S 17 -/* EMAC_MACTPES : RO ;bitpos:[16] ;default: 1'h0 ; */ -/*description: When high this bit indicates that the MAC MII transmit protocol - engine is actively transmitting data and is not in the IDLE state.*/ -#define EMAC_MACTPES (BIT(16)) -#define EMAC_MACTPES_M (BIT(16)) -#define EMAC_MACTPES_V 0x1 -#define EMAC_MACTPES_S 16 -/* EMAC_MTLRFFLS : RO ;bitpos:[9:8] ;default: 2'h0 ; */ -/*description: This field gives the status of the fill-level of the Rx FIFO: - 2'b00: Rx FIFO Empty. 2'b01: Rx FIFO fill-level below flow-control deactivate threshold. 2'b10: Rx FIFO fill-level above flow-control activate threshold. 2'b11: Rx FIFO Full.*/ -#define EMAC_MTLRFFLS 0x00000003 -#define EMAC_MTLRFFLS_M ((EMAC_MTLRFFLS_V)<<(EMAC_MTLRFFLS_S)) -#define EMAC_MTLRFFLS_V 0x3 -#define EMAC_MTLRFFLS_S 8 -/* EMAC_MTLRFRCS : RO ;bitpos:[6:5] ;default: 2'h0 ; */ -/*description: This field gives the state of the Rx FIFO read Controller: 2'b00: - IDLE state.2'b01: Reading frame data.2'b10: Reading frame status (or timestamp).2'b11: Flushing the frame data and status.*/ -#define EMAC_MTLRFRCS 0x00000003 -#define EMAC_MTLRFRCS_M ((EMAC_MTLRFRCS_V)<<(EMAC_MTLRFRCS_S)) -#define EMAC_MTLRFRCS_V 0x3 -#define EMAC_MTLRFRCS_S 5 -/* EMAC_MTLRFWCAS : RO ;bitpos:[4] ;default: 1'h0 ; */ -/*description: When high this bit indicates that the MTL Rx FIFO Write Controller - is active and is transferring a received frame to the FIFO.*/ -#define EMAC_MTLRFWCAS (BIT(4)) -#define EMAC_MTLRFWCAS_M (BIT(4)) -#define EMAC_MTLRFWCAS_V 0x1 -#define EMAC_MTLRFWCAS_S 4 -/* EMAC_MACRFFCS : RO ;bitpos:[2:1] ;default: 2'h0 ; */ -/*description: When high this field indicates the active state of the FIFO - Read and Write controllers of the MAC Receive Frame Controller Module. MACRFFCS[1] represents the status of FIFO Read controller. MACRFFCS[0] represents the status of small FIFO Write controller.*/ -#define EMAC_MACRFFCS 0x00000003 -#define EMAC_MACRFFCS_M ((EMAC_MACRFFCS_V)<<(EMAC_MACRFFCS_S)) -#define EMAC_MACRFFCS_V 0x3 -#define EMAC_MACRFFCS_S 1 -/* EMAC_MACRPES : RO ;bitpos:[0] ;default: 1'h0 ; */ -/*description: When high this bit indicates that the MAC MII receive protocol - engine is actively receiving data and not in IDLE state.*/ -#define EMAC_MACRPES (BIT(0)) -#define EMAC_MACRPES_M (BIT(0)) -#define EMAC_MACRPES_V 0x1 -#define EMAC_MACRPES_S 0 - -#define EMAC_PMT_RWUFFR_REG (DR_REG_EMAC_BASE + 0x1028) -/* EMAC_WKUPPKTFILTER : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: The MSB (31st bit) must be zero.Bit j[30:0] is the byte mask. - If Bit 1/2/3/4 (byte number) of the byte mask is set the CRC block processes the Filter 0/1/2/3 Offset + j of the incoming packet(PWKPTR is 0/1/2/3).RWKPTR is 0:Filter 0 Byte Mask .RWKPTR is 1:Filter 1 Byte Mask RWKPTR is 2:Filter 2 Byte Mask RWKPTR is 3:Filter 3 Byte Mask RWKPTR is 4:Bit 3/11/19/27 specifies the address type defining the destination address type of the pattern.When the bit is set the pattern applies to only multicast packets*/ -#define EMAC_WKUPPKTFILTER 0xFFFFFFFF -#define EMAC_WKUPPKTFILTER_M ((EMAC_WKUPPKTFILTER_V)<<(EMAC_WKUPPKTFILTER_S)) -#define EMAC_WKUPPKTFILTER_V 0xFFFFFFFF -#define EMAC_WKUPPKTFILTER_S 0 - -#define EMAC_PMT_CSR_REG (DR_REG_EMAC_BASE + 0x102C) -/* EMAC_RWKFILTRST : R_WS_SC ;bitpos:[31] ;default: 1'h0 ; */ -/*description: When this bit is set it resets the RWKPTR register to 3’b000.*/ -#define EMAC_RWKFILTRST (BIT(31)) -#define EMAC_RWKFILTRST_M (BIT(31)) -#define EMAC_RWKFILTRST_V 0x1 -#define EMAC_RWKFILTRST_S 31 -/* EMAC_RWKPTR : RO ;bitpos:[28:24] ;default: 6'h0 ; */ -/*description: The maximum value of the pointer is 7 the detail information - please refer to PMT_RWUFFR.*/ -#define EMAC_RWKPTR 0x0000001F -#define EMAC_RWKPTR_M ((EMAC_RWKPTR_V)<<(EMAC_RWKPTR_S)) -#define EMAC_RWKPTR_V 0x1F -#define EMAC_RWKPTR_S 24 -/* EMAC_GLBLUCAST : R/W ;bitpos:[9] ;default: 1'h0 ; */ -/*description: When set enables any unicast packet filtered by the MAC (DAFilter) - address recognition to be a remote wake-up frame.*/ -#define EMAC_GLBLUCAST (BIT(9)) -#define EMAC_GLBLUCAST_M (BIT(9)) -#define EMAC_GLBLUCAST_V 0x1 -#define EMAC_GLBLUCAST_S 9 -/* EMAC_RWKPRCVD : R_SS_RC ;bitpos:[6] ;default: 1'h0 ; */ -/*description: When set this bit indicates the power management event is generated - because of the reception of a remote wake-up frame. This bit is cleared by a Read into this register.*/ -#define EMAC_RWKPRCVD (BIT(6)) -#define EMAC_RWKPRCVD_M (BIT(6)) -#define EMAC_RWKPRCVD_V 0x1 -#define EMAC_RWKPRCVD_S 6 -/* EMAC_MGKPRCVD : R_SS_RC ;bitpos:[5] ;default: 1'h0 ; */ -/*description: When set this bit indicates that the power management event - is generated because of the reception of a magic packet. This bit is cleared by a Read into this register.*/ -#define EMAC_MGKPRCVD (BIT(5)) -#define EMAC_MGKPRCVD_M (BIT(5)) -#define EMAC_MGKPRCVD_V 0x1 -#define EMAC_MGKPRCVD_S 5 -/* EMAC_RWKPKTEN : R/W ;bitpos:[2] ;default: 1'h0 ; */ -/*description: When set enables generation of a power management event because - of remote wake-up frame reception*/ -#define EMAC_RWKPKTEN (BIT(2)) -#define EMAC_RWKPKTEN_M (BIT(2)) -#define EMAC_RWKPKTEN_V 0x1 -#define EMAC_RWKPKTEN_S 2 -/* EMAC_MGKPKTEN : R/W ;bitpos:[1] ;default: 1'h0 ; */ -/*description: When set enables generation of a power management event because - of magic packet reception.*/ -#define EMAC_MGKPKTEN (BIT(1)) -#define EMAC_MGKPKTEN_M (BIT(1)) -#define EMAC_MGKPKTEN_V 0x1 -#define EMAC_MGKPKTEN_S 1 -/* EMAC_PWRDWN : R_WS_SC ;bitpos:[0] ;default: 1'h0 ; */ -/*description: When set the MAC receiver drops all received frames until it - receives the expected magic packet or remote wake-up frame.This bit must only be set when MGKPKTEN GLBLUCAST or RWKPKTEN bit is set high.*/ -#define EMAC_PWRDWN (BIT(0)) -#define EMAC_PWRDWN_M (BIT(0)) -#define EMAC_PWRDWN_V 0x1 -#define EMAC_PWRDWN_S 0 - -#define EMAC_GMACLPI_CRS_REG (DR_REG_EMAC_BASE + 0x1030) -/* EMAC_LPITXA : R/W ;bitpos:[19] ;default: 1'h0 ; */ -/*description: This bit controls the behavior of the MAC when it is entering - or coming out of the LPI mode on the transmit side.If the LPITXA and LPIEN bits are set to 1 the MAC enters the LPI mode only after all outstanding frames and pending frames have been transmitted. The MAC comes out of the LPI mode when the application sends any frame.When this bit is 0 the LPIEN bit directly controls behavior of the MAC when it is entering or coming out of the LPI mode.*/ -#define EMAC_LPITXA (BIT(19)) -#define EMAC_LPITXA_M (BIT(19)) -#define EMAC_LPITXA_V 0x1 -#define EMAC_LPITXA_S 19 -/* EMAC_PLS : R/W ;bitpos:[17] ;default: 1'h0 ; */ -/*description: This bit indicates the link status of the PHY.When set the link - is considered to be okay (up) and when reset the link is considered to be down.*/ -#define EMAC_PLS (BIT(17)) -#define EMAC_PLS_M (BIT(17)) -#define EMAC_PLS_V 0x1 -#define EMAC_PLS_S 17 -/* EMAC_LPIEN : R_W_SC ;bitpos:[16] ;default: 1'h0 ; */ -/*description: When set this bit instructs the MAC Transmitter to enter the - LPI state. When reset this bit instructs the MAC to exit the LPI state and resume normal transmission.This bit is cleared when the LPITXA bit is set and the MAC exits the LPI state because of the arrival of a new packet for transmission.*/ -#define EMAC_LPIEN (BIT(16)) -#define EMAC_LPIEN_M (BIT(16)) -#define EMAC_LPIEN_V 0x1 -#define EMAC_LPIEN_S 16 -/* EMAC_RLPIST : R/W ;bitpos:[9] ;default: 1'h0 ; */ -/*description: When set this bit indicates that the MAC is receiving the LPI - pattern on the MII interface.*/ -#define EMAC_RLPIST (BIT(9)) -#define EMAC_RLPIST_M (BIT(9)) -#define EMAC_RLPIST_V 0x1 -#define EMAC_RLPIST_S 9 -/* EMAC_TLPIST : R/W ;bitpos:[8] ;default: 1'h0 ; */ -/*description: When set this bit indicates that the MAC is transmitting the - LPI pattern on the MII interface.*/ -#define EMAC_TLPIST (BIT(8)) -#define EMAC_TLPIST_M (BIT(8)) -#define EMAC_TLPIST_V 0x1 -#define EMAC_TLPIST_S 8 -/* EMAC_RLPIEX : R_SS_RC ;bitpos:[3] ;default: 1'h0 ; */ -/*description: When set this bit indicates that the MAC Receiver has stopped - receiving the LPI pattern on the MII interface exited the LPI state and resumed the normal reception. This bit is cleared by a read into this register.*/ -#define EMAC_RLPIEX (BIT(3)) -#define EMAC_RLPIEX_M (BIT(3)) -#define EMAC_RLPIEX_V 0x1 -#define EMAC_RLPIEX_S 3 -/* EMAC_RLPIEN : R_SS_RC ;bitpos:[2] ;default: 1'h0 ; */ -/*description: When set this bit indicates that the MAC Receiver has received - an LPI pattern and entered the LPI state. This bit is cleared by a read into this register.*/ -#define EMAC_RLPIEN (BIT(2)) -#define EMAC_RLPIEN_M (BIT(2)) -#define EMAC_RLPIEN_V 0x1 -#define EMAC_RLPIEN_S 2 -/* EMAC_TLPIEX : R_SS_RC ;bitpos:[1] ;default: 1'h0 ; */ -/*description: When set this bit indicates that the MAC transmitter has exited - the LPI state after the user has cleared the LPIEN bit and the LPI_TW_Timer has expired.This bit is cleared by a read into this register.*/ -#define EMAC_TLPIEX (BIT(1)) -#define EMAC_TLPIEX_M (BIT(1)) -#define EMAC_TLPIEX_V 0x1 -#define EMAC_TLPIEX_S 1 -/* EMAC_TLPIEN : R_SS_RC ;bitpos:[0] ;default: 1'h0 ; */ -/*description: When set this bit indicates that the MAC Transmitter has entered - the LPI state because of the setting of the LPIEN bit. This bit is cleared by a read into this register.*/ -#define EMAC_TLPIEN (BIT(0)) -#define EMAC_TLPIEN_M (BIT(0)) -#define EMAC_TLPIEN_V 0x1 -#define EMAC_TLPIEN_S 0 - -#define EMAC_GMACLPITIMERSCONTROL_REG (DR_REG_EMAC_BASE + 0x1034) -/* EMAC_LPI_LS_TIMER : R/W ;bitpos:[25:16] ;default: 10'h3E8 ; */ -/*description: This field specifies the minimum time (in milliseconds) for which - the link status from the PHY should be up (OKAY) before the LPI pattern can be transmitted to the PHY. The MAC does not transmit the LPI pattern even when the LPIEN bit is set unless the LPI_LS_Timer reaches the programmed terminal count. The default value of the LPI_LS_Timer is 1000 (1 sec) as defined in the IEEE standard.*/ -#define EMAC_LPI_LS_TIMER 0x000003FF -#define EMAC_LPI_LS_TIMER_M ((EMAC_LPI_LS_TIMER_V)<<(EMAC_LPI_LS_TIMER_S)) -#define EMAC_LPI_LS_TIMER_V 0x3FF -#define EMAC_LPI_LS_TIMER_S 16 -/* EMAC_LPI_TW_TIMER : R/W ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: This field specifies the minimum time (in microseconds) for which - the MAC waits after it stops transmitting the LPI pattern to the PHY and before it resumes the normal transmission. The TLPIEX status bit is set after the expiry of this timer.*/ -#define EMAC_LPI_TW_TIMER 0x0000FFFF -#define EMAC_LPI_TW_TIMER_M ((EMAC_LPI_TW_TIMER_V)<<(EMAC_LPI_TW_TIMER_S)) -#define EMAC_LPI_TW_TIMER_V 0xFFFF -#define EMAC_LPI_TW_TIMER_S 0 - -#define EMAC_INTS_REG (DR_REG_EMAC_BASE + 0x1038) -/* EMAC_LPIIS : RO ;bitpos:[10] ;default: 1'h0 ; */ -/*description: When the Energy Efficient Ethernet feature is enabled this bit - is set for any LPI state entry or exit in the MAC Transmitter or Receiver. This bit is cleared on reading Bit[0] of Register (LPI Control and Status Register).*/ -#define EMAC_LPIIS (BIT(10)) -#define EMAC_LPIIS_M (BIT(10)) -#define EMAC_LPIIS_V 0x1 -#define EMAC_LPIIS_S 10 -/* EMAC_PMTINTS : RO ;bitpos:[3] ;default: 1'h0 ; */ -/*description: This bit is set when a magic packet or remote wake-up frame is - received in the power-down mode (see Bit[5] and Bit[6] in the PMT Control and Status Register). This bit is cleared when both Bits[6:5] are cleared because of a read operation to the PMT Control and Status register. This bit is valid only when you select the optional PMT module during core configuration.*/ -#define EMAC_PMTINTS (BIT(3)) -#define EMAC_PMTINTS_M (BIT(3)) -#define EMAC_PMTINTS_V 0x1 -#define EMAC_PMTINTS_S 3 - -#define EMAC_INTMASK_REG (DR_REG_EMAC_BASE + 0x103C) -/* EMAC_LPIINTMASK : R/W ;bitpos:[10] ;default: 1'h0 ; */ -/*description: When set this bit disables the assertion of the interrupt signal - because of the setting of the LPI Interrupt Status bit in Register (Interrupt Status Register).*/ -#define EMAC_LPIINTMASK (BIT(10)) -#define EMAC_LPIINTMASK_M (BIT(10)) -#define EMAC_LPIINTMASK_V 0x1 -#define EMAC_LPIINTMASK_S 10 -/* EMAC_PMTINTMASK : R/W ;bitpos:[3] ;default: 1'h0 ; */ -/*description: When set this bit disables the assertion of the interrupt signal - because of the setting of PMT Interrupt Status bit in Register (Interrupt Status Register).*/ -#define EMAC_PMTINTMASK (BIT(3)) -#define EMAC_PMTINTMASK_M (BIT(3)) -#define EMAC_PMTINTMASK_V 0x1 -#define EMAC_PMTINTMASK_S 3 - -#define EMAC_ADDR0HIGH_REG (DR_REG_EMAC_BASE + 0x1040) -/* EMAC_ADDRESS_ENABLE0 : RO ;bitpos:[31] ;default: 1'h0 ; */ -/*description: This bit is always set to 1.*/ -#define EMAC_ADDRESS_ENABLE0 (BIT(31)) -#define EMAC_ADDRESS_ENABLE0_M (BIT(31)) -#define EMAC_ADDRESS_ENABLE0_V 0x1 -#define EMAC_ADDRESS_ENABLE0_S 31 -/* EMAC_ADDRESS0_HI : R/W ;bitpos:[15:0] ;default: 16'hFFFF ; */ -/*description: This field contains the upper 16 bits (47:32) of the first 6-byte - MAC address.The MAC uses this field for filtering the received frames and inserting the MAC address in the Transmit Flow Control (Pause) Frames.*/ -#define EMAC_ADDRESS0_HI 0x0000FFFF -#define EMAC_ADDRESS0_HI_M ((EMAC_ADDRESS0_HI_V)<<(EMAC_ADDRESS0_HI_S)) -#define EMAC_ADDRESS0_HI_V 0xFFFF -#define EMAC_ADDRESS0_HI_S 0 - -#define EMAC_ADDR0LOW_REG (DR_REG_EMAC_BASE + 0x1044) -/* EMAC_MAC_ADDRESS0_LOW : R/W ;bitpos:[31:0] ;default: 32'hFFFFFFFF ; */ -/*description: This field contains the lower 32 bits of the first 6-byte MAC - address. This is used by the MAC for filtering the received frames and inserting the MAC address in the Transmit Flow Control (Pause) Frames.*/ -#define EMAC_MAC_ADDRESS0_LOW 0xFFFFFFFF -#define EMAC_MAC_ADDRESS0_LOW_M ((EMAC_MAC_ADDRESS0_LOW_V)<<(EMAC_MAC_ADDRESS0_LOW_S)) -#define EMAC_MAC_ADDRESS0_LOW_V 0xFFFFFFFF -#define EMAC_MAC_ADDRESS0_LOW_S 0 - -#define EMAC_ADDR1HIGH_REG (DR_REG_EMAC_BASE + 0x1048) -/* EMAC_ADDRESS_ENABLE1 : R/W ;bitpos:[31] ;default: 1'h0 ; */ -/*description: When this bit is set the address filter module uses the second - MAC address for perfect filtering. When this bit is reset the address filter module ignores the address for filtering.*/ -#define EMAC_ADDRESS_ENABLE1 (BIT(31)) -#define EMAC_ADDRESS_ENABLE1_M (BIT(31)) -#define EMAC_ADDRESS_ENABLE1_V 0x1 -#define EMAC_ADDRESS_ENABLE1_S 31 -/* EMAC_SOURCE_ADDRESS : R/W ;bitpos:[30] ;default: 1'h0 ; */ -/*description: When this bit is set the EMACADDR1[47:0] is used to compare - with the SA fields of the received frame. When this bit is reset the EMACADDR1[47:0] is used to compare with the DA fields of the received frame.*/ -#define EMAC_SOURCE_ADDRESS (BIT(30)) -#define EMAC_SOURCE_ADDRESS_M (BIT(30)) -#define EMAC_SOURCE_ADDRESS_V 0x1 -#define EMAC_SOURCE_ADDRESS_S 30 -/* EMAC_MASK_BYTE_CONTROL : R/W ;bitpos:[29:24] ;default: 6'h0 ; */ -/*description: These bits are mask control bits for comparison of each of the - EMACADDR1 bytes. When set high the MAC does not compare the corresponding byte of received DA or SA with the contents of EMACADDR1 registers. Each bit controls the masking of the bytes as follows: Bit[29]: EMACADDR1 High [15:8]. Bit[28]: EMACADDR1 High [7:0]. Bit[27]: EMACADDR1 Low [31:24]. Bit[24]: EMACADDR1 Low [7:0].You can filter a group of addresses (known as group address filtering) by masking one or more bytes of the address.*/ -#define EMAC_MASK_BYTE_CONTROL 0x0000003F -#define EMAC_MASK_BYTE_CONTROL_M ((EMAC_MASK_BYTE_CONTROL_V)<<(EMAC_MASK_BYTE_CONTROL_S)) -#define EMAC_MASK_BYTE_CONTROL_V 0x3F -#define EMAC_MASK_BYTE_CONTROL_S 24 -/* EMAC_MAC_ADDRESS1_HI : R/W ;bitpos:[15:0] ;default: 16'hFFFF ; */ -/*description: This field contains the upper 16 bits Bits[47:32] of the second - 6-byte MAC Address.*/ -#define EMAC_MAC_ADDRESS1_HI 0x0000FFFF -#define EMAC_MAC_ADDRESS1_HI_M ((EMAC_MAC_ADDRESS1_HI_V)<<(EMAC_MAC_ADDRESS1_HI_S)) -#define EMAC_MAC_ADDRESS1_HI_V 0xFFFF -#define EMAC_MAC_ADDRESS1_HI_S 0 - -#define EMAC_ADDR1LOW_REG (DR_REG_EMAC_BASE + 0x104C) -/* EMAC_MAC_ADDRESS1_LOW : R/W ;bitpos:[31:0] ;default: 32'hFFFFFFFF ; */ -/*description: This field contains the lower 32 bits of the second 6-byte MAC - address.The content of this field is undefined so the register needs to be configured after the initialization Process.*/ -#define EMAC_MAC_ADDRESS1_LOW 0xFFFFFFFF -#define EMAC_MAC_ADDRESS1_LOW_M ((EMAC_MAC_ADDRESS1_LOW_V)<<(EMAC_MAC_ADDRESS1_LOW_S)) -#define EMAC_MAC_ADDRESS1_LOW_V 0xFFFFFFFF -#define EMAC_MAC_ADDRESS1_LOW_S 0 - -#define EMAC_ADDR2HIGH_REG (DR_REG_EMAC_BASE + 0x1050) -/* EMAC_ADDRESS_ENABLE2 : R/W ;bitpos:[31] ;default: 1'h0 ; */ -/*description: When this bit is set the address filter module uses the third - MAC address for perfect filtering. When this bit is reset the address filter module ignores the address for filtering.*/ -#define EMAC_ADDRESS_ENABLE2 (BIT(31)) -#define EMAC_ADDRESS_ENABLE2_M (BIT(31)) -#define EMAC_ADDRESS_ENABLE2_V 0x1 -#define EMAC_ADDRESS_ENABLE2_S 31 -/* EMAC_SOURCE_ADDRESS2 : R/W ;bitpos:[30] ;default: 1'h0 ; */ -/*description: When this bit is set the EMACADDR2[47:0] is used to compare - with the SA fields of the received frame. When this bit is reset the EMACADDR2[47:0] is used to compare with the DA fields of the received frame.*/ -#define EMAC_SOURCE_ADDRESS2 (BIT(30)) -#define EMAC_SOURCE_ADDRESS2_M (BIT(30)) -#define EMAC_SOURCE_ADDRESS2_V 0x1 -#define EMAC_SOURCE_ADDRESS2_S 30 -/* EMAC_MASK_BYTE_CONTROL2 : R/W ;bitpos:[29:24] ;default: 6'h0 ; */ -/*description: These bits are mask control bits for comparison of each of the - EMACADDR2 bytes. When set high the MAC does not compare the corresponding byte of received DA or SA with the contents of EMACADDR2 registers. Each bit controls the masking of the bytes as follows: Bit[29]: EMACADDR2 High [15:8]. Bit[28]: EMACADDR2 High [7:0]. Bit[27]: EMACADDR2 Low [31:24]. Bit[24]: EMACADDR2 Low [7:0].You can filter a group of addresses (known as group address filtering) by masking one or more bytes of the address.*/ -#define EMAC_MASK_BYTE_CONTROL2 0x0000003F -#define EMAC_MASK_BYTE_CONTROL2_M ((EMAC_MASK_BYTE_CONTROL2_V)<<(EMAC_MASK_BYTE_CONTROL2_S)) -#define EMAC_MASK_BYTE_CONTROL2_V 0x3F -#define EMAC_MASK_BYTE_CONTROL2_S 24 -/* EMAC_MAC_ADDRESS2_HI : R/W ;bitpos:[15:0] ;default: 16'hFFFF ; */ -/*description: This field contains the upper 16 bits Bits[47:32] of the third - 6-byte MAC address.*/ -#define EMAC_MAC_ADDRESS2_HI 0x0000FFFF -#define EMAC_MAC_ADDRESS2_HI_M ((EMAC_MAC_ADDRESS2_HI_V)<<(EMAC_MAC_ADDRESS2_HI_S)) -#define EMAC_MAC_ADDRESS2_HI_V 0xFFFF -#define EMAC_MAC_ADDRESS2_HI_S 0 - -#define EMAC_ADDR2LOW_REG (DR_REG_EMAC_BASE + 0x1054) -/* EMAC_MAC_ADDRESS2_LOW : R/W ;bitpos:[31:0] ;default: 32'hFFFFFFFF ; */ -/*description: This field contains the lower 32 bits of the third 6-byte MAC - address. The content of this field is undefined so the register needs to be configured after the initialization process.*/ -#define EMAC_MAC_ADDRESS2_LOW 0xFFFFFFFF -#define EMAC_MAC_ADDRESS2_LOW_M ((EMAC_MAC_ADDRESS2_LOW_V)<<(EMAC_MAC_ADDRESS2_LOW_S)) -#define EMAC_MAC_ADDRESS2_LOW_V 0xFFFFFFFF -#define EMAC_MAC_ADDRESS2_LOW_S 0 - -#define EMAC_ADDR3HIGH_REG (DR_REG_EMAC_BASE + 0x1058) -/* EMAC_ADDRESS_ENABLE3 : R/W ;bitpos:[31] ;default: 1'h0 ; */ -/*description: When this bit is set the address filter module uses the fourth - MAC address for perfect filtering. When this bit is reset the address filter module ignores the address for filtering.*/ -#define EMAC_ADDRESS_ENABLE3 (BIT(31)) -#define EMAC_ADDRESS_ENABLE3_M (BIT(31)) -#define EMAC_ADDRESS_ENABLE3_V 0x1 -#define EMAC_ADDRESS_ENABLE3_S 31 -/* EMAC_SOURCE_ADDRESS3 : R/W ;bitpos:[30] ;default: 1'h0 ; */ -/*description: When this bit is set the EMACADDR3[47:0] is used to compare - with the SA fields of the received frame. When this bit is reset the EMACADDR3[47:0] is used to compare with the DA fields of the received frame.*/ -#define EMAC_SOURCE_ADDRESS3 (BIT(30)) -#define EMAC_SOURCE_ADDRESS3_M (BIT(30)) -#define EMAC_SOURCE_ADDRESS3_V 0x1 -#define EMAC_SOURCE_ADDRESS3_S 30 -/* EMAC_MASK_BYTE_CONTROL3 : R/W ;bitpos:[29:24] ;default: 6'h0 ; */ -/*description: These bits are mask control bits for comparison of each of the - EMACADDR3 bytes. When set high the MAC does not compare the corresponding byte of received DA or SA with the contents of EMACADDR3 registers. Each bit controls the masking of the bytes as follows: Bit[29]: EMACADDR3 High [15:8]. Bit[28]: EMACADDR3 High [7:0]. Bit[27]: EMACADDR3 Low [31:24]. Bit[24]: EMACADDR3 Low [7:0].You can filter a group of addresses (known as group address filtering) by masking one or more bytes of the address.*/ -#define EMAC_MASK_BYTE_CONTROL3 0x0000003F -#define EMAC_MASK_BYTE_CONTROL3_M ((EMAC_MASK_BYTE_CONTROL3_V)<<(EMAC_MASK_BYTE_CONTROL3_S)) -#define EMAC_MASK_BYTE_CONTROL3_V 0x3F -#define EMAC_MASK_BYTE_CONTROL3_S 24 -/* EMAC_MAC_ADDRESS3_HI : R/W ;bitpos:[15:0] ;default: 16'hFFFF ; */ -/*description: This field contains the upper 16 bits Bits[47:32] of the fourth - 6-byte MAC address.*/ -#define EMAC_MAC_ADDRESS3_HI 0x0000FFFF -#define EMAC_MAC_ADDRESS3_HI_M ((EMAC_MAC_ADDRESS3_HI_V)<<(EMAC_MAC_ADDRESS3_HI_S)) -#define EMAC_MAC_ADDRESS3_HI_V 0xFFFF -#define EMAC_MAC_ADDRESS3_HI_S 0 - -#define EMAC_ADDR3LOW_REG (DR_REG_EMAC_BASE + 0x105C) -/* EMAC_MAC_ADDRESS3_LOW : R/W ;bitpos:[31:0] ;default: 32'hFFFFFFFF ; */ -/*description: This field contains the lower 32 bits of the fourth 6-byte MAC - address.The content of this field is undefined so the register needs to be configured after the initialization Process.*/ -#define EMAC_MAC_ADDRESS3_LOW 0xFFFFFFFF -#define EMAC_MAC_ADDRESS3_LOW_M ((EMAC_MAC_ADDRESS3_LOW_V)<<(EMAC_MAC_ADDRESS3_LOW_S)) -#define EMAC_MAC_ADDRESS3_LOW_V 0xFFFFFFFF -#define EMAC_MAC_ADDRESS3_LOW_S 0 - -#define EMAC_ADDR4HIGH_REG (DR_REG_EMAC_BASE + 0x1060) -/* EMAC_ADDRESS_ENABLE4 : R/W ;bitpos:[31] ;default: 1'h0 ; */ -/*description: When this bit is set the address filter module uses the fifth - MAC address for perfect filtering. When this bit is reset the address filter module ignores the address for filtering.*/ -#define EMAC_ADDRESS_ENABLE4 (BIT(31)) -#define EMAC_ADDRESS_ENABLE4_M (BIT(31)) -#define EMAC_ADDRESS_ENABLE4_V 0x1 -#define EMAC_ADDRESS_ENABLE4_S 31 -/* EMAC_SOURCE_ADDRESS4 : R/W ;bitpos:[30] ;default: 1'h0 ; */ -/*description: When this bit is set the EMACADDR4[47:0] is used to compare - with the SA fields of the received frame. When this bit is reset the EMACADDR4[47:0] is used to compare with the DA fields of the received frame.*/ -#define EMAC_SOURCE_ADDRESS4 (BIT(30)) -#define EMAC_SOURCE_ADDRESS4_M (BIT(30)) -#define EMAC_SOURCE_ADDRESS4_V 0x1 -#define EMAC_SOURCE_ADDRESS4_S 30 -/* EMAC_MASK_BYTE_CONTROL4 : R/W ;bitpos:[29:24] ;default: 6'h0 ; */ -/*description: These bits are mask control bits for comparison of each of the - EMACADDR4 bytes. When set high the MAC does not compare the corresponding byte of received DA or SA with the contents of EMACADDR4 registers. Each bit controls the masking of the bytes as follows: Bit[29]: EMACADDR4 High [15:8]. Bit[28]: EMACADDR4 High [7:0]. Bit[27]: EMACADDR4 Low [31:24]. Bit[24]: EMACADDR4 Low [7:0].You can filter a group of addresses (known as group address filtering) by masking one or more bytes of the address.*/ -#define EMAC_MASK_BYTE_CONTROL4 0x0000003F -#define EMAC_MASK_BYTE_CONTROL4_M ((EMAC_MASK_BYTE_CONTROL4_V)<<(EMAC_MASK_BYTE_CONTROL4_S)) -#define EMAC_MASK_BYTE_CONTROL4_V 0x3F -#define EMAC_MASK_BYTE_CONTROL4_S 24 -/* EMAC_MAC_ADDRESS4_HI : R/W ;bitpos:[15:0] ;default: 16'hFFFF ; */ -/*description: This field contains the upper 16 bits Bits[47:32] of the fifth - 6-byte MAC address.*/ -#define EMAC_MAC_ADDRESS4_HI 0x0000FFFF -#define EMAC_MAC_ADDRESS4_HI_M ((EMAC_MAC_ADDRESS4_HI_V)<<(EMAC_MAC_ADDRESS4_HI_S)) -#define EMAC_MAC_ADDRESS4_HI_V 0xFFFF -#define EMAC_MAC_ADDRESS4_HI_S 0 - -#define EMAC_ADDR4LOW_REG (DR_REG_EMAC_BASE + 0x1064) -/* EMAC_MAC_ADDRESS4_LOW : R/W ;bitpos:[31:0] ;default: 32'hFFFFFFFF ; */ -/*description: This field contains the lower 32 bits of the fifth 6-byte MAC - address. The content of this field is undefined so the register needs to be configured after the initialization process.*/ -#define EMAC_MAC_ADDRESS4_LOW 0xFFFFFFFF -#define EMAC_MAC_ADDRESS4_LOW_M ((EMAC_MAC_ADDRESS4_LOW_V)<<(EMAC_MAC_ADDRESS4_LOW_S)) -#define EMAC_MAC_ADDRESS4_LOW_V 0xFFFFFFFF -#define EMAC_MAC_ADDRESS4_LOW_S 0 - -#define EMAC_ADDR5HIGH_REG (DR_REG_EMAC_BASE + 0x1068) -/* EMAC_ADDRESS_ENABLE5 : R/W ;bitpos:[31] ;default: 1'h0 ; */ -/*description: When this bit is set the address filter module uses the sixth - MAC address for perfect filtering. When this bit is reset the address filter module ignores the address for filtering.*/ -#define EMAC_ADDRESS_ENABLE5 (BIT(31)) -#define EMAC_ADDRESS_ENABLE5_M (BIT(31)) -#define EMAC_ADDRESS_ENABLE5_V 0x1 -#define EMAC_ADDRESS_ENABLE5_S 31 -/* EMAC_SOURCE_ADDRESS5 : R/W ;bitpos:[30] ;default: 1'h0 ; */ -/*description: When this bit is set the EMACADDR5[47:0] is used to compare - with the SA fields of the received frame. When this bit is reset the EMACADDR5[47:0] is used to compare with the DA fields of the received frame.*/ -#define EMAC_SOURCE_ADDRESS5 (BIT(30)) -#define EMAC_SOURCE_ADDRESS5_M (BIT(30)) -#define EMAC_SOURCE_ADDRESS5_V 0x1 -#define EMAC_SOURCE_ADDRESS5_S 30 -/* EMAC_MASK_BYTE_CONTROL5 : R/W ;bitpos:[29:24] ;default: 6'h0 ; */ -/*description: These bits are mask control bits for comparison of each of the - EMACADDR5 bytes. When set high the MAC does not compare the corresponding byte of received DA or SA with the contents of EMACADDR5 registers. Each bit controls the masking of the bytes as follows: Bit[29]: EMACADDR5 High [15:8]. Bit[28]: EMACADDR5 High [7:0]. Bit[27]: EMACADDR5 Low [31:24]. Bit[24]: EMACADDR5 Low [7:0].You can filter a group of addresses (known as group address filtering) by masking one or more bytes of the address.*/ -#define EMAC_MASK_BYTE_CONTROL5 0x0000003F -#define EMAC_MASK_BYTE_CONTROL5_M ((EMAC_MASK_BYTE_CONTROL5_V)<<(EMAC_MASK_BYTE_CONTROL5_S)) -#define EMAC_MASK_BYTE_CONTROL5_V 0x3F -#define EMAC_MASK_BYTE_CONTROL5_S 24 -/* EMAC_MAC_ADDRESS5_HI : R/W ;bitpos:[15:0] ;default: 16'hFFFF ; */ -/*description: This field contains the upper 16 bits Bits[47:32] of the sixth - 6-byte MAC address.*/ -#define EMAC_MAC_ADDRESS5_HI 0x0000FFFF -#define EMAC_MAC_ADDRESS5_HI_M ((EMAC_MAC_ADDRESS5_HI_V)<<(EMAC_MAC_ADDRESS5_HI_S)) -#define EMAC_MAC_ADDRESS5_HI_V 0xFFFF -#define EMAC_MAC_ADDRESS5_HI_S 0 - -#define EMAC_ADDR5LOW_REG (DR_REG_EMAC_BASE + 0x106C) -/* EMAC_MAC_ADDRESS5_LOW : R/W ;bitpos:[31:0] ;default: 32'hFFFFFFFF ; */ -/*description: This field contains the lower 32 bits of the sixth 6-byte MAC - address. The content of this field is undefined so the register needs to be configured after the initialization process.*/ -#define EMAC_MAC_ADDRESS5_LOW 0xFFFFFFFF -#define EMAC_MAC_ADDRESS5_LOW_M ((EMAC_MAC_ADDRESS5_LOW_V)<<(EMAC_MAC_ADDRESS5_LOW_S)) -#define EMAC_MAC_ADDRESS5_LOW_V 0xFFFFFFFF -#define EMAC_MAC_ADDRESS5_LOW_S 0 - -#define EMAC_ADDR6HIGH_REG (DR_REG_EMAC_BASE + 0x1070) -/* EMAC_ADDRESS_ENABLE6 : R/W ;bitpos:[31] ;default: 1'h0 ; */ -/*description: When this bit is set the address filter module uses the seventh - MAC address for perfect filtering. When this bit is reset the address filter module ignores the address for filtering.*/ -#define EMAC_ADDRESS_ENABLE6 (BIT(31)) -#define EMAC_ADDRESS_ENABLE6_M (BIT(31)) -#define EMAC_ADDRESS_ENABLE6_V 0x1 -#define EMAC_ADDRESS_ENABLE6_S 31 -/* EMAC_SOURCE_ADDRESS6 : R/W ;bitpos:[30] ;default: 1'h0 ; */ -/*description: When this bit is set the EMACADDR6[47:0] is used to compare - with the SA fields of the received frame. When this bit is reset the EMACADDR6[47:0] is used to compare with the DA fields of the received frame.*/ -#define EMAC_SOURCE_ADDRESS6 (BIT(30)) -#define EMAC_SOURCE_ADDRESS6_M (BIT(30)) -#define EMAC_SOURCE_ADDRESS6_V 0x1 -#define EMAC_SOURCE_ADDRESS6_S 30 -/* EMAC_MASK_BYTE_CONTROL6 : R/W ;bitpos:[29:24] ;default: 6'h0 ; */ -/*description: These bits are mask control bits for comparison of each of the - EMACADDR6 bytes. When set high the MAC does not compare the corresponding byte of received DA or SA with the contents of EMACADDR6 registers. Each bit controls the masking of the bytes as follows: Bit[29]: EMACADDR6 High [15:8]. Bit[28]: EMACADDR6 High [7:0]. Bit[27]: EMACADDR6 Low [31:24]. Bit[24]: EMACADDR6 Low [7:0].You can filter a group of addresses (known as group address filtering) by masking one or more bytes of the address.*/ -#define EMAC_MASK_BYTE_CONTROL6 0x0000003F -#define EMAC_MASK_BYTE_CONTROL6_M ((EMAC_MASK_BYTE_CONTROL6_V)<<(EMAC_MASK_BYTE_CONTROL6_S)) -#define EMAC_MASK_BYTE_CONTROL6_V 0x3F -#define EMAC_MASK_BYTE_CONTROL6_S 24 -/* EMAC_MAC_ADDRESS6_HI : R/W ;bitpos:[15:0] ;default: 16'hFFFF ; */ -/*description: This field contains the upper 16 bits Bits[47:32] of the seventh - 6-byte MAC Address.*/ -#define EMAC_MAC_ADDRESS6_HI 0x0000FFFF -#define EMAC_MAC_ADDRESS6_HI_M ((EMAC_MAC_ADDRESS6_HI_V)<<(EMAC_MAC_ADDRESS6_HI_S)) -#define EMAC_MAC_ADDRESS6_HI_V 0xFFFF -#define EMAC_MAC_ADDRESS6_HI_S 0 - -#define EMAC_ADDR6LOW_REG (DR_REG_EMAC_BASE + 0x1074) -/* EMAC_MAC_ADDRESS6_LOW : R/W ;bitpos:[31:0] ;default: 32'hFFFFFFFF ; */ -/*description: This field contains the lower 32 bits of the seventh 6-byte MAC - address.The content of this field is undefined so the register needs to be configured after the initialization Process.*/ -#define EMAC_MAC_ADDRESS6_LOW 0xFFFFFFFF -#define EMAC_MAC_ADDRESS6_LOW_M ((EMAC_MAC_ADDRESS6_LOW_V)<<(EMAC_MAC_ADDRESS6_LOW_S)) -#define EMAC_MAC_ADDRESS6_LOW_V 0xFFFFFFFF -#define EMAC_MAC_ADDRESS6_LOW_S 0 - -#define EMAC_ADDR7HIGH_REG (DR_REG_EMAC_BASE + 0x1078) -/* EMAC_ADDRESS_ENABLE7 : R/W ;bitpos:[31] ;default: 1'h0 ; */ -/*description: When this bit is set the address filter module uses the eighth - MAC address for perfect filtering. When this bit is reset the address filter module ignores the address for filtering.*/ -#define EMAC_ADDRESS_ENABLE7 (BIT(31)) -#define EMAC_ADDRESS_ENABLE7_M (BIT(31)) -#define EMAC_ADDRESS_ENABLE7_V 0x1 -#define EMAC_ADDRESS_ENABLE7_S 31 -/* EMAC_SOURCE_ADDRESS7 : R/W ;bitpos:[30] ;default: 1'h0 ; */ -/*description: When this bit is set the EMACADDR7[47:0] is used to compare - with the SA fields of the received frame. When this bit is reset the EMACADDR7[47:0] is used to compare with the DA fields of the received frame.*/ -#define EMAC_SOURCE_ADDRESS7 (BIT(30)) -#define EMAC_SOURCE_ADDRESS7_M (BIT(30)) -#define EMAC_SOURCE_ADDRESS7_V 0x1 -#define EMAC_SOURCE_ADDRESS7_S 30 -/* EMAC_MASK_BYTE_CONTROL7 : R/W ;bitpos:[29:24] ;default: 6'h0 ; */ -/*description: These bits are mask control bits for comparison of each of the - EMACADDR7 bytes. When set high the MAC does not compare the corresponding byte of received DA or SA with the contents of EMACADDR7 registers. Each bit controls the masking of the bytes as follows: Bit[29]: EMACADDR7 High [15:8]. Bit[28]: EMACADDR7 High [7:0]. Bit[27]: EMACADDR7 Low [31:24]. Bit[24]: EMACADDR7 Low [7:0].You can filter a group of addresses (known as group address filtering) by masking one or more bytes of the address.*/ -#define EMAC_MASK_BYTE_CONTROL7 0x0000003F -#define EMAC_MASK_BYTE_CONTROL7_M ((EMAC_MASK_BYTE_CONTROL7_V)<<(EMAC_MASK_BYTE_CONTROL7_S)) -#define EMAC_MASK_BYTE_CONTROL7_V 0x3F -#define EMAC_MASK_BYTE_CONTROL7_S 24 -/* EMAC_MAC_ADDRESS7_HI : R/W ;bitpos:[15:0] ;default: 16'hFFFF ; */ -/*description: This field contains the upper 16 bits Bits[47:32] of the eighth - 6-byte MAC Address.*/ -#define EMAC_MAC_ADDRESS7_HI 0x0000FFFF -#define EMAC_MAC_ADDRESS7_HI_M ((EMAC_MAC_ADDRESS7_HI_V)<<(EMAC_MAC_ADDRESS7_HI_S)) -#define EMAC_MAC_ADDRESS7_HI_V 0xFFFF -#define EMAC_MAC_ADDRESS7_HI_S 0 - -#define EMAC_ADDR7LOW_REG (DR_REG_EMAC_BASE + 0x107C) -/* EMAC_MAC_ADDRESS7_LOW : R/W ;bitpos:[31:0] ;default: 32'hFFFFFFFF ; */ -/*description: This field contains the lower 32 bits of the eighth 6-byte MAC - address.The content of this field is undefined so the register needs to be configured after the initialization Process.*/ -#define EMAC_MAC_ADDRESS7_LOW 0xFFFFFFFF -#define EMAC_MAC_ADDRESS7_LOW_M ((EMAC_MAC_ADDRESS7_LOW_V)<<(EMAC_MAC_ADDRESS7_LOW_S)) -#define EMAC_MAC_ADDRESS7_LOW_V 0xFFFFFFFF -#define EMAC_MAC_ADDRESS7_LOW_S 0 - -#define EMAC_CSTATUS_REG (DR_REG_EMAC_BASE + 0x10D8) -/* EMAC_JABBER_TIMEOUT : RO ;bitpos:[4] ;default: 1'h0 ; */ -/*description: This bit indicates whether there is jabber timeout error (1'b1) - in the received Frame.*/ -#define EMAC_JABBER_TIMEOUT (BIT(4)) -#define EMAC_JABBER_TIMEOUT_M (BIT(4)) -#define EMAC_JABBER_TIMEOUT_V 0x1 -#define EMAC_JABBER_TIMEOUT_S 4 -/* EMAC_LINK_SPEED : RO ;bitpos:[2:1] ;default: 1'h0 ; */ -/*description: This bit indicates the current speed of the link: 2'b00: 2.5 - MHz. 2'b01: 25 MHz. 2'b10: 125 MHz.*/ -#define EMAC_LINK_SPEED 0x00000003 -#define EMAC_LINK_SPEED_M ((EMAC_LINK_SPEED_V)<<(EMAC_LINK_SPEED_S)) -#define EMAC_LINK_SPEED_V 0x3 -#define EMAC_LINK_SPEED_S 1 -/* EMAC_LINK_MODE : RO ;bitpos:[0] ;default: 1'h0 ; */ -/*description: This bit indicates the current mode of operation of the link: - 1'b0: Half-duplex mode. 1'b1: Full-duplex mode.*/ -#define EMAC_LINK_MODE (BIT(0)) -#define EMAC_LINK_MODE_M (BIT(0)) -#define EMAC_LINK_MODE_V 0x1 -#define EMAC_LINK_MODE_S 0 - -#define EMAC_WDOGTO_REG (DR_REG_EMAC_BASE + 0x10DC) -/* EMAC_PWDOGEN : R/W ;bitpos:[16] ;default: 1'h0 ; */ -/*description: When this bit is set and Bit[23] (WD) of EMACCONFIG_REG is reset - the WTO field (Bits[13:0]) is used as watchdog timeout for a received frame. When this bit is cleared the watchdog timeout for a received frame is controlled by the setting of Bit[23] (WD) and Bit[20] (JE) in EMACCONFIG_REG.*/ -#define EMAC_PWDOGEN (BIT(16)) -#define EMAC_PWDOGEN_M (BIT(16)) -#define EMAC_PWDOGEN_V 0x1 -#define EMAC_PWDOGEN_S 16 -/* EMAC_WDOGTO : R/W ;bitpos:[13:0] ;default: 14'h0 ; */ -/*description: When Bit[16] (PWE) is set and Bit[23] (WD) of EMACCONFIG_REG - is reset this field is used as watchdog timeout for a received frame. If the length of a received frame exceeds the value of this field such frame is terminated and declared as an error frame.*/ -#define EMAC_WDOGTO 0x00003FFF -#define EMAC_WDOGTO_M ((EMAC_WDOGTO_V)<<(EMAC_WDOGTO_S)) -#define EMAC_WDOGTO_V 0x3FFF -#define EMAC_WDOGTO_S 0 - -#ifdef __cplusplus -} -#endif - - - -#endif /*_SOC_EMAC_REG_H_ */ - - diff --git a/tools/sdk/include/soc/soc/fe_reg.h b/tools/sdk/include/soc/soc/fe_reg.h deleted file mode 100644 index 7705586d7c3..00000000000 --- a/tools/sdk/include/soc/soc/fe_reg.h +++ /dev/null @@ -1,41 +0,0 @@ -// 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. - -#pragma once - -#include "soc/soc.h" - -/* Some of the RF frontend control registers. - * PU/PD fields defined here are used in sleep related functions. - */ - -#define FE_GEN_CTRL (DR_REG_FE_BASE + 0x0090) -#define FE_IQ_EST_FORCE_PU (BIT(5)) -#define FE_IQ_EST_FORCE_PU_M (BIT(5)) -#define FE_IQ_EST_FORCE_PU_V 1 -#define FE_IQ_EST_FORCE_PU_S 5 -#define FE_IQ_EST_FORCE_PD (BIT(4)) -#define FE_IQ_EST_FORCE_PD_M (BIT(4)) -#define FE_IQ_EST_FORCE_PD_V 1 -#define FE_IQ_EST_FORCE_PD_S 4 - -#define FE2_TX_INTERP_CTRL (DR_REG_FE2_BASE + 0x00f0) -#define FE2_TX_INF_FORCE_PU (BIT(10)) -#define FE2_TX_INF_FORCE_PU_M (BIT(10)) -#define FE2_TX_INF_FORCE_PU_V 1 -#define FE2_TX_INF_FORCE_PU_S 10 -#define FE2_TX_INF_FORCE_PD (BIT(9)) -#define FE2_TX_INF_FORCE_PD_M (BIT(9)) -#define FE2_TX_INF_FORCE_PD_V 1 -#define FE2_TX_INF_FORCE_PD_S 9 diff --git a/tools/sdk/include/soc/soc/frc_timer_reg.h b/tools/sdk/include/soc/soc/frc_timer_reg.h deleted file mode 100644 index a2152c5c91a..00000000000 --- a/tools/sdk/include/soc/soc/frc_timer_reg.h +++ /dev/null @@ -1,52 +0,0 @@ -// 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. - -#ifndef _SOC_FRC_TIMER_REG_H_ -#define _SOC_FRC_TIMER_REG_H_ - -#include "soc.h" - -/** - * These are the register definitions for "legacy" timers - */ - -#define REG_FRC_TIMER_BASE(i) (DR_REG_FRC_TIMER_BASE + i*0x20) - -#define FRC_TIMER_LOAD_REG(i) (REG_FRC_TIMER_BASE(i) + 0x0) // timer load value (23 bit for i==0, 32 bit for i==1) -#define FRC_TIMER_LOAD_VALUE(i) ((i == 0)?0x007FFFFF:0xffffffff) -#define FRC_TIMER_LOAD_VALUE_S 0 - -#define FRC_TIMER_COUNT_REG(i) (REG_FRC_TIMER_BASE(i) + 0x4) // timer count value (23 bit for i==0, 32 bit for i==1) -#define FRC_TIMER_COUNT ((i == 0)?0x007FFFFF:0xffffffff) -#define FRC_TIMER_COUNT_S 0 - -#define FRC_TIMER_CTRL_REG(i) (REG_FRC_TIMER_BASE(i) + 0x8) -#define FRC_TIMER_INT_STATUS (BIT(8)) // interrupt status (RO) -#define FRC_TIMER_ENABLE (BIT(7)) // enable timer -#define FRC_TIMER_AUTOLOAD (BIT(6)) // enable autoload -#define FRC_TIMER_PRESCALER 0x00000007 -#define FRC_TIMER_PRESCALER_S 1 -#define FRC_TIMER_PRESCALER_1 (0 << FRC_TIMER_PRESCALER_S) -#define FRC_TIMER_PRESCALER_16 (2 << FRC_TIMER_PRESCALER_S) -#define FRC_TIMER_PRESCALER_256 (4 << FRC_TIMER_PRESCALER_S) -#define FRC_TIMER_LEVEL_INT (BIT(0)) // 1: level, 0: edge - -#define FRC_TIMER_INT_REG(i) (REG_FRC_TIMER_BASE(i) + 0xC) -#define FRC_TIMER_INT_CLR (BIT(0)) // clear interrupt - -#define FRC_TIMER_ALARM_REG(i) (REG_FRC_TIMER_BASE(i) + 0x10) // timer alarm value; register only present for i == 1 -#define FRC_TIMER_ALARM 0xFFFFFFFF -#define FRC_TIMER_ALARM_S 0 - -#endif //_SOC_FRC_TIMER_REG_H_ diff --git a/tools/sdk/include/soc/soc/gpio_periph.h b/tools/sdk/include/soc/soc/gpio_periph.h deleted file mode 100644 index 93b23f42772..00000000000 --- a/tools/sdk/include/soc/soc/gpio_periph.h +++ /dev/null @@ -1,35 +0,0 @@ -// 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. - -#ifndef _SOC_GPIO_PERIPH_H -#define _SOC_GPIO_PERIPH_H -#include "stdint.h" -#include "soc/gpio_pins.h" -#include "soc/io_mux_reg.h" -#include "soc/gpio_struct.h" -#include "soc/gpio_reg.h" -#include "soc/gpio_sig_map.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -extern const uint32_t GPIO_PIN_MUX_REG[GPIO_PIN_COUNT]; - -#ifdef __cplusplus -} -#endif - -#endif // _SOC_GPIO_PERIPH_H diff --git a/tools/sdk/include/soc/soc/gpio_pins.h b/tools/sdk/include/soc/soc/gpio_pins.h deleted file mode 100644 index 6c2bfb7418f..00000000000 --- a/tools/sdk/include/soc/soc/gpio_pins.h +++ /dev/null @@ -1,28 +0,0 @@ -// 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. - -#ifndef _GPIO_PINS_H -#define _GPIO_PINS_H -#ifdef __cplusplus -extern "C" -{ -#endif - -#define GPIO_PIN_COUNT 40 - -#ifdef __cplusplus -} -#endif - -#endif // _GPIO_PINS_H diff --git a/tools/sdk/include/soc/soc/gpio_reg.h b/tools/sdk/include/soc/soc/gpio_reg.h deleted file mode 100644 index 8168f4ba12b..00000000000 --- a/tools/sdk/include/soc/soc/gpio_reg.h +++ /dev/null @@ -1,8238 +0,0 @@ -// 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. -#ifndef _SOC_GPIO_REG_H_ -#define _SOC_GPIO_REG_H_ - -#include "soc.h" -#define GPIO_BT_SELECT_REG (DR_REG_GPIO_BASE + 0x0000) -/* GPIO_BT_SEL : R/W ;bitpos:[31:0] ;default: x ; */ -/*description: NA*/ -#define GPIO_BT_SEL 0xFFFFFFFF -#define GPIO_BT_SEL_M ((GPIO_BT_SEL_V)<<(GPIO_BT_SEL_S)) -#define GPIO_BT_SEL_V 0xFFFFFFFF -#define GPIO_BT_SEL_S 0 - -#define GPIO_OUT_REG (DR_REG_GPIO_BASE + 0x0004) -/* GPIO_OUT_DATA : R/W ;bitpos:[31:0] ;default: x ; */ -/*description: GPIO0~31 output value*/ -#define GPIO_OUT_DATA 0xFFFFFFFF -#define GPIO_OUT_DATA_M ((GPIO_OUT_DATA_V)<<(GPIO_OUT_DATA_S)) -#define GPIO_OUT_DATA_V 0xFFFFFFFF -#define GPIO_OUT_DATA_S 0 - -#define GPIO_OUT_W1TS_REG (DR_REG_GPIO_BASE + 0x0008) -/* GPIO_OUT_DATA_W1TS : R/W ;bitpos:[31:0] ;default: x ; */ -/*description: GPIO0~31 output value write 1 to set*/ -#define GPIO_OUT_DATA_W1TS 0xFFFFFFFF -#define GPIO_OUT_DATA_W1TS_M ((GPIO_OUT_DATA_W1TS_V)<<(GPIO_OUT_DATA_W1TS_S)) -#define GPIO_OUT_DATA_W1TS_V 0xFFFFFFFF -#define GPIO_OUT_DATA_W1TS_S 0 - -#define GPIO_OUT_W1TC_REG (DR_REG_GPIO_BASE + 0x000c) -/* GPIO_OUT_DATA_W1TC : R/W ;bitpos:[31:0] ;default: x ; */ -/*description: GPIO0~31 output value write 1 to clear*/ -#define GPIO_OUT_DATA_W1TC 0xFFFFFFFF -#define GPIO_OUT_DATA_W1TC_M ((GPIO_OUT_DATA_W1TC_V)<<(GPIO_OUT_DATA_W1TC_S)) -#define GPIO_OUT_DATA_W1TC_V 0xFFFFFFFF -#define GPIO_OUT_DATA_W1TC_S 0 - -#define GPIO_OUT1_REG (DR_REG_GPIO_BASE + 0x0010) -/* GPIO_OUT1_DATA : R/W ;bitpos:[7:0] ;default: x ; */ -/*description: GPIO32~39 output value*/ -#define GPIO_OUT1_DATA 0x000000FF -#define GPIO_OUT1_DATA_M ((GPIO_OUT1_DATA_V)<<(GPIO_OUT1_DATA_S)) -#define GPIO_OUT1_DATA_V 0xFF -#define GPIO_OUT1_DATA_S 0 - -#define GPIO_OUT1_W1TS_REG (DR_REG_GPIO_BASE + 0x0014) -/* GPIO_OUT1_DATA_W1TS : R/W ;bitpos:[7:0] ;default: x ; */ -/*description: GPIO32~39 output value write 1 to set*/ -#define GPIO_OUT1_DATA_W1TS 0x000000FF -#define GPIO_OUT1_DATA_W1TS_M ((GPIO_OUT1_DATA_W1TS_V)<<(GPIO_OUT1_DATA_W1TS_S)) -#define GPIO_OUT1_DATA_W1TS_V 0xFF -#define GPIO_OUT1_DATA_W1TS_S 0 - -#define GPIO_OUT1_W1TC_REG (DR_REG_GPIO_BASE + 0x0018) -/* GPIO_OUT1_DATA_W1TC : R/W ;bitpos:[7:0] ;default: x ; */ -/*description: GPIO32~39 output value write 1 to clear*/ -#define GPIO_OUT1_DATA_W1TC 0x000000FF -#define GPIO_OUT1_DATA_W1TC_M ((GPIO_OUT1_DATA_W1TC_V)<<(GPIO_OUT1_DATA_W1TC_S)) -#define GPIO_OUT1_DATA_W1TC_V 0xFF -#define GPIO_OUT1_DATA_W1TC_S 0 - -#define GPIO_SDIO_SELECT_REG (DR_REG_GPIO_BASE + 0x001c) -/* GPIO_SDIO_SEL : R/W ;bitpos:[7:0] ;default: x ; */ -/*description: SDIO PADS on/off control from outside*/ -#define GPIO_SDIO_SEL 0x000000FF -#define GPIO_SDIO_SEL_M ((GPIO_SDIO_SEL_V)<<(GPIO_SDIO_SEL_S)) -#define GPIO_SDIO_SEL_V 0xFF -#define GPIO_SDIO_SEL_S 0 - -#define GPIO_ENABLE_REG (DR_REG_GPIO_BASE + 0x0020) -/* GPIO_ENABLE_DATA : R/W ;bitpos:[31:0] ;default: x ; */ -/*description: GPIO0~31 output enable*/ -#define GPIO_ENABLE_DATA 0xFFFFFFFF -#define GPIO_ENABLE_DATA_M ((GPIO_ENABLE_DATA_V)<<(GPIO_ENABLE_DATA_S)) -#define GPIO_ENABLE_DATA_V 0xFFFFFFFF -#define GPIO_ENABLE_DATA_S 0 - -#define GPIO_ENABLE_W1TS_REG (DR_REG_GPIO_BASE + 0x0024) -/* GPIO_ENABLE_DATA_W1TS : R/W ;bitpos:[31:0] ;default: x ; */ -/*description: GPIO0~31 output enable write 1 to set*/ -#define GPIO_ENABLE_DATA_W1TS 0xFFFFFFFF -#define GPIO_ENABLE_DATA_W1TS_M ((GPIO_ENABLE_DATA_W1TS_V)<<(GPIO_ENABLE_DATA_W1TS_S)) -#define GPIO_ENABLE_DATA_W1TS_V 0xFFFFFFFF -#define GPIO_ENABLE_DATA_W1TS_S 0 - -#define GPIO_ENABLE_W1TC_REG (DR_REG_GPIO_BASE + 0x0028) -/* GPIO_ENABLE_DATA_W1TC : R/W ;bitpos:[31:0] ;default: x ; */ -/*description: GPIO0~31 output enable write 1 to clear*/ -#define GPIO_ENABLE_DATA_W1TC 0xFFFFFFFF -#define GPIO_ENABLE_DATA_W1TC_M ((GPIO_ENABLE_DATA_W1TC_V)<<(GPIO_ENABLE_DATA_W1TC_S)) -#define GPIO_ENABLE_DATA_W1TC_V 0xFFFFFFFF -#define GPIO_ENABLE_DATA_W1TC_S 0 - -#define GPIO_ENABLE1_REG (DR_REG_GPIO_BASE + 0x002c) -/* GPIO_ENABLE1_DATA : R/W ;bitpos:[7:0] ;default: x ; */ -/*description: GPIO32~39 output enable*/ -#define GPIO_ENABLE1_DATA 0x000000FF -#define GPIO_ENABLE1_DATA_M ((GPIO_ENABLE1_DATA_V)<<(GPIO_ENABLE1_DATA_S)) -#define GPIO_ENABLE1_DATA_V 0xFF -#define GPIO_ENABLE1_DATA_S 0 - -#define GPIO_ENABLE1_W1TS_REG (DR_REG_GPIO_BASE + 0x0030) -/* GPIO_ENABLE1_DATA_W1TS : R/W ;bitpos:[7:0] ;default: x ; */ -/*description: GPIO32~39 output enable write 1 to set*/ -#define GPIO_ENABLE1_DATA_W1TS 0x000000FF -#define GPIO_ENABLE1_DATA_W1TS_M ((GPIO_ENABLE1_DATA_W1TS_V)<<(GPIO_ENABLE1_DATA_W1TS_S)) -#define GPIO_ENABLE1_DATA_W1TS_V 0xFF -#define GPIO_ENABLE1_DATA_W1TS_S 0 - -#define GPIO_ENABLE1_W1TC_REG (DR_REG_GPIO_BASE + 0x0034) -/* GPIO_ENABLE1_DATA_W1TC : R/W ;bitpos:[7:0] ;default: x ; */ -/*description: GPIO32~39 output enable write 1 to clear*/ -#define GPIO_ENABLE1_DATA_W1TC 0x000000FF -#define GPIO_ENABLE1_DATA_W1TC_M ((GPIO_ENABLE1_DATA_W1TC_V)<<(GPIO_ENABLE1_DATA_W1TC_S)) -#define GPIO_ENABLE1_DATA_W1TC_V 0xFF -#define GPIO_ENABLE1_DATA_W1TC_S 0 - -#define GPIO_STRAP_REG (DR_REG_GPIO_BASE + 0x0038) -/* GPIO_STRAPPING : RO ;bitpos:[15:0] ;default: ; */ -/*description: {10'b0, MTDI, GPIO0, GPIO2, GPIO4, MTDO, GPIO5} */ -#define GPIO_STRAPPING 0x0000FFFF -#define GPIO_STRAPPING_M ((GPIO_STRAPPING_V)<<(GPIO_STRAPPING_S)) -#define GPIO_STRAPPING_V 0xFFFF -#define GPIO_STRAPPING_S 0 - -#define GPIO_IN_REG (DR_REG_GPIO_BASE + 0x003c) -/* GPIO_IN_DATA : RO ;bitpos:[31:0] ;default: ; */ -/*description: GPIO0~31 input value*/ -#define GPIO_IN_DATA 0xFFFFFFFF -#define GPIO_IN_DATA_M ((GPIO_IN_DATA_V)<<(GPIO_IN_DATA_S)) -#define GPIO_IN_DATA_V 0xFFFFFFFF -#define GPIO_IN_DATA_S 0 - -#define GPIO_IN1_REG (DR_REG_GPIO_BASE + 0x0040) -/* GPIO_IN1_DATA : RO ;bitpos:[7:0] ;default: ; */ -/*description: GPIO32~39 input value*/ -#define GPIO_IN1_DATA 0x000000FF -#define GPIO_IN1_DATA_M ((GPIO_IN1_DATA_V)<<(GPIO_IN1_DATA_S)) -#define GPIO_IN1_DATA_V 0xFF -#define GPIO_IN1_DATA_S 0 - -#define GPIO_STATUS_REG (DR_REG_GPIO_BASE + 0x0044) -/* GPIO_STATUS_INT : R/W ;bitpos:[31:0] ;default: x ; */ -/*description: GPIO0~31 interrupt status*/ -#define GPIO_STATUS_INT 0xFFFFFFFF -#define GPIO_STATUS_INT_M ((GPIO_STATUS_INT_V)<<(GPIO_STATUS_INT_S)) -#define GPIO_STATUS_INT_V 0xFFFFFFFF -#define GPIO_STATUS_INT_S 0 - -#define GPIO_STATUS_W1TS_REG (DR_REG_GPIO_BASE + 0x0048) -/* GPIO_STATUS_INT_W1TS : R/W ;bitpos:[31:0] ;default: x ; */ -/*description: GPIO0~31 interrupt status write 1 to set*/ -#define GPIO_STATUS_INT_W1TS 0xFFFFFFFF -#define GPIO_STATUS_INT_W1TS_M ((GPIO_STATUS_INT_W1TS_V)<<(GPIO_STATUS_INT_W1TS_S)) -#define GPIO_STATUS_INT_W1TS_V 0xFFFFFFFF -#define GPIO_STATUS_INT_W1TS_S 0 - -#define GPIO_STATUS_W1TC_REG (DR_REG_GPIO_BASE + 0x004c) -/* GPIO_STATUS_INT_W1TC : R/W ;bitpos:[31:0] ;default: x ; */ -/*description: GPIO0~31 interrupt status write 1 to clear*/ -#define GPIO_STATUS_INT_W1TC 0xFFFFFFFF -#define GPIO_STATUS_INT_W1TC_M ((GPIO_STATUS_INT_W1TC_V)<<(GPIO_STATUS_INT_W1TC_S)) -#define GPIO_STATUS_INT_W1TC_V 0xFFFFFFFF -#define GPIO_STATUS_INT_W1TC_S 0 - -#define GPIO_STATUS1_REG (DR_REG_GPIO_BASE + 0x0050) -/* GPIO_STATUS1_INT : R/W ;bitpos:[7:0] ;default: x ; */ -/*description: GPIO32~39 interrupt status*/ -#define GPIO_STATUS1_INT 0x000000FF -#define GPIO_STATUS1_INT_M ((GPIO_STATUS1_INT_V)<<(GPIO_STATUS1_INT_S)) -#define GPIO_STATUS1_INT_V 0xFF -#define GPIO_STATUS1_INT_S 0 - -#define GPIO_STATUS1_W1TS_REG (DR_REG_GPIO_BASE + 0x0054) -/* GPIO_STATUS1_INT_W1TS : R/W ;bitpos:[7:0] ;default: x ; */ -/*description: GPIO32~39 interrupt status write 1 to set*/ -#define GPIO_STATUS1_INT_W1TS 0x000000FF -#define GPIO_STATUS1_INT_W1TS_M ((GPIO_STATUS1_INT_W1TS_V)<<(GPIO_STATUS1_INT_W1TS_S)) -#define GPIO_STATUS1_INT_W1TS_V 0xFF -#define GPIO_STATUS1_INT_W1TS_S 0 - -#define GPIO_STATUS1_W1TC_REG (DR_REG_GPIO_BASE + 0x0058) -/* GPIO_STATUS1_INT_W1TC : R/W ;bitpos:[7:0] ;default: x ; */ -/*description: GPIO32~39 interrupt status write 1 to clear*/ -#define GPIO_STATUS1_INT_W1TC 0x000000FF -#define GPIO_STATUS1_INT_W1TC_M ((GPIO_STATUS1_INT_W1TC_V)<<(GPIO_STATUS1_INT_W1TC_S)) -#define GPIO_STATUS1_INT_W1TC_V 0xFF -#define GPIO_STATUS1_INT_W1TC_S 0 - -#define GPIO_ACPU_INT_REG (DR_REG_GPIO_BASE + 0x0060) -/* GPIO_APPCPU_INT : RO ;bitpos:[31:0] ;default: x ; */ -/*description: GPIO0~31 APP CPU interrupt status*/ -#define GPIO_APPCPU_INT 0xFFFFFFFF -#define GPIO_APPCPU_INT_M ((GPIO_APPCPU_INT_V)<<(GPIO_APPCPU_INT_S)) -#define GPIO_APPCPU_INT_V 0xFFFFFFFF -#define GPIO_APPCPU_INT_S 0 - -#define GPIO_ACPU_NMI_INT_REG (DR_REG_GPIO_BASE + 0x0064) -/* GPIO_APPCPU_NMI_INT : RO ;bitpos:[31:0] ;default: x ; */ -/*description: GPIO0~31 APP CPU non-maskable interrupt status*/ -#define GPIO_APPCPU_NMI_INT 0xFFFFFFFF -#define GPIO_APPCPU_NMI_INT_M ((GPIO_APPCPU_NMI_INT_V)<<(GPIO_APPCPU_NMI_INT_S)) -#define GPIO_APPCPU_NMI_INT_V 0xFFFFFFFF -#define GPIO_APPCPU_NMI_INT_S 0 - -#define GPIO_PCPU_INT_REG (DR_REG_GPIO_BASE + 0x0068) -/* GPIO_PROCPU_INT : RO ;bitpos:[31:0] ;default: x ; */ -/*description: GPIO0~31 PRO CPU interrupt status*/ -#define GPIO_PROCPU_INT 0xFFFFFFFF -#define GPIO_PROCPU_INT_M ((GPIO_PROCPU_INT_V)<<(GPIO_PROCPU_INT_S)) -#define GPIO_PROCPU_INT_V 0xFFFFFFFF -#define GPIO_PROCPU_INT_S 0 - -#define GPIO_PCPU_NMI_INT_REG (DR_REG_GPIO_BASE + 0x006c) -/* GPIO_PROCPU_NMI_INT : RO ;bitpos:[31:0] ;default: x ; */ -/*description: GPIO0~31 PRO CPU non-maskable interrupt status*/ -#define GPIO_PROCPU_NMI_INT 0xFFFFFFFF -#define GPIO_PROCPU_NMI_INT_M ((GPIO_PROCPU_NMI_INT_V)<<(GPIO_PROCPU_NMI_INT_S)) -#define GPIO_PROCPU_NMI_INT_V 0xFFFFFFFF -#define GPIO_PROCPU_NMI_INT_S 0 - -#define GPIO_CPUSDIO_INT_REG (DR_REG_GPIO_BASE + 0x0070) -/* GPIO_SDIO_INT : RO ;bitpos:[31:0] ;default: x ; */ -/*description: SDIO's extent GPIO0~31 interrupt*/ -#define GPIO_SDIO_INT 0xFFFFFFFF -#define GPIO_SDIO_INT_M ((GPIO_SDIO_INT_V)<<(GPIO_SDIO_INT_S)) -#define GPIO_SDIO_INT_V 0xFFFFFFFF -#define GPIO_SDIO_INT_S 0 - -#define GPIO_ACPU_INT1_REG (DR_REG_GPIO_BASE + 0x0074) -/* GPIO_APPCPU_INT_H : RO ;bitpos:[7:0] ;default: x ; */ -/*description: GPIO32~39 APP CPU interrupt status*/ -#define GPIO_APPCPU_INT_H 0x000000FF -#define GPIO_APPCPU_INT_H_M ((GPIO_APPCPU_INT_H_V)<<(GPIO_APPCPU_INT_H_S)) -#define GPIO_APPCPU_INT_H_V 0xFF -#define GPIO_APPCPU_INT_H_S 0 - -#define GPIO_ACPU_NMI_INT1_REG (DR_REG_GPIO_BASE + 0x0078) -/* GPIO_APPCPU_NMI_INT_H : RO ;bitpos:[7:0] ;default: x ; */ -/*description: GPIO32~39 APP CPU non-maskable interrupt status*/ -#define GPIO_APPCPU_NMI_INT_H 0x000000FF -#define GPIO_APPCPU_NMI_INT_H_M ((GPIO_APPCPU_NMI_INT_H_V)<<(GPIO_APPCPU_NMI_INT_H_S)) -#define GPIO_APPCPU_NMI_INT_H_V 0xFF -#define GPIO_APPCPU_NMI_INT_H_S 0 - -#define GPIO_PCPU_INT1_REG (DR_REG_GPIO_BASE + 0x007c) -/* GPIO_PROCPU_INT_H : RO ;bitpos:[7:0] ;default: x ; */ -/*description: GPIO32~39 PRO CPU interrupt status*/ -#define GPIO_PROCPU_INT_H 0x000000FF -#define GPIO_PROCPU_INT_H_M ((GPIO_PROCPU_INT_H_V)<<(GPIO_PROCPU_INT_H_S)) -#define GPIO_PROCPU_INT_H_V 0xFF -#define GPIO_PROCPU_INT_H_S 0 - -#define GPIO_PCPU_NMI_INT1_REG (DR_REG_GPIO_BASE + 0x0080) -/* GPIO_PROCPU_NMI_INT_H : RO ;bitpos:[7:0] ;default: x ; */ -/*description: GPIO32~39 PRO CPU non-maskable interrupt status*/ -#define GPIO_PROCPU_NMI_INT_H 0x000000FF -#define GPIO_PROCPU_NMI_INT_H_M ((GPIO_PROCPU_NMI_INT_H_V)<<(GPIO_PROCPU_NMI_INT_H_S)) -#define GPIO_PROCPU_NMI_INT_H_V 0xFF -#define GPIO_PROCPU_NMI_INT_H_S 0 - -#define GPIO_CPUSDIO_INT1_REG (DR_REG_GPIO_BASE + 0x0084) -/* GPIO_SDIO_INT_H : RO ;bitpos:[7:0] ;default: x ; */ -/*description: SDIO's extent GPIO32~39 interrupt*/ -#define GPIO_SDIO_INT_H 0x000000FF -#define GPIO_SDIO_INT_H_M ((GPIO_SDIO_INT_H_V)<<(GPIO_SDIO_INT_H_S)) -#define GPIO_SDIO_INT_H_V 0xFF -#define GPIO_SDIO_INT_H_S 0 - -#define GPIO_REG(io_num) (GPIO_PIN0_REG + (io_num)*0x4) -#define GPIO_PIN_INT_ENA 0x0000001F -#define GPIO_PIN_INT_ENA_M ((GPIO_PIN_INT_ENA_V)<<(GPIO_PIN_INT_ENA_S)) -#define GPIO_PIN_INT_ENA_V 0x0000001F -#define GPIO_PIN_INT_ENA_S 13 -#define GPIO_PIN_CONFIG 0x00000003 -#define GPIO_PIN_CONFIG_M ((GPIO_PIN_CONFIG_V)<<(GPIO_PIN_CONFIG_S)) -#define GPIO_PIN_CONFIG_V 0x00000003 -#define GPIO_PIN_CONFIG_S 11 -#define GPIO_PIN_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN_WAKEUP_ENABLE_S 10 -#define GPIO_PIN_INT_TYPE 0x00000007 -#define GPIO_PIN_INT_TYPE_M ((GPIO_PIN_INT_TYPE_V)<<(GPIO_PIN_INT_TYPE_S)) -#define GPIO_PIN_INT_TYPE_V 0x00000007 -#define GPIO_PIN_INT_TYPE_S 7 -#define GPIO_PIN_PAD_DRIVER (BIT(2)) -#define GPIO_PIN_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN_PAD_DRIVER_V 0x1 -#define GPIO_PIN_PAD_DRIVER_S 2 - -#define GPIO_PIN0_REG (DR_REG_GPIO_BASE + 0x0088) -/* GPIO_PIN0_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN0_INT_ENA 0x0000001F -#define GPIO_PIN0_INT_ENA_M ((GPIO_PIN0_INT_ENA_V)<<(GPIO_PIN0_INT_ENA_S)) -#define GPIO_PIN0_INT_ENA_V 0x1F -#define GPIO_PIN0_INT_ENA_S 13 -/* GPIO_PIN0_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN0_CONFIG 0x00000003 -#define GPIO_PIN0_CONFIG_M ((GPIO_PIN0_CONFIG_V)<<(GPIO_PIN0_CONFIG_S)) -#define GPIO_PIN0_CONFIG_V 0x3 -#define GPIO_PIN0_CONFIG_S 11 -/* GPIO_PIN0_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN0_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN0_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN0_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN0_WAKEUP_ENABLE_S 10 -/* GPIO_PIN0_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN0_INT_TYPE 0x00000007 -#define GPIO_PIN0_INT_TYPE_M ((GPIO_PIN0_INT_TYPE_V)<<(GPIO_PIN0_INT_TYPE_S)) -#define GPIO_PIN0_INT_TYPE_V 0x7 -#define GPIO_PIN0_INT_TYPE_S 7 -/* GPIO_PIN0_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN0_PAD_DRIVER (BIT(2)) -#define GPIO_PIN0_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN0_PAD_DRIVER_V 0x1 -#define GPIO_PIN0_PAD_DRIVER_S 2 - -#define GPIO_PIN1_REG (DR_REG_GPIO_BASE + 0x008c) -/* GPIO_PIN1_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN1_INT_ENA 0x0000001F -#define GPIO_PIN1_INT_ENA_M ((GPIO_PIN1_INT_ENA_V)<<(GPIO_PIN1_INT_ENA_S)) -#define GPIO_PIN1_INT_ENA_V 0x1F -#define GPIO_PIN1_INT_ENA_S 13 -/* GPIO_PIN1_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN1_CONFIG 0x00000003 -#define GPIO_PIN1_CONFIG_M ((GPIO_PIN1_CONFIG_V)<<(GPIO_PIN1_CONFIG_S)) -#define GPIO_PIN1_CONFIG_V 0x3 -#define GPIO_PIN1_CONFIG_S 11 -/* GPIO_PIN1_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN1_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN1_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN1_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN1_WAKEUP_ENABLE_S 10 -/* GPIO_PIN1_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN1_INT_TYPE 0x00000007 -#define GPIO_PIN1_INT_TYPE_M ((GPIO_PIN1_INT_TYPE_V)<<(GPIO_PIN1_INT_TYPE_S)) -#define GPIO_PIN1_INT_TYPE_V 0x7 -#define GPIO_PIN1_INT_TYPE_S 7 -/* GPIO_PIN1_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN1_PAD_DRIVER (BIT(2)) -#define GPIO_PIN1_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN1_PAD_DRIVER_V 0x1 -#define GPIO_PIN1_PAD_DRIVER_S 2 - -#define GPIO_PIN2_REG (DR_REG_GPIO_BASE + 0x0090) -/* GPIO_PIN2_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN2_INT_ENA 0x0000001F -#define GPIO_PIN2_INT_ENA_M ((GPIO_PIN2_INT_ENA_V)<<(GPIO_PIN2_INT_ENA_S)) -#define GPIO_PIN2_INT_ENA_V 0x1F -#define GPIO_PIN2_INT_ENA_S 13 -/* GPIO_PIN2_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN2_CONFIG 0x00000003 -#define GPIO_PIN2_CONFIG_M ((GPIO_PIN2_CONFIG_V)<<(GPIO_PIN2_CONFIG_S)) -#define GPIO_PIN2_CONFIG_V 0x3 -#define GPIO_PIN2_CONFIG_S 11 -/* GPIO_PIN2_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN2_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN2_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN2_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN2_WAKEUP_ENABLE_S 10 -/* GPIO_PIN2_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN2_INT_TYPE 0x00000007 -#define GPIO_PIN2_INT_TYPE_M ((GPIO_PIN2_INT_TYPE_V)<<(GPIO_PIN2_INT_TYPE_S)) -#define GPIO_PIN2_INT_TYPE_V 0x7 -#define GPIO_PIN2_INT_TYPE_S 7 -/* GPIO_PIN2_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN2_PAD_DRIVER (BIT(2)) -#define GPIO_PIN2_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN2_PAD_DRIVER_V 0x1 -#define GPIO_PIN2_PAD_DRIVER_S 2 - -#define GPIO_PIN3_REG (DR_REG_GPIO_BASE + 0x0094) -/* GPIO_PIN3_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN3_INT_ENA 0x0000001F -#define GPIO_PIN3_INT_ENA_M ((GPIO_PIN3_INT_ENA_V)<<(GPIO_PIN3_INT_ENA_S)) -#define GPIO_PIN3_INT_ENA_V 0x1F -#define GPIO_PIN3_INT_ENA_S 13 -/* GPIO_PIN3_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN3_CONFIG 0x00000003 -#define GPIO_PIN3_CONFIG_M ((GPIO_PIN3_CONFIG_V)<<(GPIO_PIN3_CONFIG_S)) -#define GPIO_PIN3_CONFIG_V 0x3 -#define GPIO_PIN3_CONFIG_S 11 -/* GPIO_PIN3_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN3_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN3_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN3_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN3_WAKEUP_ENABLE_S 10 -/* GPIO_PIN3_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN3_INT_TYPE 0x00000007 -#define GPIO_PIN3_INT_TYPE_M ((GPIO_PIN3_INT_TYPE_V)<<(GPIO_PIN3_INT_TYPE_S)) -#define GPIO_PIN3_INT_TYPE_V 0x7 -#define GPIO_PIN3_INT_TYPE_S 7 -/* GPIO_PIN3_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN3_PAD_DRIVER (BIT(2)) -#define GPIO_PIN3_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN3_PAD_DRIVER_V 0x1 -#define GPIO_PIN3_PAD_DRIVER_S 2 - -#define GPIO_PIN4_REG (DR_REG_GPIO_BASE + 0x0098) -/* GPIO_PIN4_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN4_INT_ENA 0x0000001F -#define GPIO_PIN4_INT_ENA_M ((GPIO_PIN4_INT_ENA_V)<<(GPIO_PIN4_INT_ENA_S)) -#define GPIO_PIN4_INT_ENA_V 0x1F -#define GPIO_PIN4_INT_ENA_S 13 -/* GPIO_PIN4_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN4_CONFIG 0x00000003 -#define GPIO_PIN4_CONFIG_M ((GPIO_PIN4_CONFIG_V)<<(GPIO_PIN4_CONFIG_S)) -#define GPIO_PIN4_CONFIG_V 0x3 -#define GPIO_PIN4_CONFIG_S 11 -/* GPIO_PIN4_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN4_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN4_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN4_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN4_WAKEUP_ENABLE_S 10 -/* GPIO_PIN4_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN4_INT_TYPE 0x00000007 -#define GPIO_PIN4_INT_TYPE_M ((GPIO_PIN4_INT_TYPE_V)<<(GPIO_PIN4_INT_TYPE_S)) -#define GPIO_PIN4_INT_TYPE_V 0x7 -#define GPIO_PIN4_INT_TYPE_S 7 -/* GPIO_PIN4_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN4_PAD_DRIVER (BIT(2)) -#define GPIO_PIN4_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN4_PAD_DRIVER_V 0x1 -#define GPIO_PIN4_PAD_DRIVER_S 2 - -#define GPIO_PIN5_REG (DR_REG_GPIO_BASE + 0x009c) -/* GPIO_PIN5_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN5_INT_ENA 0x0000001F -#define GPIO_PIN5_INT_ENA_M ((GPIO_PIN5_INT_ENA_V)<<(GPIO_PIN5_INT_ENA_S)) -#define GPIO_PIN5_INT_ENA_V 0x1F -#define GPIO_PIN5_INT_ENA_S 13 -/* GPIO_PIN5_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN5_CONFIG 0x00000003 -#define GPIO_PIN5_CONFIG_M ((GPIO_PIN5_CONFIG_V)<<(GPIO_PIN5_CONFIG_S)) -#define GPIO_PIN5_CONFIG_V 0x3 -#define GPIO_PIN5_CONFIG_S 11 -/* GPIO_PIN5_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN5_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN5_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN5_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN5_WAKEUP_ENABLE_S 10 -/* GPIO_PIN5_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN5_INT_TYPE 0x00000007 -#define GPIO_PIN5_INT_TYPE_M ((GPIO_PIN5_INT_TYPE_V)<<(GPIO_PIN5_INT_TYPE_S)) -#define GPIO_PIN5_INT_TYPE_V 0x7 -#define GPIO_PIN5_INT_TYPE_S 7 -/* GPIO_PIN5_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN5_PAD_DRIVER (BIT(2)) -#define GPIO_PIN5_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN5_PAD_DRIVER_V 0x1 -#define GPIO_PIN5_PAD_DRIVER_S 2 - -#define GPIO_PIN6_REG (DR_REG_GPIO_BASE + 0x00a0) -/* GPIO_PIN6_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN6_INT_ENA 0x0000001F -#define GPIO_PIN6_INT_ENA_M ((GPIO_PIN6_INT_ENA_V)<<(GPIO_PIN6_INT_ENA_S)) -#define GPIO_PIN6_INT_ENA_V 0x1F -#define GPIO_PIN6_INT_ENA_S 13 -/* GPIO_PIN6_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN6_CONFIG 0x00000003 -#define GPIO_PIN6_CONFIG_M ((GPIO_PIN6_CONFIG_V)<<(GPIO_PIN6_CONFIG_S)) -#define GPIO_PIN6_CONFIG_V 0x3 -#define GPIO_PIN6_CONFIG_S 11 -/* GPIO_PIN6_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN6_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN6_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN6_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN6_WAKEUP_ENABLE_S 10 -/* GPIO_PIN6_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN6_INT_TYPE 0x00000007 -#define GPIO_PIN6_INT_TYPE_M ((GPIO_PIN6_INT_TYPE_V)<<(GPIO_PIN6_INT_TYPE_S)) -#define GPIO_PIN6_INT_TYPE_V 0x7 -#define GPIO_PIN6_INT_TYPE_S 7 -/* GPIO_PIN6_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN6_PAD_DRIVER (BIT(2)) -#define GPIO_PIN6_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN6_PAD_DRIVER_V 0x1 -#define GPIO_PIN6_PAD_DRIVER_S 2 - -#define GPIO_PIN7_REG (DR_REG_GPIO_BASE + 0x00a4) -/* GPIO_PIN7_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN7_INT_ENA 0x0000001F -#define GPIO_PIN7_INT_ENA_M ((GPIO_PIN7_INT_ENA_V)<<(GPIO_PIN7_INT_ENA_S)) -#define GPIO_PIN7_INT_ENA_V 0x1F -#define GPIO_PIN7_INT_ENA_S 13 -/* GPIO_PIN7_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN7_CONFIG 0x00000003 -#define GPIO_PIN7_CONFIG_M ((GPIO_PIN7_CONFIG_V)<<(GPIO_PIN7_CONFIG_S)) -#define GPIO_PIN7_CONFIG_V 0x3 -#define GPIO_PIN7_CONFIG_S 11 -/* GPIO_PIN7_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN7_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN7_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN7_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN7_WAKEUP_ENABLE_S 10 -/* GPIO_PIN7_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN7_INT_TYPE 0x00000007 -#define GPIO_PIN7_INT_TYPE_M ((GPIO_PIN7_INT_TYPE_V)<<(GPIO_PIN7_INT_TYPE_S)) -#define GPIO_PIN7_INT_TYPE_V 0x7 -#define GPIO_PIN7_INT_TYPE_S 7 -/* GPIO_PIN7_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN7_PAD_DRIVER (BIT(2)) -#define GPIO_PIN7_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN7_PAD_DRIVER_V 0x1 -#define GPIO_PIN7_PAD_DRIVER_S 2 - -#define GPIO_PIN8_REG (DR_REG_GPIO_BASE + 0x00a8) -/* GPIO_PIN8_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN8_INT_ENA 0x0000001F -#define GPIO_PIN8_INT_ENA_M ((GPIO_PIN8_INT_ENA_V)<<(GPIO_PIN8_INT_ENA_S)) -#define GPIO_PIN8_INT_ENA_V 0x1F -#define GPIO_PIN8_INT_ENA_S 13 -/* GPIO_PIN8_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN8_CONFIG 0x00000003 -#define GPIO_PIN8_CONFIG_M ((GPIO_PIN8_CONFIG_V)<<(GPIO_PIN8_CONFIG_S)) -#define GPIO_PIN8_CONFIG_V 0x3 -#define GPIO_PIN8_CONFIG_S 11 -/* GPIO_PIN8_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN8_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN8_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN8_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN8_WAKEUP_ENABLE_S 10 -/* GPIO_PIN8_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN8_INT_TYPE 0x00000007 -#define GPIO_PIN8_INT_TYPE_M ((GPIO_PIN8_INT_TYPE_V)<<(GPIO_PIN8_INT_TYPE_S)) -#define GPIO_PIN8_INT_TYPE_V 0x7 -#define GPIO_PIN8_INT_TYPE_S 7 -/* GPIO_PIN8_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN8_PAD_DRIVER (BIT(2)) -#define GPIO_PIN8_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN8_PAD_DRIVER_V 0x1 -#define GPIO_PIN8_PAD_DRIVER_S 2 - -#define GPIO_PIN9_REG (DR_REG_GPIO_BASE + 0x00ac) -/* GPIO_PIN9_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN9_INT_ENA 0x0000001F -#define GPIO_PIN9_INT_ENA_M ((GPIO_PIN9_INT_ENA_V)<<(GPIO_PIN9_INT_ENA_S)) -#define GPIO_PIN9_INT_ENA_V 0x1F -#define GPIO_PIN9_INT_ENA_S 13 -/* GPIO_PIN9_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN9_CONFIG 0x00000003 -#define GPIO_PIN9_CONFIG_M ((GPIO_PIN9_CONFIG_V)<<(GPIO_PIN9_CONFIG_S)) -#define GPIO_PIN9_CONFIG_V 0x3 -#define GPIO_PIN9_CONFIG_S 11 -/* GPIO_PIN9_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN9_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN9_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN9_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN9_WAKEUP_ENABLE_S 10 -/* GPIO_PIN9_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN9_INT_TYPE 0x00000007 -#define GPIO_PIN9_INT_TYPE_M ((GPIO_PIN9_INT_TYPE_V)<<(GPIO_PIN9_INT_TYPE_S)) -#define GPIO_PIN9_INT_TYPE_V 0x7 -#define GPIO_PIN9_INT_TYPE_S 7 -/* GPIO_PIN9_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN9_PAD_DRIVER (BIT(2)) -#define GPIO_PIN9_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN9_PAD_DRIVER_V 0x1 -#define GPIO_PIN9_PAD_DRIVER_S 2 - -#define GPIO_PIN10_REG (DR_REG_GPIO_BASE + 0x00b0) -/* GPIO_PIN10_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN10_INT_ENA 0x0000001F -#define GPIO_PIN10_INT_ENA_M ((GPIO_PIN10_INT_ENA_V)<<(GPIO_PIN10_INT_ENA_S)) -#define GPIO_PIN10_INT_ENA_V 0x1F -#define GPIO_PIN10_INT_ENA_S 13 -/* GPIO_PIN10_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN10_CONFIG 0x00000003 -#define GPIO_PIN10_CONFIG_M ((GPIO_PIN10_CONFIG_V)<<(GPIO_PIN10_CONFIG_S)) -#define GPIO_PIN10_CONFIG_V 0x3 -#define GPIO_PIN10_CONFIG_S 11 -/* GPIO_PIN10_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN10_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN10_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN10_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN10_WAKEUP_ENABLE_S 10 -/* GPIO_PIN10_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN10_INT_TYPE 0x00000007 -#define GPIO_PIN10_INT_TYPE_M ((GPIO_PIN10_INT_TYPE_V)<<(GPIO_PIN10_INT_TYPE_S)) -#define GPIO_PIN10_INT_TYPE_V 0x7 -#define GPIO_PIN10_INT_TYPE_S 7 -/* GPIO_PIN10_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN10_PAD_DRIVER (BIT(2)) -#define GPIO_PIN10_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN10_PAD_DRIVER_V 0x1 -#define GPIO_PIN10_PAD_DRIVER_S 2 - -#define GPIO_PIN11_REG (DR_REG_GPIO_BASE + 0x00b4) -/* GPIO_PIN11_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN11_INT_ENA 0x0000001F -#define GPIO_PIN11_INT_ENA_M ((GPIO_PIN11_INT_ENA_V)<<(GPIO_PIN11_INT_ENA_S)) -#define GPIO_PIN11_INT_ENA_V 0x1F -#define GPIO_PIN11_INT_ENA_S 13 -/* GPIO_PIN11_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN11_CONFIG 0x00000003 -#define GPIO_PIN11_CONFIG_M ((GPIO_PIN11_CONFIG_V)<<(GPIO_PIN11_CONFIG_S)) -#define GPIO_PIN11_CONFIG_V 0x3 -#define GPIO_PIN11_CONFIG_S 11 -/* GPIO_PIN11_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN11_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN11_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN11_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN11_WAKEUP_ENABLE_S 10 -/* GPIO_PIN11_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN11_INT_TYPE 0x00000007 -#define GPIO_PIN11_INT_TYPE_M ((GPIO_PIN11_INT_TYPE_V)<<(GPIO_PIN11_INT_TYPE_S)) -#define GPIO_PIN11_INT_TYPE_V 0x7 -#define GPIO_PIN11_INT_TYPE_S 7 -/* GPIO_PIN11_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN11_PAD_DRIVER (BIT(2)) -#define GPIO_PIN11_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN11_PAD_DRIVER_V 0x1 -#define GPIO_PIN11_PAD_DRIVER_S 2 - -#define GPIO_PIN12_REG (DR_REG_GPIO_BASE + 0x00b8) -/* GPIO_PIN12_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN12_INT_ENA 0x0000001F -#define GPIO_PIN12_INT_ENA_M ((GPIO_PIN12_INT_ENA_V)<<(GPIO_PIN12_INT_ENA_S)) -#define GPIO_PIN12_INT_ENA_V 0x1F -#define GPIO_PIN12_INT_ENA_S 13 -/* GPIO_PIN12_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN12_CONFIG 0x00000003 -#define GPIO_PIN12_CONFIG_M ((GPIO_PIN12_CONFIG_V)<<(GPIO_PIN12_CONFIG_S)) -#define GPIO_PIN12_CONFIG_V 0x3 -#define GPIO_PIN12_CONFIG_S 11 -/* GPIO_PIN12_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN12_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN12_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN12_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN12_WAKEUP_ENABLE_S 10 -/* GPIO_PIN12_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN12_INT_TYPE 0x00000007 -#define GPIO_PIN12_INT_TYPE_M ((GPIO_PIN12_INT_TYPE_V)<<(GPIO_PIN12_INT_TYPE_S)) -#define GPIO_PIN12_INT_TYPE_V 0x7 -#define GPIO_PIN12_INT_TYPE_S 7 -/* GPIO_PIN12_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN12_PAD_DRIVER (BIT(2)) -#define GPIO_PIN12_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN12_PAD_DRIVER_V 0x1 -#define GPIO_PIN12_PAD_DRIVER_S 2 - -#define GPIO_PIN13_REG (DR_REG_GPIO_BASE + 0x00bc) -/* GPIO_PIN13_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN13_INT_ENA 0x0000001F -#define GPIO_PIN13_INT_ENA_M ((GPIO_PIN13_INT_ENA_V)<<(GPIO_PIN13_INT_ENA_S)) -#define GPIO_PIN13_INT_ENA_V 0x1F -#define GPIO_PIN13_INT_ENA_S 13 -/* GPIO_PIN13_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN13_CONFIG 0x00000003 -#define GPIO_PIN13_CONFIG_M ((GPIO_PIN13_CONFIG_V)<<(GPIO_PIN13_CONFIG_S)) -#define GPIO_PIN13_CONFIG_V 0x3 -#define GPIO_PIN13_CONFIG_S 11 -/* GPIO_PIN13_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN13_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN13_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN13_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN13_WAKEUP_ENABLE_S 10 -/* GPIO_PIN13_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN13_INT_TYPE 0x00000007 -#define GPIO_PIN13_INT_TYPE_M ((GPIO_PIN13_INT_TYPE_V)<<(GPIO_PIN13_INT_TYPE_S)) -#define GPIO_PIN13_INT_TYPE_V 0x7 -#define GPIO_PIN13_INT_TYPE_S 7 -/* GPIO_PIN13_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN13_PAD_DRIVER (BIT(2)) -#define GPIO_PIN13_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN13_PAD_DRIVER_V 0x1 -#define GPIO_PIN13_PAD_DRIVER_S 2 - -#define GPIO_PIN14_REG (DR_REG_GPIO_BASE + 0x00c0) -/* GPIO_PIN14_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN14_INT_ENA 0x0000001F -#define GPIO_PIN14_INT_ENA_M ((GPIO_PIN14_INT_ENA_V)<<(GPIO_PIN14_INT_ENA_S)) -#define GPIO_PIN14_INT_ENA_V 0x1F -#define GPIO_PIN14_INT_ENA_S 13 -/* GPIO_PIN14_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN14_CONFIG 0x00000003 -#define GPIO_PIN14_CONFIG_M ((GPIO_PIN14_CONFIG_V)<<(GPIO_PIN14_CONFIG_S)) -#define GPIO_PIN14_CONFIG_V 0x3 -#define GPIO_PIN14_CONFIG_S 11 -/* GPIO_PIN14_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN14_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN14_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN14_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN14_WAKEUP_ENABLE_S 10 -/* GPIO_PIN14_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN14_INT_TYPE 0x00000007 -#define GPIO_PIN14_INT_TYPE_M ((GPIO_PIN14_INT_TYPE_V)<<(GPIO_PIN14_INT_TYPE_S)) -#define GPIO_PIN14_INT_TYPE_V 0x7 -#define GPIO_PIN14_INT_TYPE_S 7 -/* GPIO_PIN14_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN14_PAD_DRIVER (BIT(2)) -#define GPIO_PIN14_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN14_PAD_DRIVER_V 0x1 -#define GPIO_PIN14_PAD_DRIVER_S 2 - -#define GPIO_PIN15_REG (DR_REG_GPIO_BASE + 0x00c4) -/* GPIO_PIN15_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN15_INT_ENA 0x0000001F -#define GPIO_PIN15_INT_ENA_M ((GPIO_PIN15_INT_ENA_V)<<(GPIO_PIN15_INT_ENA_S)) -#define GPIO_PIN15_INT_ENA_V 0x1F -#define GPIO_PIN15_INT_ENA_S 13 -/* GPIO_PIN15_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN15_CONFIG 0x00000003 -#define GPIO_PIN15_CONFIG_M ((GPIO_PIN15_CONFIG_V)<<(GPIO_PIN15_CONFIG_S)) -#define GPIO_PIN15_CONFIG_V 0x3 -#define GPIO_PIN15_CONFIG_S 11 -/* GPIO_PIN15_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN15_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN15_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN15_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN15_WAKEUP_ENABLE_S 10 -/* GPIO_PIN15_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN15_INT_TYPE 0x00000007 -#define GPIO_PIN15_INT_TYPE_M ((GPIO_PIN15_INT_TYPE_V)<<(GPIO_PIN15_INT_TYPE_S)) -#define GPIO_PIN15_INT_TYPE_V 0x7 -#define GPIO_PIN15_INT_TYPE_S 7 -/* GPIO_PIN15_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN15_PAD_DRIVER (BIT(2)) -#define GPIO_PIN15_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN15_PAD_DRIVER_V 0x1 -#define GPIO_PIN15_PAD_DRIVER_S 2 - -#define GPIO_PIN16_REG (DR_REG_GPIO_BASE + 0x00c8) -/* GPIO_PIN16_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN16_INT_ENA 0x0000001F -#define GPIO_PIN16_INT_ENA_M ((GPIO_PIN16_INT_ENA_V)<<(GPIO_PIN16_INT_ENA_S)) -#define GPIO_PIN16_INT_ENA_V 0x1F -#define GPIO_PIN16_INT_ENA_S 13 -/* GPIO_PIN16_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN16_CONFIG 0x00000003 -#define GPIO_PIN16_CONFIG_M ((GPIO_PIN16_CONFIG_V)<<(GPIO_PIN16_CONFIG_S)) -#define GPIO_PIN16_CONFIG_V 0x3 -#define GPIO_PIN16_CONFIG_S 11 -/* GPIO_PIN16_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN16_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN16_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN16_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN16_WAKEUP_ENABLE_S 10 -/* GPIO_PIN16_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN16_INT_TYPE 0x00000007 -#define GPIO_PIN16_INT_TYPE_M ((GPIO_PIN16_INT_TYPE_V)<<(GPIO_PIN16_INT_TYPE_S)) -#define GPIO_PIN16_INT_TYPE_V 0x7 -#define GPIO_PIN16_INT_TYPE_S 7 -/* GPIO_PIN16_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN16_PAD_DRIVER (BIT(2)) -#define GPIO_PIN16_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN16_PAD_DRIVER_V 0x1 -#define GPIO_PIN16_PAD_DRIVER_S 2 - -#define GPIO_PIN17_REG (DR_REG_GPIO_BASE + 0x00cc) -/* GPIO_PIN17_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN17_INT_ENA 0x0000001F -#define GPIO_PIN17_INT_ENA_M ((GPIO_PIN17_INT_ENA_V)<<(GPIO_PIN17_INT_ENA_S)) -#define GPIO_PIN17_INT_ENA_V 0x1F -#define GPIO_PIN17_INT_ENA_S 13 -/* GPIO_PIN17_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN17_CONFIG 0x00000003 -#define GPIO_PIN17_CONFIG_M ((GPIO_PIN17_CONFIG_V)<<(GPIO_PIN17_CONFIG_S)) -#define GPIO_PIN17_CONFIG_V 0x3 -#define GPIO_PIN17_CONFIG_S 11 -/* GPIO_PIN17_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN17_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN17_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN17_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN17_WAKEUP_ENABLE_S 10 -/* GPIO_PIN17_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN17_INT_TYPE 0x00000007 -#define GPIO_PIN17_INT_TYPE_M ((GPIO_PIN17_INT_TYPE_V)<<(GPIO_PIN17_INT_TYPE_S)) -#define GPIO_PIN17_INT_TYPE_V 0x7 -#define GPIO_PIN17_INT_TYPE_S 7 -/* GPIO_PIN17_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN17_PAD_DRIVER (BIT(2)) -#define GPIO_PIN17_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN17_PAD_DRIVER_V 0x1 -#define GPIO_PIN17_PAD_DRIVER_S 2 - -#define GPIO_PIN18_REG (DR_REG_GPIO_BASE + 0x00d0) -/* GPIO_PIN18_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN18_INT_ENA 0x0000001F -#define GPIO_PIN18_INT_ENA_M ((GPIO_PIN18_INT_ENA_V)<<(GPIO_PIN18_INT_ENA_S)) -#define GPIO_PIN18_INT_ENA_V 0x1F -#define GPIO_PIN18_INT_ENA_S 13 -/* GPIO_PIN18_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN18_CONFIG 0x00000003 -#define GPIO_PIN18_CONFIG_M ((GPIO_PIN18_CONFIG_V)<<(GPIO_PIN18_CONFIG_S)) -#define GPIO_PIN18_CONFIG_V 0x3 -#define GPIO_PIN18_CONFIG_S 11 -/* GPIO_PIN18_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN18_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN18_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN18_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN18_WAKEUP_ENABLE_S 10 -/* GPIO_PIN18_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN18_INT_TYPE 0x00000007 -#define GPIO_PIN18_INT_TYPE_M ((GPIO_PIN18_INT_TYPE_V)<<(GPIO_PIN18_INT_TYPE_S)) -#define GPIO_PIN18_INT_TYPE_V 0x7 -#define GPIO_PIN18_INT_TYPE_S 7 -/* GPIO_PIN18_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN18_PAD_DRIVER (BIT(2)) -#define GPIO_PIN18_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN18_PAD_DRIVER_V 0x1 -#define GPIO_PIN18_PAD_DRIVER_S 2 - -#define GPIO_PIN19_REG (DR_REG_GPIO_BASE + 0x00d4) -/* GPIO_PIN19_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN19_INT_ENA 0x0000001F -#define GPIO_PIN19_INT_ENA_M ((GPIO_PIN19_INT_ENA_V)<<(GPIO_PIN19_INT_ENA_S)) -#define GPIO_PIN19_INT_ENA_V 0x1F -#define GPIO_PIN19_INT_ENA_S 13 -/* GPIO_PIN19_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN19_CONFIG 0x00000003 -#define GPIO_PIN19_CONFIG_M ((GPIO_PIN19_CONFIG_V)<<(GPIO_PIN19_CONFIG_S)) -#define GPIO_PIN19_CONFIG_V 0x3 -#define GPIO_PIN19_CONFIG_S 11 -/* GPIO_PIN19_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN19_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN19_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN19_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN19_WAKEUP_ENABLE_S 10 -/* GPIO_PIN19_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN19_INT_TYPE 0x00000007 -#define GPIO_PIN19_INT_TYPE_M ((GPIO_PIN19_INT_TYPE_V)<<(GPIO_PIN19_INT_TYPE_S)) -#define GPIO_PIN19_INT_TYPE_V 0x7 -#define GPIO_PIN19_INT_TYPE_S 7 -/* GPIO_PIN19_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN19_PAD_DRIVER (BIT(2)) -#define GPIO_PIN19_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN19_PAD_DRIVER_V 0x1 -#define GPIO_PIN19_PAD_DRIVER_S 2 - -#define GPIO_PIN20_REG (DR_REG_GPIO_BASE + 0x00d8) -/* GPIO_PIN20_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-mask interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-mask interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN20_INT_ENA 0x0000001F -#define GPIO_PIN20_INT_ENA_M ((GPIO_PIN20_INT_ENA_V)<<(GPIO_PIN20_INT_ENA_S)) -#define GPIO_PIN20_INT_ENA_V 0x1F -#define GPIO_PIN20_INT_ENA_S 13 -/* GPIO_PIN20_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN20_CONFIG 0x00000003 -#define GPIO_PIN20_CONFIG_M ((GPIO_PIN20_CONFIG_V)<<(GPIO_PIN20_CONFIG_S)) -#define GPIO_PIN20_CONFIG_V 0x3 -#define GPIO_PIN20_CONFIG_S 11 -/* GPIO_PIN20_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN20_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN20_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN20_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN20_WAKEUP_ENABLE_S 10 -/* GPIO_PIN20_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN20_INT_TYPE 0x00000007 -#define GPIO_PIN20_INT_TYPE_M ((GPIO_PIN20_INT_TYPE_V)<<(GPIO_PIN20_INT_TYPE_S)) -#define GPIO_PIN20_INT_TYPE_V 0x7 -#define GPIO_PIN20_INT_TYPE_S 7 -/* GPIO_PIN20_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN20_PAD_DRIVER (BIT(2)) -#define GPIO_PIN20_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN20_PAD_DRIVER_V 0x1 -#define GPIO_PIN20_PAD_DRIVER_S 2 - -#define GPIO_PIN21_REG (DR_REG_GPIO_BASE + 0x00dc) -/* GPIO_PIN21_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN21_INT_ENA 0x0000001F -#define GPIO_PIN21_INT_ENA_M ((GPIO_PIN21_INT_ENA_V)<<(GPIO_PIN21_INT_ENA_S)) -#define GPIO_PIN21_INT_ENA_V 0x1F -#define GPIO_PIN21_INT_ENA_S 13 -/* GPIO_PIN21_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN21_CONFIG 0x00000003 -#define GPIO_PIN21_CONFIG_M ((GPIO_PIN21_CONFIG_V)<<(GPIO_PIN21_CONFIG_S)) -#define GPIO_PIN21_CONFIG_V 0x3 -#define GPIO_PIN21_CONFIG_S 11 -/* GPIO_PIN21_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN21_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN21_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN21_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN21_WAKEUP_ENABLE_S 10 -/* GPIO_PIN21_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN21_INT_TYPE 0x00000007 -#define GPIO_PIN21_INT_TYPE_M ((GPIO_PIN21_INT_TYPE_V)<<(GPIO_PIN21_INT_TYPE_S)) -#define GPIO_PIN21_INT_TYPE_V 0x7 -#define GPIO_PIN21_INT_TYPE_S 7 -/* GPIO_PIN21_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN21_PAD_DRIVER (BIT(2)) -#define GPIO_PIN21_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN21_PAD_DRIVER_V 0x1 -#define GPIO_PIN21_PAD_DRIVER_S 2 - -#define GPIO_PIN22_REG (DR_REG_GPIO_BASE + 0x00e0) -/* GPIO_PIN22_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: */ -#define GPIO_PIN22_INT_ENA 0x0000001F -#define GPIO_PIN22_INT_ENA_M ((GPIO_PIN22_INT_ENA_V)<<(GPIO_PIN22_INT_ENA_S)) -#define GPIO_PIN22_INT_ENA_V 0x1F -#define GPIO_PIN22_INT_ENA_S 13 -/* GPIO_PIN22_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN22_CONFIG 0x00000003 -#define GPIO_PIN22_CONFIG_M ((GPIO_PIN22_CONFIG_V)<<(GPIO_PIN22_CONFIG_S)) -#define GPIO_PIN22_CONFIG_V 0x3 -#define GPIO_PIN22_CONFIG_S 11 -/* GPIO_PIN22_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN22_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN22_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN22_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN22_WAKEUP_ENABLE_S 10 -/* GPIO_PIN22_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN22_INT_TYPE 0x00000007 -#define GPIO_PIN22_INT_TYPE_M ((GPIO_PIN22_INT_TYPE_V)<<(GPIO_PIN22_INT_TYPE_S)) -#define GPIO_PIN22_INT_TYPE_V 0x7 -#define GPIO_PIN22_INT_TYPE_S 7 -/* GPIO_PIN22_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: */ -#define GPIO_PIN22_PAD_DRIVER (BIT(2)) -#define GPIO_PIN22_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN22_PAD_DRIVER_V 0x1 -#define GPIO_PIN22_PAD_DRIVER_S 2 - -#define GPIO_PIN23_REG (DR_REG_GPIO_BASE + 0x00e4) -/* GPIO_PIN23_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN23_INT_ENA 0x0000001F -#define GPIO_PIN23_INT_ENA_M ((GPIO_PIN23_INT_ENA_V)<<(GPIO_PIN23_INT_ENA_S)) -#define GPIO_PIN23_INT_ENA_V 0x1F -#define GPIO_PIN23_INT_ENA_S 13 -/* GPIO_PIN23_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN23_CONFIG 0x00000003 -#define GPIO_PIN23_CONFIG_M ((GPIO_PIN23_CONFIG_V)<<(GPIO_PIN23_CONFIG_S)) -#define GPIO_PIN23_CONFIG_V 0x3 -#define GPIO_PIN23_CONFIG_S 11 -/* GPIO_PIN23_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN23_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN23_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN23_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN23_WAKEUP_ENABLE_S 10 -/* GPIO_PIN23_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN23_INT_TYPE 0x00000007 -#define GPIO_PIN23_INT_TYPE_M ((GPIO_PIN23_INT_TYPE_V)<<(GPIO_PIN23_INT_TYPE_S)) -#define GPIO_PIN23_INT_TYPE_V 0x7 -#define GPIO_PIN23_INT_TYPE_S 7 -/* GPIO_PIN23_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN23_PAD_DRIVER (BIT(2)) -#define GPIO_PIN23_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN23_PAD_DRIVER_V 0x1 -#define GPIO_PIN23_PAD_DRIVER_S 2 - -#define GPIO_PIN24_REG (DR_REG_GPIO_BASE + 0x00e8) -/* GPIO_PIN24_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN24_INT_ENA 0x0000001F -#define GPIO_PIN24_INT_ENA_M ((GPIO_PIN24_INT_ENA_V)<<(GPIO_PIN24_INT_ENA_S)) -#define GPIO_PIN24_INT_ENA_V 0x1F -#define GPIO_PIN24_INT_ENA_S 13 -/* GPIO_PIN24_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN24_CONFIG 0x00000003 -#define GPIO_PIN24_CONFIG_M ((GPIO_PIN24_CONFIG_V)<<(GPIO_PIN24_CONFIG_S)) -#define GPIO_PIN24_CONFIG_V 0x3 -#define GPIO_PIN24_CONFIG_S 11 -/* GPIO_PIN24_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN24_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN24_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN24_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN24_WAKEUP_ENABLE_S 10 -/* GPIO_PIN24_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN24_INT_TYPE 0x00000007 -#define GPIO_PIN24_INT_TYPE_M ((GPIO_PIN24_INT_TYPE_V)<<(GPIO_PIN24_INT_TYPE_S)) -#define GPIO_PIN24_INT_TYPE_V 0x7 -#define GPIO_PIN24_INT_TYPE_S 7 -/* GPIO_PIN24_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN24_PAD_DRIVER (BIT(2)) -#define GPIO_PIN24_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN24_PAD_DRIVER_V 0x1 -#define GPIO_PIN24_PAD_DRIVER_S 2 - -#define GPIO_PIN25_REG (DR_REG_GPIO_BASE + 0x00ec) -/* GPIO_PIN25_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN25_INT_ENA 0x0000001F -#define GPIO_PIN25_INT_ENA_M ((GPIO_PIN25_INT_ENA_V)<<(GPIO_PIN25_INT_ENA_S)) -#define GPIO_PIN25_INT_ENA_V 0x1F -#define GPIO_PIN25_INT_ENA_S 13 -/* GPIO_PIN25_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN25_CONFIG 0x00000003 -#define GPIO_PIN25_CONFIG_M ((GPIO_PIN25_CONFIG_V)<<(GPIO_PIN25_CONFIG_S)) -#define GPIO_PIN25_CONFIG_V 0x3 -#define GPIO_PIN25_CONFIG_S 11 -/* GPIO_PIN25_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN25_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN25_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN25_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN25_WAKEUP_ENABLE_S 10 -/* GPIO_PIN25_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN25_INT_TYPE 0x00000007 -#define GPIO_PIN25_INT_TYPE_M ((GPIO_PIN25_INT_TYPE_V)<<(GPIO_PIN25_INT_TYPE_S)) -#define GPIO_PIN25_INT_TYPE_V 0x7 -#define GPIO_PIN25_INT_TYPE_S 7 -/* GPIO_PIN25_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN25_PAD_DRIVER (BIT(2)) -#define GPIO_PIN25_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN25_PAD_DRIVER_V 0x1 -#define GPIO_PIN25_PAD_DRIVER_S 2 - -#define GPIO_PIN26_REG (DR_REG_GPIO_BASE + 0x00f0) -/* GPIO_PIN26_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN26_INT_ENA 0x0000001F -#define GPIO_PIN26_INT_ENA_M ((GPIO_PIN26_INT_ENA_V)<<(GPIO_PIN26_INT_ENA_S)) -#define GPIO_PIN26_INT_ENA_V 0x1F -#define GPIO_PIN26_INT_ENA_S 13 -/* GPIO_PIN26_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN26_CONFIG 0x00000003 -#define GPIO_PIN26_CONFIG_M ((GPIO_PIN26_CONFIG_V)<<(GPIO_PIN26_CONFIG_S)) -#define GPIO_PIN26_CONFIG_V 0x3 -#define GPIO_PIN26_CONFIG_S 11 -/* GPIO_PIN26_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN26_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN26_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN26_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN26_WAKEUP_ENABLE_S 10 -/* GPIO_PIN26_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN26_INT_TYPE 0x00000007 -#define GPIO_PIN26_INT_TYPE_M ((GPIO_PIN26_INT_TYPE_V)<<(GPIO_PIN26_INT_TYPE_S)) -#define GPIO_PIN26_INT_TYPE_V 0x7 -#define GPIO_PIN26_INT_TYPE_S 7 -/* GPIO_PIN26_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN26_PAD_DRIVER (BIT(2)) -#define GPIO_PIN26_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN26_PAD_DRIVER_V 0x1 -#define GPIO_PIN26_PAD_DRIVER_S 2 - -#define GPIO_PIN27_REG (DR_REG_GPIO_BASE + 0x00f4) -/* GPIO_PIN27_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN27_INT_ENA 0x0000001F -#define GPIO_PIN27_INT_ENA_M ((GPIO_PIN27_INT_ENA_V)<<(GPIO_PIN27_INT_ENA_S)) -#define GPIO_PIN27_INT_ENA_V 0x1F -#define GPIO_PIN27_INT_ENA_S 13 -/* GPIO_PIN27_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN27_CONFIG 0x00000003 -#define GPIO_PIN27_CONFIG_M ((GPIO_PIN27_CONFIG_V)<<(GPIO_PIN27_CONFIG_S)) -#define GPIO_PIN27_CONFIG_V 0x3 -#define GPIO_PIN27_CONFIG_S 11 -/* GPIO_PIN27_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN27_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN27_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN27_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN27_WAKEUP_ENABLE_S 10 -/* GPIO_PIN27_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN27_INT_TYPE 0x00000007 -#define GPIO_PIN27_INT_TYPE_M ((GPIO_PIN27_INT_TYPE_V)<<(GPIO_PIN27_INT_TYPE_S)) -#define GPIO_PIN27_INT_TYPE_V 0x7 -#define GPIO_PIN27_INT_TYPE_S 7 -/* GPIO_PIN27_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN27_PAD_DRIVER (BIT(2)) -#define GPIO_PIN27_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN27_PAD_DRIVER_V 0x1 -#define GPIO_PIN27_PAD_DRIVER_S 2 - -#define GPIO_PIN28_REG (DR_REG_GPIO_BASE + 0x00f8) -/* GPIO_PIN28_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN28_INT_ENA 0x0000001F -#define GPIO_PIN28_INT_ENA_M ((GPIO_PIN28_INT_ENA_V)<<(GPIO_PIN28_INT_ENA_S)) -#define GPIO_PIN28_INT_ENA_V 0x1F -#define GPIO_PIN28_INT_ENA_S 13 -/* GPIO_PIN28_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN28_CONFIG 0x00000003 -#define GPIO_PIN28_CONFIG_M ((GPIO_PIN28_CONFIG_V)<<(GPIO_PIN28_CONFIG_S)) -#define GPIO_PIN28_CONFIG_V 0x3 -#define GPIO_PIN28_CONFIG_S 11 -/* GPIO_PIN28_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN28_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN28_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN28_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN28_WAKEUP_ENABLE_S 10 -/* GPIO_PIN28_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN28_INT_TYPE 0x00000007 -#define GPIO_PIN28_INT_TYPE_M ((GPIO_PIN28_INT_TYPE_V)<<(GPIO_PIN28_INT_TYPE_S)) -#define GPIO_PIN28_INT_TYPE_V 0x7 -#define GPIO_PIN28_INT_TYPE_S 7 -/* GPIO_PIN28_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN28_PAD_DRIVER (BIT(2)) -#define GPIO_PIN28_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN28_PAD_DRIVER_V 0x1 -#define GPIO_PIN28_PAD_DRIVER_S 2 - -#define GPIO_PIN29_REG (DR_REG_GPIO_BASE + 0x00fc) -/* GPIO_PIN29_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN29_INT_ENA 0x0000001F -#define GPIO_PIN29_INT_ENA_M ((GPIO_PIN29_INT_ENA_V)<<(GPIO_PIN29_INT_ENA_S)) -#define GPIO_PIN29_INT_ENA_V 0x1F -#define GPIO_PIN29_INT_ENA_S 13 -/* GPIO_PIN29_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN29_CONFIG 0x00000003 -#define GPIO_PIN29_CONFIG_M ((GPIO_PIN29_CONFIG_V)<<(GPIO_PIN29_CONFIG_S)) -#define GPIO_PIN29_CONFIG_V 0x3 -#define GPIO_PIN29_CONFIG_S 11 -/* GPIO_PIN29_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN29_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN29_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN29_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN29_WAKEUP_ENABLE_S 10 -/* GPIO_PIN29_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN29_INT_TYPE 0x00000007 -#define GPIO_PIN29_INT_TYPE_M ((GPIO_PIN29_INT_TYPE_V)<<(GPIO_PIN29_INT_TYPE_S)) -#define GPIO_PIN29_INT_TYPE_V 0x7 -#define GPIO_PIN29_INT_TYPE_S 7 -/* GPIO_PIN29_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN29_PAD_DRIVER (BIT(2)) -#define GPIO_PIN29_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN29_PAD_DRIVER_V 0x1 -#define GPIO_PIN29_PAD_DRIVER_S 2 - -#define GPIO_PIN30_REG (DR_REG_GPIO_BASE + 0x0100) -/* GPIO_PIN30_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN30_INT_ENA 0x0000001F -#define GPIO_PIN30_INT_ENA_M ((GPIO_PIN30_INT_ENA_V)<<(GPIO_PIN30_INT_ENA_S)) -#define GPIO_PIN30_INT_ENA_V 0x1F -#define GPIO_PIN30_INT_ENA_S 13 -/* GPIO_PIN30_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN30_CONFIG 0x00000003 -#define GPIO_PIN30_CONFIG_M ((GPIO_PIN30_CONFIG_V)<<(GPIO_PIN30_CONFIG_S)) -#define GPIO_PIN30_CONFIG_V 0x3 -#define GPIO_PIN30_CONFIG_S 11 -/* GPIO_PIN30_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN30_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN30_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN30_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN30_WAKEUP_ENABLE_S 10 -/* GPIO_PIN30_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN30_INT_TYPE 0x00000007 -#define GPIO_PIN30_INT_TYPE_M ((GPIO_PIN30_INT_TYPE_V)<<(GPIO_PIN30_INT_TYPE_S)) -#define GPIO_PIN30_INT_TYPE_V 0x7 -#define GPIO_PIN30_INT_TYPE_S 7 -/* GPIO_PIN30_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN30_PAD_DRIVER (BIT(2)) -#define GPIO_PIN30_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN30_PAD_DRIVER_V 0x1 -#define GPIO_PIN30_PAD_DRIVER_S 2 - -#define GPIO_PIN31_REG (DR_REG_GPIO_BASE + 0x0104) -/* GPIO_PIN31_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN31_INT_ENA 0x0000001F -#define GPIO_PIN31_INT_ENA_M ((GPIO_PIN31_INT_ENA_V)<<(GPIO_PIN31_INT_ENA_S)) -#define GPIO_PIN31_INT_ENA_V 0x1F -#define GPIO_PIN31_INT_ENA_S 13 -/* GPIO_PIN31_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN31_CONFIG 0x00000003 -#define GPIO_PIN31_CONFIG_M ((GPIO_PIN31_CONFIG_V)<<(GPIO_PIN31_CONFIG_S)) -#define GPIO_PIN31_CONFIG_V 0x3 -#define GPIO_PIN31_CONFIG_S 11 -/* GPIO_PIN31_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN31_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN31_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN31_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN31_WAKEUP_ENABLE_S 10 -/* GPIO_PIN31_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN31_INT_TYPE 0x00000007 -#define GPIO_PIN31_INT_TYPE_M ((GPIO_PIN31_INT_TYPE_V)<<(GPIO_PIN31_INT_TYPE_S)) -#define GPIO_PIN31_INT_TYPE_V 0x7 -#define GPIO_PIN31_INT_TYPE_S 7 -/* GPIO_PIN31_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN31_PAD_DRIVER (BIT(2)) -#define GPIO_PIN31_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN31_PAD_DRIVER_V 0x1 -#define GPIO_PIN31_PAD_DRIVER_S 2 - -#define GPIO_PIN32_REG (DR_REG_GPIO_BASE + 0x0108) -/* GPIO_PIN32_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN32_INT_ENA 0x0000001F -#define GPIO_PIN32_INT_ENA_M ((GPIO_PIN32_INT_ENA_V)<<(GPIO_PIN32_INT_ENA_S)) -#define GPIO_PIN32_INT_ENA_V 0x1F -#define GPIO_PIN32_INT_ENA_S 13 -/* GPIO_PIN32_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN32_CONFIG 0x00000003 -#define GPIO_PIN32_CONFIG_M ((GPIO_PIN32_CONFIG_V)<<(GPIO_PIN32_CONFIG_S)) -#define GPIO_PIN32_CONFIG_V 0x3 -#define GPIO_PIN32_CONFIG_S 11 -/* GPIO_PIN32_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN32_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN32_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN32_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN32_WAKEUP_ENABLE_S 10 -/* GPIO_PIN32_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN32_INT_TYPE 0x00000007 -#define GPIO_PIN32_INT_TYPE_M ((GPIO_PIN32_INT_TYPE_V)<<(GPIO_PIN32_INT_TYPE_S)) -#define GPIO_PIN32_INT_TYPE_V 0x7 -#define GPIO_PIN32_INT_TYPE_S 7 -/* GPIO_PIN32_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN32_PAD_DRIVER (BIT(2)) -#define GPIO_PIN32_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN32_PAD_DRIVER_V 0x1 -#define GPIO_PIN32_PAD_DRIVER_S 2 - -#define GPIO_PIN33_REG (DR_REG_GPIO_BASE + 0x010c) -/* GPIO_PIN33_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN33_INT_ENA 0x0000001F -#define GPIO_PIN33_INT_ENA_M ((GPIO_PIN33_INT_ENA_V)<<(GPIO_PIN33_INT_ENA_S)) -#define GPIO_PIN33_INT_ENA_V 0x1F -#define GPIO_PIN33_INT_ENA_S 13 -/* GPIO_PIN33_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN33_CONFIG 0x00000003 -#define GPIO_PIN33_CONFIG_M ((GPIO_PIN33_CONFIG_V)<<(GPIO_PIN33_CONFIG_S)) -#define GPIO_PIN33_CONFIG_V 0x3 -#define GPIO_PIN33_CONFIG_S 11 -/* GPIO_PIN33_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN33_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN33_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN33_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN33_WAKEUP_ENABLE_S 10 -/* GPIO_PIN33_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN33_INT_TYPE 0x00000007 -#define GPIO_PIN33_INT_TYPE_M ((GPIO_PIN33_INT_TYPE_V)<<(GPIO_PIN33_INT_TYPE_S)) -#define GPIO_PIN33_INT_TYPE_V 0x7 -#define GPIO_PIN33_INT_TYPE_S 7 -/* GPIO_PIN33_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN33_PAD_DRIVER (BIT(2)) -#define GPIO_PIN33_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN33_PAD_DRIVER_V 0x1 -#define GPIO_PIN33_PAD_DRIVER_S 2 - -#define GPIO_PIN34_REG (DR_REG_GPIO_BASE + 0x0110) -/* GPIO_PIN34_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN34_INT_ENA 0x0000001F -#define GPIO_PIN34_INT_ENA_M ((GPIO_PIN34_INT_ENA_V)<<(GPIO_PIN34_INT_ENA_S)) -#define GPIO_PIN34_INT_ENA_V 0x1F -#define GPIO_PIN34_INT_ENA_S 13 -/* GPIO_PIN34_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN34_CONFIG 0x00000003 -#define GPIO_PIN34_CONFIG_M ((GPIO_PIN34_CONFIG_V)<<(GPIO_PIN34_CONFIG_S)) -#define GPIO_PIN34_CONFIG_V 0x3 -#define GPIO_PIN34_CONFIG_S 11 -/* GPIO_PIN34_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN34_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN34_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN34_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN34_WAKEUP_ENABLE_S 10 -/* GPIO_PIN34_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN34_INT_TYPE 0x00000007 -#define GPIO_PIN34_INT_TYPE_M ((GPIO_PIN34_INT_TYPE_V)<<(GPIO_PIN34_INT_TYPE_S)) -#define GPIO_PIN34_INT_TYPE_V 0x7 -#define GPIO_PIN34_INT_TYPE_S 7 -/* GPIO_PIN34_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN34_PAD_DRIVER (BIT(2)) -#define GPIO_PIN34_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN34_PAD_DRIVER_V 0x1 -#define GPIO_PIN34_PAD_DRIVER_S 2 - -#define GPIO_PIN35_REG (DR_REG_GPIO_BASE + 0x0114) -/* GPIO_PIN35_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN35_INT_ENA 0x0000001F -#define GPIO_PIN35_INT_ENA_M ((GPIO_PIN35_INT_ENA_V)<<(GPIO_PIN35_INT_ENA_S)) -#define GPIO_PIN35_INT_ENA_V 0x1F -#define GPIO_PIN35_INT_ENA_S 13 -/* GPIO_PIN35_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN35_CONFIG 0x00000003 -#define GPIO_PIN35_CONFIG_M ((GPIO_PIN35_CONFIG_V)<<(GPIO_PIN35_CONFIG_S)) -#define GPIO_PIN35_CONFIG_V 0x3 -#define GPIO_PIN35_CONFIG_S 11 -/* GPIO_PIN35_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN35_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN35_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN35_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN35_WAKEUP_ENABLE_S 10 -/* GPIO_PIN35_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN35_INT_TYPE 0x00000007 -#define GPIO_PIN35_INT_TYPE_M ((GPIO_PIN35_INT_TYPE_V)<<(GPIO_PIN35_INT_TYPE_S)) -#define GPIO_PIN35_INT_TYPE_V 0x7 -#define GPIO_PIN35_INT_TYPE_S 7 -/* GPIO_PIN35_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN35_PAD_DRIVER (BIT(2)) -#define GPIO_PIN35_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN35_PAD_DRIVER_V 0x1 -#define GPIO_PIN35_PAD_DRIVER_S 2 - -#define GPIO_PIN36_REG (DR_REG_GPIO_BASE + 0x0118) -/* GPIO_PIN36_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN36_INT_ENA 0x0000001F -#define GPIO_PIN36_INT_ENA_M ((GPIO_PIN36_INT_ENA_V)<<(GPIO_PIN36_INT_ENA_S)) -#define GPIO_PIN36_INT_ENA_V 0x1F -#define GPIO_PIN36_INT_ENA_S 13 -/* GPIO_PIN36_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN36_CONFIG 0x00000003 -#define GPIO_PIN36_CONFIG_M ((GPIO_PIN36_CONFIG_V)<<(GPIO_PIN36_CONFIG_S)) -#define GPIO_PIN36_CONFIG_V 0x3 -#define GPIO_PIN36_CONFIG_S 11 -/* GPIO_PIN36_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN36_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN36_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN36_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN36_WAKEUP_ENABLE_S 10 -/* GPIO_PIN36_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN36_INT_TYPE 0x00000007 -#define GPIO_PIN36_INT_TYPE_M ((GPIO_PIN36_INT_TYPE_V)<<(GPIO_PIN36_INT_TYPE_S)) -#define GPIO_PIN36_INT_TYPE_V 0x7 -#define GPIO_PIN36_INT_TYPE_S 7 -/* GPIO_PIN36_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN36_PAD_DRIVER (BIT(2)) -#define GPIO_PIN36_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN36_PAD_DRIVER_V 0x1 -#define GPIO_PIN36_PAD_DRIVER_S 2 - -#define GPIO_PIN37_REG (DR_REG_GPIO_BASE + 0x011c) -/* GPIO_PIN37_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN37_INT_ENA 0x0000001F -#define GPIO_PIN37_INT_ENA_M ((GPIO_PIN37_INT_ENA_V)<<(GPIO_PIN37_INT_ENA_S)) -#define GPIO_PIN37_INT_ENA_V 0x1F -#define GPIO_PIN37_INT_ENA_S 13 -/* GPIO_PIN37_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN37_CONFIG 0x00000003 -#define GPIO_PIN37_CONFIG_M ((GPIO_PIN37_CONFIG_V)<<(GPIO_PIN37_CONFIG_S)) -#define GPIO_PIN37_CONFIG_V 0x3 -#define GPIO_PIN37_CONFIG_S 11 -/* GPIO_PIN37_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN37_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN37_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN37_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN37_WAKEUP_ENABLE_S 10 -/* GPIO_PIN37_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN37_INT_TYPE 0x00000007 -#define GPIO_PIN37_INT_TYPE_M ((GPIO_PIN37_INT_TYPE_V)<<(GPIO_PIN37_INT_TYPE_S)) -#define GPIO_PIN37_INT_TYPE_V 0x7 -#define GPIO_PIN37_INT_TYPE_S 7 -/* GPIO_PIN37_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN37_PAD_DRIVER (BIT(2)) -#define GPIO_PIN37_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN37_PAD_DRIVER_V 0x1 -#define GPIO_PIN37_PAD_DRIVER_S 2 - -#define GPIO_PIN38_REG (DR_REG_GPIO_BASE + 0x0120) -/* GPIO_PIN38_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN38_INT_ENA 0x0000001F -#define GPIO_PIN38_INT_ENA_M ((GPIO_PIN38_INT_ENA_V)<<(GPIO_PIN38_INT_ENA_S)) -#define GPIO_PIN38_INT_ENA_V 0x1F -#define GPIO_PIN38_INT_ENA_S 13 -/* GPIO_PIN38_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN38_CONFIG 0x00000003 -#define GPIO_PIN38_CONFIG_M ((GPIO_PIN38_CONFIG_V)<<(GPIO_PIN38_CONFIG_S)) -#define GPIO_PIN38_CONFIG_V 0x3 -#define GPIO_PIN38_CONFIG_S 11 -/* GPIO_PIN38_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN38_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN38_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN38_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN38_WAKEUP_ENABLE_S 10 -/* GPIO_PIN38_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN38_INT_TYPE 0x00000007 -#define GPIO_PIN38_INT_TYPE_M ((GPIO_PIN38_INT_TYPE_V)<<(GPIO_PIN38_INT_TYPE_S)) -#define GPIO_PIN38_INT_TYPE_V 0x7 -#define GPIO_PIN38_INT_TYPE_S 7 -/* GPIO_PIN38_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN38_PAD_DRIVER (BIT(2)) -#define GPIO_PIN38_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN38_PAD_DRIVER_V 0x1 -#define GPIO_PIN38_PAD_DRIVER_S 2 - -#define GPIO_PIN39_REG (DR_REG_GPIO_BASE + 0x0124) -/* GPIO_PIN39_INT_ENA : R/W ;bitpos:[17:13] ;default: x ; */ -/*description: bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt - enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ -#define GPIO_PIN39_INT_ENA 0x0000001F -#define GPIO_PIN39_INT_ENA_M ((GPIO_PIN39_INT_ENA_V)<<(GPIO_PIN39_INT_ENA_S)) -#define GPIO_PIN39_INT_ENA_V 0x1F -#define GPIO_PIN39_INT_ENA_S 13 -/* GPIO_PIN39_CONFIG : R/W ;bitpos:[12:11] ;default: x ; */ -/*description: NA*/ -#define GPIO_PIN39_CONFIG 0x00000003 -#define GPIO_PIN39_CONFIG_M ((GPIO_PIN39_CONFIG_V)<<(GPIO_PIN39_CONFIG_S)) -#define GPIO_PIN39_CONFIG_V 0x3 -#define GPIO_PIN39_CONFIG_S 11 -/* GPIO_PIN39_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: x ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define GPIO_PIN39_WAKEUP_ENABLE (BIT(10)) -#define GPIO_PIN39_WAKEUP_ENABLE_M (BIT(10)) -#define GPIO_PIN39_WAKEUP_ENABLE_V 0x1 -#define GPIO_PIN39_WAKEUP_ENABLE_S 10 -/* GPIO_PIN39_INT_TYPE : R/W ;bitpos:[9:7] ;default: x ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define GPIO_PIN39_INT_TYPE 0x00000007 -#define GPIO_PIN39_INT_TYPE_M ((GPIO_PIN39_INT_TYPE_V)<<(GPIO_PIN39_INT_TYPE_S)) -#define GPIO_PIN39_INT_TYPE_V 0x7 -#define GPIO_PIN39_INT_TYPE_S 7 -/* GPIO_PIN39_PAD_DRIVER : R/W ;bitpos:[2] ;default: x ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define GPIO_PIN39_PAD_DRIVER (BIT(2)) -#define GPIO_PIN39_PAD_DRIVER_M (BIT(2)) -#define GPIO_PIN39_PAD_DRIVER_V 0x1 -#define GPIO_PIN39_PAD_DRIVER_S 2 - -#define GPIO_cali_conf_REG (DR_REG_GPIO_BASE + 0x0128) -/* GPIO_CALI_START : R/W ;bitpos:[31] ;default: x ; */ -/*description: */ -#define GPIO_CALI_START (BIT(31)) -#define GPIO_CALI_START_M (BIT(31)) -#define GPIO_CALI_START_V 0x1 -#define GPIO_CALI_START_S 31 -/* GPIO_CALI_RTC_MAX : R/W ;bitpos:[9:0] ;default: x ; */ -/*description: */ -#define GPIO_CALI_RTC_MAX 0x000003FF -#define GPIO_CALI_RTC_MAX_M ((GPIO_CALI_RTC_MAX_V)<<(GPIO_CALI_RTC_MAX_S)) -#define GPIO_CALI_RTC_MAX_V 0x3FF -#define GPIO_CALI_RTC_MAX_S 0 - -#define GPIO_cali_data_REG (DR_REG_GPIO_BASE + 0x012c) -/* GPIO_CALI_RDY_SYNC2 : RO ;bitpos:[31] ;default: ; */ -/*description: */ -#define GPIO_CALI_RDY_SYNC2 (BIT(31)) -#define GPIO_CALI_RDY_SYNC2_M (BIT(31)) -#define GPIO_CALI_RDY_SYNC2_V 0x1 -#define GPIO_CALI_RDY_SYNC2_S 31 -/* GPIO_CALI_RDY_REAL : RO ;bitpos:[30] ;default: ; */ -/*description: */ -#define GPIO_CALI_RDY_REAL (BIT(30)) -#define GPIO_CALI_RDY_REAL_M (BIT(30)) -#define GPIO_CALI_RDY_REAL_V 0x1 -#define GPIO_CALI_RDY_REAL_S 30 -/* GPIO_CALI_VALUE_SYNC2 : RO ;bitpos:[19:0] ;default: ; */ -/*description: */ -#define GPIO_CALI_VALUE_SYNC2 0x000FFFFF -#define GPIO_CALI_VALUE_SYNC2_M ((GPIO_CALI_VALUE_SYNC2_V)<<(GPIO_CALI_VALUE_SYNC2_S)) -#define GPIO_CALI_VALUE_SYNC2_V 0xFFFFF -#define GPIO_CALI_VALUE_SYNC2_S 0 - -#define GPIO_FUNC0_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0130) -/* GPIO_SIG0_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG0_IN_SEL (BIT(7)) -#define GPIO_SIG0_IN_SEL_M (BIT(7)) -#define GPIO_SIG0_IN_SEL_V 0x1 -#define GPIO_SIG0_IN_SEL_S 7 -/* GPIO_FUNC0_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC0_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC0_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC0_IN_INV_SEL_V 0x1 -#define GPIO_FUNC0_IN_INV_SEL_S 6 -/* GPIO_FUNC0_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC0_IN_SEL 0x0000003F -#define GPIO_FUNC0_IN_SEL_M ((GPIO_FUNC0_IN_SEL_V)<<(GPIO_FUNC0_IN_SEL_S)) -#define GPIO_FUNC0_IN_SEL_V 0x3F -#define GPIO_FUNC0_IN_SEL_S 0 - -#define GPIO_FUNC1_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0134) -/* GPIO_SIG1_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG1_IN_SEL (BIT(7)) -#define GPIO_SIG1_IN_SEL_M (BIT(7)) -#define GPIO_SIG1_IN_SEL_V 0x1 -#define GPIO_SIG1_IN_SEL_S 7 -/* GPIO_FUNC1_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC1_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC1_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC1_IN_INV_SEL_V 0x1 -#define GPIO_FUNC1_IN_INV_SEL_S 6 -/* GPIO_FUNC1_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC1_IN_SEL 0x0000003F -#define GPIO_FUNC1_IN_SEL_M ((GPIO_FUNC1_IN_SEL_V)<<(GPIO_FUNC1_IN_SEL_S)) -#define GPIO_FUNC1_IN_SEL_V 0x3F -#define GPIO_FUNC1_IN_SEL_S 0 - -#define GPIO_FUNC2_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0138) -/* GPIO_SIG2_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG2_IN_SEL (BIT(7)) -#define GPIO_SIG2_IN_SEL_M (BIT(7)) -#define GPIO_SIG2_IN_SEL_V 0x1 -#define GPIO_SIG2_IN_SEL_S 7 -/* GPIO_FUNC2_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC2_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC2_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC2_IN_INV_SEL_V 0x1 -#define GPIO_FUNC2_IN_INV_SEL_S 6 -/* GPIO_FUNC2_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC2_IN_SEL 0x0000003F -#define GPIO_FUNC2_IN_SEL_M ((GPIO_FUNC2_IN_SEL_V)<<(GPIO_FUNC2_IN_SEL_S)) -#define GPIO_FUNC2_IN_SEL_V 0x3F -#define GPIO_FUNC2_IN_SEL_S 0 - -#define GPIO_FUNC3_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x013c) -/* GPIO_SIG3_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG3_IN_SEL (BIT(7)) -#define GPIO_SIG3_IN_SEL_M (BIT(7)) -#define GPIO_SIG3_IN_SEL_V 0x1 -#define GPIO_SIG3_IN_SEL_S 7 -/* GPIO_FUNC3_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC3_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC3_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC3_IN_INV_SEL_V 0x1 -#define GPIO_FUNC3_IN_INV_SEL_S 6 -/* GPIO_FUNC3_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC3_IN_SEL 0x0000003F -#define GPIO_FUNC3_IN_SEL_M ((GPIO_FUNC3_IN_SEL_V)<<(GPIO_FUNC3_IN_SEL_S)) -#define GPIO_FUNC3_IN_SEL_V 0x3F -#define GPIO_FUNC3_IN_SEL_S 0 - -#define GPIO_FUNC4_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0140) -/* GPIO_SIG4_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG4_IN_SEL (BIT(7)) -#define GPIO_SIG4_IN_SEL_M (BIT(7)) -#define GPIO_SIG4_IN_SEL_V 0x1 -#define GPIO_SIG4_IN_SEL_S 7 -/* GPIO_FUNC4_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC4_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC4_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC4_IN_INV_SEL_V 0x1 -#define GPIO_FUNC4_IN_INV_SEL_S 6 -/* GPIO_FUNC4_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC4_IN_SEL 0x0000003F -#define GPIO_FUNC4_IN_SEL_M ((GPIO_FUNC4_IN_SEL_V)<<(GPIO_FUNC4_IN_SEL_S)) -#define GPIO_FUNC4_IN_SEL_V 0x3F -#define GPIO_FUNC4_IN_SEL_S 0 - -#define GPIO_FUNC5_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0144) -/* GPIO_SIG5_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG5_IN_SEL (BIT(7)) -#define GPIO_SIG5_IN_SEL_M (BIT(7)) -#define GPIO_SIG5_IN_SEL_V 0x1 -#define GPIO_SIG5_IN_SEL_S 7 -/* GPIO_FUNC5_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC5_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC5_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC5_IN_INV_SEL_V 0x1 -#define GPIO_FUNC5_IN_INV_SEL_S 6 -/* GPIO_FUNC5_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC5_IN_SEL 0x0000003F -#define GPIO_FUNC5_IN_SEL_M ((GPIO_FUNC5_IN_SEL_V)<<(GPIO_FUNC5_IN_SEL_S)) -#define GPIO_FUNC5_IN_SEL_V 0x3F -#define GPIO_FUNC5_IN_SEL_S 0 - -#define GPIO_FUNC6_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0148) -/* GPIO_SIG6_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG6_IN_SEL (BIT(7)) -#define GPIO_SIG6_IN_SEL_M (BIT(7)) -#define GPIO_SIG6_IN_SEL_V 0x1 -#define GPIO_SIG6_IN_SEL_S 7 -/* GPIO_FUNC6_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC6_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC6_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC6_IN_INV_SEL_V 0x1 -#define GPIO_FUNC6_IN_INV_SEL_S 6 -/* GPIO_FUNC6_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC6_IN_SEL 0x0000003F -#define GPIO_FUNC6_IN_SEL_M ((GPIO_FUNC6_IN_SEL_V)<<(GPIO_FUNC6_IN_SEL_S)) -#define GPIO_FUNC6_IN_SEL_V 0x3F -#define GPIO_FUNC6_IN_SEL_S 0 - -#define GPIO_FUNC7_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x014c) -/* GPIO_SIG7_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG7_IN_SEL (BIT(7)) -#define GPIO_SIG7_IN_SEL_M (BIT(7)) -#define GPIO_SIG7_IN_SEL_V 0x1 -#define GPIO_SIG7_IN_SEL_S 7 -/* GPIO_FUNC7_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC7_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC7_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC7_IN_INV_SEL_V 0x1 -#define GPIO_FUNC7_IN_INV_SEL_S 6 -/* GPIO_FUNC7_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC7_IN_SEL 0x0000003F -#define GPIO_FUNC7_IN_SEL_M ((GPIO_FUNC7_IN_SEL_V)<<(GPIO_FUNC7_IN_SEL_S)) -#define GPIO_FUNC7_IN_SEL_V 0x3F -#define GPIO_FUNC7_IN_SEL_S 0 - -#define GPIO_FUNC8_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0150) -/* GPIO_SIG8_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG8_IN_SEL (BIT(7)) -#define GPIO_SIG8_IN_SEL_M (BIT(7)) -#define GPIO_SIG8_IN_SEL_V 0x1 -#define GPIO_SIG8_IN_SEL_S 7 -/* GPIO_FUNC8_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC8_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC8_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC8_IN_INV_SEL_V 0x1 -#define GPIO_FUNC8_IN_INV_SEL_S 6 -/* GPIO_FUNC8_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC8_IN_SEL 0x0000003F -#define GPIO_FUNC8_IN_SEL_M ((GPIO_FUNC8_IN_SEL_V)<<(GPIO_FUNC8_IN_SEL_S)) -#define GPIO_FUNC8_IN_SEL_V 0x3F -#define GPIO_FUNC8_IN_SEL_S 0 - -#define GPIO_FUNC9_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0154) -/* GPIO_SIG9_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG9_IN_SEL (BIT(7)) -#define GPIO_SIG9_IN_SEL_M (BIT(7)) -#define GPIO_SIG9_IN_SEL_V 0x1 -#define GPIO_SIG9_IN_SEL_S 7 -/* GPIO_FUNC9_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC9_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC9_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC9_IN_INV_SEL_V 0x1 -#define GPIO_FUNC9_IN_INV_SEL_S 6 -/* GPIO_FUNC9_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC9_IN_SEL 0x0000003F -#define GPIO_FUNC9_IN_SEL_M ((GPIO_FUNC9_IN_SEL_V)<<(GPIO_FUNC9_IN_SEL_S)) -#define GPIO_FUNC9_IN_SEL_V 0x3F -#define GPIO_FUNC9_IN_SEL_S 0 - -#define GPIO_FUNC10_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0158) -/* GPIO_SIG10_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG10_IN_SEL (BIT(7)) -#define GPIO_SIG10_IN_SEL_M (BIT(7)) -#define GPIO_SIG10_IN_SEL_V 0x1 -#define GPIO_SIG10_IN_SEL_S 7 -/* GPIO_FUNC10_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC10_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC10_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC10_IN_INV_SEL_V 0x1 -#define GPIO_FUNC10_IN_INV_SEL_S 6 -/* GPIO_FUNC10_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC10_IN_SEL 0x0000003F -#define GPIO_FUNC10_IN_SEL_M ((GPIO_FUNC10_IN_SEL_V)<<(GPIO_FUNC10_IN_SEL_S)) -#define GPIO_FUNC10_IN_SEL_V 0x3F -#define GPIO_FUNC10_IN_SEL_S 0 - -#define GPIO_FUNC11_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x015c) -/* GPIO_SIG11_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG11_IN_SEL (BIT(7)) -#define GPIO_SIG11_IN_SEL_M (BIT(7)) -#define GPIO_SIG11_IN_SEL_V 0x1 -#define GPIO_SIG11_IN_SEL_S 7 -/* GPIO_FUNC11_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC11_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC11_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC11_IN_INV_SEL_V 0x1 -#define GPIO_FUNC11_IN_INV_SEL_S 6 -/* GPIO_FUNC11_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC11_IN_SEL 0x0000003F -#define GPIO_FUNC11_IN_SEL_M ((GPIO_FUNC11_IN_SEL_V)<<(GPIO_FUNC11_IN_SEL_S)) -#define GPIO_FUNC11_IN_SEL_V 0x3F -#define GPIO_FUNC11_IN_SEL_S 0 - -#define GPIO_FUNC12_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0160) -/* GPIO_SIG12_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG12_IN_SEL (BIT(7)) -#define GPIO_SIG12_IN_SEL_M (BIT(7)) -#define GPIO_SIG12_IN_SEL_V 0x1 -#define GPIO_SIG12_IN_SEL_S 7 -/* GPIO_FUNC12_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC12_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC12_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC12_IN_INV_SEL_V 0x1 -#define GPIO_FUNC12_IN_INV_SEL_S 6 -/* GPIO_FUNC12_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC12_IN_SEL 0x0000003F -#define GPIO_FUNC12_IN_SEL_M ((GPIO_FUNC12_IN_SEL_V)<<(GPIO_FUNC12_IN_SEL_S)) -#define GPIO_FUNC12_IN_SEL_V 0x3F -#define GPIO_FUNC12_IN_SEL_S 0 - -#define GPIO_FUNC13_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0164) -/* GPIO_SIG13_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG13_IN_SEL (BIT(7)) -#define GPIO_SIG13_IN_SEL_M (BIT(7)) -#define GPIO_SIG13_IN_SEL_V 0x1 -#define GPIO_SIG13_IN_SEL_S 7 -/* GPIO_FUNC13_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC13_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC13_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC13_IN_INV_SEL_V 0x1 -#define GPIO_FUNC13_IN_INV_SEL_S 6 -/* GPIO_FUNC13_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC13_IN_SEL 0x0000003F -#define GPIO_FUNC13_IN_SEL_M ((GPIO_FUNC13_IN_SEL_V)<<(GPIO_FUNC13_IN_SEL_S)) -#define GPIO_FUNC13_IN_SEL_V 0x3F -#define GPIO_FUNC13_IN_SEL_S 0 - -#define GPIO_FUNC14_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0168) -/* GPIO_SIG14_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG14_IN_SEL (BIT(7)) -#define GPIO_SIG14_IN_SEL_M (BIT(7)) -#define GPIO_SIG14_IN_SEL_V 0x1 -#define GPIO_SIG14_IN_SEL_S 7 -/* GPIO_FUNC14_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC14_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC14_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC14_IN_INV_SEL_V 0x1 -#define GPIO_FUNC14_IN_INV_SEL_S 6 -/* GPIO_FUNC14_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC14_IN_SEL 0x0000003F -#define GPIO_FUNC14_IN_SEL_M ((GPIO_FUNC14_IN_SEL_V)<<(GPIO_FUNC14_IN_SEL_S)) -#define GPIO_FUNC14_IN_SEL_V 0x3F -#define GPIO_FUNC14_IN_SEL_S 0 - -#define GPIO_FUNC15_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x016c) -/* GPIO_SIG15_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG15_IN_SEL (BIT(7)) -#define GPIO_SIG15_IN_SEL_M (BIT(7)) -#define GPIO_SIG15_IN_SEL_V 0x1 -#define GPIO_SIG15_IN_SEL_S 7 -/* GPIO_FUNC15_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC15_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC15_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC15_IN_INV_SEL_V 0x1 -#define GPIO_FUNC15_IN_INV_SEL_S 6 -/* GPIO_FUNC15_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC15_IN_SEL 0x0000003F -#define GPIO_FUNC15_IN_SEL_M ((GPIO_FUNC15_IN_SEL_V)<<(GPIO_FUNC15_IN_SEL_S)) -#define GPIO_FUNC15_IN_SEL_V 0x3F -#define GPIO_FUNC15_IN_SEL_S 0 - -#define GPIO_FUNC16_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0170) -/* GPIO_SIG16_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG16_IN_SEL (BIT(7)) -#define GPIO_SIG16_IN_SEL_M (BIT(7)) -#define GPIO_SIG16_IN_SEL_V 0x1 -#define GPIO_SIG16_IN_SEL_S 7 -/* GPIO_FUNC16_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC16_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC16_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC16_IN_INV_SEL_V 0x1 -#define GPIO_FUNC16_IN_INV_SEL_S 6 -/* GPIO_FUNC16_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC16_IN_SEL 0x0000003F -#define GPIO_FUNC16_IN_SEL_M ((GPIO_FUNC16_IN_SEL_V)<<(GPIO_FUNC16_IN_SEL_S)) -#define GPIO_FUNC16_IN_SEL_V 0x3F -#define GPIO_FUNC16_IN_SEL_S 0 - -#define GPIO_FUNC17_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0174) -/* GPIO_SIG17_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG17_IN_SEL (BIT(7)) -#define GPIO_SIG17_IN_SEL_M (BIT(7)) -#define GPIO_SIG17_IN_SEL_V 0x1 -#define GPIO_SIG17_IN_SEL_S 7 -/* GPIO_FUNC17_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC17_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC17_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC17_IN_INV_SEL_V 0x1 -#define GPIO_FUNC17_IN_INV_SEL_S 6 -/* GPIO_FUNC17_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC17_IN_SEL 0x0000003F -#define GPIO_FUNC17_IN_SEL_M ((GPIO_FUNC17_IN_SEL_V)<<(GPIO_FUNC17_IN_SEL_S)) -#define GPIO_FUNC17_IN_SEL_V 0x3F -#define GPIO_FUNC17_IN_SEL_S 0 - -#define GPIO_FUNC18_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0178) -/* GPIO_SIG18_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG18_IN_SEL (BIT(7)) -#define GPIO_SIG18_IN_SEL_M (BIT(7)) -#define GPIO_SIG18_IN_SEL_V 0x1 -#define GPIO_SIG18_IN_SEL_S 7 -/* GPIO_FUNC18_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC18_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC18_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC18_IN_INV_SEL_V 0x1 -#define GPIO_FUNC18_IN_INV_SEL_S 6 -/* GPIO_FUNC18_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC18_IN_SEL 0x0000003F -#define GPIO_FUNC18_IN_SEL_M ((GPIO_FUNC18_IN_SEL_V)<<(GPIO_FUNC18_IN_SEL_S)) -#define GPIO_FUNC18_IN_SEL_V 0x3F -#define GPIO_FUNC18_IN_SEL_S 0 - -#define GPIO_FUNC19_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x017c) -/* GPIO_SIG19_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG19_IN_SEL (BIT(7)) -#define GPIO_SIG19_IN_SEL_M (BIT(7)) -#define GPIO_SIG19_IN_SEL_V 0x1 -#define GPIO_SIG19_IN_SEL_S 7 -/* GPIO_FUNC19_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC19_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC19_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC19_IN_INV_SEL_V 0x1 -#define GPIO_FUNC19_IN_INV_SEL_S 6 -/* GPIO_FUNC19_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC19_IN_SEL 0x0000003F -#define GPIO_FUNC19_IN_SEL_M ((GPIO_FUNC19_IN_SEL_V)<<(GPIO_FUNC19_IN_SEL_S)) -#define GPIO_FUNC19_IN_SEL_V 0x3F -#define GPIO_FUNC19_IN_SEL_S 0 - -#define GPIO_FUNC20_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0180) -/* GPIO_SIG20_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG20_IN_SEL (BIT(7)) -#define GPIO_SIG20_IN_SEL_M (BIT(7)) -#define GPIO_SIG20_IN_SEL_V 0x1 -#define GPIO_SIG20_IN_SEL_S 7 -/* GPIO_FUNC20_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC20_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC20_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC20_IN_INV_SEL_V 0x1 -#define GPIO_FUNC20_IN_INV_SEL_S 6 -/* GPIO_FUNC20_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC20_IN_SEL 0x0000003F -#define GPIO_FUNC20_IN_SEL_M ((GPIO_FUNC20_IN_SEL_V)<<(GPIO_FUNC20_IN_SEL_S)) -#define GPIO_FUNC20_IN_SEL_V 0x3F -#define GPIO_FUNC20_IN_SEL_S 0 - -#define GPIO_FUNC21_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0184) -/* GPIO_SIG21_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG21_IN_SEL (BIT(7)) -#define GPIO_SIG21_IN_SEL_M (BIT(7)) -#define GPIO_SIG21_IN_SEL_V 0x1 -#define GPIO_SIG21_IN_SEL_S 7 -/* GPIO_FUNC21_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC21_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC21_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC21_IN_INV_SEL_V 0x1 -#define GPIO_FUNC21_IN_INV_SEL_S 6 -/* GPIO_FUNC21_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC21_IN_SEL 0x0000003F -#define GPIO_FUNC21_IN_SEL_M ((GPIO_FUNC21_IN_SEL_V)<<(GPIO_FUNC21_IN_SEL_S)) -#define GPIO_FUNC21_IN_SEL_V 0x3F -#define GPIO_FUNC21_IN_SEL_S 0 - -#define GPIO_FUNC22_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0188) -/* GPIO_SIG22_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG22_IN_SEL (BIT(7)) -#define GPIO_SIG22_IN_SEL_M (BIT(7)) -#define GPIO_SIG22_IN_SEL_V 0x1 -#define GPIO_SIG22_IN_SEL_S 7 -/* GPIO_FUNC22_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC22_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC22_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC22_IN_INV_SEL_V 0x1 -#define GPIO_FUNC22_IN_INV_SEL_S 6 -/* GPIO_FUNC22_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC22_IN_SEL 0x0000003F -#define GPIO_FUNC22_IN_SEL_M ((GPIO_FUNC22_IN_SEL_V)<<(GPIO_FUNC22_IN_SEL_S)) -#define GPIO_FUNC22_IN_SEL_V 0x3F -#define GPIO_FUNC22_IN_SEL_S 0 - -#define GPIO_FUNC23_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x018c) -/* GPIO_SIG23_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG23_IN_SEL (BIT(7)) -#define GPIO_SIG23_IN_SEL_M (BIT(7)) -#define GPIO_SIG23_IN_SEL_V 0x1 -#define GPIO_SIG23_IN_SEL_S 7 -/* GPIO_FUNC23_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC23_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC23_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC23_IN_INV_SEL_V 0x1 -#define GPIO_FUNC23_IN_INV_SEL_S 6 -/* GPIO_FUNC23_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC23_IN_SEL 0x0000003F -#define GPIO_FUNC23_IN_SEL_M ((GPIO_FUNC23_IN_SEL_V)<<(GPIO_FUNC23_IN_SEL_S)) -#define GPIO_FUNC23_IN_SEL_V 0x3F -#define GPIO_FUNC23_IN_SEL_S 0 - -#define GPIO_FUNC24_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0190) -/* GPIO_SIG24_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG24_IN_SEL (BIT(7)) -#define GPIO_SIG24_IN_SEL_M (BIT(7)) -#define GPIO_SIG24_IN_SEL_V 0x1 -#define GPIO_SIG24_IN_SEL_S 7 -/* GPIO_FUNC24_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC24_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC24_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC24_IN_INV_SEL_V 0x1 -#define GPIO_FUNC24_IN_INV_SEL_S 6 -/* GPIO_FUNC24_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC24_IN_SEL 0x0000003F -#define GPIO_FUNC24_IN_SEL_M ((GPIO_FUNC24_IN_SEL_V)<<(GPIO_FUNC24_IN_SEL_S)) -#define GPIO_FUNC24_IN_SEL_V 0x3F -#define GPIO_FUNC24_IN_SEL_S 0 - -#define GPIO_FUNC25_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0194) -/* GPIO_SIG25_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG25_IN_SEL (BIT(7)) -#define GPIO_SIG25_IN_SEL_M (BIT(7)) -#define GPIO_SIG25_IN_SEL_V 0x1 -#define GPIO_SIG25_IN_SEL_S 7 -/* GPIO_FUNC25_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC25_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC25_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC25_IN_INV_SEL_V 0x1 -#define GPIO_FUNC25_IN_INV_SEL_S 6 -/* GPIO_FUNC25_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC25_IN_SEL 0x0000003F -#define GPIO_FUNC25_IN_SEL_M ((GPIO_FUNC25_IN_SEL_V)<<(GPIO_FUNC25_IN_SEL_S)) -#define GPIO_FUNC25_IN_SEL_V 0x3F -#define GPIO_FUNC25_IN_SEL_S 0 - -#define GPIO_FUNC26_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0198) -/* GPIO_SIG26_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG26_IN_SEL (BIT(7)) -#define GPIO_SIG26_IN_SEL_M (BIT(7)) -#define GPIO_SIG26_IN_SEL_V 0x1 -#define GPIO_SIG26_IN_SEL_S 7 -/* GPIO_FUNC26_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC26_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC26_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC26_IN_INV_SEL_V 0x1 -#define GPIO_FUNC26_IN_INV_SEL_S 6 -/* GPIO_FUNC26_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC26_IN_SEL 0x0000003F -#define GPIO_FUNC26_IN_SEL_M ((GPIO_FUNC26_IN_SEL_V)<<(GPIO_FUNC26_IN_SEL_S)) -#define GPIO_FUNC26_IN_SEL_V 0x3F -#define GPIO_FUNC26_IN_SEL_S 0 - -#define GPIO_FUNC27_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x019c) -/* GPIO_SIG27_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG27_IN_SEL (BIT(7)) -#define GPIO_SIG27_IN_SEL_M (BIT(7)) -#define GPIO_SIG27_IN_SEL_V 0x1 -#define GPIO_SIG27_IN_SEL_S 7 -/* GPIO_FUNC27_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC27_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC27_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC27_IN_INV_SEL_V 0x1 -#define GPIO_FUNC27_IN_INV_SEL_S 6 -/* GPIO_FUNC27_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC27_IN_SEL 0x0000003F -#define GPIO_FUNC27_IN_SEL_M ((GPIO_FUNC27_IN_SEL_V)<<(GPIO_FUNC27_IN_SEL_S)) -#define GPIO_FUNC27_IN_SEL_V 0x3F -#define GPIO_FUNC27_IN_SEL_S 0 - -#define GPIO_FUNC28_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x01a0) -/* GPIO_SIG28_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG28_IN_SEL (BIT(7)) -#define GPIO_SIG28_IN_SEL_M (BIT(7)) -#define GPIO_SIG28_IN_SEL_V 0x1 -#define GPIO_SIG28_IN_SEL_S 7 -/* GPIO_FUNC28_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC28_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC28_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC28_IN_INV_SEL_V 0x1 -#define GPIO_FUNC28_IN_INV_SEL_S 6 -/* GPIO_FUNC28_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC28_IN_SEL 0x0000003F -#define GPIO_FUNC28_IN_SEL_M ((GPIO_FUNC28_IN_SEL_V)<<(GPIO_FUNC28_IN_SEL_S)) -#define GPIO_FUNC28_IN_SEL_V 0x3F -#define GPIO_FUNC28_IN_SEL_S 0 - -#define GPIO_FUNC29_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x01a4) -/* GPIO_SIG29_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG29_IN_SEL (BIT(7)) -#define GPIO_SIG29_IN_SEL_M (BIT(7)) -#define GPIO_SIG29_IN_SEL_V 0x1 -#define GPIO_SIG29_IN_SEL_S 7 -/* GPIO_FUNC29_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC29_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC29_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC29_IN_INV_SEL_V 0x1 -#define GPIO_FUNC29_IN_INV_SEL_S 6 -/* GPIO_FUNC29_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC29_IN_SEL 0x0000003F -#define GPIO_FUNC29_IN_SEL_M ((GPIO_FUNC29_IN_SEL_V)<<(GPIO_FUNC29_IN_SEL_S)) -#define GPIO_FUNC29_IN_SEL_V 0x3F -#define GPIO_FUNC29_IN_SEL_S 0 - -#define GPIO_FUNC30_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x01a8) -/* GPIO_SIG30_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG30_IN_SEL (BIT(7)) -#define GPIO_SIG30_IN_SEL_M (BIT(7)) -#define GPIO_SIG30_IN_SEL_V 0x1 -#define GPIO_SIG30_IN_SEL_S 7 -/* GPIO_FUNC30_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC30_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC30_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC30_IN_INV_SEL_V 0x1 -#define GPIO_FUNC30_IN_INV_SEL_S 6 -/* GPIO_FUNC30_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC30_IN_SEL 0x0000003F -#define GPIO_FUNC30_IN_SEL_M ((GPIO_FUNC30_IN_SEL_V)<<(GPIO_FUNC30_IN_SEL_S)) -#define GPIO_FUNC30_IN_SEL_V 0x3F -#define GPIO_FUNC30_IN_SEL_S 0 - -#define GPIO_FUNC31_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x01ac) -/* GPIO_SIG31_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG31_IN_SEL (BIT(7)) -#define GPIO_SIG31_IN_SEL_M (BIT(7)) -#define GPIO_SIG31_IN_SEL_V 0x1 -#define GPIO_SIG31_IN_SEL_S 7 -/* GPIO_FUNC31_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC31_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC31_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC31_IN_INV_SEL_V 0x1 -#define GPIO_FUNC31_IN_INV_SEL_S 6 -/* GPIO_FUNC31_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC31_IN_SEL 0x0000003F -#define GPIO_FUNC31_IN_SEL_M ((GPIO_FUNC31_IN_SEL_V)<<(GPIO_FUNC31_IN_SEL_S)) -#define GPIO_FUNC31_IN_SEL_V 0x3F -#define GPIO_FUNC31_IN_SEL_S 0 - -#define GPIO_FUNC32_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x01b0) -/* GPIO_SIG32_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG32_IN_SEL (BIT(7)) -#define GPIO_SIG32_IN_SEL_M (BIT(7)) -#define GPIO_SIG32_IN_SEL_V 0x1 -#define GPIO_SIG32_IN_SEL_S 7 -/* GPIO_FUNC32_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC32_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC32_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC32_IN_INV_SEL_V 0x1 -#define GPIO_FUNC32_IN_INV_SEL_S 6 -/* GPIO_FUNC32_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC32_IN_SEL 0x0000003F -#define GPIO_FUNC32_IN_SEL_M ((GPIO_FUNC32_IN_SEL_V)<<(GPIO_FUNC32_IN_SEL_S)) -#define GPIO_FUNC32_IN_SEL_V 0x3F -#define GPIO_FUNC32_IN_SEL_S 0 - -#define GPIO_FUNC33_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x01b4) -/* GPIO_SIG33_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG33_IN_SEL (BIT(7)) -#define GPIO_SIG33_IN_SEL_M (BIT(7)) -#define GPIO_SIG33_IN_SEL_V 0x1 -#define GPIO_SIG33_IN_SEL_S 7 -/* GPIO_FUNC33_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC33_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC33_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC33_IN_INV_SEL_V 0x1 -#define GPIO_FUNC33_IN_INV_SEL_S 6 -/* GPIO_FUNC33_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC33_IN_SEL 0x0000003F -#define GPIO_FUNC33_IN_SEL_M ((GPIO_FUNC33_IN_SEL_V)<<(GPIO_FUNC33_IN_SEL_S)) -#define GPIO_FUNC33_IN_SEL_V 0x3F -#define GPIO_FUNC33_IN_SEL_S 0 - -#define GPIO_FUNC34_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x01b8) -/* GPIO_SIG34_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG34_IN_SEL (BIT(7)) -#define GPIO_SIG34_IN_SEL_M (BIT(7)) -#define GPIO_SIG34_IN_SEL_V 0x1 -#define GPIO_SIG34_IN_SEL_S 7 -/* GPIO_FUNC34_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC34_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC34_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC34_IN_INV_SEL_V 0x1 -#define GPIO_FUNC34_IN_INV_SEL_S 6 -/* GPIO_FUNC34_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC34_IN_SEL 0x0000003F -#define GPIO_FUNC34_IN_SEL_M ((GPIO_FUNC34_IN_SEL_V)<<(GPIO_FUNC34_IN_SEL_S)) -#define GPIO_FUNC34_IN_SEL_V 0x3F -#define GPIO_FUNC34_IN_SEL_S 0 - -#define GPIO_FUNC35_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x01bc) -/* GPIO_SIG35_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG35_IN_SEL (BIT(7)) -#define GPIO_SIG35_IN_SEL_M (BIT(7)) -#define GPIO_SIG35_IN_SEL_V 0x1 -#define GPIO_SIG35_IN_SEL_S 7 -/* GPIO_FUNC35_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC35_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC35_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC35_IN_INV_SEL_V 0x1 -#define GPIO_FUNC35_IN_INV_SEL_S 6 -/* GPIO_FUNC35_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC35_IN_SEL 0x0000003F -#define GPIO_FUNC35_IN_SEL_M ((GPIO_FUNC35_IN_SEL_V)<<(GPIO_FUNC35_IN_SEL_S)) -#define GPIO_FUNC35_IN_SEL_V 0x3F -#define GPIO_FUNC35_IN_SEL_S 0 - -#define GPIO_FUNC36_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x01c0) -/* GPIO_SIG36_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG36_IN_SEL (BIT(7)) -#define GPIO_SIG36_IN_SEL_M (BIT(7)) -#define GPIO_SIG36_IN_SEL_V 0x1 -#define GPIO_SIG36_IN_SEL_S 7 -/* GPIO_FUNC36_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC36_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC36_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC36_IN_INV_SEL_V 0x1 -#define GPIO_FUNC36_IN_INV_SEL_S 6 -/* GPIO_FUNC36_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC36_IN_SEL 0x0000003F -#define GPIO_FUNC36_IN_SEL_M ((GPIO_FUNC36_IN_SEL_V)<<(GPIO_FUNC36_IN_SEL_S)) -#define GPIO_FUNC36_IN_SEL_V 0x3F -#define GPIO_FUNC36_IN_SEL_S 0 - -#define GPIO_FUNC37_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x01c4) -/* GPIO_SIG37_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG37_IN_SEL (BIT(7)) -#define GPIO_SIG37_IN_SEL_M (BIT(7)) -#define GPIO_SIG37_IN_SEL_V 0x1 -#define GPIO_SIG37_IN_SEL_S 7 -/* GPIO_FUNC37_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC37_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC37_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC37_IN_INV_SEL_V 0x1 -#define GPIO_FUNC37_IN_INV_SEL_S 6 -/* GPIO_FUNC37_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC37_IN_SEL 0x0000003F -#define GPIO_FUNC37_IN_SEL_M ((GPIO_FUNC37_IN_SEL_V)<<(GPIO_FUNC37_IN_SEL_S)) -#define GPIO_FUNC37_IN_SEL_V 0x3F -#define GPIO_FUNC37_IN_SEL_S 0 - -#define GPIO_FUNC38_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x01c8) -/* GPIO_SIG38_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG38_IN_SEL (BIT(7)) -#define GPIO_SIG38_IN_SEL_M (BIT(7)) -#define GPIO_SIG38_IN_SEL_V 0x1 -#define GPIO_SIG38_IN_SEL_S 7 -/* GPIO_FUNC38_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC38_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC38_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC38_IN_INV_SEL_V 0x1 -#define GPIO_FUNC38_IN_INV_SEL_S 6 -/* GPIO_FUNC38_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC38_IN_SEL 0x0000003F -#define GPIO_FUNC38_IN_SEL_M ((GPIO_FUNC38_IN_SEL_V)<<(GPIO_FUNC38_IN_SEL_S)) -#define GPIO_FUNC38_IN_SEL_V 0x3F -#define GPIO_FUNC38_IN_SEL_S 0 - -#define GPIO_FUNC39_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x01cc) -/* GPIO_SIG39_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG39_IN_SEL (BIT(7)) -#define GPIO_SIG39_IN_SEL_M (BIT(7)) -#define GPIO_SIG39_IN_SEL_V 0x1 -#define GPIO_SIG39_IN_SEL_S 7 -/* GPIO_FUNC39_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC39_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC39_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC39_IN_INV_SEL_V 0x1 -#define GPIO_FUNC39_IN_INV_SEL_S 6 -/* GPIO_FUNC39_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC39_IN_SEL 0x0000003F -#define GPIO_FUNC39_IN_SEL_M ((GPIO_FUNC39_IN_SEL_V)<<(GPIO_FUNC39_IN_SEL_S)) -#define GPIO_FUNC39_IN_SEL_V 0x3F -#define GPIO_FUNC39_IN_SEL_S 0 - -#define GPIO_FUNC40_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x01d0) -/* GPIO_SIG40_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG40_IN_SEL (BIT(7)) -#define GPIO_SIG40_IN_SEL_M (BIT(7)) -#define GPIO_SIG40_IN_SEL_V 0x1 -#define GPIO_SIG40_IN_SEL_S 7 -/* GPIO_FUNC40_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC40_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC40_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC40_IN_INV_SEL_V 0x1 -#define GPIO_FUNC40_IN_INV_SEL_S 6 -/* GPIO_FUNC40_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC40_IN_SEL 0x0000003F -#define GPIO_FUNC40_IN_SEL_M ((GPIO_FUNC40_IN_SEL_V)<<(GPIO_FUNC40_IN_SEL_S)) -#define GPIO_FUNC40_IN_SEL_V 0x3F -#define GPIO_FUNC40_IN_SEL_S 0 - -#define GPIO_FUNC41_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x01d4) -/* GPIO_SIG41_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG41_IN_SEL (BIT(7)) -#define GPIO_SIG41_IN_SEL_M (BIT(7)) -#define GPIO_SIG41_IN_SEL_V 0x1 -#define GPIO_SIG41_IN_SEL_S 7 -/* GPIO_FUNC41_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC41_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC41_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC41_IN_INV_SEL_V 0x1 -#define GPIO_FUNC41_IN_INV_SEL_S 6 -/* GPIO_FUNC41_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC41_IN_SEL 0x0000003F -#define GPIO_FUNC41_IN_SEL_M ((GPIO_FUNC41_IN_SEL_V)<<(GPIO_FUNC41_IN_SEL_S)) -#define GPIO_FUNC41_IN_SEL_V 0x3F -#define GPIO_FUNC41_IN_SEL_S 0 - -#define GPIO_FUNC42_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x01d8) -/* GPIO_SIG42_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG42_IN_SEL (BIT(7)) -#define GPIO_SIG42_IN_SEL_M (BIT(7)) -#define GPIO_SIG42_IN_SEL_V 0x1 -#define GPIO_SIG42_IN_SEL_S 7 -/* GPIO_FUNC42_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC42_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC42_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC42_IN_INV_SEL_V 0x1 -#define GPIO_FUNC42_IN_INV_SEL_S 6 -/* GPIO_FUNC42_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC42_IN_SEL 0x0000003F -#define GPIO_FUNC42_IN_SEL_M ((GPIO_FUNC42_IN_SEL_V)<<(GPIO_FUNC42_IN_SEL_S)) -#define GPIO_FUNC42_IN_SEL_V 0x3F -#define GPIO_FUNC42_IN_SEL_S 0 - -#define GPIO_FUNC43_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x01dc) -/* GPIO_SIG43_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG43_IN_SEL (BIT(7)) -#define GPIO_SIG43_IN_SEL_M (BIT(7)) -#define GPIO_SIG43_IN_SEL_V 0x1 -#define GPIO_SIG43_IN_SEL_S 7 -/* GPIO_FUNC43_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC43_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC43_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC43_IN_INV_SEL_V 0x1 -#define GPIO_FUNC43_IN_INV_SEL_S 6 -/* GPIO_FUNC43_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC43_IN_SEL 0x0000003F -#define GPIO_FUNC43_IN_SEL_M ((GPIO_FUNC43_IN_SEL_V)<<(GPIO_FUNC43_IN_SEL_S)) -#define GPIO_FUNC43_IN_SEL_V 0x3F -#define GPIO_FUNC43_IN_SEL_S 0 - -#define GPIO_FUNC44_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x01e0) -/* GPIO_SIG44_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG44_IN_SEL (BIT(7)) -#define GPIO_SIG44_IN_SEL_M (BIT(7)) -#define GPIO_SIG44_IN_SEL_V 0x1 -#define GPIO_SIG44_IN_SEL_S 7 -/* GPIO_FUNC44_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC44_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC44_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC44_IN_INV_SEL_V 0x1 -#define GPIO_FUNC44_IN_INV_SEL_S 6 -/* GPIO_FUNC44_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC44_IN_SEL 0x0000003F -#define GPIO_FUNC44_IN_SEL_M ((GPIO_FUNC44_IN_SEL_V)<<(GPIO_FUNC44_IN_SEL_S)) -#define GPIO_FUNC44_IN_SEL_V 0x3F -#define GPIO_FUNC44_IN_SEL_S 0 - -#define GPIO_FUNC45_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x01e4) -/* GPIO_SIG45_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG45_IN_SEL (BIT(7)) -#define GPIO_SIG45_IN_SEL_M (BIT(7)) -#define GPIO_SIG45_IN_SEL_V 0x1 -#define GPIO_SIG45_IN_SEL_S 7 -/* GPIO_FUNC45_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC45_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC45_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC45_IN_INV_SEL_V 0x1 -#define GPIO_FUNC45_IN_INV_SEL_S 6 -/* GPIO_FUNC45_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC45_IN_SEL 0x0000003F -#define GPIO_FUNC45_IN_SEL_M ((GPIO_FUNC45_IN_SEL_V)<<(GPIO_FUNC45_IN_SEL_S)) -#define GPIO_FUNC45_IN_SEL_V 0x3F -#define GPIO_FUNC45_IN_SEL_S 0 - -#define GPIO_FUNC46_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x01e8) -/* GPIO_SIG46_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG46_IN_SEL (BIT(7)) -#define GPIO_SIG46_IN_SEL_M (BIT(7)) -#define GPIO_SIG46_IN_SEL_V 0x1 -#define GPIO_SIG46_IN_SEL_S 7 -/* GPIO_FUNC46_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC46_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC46_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC46_IN_INV_SEL_V 0x1 -#define GPIO_FUNC46_IN_INV_SEL_S 6 -/* GPIO_FUNC46_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC46_IN_SEL 0x0000003F -#define GPIO_FUNC46_IN_SEL_M ((GPIO_FUNC46_IN_SEL_V)<<(GPIO_FUNC46_IN_SEL_S)) -#define GPIO_FUNC46_IN_SEL_V 0x3F -#define GPIO_FUNC46_IN_SEL_S 0 - -#define GPIO_FUNC47_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x01ec) -/* GPIO_SIG47_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG47_IN_SEL (BIT(7)) -#define GPIO_SIG47_IN_SEL_M (BIT(7)) -#define GPIO_SIG47_IN_SEL_V 0x1 -#define GPIO_SIG47_IN_SEL_S 7 -/* GPIO_FUNC47_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC47_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC47_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC47_IN_INV_SEL_V 0x1 -#define GPIO_FUNC47_IN_INV_SEL_S 6 -/* GPIO_FUNC47_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC47_IN_SEL 0x0000003F -#define GPIO_FUNC47_IN_SEL_M ((GPIO_FUNC47_IN_SEL_V)<<(GPIO_FUNC47_IN_SEL_S)) -#define GPIO_FUNC47_IN_SEL_V 0x3F -#define GPIO_FUNC47_IN_SEL_S 0 - -#define GPIO_FUNC48_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x01f0) -/* GPIO_SIG48_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG48_IN_SEL (BIT(7)) -#define GPIO_SIG48_IN_SEL_M (BIT(7)) -#define GPIO_SIG48_IN_SEL_V 0x1 -#define GPIO_SIG48_IN_SEL_S 7 -/* GPIO_FUNC48_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC48_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC48_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC48_IN_INV_SEL_V 0x1 -#define GPIO_FUNC48_IN_INV_SEL_S 6 -/* GPIO_FUNC48_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC48_IN_SEL 0x0000003F -#define GPIO_FUNC48_IN_SEL_M ((GPIO_FUNC48_IN_SEL_V)<<(GPIO_FUNC48_IN_SEL_S)) -#define GPIO_FUNC48_IN_SEL_V 0x3F -#define GPIO_FUNC48_IN_SEL_S 0 - -#define GPIO_FUNC49_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x01f4) -/* GPIO_SIG49_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG49_IN_SEL (BIT(7)) -#define GPIO_SIG49_IN_SEL_M (BIT(7)) -#define GPIO_SIG49_IN_SEL_V 0x1 -#define GPIO_SIG49_IN_SEL_S 7 -/* GPIO_FUNC49_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC49_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC49_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC49_IN_INV_SEL_V 0x1 -#define GPIO_FUNC49_IN_INV_SEL_S 6 -/* GPIO_FUNC49_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC49_IN_SEL 0x0000003F -#define GPIO_FUNC49_IN_SEL_M ((GPIO_FUNC49_IN_SEL_V)<<(GPIO_FUNC49_IN_SEL_S)) -#define GPIO_FUNC49_IN_SEL_V 0x3F -#define GPIO_FUNC49_IN_SEL_S 0 - -#define GPIO_FUNC50_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x01f8) -/* GPIO_SIG50_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG50_IN_SEL (BIT(7)) -#define GPIO_SIG50_IN_SEL_M (BIT(7)) -#define GPIO_SIG50_IN_SEL_V 0x1 -#define GPIO_SIG50_IN_SEL_S 7 -/* GPIO_FUNC50_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC50_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC50_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC50_IN_INV_SEL_V 0x1 -#define GPIO_FUNC50_IN_INV_SEL_S 6 -/* GPIO_FUNC50_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC50_IN_SEL 0x0000003F -#define GPIO_FUNC50_IN_SEL_M ((GPIO_FUNC50_IN_SEL_V)<<(GPIO_FUNC50_IN_SEL_S)) -#define GPIO_FUNC50_IN_SEL_V 0x3F -#define GPIO_FUNC50_IN_SEL_S 0 - -#define GPIO_FUNC51_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x01fc) -/* GPIO_SIG51_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG51_IN_SEL (BIT(7)) -#define GPIO_SIG51_IN_SEL_M (BIT(7)) -#define GPIO_SIG51_IN_SEL_V 0x1 -#define GPIO_SIG51_IN_SEL_S 7 -/* GPIO_FUNC51_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC51_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC51_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC51_IN_INV_SEL_V 0x1 -#define GPIO_FUNC51_IN_INV_SEL_S 6 -/* GPIO_FUNC51_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC51_IN_SEL 0x0000003F -#define GPIO_FUNC51_IN_SEL_M ((GPIO_FUNC51_IN_SEL_V)<<(GPIO_FUNC51_IN_SEL_S)) -#define GPIO_FUNC51_IN_SEL_V 0x3F -#define GPIO_FUNC51_IN_SEL_S 0 - -#define GPIO_FUNC52_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0200) -/* GPIO_SIG52_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG52_IN_SEL (BIT(7)) -#define GPIO_SIG52_IN_SEL_M (BIT(7)) -#define GPIO_SIG52_IN_SEL_V 0x1 -#define GPIO_SIG52_IN_SEL_S 7 -/* GPIO_FUNC52_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC52_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC52_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC52_IN_INV_SEL_V 0x1 -#define GPIO_FUNC52_IN_INV_SEL_S 6 -/* GPIO_FUNC52_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC52_IN_SEL 0x0000003F -#define GPIO_FUNC52_IN_SEL_M ((GPIO_FUNC52_IN_SEL_V)<<(GPIO_FUNC52_IN_SEL_S)) -#define GPIO_FUNC52_IN_SEL_V 0x3F -#define GPIO_FUNC52_IN_SEL_S 0 - -#define GPIO_FUNC53_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0204) -/* GPIO_SIG53_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG53_IN_SEL (BIT(7)) -#define GPIO_SIG53_IN_SEL_M (BIT(7)) -#define GPIO_SIG53_IN_SEL_V 0x1 -#define GPIO_SIG53_IN_SEL_S 7 -/* GPIO_FUNC53_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC53_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC53_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC53_IN_INV_SEL_V 0x1 -#define GPIO_FUNC53_IN_INV_SEL_S 6 -/* GPIO_FUNC53_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC53_IN_SEL 0x0000003F -#define GPIO_FUNC53_IN_SEL_M ((GPIO_FUNC53_IN_SEL_V)<<(GPIO_FUNC53_IN_SEL_S)) -#define GPIO_FUNC53_IN_SEL_V 0x3F -#define GPIO_FUNC53_IN_SEL_S 0 - -#define GPIO_FUNC54_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0208) -/* GPIO_SIG54_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG54_IN_SEL (BIT(7)) -#define GPIO_SIG54_IN_SEL_M (BIT(7)) -#define GPIO_SIG54_IN_SEL_V 0x1 -#define GPIO_SIG54_IN_SEL_S 7 -/* GPIO_FUNC54_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC54_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC54_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC54_IN_INV_SEL_V 0x1 -#define GPIO_FUNC54_IN_INV_SEL_S 6 -/* GPIO_FUNC54_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC54_IN_SEL 0x0000003F -#define GPIO_FUNC54_IN_SEL_M ((GPIO_FUNC54_IN_SEL_V)<<(GPIO_FUNC54_IN_SEL_S)) -#define GPIO_FUNC54_IN_SEL_V 0x3F -#define GPIO_FUNC54_IN_SEL_S 0 - -#define GPIO_FUNC55_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x020c) -/* GPIO_SIG55_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG55_IN_SEL (BIT(7)) -#define GPIO_SIG55_IN_SEL_M (BIT(7)) -#define GPIO_SIG55_IN_SEL_V 0x1 -#define GPIO_SIG55_IN_SEL_S 7 -/* GPIO_FUNC55_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC55_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC55_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC55_IN_INV_SEL_V 0x1 -#define GPIO_FUNC55_IN_INV_SEL_S 6 -/* GPIO_FUNC55_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC55_IN_SEL 0x0000003F -#define GPIO_FUNC55_IN_SEL_M ((GPIO_FUNC55_IN_SEL_V)<<(GPIO_FUNC55_IN_SEL_S)) -#define GPIO_FUNC55_IN_SEL_V 0x3F -#define GPIO_FUNC55_IN_SEL_S 0 - -#define GPIO_FUNC56_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0210) -/* GPIO_SIG56_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG56_IN_SEL (BIT(7)) -#define GPIO_SIG56_IN_SEL_M (BIT(7)) -#define GPIO_SIG56_IN_SEL_V 0x1 -#define GPIO_SIG56_IN_SEL_S 7 -/* GPIO_FUNC56_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC56_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC56_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC56_IN_INV_SEL_V 0x1 -#define GPIO_FUNC56_IN_INV_SEL_S 6 -/* GPIO_FUNC56_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC56_IN_SEL 0x0000003F -#define GPIO_FUNC56_IN_SEL_M ((GPIO_FUNC56_IN_SEL_V)<<(GPIO_FUNC56_IN_SEL_S)) -#define GPIO_FUNC56_IN_SEL_V 0x3F -#define GPIO_FUNC56_IN_SEL_S 0 - -#define GPIO_FUNC57_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0214) -/* GPIO_SIG57_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG57_IN_SEL (BIT(7)) -#define GPIO_SIG57_IN_SEL_M (BIT(7)) -#define GPIO_SIG57_IN_SEL_V 0x1 -#define GPIO_SIG57_IN_SEL_S 7 -/* GPIO_FUNC57_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC57_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC57_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC57_IN_INV_SEL_V 0x1 -#define GPIO_FUNC57_IN_INV_SEL_S 6 -/* GPIO_FUNC57_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC57_IN_SEL 0x0000003F -#define GPIO_FUNC57_IN_SEL_M ((GPIO_FUNC57_IN_SEL_V)<<(GPIO_FUNC57_IN_SEL_S)) -#define GPIO_FUNC57_IN_SEL_V 0x3F -#define GPIO_FUNC57_IN_SEL_S 0 - -#define GPIO_FUNC58_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0218) -/* GPIO_SIG58_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG58_IN_SEL (BIT(7)) -#define GPIO_SIG58_IN_SEL_M (BIT(7)) -#define GPIO_SIG58_IN_SEL_V 0x1 -#define GPIO_SIG58_IN_SEL_S 7 -/* GPIO_FUNC58_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC58_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC58_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC58_IN_INV_SEL_V 0x1 -#define GPIO_FUNC58_IN_INV_SEL_S 6 -/* GPIO_FUNC58_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC58_IN_SEL 0x0000003F -#define GPIO_FUNC58_IN_SEL_M ((GPIO_FUNC58_IN_SEL_V)<<(GPIO_FUNC58_IN_SEL_S)) -#define GPIO_FUNC58_IN_SEL_V 0x3F -#define GPIO_FUNC58_IN_SEL_S 0 - -#define GPIO_FUNC59_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x021c) -/* GPIO_SIG59_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG59_IN_SEL (BIT(7)) -#define GPIO_SIG59_IN_SEL_M (BIT(7)) -#define GPIO_SIG59_IN_SEL_V 0x1 -#define GPIO_SIG59_IN_SEL_S 7 -/* GPIO_FUNC59_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC59_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC59_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC59_IN_INV_SEL_V 0x1 -#define GPIO_FUNC59_IN_INV_SEL_S 6 -/* GPIO_FUNC59_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC59_IN_SEL 0x0000003F -#define GPIO_FUNC59_IN_SEL_M ((GPIO_FUNC59_IN_SEL_V)<<(GPIO_FUNC59_IN_SEL_S)) -#define GPIO_FUNC59_IN_SEL_V 0x3F -#define GPIO_FUNC59_IN_SEL_S 0 - -#define GPIO_FUNC60_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0220) -/* GPIO_SIG60_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG60_IN_SEL (BIT(7)) -#define GPIO_SIG60_IN_SEL_M (BIT(7)) -#define GPIO_SIG60_IN_SEL_V 0x1 -#define GPIO_SIG60_IN_SEL_S 7 -/* GPIO_FUNC60_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC60_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC60_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC60_IN_INV_SEL_V 0x1 -#define GPIO_FUNC60_IN_INV_SEL_S 6 -/* GPIO_FUNC60_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC60_IN_SEL 0x0000003F -#define GPIO_FUNC60_IN_SEL_M ((GPIO_FUNC60_IN_SEL_V)<<(GPIO_FUNC60_IN_SEL_S)) -#define GPIO_FUNC60_IN_SEL_V 0x3F -#define GPIO_FUNC60_IN_SEL_S 0 - -#define GPIO_FUNC61_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0224) -/* GPIO_SIG61_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG61_IN_SEL (BIT(7)) -#define GPIO_SIG61_IN_SEL_M (BIT(7)) -#define GPIO_SIG61_IN_SEL_V 0x1 -#define GPIO_SIG61_IN_SEL_S 7 -/* GPIO_FUNC61_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC61_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC61_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC61_IN_INV_SEL_V 0x1 -#define GPIO_FUNC61_IN_INV_SEL_S 6 -/* GPIO_FUNC61_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC61_IN_SEL 0x0000003F -#define GPIO_FUNC61_IN_SEL_M ((GPIO_FUNC61_IN_SEL_V)<<(GPIO_FUNC61_IN_SEL_S)) -#define GPIO_FUNC61_IN_SEL_V 0x3F -#define GPIO_FUNC61_IN_SEL_S 0 - -#define GPIO_FUNC62_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0228) -/* GPIO_SIG62_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG62_IN_SEL (BIT(7)) -#define GPIO_SIG62_IN_SEL_M (BIT(7)) -#define GPIO_SIG62_IN_SEL_V 0x1 -#define GPIO_SIG62_IN_SEL_S 7 -/* GPIO_FUNC62_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC62_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC62_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC62_IN_INV_SEL_V 0x1 -#define GPIO_FUNC62_IN_INV_SEL_S 6 -/* GPIO_FUNC62_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC62_IN_SEL 0x0000003F -#define GPIO_FUNC62_IN_SEL_M ((GPIO_FUNC62_IN_SEL_V)<<(GPIO_FUNC62_IN_SEL_S)) -#define GPIO_FUNC62_IN_SEL_V 0x3F -#define GPIO_FUNC62_IN_SEL_S 0 - -#define GPIO_FUNC63_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x022c) -/* GPIO_SIG63_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG63_IN_SEL (BIT(7)) -#define GPIO_SIG63_IN_SEL_M (BIT(7)) -#define GPIO_SIG63_IN_SEL_V 0x1 -#define GPIO_SIG63_IN_SEL_S 7 -/* GPIO_FUNC63_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC63_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC63_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC63_IN_INV_SEL_V 0x1 -#define GPIO_FUNC63_IN_INV_SEL_S 6 -/* GPIO_FUNC63_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC63_IN_SEL 0x0000003F -#define GPIO_FUNC63_IN_SEL_M ((GPIO_FUNC63_IN_SEL_V)<<(GPIO_FUNC63_IN_SEL_S)) -#define GPIO_FUNC63_IN_SEL_V 0x3F -#define GPIO_FUNC63_IN_SEL_S 0 - -#define GPIO_FUNC64_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0230) -/* GPIO_SIG64_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG64_IN_SEL (BIT(7)) -#define GPIO_SIG64_IN_SEL_M (BIT(7)) -#define GPIO_SIG64_IN_SEL_V 0x1 -#define GPIO_SIG64_IN_SEL_S 7 -/* GPIO_FUNC64_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC64_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC64_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC64_IN_INV_SEL_V 0x1 -#define GPIO_FUNC64_IN_INV_SEL_S 6 -/* GPIO_FUNC64_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC64_IN_SEL 0x0000003F -#define GPIO_FUNC64_IN_SEL_M ((GPIO_FUNC64_IN_SEL_V)<<(GPIO_FUNC64_IN_SEL_S)) -#define GPIO_FUNC64_IN_SEL_V 0x3F -#define GPIO_FUNC64_IN_SEL_S 0 - -#define GPIO_FUNC65_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0234) -/* GPIO_SIG65_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG65_IN_SEL (BIT(7)) -#define GPIO_SIG65_IN_SEL_M (BIT(7)) -#define GPIO_SIG65_IN_SEL_V 0x1 -#define GPIO_SIG65_IN_SEL_S 7 -/* GPIO_FUNC65_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC65_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC65_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC65_IN_INV_SEL_V 0x1 -#define GPIO_FUNC65_IN_INV_SEL_S 6 -/* GPIO_FUNC65_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC65_IN_SEL 0x0000003F -#define GPIO_FUNC65_IN_SEL_M ((GPIO_FUNC65_IN_SEL_V)<<(GPIO_FUNC65_IN_SEL_S)) -#define GPIO_FUNC65_IN_SEL_V 0x3F -#define GPIO_FUNC65_IN_SEL_S 0 - -#define GPIO_FUNC66_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0238) -/* GPIO_SIG66_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG66_IN_SEL (BIT(7)) -#define GPIO_SIG66_IN_SEL_M (BIT(7)) -#define GPIO_SIG66_IN_SEL_V 0x1 -#define GPIO_SIG66_IN_SEL_S 7 -/* GPIO_FUNC66_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC66_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC66_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC66_IN_INV_SEL_V 0x1 -#define GPIO_FUNC66_IN_INV_SEL_S 6 -/* GPIO_FUNC66_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC66_IN_SEL 0x0000003F -#define GPIO_FUNC66_IN_SEL_M ((GPIO_FUNC66_IN_SEL_V)<<(GPIO_FUNC66_IN_SEL_S)) -#define GPIO_FUNC66_IN_SEL_V 0x3F -#define GPIO_FUNC66_IN_SEL_S 0 - -#define GPIO_FUNC67_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x023c) -/* GPIO_SIG67_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG67_IN_SEL (BIT(7)) -#define GPIO_SIG67_IN_SEL_M (BIT(7)) -#define GPIO_SIG67_IN_SEL_V 0x1 -#define GPIO_SIG67_IN_SEL_S 7 -/* GPIO_FUNC67_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC67_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC67_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC67_IN_INV_SEL_V 0x1 -#define GPIO_FUNC67_IN_INV_SEL_S 6 -/* GPIO_FUNC67_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC67_IN_SEL 0x0000003F -#define GPIO_FUNC67_IN_SEL_M ((GPIO_FUNC67_IN_SEL_V)<<(GPIO_FUNC67_IN_SEL_S)) -#define GPIO_FUNC67_IN_SEL_V 0x3F -#define GPIO_FUNC67_IN_SEL_S 0 - -#define GPIO_FUNC68_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0240) -/* GPIO_SIG68_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG68_IN_SEL (BIT(7)) -#define GPIO_SIG68_IN_SEL_M (BIT(7)) -#define GPIO_SIG68_IN_SEL_V 0x1 -#define GPIO_SIG68_IN_SEL_S 7 -/* GPIO_FUNC68_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC68_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC68_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC68_IN_INV_SEL_V 0x1 -#define GPIO_FUNC68_IN_INV_SEL_S 6 -/* GPIO_FUNC68_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC68_IN_SEL 0x0000003F -#define GPIO_FUNC68_IN_SEL_M ((GPIO_FUNC68_IN_SEL_V)<<(GPIO_FUNC68_IN_SEL_S)) -#define GPIO_FUNC68_IN_SEL_V 0x3F -#define GPIO_FUNC68_IN_SEL_S 0 - -#define GPIO_FUNC69_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0244) -/* GPIO_SIG69_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG69_IN_SEL (BIT(7)) -#define GPIO_SIG69_IN_SEL_M (BIT(7)) -#define GPIO_SIG69_IN_SEL_V 0x1 -#define GPIO_SIG69_IN_SEL_S 7 -/* GPIO_FUNC69_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC69_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC69_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC69_IN_INV_SEL_V 0x1 -#define GPIO_FUNC69_IN_INV_SEL_S 6 -/* GPIO_FUNC69_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC69_IN_SEL 0x0000003F -#define GPIO_FUNC69_IN_SEL_M ((GPIO_FUNC69_IN_SEL_V)<<(GPIO_FUNC69_IN_SEL_S)) -#define GPIO_FUNC69_IN_SEL_V 0x3F -#define GPIO_FUNC69_IN_SEL_S 0 - -#define GPIO_FUNC70_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0248) -/* GPIO_SIG70_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG70_IN_SEL (BIT(7)) -#define GPIO_SIG70_IN_SEL_M (BIT(7)) -#define GPIO_SIG70_IN_SEL_V 0x1 -#define GPIO_SIG70_IN_SEL_S 7 -/* GPIO_FUNC70_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC70_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC70_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC70_IN_INV_SEL_V 0x1 -#define GPIO_FUNC70_IN_INV_SEL_S 6 -/* GPIO_FUNC70_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC70_IN_SEL 0x0000003F -#define GPIO_FUNC70_IN_SEL_M ((GPIO_FUNC70_IN_SEL_V)<<(GPIO_FUNC70_IN_SEL_S)) -#define GPIO_FUNC70_IN_SEL_V 0x3F -#define GPIO_FUNC70_IN_SEL_S 0 - -#define GPIO_FUNC71_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x024c) -/* GPIO_SIG71_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG71_IN_SEL (BIT(7)) -#define GPIO_SIG71_IN_SEL_M (BIT(7)) -#define GPIO_SIG71_IN_SEL_V 0x1 -#define GPIO_SIG71_IN_SEL_S 7 -/* GPIO_FUNC71_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC71_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC71_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC71_IN_INV_SEL_V 0x1 -#define GPIO_FUNC71_IN_INV_SEL_S 6 -/* GPIO_FUNC71_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC71_IN_SEL 0x0000003F -#define GPIO_FUNC71_IN_SEL_M ((GPIO_FUNC71_IN_SEL_V)<<(GPIO_FUNC71_IN_SEL_S)) -#define GPIO_FUNC71_IN_SEL_V 0x3F -#define GPIO_FUNC71_IN_SEL_S 0 - -#define GPIO_FUNC72_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0250) -/* GPIO_SIG72_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG72_IN_SEL (BIT(7)) -#define GPIO_SIG72_IN_SEL_M (BIT(7)) -#define GPIO_SIG72_IN_SEL_V 0x1 -#define GPIO_SIG72_IN_SEL_S 7 -/* GPIO_FUNC72_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC72_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC72_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC72_IN_INV_SEL_V 0x1 -#define GPIO_FUNC72_IN_INV_SEL_S 6 -/* GPIO_FUNC72_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC72_IN_SEL 0x0000003F -#define GPIO_FUNC72_IN_SEL_M ((GPIO_FUNC72_IN_SEL_V)<<(GPIO_FUNC72_IN_SEL_S)) -#define GPIO_FUNC72_IN_SEL_V 0x3F -#define GPIO_FUNC72_IN_SEL_S 0 - -#define GPIO_FUNC73_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0254) -/* GPIO_SIG73_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG73_IN_SEL (BIT(7)) -#define GPIO_SIG73_IN_SEL_M (BIT(7)) -#define GPIO_SIG73_IN_SEL_V 0x1 -#define GPIO_SIG73_IN_SEL_S 7 -/* GPIO_FUNC73_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC73_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC73_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC73_IN_INV_SEL_V 0x1 -#define GPIO_FUNC73_IN_INV_SEL_S 6 -/* GPIO_FUNC73_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC73_IN_SEL 0x0000003F -#define GPIO_FUNC73_IN_SEL_M ((GPIO_FUNC73_IN_SEL_V)<<(GPIO_FUNC73_IN_SEL_S)) -#define GPIO_FUNC73_IN_SEL_V 0x3F -#define GPIO_FUNC73_IN_SEL_S 0 - -#define GPIO_FUNC74_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0258) -/* GPIO_SIG74_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG74_IN_SEL (BIT(7)) -#define GPIO_SIG74_IN_SEL_M (BIT(7)) -#define GPIO_SIG74_IN_SEL_V 0x1 -#define GPIO_SIG74_IN_SEL_S 7 -/* GPIO_FUNC74_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC74_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC74_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC74_IN_INV_SEL_V 0x1 -#define GPIO_FUNC74_IN_INV_SEL_S 6 -/* GPIO_FUNC74_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC74_IN_SEL 0x0000003F -#define GPIO_FUNC74_IN_SEL_M ((GPIO_FUNC74_IN_SEL_V)<<(GPIO_FUNC74_IN_SEL_S)) -#define GPIO_FUNC74_IN_SEL_V 0x3F -#define GPIO_FUNC74_IN_SEL_S 0 - -#define GPIO_FUNC75_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x025c) -/* GPIO_SIG75_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG75_IN_SEL (BIT(7)) -#define GPIO_SIG75_IN_SEL_M (BIT(7)) -#define GPIO_SIG75_IN_SEL_V 0x1 -#define GPIO_SIG75_IN_SEL_S 7 -/* GPIO_FUNC75_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC75_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC75_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC75_IN_INV_SEL_V 0x1 -#define GPIO_FUNC75_IN_INV_SEL_S 6 -/* GPIO_FUNC75_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC75_IN_SEL 0x0000003F -#define GPIO_FUNC75_IN_SEL_M ((GPIO_FUNC75_IN_SEL_V)<<(GPIO_FUNC75_IN_SEL_S)) -#define GPIO_FUNC75_IN_SEL_V 0x3F -#define GPIO_FUNC75_IN_SEL_S 0 - -#define GPIO_FUNC76_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0260) -/* GPIO_SIG76_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG76_IN_SEL (BIT(7)) -#define GPIO_SIG76_IN_SEL_M (BIT(7)) -#define GPIO_SIG76_IN_SEL_V 0x1 -#define GPIO_SIG76_IN_SEL_S 7 -/* GPIO_FUNC76_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC76_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC76_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC76_IN_INV_SEL_V 0x1 -#define GPIO_FUNC76_IN_INV_SEL_S 6 -/* GPIO_FUNC76_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC76_IN_SEL 0x0000003F -#define GPIO_FUNC76_IN_SEL_M ((GPIO_FUNC76_IN_SEL_V)<<(GPIO_FUNC76_IN_SEL_S)) -#define GPIO_FUNC76_IN_SEL_V 0x3F -#define GPIO_FUNC76_IN_SEL_S 0 - -#define GPIO_FUNC77_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0264) -/* GPIO_SIG77_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG77_IN_SEL (BIT(7)) -#define GPIO_SIG77_IN_SEL_M (BIT(7)) -#define GPIO_SIG77_IN_SEL_V 0x1 -#define GPIO_SIG77_IN_SEL_S 7 -/* GPIO_FUNC77_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC77_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC77_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC77_IN_INV_SEL_V 0x1 -#define GPIO_FUNC77_IN_INV_SEL_S 6 -/* GPIO_FUNC77_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC77_IN_SEL 0x0000003F -#define GPIO_FUNC77_IN_SEL_M ((GPIO_FUNC77_IN_SEL_V)<<(GPIO_FUNC77_IN_SEL_S)) -#define GPIO_FUNC77_IN_SEL_V 0x3F -#define GPIO_FUNC77_IN_SEL_S 0 - -#define GPIO_FUNC78_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0268) -/* GPIO_SIG78_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG78_IN_SEL (BIT(7)) -#define GPIO_SIG78_IN_SEL_M (BIT(7)) -#define GPIO_SIG78_IN_SEL_V 0x1 -#define GPIO_SIG78_IN_SEL_S 7 -/* GPIO_FUNC78_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC78_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC78_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC78_IN_INV_SEL_V 0x1 -#define GPIO_FUNC78_IN_INV_SEL_S 6 -/* GPIO_FUNC78_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC78_IN_SEL 0x0000003F -#define GPIO_FUNC78_IN_SEL_M ((GPIO_FUNC78_IN_SEL_V)<<(GPIO_FUNC78_IN_SEL_S)) -#define GPIO_FUNC78_IN_SEL_V 0x3F -#define GPIO_FUNC78_IN_SEL_S 0 - -#define GPIO_FUNC79_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x026c) -/* GPIO_SIG79_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG79_IN_SEL (BIT(7)) -#define GPIO_SIG79_IN_SEL_M (BIT(7)) -#define GPIO_SIG79_IN_SEL_V 0x1 -#define GPIO_SIG79_IN_SEL_S 7 -/* GPIO_FUNC79_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC79_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC79_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC79_IN_INV_SEL_V 0x1 -#define GPIO_FUNC79_IN_INV_SEL_S 6 -/* GPIO_FUNC79_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC79_IN_SEL 0x0000003F -#define GPIO_FUNC79_IN_SEL_M ((GPIO_FUNC79_IN_SEL_V)<<(GPIO_FUNC79_IN_SEL_S)) -#define GPIO_FUNC79_IN_SEL_V 0x3F -#define GPIO_FUNC79_IN_SEL_S 0 - -#define GPIO_FUNC80_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0270) -/* GPIO_SIG80_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG80_IN_SEL (BIT(7)) -#define GPIO_SIG80_IN_SEL_M (BIT(7)) -#define GPIO_SIG80_IN_SEL_V 0x1 -#define GPIO_SIG80_IN_SEL_S 7 -/* GPIO_FUNC80_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC80_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC80_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC80_IN_INV_SEL_V 0x1 -#define GPIO_FUNC80_IN_INV_SEL_S 6 -/* GPIO_FUNC80_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC80_IN_SEL 0x0000003F -#define GPIO_FUNC80_IN_SEL_M ((GPIO_FUNC80_IN_SEL_V)<<(GPIO_FUNC80_IN_SEL_S)) -#define GPIO_FUNC80_IN_SEL_V 0x3F -#define GPIO_FUNC80_IN_SEL_S 0 - -#define GPIO_FUNC81_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0274) -/* GPIO_SIG81_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG81_IN_SEL (BIT(7)) -#define GPIO_SIG81_IN_SEL_M (BIT(7)) -#define GPIO_SIG81_IN_SEL_V 0x1 -#define GPIO_SIG81_IN_SEL_S 7 -/* GPIO_FUNC81_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC81_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC81_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC81_IN_INV_SEL_V 0x1 -#define GPIO_FUNC81_IN_INV_SEL_S 6 -/* GPIO_FUNC81_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC81_IN_SEL 0x0000003F -#define GPIO_FUNC81_IN_SEL_M ((GPIO_FUNC81_IN_SEL_V)<<(GPIO_FUNC81_IN_SEL_S)) -#define GPIO_FUNC81_IN_SEL_V 0x3F -#define GPIO_FUNC81_IN_SEL_S 0 - -#define GPIO_FUNC82_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0278) -/* GPIO_SIG82_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG82_IN_SEL (BIT(7)) -#define GPIO_SIG82_IN_SEL_M (BIT(7)) -#define GPIO_SIG82_IN_SEL_V 0x1 -#define GPIO_SIG82_IN_SEL_S 7 -/* GPIO_FUNC82_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC82_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC82_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC82_IN_INV_SEL_V 0x1 -#define GPIO_FUNC82_IN_INV_SEL_S 6 -/* GPIO_FUNC82_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC82_IN_SEL 0x0000003F -#define GPIO_FUNC82_IN_SEL_M ((GPIO_FUNC82_IN_SEL_V)<<(GPIO_FUNC82_IN_SEL_S)) -#define GPIO_FUNC82_IN_SEL_V 0x3F -#define GPIO_FUNC82_IN_SEL_S 0 - -#define GPIO_FUNC83_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x027c) -/* GPIO_SIG83_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG83_IN_SEL (BIT(7)) -#define GPIO_SIG83_IN_SEL_M (BIT(7)) -#define GPIO_SIG83_IN_SEL_V 0x1 -#define GPIO_SIG83_IN_SEL_S 7 -/* GPIO_FUNC83_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC83_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC83_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC83_IN_INV_SEL_V 0x1 -#define GPIO_FUNC83_IN_INV_SEL_S 6 -/* GPIO_FUNC83_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC83_IN_SEL 0x0000003F -#define GPIO_FUNC83_IN_SEL_M ((GPIO_FUNC83_IN_SEL_V)<<(GPIO_FUNC83_IN_SEL_S)) -#define GPIO_FUNC83_IN_SEL_V 0x3F -#define GPIO_FUNC83_IN_SEL_S 0 - -#define GPIO_FUNC84_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0280) -/* GPIO_SIG84_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG84_IN_SEL (BIT(7)) -#define GPIO_SIG84_IN_SEL_M (BIT(7)) -#define GPIO_SIG84_IN_SEL_V 0x1 -#define GPIO_SIG84_IN_SEL_S 7 -/* GPIO_FUNC84_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC84_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC84_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC84_IN_INV_SEL_V 0x1 -#define GPIO_FUNC84_IN_INV_SEL_S 6 -/* GPIO_FUNC84_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC84_IN_SEL 0x0000003F -#define GPIO_FUNC84_IN_SEL_M ((GPIO_FUNC84_IN_SEL_V)<<(GPIO_FUNC84_IN_SEL_S)) -#define GPIO_FUNC84_IN_SEL_V 0x3F -#define GPIO_FUNC84_IN_SEL_S 0 - -#define GPIO_FUNC85_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0284) -/* GPIO_SIG85_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG85_IN_SEL (BIT(7)) -#define GPIO_SIG85_IN_SEL_M (BIT(7)) -#define GPIO_SIG85_IN_SEL_V 0x1 -#define GPIO_SIG85_IN_SEL_S 7 -/* GPIO_FUNC85_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC85_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC85_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC85_IN_INV_SEL_V 0x1 -#define GPIO_FUNC85_IN_INV_SEL_S 6 -/* GPIO_FUNC85_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC85_IN_SEL 0x0000003F -#define GPIO_FUNC85_IN_SEL_M ((GPIO_FUNC85_IN_SEL_V)<<(GPIO_FUNC85_IN_SEL_S)) -#define GPIO_FUNC85_IN_SEL_V 0x3F -#define GPIO_FUNC85_IN_SEL_S 0 - -#define GPIO_FUNC86_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0288) -/* GPIO_SIG86_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG86_IN_SEL (BIT(7)) -#define GPIO_SIG86_IN_SEL_M (BIT(7)) -#define GPIO_SIG86_IN_SEL_V 0x1 -#define GPIO_SIG86_IN_SEL_S 7 -/* GPIO_FUNC86_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC86_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC86_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC86_IN_INV_SEL_V 0x1 -#define GPIO_FUNC86_IN_INV_SEL_S 6 -/* GPIO_FUNC86_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC86_IN_SEL 0x0000003F -#define GPIO_FUNC86_IN_SEL_M ((GPIO_FUNC86_IN_SEL_V)<<(GPIO_FUNC86_IN_SEL_S)) -#define GPIO_FUNC86_IN_SEL_V 0x3F -#define GPIO_FUNC86_IN_SEL_S 0 - -#define GPIO_FUNC87_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x028c) -/* GPIO_SIG87_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG87_IN_SEL (BIT(7)) -#define GPIO_SIG87_IN_SEL_M (BIT(7)) -#define GPIO_SIG87_IN_SEL_V 0x1 -#define GPIO_SIG87_IN_SEL_S 7 -/* GPIO_FUNC87_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC87_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC87_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC87_IN_INV_SEL_V 0x1 -#define GPIO_FUNC87_IN_INV_SEL_S 6 -/* GPIO_FUNC87_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC87_IN_SEL 0x0000003F -#define GPIO_FUNC87_IN_SEL_M ((GPIO_FUNC87_IN_SEL_V)<<(GPIO_FUNC87_IN_SEL_S)) -#define GPIO_FUNC87_IN_SEL_V 0x3F -#define GPIO_FUNC87_IN_SEL_S 0 - -#define GPIO_FUNC88_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0290) -/* GPIO_SIG88_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG88_IN_SEL (BIT(7)) -#define GPIO_SIG88_IN_SEL_M (BIT(7)) -#define GPIO_SIG88_IN_SEL_V 0x1 -#define GPIO_SIG88_IN_SEL_S 7 -/* GPIO_FUNC88_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC88_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC88_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC88_IN_INV_SEL_V 0x1 -#define GPIO_FUNC88_IN_INV_SEL_S 6 -/* GPIO_FUNC88_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC88_IN_SEL 0x0000003F -#define GPIO_FUNC88_IN_SEL_M ((GPIO_FUNC88_IN_SEL_V)<<(GPIO_FUNC88_IN_SEL_S)) -#define GPIO_FUNC88_IN_SEL_V 0x3F -#define GPIO_FUNC88_IN_SEL_S 0 - -#define GPIO_FUNC89_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0294) -/* GPIO_SIG89_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG89_IN_SEL (BIT(7)) -#define GPIO_SIG89_IN_SEL_M (BIT(7)) -#define GPIO_SIG89_IN_SEL_V 0x1 -#define GPIO_SIG89_IN_SEL_S 7 -/* GPIO_FUNC89_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC89_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC89_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC89_IN_INV_SEL_V 0x1 -#define GPIO_FUNC89_IN_INV_SEL_S 6 -/* GPIO_FUNC89_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC89_IN_SEL 0x0000003F -#define GPIO_FUNC89_IN_SEL_M ((GPIO_FUNC89_IN_SEL_V)<<(GPIO_FUNC89_IN_SEL_S)) -#define GPIO_FUNC89_IN_SEL_V 0x3F -#define GPIO_FUNC89_IN_SEL_S 0 - -#define GPIO_FUNC90_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0298) -/* GPIO_SIG90_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG90_IN_SEL (BIT(7)) -#define GPIO_SIG90_IN_SEL_M (BIT(7)) -#define GPIO_SIG90_IN_SEL_V 0x1 -#define GPIO_SIG90_IN_SEL_S 7 -/* GPIO_FUNC90_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC90_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC90_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC90_IN_INV_SEL_V 0x1 -#define GPIO_FUNC90_IN_INV_SEL_S 6 -/* GPIO_FUNC90_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC90_IN_SEL 0x0000003F -#define GPIO_FUNC90_IN_SEL_M ((GPIO_FUNC90_IN_SEL_V)<<(GPIO_FUNC90_IN_SEL_S)) -#define GPIO_FUNC90_IN_SEL_V 0x3F -#define GPIO_FUNC90_IN_SEL_S 0 - -#define GPIO_FUNC91_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x029c) -/* GPIO_SIG91_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG91_IN_SEL (BIT(7)) -#define GPIO_SIG91_IN_SEL_M (BIT(7)) -#define GPIO_SIG91_IN_SEL_V 0x1 -#define GPIO_SIG91_IN_SEL_S 7 -/* GPIO_FUNC91_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC91_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC91_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC91_IN_INV_SEL_V 0x1 -#define GPIO_FUNC91_IN_INV_SEL_S 6 -/* GPIO_FUNC91_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC91_IN_SEL 0x0000003F -#define GPIO_FUNC91_IN_SEL_M ((GPIO_FUNC91_IN_SEL_V)<<(GPIO_FUNC91_IN_SEL_S)) -#define GPIO_FUNC91_IN_SEL_V 0x3F -#define GPIO_FUNC91_IN_SEL_S 0 - -#define GPIO_FUNC92_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x02a0) -/* GPIO_SIG92_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG92_IN_SEL (BIT(7)) -#define GPIO_SIG92_IN_SEL_M (BIT(7)) -#define GPIO_SIG92_IN_SEL_V 0x1 -#define GPIO_SIG92_IN_SEL_S 7 -/* GPIO_FUNC92_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC92_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC92_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC92_IN_INV_SEL_V 0x1 -#define GPIO_FUNC92_IN_INV_SEL_S 6 -/* GPIO_FUNC92_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC92_IN_SEL 0x0000003F -#define GPIO_FUNC92_IN_SEL_M ((GPIO_FUNC92_IN_SEL_V)<<(GPIO_FUNC92_IN_SEL_S)) -#define GPIO_FUNC92_IN_SEL_V 0x3F -#define GPIO_FUNC92_IN_SEL_S 0 - -#define GPIO_FUNC93_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x02a4) -/* GPIO_SIG93_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG93_IN_SEL (BIT(7)) -#define GPIO_SIG93_IN_SEL_M (BIT(7)) -#define GPIO_SIG93_IN_SEL_V 0x1 -#define GPIO_SIG93_IN_SEL_S 7 -/* GPIO_FUNC93_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC93_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC93_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC93_IN_INV_SEL_V 0x1 -#define GPIO_FUNC93_IN_INV_SEL_S 6 -/* GPIO_FUNC93_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC93_IN_SEL 0x0000003F -#define GPIO_FUNC93_IN_SEL_M ((GPIO_FUNC93_IN_SEL_V)<<(GPIO_FUNC93_IN_SEL_S)) -#define GPIO_FUNC93_IN_SEL_V 0x3F -#define GPIO_FUNC93_IN_SEL_S 0 - -#define GPIO_FUNC94_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x02a8) -/* GPIO_SIG94_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG94_IN_SEL (BIT(7)) -#define GPIO_SIG94_IN_SEL_M (BIT(7)) -#define GPIO_SIG94_IN_SEL_V 0x1 -#define GPIO_SIG94_IN_SEL_S 7 -/* GPIO_FUNC94_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC94_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC94_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC94_IN_INV_SEL_V 0x1 -#define GPIO_FUNC94_IN_INV_SEL_S 6 -/* GPIO_FUNC94_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC94_IN_SEL 0x0000003F -#define GPIO_FUNC94_IN_SEL_M ((GPIO_FUNC94_IN_SEL_V)<<(GPIO_FUNC94_IN_SEL_S)) -#define GPIO_FUNC94_IN_SEL_V 0x3F -#define GPIO_FUNC94_IN_SEL_S 0 - -#define GPIO_FUNC95_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x02ac) -/* GPIO_SIG95_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG95_IN_SEL (BIT(7)) -#define GPIO_SIG95_IN_SEL_M (BIT(7)) -#define GPIO_SIG95_IN_SEL_V 0x1 -#define GPIO_SIG95_IN_SEL_S 7 -/* GPIO_FUNC95_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC95_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC95_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC95_IN_INV_SEL_V 0x1 -#define GPIO_FUNC95_IN_INV_SEL_S 6 -/* GPIO_FUNC95_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC95_IN_SEL 0x0000003F -#define GPIO_FUNC95_IN_SEL_M ((GPIO_FUNC95_IN_SEL_V)<<(GPIO_FUNC95_IN_SEL_S)) -#define GPIO_FUNC95_IN_SEL_V 0x3F -#define GPIO_FUNC95_IN_SEL_S 0 - -#define GPIO_FUNC96_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x02b0) -/* GPIO_SIG96_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG96_IN_SEL (BIT(7)) -#define GPIO_SIG96_IN_SEL_M (BIT(7)) -#define GPIO_SIG96_IN_SEL_V 0x1 -#define GPIO_SIG96_IN_SEL_S 7 -/* GPIO_FUNC96_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC96_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC96_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC96_IN_INV_SEL_V 0x1 -#define GPIO_FUNC96_IN_INV_SEL_S 6 -/* GPIO_FUNC96_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC96_IN_SEL 0x0000003F -#define GPIO_FUNC96_IN_SEL_M ((GPIO_FUNC96_IN_SEL_V)<<(GPIO_FUNC96_IN_SEL_S)) -#define GPIO_FUNC96_IN_SEL_V 0x3F -#define GPIO_FUNC96_IN_SEL_S 0 - -#define GPIO_FUNC97_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x02b4) -/* GPIO_SIG97_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG97_IN_SEL (BIT(7)) -#define GPIO_SIG97_IN_SEL_M (BIT(7)) -#define GPIO_SIG97_IN_SEL_V 0x1 -#define GPIO_SIG97_IN_SEL_S 7 -/* GPIO_FUNC97_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC97_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC97_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC97_IN_INV_SEL_V 0x1 -#define GPIO_FUNC97_IN_INV_SEL_S 6 -/* GPIO_FUNC97_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC97_IN_SEL 0x0000003F -#define GPIO_FUNC97_IN_SEL_M ((GPIO_FUNC97_IN_SEL_V)<<(GPIO_FUNC97_IN_SEL_S)) -#define GPIO_FUNC97_IN_SEL_V 0x3F -#define GPIO_FUNC97_IN_SEL_S 0 - -#define GPIO_FUNC98_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x02b8) -/* GPIO_SIG98_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG98_IN_SEL (BIT(7)) -#define GPIO_SIG98_IN_SEL_M (BIT(7)) -#define GPIO_SIG98_IN_SEL_V 0x1 -#define GPIO_SIG98_IN_SEL_S 7 -/* GPIO_FUNC98_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC98_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC98_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC98_IN_INV_SEL_V 0x1 -#define GPIO_FUNC98_IN_INV_SEL_S 6 -/* GPIO_FUNC98_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC98_IN_SEL 0x0000003F -#define GPIO_FUNC98_IN_SEL_M ((GPIO_FUNC98_IN_SEL_V)<<(GPIO_FUNC98_IN_SEL_S)) -#define GPIO_FUNC98_IN_SEL_V 0x3F -#define GPIO_FUNC98_IN_SEL_S 0 - -#define GPIO_FUNC99_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x02bc) -/* GPIO_SIG99_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG99_IN_SEL (BIT(7)) -#define GPIO_SIG99_IN_SEL_M (BIT(7)) -#define GPIO_SIG99_IN_SEL_V 0x1 -#define GPIO_SIG99_IN_SEL_S 7 -/* GPIO_FUNC99_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC99_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC99_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC99_IN_INV_SEL_V 0x1 -#define GPIO_FUNC99_IN_INV_SEL_S 6 -/* GPIO_FUNC99_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC99_IN_SEL 0x0000003F -#define GPIO_FUNC99_IN_SEL_M ((GPIO_FUNC99_IN_SEL_V)<<(GPIO_FUNC99_IN_SEL_S)) -#define GPIO_FUNC99_IN_SEL_V 0x3F -#define GPIO_FUNC99_IN_SEL_S 0 - -#define GPIO_FUNC100_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x02c0) -/* GPIO_SIG100_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG100_IN_SEL (BIT(7)) -#define GPIO_SIG100_IN_SEL_M (BIT(7)) -#define GPIO_SIG100_IN_SEL_V 0x1 -#define GPIO_SIG100_IN_SEL_S 7 -/* GPIO_FUNC100_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC100_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC100_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC100_IN_INV_SEL_V 0x1 -#define GPIO_FUNC100_IN_INV_SEL_S 6 -/* GPIO_FUNC100_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC100_IN_SEL 0x0000003F -#define GPIO_FUNC100_IN_SEL_M ((GPIO_FUNC100_IN_SEL_V)<<(GPIO_FUNC100_IN_SEL_S)) -#define GPIO_FUNC100_IN_SEL_V 0x3F -#define GPIO_FUNC100_IN_SEL_S 0 - -#define GPIO_FUNC101_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x02c4) -/* GPIO_SIG101_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG101_IN_SEL (BIT(7)) -#define GPIO_SIG101_IN_SEL_M (BIT(7)) -#define GPIO_SIG101_IN_SEL_V 0x1 -#define GPIO_SIG101_IN_SEL_S 7 -/* GPIO_FUNC101_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC101_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC101_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC101_IN_INV_SEL_V 0x1 -#define GPIO_FUNC101_IN_INV_SEL_S 6 -/* GPIO_FUNC101_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC101_IN_SEL 0x0000003F -#define GPIO_FUNC101_IN_SEL_M ((GPIO_FUNC101_IN_SEL_V)<<(GPIO_FUNC101_IN_SEL_S)) -#define GPIO_FUNC101_IN_SEL_V 0x3F -#define GPIO_FUNC101_IN_SEL_S 0 - -#define GPIO_FUNC102_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x02c8) -/* GPIO_SIG102_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG102_IN_SEL (BIT(7)) -#define GPIO_SIG102_IN_SEL_M (BIT(7)) -#define GPIO_SIG102_IN_SEL_V 0x1 -#define GPIO_SIG102_IN_SEL_S 7 -/* GPIO_FUNC102_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC102_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC102_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC102_IN_INV_SEL_V 0x1 -#define GPIO_FUNC102_IN_INV_SEL_S 6 -/* GPIO_FUNC102_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC102_IN_SEL 0x0000003F -#define GPIO_FUNC102_IN_SEL_M ((GPIO_FUNC102_IN_SEL_V)<<(GPIO_FUNC102_IN_SEL_S)) -#define GPIO_FUNC102_IN_SEL_V 0x3F -#define GPIO_FUNC102_IN_SEL_S 0 - -#define GPIO_FUNC103_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x02cc) -/* GPIO_SIG103_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG103_IN_SEL (BIT(7)) -#define GPIO_SIG103_IN_SEL_M (BIT(7)) -#define GPIO_SIG103_IN_SEL_V 0x1 -#define GPIO_SIG103_IN_SEL_S 7 -/* GPIO_FUNC103_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC103_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC103_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC103_IN_INV_SEL_V 0x1 -#define GPIO_FUNC103_IN_INV_SEL_S 6 -/* GPIO_FUNC103_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC103_IN_SEL 0x0000003F -#define GPIO_FUNC103_IN_SEL_M ((GPIO_FUNC103_IN_SEL_V)<<(GPIO_FUNC103_IN_SEL_S)) -#define GPIO_FUNC103_IN_SEL_V 0x3F -#define GPIO_FUNC103_IN_SEL_S 0 - -#define GPIO_FUNC104_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x02d0) -/* GPIO_SIG104_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG104_IN_SEL (BIT(7)) -#define GPIO_SIG104_IN_SEL_M (BIT(7)) -#define GPIO_SIG104_IN_SEL_V 0x1 -#define GPIO_SIG104_IN_SEL_S 7 -/* GPIO_FUNC104_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC104_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC104_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC104_IN_INV_SEL_V 0x1 -#define GPIO_FUNC104_IN_INV_SEL_S 6 -/* GPIO_FUNC104_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC104_IN_SEL 0x0000003F -#define GPIO_FUNC104_IN_SEL_M ((GPIO_FUNC104_IN_SEL_V)<<(GPIO_FUNC104_IN_SEL_S)) -#define GPIO_FUNC104_IN_SEL_V 0x3F -#define GPIO_FUNC104_IN_SEL_S 0 - -#define GPIO_FUNC105_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x02d4) -/* GPIO_SIG105_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG105_IN_SEL (BIT(7)) -#define GPIO_SIG105_IN_SEL_M (BIT(7)) -#define GPIO_SIG105_IN_SEL_V 0x1 -#define GPIO_SIG105_IN_SEL_S 7 -/* GPIO_FUNC105_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC105_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC105_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC105_IN_INV_SEL_V 0x1 -#define GPIO_FUNC105_IN_INV_SEL_S 6 -/* GPIO_FUNC105_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC105_IN_SEL 0x0000003F -#define GPIO_FUNC105_IN_SEL_M ((GPIO_FUNC105_IN_SEL_V)<<(GPIO_FUNC105_IN_SEL_S)) -#define GPIO_FUNC105_IN_SEL_V 0x3F -#define GPIO_FUNC105_IN_SEL_S 0 - -#define GPIO_FUNC106_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x02d8) -/* GPIO_SIG106_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG106_IN_SEL (BIT(7)) -#define GPIO_SIG106_IN_SEL_M (BIT(7)) -#define GPIO_SIG106_IN_SEL_V 0x1 -#define GPIO_SIG106_IN_SEL_S 7 -/* GPIO_FUNC106_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC106_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC106_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC106_IN_INV_SEL_V 0x1 -#define GPIO_FUNC106_IN_INV_SEL_S 6 -/* GPIO_FUNC106_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC106_IN_SEL 0x0000003F -#define GPIO_FUNC106_IN_SEL_M ((GPIO_FUNC106_IN_SEL_V)<<(GPIO_FUNC106_IN_SEL_S)) -#define GPIO_FUNC106_IN_SEL_V 0x3F -#define GPIO_FUNC106_IN_SEL_S 0 - -#define GPIO_FUNC107_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x02dc) -/* GPIO_SIG107_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG107_IN_SEL (BIT(7)) -#define GPIO_SIG107_IN_SEL_M (BIT(7)) -#define GPIO_SIG107_IN_SEL_V 0x1 -#define GPIO_SIG107_IN_SEL_S 7 -/* GPIO_FUNC107_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC107_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC107_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC107_IN_INV_SEL_V 0x1 -#define GPIO_FUNC107_IN_INV_SEL_S 6 -/* GPIO_FUNC107_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC107_IN_SEL 0x0000003F -#define GPIO_FUNC107_IN_SEL_M ((GPIO_FUNC107_IN_SEL_V)<<(GPIO_FUNC107_IN_SEL_S)) -#define GPIO_FUNC107_IN_SEL_V 0x3F -#define GPIO_FUNC107_IN_SEL_S 0 - -#define GPIO_FUNC108_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x02e0) -/* GPIO_SIG108_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG108_IN_SEL (BIT(7)) -#define GPIO_SIG108_IN_SEL_M (BIT(7)) -#define GPIO_SIG108_IN_SEL_V 0x1 -#define GPIO_SIG108_IN_SEL_S 7 -/* GPIO_FUNC108_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC108_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC108_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC108_IN_INV_SEL_V 0x1 -#define GPIO_FUNC108_IN_INV_SEL_S 6 -/* GPIO_FUNC108_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC108_IN_SEL 0x0000003F -#define GPIO_FUNC108_IN_SEL_M ((GPIO_FUNC108_IN_SEL_V)<<(GPIO_FUNC108_IN_SEL_S)) -#define GPIO_FUNC108_IN_SEL_V 0x3F -#define GPIO_FUNC108_IN_SEL_S 0 - -#define GPIO_FUNC109_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x02e4) -/* GPIO_SIG109_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG109_IN_SEL (BIT(7)) -#define GPIO_SIG109_IN_SEL_M (BIT(7)) -#define GPIO_SIG109_IN_SEL_V 0x1 -#define GPIO_SIG109_IN_SEL_S 7 -/* GPIO_FUNC109_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC109_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC109_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC109_IN_INV_SEL_V 0x1 -#define GPIO_FUNC109_IN_INV_SEL_S 6 -/* GPIO_FUNC109_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC109_IN_SEL 0x0000003F -#define GPIO_FUNC109_IN_SEL_M ((GPIO_FUNC109_IN_SEL_V)<<(GPIO_FUNC109_IN_SEL_S)) -#define GPIO_FUNC109_IN_SEL_V 0x3F -#define GPIO_FUNC109_IN_SEL_S 0 - -#define GPIO_FUNC110_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x02e8) -/* GPIO_SIG110_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG110_IN_SEL (BIT(7)) -#define GPIO_SIG110_IN_SEL_M (BIT(7)) -#define GPIO_SIG110_IN_SEL_V 0x1 -#define GPIO_SIG110_IN_SEL_S 7 -/* GPIO_FUNC110_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC110_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC110_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC110_IN_INV_SEL_V 0x1 -#define GPIO_FUNC110_IN_INV_SEL_S 6 -/* GPIO_FUNC110_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC110_IN_SEL 0x0000003F -#define GPIO_FUNC110_IN_SEL_M ((GPIO_FUNC110_IN_SEL_V)<<(GPIO_FUNC110_IN_SEL_S)) -#define GPIO_FUNC110_IN_SEL_V 0x3F -#define GPIO_FUNC110_IN_SEL_S 0 - -#define GPIO_FUNC111_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x02ec) -/* GPIO_SIG111_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG111_IN_SEL (BIT(7)) -#define GPIO_SIG111_IN_SEL_M (BIT(7)) -#define GPIO_SIG111_IN_SEL_V 0x1 -#define GPIO_SIG111_IN_SEL_S 7 -/* GPIO_FUNC111_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC111_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC111_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC111_IN_INV_SEL_V 0x1 -#define GPIO_FUNC111_IN_INV_SEL_S 6 -/* GPIO_FUNC111_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC111_IN_SEL 0x0000003F -#define GPIO_FUNC111_IN_SEL_M ((GPIO_FUNC111_IN_SEL_V)<<(GPIO_FUNC111_IN_SEL_S)) -#define GPIO_FUNC111_IN_SEL_V 0x3F -#define GPIO_FUNC111_IN_SEL_S 0 - -#define GPIO_FUNC112_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x02f0) -/* GPIO_SIG112_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG112_IN_SEL (BIT(7)) -#define GPIO_SIG112_IN_SEL_M (BIT(7)) -#define GPIO_SIG112_IN_SEL_V 0x1 -#define GPIO_SIG112_IN_SEL_S 7 -/* GPIO_FUNC112_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC112_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC112_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC112_IN_INV_SEL_V 0x1 -#define GPIO_FUNC112_IN_INV_SEL_S 6 -/* GPIO_FUNC112_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC112_IN_SEL 0x0000003F -#define GPIO_FUNC112_IN_SEL_M ((GPIO_FUNC112_IN_SEL_V)<<(GPIO_FUNC112_IN_SEL_S)) -#define GPIO_FUNC112_IN_SEL_V 0x3F -#define GPIO_FUNC112_IN_SEL_S 0 - -#define GPIO_FUNC113_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x02f4) -/* GPIO_SIG113_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG113_IN_SEL (BIT(7)) -#define GPIO_SIG113_IN_SEL_M (BIT(7)) -#define GPIO_SIG113_IN_SEL_V 0x1 -#define GPIO_SIG113_IN_SEL_S 7 -/* GPIO_FUNC113_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC113_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC113_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC113_IN_INV_SEL_V 0x1 -#define GPIO_FUNC113_IN_INV_SEL_S 6 -/* GPIO_FUNC113_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC113_IN_SEL 0x0000003F -#define GPIO_FUNC113_IN_SEL_M ((GPIO_FUNC113_IN_SEL_V)<<(GPIO_FUNC113_IN_SEL_S)) -#define GPIO_FUNC113_IN_SEL_V 0x3F -#define GPIO_FUNC113_IN_SEL_S 0 - -#define GPIO_FUNC114_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x02f8) -/* GPIO_SIG114_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG114_IN_SEL (BIT(7)) -#define GPIO_SIG114_IN_SEL_M (BIT(7)) -#define GPIO_SIG114_IN_SEL_V 0x1 -#define GPIO_SIG114_IN_SEL_S 7 -/* GPIO_FUNC114_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC114_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC114_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC114_IN_INV_SEL_V 0x1 -#define GPIO_FUNC114_IN_INV_SEL_S 6 -/* GPIO_FUNC114_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC114_IN_SEL 0x0000003F -#define GPIO_FUNC114_IN_SEL_M ((GPIO_FUNC114_IN_SEL_V)<<(GPIO_FUNC114_IN_SEL_S)) -#define GPIO_FUNC114_IN_SEL_V 0x3F -#define GPIO_FUNC114_IN_SEL_S 0 - -#define GPIO_FUNC115_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x02fc) -/* GPIO_SIG115_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG115_IN_SEL (BIT(7)) -#define GPIO_SIG115_IN_SEL_M (BIT(7)) -#define GPIO_SIG115_IN_SEL_V 0x1 -#define GPIO_SIG115_IN_SEL_S 7 -/* GPIO_FUNC115_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC115_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC115_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC115_IN_INV_SEL_V 0x1 -#define GPIO_FUNC115_IN_INV_SEL_S 6 -/* GPIO_FUNC115_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC115_IN_SEL 0x0000003F -#define GPIO_FUNC115_IN_SEL_M ((GPIO_FUNC115_IN_SEL_V)<<(GPIO_FUNC115_IN_SEL_S)) -#define GPIO_FUNC115_IN_SEL_V 0x3F -#define GPIO_FUNC115_IN_SEL_S 0 - -#define GPIO_FUNC116_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0300) -/* GPIO_SIG116_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG116_IN_SEL (BIT(7)) -#define GPIO_SIG116_IN_SEL_M (BIT(7)) -#define GPIO_SIG116_IN_SEL_V 0x1 -#define GPIO_SIG116_IN_SEL_S 7 -/* GPIO_FUNC116_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC116_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC116_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC116_IN_INV_SEL_V 0x1 -#define GPIO_FUNC116_IN_INV_SEL_S 6 -/* GPIO_FUNC116_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC116_IN_SEL 0x0000003F -#define GPIO_FUNC116_IN_SEL_M ((GPIO_FUNC116_IN_SEL_V)<<(GPIO_FUNC116_IN_SEL_S)) -#define GPIO_FUNC116_IN_SEL_V 0x3F -#define GPIO_FUNC116_IN_SEL_S 0 - -#define GPIO_FUNC117_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0304) -/* GPIO_SIG117_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG117_IN_SEL (BIT(7)) -#define GPIO_SIG117_IN_SEL_M (BIT(7)) -#define GPIO_SIG117_IN_SEL_V 0x1 -#define GPIO_SIG117_IN_SEL_S 7 -/* GPIO_FUNC117_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC117_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC117_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC117_IN_INV_SEL_V 0x1 -#define GPIO_FUNC117_IN_INV_SEL_S 6 -/* GPIO_FUNC117_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC117_IN_SEL 0x0000003F -#define GPIO_FUNC117_IN_SEL_M ((GPIO_FUNC117_IN_SEL_V)<<(GPIO_FUNC117_IN_SEL_S)) -#define GPIO_FUNC117_IN_SEL_V 0x3F -#define GPIO_FUNC117_IN_SEL_S 0 - -#define GPIO_FUNC118_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0308) -/* GPIO_SIG118_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG118_IN_SEL (BIT(7)) -#define GPIO_SIG118_IN_SEL_M (BIT(7)) -#define GPIO_SIG118_IN_SEL_V 0x1 -#define GPIO_SIG118_IN_SEL_S 7 -/* GPIO_FUNC118_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC118_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC118_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC118_IN_INV_SEL_V 0x1 -#define GPIO_FUNC118_IN_INV_SEL_S 6 -/* GPIO_FUNC118_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC118_IN_SEL 0x0000003F -#define GPIO_FUNC118_IN_SEL_M ((GPIO_FUNC118_IN_SEL_V)<<(GPIO_FUNC118_IN_SEL_S)) -#define GPIO_FUNC118_IN_SEL_V 0x3F -#define GPIO_FUNC118_IN_SEL_S 0 - -#define GPIO_FUNC119_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x030c) -/* GPIO_SIG119_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG119_IN_SEL (BIT(7)) -#define GPIO_SIG119_IN_SEL_M (BIT(7)) -#define GPIO_SIG119_IN_SEL_V 0x1 -#define GPIO_SIG119_IN_SEL_S 7 -/* GPIO_FUNC119_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC119_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC119_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC119_IN_INV_SEL_V 0x1 -#define GPIO_FUNC119_IN_INV_SEL_S 6 -/* GPIO_FUNC119_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC119_IN_SEL 0x0000003F -#define GPIO_FUNC119_IN_SEL_M ((GPIO_FUNC119_IN_SEL_V)<<(GPIO_FUNC119_IN_SEL_S)) -#define GPIO_FUNC119_IN_SEL_V 0x3F -#define GPIO_FUNC119_IN_SEL_S 0 - -#define GPIO_FUNC120_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0310) -/* GPIO_SIG120_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG120_IN_SEL (BIT(7)) -#define GPIO_SIG120_IN_SEL_M (BIT(7)) -#define GPIO_SIG120_IN_SEL_V 0x1 -#define GPIO_SIG120_IN_SEL_S 7 -/* GPIO_FUNC120_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC120_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC120_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC120_IN_INV_SEL_V 0x1 -#define GPIO_FUNC120_IN_INV_SEL_S 6 -/* GPIO_FUNC120_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC120_IN_SEL 0x0000003F -#define GPIO_FUNC120_IN_SEL_M ((GPIO_FUNC120_IN_SEL_V)<<(GPIO_FUNC120_IN_SEL_S)) -#define GPIO_FUNC120_IN_SEL_V 0x3F -#define GPIO_FUNC120_IN_SEL_S 0 - -#define GPIO_FUNC121_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0314) -/* GPIO_SIG121_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG121_IN_SEL (BIT(7)) -#define GPIO_SIG121_IN_SEL_M (BIT(7)) -#define GPIO_SIG121_IN_SEL_V 0x1 -#define GPIO_SIG121_IN_SEL_S 7 -/* GPIO_FUNC121_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC121_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC121_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC121_IN_INV_SEL_V 0x1 -#define GPIO_FUNC121_IN_INV_SEL_S 6 -/* GPIO_FUNC121_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC121_IN_SEL 0x0000003F -#define GPIO_FUNC121_IN_SEL_M ((GPIO_FUNC121_IN_SEL_V)<<(GPIO_FUNC121_IN_SEL_S)) -#define GPIO_FUNC121_IN_SEL_V 0x3F -#define GPIO_FUNC121_IN_SEL_S 0 - -#define GPIO_FUNC122_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0318) -/* GPIO_SIG122_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG122_IN_SEL (BIT(7)) -#define GPIO_SIG122_IN_SEL_M (BIT(7)) -#define GPIO_SIG122_IN_SEL_V 0x1 -#define GPIO_SIG122_IN_SEL_S 7 -/* GPIO_FUNC122_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC122_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC122_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC122_IN_INV_SEL_V 0x1 -#define GPIO_FUNC122_IN_INV_SEL_S 6 -/* GPIO_FUNC122_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC122_IN_SEL 0x0000003F -#define GPIO_FUNC122_IN_SEL_M ((GPIO_FUNC122_IN_SEL_V)<<(GPIO_FUNC122_IN_SEL_S)) -#define GPIO_FUNC122_IN_SEL_V 0x3F -#define GPIO_FUNC122_IN_SEL_S 0 - -#define GPIO_FUNC123_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x031c) -/* GPIO_SIG123_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG123_IN_SEL (BIT(7)) -#define GPIO_SIG123_IN_SEL_M (BIT(7)) -#define GPIO_SIG123_IN_SEL_V 0x1 -#define GPIO_SIG123_IN_SEL_S 7 -/* GPIO_FUNC123_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC123_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC123_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC123_IN_INV_SEL_V 0x1 -#define GPIO_FUNC123_IN_INV_SEL_S 6 -/* GPIO_FUNC123_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC123_IN_SEL 0x0000003F -#define GPIO_FUNC123_IN_SEL_M ((GPIO_FUNC123_IN_SEL_V)<<(GPIO_FUNC123_IN_SEL_S)) -#define GPIO_FUNC123_IN_SEL_V 0x3F -#define GPIO_FUNC123_IN_SEL_S 0 - -#define GPIO_FUNC124_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0320) -/* GPIO_SIG124_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG124_IN_SEL (BIT(7)) -#define GPIO_SIG124_IN_SEL_M (BIT(7)) -#define GPIO_SIG124_IN_SEL_V 0x1 -#define GPIO_SIG124_IN_SEL_S 7 -/* GPIO_FUNC124_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC124_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC124_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC124_IN_INV_SEL_V 0x1 -#define GPIO_FUNC124_IN_INV_SEL_S 6 -/* GPIO_FUNC124_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC124_IN_SEL 0x0000003F -#define GPIO_FUNC124_IN_SEL_M ((GPIO_FUNC124_IN_SEL_V)<<(GPIO_FUNC124_IN_SEL_S)) -#define GPIO_FUNC124_IN_SEL_V 0x3F -#define GPIO_FUNC124_IN_SEL_S 0 - -#define GPIO_FUNC125_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0324) -/* GPIO_SIG125_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG125_IN_SEL (BIT(7)) -#define GPIO_SIG125_IN_SEL_M (BIT(7)) -#define GPIO_SIG125_IN_SEL_V 0x1 -#define GPIO_SIG125_IN_SEL_S 7 -/* GPIO_FUNC125_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC125_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC125_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC125_IN_INV_SEL_V 0x1 -#define GPIO_FUNC125_IN_INV_SEL_S 6 -/* GPIO_FUNC125_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC125_IN_SEL 0x0000003F -#define GPIO_FUNC125_IN_SEL_M ((GPIO_FUNC125_IN_SEL_V)<<(GPIO_FUNC125_IN_SEL_S)) -#define GPIO_FUNC125_IN_SEL_V 0x3F -#define GPIO_FUNC125_IN_SEL_S 0 - -#define GPIO_FUNC126_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0328) -/* GPIO_SIG126_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG126_IN_SEL (BIT(7)) -#define GPIO_SIG126_IN_SEL_M (BIT(7)) -#define GPIO_SIG126_IN_SEL_V 0x1 -#define GPIO_SIG126_IN_SEL_S 7 -/* GPIO_FUNC126_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC126_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC126_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC126_IN_INV_SEL_V 0x1 -#define GPIO_FUNC126_IN_INV_SEL_S 6 -/* GPIO_FUNC126_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC126_IN_SEL 0x0000003F -#define GPIO_FUNC126_IN_SEL_M ((GPIO_FUNC126_IN_SEL_V)<<(GPIO_FUNC126_IN_SEL_S)) -#define GPIO_FUNC126_IN_SEL_V 0x3F -#define GPIO_FUNC126_IN_SEL_S 0 - -#define GPIO_FUNC127_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x032c) -/* GPIO_SIG127_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG127_IN_SEL (BIT(7)) -#define GPIO_SIG127_IN_SEL_M (BIT(7)) -#define GPIO_SIG127_IN_SEL_V 0x1 -#define GPIO_SIG127_IN_SEL_S 7 -/* GPIO_FUNC127_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC127_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC127_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC127_IN_INV_SEL_V 0x1 -#define GPIO_FUNC127_IN_INV_SEL_S 6 -/* GPIO_FUNC127_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC127_IN_SEL 0x0000003F -#define GPIO_FUNC127_IN_SEL_M ((GPIO_FUNC127_IN_SEL_V)<<(GPIO_FUNC127_IN_SEL_S)) -#define GPIO_FUNC127_IN_SEL_V 0x3F -#define GPIO_FUNC127_IN_SEL_S 0 - -#define GPIO_FUNC128_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0330) -/* GPIO_SIG128_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG128_IN_SEL (BIT(7)) -#define GPIO_SIG128_IN_SEL_M (BIT(7)) -#define GPIO_SIG128_IN_SEL_V 0x1 -#define GPIO_SIG128_IN_SEL_S 7 -/* GPIO_FUNC128_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC128_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC128_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC128_IN_INV_SEL_V 0x1 -#define GPIO_FUNC128_IN_INV_SEL_S 6 -/* GPIO_FUNC128_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC128_IN_SEL 0x0000003F -#define GPIO_FUNC128_IN_SEL_M ((GPIO_FUNC128_IN_SEL_V)<<(GPIO_FUNC128_IN_SEL_S)) -#define GPIO_FUNC128_IN_SEL_V 0x3F -#define GPIO_FUNC128_IN_SEL_S 0 - -#define GPIO_FUNC129_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0334) -/* GPIO_SIG129_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG129_IN_SEL (BIT(7)) -#define GPIO_SIG129_IN_SEL_M (BIT(7)) -#define GPIO_SIG129_IN_SEL_V 0x1 -#define GPIO_SIG129_IN_SEL_S 7 -/* GPIO_FUNC129_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC129_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC129_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC129_IN_INV_SEL_V 0x1 -#define GPIO_FUNC129_IN_INV_SEL_S 6 -/* GPIO_FUNC129_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC129_IN_SEL 0x0000003F -#define GPIO_FUNC129_IN_SEL_M ((GPIO_FUNC129_IN_SEL_V)<<(GPIO_FUNC129_IN_SEL_S)) -#define GPIO_FUNC129_IN_SEL_V 0x3F -#define GPIO_FUNC129_IN_SEL_S 0 - -#define GPIO_FUNC130_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0338) -/* GPIO_SIG130_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG130_IN_SEL (BIT(7)) -#define GPIO_SIG130_IN_SEL_M (BIT(7)) -#define GPIO_SIG130_IN_SEL_V 0x1 -#define GPIO_SIG130_IN_SEL_S 7 -/* GPIO_FUNC130_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC130_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC130_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC130_IN_INV_SEL_V 0x1 -#define GPIO_FUNC130_IN_INV_SEL_S 6 -/* GPIO_FUNC130_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC130_IN_SEL 0x0000003F -#define GPIO_FUNC130_IN_SEL_M ((GPIO_FUNC130_IN_SEL_V)<<(GPIO_FUNC130_IN_SEL_S)) -#define GPIO_FUNC130_IN_SEL_V 0x3F -#define GPIO_FUNC130_IN_SEL_S 0 - -#define GPIO_FUNC131_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x033c) -/* GPIO_SIG131_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG131_IN_SEL (BIT(7)) -#define GPIO_SIG131_IN_SEL_M (BIT(7)) -#define GPIO_SIG131_IN_SEL_V 0x1 -#define GPIO_SIG131_IN_SEL_S 7 -/* GPIO_FUNC131_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC131_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC131_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC131_IN_INV_SEL_V 0x1 -#define GPIO_FUNC131_IN_INV_SEL_S 6 -/* GPIO_FUNC131_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC131_IN_SEL 0x0000003F -#define GPIO_FUNC131_IN_SEL_M ((GPIO_FUNC131_IN_SEL_V)<<(GPIO_FUNC131_IN_SEL_S)) -#define GPIO_FUNC131_IN_SEL_V 0x3F -#define GPIO_FUNC131_IN_SEL_S 0 - -#define GPIO_FUNC132_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0340) -/* GPIO_SIG132_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG132_IN_SEL (BIT(7)) -#define GPIO_SIG132_IN_SEL_M (BIT(7)) -#define GPIO_SIG132_IN_SEL_V 0x1 -#define GPIO_SIG132_IN_SEL_S 7 -/* GPIO_FUNC132_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC132_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC132_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC132_IN_INV_SEL_V 0x1 -#define GPIO_FUNC132_IN_INV_SEL_S 6 -/* GPIO_FUNC132_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC132_IN_SEL 0x0000003F -#define GPIO_FUNC132_IN_SEL_M ((GPIO_FUNC132_IN_SEL_V)<<(GPIO_FUNC132_IN_SEL_S)) -#define GPIO_FUNC132_IN_SEL_V 0x3F -#define GPIO_FUNC132_IN_SEL_S 0 - -#define GPIO_FUNC133_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0344) -/* GPIO_SIG133_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG133_IN_SEL (BIT(7)) -#define GPIO_SIG133_IN_SEL_M (BIT(7)) -#define GPIO_SIG133_IN_SEL_V 0x1 -#define GPIO_SIG133_IN_SEL_S 7 -/* GPIO_FUNC133_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC133_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC133_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC133_IN_INV_SEL_V 0x1 -#define GPIO_FUNC133_IN_INV_SEL_S 6 -/* GPIO_FUNC133_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC133_IN_SEL 0x0000003F -#define GPIO_FUNC133_IN_SEL_M ((GPIO_FUNC133_IN_SEL_V)<<(GPIO_FUNC133_IN_SEL_S)) -#define GPIO_FUNC133_IN_SEL_V 0x3F -#define GPIO_FUNC133_IN_SEL_S 0 - -#define GPIO_FUNC134_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0348) -/* GPIO_SIG134_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG134_IN_SEL (BIT(7)) -#define GPIO_SIG134_IN_SEL_M (BIT(7)) -#define GPIO_SIG134_IN_SEL_V 0x1 -#define GPIO_SIG134_IN_SEL_S 7 -/* GPIO_FUNC134_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC134_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC134_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC134_IN_INV_SEL_V 0x1 -#define GPIO_FUNC134_IN_INV_SEL_S 6 -/* GPIO_FUNC134_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC134_IN_SEL 0x0000003F -#define GPIO_FUNC134_IN_SEL_M ((GPIO_FUNC134_IN_SEL_V)<<(GPIO_FUNC134_IN_SEL_S)) -#define GPIO_FUNC134_IN_SEL_V 0x3F -#define GPIO_FUNC134_IN_SEL_S 0 - -#define GPIO_FUNC135_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x034c) -/* GPIO_SIG135_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG135_IN_SEL (BIT(7)) -#define GPIO_SIG135_IN_SEL_M (BIT(7)) -#define GPIO_SIG135_IN_SEL_V 0x1 -#define GPIO_SIG135_IN_SEL_S 7 -/* GPIO_FUNC135_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC135_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC135_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC135_IN_INV_SEL_V 0x1 -#define GPIO_FUNC135_IN_INV_SEL_S 6 -/* GPIO_FUNC135_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC135_IN_SEL 0x0000003F -#define GPIO_FUNC135_IN_SEL_M ((GPIO_FUNC135_IN_SEL_V)<<(GPIO_FUNC135_IN_SEL_S)) -#define GPIO_FUNC135_IN_SEL_V 0x3F -#define GPIO_FUNC135_IN_SEL_S 0 - -#define GPIO_FUNC136_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0350) -/* GPIO_SIG136_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG136_IN_SEL (BIT(7)) -#define GPIO_SIG136_IN_SEL_M (BIT(7)) -#define GPIO_SIG136_IN_SEL_V 0x1 -#define GPIO_SIG136_IN_SEL_S 7 -/* GPIO_FUNC136_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC136_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC136_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC136_IN_INV_SEL_V 0x1 -#define GPIO_FUNC136_IN_INV_SEL_S 6 -/* GPIO_FUNC136_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC136_IN_SEL 0x0000003F -#define GPIO_FUNC136_IN_SEL_M ((GPIO_FUNC136_IN_SEL_V)<<(GPIO_FUNC136_IN_SEL_S)) -#define GPIO_FUNC136_IN_SEL_V 0x3F -#define GPIO_FUNC136_IN_SEL_S 0 - -#define GPIO_FUNC137_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0354) -/* GPIO_SIG137_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG137_IN_SEL (BIT(7)) -#define GPIO_SIG137_IN_SEL_M (BIT(7)) -#define GPIO_SIG137_IN_SEL_V 0x1 -#define GPIO_SIG137_IN_SEL_S 7 -/* GPIO_FUNC137_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC137_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC137_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC137_IN_INV_SEL_V 0x1 -#define GPIO_FUNC137_IN_INV_SEL_S 6 -/* GPIO_FUNC137_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC137_IN_SEL 0x0000003F -#define GPIO_FUNC137_IN_SEL_M ((GPIO_FUNC137_IN_SEL_V)<<(GPIO_FUNC137_IN_SEL_S)) -#define GPIO_FUNC137_IN_SEL_V 0x3F -#define GPIO_FUNC137_IN_SEL_S 0 - -#define GPIO_FUNC138_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0358) -/* GPIO_SIG138_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG138_IN_SEL (BIT(7)) -#define GPIO_SIG138_IN_SEL_M (BIT(7)) -#define GPIO_SIG138_IN_SEL_V 0x1 -#define GPIO_SIG138_IN_SEL_S 7 -/* GPIO_FUNC138_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC138_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC138_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC138_IN_INV_SEL_V 0x1 -#define GPIO_FUNC138_IN_INV_SEL_S 6 -/* GPIO_FUNC138_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC138_IN_SEL 0x0000003F -#define GPIO_FUNC138_IN_SEL_M ((GPIO_FUNC138_IN_SEL_V)<<(GPIO_FUNC138_IN_SEL_S)) -#define GPIO_FUNC138_IN_SEL_V 0x3F -#define GPIO_FUNC138_IN_SEL_S 0 - -#define GPIO_FUNC139_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x035c) -/* GPIO_SIG139_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG139_IN_SEL (BIT(7)) -#define GPIO_SIG139_IN_SEL_M (BIT(7)) -#define GPIO_SIG139_IN_SEL_V 0x1 -#define GPIO_SIG139_IN_SEL_S 7 -/* GPIO_FUNC139_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC139_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC139_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC139_IN_INV_SEL_V 0x1 -#define GPIO_FUNC139_IN_INV_SEL_S 6 -/* GPIO_FUNC139_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC139_IN_SEL 0x0000003F -#define GPIO_FUNC139_IN_SEL_M ((GPIO_FUNC139_IN_SEL_V)<<(GPIO_FUNC139_IN_SEL_S)) -#define GPIO_FUNC139_IN_SEL_V 0x3F -#define GPIO_FUNC139_IN_SEL_S 0 - -#define GPIO_FUNC140_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0360) -/* GPIO_SIG140_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG140_IN_SEL (BIT(7)) -#define GPIO_SIG140_IN_SEL_M (BIT(7)) -#define GPIO_SIG140_IN_SEL_V 0x1 -#define GPIO_SIG140_IN_SEL_S 7 -/* GPIO_FUNC140_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC140_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC140_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC140_IN_INV_SEL_V 0x1 -#define GPIO_FUNC140_IN_INV_SEL_S 6 -/* GPIO_FUNC140_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC140_IN_SEL 0x0000003F -#define GPIO_FUNC140_IN_SEL_M ((GPIO_FUNC140_IN_SEL_V)<<(GPIO_FUNC140_IN_SEL_S)) -#define GPIO_FUNC140_IN_SEL_V 0x3F -#define GPIO_FUNC140_IN_SEL_S 0 - -#define GPIO_FUNC141_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0364) -/* GPIO_SIG141_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG141_IN_SEL (BIT(7)) -#define GPIO_SIG141_IN_SEL_M (BIT(7)) -#define GPIO_SIG141_IN_SEL_V 0x1 -#define GPIO_SIG141_IN_SEL_S 7 -/* GPIO_FUNC141_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC141_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC141_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC141_IN_INV_SEL_V 0x1 -#define GPIO_FUNC141_IN_INV_SEL_S 6 -/* GPIO_FUNC141_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC141_IN_SEL 0x0000003F -#define GPIO_FUNC141_IN_SEL_M ((GPIO_FUNC141_IN_SEL_V)<<(GPIO_FUNC141_IN_SEL_S)) -#define GPIO_FUNC141_IN_SEL_V 0x3F -#define GPIO_FUNC141_IN_SEL_S 0 - -#define GPIO_FUNC142_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0368) -/* GPIO_SIG142_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG142_IN_SEL (BIT(7)) -#define GPIO_SIG142_IN_SEL_M (BIT(7)) -#define GPIO_SIG142_IN_SEL_V 0x1 -#define GPIO_SIG142_IN_SEL_S 7 -/* GPIO_FUNC142_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC142_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC142_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC142_IN_INV_SEL_V 0x1 -#define GPIO_FUNC142_IN_INV_SEL_S 6 -/* GPIO_FUNC142_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC142_IN_SEL 0x0000003F -#define GPIO_FUNC142_IN_SEL_M ((GPIO_FUNC142_IN_SEL_V)<<(GPIO_FUNC142_IN_SEL_S)) -#define GPIO_FUNC142_IN_SEL_V 0x3F -#define GPIO_FUNC142_IN_SEL_S 0 - -#define GPIO_FUNC143_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x036c) -/* GPIO_SIG143_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG143_IN_SEL (BIT(7)) -#define GPIO_SIG143_IN_SEL_M (BIT(7)) -#define GPIO_SIG143_IN_SEL_V 0x1 -#define GPIO_SIG143_IN_SEL_S 7 -/* GPIO_FUNC143_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC143_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC143_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC143_IN_INV_SEL_V 0x1 -#define GPIO_FUNC143_IN_INV_SEL_S 6 -/* GPIO_FUNC143_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC143_IN_SEL 0x0000003F -#define GPIO_FUNC143_IN_SEL_M ((GPIO_FUNC143_IN_SEL_V)<<(GPIO_FUNC143_IN_SEL_S)) -#define GPIO_FUNC143_IN_SEL_V 0x3F -#define GPIO_FUNC143_IN_SEL_S 0 - -#define GPIO_FUNC144_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0370) -/* GPIO_SIG144_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG144_IN_SEL (BIT(7)) -#define GPIO_SIG144_IN_SEL_M (BIT(7)) -#define GPIO_SIG144_IN_SEL_V 0x1 -#define GPIO_SIG144_IN_SEL_S 7 -/* GPIO_FUNC144_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC144_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC144_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC144_IN_INV_SEL_V 0x1 -#define GPIO_FUNC144_IN_INV_SEL_S 6 -/* GPIO_FUNC144_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC144_IN_SEL 0x0000003F -#define GPIO_FUNC144_IN_SEL_M ((GPIO_FUNC144_IN_SEL_V)<<(GPIO_FUNC144_IN_SEL_S)) -#define GPIO_FUNC144_IN_SEL_V 0x3F -#define GPIO_FUNC144_IN_SEL_S 0 - -#define GPIO_FUNC145_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0374) -/* GPIO_SIG145_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG145_IN_SEL (BIT(7)) -#define GPIO_SIG145_IN_SEL_M (BIT(7)) -#define GPIO_SIG145_IN_SEL_V 0x1 -#define GPIO_SIG145_IN_SEL_S 7 -/* GPIO_FUNC145_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC145_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC145_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC145_IN_INV_SEL_V 0x1 -#define GPIO_FUNC145_IN_INV_SEL_S 6 -/* GPIO_FUNC145_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC145_IN_SEL 0x0000003F -#define GPIO_FUNC145_IN_SEL_M ((GPIO_FUNC145_IN_SEL_V)<<(GPIO_FUNC145_IN_SEL_S)) -#define GPIO_FUNC145_IN_SEL_V 0x3F -#define GPIO_FUNC145_IN_SEL_S 0 - -#define GPIO_FUNC146_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0378) -/* GPIO_SIG146_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG146_IN_SEL (BIT(7)) -#define GPIO_SIG146_IN_SEL_M (BIT(7)) -#define GPIO_SIG146_IN_SEL_V 0x1 -#define GPIO_SIG146_IN_SEL_S 7 -/* GPIO_FUNC146_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC146_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC146_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC146_IN_INV_SEL_V 0x1 -#define GPIO_FUNC146_IN_INV_SEL_S 6 -/* GPIO_FUNC146_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC146_IN_SEL 0x0000003F -#define GPIO_FUNC146_IN_SEL_M ((GPIO_FUNC146_IN_SEL_V)<<(GPIO_FUNC146_IN_SEL_S)) -#define GPIO_FUNC146_IN_SEL_V 0x3F -#define GPIO_FUNC146_IN_SEL_S 0 - -#define GPIO_FUNC147_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x037c) -/* GPIO_SIG147_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG147_IN_SEL (BIT(7)) -#define GPIO_SIG147_IN_SEL_M (BIT(7)) -#define GPIO_SIG147_IN_SEL_V 0x1 -#define GPIO_SIG147_IN_SEL_S 7 -/* GPIO_FUNC147_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC147_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC147_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC147_IN_INV_SEL_V 0x1 -#define GPIO_FUNC147_IN_INV_SEL_S 6 -/* GPIO_FUNC147_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC147_IN_SEL 0x0000003F -#define GPIO_FUNC147_IN_SEL_M ((GPIO_FUNC147_IN_SEL_V)<<(GPIO_FUNC147_IN_SEL_S)) -#define GPIO_FUNC147_IN_SEL_V 0x3F -#define GPIO_FUNC147_IN_SEL_S 0 - -#define GPIO_FUNC148_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0380) -/* GPIO_SIG148_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG148_IN_SEL (BIT(7)) -#define GPIO_SIG148_IN_SEL_M (BIT(7)) -#define GPIO_SIG148_IN_SEL_V 0x1 -#define GPIO_SIG148_IN_SEL_S 7 -/* GPIO_FUNC148_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC148_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC148_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC148_IN_INV_SEL_V 0x1 -#define GPIO_FUNC148_IN_INV_SEL_S 6 -/* GPIO_FUNC148_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC148_IN_SEL 0x0000003F -#define GPIO_FUNC148_IN_SEL_M ((GPIO_FUNC148_IN_SEL_V)<<(GPIO_FUNC148_IN_SEL_S)) -#define GPIO_FUNC148_IN_SEL_V 0x3F -#define GPIO_FUNC148_IN_SEL_S 0 - -#define GPIO_FUNC149_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0384) -/* GPIO_SIG149_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG149_IN_SEL (BIT(7)) -#define GPIO_SIG149_IN_SEL_M (BIT(7)) -#define GPIO_SIG149_IN_SEL_V 0x1 -#define GPIO_SIG149_IN_SEL_S 7 -/* GPIO_FUNC149_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC149_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC149_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC149_IN_INV_SEL_V 0x1 -#define GPIO_FUNC149_IN_INV_SEL_S 6 -/* GPIO_FUNC149_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC149_IN_SEL 0x0000003F -#define GPIO_FUNC149_IN_SEL_M ((GPIO_FUNC149_IN_SEL_V)<<(GPIO_FUNC149_IN_SEL_S)) -#define GPIO_FUNC149_IN_SEL_V 0x3F -#define GPIO_FUNC149_IN_SEL_S 0 - -#define GPIO_FUNC150_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0388) -/* GPIO_SIG150_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG150_IN_SEL (BIT(7)) -#define GPIO_SIG150_IN_SEL_M (BIT(7)) -#define GPIO_SIG150_IN_SEL_V 0x1 -#define GPIO_SIG150_IN_SEL_S 7 -/* GPIO_FUNC150_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC150_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC150_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC150_IN_INV_SEL_V 0x1 -#define GPIO_FUNC150_IN_INV_SEL_S 6 -/* GPIO_FUNC150_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC150_IN_SEL 0x0000003F -#define GPIO_FUNC150_IN_SEL_M ((GPIO_FUNC150_IN_SEL_V)<<(GPIO_FUNC150_IN_SEL_S)) -#define GPIO_FUNC150_IN_SEL_V 0x3F -#define GPIO_FUNC150_IN_SEL_S 0 - -#define GPIO_FUNC151_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x038c) -/* GPIO_SIG151_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG151_IN_SEL (BIT(7)) -#define GPIO_SIG151_IN_SEL_M (BIT(7)) -#define GPIO_SIG151_IN_SEL_V 0x1 -#define GPIO_SIG151_IN_SEL_S 7 -/* GPIO_FUNC151_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC151_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC151_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC151_IN_INV_SEL_V 0x1 -#define GPIO_FUNC151_IN_INV_SEL_S 6 -/* GPIO_FUNC151_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC151_IN_SEL 0x0000003F -#define GPIO_FUNC151_IN_SEL_M ((GPIO_FUNC151_IN_SEL_V)<<(GPIO_FUNC151_IN_SEL_S)) -#define GPIO_FUNC151_IN_SEL_V 0x3F -#define GPIO_FUNC151_IN_SEL_S 0 - -#define GPIO_FUNC152_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0390) -/* GPIO_SIG152_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG152_IN_SEL (BIT(7)) -#define GPIO_SIG152_IN_SEL_M (BIT(7)) -#define GPIO_SIG152_IN_SEL_V 0x1 -#define GPIO_SIG152_IN_SEL_S 7 -/* GPIO_FUNC152_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC152_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC152_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC152_IN_INV_SEL_V 0x1 -#define GPIO_FUNC152_IN_INV_SEL_S 6 -/* GPIO_FUNC152_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC152_IN_SEL 0x0000003F -#define GPIO_FUNC152_IN_SEL_M ((GPIO_FUNC152_IN_SEL_V)<<(GPIO_FUNC152_IN_SEL_S)) -#define GPIO_FUNC152_IN_SEL_V 0x3F -#define GPIO_FUNC152_IN_SEL_S 0 - -#define GPIO_FUNC153_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0394) -/* GPIO_SIG153_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG153_IN_SEL (BIT(7)) -#define GPIO_SIG153_IN_SEL_M (BIT(7)) -#define GPIO_SIG153_IN_SEL_V 0x1 -#define GPIO_SIG153_IN_SEL_S 7 -/* GPIO_FUNC153_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC153_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC153_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC153_IN_INV_SEL_V 0x1 -#define GPIO_FUNC153_IN_INV_SEL_S 6 -/* GPIO_FUNC153_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC153_IN_SEL 0x0000003F -#define GPIO_FUNC153_IN_SEL_M ((GPIO_FUNC153_IN_SEL_V)<<(GPIO_FUNC153_IN_SEL_S)) -#define GPIO_FUNC153_IN_SEL_V 0x3F -#define GPIO_FUNC153_IN_SEL_S 0 - -#define GPIO_FUNC154_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0398) -/* GPIO_SIG154_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG154_IN_SEL (BIT(7)) -#define GPIO_SIG154_IN_SEL_M (BIT(7)) -#define GPIO_SIG154_IN_SEL_V 0x1 -#define GPIO_SIG154_IN_SEL_S 7 -/* GPIO_FUNC154_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC154_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC154_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC154_IN_INV_SEL_V 0x1 -#define GPIO_FUNC154_IN_INV_SEL_S 6 -/* GPIO_FUNC154_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC154_IN_SEL 0x0000003F -#define GPIO_FUNC154_IN_SEL_M ((GPIO_FUNC154_IN_SEL_V)<<(GPIO_FUNC154_IN_SEL_S)) -#define GPIO_FUNC154_IN_SEL_V 0x3F -#define GPIO_FUNC154_IN_SEL_S 0 - -#define GPIO_FUNC155_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x039c) -/* GPIO_SIG155_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG155_IN_SEL (BIT(7)) -#define GPIO_SIG155_IN_SEL_M (BIT(7)) -#define GPIO_SIG155_IN_SEL_V 0x1 -#define GPIO_SIG155_IN_SEL_S 7 -/* GPIO_FUNC155_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC155_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC155_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC155_IN_INV_SEL_V 0x1 -#define GPIO_FUNC155_IN_INV_SEL_S 6 -/* GPIO_FUNC155_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC155_IN_SEL 0x0000003F -#define GPIO_FUNC155_IN_SEL_M ((GPIO_FUNC155_IN_SEL_V)<<(GPIO_FUNC155_IN_SEL_S)) -#define GPIO_FUNC155_IN_SEL_V 0x3F -#define GPIO_FUNC155_IN_SEL_S 0 - -#define GPIO_FUNC156_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x03a0) -/* GPIO_SIG156_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG156_IN_SEL (BIT(7)) -#define GPIO_SIG156_IN_SEL_M (BIT(7)) -#define GPIO_SIG156_IN_SEL_V 0x1 -#define GPIO_SIG156_IN_SEL_S 7 -/* GPIO_FUNC156_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC156_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC156_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC156_IN_INV_SEL_V 0x1 -#define GPIO_FUNC156_IN_INV_SEL_S 6 -/* GPIO_FUNC156_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC156_IN_SEL 0x0000003F -#define GPIO_FUNC156_IN_SEL_M ((GPIO_FUNC156_IN_SEL_V)<<(GPIO_FUNC156_IN_SEL_S)) -#define GPIO_FUNC156_IN_SEL_V 0x3F -#define GPIO_FUNC156_IN_SEL_S 0 - -#define GPIO_FUNC157_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x03a4) -/* GPIO_SIG157_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG157_IN_SEL (BIT(7)) -#define GPIO_SIG157_IN_SEL_M (BIT(7)) -#define GPIO_SIG157_IN_SEL_V 0x1 -#define GPIO_SIG157_IN_SEL_S 7 -/* GPIO_FUNC157_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC157_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC157_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC157_IN_INV_SEL_V 0x1 -#define GPIO_FUNC157_IN_INV_SEL_S 6 -/* GPIO_FUNC157_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC157_IN_SEL 0x0000003F -#define GPIO_FUNC157_IN_SEL_M ((GPIO_FUNC157_IN_SEL_V)<<(GPIO_FUNC157_IN_SEL_S)) -#define GPIO_FUNC157_IN_SEL_V 0x3F -#define GPIO_FUNC157_IN_SEL_S 0 - -#define GPIO_FUNC158_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x03a8) -/* GPIO_SIG158_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG158_IN_SEL (BIT(7)) -#define GPIO_SIG158_IN_SEL_M (BIT(7)) -#define GPIO_SIG158_IN_SEL_V 0x1 -#define GPIO_SIG158_IN_SEL_S 7 -/* GPIO_FUNC158_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC158_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC158_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC158_IN_INV_SEL_V 0x1 -#define GPIO_FUNC158_IN_INV_SEL_S 6 -/* GPIO_FUNC158_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC158_IN_SEL 0x0000003F -#define GPIO_FUNC158_IN_SEL_M ((GPIO_FUNC158_IN_SEL_V)<<(GPIO_FUNC158_IN_SEL_S)) -#define GPIO_FUNC158_IN_SEL_V 0x3F -#define GPIO_FUNC158_IN_SEL_S 0 - -#define GPIO_FUNC159_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x03ac) -/* GPIO_SIG159_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG159_IN_SEL (BIT(7)) -#define GPIO_SIG159_IN_SEL_M (BIT(7)) -#define GPIO_SIG159_IN_SEL_V 0x1 -#define GPIO_SIG159_IN_SEL_S 7 -/* GPIO_FUNC159_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC159_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC159_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC159_IN_INV_SEL_V 0x1 -#define GPIO_FUNC159_IN_INV_SEL_S 6 -/* GPIO_FUNC159_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC159_IN_SEL 0x0000003F -#define GPIO_FUNC159_IN_SEL_M ((GPIO_FUNC159_IN_SEL_V)<<(GPIO_FUNC159_IN_SEL_S)) -#define GPIO_FUNC159_IN_SEL_V 0x3F -#define GPIO_FUNC159_IN_SEL_S 0 - -#define GPIO_FUNC160_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x03b0) -/* GPIO_SIG160_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG160_IN_SEL (BIT(7)) -#define GPIO_SIG160_IN_SEL_M (BIT(7)) -#define GPIO_SIG160_IN_SEL_V 0x1 -#define GPIO_SIG160_IN_SEL_S 7 -/* GPIO_FUNC160_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC160_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC160_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC160_IN_INV_SEL_V 0x1 -#define GPIO_FUNC160_IN_INV_SEL_S 6 -/* GPIO_FUNC160_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC160_IN_SEL 0x0000003F -#define GPIO_FUNC160_IN_SEL_M ((GPIO_FUNC160_IN_SEL_V)<<(GPIO_FUNC160_IN_SEL_S)) -#define GPIO_FUNC160_IN_SEL_V 0x3F -#define GPIO_FUNC160_IN_SEL_S 0 - -#define GPIO_FUNC161_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x03b4) -/* GPIO_SIG161_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG161_IN_SEL (BIT(7)) -#define GPIO_SIG161_IN_SEL_M (BIT(7)) -#define GPIO_SIG161_IN_SEL_V 0x1 -#define GPIO_SIG161_IN_SEL_S 7 -/* GPIO_FUNC161_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC161_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC161_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC161_IN_INV_SEL_V 0x1 -#define GPIO_FUNC161_IN_INV_SEL_S 6 -/* GPIO_FUNC161_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC161_IN_SEL 0x0000003F -#define GPIO_FUNC161_IN_SEL_M ((GPIO_FUNC161_IN_SEL_V)<<(GPIO_FUNC161_IN_SEL_S)) -#define GPIO_FUNC161_IN_SEL_V 0x3F -#define GPIO_FUNC161_IN_SEL_S 0 - -#define GPIO_FUNC162_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x03b8) -/* GPIO_SIG162_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG162_IN_SEL (BIT(7)) -#define GPIO_SIG162_IN_SEL_M (BIT(7)) -#define GPIO_SIG162_IN_SEL_V 0x1 -#define GPIO_SIG162_IN_SEL_S 7 -/* GPIO_FUNC162_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC162_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC162_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC162_IN_INV_SEL_V 0x1 -#define GPIO_FUNC162_IN_INV_SEL_S 6 -/* GPIO_FUNC162_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC162_IN_SEL 0x0000003F -#define GPIO_FUNC162_IN_SEL_M ((GPIO_FUNC162_IN_SEL_V)<<(GPIO_FUNC162_IN_SEL_S)) -#define GPIO_FUNC162_IN_SEL_V 0x3F -#define GPIO_FUNC162_IN_SEL_S 0 - -#define GPIO_FUNC163_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x03bc) -/* GPIO_SIG163_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG163_IN_SEL (BIT(7)) -#define GPIO_SIG163_IN_SEL_M (BIT(7)) -#define GPIO_SIG163_IN_SEL_V 0x1 -#define GPIO_SIG163_IN_SEL_S 7 -/* GPIO_FUNC163_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC163_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC163_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC163_IN_INV_SEL_V 0x1 -#define GPIO_FUNC163_IN_INV_SEL_S 6 -/* GPIO_FUNC163_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC163_IN_SEL 0x0000003F -#define GPIO_FUNC163_IN_SEL_M ((GPIO_FUNC163_IN_SEL_V)<<(GPIO_FUNC163_IN_SEL_S)) -#define GPIO_FUNC163_IN_SEL_V 0x3F -#define GPIO_FUNC163_IN_SEL_S 0 - -#define GPIO_FUNC164_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x03c0) -/* GPIO_SIG164_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG164_IN_SEL (BIT(7)) -#define GPIO_SIG164_IN_SEL_M (BIT(7)) -#define GPIO_SIG164_IN_SEL_V 0x1 -#define GPIO_SIG164_IN_SEL_S 7 -/* GPIO_FUNC164_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC164_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC164_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC164_IN_INV_SEL_V 0x1 -#define GPIO_FUNC164_IN_INV_SEL_S 6 -/* GPIO_FUNC164_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC164_IN_SEL 0x0000003F -#define GPIO_FUNC164_IN_SEL_M ((GPIO_FUNC164_IN_SEL_V)<<(GPIO_FUNC164_IN_SEL_S)) -#define GPIO_FUNC164_IN_SEL_V 0x3F -#define GPIO_FUNC164_IN_SEL_S 0 - -#define GPIO_FUNC165_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x03c4) -/* GPIO_SIG165_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG165_IN_SEL (BIT(7)) -#define GPIO_SIG165_IN_SEL_M (BIT(7)) -#define GPIO_SIG165_IN_SEL_V 0x1 -#define GPIO_SIG165_IN_SEL_S 7 -/* GPIO_FUNC165_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC165_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC165_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC165_IN_INV_SEL_V 0x1 -#define GPIO_FUNC165_IN_INV_SEL_S 6 -/* GPIO_FUNC165_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC165_IN_SEL 0x0000003F -#define GPIO_FUNC165_IN_SEL_M ((GPIO_FUNC165_IN_SEL_V)<<(GPIO_FUNC165_IN_SEL_S)) -#define GPIO_FUNC165_IN_SEL_V 0x3F -#define GPIO_FUNC165_IN_SEL_S 0 - -#define GPIO_FUNC166_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x03c8) -/* GPIO_SIG166_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG166_IN_SEL (BIT(7)) -#define GPIO_SIG166_IN_SEL_M (BIT(7)) -#define GPIO_SIG166_IN_SEL_V 0x1 -#define GPIO_SIG166_IN_SEL_S 7 -/* GPIO_FUNC166_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC166_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC166_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC166_IN_INV_SEL_V 0x1 -#define GPIO_FUNC166_IN_INV_SEL_S 6 -/* GPIO_FUNC166_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC166_IN_SEL 0x0000003F -#define GPIO_FUNC166_IN_SEL_M ((GPIO_FUNC166_IN_SEL_V)<<(GPIO_FUNC166_IN_SEL_S)) -#define GPIO_FUNC166_IN_SEL_V 0x3F -#define GPIO_FUNC166_IN_SEL_S 0 - -#define GPIO_FUNC167_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x03cc) -/* GPIO_SIG167_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG167_IN_SEL (BIT(7)) -#define GPIO_SIG167_IN_SEL_M (BIT(7)) -#define GPIO_SIG167_IN_SEL_V 0x1 -#define GPIO_SIG167_IN_SEL_S 7 -/* GPIO_FUNC167_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC167_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC167_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC167_IN_INV_SEL_V 0x1 -#define GPIO_FUNC167_IN_INV_SEL_S 6 -/* GPIO_FUNC167_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC167_IN_SEL 0x0000003F -#define GPIO_FUNC167_IN_SEL_M ((GPIO_FUNC167_IN_SEL_V)<<(GPIO_FUNC167_IN_SEL_S)) -#define GPIO_FUNC167_IN_SEL_V 0x3F -#define GPIO_FUNC167_IN_SEL_S 0 - -#define GPIO_FUNC168_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x03d0) -/* GPIO_SIG168_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG168_IN_SEL (BIT(7)) -#define GPIO_SIG168_IN_SEL_M (BIT(7)) -#define GPIO_SIG168_IN_SEL_V 0x1 -#define GPIO_SIG168_IN_SEL_S 7 -/* GPIO_FUNC168_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC168_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC168_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC168_IN_INV_SEL_V 0x1 -#define GPIO_FUNC168_IN_INV_SEL_S 6 -/* GPIO_FUNC168_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC168_IN_SEL 0x0000003F -#define GPIO_FUNC168_IN_SEL_M ((GPIO_FUNC168_IN_SEL_V)<<(GPIO_FUNC168_IN_SEL_S)) -#define GPIO_FUNC168_IN_SEL_V 0x3F -#define GPIO_FUNC168_IN_SEL_S 0 - -#define GPIO_FUNC169_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x03d4) -/* GPIO_SIG169_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG169_IN_SEL (BIT(7)) -#define GPIO_SIG169_IN_SEL_M (BIT(7)) -#define GPIO_SIG169_IN_SEL_V 0x1 -#define GPIO_SIG169_IN_SEL_S 7 -/* GPIO_FUNC169_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC169_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC169_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC169_IN_INV_SEL_V 0x1 -#define GPIO_FUNC169_IN_INV_SEL_S 6 -/* GPIO_FUNC169_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC169_IN_SEL 0x0000003F -#define GPIO_FUNC169_IN_SEL_M ((GPIO_FUNC169_IN_SEL_V)<<(GPIO_FUNC169_IN_SEL_S)) -#define GPIO_FUNC169_IN_SEL_V 0x3F -#define GPIO_FUNC169_IN_SEL_S 0 - -#define GPIO_FUNC170_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x03d8) -/* GPIO_SIG170_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG170_IN_SEL (BIT(7)) -#define GPIO_SIG170_IN_SEL_M (BIT(7)) -#define GPIO_SIG170_IN_SEL_V 0x1 -#define GPIO_SIG170_IN_SEL_S 7 -/* GPIO_FUNC170_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC170_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC170_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC170_IN_INV_SEL_V 0x1 -#define GPIO_FUNC170_IN_INV_SEL_S 6 -/* GPIO_FUNC170_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC170_IN_SEL 0x0000003F -#define GPIO_FUNC170_IN_SEL_M ((GPIO_FUNC170_IN_SEL_V)<<(GPIO_FUNC170_IN_SEL_S)) -#define GPIO_FUNC170_IN_SEL_V 0x3F -#define GPIO_FUNC170_IN_SEL_S 0 - -#define GPIO_FUNC171_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x03dc) -/* GPIO_SIG171_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG171_IN_SEL (BIT(7)) -#define GPIO_SIG171_IN_SEL_M (BIT(7)) -#define GPIO_SIG171_IN_SEL_V 0x1 -#define GPIO_SIG171_IN_SEL_S 7 -/* GPIO_FUNC171_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC171_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC171_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC171_IN_INV_SEL_V 0x1 -#define GPIO_FUNC171_IN_INV_SEL_S 6 -/* GPIO_FUNC171_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC171_IN_SEL 0x0000003F -#define GPIO_FUNC171_IN_SEL_M ((GPIO_FUNC171_IN_SEL_V)<<(GPIO_FUNC171_IN_SEL_S)) -#define GPIO_FUNC171_IN_SEL_V 0x3F -#define GPIO_FUNC171_IN_SEL_S 0 - -#define GPIO_FUNC172_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x03e0) -/* GPIO_SIG172_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG172_IN_SEL (BIT(7)) -#define GPIO_SIG172_IN_SEL_M (BIT(7)) -#define GPIO_SIG172_IN_SEL_V 0x1 -#define GPIO_SIG172_IN_SEL_S 7 -/* GPIO_FUNC172_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC172_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC172_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC172_IN_INV_SEL_V 0x1 -#define GPIO_FUNC172_IN_INV_SEL_S 6 -/* GPIO_FUNC172_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC172_IN_SEL 0x0000003F -#define GPIO_FUNC172_IN_SEL_M ((GPIO_FUNC172_IN_SEL_V)<<(GPIO_FUNC172_IN_SEL_S)) -#define GPIO_FUNC172_IN_SEL_V 0x3F -#define GPIO_FUNC172_IN_SEL_S 0 - -#define GPIO_FUNC173_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x03e4) -/* GPIO_SIG173_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG173_IN_SEL (BIT(7)) -#define GPIO_SIG173_IN_SEL_M (BIT(7)) -#define GPIO_SIG173_IN_SEL_V 0x1 -#define GPIO_SIG173_IN_SEL_S 7 -/* GPIO_FUNC173_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC173_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC173_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC173_IN_INV_SEL_V 0x1 -#define GPIO_FUNC173_IN_INV_SEL_S 6 -/* GPIO_FUNC173_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC173_IN_SEL 0x0000003F -#define GPIO_FUNC173_IN_SEL_M ((GPIO_FUNC173_IN_SEL_V)<<(GPIO_FUNC173_IN_SEL_S)) -#define GPIO_FUNC173_IN_SEL_V 0x3F -#define GPIO_FUNC173_IN_SEL_S 0 - -#define GPIO_FUNC174_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x03e8) -/* GPIO_SIG174_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG174_IN_SEL (BIT(7)) -#define GPIO_SIG174_IN_SEL_M (BIT(7)) -#define GPIO_SIG174_IN_SEL_V 0x1 -#define GPIO_SIG174_IN_SEL_S 7 -/* GPIO_FUNC174_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC174_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC174_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC174_IN_INV_SEL_V 0x1 -#define GPIO_FUNC174_IN_INV_SEL_S 6 -/* GPIO_FUNC174_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC174_IN_SEL 0x0000003F -#define GPIO_FUNC174_IN_SEL_M ((GPIO_FUNC174_IN_SEL_V)<<(GPIO_FUNC174_IN_SEL_S)) -#define GPIO_FUNC174_IN_SEL_V 0x3F -#define GPIO_FUNC174_IN_SEL_S 0 - -#define GPIO_FUNC175_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x03ec) -/* GPIO_SIG175_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG175_IN_SEL (BIT(7)) -#define GPIO_SIG175_IN_SEL_M (BIT(7)) -#define GPIO_SIG175_IN_SEL_V 0x1 -#define GPIO_SIG175_IN_SEL_S 7 -/* GPIO_FUNC175_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC175_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC175_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC175_IN_INV_SEL_V 0x1 -#define GPIO_FUNC175_IN_INV_SEL_S 6 -/* GPIO_FUNC175_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC175_IN_SEL 0x0000003F -#define GPIO_FUNC175_IN_SEL_M ((GPIO_FUNC175_IN_SEL_V)<<(GPIO_FUNC175_IN_SEL_S)) -#define GPIO_FUNC175_IN_SEL_V 0x3F -#define GPIO_FUNC175_IN_SEL_S 0 - -#define GPIO_FUNC176_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x03f0) -/* GPIO_SIG176_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG176_IN_SEL (BIT(7)) -#define GPIO_SIG176_IN_SEL_M (BIT(7)) -#define GPIO_SIG176_IN_SEL_V 0x1 -#define GPIO_SIG176_IN_SEL_S 7 -/* GPIO_FUNC176_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC176_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC176_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC176_IN_INV_SEL_V 0x1 -#define GPIO_FUNC176_IN_INV_SEL_S 6 -/* GPIO_FUNC176_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC176_IN_SEL 0x0000003F -#define GPIO_FUNC176_IN_SEL_M ((GPIO_FUNC176_IN_SEL_V)<<(GPIO_FUNC176_IN_SEL_S)) -#define GPIO_FUNC176_IN_SEL_V 0x3F -#define GPIO_FUNC176_IN_SEL_S 0 - -#define GPIO_FUNC177_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x03f4) -/* GPIO_SIG177_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG177_IN_SEL (BIT(7)) -#define GPIO_SIG177_IN_SEL_M (BIT(7)) -#define GPIO_SIG177_IN_SEL_V 0x1 -#define GPIO_SIG177_IN_SEL_S 7 -/* GPIO_FUNC177_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC177_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC177_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC177_IN_INV_SEL_V 0x1 -#define GPIO_FUNC177_IN_INV_SEL_S 6 -/* GPIO_FUNC177_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC177_IN_SEL 0x0000003F -#define GPIO_FUNC177_IN_SEL_M ((GPIO_FUNC177_IN_SEL_V)<<(GPIO_FUNC177_IN_SEL_S)) -#define GPIO_FUNC177_IN_SEL_V 0x3F -#define GPIO_FUNC177_IN_SEL_S 0 - -#define GPIO_FUNC178_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x03f8) -/* GPIO_SIG178_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG178_IN_SEL (BIT(7)) -#define GPIO_SIG178_IN_SEL_M (BIT(7)) -#define GPIO_SIG178_IN_SEL_V 0x1 -#define GPIO_SIG178_IN_SEL_S 7 -/* GPIO_FUNC178_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC178_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC178_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC178_IN_INV_SEL_V 0x1 -#define GPIO_FUNC178_IN_INV_SEL_S 6 -/* GPIO_FUNC178_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC178_IN_SEL 0x0000003F -#define GPIO_FUNC178_IN_SEL_M ((GPIO_FUNC178_IN_SEL_V)<<(GPIO_FUNC178_IN_SEL_S)) -#define GPIO_FUNC178_IN_SEL_V 0x3F -#define GPIO_FUNC178_IN_SEL_S 0 - -#define GPIO_FUNC179_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x03fc) -/* GPIO_SIG179_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG179_IN_SEL (BIT(7)) -#define GPIO_SIG179_IN_SEL_M (BIT(7)) -#define GPIO_SIG179_IN_SEL_V 0x1 -#define GPIO_SIG179_IN_SEL_S 7 -/* GPIO_FUNC179_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC179_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC179_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC179_IN_INV_SEL_V 0x1 -#define GPIO_FUNC179_IN_INV_SEL_S 6 -/* GPIO_FUNC179_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC179_IN_SEL 0x0000003F -#define GPIO_FUNC179_IN_SEL_M ((GPIO_FUNC179_IN_SEL_V)<<(GPIO_FUNC179_IN_SEL_S)) -#define GPIO_FUNC179_IN_SEL_V 0x3F -#define GPIO_FUNC179_IN_SEL_S 0 - -#define GPIO_FUNC180_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0400) -/* GPIO_SIG180_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG180_IN_SEL (BIT(7)) -#define GPIO_SIG180_IN_SEL_M (BIT(7)) -#define GPIO_SIG180_IN_SEL_V 0x1 -#define GPIO_SIG180_IN_SEL_S 7 -/* GPIO_FUNC180_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC180_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC180_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC180_IN_INV_SEL_V 0x1 -#define GPIO_FUNC180_IN_INV_SEL_S 6 -/* GPIO_FUNC180_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC180_IN_SEL 0x0000003F -#define GPIO_FUNC180_IN_SEL_M ((GPIO_FUNC180_IN_SEL_V)<<(GPIO_FUNC180_IN_SEL_S)) -#define GPIO_FUNC180_IN_SEL_V 0x3F -#define GPIO_FUNC180_IN_SEL_S 0 - -#define GPIO_FUNC181_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0404) -/* GPIO_SIG181_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG181_IN_SEL (BIT(7)) -#define GPIO_SIG181_IN_SEL_M (BIT(7)) -#define GPIO_SIG181_IN_SEL_V 0x1 -#define GPIO_SIG181_IN_SEL_S 7 -/* GPIO_FUNC181_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC181_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC181_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC181_IN_INV_SEL_V 0x1 -#define GPIO_FUNC181_IN_INV_SEL_S 6 -/* GPIO_FUNC181_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC181_IN_SEL 0x0000003F -#define GPIO_FUNC181_IN_SEL_M ((GPIO_FUNC181_IN_SEL_V)<<(GPIO_FUNC181_IN_SEL_S)) -#define GPIO_FUNC181_IN_SEL_V 0x3F -#define GPIO_FUNC181_IN_SEL_S 0 - -#define GPIO_FUNC182_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0408) -/* GPIO_SIG182_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG182_IN_SEL (BIT(7)) -#define GPIO_SIG182_IN_SEL_M (BIT(7)) -#define GPIO_SIG182_IN_SEL_V 0x1 -#define GPIO_SIG182_IN_SEL_S 7 -/* GPIO_FUNC182_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC182_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC182_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC182_IN_INV_SEL_V 0x1 -#define GPIO_FUNC182_IN_INV_SEL_S 6 -/* GPIO_FUNC182_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC182_IN_SEL 0x0000003F -#define GPIO_FUNC182_IN_SEL_M ((GPIO_FUNC182_IN_SEL_V)<<(GPIO_FUNC182_IN_SEL_S)) -#define GPIO_FUNC182_IN_SEL_V 0x3F -#define GPIO_FUNC182_IN_SEL_S 0 - -#define GPIO_FUNC183_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x040c) -/* GPIO_SIG183_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG183_IN_SEL (BIT(7)) -#define GPIO_SIG183_IN_SEL_M (BIT(7)) -#define GPIO_SIG183_IN_SEL_V 0x1 -#define GPIO_SIG183_IN_SEL_S 7 -/* GPIO_FUNC183_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC183_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC183_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC183_IN_INV_SEL_V 0x1 -#define GPIO_FUNC183_IN_INV_SEL_S 6 -/* GPIO_FUNC183_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC183_IN_SEL 0x0000003F -#define GPIO_FUNC183_IN_SEL_M ((GPIO_FUNC183_IN_SEL_V)<<(GPIO_FUNC183_IN_SEL_S)) -#define GPIO_FUNC183_IN_SEL_V 0x3F -#define GPIO_FUNC183_IN_SEL_S 0 - -#define GPIO_FUNC184_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0410) -/* GPIO_SIG184_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG184_IN_SEL (BIT(7)) -#define GPIO_SIG184_IN_SEL_M (BIT(7)) -#define GPIO_SIG184_IN_SEL_V 0x1 -#define GPIO_SIG184_IN_SEL_S 7 -/* GPIO_FUNC184_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC184_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC184_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC184_IN_INV_SEL_V 0x1 -#define GPIO_FUNC184_IN_INV_SEL_S 6 -/* GPIO_FUNC184_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC184_IN_SEL 0x0000003F -#define GPIO_FUNC184_IN_SEL_M ((GPIO_FUNC184_IN_SEL_V)<<(GPIO_FUNC184_IN_SEL_S)) -#define GPIO_FUNC184_IN_SEL_V 0x3F -#define GPIO_FUNC184_IN_SEL_S 0 - -#define GPIO_FUNC185_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0414) -/* GPIO_SIG185_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG185_IN_SEL (BIT(7)) -#define GPIO_SIG185_IN_SEL_M (BIT(7)) -#define GPIO_SIG185_IN_SEL_V 0x1 -#define GPIO_SIG185_IN_SEL_S 7 -/* GPIO_FUNC185_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC185_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC185_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC185_IN_INV_SEL_V 0x1 -#define GPIO_FUNC185_IN_INV_SEL_S 6 -/* GPIO_FUNC185_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC185_IN_SEL 0x0000003F -#define GPIO_FUNC185_IN_SEL_M ((GPIO_FUNC185_IN_SEL_V)<<(GPIO_FUNC185_IN_SEL_S)) -#define GPIO_FUNC185_IN_SEL_V 0x3F -#define GPIO_FUNC185_IN_SEL_S 0 - -#define GPIO_FUNC186_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0418) -/* GPIO_SIG186_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG186_IN_SEL (BIT(7)) -#define GPIO_SIG186_IN_SEL_M (BIT(7)) -#define GPIO_SIG186_IN_SEL_V 0x1 -#define GPIO_SIG186_IN_SEL_S 7 -/* GPIO_FUNC186_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC186_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC186_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC186_IN_INV_SEL_V 0x1 -#define GPIO_FUNC186_IN_INV_SEL_S 6 -/* GPIO_FUNC186_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC186_IN_SEL 0x0000003F -#define GPIO_FUNC186_IN_SEL_M ((GPIO_FUNC186_IN_SEL_V)<<(GPIO_FUNC186_IN_SEL_S)) -#define GPIO_FUNC186_IN_SEL_V 0x3F -#define GPIO_FUNC186_IN_SEL_S 0 - -#define GPIO_FUNC187_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x041c) -/* GPIO_SIG187_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG187_IN_SEL (BIT(7)) -#define GPIO_SIG187_IN_SEL_M (BIT(7)) -#define GPIO_SIG187_IN_SEL_V 0x1 -#define GPIO_SIG187_IN_SEL_S 7 -/* GPIO_FUNC187_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC187_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC187_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC187_IN_INV_SEL_V 0x1 -#define GPIO_FUNC187_IN_INV_SEL_S 6 -/* GPIO_FUNC187_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC187_IN_SEL 0x0000003F -#define GPIO_FUNC187_IN_SEL_M ((GPIO_FUNC187_IN_SEL_V)<<(GPIO_FUNC187_IN_SEL_S)) -#define GPIO_FUNC187_IN_SEL_V 0x3F -#define GPIO_FUNC187_IN_SEL_S 0 - -#define GPIO_FUNC188_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0420) -/* GPIO_SIG188_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG188_IN_SEL (BIT(7)) -#define GPIO_SIG188_IN_SEL_M (BIT(7)) -#define GPIO_SIG188_IN_SEL_V 0x1 -#define GPIO_SIG188_IN_SEL_S 7 -/* GPIO_FUNC188_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC188_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC188_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC188_IN_INV_SEL_V 0x1 -#define GPIO_FUNC188_IN_INV_SEL_S 6 -/* GPIO_FUNC188_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC188_IN_SEL 0x0000003F -#define GPIO_FUNC188_IN_SEL_M ((GPIO_FUNC188_IN_SEL_V)<<(GPIO_FUNC188_IN_SEL_S)) -#define GPIO_FUNC188_IN_SEL_V 0x3F -#define GPIO_FUNC188_IN_SEL_S 0 - -#define GPIO_FUNC189_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0424) -/* GPIO_SIG189_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG189_IN_SEL (BIT(7)) -#define GPIO_SIG189_IN_SEL_M (BIT(7)) -#define GPIO_SIG189_IN_SEL_V 0x1 -#define GPIO_SIG189_IN_SEL_S 7 -/* GPIO_FUNC189_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC189_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC189_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC189_IN_INV_SEL_V 0x1 -#define GPIO_FUNC189_IN_INV_SEL_S 6 -/* GPIO_FUNC189_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC189_IN_SEL 0x0000003F -#define GPIO_FUNC189_IN_SEL_M ((GPIO_FUNC189_IN_SEL_V)<<(GPIO_FUNC189_IN_SEL_S)) -#define GPIO_FUNC189_IN_SEL_V 0x3F -#define GPIO_FUNC189_IN_SEL_S 0 - -#define GPIO_FUNC190_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0428) -/* GPIO_SIG190_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG190_IN_SEL (BIT(7)) -#define GPIO_SIG190_IN_SEL_M (BIT(7)) -#define GPIO_SIG190_IN_SEL_V 0x1 -#define GPIO_SIG190_IN_SEL_S 7 -/* GPIO_FUNC190_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC190_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC190_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC190_IN_INV_SEL_V 0x1 -#define GPIO_FUNC190_IN_INV_SEL_S 6 -/* GPIO_FUNC190_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC190_IN_SEL 0x0000003F -#define GPIO_FUNC190_IN_SEL_M ((GPIO_FUNC190_IN_SEL_V)<<(GPIO_FUNC190_IN_SEL_S)) -#define GPIO_FUNC190_IN_SEL_V 0x3F -#define GPIO_FUNC190_IN_SEL_S 0 - -#define GPIO_FUNC191_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x042c) -/* GPIO_SIG191_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG191_IN_SEL (BIT(7)) -#define GPIO_SIG191_IN_SEL_M (BIT(7)) -#define GPIO_SIG191_IN_SEL_V 0x1 -#define GPIO_SIG191_IN_SEL_S 7 -/* GPIO_FUNC191_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC191_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC191_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC191_IN_INV_SEL_V 0x1 -#define GPIO_FUNC191_IN_INV_SEL_S 6 -/* GPIO_FUNC191_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC191_IN_SEL 0x0000003F -#define GPIO_FUNC191_IN_SEL_M ((GPIO_FUNC191_IN_SEL_V)<<(GPIO_FUNC191_IN_SEL_S)) -#define GPIO_FUNC191_IN_SEL_V 0x3F -#define GPIO_FUNC191_IN_SEL_S 0 - -#define GPIO_FUNC192_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0430) -/* GPIO_SIG192_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG192_IN_SEL (BIT(7)) -#define GPIO_SIG192_IN_SEL_M (BIT(7)) -#define GPIO_SIG192_IN_SEL_V 0x1 -#define GPIO_SIG192_IN_SEL_S 7 -/* GPIO_FUNC192_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC192_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC192_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC192_IN_INV_SEL_V 0x1 -#define GPIO_FUNC192_IN_INV_SEL_S 6 -/* GPIO_FUNC192_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC192_IN_SEL 0x0000003F -#define GPIO_FUNC192_IN_SEL_M ((GPIO_FUNC192_IN_SEL_V)<<(GPIO_FUNC192_IN_SEL_S)) -#define GPIO_FUNC192_IN_SEL_V 0x3F -#define GPIO_FUNC192_IN_SEL_S 0 - -#define GPIO_FUNC193_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0434) -/* GPIO_SIG193_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG193_IN_SEL (BIT(7)) -#define GPIO_SIG193_IN_SEL_M (BIT(7)) -#define GPIO_SIG193_IN_SEL_V 0x1 -#define GPIO_SIG193_IN_SEL_S 7 -/* GPIO_FUNC193_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC193_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC193_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC193_IN_INV_SEL_V 0x1 -#define GPIO_FUNC193_IN_INV_SEL_S 6 -/* GPIO_FUNC193_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC193_IN_SEL 0x0000003F -#define GPIO_FUNC193_IN_SEL_M ((GPIO_FUNC193_IN_SEL_V)<<(GPIO_FUNC193_IN_SEL_S)) -#define GPIO_FUNC193_IN_SEL_V 0x3F -#define GPIO_FUNC193_IN_SEL_S 0 - -#define GPIO_FUNC194_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0438) -/* GPIO_SIG194_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG194_IN_SEL (BIT(7)) -#define GPIO_SIG194_IN_SEL_M (BIT(7)) -#define GPIO_SIG194_IN_SEL_V 0x1 -#define GPIO_SIG194_IN_SEL_S 7 -/* GPIO_FUNC194_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC194_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC194_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC194_IN_INV_SEL_V 0x1 -#define GPIO_FUNC194_IN_INV_SEL_S 6 -/* GPIO_FUNC194_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC194_IN_SEL 0x0000003F -#define GPIO_FUNC194_IN_SEL_M ((GPIO_FUNC194_IN_SEL_V)<<(GPIO_FUNC194_IN_SEL_S)) -#define GPIO_FUNC194_IN_SEL_V 0x3F -#define GPIO_FUNC194_IN_SEL_S 0 - -#define GPIO_FUNC195_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x043c) -/* GPIO_SIG195_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG195_IN_SEL (BIT(7)) -#define GPIO_SIG195_IN_SEL_M (BIT(7)) -#define GPIO_SIG195_IN_SEL_V 0x1 -#define GPIO_SIG195_IN_SEL_S 7 -/* GPIO_FUNC195_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC195_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC195_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC195_IN_INV_SEL_V 0x1 -#define GPIO_FUNC195_IN_INV_SEL_S 6 -/* GPIO_FUNC195_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC195_IN_SEL 0x0000003F -#define GPIO_FUNC195_IN_SEL_M ((GPIO_FUNC195_IN_SEL_V)<<(GPIO_FUNC195_IN_SEL_S)) -#define GPIO_FUNC195_IN_SEL_V 0x3F -#define GPIO_FUNC195_IN_SEL_S 0 - -#define GPIO_FUNC196_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0440) -/* GPIO_SIG196_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG196_IN_SEL (BIT(7)) -#define GPIO_SIG196_IN_SEL_M (BIT(7)) -#define GPIO_SIG196_IN_SEL_V 0x1 -#define GPIO_SIG196_IN_SEL_S 7 -/* GPIO_FUNC196_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC196_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC196_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC196_IN_INV_SEL_V 0x1 -#define GPIO_FUNC196_IN_INV_SEL_S 6 -/* GPIO_FUNC196_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC196_IN_SEL 0x0000003F -#define GPIO_FUNC196_IN_SEL_M ((GPIO_FUNC196_IN_SEL_V)<<(GPIO_FUNC196_IN_SEL_S)) -#define GPIO_FUNC196_IN_SEL_V 0x3F -#define GPIO_FUNC196_IN_SEL_S 0 - -#define GPIO_FUNC197_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0444) -/* GPIO_SIG197_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG197_IN_SEL (BIT(7)) -#define GPIO_SIG197_IN_SEL_M (BIT(7)) -#define GPIO_SIG197_IN_SEL_V 0x1 -#define GPIO_SIG197_IN_SEL_S 7 -/* GPIO_FUNC197_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC197_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC197_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC197_IN_INV_SEL_V 0x1 -#define GPIO_FUNC197_IN_INV_SEL_S 6 -/* GPIO_FUNC197_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC197_IN_SEL 0x0000003F -#define GPIO_FUNC197_IN_SEL_M ((GPIO_FUNC197_IN_SEL_V)<<(GPIO_FUNC197_IN_SEL_S)) -#define GPIO_FUNC197_IN_SEL_V 0x3F -#define GPIO_FUNC197_IN_SEL_S 0 - -#define GPIO_FUNC198_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0448) -/* GPIO_SIG198_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG198_IN_SEL (BIT(7)) -#define GPIO_SIG198_IN_SEL_M (BIT(7)) -#define GPIO_SIG198_IN_SEL_V 0x1 -#define GPIO_SIG198_IN_SEL_S 7 -/* GPIO_FUNC198_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC198_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC198_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC198_IN_INV_SEL_V 0x1 -#define GPIO_FUNC198_IN_INV_SEL_S 6 -/* GPIO_FUNC198_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC198_IN_SEL 0x0000003F -#define GPIO_FUNC198_IN_SEL_M ((GPIO_FUNC198_IN_SEL_V)<<(GPIO_FUNC198_IN_SEL_S)) -#define GPIO_FUNC198_IN_SEL_V 0x3F -#define GPIO_FUNC198_IN_SEL_S 0 - -#define GPIO_FUNC199_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x044c) -/* GPIO_SIG199_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG199_IN_SEL (BIT(7)) -#define GPIO_SIG199_IN_SEL_M (BIT(7)) -#define GPIO_SIG199_IN_SEL_V 0x1 -#define GPIO_SIG199_IN_SEL_S 7 -/* GPIO_FUNC199_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC199_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC199_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC199_IN_INV_SEL_V 0x1 -#define GPIO_FUNC199_IN_INV_SEL_S 6 -/* GPIO_FUNC199_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC199_IN_SEL 0x0000003F -#define GPIO_FUNC199_IN_SEL_M ((GPIO_FUNC199_IN_SEL_V)<<(GPIO_FUNC199_IN_SEL_S)) -#define GPIO_FUNC199_IN_SEL_V 0x3F -#define GPIO_FUNC199_IN_SEL_S 0 - -#define GPIO_FUNC200_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0450) -/* GPIO_SIG200_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG200_IN_SEL (BIT(7)) -#define GPIO_SIG200_IN_SEL_M (BIT(7)) -#define GPIO_SIG200_IN_SEL_V 0x1 -#define GPIO_SIG200_IN_SEL_S 7 -/* GPIO_FUNC200_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC200_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC200_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC200_IN_INV_SEL_V 0x1 -#define GPIO_FUNC200_IN_INV_SEL_S 6 -/* GPIO_FUNC200_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC200_IN_SEL 0x0000003F -#define GPIO_FUNC200_IN_SEL_M ((GPIO_FUNC200_IN_SEL_V)<<(GPIO_FUNC200_IN_SEL_S)) -#define GPIO_FUNC200_IN_SEL_V 0x3F -#define GPIO_FUNC200_IN_SEL_S 0 - -#define GPIO_FUNC201_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0454) -/* GPIO_SIG201_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG201_IN_SEL (BIT(7)) -#define GPIO_SIG201_IN_SEL_M (BIT(7)) -#define GPIO_SIG201_IN_SEL_V 0x1 -#define GPIO_SIG201_IN_SEL_S 7 -/* GPIO_FUNC201_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC201_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC201_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC201_IN_INV_SEL_V 0x1 -#define GPIO_FUNC201_IN_INV_SEL_S 6 -/* GPIO_FUNC201_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC201_IN_SEL 0x0000003F -#define GPIO_FUNC201_IN_SEL_M ((GPIO_FUNC201_IN_SEL_V)<<(GPIO_FUNC201_IN_SEL_S)) -#define GPIO_FUNC201_IN_SEL_V 0x3F -#define GPIO_FUNC201_IN_SEL_S 0 - -#define GPIO_FUNC202_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0458) -/* GPIO_SIG202_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG202_IN_SEL (BIT(7)) -#define GPIO_SIG202_IN_SEL_M (BIT(7)) -#define GPIO_SIG202_IN_SEL_V 0x1 -#define GPIO_SIG202_IN_SEL_S 7 -/* GPIO_FUNC202_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC202_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC202_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC202_IN_INV_SEL_V 0x1 -#define GPIO_FUNC202_IN_INV_SEL_S 6 -/* GPIO_FUNC202_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC202_IN_SEL 0x0000003F -#define GPIO_FUNC202_IN_SEL_M ((GPIO_FUNC202_IN_SEL_V)<<(GPIO_FUNC202_IN_SEL_S)) -#define GPIO_FUNC202_IN_SEL_V 0x3F -#define GPIO_FUNC202_IN_SEL_S 0 - -#define GPIO_FUNC203_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x045c) -/* GPIO_SIG203_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG203_IN_SEL (BIT(7)) -#define GPIO_SIG203_IN_SEL_M (BIT(7)) -#define GPIO_SIG203_IN_SEL_V 0x1 -#define GPIO_SIG203_IN_SEL_S 7 -/* GPIO_FUNC203_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC203_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC203_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC203_IN_INV_SEL_V 0x1 -#define GPIO_FUNC203_IN_INV_SEL_S 6 -/* GPIO_FUNC203_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC203_IN_SEL 0x0000003F -#define GPIO_FUNC203_IN_SEL_M ((GPIO_FUNC203_IN_SEL_V)<<(GPIO_FUNC203_IN_SEL_S)) -#define GPIO_FUNC203_IN_SEL_V 0x3F -#define GPIO_FUNC203_IN_SEL_S 0 - -#define GPIO_FUNC204_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0460) -/* GPIO_SIG204_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG204_IN_SEL (BIT(7)) -#define GPIO_SIG204_IN_SEL_M (BIT(7)) -#define GPIO_SIG204_IN_SEL_V 0x1 -#define GPIO_SIG204_IN_SEL_S 7 -/* GPIO_FUNC204_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC204_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC204_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC204_IN_INV_SEL_V 0x1 -#define GPIO_FUNC204_IN_INV_SEL_S 6 -/* GPIO_FUNC204_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC204_IN_SEL 0x0000003F -#define GPIO_FUNC204_IN_SEL_M ((GPIO_FUNC204_IN_SEL_V)<<(GPIO_FUNC204_IN_SEL_S)) -#define GPIO_FUNC204_IN_SEL_V 0x3F -#define GPIO_FUNC204_IN_SEL_S 0 - -#define GPIO_FUNC205_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0464) -/* GPIO_SIG205_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG205_IN_SEL (BIT(7)) -#define GPIO_SIG205_IN_SEL_M (BIT(7)) -#define GPIO_SIG205_IN_SEL_V 0x1 -#define GPIO_SIG205_IN_SEL_S 7 -/* GPIO_FUNC205_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC205_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC205_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC205_IN_INV_SEL_V 0x1 -#define GPIO_FUNC205_IN_INV_SEL_S 6 -/* GPIO_FUNC205_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC205_IN_SEL 0x0000003F -#define GPIO_FUNC205_IN_SEL_M ((GPIO_FUNC205_IN_SEL_V)<<(GPIO_FUNC205_IN_SEL_S)) -#define GPIO_FUNC205_IN_SEL_V 0x3F -#define GPIO_FUNC205_IN_SEL_S 0 - -#define GPIO_FUNC206_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0468) -/* GPIO_SIG206_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG206_IN_SEL (BIT(7)) -#define GPIO_SIG206_IN_SEL_M (BIT(7)) -#define GPIO_SIG206_IN_SEL_V 0x1 -#define GPIO_SIG206_IN_SEL_S 7 -/* GPIO_FUNC206_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC206_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC206_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC206_IN_INV_SEL_V 0x1 -#define GPIO_FUNC206_IN_INV_SEL_S 6 -/* GPIO_FUNC206_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC206_IN_SEL 0x0000003F -#define GPIO_FUNC206_IN_SEL_M ((GPIO_FUNC206_IN_SEL_V)<<(GPIO_FUNC206_IN_SEL_S)) -#define GPIO_FUNC206_IN_SEL_V 0x3F -#define GPIO_FUNC206_IN_SEL_S 0 - -#define GPIO_FUNC207_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x046c) -/* GPIO_SIG207_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG207_IN_SEL (BIT(7)) -#define GPIO_SIG207_IN_SEL_M (BIT(7)) -#define GPIO_SIG207_IN_SEL_V 0x1 -#define GPIO_SIG207_IN_SEL_S 7 -/* GPIO_FUNC207_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC207_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC207_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC207_IN_INV_SEL_V 0x1 -#define GPIO_FUNC207_IN_INV_SEL_S 6 -/* GPIO_FUNC207_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC207_IN_SEL 0x0000003F -#define GPIO_FUNC207_IN_SEL_M ((GPIO_FUNC207_IN_SEL_V)<<(GPIO_FUNC207_IN_SEL_S)) -#define GPIO_FUNC207_IN_SEL_V 0x3F -#define GPIO_FUNC207_IN_SEL_S 0 - -#define GPIO_FUNC208_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0470) -/* GPIO_SIG208_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG208_IN_SEL (BIT(7)) -#define GPIO_SIG208_IN_SEL_M (BIT(7)) -#define GPIO_SIG208_IN_SEL_V 0x1 -#define GPIO_SIG208_IN_SEL_S 7 -/* GPIO_FUNC208_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC208_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC208_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC208_IN_INV_SEL_V 0x1 -#define GPIO_FUNC208_IN_INV_SEL_S 6 -/* GPIO_FUNC208_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC208_IN_SEL 0x0000003F -#define GPIO_FUNC208_IN_SEL_M ((GPIO_FUNC208_IN_SEL_V)<<(GPIO_FUNC208_IN_SEL_S)) -#define GPIO_FUNC208_IN_SEL_V 0x3F -#define GPIO_FUNC208_IN_SEL_S 0 - -#define GPIO_FUNC209_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0474) -/* GPIO_SIG209_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG209_IN_SEL (BIT(7)) -#define GPIO_SIG209_IN_SEL_M (BIT(7)) -#define GPIO_SIG209_IN_SEL_V 0x1 -#define GPIO_SIG209_IN_SEL_S 7 -/* GPIO_FUNC209_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC209_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC209_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC209_IN_INV_SEL_V 0x1 -#define GPIO_FUNC209_IN_INV_SEL_S 6 -/* GPIO_FUNC209_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC209_IN_SEL 0x0000003F -#define GPIO_FUNC209_IN_SEL_M ((GPIO_FUNC209_IN_SEL_V)<<(GPIO_FUNC209_IN_SEL_S)) -#define GPIO_FUNC209_IN_SEL_V 0x3F -#define GPIO_FUNC209_IN_SEL_S 0 - -#define GPIO_FUNC210_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0478) -/* GPIO_SIG210_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG210_IN_SEL (BIT(7)) -#define GPIO_SIG210_IN_SEL_M (BIT(7)) -#define GPIO_SIG210_IN_SEL_V 0x1 -#define GPIO_SIG210_IN_SEL_S 7 -/* GPIO_FUNC210_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC210_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC210_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC210_IN_INV_SEL_V 0x1 -#define GPIO_FUNC210_IN_INV_SEL_S 6 -/* GPIO_FUNC210_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC210_IN_SEL 0x0000003F -#define GPIO_FUNC210_IN_SEL_M ((GPIO_FUNC210_IN_SEL_V)<<(GPIO_FUNC210_IN_SEL_S)) -#define GPIO_FUNC210_IN_SEL_V 0x3F -#define GPIO_FUNC210_IN_SEL_S 0 - -#define GPIO_FUNC211_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x047c) -/* GPIO_SIG211_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG211_IN_SEL (BIT(7)) -#define GPIO_SIG211_IN_SEL_M (BIT(7)) -#define GPIO_SIG211_IN_SEL_V 0x1 -#define GPIO_SIG211_IN_SEL_S 7 -/* GPIO_FUNC211_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC211_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC211_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC211_IN_INV_SEL_V 0x1 -#define GPIO_FUNC211_IN_INV_SEL_S 6 -/* GPIO_FUNC211_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC211_IN_SEL 0x0000003F -#define GPIO_FUNC211_IN_SEL_M ((GPIO_FUNC211_IN_SEL_V)<<(GPIO_FUNC211_IN_SEL_S)) -#define GPIO_FUNC211_IN_SEL_V 0x3F -#define GPIO_FUNC211_IN_SEL_S 0 - -#define GPIO_FUNC212_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0480) -/* GPIO_SIG212_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG212_IN_SEL (BIT(7)) -#define GPIO_SIG212_IN_SEL_M (BIT(7)) -#define GPIO_SIG212_IN_SEL_V 0x1 -#define GPIO_SIG212_IN_SEL_S 7 -/* GPIO_FUNC212_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC212_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC212_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC212_IN_INV_SEL_V 0x1 -#define GPIO_FUNC212_IN_INV_SEL_S 6 -/* GPIO_FUNC212_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC212_IN_SEL 0x0000003F -#define GPIO_FUNC212_IN_SEL_M ((GPIO_FUNC212_IN_SEL_V)<<(GPIO_FUNC212_IN_SEL_S)) -#define GPIO_FUNC212_IN_SEL_V 0x3F -#define GPIO_FUNC212_IN_SEL_S 0 - -#define GPIO_FUNC213_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0484) -/* GPIO_SIG213_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG213_IN_SEL (BIT(7)) -#define GPIO_SIG213_IN_SEL_M (BIT(7)) -#define GPIO_SIG213_IN_SEL_V 0x1 -#define GPIO_SIG213_IN_SEL_S 7 -/* GPIO_FUNC213_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC213_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC213_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC213_IN_INV_SEL_V 0x1 -#define GPIO_FUNC213_IN_INV_SEL_S 6 -/* GPIO_FUNC213_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC213_IN_SEL 0x0000003F -#define GPIO_FUNC213_IN_SEL_M ((GPIO_FUNC213_IN_SEL_V)<<(GPIO_FUNC213_IN_SEL_S)) -#define GPIO_FUNC213_IN_SEL_V 0x3F -#define GPIO_FUNC213_IN_SEL_S 0 - -#define GPIO_FUNC214_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0488) -/* GPIO_SIG214_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG214_IN_SEL (BIT(7)) -#define GPIO_SIG214_IN_SEL_M (BIT(7)) -#define GPIO_SIG214_IN_SEL_V 0x1 -#define GPIO_SIG214_IN_SEL_S 7 -/* GPIO_FUNC214_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC214_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC214_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC214_IN_INV_SEL_V 0x1 -#define GPIO_FUNC214_IN_INV_SEL_S 6 -/* GPIO_FUNC214_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC214_IN_SEL 0x0000003F -#define GPIO_FUNC214_IN_SEL_M ((GPIO_FUNC214_IN_SEL_V)<<(GPIO_FUNC214_IN_SEL_S)) -#define GPIO_FUNC214_IN_SEL_V 0x3F -#define GPIO_FUNC214_IN_SEL_S 0 - -#define GPIO_FUNC215_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x048c) -/* GPIO_SIG215_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG215_IN_SEL (BIT(7)) -#define GPIO_SIG215_IN_SEL_M (BIT(7)) -#define GPIO_SIG215_IN_SEL_V 0x1 -#define GPIO_SIG215_IN_SEL_S 7 -/* GPIO_FUNC215_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC215_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC215_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC215_IN_INV_SEL_V 0x1 -#define GPIO_FUNC215_IN_INV_SEL_S 6 -/* GPIO_FUNC215_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC215_IN_SEL 0x0000003F -#define GPIO_FUNC215_IN_SEL_M ((GPIO_FUNC215_IN_SEL_V)<<(GPIO_FUNC215_IN_SEL_S)) -#define GPIO_FUNC215_IN_SEL_V 0x3F -#define GPIO_FUNC215_IN_SEL_S 0 - -#define GPIO_FUNC216_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0490) -/* GPIO_SIG216_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG216_IN_SEL (BIT(7)) -#define GPIO_SIG216_IN_SEL_M (BIT(7)) -#define GPIO_SIG216_IN_SEL_V 0x1 -#define GPIO_SIG216_IN_SEL_S 7 -/* GPIO_FUNC216_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC216_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC216_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC216_IN_INV_SEL_V 0x1 -#define GPIO_FUNC216_IN_INV_SEL_S 6 -/* GPIO_FUNC216_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC216_IN_SEL 0x0000003F -#define GPIO_FUNC216_IN_SEL_M ((GPIO_FUNC216_IN_SEL_V)<<(GPIO_FUNC216_IN_SEL_S)) -#define GPIO_FUNC216_IN_SEL_V 0x3F -#define GPIO_FUNC216_IN_SEL_S 0 - -#define GPIO_FUNC217_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0494) -/* GPIO_SIG217_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG217_IN_SEL (BIT(7)) -#define GPIO_SIG217_IN_SEL_M (BIT(7)) -#define GPIO_SIG217_IN_SEL_V 0x1 -#define GPIO_SIG217_IN_SEL_S 7 -/* GPIO_FUNC217_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC217_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC217_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC217_IN_INV_SEL_V 0x1 -#define GPIO_FUNC217_IN_INV_SEL_S 6 -/* GPIO_FUNC217_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC217_IN_SEL 0x0000003F -#define GPIO_FUNC217_IN_SEL_M ((GPIO_FUNC217_IN_SEL_V)<<(GPIO_FUNC217_IN_SEL_S)) -#define GPIO_FUNC217_IN_SEL_V 0x3F -#define GPIO_FUNC217_IN_SEL_S 0 - -#define GPIO_FUNC218_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0498) -/* GPIO_SIG218_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG218_IN_SEL (BIT(7)) -#define GPIO_SIG218_IN_SEL_M (BIT(7)) -#define GPIO_SIG218_IN_SEL_V 0x1 -#define GPIO_SIG218_IN_SEL_S 7 -/* GPIO_FUNC218_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC218_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC218_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC218_IN_INV_SEL_V 0x1 -#define GPIO_FUNC218_IN_INV_SEL_S 6 -/* GPIO_FUNC218_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC218_IN_SEL 0x0000003F -#define GPIO_FUNC218_IN_SEL_M ((GPIO_FUNC218_IN_SEL_V)<<(GPIO_FUNC218_IN_SEL_S)) -#define GPIO_FUNC218_IN_SEL_V 0x3F -#define GPIO_FUNC218_IN_SEL_S 0 - -#define GPIO_FUNC219_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x049c) -/* GPIO_SIG219_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG219_IN_SEL (BIT(7)) -#define GPIO_SIG219_IN_SEL_M (BIT(7)) -#define GPIO_SIG219_IN_SEL_V 0x1 -#define GPIO_SIG219_IN_SEL_S 7 -/* GPIO_FUNC219_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC219_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC219_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC219_IN_INV_SEL_V 0x1 -#define GPIO_FUNC219_IN_INV_SEL_S 6 -/* GPIO_FUNC219_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC219_IN_SEL 0x0000003F -#define GPIO_FUNC219_IN_SEL_M ((GPIO_FUNC219_IN_SEL_V)<<(GPIO_FUNC219_IN_SEL_S)) -#define GPIO_FUNC219_IN_SEL_V 0x3F -#define GPIO_FUNC219_IN_SEL_S 0 - -#define GPIO_FUNC220_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x04a0) -/* GPIO_SIG220_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG220_IN_SEL (BIT(7)) -#define GPIO_SIG220_IN_SEL_M (BIT(7)) -#define GPIO_SIG220_IN_SEL_V 0x1 -#define GPIO_SIG220_IN_SEL_S 7 -/* GPIO_FUNC220_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC220_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC220_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC220_IN_INV_SEL_V 0x1 -#define GPIO_FUNC220_IN_INV_SEL_S 6 -/* GPIO_FUNC220_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC220_IN_SEL 0x0000003F -#define GPIO_FUNC220_IN_SEL_M ((GPIO_FUNC220_IN_SEL_V)<<(GPIO_FUNC220_IN_SEL_S)) -#define GPIO_FUNC220_IN_SEL_V 0x3F -#define GPIO_FUNC220_IN_SEL_S 0 - -#define GPIO_FUNC221_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x04a4) -/* GPIO_SIG221_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG221_IN_SEL (BIT(7)) -#define GPIO_SIG221_IN_SEL_M (BIT(7)) -#define GPIO_SIG221_IN_SEL_V 0x1 -#define GPIO_SIG221_IN_SEL_S 7 -/* GPIO_FUNC221_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC221_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC221_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC221_IN_INV_SEL_V 0x1 -#define GPIO_FUNC221_IN_INV_SEL_S 6 -/* GPIO_FUNC221_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC221_IN_SEL 0x0000003F -#define GPIO_FUNC221_IN_SEL_M ((GPIO_FUNC221_IN_SEL_V)<<(GPIO_FUNC221_IN_SEL_S)) -#define GPIO_FUNC221_IN_SEL_V 0x3F -#define GPIO_FUNC221_IN_SEL_S 0 - -#define GPIO_FUNC222_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x04a8) -/* GPIO_SIG222_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG222_IN_SEL (BIT(7)) -#define GPIO_SIG222_IN_SEL_M (BIT(7)) -#define GPIO_SIG222_IN_SEL_V 0x1 -#define GPIO_SIG222_IN_SEL_S 7 -/* GPIO_FUNC222_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC222_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC222_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC222_IN_INV_SEL_V 0x1 -#define GPIO_FUNC222_IN_INV_SEL_S 6 -/* GPIO_FUNC222_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC222_IN_SEL 0x0000003F -#define GPIO_FUNC222_IN_SEL_M ((GPIO_FUNC222_IN_SEL_V)<<(GPIO_FUNC222_IN_SEL_S)) -#define GPIO_FUNC222_IN_SEL_V 0x3F -#define GPIO_FUNC222_IN_SEL_S 0 - -#define GPIO_FUNC223_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x04ac) -/* GPIO_SIG223_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG223_IN_SEL (BIT(7)) -#define GPIO_SIG223_IN_SEL_M (BIT(7)) -#define GPIO_SIG223_IN_SEL_V 0x1 -#define GPIO_SIG223_IN_SEL_S 7 -/* GPIO_FUNC223_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC223_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC223_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC223_IN_INV_SEL_V 0x1 -#define GPIO_FUNC223_IN_INV_SEL_S 6 -/* GPIO_FUNC223_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC223_IN_SEL 0x0000003F -#define GPIO_FUNC223_IN_SEL_M ((GPIO_FUNC223_IN_SEL_V)<<(GPIO_FUNC223_IN_SEL_S)) -#define GPIO_FUNC223_IN_SEL_V 0x3F -#define GPIO_FUNC223_IN_SEL_S 0 - -#define GPIO_FUNC224_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x04b0) -/* GPIO_SIG224_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG224_IN_SEL (BIT(7)) -#define GPIO_SIG224_IN_SEL_M (BIT(7)) -#define GPIO_SIG224_IN_SEL_V 0x1 -#define GPIO_SIG224_IN_SEL_S 7 -/* GPIO_FUNC224_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC224_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC224_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC224_IN_INV_SEL_V 0x1 -#define GPIO_FUNC224_IN_INV_SEL_S 6 -/* GPIO_FUNC224_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC224_IN_SEL 0x0000003F -#define GPIO_FUNC224_IN_SEL_M ((GPIO_FUNC224_IN_SEL_V)<<(GPIO_FUNC224_IN_SEL_S)) -#define GPIO_FUNC224_IN_SEL_V 0x3F -#define GPIO_FUNC224_IN_SEL_S 0 - -#define GPIO_FUNC225_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x04b4) -/* GPIO_SIG225_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG225_IN_SEL (BIT(7)) -#define GPIO_SIG225_IN_SEL_M (BIT(7)) -#define GPIO_SIG225_IN_SEL_V 0x1 -#define GPIO_SIG225_IN_SEL_S 7 -/* GPIO_FUNC225_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC225_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC225_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC225_IN_INV_SEL_V 0x1 -#define GPIO_FUNC225_IN_INV_SEL_S 6 -/* GPIO_FUNC225_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC225_IN_SEL 0x0000003F -#define GPIO_FUNC225_IN_SEL_M ((GPIO_FUNC225_IN_SEL_V)<<(GPIO_FUNC225_IN_SEL_S)) -#define GPIO_FUNC225_IN_SEL_V 0x3F -#define GPIO_FUNC225_IN_SEL_S 0 - -#define GPIO_FUNC226_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x04b8) -/* GPIO_SIG226_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG226_IN_SEL (BIT(7)) -#define GPIO_SIG226_IN_SEL_M (BIT(7)) -#define GPIO_SIG226_IN_SEL_V 0x1 -#define GPIO_SIG226_IN_SEL_S 7 -/* GPIO_FUNC226_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC226_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC226_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC226_IN_INV_SEL_V 0x1 -#define GPIO_FUNC226_IN_INV_SEL_S 6 -/* GPIO_FUNC226_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC226_IN_SEL 0x0000003F -#define GPIO_FUNC226_IN_SEL_M ((GPIO_FUNC226_IN_SEL_V)<<(GPIO_FUNC226_IN_SEL_S)) -#define GPIO_FUNC226_IN_SEL_V 0x3F -#define GPIO_FUNC226_IN_SEL_S 0 - -#define GPIO_FUNC227_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x04bc) -/* GPIO_SIG227_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG227_IN_SEL (BIT(7)) -#define GPIO_SIG227_IN_SEL_M (BIT(7)) -#define GPIO_SIG227_IN_SEL_V 0x1 -#define GPIO_SIG227_IN_SEL_S 7 -/* GPIO_FUNC227_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC227_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC227_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC227_IN_INV_SEL_V 0x1 -#define GPIO_FUNC227_IN_INV_SEL_S 6 -/* GPIO_FUNC227_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC227_IN_SEL 0x0000003F -#define GPIO_FUNC227_IN_SEL_M ((GPIO_FUNC227_IN_SEL_V)<<(GPIO_FUNC227_IN_SEL_S)) -#define GPIO_FUNC227_IN_SEL_V 0x3F -#define GPIO_FUNC227_IN_SEL_S 0 - -#define GPIO_FUNC228_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x04c0) -/* GPIO_SIG228_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG228_IN_SEL (BIT(7)) -#define GPIO_SIG228_IN_SEL_M (BIT(7)) -#define GPIO_SIG228_IN_SEL_V 0x1 -#define GPIO_SIG228_IN_SEL_S 7 -/* GPIO_FUNC228_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC228_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC228_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC228_IN_INV_SEL_V 0x1 -#define GPIO_FUNC228_IN_INV_SEL_S 6 -/* GPIO_FUNC228_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC228_IN_SEL 0x0000003F -#define GPIO_FUNC228_IN_SEL_M ((GPIO_FUNC228_IN_SEL_V)<<(GPIO_FUNC228_IN_SEL_S)) -#define GPIO_FUNC228_IN_SEL_V 0x3F -#define GPIO_FUNC228_IN_SEL_S 0 - -#define GPIO_FUNC229_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x04c4) -/* GPIO_SIG229_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG229_IN_SEL (BIT(7)) -#define GPIO_SIG229_IN_SEL_M (BIT(7)) -#define GPIO_SIG229_IN_SEL_V 0x1 -#define GPIO_SIG229_IN_SEL_S 7 -/* GPIO_FUNC229_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC229_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC229_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC229_IN_INV_SEL_V 0x1 -#define GPIO_FUNC229_IN_INV_SEL_S 6 -/* GPIO_FUNC229_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC229_IN_SEL 0x0000003F -#define GPIO_FUNC229_IN_SEL_M ((GPIO_FUNC229_IN_SEL_V)<<(GPIO_FUNC229_IN_SEL_S)) -#define GPIO_FUNC229_IN_SEL_V 0x3F -#define GPIO_FUNC229_IN_SEL_S 0 - -#define GPIO_FUNC230_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x04c8) -/* GPIO_SIG230_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG230_IN_SEL (BIT(7)) -#define GPIO_SIG230_IN_SEL_M (BIT(7)) -#define GPIO_SIG230_IN_SEL_V 0x1 -#define GPIO_SIG230_IN_SEL_S 7 -/* GPIO_FUNC230_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC230_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC230_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC230_IN_INV_SEL_V 0x1 -#define GPIO_FUNC230_IN_INV_SEL_S 6 -/* GPIO_FUNC230_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC230_IN_SEL 0x0000003F -#define GPIO_FUNC230_IN_SEL_M ((GPIO_FUNC230_IN_SEL_V)<<(GPIO_FUNC230_IN_SEL_S)) -#define GPIO_FUNC230_IN_SEL_V 0x3F -#define GPIO_FUNC230_IN_SEL_S 0 - -#define GPIO_FUNC231_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x04cc) -/* GPIO_SIG231_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG231_IN_SEL (BIT(7)) -#define GPIO_SIG231_IN_SEL_M (BIT(7)) -#define GPIO_SIG231_IN_SEL_V 0x1 -#define GPIO_SIG231_IN_SEL_S 7 -/* GPIO_FUNC231_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC231_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC231_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC231_IN_INV_SEL_V 0x1 -#define GPIO_FUNC231_IN_INV_SEL_S 6 -/* GPIO_FUNC231_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC231_IN_SEL 0x0000003F -#define GPIO_FUNC231_IN_SEL_M ((GPIO_FUNC231_IN_SEL_V)<<(GPIO_FUNC231_IN_SEL_S)) -#define GPIO_FUNC231_IN_SEL_V 0x3F -#define GPIO_FUNC231_IN_SEL_S 0 - -#define GPIO_FUNC232_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x04d0) -/* GPIO_SIG232_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG232_IN_SEL (BIT(7)) -#define GPIO_SIG232_IN_SEL_M (BIT(7)) -#define GPIO_SIG232_IN_SEL_V 0x1 -#define GPIO_SIG232_IN_SEL_S 7 -/* GPIO_FUNC232_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC232_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC232_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC232_IN_INV_SEL_V 0x1 -#define GPIO_FUNC232_IN_INV_SEL_S 6 -/* GPIO_FUNC232_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC232_IN_SEL 0x0000003F -#define GPIO_FUNC232_IN_SEL_M ((GPIO_FUNC232_IN_SEL_V)<<(GPIO_FUNC232_IN_SEL_S)) -#define GPIO_FUNC232_IN_SEL_V 0x3F -#define GPIO_FUNC232_IN_SEL_S 0 - -#define GPIO_FUNC233_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x04d4) -/* GPIO_SIG233_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG233_IN_SEL (BIT(7)) -#define GPIO_SIG233_IN_SEL_M (BIT(7)) -#define GPIO_SIG233_IN_SEL_V 0x1 -#define GPIO_SIG233_IN_SEL_S 7 -/* GPIO_FUNC233_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC233_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC233_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC233_IN_INV_SEL_V 0x1 -#define GPIO_FUNC233_IN_INV_SEL_S 6 -/* GPIO_FUNC233_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC233_IN_SEL 0x0000003F -#define GPIO_FUNC233_IN_SEL_M ((GPIO_FUNC233_IN_SEL_V)<<(GPIO_FUNC233_IN_SEL_S)) -#define GPIO_FUNC233_IN_SEL_V 0x3F -#define GPIO_FUNC233_IN_SEL_S 0 - -#define GPIO_FUNC234_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x04d8) -/* GPIO_SIG234_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG234_IN_SEL (BIT(7)) -#define GPIO_SIG234_IN_SEL_M (BIT(7)) -#define GPIO_SIG234_IN_SEL_V 0x1 -#define GPIO_SIG234_IN_SEL_S 7 -/* GPIO_FUNC234_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC234_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC234_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC234_IN_INV_SEL_V 0x1 -#define GPIO_FUNC234_IN_INV_SEL_S 6 -/* GPIO_FUNC234_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC234_IN_SEL 0x0000003F -#define GPIO_FUNC234_IN_SEL_M ((GPIO_FUNC234_IN_SEL_V)<<(GPIO_FUNC234_IN_SEL_S)) -#define GPIO_FUNC234_IN_SEL_V 0x3F -#define GPIO_FUNC234_IN_SEL_S 0 - -#define GPIO_FUNC235_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x04dc) -/* GPIO_SIG235_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG235_IN_SEL (BIT(7)) -#define GPIO_SIG235_IN_SEL_M (BIT(7)) -#define GPIO_SIG235_IN_SEL_V 0x1 -#define GPIO_SIG235_IN_SEL_S 7 -/* GPIO_FUNC235_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC235_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC235_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC235_IN_INV_SEL_V 0x1 -#define GPIO_FUNC235_IN_INV_SEL_S 6 -/* GPIO_FUNC235_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC235_IN_SEL 0x0000003F -#define GPIO_FUNC235_IN_SEL_M ((GPIO_FUNC235_IN_SEL_V)<<(GPIO_FUNC235_IN_SEL_S)) -#define GPIO_FUNC235_IN_SEL_V 0x3F -#define GPIO_FUNC235_IN_SEL_S 0 - -#define GPIO_FUNC236_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x04e0) -/* GPIO_SIG236_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG236_IN_SEL (BIT(7)) -#define GPIO_SIG236_IN_SEL_M (BIT(7)) -#define GPIO_SIG236_IN_SEL_V 0x1 -#define GPIO_SIG236_IN_SEL_S 7 -/* GPIO_FUNC236_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC236_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC236_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC236_IN_INV_SEL_V 0x1 -#define GPIO_FUNC236_IN_INV_SEL_S 6 -/* GPIO_FUNC236_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC236_IN_SEL 0x0000003F -#define GPIO_FUNC236_IN_SEL_M ((GPIO_FUNC236_IN_SEL_V)<<(GPIO_FUNC236_IN_SEL_S)) -#define GPIO_FUNC236_IN_SEL_V 0x3F -#define GPIO_FUNC236_IN_SEL_S 0 - -#define GPIO_FUNC237_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x04e4) -/* GPIO_SIG237_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG237_IN_SEL (BIT(7)) -#define GPIO_SIG237_IN_SEL_M (BIT(7)) -#define GPIO_SIG237_IN_SEL_V 0x1 -#define GPIO_SIG237_IN_SEL_S 7 -/* GPIO_FUNC237_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC237_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC237_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC237_IN_INV_SEL_V 0x1 -#define GPIO_FUNC237_IN_INV_SEL_S 6 -/* GPIO_FUNC237_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC237_IN_SEL 0x0000003F -#define GPIO_FUNC237_IN_SEL_M ((GPIO_FUNC237_IN_SEL_V)<<(GPIO_FUNC237_IN_SEL_S)) -#define GPIO_FUNC237_IN_SEL_V 0x3F -#define GPIO_FUNC237_IN_SEL_S 0 - -#define GPIO_FUNC238_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x04e8) -/* GPIO_SIG238_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG238_IN_SEL (BIT(7)) -#define GPIO_SIG238_IN_SEL_M (BIT(7)) -#define GPIO_SIG238_IN_SEL_V 0x1 -#define GPIO_SIG238_IN_SEL_S 7 -/* GPIO_FUNC238_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC238_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC238_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC238_IN_INV_SEL_V 0x1 -#define GPIO_FUNC238_IN_INV_SEL_S 6 -/* GPIO_FUNC238_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC238_IN_SEL 0x0000003F -#define GPIO_FUNC238_IN_SEL_M ((GPIO_FUNC238_IN_SEL_V)<<(GPIO_FUNC238_IN_SEL_S)) -#define GPIO_FUNC238_IN_SEL_V 0x3F -#define GPIO_FUNC238_IN_SEL_S 0 - -#define GPIO_FUNC239_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x04ec) -/* GPIO_SIG239_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG239_IN_SEL (BIT(7)) -#define GPIO_SIG239_IN_SEL_M (BIT(7)) -#define GPIO_SIG239_IN_SEL_V 0x1 -#define GPIO_SIG239_IN_SEL_S 7 -/* GPIO_FUNC239_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC239_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC239_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC239_IN_INV_SEL_V 0x1 -#define GPIO_FUNC239_IN_INV_SEL_S 6 -/* GPIO_FUNC239_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC239_IN_SEL 0x0000003F -#define GPIO_FUNC239_IN_SEL_M ((GPIO_FUNC239_IN_SEL_V)<<(GPIO_FUNC239_IN_SEL_S)) -#define GPIO_FUNC239_IN_SEL_V 0x3F -#define GPIO_FUNC239_IN_SEL_S 0 - -#define GPIO_FUNC240_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x04f0) -/* GPIO_SIG240_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG240_IN_SEL (BIT(7)) -#define GPIO_SIG240_IN_SEL_M (BIT(7)) -#define GPIO_SIG240_IN_SEL_V 0x1 -#define GPIO_SIG240_IN_SEL_S 7 -/* GPIO_FUNC240_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC240_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC240_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC240_IN_INV_SEL_V 0x1 -#define GPIO_FUNC240_IN_INV_SEL_S 6 -/* GPIO_FUNC240_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC240_IN_SEL 0x0000003F -#define GPIO_FUNC240_IN_SEL_M ((GPIO_FUNC240_IN_SEL_V)<<(GPIO_FUNC240_IN_SEL_S)) -#define GPIO_FUNC240_IN_SEL_V 0x3F -#define GPIO_FUNC240_IN_SEL_S 0 - -#define GPIO_FUNC241_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x04f4) -/* GPIO_SIG241_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG241_IN_SEL (BIT(7)) -#define GPIO_SIG241_IN_SEL_M (BIT(7)) -#define GPIO_SIG241_IN_SEL_V 0x1 -#define GPIO_SIG241_IN_SEL_S 7 -/* GPIO_FUNC241_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC241_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC241_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC241_IN_INV_SEL_V 0x1 -#define GPIO_FUNC241_IN_INV_SEL_S 6 -/* GPIO_FUNC241_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC241_IN_SEL 0x0000003F -#define GPIO_FUNC241_IN_SEL_M ((GPIO_FUNC241_IN_SEL_V)<<(GPIO_FUNC241_IN_SEL_S)) -#define GPIO_FUNC241_IN_SEL_V 0x3F -#define GPIO_FUNC241_IN_SEL_S 0 - -#define GPIO_FUNC242_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x04f8) -/* GPIO_SIG242_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG242_IN_SEL (BIT(7)) -#define GPIO_SIG242_IN_SEL_M (BIT(7)) -#define GPIO_SIG242_IN_SEL_V 0x1 -#define GPIO_SIG242_IN_SEL_S 7 -/* GPIO_FUNC242_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC242_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC242_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC242_IN_INV_SEL_V 0x1 -#define GPIO_FUNC242_IN_INV_SEL_S 6 -/* GPIO_FUNC242_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC242_IN_SEL 0x0000003F -#define GPIO_FUNC242_IN_SEL_M ((GPIO_FUNC242_IN_SEL_V)<<(GPIO_FUNC242_IN_SEL_S)) -#define GPIO_FUNC242_IN_SEL_V 0x3F -#define GPIO_FUNC242_IN_SEL_S 0 - -#define GPIO_FUNC243_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x04fc) -/* GPIO_SIG243_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG243_IN_SEL (BIT(7)) -#define GPIO_SIG243_IN_SEL_M (BIT(7)) -#define GPIO_SIG243_IN_SEL_V 0x1 -#define GPIO_SIG243_IN_SEL_S 7 -/* GPIO_FUNC243_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC243_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC243_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC243_IN_INV_SEL_V 0x1 -#define GPIO_FUNC243_IN_INV_SEL_S 6 -/* GPIO_FUNC243_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC243_IN_SEL 0x0000003F -#define GPIO_FUNC243_IN_SEL_M ((GPIO_FUNC243_IN_SEL_V)<<(GPIO_FUNC243_IN_SEL_S)) -#define GPIO_FUNC243_IN_SEL_V 0x3F -#define GPIO_FUNC243_IN_SEL_S 0 - -#define GPIO_FUNC244_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0500) -/* GPIO_SIG244_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG244_IN_SEL (BIT(7)) -#define GPIO_SIG244_IN_SEL_M (BIT(7)) -#define GPIO_SIG244_IN_SEL_V 0x1 -#define GPIO_SIG244_IN_SEL_S 7 -/* GPIO_FUNC244_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC244_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC244_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC244_IN_INV_SEL_V 0x1 -#define GPIO_FUNC244_IN_INV_SEL_S 6 -/* GPIO_FUNC244_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC244_IN_SEL 0x0000003F -#define GPIO_FUNC244_IN_SEL_M ((GPIO_FUNC244_IN_SEL_V)<<(GPIO_FUNC244_IN_SEL_S)) -#define GPIO_FUNC244_IN_SEL_V 0x3F -#define GPIO_FUNC244_IN_SEL_S 0 - -#define GPIO_FUNC245_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0504) -/* GPIO_SIG245_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG245_IN_SEL (BIT(7)) -#define GPIO_SIG245_IN_SEL_M (BIT(7)) -#define GPIO_SIG245_IN_SEL_V 0x1 -#define GPIO_SIG245_IN_SEL_S 7 -/* GPIO_FUNC245_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC245_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC245_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC245_IN_INV_SEL_V 0x1 -#define GPIO_FUNC245_IN_INV_SEL_S 6 -/* GPIO_FUNC245_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC245_IN_SEL 0x0000003F -#define GPIO_FUNC245_IN_SEL_M ((GPIO_FUNC245_IN_SEL_V)<<(GPIO_FUNC245_IN_SEL_S)) -#define GPIO_FUNC245_IN_SEL_V 0x3F -#define GPIO_FUNC245_IN_SEL_S 0 - -#define GPIO_FUNC246_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0508) -/* GPIO_SIG246_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG246_IN_SEL (BIT(7)) -#define GPIO_SIG246_IN_SEL_M (BIT(7)) -#define GPIO_SIG246_IN_SEL_V 0x1 -#define GPIO_SIG246_IN_SEL_S 7 -/* GPIO_FUNC246_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC246_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC246_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC246_IN_INV_SEL_V 0x1 -#define GPIO_FUNC246_IN_INV_SEL_S 6 -/* GPIO_FUNC246_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC246_IN_SEL 0x0000003F -#define GPIO_FUNC246_IN_SEL_M ((GPIO_FUNC246_IN_SEL_V)<<(GPIO_FUNC246_IN_SEL_S)) -#define GPIO_FUNC246_IN_SEL_V 0x3F -#define GPIO_FUNC246_IN_SEL_S 0 - -#define GPIO_FUNC247_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x050c) -/* GPIO_SIG247_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG247_IN_SEL (BIT(7)) -#define GPIO_SIG247_IN_SEL_M (BIT(7)) -#define GPIO_SIG247_IN_SEL_V 0x1 -#define GPIO_SIG247_IN_SEL_S 7 -/* GPIO_FUNC247_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC247_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC247_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC247_IN_INV_SEL_V 0x1 -#define GPIO_FUNC247_IN_INV_SEL_S 6 -/* GPIO_FUNC247_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC247_IN_SEL 0x0000003F -#define GPIO_FUNC247_IN_SEL_M ((GPIO_FUNC247_IN_SEL_V)<<(GPIO_FUNC247_IN_SEL_S)) -#define GPIO_FUNC247_IN_SEL_V 0x3F -#define GPIO_FUNC247_IN_SEL_S 0 - -#define GPIO_FUNC248_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0510) -/* GPIO_SIG248_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG248_IN_SEL (BIT(7)) -#define GPIO_SIG248_IN_SEL_M (BIT(7)) -#define GPIO_SIG248_IN_SEL_V 0x1 -#define GPIO_SIG248_IN_SEL_S 7 -/* GPIO_FUNC248_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC248_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC248_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC248_IN_INV_SEL_V 0x1 -#define GPIO_FUNC248_IN_INV_SEL_S 6 -/* GPIO_FUNC248_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC248_IN_SEL 0x0000003F -#define GPIO_FUNC248_IN_SEL_M ((GPIO_FUNC248_IN_SEL_V)<<(GPIO_FUNC248_IN_SEL_S)) -#define GPIO_FUNC248_IN_SEL_V 0x3F -#define GPIO_FUNC248_IN_SEL_S 0 - -#define GPIO_FUNC249_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0514) -/* GPIO_SIG249_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG249_IN_SEL (BIT(7)) -#define GPIO_SIG249_IN_SEL_M (BIT(7)) -#define GPIO_SIG249_IN_SEL_V 0x1 -#define GPIO_SIG249_IN_SEL_S 7 -/* GPIO_FUNC249_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC249_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC249_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC249_IN_INV_SEL_V 0x1 -#define GPIO_FUNC249_IN_INV_SEL_S 6 -/* GPIO_FUNC249_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC249_IN_SEL 0x0000003F -#define GPIO_FUNC249_IN_SEL_M ((GPIO_FUNC249_IN_SEL_V)<<(GPIO_FUNC249_IN_SEL_S)) -#define GPIO_FUNC249_IN_SEL_V 0x3F -#define GPIO_FUNC249_IN_SEL_S 0 - -#define GPIO_FUNC250_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0518) -/* GPIO_SIG250_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG250_IN_SEL (BIT(7)) -#define GPIO_SIG250_IN_SEL_M (BIT(7)) -#define GPIO_SIG250_IN_SEL_V 0x1 -#define GPIO_SIG250_IN_SEL_S 7 -/* GPIO_FUNC250_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC250_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC250_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC250_IN_INV_SEL_V 0x1 -#define GPIO_FUNC250_IN_INV_SEL_S 6 -/* GPIO_FUNC250_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC250_IN_SEL 0x0000003F -#define GPIO_FUNC250_IN_SEL_M ((GPIO_FUNC250_IN_SEL_V)<<(GPIO_FUNC250_IN_SEL_S)) -#define GPIO_FUNC250_IN_SEL_V 0x3F -#define GPIO_FUNC250_IN_SEL_S 0 - -#define GPIO_FUNC251_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x051c) -/* GPIO_SIG251_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG251_IN_SEL (BIT(7)) -#define GPIO_SIG251_IN_SEL_M (BIT(7)) -#define GPIO_SIG251_IN_SEL_V 0x1 -#define GPIO_SIG251_IN_SEL_S 7 -/* GPIO_FUNC251_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC251_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC251_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC251_IN_INV_SEL_V 0x1 -#define GPIO_FUNC251_IN_INV_SEL_S 6 -/* GPIO_FUNC251_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC251_IN_SEL 0x0000003F -#define GPIO_FUNC251_IN_SEL_M ((GPIO_FUNC251_IN_SEL_V)<<(GPIO_FUNC251_IN_SEL_S)) -#define GPIO_FUNC251_IN_SEL_V 0x3F -#define GPIO_FUNC251_IN_SEL_S 0 - -#define GPIO_FUNC252_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0520) -/* GPIO_SIG252_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG252_IN_SEL (BIT(7)) -#define GPIO_SIG252_IN_SEL_M (BIT(7)) -#define GPIO_SIG252_IN_SEL_V 0x1 -#define GPIO_SIG252_IN_SEL_S 7 -/* GPIO_FUNC252_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC252_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC252_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC252_IN_INV_SEL_V 0x1 -#define GPIO_FUNC252_IN_INV_SEL_S 6 -/* GPIO_FUNC252_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC252_IN_SEL 0x0000003F -#define GPIO_FUNC252_IN_SEL_M ((GPIO_FUNC252_IN_SEL_V)<<(GPIO_FUNC252_IN_SEL_S)) -#define GPIO_FUNC252_IN_SEL_V 0x3F -#define GPIO_FUNC252_IN_SEL_S 0 - -#define GPIO_FUNC253_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0524) -/* GPIO_SIG253_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG253_IN_SEL (BIT(7)) -#define GPIO_SIG253_IN_SEL_M (BIT(7)) -#define GPIO_SIG253_IN_SEL_V 0x1 -#define GPIO_SIG253_IN_SEL_S 7 -/* GPIO_FUNC253_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC253_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC253_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC253_IN_INV_SEL_V 0x1 -#define GPIO_FUNC253_IN_INV_SEL_S 6 -/* GPIO_FUNC253_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC253_IN_SEL 0x0000003F -#define GPIO_FUNC253_IN_SEL_M ((GPIO_FUNC253_IN_SEL_V)<<(GPIO_FUNC253_IN_SEL_S)) -#define GPIO_FUNC253_IN_SEL_V 0x3F -#define GPIO_FUNC253_IN_SEL_S 0 - -#define GPIO_FUNC254_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0528) -/* GPIO_SIG254_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG254_IN_SEL (BIT(7)) -#define GPIO_SIG254_IN_SEL_M (BIT(7)) -#define GPIO_SIG254_IN_SEL_V 0x1 -#define GPIO_SIG254_IN_SEL_S 7 -/* GPIO_FUNC254_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC254_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC254_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC254_IN_INV_SEL_V 0x1 -#define GPIO_FUNC254_IN_INV_SEL_S 6 -/* GPIO_FUNC254_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC254_IN_SEL 0x0000003F -#define GPIO_FUNC254_IN_SEL_M ((GPIO_FUNC254_IN_SEL_V)<<(GPIO_FUNC254_IN_SEL_S)) -#define GPIO_FUNC254_IN_SEL_V 0x3F -#define GPIO_FUNC254_IN_SEL_S 0 - -#define GPIO_FUNC255_IN_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x052c) -/* GPIO_SIG255_IN_SEL : R/W ;bitpos:[7] ;default: x ; */ -/*description: if the slow signal bypass the io matrix or not if you want setting - the value to 1*/ -#define GPIO_SIG255_IN_SEL (BIT(7)) -#define GPIO_SIG255_IN_SEL_M (BIT(7)) -#define GPIO_SIG255_IN_SEL_V 0x1 -#define GPIO_SIG255_IN_SEL_S 7 -/* GPIO_FUNC255_IN_INV_SEL : R/W ;bitpos:[6] ;default: x ; */ -/*description: revert the value of the input if you want to revert please set the value to 1*/ -#define GPIO_FUNC255_IN_INV_SEL (BIT(6)) -#define GPIO_FUNC255_IN_INV_SEL_M (BIT(6)) -#define GPIO_FUNC255_IN_INV_SEL_V 0x1 -#define GPIO_FUNC255_IN_INV_SEL_S 6 -/* GPIO_FUNC255_IN_SEL : R/W ;bitpos:[5:0] ;default: x ; */ -/*description: select one of the 256 inputs*/ -#define GPIO_FUNC255_IN_SEL 0x0000003F -#define GPIO_FUNC255_IN_SEL_M ((GPIO_FUNC255_IN_SEL_V)<<(GPIO_FUNC255_IN_SEL_S)) -#define GPIO_FUNC255_IN_SEL_V 0x3F -#define GPIO_FUNC255_IN_SEL_S 0 - -#define GPIO_FUNC0_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0530) -/* GPIO_FUNC0_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC0_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC0_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC0_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC0_OEN_INV_SEL_S 11 -/* GPIO_FUNC0_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC0_OEN_SEL (BIT(10)) -#define GPIO_FUNC0_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC0_OEN_SEL_V 0x1 -#define GPIO_FUNC0_OEN_SEL_S 10 -/* GPIO_FUNC0_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC0_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC0_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC0_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC0_OUT_INV_SEL_S 9 -/* GPIO_FUNC0_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC0_OUT_SEL 0x000001FF -#define GPIO_FUNC0_OUT_SEL_M ((GPIO_FUNC0_OUT_SEL_V)<<(GPIO_FUNC0_OUT_SEL_S)) -#define GPIO_FUNC0_OUT_SEL_V 0x1FF -#define GPIO_FUNC0_OUT_SEL_S 0 - -#define GPIO_FUNC1_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0534) -/* GPIO_FUNC1_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC1_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC1_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC1_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC1_OEN_INV_SEL_S 11 -/* GPIO_FUNC1_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC1_OEN_SEL (BIT(10)) -#define GPIO_FUNC1_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC1_OEN_SEL_V 0x1 -#define GPIO_FUNC1_OEN_SEL_S 10 -/* GPIO_FUNC1_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC1_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC1_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC1_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC1_OUT_INV_SEL_S 9 -/* GPIO_FUNC1_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC1_OUT_SEL 0x000001FF -#define GPIO_FUNC1_OUT_SEL_M ((GPIO_FUNC1_OUT_SEL_V)<<(GPIO_FUNC1_OUT_SEL_S)) -#define GPIO_FUNC1_OUT_SEL_V 0x1FF -#define GPIO_FUNC1_OUT_SEL_S 0 - -#define GPIO_FUNC2_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0538) -/* GPIO_FUNC2_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC2_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC2_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC2_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC2_OEN_INV_SEL_S 11 -/* GPIO_FUNC2_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC2_OEN_SEL (BIT(10)) -#define GPIO_FUNC2_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC2_OEN_SEL_V 0x1 -#define GPIO_FUNC2_OEN_SEL_S 10 -/* GPIO_FUNC2_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC2_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC2_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC2_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC2_OUT_INV_SEL_S 9 -/* GPIO_FUNC2_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC2_OUT_SEL 0x000001FF -#define GPIO_FUNC2_OUT_SEL_M ((GPIO_FUNC2_OUT_SEL_V)<<(GPIO_FUNC2_OUT_SEL_S)) -#define GPIO_FUNC2_OUT_SEL_V 0x1FF -#define GPIO_FUNC2_OUT_SEL_S 0 - -#define GPIO_FUNC3_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x053c) -/* GPIO_FUNC3_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC3_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC3_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC3_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC3_OEN_INV_SEL_S 11 -/* GPIO_FUNC3_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC3_OEN_SEL (BIT(10)) -#define GPIO_FUNC3_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC3_OEN_SEL_V 0x1 -#define GPIO_FUNC3_OEN_SEL_S 10 -/* GPIO_FUNC3_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC3_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC3_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC3_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC3_OUT_INV_SEL_S 9 -/* GPIO_FUNC3_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC3_OUT_SEL 0x000001FF -#define GPIO_FUNC3_OUT_SEL_M ((GPIO_FUNC3_OUT_SEL_V)<<(GPIO_FUNC3_OUT_SEL_S)) -#define GPIO_FUNC3_OUT_SEL_V 0x1FF -#define GPIO_FUNC3_OUT_SEL_S 0 - -#define GPIO_FUNC4_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0540) -/* GPIO_FUNC4_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC4_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC4_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC4_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC4_OEN_INV_SEL_S 11 -/* GPIO_FUNC4_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC4_OEN_SEL (BIT(10)) -#define GPIO_FUNC4_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC4_OEN_SEL_V 0x1 -#define GPIO_FUNC4_OEN_SEL_S 10 -/* GPIO_FUNC4_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC4_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC4_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC4_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC4_OUT_INV_SEL_S 9 -/* GPIO_FUNC4_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC4_OUT_SEL 0x000001FF -#define GPIO_FUNC4_OUT_SEL_M ((GPIO_FUNC4_OUT_SEL_V)<<(GPIO_FUNC4_OUT_SEL_S)) -#define GPIO_FUNC4_OUT_SEL_V 0x1FF -#define GPIO_FUNC4_OUT_SEL_S 0 - -#define GPIO_FUNC5_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0544) -/* GPIO_FUNC5_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC5_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC5_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC5_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC5_OEN_INV_SEL_S 11 -/* GPIO_FUNC5_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC5_OEN_SEL (BIT(10)) -#define GPIO_FUNC5_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC5_OEN_SEL_V 0x1 -#define GPIO_FUNC5_OEN_SEL_S 10 -/* GPIO_FUNC5_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC5_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC5_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC5_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC5_OUT_INV_SEL_S 9 -/* GPIO_FUNC5_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC5_OUT_SEL 0x000001FF -#define GPIO_FUNC5_OUT_SEL_M ((GPIO_FUNC5_OUT_SEL_V)<<(GPIO_FUNC5_OUT_SEL_S)) -#define GPIO_FUNC5_OUT_SEL_V 0x1FF -#define GPIO_FUNC5_OUT_SEL_S 0 - -#define GPIO_FUNC6_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0548) -/* GPIO_FUNC6_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC6_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC6_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC6_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC6_OEN_INV_SEL_S 11 -/* GPIO_FUNC6_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC6_OEN_SEL (BIT(10)) -#define GPIO_FUNC6_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC6_OEN_SEL_V 0x1 -#define GPIO_FUNC6_OEN_SEL_S 10 -/* GPIO_FUNC6_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC6_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC6_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC6_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC6_OUT_INV_SEL_S 9 -/* GPIO_FUNC6_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC6_OUT_SEL 0x000001FF -#define GPIO_FUNC6_OUT_SEL_M ((GPIO_FUNC6_OUT_SEL_V)<<(GPIO_FUNC6_OUT_SEL_S)) -#define GPIO_FUNC6_OUT_SEL_V 0x1FF -#define GPIO_FUNC6_OUT_SEL_S 0 - -#define GPIO_FUNC7_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x054c) -/* GPIO_FUNC7_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC7_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC7_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC7_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC7_OEN_INV_SEL_S 11 -/* GPIO_FUNC7_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC7_OEN_SEL (BIT(10)) -#define GPIO_FUNC7_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC7_OEN_SEL_V 0x1 -#define GPIO_FUNC7_OEN_SEL_S 10 -/* GPIO_FUNC7_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC7_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC7_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC7_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC7_OUT_INV_SEL_S 9 -/* GPIO_FUNC7_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC7_OUT_SEL 0x000001FF -#define GPIO_FUNC7_OUT_SEL_M ((GPIO_FUNC7_OUT_SEL_V)<<(GPIO_FUNC7_OUT_SEL_S)) -#define GPIO_FUNC7_OUT_SEL_V 0x1FF -#define GPIO_FUNC7_OUT_SEL_S 0 - -#define GPIO_FUNC8_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0550) -/* GPIO_FUNC8_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC8_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC8_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC8_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC8_OEN_INV_SEL_S 11 -/* GPIO_FUNC8_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC8_OEN_SEL (BIT(10)) -#define GPIO_FUNC8_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC8_OEN_SEL_V 0x1 -#define GPIO_FUNC8_OEN_SEL_S 10 -/* GPIO_FUNC8_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC8_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC8_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC8_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC8_OUT_INV_SEL_S 9 -/* GPIO_FUNC8_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC8_OUT_SEL 0x000001FF -#define GPIO_FUNC8_OUT_SEL_M ((GPIO_FUNC8_OUT_SEL_V)<<(GPIO_FUNC8_OUT_SEL_S)) -#define GPIO_FUNC8_OUT_SEL_V 0x1FF -#define GPIO_FUNC8_OUT_SEL_S 0 - -#define GPIO_FUNC9_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0554) -/* GPIO_FUNC9_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC9_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC9_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC9_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC9_OEN_INV_SEL_S 11 -/* GPIO_FUNC9_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC9_OEN_SEL (BIT(10)) -#define GPIO_FUNC9_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC9_OEN_SEL_V 0x1 -#define GPIO_FUNC9_OEN_SEL_S 10 -/* GPIO_FUNC9_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC9_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC9_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC9_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC9_OUT_INV_SEL_S 9 -/* GPIO_FUNC9_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC9_OUT_SEL 0x000001FF -#define GPIO_FUNC9_OUT_SEL_M ((GPIO_FUNC9_OUT_SEL_V)<<(GPIO_FUNC9_OUT_SEL_S)) -#define GPIO_FUNC9_OUT_SEL_V 0x1FF -#define GPIO_FUNC9_OUT_SEL_S 0 - -#define GPIO_FUNC10_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0558) -/* GPIO_FUNC10_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC10_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC10_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC10_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC10_OEN_INV_SEL_S 11 -/* GPIO_FUNC10_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC10_OEN_SEL (BIT(10)) -#define GPIO_FUNC10_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC10_OEN_SEL_V 0x1 -#define GPIO_FUNC10_OEN_SEL_S 10 -/* GPIO_FUNC10_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC10_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC10_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC10_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC10_OUT_INV_SEL_S 9 -/* GPIO_FUNC10_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC10_OUT_SEL 0x000001FF -#define GPIO_FUNC10_OUT_SEL_M ((GPIO_FUNC10_OUT_SEL_V)<<(GPIO_FUNC10_OUT_SEL_S)) -#define GPIO_FUNC10_OUT_SEL_V 0x1FF -#define GPIO_FUNC10_OUT_SEL_S 0 - -#define GPIO_FUNC11_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x055c) -/* GPIO_FUNC11_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC11_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC11_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC11_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC11_OEN_INV_SEL_S 11 -/* GPIO_FUNC11_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC11_OEN_SEL (BIT(10)) -#define GPIO_FUNC11_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC11_OEN_SEL_V 0x1 -#define GPIO_FUNC11_OEN_SEL_S 10 -/* GPIO_FUNC11_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC11_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC11_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC11_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC11_OUT_INV_SEL_S 9 -/* GPIO_FUNC11_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC11_OUT_SEL 0x000001FF -#define GPIO_FUNC11_OUT_SEL_M ((GPIO_FUNC11_OUT_SEL_V)<<(GPIO_FUNC11_OUT_SEL_S)) -#define GPIO_FUNC11_OUT_SEL_V 0x1FF -#define GPIO_FUNC11_OUT_SEL_S 0 - -#define GPIO_FUNC12_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0560) -/* GPIO_FUNC12_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC12_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC12_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC12_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC12_OEN_INV_SEL_S 11 -/* GPIO_FUNC12_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC12_OEN_SEL (BIT(10)) -#define GPIO_FUNC12_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC12_OEN_SEL_V 0x1 -#define GPIO_FUNC12_OEN_SEL_S 10 -/* GPIO_FUNC12_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC12_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC12_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC12_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC12_OUT_INV_SEL_S 9 -/* GPIO_FUNC12_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC12_OUT_SEL 0x000001FF -#define GPIO_FUNC12_OUT_SEL_M ((GPIO_FUNC12_OUT_SEL_V)<<(GPIO_FUNC12_OUT_SEL_S)) -#define GPIO_FUNC12_OUT_SEL_V 0x1FF -#define GPIO_FUNC12_OUT_SEL_S 0 - -#define GPIO_FUNC13_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0564) -/* GPIO_FUNC13_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC13_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC13_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC13_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC13_OEN_INV_SEL_S 11 -/* GPIO_FUNC13_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC13_OEN_SEL (BIT(10)) -#define GPIO_FUNC13_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC13_OEN_SEL_V 0x1 -#define GPIO_FUNC13_OEN_SEL_S 10 -/* GPIO_FUNC13_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC13_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC13_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC13_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC13_OUT_INV_SEL_S 9 -/* GPIO_FUNC13_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC13_OUT_SEL 0x000001FF -#define GPIO_FUNC13_OUT_SEL_M ((GPIO_FUNC13_OUT_SEL_V)<<(GPIO_FUNC13_OUT_SEL_S)) -#define GPIO_FUNC13_OUT_SEL_V 0x1FF -#define GPIO_FUNC13_OUT_SEL_S 0 - -#define GPIO_FUNC14_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0568) -/* GPIO_FUNC14_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC14_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC14_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC14_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC14_OEN_INV_SEL_S 11 -/* GPIO_FUNC14_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC14_OEN_SEL (BIT(10)) -#define GPIO_FUNC14_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC14_OEN_SEL_V 0x1 -#define GPIO_FUNC14_OEN_SEL_S 10 -/* GPIO_FUNC14_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC14_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC14_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC14_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC14_OUT_INV_SEL_S 9 -/* GPIO_FUNC14_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC14_OUT_SEL 0x000001FF -#define GPIO_FUNC14_OUT_SEL_M ((GPIO_FUNC14_OUT_SEL_V)<<(GPIO_FUNC14_OUT_SEL_S)) -#define GPIO_FUNC14_OUT_SEL_V 0x1FF -#define GPIO_FUNC14_OUT_SEL_S 0 - -#define GPIO_FUNC15_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x056c) -/* GPIO_FUNC15_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC15_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC15_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC15_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC15_OEN_INV_SEL_S 11 -/* GPIO_FUNC15_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC15_OEN_SEL (BIT(10)) -#define GPIO_FUNC15_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC15_OEN_SEL_V 0x1 -#define GPIO_FUNC15_OEN_SEL_S 10 -/* GPIO_FUNC15_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC15_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC15_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC15_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC15_OUT_INV_SEL_S 9 -/* GPIO_FUNC15_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC15_OUT_SEL 0x000001FF -#define GPIO_FUNC15_OUT_SEL_M ((GPIO_FUNC15_OUT_SEL_V)<<(GPIO_FUNC15_OUT_SEL_S)) -#define GPIO_FUNC15_OUT_SEL_V 0x1FF -#define GPIO_FUNC15_OUT_SEL_S 0 - -#define GPIO_FUNC16_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0570) -/* GPIO_FUNC16_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC16_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC16_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC16_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC16_OEN_INV_SEL_S 11 -/* GPIO_FUNC16_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC16_OEN_SEL (BIT(10)) -#define GPIO_FUNC16_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC16_OEN_SEL_V 0x1 -#define GPIO_FUNC16_OEN_SEL_S 10 -/* GPIO_FUNC16_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC16_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC16_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC16_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC16_OUT_INV_SEL_S 9 -/* GPIO_FUNC16_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC16_OUT_SEL 0x000001FF -#define GPIO_FUNC16_OUT_SEL_M ((GPIO_FUNC16_OUT_SEL_V)<<(GPIO_FUNC16_OUT_SEL_S)) -#define GPIO_FUNC16_OUT_SEL_V 0x1FF -#define GPIO_FUNC16_OUT_SEL_S 0 - -#define GPIO_FUNC17_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0574) -/* GPIO_FUNC17_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC17_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC17_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC17_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC17_OEN_INV_SEL_S 11 -/* GPIO_FUNC17_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC17_OEN_SEL (BIT(10)) -#define GPIO_FUNC17_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC17_OEN_SEL_V 0x1 -#define GPIO_FUNC17_OEN_SEL_S 10 -/* GPIO_FUNC17_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC17_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC17_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC17_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC17_OUT_INV_SEL_S 9 -/* GPIO_FUNC17_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC17_OUT_SEL 0x000001FF -#define GPIO_FUNC17_OUT_SEL_M ((GPIO_FUNC17_OUT_SEL_V)<<(GPIO_FUNC17_OUT_SEL_S)) -#define GPIO_FUNC17_OUT_SEL_V 0x1FF -#define GPIO_FUNC17_OUT_SEL_S 0 - -#define GPIO_FUNC18_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0578) -/* GPIO_FUNC18_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC18_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC18_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC18_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC18_OEN_INV_SEL_S 11 -/* GPIO_FUNC18_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC18_OEN_SEL (BIT(10)) -#define GPIO_FUNC18_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC18_OEN_SEL_V 0x1 -#define GPIO_FUNC18_OEN_SEL_S 10 -/* GPIO_FUNC18_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC18_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC18_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC18_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC18_OUT_INV_SEL_S 9 -/* GPIO_FUNC18_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC18_OUT_SEL 0x000001FF -#define GPIO_FUNC18_OUT_SEL_M ((GPIO_FUNC18_OUT_SEL_V)<<(GPIO_FUNC18_OUT_SEL_S)) -#define GPIO_FUNC18_OUT_SEL_V 0x1FF -#define GPIO_FUNC18_OUT_SEL_S 0 - -#define GPIO_FUNC19_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x057c) -/* GPIO_FUNC19_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC19_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC19_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC19_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC19_OEN_INV_SEL_S 11 -/* GPIO_FUNC19_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC19_OEN_SEL (BIT(10)) -#define GPIO_FUNC19_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC19_OEN_SEL_V 0x1 -#define GPIO_FUNC19_OEN_SEL_S 10 -/* GPIO_FUNC19_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC19_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC19_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC19_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC19_OUT_INV_SEL_S 9 -/* GPIO_FUNC19_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC19_OUT_SEL 0x000001FF -#define GPIO_FUNC19_OUT_SEL_M ((GPIO_FUNC19_OUT_SEL_V)<<(GPIO_FUNC19_OUT_SEL_S)) -#define GPIO_FUNC19_OUT_SEL_V 0x1FF -#define GPIO_FUNC19_OUT_SEL_S 0 - -#define GPIO_FUNC20_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0580) -/* GPIO_FUNC20_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC20_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC20_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC20_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC20_OEN_INV_SEL_S 11 -/* GPIO_FUNC20_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC20_OEN_SEL (BIT(10)) -#define GPIO_FUNC20_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC20_OEN_SEL_V 0x1 -#define GPIO_FUNC20_OEN_SEL_S 10 -/* GPIO_FUNC20_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC20_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC20_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC20_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC20_OUT_INV_SEL_S 9 -/* GPIO_FUNC20_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC20_OUT_SEL 0x000001FF -#define GPIO_FUNC20_OUT_SEL_M ((GPIO_FUNC20_OUT_SEL_V)<<(GPIO_FUNC20_OUT_SEL_S)) -#define GPIO_FUNC20_OUT_SEL_V 0x1FF -#define GPIO_FUNC20_OUT_SEL_S 0 - -#define GPIO_FUNC21_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0584) -/* GPIO_FUNC21_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC21_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC21_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC21_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC21_OEN_INV_SEL_S 11 -/* GPIO_FUNC21_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC21_OEN_SEL (BIT(10)) -#define GPIO_FUNC21_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC21_OEN_SEL_V 0x1 -#define GPIO_FUNC21_OEN_SEL_S 10 -/* GPIO_FUNC21_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC21_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC21_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC21_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC21_OUT_INV_SEL_S 9 -/* GPIO_FUNC21_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC21_OUT_SEL 0x000001FF -#define GPIO_FUNC21_OUT_SEL_M ((GPIO_FUNC21_OUT_SEL_V)<<(GPIO_FUNC21_OUT_SEL_S)) -#define GPIO_FUNC21_OUT_SEL_V 0x1FF -#define GPIO_FUNC21_OUT_SEL_S 0 - -#define GPIO_FUNC22_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0588) -/* GPIO_FUNC22_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC22_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC22_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC22_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC22_OEN_INV_SEL_S 11 -/* GPIO_FUNC22_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC22_OEN_SEL (BIT(10)) -#define GPIO_FUNC22_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC22_OEN_SEL_V 0x1 -#define GPIO_FUNC22_OEN_SEL_S 10 -/* GPIO_FUNC22_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC22_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC22_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC22_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC22_OUT_INV_SEL_S 9 -/* GPIO_FUNC22_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC22_OUT_SEL 0x000001FF -#define GPIO_FUNC22_OUT_SEL_M ((GPIO_FUNC22_OUT_SEL_V)<<(GPIO_FUNC22_OUT_SEL_S)) -#define GPIO_FUNC22_OUT_SEL_V 0x1FF -#define GPIO_FUNC22_OUT_SEL_S 0 - -#define GPIO_FUNC23_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x058c) -/* GPIO_FUNC23_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC23_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC23_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC23_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC23_OEN_INV_SEL_S 11 -/* GPIO_FUNC23_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC23_OEN_SEL (BIT(10)) -#define GPIO_FUNC23_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC23_OEN_SEL_V 0x1 -#define GPIO_FUNC23_OEN_SEL_S 10 -/* GPIO_FUNC23_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC23_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC23_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC23_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC23_OUT_INV_SEL_S 9 -/* GPIO_FUNC23_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC23_OUT_SEL 0x000001FF -#define GPIO_FUNC23_OUT_SEL_M ((GPIO_FUNC23_OUT_SEL_V)<<(GPIO_FUNC23_OUT_SEL_S)) -#define GPIO_FUNC23_OUT_SEL_V 0x1FF -#define GPIO_FUNC23_OUT_SEL_S 0 - -#define GPIO_FUNC24_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0590) -/* GPIO_FUNC24_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC24_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC24_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC24_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC24_OEN_INV_SEL_S 11 -/* GPIO_FUNC24_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC24_OEN_SEL (BIT(10)) -#define GPIO_FUNC24_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC24_OEN_SEL_V 0x1 -#define GPIO_FUNC24_OEN_SEL_S 10 -/* GPIO_FUNC24_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC24_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC24_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC24_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC24_OUT_INV_SEL_S 9 -/* GPIO_FUNC24_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC24_OUT_SEL 0x000001FF -#define GPIO_FUNC24_OUT_SEL_M ((GPIO_FUNC24_OUT_SEL_V)<<(GPIO_FUNC24_OUT_SEL_S)) -#define GPIO_FUNC24_OUT_SEL_V 0x1FF -#define GPIO_FUNC24_OUT_SEL_S 0 - -#define GPIO_FUNC25_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0594) -/* GPIO_FUNC25_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC25_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC25_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC25_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC25_OEN_INV_SEL_S 11 -/* GPIO_FUNC25_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC25_OEN_SEL (BIT(10)) -#define GPIO_FUNC25_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC25_OEN_SEL_V 0x1 -#define GPIO_FUNC25_OEN_SEL_S 10 -/* GPIO_FUNC25_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC25_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC25_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC25_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC25_OUT_INV_SEL_S 9 -/* GPIO_FUNC25_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC25_OUT_SEL 0x000001FF -#define GPIO_FUNC25_OUT_SEL_M ((GPIO_FUNC25_OUT_SEL_V)<<(GPIO_FUNC25_OUT_SEL_S)) -#define GPIO_FUNC25_OUT_SEL_V 0x1FF -#define GPIO_FUNC25_OUT_SEL_S 0 - -#define GPIO_FUNC26_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x0598) -/* GPIO_FUNC26_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC26_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC26_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC26_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC26_OEN_INV_SEL_S 11 -/* GPIO_FUNC26_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC26_OEN_SEL (BIT(10)) -#define GPIO_FUNC26_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC26_OEN_SEL_V 0x1 -#define GPIO_FUNC26_OEN_SEL_S 10 -/* GPIO_FUNC26_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC26_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC26_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC26_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC26_OUT_INV_SEL_S 9 -/* GPIO_FUNC26_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC26_OUT_SEL 0x000001FF -#define GPIO_FUNC26_OUT_SEL_M ((GPIO_FUNC26_OUT_SEL_V)<<(GPIO_FUNC26_OUT_SEL_S)) -#define GPIO_FUNC26_OUT_SEL_V 0x1FF -#define GPIO_FUNC26_OUT_SEL_S 0 - -#define GPIO_FUNC27_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x059c) -/* GPIO_FUNC27_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC27_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC27_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC27_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC27_OEN_INV_SEL_S 11 -/* GPIO_FUNC27_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC27_OEN_SEL (BIT(10)) -#define GPIO_FUNC27_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC27_OEN_SEL_V 0x1 -#define GPIO_FUNC27_OEN_SEL_S 10 -/* GPIO_FUNC27_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC27_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC27_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC27_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC27_OUT_INV_SEL_S 9 -/* GPIO_FUNC27_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC27_OUT_SEL 0x000001FF -#define GPIO_FUNC27_OUT_SEL_M ((GPIO_FUNC27_OUT_SEL_V)<<(GPIO_FUNC27_OUT_SEL_S)) -#define GPIO_FUNC27_OUT_SEL_V 0x1FF -#define GPIO_FUNC27_OUT_SEL_S 0 - -#define GPIO_FUNC28_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x05a0) -/* GPIO_FUNC28_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC28_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC28_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC28_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC28_OEN_INV_SEL_S 11 -/* GPIO_FUNC28_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC28_OEN_SEL (BIT(10)) -#define GPIO_FUNC28_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC28_OEN_SEL_V 0x1 -#define GPIO_FUNC28_OEN_SEL_S 10 -/* GPIO_FUNC28_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC28_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC28_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC28_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC28_OUT_INV_SEL_S 9 -/* GPIO_FUNC28_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC28_OUT_SEL 0x000001FF -#define GPIO_FUNC28_OUT_SEL_M ((GPIO_FUNC28_OUT_SEL_V)<<(GPIO_FUNC28_OUT_SEL_S)) -#define GPIO_FUNC28_OUT_SEL_V 0x1FF -#define GPIO_FUNC28_OUT_SEL_S 0 - -#define GPIO_FUNC29_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x05a4) -/* GPIO_FUNC29_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC29_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC29_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC29_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC29_OEN_INV_SEL_S 11 -/* GPIO_FUNC29_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC29_OEN_SEL (BIT(10)) -#define GPIO_FUNC29_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC29_OEN_SEL_V 0x1 -#define GPIO_FUNC29_OEN_SEL_S 10 -/* GPIO_FUNC29_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC29_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC29_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC29_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC29_OUT_INV_SEL_S 9 -/* GPIO_FUNC29_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC29_OUT_SEL 0x000001FF -#define GPIO_FUNC29_OUT_SEL_M ((GPIO_FUNC29_OUT_SEL_V)<<(GPIO_FUNC29_OUT_SEL_S)) -#define GPIO_FUNC29_OUT_SEL_V 0x1FF -#define GPIO_FUNC29_OUT_SEL_S 0 - -#define GPIO_FUNC30_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x05a8) -/* GPIO_FUNC30_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC30_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC30_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC30_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC30_OEN_INV_SEL_S 11 -/* GPIO_FUNC30_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC30_OEN_SEL (BIT(10)) -#define GPIO_FUNC30_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC30_OEN_SEL_V 0x1 -#define GPIO_FUNC30_OEN_SEL_S 10 -/* GPIO_FUNC30_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC30_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC30_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC30_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC30_OUT_INV_SEL_S 9 -/* GPIO_FUNC30_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC30_OUT_SEL 0x000001FF -#define GPIO_FUNC30_OUT_SEL_M ((GPIO_FUNC30_OUT_SEL_V)<<(GPIO_FUNC30_OUT_SEL_S)) -#define GPIO_FUNC30_OUT_SEL_V 0x1FF -#define GPIO_FUNC30_OUT_SEL_S 0 - -#define GPIO_FUNC31_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x05ac) -/* GPIO_FUNC31_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC31_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC31_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC31_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC31_OEN_INV_SEL_S 11 -/* GPIO_FUNC31_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC31_OEN_SEL (BIT(10)) -#define GPIO_FUNC31_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC31_OEN_SEL_V 0x1 -#define GPIO_FUNC31_OEN_SEL_S 10 -/* GPIO_FUNC31_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC31_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC31_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC31_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC31_OUT_INV_SEL_S 9 -/* GPIO_FUNC31_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC31_OUT_SEL 0x000001FF -#define GPIO_FUNC31_OUT_SEL_M ((GPIO_FUNC31_OUT_SEL_V)<<(GPIO_FUNC31_OUT_SEL_S)) -#define GPIO_FUNC31_OUT_SEL_V 0x1FF -#define GPIO_FUNC31_OUT_SEL_S 0 - -#define GPIO_FUNC32_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x05b0) -/* GPIO_FUNC32_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC32_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC32_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC32_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC32_OEN_INV_SEL_S 11 -/* GPIO_FUNC32_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC32_OEN_SEL (BIT(10)) -#define GPIO_FUNC32_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC32_OEN_SEL_V 0x1 -#define GPIO_FUNC32_OEN_SEL_S 10 -/* GPIO_FUNC32_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC32_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC32_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC32_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC32_OUT_INV_SEL_S 9 -/* GPIO_FUNC32_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC32_OUT_SEL 0x000001FF -#define GPIO_FUNC32_OUT_SEL_M ((GPIO_FUNC32_OUT_SEL_V)<<(GPIO_FUNC32_OUT_SEL_S)) -#define GPIO_FUNC32_OUT_SEL_V 0x1FF -#define GPIO_FUNC32_OUT_SEL_S 0 - -#define GPIO_FUNC33_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x05b4) -/* GPIO_FUNC33_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC33_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC33_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC33_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC33_OEN_INV_SEL_S 11 -/* GPIO_FUNC33_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC33_OEN_SEL (BIT(10)) -#define GPIO_FUNC33_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC33_OEN_SEL_V 0x1 -#define GPIO_FUNC33_OEN_SEL_S 10 -/* GPIO_FUNC33_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC33_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC33_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC33_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC33_OUT_INV_SEL_S 9 -/* GPIO_FUNC33_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC33_OUT_SEL 0x000001FF -#define GPIO_FUNC33_OUT_SEL_M ((GPIO_FUNC33_OUT_SEL_V)<<(GPIO_FUNC33_OUT_SEL_S)) -#define GPIO_FUNC33_OUT_SEL_V 0x1FF -#define GPIO_FUNC33_OUT_SEL_S 0 - -#define GPIO_FUNC34_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x05b8) -/* GPIO_FUNC34_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC34_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC34_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC34_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC34_OEN_INV_SEL_S 11 -/* GPIO_FUNC34_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC34_OEN_SEL (BIT(10)) -#define GPIO_FUNC34_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC34_OEN_SEL_V 0x1 -#define GPIO_FUNC34_OEN_SEL_S 10 -/* GPIO_FUNC34_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC34_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC34_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC34_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC34_OUT_INV_SEL_S 9 -/* GPIO_FUNC34_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC34_OUT_SEL 0x000001FF -#define GPIO_FUNC34_OUT_SEL_M ((GPIO_FUNC34_OUT_SEL_V)<<(GPIO_FUNC34_OUT_SEL_S)) -#define GPIO_FUNC34_OUT_SEL_V 0x1FF -#define GPIO_FUNC34_OUT_SEL_S 0 - -#define GPIO_FUNC35_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x05bc) -/* GPIO_FUNC35_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC35_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC35_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC35_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC35_OEN_INV_SEL_S 11 -/* GPIO_FUNC35_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC35_OEN_SEL (BIT(10)) -#define GPIO_FUNC35_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC35_OEN_SEL_V 0x1 -#define GPIO_FUNC35_OEN_SEL_S 10 -/* GPIO_FUNC35_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC35_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC35_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC35_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC35_OUT_INV_SEL_S 9 -/* GPIO_FUNC35_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC35_OUT_SEL 0x000001FF -#define GPIO_FUNC35_OUT_SEL_M ((GPIO_FUNC35_OUT_SEL_V)<<(GPIO_FUNC35_OUT_SEL_S)) -#define GPIO_FUNC35_OUT_SEL_V 0x1FF -#define GPIO_FUNC35_OUT_SEL_S 0 - -#define GPIO_FUNC36_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x05c0) -/* GPIO_FUNC36_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC36_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC36_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC36_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC36_OEN_INV_SEL_S 11 -/* GPIO_FUNC36_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC36_OEN_SEL (BIT(10)) -#define GPIO_FUNC36_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC36_OEN_SEL_V 0x1 -#define GPIO_FUNC36_OEN_SEL_S 10 -/* GPIO_FUNC36_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC36_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC36_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC36_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC36_OUT_INV_SEL_S 9 -/* GPIO_FUNC36_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC36_OUT_SEL 0x000001FF -#define GPIO_FUNC36_OUT_SEL_M ((GPIO_FUNC36_OUT_SEL_V)<<(GPIO_FUNC36_OUT_SEL_S)) -#define GPIO_FUNC36_OUT_SEL_V 0x1FF -#define GPIO_FUNC36_OUT_SEL_S 0 - -#define GPIO_FUNC37_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x05c4) -/* GPIO_FUNC37_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC37_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC37_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC37_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC37_OEN_INV_SEL_S 11 -/* GPIO_FUNC37_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC37_OEN_SEL (BIT(10)) -#define GPIO_FUNC37_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC37_OEN_SEL_V 0x1 -#define GPIO_FUNC37_OEN_SEL_S 10 -/* GPIO_FUNC37_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC37_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC37_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC37_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC37_OUT_INV_SEL_S 9 -/* GPIO_FUNC37_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC37_OUT_SEL 0x000001FF -#define GPIO_FUNC37_OUT_SEL_M ((GPIO_FUNC37_OUT_SEL_V)<<(GPIO_FUNC37_OUT_SEL_S)) -#define GPIO_FUNC37_OUT_SEL_V 0x1FF -#define GPIO_FUNC37_OUT_SEL_S 0 - -#define GPIO_FUNC38_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x05c8) -/* GPIO_FUNC38_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC38_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC38_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC38_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC38_OEN_INV_SEL_S 11 -/* GPIO_FUNC38_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC38_OEN_SEL (BIT(10)) -#define GPIO_FUNC38_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC38_OEN_SEL_V 0x1 -#define GPIO_FUNC38_OEN_SEL_S 10 -/* GPIO_FUNC38_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC38_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC38_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC38_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC38_OUT_INV_SEL_S 9 -/* GPIO_FUNC38_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC38_OUT_SEL 0x000001FF -#define GPIO_FUNC38_OUT_SEL_M ((GPIO_FUNC38_OUT_SEL_V)<<(GPIO_FUNC38_OUT_SEL_S)) -#define GPIO_FUNC38_OUT_SEL_V 0x1FF -#define GPIO_FUNC38_OUT_SEL_S 0 - -#define GPIO_FUNC39_OUT_SEL_CFG_REG (DR_REG_GPIO_BASE + 0x05cc) -/* GPIO_FUNC39_OEN_INV_SEL : R/W ;bitpos:[11] ;default: x ; */ -/*description: invert the output enable value if you want to revert the output - enable value setting the value to 1*/ -#define GPIO_FUNC39_OEN_INV_SEL (BIT(11)) -#define GPIO_FUNC39_OEN_INV_SEL_M (BIT(11)) -#define GPIO_FUNC39_OEN_INV_SEL_V 0x1 -#define GPIO_FUNC39_OEN_INV_SEL_S 11 -/* GPIO_FUNC39_OEN_SEL : R/W ;bitpos:[10] ;default: x ; */ -/*description: weather using the logical oen signal or not using the value setting - by the register*/ -#define GPIO_FUNC39_OEN_SEL (BIT(10)) -#define GPIO_FUNC39_OEN_SEL_M (BIT(10)) -#define GPIO_FUNC39_OEN_SEL_V 0x1 -#define GPIO_FUNC39_OEN_SEL_S 10 -/* GPIO_FUNC39_OUT_INV_SEL : R/W ;bitpos:[9] ;default: x ; */ -/*description: invert the output value if you want to revert the output value - setting the value to 1*/ -#define GPIO_FUNC39_OUT_INV_SEL (BIT(9)) -#define GPIO_FUNC39_OUT_INV_SEL_M (BIT(9)) -#define GPIO_FUNC39_OUT_INV_SEL_V 0x1 -#define GPIO_FUNC39_OUT_INV_SEL_S 9 -/* GPIO_FUNC39_OUT_SEL : R/W ;bitpos:[8:0] ;default: x ; */ -/*description: select one of the 256 output to 40 GPIO*/ -#define GPIO_FUNC39_OUT_SEL 0x000001FF -#define GPIO_FUNC39_OUT_SEL_M ((GPIO_FUNC39_OUT_SEL_V)<<(GPIO_FUNC39_OUT_SEL_S)) -#define GPIO_FUNC39_OUT_SEL_V 0x1FF -#define GPIO_FUNC39_OUT_SEL_S 0 - - - - -#endif /*_SOC_GPIO_REG_H_ */ - - diff --git a/tools/sdk/include/soc/soc/gpio_sd_reg.h b/tools/sdk/include/soc/soc/gpio_sd_reg.h deleted file mode 100644 index be39fcf2c20..00000000000 --- a/tools/sdk/include/soc/soc/gpio_sd_reg.h +++ /dev/null @@ -1,160 +0,0 @@ -// 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. -#ifndef _SOC_GPIO_SD_REG_H_ -#define _SOC_GPIO_SD_REG_H_ - -#include "soc.h" -#define GPIO_SIGMADELTA0_REG (DR_REG_GPIO_SD_BASE + 0x0000) -/* GPIO_SD0_PRESCALE : R/W ;bitpos:[15:8] ;default: 8'hff ; */ -/*description: */ -#define GPIO_SD0_PRESCALE 0x000000FF -#define GPIO_SD0_PRESCALE_M ((GPIO_SD0_PRESCALE_V)<<(GPIO_SD0_PRESCALE_S)) -#define GPIO_SD0_PRESCALE_V 0xFF -#define GPIO_SD0_PRESCALE_S 8 -/* GPIO_SD0_IN : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define GPIO_SD0_IN 0x000000FF -#define GPIO_SD0_IN_M ((GPIO_SD0_IN_V)<<(GPIO_SD0_IN_S)) -#define GPIO_SD0_IN_V 0xFF -#define GPIO_SD0_IN_S 0 - -#define GPIO_SIGMADELTA1_REG (DR_REG_GPIO_SD_BASE + 0x0004) -/* GPIO_SD1_PRESCALE : R/W ;bitpos:[15:8] ;default: 8'hff ; */ -/*description: */ -#define GPIO_SD1_PRESCALE 0x000000FF -#define GPIO_SD1_PRESCALE_M ((GPIO_SD1_PRESCALE_V)<<(GPIO_SD1_PRESCALE_S)) -#define GPIO_SD1_PRESCALE_V 0xFF -#define GPIO_SD1_PRESCALE_S 8 -/* GPIO_SD1_IN : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define GPIO_SD1_IN 0x000000FF -#define GPIO_SD1_IN_M ((GPIO_SD1_IN_V)<<(GPIO_SD1_IN_S)) -#define GPIO_SD1_IN_V 0xFF -#define GPIO_SD1_IN_S 0 - -#define GPIO_SIGMADELTA2_REG (DR_REG_GPIO_SD_BASE + 0x0008) -/* GPIO_SD2_PRESCALE : R/W ;bitpos:[15:8] ;default: 8'hff ; */ -/*description: */ -#define GPIO_SD2_PRESCALE 0x000000FF -#define GPIO_SD2_PRESCALE_M ((GPIO_SD2_PRESCALE_V)<<(GPIO_SD2_PRESCALE_S)) -#define GPIO_SD2_PRESCALE_V 0xFF -#define GPIO_SD2_PRESCALE_S 8 -/* GPIO_SD2_IN : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define GPIO_SD2_IN 0x000000FF -#define GPIO_SD2_IN_M ((GPIO_SD2_IN_V)<<(GPIO_SD2_IN_S)) -#define GPIO_SD2_IN_V 0xFF -#define GPIO_SD2_IN_S 0 - -#define GPIO_SIGMADELTA3_REG (DR_REG_GPIO_SD_BASE + 0x000c) -/* GPIO_SD3_PRESCALE : R/W ;bitpos:[15:8] ;default: 8'hff ; */ -/*description: */ -#define GPIO_SD3_PRESCALE 0x000000FF -#define GPIO_SD3_PRESCALE_M ((GPIO_SD3_PRESCALE_V)<<(GPIO_SD3_PRESCALE_S)) -#define GPIO_SD3_PRESCALE_V 0xFF -#define GPIO_SD3_PRESCALE_S 8 -/* GPIO_SD3_IN : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define GPIO_SD3_IN 0x000000FF -#define GPIO_SD3_IN_M ((GPIO_SD3_IN_V)<<(GPIO_SD3_IN_S)) -#define GPIO_SD3_IN_V 0xFF -#define GPIO_SD3_IN_S 0 - -#define GPIO_SIGMADELTA4_REG (DR_REG_GPIO_SD_BASE + 0x0010) -/* GPIO_SD4_PRESCALE : R/W ;bitpos:[15:8] ;default: 8'hff ; */ -/*description: */ -#define GPIO_SD4_PRESCALE 0x000000FF -#define GPIO_SD4_PRESCALE_M ((GPIO_SD4_PRESCALE_V)<<(GPIO_SD4_PRESCALE_S)) -#define GPIO_SD4_PRESCALE_V 0xFF -#define GPIO_SD4_PRESCALE_S 8 -/* GPIO_SD4_IN : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define GPIO_SD4_IN 0x000000FF -#define GPIO_SD4_IN_M ((GPIO_SD4_IN_V)<<(GPIO_SD4_IN_S)) -#define GPIO_SD4_IN_V 0xFF -#define GPIO_SD4_IN_S 0 - -#define GPIO_SIGMADELTA5_REG (DR_REG_GPIO_SD_BASE + 0x0014) -/* GPIO_SD5_PRESCALE : R/W ;bitpos:[15:8] ;default: 8'hff ; */ -/*description: */ -#define GPIO_SD5_PRESCALE 0x000000FF -#define GPIO_SD5_PRESCALE_M ((GPIO_SD5_PRESCALE_V)<<(GPIO_SD5_PRESCALE_S)) -#define GPIO_SD5_PRESCALE_V 0xFF -#define GPIO_SD5_PRESCALE_S 8 -/* GPIO_SD5_IN : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define GPIO_SD5_IN 0x000000FF -#define GPIO_SD5_IN_M ((GPIO_SD5_IN_V)<<(GPIO_SD5_IN_S)) -#define GPIO_SD5_IN_V 0xFF -#define GPIO_SD5_IN_S 0 - -#define GPIO_SIGMADELTA6_REG (DR_REG_GPIO_SD_BASE + 0x0018) -/* GPIO_SD6_PRESCALE : R/W ;bitpos:[15:8] ;default: 8'hff ; */ -/*description: */ -#define GPIO_SD6_PRESCALE 0x000000FF -#define GPIO_SD6_PRESCALE_M ((GPIO_SD6_PRESCALE_V)<<(GPIO_SD6_PRESCALE_S)) -#define GPIO_SD6_PRESCALE_V 0xFF -#define GPIO_SD6_PRESCALE_S 8 -/* GPIO_SD6_IN : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define GPIO_SD6_IN 0x000000FF -#define GPIO_SD6_IN_M ((GPIO_SD6_IN_V)<<(GPIO_SD6_IN_S)) -#define GPIO_SD6_IN_V 0xFF -#define GPIO_SD6_IN_S 0 - -#define GPIO_SIGMADELTA7_REG (DR_REG_GPIO_SD_BASE + 0x001c) -/* GPIO_SD7_PRESCALE : R/W ;bitpos:[15:8] ;default: 8'hff ; */ -/*description: */ -#define GPIO_SD7_PRESCALE 0x000000FF -#define GPIO_SD7_PRESCALE_M ((GPIO_SD7_PRESCALE_V)<<(GPIO_SD7_PRESCALE_S)) -#define GPIO_SD7_PRESCALE_V 0xFF -#define GPIO_SD7_PRESCALE_S 8 -/* GPIO_SD7_IN : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define GPIO_SD7_IN 0x000000FF -#define GPIO_SD7_IN_M ((GPIO_SD7_IN_V)<<(GPIO_SD7_IN_S)) -#define GPIO_SD7_IN_V 0xFF -#define GPIO_SD7_IN_S 0 - -#define GPIO_SIGMADELTA_CG_REG (DR_REG_GPIO_SD_BASE + 0x0020) -/* GPIO_SD_CLK_EN : R/W ;bitpos:[31] ;default: 1'h0 ; */ -/*description: */ -#define GPIO_SD_CLK_EN (BIT(31)) -#define GPIO_SD_CLK_EN_M (BIT(31)) -#define GPIO_SD_CLK_EN_V 0x1 -#define GPIO_SD_CLK_EN_S 31 - -#define GPIO_SIGMADELTA_MISC_REG (DR_REG_GPIO_SD_BASE + 0x0024) -/* GPIO_SPI_SWAP : R/W ;bitpos:[31] ;default: 1'h0 ; */ -/*description: */ -#define GPIO_SPI_SWAP (BIT(31)) -#define GPIO_SPI_SWAP_M (BIT(31)) -#define GPIO_SPI_SWAP_V 0x1 -#define GPIO_SPI_SWAP_S 31 - -#define GPIO_SIGMADELTA_VERSION_REG (DR_REG_GPIO_SD_BASE + 0x0028) -/* GPIO_SD_DATE : R/W ;bitpos:[27:0] ;default: 28'h1506190 ; */ -/*description: */ -#define GPIO_SD_DATE 0x0FFFFFFF -#define GPIO_SD_DATE_M ((GPIO_SD_DATE_V)<<(GPIO_SD_DATE_S)) -#define GPIO_SD_DATE_V 0xFFFFFFF -#define GPIO_SD_DATE_S 0 -#define SIGMADELTA_GPIO_SD_DATE_VERSION 0x1506190 - - - - -#endif /*_SOC_GPIO_SD_REG_H_ */ - - diff --git a/tools/sdk/include/soc/soc/gpio_sd_struct.h b/tools/sdk/include/soc/soc/gpio_sd_struct.h deleted file mode 100644 index e5001c23f5f..00000000000 --- a/tools/sdk/include/soc/soc/gpio_sd_struct.h +++ /dev/null @@ -1,58 +0,0 @@ -// 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. -#ifndef _SOC_GPIO_SD_STRUCT_H_ -#define _SOC_GPIO_SD_STRUCT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef volatile struct { - union { - struct { - uint32_t duty: 8; - uint32_t prescale: 8; - uint32_t reserved16: 16; - }; - uint32_t val; - } channel[8]; - union { - struct { - uint32_t reserved0: 31; - uint32_t clk_en: 1; - }; - uint32_t val; - } cg; - union { - struct { - uint32_t reserved0: 31; - uint32_t spi_swap: 1; - }; - uint32_t val; - } misc; - union { - struct { - uint32_t date: 28; - uint32_t reserved28: 4; - }; - uint32_t val; - } version; -} gpio_sd_dev_t; -extern gpio_sd_dev_t SIGMADELTA; - -#ifdef __cplusplus -} -#endif - -#endif /* _SOC_GPIO_SD_STRUCT_H_ */ diff --git a/tools/sdk/include/soc/soc/gpio_sig_map.h b/tools/sdk/include/soc/soc/gpio_sig_map.h deleted file mode 100644 index 1d3dc5b04ce..00000000000 --- a/tools/sdk/include/soc/soc/gpio_sig_map.h +++ /dev/null @@ -1,422 +0,0 @@ -// 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. -#ifndef _SOC_GPIO_SIG_MAP_H_ -#define _SOC_GPIO_SIG_MAP_H_ - -#define SPICLK_IN_IDX 0 -#define SPICLK_OUT_IDX 0 -#define SPIQ_IN_IDX 1 -#define SPIQ_OUT_IDX 1 -#define SPID_IN_IDX 2 -#define SPID_OUT_IDX 2 -#define SPIHD_IN_IDX 3 -#define SPIHD_OUT_IDX 3 -#define SPIWP_IN_IDX 4 -#define SPIWP_OUT_IDX 4 -#define SPICS0_IN_IDX 5 -#define SPICS0_OUT_IDX 5 -#define SPICS1_IN_IDX 6 -#define SPICS1_OUT_IDX 6 -#define SPICS2_IN_IDX 7 -#define SPICS2_OUT_IDX 7 -#define HSPICLK_IN_IDX 8 -#define HSPICLK_OUT_IDX 8 -#define HSPIQ_IN_IDX 9 -#define HSPIQ_OUT_IDX 9 -#define HSPID_IN_IDX 10 -#define HSPID_OUT_IDX 10 -#define HSPICS0_IN_IDX 11 -#define HSPICS0_OUT_IDX 11 -#define HSPIHD_IN_IDX 12 -#define HSPIHD_OUT_IDX 12 -#define HSPIWP_IN_IDX 13 -#define HSPIWP_OUT_IDX 13 -#define U0RXD_IN_IDX 14 -#define U0TXD_OUT_IDX 14 -#define U0CTS_IN_IDX 15 -#define U0RTS_OUT_IDX 15 -#define U0DSR_IN_IDX 16 -#define U0DTR_OUT_IDX 16 -#define U1RXD_IN_IDX 17 -#define U1TXD_OUT_IDX 17 -#define U1CTS_IN_IDX 18 -#define U1RTS_OUT_IDX 18 -#define I2CM_SCL_O_IDX 19 -#define I2CM_SDA_I_IDX 20 -#define I2CM_SDA_O_IDX 20 -#define EXT_I2C_SCL_O_IDX 21 -#define EXT_I2C_SDA_O_IDX 22 -#define EXT_I2C_SDA_I_IDX 22 -#define I2S0O_BCK_IN_IDX 23 -#define I2S0O_BCK_OUT_IDX 23 -#define I2S1O_BCK_IN_IDX 24 -#define I2S1O_BCK_OUT_IDX 24 -#define I2S0O_WS_IN_IDX 25 -#define I2S0O_WS_OUT_IDX 25 -#define I2S1O_WS_IN_IDX 26 -#define I2S1O_WS_OUT_IDX 26 -#define I2S0I_BCK_IN_IDX 27 -#define I2S0I_BCK_OUT_IDX 27 -#define I2S0I_WS_IN_IDX 28 -#define I2S0I_WS_OUT_IDX 28 -#define I2CEXT0_SCL_IN_IDX 29 -#define I2CEXT0_SCL_OUT_IDX 29 -#define I2CEXT0_SDA_IN_IDX 30 -#define I2CEXT0_SDA_OUT_IDX 30 -#define PWM0_SYNC0_IN_IDX 31 -#define SDIO_TOHOST_INT_OUT_IDX 31 -#define PWM0_SYNC1_IN_IDX 32 -#define PWM0_OUT0A_IDX 32 -#define PWM0_SYNC2_IN_IDX 33 -#define PWM0_OUT0B_IDX 33 -#define PWM0_F0_IN_IDX 34 -#define PWM0_OUT1A_IDX 34 -#define PWM0_F1_IN_IDX 35 -#define PWM0_OUT1B_IDX 35 -#define PWM0_F2_IN_IDX 36 -#define PWM0_OUT2A_IDX 36 -#define GPIO_BT_ACTIVE_IDX 37 -#define PWM0_OUT2B_IDX 37 -#define GPIO_BT_PRIORITY_IDX 38 -#define PCNT_SIG_CH0_IN0_IDX 39 -#define PCNT_SIG_CH1_IN0_IDX 40 -#define GPIO_WLAN_ACTIVE_IDX 40 -#define PCNT_CTRL_CH0_IN0_IDX 41 -#define BB_DIAG0_IDX 41 -#define PCNT_CTRL_CH1_IN0_IDX 42 -#define BB_DIAG1_IDX 42 -#define PCNT_SIG_CH0_IN1_IDX 43 -#define BB_DIAG2_IDX 43 -#define PCNT_SIG_CH1_IN1_IDX 44 -#define BB_DIAG3_IDX 44 -#define PCNT_CTRL_CH0_IN1_IDX 45 -#define BB_DIAG4_IDX 45 -#define PCNT_CTRL_CH1_IN1_IDX 46 -#define BB_DIAG5_IDX 46 -#define PCNT_SIG_CH0_IN2_IDX 47 -#define BB_DIAG6_IDX 47 -#define PCNT_SIG_CH1_IN2_IDX 48 -#define BB_DIAG7_IDX 48 -#define PCNT_CTRL_CH0_IN2_IDX 49 -#define BB_DIAG8_IDX 49 -#define PCNT_CTRL_CH1_IN2_IDX 50 -#define BB_DIAG9_IDX 50 -#define PCNT_SIG_CH0_IN3_IDX 51 -#define BB_DIAG10_IDX 51 -#define PCNT_SIG_CH1_IN3_IDX 52 -#define BB_DIAG11_IDX 52 -#define PCNT_CTRL_CH0_IN3_IDX 53 -#define BB_DIAG12_IDX 53 -#define PCNT_CTRL_CH1_IN3_IDX 54 -#define BB_DIAG13_IDX 54 -#define PCNT_SIG_CH0_IN4_IDX 55 -#define BB_DIAG14_IDX 55 -#define PCNT_SIG_CH1_IN4_IDX 56 -#define BB_DIAG15_IDX 56 -#define PCNT_CTRL_CH0_IN4_IDX 57 -#define BB_DIAG16_IDX 57 -#define PCNT_CTRL_CH1_IN4_IDX 58 -#define BB_DIAG17_IDX 58 -#define BB_DIAG18_IDX 59 -#define BB_DIAG19_IDX 60 -#define HSPICS1_IN_IDX 61 -#define HSPICS1_OUT_IDX 61 -#define HSPICS2_IN_IDX 62 -#define HSPICS2_OUT_IDX 62 -#define VSPICLK_IN_IDX 63 -#define VSPICLK_OUT_IDX 63 -#define VSPIQ_IN_IDX 64 -#define VSPIQ_OUT_IDX 64 -#define VSPID_IN_IDX 65 -#define VSPID_OUT_IDX 65 -#define VSPIHD_IN_IDX 66 -#define VSPIHD_OUT_IDX 66 -#define VSPIWP_IN_IDX 67 -#define VSPIWP_OUT_IDX 67 -#define VSPICS0_IN_IDX 68 -#define VSPICS0_OUT_IDX 68 -#define VSPICS1_IN_IDX 69 -#define VSPICS1_OUT_IDX 69 -#define VSPICS2_IN_IDX 70 -#define VSPICS2_OUT_IDX 70 -#define PCNT_SIG_CH0_IN5_IDX 71 -#define LEDC_HS_SIG_OUT0_IDX 71 -#define PCNT_SIG_CH1_IN5_IDX 72 -#define LEDC_HS_SIG_OUT1_IDX 72 -#define PCNT_CTRL_CH0_IN5_IDX 73 -#define LEDC_HS_SIG_OUT2_IDX 73 -#define PCNT_CTRL_CH1_IN5_IDX 74 -#define LEDC_HS_SIG_OUT3_IDX 74 -#define PCNT_SIG_CH0_IN6_IDX 75 -#define LEDC_HS_SIG_OUT4_IDX 75 -#define PCNT_SIG_CH1_IN6_IDX 76 -#define LEDC_HS_SIG_OUT5_IDX 76 -#define PCNT_CTRL_CH0_IN6_IDX 77 -#define LEDC_HS_SIG_OUT6_IDX 77 -#define PCNT_CTRL_CH1_IN6_IDX 78 -#define LEDC_HS_SIG_OUT7_IDX 78 -#define PCNT_SIG_CH0_IN7_IDX 79 -#define LEDC_LS_SIG_OUT0_IDX 79 -#define PCNT_SIG_CH1_IN7_IDX 80 -#define LEDC_LS_SIG_OUT1_IDX 80 -#define PCNT_CTRL_CH0_IN7_IDX 81 -#define LEDC_LS_SIG_OUT2_IDX 81 -#define PCNT_CTRL_CH1_IN7_IDX 82 -#define LEDC_LS_SIG_OUT3_IDX 82 -#define RMT_SIG_IN0_IDX 83 -#define LEDC_LS_SIG_OUT4_IDX 83 -#define RMT_SIG_IN1_IDX 84 -#define LEDC_LS_SIG_OUT5_IDX 84 -#define RMT_SIG_IN2_IDX 85 -#define LEDC_LS_SIG_OUT6_IDX 85 -#define RMT_SIG_IN3_IDX 86 -#define LEDC_LS_SIG_OUT7_IDX 86 -#define RMT_SIG_IN4_IDX 87 -#define RMT_SIG_OUT0_IDX 87 -#define RMT_SIG_IN5_IDX 88 -#define RMT_SIG_OUT1_IDX 88 -#define RMT_SIG_IN6_IDX 89 -#define RMT_SIG_OUT2_IDX 89 -#define RMT_SIG_IN7_IDX 90 -#define RMT_SIG_OUT3_IDX 90 -#define RMT_SIG_OUT4_IDX 91 -#define RMT_SIG_OUT5_IDX 92 -#define EXT_ADC_START_IDX 93 -#define RMT_SIG_OUT6_IDX 93 -#define CAN_RX_IDX 94 -#define RMT_SIG_OUT7_IDX 94 -#define I2CEXT1_SCL_IN_IDX 95 -#define I2CEXT1_SCL_OUT_IDX 95 -#define I2CEXT1_SDA_IN_IDX 96 -#define I2CEXT1_SDA_OUT_IDX 96 -#define HOST_CARD_DETECT_N_1_IDX 97 -#define HOST_CCMD_OD_PULLUP_EN_N_IDX 97 -#define HOST_CARD_DETECT_N_2_IDX 98 -#define HOST_RST_N_1_IDX 98 -#define HOST_CARD_WRITE_PRT_1_IDX 99 -#define HOST_RST_N_2_IDX 99 -#define HOST_CARD_WRITE_PRT_2_IDX 100 -#define GPIO_SD0_OUT_IDX 100 -#define HOST_CARD_INT_N_1_IDX 101 -#define GPIO_SD1_OUT_IDX 101 -#define HOST_CARD_INT_N_2_IDX 102 -#define GPIO_SD2_OUT_IDX 102 -#define PWM1_SYNC0_IN_IDX 103 -#define GPIO_SD3_OUT_IDX 103 -#define PWM1_SYNC1_IN_IDX 104 -#define GPIO_SD4_OUT_IDX 104 -#define PWM1_SYNC2_IN_IDX 105 -#define GPIO_SD5_OUT_IDX 105 -#define PWM1_F0_IN_IDX 106 -#define GPIO_SD6_OUT_IDX 106 -#define PWM1_F1_IN_IDX 107 -#define GPIO_SD7_OUT_IDX 107 -#define PWM1_F2_IN_IDX 108 -#define PWM1_OUT0A_IDX 108 -#define PWM0_CAP0_IN_IDX 109 -#define PWM1_OUT0B_IDX 109 -#define PWM0_CAP1_IN_IDX 110 -#define PWM1_OUT1A_IDX 110 -#define PWM0_CAP2_IN_IDX 111 -#define PWM1_OUT1B_IDX 111 -#define PWM1_CAP0_IN_IDX 112 -#define PWM1_OUT2A_IDX 112 -#define PWM1_CAP1_IN_IDX 113 -#define PWM1_OUT2B_IDX 113 -#define PWM1_CAP2_IN_IDX 114 -#define PWM2_OUT1H_IDX 114 -#define PWM2_FLTA_IDX 115 -#define PWM2_OUT1L_IDX 115 -#define PWM2_FLTB_IDX 116 -#define PWM2_OUT2H_IDX 116 -#define PWM2_CAP1_IN_IDX 117 -#define PWM2_OUT2L_IDX 117 -#define PWM2_CAP2_IN_IDX 118 -#define PWM2_OUT3H_IDX 118 -#define PWM2_CAP3_IN_IDX 119 -#define PWM2_OUT3L_IDX 119 -#define PWM3_FLTA_IDX 120 -#define PWM2_OUT4H_IDX 120 -#define PWM3_FLTB_IDX 121 -#define PWM2_OUT4L_IDX 121 -#define PWM3_CAP1_IN_IDX 122 -#define PWM3_CAP2_IN_IDX 123 -#define CAN_TX_IDX 123 -#define PWM3_CAP3_IN_IDX 124 -#define CAN_BUS_OFF_ON_IDX 124 -#define CAN_CLKOUT_IDX 125 -#define SPID4_IN_IDX 128 -#define SPID4_OUT_IDX 128 -#define SPID5_IN_IDX 129 -#define SPID5_OUT_IDX 129 -#define SPID6_IN_IDX 130 -#define SPID6_OUT_IDX 130 -#define SPID7_IN_IDX 131 -#define SPID7_OUT_IDX 131 -#define HSPID4_IN_IDX 132 -#define HSPID4_OUT_IDX 132 -#define HSPID5_IN_IDX 133 -#define HSPID5_OUT_IDX 133 -#define HSPID6_IN_IDX 134 -#define HSPID6_OUT_IDX 134 -#define HSPID7_IN_IDX 135 -#define HSPID7_OUT_IDX 135 -#define VSPID4_IN_IDX 136 -#define VSPID4_OUT_IDX 136 -#define VSPID5_IN_IDX 137 -#define VSPID5_OUT_IDX 137 -#define VSPID6_IN_IDX 138 -#define VSPID6_OUT_IDX 138 -#define VSPID7_IN_IDX 139 -#define VSPID7_OUT_IDX 139 -#define I2S0I_DATA_IN0_IDX 140 -#define I2S0O_DATA_OUT0_IDX 140 -#define I2S0I_DATA_IN1_IDX 141 -#define I2S0O_DATA_OUT1_IDX 141 -#define I2S0I_DATA_IN2_IDX 142 -#define I2S0O_DATA_OUT2_IDX 142 -#define I2S0I_DATA_IN3_IDX 143 -#define I2S0O_DATA_OUT3_IDX 143 -#define I2S0I_DATA_IN4_IDX 144 -#define I2S0O_DATA_OUT4_IDX 144 -#define I2S0I_DATA_IN5_IDX 145 -#define I2S0O_DATA_OUT5_IDX 145 -#define I2S0I_DATA_IN6_IDX 146 -#define I2S0O_DATA_OUT6_IDX 146 -#define I2S0I_DATA_IN7_IDX 147 -#define I2S0O_DATA_OUT7_IDX 147 -#define I2S0I_DATA_IN8_IDX 148 -#define I2S0O_DATA_OUT8_IDX 148 -#define I2S0I_DATA_IN9_IDX 149 -#define I2S0O_DATA_OUT9_IDX 149 -#define I2S0I_DATA_IN10_IDX 150 -#define I2S0O_DATA_OUT10_IDX 150 -#define I2S0I_DATA_IN11_IDX 151 -#define I2S0O_DATA_OUT11_IDX 151 -#define I2S0I_DATA_IN12_IDX 152 -#define I2S0O_DATA_OUT12_IDX 152 -#define I2S0I_DATA_IN13_IDX 153 -#define I2S0O_DATA_OUT13_IDX 153 -#define I2S0I_DATA_IN14_IDX 154 -#define I2S0O_DATA_OUT14_IDX 154 -#define I2S0I_DATA_IN15_IDX 155 -#define I2S0O_DATA_OUT15_IDX 155 -#define I2S0O_DATA_OUT16_IDX 156 -#define I2S0O_DATA_OUT17_IDX 157 -#define I2S0O_DATA_OUT18_IDX 158 -#define I2S0O_DATA_OUT19_IDX 159 -#define I2S0O_DATA_OUT20_IDX 160 -#define I2S0O_DATA_OUT21_IDX 161 -#define I2S0O_DATA_OUT22_IDX 162 -#define I2S0O_DATA_OUT23_IDX 163 -#define I2S1I_BCK_IN_IDX 164 -#define I2S1I_BCK_OUT_IDX 164 -#define I2S1I_WS_IN_IDX 165 -#define I2S1I_WS_OUT_IDX 165 -#define I2S1I_DATA_IN0_IDX 166 -#define I2S1O_DATA_OUT0_IDX 166 -#define I2S1I_DATA_IN1_IDX 167 -#define I2S1O_DATA_OUT1_IDX 167 -#define I2S1I_DATA_IN2_IDX 168 -#define I2S1O_DATA_OUT2_IDX 168 -#define I2S1I_DATA_IN3_IDX 169 -#define I2S1O_DATA_OUT3_IDX 169 -#define I2S1I_DATA_IN4_IDX 170 -#define I2S1O_DATA_OUT4_IDX 170 -#define I2S1I_DATA_IN5_IDX 171 -#define I2S1O_DATA_OUT5_IDX 171 -#define I2S1I_DATA_IN6_IDX 172 -#define I2S1O_DATA_OUT6_IDX 172 -#define I2S1I_DATA_IN7_IDX 173 -#define I2S1O_DATA_OUT7_IDX 173 -#define I2S1I_DATA_IN8_IDX 174 -#define I2S1O_DATA_OUT8_IDX 174 -#define I2S1I_DATA_IN9_IDX 175 -#define I2S1O_DATA_OUT9_IDX 175 -#define I2S1I_DATA_IN10_IDX 176 -#define I2S1O_DATA_OUT10_IDX 176 -#define I2S1I_DATA_IN11_IDX 177 -#define I2S1O_DATA_OUT11_IDX 177 -#define I2S1I_DATA_IN12_IDX 178 -#define I2S1O_DATA_OUT12_IDX 178 -#define I2S1I_DATA_IN13_IDX 179 -#define I2S1O_DATA_OUT13_IDX 179 -#define I2S1I_DATA_IN14_IDX 180 -#define I2S1O_DATA_OUT14_IDX 180 -#define I2S1I_DATA_IN15_IDX 181 -#define I2S1O_DATA_OUT15_IDX 181 -#define I2S1O_DATA_OUT16_IDX 182 -#define I2S1O_DATA_OUT17_IDX 183 -#define I2S1O_DATA_OUT18_IDX 184 -#define I2S1O_DATA_OUT19_IDX 185 -#define I2S1O_DATA_OUT20_IDX 186 -#define I2S1O_DATA_OUT21_IDX 187 -#define I2S1O_DATA_OUT22_IDX 188 -#define I2S1O_DATA_OUT23_IDX 189 -#define I2S0I_H_SYNC_IDX 190 -#define PWM3_OUT1H_IDX 190 -#define I2S0I_V_SYNC_IDX 191 -#define PWM3_OUT1L_IDX 191 -#define I2S0I_H_ENABLE_IDX 192 -#define PWM3_OUT2H_IDX 192 -#define I2S1I_H_SYNC_IDX 193 -#define PWM3_OUT2L_IDX 193 -#define I2S1I_V_SYNC_IDX 194 -#define PWM3_OUT3H_IDX 194 -#define I2S1I_H_ENABLE_IDX 195 -#define PWM3_OUT3L_IDX 195 -#define PWM3_OUT4H_IDX 196 -#define PWM3_OUT4L_IDX 197 -#define U2RXD_IN_IDX 198 -#define U2TXD_OUT_IDX 198 -#define U2CTS_IN_IDX 199 -#define U2RTS_OUT_IDX 199 -#define EMAC_MDC_I_IDX 200 -#define EMAC_MDC_O_IDX 200 -#define EMAC_MDI_I_IDX 201 -#define EMAC_MDO_O_IDX 201 -#define EMAC_CRS_I_IDX 202 -#define EMAC_CRS_O_IDX 202 -#define EMAC_COL_I_IDX 203 -#define EMAC_COL_O_IDX 203 -#define PCMFSYNC_IN_IDX 204 -#define BT_AUDIO0_IRQ_IDX 204 -#define PCMCLK_IN_IDX 205 -#define BT_AUDIO1_IRQ_IDX 205 -#define PCMDIN_IDX 206 -#define BT_AUDIO2_IRQ_IDX 206 -#define BLE_AUDIO0_IRQ_IDX 207 -#define BLE_AUDIO1_IRQ_IDX 208 -#define BLE_AUDIO2_IRQ_IDX 209 -#define PCMFSYNC_OUT_IDX 210 -#define PCMCLK_OUT_IDX 211 -#define PCMDOUT_IDX 212 -#define BLE_AUDIO_SYNC0_P_IDX 213 -#define BLE_AUDIO_SYNC1_P_IDX 214 -#define BLE_AUDIO_SYNC2_P_IDX 215 -#define ANT_SEL0_IDX 216 -#define ANT_SEL1_IDX 217 -#define ANT_SEL2_IDX 218 -#define ANT_SEL3_IDX 219 -#define ANT_SEL4_IDX 220 -#define ANT_SEL5_IDX 221 -#define ANT_SEL6_IDX 222 -#define ANT_SEL7_IDX 223 -#define SIG_IN_FUNC224_IDX 224 -#define SIG_IN_FUNC225_IDX 225 -#define SIG_IN_FUNC226_IDX 226 -#define SIG_IN_FUNC227_IDX 227 -#define SIG_IN_FUNC228_IDX 228 -#define SIG_GPIO_OUT_IDX 256 -#endif /* _SOC_GPIO_SIG_MAP_H_ */ diff --git a/tools/sdk/include/soc/soc/gpio_struct.h b/tools/sdk/include/soc/soc/gpio_struct.h deleted file mode 100644 index 46ee88229c2..00000000000 --- a/tools/sdk/include/soc/soc/gpio_struct.h +++ /dev/null @@ -1,214 +0,0 @@ -// 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. -#ifndef _SOC_GPIO_STRUCT_H_ -#define _SOC_GPIO_STRUCT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef volatile struct { - uint32_t bt_select; /*NA*/ - uint32_t out; /*GPIO0~31 output value*/ - uint32_t out_w1ts; /*GPIO0~31 output value write 1 to set*/ - uint32_t out_w1tc; /*GPIO0~31 output value write 1 to clear*/ - union { - struct { - uint32_t data: 8; /*GPIO32~39 output value*/ - uint32_t reserved8: 24; - }; - uint32_t val; - } out1; - union { - struct { - uint32_t data: 8; /*GPIO32~39 output value write 1 to set*/ - uint32_t reserved8: 24; - }; - uint32_t val; - } out1_w1ts; - union { - struct { - uint32_t data: 8; /*GPIO32~39 output value write 1 to clear*/ - uint32_t reserved8: 24; - }; - uint32_t val; - } out1_w1tc; - union { - struct { - uint32_t sel: 8; /*SDIO PADS on/off control from outside*/ - uint32_t reserved8: 24; - }; - uint32_t val; - } sdio_select; - uint32_t enable; /*GPIO0~31 output enable*/ - uint32_t enable_w1ts; /*GPIO0~31 output enable write 1 to set*/ - uint32_t enable_w1tc; /*GPIO0~31 output enable write 1 to clear*/ - union { - struct { - uint32_t data: 8; /*GPIO32~39 output enable*/ - uint32_t reserved8: 24; - }; - uint32_t val; - } enable1; - union { - struct { - uint32_t data: 8; /*GPIO32~39 output enable write 1 to set*/ - uint32_t reserved8: 24; - }; - uint32_t val; - } enable1_w1ts; - union { - struct { - uint32_t data: 8; /*GPIO32~39 output enable write 1 to clear*/ - uint32_t reserved8: 24; - }; - uint32_t val; - } enable1_w1tc; - union { - struct { - uint32_t strapping: 16; /*GPIO strapping results: {2'd0 boot_sel_dig[7:1] vsdio_boot_sel boot_sel_chip[5:0]} . Boot_sel_dig[7:1]: {U0RXD SD_CLK SD_CMD SD_DATA0 SD_DATA1 SD_DATA2 SD_DATA3} . vsdio_boot_sel: MTDI. boot_sel_chip[5:0]: {GPIO0 U0TXD GPIO2 GPIO4 MTDO GPIO5} */ - uint32_t reserved16:16; - }; - uint32_t val; - } strap; - uint32_t in; /*GPIO0~31 input value*/ - union { - struct { - uint32_t data: 8; /*GPIO32~39 input value*/ - uint32_t reserved8: 24; - }; - uint32_t val; - } in1; - uint32_t status; /*GPIO0~31 interrupt status*/ - uint32_t status_w1ts; /*GPIO0~31 interrupt status write 1 to set*/ - uint32_t status_w1tc; /*GPIO0~31 interrupt status write 1 to clear*/ - union { - struct { - uint32_t intr_st: 8; /*GPIO32~39 interrupt status*/ - uint32_t reserved8: 24; - }; - uint32_t val; - } status1; - union { - struct { - uint32_t intr_st: 8; /*GPIO32~39 interrupt status write 1 to set*/ - uint32_t reserved8: 24; - }; - uint32_t val; - } status1_w1ts; - union { - struct { - uint32_t intr_st: 8; /*GPIO32~39 interrupt status write 1 to clear*/ - uint32_t reserved8: 24; - }; - uint32_t val; - } status1_w1tc; - uint32_t reserved_5c; - uint32_t acpu_int; /*GPIO0~31 APP CPU interrupt status*/ - uint32_t acpu_nmi_int; /*GPIO0~31 APP CPU non-maskable interrupt status*/ - uint32_t pcpu_int; /*GPIO0~31 PRO CPU interrupt status*/ - uint32_t pcpu_nmi_int; /*GPIO0~31 PRO CPU non-maskable interrupt status*/ - uint32_t cpusdio_int; /*SDIO's extent GPIO0~31 interrupt*/ - union { - struct { - uint32_t intr: 8; /*GPIO32~39 APP CPU interrupt status*/ - uint32_t reserved8: 24; - }; - uint32_t val; - } acpu_int1; - union { - struct { - uint32_t intr: 8; /*GPIO32~39 APP CPU non-maskable interrupt status*/ - uint32_t reserved8: 24; - }; - uint32_t val; - } acpu_nmi_int1; - union { - struct { - uint32_t intr: 8; /*GPIO32~39 PRO CPU interrupt status*/ - uint32_t reserved8: 24; - }; - uint32_t val; - } pcpu_int1; - union { - struct { - uint32_t intr: 8; /*GPIO32~39 PRO CPU non-maskable interrupt status*/ - uint32_t reserved8: 24; - }; - uint32_t val; - } pcpu_nmi_int1; - union { - struct { - uint32_t intr: 8; /*SDIO's extent GPIO32~39 interrupt*/ - uint32_t reserved8: 24; - }; - uint32_t val; - } cpusdio_int1; - union { - struct { - uint32_t reserved0: 2; - uint32_t pad_driver: 1; /*if set to 0: normal output if set to 1: open drain*/ - uint32_t reserved3: 4; - uint32_t int_type: 3; /*if set to 0: GPIO interrupt disable if set to 1: rising edge trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ - uint32_t wakeup_enable: 1; /*GPIO wake up enable only available in light sleep*/ - uint32_t config: 2; /*NA*/ - uint32_t int_ena: 5; /*bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/ - uint32_t reserved18: 14; - }; - uint32_t val; - } pin[40]; - union { - struct { - uint32_t rtc_max: 10; - uint32_t reserved10: 21; - uint32_t start: 1; - }; - uint32_t val; - } cali_conf; - union { - struct { - uint32_t value_sync2: 20; - uint32_t reserved20: 10; - uint32_t rdy_real: 1; - uint32_t rdy_sync2: 1; - }; - uint32_t val; - } cali_data; - union { - struct { - uint32_t func_sel: 6; /*select one of the 256 inputs*/ - uint32_t sig_in_inv: 1; /*revert the value of the input if you want to revert please set the value to 1*/ - uint32_t sig_in_sel: 1; /*if the slow signal bypass the io matrix or not if you want setting the value to 1*/ - uint32_t reserved8: 24; /*The 256 registers below are selection control for 256 input signals connected to GPIO matrix's 40 GPIO input if GPIO_FUNCx_IN_SEL is set to n(0<=n<40): it means GPIOn input is used for input signal x if GPIO_FUNCx_IN_SEL is set to 0x38: the input signal x is set to 1 if GPIO_FUNCx_IN_SEL is set to 0x30: the input signal x is set to 0*/ - }; - uint32_t val; - } func_in_sel_cfg[256]; - union { - struct { - uint32_t func_sel: 9; /*select one of the 256 output to 40 GPIO*/ - uint32_t inv_sel: 1; /*invert the output value if you want to revert the output value setting the value to 1*/ - uint32_t oen_sel: 1; /*weather using the logical oen signal or not using the value setting by the register*/ - uint32_t oen_inv_sel: 1; /*invert the output enable value if you want to revert the output enable value setting the value to 1*/ - uint32_t reserved12: 20; /*The 40 registers below are selection control for 40 GPIO output if GPIO_FUNCx_OUT_SEL is set to n(0<=n<256): it means GPIOn input is used for output signal x if GPIO_FUNCx_OUT_INV_SEL is set to 1 the output signal x is set to ~value. if GPIO_FUNC0_OUT_SEL is 256 or GPIO_FUNC0_OEN_SEL is 1 using GPIO_ENABLE_DATA[x] for the enable value else using the signal enable*/ - }; - uint32_t val; - } func_out_sel_cfg[40]; -} gpio_dev_t; -extern gpio_dev_t GPIO; - -#ifdef __cplusplus -} -#endif - -#endif /* _SOC_GPIO_STRUCT_H_ */ diff --git a/tools/sdk/include/soc/soc/hinf_reg.h b/tools/sdk/include/soc/soc/hinf_reg.h deleted file mode 100644 index aad357864eb..00000000000 --- a/tools/sdk/include/soc/soc/hinf_reg.h +++ /dev/null @@ -1,248 +0,0 @@ -// 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. -#ifndef _SOC_HINF_REG_H_ -#define _SOC_HINF_REG_H_ - - -#include "soc.h" -#define HINF_CFG_DATA0_REG (DR_REG_HINF_BASE + 0x0) -/* HINF_DEVICE_ID_FN1 : R/W ;bitpos:[31:16] ;default: 16'h2222 ; */ -/*description: */ -#define HINF_DEVICE_ID_FN1 0x0000FFFF -#define HINF_DEVICE_ID_FN1_M ((HINF_DEVICE_ID_FN1_V)<<(HINF_DEVICE_ID_FN1_S)) -#define HINF_DEVICE_ID_FN1_V 0xFFFF -#define HINF_DEVICE_ID_FN1_S 16 -/* HINF_USER_ID_FN1 : R/W ;bitpos:[15:0] ;default: 16'h6666 ; */ -/*description: */ -#define HINF_USER_ID_FN1 0x0000FFFF -#define HINF_USER_ID_FN1_M ((HINF_USER_ID_FN1_V)<<(HINF_USER_ID_FN1_S)) -#define HINF_USER_ID_FN1_V 0xFFFF -#define HINF_USER_ID_FN1_S 0 - -#define HINF_CFG_DATA1_REG (DR_REG_HINF_BASE + 0x4) -/* HINF_SDIO20_CONF1 : R/W ;bitpos:[31:29] ;default: 3'h0 ; */ -/*description: */ -#define HINF_SDIO20_CONF1 0x00000007 -#define HINF_SDIO20_CONF1_M ((HINF_SDIO20_CONF1_V)<<(HINF_SDIO20_CONF1_S)) -#define HINF_SDIO20_CONF1_V 0x7 -#define HINF_SDIO20_CONF1_S 29 -/* HINF_FUNC2_EPS : RO ;bitpos:[28] ;default: 1'b0 ; */ -/*description: */ -#define HINF_FUNC2_EPS (BIT(28)) -#define HINF_FUNC2_EPS_M (BIT(28)) -#define HINF_FUNC2_EPS_V 0x1 -#define HINF_FUNC2_EPS_S 28 -/* HINF_SDIO_VER : R/W ;bitpos:[27:16] ;default: 12'h111 ; */ -/*description: */ -#define HINF_SDIO_VER 0x00000FFF -#define HINF_SDIO_VER_M ((HINF_SDIO_VER_V)<<(HINF_SDIO_VER_S)) -#define HINF_SDIO_VER_V 0xFFF -#define HINF_SDIO_VER_S 16 -/* HINF_SDIO20_CONF0 : R/W ;bitpos:[15:12] ;default: 4'b0 ; */ -/*description: */ -#define HINF_SDIO20_CONF0 0x0000000F -#define HINF_SDIO20_CONF0_M ((HINF_SDIO20_CONF0_V)<<(HINF_SDIO20_CONF0_S)) -#define HINF_SDIO20_CONF0_V 0xF -#define HINF_SDIO20_CONF0_S 12 -/* HINF_IOENABLE1 : RO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define HINF_IOENABLE1 (BIT(11)) -#define HINF_IOENABLE1_M (BIT(11)) -#define HINF_IOENABLE1_V 0x1 -#define HINF_IOENABLE1_S 11 -/* HINF_EMP : RO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define HINF_EMP (BIT(10)) -#define HINF_EMP_M (BIT(10)) -#define HINF_EMP_V 0x1 -#define HINF_EMP_S 10 -/* HINF_FUNC1_EPS : RO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define HINF_FUNC1_EPS (BIT(9)) -#define HINF_FUNC1_EPS_M (BIT(9)) -#define HINF_FUNC1_EPS_V 0x1 -#define HINF_FUNC1_EPS_S 9 -/* HINF_CD_DISABLE : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define HINF_CD_DISABLE (BIT(8)) -#define HINF_CD_DISABLE_M (BIT(8)) -#define HINF_CD_DISABLE_V 0x1 -#define HINF_CD_DISABLE_S 8 -/* HINF_IOENABLE2 : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define HINF_IOENABLE2 (BIT(7)) -#define HINF_IOENABLE2_M (BIT(7)) -#define HINF_IOENABLE2_V 0x1 -#define HINF_IOENABLE2_S 7 -/* HINF_SDIO_INT_MASK : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define HINF_SDIO_INT_MASK (BIT(6)) -#define HINF_SDIO_INT_MASK_M (BIT(6)) -#define HINF_SDIO_INT_MASK_V 0x1 -#define HINF_SDIO_INT_MASK_S 6 -/* HINF_SDIO_IOREADY2 : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define HINF_SDIO_IOREADY2 (BIT(5)) -#define HINF_SDIO_IOREADY2_M (BIT(5)) -#define HINF_SDIO_IOREADY2_V 0x1 -#define HINF_SDIO_IOREADY2_S 5 -/* HINF_SDIO_CD_ENABLE : R/W ;bitpos:[4] ;default: 1'b1 ; */ -/*description: */ -#define HINF_SDIO_CD_ENABLE (BIT(4)) -#define HINF_SDIO_CD_ENABLE_M (BIT(4)) -#define HINF_SDIO_CD_ENABLE_V 0x1 -#define HINF_SDIO_CD_ENABLE_S 4 -/* HINF_HIGHSPEED_MODE : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define HINF_HIGHSPEED_MODE (BIT(3)) -#define HINF_HIGHSPEED_MODE_M (BIT(3)) -#define HINF_HIGHSPEED_MODE_V 0x1 -#define HINF_HIGHSPEED_MODE_S 3 -/* HINF_HIGHSPEED_ENABLE : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define HINF_HIGHSPEED_ENABLE (BIT(2)) -#define HINF_HIGHSPEED_ENABLE_M (BIT(2)) -#define HINF_HIGHSPEED_ENABLE_V 0x1 -#define HINF_HIGHSPEED_ENABLE_S 2 -/* HINF_SDIO_IOREADY1 : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define HINF_SDIO_IOREADY1 (BIT(1)) -#define HINF_SDIO_IOREADY1_M (BIT(1)) -#define HINF_SDIO_IOREADY1_V 0x1 -#define HINF_SDIO_IOREADY1_S 1 -/* HINF_SDIO_ENABLE : R/W ;bitpos:[0] ;default: 1'b1 ; */ -/*description: */ -#define HINF_SDIO_ENABLE (BIT(0)) -#define HINF_SDIO_ENABLE_M (BIT(0)) -#define HINF_SDIO_ENABLE_V 0x1 -#define HINF_SDIO_ENABLE_S 0 - -#define HINF_CFG_DATA7_REG (DR_REG_HINF_BASE + 0x1C) -/* HINF_SDIO_IOREADY0 : R/W ;bitpos:[17] ;default: 1'b1 ; */ -/*description: */ -#define HINF_SDIO_IOREADY0 (BIT(17)) -#define HINF_SDIO_IOREADY0_M (BIT(17)) -#define HINF_SDIO_IOREADY0_V 0x1 -#define HINF_SDIO_IOREADY0_S 17 -/* HINF_SDIO_RST : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define HINF_SDIO_RST (BIT(16)) -#define HINF_SDIO_RST_M (BIT(16)) -#define HINF_SDIO_RST_V 0x1 -#define HINF_SDIO_RST_S 16 -/* HINF_CHIP_STATE : R/W ;bitpos:[15:8] ;default: 8'b0 ; */ -/*description: */ -#define HINF_CHIP_STATE 0x000000FF -#define HINF_CHIP_STATE_M ((HINF_CHIP_STATE_V)<<(HINF_CHIP_STATE_S)) -#define HINF_CHIP_STATE_V 0xFF -#define HINF_CHIP_STATE_S 8 -/* HINF_PIN_STATE : R/W ;bitpos:[7:0] ;default: 8'b0 ; */ -/*description: */ -#define HINF_PIN_STATE 0x000000FF -#define HINF_PIN_STATE_M ((HINF_PIN_STATE_V)<<(HINF_PIN_STATE_S)) -#define HINF_PIN_STATE_V 0xFF -#define HINF_PIN_STATE_S 0 - -#define HINF_CIS_CONF0_REG (DR_REG_HINF_BASE + 0x20) -/* HINF_CIS_CONF_W0 : R/W ;bitpos:[31:0] ;default: 32'hffffffff ; */ -/*description: */ -#define HINF_CIS_CONF_W0 0xFFFFFFFF -#define HINF_CIS_CONF_W0_M ((HINF_CIS_CONF_W0_V)<<(HINF_CIS_CONF_W0_S)) -#define HINF_CIS_CONF_W0_V 0xFFFFFFFF -#define HINF_CIS_CONF_W0_S 0 - -#define HINF_CIS_CONF1_REG (DR_REG_HINF_BASE + 0x24) -/* HINF_CIS_CONF_W1 : R/W ;bitpos:[31:0] ;default: 32'hffffffff ; */ -/*description: */ -#define HINF_CIS_CONF_W1 0xFFFFFFFF -#define HINF_CIS_CONF_W1_M ((HINF_CIS_CONF_W1_V)<<(HINF_CIS_CONF_W1_S)) -#define HINF_CIS_CONF_W1_V 0xFFFFFFFF -#define HINF_CIS_CONF_W1_S 0 - -#define HINF_CIS_CONF2_REG (DR_REG_HINF_BASE + 0x28) -/* HINF_CIS_CONF_W2 : R/W ;bitpos:[31:0] ;default: 32'hffffffff ; */ -/*description: */ -#define HINF_CIS_CONF_W2 0xFFFFFFFF -#define HINF_CIS_CONF_W2_M ((HINF_CIS_CONF_W2_V)<<(HINF_CIS_CONF_W2_S)) -#define HINF_CIS_CONF_W2_V 0xFFFFFFFF -#define HINF_CIS_CONF_W2_S 0 - -#define HINF_CIS_CONF3_REG (DR_REG_HINF_BASE + 0x2C) -/* HINF_CIS_CONF_W3 : R/W ;bitpos:[31:0] ;default: 32'hffffffff ; */ -/*description: */ -#define HINF_CIS_CONF_W3 0xFFFFFFFF -#define HINF_CIS_CONF_W3_M ((HINF_CIS_CONF_W3_V)<<(HINF_CIS_CONF_W3_S)) -#define HINF_CIS_CONF_W3_V 0xFFFFFFFF -#define HINF_CIS_CONF_W3_S 0 - -#define HINF_CIS_CONF4_REG (DR_REG_HINF_BASE + 0x30) -/* HINF_CIS_CONF_W4 : R/W ;bitpos:[31:0] ;default: 32'hffffffff ; */ -/*description: */ -#define HINF_CIS_CONF_W4 0xFFFFFFFF -#define HINF_CIS_CONF_W4_M ((HINF_CIS_CONF_W4_V)<<(HINF_CIS_CONF_W4_S)) -#define HINF_CIS_CONF_W4_V 0xFFFFFFFF -#define HINF_CIS_CONF_W4_S 0 - -#define HINF_CIS_CONF5_REG (DR_REG_HINF_BASE + 0x34) -/* HINF_CIS_CONF_W5 : R/W ;bitpos:[31:0] ;default: 32'hffffffff ; */ -/*description: */ -#define HINF_CIS_CONF_W5 0xFFFFFFFF -#define HINF_CIS_CONF_W5_M ((HINF_CIS_CONF_W5_V)<<(HINF_CIS_CONF_W5_S)) -#define HINF_CIS_CONF_W5_V 0xFFFFFFFF -#define HINF_CIS_CONF_W5_S 0 - -#define HINF_CIS_CONF6_REG (DR_REG_HINF_BASE + 0x38) -/* HINF_CIS_CONF_W6 : R/W ;bitpos:[31:0] ;default: 32'hffffffff ; */ -/*description: */ -#define HINF_CIS_CONF_W6 0xFFFFFFFF -#define HINF_CIS_CONF_W6_M ((HINF_CIS_CONF_W6_V)<<(HINF_CIS_CONF_W6_S)) -#define HINF_CIS_CONF_W6_V 0xFFFFFFFF -#define HINF_CIS_CONF_W6_S 0 - -#define HINF_CIS_CONF7_REG (DR_REG_HINF_BASE + 0x3C) -/* HINF_CIS_CONF_W7 : R/W ;bitpos:[31:0] ;default: 32'hffffffff ; */ -/*description: */ -#define HINF_CIS_CONF_W7 0xFFFFFFFF -#define HINF_CIS_CONF_W7_M ((HINF_CIS_CONF_W7_V)<<(HINF_CIS_CONF_W7_S)) -#define HINF_CIS_CONF_W7_V 0xFFFFFFFF -#define HINF_CIS_CONF_W7_S 0 - -#define HINF_CFG_DATA16_REG (DR_REG_HINF_BASE + 0x40) -/* HINF_DEVICE_ID_FN2 : R/W ;bitpos:[31:16] ;default: 16'h3333 ; */ -/*description: */ -#define HINF_DEVICE_ID_FN2 0x0000FFFF -#define HINF_DEVICE_ID_FN2_M ((HINF_DEVICE_ID_FN2_V)<<(HINF_DEVICE_ID_FN2_S)) -#define HINF_DEVICE_ID_FN2_V 0xFFFF -#define HINF_DEVICE_ID_FN2_S 16 -/* HINF_USER_ID_FN2 : R/W ;bitpos:[15:0] ;default: 16'h6666 ; */ -/*description: */ -#define HINF_USER_ID_FN2 0x0000FFFF -#define HINF_USER_ID_FN2_M ((HINF_USER_ID_FN2_V)<<(HINF_USER_ID_FN2_S)) -#define HINF_USER_ID_FN2_V 0xFFFF -#define HINF_USER_ID_FN2_S 0 - -#define HINF_DATE_REG (DR_REG_HINF_BASE + 0xFC) -/* HINF_SDIO_DATE : R/W ;bitpos:[31:0] ;default: 32'h15030200 ; */ -/*description: */ -#define HINF_SDIO_DATE 0xFFFFFFFF -#define HINF_SDIO_DATE_M ((HINF_SDIO_DATE_V)<<(HINF_SDIO_DATE_S)) -#define HINF_SDIO_DATE_V 0xFFFFFFFF -#define HINF_SDIO_DATE_S 0 - - - - -#endif /*_SOC_HINF_REG_H_ */ - - diff --git a/tools/sdk/include/soc/soc/hinf_struct.h b/tools/sdk/include/soc/soc/hinf_struct.h deleted file mode 100644 index 1c2d9e3b784..00000000000 --- a/tools/sdk/include/soc/soc/hinf_struct.h +++ /dev/null @@ -1,134 +0,0 @@ -// 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. -#ifndef _SOC_HINF_STRUCT_H_ -#define _SOC_HINF_STRUCT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef volatile struct { - union { - struct { - uint32_t user_id_fn1: 16; - uint32_t device_id_fn1:16; - }; - uint32_t val; - } cfg_data0; - union { - struct { - uint32_t sdio_enable: 1; - uint32_t sdio_ioready1: 1; - uint32_t highspeed_enable: 1; - uint32_t highspeed_mode: 1; - uint32_t sdio_cd_enable: 1; - uint32_t sdio_ioready2: 1; - uint32_t sdio_int_mask: 1; - uint32_t ioenable2: 1; - uint32_t cd_disable: 1; - uint32_t func1_eps: 1; - uint32_t emp: 1; - uint32_t ioenable1: 1; - uint32_t sdio20_conf0: 4; - uint32_t sdio_ver: 12; - uint32_t func2_eps: 1; - uint32_t sdio20_conf1: 3; - }; - uint32_t val; - } cfg_data1; - uint32_t reserved_8; - uint32_t reserved_c; - uint32_t reserved_10; - uint32_t reserved_14; - uint32_t reserved_18; - union { - struct { - uint32_t pin_state: 8; - uint32_t chip_state: 8; - uint32_t sdio_rst: 1; - uint32_t sdio_ioready0: 1; - uint32_t reserved18: 14; - }; - uint32_t val; - } cfg_data7; - uint32_t cis_conf0; /**/ - uint32_t cis_conf1; /**/ - uint32_t cis_conf2; /**/ - uint32_t cis_conf3; /**/ - uint32_t cis_conf4; /**/ - uint32_t cis_conf5; /**/ - uint32_t cis_conf6; /**/ - uint32_t cis_conf7; /**/ - union { - struct { - uint32_t user_id_fn2: 16; - uint32_t device_id_fn2:16; - }; - uint32_t val; - } cfg_data16; - uint32_t reserved_44; - uint32_t reserved_48; - uint32_t reserved_4c; - uint32_t reserved_50; - uint32_t reserved_54; - uint32_t reserved_58; - uint32_t reserved_5c; - uint32_t reserved_60; - uint32_t reserved_64; - uint32_t reserved_68; - uint32_t reserved_6c; - uint32_t reserved_70; - uint32_t reserved_74; - uint32_t reserved_78; - uint32_t reserved_7c; - uint32_t reserved_80; - uint32_t reserved_84; - uint32_t reserved_88; - uint32_t reserved_8c; - uint32_t reserved_90; - uint32_t reserved_94; - uint32_t reserved_98; - uint32_t reserved_9c; - uint32_t reserved_a0; - uint32_t reserved_a4; - uint32_t reserved_a8; - uint32_t reserved_ac; - uint32_t reserved_b0; - uint32_t reserved_b4; - uint32_t reserved_b8; - uint32_t reserved_bc; - uint32_t reserved_c0; - uint32_t reserved_c4; - uint32_t reserved_c8; - uint32_t reserved_cc; - uint32_t reserved_d0; - uint32_t reserved_d4; - uint32_t reserved_d8; - uint32_t reserved_dc; - uint32_t reserved_e0; - uint32_t reserved_e4; - uint32_t reserved_e8; - uint32_t reserved_ec; - uint32_t reserved_f0; - uint32_t reserved_f4; - uint32_t reserved_f8; - uint32_t date; /**/ -} hinf_dev_t; -extern hinf_dev_t HINF; - -#ifdef __cplusplus -} -#endif - -#endif /* _SOC_HINF_STRUCT_H_ */ diff --git a/tools/sdk/include/soc/soc/host_reg.h b/tools/sdk/include/soc/soc/host_reg.h deleted file mode 100644 index ef556e21cdc..00000000000 --- a/tools/sdk/include/soc/soc/host_reg.h +++ /dev/null @@ -1,3144 +0,0 @@ -// 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. -#ifndef _SOC_HOST_REG_H_ -#define _SOC_HOST_REG_H_ - - -#include "soc.h" -#define HOST_SLCHOST_FUNC2_0_REG (DR_REG_SLCHOST_BASE + 0x10) -/* HOST_SLC_FUNC2_INT : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC_FUNC2_INT (BIT(24)) -#define HOST_SLC_FUNC2_INT_M (BIT(24)) -#define HOST_SLC_FUNC2_INT_V 0x1 -#define HOST_SLC_FUNC2_INT_S 24 - -#define HOST_SLCHOST_FUNC2_1_REG (DR_REG_SLCHOST_BASE + 0x14) -/* HOST_SLC_FUNC2_INT_EN : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC_FUNC2_INT_EN (BIT(0)) -#define HOST_SLC_FUNC2_INT_EN_M (BIT(0)) -#define HOST_SLC_FUNC2_INT_EN_V 0x1 -#define HOST_SLC_FUNC2_INT_EN_S 0 - -#define HOST_SLCHOST_FUNC2_2_REG (DR_REG_SLCHOST_BASE + 0x20) -/* HOST_SLC_FUNC1_MDSTAT : R/W ;bitpos:[0] ;default: 1'b1 ; */ -/*description: */ -#define HOST_SLC_FUNC1_MDSTAT (BIT(0)) -#define HOST_SLC_FUNC1_MDSTAT_M (BIT(0)) -#define HOST_SLC_FUNC1_MDSTAT_V 0x1 -#define HOST_SLC_FUNC1_MDSTAT_S 0 - -#define HOST_SLCHOST_GPIO_STATUS0_REG (DR_REG_SLCHOST_BASE + 0x34) -/* HOST_GPIO_SDIO_INT0 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define HOST_GPIO_SDIO_INT0 0xFFFFFFFF -#define HOST_GPIO_SDIO_INT0_M ((HOST_GPIO_SDIO_INT0_V)<<(HOST_GPIO_SDIO_INT0_S)) -#define HOST_GPIO_SDIO_INT0_V 0xFFFFFFFF -#define HOST_GPIO_SDIO_INT0_S 0 - -#define HOST_SLCHOST_GPIO_STATUS1_REG (DR_REG_SLCHOST_BASE + 0x38) -/* HOST_GPIO_SDIO_INT1 : RO ;bitpos:[7:0] ;default: 8'b0 ; */ -/*description: */ -#define HOST_GPIO_SDIO_INT1 0x000000FF -#define HOST_GPIO_SDIO_INT1_M ((HOST_GPIO_SDIO_INT1_V)<<(HOST_GPIO_SDIO_INT1_S)) -#define HOST_GPIO_SDIO_INT1_V 0xFF -#define HOST_GPIO_SDIO_INT1_S 0 - -#define HOST_SLCHOST_GPIO_IN0_REG (DR_REG_SLCHOST_BASE + 0x3C) -/* HOST_GPIO_SDIO_IN0 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define HOST_GPIO_SDIO_IN0 0xFFFFFFFF -#define HOST_GPIO_SDIO_IN0_M ((HOST_GPIO_SDIO_IN0_V)<<(HOST_GPIO_SDIO_IN0_S)) -#define HOST_GPIO_SDIO_IN0_V 0xFFFFFFFF -#define HOST_GPIO_SDIO_IN0_S 0 - -#define HOST_SLCHOST_GPIO_IN1_REG (DR_REG_SLCHOST_BASE + 0x40) -/* HOST_GPIO_SDIO_IN1 : RO ;bitpos:[7:0] ;default: 8'b0 ; */ -/*description: */ -#define HOST_GPIO_SDIO_IN1 0x000000FF -#define HOST_GPIO_SDIO_IN1_M ((HOST_GPIO_SDIO_IN1_V)<<(HOST_GPIO_SDIO_IN1_S)) -#define HOST_GPIO_SDIO_IN1_V 0xFF -#define HOST_GPIO_SDIO_IN1_S 0 - -#define HOST_SLC0HOST_TOKEN_RDATA_REG (DR_REG_SLCHOST_BASE + 0x44) -/* HOST_SLC0_RX_PF_EOF : RO ;bitpos:[31:28] ;default: 4'h0 ; */ -/*description: */ -#define HOST_SLC0_RX_PF_EOF 0x0000000F -#define HOST_SLC0_RX_PF_EOF_M ((HOST_SLC0_RX_PF_EOF_V)<<(HOST_SLC0_RX_PF_EOF_S)) -#define HOST_SLC0_RX_PF_EOF_V 0xF -#define HOST_SLC0_RX_PF_EOF_S 28 -/* HOST_HOSTSLC0_TOKEN1 : RO ;bitpos:[27:16] ;default: 12'h0 ; */ -/*description: */ -#define HOST_HOSTSLC0_TOKEN1 0x00000FFF -#define HOST_HOSTSLC0_TOKEN1_M ((HOST_HOSTSLC0_TOKEN1_V)<<(HOST_HOSTSLC0_TOKEN1_S)) -#define HOST_HOSTSLC0_TOKEN1_V 0xFFF -#define HOST_HOSTSLC0_TOKEN1_S 16 -/* HOST_SLC0_RX_PF_VALID : RO ;bitpos:[12] ;default: 4'h0 ; */ -/*description: */ -#define HOST_SLC0_RX_PF_VALID (BIT(12)) -#define HOST_SLC0_RX_PF_VALID_M (BIT(12)) -#define HOST_SLC0_RX_PF_VALID_V 0x1 -#define HOST_SLC0_RX_PF_VALID_S 12 -/* HOST_SLC0_TOKEN0 : RO ;bitpos:[11:0] ;default: 12'h0 ; */ -/*description: */ -#define HOST_SLC0_TOKEN0 0x00000FFF -#define HOST_SLC0_TOKEN0_M ((HOST_SLC0_TOKEN0_V)<<(HOST_SLC0_TOKEN0_S)) -#define HOST_SLC0_TOKEN0_V 0xFFF -#define HOST_SLC0_TOKEN0_S 0 - -#define HOST_SLC0_HOST_PF_REG (DR_REG_SLCHOST_BASE + 0x48) -/* HOST_SLC0_PF_DATA : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define HOST_SLC0_PF_DATA 0xFFFFFFFF -#define HOST_SLC0_PF_DATA_M ((HOST_SLC0_PF_DATA_V)<<(HOST_SLC0_PF_DATA_S)) -#define HOST_SLC0_PF_DATA_V 0xFFFFFFFF -#define HOST_SLC0_PF_DATA_S 0 - -#define HOST_SLC1_HOST_PF_REG (DR_REG_SLCHOST_BASE + 0x4C) -/* HOST_SLC1_PF_DATA : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define HOST_SLC1_PF_DATA 0xFFFFFFFF -#define HOST_SLC1_PF_DATA_M ((HOST_SLC1_PF_DATA_V)<<(HOST_SLC1_PF_DATA_S)) -#define HOST_SLC1_PF_DATA_V 0xFFFFFFFF -#define HOST_SLC1_PF_DATA_S 0 - -#define HOST_SLC0HOST_INT_RAW_REG (DR_REG_SLCHOST_BASE + 0x50) -/* HOST_GPIO_SDIO_INT_RAW : RO ;bitpos:[25] ;default: 1'b0 ; */ -/*description: */ -#define HOST_GPIO_SDIO_INT_RAW (BIT(25)) -#define HOST_GPIO_SDIO_INT_RAW_M (BIT(25)) -#define HOST_GPIO_SDIO_INT_RAW_V 0x1 -#define HOST_GPIO_SDIO_INT_RAW_S 25 -/* HOST_SLC0_HOST_RD_RETRY_INT_RAW : RO ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_HOST_RD_RETRY_INT_RAW (BIT(24)) -#define HOST_SLC0_HOST_RD_RETRY_INT_RAW_M (BIT(24)) -#define HOST_SLC0_HOST_RD_RETRY_INT_RAW_V 0x1 -#define HOST_SLC0_HOST_RD_RETRY_INT_RAW_S 24 -/* HOST_SLC0_RX_NEW_PACKET_INT_RAW : RO ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_RX_NEW_PACKET_INT_RAW (BIT(23)) -#define HOST_SLC0_RX_NEW_PACKET_INT_RAW_M (BIT(23)) -#define HOST_SLC0_RX_NEW_PACKET_INT_RAW_V 0x1 -#define HOST_SLC0_RX_NEW_PACKET_INT_RAW_S 23 -/* HOST_SLC0_EXT_BIT3_INT_RAW : RO ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_EXT_BIT3_INT_RAW (BIT(22)) -#define HOST_SLC0_EXT_BIT3_INT_RAW_M (BIT(22)) -#define HOST_SLC0_EXT_BIT3_INT_RAW_V 0x1 -#define HOST_SLC0_EXT_BIT3_INT_RAW_S 22 -/* HOST_SLC0_EXT_BIT2_INT_RAW : RO ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_EXT_BIT2_INT_RAW (BIT(21)) -#define HOST_SLC0_EXT_BIT2_INT_RAW_M (BIT(21)) -#define HOST_SLC0_EXT_BIT2_INT_RAW_V 0x1 -#define HOST_SLC0_EXT_BIT2_INT_RAW_S 21 -/* HOST_SLC0_EXT_BIT1_INT_RAW : RO ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_EXT_BIT1_INT_RAW (BIT(20)) -#define HOST_SLC0_EXT_BIT1_INT_RAW_M (BIT(20)) -#define HOST_SLC0_EXT_BIT1_INT_RAW_V 0x1 -#define HOST_SLC0_EXT_BIT1_INT_RAW_S 20 -/* HOST_SLC0_EXT_BIT0_INT_RAW : RO ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_EXT_BIT0_INT_RAW (BIT(19)) -#define HOST_SLC0_EXT_BIT0_INT_RAW_M (BIT(19)) -#define HOST_SLC0_EXT_BIT0_INT_RAW_V 0x1 -#define HOST_SLC0_EXT_BIT0_INT_RAW_S 19 -/* HOST_SLC0_RX_PF_VALID_INT_RAW : RO ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_RX_PF_VALID_INT_RAW (BIT(18)) -#define HOST_SLC0_RX_PF_VALID_INT_RAW_M (BIT(18)) -#define HOST_SLC0_RX_PF_VALID_INT_RAW_V 0x1 -#define HOST_SLC0_RX_PF_VALID_INT_RAW_S 18 -/* HOST_SLC0_TX_OVF_INT_RAW : RO ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TX_OVF_INT_RAW (BIT(17)) -#define HOST_SLC0_TX_OVF_INT_RAW_M (BIT(17)) -#define HOST_SLC0_TX_OVF_INT_RAW_V 0x1 -#define HOST_SLC0_TX_OVF_INT_RAW_S 17 -/* HOST_SLC0_RX_UDF_INT_RAW : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_RX_UDF_INT_RAW (BIT(16)) -#define HOST_SLC0_RX_UDF_INT_RAW_M (BIT(16)) -#define HOST_SLC0_RX_UDF_INT_RAW_V 0x1 -#define HOST_SLC0_RX_UDF_INT_RAW_S 16 -/* HOST_SLC0HOST_TX_START_INT_RAW : RO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_TX_START_INT_RAW (BIT(15)) -#define HOST_SLC0HOST_TX_START_INT_RAW_M (BIT(15)) -#define HOST_SLC0HOST_TX_START_INT_RAW_V 0x1 -#define HOST_SLC0HOST_TX_START_INT_RAW_S 15 -/* HOST_SLC0HOST_RX_START_INT_RAW : RO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_RX_START_INT_RAW (BIT(14)) -#define HOST_SLC0HOST_RX_START_INT_RAW_M (BIT(14)) -#define HOST_SLC0HOST_RX_START_INT_RAW_V 0x1 -#define HOST_SLC0HOST_RX_START_INT_RAW_S 14 -/* HOST_SLC0HOST_RX_EOF_INT_RAW : RO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_RX_EOF_INT_RAW (BIT(13)) -#define HOST_SLC0HOST_RX_EOF_INT_RAW_M (BIT(13)) -#define HOST_SLC0HOST_RX_EOF_INT_RAW_V 0x1 -#define HOST_SLC0HOST_RX_EOF_INT_RAW_S 13 -/* HOST_SLC0HOST_RX_SOF_INT_RAW : RO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_RX_SOF_INT_RAW (BIT(12)) -#define HOST_SLC0HOST_RX_SOF_INT_RAW_M (BIT(12)) -#define HOST_SLC0HOST_RX_SOF_INT_RAW_V 0x1 -#define HOST_SLC0HOST_RX_SOF_INT_RAW_S 12 -/* HOST_SLC0_TOKEN1_0TO1_INT_RAW : RO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOKEN1_0TO1_INT_RAW (BIT(11)) -#define HOST_SLC0_TOKEN1_0TO1_INT_RAW_M (BIT(11)) -#define HOST_SLC0_TOKEN1_0TO1_INT_RAW_V 0x1 -#define HOST_SLC0_TOKEN1_0TO1_INT_RAW_S 11 -/* HOST_SLC0_TOKEN0_0TO1_INT_RAW : RO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOKEN0_0TO1_INT_RAW (BIT(10)) -#define HOST_SLC0_TOKEN0_0TO1_INT_RAW_M (BIT(10)) -#define HOST_SLC0_TOKEN0_0TO1_INT_RAW_V 0x1 -#define HOST_SLC0_TOKEN0_0TO1_INT_RAW_S 10 -/* HOST_SLC0_TOKEN1_1TO0_INT_RAW : RO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOKEN1_1TO0_INT_RAW (BIT(9)) -#define HOST_SLC0_TOKEN1_1TO0_INT_RAW_M (BIT(9)) -#define HOST_SLC0_TOKEN1_1TO0_INT_RAW_V 0x1 -#define HOST_SLC0_TOKEN1_1TO0_INT_RAW_S 9 -/* HOST_SLC0_TOKEN0_1TO0_INT_RAW : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOKEN0_1TO0_INT_RAW (BIT(8)) -#define HOST_SLC0_TOKEN0_1TO0_INT_RAW_M (BIT(8)) -#define HOST_SLC0_TOKEN0_1TO0_INT_RAW_V 0x1 -#define HOST_SLC0_TOKEN0_1TO0_INT_RAW_S 8 -/* HOST_SLC0_TOHOST_BIT7_INT_RAW : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT7_INT_RAW (BIT(7)) -#define HOST_SLC0_TOHOST_BIT7_INT_RAW_M (BIT(7)) -#define HOST_SLC0_TOHOST_BIT7_INT_RAW_V 0x1 -#define HOST_SLC0_TOHOST_BIT7_INT_RAW_S 7 -/* HOST_SLC0_TOHOST_BIT6_INT_RAW : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT6_INT_RAW (BIT(6)) -#define HOST_SLC0_TOHOST_BIT6_INT_RAW_M (BIT(6)) -#define HOST_SLC0_TOHOST_BIT6_INT_RAW_V 0x1 -#define HOST_SLC0_TOHOST_BIT6_INT_RAW_S 6 -/* HOST_SLC0_TOHOST_BIT5_INT_RAW : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT5_INT_RAW (BIT(5)) -#define HOST_SLC0_TOHOST_BIT5_INT_RAW_M (BIT(5)) -#define HOST_SLC0_TOHOST_BIT5_INT_RAW_V 0x1 -#define HOST_SLC0_TOHOST_BIT5_INT_RAW_S 5 -/* HOST_SLC0_TOHOST_BIT4_INT_RAW : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT4_INT_RAW (BIT(4)) -#define HOST_SLC0_TOHOST_BIT4_INT_RAW_M (BIT(4)) -#define HOST_SLC0_TOHOST_BIT4_INT_RAW_V 0x1 -#define HOST_SLC0_TOHOST_BIT4_INT_RAW_S 4 -/* HOST_SLC0_TOHOST_BIT3_INT_RAW : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT3_INT_RAW (BIT(3)) -#define HOST_SLC0_TOHOST_BIT3_INT_RAW_M (BIT(3)) -#define HOST_SLC0_TOHOST_BIT3_INT_RAW_V 0x1 -#define HOST_SLC0_TOHOST_BIT3_INT_RAW_S 3 -/* HOST_SLC0_TOHOST_BIT2_INT_RAW : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT2_INT_RAW (BIT(2)) -#define HOST_SLC0_TOHOST_BIT2_INT_RAW_M (BIT(2)) -#define HOST_SLC0_TOHOST_BIT2_INT_RAW_V 0x1 -#define HOST_SLC0_TOHOST_BIT2_INT_RAW_S 2 -/* HOST_SLC0_TOHOST_BIT1_INT_RAW : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT1_INT_RAW (BIT(1)) -#define HOST_SLC0_TOHOST_BIT1_INT_RAW_M (BIT(1)) -#define HOST_SLC0_TOHOST_BIT1_INT_RAW_V 0x1 -#define HOST_SLC0_TOHOST_BIT1_INT_RAW_S 1 -/* HOST_SLC0_TOHOST_BIT0_INT_RAW : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT0_INT_RAW (BIT(0)) -#define HOST_SLC0_TOHOST_BIT0_INT_RAW_M (BIT(0)) -#define HOST_SLC0_TOHOST_BIT0_INT_RAW_V 0x1 -#define HOST_SLC0_TOHOST_BIT0_INT_RAW_S 0 - -#define HOST_SLC1HOST_INT_RAW_REG (DR_REG_SLCHOST_BASE + 0x54) -/* HOST_SLC1_BT_RX_NEW_PACKET_INT_RAW : RO ;bitpos:[25] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_BT_RX_NEW_PACKET_INT_RAW (BIT(25)) -#define HOST_SLC1_BT_RX_NEW_PACKET_INT_RAW_M (BIT(25)) -#define HOST_SLC1_BT_RX_NEW_PACKET_INT_RAW_V 0x1 -#define HOST_SLC1_BT_RX_NEW_PACKET_INT_RAW_S 25 -/* HOST_SLC1_HOST_RD_RETRY_INT_RAW : RO ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_HOST_RD_RETRY_INT_RAW (BIT(24)) -#define HOST_SLC1_HOST_RD_RETRY_INT_RAW_M (BIT(24)) -#define HOST_SLC1_HOST_RD_RETRY_INT_RAW_V 0x1 -#define HOST_SLC1_HOST_RD_RETRY_INT_RAW_S 24 -/* HOST_SLC1_WIFI_RX_NEW_PACKET_INT_RAW : RO ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_WIFI_RX_NEW_PACKET_INT_RAW (BIT(23)) -#define HOST_SLC1_WIFI_RX_NEW_PACKET_INT_RAW_M (BIT(23)) -#define HOST_SLC1_WIFI_RX_NEW_PACKET_INT_RAW_V 0x1 -#define HOST_SLC1_WIFI_RX_NEW_PACKET_INT_RAW_S 23 -/* HOST_SLC1_EXT_BIT3_INT_RAW : RO ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_EXT_BIT3_INT_RAW (BIT(22)) -#define HOST_SLC1_EXT_BIT3_INT_RAW_M (BIT(22)) -#define HOST_SLC1_EXT_BIT3_INT_RAW_V 0x1 -#define HOST_SLC1_EXT_BIT3_INT_RAW_S 22 -/* HOST_SLC1_EXT_BIT2_INT_RAW : RO ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_EXT_BIT2_INT_RAW (BIT(21)) -#define HOST_SLC1_EXT_BIT2_INT_RAW_M (BIT(21)) -#define HOST_SLC1_EXT_BIT2_INT_RAW_V 0x1 -#define HOST_SLC1_EXT_BIT2_INT_RAW_S 21 -/* HOST_SLC1_EXT_BIT1_INT_RAW : RO ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_EXT_BIT1_INT_RAW (BIT(20)) -#define HOST_SLC1_EXT_BIT1_INT_RAW_M (BIT(20)) -#define HOST_SLC1_EXT_BIT1_INT_RAW_V 0x1 -#define HOST_SLC1_EXT_BIT1_INT_RAW_S 20 -/* HOST_SLC1_EXT_BIT0_INT_RAW : RO ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_EXT_BIT0_INT_RAW (BIT(19)) -#define HOST_SLC1_EXT_BIT0_INT_RAW_M (BIT(19)) -#define HOST_SLC1_EXT_BIT0_INT_RAW_V 0x1 -#define HOST_SLC1_EXT_BIT0_INT_RAW_S 19 -/* HOST_SLC1_RX_PF_VALID_INT_RAW : RO ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_RX_PF_VALID_INT_RAW (BIT(18)) -#define HOST_SLC1_RX_PF_VALID_INT_RAW_M (BIT(18)) -#define HOST_SLC1_RX_PF_VALID_INT_RAW_V 0x1 -#define HOST_SLC1_RX_PF_VALID_INT_RAW_S 18 -/* HOST_SLC1_TX_OVF_INT_RAW : RO ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TX_OVF_INT_RAW (BIT(17)) -#define HOST_SLC1_TX_OVF_INT_RAW_M (BIT(17)) -#define HOST_SLC1_TX_OVF_INT_RAW_V 0x1 -#define HOST_SLC1_TX_OVF_INT_RAW_S 17 -/* HOST_SLC1_RX_UDF_INT_RAW : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_RX_UDF_INT_RAW (BIT(16)) -#define HOST_SLC1_RX_UDF_INT_RAW_M (BIT(16)) -#define HOST_SLC1_RX_UDF_INT_RAW_V 0x1 -#define HOST_SLC1_RX_UDF_INT_RAW_S 16 -/* HOST_SLC1HOST_TX_START_INT_RAW : RO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1HOST_TX_START_INT_RAW (BIT(15)) -#define HOST_SLC1HOST_TX_START_INT_RAW_M (BIT(15)) -#define HOST_SLC1HOST_TX_START_INT_RAW_V 0x1 -#define HOST_SLC1HOST_TX_START_INT_RAW_S 15 -/* HOST_SLC1HOST_RX_START_INT_RAW : RO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1HOST_RX_START_INT_RAW (BIT(14)) -#define HOST_SLC1HOST_RX_START_INT_RAW_M (BIT(14)) -#define HOST_SLC1HOST_RX_START_INT_RAW_V 0x1 -#define HOST_SLC1HOST_RX_START_INT_RAW_S 14 -/* HOST_SLC1HOST_RX_EOF_INT_RAW : RO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1HOST_RX_EOF_INT_RAW (BIT(13)) -#define HOST_SLC1HOST_RX_EOF_INT_RAW_M (BIT(13)) -#define HOST_SLC1HOST_RX_EOF_INT_RAW_V 0x1 -#define HOST_SLC1HOST_RX_EOF_INT_RAW_S 13 -/* HOST_SLC1HOST_RX_SOF_INT_RAW : RO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1HOST_RX_SOF_INT_RAW (BIT(12)) -#define HOST_SLC1HOST_RX_SOF_INT_RAW_M (BIT(12)) -#define HOST_SLC1HOST_RX_SOF_INT_RAW_V 0x1 -#define HOST_SLC1HOST_RX_SOF_INT_RAW_S 12 -/* HOST_SLC1_TOKEN1_0TO1_INT_RAW : RO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOKEN1_0TO1_INT_RAW (BIT(11)) -#define HOST_SLC1_TOKEN1_0TO1_INT_RAW_M (BIT(11)) -#define HOST_SLC1_TOKEN1_0TO1_INT_RAW_V 0x1 -#define HOST_SLC1_TOKEN1_0TO1_INT_RAW_S 11 -/* HOST_SLC1_TOKEN0_0TO1_INT_RAW : RO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOKEN0_0TO1_INT_RAW (BIT(10)) -#define HOST_SLC1_TOKEN0_0TO1_INT_RAW_M (BIT(10)) -#define HOST_SLC1_TOKEN0_0TO1_INT_RAW_V 0x1 -#define HOST_SLC1_TOKEN0_0TO1_INT_RAW_S 10 -/* HOST_SLC1_TOKEN1_1TO0_INT_RAW : RO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOKEN1_1TO0_INT_RAW (BIT(9)) -#define HOST_SLC1_TOKEN1_1TO0_INT_RAW_M (BIT(9)) -#define HOST_SLC1_TOKEN1_1TO0_INT_RAW_V 0x1 -#define HOST_SLC1_TOKEN1_1TO0_INT_RAW_S 9 -/* HOST_SLC1_TOKEN0_1TO0_INT_RAW : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOKEN0_1TO0_INT_RAW (BIT(8)) -#define HOST_SLC1_TOKEN0_1TO0_INT_RAW_M (BIT(8)) -#define HOST_SLC1_TOKEN0_1TO0_INT_RAW_V 0x1 -#define HOST_SLC1_TOKEN0_1TO0_INT_RAW_S 8 -/* HOST_SLC1_TOHOST_BIT7_INT_RAW : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT7_INT_RAW (BIT(7)) -#define HOST_SLC1_TOHOST_BIT7_INT_RAW_M (BIT(7)) -#define HOST_SLC1_TOHOST_BIT7_INT_RAW_V 0x1 -#define HOST_SLC1_TOHOST_BIT7_INT_RAW_S 7 -/* HOST_SLC1_TOHOST_BIT6_INT_RAW : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT6_INT_RAW (BIT(6)) -#define HOST_SLC1_TOHOST_BIT6_INT_RAW_M (BIT(6)) -#define HOST_SLC1_TOHOST_BIT6_INT_RAW_V 0x1 -#define HOST_SLC1_TOHOST_BIT6_INT_RAW_S 6 -/* HOST_SLC1_TOHOST_BIT5_INT_RAW : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT5_INT_RAW (BIT(5)) -#define HOST_SLC1_TOHOST_BIT5_INT_RAW_M (BIT(5)) -#define HOST_SLC1_TOHOST_BIT5_INT_RAW_V 0x1 -#define HOST_SLC1_TOHOST_BIT5_INT_RAW_S 5 -/* HOST_SLC1_TOHOST_BIT4_INT_RAW : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT4_INT_RAW (BIT(4)) -#define HOST_SLC1_TOHOST_BIT4_INT_RAW_M (BIT(4)) -#define HOST_SLC1_TOHOST_BIT4_INT_RAW_V 0x1 -#define HOST_SLC1_TOHOST_BIT4_INT_RAW_S 4 -/* HOST_SLC1_TOHOST_BIT3_INT_RAW : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT3_INT_RAW (BIT(3)) -#define HOST_SLC1_TOHOST_BIT3_INT_RAW_M (BIT(3)) -#define HOST_SLC1_TOHOST_BIT3_INT_RAW_V 0x1 -#define HOST_SLC1_TOHOST_BIT3_INT_RAW_S 3 -/* HOST_SLC1_TOHOST_BIT2_INT_RAW : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT2_INT_RAW (BIT(2)) -#define HOST_SLC1_TOHOST_BIT2_INT_RAW_M (BIT(2)) -#define HOST_SLC1_TOHOST_BIT2_INT_RAW_V 0x1 -#define HOST_SLC1_TOHOST_BIT2_INT_RAW_S 2 -/* HOST_SLC1_TOHOST_BIT1_INT_RAW : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT1_INT_RAW (BIT(1)) -#define HOST_SLC1_TOHOST_BIT1_INT_RAW_M (BIT(1)) -#define HOST_SLC1_TOHOST_BIT1_INT_RAW_V 0x1 -#define HOST_SLC1_TOHOST_BIT1_INT_RAW_S 1 -/* HOST_SLC1_TOHOST_BIT0_INT_RAW : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT0_INT_RAW (BIT(0)) -#define HOST_SLC1_TOHOST_BIT0_INT_RAW_M (BIT(0)) -#define HOST_SLC1_TOHOST_BIT0_INT_RAW_V 0x1 -#define HOST_SLC1_TOHOST_BIT0_INT_RAW_S 0 - -#define HOST_SLC0HOST_INT_ST_REG (DR_REG_SLCHOST_BASE + 0x58) -/* HOST_GPIO_SDIO_INT_ST : RO ;bitpos:[25] ;default: 1'b0 ; */ -/*description: */ -#define HOST_GPIO_SDIO_INT_ST (BIT(25)) -#define HOST_GPIO_SDIO_INT_ST_M (BIT(25)) -#define HOST_GPIO_SDIO_INT_ST_V 0x1 -#define HOST_GPIO_SDIO_INT_ST_S 25 -/* HOST_SLC0_HOST_RD_RETRY_INT_ST : RO ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_HOST_RD_RETRY_INT_ST (BIT(24)) -#define HOST_SLC0_HOST_RD_RETRY_INT_ST_M (BIT(24)) -#define HOST_SLC0_HOST_RD_RETRY_INT_ST_V 0x1 -#define HOST_SLC0_HOST_RD_RETRY_INT_ST_S 24 -/* HOST_SLC0_RX_NEW_PACKET_INT_ST : RO ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_RX_NEW_PACKET_INT_ST (BIT(23)) -#define HOST_SLC0_RX_NEW_PACKET_INT_ST_M (BIT(23)) -#define HOST_SLC0_RX_NEW_PACKET_INT_ST_V 0x1 -#define HOST_SLC0_RX_NEW_PACKET_INT_ST_S 23 -/* HOST_SLC0_EXT_BIT3_INT_ST : RO ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_EXT_BIT3_INT_ST (BIT(22)) -#define HOST_SLC0_EXT_BIT3_INT_ST_M (BIT(22)) -#define HOST_SLC0_EXT_BIT3_INT_ST_V 0x1 -#define HOST_SLC0_EXT_BIT3_INT_ST_S 22 -/* HOST_SLC0_EXT_BIT2_INT_ST : RO ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_EXT_BIT2_INT_ST (BIT(21)) -#define HOST_SLC0_EXT_BIT2_INT_ST_M (BIT(21)) -#define HOST_SLC0_EXT_BIT2_INT_ST_V 0x1 -#define HOST_SLC0_EXT_BIT2_INT_ST_S 21 -/* HOST_SLC0_EXT_BIT1_INT_ST : RO ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_EXT_BIT1_INT_ST (BIT(20)) -#define HOST_SLC0_EXT_BIT1_INT_ST_M (BIT(20)) -#define HOST_SLC0_EXT_BIT1_INT_ST_V 0x1 -#define HOST_SLC0_EXT_BIT1_INT_ST_S 20 -/* HOST_SLC0_EXT_BIT0_INT_ST : RO ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_EXT_BIT0_INT_ST (BIT(19)) -#define HOST_SLC0_EXT_BIT0_INT_ST_M (BIT(19)) -#define HOST_SLC0_EXT_BIT0_INT_ST_V 0x1 -#define HOST_SLC0_EXT_BIT0_INT_ST_S 19 -/* HOST_SLC0_RX_PF_VALID_INT_ST : RO ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_RX_PF_VALID_INT_ST (BIT(18)) -#define HOST_SLC0_RX_PF_VALID_INT_ST_M (BIT(18)) -#define HOST_SLC0_RX_PF_VALID_INT_ST_V 0x1 -#define HOST_SLC0_RX_PF_VALID_INT_ST_S 18 -/* HOST_SLC0_TX_OVF_INT_ST : RO ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TX_OVF_INT_ST (BIT(17)) -#define HOST_SLC0_TX_OVF_INT_ST_M (BIT(17)) -#define HOST_SLC0_TX_OVF_INT_ST_V 0x1 -#define HOST_SLC0_TX_OVF_INT_ST_S 17 -/* HOST_SLC0_RX_UDF_INT_ST : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_RX_UDF_INT_ST (BIT(16)) -#define HOST_SLC0_RX_UDF_INT_ST_M (BIT(16)) -#define HOST_SLC0_RX_UDF_INT_ST_V 0x1 -#define HOST_SLC0_RX_UDF_INT_ST_S 16 -/* HOST_SLC0HOST_TX_START_INT_ST : RO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_TX_START_INT_ST (BIT(15)) -#define HOST_SLC0HOST_TX_START_INT_ST_M (BIT(15)) -#define HOST_SLC0HOST_TX_START_INT_ST_V 0x1 -#define HOST_SLC0HOST_TX_START_INT_ST_S 15 -/* HOST_SLC0HOST_RX_START_INT_ST : RO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_RX_START_INT_ST (BIT(14)) -#define HOST_SLC0HOST_RX_START_INT_ST_M (BIT(14)) -#define HOST_SLC0HOST_RX_START_INT_ST_V 0x1 -#define HOST_SLC0HOST_RX_START_INT_ST_S 14 -/* HOST_SLC0HOST_RX_EOF_INT_ST : RO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_RX_EOF_INT_ST (BIT(13)) -#define HOST_SLC0HOST_RX_EOF_INT_ST_M (BIT(13)) -#define HOST_SLC0HOST_RX_EOF_INT_ST_V 0x1 -#define HOST_SLC0HOST_RX_EOF_INT_ST_S 13 -/* HOST_SLC0HOST_RX_SOF_INT_ST : RO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_RX_SOF_INT_ST (BIT(12)) -#define HOST_SLC0HOST_RX_SOF_INT_ST_M (BIT(12)) -#define HOST_SLC0HOST_RX_SOF_INT_ST_V 0x1 -#define HOST_SLC0HOST_RX_SOF_INT_ST_S 12 -/* HOST_SLC0_TOKEN1_0TO1_INT_ST : RO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOKEN1_0TO1_INT_ST (BIT(11)) -#define HOST_SLC0_TOKEN1_0TO1_INT_ST_M (BIT(11)) -#define HOST_SLC0_TOKEN1_0TO1_INT_ST_V 0x1 -#define HOST_SLC0_TOKEN1_0TO1_INT_ST_S 11 -/* HOST_SLC0_TOKEN0_0TO1_INT_ST : RO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOKEN0_0TO1_INT_ST (BIT(10)) -#define HOST_SLC0_TOKEN0_0TO1_INT_ST_M (BIT(10)) -#define HOST_SLC0_TOKEN0_0TO1_INT_ST_V 0x1 -#define HOST_SLC0_TOKEN0_0TO1_INT_ST_S 10 -/* HOST_SLC0_TOKEN1_1TO0_INT_ST : RO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOKEN1_1TO0_INT_ST (BIT(9)) -#define HOST_SLC0_TOKEN1_1TO0_INT_ST_M (BIT(9)) -#define HOST_SLC0_TOKEN1_1TO0_INT_ST_V 0x1 -#define HOST_SLC0_TOKEN1_1TO0_INT_ST_S 9 -/* HOST_SLC0_TOKEN0_1TO0_INT_ST : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOKEN0_1TO0_INT_ST (BIT(8)) -#define HOST_SLC0_TOKEN0_1TO0_INT_ST_M (BIT(8)) -#define HOST_SLC0_TOKEN0_1TO0_INT_ST_V 0x1 -#define HOST_SLC0_TOKEN0_1TO0_INT_ST_S 8 -/* HOST_SLC0_TOHOST_BIT7_INT_ST : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT7_INT_ST (BIT(7)) -#define HOST_SLC0_TOHOST_BIT7_INT_ST_M (BIT(7)) -#define HOST_SLC0_TOHOST_BIT7_INT_ST_V 0x1 -#define HOST_SLC0_TOHOST_BIT7_INT_ST_S 7 -/* HOST_SLC0_TOHOST_BIT6_INT_ST : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT6_INT_ST (BIT(6)) -#define HOST_SLC0_TOHOST_BIT6_INT_ST_M (BIT(6)) -#define HOST_SLC0_TOHOST_BIT6_INT_ST_V 0x1 -#define HOST_SLC0_TOHOST_BIT6_INT_ST_S 6 -/* HOST_SLC0_TOHOST_BIT5_INT_ST : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT5_INT_ST (BIT(5)) -#define HOST_SLC0_TOHOST_BIT5_INT_ST_M (BIT(5)) -#define HOST_SLC0_TOHOST_BIT5_INT_ST_V 0x1 -#define HOST_SLC0_TOHOST_BIT5_INT_ST_S 5 -/* HOST_SLC0_TOHOST_BIT4_INT_ST : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT4_INT_ST (BIT(4)) -#define HOST_SLC0_TOHOST_BIT4_INT_ST_M (BIT(4)) -#define HOST_SLC0_TOHOST_BIT4_INT_ST_V 0x1 -#define HOST_SLC0_TOHOST_BIT4_INT_ST_S 4 -/* HOST_SLC0_TOHOST_BIT3_INT_ST : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT3_INT_ST (BIT(3)) -#define HOST_SLC0_TOHOST_BIT3_INT_ST_M (BIT(3)) -#define HOST_SLC0_TOHOST_BIT3_INT_ST_V 0x1 -#define HOST_SLC0_TOHOST_BIT3_INT_ST_S 3 -/* HOST_SLC0_TOHOST_BIT2_INT_ST : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT2_INT_ST (BIT(2)) -#define HOST_SLC0_TOHOST_BIT2_INT_ST_M (BIT(2)) -#define HOST_SLC0_TOHOST_BIT2_INT_ST_V 0x1 -#define HOST_SLC0_TOHOST_BIT2_INT_ST_S 2 -/* HOST_SLC0_TOHOST_BIT1_INT_ST : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT1_INT_ST (BIT(1)) -#define HOST_SLC0_TOHOST_BIT1_INT_ST_M (BIT(1)) -#define HOST_SLC0_TOHOST_BIT1_INT_ST_V 0x1 -#define HOST_SLC0_TOHOST_BIT1_INT_ST_S 1 -/* HOST_SLC0_TOHOST_BIT0_INT_ST : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT0_INT_ST (BIT(0)) -#define HOST_SLC0_TOHOST_BIT0_INT_ST_M (BIT(0)) -#define HOST_SLC0_TOHOST_BIT0_INT_ST_V 0x1 -#define HOST_SLC0_TOHOST_BIT0_INT_ST_S 0 - -#define HOST_SLC1HOST_INT_ST_REG (DR_REG_SLCHOST_BASE + 0x5C) -/* HOST_SLC1_BT_RX_NEW_PACKET_INT_ST : RO ;bitpos:[25] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_BT_RX_NEW_PACKET_INT_ST (BIT(25)) -#define HOST_SLC1_BT_RX_NEW_PACKET_INT_ST_M (BIT(25)) -#define HOST_SLC1_BT_RX_NEW_PACKET_INT_ST_V 0x1 -#define HOST_SLC1_BT_RX_NEW_PACKET_INT_ST_S 25 -/* HOST_SLC1_HOST_RD_RETRY_INT_ST : RO ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_HOST_RD_RETRY_INT_ST (BIT(24)) -#define HOST_SLC1_HOST_RD_RETRY_INT_ST_M (BIT(24)) -#define HOST_SLC1_HOST_RD_RETRY_INT_ST_V 0x1 -#define HOST_SLC1_HOST_RD_RETRY_INT_ST_S 24 -/* HOST_SLC1_WIFI_RX_NEW_PACKET_INT_ST : RO ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_WIFI_RX_NEW_PACKET_INT_ST (BIT(23)) -#define HOST_SLC1_WIFI_RX_NEW_PACKET_INT_ST_M (BIT(23)) -#define HOST_SLC1_WIFI_RX_NEW_PACKET_INT_ST_V 0x1 -#define HOST_SLC1_WIFI_RX_NEW_PACKET_INT_ST_S 23 -/* HOST_SLC1_EXT_BIT3_INT_ST : RO ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_EXT_BIT3_INT_ST (BIT(22)) -#define HOST_SLC1_EXT_BIT3_INT_ST_M (BIT(22)) -#define HOST_SLC1_EXT_BIT3_INT_ST_V 0x1 -#define HOST_SLC1_EXT_BIT3_INT_ST_S 22 -/* HOST_SLC1_EXT_BIT2_INT_ST : RO ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_EXT_BIT2_INT_ST (BIT(21)) -#define HOST_SLC1_EXT_BIT2_INT_ST_M (BIT(21)) -#define HOST_SLC1_EXT_BIT2_INT_ST_V 0x1 -#define HOST_SLC1_EXT_BIT2_INT_ST_S 21 -/* HOST_SLC1_EXT_BIT1_INT_ST : RO ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_EXT_BIT1_INT_ST (BIT(20)) -#define HOST_SLC1_EXT_BIT1_INT_ST_M (BIT(20)) -#define HOST_SLC1_EXT_BIT1_INT_ST_V 0x1 -#define HOST_SLC1_EXT_BIT1_INT_ST_S 20 -/* HOST_SLC1_EXT_BIT0_INT_ST : RO ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_EXT_BIT0_INT_ST (BIT(19)) -#define HOST_SLC1_EXT_BIT0_INT_ST_M (BIT(19)) -#define HOST_SLC1_EXT_BIT0_INT_ST_V 0x1 -#define HOST_SLC1_EXT_BIT0_INT_ST_S 19 -/* HOST_SLC1_RX_PF_VALID_INT_ST : RO ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_RX_PF_VALID_INT_ST (BIT(18)) -#define HOST_SLC1_RX_PF_VALID_INT_ST_M (BIT(18)) -#define HOST_SLC1_RX_PF_VALID_INT_ST_V 0x1 -#define HOST_SLC1_RX_PF_VALID_INT_ST_S 18 -/* HOST_SLC1_TX_OVF_INT_ST : RO ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TX_OVF_INT_ST (BIT(17)) -#define HOST_SLC1_TX_OVF_INT_ST_M (BIT(17)) -#define HOST_SLC1_TX_OVF_INT_ST_V 0x1 -#define HOST_SLC1_TX_OVF_INT_ST_S 17 -/* HOST_SLC1_RX_UDF_INT_ST : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_RX_UDF_INT_ST (BIT(16)) -#define HOST_SLC1_RX_UDF_INT_ST_M (BIT(16)) -#define HOST_SLC1_RX_UDF_INT_ST_V 0x1 -#define HOST_SLC1_RX_UDF_INT_ST_S 16 -/* HOST_SLC1HOST_TX_START_INT_ST : RO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1HOST_TX_START_INT_ST (BIT(15)) -#define HOST_SLC1HOST_TX_START_INT_ST_M (BIT(15)) -#define HOST_SLC1HOST_TX_START_INT_ST_V 0x1 -#define HOST_SLC1HOST_TX_START_INT_ST_S 15 -/* HOST_SLC1HOST_RX_START_INT_ST : RO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1HOST_RX_START_INT_ST (BIT(14)) -#define HOST_SLC1HOST_RX_START_INT_ST_M (BIT(14)) -#define HOST_SLC1HOST_RX_START_INT_ST_V 0x1 -#define HOST_SLC1HOST_RX_START_INT_ST_S 14 -/* HOST_SLC1HOST_RX_EOF_INT_ST : RO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1HOST_RX_EOF_INT_ST (BIT(13)) -#define HOST_SLC1HOST_RX_EOF_INT_ST_M (BIT(13)) -#define HOST_SLC1HOST_RX_EOF_INT_ST_V 0x1 -#define HOST_SLC1HOST_RX_EOF_INT_ST_S 13 -/* HOST_SLC1HOST_RX_SOF_INT_ST : RO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1HOST_RX_SOF_INT_ST (BIT(12)) -#define HOST_SLC1HOST_RX_SOF_INT_ST_M (BIT(12)) -#define HOST_SLC1HOST_RX_SOF_INT_ST_V 0x1 -#define HOST_SLC1HOST_RX_SOF_INT_ST_S 12 -/* HOST_SLC1_TOKEN1_0TO1_INT_ST : RO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOKEN1_0TO1_INT_ST (BIT(11)) -#define HOST_SLC1_TOKEN1_0TO1_INT_ST_M (BIT(11)) -#define HOST_SLC1_TOKEN1_0TO1_INT_ST_V 0x1 -#define HOST_SLC1_TOKEN1_0TO1_INT_ST_S 11 -/* HOST_SLC1_TOKEN0_0TO1_INT_ST : RO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOKEN0_0TO1_INT_ST (BIT(10)) -#define HOST_SLC1_TOKEN0_0TO1_INT_ST_M (BIT(10)) -#define HOST_SLC1_TOKEN0_0TO1_INT_ST_V 0x1 -#define HOST_SLC1_TOKEN0_0TO1_INT_ST_S 10 -/* HOST_SLC1_TOKEN1_1TO0_INT_ST : RO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOKEN1_1TO0_INT_ST (BIT(9)) -#define HOST_SLC1_TOKEN1_1TO0_INT_ST_M (BIT(9)) -#define HOST_SLC1_TOKEN1_1TO0_INT_ST_V 0x1 -#define HOST_SLC1_TOKEN1_1TO0_INT_ST_S 9 -/* HOST_SLC1_TOKEN0_1TO0_INT_ST : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOKEN0_1TO0_INT_ST (BIT(8)) -#define HOST_SLC1_TOKEN0_1TO0_INT_ST_M (BIT(8)) -#define HOST_SLC1_TOKEN0_1TO0_INT_ST_V 0x1 -#define HOST_SLC1_TOKEN0_1TO0_INT_ST_S 8 -/* HOST_SLC1_TOHOST_BIT7_INT_ST : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT7_INT_ST (BIT(7)) -#define HOST_SLC1_TOHOST_BIT7_INT_ST_M (BIT(7)) -#define HOST_SLC1_TOHOST_BIT7_INT_ST_V 0x1 -#define HOST_SLC1_TOHOST_BIT7_INT_ST_S 7 -/* HOST_SLC1_TOHOST_BIT6_INT_ST : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT6_INT_ST (BIT(6)) -#define HOST_SLC1_TOHOST_BIT6_INT_ST_M (BIT(6)) -#define HOST_SLC1_TOHOST_BIT6_INT_ST_V 0x1 -#define HOST_SLC1_TOHOST_BIT6_INT_ST_S 6 -/* HOST_SLC1_TOHOST_BIT5_INT_ST : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT5_INT_ST (BIT(5)) -#define HOST_SLC1_TOHOST_BIT5_INT_ST_M (BIT(5)) -#define HOST_SLC1_TOHOST_BIT5_INT_ST_V 0x1 -#define HOST_SLC1_TOHOST_BIT5_INT_ST_S 5 -/* HOST_SLC1_TOHOST_BIT4_INT_ST : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT4_INT_ST (BIT(4)) -#define HOST_SLC1_TOHOST_BIT4_INT_ST_M (BIT(4)) -#define HOST_SLC1_TOHOST_BIT4_INT_ST_V 0x1 -#define HOST_SLC1_TOHOST_BIT4_INT_ST_S 4 -/* HOST_SLC1_TOHOST_BIT3_INT_ST : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT3_INT_ST (BIT(3)) -#define HOST_SLC1_TOHOST_BIT3_INT_ST_M (BIT(3)) -#define HOST_SLC1_TOHOST_BIT3_INT_ST_V 0x1 -#define HOST_SLC1_TOHOST_BIT3_INT_ST_S 3 -/* HOST_SLC1_TOHOST_BIT2_INT_ST : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT2_INT_ST (BIT(2)) -#define HOST_SLC1_TOHOST_BIT2_INT_ST_M (BIT(2)) -#define HOST_SLC1_TOHOST_BIT2_INT_ST_V 0x1 -#define HOST_SLC1_TOHOST_BIT2_INT_ST_S 2 -/* HOST_SLC1_TOHOST_BIT1_INT_ST : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT1_INT_ST (BIT(1)) -#define HOST_SLC1_TOHOST_BIT1_INT_ST_M (BIT(1)) -#define HOST_SLC1_TOHOST_BIT1_INT_ST_V 0x1 -#define HOST_SLC1_TOHOST_BIT1_INT_ST_S 1 -/* HOST_SLC1_TOHOST_BIT0_INT_ST : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT0_INT_ST (BIT(0)) -#define HOST_SLC1_TOHOST_BIT0_INT_ST_M (BIT(0)) -#define HOST_SLC1_TOHOST_BIT0_INT_ST_V 0x1 -#define HOST_SLC1_TOHOST_BIT0_INT_ST_S 0 - -#define HOST_SLCHOST_PKT_LEN_REG (DR_REG_SLCHOST_BASE + 0x60) -/* HOST_HOSTSLC0_LEN_CHECK : RO ;bitpos:[31:20] ;default: 10'h0 ; */ -/*description: */ -#define HOST_HOSTSLC0_LEN_CHECK 0x00000FFF -#define HOST_HOSTSLC0_LEN_CHECK_M ((HOST_HOSTSLC0_LEN_CHECK_V)<<(HOST_HOSTSLC0_LEN_CHECK_S)) -#define HOST_HOSTSLC0_LEN_CHECK_V 0xFFF -#define HOST_HOSTSLC0_LEN_CHECK_S 20 -/* HOST_HOSTSLC0_LEN : RO ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: */ -#define HOST_HOSTSLC0_LEN 0x000FFFFF -#define HOST_HOSTSLC0_LEN_M ((HOST_HOSTSLC0_LEN_V)<<(HOST_HOSTSLC0_LEN_S)) -#define HOST_HOSTSLC0_LEN_V 0xFFFFF -#define HOST_HOSTSLC0_LEN_S 0 - -#define HOST_SLCHOST_STATE_W0_REG (DR_REG_SLCHOST_BASE + 0x64) -/* HOST_SLCHOST_STATE3 : RO ;bitpos:[31:24] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_STATE3 0x000000FF -#define HOST_SLCHOST_STATE3_M ((HOST_SLCHOST_STATE3_V)<<(HOST_SLCHOST_STATE3_S)) -#define HOST_SLCHOST_STATE3_V 0xFF -#define HOST_SLCHOST_STATE3_S 24 -/* HOST_SLCHOST_STATE2 : RO ;bitpos:[23:16] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_STATE2 0x000000FF -#define HOST_SLCHOST_STATE2_M ((HOST_SLCHOST_STATE2_V)<<(HOST_SLCHOST_STATE2_S)) -#define HOST_SLCHOST_STATE2_V 0xFF -#define HOST_SLCHOST_STATE2_S 16 -/* HOST_SLCHOST_STATE1 : RO ;bitpos:[15:8] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_STATE1 0x000000FF -#define HOST_SLCHOST_STATE1_M ((HOST_SLCHOST_STATE1_V)<<(HOST_SLCHOST_STATE1_S)) -#define HOST_SLCHOST_STATE1_V 0xFF -#define HOST_SLCHOST_STATE1_S 8 -/* HOST_SLCHOST_STATE0 : RO ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_STATE0 0x000000FF -#define HOST_SLCHOST_STATE0_M ((HOST_SLCHOST_STATE0_V)<<(HOST_SLCHOST_STATE0_S)) -#define HOST_SLCHOST_STATE0_V 0xFF -#define HOST_SLCHOST_STATE0_S 0 - -#define HOST_SLCHOST_STATE_W1_REG (DR_REG_SLCHOST_BASE + 0x68) -/* HOST_SLCHOST_STATE7 : RO ;bitpos:[31:24] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_STATE7 0x000000FF -#define HOST_SLCHOST_STATE7_M ((HOST_SLCHOST_STATE7_V)<<(HOST_SLCHOST_STATE7_S)) -#define HOST_SLCHOST_STATE7_V 0xFF -#define HOST_SLCHOST_STATE7_S 24 -/* HOST_SLCHOST_STATE6 : RO ;bitpos:[23:16] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_STATE6 0x000000FF -#define HOST_SLCHOST_STATE6_M ((HOST_SLCHOST_STATE6_V)<<(HOST_SLCHOST_STATE6_S)) -#define HOST_SLCHOST_STATE6_V 0xFF -#define HOST_SLCHOST_STATE6_S 16 -/* HOST_SLCHOST_STATE5 : RO ;bitpos:[15:8] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_STATE5 0x000000FF -#define HOST_SLCHOST_STATE5_M ((HOST_SLCHOST_STATE5_V)<<(HOST_SLCHOST_STATE5_S)) -#define HOST_SLCHOST_STATE5_V 0xFF -#define HOST_SLCHOST_STATE5_S 8 -/* HOST_SLCHOST_STATE4 : RO ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_STATE4 0x000000FF -#define HOST_SLCHOST_STATE4_M ((HOST_SLCHOST_STATE4_V)<<(HOST_SLCHOST_STATE4_S)) -#define HOST_SLCHOST_STATE4_V 0xFF -#define HOST_SLCHOST_STATE4_S 0 - -#define HOST_SLCHOST_CONF_W_REG(pos) (HOST_SLCHOST_CONF_W0_REG+pos+(pos>23?4:0)+(pos>31?12:0)) - -#define HOST_SLCHOST_CONF_W0_REG (DR_REG_SLCHOST_BASE + 0x6C) -/* HOST_SLCHOST_CONF3 : R/W ;bitpos:[31:24] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF3 0x000000FF -#define HOST_SLCHOST_CONF3_M ((HOST_SLCHOST_CONF3_V)<<(HOST_SLCHOST_CONF3_S)) -#define HOST_SLCHOST_CONF3_V 0xFF -#define HOST_SLCHOST_CONF3_S 24 -/* HOST_SLCHOST_CONF2 : R/W ;bitpos:[23:16] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF2 0x000000FF -#define HOST_SLCHOST_CONF2_M ((HOST_SLCHOST_CONF2_V)<<(HOST_SLCHOST_CONF2_S)) -#define HOST_SLCHOST_CONF2_V 0xFF -#define HOST_SLCHOST_CONF2_S 16 -/* HOST_SLCHOST_CONF1 : R/W ;bitpos:[15:8] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF1 0x000000FF -#define HOST_SLCHOST_CONF1_M ((HOST_SLCHOST_CONF1_V)<<(HOST_SLCHOST_CONF1_S)) -#define HOST_SLCHOST_CONF1_V 0xFF -#define HOST_SLCHOST_CONF1_S 8 -/* HOST_SLCHOST_CONF0 : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF0 0x000000FF -#define HOST_SLCHOST_CONF0_M ((HOST_SLCHOST_CONF0_V)<<(HOST_SLCHOST_CONF0_S)) -#define HOST_SLCHOST_CONF0_V 0xFF -#define HOST_SLCHOST_CONF0_S 0 - -#define HOST_SLCHOST_CONF_W1_REG (DR_REG_SLCHOST_BASE + 0x70) -/* HOST_SLCHOST_CONF7 : R/W ;bitpos:[31:24] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF7 0x000000FF -#define HOST_SLCHOST_CONF7_M ((HOST_SLCHOST_CONF7_V)<<(HOST_SLCHOST_CONF7_S)) -#define HOST_SLCHOST_CONF7_V 0xFF -#define HOST_SLCHOST_CONF7_S 24 -/* HOST_SLCHOST_CONF6 : R/W ;bitpos:[23:16] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF6 0x000000FF -#define HOST_SLCHOST_CONF6_M ((HOST_SLCHOST_CONF6_V)<<(HOST_SLCHOST_CONF6_S)) -#define HOST_SLCHOST_CONF6_V 0xFF -#define HOST_SLCHOST_CONF6_S 16 -/* HOST_SLCHOST_CONF5 : R/W ;bitpos:[15:8] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF5 0x000000FF -#define HOST_SLCHOST_CONF5_M ((HOST_SLCHOST_CONF5_V)<<(HOST_SLCHOST_CONF5_S)) -#define HOST_SLCHOST_CONF5_V 0xFF -#define HOST_SLCHOST_CONF5_S 8 -/* HOST_SLCHOST_CONF4 : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF4 0x000000FF -#define HOST_SLCHOST_CONF4_M ((HOST_SLCHOST_CONF4_V)<<(HOST_SLCHOST_CONF4_S)) -#define HOST_SLCHOST_CONF4_V 0xFF -#define HOST_SLCHOST_CONF4_S 0 - -#define HOST_SLCHOST_CONF_W2_REG (DR_REG_SLCHOST_BASE + 0x74) -/* HOST_SLCHOST_CONF11 : R/W ;bitpos:[31:24] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF11 0x000000FF -#define HOST_SLCHOST_CONF11_M ((HOST_SLCHOST_CONF11_V)<<(HOST_SLCHOST_CONF11_S)) -#define HOST_SLCHOST_CONF11_V 0xFF -#define HOST_SLCHOST_CONF11_S 24 -/* HOST_SLCHOST_CONF10 : R/W ;bitpos:[23:16] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF10 0x000000FF -#define HOST_SLCHOST_CONF10_M ((HOST_SLCHOST_CONF10_V)<<(HOST_SLCHOST_CONF10_S)) -#define HOST_SLCHOST_CONF10_V 0xFF -#define HOST_SLCHOST_CONF10_S 16 -/* HOST_SLCHOST_CONF9 : R/W ;bitpos:[15:8] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF9 0x000000FF -#define HOST_SLCHOST_CONF9_M ((HOST_SLCHOST_CONF9_V)<<(HOST_SLCHOST_CONF9_S)) -#define HOST_SLCHOST_CONF9_V 0xFF -#define HOST_SLCHOST_CONF9_S 8 -/* HOST_SLCHOST_CONF8 : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF8 0x000000FF -#define HOST_SLCHOST_CONF8_M ((HOST_SLCHOST_CONF8_V)<<(HOST_SLCHOST_CONF8_S)) -#define HOST_SLCHOST_CONF8_V 0xFF -#define HOST_SLCHOST_CONF8_S 0 - -#define HOST_SLCHOST_CONF_W3_REG (DR_REG_SLCHOST_BASE + 0x78) -/* HOST_SLCHOST_CONF15 : R/W ;bitpos:[31:24] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF15 0x000000FF -#define HOST_SLCHOST_CONF15_M ((HOST_SLCHOST_CONF15_V)<<(HOST_SLCHOST_CONF15_S)) -#define HOST_SLCHOST_CONF15_V 0xFF -#define HOST_SLCHOST_CONF15_S 24 -/* HOST_SLCHOST_CONF14 : R/W ;bitpos:[23:16] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF14 0x000000FF -#define HOST_SLCHOST_CONF14_M ((HOST_SLCHOST_CONF14_V)<<(HOST_SLCHOST_CONF14_S)) -#define HOST_SLCHOST_CONF14_V 0xFF -#define HOST_SLCHOST_CONF14_S 16 -/* HOST_SLCHOST_CONF13 : R/W ;bitpos:[15:8] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF13 0x000000FF -#define HOST_SLCHOST_CONF13_M ((HOST_SLCHOST_CONF13_V)<<(HOST_SLCHOST_CONF13_S)) -#define HOST_SLCHOST_CONF13_V 0xFF -#define HOST_SLCHOST_CONF13_S 8 -/* HOST_SLCHOST_CONF12 : R/W ;bitpos:[7:0] ;default: 8'hc0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF12 0x000000FF -#define HOST_SLCHOST_CONF12_M ((HOST_SLCHOST_CONF12_V)<<(HOST_SLCHOST_CONF12_S)) -#define HOST_SLCHOST_CONF12_V 0xFF -#define HOST_SLCHOST_CONF12_S 0 - -#define HOST_SLCHOST_CONF_W4_REG (DR_REG_SLCHOST_BASE + 0x7C) -/* HOST_SLCHOST_CONF19 : R/W ;bitpos:[31:24] ;default: 8'h0 ; */ -/*description: Interrupt to target CPU*/ -#define HOST_SLCHOST_CONF19 0x000000FF -#define HOST_SLCHOST_CONF19_M ((HOST_SLCHOST_CONF19_V)<<(HOST_SLCHOST_CONF19_S)) -#define HOST_SLCHOST_CONF19_V 0xFF -#define HOST_SLCHOST_CONF19_S 24 -/* HOST_SLCHOST_CONF18 : R/W ;bitpos:[23:16] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF18 0x000000FF -#define HOST_SLCHOST_CONF18_M ((HOST_SLCHOST_CONF18_V)<<(HOST_SLCHOST_CONF18_S)) -#define HOST_SLCHOST_CONF18_V 0xFF -#define HOST_SLCHOST_CONF18_S 16 -/* HOST_SLCHOST_CONF17 : R/W ;bitpos:[15:8] ;default: 8'h1 ; */ -/*description: SLC timeout enable*/ -#define HOST_SLCHOST_CONF17 0x000000FF -#define HOST_SLCHOST_CONF17_M ((HOST_SLCHOST_CONF17_V)<<(HOST_SLCHOST_CONF17_S)) -#define HOST_SLCHOST_CONF17_V 0xFF -#define HOST_SLCHOST_CONF17_S 8 -/* HOST_SLCHOST_CONF16 : R/W ;bitpos:[7:0] ;default: 8'hFF ; */ -/*description: SLC timeout value*/ -#define HOST_SLCHOST_CONF16 0x000000FF -#define HOST_SLCHOST_CONF16_M ((HOST_SLCHOST_CONF16_V)<<(HOST_SLCHOST_CONF16_S)) -#define HOST_SLCHOST_CONF16_V 0xFF -#define HOST_SLCHOST_CONF16_S 0 - -#define HOST_SLCHOST_CONF_W5_REG (DR_REG_SLCHOST_BASE + 0x80) -/* HOST_SLCHOST_CONF23 : R/W ;bitpos:[31:24] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF23 0x000000FF -#define HOST_SLCHOST_CONF23_M ((HOST_SLCHOST_CONF23_V)<<(HOST_SLCHOST_CONF23_S)) -#define HOST_SLCHOST_CONF23_V 0xFF -#define HOST_SLCHOST_CONF23_S 24 -/* HOST_SLCHOST_CONF22 : R/W ;bitpos:[23:16] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF22 0x000000FF -#define HOST_SLCHOST_CONF22_M ((HOST_SLCHOST_CONF22_V)<<(HOST_SLCHOST_CONF22_S)) -#define HOST_SLCHOST_CONF22_V 0xFF -#define HOST_SLCHOST_CONF22_S 16 -/* HOST_SLCHOST_CONF21 : R/W ;bitpos:[15:8] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF21 0x000000FF -#define HOST_SLCHOST_CONF21_M ((HOST_SLCHOST_CONF21_V)<<(HOST_SLCHOST_CONF21_S)) -#define HOST_SLCHOST_CONF21_V 0xFF -#define HOST_SLCHOST_CONF21_S 8 -/* HOST_SLCHOST_CONF20 : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF20 0x000000FF -#define HOST_SLCHOST_CONF20_M ((HOST_SLCHOST_CONF20_V)<<(HOST_SLCHOST_CONF20_S)) -#define HOST_SLCHOST_CONF20_V 0xFF -#define HOST_SLCHOST_CONF20_S 0 - -#define HOST_SLCHOST_WIN_CMD_REG (DR_REG_SLCHOST_BASE + 0x84) - -#define HOST_SLCHOST_CONF_W6_REG (DR_REG_SLCHOST_BASE + 0x88) -/* HOST_SLCHOST_CONF27 : R/W ;bitpos:[31:24] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF27 0x000000FF -#define HOST_SLCHOST_CONF27_M ((HOST_SLCHOST_CONF27_V)<<(HOST_SLCHOST_CONF27_S)) -#define HOST_SLCHOST_CONF27_V 0xFF -#define HOST_SLCHOST_CONF27_S 24 -/* HOST_SLCHOST_CONF26 : R/W ;bitpos:[23:16] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF26 0x000000FF -#define HOST_SLCHOST_CONF26_M ((HOST_SLCHOST_CONF26_V)<<(HOST_SLCHOST_CONF26_S)) -#define HOST_SLCHOST_CONF26_V 0xFF -#define HOST_SLCHOST_CONF26_S 16 -/* HOST_SLCHOST_CONF25 : R/W ;bitpos:[15:8] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF25 0x000000FF -#define HOST_SLCHOST_CONF25_M ((HOST_SLCHOST_CONF25_V)<<(HOST_SLCHOST_CONF25_S)) -#define HOST_SLCHOST_CONF25_V 0xFF -#define HOST_SLCHOST_CONF25_S 8 -/* HOST_SLCHOST_CONF24 : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF24 0x000000FF -#define HOST_SLCHOST_CONF24_M ((HOST_SLCHOST_CONF24_V)<<(HOST_SLCHOST_CONF24_S)) -#define HOST_SLCHOST_CONF24_V 0xFF -#define HOST_SLCHOST_CONF24_S 0 - -#define HOST_SLCHOST_CONF_W7_REG (DR_REG_SLCHOST_BASE + 0x8C) -/* HOST_SLCHOST_CONF31 : R/W ;bitpos:[31:24] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF31 0x000000FF -#define HOST_SLCHOST_CONF31_M ((HOST_SLCHOST_CONF31_V)<<(HOST_SLCHOST_CONF31_S)) -#define HOST_SLCHOST_CONF31_V 0xFF -#define HOST_SLCHOST_CONF31_S 24 -/* HOST_SLCHOST_CONF30 : R/W ;bitpos:[23:16] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF30 0x000000FF -#define HOST_SLCHOST_CONF30_M ((HOST_SLCHOST_CONF30_V)<<(HOST_SLCHOST_CONF30_S)) -#define HOST_SLCHOST_CONF30_V 0xFF -#define HOST_SLCHOST_CONF30_S 16 -/* HOST_SLCHOST_CONF29 : R/W ;bitpos:[15:8] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF29 0x000000FF -#define HOST_SLCHOST_CONF29_M ((HOST_SLCHOST_CONF29_V)<<(HOST_SLCHOST_CONF29_S)) -#define HOST_SLCHOST_CONF29_V 0xFF -#define HOST_SLCHOST_CONF29_S 8 -/* HOST_SLCHOST_CONF28 : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF28 0x000000FF -#define HOST_SLCHOST_CONF28_M ((HOST_SLCHOST_CONF28_V)<<(HOST_SLCHOST_CONF28_S)) -#define HOST_SLCHOST_CONF28_V 0xFF -#define HOST_SLCHOST_CONF28_S 0 - -#define HOST_SLCHOST_PKT_LEN0_REG (DR_REG_SLCHOST_BASE + 0x90) -/* HOST_HOSTSLC0_LEN0 : RO ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: */ -#define HOST_HOSTSLC0_LEN0 0x000FFFFF -#define HOST_HOSTSLC0_LEN0_M ((HOST_HOSTSLC0_LEN0_V)<<(HOST_HOSTSLC0_LEN0_S)) -#define HOST_HOSTSLC0_LEN0_V 0xFFFFF -#define HOST_HOSTSLC0_LEN0_S 0 - -#define HOST_SLCHOST_PKT_LEN1_REG (DR_REG_SLCHOST_BASE + 0x94) -/* HOST_HOSTSLC0_LEN1 : RO ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: */ -#define HOST_HOSTSLC0_LEN1 0x000FFFFF -#define HOST_HOSTSLC0_LEN1_M ((HOST_HOSTSLC0_LEN1_V)<<(HOST_HOSTSLC0_LEN1_S)) -#define HOST_HOSTSLC0_LEN1_V 0xFFFFF -#define HOST_HOSTSLC0_LEN1_S 0 - -#define HOST_SLCHOST_PKT_LEN2_REG (DR_REG_SLCHOST_BASE + 0x98) -/* HOST_HOSTSLC0_LEN2 : RO ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: */ -#define HOST_HOSTSLC0_LEN2 0x000FFFFF -#define HOST_HOSTSLC0_LEN2_M ((HOST_HOSTSLC0_LEN2_V)<<(HOST_HOSTSLC0_LEN2_S)) -#define HOST_HOSTSLC0_LEN2_V 0xFFFFF -#define HOST_HOSTSLC0_LEN2_S 0 - -#define HOST_SLCHOST_CONF_W8_REG (DR_REG_SLCHOST_BASE + 0x9C) -/* HOST_SLCHOST_CONF35 : R/W ;bitpos:[31:24] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF35 0x000000FF -#define HOST_SLCHOST_CONF35_M ((HOST_SLCHOST_CONF35_V)<<(HOST_SLCHOST_CONF35_S)) -#define HOST_SLCHOST_CONF35_V 0xFF -#define HOST_SLCHOST_CONF35_S 24 -/* HOST_SLCHOST_CONF34 : R/W ;bitpos:[23:16] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF34 0x000000FF -#define HOST_SLCHOST_CONF34_M ((HOST_SLCHOST_CONF34_V)<<(HOST_SLCHOST_CONF34_S)) -#define HOST_SLCHOST_CONF34_V 0xFF -#define HOST_SLCHOST_CONF34_S 16 -/* HOST_SLCHOST_CONF33 : R/W ;bitpos:[15:8] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF33 0x000000FF -#define HOST_SLCHOST_CONF33_M ((HOST_SLCHOST_CONF33_V)<<(HOST_SLCHOST_CONF33_S)) -#define HOST_SLCHOST_CONF33_V 0xFF -#define HOST_SLCHOST_CONF33_S 8 -/* HOST_SLCHOST_CONF32 : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF32 0x000000FF -#define HOST_SLCHOST_CONF32_M ((HOST_SLCHOST_CONF32_V)<<(HOST_SLCHOST_CONF32_S)) -#define HOST_SLCHOST_CONF32_V 0xFF -#define HOST_SLCHOST_CONF32_S 0 - -#define HOST_SLCHOST_CONF_W9_REG (DR_REG_SLCHOST_BASE + 0xA0) -/* HOST_SLCHOST_CONF39 : R/W ;bitpos:[31:24] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF39 0x000000FF -#define HOST_SLCHOST_CONF39_M ((HOST_SLCHOST_CONF39_V)<<(HOST_SLCHOST_CONF39_S)) -#define HOST_SLCHOST_CONF39_V 0xFF -#define HOST_SLCHOST_CONF39_S 24 -/* HOST_SLCHOST_CONF38 : R/W ;bitpos:[23:16] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF38 0x000000FF -#define HOST_SLCHOST_CONF38_M ((HOST_SLCHOST_CONF38_V)<<(HOST_SLCHOST_CONF38_S)) -#define HOST_SLCHOST_CONF38_V 0xFF -#define HOST_SLCHOST_CONF38_S 16 -/* HOST_SLCHOST_CONF37 : R/W ;bitpos:[15:8] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF37 0x000000FF -#define HOST_SLCHOST_CONF37_M ((HOST_SLCHOST_CONF37_V)<<(HOST_SLCHOST_CONF37_S)) -#define HOST_SLCHOST_CONF37_V 0xFF -#define HOST_SLCHOST_CONF37_S 8 -/* HOST_SLCHOST_CONF36 : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF36 0x000000FF -#define HOST_SLCHOST_CONF36_M ((HOST_SLCHOST_CONF36_V)<<(HOST_SLCHOST_CONF36_S)) -#define HOST_SLCHOST_CONF36_V 0xFF -#define HOST_SLCHOST_CONF36_S 0 - -#define HOST_SLCHOST_CONF_W10_REG (DR_REG_SLCHOST_BASE + 0xA4) -/* HOST_SLCHOST_CONF43 : R/W ;bitpos:[31:24] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF43 0x000000FF -#define HOST_SLCHOST_CONF43_M ((HOST_SLCHOST_CONF43_V)<<(HOST_SLCHOST_CONF43_S)) -#define HOST_SLCHOST_CONF43_V 0xFF -#define HOST_SLCHOST_CONF43_S 24 -/* HOST_SLCHOST_CONF42 : R/W ;bitpos:[23:16] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF42 0x000000FF -#define HOST_SLCHOST_CONF42_M ((HOST_SLCHOST_CONF42_V)<<(HOST_SLCHOST_CONF42_S)) -#define HOST_SLCHOST_CONF42_V 0xFF -#define HOST_SLCHOST_CONF42_S 16 -/* HOST_SLCHOST_CONF41 : R/W ;bitpos:[15:8] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF41 0x000000FF -#define HOST_SLCHOST_CONF41_M ((HOST_SLCHOST_CONF41_V)<<(HOST_SLCHOST_CONF41_S)) -#define HOST_SLCHOST_CONF41_V 0xFF -#define HOST_SLCHOST_CONF41_S 8 -/* HOST_SLCHOST_CONF40 : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF40 0x000000FF -#define HOST_SLCHOST_CONF40_M ((HOST_SLCHOST_CONF40_V)<<(HOST_SLCHOST_CONF40_S)) -#define HOST_SLCHOST_CONF40_V 0xFF -#define HOST_SLCHOST_CONF40_S 0 - -#define HOST_SLCHOST_CONF_W11_REG (DR_REG_SLCHOST_BASE + 0xA8) -/* HOST_SLCHOST_CONF47 : R/W ;bitpos:[31:24] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF47 0x000000FF -#define HOST_SLCHOST_CONF47_M ((HOST_SLCHOST_CONF47_V)<<(HOST_SLCHOST_CONF47_S)) -#define HOST_SLCHOST_CONF47_V 0xFF -#define HOST_SLCHOST_CONF47_S 24 -/* HOST_SLCHOST_CONF46 : R/W ;bitpos:[23:16] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF46 0x000000FF -#define HOST_SLCHOST_CONF46_M ((HOST_SLCHOST_CONF46_V)<<(HOST_SLCHOST_CONF46_S)) -#define HOST_SLCHOST_CONF46_V 0xFF -#define HOST_SLCHOST_CONF46_S 16 -/* HOST_SLCHOST_CONF45 : R/W ;bitpos:[15:8] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF45 0x000000FF -#define HOST_SLCHOST_CONF45_M ((HOST_SLCHOST_CONF45_V)<<(HOST_SLCHOST_CONF45_S)) -#define HOST_SLCHOST_CONF45_V 0xFF -#define HOST_SLCHOST_CONF45_S 8 -/* HOST_SLCHOST_CONF44 : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF44 0x000000FF -#define HOST_SLCHOST_CONF44_M ((HOST_SLCHOST_CONF44_V)<<(HOST_SLCHOST_CONF44_S)) -#define HOST_SLCHOST_CONF44_V 0xFF -#define HOST_SLCHOST_CONF44_S 0 - -#define HOST_SLCHOST_CONF_W12_REG (DR_REG_SLCHOST_BASE + 0xAC) -/* HOST_SLCHOST_CONF51 : R/W ;bitpos:[31:24] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF51 0x000000FF -#define HOST_SLCHOST_CONF51_M ((HOST_SLCHOST_CONF51_V)<<(HOST_SLCHOST_CONF51_S)) -#define HOST_SLCHOST_CONF51_V 0xFF -#define HOST_SLCHOST_CONF51_S 24 -/* HOST_SLCHOST_CONF50 : R/W ;bitpos:[23:16] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF50 0x000000FF -#define HOST_SLCHOST_CONF50_M ((HOST_SLCHOST_CONF50_V)<<(HOST_SLCHOST_CONF50_S)) -#define HOST_SLCHOST_CONF50_V 0xFF -#define HOST_SLCHOST_CONF50_S 16 -/* HOST_SLCHOST_CONF49 : R/W ;bitpos:[15:8] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF49 0x000000FF -#define HOST_SLCHOST_CONF49_M ((HOST_SLCHOST_CONF49_V)<<(HOST_SLCHOST_CONF49_S)) -#define HOST_SLCHOST_CONF49_V 0xFF -#define HOST_SLCHOST_CONF49_S 8 -/* HOST_SLCHOST_CONF48 : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF48 0x000000FF -#define HOST_SLCHOST_CONF48_M ((HOST_SLCHOST_CONF48_V)<<(HOST_SLCHOST_CONF48_S)) -#define HOST_SLCHOST_CONF48_V 0xFF -#define HOST_SLCHOST_CONF48_S 0 - -#define HOST_SLCHOST_CONF_W13_REG (DR_REG_SLCHOST_BASE + 0xB0) -/* HOST_SLCHOST_CONF55 : R/W ;bitpos:[31:24] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF55 0x000000FF -#define HOST_SLCHOST_CONF55_M ((HOST_SLCHOST_CONF55_V)<<(HOST_SLCHOST_CONF55_S)) -#define HOST_SLCHOST_CONF55_V 0xFF -#define HOST_SLCHOST_CONF55_S 24 -/* HOST_SLCHOST_CONF54 : R/W ;bitpos:[23:16] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF54 0x000000FF -#define HOST_SLCHOST_CONF54_M ((HOST_SLCHOST_CONF54_V)<<(HOST_SLCHOST_CONF54_S)) -#define HOST_SLCHOST_CONF54_V 0xFF -#define HOST_SLCHOST_CONF54_S 16 -/* HOST_SLCHOST_CONF53 : R/W ;bitpos:[15:8] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF53 0x000000FF -#define HOST_SLCHOST_CONF53_M ((HOST_SLCHOST_CONF53_V)<<(HOST_SLCHOST_CONF53_S)) -#define HOST_SLCHOST_CONF53_V 0xFF -#define HOST_SLCHOST_CONF53_S 8 -/* HOST_SLCHOST_CONF52 : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF52 0x000000FF -#define HOST_SLCHOST_CONF52_M ((HOST_SLCHOST_CONF52_V)<<(HOST_SLCHOST_CONF52_S)) -#define HOST_SLCHOST_CONF52_V 0xFF -#define HOST_SLCHOST_CONF52_S 0 - -#define HOST_SLCHOST_CONF_W14_REG (DR_REG_SLCHOST_BASE + 0xB4) -/* HOST_SLCHOST_CONF59 : R/W ;bitpos:[31:24] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF59 0x000000FF -#define HOST_SLCHOST_CONF59_M ((HOST_SLCHOST_CONF59_V)<<(HOST_SLCHOST_CONF59_S)) -#define HOST_SLCHOST_CONF59_V 0xFF -#define HOST_SLCHOST_CONF59_S 24 -/* HOST_SLCHOST_CONF58 : R/W ;bitpos:[23:16] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF58 0x000000FF -#define HOST_SLCHOST_CONF58_M ((HOST_SLCHOST_CONF58_V)<<(HOST_SLCHOST_CONF58_S)) -#define HOST_SLCHOST_CONF58_V 0xFF -#define HOST_SLCHOST_CONF58_S 16 -/* HOST_SLCHOST_CONF57 : R/W ;bitpos:[15:8] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF57 0x000000FF -#define HOST_SLCHOST_CONF57_M ((HOST_SLCHOST_CONF57_V)<<(HOST_SLCHOST_CONF57_S)) -#define HOST_SLCHOST_CONF57_V 0xFF -#define HOST_SLCHOST_CONF57_S 8 -/* HOST_SLCHOST_CONF56 : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF56 0x000000FF -#define HOST_SLCHOST_CONF56_M ((HOST_SLCHOST_CONF56_V)<<(HOST_SLCHOST_CONF56_S)) -#define HOST_SLCHOST_CONF56_V 0xFF -#define HOST_SLCHOST_CONF56_S 0 - -#define HOST_SLCHOST_CONF_W15_REG (DR_REG_SLCHOST_BASE + 0xB8) -/* HOST_SLCHOST_CONF63 : R/W ;bitpos:[31:24] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF63 0x000000FF -#define HOST_SLCHOST_CONF63_M ((HOST_SLCHOST_CONF63_V)<<(HOST_SLCHOST_CONF63_S)) -#define HOST_SLCHOST_CONF63_V 0xFF -#define HOST_SLCHOST_CONF63_S 24 -/* HOST_SLCHOST_CONF62 : R/W ;bitpos:[23:16] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF62 0x000000FF -#define HOST_SLCHOST_CONF62_M ((HOST_SLCHOST_CONF62_V)<<(HOST_SLCHOST_CONF62_S)) -#define HOST_SLCHOST_CONF62_V 0xFF -#define HOST_SLCHOST_CONF62_S 16 -/* HOST_SLCHOST_CONF61 : R/W ;bitpos:[15:8] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF61 0x000000FF -#define HOST_SLCHOST_CONF61_M ((HOST_SLCHOST_CONF61_V)<<(HOST_SLCHOST_CONF61_S)) -#define HOST_SLCHOST_CONF61_V 0xFF -#define HOST_SLCHOST_CONF61_S 8 -/* HOST_SLCHOST_CONF60 : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define HOST_SLCHOST_CONF60 0x000000FF -#define HOST_SLCHOST_CONF60_M ((HOST_SLCHOST_CONF60_V)<<(HOST_SLCHOST_CONF60_S)) -#define HOST_SLCHOST_CONF60_V 0xFF -#define HOST_SLCHOST_CONF60_S 0 - -#define HOST_SLCHOST_CHECK_SUM0_REG (DR_REG_SLCHOST_BASE + 0xBC) -/* HOST_SLCHOST_CHECK_SUM0 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define HOST_SLCHOST_CHECK_SUM0 0xFFFFFFFF -#define HOST_SLCHOST_CHECK_SUM0_M ((HOST_SLCHOST_CHECK_SUM0_V)<<(HOST_SLCHOST_CHECK_SUM0_S)) -#define HOST_SLCHOST_CHECK_SUM0_V 0xFFFFFFFF -#define HOST_SLCHOST_CHECK_SUM0_S 0 - -#define HOST_SLCHOST_CHECK_SUM1_REG (DR_REG_SLCHOST_BASE + 0xC0) -/* HOST_SLCHOST_CHECK_SUM1 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define HOST_SLCHOST_CHECK_SUM1 0xFFFFFFFF -#define HOST_SLCHOST_CHECK_SUM1_M ((HOST_SLCHOST_CHECK_SUM1_V)<<(HOST_SLCHOST_CHECK_SUM1_S)) -#define HOST_SLCHOST_CHECK_SUM1_V 0xFFFFFFFF -#define HOST_SLCHOST_CHECK_SUM1_S 0 - -#define HOST_SLC1HOST_TOKEN_RDATA_REG (DR_REG_SLCHOST_BASE + 0xC4) -/* HOST_SLC1_RX_PF_EOF : RO ;bitpos:[31:28] ;default: 4'h0 ; */ -/*description: */ -#define HOST_SLC1_RX_PF_EOF 0x0000000F -#define HOST_SLC1_RX_PF_EOF_M ((HOST_SLC1_RX_PF_EOF_V)<<(HOST_SLC1_RX_PF_EOF_S)) -#define HOST_SLC1_RX_PF_EOF_V 0xF -#define HOST_SLC1_RX_PF_EOF_S 28 -/* HOST_HOSTSLC1_TOKEN1 : RO ;bitpos:[27:16] ;default: 12'h0 ; */ -/*description: */ -#define HOST_HOSTSLC1_TOKEN1 0x00000FFF -#define HOST_HOSTSLC1_TOKEN1_M ((HOST_HOSTSLC1_TOKEN1_V)<<(HOST_HOSTSLC1_TOKEN1_S)) -#define HOST_HOSTSLC1_TOKEN1_V 0xFFF -#define HOST_HOSTSLC1_TOKEN1_S 16 -/* HOST_SLC1_RX_PF_VALID : RO ;bitpos:[12] ;default: 1'h0 ; */ -/*description: */ -#define HOST_SLC1_RX_PF_VALID (BIT(12)) -#define HOST_SLC1_RX_PF_VALID_M (BIT(12)) -#define HOST_SLC1_RX_PF_VALID_V 0x1 -#define HOST_SLC1_RX_PF_VALID_S 12 -/* HOST_SLC1_TOKEN0 : RO ;bitpos:[11:0] ;default: 12'h0 ; */ -/*description: */ -#define HOST_SLC1_TOKEN0 0x00000FFF -#define HOST_SLC1_TOKEN0_M ((HOST_SLC1_TOKEN0_V)<<(HOST_SLC1_TOKEN0_S)) -#define HOST_SLC1_TOKEN0_V 0xFFF -#define HOST_SLC1_TOKEN0_S 0 - -#define HOST_SLC0HOST_TOKEN_WDATA_REG (DR_REG_SLCHOST_BASE + 0xC8) -/* HOST_SLC0HOST_TOKEN1_WD : R/W ;bitpos:[27:16] ;default: 12'h0 ; */ -/*description: */ -#define HOST_SLC0HOST_TOKEN1_WD 0x00000FFF -#define HOST_SLC0HOST_TOKEN1_WD_M ((HOST_SLC0HOST_TOKEN1_WD_V)<<(HOST_SLC0HOST_TOKEN1_WD_S)) -#define HOST_SLC0HOST_TOKEN1_WD_V 0xFFF -#define HOST_SLC0HOST_TOKEN1_WD_S 16 -/* HOST_SLC0HOST_TOKEN0_WD : R/W ;bitpos:[11:0] ;default: 12'h0 ; */ -/*description: */ -#define HOST_SLC0HOST_TOKEN0_WD 0x00000FFF -#define HOST_SLC0HOST_TOKEN0_WD_M ((HOST_SLC0HOST_TOKEN0_WD_V)<<(HOST_SLC0HOST_TOKEN0_WD_S)) -#define HOST_SLC0HOST_TOKEN0_WD_V 0xFFF -#define HOST_SLC0HOST_TOKEN0_WD_S 0 - -#define HOST_SLC1HOST_TOKEN_WDATA_REG (DR_REG_SLCHOST_BASE + 0xCC) -/* HOST_SLC1HOST_TOKEN1_WD : R/W ;bitpos:[27:16] ;default: 12'h0 ; */ -/*description: */ -#define HOST_SLC1HOST_TOKEN1_WD 0x00000FFF -#define HOST_SLC1HOST_TOKEN1_WD_M ((HOST_SLC1HOST_TOKEN1_WD_V)<<(HOST_SLC1HOST_TOKEN1_WD_S)) -#define HOST_SLC1HOST_TOKEN1_WD_V 0xFFF -#define HOST_SLC1HOST_TOKEN1_WD_S 16 -/* HOST_SLC1HOST_TOKEN0_WD : R/W ;bitpos:[11:0] ;default: 12'h0 ; */ -/*description: */ -#define HOST_SLC1HOST_TOKEN0_WD 0x00000FFF -#define HOST_SLC1HOST_TOKEN0_WD_M ((HOST_SLC1HOST_TOKEN0_WD_V)<<(HOST_SLC1HOST_TOKEN0_WD_S)) -#define HOST_SLC1HOST_TOKEN0_WD_V 0xFFF -#define HOST_SLC1HOST_TOKEN0_WD_S 0 - -#define HOST_SLCHOST_TOKEN_CON_REG (DR_REG_SLCHOST_BASE + 0xD0) -/* HOST_SLC0HOST_LEN_WR : WO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_LEN_WR (BIT(8)) -#define HOST_SLC0HOST_LEN_WR_M (BIT(8)) -#define HOST_SLC0HOST_LEN_WR_V 0x1 -#define HOST_SLC0HOST_LEN_WR_S 8 -/* HOST_SLC1HOST_TOKEN1_WR : WO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1HOST_TOKEN1_WR (BIT(7)) -#define HOST_SLC1HOST_TOKEN1_WR_M (BIT(7)) -#define HOST_SLC1HOST_TOKEN1_WR_V 0x1 -#define HOST_SLC1HOST_TOKEN1_WR_S 7 -/* HOST_SLC1HOST_TOKEN0_WR : WO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1HOST_TOKEN0_WR (BIT(6)) -#define HOST_SLC1HOST_TOKEN0_WR_M (BIT(6)) -#define HOST_SLC1HOST_TOKEN0_WR_V 0x1 -#define HOST_SLC1HOST_TOKEN0_WR_S 6 -/* HOST_SLC1HOST_TOKEN1_DEC : WO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1HOST_TOKEN1_DEC (BIT(5)) -#define HOST_SLC1HOST_TOKEN1_DEC_M (BIT(5)) -#define HOST_SLC1HOST_TOKEN1_DEC_V 0x1 -#define HOST_SLC1HOST_TOKEN1_DEC_S 5 -/* HOST_SLC1HOST_TOKEN0_DEC : WO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1HOST_TOKEN0_DEC (BIT(4)) -#define HOST_SLC1HOST_TOKEN0_DEC_M (BIT(4)) -#define HOST_SLC1HOST_TOKEN0_DEC_V 0x1 -#define HOST_SLC1HOST_TOKEN0_DEC_S 4 -/* HOST_SLC0HOST_TOKEN1_WR : WO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_TOKEN1_WR (BIT(3)) -#define HOST_SLC0HOST_TOKEN1_WR_M (BIT(3)) -#define HOST_SLC0HOST_TOKEN1_WR_V 0x1 -#define HOST_SLC0HOST_TOKEN1_WR_S 3 -/* HOST_SLC0HOST_TOKEN0_WR : WO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_TOKEN0_WR (BIT(2)) -#define HOST_SLC0HOST_TOKEN0_WR_M (BIT(2)) -#define HOST_SLC0HOST_TOKEN0_WR_V 0x1 -#define HOST_SLC0HOST_TOKEN0_WR_S 2 -/* HOST_SLC0HOST_TOKEN1_DEC : WO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_TOKEN1_DEC (BIT(1)) -#define HOST_SLC0HOST_TOKEN1_DEC_M (BIT(1)) -#define HOST_SLC0HOST_TOKEN1_DEC_V 0x1 -#define HOST_SLC0HOST_TOKEN1_DEC_S 1 -/* HOST_SLC0HOST_TOKEN0_DEC : WO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_TOKEN0_DEC (BIT(0)) -#define HOST_SLC0HOST_TOKEN0_DEC_M (BIT(0)) -#define HOST_SLC0HOST_TOKEN0_DEC_V 0x1 -#define HOST_SLC0HOST_TOKEN0_DEC_S 0 - -#define HOST_SLC0HOST_INT_CLR_REG (DR_REG_SLCHOST_BASE + 0xD4) -/* HOST_GPIO_SDIO_INT_CLR : WO ;bitpos:[25] ;default: 1'b0 ; */ -/*description: */ -#define HOST_GPIO_SDIO_INT_CLR (BIT(25)) -#define HOST_GPIO_SDIO_INT_CLR_M (BIT(25)) -#define HOST_GPIO_SDIO_INT_CLR_V 0x1 -#define HOST_GPIO_SDIO_INT_CLR_S 25 -/* HOST_SLC0_HOST_RD_RETRY_INT_CLR : WO ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_HOST_RD_RETRY_INT_CLR (BIT(24)) -#define HOST_SLC0_HOST_RD_RETRY_INT_CLR_M (BIT(24)) -#define HOST_SLC0_HOST_RD_RETRY_INT_CLR_V 0x1 -#define HOST_SLC0_HOST_RD_RETRY_INT_CLR_S 24 -/* HOST_SLC0_RX_NEW_PACKET_INT_CLR : WO ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_RX_NEW_PACKET_INT_CLR (BIT(23)) -#define HOST_SLC0_RX_NEW_PACKET_INT_CLR_M (BIT(23)) -#define HOST_SLC0_RX_NEW_PACKET_INT_CLR_V 0x1 -#define HOST_SLC0_RX_NEW_PACKET_INT_CLR_S 23 -/* HOST_SLC0_EXT_BIT3_INT_CLR : WO ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_EXT_BIT3_INT_CLR (BIT(22)) -#define HOST_SLC0_EXT_BIT3_INT_CLR_M (BIT(22)) -#define HOST_SLC0_EXT_BIT3_INT_CLR_V 0x1 -#define HOST_SLC0_EXT_BIT3_INT_CLR_S 22 -/* HOST_SLC0_EXT_BIT2_INT_CLR : WO ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_EXT_BIT2_INT_CLR (BIT(21)) -#define HOST_SLC0_EXT_BIT2_INT_CLR_M (BIT(21)) -#define HOST_SLC0_EXT_BIT2_INT_CLR_V 0x1 -#define HOST_SLC0_EXT_BIT2_INT_CLR_S 21 -/* HOST_SLC0_EXT_BIT1_INT_CLR : WO ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_EXT_BIT1_INT_CLR (BIT(20)) -#define HOST_SLC0_EXT_BIT1_INT_CLR_M (BIT(20)) -#define HOST_SLC0_EXT_BIT1_INT_CLR_V 0x1 -#define HOST_SLC0_EXT_BIT1_INT_CLR_S 20 -/* HOST_SLC0_EXT_BIT0_INT_CLR : WO ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_EXT_BIT0_INT_CLR (BIT(19)) -#define HOST_SLC0_EXT_BIT0_INT_CLR_M (BIT(19)) -#define HOST_SLC0_EXT_BIT0_INT_CLR_V 0x1 -#define HOST_SLC0_EXT_BIT0_INT_CLR_S 19 -/* HOST_SLC0_RX_PF_VALID_INT_CLR : WO ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_RX_PF_VALID_INT_CLR (BIT(18)) -#define HOST_SLC0_RX_PF_VALID_INT_CLR_M (BIT(18)) -#define HOST_SLC0_RX_PF_VALID_INT_CLR_V 0x1 -#define HOST_SLC0_RX_PF_VALID_INT_CLR_S 18 -/* HOST_SLC0_TX_OVF_INT_CLR : WO ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TX_OVF_INT_CLR (BIT(17)) -#define HOST_SLC0_TX_OVF_INT_CLR_M (BIT(17)) -#define HOST_SLC0_TX_OVF_INT_CLR_V 0x1 -#define HOST_SLC0_TX_OVF_INT_CLR_S 17 -/* HOST_SLC0_RX_UDF_INT_CLR : WO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_RX_UDF_INT_CLR (BIT(16)) -#define HOST_SLC0_RX_UDF_INT_CLR_M (BIT(16)) -#define HOST_SLC0_RX_UDF_INT_CLR_V 0x1 -#define HOST_SLC0_RX_UDF_INT_CLR_S 16 -/* HOST_SLC0HOST_TX_START_INT_CLR : WO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_TX_START_INT_CLR (BIT(15)) -#define HOST_SLC0HOST_TX_START_INT_CLR_M (BIT(15)) -#define HOST_SLC0HOST_TX_START_INT_CLR_V 0x1 -#define HOST_SLC0HOST_TX_START_INT_CLR_S 15 -/* HOST_SLC0HOST_RX_START_INT_CLR : WO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_RX_START_INT_CLR (BIT(14)) -#define HOST_SLC0HOST_RX_START_INT_CLR_M (BIT(14)) -#define HOST_SLC0HOST_RX_START_INT_CLR_V 0x1 -#define HOST_SLC0HOST_RX_START_INT_CLR_S 14 -/* HOST_SLC0HOST_RX_EOF_INT_CLR : WO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_RX_EOF_INT_CLR (BIT(13)) -#define HOST_SLC0HOST_RX_EOF_INT_CLR_M (BIT(13)) -#define HOST_SLC0HOST_RX_EOF_INT_CLR_V 0x1 -#define HOST_SLC0HOST_RX_EOF_INT_CLR_S 13 -/* HOST_SLC0HOST_RX_SOF_INT_CLR : WO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_RX_SOF_INT_CLR (BIT(12)) -#define HOST_SLC0HOST_RX_SOF_INT_CLR_M (BIT(12)) -#define HOST_SLC0HOST_RX_SOF_INT_CLR_V 0x1 -#define HOST_SLC0HOST_RX_SOF_INT_CLR_S 12 -/* HOST_SLC0_TOKEN1_0TO1_INT_CLR : WO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOKEN1_0TO1_INT_CLR (BIT(11)) -#define HOST_SLC0_TOKEN1_0TO1_INT_CLR_M (BIT(11)) -#define HOST_SLC0_TOKEN1_0TO1_INT_CLR_V 0x1 -#define HOST_SLC0_TOKEN1_0TO1_INT_CLR_S 11 -/* HOST_SLC0_TOKEN0_0TO1_INT_CLR : WO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOKEN0_0TO1_INT_CLR (BIT(10)) -#define HOST_SLC0_TOKEN0_0TO1_INT_CLR_M (BIT(10)) -#define HOST_SLC0_TOKEN0_0TO1_INT_CLR_V 0x1 -#define HOST_SLC0_TOKEN0_0TO1_INT_CLR_S 10 -/* HOST_SLC0_TOKEN1_1TO0_INT_CLR : WO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOKEN1_1TO0_INT_CLR (BIT(9)) -#define HOST_SLC0_TOKEN1_1TO0_INT_CLR_M (BIT(9)) -#define HOST_SLC0_TOKEN1_1TO0_INT_CLR_V 0x1 -#define HOST_SLC0_TOKEN1_1TO0_INT_CLR_S 9 -/* HOST_SLC0_TOKEN0_1TO0_INT_CLR : WO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOKEN0_1TO0_INT_CLR (BIT(8)) -#define HOST_SLC0_TOKEN0_1TO0_INT_CLR_M (BIT(8)) -#define HOST_SLC0_TOKEN0_1TO0_INT_CLR_V 0x1 -#define HOST_SLC0_TOKEN0_1TO0_INT_CLR_S 8 -/* HOST_SLC0_TOHOST_BIT7_INT_CLR : WO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT7_INT_CLR (BIT(7)) -#define HOST_SLC0_TOHOST_BIT7_INT_CLR_M (BIT(7)) -#define HOST_SLC0_TOHOST_BIT7_INT_CLR_V 0x1 -#define HOST_SLC0_TOHOST_BIT7_INT_CLR_S 7 -/* HOST_SLC0_TOHOST_BIT6_INT_CLR : WO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT6_INT_CLR (BIT(6)) -#define HOST_SLC0_TOHOST_BIT6_INT_CLR_M (BIT(6)) -#define HOST_SLC0_TOHOST_BIT6_INT_CLR_V 0x1 -#define HOST_SLC0_TOHOST_BIT6_INT_CLR_S 6 -/* HOST_SLC0_TOHOST_BIT5_INT_CLR : WO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT5_INT_CLR (BIT(5)) -#define HOST_SLC0_TOHOST_BIT5_INT_CLR_M (BIT(5)) -#define HOST_SLC0_TOHOST_BIT5_INT_CLR_V 0x1 -#define HOST_SLC0_TOHOST_BIT5_INT_CLR_S 5 -/* HOST_SLC0_TOHOST_BIT4_INT_CLR : WO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT4_INT_CLR (BIT(4)) -#define HOST_SLC0_TOHOST_BIT4_INT_CLR_M (BIT(4)) -#define HOST_SLC0_TOHOST_BIT4_INT_CLR_V 0x1 -#define HOST_SLC0_TOHOST_BIT4_INT_CLR_S 4 -/* HOST_SLC0_TOHOST_BIT3_INT_CLR : WO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT3_INT_CLR (BIT(3)) -#define HOST_SLC0_TOHOST_BIT3_INT_CLR_M (BIT(3)) -#define HOST_SLC0_TOHOST_BIT3_INT_CLR_V 0x1 -#define HOST_SLC0_TOHOST_BIT3_INT_CLR_S 3 -/* HOST_SLC0_TOHOST_BIT2_INT_CLR : WO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT2_INT_CLR (BIT(2)) -#define HOST_SLC0_TOHOST_BIT2_INT_CLR_M (BIT(2)) -#define HOST_SLC0_TOHOST_BIT2_INT_CLR_V 0x1 -#define HOST_SLC0_TOHOST_BIT2_INT_CLR_S 2 -/* HOST_SLC0_TOHOST_BIT1_INT_CLR : WO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT1_INT_CLR (BIT(1)) -#define HOST_SLC0_TOHOST_BIT1_INT_CLR_M (BIT(1)) -#define HOST_SLC0_TOHOST_BIT1_INT_CLR_V 0x1 -#define HOST_SLC0_TOHOST_BIT1_INT_CLR_S 1 -/* HOST_SLC0_TOHOST_BIT0_INT_CLR : WO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT0_INT_CLR (BIT(0)) -#define HOST_SLC0_TOHOST_BIT0_INT_CLR_M (BIT(0)) -#define HOST_SLC0_TOHOST_BIT0_INT_CLR_V 0x1 -#define HOST_SLC0_TOHOST_BIT0_INT_CLR_S 0 - -#define HOST_SLC1HOST_INT_CLR_REG (DR_REG_SLCHOST_BASE + 0xD8) -/* HOST_SLC1_BT_RX_NEW_PACKET_INT_CLR : WO ;bitpos:[25] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_BT_RX_NEW_PACKET_INT_CLR (BIT(25)) -#define HOST_SLC1_BT_RX_NEW_PACKET_INT_CLR_M (BIT(25)) -#define HOST_SLC1_BT_RX_NEW_PACKET_INT_CLR_V 0x1 -#define HOST_SLC1_BT_RX_NEW_PACKET_INT_CLR_S 25 -/* HOST_SLC1_HOST_RD_RETRY_INT_CLR : WO ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_HOST_RD_RETRY_INT_CLR (BIT(24)) -#define HOST_SLC1_HOST_RD_RETRY_INT_CLR_M (BIT(24)) -#define HOST_SLC1_HOST_RD_RETRY_INT_CLR_V 0x1 -#define HOST_SLC1_HOST_RD_RETRY_INT_CLR_S 24 -/* HOST_SLC1_WIFI_RX_NEW_PACKET_INT_CLR : WO ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_WIFI_RX_NEW_PACKET_INT_CLR (BIT(23)) -#define HOST_SLC1_WIFI_RX_NEW_PACKET_INT_CLR_M (BIT(23)) -#define HOST_SLC1_WIFI_RX_NEW_PACKET_INT_CLR_V 0x1 -#define HOST_SLC1_WIFI_RX_NEW_PACKET_INT_CLR_S 23 -/* HOST_SLC1_EXT_BIT3_INT_CLR : WO ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_EXT_BIT3_INT_CLR (BIT(22)) -#define HOST_SLC1_EXT_BIT3_INT_CLR_M (BIT(22)) -#define HOST_SLC1_EXT_BIT3_INT_CLR_V 0x1 -#define HOST_SLC1_EXT_BIT3_INT_CLR_S 22 -/* HOST_SLC1_EXT_BIT2_INT_CLR : WO ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_EXT_BIT2_INT_CLR (BIT(21)) -#define HOST_SLC1_EXT_BIT2_INT_CLR_M (BIT(21)) -#define HOST_SLC1_EXT_BIT2_INT_CLR_V 0x1 -#define HOST_SLC1_EXT_BIT2_INT_CLR_S 21 -/* HOST_SLC1_EXT_BIT1_INT_CLR : WO ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_EXT_BIT1_INT_CLR (BIT(20)) -#define HOST_SLC1_EXT_BIT1_INT_CLR_M (BIT(20)) -#define HOST_SLC1_EXT_BIT1_INT_CLR_V 0x1 -#define HOST_SLC1_EXT_BIT1_INT_CLR_S 20 -/* HOST_SLC1_EXT_BIT0_INT_CLR : WO ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_EXT_BIT0_INT_CLR (BIT(19)) -#define HOST_SLC1_EXT_BIT0_INT_CLR_M (BIT(19)) -#define HOST_SLC1_EXT_BIT0_INT_CLR_V 0x1 -#define HOST_SLC1_EXT_BIT0_INT_CLR_S 19 -/* HOST_SLC1_RX_PF_VALID_INT_CLR : WO ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_RX_PF_VALID_INT_CLR (BIT(18)) -#define HOST_SLC1_RX_PF_VALID_INT_CLR_M (BIT(18)) -#define HOST_SLC1_RX_PF_VALID_INT_CLR_V 0x1 -#define HOST_SLC1_RX_PF_VALID_INT_CLR_S 18 -/* HOST_SLC1_TX_OVF_INT_CLR : WO ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TX_OVF_INT_CLR (BIT(17)) -#define HOST_SLC1_TX_OVF_INT_CLR_M (BIT(17)) -#define HOST_SLC1_TX_OVF_INT_CLR_V 0x1 -#define HOST_SLC1_TX_OVF_INT_CLR_S 17 -/* HOST_SLC1_RX_UDF_INT_CLR : WO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_RX_UDF_INT_CLR (BIT(16)) -#define HOST_SLC1_RX_UDF_INT_CLR_M (BIT(16)) -#define HOST_SLC1_RX_UDF_INT_CLR_V 0x1 -#define HOST_SLC1_RX_UDF_INT_CLR_S 16 -/* HOST_SLC1HOST_TX_START_INT_CLR : WO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1HOST_TX_START_INT_CLR (BIT(15)) -#define HOST_SLC1HOST_TX_START_INT_CLR_M (BIT(15)) -#define HOST_SLC1HOST_TX_START_INT_CLR_V 0x1 -#define HOST_SLC1HOST_TX_START_INT_CLR_S 15 -/* HOST_SLC1HOST_RX_START_INT_CLR : WO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1HOST_RX_START_INT_CLR (BIT(14)) -#define HOST_SLC1HOST_RX_START_INT_CLR_M (BIT(14)) -#define HOST_SLC1HOST_RX_START_INT_CLR_V 0x1 -#define HOST_SLC1HOST_RX_START_INT_CLR_S 14 -/* HOST_SLC1HOST_RX_EOF_INT_CLR : WO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1HOST_RX_EOF_INT_CLR (BIT(13)) -#define HOST_SLC1HOST_RX_EOF_INT_CLR_M (BIT(13)) -#define HOST_SLC1HOST_RX_EOF_INT_CLR_V 0x1 -#define HOST_SLC1HOST_RX_EOF_INT_CLR_S 13 -/* HOST_SLC1HOST_RX_SOF_INT_CLR : WO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1HOST_RX_SOF_INT_CLR (BIT(12)) -#define HOST_SLC1HOST_RX_SOF_INT_CLR_M (BIT(12)) -#define HOST_SLC1HOST_RX_SOF_INT_CLR_V 0x1 -#define HOST_SLC1HOST_RX_SOF_INT_CLR_S 12 -/* HOST_SLC1_TOKEN1_0TO1_INT_CLR : WO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOKEN1_0TO1_INT_CLR (BIT(11)) -#define HOST_SLC1_TOKEN1_0TO1_INT_CLR_M (BIT(11)) -#define HOST_SLC1_TOKEN1_0TO1_INT_CLR_V 0x1 -#define HOST_SLC1_TOKEN1_0TO1_INT_CLR_S 11 -/* HOST_SLC1_TOKEN0_0TO1_INT_CLR : WO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOKEN0_0TO1_INT_CLR (BIT(10)) -#define HOST_SLC1_TOKEN0_0TO1_INT_CLR_M (BIT(10)) -#define HOST_SLC1_TOKEN0_0TO1_INT_CLR_V 0x1 -#define HOST_SLC1_TOKEN0_0TO1_INT_CLR_S 10 -/* HOST_SLC1_TOKEN1_1TO0_INT_CLR : WO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOKEN1_1TO0_INT_CLR (BIT(9)) -#define HOST_SLC1_TOKEN1_1TO0_INT_CLR_M (BIT(9)) -#define HOST_SLC1_TOKEN1_1TO0_INT_CLR_V 0x1 -#define HOST_SLC1_TOKEN1_1TO0_INT_CLR_S 9 -/* HOST_SLC1_TOKEN0_1TO0_INT_CLR : WO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOKEN0_1TO0_INT_CLR (BIT(8)) -#define HOST_SLC1_TOKEN0_1TO0_INT_CLR_M (BIT(8)) -#define HOST_SLC1_TOKEN0_1TO0_INT_CLR_V 0x1 -#define HOST_SLC1_TOKEN0_1TO0_INT_CLR_S 8 -/* HOST_SLC1_TOHOST_BIT7_INT_CLR : WO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT7_INT_CLR (BIT(7)) -#define HOST_SLC1_TOHOST_BIT7_INT_CLR_M (BIT(7)) -#define HOST_SLC1_TOHOST_BIT7_INT_CLR_V 0x1 -#define HOST_SLC1_TOHOST_BIT7_INT_CLR_S 7 -/* HOST_SLC1_TOHOST_BIT6_INT_CLR : WO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT6_INT_CLR (BIT(6)) -#define HOST_SLC1_TOHOST_BIT6_INT_CLR_M (BIT(6)) -#define HOST_SLC1_TOHOST_BIT6_INT_CLR_V 0x1 -#define HOST_SLC1_TOHOST_BIT6_INT_CLR_S 6 -/* HOST_SLC1_TOHOST_BIT5_INT_CLR : WO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT5_INT_CLR (BIT(5)) -#define HOST_SLC1_TOHOST_BIT5_INT_CLR_M (BIT(5)) -#define HOST_SLC1_TOHOST_BIT5_INT_CLR_V 0x1 -#define HOST_SLC1_TOHOST_BIT5_INT_CLR_S 5 -/* HOST_SLC1_TOHOST_BIT4_INT_CLR : WO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT4_INT_CLR (BIT(4)) -#define HOST_SLC1_TOHOST_BIT4_INT_CLR_M (BIT(4)) -#define HOST_SLC1_TOHOST_BIT4_INT_CLR_V 0x1 -#define HOST_SLC1_TOHOST_BIT4_INT_CLR_S 4 -/* HOST_SLC1_TOHOST_BIT3_INT_CLR : WO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT3_INT_CLR (BIT(3)) -#define HOST_SLC1_TOHOST_BIT3_INT_CLR_M (BIT(3)) -#define HOST_SLC1_TOHOST_BIT3_INT_CLR_V 0x1 -#define HOST_SLC1_TOHOST_BIT3_INT_CLR_S 3 -/* HOST_SLC1_TOHOST_BIT2_INT_CLR : WO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT2_INT_CLR (BIT(2)) -#define HOST_SLC1_TOHOST_BIT2_INT_CLR_M (BIT(2)) -#define HOST_SLC1_TOHOST_BIT2_INT_CLR_V 0x1 -#define HOST_SLC1_TOHOST_BIT2_INT_CLR_S 2 -/* HOST_SLC1_TOHOST_BIT1_INT_CLR : WO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT1_INT_CLR (BIT(1)) -#define HOST_SLC1_TOHOST_BIT1_INT_CLR_M (BIT(1)) -#define HOST_SLC1_TOHOST_BIT1_INT_CLR_V 0x1 -#define HOST_SLC1_TOHOST_BIT1_INT_CLR_S 1 -/* HOST_SLC1_TOHOST_BIT0_INT_CLR : WO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT0_INT_CLR (BIT(0)) -#define HOST_SLC1_TOHOST_BIT0_INT_CLR_M (BIT(0)) -#define HOST_SLC1_TOHOST_BIT0_INT_CLR_V 0x1 -#define HOST_SLC1_TOHOST_BIT0_INT_CLR_S 0 - -#define HOST_SLC0HOST_FUNC1_INT_ENA_REG (DR_REG_SLCHOST_BASE + 0xDC) -/* HOST_FN1_GPIO_SDIO_INT_ENA : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_GPIO_SDIO_INT_ENA (BIT(25)) -#define HOST_FN1_GPIO_SDIO_INT_ENA_M (BIT(25)) -#define HOST_FN1_GPIO_SDIO_INT_ENA_V 0x1 -#define HOST_FN1_GPIO_SDIO_INT_ENA_S 25 -/* HOST_FN1_SLC0_HOST_RD_RETRY_INT_ENA : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC0_HOST_RD_RETRY_INT_ENA (BIT(24)) -#define HOST_FN1_SLC0_HOST_RD_RETRY_INT_ENA_M (BIT(24)) -#define HOST_FN1_SLC0_HOST_RD_RETRY_INT_ENA_V 0x1 -#define HOST_FN1_SLC0_HOST_RD_RETRY_INT_ENA_S 24 -/* HOST_FN1_SLC0_RX_NEW_PACKET_INT_ENA : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC0_RX_NEW_PACKET_INT_ENA (BIT(23)) -#define HOST_FN1_SLC0_RX_NEW_PACKET_INT_ENA_M (BIT(23)) -#define HOST_FN1_SLC0_RX_NEW_PACKET_INT_ENA_V 0x1 -#define HOST_FN1_SLC0_RX_NEW_PACKET_INT_ENA_S 23 -/* HOST_FN1_SLC0_EXT_BIT3_INT_ENA : R/W ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC0_EXT_BIT3_INT_ENA (BIT(22)) -#define HOST_FN1_SLC0_EXT_BIT3_INT_ENA_M (BIT(22)) -#define HOST_FN1_SLC0_EXT_BIT3_INT_ENA_V 0x1 -#define HOST_FN1_SLC0_EXT_BIT3_INT_ENA_S 22 -/* HOST_FN1_SLC0_EXT_BIT2_INT_ENA : R/W ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC0_EXT_BIT2_INT_ENA (BIT(21)) -#define HOST_FN1_SLC0_EXT_BIT2_INT_ENA_M (BIT(21)) -#define HOST_FN1_SLC0_EXT_BIT2_INT_ENA_V 0x1 -#define HOST_FN1_SLC0_EXT_BIT2_INT_ENA_S 21 -/* HOST_FN1_SLC0_EXT_BIT1_INT_ENA : R/W ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC0_EXT_BIT1_INT_ENA (BIT(20)) -#define HOST_FN1_SLC0_EXT_BIT1_INT_ENA_M (BIT(20)) -#define HOST_FN1_SLC0_EXT_BIT1_INT_ENA_V 0x1 -#define HOST_FN1_SLC0_EXT_BIT1_INT_ENA_S 20 -/* HOST_FN1_SLC0_EXT_BIT0_INT_ENA : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC0_EXT_BIT0_INT_ENA (BIT(19)) -#define HOST_FN1_SLC0_EXT_BIT0_INT_ENA_M (BIT(19)) -#define HOST_FN1_SLC0_EXT_BIT0_INT_ENA_V 0x1 -#define HOST_FN1_SLC0_EXT_BIT0_INT_ENA_S 19 -/* HOST_FN1_SLC0_RX_PF_VALID_INT_ENA : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC0_RX_PF_VALID_INT_ENA (BIT(18)) -#define HOST_FN1_SLC0_RX_PF_VALID_INT_ENA_M (BIT(18)) -#define HOST_FN1_SLC0_RX_PF_VALID_INT_ENA_V 0x1 -#define HOST_FN1_SLC0_RX_PF_VALID_INT_ENA_S 18 -/* HOST_FN1_SLC0_TX_OVF_INT_ENA : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC0_TX_OVF_INT_ENA (BIT(17)) -#define HOST_FN1_SLC0_TX_OVF_INT_ENA_M (BIT(17)) -#define HOST_FN1_SLC0_TX_OVF_INT_ENA_V 0x1 -#define HOST_FN1_SLC0_TX_OVF_INT_ENA_S 17 -/* HOST_FN1_SLC0_RX_UDF_INT_ENA : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC0_RX_UDF_INT_ENA (BIT(16)) -#define HOST_FN1_SLC0_RX_UDF_INT_ENA_M (BIT(16)) -#define HOST_FN1_SLC0_RX_UDF_INT_ENA_V 0x1 -#define HOST_FN1_SLC0_RX_UDF_INT_ENA_S 16 -/* HOST_FN1_SLC0HOST_TX_START_INT_ENA : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC0HOST_TX_START_INT_ENA (BIT(15)) -#define HOST_FN1_SLC0HOST_TX_START_INT_ENA_M (BIT(15)) -#define HOST_FN1_SLC0HOST_TX_START_INT_ENA_V 0x1 -#define HOST_FN1_SLC0HOST_TX_START_INT_ENA_S 15 -/* HOST_FN1_SLC0HOST_RX_START_INT_ENA : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC0HOST_RX_START_INT_ENA (BIT(14)) -#define HOST_FN1_SLC0HOST_RX_START_INT_ENA_M (BIT(14)) -#define HOST_FN1_SLC0HOST_RX_START_INT_ENA_V 0x1 -#define HOST_FN1_SLC0HOST_RX_START_INT_ENA_S 14 -/* HOST_FN1_SLC0HOST_RX_EOF_INT_ENA : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC0HOST_RX_EOF_INT_ENA (BIT(13)) -#define HOST_FN1_SLC0HOST_RX_EOF_INT_ENA_M (BIT(13)) -#define HOST_FN1_SLC0HOST_RX_EOF_INT_ENA_V 0x1 -#define HOST_FN1_SLC0HOST_RX_EOF_INT_ENA_S 13 -/* HOST_FN1_SLC0HOST_RX_SOF_INT_ENA : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC0HOST_RX_SOF_INT_ENA (BIT(12)) -#define HOST_FN1_SLC0HOST_RX_SOF_INT_ENA_M (BIT(12)) -#define HOST_FN1_SLC0HOST_RX_SOF_INT_ENA_V 0x1 -#define HOST_FN1_SLC0HOST_RX_SOF_INT_ENA_S 12 -/* HOST_FN1_SLC0_TOKEN1_0TO1_INT_ENA : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC0_TOKEN1_0TO1_INT_ENA (BIT(11)) -#define HOST_FN1_SLC0_TOKEN1_0TO1_INT_ENA_M (BIT(11)) -#define HOST_FN1_SLC0_TOKEN1_0TO1_INT_ENA_V 0x1 -#define HOST_FN1_SLC0_TOKEN1_0TO1_INT_ENA_S 11 -/* HOST_FN1_SLC0_TOKEN0_0TO1_INT_ENA : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC0_TOKEN0_0TO1_INT_ENA (BIT(10)) -#define HOST_FN1_SLC0_TOKEN0_0TO1_INT_ENA_M (BIT(10)) -#define HOST_FN1_SLC0_TOKEN0_0TO1_INT_ENA_V 0x1 -#define HOST_FN1_SLC0_TOKEN0_0TO1_INT_ENA_S 10 -/* HOST_FN1_SLC0_TOKEN1_1TO0_INT_ENA : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC0_TOKEN1_1TO0_INT_ENA (BIT(9)) -#define HOST_FN1_SLC0_TOKEN1_1TO0_INT_ENA_M (BIT(9)) -#define HOST_FN1_SLC0_TOKEN1_1TO0_INT_ENA_V 0x1 -#define HOST_FN1_SLC0_TOKEN1_1TO0_INT_ENA_S 9 -/* HOST_FN1_SLC0_TOKEN0_1TO0_INT_ENA : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC0_TOKEN0_1TO0_INT_ENA (BIT(8)) -#define HOST_FN1_SLC0_TOKEN0_1TO0_INT_ENA_M (BIT(8)) -#define HOST_FN1_SLC0_TOKEN0_1TO0_INT_ENA_V 0x1 -#define HOST_FN1_SLC0_TOKEN0_1TO0_INT_ENA_S 8 -/* HOST_FN1_SLC0_TOHOST_BIT7_INT_ENA : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC0_TOHOST_BIT7_INT_ENA (BIT(7)) -#define HOST_FN1_SLC0_TOHOST_BIT7_INT_ENA_M (BIT(7)) -#define HOST_FN1_SLC0_TOHOST_BIT7_INT_ENA_V 0x1 -#define HOST_FN1_SLC0_TOHOST_BIT7_INT_ENA_S 7 -/* HOST_FN1_SLC0_TOHOST_BIT6_INT_ENA : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC0_TOHOST_BIT6_INT_ENA (BIT(6)) -#define HOST_FN1_SLC0_TOHOST_BIT6_INT_ENA_M (BIT(6)) -#define HOST_FN1_SLC0_TOHOST_BIT6_INT_ENA_V 0x1 -#define HOST_FN1_SLC0_TOHOST_BIT6_INT_ENA_S 6 -/* HOST_FN1_SLC0_TOHOST_BIT5_INT_ENA : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC0_TOHOST_BIT5_INT_ENA (BIT(5)) -#define HOST_FN1_SLC0_TOHOST_BIT5_INT_ENA_M (BIT(5)) -#define HOST_FN1_SLC0_TOHOST_BIT5_INT_ENA_V 0x1 -#define HOST_FN1_SLC0_TOHOST_BIT5_INT_ENA_S 5 -/* HOST_FN1_SLC0_TOHOST_BIT4_INT_ENA : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC0_TOHOST_BIT4_INT_ENA (BIT(4)) -#define HOST_FN1_SLC0_TOHOST_BIT4_INT_ENA_M (BIT(4)) -#define HOST_FN1_SLC0_TOHOST_BIT4_INT_ENA_V 0x1 -#define HOST_FN1_SLC0_TOHOST_BIT4_INT_ENA_S 4 -/* HOST_FN1_SLC0_TOHOST_BIT3_INT_ENA : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC0_TOHOST_BIT3_INT_ENA (BIT(3)) -#define HOST_FN1_SLC0_TOHOST_BIT3_INT_ENA_M (BIT(3)) -#define HOST_FN1_SLC0_TOHOST_BIT3_INT_ENA_V 0x1 -#define HOST_FN1_SLC0_TOHOST_BIT3_INT_ENA_S 3 -/* HOST_FN1_SLC0_TOHOST_BIT2_INT_ENA : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC0_TOHOST_BIT2_INT_ENA (BIT(2)) -#define HOST_FN1_SLC0_TOHOST_BIT2_INT_ENA_M (BIT(2)) -#define HOST_FN1_SLC0_TOHOST_BIT2_INT_ENA_V 0x1 -#define HOST_FN1_SLC0_TOHOST_BIT2_INT_ENA_S 2 -/* HOST_FN1_SLC0_TOHOST_BIT1_INT_ENA : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC0_TOHOST_BIT1_INT_ENA (BIT(1)) -#define HOST_FN1_SLC0_TOHOST_BIT1_INT_ENA_M (BIT(1)) -#define HOST_FN1_SLC0_TOHOST_BIT1_INT_ENA_V 0x1 -#define HOST_FN1_SLC0_TOHOST_BIT1_INT_ENA_S 1 -/* HOST_FN1_SLC0_TOHOST_BIT0_INT_ENA : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC0_TOHOST_BIT0_INT_ENA (BIT(0)) -#define HOST_FN1_SLC0_TOHOST_BIT0_INT_ENA_M (BIT(0)) -#define HOST_FN1_SLC0_TOHOST_BIT0_INT_ENA_V 0x1 -#define HOST_FN1_SLC0_TOHOST_BIT0_INT_ENA_S 0 - -#define HOST_SLC1HOST_FUNC1_INT_ENA_REG (DR_REG_SLCHOST_BASE + 0xE0) -/* HOST_FN1_SLC1_BT_RX_NEW_PACKET_INT_ENA : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1_BT_RX_NEW_PACKET_INT_ENA (BIT(25)) -#define HOST_FN1_SLC1_BT_RX_NEW_PACKET_INT_ENA_M (BIT(25)) -#define HOST_FN1_SLC1_BT_RX_NEW_PACKET_INT_ENA_V 0x1 -#define HOST_FN1_SLC1_BT_RX_NEW_PACKET_INT_ENA_S 25 -/* HOST_FN1_SLC1_HOST_RD_RETRY_INT_ENA : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1_HOST_RD_RETRY_INT_ENA (BIT(24)) -#define HOST_FN1_SLC1_HOST_RD_RETRY_INT_ENA_M (BIT(24)) -#define HOST_FN1_SLC1_HOST_RD_RETRY_INT_ENA_V 0x1 -#define HOST_FN1_SLC1_HOST_RD_RETRY_INT_ENA_S 24 -/* HOST_FN1_SLC1_WIFI_RX_NEW_PACKET_INT_ENA : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1_WIFI_RX_NEW_PACKET_INT_ENA (BIT(23)) -#define HOST_FN1_SLC1_WIFI_RX_NEW_PACKET_INT_ENA_M (BIT(23)) -#define HOST_FN1_SLC1_WIFI_RX_NEW_PACKET_INT_ENA_V 0x1 -#define HOST_FN1_SLC1_WIFI_RX_NEW_PACKET_INT_ENA_S 23 -/* HOST_FN1_SLC1_EXT_BIT3_INT_ENA : R/W ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1_EXT_BIT3_INT_ENA (BIT(22)) -#define HOST_FN1_SLC1_EXT_BIT3_INT_ENA_M (BIT(22)) -#define HOST_FN1_SLC1_EXT_BIT3_INT_ENA_V 0x1 -#define HOST_FN1_SLC1_EXT_BIT3_INT_ENA_S 22 -/* HOST_FN1_SLC1_EXT_BIT2_INT_ENA : R/W ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1_EXT_BIT2_INT_ENA (BIT(21)) -#define HOST_FN1_SLC1_EXT_BIT2_INT_ENA_M (BIT(21)) -#define HOST_FN1_SLC1_EXT_BIT2_INT_ENA_V 0x1 -#define HOST_FN1_SLC1_EXT_BIT2_INT_ENA_S 21 -/* HOST_FN1_SLC1_EXT_BIT1_INT_ENA : R/W ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1_EXT_BIT1_INT_ENA (BIT(20)) -#define HOST_FN1_SLC1_EXT_BIT1_INT_ENA_M (BIT(20)) -#define HOST_FN1_SLC1_EXT_BIT1_INT_ENA_V 0x1 -#define HOST_FN1_SLC1_EXT_BIT1_INT_ENA_S 20 -/* HOST_FN1_SLC1_EXT_BIT0_INT_ENA : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1_EXT_BIT0_INT_ENA (BIT(19)) -#define HOST_FN1_SLC1_EXT_BIT0_INT_ENA_M (BIT(19)) -#define HOST_FN1_SLC1_EXT_BIT0_INT_ENA_V 0x1 -#define HOST_FN1_SLC1_EXT_BIT0_INT_ENA_S 19 -/* HOST_FN1_SLC1_RX_PF_VALID_INT_ENA : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1_RX_PF_VALID_INT_ENA (BIT(18)) -#define HOST_FN1_SLC1_RX_PF_VALID_INT_ENA_M (BIT(18)) -#define HOST_FN1_SLC1_RX_PF_VALID_INT_ENA_V 0x1 -#define HOST_FN1_SLC1_RX_PF_VALID_INT_ENA_S 18 -/* HOST_FN1_SLC1_TX_OVF_INT_ENA : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1_TX_OVF_INT_ENA (BIT(17)) -#define HOST_FN1_SLC1_TX_OVF_INT_ENA_M (BIT(17)) -#define HOST_FN1_SLC1_TX_OVF_INT_ENA_V 0x1 -#define HOST_FN1_SLC1_TX_OVF_INT_ENA_S 17 -/* HOST_FN1_SLC1_RX_UDF_INT_ENA : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1_RX_UDF_INT_ENA (BIT(16)) -#define HOST_FN1_SLC1_RX_UDF_INT_ENA_M (BIT(16)) -#define HOST_FN1_SLC1_RX_UDF_INT_ENA_V 0x1 -#define HOST_FN1_SLC1_RX_UDF_INT_ENA_S 16 -/* HOST_FN1_SLC1HOST_TX_START_INT_ENA : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1HOST_TX_START_INT_ENA (BIT(15)) -#define HOST_FN1_SLC1HOST_TX_START_INT_ENA_M (BIT(15)) -#define HOST_FN1_SLC1HOST_TX_START_INT_ENA_V 0x1 -#define HOST_FN1_SLC1HOST_TX_START_INT_ENA_S 15 -/* HOST_FN1_SLC1HOST_RX_START_INT_ENA : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1HOST_RX_START_INT_ENA (BIT(14)) -#define HOST_FN1_SLC1HOST_RX_START_INT_ENA_M (BIT(14)) -#define HOST_FN1_SLC1HOST_RX_START_INT_ENA_V 0x1 -#define HOST_FN1_SLC1HOST_RX_START_INT_ENA_S 14 -/* HOST_FN1_SLC1HOST_RX_EOF_INT_ENA : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1HOST_RX_EOF_INT_ENA (BIT(13)) -#define HOST_FN1_SLC1HOST_RX_EOF_INT_ENA_M (BIT(13)) -#define HOST_FN1_SLC1HOST_RX_EOF_INT_ENA_V 0x1 -#define HOST_FN1_SLC1HOST_RX_EOF_INT_ENA_S 13 -/* HOST_FN1_SLC1HOST_RX_SOF_INT_ENA : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1HOST_RX_SOF_INT_ENA (BIT(12)) -#define HOST_FN1_SLC1HOST_RX_SOF_INT_ENA_M (BIT(12)) -#define HOST_FN1_SLC1HOST_RX_SOF_INT_ENA_V 0x1 -#define HOST_FN1_SLC1HOST_RX_SOF_INT_ENA_S 12 -/* HOST_FN1_SLC1_TOKEN1_0TO1_INT_ENA : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1_TOKEN1_0TO1_INT_ENA (BIT(11)) -#define HOST_FN1_SLC1_TOKEN1_0TO1_INT_ENA_M (BIT(11)) -#define HOST_FN1_SLC1_TOKEN1_0TO1_INT_ENA_V 0x1 -#define HOST_FN1_SLC1_TOKEN1_0TO1_INT_ENA_S 11 -/* HOST_FN1_SLC1_TOKEN0_0TO1_INT_ENA : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1_TOKEN0_0TO1_INT_ENA (BIT(10)) -#define HOST_FN1_SLC1_TOKEN0_0TO1_INT_ENA_M (BIT(10)) -#define HOST_FN1_SLC1_TOKEN0_0TO1_INT_ENA_V 0x1 -#define HOST_FN1_SLC1_TOKEN0_0TO1_INT_ENA_S 10 -/* HOST_FN1_SLC1_TOKEN1_1TO0_INT_ENA : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1_TOKEN1_1TO0_INT_ENA (BIT(9)) -#define HOST_FN1_SLC1_TOKEN1_1TO0_INT_ENA_M (BIT(9)) -#define HOST_FN1_SLC1_TOKEN1_1TO0_INT_ENA_V 0x1 -#define HOST_FN1_SLC1_TOKEN1_1TO0_INT_ENA_S 9 -/* HOST_FN1_SLC1_TOKEN0_1TO0_INT_ENA : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1_TOKEN0_1TO0_INT_ENA (BIT(8)) -#define HOST_FN1_SLC1_TOKEN0_1TO0_INT_ENA_M (BIT(8)) -#define HOST_FN1_SLC1_TOKEN0_1TO0_INT_ENA_V 0x1 -#define HOST_FN1_SLC1_TOKEN0_1TO0_INT_ENA_S 8 -/* HOST_FN1_SLC1_TOHOST_BIT7_INT_ENA : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1_TOHOST_BIT7_INT_ENA (BIT(7)) -#define HOST_FN1_SLC1_TOHOST_BIT7_INT_ENA_M (BIT(7)) -#define HOST_FN1_SLC1_TOHOST_BIT7_INT_ENA_V 0x1 -#define HOST_FN1_SLC1_TOHOST_BIT7_INT_ENA_S 7 -/* HOST_FN1_SLC1_TOHOST_BIT6_INT_ENA : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1_TOHOST_BIT6_INT_ENA (BIT(6)) -#define HOST_FN1_SLC1_TOHOST_BIT6_INT_ENA_M (BIT(6)) -#define HOST_FN1_SLC1_TOHOST_BIT6_INT_ENA_V 0x1 -#define HOST_FN1_SLC1_TOHOST_BIT6_INT_ENA_S 6 -/* HOST_FN1_SLC1_TOHOST_BIT5_INT_ENA : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1_TOHOST_BIT5_INT_ENA (BIT(5)) -#define HOST_FN1_SLC1_TOHOST_BIT5_INT_ENA_M (BIT(5)) -#define HOST_FN1_SLC1_TOHOST_BIT5_INT_ENA_V 0x1 -#define HOST_FN1_SLC1_TOHOST_BIT5_INT_ENA_S 5 -/* HOST_FN1_SLC1_TOHOST_BIT4_INT_ENA : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1_TOHOST_BIT4_INT_ENA (BIT(4)) -#define HOST_FN1_SLC1_TOHOST_BIT4_INT_ENA_M (BIT(4)) -#define HOST_FN1_SLC1_TOHOST_BIT4_INT_ENA_V 0x1 -#define HOST_FN1_SLC1_TOHOST_BIT4_INT_ENA_S 4 -/* HOST_FN1_SLC1_TOHOST_BIT3_INT_ENA : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1_TOHOST_BIT3_INT_ENA (BIT(3)) -#define HOST_FN1_SLC1_TOHOST_BIT3_INT_ENA_M (BIT(3)) -#define HOST_FN1_SLC1_TOHOST_BIT3_INT_ENA_V 0x1 -#define HOST_FN1_SLC1_TOHOST_BIT3_INT_ENA_S 3 -/* HOST_FN1_SLC1_TOHOST_BIT2_INT_ENA : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1_TOHOST_BIT2_INT_ENA (BIT(2)) -#define HOST_FN1_SLC1_TOHOST_BIT2_INT_ENA_M (BIT(2)) -#define HOST_FN1_SLC1_TOHOST_BIT2_INT_ENA_V 0x1 -#define HOST_FN1_SLC1_TOHOST_BIT2_INT_ENA_S 2 -/* HOST_FN1_SLC1_TOHOST_BIT1_INT_ENA : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1_TOHOST_BIT1_INT_ENA (BIT(1)) -#define HOST_FN1_SLC1_TOHOST_BIT1_INT_ENA_M (BIT(1)) -#define HOST_FN1_SLC1_TOHOST_BIT1_INT_ENA_V 0x1 -#define HOST_FN1_SLC1_TOHOST_BIT1_INT_ENA_S 1 -/* HOST_FN1_SLC1_TOHOST_BIT0_INT_ENA : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN1_SLC1_TOHOST_BIT0_INT_ENA (BIT(0)) -#define HOST_FN1_SLC1_TOHOST_BIT0_INT_ENA_M (BIT(0)) -#define HOST_FN1_SLC1_TOHOST_BIT0_INT_ENA_V 0x1 -#define HOST_FN1_SLC1_TOHOST_BIT0_INT_ENA_S 0 - -#define HOST_SLC0HOST_FUNC2_INT_ENA_REG (DR_REG_SLCHOST_BASE + 0xE4) -/* HOST_FN2_GPIO_SDIO_INT_ENA : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_GPIO_SDIO_INT_ENA (BIT(25)) -#define HOST_FN2_GPIO_SDIO_INT_ENA_M (BIT(25)) -#define HOST_FN2_GPIO_SDIO_INT_ENA_V 0x1 -#define HOST_FN2_GPIO_SDIO_INT_ENA_S 25 -/* HOST_FN2_SLC0_HOST_RD_RETRY_INT_ENA : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC0_HOST_RD_RETRY_INT_ENA (BIT(24)) -#define HOST_FN2_SLC0_HOST_RD_RETRY_INT_ENA_M (BIT(24)) -#define HOST_FN2_SLC0_HOST_RD_RETRY_INT_ENA_V 0x1 -#define HOST_FN2_SLC0_HOST_RD_RETRY_INT_ENA_S 24 -/* HOST_FN2_SLC0_RX_NEW_PACKET_INT_ENA : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC0_RX_NEW_PACKET_INT_ENA (BIT(23)) -#define HOST_FN2_SLC0_RX_NEW_PACKET_INT_ENA_M (BIT(23)) -#define HOST_FN2_SLC0_RX_NEW_PACKET_INT_ENA_V 0x1 -#define HOST_FN2_SLC0_RX_NEW_PACKET_INT_ENA_S 23 -/* HOST_FN2_SLC0_EXT_BIT3_INT_ENA : R/W ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC0_EXT_BIT3_INT_ENA (BIT(22)) -#define HOST_FN2_SLC0_EXT_BIT3_INT_ENA_M (BIT(22)) -#define HOST_FN2_SLC0_EXT_BIT3_INT_ENA_V 0x1 -#define HOST_FN2_SLC0_EXT_BIT3_INT_ENA_S 22 -/* HOST_FN2_SLC0_EXT_BIT2_INT_ENA : R/W ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC0_EXT_BIT2_INT_ENA (BIT(21)) -#define HOST_FN2_SLC0_EXT_BIT2_INT_ENA_M (BIT(21)) -#define HOST_FN2_SLC0_EXT_BIT2_INT_ENA_V 0x1 -#define HOST_FN2_SLC0_EXT_BIT2_INT_ENA_S 21 -/* HOST_FN2_SLC0_EXT_BIT1_INT_ENA : R/W ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC0_EXT_BIT1_INT_ENA (BIT(20)) -#define HOST_FN2_SLC0_EXT_BIT1_INT_ENA_M (BIT(20)) -#define HOST_FN2_SLC0_EXT_BIT1_INT_ENA_V 0x1 -#define HOST_FN2_SLC0_EXT_BIT1_INT_ENA_S 20 -/* HOST_FN2_SLC0_EXT_BIT0_INT_ENA : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC0_EXT_BIT0_INT_ENA (BIT(19)) -#define HOST_FN2_SLC0_EXT_BIT0_INT_ENA_M (BIT(19)) -#define HOST_FN2_SLC0_EXT_BIT0_INT_ENA_V 0x1 -#define HOST_FN2_SLC0_EXT_BIT0_INT_ENA_S 19 -/* HOST_FN2_SLC0_RX_PF_VALID_INT_ENA : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC0_RX_PF_VALID_INT_ENA (BIT(18)) -#define HOST_FN2_SLC0_RX_PF_VALID_INT_ENA_M (BIT(18)) -#define HOST_FN2_SLC0_RX_PF_VALID_INT_ENA_V 0x1 -#define HOST_FN2_SLC0_RX_PF_VALID_INT_ENA_S 18 -/* HOST_FN2_SLC0_TX_OVF_INT_ENA : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC0_TX_OVF_INT_ENA (BIT(17)) -#define HOST_FN2_SLC0_TX_OVF_INT_ENA_M (BIT(17)) -#define HOST_FN2_SLC0_TX_OVF_INT_ENA_V 0x1 -#define HOST_FN2_SLC0_TX_OVF_INT_ENA_S 17 -/* HOST_FN2_SLC0_RX_UDF_INT_ENA : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC0_RX_UDF_INT_ENA (BIT(16)) -#define HOST_FN2_SLC0_RX_UDF_INT_ENA_M (BIT(16)) -#define HOST_FN2_SLC0_RX_UDF_INT_ENA_V 0x1 -#define HOST_FN2_SLC0_RX_UDF_INT_ENA_S 16 -/* HOST_FN2_SLC0HOST_TX_START_INT_ENA : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC0HOST_TX_START_INT_ENA (BIT(15)) -#define HOST_FN2_SLC0HOST_TX_START_INT_ENA_M (BIT(15)) -#define HOST_FN2_SLC0HOST_TX_START_INT_ENA_V 0x1 -#define HOST_FN2_SLC0HOST_TX_START_INT_ENA_S 15 -/* HOST_FN2_SLC0HOST_RX_START_INT_ENA : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC0HOST_RX_START_INT_ENA (BIT(14)) -#define HOST_FN2_SLC0HOST_RX_START_INT_ENA_M (BIT(14)) -#define HOST_FN2_SLC0HOST_RX_START_INT_ENA_V 0x1 -#define HOST_FN2_SLC0HOST_RX_START_INT_ENA_S 14 -/* HOST_FN2_SLC0HOST_RX_EOF_INT_ENA : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC0HOST_RX_EOF_INT_ENA (BIT(13)) -#define HOST_FN2_SLC0HOST_RX_EOF_INT_ENA_M (BIT(13)) -#define HOST_FN2_SLC0HOST_RX_EOF_INT_ENA_V 0x1 -#define HOST_FN2_SLC0HOST_RX_EOF_INT_ENA_S 13 -/* HOST_FN2_SLC0HOST_RX_SOF_INT_ENA : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC0HOST_RX_SOF_INT_ENA (BIT(12)) -#define HOST_FN2_SLC0HOST_RX_SOF_INT_ENA_M (BIT(12)) -#define HOST_FN2_SLC0HOST_RX_SOF_INT_ENA_V 0x1 -#define HOST_FN2_SLC0HOST_RX_SOF_INT_ENA_S 12 -/* HOST_FN2_SLC0_TOKEN1_0TO1_INT_ENA : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC0_TOKEN1_0TO1_INT_ENA (BIT(11)) -#define HOST_FN2_SLC0_TOKEN1_0TO1_INT_ENA_M (BIT(11)) -#define HOST_FN2_SLC0_TOKEN1_0TO1_INT_ENA_V 0x1 -#define HOST_FN2_SLC0_TOKEN1_0TO1_INT_ENA_S 11 -/* HOST_FN2_SLC0_TOKEN0_0TO1_INT_ENA : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC0_TOKEN0_0TO1_INT_ENA (BIT(10)) -#define HOST_FN2_SLC0_TOKEN0_0TO1_INT_ENA_M (BIT(10)) -#define HOST_FN2_SLC0_TOKEN0_0TO1_INT_ENA_V 0x1 -#define HOST_FN2_SLC0_TOKEN0_0TO1_INT_ENA_S 10 -/* HOST_FN2_SLC0_TOKEN1_1TO0_INT_ENA : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC0_TOKEN1_1TO0_INT_ENA (BIT(9)) -#define HOST_FN2_SLC0_TOKEN1_1TO0_INT_ENA_M (BIT(9)) -#define HOST_FN2_SLC0_TOKEN1_1TO0_INT_ENA_V 0x1 -#define HOST_FN2_SLC0_TOKEN1_1TO0_INT_ENA_S 9 -/* HOST_FN2_SLC0_TOKEN0_1TO0_INT_ENA : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC0_TOKEN0_1TO0_INT_ENA (BIT(8)) -#define HOST_FN2_SLC0_TOKEN0_1TO0_INT_ENA_M (BIT(8)) -#define HOST_FN2_SLC0_TOKEN0_1TO0_INT_ENA_V 0x1 -#define HOST_FN2_SLC0_TOKEN0_1TO0_INT_ENA_S 8 -/* HOST_FN2_SLC0_TOHOST_BIT7_INT_ENA : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC0_TOHOST_BIT7_INT_ENA (BIT(7)) -#define HOST_FN2_SLC0_TOHOST_BIT7_INT_ENA_M (BIT(7)) -#define HOST_FN2_SLC0_TOHOST_BIT7_INT_ENA_V 0x1 -#define HOST_FN2_SLC0_TOHOST_BIT7_INT_ENA_S 7 -/* HOST_FN2_SLC0_TOHOST_BIT6_INT_ENA : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC0_TOHOST_BIT6_INT_ENA (BIT(6)) -#define HOST_FN2_SLC0_TOHOST_BIT6_INT_ENA_M (BIT(6)) -#define HOST_FN2_SLC0_TOHOST_BIT6_INT_ENA_V 0x1 -#define HOST_FN2_SLC0_TOHOST_BIT6_INT_ENA_S 6 -/* HOST_FN2_SLC0_TOHOST_BIT5_INT_ENA : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC0_TOHOST_BIT5_INT_ENA (BIT(5)) -#define HOST_FN2_SLC0_TOHOST_BIT5_INT_ENA_M (BIT(5)) -#define HOST_FN2_SLC0_TOHOST_BIT5_INT_ENA_V 0x1 -#define HOST_FN2_SLC0_TOHOST_BIT5_INT_ENA_S 5 -/* HOST_FN2_SLC0_TOHOST_BIT4_INT_ENA : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC0_TOHOST_BIT4_INT_ENA (BIT(4)) -#define HOST_FN2_SLC0_TOHOST_BIT4_INT_ENA_M (BIT(4)) -#define HOST_FN2_SLC0_TOHOST_BIT4_INT_ENA_V 0x1 -#define HOST_FN2_SLC0_TOHOST_BIT4_INT_ENA_S 4 -/* HOST_FN2_SLC0_TOHOST_BIT3_INT_ENA : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC0_TOHOST_BIT3_INT_ENA (BIT(3)) -#define HOST_FN2_SLC0_TOHOST_BIT3_INT_ENA_M (BIT(3)) -#define HOST_FN2_SLC0_TOHOST_BIT3_INT_ENA_V 0x1 -#define HOST_FN2_SLC0_TOHOST_BIT3_INT_ENA_S 3 -/* HOST_FN2_SLC0_TOHOST_BIT2_INT_ENA : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC0_TOHOST_BIT2_INT_ENA (BIT(2)) -#define HOST_FN2_SLC0_TOHOST_BIT2_INT_ENA_M (BIT(2)) -#define HOST_FN2_SLC0_TOHOST_BIT2_INT_ENA_V 0x1 -#define HOST_FN2_SLC0_TOHOST_BIT2_INT_ENA_S 2 -/* HOST_FN2_SLC0_TOHOST_BIT1_INT_ENA : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC0_TOHOST_BIT1_INT_ENA (BIT(1)) -#define HOST_FN2_SLC0_TOHOST_BIT1_INT_ENA_M (BIT(1)) -#define HOST_FN2_SLC0_TOHOST_BIT1_INT_ENA_V 0x1 -#define HOST_FN2_SLC0_TOHOST_BIT1_INT_ENA_S 1 -/* HOST_FN2_SLC0_TOHOST_BIT0_INT_ENA : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC0_TOHOST_BIT0_INT_ENA (BIT(0)) -#define HOST_FN2_SLC0_TOHOST_BIT0_INT_ENA_M (BIT(0)) -#define HOST_FN2_SLC0_TOHOST_BIT0_INT_ENA_V 0x1 -#define HOST_FN2_SLC0_TOHOST_BIT0_INT_ENA_S 0 - -#define HOST_SLC1HOST_FUNC2_INT_ENA_REG (DR_REG_SLCHOST_BASE + 0xE8) -/* HOST_FN2_SLC1_BT_RX_NEW_PACKET_INT_ENA : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1_BT_RX_NEW_PACKET_INT_ENA (BIT(25)) -#define HOST_FN2_SLC1_BT_RX_NEW_PACKET_INT_ENA_M (BIT(25)) -#define HOST_FN2_SLC1_BT_RX_NEW_PACKET_INT_ENA_V 0x1 -#define HOST_FN2_SLC1_BT_RX_NEW_PACKET_INT_ENA_S 25 -/* HOST_FN2_SLC1_HOST_RD_RETRY_INT_ENA : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1_HOST_RD_RETRY_INT_ENA (BIT(24)) -#define HOST_FN2_SLC1_HOST_RD_RETRY_INT_ENA_M (BIT(24)) -#define HOST_FN2_SLC1_HOST_RD_RETRY_INT_ENA_V 0x1 -#define HOST_FN2_SLC1_HOST_RD_RETRY_INT_ENA_S 24 -/* HOST_FN2_SLC1_WIFI_RX_NEW_PACKET_INT_ENA : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1_WIFI_RX_NEW_PACKET_INT_ENA (BIT(23)) -#define HOST_FN2_SLC1_WIFI_RX_NEW_PACKET_INT_ENA_M (BIT(23)) -#define HOST_FN2_SLC1_WIFI_RX_NEW_PACKET_INT_ENA_V 0x1 -#define HOST_FN2_SLC1_WIFI_RX_NEW_PACKET_INT_ENA_S 23 -/* HOST_FN2_SLC1_EXT_BIT3_INT_ENA : R/W ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1_EXT_BIT3_INT_ENA (BIT(22)) -#define HOST_FN2_SLC1_EXT_BIT3_INT_ENA_M (BIT(22)) -#define HOST_FN2_SLC1_EXT_BIT3_INT_ENA_V 0x1 -#define HOST_FN2_SLC1_EXT_BIT3_INT_ENA_S 22 -/* HOST_FN2_SLC1_EXT_BIT2_INT_ENA : R/W ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1_EXT_BIT2_INT_ENA (BIT(21)) -#define HOST_FN2_SLC1_EXT_BIT2_INT_ENA_M (BIT(21)) -#define HOST_FN2_SLC1_EXT_BIT2_INT_ENA_V 0x1 -#define HOST_FN2_SLC1_EXT_BIT2_INT_ENA_S 21 -/* HOST_FN2_SLC1_EXT_BIT1_INT_ENA : R/W ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1_EXT_BIT1_INT_ENA (BIT(20)) -#define HOST_FN2_SLC1_EXT_BIT1_INT_ENA_M (BIT(20)) -#define HOST_FN2_SLC1_EXT_BIT1_INT_ENA_V 0x1 -#define HOST_FN2_SLC1_EXT_BIT1_INT_ENA_S 20 -/* HOST_FN2_SLC1_EXT_BIT0_INT_ENA : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1_EXT_BIT0_INT_ENA (BIT(19)) -#define HOST_FN2_SLC1_EXT_BIT0_INT_ENA_M (BIT(19)) -#define HOST_FN2_SLC1_EXT_BIT0_INT_ENA_V 0x1 -#define HOST_FN2_SLC1_EXT_BIT0_INT_ENA_S 19 -/* HOST_FN2_SLC1_RX_PF_VALID_INT_ENA : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1_RX_PF_VALID_INT_ENA (BIT(18)) -#define HOST_FN2_SLC1_RX_PF_VALID_INT_ENA_M (BIT(18)) -#define HOST_FN2_SLC1_RX_PF_VALID_INT_ENA_V 0x1 -#define HOST_FN2_SLC1_RX_PF_VALID_INT_ENA_S 18 -/* HOST_FN2_SLC1_TX_OVF_INT_ENA : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1_TX_OVF_INT_ENA (BIT(17)) -#define HOST_FN2_SLC1_TX_OVF_INT_ENA_M (BIT(17)) -#define HOST_FN2_SLC1_TX_OVF_INT_ENA_V 0x1 -#define HOST_FN2_SLC1_TX_OVF_INT_ENA_S 17 -/* HOST_FN2_SLC1_RX_UDF_INT_ENA : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1_RX_UDF_INT_ENA (BIT(16)) -#define HOST_FN2_SLC1_RX_UDF_INT_ENA_M (BIT(16)) -#define HOST_FN2_SLC1_RX_UDF_INT_ENA_V 0x1 -#define HOST_FN2_SLC1_RX_UDF_INT_ENA_S 16 -/* HOST_FN2_SLC1HOST_TX_START_INT_ENA : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1HOST_TX_START_INT_ENA (BIT(15)) -#define HOST_FN2_SLC1HOST_TX_START_INT_ENA_M (BIT(15)) -#define HOST_FN2_SLC1HOST_TX_START_INT_ENA_V 0x1 -#define HOST_FN2_SLC1HOST_TX_START_INT_ENA_S 15 -/* HOST_FN2_SLC1HOST_RX_START_INT_ENA : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1HOST_RX_START_INT_ENA (BIT(14)) -#define HOST_FN2_SLC1HOST_RX_START_INT_ENA_M (BIT(14)) -#define HOST_FN2_SLC1HOST_RX_START_INT_ENA_V 0x1 -#define HOST_FN2_SLC1HOST_RX_START_INT_ENA_S 14 -/* HOST_FN2_SLC1HOST_RX_EOF_INT_ENA : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1HOST_RX_EOF_INT_ENA (BIT(13)) -#define HOST_FN2_SLC1HOST_RX_EOF_INT_ENA_M (BIT(13)) -#define HOST_FN2_SLC1HOST_RX_EOF_INT_ENA_V 0x1 -#define HOST_FN2_SLC1HOST_RX_EOF_INT_ENA_S 13 -/* HOST_FN2_SLC1HOST_RX_SOF_INT_ENA : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1HOST_RX_SOF_INT_ENA (BIT(12)) -#define HOST_FN2_SLC1HOST_RX_SOF_INT_ENA_M (BIT(12)) -#define HOST_FN2_SLC1HOST_RX_SOF_INT_ENA_V 0x1 -#define HOST_FN2_SLC1HOST_RX_SOF_INT_ENA_S 12 -/* HOST_FN2_SLC1_TOKEN1_0TO1_INT_ENA : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1_TOKEN1_0TO1_INT_ENA (BIT(11)) -#define HOST_FN2_SLC1_TOKEN1_0TO1_INT_ENA_M (BIT(11)) -#define HOST_FN2_SLC1_TOKEN1_0TO1_INT_ENA_V 0x1 -#define HOST_FN2_SLC1_TOKEN1_0TO1_INT_ENA_S 11 -/* HOST_FN2_SLC1_TOKEN0_0TO1_INT_ENA : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1_TOKEN0_0TO1_INT_ENA (BIT(10)) -#define HOST_FN2_SLC1_TOKEN0_0TO1_INT_ENA_M (BIT(10)) -#define HOST_FN2_SLC1_TOKEN0_0TO1_INT_ENA_V 0x1 -#define HOST_FN2_SLC1_TOKEN0_0TO1_INT_ENA_S 10 -/* HOST_FN2_SLC1_TOKEN1_1TO0_INT_ENA : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1_TOKEN1_1TO0_INT_ENA (BIT(9)) -#define HOST_FN2_SLC1_TOKEN1_1TO0_INT_ENA_M (BIT(9)) -#define HOST_FN2_SLC1_TOKEN1_1TO0_INT_ENA_V 0x1 -#define HOST_FN2_SLC1_TOKEN1_1TO0_INT_ENA_S 9 -/* HOST_FN2_SLC1_TOKEN0_1TO0_INT_ENA : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1_TOKEN0_1TO0_INT_ENA (BIT(8)) -#define HOST_FN2_SLC1_TOKEN0_1TO0_INT_ENA_M (BIT(8)) -#define HOST_FN2_SLC1_TOKEN0_1TO0_INT_ENA_V 0x1 -#define HOST_FN2_SLC1_TOKEN0_1TO0_INT_ENA_S 8 -/* HOST_FN2_SLC1_TOHOST_BIT7_INT_ENA : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1_TOHOST_BIT7_INT_ENA (BIT(7)) -#define HOST_FN2_SLC1_TOHOST_BIT7_INT_ENA_M (BIT(7)) -#define HOST_FN2_SLC1_TOHOST_BIT7_INT_ENA_V 0x1 -#define HOST_FN2_SLC1_TOHOST_BIT7_INT_ENA_S 7 -/* HOST_FN2_SLC1_TOHOST_BIT6_INT_ENA : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1_TOHOST_BIT6_INT_ENA (BIT(6)) -#define HOST_FN2_SLC1_TOHOST_BIT6_INT_ENA_M (BIT(6)) -#define HOST_FN2_SLC1_TOHOST_BIT6_INT_ENA_V 0x1 -#define HOST_FN2_SLC1_TOHOST_BIT6_INT_ENA_S 6 -/* HOST_FN2_SLC1_TOHOST_BIT5_INT_ENA : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1_TOHOST_BIT5_INT_ENA (BIT(5)) -#define HOST_FN2_SLC1_TOHOST_BIT5_INT_ENA_M (BIT(5)) -#define HOST_FN2_SLC1_TOHOST_BIT5_INT_ENA_V 0x1 -#define HOST_FN2_SLC1_TOHOST_BIT5_INT_ENA_S 5 -/* HOST_FN2_SLC1_TOHOST_BIT4_INT_ENA : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1_TOHOST_BIT4_INT_ENA (BIT(4)) -#define HOST_FN2_SLC1_TOHOST_BIT4_INT_ENA_M (BIT(4)) -#define HOST_FN2_SLC1_TOHOST_BIT4_INT_ENA_V 0x1 -#define HOST_FN2_SLC1_TOHOST_BIT4_INT_ENA_S 4 -/* HOST_FN2_SLC1_TOHOST_BIT3_INT_ENA : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1_TOHOST_BIT3_INT_ENA (BIT(3)) -#define HOST_FN2_SLC1_TOHOST_BIT3_INT_ENA_M (BIT(3)) -#define HOST_FN2_SLC1_TOHOST_BIT3_INT_ENA_V 0x1 -#define HOST_FN2_SLC1_TOHOST_BIT3_INT_ENA_S 3 -/* HOST_FN2_SLC1_TOHOST_BIT2_INT_ENA : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1_TOHOST_BIT2_INT_ENA (BIT(2)) -#define HOST_FN2_SLC1_TOHOST_BIT2_INT_ENA_M (BIT(2)) -#define HOST_FN2_SLC1_TOHOST_BIT2_INT_ENA_V 0x1 -#define HOST_FN2_SLC1_TOHOST_BIT2_INT_ENA_S 2 -/* HOST_FN2_SLC1_TOHOST_BIT1_INT_ENA : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1_TOHOST_BIT1_INT_ENA (BIT(1)) -#define HOST_FN2_SLC1_TOHOST_BIT1_INT_ENA_M (BIT(1)) -#define HOST_FN2_SLC1_TOHOST_BIT1_INT_ENA_V 0x1 -#define HOST_FN2_SLC1_TOHOST_BIT1_INT_ENA_S 1 -/* HOST_FN2_SLC1_TOHOST_BIT0_INT_ENA : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define HOST_FN2_SLC1_TOHOST_BIT0_INT_ENA (BIT(0)) -#define HOST_FN2_SLC1_TOHOST_BIT0_INT_ENA_M (BIT(0)) -#define HOST_FN2_SLC1_TOHOST_BIT0_INT_ENA_V 0x1 -#define HOST_FN2_SLC1_TOHOST_BIT0_INT_ENA_S 0 - -#define HOST_SLC0HOST_INT_ENA_REG (DR_REG_SLCHOST_BASE + 0xEC) -/* HOST_GPIO_SDIO_INT_ENA : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: */ -#define HOST_GPIO_SDIO_INT_ENA (BIT(25)) -#define HOST_GPIO_SDIO_INT_ENA_M (BIT(25)) -#define HOST_GPIO_SDIO_INT_ENA_V 0x1 -#define HOST_GPIO_SDIO_INT_ENA_S 25 -/* HOST_SLC0_HOST_RD_RETRY_INT_ENA : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_HOST_RD_RETRY_INT_ENA (BIT(24)) -#define HOST_SLC0_HOST_RD_RETRY_INT_ENA_M (BIT(24)) -#define HOST_SLC0_HOST_RD_RETRY_INT_ENA_V 0x1 -#define HOST_SLC0_HOST_RD_RETRY_INT_ENA_S 24 -/* HOST_SLC0_RX_NEW_PACKET_INT_ENA : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_RX_NEW_PACKET_INT_ENA (BIT(23)) -#define HOST_SLC0_RX_NEW_PACKET_INT_ENA_M (BIT(23)) -#define HOST_SLC0_RX_NEW_PACKET_INT_ENA_V 0x1 -#define HOST_SLC0_RX_NEW_PACKET_INT_ENA_S 23 -/* HOST_SLC0_EXT_BIT3_INT_ENA : R/W ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_EXT_BIT3_INT_ENA (BIT(22)) -#define HOST_SLC0_EXT_BIT3_INT_ENA_M (BIT(22)) -#define HOST_SLC0_EXT_BIT3_INT_ENA_V 0x1 -#define HOST_SLC0_EXT_BIT3_INT_ENA_S 22 -/* HOST_SLC0_EXT_BIT2_INT_ENA : R/W ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_EXT_BIT2_INT_ENA (BIT(21)) -#define HOST_SLC0_EXT_BIT2_INT_ENA_M (BIT(21)) -#define HOST_SLC0_EXT_BIT2_INT_ENA_V 0x1 -#define HOST_SLC0_EXT_BIT2_INT_ENA_S 21 -/* HOST_SLC0_EXT_BIT1_INT_ENA : R/W ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_EXT_BIT1_INT_ENA (BIT(20)) -#define HOST_SLC0_EXT_BIT1_INT_ENA_M (BIT(20)) -#define HOST_SLC0_EXT_BIT1_INT_ENA_V 0x1 -#define HOST_SLC0_EXT_BIT1_INT_ENA_S 20 -/* HOST_SLC0_EXT_BIT0_INT_ENA : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_EXT_BIT0_INT_ENA (BIT(19)) -#define HOST_SLC0_EXT_BIT0_INT_ENA_M (BIT(19)) -#define HOST_SLC0_EXT_BIT0_INT_ENA_V 0x1 -#define HOST_SLC0_EXT_BIT0_INT_ENA_S 19 -/* HOST_SLC0_RX_PF_VALID_INT_ENA : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_RX_PF_VALID_INT_ENA (BIT(18)) -#define HOST_SLC0_RX_PF_VALID_INT_ENA_M (BIT(18)) -#define HOST_SLC0_RX_PF_VALID_INT_ENA_V 0x1 -#define HOST_SLC0_RX_PF_VALID_INT_ENA_S 18 -/* HOST_SLC0_TX_OVF_INT_ENA : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TX_OVF_INT_ENA (BIT(17)) -#define HOST_SLC0_TX_OVF_INT_ENA_M (BIT(17)) -#define HOST_SLC0_TX_OVF_INT_ENA_V 0x1 -#define HOST_SLC0_TX_OVF_INT_ENA_S 17 -/* HOST_SLC0_RX_UDF_INT_ENA : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_RX_UDF_INT_ENA (BIT(16)) -#define HOST_SLC0_RX_UDF_INT_ENA_M (BIT(16)) -#define HOST_SLC0_RX_UDF_INT_ENA_V 0x1 -#define HOST_SLC0_RX_UDF_INT_ENA_S 16 -/* HOST_SLC0HOST_TX_START_INT_ENA : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_TX_START_INT_ENA (BIT(15)) -#define HOST_SLC0HOST_TX_START_INT_ENA_M (BIT(15)) -#define HOST_SLC0HOST_TX_START_INT_ENA_V 0x1 -#define HOST_SLC0HOST_TX_START_INT_ENA_S 15 -/* HOST_SLC0HOST_RX_START_INT_ENA : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_RX_START_INT_ENA (BIT(14)) -#define HOST_SLC0HOST_RX_START_INT_ENA_M (BIT(14)) -#define HOST_SLC0HOST_RX_START_INT_ENA_V 0x1 -#define HOST_SLC0HOST_RX_START_INT_ENA_S 14 -/* HOST_SLC0HOST_RX_EOF_INT_ENA : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_RX_EOF_INT_ENA (BIT(13)) -#define HOST_SLC0HOST_RX_EOF_INT_ENA_M (BIT(13)) -#define HOST_SLC0HOST_RX_EOF_INT_ENA_V 0x1 -#define HOST_SLC0HOST_RX_EOF_INT_ENA_S 13 -/* HOST_SLC0HOST_RX_SOF_INT_ENA : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_RX_SOF_INT_ENA (BIT(12)) -#define HOST_SLC0HOST_RX_SOF_INT_ENA_M (BIT(12)) -#define HOST_SLC0HOST_RX_SOF_INT_ENA_V 0x1 -#define HOST_SLC0HOST_RX_SOF_INT_ENA_S 12 -/* HOST_SLC0_TOKEN1_0TO1_INT_ENA : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOKEN1_0TO1_INT_ENA (BIT(11)) -#define HOST_SLC0_TOKEN1_0TO1_INT_ENA_M (BIT(11)) -#define HOST_SLC0_TOKEN1_0TO1_INT_ENA_V 0x1 -#define HOST_SLC0_TOKEN1_0TO1_INT_ENA_S 11 -/* HOST_SLC0_TOKEN0_0TO1_INT_ENA : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOKEN0_0TO1_INT_ENA (BIT(10)) -#define HOST_SLC0_TOKEN0_0TO1_INT_ENA_M (BIT(10)) -#define HOST_SLC0_TOKEN0_0TO1_INT_ENA_V 0x1 -#define HOST_SLC0_TOKEN0_0TO1_INT_ENA_S 10 -/* HOST_SLC0_TOKEN1_1TO0_INT_ENA : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOKEN1_1TO0_INT_ENA (BIT(9)) -#define HOST_SLC0_TOKEN1_1TO0_INT_ENA_M (BIT(9)) -#define HOST_SLC0_TOKEN1_1TO0_INT_ENA_V 0x1 -#define HOST_SLC0_TOKEN1_1TO0_INT_ENA_S 9 -/* HOST_SLC0_TOKEN0_1TO0_INT_ENA : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOKEN0_1TO0_INT_ENA (BIT(8)) -#define HOST_SLC0_TOKEN0_1TO0_INT_ENA_M (BIT(8)) -#define HOST_SLC0_TOKEN0_1TO0_INT_ENA_V 0x1 -#define HOST_SLC0_TOKEN0_1TO0_INT_ENA_S 8 -/* HOST_SLC0_TOHOST_BIT7_INT_ENA : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT7_INT_ENA (BIT(7)) -#define HOST_SLC0_TOHOST_BIT7_INT_ENA_M (BIT(7)) -#define HOST_SLC0_TOHOST_BIT7_INT_ENA_V 0x1 -#define HOST_SLC0_TOHOST_BIT7_INT_ENA_S 7 -/* HOST_SLC0_TOHOST_BIT6_INT_ENA : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT6_INT_ENA (BIT(6)) -#define HOST_SLC0_TOHOST_BIT6_INT_ENA_M (BIT(6)) -#define HOST_SLC0_TOHOST_BIT6_INT_ENA_V 0x1 -#define HOST_SLC0_TOHOST_BIT6_INT_ENA_S 6 -/* HOST_SLC0_TOHOST_BIT5_INT_ENA : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT5_INT_ENA (BIT(5)) -#define HOST_SLC0_TOHOST_BIT5_INT_ENA_M (BIT(5)) -#define HOST_SLC0_TOHOST_BIT5_INT_ENA_V 0x1 -#define HOST_SLC0_TOHOST_BIT5_INT_ENA_S 5 -/* HOST_SLC0_TOHOST_BIT4_INT_ENA : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT4_INT_ENA (BIT(4)) -#define HOST_SLC0_TOHOST_BIT4_INT_ENA_M (BIT(4)) -#define HOST_SLC0_TOHOST_BIT4_INT_ENA_V 0x1 -#define HOST_SLC0_TOHOST_BIT4_INT_ENA_S 4 -/* HOST_SLC0_TOHOST_BIT3_INT_ENA : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT3_INT_ENA (BIT(3)) -#define HOST_SLC0_TOHOST_BIT3_INT_ENA_M (BIT(3)) -#define HOST_SLC0_TOHOST_BIT3_INT_ENA_V 0x1 -#define HOST_SLC0_TOHOST_BIT3_INT_ENA_S 3 -/* HOST_SLC0_TOHOST_BIT2_INT_ENA : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT2_INT_ENA (BIT(2)) -#define HOST_SLC0_TOHOST_BIT2_INT_ENA_M (BIT(2)) -#define HOST_SLC0_TOHOST_BIT2_INT_ENA_V 0x1 -#define HOST_SLC0_TOHOST_BIT2_INT_ENA_S 2 -/* HOST_SLC0_TOHOST_BIT1_INT_ENA : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT1_INT_ENA (BIT(1)) -#define HOST_SLC0_TOHOST_BIT1_INT_ENA_M (BIT(1)) -#define HOST_SLC0_TOHOST_BIT1_INT_ENA_V 0x1 -#define HOST_SLC0_TOHOST_BIT1_INT_ENA_S 1 -/* HOST_SLC0_TOHOST_BIT0_INT_ENA : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT0_INT_ENA (BIT(0)) -#define HOST_SLC0_TOHOST_BIT0_INT_ENA_M (BIT(0)) -#define HOST_SLC0_TOHOST_BIT0_INT_ENA_V 0x1 -#define HOST_SLC0_TOHOST_BIT0_INT_ENA_S 0 - -#define HOST_SLC1HOST_INT_ENA_REG (DR_REG_SLCHOST_BASE + 0xF0) -/* HOST_SLC1_BT_RX_NEW_PACKET_INT_ENA : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_BT_RX_NEW_PACKET_INT_ENA (BIT(25)) -#define HOST_SLC1_BT_RX_NEW_PACKET_INT_ENA_M (BIT(25)) -#define HOST_SLC1_BT_RX_NEW_PACKET_INT_ENA_V 0x1 -#define HOST_SLC1_BT_RX_NEW_PACKET_INT_ENA_S 25 -/* HOST_SLC1_HOST_RD_RETRY_INT_ENA : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_HOST_RD_RETRY_INT_ENA (BIT(24)) -#define HOST_SLC1_HOST_RD_RETRY_INT_ENA_M (BIT(24)) -#define HOST_SLC1_HOST_RD_RETRY_INT_ENA_V 0x1 -#define HOST_SLC1_HOST_RD_RETRY_INT_ENA_S 24 -/* HOST_SLC1_WIFI_RX_NEW_PACKET_INT_ENA : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_WIFI_RX_NEW_PACKET_INT_ENA (BIT(23)) -#define HOST_SLC1_WIFI_RX_NEW_PACKET_INT_ENA_M (BIT(23)) -#define HOST_SLC1_WIFI_RX_NEW_PACKET_INT_ENA_V 0x1 -#define HOST_SLC1_WIFI_RX_NEW_PACKET_INT_ENA_S 23 -/* HOST_SLC1_EXT_BIT3_INT_ENA : R/W ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_EXT_BIT3_INT_ENA (BIT(22)) -#define HOST_SLC1_EXT_BIT3_INT_ENA_M (BIT(22)) -#define HOST_SLC1_EXT_BIT3_INT_ENA_V 0x1 -#define HOST_SLC1_EXT_BIT3_INT_ENA_S 22 -/* HOST_SLC1_EXT_BIT2_INT_ENA : R/W ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_EXT_BIT2_INT_ENA (BIT(21)) -#define HOST_SLC1_EXT_BIT2_INT_ENA_M (BIT(21)) -#define HOST_SLC1_EXT_BIT2_INT_ENA_V 0x1 -#define HOST_SLC1_EXT_BIT2_INT_ENA_S 21 -/* HOST_SLC1_EXT_BIT1_INT_ENA : R/W ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_EXT_BIT1_INT_ENA (BIT(20)) -#define HOST_SLC1_EXT_BIT1_INT_ENA_M (BIT(20)) -#define HOST_SLC1_EXT_BIT1_INT_ENA_V 0x1 -#define HOST_SLC1_EXT_BIT1_INT_ENA_S 20 -/* HOST_SLC1_EXT_BIT0_INT_ENA : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_EXT_BIT0_INT_ENA (BIT(19)) -#define HOST_SLC1_EXT_BIT0_INT_ENA_M (BIT(19)) -#define HOST_SLC1_EXT_BIT0_INT_ENA_V 0x1 -#define HOST_SLC1_EXT_BIT0_INT_ENA_S 19 -/* HOST_SLC1_RX_PF_VALID_INT_ENA : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_RX_PF_VALID_INT_ENA (BIT(18)) -#define HOST_SLC1_RX_PF_VALID_INT_ENA_M (BIT(18)) -#define HOST_SLC1_RX_PF_VALID_INT_ENA_V 0x1 -#define HOST_SLC1_RX_PF_VALID_INT_ENA_S 18 -/* HOST_SLC1_TX_OVF_INT_ENA : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TX_OVF_INT_ENA (BIT(17)) -#define HOST_SLC1_TX_OVF_INT_ENA_M (BIT(17)) -#define HOST_SLC1_TX_OVF_INT_ENA_V 0x1 -#define HOST_SLC1_TX_OVF_INT_ENA_S 17 -/* HOST_SLC1_RX_UDF_INT_ENA : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_RX_UDF_INT_ENA (BIT(16)) -#define HOST_SLC1_RX_UDF_INT_ENA_M (BIT(16)) -#define HOST_SLC1_RX_UDF_INT_ENA_V 0x1 -#define HOST_SLC1_RX_UDF_INT_ENA_S 16 -/* HOST_SLC1HOST_TX_START_INT_ENA : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1HOST_TX_START_INT_ENA (BIT(15)) -#define HOST_SLC1HOST_TX_START_INT_ENA_M (BIT(15)) -#define HOST_SLC1HOST_TX_START_INT_ENA_V 0x1 -#define HOST_SLC1HOST_TX_START_INT_ENA_S 15 -/* HOST_SLC1HOST_RX_START_INT_ENA : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1HOST_RX_START_INT_ENA (BIT(14)) -#define HOST_SLC1HOST_RX_START_INT_ENA_M (BIT(14)) -#define HOST_SLC1HOST_RX_START_INT_ENA_V 0x1 -#define HOST_SLC1HOST_RX_START_INT_ENA_S 14 -/* HOST_SLC1HOST_RX_EOF_INT_ENA : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1HOST_RX_EOF_INT_ENA (BIT(13)) -#define HOST_SLC1HOST_RX_EOF_INT_ENA_M (BIT(13)) -#define HOST_SLC1HOST_RX_EOF_INT_ENA_V 0x1 -#define HOST_SLC1HOST_RX_EOF_INT_ENA_S 13 -/* HOST_SLC1HOST_RX_SOF_INT_ENA : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1HOST_RX_SOF_INT_ENA (BIT(12)) -#define HOST_SLC1HOST_RX_SOF_INT_ENA_M (BIT(12)) -#define HOST_SLC1HOST_RX_SOF_INT_ENA_V 0x1 -#define HOST_SLC1HOST_RX_SOF_INT_ENA_S 12 -/* HOST_SLC1_TOKEN1_0TO1_INT_ENA : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOKEN1_0TO1_INT_ENA (BIT(11)) -#define HOST_SLC1_TOKEN1_0TO1_INT_ENA_M (BIT(11)) -#define HOST_SLC1_TOKEN1_0TO1_INT_ENA_V 0x1 -#define HOST_SLC1_TOKEN1_0TO1_INT_ENA_S 11 -/* HOST_SLC1_TOKEN0_0TO1_INT_ENA : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOKEN0_0TO1_INT_ENA (BIT(10)) -#define HOST_SLC1_TOKEN0_0TO1_INT_ENA_M (BIT(10)) -#define HOST_SLC1_TOKEN0_0TO1_INT_ENA_V 0x1 -#define HOST_SLC1_TOKEN0_0TO1_INT_ENA_S 10 -/* HOST_SLC1_TOKEN1_1TO0_INT_ENA : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOKEN1_1TO0_INT_ENA (BIT(9)) -#define HOST_SLC1_TOKEN1_1TO0_INT_ENA_M (BIT(9)) -#define HOST_SLC1_TOKEN1_1TO0_INT_ENA_V 0x1 -#define HOST_SLC1_TOKEN1_1TO0_INT_ENA_S 9 -/* HOST_SLC1_TOKEN0_1TO0_INT_ENA : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOKEN0_1TO0_INT_ENA (BIT(8)) -#define HOST_SLC1_TOKEN0_1TO0_INT_ENA_M (BIT(8)) -#define HOST_SLC1_TOKEN0_1TO0_INT_ENA_V 0x1 -#define HOST_SLC1_TOKEN0_1TO0_INT_ENA_S 8 -/* HOST_SLC1_TOHOST_BIT7_INT_ENA : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT7_INT_ENA (BIT(7)) -#define HOST_SLC1_TOHOST_BIT7_INT_ENA_M (BIT(7)) -#define HOST_SLC1_TOHOST_BIT7_INT_ENA_V 0x1 -#define HOST_SLC1_TOHOST_BIT7_INT_ENA_S 7 -/* HOST_SLC1_TOHOST_BIT6_INT_ENA : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT6_INT_ENA (BIT(6)) -#define HOST_SLC1_TOHOST_BIT6_INT_ENA_M (BIT(6)) -#define HOST_SLC1_TOHOST_BIT6_INT_ENA_V 0x1 -#define HOST_SLC1_TOHOST_BIT6_INT_ENA_S 6 -/* HOST_SLC1_TOHOST_BIT5_INT_ENA : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT5_INT_ENA (BIT(5)) -#define HOST_SLC1_TOHOST_BIT5_INT_ENA_M (BIT(5)) -#define HOST_SLC1_TOHOST_BIT5_INT_ENA_V 0x1 -#define HOST_SLC1_TOHOST_BIT5_INT_ENA_S 5 -/* HOST_SLC1_TOHOST_BIT4_INT_ENA : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT4_INT_ENA (BIT(4)) -#define HOST_SLC1_TOHOST_BIT4_INT_ENA_M (BIT(4)) -#define HOST_SLC1_TOHOST_BIT4_INT_ENA_V 0x1 -#define HOST_SLC1_TOHOST_BIT4_INT_ENA_S 4 -/* HOST_SLC1_TOHOST_BIT3_INT_ENA : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT3_INT_ENA (BIT(3)) -#define HOST_SLC1_TOHOST_BIT3_INT_ENA_M (BIT(3)) -#define HOST_SLC1_TOHOST_BIT3_INT_ENA_V 0x1 -#define HOST_SLC1_TOHOST_BIT3_INT_ENA_S 3 -/* HOST_SLC1_TOHOST_BIT2_INT_ENA : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT2_INT_ENA (BIT(2)) -#define HOST_SLC1_TOHOST_BIT2_INT_ENA_M (BIT(2)) -#define HOST_SLC1_TOHOST_BIT2_INT_ENA_V 0x1 -#define HOST_SLC1_TOHOST_BIT2_INT_ENA_S 2 -/* HOST_SLC1_TOHOST_BIT1_INT_ENA : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT1_INT_ENA (BIT(1)) -#define HOST_SLC1_TOHOST_BIT1_INT_ENA_M (BIT(1)) -#define HOST_SLC1_TOHOST_BIT1_INT_ENA_V 0x1 -#define HOST_SLC1_TOHOST_BIT1_INT_ENA_S 1 -/* HOST_SLC1_TOHOST_BIT0_INT_ENA : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT0_INT_ENA (BIT(0)) -#define HOST_SLC1_TOHOST_BIT0_INT_ENA_M (BIT(0)) -#define HOST_SLC1_TOHOST_BIT0_INT_ENA_V 0x1 -#define HOST_SLC1_TOHOST_BIT0_INT_ENA_S 0 - -#define HOST_SLC0HOST_RX_INFOR_REG (DR_REG_SLCHOST_BASE + 0xF4) -/* HOST_SLC0HOST_RX_INFOR : R/W ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_RX_INFOR 0x000FFFFF -#define HOST_SLC0HOST_RX_INFOR_M ((HOST_SLC0HOST_RX_INFOR_V)<<(HOST_SLC0HOST_RX_INFOR_S)) -#define HOST_SLC0HOST_RX_INFOR_V 0xFFFFF -#define HOST_SLC0HOST_RX_INFOR_S 0 - -#define HOST_SLC1HOST_RX_INFOR_REG (DR_REG_SLCHOST_BASE + 0xF8) -/* HOST_SLC1HOST_RX_INFOR : R/W ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: */ -#define HOST_SLC1HOST_RX_INFOR 0x000FFFFF -#define HOST_SLC1HOST_RX_INFOR_M ((HOST_SLC1HOST_RX_INFOR_V)<<(HOST_SLC1HOST_RX_INFOR_S)) -#define HOST_SLC1HOST_RX_INFOR_V 0xFFFFF -#define HOST_SLC1HOST_RX_INFOR_S 0 - -#define HOST_SLC0HOST_LEN_WD_REG (DR_REG_SLCHOST_BASE + 0xFC) -/* HOST_SLC0HOST_LEN_WD : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_LEN_WD 0xFFFFFFFF -#define HOST_SLC0HOST_LEN_WD_M ((HOST_SLC0HOST_LEN_WD_V)<<(HOST_SLC0HOST_LEN_WD_S)) -#define HOST_SLC0HOST_LEN_WD_V 0xFFFFFFFF -#define HOST_SLC0HOST_LEN_WD_S 0 - -#define HOST_SLC_APBWIN_WDATA_REG (DR_REG_SLCHOST_BASE + 0x100) -/* HOST_SLC_APBWIN_WDATA : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define HOST_SLC_APBWIN_WDATA 0xFFFFFFFF -#define HOST_SLC_APBWIN_WDATA_M ((HOST_SLC_APBWIN_WDATA_V)<<(HOST_SLC_APBWIN_WDATA_S)) -#define HOST_SLC_APBWIN_WDATA_V 0xFFFFFFFF -#define HOST_SLC_APBWIN_WDATA_S 0 - -#define HOST_SLC_APBWIN_CONF_REG (DR_REG_SLCHOST_BASE + 0x104) -/* HOST_SLC_APBWIN_START : R/W ;bitpos:[29] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC_APBWIN_START (BIT(29)) -#define HOST_SLC_APBWIN_START_M (BIT(29)) -#define HOST_SLC_APBWIN_START_V 0x1 -#define HOST_SLC_APBWIN_START_S 29 -/* HOST_SLC_APBWIN_WR : R/W ;bitpos:[28] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC_APBWIN_WR (BIT(28)) -#define HOST_SLC_APBWIN_WR_M (BIT(28)) -#define HOST_SLC_APBWIN_WR_V 0x1 -#define HOST_SLC_APBWIN_WR_S 28 -/* HOST_SLC_APBWIN_ADDR : R/W ;bitpos:[27:0] ;default: 28'b0 ; */ -/*description: */ -#define HOST_SLC_APBWIN_ADDR 0x0FFFFFFF -#define HOST_SLC_APBWIN_ADDR_M ((HOST_SLC_APBWIN_ADDR_V)<<(HOST_SLC_APBWIN_ADDR_S)) -#define HOST_SLC_APBWIN_ADDR_V 0xFFFFFFF -#define HOST_SLC_APBWIN_ADDR_S 0 - -#define HOST_SLC_APBWIN_RDATA_REG (DR_REG_SLCHOST_BASE + 0x108) -/* HOST_SLC_APBWIN_RDATA : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define HOST_SLC_APBWIN_RDATA 0xFFFFFFFF -#define HOST_SLC_APBWIN_RDATA_M ((HOST_SLC_APBWIN_RDATA_V)<<(HOST_SLC_APBWIN_RDATA_S)) -#define HOST_SLC_APBWIN_RDATA_V 0xFFFFFFFF -#define HOST_SLC_APBWIN_RDATA_S 0 - -#define HOST_SLCHOST_RDCLR0_REG (DR_REG_SLCHOST_BASE + 0x10C) -/* HOST_SLCHOST_SLC0_BIT6_CLRADDR : R/W ;bitpos:[17:9] ;default: 9'h1e0 ; */ -/*description: */ -#define HOST_SLCHOST_SLC0_BIT6_CLRADDR 0x000001FF -#define HOST_SLCHOST_SLC0_BIT6_CLRADDR_M ((HOST_SLCHOST_SLC0_BIT6_CLRADDR_V)<<(HOST_SLCHOST_SLC0_BIT6_CLRADDR_S)) -#define HOST_SLCHOST_SLC0_BIT6_CLRADDR_V 0x1FF -#define HOST_SLCHOST_SLC0_BIT6_CLRADDR_S 9 -/* HOST_SLCHOST_SLC0_BIT7_CLRADDR : R/W ;bitpos:[8:0] ;default: 9'h44 ; */ -/*description: */ -#define HOST_SLCHOST_SLC0_BIT7_CLRADDR 0x000001FF -#define HOST_SLCHOST_SLC0_BIT7_CLRADDR_M ((HOST_SLCHOST_SLC0_BIT7_CLRADDR_V)<<(HOST_SLCHOST_SLC0_BIT7_CLRADDR_S)) -#define HOST_SLCHOST_SLC0_BIT7_CLRADDR_V 0x1FF -#define HOST_SLCHOST_SLC0_BIT7_CLRADDR_S 0 - -#define HOST_SLCHOST_RDCLR1_REG (DR_REG_SLCHOST_BASE + 0x110) -/* HOST_SLCHOST_SLC1_BIT6_CLRADDR : R/W ;bitpos:[17:9] ;default: 9'h1e0 ; */ -/*description: */ -#define HOST_SLCHOST_SLC1_BIT6_CLRADDR 0x000001FF -#define HOST_SLCHOST_SLC1_BIT6_CLRADDR_M ((HOST_SLCHOST_SLC1_BIT6_CLRADDR_V)<<(HOST_SLCHOST_SLC1_BIT6_CLRADDR_S)) -#define HOST_SLCHOST_SLC1_BIT6_CLRADDR_V 0x1FF -#define HOST_SLCHOST_SLC1_BIT6_CLRADDR_S 9 -/* HOST_SLCHOST_SLC1_BIT7_CLRADDR : R/W ;bitpos:[8:0] ;default: 9'h1e0 ; */ -/*description: */ -#define HOST_SLCHOST_SLC1_BIT7_CLRADDR 0x000001FF -#define HOST_SLCHOST_SLC1_BIT7_CLRADDR_M ((HOST_SLCHOST_SLC1_BIT7_CLRADDR_V)<<(HOST_SLCHOST_SLC1_BIT7_CLRADDR_S)) -#define HOST_SLCHOST_SLC1_BIT7_CLRADDR_V 0x1FF -#define HOST_SLCHOST_SLC1_BIT7_CLRADDR_S 0 - -#define HOST_SLC0HOST_INT_ENA1_REG (DR_REG_SLCHOST_BASE + 0x114) -/* HOST_GPIO_SDIO_INT_ENA1 : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: */ -#define HOST_GPIO_SDIO_INT_ENA1 (BIT(25)) -#define HOST_GPIO_SDIO_INT_ENA1_M (BIT(25)) -#define HOST_GPIO_SDIO_INT_ENA1_V 0x1 -#define HOST_GPIO_SDIO_INT_ENA1_S 25 -/* HOST_SLC0_HOST_RD_RETRY_INT_ENA1 : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_HOST_RD_RETRY_INT_ENA1 (BIT(24)) -#define HOST_SLC0_HOST_RD_RETRY_INT_ENA1_M (BIT(24)) -#define HOST_SLC0_HOST_RD_RETRY_INT_ENA1_V 0x1 -#define HOST_SLC0_HOST_RD_RETRY_INT_ENA1_S 24 -/* HOST_SLC0_RX_NEW_PACKET_INT_ENA1 : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_RX_NEW_PACKET_INT_ENA1 (BIT(23)) -#define HOST_SLC0_RX_NEW_PACKET_INT_ENA1_M (BIT(23)) -#define HOST_SLC0_RX_NEW_PACKET_INT_ENA1_V 0x1 -#define HOST_SLC0_RX_NEW_PACKET_INT_ENA1_S 23 -/* HOST_SLC0_EXT_BIT3_INT_ENA1 : R/W ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_EXT_BIT3_INT_ENA1 (BIT(22)) -#define HOST_SLC0_EXT_BIT3_INT_ENA1_M (BIT(22)) -#define HOST_SLC0_EXT_BIT3_INT_ENA1_V 0x1 -#define HOST_SLC0_EXT_BIT3_INT_ENA1_S 22 -/* HOST_SLC0_EXT_BIT2_INT_ENA1 : R/W ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_EXT_BIT2_INT_ENA1 (BIT(21)) -#define HOST_SLC0_EXT_BIT2_INT_ENA1_M (BIT(21)) -#define HOST_SLC0_EXT_BIT2_INT_ENA1_V 0x1 -#define HOST_SLC0_EXT_BIT2_INT_ENA1_S 21 -/* HOST_SLC0_EXT_BIT1_INT_ENA1 : R/W ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_EXT_BIT1_INT_ENA1 (BIT(20)) -#define HOST_SLC0_EXT_BIT1_INT_ENA1_M (BIT(20)) -#define HOST_SLC0_EXT_BIT1_INT_ENA1_V 0x1 -#define HOST_SLC0_EXT_BIT1_INT_ENA1_S 20 -/* HOST_SLC0_EXT_BIT0_INT_ENA1 : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_EXT_BIT0_INT_ENA1 (BIT(19)) -#define HOST_SLC0_EXT_BIT0_INT_ENA1_M (BIT(19)) -#define HOST_SLC0_EXT_BIT0_INT_ENA1_V 0x1 -#define HOST_SLC0_EXT_BIT0_INT_ENA1_S 19 -/* HOST_SLC0_RX_PF_VALID_INT_ENA1 : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_RX_PF_VALID_INT_ENA1 (BIT(18)) -#define HOST_SLC0_RX_PF_VALID_INT_ENA1_M (BIT(18)) -#define HOST_SLC0_RX_PF_VALID_INT_ENA1_V 0x1 -#define HOST_SLC0_RX_PF_VALID_INT_ENA1_S 18 -/* HOST_SLC0_TX_OVF_INT_ENA1 : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TX_OVF_INT_ENA1 (BIT(17)) -#define HOST_SLC0_TX_OVF_INT_ENA1_M (BIT(17)) -#define HOST_SLC0_TX_OVF_INT_ENA1_V 0x1 -#define HOST_SLC0_TX_OVF_INT_ENA1_S 17 -/* HOST_SLC0_RX_UDF_INT_ENA1 : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_RX_UDF_INT_ENA1 (BIT(16)) -#define HOST_SLC0_RX_UDF_INT_ENA1_M (BIT(16)) -#define HOST_SLC0_RX_UDF_INT_ENA1_V 0x1 -#define HOST_SLC0_RX_UDF_INT_ENA1_S 16 -/* HOST_SLC0HOST_TX_START_INT_ENA1 : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_TX_START_INT_ENA1 (BIT(15)) -#define HOST_SLC0HOST_TX_START_INT_ENA1_M (BIT(15)) -#define HOST_SLC0HOST_TX_START_INT_ENA1_V 0x1 -#define HOST_SLC0HOST_TX_START_INT_ENA1_S 15 -/* HOST_SLC0HOST_RX_START_INT_ENA1 : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_RX_START_INT_ENA1 (BIT(14)) -#define HOST_SLC0HOST_RX_START_INT_ENA1_M (BIT(14)) -#define HOST_SLC0HOST_RX_START_INT_ENA1_V 0x1 -#define HOST_SLC0HOST_RX_START_INT_ENA1_S 14 -/* HOST_SLC0HOST_RX_EOF_INT_ENA1 : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_RX_EOF_INT_ENA1 (BIT(13)) -#define HOST_SLC0HOST_RX_EOF_INT_ENA1_M (BIT(13)) -#define HOST_SLC0HOST_RX_EOF_INT_ENA1_V 0x1 -#define HOST_SLC0HOST_RX_EOF_INT_ENA1_S 13 -/* HOST_SLC0HOST_RX_SOF_INT_ENA1 : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0HOST_RX_SOF_INT_ENA1 (BIT(12)) -#define HOST_SLC0HOST_RX_SOF_INT_ENA1_M (BIT(12)) -#define HOST_SLC0HOST_RX_SOF_INT_ENA1_V 0x1 -#define HOST_SLC0HOST_RX_SOF_INT_ENA1_S 12 -/* HOST_SLC0_TOKEN1_0TO1_INT_ENA1 : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOKEN1_0TO1_INT_ENA1 (BIT(11)) -#define HOST_SLC0_TOKEN1_0TO1_INT_ENA1_M (BIT(11)) -#define HOST_SLC0_TOKEN1_0TO1_INT_ENA1_V 0x1 -#define HOST_SLC0_TOKEN1_0TO1_INT_ENA1_S 11 -/* HOST_SLC0_TOKEN0_0TO1_INT_ENA1 : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOKEN0_0TO1_INT_ENA1 (BIT(10)) -#define HOST_SLC0_TOKEN0_0TO1_INT_ENA1_M (BIT(10)) -#define HOST_SLC0_TOKEN0_0TO1_INT_ENA1_V 0x1 -#define HOST_SLC0_TOKEN0_0TO1_INT_ENA1_S 10 -/* HOST_SLC0_TOKEN1_1TO0_INT_ENA1 : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOKEN1_1TO0_INT_ENA1 (BIT(9)) -#define HOST_SLC0_TOKEN1_1TO0_INT_ENA1_M (BIT(9)) -#define HOST_SLC0_TOKEN1_1TO0_INT_ENA1_V 0x1 -#define HOST_SLC0_TOKEN1_1TO0_INT_ENA1_S 9 -/* HOST_SLC0_TOKEN0_1TO0_INT_ENA1 : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOKEN0_1TO0_INT_ENA1 (BIT(8)) -#define HOST_SLC0_TOKEN0_1TO0_INT_ENA1_M (BIT(8)) -#define HOST_SLC0_TOKEN0_1TO0_INT_ENA1_V 0x1 -#define HOST_SLC0_TOKEN0_1TO0_INT_ENA1_S 8 -/* HOST_SLC0_TOHOST_BIT7_INT_ENA1 : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT7_INT_ENA1 (BIT(7)) -#define HOST_SLC0_TOHOST_BIT7_INT_ENA1_M (BIT(7)) -#define HOST_SLC0_TOHOST_BIT7_INT_ENA1_V 0x1 -#define HOST_SLC0_TOHOST_BIT7_INT_ENA1_S 7 -/* HOST_SLC0_TOHOST_BIT6_INT_ENA1 : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT6_INT_ENA1 (BIT(6)) -#define HOST_SLC0_TOHOST_BIT6_INT_ENA1_M (BIT(6)) -#define HOST_SLC0_TOHOST_BIT6_INT_ENA1_V 0x1 -#define HOST_SLC0_TOHOST_BIT6_INT_ENA1_S 6 -/* HOST_SLC0_TOHOST_BIT5_INT_ENA1 : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT5_INT_ENA1 (BIT(5)) -#define HOST_SLC0_TOHOST_BIT5_INT_ENA1_M (BIT(5)) -#define HOST_SLC0_TOHOST_BIT5_INT_ENA1_V 0x1 -#define HOST_SLC0_TOHOST_BIT5_INT_ENA1_S 5 -/* HOST_SLC0_TOHOST_BIT4_INT_ENA1 : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT4_INT_ENA1 (BIT(4)) -#define HOST_SLC0_TOHOST_BIT4_INT_ENA1_M (BIT(4)) -#define HOST_SLC0_TOHOST_BIT4_INT_ENA1_V 0x1 -#define HOST_SLC0_TOHOST_BIT4_INT_ENA1_S 4 -/* HOST_SLC0_TOHOST_BIT3_INT_ENA1 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT3_INT_ENA1 (BIT(3)) -#define HOST_SLC0_TOHOST_BIT3_INT_ENA1_M (BIT(3)) -#define HOST_SLC0_TOHOST_BIT3_INT_ENA1_V 0x1 -#define HOST_SLC0_TOHOST_BIT3_INT_ENA1_S 3 -/* HOST_SLC0_TOHOST_BIT2_INT_ENA1 : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT2_INT_ENA1 (BIT(2)) -#define HOST_SLC0_TOHOST_BIT2_INT_ENA1_M (BIT(2)) -#define HOST_SLC0_TOHOST_BIT2_INT_ENA1_V 0x1 -#define HOST_SLC0_TOHOST_BIT2_INT_ENA1_S 2 -/* HOST_SLC0_TOHOST_BIT1_INT_ENA1 : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT1_INT_ENA1 (BIT(1)) -#define HOST_SLC0_TOHOST_BIT1_INT_ENA1_M (BIT(1)) -#define HOST_SLC0_TOHOST_BIT1_INT_ENA1_V 0x1 -#define HOST_SLC0_TOHOST_BIT1_INT_ENA1_S 1 -/* HOST_SLC0_TOHOST_BIT0_INT_ENA1 : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC0_TOHOST_BIT0_INT_ENA1 (BIT(0)) -#define HOST_SLC0_TOHOST_BIT0_INT_ENA1_M (BIT(0)) -#define HOST_SLC0_TOHOST_BIT0_INT_ENA1_V 0x1 -#define HOST_SLC0_TOHOST_BIT0_INT_ENA1_S 0 - -#define HOST_SLC1HOST_INT_ENA1_REG (DR_REG_SLCHOST_BASE + 0x118) -/* HOST_SLC1_BT_RX_NEW_PACKET_INT_ENA1 : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_BT_RX_NEW_PACKET_INT_ENA1 (BIT(25)) -#define HOST_SLC1_BT_RX_NEW_PACKET_INT_ENA1_M (BIT(25)) -#define HOST_SLC1_BT_RX_NEW_PACKET_INT_ENA1_V 0x1 -#define HOST_SLC1_BT_RX_NEW_PACKET_INT_ENA1_S 25 -/* HOST_SLC1_HOST_RD_RETRY_INT_ENA1 : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_HOST_RD_RETRY_INT_ENA1 (BIT(24)) -#define HOST_SLC1_HOST_RD_RETRY_INT_ENA1_M (BIT(24)) -#define HOST_SLC1_HOST_RD_RETRY_INT_ENA1_V 0x1 -#define HOST_SLC1_HOST_RD_RETRY_INT_ENA1_S 24 -/* HOST_SLC1_WIFI_RX_NEW_PACKET_INT_ENA1 : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_WIFI_RX_NEW_PACKET_INT_ENA1 (BIT(23)) -#define HOST_SLC1_WIFI_RX_NEW_PACKET_INT_ENA1_M (BIT(23)) -#define HOST_SLC1_WIFI_RX_NEW_PACKET_INT_ENA1_V 0x1 -#define HOST_SLC1_WIFI_RX_NEW_PACKET_INT_ENA1_S 23 -/* HOST_SLC1_EXT_BIT3_INT_ENA1 : R/W ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_EXT_BIT3_INT_ENA1 (BIT(22)) -#define HOST_SLC1_EXT_BIT3_INT_ENA1_M (BIT(22)) -#define HOST_SLC1_EXT_BIT3_INT_ENA1_V 0x1 -#define HOST_SLC1_EXT_BIT3_INT_ENA1_S 22 -/* HOST_SLC1_EXT_BIT2_INT_ENA1 : R/W ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_EXT_BIT2_INT_ENA1 (BIT(21)) -#define HOST_SLC1_EXT_BIT2_INT_ENA1_M (BIT(21)) -#define HOST_SLC1_EXT_BIT2_INT_ENA1_V 0x1 -#define HOST_SLC1_EXT_BIT2_INT_ENA1_S 21 -/* HOST_SLC1_EXT_BIT1_INT_ENA1 : R/W ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_EXT_BIT1_INT_ENA1 (BIT(20)) -#define HOST_SLC1_EXT_BIT1_INT_ENA1_M (BIT(20)) -#define HOST_SLC1_EXT_BIT1_INT_ENA1_V 0x1 -#define HOST_SLC1_EXT_BIT1_INT_ENA1_S 20 -/* HOST_SLC1_EXT_BIT0_INT_ENA1 : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_EXT_BIT0_INT_ENA1 (BIT(19)) -#define HOST_SLC1_EXT_BIT0_INT_ENA1_M (BIT(19)) -#define HOST_SLC1_EXT_BIT0_INT_ENA1_V 0x1 -#define HOST_SLC1_EXT_BIT0_INT_ENA1_S 19 -/* HOST_SLC1_RX_PF_VALID_INT_ENA1 : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_RX_PF_VALID_INT_ENA1 (BIT(18)) -#define HOST_SLC1_RX_PF_VALID_INT_ENA1_M (BIT(18)) -#define HOST_SLC1_RX_PF_VALID_INT_ENA1_V 0x1 -#define HOST_SLC1_RX_PF_VALID_INT_ENA1_S 18 -/* HOST_SLC1_TX_OVF_INT_ENA1 : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TX_OVF_INT_ENA1 (BIT(17)) -#define HOST_SLC1_TX_OVF_INT_ENA1_M (BIT(17)) -#define HOST_SLC1_TX_OVF_INT_ENA1_V 0x1 -#define HOST_SLC1_TX_OVF_INT_ENA1_S 17 -/* HOST_SLC1_RX_UDF_INT_ENA1 : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_RX_UDF_INT_ENA1 (BIT(16)) -#define HOST_SLC1_RX_UDF_INT_ENA1_M (BIT(16)) -#define HOST_SLC1_RX_UDF_INT_ENA1_V 0x1 -#define HOST_SLC1_RX_UDF_INT_ENA1_S 16 -/* HOST_SLC1HOST_TX_START_INT_ENA1 : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1HOST_TX_START_INT_ENA1 (BIT(15)) -#define HOST_SLC1HOST_TX_START_INT_ENA1_M (BIT(15)) -#define HOST_SLC1HOST_TX_START_INT_ENA1_V 0x1 -#define HOST_SLC1HOST_TX_START_INT_ENA1_S 15 -/* HOST_SLC1HOST_RX_START_INT_ENA1 : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1HOST_RX_START_INT_ENA1 (BIT(14)) -#define HOST_SLC1HOST_RX_START_INT_ENA1_M (BIT(14)) -#define HOST_SLC1HOST_RX_START_INT_ENA1_V 0x1 -#define HOST_SLC1HOST_RX_START_INT_ENA1_S 14 -/* HOST_SLC1HOST_RX_EOF_INT_ENA1 : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1HOST_RX_EOF_INT_ENA1 (BIT(13)) -#define HOST_SLC1HOST_RX_EOF_INT_ENA1_M (BIT(13)) -#define HOST_SLC1HOST_RX_EOF_INT_ENA1_V 0x1 -#define HOST_SLC1HOST_RX_EOF_INT_ENA1_S 13 -/* HOST_SLC1HOST_RX_SOF_INT_ENA1 : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1HOST_RX_SOF_INT_ENA1 (BIT(12)) -#define HOST_SLC1HOST_RX_SOF_INT_ENA1_M (BIT(12)) -#define HOST_SLC1HOST_RX_SOF_INT_ENA1_V 0x1 -#define HOST_SLC1HOST_RX_SOF_INT_ENA1_S 12 -/* HOST_SLC1_TOKEN1_0TO1_INT_ENA1 : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOKEN1_0TO1_INT_ENA1 (BIT(11)) -#define HOST_SLC1_TOKEN1_0TO1_INT_ENA1_M (BIT(11)) -#define HOST_SLC1_TOKEN1_0TO1_INT_ENA1_V 0x1 -#define HOST_SLC1_TOKEN1_0TO1_INT_ENA1_S 11 -/* HOST_SLC1_TOKEN0_0TO1_INT_ENA1 : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOKEN0_0TO1_INT_ENA1 (BIT(10)) -#define HOST_SLC1_TOKEN0_0TO1_INT_ENA1_M (BIT(10)) -#define HOST_SLC1_TOKEN0_0TO1_INT_ENA1_V 0x1 -#define HOST_SLC1_TOKEN0_0TO1_INT_ENA1_S 10 -/* HOST_SLC1_TOKEN1_1TO0_INT_ENA1 : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOKEN1_1TO0_INT_ENA1 (BIT(9)) -#define HOST_SLC1_TOKEN1_1TO0_INT_ENA1_M (BIT(9)) -#define HOST_SLC1_TOKEN1_1TO0_INT_ENA1_V 0x1 -#define HOST_SLC1_TOKEN1_1TO0_INT_ENA1_S 9 -/* HOST_SLC1_TOKEN0_1TO0_INT_ENA1 : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOKEN0_1TO0_INT_ENA1 (BIT(8)) -#define HOST_SLC1_TOKEN0_1TO0_INT_ENA1_M (BIT(8)) -#define HOST_SLC1_TOKEN0_1TO0_INT_ENA1_V 0x1 -#define HOST_SLC1_TOKEN0_1TO0_INT_ENA1_S 8 -/* HOST_SLC1_TOHOST_BIT7_INT_ENA1 : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT7_INT_ENA1 (BIT(7)) -#define HOST_SLC1_TOHOST_BIT7_INT_ENA1_M (BIT(7)) -#define HOST_SLC1_TOHOST_BIT7_INT_ENA1_V 0x1 -#define HOST_SLC1_TOHOST_BIT7_INT_ENA1_S 7 -/* HOST_SLC1_TOHOST_BIT6_INT_ENA1 : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT6_INT_ENA1 (BIT(6)) -#define HOST_SLC1_TOHOST_BIT6_INT_ENA1_M (BIT(6)) -#define HOST_SLC1_TOHOST_BIT6_INT_ENA1_V 0x1 -#define HOST_SLC1_TOHOST_BIT6_INT_ENA1_S 6 -/* HOST_SLC1_TOHOST_BIT5_INT_ENA1 : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT5_INT_ENA1 (BIT(5)) -#define HOST_SLC1_TOHOST_BIT5_INT_ENA1_M (BIT(5)) -#define HOST_SLC1_TOHOST_BIT5_INT_ENA1_V 0x1 -#define HOST_SLC1_TOHOST_BIT5_INT_ENA1_S 5 -/* HOST_SLC1_TOHOST_BIT4_INT_ENA1 : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT4_INT_ENA1 (BIT(4)) -#define HOST_SLC1_TOHOST_BIT4_INT_ENA1_M (BIT(4)) -#define HOST_SLC1_TOHOST_BIT4_INT_ENA1_V 0x1 -#define HOST_SLC1_TOHOST_BIT4_INT_ENA1_S 4 -/* HOST_SLC1_TOHOST_BIT3_INT_ENA1 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT3_INT_ENA1 (BIT(3)) -#define HOST_SLC1_TOHOST_BIT3_INT_ENA1_M (BIT(3)) -#define HOST_SLC1_TOHOST_BIT3_INT_ENA1_V 0x1 -#define HOST_SLC1_TOHOST_BIT3_INT_ENA1_S 3 -/* HOST_SLC1_TOHOST_BIT2_INT_ENA1 : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT2_INT_ENA1 (BIT(2)) -#define HOST_SLC1_TOHOST_BIT2_INT_ENA1_M (BIT(2)) -#define HOST_SLC1_TOHOST_BIT2_INT_ENA1_V 0x1 -#define HOST_SLC1_TOHOST_BIT2_INT_ENA1_S 2 -/* HOST_SLC1_TOHOST_BIT1_INT_ENA1 : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT1_INT_ENA1 (BIT(1)) -#define HOST_SLC1_TOHOST_BIT1_INT_ENA1_M (BIT(1)) -#define HOST_SLC1_TOHOST_BIT1_INT_ENA1_V 0x1 -#define HOST_SLC1_TOHOST_BIT1_INT_ENA1_S 1 -/* HOST_SLC1_TOHOST_BIT0_INT_ENA1 : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SLC1_TOHOST_BIT0_INT_ENA1 (BIT(0)) -#define HOST_SLC1_TOHOST_BIT0_INT_ENA1_M (BIT(0)) -#define HOST_SLC1_TOHOST_BIT0_INT_ENA1_V 0x1 -#define HOST_SLC1_TOHOST_BIT0_INT_ENA1_S 0 - -#define HOST_SLCHOSTDATE_REG (DR_REG_SLCHOST_BASE + 0x178) -/* HOST_SLCHOST_DATE : R/W ;bitpos:[31:0] ;default: 32'h16022500 ; */ -/*description: */ -#define HOST_SLCHOST_DATE 0xFFFFFFFF -#define HOST_SLCHOST_DATE_M ((HOST_SLCHOST_DATE_V)<<(HOST_SLCHOST_DATE_S)) -#define HOST_SLCHOST_DATE_V 0xFFFFFFFF -#define HOST_SLCHOST_DATE_S 0 - -#define HOST_SLCHOSTID_REG (DR_REG_SLCHOST_BASE + 0x17C) -/* HOST_SLCHOST_ID : R/W ;bitpos:[31:0] ;default: 32'h0600 ; */ -/*description: */ -#define HOST_SLCHOST_ID 0xFFFFFFFF -#define HOST_SLCHOST_ID_M ((HOST_SLCHOST_ID_V)<<(HOST_SLCHOST_ID_S)) -#define HOST_SLCHOST_ID_V 0xFFFFFFFF -#define HOST_SLCHOST_ID_S 0 - -#define HOST_SLCHOST_CONF_REG (DR_REG_SLCHOST_BASE + 0x1F0) -/* HOST_HSPEED_CON_EN : R/W ;bitpos:[27] ;default: 1'b0 ; */ -/*description: */ -#define HOST_HSPEED_CON_EN (BIT(27)) -#define HOST_HSPEED_CON_EN_M (BIT(27)) -#define HOST_HSPEED_CON_EN_V 0x1 -#define HOST_HSPEED_CON_EN_S 27 -/* HOST_SDIO_PAD_PULLUP : R/W ;bitpos:[26] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SDIO_PAD_PULLUP (BIT(26)) -#define HOST_SDIO_PAD_PULLUP_M (BIT(26)) -#define HOST_SDIO_PAD_PULLUP_V 0x1 -#define HOST_SDIO_PAD_PULLUP_S 26 -/* HOST_SDIO20_INT_DELAY : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: */ -#define HOST_SDIO20_INT_DELAY (BIT(25)) -#define HOST_SDIO20_INT_DELAY_M (BIT(25)) -#define HOST_SDIO20_INT_DELAY_V 0x1 -#define HOST_SDIO20_INT_DELAY_S 25 -/* HOST_FRC_QUICK_IN : R/W ;bitpos:[24:20] ;default: 5'b0 ; */ -/*description: */ -#define HOST_FRC_QUICK_IN 0x0000001F -#define HOST_FRC_QUICK_IN_M ((HOST_FRC_QUICK_IN_V)<<(HOST_FRC_QUICK_IN_S)) -#define HOST_FRC_QUICK_IN_V 0x1F -#define HOST_FRC_QUICK_IN_S 20 -/* HOST_FRC_POS_SAMP : R/W ;bitpos:[19:15] ;default: 5'b0 ; */ -/*description: */ -#define HOST_FRC_POS_SAMP 0x0000001F -#define HOST_FRC_POS_SAMP_M ((HOST_FRC_POS_SAMP_V)<<(HOST_FRC_POS_SAMP_S)) -#define HOST_FRC_POS_SAMP_V 0x1F -#define HOST_FRC_POS_SAMP_S 15 -/* HOST_FRC_NEG_SAMP : R/W ;bitpos:[14:10] ;default: 5'b0 ; */ -/*description: */ -#define HOST_FRC_NEG_SAMP 0x0000001F -#define HOST_FRC_NEG_SAMP_M ((HOST_FRC_NEG_SAMP_V)<<(HOST_FRC_NEG_SAMP_S)) -#define HOST_FRC_NEG_SAMP_V 0x1F -#define HOST_FRC_NEG_SAMP_S 10 -/* HOST_FRC_SDIO20 : R/W ;bitpos:[9:5] ;default: 5'b0 ; */ -/*description: */ -#define HOST_FRC_SDIO20 0x0000001F -#define HOST_FRC_SDIO20_M ((HOST_FRC_SDIO20_V)<<(HOST_FRC_SDIO20_S)) -#define HOST_FRC_SDIO20_V 0x1F -#define HOST_FRC_SDIO20_S 5 -/* HOST_FRC_SDIO11 : R/W ;bitpos:[4:0] ;default: 5'b0 ; */ -/*description: */ -#define HOST_FRC_SDIO11 0x0000001F -#define HOST_FRC_SDIO11_M ((HOST_FRC_SDIO11_V)<<(HOST_FRC_SDIO11_S)) -#define HOST_FRC_SDIO11_V 0x1F -#define HOST_FRC_SDIO11_S 0 - -#define HOST_SLCHOST_INF_ST_REG (DR_REG_SLCHOST_BASE + 0x1F4) -/* HOST_SDIO_QUICK_IN : RO ;bitpos:[14:10] ;default: 5'b0 ; */ -/*description: */ -#define HOST_SDIO_QUICK_IN 0x0000001F -#define HOST_SDIO_QUICK_IN_M ((HOST_SDIO_QUICK_IN_V)<<(HOST_SDIO_QUICK_IN_S)) -#define HOST_SDIO_QUICK_IN_V 0x1F -#define HOST_SDIO_QUICK_IN_S 10 -/* HOST_SDIO_NEG_SAMP : RO ;bitpos:[9:5] ;default: 5'b0 ; */ -/*description: */ -#define HOST_SDIO_NEG_SAMP 0x0000001F -#define HOST_SDIO_NEG_SAMP_M ((HOST_SDIO_NEG_SAMP_V)<<(HOST_SDIO_NEG_SAMP_S)) -#define HOST_SDIO_NEG_SAMP_V 0x1F -#define HOST_SDIO_NEG_SAMP_S 5 -/* HOST_SDIO20_MODE : RO ;bitpos:[4:0] ;default: 5'b0 ; */ -/*description: */ -#define HOST_SDIO20_MODE 0x0000001F -#define HOST_SDIO20_MODE_M ((HOST_SDIO20_MODE_V)<<(HOST_SDIO20_MODE_S)) -#define HOST_SDIO20_MODE_V 0x1F -#define HOST_SDIO20_MODE_S 0 - - - - -#endif /*_SOC_HOST_REG_H_ */ - - diff --git a/tools/sdk/include/soc/soc/host_struct.h b/tools/sdk/include/soc/soc/host_struct.h deleted file mode 100644 index a86c2982db1..00000000000 --- a/tools/sdk/include/soc/soc/host_struct.h +++ /dev/null @@ -1,891 +0,0 @@ -// 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. -#ifndef _SOC_HOST_STRUCT_H_ -#define _SOC_HOST_STRUCT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef volatile struct { - uint32_t reserved_0; - uint32_t reserved_4; - uint32_t reserved_8; - uint32_t reserved_c; - union { - struct { - uint32_t reserved0: 24; - uint32_t func2_int: 1; - uint32_t reserved25: 7; - }; - uint32_t val; - } func2_0; - union { - struct { - uint32_t func2_int_en: 1; - uint32_t reserved1: 31; - }; - uint32_t val; - } func2_1; - uint32_t reserved_18; - uint32_t reserved_1c; - union { - struct { - uint32_t func1_mdstat: 1; - uint32_t reserved1: 31; - }; - uint32_t val; - } func2_2; - uint32_t reserved_24; - uint32_t reserved_28; - uint32_t reserved_2c; - uint32_t reserved_30; - uint32_t gpio_status0; /**/ - union { - struct { - uint32_t sdio_int1: 8; - uint32_t reserved8: 24; - }; - uint32_t val; - } gpio_status1; - uint32_t gpio_in0; /**/ - union { - struct { - uint32_t sdio_in1: 8; - uint32_t reserved8: 24; - }; - uint32_t val; - } gpio_in1; - union { - struct { - uint32_t token0: 12; - uint32_t rx_pf_valid: 1; - uint32_t reserved13: 3; - uint32_t reg_token1: 12; - uint32_t rx_pf_eof: 4; - }; - uint32_t val; - } slc0_token_rdata; - uint32_t slc0_pf; /**/ - uint32_t slc1_pf; /**/ - union { - struct { - uint32_t tohost_bit0: 1; - uint32_t tohost_bit1: 1; - uint32_t tohost_bit2: 1; - uint32_t tohost_bit3: 1; - uint32_t tohost_bit4: 1; - uint32_t tohost_bit5: 1; - uint32_t tohost_bit6: 1; - uint32_t tohost_bit7: 1; - uint32_t token0_1to0: 1; - uint32_t token1_1to0: 1; - uint32_t token0_0to1: 1; - uint32_t token1_0to1: 1; - uint32_t rx_sof: 1; - uint32_t rx_eof: 1; - uint32_t rx_start: 1; - uint32_t tx_start: 1; - uint32_t rx_udf: 1; - uint32_t tx_ovf: 1; - uint32_t rx_pf_valid: 1; - uint32_t ext_bit0: 1; - uint32_t ext_bit1: 1; - uint32_t ext_bit2: 1; - uint32_t ext_bit3: 1; - uint32_t rx_new_packet: 1; - uint32_t rd_retry: 1; - uint32_t gpio_sdio: 1; - uint32_t reserved26: 6; - }; - uint32_t val; - } slc0_int_raw; - union { - struct { - uint32_t tohost_bit0: 1; - uint32_t tohost_bit1: 1; - uint32_t tohost_bit2: 1; - uint32_t tohost_bit3: 1; - uint32_t tohost_bit4: 1; - uint32_t tohost_bit5: 1; - uint32_t tohost_bit6: 1; - uint32_t tohost_bit7: 1; - uint32_t token0_1to0: 1; - uint32_t token1_1to0: 1; - uint32_t token0_0to1: 1; - uint32_t token1_0to1: 1; - uint32_t rx_sof: 1; - uint32_t rx_eof: 1; - uint32_t rx_start: 1; - uint32_t tx_start: 1; - uint32_t rx_udf: 1; - uint32_t tx_ovf: 1; - uint32_t rx_pf_valid: 1; - uint32_t ext_bit0: 1; - uint32_t ext_bit1: 1; - uint32_t ext_bit2: 1; - uint32_t ext_bit3: 1; - uint32_t wifi_rx_new_packet: 1; - uint32_t rd_retry: 1; - uint32_t bt_rx_new_packet: 1; - uint32_t reserved26: 6; - }; - uint32_t val; - } slc1_int_raw; - union { - struct { - uint32_t tohost_bit0: 1; - uint32_t tohost_bit1: 1; - uint32_t tohost_bit2: 1; - uint32_t tohost_bit3: 1; - uint32_t tohost_bit4: 1; - uint32_t tohost_bit5: 1; - uint32_t tohost_bit6: 1; - uint32_t tohost_bit7: 1; - uint32_t token0_1to0: 1; - uint32_t token1_1to0: 1; - uint32_t token0_0to1: 1; - uint32_t token1_0to1: 1; - uint32_t rx_sof: 1; - uint32_t rx_eof: 1; - uint32_t rx_start: 1; - uint32_t tx_start: 1; - uint32_t rx_udf: 1; - uint32_t tx_ovf: 1; - uint32_t rx_pf_valid: 1; - uint32_t ext_bit0: 1; - uint32_t ext_bit1: 1; - uint32_t ext_bit2: 1; - uint32_t ext_bit3: 1; - uint32_t rx_new_packet: 1; - uint32_t rd_retry: 1; - uint32_t gpio_sdio: 1; - uint32_t reserved26: 6; - }; - uint32_t val; - } slc0_int_st; - union { - struct { - uint32_t tohost_bit0: 1; - uint32_t tohost_bit1: 1; - uint32_t tohost_bit2: 1; - uint32_t tohost_bit3: 1; - uint32_t tohost_bit4: 1; - uint32_t tohost_bit5: 1; - uint32_t tohost_bit6: 1; - uint32_t tohost_bit7: 1; - uint32_t token0_1to0: 1; - uint32_t token1_1to0: 1; - uint32_t token0_0to1: 1; - uint32_t token1_0to1: 1; - uint32_t rx_sof: 1; - uint32_t rx_eof: 1; - uint32_t rx_start: 1; - uint32_t tx_start: 1; - uint32_t rx_udf: 1; - uint32_t tx_ovf: 1; - uint32_t rx_pf_valid: 1; - uint32_t ext_bit0: 1; - uint32_t ext_bit1: 1; - uint32_t ext_bit2: 1; - uint32_t ext_bit3: 1; - uint32_t wifi_rx_new_packet: 1; - uint32_t rd_retry: 1; - uint32_t bt_rx_new_packet: 1; - uint32_t reserved26: 6; - }; - uint32_t val; - } slc1_int_st; - union { - struct { - uint32_t reg_slc0_len: 20; - uint32_t reg_slc0_len_check:12; - }; - uint32_t val; - } pkt_len; - union { - struct { - uint32_t state0: 8; - uint32_t state1: 8; - uint32_t state2: 8; - uint32_t state3: 8; - }; - uint32_t val; - } state_w0; - union { - struct { - uint32_t state4: 8; - uint32_t state5: 8; - uint32_t state6: 8; - uint32_t state7: 8; - }; - uint32_t val; - } state_w1; - union { - struct { - uint32_t conf0: 8; - uint32_t conf1: 8; - uint32_t conf2: 8; - uint32_t conf3: 8; - }; - uint32_t val; - } conf_w0; - union { - struct { - uint32_t conf4: 8; - uint32_t conf5: 8; - uint32_t conf6: 8; - uint32_t conf7: 8; - }; - uint32_t val; - } conf_w1; - union { - struct { - uint32_t conf8: 8; - uint32_t conf9: 8; - uint32_t conf10: 8; - uint32_t conf11: 8; - }; - uint32_t val; - } conf_w2; - union { - struct { - uint32_t conf12: 8; - uint32_t conf13: 8; - uint32_t conf14: 8; - uint32_t conf15: 8; - }; - uint32_t val; - } conf_w3; - union { - struct { - uint32_t conf16: 8; /*SLC timeout value*/ - uint32_t conf17: 8; /*SLC timeout enable*/ - uint32_t conf18: 8; - uint32_t conf19: 8; /*Interrupt to target CPU*/ - }; - uint32_t val; - } conf_w4; - union { - struct { - uint32_t conf20: 8; - uint32_t conf21: 8; - uint32_t conf22: 8; - uint32_t conf23: 8; - }; - uint32_t val; - } conf_w5; - uint32_t win_cmd; /**/ - union { - struct { - uint32_t conf24: 8; - uint32_t conf25: 8; - uint32_t conf26: 8; - uint32_t conf27: 8; - }; - uint32_t val; - } conf_w6; - union { - struct { - uint32_t conf28: 8; - uint32_t conf29: 8; - uint32_t conf30: 8; - uint32_t conf31: 8; - }; - uint32_t val; - } conf_w7; - union { - struct { - uint32_t reg_slc0_len0:20; - uint32_t reserved20: 12; - }; - uint32_t val; - } pkt_len0; - union { - struct { - uint32_t reg_slc0_len1:20; - uint32_t reserved20: 12; - }; - uint32_t val; - } pkt_len1; - union { - struct { - uint32_t reg_slc0_len2:20; - uint32_t reserved20: 12; - }; - uint32_t val; - } pkt_len2; - union { - struct { - uint32_t conf32: 8; - uint32_t conf33: 8; - uint32_t conf34: 8; - uint32_t conf35: 8; - }; - uint32_t val; - } conf_w8; - union { - struct { - uint32_t conf36: 8; - uint32_t conf37: 8; - uint32_t conf38: 8; - uint32_t conf39: 8; - }; - uint32_t val; - } conf_w9; - union { - struct { - uint32_t conf40: 8; - uint32_t conf41: 8; - uint32_t conf42: 8; - uint32_t conf43: 8; - }; - uint32_t val; - } conf_w10; - union { - struct { - uint32_t conf44: 8; - uint32_t conf45: 8; - uint32_t conf46: 8; - uint32_t conf47: 8; - }; - uint32_t val; - } conf_w11; - union { - struct { - uint32_t conf48: 8; - uint32_t conf49: 8; - uint32_t conf50: 8; - uint32_t conf51: 8; - }; - uint32_t val; - } conf_w12; - union { - struct { - uint32_t conf52: 8; - uint32_t conf53: 8; - uint32_t conf54: 8; - uint32_t conf55: 8; - }; - uint32_t val; - } conf_w13; - union { - struct { - uint32_t conf56: 8; - uint32_t conf57: 8; - uint32_t conf58: 8; - uint32_t conf59: 8; - }; - uint32_t val; - } conf_w14; - union { - struct { - uint32_t conf60: 8; - uint32_t conf61: 8; - uint32_t conf62: 8; - uint32_t conf63: 8; - }; - uint32_t val; - } conf_w15; - uint32_t check_sum0; /**/ - uint32_t check_sum1; /**/ - union { - struct { - uint32_t token0: 12; - uint32_t rx_pf_valid: 1; - uint32_t reserved13: 3; - uint32_t reg_token1: 12; - uint32_t rx_pf_eof: 4; - }; - uint32_t val; - } slc1_token_rdata; - union { - struct { - uint32_t token0_wd: 12; - uint32_t reserved12: 4; - uint32_t token1_wd: 12; - uint32_t reserved28: 4; - }; - uint32_t val; - } slc0_token_wdata; - union { - struct { - uint32_t token0_wd: 12; - uint32_t reserved12: 4; - uint32_t token1_wd: 12; - uint32_t reserved28: 4; - }; - uint32_t val; - } slc1_token_wdata; - union { - struct { - uint32_t slc0_token0_dec: 1; - uint32_t slc0_token1_dec: 1; - uint32_t slc0_token0_wr: 1; - uint32_t slc0_token1_wr: 1; - uint32_t slc1_token0_dec: 1; - uint32_t slc1_token1_dec: 1; - uint32_t slc1_token0_wr: 1; - uint32_t slc1_token1_wr: 1; - uint32_t slc0_len_wr: 1; - uint32_t reserved9: 23; - }; - uint32_t val; - } token_con; - union { - struct { - uint32_t tohost_bit0: 1; - uint32_t tohost_bit1: 1; - uint32_t tohost_bit2: 1; - uint32_t tohost_bit3: 1; - uint32_t tohost_bit4: 1; - uint32_t tohost_bit5: 1; - uint32_t tohost_bit6: 1; - uint32_t tohost_bit7: 1; - uint32_t token0_1to0: 1; - uint32_t token1_1to0: 1; - uint32_t token0_0to1: 1; - uint32_t token1_0to1: 1; - uint32_t rx_sof: 1; - uint32_t rx_eof: 1; - uint32_t rx_start: 1; - uint32_t tx_start: 1; - uint32_t rx_udf: 1; - uint32_t tx_ovf: 1; - uint32_t rx_pf_valid: 1; - uint32_t ext_bit0: 1; - uint32_t ext_bit1: 1; - uint32_t ext_bit2: 1; - uint32_t ext_bit3: 1; - uint32_t rx_new_packet: 1; - uint32_t rd_retry: 1; - uint32_t gpio_sdio: 1; - uint32_t reserved26: 6; - }; - uint32_t val; - } slc0_int_clr; - union { - struct { - uint32_t tohost_bit0: 1; - uint32_t tohost_bit1: 1; - uint32_t tohost_bit2: 1; - uint32_t tohost_bit3: 1; - uint32_t tohost_bit4: 1; - uint32_t tohost_bit5: 1; - uint32_t tohost_bit6: 1; - uint32_t tohost_bit7: 1; - uint32_t token0_1to0: 1; - uint32_t token1_1to0: 1; - uint32_t token0_0to1: 1; - uint32_t token1_0to1: 1; - uint32_t rx_sof: 1; - uint32_t rx_eof: 1; - uint32_t rx_start: 1; - uint32_t tx_start: 1; - uint32_t rx_udf: 1; - uint32_t tx_ovf: 1; - uint32_t rx_pf_valid: 1; - uint32_t ext_bit0: 1; - uint32_t ext_bit1: 1; - uint32_t ext_bit2: 1; - uint32_t ext_bit3: 1; - uint32_t wifi_rx_new_packet: 1; - uint32_t rd_retry: 1; - uint32_t bt_rx_new_packet: 1; - uint32_t reserved26: 6; - }; - uint32_t val; - } slc1_int_clr; - union { - struct { - uint32_t tohost_bit0: 1; - uint32_t tohost_bit1: 1; - uint32_t tohost_bit2: 1; - uint32_t tohost_bit3: 1; - uint32_t tohost_bit4: 1; - uint32_t tohost_bit5: 1; - uint32_t tohost_bit6: 1; - uint32_t tohost_bit7: 1; - uint32_t token0_1to0: 1; - uint32_t token1_1to0: 1; - uint32_t token0_0to1: 1; - uint32_t token1_0to1: 1; - uint32_t rx_sof: 1; - uint32_t rx_eof: 1; - uint32_t rx_start: 1; - uint32_t tx_start: 1; - uint32_t rx_udf: 1; - uint32_t tx_ovf: 1; - uint32_t rx_pf_valid: 1; - uint32_t ext_bit0: 1; - uint32_t ext_bit1: 1; - uint32_t ext_bit2: 1; - uint32_t ext_bit3: 1; - uint32_t rx_new_packet: 1; - uint32_t rd_retry: 1; - uint32_t gpio_sdio: 1; - uint32_t reserved26: 6; - }; - uint32_t val; - } slc0_func1_int_ena; - union { - struct { - uint32_t tohost_bit0: 1; - uint32_t tohost_bit1: 1; - uint32_t tohost_bit2: 1; - uint32_t tohost_bit3: 1; - uint32_t tohost_bit4: 1; - uint32_t tohost_bit5: 1; - uint32_t tohost_bit6: 1; - uint32_t tohost_bit7: 1; - uint32_t token0_1to0: 1; - uint32_t token1_1to0: 1; - uint32_t token0_0to1: 1; - uint32_t token1_0to1: 1; - uint32_t rx_sof: 1; - uint32_t rx_eof: 1; - uint32_t rx_start: 1; - uint32_t tx_start: 1; - uint32_t rx_udf: 1; - uint32_t tx_ovf: 1; - uint32_t rx_pf_valid: 1; - uint32_t ext_bit0: 1; - uint32_t ext_bit1: 1; - uint32_t ext_bit2: 1; - uint32_t ext_bit3: 1; - uint32_t wifi_rx_new_packet: 1; - uint32_t rd_retry: 1; - uint32_t bt_rx_new_packet: 1; - uint32_t reserved26: 6; - }; - uint32_t val; - } slc1_func1_int_ena; - union { - struct { - uint32_t tohost_bit0: 1; - uint32_t tohost_bit1: 1; - uint32_t tohost_bit2: 1; - uint32_t tohost_bit3: 1; - uint32_t tohost_bit4: 1; - uint32_t tohost_bit5: 1; - uint32_t tohost_bit6: 1; - uint32_t tohost_bit7: 1; - uint32_t token0_1to0: 1; - uint32_t token1_1to0: 1; - uint32_t token0_0to1: 1; - uint32_t token1_0to1: 1; - uint32_t rx_sof: 1; - uint32_t rx_eof: 1; - uint32_t rx_start: 1; - uint32_t tx_start: 1; - uint32_t rx_udf: 1; - uint32_t tx_ovf: 1; - uint32_t rx_pf_valid: 1; - uint32_t ext_bit0: 1; - uint32_t ext_bit1: 1; - uint32_t ext_bit2: 1; - uint32_t ext_bit3: 1; - uint32_t rx_new_packet: 1; - uint32_t rd_retry: 1; - uint32_t gpio_sdio: 1; - uint32_t reserved26: 6; - }; - uint32_t val; - } slc0_func2_int_ena; - union { - struct { - uint32_t tohost_bit0: 1; - uint32_t tohost_bit1: 1; - uint32_t tohost_bit2: 1; - uint32_t tohost_bit3: 1; - uint32_t tohost_bit4: 1; - uint32_t tohost_bit5: 1; - uint32_t tohost_bit6: 1; - uint32_t tohost_bit7: 1; - uint32_t token0_1to0: 1; - uint32_t token1_1to0: 1; - uint32_t token0_0to1: 1; - uint32_t token1_0to1: 1; - uint32_t rx_sof: 1; - uint32_t rx_eof: 1; - uint32_t rx_start: 1; - uint32_t tx_start: 1; - uint32_t rx_udf: 1; - uint32_t tx_ovf: 1; - uint32_t rx_pf_valid: 1; - uint32_t ext_bit0: 1; - uint32_t ext_bit1: 1; - uint32_t ext_bit2: 1; - uint32_t ext_bit3: 1; - uint32_t wifi_rx_new_packet: 1; - uint32_t rd_retry: 1; - uint32_t bt_rx_new_packet: 1; - uint32_t reserved26: 6; - }; - uint32_t val; - } slc1_func2_int_ena; - union { - struct { - uint32_t tohost_bit0: 1; - uint32_t tohost_bit1: 1; - uint32_t tohost_bit2: 1; - uint32_t tohost_bit3: 1; - uint32_t tohost_bit4: 1; - uint32_t tohost_bit5: 1; - uint32_t tohost_bit6: 1; - uint32_t tohost_bit7: 1; - uint32_t token0_1to0: 1; - uint32_t token1_1to0: 1; - uint32_t token0_0to1: 1; - uint32_t token1_0to1: 1; - uint32_t rx_sof: 1; - uint32_t rx_eof: 1; - uint32_t rx_start: 1; - uint32_t tx_start: 1; - uint32_t rx_udf: 1; - uint32_t tx_ovf: 1; - uint32_t rx_pf_valid: 1; - uint32_t ext_bit0: 1; - uint32_t ext_bit1: 1; - uint32_t ext_bit2: 1; - uint32_t ext_bit3: 1; - uint32_t rx_new_packet: 1; - uint32_t rd_retry: 1; - uint32_t gpio_sdio: 1; - uint32_t reserved26: 6; - }; - uint32_t val; - } slc0_int_ena; - union { - struct { - uint32_t tohost_bit0: 1; - uint32_t tohost_bit1: 1; - uint32_t tohost_bit2: 1; - uint32_t tohost_bit3: 1; - uint32_t tohost_bit4: 1; - uint32_t tohost_bit5: 1; - uint32_t tohost_bit6: 1; - uint32_t tohost_bit7: 1; - uint32_t token0_1to0: 1; - uint32_t token1_1to0: 1; - uint32_t token0_0to1: 1; - uint32_t token1_0to1: 1; - uint32_t rx_sof: 1; - uint32_t rx_eof: 1; - uint32_t rx_start: 1; - uint32_t tx_start: 1; - uint32_t rx_udf: 1; - uint32_t tx_ovf: 1; - uint32_t rx_pf_valid: 1; - uint32_t ext_bit0: 1; - uint32_t ext_bit1: 1; - uint32_t ext_bit2: 1; - uint32_t ext_bit3: 1; - uint32_t wifi_rx_new_packet: 1; - uint32_t rd_retry: 1; - uint32_t bt_rx_new_packet: 1; - uint32_t reserved26: 6; - }; - uint32_t val; - } slc1_int_ena; - union { - struct { - uint32_t infor: 20; - uint32_t reserved20: 12; - }; - uint32_t val; - } slc0_rx_infor; - union { - struct { - uint32_t infor: 20; - uint32_t reserved20: 12; - }; - uint32_t val; - } slc1_rx_infor; - uint32_t slc0_len_wd; /**/ - uint32_t apbwin_wdata; /**/ - union { - struct { - uint32_t addr: 28; - uint32_t wr: 1; - uint32_t start: 1; - uint32_t reserved30: 2; - }; - uint32_t val; - } apbwin_conf; - uint32_t apbwin_rdata; /**/ - union { - struct { - uint32_t bit7_clraddr: 9; - uint32_t bit6_clraddr: 9; - uint32_t reserved18: 14; - }; - uint32_t val; - } slc0_rdclr; - union { - struct { - uint32_t bit7_clraddr: 9; - uint32_t bit6_clraddr: 9; - uint32_t reserved18: 14; - }; - uint32_t val; - } slc1_rdclr; - union { - struct { - uint32_t tohost_bit01: 1; - uint32_t tohost_bit11: 1; - uint32_t tohost_bit21: 1; - uint32_t tohost_bit31: 1; - uint32_t tohost_bit41: 1; - uint32_t tohost_bit51: 1; - uint32_t tohost_bit61: 1; - uint32_t tohost_bit71: 1; - uint32_t token0_1to01: 1; - uint32_t token1_1to01: 1; - uint32_t token0_0to11: 1; - uint32_t token1_0to11: 1; - uint32_t rx_sof1: 1; - uint32_t rx_eof1: 1; - uint32_t rx_start1: 1; - uint32_t tx_start1: 1; - uint32_t rx_udf1: 1; - uint32_t tx_ovf1: 1; - uint32_t rx_pf_valid1: 1; - uint32_t ext_bit01: 1; - uint32_t ext_bit11: 1; - uint32_t ext_bit21: 1; - uint32_t ext_bit31: 1; - uint32_t rx_new_packet1: 1; - uint32_t rd_retry1: 1; - uint32_t gpio_sdio1: 1; - uint32_t reserved26: 6; - }; - uint32_t val; - } slc0_int_ena1; - union { - struct { - uint32_t tohost_bit01: 1; - uint32_t tohost_bit11: 1; - uint32_t tohost_bit21: 1; - uint32_t tohost_bit31: 1; - uint32_t tohost_bit41: 1; - uint32_t tohost_bit51: 1; - uint32_t tohost_bit61: 1; - uint32_t tohost_bit71: 1; - uint32_t token0_1to01: 1; - uint32_t token1_1to01: 1; - uint32_t token0_0to11: 1; - uint32_t token1_0to11: 1; - uint32_t rx_sof1: 1; - uint32_t rx_eof1: 1; - uint32_t rx_start1: 1; - uint32_t tx_start1: 1; - uint32_t rx_udf1: 1; - uint32_t tx_ovf1: 1; - uint32_t rx_pf_valid1: 1; - uint32_t ext_bit01: 1; - uint32_t ext_bit11: 1; - uint32_t ext_bit21: 1; - uint32_t ext_bit31: 1; - uint32_t wifi_rx_new_packet1: 1; - uint32_t rd_retry1: 1; - uint32_t bt_rx_new_packet1: 1; - uint32_t reserved26: 6; - }; - uint32_t val; - } slc1_int_ena1; - uint32_t reserved_11c; - uint32_t reserved_120; - uint32_t reserved_124; - uint32_t reserved_128; - uint32_t reserved_12c; - uint32_t reserved_130; - uint32_t reserved_134; - uint32_t reserved_138; - uint32_t reserved_13c; - uint32_t reserved_140; - uint32_t reserved_144; - uint32_t reserved_148; - uint32_t reserved_14c; - uint32_t reserved_150; - uint32_t reserved_154; - uint32_t reserved_158; - uint32_t reserved_15c; - uint32_t reserved_160; - uint32_t reserved_164; - uint32_t reserved_168; - uint32_t reserved_16c; - uint32_t reserved_170; - uint32_t reserved_174; - uint32_t date; /**/ - uint32_t id; /**/ - uint32_t reserved_180; - uint32_t reserved_184; - uint32_t reserved_188; - uint32_t reserved_18c; - uint32_t reserved_190; - uint32_t reserved_194; - uint32_t reserved_198; - uint32_t reserved_19c; - uint32_t reserved_1a0; - uint32_t reserved_1a4; - uint32_t reserved_1a8; - uint32_t reserved_1ac; - uint32_t reserved_1b0; - uint32_t reserved_1b4; - uint32_t reserved_1b8; - uint32_t reserved_1bc; - uint32_t reserved_1c0; - uint32_t reserved_1c4; - uint32_t reserved_1c8; - uint32_t reserved_1cc; - uint32_t reserved_1d0; - uint32_t reserved_1d4; - uint32_t reserved_1d8; - uint32_t reserved_1dc; - uint32_t reserved_1e0; - uint32_t reserved_1e4; - uint32_t reserved_1e8; - uint32_t reserved_1ec; - union { - struct { - uint32_t frc_sdio11: 5; - uint32_t frc_sdio20: 5; - uint32_t frc_neg_samp: 5; - uint32_t frc_pos_samp: 5; - uint32_t frc_quick_in: 5; - uint32_t sdio20_int_delay: 1; - uint32_t sdio_pad_pullup: 1; - uint32_t hspeed_con_en: 1; - uint32_t reserved28: 4; - }; - uint32_t val; - } conf; - union { - struct { - uint32_t sdio20_mode: 5; - uint32_t sdio_neg_samp: 5; - uint32_t sdio_quick_in: 5; - uint32_t reserved15: 17; - }; - uint32_t val; - } inf_st; -} host_dev_t; -extern host_dev_t HOST; - -#ifdef __cplusplus -} -#endif - -#endif /* _SOC_HOST_STRUCT_H_ */ diff --git a/tools/sdk/include/soc/soc/hwcrypto_reg.h b/tools/sdk/include/soc/soc/hwcrypto_reg.h deleted file mode 100644 index d0dfa748589..00000000000 --- a/tools/sdk/include/soc/soc/hwcrypto_reg.h +++ /dev/null @@ -1,68 +0,0 @@ -// 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. -#ifndef __HWCRYPTO_REG_H__ -#define __HWCRYPTO_REG_H__ - -#include "soc.h" - -/* registers for RSA acceleration via Multiple Precision Integer ops */ -#define RSA_MEM_M_BLOCK_BASE ((DR_REG_RSA_BASE)+0x000) -/* RB & Z use the same memory block, depending on phase of operation */ -#define RSA_MEM_RB_BLOCK_BASE ((DR_REG_RSA_BASE)+0x200) -#define RSA_MEM_Z_BLOCK_BASE ((DR_REG_RSA_BASE)+0x200) -#define RSA_MEM_Y_BLOCK_BASE ((DR_REG_RSA_BASE)+0x400) -#define RSA_MEM_X_BLOCK_BASE ((DR_REG_RSA_BASE)+0x600) - -#define RSA_M_DASH_REG (DR_REG_RSA_BASE + 0x800) -#define RSA_MODEXP_MODE_REG (DR_REG_RSA_BASE + 0x804) -#define RSA_START_MODEXP_REG (DR_REG_RSA_BASE + 0x808) -#define RSA_MULT_MODE_REG (DR_REG_RSA_BASE + 0x80c) -#define RSA_MULT_START_REG (DR_REG_RSA_BASE + 0x810) - -#define RSA_INTERRUPT_REG (DR_REG_RSA_BASE + 0x814) - -#define RSA_CLEAN_REG (DR_REG_RSA_BASE + 0x818) - -/* SHA acceleration registers */ -#define SHA_TEXT_BASE ((DR_REG_SHA_BASE) + 0x00) - -#define SHA_1_START_REG ((DR_REG_SHA_BASE) + 0x80) -#define SHA_1_CONTINUE_REG ((DR_REG_SHA_BASE) + 0x84) -#define SHA_1_LOAD_REG ((DR_REG_SHA_BASE) + 0x88) -#define SHA_1_BUSY_REG ((DR_REG_SHA_BASE) + 0x8c) - -#define SHA_256_START_REG ((DR_REG_SHA_BASE) + 0x90) -#define SHA_256_CONTINUE_REG ((DR_REG_SHA_BASE) + 0x94) -#define SHA_256_LOAD_REG ((DR_REG_SHA_BASE) + 0x98) -#define SHA_256_BUSY_REG ((DR_REG_SHA_BASE) + 0x9c) - -#define SHA_384_START_REG ((DR_REG_SHA_BASE) + 0xa0) -#define SHA_384_CONTINUE_REG ((DR_REG_SHA_BASE) + 0xa4) -#define SHA_384_LOAD_REG ((DR_REG_SHA_BASE) + 0xa8) -#define SHA_384_BUSY_REG ((DR_REG_SHA_BASE) + 0xac) - -#define SHA_512_START_REG ((DR_REG_SHA_BASE) + 0xb0) -#define SHA_512_CONTINUE_REG ((DR_REG_SHA_BASE) + 0xb4) -#define SHA_512_LOAD_REG ((DR_REG_SHA_BASE) + 0xb8) -#define SHA_512_BUSY_REG ((DR_REG_SHA_BASE) + 0xbc) - -/* AES acceleration registers */ -#define AES_START_REG ((DR_REG_AES_BASE) + 0x00) -#define AES_IDLE_REG ((DR_REG_AES_BASE) + 0x04) -#define AES_MODE_REG ((DR_REG_AES_BASE) + 0x08) -#define AES_KEY_BASE ((DR_REG_AES_BASE) + 0x10) -#define AES_TEXT_BASE ((DR_REG_AES_BASE) + 0x30) -#define AES_ENDIAN ((DR_REG_AES_BASE) + 0x40) - -#endif diff --git a/tools/sdk/include/soc/soc/i2c_reg.h b/tools/sdk/include/soc/soc/i2c_reg.h deleted file mode 100644 index 292695eb7f3..00000000000 --- a/tools/sdk/include/soc/soc/i2c_reg.h +++ /dev/null @@ -1,951 +0,0 @@ -// 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. -#ifndef _SOC_I2C_REG_H_ -#define _SOC_I2C_REG_H_ - - -#include "soc.h" - -#define REG_I2C_BASE(i) (DR_REG_I2C_EXT_BASE + (i) * 0x14000 ) - -#define I2C_SCL_LOW_PERIOD_REG(i) (REG_I2C_BASE(i) + 0x0000) -/* I2C_SCL_LOW_PERIOD : R/W ;bitpos:[13:0] ;default: 14'b0 ; */ -/*description: This register is used to configure the low level width of SCL clock.*/ -#define I2C_SCL_LOW_PERIOD 0x00003FFF -#define I2C_SCL_LOW_PERIOD_M ((I2C_SCL_LOW_PERIOD_V)<<(I2C_SCL_LOW_PERIOD_S)) -#define I2C_SCL_LOW_PERIOD_V 0x3FFF -#define I2C_SCL_LOW_PERIOD_S 0 - -#define I2C_CTR_REG(i) (REG_I2C_BASE(i) + 0x0004) -/* I2C_CLK_EN : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: This is the clock gating control bit for reading or writing registers.*/ -#define I2C_CLK_EN (BIT(8)) -#define I2C_CLK_EN_M (BIT(8)) -#define I2C_CLK_EN_V 0x1 -#define I2C_CLK_EN_S 8 -/* I2C_RX_LSB_FIRST : R/W ;bitpos:[7] ;default: 1'h0 ; */ -/*description: This bit is used to control the storage mode for received datas. - 1: receive data from most significant bit 0: receive data from least significant bit*/ -#define I2C_RX_LSB_FIRST (BIT(7)) -#define I2C_RX_LSB_FIRST_M (BIT(7)) -#define I2C_RX_LSB_FIRST_V 0x1 -#define I2C_RX_LSB_FIRST_S 7 -/* I2C_TX_LSB_FIRST : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: This bit is used to control the sending mode for data need to - be send. 1: receive data from most significant bit 0: receive data from least significant bit*/ -#define I2C_TX_LSB_FIRST (BIT(6)) -#define I2C_TX_LSB_FIRST_M (BIT(6)) -#define I2C_TX_LSB_FIRST_V 0x1 -#define I2C_TX_LSB_FIRST_S 6 -/* I2C_TRANS_START : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: Set this bit to start sending data in txfifo.*/ -#define I2C_TRANS_START (BIT(5)) -#define I2C_TRANS_START_M (BIT(5)) -#define I2C_TRANS_START_V 0x1 -#define I2C_TRANS_START_S 5 -/* I2C_MS_MODE : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: Set this bit to configure the module as i2c master clear this - bit to configure the module as i2c slave.*/ -#define I2C_MS_MODE (BIT(4)) -#define I2C_MS_MODE_M (BIT(4)) -#define I2C_MS_MODE_V 0x1 -#define I2C_MS_MODE_S 4 -/* I2C_SAMPLE_SCL_LEVEL : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: Set this bit to sample data in SCL low level. clear this bit - to sample data in SCL high level.*/ -#define I2C_SAMPLE_SCL_LEVEL (BIT(2)) -#define I2C_SAMPLE_SCL_LEVEL_M (BIT(2)) -#define I2C_SAMPLE_SCL_LEVEL_V 0x1 -#define I2C_SAMPLE_SCL_LEVEL_S 2 -/* I2C_SCL_FORCE_OUT : R/W ;bitpos:[1] ;default: 1'b1 ; */ -/*description: 1: normally ouput scl clock 0: exchange the function of scl_o - and scl_oe (scl_o is the original internal output scl signal scl_oe is the enable bit for the internal output scl signal)*/ -#define I2C_SCL_FORCE_OUT (BIT(1)) -#define I2C_SCL_FORCE_OUT_M (BIT(1)) -#define I2C_SCL_FORCE_OUT_V 0x1 -#define I2C_SCL_FORCE_OUT_S 1 -/* I2C_SDA_FORCE_OUT : R/W ;bitpos:[0] ;default: 1'b1 ; */ -/*description: 1: normally ouput sda data 0: exchange the function of sda_o - and sda_oe (sda_o is the original internal output sda signal sda_oe is the enable bit for the internal output sda signal)*/ -#define I2C_SDA_FORCE_OUT (BIT(0)) -#define I2C_SDA_FORCE_OUT_M (BIT(0)) -#define I2C_SDA_FORCE_OUT_V 0x1 -#define I2C_SDA_FORCE_OUT_S 0 - -#define I2C_SR_REG(i) (REG_I2C_BASE(i) + 0x0008) -/* I2C_SCL_STATE_LAST : RO ;bitpos:[30:28] ;default: 3'b0 ; */ -/*description: This register stores the value of state machine to produce SCL. - 3'h0: SCL_IDLE 3'h1:SCL_START 3'h2:SCL_LOW_EDGE 3'h3: SCL_LOW 3'h4:SCL_HIGH_EDGE 3'h5:SCL_HIGH 3'h6:SCL_STOP*/ -#define I2C_SCL_STATE_LAST 0x00000007 -#define I2C_SCL_STATE_LAST_M ((I2C_SCL_STATE_LAST_V)<<(I2C_SCL_STATE_LAST_S)) -#define I2C_SCL_STATE_LAST_V 0x7 -#define I2C_SCL_STATE_LAST_S 28 -/* I2C_SCL_MAIN_STATE_LAST : RO ;bitpos:[26:24] ;default: 3'b0 ; */ -/*description: This register stores the value of state machine for i2c module. - 3'h0: SCL_MAIN_IDLE 3'h1: SCL_ADDRESS_SHIFT 3'h2: SCL_ACK_ADDRESS 3'h3: SCL_RX_DATA 3'h4 SCL_TX_DATA 3'h5:SCL_SEND_ACK 3'h6:SCL_WAIT_ACK*/ -#define I2C_SCL_MAIN_STATE_LAST 0x00000007 -#define I2C_SCL_MAIN_STATE_LAST_M ((I2C_SCL_MAIN_STATE_LAST_V)<<(I2C_SCL_MAIN_STATE_LAST_S)) -#define I2C_SCL_MAIN_STATE_LAST_V 0x7 -#define I2C_SCL_MAIN_STATE_LAST_S 24 -/* I2C_TXFIFO_CNT : RO ;bitpos:[23:18] ;default: 6'b0 ; */ -/*description: This register stores the amount of received data in ram.*/ -#define I2C_TXFIFO_CNT 0x0000003F -#define I2C_TXFIFO_CNT_M ((I2C_TXFIFO_CNT_V)<<(I2C_TXFIFO_CNT_S)) -#define I2C_TXFIFO_CNT_V 0x3F -#define I2C_TXFIFO_CNT_S 18 -/* I2C_RXFIFO_CNT : RO ;bitpos:[13:8] ;default: 6'b0 ; */ -/*description: This register represent the amount of data need to send.*/ -#define I2C_RXFIFO_CNT 0x0000003F -#define I2C_RXFIFO_CNT_M ((I2C_RXFIFO_CNT_V)<<(I2C_RXFIFO_CNT_S)) -#define I2C_RXFIFO_CNT_V 0x3F -#define I2C_RXFIFO_CNT_S 8 -/* I2C_BYTE_TRANS : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: This register changes to high level when one byte is transferred.*/ -#define I2C_BYTE_TRANS (BIT(6)) -#define I2C_BYTE_TRANS_M (BIT(6)) -#define I2C_BYTE_TRANS_V 0x1 -#define I2C_BYTE_TRANS_S 6 -/* I2C_SLAVE_ADDRESSED : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: when configured as i2c slave and the address send by master - is equal to slave's address then this bit will be high level.*/ -#define I2C_SLAVE_ADDRESSED (BIT(5)) -#define I2C_SLAVE_ADDRESSED_M (BIT(5)) -#define I2C_SLAVE_ADDRESSED_V 0x1 -#define I2C_SLAVE_ADDRESSED_S 5 -/* I2C_BUS_BUSY : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: 1:I2C bus is busy transferring data. 0:I2C bus is in idle state.*/ -#define I2C_BUS_BUSY (BIT(4)) -#define I2C_BUS_BUSY_M (BIT(4)) -#define I2C_BUS_BUSY_V 0x1 -#define I2C_BUS_BUSY_S 4 -/* I2C_ARB_LOST : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: when I2C lost control of SDA line this register changes to high level.*/ -#define I2C_ARB_LOST (BIT(3)) -#define I2C_ARB_LOST_M (BIT(3)) -#define I2C_ARB_LOST_V 0x1 -#define I2C_ARB_LOST_S 3 -/* I2C_TIME_OUT : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: when I2C takes more than time_out_reg clocks to receive a data - then this register changes to high level.*/ -#define I2C_TIME_OUT (BIT(2)) -#define I2C_TIME_OUT_M (BIT(2)) -#define I2C_TIME_OUT_V 0x1 -#define I2C_TIME_OUT_S 2 -/* I2C_SLAVE_RW : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: when in slave mode 1: master read slave 0: master write slave.*/ -#define I2C_SLAVE_RW (BIT(1)) -#define I2C_SLAVE_RW_M (BIT(1)) -#define I2C_SLAVE_RW_V 0x1 -#define I2C_SLAVE_RW_S 1 -/* I2C_ACK_REC : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: This register stores the value of ACK bit.*/ -#define I2C_ACK_REC (BIT(0)) -#define I2C_ACK_REC_M (BIT(0)) -#define I2C_ACK_REC_V 0x1 -#define I2C_ACK_REC_S 0 - -#define I2C_TO_REG(i) (REG_I2C_BASE(i) + 0x000c) -/* I2C_TIME_OUT_REG : R/W ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: This register is used to configure the max clock number of receiving a data.*/ -#define I2C_TIME_OUT_REG 0x000FFFFF -#define I2C_TIME_OUT_REG_M ((I2C_TIME_OUT_REG_V)<<(I2C_TIME_OUT_REG_S)) -#define I2C_TIME_OUT_REG_V 0xFFFFF -#define I2C_TIME_OUT_REG_S 0 - -#define I2C_SLAVE_ADDR_REG(i) (REG_I2C_BASE(i) + 0x0010) -/* I2C_ADDR_10BIT_EN : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: This register is used to enable slave 10bit address mode.*/ -#define I2C_ADDR_10BIT_EN (BIT(31)) -#define I2C_ADDR_10BIT_EN_M (BIT(31)) -#define I2C_ADDR_10BIT_EN_V 0x1 -#define I2C_ADDR_10BIT_EN_S 31 -/* I2C_SLAVE_ADDR : R/W ;bitpos:[14:0] ;default: 15'b0 ; */ -/*description: when configured as i2c slave this register is used to configure - slave's address.*/ -#define I2C_SLAVE_ADDR 0x00007FFF -#define I2C_SLAVE_ADDR_M ((I2C_SLAVE_ADDR_V)<<(I2C_SLAVE_ADDR_S)) -#define I2C_SLAVE_ADDR_V 0x7FFF -#define I2C_SLAVE_ADDR_S 0 - -#define I2C_RXFIFO_ST_REG(i) (REG_I2C_BASE(i) + 0x0014) -/* I2C_TXFIFO_END_ADDR : RO ;bitpos:[19:15] ;default: 5'b0 ; */ -/*description: This is the offset address of the last sending data as described - in nonfifo_tx_thres register.*/ -#define I2C_TXFIFO_END_ADDR 0x0000001F -#define I2C_TXFIFO_END_ADDR_M ((I2C_TXFIFO_END_ADDR_V)<<(I2C_TXFIFO_END_ADDR_S)) -#define I2C_TXFIFO_END_ADDR_V 0x1F -#define I2C_TXFIFO_END_ADDR_S 15 -/* I2C_TXFIFO_START_ADDR : RO ;bitpos:[14:10] ;default: 5'b0 ; */ -/*description: This is the offset address of the first sending data as described - in nonfifo_tx_thres register.*/ -#define I2C_TXFIFO_START_ADDR 0x0000001F -#define I2C_TXFIFO_START_ADDR_M ((I2C_TXFIFO_START_ADDR_V)<<(I2C_TXFIFO_START_ADDR_S)) -#define I2C_TXFIFO_START_ADDR_V 0x1F -#define I2C_TXFIFO_START_ADDR_S 10 -/* I2C_RXFIFO_END_ADDR : RO ;bitpos:[9:5] ;default: 5'b0 ; */ -/*description: This is the offset address of the first receiving data as described - in nonfifo_rx_thres_register.*/ -#define I2C_RXFIFO_END_ADDR 0x0000001F -#define I2C_RXFIFO_END_ADDR_M ((I2C_RXFIFO_END_ADDR_V)<<(I2C_RXFIFO_END_ADDR_S)) -#define I2C_RXFIFO_END_ADDR_V 0x1F -#define I2C_RXFIFO_END_ADDR_S 5 -/* I2C_RXFIFO_START_ADDR : RO ;bitpos:[4:0] ;default: 5'b0 ; */ -/*description: This is the offset address of the last receiving data as described - in nonfifo_rx_thres_register.*/ -#define I2C_RXFIFO_START_ADDR 0x0000001F -#define I2C_RXFIFO_START_ADDR_M ((I2C_RXFIFO_START_ADDR_V)<<(I2C_RXFIFO_START_ADDR_S)) -#define I2C_RXFIFO_START_ADDR_V 0x1F -#define I2C_RXFIFO_START_ADDR_S 0 - -#define I2C_FIFO_CONF_REG(i) (REG_I2C_BASE(i) + 0x0018) -/* I2C_NONFIFO_TX_THRES : R/W ;bitpos:[25:20] ;default: 6'h15 ; */ -/*description: when I2C sends more than nonfifo_tx_thres data it will produce - tx_send_empty_int_raw interrupt and update the current offset address of the sending data.*/ -#define I2C_NONFIFO_TX_THRES 0x0000003F -#define I2C_NONFIFO_TX_THRES_M ((I2C_NONFIFO_TX_THRES_V)<<(I2C_NONFIFO_TX_THRES_S)) -#define I2C_NONFIFO_TX_THRES_V 0x3F -#define I2C_NONFIFO_TX_THRES_S 20 -/* I2C_NONFIFO_RX_THRES : R/W ;bitpos:[19:14] ;default: 6'h15 ; */ -/*description: when I2C receives more than nonfifo_rx_thres data it will produce - rx_send_full_int_raw interrupt and update the current offset address of the receiving data.*/ -#define I2C_NONFIFO_RX_THRES 0x0000003F -#define I2C_NONFIFO_RX_THRES_M ((I2C_NONFIFO_RX_THRES_V)<<(I2C_NONFIFO_RX_THRES_S)) -#define I2C_NONFIFO_RX_THRES_V 0x3F -#define I2C_NONFIFO_RX_THRES_S 14 -/* I2C_TX_FIFO_RST : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: Set this bit to reset tx fifo when using apb fifo access.*/ -#define I2C_TX_FIFO_RST (BIT(13)) -#define I2C_TX_FIFO_RST_M (BIT(13)) -#define I2C_TX_FIFO_RST_V 0x1 -#define I2C_TX_FIFO_RST_S 13 -/* I2C_RX_FIFO_RST : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: Set this bit to reset rx fifo when using apb fifo access.*/ -#define I2C_RX_FIFO_RST (BIT(12)) -#define I2C_RX_FIFO_RST_M (BIT(12)) -#define I2C_RX_FIFO_RST_V 0x1 -#define I2C_RX_FIFO_RST_S 12 -/* I2C_FIFO_ADDR_CFG_EN : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: When this bit is set to 1 then the byte after address represent - the offset address of I2C Slave's ram.*/ -#define I2C_FIFO_ADDR_CFG_EN (BIT(11)) -#define I2C_FIFO_ADDR_CFG_EN_M (BIT(11)) -#define I2C_FIFO_ADDR_CFG_EN_V 0x1 -#define I2C_FIFO_ADDR_CFG_EN_S 11 -/* I2C_NONFIFO_EN : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: Set this bit to enble apb nonfifo access.*/ -#define I2C_NONFIFO_EN (BIT(10)) -#define I2C_NONFIFO_EN_M (BIT(10)) -#define I2C_NONFIFO_EN_V 0x1 -#define I2C_NONFIFO_EN_S 10 -/* I2C_TXFIFO_EMPTY_THRHD : R/W ;bitpos:[9:5] ;default: 5'h4 ; */ -/*description: Config txfifo empty threhd value when using apb fifo access*/ -#define I2C_TXFIFO_EMPTY_THRHD 0x0000001F -#define I2C_TXFIFO_EMPTY_THRHD_M ((I2C_TXFIFO_EMPTY_THRHD_V)<<(I2C_TXFIFO_EMPTY_THRHD_S)) -#define I2C_TXFIFO_EMPTY_THRHD_V 0x1F -#define I2C_TXFIFO_EMPTY_THRHD_S 5 -/* I2C_RXFIFO_FULL_THRHD : R/W ;bitpos:[4:0] ;default: 5'hb ; */ -/*description: */ -#define I2C_RXFIFO_FULL_THRHD 0x0000001F -#define I2C_RXFIFO_FULL_THRHD_M ((I2C_RXFIFO_FULL_THRHD_V)<<(I2C_RXFIFO_FULL_THRHD_S)) -#define I2C_RXFIFO_FULL_THRHD_V 0x1F -#define I2C_RXFIFO_FULL_THRHD_S 0 - -#define I2C_DATA_APB_REG(i) (0x60013000 + (i) * 0x14000 + 0x001c) - -#define I2C_DATA_REG(i) (REG_I2C_BASE(i) + 0x001c) -/* I2C_FIFO_RDATA : RO ;bitpos:[7:0] ;default: 8'b0 ; */ -/*description: The register represent the byte data read from rxfifo when use apb fifo access*/ -#define I2C_FIFO_RDATA 0x000000FF -#define I2C_FIFO_RDATA_M ((I2C_FIFO_RDATA_V)<<(I2C_FIFO_RDATA_S)) -#define I2C_FIFO_RDATA_V 0xFF -#define I2C_FIFO_RDATA_S 0 - -#define I2C_INT_RAW_REG(i) (REG_I2C_BASE(i) + 0x0020) -/* I2C_TX_SEND_EMPTY_INT_RAW : RO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: The raw interrupt status bit for tx_send_empty_int interrupt.when - I2C sends more data than nonfifo_tx_thres it will produce tx_send_empty_int interrupt..*/ -#define I2C_TX_SEND_EMPTY_INT_RAW (BIT(12)) -#define I2C_TX_SEND_EMPTY_INT_RAW_M (BIT(12)) -#define I2C_TX_SEND_EMPTY_INT_RAW_V 0x1 -#define I2C_TX_SEND_EMPTY_INT_RAW_S 12 -/* I2C_RX_REC_FULL_INT_RAW : RO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: The raw interrupt status bit for rx_rec_full_int interrupt. when - I2C receives more data than nonfifo_rx_thres it will produce rx_rec_full_int interrupt.*/ -#define I2C_RX_REC_FULL_INT_RAW (BIT(11)) -#define I2C_RX_REC_FULL_INT_RAW_M (BIT(11)) -#define I2C_RX_REC_FULL_INT_RAW_V 0x1 -#define I2C_RX_REC_FULL_INT_RAW_S 11 -/* I2C_ACK_ERR_INT_RAW : RO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: The raw interrupt status bit for ack_err_int interrupt. when - I2C receives a wrong ACK bit it will produce ack_err_int interrupt..*/ -#define I2C_ACK_ERR_INT_RAW (BIT(10)) -#define I2C_ACK_ERR_INT_RAW_M (BIT(10)) -#define I2C_ACK_ERR_INT_RAW_V 0x1 -#define I2C_ACK_ERR_INT_RAW_S 10 -/* I2C_TRANS_START_INT_RAW : RO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: The raw interrupt status bit for trans_start_int interrupt. when - I2C sends the START bit it will produce trans_start_int interrupt.*/ -#define I2C_TRANS_START_INT_RAW (BIT(9)) -#define I2C_TRANS_START_INT_RAW_M (BIT(9)) -#define I2C_TRANS_START_INT_RAW_V 0x1 -#define I2C_TRANS_START_INT_RAW_S 9 -/* I2C_TIME_OUT_INT_RAW : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: The raw interrupt status bit for time_out_int interrupt. when - I2C takes a lot of time to receive a data it will produce time_out_int interrupt.*/ -#define I2C_TIME_OUT_INT_RAW (BIT(8)) -#define I2C_TIME_OUT_INT_RAW_M (BIT(8)) -#define I2C_TIME_OUT_INT_RAW_V 0x1 -#define I2C_TIME_OUT_INT_RAW_S 8 -/* I2C_TRANS_COMPLETE_INT_RAW : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: The raw interrupt status bit for trans_complete_int interrupt. - when I2C Master finished STOP command it will produce trans_complete_int interrupt.*/ -#define I2C_TRANS_COMPLETE_INT_RAW (BIT(7)) -#define I2C_TRANS_COMPLETE_INT_RAW_M (BIT(7)) -#define I2C_TRANS_COMPLETE_INT_RAW_V 0x1 -#define I2C_TRANS_COMPLETE_INT_RAW_S 7 -/* I2C_MASTER_TRAN_COMP_INT_RAW : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: The raw interrupt status bit for master_tra_comp_int interrupt. - when I2C Master sends or receives a byte it will produce master_tran_comp_int interrupt.*/ -#define I2C_MASTER_TRAN_COMP_INT_RAW (BIT(6)) -#define I2C_MASTER_TRAN_COMP_INT_RAW_M (BIT(6)) -#define I2C_MASTER_TRAN_COMP_INT_RAW_V 0x1 -#define I2C_MASTER_TRAN_COMP_INT_RAW_S 6 -/* I2C_ARBITRATION_LOST_INT_RAW : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: The raw interrupt status bit for arbitration_lost_int interrupt.when - I2C lost the usage right of I2C BUS it will produce arbitration_lost_int interrupt.*/ -#define I2C_ARBITRATION_LOST_INT_RAW (BIT(5)) -#define I2C_ARBITRATION_LOST_INT_RAW_M (BIT(5)) -#define I2C_ARBITRATION_LOST_INT_RAW_V 0x1 -#define I2C_ARBITRATION_LOST_INT_RAW_S 5 -/* I2C_SLAVE_TRAN_COMP_INT_RAW : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: The raw interrupt status bit for slave_tran_comp_int interrupt. - when I2C Slave detectsthe STOP bit it will produce slave_tran_comp_int interrupt.*/ -#define I2C_SLAVE_TRAN_COMP_INT_RAW (BIT(4)) -#define I2C_SLAVE_TRAN_COMP_INT_RAW_M (BIT(4)) -#define I2C_SLAVE_TRAN_COMP_INT_RAW_V 0x1 -#define I2C_SLAVE_TRAN_COMP_INT_RAW_S 4 -/* I2C_END_DETECT_INT_RAW : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: The raw interrupt status bit for end_detect_int interrupt. when - I2C deals with the END command it will produce end_detect_int interrupt.*/ -#define I2C_END_DETECT_INT_RAW (BIT(3)) -#define I2C_END_DETECT_INT_RAW_M (BIT(3)) -#define I2C_END_DETECT_INT_RAW_V 0x1 -#define I2C_END_DETECT_INT_RAW_S 3 -/* I2C_RXFIFO_OVF_INT_RAW : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: The raw interrupt status bit for receiving data overflow when - use apb fifo access.*/ -#define I2C_RXFIFO_OVF_INT_RAW (BIT(2)) -#define I2C_RXFIFO_OVF_INT_RAW_M (BIT(2)) -#define I2C_RXFIFO_OVF_INT_RAW_V 0x1 -#define I2C_RXFIFO_OVF_INT_RAW_S 2 -/* I2C_TXFIFO_EMPTY_INT_RAW : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: The raw interrupt status bit for txfifo empty when use apb fifo access.*/ -#define I2C_TXFIFO_EMPTY_INT_RAW (BIT(1)) -#define I2C_TXFIFO_EMPTY_INT_RAW_M (BIT(1)) -#define I2C_TXFIFO_EMPTY_INT_RAW_V 0x1 -#define I2C_TXFIFO_EMPTY_INT_RAW_S 1 -/* I2C_RXFIFO_FULL_INT_RAW : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: The raw interrupt status bit for rxfifo full when use apb fifo access.*/ -#define I2C_RXFIFO_FULL_INT_RAW (BIT(0)) -#define I2C_RXFIFO_FULL_INT_RAW_M (BIT(0)) -#define I2C_RXFIFO_FULL_INT_RAW_V 0x1 -#define I2C_RXFIFO_FULL_INT_RAW_S 0 - -#define I2C_INT_CLR_REG(i) (REG_I2C_BASE(i) + 0x0024) -/* I2C_TX_SEND_EMPTY_INT_CLR : WO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: Set this bit to clear the tx_send_empty_int interrupt.*/ -#define I2C_TX_SEND_EMPTY_INT_CLR (BIT(12)) -#define I2C_TX_SEND_EMPTY_INT_CLR_M (BIT(12)) -#define I2C_TX_SEND_EMPTY_INT_CLR_V 0x1 -#define I2C_TX_SEND_EMPTY_INT_CLR_S 12 -/* I2C_RX_REC_FULL_INT_CLR : WO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rx_rec_full_int interrupt.*/ -#define I2C_RX_REC_FULL_INT_CLR (BIT(11)) -#define I2C_RX_REC_FULL_INT_CLR_M (BIT(11)) -#define I2C_RX_REC_FULL_INT_CLR_V 0x1 -#define I2C_RX_REC_FULL_INT_CLR_S 11 -/* I2C_ACK_ERR_INT_CLR : WO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: Set this bit to clear the ack_err_int interrupt.*/ -#define I2C_ACK_ERR_INT_CLR (BIT(10)) -#define I2C_ACK_ERR_INT_CLR_M (BIT(10)) -#define I2C_ACK_ERR_INT_CLR_V 0x1 -#define I2C_ACK_ERR_INT_CLR_S 10 -/* I2C_TRANS_START_INT_CLR : WO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: Set this bit to clear the trans_start_int interrupt.*/ -#define I2C_TRANS_START_INT_CLR (BIT(9)) -#define I2C_TRANS_START_INT_CLR_M (BIT(9)) -#define I2C_TRANS_START_INT_CLR_V 0x1 -#define I2C_TRANS_START_INT_CLR_S 9 -/* I2C_TIME_OUT_INT_CLR : WO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: Set this bit to clear the time_out_int interrupt.*/ -#define I2C_TIME_OUT_INT_CLR (BIT(8)) -#define I2C_TIME_OUT_INT_CLR_M (BIT(8)) -#define I2C_TIME_OUT_INT_CLR_V 0x1 -#define I2C_TIME_OUT_INT_CLR_S 8 -/* I2C_TRANS_COMPLETE_INT_CLR : WO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: Set this bit to clear the trans_complete_int interrupt.*/ -#define I2C_TRANS_COMPLETE_INT_CLR (BIT(7)) -#define I2C_TRANS_COMPLETE_INT_CLR_M (BIT(7)) -#define I2C_TRANS_COMPLETE_INT_CLR_V 0x1 -#define I2C_TRANS_COMPLETE_INT_CLR_S 7 -/* I2C_MASTER_TRAN_COMP_INT_CLR : WO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: Set this bit to clear the master_tran_comp interrupt.*/ -#define I2C_MASTER_TRAN_COMP_INT_CLR (BIT(6)) -#define I2C_MASTER_TRAN_COMP_INT_CLR_M (BIT(6)) -#define I2C_MASTER_TRAN_COMP_INT_CLR_V 0x1 -#define I2C_MASTER_TRAN_COMP_INT_CLR_S 6 -/* I2C_ARBITRATION_LOST_INT_CLR : WO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: Set this bit to clear the arbitration_lost_int interrupt.*/ -#define I2C_ARBITRATION_LOST_INT_CLR (BIT(5)) -#define I2C_ARBITRATION_LOST_INT_CLR_M (BIT(5)) -#define I2C_ARBITRATION_LOST_INT_CLR_V 0x1 -#define I2C_ARBITRATION_LOST_INT_CLR_S 5 -/* I2C_SLAVE_TRAN_COMP_INT_CLR : WO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: Set this bit to clear the slave_tran_comp_int interrupt.*/ -#define I2C_SLAVE_TRAN_COMP_INT_CLR (BIT(4)) -#define I2C_SLAVE_TRAN_COMP_INT_CLR_M (BIT(4)) -#define I2C_SLAVE_TRAN_COMP_INT_CLR_V 0x1 -#define I2C_SLAVE_TRAN_COMP_INT_CLR_S 4 -/* I2C_END_DETECT_INT_CLR : WO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: Set this bit to clear the end_detect_int interrupt.*/ -#define I2C_END_DETECT_INT_CLR (BIT(3)) -#define I2C_END_DETECT_INT_CLR_M (BIT(3)) -#define I2C_END_DETECT_INT_CLR_V 0x1 -#define I2C_END_DETECT_INT_CLR_S 3 -/* I2C_RXFIFO_OVF_INT_CLR : WO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rxfifo_ovf_int interrupt.*/ -#define I2C_RXFIFO_OVF_INT_CLR (BIT(2)) -#define I2C_RXFIFO_OVF_INT_CLR_M (BIT(2)) -#define I2C_RXFIFO_OVF_INT_CLR_V 0x1 -#define I2C_RXFIFO_OVF_INT_CLR_S 2 -/* I2C_TXFIFO_EMPTY_INT_CLR : WO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: Set this bit to clear the txfifo_empty_int interrupt.*/ -#define I2C_TXFIFO_EMPTY_INT_CLR (BIT(1)) -#define I2C_TXFIFO_EMPTY_INT_CLR_M (BIT(1)) -#define I2C_TXFIFO_EMPTY_INT_CLR_V 0x1 -#define I2C_TXFIFO_EMPTY_INT_CLR_S 1 -/* I2C_RXFIFO_FULL_INT_CLR : WO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rxfifo_full_int interrupt.*/ -#define I2C_RXFIFO_FULL_INT_CLR (BIT(0)) -#define I2C_RXFIFO_FULL_INT_CLR_M (BIT(0)) -#define I2C_RXFIFO_FULL_INT_CLR_V 0x1 -#define I2C_RXFIFO_FULL_INT_CLR_S 0 - -#define I2C_INT_ENA_REG(i) (REG_I2C_BASE(i) + 0x0028) -/* I2C_TX_SEND_EMPTY_INT_ENA : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: The enable bit for tx_send_empty_int interrupt.*/ -#define I2C_TX_SEND_EMPTY_INT_ENA (BIT(12)) -#define I2C_TX_SEND_EMPTY_INT_ENA_M (BIT(12)) -#define I2C_TX_SEND_EMPTY_INT_ENA_V 0x1 -#define I2C_TX_SEND_EMPTY_INT_ENA_S 12 -/* I2C_RX_REC_FULL_INT_ENA : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: The enable bit for rx_rec_full_int interrupt.*/ -#define I2C_RX_REC_FULL_INT_ENA (BIT(11)) -#define I2C_RX_REC_FULL_INT_ENA_M (BIT(11)) -#define I2C_RX_REC_FULL_INT_ENA_V 0x1 -#define I2C_RX_REC_FULL_INT_ENA_S 11 -/* I2C_ACK_ERR_INT_ENA : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: The enable bit for ack_err_int interrupt.*/ -#define I2C_ACK_ERR_INT_ENA (BIT(10)) -#define I2C_ACK_ERR_INT_ENA_M (BIT(10)) -#define I2C_ACK_ERR_INT_ENA_V 0x1 -#define I2C_ACK_ERR_INT_ENA_S 10 -/* I2C_TRANS_START_INT_ENA : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: The enable bit for trans_start_int interrupt.*/ -#define I2C_TRANS_START_INT_ENA (BIT(9)) -#define I2C_TRANS_START_INT_ENA_M (BIT(9)) -#define I2C_TRANS_START_INT_ENA_V 0x1 -#define I2C_TRANS_START_INT_ENA_S 9 -/* I2C_TIME_OUT_INT_ENA : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: The enable bit for time_out_int interrupt.*/ -#define I2C_TIME_OUT_INT_ENA (BIT(8)) -#define I2C_TIME_OUT_INT_ENA_M (BIT(8)) -#define I2C_TIME_OUT_INT_ENA_V 0x1 -#define I2C_TIME_OUT_INT_ENA_S 8 -/* I2C_TRANS_COMPLETE_INT_ENA : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: The enable bit for trans_complete_int interrupt.*/ -#define I2C_TRANS_COMPLETE_INT_ENA (BIT(7)) -#define I2C_TRANS_COMPLETE_INT_ENA_M (BIT(7)) -#define I2C_TRANS_COMPLETE_INT_ENA_V 0x1 -#define I2C_TRANS_COMPLETE_INT_ENA_S 7 -/* I2C_MASTER_TRAN_COMP_INT_ENA : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: The enable bit for master_tran_comp_int interrupt.*/ -#define I2C_MASTER_TRAN_COMP_INT_ENA (BIT(6)) -#define I2C_MASTER_TRAN_COMP_INT_ENA_M (BIT(6)) -#define I2C_MASTER_TRAN_COMP_INT_ENA_V 0x1 -#define I2C_MASTER_TRAN_COMP_INT_ENA_S 6 -/* I2C_ARBITRATION_LOST_INT_ENA : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: The enable bit for arbitration_lost_int interrupt.*/ -#define I2C_ARBITRATION_LOST_INT_ENA (BIT(5)) -#define I2C_ARBITRATION_LOST_INT_ENA_M (BIT(5)) -#define I2C_ARBITRATION_LOST_INT_ENA_V 0x1 -#define I2C_ARBITRATION_LOST_INT_ENA_S 5 -/* I2C_SLAVE_TRAN_COMP_INT_ENA : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: The enable bit for slave_tran_comp_int interrupt.*/ -#define I2C_SLAVE_TRAN_COMP_INT_ENA (BIT(4)) -#define I2C_SLAVE_TRAN_COMP_INT_ENA_M (BIT(4)) -#define I2C_SLAVE_TRAN_COMP_INT_ENA_V 0x1 -#define I2C_SLAVE_TRAN_COMP_INT_ENA_S 4 -/* I2C_END_DETECT_INT_ENA : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: The enable bit for end_detect_int interrupt.*/ -#define I2C_END_DETECT_INT_ENA (BIT(3)) -#define I2C_END_DETECT_INT_ENA_M (BIT(3)) -#define I2C_END_DETECT_INT_ENA_V 0x1 -#define I2C_END_DETECT_INT_ENA_S 3 -/* I2C_RXFIFO_OVF_INT_ENA : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: The enable bit for rxfifo_ovf_int interrupt.*/ -#define I2C_RXFIFO_OVF_INT_ENA (BIT(2)) -#define I2C_RXFIFO_OVF_INT_ENA_M (BIT(2)) -#define I2C_RXFIFO_OVF_INT_ENA_V 0x1 -#define I2C_RXFIFO_OVF_INT_ENA_S 2 -/* I2C_TXFIFO_EMPTY_INT_ENA : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: The enable bit for txfifo_empty_int interrupt.*/ -#define I2C_TXFIFO_EMPTY_INT_ENA (BIT(1)) -#define I2C_TXFIFO_EMPTY_INT_ENA_M (BIT(1)) -#define I2C_TXFIFO_EMPTY_INT_ENA_V 0x1 -#define I2C_TXFIFO_EMPTY_INT_ENA_S 1 -/* I2C_RXFIFO_FULL_INT_ENA : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: The enable bit for rxfifo_full_int interrupt.*/ -#define I2C_RXFIFO_FULL_INT_ENA (BIT(0)) -#define I2C_RXFIFO_FULL_INT_ENA_M (BIT(0)) -#define I2C_RXFIFO_FULL_INT_ENA_V 0x1 -#define I2C_RXFIFO_FULL_INT_ENA_S 0 - -#define I2C_INT_STATUS_REG(i) (REG_I2C_BASE(i) + 0x002c) -/* I2C_TX_SEND_EMPTY_INT_ST : RO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: The masked interrupt status for tx_send_empty_int interrupt.*/ -#define I2C_TX_SEND_EMPTY_INT_ST (BIT(12)) -#define I2C_TX_SEND_EMPTY_INT_ST_M (BIT(12)) -#define I2C_TX_SEND_EMPTY_INT_ST_V 0x1 -#define I2C_TX_SEND_EMPTY_INT_ST_S 12 -/* I2C_RX_REC_FULL_INT_ST : RO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: The masked interrupt status for rx_rec_full_int interrupt.*/ -#define I2C_RX_REC_FULL_INT_ST (BIT(11)) -#define I2C_RX_REC_FULL_INT_ST_M (BIT(11)) -#define I2C_RX_REC_FULL_INT_ST_V 0x1 -#define I2C_RX_REC_FULL_INT_ST_S 11 -/* I2C_ACK_ERR_INT_ST : RO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: The masked interrupt status for ack_err_int interrupt.*/ -#define I2C_ACK_ERR_INT_ST (BIT(10)) -#define I2C_ACK_ERR_INT_ST_M (BIT(10)) -#define I2C_ACK_ERR_INT_ST_V 0x1 -#define I2C_ACK_ERR_INT_ST_S 10 -/* I2C_TRANS_START_INT_ST : RO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: The masked interrupt status for trans_start_int interrupt.*/ -#define I2C_TRANS_START_INT_ST (BIT(9)) -#define I2C_TRANS_START_INT_ST_M (BIT(9)) -#define I2C_TRANS_START_INT_ST_V 0x1 -#define I2C_TRANS_START_INT_ST_S 9 -/* I2C_TIME_OUT_INT_ST : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: The masked interrupt status for time_out_int interrupt.*/ -#define I2C_TIME_OUT_INT_ST (BIT(8)) -#define I2C_TIME_OUT_INT_ST_M (BIT(8)) -#define I2C_TIME_OUT_INT_ST_V 0x1 -#define I2C_TIME_OUT_INT_ST_S 8 -/* I2C_TRANS_COMPLETE_INT_ST : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: The masked interrupt status for trans_complete_int interrupt.*/ -#define I2C_TRANS_COMPLETE_INT_ST (BIT(7)) -#define I2C_TRANS_COMPLETE_INT_ST_M (BIT(7)) -#define I2C_TRANS_COMPLETE_INT_ST_V 0x1 -#define I2C_TRANS_COMPLETE_INT_ST_S 7 -/* I2C_MASTER_TRAN_COMP_INT_ST : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: The masked interrupt status for master_tran_comp_int interrupt.*/ -#define I2C_MASTER_TRAN_COMP_INT_ST (BIT(6)) -#define I2C_MASTER_TRAN_COMP_INT_ST_M (BIT(6)) -#define I2C_MASTER_TRAN_COMP_INT_ST_V 0x1 -#define I2C_MASTER_TRAN_COMP_INT_ST_S 6 -/* I2C_ARBITRATION_LOST_INT_ST : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: The masked interrupt status for arbitration_lost_int interrupt.*/ -#define I2C_ARBITRATION_LOST_INT_ST (BIT(5)) -#define I2C_ARBITRATION_LOST_INT_ST_M (BIT(5)) -#define I2C_ARBITRATION_LOST_INT_ST_V 0x1 -#define I2C_ARBITRATION_LOST_INT_ST_S 5 -/* I2C_SLAVE_TRAN_COMP_INT_ST : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: The masked interrupt status for slave_tran_comp_int interrupt.*/ -#define I2C_SLAVE_TRAN_COMP_INT_ST (BIT(4)) -#define I2C_SLAVE_TRAN_COMP_INT_ST_M (BIT(4)) -#define I2C_SLAVE_TRAN_COMP_INT_ST_V 0x1 -#define I2C_SLAVE_TRAN_COMP_INT_ST_S 4 -/* I2C_END_DETECT_INT_ST : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: The masked interrupt status for end_detect_int interrupt.*/ -#define I2C_END_DETECT_INT_ST (BIT(3)) -#define I2C_END_DETECT_INT_ST_M (BIT(3)) -#define I2C_END_DETECT_INT_ST_V 0x1 -#define I2C_END_DETECT_INT_ST_S 3 -/* I2C_RXFIFO_OVF_INT_ST : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: The masked interrupt status for rxfifo_ovf_int interrupt.*/ -#define I2C_RXFIFO_OVF_INT_ST (BIT(2)) -#define I2C_RXFIFO_OVF_INT_ST_M (BIT(2)) -#define I2C_RXFIFO_OVF_INT_ST_V 0x1 -#define I2C_RXFIFO_OVF_INT_ST_S 2 -/* I2C_TXFIFO_EMPTY_INT_ST : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: The masked interrupt status for txfifo_empty_int interrupt.*/ -#define I2C_TXFIFO_EMPTY_INT_ST (BIT(1)) -#define I2C_TXFIFO_EMPTY_INT_ST_M (BIT(1)) -#define I2C_TXFIFO_EMPTY_INT_ST_V 0x1 -#define I2C_TXFIFO_EMPTY_INT_ST_S 1 -/* I2C_RXFIFO_FULL_INT_ST : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: The masked interrupt status for rxfifo_full_int interrupt.*/ -#define I2C_RXFIFO_FULL_INT_ST (BIT(0)) -#define I2C_RXFIFO_FULL_INT_ST_M (BIT(0)) -#define I2C_RXFIFO_FULL_INT_ST_V 0x1 -#define I2C_RXFIFO_FULL_INT_ST_S 0 - -#define I2C_SDA_HOLD_REG(i) (REG_I2C_BASE(i) + 0x0030) -/* I2C_SDA_HOLD_TIME : R/W ;bitpos:[9:0] ;default: 10'b0 ; */ -/*description: This register is used to configure the clock num I2C used to - hold the data after the negedge of SCL.*/ -#define I2C_SDA_HOLD_TIME 0x000003FF -#define I2C_SDA_HOLD_TIME_M ((I2C_SDA_HOLD_TIME_V)<<(I2C_SDA_HOLD_TIME_S)) -#define I2C_SDA_HOLD_TIME_V 0x3FF -#define I2C_SDA_HOLD_TIME_S 0 - -#define I2C_SDA_SAMPLE_REG(i) (REG_I2C_BASE(i) + 0x0034) -/* I2C_SDA_SAMPLE_TIME : R/W ;bitpos:[9:0] ;default: 10'b0 ; */ -/*description: This register is used to configure the clock num I2C used to - sample data on SDA after the posedge of SCL*/ -#define I2C_SDA_SAMPLE_TIME 0x000003FF -#define I2C_SDA_SAMPLE_TIME_M ((I2C_SDA_SAMPLE_TIME_V)<<(I2C_SDA_SAMPLE_TIME_S)) -#define I2C_SDA_SAMPLE_TIME_V 0x3FF -#define I2C_SDA_SAMPLE_TIME_S 0 - -#define I2C_SCL_HIGH_PERIOD_REG(i) (REG_I2C_BASE(i) + 0x0038) -/* I2C_SCL_HIGH_PERIOD : R/W ;bitpos:[13:0] ;default: 14'b0 ; */ -/*description: This register is used to configure the clock num during SCL is low level.*/ -#define I2C_SCL_HIGH_PERIOD 0x00003FFF -#define I2C_SCL_HIGH_PERIOD_M ((I2C_SCL_HIGH_PERIOD_V)<<(I2C_SCL_HIGH_PERIOD_S)) -#define I2C_SCL_HIGH_PERIOD_V 0x3FFF -#define I2C_SCL_HIGH_PERIOD_S 0 - -#define I2C_SCL_START_HOLD_REG(i) (REG_I2C_BASE(i) + 0x0040) -/* I2C_SCL_START_HOLD_TIME : R/W ;bitpos:[9:0] ;default: 10'b1000 ; */ -/*description: This register is used to configure the clock num between the - negedge of SDA and negedge of SCL for start mark.*/ -#define I2C_SCL_START_HOLD_TIME 0x000003FF -#define I2C_SCL_START_HOLD_TIME_M ((I2C_SCL_START_HOLD_TIME_V)<<(I2C_SCL_START_HOLD_TIME_S)) -#define I2C_SCL_START_HOLD_TIME_V 0x3FF -#define I2C_SCL_START_HOLD_TIME_S 0 - -#define I2C_SCL_RSTART_SETUP_REG(i) (REG_I2C_BASE(i) + 0x0044) -/* I2C_SCL_RSTART_SETUP_TIME : R/W ;bitpos:[9:0] ;default: 10'b1000 ; */ -/*description: This register is used to configure the clock num between the - posedge of SCL and the negedge of SDA for restart mark.*/ -#define I2C_SCL_RSTART_SETUP_TIME 0x000003FF -#define I2C_SCL_RSTART_SETUP_TIME_M ((I2C_SCL_RSTART_SETUP_TIME_V)<<(I2C_SCL_RSTART_SETUP_TIME_S)) -#define I2C_SCL_RSTART_SETUP_TIME_V 0x3FF -#define I2C_SCL_RSTART_SETUP_TIME_S 0 - -#define I2C_SCL_STOP_HOLD_REG(i) (REG_I2C_BASE(i) + 0x0048) -/* I2C_SCL_STOP_HOLD_TIME : R/W ;bitpos:[13:0] ;default: 14'b0 ; */ -/*description: This register is used to configure the clock num after the STOP bit's posedge.*/ -#define I2C_SCL_STOP_HOLD_TIME 0x00003FFF -#define I2C_SCL_STOP_HOLD_TIME_M ((I2C_SCL_STOP_HOLD_TIME_V)<<(I2C_SCL_STOP_HOLD_TIME_S)) -#define I2C_SCL_STOP_HOLD_TIME_V 0x3FFF -#define I2C_SCL_STOP_HOLD_TIME_S 0 - -#define I2C_SCL_STOP_SETUP_REG(i) (REG_I2C_BASE(i) + 0x004C) -/* I2C_SCL_STOP_SETUP_TIME : R/W ;bitpos:[9:0] ;default: 10'b0 ; */ -/*description: This register is used to configure the clock num between the - posedge of SCL and the posedge of SDA.*/ -#define I2C_SCL_STOP_SETUP_TIME 0x000003FF -#define I2C_SCL_STOP_SETUP_TIME_M ((I2C_SCL_STOP_SETUP_TIME_V)<<(I2C_SCL_STOP_SETUP_TIME_S)) -#define I2C_SCL_STOP_SETUP_TIME_V 0x3FF -#define I2C_SCL_STOP_SETUP_TIME_S 0 - -#define I2C_SCL_FILTER_CFG_REG(i) (REG_I2C_BASE(i) + 0x0050) -/* I2C_SCL_FILTER_EN : R/W ;bitpos:[3] ;default: 1'b1 ; */ -/*description: This is the filter enable bit for SCL.*/ -#define I2C_SCL_FILTER_EN (BIT(3)) -#define I2C_SCL_FILTER_EN_M (BIT(3)) -#define I2C_SCL_FILTER_EN_V 0x1 -#define I2C_SCL_FILTER_EN_S 3 -/* I2C_SCL_FILTER_THRES : R/W ;bitpos:[2:0] ;default: 3'b0 ; */ -/*description: When input SCL's pulse width is smaller than this register value - I2C ignores this pulse.*/ -#define I2C_SCL_FILTER_THRES 0x00000007 -#define I2C_SCL_FILTER_THRES_M ((I2C_SCL_FILTER_THRES_V)<<(I2C_SCL_FILTER_THRES_S)) -#define I2C_SCL_FILTER_THRES_V 0x7 -#define I2C_SCL_FILTER_THRES_S 0 - -#define I2C_SDA_FILTER_CFG_REG(i) (REG_I2C_BASE(i) + 0x0054) -/* I2C_SDA_FILTER_EN : R/W ;bitpos:[3] ;default: 1'b1 ; */ -/*description: This is the filter enable bit for SDA.*/ -#define I2C_SDA_FILTER_EN (BIT(3)) -#define I2C_SDA_FILTER_EN_M (BIT(3)) -#define I2C_SDA_FILTER_EN_V 0x1 -#define I2C_SDA_FILTER_EN_S 3 -/* I2C_SDA_FILTER_THRES : R/W ;bitpos:[2:0] ;default: 3'b0 ; */ -/*description: When input SCL's pulse width is smaller than this register value - I2C ignores this pulse.*/ -#define I2C_SDA_FILTER_THRES 0x00000007 -#define I2C_SDA_FILTER_THRES_M ((I2C_SDA_FILTER_THRES_V)<<(I2C_SDA_FILTER_THRES_S)) -#define I2C_SDA_FILTER_THRES_V 0x7 -#define I2C_SDA_FILTER_THRES_S 0 - -#define I2C_COMD0_REG(i) (REG_I2C_BASE(i) + 0x0058) -/* I2C_COMMAND0_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When command0 is done in I2C Master mode this bit changes to high level.*/ -#define I2C_COMMAND0_DONE (BIT(31)) -#define I2C_COMMAND0_DONE_M (BIT(31)) -#define I2C_COMMAND0_DONE_V 0x1 -#define I2C_COMMAND0_DONE_S 31 -/* I2C_COMMAND0 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */ -/*description: This is the content of command0. It consists of three part. op_code - is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/ -#define I2C_COMMAND0 0x00003FFF -#define I2C_COMMAND0_M ((I2C_COMMAND0_V)<<(I2C_COMMAND0_S)) -#define I2C_COMMAND0_V 0x3FFF -#define I2C_COMMAND0_S 0 - -#define I2C_COMD1_REG(i) (REG_I2C_BASE(i) + 0x005C) -/* I2C_COMMAND1_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When command1 is done in I2C Master mode this bit changes to high level.*/ -#define I2C_COMMAND1_DONE (BIT(31)) -#define I2C_COMMAND1_DONE_M (BIT(31)) -#define I2C_COMMAND1_DONE_V 0x1 -#define I2C_COMMAND1_DONE_S 31 -/* I2C_COMMAND1 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */ -/*description: This is the content of command1. It consists of three part. op_code - is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/ -#define I2C_COMMAND1 0x00003FFF -#define I2C_COMMAND1_M ((I2C_COMMAND1_V)<<(I2C_COMMAND1_S)) -#define I2C_COMMAND1_V 0x3FFF -#define I2C_COMMAND1_S 0 - -#define I2C_COMD2_REG(i) (REG_I2C_BASE(i) + 0x0060) -/* I2C_COMMAND2_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When command2 is done in I2C Master mode this bit changes to high level.*/ -#define I2C_COMMAND2_DONE (BIT(31)) -#define I2C_COMMAND2_DONE_M (BIT(31)) -#define I2C_COMMAND2_DONE_V 0x1 -#define I2C_COMMAND2_DONE_S 31 -/* I2C_COMMAND2 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */ -/*description: This is the content of command2. It consists of three part. op_code - is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/ -#define I2C_COMMAND2 0x00003FFF -#define I2C_COMMAND2_M ((I2C_COMMAND2_V)<<(I2C_COMMAND2_S)) -#define I2C_COMMAND2_V 0x3FFF -#define I2C_COMMAND2_S 0 - -#define I2C_COMD3_REG(i) (REG_I2C_BASE(i) + 0x0064) -/* I2C_COMMAND3_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When command3 is done in I2C Master mode this bit changes to high level.*/ -#define I2C_COMMAND3_DONE (BIT(31)) -#define I2C_COMMAND3_DONE_M (BIT(31)) -#define I2C_COMMAND3_DONE_V 0x1 -#define I2C_COMMAND3_DONE_S 31 -/* I2C_COMMAND3 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */ -/*description: This is the content of command3. It consists of three part. op_code - is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/ -#define I2C_COMMAND3 0x00003FFF -#define I2C_COMMAND3_M ((I2C_COMMAND3_V)<<(I2C_COMMAND3_S)) -#define I2C_COMMAND3_V 0x3FFF -#define I2C_COMMAND3_S 0 - -#define I2C_COMD4_REG(i) (REG_I2C_BASE(i) + 0x0068) -/* I2C_COMMAND4_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When command4 is done in I2C Master mode this bit changes to high level.*/ -#define I2C_COMMAND4_DONE (BIT(31)) -#define I2C_COMMAND4_DONE_M (BIT(31)) -#define I2C_COMMAND4_DONE_V 0x1 -#define I2C_COMMAND4_DONE_S 31 -/* I2C_COMMAND4 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */ -/*description: This is the content of command4. It consists of three part. op_code - is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/ -#define I2C_COMMAND4 0x00003FFF -#define I2C_COMMAND4_M ((I2C_COMMAND4_V)<<(I2C_COMMAND4_S)) -#define I2C_COMMAND4_V 0x3FFF -#define I2C_COMMAND4_S 0 - -#define I2C_COMD5_REG(i) (REG_I2C_BASE(i) + 0x006C) -/* I2C_COMMAND5_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When command5 is done in I2C Master mode this bit changes to high level.*/ -#define I2C_COMMAND5_DONE (BIT(31)) -#define I2C_COMMAND5_DONE_M (BIT(31)) -#define I2C_COMMAND5_DONE_V 0x1 -#define I2C_COMMAND5_DONE_S 31 -/* I2C_COMMAND5 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */ -/*description: This is the content of command5. It consists of three part. op_code - is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/ -#define I2C_COMMAND5 0x00003FFF -#define I2C_COMMAND5_M ((I2C_COMMAND5_V)<<(I2C_COMMAND5_S)) -#define I2C_COMMAND5_V 0x3FFF -#define I2C_COMMAND5_S 0 - -#define I2C_COMD6_REG(i) (REG_I2C_BASE(i) + 0x0070) -/* I2C_COMMAND6_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When command6 is done in I2C Master mode this bit changes to high level.*/ -#define I2C_COMMAND6_DONE (BIT(31)) -#define I2C_COMMAND6_DONE_M (BIT(31)) -#define I2C_COMMAND6_DONE_V 0x1 -#define I2C_COMMAND6_DONE_S 31 -/* I2C_COMMAND6 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */ -/*description: This is the content of command6. It consists of three part. op_code - is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/ -#define I2C_COMMAND6 0x00003FFF -#define I2C_COMMAND6_M ((I2C_COMMAND6_V)<<(I2C_COMMAND6_S)) -#define I2C_COMMAND6_V 0x3FFF -#define I2C_COMMAND6_S 0 - -#define I2C_COMD7_REG(i) (REG_I2C_BASE(i) + 0x0074) -/* I2C_COMMAND7_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When command7 is done in I2C Master mode this bit changes to high level.*/ -#define I2C_COMMAND7_DONE (BIT(31)) -#define I2C_COMMAND7_DONE_M (BIT(31)) -#define I2C_COMMAND7_DONE_V 0x1 -#define I2C_COMMAND7_DONE_S 31 -/* I2C_COMMAND7 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */ -/*description: This is the content of command7. It consists of three part. op_code - is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/ -#define I2C_COMMAND7 0x00003FFF -#define I2C_COMMAND7_M ((I2C_COMMAND7_V)<<(I2C_COMMAND7_S)) -#define I2C_COMMAND7_V 0x3FFF -#define I2C_COMMAND7_S 0 - -#define I2C_COMD8_REG(i) (REG_I2C_BASE(i) + 0x0078) -/* I2C_COMMAND8_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When command8 is done in I2C Master mode this bit changes to high level.*/ -#define I2C_COMMAND8_DONE (BIT(31)) -#define I2C_COMMAND8_DONE_M (BIT(31)) -#define I2C_COMMAND8_DONE_V 0x1 -#define I2C_COMMAND8_DONE_S 31 -/* I2C_COMMAND8 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */ -/*description: This is the content of command8. It consists of three part. op_code - is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/ -#define I2C_COMMAND8 0x00003FFF -#define I2C_COMMAND8_M ((I2C_COMMAND8_V)<<(I2C_COMMAND8_S)) -#define I2C_COMMAND8_V 0x3FFF -#define I2C_COMMAND8_S 0 - -#define I2C_COMD9_REG(i) (REG_I2C_BASE(i) + 0x007C) -/* I2C_COMMAND9_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When command9 is done in I2C Master mode this bit changes to high level.*/ -#define I2C_COMMAND9_DONE (BIT(31)) -#define I2C_COMMAND9_DONE_M (BIT(31)) -#define I2C_COMMAND9_DONE_V 0x1 -#define I2C_COMMAND9_DONE_S 31 -/* I2C_COMMAND9 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */ -/*description: This is the content of command9. It consists of three part. op_code - is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/ -#define I2C_COMMAND9 0x00003FFF -#define I2C_COMMAND9_M ((I2C_COMMAND9_V)<<(I2C_COMMAND9_S)) -#define I2C_COMMAND9_V 0x3FFF -#define I2C_COMMAND9_S 0 - -#define I2C_COMD10_REG(i) (REG_I2C_BASE(i) + 0x0080) -/* I2C_COMMAND10_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When command10 is done in I2C Master mode this bit changes to high level.*/ -#define I2C_COMMAND10_DONE (BIT(31)) -#define I2C_COMMAND10_DONE_M (BIT(31)) -#define I2C_COMMAND10_DONE_V 0x1 -#define I2C_COMMAND10_DONE_S 31 -/* I2C_COMMAND10 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */ -/*description: This is the content of command10. It consists of three part. - op_code is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/ -#define I2C_COMMAND10 0x00003FFF -#define I2C_COMMAND10_M ((I2C_COMMAND10_V)<<(I2C_COMMAND10_S)) -#define I2C_COMMAND10_V 0x3FFF -#define I2C_COMMAND10_S 0 - -#define I2C_COMD11_REG(i) (REG_I2C_BASE(i) + 0x0084) -/* I2C_COMMAND11_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When command11 is done in I2C Master mode this bit changes to high level.*/ -#define I2C_COMMAND11_DONE (BIT(31)) -#define I2C_COMMAND11_DONE_M (BIT(31)) -#define I2C_COMMAND11_DONE_V 0x1 -#define I2C_COMMAND11_DONE_S 31 -/* I2C_COMMAND11 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */ -/*description: This is the content of command11. It consists of three part. - op_code is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/ -#define I2C_COMMAND11 0x00003FFF -#define I2C_COMMAND11_M ((I2C_COMMAND11_V)<<(I2C_COMMAND11_S)) -#define I2C_COMMAND11_V 0x3FFF -#define I2C_COMMAND11_S 0 - -#define I2C_COMD12_REG(i) (REG_I2C_BASE(i) + 0x0088) -/* I2C_COMMAND12_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When command12 is done in I2C Master mode this bit changes to high level.*/ -#define I2C_COMMAND12_DONE (BIT(31)) -#define I2C_COMMAND12_DONE_M (BIT(31)) -#define I2C_COMMAND12_DONE_V 0x1 -#define I2C_COMMAND12_DONE_S 31 -/* I2C_COMMAND12 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */ -/*description: This is the content of command12. It consists of three part. - op_code is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/ -#define I2C_COMMAND12 0x00003FFF -#define I2C_COMMAND12_M ((I2C_COMMAND12_V)<<(I2C_COMMAND12_S)) -#define I2C_COMMAND12_V 0x3FFF -#define I2C_COMMAND12_S 0 - -#define I2C_COMD13_REG(i) (REG_I2C_BASE(i) + 0x008C) -/* I2C_COMMAND13_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When command13 is done in I2C Master mode this bit changes to high level.*/ -#define I2C_COMMAND13_DONE (BIT(31)) -#define I2C_COMMAND13_DONE_M (BIT(31)) -#define I2C_COMMAND13_DONE_V 0x1 -#define I2C_COMMAND13_DONE_S 31 -/* I2C_COMMAND13 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */ -/*description: This is the content of command13. It consists of three part. - op_code is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/ -#define I2C_COMMAND13 0x00003FFF -#define I2C_COMMAND13_M ((I2C_COMMAND13_V)<<(I2C_COMMAND13_S)) -#define I2C_COMMAND13_V 0x3FFF -#define I2C_COMMAND13_S 0 - -#define I2C_COMD14_REG(i) (REG_I2C_BASE(i) + 0x0090) -/* I2C_COMMAND14_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When command14 is done in I2C Master mode this bit changes to high level.*/ -#define I2C_COMMAND14_DONE (BIT(31)) -#define I2C_COMMAND14_DONE_M (BIT(31)) -#define I2C_COMMAND14_DONE_V 0x1 -#define I2C_COMMAND14_DONE_S 31 -/* I2C_COMMAND14 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */ -/*description: This is the content of command14. It consists of three part. - op_code is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/ -#define I2C_COMMAND14 0x00003FFF -#define I2C_COMMAND14_M ((I2C_COMMAND14_V)<<(I2C_COMMAND14_S)) -#define I2C_COMMAND14_V 0x3FFF -#define I2C_COMMAND14_S 0 - -#define I2C_COMD15_REG(i) (REG_I2C_BASE(i) + 0x0094) -/* I2C_COMMAND15_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When command15 is done in I2C Master mode this bit changes to high level.*/ -#define I2C_COMMAND15_DONE (BIT(31)) -#define I2C_COMMAND15_DONE_M (BIT(31)) -#define I2C_COMMAND15_DONE_V 0x1 -#define I2C_COMMAND15_DONE_S 31 -/* I2C_COMMAND15 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */ -/*description: This is the content of command15. It consists of three part. - op_code is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/ -#define I2C_COMMAND15 0x00003FFF -#define I2C_COMMAND15_M ((I2C_COMMAND15_V)<<(I2C_COMMAND15_S)) -#define I2C_COMMAND15_V 0x3FFF -#define I2C_COMMAND15_S 0 - -#define I2C_DATE_REG(i) (REG_I2C_BASE(i) + 0x00F8) -/* I2C_DATE : R/W ;bitpos:[31:0] ;default: 32'h16042000 ; */ -/*description: */ -#define I2C_DATE 0xFFFFFFFF -#define I2C_DATE_M ((I2C_DATE_V)<<(I2C_DATE_S)) -#define I2C_DATE_V 0xFFFFFFFF -#define I2C_DATE_S 0 - -#define I2C_FIFO_START_ADDR_REG(i) (REG_I2C_BASE(i) + 0x0100) - - - - -#endif /*_SOC_I2C_REG_H_ */ - - diff --git a/tools/sdk/include/soc/soc/i2c_struct.h b/tools/sdk/include/soc/soc/i2c_struct.h deleted file mode 100644 index 7e7818700e3..00000000000 --- a/tools/sdk/include/soc/soc/i2c_struct.h +++ /dev/null @@ -1,299 +0,0 @@ -// 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. -#ifndef _SOC_I2C_STRUCT_H_ -#define _SOC_I2C_STRUCT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef volatile struct { - union { - struct { - uint32_t period:14; /*This register is used to configure the low level width of SCL clock.*/ - uint32_t reserved14: 18; - }; - uint32_t val; - } scl_low_period; - union { - struct { - uint32_t sda_force_out: 1; /*1:normally output sda data 0: exchange the function of sda_o and sda_oe (sda_o is the original internal output sda signal sda_oe is the enable bit for the internal output sda signal)*/ - uint32_t scl_force_out: 1; /*1:normally output scl clock 0: exchange the function of scl_o and scl_oe (scl_o is the original internal output scl signal scl_oe is the enable bit for the internal output scl signal)*/ - uint32_t sample_scl_level: 1; /*Set this bit to sample data in SCL low level. clear this bit to sample data in SCL high level.*/ - uint32_t reserved3: 1; - uint32_t ms_mode: 1; /*Set this bit to configure the module as i2c master clear this bit to configure the module as i2c slave.*/ - uint32_t trans_start: 1; /*Set this bit to start sending data in tx_fifo.*/ - uint32_t tx_lsb_first: 1; /*This bit is used to control the sending mode for data need to be send. 1:receive data from most significant bit 0:receive data from least significant bit*/ - uint32_t rx_lsb_first: 1; /*This bit is used to control the storage mode for received data. 1:receive data from most significant bit 0:receive data from least significant bit*/ - uint32_t clk_en: 1; /*This is the clock gating control bit for reading or writing registers.*/ - uint32_t reserved9: 23; - }; - uint32_t val; - } ctr; - union { - struct { - uint32_t ack_rec: 1; /*This register stores the value of ACK bit.*/ - uint32_t slave_rw: 1; /*when in slave mode 1:master read slave 0: master write slave.*/ - uint32_t time_out: 1; /*when I2C takes more than time_out_reg clocks to receive a data then this register changes to high level.*/ - uint32_t arb_lost: 1; /*when I2C lost control of SDA line this register changes to high level.*/ - uint32_t bus_busy: 1; /*1:I2C bus is busy transferring data. 0:I2C bus is in idle state.*/ - uint32_t slave_addressed: 1; /*when configured as i2c slave and the address send by master is equal to slave's address then this bit will be high level.*/ - uint32_t byte_trans: 1; /*This register changes to high level when one byte is transferred.*/ - uint32_t reserved7: 1; - uint32_t rx_fifo_cnt: 6; /*This register represent the amount of data need to send.*/ - uint32_t reserved14: 4; - uint32_t tx_fifo_cnt: 6; /*This register stores the amount of received data in ram.*/ - uint32_t scl_main_state_last: 3; /*This register stores the value of state machine for i2c module. 3'h0: SCL_MAIN_IDLE 3'h1: SCL_ADDRESS_SHIFT 3'h2: SCL_ACK_ADDRESS 3'h3: SCL_RX_DATA 3'h4 SCL_TX_DATA 3'h5:SCL_SEND_ACK 3'h6:SCL_WAIT_ACK*/ - uint32_t reserved27: 1; - uint32_t scl_state_last: 3; /*This register stores the value of state machine to produce SCL. 3'h0: SCL_IDLE 3'h1:SCL_START 3'h2:SCL_LOW_EDGE 3'h3: SCL_LOW 3'h4:SCL_HIGH_EDGE 3'h5:SCL_HIGH 3'h6:SCL_STOP*/ - uint32_t reserved31: 1; - }; - uint32_t val; - } status_reg; - union { - struct { - uint32_t tout: 20; /*This register is used to configure the max clock number of receiving a data, unit: APB clock cycle.*/ - uint32_t reserved20:12; - }; - uint32_t val; - } timeout; - union { - struct { - uint32_t addr: 15; /*when configured as i2c slave this register is used to configure slave's address.*/ - uint32_t reserved15: 16; - uint32_t en_10bit: 1; /*This register is used to enable slave 10bit address mode.*/ - }; - uint32_t val; - } slave_addr; - union { - struct { - uint32_t rx_fifo_start_addr: 5; /*This is the offset address of the last receiving data as described in nonfifo_rx_thres_register.*/ - uint32_t rx_fifo_end_addr: 5; /*This is the offset address of the first receiving data as described in nonfifo_rx_thres_register.*/ - uint32_t tx_fifo_start_addr: 5; /*This is the offset address of the first sending data as described in nonfifo_tx_thres register.*/ - uint32_t tx_fifo_end_addr: 5; /*This is the offset address of the last sending data as described in nonfifo_tx_thres register.*/ - uint32_t reserved20: 12; - }; - uint32_t val; - } fifo_st; - union { - struct { - uint32_t rx_fifo_full_thrhd: 5; - uint32_t tx_fifo_empty_thrhd:5; /*Config tx_fifo empty threhd value when using apb fifo access*/ - uint32_t nonfifo_en: 1; /*Set this bit to enble apb nonfifo access.*/ - uint32_t fifo_addr_cfg_en: 1; /*When this bit is set to 1 then the byte after address represent the offset address of I2C Slave's ram.*/ - uint32_t rx_fifo_rst: 1; /*Set this bit to reset rx fifo when using apb fifo access.*/ - uint32_t tx_fifo_rst: 1; /*Set this bit to reset tx fifo when using apb fifo access.*/ - uint32_t nonfifo_rx_thres: 6; /*when I2C receives more than nonfifo_rx_thres data it will produce rx_send_full_int_raw interrupt and update the current offset address of the receiving data.*/ - uint32_t nonfifo_tx_thres: 6; /*when I2C sends more than nonfifo_tx_thres data it will produce tx_send_empty_int_raw interrupt and update the current offset address of the sending data.*/ - uint32_t reserved26: 6; - }; - uint32_t val; - } fifo_conf; - union { - struct { - uint8_t data; /*The register represent the byte data read from rx_fifo when use apb fifo access*/ - uint8_t reserved[3]; - }; - uint32_t val; - } fifo_data; - union { - struct { - uint32_t rx_fifo_full: 1; /*The raw interrupt status bit for rx_fifo full when use apb fifo access.*/ - uint32_t tx_fifo_empty: 1; /*The raw interrupt status bit for tx_fifo empty when use apb fifo access.*/ - uint32_t rx_fifo_ovf: 1; /*The raw interrupt status bit for receiving data overflow when use apb fifo access.*/ - uint32_t end_detect: 1; /*The raw interrupt status bit for end_detect_int interrupt. when I2C deals with the END command it will produce end_detect_int interrupt.*/ - uint32_t slave_tran_comp: 1; /*The raw interrupt status bit for slave_tran_comp_int interrupt. when I2C Slave detects the STOP bit it will produce slave_tran_comp_int interrupt.*/ - uint32_t arbitration_lost: 1; /*The raw interrupt status bit for arbitration_lost_int interrupt.when I2C lost the usage right of I2C BUS it will produce arbitration_lost_int interrupt.*/ - uint32_t master_tran_comp: 1; /*The raw interrupt status bit for master_tra_comp_int interrupt. when I2C Master sends or receives a byte it will produce master_tran_comp_int interrupt.*/ - uint32_t trans_complete: 1; /*The raw interrupt status bit for trans_complete_int interrupt. when I2C Master finished STOP command it will produce trans_complete_int interrupt.*/ - uint32_t time_out: 1; /*The raw interrupt status bit for time_out_int interrupt. when I2C takes a lot of time to receive a data it will produce time_out_int interrupt.*/ - uint32_t trans_start: 1; /*The raw interrupt status bit for trans_start_int interrupt. when I2C sends the START bit it will produce trans_start_int interrupt.*/ - uint32_t ack_err: 1; /*The raw interrupt status bit for ack_err_int interrupt. when I2C receives a wrong ACK bit it will produce ack_err_int interrupt..*/ - uint32_t rx_rec_full: 1; /*The raw interrupt status bit for rx_rec_full_int interrupt. when I2C receives more data than nonfifo_rx_thres it will produce rx_rec_full_int interrupt.*/ - uint32_t tx_send_empty: 1; /*The raw interrupt status bit for tx_send_empty_int interrupt.when I2C sends more data than nonfifo_tx_thres it will produce tx_send_empty_int interrupt..*/ - uint32_t reserved13: 19; - }; - uint32_t val; - } int_raw; - union { - struct { - uint32_t rx_fifo_full: 1; /*Set this bit to clear the rx_fifo_full_int interrupt.*/ - uint32_t tx_fifo_empty: 1; /*Set this bit to clear the tx_fifo_empty_int interrupt.*/ - uint32_t rx_fifo_ovf: 1; /*Set this bit to clear the rx_fifo_ovf_int interrupt.*/ - uint32_t end_detect: 1; /*Set this bit to clear the end_detect_int interrupt.*/ - uint32_t slave_tran_comp: 1; /*Set this bit to clear the slave_tran_comp_int interrupt.*/ - uint32_t arbitration_lost: 1; /*Set this bit to clear the arbitration_lost_int interrupt.*/ - uint32_t master_tran_comp: 1; /*Set this bit to clear the master_tran_comp interrupt.*/ - uint32_t trans_complete: 1; /*Set this bit to clear the trans_complete_int interrupt.*/ - uint32_t time_out: 1; /*Set this bit to clear the time_out_int interrupt.*/ - uint32_t trans_start: 1; /*Set this bit to clear the trans_start_int interrupt.*/ - uint32_t ack_err: 1; /*Set this bit to clear the ack_err_int interrupt.*/ - uint32_t rx_rec_full: 1; /*Set this bit to clear the rx_rec_full_int interrupt.*/ - uint32_t tx_send_empty: 1; /*Set this bit to clear the tx_send_empty_int interrupt.*/ - uint32_t reserved13: 19; - }; - uint32_t val; - } int_clr; - union { - struct { - uint32_t rx_fifo_full: 1; /*The enable bit for rx_fifo_full_int interrupt.*/ - uint32_t tx_fifo_empty: 1; /*The enable bit for tx_fifo_empty_int interrupt.*/ - uint32_t rx_fifo_ovf: 1; /*The enable bit for rx_fifo_ovf_int interrupt.*/ - uint32_t end_detect: 1; /*The enable bit for end_detect_int interrupt.*/ - uint32_t slave_tran_comp: 1; /*The enable bit for slave_tran_comp_int interrupt.*/ - uint32_t arbitration_lost: 1; /*The enable bit for arbitration_lost_int interrupt.*/ - uint32_t master_tran_comp: 1; /*The enable bit for master_tran_comp_int interrupt.*/ - uint32_t trans_complete: 1; /*The enable bit for trans_complete_int interrupt.*/ - uint32_t time_out: 1; /*The enable bit for time_out_int interrupt.*/ - uint32_t trans_start: 1; /*The enable bit for trans_start_int interrupt.*/ - uint32_t ack_err: 1; /*The enable bit for ack_err_int interrupt.*/ - uint32_t rx_rec_full: 1; /*The enable bit for rx_rec_full_int interrupt.*/ - uint32_t tx_send_empty: 1; /*The enable bit for tx_send_empty_int interrupt.*/ - uint32_t reserved13: 19; - }; - uint32_t val; - } int_ena; - union { - struct { - uint32_t rx_fifo_full: 1; /*The masked interrupt status for rx_fifo_full_int interrupt.*/ - uint32_t tx_fifo_empty: 1; /*The masked interrupt status for tx_fifo_empty_int interrupt.*/ - uint32_t rx_fifo_ovf: 1; /*The masked interrupt status for rx_fifo_ovf_int interrupt.*/ - uint32_t end_detect: 1; /*The masked interrupt status for end_detect_int interrupt.*/ - uint32_t slave_tran_comp: 1; /*The masked interrupt status for slave_tran_comp_int interrupt.*/ - uint32_t arbitration_lost: 1; /*The masked interrupt status for arbitration_lost_int interrupt.*/ - uint32_t master_tran_comp: 1; /*The masked interrupt status for master_tran_comp_int interrupt.*/ - uint32_t trans_complete: 1; /*The masked interrupt status for trans_complete_int interrupt.*/ - uint32_t time_out: 1; /*The masked interrupt status for time_out_int interrupt.*/ - uint32_t trans_start: 1; /*The masked interrupt status for trans_start_int interrupt.*/ - uint32_t ack_err: 1; /*The masked interrupt status for ack_err_int interrupt.*/ - uint32_t rx_rec_full: 1; /*The masked interrupt status for rx_rec_full_int interrupt.*/ - uint32_t tx_send_empty: 1; /*The masked interrupt status for tx_send_empty_int interrupt.*/ - uint32_t reserved13: 19; - }; - uint32_t val; - } int_status; - union { - struct { - uint32_t time: 10; /*This register is used to configure the clock num I2C used to hold the data after the negedge of SCL.*/ - uint32_t reserved10: 22; - }; - uint32_t val; - } sda_hold; - union { - struct { - uint32_t time: 10; /*This register is used to configure the clock num I2C used to sample data on SDA after the posedge of SCL*/ - uint32_t reserved10: 22; - }; - uint32_t val; - } sda_sample; - union { - struct { - uint32_t period: 14; /*This register is used to configure the clock num during SCL is low level.*/ - uint32_t reserved14: 18; - }; - uint32_t val; - } scl_high_period; - uint32_t reserved_3c; - union { - struct { - uint32_t time: 10; /*This register is used to configure the clock num between the negedge of SDA and negedge of SCL for start mark.*/ - uint32_t reserved10: 22; - }; - uint32_t val; - } scl_start_hold; - union { - struct { - uint32_t time: 10; /*This register is used to configure the clock num between the posedge of SCL and the negedge of SDA for restart mark.*/ - uint32_t reserved10: 22; - }; - uint32_t val; - } scl_rstart_setup; - union { - struct { - uint32_t time: 14; /*This register is used to configure the clock num after the STOP bit's posedge.*/ - uint32_t reserved14: 18; - }; - uint32_t val; - } scl_stop_hold; - union { - struct { - uint32_t time: 10; /*This register is used to configure the clock num between the posedge of SCL and the posedge of SDA.*/ - uint32_t reserved10: 22; - }; - uint32_t val; - } scl_stop_setup; - union { - struct { - uint32_t thres: 3; /*When input SCL's pulse width is smaller than this register value I2C ignores this pulse.*/ - uint32_t en: 1; /*This is the filter enable bit for SCL.*/ - uint32_t reserved4: 28; - }; - uint32_t val; - } scl_filter_cfg; - union { - struct { - uint32_t thres: 3; /*When input SCL's pulse width is smaller than this register value I2C ignores this pulse.*/ - uint32_t en: 1; /*This is the filter enable bit for SDA.*/ - uint32_t reserved4: 28; - }; - uint32_t val; - } sda_filter_cfg; - union { - struct { - uint32_t byte_num: 8; /*Byte_num represent the number of data need to be send or data need to be received.*/ - uint32_t ack_en: 1; /*ack_check_en ack_exp and ack value are used to control the ack bit.*/ - uint32_t ack_exp: 1; /*ack_check_en ack_exp and ack value are used to control the ack bit.*/ - uint32_t ack_val: 1; /*ack_check_en ack_exp and ack value are used to control the ack bit.*/ - uint32_t op_code: 3; /*op_code is the command 0:RSTART 1:WRITE 2:READ 3:STOP . 4:END.*/ - uint32_t reserved14: 17; - uint32_t done: 1; /*When command0 is done in I2C Master mode this bit changes to high level.*/ - }; - uint32_t val; - } command[16]; - uint32_t reserved_98; - uint32_t reserved_9c; - uint32_t reserved_a0; - uint32_t reserved_a4; - uint32_t reserved_a8; - uint32_t reserved_ac; - uint32_t reserved_b0; - uint32_t reserved_b4; - uint32_t reserved_b8; - uint32_t reserved_bc; - uint32_t reserved_c0; - uint32_t reserved_c4; - uint32_t reserved_c8; - uint32_t reserved_cc; - uint32_t reserved_d0; - uint32_t reserved_d4; - uint32_t reserved_d8; - uint32_t reserved_dc; - uint32_t reserved_e0; - uint32_t reserved_e4; - uint32_t reserved_e8; - uint32_t reserved_ec; - uint32_t reserved_f0; - uint32_t reserved_f4; - uint32_t date; /**/ - uint32_t reserved_fc; - uint32_t ram_data[32]; /*This the start address for ram when use apb nonfifo access.*/ -} i2c_dev_t; -extern i2c_dev_t I2C0; -extern i2c_dev_t I2C1; - -#ifdef __cplusplus -} -#endif - -#endif /* _SOC_I2C_STRUCT_H_ */ diff --git a/tools/sdk/include/soc/soc/i2s_reg.h b/tools/sdk/include/soc/soc/i2s_reg.h deleted file mode 100644 index 3473c087cae..00000000000 --- a/tools/sdk/include/soc/soc/i2s_reg.h +++ /dev/null @@ -1,1527 +0,0 @@ -// 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. -#ifndef _SOC_I2S_REG_H_ -#define _SOC_I2S_REG_H_ - -#include "soc.h" - -#define REG_I2S_BASE( i ) ( DR_REG_I2S_BASE + ((i)*0x1E000)) - - -#define I2S_CONF_REG(i) (REG_I2S_BASE(i) + 0x0008) -/* I2S_SIG_LOOPBACK : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define I2S_SIG_LOOPBACK (BIT(18)) -#define I2S_SIG_LOOPBACK_M (BIT(18)) -#define I2S_SIG_LOOPBACK_V 0x1 -#define I2S_SIG_LOOPBACK_S 18 -/* I2S_RX_MSB_RIGHT : R/W ;bitpos:[17] ;default: 1'b1 ; */ -/*description: */ -#define I2S_RX_MSB_RIGHT (BIT(17)) -#define I2S_RX_MSB_RIGHT_M (BIT(17)) -#define I2S_RX_MSB_RIGHT_V 0x1 -#define I2S_RX_MSB_RIGHT_S 17 -/* I2S_TX_MSB_RIGHT : R/W ;bitpos:[16] ;default: 1'b1 ; */ -/*description: */ -#define I2S_TX_MSB_RIGHT (BIT(16)) -#define I2S_TX_MSB_RIGHT_M (BIT(16)) -#define I2S_TX_MSB_RIGHT_V 0x1 -#define I2S_TX_MSB_RIGHT_S 16 -/* I2S_RX_MONO : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define I2S_RX_MONO (BIT(15)) -#define I2S_RX_MONO_M (BIT(15)) -#define I2S_RX_MONO_V 0x1 -#define I2S_RX_MONO_S 15 -/* I2S_TX_MONO : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TX_MONO (BIT(14)) -#define I2S_TX_MONO_M (BIT(14)) -#define I2S_TX_MONO_V 0x1 -#define I2S_TX_MONO_S 14 -/* I2S_RX_SHORT_SYNC : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define I2S_RX_SHORT_SYNC (BIT(13)) -#define I2S_RX_SHORT_SYNC_M (BIT(13)) -#define I2S_RX_SHORT_SYNC_V 0x1 -#define I2S_RX_SHORT_SYNC_S 13 -/* I2S_TX_SHORT_SYNC : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TX_SHORT_SYNC (BIT(12)) -#define I2S_TX_SHORT_SYNC_M (BIT(12)) -#define I2S_TX_SHORT_SYNC_V 0x1 -#define I2S_TX_SHORT_SYNC_S 12 -/* I2S_RX_MSB_SHIFT : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define I2S_RX_MSB_SHIFT (BIT(11)) -#define I2S_RX_MSB_SHIFT_M (BIT(11)) -#define I2S_RX_MSB_SHIFT_V 0x1 -#define I2S_RX_MSB_SHIFT_S 11 -/* I2S_TX_MSB_SHIFT : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TX_MSB_SHIFT (BIT(10)) -#define I2S_TX_MSB_SHIFT_M (BIT(10)) -#define I2S_TX_MSB_SHIFT_V 0x1 -#define I2S_TX_MSB_SHIFT_S 10 -/* I2S_RX_RIGHT_FIRST : R/W ;bitpos:[9] ;default: 1'b1 ; */ -/*description: */ -#define I2S_RX_RIGHT_FIRST (BIT(9)) -#define I2S_RX_RIGHT_FIRST_M (BIT(9)) -#define I2S_RX_RIGHT_FIRST_V 0x1 -#define I2S_RX_RIGHT_FIRST_S 9 -/* I2S_TX_RIGHT_FIRST : R/W ;bitpos:[8] ;default: 1'b1 ; */ -/*description: */ -#define I2S_TX_RIGHT_FIRST (BIT(8)) -#define I2S_TX_RIGHT_FIRST_M (BIT(8)) -#define I2S_TX_RIGHT_FIRST_V 0x1 -#define I2S_TX_RIGHT_FIRST_S 8 -/* I2S_RX_SLAVE_MOD : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define I2S_RX_SLAVE_MOD (BIT(7)) -#define I2S_RX_SLAVE_MOD_M (BIT(7)) -#define I2S_RX_SLAVE_MOD_V 0x1 -#define I2S_RX_SLAVE_MOD_S 7 -/* I2S_TX_SLAVE_MOD : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TX_SLAVE_MOD (BIT(6)) -#define I2S_TX_SLAVE_MOD_M (BIT(6)) -#define I2S_TX_SLAVE_MOD_V 0x1 -#define I2S_TX_SLAVE_MOD_S 6 -/* I2S_RX_START : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define I2S_RX_START (BIT(5)) -#define I2S_RX_START_M (BIT(5)) -#define I2S_RX_START_V 0x1 -#define I2S_RX_START_S 5 -/* I2S_TX_START : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TX_START (BIT(4)) -#define I2S_TX_START_M (BIT(4)) -#define I2S_TX_START_V 0x1 -#define I2S_TX_START_S 4 -/* I2S_RX_FIFO_RESET : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define I2S_RX_FIFO_RESET (BIT(3)) -#define I2S_RX_FIFO_RESET_M (BIT(3)) -#define I2S_RX_FIFO_RESET_V 0x1 -#define I2S_RX_FIFO_RESET_S 3 -/* I2S_TX_FIFO_RESET : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TX_FIFO_RESET (BIT(2)) -#define I2S_TX_FIFO_RESET_M (BIT(2)) -#define I2S_TX_FIFO_RESET_V 0x1 -#define I2S_TX_FIFO_RESET_S 2 -/* I2S_RX_RESET : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define I2S_RX_RESET (BIT(1)) -#define I2S_RX_RESET_M (BIT(1)) -#define I2S_RX_RESET_V 0x1 -#define I2S_RX_RESET_S 1 -/* I2S_TX_RESET : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TX_RESET (BIT(0)) -#define I2S_TX_RESET_M (BIT(0)) -#define I2S_TX_RESET_V 0x1 -#define I2S_TX_RESET_S 0 - -#define I2S_INT_RAW_REG(i) (REG_I2S_BASE(i) + 0x000c) -/* I2S_OUT_TOTAL_EOF_INT_RAW : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define I2S_OUT_TOTAL_EOF_INT_RAW (BIT(16)) -#define I2S_OUT_TOTAL_EOF_INT_RAW_M (BIT(16)) -#define I2S_OUT_TOTAL_EOF_INT_RAW_V 0x1 -#define I2S_OUT_TOTAL_EOF_INT_RAW_S 16 -/* I2S_IN_DSCR_EMPTY_INT_RAW : RO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define I2S_IN_DSCR_EMPTY_INT_RAW (BIT(15)) -#define I2S_IN_DSCR_EMPTY_INT_RAW_M (BIT(15)) -#define I2S_IN_DSCR_EMPTY_INT_RAW_V 0x1 -#define I2S_IN_DSCR_EMPTY_INT_RAW_S 15 -/* I2S_OUT_DSCR_ERR_INT_RAW : RO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define I2S_OUT_DSCR_ERR_INT_RAW (BIT(14)) -#define I2S_OUT_DSCR_ERR_INT_RAW_M (BIT(14)) -#define I2S_OUT_DSCR_ERR_INT_RAW_V 0x1 -#define I2S_OUT_DSCR_ERR_INT_RAW_S 14 -/* I2S_IN_DSCR_ERR_INT_RAW : RO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define I2S_IN_DSCR_ERR_INT_RAW (BIT(13)) -#define I2S_IN_DSCR_ERR_INT_RAW_M (BIT(13)) -#define I2S_IN_DSCR_ERR_INT_RAW_V 0x1 -#define I2S_IN_DSCR_ERR_INT_RAW_S 13 -/* I2S_OUT_EOF_INT_RAW : RO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define I2S_OUT_EOF_INT_RAW (BIT(12)) -#define I2S_OUT_EOF_INT_RAW_M (BIT(12)) -#define I2S_OUT_EOF_INT_RAW_V 0x1 -#define I2S_OUT_EOF_INT_RAW_S 12 -/* I2S_OUT_DONE_INT_RAW : RO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define I2S_OUT_DONE_INT_RAW (BIT(11)) -#define I2S_OUT_DONE_INT_RAW_M (BIT(11)) -#define I2S_OUT_DONE_INT_RAW_V 0x1 -#define I2S_OUT_DONE_INT_RAW_S 11 -/* I2S_IN_ERR_EOF_INT_RAW : RO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define I2S_IN_ERR_EOF_INT_RAW (BIT(10)) -#define I2S_IN_ERR_EOF_INT_RAW_M (BIT(10)) -#define I2S_IN_ERR_EOF_INT_RAW_V 0x1 -#define I2S_IN_ERR_EOF_INT_RAW_S 10 -/* I2S_IN_SUC_EOF_INT_RAW : RO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define I2S_IN_SUC_EOF_INT_RAW (BIT(9)) -#define I2S_IN_SUC_EOF_INT_RAW_M (BIT(9)) -#define I2S_IN_SUC_EOF_INT_RAW_V 0x1 -#define I2S_IN_SUC_EOF_INT_RAW_S 9 -/* I2S_IN_DONE_INT_RAW : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define I2S_IN_DONE_INT_RAW (BIT(8)) -#define I2S_IN_DONE_INT_RAW_M (BIT(8)) -#define I2S_IN_DONE_INT_RAW_V 0x1 -#define I2S_IN_DONE_INT_RAW_S 8 -/* I2S_TX_HUNG_INT_RAW : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TX_HUNG_INT_RAW (BIT(7)) -#define I2S_TX_HUNG_INT_RAW_M (BIT(7)) -#define I2S_TX_HUNG_INT_RAW_V 0x1 -#define I2S_TX_HUNG_INT_RAW_S 7 -/* I2S_RX_HUNG_INT_RAW : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define I2S_RX_HUNG_INT_RAW (BIT(6)) -#define I2S_RX_HUNG_INT_RAW_M (BIT(6)) -#define I2S_RX_HUNG_INT_RAW_V 0x1 -#define I2S_RX_HUNG_INT_RAW_S 6 -/* I2S_TX_REMPTY_INT_RAW : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TX_REMPTY_INT_RAW (BIT(5)) -#define I2S_TX_REMPTY_INT_RAW_M (BIT(5)) -#define I2S_TX_REMPTY_INT_RAW_V 0x1 -#define I2S_TX_REMPTY_INT_RAW_S 5 -/* I2S_TX_WFULL_INT_RAW : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TX_WFULL_INT_RAW (BIT(4)) -#define I2S_TX_WFULL_INT_RAW_M (BIT(4)) -#define I2S_TX_WFULL_INT_RAW_V 0x1 -#define I2S_TX_WFULL_INT_RAW_S 4 -/* I2S_RX_REMPTY_INT_RAW : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define I2S_RX_REMPTY_INT_RAW (BIT(3)) -#define I2S_RX_REMPTY_INT_RAW_M (BIT(3)) -#define I2S_RX_REMPTY_INT_RAW_V 0x1 -#define I2S_RX_REMPTY_INT_RAW_S 3 -/* I2S_RX_WFULL_INT_RAW : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define I2S_RX_WFULL_INT_RAW (BIT(2)) -#define I2S_RX_WFULL_INT_RAW_M (BIT(2)) -#define I2S_RX_WFULL_INT_RAW_V 0x1 -#define I2S_RX_WFULL_INT_RAW_S 2 -/* I2S_TX_PUT_DATA_INT_RAW : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TX_PUT_DATA_INT_RAW (BIT(1)) -#define I2S_TX_PUT_DATA_INT_RAW_M (BIT(1)) -#define I2S_TX_PUT_DATA_INT_RAW_V 0x1 -#define I2S_TX_PUT_DATA_INT_RAW_S 1 -/* I2S_RX_TAKE_DATA_INT_RAW : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define I2S_RX_TAKE_DATA_INT_RAW (BIT(0)) -#define I2S_RX_TAKE_DATA_INT_RAW_M (BIT(0)) -#define I2S_RX_TAKE_DATA_INT_RAW_V 0x1 -#define I2S_RX_TAKE_DATA_INT_RAW_S 0 - -#define I2S_INT_ST_REG(i) (REG_I2S_BASE(i) + 0x0010) -/* I2S_OUT_TOTAL_EOF_INT_ST : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define I2S_OUT_TOTAL_EOF_INT_ST (BIT(16)) -#define I2S_OUT_TOTAL_EOF_INT_ST_M (BIT(16)) -#define I2S_OUT_TOTAL_EOF_INT_ST_V 0x1 -#define I2S_OUT_TOTAL_EOF_INT_ST_S 16 -/* I2S_IN_DSCR_EMPTY_INT_ST : RO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define I2S_IN_DSCR_EMPTY_INT_ST (BIT(15)) -#define I2S_IN_DSCR_EMPTY_INT_ST_M (BIT(15)) -#define I2S_IN_DSCR_EMPTY_INT_ST_V 0x1 -#define I2S_IN_DSCR_EMPTY_INT_ST_S 15 -/* I2S_OUT_DSCR_ERR_INT_ST : RO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define I2S_OUT_DSCR_ERR_INT_ST (BIT(14)) -#define I2S_OUT_DSCR_ERR_INT_ST_M (BIT(14)) -#define I2S_OUT_DSCR_ERR_INT_ST_V 0x1 -#define I2S_OUT_DSCR_ERR_INT_ST_S 14 -/* I2S_IN_DSCR_ERR_INT_ST : RO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define I2S_IN_DSCR_ERR_INT_ST (BIT(13)) -#define I2S_IN_DSCR_ERR_INT_ST_M (BIT(13)) -#define I2S_IN_DSCR_ERR_INT_ST_V 0x1 -#define I2S_IN_DSCR_ERR_INT_ST_S 13 -/* I2S_OUT_EOF_INT_ST : RO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define I2S_OUT_EOF_INT_ST (BIT(12)) -#define I2S_OUT_EOF_INT_ST_M (BIT(12)) -#define I2S_OUT_EOF_INT_ST_V 0x1 -#define I2S_OUT_EOF_INT_ST_S 12 -/* I2S_OUT_DONE_INT_ST : RO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define I2S_OUT_DONE_INT_ST (BIT(11)) -#define I2S_OUT_DONE_INT_ST_M (BIT(11)) -#define I2S_OUT_DONE_INT_ST_V 0x1 -#define I2S_OUT_DONE_INT_ST_S 11 -/* I2S_IN_ERR_EOF_INT_ST : RO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define I2S_IN_ERR_EOF_INT_ST (BIT(10)) -#define I2S_IN_ERR_EOF_INT_ST_M (BIT(10)) -#define I2S_IN_ERR_EOF_INT_ST_V 0x1 -#define I2S_IN_ERR_EOF_INT_ST_S 10 -/* I2S_IN_SUC_EOF_INT_ST : RO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define I2S_IN_SUC_EOF_INT_ST (BIT(9)) -#define I2S_IN_SUC_EOF_INT_ST_M (BIT(9)) -#define I2S_IN_SUC_EOF_INT_ST_V 0x1 -#define I2S_IN_SUC_EOF_INT_ST_S 9 -/* I2S_IN_DONE_INT_ST : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define I2S_IN_DONE_INT_ST (BIT(8)) -#define I2S_IN_DONE_INT_ST_M (BIT(8)) -#define I2S_IN_DONE_INT_ST_V 0x1 -#define I2S_IN_DONE_INT_ST_S 8 -/* I2S_TX_HUNG_INT_ST : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TX_HUNG_INT_ST (BIT(7)) -#define I2S_TX_HUNG_INT_ST_M (BIT(7)) -#define I2S_TX_HUNG_INT_ST_V 0x1 -#define I2S_TX_HUNG_INT_ST_S 7 -/* I2S_RX_HUNG_INT_ST : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define I2S_RX_HUNG_INT_ST (BIT(6)) -#define I2S_RX_HUNG_INT_ST_M (BIT(6)) -#define I2S_RX_HUNG_INT_ST_V 0x1 -#define I2S_RX_HUNG_INT_ST_S 6 -/* I2S_TX_REMPTY_INT_ST : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TX_REMPTY_INT_ST (BIT(5)) -#define I2S_TX_REMPTY_INT_ST_M (BIT(5)) -#define I2S_TX_REMPTY_INT_ST_V 0x1 -#define I2S_TX_REMPTY_INT_ST_S 5 -/* I2S_TX_WFULL_INT_ST : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TX_WFULL_INT_ST (BIT(4)) -#define I2S_TX_WFULL_INT_ST_M (BIT(4)) -#define I2S_TX_WFULL_INT_ST_V 0x1 -#define I2S_TX_WFULL_INT_ST_S 4 -/* I2S_RX_REMPTY_INT_ST : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define I2S_RX_REMPTY_INT_ST (BIT(3)) -#define I2S_RX_REMPTY_INT_ST_M (BIT(3)) -#define I2S_RX_REMPTY_INT_ST_V 0x1 -#define I2S_RX_REMPTY_INT_ST_S 3 -/* I2S_RX_WFULL_INT_ST : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define I2S_RX_WFULL_INT_ST (BIT(2)) -#define I2S_RX_WFULL_INT_ST_M (BIT(2)) -#define I2S_RX_WFULL_INT_ST_V 0x1 -#define I2S_RX_WFULL_INT_ST_S 2 -/* I2S_TX_PUT_DATA_INT_ST : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TX_PUT_DATA_INT_ST (BIT(1)) -#define I2S_TX_PUT_DATA_INT_ST_M (BIT(1)) -#define I2S_TX_PUT_DATA_INT_ST_V 0x1 -#define I2S_TX_PUT_DATA_INT_ST_S 1 -/* I2S_RX_TAKE_DATA_INT_ST : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define I2S_RX_TAKE_DATA_INT_ST (BIT(0)) -#define I2S_RX_TAKE_DATA_INT_ST_M (BIT(0)) -#define I2S_RX_TAKE_DATA_INT_ST_V 0x1 -#define I2S_RX_TAKE_DATA_INT_ST_S 0 - -#define I2S_INT_ENA_REG(i) (REG_I2S_BASE(i) + 0x0014) -/* I2S_OUT_TOTAL_EOF_INT_ENA : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define I2S_OUT_TOTAL_EOF_INT_ENA (BIT(16)) -#define I2S_OUT_TOTAL_EOF_INT_ENA_M (BIT(16)) -#define I2S_OUT_TOTAL_EOF_INT_ENA_V 0x1 -#define I2S_OUT_TOTAL_EOF_INT_ENA_S 16 -/* I2S_IN_DSCR_EMPTY_INT_ENA : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define I2S_IN_DSCR_EMPTY_INT_ENA (BIT(15)) -#define I2S_IN_DSCR_EMPTY_INT_ENA_M (BIT(15)) -#define I2S_IN_DSCR_EMPTY_INT_ENA_V 0x1 -#define I2S_IN_DSCR_EMPTY_INT_ENA_S 15 -/* I2S_OUT_DSCR_ERR_INT_ENA : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define I2S_OUT_DSCR_ERR_INT_ENA (BIT(14)) -#define I2S_OUT_DSCR_ERR_INT_ENA_M (BIT(14)) -#define I2S_OUT_DSCR_ERR_INT_ENA_V 0x1 -#define I2S_OUT_DSCR_ERR_INT_ENA_S 14 -/* I2S_IN_DSCR_ERR_INT_ENA : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define I2S_IN_DSCR_ERR_INT_ENA (BIT(13)) -#define I2S_IN_DSCR_ERR_INT_ENA_M (BIT(13)) -#define I2S_IN_DSCR_ERR_INT_ENA_V 0x1 -#define I2S_IN_DSCR_ERR_INT_ENA_S 13 -/* I2S_OUT_EOF_INT_ENA : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define I2S_OUT_EOF_INT_ENA (BIT(12)) -#define I2S_OUT_EOF_INT_ENA_M (BIT(12)) -#define I2S_OUT_EOF_INT_ENA_V 0x1 -#define I2S_OUT_EOF_INT_ENA_S 12 -/* I2S_OUT_DONE_INT_ENA : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define I2S_OUT_DONE_INT_ENA (BIT(11)) -#define I2S_OUT_DONE_INT_ENA_M (BIT(11)) -#define I2S_OUT_DONE_INT_ENA_V 0x1 -#define I2S_OUT_DONE_INT_ENA_S 11 -/* I2S_IN_ERR_EOF_INT_ENA : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define I2S_IN_ERR_EOF_INT_ENA (BIT(10)) -#define I2S_IN_ERR_EOF_INT_ENA_M (BIT(10)) -#define I2S_IN_ERR_EOF_INT_ENA_V 0x1 -#define I2S_IN_ERR_EOF_INT_ENA_S 10 -/* I2S_IN_SUC_EOF_INT_ENA : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define I2S_IN_SUC_EOF_INT_ENA (BIT(9)) -#define I2S_IN_SUC_EOF_INT_ENA_M (BIT(9)) -#define I2S_IN_SUC_EOF_INT_ENA_V 0x1 -#define I2S_IN_SUC_EOF_INT_ENA_S 9 -/* I2S_IN_DONE_INT_ENA : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define I2S_IN_DONE_INT_ENA (BIT(8)) -#define I2S_IN_DONE_INT_ENA_M (BIT(8)) -#define I2S_IN_DONE_INT_ENA_V 0x1 -#define I2S_IN_DONE_INT_ENA_S 8 -/* I2S_TX_HUNG_INT_ENA : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TX_HUNG_INT_ENA (BIT(7)) -#define I2S_TX_HUNG_INT_ENA_M (BIT(7)) -#define I2S_TX_HUNG_INT_ENA_V 0x1 -#define I2S_TX_HUNG_INT_ENA_S 7 -/* I2S_RX_HUNG_INT_ENA : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define I2S_RX_HUNG_INT_ENA (BIT(6)) -#define I2S_RX_HUNG_INT_ENA_M (BIT(6)) -#define I2S_RX_HUNG_INT_ENA_V 0x1 -#define I2S_RX_HUNG_INT_ENA_S 6 -/* I2S_TX_REMPTY_INT_ENA : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TX_REMPTY_INT_ENA (BIT(5)) -#define I2S_TX_REMPTY_INT_ENA_M (BIT(5)) -#define I2S_TX_REMPTY_INT_ENA_V 0x1 -#define I2S_TX_REMPTY_INT_ENA_S 5 -/* I2S_TX_WFULL_INT_ENA : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TX_WFULL_INT_ENA (BIT(4)) -#define I2S_TX_WFULL_INT_ENA_M (BIT(4)) -#define I2S_TX_WFULL_INT_ENA_V 0x1 -#define I2S_TX_WFULL_INT_ENA_S 4 -/* I2S_RX_REMPTY_INT_ENA : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define I2S_RX_REMPTY_INT_ENA (BIT(3)) -#define I2S_RX_REMPTY_INT_ENA_M (BIT(3)) -#define I2S_RX_REMPTY_INT_ENA_V 0x1 -#define I2S_RX_REMPTY_INT_ENA_S 3 -/* I2S_RX_WFULL_INT_ENA : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define I2S_RX_WFULL_INT_ENA (BIT(2)) -#define I2S_RX_WFULL_INT_ENA_M (BIT(2)) -#define I2S_RX_WFULL_INT_ENA_V 0x1 -#define I2S_RX_WFULL_INT_ENA_S 2 -/* I2S_TX_PUT_DATA_INT_ENA : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TX_PUT_DATA_INT_ENA (BIT(1)) -#define I2S_TX_PUT_DATA_INT_ENA_M (BIT(1)) -#define I2S_TX_PUT_DATA_INT_ENA_V 0x1 -#define I2S_TX_PUT_DATA_INT_ENA_S 1 -/* I2S_RX_TAKE_DATA_INT_ENA : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define I2S_RX_TAKE_DATA_INT_ENA (BIT(0)) -#define I2S_RX_TAKE_DATA_INT_ENA_M (BIT(0)) -#define I2S_RX_TAKE_DATA_INT_ENA_V 0x1 -#define I2S_RX_TAKE_DATA_INT_ENA_S 0 - -#define I2S_INT_CLR_REG(i) (REG_I2S_BASE(i) + 0x0018) -/* I2S_OUT_TOTAL_EOF_INT_CLR : WO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define I2S_OUT_TOTAL_EOF_INT_CLR (BIT(16)) -#define I2S_OUT_TOTAL_EOF_INT_CLR_M (BIT(16)) -#define I2S_OUT_TOTAL_EOF_INT_CLR_V 0x1 -#define I2S_OUT_TOTAL_EOF_INT_CLR_S 16 -/* I2S_IN_DSCR_EMPTY_INT_CLR : WO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define I2S_IN_DSCR_EMPTY_INT_CLR (BIT(15)) -#define I2S_IN_DSCR_EMPTY_INT_CLR_M (BIT(15)) -#define I2S_IN_DSCR_EMPTY_INT_CLR_V 0x1 -#define I2S_IN_DSCR_EMPTY_INT_CLR_S 15 -/* I2S_OUT_DSCR_ERR_INT_CLR : WO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define I2S_OUT_DSCR_ERR_INT_CLR (BIT(14)) -#define I2S_OUT_DSCR_ERR_INT_CLR_M (BIT(14)) -#define I2S_OUT_DSCR_ERR_INT_CLR_V 0x1 -#define I2S_OUT_DSCR_ERR_INT_CLR_S 14 -/* I2S_IN_DSCR_ERR_INT_CLR : WO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define I2S_IN_DSCR_ERR_INT_CLR (BIT(13)) -#define I2S_IN_DSCR_ERR_INT_CLR_M (BIT(13)) -#define I2S_IN_DSCR_ERR_INT_CLR_V 0x1 -#define I2S_IN_DSCR_ERR_INT_CLR_S 13 -/* I2S_OUT_EOF_INT_CLR : WO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define I2S_OUT_EOF_INT_CLR (BIT(12)) -#define I2S_OUT_EOF_INT_CLR_M (BIT(12)) -#define I2S_OUT_EOF_INT_CLR_V 0x1 -#define I2S_OUT_EOF_INT_CLR_S 12 -/* I2S_OUT_DONE_INT_CLR : WO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define I2S_OUT_DONE_INT_CLR (BIT(11)) -#define I2S_OUT_DONE_INT_CLR_M (BIT(11)) -#define I2S_OUT_DONE_INT_CLR_V 0x1 -#define I2S_OUT_DONE_INT_CLR_S 11 -/* I2S_IN_ERR_EOF_INT_CLR : WO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define I2S_IN_ERR_EOF_INT_CLR (BIT(10)) -#define I2S_IN_ERR_EOF_INT_CLR_M (BIT(10)) -#define I2S_IN_ERR_EOF_INT_CLR_V 0x1 -#define I2S_IN_ERR_EOF_INT_CLR_S 10 -/* I2S_IN_SUC_EOF_INT_CLR : WO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define I2S_IN_SUC_EOF_INT_CLR (BIT(9)) -#define I2S_IN_SUC_EOF_INT_CLR_M (BIT(9)) -#define I2S_IN_SUC_EOF_INT_CLR_V 0x1 -#define I2S_IN_SUC_EOF_INT_CLR_S 9 -/* I2S_IN_DONE_INT_CLR : WO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define I2S_IN_DONE_INT_CLR (BIT(8)) -#define I2S_IN_DONE_INT_CLR_M (BIT(8)) -#define I2S_IN_DONE_INT_CLR_V 0x1 -#define I2S_IN_DONE_INT_CLR_S 8 -/* I2S_TX_HUNG_INT_CLR : WO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TX_HUNG_INT_CLR (BIT(7)) -#define I2S_TX_HUNG_INT_CLR_M (BIT(7)) -#define I2S_TX_HUNG_INT_CLR_V 0x1 -#define I2S_TX_HUNG_INT_CLR_S 7 -/* I2S_RX_HUNG_INT_CLR : WO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define I2S_RX_HUNG_INT_CLR (BIT(6)) -#define I2S_RX_HUNG_INT_CLR_M (BIT(6)) -#define I2S_RX_HUNG_INT_CLR_V 0x1 -#define I2S_RX_HUNG_INT_CLR_S 6 -/* I2S_TX_REMPTY_INT_CLR : WO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TX_REMPTY_INT_CLR (BIT(5)) -#define I2S_TX_REMPTY_INT_CLR_M (BIT(5)) -#define I2S_TX_REMPTY_INT_CLR_V 0x1 -#define I2S_TX_REMPTY_INT_CLR_S 5 -/* I2S_TX_WFULL_INT_CLR : WO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TX_WFULL_INT_CLR (BIT(4)) -#define I2S_TX_WFULL_INT_CLR_M (BIT(4)) -#define I2S_TX_WFULL_INT_CLR_V 0x1 -#define I2S_TX_WFULL_INT_CLR_S 4 -/* I2S_RX_REMPTY_INT_CLR : WO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define I2S_RX_REMPTY_INT_CLR (BIT(3)) -#define I2S_RX_REMPTY_INT_CLR_M (BIT(3)) -#define I2S_RX_REMPTY_INT_CLR_V 0x1 -#define I2S_RX_REMPTY_INT_CLR_S 3 -/* I2S_RX_WFULL_INT_CLR : WO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define I2S_RX_WFULL_INT_CLR (BIT(2)) -#define I2S_RX_WFULL_INT_CLR_M (BIT(2)) -#define I2S_RX_WFULL_INT_CLR_V 0x1 -#define I2S_RX_WFULL_INT_CLR_S 2 -/* I2S_PUT_DATA_INT_CLR : WO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define I2S_PUT_DATA_INT_CLR (BIT(1)) -#define I2S_PUT_DATA_INT_CLR_M (BIT(1)) -#define I2S_PUT_DATA_INT_CLR_V 0x1 -#define I2S_PUT_DATA_INT_CLR_S 1 -/* I2S_TAKE_DATA_INT_CLR : WO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TAKE_DATA_INT_CLR (BIT(0)) -#define I2S_TAKE_DATA_INT_CLR_M (BIT(0)) -#define I2S_TAKE_DATA_INT_CLR_V 0x1 -#define I2S_TAKE_DATA_INT_CLR_S 0 - -#define I2S_TIMING_REG(i) (REG_I2S_BASE(i) + 0x001c) -/* I2S_TX_BCK_IN_INV : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TX_BCK_IN_INV (BIT(24)) -#define I2S_TX_BCK_IN_INV_M (BIT(24)) -#define I2S_TX_BCK_IN_INV_V 0x1 -#define I2S_TX_BCK_IN_INV_S 24 -/* I2S_DATA_ENABLE_DELAY : R/W ;bitpos:[23:22] ;default: 2'b0 ; */ -/*description: */ -#define I2S_DATA_ENABLE_DELAY 0x00000003 -#define I2S_DATA_ENABLE_DELAY_M ((I2S_DATA_ENABLE_DELAY_V)<<(I2S_DATA_ENABLE_DELAY_S)) -#define I2S_DATA_ENABLE_DELAY_V 0x3 -#define I2S_DATA_ENABLE_DELAY_S 22 -/* I2S_RX_DSYNC_SW : R/W ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define I2S_RX_DSYNC_SW (BIT(21)) -#define I2S_RX_DSYNC_SW_M (BIT(21)) -#define I2S_RX_DSYNC_SW_V 0x1 -#define I2S_RX_DSYNC_SW_S 21 -/* I2S_TX_DSYNC_SW : R/W ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TX_DSYNC_SW (BIT(20)) -#define I2S_TX_DSYNC_SW_M (BIT(20)) -#define I2S_TX_DSYNC_SW_V 0x1 -#define I2S_TX_DSYNC_SW_S 20 -/* I2S_RX_BCK_OUT_DELAY : R/W ;bitpos:[19:18] ;default: 2'b0 ; */ -/*description: */ -#define I2S_RX_BCK_OUT_DELAY 0x00000003 -#define I2S_RX_BCK_OUT_DELAY_M ((I2S_RX_BCK_OUT_DELAY_V)<<(I2S_RX_BCK_OUT_DELAY_S)) -#define I2S_RX_BCK_OUT_DELAY_V 0x3 -#define I2S_RX_BCK_OUT_DELAY_S 18 -/* I2S_RX_WS_OUT_DELAY : R/W ;bitpos:[17:16] ;default: 2'b0 ; */ -/*description: */ -#define I2S_RX_WS_OUT_DELAY 0x00000003 -#define I2S_RX_WS_OUT_DELAY_M ((I2S_RX_WS_OUT_DELAY_V)<<(I2S_RX_WS_OUT_DELAY_S)) -#define I2S_RX_WS_OUT_DELAY_V 0x3 -#define I2S_RX_WS_OUT_DELAY_S 16 -/* I2S_TX_SD_OUT_DELAY : R/W ;bitpos:[15:14] ;default: 2'b0 ; */ -/*description: */ -#define I2S_TX_SD_OUT_DELAY 0x00000003 -#define I2S_TX_SD_OUT_DELAY_M ((I2S_TX_SD_OUT_DELAY_V)<<(I2S_TX_SD_OUT_DELAY_S)) -#define I2S_TX_SD_OUT_DELAY_V 0x3 -#define I2S_TX_SD_OUT_DELAY_S 14 -/* I2S_TX_WS_OUT_DELAY : R/W ;bitpos:[13:12] ;default: 2'b0 ; */ -/*description: */ -#define I2S_TX_WS_OUT_DELAY 0x00000003 -#define I2S_TX_WS_OUT_DELAY_M ((I2S_TX_WS_OUT_DELAY_V)<<(I2S_TX_WS_OUT_DELAY_S)) -#define I2S_TX_WS_OUT_DELAY_V 0x3 -#define I2S_TX_WS_OUT_DELAY_S 12 -/* I2S_TX_BCK_OUT_DELAY : R/W ;bitpos:[11:10] ;default: 2'b0 ; */ -/*description: */ -#define I2S_TX_BCK_OUT_DELAY 0x00000003 -#define I2S_TX_BCK_OUT_DELAY_M ((I2S_TX_BCK_OUT_DELAY_V)<<(I2S_TX_BCK_OUT_DELAY_S)) -#define I2S_TX_BCK_OUT_DELAY_V 0x3 -#define I2S_TX_BCK_OUT_DELAY_S 10 -/* I2S_RX_SD_IN_DELAY : R/W ;bitpos:[9:8] ;default: 2'b0 ; */ -/*description: */ -#define I2S_RX_SD_IN_DELAY 0x00000003 -#define I2S_RX_SD_IN_DELAY_M ((I2S_RX_SD_IN_DELAY_V)<<(I2S_RX_SD_IN_DELAY_S)) -#define I2S_RX_SD_IN_DELAY_V 0x3 -#define I2S_RX_SD_IN_DELAY_S 8 -/* I2S_RX_WS_IN_DELAY : R/W ;bitpos:[7:6] ;default: 2'b0 ; */ -/*description: */ -#define I2S_RX_WS_IN_DELAY 0x00000003 -#define I2S_RX_WS_IN_DELAY_M ((I2S_RX_WS_IN_DELAY_V)<<(I2S_RX_WS_IN_DELAY_S)) -#define I2S_RX_WS_IN_DELAY_V 0x3 -#define I2S_RX_WS_IN_DELAY_S 6 -/* I2S_RX_BCK_IN_DELAY : R/W ;bitpos:[5:4] ;default: 2'b0 ; */ -/*description: */ -#define I2S_RX_BCK_IN_DELAY 0x00000003 -#define I2S_RX_BCK_IN_DELAY_M ((I2S_RX_BCK_IN_DELAY_V)<<(I2S_RX_BCK_IN_DELAY_S)) -#define I2S_RX_BCK_IN_DELAY_V 0x3 -#define I2S_RX_BCK_IN_DELAY_S 4 -/* I2S_TX_WS_IN_DELAY : R/W ;bitpos:[3:2] ;default: 2'b0 ; */ -/*description: */ -#define I2S_TX_WS_IN_DELAY 0x00000003 -#define I2S_TX_WS_IN_DELAY_M ((I2S_TX_WS_IN_DELAY_V)<<(I2S_TX_WS_IN_DELAY_S)) -#define I2S_TX_WS_IN_DELAY_V 0x3 -#define I2S_TX_WS_IN_DELAY_S 2 -/* I2S_TX_BCK_IN_DELAY : R/W ;bitpos:[1:0] ;default: 2'b0 ; */ -/*description: */ -#define I2S_TX_BCK_IN_DELAY 0x00000003 -#define I2S_TX_BCK_IN_DELAY_M ((I2S_TX_BCK_IN_DELAY_V)<<(I2S_TX_BCK_IN_DELAY_S)) -#define I2S_TX_BCK_IN_DELAY_V 0x3 -#define I2S_TX_BCK_IN_DELAY_S 0 - -#define I2S_FIFO_CONF_REG(i) (REG_I2S_BASE(i) + 0x0020) -/* I2S_RX_FIFO_MOD_FORCE_EN : R/W ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define I2S_RX_FIFO_MOD_FORCE_EN (BIT(20)) -#define I2S_RX_FIFO_MOD_FORCE_EN_M (BIT(20)) -#define I2S_RX_FIFO_MOD_FORCE_EN_V 0x1 -#define I2S_RX_FIFO_MOD_FORCE_EN_S 20 -/* I2S_TX_FIFO_MOD_FORCE_EN : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define I2S_TX_FIFO_MOD_FORCE_EN (BIT(19)) -#define I2S_TX_FIFO_MOD_FORCE_EN_M (BIT(19)) -#define I2S_TX_FIFO_MOD_FORCE_EN_V 0x1 -#define I2S_TX_FIFO_MOD_FORCE_EN_S 19 -/* I2S_RX_FIFO_MOD : R/W ;bitpos:[18:16] ;default: 3'b0 ; */ -/*description: */ -#define I2S_RX_FIFO_MOD 0x00000007 -#define I2S_RX_FIFO_MOD_M ((I2S_RX_FIFO_MOD_V)<<(I2S_RX_FIFO_MOD_S)) -#define I2S_RX_FIFO_MOD_V 0x7 -#define I2S_RX_FIFO_MOD_S 16 -/* I2S_TX_FIFO_MOD : R/W ;bitpos:[15:13] ;default: 3'b0 ; */ -/*description: */ -#define I2S_TX_FIFO_MOD 0x00000007 -#define I2S_TX_FIFO_MOD_M ((I2S_TX_FIFO_MOD_V)<<(I2S_TX_FIFO_MOD_S)) -#define I2S_TX_FIFO_MOD_V 0x7 -#define I2S_TX_FIFO_MOD_S 13 -/* I2S_DSCR_EN : R/W ;bitpos:[12] ;default: 1'd1 ; */ -/*description: */ -#define I2S_DSCR_EN (BIT(12)) -#define I2S_DSCR_EN_M (BIT(12)) -#define I2S_DSCR_EN_V 0x1 -#define I2S_DSCR_EN_S 12 -/* I2S_TX_DATA_NUM : R/W ;bitpos:[11:6] ;default: 6'd32 ; */ -/*description: */ -#define I2S_TX_DATA_NUM 0x0000003F -#define I2S_TX_DATA_NUM_M ((I2S_TX_DATA_NUM_V)<<(I2S_TX_DATA_NUM_S)) -#define I2S_TX_DATA_NUM_V 0x3F -#define I2S_TX_DATA_NUM_S 6 -/* I2S_RX_DATA_NUM : R/W ;bitpos:[5:0] ;default: 6'd32 ; */ -/*description: */ -#define I2S_RX_DATA_NUM 0x0000003F -#define I2S_RX_DATA_NUM_M ((I2S_RX_DATA_NUM_V)<<(I2S_RX_DATA_NUM_S)) -#define I2S_RX_DATA_NUM_V 0x3F -#define I2S_RX_DATA_NUM_S 0 - -#define I2S_RXEOF_NUM_REG(i) (REG_I2S_BASE(i) + 0x0024) -/* I2S_RX_EOF_NUM : R/W ;bitpos:[31:0] ;default: 32'd64 ; */ -/*description: */ -#define I2S_RX_EOF_NUM 0xFFFFFFFF -#define I2S_RX_EOF_NUM_M ((I2S_RX_EOF_NUM_V)<<(I2S_RX_EOF_NUM_S)) -#define I2S_RX_EOF_NUM_V 0xFFFFFFFF -#define I2S_RX_EOF_NUM_S 0 - -#define I2S_CONF_SIGLE_DATA_REG(i) (REG_I2S_BASE(i) + 0x0028) -/* I2S_SIGLE_DATA : R/W ;bitpos:[31:0] ;default: 32'd0 ; */ -/*description: */ -#define I2S_SIGLE_DATA 0xFFFFFFFF -#define I2S_SIGLE_DATA_M ((I2S_SIGLE_DATA_V)<<(I2S_SIGLE_DATA_S)) -#define I2S_SIGLE_DATA_V 0xFFFFFFFF -#define I2S_SIGLE_DATA_S 0 - -#define I2S_CONF_CHAN_REG(i) (REG_I2S_BASE(i) + 0x002c) -/* I2S_RX_CHAN_MOD : R/W ;bitpos:[4:3] ;default: 2'b0 ; */ -/*description: */ -#define I2S_RX_CHAN_MOD 0x00000003 -#define I2S_RX_CHAN_MOD_M ((I2S_RX_CHAN_MOD_V)<<(I2S_RX_CHAN_MOD_S)) -#define I2S_RX_CHAN_MOD_V 0x3 -#define I2S_RX_CHAN_MOD_S 3 -/* I2S_TX_CHAN_MOD : R/W ;bitpos:[2:0] ;default: 3'b0 ; */ -/*description: */ -#define I2S_TX_CHAN_MOD 0x00000007 -#define I2S_TX_CHAN_MOD_M ((I2S_TX_CHAN_MOD_V)<<(I2S_TX_CHAN_MOD_S)) -#define I2S_TX_CHAN_MOD_V 0x7 -#define I2S_TX_CHAN_MOD_S 0 - -#define I2S_OUT_LINK_REG(i) (REG_I2S_BASE(i) + 0x0030) -/* I2S_OUTLINK_PARK : RO ;bitpos:[31] ;default: 1'h0 ; */ -/*description: */ -#define I2S_OUTLINK_PARK (BIT(31)) -#define I2S_OUTLINK_PARK_M (BIT(31)) -#define I2S_OUTLINK_PARK_V 0x1 -#define I2S_OUTLINK_PARK_S 31 -/* I2S_OUTLINK_RESTART : R/W ;bitpos:[30] ;default: 1'b0 ; */ -/*description: */ -#define I2S_OUTLINK_RESTART (BIT(30)) -#define I2S_OUTLINK_RESTART_M (BIT(30)) -#define I2S_OUTLINK_RESTART_V 0x1 -#define I2S_OUTLINK_RESTART_S 30 -/* I2S_OUTLINK_START : R/W ;bitpos:[29] ;default: 1'b0 ; */ -/*description: */ -#define I2S_OUTLINK_START (BIT(29)) -#define I2S_OUTLINK_START_M (BIT(29)) -#define I2S_OUTLINK_START_V 0x1 -#define I2S_OUTLINK_START_S 29 -/* I2S_OUTLINK_STOP : R/W ;bitpos:[28] ;default: 1'b0 ; */ -/*description: */ -#define I2S_OUTLINK_STOP (BIT(28)) -#define I2S_OUTLINK_STOP_M (BIT(28)) -#define I2S_OUTLINK_STOP_V 0x1 -#define I2S_OUTLINK_STOP_S 28 -/* I2S_OUTLINK_ADDR : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: */ -#define I2S_OUTLINK_ADDR 0x000FFFFF -#define I2S_OUTLINK_ADDR_M ((I2S_OUTLINK_ADDR_V)<<(I2S_OUTLINK_ADDR_S)) -#define I2S_OUTLINK_ADDR_V 0xFFFFF -#define I2S_OUTLINK_ADDR_S 0 - -#define I2S_IN_LINK_REG(i) (REG_I2S_BASE(i) + 0x0034) -/* I2S_INLINK_PARK : RO ;bitpos:[31] ;default: 1'h0 ; */ -/*description: */ -#define I2S_INLINK_PARK (BIT(31)) -#define I2S_INLINK_PARK_M (BIT(31)) -#define I2S_INLINK_PARK_V 0x1 -#define I2S_INLINK_PARK_S 31 -/* I2S_INLINK_RESTART : R/W ;bitpos:[30] ;default: 1'b0 ; */ -/*description: */ -#define I2S_INLINK_RESTART (BIT(30)) -#define I2S_INLINK_RESTART_M (BIT(30)) -#define I2S_INLINK_RESTART_V 0x1 -#define I2S_INLINK_RESTART_S 30 -/* I2S_INLINK_START : R/W ;bitpos:[29] ;default: 1'b0 ; */ -/*description: */ -#define I2S_INLINK_START (BIT(29)) -#define I2S_INLINK_START_M (BIT(29)) -#define I2S_INLINK_START_V 0x1 -#define I2S_INLINK_START_S 29 -/* I2S_INLINK_STOP : R/W ;bitpos:[28] ;default: 1'b0 ; */ -/*description: */ -#define I2S_INLINK_STOP (BIT(28)) -#define I2S_INLINK_STOP_M (BIT(28)) -#define I2S_INLINK_STOP_V 0x1 -#define I2S_INLINK_STOP_S 28 -/* I2S_INLINK_ADDR : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: */ -#define I2S_INLINK_ADDR 0x000FFFFF -#define I2S_INLINK_ADDR_M ((I2S_INLINK_ADDR_V)<<(I2S_INLINK_ADDR_S)) -#define I2S_INLINK_ADDR_V 0xFFFFF -#define I2S_INLINK_ADDR_S 0 - -#define I2S_OUT_EOF_DES_ADDR_REG(i) (REG_I2S_BASE(i) + 0x0038) -/* I2S_OUT_EOF_DES_ADDR : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define I2S_OUT_EOF_DES_ADDR 0xFFFFFFFF -#define I2S_OUT_EOF_DES_ADDR_M ((I2S_OUT_EOF_DES_ADDR_V)<<(I2S_OUT_EOF_DES_ADDR_S)) -#define I2S_OUT_EOF_DES_ADDR_V 0xFFFFFFFF -#define I2S_OUT_EOF_DES_ADDR_S 0 - -#define I2S_IN_EOF_DES_ADDR_REG(i) (REG_I2S_BASE(i) + 0x003c) -/* I2S_IN_SUC_EOF_DES_ADDR : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define I2S_IN_SUC_EOF_DES_ADDR 0xFFFFFFFF -#define I2S_IN_SUC_EOF_DES_ADDR_M ((I2S_IN_SUC_EOF_DES_ADDR_V)<<(I2S_IN_SUC_EOF_DES_ADDR_S)) -#define I2S_IN_SUC_EOF_DES_ADDR_V 0xFFFFFFFF -#define I2S_IN_SUC_EOF_DES_ADDR_S 0 - -#define I2S_OUT_EOF_BFR_DES_ADDR_REG(i) (REG_I2S_BASE(i) + 0x0040) -/* I2S_OUT_EOF_BFR_DES_ADDR : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define I2S_OUT_EOF_BFR_DES_ADDR 0xFFFFFFFF -#define I2S_OUT_EOF_BFR_DES_ADDR_M ((I2S_OUT_EOF_BFR_DES_ADDR_V)<<(I2S_OUT_EOF_BFR_DES_ADDR_S)) -#define I2S_OUT_EOF_BFR_DES_ADDR_V 0xFFFFFFFF -#define I2S_OUT_EOF_BFR_DES_ADDR_S 0 - -#define I2S_AHB_TEST_REG(i) (REG_I2S_BASE(i) + 0x0044) -/* I2S_AHB_TESTADDR : R/W ;bitpos:[5:4] ;default: 2'b0 ; */ -/*description: */ -#define I2S_AHB_TESTADDR 0x00000003 -#define I2S_AHB_TESTADDR_M ((I2S_AHB_TESTADDR_V)<<(I2S_AHB_TESTADDR_S)) -#define I2S_AHB_TESTADDR_V 0x3 -#define I2S_AHB_TESTADDR_S 4 -/* I2S_AHB_TESTMODE : R/W ;bitpos:[2:0] ;default: 3'b0 ; */ -/*description: */ -#define I2S_AHB_TESTMODE 0x00000007 -#define I2S_AHB_TESTMODE_M ((I2S_AHB_TESTMODE_V)<<(I2S_AHB_TESTMODE_S)) -#define I2S_AHB_TESTMODE_V 0x7 -#define I2S_AHB_TESTMODE_S 0 - -#define I2S_INLINK_DSCR_REG(i) (REG_I2S_BASE(i) + 0x0048) -/* I2S_INLINK_DSCR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define I2S_INLINK_DSCR 0xFFFFFFFF -#define I2S_INLINK_DSCR_M ((I2S_INLINK_DSCR_V)<<(I2S_INLINK_DSCR_S)) -#define I2S_INLINK_DSCR_V 0xFFFFFFFF -#define I2S_INLINK_DSCR_S 0 - -#define I2S_INLINK_DSCR_BF0_REG(i) (REG_I2S_BASE(i) + 0x004C) -/* I2S_INLINK_DSCR_BF0 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define I2S_INLINK_DSCR_BF0 0xFFFFFFFF -#define I2S_INLINK_DSCR_BF0_M ((I2S_INLINK_DSCR_BF0_V)<<(I2S_INLINK_DSCR_BF0_S)) -#define I2S_INLINK_DSCR_BF0_V 0xFFFFFFFF -#define I2S_INLINK_DSCR_BF0_S 0 - -#define I2S_INLINK_DSCR_BF1_REG(i) (REG_I2S_BASE(i) + 0x0050) -/* I2S_INLINK_DSCR_BF1 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define I2S_INLINK_DSCR_BF1 0xFFFFFFFF -#define I2S_INLINK_DSCR_BF1_M ((I2S_INLINK_DSCR_BF1_V)<<(I2S_INLINK_DSCR_BF1_S)) -#define I2S_INLINK_DSCR_BF1_V 0xFFFFFFFF -#define I2S_INLINK_DSCR_BF1_S 0 - -#define I2S_OUTLINK_DSCR_REG(i) (REG_I2S_BASE(i) + 0x0054) -/* I2S_OUTLINK_DSCR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define I2S_OUTLINK_DSCR 0xFFFFFFFF -#define I2S_OUTLINK_DSCR_M ((I2S_OUTLINK_DSCR_V)<<(I2S_OUTLINK_DSCR_S)) -#define I2S_OUTLINK_DSCR_V 0xFFFFFFFF -#define I2S_OUTLINK_DSCR_S 0 - -#define I2S_OUTLINK_DSCR_BF0_REG(i) (REG_I2S_BASE(i) + 0x0058) -/* I2S_OUTLINK_DSCR_BF0 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define I2S_OUTLINK_DSCR_BF0 0xFFFFFFFF -#define I2S_OUTLINK_DSCR_BF0_M ((I2S_OUTLINK_DSCR_BF0_V)<<(I2S_OUTLINK_DSCR_BF0_S)) -#define I2S_OUTLINK_DSCR_BF0_V 0xFFFFFFFF -#define I2S_OUTLINK_DSCR_BF0_S 0 - -#define I2S_OUTLINK_DSCR_BF1_REG(i) (REG_I2S_BASE(i) + 0x005C) -/* I2S_OUTLINK_DSCR_BF1 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define I2S_OUTLINK_DSCR_BF1 0xFFFFFFFF -#define I2S_OUTLINK_DSCR_BF1_M ((I2S_OUTLINK_DSCR_BF1_V)<<(I2S_OUTLINK_DSCR_BF1_S)) -#define I2S_OUTLINK_DSCR_BF1_V 0xFFFFFFFF -#define I2S_OUTLINK_DSCR_BF1_S 0 - -#define I2S_LC_CONF_REG(i) (REG_I2S_BASE(i) + 0x0060) -/* I2S_MEM_TRANS_EN : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define I2S_MEM_TRANS_EN (BIT(13)) -#define I2S_MEM_TRANS_EN_M (BIT(13)) -#define I2S_MEM_TRANS_EN_V 0x1 -#define I2S_MEM_TRANS_EN_S 13 -/* I2S_CHECK_OWNER : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define I2S_CHECK_OWNER (BIT(12)) -#define I2S_CHECK_OWNER_M (BIT(12)) -#define I2S_CHECK_OWNER_V 0x1 -#define I2S_CHECK_OWNER_S 12 -/* I2S_OUT_DATA_BURST_EN : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define I2S_OUT_DATA_BURST_EN (BIT(11)) -#define I2S_OUT_DATA_BURST_EN_M (BIT(11)) -#define I2S_OUT_DATA_BURST_EN_V 0x1 -#define I2S_OUT_DATA_BURST_EN_S 11 -/* I2S_INDSCR_BURST_EN : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define I2S_INDSCR_BURST_EN (BIT(10)) -#define I2S_INDSCR_BURST_EN_M (BIT(10)) -#define I2S_INDSCR_BURST_EN_V 0x1 -#define I2S_INDSCR_BURST_EN_S 10 -/* I2S_OUTDSCR_BURST_EN : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define I2S_OUTDSCR_BURST_EN (BIT(9)) -#define I2S_OUTDSCR_BURST_EN_M (BIT(9)) -#define I2S_OUTDSCR_BURST_EN_V 0x1 -#define I2S_OUTDSCR_BURST_EN_S 9 -/* I2S_OUT_EOF_MODE : R/W ;bitpos:[8] ;default: 1'b1 ; */ -/*description: */ -#define I2S_OUT_EOF_MODE (BIT(8)) -#define I2S_OUT_EOF_MODE_M (BIT(8)) -#define I2S_OUT_EOF_MODE_V 0x1 -#define I2S_OUT_EOF_MODE_S 8 -/* I2S_OUT_NO_RESTART_CLR : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define I2S_OUT_NO_RESTART_CLR (BIT(7)) -#define I2S_OUT_NO_RESTART_CLR_M (BIT(7)) -#define I2S_OUT_NO_RESTART_CLR_V 0x1 -#define I2S_OUT_NO_RESTART_CLR_S 7 -/* I2S_OUT_AUTO_WRBACK : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define I2S_OUT_AUTO_WRBACK (BIT(6)) -#define I2S_OUT_AUTO_WRBACK_M (BIT(6)) -#define I2S_OUT_AUTO_WRBACK_V 0x1 -#define I2S_OUT_AUTO_WRBACK_S 6 -/* I2S_IN_LOOP_TEST : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define I2S_IN_LOOP_TEST (BIT(5)) -#define I2S_IN_LOOP_TEST_M (BIT(5)) -#define I2S_IN_LOOP_TEST_V 0x1 -#define I2S_IN_LOOP_TEST_S 5 -/* I2S_OUT_LOOP_TEST : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define I2S_OUT_LOOP_TEST (BIT(4)) -#define I2S_OUT_LOOP_TEST_M (BIT(4)) -#define I2S_OUT_LOOP_TEST_V 0x1 -#define I2S_OUT_LOOP_TEST_S 4 -/* I2S_AHBM_RST : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define I2S_AHBM_RST (BIT(3)) -#define I2S_AHBM_RST_M (BIT(3)) -#define I2S_AHBM_RST_V 0x1 -#define I2S_AHBM_RST_S 3 -/* I2S_AHBM_FIFO_RST : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define I2S_AHBM_FIFO_RST (BIT(2)) -#define I2S_AHBM_FIFO_RST_M (BIT(2)) -#define I2S_AHBM_FIFO_RST_V 0x1 -#define I2S_AHBM_FIFO_RST_S 2 -/* I2S_OUT_RST : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define I2S_OUT_RST (BIT(1)) -#define I2S_OUT_RST_M (BIT(1)) -#define I2S_OUT_RST_V 0x1 -#define I2S_OUT_RST_S 1 -/* I2S_IN_RST : R/W ;bitpos:[0] ;default: 1'h0 ; */ -/*description: */ -#define I2S_IN_RST (BIT(0)) -#define I2S_IN_RST_M (BIT(0)) -#define I2S_IN_RST_V 0x1 -#define I2S_IN_RST_S 0 - -#define I2S_OUTFIFO_PUSH_REG(i) (REG_I2S_BASE(i) + 0x0064) -/* I2S_OUTFIFO_PUSH : R/W ;bitpos:[16] ;default: 1'h0 ; */ -/*description: */ -#define I2S_OUTFIFO_PUSH (BIT(16)) -#define I2S_OUTFIFO_PUSH_M (BIT(16)) -#define I2S_OUTFIFO_PUSH_V 0x1 -#define I2S_OUTFIFO_PUSH_S 16 -/* I2S_OUTFIFO_WDATA : R/W ;bitpos:[8:0] ;default: 9'h0 ; */ -/*description: */ -#define I2S_OUTFIFO_WDATA 0x000001FF -#define I2S_OUTFIFO_WDATA_M ((I2S_OUTFIFO_WDATA_V)<<(I2S_OUTFIFO_WDATA_S)) -#define I2S_OUTFIFO_WDATA_V 0x1FF -#define I2S_OUTFIFO_WDATA_S 0 - -#define I2S_INFIFO_POP_REG(i) (REG_I2S_BASE(i) + 0x0068) -/* I2S_INFIFO_POP : R/W ;bitpos:[16] ;default: 1'h0 ; */ -/*description: */ -#define I2S_INFIFO_POP (BIT(16)) -#define I2S_INFIFO_POP_M (BIT(16)) -#define I2S_INFIFO_POP_V 0x1 -#define I2S_INFIFO_POP_S 16 -/* I2S_INFIFO_RDATA : RO ;bitpos:[11:0] ;default: 12'h0 ; */ -/*description: */ -#define I2S_INFIFO_RDATA 0x00000FFF -#define I2S_INFIFO_RDATA_M ((I2S_INFIFO_RDATA_V)<<(I2S_INFIFO_RDATA_S)) -#define I2S_INFIFO_RDATA_V 0xFFF -#define I2S_INFIFO_RDATA_S 0 - -#define I2S_LC_STATE0_REG(i) (REG_I2S_BASE(i) + 0x006C) -/* I2S_LC_STATE0 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define I2S_LC_STATE0 0xFFFFFFFF -#define I2S_LC_STATE0_M ((I2S_LC_STATE0_V)<<(I2S_LC_STATE0_S)) -#define I2S_LC_STATE0_V 0xFFFFFFFF -#define I2S_LC_STATE0_S 0 - -#define I2S_LC_STATE1_REG(i) (REG_I2S_BASE(i) + 0x0070) -/* I2S_LC_STATE1 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define I2S_LC_STATE1 0xFFFFFFFF -#define I2S_LC_STATE1_M ((I2S_LC_STATE1_V)<<(I2S_LC_STATE1_S)) -#define I2S_LC_STATE1_V 0xFFFFFFFF -#define I2S_LC_STATE1_S 0 - -#define I2S_LC_HUNG_CONF_REG(i) (REG_I2S_BASE(i) + 0x0074) -/* I2S_LC_FIFO_TIMEOUT_ENA : R/W ;bitpos:[11] ;default: 1'b1 ; */ -/*description: */ -#define I2S_LC_FIFO_TIMEOUT_ENA (BIT(11)) -#define I2S_LC_FIFO_TIMEOUT_ENA_M (BIT(11)) -#define I2S_LC_FIFO_TIMEOUT_ENA_V 0x1 -#define I2S_LC_FIFO_TIMEOUT_ENA_S 11 -/* I2S_LC_FIFO_TIMEOUT_SHIFT : R/W ;bitpos:[10:8] ;default: 3'b0 ; */ -/*description: */ -#define I2S_LC_FIFO_TIMEOUT_SHIFT 0x00000007 -#define I2S_LC_FIFO_TIMEOUT_SHIFT_M ((I2S_LC_FIFO_TIMEOUT_SHIFT_V)<<(I2S_LC_FIFO_TIMEOUT_SHIFT_S)) -#define I2S_LC_FIFO_TIMEOUT_SHIFT_V 0x7 -#define I2S_LC_FIFO_TIMEOUT_SHIFT_S 8 -/* I2S_LC_FIFO_TIMEOUT : R/W ;bitpos:[7:0] ;default: 8'h10 ; */ -/*description: */ -#define I2S_LC_FIFO_TIMEOUT 0x000000FF -#define I2S_LC_FIFO_TIMEOUT_M ((I2S_LC_FIFO_TIMEOUT_V)<<(I2S_LC_FIFO_TIMEOUT_S)) -#define I2S_LC_FIFO_TIMEOUT_V 0xFF -#define I2S_LC_FIFO_TIMEOUT_S 0 - -#define I2S_CVSD_CONF0_REG(i) (REG_I2S_BASE(i) + 0x0080) -/* I2S_CVSD_Y_MIN : R/W ;bitpos:[31:16] ;default: 16'h8000 ; */ -/*description: */ -#define I2S_CVSD_Y_MIN 0x0000FFFF -#define I2S_CVSD_Y_MIN_M ((I2S_CVSD_Y_MIN_V)<<(I2S_CVSD_Y_MIN_S)) -#define I2S_CVSD_Y_MIN_V 0xFFFF -#define I2S_CVSD_Y_MIN_S 16 -/* I2S_CVSD_Y_MAX : R/W ;bitpos:[15:0] ;default: 16'h7fff ; */ -/*description: */ -#define I2S_CVSD_Y_MAX 0x0000FFFF -#define I2S_CVSD_Y_MAX_M ((I2S_CVSD_Y_MAX_V)<<(I2S_CVSD_Y_MAX_S)) -#define I2S_CVSD_Y_MAX_V 0xFFFF -#define I2S_CVSD_Y_MAX_S 0 - -#define I2S_CVSD_CONF1_REG(i) (REG_I2S_BASE(i) + 0x0084) -/* I2S_CVSD_SIGMA_MIN : R/W ;bitpos:[31:16] ;default: 16'd10 ; */ -/*description: */ -#define I2S_CVSD_SIGMA_MIN 0x0000FFFF -#define I2S_CVSD_SIGMA_MIN_M ((I2S_CVSD_SIGMA_MIN_V)<<(I2S_CVSD_SIGMA_MIN_S)) -#define I2S_CVSD_SIGMA_MIN_V 0xFFFF -#define I2S_CVSD_SIGMA_MIN_S 16 -/* I2S_CVSD_SIGMA_MAX : R/W ;bitpos:[15:0] ;default: 16'd1280 ; */ -/*description: */ -#define I2S_CVSD_SIGMA_MAX 0x0000FFFF -#define I2S_CVSD_SIGMA_MAX_M ((I2S_CVSD_SIGMA_MAX_V)<<(I2S_CVSD_SIGMA_MAX_S)) -#define I2S_CVSD_SIGMA_MAX_V 0xFFFF -#define I2S_CVSD_SIGMA_MAX_S 0 - -#define I2S_CVSD_CONF2_REG(i) (REG_I2S_BASE(i) + 0x0088) -/* I2S_CVSD_H : R/W ;bitpos:[18:16] ;default: 3'd5 ; */ -/*description: */ -#define I2S_CVSD_H 0x00000007 -#define I2S_CVSD_H_M ((I2S_CVSD_H_V)<<(I2S_CVSD_H_S)) -#define I2S_CVSD_H_V 0x7 -#define I2S_CVSD_H_S 16 -/* I2S_CVSD_BETA : R/W ;bitpos:[15:6] ;default: 10'd10 ; */ -/*description: */ -#define I2S_CVSD_BETA 0x000003FF -#define I2S_CVSD_BETA_M ((I2S_CVSD_BETA_V)<<(I2S_CVSD_BETA_S)) -#define I2S_CVSD_BETA_V 0x3FF -#define I2S_CVSD_BETA_S 6 -/* I2S_CVSD_J : R/W ;bitpos:[5:3] ;default: 3'h4 ; */ -/*description: */ -#define I2S_CVSD_J 0x00000007 -#define I2S_CVSD_J_M ((I2S_CVSD_J_V)<<(I2S_CVSD_J_S)) -#define I2S_CVSD_J_V 0x7 -#define I2S_CVSD_J_S 3 -/* I2S_CVSD_K : R/W ;bitpos:[2:0] ;default: 3'h4 ; */ -/*description: */ -#define I2S_CVSD_K 0x00000007 -#define I2S_CVSD_K_M ((I2S_CVSD_K_V)<<(I2S_CVSD_K_S)) -#define I2S_CVSD_K_V 0x7 -#define I2S_CVSD_K_S 0 - -#define I2S_PLC_CONF0_REG(i) (REG_I2S_BASE(i) + 0x008C) -/* I2S_N_MIN_ERR : R/W ;bitpos:[27:25] ;default: 3'd4 ; */ -/*description: */ -#define I2S_N_MIN_ERR 0x00000007 -#define I2S_N_MIN_ERR_M ((I2S_N_MIN_ERR_V)<<(I2S_N_MIN_ERR_S)) -#define I2S_N_MIN_ERR_V 0x7 -#define I2S_N_MIN_ERR_S 25 -/* I2S_PACK_LEN_8K : R/W ;bitpos:[24:20] ;default: 5'd10 ; */ -/*description: */ -#define I2S_PACK_LEN_8K 0x0000001F -#define I2S_PACK_LEN_8K_M ((I2S_PACK_LEN_8K_V)<<(I2S_PACK_LEN_8K_S)) -#define I2S_PACK_LEN_8K_V 0x1F -#define I2S_PACK_LEN_8K_S 20 -/* I2S_MAX_SLIDE_SAMPLE : R/W ;bitpos:[19:12] ;default: 8'd128 ; */ -/*description: */ -#define I2S_MAX_SLIDE_SAMPLE 0x000000FF -#define I2S_MAX_SLIDE_SAMPLE_M ((I2S_MAX_SLIDE_SAMPLE_V)<<(I2S_MAX_SLIDE_SAMPLE_S)) -#define I2S_MAX_SLIDE_SAMPLE_V 0xFF -#define I2S_MAX_SLIDE_SAMPLE_S 12 -/* I2S_SHIFT_RATE : R/W ;bitpos:[11:9] ;default: 3'h1 ; */ -/*description: */ -#define I2S_SHIFT_RATE 0x00000007 -#define I2S_SHIFT_RATE_M ((I2S_SHIFT_RATE_V)<<(I2S_SHIFT_RATE_S)) -#define I2S_SHIFT_RATE_V 0x7 -#define I2S_SHIFT_RATE_S 9 -/* I2S_N_ERR_SEG : R/W ;bitpos:[8:6] ;default: 3'h4 ; */ -/*description: */ -#define I2S_N_ERR_SEG 0x00000007 -#define I2S_N_ERR_SEG_M ((I2S_N_ERR_SEG_V)<<(I2S_N_ERR_SEG_S)) -#define I2S_N_ERR_SEG_V 0x7 -#define I2S_N_ERR_SEG_S 6 -/* I2S_GOOD_PACK_MAX : R/W ;bitpos:[5:0] ;default: 6'h39 ; */ -/*description: */ -#define I2S_GOOD_PACK_MAX 0x0000003F -#define I2S_GOOD_PACK_MAX_M ((I2S_GOOD_PACK_MAX_V)<<(I2S_GOOD_PACK_MAX_S)) -#define I2S_GOOD_PACK_MAX_V 0x3F -#define I2S_GOOD_PACK_MAX_S 0 - -#define I2S_PLC_CONF1_REG(i) (REG_I2S_BASE(i) + 0x0090) -/* I2S_SLIDE_WIN_LEN : R/W ;bitpos:[31:24] ;default: 8'd160 ; */ -/*description: */ -#define I2S_SLIDE_WIN_LEN 0x000000FF -#define I2S_SLIDE_WIN_LEN_M ((I2S_SLIDE_WIN_LEN_V)<<(I2S_SLIDE_WIN_LEN_S)) -#define I2S_SLIDE_WIN_LEN_V 0xFF -#define I2S_SLIDE_WIN_LEN_S 24 -/* I2S_BAD_OLA_WIN2_PARA : R/W ;bitpos:[23:16] ;default: 8'd23 ; */ -/*description: */ -#define I2S_BAD_OLA_WIN2_PARA 0x000000FF -#define I2S_BAD_OLA_WIN2_PARA_M ((I2S_BAD_OLA_WIN2_PARA_V)<<(I2S_BAD_OLA_WIN2_PARA_S)) -#define I2S_BAD_OLA_WIN2_PARA_V 0xFF -#define I2S_BAD_OLA_WIN2_PARA_S 16 -/* I2S_BAD_OLA_WIN2_PARA_SHIFT : R/W ;bitpos:[15:12] ;default: 4'd8 ; */ -/*description: */ -#define I2S_BAD_OLA_WIN2_PARA_SHIFT 0x0000000F -#define I2S_BAD_OLA_WIN2_PARA_SHIFT_M ((I2S_BAD_OLA_WIN2_PARA_SHIFT_V)<<(I2S_BAD_OLA_WIN2_PARA_SHIFT_S)) -#define I2S_BAD_OLA_WIN2_PARA_SHIFT_V 0xF -#define I2S_BAD_OLA_WIN2_PARA_SHIFT_S 12 -/* I2S_BAD_CEF_ATTEN_PARA_SHIFT : R/W ;bitpos:[11:8] ;default: 4'd10 ; */ -/*description: */ -#define I2S_BAD_CEF_ATTEN_PARA_SHIFT 0x0000000F -#define I2S_BAD_CEF_ATTEN_PARA_SHIFT_M ((I2S_BAD_CEF_ATTEN_PARA_SHIFT_V)<<(I2S_BAD_CEF_ATTEN_PARA_SHIFT_S)) -#define I2S_BAD_CEF_ATTEN_PARA_SHIFT_V 0xF -#define I2S_BAD_CEF_ATTEN_PARA_SHIFT_S 8 -/* I2S_BAD_CEF_ATTEN_PARA : R/W ;bitpos:[7:0] ;default: 8'd5 ; */ -/*description: */ -#define I2S_BAD_CEF_ATTEN_PARA 0x000000FF -#define I2S_BAD_CEF_ATTEN_PARA_M ((I2S_BAD_CEF_ATTEN_PARA_V)<<(I2S_BAD_CEF_ATTEN_PARA_S)) -#define I2S_BAD_CEF_ATTEN_PARA_V 0xFF -#define I2S_BAD_CEF_ATTEN_PARA_S 0 - -#define I2S_PLC_CONF2_REG(i) (REG_I2S_BASE(i) + 0x0094) -/* I2S_MIN_PERIOD : R/W ;bitpos:[6:2] ;default: 5'd10 ; */ -/*description: */ -#define I2S_MIN_PERIOD 0x0000001F -#define I2S_MIN_PERIOD_M ((I2S_MIN_PERIOD_V)<<(I2S_MIN_PERIOD_S)) -#define I2S_MIN_PERIOD_V 0x1F -#define I2S_MIN_PERIOD_S 2 -/* I2S_CVSD_SEG_MOD : R/W ;bitpos:[1:0] ;default: 2'd0 ; */ -/*description: */ -#define I2S_CVSD_SEG_MOD 0x00000003 -#define I2S_CVSD_SEG_MOD_M ((I2S_CVSD_SEG_MOD_V)<<(I2S_CVSD_SEG_MOD_S)) -#define I2S_CVSD_SEG_MOD_V 0x3 -#define I2S_CVSD_SEG_MOD_S 0 - -#define I2S_ESCO_CONF0_REG(i) (REG_I2S_BASE(i) + 0x0098) -/* I2S_PLC2DMA_EN : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define I2S_PLC2DMA_EN (BIT(12)) -#define I2S_PLC2DMA_EN_M (BIT(12)) -#define I2S_PLC2DMA_EN_V 0x1 -#define I2S_PLC2DMA_EN_S 12 -/* I2S_PLC_EN : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define I2S_PLC_EN (BIT(11)) -#define I2S_PLC_EN_M (BIT(11)) -#define I2S_PLC_EN_V 0x1 -#define I2S_PLC_EN_S 11 -/* I2S_CVSD_DEC_RESET : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define I2S_CVSD_DEC_RESET (BIT(10)) -#define I2S_CVSD_DEC_RESET_M (BIT(10)) -#define I2S_CVSD_DEC_RESET_V 0x1 -#define I2S_CVSD_DEC_RESET_S 10 -/* I2S_CVSD_DEC_START : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define I2S_CVSD_DEC_START (BIT(9)) -#define I2S_CVSD_DEC_START_M (BIT(9)) -#define I2S_CVSD_DEC_START_V 0x1 -#define I2S_CVSD_DEC_START_S 9 -/* I2S_ESCO_CVSD_INF_EN : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define I2S_ESCO_CVSD_INF_EN (BIT(8)) -#define I2S_ESCO_CVSD_INF_EN_M (BIT(8)) -#define I2S_ESCO_CVSD_INF_EN_V 0x1 -#define I2S_ESCO_CVSD_INF_EN_S 8 -/* I2S_ESCO_CVSD_PACK_LEN_8K : R/W ;bitpos:[7:3] ;default: 5'b0 ; */ -/*description: */ -#define I2S_ESCO_CVSD_PACK_LEN_8K 0x0000001F -#define I2S_ESCO_CVSD_PACK_LEN_8K_M ((I2S_ESCO_CVSD_PACK_LEN_8K_V)<<(I2S_ESCO_CVSD_PACK_LEN_8K_S)) -#define I2S_ESCO_CVSD_PACK_LEN_8K_V 0x1F -#define I2S_ESCO_CVSD_PACK_LEN_8K_S 3 -/* I2S_ESCO_CVSD_DEC_PACK_ERR : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define I2S_ESCO_CVSD_DEC_PACK_ERR (BIT(2)) -#define I2S_ESCO_CVSD_DEC_PACK_ERR_M (BIT(2)) -#define I2S_ESCO_CVSD_DEC_PACK_ERR_V 0x1 -#define I2S_ESCO_CVSD_DEC_PACK_ERR_S 2 -/* I2S_ESCO_CHAN_MOD : R/W ;bitpos:[1] ;default: 1'd0 ; */ -/*description: */ -#define I2S_ESCO_CHAN_MOD (BIT(1)) -#define I2S_ESCO_CHAN_MOD_M (BIT(1)) -#define I2S_ESCO_CHAN_MOD_V 0x1 -#define I2S_ESCO_CHAN_MOD_S 1 -/* I2S_ESCO_EN : R/W ;bitpos:[0] ;default: 1'd0 ; */ -/*description: */ -#define I2S_ESCO_EN (BIT(0)) -#define I2S_ESCO_EN_M (BIT(0)) -#define I2S_ESCO_EN_V 0x1 -#define I2S_ESCO_EN_S 0 - -#define I2S_SCO_CONF0_REG(i) (REG_I2S_BASE(i) + 0x009c) -/* I2S_CVSD_ENC_RESET : R/W ;bitpos:[3] ;default: 1'd0 ; */ -/*description: */ -#define I2S_CVSD_ENC_RESET (BIT(3)) -#define I2S_CVSD_ENC_RESET_M (BIT(3)) -#define I2S_CVSD_ENC_RESET_V 0x1 -#define I2S_CVSD_ENC_RESET_S 3 -/* I2S_CVSD_ENC_START : R/W ;bitpos:[2] ;default: 1'd0 ; */ -/*description: */ -#define I2S_CVSD_ENC_START (BIT(2)) -#define I2S_CVSD_ENC_START_M (BIT(2)) -#define I2S_CVSD_ENC_START_V 0x1 -#define I2S_CVSD_ENC_START_S 2 -/* I2S_SCO_NO_I2S_EN : R/W ;bitpos:[1] ;default: 1'd0 ; */ -/*description: */ -#define I2S_SCO_NO_I2S_EN (BIT(1)) -#define I2S_SCO_NO_I2S_EN_M (BIT(1)) -#define I2S_SCO_NO_I2S_EN_V 0x1 -#define I2S_SCO_NO_I2S_EN_S 1 -/* I2S_SCO_WITH_I2S_EN : R/W ;bitpos:[0] ;default: 1'd0 ; */ -/*description: */ -#define I2S_SCO_WITH_I2S_EN (BIT(0)) -#define I2S_SCO_WITH_I2S_EN_M (BIT(0)) -#define I2S_SCO_WITH_I2S_EN_V 0x1 -#define I2S_SCO_WITH_I2S_EN_S 0 - -#define I2S_CONF1_REG(i) (REG_I2S_BASE(i) + 0x00a0) -/* I2S_TX_ZEROS_RM_EN : R/W ;bitpos:[9] ;default: 1'd0 ; */ -/*description: */ -#define I2S_TX_ZEROS_RM_EN (BIT(9)) -#define I2S_TX_ZEROS_RM_EN_M (BIT(9)) -#define I2S_TX_ZEROS_RM_EN_V 0x1 -#define I2S_TX_ZEROS_RM_EN_S 9 -/* I2S_TX_STOP_EN : R/W ;bitpos:[8] ;default: 1'd0 ; */ -/*description: */ -#define I2S_TX_STOP_EN (BIT(8)) -#define I2S_TX_STOP_EN_M (BIT(8)) -#define I2S_TX_STOP_EN_V 0x1 -#define I2S_TX_STOP_EN_S 8 -/* I2S_RX_PCM_BYPASS : R/W ;bitpos:[7] ;default: 1'h1 ; */ -/*description: */ -#define I2S_RX_PCM_BYPASS (BIT(7)) -#define I2S_RX_PCM_BYPASS_M (BIT(7)) -#define I2S_RX_PCM_BYPASS_V 0x1 -#define I2S_RX_PCM_BYPASS_S 7 -/* I2S_RX_PCM_CONF : R/W ;bitpos:[6:4] ;default: 3'h0 ; */ -/*description: */ -#define I2S_RX_PCM_CONF 0x00000007 -#define I2S_RX_PCM_CONF_M ((I2S_RX_PCM_CONF_V)<<(I2S_RX_PCM_CONF_S)) -#define I2S_RX_PCM_CONF_V 0x7 -#define I2S_RX_PCM_CONF_S 4 -/* I2S_TX_PCM_BYPASS : R/W ;bitpos:[3] ;default: 1'h1 ; */ -/*description: */ -#define I2S_TX_PCM_BYPASS (BIT(3)) -#define I2S_TX_PCM_BYPASS_M (BIT(3)) -#define I2S_TX_PCM_BYPASS_V 0x1 -#define I2S_TX_PCM_BYPASS_S 3 -/* I2S_TX_PCM_CONF : R/W ;bitpos:[2:0] ;default: 3'h1 ; */ -/*description: */ -#define I2S_TX_PCM_CONF 0x00000007 -#define I2S_TX_PCM_CONF_M ((I2S_TX_PCM_CONF_V)<<(I2S_TX_PCM_CONF_S)) -#define I2S_TX_PCM_CONF_V 0x7 -#define I2S_TX_PCM_CONF_S 0 - -#define I2S_PD_CONF_REG(i) (REG_I2S_BASE(i) + 0x00a4) -/* I2S_PLC_MEM_FORCE_PU : R/W ;bitpos:[3] ;default: 1'h1 ; */ -/*description: */ -#define I2S_PLC_MEM_FORCE_PU (BIT(3)) -#define I2S_PLC_MEM_FORCE_PU_M (BIT(3)) -#define I2S_PLC_MEM_FORCE_PU_V 0x1 -#define I2S_PLC_MEM_FORCE_PU_S 3 -/* I2S_PLC_MEM_FORCE_PD : R/W ;bitpos:[2] ;default: 1'h0 ; */ -/*description: */ -#define I2S_PLC_MEM_FORCE_PD (BIT(2)) -#define I2S_PLC_MEM_FORCE_PD_M (BIT(2)) -#define I2S_PLC_MEM_FORCE_PD_V 0x1 -#define I2S_PLC_MEM_FORCE_PD_S 2 -/* I2S_FIFO_FORCE_PU : R/W ;bitpos:[1] ;default: 1'h1 ; */ -/*description: */ -#define I2S_FIFO_FORCE_PU (BIT(1)) -#define I2S_FIFO_FORCE_PU_M (BIT(1)) -#define I2S_FIFO_FORCE_PU_V 0x1 -#define I2S_FIFO_FORCE_PU_S 1 -/* I2S_FIFO_FORCE_PD : R/W ;bitpos:[0] ;default: 1'h0 ; */ -/*description: */ -#define I2S_FIFO_FORCE_PD (BIT(0)) -#define I2S_FIFO_FORCE_PD_M (BIT(0)) -#define I2S_FIFO_FORCE_PD_V 0x1 -#define I2S_FIFO_FORCE_PD_S 0 - -#define I2S_CONF2_REG(i) (REG_I2S_BASE(i) + 0x00a8) -/* I2S_INTER_VALID_EN : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define I2S_INTER_VALID_EN (BIT(7)) -#define I2S_INTER_VALID_EN_M (BIT(7)) -#define I2S_INTER_VALID_EN_V 0x1 -#define I2S_INTER_VALID_EN_S 7 -/* I2S_EXT_ADC_START_EN : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define I2S_EXT_ADC_START_EN (BIT(6)) -#define I2S_EXT_ADC_START_EN_M (BIT(6)) -#define I2S_EXT_ADC_START_EN_V 0x1 -#define I2S_EXT_ADC_START_EN_S 6 -/* I2S_LCD_EN : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define I2S_LCD_EN (BIT(5)) -#define I2S_LCD_EN_M (BIT(5)) -#define I2S_LCD_EN_V 0x1 -#define I2S_LCD_EN_S 5 -/* I2S_DATA_ENABLE : R/W ;bitpos:[4] ;default: 1'h0 ; */ -/*description: */ -#define I2S_DATA_ENABLE (BIT(4)) -#define I2S_DATA_ENABLE_M (BIT(4)) -#define I2S_DATA_ENABLE_V 0x1 -#define I2S_DATA_ENABLE_S 4 -/* I2S_DATA_ENABLE_TEST_EN : R/W ;bitpos:[3] ;default: 1'h0 ; */ -/*description: */ -#define I2S_DATA_ENABLE_TEST_EN (BIT(3)) -#define I2S_DATA_ENABLE_TEST_EN_M (BIT(3)) -#define I2S_DATA_ENABLE_TEST_EN_V 0x1 -#define I2S_DATA_ENABLE_TEST_EN_S 3 -/* I2S_LCD_TX_SDX2_EN : R/W ;bitpos:[2] ;default: 1'h0 ; */ -/*description: */ -#define I2S_LCD_TX_SDX2_EN (BIT(2)) -#define I2S_LCD_TX_SDX2_EN_M (BIT(2)) -#define I2S_LCD_TX_SDX2_EN_V 0x1 -#define I2S_LCD_TX_SDX2_EN_S 2 -/* I2S_LCD_TX_WRX2_EN : R/W ;bitpos:[1] ;default: 1'h0 ; */ -/*description: */ -#define I2S_LCD_TX_WRX2_EN (BIT(1)) -#define I2S_LCD_TX_WRX2_EN_M (BIT(1)) -#define I2S_LCD_TX_WRX2_EN_V 0x1 -#define I2S_LCD_TX_WRX2_EN_S 1 -/* I2S_CAMERA_EN : R/W ;bitpos:[0] ;default: 1'h0 ; */ -/*description: */ -#define I2S_CAMERA_EN (BIT(0)) -#define I2S_CAMERA_EN_M (BIT(0)) -#define I2S_CAMERA_EN_V 0x1 -#define I2S_CAMERA_EN_S 0 - -#define I2S_CLKM_CONF_REG(i) (REG_I2S_BASE(i) + 0x00ac) -/* I2S_CLKA_ENA : R/W ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define I2S_CLKA_ENA (BIT(21)) -#define I2S_CLKA_ENA_M (BIT(21)) -#define I2S_CLKA_ENA_V 0x1 -#define I2S_CLKA_ENA_S 21 -/* I2S_CLK_EN : R/W ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define I2S_CLK_EN (BIT(20)) -#define I2S_CLK_EN_M (BIT(20)) -#define I2S_CLK_EN_V 0x1 -#define I2S_CLK_EN_S 20 -/* I2S_CLKM_DIV_A : R/W ;bitpos:[19:14] ;default: 6'h0 ; */ -/*description: */ -#define I2S_CLKM_DIV_A 0x0000003F -#define I2S_CLKM_DIV_A_M ((I2S_CLKM_DIV_A_V)<<(I2S_CLKM_DIV_A_S)) -#define I2S_CLKM_DIV_A_V 0x3F -#define I2S_CLKM_DIV_A_S 14 -/* I2S_CLKM_DIV_B : R/W ;bitpos:[13:8] ;default: 6'h0 ; */ -/*description: */ -#define I2S_CLKM_DIV_B 0x0000003F -#define I2S_CLKM_DIV_B_M ((I2S_CLKM_DIV_B_V)<<(I2S_CLKM_DIV_B_S)) -#define I2S_CLKM_DIV_B_V 0x3F -#define I2S_CLKM_DIV_B_S 8 -/* I2S_CLKM_DIV_NUM : R/W ;bitpos:[7:0] ;default: 8'd4 ; */ -/*description: */ -#define I2S_CLKM_DIV_NUM 0x000000FF -#define I2S_CLKM_DIV_NUM_M ((I2S_CLKM_DIV_NUM_V)<<(I2S_CLKM_DIV_NUM_S)) -#define I2S_CLKM_DIV_NUM_V 0xFF -#define I2S_CLKM_DIV_NUM_S 0 - -#define I2S_SAMPLE_RATE_CONF_REG(i) (REG_I2S_BASE(i) + 0x00b0) -/* I2S_RX_BITS_MOD : R/W ;bitpos:[23:18] ;default: 6'd16 ; */ -/*description: */ -#define I2S_RX_BITS_MOD 0x0000003F -#define I2S_RX_BITS_MOD_M ((I2S_RX_BITS_MOD_V)<<(I2S_RX_BITS_MOD_S)) -#define I2S_RX_BITS_MOD_V 0x3F -#define I2S_RX_BITS_MOD_S 18 -/* I2S_TX_BITS_MOD : R/W ;bitpos:[17:12] ;default: 6'd16 ; */ -/*description: */ -#define I2S_TX_BITS_MOD 0x0000003F -#define I2S_TX_BITS_MOD_M ((I2S_TX_BITS_MOD_V)<<(I2S_TX_BITS_MOD_S)) -#define I2S_TX_BITS_MOD_V 0x3F -#define I2S_TX_BITS_MOD_S 12 -/* I2S_RX_BCK_DIV_NUM : R/W ;bitpos:[11:6] ;default: 6'd6 ; */ -/*description: */ -#define I2S_RX_BCK_DIV_NUM 0x0000003F -#define I2S_RX_BCK_DIV_NUM_M ((I2S_RX_BCK_DIV_NUM_V)<<(I2S_RX_BCK_DIV_NUM_S)) -#define I2S_RX_BCK_DIV_NUM_V 0x3F -#define I2S_RX_BCK_DIV_NUM_S 6 -/* I2S_TX_BCK_DIV_NUM : R/W ;bitpos:[5:0] ;default: 6'd6 ; */ -/*description: */ -#define I2S_TX_BCK_DIV_NUM 0x0000003F -#define I2S_TX_BCK_DIV_NUM_M ((I2S_TX_BCK_DIV_NUM_V)<<(I2S_TX_BCK_DIV_NUM_S)) -#define I2S_TX_BCK_DIV_NUM_V 0x3F -#define I2S_TX_BCK_DIV_NUM_S 0 - -#define I2S_PDM_CONF_REG(i) (REG_I2S_BASE(i) + 0x00b4) -/* I2S_TX_PDM_HP_BYPASS : R/W ;bitpos:[25] ;default: 1'h0 ; */ -/*description: */ -#define I2S_TX_PDM_HP_BYPASS (BIT(25)) -#define I2S_TX_PDM_HP_BYPASS_M (BIT(25)) -#define I2S_TX_PDM_HP_BYPASS_V 0x1 -#define I2S_TX_PDM_HP_BYPASS_S 25 -/* I2S_RX_PDM_SINC_DSR_16_EN : R/W ;bitpos:[24] ;default: 1'h1 ; */ -/*description: */ -#define I2S_RX_PDM_SINC_DSR_16_EN (BIT(24)) -#define I2S_RX_PDM_SINC_DSR_16_EN_M (BIT(24)) -#define I2S_RX_PDM_SINC_DSR_16_EN_V 0x1 -#define I2S_RX_PDM_SINC_DSR_16_EN_S 24 -/* I2S_TX_PDM_SIGMADELTA_IN_SHIFT : R/W ;bitpos:[23:22] ;default: 2'h1 ; */ -/*description: */ -#define I2S_TX_PDM_SIGMADELTA_IN_SHIFT 0x00000003 -#define I2S_TX_PDM_SIGMADELTA_IN_SHIFT_M ((I2S_TX_PDM_SIGMADELTA_IN_SHIFT_V)<<(I2S_TX_PDM_SIGMADELTA_IN_SHIFT_S)) -#define I2S_TX_PDM_SIGMADELTA_IN_SHIFT_V 0x3 -#define I2S_TX_PDM_SIGMADELTA_IN_SHIFT_S 22 -/* I2S_TX_PDM_SINC_IN_SHIFT : R/W ;bitpos:[21:20] ;default: 2'h1 ; */ -/*description: */ -#define I2S_TX_PDM_SINC_IN_SHIFT 0x00000003 -#define I2S_TX_PDM_SINC_IN_SHIFT_M ((I2S_TX_PDM_SINC_IN_SHIFT_V)<<(I2S_TX_PDM_SINC_IN_SHIFT_S)) -#define I2S_TX_PDM_SINC_IN_SHIFT_V 0x3 -#define I2S_TX_PDM_SINC_IN_SHIFT_S 20 -/* I2S_TX_PDM_LP_IN_SHIFT : R/W ;bitpos:[19:18] ;default: 2'h1 ; */ -/*description: */ -#define I2S_TX_PDM_LP_IN_SHIFT 0x00000003 -#define I2S_TX_PDM_LP_IN_SHIFT_M ((I2S_TX_PDM_LP_IN_SHIFT_V)<<(I2S_TX_PDM_LP_IN_SHIFT_S)) -#define I2S_TX_PDM_LP_IN_SHIFT_V 0x3 -#define I2S_TX_PDM_LP_IN_SHIFT_S 18 -/* I2S_TX_PDM_HP_IN_SHIFT : R/W ;bitpos:[17:16] ;default: 2'h1 ; */ -/*description: */ -#define I2S_TX_PDM_HP_IN_SHIFT 0x00000003 -#define I2S_TX_PDM_HP_IN_SHIFT_M ((I2S_TX_PDM_HP_IN_SHIFT_V)<<(I2S_TX_PDM_HP_IN_SHIFT_S)) -#define I2S_TX_PDM_HP_IN_SHIFT_V 0x3 -#define I2S_TX_PDM_HP_IN_SHIFT_S 16 -/* I2S_TX_PDM_PRESCALE : R/W ;bitpos:[15:8] ;default: 8'h0 ; */ -/*description: */ -#define I2S_TX_PDM_PRESCALE 0x000000FF -#define I2S_TX_PDM_PRESCALE_M ((I2S_TX_PDM_PRESCALE_V)<<(I2S_TX_PDM_PRESCALE_S)) -#define I2S_TX_PDM_PRESCALE_V 0xFF -#define I2S_TX_PDM_PRESCALE_S 8 -/* I2S_TX_PDM_SINC_OSR2 : R/W ;bitpos:[7:4] ;default: 4'h2 ; */ -/*description: */ -#define I2S_TX_PDM_SINC_OSR2 0x0000000F -#define I2S_TX_PDM_SINC_OSR2_M ((I2S_TX_PDM_SINC_OSR2_V)<<(I2S_TX_PDM_SINC_OSR2_S)) -#define I2S_TX_PDM_SINC_OSR2_V 0xF -#define I2S_TX_PDM_SINC_OSR2_S 4 -/* I2S_PDM2PCM_CONV_EN : R/W ;bitpos:[3] ;default: 1'h0 ; */ -/*description: */ -#define I2S_PDM2PCM_CONV_EN (BIT(3)) -#define I2S_PDM2PCM_CONV_EN_M (BIT(3)) -#define I2S_PDM2PCM_CONV_EN_V 0x1 -#define I2S_PDM2PCM_CONV_EN_S 3 -/* I2S_PCM2PDM_CONV_EN : R/W ;bitpos:[2] ;default: 1'h0 ; */ -/*description: */ -#define I2S_PCM2PDM_CONV_EN (BIT(2)) -#define I2S_PCM2PDM_CONV_EN_M (BIT(2)) -#define I2S_PCM2PDM_CONV_EN_V 0x1 -#define I2S_PCM2PDM_CONV_EN_S 2 -/* I2S_RX_PDM_EN : R/W ;bitpos:[1] ;default: 1'h0 ; */ -/*description: */ -#define I2S_RX_PDM_EN (BIT(1)) -#define I2S_RX_PDM_EN_M (BIT(1)) -#define I2S_RX_PDM_EN_V 0x1 -#define I2S_RX_PDM_EN_S 1 -/* I2S_TX_PDM_EN : R/W ;bitpos:[0] ;default: 1'h0 ; */ -/*description: */ -#define I2S_TX_PDM_EN (BIT(0)) -#define I2S_TX_PDM_EN_M (BIT(0)) -#define I2S_TX_PDM_EN_V 0x1 -#define I2S_TX_PDM_EN_S 0 - -#define I2S_PDM_FREQ_CONF_REG(i) (REG_I2S_BASE(i) + 0x00b8) -/* I2S_TX_PDM_FP : R/W ;bitpos:[19:10] ;default: 10'd960 ; */ -/*description: */ -#define I2S_TX_PDM_FP 0x000003FF -#define I2S_TX_PDM_FP_M ((I2S_TX_PDM_FP_V)<<(I2S_TX_PDM_FP_S)) -#define I2S_TX_PDM_FP_V 0x3FF -#define I2S_TX_PDM_FP_S 10 -/* I2S_TX_PDM_FS : R/W ;bitpos:[9:0] ;default: 10'd480 ; */ -/*description: */ -#define I2S_TX_PDM_FS 0x000003FF -#define I2S_TX_PDM_FS_M ((I2S_TX_PDM_FS_V)<<(I2S_TX_PDM_FS_S)) -#define I2S_TX_PDM_FS_V 0x3FF -#define I2S_TX_PDM_FS_S 0 - -#define I2S_STATE_REG(i) (REG_I2S_BASE(i) + 0x00bc) -/* I2S_RX_FIFO_RESET_BACK : RO ;bitpos:[2] ;default: 1'b1 ; */ -/*description: */ -#define I2S_RX_FIFO_RESET_BACK (BIT(2)) -#define I2S_RX_FIFO_RESET_BACK_M (BIT(2)) -#define I2S_RX_FIFO_RESET_BACK_V 0x1 -#define I2S_RX_FIFO_RESET_BACK_S 2 -/* I2S_TX_FIFO_RESET_BACK : RO ;bitpos:[1] ;default: 1'b1 ; */ -/*description: */ -#define I2S_TX_FIFO_RESET_BACK (BIT(1)) -#define I2S_TX_FIFO_RESET_BACK_M (BIT(1)) -#define I2S_TX_FIFO_RESET_BACK_V 0x1 -#define I2S_TX_FIFO_RESET_BACK_S 1 -/* I2S_TX_IDLE : RO ;bitpos:[0] ;default: 1'b1 ; */ -/*description: */ -#define I2S_TX_IDLE (BIT(0)) -#define I2S_TX_IDLE_M (BIT(0)) -#define I2S_TX_IDLE_V 0x1 -#define I2S_TX_IDLE_S 0 - -#define I2S_DATE_REG(i) (REG_I2S_BASE(i) + 0x00fc) -/* I2S_I2SDATE : R/W ;bitpos:[31:0] ;default: 32'h1604201 ; */ -/*description: */ -#define I2S_I2SDATE 0xFFFFFFFF -#define I2S_I2SDATE_M ((I2S_I2SDATE_V)<<(I2S_I2SDATE_S)) -#define I2S_I2SDATE_V 0xFFFFFFFF -#define I2S_I2SDATE_S 0 - - - - -#endif /*_SOC_I2S_REG_H_ */ - - diff --git a/tools/sdk/include/soc/soc/i2s_struct.h b/tools/sdk/include/soc/soc/i2s_struct.h deleted file mode 100644 index 8ec3145cdc8..00000000000 --- a/tools/sdk/include/soc/soc/i2s_struct.h +++ /dev/null @@ -1,470 +0,0 @@ -// 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. -#ifndef _SOC_I2S_STRUCT_H_ -#define _SOC_I2S_STRUCT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef volatile struct { - uint32_t reserved_0; - uint32_t reserved_4; - union { - struct { - uint32_t tx_reset: 1; - uint32_t rx_reset: 1; - uint32_t tx_fifo_reset: 1; - uint32_t rx_fifo_reset: 1; - uint32_t tx_start: 1; - uint32_t rx_start: 1; - uint32_t tx_slave_mod: 1; - uint32_t rx_slave_mod: 1; - uint32_t tx_right_first: 1; - uint32_t rx_right_first: 1; - uint32_t tx_msb_shift: 1; - uint32_t rx_msb_shift: 1; - uint32_t tx_short_sync: 1; - uint32_t rx_short_sync: 1; - uint32_t tx_mono: 1; - uint32_t rx_mono: 1; - uint32_t tx_msb_right: 1; - uint32_t rx_msb_right: 1; - uint32_t sig_loopback: 1; - uint32_t reserved19: 13; - }; - uint32_t val; - } conf; - union { - struct { - uint32_t rx_take_data: 1; - uint32_t tx_put_data: 1; - uint32_t rx_wfull: 1; - uint32_t rx_rempty: 1; - uint32_t tx_wfull: 1; - uint32_t tx_rempty: 1; - uint32_t rx_hung: 1; - uint32_t tx_hung: 1; - uint32_t in_done: 1; - uint32_t in_suc_eof: 1; - uint32_t in_err_eof: 1; - uint32_t out_done: 1; - uint32_t out_eof: 1; - uint32_t in_dscr_err: 1; - uint32_t out_dscr_err: 1; - uint32_t in_dscr_empty: 1; - uint32_t out_total_eof: 1; - uint32_t reserved17: 15; - }; - uint32_t val; - } int_raw; - union { - struct { - uint32_t rx_take_data: 1; - uint32_t tx_put_data: 1; - uint32_t rx_wfull: 1; - uint32_t rx_rempty: 1; - uint32_t tx_wfull: 1; - uint32_t tx_rempty: 1; - uint32_t rx_hung: 1; - uint32_t tx_hung: 1; - uint32_t in_done: 1; - uint32_t in_suc_eof: 1; - uint32_t in_err_eof: 1; - uint32_t out_done: 1; - uint32_t out_eof: 1; - uint32_t in_dscr_err: 1; - uint32_t out_dscr_err: 1; - uint32_t in_dscr_empty: 1; - uint32_t out_total_eof: 1; - uint32_t reserved17: 15; - }; - uint32_t val; - } int_st; - union { - struct { - uint32_t rx_take_data: 1; - uint32_t tx_put_data: 1; - uint32_t rx_wfull: 1; - uint32_t rx_rempty: 1; - uint32_t tx_wfull: 1; - uint32_t tx_rempty: 1; - uint32_t rx_hung: 1; - uint32_t tx_hung: 1; - uint32_t in_done: 1; - uint32_t in_suc_eof: 1; - uint32_t in_err_eof: 1; - uint32_t out_done: 1; - uint32_t out_eof: 1; - uint32_t in_dscr_err: 1; - uint32_t out_dscr_err: 1; - uint32_t in_dscr_empty: 1; - uint32_t out_total_eof: 1; - uint32_t reserved17: 15; - }; - uint32_t val; - } int_ena; - union { - struct { - uint32_t take_data: 1; - uint32_t put_data: 1; - uint32_t rx_wfull: 1; - uint32_t rx_rempty: 1; - uint32_t tx_wfull: 1; - uint32_t tx_rempty: 1; - uint32_t rx_hung: 1; - uint32_t tx_hung: 1; - uint32_t in_done: 1; - uint32_t in_suc_eof: 1; - uint32_t in_err_eof: 1; - uint32_t out_done: 1; - uint32_t out_eof: 1; - uint32_t in_dscr_err: 1; - uint32_t out_dscr_err: 1; - uint32_t in_dscr_empty: 1; - uint32_t out_total_eof: 1; - uint32_t reserved17: 15; - }; - uint32_t val; - } int_clr; - union { - struct { - uint32_t tx_bck_in_delay: 2; - uint32_t tx_ws_in_delay: 2; - uint32_t rx_bck_in_delay: 2; - uint32_t rx_ws_in_delay: 2; - uint32_t rx_sd_in_delay: 2; - uint32_t tx_bck_out_delay: 2; - uint32_t tx_ws_out_delay: 2; - uint32_t tx_sd_out_delay: 2; - uint32_t rx_ws_out_delay: 2; - uint32_t rx_bck_out_delay: 2; - uint32_t tx_dsync_sw: 1; - uint32_t rx_dsync_sw: 1; - uint32_t data_enable_delay: 2; - uint32_t tx_bck_in_inv: 1; - uint32_t reserved25: 7; - }; - uint32_t val; - } timing; - union { - struct { - uint32_t rx_data_num: 6; - uint32_t tx_data_num: 6; - uint32_t dscr_en: 1; - uint32_t tx_fifo_mod: 3; - uint32_t rx_fifo_mod: 3; - uint32_t tx_fifo_mod_force_en: 1; - uint32_t rx_fifo_mod_force_en: 1; - uint32_t reserved21: 11; - }; - uint32_t val; - } fifo_conf; - uint32_t rx_eof_num; - uint32_t conf_single_data; - union { - struct { - uint32_t tx_chan_mod: 3; - uint32_t rx_chan_mod: 2; - uint32_t reserved5: 27; - }; - uint32_t val; - } conf_chan; - union { - struct { - uint32_t addr: 20; - uint32_t reserved20: 8; - uint32_t stop: 1; - uint32_t start: 1; - uint32_t restart: 1; - uint32_t park: 1; - }; - uint32_t val; - } out_link; - union { - struct { - uint32_t addr: 20; - uint32_t reserved20: 8; - uint32_t stop: 1; - uint32_t start: 1; - uint32_t restart: 1; - uint32_t park: 1; - }; - uint32_t val; - } in_link; - uint32_t out_eof_des_addr; - uint32_t in_eof_des_addr; - uint32_t out_eof_bfr_des_addr; - union { - struct { - uint32_t mode: 3; - uint32_t reserved3: 1; - uint32_t addr: 2; - uint32_t reserved6: 26; - }; - uint32_t val; - } ahb_test; - uint32_t in_link_dscr; - uint32_t in_link_dscr_bf0; - uint32_t in_link_dscr_bf1; - uint32_t out_link_dscr; - uint32_t out_link_dscr_bf0; - uint32_t out_link_dscr_bf1; - union { - struct { - uint32_t in_rst: 1; - uint32_t out_rst: 1; - uint32_t ahbm_fifo_rst: 1; - uint32_t ahbm_rst: 1; - uint32_t out_loop_test: 1; - uint32_t in_loop_test: 1; - uint32_t out_auto_wrback: 1; - uint32_t out_no_restart_clr: 1; - uint32_t out_eof_mode: 1; - uint32_t outdscr_burst_en: 1; - uint32_t indscr_burst_en: 1; - uint32_t out_data_burst_en: 1; - uint32_t check_owner: 1; - uint32_t mem_trans_en: 1; - uint32_t reserved14: 18; - }; - uint32_t val; - } lc_conf; - union { - struct { - uint32_t wdata: 9; - uint32_t reserved9: 7; - uint32_t push: 1; - uint32_t reserved17: 15; - }; - uint32_t val; - } out_fifo_push; - union { - struct { - uint32_t rdata: 12; - uint32_t reserved12: 4; - uint32_t pop: 1; - uint32_t reserved17: 15; - }; - uint32_t val; - } in_fifo_pop; - uint32_t lc_state0; - uint32_t lc_state1; - union { - struct { - uint32_t fifo_timeout: 8; - uint32_t fifo_timeout_shift: 3; - uint32_t fifo_timeout_ena: 1; - uint32_t reserved12: 20; - }; - uint32_t val; - } lc_hung_conf; - uint32_t reserved_78; - uint32_t reserved_7c; - union { - struct { - uint32_t y_max:16; - uint32_t y_min:16; - }; - uint32_t val; - } cvsd_conf0; - union { - struct { - uint32_t sigma_max:16; - uint32_t sigma_min:16; - }; - uint32_t val; - } cvsd_conf1; - union { - struct { - uint32_t cvsd_k: 3; - uint32_t cvsd_j: 3; - uint32_t cvsd_beta: 10; - uint32_t cvsd_h: 3; - uint32_t reserved19:13; - }; - uint32_t val; - } cvsd_conf2; - union { - struct { - uint32_t good_pack_max: 6; - uint32_t n_err_seg: 3; - uint32_t shift_rate: 3; - uint32_t max_slide_sample: 8; - uint32_t pack_len_8k: 5; - uint32_t n_min_err: 3; - uint32_t reserved28: 4; - }; - uint32_t val; - } plc_conf0; - union { - struct { - uint32_t bad_cef_atten_para: 8; - uint32_t bad_cef_atten_para_shift: 4; - uint32_t bad_ola_win2_para_shift: 4; - uint32_t bad_ola_win2_para: 8; - uint32_t slide_win_len: 8; - }; - uint32_t val; - } plc_conf1; - union { - struct { - uint32_t cvsd_seg_mod: 2; - uint32_t min_period: 5; - uint32_t reserved7: 25; - }; - uint32_t val; - } plc_conf2; - union { - struct { - uint32_t en: 1; - uint32_t chan_mod: 1; - uint32_t cvsd_dec_pack_err: 1; - uint32_t cvsd_pack_len_8k: 5; - uint32_t cvsd_inf_en: 1; - uint32_t cvsd_dec_start: 1; - uint32_t cvsd_dec_reset: 1; - uint32_t plc_en: 1; - uint32_t plc2dma_en: 1; - uint32_t reserved13: 19; - }; - uint32_t val; - } esco_conf0; - union { - struct { - uint32_t with_en: 1; - uint32_t no_en: 1; - uint32_t cvsd_enc_start: 1; - uint32_t cvsd_enc_reset: 1; - uint32_t reserved4: 28; - }; - uint32_t val; - } sco_conf0; - union { - struct { - uint32_t tx_pcm_conf: 3; - uint32_t tx_pcm_bypass: 1; - uint32_t rx_pcm_conf: 3; - uint32_t rx_pcm_bypass: 1; - uint32_t tx_stop_en: 1; - uint32_t tx_zeros_rm_en: 1; - uint32_t reserved10: 22; - }; - uint32_t val; - } conf1; - union { - struct { - uint32_t fifo_force_pd: 1; - uint32_t fifo_force_pu: 1; - uint32_t plc_mem_force_pd: 1; - uint32_t plc_mem_force_pu: 1; - uint32_t reserved4: 28; - }; - uint32_t val; - } pd_conf; - union { - struct { - uint32_t camera_en: 1; - uint32_t lcd_tx_wrx2_en: 1; - uint32_t lcd_tx_sdx2_en: 1; - uint32_t data_enable_test_en: 1; - uint32_t data_enable: 1; - uint32_t lcd_en: 1; - uint32_t ext_adc_start_en: 1; - uint32_t inter_valid_en: 1; - uint32_t reserved8: 24; - }; - uint32_t val; - } conf2; - union { - struct { - uint32_t clkm_div_num: 8; - uint32_t clkm_div_b: 6; - uint32_t clkm_div_a: 6; - uint32_t clk_en: 1; - uint32_t clka_en: 1; - uint32_t reserved22: 10; - }; - uint32_t val; - } clkm_conf; - union { - struct { - uint32_t tx_bck_div_num: 6; - uint32_t rx_bck_div_num: 6; - uint32_t tx_bits_mod: 6; - uint32_t rx_bits_mod: 6; - uint32_t reserved24: 8; - }; - uint32_t val; - } sample_rate_conf; - union { - struct { - uint32_t tx_pdm_en: 1; - uint32_t rx_pdm_en: 1; - uint32_t pcm2pdm_conv_en: 1; - uint32_t pdm2pcm_conv_en: 1; - uint32_t tx_sinc_osr2: 4; - uint32_t tx_prescale: 8; - uint32_t tx_hp_in_shift: 2; - uint32_t tx_lp_in_shift: 2; - uint32_t tx_sinc_in_shift: 2; - uint32_t tx_sigmadelta_in_shift: 2; - uint32_t rx_sinc_dsr_16_en: 1; - uint32_t txhp_bypass: 1; - uint32_t reserved26: 6; - }; - uint32_t val; - } pdm_conf; - union { - struct { - uint32_t tx_pdm_fs: 10; - uint32_t tx_pdm_fp: 10; - uint32_t reserved20:12; - }; - uint32_t val; - } pdm_freq_conf; - union { - struct { - uint32_t tx_idle: 1; - uint32_t tx_fifo_reset_back: 1; - uint32_t rx_fifo_reset_back: 1; - uint32_t reserved3: 29; - }; - uint32_t val; - } state; - uint32_t reserved_c0; - uint32_t reserved_c4; - uint32_t reserved_c8; - uint32_t reserved_cc; - uint32_t reserved_d0; - uint32_t reserved_d4; - uint32_t reserved_d8; - uint32_t reserved_dc; - uint32_t reserved_e0; - uint32_t reserved_e4; - uint32_t reserved_e8; - uint32_t reserved_ec; - uint32_t reserved_f0; - uint32_t reserved_f4; - uint32_t reserved_f8; - uint32_t date; /**/ -} i2s_dev_t; -extern i2s_dev_t I2S0; -extern i2s_dev_t I2S1; - -#ifdef __cplusplus -} -#endif - -#endif /* _SOC_I2S_STRUCT_H_ */ diff --git a/tools/sdk/include/soc/soc/io_mux_reg.h b/tools/sdk/include/soc/soc/io_mux_reg.h deleted file mode 100644 index 25978b326ff..00000000000 --- a/tools/sdk/include/soc/soc/io_mux_reg.h +++ /dev/null @@ -1,382 +0,0 @@ -// 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. -#ifndef _SOC_IO_MUX_REG_H_ -#define _SOC_IO_MUX_REG_H_ - -#include "soc.h" - -/* The following are the bit fields for PERIPHS_IO_MUX_x_U registers */ -/* Output enable in sleep mode */ -#define SLP_OE (BIT(0)) -#define SLP_OE_M (BIT(0)) -#define SLP_OE_V 1 -#define SLP_OE_S 0 -/* Pin used for wakeup from sleep */ -#define SLP_SEL (BIT(1)) -#define SLP_SEL_M (BIT(1)) -#define SLP_SEL_V 1 -#define SLP_SEL_S 1 -/* Pulldown enable in sleep mode */ -#define SLP_PD (BIT(2)) -#define SLP_PD_M (BIT(2)) -#define SLP_PD_V 1 -#define SLP_PD_S 2 -/* Pullup enable in sleep mode */ -#define SLP_PU (BIT(3)) -#define SLP_PU_M (BIT(3)) -#define SLP_PU_V 1 -#define SLP_PU_S 3 -/* Input enable in sleep mode */ -#define SLP_IE (BIT(4)) -#define SLP_IE_M (BIT(4)) -#define SLP_IE_V 1 -#define SLP_IE_S 4 -/* Drive strength in sleep mode */ -#define SLP_DRV 0x3 -#define SLP_DRV_M (SLP_DRV_V << SLP_DRV_S) -#define SLP_DRV_V 0x3 -#define SLP_DRV_S 5 -/* Pulldown enable */ -#define FUN_PD (BIT(7)) -#define FUN_PD_M (BIT(7)) -#define FUN_PD_V 1 -#define FUN_PD_S 7 -/* Pullup enable */ -#define FUN_PU (BIT(8)) -#define FUN_PU_M (BIT(8)) -#define FUN_PU_V 1 -#define FUN_PU_S 8 -/* Input enable */ -#define FUN_IE (BIT(9)) -#define FUN_IE_M (FUN_IE_V << FUN_IE_S) -#define FUN_IE_V 1 -#define FUN_IE_S 9 -/* Drive strength */ -#define FUN_DRV 0x3 -#define FUN_DRV_M (FUN_DRV_V << FUN_DRV_S) -#define FUN_DRV_V 0x3 -#define FUN_DRV_S 10 -/* Function select (possible values are defined for each pin as FUNC_pinname_function below) */ -#define MCU_SEL 0x7 -#define MCU_SEL_M (MCU_SEL_V << MCU_SEL_S) -#define MCU_SEL_V 0x7 -#define MCU_SEL_S 12 - -#define PIN_INPUT_ENABLE(PIN_NAME) SET_PERI_REG_MASK(PIN_NAME,FUN_IE) -#define PIN_INPUT_DISABLE(PIN_NAME) CLEAR_PERI_REG_MASK(PIN_NAME,FUN_IE) -#define PIN_SET_DRV(PIN_NAME, drv) REG_SET_FIELD(PIN_NAME, FUN_DRV, (drv)); - -/* - * @attention - * The PIN_PULL[UP|DWN]_[EN|DIS]() functions used to exist as macros in previous SDK versions. - * Unfortunately, however, they do not work for some GPIOs on the ESP32 chip, which needs pullups - * and -downs turned on and off through RTC registers. The functions still exist for compatibility - * with older code, but are marked as deprecated in order to generate a warning. - * Please replace them in this fashion: (make sure to include driver/gpio.h as well) - * PIN_PULLUP_EN(GPIO_PIN_MUX_REG[x]) -> gpio_pullup_en(x) - * PIN_PULLUP_DIS(GPIO_PIN_MUX_REG[x]) -> gpio_pullup_dis(x) - * PIN_PULLDWN_EN(GPIO_PIN_MUX_REG[x]) -> gpio_pulldown_en(x) - * PIN_PULLDWN_DIS(GPIO_PIN_MUX_REG[x]) -> gpio_pulldown_dis(x) - * -*/ -static inline void __attribute__ ((deprecated)) PIN_PULLUP_DIS(uint32_t PIN_NAME) -{ - REG_CLR_BIT(PIN_NAME, FUN_PU); -} - -static inline void __attribute__ ((deprecated)) PIN_PULLUP_EN(uint32_t PIN_NAME) -{ - REG_SET_BIT(PIN_NAME, FUN_PU); -} - -static inline void __attribute__ ((deprecated)) PIN_PULLDWN_DIS(uint32_t PIN_NAME) -{ - REG_CLR_BIT(PIN_NAME, FUN_PD); -} - -static inline void __attribute__ ((deprecated)) PIN_PULLDWN_EN(uint32_t PIN_NAME) -{ - REG_SET_BIT(PIN_NAME, FUN_PD); -} - - -#define PIN_FUNC_SELECT(PIN_NAME, FUNC) REG_SET_FIELD(PIN_NAME, MCU_SEL, FUNC) - -#define PIN_FUNC_GPIO 2 - -#define PIN_CTRL (DR_REG_IO_MUX_BASE +0x00) -#define CLK_OUT3 0xf -#define CLK_OUT3_V CLK_OUT3 -#define CLK_OUT3_S 8 -#define CLK_OUT3_M (CLK_OUT3_V << CLK_OUT3_S) -#define CLK_OUT2 0xf -#define CLK_OUT2_V CLK_OUT2 -#define CLK_OUT2_S 4 -#define CLK_OUT2_M (CLK_OUT2_V << CLK_OUT2_S) -#define CLK_OUT1 0xf -#define CLK_OUT1_V CLK_OUT1 -#define CLK_OUT1_S 0 -#define CLK_OUT1_M (CLK_OUT1_V << CLK_OUT1_S) - -#define PERIPHS_IO_MUX_GPIO0_U (DR_REG_IO_MUX_BASE +0x44) -#define IO_MUX_GPIO0_REG PERIPHS_IO_MUX_GPIO0_U -#define FUNC_GPIO0_EMAC_TX_CLK 5 -#define FUNC_GPIO0_GPIO0 2 -#define FUNC_GPIO0_CLK_OUT1 1 -#define FUNC_GPIO0_GPIO0_0 0 - -#define PERIPHS_IO_MUX_U0TXD_U (DR_REG_IO_MUX_BASE +0x88) -#define IO_MUX_GPIO1_REG PERIPHS_IO_MUX_U0TXD_U -#define FUNC_U0TXD_EMAC_RXD2 5 -#define FUNC_U0TXD_GPIO1 2 -#define FUNC_U0TXD_CLK_OUT3 1 -#define FUNC_U0TXD_U0TXD 0 - -#define PERIPHS_IO_MUX_GPIO2_U (DR_REG_IO_MUX_BASE +0x40) -#define IO_MUX_GPIO2_REG PERIPHS_IO_MUX_GPIO2_U -#define FUNC_GPIO2_SD_DATA0 4 -#define FUNC_GPIO2_HS2_DATA0 3 -#define FUNC_GPIO2_GPIO2 2 -#define FUNC_GPIO2_HSPIWP 1 -#define FUNC_GPIO2_GPIO2_0 0 - -#define PERIPHS_IO_MUX_U0RXD_U (DR_REG_IO_MUX_BASE +0x84) -#define IO_MUX_GPIO3_REG PERIPHS_IO_MUX_U0RXD_U -#define FUNC_U0RXD_GPIO3 2 -#define FUNC_U0RXD_CLK_OUT2 1 -#define FUNC_U0RXD_U0RXD 0 - -#define PERIPHS_IO_MUX_GPIO4_U (DR_REG_IO_MUX_BASE +0x48) -#define IO_MUX_GPIO4_REG PERIPHS_IO_MUX_GPIO4_U -#define FUNC_GPIO4_EMAC_TX_ER 5 -#define FUNC_GPIO4_SD_DATA1 4 -#define FUNC_GPIO4_HS2_DATA1 3 -#define FUNC_GPIO4_GPIO4 2 -#define FUNC_GPIO4_HSPIHD 1 -#define FUNC_GPIO4_GPIO4_0 0 - -#define PERIPHS_IO_MUX_GPIO5_U (DR_REG_IO_MUX_BASE +0x6c) -#define IO_MUX_GPIO5_REG PERIPHS_IO_MUX_GPIO5_U -#define FUNC_GPIO5_EMAC_RX_CLK 5 -#define FUNC_GPIO5_HS1_DATA6 3 -#define FUNC_GPIO5_GPIO5 2 -#define FUNC_GPIO5_VSPICS0 1 -#define FUNC_GPIO5_GPIO5_0 0 - -#define PERIPHS_IO_MUX_SD_CLK_U (DR_REG_IO_MUX_BASE +0x60) -#define IO_MUX_GPIO6_REG PERIPHS_IO_MUX_SD_CLK_U -#define FUNC_SD_CLK_U1CTS 4 -#define FUNC_SD_CLK_HS1_CLK 3 -#define FUNC_SD_CLK_GPIO6 2 -#define FUNC_SD_CLK_SPICLK 1 -#define FUNC_SD_CLK_SD_CLK 0 - -#define PERIPHS_IO_MUX_SD_DATA0_U (DR_REG_IO_MUX_BASE +0x64) -#define IO_MUX_GPIO7_REG PERIPHS_IO_MUX_SD_DATA0_U -#define FUNC_SD_DATA0_U2RTS 4 -#define FUNC_SD_DATA0_HS1_DATA0 3 -#define FUNC_SD_DATA0_GPIO7 2 -#define FUNC_SD_DATA0_SPIQ 1 -#define FUNC_SD_DATA0_SD_DATA0 0 - -#define PERIPHS_IO_MUX_SD_DATA1_U (DR_REG_IO_MUX_BASE +0x68) -#define IO_MUX_GPIO8_REG PERIPHS_IO_MUX_SD_DATA1_U -#define FUNC_SD_DATA1_U2CTS 4 -#define FUNC_SD_DATA1_HS1_DATA1 3 -#define FUNC_SD_DATA1_GPIO8 2 -#define FUNC_SD_DATA1_SPID 1 -#define FUNC_SD_DATA1_SD_DATA1 0 - -#define PERIPHS_IO_MUX_SD_DATA2_U (DR_REG_IO_MUX_BASE +0x54) -#define IO_MUX_GPIO9_REG PERIPHS_IO_MUX_SD_DATA2_U -#define FUNC_SD_DATA2_U1RXD 4 -#define FUNC_SD_DATA2_HS1_DATA2 3 -#define FUNC_SD_DATA2_GPIO9 2 -#define FUNC_SD_DATA2_SPIHD 1 -#define FUNC_SD_DATA2_SD_DATA2 0 - -#define PERIPHS_IO_MUX_SD_DATA3_U (DR_REG_IO_MUX_BASE +0x58) -#define IO_MUX_GPIO10_REG PERIPHS_IO_MUX_SD_DATA3_U -#define FUNC_SD_DATA3_U1TXD 4 -#define FUNC_SD_DATA3_HS1_DATA3 3 -#define FUNC_SD_DATA3_GPIO10 2 -#define FUNC_SD_DATA3_SPIWP 1 -#define FUNC_SD_DATA3_SD_DATA3 0 - -#define PERIPHS_IO_MUX_SD_CMD_U (DR_REG_IO_MUX_BASE +0x5c) -#define IO_MUX_GPIO11_REG PERIPHS_IO_MUX_SD_CMD_U -#define FUNC_SD_CMD_U1RTS 4 -#define FUNC_SD_CMD_HS1_CMD 3 -#define FUNC_SD_CMD_GPIO11 2 -#define FUNC_SD_CMD_SPICS0 1 -#define FUNC_SD_CMD_SD_CMD 0 - -#define PERIPHS_IO_MUX_MTDI_U (DR_REG_IO_MUX_BASE +0x34) -#define IO_MUX_GPIO12_REG PERIPHS_IO_MUX_MTDI_U -#define FUNC_MTDI_EMAC_TXD3 5 -#define FUNC_MTDI_SD_DATA2 4 -#define FUNC_MTDI_HS2_DATA2 3 -#define FUNC_MTDI_GPIO12 2 -#define FUNC_MTDI_HSPIQ 1 -#define FUNC_MTDI_MTDI 0 - -#define PERIPHS_IO_MUX_MTCK_U (DR_REG_IO_MUX_BASE +0x38) -#define IO_MUX_GPIO13_REG PERIPHS_IO_MUX_MTCK_U -#define FUNC_MTCK_EMAC_RX_ER 5 -#define FUNC_MTCK_SD_DATA3 4 -#define FUNC_MTCK_HS2_DATA3 3 -#define FUNC_MTCK_GPIO13 2 -#define FUNC_MTCK_HSPID 1 -#define FUNC_MTCK_MTCK 0 - -#define PERIPHS_IO_MUX_MTMS_U (DR_REG_IO_MUX_BASE +0x30) -#define IO_MUX_GPIO14_REG PERIPHS_IO_MUX_MTMS_U -#define FUNC_MTMS_EMAC_TXD2 5 -#define FUNC_MTMS_SD_CLK 4 -#define FUNC_MTMS_HS2_CLK 3 -#define FUNC_MTMS_GPIO14 2 -#define FUNC_MTMS_HSPICLK 1 -#define FUNC_MTMS_MTMS 0 - -#define PERIPHS_IO_MUX_MTDO_U (DR_REG_IO_MUX_BASE +0x3c) -#define IO_MUX_GPIO15_REG PERIPHS_IO_MUX_MTDO_U -#define FUNC_MTDO_EMAC_RXD3 5 -#define FUNC_MTDO_SD_CMD 4 -#define FUNC_MTDO_HS2_CMD 3 -#define FUNC_MTDO_GPIO15 2 -#define FUNC_MTDO_HSPICS0 1 -#define FUNC_MTDO_MTDO 0 - -#define PERIPHS_IO_MUX_GPIO16_U (DR_REG_IO_MUX_BASE +0x4c) -#define IO_MUX_GPIO16_REG PERIPHS_IO_MUX_GPIO16_U -#define FUNC_GPIO16_EMAC_CLK_OUT 5 -#define FUNC_GPIO16_U2RXD 4 -#define FUNC_GPIO16_HS1_DATA4 3 -#define FUNC_GPIO16_GPIO16 2 -#define FUNC_GPIO16_GPIO16_0 0 - -#define PERIPHS_IO_MUX_GPIO17_U (DR_REG_IO_MUX_BASE +0x50) -#define IO_MUX_GPIO17_REG PERIPHS_IO_MUX_GPIO17_U -#define FUNC_GPIO17_EMAC_CLK_OUT_180 5 -#define FUNC_GPIO17_U2TXD 4 -#define FUNC_GPIO17_HS1_DATA5 3 -#define FUNC_GPIO17_GPIO17 2 -#define FUNC_GPIO17_GPIO17_0 0 - -#define PERIPHS_IO_MUX_GPIO18_U (DR_REG_IO_MUX_BASE +0x70) -#define IO_MUX_GPIO18_REG PERIPHS_IO_MUX_GPIO18_U -#define FUNC_GPIO18_HS1_DATA7 3 -#define FUNC_GPIO18_GPIO18 2 -#define FUNC_GPIO18_VSPICLK 1 -#define FUNC_GPIO18_GPIO18_0 0 - -#define PERIPHS_IO_MUX_GPIO19_U (DR_REG_IO_MUX_BASE +0x74) -#define IO_MUX_GPIO19_REG PERIPHS_IO_MUX_GPIO19_U -#define FUNC_GPIO19_EMAC_TXD0 5 -#define FUNC_GPIO19_U0CTS 3 -#define FUNC_GPIO19_GPIO19 2 -#define FUNC_GPIO19_VSPIQ 1 -#define FUNC_GPIO19_GPIO19_0 0 - -#define PERIPHS_IO_MUX_GPIO20_U (DR_REG_IO_MUX_BASE +0x78) -#define IO_MUX_GPIO20_REG PERIPHS_IO_MUX_GPIO20_U -#define FUNC_GPIO20_GPIO20 2 -#define FUNC_GPIO20_GPIO20_0 0 - -#define PERIPHS_IO_MUX_GPIO21_U (DR_REG_IO_MUX_BASE +0x7c) -#define IO_MUX_GPIO21_REG PERIPHS_IO_MUX_GPIO21_U -#define FUNC_GPIO21_EMAC_TX_EN 5 -#define FUNC_GPIO21_GPIO21 2 -#define FUNC_GPIO21_VSPIHD 1 -#define FUNC_GPIO21_GPIO21_0 0 - -#define PERIPHS_IO_MUX_GPIO22_U (DR_REG_IO_MUX_BASE +0x80) -#define IO_MUX_GPIO22_REG PERIPHS_IO_MUX_GPIO22_U -#define FUNC_GPIO22_EMAC_TXD1 5 -#define FUNC_GPIO22_U0RTS 3 -#define FUNC_GPIO22_GPIO22 2 -#define FUNC_GPIO22_VSPIWP 1 -#define FUNC_GPIO22_GPIO22_0 0 - -#define PERIPHS_IO_MUX_GPIO23_U (DR_REG_IO_MUX_BASE +0x8c) -#define IO_MUX_GPIO23_REG PERIPHS_IO_MUX_GPIO23_U -#define FUNC_GPIO23_HS1_STROBE 3 -#define FUNC_GPIO23_GPIO23 2 -#define FUNC_GPIO23_VSPID 1 -#define FUNC_GPIO23_GPIO23_0 0 - -#define PERIPHS_IO_MUX_GPIO24_U (DR_REG_IO_MUX_BASE +0x90) -#define IO_MUX_GPIO24_REG PERIPHS_IO_MUX_GPIO24_U -#define FUNC_GPIO24_GPIO24 2 -#define FUNC_GPIO24_GPIO24_0 0 - -#define PERIPHS_IO_MUX_GPIO25_U (DR_REG_IO_MUX_BASE +0x24) -#define IO_MUX_GPIO25_REG PERIPHS_IO_MUX_GPIO25_U -#define FUNC_GPIO25_EMAC_RXD0 5 -#define FUNC_GPIO25_GPIO25 2 -#define FUNC_GPIO25_GPIO25_0 0 - -#define PERIPHS_IO_MUX_GPIO26_U (DR_REG_IO_MUX_BASE +0x28) -#define IO_MUX_GPIO26_REG PERIPHS_IO_MUX_GPIO26_U -#define FUNC_GPIO26_EMAC_RXD1 5 -#define FUNC_GPIO26_GPIO26 2 -#define FUNC_GPIO26_GPIO26_0 0 - -#define PERIPHS_IO_MUX_GPIO27_U (DR_REG_IO_MUX_BASE +0x2c) -#define IO_MUX_GPIO27_REG PERIPHS_IO_MUX_GPIO27_U -#define FUNC_GPIO27_EMAC_RX_DV 5 -#define FUNC_GPIO27_GPIO27 2 -#define FUNC_GPIO27_GPIO27_0 0 - -#define PERIPHS_IO_MUX_GPIO32_U (DR_REG_IO_MUX_BASE +0x1c) -#define IO_MUX_GPIO32_REG PERIPHS_IO_MUX_GPIO32_U -#define FUNC_GPIO32_GPIO32 2 -#define FUNC_GPIO32_GPIO32_0 0 - -#define PERIPHS_IO_MUX_GPIO33_U (DR_REG_IO_MUX_BASE +0x20) -#define IO_MUX_GPIO33_REG PERIPHS_IO_MUX_GPIO33_U -#define FUNC_GPIO33_GPIO33 2 -#define FUNC_GPIO33_GPIO33_0 0 - -#define PERIPHS_IO_MUX_GPIO34_U (DR_REG_IO_MUX_BASE +0x14) -#define IO_MUX_GPIO34_REG PERIPHS_IO_MUX_GPIO34_U -#define FUNC_GPIO34_GPIO34 2 -#define FUNC_GPIO34_GPIO34_0 0 - -#define PERIPHS_IO_MUX_GPIO35_U (DR_REG_IO_MUX_BASE +0x18) -#define IO_MUX_GPIO35_REG PERIPHS_IO_MUX_GPIO35_U -#define FUNC_GPIO35_GPIO35 2 -#define FUNC_GPIO35_GPIO35_0 0 - -#define PERIPHS_IO_MUX_GPIO36_U (DR_REG_IO_MUX_BASE +0x04) -#define IO_MUX_GPIO36_REG PERIPHS_IO_MUX_GPIO36_U -#define FUNC_GPIO36_GPIO36 2 -#define FUNC_GPIO36_GPIO36_0 0 - -#define PERIPHS_IO_MUX_GPIO37_U (DR_REG_IO_MUX_BASE +0x08) -#define IO_MUX_GPIO37_REG PERIPHS_IO_MUX_GPIO37_U -#define FUNC_GPIO37_GPIO37 2 -#define FUNC_GPIO37_GPIO37_0 0 - -#define PERIPHS_IO_MUX_GPIO38_U (DR_REG_IO_MUX_BASE +0x0c) -#define IO_MUX_GPIO38_REG PERIPHS_IO_MUX_GPIO38_U -#define FUNC_GPIO38_GPIO38 2 -#define FUNC_GPIO38_GPIO38_0 0 - -#define PERIPHS_IO_MUX_GPIO39_U (DR_REG_IO_MUX_BASE +0x10) -#define IO_MUX_GPIO39_REG PERIPHS_IO_MUX_GPIO39_U -#define FUNC_GPIO39_GPIO39 2 -#define FUNC_GPIO39_GPIO39_0 0 - -#endif /* _SOC_IO_MUX_REG_H_ */ diff --git a/tools/sdk/include/soc/soc/ledc_reg.h b/tools/sdk/include/soc/soc/ledc_reg.h deleted file mode 100644 index 6d6abf8b878..00000000000 --- a/tools/sdk/include/soc/soc/ledc_reg.h +++ /dev/null @@ -1,2423 +0,0 @@ -// 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. -#ifndef _SOC_LEDC_REG_H_ -#define _SOC_LEDC_REG_H_ - - -#include "soc.h" -#define LEDC_HSCH0_CONF0_REG (DR_REG_LEDC_BASE + 0x0000) -/* LEDC_CLK_EN : R/W ;bitpos:[31] ;default: 1'h0 ; */ -/*description: This bit is clock gating control signal. when software config - LED_PWM internal registers it controls the register clock.*/ -#define LEDC_CLK_EN (BIT(31)) -#define LEDC_CLK_EN_M (BIT(31)) -#define LEDC_CLK_EN_V 0x1 -#define LEDC_CLK_EN_S 31 -/* LEDC_IDLE_LV_HSCH0 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: This bit is used to control the output value when high speed channel0 is off.*/ -#define LEDC_IDLE_LV_HSCH0 (BIT(3)) -#define LEDC_IDLE_LV_HSCH0_M (BIT(3)) -#define LEDC_IDLE_LV_HSCH0_V 0x1 -#define LEDC_IDLE_LV_HSCH0_S 3 -/* LEDC_SIG_OUT_EN_HSCH0 : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: This is the output enable control bit for high speed channel0*/ -#define LEDC_SIG_OUT_EN_HSCH0 (BIT(2)) -#define LEDC_SIG_OUT_EN_HSCH0_M (BIT(2)) -#define LEDC_SIG_OUT_EN_HSCH0_V 0x1 -#define LEDC_SIG_OUT_EN_HSCH0_S 2 -/* LEDC_TIMER_SEL_HSCH0 : R/W ;bitpos:[1:0] ;default: 2'd0 ; */ -/*description: There are four high speed timers the two bits are used to select - one of them for high speed channel0. 2'b00: seletc hstimer0. 2'b01: select hstimer1. 2'b10: select hstimer2. 2'b11: select hstimer3.*/ -#define LEDC_TIMER_SEL_HSCH0 0x00000003 -#define LEDC_TIMER_SEL_HSCH0_M ((LEDC_TIMER_SEL_HSCH0_V)<<(LEDC_TIMER_SEL_HSCH0_S)) -#define LEDC_TIMER_SEL_HSCH0_V 0x3 -#define LEDC_TIMER_SEL_HSCH0_S 0 - -#define LEDC_HSCH0_HPOINT_REG (DR_REG_LEDC_BASE + 0x0004) -/* LEDC_HPOINT_HSCH0 : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: The output value changes to high when htimerx(x=[0 3]) selected - by high speed channel0 has reached reg_hpoint_hsch0[19:0]*/ -#define LEDC_HPOINT_HSCH0 0x000FFFFF -#define LEDC_HPOINT_HSCH0_M ((LEDC_HPOINT_HSCH0_V)<<(LEDC_HPOINT_HSCH0_S)) -#define LEDC_HPOINT_HSCH0_V 0xFFFFF -#define LEDC_HPOINT_HSCH0_S 0 - -#define LEDC_HSCH0_DUTY_REG (DR_REG_LEDC_BASE + 0x0008) -/* LEDC_DUTY_HSCH0 : R/W ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: The register is used to control output duty. When hstimerx(x=[0 - 3]) choosed by high speed channel0 has reached reg_lpoint_hsch0 the output signal changes to low. reg_lpoint_hsch0=(reg_hpoint_hsch0[19:0]+reg_duty_hsch0[24:4]) (1) reg_lpoint_hsch0=(reg_hpoint_hsch0[19:0]+reg_duty_hsch0[24:4] +1) (2) The least four bits in this register represent the decimal part and determines when to choose (1) or (2)*/ -#define LEDC_DUTY_HSCH0 0x01FFFFFF -#define LEDC_DUTY_HSCH0_M ((LEDC_DUTY_HSCH0_V)<<(LEDC_DUTY_HSCH0_S)) -#define LEDC_DUTY_HSCH0_V 0x1FFFFFF -#define LEDC_DUTY_HSCH0_S 0 - -#define LEDC_HSCH0_CONF1_REG (DR_REG_LEDC_BASE + 0x000C) -/* LEDC_DUTY_START_HSCH0 : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When reg_duty_num_hsch0 reg_duty_cycle_hsch0 and reg_duty_scale_hsch0 - has been configured. these register won't take effect until set reg_duty_start_hsch0. this bit is automatically cleared by hardware.*/ -#define LEDC_DUTY_START_HSCH0 (BIT(31)) -#define LEDC_DUTY_START_HSCH0_M (BIT(31)) -#define LEDC_DUTY_START_HSCH0_V 0x1 -#define LEDC_DUTY_START_HSCH0_S 31 -/* LEDC_DUTY_INC_HSCH0 : R/W ;bitpos:[30] ;default: 1'b1 ; */ -/*description: This register is used to increase the duty of output signal or - decrease the duty of output signal for high speed channel0.*/ -#define LEDC_DUTY_INC_HSCH0 (BIT(30)) -#define LEDC_DUTY_INC_HSCH0_M (BIT(30)) -#define LEDC_DUTY_INC_HSCH0_V 0x1 -#define LEDC_DUTY_INC_HSCH0_S 30 -/* LEDC_DUTY_NUM_HSCH0 : R/W ;bitpos:[29:20] ;default: 10'h0 ; */ -/*description: This register is used to control the num of increased or decreased - times for high speed channel0.*/ -#define LEDC_DUTY_NUM_HSCH0 0x000003FF -#define LEDC_DUTY_NUM_HSCH0_M ((LEDC_DUTY_NUM_HSCH0_V)<<(LEDC_DUTY_NUM_HSCH0_S)) -#define LEDC_DUTY_NUM_HSCH0_V 0x3FF -#define LEDC_DUTY_NUM_HSCH0_S 20 -/* LEDC_DUTY_CYCLE_HSCH0 : R/W ;bitpos:[19:10] ;default: 10'h0 ; */ -/*description: This register is used to increase or decrease the duty every - reg_duty_cycle_hsch0 cycles for high speed channel0.*/ -#define LEDC_DUTY_CYCLE_HSCH0 0x000003FF -#define LEDC_DUTY_CYCLE_HSCH0_M ((LEDC_DUTY_CYCLE_HSCH0_V)<<(LEDC_DUTY_CYCLE_HSCH0_S)) -#define LEDC_DUTY_CYCLE_HSCH0_V 0x3FF -#define LEDC_DUTY_CYCLE_HSCH0_S 10 -/* LEDC_DUTY_SCALE_HSCH0 : R/W ;bitpos:[9:0] ;default: 10'h0 ; */ -/*description: This register controls the increase or decrease step scale for - high speed channel0.*/ -#define LEDC_DUTY_SCALE_HSCH0 0x000003FF -#define LEDC_DUTY_SCALE_HSCH0_M ((LEDC_DUTY_SCALE_HSCH0_V)<<(LEDC_DUTY_SCALE_HSCH0_S)) -#define LEDC_DUTY_SCALE_HSCH0_V 0x3FF -#define LEDC_DUTY_SCALE_HSCH0_S 0 - -#define LEDC_HSCH0_DUTY_R_REG (DR_REG_LEDC_BASE + 0x0010) -/* LEDC_DUTY_HSCH0 : RO ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: This register represents the current duty of the output signal - for high speed channel0.*/ -#define LEDC_DUTY_HSCH0 0x01FFFFFF -#define LEDC_DUTY_HSCH0_M ((LEDC_DUTY_HSCH0_V)<<(LEDC_DUTY_HSCH0_S)) -#define LEDC_DUTY_HSCH0_V 0x1FFFFFF -#define LEDC_DUTY_HSCH0_S 0 - -#define LEDC_HSCH1_CONF0_REG (DR_REG_LEDC_BASE + 0x0014) -/* LEDC_IDLE_LV_HSCH1 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: This bit is used to control the output value when high speed channel1 is off.*/ -#define LEDC_IDLE_LV_HSCH1 (BIT(3)) -#define LEDC_IDLE_LV_HSCH1_M (BIT(3)) -#define LEDC_IDLE_LV_HSCH1_V 0x1 -#define LEDC_IDLE_LV_HSCH1_S 3 -/* LEDC_SIG_OUT_EN_HSCH1 : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: This is the output enable control bit for high speed channel1*/ -#define LEDC_SIG_OUT_EN_HSCH1 (BIT(2)) -#define LEDC_SIG_OUT_EN_HSCH1_M (BIT(2)) -#define LEDC_SIG_OUT_EN_HSCH1_V 0x1 -#define LEDC_SIG_OUT_EN_HSCH1_S 2 -/* LEDC_TIMER_SEL_HSCH1 : R/W ;bitpos:[1:0] ;default: 2'd0 ; */ -/*description: There are four high speed timers the two bits are used to select - one of them for high speed channel1. 2'b00: seletc hstimer0. 2'b01: select hstimer1. 2'b10: select hstimer2. 2'b11: select hstimer3.*/ -#define LEDC_TIMER_SEL_HSCH1 0x00000003 -#define LEDC_TIMER_SEL_HSCH1_M ((LEDC_TIMER_SEL_HSCH1_V)<<(LEDC_TIMER_SEL_HSCH1_S)) -#define LEDC_TIMER_SEL_HSCH1_V 0x3 -#define LEDC_TIMER_SEL_HSCH1_S 0 - -#define LEDC_HSCH1_HPOINT_REG (DR_REG_LEDC_BASE + 0x0018) -/* LEDC_HPOINT_HSCH1 : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: The output value changes to high when htimerx(x=[0 3]) selected - by high speed channel1 has reached reg_hpoint_hsch1[19:0]*/ -#define LEDC_HPOINT_HSCH1 0x000FFFFF -#define LEDC_HPOINT_HSCH1_M ((LEDC_HPOINT_HSCH1_V)<<(LEDC_HPOINT_HSCH1_S)) -#define LEDC_HPOINT_HSCH1_V 0xFFFFF -#define LEDC_HPOINT_HSCH1_S 0 - -#define LEDC_HSCH1_DUTY_REG (DR_REG_LEDC_BASE + 0x001C) -/* LEDC_DUTY_HSCH1 : R/W ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: The register is used to control output duty. When hstimerx(x=[0 - 3]) choosed by high speed channel1 has reached reg_lpoint_hsch1 the output signal changes to low. reg_lpoint_hsch1=(reg_hpoint_hsch1[19:0]+reg_duty_hsch1[24:4]) (1) reg_lpoint_hsch1=(reg_hpoint_hsch1[19:0]+reg_duty_hsch1[24:4] +1) (2) The least four bits in this register represent the decimal part and determines when to choose (1) or (2)*/ -#define LEDC_DUTY_HSCH1 0x01FFFFFF -#define LEDC_DUTY_HSCH1_M ((LEDC_DUTY_HSCH1_V)<<(LEDC_DUTY_HSCH1_S)) -#define LEDC_DUTY_HSCH1_V 0x1FFFFFF -#define LEDC_DUTY_HSCH1_S 0 - -#define LEDC_HSCH1_CONF1_REG (DR_REG_LEDC_BASE + 0x0020) -/* LEDC_DUTY_START_HSCH1 : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When reg_duty_num_hsch1 reg_duty_cycle_hsch1 and reg_duty_scale_hsch1 - has been configured. these register won't take effect until set reg_duty_start_hsch1. this bit is automatically cleared by hardware.*/ -#define LEDC_DUTY_START_HSCH1 (BIT(31)) -#define LEDC_DUTY_START_HSCH1_M (BIT(31)) -#define LEDC_DUTY_START_HSCH1_V 0x1 -#define LEDC_DUTY_START_HSCH1_S 31 -/* LEDC_DUTY_INC_HSCH1 : R/W ;bitpos:[30] ;default: 1'b1 ; */ -/*description: This register is used to increase the duty of output signal or - decrease the duty of output signal for high speed channel1.*/ -#define LEDC_DUTY_INC_HSCH1 (BIT(30)) -#define LEDC_DUTY_INC_HSCH1_M (BIT(30)) -#define LEDC_DUTY_INC_HSCH1_V 0x1 -#define LEDC_DUTY_INC_HSCH1_S 30 -/* LEDC_DUTY_NUM_HSCH1 : R/W ;bitpos:[29:20] ;default: 10'h0 ; */ -/*description: This register is used to control the num of increased or decreased - times for high speed channel1.*/ -#define LEDC_DUTY_NUM_HSCH1 0x000003FF -#define LEDC_DUTY_NUM_HSCH1_M ((LEDC_DUTY_NUM_HSCH1_V)<<(LEDC_DUTY_NUM_HSCH1_S)) -#define LEDC_DUTY_NUM_HSCH1_V 0x3FF -#define LEDC_DUTY_NUM_HSCH1_S 20 -/* LEDC_DUTY_CYCLE_HSCH1 : R/W ;bitpos:[19:10] ;default: 10'h0 ; */ -/*description: This register is used to increase or decrease the duty every - reg_duty_cycle_hsch1 cycles for high speed channel1.*/ -#define LEDC_DUTY_CYCLE_HSCH1 0x000003FF -#define LEDC_DUTY_CYCLE_HSCH1_M ((LEDC_DUTY_CYCLE_HSCH1_V)<<(LEDC_DUTY_CYCLE_HSCH1_S)) -#define LEDC_DUTY_CYCLE_HSCH1_V 0x3FF -#define LEDC_DUTY_CYCLE_HSCH1_S 10 -/* LEDC_DUTY_SCALE_HSCH1 : R/W ;bitpos:[9:0] ;default: 10'h0 ; */ -/*description: This register controls the increase or decrease step scale for - high speed channel1.*/ -#define LEDC_DUTY_SCALE_HSCH1 0x000003FF -#define LEDC_DUTY_SCALE_HSCH1_M ((LEDC_DUTY_SCALE_HSCH1_V)<<(LEDC_DUTY_SCALE_HSCH1_S)) -#define LEDC_DUTY_SCALE_HSCH1_V 0x3FF -#define LEDC_DUTY_SCALE_HSCH1_S 0 - -#define LEDC_HSCH1_DUTY_R_REG (DR_REG_LEDC_BASE + 0x0024) -/* LEDC_DUTY_HSCH1 : RO ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: This register represents the current duty of the output signal - for high speed channel1.*/ -#define LEDC_DUTY_HSCH1 0x01FFFFFF -#define LEDC_DUTY_HSCH1_M ((LEDC_DUTY_HSCH1_V)<<(LEDC_DUTY_HSCH1_S)) -#define LEDC_DUTY_HSCH1_V 0x1FFFFFF -#define LEDC_DUTY_HSCH1_S 0 - -#define LEDC_HSCH2_CONF0_REG (DR_REG_LEDC_BASE + 0x0028) -/* LEDC_IDLE_LV_HSCH2 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: This bit is used to control the output value when high speed channel2 is off.*/ -#define LEDC_IDLE_LV_HSCH2 (BIT(3)) -#define LEDC_IDLE_LV_HSCH2_M (BIT(3)) -#define LEDC_IDLE_LV_HSCH2_V 0x1 -#define LEDC_IDLE_LV_HSCH2_S 3 -/* LEDC_SIG_OUT_EN_HSCH2 : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: This is the output enable control bit for high speed channel2*/ -#define LEDC_SIG_OUT_EN_HSCH2 (BIT(2)) -#define LEDC_SIG_OUT_EN_HSCH2_M (BIT(2)) -#define LEDC_SIG_OUT_EN_HSCH2_V 0x1 -#define LEDC_SIG_OUT_EN_HSCH2_S 2 -/* LEDC_TIMER_SEL_HSCH2 : R/W ;bitpos:[1:0] ;default: 2'd0 ; */ -/*description: There are four high speed timers the two bits are used to select - one of them for high speed channel2. 2'b00: seletc hstimer0. 2'b01: select hstimer1. 2'b10: select hstimer2. 2'b11: select hstimer3.*/ -#define LEDC_TIMER_SEL_HSCH2 0x00000003 -#define LEDC_TIMER_SEL_HSCH2_M ((LEDC_TIMER_SEL_HSCH2_V)<<(LEDC_TIMER_SEL_HSCH2_S)) -#define LEDC_TIMER_SEL_HSCH2_V 0x3 -#define LEDC_TIMER_SEL_HSCH2_S 0 - -#define LEDC_HSCH2_HPOINT_REG (DR_REG_LEDC_BASE + 0x002C) -/* LEDC_HPOINT_HSCH2 : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: The output value changes to high when htimerx(x=[0 3]) selected - by high speed channel2 has reached reg_hpoint_hsch2[19:0]*/ -#define LEDC_HPOINT_HSCH2 0x000FFFFF -#define LEDC_HPOINT_HSCH2_M ((LEDC_HPOINT_HSCH2_V)<<(LEDC_HPOINT_HSCH2_S)) -#define LEDC_HPOINT_HSCH2_V 0xFFFFF -#define LEDC_HPOINT_HSCH2_S 0 - -#define LEDC_HSCH2_DUTY_REG (DR_REG_LEDC_BASE + 0x0030) -/* LEDC_DUTY_HSCH2 : R/W ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: The register is used to control output duty. When hstimerx(x=[0 - 3]) choosed by high speed channel2 has reached reg_lpoint_hsch2 the output signal changes to low. reg_lpoint_hsch2=(reg_hpoint_hsch2[19:0]+reg_duty_hsch2[24:4]) (1) reg_lpoint_hsch2=(reg_hpoint_hsch2[19:0]+reg_duty_hsch2[24:4] +1) (2) The least four bits in this register represent the decimal part and determines when to choose (1) or (2)*/ -#define LEDC_DUTY_HSCH2 0x01FFFFFF -#define LEDC_DUTY_HSCH2_M ((LEDC_DUTY_HSCH2_V)<<(LEDC_DUTY_HSCH2_S)) -#define LEDC_DUTY_HSCH2_V 0x1FFFFFF -#define LEDC_DUTY_HSCH2_S 0 - -#define LEDC_HSCH2_CONF1_REG (DR_REG_LEDC_BASE + 0x0034) -/* LEDC_DUTY_START_HSCH2 : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When reg_duty_num_hsch2 reg_duty_cycle_hsch2 and reg_duty_scale_hsch2 - has been configured. these register won't take effect until set reg_duty_start_hsch2. this bit is automatically cleared by hardware.*/ -#define LEDC_DUTY_START_HSCH2 (BIT(31)) -#define LEDC_DUTY_START_HSCH2_M (BIT(31)) -#define LEDC_DUTY_START_HSCH2_V 0x1 -#define LEDC_DUTY_START_HSCH2_S 31 -/* LEDC_DUTY_INC_HSCH2 : R/W ;bitpos:[30] ;default: 1'b1 ; */ -/*description: This register is used to increase the duty of output signal or - decrease the duty of output signal for high speed channel2.*/ -#define LEDC_DUTY_INC_HSCH2 (BIT(30)) -#define LEDC_DUTY_INC_HSCH2_M (BIT(30)) -#define LEDC_DUTY_INC_HSCH2_V 0x1 -#define LEDC_DUTY_INC_HSCH2_S 30 -/* LEDC_DUTY_NUM_HSCH2 : R/W ;bitpos:[29:20] ;default: 10'h0 ; */ -/*description: This register is used to control the num of increased or decreased - times for high speed channel2.*/ -#define LEDC_DUTY_NUM_HSCH2 0x000003FF -#define LEDC_DUTY_NUM_HSCH2_M ((LEDC_DUTY_NUM_HSCH2_V)<<(LEDC_DUTY_NUM_HSCH2_S)) -#define LEDC_DUTY_NUM_HSCH2_V 0x3FF -#define LEDC_DUTY_NUM_HSCH2_S 20 -/* LEDC_DUTY_CYCLE_HSCH2 : R/W ;bitpos:[19:10] ;default: 10'h0 ; */ -/*description: This register is used to increase or decrease the duty every - reg_duty_cycle_hsch2 cycles for high speed channel2.*/ -#define LEDC_DUTY_CYCLE_HSCH2 0x000003FF -#define LEDC_DUTY_CYCLE_HSCH2_M ((LEDC_DUTY_CYCLE_HSCH2_V)<<(LEDC_DUTY_CYCLE_HSCH2_S)) -#define LEDC_DUTY_CYCLE_HSCH2_V 0x3FF -#define LEDC_DUTY_CYCLE_HSCH2_S 10 -/* LEDC_DUTY_SCALE_HSCH2 : R/W ;bitpos:[9:0] ;default: 10'h0 ; */ -/*description: This register controls the increase or decrease step scale for - high speed channel2.*/ -#define LEDC_DUTY_SCALE_HSCH2 0x000003FF -#define LEDC_DUTY_SCALE_HSCH2_M ((LEDC_DUTY_SCALE_HSCH2_V)<<(LEDC_DUTY_SCALE_HSCH2_S)) -#define LEDC_DUTY_SCALE_HSCH2_V 0x3FF -#define LEDC_DUTY_SCALE_HSCH2_S 0 - -#define LEDC_HSCH2_DUTY_R_REG (DR_REG_LEDC_BASE + 0x0038) -/* LEDC_DUTY_HSCH2 : RO ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: This register represents the current duty of the output signal - for high speed channel2.*/ -#define LEDC_DUTY_HSCH2 0x01FFFFFF -#define LEDC_DUTY_HSCH2_M ((LEDC_DUTY_HSCH2_V)<<(LEDC_DUTY_HSCH2_S)) -#define LEDC_DUTY_HSCH2_V 0x1FFFFFF -#define LEDC_DUTY_HSCH2_S 0 - -#define LEDC_HSCH3_CONF0_REG (DR_REG_LEDC_BASE + 0x003C) -/* LEDC_IDLE_LV_HSCH3 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: This bit is used to control the output value when high speed channel3 is off.*/ -#define LEDC_IDLE_LV_HSCH3 (BIT(3)) -#define LEDC_IDLE_LV_HSCH3_M (BIT(3)) -#define LEDC_IDLE_LV_HSCH3_V 0x1 -#define LEDC_IDLE_LV_HSCH3_S 3 -/* LEDC_SIG_OUT_EN_HSCH3 : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: This is the output enable control bit for high speed channel3*/ -#define LEDC_SIG_OUT_EN_HSCH3 (BIT(2)) -#define LEDC_SIG_OUT_EN_HSCH3_M (BIT(2)) -#define LEDC_SIG_OUT_EN_HSCH3_V 0x1 -#define LEDC_SIG_OUT_EN_HSCH3_S 2 -/* LEDC_TIMER_SEL_HSCH3 : R/W ;bitpos:[1:0] ;default: 2'd0 ; */ -/*description: There are four high speed timers the two bits are used to select - one of them for high speed channel3. 2'b00: seletc hstimer0. 2'b01: select hstimer1. 2'b10: select hstimer2. 2'b11: select hstimer3.*/ -#define LEDC_TIMER_SEL_HSCH3 0x00000003 -#define LEDC_TIMER_SEL_HSCH3_M ((LEDC_TIMER_SEL_HSCH3_V)<<(LEDC_TIMER_SEL_HSCH3_S)) -#define LEDC_TIMER_SEL_HSCH3_V 0x3 -#define LEDC_TIMER_SEL_HSCH3_S 0 - -#define LEDC_HSCH3_HPOINT_REG (DR_REG_LEDC_BASE + 0x0040) -/* LEDC_HPOINT_HSCH3 : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: The output value changes to high when htimerx(x=[0 3]) selected - by high speed channel3 has reached reg_hpoint_hsch3[19:0]*/ -#define LEDC_HPOINT_HSCH3 0x000FFFFF -#define LEDC_HPOINT_HSCH3_M ((LEDC_HPOINT_HSCH3_V)<<(LEDC_HPOINT_HSCH3_S)) -#define LEDC_HPOINT_HSCH3_V 0xFFFFF -#define LEDC_HPOINT_HSCH3_S 0 - -#define LEDC_HSCH3_DUTY_REG (DR_REG_LEDC_BASE + 0x0044) -/* LEDC_DUTY_HSCH3 : R/W ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: The register is used to control output duty. When hstimerx(x=[0 - 3]) choosed by high speed channel3 has reached reg_lpoint_hsch3 the output signal changes to low. reg_lpoint_hsch3=(reg_hpoint_hsch3[19:0]+reg_duty_hsch3[24:4]) (1) reg_lpoint_hsch3=(reg_hpoint_hsch3[19:0]+reg_duty_hsch3[24:4] +1) (2) The least four bits in this register represent the decimal part and determines when to choose (1) or (2)*/ -#define LEDC_DUTY_HSCH3 0x01FFFFFF -#define LEDC_DUTY_HSCH3_M ((LEDC_DUTY_HSCH3_V)<<(LEDC_DUTY_HSCH3_S)) -#define LEDC_DUTY_HSCH3_V 0x1FFFFFF -#define LEDC_DUTY_HSCH3_S 0 - -#define LEDC_HSCH3_CONF1_REG (DR_REG_LEDC_BASE + 0x0048) -/* LEDC_DUTY_START_HSCH3 : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When reg_duty_num_hsch3 reg_duty_cycle_hsch3 and reg_duty_scale_hsch3 - has been configured. these register won't take effect until set reg_duty_start_hsch3. this bit is automatically cleared by hardware.*/ -#define LEDC_DUTY_START_HSCH3 (BIT(31)) -#define LEDC_DUTY_START_HSCH3_M (BIT(31)) -#define LEDC_DUTY_START_HSCH3_V 0x1 -#define LEDC_DUTY_START_HSCH3_S 31 -/* LEDC_DUTY_INC_HSCH3 : R/W ;bitpos:[30] ;default: 1'b1 ; */ -/*description: This register is used to increase the duty of output signal or - decrease the duty of output signal for high speed channel3.*/ -#define LEDC_DUTY_INC_HSCH3 (BIT(30)) -#define LEDC_DUTY_INC_HSCH3_M (BIT(30)) -#define LEDC_DUTY_INC_HSCH3_V 0x1 -#define LEDC_DUTY_INC_HSCH3_S 30 -/* LEDC_DUTY_NUM_HSCH3 : R/W ;bitpos:[29:20] ;default: 10'h0 ; */ -/*description: This register is used to control the num of increased or decreased - times for high speed channel3.*/ -#define LEDC_DUTY_NUM_HSCH3 0x000003FF -#define LEDC_DUTY_NUM_HSCH3_M ((LEDC_DUTY_NUM_HSCH3_V)<<(LEDC_DUTY_NUM_HSCH3_S)) -#define LEDC_DUTY_NUM_HSCH3_V 0x3FF -#define LEDC_DUTY_NUM_HSCH3_S 20 -/* LEDC_DUTY_CYCLE_HSCH3 : R/W ;bitpos:[19:10] ;default: 10'h0 ; */ -/*description: This register is used to increase or decrease the duty every - reg_duty_cycle_hsch3 cycles for high speed channel3.*/ -#define LEDC_DUTY_CYCLE_HSCH3 0x000003FF -#define LEDC_DUTY_CYCLE_HSCH3_M ((LEDC_DUTY_CYCLE_HSCH3_V)<<(LEDC_DUTY_CYCLE_HSCH3_S)) -#define LEDC_DUTY_CYCLE_HSCH3_V 0x3FF -#define LEDC_DUTY_CYCLE_HSCH3_S 10 -/* LEDC_DUTY_SCALE_HSCH3 : R/W ;bitpos:[9:0] ;default: 10'h0 ; */ -/*description: This register controls the increase or decrease step scale for - high speed channel3.*/ -#define LEDC_DUTY_SCALE_HSCH3 0x000003FF -#define LEDC_DUTY_SCALE_HSCH3_M ((LEDC_DUTY_SCALE_HSCH3_V)<<(LEDC_DUTY_SCALE_HSCH3_S)) -#define LEDC_DUTY_SCALE_HSCH3_V 0x3FF -#define LEDC_DUTY_SCALE_HSCH3_S 0 - -#define LEDC_HSCH3_DUTY_R_REG (DR_REG_LEDC_BASE + 0x004C) -/* LEDC_DUTY_HSCH3 : RO ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: This register represents the current duty of the output signal - for high speed channel3.*/ -#define LEDC_DUTY_HSCH3 0x01FFFFFF -#define LEDC_DUTY_HSCH3_M ((LEDC_DUTY_HSCH3_V)<<(LEDC_DUTY_HSCH3_S)) -#define LEDC_DUTY_HSCH3_V 0x1FFFFFF -#define LEDC_DUTY_HSCH3_S 0 - -#define LEDC_HSCH4_CONF0_REG (DR_REG_LEDC_BASE + 0x0050) -/* LEDC_IDLE_LV_HSCH4 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: This bit is used to control the output value when high speed channel4 is off.*/ -#define LEDC_IDLE_LV_HSCH4 (BIT(3)) -#define LEDC_IDLE_LV_HSCH4_M (BIT(3)) -#define LEDC_IDLE_LV_HSCH4_V 0x1 -#define LEDC_IDLE_LV_HSCH4_S 3 -/* LEDC_SIG_OUT_EN_HSCH4 : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: This is the output enable control bit for high speed channel4*/ -#define LEDC_SIG_OUT_EN_HSCH4 (BIT(2)) -#define LEDC_SIG_OUT_EN_HSCH4_M (BIT(2)) -#define LEDC_SIG_OUT_EN_HSCH4_V 0x1 -#define LEDC_SIG_OUT_EN_HSCH4_S 2 -/* LEDC_TIMER_SEL_HSCH4 : R/W ;bitpos:[1:0] ;default: 2'd0 ; */ -/*description: There are four high speed timers the two bits are used to select - one of them for high speed channel4. 2'b00: seletc hstimer0. 2'b01: select hstimer1. 2'b10: select hstimer2. 2'b11: select hstimer3.*/ -#define LEDC_TIMER_SEL_HSCH4 0x00000003 -#define LEDC_TIMER_SEL_HSCH4_M ((LEDC_TIMER_SEL_HSCH4_V)<<(LEDC_TIMER_SEL_HSCH4_S)) -#define LEDC_TIMER_SEL_HSCH4_V 0x3 -#define LEDC_TIMER_SEL_HSCH4_S 0 - -#define LEDC_HSCH4_HPOINT_REG (DR_REG_LEDC_BASE + 0x0054) -/* LEDC_HPOINT_HSCH4 : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: The output value changes to high when htimerx(x=[0 3]) selected - by high speed channel4 has reached reg_hpoint_hsch4[19:0]*/ -#define LEDC_HPOINT_HSCH4 0x000FFFFF -#define LEDC_HPOINT_HSCH4_M ((LEDC_HPOINT_HSCH4_V)<<(LEDC_HPOINT_HSCH4_S)) -#define LEDC_HPOINT_HSCH4_V 0xFFFFF -#define LEDC_HPOINT_HSCH4_S 0 - -#define LEDC_HSCH4_DUTY_REG (DR_REG_LEDC_BASE + 0x0058) -/* LEDC_DUTY_HSCH4 : R/W ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: The register is used to control output duty. When hstimerx(x=[0 - 3]) choosed by high speed channel4 has reached reg_lpoint_hsch4 the output signal changes to low. reg_lpoint_hsch4=(reg_hpoint_hsch4[19:0]+reg_duty_hsch4[24:4]) (1) reg_lpoint_hsch4=(reg_hpoint_hsch4[19:0]+reg_duty_hsch4[24:4] +1) (2) The least four bits in this register represent the decimal part and determines when to choose (1) or (2)*/ -#define LEDC_DUTY_HSCH4 0x01FFFFFF -#define LEDC_DUTY_HSCH4_M ((LEDC_DUTY_HSCH4_V)<<(LEDC_DUTY_HSCH4_S)) -#define LEDC_DUTY_HSCH4_V 0x1FFFFFF -#define LEDC_DUTY_HSCH4_S 0 - -#define LEDC_HSCH4_CONF1_REG (DR_REG_LEDC_BASE + 0x005C) -/* LEDC_DUTY_START_HSCH4 : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When reg_duty_num_hsch1 reg_duty_cycle_hsch1 and reg_duty_scale_hsch1 - has been configured. these register won't take effect until set reg_duty_start_hsch1. this bit is automatically cleared by hardware.*/ -#define LEDC_DUTY_START_HSCH4 (BIT(31)) -#define LEDC_DUTY_START_HSCH4_M (BIT(31)) -#define LEDC_DUTY_START_HSCH4_V 0x1 -#define LEDC_DUTY_START_HSCH4_S 31 -/* LEDC_DUTY_INC_HSCH4 : R/W ;bitpos:[30] ;default: 1'b1 ; */ -/*description: This register is used to increase the duty of output signal or - decrease the duty of output signal for high speed channel4.*/ -#define LEDC_DUTY_INC_HSCH4 (BIT(30)) -#define LEDC_DUTY_INC_HSCH4_M (BIT(30)) -#define LEDC_DUTY_INC_HSCH4_V 0x1 -#define LEDC_DUTY_INC_HSCH4_S 30 -/* LEDC_DUTY_NUM_HSCH4 : R/W ;bitpos:[29:20] ;default: 10'h0 ; */ -/*description: This register is used to control the num of increased or decreased - times for high speed channel1.*/ -#define LEDC_DUTY_NUM_HSCH4 0x000003FF -#define LEDC_DUTY_NUM_HSCH4_M ((LEDC_DUTY_NUM_HSCH4_V)<<(LEDC_DUTY_NUM_HSCH4_S)) -#define LEDC_DUTY_NUM_HSCH4_V 0x3FF -#define LEDC_DUTY_NUM_HSCH4_S 20 -/* LEDC_DUTY_CYCLE_HSCH4 : R/W ;bitpos:[19:10] ;default: 10'h0 ; */ -/*description: This register is used to increase or decrease the duty every - reg_duty_cycle_hsch4 cycles for high speed channel4.*/ -#define LEDC_DUTY_CYCLE_HSCH4 0x000003FF -#define LEDC_DUTY_CYCLE_HSCH4_M ((LEDC_DUTY_CYCLE_HSCH4_V)<<(LEDC_DUTY_CYCLE_HSCH4_S)) -#define LEDC_DUTY_CYCLE_HSCH4_V 0x3FF -#define LEDC_DUTY_CYCLE_HSCH4_S 10 -/* LEDC_DUTY_SCALE_HSCH4 : R/W ;bitpos:[9:0] ;default: 10'h0 ; */ -/*description: This register controls the increase or decrease step scale for - high speed channel4.*/ -#define LEDC_DUTY_SCALE_HSCH4 0x000003FF -#define LEDC_DUTY_SCALE_HSCH4_M ((LEDC_DUTY_SCALE_HSCH4_V)<<(LEDC_DUTY_SCALE_HSCH4_S)) -#define LEDC_DUTY_SCALE_HSCH4_V 0x3FF -#define LEDC_DUTY_SCALE_HSCH4_S 0 - -#define LEDC_HSCH4_DUTY_R_REG (DR_REG_LEDC_BASE + 0x0060) -/* LEDC_DUTY_HSCH4 : RO ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: This register represents the current duty of the output signal - for high speed channel4.*/ -#define LEDC_DUTY_HSCH4 0x01FFFFFF -#define LEDC_DUTY_HSCH4_M ((LEDC_DUTY_HSCH4_V)<<(LEDC_DUTY_HSCH4_S)) -#define LEDC_DUTY_HSCH4_V 0x1FFFFFF -#define LEDC_DUTY_HSCH4_S 0 - -#define LEDC_HSCH5_CONF0_REG (DR_REG_LEDC_BASE + 0x0064) -/* LEDC_IDLE_LV_HSCH5 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: This bit is used to control the output value when high speed channel5 is off.*/ -#define LEDC_IDLE_LV_HSCH5 (BIT(3)) -#define LEDC_IDLE_LV_HSCH5_M (BIT(3)) -#define LEDC_IDLE_LV_HSCH5_V 0x1 -#define LEDC_IDLE_LV_HSCH5_S 3 -/* LEDC_SIG_OUT_EN_HSCH5 : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: This is the output enable control bit for high speed channel5.*/ -#define LEDC_SIG_OUT_EN_HSCH5 (BIT(2)) -#define LEDC_SIG_OUT_EN_HSCH5_M (BIT(2)) -#define LEDC_SIG_OUT_EN_HSCH5_V 0x1 -#define LEDC_SIG_OUT_EN_HSCH5_S 2 -/* LEDC_TIMER_SEL_HSCH5 : R/W ;bitpos:[1:0] ;default: 2'd0 ; */ -/*description: There are four high speed timers the two bits are used to select - one of them for high speed channel5. 2'b00: seletc hstimer0. 2'b01: select hstimer1. 2'b10: select hstimer2. 2'b11: select hstimer3.*/ -#define LEDC_TIMER_SEL_HSCH5 0x00000003 -#define LEDC_TIMER_SEL_HSCH5_M ((LEDC_TIMER_SEL_HSCH5_V)<<(LEDC_TIMER_SEL_HSCH5_S)) -#define LEDC_TIMER_SEL_HSCH5_V 0x3 -#define LEDC_TIMER_SEL_HSCH5_S 0 - -#define LEDC_HSCH5_HPOINT_REG (DR_REG_LEDC_BASE + 0x0068) -/* LEDC_HPOINT_HSCH5 : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: The output value changes to high when htimerx(x=[0 3]) selected - by high speed channel5 has reached reg_hpoint_hsch5[19:0]*/ -#define LEDC_HPOINT_HSCH5 0x000FFFFF -#define LEDC_HPOINT_HSCH5_M ((LEDC_HPOINT_HSCH5_V)<<(LEDC_HPOINT_HSCH5_S)) -#define LEDC_HPOINT_HSCH5_V 0xFFFFF -#define LEDC_HPOINT_HSCH5_S 0 - -#define LEDC_HSCH5_DUTY_REG (DR_REG_LEDC_BASE + 0x006C) -/* LEDC_DUTY_HSCH5 : R/W ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: The register is used to control output duty. When hstimerx(x=[0 - 3]) choosed by high speed channel5 has reached reg_lpoint_hsch5 the output signal changes to low. reg_lpoint_hsch5=(reg_hpoint_hsch5[19:0]+reg_duty_hsch5[24:4]) (1) reg_lpoint_hsch5=(reg_hpoint_hsch5[19:0]+reg_duty_hsch5[24:4] +1) (2) The least four bits in this register represent the decimal part and determines when to choose (1) or (2)*/ -#define LEDC_DUTY_HSCH5 0x01FFFFFF -#define LEDC_DUTY_HSCH5_M ((LEDC_DUTY_HSCH5_V)<<(LEDC_DUTY_HSCH5_S)) -#define LEDC_DUTY_HSCH5_V 0x1FFFFFF -#define LEDC_DUTY_HSCH5_S 0 - -#define LEDC_HSCH5_CONF1_REG (DR_REG_LEDC_BASE + 0x0070) -/* LEDC_DUTY_START_HSCH5 : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When reg_duty_num_hsch5 reg_duty_cycle_hsch5 and reg_duty_scale_hsch5 - has been configured. these register won't take effect until set reg_duty_start_hsch5. this bit is automatically cleared by hardware.*/ -#define LEDC_DUTY_START_HSCH5 (BIT(31)) -#define LEDC_DUTY_START_HSCH5_M (BIT(31)) -#define LEDC_DUTY_START_HSCH5_V 0x1 -#define LEDC_DUTY_START_HSCH5_S 31 -/* LEDC_DUTY_INC_HSCH5 : R/W ;bitpos:[30] ;default: 1'b1 ; */ -/*description: This register is used to increase the duty of output signal or - decrease the duty of output signal for high speed channel5.*/ -#define LEDC_DUTY_INC_HSCH5 (BIT(30)) -#define LEDC_DUTY_INC_HSCH5_M (BIT(30)) -#define LEDC_DUTY_INC_HSCH5_V 0x1 -#define LEDC_DUTY_INC_HSCH5_S 30 -/* LEDC_DUTY_NUM_HSCH5 : R/W ;bitpos:[29:20] ;default: 10'h0 ; */ -/*description: This register is used to control the num of increased or decreased - times for high speed channel5.*/ -#define LEDC_DUTY_NUM_HSCH5 0x000003FF -#define LEDC_DUTY_NUM_HSCH5_M ((LEDC_DUTY_NUM_HSCH5_V)<<(LEDC_DUTY_NUM_HSCH5_S)) -#define LEDC_DUTY_NUM_HSCH5_V 0x3FF -#define LEDC_DUTY_NUM_HSCH5_S 20 -/* LEDC_DUTY_CYCLE_HSCH5 : R/W ;bitpos:[19:10] ;default: 10'h0 ; */ -/*description: This register is used to increase or decrease the duty every - reg_duty_cycle_hsch5 cycles for high speed channel5.*/ -#define LEDC_DUTY_CYCLE_HSCH5 0x000003FF -#define LEDC_DUTY_CYCLE_HSCH5_M ((LEDC_DUTY_CYCLE_HSCH5_V)<<(LEDC_DUTY_CYCLE_HSCH5_S)) -#define LEDC_DUTY_CYCLE_HSCH5_V 0x3FF -#define LEDC_DUTY_CYCLE_HSCH5_S 10 -/* LEDC_DUTY_SCALE_HSCH5 : R/W ;bitpos:[9:0] ;default: 10'h0 ; */ -/*description: This register controls the increase or decrease step scale for - high speed channel5.*/ -#define LEDC_DUTY_SCALE_HSCH5 0x000003FF -#define LEDC_DUTY_SCALE_HSCH5_M ((LEDC_DUTY_SCALE_HSCH5_V)<<(LEDC_DUTY_SCALE_HSCH5_S)) -#define LEDC_DUTY_SCALE_HSCH5_V 0x3FF -#define LEDC_DUTY_SCALE_HSCH5_S 0 - -#define LEDC_HSCH5_DUTY_R_REG (DR_REG_LEDC_BASE + 0x0074) -/* LEDC_DUTY_HSCH5 : RO ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: This register represents the current duty of the output signal - for high speed channel5.*/ -#define LEDC_DUTY_HSCH5 0x01FFFFFF -#define LEDC_DUTY_HSCH5_M ((LEDC_DUTY_HSCH5_V)<<(LEDC_DUTY_HSCH5_S)) -#define LEDC_DUTY_HSCH5_V 0x1FFFFFF -#define LEDC_DUTY_HSCH5_S 0 - -#define LEDC_HSCH6_CONF0_REG (DR_REG_LEDC_BASE + 0x0078) -/* LEDC_IDLE_LV_HSCH6 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: This bit is used to control the output value when high speed channel6 is off.*/ -#define LEDC_IDLE_LV_HSCH6 (BIT(3)) -#define LEDC_IDLE_LV_HSCH6_M (BIT(3)) -#define LEDC_IDLE_LV_HSCH6_V 0x1 -#define LEDC_IDLE_LV_HSCH6_S 3 -/* LEDC_SIG_OUT_EN_HSCH6 : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: This is the output enable control bit for high speed channel6*/ -#define LEDC_SIG_OUT_EN_HSCH6 (BIT(2)) -#define LEDC_SIG_OUT_EN_HSCH6_M (BIT(2)) -#define LEDC_SIG_OUT_EN_HSCH6_V 0x1 -#define LEDC_SIG_OUT_EN_HSCH6_S 2 -/* LEDC_TIMER_SEL_HSCH6 : R/W ;bitpos:[1:0] ;default: 2'd0 ; */ -/*description: There are four high speed timers the two bits are used to select - one of them for high speed channel6. 2'b00: seletc hstimer0. 2'b01: select hstimer1. 2'b10: select hstimer2. 2'b11: select hstimer3.*/ -#define LEDC_TIMER_SEL_HSCH6 0x00000003 -#define LEDC_TIMER_SEL_HSCH6_M ((LEDC_TIMER_SEL_HSCH6_V)<<(LEDC_TIMER_SEL_HSCH6_S)) -#define LEDC_TIMER_SEL_HSCH6_V 0x3 -#define LEDC_TIMER_SEL_HSCH6_S 0 - -#define LEDC_HSCH6_HPOINT_REG (DR_REG_LEDC_BASE + 0x007C) -/* LEDC_HPOINT_HSCH6 : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: The output value changes to high when htimerx(x=[0 3]) selected - by high speed channel6 has reached reg_hpoint_hsch6[19:0]*/ -#define LEDC_HPOINT_HSCH6 0x000FFFFF -#define LEDC_HPOINT_HSCH6_M ((LEDC_HPOINT_HSCH6_V)<<(LEDC_HPOINT_HSCH6_S)) -#define LEDC_HPOINT_HSCH6_V 0xFFFFF -#define LEDC_HPOINT_HSCH6_S 0 - -#define LEDC_HSCH6_DUTY_REG (DR_REG_LEDC_BASE + 0x0080) -/* LEDC_DUTY_HSCH6 : R/W ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: The register is used to control output duty. When hstimerx(x=[0 - 3]) choosed by high speed channel6 has reached reg_lpoint_hsch6 the output signal changes to low. reg_lpoint_hsch6=(reg_hpoint_hsch6[19:0]+reg_duty_hsch6[24:4]) (1) reg_lpoint_hsch6=(reg_hpoint_hsch6[19:0]+reg_duty_hsch6[24:4] +1) (2) The least four bits in this register represent the decimal part and determines when to choose (1) or (2)*/ -#define LEDC_DUTY_HSCH6 0x01FFFFFF -#define LEDC_DUTY_HSCH6_M ((LEDC_DUTY_HSCH6_V)<<(LEDC_DUTY_HSCH6_S)) -#define LEDC_DUTY_HSCH6_V 0x1FFFFFF -#define LEDC_DUTY_HSCH6_S 0 - -#define LEDC_HSCH6_CONF1_REG (DR_REG_LEDC_BASE + 0x0084) -/* LEDC_DUTY_START_HSCH6 : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When reg_duty_num_hsch1 reg_duty_cycle_hsch1 and reg_duty_scale_hsch1 - has been configured. these register won't take effect until set reg_duty_start_hsch1. this bit is automatically cleared by hardware.*/ -#define LEDC_DUTY_START_HSCH6 (BIT(31)) -#define LEDC_DUTY_START_HSCH6_M (BIT(31)) -#define LEDC_DUTY_START_HSCH6_V 0x1 -#define LEDC_DUTY_START_HSCH6_S 31 -/* LEDC_DUTY_INC_HSCH6 : R/W ;bitpos:[30] ;default: 1'b1 ; */ -/*description: This register is used to increase the duty of output signal or - decrease the duty of output signal for high speed channel6.*/ -#define LEDC_DUTY_INC_HSCH6 (BIT(30)) -#define LEDC_DUTY_INC_HSCH6_M (BIT(30)) -#define LEDC_DUTY_INC_HSCH6_V 0x1 -#define LEDC_DUTY_INC_HSCH6_S 30 -/* LEDC_DUTY_NUM_HSCH6 : R/W ;bitpos:[29:20] ;default: 10'h0 ; */ -/*description: This register is used to control the num of increased or decreased - times for high speed channel6.*/ -#define LEDC_DUTY_NUM_HSCH6 0x000003FF -#define LEDC_DUTY_NUM_HSCH6_M ((LEDC_DUTY_NUM_HSCH6_V)<<(LEDC_DUTY_NUM_HSCH6_S)) -#define LEDC_DUTY_NUM_HSCH6_V 0x3FF -#define LEDC_DUTY_NUM_HSCH6_S 20 -/* LEDC_DUTY_CYCLE_HSCH6 : R/W ;bitpos:[19:10] ;default: 10'h0 ; */ -/*description: This register is used to increase or decrease the duty every - reg_duty_cycle_hsch6 cycles for high speed channel6.*/ -#define LEDC_DUTY_CYCLE_HSCH6 0x000003FF -#define LEDC_DUTY_CYCLE_HSCH6_M ((LEDC_DUTY_CYCLE_HSCH6_V)<<(LEDC_DUTY_CYCLE_HSCH6_S)) -#define LEDC_DUTY_CYCLE_HSCH6_V 0x3FF -#define LEDC_DUTY_CYCLE_HSCH6_S 10 -/* LEDC_DUTY_SCALE_HSCH6 : R/W ;bitpos:[9:0] ;default: 10'h0 ; */ -/*description: This register controls the increase or decrease step scale for - high speed channel6.*/ -#define LEDC_DUTY_SCALE_HSCH6 0x000003FF -#define LEDC_DUTY_SCALE_HSCH6_M ((LEDC_DUTY_SCALE_HSCH6_V)<<(LEDC_DUTY_SCALE_HSCH6_S)) -#define LEDC_DUTY_SCALE_HSCH6_V 0x3FF -#define LEDC_DUTY_SCALE_HSCH6_S 0 - -#define LEDC_HSCH6_DUTY_R_REG (DR_REG_LEDC_BASE + 0x0088) -/* LEDC_DUTY_HSCH6 : RO ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: This register represents the current duty of the output signal - for high speed channel6.*/ -#define LEDC_DUTY_HSCH6 0x01FFFFFF -#define LEDC_DUTY_HSCH6_M ((LEDC_DUTY_HSCH6_V)<<(LEDC_DUTY_HSCH6_S)) -#define LEDC_DUTY_HSCH6_V 0x1FFFFFF -#define LEDC_DUTY_HSCH6_S 0 - -#define LEDC_HSCH7_CONF0_REG (DR_REG_LEDC_BASE + 0x008C) -/* LEDC_IDLE_LV_HSCH7 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: This bit is used to control the output value when high speed channel7 is off.*/ -#define LEDC_IDLE_LV_HSCH7 (BIT(3)) -#define LEDC_IDLE_LV_HSCH7_M (BIT(3)) -#define LEDC_IDLE_LV_HSCH7_V 0x1 -#define LEDC_IDLE_LV_HSCH7_S 3 -/* LEDC_SIG_OUT_EN_HSCH7 : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: This is the output enable control bit for high speed channel7.*/ -#define LEDC_SIG_OUT_EN_HSCH7 (BIT(2)) -#define LEDC_SIG_OUT_EN_HSCH7_M (BIT(2)) -#define LEDC_SIG_OUT_EN_HSCH7_V 0x1 -#define LEDC_SIG_OUT_EN_HSCH7_S 2 -/* LEDC_TIMER_SEL_HSCH7 : R/W ;bitpos:[1:0] ;default: 2'd0 ; */ -/*description: There are four high speed timers the two bits are used to select - one of them for high speed channel7. 2'b00: seletc hstimer0. 2'b01: select hstimer1. 2'b10: select hstimer2. 2'b11: select hstimer3.*/ -#define LEDC_TIMER_SEL_HSCH7 0x00000003 -#define LEDC_TIMER_SEL_HSCH7_M ((LEDC_TIMER_SEL_HSCH7_V)<<(LEDC_TIMER_SEL_HSCH7_S)) -#define LEDC_TIMER_SEL_HSCH7_V 0x3 -#define LEDC_TIMER_SEL_HSCH7_S 0 - -#define LEDC_HSCH7_HPOINT_REG (DR_REG_LEDC_BASE + 0x0090) -/* LEDC_HPOINT_HSCH7 : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: The output value changes to high when htimerx(x=[0 3]) selected - by high speed channel7 has reached reg_hpoint_hsch7[19:0]*/ -#define LEDC_HPOINT_HSCH7 0x000FFFFF -#define LEDC_HPOINT_HSCH7_M ((LEDC_HPOINT_HSCH7_V)<<(LEDC_HPOINT_HSCH7_S)) -#define LEDC_HPOINT_HSCH7_V 0xFFFFF -#define LEDC_HPOINT_HSCH7_S 0 - -#define LEDC_HSCH7_DUTY_REG (DR_REG_LEDC_BASE + 0x0094) -/* LEDC_DUTY_HSCH7 : R/W ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: The register is used to control output duty. When hstimerx(x=[0 - 3]) choosed by high speed channel7 has reached reg_lpoint_hsch7 the output signal changes to low. reg_lpoint_hsch7=(reg_hpoint_hsch7[19:0]+reg_duty_hsch7[24:4]) (1) reg_lpoint_hsch7=(reg_hpoint_hsch7[19:0]+reg_duty_hsch7[24:4] +1) (2) The least four bits in this register represent the decimal part and determines when to choose (1) or (2)*/ -#define LEDC_DUTY_HSCH7 0x01FFFFFF -#define LEDC_DUTY_HSCH7_M ((LEDC_DUTY_HSCH7_V)<<(LEDC_DUTY_HSCH7_S)) -#define LEDC_DUTY_HSCH7_V 0x1FFFFFF -#define LEDC_DUTY_HSCH7_S 0 - -#define LEDC_HSCH7_CONF1_REG (DR_REG_LEDC_BASE + 0x0098) -/* LEDC_DUTY_START_HSCH7 : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When reg_duty_num_hsch1 reg_duty_cycle_hsch1 and reg_duty_scale_hsch1 - has been configured. these register won't take effect until set reg_duty_start_hsch1. this bit is automatically cleared by hardware.*/ -#define LEDC_DUTY_START_HSCH7 (BIT(31)) -#define LEDC_DUTY_START_HSCH7_M (BIT(31)) -#define LEDC_DUTY_START_HSCH7_V 0x1 -#define LEDC_DUTY_START_HSCH7_S 31 -/* LEDC_DUTY_INC_HSCH7 : R/W ;bitpos:[30] ;default: 1'b1 ; */ -/*description: This register is used to increase the duty of output signal or - decrease the duty of output signal for high speed channel6.*/ -#define LEDC_DUTY_INC_HSCH7 (BIT(30)) -#define LEDC_DUTY_INC_HSCH7_M (BIT(30)) -#define LEDC_DUTY_INC_HSCH7_V 0x1 -#define LEDC_DUTY_INC_HSCH7_S 30 -/* LEDC_DUTY_NUM_HSCH7 : R/W ;bitpos:[29:20] ;default: 10'h0 ; */ -/*description: This register is used to control the num of increased or decreased - times for high speed channel6.*/ -#define LEDC_DUTY_NUM_HSCH7 0x000003FF -#define LEDC_DUTY_NUM_HSCH7_M ((LEDC_DUTY_NUM_HSCH7_V)<<(LEDC_DUTY_NUM_HSCH7_S)) -#define LEDC_DUTY_NUM_HSCH7_V 0x3FF -#define LEDC_DUTY_NUM_HSCH7_S 20 -/* LEDC_DUTY_CYCLE_HSCH7 : R/W ;bitpos:[19:10] ;default: 10'h0 ; */ -/*description: This register is used to increase or decrease the duty every - reg_duty_cycle_hsch7 cycles for high speed channel7.*/ -#define LEDC_DUTY_CYCLE_HSCH7 0x000003FF -#define LEDC_DUTY_CYCLE_HSCH7_M ((LEDC_DUTY_CYCLE_HSCH7_V)<<(LEDC_DUTY_CYCLE_HSCH7_S)) -#define LEDC_DUTY_CYCLE_HSCH7_V 0x3FF -#define LEDC_DUTY_CYCLE_HSCH7_S 10 -/* LEDC_DUTY_SCALE_HSCH7 : R/W ;bitpos:[9:0] ;default: 10'h0 ; */ -/*description: This register controls the increase or decrease step scale for - high speed channel7.*/ -#define LEDC_DUTY_SCALE_HSCH7 0x000003FF -#define LEDC_DUTY_SCALE_HSCH7_M ((LEDC_DUTY_SCALE_HSCH7_V)<<(LEDC_DUTY_SCALE_HSCH7_S)) -#define LEDC_DUTY_SCALE_HSCH7_V 0x3FF -#define LEDC_DUTY_SCALE_HSCH7_S 0 - -#define LEDC_HSCH7_DUTY_R_REG (DR_REG_LEDC_BASE + 0x009C) -/* LEDC_DUTY_HSCH7 : RO ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: This register represents the current duty of the output signal - for high speed channel7.*/ -#define LEDC_DUTY_HSCH7 0x01FFFFFF -#define LEDC_DUTY_HSCH7_M ((LEDC_DUTY_HSCH7_V)<<(LEDC_DUTY_HSCH7_S)) -#define LEDC_DUTY_HSCH7_V 0x1FFFFFF -#define LEDC_DUTY_HSCH7_S 0 - -#define LEDC_LSCH0_CONF0_REG (DR_REG_LEDC_BASE + 0x00A0) -/* LEDC_PARA_UP_LSCH0 : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: This bit is used to update register LEDC_LSCH0_HPOINT and LEDC_LSCH0_DUTY - for low speed channel0.*/ -#define LEDC_PARA_UP_LSCH0 (BIT(4)) -#define LEDC_PARA_UP_LSCH0_M (BIT(4)) -#define LEDC_PARA_UP_LSCH0_V 0x1 -#define LEDC_PARA_UP_LSCH0_S 4 -/* LEDC_IDLE_LV_LSCH0 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: This bit is used to control the output value when low speed channel0 is off.*/ -#define LEDC_IDLE_LV_LSCH0 (BIT(3)) -#define LEDC_IDLE_LV_LSCH0_M (BIT(3)) -#define LEDC_IDLE_LV_LSCH0_V 0x1 -#define LEDC_IDLE_LV_LSCH0_S 3 -/* LEDC_SIG_OUT_EN_LSCH0 : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: This is the output enable control bit for low speed channel0.*/ -#define LEDC_SIG_OUT_EN_LSCH0 (BIT(2)) -#define LEDC_SIG_OUT_EN_LSCH0_M (BIT(2)) -#define LEDC_SIG_OUT_EN_LSCH0_V 0x1 -#define LEDC_SIG_OUT_EN_LSCH0_S 2 -/* LEDC_TIMER_SEL_LSCH0 : R/W ;bitpos:[1:0] ;default: 2'd0 ; */ -/*description: There are four low speed timers the two bits are used to select - one of them for low speed channel0. 2'b00: seletc lstimer0. 2'b01: select lstimer1. 2'b10: select lstimer2. 2'b11: select lstimer3.*/ -#define LEDC_TIMER_SEL_LSCH0 0x00000003 -#define LEDC_TIMER_SEL_LSCH0_M ((LEDC_TIMER_SEL_LSCH0_V)<<(LEDC_TIMER_SEL_LSCH0_S)) -#define LEDC_TIMER_SEL_LSCH0_V 0x3 -#define LEDC_TIMER_SEL_LSCH0_S 0 - -#define LEDC_LSCH0_HPOINT_REG (DR_REG_LEDC_BASE + 0x00A4) -/* LEDC_HPOINT_LSCH0 : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: The output value changes to high when lstimerx(x=[0 3]) selected - by low speed channel0 has reached reg_hpoint_lsch0[19:0]*/ -#define LEDC_HPOINT_LSCH0 0x000FFFFF -#define LEDC_HPOINT_LSCH0_M ((LEDC_HPOINT_LSCH0_V)<<(LEDC_HPOINT_LSCH0_S)) -#define LEDC_HPOINT_LSCH0_V 0xFFFFF -#define LEDC_HPOINT_LSCH0_S 0 - -#define LEDC_LSCH0_DUTY_REG (DR_REG_LEDC_BASE + 0x00A8) -/* LEDC_DUTY_LSCH0 : R/W ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: The register is used to control output duty. When lstimerx(x=[0 - 3]) choosed by low speed channel0 has reached reg_lpoint_lsch0 the output signal changes to low. reg_lpoint_lsch0=(reg_hpoint_lsch0[19:0]+reg_duty_lsch0[24:4]) (1) reg_lpoint_lsch0=(reg_hpoint_lsch0[19:0]+reg_duty_lsch0[24:4] +1) (2) The least four bits in this register represent the decimal part and determines when to choose (1) or (2)*/ -#define LEDC_DUTY_LSCH0 0x01FFFFFF -#define LEDC_DUTY_LSCH0_M ((LEDC_DUTY_LSCH0_V)<<(LEDC_DUTY_LSCH0_S)) -#define LEDC_DUTY_LSCH0_V 0x1FFFFFF -#define LEDC_DUTY_LSCH0_S 0 - -#define LEDC_LSCH0_CONF1_REG (DR_REG_LEDC_BASE + 0x00AC) -/* LEDC_DUTY_START_LSCH0 : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When reg_duty_num_hsch1 reg_duty_cycle_hsch1 and reg_duty_scale_hsch1 - has been configured. these register won't take effect until set reg_duty_start_hsch1. this bit is automatically cleared by hardware.*/ -#define LEDC_DUTY_START_LSCH0 (BIT(31)) -#define LEDC_DUTY_START_LSCH0_M (BIT(31)) -#define LEDC_DUTY_START_LSCH0_V 0x1 -#define LEDC_DUTY_START_LSCH0_S 31 -/* LEDC_DUTY_INC_LSCH0 : R/W ;bitpos:[30] ;default: 1'b1 ; */ -/*description: This register is used to increase the duty of output signal or - decrease the duty of output signal for low speed channel6.*/ -#define LEDC_DUTY_INC_LSCH0 (BIT(30)) -#define LEDC_DUTY_INC_LSCH0_M (BIT(30)) -#define LEDC_DUTY_INC_LSCH0_V 0x1 -#define LEDC_DUTY_INC_LSCH0_S 30 -/* LEDC_DUTY_NUM_LSCH0 : R/W ;bitpos:[29:20] ;default: 10'h0 ; */ -/*description: This register is used to control the num of increased or decreased - times for low speed channel6.*/ -#define LEDC_DUTY_NUM_LSCH0 0x000003FF -#define LEDC_DUTY_NUM_LSCH0_M ((LEDC_DUTY_NUM_LSCH0_V)<<(LEDC_DUTY_NUM_LSCH0_S)) -#define LEDC_DUTY_NUM_LSCH0_V 0x3FF -#define LEDC_DUTY_NUM_LSCH0_S 20 -/* LEDC_DUTY_CYCLE_LSCH0 : R/W ;bitpos:[19:10] ;default: 10'h0 ; */ -/*description: This register is used to increase or decrease the duty every - reg_duty_cycle_lsch0 cycles for low speed channel0.*/ -#define LEDC_DUTY_CYCLE_LSCH0 0x000003FF -#define LEDC_DUTY_CYCLE_LSCH0_M ((LEDC_DUTY_CYCLE_LSCH0_V)<<(LEDC_DUTY_CYCLE_LSCH0_S)) -#define LEDC_DUTY_CYCLE_LSCH0_V 0x3FF -#define LEDC_DUTY_CYCLE_LSCH0_S 10 -/* LEDC_DUTY_SCALE_LSCH0 : R/W ;bitpos:[9:0] ;default: 10'h0 ; */ -/*description: This register controls the increase or decrease step scale for - low speed channel0.*/ -#define LEDC_DUTY_SCALE_LSCH0 0x000003FF -#define LEDC_DUTY_SCALE_LSCH0_M ((LEDC_DUTY_SCALE_LSCH0_V)<<(LEDC_DUTY_SCALE_LSCH0_S)) -#define LEDC_DUTY_SCALE_LSCH0_V 0x3FF -#define LEDC_DUTY_SCALE_LSCH0_S 0 - -#define LEDC_LSCH0_DUTY_R_REG (DR_REG_LEDC_BASE + 0x00B0) -/* LEDC_DUTY_LSCH0 : RO ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: This register represents the current duty of the output signal - for low speed channel0.*/ -#define LEDC_DUTY_LSCH0 0x01FFFFFF -#define LEDC_DUTY_LSCH0_M ((LEDC_DUTY_LSCH0_V)<<(LEDC_DUTY_LSCH0_S)) -#define LEDC_DUTY_LSCH0_V 0x1FFFFFF -#define LEDC_DUTY_LSCH0_S 0 - -#define LEDC_LSCH1_CONF0_REG (DR_REG_LEDC_BASE + 0x00B4) -/* LEDC_PARA_UP_LSCH1 : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: This bit is used to update register LEDC_LSCH1_HPOINT and LEDC_LSCH1_DUTY - for low speed channel1.*/ -#define LEDC_PARA_UP_LSCH1 (BIT(4)) -#define LEDC_PARA_UP_LSCH1_M (BIT(4)) -#define LEDC_PARA_UP_LSCH1_V 0x1 -#define LEDC_PARA_UP_LSCH1_S 4 -/* LEDC_IDLE_LV_LSCH1 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: This bit is used to control the output value when low speed channel1 is off.*/ -#define LEDC_IDLE_LV_LSCH1 (BIT(3)) -#define LEDC_IDLE_LV_LSCH1_M (BIT(3)) -#define LEDC_IDLE_LV_LSCH1_V 0x1 -#define LEDC_IDLE_LV_LSCH1_S 3 -/* LEDC_SIG_OUT_EN_LSCH1 : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: This is the output enable control bit for low speed channel1.*/ -#define LEDC_SIG_OUT_EN_LSCH1 (BIT(2)) -#define LEDC_SIG_OUT_EN_LSCH1_M (BIT(2)) -#define LEDC_SIG_OUT_EN_LSCH1_V 0x1 -#define LEDC_SIG_OUT_EN_LSCH1_S 2 -/* LEDC_TIMER_SEL_LSCH1 : R/W ;bitpos:[1:0] ;default: 2'd0 ; */ -/*description: There are four low speed timers the two bits are used to select - one of them for low speed channel1. 2'b00: seletc lstimer0. 2'b01: select lstimer1. 2'b10: select lstimer2. 2'b11: select lstimer3.*/ -#define LEDC_TIMER_SEL_LSCH1 0x00000003 -#define LEDC_TIMER_SEL_LSCH1_M ((LEDC_TIMER_SEL_LSCH1_V)<<(LEDC_TIMER_SEL_LSCH1_S)) -#define LEDC_TIMER_SEL_LSCH1_V 0x3 -#define LEDC_TIMER_SEL_LSCH1_S 0 - -#define LEDC_LSCH1_HPOINT_REG (DR_REG_LEDC_BASE + 0x00B8) -/* LEDC_HPOINT_LSCH1 : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: The output value changes to high when lstimerx(x=[0 3]) selected - by low speed channel1 has reached reg_hpoint_lsch1[19:0]*/ -#define LEDC_HPOINT_LSCH1 0x000FFFFF -#define LEDC_HPOINT_LSCH1_M ((LEDC_HPOINT_LSCH1_V)<<(LEDC_HPOINT_LSCH1_S)) -#define LEDC_HPOINT_LSCH1_V 0xFFFFF -#define LEDC_HPOINT_LSCH1_S 0 - -#define LEDC_LSCH1_DUTY_REG (DR_REG_LEDC_BASE + 0x00BC) -/* LEDC_DUTY_LSCH1 : R/W ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: The register is used to control output duty. When lstimerx(x=[0 - 3]) choosed by low speed channel1 has reached reg_lpoint_lsch1 the output signal changes to low. reg_lpoint_lsch1=(reg_hpoint_lsch1[19:0]+reg_duty_lsch1[24:4]) (1) reg_lpoint_lsch1=(reg_hpoint_lsch1[19:0]+reg_duty_lsch1[24:4] +1) (2) The least four bits in this register represent the decimal part and determines when to choose (1) or (2)*/ -#define LEDC_DUTY_LSCH1 0x01FFFFFF -#define LEDC_DUTY_LSCH1_M ((LEDC_DUTY_LSCH1_V)<<(LEDC_DUTY_LSCH1_S)) -#define LEDC_DUTY_LSCH1_V 0x1FFFFFF -#define LEDC_DUTY_LSCH1_S 0 - -#define LEDC_LSCH1_CONF1_REG (DR_REG_LEDC_BASE + 0x00C0) -/* LEDC_DUTY_START_LSCH1 : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When reg_duty_num_hsch1 reg_duty_cycle_hsch1 and reg_duty_scale_hsch1 - has been configured. these register won't take effect until set reg_duty_start_hsch1. this bit is automatically cleared by hardware.*/ -#define LEDC_DUTY_START_LSCH1 (BIT(31)) -#define LEDC_DUTY_START_LSCH1_M (BIT(31)) -#define LEDC_DUTY_START_LSCH1_V 0x1 -#define LEDC_DUTY_START_LSCH1_S 31 -/* LEDC_DUTY_INC_LSCH1 : R/W ;bitpos:[30] ;default: 1'b1 ; */ -/*description: This register is used to increase the duty of output signal or - decrease the duty of output signal for low speed channel1.*/ -#define LEDC_DUTY_INC_LSCH1 (BIT(30)) -#define LEDC_DUTY_INC_LSCH1_M (BIT(30)) -#define LEDC_DUTY_INC_LSCH1_V 0x1 -#define LEDC_DUTY_INC_LSCH1_S 30 -/* LEDC_DUTY_NUM_LSCH1 : R/W ;bitpos:[29:20] ;default: 10'h0 ; */ -/*description: This register is used to control the num of increased or decreased - times for low speed channel1.*/ -#define LEDC_DUTY_NUM_LSCH1 0x000003FF -#define LEDC_DUTY_NUM_LSCH1_M ((LEDC_DUTY_NUM_LSCH1_V)<<(LEDC_DUTY_NUM_LSCH1_S)) -#define LEDC_DUTY_NUM_LSCH1_V 0x3FF -#define LEDC_DUTY_NUM_LSCH1_S 20 -/* LEDC_DUTY_CYCLE_LSCH1 : R/W ;bitpos:[19:10] ;default: 10'h0 ; */ -/*description: This register is used to increase or decrease the duty every - reg_duty_cycle_lsch1 cycles for low speed channel1.*/ -#define LEDC_DUTY_CYCLE_LSCH1 0x000003FF -#define LEDC_DUTY_CYCLE_LSCH1_M ((LEDC_DUTY_CYCLE_LSCH1_V)<<(LEDC_DUTY_CYCLE_LSCH1_S)) -#define LEDC_DUTY_CYCLE_LSCH1_V 0x3FF -#define LEDC_DUTY_CYCLE_LSCH1_S 10 -/* LEDC_DUTY_SCALE_LSCH1 : R/W ;bitpos:[9:0] ;default: 10'h0 ; */ -/*description: This register controls the increase or decrease step scale for - low speed channel1.*/ -#define LEDC_DUTY_SCALE_LSCH1 0x000003FF -#define LEDC_DUTY_SCALE_LSCH1_M ((LEDC_DUTY_SCALE_LSCH1_V)<<(LEDC_DUTY_SCALE_LSCH1_S)) -#define LEDC_DUTY_SCALE_LSCH1_V 0x3FF -#define LEDC_DUTY_SCALE_LSCH1_S 0 - -#define LEDC_LSCH1_DUTY_R_REG (DR_REG_LEDC_BASE + 0x00C4) -/* LEDC_DUTY_LSCH1 : RO ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: This register represents the current duty of the output signal - for low speed channel1.*/ -#define LEDC_DUTY_LSCH1 0x01FFFFFF -#define LEDC_DUTY_LSCH1_M ((LEDC_DUTY_LSCH1_V)<<(LEDC_DUTY_LSCH1_S)) -#define LEDC_DUTY_LSCH1_V 0x1FFFFFF -#define LEDC_DUTY_LSCH1_S 0 - -#define LEDC_LSCH2_CONF0_REG (DR_REG_LEDC_BASE + 0x00C8) -/* LEDC_PARA_UP_LSCH2 : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: This bit is used to update register LEDC_LSCH2_HPOINT and LEDC_LSCH2_DUTY - for low speed channel2.*/ -#define LEDC_PARA_UP_LSCH2 (BIT(4)) -#define LEDC_PARA_UP_LSCH2_M (BIT(4)) -#define LEDC_PARA_UP_LSCH2_V 0x1 -#define LEDC_PARA_UP_LSCH2_S 4 -/* LEDC_IDLE_LV_LSCH2 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: This bit is used to control the output value when low speed channel2 is off.*/ -#define LEDC_IDLE_LV_LSCH2 (BIT(3)) -#define LEDC_IDLE_LV_LSCH2_M (BIT(3)) -#define LEDC_IDLE_LV_LSCH2_V 0x1 -#define LEDC_IDLE_LV_LSCH2_S 3 -/* LEDC_SIG_OUT_EN_LSCH2 : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: This is the output enable control bit for low speed channel2.*/ -#define LEDC_SIG_OUT_EN_LSCH2 (BIT(2)) -#define LEDC_SIG_OUT_EN_LSCH2_M (BIT(2)) -#define LEDC_SIG_OUT_EN_LSCH2_V 0x1 -#define LEDC_SIG_OUT_EN_LSCH2_S 2 -/* LEDC_TIMER_SEL_LSCH2 : R/W ;bitpos:[1:0] ;default: 2'd0 ; */ -/*description: There are four low speed timers the two bits are used to select - one of them for low speed channel2. 2'b00: seletc lstimer0. 2'b01: select lstimer1. 2'b10: select lstimer2. 2'b11: select lstimer3.*/ -#define LEDC_TIMER_SEL_LSCH2 0x00000003 -#define LEDC_TIMER_SEL_LSCH2_M ((LEDC_TIMER_SEL_LSCH2_V)<<(LEDC_TIMER_SEL_LSCH2_S)) -#define LEDC_TIMER_SEL_LSCH2_V 0x3 -#define LEDC_TIMER_SEL_LSCH2_S 0 - -#define LEDC_LSCH2_HPOINT_REG (DR_REG_LEDC_BASE + 0x00CC) -/* LEDC_HPOINT_LSCH2 : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: The output value changes to high when lstimerx(x=[0 3]) selected - by low speed channel2 has reached reg_hpoint_lsch2[19:0]*/ -#define LEDC_HPOINT_LSCH2 0x000FFFFF -#define LEDC_HPOINT_LSCH2_M ((LEDC_HPOINT_LSCH2_V)<<(LEDC_HPOINT_LSCH2_S)) -#define LEDC_HPOINT_LSCH2_V 0xFFFFF -#define LEDC_HPOINT_LSCH2_S 0 - -#define LEDC_LSCH2_DUTY_REG (DR_REG_LEDC_BASE + 0x00D0) -/* LEDC_DUTY_LSCH2 : R/W ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: The register is used to control output duty. When lstimerx(x=[0 - 3]) choosed by low speed channel2 has reached reg_lpoint_lsch2 the output signal changes to low. reg_lpoint_lsch2=(reg_hpoint_lsch2[19:0]+reg_duty_lsch2[24:4]) (1) reg_lpoint_lsch2=(reg_hpoint_lsch2[19:0]+reg_duty_lsch2[24:4] +1) (2) The least four bits in this register represent the decimal part and determines when to choose (1) or (2)*/ -#define LEDC_DUTY_LSCH2 0x01FFFFFF -#define LEDC_DUTY_LSCH2_M ((LEDC_DUTY_LSCH2_V)<<(LEDC_DUTY_LSCH2_S)) -#define LEDC_DUTY_LSCH2_V 0x1FFFFFF -#define LEDC_DUTY_LSCH2_S 0 - -#define LEDC_LSCH2_CONF1_REG (DR_REG_LEDC_BASE + 0x00D4) -/* LEDC_DUTY_START_LSCH2 : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When reg_duty_num_hsch2 reg_duty_cycle_hsch2 and reg_duty_scale_hsch2 - has been configured. these register won't take effect until set reg_duty_start_hsch2. this bit is automatically cleared by hardware.*/ -#define LEDC_DUTY_START_LSCH2 (BIT(31)) -#define LEDC_DUTY_START_LSCH2_M (BIT(31)) -#define LEDC_DUTY_START_LSCH2_V 0x1 -#define LEDC_DUTY_START_LSCH2_S 31 -/* LEDC_DUTY_INC_LSCH2 : R/W ;bitpos:[30] ;default: 1'b1 ; */ -/*description: This register is used to increase the duty of output signal or - decrease the duty of output signal for low speed channel2.*/ -#define LEDC_DUTY_INC_LSCH2 (BIT(30)) -#define LEDC_DUTY_INC_LSCH2_M (BIT(30)) -#define LEDC_DUTY_INC_LSCH2_V 0x1 -#define LEDC_DUTY_INC_LSCH2_S 30 -/* LEDC_DUTY_NUM_LSCH2 : R/W ;bitpos:[29:20] ;default: 10'h0 ; */ -/*description: This register is used to control the num of increased or decreased - times for low speed channel2.*/ -#define LEDC_DUTY_NUM_LSCH2 0x000003FF -#define LEDC_DUTY_NUM_LSCH2_M ((LEDC_DUTY_NUM_LSCH2_V)<<(LEDC_DUTY_NUM_LSCH2_S)) -#define LEDC_DUTY_NUM_LSCH2_V 0x3FF -#define LEDC_DUTY_NUM_LSCH2_S 20 -/* LEDC_DUTY_CYCLE_LSCH2 : R/W ;bitpos:[19:10] ;default: 10'h0 ; */ -/*description: This register is used to increase or decrease the duty every - reg_duty_cycle_lsch2 cycles for low speed channel2.*/ -#define LEDC_DUTY_CYCLE_LSCH2 0x000003FF -#define LEDC_DUTY_CYCLE_LSCH2_M ((LEDC_DUTY_CYCLE_LSCH2_V)<<(LEDC_DUTY_CYCLE_LSCH2_S)) -#define LEDC_DUTY_CYCLE_LSCH2_V 0x3FF -#define LEDC_DUTY_CYCLE_LSCH2_S 10 -/* LEDC_DUTY_SCALE_LSCH2 : R/W ;bitpos:[9:0] ;default: 10'h0 ; */ -/*description: This register controls the increase or decrease step scale for - low speed channel2.*/ -#define LEDC_DUTY_SCALE_LSCH2 0x000003FF -#define LEDC_DUTY_SCALE_LSCH2_M ((LEDC_DUTY_SCALE_LSCH2_V)<<(LEDC_DUTY_SCALE_LSCH2_S)) -#define LEDC_DUTY_SCALE_LSCH2_V 0x3FF -#define LEDC_DUTY_SCALE_LSCH2_S 0 - -#define LEDC_LSCH2_DUTY_R_REG (DR_REG_LEDC_BASE + 0x00D8) -/* LEDC_DUTY_LSCH2 : RO ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: This register represents the current duty of the output signal - for low speed channel2.*/ -#define LEDC_DUTY_LSCH2 0x01FFFFFF -#define LEDC_DUTY_LSCH2_M ((LEDC_DUTY_LSCH2_V)<<(LEDC_DUTY_LSCH2_S)) -#define LEDC_DUTY_LSCH2_V 0x1FFFFFF -#define LEDC_DUTY_LSCH2_S 0 - -#define LEDC_LSCH3_CONF0_REG (DR_REG_LEDC_BASE + 0x00DC) -/* LEDC_PARA_UP_LSCH3 : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: This bit is used to update register LEDC_LSCH3_HPOINT and LEDC_LSCH3_DUTY - for low speed channel3.*/ -#define LEDC_PARA_UP_LSCH3 (BIT(4)) -#define LEDC_PARA_UP_LSCH3_M (BIT(4)) -#define LEDC_PARA_UP_LSCH3_V 0x1 -#define LEDC_PARA_UP_LSCH3_S 4 -/* LEDC_IDLE_LV_LSCH3 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: This bit is used to control the output value when low speed channel3 is off.*/ -#define LEDC_IDLE_LV_LSCH3 (BIT(3)) -#define LEDC_IDLE_LV_LSCH3_M (BIT(3)) -#define LEDC_IDLE_LV_LSCH3_V 0x1 -#define LEDC_IDLE_LV_LSCH3_S 3 -/* LEDC_SIG_OUT_EN_LSCH3 : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: This is the output enable control bit for low speed channel3.*/ -#define LEDC_SIG_OUT_EN_LSCH3 (BIT(2)) -#define LEDC_SIG_OUT_EN_LSCH3_M (BIT(2)) -#define LEDC_SIG_OUT_EN_LSCH3_V 0x1 -#define LEDC_SIG_OUT_EN_LSCH3_S 2 -/* LEDC_TIMER_SEL_LSCH3 : R/W ;bitpos:[1:0] ;default: 2'd0 ; */ -/*description: There are four low speed timers the two bits are used to select - one of them for low speed channel3. 2'b00: seletc lstimer0. 2'b01: select lstimer1. 2'b10: select lstimer2. 2'b11: select lstimer3.*/ -#define LEDC_TIMER_SEL_LSCH3 0x00000003 -#define LEDC_TIMER_SEL_LSCH3_M ((LEDC_TIMER_SEL_LSCH3_V)<<(LEDC_TIMER_SEL_LSCH3_S)) -#define LEDC_TIMER_SEL_LSCH3_V 0x3 -#define LEDC_TIMER_SEL_LSCH3_S 0 - -#define LEDC_LSCH3_HPOINT_REG (DR_REG_LEDC_BASE + 0x00E0) -/* LEDC_HPOINT_LSCH3 : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: The output value changes to high when lstimerx(x=[0 3]) selected - by low speed channel3 has reached reg_hpoint_lsch3[19:0]*/ -#define LEDC_HPOINT_LSCH3 0x000FFFFF -#define LEDC_HPOINT_LSCH3_M ((LEDC_HPOINT_LSCH3_V)<<(LEDC_HPOINT_LSCH3_S)) -#define LEDC_HPOINT_LSCH3_V 0xFFFFF -#define LEDC_HPOINT_LSCH3_S 0 - -#define LEDC_LSCH3_DUTY_REG (DR_REG_LEDC_BASE + 0x00E4) -/* LEDC_DUTY_LSCH3 : R/W ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: The register is used to control output duty. When lstimerx(x=[0 - 3]) choosed by low speed channel3 has reached reg_lpoint_lsch3 the output signal changes to low. reg_lpoint_lsch3=(reg_hpoint_lsch3[19:0]+reg_duty_lsch3[24:4]) (1) reg_lpoint_lsch3=(reg_hpoint_lsch3[19:0]+reg_duty_lsch3[24:4] +1) (2) The least four bits in this register represent the decimal part and determines when to choose (1) or (2)*/ -#define LEDC_DUTY_LSCH3 0x01FFFFFF -#define LEDC_DUTY_LSCH3_M ((LEDC_DUTY_LSCH3_V)<<(LEDC_DUTY_LSCH3_S)) -#define LEDC_DUTY_LSCH3_V 0x1FFFFFF -#define LEDC_DUTY_LSCH3_S 0 - -#define LEDC_LSCH3_CONF1_REG (DR_REG_LEDC_BASE + 0x00E8) -/* LEDC_DUTY_START_LSCH3 : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When reg_duty_num_hsch3 reg_duty_cycle_hsch3 and reg_duty_scale_hsch3 - has been configured. these register won't take effect until set reg_duty_start_hsch3. this bit is automatically cleared by hardware.*/ -#define LEDC_DUTY_START_LSCH3 (BIT(31)) -#define LEDC_DUTY_START_LSCH3_M (BIT(31)) -#define LEDC_DUTY_START_LSCH3_V 0x1 -#define LEDC_DUTY_START_LSCH3_S 31 -/* LEDC_DUTY_INC_LSCH3 : R/W ;bitpos:[30] ;default: 1'b1 ; */ -/*description: This register is used to increase the duty of output signal or - decrease the duty of output signal for low speed channel3.*/ -#define LEDC_DUTY_INC_LSCH3 (BIT(30)) -#define LEDC_DUTY_INC_LSCH3_M (BIT(30)) -#define LEDC_DUTY_INC_LSCH3_V 0x1 -#define LEDC_DUTY_INC_LSCH3_S 30 -/* LEDC_DUTY_NUM_LSCH3 : R/W ;bitpos:[29:20] ;default: 10'h0 ; */ -/*description: This register is used to control the num of increased or decreased - times for low speed channel3.*/ -#define LEDC_DUTY_NUM_LSCH3 0x000003FF -#define LEDC_DUTY_NUM_LSCH3_M ((LEDC_DUTY_NUM_LSCH3_V)<<(LEDC_DUTY_NUM_LSCH3_S)) -#define LEDC_DUTY_NUM_LSCH3_V 0x3FF -#define LEDC_DUTY_NUM_LSCH3_S 20 -/* LEDC_DUTY_CYCLE_LSCH3 : R/W ;bitpos:[19:10] ;default: 10'h0 ; */ -/*description: This register is used to increase or decrease the duty every - reg_duty_cycle_lsch3 cycles for low speed channel3.*/ -#define LEDC_DUTY_CYCLE_LSCH3 0x000003FF -#define LEDC_DUTY_CYCLE_LSCH3_M ((LEDC_DUTY_CYCLE_LSCH3_V)<<(LEDC_DUTY_CYCLE_LSCH3_S)) -#define LEDC_DUTY_CYCLE_LSCH3_V 0x3FF -#define LEDC_DUTY_CYCLE_LSCH3_S 10 -/* LEDC_DUTY_SCALE_LSCH3 : R/W ;bitpos:[9:0] ;default: 10'h0 ; */ -/*description: This register controls the increase or decrease step scale for - low speed channel3.*/ -#define LEDC_DUTY_SCALE_LSCH3 0x000003FF -#define LEDC_DUTY_SCALE_LSCH3_M ((LEDC_DUTY_SCALE_LSCH3_V)<<(LEDC_DUTY_SCALE_LSCH3_S)) -#define LEDC_DUTY_SCALE_LSCH3_V 0x3FF -#define LEDC_DUTY_SCALE_LSCH3_S 0 - -#define LEDC_LSCH3_DUTY_R_REG (DR_REG_LEDC_BASE + 0x00EC) -/* LEDC_DUTY_LSCH3 : RO ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: This register represents the current duty of the output signal - for low speed channel3.*/ -#define LEDC_DUTY_LSCH3 0x01FFFFFF -#define LEDC_DUTY_LSCH3_M ((LEDC_DUTY_LSCH3_V)<<(LEDC_DUTY_LSCH3_S)) -#define LEDC_DUTY_LSCH3_V 0x1FFFFFF -#define LEDC_DUTY_LSCH3_S 0 - -#define LEDC_LSCH4_CONF0_REG (DR_REG_LEDC_BASE + 0x00F0) -/* LEDC_PARA_UP_LSCH4 : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: This bit is used to update register LEDC_LSCH4_HPOINT and LEDC_LSCH4_DUTY - for low speed channel4.*/ -#define LEDC_PARA_UP_LSCH4 (BIT(4)) -#define LEDC_PARA_UP_LSCH4_M (BIT(4)) -#define LEDC_PARA_UP_LSCH4_V 0x1 -#define LEDC_PARA_UP_LSCH4_S 4 -/* LEDC_IDLE_LV_LSCH4 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: This bit is used to control the output value when low speed channel4 is off.*/ -#define LEDC_IDLE_LV_LSCH4 (BIT(3)) -#define LEDC_IDLE_LV_LSCH4_M (BIT(3)) -#define LEDC_IDLE_LV_LSCH4_V 0x1 -#define LEDC_IDLE_LV_LSCH4_S 3 -/* LEDC_SIG_OUT_EN_LSCH4 : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: This is the output enable control bit for low speed channel4.*/ -#define LEDC_SIG_OUT_EN_LSCH4 (BIT(2)) -#define LEDC_SIG_OUT_EN_LSCH4_M (BIT(2)) -#define LEDC_SIG_OUT_EN_LSCH4_V 0x1 -#define LEDC_SIG_OUT_EN_LSCH4_S 2 -/* LEDC_TIMER_SEL_LSCH4 : R/W ;bitpos:[1:0] ;default: 2'd0 ; */ -/*description: There are four low speed timers the two bits are used to select - one of them for low speed channel4. 2'b00: seletc lstimer0. 2'b01: select lstimer1. 2'b10: select lstimer2. 2'b11: select lstimer3.*/ -#define LEDC_TIMER_SEL_LSCH4 0x00000003 -#define LEDC_TIMER_SEL_LSCH4_M ((LEDC_TIMER_SEL_LSCH4_V)<<(LEDC_TIMER_SEL_LSCH4_S)) -#define LEDC_TIMER_SEL_LSCH4_V 0x3 -#define LEDC_TIMER_SEL_LSCH4_S 0 - -#define LEDC_LSCH4_HPOINT_REG (DR_REG_LEDC_BASE + 0x00F4) -/* LEDC_HPOINT_LSCH4 : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: The output value changes to high when lstimerx(x=[0 3]) selected - by low speed channel4 has reached reg_hpoint_lsch4[19:0]*/ -#define LEDC_HPOINT_LSCH4 0x000FFFFF -#define LEDC_HPOINT_LSCH4_M ((LEDC_HPOINT_LSCH4_V)<<(LEDC_HPOINT_LSCH4_S)) -#define LEDC_HPOINT_LSCH4_V 0xFFFFF -#define LEDC_HPOINT_LSCH4_S 0 - -#define LEDC_LSCH4_DUTY_REG (DR_REG_LEDC_BASE + 0x00F8) -/* LEDC_DUTY_LSCH4 : R/W ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: The register is used to control output duty. When lstimerx(x=[0 - 3]) choosed by low speed channel4 has reached reg_lpoint_lsch4 the output signal changes to low. reg_lpoint_lsch4=(reg_hpoint_lsch4[19:0]+reg_duty_lsch4[24:4]) (1) reg_lpoint_lsch4=(reg_hpoint_lsch4[19:0]+reg_duty_lsch4[24:4] +1) (2) The least four bits in this register represent the decimal part and determines when to choose (1) or (2)*/ -#define LEDC_DUTY_LSCH4 0x01FFFFFF -#define LEDC_DUTY_LSCH4_M ((LEDC_DUTY_LSCH4_V)<<(LEDC_DUTY_LSCH4_S)) -#define LEDC_DUTY_LSCH4_V 0x1FFFFFF -#define LEDC_DUTY_LSCH4_S 0 - -#define LEDC_LSCH4_CONF1_REG (DR_REG_LEDC_BASE + 0x00FC) -/* LEDC_DUTY_START_LSCH4 : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When reg_duty_num_hsch4 reg_duty_cycle_hsch4 and reg_duty_scale_hsch4 - has been configured. these register won't take effect until set reg_duty_start_hsch4. this bit is automatically cleared by hardware.*/ -#define LEDC_DUTY_START_LSCH4 (BIT(31)) -#define LEDC_DUTY_START_LSCH4_M (BIT(31)) -#define LEDC_DUTY_START_LSCH4_V 0x1 -#define LEDC_DUTY_START_LSCH4_S 31 -/* LEDC_DUTY_INC_LSCH4 : R/W ;bitpos:[30] ;default: 1'b1 ; */ -/*description: This register is used to increase the duty of output signal or - decrease the duty of output signal for low speed channel4.*/ -#define LEDC_DUTY_INC_LSCH4 (BIT(30)) -#define LEDC_DUTY_INC_LSCH4_M (BIT(30)) -#define LEDC_DUTY_INC_LSCH4_V 0x1 -#define LEDC_DUTY_INC_LSCH4_S 30 -/* LEDC_DUTY_NUM_LSCH4 : R/W ;bitpos:[29:20] ;default: 10'h0 ; */ -/*description: This register is used to control the num of increased or decreased - times for low speed channel4.*/ -#define LEDC_DUTY_NUM_LSCH4 0x000003FF -#define LEDC_DUTY_NUM_LSCH4_M ((LEDC_DUTY_NUM_LSCH4_V)<<(LEDC_DUTY_NUM_LSCH4_S)) -#define LEDC_DUTY_NUM_LSCH4_V 0x3FF -#define LEDC_DUTY_NUM_LSCH4_S 20 -/* LEDC_DUTY_CYCLE_LSCH4 : R/W ;bitpos:[19:10] ;default: 10'h0 ; */ -/*description: This register is used to increase or decrease the duty every - reg_duty_cycle_lsch4 cycles for low speed channel4.*/ -#define LEDC_DUTY_CYCLE_LSCH4 0x000003FF -#define LEDC_DUTY_CYCLE_LSCH4_M ((LEDC_DUTY_CYCLE_LSCH4_V)<<(LEDC_DUTY_CYCLE_LSCH4_S)) -#define LEDC_DUTY_CYCLE_LSCH4_V 0x3FF -#define LEDC_DUTY_CYCLE_LSCH4_S 10 -/* LEDC_DUTY_SCALE_LSCH4 : R/W ;bitpos:[9:0] ;default: 10'h0 ; */ -/*description: This register controls the increase or decrease step scale for - low speed channel4.*/ -#define LEDC_DUTY_SCALE_LSCH4 0x000003FF -#define LEDC_DUTY_SCALE_LSCH4_M ((LEDC_DUTY_SCALE_LSCH4_V)<<(LEDC_DUTY_SCALE_LSCH4_S)) -#define LEDC_DUTY_SCALE_LSCH4_V 0x3FF -#define LEDC_DUTY_SCALE_LSCH4_S 0 - -#define LEDC_LSCH4_DUTY_R_REG (DR_REG_LEDC_BASE + 0x0100) -/* LEDC_DUTY_LSCH4 : RO ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: This register represents the current duty of the output signal - for low speed channel4.*/ -#define LEDC_DUTY_LSCH4 0x01FFFFFF -#define LEDC_DUTY_LSCH4_M ((LEDC_DUTY_LSCH4_V)<<(LEDC_DUTY_LSCH4_S)) -#define LEDC_DUTY_LSCH4_V 0x1FFFFFF -#define LEDC_DUTY_LSCH4_S 0 - -#define LEDC_LSCH5_CONF0_REG (DR_REG_LEDC_BASE + 0x0104) -/* LEDC_PARA_UP_LSCH5 : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: This bit is used to update register LEDC_LSCH5_HPOINT and LEDC_LSCH5_DUTY - for low speed channel5.*/ -#define LEDC_PARA_UP_LSCH5 (BIT(4)) -#define LEDC_PARA_UP_LSCH5_M (BIT(4)) -#define LEDC_PARA_UP_LSCH5_V 0x1 -#define LEDC_PARA_UP_LSCH5_S 4 -/* LEDC_IDLE_LV_LSCH5 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: This bit is used to control the output value when low speed channel5 is off.*/ -#define LEDC_IDLE_LV_LSCH5 (BIT(3)) -#define LEDC_IDLE_LV_LSCH5_M (BIT(3)) -#define LEDC_IDLE_LV_LSCH5_V 0x1 -#define LEDC_IDLE_LV_LSCH5_S 3 -/* LEDC_SIG_OUT_EN_LSCH5 : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: This is the output enable control bit for low speed channel5.*/ -#define LEDC_SIG_OUT_EN_LSCH5 (BIT(2)) -#define LEDC_SIG_OUT_EN_LSCH5_M (BIT(2)) -#define LEDC_SIG_OUT_EN_LSCH5_V 0x1 -#define LEDC_SIG_OUT_EN_LSCH5_S 2 -/* LEDC_TIMER_SEL_LSCH5 : R/W ;bitpos:[1:0] ;default: 2'd0 ; */ -/*description: There are four low speed timers the two bits are used to select - one of them for low speed channel5. 2'b00: seletc lstimer0. 2'b01: select lstimer1. 2'b10: select lstimer2. 2'b11: select lstimer3.*/ -#define LEDC_TIMER_SEL_LSCH5 0x00000003 -#define LEDC_TIMER_SEL_LSCH5_M ((LEDC_TIMER_SEL_LSCH5_V)<<(LEDC_TIMER_SEL_LSCH5_S)) -#define LEDC_TIMER_SEL_LSCH5_V 0x3 -#define LEDC_TIMER_SEL_LSCH5_S 0 - -#define LEDC_LSCH5_HPOINT_REG (DR_REG_LEDC_BASE + 0x0108) -/* LEDC_HPOINT_LSCH5 : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: The output value changes to high when lstimerx(x=[0 3]) selected - by low speed channel5 has reached reg_hpoint_lsch5[19:0]*/ -#define LEDC_HPOINT_LSCH5 0x000FFFFF -#define LEDC_HPOINT_LSCH5_M ((LEDC_HPOINT_LSCH5_V)<<(LEDC_HPOINT_LSCH5_S)) -#define LEDC_HPOINT_LSCH5_V 0xFFFFF -#define LEDC_HPOINT_LSCH5_S 0 - -#define LEDC_LSCH5_DUTY_REG (DR_REG_LEDC_BASE + 0x010C) -/* LEDC_DUTY_LSCH5 : R/W ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: The register is used to control output duty. When lstimerx(x=[0 - 3]) choosed by low speed channel5 has reached reg_lpoint_lsch5 the output signal changes to low. reg_lpoint_lsch5=(reg_hpoint_lsch5[19:0]+reg_duty_lsch5[24:4]) (1) reg_lpoint_lsch5=(reg_hpoint_lsch5[19:0]+reg_duty_lsch5[24:4] +1) (2) The least four bits in this register represent the decimal part and determines when to choose (1) or (2)*/ -#define LEDC_DUTY_LSCH5 0x01FFFFFF -#define LEDC_DUTY_LSCH5_M ((LEDC_DUTY_LSCH5_V)<<(LEDC_DUTY_LSCH5_S)) -#define LEDC_DUTY_LSCH5_V 0x1FFFFFF -#define LEDC_DUTY_LSCH5_S 0 - -#define LEDC_LSCH5_CONF1_REG (DR_REG_LEDC_BASE + 0x0110) -/* LEDC_DUTY_START_LSCH5 : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When reg_duty_num_hsch4 reg_duty_cycle_hsch4 and reg_duty_scale_hsch4 - has been configured. these register won't take effect until set reg_duty_start_hsch4. this bit is automatically cleared by hardware.*/ -#define LEDC_DUTY_START_LSCH5 (BIT(31)) -#define LEDC_DUTY_START_LSCH5_M (BIT(31)) -#define LEDC_DUTY_START_LSCH5_V 0x1 -#define LEDC_DUTY_START_LSCH5_S 31 -/* LEDC_DUTY_INC_LSCH5 : R/W ;bitpos:[30] ;default: 1'b1 ; */ -/*description: This register is used to increase the duty of output signal or - decrease the duty of output signal for low speed channel5.*/ -#define LEDC_DUTY_INC_LSCH5 (BIT(30)) -#define LEDC_DUTY_INC_LSCH5_M (BIT(30)) -#define LEDC_DUTY_INC_LSCH5_V 0x1 -#define LEDC_DUTY_INC_LSCH5_S 30 -/* LEDC_DUTY_NUM_LSCH5 : R/W ;bitpos:[29:20] ;default: 10'h0 ; */ -/*description: This register is used to control the num of increased or decreased - times for low speed channel5.*/ -#define LEDC_DUTY_NUM_LSCH5 0x000003FF -#define LEDC_DUTY_NUM_LSCH5_M ((LEDC_DUTY_NUM_LSCH5_V)<<(LEDC_DUTY_NUM_LSCH5_S)) -#define LEDC_DUTY_NUM_LSCH5_V 0x3FF -#define LEDC_DUTY_NUM_LSCH5_S 20 -/* LEDC_DUTY_CYCLE_LSCH5 : R/W ;bitpos:[19:10] ;default: 10'h0 ; */ -/*description: This register is used to increase or decrease the duty every - reg_duty_cycle_lsch5 cycles for low speed channel4.*/ -#define LEDC_DUTY_CYCLE_LSCH5 0x000003FF -#define LEDC_DUTY_CYCLE_LSCH5_M ((LEDC_DUTY_CYCLE_LSCH5_V)<<(LEDC_DUTY_CYCLE_LSCH5_S)) -#define LEDC_DUTY_CYCLE_LSCH5_V 0x3FF -#define LEDC_DUTY_CYCLE_LSCH5_S 10 -/* LEDC_DUTY_SCALE_LSCH5 : R/W ;bitpos:[9:0] ;default: 10'h0 ; */ -/*description: This register controls the increase or decrease step scale for - low speed channel5.*/ -#define LEDC_DUTY_SCALE_LSCH5 0x000003FF -#define LEDC_DUTY_SCALE_LSCH5_M ((LEDC_DUTY_SCALE_LSCH5_V)<<(LEDC_DUTY_SCALE_LSCH5_S)) -#define LEDC_DUTY_SCALE_LSCH5_V 0x3FF -#define LEDC_DUTY_SCALE_LSCH5_S 0 - -#define LEDC_LSCH5_DUTY_R_REG (DR_REG_LEDC_BASE + 0x0114) -/* LEDC_DUTY_LSCH5 : RO ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: This register represents the current duty of the output signal - for low speed channel5.*/ -#define LEDC_DUTY_LSCH5 0x01FFFFFF -#define LEDC_DUTY_LSCH5_M ((LEDC_DUTY_LSCH5_V)<<(LEDC_DUTY_LSCH5_S)) -#define LEDC_DUTY_LSCH5_V 0x1FFFFFF -#define LEDC_DUTY_LSCH5_S 0 - -#define LEDC_LSCH6_CONF0_REG (DR_REG_LEDC_BASE + 0x0118) -/* LEDC_PARA_UP_LSCH6 : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: This bit is used to update register LEDC_LSCH6_HPOINT and LEDC_LSCH6_DUTY - for low speed channel6.*/ -#define LEDC_PARA_UP_LSCH6 (BIT(4)) -#define LEDC_PARA_UP_LSCH6_M (BIT(4)) -#define LEDC_PARA_UP_LSCH6_V 0x1 -#define LEDC_PARA_UP_LSCH6_S 4 -/* LEDC_IDLE_LV_LSCH6 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: This bit is used to control the output value when low speed channel6 is off.*/ -#define LEDC_IDLE_LV_LSCH6 (BIT(3)) -#define LEDC_IDLE_LV_LSCH6_M (BIT(3)) -#define LEDC_IDLE_LV_LSCH6_V 0x1 -#define LEDC_IDLE_LV_LSCH6_S 3 -/* LEDC_SIG_OUT_EN_LSCH6 : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: This is the output enable control bit for low speed channel6.*/ -#define LEDC_SIG_OUT_EN_LSCH6 (BIT(2)) -#define LEDC_SIG_OUT_EN_LSCH6_M (BIT(2)) -#define LEDC_SIG_OUT_EN_LSCH6_V 0x1 -#define LEDC_SIG_OUT_EN_LSCH6_S 2 -/* LEDC_TIMER_SEL_LSCH6 : R/W ;bitpos:[1:0] ;default: 2'd0 ; */ -/*description: There are four low speed timers the two bits are used to select - one of them for low speed channel6. 2'b00: seletc lstimer0. 2'b01: select lstimer1. 2'b10: select lstimer2. 2'b11: select lstimer3.*/ -#define LEDC_TIMER_SEL_LSCH6 0x00000003 -#define LEDC_TIMER_SEL_LSCH6_M ((LEDC_TIMER_SEL_LSCH6_V)<<(LEDC_TIMER_SEL_LSCH6_S)) -#define LEDC_TIMER_SEL_LSCH6_V 0x3 -#define LEDC_TIMER_SEL_LSCH6_S 0 - -#define LEDC_LSCH6_HPOINT_REG (DR_REG_LEDC_BASE + 0x011C) -/* LEDC_HPOINT_LSCH6 : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: The output value changes to high when lstimerx(x=[0 3]) selected - by low speed channel6 has reached reg_hpoint_lsch6[19:0]*/ -#define LEDC_HPOINT_LSCH6 0x000FFFFF -#define LEDC_HPOINT_LSCH6_M ((LEDC_HPOINT_LSCH6_V)<<(LEDC_HPOINT_LSCH6_S)) -#define LEDC_HPOINT_LSCH6_V 0xFFFFF -#define LEDC_HPOINT_LSCH6_S 0 - -#define LEDC_LSCH6_DUTY_REG (DR_REG_LEDC_BASE + 0x0120) -/* LEDC_DUTY_LSCH6 : R/W ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: The register is used to control output duty. When lstimerx(x=[0 - 3]) choosed by low speed channel6 has reached reg_lpoint_lsch6 the output signal changes to low. reg_lpoint_lsch6=(reg_hpoint_lsch6[19:0]+reg_duty_lsch6[24:4]) (1) reg_lpoint_lsch6=(reg_hpoint_lsch6[19:0]+reg_duty_lsch6[24:4] +1) (2) The least four bits in this register represent the decimal part and determines when to choose (1) or (2)*/ -#define LEDC_DUTY_LSCH6 0x01FFFFFF -#define LEDC_DUTY_LSCH6_M ((LEDC_DUTY_LSCH6_V)<<(LEDC_DUTY_LSCH6_S)) -#define LEDC_DUTY_LSCH6_V 0x1FFFFFF -#define LEDC_DUTY_LSCH6_S 0 - -#define LEDC_LSCH6_CONF1_REG (DR_REG_LEDC_BASE + 0x0124) -/* LEDC_DUTY_START_LSCH6 : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When reg_duty_num_hsch6 reg_duty_cycle_hsch6 and reg_duty_scale_hsch6 - has been configured. these register won't take effect until set reg_duty_start_hsch6. this bit is automatically cleared by hardware.*/ -#define LEDC_DUTY_START_LSCH6 (BIT(31)) -#define LEDC_DUTY_START_LSCH6_M (BIT(31)) -#define LEDC_DUTY_START_LSCH6_V 0x1 -#define LEDC_DUTY_START_LSCH6_S 31 -/* LEDC_DUTY_INC_LSCH6 : R/W ;bitpos:[30] ;default: 1'b1 ; */ -/*description: This register is used to increase the duty of output signal or - decrease the duty of output signal for low speed channel6.*/ -#define LEDC_DUTY_INC_LSCH6 (BIT(30)) -#define LEDC_DUTY_INC_LSCH6_M (BIT(30)) -#define LEDC_DUTY_INC_LSCH6_V 0x1 -#define LEDC_DUTY_INC_LSCH6_S 30 -/* LEDC_DUTY_NUM_LSCH6 : R/W ;bitpos:[29:20] ;default: 10'h0 ; */ -/*description: This register is used to control the num of increased or decreased - times for low speed channel6.*/ -#define LEDC_DUTY_NUM_LSCH6 0x000003FF -#define LEDC_DUTY_NUM_LSCH6_M ((LEDC_DUTY_NUM_LSCH6_V)<<(LEDC_DUTY_NUM_LSCH6_S)) -#define LEDC_DUTY_NUM_LSCH6_V 0x3FF -#define LEDC_DUTY_NUM_LSCH6_S 20 -/* LEDC_DUTY_CYCLE_LSCH6 : R/W ;bitpos:[19:10] ;default: 10'h0 ; */ -/*description: This register is used to increase or decrease the duty every - reg_duty_cycle_lsch6 cycles for low speed channel6.*/ -#define LEDC_DUTY_CYCLE_LSCH6 0x000003FF -#define LEDC_DUTY_CYCLE_LSCH6_M ((LEDC_DUTY_CYCLE_LSCH6_V)<<(LEDC_DUTY_CYCLE_LSCH6_S)) -#define LEDC_DUTY_CYCLE_LSCH6_V 0x3FF -#define LEDC_DUTY_CYCLE_LSCH6_S 10 -/* LEDC_DUTY_SCALE_LSCH6 : R/W ;bitpos:[9:0] ;default: 10'h0 ; */ -/*description: This register controls the increase or decrease step scale for - low speed channel6.*/ -#define LEDC_DUTY_SCALE_LSCH6 0x000003FF -#define LEDC_DUTY_SCALE_LSCH6_M ((LEDC_DUTY_SCALE_LSCH6_V)<<(LEDC_DUTY_SCALE_LSCH6_S)) -#define LEDC_DUTY_SCALE_LSCH6_V 0x3FF -#define LEDC_DUTY_SCALE_LSCH6_S 0 - -#define LEDC_LSCH6_DUTY_R_REG (DR_REG_LEDC_BASE + 0x0128) -/* LEDC_DUTY_LSCH6 : RO ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: This register represents the current duty of the output signal - for low speed channel6.*/ -#define LEDC_DUTY_LSCH6 0x01FFFFFF -#define LEDC_DUTY_LSCH6_M ((LEDC_DUTY_LSCH6_V)<<(LEDC_DUTY_LSCH6_S)) -#define LEDC_DUTY_LSCH6_V 0x1FFFFFF -#define LEDC_DUTY_LSCH6_S 0 - -#define LEDC_LSCH7_CONF0_REG (DR_REG_LEDC_BASE + 0x012C) -/* LEDC_PARA_UP_LSCH7 : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: This bit is used to update register LEDC_LSCH7_HPOINT and LEDC_LSCH7_DUTY - for low speed channel7.*/ -#define LEDC_PARA_UP_LSCH7 (BIT(4)) -#define LEDC_PARA_UP_LSCH7_M (BIT(4)) -#define LEDC_PARA_UP_LSCH7_V 0x1 -#define LEDC_PARA_UP_LSCH7_S 4 -/* LEDC_IDLE_LV_LSCH7 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: This bit is used to control the output value when low speed channel7 is off.*/ -#define LEDC_IDLE_LV_LSCH7 (BIT(3)) -#define LEDC_IDLE_LV_LSCH7_M (BIT(3)) -#define LEDC_IDLE_LV_LSCH7_V 0x1 -#define LEDC_IDLE_LV_LSCH7_S 3 -/* LEDC_SIG_OUT_EN_LSCH7 : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: This is the output enable control bit for low speed channel7.*/ -#define LEDC_SIG_OUT_EN_LSCH7 (BIT(2)) -#define LEDC_SIG_OUT_EN_LSCH7_M (BIT(2)) -#define LEDC_SIG_OUT_EN_LSCH7_V 0x1 -#define LEDC_SIG_OUT_EN_LSCH7_S 2 -/* LEDC_TIMER_SEL_LSCH7 : R/W ;bitpos:[1:0] ;default: 2'd0 ; */ -/*description: There are four low speed timers the two bits are used to select - one of them for low speed channel7. 2'b00: seletc lstimer0. 2'b01: select lstimer1. 2'b10: select lstimer2. 2'b11: select lstimer3.*/ -#define LEDC_TIMER_SEL_LSCH7 0x00000003 -#define LEDC_TIMER_SEL_LSCH7_M ((LEDC_TIMER_SEL_LSCH7_V)<<(LEDC_TIMER_SEL_LSCH7_S)) -#define LEDC_TIMER_SEL_LSCH7_V 0x3 -#define LEDC_TIMER_SEL_LSCH7_S 0 - -#define LEDC_LSCH7_HPOINT_REG (DR_REG_LEDC_BASE + 0x0130) -/* LEDC_HPOINT_LSCH7 : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: The output value changes to high when lstimerx(x=[0 3]) selected - by low speed channel7 has reached reg_hpoint_lsch7[19:0]*/ -#define LEDC_HPOINT_LSCH7 0x000FFFFF -#define LEDC_HPOINT_LSCH7_M ((LEDC_HPOINT_LSCH7_V)<<(LEDC_HPOINT_LSCH7_S)) -#define LEDC_HPOINT_LSCH7_V 0xFFFFF -#define LEDC_HPOINT_LSCH7_S 0 - -#define LEDC_LSCH7_DUTY_REG (DR_REG_LEDC_BASE + 0x0134) -/* LEDC_DUTY_LSCH7 : R/W ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: The register is used to control output duty. When lstimerx(x=[0 - 3]) choosed by low speed channel7 has reached reg_lpoint_lsch7 the output signal changes to low. reg_lpoint_lsch7=(reg_hpoint_lsch7[19:0]+reg_duty_lsch7[24:4]) (1) reg_lpoint_lsch7=(reg_hpoint_lsch7[19:0]+reg_duty_lsch7[24:4] +1) (2) The least four bits in this register represent the decimal part and determines when to choose (1) or (2)*/ -#define LEDC_DUTY_LSCH7 0x01FFFFFF -#define LEDC_DUTY_LSCH7_M ((LEDC_DUTY_LSCH7_V)<<(LEDC_DUTY_LSCH7_S)) -#define LEDC_DUTY_LSCH7_V 0x1FFFFFF -#define LEDC_DUTY_LSCH7_S 0 - -#define LEDC_LSCH7_CONF1_REG (DR_REG_LEDC_BASE + 0x0138) -/* LEDC_DUTY_START_LSCH7 : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: When reg_duty_num_hsch4 reg_duty_cycle_hsch4 and reg_duty_scale_hsch4 - has been configured. these register won't take effect until set reg_duty_start_hsch4. this bit is automatically cleared by hardware.*/ -#define LEDC_DUTY_START_LSCH7 (BIT(31)) -#define LEDC_DUTY_START_LSCH7_M (BIT(31)) -#define LEDC_DUTY_START_LSCH7_V 0x1 -#define LEDC_DUTY_START_LSCH7_S 31 -/* LEDC_DUTY_INC_LSCH7 : R/W ;bitpos:[30] ;default: 1'b1 ; */ -/*description: This register is used to increase the duty of output signal or - decrease the duty of output signal for low speed channel4.*/ -#define LEDC_DUTY_INC_LSCH7 (BIT(30)) -#define LEDC_DUTY_INC_LSCH7_M (BIT(30)) -#define LEDC_DUTY_INC_LSCH7_V 0x1 -#define LEDC_DUTY_INC_LSCH7_S 30 -/* LEDC_DUTY_NUM_LSCH7 : R/W ;bitpos:[29:20] ;default: 10'h0 ; */ -/*description: This register is used to control the num of increased or decreased - times for low speed channel4.*/ -#define LEDC_DUTY_NUM_LSCH7 0x000003FF -#define LEDC_DUTY_NUM_LSCH7_M ((LEDC_DUTY_NUM_LSCH7_V)<<(LEDC_DUTY_NUM_LSCH7_S)) -#define LEDC_DUTY_NUM_LSCH7_V 0x3FF -#define LEDC_DUTY_NUM_LSCH7_S 20 -/* LEDC_DUTY_CYCLE_LSCH7 : R/W ;bitpos:[19:10] ;default: 10'h0 ; */ -/*description: This register is used to increase or decrease the duty every - reg_duty_cycle_lsch7 cycles for low speed channel7.*/ -#define LEDC_DUTY_CYCLE_LSCH7 0x000003FF -#define LEDC_DUTY_CYCLE_LSCH7_M ((LEDC_DUTY_CYCLE_LSCH7_V)<<(LEDC_DUTY_CYCLE_LSCH7_S)) -#define LEDC_DUTY_CYCLE_LSCH7_V 0x3FF -#define LEDC_DUTY_CYCLE_LSCH7_S 10 -/* LEDC_DUTY_SCALE_LSCH7 : R/W ;bitpos:[9:0] ;default: 10'h0 ; */ -/*description: This register controls the increase or decrease step scale for - low speed channel7.*/ -#define LEDC_DUTY_SCALE_LSCH7 0x000003FF -#define LEDC_DUTY_SCALE_LSCH7_M ((LEDC_DUTY_SCALE_LSCH7_V)<<(LEDC_DUTY_SCALE_LSCH7_S)) -#define LEDC_DUTY_SCALE_LSCH7_V 0x3FF -#define LEDC_DUTY_SCALE_LSCH7_S 0 - -#define LEDC_LSCH7_DUTY_R_REG (DR_REG_LEDC_BASE + 0x013C) -/* LEDC_DUTY_LSCH7 : RO ;bitpos:[24:0] ;default: 25'h0 ; */ -/*description: This register represents the current duty of the output signal - for low speed channel7.*/ -#define LEDC_DUTY_LSCH7 0x01FFFFFF -#define LEDC_DUTY_LSCH7_M ((LEDC_DUTY_LSCH7_V)<<(LEDC_DUTY_LSCH7_S)) -#define LEDC_DUTY_LSCH7_V 0x1FFFFFF -#define LEDC_DUTY_LSCH7_S 0 - -#define LEDC_HSTIMER0_CONF_REG (DR_REG_LEDC_BASE + 0x0140) -/* LEDC_TICK_SEL_HSTIMER0 : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: This bit is used to choose apb_clk or ref_tick for high speed - timer0. 1'b1:apb_clk 0:ref_tick*/ -#define LEDC_TICK_SEL_HSTIMER0 (BIT(25)) -#define LEDC_TICK_SEL_HSTIMER0_M (BIT(25)) -#define LEDC_TICK_SEL_HSTIMER0_V 0x1 -#define LEDC_TICK_SEL_HSTIMER0_S 25 -/* LEDC_HSTIMER0_RST : R/W ;bitpos:[24] ;default: 1'b1 ; */ -/*description: This bit is used to reset high speed timer0 the counter will be 0 after reset.*/ -#define LEDC_HSTIMER0_RST (BIT(24)) -#define LEDC_HSTIMER0_RST_M (BIT(24)) -#define LEDC_HSTIMER0_RST_V 0x1 -#define LEDC_HSTIMER0_RST_S 24 -/* LEDC_HSTIMER0_PAUSE : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: This bit is used to pause the counter in high speed timer0*/ -#define LEDC_HSTIMER0_PAUSE (BIT(23)) -#define LEDC_HSTIMER0_PAUSE_M (BIT(23)) -#define LEDC_HSTIMER0_PAUSE_V 0x1 -#define LEDC_HSTIMER0_PAUSE_S 23 -/* LEDC_DIV_NUM_HSTIMER0 : R/W ;bitpos:[22:5] ;default: 18'h0 ; */ -/*description: This register is used to configure parameter for divider in high - speed timer0 the least significant eight bits represent the decimal part.*/ -#define LEDC_DIV_NUM_HSTIMER0 0x0003FFFF -#define LEDC_DIV_NUM_HSTIMER0_M ((LEDC_DIV_NUM_HSTIMER0_V)<<(LEDC_DIV_NUM_HSTIMER0_S)) -#define LEDC_DIV_NUM_HSTIMER0_V 0x3FFFF -#define LEDC_DIV_NUM_HSTIMER0_S 5 -/* LEDC_HSTIMER0_LIM : R/W ;bitpos:[4:0] ;default: 5'h0 ; */ -/*description: This register controls the range of the counter in high speed - timer0. the counter range is [0 2**reg_hstimer0_lim] the max bit width for counter is 20.*/ -#define LEDC_HSTIMER0_LIM 0x0000001F -#define LEDC_HSTIMER0_LIM_M ((LEDC_HSTIMER0_LIM_V)<<(LEDC_HSTIMER0_LIM_S)) -#define LEDC_HSTIMER0_LIM_V 0x1F -#define LEDC_HSTIMER0_LIM_S 0 - -#define LEDC_HSTIMER0_VALUE_REG (DR_REG_LEDC_BASE + 0x0144) -/* LEDC_HSTIMER0_CNT : RO ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: software can read this register to get the current counter value - in high speed timer0*/ -#define LEDC_HSTIMER0_CNT 0x000FFFFF -#define LEDC_HSTIMER0_CNT_M ((LEDC_HSTIMER0_CNT_V)<<(LEDC_HSTIMER0_CNT_S)) -#define LEDC_HSTIMER0_CNT_V 0xFFFFF -#define LEDC_HSTIMER0_CNT_S 0 - -#define LEDC_HSTIMER1_CONF_REG (DR_REG_LEDC_BASE + 0x0148) -/* LEDC_TICK_SEL_HSTIMER1 : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: This bit is used to choose apb_clk or ref_tick for high speed - timer1. 1'b1:apb_clk 0:ref_tick*/ -#define LEDC_TICK_SEL_HSTIMER1 (BIT(25)) -#define LEDC_TICK_SEL_HSTIMER1_M (BIT(25)) -#define LEDC_TICK_SEL_HSTIMER1_V 0x1 -#define LEDC_TICK_SEL_HSTIMER1_S 25 -/* LEDC_HSTIMER1_RST : R/W ;bitpos:[24] ;default: 1'b1 ; */ -/*description: This bit is used to reset high speed timer1 the counter will be 0 after reset.*/ -#define LEDC_HSTIMER1_RST (BIT(24)) -#define LEDC_HSTIMER1_RST_M (BIT(24)) -#define LEDC_HSTIMER1_RST_V 0x1 -#define LEDC_HSTIMER1_RST_S 24 -/* LEDC_HSTIMER1_PAUSE : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: This bit is used to pause the counter in high speed timer1*/ -#define LEDC_HSTIMER1_PAUSE (BIT(23)) -#define LEDC_HSTIMER1_PAUSE_M (BIT(23)) -#define LEDC_HSTIMER1_PAUSE_V 0x1 -#define LEDC_HSTIMER1_PAUSE_S 23 -/* LEDC_DIV_NUM_HSTIMER1 : R/W ;bitpos:[22:5] ;default: 18'h0 ; */ -/*description: This register is used to configure parameter for divider in high - speed timer1 the least significant eight bits represent the decimal part.*/ -#define LEDC_DIV_NUM_HSTIMER1 0x0003FFFF -#define LEDC_DIV_NUM_HSTIMER1_M ((LEDC_DIV_NUM_HSTIMER1_V)<<(LEDC_DIV_NUM_HSTIMER1_S)) -#define LEDC_DIV_NUM_HSTIMER1_V 0x3FFFF -#define LEDC_DIV_NUM_HSTIMER1_S 5 -/* LEDC_HSTIMER1_LIM : R/W ;bitpos:[4:0] ;default: 5'h0 ; */ -/*description: This register controls the range of the counter in high speed - timer1. the counter range is [0 2**reg_hstimer1_lim] the max bit width for counter is 20.*/ -#define LEDC_HSTIMER1_LIM 0x0000001F -#define LEDC_HSTIMER1_LIM_M ((LEDC_HSTIMER1_LIM_V)<<(LEDC_HSTIMER1_LIM_S)) -#define LEDC_HSTIMER1_LIM_V 0x1F -#define LEDC_HSTIMER1_LIM_S 0 - -#define LEDC_HSTIMER1_VALUE_REG (DR_REG_LEDC_BASE + 0x014C) -/* LEDC_HSTIMER1_CNT : RO ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: software can read this register to get the current counter value - in high speed timer1.*/ -#define LEDC_HSTIMER1_CNT 0x000FFFFF -#define LEDC_HSTIMER1_CNT_M ((LEDC_HSTIMER1_CNT_V)<<(LEDC_HSTIMER1_CNT_S)) -#define LEDC_HSTIMER1_CNT_V 0xFFFFF -#define LEDC_HSTIMER1_CNT_S 0 - -#define LEDC_HSTIMER2_CONF_REG (DR_REG_LEDC_BASE + 0x0150) -/* LEDC_TICK_SEL_HSTIMER2 : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: This bit is used to choose apb_clk or ref_tick for high speed - timer2. 1'b1:apb_clk 0:ref_tick*/ -#define LEDC_TICK_SEL_HSTIMER2 (BIT(25)) -#define LEDC_TICK_SEL_HSTIMER2_M (BIT(25)) -#define LEDC_TICK_SEL_HSTIMER2_V 0x1 -#define LEDC_TICK_SEL_HSTIMER2_S 25 -/* LEDC_HSTIMER2_RST : R/W ;bitpos:[24] ;default: 1'b1 ; */ -/*description: This bit is used to reset high speed timer2 the counter will be 0 after reset.*/ -#define LEDC_HSTIMER2_RST (BIT(24)) -#define LEDC_HSTIMER2_RST_M (BIT(24)) -#define LEDC_HSTIMER2_RST_V 0x1 -#define LEDC_HSTIMER2_RST_S 24 -/* LEDC_HSTIMER2_PAUSE : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: This bit is used to pause the counter in high speed timer2*/ -#define LEDC_HSTIMER2_PAUSE (BIT(23)) -#define LEDC_HSTIMER2_PAUSE_M (BIT(23)) -#define LEDC_HSTIMER2_PAUSE_V 0x1 -#define LEDC_HSTIMER2_PAUSE_S 23 -/* LEDC_DIV_NUM_HSTIMER2 : R/W ;bitpos:[22:5] ;default: 18'h0 ; */ -/*description: This register is used to configure parameter for divider in high - speed timer2 the least significant eight bits represent the decimal part.*/ -#define LEDC_DIV_NUM_HSTIMER2 0x0003FFFF -#define LEDC_DIV_NUM_HSTIMER2_M ((LEDC_DIV_NUM_HSTIMER2_V)<<(LEDC_DIV_NUM_HSTIMER2_S)) -#define LEDC_DIV_NUM_HSTIMER2_V 0x3FFFF -#define LEDC_DIV_NUM_HSTIMER2_S 5 -/* LEDC_HSTIMER2_LIM : R/W ;bitpos:[4:0] ;default: 5'h0 ; */ -/*description: This register controls the range of the counter in high speed - timer2. the counter range is [0 2**reg_hstimer2_lim] the max bit width for counter is 20.*/ -#define LEDC_HSTIMER2_LIM 0x0000001F -#define LEDC_HSTIMER2_LIM_M ((LEDC_HSTIMER2_LIM_V)<<(LEDC_HSTIMER2_LIM_S)) -#define LEDC_HSTIMER2_LIM_V 0x1F -#define LEDC_HSTIMER2_LIM_S 0 - -#define LEDC_HSTIMER2_VALUE_REG (DR_REG_LEDC_BASE + 0x0154) -/* LEDC_HSTIMER2_CNT : RO ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: software can read this register to get the current counter value - in high speed timer2*/ -#define LEDC_HSTIMER2_CNT 0x000FFFFF -#define LEDC_HSTIMER2_CNT_M ((LEDC_HSTIMER2_CNT_V)<<(LEDC_HSTIMER2_CNT_S)) -#define LEDC_HSTIMER2_CNT_V 0xFFFFF -#define LEDC_HSTIMER2_CNT_S 0 - -#define LEDC_HSTIMER3_CONF_REG (DR_REG_LEDC_BASE + 0x0158) -/* LEDC_TICK_SEL_HSTIMER3 : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: This bit is used to choose apb_clk or ref_tick for high speed - timer3. 1'b1:apb_clk 0:ref_tick*/ -#define LEDC_TICK_SEL_HSTIMER3 (BIT(25)) -#define LEDC_TICK_SEL_HSTIMER3_M (BIT(25)) -#define LEDC_TICK_SEL_HSTIMER3_V 0x1 -#define LEDC_TICK_SEL_HSTIMER3_S 25 -/* LEDC_HSTIMER3_RST : R/W ;bitpos:[24] ;default: 1'b1 ; */ -/*description: This bit is used to reset high speed timer3 the counter will be 0 after reset.*/ -#define LEDC_HSTIMER3_RST (BIT(24)) -#define LEDC_HSTIMER3_RST_M (BIT(24)) -#define LEDC_HSTIMER3_RST_V 0x1 -#define LEDC_HSTIMER3_RST_S 24 -/* LEDC_HSTIMER3_PAUSE : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: This bit is used to pause the counter in high speed timer3*/ -#define LEDC_HSTIMER3_PAUSE (BIT(23)) -#define LEDC_HSTIMER3_PAUSE_M (BIT(23)) -#define LEDC_HSTIMER3_PAUSE_V 0x1 -#define LEDC_HSTIMER3_PAUSE_S 23 -/* LEDC_DIV_NUM_HSTIMER3 : R/W ;bitpos:[22:5] ;default: 18'h0 ; */ -/*description: This register is used to configure parameter for divider in high - speed timer3 the least significant eight bits represent the decimal part.*/ -#define LEDC_DIV_NUM_HSTIMER3 0x0003FFFF -#define LEDC_DIV_NUM_HSTIMER3_M ((LEDC_DIV_NUM_HSTIMER3_V)<<(LEDC_DIV_NUM_HSTIMER3_S)) -#define LEDC_DIV_NUM_HSTIMER3_V 0x3FFFF -#define LEDC_DIV_NUM_HSTIMER3_S 5 -/* LEDC_HSTIMER3_LIM : R/W ;bitpos:[4:0] ;default: 5'h0 ; */ -/*description: This register controls the range of the counter in high speed - timer3. the counter range is [0 2**reg_hstimer3_lim] the max bit width for counter is 20.*/ -#define LEDC_HSTIMER3_LIM 0x0000001F -#define LEDC_HSTIMER3_LIM_M ((LEDC_HSTIMER3_LIM_V)<<(LEDC_HSTIMER3_LIM_S)) -#define LEDC_HSTIMER3_LIM_V 0x1F -#define LEDC_HSTIMER3_LIM_S 0 - -#define LEDC_HSTIMER3_VALUE_REG (DR_REG_LEDC_BASE + 0x015C) -/* LEDC_HSTIMER3_CNT : RO ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: software can read this register to get the current counter value - in high speed timer3*/ -#define LEDC_HSTIMER3_CNT 0x000FFFFF -#define LEDC_HSTIMER3_CNT_M ((LEDC_HSTIMER3_CNT_V)<<(LEDC_HSTIMER3_CNT_S)) -#define LEDC_HSTIMER3_CNT_V 0xFFFFF -#define LEDC_HSTIMER3_CNT_S 0 - -#define LEDC_LSTIMER0_CONF_REG (DR_REG_LEDC_BASE + 0x0160) -/* LEDC_LSTIMER0_PARA_UP : R/W ;bitpos:[26] ;default: 1'h0 ; */ -/*description: Set this bit to update reg_div_num_lstime0 and reg_lstimer0_lim.*/ -#define LEDC_LSTIMER0_PARA_UP (BIT(26)) -#define LEDC_LSTIMER0_PARA_UP_M (BIT(26)) -#define LEDC_LSTIMER0_PARA_UP_V 0x1 -#define LEDC_LSTIMER0_PARA_UP_S 26 -/* LEDC_TICK_SEL_LSTIMER0 : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: This bit is used to choose slow_clk or ref_tick for low speed - timer0. 1'b1:slow_clk 0:ref_tick*/ -#define LEDC_TICK_SEL_LSTIMER0 (BIT(25)) -#define LEDC_TICK_SEL_LSTIMER0_M (BIT(25)) -#define LEDC_TICK_SEL_LSTIMER0_V 0x1 -#define LEDC_TICK_SEL_LSTIMER0_S 25 -/* LEDC_LSTIMER0_RST : R/W ;bitpos:[24] ;default: 1'b1 ; */ -/*description: This bit is used to reset low speed timer0 the counter will be 0 after reset.*/ -#define LEDC_LSTIMER0_RST (BIT(24)) -#define LEDC_LSTIMER0_RST_M (BIT(24)) -#define LEDC_LSTIMER0_RST_V 0x1 -#define LEDC_LSTIMER0_RST_S 24 -/* LEDC_LSTIMER0_PAUSE : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: This bit is used to pause the counter in low speed timer0.*/ -#define LEDC_LSTIMER0_PAUSE (BIT(23)) -#define LEDC_LSTIMER0_PAUSE_M (BIT(23)) -#define LEDC_LSTIMER0_PAUSE_V 0x1 -#define LEDC_LSTIMER0_PAUSE_S 23 -/* LEDC_DIV_NUM_LSTIMER0 : R/W ;bitpos:[22:5] ;default: 18'h0 ; */ -/*description: This register is used to configure parameter for divider in low - speed timer0 the least significant eight bits represent the decimal part.*/ -#define LEDC_DIV_NUM_LSTIMER0 0x0003FFFF -#define LEDC_DIV_NUM_LSTIMER0_M ((LEDC_DIV_NUM_LSTIMER0_V)<<(LEDC_DIV_NUM_LSTIMER0_S)) -#define LEDC_DIV_NUM_LSTIMER0_V 0x3FFFF -#define LEDC_DIV_NUM_LSTIMER0_S 5 -/* LEDC_LSTIMER0_LIM : R/W ;bitpos:[4:0] ;default: 5'h0 ; */ -/*description: This register controls the range of the counter in low speed - timer0. the counter range is [0 2**reg_lstimer0_lim] the max bit width for counter is 20.*/ -#define LEDC_LSTIMER0_LIM 0x0000001F -#define LEDC_LSTIMER0_LIM_M ((LEDC_LSTIMER0_LIM_V)<<(LEDC_LSTIMER0_LIM_S)) -#define LEDC_LSTIMER0_LIM_V 0x1F -#define LEDC_LSTIMER0_LIM_S 0 - -#define LEDC_LSTIMER0_VALUE_REG (DR_REG_LEDC_BASE + 0x0164) -/* LEDC_LSTIMER0_CNT : RO ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: software can read this register to get the current counter value - in low speed timer0.*/ -#define LEDC_LSTIMER0_CNT 0x000FFFFF -#define LEDC_LSTIMER0_CNT_M ((LEDC_LSTIMER0_CNT_V)<<(LEDC_LSTIMER0_CNT_S)) -#define LEDC_LSTIMER0_CNT_V 0xFFFFF -#define LEDC_LSTIMER0_CNT_S 0 - -#define LEDC_LSTIMER1_CONF_REG (DR_REG_LEDC_BASE + 0x0168) -/* LEDC_LSTIMER1_PARA_UP : R/W ;bitpos:[26] ;default: 1'h0 ; */ -/*description: Set this bit to update reg_div_num_lstime1 and reg_lstimer1_lim.*/ -#define LEDC_LSTIMER1_PARA_UP (BIT(26)) -#define LEDC_LSTIMER1_PARA_UP_M (BIT(26)) -#define LEDC_LSTIMER1_PARA_UP_V 0x1 -#define LEDC_LSTIMER1_PARA_UP_S 26 -/* LEDC_TICK_SEL_LSTIMER1 : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: This bit is used to choose slow_clk or ref_tick for low speed - timer1. 1'b1:slow_clk 0:ref_tick*/ -#define LEDC_TICK_SEL_LSTIMER1 (BIT(25)) -#define LEDC_TICK_SEL_LSTIMER1_M (BIT(25)) -#define LEDC_TICK_SEL_LSTIMER1_V 0x1 -#define LEDC_TICK_SEL_LSTIMER1_S 25 -/* LEDC_LSTIMER1_RST : R/W ;bitpos:[24] ;default: 1'b1 ; */ -/*description: This bit is used to reset low speed timer1 the counter will be 0 after reset.*/ -#define LEDC_LSTIMER1_RST (BIT(24)) -#define LEDC_LSTIMER1_RST_M (BIT(24)) -#define LEDC_LSTIMER1_RST_V 0x1 -#define LEDC_LSTIMER1_RST_S 24 -/* LEDC_LSTIMER1_PAUSE : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: This bit is used to pause the counter in low speed timer1.*/ -#define LEDC_LSTIMER1_PAUSE (BIT(23)) -#define LEDC_LSTIMER1_PAUSE_M (BIT(23)) -#define LEDC_LSTIMER1_PAUSE_V 0x1 -#define LEDC_LSTIMER1_PAUSE_S 23 -/* LEDC_DIV_NUM_LSTIMER1 : R/W ;bitpos:[22:5] ;default: 18'h0 ; */ -/*description: This register is used to configure parameter for divider in low - speed timer1 the least significant eight bits represent the decimal part.*/ -#define LEDC_DIV_NUM_LSTIMER1 0x0003FFFF -#define LEDC_DIV_NUM_LSTIMER1_M ((LEDC_DIV_NUM_LSTIMER1_V)<<(LEDC_DIV_NUM_LSTIMER1_S)) -#define LEDC_DIV_NUM_LSTIMER1_V 0x3FFFF -#define LEDC_DIV_NUM_LSTIMER1_S 5 -/* LEDC_LSTIMER1_LIM : R/W ;bitpos:[4:0] ;default: 5'h0 ; */ -/*description: This register controls the range of the counter in low speed - timer1. the counter range is [0 2**reg_lstimer1_lim] the max bit width for counter is 20.*/ -#define LEDC_LSTIMER1_LIM 0x0000001F -#define LEDC_LSTIMER1_LIM_M ((LEDC_LSTIMER1_LIM_V)<<(LEDC_LSTIMER1_LIM_S)) -#define LEDC_LSTIMER1_LIM_V 0x1F -#define LEDC_LSTIMER1_LIM_S 0 - -#define LEDC_LSTIMER1_VALUE_REG (DR_REG_LEDC_BASE + 0x016C) -/* LEDC_LSTIMER1_CNT : RO ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: software can read this register to get the current counter value - in low speed timer1.*/ -#define LEDC_LSTIMER1_CNT 0x000FFFFF -#define LEDC_LSTIMER1_CNT_M ((LEDC_LSTIMER1_CNT_V)<<(LEDC_LSTIMER1_CNT_S)) -#define LEDC_LSTIMER1_CNT_V 0xFFFFF -#define LEDC_LSTIMER1_CNT_S 0 - -#define LEDC_LSTIMER2_CONF_REG (DR_REG_LEDC_BASE + 0x0170) -/* LEDC_LSTIMER2_PARA_UP : R/W ;bitpos:[26] ;default: 1'h0 ; */ -/*description: Set this bit to update reg_div_num_lstime2 and reg_lstimer2_lim.*/ -#define LEDC_LSTIMER2_PARA_UP (BIT(26)) -#define LEDC_LSTIMER2_PARA_UP_M (BIT(26)) -#define LEDC_LSTIMER2_PARA_UP_V 0x1 -#define LEDC_LSTIMER2_PARA_UP_S 26 -/* LEDC_TICK_SEL_LSTIMER2 : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: This bit is used to choose slow_clk or ref_tick for low speed - timer2. 1'b1:slow_clk 0:ref_tick*/ -#define LEDC_TICK_SEL_LSTIMER2 (BIT(25)) -#define LEDC_TICK_SEL_LSTIMER2_M (BIT(25)) -#define LEDC_TICK_SEL_LSTIMER2_V 0x1 -#define LEDC_TICK_SEL_LSTIMER2_S 25 -/* LEDC_LSTIMER2_RST : R/W ;bitpos:[24] ;default: 1'b1 ; */ -/*description: This bit is used to reset low speed timer2 the counter will be 0 after reset.*/ -#define LEDC_LSTIMER2_RST (BIT(24)) -#define LEDC_LSTIMER2_RST_M (BIT(24)) -#define LEDC_LSTIMER2_RST_V 0x1 -#define LEDC_LSTIMER2_RST_S 24 -/* LEDC_LSTIMER2_PAUSE : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: This bit is used to pause the counter in low speed timer2.*/ -#define LEDC_LSTIMER2_PAUSE (BIT(23)) -#define LEDC_LSTIMER2_PAUSE_M (BIT(23)) -#define LEDC_LSTIMER2_PAUSE_V 0x1 -#define LEDC_LSTIMER2_PAUSE_S 23 -/* LEDC_DIV_NUM_LSTIMER2 : R/W ;bitpos:[22:5] ;default: 18'h0 ; */ -/*description: This register is used to configure parameter for divider in low - speed timer2 the least significant eight bits represent the decimal part.*/ -#define LEDC_DIV_NUM_LSTIMER2 0x0003FFFF -#define LEDC_DIV_NUM_LSTIMER2_M ((LEDC_DIV_NUM_LSTIMER2_V)<<(LEDC_DIV_NUM_LSTIMER2_S)) -#define LEDC_DIV_NUM_LSTIMER2_V 0x3FFFF -#define LEDC_DIV_NUM_LSTIMER2_S 5 -/* LEDC_LSTIMER2_LIM : R/W ;bitpos:[4:0] ;default: 5'h0 ; */ -/*description: This register controls the range of the counter in low speed - timer2. the counter range is [0 2**reg_lstimer2_lim] the max bit width for counter is 20.*/ -#define LEDC_LSTIMER2_LIM 0x0000001F -#define LEDC_LSTIMER2_LIM_M ((LEDC_LSTIMER2_LIM_V)<<(LEDC_LSTIMER2_LIM_S)) -#define LEDC_LSTIMER2_LIM_V 0x1F -#define LEDC_LSTIMER2_LIM_S 0 - -#define LEDC_LSTIMER2_VALUE_REG (DR_REG_LEDC_BASE + 0x0174) -/* LEDC_LSTIMER2_CNT : RO ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: software can read this register to get the current counter value - in low speed timer2.*/ -#define LEDC_LSTIMER2_CNT 0x000FFFFF -#define LEDC_LSTIMER2_CNT_M ((LEDC_LSTIMER2_CNT_V)<<(LEDC_LSTIMER2_CNT_S)) -#define LEDC_LSTIMER2_CNT_V 0xFFFFF -#define LEDC_LSTIMER2_CNT_S 0 - -#define LEDC_LSTIMER3_CONF_REG (DR_REG_LEDC_BASE + 0x0178) -/* LEDC_LSTIMER3_PARA_UP : R/W ;bitpos:[26] ;default: 1'h0 ; */ -/*description: Set this bit to update reg_div_num_lstime3 and reg_lstimer3_lim.*/ -#define LEDC_LSTIMER3_PARA_UP (BIT(26)) -#define LEDC_LSTIMER3_PARA_UP_M (BIT(26)) -#define LEDC_LSTIMER3_PARA_UP_V 0x1 -#define LEDC_LSTIMER3_PARA_UP_S 26 -/* LEDC_TICK_SEL_LSTIMER3 : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: This bit is used to choose slow_clk or ref_tick for low speed - timer3. 1'b1:slow_clk 0:ref_tick*/ -#define LEDC_TICK_SEL_LSTIMER3 (BIT(25)) -#define LEDC_TICK_SEL_LSTIMER3_M (BIT(25)) -#define LEDC_TICK_SEL_LSTIMER3_V 0x1 -#define LEDC_TICK_SEL_LSTIMER3_S 25 -/* LEDC_LSTIMER3_RST : R/W ;bitpos:[24] ;default: 1'b1 ; */ -/*description: This bit is used to reset low speed timer3 the counter will be 0 after reset.*/ -#define LEDC_LSTIMER3_RST (BIT(24)) -#define LEDC_LSTIMER3_RST_M (BIT(24)) -#define LEDC_LSTIMER3_RST_V 0x1 -#define LEDC_LSTIMER3_RST_S 24 -/* LEDC_LSTIMER3_PAUSE : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: This bit is used to pause the counter in low speed timer3.*/ -#define LEDC_LSTIMER3_PAUSE (BIT(23)) -#define LEDC_LSTIMER3_PAUSE_M (BIT(23)) -#define LEDC_LSTIMER3_PAUSE_V 0x1 -#define LEDC_LSTIMER3_PAUSE_S 23 -/* LEDC_DIV_NUM_LSTIMER3 : R/W ;bitpos:[22:5] ;default: 18'h0 ; */ -/*description: This register is used to configure parameter for divider in low - speed timer3 the least significant eight bits represent the decimal part.*/ -#define LEDC_DIV_NUM_LSTIMER3 0x0003FFFF -#define LEDC_DIV_NUM_LSTIMER3_M ((LEDC_DIV_NUM_LSTIMER3_V)<<(LEDC_DIV_NUM_LSTIMER3_S)) -#define LEDC_DIV_NUM_LSTIMER3_V 0x3FFFF -#define LEDC_DIV_NUM_LSTIMER3_S 5 -/* LEDC_LSTIMER3_LIM : R/W ;bitpos:[4:0] ;default: 5'h0 ; */ -/*description: This register controls the range of the counter in low speed - timer3. the counter range is [0 2**reg_lstimer3_lim] the max bit width for counter is 20.*/ -#define LEDC_LSTIMER3_LIM 0x0000001F -#define LEDC_LSTIMER3_LIM_M ((LEDC_LSTIMER3_LIM_V)<<(LEDC_LSTIMER3_LIM_S)) -#define LEDC_LSTIMER3_LIM_V 0x1F -#define LEDC_LSTIMER3_LIM_S 0 - -#define LEDC_LSTIMER3_VALUE_REG (DR_REG_LEDC_BASE + 0x017C) -/* LEDC_LSTIMER3_CNT : RO ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: software can read this register to get the current counter value - in low speed timer3.*/ -#define LEDC_LSTIMER3_CNT 0x000FFFFF -#define LEDC_LSTIMER3_CNT_M ((LEDC_LSTIMER3_CNT_V)<<(LEDC_LSTIMER3_CNT_S)) -#define LEDC_LSTIMER3_CNT_V 0xFFFFF -#define LEDC_LSTIMER3_CNT_S 0 - -#define LEDC_INT_RAW_REG (DR_REG_LEDC_BASE + 0x0180) -/* LEDC_DUTY_CHNG_END_LSCH7_INT_RAW : RO ;bitpos:[23] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for low speed channel 7 duty change done.*/ -#define LEDC_DUTY_CHNG_END_LSCH7_INT_RAW (BIT(23)) -#define LEDC_DUTY_CHNG_END_LSCH7_INT_RAW_M (BIT(23)) -#define LEDC_DUTY_CHNG_END_LSCH7_INT_RAW_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH7_INT_RAW_S 23 -/* LEDC_DUTY_CHNG_END_LSCH6_INT_RAW : RO ;bitpos:[22] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for low speed channel 6 duty change done.*/ -#define LEDC_DUTY_CHNG_END_LSCH6_INT_RAW (BIT(22)) -#define LEDC_DUTY_CHNG_END_LSCH6_INT_RAW_M (BIT(22)) -#define LEDC_DUTY_CHNG_END_LSCH6_INT_RAW_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH6_INT_RAW_S 22 -/* LEDC_DUTY_CHNG_END_LSCH5_INT_RAW : RO ;bitpos:[21] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for low speed channel 5 duty change done.*/ -#define LEDC_DUTY_CHNG_END_LSCH5_INT_RAW (BIT(21)) -#define LEDC_DUTY_CHNG_END_LSCH5_INT_RAW_M (BIT(21)) -#define LEDC_DUTY_CHNG_END_LSCH5_INT_RAW_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH5_INT_RAW_S 21 -/* LEDC_DUTY_CHNG_END_LSCH4_INT_RAW : RO ;bitpos:[20] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for low speed channel 4 duty change done.*/ -#define LEDC_DUTY_CHNG_END_LSCH4_INT_RAW (BIT(20)) -#define LEDC_DUTY_CHNG_END_LSCH4_INT_RAW_M (BIT(20)) -#define LEDC_DUTY_CHNG_END_LSCH4_INT_RAW_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH4_INT_RAW_S 20 -/* LEDC_DUTY_CHNG_END_LSCH3_INT_RAW : RO ;bitpos:[19] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for low speed channel 3 duty change done.*/ -#define LEDC_DUTY_CHNG_END_LSCH3_INT_RAW (BIT(19)) -#define LEDC_DUTY_CHNG_END_LSCH3_INT_RAW_M (BIT(19)) -#define LEDC_DUTY_CHNG_END_LSCH3_INT_RAW_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH3_INT_RAW_S 19 -/* LEDC_DUTY_CHNG_END_LSCH2_INT_RAW : RO ;bitpos:[18] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for low speed channel 2 duty change done.*/ -#define LEDC_DUTY_CHNG_END_LSCH2_INT_RAW (BIT(18)) -#define LEDC_DUTY_CHNG_END_LSCH2_INT_RAW_M (BIT(18)) -#define LEDC_DUTY_CHNG_END_LSCH2_INT_RAW_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH2_INT_RAW_S 18 -/* LEDC_DUTY_CHNG_END_LSCH1_INT_RAW : RO ;bitpos:[17] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for low speed channel 1 duty change done.*/ -#define LEDC_DUTY_CHNG_END_LSCH1_INT_RAW (BIT(17)) -#define LEDC_DUTY_CHNG_END_LSCH1_INT_RAW_M (BIT(17)) -#define LEDC_DUTY_CHNG_END_LSCH1_INT_RAW_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH1_INT_RAW_S 17 -/* LEDC_DUTY_CHNG_END_LSCH0_INT_RAW : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for low speed channel 0 duty change done.*/ -#define LEDC_DUTY_CHNG_END_LSCH0_INT_RAW (BIT(16)) -#define LEDC_DUTY_CHNG_END_LSCH0_INT_RAW_M (BIT(16)) -#define LEDC_DUTY_CHNG_END_LSCH0_INT_RAW_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH0_INT_RAW_S 16 -/* LEDC_DUTY_CHNG_END_HSCH7_INT_RAW : RO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for high speed channel 7 duty change done.*/ -#define LEDC_DUTY_CHNG_END_HSCH7_INT_RAW (BIT(15)) -#define LEDC_DUTY_CHNG_END_HSCH7_INT_RAW_M (BIT(15)) -#define LEDC_DUTY_CHNG_END_HSCH7_INT_RAW_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH7_INT_RAW_S 15 -/* LEDC_DUTY_CHNG_END_HSCH6_INT_RAW : RO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for high speed channel 6 duty change done.*/ -#define LEDC_DUTY_CHNG_END_HSCH6_INT_RAW (BIT(14)) -#define LEDC_DUTY_CHNG_END_HSCH6_INT_RAW_M (BIT(14)) -#define LEDC_DUTY_CHNG_END_HSCH6_INT_RAW_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH6_INT_RAW_S 14 -/* LEDC_DUTY_CHNG_END_HSCH5_INT_RAW : RO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for high speed channel 5 duty change done.*/ -#define LEDC_DUTY_CHNG_END_HSCH5_INT_RAW (BIT(13)) -#define LEDC_DUTY_CHNG_END_HSCH5_INT_RAW_M (BIT(13)) -#define LEDC_DUTY_CHNG_END_HSCH5_INT_RAW_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH5_INT_RAW_S 13 -/* LEDC_DUTY_CHNG_END_HSCH4_INT_RAW : RO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for high speed channel 4 duty change done.*/ -#define LEDC_DUTY_CHNG_END_HSCH4_INT_RAW (BIT(12)) -#define LEDC_DUTY_CHNG_END_HSCH4_INT_RAW_M (BIT(12)) -#define LEDC_DUTY_CHNG_END_HSCH4_INT_RAW_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH4_INT_RAW_S 12 -/* LEDC_DUTY_CHNG_END_HSCH3_INT_RAW : RO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for high speed channel 3 duty change done.*/ -#define LEDC_DUTY_CHNG_END_HSCH3_INT_RAW (BIT(11)) -#define LEDC_DUTY_CHNG_END_HSCH3_INT_RAW_M (BIT(11)) -#define LEDC_DUTY_CHNG_END_HSCH3_INT_RAW_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH3_INT_RAW_S 11 -/* LEDC_DUTY_CHNG_END_HSCH2_INT_RAW : RO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for high speed channel 2 duty change done.*/ -#define LEDC_DUTY_CHNG_END_HSCH2_INT_RAW (BIT(10)) -#define LEDC_DUTY_CHNG_END_HSCH2_INT_RAW_M (BIT(10)) -#define LEDC_DUTY_CHNG_END_HSCH2_INT_RAW_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH2_INT_RAW_S 10 -/* LEDC_DUTY_CHNG_END_HSCH1_INT_RAW : RO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for high speed channel 1 duty change done.*/ -#define LEDC_DUTY_CHNG_END_HSCH1_INT_RAW (BIT(9)) -#define LEDC_DUTY_CHNG_END_HSCH1_INT_RAW_M (BIT(9)) -#define LEDC_DUTY_CHNG_END_HSCH1_INT_RAW_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH1_INT_RAW_S 9 -/* LEDC_DUTY_CHNG_END_HSCH0_INT_RAW : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for high speed channel 0 duty change done.*/ -#define LEDC_DUTY_CHNG_END_HSCH0_INT_RAW (BIT(8)) -#define LEDC_DUTY_CHNG_END_HSCH0_INT_RAW_M (BIT(8)) -#define LEDC_DUTY_CHNG_END_HSCH0_INT_RAW_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH0_INT_RAW_S 8 -/* LEDC_LSTIMER3_OVF_INT_RAW : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for low speed channel3 counter overflow.*/ -#define LEDC_LSTIMER3_OVF_INT_RAW (BIT(7)) -#define LEDC_LSTIMER3_OVF_INT_RAW_M (BIT(7)) -#define LEDC_LSTIMER3_OVF_INT_RAW_V 0x1 -#define LEDC_LSTIMER3_OVF_INT_RAW_S 7 -/* LEDC_LSTIMER2_OVF_INT_RAW : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for low speed channel2 counter overflow.*/ -#define LEDC_LSTIMER2_OVF_INT_RAW (BIT(6)) -#define LEDC_LSTIMER2_OVF_INT_RAW_M (BIT(6)) -#define LEDC_LSTIMER2_OVF_INT_RAW_V 0x1 -#define LEDC_LSTIMER2_OVF_INT_RAW_S 6 -/* LEDC_LSTIMER1_OVF_INT_RAW : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for low speed channel1 counter overflow.*/ -#define LEDC_LSTIMER1_OVF_INT_RAW (BIT(5)) -#define LEDC_LSTIMER1_OVF_INT_RAW_M (BIT(5)) -#define LEDC_LSTIMER1_OVF_INT_RAW_V 0x1 -#define LEDC_LSTIMER1_OVF_INT_RAW_S 5 -/* LEDC_LSTIMER0_OVF_INT_RAW : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for low speed channel0 counter overflow.*/ -#define LEDC_LSTIMER0_OVF_INT_RAW (BIT(4)) -#define LEDC_LSTIMER0_OVF_INT_RAW_M (BIT(4)) -#define LEDC_LSTIMER0_OVF_INT_RAW_V 0x1 -#define LEDC_LSTIMER0_OVF_INT_RAW_S 4 -/* LEDC_HSTIMER3_OVF_INT_RAW : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for high speed channel3 counter overflow.*/ -#define LEDC_HSTIMER3_OVF_INT_RAW (BIT(3)) -#define LEDC_HSTIMER3_OVF_INT_RAW_M (BIT(3)) -#define LEDC_HSTIMER3_OVF_INT_RAW_V 0x1 -#define LEDC_HSTIMER3_OVF_INT_RAW_S 3 -/* LEDC_HSTIMER2_OVF_INT_RAW : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for high speed channel2 counter overflow.*/ -#define LEDC_HSTIMER2_OVF_INT_RAW (BIT(2)) -#define LEDC_HSTIMER2_OVF_INT_RAW_M (BIT(2)) -#define LEDC_HSTIMER2_OVF_INT_RAW_V 0x1 -#define LEDC_HSTIMER2_OVF_INT_RAW_S 2 -/* LEDC_HSTIMER1_OVF_INT_RAW : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for high speed channel1 counter overflow.*/ -#define LEDC_HSTIMER1_OVF_INT_RAW (BIT(1)) -#define LEDC_HSTIMER1_OVF_INT_RAW_M (BIT(1)) -#define LEDC_HSTIMER1_OVF_INT_RAW_V 0x1 -#define LEDC_HSTIMER1_OVF_INT_RAW_S 1 -/* LEDC_HSTIMER0_OVF_INT_RAW : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for high speed channel0 counter overflow.*/ -#define LEDC_HSTIMER0_OVF_INT_RAW (BIT(0)) -#define LEDC_HSTIMER0_OVF_INT_RAW_M (BIT(0)) -#define LEDC_HSTIMER0_OVF_INT_RAW_V 0x1 -#define LEDC_HSTIMER0_OVF_INT_RAW_S 0 - -#define LEDC_INT_ST_REG (DR_REG_LEDC_BASE + 0x0184) -/* LEDC_DUTY_CHNG_END_LSCH7_INT_ST : RO ;bitpos:[23] ;default: 1'h0 ; */ -/*description: The interrupt status bit for low speed channel 7 duty change done event*/ -#define LEDC_DUTY_CHNG_END_LSCH7_INT_ST (BIT(23)) -#define LEDC_DUTY_CHNG_END_LSCH7_INT_ST_M (BIT(23)) -#define LEDC_DUTY_CHNG_END_LSCH7_INT_ST_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH7_INT_ST_S 23 -/* LEDC_DUTY_CHNG_END_LSCH6_INT_ST : RO ;bitpos:[22] ;default: 1'b0 ; */ -/*description: The interrupt status bit for low speed channel 6 duty change done event.*/ -#define LEDC_DUTY_CHNG_END_LSCH6_INT_ST (BIT(22)) -#define LEDC_DUTY_CHNG_END_LSCH6_INT_ST_M (BIT(22)) -#define LEDC_DUTY_CHNG_END_LSCH6_INT_ST_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH6_INT_ST_S 22 -/* LEDC_DUTY_CHNG_END_LSCH5_INT_ST : RO ;bitpos:[21] ;default: 1'b0 ; */ -/*description: The interrupt status bit for low speed channel 5 duty change done event.*/ -#define LEDC_DUTY_CHNG_END_LSCH5_INT_ST (BIT(21)) -#define LEDC_DUTY_CHNG_END_LSCH5_INT_ST_M (BIT(21)) -#define LEDC_DUTY_CHNG_END_LSCH5_INT_ST_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH5_INT_ST_S 21 -/* LEDC_DUTY_CHNG_END_LSCH4_INT_ST : RO ;bitpos:[20] ;default: 1'b0 ; */ -/*description: The interrupt status bit for low speed channel 4 duty change done event.*/ -#define LEDC_DUTY_CHNG_END_LSCH4_INT_ST (BIT(20)) -#define LEDC_DUTY_CHNG_END_LSCH4_INT_ST_M (BIT(20)) -#define LEDC_DUTY_CHNG_END_LSCH4_INT_ST_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH4_INT_ST_S 20 -/* LEDC_DUTY_CHNG_END_LSCH3_INT_ST : RO ;bitpos:[19] ;default: 1'b0 ; */ -/*description: The interrupt status bit for low speed channel 3 duty change done event.*/ -#define LEDC_DUTY_CHNG_END_LSCH3_INT_ST (BIT(19)) -#define LEDC_DUTY_CHNG_END_LSCH3_INT_ST_M (BIT(19)) -#define LEDC_DUTY_CHNG_END_LSCH3_INT_ST_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH3_INT_ST_S 19 -/* LEDC_DUTY_CHNG_END_LSCH2_INT_ST : RO ;bitpos:[18] ;default: 1'b0 ; */ -/*description: The interrupt status bit for low speed channel 2 duty change done event.*/ -#define LEDC_DUTY_CHNG_END_LSCH2_INT_ST (BIT(18)) -#define LEDC_DUTY_CHNG_END_LSCH2_INT_ST_M (BIT(18)) -#define LEDC_DUTY_CHNG_END_LSCH2_INT_ST_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH2_INT_ST_S 18 -/* LEDC_DUTY_CHNG_END_LSCH1_INT_ST : RO ;bitpos:[17] ;default: 1'b0 ; */ -/*description: The interrupt status bit for low speed channel 1 duty change done event.*/ -#define LEDC_DUTY_CHNG_END_LSCH1_INT_ST (BIT(17)) -#define LEDC_DUTY_CHNG_END_LSCH1_INT_ST_M (BIT(17)) -#define LEDC_DUTY_CHNG_END_LSCH1_INT_ST_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH1_INT_ST_S 17 -/* LEDC_DUTY_CHNG_END_LSCH0_INT_ST : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: The interrupt status bit for low speed channel 0 duty change done event.*/ -#define LEDC_DUTY_CHNG_END_LSCH0_INT_ST (BIT(16)) -#define LEDC_DUTY_CHNG_END_LSCH0_INT_ST_M (BIT(16)) -#define LEDC_DUTY_CHNG_END_LSCH0_INT_ST_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH0_INT_ST_S 16 -/* LEDC_DUTY_CHNG_END_HSCH7_INT_ST : RO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: The interrupt status bit for high speed channel 7 duty change done event.*/ -#define LEDC_DUTY_CHNG_END_HSCH7_INT_ST (BIT(15)) -#define LEDC_DUTY_CHNG_END_HSCH7_INT_ST_M (BIT(15)) -#define LEDC_DUTY_CHNG_END_HSCH7_INT_ST_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH7_INT_ST_S 15 -/* LEDC_DUTY_CHNG_END_HSCH6_INT_ST : RO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: The interrupt status bit for high speed channel 6 duty change done event.*/ -#define LEDC_DUTY_CHNG_END_HSCH6_INT_ST (BIT(14)) -#define LEDC_DUTY_CHNG_END_HSCH6_INT_ST_M (BIT(14)) -#define LEDC_DUTY_CHNG_END_HSCH6_INT_ST_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH6_INT_ST_S 14 -/* LEDC_DUTY_CHNG_END_HSCH5_INT_ST : RO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: The interrupt status bit for high speed channel 5 duty change done event.*/ -#define LEDC_DUTY_CHNG_END_HSCH5_INT_ST (BIT(13)) -#define LEDC_DUTY_CHNG_END_HSCH5_INT_ST_M (BIT(13)) -#define LEDC_DUTY_CHNG_END_HSCH5_INT_ST_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH5_INT_ST_S 13 -/* LEDC_DUTY_CHNG_END_HSCH4_INT_ST : RO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: The interrupt status bit for high speed channel 4 duty change done event.*/ -#define LEDC_DUTY_CHNG_END_HSCH4_INT_ST (BIT(12)) -#define LEDC_DUTY_CHNG_END_HSCH4_INT_ST_M (BIT(12)) -#define LEDC_DUTY_CHNG_END_HSCH4_INT_ST_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH4_INT_ST_S 12 -/* LEDC_DUTY_CHNG_END_HSCH3_INT_ST : RO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: The interrupt status bit for high speed channel 3 duty change done event.*/ -#define LEDC_DUTY_CHNG_END_HSCH3_INT_ST (BIT(11)) -#define LEDC_DUTY_CHNG_END_HSCH3_INT_ST_M (BIT(11)) -#define LEDC_DUTY_CHNG_END_HSCH3_INT_ST_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH3_INT_ST_S 11 -/* LEDC_DUTY_CHNG_END_HSCH2_INT_ST : RO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: The interrupt status bit for high speed channel 2 duty change done event.*/ -#define LEDC_DUTY_CHNG_END_HSCH2_INT_ST (BIT(10)) -#define LEDC_DUTY_CHNG_END_HSCH2_INT_ST_M (BIT(10)) -#define LEDC_DUTY_CHNG_END_HSCH2_INT_ST_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH2_INT_ST_S 10 -/* LEDC_DUTY_CHNG_END_HSCH1_INT_ST : RO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: The interrupt status bit for high speed channel 1 duty change done event.*/ -#define LEDC_DUTY_CHNG_END_HSCH1_INT_ST (BIT(9)) -#define LEDC_DUTY_CHNG_END_HSCH1_INT_ST_M (BIT(9)) -#define LEDC_DUTY_CHNG_END_HSCH1_INT_ST_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH1_INT_ST_S 9 -/* LEDC_DUTY_CHNG_END_HSCH0_INT_ST : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: The interrupt status bit for high speed channel 0 duty change done event.*/ -#define LEDC_DUTY_CHNG_END_HSCH0_INT_ST (BIT(8)) -#define LEDC_DUTY_CHNG_END_HSCH0_INT_ST_M (BIT(8)) -#define LEDC_DUTY_CHNG_END_HSCH0_INT_ST_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH0_INT_ST_S 8 -/* LEDC_LSTIMER3_OVF_INT_ST : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: The interrupt status bit for low speed channel3 counter overflow event.*/ -#define LEDC_LSTIMER3_OVF_INT_ST (BIT(7)) -#define LEDC_LSTIMER3_OVF_INT_ST_M (BIT(7)) -#define LEDC_LSTIMER3_OVF_INT_ST_V 0x1 -#define LEDC_LSTIMER3_OVF_INT_ST_S 7 -/* LEDC_LSTIMER2_OVF_INT_ST : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: The interrupt status bit for low speed channel2 counter overflow event.*/ -#define LEDC_LSTIMER2_OVF_INT_ST (BIT(6)) -#define LEDC_LSTIMER2_OVF_INT_ST_M (BIT(6)) -#define LEDC_LSTIMER2_OVF_INT_ST_V 0x1 -#define LEDC_LSTIMER2_OVF_INT_ST_S 6 -/* LEDC_LSTIMER1_OVF_INT_ST : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: The interrupt status bit for low speed channel1 counter overflow event.*/ -#define LEDC_LSTIMER1_OVF_INT_ST (BIT(5)) -#define LEDC_LSTIMER1_OVF_INT_ST_M (BIT(5)) -#define LEDC_LSTIMER1_OVF_INT_ST_V 0x1 -#define LEDC_LSTIMER1_OVF_INT_ST_S 5 -/* LEDC_LSTIMER0_OVF_INT_ST : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: The interrupt status bit for low speed channel0 counter overflow event.*/ -#define LEDC_LSTIMER0_OVF_INT_ST (BIT(4)) -#define LEDC_LSTIMER0_OVF_INT_ST_M (BIT(4)) -#define LEDC_LSTIMER0_OVF_INT_ST_V 0x1 -#define LEDC_LSTIMER0_OVF_INT_ST_S 4 -/* LEDC_HSTIMER3_OVF_INT_ST : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: The interrupt status bit for high speed channel3 counter overflow event.*/ -#define LEDC_HSTIMER3_OVF_INT_ST (BIT(3)) -#define LEDC_HSTIMER3_OVF_INT_ST_M (BIT(3)) -#define LEDC_HSTIMER3_OVF_INT_ST_V 0x1 -#define LEDC_HSTIMER3_OVF_INT_ST_S 3 -/* LEDC_HSTIMER2_OVF_INT_ST : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: The interrupt status bit for high speed channel2 counter overflow event.*/ -#define LEDC_HSTIMER2_OVF_INT_ST (BIT(2)) -#define LEDC_HSTIMER2_OVF_INT_ST_M (BIT(2)) -#define LEDC_HSTIMER2_OVF_INT_ST_V 0x1 -#define LEDC_HSTIMER2_OVF_INT_ST_S 2 -/* LEDC_HSTIMER1_OVF_INT_ST : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: The interrupt status bit for high speed channel1 counter overflow event.*/ -#define LEDC_HSTIMER1_OVF_INT_ST (BIT(1)) -#define LEDC_HSTIMER1_OVF_INT_ST_M (BIT(1)) -#define LEDC_HSTIMER1_OVF_INT_ST_V 0x1 -#define LEDC_HSTIMER1_OVF_INT_ST_S 1 -/* LEDC_HSTIMER0_OVF_INT_ST : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: The interrupt status bit for high speed channel0 counter overflow event.*/ -#define LEDC_HSTIMER0_OVF_INT_ST (BIT(0)) -#define LEDC_HSTIMER0_OVF_INT_ST_M (BIT(0)) -#define LEDC_HSTIMER0_OVF_INT_ST_V 0x1 -#define LEDC_HSTIMER0_OVF_INT_ST_S 0 - -#define LEDC_INT_ENA_REG (DR_REG_LEDC_BASE + 0x0188) -/* LEDC_DUTY_CHNG_END_LSCH7_INT_ENA : R/W ;bitpos:[23] ;default: 1'h0 ; */ -/*description: The interrupt enable bit for low speed channel 7 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_LSCH7_INT_ENA (BIT(23)) -#define LEDC_DUTY_CHNG_END_LSCH7_INT_ENA_M (BIT(23)) -#define LEDC_DUTY_CHNG_END_LSCH7_INT_ENA_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH7_INT_ENA_S 23 -/* LEDC_DUTY_CHNG_END_LSCH6_INT_ENA : R/W ;bitpos:[22] ;default: 1'b0 ; */ -/*description: The interrupt enable bit for low speed channel 6 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_LSCH6_INT_ENA (BIT(22)) -#define LEDC_DUTY_CHNG_END_LSCH6_INT_ENA_M (BIT(22)) -#define LEDC_DUTY_CHNG_END_LSCH6_INT_ENA_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH6_INT_ENA_S 22 -/* LEDC_DUTY_CHNG_END_LSCH5_INT_ENA : R/W ;bitpos:[21] ;default: 1'b0 ; */ -/*description: The interrupt enable bit for low speed channel 5 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_LSCH5_INT_ENA (BIT(21)) -#define LEDC_DUTY_CHNG_END_LSCH5_INT_ENA_M (BIT(21)) -#define LEDC_DUTY_CHNG_END_LSCH5_INT_ENA_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH5_INT_ENA_S 21 -/* LEDC_DUTY_CHNG_END_LSCH4_INT_ENA : R/W ;bitpos:[20] ;default: 1'b0 ; */ -/*description: The interrupt enable bit for low speed channel 4 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_LSCH4_INT_ENA (BIT(20)) -#define LEDC_DUTY_CHNG_END_LSCH4_INT_ENA_M (BIT(20)) -#define LEDC_DUTY_CHNG_END_LSCH4_INT_ENA_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH4_INT_ENA_S 20 -/* LEDC_DUTY_CHNG_END_LSCH3_INT_ENA : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: The interrupt enable bit for low speed channel 3 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_LSCH3_INT_ENA (BIT(19)) -#define LEDC_DUTY_CHNG_END_LSCH3_INT_ENA_M (BIT(19)) -#define LEDC_DUTY_CHNG_END_LSCH3_INT_ENA_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH3_INT_ENA_S 19 -/* LEDC_DUTY_CHNG_END_LSCH2_INT_ENA : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: The interrupt enable bit for low speed channel 2 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_LSCH2_INT_ENA (BIT(18)) -#define LEDC_DUTY_CHNG_END_LSCH2_INT_ENA_M (BIT(18)) -#define LEDC_DUTY_CHNG_END_LSCH2_INT_ENA_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH2_INT_ENA_S 18 -/* LEDC_DUTY_CHNG_END_LSCH1_INT_ENA : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: The interrupt enable bit for low speed channel 1 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_LSCH1_INT_ENA (BIT(17)) -#define LEDC_DUTY_CHNG_END_LSCH1_INT_ENA_M (BIT(17)) -#define LEDC_DUTY_CHNG_END_LSCH1_INT_ENA_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH1_INT_ENA_S 17 -/* LEDC_DUTY_CHNG_END_LSCH0_INT_ENA : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: The interrupt enable bit for low speed channel 0 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_LSCH0_INT_ENA (BIT(16)) -#define LEDC_DUTY_CHNG_END_LSCH0_INT_ENA_M (BIT(16)) -#define LEDC_DUTY_CHNG_END_LSCH0_INT_ENA_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH0_INT_ENA_S 16 -/* LEDC_DUTY_CHNG_END_HSCH7_INT_ENA : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: The interrupt enable bit for high speed channel 7 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_HSCH7_INT_ENA (BIT(15)) -#define LEDC_DUTY_CHNG_END_HSCH7_INT_ENA_M (BIT(15)) -#define LEDC_DUTY_CHNG_END_HSCH7_INT_ENA_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH7_INT_ENA_S 15 -/* LEDC_DUTY_CHNG_END_HSCH6_INT_ENA : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: The interrupt enable bit for high speed channel 6 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_HSCH6_INT_ENA (BIT(14)) -#define LEDC_DUTY_CHNG_END_HSCH6_INT_ENA_M (BIT(14)) -#define LEDC_DUTY_CHNG_END_HSCH6_INT_ENA_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH6_INT_ENA_S 14 -/* LEDC_DUTY_CHNG_END_HSCH5_INT_ENA : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: The interrupt enable bit for high speed channel 5 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_HSCH5_INT_ENA (BIT(13)) -#define LEDC_DUTY_CHNG_END_HSCH5_INT_ENA_M (BIT(13)) -#define LEDC_DUTY_CHNG_END_HSCH5_INT_ENA_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH5_INT_ENA_S 13 -/* LEDC_DUTY_CHNG_END_HSCH4_INT_ENA : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: The interrupt enable bit for high speed channel 4 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_HSCH4_INT_ENA (BIT(12)) -#define LEDC_DUTY_CHNG_END_HSCH4_INT_ENA_M (BIT(12)) -#define LEDC_DUTY_CHNG_END_HSCH4_INT_ENA_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH4_INT_ENA_S 12 -/* LEDC_DUTY_CHNG_END_HSCH3_INT_ENA : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: The interrupt enable bit for high speed channel 3 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_HSCH3_INT_ENA (BIT(11)) -#define LEDC_DUTY_CHNG_END_HSCH3_INT_ENA_M (BIT(11)) -#define LEDC_DUTY_CHNG_END_HSCH3_INT_ENA_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH3_INT_ENA_S 11 -/* LEDC_DUTY_CHNG_END_HSCH2_INT_ENA : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: The interrupt enable bit for high speed channel 2 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_HSCH2_INT_ENA (BIT(10)) -#define LEDC_DUTY_CHNG_END_HSCH2_INT_ENA_M (BIT(10)) -#define LEDC_DUTY_CHNG_END_HSCH2_INT_ENA_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH2_INT_ENA_S 10 -/* LEDC_DUTY_CHNG_END_HSCH1_INT_ENA : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: The interrupt enable bit for high speed channel 1 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_HSCH1_INT_ENA (BIT(9)) -#define LEDC_DUTY_CHNG_END_HSCH1_INT_ENA_M (BIT(9)) -#define LEDC_DUTY_CHNG_END_HSCH1_INT_ENA_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH1_INT_ENA_S 9 -/* LEDC_DUTY_CHNG_END_HSCH0_INT_ENA : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: The interrupt enable bit for high speed channel 0 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_HSCH0_INT_ENA (BIT(8)) -#define LEDC_DUTY_CHNG_END_HSCH0_INT_ENA_M (BIT(8)) -#define LEDC_DUTY_CHNG_END_HSCH0_INT_ENA_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH0_INT_ENA_S 8 -/* LEDC_LSTIMER3_OVF_INT_ENA : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: The interrupt enable bit for low speed channel3 counter overflow interrupt.*/ -#define LEDC_LSTIMER3_OVF_INT_ENA (BIT(7)) -#define LEDC_LSTIMER3_OVF_INT_ENA_M (BIT(7)) -#define LEDC_LSTIMER3_OVF_INT_ENA_V 0x1 -#define LEDC_LSTIMER3_OVF_INT_ENA_S 7 -/* LEDC_LSTIMER2_OVF_INT_ENA : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: The interrupt enable bit for low speed channel2 counter overflow interrupt.*/ -#define LEDC_LSTIMER2_OVF_INT_ENA (BIT(6)) -#define LEDC_LSTIMER2_OVF_INT_ENA_M (BIT(6)) -#define LEDC_LSTIMER2_OVF_INT_ENA_V 0x1 -#define LEDC_LSTIMER2_OVF_INT_ENA_S 6 -/* LEDC_LSTIMER1_OVF_INT_ENA : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: The interrupt enable bit for low speed channel1 counter overflow interrupt.*/ -#define LEDC_LSTIMER1_OVF_INT_ENA (BIT(5)) -#define LEDC_LSTIMER1_OVF_INT_ENA_M (BIT(5)) -#define LEDC_LSTIMER1_OVF_INT_ENA_V 0x1 -#define LEDC_LSTIMER1_OVF_INT_ENA_S 5 -/* LEDC_LSTIMER0_OVF_INT_ENA : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: The interrupt enable bit for low speed channel0 counter overflow interrupt.*/ -#define LEDC_LSTIMER0_OVF_INT_ENA (BIT(4)) -#define LEDC_LSTIMER0_OVF_INT_ENA_M (BIT(4)) -#define LEDC_LSTIMER0_OVF_INT_ENA_V 0x1 -#define LEDC_LSTIMER0_OVF_INT_ENA_S 4 -/* LEDC_HSTIMER3_OVF_INT_ENA : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: The interrupt enable bit for high speed channel3 counter overflow interrupt.*/ -#define LEDC_HSTIMER3_OVF_INT_ENA (BIT(3)) -#define LEDC_HSTIMER3_OVF_INT_ENA_M (BIT(3)) -#define LEDC_HSTIMER3_OVF_INT_ENA_V 0x1 -#define LEDC_HSTIMER3_OVF_INT_ENA_S 3 -/* LEDC_HSTIMER2_OVF_INT_ENA : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: The interrupt enable bit for high speed channel2 counter overflow interrupt.*/ -#define LEDC_HSTIMER2_OVF_INT_ENA (BIT(2)) -#define LEDC_HSTIMER2_OVF_INT_ENA_M (BIT(2)) -#define LEDC_HSTIMER2_OVF_INT_ENA_V 0x1 -#define LEDC_HSTIMER2_OVF_INT_ENA_S 2 -/* LEDC_HSTIMER1_OVF_INT_ENA : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: The interrupt enable bit for high speed channel1 counter overflow interrupt.*/ -#define LEDC_HSTIMER1_OVF_INT_ENA (BIT(1)) -#define LEDC_HSTIMER1_OVF_INT_ENA_M (BIT(1)) -#define LEDC_HSTIMER1_OVF_INT_ENA_V 0x1 -#define LEDC_HSTIMER1_OVF_INT_ENA_S 1 -/* LEDC_HSTIMER0_OVF_INT_ENA : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: The interrupt enable bit for high speed channel0 counter overflow interrupt.*/ -#define LEDC_HSTIMER0_OVF_INT_ENA (BIT(0)) -#define LEDC_HSTIMER0_OVF_INT_ENA_M (BIT(0)) -#define LEDC_HSTIMER0_OVF_INT_ENA_V 0x1 -#define LEDC_HSTIMER0_OVF_INT_ENA_S 0 - -#define LEDC_INT_CLR_REG (DR_REG_LEDC_BASE + 0x018C) -/* LEDC_DUTY_CHNG_END_LSCH7_INT_CLR : WO ;bitpos:[23] ;default: 1'h0 ; */ -/*description: Set this bit to clear low speed channel 7 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_LSCH7_INT_CLR (BIT(23)) -#define LEDC_DUTY_CHNG_END_LSCH7_INT_CLR_M (BIT(23)) -#define LEDC_DUTY_CHNG_END_LSCH7_INT_CLR_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH7_INT_CLR_S 23 -/* LEDC_DUTY_CHNG_END_LSCH6_INT_CLR : WO ;bitpos:[22] ;default: 1'b0 ; */ -/*description: Set this bit to clear low speed channel 6 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_LSCH6_INT_CLR (BIT(22)) -#define LEDC_DUTY_CHNG_END_LSCH6_INT_CLR_M (BIT(22)) -#define LEDC_DUTY_CHNG_END_LSCH6_INT_CLR_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH6_INT_CLR_S 22 -/* LEDC_DUTY_CHNG_END_LSCH5_INT_CLR : WO ;bitpos:[21] ;default: 1'b0 ; */ -/*description: Set this bit to clear low speed channel 5 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_LSCH5_INT_CLR (BIT(21)) -#define LEDC_DUTY_CHNG_END_LSCH5_INT_CLR_M (BIT(21)) -#define LEDC_DUTY_CHNG_END_LSCH5_INT_CLR_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH5_INT_CLR_S 21 -/* LEDC_DUTY_CHNG_END_LSCH4_INT_CLR : WO ;bitpos:[20] ;default: 1'b0 ; */ -/*description: Set this bit to clear low speed channel 4 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_LSCH4_INT_CLR (BIT(20)) -#define LEDC_DUTY_CHNG_END_LSCH4_INT_CLR_M (BIT(20)) -#define LEDC_DUTY_CHNG_END_LSCH4_INT_CLR_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH4_INT_CLR_S 20 -/* LEDC_DUTY_CHNG_END_LSCH3_INT_CLR : WO ;bitpos:[19] ;default: 1'b0 ; */ -/*description: Set this bit to clear low speed channel 3 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_LSCH3_INT_CLR (BIT(19)) -#define LEDC_DUTY_CHNG_END_LSCH3_INT_CLR_M (BIT(19)) -#define LEDC_DUTY_CHNG_END_LSCH3_INT_CLR_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH3_INT_CLR_S 19 -/* LEDC_DUTY_CHNG_END_LSCH2_INT_CLR : WO ;bitpos:[18] ;default: 1'b0 ; */ -/*description: Set this bit to clear low speed channel 2 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_LSCH2_INT_CLR (BIT(18)) -#define LEDC_DUTY_CHNG_END_LSCH2_INT_CLR_M (BIT(18)) -#define LEDC_DUTY_CHNG_END_LSCH2_INT_CLR_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH2_INT_CLR_S 18 -/* LEDC_DUTY_CHNG_END_LSCH1_INT_CLR : WO ;bitpos:[17] ;default: 1'b0 ; */ -/*description: Set this bit to clear low speed channel 1 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_LSCH1_INT_CLR (BIT(17)) -#define LEDC_DUTY_CHNG_END_LSCH1_INT_CLR_M (BIT(17)) -#define LEDC_DUTY_CHNG_END_LSCH1_INT_CLR_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH1_INT_CLR_S 17 -/* LEDC_DUTY_CHNG_END_LSCH0_INT_CLR : WO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: Set this bit to clear low speed channel 0 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_LSCH0_INT_CLR (BIT(16)) -#define LEDC_DUTY_CHNG_END_LSCH0_INT_CLR_M (BIT(16)) -#define LEDC_DUTY_CHNG_END_LSCH0_INT_CLR_V 0x1 -#define LEDC_DUTY_CHNG_END_LSCH0_INT_CLR_S 16 -/* LEDC_DUTY_CHNG_END_HSCH7_INT_CLR : WO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: Set this bit to clear high speed channel 7 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_HSCH7_INT_CLR (BIT(15)) -#define LEDC_DUTY_CHNG_END_HSCH7_INT_CLR_M (BIT(15)) -#define LEDC_DUTY_CHNG_END_HSCH7_INT_CLR_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH7_INT_CLR_S 15 -/* LEDC_DUTY_CHNG_END_HSCH6_INT_CLR : WO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: Set this bit to clear high speed channel 6 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_HSCH6_INT_CLR (BIT(14)) -#define LEDC_DUTY_CHNG_END_HSCH6_INT_CLR_M (BIT(14)) -#define LEDC_DUTY_CHNG_END_HSCH6_INT_CLR_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH6_INT_CLR_S 14 -/* LEDC_DUTY_CHNG_END_HSCH5_INT_CLR : WO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: Set this bit to clear high speed channel 5 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_HSCH5_INT_CLR (BIT(13)) -#define LEDC_DUTY_CHNG_END_HSCH5_INT_CLR_M (BIT(13)) -#define LEDC_DUTY_CHNG_END_HSCH5_INT_CLR_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH5_INT_CLR_S 13 -/* LEDC_DUTY_CHNG_END_HSCH4_INT_CLR : WO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: Set this bit to clear high speed channel 4 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_HSCH4_INT_CLR (BIT(12)) -#define LEDC_DUTY_CHNG_END_HSCH4_INT_CLR_M (BIT(12)) -#define LEDC_DUTY_CHNG_END_HSCH4_INT_CLR_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH4_INT_CLR_S 12 -/* LEDC_DUTY_CHNG_END_HSCH3_INT_CLR : WO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: Set this bit to clear high speed channel 3 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_HSCH3_INT_CLR (BIT(11)) -#define LEDC_DUTY_CHNG_END_HSCH3_INT_CLR_M (BIT(11)) -#define LEDC_DUTY_CHNG_END_HSCH3_INT_CLR_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH3_INT_CLR_S 11 -/* LEDC_DUTY_CHNG_END_HSCH2_INT_CLR : WO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: Set this bit to clear high speed channel 2 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_HSCH2_INT_CLR (BIT(10)) -#define LEDC_DUTY_CHNG_END_HSCH2_INT_CLR_M (BIT(10)) -#define LEDC_DUTY_CHNG_END_HSCH2_INT_CLR_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH2_INT_CLR_S 10 -/* LEDC_DUTY_CHNG_END_HSCH1_INT_CLR : WO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: Set this bit to clear high speed channel 1 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_HSCH1_INT_CLR (BIT(9)) -#define LEDC_DUTY_CHNG_END_HSCH1_INT_CLR_M (BIT(9)) -#define LEDC_DUTY_CHNG_END_HSCH1_INT_CLR_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH1_INT_CLR_S 9 -/* LEDC_DUTY_CHNG_END_HSCH0_INT_CLR : WO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: Set this bit to clear high speed channel 0 duty change done interrupt.*/ -#define LEDC_DUTY_CHNG_END_HSCH0_INT_CLR (BIT(8)) -#define LEDC_DUTY_CHNG_END_HSCH0_INT_CLR_M (BIT(8)) -#define LEDC_DUTY_CHNG_END_HSCH0_INT_CLR_V 0x1 -#define LEDC_DUTY_CHNG_END_HSCH0_INT_CLR_S 8 -/* LEDC_LSTIMER3_OVF_INT_CLR : WO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: Set this bit to clear low speed channel3 counter overflow interrupt.*/ -#define LEDC_LSTIMER3_OVF_INT_CLR (BIT(7)) -#define LEDC_LSTIMER3_OVF_INT_CLR_M (BIT(7)) -#define LEDC_LSTIMER3_OVF_INT_CLR_V 0x1 -#define LEDC_LSTIMER3_OVF_INT_CLR_S 7 -/* LEDC_LSTIMER2_OVF_INT_CLR : WO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: Set this bit to clear low speed channel2 counter overflow interrupt.*/ -#define LEDC_LSTIMER2_OVF_INT_CLR (BIT(6)) -#define LEDC_LSTIMER2_OVF_INT_CLR_M (BIT(6)) -#define LEDC_LSTIMER2_OVF_INT_CLR_V 0x1 -#define LEDC_LSTIMER2_OVF_INT_CLR_S 6 -/* LEDC_LSTIMER1_OVF_INT_CLR : WO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: Set this bit to clear low speed channel1 counter overflow interrupt.*/ -#define LEDC_LSTIMER1_OVF_INT_CLR (BIT(5)) -#define LEDC_LSTIMER1_OVF_INT_CLR_M (BIT(5)) -#define LEDC_LSTIMER1_OVF_INT_CLR_V 0x1 -#define LEDC_LSTIMER1_OVF_INT_CLR_S 5 -/* LEDC_LSTIMER0_OVF_INT_CLR : WO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: Set this bit to clear low speed channel0 counter overflow interrupt.*/ -#define LEDC_LSTIMER0_OVF_INT_CLR (BIT(4)) -#define LEDC_LSTIMER0_OVF_INT_CLR_M (BIT(4)) -#define LEDC_LSTIMER0_OVF_INT_CLR_V 0x1 -#define LEDC_LSTIMER0_OVF_INT_CLR_S 4 -/* LEDC_HSTIMER3_OVF_INT_CLR : WO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: Set this bit to clear high speed channel3 counter overflow interrupt.*/ -#define LEDC_HSTIMER3_OVF_INT_CLR (BIT(3)) -#define LEDC_HSTIMER3_OVF_INT_CLR_M (BIT(3)) -#define LEDC_HSTIMER3_OVF_INT_CLR_V 0x1 -#define LEDC_HSTIMER3_OVF_INT_CLR_S 3 -/* LEDC_HSTIMER2_OVF_INT_CLR : WO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: Set this bit to clear high speed channel2 counter overflow interrupt.*/ -#define LEDC_HSTIMER2_OVF_INT_CLR (BIT(2)) -#define LEDC_HSTIMER2_OVF_INT_CLR_M (BIT(2)) -#define LEDC_HSTIMER2_OVF_INT_CLR_V 0x1 -#define LEDC_HSTIMER2_OVF_INT_CLR_S 2 -/* LEDC_HSTIMER1_OVF_INT_CLR : WO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: Set this bit to clear high speed channel1 counter overflow interrupt.*/ -#define LEDC_HSTIMER1_OVF_INT_CLR (BIT(1)) -#define LEDC_HSTIMER1_OVF_INT_CLR_M (BIT(1)) -#define LEDC_HSTIMER1_OVF_INT_CLR_V 0x1 -#define LEDC_HSTIMER1_OVF_INT_CLR_S 1 -/* LEDC_HSTIMER0_OVF_INT_CLR : WO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: Set this bit to clear high speed channel0 counter overflow interrupt.*/ -#define LEDC_HSTIMER0_OVF_INT_CLR (BIT(0)) -#define LEDC_HSTIMER0_OVF_INT_CLR_M (BIT(0)) -#define LEDC_HSTIMER0_OVF_INT_CLR_V 0x1 -#define LEDC_HSTIMER0_OVF_INT_CLR_S 0 - -#define LEDC_CONF_REG (DR_REG_LEDC_BASE + 0x0190) -/* LEDC_APB_CLK_SEL : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: This bit is used to set the frequency of slow_clk. 1'b1:80mhz 1'b0:8mhz*/ -#define LEDC_APB_CLK_SEL (BIT(0)) -#define LEDC_APB_CLK_SEL_M (BIT(0)) -#define LEDC_APB_CLK_SEL_V 0x1 -#define LEDC_APB_CLK_SEL_S 0 - -#define LEDC_DATE_REG (DR_REG_LEDC_BASE + 0x01FC) -/* LEDC_DATE : R/W ;bitpos:[31:0] ;default: 32'h16031700 ; */ -/*description: This register represents the version .*/ -#define LEDC_DATE 0xFFFFFFFF -#define LEDC_DATE_M ((LEDC_DATE_V)<<(LEDC_DATE_S)) -#define LEDC_DATE_V 0xFFFFFFFF -#define LEDC_DATE_S 0 - - - - -#endif /*_SOC_LEDC_REG_H_ */ - - diff --git a/tools/sdk/include/soc/soc/ledc_struct.h b/tools/sdk/include/soc/soc/ledc_struct.h deleted file mode 100644 index 4c87dfc2654..00000000000 --- a/tools/sdk/include/soc/soc/ledc_struct.h +++ /dev/null @@ -1,261 +0,0 @@ -// 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. -#ifndef _SOC_LEDC_STRUCT_H_ -#define _SOC_LEDC_STRUCT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef volatile struct { - struct { - struct { - union { - struct { - uint32_t timer_sel: 2; /*There are four high speed timers the two bits are used to select one of them for high speed channel. 2'b00: seletc hstimer0. 2'b01: select hstimer1. 2'b10: select hstimer2. 2'b11: select hstimer3.*/ - uint32_t sig_out_en: 1; /*This is the output enable control bit for high speed channel*/ - uint32_t idle_lv: 1; /*This bit is used to control the output value when high speed channel is off.*/ - uint32_t low_speed_update: 1; /*This bit is only useful for low speed timer channels, reserved for high speed timers*/ - uint32_t reserved4: 26; - uint32_t clk_en: 1; /*This bit is clock gating control signal. when software configure LED_PWM internal registers it controls the register clock.*/ - }; - uint32_t val; - } conf0; - union { - struct { - uint32_t hpoint: 20; /*The output value changes to high when htimerx(x=[0 3]) selected by high speed channel has reached reg_hpoint_hsch0[19:0]*/ - uint32_t reserved20: 12; - }; - uint32_t val; - } hpoint; - union { - struct { - uint32_t duty: 25; /*The register is used to control output duty. When hstimerx(x=[0 3]) chosen by high speed channel has reached reg_lpoint_hsch0 the output signal changes to low. reg_lpoint_hsch0=(reg_hpoint_hsch0[19:0]+reg_duty_hsch0[24:4]) (1) reg_lpoint_hsch0=(reg_hpoint_hsch0[19:0]+reg_duty_hsch0[24:4] +1) (2) The least four bits in this register represent the decimal part and determines when to choose (1) or (2)*/ - uint32_t reserved25: 7; - }; - uint32_t val; - } duty; - union { - struct { - uint32_t duty_scale:10; /*This register controls the increase or decrease step scale for high speed channel.*/ - uint32_t duty_cycle:10; /*This register is used to increase or decrease the duty every reg_duty_cycle_hsch0 cycles for high speed channel.*/ - uint32_t duty_num: 10; /*This register is used to control the number of increased or decreased times for high speed channel.*/ - uint32_t duty_inc: 1; /*This register is used to increase the duty of output signal or decrease the duty of output signal for high speed channel.*/ - uint32_t duty_start: 1; /*When reg_duty_num_hsch0 reg_duty_cycle_hsch0 and reg_duty_scale_hsch0 has been configured. these register won't take effect until set reg_duty_start_hsch0. this bit is automatically cleared by hardware.*/ - }; - uint32_t val; - } conf1; - union { - struct { - uint32_t duty_read: 25; /*This register represents the current duty of the output signal for high speed channel.*/ - uint32_t reserved25: 7; - }; - uint32_t val; - } duty_rd; - } channel[8]; - } channel_group[2]; /*two channel groups : 0: high-speed channels; 1: low-speed channels*/ - struct { - struct { - union { - struct { - uint32_t duty_resolution: 5; /*This register controls resolution of PWN duty by defining the bit width of timer's counter. The max bit width of the counter is 20.*/ - uint32_t clock_divider: 18; /*This register is used to configure the divider of clock at the entry of timer. The least significant eight bits represent the decimal part.*/ - uint32_t pause: 1; /*This bit is used to pause the counter in high speed timer*/ - uint32_t rst: 1; /*This bit is used to reset high speed timer the counter will be 0 after reset.*/ - uint32_t tick_sel: 1; /*This bit is used to choose apb_clk or ref_tick for high speed timer. 1'b1:apb_clk 0:ref_tick*/ - uint32_t low_speed_update: 1; /*This bit is only useful for low speed timer channels, reserved for high speed timers*/ - uint32_t reserved26: 5; - }; - struct { - uint32_t bit_num: 5 __attribute__((deprecated)); /*Deprecated in ESP-IDF 3.0. This is an alias to 'duty_resolution' for backward compatibility with ESP-IDF 2.1.*/ - uint32_t div_num: 18 __attribute__((deprecated)); /*Deprecated in ESP-IDF 3.0. This is an alias to 'clock_divider' for backward compatibility with ESP-IDF 2.1.*/ - uint32_t place_holder: 9 __attribute__((deprecated)); /*A place holder to accommodate deprecated members*/ - }; - uint32_t val; - } conf; - union { - struct { - uint32_t timer_cnt: 20; /*software can read this register to get the current counter value in high speed timer*/ - uint32_t reserved20: 12; - }; - uint32_t val; - } value; - } timer[4]; - } timer_group[2]; /*two channel groups : 0: high-speed channels; 1: low-speed channels*/ - union { - struct { - uint32_t hstimer0_ovf: 1; /*The interrupt raw bit for high speed channel0 counter overflow.*/ - uint32_t hstimer1_ovf: 1; /*The interrupt raw bit for high speed channel1 counter overflow.*/ - uint32_t hstimer2_ovf: 1; /*The interrupt raw bit for high speed channel2 counter overflow.*/ - uint32_t hstimer3_ovf: 1; /*The interrupt raw bit for high speed channel3 counter overflow.*/ - uint32_t lstimer0_ovf: 1; /*The interrupt raw bit for low speed channel0 counter overflow.*/ - uint32_t lstimer1_ovf: 1; /*The interrupt raw bit for low speed channel1 counter overflow.*/ - uint32_t lstimer2_ovf: 1; /*The interrupt raw bit for low speed channel2 counter overflow.*/ - uint32_t lstimer3_ovf: 1; /*The interrupt raw bit for low speed channel3 counter overflow.*/ - uint32_t duty_chng_end_hsch0: 1; /*The interrupt raw bit for high speed channel 0 duty change done.*/ - uint32_t duty_chng_end_hsch1: 1; /*The interrupt raw bit for high speed channel 1 duty change done.*/ - uint32_t duty_chng_end_hsch2: 1; /*The interrupt raw bit for high speed channel 2 duty change done.*/ - uint32_t duty_chng_end_hsch3: 1; /*The interrupt raw bit for high speed channel 3 duty change done.*/ - uint32_t duty_chng_end_hsch4: 1; /*The interrupt raw bit for high speed channel 4 duty change done.*/ - uint32_t duty_chng_end_hsch5: 1; /*The interrupt raw bit for high speed channel 5 duty change done.*/ - uint32_t duty_chng_end_hsch6: 1; /*The interrupt raw bit for high speed channel 6 duty change done.*/ - uint32_t duty_chng_end_hsch7: 1; /*The interrupt raw bit for high speed channel 7 duty change done.*/ - uint32_t duty_chng_end_lsch0: 1; /*The interrupt raw bit for low speed channel 0 duty change done.*/ - uint32_t duty_chng_end_lsch1: 1; /*The interrupt raw bit for low speed channel 1 duty change done.*/ - uint32_t duty_chng_end_lsch2: 1; /*The interrupt raw bit for low speed channel 2 duty change done.*/ - uint32_t duty_chng_end_lsch3: 1; /*The interrupt raw bit for low speed channel 3 duty change done.*/ - uint32_t duty_chng_end_lsch4: 1; /*The interrupt raw bit for low speed channel 4 duty change done.*/ - uint32_t duty_chng_end_lsch5: 1; /*The interrupt raw bit for low speed channel 5 duty change done.*/ - uint32_t duty_chng_end_lsch6: 1; /*The interrupt raw bit for low speed channel 6 duty change done.*/ - uint32_t duty_chng_end_lsch7: 1; /*The interrupt raw bit for low speed channel 7 duty change done.*/ - uint32_t reserved24: 8; - }; - uint32_t val; - } int_raw; - union { - struct { - uint32_t hstimer0_ovf: 1; /*The interrupt status bit for high speed channel0 counter overflow event.*/ - uint32_t hstimer1_ovf: 1; /*The interrupt status bit for high speed channel1 counter overflow event.*/ - uint32_t hstimer2_ovf: 1; /*The interrupt status bit for high speed channel2 counter overflow event.*/ - uint32_t hstimer3_ovf: 1; /*The interrupt status bit for high speed channel3 counter overflow event.*/ - uint32_t lstimer0_ovf: 1; /*The interrupt status bit for low speed channel0 counter overflow event.*/ - uint32_t lstimer1_ovf: 1; /*The interrupt status bit for low speed channel1 counter overflow event.*/ - uint32_t lstimer2_ovf: 1; /*The interrupt status bit for low speed channel2 counter overflow event.*/ - uint32_t lstimer3_ovf: 1; /*The interrupt status bit for low speed channel3 counter overflow event.*/ - uint32_t duty_chng_end_hsch0: 1; /*The interrupt enable bit for high speed channel 0 duty change done event.*/ - uint32_t duty_chng_end_hsch1: 1; /*The interrupt status bit for high speed channel 1 duty change done event.*/ - uint32_t duty_chng_end_hsch2: 1; /*The interrupt status bit for high speed channel 2 duty change done event.*/ - uint32_t duty_chng_end_hsch3: 1; /*The interrupt status bit for high speed channel 3 duty change done event.*/ - uint32_t duty_chng_end_hsch4: 1; /*The interrupt status bit for high speed channel 4 duty change done event.*/ - uint32_t duty_chng_end_hsch5: 1; /*The interrupt status bit for high speed channel 5 duty change done event.*/ - uint32_t duty_chng_end_hsch6: 1; /*The interrupt status bit for high speed channel 6 duty change done event.*/ - uint32_t duty_chng_end_hsch7: 1; /*The interrupt status bit for high speed channel 7 duty change done event.*/ - uint32_t duty_chng_end_lsch0: 1; /*The interrupt status bit for low speed channel 0 duty change done event.*/ - uint32_t duty_chng_end_lsch1: 1; /*The interrupt status bit for low speed channel 1 duty change done event.*/ - uint32_t duty_chng_end_lsch2: 1; /*The interrupt status bit for low speed channel 2 duty change done event.*/ - uint32_t duty_chng_end_lsch3: 1; /*The interrupt status bit for low speed channel 3 duty change done event.*/ - uint32_t duty_chng_end_lsch4: 1; /*The interrupt status bit for low speed channel 4 duty change done event.*/ - uint32_t duty_chng_end_lsch5: 1; /*The interrupt status bit for low speed channel 5 duty change done event.*/ - uint32_t duty_chng_end_lsch6: 1; /*The interrupt status bit for low speed channel 6 duty change done event.*/ - uint32_t duty_chng_end_lsch7: 1; /*The interrupt status bit for low speed channel 7 duty change done event*/ - uint32_t reserved24: 8; - }; - uint32_t val; - } int_st; - union { - struct { - uint32_t hstimer0_ovf: 1; /*The interrupt enable bit for high speed channel0 counter overflow interrupt.*/ - uint32_t hstimer1_ovf: 1; /*The interrupt enable bit for high speed channel1 counter overflow interrupt.*/ - uint32_t hstimer2_ovf: 1; /*The interrupt enable bit for high speed channel2 counter overflow interrupt.*/ - uint32_t hstimer3_ovf: 1; /*The interrupt enable bit for high speed channel3 counter overflow interrupt.*/ - uint32_t lstimer0_ovf: 1; /*The interrupt enable bit for low speed channel0 counter overflow interrupt.*/ - uint32_t lstimer1_ovf: 1; /*The interrupt enable bit for low speed channel1 counter overflow interrupt.*/ - uint32_t lstimer2_ovf: 1; /*The interrupt enable bit for low speed channel2 counter overflow interrupt.*/ - uint32_t lstimer3_ovf: 1; /*The interrupt enable bit for low speed channel3 counter overflow interrupt.*/ - uint32_t duty_chng_end_hsch0: 1; /*The interrupt enable bit for high speed channel 0 duty change done interrupt.*/ - uint32_t duty_chng_end_hsch1: 1; /*The interrupt enable bit for high speed channel 1 duty change done interrupt.*/ - uint32_t duty_chng_end_hsch2: 1; /*The interrupt enable bit for high speed channel 2 duty change done interrupt.*/ - uint32_t duty_chng_end_hsch3: 1; /*The interrupt enable bit for high speed channel 3 duty change done interrupt.*/ - uint32_t duty_chng_end_hsch4: 1; /*The interrupt enable bit for high speed channel 4 duty change done interrupt.*/ - uint32_t duty_chng_end_hsch5: 1; /*The interrupt enable bit for high speed channel 5 duty change done interrupt.*/ - uint32_t duty_chng_end_hsch6: 1; /*The interrupt enable bit for high speed channel 6 duty change done interrupt.*/ - uint32_t duty_chng_end_hsch7: 1; /*The interrupt enable bit for high speed channel 7 duty change done interrupt.*/ - uint32_t duty_chng_end_lsch0: 1; /*The interrupt enable bit for low speed channel 0 duty change done interrupt.*/ - uint32_t duty_chng_end_lsch1: 1; /*The interrupt enable bit for low speed channel 1 duty change done interrupt.*/ - uint32_t duty_chng_end_lsch2: 1; /*The interrupt enable bit for low speed channel 2 duty change done interrupt.*/ - uint32_t duty_chng_end_lsch3: 1; /*The interrupt enable bit for low speed channel 3 duty change done interrupt.*/ - uint32_t duty_chng_end_lsch4: 1; /*The interrupt enable bit for low speed channel 4 duty change done interrupt.*/ - uint32_t duty_chng_end_lsch5: 1; /*The interrupt enable bit for low speed channel 5 duty change done interrupt.*/ - uint32_t duty_chng_end_lsch6: 1; /*The interrupt enable bit for low speed channel 6 duty change done interrupt.*/ - uint32_t duty_chng_end_lsch7: 1; /*The interrupt enable bit for low speed channel 7 duty change done interrupt.*/ - uint32_t reserved24: 8; - }; - uint32_t val; - } int_ena; - union { - struct { - uint32_t hstimer0_ovf: 1; /*Set this bit to clear high speed channel0 counter overflow interrupt.*/ - uint32_t hstimer1_ovf: 1; /*Set this bit to clear high speed channel1 counter overflow interrupt.*/ - uint32_t hstimer2_ovf: 1; /*Set this bit to clear high speed channel2 counter overflow interrupt.*/ - uint32_t hstimer3_ovf: 1; /*Set this bit to clear high speed channel3 counter overflow interrupt.*/ - uint32_t lstimer0_ovf: 1; /*Set this bit to clear low speed channel0 counter overflow interrupt.*/ - uint32_t lstimer1_ovf: 1; /*Set this bit to clear low speed channel1 counter overflow interrupt.*/ - uint32_t lstimer2_ovf: 1; /*Set this bit to clear low speed channel2 counter overflow interrupt.*/ - uint32_t lstimer3_ovf: 1; /*Set this bit to clear low speed channel3 counter overflow interrupt.*/ - uint32_t duty_chng_end_hsch0: 1; /*Set this bit to clear high speed channel 0 duty change done interrupt.*/ - uint32_t duty_chng_end_hsch1: 1; /*Set this bit to clear high speed channel 1 duty change done interrupt.*/ - uint32_t duty_chng_end_hsch2: 1; /*Set this bit to clear high speed channel 2 duty change done interrupt.*/ - uint32_t duty_chng_end_hsch3: 1; /*Set this bit to clear high speed channel 3 duty change done interrupt.*/ - uint32_t duty_chng_end_hsch4: 1; /*Set this bit to clear high speed channel 4 duty change done interrupt.*/ - uint32_t duty_chng_end_hsch5: 1; /*Set this bit to clear high speed channel 5 duty change done interrupt.*/ - uint32_t duty_chng_end_hsch6: 1; /*Set this bit to clear high speed channel 6 duty change done interrupt.*/ - uint32_t duty_chng_end_hsch7: 1; /*Set this bit to clear high speed channel 7 duty change done interrupt.*/ - uint32_t duty_chng_end_lsch0: 1; /*Set this bit to clear low speed channel 0 duty change done interrupt.*/ - uint32_t duty_chng_end_lsch1: 1; /*Set this bit to clear low speed channel 1 duty change done interrupt.*/ - uint32_t duty_chng_end_lsch2: 1; /*Set this bit to clear low speed channel 2 duty change done interrupt.*/ - uint32_t duty_chng_end_lsch3: 1; /*Set this bit to clear low speed channel 3 duty change done interrupt.*/ - uint32_t duty_chng_end_lsch4: 1; /*Set this bit to clear low speed channel 4 duty change done interrupt.*/ - uint32_t duty_chng_end_lsch5: 1; /*Set this bit to clear low speed channel 5 duty change done interrupt.*/ - uint32_t duty_chng_end_lsch6: 1; /*Set this bit to clear low speed channel 6 duty change done interrupt.*/ - uint32_t duty_chng_end_lsch7: 1; /*Set this bit to clear low speed channel 7 duty change done interrupt.*/ - uint32_t reserved24: 8; - }; - uint32_t val; - } int_clr; - union { - struct { - uint32_t apb_clk_sel: 1; /*This bit decides the slow clock for LEDC low speed channels, so we want to replace the field name with slow_clk_sel*/ - uint32_t reserved1: 31; - }; - struct { - uint32_t slow_clk_sel: 1; /*This bit is used to set the frequency of slow_clk. 1'b1:80mhz 1'b0:8mhz, (only used by LEDC low speed channels/timers)*/ - uint32_t reserved: 31; - }; - uint32_t val; - } conf; - uint32_t reserved_194; - uint32_t reserved_198; - uint32_t reserved_19c; - uint32_t reserved_1a0; - uint32_t reserved_1a4; - uint32_t reserved_1a8; - uint32_t reserved_1ac; - uint32_t reserved_1b0; - uint32_t reserved_1b4; - uint32_t reserved_1b8; - uint32_t reserved_1bc; - uint32_t reserved_1c0; - uint32_t reserved_1c4; - uint32_t reserved_1c8; - uint32_t reserved_1cc; - uint32_t reserved_1d0; - uint32_t reserved_1d4; - uint32_t reserved_1d8; - uint32_t reserved_1dc; - uint32_t reserved_1e0; - uint32_t reserved_1e4; - uint32_t reserved_1e8; - uint32_t reserved_1ec; - uint32_t reserved_1f0; - uint32_t reserved_1f4; - uint32_t reserved_1f8; - uint32_t date; /*This register represents the version .*/ -} ledc_dev_t; -extern ledc_dev_t LEDC; - -#ifdef __cplusplus -} -#endif - -#endif /* _SOC_LEDC_STRUCT_H_ */ diff --git a/tools/sdk/include/soc/soc/mcpwm_reg.h b/tools/sdk/include/soc/soc/mcpwm_reg.h deleted file mode 100644 index 1dce94d4694..00000000000 --- a/tools/sdk/include/soc/soc/mcpwm_reg.h +++ /dev/null @@ -1,3028 +0,0 @@ -// 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. -#ifndef _SOC_MCPWM_REG_H_ -#define _SOC_MCPWM_REG_H_ -#include "soc.h" - -#define REG_MCPWM_BASE(i) (DR_REG_PWM_BASE + i * (0xE000)) -#define MCPWM_CLK_CFG_REG(i) (REG_MCPWM_BASE(i) + 0x0000) -/* MCPWM_CLK_PRESCALE : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: Period of PWM_clk = 6.25ns * (PWM_CLK_PRESCALE + 1)*/ -#define MCPWM_CLK_PRESCALE 0x000000FF -#define MCPWM_CLK_PRESCALE_M ((MCPWM_CLK_PRESCALE_V)<<(MCPWM_CLK_PRESCALE_S)) -#define MCPWM_CLK_PRESCALE_V 0xFF -#define MCPWM_CLK_PRESCALE_S 0 - -#define MCPWM_TIMER0_CFG0_REG(i) (REG_MCPWM_BASE(i) + 0x0004) -/* MCPWM_TIMER0_PERIOD_UPMETHOD : R/W ;bitpos:[25:24] ;default: 2'd0 ; */ -/*description: Update method for active reg of PWM timer0 period 0: immediate - 1: TEZ 2: sync 3: TEZ or sync. TEZ here and below means timer equal zero event*/ -#define MCPWM_TIMER0_PERIOD_UPMETHOD 0x00000003 -#define MCPWM_TIMER0_PERIOD_UPMETHOD_M ((MCPWM_TIMER0_PERIOD_UPMETHOD_V)<<(MCPWM_TIMER0_PERIOD_UPMETHOD_S)) -#define MCPWM_TIMER0_PERIOD_UPMETHOD_V 0x3 -#define MCPWM_TIMER0_PERIOD_UPMETHOD_S 24 -/* MCPWM_TIMER0_PERIOD : R/W ;bitpos:[23:8] ;default: 16'h00ff ; */ -/*description: Period shadow reg of PWM timer0*/ -#define MCPWM_TIMER0_PERIOD 0x0000FFFF -#define MCPWM_TIMER0_PERIOD_M ((MCPWM_TIMER0_PERIOD_V)<<(MCPWM_TIMER0_PERIOD_S)) -#define MCPWM_TIMER0_PERIOD_V 0xFFFF -#define MCPWM_TIMER0_PERIOD_S 8 -/* MCPWM_TIMER0_PRESCALE : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: Period of PT0_clk = Period of PWM_clk * (PWM_TIMER0_PRESCALE + 1)*/ -#define MCPWM_TIMER0_PRESCALE 0x000000FF -#define MCPWM_TIMER0_PRESCALE_M ((MCPWM_TIMER0_PRESCALE_V)<<(MCPWM_TIMER0_PRESCALE_S)) -#define MCPWM_TIMER0_PRESCALE_V 0xFF -#define MCPWM_TIMER0_PRESCALE_S 0 - -#define MCPWM_TIMER0_CFG1_REG(i) (REG_MCPWM_BASE(i) + 0x0008) -/* MCPWM_TIMER0_MOD : R/W ;bitpos:[4:3] ;default: 2'h0 ; */ -/*description: PWM timer0 working mode 0: freeze 1: increase mod 2: decrease - mod 3: up-down mod*/ -#define MCPWM_TIMER0_MOD 0x00000003 -#define MCPWM_TIMER0_MOD_M ((MCPWM_TIMER0_MOD_V)<<(MCPWM_TIMER0_MOD_S)) -#define MCPWM_TIMER0_MOD_V 0x3 -#define MCPWM_TIMER0_MOD_S 3 -/* MCPWM_TIMER0_START : R/W ;bitpos:[2:0] ;default: 3'h0 ; */ -/*description: PWM timer0 start and stop control. 0: stop @ TEZ 1: stop @ TEP - 2: free run 3: start and stop @ next TEZ 4: start and stop @ next TEP. TEP here and below means timer equal period event*/ -#define MCPWM_TIMER0_START 0x00000007 -#define MCPWM_TIMER0_START_M ((MCPWM_TIMER0_START_V)<<(MCPWM_TIMER0_START_S)) -#define MCPWM_TIMER0_START_V 0x7 -#define MCPWM_TIMER0_START_S 0 - -#define MCPWM_TIMER0_SYNC_REG(i) (REG_MCPWM_BASE(i) + 0x000c) -/* MCPWM_TIMER0_PHASE : R/W ;bitpos:[20:4] ;default: 17'd0 ; */ -/*description: Phase for timer reload on sync event*/ -#define MCPWM_TIMER0_PHASE 0x0001FFFF -#define MCPWM_TIMER0_PHASE_M ((MCPWM_TIMER0_PHASE_V)<<(MCPWM_TIMER0_PHASE_S)) -#define MCPWM_TIMER0_PHASE_V 0x1FFFF -#define MCPWM_TIMER0_PHASE_S 4 -/* MCPWM_TIMER0_SYNCO_SEL : R/W ;bitpos:[3:2] ;default: 2'd0 ; */ -/*description: PWM timer0 synco selection 0: synci 1: TEZ 2: TEP else 0*/ -#define MCPWM_TIMER0_SYNCO_SEL 0x00000003 -#define MCPWM_TIMER0_SYNCO_SEL_M ((MCPWM_TIMER0_SYNCO_SEL_V)<<(MCPWM_TIMER0_SYNCO_SEL_S)) -#define MCPWM_TIMER0_SYNCO_SEL_V 0x3 -#define MCPWM_TIMER0_SYNCO_SEL_S 2 -/* MCPWM_TIMER0_SYNC_SW : R/W ;bitpos:[1] ;default: 1'h0 ; */ -/*description: Toggling this bit will trigger a software sync*/ -#define MCPWM_TIMER0_SYNC_SW (BIT(1)) -#define MCPWM_TIMER0_SYNC_SW_M (BIT(1)) -#define MCPWM_TIMER0_SYNC_SW_V 0x1 -#define MCPWM_TIMER0_SYNC_SW_S 1 -/* MCPWM_TIMER0_SYNCI_EN : R/W ;bitpos:[0] ;default: 1'h0 ; */ -/*description: When set timer reload with phase on sync input event is enabled*/ -#define MCPWM_TIMER0_SYNCI_EN (BIT(0)) -#define MCPWM_TIMER0_SYNCI_EN_M (BIT(0)) -#define MCPWM_TIMER0_SYNCI_EN_V 0x1 -#define MCPWM_TIMER0_SYNCI_EN_S 0 - -#define MCPWM_TIMER0_STATUS_REG(i) (REG_MCPWM_BASE(i) + 0x0010) -/* MCPWM_TIMER0_DIRECTION : RO ;bitpos:[16] ;default: 1'd0 ; */ -/*description: Current PWM timer0 counter direction 0: increment 1: decrement*/ -#define MCPWM_TIMER0_DIRECTION (BIT(16)) -#define MCPWM_TIMER0_DIRECTION_M (BIT(16)) -#define MCPWM_TIMER0_DIRECTION_V 0x1 -#define MCPWM_TIMER0_DIRECTION_S 16 -/* MCPWM_TIMER0_VALUE : RO ;bitpos:[15:0] ;default: 16'd0 ; */ -/*description: Current PWM timer0 counter value*/ -#define MCPWM_TIMER0_VALUE 0x0000FFFF -#define MCPWM_TIMER0_VALUE_M ((MCPWM_TIMER0_VALUE_V)<<(MCPWM_TIMER0_VALUE_S)) -#define MCPWM_TIMER0_VALUE_V 0xFFFF -#define MCPWM_TIMER0_VALUE_S 0 - -#define MCPWM_TIMER1_CFG0_REG(i) (REG_MCPWM_BASE(i) + 0x0014) -/* MCPWM_TIMER1_PERIOD_UPMETHOD : R/W ;bitpos:[25:24] ;default: 2'd0 ; */ -/*description: Update method for active reg of PWM timer1 period 0: immediate - 1: TEZ 2: sync 3: TEZ or sync*/ -#define MCPWM_TIMER1_PERIOD_UPMETHOD 0x00000003 -#define MCPWM_TIMER1_PERIOD_UPMETHOD_M ((MCPWM_TIMER1_PERIOD_UPMETHOD_V)<<(MCPWM_TIMER1_PERIOD_UPMETHOD_S)) -#define MCPWM_TIMER1_PERIOD_UPMETHOD_V 0x3 -#define MCPWM_TIMER1_PERIOD_UPMETHOD_S 24 -/* MCPWM_TIMER1_PERIOD : R/W ;bitpos:[23:8] ;default: 16'h00ff ; */ -/*description: Period shadow reg of PWM timer1*/ -#define MCPWM_TIMER1_PERIOD 0x0000FFFF -#define MCPWM_TIMER1_PERIOD_M ((MCPWM_TIMER1_PERIOD_V)<<(MCPWM_TIMER1_PERIOD_S)) -#define MCPWM_TIMER1_PERIOD_V 0xFFFF -#define MCPWM_TIMER1_PERIOD_S 8 -/* MCPWM_TIMER1_PRESCALE : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: Period of PT1_clk = Period of PWM_clk * (PWM_TIMER1_PRESCALE + 1)*/ -#define MCPWM_TIMER1_PRESCALE 0x000000FF -#define MCPWM_TIMER1_PRESCALE_M ((MCPWM_TIMER1_PRESCALE_V)<<(MCPWM_TIMER1_PRESCALE_S)) -#define MCPWM_TIMER1_PRESCALE_V 0xFF -#define MCPWM_TIMER1_PRESCALE_S 0 - -#define MCPWM_TIMER1_CFG1_REG(i) (REG_MCPWM_BASE(i) + 0x0018) -/* MCPWM_TIMER1_MOD : R/W ;bitpos:[4:3] ;default: 2'h0 ; */ -/*description: PWM timer1 working mode 0: freeze 1: increase mod 2: decrease - mod 3: up-down mod*/ -#define MCPWM_TIMER1_MOD 0x00000003 -#define MCPWM_TIMER1_MOD_M ((MCPWM_TIMER1_MOD_V)<<(MCPWM_TIMER1_MOD_S)) -#define MCPWM_TIMER1_MOD_V 0x3 -#define MCPWM_TIMER1_MOD_S 3 -/* MCPWM_TIMER1_START : R/W ;bitpos:[2:0] ;default: 3'h0 ; */ -/*description: PWM timer1 start and stop control. 0: stop @ TEZ 1: stop @ TEP - 2: free run 3: start and stop @ next TEZ 4: start and stop @ next TEP.*/ -#define MCPWM_TIMER1_START 0x00000007 -#define MCPWM_TIMER1_START_M ((MCPWM_TIMER1_START_V)<<(MCPWM_TIMER1_START_S)) -#define MCPWM_TIMER1_START_V 0x7 -#define MCPWM_TIMER1_START_S 0 - -#define MCPWM_TIMER1_SYNC_REG(i) (REG_MCPWM_BASE(i) + 0x001c) -/* MCPWM_TIMER1_PHASE : R/W ;bitpos:[20:4] ;default: 17'd0 ; */ -/*description: Phase for timer reload on sync event*/ -#define MCPWM_TIMER1_PHASE 0x0001FFFF -#define MCPWM_TIMER1_PHASE_M ((MCPWM_TIMER1_PHASE_V)<<(MCPWM_TIMER1_PHASE_S)) -#define MCPWM_TIMER1_PHASE_V 0x1FFFF -#define MCPWM_TIMER1_PHASE_S 4 -/* MCPWM_TIMER1_SYNCO_SEL : R/W ;bitpos:[3:2] ;default: 2'd0 ; */ -/*description: PWM timer1 synco selection 0: synci 1: TEZ 2: TEP else 0*/ -#define MCPWM_TIMER1_SYNCO_SEL 0x00000003 -#define MCPWM_TIMER1_SYNCO_SEL_M ((MCPWM_TIMER1_SYNCO_SEL_V)<<(MCPWM_TIMER1_SYNCO_SEL_S)) -#define MCPWM_TIMER1_SYNCO_SEL_V 0x3 -#define MCPWM_TIMER1_SYNCO_SEL_S 2 -/* MCPWM_TIMER1_SYNC_SW : R/W ;bitpos:[1] ;default: 1'h0 ; */ -/*description: Toggling this bit will trigger a software sync*/ -#define MCPWM_TIMER1_SYNC_SW (BIT(1)) -#define MCPWM_TIMER1_SYNC_SW_M (BIT(1)) -#define MCPWM_TIMER1_SYNC_SW_V 0x1 -#define MCPWM_TIMER1_SYNC_SW_S 1 -/* MCPWM_TIMER1_SYNCI_EN : R/W ;bitpos:[0] ;default: 1'h0 ; */ -/*description: When set timer reload with phase on sync input event is enabled*/ -#define MCPWM_TIMER1_SYNCI_EN (BIT(0)) -#define MCPWM_TIMER1_SYNCI_EN_M (BIT(0)) -#define MCPWM_TIMER1_SYNCI_EN_V 0x1 -#define MCPWM_TIMER1_SYNCI_EN_S 0 - -#define MCPWM_TIMER1_STATUS_REG(i) (REG_MCPWM_BASE(i) + 0x0020) -/* MCPWM_TIMER1_DIRECTION : RO ;bitpos:[16] ;default: 1'd0 ; */ -/*description: Current PWM timer1 counter direction 0: increment 1: decrement*/ -#define MCPWM_TIMER1_DIRECTION (BIT(16)) -#define MCPWM_TIMER1_DIRECTION_M (BIT(16)) -#define MCPWM_TIMER1_DIRECTION_V 0x1 -#define MCPWM_TIMER1_DIRECTION_S 16 -/* MCPWM_TIMER1_VALUE : RO ;bitpos:[15:0] ;default: 16'd0 ; */ -/*description: Current PWM timer1 counter value*/ -#define MCPWM_TIMER1_VALUE 0x0000FFFF -#define MCPWM_TIMER1_VALUE_M ((MCPWM_TIMER1_VALUE_V)<<(MCPWM_TIMER1_VALUE_S)) -#define MCPWM_TIMER1_VALUE_V 0xFFFF -#define MCPWM_TIMER1_VALUE_S 0 - -#define MCPWM_TIMER2_CFG0_REG(i) (REG_MCPWM_BASE(i) + 0x0024) -/* MCPWM_TIMER2_PERIOD_UPMETHOD : R/W ;bitpos:[25:24] ;default: 2'd0 ; */ -/*description: Update method for active reg of PWM timer2 period 0: immediate - 1: TEZ 2: sync 3: TEZ or sync*/ -#define MCPWM_TIMER2_PERIOD_UPMETHOD 0x00000003 -#define MCPWM_TIMER2_PERIOD_UPMETHOD_M ((MCPWM_TIMER2_PERIOD_UPMETHOD_V)<<(MCPWM_TIMER2_PERIOD_UPMETHOD_S)) -#define MCPWM_TIMER2_PERIOD_UPMETHOD_V 0x3 -#define MCPWM_TIMER2_PERIOD_UPMETHOD_S 24 -/* MCPWM_TIMER2_PERIOD : R/W ;bitpos:[23:8] ;default: 16'h00ff ; */ -/*description: Period shadow reg of PWM timer2*/ -#define MCPWM_TIMER2_PERIOD 0x0000FFFF -#define MCPWM_TIMER2_PERIOD_M ((MCPWM_TIMER2_PERIOD_V)<<(MCPWM_TIMER2_PERIOD_S)) -#define MCPWM_TIMER2_PERIOD_V 0xFFFF -#define MCPWM_TIMER2_PERIOD_S 8 -/* MCPWM_TIMER2_PRESCALE : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: Period of PT2_clk = Period of PWM_clk * (PWM_TIMER2_PRESCALE + 1)*/ -#define MCPWM_TIMER2_PRESCALE 0x000000FF -#define MCPWM_TIMER2_PRESCALE_M ((MCPWM_TIMER2_PRESCALE_V)<<(MCPWM_TIMER2_PRESCALE_S)) -#define MCPWM_TIMER2_PRESCALE_V 0xFF -#define MCPWM_TIMER2_PRESCALE_S 0 - -#define MCPWM_TIMER2_CFG1_REG(i) (REG_MCPWM_BASE(i) + 0x0028) -/* MCPWM_TIMER2_MOD : R/W ;bitpos:[4:3] ;default: 2'h0 ; */ -/*description: PWM timer2 working mode 0: freeze 1: increase mod 2: decrease - mod 3: up-down mod*/ -#define MCPWM_TIMER2_MOD 0x00000003 -#define MCPWM_TIMER2_MOD_M ((MCPWM_TIMER2_MOD_V)<<(MCPWM_TIMER2_MOD_S)) -#define MCPWM_TIMER2_MOD_V 0x3 -#define MCPWM_TIMER2_MOD_S 3 -/* MCPWM_TIMER2_START : R/W ;bitpos:[2:0] ;default: 3'h0 ; */ -/*description: PWM timer2 start and stop control. 0: stop @ TEZ 1: stop @ TEP - 2: free run 3: start and stop @ next TEZ 4: start and stop @ next TEP.*/ -#define MCPWM_TIMER2_START 0x00000007 -#define MCPWM_TIMER2_START_M ((MCPWM_TIMER2_START_V)<<(MCPWM_TIMER2_START_S)) -#define MCPWM_TIMER2_START_V 0x7 -#define MCPWM_TIMER2_START_S 0 - -#define MCPWM_TIMER2_SYNC_REG(i) (REG_MCPWM_BASE(i) + 0x002c) -/* MCPWM_TIMER2_PHASE : R/W ;bitpos:[20:4] ;default: 17'd0 ; */ -/*description: Phase for timer reload on sync event*/ -#define MCPWM_TIMER2_PHASE 0x0001FFFF -#define MCPWM_TIMER2_PHASE_M ((MCPWM_TIMER2_PHASE_V)<<(MCPWM_TIMER2_PHASE_S)) -#define MCPWM_TIMER2_PHASE_V 0x1FFFF -#define MCPWM_TIMER2_PHASE_S 4 -/* MCPWM_TIMER2_SYNCO_SEL : R/W ;bitpos:[3:2] ;default: 2'd0 ; */ -/*description: PWM timer2 synco selection 0: synci 1: TEZ 2: TEP else 0*/ -#define MCPWM_TIMER2_SYNCO_SEL 0x00000003 -#define MCPWM_TIMER2_SYNCO_SEL_M ((MCPWM_TIMER2_SYNCO_SEL_V)<<(MCPWM_TIMER2_SYNCO_SEL_S)) -#define MCPWM_TIMER2_SYNCO_SEL_V 0x3 -#define MCPWM_TIMER2_SYNCO_SEL_S 2 -/* MCPWM_TIMER2_SYNC_SW : R/W ;bitpos:[1] ;default: 1'h0 ; */ -/*description: Toggling this bit will trigger a software sync*/ -#define MCPWM_TIMER2_SYNC_SW (BIT(1)) -#define MCPWM_TIMER2_SYNC_SW_M (BIT(1)) -#define MCPWM_TIMER2_SYNC_SW_V 0x1 -#define MCPWM_TIMER2_SYNC_SW_S 1 -/* MCPWM_TIMER2_SYNCI_EN : R/W ;bitpos:[0] ;default: 1'h0 ; */ -/*description: When set timer reload with phase on sync input event is enabled*/ -#define MCPWM_TIMER2_SYNCI_EN (BIT(0)) -#define MCPWM_TIMER2_SYNCI_EN_M (BIT(0)) -#define MCPWM_TIMER2_SYNCI_EN_V 0x1 -#define MCPWM_TIMER2_SYNCI_EN_S 0 - -#define MCPWM_TIMER2_STATUS_REG(i) (REG_MCPWM_BASE(i) + 0x0030) -/* MCPWM_TIMER2_DIRECTION : RO ;bitpos:[16] ;default: 1'd0 ; */ -/*description: Current PWM timer2 counter direction 0: increment 1: decrement*/ -#define MCPWM_TIMER2_DIRECTION (BIT(16)) -#define MCPWM_TIMER2_DIRECTION_M (BIT(16)) -#define MCPWM_TIMER2_DIRECTION_V 0x1 -#define MCPWM_TIMER2_DIRECTION_S 16 -/* MCPWM_TIMER2_VALUE : RO ;bitpos:[15:0] ;default: 16'd0 ; */ -/*description: Current PWM timer2 counter value*/ -#define MCPWM_TIMER2_VALUE 0x0000FFFF -#define MCPWM_TIMER2_VALUE_M ((MCPWM_TIMER2_VALUE_V)<<(MCPWM_TIMER2_VALUE_S)) -#define MCPWM_TIMER2_VALUE_V 0xFFFF -#define MCPWM_TIMER2_VALUE_S 0 - -#define MCPWM_TIMER_SYNCI_CFG_REG(i) (REG_MCPWM_BASE(i) + 0x0034) -/* MCPWM_EXTERNAL_SYNCI2_INVERT : R/W ;bitpos:[11] ;default: 1'd0 ; */ -/*description: Onvert SYNC2 from GPIO matrix*/ -#define MCPWM_EXTERNAL_SYNCI2_INVERT (BIT(11)) -#define MCPWM_EXTERNAL_SYNCI2_INVERT_M (BIT(11)) -#define MCPWM_EXTERNAL_SYNCI2_INVERT_V 0x1 -#define MCPWM_EXTERNAL_SYNCI2_INVERT_S 11 -/* MCPWM_EXTERNAL_SYNCI1_INVERT : R/W ;bitpos:[10] ;default: 1'd0 ; */ -/*description: Invert SYNC1 from GPIO matrix*/ -#define MCPWM_EXTERNAL_SYNCI1_INVERT (BIT(10)) -#define MCPWM_EXTERNAL_SYNCI1_INVERT_M (BIT(10)) -#define MCPWM_EXTERNAL_SYNCI1_INVERT_V 0x1 -#define MCPWM_EXTERNAL_SYNCI1_INVERT_S 10 -/* MCPWM_EXTERNAL_SYNCI0_INVERT : R/W ;bitpos:[9] ;default: 1'd0 ; */ -/*description: Invert SYNC0 from GPIO matrix*/ -#define MCPWM_EXTERNAL_SYNCI0_INVERT (BIT(9)) -#define MCPWM_EXTERNAL_SYNCI0_INVERT_M (BIT(9)) -#define MCPWM_EXTERNAL_SYNCI0_INVERT_V 0x1 -#define MCPWM_EXTERNAL_SYNCI0_INVERT_S 9 -/* MCPWM_TIMER2_SYNCISEL : R/W ;bitpos:[8:6] ;default: 3'd0 ; */ -/*description: Select sync input for PWM timer2 1: PWM timer0 synco 2: PWM - timer1 synco 3: PWM timer2 synco 4: SYNC0 from GPIO matrix 5: SYNC1 from GPIO matrix 6: SYNC2 from GPIO matrix other values: no sync input selected*/ -#define MCPWM_TIMER2_SYNCISEL 0x00000007 -#define MCPWM_TIMER2_SYNCISEL_M ((MCPWM_TIMER2_SYNCISEL_V)<<(MCPWM_TIMER2_SYNCISEL_S)) -#define MCPWM_TIMER2_SYNCISEL_V 0x7 -#define MCPWM_TIMER2_SYNCISEL_S 6 -/* MCPWM_TIMER1_SYNCISEL : R/W ;bitpos:[5:3] ;default: 3'd0 ; */ -/*description: Select sync input for PWM timer1 1: PWM timer0 synco 2: PWM - timer1 synco 3: PWM timer2 synco 4: SYNC0 from GPIO matrix 5: SYNC1 from GPIO matrix 6: SYNC2 from GPIO matrix other values: no sync input selected*/ -#define MCPWM_TIMER1_SYNCISEL 0x00000007 -#define MCPWM_TIMER1_SYNCISEL_M ((MCPWM_TIMER1_SYNCISEL_V)<<(MCPWM_TIMER1_SYNCISEL_S)) -#define MCPWM_TIMER1_SYNCISEL_V 0x7 -#define MCPWM_TIMER1_SYNCISEL_S 3 -/* MCPWM_TIMER0_SYNCISEL : R/W ;bitpos:[2:0] ;default: 3'd0 ; */ -/*description: Select sync input for PWM timer0 1: PWM timer0 synco 2: PWM - timer1 synco 3: PWM timer2 synco 4: SYNC0 from GPIO matrix 5: SYNC1 from GPIO matrix 6: SYNC2 from GPIO matrix other values: no sync input selected*/ -#define MCPWM_TIMER0_SYNCISEL 0x00000007 -#define MCPWM_TIMER0_SYNCISEL_M ((MCPWM_TIMER0_SYNCISEL_V)<<(MCPWM_TIMER0_SYNCISEL_S)) -#define MCPWM_TIMER0_SYNCISEL_V 0x7 -#define MCPWM_TIMER0_SYNCISEL_S 0 - -#define MCPWM_OPERATOR_TIMERSEL_REG(i) (REG_MCPWM_BASE(i) + 0x0038) -/* MCPWM_OPERATOR2_TIMERSEL : R/W ;bitpos:[5:4] ;default: 2'd0 ; */ -/*description: Select which PWM timer's is the timing reference for PWM operator2 - 0: timer0 1: timer1 2: timer2*/ -#define MCPWM_OPERATOR2_TIMERSEL 0x00000003 -#define MCPWM_OPERATOR2_TIMERSEL_M ((MCPWM_OPERATOR2_TIMERSEL_V)<<(MCPWM_OPERATOR2_TIMERSEL_S)) -#define MCPWM_OPERATOR2_TIMERSEL_V 0x3 -#define MCPWM_OPERATOR2_TIMERSEL_S 4 -/* MCPWM_OPERATOR1_TIMERSEL : R/W ;bitpos:[3:2] ;default: 2'd0 ; */ -/*description: Select which PWM timer's is the timing reference for PWM operator1 - 0: timer0 1: timer1 2: timer2*/ -#define MCPWM_OPERATOR1_TIMERSEL 0x00000003 -#define MCPWM_OPERATOR1_TIMERSEL_M ((MCPWM_OPERATOR1_TIMERSEL_V)<<(MCPWM_OPERATOR1_TIMERSEL_S)) -#define MCPWM_OPERATOR1_TIMERSEL_V 0x3 -#define MCPWM_OPERATOR1_TIMERSEL_S 2 -/* MCPWM_OPERATOR0_TIMERSEL : R/W ;bitpos:[1:0] ;default: 2'd0 ; */ -/*description: Select which PWM timer's is the timing reference for PWM operator0 - 0: timer0 1: timer1 2: timer2*/ -#define MCPWM_OPERATOR0_TIMERSEL 0x00000003 -#define MCPWM_OPERATOR0_TIMERSEL_M ((MCPWM_OPERATOR0_TIMERSEL_V)<<(MCPWM_OPERATOR0_TIMERSEL_S)) -#define MCPWM_OPERATOR0_TIMERSEL_V 0x3 -#define MCPWM_OPERATOR0_TIMERSEL_S 0 - -#define MCPWM_GEN0_STMP_CFG_REG(i) (REG_MCPWM_BASE(i) + 0x003c) -/* MCPWM_GEN0_B_SHDW_FULL : RO ;bitpos:[9] ;default: 1'd0 ; */ -/*description: Set and reset by hardware. If set PWM generator 0 time stamp - B's shadow reg is filled and waiting to be transferred to B's active reg. If cleared B's active reg has been updated with shadow reg latest value*/ -#define MCPWM_GEN0_B_SHDW_FULL (BIT(9)) -#define MCPWM_GEN0_B_SHDW_FULL_M (BIT(9)) -#define MCPWM_GEN0_B_SHDW_FULL_V 0x1 -#define MCPWM_GEN0_B_SHDW_FULL_S 9 -/* MCPWM_GEN0_A_SHDW_FULL : RO ;bitpos:[8] ;default: 1'd0 ; */ -/*description: Set and reset by hardware. If set PWM generator 0 time stamp - A's shadow reg is filled and waiting to be transferred to A's active reg. If cleared A's active reg has been updated with shadow reg latest value*/ -#define MCPWM_GEN0_A_SHDW_FULL (BIT(8)) -#define MCPWM_GEN0_A_SHDW_FULL_M (BIT(8)) -#define MCPWM_GEN0_A_SHDW_FULL_V 0x1 -#define MCPWM_GEN0_A_SHDW_FULL_S 8 -/* MCPWM_GEN0_B_UPMETHOD : R/W ;bitpos:[7:4] ;default: 4'd0 ; */ -/*description: Update method for PWM generator 0 time stamp B's active reg. - 0: immediate bit0: TEZ bit1: TEP bit2: sync bit3: disable update*/ -#define MCPWM_GEN0_B_UPMETHOD 0x0000000F -#define MCPWM_GEN0_B_UPMETHOD_M ((MCPWM_GEN0_B_UPMETHOD_V)<<(MCPWM_GEN0_B_UPMETHOD_S)) -#define MCPWM_GEN0_B_UPMETHOD_V 0xF -#define MCPWM_GEN0_B_UPMETHOD_S 4 -/* MCPWM_GEN0_A_UPMETHOD : R/W ;bitpos:[3:0] ;default: 4'd0 ; */ -/*description: Update method for PWM generator 0 time stamp A's active reg. - 0: immediate bit0: TEZ bit1: TEP bit2: sync bit3: disable update*/ -#define MCPWM_GEN0_A_UPMETHOD 0x0000000F -#define MCPWM_GEN0_A_UPMETHOD_M ((MCPWM_GEN0_A_UPMETHOD_V)<<(MCPWM_GEN0_A_UPMETHOD_S)) -#define MCPWM_GEN0_A_UPMETHOD_V 0xF -#define MCPWM_GEN0_A_UPMETHOD_S 0 - -#define MCPWM_GEN0_TSTMP_A_REG(i) (REG_MCPWM_BASE(i) + 0x0040) -/* MCPWM_GEN0_A : R/W ;bitpos:[15:0] ;default: 16'd0 ; */ -/*description: PWM generator 0 time stamp A's shadow reg*/ -#define MCPWM_GEN0_A 0x0000FFFF -#define MCPWM_GEN0_A_M ((MCPWM_GEN0_A_V)<<(MCPWM_GEN0_A_S)) -#define MCPWM_GEN0_A_V 0xFFFF -#define MCPWM_GEN0_A_S 0 - -#define MCPWM_GEN0_TSTMP_B_REG(i) (REG_MCPWM_BASE(i) + 0x0044) -/* MCPWM_GEN0_B : R/W ;bitpos:[15:0] ;default: 16'd0 ; */ -/*description: PWM generator 0 time stamp B's shadow reg*/ -#define MCPWM_GEN0_B 0x0000FFFF -#define MCPWM_GEN0_B_M ((MCPWM_GEN0_B_V)<<(MCPWM_GEN0_B_S)) -#define MCPWM_GEN0_B_V 0xFFFF -#define MCPWM_GEN0_B_S 0 - -#define MCPWM_GEN0_CFG0_REG(i) (REG_MCPWM_BASE(i) + 0x0048) -/* MCPWM_GEN0_T1_SEL : R/W ;bitpos:[9:7] ;default: 3'd0 ; */ -/*description: Source selection for PWM generator 0 event_t1 take effect immediately - 0: fault_event0 1: fault_event1 2: fault_event2 3: sync_taken 4: none*/ -#define MCPWM_GEN0_T1_SEL 0x00000007 -#define MCPWM_GEN0_T1_SEL_M ((MCPWM_GEN0_T1_SEL_V)<<(MCPWM_GEN0_T1_SEL_S)) -#define MCPWM_GEN0_T1_SEL_V 0x7 -#define MCPWM_GEN0_T1_SEL_S 7 -/* MCPWM_GEN0_T0_SEL : R/W ;bitpos:[6:4] ;default: 3'd0 ; */ -/*description: Source selection for PWM generator 0 event_t0 take effect immediately - 0: fault_event0 1: fault_event1 2: fault_event2 3: sync_taken 4: none*/ -#define MCPWM_GEN0_T0_SEL 0x00000007 -#define MCPWM_GEN0_T0_SEL_M ((MCPWM_GEN0_T0_SEL_V)<<(MCPWM_GEN0_T0_SEL_S)) -#define MCPWM_GEN0_T0_SEL_V 0x7 -#define MCPWM_GEN0_T0_SEL_S 4 -/* MCPWM_GEN0_CFG_UPMETHOD : R/W ;bitpos:[3:0] ;default: 4'd0 ; */ -/*description: Update method for PWM generator 0's active reg of configuration. - 0: immediate bit0: TEZ bit1: TEP bit2: sync. bit3: disable update*/ -#define MCPWM_GEN0_CFG_UPMETHOD 0x0000000F -#define MCPWM_GEN0_CFG_UPMETHOD_M ((MCPWM_GEN0_CFG_UPMETHOD_V)<<(MCPWM_GEN0_CFG_UPMETHOD_S)) -#define MCPWM_GEN0_CFG_UPMETHOD_V 0xF -#define MCPWM_GEN0_CFG_UPMETHOD_S 0 - -#define MCPWM_GEN0_FORCE_REG(i) (REG_MCPWM_BASE(i) + 0x004c) -/* MCPWM_GEN0_B_NCIFORCE_MODE : R/W ;bitpos:[15:14] ;default: 2'd0 ; */ -/*description: Non-continuous immediate software force mode for PWM0B 0: disabled - 1: low 2: high 3: disabled*/ -#define MCPWM_GEN0_B_NCIFORCE_MODE 0x00000003 -#define MCPWM_GEN0_B_NCIFORCE_MODE_M ((MCPWM_GEN0_B_NCIFORCE_MODE_V)<<(MCPWM_GEN0_B_NCIFORCE_MODE_S)) -#define MCPWM_GEN0_B_NCIFORCE_MODE_V 0x3 -#define MCPWM_GEN0_B_NCIFORCE_MODE_S 14 -/* MCPWM_GEN0_B_NCIFORCE : R/W ;bitpos:[13] ;default: 1'd0 ; */ -/*description: Non-continuous immediate software force trigger for PWM0B a - toggle will trigger a force event*/ -#define MCPWM_GEN0_B_NCIFORCE (BIT(13)) -#define MCPWM_GEN0_B_NCIFORCE_M (BIT(13)) -#define MCPWM_GEN0_B_NCIFORCE_V 0x1 -#define MCPWM_GEN0_B_NCIFORCE_S 13 -/* MCPWM_GEN0_A_NCIFORCE_MODE : R/W ;bitpos:[12:11] ;default: 2'd0 ; */ -/*description: Non-continuous immediate software force mode for PWM0A 0: disabled - 1: low 2: high 3: disabled*/ -#define MCPWM_GEN0_A_NCIFORCE_MODE 0x00000003 -#define MCPWM_GEN0_A_NCIFORCE_MODE_M ((MCPWM_GEN0_A_NCIFORCE_MODE_V)<<(MCPWM_GEN0_A_NCIFORCE_MODE_S)) -#define MCPWM_GEN0_A_NCIFORCE_MODE_V 0x3 -#define MCPWM_GEN0_A_NCIFORCE_MODE_S 11 -/* MCPWM_GEN0_A_NCIFORCE : R/W ;bitpos:[10] ;default: 1'd0 ; */ -/*description: Non-continuous immediate software force trigger for PWM0A a - toggle will trigger a force event*/ -#define MCPWM_GEN0_A_NCIFORCE (BIT(10)) -#define MCPWM_GEN0_A_NCIFORCE_M (BIT(10)) -#define MCPWM_GEN0_A_NCIFORCE_V 0x1 -#define MCPWM_GEN0_A_NCIFORCE_S 10 -/* MCPWM_GEN0_B_CNTUFORCE_MODE : R/W ;bitpos:[9:8] ;default: 2'd0 ; */ -/*description: Continuous software force mode for PWM0B. 0: disabled 1: low - 2: high 3: disabled*/ -#define MCPWM_GEN0_B_CNTUFORCE_MODE 0x00000003 -#define MCPWM_GEN0_B_CNTUFORCE_MODE_M ((MCPWM_GEN0_B_CNTUFORCE_MODE_V)<<(MCPWM_GEN0_B_CNTUFORCE_MODE_S)) -#define MCPWM_GEN0_B_CNTUFORCE_MODE_V 0x3 -#define MCPWM_GEN0_B_CNTUFORCE_MODE_S 8 -/* MCPWM_GEN0_A_CNTUFORCE_MODE : R/W ;bitpos:[7:6] ;default: 2'd0 ; */ -/*description: Continuous software force mode for PWM0A. 0: disabled 1: low - 2: high 3: disabled*/ -#define MCPWM_GEN0_A_CNTUFORCE_MODE 0x00000003 -#define MCPWM_GEN0_A_CNTUFORCE_MODE_M ((MCPWM_GEN0_A_CNTUFORCE_MODE_V)<<(MCPWM_GEN0_A_CNTUFORCE_MODE_S)) -#define MCPWM_GEN0_A_CNTUFORCE_MODE_V 0x3 -#define MCPWM_GEN0_A_CNTUFORCE_MODE_S 6 -/* MCPWM_GEN0_CNTUFORCE_UPMETHOD : R/W ;bitpos:[5:0] ;default: 6'h20 ; */ -/*description: Update method for continuous software force of PWM generator0. - 0: immediate bit0: TEZ bit1: TEP bit2: TEA bit3: TEB bit4: sync bit5: disable update. (TEA/B here and below means an event generated when timer value equals A/B register)*/ -#define MCPWM_GEN0_CNTUFORCE_UPMETHOD 0x0000003F -#define MCPWM_GEN0_CNTUFORCE_UPMETHOD_M ((MCPWM_GEN0_CNTUFORCE_UPMETHOD_V)<<(MCPWM_GEN0_CNTUFORCE_UPMETHOD_S)) -#define MCPWM_GEN0_CNTUFORCE_UPMETHOD_V 0x3F -#define MCPWM_GEN0_CNTUFORCE_UPMETHOD_S 0 - -#define MCPWM_GEN0_A_REG(i) (REG_MCPWM_BASE(i) + 0x0050) -/* MCPWM_GEN0_A_DT1 : R/W ;bitpos:[23:22] ;default: 2'd0 ; */ -/*description: Action on PWM0A triggered by event_t1 when timer decreasing. - 0: no change 1: low 2: high 3: toggle*/ -#define MCPWM_GEN0_A_DT1 0x00000003 -#define MCPWM_GEN0_A_DT1_M ((MCPWM_GEN0_A_DT1_V)<<(MCPWM_GEN0_A_DT1_S)) -#define MCPWM_GEN0_A_DT1_V 0x3 -#define MCPWM_GEN0_A_DT1_S 22 -/* MCPWM_GEN0_A_DT0 : R/W ;bitpos:[21:20] ;default: 2'd0 ; */ -/*description: Action on PWM0A triggered by event_t0 when timer decreasing*/ -#define MCPWM_GEN0_A_DT0 0x00000003 -#define MCPWM_GEN0_A_DT0_M ((MCPWM_GEN0_A_DT0_V)<<(MCPWM_GEN0_A_DT0_S)) -#define MCPWM_GEN0_A_DT0_V 0x3 -#define MCPWM_GEN0_A_DT0_S 20 -/* MCPWM_GEN0_A_DTEB : R/W ;bitpos:[19:18] ;default: 2'd0 ; */ -/*description: Action on PWM0A triggered by event TEB when timer decreasing*/ -#define MCPWM_GEN0_A_DTEB 0x00000003 -#define MCPWM_GEN0_A_DTEB_M ((MCPWM_GEN0_A_DTEB_V)<<(MCPWM_GEN0_A_DTEB_S)) -#define MCPWM_GEN0_A_DTEB_V 0x3 -#define MCPWM_GEN0_A_DTEB_S 18 -/* MCPWM_GEN0_A_DTEA : R/W ;bitpos:[17:16] ;default: 2'd0 ; */ -/*description: Action on PWM0A triggered by event TEA when timer decreasing*/ -#define MCPWM_GEN0_A_DTEA 0x00000003 -#define MCPWM_GEN0_A_DTEA_M ((MCPWM_GEN0_A_DTEA_V)<<(MCPWM_GEN0_A_DTEA_S)) -#define MCPWM_GEN0_A_DTEA_V 0x3 -#define MCPWM_GEN0_A_DTEA_S 16 -/* MCPWM_GEN0_A_DTEP : R/W ;bitpos:[15:14] ;default: 2'd0 ; */ -/*description: Action on PWM0A triggered by event TEP when timer decreasing*/ -#define MCPWM_GEN0_A_DTEP 0x00000003 -#define MCPWM_GEN0_A_DTEP_M ((MCPWM_GEN0_A_DTEP_V)<<(MCPWM_GEN0_A_DTEP_S)) -#define MCPWM_GEN0_A_DTEP_V 0x3 -#define MCPWM_GEN0_A_DTEP_S 14 -/* MCPWM_GEN0_A_DTEZ : R/W ;bitpos:[13:12] ;default: 2'd0 ; */ -/*description: Action on PWM0A triggered by event TEZ when timer decreasing*/ -#define MCPWM_GEN0_A_DTEZ 0x00000003 -#define MCPWM_GEN0_A_DTEZ_M ((MCPWM_GEN0_A_DTEZ_V)<<(MCPWM_GEN0_A_DTEZ_S)) -#define MCPWM_GEN0_A_DTEZ_V 0x3 -#define MCPWM_GEN0_A_DTEZ_S 12 -/* MCPWM_GEN0_A_UT1 : R/W ;bitpos:[11:10] ;default: 2'd0 ; */ -/*description: Action on PWM0A triggered by event_t1 when timer increasing*/ -#define MCPWM_GEN0_A_UT1 0x00000003 -#define MCPWM_GEN0_A_UT1_M ((MCPWM_GEN0_A_UT1_V)<<(MCPWM_GEN0_A_UT1_S)) -#define MCPWM_GEN0_A_UT1_V 0x3 -#define MCPWM_GEN0_A_UT1_S 10 -/* MCPWM_GEN0_A_UT0 : R/W ;bitpos:[9:8] ;default: 2'd0 ; */ -/*description: Action on PWM0A triggered by event_t0 when timer increasing*/ -#define MCPWM_GEN0_A_UT0 0x00000003 -#define MCPWM_GEN0_A_UT0_M ((MCPWM_GEN0_A_UT0_V)<<(MCPWM_GEN0_A_UT0_S)) -#define MCPWM_GEN0_A_UT0_V 0x3 -#define MCPWM_GEN0_A_UT0_S 8 -/* MCPWM_GEN0_A_UTEB : R/W ;bitpos:[7:6] ;default: 2'd0 ; */ -/*description: Action on PWM0A triggered by event TEB when timer increasing*/ -#define MCPWM_GEN0_A_UTEB 0x00000003 -#define MCPWM_GEN0_A_UTEB_M ((MCPWM_GEN0_A_UTEB_V)<<(MCPWM_GEN0_A_UTEB_S)) -#define MCPWM_GEN0_A_UTEB_V 0x3 -#define MCPWM_GEN0_A_UTEB_S 6 -/* MCPWM_GEN0_A_UTEA : R/W ;bitpos:[5:4] ;default: 2'd0 ; */ -/*description: Action on PWM0A triggered by event TEA when timer increasing*/ -#define MCPWM_GEN0_A_UTEA 0x00000003 -#define MCPWM_GEN0_A_UTEA_M ((MCPWM_GEN0_A_UTEA_V)<<(MCPWM_GEN0_A_UTEA_S)) -#define MCPWM_GEN0_A_UTEA_V 0x3 -#define MCPWM_GEN0_A_UTEA_S 4 -/* MCPWM_GEN0_A_UTEP : R/W ;bitpos:[3:2] ;default: 2'd0 ; */ -/*description: Action on PWM0A triggered by event TEP when timer increasing*/ -#define MCPWM_GEN0_A_UTEP 0x00000003 -#define MCPWM_GEN0_A_UTEP_M ((MCPWM_GEN0_A_UTEP_V)<<(MCPWM_GEN0_A_UTEP_S)) -#define MCPWM_GEN0_A_UTEP_V 0x3 -#define MCPWM_GEN0_A_UTEP_S 2 -/* MCPWM_GEN0_A_UTEZ : R/W ;bitpos:[1:0] ;default: 2'd0 ; */ -/*description: Action on PWM0A triggered by event TEZ when timer increasing*/ -#define MCPWM_GEN0_A_UTEZ 0x00000003 -#define MCPWM_GEN0_A_UTEZ_M ((MCPWM_GEN0_A_UTEZ_V)<<(MCPWM_GEN0_A_UTEZ_S)) -#define MCPWM_GEN0_A_UTEZ_V 0x3 -#define MCPWM_GEN0_A_UTEZ_S 0 - -#define MCPWM_GEN0_B_REG(i) (REG_MCPWM_BASE(i) + 0x0054) -/* MCPWM_GEN0_B_DT1 : R/W ;bitpos:[23:22] ;default: 2'd0 ; */ -/*description: Action on PWM0B triggered by event_t1 when timer decreasing. - 0: no change 1: low 2: high 3: toggle*/ -#define MCPWM_GEN0_B_DT1 0x00000003 -#define MCPWM_GEN0_B_DT1_M ((MCPWM_GEN0_B_DT1_V)<<(MCPWM_GEN0_B_DT1_S)) -#define MCPWM_GEN0_B_DT1_V 0x3 -#define MCPWM_GEN0_B_DT1_S 22 -/* MCPWM_GEN0_B_DT0 : R/W ;bitpos:[21:20] ;default: 2'd0 ; */ -/*description: Action on PWM0B triggered by event_t0 when timer decreasing*/ -#define MCPWM_GEN0_B_DT0 0x00000003 -#define MCPWM_GEN0_B_DT0_M ((MCPWM_GEN0_B_DT0_V)<<(MCPWM_GEN0_B_DT0_S)) -#define MCPWM_GEN0_B_DT0_V 0x3 -#define MCPWM_GEN0_B_DT0_S 20 -/* MCPWM_GEN0_B_DTEB : R/W ;bitpos:[19:18] ;default: 2'd0 ; */ -/*description: Action on PWM0B triggered by event TEB when timer decreasing*/ -#define MCPWM_GEN0_B_DTEB 0x00000003 -#define MCPWM_GEN0_B_DTEB_M ((MCPWM_GEN0_B_DTEB_V)<<(MCPWM_GEN0_B_DTEB_S)) -#define MCPWM_GEN0_B_DTEB_V 0x3 -#define MCPWM_GEN0_B_DTEB_S 18 -/* MCPWM_GEN0_B_DTEA : R/W ;bitpos:[17:16] ;default: 2'd0 ; */ -/*description: Action on PWM0B triggered by event TEA when timer decreasing*/ -#define MCPWM_GEN0_B_DTEA 0x00000003 -#define MCPWM_GEN0_B_DTEA_M ((MCPWM_GEN0_B_DTEA_V)<<(MCPWM_GEN0_B_DTEA_S)) -#define MCPWM_GEN0_B_DTEA_V 0x3 -#define MCPWM_GEN0_B_DTEA_S 16 -/* MCPWM_GEN0_B_DTEP : R/W ;bitpos:[15:14] ;default: 2'd0 ; */ -/*description: Action on PWM0B triggered by event TEP when timer decreasing*/ -#define MCPWM_GEN0_B_DTEP 0x00000003 -#define MCPWM_GEN0_B_DTEP_M ((MCPWM_GEN0_B_DTEP_V)<<(MCPWM_GEN0_B_DTEP_S)) -#define MCPWM_GEN0_B_DTEP_V 0x3 -#define MCPWM_GEN0_B_DTEP_S 14 -/* MCPWM_GEN0_B_DTEZ : R/W ;bitpos:[13:12] ;default: 2'd0 ; */ -/*description: Action on PWM0B triggered by event TEZ when timer decreasing*/ -#define MCPWM_GEN0_B_DTEZ 0x00000003 -#define MCPWM_GEN0_B_DTEZ_M ((MCPWM_GEN0_B_DTEZ_V)<<(MCPWM_GEN0_B_DTEZ_S)) -#define MCPWM_GEN0_B_DTEZ_V 0x3 -#define MCPWM_GEN0_B_DTEZ_S 12 -/* MCPWM_GEN0_B_UT1 : R/W ;bitpos:[11:10] ;default: 2'd0 ; */ -/*description: Action on PWM0B triggered by event_t1 when timer increasing*/ -#define MCPWM_GEN0_B_UT1 0x00000003 -#define MCPWM_GEN0_B_UT1_M ((MCPWM_GEN0_B_UT1_V)<<(MCPWM_GEN0_B_UT1_S)) -#define MCPWM_GEN0_B_UT1_V 0x3 -#define MCPWM_GEN0_B_UT1_S 10 -/* MCPWM_GEN0_B_UT0 : R/W ;bitpos:[9:8] ;default: 2'd0 ; */ -/*description: Action on PWM0B triggered by event_t0 when timer increasing*/ -#define MCPWM_GEN0_B_UT0 0x00000003 -#define MCPWM_GEN0_B_UT0_M ((MCPWM_GEN0_B_UT0_V)<<(MCPWM_GEN0_B_UT0_S)) -#define MCPWM_GEN0_B_UT0_V 0x3 -#define MCPWM_GEN0_B_UT0_S 8 -/* MCPWM_GEN0_B_UTEB : R/W ;bitpos:[7:6] ;default: 2'd0 ; */ -/*description: Action on PWM0B triggered by event TEB when timer increasing*/ -#define MCPWM_GEN0_B_UTEB 0x00000003 -#define MCPWM_GEN0_B_UTEB_M ((MCPWM_GEN0_B_UTEB_V)<<(MCPWM_GEN0_B_UTEB_S)) -#define MCPWM_GEN0_B_UTEB_V 0x3 -#define MCPWM_GEN0_B_UTEB_S 6 -/* MCPWM_GEN0_B_UTEA : R/W ;bitpos:[5:4] ;default: 2'd0 ; */ -/*description: Action on PWM0B triggered by event TEA when timer increasing*/ -#define MCPWM_GEN0_B_UTEA 0x00000003 -#define MCPWM_GEN0_B_UTEA_M ((MCPWM_GEN0_B_UTEA_V)<<(MCPWM_GEN0_B_UTEA_S)) -#define MCPWM_GEN0_B_UTEA_V 0x3 -#define MCPWM_GEN0_B_UTEA_S 4 -/* MCPWM_GEN0_B_UTEP : R/W ;bitpos:[3:2] ;default: 2'd0 ; */ -/*description: Action on PWM0B triggered by event TEP when timer increasing*/ -#define MCPWM_GEN0_B_UTEP 0x00000003 -#define MCPWM_GEN0_B_UTEP_M ((MCPWM_GEN0_B_UTEP_V)<<(MCPWM_GEN0_B_UTEP_S)) -#define MCPWM_GEN0_B_UTEP_V 0x3 -#define MCPWM_GEN0_B_UTEP_S 2 -/* MCPWM_GEN0_B_UTEZ : R/W ;bitpos:[1:0] ;default: 2'd0 ; */ -/*description: Action on PWM0B triggered by event TEZ when timer increasing*/ -#define MCPWM_GEN0_B_UTEZ 0x00000003 -#define MCPWM_GEN0_B_UTEZ_M ((MCPWM_GEN0_B_UTEZ_V)<<(MCPWM_GEN0_B_UTEZ_S)) -#define MCPWM_GEN0_B_UTEZ_V 0x3 -#define MCPWM_GEN0_B_UTEZ_S 0 - -#define MCPWM_DT0_CFG_REG(i) (REG_MCPWM_BASE(i) + 0x0058) -/* MCPWM_DT0_CLK_SEL : R/W ;bitpos:[17] ;default: 1'd0 ; */ -/*description: Dead time generator 0 clock selection. 0: PWM_clk 1: PT_clk*/ -#define MCPWM_DT0_CLK_SEL (BIT(17)) -#define MCPWM_DT0_CLK_SEL_M (BIT(17)) -#define MCPWM_DT0_CLK_SEL_V 0x1 -#define MCPWM_DT0_CLK_SEL_S 17 -/* MCPWM_DT0_B_OUTBYPASS : R/W ;bitpos:[16] ;default: 1'd1 ; */ -/*description: S0 in documentation*/ -#define MCPWM_DT0_B_OUTBYPASS (BIT(16)) -#define MCPWM_DT0_B_OUTBYPASS_M (BIT(16)) -#define MCPWM_DT0_B_OUTBYPASS_V 0x1 -#define MCPWM_DT0_B_OUTBYPASS_S 16 -/* MCPWM_DT0_A_OUTBYPASS : R/W ;bitpos:[15] ;default: 1'd1 ; */ -/*description: S1 in documentation*/ -#define MCPWM_DT0_A_OUTBYPASS (BIT(15)) -#define MCPWM_DT0_A_OUTBYPASS_M (BIT(15)) -#define MCPWM_DT0_A_OUTBYPASS_V 0x1 -#define MCPWM_DT0_A_OUTBYPASS_S 15 -/* MCPWM_DT0_FED_OUTINVERT : R/W ;bitpos:[14] ;default: 1'd0 ; */ -/*description: S3 in documentation*/ -#define MCPWM_DT0_FED_OUTINVERT (BIT(14)) -#define MCPWM_DT0_FED_OUTINVERT_M (BIT(14)) -#define MCPWM_DT0_FED_OUTINVERT_V 0x1 -#define MCPWM_DT0_FED_OUTINVERT_S 14 -/* MCPWM_DT0_RED_OUTINVERT : R/W ;bitpos:[13] ;default: 1'd0 ; */ -/*description: S2 in documentation*/ -#define MCPWM_DT0_RED_OUTINVERT (BIT(13)) -#define MCPWM_DT0_RED_OUTINVERT_M (BIT(13)) -#define MCPWM_DT0_RED_OUTINVERT_V 0x1 -#define MCPWM_DT0_RED_OUTINVERT_S 13 -/* MCPWM_DT0_FED_INSEL : R/W ;bitpos:[12] ;default: 1'd0 ; */ -/*description: S5 in documentation*/ -#define MCPWM_DT0_FED_INSEL (BIT(12)) -#define MCPWM_DT0_FED_INSEL_M (BIT(12)) -#define MCPWM_DT0_FED_INSEL_V 0x1 -#define MCPWM_DT0_FED_INSEL_S 12 -/* MCPWM_DT0_RED_INSEL : R/W ;bitpos:[11] ;default: 1'd0 ; */ -/*description: S4 in documentation*/ -#define MCPWM_DT0_RED_INSEL (BIT(11)) -#define MCPWM_DT0_RED_INSEL_M (BIT(11)) -#define MCPWM_DT0_RED_INSEL_V 0x1 -#define MCPWM_DT0_RED_INSEL_S 11 -/* MCPWM_DT0_B_OUTSWAP : R/W ;bitpos:[10] ;default: 1'd0 ; */ -/*description: S7 in documentation*/ -#define MCPWM_DT0_B_OUTSWAP (BIT(10)) -#define MCPWM_DT0_B_OUTSWAP_M (BIT(10)) -#define MCPWM_DT0_B_OUTSWAP_V 0x1 -#define MCPWM_DT0_B_OUTSWAP_S 10 -/* MCPWM_DT0_A_OUTSWAP : R/W ;bitpos:[9] ;default: 1'd0 ; */ -/*description: S6 in documentation*/ -#define MCPWM_DT0_A_OUTSWAP (BIT(9)) -#define MCPWM_DT0_A_OUTSWAP_M (BIT(9)) -#define MCPWM_DT0_A_OUTSWAP_V 0x1 -#define MCPWM_DT0_A_OUTSWAP_S 9 -/* MCPWM_DT0_DEB_MODE : R/W ;bitpos:[8] ;default: 1'd0 ; */ -/*description: S8 in documentation dual-edge B mode 0: FED/RED take effect - on different path separately 1: FED/RED take effect on B path A out is in bypass or normal operation mode*/ -#define MCPWM_DT0_DEB_MODE (BIT(8)) -#define MCPWM_DT0_DEB_MODE_M (BIT(8)) -#define MCPWM_DT0_DEB_MODE_V 0x1 -#define MCPWM_DT0_DEB_MODE_S 8 -/* MCPWM_DT0_RED_UPMETHOD : R/W ;bitpos:[7:4] ;default: 4'd0 ; */ -/*description: Update method for RED (rising edge delay) active reg. 0: immediate - bit0: TEZ bit1: TEP bit2: sync bit3: disable update*/ -#define MCPWM_DT0_RED_UPMETHOD 0x0000000F -#define MCPWM_DT0_RED_UPMETHOD_M ((MCPWM_DT0_RED_UPMETHOD_V)<<(MCPWM_DT0_RED_UPMETHOD_S)) -#define MCPWM_DT0_RED_UPMETHOD_V 0xF -#define MCPWM_DT0_RED_UPMETHOD_S 4 -/* MCPWM_DT0_FED_UPMETHOD : R/W ;bitpos:[3:0] ;default: 4'd0 ; */ -/*description: Update method for FED (falling edge delay) active reg. 0: immediate - bit0: TEZ bit1: TEP bit2: sync bit3: disable update*/ -#define MCPWM_DT0_FED_UPMETHOD 0x0000000F -#define MCPWM_DT0_FED_UPMETHOD_M ((MCPWM_DT0_FED_UPMETHOD_V)<<(MCPWM_DT0_FED_UPMETHOD_S)) -#define MCPWM_DT0_FED_UPMETHOD_V 0xF -#define MCPWM_DT0_FED_UPMETHOD_S 0 - -#define MCPWM_DT0_FED_CFG_REG(i) (REG_MCPWM_BASE(i) + 0x005c) -/* MCPWM_DT0_FED : R/W ;bitpos:[15:0] ;default: 16'd0 ; */ -/*description: Shadow reg for FED*/ -#define MCPWM_DT0_FED 0x0000FFFF -#define MCPWM_DT0_FED_M ((MCPWM_DT0_FED_V)<<(MCPWM_DT0_FED_S)) -#define MCPWM_DT0_FED_V 0xFFFF -#define MCPWM_DT0_FED_S 0 - -#define MCPWM_DT0_RED_CFG_REG(i) (REG_MCPWM_BASE(i) + 0x0060) -/* MCPWM_DT0_RED : R/W ;bitpos:[15:0] ;default: 16'd0 ; */ -/*description: Shadow reg for RED*/ -#define MCPWM_DT0_RED 0x0000FFFF -#define MCPWM_DT0_RED_M ((MCPWM_DT0_RED_V)<<(MCPWM_DT0_RED_S)) -#define MCPWM_DT0_RED_V 0xFFFF -#define MCPWM_DT0_RED_S 0 - -#define MCPWM_CARRIER0_CFG_REG(i) (REG_MCPWM_BASE(i) + 0x0064) -/* MCPWM_CARRIER0_IN_INVERT : R/W ;bitpos:[13] ;default: 1'd0 ; */ -/*description: When set invert the input of PWM0A and PWM0B for this submodule*/ -#define MCPWM_CARRIER0_IN_INVERT (BIT(13)) -#define MCPWM_CARRIER0_IN_INVERT_M (BIT(13)) -#define MCPWM_CARRIER0_IN_INVERT_V 0x1 -#define MCPWM_CARRIER0_IN_INVERT_S 13 -/* MCPWM_CARRIER0_OUT_INVERT : R/W ;bitpos:[12] ;default: 1'd0 ; */ -/*description: When set invert the output of PWM0A and PWM0B for this submodule*/ -#define MCPWM_CARRIER0_OUT_INVERT (BIT(12)) -#define MCPWM_CARRIER0_OUT_INVERT_M (BIT(12)) -#define MCPWM_CARRIER0_OUT_INVERT_V 0x1 -#define MCPWM_CARRIER0_OUT_INVERT_S 12 -/* MCPWM_CARRIER0_OSHWTH : R/W ;bitpos:[11:8] ;default: 4'd0 ; */ -/*description: Width of the fist pulse in number of periods of the carrier*/ -#define MCPWM_CARRIER0_OSHWTH 0x0000000F -#define MCPWM_CARRIER0_OSHWTH_M ((MCPWM_CARRIER0_OSHWTH_V)<<(MCPWM_CARRIER0_OSHWTH_S)) -#define MCPWM_CARRIER0_OSHWTH_V 0xF -#define MCPWM_CARRIER0_OSHWTH_S 8 -/* MCPWM_CARRIER0_DUTY : R/W ;bitpos:[7:5] ;default: 3'd0 ; */ -/*description: Carrier duty selection. Duty = PWM_CARRIER0_DUTY / 8*/ -#define MCPWM_CARRIER0_DUTY 0x00000007 -#define MCPWM_CARRIER0_DUTY_M ((MCPWM_CARRIER0_DUTY_V)<<(MCPWM_CARRIER0_DUTY_S)) -#define MCPWM_CARRIER0_DUTY_V 0x7 -#define MCPWM_CARRIER0_DUTY_S 5 -/* MCPWM_CARRIER0_PRESCALE : R/W ;bitpos:[4:1] ;default: 4'd0 ; */ -/*description: PWM carrier0 clock (PC_clk) prescale value. Period of PC_clk - = period of PWM_clk * (PWM_CARRIER0_PRESCALE + 1)*/ -#define MCPWM_CARRIER0_PRESCALE 0x0000000F -#define MCPWM_CARRIER0_PRESCALE_M ((MCPWM_CARRIER0_PRESCALE_V)<<(MCPWM_CARRIER0_PRESCALE_S)) -#define MCPWM_CARRIER0_PRESCALE_V 0xF -#define MCPWM_CARRIER0_PRESCALE_S 1 -/* MCPWM_CARRIER0_EN : R/W ;bitpos:[0] ;default: 1'd0 ; */ -/*description: When set carrier0 function is enabled. When cleared carrier0 is bypassed*/ -#define MCPWM_CARRIER0_EN (BIT(0)) -#define MCPWM_CARRIER0_EN_M (BIT(0)) -#define MCPWM_CARRIER0_EN_V 0x1 -#define MCPWM_CARRIER0_EN_S 0 - -#define MCPWM_FH0_CFG0_REG(i) (REG_MCPWM_BASE(i) + 0x0068) -/* MCPWM_FH0_B_OST_U : R/W ;bitpos:[23:22] ;default: 2'd0 ; */ -/*description: One-shot mode action on PWM0B when fault event occurs and timer - is increasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ -#define MCPWM_FH0_B_OST_U 0x00000003 -#define MCPWM_FH0_B_OST_U_M ((MCPWM_FH0_B_OST_U_V)<<(MCPWM_FH0_B_OST_U_S)) -#define MCPWM_FH0_B_OST_U_V 0x3 -#define MCPWM_FH0_B_OST_U_S 22 -/* MCPWM_FH0_B_OST_D : R/W ;bitpos:[21:20] ;default: 2'd0 ; */ -/*description: One-shot mode action on PWM0B when fault event occurs and timer - is decreasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ -#define MCPWM_FH0_B_OST_D 0x00000003 -#define MCPWM_FH0_B_OST_D_M ((MCPWM_FH0_B_OST_D_V)<<(MCPWM_FH0_B_OST_D_S)) -#define MCPWM_FH0_B_OST_D_V 0x3 -#define MCPWM_FH0_B_OST_D_S 20 -/* MCPWM_FH0_B_CBC_U : R/W ;bitpos:[19:18] ;default: 2'd0 ; */ -/*description: Cycle-by-cycle mode action on PWM0B when fault event occurs and - timer is increasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ -#define MCPWM_FH0_B_CBC_U 0x00000003 -#define MCPWM_FH0_B_CBC_U_M ((MCPWM_FH0_B_CBC_U_V)<<(MCPWM_FH0_B_CBC_U_S)) -#define MCPWM_FH0_B_CBC_U_V 0x3 -#define MCPWM_FH0_B_CBC_U_S 18 -/* MCPWM_FH0_B_CBC_D : R/W ;bitpos:[17:16] ;default: 2'd0 ; */ -/*description: Cycle-by-cycle mode action on PWM0B when fault event occurs and - timer is decreasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ -#define MCPWM_FH0_B_CBC_D 0x00000003 -#define MCPWM_FH0_B_CBC_D_M ((MCPWM_FH0_B_CBC_D_V)<<(MCPWM_FH0_B_CBC_D_S)) -#define MCPWM_FH0_B_CBC_D_V 0x3 -#define MCPWM_FH0_B_CBC_D_S 16 -/* MCPWM_FH0_A_OST_U : R/W ;bitpos:[15:14] ;default: 2'd0 ; */ -/*description: One-shot mode action on PWM0A when fault event occurs and timer - is increasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ -#define MCPWM_FH0_A_OST_U 0x00000003 -#define MCPWM_FH0_A_OST_U_M ((MCPWM_FH0_A_OST_U_V)<<(MCPWM_FH0_A_OST_U_S)) -#define MCPWM_FH0_A_OST_U_V 0x3 -#define MCPWM_FH0_A_OST_U_S 14 -/* MCPWM_FH0_A_OST_D : R/W ;bitpos:[13:12] ;default: 2'd0 ; */ -/*description: One-shot mode action on PWM0A when fault event occurs and timer - is decreasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ -#define MCPWM_FH0_A_OST_D 0x00000003 -#define MCPWM_FH0_A_OST_D_M ((MCPWM_FH0_A_OST_D_V)<<(MCPWM_FH0_A_OST_D_S)) -#define MCPWM_FH0_A_OST_D_V 0x3 -#define MCPWM_FH0_A_OST_D_S 12 -/* MCPWM_FH0_A_CBC_U : R/W ;bitpos:[11:10] ;default: 2'd0 ; */ -/*description: Cycle-by-cycle mode action on PWM0A when fault event occurs and - timer is increasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ -#define MCPWM_FH0_A_CBC_U 0x00000003 -#define MCPWM_FH0_A_CBC_U_M ((MCPWM_FH0_A_CBC_U_V)<<(MCPWM_FH0_A_CBC_U_S)) -#define MCPWM_FH0_A_CBC_U_V 0x3 -#define MCPWM_FH0_A_CBC_U_S 10 -/* MCPWM_FH0_A_CBC_D : R/W ;bitpos:[9:8] ;default: 2'd0 ; */ -/*description: Cycle-by-cycle mode action on PWM0A when fault event occurs and - timer is decreasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ -#define MCPWM_FH0_A_CBC_D 0x00000003 -#define MCPWM_FH0_A_CBC_D_M ((MCPWM_FH0_A_CBC_D_V)<<(MCPWM_FH0_A_CBC_D_S)) -#define MCPWM_FH0_A_CBC_D_V 0x3 -#define MCPWM_FH0_A_CBC_D_S 8 -/* MCPWM_FH0_F0_OST : R/W ;bitpos:[7] ;default: 1'd0 ; */ -/*description: event_f0 will trigger one-shot mode action. 0: disable 1: enable*/ -#define MCPWM_FH0_F0_OST (BIT(7)) -#define MCPWM_FH0_F0_OST_M (BIT(7)) -#define MCPWM_FH0_F0_OST_V 0x1 -#define MCPWM_FH0_F0_OST_S 7 -/* MCPWM_FH0_F1_OST : R/W ;bitpos:[6] ;default: 1'd0 ; */ -/*description: event_f1 will trigger one-shot mode action. 0: disable 1: enable*/ -#define MCPWM_FH0_F1_OST (BIT(6)) -#define MCPWM_FH0_F1_OST_M (BIT(6)) -#define MCPWM_FH0_F1_OST_V 0x1 -#define MCPWM_FH0_F1_OST_S 6 -/* MCPWM_FH0_F2_OST : R/W ;bitpos:[5] ;default: 1'd0 ; */ -/*description: event_f2 will trigger one-shot mode action. 0: disable 1: enable*/ -#define MCPWM_FH0_F2_OST (BIT(5)) -#define MCPWM_FH0_F2_OST_M (BIT(5)) -#define MCPWM_FH0_F2_OST_V 0x1 -#define MCPWM_FH0_F2_OST_S 5 -/* MCPWM_FH0_SW_OST : R/W ;bitpos:[4] ;default: 1'd0 ; */ -/*description: Enable register for software force one-shot mode action. 0: disable 1: enable*/ -#define MCPWM_FH0_SW_OST (BIT(4)) -#define MCPWM_FH0_SW_OST_M (BIT(4)) -#define MCPWM_FH0_SW_OST_V 0x1 -#define MCPWM_FH0_SW_OST_S 4 -/* MCPWM_FH0_F0_CBC : R/W ;bitpos:[3] ;default: 1'd0 ; */ -/*description: event_f0 will trigger cycle-by-cycle mode action. 0: disable 1: enable*/ -#define MCPWM_FH0_F0_CBC (BIT(3)) -#define MCPWM_FH0_F0_CBC_M (BIT(3)) -#define MCPWM_FH0_F0_CBC_V 0x1 -#define MCPWM_FH0_F0_CBC_S 3 -/* MCPWM_FH0_F1_CBC : R/W ;bitpos:[2] ;default: 1'd0 ; */ -/*description: event_f1 will trigger cycle-by-cycle mode action. 0: disable 1: enable*/ -#define MCPWM_FH0_F1_CBC (BIT(2)) -#define MCPWM_FH0_F1_CBC_M (BIT(2)) -#define MCPWM_FH0_F1_CBC_V 0x1 -#define MCPWM_FH0_F1_CBC_S 2 -/* MCPWM_FH0_F2_CBC : R/W ;bitpos:[1] ;default: 1'd0 ; */ -/*description: event_f2 will trigger cycle-by-cycle mode action. 0: disable 1: enable*/ -#define MCPWM_FH0_F2_CBC (BIT(1)) -#define MCPWM_FH0_F2_CBC_M (BIT(1)) -#define MCPWM_FH0_F2_CBC_V 0x1 -#define MCPWM_FH0_F2_CBC_S 1 -/* MCPWM_FH0_SW_CBC : R/W ;bitpos:[0] ;default: 1'd0 ; */ -/*description: Enable register for software force cycle-by-cycle mode action. - 0: disable 1: enable*/ -#define MCPWM_FH0_SW_CBC (BIT(0)) -#define MCPWM_FH0_SW_CBC_M (BIT(0)) -#define MCPWM_FH0_SW_CBC_V 0x1 -#define MCPWM_FH0_SW_CBC_S 0 - -#define MCPWM_FH0_CFG1_REG(i) (REG_MCPWM_BASE(i) + 0x006c) -/* MCPWM_FH0_FORCE_OST : R/W ;bitpos:[4] ;default: 1'd0 ; */ -/*description: A toggle (software negation of value of this bit) triggers a - one-shot mode action*/ -#define MCPWM_FH0_FORCE_OST (BIT(4)) -#define MCPWM_FH0_FORCE_OST_M (BIT(4)) -#define MCPWM_FH0_FORCE_OST_V 0x1 -#define MCPWM_FH0_FORCE_OST_S 4 -/* MCPWM_FH0_FORCE_CBC : R/W ;bitpos:[3] ;default: 1'd0 ; */ -/*description: A toggle triggers a cycle-by-cycle mode action*/ -#define MCPWM_FH0_FORCE_CBC (BIT(3)) -#define MCPWM_FH0_FORCE_CBC_M (BIT(3)) -#define MCPWM_FH0_FORCE_CBC_V 0x1 -#define MCPWM_FH0_FORCE_CBC_S 3 -/* MCPWM_FH0_CBCPULSE : R/W ;bitpos:[2:1] ;default: 2'd0 ; */ -/*description: The cycle-by-cycle mode action refresh moment selection. Bit0: TEZ bit1:TEP*/ -#define MCPWM_FH0_CBCPULSE 0x00000003 -#define MCPWM_FH0_CBCPULSE_M ((MCPWM_FH0_CBCPULSE_V)<<(MCPWM_FH0_CBCPULSE_S)) -#define MCPWM_FH0_CBCPULSE_V 0x3 -#define MCPWM_FH0_CBCPULSE_S 1 -/* MCPWM_FH0_CLR_OST : R/W ;bitpos:[0] ;default: 1'd0 ; */ -/*description: A toggle will clear on going one-shot mode action*/ -#define MCPWM_FH0_CLR_OST (BIT(0)) -#define MCPWM_FH0_CLR_OST_M (BIT(0)) -#define MCPWM_FH0_CLR_OST_V 0x1 -#define MCPWM_FH0_CLR_OST_S 0 - -#define MCPWM_FH0_STATUS_REG(i) (REG_MCPWM_BASE(i) + 0x0070) -/* MCPWM_FH0_OST_ON : RO ;bitpos:[1] ;default: 1'd0 ; */ -/*description: Set and reset by hardware. If set an one-shot mode action is on going*/ -#define MCPWM_FH0_OST_ON (BIT(1)) -#define MCPWM_FH0_OST_ON_M (BIT(1)) -#define MCPWM_FH0_OST_ON_V 0x1 -#define MCPWM_FH0_OST_ON_S 1 -/* MCPWM_FH0_CBC_ON : RO ;bitpos:[0] ;default: 1'd0 ; */ -/*description: Set and reset by hardware. If set an cycle-by-cycle mode action is on going*/ -#define MCPWM_FH0_CBC_ON (BIT(0)) -#define MCPWM_FH0_CBC_ON_M (BIT(0)) -#define MCPWM_FH0_CBC_ON_V 0x1 -#define MCPWM_FH0_CBC_ON_S 0 - -#define MCPWM_GEN1_STMP_CFG_REG(i) (REG_MCPWM_BASE(i) + 0x0074) -/* MCPWM_GEN1_B_SHDW_FULL : RO ;bitpos:[9] ;default: 1'd0 ; */ -/*description: Set and reset by hardware. If set PWM generator 1 time stamp - B's shadow reg is filled and waiting to be transferred to B's active reg. If cleared B's active reg has been updated with shadow reg latest value*/ -#define MCPWM_GEN1_B_SHDW_FULL (BIT(9)) -#define MCPWM_GEN1_B_SHDW_FULL_M (BIT(9)) -#define MCPWM_GEN1_B_SHDW_FULL_V 0x1 -#define MCPWM_GEN1_B_SHDW_FULL_S 9 -/* MCPWM_GEN1_A_SHDW_FULL : RO ;bitpos:[8] ;default: 1'd0 ; */ -/*description: Set and reset by hardware. If set PWM generator 1 time stamp - A's shadow reg is filled and waiting to be transferred to A's active reg. If cleared A's active reg has been updated with shadow reg latest value*/ -#define MCPWM_GEN1_A_SHDW_FULL (BIT(8)) -#define MCPWM_GEN1_A_SHDW_FULL_M (BIT(8)) -#define MCPWM_GEN1_A_SHDW_FULL_V 0x1 -#define MCPWM_GEN1_A_SHDW_FULL_S 8 -/* MCPWM_GEN1_B_UPMETHOD : R/W ;bitpos:[7:4] ;default: 4'd0 ; */ -/*description: Update method for PWM generator 1 time stamp B's active reg. - 0: immediate bit0: TEZ bit1: TEP bit2: sync bit3: disable update*/ -#define MCPWM_GEN1_B_UPMETHOD 0x0000000F -#define MCPWM_GEN1_B_UPMETHOD_M ((MCPWM_GEN1_B_UPMETHOD_V)<<(MCPWM_GEN1_B_UPMETHOD_S)) -#define MCPWM_GEN1_B_UPMETHOD_V 0xF -#define MCPWM_GEN1_B_UPMETHOD_S 4 -/* MCPWM_GEN1_A_UPMETHOD : R/W ;bitpos:[3:0] ;default: 4'd0 ; */ -/*description: Update method for PWM generator 1 time stamp A's active reg. - 0: immediate bit0: TEZ bit1: TEP bit2: sync bit3: disable update*/ -#define MCPWM_GEN1_A_UPMETHOD 0x0000000F -#define MCPWM_GEN1_A_UPMETHOD_M ((MCPWM_GEN1_A_UPMETHOD_V)<<(MCPWM_GEN1_A_UPMETHOD_S)) -#define MCPWM_GEN1_A_UPMETHOD_V 0xF -#define MCPWM_GEN1_A_UPMETHOD_S 0 - -#define MCPWM_GEN1_TSTMP_A_REG(i) (REG_MCPWM_BASE(i) + 0x0078) -/* MCPWM_GEN1_A : R/W ;bitpos:[15:0] ;default: 16'd0 ; */ -/*description: PWM generator 1 time stamp A's shadow reg*/ -#define MCPWM_GEN1_A 0x0000FFFF -#define MCPWM_GEN1_A_M ((MCPWM_GEN1_A_V)<<(MCPWM_GEN1_A_S)) -#define MCPWM_GEN1_A_V 0xFFFF -#define MCPWM_GEN1_A_S 0 - -#define MCPWM_GEN1_TSTMP_B_REG(i) (REG_MCPWM_BASE(i) + 0x007c) -/* MCPWM_GEN1_B : R/W ;bitpos:[15:0] ;default: 16'd0 ; */ -/*description: PWM generator 1 time stamp B's shadow reg*/ -#define MCPWM_GEN1_B 0x0000FFFF -#define MCPWM_GEN1_B_M ((MCPWM_GEN1_B_V)<<(MCPWM_GEN1_B_S)) -#define MCPWM_GEN1_B_V 0xFFFF -#define MCPWM_GEN1_B_S 0 - -#define MCPWM_GEN1_CFG0_REG(i) (REG_MCPWM_BASE(i) + 0x0080) -/* MCPWM_GEN1_T1_SEL : R/W ;bitpos:[9:7] ;default: 3'd0 ; */ -/*description: Source selection for PWM generate1 event_t1 take effect immediately - 0: fault_event0 1: fault_event1 2: fault_event2 3: sync_taken 4: none*/ -#define MCPWM_GEN1_T1_SEL 0x00000007 -#define MCPWM_GEN1_T1_SEL_M ((MCPWM_GEN1_T1_SEL_V)<<(MCPWM_GEN1_T1_SEL_S)) -#define MCPWM_GEN1_T1_SEL_V 0x7 -#define MCPWM_GEN1_T1_SEL_S 7 -/* MCPWM_GEN1_T0_SEL : R/W ;bitpos:[6:4] ;default: 3'd0 ; */ -/*description: Source selection for PWM generate1 event_t0 take effect immediately - 0: fault_event0 1: fault_event1 2: fault_event2 3: sync_taken 4: none*/ -#define MCPWM_GEN1_T0_SEL 0x00000007 -#define MCPWM_GEN1_T0_SEL_M ((MCPWM_GEN1_T0_SEL_V)<<(MCPWM_GEN1_T0_SEL_S)) -#define MCPWM_GEN1_T0_SEL_V 0x7 -#define MCPWM_GEN1_T0_SEL_S 4 -/* MCPWM_GEN1_CFG_UPMETHOD : R/W ;bitpos:[3:0] ;default: 4'd0 ; */ -/*description: Update method for PWM generate1's active reg of configuration. - 0: immediate bit0: TEZ bit1: TEP bit2: sync. bit3: disable update*/ -#define MCPWM_GEN1_CFG_UPMETHOD 0x0000000F -#define MCPWM_GEN1_CFG_UPMETHOD_M ((MCPWM_GEN1_CFG_UPMETHOD_V)<<(MCPWM_GEN1_CFG_UPMETHOD_S)) -#define MCPWM_GEN1_CFG_UPMETHOD_V 0xF -#define MCPWM_GEN1_CFG_UPMETHOD_S 0 - -#define MCPWM_GEN1_FORCE_REG(i) (REG_MCPWM_BASE(i) + 0x0084) -/* MCPWM_GEN1_B_NCIFORCE_MODE : R/W ;bitpos:[15:14] ;default: 2'd0 ; */ -/*description: Non-continuous immediate software force mode for PWM1B 0: disabled - 1: low 2: high 3: disabled*/ -#define MCPWM_GEN1_B_NCIFORCE_MODE 0x00000003 -#define MCPWM_GEN1_B_NCIFORCE_MODE_M ((MCPWM_GEN1_B_NCIFORCE_MODE_V)<<(MCPWM_GEN1_B_NCIFORCE_MODE_S)) -#define MCPWM_GEN1_B_NCIFORCE_MODE_V 0x3 -#define MCPWM_GEN1_B_NCIFORCE_MODE_S 14 -/* MCPWM_GEN1_B_NCIFORCE : R/W ;bitpos:[13] ;default: 1'd0 ; */ -/*description: Non-continuous immediate software force trigger for PWM1B a - toggle will trigger a force event*/ -#define MCPWM_GEN1_B_NCIFORCE (BIT(13)) -#define MCPWM_GEN1_B_NCIFORCE_M (BIT(13)) -#define MCPWM_GEN1_B_NCIFORCE_V 0x1 -#define MCPWM_GEN1_B_NCIFORCE_S 13 -/* MCPWM_GEN1_A_NCIFORCE_MODE : R/W ;bitpos:[12:11] ;default: 2'd0 ; */ -/*description: Non-continuous immediate software force mode for PWM1A 0: disabled - 1: low 2: high 3: disabled*/ -#define MCPWM_GEN1_A_NCIFORCE_MODE 0x00000003 -#define MCPWM_GEN1_A_NCIFORCE_MODE_M ((MCPWM_GEN1_A_NCIFORCE_MODE_V)<<(MCPWM_GEN1_A_NCIFORCE_MODE_S)) -#define MCPWM_GEN1_A_NCIFORCE_MODE_V 0x3 -#define MCPWM_GEN1_A_NCIFORCE_MODE_S 11 -/* MCPWM_GEN1_A_NCIFORCE : R/W ;bitpos:[10] ;default: 1'd0 ; */ -/*description: Non-continuous immediate software force trigger for PWM1A a - toggle will trigger a force event*/ -#define MCPWM_GEN1_A_NCIFORCE (BIT(10)) -#define MCPWM_GEN1_A_NCIFORCE_M (BIT(10)) -#define MCPWM_GEN1_A_NCIFORCE_V 0x1 -#define MCPWM_GEN1_A_NCIFORCE_S 10 -/* MCPWM_GEN1_B_CNTUFORCE_MODE : R/W ;bitpos:[9:8] ;default: 2'd0 ; */ -/*description: Continuous software force mode for PWM1B. 0: disabled 1: low - 2: high 3: disabled*/ -#define MCPWM_GEN1_B_CNTUFORCE_MODE 0x00000003 -#define MCPWM_GEN1_B_CNTUFORCE_MODE_M ((MCPWM_GEN1_B_CNTUFORCE_MODE_V)<<(MCPWM_GEN1_B_CNTUFORCE_MODE_S)) -#define MCPWM_GEN1_B_CNTUFORCE_MODE_V 0x3 -#define MCPWM_GEN1_B_CNTUFORCE_MODE_S 8 -/* MCPWM_GEN1_A_CNTUFORCE_MODE : R/W ;bitpos:[7:6] ;default: 2'd0 ; */ -/*description: Continuous software force mode for PWM1A. 0: disabled 1: low - 2: high 3: disabled*/ -#define MCPWM_GEN1_A_CNTUFORCE_MODE 0x00000003 -#define MCPWM_GEN1_A_CNTUFORCE_MODE_M ((MCPWM_GEN1_A_CNTUFORCE_MODE_V)<<(MCPWM_GEN1_A_CNTUFORCE_MODE_S)) -#define MCPWM_GEN1_A_CNTUFORCE_MODE_V 0x3 -#define MCPWM_GEN1_A_CNTUFORCE_MODE_S 6 -/* MCPWM_GEN1_CNTUFORCE_UPMETHOD : R/W ;bitpos:[5:0] ;default: 6'h20 ; */ -/*description: Update method for continuous software force of PWM generator1. - 0: immediate bit0: TEZ bit1: TEP bit2: TEA bit3: TEB bit4: sync bit5: disable update. (TEA/B here and below means an event generated when timer value equals A/B register)*/ -#define MCPWM_GEN1_CNTUFORCE_UPMETHOD 0x0000003F -#define MCPWM_GEN1_CNTUFORCE_UPMETHOD_M ((MCPWM_GEN1_CNTUFORCE_UPMETHOD_V)<<(MCPWM_GEN1_CNTUFORCE_UPMETHOD_S)) -#define MCPWM_GEN1_CNTUFORCE_UPMETHOD_V 0x3F -#define MCPWM_GEN1_CNTUFORCE_UPMETHOD_S 0 - -#define MCPWM_GEN1_A_REG(i) (REG_MCPWM_BASE(i) + 0x0088) -/* MCPWM_GEN1_A_DT1 : R/W ;bitpos:[23:22] ;default: 2'd0 ; */ -/*description: Action on PWM1A triggered by event_t1 when timer decreasing. - 0: no change 1: low 2: high 3: toggle*/ -#define MCPWM_GEN1_A_DT1 0x00000003 -#define MCPWM_GEN1_A_DT1_M ((MCPWM_GEN1_A_DT1_V)<<(MCPWM_GEN1_A_DT1_S)) -#define MCPWM_GEN1_A_DT1_V 0x3 -#define MCPWM_GEN1_A_DT1_S 22 -/* MCPWM_GEN1_A_DT0 : R/W ;bitpos:[21:20] ;default: 2'd0 ; */ -/*description: Action on PWM1A triggered by event_t0 when timer decreasing*/ -#define MCPWM_GEN1_A_DT0 0x00000003 -#define MCPWM_GEN1_A_DT0_M ((MCPWM_GEN1_A_DT0_V)<<(MCPWM_GEN1_A_DT0_S)) -#define MCPWM_GEN1_A_DT0_V 0x3 -#define MCPWM_GEN1_A_DT0_S 20 -/* MCPWM_GEN1_A_DTEB : R/W ;bitpos:[19:18] ;default: 2'd0 ; */ -/*description: Action on PWM1A triggered by event TEB when timer decreasing*/ -#define MCPWM_GEN1_A_DTEB 0x00000003 -#define MCPWM_GEN1_A_DTEB_M ((MCPWM_GEN1_A_DTEB_V)<<(MCPWM_GEN1_A_DTEB_S)) -#define MCPWM_GEN1_A_DTEB_V 0x3 -#define MCPWM_GEN1_A_DTEB_S 18 -/* MCPWM_GEN1_A_DTEA : R/W ;bitpos:[17:16] ;default: 2'd0 ; */ -/*description: Action on PWM1A triggered by event TEA when timer decreasing*/ -#define MCPWM_GEN1_A_DTEA 0x00000003 -#define MCPWM_GEN1_A_DTEA_M ((MCPWM_GEN1_A_DTEA_V)<<(MCPWM_GEN1_A_DTEA_S)) -#define MCPWM_GEN1_A_DTEA_V 0x3 -#define MCPWM_GEN1_A_DTEA_S 16 -/* MCPWM_GEN1_A_DTEP : R/W ;bitpos:[15:14] ;default: 2'd0 ; */ -/*description: Action on PWM1A triggered by event TEP when timer decreasing*/ -#define MCPWM_GEN1_A_DTEP 0x00000003 -#define MCPWM_GEN1_A_DTEP_M ((MCPWM_GEN1_A_DTEP_V)<<(MCPWM_GEN1_A_DTEP_S)) -#define MCPWM_GEN1_A_DTEP_V 0x3 -#define MCPWM_GEN1_A_DTEP_S 14 -/* MCPWM_GEN1_A_DTEZ : R/W ;bitpos:[13:12] ;default: 2'd0 ; */ -/*description: Action on PWM1A triggered by event TEZ when timer decreasing*/ -#define MCPWM_GEN1_A_DTEZ 0x00000003 -#define MCPWM_GEN1_A_DTEZ_M ((MCPWM_GEN1_A_DTEZ_V)<<(MCPWM_GEN1_A_DTEZ_S)) -#define MCPWM_GEN1_A_DTEZ_V 0x3 -#define MCPWM_GEN1_A_DTEZ_S 12 -/* MCPWM_GEN1_A_UT1 : R/W ;bitpos:[11:10] ;default: 2'd0 ; */ -/*description: Action on PWM1A triggered by event_t1 when timer increasing*/ -#define MCPWM_GEN1_A_UT1 0x00000003 -#define MCPWM_GEN1_A_UT1_M ((MCPWM_GEN1_A_UT1_V)<<(MCPWM_GEN1_A_UT1_S)) -#define MCPWM_GEN1_A_UT1_V 0x3 -#define MCPWM_GEN1_A_UT1_S 10 -/* MCPWM_GEN1_A_UT0 : R/W ;bitpos:[9:8] ;default: 2'd0 ; */ -/*description: Action on PWM1A triggered by event_t0 when timer increasing*/ -#define MCPWM_GEN1_A_UT0 0x00000003 -#define MCPWM_GEN1_A_UT0_M ((MCPWM_GEN1_A_UT0_V)<<(MCPWM_GEN1_A_UT0_S)) -#define MCPWM_GEN1_A_UT0_V 0x3 -#define MCPWM_GEN1_A_UT0_S 8 -/* MCPWM_GEN1_A_UTEB : R/W ;bitpos:[7:6] ;default: 2'd0 ; */ -/*description: Action on PWM1A triggered by event TEB when timer increasing*/ -#define MCPWM_GEN1_A_UTEB 0x00000003 -#define MCPWM_GEN1_A_UTEB_M ((MCPWM_GEN1_A_UTEB_V)<<(MCPWM_GEN1_A_UTEB_S)) -#define MCPWM_GEN1_A_UTEB_V 0x3 -#define MCPWM_GEN1_A_UTEB_S 6 -/* MCPWM_GEN1_A_UTEA : R/W ;bitpos:[5:4] ;default: 2'd0 ; */ -/*description: Action on PWM1A triggered by event TEA when timer increasing*/ -#define MCPWM_GEN1_A_UTEA 0x00000003 -#define MCPWM_GEN1_A_UTEA_M ((MCPWM_GEN1_A_UTEA_V)<<(MCPWM_GEN1_A_UTEA_S)) -#define MCPWM_GEN1_A_UTEA_V 0x3 -#define MCPWM_GEN1_A_UTEA_S 4 -/* MCPWM_GEN1_A_UTEP : R/W ;bitpos:[3:2] ;default: 2'd0 ; */ -/*description: Action on PWM1A triggered by event TEP when timer increasing*/ -#define MCPWM_GEN1_A_UTEP 0x00000003 -#define MCPWM_GEN1_A_UTEP_M ((MCPWM_GEN1_A_UTEP_V)<<(MCPWM_GEN1_A_UTEP_S)) -#define MCPWM_GEN1_A_UTEP_V 0x3 -#define MCPWM_GEN1_A_UTEP_S 2 -/* MCPWM_GEN1_A_UTEZ : R/W ;bitpos:[1:0] ;default: 2'd0 ; */ -/*description: Action on PWM1A triggered by event TEZ when timer increasing*/ -#define MCPWM_GEN1_A_UTEZ 0x00000003 -#define MCPWM_GEN1_A_UTEZ_M ((MCPWM_GEN1_A_UTEZ_V)<<(MCPWM_GEN1_A_UTEZ_S)) -#define MCPWM_GEN1_A_UTEZ_V 0x3 -#define MCPWM_GEN1_A_UTEZ_S 0 - -#define MCPWM_GEN1_B_REG(i) (REG_MCPWM_BASE(i) + 0x008c) -/* MCPWM_GEN1_B_DT1 : R/W ;bitpos:[23:22] ;default: 2'd0 ; */ -/*description: Action on PWM1B triggered by event_t1 when timer decreasing. - 0: no change 1: low 2: high 3: toggle*/ -#define MCPWM_GEN1_B_DT1 0x00000003 -#define MCPWM_GEN1_B_DT1_M ((MCPWM_GEN1_B_DT1_V)<<(MCPWM_GEN1_B_DT1_S)) -#define MCPWM_GEN1_B_DT1_V 0x3 -#define MCPWM_GEN1_B_DT1_S 22 -/* MCPWM_GEN1_B_DT0 : R/W ;bitpos:[21:20] ;default: 2'd0 ; */ -/*description: Action on PWM1B triggered by event_t0 when timer decreasing*/ -#define MCPWM_GEN1_B_DT0 0x00000003 -#define MCPWM_GEN1_B_DT0_M ((MCPWM_GEN1_B_DT0_V)<<(MCPWM_GEN1_B_DT0_S)) -#define MCPWM_GEN1_B_DT0_V 0x3 -#define MCPWM_GEN1_B_DT0_S 20 -/* MCPWM_GEN1_B_DTEB : R/W ;bitpos:[19:18] ;default: 2'd0 ; */ -/*description: Action on PWM1B triggered by event TEB when timer decreasing*/ -#define MCPWM_GEN1_B_DTEB 0x00000003 -#define MCPWM_GEN1_B_DTEB_M ((MCPWM_GEN1_B_DTEB_V)<<(MCPWM_GEN1_B_DTEB_S)) -#define MCPWM_GEN1_B_DTEB_V 0x3 -#define MCPWM_GEN1_B_DTEB_S 18 -/* MCPWM_GEN1_B_DTEA : R/W ;bitpos:[17:16] ;default: 2'd0 ; */ -/*description: Action on PWM1B triggered by event TEA when timer decreasing*/ -#define MCPWM_GEN1_B_DTEA 0x00000003 -#define MCPWM_GEN1_B_DTEA_M ((MCPWM_GEN1_B_DTEA_V)<<(MCPWM_GEN1_B_DTEA_S)) -#define MCPWM_GEN1_B_DTEA_V 0x3 -#define MCPWM_GEN1_B_DTEA_S 16 -/* MCPWM_GEN1_B_DTEP : R/W ;bitpos:[15:14] ;default: 2'd0 ; */ -/*description: Action on PWM1B triggered by event TEP when timer decreasing*/ -#define MCPWM_GEN1_B_DTEP 0x00000003 -#define MCPWM_GEN1_B_DTEP_M ((MCPWM_GEN1_B_DTEP_V)<<(MCPWM_GEN1_B_DTEP_S)) -#define MCPWM_GEN1_B_DTEP_V 0x3 -#define MCPWM_GEN1_B_DTEP_S 14 -/* MCPWM_GEN1_B_DTEZ : R/W ;bitpos:[13:12] ;default: 2'd0 ; */ -/*description: Action on PWM1B triggered by event TEZ when timer decreasing*/ -#define MCPWM_GEN1_B_DTEZ 0x00000003 -#define MCPWM_GEN1_B_DTEZ_M ((MCPWM_GEN1_B_DTEZ_V)<<(MCPWM_GEN1_B_DTEZ_S)) -#define MCPWM_GEN1_B_DTEZ_V 0x3 -#define MCPWM_GEN1_B_DTEZ_S 12 -/* MCPWM_GEN1_B_UT1 : R/W ;bitpos:[11:10] ;default: 2'd0 ; */ -/*description: Action on PWM1B triggered by event_t1 when timer increasing*/ -#define MCPWM_GEN1_B_UT1 0x00000003 -#define MCPWM_GEN1_B_UT1_M ((MCPWM_GEN1_B_UT1_V)<<(MCPWM_GEN1_B_UT1_S)) -#define MCPWM_GEN1_B_UT1_V 0x3 -#define MCPWM_GEN1_B_UT1_S 10 -/* MCPWM_GEN1_B_UT0 : R/W ;bitpos:[9:8] ;default: 2'd0 ; */ -/*description: Action on PWM1B triggered by event_t0 when timer increasing*/ -#define MCPWM_GEN1_B_UT0 0x00000003 -#define MCPWM_GEN1_B_UT0_M ((MCPWM_GEN1_B_UT0_V)<<(MCPWM_GEN1_B_UT0_S)) -#define MCPWM_GEN1_B_UT0_V 0x3 -#define MCPWM_GEN1_B_UT0_S 8 -/* MCPWM_GEN1_B_UTEB : R/W ;bitpos:[7:6] ;default: 2'd0 ; */ -/*description: Action on PWM1B triggered by event TEB when timer increasing*/ -#define MCPWM_GEN1_B_UTEB 0x00000003 -#define MCPWM_GEN1_B_UTEB_M ((MCPWM_GEN1_B_UTEB_V)<<(MCPWM_GEN1_B_UTEB_S)) -#define MCPWM_GEN1_B_UTEB_V 0x3 -#define MCPWM_GEN1_B_UTEB_S 6 -/* MCPWM_GEN1_B_UTEA : R/W ;bitpos:[5:4] ;default: 2'd0 ; */ -/*description: Action on PWM1B triggered by event TEA when timer increasing*/ -#define MCPWM_GEN1_B_UTEA 0x00000003 -#define MCPWM_GEN1_B_UTEA_M ((MCPWM_GEN1_B_UTEA_V)<<(MCPWM_GEN1_B_UTEA_S)) -#define MCPWM_GEN1_B_UTEA_V 0x3 -#define MCPWM_GEN1_B_UTEA_S 4 -/* MCPWM_GEN1_B_UTEP : R/W ;bitpos:[3:2] ;default: 2'd0 ; */ -/*description: Action on PWM1B triggered by event TEP when timer increasing*/ -#define MCPWM_GEN1_B_UTEP 0x00000003 -#define MCPWM_GEN1_B_UTEP_M ((MCPWM_GEN1_B_UTEP_V)<<(MCPWM_GEN1_B_UTEP_S)) -#define MCPWM_GEN1_B_UTEP_V 0x3 -#define MCPWM_GEN1_B_UTEP_S 2 -/* MCPWM_GEN1_B_UTEZ : R/W ;bitpos:[1:0] ;default: 2'd0 ; */ -/*description: Action on PWM1B triggered by event TEZ when timer increasing*/ -#define MCPWM_GEN1_B_UTEZ 0x00000003 -#define MCPWM_GEN1_B_UTEZ_M ((MCPWM_GEN1_B_UTEZ_V)<<(MCPWM_GEN1_B_UTEZ_S)) -#define MCPWM_GEN1_B_UTEZ_V 0x3 -#define MCPWM_GEN1_B_UTEZ_S 0 - -#define MCPWM_DT1_CFG_REG(i) (REG_MCPWM_BASE(i) + 0x0090) -/* MCPWM_DT1_CLK_SEL : R/W ;bitpos:[17] ;default: 1'd0 ; */ -/*description: Dead time generator 1 clock selection. 0: PWM_clk 1: PT_clk*/ -#define MCPWM_DT1_CLK_SEL (BIT(17)) -#define MCPWM_DT1_CLK_SEL_M (BIT(17)) -#define MCPWM_DT1_CLK_SEL_V 0x1 -#define MCPWM_DT1_CLK_SEL_S 17 -/* MCPWM_DT1_B_OUTBYPASS : R/W ;bitpos:[16] ;default: 1'd1 ; */ -/*description: S0 in documentation*/ -#define MCPWM_DT1_B_OUTBYPASS (BIT(16)) -#define MCPWM_DT1_B_OUTBYPASS_M (BIT(16)) -#define MCPWM_DT1_B_OUTBYPASS_V 0x1 -#define MCPWM_DT1_B_OUTBYPASS_S 16 -/* MCPWM_DT1_A_OUTBYPASS : R/W ;bitpos:[15] ;default: 1'd1 ; */ -/*description: S1 in documentation*/ -#define MCPWM_DT1_A_OUTBYPASS (BIT(15)) -#define MCPWM_DT1_A_OUTBYPASS_M (BIT(15)) -#define MCPWM_DT1_A_OUTBYPASS_V 0x1 -#define MCPWM_DT1_A_OUTBYPASS_S 15 -/* MCPWM_DT1_FED_OUTINVERT : R/W ;bitpos:[14] ;default: 1'd0 ; */ -/*description: S3 in documentation*/ -#define MCPWM_DT1_FED_OUTINVERT (BIT(14)) -#define MCPWM_DT1_FED_OUTINVERT_M (BIT(14)) -#define MCPWM_DT1_FED_OUTINVERT_V 0x1 -#define MCPWM_DT1_FED_OUTINVERT_S 14 -/* MCPWM_DT1_RED_OUTINVERT : R/W ;bitpos:[13] ;default: 1'd0 ; */ -/*description: S2 in documentation*/ -#define MCPWM_DT1_RED_OUTINVERT (BIT(13)) -#define MCPWM_DT1_RED_OUTINVERT_M (BIT(13)) -#define MCPWM_DT1_RED_OUTINVERT_V 0x1 -#define MCPWM_DT1_RED_OUTINVERT_S 13 -/* MCPWM_DT1_FED_INSEL : R/W ;bitpos:[12] ;default: 1'd0 ; */ -/*description: S5 in documentation*/ -#define MCPWM_DT1_FED_INSEL (BIT(12)) -#define MCPWM_DT1_FED_INSEL_M (BIT(12)) -#define MCPWM_DT1_FED_INSEL_V 0x1 -#define MCPWM_DT1_FED_INSEL_S 12 -/* MCPWM_DT1_RED_INSEL : R/W ;bitpos:[11] ;default: 1'd0 ; */ -/*description: S4 in documentation*/ -#define MCPWM_DT1_RED_INSEL (BIT(11)) -#define MCPWM_DT1_RED_INSEL_M (BIT(11)) -#define MCPWM_DT1_RED_INSEL_V 0x1 -#define MCPWM_DT1_RED_INSEL_S 11 -/* MCPWM_DT1_B_OUTSWAP : R/W ;bitpos:[10] ;default: 1'd0 ; */ -/*description: S7 in documentation*/ -#define MCPWM_DT1_B_OUTSWAP (BIT(10)) -#define MCPWM_DT1_B_OUTSWAP_M (BIT(10)) -#define MCPWM_DT1_B_OUTSWAP_V 0x1 -#define MCPWM_DT1_B_OUTSWAP_S 10 -/* MCPWM_DT1_A_OUTSWAP : R/W ;bitpos:[9] ;default: 1'd0 ; */ -/*description: S6 in documentation*/ -#define MCPWM_DT1_A_OUTSWAP (BIT(9)) -#define MCPWM_DT1_A_OUTSWAP_M (BIT(9)) -#define MCPWM_DT1_A_OUTSWAP_V 0x1 -#define MCPWM_DT1_A_OUTSWAP_S 9 -/* MCPWM_DT1_DEB_MODE : R/W ;bitpos:[8] ;default: 1'd0 ; */ -/*description: S8 in documentation dual-edge B mode 0: FED/RED take effect - on different path separately 1: FED/RED take effect on B path A out is in bypass or normal operation mode*/ -#define MCPWM_DT1_DEB_MODE (BIT(8)) -#define MCPWM_DT1_DEB_MODE_M (BIT(8)) -#define MCPWM_DT1_DEB_MODE_V 0x1 -#define MCPWM_DT1_DEB_MODE_S 8 -/* MCPWM_DT1_RED_UPMETHOD : R/W ;bitpos:[7:4] ;default: 4'd0 ; */ -/*description: Update method for RED (rising edge delay) active reg. 0: immediate - bit0: TEZ bit1: TEP bit2: sync bit3: disable update*/ -#define MCPWM_DT1_RED_UPMETHOD 0x0000000F -#define MCPWM_DT1_RED_UPMETHOD_M ((MCPWM_DT1_RED_UPMETHOD_V)<<(MCPWM_DT1_RED_UPMETHOD_S)) -#define MCPWM_DT1_RED_UPMETHOD_V 0xF -#define MCPWM_DT1_RED_UPMETHOD_S 4 -/* MCPWM_DT1_FED_UPMETHOD : R/W ;bitpos:[3:0] ;default: 4'd0 ; */ -/*description: Update method for FED (falling edge delay) active reg. 0: immediate - bit0: TEZ bit1: TEP bit2: sync bit3: disable update*/ -#define MCPWM_DT1_FED_UPMETHOD 0x0000000F -#define MCPWM_DT1_FED_UPMETHOD_M ((MCPWM_DT1_FED_UPMETHOD_V)<<(MCPWM_DT1_FED_UPMETHOD_S)) -#define MCPWM_DT1_FED_UPMETHOD_V 0xF -#define MCPWM_DT1_FED_UPMETHOD_S 0 - -#define MCPWM_DT1_FED_CFG_REG(i) (REG_MCPWM_BASE(i) + 0x0094) -/* MCPWM_DT1_FED : R/W ;bitpos:[15:0] ;default: 16'd0 ; */ -/*description: Shadow reg for FED*/ -#define MCPWM_DT1_FED 0x0000FFFF -#define MCPWM_DT1_FED_M ((MCPWM_DT1_FED_V)<<(MCPWM_DT1_FED_S)) -#define MCPWM_DT1_FED_V 0xFFFF -#define MCPWM_DT1_FED_S 0 - -#define MCPWM_DT1_RED_CFG_REG(i) (REG_MCPWM_BASE(i) + 0x0098) -/* MCPWM_DT1_RED : R/W ;bitpos:[15:0] ;default: 16'd0 ; */ -/*description: Shadow reg for RED*/ -#define MCPWM_DT1_RED 0x0000FFFF -#define MCPWM_DT1_RED_M ((MCPWM_DT1_RED_V)<<(MCPWM_DT1_RED_S)) -#define MCPWM_DT1_RED_V 0xFFFF -#define MCPWM_DT1_RED_S 0 - -#define MCPWM_CARRIER1_CFG_REG(i) (REG_MCPWM_BASE(i) + 0x009c) -/* MCPWM_CARRIER1_IN_INVERT : R/W ;bitpos:[13] ;default: 1'd0 ; */ -/*description: When set invert the input of PWM1A and PWM1B for this submodule*/ -#define MCPWM_CARRIER1_IN_INVERT (BIT(13)) -#define MCPWM_CARRIER1_IN_INVERT_M (BIT(13)) -#define MCPWM_CARRIER1_IN_INVERT_V 0x1 -#define MCPWM_CARRIER1_IN_INVERT_S 13 -/* MCPWM_CARRIER1_OUT_INVERT : R/W ;bitpos:[12] ;default: 1'd0 ; */ -/*description: When set invert the output of PWM1A and PWM1B for this submodule*/ -#define MCPWM_CARRIER1_OUT_INVERT (BIT(12)) -#define MCPWM_CARRIER1_OUT_INVERT_M (BIT(12)) -#define MCPWM_CARRIER1_OUT_INVERT_V 0x1 -#define MCPWM_CARRIER1_OUT_INVERT_S 12 -/* MCPWM_CARRIER1_OSHWTH : R/W ;bitpos:[11:8] ;default: 4'd0 ; */ -/*description: Width of the fist pulse in number of periods of the carrier*/ -#define MCPWM_CARRIER1_OSHWTH 0x0000000F -#define MCPWM_CARRIER1_OSHWTH_M ((MCPWM_CARRIER1_OSHWTH_V)<<(MCPWM_CARRIER1_OSHWTH_S)) -#define MCPWM_CARRIER1_OSHWTH_V 0xF -#define MCPWM_CARRIER1_OSHWTH_S 8 -/* MCPWM_CARRIER1_DUTY : R/W ;bitpos:[7:5] ;default: 3'd0 ; */ -/*description: Carrier duty selection. Duty = PWM_CARRIER1_DUTY / 8*/ -#define MCPWM_CARRIER1_DUTY 0x00000007 -#define MCPWM_CARRIER1_DUTY_M ((MCPWM_CARRIER1_DUTY_V)<<(MCPWM_CARRIER1_DUTY_S)) -#define MCPWM_CARRIER1_DUTY_V 0x7 -#define MCPWM_CARRIER1_DUTY_S 5 -/* MCPWM_CARRIER1_PRESCALE : R/W ;bitpos:[4:1] ;default: 4'd0 ; */ -/*description: PWM carrier1 clock (PC_clk) prescale value. Period of PC_clk - = period of PWM_clk * (PWM_CARRIER1_PRESCALE + 1)*/ -#define MCPWM_CARRIER1_PRESCALE 0x0000000F -#define MCPWM_CARRIER1_PRESCALE_M ((MCPWM_CARRIER1_PRESCALE_V)<<(MCPWM_CARRIER1_PRESCALE_S)) -#define MCPWM_CARRIER1_PRESCALE_V 0xF -#define MCPWM_CARRIER1_PRESCALE_S 1 -/* MCPWM_CARRIER1_EN : R/W ;bitpos:[0] ;default: 1'd0 ; */ -/*description: When set carrier1 function is enabled. When cleared carrier1 is bypassed*/ -#define MCPWM_CARRIER1_EN (BIT(0)) -#define MCPWM_CARRIER1_EN_M (BIT(0)) -#define MCPWM_CARRIER1_EN_V 0x1 -#define MCPWM_CARRIER1_EN_S 0 - -#define MCPWM_FH1_CFG0_REG(i) (REG_MCPWM_BASE(i) + 0x00a0) -/* MCPWM_FH1_B_OST_U : R/W ;bitpos:[23:22] ;default: 2'd0 ; */ -/*description: One-shot mode action on PWM1B when fault event occurs and timer - is increasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ -#define MCPWM_FH1_B_OST_U 0x00000003 -#define MCPWM_FH1_B_OST_U_M ((MCPWM_FH1_B_OST_U_V)<<(MCPWM_FH1_B_OST_U_S)) -#define MCPWM_FH1_B_OST_U_V 0x3 -#define MCPWM_FH1_B_OST_U_S 22 -/* MCPWM_FH1_B_OST_D : R/W ;bitpos:[21:20] ;default: 2'd0 ; */ -/*description: One-shot mode action on PWM1B when fault event occurs and timer - is decreasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ -#define MCPWM_FH1_B_OST_D 0x00000003 -#define MCPWM_FH1_B_OST_D_M ((MCPWM_FH1_B_OST_D_V)<<(MCPWM_FH1_B_OST_D_S)) -#define MCPWM_FH1_B_OST_D_V 0x3 -#define MCPWM_FH1_B_OST_D_S 20 -/* MCPWM_FH1_B_CBC_U : R/W ;bitpos:[19:18] ;default: 2'd0 ; */ -/*description: Cycle-by-cycle mode action on PWM1B when fault event occurs and - timer is increasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ -#define MCPWM_FH1_B_CBC_U 0x00000003 -#define MCPWM_FH1_B_CBC_U_M ((MCPWM_FH1_B_CBC_U_V)<<(MCPWM_FH1_B_CBC_U_S)) -#define MCPWM_FH1_B_CBC_U_V 0x3 -#define MCPWM_FH1_B_CBC_U_S 18 -/* MCPWM_FH1_B_CBC_D : R/W ;bitpos:[17:16] ;default: 2'd0 ; */ -/*description: Cycle-by-cycle mode action on PWM1B when fault event occurs and - timer is decreasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ -#define MCPWM_FH1_B_CBC_D 0x00000003 -#define MCPWM_FH1_B_CBC_D_M ((MCPWM_FH1_B_CBC_D_V)<<(MCPWM_FH1_B_CBC_D_S)) -#define MCPWM_FH1_B_CBC_D_V 0x3 -#define MCPWM_FH1_B_CBC_D_S 16 -/* MCPWM_FH1_A_OST_U : R/W ;bitpos:[15:14] ;default: 2'd0 ; */ -/*description: One-shot mode action on PWM1A when fault event occurs and timer - is increasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ -#define MCPWM_FH1_A_OST_U 0x00000003 -#define MCPWM_FH1_A_OST_U_M ((MCPWM_FH1_A_OST_U_V)<<(MCPWM_FH1_A_OST_U_S)) -#define MCPWM_FH1_A_OST_U_V 0x3 -#define MCPWM_FH1_A_OST_U_S 14 -/* MCPWM_FH1_A_OST_D : R/W ;bitpos:[13:12] ;default: 2'd0 ; */ -/*description: One-shot mode action on PWM1A when fault event occurs and timer - is decreasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ -#define MCPWM_FH1_A_OST_D 0x00000003 -#define MCPWM_FH1_A_OST_D_M ((MCPWM_FH1_A_OST_D_V)<<(MCPWM_FH1_A_OST_D_S)) -#define MCPWM_FH1_A_OST_D_V 0x3 -#define MCPWM_FH1_A_OST_D_S 12 -/* MCPWM_FH1_A_CBC_U : R/W ;bitpos:[11:10] ;default: 2'd0 ; */ -/*description: Cycle-by-cycle mode action on PWM1A when fault event occurs and - timer is increasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ -#define MCPWM_FH1_A_CBC_U 0x00000003 -#define MCPWM_FH1_A_CBC_U_M ((MCPWM_FH1_A_CBC_U_V)<<(MCPWM_FH1_A_CBC_U_S)) -#define MCPWM_FH1_A_CBC_U_V 0x3 -#define MCPWM_FH1_A_CBC_U_S 10 -/* MCPWM_FH1_A_CBC_D : R/W ;bitpos:[9:8] ;default: 2'd0 ; */ -/*description: Cycle-by-cycle mode action on PWM1A when fault event occurs and - timer is decreasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ -#define MCPWM_FH1_A_CBC_D 0x00000003 -#define MCPWM_FH1_A_CBC_D_M ((MCPWM_FH1_A_CBC_D_V)<<(MCPWM_FH1_A_CBC_D_S)) -#define MCPWM_FH1_A_CBC_D_V 0x3 -#define MCPWM_FH1_A_CBC_D_S 8 -/* MCPWM_FH1_F0_OST : R/W ;bitpos:[7] ;default: 1'd0 ; */ -/*description: event_f0 will trigger one-shot mode action. 0: disable 1: enable*/ -#define MCPWM_FH1_F0_OST (BIT(7)) -#define MCPWM_FH1_F0_OST_M (BIT(7)) -#define MCPWM_FH1_F0_OST_V 0x1 -#define MCPWM_FH1_F0_OST_S 7 -/* MCPWM_FH1_F1_OST : R/W ;bitpos:[6] ;default: 1'd0 ; */ -/*description: event_f1 will trigger one-shot mode action. 0: disable 1: enable*/ -#define MCPWM_FH1_F1_OST (BIT(6)) -#define MCPWM_FH1_F1_OST_M (BIT(6)) -#define MCPWM_FH1_F1_OST_V 0x1 -#define MCPWM_FH1_F1_OST_S 6 -/* MCPWM_FH1_F2_OST : R/W ;bitpos:[5] ;default: 1'd0 ; */ -/*description: event_f2 will trigger one-shot mode action. 0: disable 1: enable*/ -#define MCPWM_FH1_F2_OST (BIT(5)) -#define MCPWM_FH1_F2_OST_M (BIT(5)) -#define MCPWM_FH1_F2_OST_V 0x1 -#define MCPWM_FH1_F2_OST_S 5 -/* MCPWM_FH1_SW_OST : R/W ;bitpos:[4] ;default: 1'd0 ; */ -/*description: Enable register for software force one-shot mode action. 0: disable 1: enable*/ -#define MCPWM_FH1_SW_OST (BIT(4)) -#define MCPWM_FH1_SW_OST_M (BIT(4)) -#define MCPWM_FH1_SW_OST_V 0x1 -#define MCPWM_FH1_SW_OST_S 4 -/* MCPWM_FH1_F0_CBC : R/W ;bitpos:[3] ;default: 1'd0 ; */ -/*description: event_f0 will trigger cycle-by-cycle mode action. 0: disable 1: enable*/ -#define MCPWM_FH1_F0_CBC (BIT(3)) -#define MCPWM_FH1_F0_CBC_M (BIT(3)) -#define MCPWM_FH1_F0_CBC_V 0x1 -#define MCPWM_FH1_F0_CBC_S 3 -/* MCPWM_FH1_F1_CBC : R/W ;bitpos:[2] ;default: 1'd0 ; */ -/*description: event_f1 will trigger cycle-by-cycle mode action. 0: disable 1: enable*/ -#define MCPWM_FH1_F1_CBC (BIT(2)) -#define MCPWM_FH1_F1_CBC_M (BIT(2)) -#define MCPWM_FH1_F1_CBC_V 0x1 -#define MCPWM_FH1_F1_CBC_S 2 -/* MCPWM_FH1_F2_CBC : R/W ;bitpos:[1] ;default: 1'd0 ; */ -/*description: event_f2 will trigger cycle-by-cycle mode action. 0: disable 1: enable*/ -#define MCPWM_FH1_F2_CBC (BIT(1)) -#define MCPWM_FH1_F2_CBC_M (BIT(1)) -#define MCPWM_FH1_F2_CBC_V 0x1 -#define MCPWM_FH1_F2_CBC_S 1 -/* MCPWM_FH1_SW_CBC : R/W ;bitpos:[0] ;default: 1'd0 ; */ -/*description: Enable register for software force cycle-by-cycle mode action. - 0: disable 1: enable*/ -#define MCPWM_FH1_SW_CBC (BIT(0)) -#define MCPWM_FH1_SW_CBC_M (BIT(0)) -#define MCPWM_FH1_SW_CBC_V 0x1 -#define MCPWM_FH1_SW_CBC_S 0 - -#define MCPWM_FH1_CFG1_REG(i) (REG_MCPWM_BASE(i) + 0x00a4) -/* MCPWM_FH1_FORCE_OST : R/W ;bitpos:[4] ;default: 1'd0 ; */ -/*description: A toggle (software negation of value of this bit) triggers a - one-shot mode action*/ -#define MCPWM_FH1_FORCE_OST (BIT(4)) -#define MCPWM_FH1_FORCE_OST_M (BIT(4)) -#define MCPWM_FH1_FORCE_OST_V 0x1 -#define MCPWM_FH1_FORCE_OST_S 4 -/* MCPWM_FH1_FORCE_CBC : R/W ;bitpos:[3] ;default: 1'd0 ; */ -/*description: A toggle triggers a cycle-by-cycle mode action*/ -#define MCPWM_FH1_FORCE_CBC (BIT(3)) -#define MCPWM_FH1_FORCE_CBC_M (BIT(3)) -#define MCPWM_FH1_FORCE_CBC_V 0x1 -#define MCPWM_FH1_FORCE_CBC_S 3 -/* MCPWM_FH1_CBCPULSE : R/W ;bitpos:[2:1] ;default: 2'd0 ; */ -/*description: The cycle-by-cycle mode action refresh moment selection. Bit0: TEZ bit1:TEP*/ -#define MCPWM_FH1_CBCPULSE 0x00000003 -#define MCPWM_FH1_CBCPULSE_M ((MCPWM_FH1_CBCPULSE_V)<<(MCPWM_FH1_CBCPULSE_S)) -#define MCPWM_FH1_CBCPULSE_V 0x3 -#define MCPWM_FH1_CBCPULSE_S 1 -/* MCPWM_FH1_CLR_OST : R/W ;bitpos:[0] ;default: 1'd0 ; */ -/*description: A toggle will clear on going one-shot mode action*/ -#define MCPWM_FH1_CLR_OST (BIT(0)) -#define MCPWM_FH1_CLR_OST_M (BIT(0)) -#define MCPWM_FH1_CLR_OST_V 0x1 -#define MCPWM_FH1_CLR_OST_S 0 - -#define MCPWM_FH1_STATUS_REG(i) (REG_MCPWM_BASE(i) + 0x00a8) -/* MCPWM_FH1_OST_ON : RO ;bitpos:[1] ;default: 1'd0 ; */ -/*description: Set and reset by hardware. If set an one-shot mode action is on going*/ -#define MCPWM_FH1_OST_ON (BIT(1)) -#define MCPWM_FH1_OST_ON_M (BIT(1)) -#define MCPWM_FH1_OST_ON_V 0x1 -#define MCPWM_FH1_OST_ON_S 1 -/* MCPWM_FH1_CBC_ON : RO ;bitpos:[0] ;default: 1'd0 ; */ -/*description: Set and reset by hardware. If set an cycle-by-cycle mode action is on going*/ -#define MCPWM_FH1_CBC_ON (BIT(0)) -#define MCPWM_FH1_CBC_ON_M (BIT(0)) -#define MCPWM_FH1_CBC_ON_V 0x1 -#define MCPWM_FH1_CBC_ON_S 0 - -#define MCPWM_GEN2_STMP_CFG_REG(i) (REG_MCPWM_BASE(i) + 0x00ac) -/* MCPWM_GEN2_B_SHDW_FULL : RO ;bitpos:[9] ;default: 1'd0 ; */ -/*description: Set and reset by hardware. If set PWM generator 2 time stamp - B's shadow reg is filled and waiting to be transferred to B's active reg. If cleared B's active reg has been updated with shadow reg latest value*/ -#define MCPWM_GEN2_B_SHDW_FULL (BIT(9)) -#define MCPWM_GEN2_B_SHDW_FULL_M (BIT(9)) -#define MCPWM_GEN2_B_SHDW_FULL_V 0x1 -#define MCPWM_GEN2_B_SHDW_FULL_S 9 -/* MCPWM_GEN2_A_SHDW_FULL : RO ;bitpos:[8] ;default: 1'd0 ; */ -/*description: Set and reset by hardware. If set PWM generator 2 time stamp - A's shadow reg is filled and waiting to be transferred to A's active reg. If cleared A's active reg has been updated with shadow reg latest value*/ -#define MCPWM_GEN2_A_SHDW_FULL (BIT(8)) -#define MCPWM_GEN2_A_SHDW_FULL_M (BIT(8)) -#define MCPWM_GEN2_A_SHDW_FULL_V 0x1 -#define MCPWM_GEN2_A_SHDW_FULL_S 8 -/* MCPWM_GEN2_B_UPMETHOD : R/W ;bitpos:[7:4] ;default: 4'd0 ; */ -/*description: Update method for PWM generator 2 time stamp B's active reg. - 0: immediate bit0: TEZ bit1: TEP bit2: sync bit3: disable update*/ -#define MCPWM_GEN2_B_UPMETHOD 0x0000000F -#define MCPWM_GEN2_B_UPMETHOD_M ((MCPWM_GEN2_B_UPMETHOD_V)<<(MCPWM_GEN2_B_UPMETHOD_S)) -#define MCPWM_GEN2_B_UPMETHOD_V 0xF -#define MCPWM_GEN2_B_UPMETHOD_S 4 -/* MCPWM_GEN2_A_UPMETHOD : R/W ;bitpos:[3:0] ;default: 4'd0 ; */ -/*description: Update method for PWM generator 2 time stamp A's active reg. - 0: immediate bit0: TEZ bit1: TEP bit2: sync bit3: disable update*/ -#define MCPWM_GEN2_A_UPMETHOD 0x0000000F -#define MCPWM_GEN2_A_UPMETHOD_M ((MCPWM_GEN2_A_UPMETHOD_V)<<(MCPWM_GEN2_A_UPMETHOD_S)) -#define MCPWM_GEN2_A_UPMETHOD_V 0xF -#define MCPWM_GEN2_A_UPMETHOD_S 0 - -#define MCPWM_GEN2_TSTMP_A_REG(i) (REG_MCPWM_BASE(i) + 0x00b0) -/* MCPWM_GEN2_A : R/W ;bitpos:[15:0] ;default: 16'd0 ; */ -/*description: PWM generator 2 time stamp A's shadow reg*/ -#define MCPWM_GEN2_A 0x0000FFFF -#define MCPWM_GEN2_A_M ((MCPWM_GEN2_A_V)<<(MCPWM_GEN2_A_S)) -#define MCPWM_GEN2_A_V 0xFFFF -#define MCPWM_GEN2_A_S 0 - -#define MCPWM_GEN2_TSTMP_B_REG(i) (REG_MCPWM_BASE(i) + 0x00b4) -/* MCPWM_GEN2_B : R/W ;bitpos:[15:0] ;default: 16'd0 ; */ -/*description: PWM generator 2 time stamp B's shadow reg*/ -#define MCPWM_GEN2_B 0x0000FFFF -#define MCPWM_GEN2_B_M ((MCPWM_GEN2_B_V)<<(MCPWM_GEN2_B_S)) -#define MCPWM_GEN2_B_V 0xFFFF -#define MCPWM_GEN2_B_S 0 - -#define MCPWM_GEN2_CFG0_REG(i) (REG_MCPWM_BASE(i) + 0x00b8) -/* MCPWM_GEN2_T1_SEL : R/W ;bitpos:[9:7] ;default: 3'd0 ; */ -/*description: Source selection for PWM generate2 event_t1 take effect immediately - 0: fault_event0 1: fault_event1 2: fault_event2 3: sync_taken 4: none*/ -#define MCPWM_GEN2_T1_SEL 0x00000007 -#define MCPWM_GEN2_T1_SEL_M ((MCPWM_GEN2_T1_SEL_V)<<(MCPWM_GEN2_T1_SEL_S)) -#define MCPWM_GEN2_T1_SEL_V 0x7 -#define MCPWM_GEN2_T1_SEL_S 7 -/* MCPWM_GEN2_T0_SEL : R/W ;bitpos:[6:4] ;default: 3'd0 ; */ -/*description: Source selection for PWM generate2 event_t0 take effect immediately - 0: fault_event0 1: fault_event1 2: fault_event2 3: sync_taken 4: none*/ -#define MCPWM_GEN2_T0_SEL 0x00000007 -#define MCPWM_GEN2_T0_SEL_M ((MCPWM_GEN2_T0_SEL_V)<<(MCPWM_GEN2_T0_SEL_S)) -#define MCPWM_GEN2_T0_SEL_V 0x7 -#define MCPWM_GEN2_T0_SEL_S 4 -/* MCPWM_GEN2_CFG_UPMETHOD : R/W ;bitpos:[3:0] ;default: 4'd0 ; */ -/*description: Update method for PWM generate2's active reg of configuration. - 0: immediate bit0: TEZ bit1: TEP bit2: sync. bit3: disable update*/ -#define MCPWM_GEN2_CFG_UPMETHOD 0x0000000F -#define MCPWM_GEN2_CFG_UPMETHOD_M ((MCPWM_GEN2_CFG_UPMETHOD_V)<<(MCPWM_GEN2_CFG_UPMETHOD_S)) -#define MCPWM_GEN2_CFG_UPMETHOD_V 0xF -#define MCPWM_GEN2_CFG_UPMETHOD_S 0 - -#define MCPWM_GEN2_FORCE_REG(i) (REG_MCPWM_BASE(i) + 0x00bc) -/* MCPWM_GEN2_B_NCIFORCE_MODE : R/W ;bitpos:[15:14] ;default: 2'd0 ; */ -/*description: Non-continuous immediate software force mode for PWM2B 0: disabled - 1: low 2: high 3: disabled*/ -#define MCPWM_GEN2_B_NCIFORCE_MODE 0x00000003 -#define MCPWM_GEN2_B_NCIFORCE_MODE_M ((MCPWM_GEN2_B_NCIFORCE_MODE_V)<<(MCPWM_GEN2_B_NCIFORCE_MODE_S)) -#define MCPWM_GEN2_B_NCIFORCE_MODE_V 0x3 -#define MCPWM_GEN2_B_NCIFORCE_MODE_S 14 -/* MCPWM_GEN2_B_NCIFORCE : R/W ;bitpos:[13] ;default: 1'd0 ; */ -/*description: Non-continuous immediate software force trigger for PWM2B a - toggle will trigger a force event*/ -#define MCPWM_GEN2_B_NCIFORCE (BIT(13)) -#define MCPWM_GEN2_B_NCIFORCE_M (BIT(13)) -#define MCPWM_GEN2_B_NCIFORCE_V 0x1 -#define MCPWM_GEN2_B_NCIFORCE_S 13 -/* MCPWM_GEN2_A_NCIFORCE_MODE : R/W ;bitpos:[12:11] ;default: 2'd0 ; */ -/*description: Non-continuous immediate software force mode for PWM2A 0: disabled - 1: low 2: high 3: disabled*/ -#define MCPWM_GEN2_A_NCIFORCE_MODE 0x00000003 -#define MCPWM_GEN2_A_NCIFORCE_MODE_M ((MCPWM_GEN2_A_NCIFORCE_MODE_V)<<(MCPWM_GEN2_A_NCIFORCE_MODE_S)) -#define MCPWM_GEN2_A_NCIFORCE_MODE_V 0x3 -#define MCPWM_GEN2_A_NCIFORCE_MODE_S 11 -/* MCPWM_GEN2_A_NCIFORCE : R/W ;bitpos:[10] ;default: 1'd0 ; */ -/*description: Non-continuous immediate software force trigger for PWM2A a - toggle will trigger a force event*/ -#define MCPWM_GEN2_A_NCIFORCE (BIT(10)) -#define MCPWM_GEN2_A_NCIFORCE_M (BIT(10)) -#define MCPWM_GEN2_A_NCIFORCE_V 0x1 -#define MCPWM_GEN2_A_NCIFORCE_S 10 -/* MCPWM_GEN2_B_CNTUFORCE_MODE : R/W ;bitpos:[9:8] ;default: 2'd0 ; */ -/*description: Continuous software force mode for PWM2B. 0: disabled 1: low - 2: high 3: disabled*/ -#define MCPWM_GEN2_B_CNTUFORCE_MODE 0x00000003 -#define MCPWM_GEN2_B_CNTUFORCE_MODE_M ((MCPWM_GEN2_B_CNTUFORCE_MODE_V)<<(MCPWM_GEN2_B_CNTUFORCE_MODE_S)) -#define MCPWM_GEN2_B_CNTUFORCE_MODE_V 0x3 -#define MCPWM_GEN2_B_CNTUFORCE_MODE_S 8 -/* MCPWM_GEN2_A_CNTUFORCE_MODE : R/W ;bitpos:[7:6] ;default: 2'd0 ; */ -/*description: Continuous software force mode for PWM2A. 0: disabled 1: low - 2: high 3: disabled*/ -#define MCPWM_GEN2_A_CNTUFORCE_MODE 0x00000003 -#define MCPWM_GEN2_A_CNTUFORCE_MODE_M ((MCPWM_GEN2_A_CNTUFORCE_MODE_V)<<(MCPWM_GEN2_A_CNTUFORCE_MODE_S)) -#define MCPWM_GEN2_A_CNTUFORCE_MODE_V 0x3 -#define MCPWM_GEN2_A_CNTUFORCE_MODE_S 6 -/* MCPWM_GEN2_CNTUFORCE_UPMETHOD : R/W ;bitpos:[5:0] ;default: 6'h20 ; */ -/*description: Update method for continuous software force of PWM generator2. - 0: immediate bit0: TEZ bit1: TEP bit2: TEA bit3: TEB bit4: sync bit5: disable update. (TEA/B here and below means an event generated when timer value equals A/B register)*/ -#define MCPWM_GEN2_CNTUFORCE_UPMETHOD 0x0000003F -#define MCPWM_GEN2_CNTUFORCE_UPMETHOD_M ((MCPWM_GEN2_CNTUFORCE_UPMETHOD_V)<<(MCPWM_GEN2_CNTUFORCE_UPMETHOD_S)) -#define MCPWM_GEN2_CNTUFORCE_UPMETHOD_V 0x3F -#define MCPWM_GEN2_CNTUFORCE_UPMETHOD_S 0 - -#define MCPWM_GEN2_A_REG(i) (REG_MCPWM_BASE(i) + 0x00c0) -/* MCPWM_GEN2_A_DT1 : R/W ;bitpos:[23:22] ;default: 2'd0 ; */ -/*description: Action on PWM2A triggered by event_t1 when timer decreasing. - 0: no change 1: low 2: high 3: toggle*/ -#define MCPWM_GEN2_A_DT1 0x00000003 -#define MCPWM_GEN2_A_DT1_M ((MCPWM_GEN2_A_DT1_V)<<(MCPWM_GEN2_A_DT1_S)) -#define MCPWM_GEN2_A_DT1_V 0x3 -#define MCPWM_GEN2_A_DT1_S 22 -/* MCPWM_GEN2_A_DT0 : R/W ;bitpos:[21:20] ;default: 2'd0 ; */ -/*description: Action on PWM2A triggered by event_t0 when timer decreasing*/ -#define MCPWM_GEN2_A_DT0 0x00000003 -#define MCPWM_GEN2_A_DT0_M ((MCPWM_GEN2_A_DT0_V)<<(MCPWM_GEN2_A_DT0_S)) -#define MCPWM_GEN2_A_DT0_V 0x3 -#define MCPWM_GEN2_A_DT0_S 20 -/* MCPWM_GEN2_A_DTEB : R/W ;bitpos:[19:18] ;default: 2'd0 ; */ -/*description: Action on PWM2A triggered by event TEB when timer decreasing*/ -#define MCPWM_GEN2_A_DTEB 0x00000003 -#define MCPWM_GEN2_A_DTEB_M ((MCPWM_GEN2_A_DTEB_V)<<(MCPWM_GEN2_A_DTEB_S)) -#define MCPWM_GEN2_A_DTEB_V 0x3 -#define MCPWM_GEN2_A_DTEB_S 18 -/* MCPWM_GEN2_A_DTEA : R/W ;bitpos:[17:16] ;default: 2'd0 ; */ -/*description: Action on PWM2A triggered by event TEA when timer decreasing*/ -#define MCPWM_GEN2_A_DTEA 0x00000003 -#define MCPWM_GEN2_A_DTEA_M ((MCPWM_GEN2_A_DTEA_V)<<(MCPWM_GEN2_A_DTEA_S)) -#define MCPWM_GEN2_A_DTEA_V 0x3 -#define MCPWM_GEN2_A_DTEA_S 16 -/* MCPWM_GEN2_A_DTEP : R/W ;bitpos:[15:14] ;default: 2'd0 ; */ -/*description: Action on PWM2A triggered by event TEP when timer decreasing*/ -#define MCPWM_GEN2_A_DTEP 0x00000003 -#define MCPWM_GEN2_A_DTEP_M ((MCPWM_GEN2_A_DTEP_V)<<(MCPWM_GEN2_A_DTEP_S)) -#define MCPWM_GEN2_A_DTEP_V 0x3 -#define MCPWM_GEN2_A_DTEP_S 14 -/* MCPWM_GEN2_A_DTEZ : R/W ;bitpos:[13:12] ;default: 2'd0 ; */ -/*description: Action on PWM2A triggered by event TEZ when timer decreasing*/ -#define MCPWM_GEN2_A_DTEZ 0x00000003 -#define MCPWM_GEN2_A_DTEZ_M ((MCPWM_GEN2_A_DTEZ_V)<<(MCPWM_GEN2_A_DTEZ_S)) -#define MCPWM_GEN2_A_DTEZ_V 0x3 -#define MCPWM_GEN2_A_DTEZ_S 12 -/* MCPWM_GEN2_A_UT1 : R/W ;bitpos:[11:10] ;default: 2'd0 ; */ -/*description: Action on PWM2A triggered by event_t1 when timer increasing*/ -#define MCPWM_GEN2_A_UT1 0x00000003 -#define MCPWM_GEN2_A_UT1_M ((MCPWM_GEN2_A_UT1_V)<<(MCPWM_GEN2_A_UT1_S)) -#define MCPWM_GEN2_A_UT1_V 0x3 -#define MCPWM_GEN2_A_UT1_S 10 -/* MCPWM_GEN2_A_UT0 : R/W ;bitpos:[9:8] ;default: 2'd0 ; */ -/*description: Action on PWM2A triggered by event_t0 when timer increasing*/ -#define MCPWM_GEN2_A_UT0 0x00000003 -#define MCPWM_GEN2_A_UT0_M ((MCPWM_GEN2_A_UT0_V)<<(MCPWM_GEN2_A_UT0_S)) -#define MCPWM_GEN2_A_UT0_V 0x3 -#define MCPWM_GEN2_A_UT0_S 8 -/* MCPWM_GEN2_A_UTEB : R/W ;bitpos:[7:6] ;default: 2'd0 ; */ -/*description: Action on PWM2A triggered by event TEB when timer increasing*/ -#define MCPWM_GEN2_A_UTEB 0x00000003 -#define MCPWM_GEN2_A_UTEB_M ((MCPWM_GEN2_A_UTEB_V)<<(MCPWM_GEN2_A_UTEB_S)) -#define MCPWM_GEN2_A_UTEB_V 0x3 -#define MCPWM_GEN2_A_UTEB_S 6 -/* MCPWM_GEN2_A_UTEA : R/W ;bitpos:[5:4] ;default: 2'd0 ; */ -/*description: Action on PWM2A triggered by event TEA when timer increasing*/ -#define MCPWM_GEN2_A_UTEA 0x00000003 -#define MCPWM_GEN2_A_UTEA_M ((MCPWM_GEN2_A_UTEA_V)<<(MCPWM_GEN2_A_UTEA_S)) -#define MCPWM_GEN2_A_UTEA_V 0x3 -#define MCPWM_GEN2_A_UTEA_S 4 -/* MCPWM_GEN2_A_UTEP : R/W ;bitpos:[3:2] ;default: 2'd0 ; */ -/*description: Action on PWM2A triggered by event TEP when timer increasing*/ -#define MCPWM_GEN2_A_UTEP 0x00000003 -#define MCPWM_GEN2_A_UTEP_M ((MCPWM_GEN2_A_UTEP_V)<<(MCPWM_GEN2_A_UTEP_S)) -#define MCPWM_GEN2_A_UTEP_V 0x3 -#define MCPWM_GEN2_A_UTEP_S 2 -/* MCPWM_GEN2_A_UTEZ : R/W ;bitpos:[1:0] ;default: 2'd0 ; */ -/*description: Action on PWM2A triggered by event TEZ when timer increasing*/ -#define MCPWM_GEN2_A_UTEZ 0x00000003 -#define MCPWM_GEN2_A_UTEZ_M ((MCPWM_GEN2_A_UTEZ_V)<<(MCPWM_GEN2_A_UTEZ_S)) -#define MCPWM_GEN2_A_UTEZ_V 0x3 -#define MCPWM_GEN2_A_UTEZ_S 0 - -#define MCPWM_GEN2_B_REG(i) (REG_MCPWM_BASE(i) + 0x00c4) -/* MCPWM_GEN2_B_DT1 : R/W ;bitpos:[23:22] ;default: 2'd0 ; */ -/*description: Action on PWM2B triggered by event_t1 when timer decreasing. - 0: no change 1: low 2: high 3: toggle*/ -#define MCPWM_GEN2_B_DT1 0x00000003 -#define MCPWM_GEN2_B_DT1_M ((MCPWM_GEN2_B_DT1_V)<<(MCPWM_GEN2_B_DT1_S)) -#define MCPWM_GEN2_B_DT1_V 0x3 -#define MCPWM_GEN2_B_DT1_S 22 -/* MCPWM_GEN2_B_DT0 : R/W ;bitpos:[21:20] ;default: 2'd0 ; */ -/*description: Action on PWM2B triggered by event_t0 when timer decreasing*/ -#define MCPWM_GEN2_B_DT0 0x00000003 -#define MCPWM_GEN2_B_DT0_M ((MCPWM_GEN2_B_DT0_V)<<(MCPWM_GEN2_B_DT0_S)) -#define MCPWM_GEN2_B_DT0_V 0x3 -#define MCPWM_GEN2_B_DT0_S 20 -/* MCPWM_GEN2_B_DTEB : R/W ;bitpos:[19:18] ;default: 2'd0 ; */ -/*description: Action on PWM2B triggered by event TEB when timer decreasing*/ -#define MCPWM_GEN2_B_DTEB 0x00000003 -#define MCPWM_GEN2_B_DTEB_M ((MCPWM_GEN2_B_DTEB_V)<<(MCPWM_GEN2_B_DTEB_S)) -#define MCPWM_GEN2_B_DTEB_V 0x3 -#define MCPWM_GEN2_B_DTEB_S 18 -/* MCPWM_GEN2_B_DTEA : R/W ;bitpos:[17:16] ;default: 2'd0 ; */ -/*description: Action on PWM2B triggered by event TEA when timer decreasing*/ -#define MCPWM_GEN2_B_DTEA 0x00000003 -#define MCPWM_GEN2_B_DTEA_M ((MCPWM_GEN2_B_DTEA_V)<<(MCPWM_GEN2_B_DTEA_S)) -#define MCPWM_GEN2_B_DTEA_V 0x3 -#define MCPWM_GEN2_B_DTEA_S 16 -/* MCPWM_GEN2_B_DTEP : R/W ;bitpos:[15:14] ;default: 2'd0 ; */ -/*description: Action on PWM2B triggered by event TEP when timer decreasing*/ -#define MCPWM_GEN2_B_DTEP 0x00000003 -#define MCPWM_GEN2_B_DTEP_M ((MCPWM_GEN2_B_DTEP_V)<<(MCPWM_GEN2_B_DTEP_S)) -#define MCPWM_GEN2_B_DTEP_V 0x3 -#define MCPWM_GEN2_B_DTEP_S 14 -/* MCPWM_GEN2_B_DTEZ : R/W ;bitpos:[13:12] ;default: 2'd0 ; */ -/*description: Action on PWM2B triggered by event TEZ when timer decreasing*/ -#define MCPWM_GEN2_B_DTEZ 0x00000003 -#define MCPWM_GEN2_B_DTEZ_M ((MCPWM_GEN2_B_DTEZ_V)<<(MCPWM_GEN2_B_DTEZ_S)) -#define MCPWM_GEN2_B_DTEZ_V 0x3 -#define MCPWM_GEN2_B_DTEZ_S 12 -/* MCPWM_GEN2_B_UT1 : R/W ;bitpos:[11:10] ;default: 2'd0 ; */ -/*description: Action on PWM2B triggered by event_t1 when timer increasing*/ -#define MCPWM_GEN2_B_UT1 0x00000003 -#define MCPWM_GEN2_B_UT1_M ((MCPWM_GEN2_B_UT1_V)<<(MCPWM_GEN2_B_UT1_S)) -#define MCPWM_GEN2_B_UT1_V 0x3 -#define MCPWM_GEN2_B_UT1_S 10 -/* MCPWM_GEN2_B_UT0 : R/W ;bitpos:[9:8] ;default: 2'd0 ; */ -/*description: Action on PWM2B triggered by event_t0 when timer increasing*/ -#define MCPWM_GEN2_B_UT0 0x00000003 -#define MCPWM_GEN2_B_UT0_M ((MCPWM_GEN2_B_UT0_V)<<(MCPWM_GEN2_B_UT0_S)) -#define MCPWM_GEN2_B_UT0_V 0x3 -#define MCPWM_GEN2_B_UT0_S 8 -/* MCPWM_GEN2_B_UTEB : R/W ;bitpos:[7:6] ;default: 2'd0 ; */ -/*description: Action on PWM2B triggered by event TEB when timer increasing*/ -#define MCPWM_GEN2_B_UTEB 0x00000003 -#define MCPWM_GEN2_B_UTEB_M ((MCPWM_GEN2_B_UTEB_V)<<(MCPWM_GEN2_B_UTEB_S)) -#define MCPWM_GEN2_B_UTEB_V 0x3 -#define MCPWM_GEN2_B_UTEB_S 6 -/* MCPWM_GEN2_B_UTEA : R/W ;bitpos:[5:4] ;default: 2'd0 ; */ -/*description: Action on PWM2B triggered by event TEA when timer increasing*/ -#define MCPWM_GEN2_B_UTEA 0x00000003 -#define MCPWM_GEN2_B_UTEA_M ((MCPWM_GEN2_B_UTEA_V)<<(MCPWM_GEN2_B_UTEA_S)) -#define MCPWM_GEN2_B_UTEA_V 0x3 -#define MCPWM_GEN2_B_UTEA_S 4 -/* MCPWM_GEN2_B_UTEP : R/W ;bitpos:[3:2] ;default: 2'd0 ; */ -/*description: Action on PWM2B triggered by event TEP when timer increasing*/ -#define MCPWM_GEN2_B_UTEP 0x00000003 -#define MCPWM_GEN2_B_UTEP_M ((MCPWM_GEN2_B_UTEP_V)<<(MCPWM_GEN2_B_UTEP_S)) -#define MCPWM_GEN2_B_UTEP_V 0x3 -#define MCPWM_GEN2_B_UTEP_S 2 -/* MCPWM_GEN2_B_UTEZ : R/W ;bitpos:[1:0] ;default: 2'd0 ; */ -/*description: Action on PWM2B triggered by event TEZ when timer increasing*/ -#define MCPWM_GEN2_B_UTEZ 0x00000003 -#define MCPWM_GEN2_B_UTEZ_M ((MCPWM_GEN2_B_UTEZ_V)<<(MCPWM_GEN2_B_UTEZ_S)) -#define MCPWM_GEN2_B_UTEZ_V 0x3 -#define MCPWM_GEN2_B_UTEZ_S 0 - -#define MCPWM_DT2_CFG_REG(i) (REG_MCPWM_BASE(i) + 0x00c8) -/* MCPWM_DT2_CLK_SEL : R/W ;bitpos:[17] ;default: 1'd0 ; */ -/*description: Dead time generator 1 clock selection. 0: PWM_clk 1: PT_clk*/ -#define MCPWM_DT2_CLK_SEL (BIT(17)) -#define MCPWM_DT2_CLK_SEL_M (BIT(17)) -#define MCPWM_DT2_CLK_SEL_V 0x1 -#define MCPWM_DT2_CLK_SEL_S 17 -/* MCPWM_DT2_B_OUTBYPASS : R/W ;bitpos:[16] ;default: 1'd1 ; */ -/*description: S0 in documentation*/ -#define MCPWM_DT2_B_OUTBYPASS (BIT(16)) -#define MCPWM_DT2_B_OUTBYPASS_M (BIT(16)) -#define MCPWM_DT2_B_OUTBYPASS_V 0x1 -#define MCPWM_DT2_B_OUTBYPASS_S 16 -/* MCPWM_DT2_A_OUTBYPASS : R/W ;bitpos:[15] ;default: 1'd1 ; */ -/*description: S1 in documentation*/ -#define MCPWM_DT2_A_OUTBYPASS (BIT(15)) -#define MCPWM_DT2_A_OUTBYPASS_M (BIT(15)) -#define MCPWM_DT2_A_OUTBYPASS_V 0x1 -#define MCPWM_DT2_A_OUTBYPASS_S 15 -/* MCPWM_DT2_FED_OUTINVERT : R/W ;bitpos:[14] ;default: 1'd0 ; */ -/*description: S3 in documentation*/ -#define MCPWM_DT2_FED_OUTINVERT (BIT(14)) -#define MCPWM_DT2_FED_OUTINVERT_M (BIT(14)) -#define MCPWM_DT2_FED_OUTINVERT_V 0x1 -#define MCPWM_DT2_FED_OUTINVERT_S 14 -/* MCPWM_DT2_RED_OUTINVERT : R/W ;bitpos:[13] ;default: 1'd0 ; */ -/*description: S2 in documentation*/ -#define MCPWM_DT2_RED_OUTINVERT (BIT(13)) -#define MCPWM_DT2_RED_OUTINVERT_M (BIT(13)) -#define MCPWM_DT2_RED_OUTINVERT_V 0x1 -#define MCPWM_DT2_RED_OUTINVERT_S 13 -/* MCPWM_DT2_FED_INSEL : R/W ;bitpos:[12] ;default: 1'd0 ; */ -/*description: S5 in documentation*/ -#define MCPWM_DT2_FED_INSEL (BIT(12)) -#define MCPWM_DT2_FED_INSEL_M (BIT(12)) -#define MCPWM_DT2_FED_INSEL_V 0x1 -#define MCPWM_DT2_FED_INSEL_S 12 -/* MCPWM_DT2_RED_INSEL : R/W ;bitpos:[11] ;default: 1'd0 ; */ -/*description: S4 in documentation*/ -#define MCPWM_DT2_RED_INSEL (BIT(11)) -#define MCPWM_DT2_RED_INSEL_M (BIT(11)) -#define MCPWM_DT2_RED_INSEL_V 0x1 -#define MCPWM_DT2_RED_INSEL_S 11 -/* MCPWM_DT2_B_OUTSWAP : R/W ;bitpos:[10] ;default: 1'd0 ; */ -/*description: S7 in documentation*/ -#define MCPWM_DT2_B_OUTSWAP (BIT(10)) -#define MCPWM_DT2_B_OUTSWAP_M (BIT(10)) -#define MCPWM_DT2_B_OUTSWAP_V 0x1 -#define MCPWM_DT2_B_OUTSWAP_S 10 -/* MCPWM_DT2_A_OUTSWAP : R/W ;bitpos:[9] ;default: 1'd0 ; */ -/*description: S6 in documentation*/ -#define MCPWM_DT2_A_OUTSWAP (BIT(9)) -#define MCPWM_DT2_A_OUTSWAP_M (BIT(9)) -#define MCPWM_DT2_A_OUTSWAP_V 0x1 -#define MCPWM_DT2_A_OUTSWAP_S 9 -/* MCPWM_DT2_DEB_MODE : R/W ;bitpos:[8] ;default: 1'd0 ; */ -/*description: S8 in documentation dual-edge B mode 0: FED/RED take effect - on different path separately 1: FED/RED take effect on B path A out is in bypass or normal operation mode*/ -#define MCPWM_DT2_DEB_MODE (BIT(8)) -#define MCPWM_DT2_DEB_MODE_M (BIT(8)) -#define MCPWM_DT2_DEB_MODE_V 0x1 -#define MCPWM_DT2_DEB_MODE_S 8 -/* MCPWM_DT2_RED_UPMETHOD : R/W ;bitpos:[7:4] ;default: 4'd0 ; */ -/*description: Update method for RED (rising edge delay) active reg. 0: immediate - bit0: TEZ bit1: TEP bit2: sync bit3: disable update*/ -#define MCPWM_DT2_RED_UPMETHOD 0x0000000F -#define MCPWM_DT2_RED_UPMETHOD_M ((MCPWM_DT2_RED_UPMETHOD_V)<<(MCPWM_DT2_RED_UPMETHOD_S)) -#define MCPWM_DT2_RED_UPMETHOD_V 0xF -#define MCPWM_DT2_RED_UPMETHOD_S 4 -/* MCPWM_DT2_FED_UPMETHOD : R/W ;bitpos:[3:0] ;default: 4'd0 ; */ -/*description: Update method for FED (falling edge delay) active reg. 0: immediate - bit0: TEZ bit1: TEP bit2: sync bit3: disable update*/ -#define MCPWM_DT2_FED_UPMETHOD 0x0000000F -#define MCPWM_DT2_FED_UPMETHOD_M ((MCPWM_DT2_FED_UPMETHOD_V)<<(MCPWM_DT2_FED_UPMETHOD_S)) -#define MCPWM_DT2_FED_UPMETHOD_V 0xF -#define MCPWM_DT2_FED_UPMETHOD_S 0 - -#define MCPWM_DT2_FED_CFG_REG(i) (REG_MCPWM_BASE(i) + 0x00cc) -/* MCPWM_DT2_FED : R/W ;bitpos:[15:0] ;default: 16'd0 ; */ -/*description: Shadow reg for FED*/ -#define MCPWM_DT2_FED 0x0000FFFF -#define MCPWM_DT2_FED_M ((MCPWM_DT2_FED_V)<<(MCPWM_DT2_FED_S)) -#define MCPWM_DT2_FED_V 0xFFFF -#define MCPWM_DT2_FED_S 0 - -#define MCPWM_DT2_RED_CFG_REG(i) (REG_MCPWM_BASE(i) + 0x00d0) -/* MCPWM_DT2_RED : R/W ;bitpos:[15:0] ;default: 16'd0 ; */ -/*description: Shadow reg for RED*/ -#define MCPWM_DT2_RED 0x0000FFFF -#define MCPWM_DT2_RED_M ((MCPWM_DT2_RED_V)<<(MCPWM_DT2_RED_S)) -#define MCPWM_DT2_RED_V 0xFFFF -#define MCPWM_DT2_RED_S 0 - -#define MCPWM_CARRIER2_CFG_REG(i) (REG_MCPWM_BASE(i) + 0x00d4) -/* MCPWM_CARRIER2_IN_INVERT : R/W ;bitpos:[13] ;default: 1'd0 ; */ -/*description: When set invert the input of PWM2A and PWM2B for this submodule*/ -#define MCPWM_CARRIER2_IN_INVERT (BIT(13)) -#define MCPWM_CARRIER2_IN_INVERT_M (BIT(13)) -#define MCPWM_CARRIER2_IN_INVERT_V 0x1 -#define MCPWM_CARRIER2_IN_INVERT_S 13 -/* MCPWM_CARRIER2_OUT_INVERT : R/W ;bitpos:[12] ;default: 1'd0 ; */ -/*description: When set invert the output of PWM2A and PWM2B for this submodule*/ -#define MCPWM_CARRIER2_OUT_INVERT (BIT(12)) -#define MCPWM_CARRIER2_OUT_INVERT_M (BIT(12)) -#define MCPWM_CARRIER2_OUT_INVERT_V 0x1 -#define MCPWM_CARRIER2_OUT_INVERT_S 12 -/* MCPWM_CARRIER2_OSHWTH : R/W ;bitpos:[11:8] ;default: 4'd0 ; */ -/*description: Width of the fist pulse in number of periods of the carrier*/ -#define MCPWM_CARRIER2_OSHWTH 0x0000000F -#define MCPWM_CARRIER2_OSHWTH_M ((MCPWM_CARRIER2_OSHWTH_V)<<(MCPWM_CARRIER2_OSHWTH_S)) -#define MCPWM_CARRIER2_OSHWTH_V 0xF -#define MCPWM_CARRIER2_OSHWTH_S 8 -/* MCPWM_CARRIER2_DUTY : R/W ;bitpos:[7:5] ;default: 3'd0 ; */ -/*description: Carrier duty selection. Duty = PWM_CARRIER2_DUTY / 8*/ -#define MCPWM_CARRIER2_DUTY 0x00000007 -#define MCPWM_CARRIER2_DUTY_M ((MCPWM_CARRIER2_DUTY_V)<<(MCPWM_CARRIER2_DUTY_S)) -#define MCPWM_CARRIER2_DUTY_V 0x7 -#define MCPWM_CARRIER2_DUTY_S 5 -/* MCPWM_CARRIER2_PRESCALE : R/W ;bitpos:[4:1] ;default: 4'd0 ; */ -/*description: PWM carrier2 clock (PC_clk) prescale value. Period of PC_clk - = period of PWM_clk * (PWM_CARRIER2_PRESCALE + 1)*/ -#define MCPWM_CARRIER2_PRESCALE 0x0000000F -#define MCPWM_CARRIER2_PRESCALE_M ((MCPWM_CARRIER2_PRESCALE_V)<<(MCPWM_CARRIER2_PRESCALE_S)) -#define MCPWM_CARRIER2_PRESCALE_V 0xF -#define MCPWM_CARRIER2_PRESCALE_S 1 -/* MCPWM_CARRIER2_EN : R/W ;bitpos:[0] ;default: 1'd0 ; */ -/*description: When set carrier2 function is enabled. When cleared carrier2 is bypassed*/ -#define MCPWM_CARRIER2_EN (BIT(0)) -#define MCPWM_CARRIER2_EN_M (BIT(0)) -#define MCPWM_CARRIER2_EN_V 0x1 -#define MCPWM_CARRIER2_EN_S 0 - -#define MCPWM_FH2_CFG0_REG(i) (REG_MCPWM_BASE(i) + 0x00d8) -/* MCPWM_FH2_B_OST_U : R/W ;bitpos:[23:22] ;default: 2'd0 ; */ -/*description: One-shot mode action on PWM2B when fault event occurs and timer - is increasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ -#define MCPWM_FH2_B_OST_U 0x00000003 -#define MCPWM_FH2_B_OST_U_M ((MCPWM_FH2_B_OST_U_V)<<(MCPWM_FH2_B_OST_U_S)) -#define MCPWM_FH2_B_OST_U_V 0x3 -#define MCPWM_FH2_B_OST_U_S 22 -/* MCPWM_FH2_B_OST_D : R/W ;bitpos:[21:20] ;default: 2'd0 ; */ -/*description: One-shot mode action on PWM2B when fault event occurs and timer - is decreasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ -#define MCPWM_FH2_B_OST_D 0x00000003 -#define MCPWM_FH2_B_OST_D_M ((MCPWM_FH2_B_OST_D_V)<<(MCPWM_FH2_B_OST_D_S)) -#define MCPWM_FH2_B_OST_D_V 0x3 -#define MCPWM_FH2_B_OST_D_S 20 -/* MCPWM_FH2_B_CBC_U : R/W ;bitpos:[19:18] ;default: 2'd0 ; */ -/*description: Cycle-by-cycle mode action on PWM2B when fault event occurs and - timer is increasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ -#define MCPWM_FH2_B_CBC_U 0x00000003 -#define MCPWM_FH2_B_CBC_U_M ((MCPWM_FH2_B_CBC_U_V)<<(MCPWM_FH2_B_CBC_U_S)) -#define MCPWM_FH2_B_CBC_U_V 0x3 -#define MCPWM_FH2_B_CBC_U_S 18 -/* MCPWM_FH2_B_CBC_D : R/W ;bitpos:[17:16] ;default: 2'd0 ; */ -/*description: Cycle-by-cycle mode action on PWM2B when fault event occurs and - timer is decreasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ -#define MCPWM_FH2_B_CBC_D 0x00000003 -#define MCPWM_FH2_B_CBC_D_M ((MCPWM_FH2_B_CBC_D_V)<<(MCPWM_FH2_B_CBC_D_S)) -#define MCPWM_FH2_B_CBC_D_V 0x3 -#define MCPWM_FH2_B_CBC_D_S 16 -/* MCPWM_FH2_A_OST_U : R/W ;bitpos:[15:14] ;default: 2'd0 ; */ -/*description: One-shot mode action on PWM2A when fault event occurs and timer - is increasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ -#define MCPWM_FH2_A_OST_U 0x00000003 -#define MCPWM_FH2_A_OST_U_M ((MCPWM_FH2_A_OST_U_V)<<(MCPWM_FH2_A_OST_U_S)) -#define MCPWM_FH2_A_OST_U_V 0x3 -#define MCPWM_FH2_A_OST_U_S 14 -/* MCPWM_FH2_A_OST_D : R/W ;bitpos:[13:12] ;default: 2'd0 ; */ -/*description: One-shot mode action on PWM2A when fault event occurs and timer - is decreasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ -#define MCPWM_FH2_A_OST_D 0x00000003 -#define MCPWM_FH2_A_OST_D_M ((MCPWM_FH2_A_OST_D_V)<<(MCPWM_FH2_A_OST_D_S)) -#define MCPWM_FH2_A_OST_D_V 0x3 -#define MCPWM_FH2_A_OST_D_S 12 -/* MCPWM_FH2_A_CBC_U : R/W ;bitpos:[11:10] ;default: 2'd0 ; */ -/*description: Cycle-by-cycle mode action on PWM2A when fault event occurs and - timer is increasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ -#define MCPWM_FH2_A_CBC_U 0x00000003 -#define MCPWM_FH2_A_CBC_U_M ((MCPWM_FH2_A_CBC_U_V)<<(MCPWM_FH2_A_CBC_U_S)) -#define MCPWM_FH2_A_CBC_U_V 0x3 -#define MCPWM_FH2_A_CBC_U_S 10 -/* MCPWM_FH2_A_CBC_D : R/W ;bitpos:[9:8] ;default: 2'd0 ; */ -/*description: Cycle-by-cycle mode action on PWM2A when fault event occurs and - timer is decreasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ -#define MCPWM_FH2_A_CBC_D 0x00000003 -#define MCPWM_FH2_A_CBC_D_M ((MCPWM_FH2_A_CBC_D_V)<<(MCPWM_FH2_A_CBC_D_S)) -#define MCPWM_FH2_A_CBC_D_V 0x3 -#define MCPWM_FH2_A_CBC_D_S 8 -/* MCPWM_FH2_F0_OST : R/W ;bitpos:[7] ;default: 1'd0 ; */ -/*description: event_f0 will trigger one-shot mode action. 0: disable 1: enable*/ -#define MCPWM_FH2_F0_OST (BIT(7)) -#define MCPWM_FH2_F0_OST_M (BIT(7)) -#define MCPWM_FH2_F0_OST_V 0x1 -#define MCPWM_FH2_F0_OST_S 7 -/* MCPWM_FH2_F1_OST : R/W ;bitpos:[6] ;default: 1'd0 ; */ -/*description: event_f1 will trigger one-shot mode action. 0: disable 1: enable*/ -#define MCPWM_FH2_F1_OST (BIT(6)) -#define MCPWM_FH2_F1_OST_M (BIT(6)) -#define MCPWM_FH2_F1_OST_V 0x1 -#define MCPWM_FH2_F1_OST_S 6 -/* MCPWM_FH2_F2_OST : R/W ;bitpos:[5] ;default: 1'd0 ; */ -/*description: event_f2 will trigger one-shot mode action. 0: disable 1: enable*/ -#define MCPWM_FH2_F2_OST (BIT(5)) -#define MCPWM_FH2_F2_OST_M (BIT(5)) -#define MCPWM_FH2_F2_OST_V 0x1 -#define MCPWM_FH2_F2_OST_S 5 -/* MCPWM_FH2_SW_OST : R/W ;bitpos:[4] ;default: 1'd0 ; */ -/*description: Enable register for software force one-shot mode action. 0: disable 1: enable*/ -#define MCPWM_FH2_SW_OST (BIT(4)) -#define MCPWM_FH2_SW_OST_M (BIT(4)) -#define MCPWM_FH2_SW_OST_V 0x1 -#define MCPWM_FH2_SW_OST_S 4 -/* MCPWM_FH2_F0_CBC : R/W ;bitpos:[3] ;default: 1'd0 ; */ -/*description: event_f0 will trigger cycle-by-cycle mode action. 0: disable 1: enable*/ -#define MCPWM_FH2_F0_CBC (BIT(3)) -#define MCPWM_FH2_F0_CBC_M (BIT(3)) -#define MCPWM_FH2_F0_CBC_V 0x1 -#define MCPWM_FH2_F0_CBC_S 3 -/* MCPWM_FH2_F1_CBC : R/W ;bitpos:[2] ;default: 1'd0 ; */ -/*description: event_f1 will trigger cycle-by-cycle mode action. 0: disable 1: enable*/ -#define MCPWM_FH2_F1_CBC (BIT(2)) -#define MCPWM_FH2_F1_CBC_M (BIT(2)) -#define MCPWM_FH2_F1_CBC_V 0x1 -#define MCPWM_FH2_F1_CBC_S 2 -/* MCPWM_FH2_F2_CBC : R/W ;bitpos:[1] ;default: 1'd0 ; */ -/*description: event_f2 will trigger cycle-by-cycle mode action. 0: disable 1: enable*/ -#define MCPWM_FH2_F2_CBC (BIT(1)) -#define MCPWM_FH2_F2_CBC_M (BIT(1)) -#define MCPWM_FH2_F2_CBC_V 0x1 -#define MCPWM_FH2_F2_CBC_S 1 -/* MCPWM_FH2_SW_CBC : R/W ;bitpos:[0] ;default: 1'd0 ; */ -/*description: Enable register for software force cycle-by-cycle mode action. - 0: disable 1: enable*/ -#define MCPWM_FH2_SW_CBC (BIT(0)) -#define MCPWM_FH2_SW_CBC_M (BIT(0)) -#define MCPWM_FH2_SW_CBC_V 0x1 -#define MCPWM_FH2_SW_CBC_S 0 - -#define MCPWM_FH2_CFG1_REG(i) (REG_MCPWM_BASE(i) + 0x00dc) -/* MCPWM_FH2_FORCE_OST : R/W ;bitpos:[4] ;default: 1'd0 ; */ -/*description: A toggle (software negation of value of this bit) triggers a - one-shot mode action*/ -#define MCPWM_FH2_FORCE_OST (BIT(4)) -#define MCPWM_FH2_FORCE_OST_M (BIT(4)) -#define MCPWM_FH2_FORCE_OST_V 0x1 -#define MCPWM_FH2_FORCE_OST_S 4 -/* MCPWM_FH2_FORCE_CBC : R/W ;bitpos:[3] ;default: 1'd0 ; */ -/*description: A toggle triggers a cycle-by-cycle mode action*/ -#define MCPWM_FH2_FORCE_CBC (BIT(3)) -#define MCPWM_FH2_FORCE_CBC_M (BIT(3)) -#define MCPWM_FH2_FORCE_CBC_V 0x1 -#define MCPWM_FH2_FORCE_CBC_S 3 -/* MCPWM_FH2_CBCPULSE : R/W ;bitpos:[2:1] ;default: 2'd0 ; */ -/*description: The cycle-by-cycle mode action refresh moment selection. Bit0: TEZ bit1:TEP*/ -#define MCPWM_FH2_CBCPULSE 0x00000003 -#define MCPWM_FH2_CBCPULSE_M ((MCPWM_FH2_CBCPULSE_V)<<(MCPWM_FH2_CBCPULSE_S)) -#define MCPWM_FH2_CBCPULSE_V 0x3 -#define MCPWM_FH2_CBCPULSE_S 1 -/* MCPWM_FH2_CLR_OST : R/W ;bitpos:[0] ;default: 1'd0 ; */ -/*description: A toggle will clear on going one-shot mode action*/ -#define MCPWM_FH2_CLR_OST (BIT(0)) -#define MCPWM_FH2_CLR_OST_M (BIT(0)) -#define MCPWM_FH2_CLR_OST_V 0x1 -#define MCPWM_FH2_CLR_OST_S 0 - -#define MCPWM_FH2_STATUS_REG(i) (REG_MCPWM_BASE(i) + 0x00e0) -/* MCPWM_FH2_OST_ON : RO ;bitpos:[1] ;default: 1'd0 ; */ -/*description: Set and reset by hardware. If set an one-shot mode action is on going*/ -#define MCPWM_FH2_OST_ON (BIT(1)) -#define MCPWM_FH2_OST_ON_M (BIT(1)) -#define MCPWM_FH2_OST_ON_V 0x1 -#define MCPWM_FH2_OST_ON_S 1 -/* MCPWM_FH2_CBC_ON : RO ;bitpos:[0] ;default: 1'd0 ; */ -/*description: Set and reset by hardware. If set an cycle-by-cycle mode action is on going*/ -#define MCPWM_FH2_CBC_ON (BIT(0)) -#define MCPWM_FH2_CBC_ON_M (BIT(0)) -#define MCPWM_FH2_CBC_ON_V 0x1 -#define MCPWM_FH2_CBC_ON_S 0 - -#define MCPWM_FAULT_DETECT_REG(i) (REG_MCPWM_BASE(i) + 0x00e4) -/* MCPWM_EVENT_F2 : RO ;bitpos:[8] ;default: 1'd0 ; */ -/*description: Set and reset by hardware. If set event_f2 is on going*/ -#define MCPWM_EVENT_F2 (BIT(8)) -#define MCPWM_EVENT_F2_M (BIT(8)) -#define MCPWM_EVENT_F2_V 0x1 -#define MCPWM_EVENT_F2_S 8 -/* MCPWM_EVENT_F1 : RO ;bitpos:[7] ;default: 1'd0 ; */ -/*description: Set and reset by hardware. If set event_f1 is on going*/ -#define MCPWM_EVENT_F1 (BIT(7)) -#define MCPWM_EVENT_F1_M (BIT(7)) -#define MCPWM_EVENT_F1_V 0x1 -#define MCPWM_EVENT_F1_S 7 -/* MCPWM_EVENT_F0 : RO ;bitpos:[6] ;default: 1'd0 ; */ -/*description: Set and reset by hardware. If set event_f0 is on going*/ -#define MCPWM_EVENT_F0 (BIT(6)) -#define MCPWM_EVENT_F0_M (BIT(6)) -#define MCPWM_EVENT_F0_V 0x1 -#define MCPWM_EVENT_F0_S 6 -/* MCPWM_F2_POLE : R/W ;bitpos:[5] ;default: 1'd0 ; */ -/*description: Set event_f2 trigger polarity on FAULT2 source from GPIO matrix. - 0: level low 1: level high*/ -#define MCPWM_F2_POLE (BIT(5)) -#define MCPWM_F2_POLE_M (BIT(5)) -#define MCPWM_F2_POLE_V 0x1 -#define MCPWM_F2_POLE_S 5 -/* MCPWM_F1_POLE : R/W ;bitpos:[4] ;default: 1'd0 ; */ -/*description: Set event_f1 trigger polarity on FAULT2 source from GPIO matrix. - 0: level low 1: level high*/ -#define MCPWM_F1_POLE (BIT(4)) -#define MCPWM_F1_POLE_M (BIT(4)) -#define MCPWM_F1_POLE_V 0x1 -#define MCPWM_F1_POLE_S 4 -/* MCPWM_F0_POLE : R/W ;bitpos:[3] ;default: 1'd0 ; */ -/*description: Set event_f0 trigger polarity on FAULT2 source from GPIO matrix. - 0: level low 1: level high*/ -#define MCPWM_F0_POLE (BIT(3)) -#define MCPWM_F0_POLE_M (BIT(3)) -#define MCPWM_F0_POLE_V 0x1 -#define MCPWM_F0_POLE_S 3 -/* MCPWM_F2_EN : R/W ;bitpos:[2] ;default: 1'd0 ; */ -/*description: Set to enable generation of event_f2*/ -#define MCPWM_F2_EN (BIT(2)) -#define MCPWM_F2_EN_M (BIT(2)) -#define MCPWM_F2_EN_V 0x1 -#define MCPWM_F2_EN_S 2 -/* MCPWM_F1_EN : R/W ;bitpos:[1] ;default: 1'd0 ; */ -/*description: Set to enable generation of event_f1*/ -#define MCPWM_F1_EN (BIT(1)) -#define MCPWM_F1_EN_M (BIT(1)) -#define MCPWM_F1_EN_V 0x1 -#define MCPWM_F1_EN_S 1 -/* MCPWM_F0_EN : R/W ;bitpos:[0] ;default: 1'd0 ; */ -/*description: Set to enable generation of event_f0*/ -#define MCPWM_F0_EN (BIT(0)) -#define MCPWM_F0_EN_M (BIT(0)) -#define MCPWM_F0_EN_V 0x1 -#define MCPWM_F0_EN_S 0 - -#define MCPWM_CAP_TIMER_CFG_REG(i) (REG_MCPWM_BASE(i) + 0x00e8) -/* MCPWM_CAP_SYNC_SW : WO ;bitpos:[5] ;default: 1'd0 ; */ -/*description: Set this bit to force a capture timer sync capture timer is - loaded with value in phase register.*/ -#define MCPWM_CAP_SYNC_SW (BIT(5)) -#define MCPWM_CAP_SYNC_SW_M (BIT(5)) -#define MCPWM_CAP_SYNC_SW_V 0x1 -#define MCPWM_CAP_SYNC_SW_S 5 -/* MCPWM_CAP_SYNCI_SEL : R/W ;bitpos:[4:2] ;default: 3'd0 ; */ -/*description: Capture module sync input selection. 0: none 1: timer0 synco - 2: timer1 synco 3: timer2 synco 4: SYNC0 from GPIO matrix 5: SYNC1 from GPIO matrix 6: SYNC2 from GPIO matrix*/ -#define MCPWM_CAP_SYNCI_SEL 0x00000007 -#define MCPWM_CAP_SYNCI_SEL_M ((MCPWM_CAP_SYNCI_SEL_V)<<(MCPWM_CAP_SYNCI_SEL_S)) -#define MCPWM_CAP_SYNCI_SEL_V 0x7 -#define MCPWM_CAP_SYNCI_SEL_S 2 -/* MCPWM_CAP_SYNCI_EN : R/W ;bitpos:[1] ;default: 1'd0 ; */ -/*description: When set capture timer sync is enabled.*/ -#define MCPWM_CAP_SYNCI_EN (BIT(1)) -#define MCPWM_CAP_SYNCI_EN_M (BIT(1)) -#define MCPWM_CAP_SYNCI_EN_V 0x1 -#define MCPWM_CAP_SYNCI_EN_S 1 -/* MCPWM_CAP_TIMER_EN : R/W ;bitpos:[0] ;default: 1'd0 ; */ -/*description: When set capture timer incrementing under APB_clk is enabled.*/ -#define MCPWM_CAP_TIMER_EN (BIT(0)) -#define MCPWM_CAP_TIMER_EN_M (BIT(0)) -#define MCPWM_CAP_TIMER_EN_V 0x1 -#define MCPWM_CAP_TIMER_EN_S 0 - -#define MCPWM_CAP_TIMER_PHASE_REG(i) (REG_MCPWM_BASE(i) + 0x00ec) -/* MCPWM_CAP_PHASE : R/W ;bitpos:[31:0] ;default: 32'd0 ; */ -/*description: Phase value for capture timer sync operation.*/ -#define MCPWM_CAP_PHASE 0xFFFFFFFF -#define MCPWM_CAP_PHASE_M ((MCPWM_CAP_PHASE_V)<<(MCPWM_CAP_PHASE_S)) -#define MCPWM_CAP_PHASE_V 0xFFFFFFFF -#define MCPWM_CAP_PHASE_S 0 - -#define MCPWM_CAP_CH0_CFG_REG(i) (REG_MCPWM_BASE(i) + 0x00f0) -/* MCPWM_CAP0_SW : WO ;bitpos:[12] ;default: 1'd0 ; */ -/*description: Write 1 will trigger a software forced capture on channel 0*/ -#define MCPWM_CAP0_SW (BIT(12)) -#define MCPWM_CAP0_SW_M (BIT(12)) -#define MCPWM_CAP0_SW_V 0x1 -#define MCPWM_CAP0_SW_S 12 -/* MCPWM_CAP0_IN_INVERT : R/W ;bitpos:[11] ;default: 1'd0 ; */ -/*description: When set CAP0 form GPIO matrix is inverted before prescale*/ -#define MCPWM_CAP0_IN_INVERT (BIT(11)) -#define MCPWM_CAP0_IN_INVERT_M (BIT(11)) -#define MCPWM_CAP0_IN_INVERT_V 0x1 -#define MCPWM_CAP0_IN_INVERT_S 11 -/* MCPWM_CAP0_PRESCALE : R/W ;bitpos:[10:3] ;default: 8'd0 ; */ -/*description: Value of prescale on possitive edge of CAP0. Prescale value = - PWM_CAP0_PRESCALE + 1*/ -#define MCPWM_CAP0_PRESCALE 0x000000FF -#define MCPWM_CAP0_PRESCALE_M ((MCPWM_CAP0_PRESCALE_V)<<(MCPWM_CAP0_PRESCALE_S)) -#define MCPWM_CAP0_PRESCALE_V 0xFF -#define MCPWM_CAP0_PRESCALE_S 3 -/* MCPWM_CAP0_MODE : R/W ;bitpos:[2:1] ;default: 2'd0 ; */ -/*description: Edge of capture on channel 0 after prescale. bit0: negedge cap - en bit1: posedge cap en*/ -#define MCPWM_CAP0_MODE 0x00000003 -#define MCPWM_CAP0_MODE_M ((MCPWM_CAP0_MODE_V)<<(MCPWM_CAP0_MODE_S)) -#define MCPWM_CAP0_MODE_V 0x3 -#define MCPWM_CAP0_MODE_S 1 -/* MCPWM_CAP0_EN : R/W ;bitpos:[0] ;default: 1'd0 ; */ -/*description: When set capture on channel 0 is enabled*/ -#define MCPWM_CAP0_EN (BIT(0)) -#define MCPWM_CAP0_EN_M (BIT(0)) -#define MCPWM_CAP0_EN_V 0x1 -#define MCPWM_CAP0_EN_S 0 - -#define MCPWM_CAP_CH1_CFG_REG(i) (REG_MCPWM_BASE(i) + 0x00f4) -/* MCPWM_CAP1_SW : WO ;bitpos:[12] ;default: 1'd0 ; */ -/*description: Write 1 will trigger a software forced capture on channel 1*/ -#define MCPWM_CAP1_SW (BIT(12)) -#define MCPWM_CAP1_SW_M (BIT(12)) -#define MCPWM_CAP1_SW_V 0x1 -#define MCPWM_CAP1_SW_S 12 -/* MCPWM_CAP1_IN_INVERT : R/W ;bitpos:[11] ;default: 1'd0 ; */ -/*description: When set CAP1 form GPIO matrix is inverted before prescale*/ -#define MCPWM_CAP1_IN_INVERT (BIT(11)) -#define MCPWM_CAP1_IN_INVERT_M (BIT(11)) -#define MCPWM_CAP1_IN_INVERT_V 0x1 -#define MCPWM_CAP1_IN_INVERT_S 11 -/* MCPWM_CAP1_PRESCALE : R/W ;bitpos:[10:3] ;default: 8'd0 ; */ -/*description: Value of prescale on possitive edge of CAP1. Prescale value = - PWM_CAP1_PRESCALE + 1*/ -#define MCPWM_CAP1_PRESCALE 0x000000FF -#define MCPWM_CAP1_PRESCALE_M ((MCPWM_CAP1_PRESCALE_V)<<(MCPWM_CAP1_PRESCALE_S)) -#define MCPWM_CAP1_PRESCALE_V 0xFF -#define MCPWM_CAP1_PRESCALE_S 3 -/* MCPWM_CAP1_MODE : R/W ;bitpos:[2:1] ;default: 2'd0 ; */ -/*description: Edge of capture on channel 1 after prescale. bit0: negedge cap - en bit1: posedge cap en*/ -#define MCPWM_CAP1_MODE 0x00000003 -#define MCPWM_CAP1_MODE_M ((MCPWM_CAP1_MODE_V)<<(MCPWM_CAP1_MODE_S)) -#define MCPWM_CAP1_MODE_V 0x3 -#define MCPWM_CAP1_MODE_S 1 -/* MCPWM_CAP1_EN : R/W ;bitpos:[0] ;default: 1'd0 ; */ -/*description: When set capture on channel 1 is enabled*/ -#define MCPWM_CAP1_EN (BIT(0)) -#define MCPWM_CAP1_EN_M (BIT(0)) -#define MCPWM_CAP1_EN_V 0x1 -#define MCPWM_CAP1_EN_S 0 - -#define MCPWM_CAP_CH2_CFG_REG(i) (REG_MCPWM_BASE(i) + 0x00f8) -/* MCPWM_CAP2_SW : WO ;bitpos:[12] ;default: 1'd0 ; */ -/*description: Write 1 will trigger a software forced capture on channel 2*/ -#define MCPWM_CAP2_SW (BIT(12)) -#define MCPWM_CAP2_SW_M (BIT(12)) -#define MCPWM_CAP2_SW_V 0x1 -#define MCPWM_CAP2_SW_S 12 -/* MCPWM_CAP2_IN_INVERT : R/W ;bitpos:[11] ;default: 1'd0 ; */ -/*description: When set CAP2 form GPIO matrix is inverted before prescale*/ -#define MCPWM_CAP2_IN_INVERT (BIT(11)) -#define MCPWM_CAP2_IN_INVERT_M (BIT(11)) -#define MCPWM_CAP2_IN_INVERT_V 0x1 -#define MCPWM_CAP2_IN_INVERT_S 11 -/* MCPWM_CAP2_PRESCALE : R/W ;bitpos:[10:3] ;default: 8'd0 ; */ -/*description: Value of prescale on possitive edge of CAP2. Prescale value = - PWM_CAP2_PRESCALE + 1*/ -#define MCPWM_CAP2_PRESCALE 0x000000FF -#define MCPWM_CAP2_PRESCALE_M ((MCPWM_CAP2_PRESCALE_V)<<(MCPWM_CAP2_PRESCALE_S)) -#define MCPWM_CAP2_PRESCALE_V 0xFF -#define MCPWM_CAP2_PRESCALE_S 3 -/* MCPWM_CAP2_MODE : R/W ;bitpos:[2:1] ;default: 2'd0 ; */ -/*description: Edge of capture on channel 2 after prescale. bit0: negedge cap - en bit1: posedge cap en*/ -#define MCPWM_CAP2_MODE 0x00000003 -#define MCPWM_CAP2_MODE_M ((MCPWM_CAP2_MODE_V)<<(MCPWM_CAP2_MODE_S)) -#define MCPWM_CAP2_MODE_V 0x3 -#define MCPWM_CAP2_MODE_S 1 -/* MCPWM_CAP2_EN : R/W ;bitpos:[0] ;default: 1'd0 ; */ -/*description: When set capture on channel 2 is enabled*/ -#define MCPWM_CAP2_EN (BIT(0)) -#define MCPWM_CAP2_EN_M (BIT(0)) -#define MCPWM_CAP2_EN_V 0x1 -#define MCPWM_CAP2_EN_S 0 - -#define MCPWM_CAP_CH0_REG(i) (REG_MCPWM_BASE(i) + 0x00fc) -/* MCPWM_CAP0_VALUE : RO ;bitpos:[31:0] ;default: 32'd0 ; */ -/*description: Value of last capture on channel 0*/ -#define MCPWM_CAP0_VALUE 0xFFFFFFFF -#define MCPWM_CAP0_VALUE_M ((MCPWM_CAP0_VALUE_V)<<(MCPWM_CAP0_VALUE_S)) -#define MCPWM_CAP0_VALUE_V 0xFFFFFFFF -#define MCPWM_CAP0_VALUE_S 0 - -#define MCPWM_CAP_CH1_REG(i) (REG_MCPWM_BASE(i) + 0x0100) -/* MCPWM_CAP1_VALUE : RO ;bitpos:[31:0] ;default: 32'd0 ; */ -/*description: Value of last capture on channel 1*/ -#define MCPWM_CAP1_VALUE 0xFFFFFFFF -#define MCPWM_CAP1_VALUE_M ((MCPWM_CAP1_VALUE_V)<<(MCPWM_CAP1_VALUE_S)) -#define MCPWM_CAP1_VALUE_V 0xFFFFFFFF -#define MCPWM_CAP1_VALUE_S 0 - -#define MCPWM_CAP_CH2_REG(i) (REG_MCPWM_BASE(i) + 0x0104) -/* MCPWM_CAP2_VALUE : RO ;bitpos:[31:0] ;default: 32'd0 ; */ -/*description: Value of last capture on channel 2*/ -#define MCPWM_CAP2_VALUE 0xFFFFFFFF -#define MCPWM_CAP2_VALUE_M ((MCPWM_CAP2_VALUE_V)<<(MCPWM_CAP2_VALUE_S)) -#define MCPWM_CAP2_VALUE_V 0xFFFFFFFF -#define MCPWM_CAP2_VALUE_S 0 - -#define MCPWM_CAP_STATUS_REG(i) (REG_MCPWM_BASE(i) + 0x0108) -/* MCPWM_CAP2_EDGE : RO ;bitpos:[2] ;default: 1'd0 ; */ -/*description: Edge of last capture trigger on channel 2 0: posedge 1: negedge*/ -#define MCPWM_CAP2_EDGE (BIT(2)) -#define MCPWM_CAP2_EDGE_M (BIT(2)) -#define MCPWM_CAP2_EDGE_V 0x1 -#define MCPWM_CAP2_EDGE_S 2 -/* MCPWM_CAP1_EDGE : RO ;bitpos:[1] ;default: 1'd0 ; */ -/*description: Edge of last capture trigger on channel 1 0: posedge 1: negedge*/ -#define MCPWM_CAP1_EDGE (BIT(1)) -#define MCPWM_CAP1_EDGE_M (BIT(1)) -#define MCPWM_CAP1_EDGE_V 0x1 -#define MCPWM_CAP1_EDGE_S 1 -/* MCPWM_CAP0_EDGE : RO ;bitpos:[0] ;default: 1'd0 ; */ -/*description: Edge of last capture trigger on channel 0 0: posedge 1: negedge*/ -#define MCPWM_CAP0_EDGE (BIT(0)) -#define MCPWM_CAP0_EDGE_M (BIT(0)) -#define MCPWM_CAP0_EDGE_V 0x1 -#define MCPWM_CAP0_EDGE_S 0 - -#define MCPWM_UPDATE_CFG_REG(i) (REG_MCPWM_BASE(i) + 0x010c) -/* MCPWM_OP2_FORCE_UP : R/W ;bitpos:[7] ;default: 1'd0 ; */ -/*description: A toggle (software negation of value of this bit) will trigger - a forced update of active registers in PWM operator 2*/ -#define MCPWM_OP2_FORCE_UP (BIT(7)) -#define MCPWM_OP2_FORCE_UP_M (BIT(7)) -#define MCPWM_OP2_FORCE_UP_V 0x1 -#define MCPWM_OP2_FORCE_UP_S 7 -/* MCPWM_OP2_UP_EN : R/W ;bitpos:[6] ;default: 1'd1 ; */ -/*description: When set and PWM_GLOBAL_UP_EN is set update of active registers - in PWM operator 2 are enabled*/ -#define MCPWM_OP2_UP_EN (BIT(6)) -#define MCPWM_OP2_UP_EN_M (BIT(6)) -#define MCPWM_OP2_UP_EN_V 0x1 -#define MCPWM_OP2_UP_EN_S 6 -/* MCPWM_OP1_FORCE_UP : R/W ;bitpos:[5] ;default: 1'd0 ; */ -/*description: A toggle (software negation of value of this bit) will trigger - a forced update of active registers in PWM operator 1*/ -#define MCPWM_OP1_FORCE_UP (BIT(5)) -#define MCPWM_OP1_FORCE_UP_M (BIT(5)) -#define MCPWM_OP1_FORCE_UP_V 0x1 -#define MCPWM_OP1_FORCE_UP_S 5 -/* MCPWM_OP1_UP_EN : R/W ;bitpos:[4] ;default: 1'd1 ; */ -/*description: When set and PWM_GLOBAL_UP_EN is set update of active registers - in PWM operator 1 are enabled*/ -#define MCPWM_OP1_UP_EN (BIT(4)) -#define MCPWM_OP1_UP_EN_M (BIT(4)) -#define MCPWM_OP1_UP_EN_V 0x1 -#define MCPWM_OP1_UP_EN_S 4 -/* MCPWM_OP0_FORCE_UP : R/W ;bitpos:[3] ;default: 1'd0 ; */ -/*description: A toggle (software negation of value of this bit) will trigger - a forced update of active registers in PWM operator 0*/ -#define MCPWM_OP0_FORCE_UP (BIT(3)) -#define MCPWM_OP0_FORCE_UP_M (BIT(3)) -#define MCPWM_OP0_FORCE_UP_V 0x1 -#define MCPWM_OP0_FORCE_UP_S 3 -/* MCPWM_OP0_UP_EN : R/W ;bitpos:[2] ;default: 1'd1 ; */ -/*description: When set and PWM_GLOBAL_UP_EN is set update of active registers - in PWM operator 0 are enabled*/ -#define MCPWM_OP0_UP_EN (BIT(2)) -#define MCPWM_OP0_UP_EN_M (BIT(2)) -#define MCPWM_OP0_UP_EN_V 0x1 -#define MCPWM_OP0_UP_EN_S 2 -/* MCPWM_GLOBAL_FORCE_UP : R/W ;bitpos:[1] ;default: 1'd0 ; */ -/*description: A toggle (software negation of value of this bit) will trigger - a forced update of all active registers in MCPWM module*/ -#define MCPWM_GLOBAL_FORCE_UP (BIT(1)) -#define MCPWM_GLOBAL_FORCE_UP_M (BIT(1)) -#define MCPWM_GLOBAL_FORCE_UP_V 0x1 -#define MCPWM_GLOBAL_FORCE_UP_S 1 -/* MCPWM_GLOBAL_UP_EN : R/W ;bitpos:[0] ;default: 1'd1 ; */ -/*description: The global enable of update of all active registers in MCPWM module*/ -#define MCPWM_GLOBAL_UP_EN (BIT(0)) -#define MCPWM_GLOBAL_UP_EN_M (BIT(0)) -#define MCPWM_GLOBAL_UP_EN_V 0x1 -#define MCPWM_GLOBAL_UP_EN_S 0 - -#define MCMCPWM_INT_ENA_MCPWM_REG(i) (REG_MCPWM_BASE(i) + 0x0110) -/* MCPWM_CAP2_INT_ENA : R/W ;bitpos:[29] ;default: 1'd0 ; */ -/*description: The enable bit for interrupt triggered by captureon channel 2*/ -#define MCPWM_CAP2_INT_ENA (BIT(29)) -#define MCPWM_CAP2_INT_ENA_M (BIT(29)) -#define MCPWM_CAP2_INT_ENA_V 0x1 -#define MCPWM_CAP2_INT_ENA_S 29 -/* MCPWM_CAP1_INT_ENA : R/W ;bitpos:[28] ;default: 1'd0 ; */ -/*description: The enable bit for interrupt triggered by captureon channel 1*/ -#define MCPWM_CAP1_INT_ENA (BIT(28)) -#define MCPWM_CAP1_INT_ENA_M (BIT(28)) -#define MCPWM_CAP1_INT_ENA_V 0x1 -#define MCPWM_CAP1_INT_ENA_S 28 -/* MCPWM_CAP0_INT_ENA : R/W ;bitpos:[27] ;default: 1'd0 ; */ -/*description: The enable bit for interrupt triggered by captureon channel 0*/ -#define MCPWM_CAP0_INT_ENA (BIT(27)) -#define MCPWM_CAP0_INT_ENA_M (BIT(27)) -#define MCPWM_CAP0_INT_ENA_V 0x1 -#define MCPWM_CAP0_INT_ENA_S 27 -/* MCPWM_FH2_OST_INT_ENA : R/W ;bitpos:[26] ;default: 1'd0 ; */ -/*description: The enable bit for interrupt triggered by an one-shot mode action on PWM2*/ -#define MCPWM_FH2_OST_INT_ENA (BIT(26)) -#define MCPWM_FH2_OST_INT_ENA_M (BIT(26)) -#define MCPWM_FH2_OST_INT_ENA_V 0x1 -#define MCPWM_FH2_OST_INT_ENA_S 26 -/* MCPWM_FH1_OST_INT_ENA : R/W ;bitpos:[25] ;default: 1'd0 ; */ -/*description: The enable bit for interrupt triggered by an one-shot mode action on PWM0*/ -#define MCPWM_FH1_OST_INT_ENA (BIT(25)) -#define MCPWM_FH1_OST_INT_ENA_M (BIT(25)) -#define MCPWM_FH1_OST_INT_ENA_V 0x1 -#define MCPWM_FH1_OST_INT_ENA_S 25 -/* MCPWM_FH0_OST_INT_ENA : R/W ;bitpos:[24] ;default: 1'd0 ; */ -/*description: The enable bit for interrupt triggered by an one-shot mode action on PWM0*/ -#define MCPWM_FH0_OST_INT_ENA (BIT(24)) -#define MCPWM_FH0_OST_INT_ENA_M (BIT(24)) -#define MCPWM_FH0_OST_INT_ENA_V 0x1 -#define MCPWM_FH0_OST_INT_ENA_S 24 -/* MCPWM_FH2_CBC_INT_ENA : R/W ;bitpos:[23] ;default: 1'd0 ; */ -/*description: The enable bit for interrupt triggered by an cycle-by-cycle mode action on PWM2*/ -#define MCPWM_FH2_CBC_INT_ENA (BIT(23)) -#define MCPWM_FH2_CBC_INT_ENA_M (BIT(23)) -#define MCPWM_FH2_CBC_INT_ENA_V 0x1 -#define MCPWM_FH2_CBC_INT_ENA_S 23 -/* MCPWM_FH1_CBC_INT_ENA : R/W ;bitpos:[22] ;default: 1'd0 ; */ -/*description: The enable bit for interrupt triggered by an cycle-by-cycle mode action on PWM1*/ -#define MCPWM_FH1_CBC_INT_ENA (BIT(22)) -#define MCPWM_FH1_CBC_INT_ENA_M (BIT(22)) -#define MCPWM_FH1_CBC_INT_ENA_V 0x1 -#define MCPWM_FH1_CBC_INT_ENA_S 22 -/* MCPWM_FH0_CBC_INT_ENA : R/W ;bitpos:[21] ;default: 1'd0 ; */ -/*description: The enable bit for interrupt triggered by an cycle-by-cycle mode action on PWM0*/ -#define MCPWM_FH0_CBC_INT_ENA (BIT(21)) -#define MCPWM_FH0_CBC_INT_ENA_M (BIT(21)) -#define MCPWM_FH0_CBC_INT_ENA_V 0x1 -#define MCPWM_FH0_CBC_INT_ENA_S 21 -/* MCPWM_OP2_TEB_INT_ENA : R/W ;bitpos:[20] ;default: 1'd0 ; */ -/*description: The enable bit for interrupt triggered by a PWM operator 2 TEB event*/ -#define MCPWM_OP2_TEB_INT_ENA (BIT(20)) -#define MCPWM_OP2_TEB_INT_ENA_M (BIT(20)) -#define MCPWM_OP2_TEB_INT_ENA_V 0x1 -#define MCPWM_OP2_TEB_INT_ENA_S 20 -/* MCPWM_OP1_TEB_INT_ENA : R/W ;bitpos:[19] ;default: 1'd0 ; */ -/*description: The enable bit for interrupt triggered by a PWM operator 1 TEB event*/ -#define MCPWM_OP1_TEB_INT_ENA (BIT(19)) -#define MCPWM_OP1_TEB_INT_ENA_M (BIT(19)) -#define MCPWM_OP1_TEB_INT_ENA_V 0x1 -#define MCPWM_OP1_TEB_INT_ENA_S 19 -/* MCPWM_OP0_TEB_INT_ENA : R/W ;bitpos:[18] ;default: 1'd0 ; */ -/*description: The enable bit for interrupt triggered by a PWM operator 0 TEB event*/ -#define MCPWM_OP0_TEB_INT_ENA (BIT(18)) -#define MCPWM_OP0_TEB_INT_ENA_M (BIT(18)) -#define MCPWM_OP0_TEB_INT_ENA_V 0x1 -#define MCPWM_OP0_TEB_INT_ENA_S 18 -/* MCPWM_OP2_TEA_INT_ENA : R/W ;bitpos:[17] ;default: 1'd0 ; */ -/*description: The enable bit for interrupt triggered by a PWM operator 2 TEA event*/ -#define MCPWM_OP2_TEA_INT_ENA (BIT(17)) -#define MCPWM_OP2_TEA_INT_ENA_M (BIT(17)) -#define MCPWM_OP2_TEA_INT_ENA_V 0x1 -#define MCPWM_OP2_TEA_INT_ENA_S 17 -/* MCPWM_OP1_TEA_INT_ENA : R/W ;bitpos:[16] ;default: 1'd0 ; */ -/*description: The enable bit for interrupt triggered by a PWM operator 1 TEA event*/ -#define MCPWM_OP1_TEA_INT_ENA (BIT(16)) -#define MCPWM_OP1_TEA_INT_ENA_M (BIT(16)) -#define MCPWM_OP1_TEA_INT_ENA_V 0x1 -#define MCPWM_OP1_TEA_INT_ENA_S 16 -/* MCPWM_OP0_TEA_INT_ENA : R/W ;bitpos:[15] ;default: 1'd0 ; */ -/*description: The enable bit for interrupt triggered by a PWM operator 0 TEA event*/ -#define MCPWM_OP0_TEA_INT_ENA (BIT(15)) -#define MCPWM_OP0_TEA_INT_ENA_M (BIT(15)) -#define MCPWM_OP0_TEA_INT_ENA_V 0x1 -#define MCPWM_OP0_TEA_INT_ENA_S 15 -/* MCPWM_FAULT2_CLR_INT_ENA : R/W ;bitpos:[14] ;default: 1'd0 ; */ -/*description: The enable bit for interrupt triggered when event_f2 ends*/ -#define MCPWM_FAULT2_CLR_INT_ENA (BIT(14)) -#define MCPWM_FAULT2_CLR_INT_ENA_M (BIT(14)) -#define MCPWM_FAULT2_CLR_INT_ENA_V 0x1 -#define MCPWM_FAULT2_CLR_INT_ENA_S 14 -/* MCPWM_FAULT1_CLR_INT_ENA : R/W ;bitpos:[13] ;default: 1'd0 ; */ -/*description: The enable bit for interrupt triggered when event_f1 ends*/ -#define MCPWM_FAULT1_CLR_INT_ENA (BIT(13)) -#define MCPWM_FAULT1_CLR_INT_ENA_M (BIT(13)) -#define MCPWM_FAULT1_CLR_INT_ENA_V 0x1 -#define MCPWM_FAULT1_CLR_INT_ENA_S 13 -/* MCPWM_FAULT0_CLR_INT_ENA : R/W ;bitpos:[12] ;default: 1'd0 ; */ -/*description: The enable bit for interrupt triggered when event_f0 ends*/ -#define MCPWM_FAULT0_CLR_INT_ENA (BIT(12)) -#define MCPWM_FAULT0_CLR_INT_ENA_M (BIT(12)) -#define MCPWM_FAULT0_CLR_INT_ENA_V 0x1 -#define MCPWM_FAULT0_CLR_INT_ENA_S 12 -/* MCPWM_FAULT2_INT_ENA : R/W ;bitpos:[11] ;default: 1'd0 ; */ -/*description: The enable bit for interrupt triggered when event_f2 starts*/ -#define MCPWM_FAULT2_INT_ENA (BIT(11)) -#define MCPWM_FAULT2_INT_ENA_M (BIT(11)) -#define MCPWM_FAULT2_INT_ENA_V 0x1 -#define MCPWM_FAULT2_INT_ENA_S 11 -/* MCPWM_FAULT1_INT_ENA : R/W ;bitpos:[10] ;default: 1'd0 ; */ -/*description: The enable bit for interrupt triggered when event_f1 starts*/ -#define MCPWM_FAULT1_INT_ENA (BIT(10)) -#define MCPWM_FAULT1_INT_ENA_M (BIT(10)) -#define MCPWM_FAULT1_INT_ENA_V 0x1 -#define MCPWM_FAULT1_INT_ENA_S 10 -/* MCPWM_FAULT0_INT_ENA : R/W ;bitpos:[9] ;default: 1'd0 ; */ -/*description: The enable bit for interrupt triggered when event_f0 starts*/ -#define MCPWM_FAULT0_INT_ENA (BIT(9)) -#define MCPWM_FAULT0_INT_ENA_M (BIT(9)) -#define MCPWM_FAULT0_INT_ENA_V 0x1 -#define MCPWM_FAULT0_INT_ENA_S 9 -/* MCPWM_TIMER2_TEP_INT_ENA : R/W ;bitpos:[8] ;default: 1'h0 ; */ -/*description: The enable bit for interrupt triggered by a PWM timer 2 TEP event*/ -#define MCPWM_TIMER2_TEP_INT_ENA (BIT(8)) -#define MCPWM_TIMER2_TEP_INT_ENA_M (BIT(8)) -#define MCPWM_TIMER2_TEP_INT_ENA_V 0x1 -#define MCPWM_TIMER2_TEP_INT_ENA_S 8 -/* MCPWM_TIMER1_TEP_INT_ENA : R/W ;bitpos:[7] ;default: 1'h0 ; */ -/*description: The enable bit for interrupt triggered by a PWM timer 1 TEP event*/ -#define MCPWM_TIMER1_TEP_INT_ENA (BIT(7)) -#define MCPWM_TIMER1_TEP_INT_ENA_M (BIT(7)) -#define MCPWM_TIMER1_TEP_INT_ENA_V 0x1 -#define MCPWM_TIMER1_TEP_INT_ENA_S 7 -/* MCPWM_TIMER0_TEP_INT_ENA : R/W ;bitpos:[6] ;default: 1'h0 ; */ -/*description: The enable bit for interrupt triggered by a PWM timer 0 TEP event*/ -#define MCPWM_TIMER0_TEP_INT_ENA (BIT(6)) -#define MCPWM_TIMER0_TEP_INT_ENA_M (BIT(6)) -#define MCPWM_TIMER0_TEP_INT_ENA_V 0x1 -#define MCPWM_TIMER0_TEP_INT_ENA_S 6 -/* MCPWM_TIMER2_TEZ_INT_ENA : R/W ;bitpos:[5] ;default: 1'h0 ; */ -/*description: The enable bit for interrupt triggered by a PWM timer 2 TEZ event*/ -#define MCPWM_TIMER2_TEZ_INT_ENA (BIT(5)) -#define MCPWM_TIMER2_TEZ_INT_ENA_M (BIT(5)) -#define MCPWM_TIMER2_TEZ_INT_ENA_V 0x1 -#define MCPWM_TIMER2_TEZ_INT_ENA_S 5 -/* MCPWM_TIMER1_TEZ_INT_ENA : R/W ;bitpos:[4] ;default: 1'h0 ; */ -/*description: The enable bit for interrupt triggered by a PWM timer 1 TEZ event*/ -#define MCPWM_TIMER1_TEZ_INT_ENA (BIT(4)) -#define MCPWM_TIMER1_TEZ_INT_ENA_M (BIT(4)) -#define MCPWM_TIMER1_TEZ_INT_ENA_V 0x1 -#define MCPWM_TIMER1_TEZ_INT_ENA_S 4 -/* MCPWM_TIMER0_TEZ_INT_ENA : R/W ;bitpos:[3] ;default: 1'h0 ; */ -/*description: The enable bit for interrupt triggered by a PWM timer 0 TEZ event*/ -#define MCPWM_TIMER0_TEZ_INT_ENA (BIT(3)) -#define MCPWM_TIMER0_TEZ_INT_ENA_M (BIT(3)) -#define MCPWM_TIMER0_TEZ_INT_ENA_V 0x1 -#define MCPWM_TIMER0_TEZ_INT_ENA_S 3 -/* MCPWM_TIMER2_STOP_INT_ENA : R/W ;bitpos:[2] ;default: 1'h0 ; */ -/*description: The enable bit for interrupt triggered when timer 2 stops*/ -#define MCPWM_TIMER2_STOP_INT_ENA (BIT(2)) -#define MCPWM_TIMER2_STOP_INT_ENA_M (BIT(2)) -#define MCPWM_TIMER2_STOP_INT_ENA_V 0x1 -#define MCPWM_TIMER2_STOP_INT_ENA_S 2 -/* MCPWM_TIMER1_STOP_INT_ENA : R/W ;bitpos:[1] ;default: 1'h0 ; */ -/*description: The enable bit for interrupt triggered when timer 1 stops*/ -#define MCPWM_TIMER1_STOP_INT_ENA (BIT(1)) -#define MCPWM_TIMER1_STOP_INT_ENA_M (BIT(1)) -#define MCPWM_TIMER1_STOP_INT_ENA_V 0x1 -#define MCPWM_TIMER1_STOP_INT_ENA_S 1 -/* MCPWM_TIMER0_STOP_INT_ENA : R/W ;bitpos:[0] ;default: 1'h0 ; */ -/*description: The enable bit for interrupt triggered when timer 0 stops*/ -#define MCPWM_TIMER0_STOP_INT_ENA (BIT(0)) -#define MCPWM_TIMER0_STOP_INT_ENA_M (BIT(0)) -#define MCPWM_TIMER0_STOP_INT_ENA_V 0x1 -#define MCPWM_TIMER0_STOP_INT_ENA_S 0 - -#define MCMCPWM_INT_RAW_MCPWM_REG(i) (REG_MCPWM_BASE(i) + 0x0114) -/* MCPWM_CAP2_INT_RAW : RO ;bitpos:[29] ;default: 1'd0 ; */ -/*description: The raw status bit for interrupt triggered by captureon channel 2*/ -#define MCPWM_CAP2_INT_RAW (BIT(29)) -#define MCPWM_CAP2_INT_RAW_M (BIT(29)) -#define MCPWM_CAP2_INT_RAW_V 0x1 -#define MCPWM_CAP2_INT_RAW_S 29 -/* MCPWM_CAP1_INT_RAW : RO ;bitpos:[28] ;default: 1'd0 ; */ -/*description: The raw status bit for interrupt triggered by captureon channel 1*/ -#define MCPWM_CAP1_INT_RAW (BIT(28)) -#define MCPWM_CAP1_INT_RAW_M (BIT(28)) -#define MCPWM_CAP1_INT_RAW_V 0x1 -#define MCPWM_CAP1_INT_RAW_S 28 -/* MCPWM_CAP0_INT_RAW : RO ;bitpos:[27] ;default: 1'd0 ; */ -/*description: The raw status bit for interrupt triggered by captureon channel 0*/ -#define MCPWM_CAP0_INT_RAW (BIT(27)) -#define MCPWM_CAP0_INT_RAW_M (BIT(27)) -#define MCPWM_CAP0_INT_RAW_V 0x1 -#define MCPWM_CAP0_INT_RAW_S 27 -/* MCPWM_FH2_OST_INT_RAW : RO ;bitpos:[26] ;default: 1'd0 ; */ -/*description: The raw status bit for interrupt triggered by an one-shot mode action on PWM2*/ -#define MCPWM_FH2_OST_INT_RAW (BIT(26)) -#define MCPWM_FH2_OST_INT_RAW_M (BIT(26)) -#define MCPWM_FH2_OST_INT_RAW_V 0x1 -#define MCPWM_FH2_OST_INT_RAW_S 26 -/* MCPWM_FH1_OST_INT_RAW : RO ;bitpos:[25] ;default: 1'd0 ; */ -/*description: The raw status bit for interrupt triggered by an one-shot mode action on PWM0*/ -#define MCPWM_FH1_OST_INT_RAW (BIT(25)) -#define MCPWM_FH1_OST_INT_RAW_M (BIT(25)) -#define MCPWM_FH1_OST_INT_RAW_V 0x1 -#define MCPWM_FH1_OST_INT_RAW_S 25 -/* MCPWM_FH0_OST_INT_RAW : RO ;bitpos:[24] ;default: 1'd0 ; */ -/*description: The raw status bit for interrupt triggered by an one-shot mode action on PWM0*/ -#define MCPWM_FH0_OST_INT_RAW (BIT(24)) -#define MCPWM_FH0_OST_INT_RAW_M (BIT(24)) -#define MCPWM_FH0_OST_INT_RAW_V 0x1 -#define MCPWM_FH0_OST_INT_RAW_S 24 -/* MCPWM_FH2_CBC_INT_RAW : RO ;bitpos:[23] ;default: 1'd0 ; */ -/*description: The raw status bit for interrupt triggered by an cycle-by-cycle - mode action on PWM2*/ -#define MCPWM_FH2_CBC_INT_RAW (BIT(23)) -#define MCPWM_FH2_CBC_INT_RAW_M (BIT(23)) -#define MCPWM_FH2_CBC_INT_RAW_V 0x1 -#define MCPWM_FH2_CBC_INT_RAW_S 23 -/* MCPWM_FH1_CBC_INT_RAW : RO ;bitpos:[22] ;default: 1'd0 ; */ -/*description: The raw status bit for interrupt triggered by an cycle-by-cycle - mode action on PWM1*/ -#define MCPWM_FH1_CBC_INT_RAW (BIT(22)) -#define MCPWM_FH1_CBC_INT_RAW_M (BIT(22)) -#define MCPWM_FH1_CBC_INT_RAW_V 0x1 -#define MCPWM_FH1_CBC_INT_RAW_S 22 -/* MCPWM_FH0_CBC_INT_RAW : RO ;bitpos:[21] ;default: 1'd0 ; */ -/*description: The raw status bit for interrupt triggered by an cycle-by-cycle - mode action on PWM0*/ -#define MCPWM_FH0_CBC_INT_RAW (BIT(21)) -#define MCPWM_FH0_CBC_INT_RAW_M (BIT(21)) -#define MCPWM_FH0_CBC_INT_RAW_V 0x1 -#define MCPWM_FH0_CBC_INT_RAW_S 21 -/* MCPWM_OP2_TEB_INT_RAW : RO ;bitpos:[20] ;default: 1'd0 ; */ -/*description: The raw status bit for interrupt triggered by a PWM operator 2 TEB event*/ -#define MCPWM_OP2_TEB_INT_RAW (BIT(20)) -#define MCPWM_OP2_TEB_INT_RAW_M (BIT(20)) -#define MCPWM_OP2_TEB_INT_RAW_V 0x1 -#define MCPWM_OP2_TEB_INT_RAW_S 20 -/* MCPWM_OP1_TEB_INT_RAW : RO ;bitpos:[19] ;default: 1'd0 ; */ -/*description: The raw status bit for interrupt triggered by a PWM operator 1 TEB event*/ -#define MCPWM_OP1_TEB_INT_RAW (BIT(19)) -#define MCPWM_OP1_TEB_INT_RAW_M (BIT(19)) -#define MCPWM_OP1_TEB_INT_RAW_V 0x1 -#define MCPWM_OP1_TEB_INT_RAW_S 19 -/* MCPWM_OP0_TEB_INT_RAW : RO ;bitpos:[18] ;default: 1'd0 ; */ -/*description: The raw status bit for interrupt triggered by a PWM operator 0 TEB event*/ -#define MCPWM_OP0_TEB_INT_RAW (BIT(18)) -#define MCPWM_OP0_TEB_INT_RAW_M (BIT(18)) -#define MCPWM_OP0_TEB_INT_RAW_V 0x1 -#define MCPWM_OP0_TEB_INT_RAW_S 18 -/* MCPWM_OP2_TEA_INT_RAW : RO ;bitpos:[17] ;default: 1'd0 ; */ -/*description: The raw status bit for interrupt triggered by a PWM operator 2 TEA event*/ -#define MCPWM_OP2_TEA_INT_RAW (BIT(17)) -#define MCPWM_OP2_TEA_INT_RAW_M (BIT(17)) -#define MCPWM_OP2_TEA_INT_RAW_V 0x1 -#define MCPWM_OP2_TEA_INT_RAW_S 17 -/* MCPWM_OP1_TEA_INT_RAW : RO ;bitpos:[16] ;default: 1'd0 ; */ -/*description: The raw status bit for interrupt triggered by a PWM operator 1 TEA event*/ -#define MCPWM_OP1_TEA_INT_RAW (BIT(16)) -#define MCPWM_OP1_TEA_INT_RAW_M (BIT(16)) -#define MCPWM_OP1_TEA_INT_RAW_V 0x1 -#define MCPWM_OP1_TEA_INT_RAW_S 16 -/* MCPWM_OP0_TEA_INT_RAW : RO ;bitpos:[15] ;default: 1'd0 ; */ -/*description: The raw status bit for interrupt triggered by a PWM operator 0 TEA event*/ -#define MCPWM_OP0_TEA_INT_RAW (BIT(15)) -#define MCPWM_OP0_TEA_INT_RAW_M (BIT(15)) -#define MCPWM_OP0_TEA_INT_RAW_V 0x1 -#define MCPWM_OP0_TEA_INT_RAW_S 15 -/* MCPWM_FAULT2_CLR_INT_RAW : RO ;bitpos:[14] ;default: 1'd0 ; */ -/*description: The raw status bit for interrupt triggered when event_f2 ends*/ -#define MCPWM_FAULT2_CLR_INT_RAW (BIT(14)) -#define MCPWM_FAULT2_CLR_INT_RAW_M (BIT(14)) -#define MCPWM_FAULT2_CLR_INT_RAW_V 0x1 -#define MCPWM_FAULT2_CLR_INT_RAW_S 14 -/* MCPWM_FAULT1_CLR_INT_RAW : RO ;bitpos:[13] ;default: 1'd0 ; */ -/*description: The raw status bit for interrupt triggered when event_f1 ends*/ -#define MCPWM_FAULT1_CLR_INT_RAW (BIT(13)) -#define MCPWM_FAULT1_CLR_INT_RAW_M (BIT(13)) -#define MCPWM_FAULT1_CLR_INT_RAW_V 0x1 -#define MCPWM_FAULT1_CLR_INT_RAW_S 13 -/* MCPWM_FAULT0_CLR_INT_RAW : RO ;bitpos:[12] ;default: 1'd0 ; */ -/*description: The raw status bit for interrupt triggered when event_f0 ends*/ -#define MCPWM_FAULT0_CLR_INT_RAW (BIT(12)) -#define MCPWM_FAULT0_CLR_INT_RAW_M (BIT(12)) -#define MCPWM_FAULT0_CLR_INT_RAW_V 0x1 -#define MCPWM_FAULT0_CLR_INT_RAW_S 12 -/* MCPWM_FAULT2_INT_RAW : RO ;bitpos:[11] ;default: 1'd0 ; */ -/*description: The raw status bit for interrupt triggered when event_f2 starts*/ -#define MCPWM_FAULT2_INT_RAW (BIT(11)) -#define MCPWM_FAULT2_INT_RAW_M (BIT(11)) -#define MCPWM_FAULT2_INT_RAW_V 0x1 -#define MCPWM_FAULT2_INT_RAW_S 11 -/* MCPWM_FAULT1_INT_RAW : RO ;bitpos:[10] ;default: 1'd0 ; */ -/*description: The raw status bit for interrupt triggered when event_f1 starts*/ -#define MCPWM_FAULT1_INT_RAW (BIT(10)) -#define MCPWM_FAULT1_INT_RAW_M (BIT(10)) -#define MCPWM_FAULT1_INT_RAW_V 0x1 -#define MCPWM_FAULT1_INT_RAW_S 10 -/* MCPWM_FAULT0_INT_RAW : RO ;bitpos:[9] ;default: 1'd0 ; */ -/*description: The raw status bit for interrupt triggered when event_f0 starts*/ -#define MCPWM_FAULT0_INT_RAW (BIT(9)) -#define MCPWM_FAULT0_INT_RAW_M (BIT(9)) -#define MCPWM_FAULT0_INT_RAW_V 0x1 -#define MCPWM_FAULT0_INT_RAW_S 9 -/* MCPWM_TIMER2_TEP_INT_RAW : RO ;bitpos:[8] ;default: 1'h0 ; */ -/*description: The raw status bit for interrupt triggered by a PWM timer 2 TEP event*/ -#define MCPWM_TIMER2_TEP_INT_RAW (BIT(8)) -#define MCPWM_TIMER2_TEP_INT_RAW_M (BIT(8)) -#define MCPWM_TIMER2_TEP_INT_RAW_V 0x1 -#define MCPWM_TIMER2_TEP_INT_RAW_S 8 -/* MCPWM_TIMER1_TEP_INT_RAW : RO ;bitpos:[7] ;default: 1'h0 ; */ -/*description: The raw status bit for interrupt triggered by a PWM timer 1 TEP event*/ -#define MCPWM_TIMER1_TEP_INT_RAW (BIT(7)) -#define MCPWM_TIMER1_TEP_INT_RAW_M (BIT(7)) -#define MCPWM_TIMER1_TEP_INT_RAW_V 0x1 -#define MCPWM_TIMER1_TEP_INT_RAW_S 7 -/* MCPWM_TIMER0_TEP_INT_RAW : RO ;bitpos:[6] ;default: 1'h0 ; */ -/*description: The raw status bit for interrupt triggered by a PWM timer 0 TEP event*/ -#define MCPWM_TIMER0_TEP_INT_RAW (BIT(6)) -#define MCPWM_TIMER0_TEP_INT_RAW_M (BIT(6)) -#define MCPWM_TIMER0_TEP_INT_RAW_V 0x1 -#define MCPWM_TIMER0_TEP_INT_RAW_S 6 -/* MCPWM_TIMER2_TEZ_INT_RAW : RO ;bitpos:[5] ;default: 1'h0 ; */ -/*description: The raw status bit for interrupt triggered by a PWM timer 2 TEZ event*/ -#define MCPWM_TIMER2_TEZ_INT_RAW (BIT(5)) -#define MCPWM_TIMER2_TEZ_INT_RAW_M (BIT(5)) -#define MCPWM_TIMER2_TEZ_INT_RAW_V 0x1 -#define MCPWM_TIMER2_TEZ_INT_RAW_S 5 -/* MCPWM_TIMER1_TEZ_INT_RAW : RO ;bitpos:[4] ;default: 1'h0 ; */ -/*description: The raw status bit for interrupt triggered by a PWM timer 1 TEZ event*/ -#define MCPWM_TIMER1_TEZ_INT_RAW (BIT(4)) -#define MCPWM_TIMER1_TEZ_INT_RAW_M (BIT(4)) -#define MCPWM_TIMER1_TEZ_INT_RAW_V 0x1 -#define MCPWM_TIMER1_TEZ_INT_RAW_S 4 -/* MCPWM_TIMER0_TEZ_INT_RAW : RO ;bitpos:[3] ;default: 1'h0 ; */ -/*description: The raw status bit for interrupt triggered by a PWM timer 0 TEZ event*/ -#define MCPWM_TIMER0_TEZ_INT_RAW (BIT(3)) -#define MCPWM_TIMER0_TEZ_INT_RAW_M (BIT(3)) -#define MCPWM_TIMER0_TEZ_INT_RAW_V 0x1 -#define MCPWM_TIMER0_TEZ_INT_RAW_S 3 -/* MCPWM_TIMER2_STOP_INT_RAW : RO ;bitpos:[2] ;default: 1'h0 ; */ -/*description: The raw status bit for interrupt triggered when timer 2 stops*/ -#define MCPWM_TIMER2_STOP_INT_RAW (BIT(2)) -#define MCPWM_TIMER2_STOP_INT_RAW_M (BIT(2)) -#define MCPWM_TIMER2_STOP_INT_RAW_V 0x1 -#define MCPWM_TIMER2_STOP_INT_RAW_S 2 -/* MCPWM_TIMER1_STOP_INT_RAW : RO ;bitpos:[1] ;default: 1'h0 ; */ -/*description: The raw status bit for interrupt triggered when timer 1 stops*/ -#define MCPWM_TIMER1_STOP_INT_RAW (BIT(1)) -#define MCPWM_TIMER1_STOP_INT_RAW_M (BIT(1)) -#define MCPWM_TIMER1_STOP_INT_RAW_V 0x1 -#define MCPWM_TIMER1_STOP_INT_RAW_S 1 -/* MCPWM_TIMER0_STOP_INT_RAW : RO ;bitpos:[0] ;default: 1'h0 ; */ -/*description: The raw status bit for interrupt triggered when timer 0 stops*/ -#define MCPWM_TIMER0_STOP_INT_RAW (BIT(0)) -#define MCPWM_TIMER0_STOP_INT_RAW_M (BIT(0)) -#define MCPWM_TIMER0_STOP_INT_RAW_V 0x1 -#define MCPWM_TIMER0_STOP_INT_RAW_S 0 - -#define MCMCPWM_INT_ST_MCPWM_REG(i) (REG_MCPWM_BASE(i) + 0x0118) -/* MCPWM_CAP2_INT_ST : RO ;bitpos:[29] ;default: 1'd0 ; */ -/*description: The masked status bit for interrupt triggered by captureon channel 2*/ -#define MCPWM_CAP2_INT_ST (BIT(29)) -#define MCPWM_CAP2_INT_ST_M (BIT(29)) -#define MCPWM_CAP2_INT_ST_V 0x1 -#define MCPWM_CAP2_INT_ST_S 29 -/* MCPWM_CAP1_INT_ST : RO ;bitpos:[28] ;default: 1'd0 ; */ -/*description: The masked status bit for interrupt triggered by captureon channel 1*/ -#define MCPWM_CAP1_INT_ST (BIT(28)) -#define MCPWM_CAP1_INT_ST_M (BIT(28)) -#define MCPWM_CAP1_INT_ST_V 0x1 -#define MCPWM_CAP1_INT_ST_S 28 -/* MCPWM_CAP0_INT_ST : RO ;bitpos:[27] ;default: 1'd0 ; */ -/*description: The masked status bit for interrupt triggered by captureon channel 0*/ -#define MCPWM_CAP0_INT_ST (BIT(27)) -#define MCPWM_CAP0_INT_ST_M (BIT(27)) -#define MCPWM_CAP0_INT_ST_V 0x1 -#define MCPWM_CAP0_INT_ST_S 27 -/* MCPWM_FH2_OST_INT_ST : RO ;bitpos:[26] ;default: 1'd0 ; */ -/*description: The masked status bit for interrupt triggered by an one-shot mode action on PWM2*/ -#define MCPWM_FH2_OST_INT_ST (BIT(26)) -#define MCPWM_FH2_OST_INT_ST_M (BIT(26)) -#define MCPWM_FH2_OST_INT_ST_V 0x1 -#define MCPWM_FH2_OST_INT_ST_S 26 -/* MCPWM_FH1_OST_INT_ST : RO ;bitpos:[25] ;default: 1'd0 ; */ -/*description: The masked status bit for interrupt triggered by an one-shot mode action on PWM0*/ -#define MCPWM_FH1_OST_INT_ST (BIT(25)) -#define MCPWM_FH1_OST_INT_ST_M (BIT(25)) -#define MCPWM_FH1_OST_INT_ST_V 0x1 -#define MCPWM_FH1_OST_INT_ST_S 25 -/* MCPWM_FH0_OST_INT_ST : RO ;bitpos:[24] ;default: 1'd0 ; */ -/*description: The masked status bit for interrupt triggered by an one-shot mode action on PWM0*/ -#define MCPWM_FH0_OST_INT_ST (BIT(24)) -#define MCPWM_FH0_OST_INT_ST_M (BIT(24)) -#define MCPWM_FH0_OST_INT_ST_V 0x1 -#define MCPWM_FH0_OST_INT_ST_S 24 -/* MCPWM_FH2_CBC_INT_ST : RO ;bitpos:[23] ;default: 1'd0 ; */ -/*description: The masked status bit for interrupt triggered by an cycle-by-cycle - mode action on PWM2*/ -#define MCPWM_FH2_CBC_INT_ST (BIT(23)) -#define MCPWM_FH2_CBC_INT_ST_M (BIT(23)) -#define MCPWM_FH2_CBC_INT_ST_V 0x1 -#define MCPWM_FH2_CBC_INT_ST_S 23 -/* MCPWM_FH1_CBC_INT_ST : RO ;bitpos:[22] ;default: 1'd0 ; */ -/*description: The masked status bit for interrupt triggered by an cycle-by-cycle - mode action on PWM1*/ -#define MCPWM_FH1_CBC_INT_ST (BIT(22)) -#define MCPWM_FH1_CBC_INT_ST_M (BIT(22)) -#define MCPWM_FH1_CBC_INT_ST_V 0x1 -#define MCPWM_FH1_CBC_INT_ST_S 22 -/* MCPWM_FH0_CBC_INT_ST : RO ;bitpos:[21] ;default: 1'd0 ; */ -/*description: The masked status bit for interrupt triggered by an cycle-by-cycle - mode action on PWM0*/ -#define MCPWM_FH0_CBC_INT_ST (BIT(21)) -#define MCPWM_FH0_CBC_INT_ST_M (BIT(21)) -#define MCPWM_FH0_CBC_INT_ST_V 0x1 -#define MCPWM_FH0_CBC_INT_ST_S 21 -/* MCPWM_OP2_TEB_INT_ST : RO ;bitpos:[20] ;default: 1'd0 ; */ -/*description: The masked status bit for interrupt triggered by a PWM operator 2 TEB event*/ -#define MCPWM_OP2_TEB_INT_ST (BIT(20)) -#define MCPWM_OP2_TEB_INT_ST_M (BIT(20)) -#define MCPWM_OP2_TEB_INT_ST_V 0x1 -#define MCPWM_OP2_TEB_INT_ST_S 20 -/* MCPWM_OP1_TEB_INT_ST : RO ;bitpos:[19] ;default: 1'd0 ; */ -/*description: The masked status bit for interrupt triggered by a PWM operator 1 TEB event*/ -#define MCPWM_OP1_TEB_INT_ST (BIT(19)) -#define MCPWM_OP1_TEB_INT_ST_M (BIT(19)) -#define MCPWM_OP1_TEB_INT_ST_V 0x1 -#define MCPWM_OP1_TEB_INT_ST_S 19 -/* MCPWM_OP0_TEB_INT_ST : RO ;bitpos:[18] ;default: 1'd0 ; */ -/*description: The masked status bit for interrupt triggered by a PWM operator 0 TEB event*/ -#define MCPWM_OP0_TEB_INT_ST (BIT(18)) -#define MCPWM_OP0_TEB_INT_ST_M (BIT(18)) -#define MCPWM_OP0_TEB_INT_ST_V 0x1 -#define MCPWM_OP0_TEB_INT_ST_S 18 -/* MCPWM_OP2_TEA_INT_ST : RO ;bitpos:[17] ;default: 1'd0 ; */ -/*description: The masked status bit for interrupt triggered by a PWM operator 2 TEA event*/ -#define MCPWM_OP2_TEA_INT_ST (BIT(17)) -#define MCPWM_OP2_TEA_INT_ST_M (BIT(17)) -#define MCPWM_OP2_TEA_INT_ST_V 0x1 -#define MCPWM_OP2_TEA_INT_ST_S 17 -/* MCPWM_OP1_TEA_INT_ST : RO ;bitpos:[16] ;default: 1'd0 ; */ -/*description: The masked status bit for interrupt triggered by a PWM operator 1 TEA event*/ -#define MCPWM_OP1_TEA_INT_ST (BIT(16)) -#define MCPWM_OP1_TEA_INT_ST_M (BIT(16)) -#define MCPWM_OP1_TEA_INT_ST_V 0x1 -#define MCPWM_OP1_TEA_INT_ST_S 16 -/* MCPWM_OP0_TEA_INT_ST : RO ;bitpos:[15] ;default: 1'd0 ; */ -/*description: The masked status bit for interrupt triggered by a PWM operator 0 TEA event*/ -#define MCPWM_OP0_TEA_INT_ST (BIT(15)) -#define MCPWM_OP0_TEA_INT_ST_M (BIT(15)) -#define MCPWM_OP0_TEA_INT_ST_V 0x1 -#define MCPWM_OP0_TEA_INT_ST_S 15 -/* MCPWM_FAULT2_CLR_INT_ST : RO ;bitpos:[14] ;default: 1'd0 ; */ -/*description: The masked status bit for interrupt triggered when event_f2 ends*/ -#define MCPWM_FAULT2_CLR_INT_ST (BIT(14)) -#define MCPWM_FAULT2_CLR_INT_ST_M (BIT(14)) -#define MCPWM_FAULT2_CLR_INT_ST_V 0x1 -#define MCPWM_FAULT2_CLR_INT_ST_S 14 -/* MCPWM_FAULT1_CLR_INT_ST : RO ;bitpos:[13] ;default: 1'd0 ; */ -/*description: The masked status bit for interrupt triggered when event_f1 ends*/ -#define MCPWM_FAULT1_CLR_INT_ST (BIT(13)) -#define MCPWM_FAULT1_CLR_INT_ST_M (BIT(13)) -#define MCPWM_FAULT1_CLR_INT_ST_V 0x1 -#define MCPWM_FAULT1_CLR_INT_ST_S 13 -/* MCPWM_FAULT0_CLR_INT_ST : RO ;bitpos:[12] ;default: 1'd0 ; */ -/*description: The masked status bit for interrupt triggered when event_f0 ends*/ -#define MCPWM_FAULT0_CLR_INT_ST (BIT(12)) -#define MCPWM_FAULT0_CLR_INT_ST_M (BIT(12)) -#define MCPWM_FAULT0_CLR_INT_ST_V 0x1 -#define MCPWM_FAULT0_CLR_INT_ST_S 12 -/* MCPWM_FAULT2_INT_ST : RO ;bitpos:[11] ;default: 1'd0 ; */ -/*description: The masked status bit for interrupt triggered when event_f2 starts*/ -#define MCPWM_FAULT2_INT_ST (BIT(11)) -#define MCPWM_FAULT2_INT_ST_M (BIT(11)) -#define MCPWM_FAULT2_INT_ST_V 0x1 -#define MCPWM_FAULT2_INT_ST_S 11 -/* MCPWM_FAULT1_INT_ST : RO ;bitpos:[10] ;default: 1'd0 ; */ -/*description: The masked status bit for interrupt triggered when event_f1 starts*/ -#define MCPWM_FAULT1_INT_ST (BIT(10)) -#define MCPWM_FAULT1_INT_ST_M (BIT(10)) -#define MCPWM_FAULT1_INT_ST_V 0x1 -#define MCPWM_FAULT1_INT_ST_S 10 -/* MCPWM_FAULT0_INT_ST : RO ;bitpos:[9] ;default: 1'd0 ; */ -/*description: The masked status bit for interrupt triggered when event_f0 starts*/ -#define MCPWM_FAULT0_INT_ST (BIT(9)) -#define MCPWM_FAULT0_INT_ST_M (BIT(9)) -#define MCPWM_FAULT0_INT_ST_V 0x1 -#define MCPWM_FAULT0_INT_ST_S 9 -/* MCPWM_TIMER2_TEP_INT_ST : RO ;bitpos:[8] ;default: 1'h0 ; */ -/*description: The masked status bit for interrupt triggered by a PWM timer 2 TEP event*/ -#define MCPWM_TIMER2_TEP_INT_ST (BIT(8)) -#define MCPWM_TIMER2_TEP_INT_ST_M (BIT(8)) -#define MCPWM_TIMER2_TEP_INT_ST_V 0x1 -#define MCPWM_TIMER2_TEP_INT_ST_S 8 -/* MCPWM_TIMER1_TEP_INT_ST : RO ;bitpos:[7] ;default: 1'h0 ; */ -/*description: The masked status bit for interrupt triggered by a PWM timer 1 TEP event*/ -#define MCPWM_TIMER1_TEP_INT_ST (BIT(7)) -#define MCPWM_TIMER1_TEP_INT_ST_M (BIT(7)) -#define MCPWM_TIMER1_TEP_INT_ST_V 0x1 -#define MCPWM_TIMER1_TEP_INT_ST_S 7 -/* MCPWM_TIMER0_TEP_INT_ST : RO ;bitpos:[6] ;default: 1'h0 ; */ -/*description: The masked status bit for interrupt triggered by a PWM timer 0 TEP event*/ -#define MCPWM_TIMER0_TEP_INT_ST (BIT(6)) -#define MCPWM_TIMER0_TEP_INT_ST_M (BIT(6)) -#define MCPWM_TIMER0_TEP_INT_ST_V 0x1 -#define MCPWM_TIMER0_TEP_INT_ST_S 6 -/* MCPWM_TIMER2_TEZ_INT_ST : RO ;bitpos:[5] ;default: 1'h0 ; */ -/*description: The masked status bit for interrupt triggered by a PWM timer 2 TEZ event*/ -#define MCPWM_TIMER2_TEZ_INT_ST (BIT(5)) -#define MCPWM_TIMER2_TEZ_INT_ST_M (BIT(5)) -#define MCPWM_TIMER2_TEZ_INT_ST_V 0x1 -#define MCPWM_TIMER2_TEZ_INT_ST_S 5 -/* MCPWM_TIMER1_TEZ_INT_ST : RO ;bitpos:[4] ;default: 1'h0 ; */ -/*description: The masked status bit for interrupt triggered by a PWM timer 1 TEZ event*/ -#define MCPWM_TIMER1_TEZ_INT_ST (BIT(4)) -#define MCPWM_TIMER1_TEZ_INT_ST_M (BIT(4)) -#define MCPWM_TIMER1_TEZ_INT_ST_V 0x1 -#define MCPWM_TIMER1_TEZ_INT_ST_S 4 -/* MCPWM_TIMER0_TEZ_INT_ST : RO ;bitpos:[3] ;default: 1'h0 ; */ -/*description: The masked status bit for interrupt triggered by a PWM timer 0 TEZ event*/ -#define MCPWM_TIMER0_TEZ_INT_ST (BIT(3)) -#define MCPWM_TIMER0_TEZ_INT_ST_M (BIT(3)) -#define MCPWM_TIMER0_TEZ_INT_ST_V 0x1 -#define MCPWM_TIMER0_TEZ_INT_ST_S 3 -/* MCPWM_TIMER2_STOP_INT_ST : RO ;bitpos:[2] ;default: 1'h0 ; */ -/*description: The masked status bit for interrupt triggered when timer 2 stops*/ -#define MCPWM_TIMER2_STOP_INT_ST (BIT(2)) -#define MCPWM_TIMER2_STOP_INT_ST_M (BIT(2)) -#define MCPWM_TIMER2_STOP_INT_ST_V 0x1 -#define MCPWM_TIMER2_STOP_INT_ST_S 2 -/* MCPWM_TIMER1_STOP_INT_ST : RO ;bitpos:[1] ;default: 1'h0 ; */ -/*description: The masked status bit for interrupt triggered when timer 1 stops*/ -#define MCPWM_TIMER1_STOP_INT_ST (BIT(1)) -#define MCPWM_TIMER1_STOP_INT_ST_M (BIT(1)) -#define MCPWM_TIMER1_STOP_INT_ST_V 0x1 -#define MCPWM_TIMER1_STOP_INT_ST_S 1 -/* MCPWM_TIMER0_STOP_INT_ST : RO ;bitpos:[0] ;default: 1'h0 ; */ -/*description: The masked status bit for interrupt triggered when timer 0 stops*/ -#define MCPWM_TIMER0_STOP_INT_ST (BIT(0)) -#define MCPWM_TIMER0_STOP_INT_ST_M (BIT(0)) -#define MCPWM_TIMER0_STOP_INT_ST_V 0x1 -#define MCPWM_TIMER0_STOP_INT_ST_S 0 - -#define MCMCPWM_INT_CLR_MCPWM_REG(i) (REG_MCPWM_BASE(i) + 0x011c) -/* MCPWM_CAP2_INT_CLR : WO ;bitpos:[29] ;default: 1'd0 ; */ -/*description: Set this bit to clear interrupt triggered by captureon channel 2*/ -#define MCPWM_CAP2_INT_CLR (BIT(29)) -#define MCPWM_CAP2_INT_CLR_M (BIT(29)) -#define MCPWM_CAP2_INT_CLR_V 0x1 -#define MCPWM_CAP2_INT_CLR_S 29 -/* MCPWM_CAP1_INT_CLR : WO ;bitpos:[28] ;default: 1'd0 ; */ -/*description: Set this bit to clear interrupt triggered by captureon channel 1*/ -#define MCPWM_CAP1_INT_CLR (BIT(28)) -#define MCPWM_CAP1_INT_CLR_M (BIT(28)) -#define MCPWM_CAP1_INT_CLR_V 0x1 -#define MCPWM_CAP1_INT_CLR_S 28 -/* MCPWM_CAP0_INT_CLR : WO ;bitpos:[27] ;default: 1'd0 ; */ -/*description: Set this bit to clear interrupt triggered by captureon channel 0*/ -#define MCPWM_CAP0_INT_CLR (BIT(27)) -#define MCPWM_CAP0_INT_CLR_M (BIT(27)) -#define MCPWM_CAP0_INT_CLR_V 0x1 -#define MCPWM_CAP0_INT_CLR_S 27 -/* MCPWM_FH2_OST_INT_CLR : WO ;bitpos:[26] ;default: 1'd0 ; */ -/*description: Set this bit to clear interrupt triggered by an one-shot mode action on PWM2*/ -#define MCPWM_FH2_OST_INT_CLR (BIT(26)) -#define MCPWM_FH2_OST_INT_CLR_M (BIT(26)) -#define MCPWM_FH2_OST_INT_CLR_V 0x1 -#define MCPWM_FH2_OST_INT_CLR_S 26 -/* MCPWM_FH1_OST_INT_CLR : WO ;bitpos:[25] ;default: 1'd0 ; */ -/*description: Set this bit to clear interrupt triggered by an one-shot mode action on PWM0*/ -#define MCPWM_FH1_OST_INT_CLR (BIT(25)) -#define MCPWM_FH1_OST_INT_CLR_M (BIT(25)) -#define MCPWM_FH1_OST_INT_CLR_V 0x1 -#define MCPWM_FH1_OST_INT_CLR_S 25 -/* MCPWM_FH0_OST_INT_CLR : WO ;bitpos:[24] ;default: 1'd0 ; */ -/*description: Set this bit to clear interrupt triggered by an one-shot mode action on PWM0*/ -#define MCPWM_FH0_OST_INT_CLR (BIT(24)) -#define MCPWM_FH0_OST_INT_CLR_M (BIT(24)) -#define MCPWM_FH0_OST_INT_CLR_V 0x1 -#define MCPWM_FH0_OST_INT_CLR_S 24 -/* MCPWM_FH2_CBC_INT_CLR : WO ;bitpos:[23] ;default: 1'd0 ; */ -/*description: Set this bit to clear interrupt triggered by an cycle-by-cycle - mode action on PWM2*/ -#define MCPWM_FH2_CBC_INT_CLR (BIT(23)) -#define MCPWM_FH2_CBC_INT_CLR_M (BIT(23)) -#define MCPWM_FH2_CBC_INT_CLR_V 0x1 -#define MCPWM_FH2_CBC_INT_CLR_S 23 -/* MCPWM_FH1_CBC_INT_CLR : WO ;bitpos:[22] ;default: 1'd0 ; */ -/*description: Set this bit to clear interrupt triggered by an cycle-by-cycle - mode action on PWM1*/ -#define MCPWM_FH1_CBC_INT_CLR (BIT(22)) -#define MCPWM_FH1_CBC_INT_CLR_M (BIT(22)) -#define MCPWM_FH1_CBC_INT_CLR_V 0x1 -#define MCPWM_FH1_CBC_INT_CLR_S 22 -/* MCPWM_FH0_CBC_INT_CLR : WO ;bitpos:[21] ;default: 1'd0 ; */ -/*description: Set this bit to clear interrupt triggered by an cycle-by-cycle - mode action on PWM0*/ -#define MCPWM_FH0_CBC_INT_CLR (BIT(21)) -#define MCPWM_FH0_CBC_INT_CLR_M (BIT(21)) -#define MCPWM_FH0_CBC_INT_CLR_V 0x1 -#define MCPWM_FH0_CBC_INT_CLR_S 21 -/* MCPWM_OP2_TEB_INT_CLR : WO ;bitpos:[20] ;default: 1'd0 ; */ -/*description: Set this bit to clear interrupt triggered by a PWM operator 2 TEB event*/ -#define MCPWM_OP2_TEB_INT_CLR (BIT(20)) -#define MCPWM_OP2_TEB_INT_CLR_M (BIT(20)) -#define MCPWM_OP2_TEB_INT_CLR_V 0x1 -#define MCPWM_OP2_TEB_INT_CLR_S 20 -/* MCPWM_OP1_TEB_INT_CLR : WO ;bitpos:[19] ;default: 1'd0 ; */ -/*description: Set this bit to clear interrupt triggered by a PWM operator 1 TEB event*/ -#define MCPWM_OP1_TEB_INT_CLR (BIT(19)) -#define MCPWM_OP1_TEB_INT_CLR_M (BIT(19)) -#define MCPWM_OP1_TEB_INT_CLR_V 0x1 -#define MCPWM_OP1_TEB_INT_CLR_S 19 -/* MCPWM_OP0_TEB_INT_CLR : WO ;bitpos:[18] ;default: 1'd0 ; */ -/*description: Set this bit to clear interrupt triggered by a PWM operator 0 TEB event*/ -#define MCPWM_OP0_TEB_INT_CLR (BIT(18)) -#define MCPWM_OP0_TEB_INT_CLR_M (BIT(18)) -#define MCPWM_OP0_TEB_INT_CLR_V 0x1 -#define MCPWM_OP0_TEB_INT_CLR_S 18 -/* MCPWM_OP2_TEA_INT_CLR : WO ;bitpos:[17] ;default: 1'd0 ; */ -/*description: Set this bit to clear interrupt triggered by a PWM operator 2 TEA event*/ -#define MCPWM_OP2_TEA_INT_CLR (BIT(17)) -#define MCPWM_OP2_TEA_INT_CLR_M (BIT(17)) -#define MCPWM_OP2_TEA_INT_CLR_V 0x1 -#define MCPWM_OP2_TEA_INT_CLR_S 17 -/* MCPWM_OP1_TEA_INT_CLR : WO ;bitpos:[16] ;default: 1'd0 ; */ -/*description: Set this bit to clear interrupt triggered by a PWM operator 1 TEA event*/ -#define MCPWM_OP1_TEA_INT_CLR (BIT(16)) -#define MCPWM_OP1_TEA_INT_CLR_M (BIT(16)) -#define MCPWM_OP1_TEA_INT_CLR_V 0x1 -#define MCPWM_OP1_TEA_INT_CLR_S 16 -/* MCPWM_OP0_TEA_INT_CLR : WO ;bitpos:[15] ;default: 1'd0 ; */ -/*description: Set this bit to clear interrupt triggered by a PWM operator 0 TEA event*/ -#define MCPWM_OP0_TEA_INT_CLR (BIT(15)) -#define MCPWM_OP0_TEA_INT_CLR_M (BIT(15)) -#define MCPWM_OP0_TEA_INT_CLR_V 0x1 -#define MCPWM_OP0_TEA_INT_CLR_S 15 -/* MCPWM_FAULT2_CLR_INT_CLR : WO ;bitpos:[14] ;default: 1'd0 ; */ -/*description: Set this bit to clear interrupt triggered when event_f2 ends*/ -#define MCPWM_FAULT2_CLR_INT_CLR (BIT(14)) -#define MCPWM_FAULT2_CLR_INT_CLR_M (BIT(14)) -#define MCPWM_FAULT2_CLR_INT_CLR_V 0x1 -#define MCPWM_FAULT2_CLR_INT_CLR_S 14 -/* MCPWM_FAULT1_CLR_INT_CLR : WO ;bitpos:[13] ;default: 1'd0 ; */ -/*description: Set this bit to clear interrupt triggered when event_f1 ends*/ -#define MCPWM_FAULT1_CLR_INT_CLR (BIT(13)) -#define MCPWM_FAULT1_CLR_INT_CLR_M (BIT(13)) -#define MCPWM_FAULT1_CLR_INT_CLR_V 0x1 -#define MCPWM_FAULT1_CLR_INT_CLR_S 13 -/* MCPWM_FAULT0_CLR_INT_CLR : WO ;bitpos:[12] ;default: 1'd0 ; */ -/*description: Set this bit to clear interrupt triggered when event_f0 ends*/ -#define MCPWM_FAULT0_CLR_INT_CLR (BIT(12)) -#define MCPWM_FAULT0_CLR_INT_CLR_M (BIT(12)) -#define MCPWM_FAULT0_CLR_INT_CLR_V 0x1 -#define MCPWM_FAULT0_CLR_INT_CLR_S 12 -/* MCPWM_FAULT2_INT_CLR : WO ;bitpos:[11] ;default: 1'd0 ; */ -/*description: Set this bit to clear interrupt triggered when event_f2 starts*/ -#define MCPWM_FAULT2_INT_CLR (BIT(11)) -#define MCPWM_FAULT2_INT_CLR_M (BIT(11)) -#define MCPWM_FAULT2_INT_CLR_V 0x1 -#define MCPWM_FAULT2_INT_CLR_S 11 -/* MCPWM_FAULT1_INT_CLR : WO ;bitpos:[10] ;default: 1'd0 ; */ -/*description: Set this bit to clear interrupt triggered when event_f1 starts*/ -#define MCPWM_FAULT1_INT_CLR (BIT(10)) -#define MCPWM_FAULT1_INT_CLR_M (BIT(10)) -#define MCPWM_FAULT1_INT_CLR_V 0x1 -#define MCPWM_FAULT1_INT_CLR_S 10 -/* MCPWM_FAULT0_INT_CLR : WO ;bitpos:[9] ;default: 1'd0 ; */ -/*description: Set this bit to clear interrupt triggered when event_f0 starts*/ -#define MCPWM_FAULT0_INT_CLR (BIT(9)) -#define MCPWM_FAULT0_INT_CLR_M (BIT(9)) -#define MCPWM_FAULT0_INT_CLR_V 0x1 -#define MCPWM_FAULT0_INT_CLR_S 9 -/* MCPWM_TIMER2_TEP_INT_CLR : WO ;bitpos:[8] ;default: 1'h0 ; */ -/*description: Set this bit to clear interrupt triggered by a PWM timer 2 TEP event*/ -#define MCPWM_TIMER2_TEP_INT_CLR (BIT(8)) -#define MCPWM_TIMER2_TEP_INT_CLR_M (BIT(8)) -#define MCPWM_TIMER2_TEP_INT_CLR_V 0x1 -#define MCPWM_TIMER2_TEP_INT_CLR_S 8 -/* MCPWM_TIMER1_TEP_INT_CLR : WO ;bitpos:[7] ;default: 1'h0 ; */ -/*description: Set this bit to clear interrupt triggered by a PWM timer 1 TEP event*/ -#define MCPWM_TIMER1_TEP_INT_CLR (BIT(7)) -#define MCPWM_TIMER1_TEP_INT_CLR_M (BIT(7)) -#define MCPWM_TIMER1_TEP_INT_CLR_V 0x1 -#define MCPWM_TIMER1_TEP_INT_CLR_S 7 -/* MCPWM_TIMER0_TEP_INT_CLR : WO ;bitpos:[6] ;default: 1'h0 ; */ -/*description: Set this bit to clear interrupt triggered by a PWM timer 0 TEP event*/ -#define MCPWM_TIMER0_TEP_INT_CLR (BIT(6)) -#define MCPWM_TIMER0_TEP_INT_CLR_M (BIT(6)) -#define MCPWM_TIMER0_TEP_INT_CLR_V 0x1 -#define MCPWM_TIMER0_TEP_INT_CLR_S 6 -/* MCPWM_TIMER2_TEZ_INT_CLR : WO ;bitpos:[5] ;default: 1'h0 ; */ -/*description: Set this bit to clear interrupt triggered by a PWM timer 2 TEZ event*/ -#define MCPWM_TIMER2_TEZ_INT_CLR (BIT(5)) -#define MCPWM_TIMER2_TEZ_INT_CLR_M (BIT(5)) -#define MCPWM_TIMER2_TEZ_INT_CLR_V 0x1 -#define MCPWM_TIMER2_TEZ_INT_CLR_S 5 -/* MCPWM_TIMER1_TEZ_INT_CLR : WO ;bitpos:[4] ;default: 1'h0 ; */ -/*description: Set this bit to clear interrupt triggered by a PWM timer 1 TEZ event*/ -#define MCPWM_TIMER1_TEZ_INT_CLR (BIT(4)) -#define MCPWM_TIMER1_TEZ_INT_CLR_M (BIT(4)) -#define MCPWM_TIMER1_TEZ_INT_CLR_V 0x1 -#define MCPWM_TIMER1_TEZ_INT_CLR_S 4 -/* MCPWM_TIMER0_TEZ_INT_CLR : WO ;bitpos:[3] ;default: 1'h0 ; */ -/*description: Set this bit to clear interrupt triggered by a PWM timer 0 TEZ event*/ -#define MCPWM_TIMER0_TEZ_INT_CLR (BIT(3)) -#define MCPWM_TIMER0_TEZ_INT_CLR_M (BIT(3)) -#define MCPWM_TIMER0_TEZ_INT_CLR_V 0x1 -#define MCPWM_TIMER0_TEZ_INT_CLR_S 3 -/* MCPWM_TIMER2_STOP_INT_CLR : WO ;bitpos:[2] ;default: 1'h0 ; */ -/*description: Set this bit to clear interrupt triggered when timer 2 stops*/ -#define MCPWM_TIMER2_STOP_INT_CLR (BIT(2)) -#define MCPWM_TIMER2_STOP_INT_CLR_M (BIT(2)) -#define MCPWM_TIMER2_STOP_INT_CLR_V 0x1 -#define MCPWM_TIMER2_STOP_INT_CLR_S 2 -/* MCPWM_TIMER1_STOP_INT_CLR : WO ;bitpos:[1] ;default: 1'h0 ; */ -/*description: Set this bit to clear interrupt triggered when timer 1 stops*/ -#define MCPWM_TIMER1_STOP_INT_CLR (BIT(1)) -#define MCPWM_TIMER1_STOP_INT_CLR_M (BIT(1)) -#define MCPWM_TIMER1_STOP_INT_CLR_V 0x1 -#define MCPWM_TIMER1_STOP_INT_CLR_S 1 -/* MCPWM_TIMER0_STOP_INT_CLR : WO ;bitpos:[0] ;default: 1'h0 ; */ -/*description: Set this bit to clear interrupt triggered when timer 0 stops*/ -#define MCPWM_TIMER0_STOP_INT_CLR (BIT(0)) -#define MCPWM_TIMER0_STOP_INT_CLR_M (BIT(0)) -#define MCPWM_TIMER0_STOP_INT_CLR_V 0x1 -#define MCPWM_TIMER0_STOP_INT_CLR_S 0 - -#define MCPWM_CLK_REG(i) (REG_MCPWM_BASE(i) + 0x0120) -/* MCPWM_CLK_EN : R/W ;bitpos:[0] ;default: 1'd0 ; */ -/*description: Force clock on for this reg file*/ -#define MCPWM_CLK_EN (BIT(0)) -#define MCPWM_CLK_EN_M (BIT(0)) -#define MCPWM_CLK_EN_V 0x1 -#define MCPWM_CLK_EN_S 0 - -#define MCPWM_VERSION_REG(i) (REG_MCPWM_BASE(i) + 0x0124) -/* MCPWM_DATE : R/W ;bitpos:[27:0] ;default: 28'h1509110 ; */ -/*description: Version of this reg file*/ -#define MCPWM_DATE 0x0FFFFFFF -#define MCPWM_DATE_M ((MCPWM_DATE_V)<<(MCPWM_DATE_S)) -#define MCPWM_DATE_V 0xFFFFFFF -#define MCPWM_DATE_S 0 - - - - -#endif /*_SOC_MCPWM_REG_H_ */ - - diff --git a/tools/sdk/include/soc/soc/mcpwm_struct.h b/tools/sdk/include/soc/soc/mcpwm_struct.h deleted file mode 100644 index f41d40c6448..00000000000 --- a/tools/sdk/include/soc/soc/mcpwm_struct.h +++ /dev/null @@ -1,462 +0,0 @@ -// 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. -#ifndef _SOC_MCPWM_STRUCT_H__ -#define _SOC_MCPWM_STRUCT_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef volatile struct { - union { - struct { - uint32_t prescale: 8; /*Period of PWM_clk = 6.25ns * (PWM_CLK_PRESCALE + 1)*/ - uint32_t reserved8: 24; - }; - uint32_t val; - }clk_cfg; - struct { - union { - struct { - uint32_t prescale: 8; /*period of PT0_clk = Period of PWM_clk * (PWM_TIMER0_PRESCALE + 1)*/ - uint32_t period: 16; /*period shadow reg of PWM timer0*/ - uint32_t upmethod: 2; /*Update method for active reg of PWM timer0 period 0: immediate 1: TEZ 2: sync 3: TEZ | sync. TEZ here and below means timer equal zero event*/ - uint32_t reserved26: 6; - }; - uint32_t val; - }period; - union { - struct { - uint32_t start: 3; /*PWM timer0 start and stop control. 0: stop @ TEZ 1: stop @ TEP 2: free run 3: start and stop @ next TEZ 4: start and stop @ next TEP. TEP here and below means timer equal period event*/ - uint32_t mode: 2; /*PWM timer0 working mode 0: freeze 1: increase mod 2: decrease mod 3: up-down mod*/ - uint32_t reserved5: 27; - }; - uint32_t val; - }mode; - union { - struct { - uint32_t in_en: 1; /*when set timer reload with phase on sync input event is enabled*/ - uint32_t sync_sw: 1; /*write the negate value will trigger a software sync*/ - uint32_t out_sel: 2; /*PWM timer0 synco selection 0: synci 1: TEZ 2: TEP else 0*/ - uint32_t timer_phase: 17; /*phase for timer reload on sync event*/ - uint32_t reserved21: 11; - }; - uint32_t val; - }sync; - union { - struct { - uint32_t value: 16; /*current PWM timer0 counter value*/ - uint32_t direction: 1; /*current PWM timer0 counter direction 0: increment 1: decrement*/ - uint32_t reserved17: 15; - }; - uint32_t val; - }status; - }timer[3]; - - - union { - struct { - uint32_t t0_in_sel: 3; /*select sync input for PWM timer0 1: PWM timer0 synco 2: PWM timer1 synco 3: PWM timer2 synco 4: SYNC0 from GPIO matrix 5: SYNC1 from GPIO matrix 6: SYNC2 from GPIO matrix else: none*/ - uint32_t t1_in_sel: 3; /*select sync input for PWM timer1 1: PWM timer0 synco 2: PWM timer1 synco 3: PWM timer2 synco 4: SYNC0 from GPIO matrix 5: SYNC1 from GPIO matrix 6: SYNC2 from GPIO matrix else: none*/ - uint32_t t2_in_sel: 3; /*select sync input for PWM timer2 1: PWM timer0 synco 2: PWM timer1 synco 3: PWM timer2 synco 4: SYNC0 from GPIO matrix 5: SYNC1 from GPIO matrix 6: SYNC2 from GPIO matrix else: none*/ - uint32_t ext_in0_inv: 1; /*invert SYNC0 from GPIO matrix*/ - uint32_t ext_in1_inv: 1; /*invert SYNC1 from GPIO matrix*/ - uint32_t ext_in2_inv: 1; /*invert SYNC2 from GPIO matrix*/ - uint32_t reserved12: 20; - }; - uint32_t val; - }timer_synci_cfg; - union { - struct { - uint32_t operator0_sel: 2; /*Select which PWM timer's is the timing reference for PWM operator0 0: timer0 1: timer1 2: timer2*/ - uint32_t operator1_sel: 2; /*Select which PWM timer's is the timing reference for PWM operator1 0: timer0 1: timer1 2: timer2*/ - uint32_t operator2_sel: 2; /*Select which PWM timer's is the timing reference for PWM operator2 0: timer0 1: timer1 2: timer2*/ - uint32_t reserved6: 26; - }; - uint32_t val; - }timer_sel; - - - struct { - union { - struct { - uint32_t a_upmethod: 4; /*Update method for PWM compare0 A's active reg. 0: immediate bit0: TEZ bit1: TEP bit2: sync bit3: freeze*/ - uint32_t b_upmethod: 4; /*Update method for PWM compare0 B's active reg. 0: immediate bit0: TEZ bit1: TEP bit2: sync bit3: freeze*/ - uint32_t a_shdw_full: 1; /*Set and reset by hardware. If set PWM compare0 A's shadow reg is filled and waiting to be transferred to A's active reg. If cleared A's active reg has been updated with shadow reg latest value*/ - uint32_t b_shdw_full: 1; /*Set and reset by hardware. If set PWM compare0 B's shadow reg is filled and waiting to be transferred to B's active reg. If cleared B's active reg has been updated with shadow reg latest value*/ - uint32_t reserved10: 22; - }; - uint32_t val; - }cmpr_cfg; - union { - struct { - uint32_t cmpr_val: 16; /*PWM compare0 A's shadow reg*/ - uint32_t reserved16:16; - }; - uint32_t val; - }cmpr_value[2]; - union { - struct { - uint32_t upmethod: 4; /*Update method for PWM generate0's active reg of configuration. 0: immediate bit0: TEZ bit1: TEP bit2: sync. bit3: freeze*/ - uint32_t t0_sel: 3; /*Source selection for PWM generate0 event_t0 take effect immediately 0: fault_event0 1: fault_event1 2: fault_event2 3: sync_taken 4: none*/ - uint32_t t1_sel: 3; /*Source selection for PWM generate0 event_t1 take effect immediately 0: fault_event0 1: fault_event1 2: fault_event2 3: sync_taken 4: none*/ - uint32_t reserved10: 22; - }; - uint32_t val; - }gen_cfg0; - union { - struct { - uint32_t cntu_force_upmethod: 6; /*Update method for continuous software force of PWM generate0. 0: immediate bit0: TEZ bit1: TEP bit2: TEA bit3: TEB bit4: sync bit5: freeze. (TEA/B here and below means timer equals A/B event)*/ - uint32_t a_cntuforce_mode: 2; /*Continuous software force mode for PWM0A. 0: disabled 1: low 2: high 3: disabled*/ - uint32_t b_cntuforce_mode: 2; /*Continuous software force mode for PWM0B. 0: disabled 1: low 2: high 3: disabled*/ - uint32_t a_nciforce: 1; /*non-continuous immediate software force trigger for PWM0A a toggle will trigger a force event*/ - uint32_t a_nciforce_mode: 2; /*non-continuous immediate software force mode for PWM0A 0: disabled 1: low 2: high 3: disabled*/ - uint32_t b_nciforce: 1; /*non-continuous immediate software force trigger for PWM0B a toggle will trigger a force event*/ - uint32_t b_nciforce_mode: 2; /*non-continuous immediate software force mode for PWM0B 0: disabled 1: low 2: high 3: disabled*/ - uint32_t reserved16: 16; - }; - uint32_t val; - }gen_force; - union { - struct { - uint32_t utez: 2; /*Action on PWM0A triggered by event TEZ when timer increasing*/ - uint32_t utep: 2; /*Action on PWM0A triggered by event TEP when timer increasing*/ - uint32_t utea: 2; /*Action on PWM0A triggered by event TEA when timer increasing*/ - uint32_t uteb: 2; /*Action on PWM0A triggered by event TEB when timer increasing*/ - uint32_t ut0: 2; /*Action on PWM0A triggered by event_t0 when timer increasing*/ - uint32_t ut1: 2; /*Action on PWM0A triggered by event_t1 when timer increasing*/ - uint32_t dtez: 2; /*Action on PWM0A triggered by event TEZ when timer decreasing*/ - uint32_t dtep: 2; /*Action on PWM0A triggered by event TEP when timer decreasing*/ - uint32_t dtea: 2; /*Action on PWM0A triggered by event TEA when timer decreasing*/ - uint32_t dteb: 2; /*Action on PWM0A triggered by event TEB when timer decreasing*/ - uint32_t dt0: 2; /*Action on PWM0A triggered by event_t0 when timer decreasing*/ - uint32_t dt1: 2; /*Action on PWM0A triggered by event_t1 when timer decreasing. 0: no change 1: low 2: high 3: toggle*/ - uint32_t reserved24: 8; - }; - uint32_t val; - }generator[2]; - union { - struct { - uint32_t fed_upmethod: 4; /*Update method for FED (falling edge delay) active reg. 0: immediate bit0: tez bit1: tep bit2: sync bit3: freeze*/ - uint32_t red_upmethod: 4; /*Update method for RED (rising edge delay) active reg. 0: immediate bit0: tez bit1: tep bit2: sync bit3: freeze*/ - uint32_t deb_mode: 1; /*S8 in documentation dual-edge B mode 0: fed/red take effect on different path separately 1: fed/red take effect on B path A out is in bypass or dulpB mode*/ - uint32_t a_outswap: 1; /*S6 in documentation*/ - uint32_t b_outswap: 1; /*S7 in documentation*/ - uint32_t red_insel: 1; /*S4 in documentation*/ - uint32_t fed_insel: 1; /*S5 in documentation*/ - uint32_t red_outinvert: 1; /*S2 in documentation*/ - uint32_t fed_outinvert: 1; /*S3 in documentation*/ - uint32_t a_outbypass: 1; /*S1 in documentation*/ - uint32_t b_outbypass: 1; /*S0 in documentation*/ - uint32_t clk_sel: 1; /*Dead band0 clock selection. 0: PWM_clk 1: PT_clk*/ - uint32_t reserved18: 14; - }; - uint32_t val; - }db_cfg; - union { - struct { - uint32_t fed: 16; /*Shadow reg for FED*/ - uint32_t reserved16:16; - }; - uint32_t val; - }db_fed_cfg; - union { - struct { - uint32_t red: 16; /*Shadow reg for RED*/ - uint32_t reserved16:16; - }; - uint32_t val; - }db_red_cfg; - union { - struct { - uint32_t en: 1; /*When set carrier0 function is enabled. When reset carrier0 is bypassed*/ - uint32_t prescale: 4; /*carrier0 clk (CP_clk) prescale value. Period of CP_clk = period of PWM_clk * (PWM_CARRIER0_PRESCALE + 1)*/ - uint32_t duty: 3; /*carrier duty selection. Duty = PWM_CARRIER0_DUTY / 8*/ - uint32_t oshtwth: 4; /*width of the fist pulse in number of periods of the carrier*/ - uint32_t out_invert: 1; /*when set invert the output of PWM0A and PWM0B for this submodule*/ - uint32_t in_invert: 1; /*when set invert the input of PWM0A and PWM0B for this submodule*/ - uint32_t reserved14: 18; - }; - uint32_t val; - }carrier_cfg; - union { - struct { - uint32_t sw_cbc: 1; /*Cycle-by-cycle tripping software force event will trigger cycle-by-cycle trip event. 0: disable 1: enable*/ - uint32_t f2_cbc: 1; /*event_f2 will trigger cycle-by-cycle trip event. 0: disable 1: enable*/ - uint32_t f1_cbc: 1; /*event_f1 will trigger cycle-by-cycle trip event. 0: disable 1: enable*/ - uint32_t f0_cbc: 1; /*event_f0 will trigger cycle-by-cycle trip event. 0: disable 1: enable*/ - uint32_t sw_ost: 1; /*one-shot tripping software force event will trigger one-shot trip event. 0: disable 1: enable*/ - uint32_t f2_ost: 1; /*event_f2 will trigger one-shot trip event. 0: disable 1: enable*/ - uint32_t f1_ost: 1; /*event_f1 will trigger one-shot trip event. 0: disable 1: enable*/ - uint32_t f0_ost: 1; /*event_f0 will trigger one-shot trip event. 0: disable 1: enable*/ - uint32_t a_cbc_d: 2; /*Action on PWM0A when cycle-by-cycle trip event occurs and timer is decreasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ - uint32_t a_cbc_u: 2; /*Action on PWM0A when cycle-by-cycle trip event occurs and timer is increasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ - uint32_t a_ost_d: 2; /*Action on PWM0A when one-shot trip event occurs and timer is decreasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ - uint32_t a_ost_u: 2; /*Action on PWM0A when one-shot trip event occurs and timer is increasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ - uint32_t b_cbc_d: 2; /*Action on PWM0B when cycle-by-cycle trip event occurs and timer is decreasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ - uint32_t b_cbc_u: 2; /*Action on PWM0B when cycle-by-cycle trip event occurs and timer is increasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ - uint32_t b_ost_d: 2; /*Action on PWM0B when one-shot trip event occurs and timer is decreasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ - uint32_t b_ost_u: 2; /*Action on PWM0B when one-shot trip event occurs and timer is increasing. 0: do nothing 1: force lo 2: force hi 3: toggle*/ - uint32_t reserved24: 8; - }; - uint32_t val; - }tz_cfg0; - union { - struct { - uint32_t clr_ost: 1; /*a toggle will clear on going one-shot tripping*/ - uint32_t cbcpulse: 2; /*cycle-by-cycle tripping refresh moment selection. Bit0: TEZ bit1:TEP*/ - uint32_t force_cbc: 1; /*a toggle trigger a cycle-by-cycle tripping software force event*/ - uint32_t force_ost: 1; /*a toggle (software negate its value) trigger a one-shot tripping software force event*/ - uint32_t reserved5: 27; - }; - uint32_t val; - }tz_cfg1; - union { - struct { - uint32_t cbc_on: 1; /*Set and reset by hardware. If set an cycle-by-cycle trip event is on going*/ - uint32_t ost_on: 1; /*Set and reset by hardware. If set an one-shot trip event is on going*/ - uint32_t reserved2: 30; - }; - uint32_t val; - }tz_status; - }channel[3]; - - union { - struct { - uint32_t f0_en: 1; /*When set event_f0 generation is enabled*/ - uint32_t f1_en: 1; /*When set event_f1 generation is enabled*/ - uint32_t f2_en: 1; /*When set event_f2 generation is enabled*/ - uint32_t f0_pole: 1; /*Set event_f0 trigger polarity on FAULT2 source from GPIO matrix. 0: level low 1: level high*/ - uint32_t f1_pole: 1; /*Set event_f1 trigger polarity on FAULT2 source from GPIO matrix. 0: level low 1: level high*/ - uint32_t f2_pole: 1; /*Set event_f2 trigger polarity on FAULT2 source from GPIO matrix. 0: level low 1: level high*/ - uint32_t event_f0: 1; /*Set and reset by hardware. If set event_f0 is on going*/ - uint32_t event_f1: 1; /*Set and reset by hardware. If set event_f1 is on going*/ - uint32_t event_f2: 1; /*Set and reset by hardware. If set event_f2 is on going*/ - uint32_t reserved9: 23; - }; - uint32_t val; - }fault_detect; - union { - struct { - uint32_t timer_en: 1; /*When set capture timer incrementing under APB_clk is enabled.*/ - uint32_t synci_en: 1; /*When set capture timer sync is enabled.*/ - uint32_t synci_sel: 3; /*capture module sync input selection. 0: none 1: timer0 synco 2: timer1 synco 3: timer2 synco 4: SYNC0 from GPIO matrix 5: SYNC1 from GPIO matrix 6: SYNC2 from GPIO matrix*/ - uint32_t sync_sw: 1; /*Write 1 will force a capture timer sync capture timer is loaded with value in phase register.*/ - uint32_t reserved6: 26; - }; - uint32_t val; - }cap_timer_cfg; - uint32_t cap_timer_phase; /*Phase value for capture timer sync operation.*/ - union { - struct { - uint32_t en: 1; /*When set capture on channel 0 is enabled*/ - uint32_t mode: 2; /*Edge of capture on channel 0 after prescale. bit0: negedge cap en bit1: posedge cap en*/ - uint32_t prescale: 8; /*Value of prescale on possitive edge of CAP0. Prescale value = PWM_CAP0_PRESCALE + 1*/ - uint32_t in_invert: 1; /*when set CAP0 form GPIO matrix is inverted before prescale*/ - uint32_t sw: 1; /*Write 1 will trigger a software forced capture on channel 0*/ - uint32_t reserved13: 19; - }; - uint32_t val; - }cap_cfg_ch[3]; - uint32_t cap_val_ch[3]; /*Value of last capture on channel 0*/ - union { - struct { - uint32_t cap0_edge: 1; /*Edge of last capture trigger on channel 0 0: posedge 1: negedge*/ - uint32_t cap1_edge: 1; /*Edge of last capture trigger on channel 1 0: posedge 1: negedge*/ - uint32_t cap2_edge: 1; /*Edge of last capture trigger on channel 2 0: posedge 1: negedge*/ - uint32_t reserved3: 29; - }; - uint32_t val; - }cap_status; - union { - struct { - uint32_t global_up_en: 1; /*The global enable of update of all active registers in MCPWM module*/ - uint32_t global_force_up: 1; /*a toggle (software invert its value) will trigger a forced update of all active registers in MCPWM module*/ - uint32_t op0_up_en: 1; /*When set and PWM_GLOBAL_UP_EN is set update of active registers in PWM operator 0 are enabled*/ - uint32_t op0_force_up: 1; /*a toggle (software invert its value) will trigger a forced update of active registers in PWM operator 0*/ - uint32_t op1_up_en: 1; /*When set and PWM_GLOBAL_UP_EN is set update of active registers in PWM operator 1 are enabled*/ - uint32_t op1_force_up: 1; /*a toggle (software invert its value) will trigger a forced update of active registers in PWM operator 1*/ - uint32_t op2_up_en: 1; /*When set and PWM_GLOBAL_UP_EN is set update of active registers in PWM operator 2 are enabled*/ - uint32_t op2_force_up: 1; /*a toggle (software invert its value) will trigger a forced update of active registers in PWM operator 2*/ - uint32_t reserved8: 24; - }; - uint32_t val; - }update_cfg; - union { - struct { - uint32_t timer0_stop_int_ena: 1; /*Interrupt when timer 0 stops*/ - uint32_t timer1_stop_int_ena: 1; /*Interrupt when timer 1 stops*/ - uint32_t timer2_stop_int_ena: 1; /*Interrupt when timer 2 stops*/ - uint32_t timer0_tez_int_ena: 1; /*A PWM timer 0 TEZ event will trigger this interrupt*/ - uint32_t timer1_tez_int_ena: 1; /*A PWM timer 1 TEZ event will trigger this interrupt*/ - uint32_t timer2_tez_int_ena: 1; /*A PWM timer 2 TEZ event will trigger this interrupt*/ - uint32_t timer0_tep_int_ena: 1; /*A PWM timer 0 TEP event will trigger this interrupt*/ - uint32_t timer1_tep_int_ena: 1; /*A PWM timer 1 TEP event will trigger this interrupt*/ - uint32_t timer2_tep_int_ena: 1; /*A PWM timer 2 TEP event will trigger this interrupt*/ - uint32_t fault0_int_ena: 1; /*Interrupt when event_f0 starts*/ - uint32_t fault1_int_ena: 1; /*Interrupt when event_f1 starts*/ - uint32_t fault2_int_ena: 1; /*Interrupt when event_f2 starts*/ - uint32_t fault0_clr_int_ena: 1; /*Interrupt when event_f0 ends*/ - uint32_t fault1_clr_int_ena: 1; /*Interrupt when event_f1 ends*/ - uint32_t fault2_clr_int_ena: 1; /*Interrupt when event_f2 ends*/ - uint32_t cmpr0_tea_int_ena: 1; /*A PWM operator 0 TEA event will trigger this interrupt*/ - uint32_t cmpr1_tea_int_ena: 1; /*A PWM operator 1 TEA event will trigger this interrupt*/ - uint32_t cmpr2_tea_int_ena: 1; /*A PWM operator 2 TEA event will trigger this interrupt*/ - uint32_t cmpr0_teb_int_ena: 1; /*A PWM operator 0 TEB event will trigger this interrupt*/ - uint32_t cmpr1_teb_int_ena: 1; /*A PWM operator 1 TEB event will trigger this interrupt*/ - uint32_t cmpr2_teb_int_ena: 1; /*A PWM operator 2 TEB event will trigger this interrupt*/ - uint32_t tz0_cbc_int_ena: 1; /*An cycle-by-cycle trip event on PWM0 will trigger this interrupt*/ - uint32_t tz1_cbc_int_ena: 1; /*An cycle-by-cycle trip event on PWM1 will trigger this interrupt*/ - uint32_t tz2_cbc_int_ena: 1; /*An cycle-by-cycle trip event on PWM2 will trigger this interrupt*/ - uint32_t tz0_ost_int_ena: 1; /*An one-shot trip event on PWM0 will trigger this interrupt*/ - uint32_t tz1_ost_int_ena: 1; /*An one-shot trip event on PWM1 will trigger this interrupt*/ - uint32_t tz2_ost_int_ena: 1; /*An one-shot trip event on PWM2 will trigger this interrupt*/ - uint32_t cap0_int_ena: 1; /*A capture on channel 0 will trigger this interrupt*/ - uint32_t cap1_int_ena: 1; /*A capture on channel 1 will trigger this interrupt*/ - uint32_t cap2_int_ena: 1; /*A capture on channel 2 will trigger this interrupt*/ - uint32_t reserved30: 2; - }; - uint32_t val; - }int_ena; - union { - struct { - uint32_t timer0_stop_int_raw: 1; /*Interrupt when timer 0 stops*/ - uint32_t timer1_stop_int_raw: 1; /*Interrupt when timer 1 stops*/ - uint32_t timer2_stop_int_raw: 1; /*Interrupt when timer 2 stops*/ - uint32_t timer0_tez_int_raw: 1; /*A PWM timer 0 TEZ event will trigger this interrupt*/ - uint32_t timer1_tez_int_raw: 1; /*A PWM timer 1 TEZ event will trigger this interrupt*/ - uint32_t timer2_tez_int_raw: 1; /*A PWM timer 2 TEZ event will trigger this interrupt*/ - uint32_t timer0_tep_int_raw: 1; /*A PWM timer 0 TEP event will trigger this interrupt*/ - uint32_t timer1_tep_int_raw: 1; /*A PWM timer 1 TEP event will trigger this interrupt*/ - uint32_t timer2_tep_int_raw: 1; /*A PWM timer 2 TEP event will trigger this interrupt*/ - uint32_t fault0_int_raw: 1; /*Interrupt when event_f0 starts*/ - uint32_t fault1_int_raw: 1; /*Interrupt when event_f1 starts*/ - uint32_t fault2_int_raw: 1; /*Interrupt when event_f2 starts*/ - uint32_t fault0_clr_int_raw: 1; /*Interrupt when event_f0 ends*/ - uint32_t fault1_clr_int_raw: 1; /*Interrupt when event_f1 ends*/ - uint32_t fault2_clr_int_raw: 1; /*Interrupt when event_f2 ends*/ - uint32_t cmpr0_tea_int_raw: 1; /*A PWM operator 0 TEA event will trigger this interrupt*/ - uint32_t cmpr1_tea_int_raw: 1; /*A PWM operator 1 TEA event will trigger this interrupt*/ - uint32_t cmpr2_tea_int_raw: 1; /*A PWM operator 2 TEA event will trigger this interrupt*/ - uint32_t cmpr0_teb_int_raw: 1; /*A PWM operator 0 TEB event will trigger this interrupt*/ - uint32_t cmpr1_teb_int_raw: 1; /*A PWM operator 1 TEB event will trigger this interrupt*/ - uint32_t cmpr2_teb_int_raw: 1; /*A PWM operator 2 TEB event will trigger this interrupt*/ - uint32_t tz0_cbc_int_raw: 1; /*An cycle-by-cycle trip event on PWM0 will trigger this interrupt*/ - uint32_t tz1_cbc_int_raw: 1; /*An cycle-by-cycle trip event on PWM1 will trigger this interrupt*/ - uint32_t tz2_cbc_int_raw: 1; /*An cycle-by-cycle trip event on PWM2 will trigger this interrupt*/ - uint32_t tz0_ost_int_raw: 1; /*An one-shot trip event on PWM0 will trigger this interrupt*/ - uint32_t tz1_ost_int_raw: 1; /*An one-shot trip event on PWM1 will trigger this interrupt*/ - uint32_t tz2_ost_int_raw: 1; /*An one-shot trip event on PWM2 will trigger this interrupt*/ - uint32_t cap0_int_raw: 1; /*A capture on channel 0 will trigger this interrupt*/ - uint32_t cap1_int_raw: 1; /*A capture on channel 1 will trigger this interrupt*/ - uint32_t cap2_int_raw: 1; /*A capture on channel 2 will trigger this interrupt*/ - uint32_t reserved30: 2; - }; - uint32_t val; - }int_raw; - union { - struct { - uint32_t timer0_stop_int_st: 1; /*Interrupt when timer 0 stops*/ - uint32_t timer1_stop_int_st: 1; /*Interrupt when timer 1 stops*/ - uint32_t timer2_stop_int_st: 1; /*Interrupt when timer 2 stops*/ - uint32_t timer0_tez_int_st: 1; /*A PWM timer 0 TEZ event will trigger this interrupt*/ - uint32_t timer1_tez_int_st: 1; /*A PWM timer 1 TEZ event will trigger this interrupt*/ - uint32_t timer2_tez_int_st: 1; /*A PWM timer 2 TEZ event will trigger this interrupt*/ - uint32_t timer0_tep_int_st: 1; /*A PWM timer 0 TEP event will trigger this interrupt*/ - uint32_t timer1_tep_int_st: 1; /*A PWM timer 1 TEP event will trigger this interrupt*/ - uint32_t timer2_tep_int_st: 1; /*A PWM timer 2 TEP event will trigger this interrupt*/ - uint32_t fault0_int_st: 1; /*Interrupt when event_f0 starts*/ - uint32_t fault1_int_st: 1; /*Interrupt when event_f1 starts*/ - uint32_t fault2_int_st: 1; /*Interrupt when event_f2 starts*/ - uint32_t fault0_clr_int_st: 1; /*Interrupt when event_f0 ends*/ - uint32_t fault1_clr_int_st: 1; /*Interrupt when event_f1 ends*/ - uint32_t fault2_clr_int_st: 1; /*Interrupt when event_f2 ends*/ - uint32_t cmpr0_tea_int_st: 1; /*A PWM operator 0 TEA event will trigger this interrupt*/ - uint32_t cmpr1_tea_int_st: 1; /*A PWM operator 1 TEA event will trigger this interrupt*/ - uint32_t cmpr2_tea_int_st: 1; /*A PWM operator 2 TEA event will trigger this interrupt*/ - uint32_t cmpr0_teb_int_st: 1; /*A PWM operator 0 TEB event will trigger this interrupt*/ - uint32_t cmpr1_teb_int_st: 1; /*A PWM operator 1 TEB event will trigger this interrupt*/ - uint32_t cmpr2_teb_int_st: 1; /*A PWM operator 2 TEB event will trigger this interrupt*/ - uint32_t tz0_cbc_int_st: 1; /*An cycle-by-cycle trip event on PWM0 will trigger this interrupt*/ - uint32_t tz1_cbc_int_st: 1; /*An cycle-by-cycle trip event on PWM1 will trigger this interrupt*/ - uint32_t tz2_cbc_int_st: 1; /*An cycle-by-cycle trip event on PWM2 will trigger this interrupt*/ - uint32_t tz0_ost_int_st: 1; /*An one-shot trip event on PWM0 will trigger this interrupt*/ - uint32_t tz1_ost_int_st: 1; /*An one-shot trip event on PWM1 will trigger this interrupt*/ - uint32_t tz2_ost_int_st: 1; /*An one-shot trip event on PWM2 will trigger this interrupt*/ - uint32_t cap0_int_st: 1; /*A capture on channel 0 will trigger this interrupt*/ - uint32_t cap1_int_st: 1; /*A capture on channel 1 will trigger this interrupt*/ - uint32_t cap2_int_st: 1; /*A capture on channel 2 will trigger this interrupt*/ - uint32_t reserved30: 2; - }; - uint32_t val; - }int_st; - union { - struct { - uint32_t timer0_stop_int_clr: 1; /*Interrupt when timer 0 stops*/ - uint32_t timer1_stop_int_clr: 1; /*Interrupt when timer 1 stops*/ - uint32_t timer2_stop_int_clr: 1; /*Interrupt when timer 2 stops*/ - uint32_t timer0_tez_int_clr: 1; /*A PWM timer 0 TEZ event will trigger this interrupt*/ - uint32_t timer1_tez_int_clr: 1; /*A PWM timer 1 TEZ event will trigger this interrupt*/ - uint32_t timer2_tez_int_clr: 1; /*A PWM timer 2 TEZ event will trigger this interrupt*/ - uint32_t timer0_tep_int_clr: 1; /*A PWM timer 0 TEP event will trigger this interrupt*/ - uint32_t timer1_tep_int_clr: 1; /*A PWM timer 1 TEP event will trigger this interrupt*/ - uint32_t timer2_tep_int_clr: 1; /*A PWM timer 2 TEP event will trigger this interrupt*/ - uint32_t fault0_int_clr: 1; /*Interrupt when event_f0 starts*/ - uint32_t fault1_int_clr: 1; /*Interrupt when event_f1 starts*/ - uint32_t fault2_int_clr: 1; /*Interrupt when event_f2 starts*/ - uint32_t fault0_clr_int_clr: 1; /*Interrupt when event_f0 ends*/ - uint32_t fault1_clr_int_clr: 1; /*Interrupt when event_f1 ends*/ - uint32_t fault2_clr_int_clr: 1; /*Interrupt when event_f2 ends*/ - uint32_t cmpr0_tea_int_clr: 1; /*A PWM operator 0 TEA event will trigger this interrupt*/ - uint32_t cmpr1_tea_int_clr: 1; /*A PWM operator 1 TEA event will trigger this interrupt*/ - uint32_t cmpr2_tea_int_clr: 1; /*A PWM operator 2 TEA event will trigger this interrupt*/ - uint32_t cmpr0_teb_int_clr: 1; /*A PWM operator 0 TEB event will trigger this interrupt*/ - uint32_t cmpr1_teb_int_clr: 1; /*A PWM operator 1 TEB event will trigger this interrupt*/ - uint32_t cmpr2_teb_int_clr: 1; /*A PWM operator 2 TEB event will trigger this interrupt*/ - uint32_t tz0_cbc_int_clr: 1; /*An cycle-by-cycle trip event on PWM0 will trigger this interrupt*/ - uint32_t tz1_cbc_int_clr: 1; /*An cycle-by-cycle trip event on PWM1 will trigger this interrupt*/ - uint32_t tz2_cbc_int_clr: 1; /*An cycle-by-cycle trip event on PWM2 will trigger this interrupt*/ - uint32_t tz0_ost_int_clr: 1; /*An one-shot trip event on PWM0 will trigger this interrupt*/ - uint32_t tz1_ost_int_clr: 1; /*An one-shot trip event on PWM1 will trigger this interrupt*/ - uint32_t tz2_ost_int_clr: 1; /*An one-shot trip event on PWM2 will trigger this interrupt*/ - uint32_t cap0_int_clr: 1; /*A capture on channel 0 will trigger this interrupt*/ - uint32_t cap1_int_clr: 1; /*A capture on channel 1 will trigger this interrupt*/ - uint32_t cap2_int_clr: 1; /*A capture on channel 2 will trigger this interrupt*/ - uint32_t reserved30: 2; - }; - uint32_t val; - }int_clr; - union { - struct { - uint32_t clk_en: 1; /*Force clock on for this reg file*/ - uint32_t reserved1: 31; - }; - uint32_t val; - }reg_clk; - union { - struct { - uint32_t date: 28; /*Version of this reg file*/ - uint32_t reserved28: 4; - }; - uint32_t val; - }version; -} mcpwm_dev_t; -extern mcpwm_dev_t MCPWM0; -extern mcpwm_dev_t MCPWM1; - -#ifdef __cplusplus -} -#endif - -#endif /* _SOC_MCPWM_STRUCT_H__ */ diff --git a/tools/sdk/include/soc/soc/nrx_reg.h b/tools/sdk/include/soc/soc/nrx_reg.h deleted file mode 100644 index ca338b89ab3..00000000000 --- a/tools/sdk/include/soc/soc/nrx_reg.h +++ /dev/null @@ -1,55 +0,0 @@ -// 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. - -#pragma once - -#include "soc/soc.h" - -/* Some of the WiFi RX control registers. - * PU/PD fields defined here are used in sleep related functions. - */ - -#define NRXPD_CTRL (DR_REG_NRX_BASE + 0x00d4) -#define NRX_CHAN_EST_FORCE_PU (BIT(7)) -#define NRX_CHAN_EST_FORCE_PU_M (BIT(7)) -#define NRX_CHAN_EST_FORCE_PU_V 1 -#define NRX_CHAN_EST_FORCE_PU_S 7 -#define NRX_CHAN_EST_FORCE_PD (BIT(6)) -#define NRX_CHAN_EST_FORCE_PD_M (BIT(6)) -#define NRX_CHAN_EST_FORCE_PD_V 1 -#define NRX_CHAN_EST_FORCE_PD_S 6 -#define NRX_RX_ROT_FORCE_PU (BIT(5)) -#define NRX_RX_ROT_FORCE_PU_M (BIT(5)) -#define NRX_RX_ROT_FORCE_PU_V 1 -#define NRX_RX_ROT_FORCE_PU_S 5 -#define NRX_RX_ROT_FORCE_PD (BIT(4)) -#define NRX_RX_ROT_FORCE_PD_M (BIT(4)) -#define NRX_RX_ROT_FORCE_PD_V 1 -#define NRX_RX_ROT_FORCE_PD_S 4 -#define NRX_VIT_FORCE_PU (BIT(3)) -#define NRX_VIT_FORCE_PU_M (BIT(3)) -#define NRX_VIT_FORCE_PU_V 1 -#define NRX_VIT_FORCE_PU_S 3 -#define NRX_VIT_FORCE_PD (BIT(2)) -#define NRX_VIT_FORCE_PD_M (BIT(2)) -#define NRX_VIT_FORCE_PD_V 1 -#define NRX_VIT_FORCE_PD_S 2 -#define NRX_DEMAP_FORCE_PU (BIT(1)) -#define NRX_DEMAP_FORCE_PU_M (BIT(1)) -#define NRX_DEMAP_FORCE_PU_V 1 -#define NRX_DEMAP_FORCE_PU_S 1 -#define NRX_DEMAP_FORCE_PD (BIT(0)) -#define NRX_DEMAP_FORCE_PD_M (BIT(0)) -#define NRX_DEMAP_FORCE_PD_V 1 -#define NRX_DEMAP_FORCE_PD_S 0 diff --git a/tools/sdk/include/soc/soc/pcnt_reg.h b/tools/sdk/include/soc/soc/pcnt_reg.h deleted file mode 100644 index fa7dedc2528..00000000000 --- a/tools/sdk/include/soc/soc/pcnt_reg.h +++ /dev/null @@ -1,1526 +0,0 @@ -// 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. -#ifndef _SOC_PCNT_REG_H_ -#define _SOC_PCNT_REG_H_ - - -#include "soc.h" -#define PCNT_U0_CONF0_REG (DR_REG_PCNT_BASE + 0x0000) -/* PCNT_CH1_LCTRL_MODE_U0 : R/W ;bitpos:[31:30] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's low control - signal for unit0. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH1_LCTRL_MODE_U0 0x00000003 -#define PCNT_CH1_LCTRL_MODE_U0_M ((PCNT_CH1_LCTRL_MODE_U0_V)<<(PCNT_CH1_LCTRL_MODE_U0_S)) -#define PCNT_CH1_LCTRL_MODE_U0_V 0x3 -#define PCNT_CH1_LCTRL_MODE_U0_S 30 -/* PCNT_CH1_HCTRL_MODE_U0 : R/W ;bitpos:[29:28] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's high - control signal for unit0. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH1_HCTRL_MODE_U0 0x00000003 -#define PCNT_CH1_HCTRL_MODE_U0_M ((PCNT_CH1_HCTRL_MODE_U0_V)<<(PCNT_CH1_HCTRL_MODE_U0_S)) -#define PCNT_CH1_HCTRL_MODE_U0_V 0x3 -#define PCNT_CH1_HCTRL_MODE_U0_S 28 -/* PCNT_CH1_POS_MODE_U0 : R/W ;bitpos:[27:26] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's input - posedge signal for unit0. 2'd1: increase at the posedge of input signal 2'd2:decrease at the posedge of input signal others:forbidden*/ -#define PCNT_CH1_POS_MODE_U0 0x00000003 -#define PCNT_CH1_POS_MODE_U0_M ((PCNT_CH1_POS_MODE_U0_V)<<(PCNT_CH1_POS_MODE_U0_S)) -#define PCNT_CH1_POS_MODE_U0_V 0x3 -#define PCNT_CH1_POS_MODE_U0_S 26 -/* PCNT_CH1_NEG_MODE_U0 : R/W ;bitpos:[25:24] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's input - negedge signal for unit0. 2'd1: increase at the negedge of input signal 2'd2:decrease at the negedge of input signal others:forbidden*/ -#define PCNT_CH1_NEG_MODE_U0 0x00000003 -#define PCNT_CH1_NEG_MODE_U0_M ((PCNT_CH1_NEG_MODE_U0_V)<<(PCNT_CH1_NEG_MODE_U0_S)) -#define PCNT_CH1_NEG_MODE_U0_V 0x3 -#define PCNT_CH1_NEG_MODE_U0_S 24 -/* PCNT_CH0_LCTRL_MODE_U0 : R/W ;bitpos:[23:22] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's low control - signal for unit0. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH0_LCTRL_MODE_U0 0x00000003 -#define PCNT_CH0_LCTRL_MODE_U0_M ((PCNT_CH0_LCTRL_MODE_U0_V)<<(PCNT_CH0_LCTRL_MODE_U0_S)) -#define PCNT_CH0_LCTRL_MODE_U0_V 0x3 -#define PCNT_CH0_LCTRL_MODE_U0_S 22 -/* PCNT_CH0_HCTRL_MODE_U0 : R/W ;bitpos:[21:20] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's high - control signal for unit0. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH0_HCTRL_MODE_U0 0x00000003 -#define PCNT_CH0_HCTRL_MODE_U0_M ((PCNT_CH0_HCTRL_MODE_U0_V)<<(PCNT_CH0_HCTRL_MODE_U0_S)) -#define PCNT_CH0_HCTRL_MODE_U0_V 0x3 -#define PCNT_CH0_HCTRL_MODE_U0_S 20 -/* PCNT_CH0_POS_MODE_U0 : R/W ;bitpos:[19:18] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's input - posedge signal for unit0. 2'd1: increase at the posedge of input signal 2'd2:decrease at the posedge of input signal others:forbidden*/ -#define PCNT_CH0_POS_MODE_U0 0x00000003 -#define PCNT_CH0_POS_MODE_U0_M ((PCNT_CH0_POS_MODE_U0_V)<<(PCNT_CH0_POS_MODE_U0_S)) -#define PCNT_CH0_POS_MODE_U0_V 0x3 -#define PCNT_CH0_POS_MODE_U0_S 18 -/* PCNT_CH0_NEG_MODE_U0 : R/W ;bitpos:[17:16] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's input - negedge signal for unit0. 2'd1: increase at the negedge of input signal 2'd2:decrease at the negedge of input signal others:forbidden*/ -#define PCNT_CH0_NEG_MODE_U0 0x00000003 -#define PCNT_CH0_NEG_MODE_U0_M ((PCNT_CH0_NEG_MODE_U0_V)<<(PCNT_CH0_NEG_MODE_U0_S)) -#define PCNT_CH0_NEG_MODE_U0_V 0x3 -#define PCNT_CH0_NEG_MODE_U0_S 16 -/* PCNT_THR_THRES1_EN_U0 : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: This is the enable bit for comparing unit0's count with thres1 value .*/ -#define PCNT_THR_THRES1_EN_U0 (BIT(15)) -#define PCNT_THR_THRES1_EN_U0_M (BIT(15)) -#define PCNT_THR_THRES1_EN_U0_V 0x1 -#define PCNT_THR_THRES1_EN_U0_S 15 -/* PCNT_THR_THRES0_EN_U0 : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: This is the enable bit for comparing unit0's count with thres0 value.*/ -#define PCNT_THR_THRES0_EN_U0 (BIT(14)) -#define PCNT_THR_THRES0_EN_U0_M (BIT(14)) -#define PCNT_THR_THRES0_EN_U0_V 0x1 -#define PCNT_THR_THRES0_EN_U0_S 14 -/* PCNT_THR_L_LIM_EN_U0 : R/W ;bitpos:[13] ;default: 1'b1 ; */ -/*description: This is the enable bit for comparing unit0's count with thr_l_lim value.*/ -#define PCNT_THR_L_LIM_EN_U0 (BIT(13)) -#define PCNT_THR_L_LIM_EN_U0_M (BIT(13)) -#define PCNT_THR_L_LIM_EN_U0_V 0x1 -#define PCNT_THR_L_LIM_EN_U0_S 13 -/* PCNT_THR_H_LIM_EN_U0 : R/W ;bitpos:[12] ;default: 1'b1 ; */ -/*description: This is the enable bit for comparing unit0's count with thr_h_lim value.*/ -#define PCNT_THR_H_LIM_EN_U0 (BIT(12)) -#define PCNT_THR_H_LIM_EN_U0_M (BIT(12)) -#define PCNT_THR_H_LIM_EN_U0_V 0x1 -#define PCNT_THR_H_LIM_EN_U0_S 12 -/* PCNT_THR_ZERO_EN_U0 : R/W ;bitpos:[11] ;default: 1'b1 ; */ -/*description: This is the enable bit for comparing unit0's count with 0 value.*/ -#define PCNT_THR_ZERO_EN_U0 (BIT(11)) -#define PCNT_THR_ZERO_EN_U0_M (BIT(11)) -#define PCNT_THR_ZERO_EN_U0_V 0x1 -#define PCNT_THR_ZERO_EN_U0_S 11 -/* PCNT_FILTER_EN_U0 : R/W ;bitpos:[10] ;default: 1'b1 ; */ -/*description: This is the enable bit for filtering input signals for unit0.*/ -#define PCNT_FILTER_EN_U0 (BIT(10)) -#define PCNT_FILTER_EN_U0_M (BIT(10)) -#define PCNT_FILTER_EN_U0_V 0x1 -#define PCNT_FILTER_EN_U0_S 10 -/* PCNT_FILTER_THRES_U0 : R/W ;bitpos:[9:0] ;default: 10'h10 ; */ -/*description: This register is used to filter pluse whose width is smaller - than this value for unit0.*/ -#define PCNT_FILTER_THRES_U0 0x000003FF -#define PCNT_FILTER_THRES_U0_M ((PCNT_FILTER_THRES_U0_V)<<(PCNT_FILTER_THRES_U0_S)) -#define PCNT_FILTER_THRES_U0_V 0x3FF -#define PCNT_FILTER_THRES_U0_S 0 - -#define PCNT_U0_CONF1_REG (DR_REG_PCNT_BASE + 0x0004) -/* PCNT_CNT_THRES1_U0 : R/W ;bitpos:[31:16] ;default: 10'h0 ; */ -/*description: This register is used to configure thres1 value for unit0.*/ -#define PCNT_CNT_THRES1_U0 0x0000FFFF -#define PCNT_CNT_THRES1_U0_M ((PCNT_CNT_THRES1_U0_V)<<(PCNT_CNT_THRES1_U0_S)) -#define PCNT_CNT_THRES1_U0_V 0xFFFF -#define PCNT_CNT_THRES1_U0_S 16 -/* PCNT_CNT_THRES0_U0 : R/W ;bitpos:[15:0] ;default: 10'h0 ; */ -/*description: This register is used to configure thres0 value for unit0.*/ -#define PCNT_CNT_THRES0_U0 0x0000FFFF -#define PCNT_CNT_THRES0_U0_M ((PCNT_CNT_THRES0_U0_V)<<(PCNT_CNT_THRES0_U0_S)) -#define PCNT_CNT_THRES0_U0_V 0xFFFF -#define PCNT_CNT_THRES0_U0_S 0 - -#define PCNT_U0_CONF2_REG (DR_REG_PCNT_BASE + 0x0008) -/* PCNT_CNT_L_LIM_U0 : R/W ;bitpos:[31:16] ;default: 10'h0 ; */ -/*description: This register is used to confiugre thr_l_lim value for unit0.*/ -#define PCNT_CNT_L_LIM_U0 0x0000FFFF -#define PCNT_CNT_L_LIM_U0_M ((PCNT_CNT_L_LIM_U0_V)<<(PCNT_CNT_L_LIM_U0_S)) -#define PCNT_CNT_L_LIM_U0_V 0xFFFF -#define PCNT_CNT_L_LIM_U0_S 16 -/* PCNT_CNT_H_LIM_U0 : R/W ;bitpos:[15:0] ;default: 10'h0 ; */ -/*description: This register is used to configure thr_h_lim value for unit0.*/ -#define PCNT_CNT_H_LIM_U0 0x0000FFFF -#define PCNT_CNT_H_LIM_U0_M ((PCNT_CNT_H_LIM_U0_V)<<(PCNT_CNT_H_LIM_U0_S)) -#define PCNT_CNT_H_LIM_U0_V 0xFFFF -#define PCNT_CNT_H_LIM_U0_S 0 - -#define PCNT_U1_CONF0_REG (DR_REG_PCNT_BASE + 0x000c) -/* PCNT_CH1_LCTRL_MODE_U1 : R/W ;bitpos:[31:30] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's low control - signal for unit1. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH1_LCTRL_MODE_U1 0x00000003 -#define PCNT_CH1_LCTRL_MODE_U1_M ((PCNT_CH1_LCTRL_MODE_U1_V)<<(PCNT_CH1_LCTRL_MODE_U1_S)) -#define PCNT_CH1_LCTRL_MODE_U1_V 0x3 -#define PCNT_CH1_LCTRL_MODE_U1_S 30 -/* PCNT_CH1_HCTRL_MODE_U1 : R/W ;bitpos:[29:28] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's high - control signal for unit1. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH1_HCTRL_MODE_U1 0x00000003 -#define PCNT_CH1_HCTRL_MODE_U1_M ((PCNT_CH1_HCTRL_MODE_U1_V)<<(PCNT_CH1_HCTRL_MODE_U1_S)) -#define PCNT_CH1_HCTRL_MODE_U1_V 0x3 -#define PCNT_CH1_HCTRL_MODE_U1_S 28 -/* PCNT_CH1_POS_MODE_U1 : R/W ;bitpos:[27:26] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's input - posedge signal for unit1. 2'd1: increase at the posedge of input signal 2'd2:decrease at the posedge of input signal others:forbidden*/ -#define PCNT_CH1_POS_MODE_U1 0x00000003 -#define PCNT_CH1_POS_MODE_U1_M ((PCNT_CH1_POS_MODE_U1_V)<<(PCNT_CH1_POS_MODE_U1_S)) -#define PCNT_CH1_POS_MODE_U1_V 0x3 -#define PCNT_CH1_POS_MODE_U1_S 26 -/* PCNT_CH1_NEG_MODE_U1 : R/W ;bitpos:[25:24] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's input - negedge signal for unit1. 2'd1: increase at the negedge of input signal 2'd2:decrease at the negedge of input signal others:forbidden*/ -#define PCNT_CH1_NEG_MODE_U1 0x00000003 -#define PCNT_CH1_NEG_MODE_U1_M ((PCNT_CH1_NEG_MODE_U1_V)<<(PCNT_CH1_NEG_MODE_U1_S)) -#define PCNT_CH1_NEG_MODE_U1_V 0x3 -#define PCNT_CH1_NEG_MODE_U1_S 24 -/* PCNT_CH0_LCTRL_MODE_U1 : R/W ;bitpos:[23:22] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's low control - signal for unit1. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH0_LCTRL_MODE_U1 0x00000003 -#define PCNT_CH0_LCTRL_MODE_U1_M ((PCNT_CH0_LCTRL_MODE_U1_V)<<(PCNT_CH0_LCTRL_MODE_U1_S)) -#define PCNT_CH0_LCTRL_MODE_U1_V 0x3 -#define PCNT_CH0_LCTRL_MODE_U1_S 22 -/* PCNT_CH0_HCTRL_MODE_U1 : R/W ;bitpos:[21:20] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's high - control signal for unit1. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH0_HCTRL_MODE_U1 0x00000003 -#define PCNT_CH0_HCTRL_MODE_U1_M ((PCNT_CH0_HCTRL_MODE_U1_V)<<(PCNT_CH0_HCTRL_MODE_U1_S)) -#define PCNT_CH0_HCTRL_MODE_U1_V 0x3 -#define PCNT_CH0_HCTRL_MODE_U1_S 20 -/* PCNT_CH0_POS_MODE_U1 : R/W ;bitpos:[19:18] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's input - posedge signal for unit1. 2'd1: increase at the posedge of input signal 2'd2:decrease at the posedge of input signal others:forbidden*/ -#define PCNT_CH0_POS_MODE_U1 0x00000003 -#define PCNT_CH0_POS_MODE_U1_M ((PCNT_CH0_POS_MODE_U1_V)<<(PCNT_CH0_POS_MODE_U1_S)) -#define PCNT_CH0_POS_MODE_U1_V 0x3 -#define PCNT_CH0_POS_MODE_U1_S 18 -/* PCNT_CH0_NEG_MODE_U1 : R/W ;bitpos:[17:16] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's input - negedge signal for unit1. 2'd1: increase at the negedge of input signal 2'd2:decrease at the negedge of input signal others:forbidden*/ -#define PCNT_CH0_NEG_MODE_U1 0x00000003 -#define PCNT_CH0_NEG_MODE_U1_M ((PCNT_CH0_NEG_MODE_U1_V)<<(PCNT_CH0_NEG_MODE_U1_S)) -#define PCNT_CH0_NEG_MODE_U1_V 0x3 -#define PCNT_CH0_NEG_MODE_U1_S 16 -/* PCNT_THR_THRES1_EN_U1 : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: This is the enable bit for comparing unit1's count with thres1 value .*/ -#define PCNT_THR_THRES1_EN_U1 (BIT(15)) -#define PCNT_THR_THRES1_EN_U1_M (BIT(15)) -#define PCNT_THR_THRES1_EN_U1_V 0x1 -#define PCNT_THR_THRES1_EN_U1_S 15 -/* PCNT_THR_THRES0_EN_U1 : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: This is the enable bit for comparing unit1's count with thres0 value.*/ -#define PCNT_THR_THRES0_EN_U1 (BIT(14)) -#define PCNT_THR_THRES0_EN_U1_M (BIT(14)) -#define PCNT_THR_THRES0_EN_U1_V 0x1 -#define PCNT_THR_THRES0_EN_U1_S 14 -/* PCNT_THR_L_LIM_EN_U1 : R/W ;bitpos:[13] ;default: 1'b1 ; */ -/*description: This is the enable bit for comparing unit1's count with thr_l_lim value.*/ -#define PCNT_THR_L_LIM_EN_U1 (BIT(13)) -#define PCNT_THR_L_LIM_EN_U1_M (BIT(13)) -#define PCNT_THR_L_LIM_EN_U1_V 0x1 -#define PCNT_THR_L_LIM_EN_U1_S 13 -/* PCNT_THR_H_LIM_EN_U1 : R/W ;bitpos:[12] ;default: 1'b1 ; */ -/*description: This is the enable bit for comparing unit1's count with thr_h_lim value.*/ -#define PCNT_THR_H_LIM_EN_U1 (BIT(12)) -#define PCNT_THR_H_LIM_EN_U1_M (BIT(12)) -#define PCNT_THR_H_LIM_EN_U1_V 0x1 -#define PCNT_THR_H_LIM_EN_U1_S 12 -/* PCNT_THR_ZERO_EN_U1 : R/W ;bitpos:[11] ;default: 1'b1 ; */ -/*description: This is the enable bit for comparing unit1's count with 0 value.*/ -#define PCNT_THR_ZERO_EN_U1 (BIT(11)) -#define PCNT_THR_ZERO_EN_U1_M (BIT(11)) -#define PCNT_THR_ZERO_EN_U1_V 0x1 -#define PCNT_THR_ZERO_EN_U1_S 11 -/* PCNT_FILTER_EN_U1 : R/W ;bitpos:[10] ;default: 1'b1 ; */ -/*description: This is the enable bit for filtering input signals for unit1.*/ -#define PCNT_FILTER_EN_U1 (BIT(10)) -#define PCNT_FILTER_EN_U1_M (BIT(10)) -#define PCNT_FILTER_EN_U1_V 0x1 -#define PCNT_FILTER_EN_U1_S 10 -/* PCNT_FILTER_THRES_U1 : R/W ;bitpos:[9:0] ;default: 10'h10 ; */ -/*description: This register is used to filter pluse whose width is smaller - than this value for unit1.*/ -#define PCNT_FILTER_THRES_U1 0x000003FF -#define PCNT_FILTER_THRES_U1_M ((PCNT_FILTER_THRES_U1_V)<<(PCNT_FILTER_THRES_U1_S)) -#define PCNT_FILTER_THRES_U1_V 0x3FF -#define PCNT_FILTER_THRES_U1_S 0 - -#define PCNT_U1_CONF1_REG (DR_REG_PCNT_BASE + 0x0010) -/* PCNT_CNT_THRES1_U1 : R/W ;bitpos:[31:16] ;default: 10'h0 ; */ -/*description: This register is used to configure thres1 value for unit1.*/ -#define PCNT_CNT_THRES1_U1 0x0000FFFF -#define PCNT_CNT_THRES1_U1_M ((PCNT_CNT_THRES1_U1_V)<<(PCNT_CNT_THRES1_U1_S)) -#define PCNT_CNT_THRES1_U1_V 0xFFFF -#define PCNT_CNT_THRES1_U1_S 16 -/* PCNT_CNT_THRES0_U1 : R/W ;bitpos:[15:0] ;default: 10'h0 ; */ -/*description: This register is used to configure thres0 value for unit1.*/ -#define PCNT_CNT_THRES0_U1 0x0000FFFF -#define PCNT_CNT_THRES0_U1_M ((PCNT_CNT_THRES0_U1_V)<<(PCNT_CNT_THRES0_U1_S)) -#define PCNT_CNT_THRES0_U1_V 0xFFFF -#define PCNT_CNT_THRES0_U1_S 0 - -#define PCNT_U1_CONF2_REG (DR_REG_PCNT_BASE + 0x0014) -/* PCNT_CNT_L_LIM_U1 : R/W ;bitpos:[31:16] ;default: 10'h0 ; */ -/*description: This register is used to confiugre thr_l_lim value for unit1.*/ -#define PCNT_CNT_L_LIM_U1 0x0000FFFF -#define PCNT_CNT_L_LIM_U1_M ((PCNT_CNT_L_LIM_U1_V)<<(PCNT_CNT_L_LIM_U1_S)) -#define PCNT_CNT_L_LIM_U1_V 0xFFFF -#define PCNT_CNT_L_LIM_U1_S 16 -/* PCNT_CNT_H_LIM_U1 : R/W ;bitpos:[15:0] ;default: 10'h0 ; */ -/*description: This register is used to configure thr_h_lim value for unit1.*/ -#define PCNT_CNT_H_LIM_U1 0x0000FFFF -#define PCNT_CNT_H_LIM_U1_M ((PCNT_CNT_H_LIM_U1_V)<<(PCNT_CNT_H_LIM_U1_S)) -#define PCNT_CNT_H_LIM_U1_V 0xFFFF -#define PCNT_CNT_H_LIM_U1_S 0 - -#define PCNT_U2_CONF0_REG (DR_REG_PCNT_BASE + 0x0018) -/* PCNT_CH1_LCTRL_MODE_U2 : R/W ;bitpos:[31:30] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's low control - signal for unit2. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH1_LCTRL_MODE_U2 0x00000003 -#define PCNT_CH1_LCTRL_MODE_U2_M ((PCNT_CH1_LCTRL_MODE_U2_V)<<(PCNT_CH1_LCTRL_MODE_U2_S)) -#define PCNT_CH1_LCTRL_MODE_U2_V 0x3 -#define PCNT_CH1_LCTRL_MODE_U2_S 30 -/* PCNT_CH1_HCTRL_MODE_U2 : R/W ;bitpos:[29:28] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's high - control signal for unit2. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH1_HCTRL_MODE_U2 0x00000003 -#define PCNT_CH1_HCTRL_MODE_U2_M ((PCNT_CH1_HCTRL_MODE_U2_V)<<(PCNT_CH1_HCTRL_MODE_U2_S)) -#define PCNT_CH1_HCTRL_MODE_U2_V 0x3 -#define PCNT_CH1_HCTRL_MODE_U2_S 28 -/* PCNT_CH1_POS_MODE_U2 : R/W ;bitpos:[27:26] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's input - posedge signal for unit2. 2'd1: increase at the posedge of input signal 2'd2:decrease at the posedge of input signal others:forbidden*/ -#define PCNT_CH1_POS_MODE_U2 0x00000003 -#define PCNT_CH1_POS_MODE_U2_M ((PCNT_CH1_POS_MODE_U2_V)<<(PCNT_CH1_POS_MODE_U2_S)) -#define PCNT_CH1_POS_MODE_U2_V 0x3 -#define PCNT_CH1_POS_MODE_U2_S 26 -/* PCNT_CH1_NEG_MODE_U2 : R/W ;bitpos:[25:24] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's input - negedge signal for unit2. 2'd1: increase at the negedge of input signal 2'd2:decrease at the negedge of input signal others:forbidden*/ -#define PCNT_CH1_NEG_MODE_U2 0x00000003 -#define PCNT_CH1_NEG_MODE_U2_M ((PCNT_CH1_NEG_MODE_U2_V)<<(PCNT_CH1_NEG_MODE_U2_S)) -#define PCNT_CH1_NEG_MODE_U2_V 0x3 -#define PCNT_CH1_NEG_MODE_U2_S 24 -/* PCNT_CH0_LCTRL_MODE_U2 : R/W ;bitpos:[23:22] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's low control - signal for unit2. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH0_LCTRL_MODE_U2 0x00000003 -#define PCNT_CH0_LCTRL_MODE_U2_M ((PCNT_CH0_LCTRL_MODE_U2_V)<<(PCNT_CH0_LCTRL_MODE_U2_S)) -#define PCNT_CH0_LCTRL_MODE_U2_V 0x3 -#define PCNT_CH0_LCTRL_MODE_U2_S 22 -/* PCNT_CH0_HCTRL_MODE_U2 : R/W ;bitpos:[21:20] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's high - control signal for unit2. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH0_HCTRL_MODE_U2 0x00000003 -#define PCNT_CH0_HCTRL_MODE_U2_M ((PCNT_CH0_HCTRL_MODE_U2_V)<<(PCNT_CH0_HCTRL_MODE_U2_S)) -#define PCNT_CH0_HCTRL_MODE_U2_V 0x3 -#define PCNT_CH0_HCTRL_MODE_U2_S 20 -/* PCNT_CH0_POS_MODE_U2 : R/W ;bitpos:[19:18] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's input - posedge signal for unit2. 2'd1: increase at the posedge of input signal 2'd2:decrease at the posedge of input signal others:forbidden*/ -#define PCNT_CH0_POS_MODE_U2 0x00000003 -#define PCNT_CH0_POS_MODE_U2_M ((PCNT_CH0_POS_MODE_U2_V)<<(PCNT_CH0_POS_MODE_U2_S)) -#define PCNT_CH0_POS_MODE_U2_V 0x3 -#define PCNT_CH0_POS_MODE_U2_S 18 -/* PCNT_CH0_NEG_MODE_U2 : R/W ;bitpos:[17:16] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's input - negedge signal for unit2. 2'd1: increase at the negedge of input signal 2'd2:decrease at the negedge of input signal others:forbidden*/ -#define PCNT_CH0_NEG_MODE_U2 0x00000003 -#define PCNT_CH0_NEG_MODE_U2_M ((PCNT_CH0_NEG_MODE_U2_V)<<(PCNT_CH0_NEG_MODE_U2_S)) -#define PCNT_CH0_NEG_MODE_U2_V 0x3 -#define PCNT_CH0_NEG_MODE_U2_S 16 -/* PCNT_THR_THRES1_EN_U2 : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: This is the enable bit for comparing unit2's count with thres1 value .*/ -#define PCNT_THR_THRES1_EN_U2 (BIT(15)) -#define PCNT_THR_THRES1_EN_U2_M (BIT(15)) -#define PCNT_THR_THRES1_EN_U2_V 0x1 -#define PCNT_THR_THRES1_EN_U2_S 15 -/* PCNT_THR_THRES0_EN_U2 : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: This is the enable bit for comparing unit2's count with thres0 value.*/ -#define PCNT_THR_THRES0_EN_U2 (BIT(14)) -#define PCNT_THR_THRES0_EN_U2_M (BIT(14)) -#define PCNT_THR_THRES0_EN_U2_V 0x1 -#define PCNT_THR_THRES0_EN_U2_S 14 -/* PCNT_THR_L_LIM_EN_U2 : R/W ;bitpos:[13] ;default: 1'b1 ; */ -/*description: This is the enable bit for comparing unit2's count with thr_l_lim value.*/ -#define PCNT_THR_L_LIM_EN_U2 (BIT(13)) -#define PCNT_THR_L_LIM_EN_U2_M (BIT(13)) -#define PCNT_THR_L_LIM_EN_U2_V 0x1 -#define PCNT_THR_L_LIM_EN_U2_S 13 -/* PCNT_THR_H_LIM_EN_U2 : R/W ;bitpos:[12] ;default: 1'b1 ; */ -/*description: This is the enable bit for comparing unit2's count with thr_h_lim value.*/ -#define PCNT_THR_H_LIM_EN_U2 (BIT(12)) -#define PCNT_THR_H_LIM_EN_U2_M (BIT(12)) -#define PCNT_THR_H_LIM_EN_U2_V 0x1 -#define PCNT_THR_H_LIM_EN_U2_S 12 -/* PCNT_THR_ZERO_EN_U2 : R/W ;bitpos:[11] ;default: 1'b1 ; */ -/*description: This is the enable bit for comparing unit2's count with 0 value.*/ -#define PCNT_THR_ZERO_EN_U2 (BIT(11)) -#define PCNT_THR_ZERO_EN_U2_M (BIT(11)) -#define PCNT_THR_ZERO_EN_U2_V 0x1 -#define PCNT_THR_ZERO_EN_U2_S 11 -/* PCNT_FILTER_EN_U2 : R/W ;bitpos:[10] ;default: 1'b1 ; */ -/*description: This is the enable bit for filtering input signals for unit2.*/ -#define PCNT_FILTER_EN_U2 (BIT(10)) -#define PCNT_FILTER_EN_U2_M (BIT(10)) -#define PCNT_FILTER_EN_U2_V 0x1 -#define PCNT_FILTER_EN_U2_S 10 -/* PCNT_FILTER_THRES_U2 : R/W ;bitpos:[9:0] ;default: 10'h10 ; */ -/*description: This register is used to filter pluse whose width is smaller - than this value for unit2.*/ -#define PCNT_FILTER_THRES_U2 0x000003FF -#define PCNT_FILTER_THRES_U2_M ((PCNT_FILTER_THRES_U2_V)<<(PCNT_FILTER_THRES_U2_S)) -#define PCNT_FILTER_THRES_U2_V 0x3FF -#define PCNT_FILTER_THRES_U2_S 0 - -#define PCNT_U2_CONF1_REG (DR_REG_PCNT_BASE + 0x001c) -/* PCNT_CNT_THRES1_U2 : R/W ;bitpos:[31:16] ;default: 10'h0 ; */ -/*description: This register is used to configure thres1 value for unit2.*/ -#define PCNT_CNT_THRES1_U2 0x0000FFFF -#define PCNT_CNT_THRES1_U2_M ((PCNT_CNT_THRES1_U2_V)<<(PCNT_CNT_THRES1_U2_S)) -#define PCNT_CNT_THRES1_U2_V 0xFFFF -#define PCNT_CNT_THRES1_U2_S 16 -/* PCNT_CNT_THRES0_U2 : R/W ;bitpos:[15:0] ;default: 10'h0 ; */ -/*description: This register is used to configure thres0 value for unit2.*/ -#define PCNT_CNT_THRES0_U2 0x0000FFFF -#define PCNT_CNT_THRES0_U2_M ((PCNT_CNT_THRES0_U2_V)<<(PCNT_CNT_THRES0_U2_S)) -#define PCNT_CNT_THRES0_U2_V 0xFFFF -#define PCNT_CNT_THRES0_U2_S 0 - -#define PCNT_U2_CONF2_REG (DR_REG_PCNT_BASE + 0x0020) -/* PCNT_CNT_L_LIM_U2 : R/W ;bitpos:[31:16] ;default: 10'h0 ; */ -/*description: This register is used to confiugre thr_l_lim value for unit2.*/ -#define PCNT_CNT_L_LIM_U2 0x0000FFFF -#define PCNT_CNT_L_LIM_U2_M ((PCNT_CNT_L_LIM_U2_V)<<(PCNT_CNT_L_LIM_U2_S)) -#define PCNT_CNT_L_LIM_U2_V 0xFFFF -#define PCNT_CNT_L_LIM_U2_S 16 -/* PCNT_CNT_H_LIM_U2 : R/W ;bitpos:[15:0] ;default: 10'h0 ; */ -/*description: This register is used to configure thr_h_lim value for unit2.*/ -#define PCNT_CNT_H_LIM_U2 0x0000FFFF -#define PCNT_CNT_H_LIM_U2_M ((PCNT_CNT_H_LIM_U2_V)<<(PCNT_CNT_H_LIM_U2_S)) -#define PCNT_CNT_H_LIM_U2_V 0xFFFF -#define PCNT_CNT_H_LIM_U2_S 0 - -#define PCNT_U3_CONF0_REG (DR_REG_PCNT_BASE + 0x0024) -/* PCNT_CH1_LCTRL_MODE_U3 : R/W ;bitpos:[31:30] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's low control - signal for unit3. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH1_LCTRL_MODE_U3 0x00000003 -#define PCNT_CH1_LCTRL_MODE_U3_M ((PCNT_CH1_LCTRL_MODE_U3_V)<<(PCNT_CH1_LCTRL_MODE_U3_S)) -#define PCNT_CH1_LCTRL_MODE_U3_V 0x3 -#define PCNT_CH1_LCTRL_MODE_U3_S 30 -/* PCNT_CH1_HCTRL_MODE_U3 : R/W ;bitpos:[29:28] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's high - control signal for unit3. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH1_HCTRL_MODE_U3 0x00000003 -#define PCNT_CH1_HCTRL_MODE_U3_M ((PCNT_CH1_HCTRL_MODE_U3_V)<<(PCNT_CH1_HCTRL_MODE_U3_S)) -#define PCNT_CH1_HCTRL_MODE_U3_V 0x3 -#define PCNT_CH1_HCTRL_MODE_U3_S 28 -/* PCNT_CH1_POS_MODE_U3 : R/W ;bitpos:[27:26] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's input - posedge signal for unit3. 2'd1: increase at the posedge of input signal 2'd2:decrease at the posedge of input signal others:forbidden*/ -#define PCNT_CH1_POS_MODE_U3 0x00000003 -#define PCNT_CH1_POS_MODE_U3_M ((PCNT_CH1_POS_MODE_U3_V)<<(PCNT_CH1_POS_MODE_U3_S)) -#define PCNT_CH1_POS_MODE_U3_V 0x3 -#define PCNT_CH1_POS_MODE_U3_S 26 -/* PCNT_CH1_NEG_MODE_U3 : R/W ;bitpos:[25:24] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's input - negedge signal for unit3. 2'd1: increase at the negedge of input signal 2'd2:decrease at the negedge of input signal others:forbidden*/ -#define PCNT_CH1_NEG_MODE_U3 0x00000003 -#define PCNT_CH1_NEG_MODE_U3_M ((PCNT_CH1_NEG_MODE_U3_V)<<(PCNT_CH1_NEG_MODE_U3_S)) -#define PCNT_CH1_NEG_MODE_U3_V 0x3 -#define PCNT_CH1_NEG_MODE_U3_S 24 -/* PCNT_CH0_LCTRL_MODE_U3 : R/W ;bitpos:[23:22] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's low control - signal for unit3. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH0_LCTRL_MODE_U3 0x00000003 -#define PCNT_CH0_LCTRL_MODE_U3_M ((PCNT_CH0_LCTRL_MODE_U3_V)<<(PCNT_CH0_LCTRL_MODE_U3_S)) -#define PCNT_CH0_LCTRL_MODE_U3_V 0x3 -#define PCNT_CH0_LCTRL_MODE_U3_S 22 -/* PCNT_CH0_HCTRL_MODE_U3 : R/W ;bitpos:[21:20] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's high - control signal for unit3. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH0_HCTRL_MODE_U3 0x00000003 -#define PCNT_CH0_HCTRL_MODE_U3_M ((PCNT_CH0_HCTRL_MODE_U3_V)<<(PCNT_CH0_HCTRL_MODE_U3_S)) -#define PCNT_CH0_HCTRL_MODE_U3_V 0x3 -#define PCNT_CH0_HCTRL_MODE_U3_S 20 -/* PCNT_CH0_POS_MODE_U3 : R/W ;bitpos:[19:18] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's input - posedge signal for unit3. 2'd1: increase at the posedge of input signal 2'd2:decrease at the posedge of input signal others:forbidden*/ -#define PCNT_CH0_POS_MODE_U3 0x00000003 -#define PCNT_CH0_POS_MODE_U3_M ((PCNT_CH0_POS_MODE_U3_V)<<(PCNT_CH0_POS_MODE_U3_S)) -#define PCNT_CH0_POS_MODE_U3_V 0x3 -#define PCNT_CH0_POS_MODE_U3_S 18 -/* PCNT_CH0_NEG_MODE_U3 : R/W ;bitpos:[17:16] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's input - negedge signal for unit3. 2'd1: increase at the negedge of input signal 2'd2:decrease at the negedge of input signal others:forbidden*/ -#define PCNT_CH0_NEG_MODE_U3 0x00000003 -#define PCNT_CH0_NEG_MODE_U3_M ((PCNT_CH0_NEG_MODE_U3_V)<<(PCNT_CH0_NEG_MODE_U3_S)) -#define PCNT_CH0_NEG_MODE_U3_V 0x3 -#define PCNT_CH0_NEG_MODE_U3_S 16 -/* PCNT_THR_THRES1_EN_U3 : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: This is the enable bit for comparing unit3's count with thres1 value .*/ -#define PCNT_THR_THRES1_EN_U3 (BIT(15)) -#define PCNT_THR_THRES1_EN_U3_M (BIT(15)) -#define PCNT_THR_THRES1_EN_U3_V 0x1 -#define PCNT_THR_THRES1_EN_U3_S 15 -/* PCNT_THR_THRES0_EN_U3 : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: This is the enable bit for comparing unit3's count with thres0 value.*/ -#define PCNT_THR_THRES0_EN_U3 (BIT(14)) -#define PCNT_THR_THRES0_EN_U3_M (BIT(14)) -#define PCNT_THR_THRES0_EN_U3_V 0x1 -#define PCNT_THR_THRES0_EN_U3_S 14 -/* PCNT_THR_L_LIM_EN_U3 : R/W ;bitpos:[13] ;default: 1'b1 ; */ -/*description: This is the enable bit for comparing unit3's count with thr_l_lim value.*/ -#define PCNT_THR_L_LIM_EN_U3 (BIT(13)) -#define PCNT_THR_L_LIM_EN_U3_M (BIT(13)) -#define PCNT_THR_L_LIM_EN_U3_V 0x1 -#define PCNT_THR_L_LIM_EN_U3_S 13 -/* PCNT_THR_H_LIM_EN_U3 : R/W ;bitpos:[12] ;default: 1'b1 ; */ -/*description: This is the enable bit for comparing unit3's count with thr_h_lim value.*/ -#define PCNT_THR_H_LIM_EN_U3 (BIT(12)) -#define PCNT_THR_H_LIM_EN_U3_M (BIT(12)) -#define PCNT_THR_H_LIM_EN_U3_V 0x1 -#define PCNT_THR_H_LIM_EN_U3_S 12 -/* PCNT_THR_ZERO_EN_U3 : R/W ;bitpos:[11] ;default: 1'b1 ; */ -/*description: This is the enable bit for comparing unit3's count with 0 value.*/ -#define PCNT_THR_ZERO_EN_U3 (BIT(11)) -#define PCNT_THR_ZERO_EN_U3_M (BIT(11)) -#define PCNT_THR_ZERO_EN_U3_V 0x1 -#define PCNT_THR_ZERO_EN_U3_S 11 -/* PCNT_FILTER_EN_U3 : R/W ;bitpos:[10] ;default: 1'b1 ; */ -/*description: This is the enable bit for filtering input signals for unit3.*/ -#define PCNT_FILTER_EN_U3 (BIT(10)) -#define PCNT_FILTER_EN_U3_M (BIT(10)) -#define PCNT_FILTER_EN_U3_V 0x1 -#define PCNT_FILTER_EN_U3_S 10 -/* PCNT_FILTER_THRES_U3 : R/W ;bitpos:[9:0] ;default: 10'h10 ; */ -/*description: This register is used to filter pluse whose width is smaller - than this value for unit3.*/ -#define PCNT_FILTER_THRES_U3 0x000003FF -#define PCNT_FILTER_THRES_U3_M ((PCNT_FILTER_THRES_U3_V)<<(PCNT_FILTER_THRES_U3_S)) -#define PCNT_FILTER_THRES_U3_V 0x3FF -#define PCNT_FILTER_THRES_U3_S 0 - -#define PCNT_U3_CONF1_REG (DR_REG_PCNT_BASE + 0x0028) -/* PCNT_CNT_THRES1_U3 : R/W ;bitpos:[31:16] ;default: 10'h0 ; */ -/*description: This register is used to configure thres1 value for unit3.*/ -#define PCNT_CNT_THRES1_U3 0x0000FFFF -#define PCNT_CNT_THRES1_U3_M ((PCNT_CNT_THRES1_U3_V)<<(PCNT_CNT_THRES1_U3_S)) -#define PCNT_CNT_THRES1_U3_V 0xFFFF -#define PCNT_CNT_THRES1_U3_S 16 -/* PCNT_CNT_THRES0_U3 : R/W ;bitpos:[15:0] ;default: 10'h0 ; */ -/*description: This register is used to configure thres0 value for unit3.*/ -#define PCNT_CNT_THRES0_U3 0x0000FFFF -#define PCNT_CNT_THRES0_U3_M ((PCNT_CNT_THRES0_U3_V)<<(PCNT_CNT_THRES0_U3_S)) -#define PCNT_CNT_THRES0_U3_V 0xFFFF -#define PCNT_CNT_THRES0_U3_S 0 - -#define PCNT_U3_CONF2_REG (DR_REG_PCNT_BASE + 0x002c) -/* PCNT_CNT_L_LIM_U3 : R/W ;bitpos:[31:16] ;default: 10'h0 ; */ -/*description: This register is used to confiugre thr_l_lim value for unit3.*/ -#define PCNT_CNT_L_LIM_U3 0x0000FFFF -#define PCNT_CNT_L_LIM_U3_M ((PCNT_CNT_L_LIM_U3_V)<<(PCNT_CNT_L_LIM_U3_S)) -#define PCNT_CNT_L_LIM_U3_V 0xFFFF -#define PCNT_CNT_L_LIM_U3_S 16 -/* PCNT_CNT_H_LIM_U3 : R/W ;bitpos:[15:0] ;default: 10'h0 ; */ -/*description: This register is used to configure thr_h_lim value for unit3.*/ -#define PCNT_CNT_H_LIM_U3 0x0000FFFF -#define PCNT_CNT_H_LIM_U3_M ((PCNT_CNT_H_LIM_U3_V)<<(PCNT_CNT_H_LIM_U3_S)) -#define PCNT_CNT_H_LIM_U3_V 0xFFFF -#define PCNT_CNT_H_LIM_U3_S 0 - -#define PCNT_U4_CONF0_REG (DR_REG_PCNT_BASE + 0x0030) -/* PCNT_CH1_LCTRL_MODE_U4 : R/W ;bitpos:[31:30] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's low control - signal for unit4. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH1_LCTRL_MODE_U4 0x00000003 -#define PCNT_CH1_LCTRL_MODE_U4_M ((PCNT_CH1_LCTRL_MODE_U4_V)<<(PCNT_CH1_LCTRL_MODE_U4_S)) -#define PCNT_CH1_LCTRL_MODE_U4_V 0x3 -#define PCNT_CH1_LCTRL_MODE_U4_S 30 -/* PCNT_CH1_HCTRL_MODE_U4 : R/W ;bitpos:[29:28] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's high - control signal for unit4. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH1_HCTRL_MODE_U4 0x00000003 -#define PCNT_CH1_HCTRL_MODE_U4_M ((PCNT_CH1_HCTRL_MODE_U4_V)<<(PCNT_CH1_HCTRL_MODE_U4_S)) -#define PCNT_CH1_HCTRL_MODE_U4_V 0x3 -#define PCNT_CH1_HCTRL_MODE_U4_S 28 -/* PCNT_CH1_POS_MODE_U4 : R/W ;bitpos:[27:26] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's input - posedge signal for unit4. 2'd1: increase at the posedge of input signal 2'd2:decrease at the posedge of input signal others:forbidden*/ -#define PCNT_CH1_POS_MODE_U4 0x00000003 -#define PCNT_CH1_POS_MODE_U4_M ((PCNT_CH1_POS_MODE_U4_V)<<(PCNT_CH1_POS_MODE_U4_S)) -#define PCNT_CH1_POS_MODE_U4_V 0x3 -#define PCNT_CH1_POS_MODE_U4_S 26 -/* PCNT_CH1_NEG_MODE_U4 : R/W ;bitpos:[25:24] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's input - negedge signal for unit4. 2'd1: increase at the negedge of input signal 2'd2:decrease at the negedge of input signal others:forbidden*/ -#define PCNT_CH1_NEG_MODE_U4 0x00000003 -#define PCNT_CH1_NEG_MODE_U4_M ((PCNT_CH1_NEG_MODE_U4_V)<<(PCNT_CH1_NEG_MODE_U4_S)) -#define PCNT_CH1_NEG_MODE_U4_V 0x3 -#define PCNT_CH1_NEG_MODE_U4_S 24 -/* PCNT_CH0_LCTRL_MODE_U4 : R/W ;bitpos:[23:22] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's low control - signal for unit4. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH0_LCTRL_MODE_U4 0x00000003 -#define PCNT_CH0_LCTRL_MODE_U4_M ((PCNT_CH0_LCTRL_MODE_U4_V)<<(PCNT_CH0_LCTRL_MODE_U4_S)) -#define PCNT_CH0_LCTRL_MODE_U4_V 0x3 -#define PCNT_CH0_LCTRL_MODE_U4_S 22 -/* PCNT_CH0_HCTRL_MODE_U4 : R/W ;bitpos:[21:20] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's high - control signal for unit4. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH0_HCTRL_MODE_U4 0x00000003 -#define PCNT_CH0_HCTRL_MODE_U4_M ((PCNT_CH0_HCTRL_MODE_U4_V)<<(PCNT_CH0_HCTRL_MODE_U4_S)) -#define PCNT_CH0_HCTRL_MODE_U4_V 0x3 -#define PCNT_CH0_HCTRL_MODE_U4_S 20 -/* PCNT_CH0_POS_MODE_U4 : R/W ;bitpos:[19:18] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's input - posedge signal for unit4. 2'd1: increase at the posedge of input signal 2'd2:decrease at the posedge of input signal others:forbidden*/ -#define PCNT_CH0_POS_MODE_U4 0x00000003 -#define PCNT_CH0_POS_MODE_U4_M ((PCNT_CH0_POS_MODE_U4_V)<<(PCNT_CH0_POS_MODE_U4_S)) -#define PCNT_CH0_POS_MODE_U4_V 0x3 -#define PCNT_CH0_POS_MODE_U4_S 18 -/* PCNT_CH0_NEG_MODE_U4 : R/W ;bitpos:[17:16] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's input - negedge signal for unit4. 2'd1: increase at the negedge of input signal 2'd2:decrease at the negedge of input signal others:forbidden*/ -#define PCNT_CH0_NEG_MODE_U4 0x00000003 -#define PCNT_CH0_NEG_MODE_U4_M ((PCNT_CH0_NEG_MODE_U4_V)<<(PCNT_CH0_NEG_MODE_U4_S)) -#define PCNT_CH0_NEG_MODE_U4_V 0x3 -#define PCNT_CH0_NEG_MODE_U4_S 16 -/* PCNT_THR_THRES1_EN_U4 : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: This is the enable bit for comparing unit4's count with thres1 value .*/ -#define PCNT_THR_THRES1_EN_U4 (BIT(15)) -#define PCNT_THR_THRES1_EN_U4_M (BIT(15)) -#define PCNT_THR_THRES1_EN_U4_V 0x1 -#define PCNT_THR_THRES1_EN_U4_S 15 -/* PCNT_THR_THRES0_EN_U4 : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: This is the enable bit for comparing unit4's count with thres0 value.*/ -#define PCNT_THR_THRES0_EN_U4 (BIT(14)) -#define PCNT_THR_THRES0_EN_U4_M (BIT(14)) -#define PCNT_THR_THRES0_EN_U4_V 0x1 -#define PCNT_THR_THRES0_EN_U4_S 14 -/* PCNT_THR_L_LIM_EN_U4 : R/W ;bitpos:[13] ;default: 1'b1 ; */ -/*description: This is the enable bit for comparing unit4's count with thr_l_lim value.*/ -#define PCNT_THR_L_LIM_EN_U4 (BIT(13)) -#define PCNT_THR_L_LIM_EN_U4_M (BIT(13)) -#define PCNT_THR_L_LIM_EN_U4_V 0x1 -#define PCNT_THR_L_LIM_EN_U4_S 13 -/* PCNT_THR_H_LIM_EN_U4 : R/W ;bitpos:[12] ;default: 1'b1 ; */ -/*description: This is the enable bit for comparing unit4's count with thr_h_lim value.*/ -#define PCNT_THR_H_LIM_EN_U4 (BIT(12)) -#define PCNT_THR_H_LIM_EN_U4_M (BIT(12)) -#define PCNT_THR_H_LIM_EN_U4_V 0x1 -#define PCNT_THR_H_LIM_EN_U4_S 12 -/* PCNT_THR_ZERO_EN_U4 : R/W ;bitpos:[11] ;default: 1'b1 ; */ -/*description: This is the enable bit for comparing unit4's count with 0 value.*/ -#define PCNT_THR_ZERO_EN_U4 (BIT(11)) -#define PCNT_THR_ZERO_EN_U4_M (BIT(11)) -#define PCNT_THR_ZERO_EN_U4_V 0x1 -#define PCNT_THR_ZERO_EN_U4_S 11 -/* PCNT_FILTER_EN_U4 : R/W ;bitpos:[10] ;default: 1'b1 ; */ -/*description: This is the enable bit for filtering input signals for unit4.*/ -#define PCNT_FILTER_EN_U4 (BIT(10)) -#define PCNT_FILTER_EN_U4_M (BIT(10)) -#define PCNT_FILTER_EN_U4_V 0x1 -#define PCNT_FILTER_EN_U4_S 10 -/* PCNT_FILTER_THRES_U4 : R/W ;bitpos:[9:0] ;default: 10'h10 ; */ -/*description: This register is used to filter pluse whose width is smaller - than this value for unit4.*/ -#define PCNT_FILTER_THRES_U4 0x000003FF -#define PCNT_FILTER_THRES_U4_M ((PCNT_FILTER_THRES_U4_V)<<(PCNT_FILTER_THRES_U4_S)) -#define PCNT_FILTER_THRES_U4_V 0x3FF -#define PCNT_FILTER_THRES_U4_S 0 - -#define PCNT_U4_CONF1_REG (DR_REG_PCNT_BASE + 0x0034) -/* PCNT_CNT_THRES1_U4 : R/W ;bitpos:[31:16] ;default: 10'h0 ; */ -/*description: This register is used to configure thres1 value for unit4.*/ -#define PCNT_CNT_THRES1_U4 0x0000FFFF -#define PCNT_CNT_THRES1_U4_M ((PCNT_CNT_THRES1_U4_V)<<(PCNT_CNT_THRES1_U4_S)) -#define PCNT_CNT_THRES1_U4_V 0xFFFF -#define PCNT_CNT_THRES1_U4_S 16 -/* PCNT_CNT_THRES0_U4 : R/W ;bitpos:[15:0] ;default: 10'h0 ; */ -/*description: This register is used to configure thres0 value for unit4.*/ -#define PCNT_CNT_THRES0_U4 0x0000FFFF -#define PCNT_CNT_THRES0_U4_M ((PCNT_CNT_THRES0_U4_V)<<(PCNT_CNT_THRES0_U4_S)) -#define PCNT_CNT_THRES0_U4_V 0xFFFF -#define PCNT_CNT_THRES0_U4_S 0 - -#define PCNT_U4_CONF2_REG (DR_REG_PCNT_BASE + 0x0038) -/* PCNT_CNT_L_LIM_U4 : R/W ;bitpos:[31:16] ;default: 10'h0 ; */ -/*description: This register is used to confiugre thr_l_lim value for unit4.*/ -#define PCNT_CNT_L_LIM_U4 0x0000FFFF -#define PCNT_CNT_L_LIM_U4_M ((PCNT_CNT_L_LIM_U4_V)<<(PCNT_CNT_L_LIM_U4_S)) -#define PCNT_CNT_L_LIM_U4_V 0xFFFF -#define PCNT_CNT_L_LIM_U4_S 16 -/* PCNT_CNT_H_LIM_U4 : R/W ;bitpos:[15:0] ;default: 10'h0 ; */ -/*description: This register is used to configure thr_h_lim value for unit4.*/ -#define PCNT_CNT_H_LIM_U4 0x0000FFFF -#define PCNT_CNT_H_LIM_U4_M ((PCNT_CNT_H_LIM_U4_V)<<(PCNT_CNT_H_LIM_U4_S)) -#define PCNT_CNT_H_LIM_U4_V 0xFFFF -#define PCNT_CNT_H_LIM_U4_S 0 - -#define PCNT_U5_CONF0_REG (DR_REG_PCNT_BASE + 0x003c) -/* PCNT_CH1_LCTRL_MODE_U5 : R/W ;bitpos:[31:30] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's low control - signal for unit5. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH1_LCTRL_MODE_U5 0x00000003 -#define PCNT_CH1_LCTRL_MODE_U5_M ((PCNT_CH1_LCTRL_MODE_U5_V)<<(PCNT_CH1_LCTRL_MODE_U5_S)) -#define PCNT_CH1_LCTRL_MODE_U5_V 0x3 -#define PCNT_CH1_LCTRL_MODE_U5_S 30 -/* PCNT_CH1_HCTRL_MODE_U5 : R/W ;bitpos:[29:28] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's high - control signal for unit5. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH1_HCTRL_MODE_U5 0x00000003 -#define PCNT_CH1_HCTRL_MODE_U5_M ((PCNT_CH1_HCTRL_MODE_U5_V)<<(PCNT_CH1_HCTRL_MODE_U5_S)) -#define PCNT_CH1_HCTRL_MODE_U5_V 0x3 -#define PCNT_CH1_HCTRL_MODE_U5_S 28 -/* PCNT_CH1_POS_MODE_U5 : R/W ;bitpos:[27:26] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's input - posedge signal for unit5. 2'd1: increase at the posedge of input signal 2'd2:decrease at the posedge of input signal others:forbidden*/ -#define PCNT_CH1_POS_MODE_U5 0x00000003 -#define PCNT_CH1_POS_MODE_U5_M ((PCNT_CH1_POS_MODE_U5_V)<<(PCNT_CH1_POS_MODE_U5_S)) -#define PCNT_CH1_POS_MODE_U5_V 0x3 -#define PCNT_CH1_POS_MODE_U5_S 26 -/* PCNT_CH1_NEG_MODE_U5 : R/W ;bitpos:[25:24] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's input - negedge signal for unit5. 2'd1: increase at the negedge of input signal 2'd2:decrease at the negedge of input signal others:forbidden*/ -#define PCNT_CH1_NEG_MODE_U5 0x00000003 -#define PCNT_CH1_NEG_MODE_U5_M ((PCNT_CH1_NEG_MODE_U5_V)<<(PCNT_CH1_NEG_MODE_U5_S)) -#define PCNT_CH1_NEG_MODE_U5_V 0x3 -#define PCNT_CH1_NEG_MODE_U5_S 24 -/* PCNT_CH0_LCTRL_MODE_U5 : R/W ;bitpos:[23:22] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's low control - signal for unit5. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH0_LCTRL_MODE_U5 0x00000003 -#define PCNT_CH0_LCTRL_MODE_U5_M ((PCNT_CH0_LCTRL_MODE_U5_V)<<(PCNT_CH0_LCTRL_MODE_U5_S)) -#define PCNT_CH0_LCTRL_MODE_U5_V 0x3 -#define PCNT_CH0_LCTRL_MODE_U5_S 22 -/* PCNT_CH0_HCTRL_MODE_U5 : R/W ;bitpos:[21:20] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's high - control signal for unit5. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH0_HCTRL_MODE_U5 0x00000003 -#define PCNT_CH0_HCTRL_MODE_U5_M ((PCNT_CH0_HCTRL_MODE_U5_V)<<(PCNT_CH0_HCTRL_MODE_U5_S)) -#define PCNT_CH0_HCTRL_MODE_U5_V 0x3 -#define PCNT_CH0_HCTRL_MODE_U5_S 20 -/* PCNT_CH0_POS_MODE_U5 : R/W ;bitpos:[19:18] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's input - posedge signal for unit5. 2'd1: increase at the posedge of input signal 2'd2:decrease at the posedge of input signal others:forbidden*/ -#define PCNT_CH0_POS_MODE_U5 0x00000003 -#define PCNT_CH0_POS_MODE_U5_M ((PCNT_CH0_POS_MODE_U5_V)<<(PCNT_CH0_POS_MODE_U5_S)) -#define PCNT_CH0_POS_MODE_U5_V 0x3 -#define PCNT_CH0_POS_MODE_U5_S 18 -/* PCNT_CH0_NEG_MODE_U5 : R/W ;bitpos:[17:16] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's input - negedge signal for unit5. 2'd1: increase at the negedge of input signal 2'd2:decrease at the negedge of input signal others:forbidden*/ -#define PCNT_CH0_NEG_MODE_U5 0x00000003 -#define PCNT_CH0_NEG_MODE_U5_M ((PCNT_CH0_NEG_MODE_U5_V)<<(PCNT_CH0_NEG_MODE_U5_S)) -#define PCNT_CH0_NEG_MODE_U5_V 0x3 -#define PCNT_CH0_NEG_MODE_U5_S 16 -/* PCNT_THR_THRES1_EN_U5 : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: This is the enable bit for comparing unit5's count with thres1 value .*/ -#define PCNT_THR_THRES1_EN_U5 (BIT(15)) -#define PCNT_THR_THRES1_EN_U5_M (BIT(15)) -#define PCNT_THR_THRES1_EN_U5_V 0x1 -#define PCNT_THR_THRES1_EN_U5_S 15 -/* PCNT_THR_THRES0_EN_U5 : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: This is the enable bit for comparing unit5's count with thres0 value.*/ -#define PCNT_THR_THRES0_EN_U5 (BIT(14)) -#define PCNT_THR_THRES0_EN_U5_M (BIT(14)) -#define PCNT_THR_THRES0_EN_U5_V 0x1 -#define PCNT_THR_THRES0_EN_U5_S 14 -/* PCNT_THR_L_LIM_EN_U5 : R/W ;bitpos:[13] ;default: 1'b1 ; */ -/*description: This is the enable bit for comparing unit5's count with thr_l_lim value.*/ -#define PCNT_THR_L_LIM_EN_U5 (BIT(13)) -#define PCNT_THR_L_LIM_EN_U5_M (BIT(13)) -#define PCNT_THR_L_LIM_EN_U5_V 0x1 -#define PCNT_THR_L_LIM_EN_U5_S 13 -/* PCNT_THR_H_LIM_EN_U5 : R/W ;bitpos:[12] ;default: 1'b1 ; */ -/*description: This is the enable bit for comparing unit5's count with thr_h_lim value.*/ -#define PCNT_THR_H_LIM_EN_U5 (BIT(12)) -#define PCNT_THR_H_LIM_EN_U5_M (BIT(12)) -#define PCNT_THR_H_LIM_EN_U5_V 0x1 -#define PCNT_THR_H_LIM_EN_U5_S 12 -/* PCNT_THR_ZERO_EN_U5 : R/W ;bitpos:[11] ;default: 1'b1 ; */ -/*description: This is the enable bit for comparing unit5's count with 0 value.*/ -#define PCNT_THR_ZERO_EN_U5 (BIT(11)) -#define PCNT_THR_ZERO_EN_U5_M (BIT(11)) -#define PCNT_THR_ZERO_EN_U5_V 0x1 -#define PCNT_THR_ZERO_EN_U5_S 11 -/* PCNT_FILTER_EN_U5 : R/W ;bitpos:[10] ;default: 1'b1 ; */ -/*description: This is the enable bit for filtering input signals for unit5.*/ -#define PCNT_FILTER_EN_U5 (BIT(10)) -#define PCNT_FILTER_EN_U5_M (BIT(10)) -#define PCNT_FILTER_EN_U5_V 0x1 -#define PCNT_FILTER_EN_U5_S 10 -/* PCNT_FILTER_THRES_U5 : R/W ;bitpos:[9:0] ;default: 10'h10 ; */ -/*description: This register is used to filter pluse whose width is smaller - than this value for unit5.*/ -#define PCNT_FILTER_THRES_U5 0x000003FF -#define PCNT_FILTER_THRES_U5_M ((PCNT_FILTER_THRES_U5_V)<<(PCNT_FILTER_THRES_U5_S)) -#define PCNT_FILTER_THRES_U5_V 0x3FF -#define PCNT_FILTER_THRES_U5_S 0 - -#define PCNT_U5_CONF1_REG (DR_REG_PCNT_BASE + 0x0040) -/* PCNT_CNT_THRES1_U5 : R/W ;bitpos:[31:16] ;default: 10'h0 ; */ -/*description: This register is used to configure thres1 value for unit5.*/ -#define PCNT_CNT_THRES1_U5 0x0000FFFF -#define PCNT_CNT_THRES1_U5_M ((PCNT_CNT_THRES1_U5_V)<<(PCNT_CNT_THRES1_U5_S)) -#define PCNT_CNT_THRES1_U5_V 0xFFFF -#define PCNT_CNT_THRES1_U5_S 16 -/* PCNT_CNT_THRES0_U5 : R/W ;bitpos:[15:0] ;default: 10'h0 ; */ -/*description: This register is used to configure thres0 value for unit5.*/ -#define PCNT_CNT_THRES0_U5 0x0000FFFF -#define PCNT_CNT_THRES0_U5_M ((PCNT_CNT_THRES0_U5_V)<<(PCNT_CNT_THRES0_U5_S)) -#define PCNT_CNT_THRES0_U5_V 0xFFFF -#define PCNT_CNT_THRES0_U5_S 0 - -#define PCNT_U5_CONF2_REG (DR_REG_PCNT_BASE + 0x0044) -/* PCNT_CNT_L_LIM_U5 : R/W ;bitpos:[31:16] ;default: 10'h0 ; */ -/*description: This register is used to confiugre thr_l_lim value for unit5.*/ -#define PCNT_CNT_L_LIM_U5 0x0000FFFF -#define PCNT_CNT_L_LIM_U5_M ((PCNT_CNT_L_LIM_U5_V)<<(PCNT_CNT_L_LIM_U5_S)) -#define PCNT_CNT_L_LIM_U5_V 0xFFFF -#define PCNT_CNT_L_LIM_U5_S 16 -/* PCNT_CNT_H_LIM_U5 : R/W ;bitpos:[15:0] ;default: 10'h0 ; */ -/*description: This register is used to configure thr_h_lim value for unit5.*/ -#define PCNT_CNT_H_LIM_U5 0x0000FFFF -#define PCNT_CNT_H_LIM_U5_M ((PCNT_CNT_H_LIM_U5_V)<<(PCNT_CNT_H_LIM_U5_S)) -#define PCNT_CNT_H_LIM_U5_V 0xFFFF -#define PCNT_CNT_H_LIM_U5_S 0 - -#define PCNT_U6_CONF0_REG (DR_REG_PCNT_BASE + 0x0048) -/* PCNT_CH1_LCTRL_MODE_U6 : R/W ;bitpos:[31:30] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's low control - signal for unit6. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH1_LCTRL_MODE_U6 0x00000003 -#define PCNT_CH1_LCTRL_MODE_U6_M ((PCNT_CH1_LCTRL_MODE_U6_V)<<(PCNT_CH1_LCTRL_MODE_U6_S)) -#define PCNT_CH1_LCTRL_MODE_U6_V 0x3 -#define PCNT_CH1_LCTRL_MODE_U6_S 30 -/* PCNT_CH1_HCTRL_MODE_U6 : R/W ;bitpos:[29:28] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's high - control signal for unit6. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH1_HCTRL_MODE_U6 0x00000003 -#define PCNT_CH1_HCTRL_MODE_U6_M ((PCNT_CH1_HCTRL_MODE_U6_V)<<(PCNT_CH1_HCTRL_MODE_U6_S)) -#define PCNT_CH1_HCTRL_MODE_U6_V 0x3 -#define PCNT_CH1_HCTRL_MODE_U6_S 28 -/* PCNT_CH1_POS_MODE_U6 : R/W ;bitpos:[27:26] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's input - posedge signal for unit6. 2'd1: increase at the posedge of input signal 2'd2:decrease at the posedge of input signal others:forbidden*/ -#define PCNT_CH1_POS_MODE_U6 0x00000003 -#define PCNT_CH1_POS_MODE_U6_M ((PCNT_CH1_POS_MODE_U6_V)<<(PCNT_CH1_POS_MODE_U6_S)) -#define PCNT_CH1_POS_MODE_U6_V 0x3 -#define PCNT_CH1_POS_MODE_U6_S 26 -/* PCNT_CH1_NEG_MODE_U6 : R/W ;bitpos:[25:24] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's input - negedge signal for unit6. 2'd1: increase at the negedge of input signal 2'd2:decrease at the negedge of input signal others:forbidden*/ -#define PCNT_CH1_NEG_MODE_U6 0x00000003 -#define PCNT_CH1_NEG_MODE_U6_M ((PCNT_CH1_NEG_MODE_U6_V)<<(PCNT_CH1_NEG_MODE_U6_S)) -#define PCNT_CH1_NEG_MODE_U6_V 0x3 -#define PCNT_CH1_NEG_MODE_U6_S 24 -/* PCNT_CH0_LCTRL_MODE_U6 : R/W ;bitpos:[23:22] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's low control - signal for unit6. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH0_LCTRL_MODE_U6 0x00000003 -#define PCNT_CH0_LCTRL_MODE_U6_M ((PCNT_CH0_LCTRL_MODE_U6_V)<<(PCNT_CH0_LCTRL_MODE_U6_S)) -#define PCNT_CH0_LCTRL_MODE_U6_V 0x3 -#define PCNT_CH0_LCTRL_MODE_U6_S 22 -/* PCNT_CH0_HCTRL_MODE_U6 : R/W ;bitpos:[21:20] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's high - control signal for unit6. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH0_HCTRL_MODE_U6 0x00000003 -#define PCNT_CH0_HCTRL_MODE_U6_M ((PCNT_CH0_HCTRL_MODE_U6_V)<<(PCNT_CH0_HCTRL_MODE_U6_S)) -#define PCNT_CH0_HCTRL_MODE_U6_V 0x3 -#define PCNT_CH0_HCTRL_MODE_U6_S 20 -/* PCNT_CH0_POS_MODE_U6 : R/W ;bitpos:[19:18] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's input - posedge signal for unit6. 2'd1: increase at the posedge of input signal 2'd2:decrease at the posedge of input signal others:forbidden*/ -#define PCNT_CH0_POS_MODE_U6 0x00000003 -#define PCNT_CH0_POS_MODE_U6_M ((PCNT_CH0_POS_MODE_U6_V)<<(PCNT_CH0_POS_MODE_U6_S)) -#define PCNT_CH0_POS_MODE_U6_V 0x3 -#define PCNT_CH0_POS_MODE_U6_S 18 -/* PCNT_CH0_NEG_MODE_U6 : R/W ;bitpos:[17:16] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's input - negedge signal for unit6. 2'd1: increase at the negedge of input signal 2'd2:decrease at the negedge of input signal others:forbidden*/ -#define PCNT_CH0_NEG_MODE_U6 0x00000003 -#define PCNT_CH0_NEG_MODE_U6_M ((PCNT_CH0_NEG_MODE_U6_V)<<(PCNT_CH0_NEG_MODE_U6_S)) -#define PCNT_CH0_NEG_MODE_U6_V 0x3 -#define PCNT_CH0_NEG_MODE_U6_S 16 -/* PCNT_THR_THRES1_EN_U6 : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: This is the enable bit for comparing unit6's count with thres1 value .*/ -#define PCNT_THR_THRES1_EN_U6 (BIT(15)) -#define PCNT_THR_THRES1_EN_U6_M (BIT(15)) -#define PCNT_THR_THRES1_EN_U6_V 0x1 -#define PCNT_THR_THRES1_EN_U6_S 15 -/* PCNT_THR_THRES0_EN_U6 : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: This is the enable bit for comparing unit6's count with thres0 value.*/ -#define PCNT_THR_THRES0_EN_U6 (BIT(14)) -#define PCNT_THR_THRES0_EN_U6_M (BIT(14)) -#define PCNT_THR_THRES0_EN_U6_V 0x1 -#define PCNT_THR_THRES0_EN_U6_S 14 -/* PCNT_THR_L_LIM_EN_U6 : R/W ;bitpos:[13] ;default: 1'b1 ; */ -/*description: This is the enable bit for comparing unit6's count with thr_l_lim value.*/ -#define PCNT_THR_L_LIM_EN_U6 (BIT(13)) -#define PCNT_THR_L_LIM_EN_U6_M (BIT(13)) -#define PCNT_THR_L_LIM_EN_U6_V 0x1 -#define PCNT_THR_L_LIM_EN_U6_S 13 -/* PCNT_THR_H_LIM_EN_U6 : R/W ;bitpos:[12] ;default: 1'b1 ; */ -/*description: This is the enable bit for comparing unit6's count with thr_h_lim value.*/ -#define PCNT_THR_H_LIM_EN_U6 (BIT(12)) -#define PCNT_THR_H_LIM_EN_U6_M (BIT(12)) -#define PCNT_THR_H_LIM_EN_U6_V 0x1 -#define PCNT_THR_H_LIM_EN_U6_S 12 -/* PCNT_THR_ZERO_EN_U6 : R/W ;bitpos:[11] ;default: 1'b1 ; */ -/*description: This is the enable bit for comparing unit6's count with 0 value.*/ -#define PCNT_THR_ZERO_EN_U6 (BIT(11)) -#define PCNT_THR_ZERO_EN_U6_M (BIT(11)) -#define PCNT_THR_ZERO_EN_U6_V 0x1 -#define PCNT_THR_ZERO_EN_U6_S 11 -/* PCNT_FILTER_EN_U6 : R/W ;bitpos:[10] ;default: 1'b1 ; */ -/*description: This is the enable bit for filtering input signals for unit6.*/ -#define PCNT_FILTER_EN_U6 (BIT(10)) -#define PCNT_FILTER_EN_U6_M (BIT(10)) -#define PCNT_FILTER_EN_U6_V 0x1 -#define PCNT_FILTER_EN_U6_S 10 -/* PCNT_FILTER_THRES_U6 : R/W ;bitpos:[9:0] ;default: 10'h10 ; */ -/*description: This register is used to filter pluse whose width is smaller - than this value for unit6.*/ -#define PCNT_FILTER_THRES_U6 0x000003FF -#define PCNT_FILTER_THRES_U6_M ((PCNT_FILTER_THRES_U6_V)<<(PCNT_FILTER_THRES_U6_S)) -#define PCNT_FILTER_THRES_U6_V 0x3FF -#define PCNT_FILTER_THRES_U6_S 0 - -#define PCNT_U6_CONF1_REG (DR_REG_PCNT_BASE + 0x004c) -/* PCNT_CNT_THRES1_U6 : R/W ;bitpos:[31:16] ;default: 10'h0 ; */ -/*description: This register is used to configure thres1 value for unit6.*/ -#define PCNT_CNT_THRES1_U6 0x0000FFFF -#define PCNT_CNT_THRES1_U6_M ((PCNT_CNT_THRES1_U6_V)<<(PCNT_CNT_THRES1_U6_S)) -#define PCNT_CNT_THRES1_U6_V 0xFFFF -#define PCNT_CNT_THRES1_U6_S 16 -/* PCNT_CNT_THRES0_U6 : R/W ;bitpos:[15:0] ;default: 10'h0 ; */ -/*description: This register is used to configure thres0 value for unit6.*/ -#define PCNT_CNT_THRES0_U6 0x0000FFFF -#define PCNT_CNT_THRES0_U6_M ((PCNT_CNT_THRES0_U6_V)<<(PCNT_CNT_THRES0_U6_S)) -#define PCNT_CNT_THRES0_U6_V 0xFFFF -#define PCNT_CNT_THRES0_U6_S 0 - -#define PCNT_U6_CONF2_REG (DR_REG_PCNT_BASE + 0x0050) -/* PCNT_CNT_L_LIM_U6 : R/W ;bitpos:[31:16] ;default: 10'h0 ; */ -/*description: This register is used to confiugre thr_l_lim value for unit6.*/ -#define PCNT_CNT_L_LIM_U6 0x0000FFFF -#define PCNT_CNT_L_LIM_U6_M ((PCNT_CNT_L_LIM_U6_V)<<(PCNT_CNT_L_LIM_U6_S)) -#define PCNT_CNT_L_LIM_U6_V 0xFFFF -#define PCNT_CNT_L_LIM_U6_S 16 -/* PCNT_CNT_H_LIM_U6 : R/W ;bitpos:[15:0] ;default: 10'h0 ; */ -/*description: This register is used to configure thr_h_lim value for unit6.*/ -#define PCNT_CNT_H_LIM_U6 0x0000FFFF -#define PCNT_CNT_H_LIM_U6_M ((PCNT_CNT_H_LIM_U6_V)<<(PCNT_CNT_H_LIM_U6_S)) -#define PCNT_CNT_H_LIM_U6_V 0xFFFF -#define PCNT_CNT_H_LIM_U6_S 0 - -#define PCNT_U7_CONF0_REG (DR_REG_PCNT_BASE + 0x0054) -/* PCNT_CH1_LCTRL_MODE_U7 : R/W ;bitpos:[31:30] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's low control - signal for unit7. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH1_LCTRL_MODE_U7 0x00000003 -#define PCNT_CH1_LCTRL_MODE_U7_M ((PCNT_CH1_LCTRL_MODE_U7_V)<<(PCNT_CH1_LCTRL_MODE_U7_S)) -#define PCNT_CH1_LCTRL_MODE_U7_V 0x3 -#define PCNT_CH1_LCTRL_MODE_U7_S 30 -/* PCNT_CH1_HCTRL_MODE_U7 : R/W ;bitpos:[29:28] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's high - control signal for unit7. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH1_HCTRL_MODE_U7 0x00000003 -#define PCNT_CH1_HCTRL_MODE_U7_M ((PCNT_CH1_HCTRL_MODE_U7_V)<<(PCNT_CH1_HCTRL_MODE_U7_S)) -#define PCNT_CH1_HCTRL_MODE_U7_V 0x3 -#define PCNT_CH1_HCTRL_MODE_U7_S 28 -/* PCNT_CH1_POS_MODE_U7 : R/W ;bitpos:[27:26] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's input - posedge signal for unit7. 2'd1: increase at the posedge of input signal 2'd2:decrease at the posedge of input signal others:forbidden*/ -#define PCNT_CH1_POS_MODE_U7 0x00000003 -#define PCNT_CH1_POS_MODE_U7_M ((PCNT_CH1_POS_MODE_U7_V)<<(PCNT_CH1_POS_MODE_U7_S)) -#define PCNT_CH1_POS_MODE_U7_V 0x3 -#define PCNT_CH1_POS_MODE_U7_S 26 -/* PCNT_CH1_NEG_MODE_U7 : R/W ;bitpos:[25:24] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel1's input - negedge signal for unit7. 2'd1: increase at the negedge of input signal 2'd2:decrease at the negedge of input signal others:forbidden*/ -#define PCNT_CH1_NEG_MODE_U7 0x00000003 -#define PCNT_CH1_NEG_MODE_U7_M ((PCNT_CH1_NEG_MODE_U7_V)<<(PCNT_CH1_NEG_MODE_U7_S)) -#define PCNT_CH1_NEG_MODE_U7_V 0x3 -#define PCNT_CH1_NEG_MODE_U7_S 24 -/* PCNT_CH0_LCTRL_MODE_U7 : R/W ;bitpos:[23:22] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's low control - signal for unit7. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH0_LCTRL_MODE_U7 0x00000003 -#define PCNT_CH0_LCTRL_MODE_U7_M ((PCNT_CH0_LCTRL_MODE_U7_V)<<(PCNT_CH0_LCTRL_MODE_U7_S)) -#define PCNT_CH0_LCTRL_MODE_U7_V 0x3 -#define PCNT_CH0_LCTRL_MODE_U7_S 22 -/* PCNT_CH0_HCTRL_MODE_U7 : R/W ;bitpos:[21:20] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's high - control signal for unit7. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden*/ -#define PCNT_CH0_HCTRL_MODE_U7 0x00000003 -#define PCNT_CH0_HCTRL_MODE_U7_M ((PCNT_CH0_HCTRL_MODE_U7_V)<<(PCNT_CH0_HCTRL_MODE_U7_S)) -#define PCNT_CH0_HCTRL_MODE_U7_V 0x3 -#define PCNT_CH0_HCTRL_MODE_U7_S 20 -/* PCNT_CH0_POS_MODE_U7 : R/W ;bitpos:[19:18] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's input - posedge signal for unit7. 2'd1: increase at the posedge of input signal 2'd2:decrease at the posedge of input signal others:forbidden*/ -#define PCNT_CH0_POS_MODE_U7 0x00000003 -#define PCNT_CH0_POS_MODE_U7_M ((PCNT_CH0_POS_MODE_U7_V)<<(PCNT_CH0_POS_MODE_U7_S)) -#define PCNT_CH0_POS_MODE_U7_V 0x3 -#define PCNT_CH0_POS_MODE_U7_S 18 -/* PCNT_CH0_NEG_MODE_U7 : R/W ;bitpos:[17:16] ;default: 2'd0 ; */ -/*description: This register is used to control the mode of channel0's input - negedge signal for unit7. 2'd1: increase at the negedge of input signal 2'd2:decrease at the negedge of input signal others:forbidden*/ -#define PCNT_CH0_NEG_MODE_U7 0x00000003 -#define PCNT_CH0_NEG_MODE_U7_M ((PCNT_CH0_NEG_MODE_U7_V)<<(PCNT_CH0_NEG_MODE_U7_S)) -#define PCNT_CH0_NEG_MODE_U7_V 0x3 -#define PCNT_CH0_NEG_MODE_U7_S 16 -/* PCNT_THR_THRES1_EN_U7 : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: This is the enable bit for comparing unit7's count with thres1 value .*/ -#define PCNT_THR_THRES1_EN_U7 (BIT(15)) -#define PCNT_THR_THRES1_EN_U7_M (BIT(15)) -#define PCNT_THR_THRES1_EN_U7_V 0x1 -#define PCNT_THR_THRES1_EN_U7_S 15 -/* PCNT_THR_THRES0_EN_U7 : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: This is the enable bit for comparing unit7's count with thres0 value.*/ -#define PCNT_THR_THRES0_EN_U7 (BIT(14)) -#define PCNT_THR_THRES0_EN_U7_M (BIT(14)) -#define PCNT_THR_THRES0_EN_U7_V 0x1 -#define PCNT_THR_THRES0_EN_U7_S 14 -/* PCNT_THR_L_LIM_EN_U7 : R/W ;bitpos:[13] ;default: 1'b1 ; */ -/*description: This is the enable bit for comparing unit7's count with thr_l_lim value.*/ -#define PCNT_THR_L_LIM_EN_U7 (BIT(13)) -#define PCNT_THR_L_LIM_EN_U7_M (BIT(13)) -#define PCNT_THR_L_LIM_EN_U7_V 0x1 -#define PCNT_THR_L_LIM_EN_U7_S 13 -/* PCNT_THR_H_LIM_EN_U7 : R/W ;bitpos:[12] ;default: 1'b1 ; */ -/*description: This is the enable bit for comparing unit7's count with thr_h_lim value.*/ -#define PCNT_THR_H_LIM_EN_U7 (BIT(12)) -#define PCNT_THR_H_LIM_EN_U7_M (BIT(12)) -#define PCNT_THR_H_LIM_EN_U7_V 0x1 -#define PCNT_THR_H_LIM_EN_U7_S 12 -/* PCNT_THR_ZERO_EN_U7 : R/W ;bitpos:[11] ;default: 1'b1 ; */ -/*description: This is the enable bit for comparing unit7's count with 0 value.*/ -#define PCNT_THR_ZERO_EN_U7 (BIT(11)) -#define PCNT_THR_ZERO_EN_U7_M (BIT(11)) -#define PCNT_THR_ZERO_EN_U7_V 0x1 -#define PCNT_THR_ZERO_EN_U7_S 11 -/* PCNT_FILTER_EN_U7 : R/W ;bitpos:[10] ;default: 1'b1 ; */ -/*description: This is the enable bit for filtering input signals for unit7.*/ -#define PCNT_FILTER_EN_U7 (BIT(10)) -#define PCNT_FILTER_EN_U7_M (BIT(10)) -#define PCNT_FILTER_EN_U7_V 0x1 -#define PCNT_FILTER_EN_U7_S 10 -/* PCNT_FILTER_THRES_U7 : R/W ;bitpos:[9:0] ;default: 10'h10 ; */ -/*description: This register is used to filter pluse whose width is smaller - than this value for unit7.*/ -#define PCNT_FILTER_THRES_U7 0x000003FF -#define PCNT_FILTER_THRES_U7_M ((PCNT_FILTER_THRES_U7_V)<<(PCNT_FILTER_THRES_U7_S)) -#define PCNT_FILTER_THRES_U7_V 0x3FF -#define PCNT_FILTER_THRES_U7_S 0 - -#define PCNT_U7_CONF1_REG (DR_REG_PCNT_BASE + 0x0058) -/* PCNT_CNT_THRES1_U7 : R/W ;bitpos:[31:16] ;default: 10'h0 ; */ -/*description: This register is used to configure thres1 value for unit7.*/ -#define PCNT_CNT_THRES1_U7 0x0000FFFF -#define PCNT_CNT_THRES1_U7_M ((PCNT_CNT_THRES1_U7_V)<<(PCNT_CNT_THRES1_U7_S)) -#define PCNT_CNT_THRES1_U7_V 0xFFFF -#define PCNT_CNT_THRES1_U7_S 16 -/* PCNT_CNT_THRES0_U7 : R/W ;bitpos:[15:0] ;default: 10'h0 ; */ -/*description: This register is used to configure thres0 value for unit7.*/ -#define PCNT_CNT_THRES0_U7 0x0000FFFF -#define PCNT_CNT_THRES0_U7_M ((PCNT_CNT_THRES0_U7_V)<<(PCNT_CNT_THRES0_U7_S)) -#define PCNT_CNT_THRES0_U7_V 0xFFFF -#define PCNT_CNT_THRES0_U7_S 0 - -#define PCNT_U7_CONF2_REG (DR_REG_PCNT_BASE + 0x005c) -/* PCNT_CNT_L_LIM_U7 : R/W ;bitpos:[31:16] ;default: 10'h0 ; */ -/*description: This register is used to confiugre thr_l_lim value for unit7.*/ -#define PCNT_CNT_L_LIM_U7 0x0000FFFF -#define PCNT_CNT_L_LIM_U7_M ((PCNT_CNT_L_LIM_U7_V)<<(PCNT_CNT_L_LIM_U7_S)) -#define PCNT_CNT_L_LIM_U7_V 0xFFFF -#define PCNT_CNT_L_LIM_U7_S 16 -/* PCNT_CNT_H_LIM_U7 : R/W ;bitpos:[15:0] ;default: 10'h0 ; */ -/*description: This register is used to configure thr_h_lim value for unit7.*/ -#define PCNT_CNT_H_LIM_U7 0x0000FFFF -#define PCNT_CNT_H_LIM_U7_M ((PCNT_CNT_H_LIM_U7_V)<<(PCNT_CNT_H_LIM_U7_S)) -#define PCNT_CNT_H_LIM_U7_V 0xFFFF -#define PCNT_CNT_H_LIM_U7_S 0 - -#define PCNT_U0_CNT_REG (DR_REG_PCNT_BASE + 0x0060) -/* PCNT_PLUS_CNT_U0 : RO ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: This register stores the current pulse count value for unit0.*/ -#define PCNT_PLUS_CNT_U0 0x0000FFFF -#define PCNT_PLUS_CNT_U0_M ((PCNT_PLUS_CNT_U0_V)<<(PCNT_PLUS_CNT_U0_S)) -#define PCNT_PLUS_CNT_U0_V 0xFFFF -#define PCNT_PLUS_CNT_U0_S 0 - -#define PCNT_U1_CNT_REG (DR_REG_PCNT_BASE + 0x0064) -/* PCNT_PLUS_CNT_U1 : RO ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: This register stores the current pulse count value for unit1.*/ -#define PCNT_PLUS_CNT_U1 0x0000FFFF -#define PCNT_PLUS_CNT_U1_M ((PCNT_PLUS_CNT_U1_V)<<(PCNT_PLUS_CNT_U1_S)) -#define PCNT_PLUS_CNT_U1_V 0xFFFF -#define PCNT_PLUS_CNT_U1_S 0 - -#define PCNT_U2_CNT_REG (DR_REG_PCNT_BASE + 0x0068) -/* PCNT_PLUS_CNT_U2 : RO ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: This register stores the current pulse count value for unit2.*/ -#define PCNT_PLUS_CNT_U2 0x0000FFFF -#define PCNT_PLUS_CNT_U2_M ((PCNT_PLUS_CNT_U2_V)<<(PCNT_PLUS_CNT_U2_S)) -#define PCNT_PLUS_CNT_U2_V 0xFFFF -#define PCNT_PLUS_CNT_U2_S 0 - -#define PCNT_U3_CNT_REG (DR_REG_PCNT_BASE + 0x006c) -/* PCNT_PLUS_CNT_U3 : RO ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: This register stores the current pulse count value for unit3.*/ -#define PCNT_PLUS_CNT_U3 0x0000FFFF -#define PCNT_PLUS_CNT_U3_M ((PCNT_PLUS_CNT_U3_V)<<(PCNT_PLUS_CNT_U3_S)) -#define PCNT_PLUS_CNT_U3_V 0xFFFF -#define PCNT_PLUS_CNT_U3_S 0 - -#define PCNT_U4_CNT_REG (DR_REG_PCNT_BASE + 0x0070) -/* PCNT_PLUS_CNT_U4 : RO ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: This register stores the current pulse count value for unit4.*/ -#define PCNT_PLUS_CNT_U4 0x0000FFFF -#define PCNT_PLUS_CNT_U4_M ((PCNT_PLUS_CNT_U4_V)<<(PCNT_PLUS_CNT_U4_S)) -#define PCNT_PLUS_CNT_U4_V 0xFFFF -#define PCNT_PLUS_CNT_U4_S 0 - -#define PCNT_U5_CNT_REG (DR_REG_PCNT_BASE + 0x0074) -/* PCNT_PLUS_CNT_U5 : RO ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: This register stores the current pulse count value for unit5.*/ -#define PCNT_PLUS_CNT_U5 0x0000FFFF -#define PCNT_PLUS_CNT_U5_M ((PCNT_PLUS_CNT_U5_V)<<(PCNT_PLUS_CNT_U5_S)) -#define PCNT_PLUS_CNT_U5_V 0xFFFF -#define PCNT_PLUS_CNT_U5_S 0 - -#define PCNT_U6_CNT_REG (DR_REG_PCNT_BASE + 0x0078) -/* PCNT_PLUS_CNT_U6 : RO ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: This register stores the current pulse count value for unit6.*/ -#define PCNT_PLUS_CNT_U6 0x0000FFFF -#define PCNT_PLUS_CNT_U6_M ((PCNT_PLUS_CNT_U6_V)<<(PCNT_PLUS_CNT_U6_S)) -#define PCNT_PLUS_CNT_U6_V 0xFFFF -#define PCNT_PLUS_CNT_U6_S 0 - -#define PCNT_U7_CNT_REG (DR_REG_PCNT_BASE + 0x007c) -/* PCNT_PLUS_CNT_U7 : RO ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: This register stores the current pulse count value for unit7.*/ -#define PCNT_PLUS_CNT_U7 0x0000FFFF -#define PCNT_PLUS_CNT_U7_M ((PCNT_PLUS_CNT_U7_V)<<(PCNT_PLUS_CNT_U7_S)) -#define PCNT_PLUS_CNT_U7_V 0xFFFF -#define PCNT_PLUS_CNT_U7_S 0 - -#define PCNT_INT_RAW_REG (DR_REG_PCNT_BASE + 0x0080) -/* PCNT_CNT_THR_EVENT_U7_INT_RAW : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: This is the interrupt raw bit for channel7 event.*/ -#define PCNT_CNT_THR_EVENT_U7_INT_RAW (BIT(7)) -#define PCNT_CNT_THR_EVENT_U7_INT_RAW_M (BIT(7)) -#define PCNT_CNT_THR_EVENT_U7_INT_RAW_V 0x1 -#define PCNT_CNT_THR_EVENT_U7_INT_RAW_S 7 -/* PCNT_CNT_THR_EVENT_U6_INT_RAW : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: This is the interrupt raw bit for channel6 event.*/ -#define PCNT_CNT_THR_EVENT_U6_INT_RAW (BIT(6)) -#define PCNT_CNT_THR_EVENT_U6_INT_RAW_M (BIT(6)) -#define PCNT_CNT_THR_EVENT_U6_INT_RAW_V 0x1 -#define PCNT_CNT_THR_EVENT_U6_INT_RAW_S 6 -/* PCNT_CNT_THR_EVENT_U5_INT_RAW : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: This is the interrupt raw bit for channel5 event.*/ -#define PCNT_CNT_THR_EVENT_U5_INT_RAW (BIT(5)) -#define PCNT_CNT_THR_EVENT_U5_INT_RAW_M (BIT(5)) -#define PCNT_CNT_THR_EVENT_U5_INT_RAW_V 0x1 -#define PCNT_CNT_THR_EVENT_U5_INT_RAW_S 5 -/* PCNT_CNT_THR_EVENT_U4_INT_RAW : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: This is the interrupt raw bit for channel4 event.*/ -#define PCNT_CNT_THR_EVENT_U4_INT_RAW (BIT(4)) -#define PCNT_CNT_THR_EVENT_U4_INT_RAW_M (BIT(4)) -#define PCNT_CNT_THR_EVENT_U4_INT_RAW_V 0x1 -#define PCNT_CNT_THR_EVENT_U4_INT_RAW_S 4 -/* PCNT_CNT_THR_EVENT_U3_INT_RAW : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: This is the interrupt raw bit for channel3 event.*/ -#define PCNT_CNT_THR_EVENT_U3_INT_RAW (BIT(3)) -#define PCNT_CNT_THR_EVENT_U3_INT_RAW_M (BIT(3)) -#define PCNT_CNT_THR_EVENT_U3_INT_RAW_V 0x1 -#define PCNT_CNT_THR_EVENT_U3_INT_RAW_S 3 -/* PCNT_CNT_THR_EVENT_U2_INT_RAW : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: This is the interrupt raw bit for channel2 event.*/ -#define PCNT_CNT_THR_EVENT_U2_INT_RAW (BIT(2)) -#define PCNT_CNT_THR_EVENT_U2_INT_RAW_M (BIT(2)) -#define PCNT_CNT_THR_EVENT_U2_INT_RAW_V 0x1 -#define PCNT_CNT_THR_EVENT_U2_INT_RAW_S 2 -/* PCNT_CNT_THR_EVENT_U1_INT_RAW : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: This is the interrupt raw bit for channel1 event.*/ -#define PCNT_CNT_THR_EVENT_U1_INT_RAW (BIT(1)) -#define PCNT_CNT_THR_EVENT_U1_INT_RAW_M (BIT(1)) -#define PCNT_CNT_THR_EVENT_U1_INT_RAW_V 0x1 -#define PCNT_CNT_THR_EVENT_U1_INT_RAW_S 1 -/* PCNT_CNT_THR_EVENT_U0_INT_RAW : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: This is the interrupt raw bit for channel0 event.*/ -#define PCNT_CNT_THR_EVENT_U0_INT_RAW (BIT(0)) -#define PCNT_CNT_THR_EVENT_U0_INT_RAW_M (BIT(0)) -#define PCNT_CNT_THR_EVENT_U0_INT_RAW_V 0x1 -#define PCNT_CNT_THR_EVENT_U0_INT_RAW_S 0 - -#define PCNT_INT_ST_REG (DR_REG_PCNT_BASE + 0x0084) -/* PCNT_CNT_THR_EVENT_U7_INT_ST : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: This is the interrupt status bit for channel7 event.*/ -#define PCNT_CNT_THR_EVENT_U7_INT_ST (BIT(7)) -#define PCNT_CNT_THR_EVENT_U7_INT_ST_M (BIT(7)) -#define PCNT_CNT_THR_EVENT_U7_INT_ST_V 0x1 -#define PCNT_CNT_THR_EVENT_U7_INT_ST_S 7 -/* PCNT_CNT_THR_EVENT_U6_INT_ST : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: This is the interrupt status bit for channel6 event.*/ -#define PCNT_CNT_THR_EVENT_U6_INT_ST (BIT(6)) -#define PCNT_CNT_THR_EVENT_U6_INT_ST_M (BIT(6)) -#define PCNT_CNT_THR_EVENT_U6_INT_ST_V 0x1 -#define PCNT_CNT_THR_EVENT_U6_INT_ST_S 6 -/* PCNT_CNT_THR_EVENT_U5_INT_ST : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: This is the interrupt status bit for channel5 event.*/ -#define PCNT_CNT_THR_EVENT_U5_INT_ST (BIT(5)) -#define PCNT_CNT_THR_EVENT_U5_INT_ST_M (BIT(5)) -#define PCNT_CNT_THR_EVENT_U5_INT_ST_V 0x1 -#define PCNT_CNT_THR_EVENT_U5_INT_ST_S 5 -/* PCNT_CNT_THR_EVENT_U4_INT_ST : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: This is the interrupt status bit for channel4 event.*/ -#define PCNT_CNT_THR_EVENT_U4_INT_ST (BIT(4)) -#define PCNT_CNT_THR_EVENT_U4_INT_ST_M (BIT(4)) -#define PCNT_CNT_THR_EVENT_U4_INT_ST_V 0x1 -#define PCNT_CNT_THR_EVENT_U4_INT_ST_S 4 -/* PCNT_CNT_THR_EVENT_U3_INT_ST : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: This is the interrupt status bit for channel3 event.*/ -#define PCNT_CNT_THR_EVENT_U3_INT_ST (BIT(3)) -#define PCNT_CNT_THR_EVENT_U3_INT_ST_M (BIT(3)) -#define PCNT_CNT_THR_EVENT_U3_INT_ST_V 0x1 -#define PCNT_CNT_THR_EVENT_U3_INT_ST_S 3 -/* PCNT_CNT_THR_EVENT_U2_INT_ST : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: This is the interrupt status bit for channel2 event.*/ -#define PCNT_CNT_THR_EVENT_U2_INT_ST (BIT(2)) -#define PCNT_CNT_THR_EVENT_U2_INT_ST_M (BIT(2)) -#define PCNT_CNT_THR_EVENT_U2_INT_ST_V 0x1 -#define PCNT_CNT_THR_EVENT_U2_INT_ST_S 2 -/* PCNT_CNT_THR_EVENT_U1_INT_ST : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: This is the interrupt status bit for channel1 event.*/ -#define PCNT_CNT_THR_EVENT_U1_INT_ST (BIT(1)) -#define PCNT_CNT_THR_EVENT_U1_INT_ST_M (BIT(1)) -#define PCNT_CNT_THR_EVENT_U1_INT_ST_V 0x1 -#define PCNT_CNT_THR_EVENT_U1_INT_ST_S 1 -/* PCNT_CNT_THR_EVENT_U0_INT_ST : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: This is the interrupt status bit for channel0 event.*/ -#define PCNT_CNT_THR_EVENT_U0_INT_ST (BIT(0)) -#define PCNT_CNT_THR_EVENT_U0_INT_ST_M (BIT(0)) -#define PCNT_CNT_THR_EVENT_U0_INT_ST_V 0x1 -#define PCNT_CNT_THR_EVENT_U0_INT_ST_S 0 - -#define PCNT_INT_ENA_REG (DR_REG_PCNT_BASE + 0x0088) -/* PCNT_CNT_THR_EVENT_U7_INT_ENA : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: This is the interrupt enable bit for channel7 event.*/ -#define PCNT_CNT_THR_EVENT_U7_INT_ENA (BIT(7)) -#define PCNT_CNT_THR_EVENT_U7_INT_ENA_M (BIT(7)) -#define PCNT_CNT_THR_EVENT_U7_INT_ENA_V 0x1 -#define PCNT_CNT_THR_EVENT_U7_INT_ENA_S 7 -/* PCNT_CNT_THR_EVENT_U6_INT_ENA : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: This is the interrupt enable bit for channel6 event.*/ -#define PCNT_CNT_THR_EVENT_U6_INT_ENA (BIT(6)) -#define PCNT_CNT_THR_EVENT_U6_INT_ENA_M (BIT(6)) -#define PCNT_CNT_THR_EVENT_U6_INT_ENA_V 0x1 -#define PCNT_CNT_THR_EVENT_U6_INT_ENA_S 6 -/* PCNT_CNT_THR_EVENT_U5_INT_ENA : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: This is the interrupt enable bit for channel5 event.*/ -#define PCNT_CNT_THR_EVENT_U5_INT_ENA (BIT(5)) -#define PCNT_CNT_THR_EVENT_U5_INT_ENA_M (BIT(5)) -#define PCNT_CNT_THR_EVENT_U5_INT_ENA_V 0x1 -#define PCNT_CNT_THR_EVENT_U5_INT_ENA_S 5 -/* PCNT_CNT_THR_EVENT_U4_INT_ENA : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: This is the interrupt enable bit for channel4 event.*/ -#define PCNT_CNT_THR_EVENT_U4_INT_ENA (BIT(4)) -#define PCNT_CNT_THR_EVENT_U4_INT_ENA_M (BIT(4)) -#define PCNT_CNT_THR_EVENT_U4_INT_ENA_V 0x1 -#define PCNT_CNT_THR_EVENT_U4_INT_ENA_S 4 -/* PCNT_CNT_THR_EVENT_U3_INT_ENA : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: This is the interrupt enable bit for channel3 event.*/ -#define PCNT_CNT_THR_EVENT_U3_INT_ENA (BIT(3)) -#define PCNT_CNT_THR_EVENT_U3_INT_ENA_M (BIT(3)) -#define PCNT_CNT_THR_EVENT_U3_INT_ENA_V 0x1 -#define PCNT_CNT_THR_EVENT_U3_INT_ENA_S 3 -/* PCNT_CNT_THR_EVENT_U2_INT_ENA : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: This is the interrupt enable bit for channel2 event.*/ -#define PCNT_CNT_THR_EVENT_U2_INT_ENA (BIT(2)) -#define PCNT_CNT_THR_EVENT_U2_INT_ENA_M (BIT(2)) -#define PCNT_CNT_THR_EVENT_U2_INT_ENA_V 0x1 -#define PCNT_CNT_THR_EVENT_U2_INT_ENA_S 2 -/* PCNT_CNT_THR_EVENT_U1_INT_ENA : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: This is the interrupt enable bit for channel1 event.*/ -#define PCNT_CNT_THR_EVENT_U1_INT_ENA (BIT(1)) -#define PCNT_CNT_THR_EVENT_U1_INT_ENA_M (BIT(1)) -#define PCNT_CNT_THR_EVENT_U1_INT_ENA_V 0x1 -#define PCNT_CNT_THR_EVENT_U1_INT_ENA_S 1 -/* PCNT_CNT_THR_EVENT_U0_INT_ENA : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: This is the interrupt enable bit for channel0 event.*/ -#define PCNT_CNT_THR_EVENT_U0_INT_ENA (BIT(0)) -#define PCNT_CNT_THR_EVENT_U0_INT_ENA_M (BIT(0)) -#define PCNT_CNT_THR_EVENT_U0_INT_ENA_V 0x1 -#define PCNT_CNT_THR_EVENT_U0_INT_ENA_S 0 - -#define PCNT_INT_CLR_REG (DR_REG_PCNT_BASE + 0x008c) -/* PCNT_CNT_THR_EVENT_U7_INT_CLR : WO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: Set this bit to clear channel7 event interrupt.*/ -#define PCNT_CNT_THR_EVENT_U7_INT_CLR (BIT(7)) -#define PCNT_CNT_THR_EVENT_U7_INT_CLR_M (BIT(7)) -#define PCNT_CNT_THR_EVENT_U7_INT_CLR_V 0x1 -#define PCNT_CNT_THR_EVENT_U7_INT_CLR_S 7 -/* PCNT_CNT_THR_EVENT_U6_INT_CLR : WO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: Set this bit to clear channel6 event interrupt.*/ -#define PCNT_CNT_THR_EVENT_U6_INT_CLR (BIT(6)) -#define PCNT_CNT_THR_EVENT_U6_INT_CLR_M (BIT(6)) -#define PCNT_CNT_THR_EVENT_U6_INT_CLR_V 0x1 -#define PCNT_CNT_THR_EVENT_U6_INT_CLR_S 6 -/* PCNT_CNT_THR_EVENT_U5_INT_CLR : WO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: Set this bit to clear channel5 event interrupt.*/ -#define PCNT_CNT_THR_EVENT_U5_INT_CLR (BIT(5)) -#define PCNT_CNT_THR_EVENT_U5_INT_CLR_M (BIT(5)) -#define PCNT_CNT_THR_EVENT_U5_INT_CLR_V 0x1 -#define PCNT_CNT_THR_EVENT_U5_INT_CLR_S 5 -/* PCNT_CNT_THR_EVENT_U4_INT_CLR : WO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: Set this bit to clear channel4 event interrupt.*/ -#define PCNT_CNT_THR_EVENT_U4_INT_CLR (BIT(4)) -#define PCNT_CNT_THR_EVENT_U4_INT_CLR_M (BIT(4)) -#define PCNT_CNT_THR_EVENT_U4_INT_CLR_V 0x1 -#define PCNT_CNT_THR_EVENT_U4_INT_CLR_S 4 -/* PCNT_CNT_THR_EVENT_U3_INT_CLR : WO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: Set this bit to clear channel3 event interrupt.*/ -#define PCNT_CNT_THR_EVENT_U3_INT_CLR (BIT(3)) -#define PCNT_CNT_THR_EVENT_U3_INT_CLR_M (BIT(3)) -#define PCNT_CNT_THR_EVENT_U3_INT_CLR_V 0x1 -#define PCNT_CNT_THR_EVENT_U3_INT_CLR_S 3 -/* PCNT_CNT_THR_EVENT_U2_INT_CLR : WO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: Set this bit to clear channel2 event interrupt.*/ -#define PCNT_CNT_THR_EVENT_U2_INT_CLR (BIT(2)) -#define PCNT_CNT_THR_EVENT_U2_INT_CLR_M (BIT(2)) -#define PCNT_CNT_THR_EVENT_U2_INT_CLR_V 0x1 -#define PCNT_CNT_THR_EVENT_U2_INT_CLR_S 2 -/* PCNT_CNT_THR_EVENT_U1_INT_CLR : WO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: Set this bit to clear channel1 event interrupt.*/ -#define PCNT_CNT_THR_EVENT_U1_INT_CLR (BIT(1)) -#define PCNT_CNT_THR_EVENT_U1_INT_CLR_M (BIT(1)) -#define PCNT_CNT_THR_EVENT_U1_INT_CLR_V 0x1 -#define PCNT_CNT_THR_EVENT_U1_INT_CLR_S 1 -/* PCNT_CNT_THR_EVENT_U0_INT_CLR : WO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: Set this bit to clear channel0 event interrupt.*/ -#define PCNT_CNT_THR_EVENT_U0_INT_CLR (BIT(0)) -#define PCNT_CNT_THR_EVENT_U0_INT_CLR_M (BIT(0)) -#define PCNT_CNT_THR_EVENT_U0_INT_CLR_V 0x1 -#define PCNT_CNT_THR_EVENT_U0_INT_CLR_S 0 - -#define PCNT_U0_STATUS_REG (DR_REG_PCNT_BASE + 0x0090) -/* PCNT_CORE_STATUS_U0 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define PCNT_CORE_STATUS_U0 0xFFFFFFFF -#define PCNT_CORE_STATUS_U0_M ((PCNT_CORE_STATUS_U0_V)<<(PCNT_CORE_STATUS_U0_S)) -#define PCNT_CORE_STATUS_U0_V 0xFFFFFFFF -#define PCNT_CORE_STATUS_U0_S 0 -/*0: positive value to zero; 1: negative value to zero; 2: counter value negative ; 3: counter value positive*/ -#define PCNT_STATUS_CNT_MODE 0x3 -#define PCNT_STATUS_CNT_MODE_M ((PCNT_STATUS_CNT_MODE_V)<<(PCNT_STATUS_CNT_MODE_S)) -#define PCNT_STATUS_CNT_MODE_V 0x3 -#define PCNT_STATUS_CNT_MODE_S 0 -/* counter value equals to thresh1*/ -#define PCNT_STATUS_THRES1 BIT(2) -#define PCNT_STATUS_THRES1_M BIT(2) -#define PCNT_STATUS_THRES1_V 0x1 -#define PCNT_STATUS_THRES1_S 2 -/* counter value equals to thresh0*/ -#define PCNT_STATUS_THRES0 BIT(3) -#define PCNT_STATUS_THRES0_M BIT(3) -#define PCNT_STATUS_THRES0_V 0x1 -#define PCNT_STATUS_THRES0_S 3 -/* counter value reaches h_lim*/ -#define PCNT_STATUS_L_LIM BIT(4) -#define PCNT_STATUS_L_LIM_M BIT(4) -#define PCNT_STATUS_L_LIM_V 0x1 -#define PCNT_STATUS_L_LIM_S 4 -/* counter value reaches l_lim*/ -#define PCNT_STATUS_H_LIM BIT(5) -#define PCNT_STATUS_H_LIM_M BIT(5) -#define PCNT_STATUS_H_LIM_V 0x1 -#define PCNT_STATUS_H_LIM_S 5 -/* counter value equals to zero*/ -#define PCNT_STATUS_ZERO BIT(6) -#define PCNT_STATUS_ZERO_M BIT(6) -#define PCNT_STATUS_ZERO_V 0x1 -#define PCNT_STATUS_ZERO_S 6 - -#define PCNT_U1_STATUS_REG (DR_REG_PCNT_BASE + 0x0094) -/* PCNT_CORE_STATUS_U1 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define PCNT_CORE_STATUS_U1 0xFFFFFFFF -#define PCNT_CORE_STATUS_U1_M ((PCNT_CORE_STATUS_U1_V)<<(PCNT_CORE_STATUS_U1_S)) -#define PCNT_CORE_STATUS_U1_V 0xFFFFFFFF -#define PCNT_CORE_STATUS_U1_S 0 - -#define PCNT_U2_STATUS_REG (DR_REG_PCNT_BASE + 0x0098) -/* PCNT_CORE_STATUS_U2 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define PCNT_CORE_STATUS_U2 0xFFFFFFFF -#define PCNT_CORE_STATUS_U2_M ((PCNT_CORE_STATUS_U2_V)<<(PCNT_CORE_STATUS_U2_S)) -#define PCNT_CORE_STATUS_U2_V 0xFFFFFFFF -#define PCNT_CORE_STATUS_U2_S 0 - -#define PCNT_U3_STATUS_REG (DR_REG_PCNT_BASE + 0x009c) -/* PCNT_CORE_STATUS_U3 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define PCNT_CORE_STATUS_U3 0xFFFFFFFF -#define PCNT_CORE_STATUS_U3_M ((PCNT_CORE_STATUS_U3_V)<<(PCNT_CORE_STATUS_U3_S)) -#define PCNT_CORE_STATUS_U3_V 0xFFFFFFFF -#define PCNT_CORE_STATUS_U3_S 0 - -#define PCNT_U4_STATUS_REG (DR_REG_PCNT_BASE + 0x00a0) -/* PCNT_CORE_STATUS_U4 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define PCNT_CORE_STATUS_U4 0xFFFFFFFF -#define PCNT_CORE_STATUS_U4_M ((PCNT_CORE_STATUS_U4_V)<<(PCNT_CORE_STATUS_U4_S)) -#define PCNT_CORE_STATUS_U4_V 0xFFFFFFFF -#define PCNT_CORE_STATUS_U4_S 0 - -#define PCNT_U5_STATUS_REG (DR_REG_PCNT_BASE + 0x00a4) -/* PCNT_CORE_STATUS_U5 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define PCNT_CORE_STATUS_U5 0xFFFFFFFF -#define PCNT_CORE_STATUS_U5_M ((PCNT_CORE_STATUS_U5_V)<<(PCNT_CORE_STATUS_U5_S)) -#define PCNT_CORE_STATUS_U5_V 0xFFFFFFFF -#define PCNT_CORE_STATUS_U5_S 0 - -#define PCNT_U6_STATUS_REG (DR_REG_PCNT_BASE + 0x00a8) -/* PCNT_CORE_STATUS_U6 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define PCNT_CORE_STATUS_U6 0xFFFFFFFF -#define PCNT_CORE_STATUS_U6_M ((PCNT_CORE_STATUS_U6_V)<<(PCNT_CORE_STATUS_U6_S)) -#define PCNT_CORE_STATUS_U6_V 0xFFFFFFFF -#define PCNT_CORE_STATUS_U6_S 0 - -#define PCNT_U7_STATUS_REG (DR_REG_PCNT_BASE + 0x00ac) -/* PCNT_CORE_STATUS_U7 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define PCNT_CORE_STATUS_U7 0xFFFFFFFF -#define PCNT_CORE_STATUS_U7_M ((PCNT_CORE_STATUS_U7_V)<<(PCNT_CORE_STATUS_U7_S)) -#define PCNT_CORE_STATUS_U7_V 0xFFFFFFFF -#define PCNT_CORE_STATUS_U7_S 0 - -#define PCNT_CTRL_REG (DR_REG_PCNT_BASE + 0x00b0) -/* PCNT_CLK_EN : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define PCNT_CLK_EN (BIT(16)) -#define PCNT_CLK_EN_M (BIT(16)) -#define PCNT_CLK_EN_V 0x1 -#define PCNT_CLK_EN_S 16 -/* PCNT_CNT_PAUSE_U7 : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: Set this bit to pause unit7's counter.*/ -#define PCNT_CNT_PAUSE_U7 (BIT(15)) -#define PCNT_CNT_PAUSE_U7_M (BIT(15)) -#define PCNT_CNT_PAUSE_U7_V 0x1 -#define PCNT_CNT_PAUSE_U7_S 15 -/* PCNT_PLUS_CNT_RST_U7 : R/W ;bitpos:[14] ;default: 1'b1 ; */ -/*description: Set this bit to clear unit7's counter.*/ -#define PCNT_PLUS_CNT_RST_U7 (BIT(14)) -#define PCNT_PLUS_CNT_RST_U7_M (BIT(14)) -#define PCNT_PLUS_CNT_RST_U7_V 0x1 -#define PCNT_PLUS_CNT_RST_U7_S 14 -/* PCNT_CNT_PAUSE_U6 : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: Set this bit to pause unit6's counter.*/ -#define PCNT_CNT_PAUSE_U6 (BIT(13)) -#define PCNT_CNT_PAUSE_U6_M (BIT(13)) -#define PCNT_CNT_PAUSE_U6_V 0x1 -#define PCNT_CNT_PAUSE_U6_S 13 -/* PCNT_PLUS_CNT_RST_U6 : R/W ;bitpos:[12] ;default: 1'b1 ; */ -/*description: Set this bit to clear unit6's counter.*/ -#define PCNT_PLUS_CNT_RST_U6 (BIT(12)) -#define PCNT_PLUS_CNT_RST_U6_M (BIT(12)) -#define PCNT_PLUS_CNT_RST_U6_V 0x1 -#define PCNT_PLUS_CNT_RST_U6_S 12 -/* PCNT_CNT_PAUSE_U5 : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: Set this bit to pause unit5's counter.*/ -#define PCNT_CNT_PAUSE_U5 (BIT(11)) -#define PCNT_CNT_PAUSE_U5_M (BIT(11)) -#define PCNT_CNT_PAUSE_U5_V 0x1 -#define PCNT_CNT_PAUSE_U5_S 11 -/* PCNT_PLUS_CNT_RST_U5 : R/W ;bitpos:[10] ;default: 1'b1 ; */ -/*description: Set this bit to clear unit5's counter.*/ -#define PCNT_PLUS_CNT_RST_U5 (BIT(10)) -#define PCNT_PLUS_CNT_RST_U5_M (BIT(10)) -#define PCNT_PLUS_CNT_RST_U5_V 0x1 -#define PCNT_PLUS_CNT_RST_U5_S 10 -/* PCNT_CNT_PAUSE_U4 : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: Set this bit to pause unit4's counter.*/ -#define PCNT_CNT_PAUSE_U4 (BIT(9)) -#define PCNT_CNT_PAUSE_U4_M (BIT(9)) -#define PCNT_CNT_PAUSE_U4_V 0x1 -#define PCNT_CNT_PAUSE_U4_S 9 -/* PCNT_PLUS_CNT_RST_U4 : R/W ;bitpos:[8] ;default: 1'b1 ; */ -/*description: Set this bit to clear unit4's counter.*/ -#define PCNT_PLUS_CNT_RST_U4 (BIT(8)) -#define PCNT_PLUS_CNT_RST_U4_M (BIT(8)) -#define PCNT_PLUS_CNT_RST_U4_V 0x1 -#define PCNT_PLUS_CNT_RST_U4_S 8 -/* PCNT_CNT_PAUSE_U3 : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: Set this bit to pause unit3's counter.*/ -#define PCNT_CNT_PAUSE_U3 (BIT(7)) -#define PCNT_CNT_PAUSE_U3_M (BIT(7)) -#define PCNT_CNT_PAUSE_U3_V 0x1 -#define PCNT_CNT_PAUSE_U3_S 7 -/* PCNT_PLUS_CNT_RST_U3 : R/W ;bitpos:[6] ;default: 1'b1 ; */ -/*description: Set this bit to clear unit3's counter.*/ -#define PCNT_PLUS_CNT_RST_U3 (BIT(6)) -#define PCNT_PLUS_CNT_RST_U3_M (BIT(6)) -#define PCNT_PLUS_CNT_RST_U3_V 0x1 -#define PCNT_PLUS_CNT_RST_U3_S 6 -/* PCNT_CNT_PAUSE_U2 : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: Set this bit to pause unit2's counter.*/ -#define PCNT_CNT_PAUSE_U2 (BIT(5)) -#define PCNT_CNT_PAUSE_U2_M (BIT(5)) -#define PCNT_CNT_PAUSE_U2_V 0x1 -#define PCNT_CNT_PAUSE_U2_S 5 -/* PCNT_PLUS_CNT_RST_U2 : R/W ;bitpos:[4] ;default: 1'b1 ; */ -/*description: Set this bit to clear unit2's counter.*/ -#define PCNT_PLUS_CNT_RST_U2 (BIT(4)) -#define PCNT_PLUS_CNT_RST_U2_M (BIT(4)) -#define PCNT_PLUS_CNT_RST_U2_V 0x1 -#define PCNT_PLUS_CNT_RST_U2_S 4 -/* PCNT_CNT_PAUSE_U1 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: Set this bit to pause unit1's counter.*/ -#define PCNT_CNT_PAUSE_U1 (BIT(3)) -#define PCNT_CNT_PAUSE_U1_M (BIT(3)) -#define PCNT_CNT_PAUSE_U1_V 0x1 -#define PCNT_CNT_PAUSE_U1_S 3 -/* PCNT_PLUS_CNT_RST_U1 : R/W ;bitpos:[2] ;default: 1'b1 ; */ -/*description: Set this bit to clear unit1's counter.*/ -#define PCNT_PLUS_CNT_RST_U1 (BIT(2)) -#define PCNT_PLUS_CNT_RST_U1_M (BIT(2)) -#define PCNT_PLUS_CNT_RST_U1_V 0x1 -#define PCNT_PLUS_CNT_RST_U1_S 2 -/* PCNT_CNT_PAUSE_U0 : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: Set this bit to pause unit0's counter.*/ -#define PCNT_CNT_PAUSE_U0 (BIT(1)) -#define PCNT_CNT_PAUSE_U0_M (BIT(1)) -#define PCNT_CNT_PAUSE_U0_V 0x1 -#define PCNT_CNT_PAUSE_U0_S 1 -/* PCNT_PLUS_CNT_RST_U0 : R/W ;bitpos:[0] ;default: 1'b1 ; */ -/*description: Set this bit to clear unit0's counter.*/ -#define PCNT_PLUS_CNT_RST_U0 (BIT(0)) -#define PCNT_PLUS_CNT_RST_U0_M (BIT(0)) -#define PCNT_PLUS_CNT_RST_U0_V 0x1 -#define PCNT_PLUS_CNT_RST_U0_S 0 - -#define PCNT_DATE_REG (DR_REG_PCNT_BASE + 0x00fc) -/* PCNT_DATE : R/W ;bitpos:[31:0] ;default: 32'h14122600 ; */ -/*description: */ -#define PCNT_DATE 0xFFFFFFFF -#define PCNT_DATE_M ((PCNT_DATE_V)<<(PCNT_DATE_S)) -#define PCNT_DATE_V 0xFFFFFFFF -#define PCNT_DATE_S 0 - - - - -#endif /*_SOC_PCNT_REG_H_ */ - - diff --git a/tools/sdk/include/soc/soc/pcnt_struct.h b/tools/sdk/include/soc/soc/pcnt_struct.h deleted file mode 100644 index 8cfd4ca36e2..00000000000 --- a/tools/sdk/include/soc/soc/pcnt_struct.h +++ /dev/null @@ -1,182 +0,0 @@ -// 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. -#ifndef _SOC_PCNT_STRUCT_H_ -#define _SOC_PCNT_STRUCT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef volatile struct { - struct{ - union { - struct { - uint32_t filter_thres: 10; /*This register is used to filter pulse whose width is smaller than this value for unit0.*/ - uint32_t filter_en: 1; /*This is the enable bit for filtering input signals for unit0.*/ - uint32_t thr_zero_en: 1; /*This is the enable bit for comparing unit0's count with 0 value.*/ - uint32_t thr_h_lim_en: 1; /*This is the enable bit for comparing unit0's count with thr_h_lim value.*/ - uint32_t thr_l_lim_en: 1; /*This is the enable bit for comparing unit0's count with thr_l_lim value.*/ - uint32_t thr_thres0_en: 1; /*This is the enable bit for comparing unit0's count with thres0 value.*/ - uint32_t thr_thres1_en: 1; /*This is the enable bit for comparing unit0's count with thres1 value .*/ - uint32_t ch0_neg_mode: 2; /*This register is used to control the mode of channel0's input neg-edge signal for unit0. 2'd1:increase at the negedge of input signal 2'd2:decrease at the negedge of input signal others:forbidden*/ - uint32_t ch0_pos_mode: 2; /*This register is used to control the mode of channel0's input pos-edge signal for unit0. 2'd1:increase at the posedge of input signal 2'd2:decrease at the posedge of input signal others:forbidden*/ - uint32_t ch0_hctrl_mode: 2; /*This register is used to control the mode of channel0's high control signal for unit0. 2'd0:increase when control signal is low 2'd1:decrease when control signal is high others:forbidden*/ - uint32_t ch0_lctrl_mode: 2; /*This register is used to control the mode of channel0's low control signal for unit0. 2'd0:increase when control signal is low 2'd1:decrease when control signal is high others:forbidden*/ - uint32_t ch1_neg_mode: 2; /*This register is used to control the mode of channel1's input neg-edge signal for unit0. 2'd1:increase at the negedge of input signal 2'd2:decrease at the negedge of input signal others:forbidden*/ - uint32_t ch1_pos_mode: 2; /*This register is used to control the mode of channel1's input pos-edge signal for unit0. 2'd1:increase at the posedge of input signal 2'd2:decrease at the posedge of input signal others:forbidden*/ - uint32_t ch1_hctrl_mode: 2; /*This register is used to control the mode of channel1's high control signal for unit0. 2'd0:increase when control signal is low 2'd1:decrease when control signal is high others:forbidden*/ - uint32_t ch1_lctrl_mode: 2; /*This register is used to control the mode of channel1's low control signal for unit0. 2'd0:increase when control signal is low 2'd1:decrease when control signal is high others:forbidden*/ - }; - uint32_t val; - } conf0; - union { - struct { - uint32_t cnt_thres0:16; /*This register is used to configure thres0 value for unit0.*/ - uint32_t cnt_thres1:16; /*This register is used to configure thres1 value for unit0.*/ - }; - uint32_t val; - } conf1; - union { - struct { - uint32_t cnt_h_lim:16; /*This register is used to configure thr_h_lim value for unit0.*/ - uint32_t cnt_l_lim:16; /*This register is used to configure thr_l_lim value for unit0.*/ - }; - uint32_t val; - } conf2; - } conf_unit[8]; - union { - struct { - uint32_t cnt_val : 16; /*This register stores the current pulse count value for unit0.*/ - uint32_t reserved16: 16; - }; - uint32_t val; - } cnt_unit[8]; - union { - struct { - uint32_t cnt_thr_event_u0: 1; /*This is the interrupt raw bit for channel0 event.*/ - uint32_t cnt_thr_event_u1: 1; /*This is the interrupt raw bit for channel1 event.*/ - uint32_t cnt_thr_event_u2: 1; /*This is the interrupt raw bit for channel2 event.*/ - uint32_t cnt_thr_event_u3: 1; /*This is the interrupt raw bit for channel3 event.*/ - uint32_t cnt_thr_event_u4: 1; /*This is the interrupt raw bit for channel4 event.*/ - uint32_t cnt_thr_event_u5: 1; /*This is the interrupt raw bit for channel5 event.*/ - uint32_t cnt_thr_event_u6: 1; /*This is the interrupt raw bit for channel6 event.*/ - uint32_t cnt_thr_event_u7: 1; /*This is the interrupt raw bit for channel7 event.*/ - uint32_t reserved8: 24; - }; - uint32_t val; - } int_raw; - union { - struct { - uint32_t cnt_thr_event_u0: 1; /*This is the interrupt status bit for channel0 event.*/ - uint32_t cnt_thr_event_u1: 1; /*This is the interrupt status bit for channel1 event.*/ - uint32_t cnt_thr_event_u2: 1; /*This is the interrupt status bit for channel2 event.*/ - uint32_t cnt_thr_event_u3: 1; /*This is the interrupt status bit for channel3 event.*/ - uint32_t cnt_thr_event_u4: 1; /*This is the interrupt status bit for channel4 event.*/ - uint32_t cnt_thr_event_u5: 1; /*This is the interrupt status bit for channel5 event.*/ - uint32_t cnt_thr_event_u6: 1; /*This is the interrupt status bit for channel6 event.*/ - uint32_t cnt_thr_event_u7: 1; /*This is the interrupt status bit for channel7 event.*/ - uint32_t reserved8: 24; - }; - uint32_t val; - } int_st; - union { - struct { - uint32_t cnt_thr_event_u0: 1; /*This is the interrupt enable bit for channel0 event.*/ - uint32_t cnt_thr_event_u1: 1; /*This is the interrupt enable bit for channel1 event.*/ - uint32_t cnt_thr_event_u2: 1; /*This is the interrupt enable bit for channel2 event.*/ - uint32_t cnt_thr_event_u3: 1; /*This is the interrupt enable bit for channel3 event.*/ - uint32_t cnt_thr_event_u4: 1; /*This is the interrupt enable bit for channel4 event.*/ - uint32_t cnt_thr_event_u5: 1; /*This is the interrupt enable bit for channel5 event.*/ - uint32_t cnt_thr_event_u6: 1; /*This is the interrupt enable bit for channel6 event.*/ - uint32_t cnt_thr_event_u7: 1; /*This is the interrupt enable bit for channel7 event.*/ - uint32_t reserved8: 24; - }; - uint32_t val; - } int_ena; - union { - struct { - uint32_t cnt_thr_event_u0: 1; /*Set this bit to clear channel0 event interrupt.*/ - uint32_t cnt_thr_event_u1: 1; /*Set this bit to clear channel1 event interrupt.*/ - uint32_t cnt_thr_event_u2: 1; /*Set this bit to clear channel2 event interrupt.*/ - uint32_t cnt_thr_event_u3: 1; /*Set this bit to clear channel3 event interrupt.*/ - uint32_t cnt_thr_event_u4: 1; /*Set this bit to clear channel4 event interrupt.*/ - uint32_t cnt_thr_event_u5: 1; /*Set this bit to clear channel5 event interrupt.*/ - uint32_t cnt_thr_event_u6: 1; /*Set this bit to clear channel6 event interrupt.*/ - uint32_t cnt_thr_event_u7: 1; /*Set this bit to clear channel7 event interrupt.*/ - uint32_t reserved8: 24; - }; - uint32_t val; - } int_clr; - union { - struct { - uint32_t cnt_mode:2; /*0: positive value to zero; 1: negative value to zero; 2: counter value negative ; 3: counter value positive*/ - uint32_t thres1_lat:1; /* counter value equals to thresh1*/ - uint32_t thres0_lat:1; /* counter value equals to thresh0*/ - uint32_t l_lim_lat:1; /* counter value reaches h_lim*/ - uint32_t h_lim_lat:1; /* counter value reaches l_lim*/ - uint32_t zero_lat:1; /* counter value equals zero*/ - uint32_t reserved7:25; - }; - uint32_t val; - } status_unit[8]; - union { - struct { - uint32_t cnt_rst_u0: 1; /*Set this bit to clear unit0's counter.*/ - uint32_t cnt_pause_u0: 1; /*Set this bit to pause unit0's counter.*/ - uint32_t cnt_rst_u1: 1; /*Set this bit to clear unit1's counter.*/ - uint32_t cnt_pause_u1: 1; /*Set this bit to pause unit1's counter.*/ - uint32_t cnt_rst_u2: 1; /*Set this bit to clear unit2's counter.*/ - uint32_t cnt_pause_u2: 1; /*Set this bit to pause unit2's counter.*/ - uint32_t cnt_rst_u3: 1; /*Set this bit to clear unit3's counter.*/ - uint32_t cnt_pause_u3: 1; /*Set this bit to pause unit3's counter.*/ - uint32_t cnt_rst_u4: 1; /*Set this bit to clear unit4's counter.*/ - uint32_t cnt_pause_u4: 1; /*Set this bit to pause unit4's counter.*/ - uint32_t cnt_rst_u5: 1; /*Set this bit to clear unit5's counter.*/ - uint32_t cnt_pause_u5: 1; /*Set this bit to pause unit5's counter.*/ - uint32_t cnt_rst_u6: 1; /*Set this bit to clear unit6's counter.*/ - uint32_t cnt_pause_u6: 1; /*Set this bit to pause unit6's counter.*/ - uint32_t cnt_rst_u7: 1; /*Set this bit to clear unit7's counter.*/ - uint32_t cnt_pause_u7: 1; /*Set this bit to pause unit7's counter.*/ - uint32_t clk_en: 1; - uint32_t reserved17: 15; - }; - uint32_t val; - } ctrl; - uint32_t reserved_b4; - uint32_t reserved_b8; - uint32_t reserved_bc; - uint32_t reserved_c0; - uint32_t reserved_c4; - uint32_t reserved_c8; - uint32_t reserved_cc; - uint32_t reserved_d0; - uint32_t reserved_d4; - uint32_t reserved_d8; - uint32_t reserved_dc; - uint32_t reserved_e0; - uint32_t reserved_e4; - uint32_t reserved_e8; - uint32_t reserved_ec; - uint32_t reserved_f0; - uint32_t reserved_f4; - uint32_t reserved_f8; - uint32_t date; /**/ -} pcnt_dev_t; -extern pcnt_dev_t PCNT; - -#ifdef __cplusplus -} -#endif - -#endif /* _SOC_PCNT_STRUCT_H_ */ diff --git a/tools/sdk/include/soc/soc/periph_defs.h b/tools/sdk/include/soc/soc/periph_defs.h deleted file mode 100644 index c4ad589c9dd..00000000000 --- a/tools/sdk/include/soc/soc/periph_defs.h +++ /dev/null @@ -1,64 +0,0 @@ -// 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. - -#ifndef _SOC_PERIPH_DEFS_H_ -#define _SOC_PERIPH_DEFS_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - PERIPH_LEDC_MODULE = 0, - PERIPH_UART0_MODULE, - PERIPH_UART1_MODULE, - PERIPH_UART2_MODULE, - PERIPH_I2C0_MODULE, - PERIPH_I2C1_MODULE, - PERIPH_I2S0_MODULE, - PERIPH_I2S1_MODULE, - PERIPH_TIMG0_MODULE, - PERIPH_TIMG1_MODULE, - PERIPH_PWM0_MODULE, - PERIPH_PWM1_MODULE, - PERIPH_PWM2_MODULE, - PERIPH_PWM3_MODULE, - PERIPH_UHCI0_MODULE, - PERIPH_UHCI1_MODULE, - PERIPH_RMT_MODULE, - PERIPH_PCNT_MODULE, - PERIPH_SPI_MODULE, - PERIPH_HSPI_MODULE, - PERIPH_VSPI_MODULE, - PERIPH_SPI_DMA_MODULE, - PERIPH_SDMMC_MODULE, - PERIPH_SDIO_SLAVE_MODULE, - PERIPH_CAN_MODULE, - PERIPH_EMAC_MODULE, - PERIPH_RNG_MODULE, - PERIPH_WIFI_MODULE, - PERIPH_BT_MODULE, - PERIPH_WIFI_BT_COMMON_MODULE, - PERIPH_BT_BASEBAND_MODULE, - PERIPH_BT_LC_MODULE, - PERIPH_AES_MODULE, - PERIPH_SHA_MODULE, - PERIPH_RSA_MODULE, -} periph_module_t; - -#ifdef __cplusplus -} -#endif - -#endif /* _SOC_PERIPH_DEFS_H_ */ diff --git a/tools/sdk/include/soc/soc/pid.h b/tools/sdk/include/soc/soc/pid.h deleted file mode 100644 index bd4e9f26d24..00000000000 --- a/tools/sdk/include/soc/soc/pid.h +++ /dev/null @@ -1,65 +0,0 @@ -// 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. -#ifndef _SOC_PID_H_ -#define _SOC_PID_H_ - -#define PROPID_GEN_BASE 0x3FF1F000 -//Bits 1..7: 1 if interrupt will be triggering PID change -#define PROPID_CONFIG_INTERRUPT_ENABLE ((PROPID_GEN_BASE)+0x000) -//Vectors for the various interrupt handlers -#define PROPID_CONFIG_INTERRUPT_ADDR_1 ((PROPID_GEN_BASE)+0x004) -#define PROPID_CONFIG_INTERRUPT_ADDR_2 ((PROPID_GEN_BASE)+0x008) -#define PROPID_CONFIG_INTERRUPT_ADDR_3 ((PROPID_GEN_BASE)+0x00C) -#define PROPID_CONFIG_INTERRUPT_ADDR_4 ((PROPID_GEN_BASE)+0x010) -#define PROPID_CONFIG_INTERRUPT_ADDR_5 ((PROPID_GEN_BASE)+0x014) -#define PROPID_CONFIG_INTERRUPT_ADDR_6 ((PROPID_GEN_BASE)+0x018) -#define PROPID_CONFIG_INTERRUPT_ADDR_7 ((PROPID_GEN_BASE)+0x01C) - -//Delay, in CPU cycles, before switching to new PID -#define PROPID_CONFIG_PID_DELAY ((PROPID_GEN_BASE)+0x020) -#define PROPID_CONFIG_NMI_DELAY ((PROPID_GEN_BASE)+0x024) - -//Last detected interrupt. Set by hw on int. -#define PROPID_TABLE_LEVEL ((PROPID_GEN_BASE)+0x028) -//PID/prev int data for each int -#define PROPID_FROM_1 ((PROPID_GEN_BASE)+0x02C) -#define PROPID_FROM_2 ((PROPID_GEN_BASE)+0x030) -#define PROPID_FROM_3 ((PROPID_GEN_BASE)+0x034) -#define PROPID_FROM_4 ((PROPID_GEN_BASE)+0x038) -#define PROPID_FROM_5 ((PROPID_GEN_BASE)+0x03C) -#define PROPID_FROM_6 ((PROPID_GEN_BASE)+0x040) -#define PROPID_FROM_7 ((PROPID_GEN_BASE)+0x044) -#define PROPID_FROM_PID_MASK 0x7 -#define PROPID_FROM_PID_S 0 -#define PROPID_FROM_INT_MASK 0xF -#define PROPID_FROM_INT_S 3 - -//PID to be set after confirm routine -#define PROPID_PID_NEW ((PROPID_GEN_BASE)+0x048) -//Write to kick off PID change -#define PROPID_PID_CONFIRM ((PROPID_GEN_BASE)+0x04c) -//current PID? -#define PROPID_PID_REG ((PROPID_GEN_BASE)+0x050) - -//Write to mask NMI -#define PROPID_PID_NMI_MASK_HW_ENABLE ((PROPID_GEN_BASE)+0x054) -//Write to unmask NMI -#define PROPID_PID_NMI_MASK_HW_DISABLE ((PROPID_GEN_BASE)+0x058) -#define PROPID_PID_NMI_MASK_HW_REG ((PROPID_GEN_BASE)+0x05c) - -//Debug regs -#define PROPID_PID ((PROPID_GEN_BASE)+0x060) -#define PROPID_NMI_MASK_HW ((PROPID_GEN_BASE)+0x064) - -#endif /* _SOC_PID_H_ */ diff --git a/tools/sdk/include/soc/soc/rmt_reg.h b/tools/sdk/include/soc/soc/rmt_reg.h deleted file mode 100644 index 59756fa2490..00000000000 --- a/tools/sdk/include/soc/soc/rmt_reg.h +++ /dev/null @@ -1,2172 +0,0 @@ -// 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. -#ifndef _SOC_RMT_REG_H_ -#define _SOC_RMT_REG_H_ - -#include "soc.h" -#define RMT_CH0DATA_REG (DR_REG_RMT_BASE + 0x0000) - -#define RMT_CH1DATA_REG (DR_REG_RMT_BASE + 0x0004) - -#define RMT_CH2DATA_REG (DR_REG_RMT_BASE + 0x0008) - -#define RMT_CH3DATA_REG (DR_REG_RMT_BASE + 0x000c) - -#define RMT_CH4DATA_REG (DR_REG_RMT_BASE + 0x0010) - -#define RMT_CH5DATA_REG (DR_REG_RMT_BASE + 0x0014) - -#define RMT_CH6DATA_REG (DR_REG_RMT_BASE + 0x0018) - -#define RMT_CH7DATA_REG (DR_REG_RMT_BASE + 0x001c) - -#define RMT_CH0CONF0_REG (DR_REG_RMT_BASE + 0x0020) -/* RMT_CLK_EN : R/W ;bitpos:[31] ;default: 1'h0 ; */ -/*description: This bit is used to control clock.when software config RMT - internal registers it controls the register clock.*/ -#define RMT_CLK_EN (BIT(31)) -#define RMT_CLK_EN_M (BIT(31)) -#define RMT_CLK_EN_V 0x1 -#define RMT_CLK_EN_S 31 -/* RMT_MEM_PD : R/W ;bitpos:[30] ;default: 1'b0 ; */ -/*description: This bit is used to reduce power consumed by mem. 1:mem is in low power state.*/ -#define RMT_MEM_PD (BIT(30)) -#define RMT_MEM_PD_M (BIT(30)) -#define RMT_MEM_PD_V 0x1 -#define RMT_MEM_PD_S 30 -/* RMT_CARRIER_OUT_LV_CH0 : R/W ;bitpos:[29] ;default: 1'b1 ; */ -/*description: This bit is used to configure the way carrier wave is modulated - for channel0.1'b1:transmit on low output level 1'b0:transmit on high output level.*/ -#define RMT_CARRIER_OUT_LV_CH0 (BIT(29)) -#define RMT_CARRIER_OUT_LV_CH0_M (BIT(29)) -#define RMT_CARRIER_OUT_LV_CH0_V 0x1 -#define RMT_CARRIER_OUT_LV_CH0_S 29 -/* RMT_CARRIER_EN_CH0 : R/W ;bitpos:[28] ;default: 1'b1 ; */ -/*description: This is the carrier modulation enable control bit for channel0.*/ -#define RMT_CARRIER_EN_CH0 (BIT(28)) -#define RMT_CARRIER_EN_CH0_M (BIT(28)) -#define RMT_CARRIER_EN_CH0_V 0x1 -#define RMT_CARRIER_EN_CH0_S 28 -/* RMT_MEM_SIZE_CH0 : R/W ;bitpos:[27:24] ;default: 4'h1 ; */ -/*description: This register is used to configure the the amount of memory blocks - allocated to channel0.*/ -#define RMT_MEM_SIZE_CH0 0x0000000F -#define RMT_MEM_SIZE_CH0_M ((RMT_MEM_SIZE_CH0_V)<<(RMT_MEM_SIZE_CH0_S)) -#define RMT_MEM_SIZE_CH0_V 0xF -#define RMT_MEM_SIZE_CH0_S 24 -/* RMT_IDLE_THRES_CH0 : R/W ;bitpos:[23:8] ;default: 16'h1000 ; */ -/*description: In receive mode when no edge is detected on the input signal - for longer than reg_idle_thres_ch0 then the receive process is done.*/ -#define RMT_IDLE_THRES_CH0 0x0000FFFF -#define RMT_IDLE_THRES_CH0_M ((RMT_IDLE_THRES_CH0_V)<<(RMT_IDLE_THRES_CH0_S)) -#define RMT_IDLE_THRES_CH0_V 0xFFFF -#define RMT_IDLE_THRES_CH0_S 8 -/* RMT_DIV_CNT_CH0 : R/W ;bitpos:[7:0] ;default: 8'h2 ; */ -/*description: This register is used to configure the frequency divider's factor in channel0.*/ -#define RMT_DIV_CNT_CH0 0x000000FF -#define RMT_DIV_CNT_CH0_M ((RMT_DIV_CNT_CH0_V)<<(RMT_DIV_CNT_CH0_S)) -#define RMT_DIV_CNT_CH0_V 0xFF -#define RMT_DIV_CNT_CH0_S 0 - -#define RMT_CH0CONF1_REG (DR_REG_RMT_BASE + 0x0024) -/* RMT_IDLE_OUT_EN_CH0 : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: This is the output enable control bit for channel0 in IDLE state.*/ -#define RMT_IDLE_OUT_EN_CH0 (BIT(19)) -#define RMT_IDLE_OUT_EN_CH0_M (BIT(19)) -#define RMT_IDLE_OUT_EN_CH0_V 0x1 -#define RMT_IDLE_OUT_EN_CH0_S 19 -/* RMT_IDLE_OUT_LV_CH0 : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: This bit configures the output signal's level for channel0 in IDLE state.*/ -#define RMT_IDLE_OUT_LV_CH0 (BIT(18)) -#define RMT_IDLE_OUT_LV_CH0_M (BIT(18)) -#define RMT_IDLE_OUT_LV_CH0_V 0x1 -#define RMT_IDLE_OUT_LV_CH0_S 18 -/* RMT_REF_ALWAYS_ON_CH0 : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: This bit is used to select base clock. 1'b1:clk_apb 1'b0:clk_ref*/ -#define RMT_REF_ALWAYS_ON_CH0 (BIT(17)) -#define RMT_REF_ALWAYS_ON_CH0_M (BIT(17)) -#define RMT_REF_ALWAYS_ON_CH0_V 0x1 -#define RMT_REF_ALWAYS_ON_CH0_S 17 -/* RMT_REF_CNT_RST_CH0 : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: This bit is used to reset divider in channel0.*/ -#define RMT_REF_CNT_RST_CH0 (BIT(16)) -#define RMT_REF_CNT_RST_CH0_M (BIT(16)) -#define RMT_REF_CNT_RST_CH0_V 0x1 -#define RMT_REF_CNT_RST_CH0_S 16 -/* RMT_RX_FILTER_THRES_CH0 : R/W ;bitpos:[15:8] ;default: 8'hf ; */ -/*description: in receive mode channel0 ignore input pulse when the pulse width - is smaller then this value.*/ -#define RMT_RX_FILTER_THRES_CH0 0x000000FF -#define RMT_RX_FILTER_THRES_CH0_M ((RMT_RX_FILTER_THRES_CH0_V)<<(RMT_RX_FILTER_THRES_CH0_S)) -#define RMT_RX_FILTER_THRES_CH0_V 0xFF -#define RMT_RX_FILTER_THRES_CH0_S 8 -/* RMT_RX_FILTER_EN_CH0 : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: This is the receive filter enable bit for channel0.*/ -#define RMT_RX_FILTER_EN_CH0 (BIT(7)) -#define RMT_RX_FILTER_EN_CH0_M (BIT(7)) -#define RMT_RX_FILTER_EN_CH0_V 0x1 -#define RMT_RX_FILTER_EN_CH0_S 7 -/* RMT_TX_CONTI_MODE_CH0 : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: Set this bit to continue sending from the first data to the - last data in channel0 again and again.*/ -#define RMT_TX_CONTI_MODE_CH0 (BIT(6)) -#define RMT_TX_CONTI_MODE_CH0_M (BIT(6)) -#define RMT_TX_CONTI_MODE_CH0_V 0x1 -#define RMT_TX_CONTI_MODE_CH0_S 6 -/* RMT_MEM_OWNER_CH0 : R/W ;bitpos:[5] ;default: 1'b1 ; */ -/*description: This is the mark of channel0's ram usage right.1'b1:receiver - uses the ram 0:transmitter uses the ram*/ -#define RMT_MEM_OWNER_CH0 (BIT(5)) -#define RMT_MEM_OWNER_CH0_M (BIT(5)) -#define RMT_MEM_OWNER_CH0_V 0x1 -#define RMT_MEM_OWNER_CH0_S 5 -/* RMT_APB_MEM_RST_CH0 : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: Set this bit to reset W/R ram address for channel0 by apb fifo access*/ -#define RMT_APB_MEM_RST_CH0 (BIT(4)) -#define RMT_APB_MEM_RST_CH0_M (BIT(4)) -#define RMT_APB_MEM_RST_CH0_V 0x1 -#define RMT_APB_MEM_RST_CH0_S 4 -/* RMT_MEM_RD_RST_CH0 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: Set this bit to reset read ram address for channel0 by transmitter access.*/ -#define RMT_MEM_RD_RST_CH0 (BIT(3)) -#define RMT_MEM_RD_RST_CH0_M (BIT(3)) -#define RMT_MEM_RD_RST_CH0_V 0x1 -#define RMT_MEM_RD_RST_CH0_S 3 -/* RMT_MEM_WR_RST_CH0 : R/W ;bitpos:[2] ;default: 1'h0 ; */ -/*description: Set this bit to reset write ram address for channel0 by receiver access.*/ -#define RMT_MEM_WR_RST_CH0 (BIT(2)) -#define RMT_MEM_WR_RST_CH0_M (BIT(2)) -#define RMT_MEM_WR_RST_CH0_V 0x1 -#define RMT_MEM_WR_RST_CH0_S 2 -/* RMT_RX_EN_CH0 : R/W ;bitpos:[1] ;default: 1'h0 ; */ -/*description: Set this bit to enbale receving data for channel0.*/ -#define RMT_RX_EN_CH0 (BIT(1)) -#define RMT_RX_EN_CH0_M (BIT(1)) -#define RMT_RX_EN_CH0_V 0x1 -#define RMT_RX_EN_CH0_S 1 -/* RMT_TX_START_CH0 : R/W ;bitpos:[0] ;default: 1'h0 ; */ -/*description: Set this bit to start sending data for channel0.*/ -#define RMT_TX_START_CH0 (BIT(0)) -#define RMT_TX_START_CH0_M (BIT(0)) -#define RMT_TX_START_CH0_V 0x1 -#define RMT_TX_START_CH0_S 0 - -#define RMT_CH1CONF0_REG (DR_REG_RMT_BASE + 0x0028) -/* RMT_CARRIER_OUT_LV_CH1 : R/W ;bitpos:[29] ;default: 1'b1 ; */ -/*description: This bit is used to configure the way carrier wave is modulated - for channel1.1'b1:transmit on low output level 1'b0:transmit on high output level.*/ -#define RMT_CARRIER_OUT_LV_CH1 (BIT(29)) -#define RMT_CARRIER_OUT_LV_CH1_M (BIT(29)) -#define RMT_CARRIER_OUT_LV_CH1_V 0x1 -#define RMT_CARRIER_OUT_LV_CH1_S 29 -/* RMT_CARRIER_EN_CH1 : R/W ;bitpos:[28] ;default: 1'b1 ; */ -/*description: This is the carrier modulation enable control bit for channel1.*/ -#define RMT_CARRIER_EN_CH1 (BIT(28)) -#define RMT_CARRIER_EN_CH1_M (BIT(28)) -#define RMT_CARRIER_EN_CH1_V 0x1 -#define RMT_CARRIER_EN_CH1_S 28 -/* RMT_MEM_SIZE_CH1 : R/W ;bitpos:[27:24] ;default: 4'h1 ; */ -/*description: This register is used to configure the the amount of memory blocks - allocated to channel1.*/ -#define RMT_MEM_SIZE_CH1 0x0000000F -#define RMT_MEM_SIZE_CH1_M ((RMT_MEM_SIZE_CH1_V)<<(RMT_MEM_SIZE_CH1_S)) -#define RMT_MEM_SIZE_CH1_V 0xF -#define RMT_MEM_SIZE_CH1_S 24 -/* RMT_IDLE_THRES_CH1 : R/W ;bitpos:[23:8] ;default: 16'h1000 ; */ -/*description: This register is used to configure the the amount of memory blocks - allocated to channel1.*/ -#define RMT_IDLE_THRES_CH1 0x0000FFFF -#define RMT_IDLE_THRES_CH1_M ((RMT_IDLE_THRES_CH1_V)<<(RMT_IDLE_THRES_CH1_S)) -#define RMT_IDLE_THRES_CH1_V 0xFFFF -#define RMT_IDLE_THRES_CH1_S 8 -/* RMT_DIV_CNT_CH1 : R/W ;bitpos:[7:0] ;default: 8'h2 ; */ -/*description: This register is used to configure the frequency divider's factor in channel1.*/ -#define RMT_DIV_CNT_CH1 0x000000FF -#define RMT_DIV_CNT_CH1_M ((RMT_DIV_CNT_CH1_V)<<(RMT_DIV_CNT_CH1_S)) -#define RMT_DIV_CNT_CH1_V 0xFF -#define RMT_DIV_CNT_CH1_S 0 - -#define RMT_CH1CONF1_REG (DR_REG_RMT_BASE + 0x002c) -/* RMT_IDLE_OUT_EN_CH1 : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: This is the output enable control bit for channel1 in IDLE state.*/ -#define RMT_IDLE_OUT_EN_CH1 (BIT(19)) -#define RMT_IDLE_OUT_EN_CH1_M (BIT(19)) -#define RMT_IDLE_OUT_EN_CH1_V 0x1 -#define RMT_IDLE_OUT_EN_CH1_S 19 -/* RMT_IDLE_OUT_LV_CH1 : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: This bit configures the output signal's level for channel1 in IDLE state.*/ -#define RMT_IDLE_OUT_LV_CH1 (BIT(18)) -#define RMT_IDLE_OUT_LV_CH1_M (BIT(18)) -#define RMT_IDLE_OUT_LV_CH1_V 0x1 -#define RMT_IDLE_OUT_LV_CH1_S 18 -/* RMT_REF_ALWAYS_ON_CH1 : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: This bit is used to select base clock. 1'b1:clk_apb 1'b0:clk_ref*/ -#define RMT_REF_ALWAYS_ON_CH1 (BIT(17)) -#define RMT_REF_ALWAYS_ON_CH1_M (BIT(17)) -#define RMT_REF_ALWAYS_ON_CH1_V 0x1 -#define RMT_REF_ALWAYS_ON_CH1_S 17 -/* RMT_REF_CNT_RST_CH1 : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: This bit is used to reset divider in channel1.*/ -#define RMT_REF_CNT_RST_CH1 (BIT(16)) -#define RMT_REF_CNT_RST_CH1_M (BIT(16)) -#define RMT_REF_CNT_RST_CH1_V 0x1 -#define RMT_REF_CNT_RST_CH1_S 16 -/* RMT_RX_FILTER_THRES_CH1 : R/W ;bitpos:[15:8] ;default: 8'hf ; */ -/*description: in receive mode channel1 ignore input pulse when the pulse width - is smaller then this value.*/ -#define RMT_RX_FILTER_THRES_CH1 0x000000FF -#define RMT_RX_FILTER_THRES_CH1_M ((RMT_RX_FILTER_THRES_CH1_V)<<(RMT_RX_FILTER_THRES_CH1_S)) -#define RMT_RX_FILTER_THRES_CH1_V 0xFF -#define RMT_RX_FILTER_THRES_CH1_S 8 -/* RMT_RX_FILTER_EN_CH1 : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: This is the receive filter enable bit for channel1.*/ -#define RMT_RX_FILTER_EN_CH1 (BIT(7)) -#define RMT_RX_FILTER_EN_CH1_M (BIT(7)) -#define RMT_RX_FILTER_EN_CH1_V 0x1 -#define RMT_RX_FILTER_EN_CH1_S 7 -/* RMT_TX_CONTI_MODE_CH1 : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: Set this bit to continue sending from the first data to the - last data in channel1 again and again.*/ -#define RMT_TX_CONTI_MODE_CH1 (BIT(6)) -#define RMT_TX_CONTI_MODE_CH1_M (BIT(6)) -#define RMT_TX_CONTI_MODE_CH1_V 0x1 -#define RMT_TX_CONTI_MODE_CH1_S 6 -/* RMT_MEM_OWNER_CH1 : R/W ;bitpos:[5] ;default: 1'b1 ; */ -/*description: This is the mark of channel1's ram usage right.1'b1:receiver - uses the ram 0:transmitter uses the ram*/ -#define RMT_MEM_OWNER_CH1 (BIT(5)) -#define RMT_MEM_OWNER_CH1_M (BIT(5)) -#define RMT_MEM_OWNER_CH1_V 0x1 -#define RMT_MEM_OWNER_CH1_S 5 -/* RMT_APB_MEM_RST_CH1 : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: Set this bit to reset W/R ram address for channel1 by apb fifo access*/ -#define RMT_APB_MEM_RST_CH1 (BIT(4)) -#define RMT_APB_MEM_RST_CH1_M (BIT(4)) -#define RMT_APB_MEM_RST_CH1_V 0x1 -#define RMT_APB_MEM_RST_CH1_S 4 -/* RMT_MEM_RD_RST_CH1 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: Set this bit to reset read ram address for channel1 by transmitter access.*/ -#define RMT_MEM_RD_RST_CH1 (BIT(3)) -#define RMT_MEM_RD_RST_CH1_M (BIT(3)) -#define RMT_MEM_RD_RST_CH1_V 0x1 -#define RMT_MEM_RD_RST_CH1_S 3 -/* RMT_MEM_WR_RST_CH1 : R/W ;bitpos:[2] ;default: 1'h0 ; */ -/*description: Set this bit to reset write ram address for channel1 by receiver access.*/ -#define RMT_MEM_WR_RST_CH1 (BIT(2)) -#define RMT_MEM_WR_RST_CH1_M (BIT(2)) -#define RMT_MEM_WR_RST_CH1_V 0x1 -#define RMT_MEM_WR_RST_CH1_S 2 -/* RMT_RX_EN_CH1 : R/W ;bitpos:[1] ;default: 1'h0 ; */ -/*description: Set this bit to enbale receving data for channel1.*/ -#define RMT_RX_EN_CH1 (BIT(1)) -#define RMT_RX_EN_CH1_M (BIT(1)) -#define RMT_RX_EN_CH1_V 0x1 -#define RMT_RX_EN_CH1_S 1 -/* RMT_TX_START_CH1 : R/W ;bitpos:[0] ;default: 1'h0 ; */ -/*description: Set this bit to start sending data for channel1.*/ -#define RMT_TX_START_CH1 (BIT(0)) -#define RMT_TX_START_CH1_M (BIT(0)) -#define RMT_TX_START_CH1_V 0x1 -#define RMT_TX_START_CH1_S 0 - -#define RMT_CH2CONF0_REG (DR_REG_RMT_BASE + 0x0030) -/* RMT_CARRIER_OUT_LV_CH2 : R/W ;bitpos:[29] ;default: 1'b1 ; */ -/*description: This bit is used to configure carrier wave's position for channel2.1'b1:add - on low level 1'b0:add on high level.*/ -#define RMT_CARRIER_OUT_LV_CH2 (BIT(29)) -#define RMT_CARRIER_OUT_LV_CH2_M (BIT(29)) -#define RMT_CARRIER_OUT_LV_CH2_V 0x1 -#define RMT_CARRIER_OUT_LV_CH2_S 29 -/* RMT_CARRIER_EN_CH2 : R/W ;bitpos:[28] ;default: 1'b1 ; */ -/*description: This is the carrier modulation enable control bit for channel2.*/ -#define RMT_CARRIER_EN_CH2 (BIT(28)) -#define RMT_CARRIER_EN_CH2_M (BIT(28)) -#define RMT_CARRIER_EN_CH2_V 0x1 -#define RMT_CARRIER_EN_CH2_S 28 -/* RMT_MEM_SIZE_CH2 : R/W ;bitpos:[27:24] ;default: 4'h1 ; */ -/*description: This register is used to configure the the amount of memory blocks - allocated to channel2.*/ -#define RMT_MEM_SIZE_CH2 0x0000000F -#define RMT_MEM_SIZE_CH2_M ((RMT_MEM_SIZE_CH2_V)<<(RMT_MEM_SIZE_CH2_S)) -#define RMT_MEM_SIZE_CH2_V 0xF -#define RMT_MEM_SIZE_CH2_S 24 -/* RMT_IDLE_THRES_CH2 : R/W ;bitpos:[23:8] ;default: 16'h1000 ; */ -/*description: In receive mode when the counter's value is bigger than reg_idle_thres_ch2 - then the receive process is done.*/ -#define RMT_IDLE_THRES_CH2 0x0000FFFF -#define RMT_IDLE_THRES_CH2_M ((RMT_IDLE_THRES_CH2_V)<<(RMT_IDLE_THRES_CH2_S)) -#define RMT_IDLE_THRES_CH2_V 0xFFFF -#define RMT_IDLE_THRES_CH2_S 8 -/* RMT_DIV_CNT_CH2 : R/W ;bitpos:[7:0] ;default: 8'h2 ; */ -/*description: This register is used to configure the frequency divider's factor in channel2.*/ -#define RMT_DIV_CNT_CH2 0x000000FF -#define RMT_DIV_CNT_CH2_M ((RMT_DIV_CNT_CH2_V)<<(RMT_DIV_CNT_CH2_S)) -#define RMT_DIV_CNT_CH2_V 0xFF -#define RMT_DIV_CNT_CH2_S 0 - -#define RMT_CH2CONF1_REG (DR_REG_RMT_BASE + 0x0034) -/* RMT_IDLE_OUT_EN_CH2 : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: This is the output enable control bit for channel2 in IDLE state.*/ -#define RMT_IDLE_OUT_EN_CH2 (BIT(19)) -#define RMT_IDLE_OUT_EN_CH2_M (BIT(19)) -#define RMT_IDLE_OUT_EN_CH2_V 0x1 -#define RMT_IDLE_OUT_EN_CH2_S 19 -/* RMT_IDLE_OUT_LV_CH2 : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: This bit configures the output signal's level for channel2 in IDLE state.*/ -#define RMT_IDLE_OUT_LV_CH2 (BIT(18)) -#define RMT_IDLE_OUT_LV_CH2_M (BIT(18)) -#define RMT_IDLE_OUT_LV_CH2_V 0x1 -#define RMT_IDLE_OUT_LV_CH2_S 18 -/* RMT_REF_ALWAYS_ON_CH2 : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: This bit is used to select base clock. 1'b1:clk_apb 1'b0:clk_ref*/ -#define RMT_REF_ALWAYS_ON_CH2 (BIT(17)) -#define RMT_REF_ALWAYS_ON_CH2_M (BIT(17)) -#define RMT_REF_ALWAYS_ON_CH2_V 0x1 -#define RMT_REF_ALWAYS_ON_CH2_S 17 -/* RMT_REF_CNT_RST_CH2 : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: This bit is used to reset divider in channel2.*/ -#define RMT_REF_CNT_RST_CH2 (BIT(16)) -#define RMT_REF_CNT_RST_CH2_M (BIT(16)) -#define RMT_REF_CNT_RST_CH2_V 0x1 -#define RMT_REF_CNT_RST_CH2_S 16 -/* RMT_RX_FILTER_THRES_CH2 : R/W ;bitpos:[15:8] ;default: 8'hf ; */ -/*description: in receive mode channel2 ignore input pulse when the pulse width - is smaller then this value.*/ -#define RMT_RX_FILTER_THRES_CH2 0x000000FF -#define RMT_RX_FILTER_THRES_CH2_M ((RMT_RX_FILTER_THRES_CH2_V)<<(RMT_RX_FILTER_THRES_CH2_S)) -#define RMT_RX_FILTER_THRES_CH2_V 0xFF -#define RMT_RX_FILTER_THRES_CH2_S 8 -/* RMT_RX_FILTER_EN_CH2 : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: This is the receive filter enable bit for channel2.*/ -#define RMT_RX_FILTER_EN_CH2 (BIT(7)) -#define RMT_RX_FILTER_EN_CH2_M (BIT(7)) -#define RMT_RX_FILTER_EN_CH2_V 0x1 -#define RMT_RX_FILTER_EN_CH2_S 7 -/* RMT_TX_CONTI_MODE_CH2 : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: Set this bit to continue sending from the first data to the - last data in channel2.*/ -#define RMT_TX_CONTI_MODE_CH2 (BIT(6)) -#define RMT_TX_CONTI_MODE_CH2_M (BIT(6)) -#define RMT_TX_CONTI_MODE_CH2_V 0x1 -#define RMT_TX_CONTI_MODE_CH2_S 6 -/* RMT_MEM_OWNER_CH2 : R/W ;bitpos:[5] ;default: 1'b1 ; */ -/*description: This is the mark of channel2's ram usage right.1'b1:receiver - uses the ram 0:transmitter uses the ram*/ -#define RMT_MEM_OWNER_CH2 (BIT(5)) -#define RMT_MEM_OWNER_CH2_M (BIT(5)) -#define RMT_MEM_OWNER_CH2_V 0x1 -#define RMT_MEM_OWNER_CH2_S 5 -/* RMT_APB_MEM_RST_CH2 : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: Set this bit to reset W/R ram address for channel2 by apb fifo access*/ -#define RMT_APB_MEM_RST_CH2 (BIT(4)) -#define RMT_APB_MEM_RST_CH2_M (BIT(4)) -#define RMT_APB_MEM_RST_CH2_V 0x1 -#define RMT_APB_MEM_RST_CH2_S 4 -/* RMT_MEM_RD_RST_CH2 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: Set this bit to reset read ram address for channel2 by transmitter access.*/ -#define RMT_MEM_RD_RST_CH2 (BIT(3)) -#define RMT_MEM_RD_RST_CH2_M (BIT(3)) -#define RMT_MEM_RD_RST_CH2_V 0x1 -#define RMT_MEM_RD_RST_CH2_S 3 -/* RMT_MEM_WR_RST_CH2 : R/W ;bitpos:[2] ;default: 1'h0 ; */ -/*description: Set this bit to reset write ram address for channel2 by receiver access.*/ -#define RMT_MEM_WR_RST_CH2 (BIT(2)) -#define RMT_MEM_WR_RST_CH2_M (BIT(2)) -#define RMT_MEM_WR_RST_CH2_V 0x1 -#define RMT_MEM_WR_RST_CH2_S 2 -/* RMT_RX_EN_CH2 : R/W ;bitpos:[1] ;default: 1'h0 ; */ -/*description: Set this bit to enbale receving data for channel2.*/ -#define RMT_RX_EN_CH2 (BIT(1)) -#define RMT_RX_EN_CH2_M (BIT(1)) -#define RMT_RX_EN_CH2_V 0x1 -#define RMT_RX_EN_CH2_S 1 -/* RMT_TX_START_CH2 : R/W ;bitpos:[0] ;default: 1'h0 ; */ -/*description: Set this bit to start sending data for channel2.*/ -#define RMT_TX_START_CH2 (BIT(0)) -#define RMT_TX_START_CH2_M (BIT(0)) -#define RMT_TX_START_CH2_V 0x1 -#define RMT_TX_START_CH2_S 0 - -#define RMT_CH3CONF0_REG (DR_REG_RMT_BASE + 0x0038) -/* RMT_CARRIER_OUT_LV_CH3 : R/W ;bitpos:[29] ;default: 1'b1 ; */ -/*description: This bit is used to configure carrier wave's position for channel3.1'b1:add - on low level 1'b0:add on high level.*/ -#define RMT_CARRIER_OUT_LV_CH3 (BIT(29)) -#define RMT_CARRIER_OUT_LV_CH3_M (BIT(29)) -#define RMT_CARRIER_OUT_LV_CH3_V 0x1 -#define RMT_CARRIER_OUT_LV_CH3_S 29 -/* RMT_CARRIER_EN_CH3 : R/W ;bitpos:[28] ;default: 1'b1 ; */ -/*description: This is the carrier modulation enable control bit for channel3.*/ -#define RMT_CARRIER_EN_CH3 (BIT(28)) -#define RMT_CARRIER_EN_CH3_M (BIT(28)) -#define RMT_CARRIER_EN_CH3_V 0x1 -#define RMT_CARRIER_EN_CH3_S 28 -/* RMT_MEM_SIZE_CH3 : R/W ;bitpos:[27:24] ;default: 4'h1 ; */ -/*description: This register is used to configure the the amount of memory blocks - allocated to channel3.*/ -#define RMT_MEM_SIZE_CH3 0x0000000F -#define RMT_MEM_SIZE_CH3_M ((RMT_MEM_SIZE_CH3_V)<<(RMT_MEM_SIZE_CH3_S)) -#define RMT_MEM_SIZE_CH3_V 0xF -#define RMT_MEM_SIZE_CH3_S 24 -/* RMT_IDLE_THRES_CH3 : R/W ;bitpos:[23:8] ;default: 16'h1000 ; */ -/*description: In receive mode when the counter's value is bigger than reg_idle_thres_ch3 - then the receive process is done.*/ -#define RMT_IDLE_THRES_CH3 0x0000FFFF -#define RMT_IDLE_THRES_CH3_M ((RMT_IDLE_THRES_CH3_V)<<(RMT_IDLE_THRES_CH3_S)) -#define RMT_IDLE_THRES_CH3_V 0xFFFF -#define RMT_IDLE_THRES_CH3_S 8 -/* RMT_DIV_CNT_CH3 : R/W ;bitpos:[7:0] ;default: 8'h2 ; */ -/*description: This register is used to configure the frequency divider's factor in channel3.*/ -#define RMT_DIV_CNT_CH3 0x000000FF -#define RMT_DIV_CNT_CH3_M ((RMT_DIV_CNT_CH3_V)<<(RMT_DIV_CNT_CH3_S)) -#define RMT_DIV_CNT_CH3_V 0xFF -#define RMT_DIV_CNT_CH3_S 0 - -#define RMT_CH3CONF1_REG (DR_REG_RMT_BASE + 0x003c) -/* RMT_IDLE_OUT_EN_CH3 : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: This is the output enable control bit for channel3 in IDLE state.*/ -#define RMT_IDLE_OUT_EN_CH3 (BIT(19)) -#define RMT_IDLE_OUT_EN_CH3_M (BIT(19)) -#define RMT_IDLE_OUT_EN_CH3_V 0x1 -#define RMT_IDLE_OUT_EN_CH3_S 19 -/* RMT_IDLE_OUT_LV_CH3 : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: This bit configures the output signal's level for channel3 in IDLE state.*/ -#define RMT_IDLE_OUT_LV_CH3 (BIT(18)) -#define RMT_IDLE_OUT_LV_CH3_M (BIT(18)) -#define RMT_IDLE_OUT_LV_CH3_V 0x1 -#define RMT_IDLE_OUT_LV_CH3_S 18 -/* RMT_REF_ALWAYS_ON_CH3 : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: This bit is used to select base clock. 1'b1:clk_apb 1'b0:clk_ref*/ -#define RMT_REF_ALWAYS_ON_CH3 (BIT(17)) -#define RMT_REF_ALWAYS_ON_CH3_M (BIT(17)) -#define RMT_REF_ALWAYS_ON_CH3_V 0x1 -#define RMT_REF_ALWAYS_ON_CH3_S 17 -/* RMT_REF_CNT_RST_CH3 : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: This bit is used to reset divider in channel3.*/ -#define RMT_REF_CNT_RST_CH3 (BIT(16)) -#define RMT_REF_CNT_RST_CH3_M (BIT(16)) -#define RMT_REF_CNT_RST_CH3_V 0x1 -#define RMT_REF_CNT_RST_CH3_S 16 -/* RMT_RX_FILTER_THRES_CH3 : R/W ;bitpos:[15:8] ;default: 8'hf ; */ -/*description: in receive mode channel3 ignore input pulse when the pulse width - is smaller then this value.*/ -#define RMT_RX_FILTER_THRES_CH3 0x000000FF -#define RMT_RX_FILTER_THRES_CH3_M ((RMT_RX_FILTER_THRES_CH3_V)<<(RMT_RX_FILTER_THRES_CH3_S)) -#define RMT_RX_FILTER_THRES_CH3_V 0xFF -#define RMT_RX_FILTER_THRES_CH3_S 8 -/* RMT_RX_FILTER_EN_CH3 : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: This is the receive filter enable bit for channel3.*/ -#define RMT_RX_FILTER_EN_CH3 (BIT(7)) -#define RMT_RX_FILTER_EN_CH3_M (BIT(7)) -#define RMT_RX_FILTER_EN_CH3_V 0x1 -#define RMT_RX_FILTER_EN_CH3_S 7 -/* RMT_TX_CONTI_MODE_CH3 : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: Set this bit to continue sending from the first data to the - last data in channel3.*/ -#define RMT_TX_CONTI_MODE_CH3 (BIT(6)) -#define RMT_TX_CONTI_MODE_CH3_M (BIT(6)) -#define RMT_TX_CONTI_MODE_CH3_V 0x1 -#define RMT_TX_CONTI_MODE_CH3_S 6 -/* RMT_MEM_OWNER_CH3 : R/W ;bitpos:[5] ;default: 1'b1 ; */ -/*description: This is the mark of channel3's ram usage right.1'b1:receiver - uses the ram 0:transmitter uses the ram*/ -#define RMT_MEM_OWNER_CH3 (BIT(5)) -#define RMT_MEM_OWNER_CH3_M (BIT(5)) -#define RMT_MEM_OWNER_CH3_V 0x1 -#define RMT_MEM_OWNER_CH3_S 5 -/* RMT_APB_MEM_RST_CH3 : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: Set this bit to reset W/R ram address for channel3 by apb fifo access*/ -#define RMT_APB_MEM_RST_CH3 (BIT(4)) -#define RMT_APB_MEM_RST_CH3_M (BIT(4)) -#define RMT_APB_MEM_RST_CH3_V 0x1 -#define RMT_APB_MEM_RST_CH3_S 4 -/* RMT_MEM_RD_RST_CH3 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: Set this bit to reset read ram address for channel3 by transmitter access.*/ -#define RMT_MEM_RD_RST_CH3 (BIT(3)) -#define RMT_MEM_RD_RST_CH3_M (BIT(3)) -#define RMT_MEM_RD_RST_CH3_V 0x1 -#define RMT_MEM_RD_RST_CH3_S 3 -/* RMT_MEM_WR_RST_CH3 : R/W ;bitpos:[2] ;default: 1'h0 ; */ -/*description: Set this bit to reset write ram address for channel3 by receiver access.*/ -#define RMT_MEM_WR_RST_CH3 (BIT(2)) -#define RMT_MEM_WR_RST_CH3_M (BIT(2)) -#define RMT_MEM_WR_RST_CH3_V 0x1 -#define RMT_MEM_WR_RST_CH3_S 2 -/* RMT_RX_EN_CH3 : R/W ;bitpos:[1] ;default: 1'h0 ; */ -/*description: Set this bit to enbale receving data for channel3.*/ -#define RMT_RX_EN_CH3 (BIT(1)) -#define RMT_RX_EN_CH3_M (BIT(1)) -#define RMT_RX_EN_CH3_V 0x1 -#define RMT_RX_EN_CH3_S 1 -/* RMT_TX_START_CH3 : R/W ;bitpos:[0] ;default: 1'h0 ; */ -/*description: Set this bit to start sending data for channel3.*/ -#define RMT_TX_START_CH3 (BIT(0)) -#define RMT_TX_START_CH3_M (BIT(0)) -#define RMT_TX_START_CH3_V 0x1 -#define RMT_TX_START_CH3_S 0 - -#define RMT_CH4CONF0_REG (DR_REG_RMT_BASE + 0x0040) -/* RMT_CARRIER_OUT_LV_CH4 : R/W ;bitpos:[29] ;default: 1'b1 ; */ -/*description: This bit is used to configure carrier wave's position for channel4.1'b1:add - on low level 1'b0:add on high level.*/ -#define RMT_CARRIER_OUT_LV_CH4 (BIT(29)) -#define RMT_CARRIER_OUT_LV_CH4_M (BIT(29)) -#define RMT_CARRIER_OUT_LV_CH4_V 0x1 -#define RMT_CARRIER_OUT_LV_CH4_S 29 -/* RMT_CARRIER_EN_CH4 : R/W ;bitpos:[28] ;default: 1'b1 ; */ -/*description: This is the carrier modulation enable control bit for channel4.*/ -#define RMT_CARRIER_EN_CH4 (BIT(28)) -#define RMT_CARRIER_EN_CH4_M (BIT(28)) -#define RMT_CARRIER_EN_CH4_V 0x1 -#define RMT_CARRIER_EN_CH4_S 28 -/* RMT_MEM_SIZE_CH4 : R/W ;bitpos:[27:24] ;default: 4'h1 ; */ -/*description: This register is used to configure the the amount of memory blocks - allocated to channel4.*/ -#define RMT_MEM_SIZE_CH4 0x0000000F -#define RMT_MEM_SIZE_CH4_M ((RMT_MEM_SIZE_CH4_V)<<(RMT_MEM_SIZE_CH4_S)) -#define RMT_MEM_SIZE_CH4_V 0xF -#define RMT_MEM_SIZE_CH4_S 24 -/* RMT_IDLE_THRES_CH4 : R/W ;bitpos:[23:8] ;default: 16'h1000 ; */ -/*description: In receive mode when the counter's value is bigger than reg_idle_thres_ch4 - then the receive process is done.*/ -#define RMT_IDLE_THRES_CH4 0x0000FFFF -#define RMT_IDLE_THRES_CH4_M ((RMT_IDLE_THRES_CH4_V)<<(RMT_IDLE_THRES_CH4_S)) -#define RMT_IDLE_THRES_CH4_V 0xFFFF -#define RMT_IDLE_THRES_CH4_S 8 -/* RMT_DIV_CNT_CH4 : R/W ;bitpos:[7:0] ;default: 8'h2 ; */ -/*description: This register is used to configure the frequency divider's factor in channel4.*/ -#define RMT_DIV_CNT_CH4 0x000000FF -#define RMT_DIV_CNT_CH4_M ((RMT_DIV_CNT_CH4_V)<<(RMT_DIV_CNT_CH4_S)) -#define RMT_DIV_CNT_CH4_V 0xFF -#define RMT_DIV_CNT_CH4_S 0 - -#define RMT_CH4CONF1_REG (DR_REG_RMT_BASE + 0x0044) -/* RMT_IDLE_OUT_EN_CH4 : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: This is the output enable control bit for channel4 in IDLE state.*/ -#define RMT_IDLE_OUT_EN_CH4 (BIT(19)) -#define RMT_IDLE_OUT_EN_CH4_M (BIT(19)) -#define RMT_IDLE_OUT_EN_CH4_V 0x1 -#define RMT_IDLE_OUT_EN_CH4_S 19 -/* RMT_IDLE_OUT_LV_CH4 : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: This bit configures the output signal's level for channel4 in IDLE state.*/ -#define RMT_IDLE_OUT_LV_CH4 (BIT(18)) -#define RMT_IDLE_OUT_LV_CH4_M (BIT(18)) -#define RMT_IDLE_OUT_LV_CH4_V 0x1 -#define RMT_IDLE_OUT_LV_CH4_S 18 -/* RMT_REF_ALWAYS_ON_CH4 : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: This bit is used to select base clock. 1'b1:clk_apb 1'b0:clk_ref*/ -#define RMT_REF_ALWAYS_ON_CH4 (BIT(17)) -#define RMT_REF_ALWAYS_ON_CH4_M (BIT(17)) -#define RMT_REF_ALWAYS_ON_CH4_V 0x1 -#define RMT_REF_ALWAYS_ON_CH4_S 17 -/* RMT_REF_CNT_RST_CH4 : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: This bit is used to reset divider in channel4.*/ -#define RMT_REF_CNT_RST_CH4 (BIT(16)) -#define RMT_REF_CNT_RST_CH4_M (BIT(16)) -#define RMT_REF_CNT_RST_CH4_V 0x1 -#define RMT_REF_CNT_RST_CH4_S 16 -/* RMT_RX_FILTER_THRES_CH4 : R/W ;bitpos:[15:8] ;default: 8'hf ; */ -/*description: in receive mode channel4 ignore input pulse when the pulse width - is smaller then this value.*/ -#define RMT_RX_FILTER_THRES_CH4 0x000000FF -#define RMT_RX_FILTER_THRES_CH4_M ((RMT_RX_FILTER_THRES_CH4_V)<<(RMT_RX_FILTER_THRES_CH4_S)) -#define RMT_RX_FILTER_THRES_CH4_V 0xFF -#define RMT_RX_FILTER_THRES_CH4_S 8 -/* RMT_RX_FILTER_EN_CH4 : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: This is the receive filter enable bit for channel4.*/ -#define RMT_RX_FILTER_EN_CH4 (BIT(7)) -#define RMT_RX_FILTER_EN_CH4_M (BIT(7)) -#define RMT_RX_FILTER_EN_CH4_V 0x1 -#define RMT_RX_FILTER_EN_CH4_S 7 -/* RMT_TX_CONTI_MODE_CH4 : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: Set this bit to continue sending from the first data to the - last data in channel4.*/ -#define RMT_TX_CONTI_MODE_CH4 (BIT(6)) -#define RMT_TX_CONTI_MODE_CH4_M (BIT(6)) -#define RMT_TX_CONTI_MODE_CH4_V 0x1 -#define RMT_TX_CONTI_MODE_CH4_S 6 -/* RMT_MEM_OWNER_CH4 : R/W ;bitpos:[5] ;default: 1'b1 ; */ -/*description: This is the mark of channel4's ram usage right.1'b1:receiver - uses the ram 0:transmitter uses the ram*/ -#define RMT_MEM_OWNER_CH4 (BIT(5)) -#define RMT_MEM_OWNER_CH4_M (BIT(5)) -#define RMT_MEM_OWNER_CH4_V 0x1 -#define RMT_MEM_OWNER_CH4_S 5 -/* RMT_APB_MEM_RST_CH4 : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: Set this bit to reset W/R ram address for channel4 by apb fifo access*/ -#define RMT_APB_MEM_RST_CH4 (BIT(4)) -#define RMT_APB_MEM_RST_CH4_M (BIT(4)) -#define RMT_APB_MEM_RST_CH4_V 0x1 -#define RMT_APB_MEM_RST_CH4_S 4 -/* RMT_MEM_RD_RST_CH4 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: Set this bit to reset read ram address for channel4 by transmitter access.*/ -#define RMT_MEM_RD_RST_CH4 (BIT(3)) -#define RMT_MEM_RD_RST_CH4_M (BIT(3)) -#define RMT_MEM_RD_RST_CH4_V 0x1 -#define RMT_MEM_RD_RST_CH4_S 3 -/* RMT_MEM_WR_RST_CH4 : R/W ;bitpos:[2] ;default: 1'h0 ; */ -/*description: Set this bit to reset write ram address for channel4 by receiver access.*/ -#define RMT_MEM_WR_RST_CH4 (BIT(2)) -#define RMT_MEM_WR_RST_CH4_M (BIT(2)) -#define RMT_MEM_WR_RST_CH4_V 0x1 -#define RMT_MEM_WR_RST_CH4_S 2 -/* RMT_RX_EN_CH4 : R/W ;bitpos:[1] ;default: 1'h0 ; */ -/*description: Set this bit to enbale receving data for channel4.*/ -#define RMT_RX_EN_CH4 (BIT(1)) -#define RMT_RX_EN_CH4_M (BIT(1)) -#define RMT_RX_EN_CH4_V 0x1 -#define RMT_RX_EN_CH4_S 1 -/* RMT_TX_START_CH4 : R/W ;bitpos:[0] ;default: 1'h0 ; */ -/*description: Set this bit to start sending data for channel4.*/ -#define RMT_TX_START_CH4 (BIT(0)) -#define RMT_TX_START_CH4_M (BIT(0)) -#define RMT_TX_START_CH4_V 0x1 -#define RMT_TX_START_CH4_S 0 - -#define RMT_CH5CONF0_REG (DR_REG_RMT_BASE + 0x0048) -/* RMT_CARRIER_OUT_LV_CH5 : R/W ;bitpos:[29] ;default: 1'b1 ; */ -/*description: This bit is used to configure carrier wave's position for channel5.1'b1:add - on low level 1'b0:add on high level.*/ -#define RMT_CARRIER_OUT_LV_CH5 (BIT(29)) -#define RMT_CARRIER_OUT_LV_CH5_M (BIT(29)) -#define RMT_CARRIER_OUT_LV_CH5_V 0x1 -#define RMT_CARRIER_OUT_LV_CH5_S 29 -/* RMT_CARRIER_EN_CH5 : R/W ;bitpos:[28] ;default: 1'b1 ; */ -/*description: This is the carrier modulation enable control bit for channel5.*/ -#define RMT_CARRIER_EN_CH5 (BIT(28)) -#define RMT_CARRIER_EN_CH5_M (BIT(28)) -#define RMT_CARRIER_EN_CH5_V 0x1 -#define RMT_CARRIER_EN_CH5_S 28 -/* RMT_MEM_SIZE_CH5 : R/W ;bitpos:[27:24] ;default: 4'h1 ; */ -/*description: This register is used to configure the the amount of memory blocks - allocated to channel5.*/ -#define RMT_MEM_SIZE_CH5 0x0000000F -#define RMT_MEM_SIZE_CH5_M ((RMT_MEM_SIZE_CH5_V)<<(RMT_MEM_SIZE_CH5_S)) -#define RMT_MEM_SIZE_CH5_V 0xF -#define RMT_MEM_SIZE_CH5_S 24 -/* RMT_IDLE_THRES_CH5 : R/W ;bitpos:[23:8] ;default: 16'h1000 ; */ -/*description: In receive mode when the counter's value is bigger than reg_idle_thres_ch5 - then the receive process is done.*/ -#define RMT_IDLE_THRES_CH5 0x0000FFFF -#define RMT_IDLE_THRES_CH5_M ((RMT_IDLE_THRES_CH5_V)<<(RMT_IDLE_THRES_CH5_S)) -#define RMT_IDLE_THRES_CH5_V 0xFFFF -#define RMT_IDLE_THRES_CH5_S 8 -/* RMT_DIV_CNT_CH5 : R/W ;bitpos:[7:0] ;default: 8'h2 ; */ -/*description: This register is used to configure the frequency divider's factor in channel5.*/ -#define RMT_DIV_CNT_CH5 0x000000FF -#define RMT_DIV_CNT_CH5_M ((RMT_DIV_CNT_CH5_V)<<(RMT_DIV_CNT_CH5_S)) -#define RMT_DIV_CNT_CH5_V 0xFF -#define RMT_DIV_CNT_CH5_S 0 - -#define RMT_CH5CONF1_REG (DR_REG_RMT_BASE + 0x004c) -/* RMT_IDLE_OUT_EN_CH5 : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: This is the output enable control bit for channel5 in IDLE state.*/ -#define RMT_IDLE_OUT_EN_CH5 (BIT(19)) -#define RMT_IDLE_OUT_EN_CH5_M (BIT(19)) -#define RMT_IDLE_OUT_EN_CH5_V 0x1 -#define RMT_IDLE_OUT_EN_CH5_S 19 -/* RMT_IDLE_OUT_LV_CH5 : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: This bit configures the output signal's level for channel5 in IDLE state.*/ -#define RMT_IDLE_OUT_LV_CH5 (BIT(18)) -#define RMT_IDLE_OUT_LV_CH5_M (BIT(18)) -#define RMT_IDLE_OUT_LV_CH5_V 0x1 -#define RMT_IDLE_OUT_LV_CH5_S 18 -/* RMT_REF_ALWAYS_ON_CH5 : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: This bit is used to select base clock. 1'b1:clk_apb 1'b0:clk_ref*/ -#define RMT_REF_ALWAYS_ON_CH5 (BIT(17)) -#define RMT_REF_ALWAYS_ON_CH5_M (BIT(17)) -#define RMT_REF_ALWAYS_ON_CH5_V 0x1 -#define RMT_REF_ALWAYS_ON_CH5_S 17 -/* RMT_REF_CNT_RST_CH5 : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: This bit is used to reset divider in channel5.*/ -#define RMT_REF_CNT_RST_CH5 (BIT(16)) -#define RMT_REF_CNT_RST_CH5_M (BIT(16)) -#define RMT_REF_CNT_RST_CH5_V 0x1 -#define RMT_REF_CNT_RST_CH5_S 16 -/* RMT_RX_FILTER_THRES_CH5 : R/W ;bitpos:[15:8] ;default: 8'hf ; */ -/*description: in receive mode channel5 ignore input pulse when the pulse width - is smaller then this value.*/ -#define RMT_RX_FILTER_THRES_CH5 0x000000FF -#define RMT_RX_FILTER_THRES_CH5_M ((RMT_RX_FILTER_THRES_CH5_V)<<(RMT_RX_FILTER_THRES_CH5_S)) -#define RMT_RX_FILTER_THRES_CH5_V 0xFF -#define RMT_RX_FILTER_THRES_CH5_S 8 -/* RMT_RX_FILTER_EN_CH5 : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: This is the receive filter enable bit for channel5.*/ -#define RMT_RX_FILTER_EN_CH5 (BIT(7)) -#define RMT_RX_FILTER_EN_CH5_M (BIT(7)) -#define RMT_RX_FILTER_EN_CH5_V 0x1 -#define RMT_RX_FILTER_EN_CH5_S 7 -/* RMT_TX_CONTI_MODE_CH5 : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: Set this bit to continue sending from the first data to the - last data in channel5.*/ -#define RMT_TX_CONTI_MODE_CH5 (BIT(6)) -#define RMT_TX_CONTI_MODE_CH5_M (BIT(6)) -#define RMT_TX_CONTI_MODE_CH5_V 0x1 -#define RMT_TX_CONTI_MODE_CH5_S 6 -/* RMT_MEM_OWNER_CH5 : R/W ;bitpos:[5] ;default: 1'b1 ; */ -/*description: This is the mark of channel5's ram usage right.1'b1:receiver - uses the ram 0:transmitter uses the ram*/ -#define RMT_MEM_OWNER_CH5 (BIT(5)) -#define RMT_MEM_OWNER_CH5_M (BIT(5)) -#define RMT_MEM_OWNER_CH5_V 0x1 -#define RMT_MEM_OWNER_CH5_S 5 -/* RMT_APB_MEM_RST_CH5 : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: Set this bit to reset W/R ram address for channel5 by apb fifo access*/ -#define RMT_APB_MEM_RST_CH5 (BIT(4)) -#define RMT_APB_MEM_RST_CH5_M (BIT(4)) -#define RMT_APB_MEM_RST_CH5_V 0x1 -#define RMT_APB_MEM_RST_CH5_S 4 -/* RMT_MEM_RD_RST_CH5 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: Set this bit to reset read ram address for channel5 by transmitter access.*/ -#define RMT_MEM_RD_RST_CH5 (BIT(3)) -#define RMT_MEM_RD_RST_CH5_M (BIT(3)) -#define RMT_MEM_RD_RST_CH5_V 0x1 -#define RMT_MEM_RD_RST_CH5_S 3 -/* RMT_MEM_WR_RST_CH5 : R/W ;bitpos:[2] ;default: 1'h0 ; */ -/*description: Set this bit to reset write ram address for channel5 by receiver access.*/ -#define RMT_MEM_WR_RST_CH5 (BIT(2)) -#define RMT_MEM_WR_RST_CH5_M (BIT(2)) -#define RMT_MEM_WR_RST_CH5_V 0x1 -#define RMT_MEM_WR_RST_CH5_S 2 -/* RMT_RX_EN_CH5 : R/W ;bitpos:[1] ;default: 1'h0 ; */ -/*description: Set this bit to enbale receving data for channel5.*/ -#define RMT_RX_EN_CH5 (BIT(1)) -#define RMT_RX_EN_CH5_M (BIT(1)) -#define RMT_RX_EN_CH5_V 0x1 -#define RMT_RX_EN_CH5_S 1 -/* RMT_TX_START_CH5 : R/W ;bitpos:[0] ;default: 1'h0 ; */ -/*description: Set this bit to start sending data for channel5.*/ -#define RMT_TX_START_CH5 (BIT(0)) -#define RMT_TX_START_CH5_M (BIT(0)) -#define RMT_TX_START_CH5_V 0x1 -#define RMT_TX_START_CH5_S 0 - -#define RMT_CH6CONF0_REG (DR_REG_RMT_BASE + 0x0050) -/* RMT_CARRIER_OUT_LV_CH6 : R/W ;bitpos:[29] ;default: 1'b1 ; */ -/*description: This bit is used to configure carrier wave's position for channel6.1'b1:add - on low level 1'b0:add on high level.*/ -#define RMT_CARRIER_OUT_LV_CH6 (BIT(29)) -#define RMT_CARRIER_OUT_LV_CH6_M (BIT(29)) -#define RMT_CARRIER_OUT_LV_CH6_V 0x1 -#define RMT_CARRIER_OUT_LV_CH6_S 29 -/* RMT_CARRIER_EN_CH6 : R/W ;bitpos:[28] ;default: 1'b1 ; */ -/*description: This is the carrier modulation enable control bit for channel6.*/ -#define RMT_CARRIER_EN_CH6 (BIT(28)) -#define RMT_CARRIER_EN_CH6_M (BIT(28)) -#define RMT_CARRIER_EN_CH6_V 0x1 -#define RMT_CARRIER_EN_CH6_S 28 -/* RMT_MEM_SIZE_CH6 : R/W ;bitpos:[27:24] ;default: 4'h1 ; */ -/*description: This register is used to configure the the amount of memory blocks - allocated to channel6.*/ -#define RMT_MEM_SIZE_CH6 0x0000000F -#define RMT_MEM_SIZE_CH6_M ((RMT_MEM_SIZE_CH6_V)<<(RMT_MEM_SIZE_CH6_S)) -#define RMT_MEM_SIZE_CH6_V 0xF -#define RMT_MEM_SIZE_CH6_S 24 -/* RMT_IDLE_THRES_CH6 : R/W ;bitpos:[23:8] ;default: 16'h1000 ; */ -/*description: In receive mode when the counter's value is bigger than reg_idle_thres_ch6 - then the receive process is done.*/ -#define RMT_IDLE_THRES_CH6 0x0000FFFF -#define RMT_IDLE_THRES_CH6_M ((RMT_IDLE_THRES_CH6_V)<<(RMT_IDLE_THRES_CH6_S)) -#define RMT_IDLE_THRES_CH6_V 0xFFFF -#define RMT_IDLE_THRES_CH6_S 8 -/* RMT_DIV_CNT_CH6 : R/W ;bitpos:[7:0] ;default: 8'h2 ; */ -/*description: This register is used to configure the frequency divider's factor in channel6.*/ -#define RMT_DIV_CNT_CH6 0x000000FF -#define RMT_DIV_CNT_CH6_M ((RMT_DIV_CNT_CH6_V)<<(RMT_DIV_CNT_CH6_S)) -#define RMT_DIV_CNT_CH6_V 0xFF -#define RMT_DIV_CNT_CH6_S 0 - -#define RMT_CH6CONF1_REG (DR_REG_RMT_BASE + 0x0054) -/* RMT_IDLE_OUT_EN_CH6 : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: This is the output enable control bit for channel6 in IDLE state.*/ -#define RMT_IDLE_OUT_EN_CH6 (BIT(19)) -#define RMT_IDLE_OUT_EN_CH6_M (BIT(19)) -#define RMT_IDLE_OUT_EN_CH6_V 0x1 -#define RMT_IDLE_OUT_EN_CH6_S 19 -/* RMT_IDLE_OUT_LV_CH6 : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: This bit configures the output signal's level for channel6 in IDLE state.*/ -#define RMT_IDLE_OUT_LV_CH6 (BIT(18)) -#define RMT_IDLE_OUT_LV_CH6_M (BIT(18)) -#define RMT_IDLE_OUT_LV_CH6_V 0x1 -#define RMT_IDLE_OUT_LV_CH6_S 18 -/* RMT_REF_ALWAYS_ON_CH6 : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: This bit is used to select base clock. 1'b1:clk_apb 1'b0:clk_ref*/ -#define RMT_REF_ALWAYS_ON_CH6 (BIT(17)) -#define RMT_REF_ALWAYS_ON_CH6_M (BIT(17)) -#define RMT_REF_ALWAYS_ON_CH6_V 0x1 -#define RMT_REF_ALWAYS_ON_CH6_S 17 -/* RMT_REF_CNT_RST_CH6 : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: This bit is used to reset divider in channel6.*/ -#define RMT_REF_CNT_RST_CH6 (BIT(16)) -#define RMT_REF_CNT_RST_CH6_M (BIT(16)) -#define RMT_REF_CNT_RST_CH6_V 0x1 -#define RMT_REF_CNT_RST_CH6_S 16 -/* RMT_RX_FILTER_THRES_CH6 : R/W ;bitpos:[15:8] ;default: 8'hf ; */ -/*description: in receive mode channel6 ignore input pulse when the pulse width - is smaller then this value.*/ -#define RMT_RX_FILTER_THRES_CH6 0x000000FF -#define RMT_RX_FILTER_THRES_CH6_M ((RMT_RX_FILTER_THRES_CH6_V)<<(RMT_RX_FILTER_THRES_CH6_S)) -#define RMT_RX_FILTER_THRES_CH6_V 0xFF -#define RMT_RX_FILTER_THRES_CH6_S 8 -/* RMT_RX_FILTER_EN_CH6 : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: This is the receive filter enable bit for channel6.*/ -#define RMT_RX_FILTER_EN_CH6 (BIT(7)) -#define RMT_RX_FILTER_EN_CH6_M (BIT(7)) -#define RMT_RX_FILTER_EN_CH6_V 0x1 -#define RMT_RX_FILTER_EN_CH6_S 7 -/* RMT_TX_CONTI_MODE_CH6 : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: Set this bit to continue sending from the first data to the - last data in channel6.*/ -#define RMT_TX_CONTI_MODE_CH6 (BIT(6)) -#define RMT_TX_CONTI_MODE_CH6_M (BIT(6)) -#define RMT_TX_CONTI_MODE_CH6_V 0x1 -#define RMT_TX_CONTI_MODE_CH6_S 6 -/* RMT_MEM_OWNER_CH6 : R/W ;bitpos:[5] ;default: 1'b1 ; */ -/*description: This is the mark of channel6's ram usage right.1'b1:receiver - uses the ram 0:transmitter uses the ram*/ -#define RMT_MEM_OWNER_CH6 (BIT(5)) -#define RMT_MEM_OWNER_CH6_M (BIT(5)) -#define RMT_MEM_OWNER_CH6_V 0x1 -#define RMT_MEM_OWNER_CH6_S 5 -/* RMT_APB_MEM_RST_CH6 : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: Set this bit to reset W/R ram address for channel6 by apb fifo access*/ -#define RMT_APB_MEM_RST_CH6 (BIT(4)) -#define RMT_APB_MEM_RST_CH6_M (BIT(4)) -#define RMT_APB_MEM_RST_CH6_V 0x1 -#define RMT_APB_MEM_RST_CH6_S 4 -/* RMT_MEM_RD_RST_CH6 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: Set this bit to reset read ram address for channel6 by transmitter access.*/ -#define RMT_MEM_RD_RST_CH6 (BIT(3)) -#define RMT_MEM_RD_RST_CH6_M (BIT(3)) -#define RMT_MEM_RD_RST_CH6_V 0x1 -#define RMT_MEM_RD_RST_CH6_S 3 -/* RMT_MEM_WR_RST_CH6 : R/W ;bitpos:[2] ;default: 1'h0 ; */ -/*description: Set this bit to reset write ram address for channel6 by receiver access.*/ -#define RMT_MEM_WR_RST_CH6 (BIT(2)) -#define RMT_MEM_WR_RST_CH6_M (BIT(2)) -#define RMT_MEM_WR_RST_CH6_V 0x1 -#define RMT_MEM_WR_RST_CH6_S 2 -/* RMT_RX_EN_CH6 : R/W ;bitpos:[1] ;default: 1'h0 ; */ -/*description: Set this bit to enbale receving data for channel6.*/ -#define RMT_RX_EN_CH6 (BIT(1)) -#define RMT_RX_EN_CH6_M (BIT(1)) -#define RMT_RX_EN_CH6_V 0x1 -#define RMT_RX_EN_CH6_S 1 -/* RMT_TX_START_CH6 : R/W ;bitpos:[0] ;default: 1'h0 ; */ -/*description: Set this bit to start sending data for channel6.*/ -#define RMT_TX_START_CH6 (BIT(0)) -#define RMT_TX_START_CH6_M (BIT(0)) -#define RMT_TX_START_CH6_V 0x1 -#define RMT_TX_START_CH6_S 0 - -#define RMT_CH7CONF0_REG (DR_REG_RMT_BASE + 0x0058) -/* RMT_CARRIER_OUT_LV_CH7 : R/W ;bitpos:[29] ;default: 1'b1 ; */ -/*description: This bit is used to configure carrier wave's position for channel7.1'b1:add - on low level 1'b0:add on high level.*/ -#define RMT_CARRIER_OUT_LV_CH7 (BIT(29)) -#define RMT_CARRIER_OUT_LV_CH7_M (BIT(29)) -#define RMT_CARRIER_OUT_LV_CH7_V 0x1 -#define RMT_CARRIER_OUT_LV_CH7_S 29 -/* RMT_CARRIER_EN_CH7 : R/W ;bitpos:[28] ;default: 1'b1 ; */ -/*description: This is the carrier modulation enable control bit for channel7.*/ -#define RMT_CARRIER_EN_CH7 (BIT(28)) -#define RMT_CARRIER_EN_CH7_M (BIT(28)) -#define RMT_CARRIER_EN_CH7_V 0x1 -#define RMT_CARRIER_EN_CH7_S 28 -/* RMT_MEM_SIZE_CH7 : R/W ;bitpos:[27:24] ;default: 4'h1 ; */ -/*description: This register is used to configure the the amount of memory blocks - allocated to channel7.*/ -#define RMT_MEM_SIZE_CH7 0x0000000F -#define RMT_MEM_SIZE_CH7_M ((RMT_MEM_SIZE_CH7_V)<<(RMT_MEM_SIZE_CH7_S)) -#define RMT_MEM_SIZE_CH7_V 0xF -#define RMT_MEM_SIZE_CH7_S 24 -/* RMT_IDLE_THRES_CH7 : R/W ;bitpos:[23:8] ;default: 16'h1000 ; */ -/*description: In receive mode when the counter's value is bigger than reg_idle_thres_ch7 - then the receive process is done.*/ -#define RMT_IDLE_THRES_CH7 0x0000FFFF -#define RMT_IDLE_THRES_CH7_M ((RMT_IDLE_THRES_CH7_V)<<(RMT_IDLE_THRES_CH7_S)) -#define RMT_IDLE_THRES_CH7_V 0xFFFF -#define RMT_IDLE_THRES_CH7_S 8 -/* RMT_DIV_CNT_CH7 : R/W ;bitpos:[7:0] ;default: 8'h2 ; */ -/*description: This register is used to configure the frequency divider's factor in channel7.*/ -#define RMT_DIV_CNT_CH7 0x000000FF -#define RMT_DIV_CNT_CH7_M ((RMT_DIV_CNT_CH7_V)<<(RMT_DIV_CNT_CH7_S)) -#define RMT_DIV_CNT_CH7_V 0xFF -#define RMT_DIV_CNT_CH7_S 0 - -#define RMT_CH7CONF1_REG (DR_REG_RMT_BASE + 0x005c) -/* RMT_IDLE_OUT_EN_CH7 : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: This is the output enable control bit for channel6 in IDLE state.*/ -#define RMT_IDLE_OUT_EN_CH7 (BIT(19)) -#define RMT_IDLE_OUT_EN_CH7_M (BIT(19)) -#define RMT_IDLE_OUT_EN_CH7_V 0x1 -#define RMT_IDLE_OUT_EN_CH7_S 19 -/* RMT_IDLE_OUT_LV_CH7 : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: This bit configures the output signal's level for channel7 in IDLE state.*/ -#define RMT_IDLE_OUT_LV_CH7 (BIT(18)) -#define RMT_IDLE_OUT_LV_CH7_M (BIT(18)) -#define RMT_IDLE_OUT_LV_CH7_V 0x1 -#define RMT_IDLE_OUT_LV_CH7_S 18 -/* RMT_REF_ALWAYS_ON_CH7 : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: This bit is used to select base clock. 1'b1:clk_apb 1'b0:clk_ref*/ -#define RMT_REF_ALWAYS_ON_CH7 (BIT(17)) -#define RMT_REF_ALWAYS_ON_CH7_M (BIT(17)) -#define RMT_REF_ALWAYS_ON_CH7_V 0x1 -#define RMT_REF_ALWAYS_ON_CH7_S 17 -/* RMT_REF_CNT_RST_CH7 : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: This bit is used to reset divider in channel7.*/ -#define RMT_REF_CNT_RST_CH7 (BIT(16)) -#define RMT_REF_CNT_RST_CH7_M (BIT(16)) -#define RMT_REF_CNT_RST_CH7_V 0x1 -#define RMT_REF_CNT_RST_CH7_S 16 -/* RMT_RX_FILTER_THRES_CH7 : R/W ;bitpos:[15:8] ;default: 8'hf ; */ -/*description: in receive mode channel7 ignore input pulse when the pulse width - is smaller then this value.*/ -#define RMT_RX_FILTER_THRES_CH7 0x000000FF -#define RMT_RX_FILTER_THRES_CH7_M ((RMT_RX_FILTER_THRES_CH7_V)<<(RMT_RX_FILTER_THRES_CH7_S)) -#define RMT_RX_FILTER_THRES_CH7_V 0xFF -#define RMT_RX_FILTER_THRES_CH7_S 8 -/* RMT_RX_FILTER_EN_CH7 : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: This is the receive filter enable bit for channel7.*/ -#define RMT_RX_FILTER_EN_CH7 (BIT(7)) -#define RMT_RX_FILTER_EN_CH7_M (BIT(7)) -#define RMT_RX_FILTER_EN_CH7_V 0x1 -#define RMT_RX_FILTER_EN_CH7_S 7 -/* RMT_TX_CONTI_MODE_CH7 : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: Set this bit to continue sending from the first data to the - last data in channel7.*/ -#define RMT_TX_CONTI_MODE_CH7 (BIT(6)) -#define RMT_TX_CONTI_MODE_CH7_M (BIT(6)) -#define RMT_TX_CONTI_MODE_CH7_V 0x1 -#define RMT_TX_CONTI_MODE_CH7_S 6 -/* RMT_MEM_OWNER_CH7 : R/W ;bitpos:[5] ;default: 1'b1 ; */ -/*description: This is the mark of channel7's ram usage right.1'b1:receiver - uses the ram 0:transmitter uses the ram*/ -#define RMT_MEM_OWNER_CH7 (BIT(5)) -#define RMT_MEM_OWNER_CH7_M (BIT(5)) -#define RMT_MEM_OWNER_CH7_V 0x1 -#define RMT_MEM_OWNER_CH7_S 5 -/* RMT_APB_MEM_RST_CH7 : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: Set this bit to reset W/R ram address for channel7 by apb fifo access*/ -#define RMT_APB_MEM_RST_CH7 (BIT(4)) -#define RMT_APB_MEM_RST_CH7_M (BIT(4)) -#define RMT_APB_MEM_RST_CH7_V 0x1 -#define RMT_APB_MEM_RST_CH7_S 4 -/* RMT_MEM_RD_RST_CH7 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: Set this bit to reset read ram address for channel7 by transmitter access.*/ -#define RMT_MEM_RD_RST_CH7 (BIT(3)) -#define RMT_MEM_RD_RST_CH7_M (BIT(3)) -#define RMT_MEM_RD_RST_CH7_V 0x1 -#define RMT_MEM_RD_RST_CH7_S 3 -/* RMT_MEM_WR_RST_CH7 : R/W ;bitpos:[2] ;default: 1'h0 ; */ -/*description: Set this bit to reset write ram address for channel7 by receiver access.*/ -#define RMT_MEM_WR_RST_CH7 (BIT(2)) -#define RMT_MEM_WR_RST_CH7_M (BIT(2)) -#define RMT_MEM_WR_RST_CH7_V 0x1 -#define RMT_MEM_WR_RST_CH7_S 2 -/* RMT_RX_EN_CH7 : R/W ;bitpos:[1] ;default: 1'h0 ; */ -/*description: Set this bit to enbale receving data for channel7.*/ -#define RMT_RX_EN_CH7 (BIT(1)) -#define RMT_RX_EN_CH7_M (BIT(1)) -#define RMT_RX_EN_CH7_V 0x1 -#define RMT_RX_EN_CH7_S 1 -/* RMT_TX_START_CH7 : R/W ;bitpos:[0] ;default: 1'h0 ; */ -/*description: Set this bit to start sending data for channel7.*/ -#define RMT_TX_START_CH7 (BIT(0)) -#define RMT_TX_START_CH7_M (BIT(0)) -#define RMT_TX_START_CH7_V 0x1 -#define RMT_TX_START_CH7_S 0 - -#define RMT_CH0STATUS_REG (DR_REG_RMT_BASE + 0x0060) -/* RMT_STATUS_CH0 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: The status for channel0*/ -#define RMT_STATUS_CH0 0xFFFFFFFF -#define RMT_STATUS_CH0_M ((RMT_STATUS_CH0_V)<<(RMT_STATUS_CH0_S)) -#define RMT_STATUS_CH0_V 0xFFFFFFFF -#define RMT_STATUS_CH0_S 0 - -#define RMT_CH1STATUS_REG (DR_REG_RMT_BASE + 0x0064) -/* RMT_STATUS_CH1 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: The status for channel1*/ -#define RMT_STATUS_CH1 0xFFFFFFFF -#define RMT_STATUS_CH1_M ((RMT_STATUS_CH1_V)<<(RMT_STATUS_CH1_S)) -#define RMT_STATUS_CH1_V 0xFFFFFFFF -#define RMT_STATUS_CH1_S 0 - -#define RMT_CH2STATUS_REG (DR_REG_RMT_BASE + 0x0068) -/* RMT_STATUS_CH2 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: The status for channel2*/ -#define RMT_STATUS_CH2 0xFFFFFFFF -#define RMT_STATUS_CH2_M ((RMT_STATUS_CH2_V)<<(RMT_STATUS_CH2_S)) -#define RMT_STATUS_CH2_V 0xFFFFFFFF -#define RMT_STATUS_CH2_S 0 - -#define RMT_CH3STATUS_REG (DR_REG_RMT_BASE + 0x006c) -/* RMT_STATUS_CH3 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: The status for channel3*/ -#define RMT_STATUS_CH3 0xFFFFFFFF -#define RMT_STATUS_CH3_M ((RMT_STATUS_CH3_V)<<(RMT_STATUS_CH3_S)) -#define RMT_STATUS_CH3_V 0xFFFFFFFF -#define RMT_STATUS_CH3_S 0 - -#define RMT_CH4STATUS_REG (DR_REG_RMT_BASE + 0x0070) -/* RMT_STATUS_CH4 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: The status for channel4*/ -#define RMT_STATUS_CH4 0xFFFFFFFF -#define RMT_STATUS_CH4_M ((RMT_STATUS_CH4_V)<<(RMT_STATUS_CH4_S)) -#define RMT_STATUS_CH4_V 0xFFFFFFFF -#define RMT_STATUS_CH4_S 0 - -#define RMT_CH5STATUS_REG (DR_REG_RMT_BASE + 0x0074) -/* RMT_STATUS_CH5 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: The status for channel5*/ -#define RMT_STATUS_CH5 0xFFFFFFFF -#define RMT_STATUS_CH5_M ((RMT_STATUS_CH5_V)<<(RMT_STATUS_CH5_S)) -#define RMT_STATUS_CH5_V 0xFFFFFFFF -#define RMT_STATUS_CH5_S 0 - -#define RMT_CH6STATUS_REG (DR_REG_RMT_BASE + 0x0078) -/* RMT_STATUS_CH6 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: The status for channel6*/ -#define RMT_STATUS_CH6 0xFFFFFFFF -#define RMT_STATUS_CH6_M ((RMT_STATUS_CH6_V)<<(RMT_STATUS_CH6_S)) -#define RMT_STATUS_CH6_V 0xFFFFFFFF -#define RMT_STATUS_CH6_S 0 - -#define RMT_CH7STATUS_REG (DR_REG_RMT_BASE + 0x007c) -/* RMT_STATUS_CH7 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: The status for channel7*/ -#define RMT_STATUS_CH7 0xFFFFFFFF -#define RMT_STATUS_CH7_M ((RMT_STATUS_CH7_V)<<(RMT_STATUS_CH7_S)) -#define RMT_STATUS_CH7_V 0xFFFFFFFF -#define RMT_STATUS_CH7_S 0 - -#define RMT_CH0ADDR_REG (DR_REG_RMT_BASE + 0x0080) -/* RMT_APB_MEM_ADDR_CH0 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: The ram relative address in channel0 by apb fifo access*/ -#define RMT_APB_MEM_ADDR_CH0 0xFFFFFFFF -#define RMT_APB_MEM_ADDR_CH0_M ((RMT_APB_MEM_ADDR_CH0_V)<<(RMT_APB_MEM_ADDR_CH0_S)) -#define RMT_APB_MEM_ADDR_CH0_V 0xFFFFFFFF -#define RMT_APB_MEM_ADDR_CH0_S 0 - -#define RMT_CH1ADDR_REG (DR_REG_RMT_BASE + 0x0084) -/* RMT_APB_MEM_ADDR_CH1 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: The ram relative address in channel1 by apb fifo access*/ -#define RMT_APB_MEM_ADDR_CH1 0xFFFFFFFF -#define RMT_APB_MEM_ADDR_CH1_M ((RMT_APB_MEM_ADDR_CH1_V)<<(RMT_APB_MEM_ADDR_CH1_S)) -#define RMT_APB_MEM_ADDR_CH1_V 0xFFFFFFFF -#define RMT_APB_MEM_ADDR_CH1_S 0 - -#define RMT_CH2ADDR_REG (DR_REG_RMT_BASE + 0x0088) -/* RMT_APB_MEM_ADDR_CH2 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: The ram relative address in channel2 by apb fifo access*/ -#define RMT_APB_MEM_ADDR_CH2 0xFFFFFFFF -#define RMT_APB_MEM_ADDR_CH2_M ((RMT_APB_MEM_ADDR_CH2_V)<<(RMT_APB_MEM_ADDR_CH2_S)) -#define RMT_APB_MEM_ADDR_CH2_V 0xFFFFFFFF -#define RMT_APB_MEM_ADDR_CH2_S 0 - -#define RMT_CH3ADDR_REG (DR_REG_RMT_BASE + 0x008c) -/* RMT_APB_MEM_ADDR_CH3 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: The ram relative address in channel3 by apb fifo access*/ -#define RMT_APB_MEM_ADDR_CH3 0xFFFFFFFF -#define RMT_APB_MEM_ADDR_CH3_M ((RMT_APB_MEM_ADDR_CH3_V)<<(RMT_APB_MEM_ADDR_CH3_S)) -#define RMT_APB_MEM_ADDR_CH3_V 0xFFFFFFFF -#define RMT_APB_MEM_ADDR_CH3_S 0 - -#define RMT_CH4ADDR_REG (DR_REG_RMT_BASE + 0x0090) -/* RMT_APB_MEM_ADDR_CH4 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: The ram relative address in channel4 by apb fifo access*/ -#define RMT_APB_MEM_ADDR_CH4 0xFFFFFFFF -#define RMT_APB_MEM_ADDR_CH4_M ((RMT_APB_MEM_ADDR_CH4_V)<<(RMT_APB_MEM_ADDR_CH4_S)) -#define RMT_APB_MEM_ADDR_CH4_V 0xFFFFFFFF -#define RMT_APB_MEM_ADDR_CH4_S 0 - -#define RMT_CH5ADDR_REG (DR_REG_RMT_BASE + 0x0094) -/* RMT_APB_MEM_ADDR_CH5 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: The ram relative address in channel5 by apb fifo access*/ -#define RMT_APB_MEM_ADDR_CH5 0xFFFFFFFF -#define RMT_APB_MEM_ADDR_CH5_M ((RMT_APB_MEM_ADDR_CH5_V)<<(RMT_APB_MEM_ADDR_CH5_S)) -#define RMT_APB_MEM_ADDR_CH5_V 0xFFFFFFFF -#define RMT_APB_MEM_ADDR_CH5_S 0 - -#define RMT_CH6ADDR_REG (DR_REG_RMT_BASE + 0x0098) -/* RMT_APB_MEM_ADDR_CH6 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: The ram relative address in channel6 by apb fifo access*/ -#define RMT_APB_MEM_ADDR_CH6 0xFFFFFFFF -#define RMT_APB_MEM_ADDR_CH6_M ((RMT_APB_MEM_ADDR_CH6_V)<<(RMT_APB_MEM_ADDR_CH6_S)) -#define RMT_APB_MEM_ADDR_CH6_V 0xFFFFFFFF -#define RMT_APB_MEM_ADDR_CH6_S 0 - -#define RMT_CH7ADDR_REG (DR_REG_RMT_BASE + 0x009c) -/* RMT_APB_MEM_ADDR_CH7 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: The ram relative address in channel7 by apb fifo access*/ -#define RMT_APB_MEM_ADDR_CH7 0xFFFFFFFF -#define RMT_APB_MEM_ADDR_CH7_M ((RMT_APB_MEM_ADDR_CH7_V)<<(RMT_APB_MEM_ADDR_CH7_S)) -#define RMT_APB_MEM_ADDR_CH7_V 0xFFFFFFFF -#define RMT_APB_MEM_ADDR_CH7_S 0 - -#define RMT_INT_RAW_REG (DR_REG_RMT_BASE + 0x00a0) -/* RMT_CH7_TX_THR_EVENT_INT_RAW : RO ;bitpos:[31] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 7 turns to high level when - transmitter in channle7 have send datas more than reg_rmt_tx_lim_ch7 after detecting this interrupt software can updata the old datas with new datas.*/ -#define RMT_CH7_TX_THR_EVENT_INT_RAW (BIT(31)) -#define RMT_CH7_TX_THR_EVENT_INT_RAW_M (BIT(31)) -#define RMT_CH7_TX_THR_EVENT_INT_RAW_V 0x1 -#define RMT_CH7_TX_THR_EVENT_INT_RAW_S 31 -/* RMT_CH6_TX_THR_EVENT_INT_RAW : RO ;bitpos:[30] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 6 turns to high level when - transmitter in channle6 have send datas more than reg_rmt_tx_lim_ch6 after detecting this interrupt software can updata the old datas with new datas.*/ -#define RMT_CH6_TX_THR_EVENT_INT_RAW (BIT(30)) -#define RMT_CH6_TX_THR_EVENT_INT_RAW_M (BIT(30)) -#define RMT_CH6_TX_THR_EVENT_INT_RAW_V 0x1 -#define RMT_CH6_TX_THR_EVENT_INT_RAW_S 30 -/* RMT_CH5_TX_THR_EVENT_INT_RAW : RO ;bitpos:[29] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 5 turns to high level when - transmitter in channle5 have send datas more than reg_rmt_tx_lim_ch5 after detecting this interrupt software can updata the old datas with new datas.*/ -#define RMT_CH5_TX_THR_EVENT_INT_RAW (BIT(29)) -#define RMT_CH5_TX_THR_EVENT_INT_RAW_M (BIT(29)) -#define RMT_CH5_TX_THR_EVENT_INT_RAW_V 0x1 -#define RMT_CH5_TX_THR_EVENT_INT_RAW_S 29 -/* RMT_CH4_TX_THR_EVENT_INT_RAW : RO ;bitpos:[28] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 4 turns to high level when - transmitter in channle4 have send datas more than reg_rmt_tx_lim_ch4 after detecting this interrupt software can updata the old datas with new datas.*/ -#define RMT_CH4_TX_THR_EVENT_INT_RAW (BIT(28)) -#define RMT_CH4_TX_THR_EVENT_INT_RAW_M (BIT(28)) -#define RMT_CH4_TX_THR_EVENT_INT_RAW_V 0x1 -#define RMT_CH4_TX_THR_EVENT_INT_RAW_S 28 -/* RMT_CH3_TX_THR_EVENT_INT_RAW : RO ;bitpos:[27] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 3 turns to high level when - transmitter in channle3 have send datas more than reg_rmt_tx_lim_ch3 after detecting this interrupt software can updata the old datas with new datas.*/ -#define RMT_CH3_TX_THR_EVENT_INT_RAW (BIT(27)) -#define RMT_CH3_TX_THR_EVENT_INT_RAW_M (BIT(27)) -#define RMT_CH3_TX_THR_EVENT_INT_RAW_V 0x1 -#define RMT_CH3_TX_THR_EVENT_INT_RAW_S 27 -/* RMT_CH2_TX_THR_EVENT_INT_RAW : RO ;bitpos:[26] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 2 turns to high level when - transmitter in channle2 have send datas more than reg_rmt_tx_lim_ch2 after detecting this interrupt software can updata the old datas with new datas.*/ -#define RMT_CH2_TX_THR_EVENT_INT_RAW (BIT(26)) -#define RMT_CH2_TX_THR_EVENT_INT_RAW_M (BIT(26)) -#define RMT_CH2_TX_THR_EVENT_INT_RAW_V 0x1 -#define RMT_CH2_TX_THR_EVENT_INT_RAW_S 26 -/* RMT_CH1_TX_THR_EVENT_INT_RAW : RO ;bitpos:[25] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 1 turns to high level when - transmitter in channle1 have send datas more than reg_rmt_tx_lim_ch1 after detecting this interrupt software can updata the old datas with new datas.*/ -#define RMT_CH1_TX_THR_EVENT_INT_RAW (BIT(25)) -#define RMT_CH1_TX_THR_EVENT_INT_RAW_M (BIT(25)) -#define RMT_CH1_TX_THR_EVENT_INT_RAW_V 0x1 -#define RMT_CH1_TX_THR_EVENT_INT_RAW_S 25 -/* RMT_CH0_TX_THR_EVENT_INT_RAW : RO ;bitpos:[24] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 0 turns to high level when - transmitter in channle0 have send datas more than reg_rmt_tx_lim_ch0 after detecting this interrupt software can updata the old datas with new datas.*/ -#define RMT_CH0_TX_THR_EVENT_INT_RAW (BIT(24)) -#define RMT_CH0_TX_THR_EVENT_INT_RAW_M (BIT(24)) -#define RMT_CH0_TX_THR_EVENT_INT_RAW_V 0x1 -#define RMT_CH0_TX_THR_EVENT_INT_RAW_S 24 -/* RMT_CH7_ERR_INT_RAW : RO ;bitpos:[23] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 7 turns to high level when - channle 7 detects some errors.*/ -#define RMT_CH7_ERR_INT_RAW (BIT(23)) -#define RMT_CH7_ERR_INT_RAW_M (BIT(23)) -#define RMT_CH7_ERR_INT_RAW_V 0x1 -#define RMT_CH7_ERR_INT_RAW_S 23 -/* RMT_CH7_RX_END_INT_RAW : RO ;bitpos:[22] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 7 turns to high level when - the receive process is done.*/ -#define RMT_CH7_RX_END_INT_RAW (BIT(22)) -#define RMT_CH7_RX_END_INT_RAW_M (BIT(22)) -#define RMT_CH7_RX_END_INT_RAW_V 0x1 -#define RMT_CH7_RX_END_INT_RAW_S 22 -/* RMT_CH7_TX_END_INT_RAW : RO ;bitpos:[21] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 7 turns to high level when - the transmit process is done.*/ -#define RMT_CH7_TX_END_INT_RAW (BIT(21)) -#define RMT_CH7_TX_END_INT_RAW_M (BIT(21)) -#define RMT_CH7_TX_END_INT_RAW_V 0x1 -#define RMT_CH7_TX_END_INT_RAW_S 21 -/* RMT_CH6_ERR_INT_RAW : RO ;bitpos:[20] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 6 turns to high level when - channle 6 detects some errors.*/ -#define RMT_CH6_ERR_INT_RAW (BIT(20)) -#define RMT_CH6_ERR_INT_RAW_M (BIT(20)) -#define RMT_CH6_ERR_INT_RAW_V 0x1 -#define RMT_CH6_ERR_INT_RAW_S 20 -/* RMT_CH6_RX_END_INT_RAW : RO ;bitpos:[19] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 6 turns to high level when - the receive process is done.*/ -#define RMT_CH6_RX_END_INT_RAW (BIT(19)) -#define RMT_CH6_RX_END_INT_RAW_M (BIT(19)) -#define RMT_CH6_RX_END_INT_RAW_V 0x1 -#define RMT_CH6_RX_END_INT_RAW_S 19 -/* RMT_CH6_TX_END_INT_RAW : RO ;bitpos:[18] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 6 turns to high level when - the transmit process is done.*/ -#define RMT_CH6_TX_END_INT_RAW (BIT(18)) -#define RMT_CH6_TX_END_INT_RAW_M (BIT(18)) -#define RMT_CH6_TX_END_INT_RAW_V 0x1 -#define RMT_CH6_TX_END_INT_RAW_S 18 -/* RMT_CH5_ERR_INT_RAW : RO ;bitpos:[17] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 5 turns to high level when - channle 5 detects some errors.*/ -#define RMT_CH5_ERR_INT_RAW (BIT(17)) -#define RMT_CH5_ERR_INT_RAW_M (BIT(17)) -#define RMT_CH5_ERR_INT_RAW_V 0x1 -#define RMT_CH5_ERR_INT_RAW_S 17 -/* RMT_CH5_RX_END_INT_RAW : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 5 turns to high level when - the receive process is done.*/ -#define RMT_CH5_RX_END_INT_RAW (BIT(16)) -#define RMT_CH5_RX_END_INT_RAW_M (BIT(16)) -#define RMT_CH5_RX_END_INT_RAW_V 0x1 -#define RMT_CH5_RX_END_INT_RAW_S 16 -/* RMT_CH5_TX_END_INT_RAW : RO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 5 turns to high level when - the transmit process is done.*/ -#define RMT_CH5_TX_END_INT_RAW (BIT(15)) -#define RMT_CH5_TX_END_INT_RAW_M (BIT(15)) -#define RMT_CH5_TX_END_INT_RAW_V 0x1 -#define RMT_CH5_TX_END_INT_RAW_S 15 -/* RMT_CH4_ERR_INT_RAW : RO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 4 turns to high level when - channle 4 detects some errors.*/ -#define RMT_CH4_ERR_INT_RAW (BIT(14)) -#define RMT_CH4_ERR_INT_RAW_M (BIT(14)) -#define RMT_CH4_ERR_INT_RAW_V 0x1 -#define RMT_CH4_ERR_INT_RAW_S 14 -/* RMT_CH4_RX_END_INT_RAW : RO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 4 turns to high level when - the receive process is done.*/ -#define RMT_CH4_RX_END_INT_RAW (BIT(13)) -#define RMT_CH4_RX_END_INT_RAW_M (BIT(13)) -#define RMT_CH4_RX_END_INT_RAW_V 0x1 -#define RMT_CH4_RX_END_INT_RAW_S 13 -/* RMT_CH4_TX_END_INT_RAW : RO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 4 turns to high level when - the transmit process is done.*/ -#define RMT_CH4_TX_END_INT_RAW (BIT(12)) -#define RMT_CH4_TX_END_INT_RAW_M (BIT(12)) -#define RMT_CH4_TX_END_INT_RAW_V 0x1 -#define RMT_CH4_TX_END_INT_RAW_S 12 -/* RMT_CH3_ERR_INT_RAW : RO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 3 turns to high level when - channle 3 detects some errors.*/ -#define RMT_CH3_ERR_INT_RAW (BIT(11)) -#define RMT_CH3_ERR_INT_RAW_M (BIT(11)) -#define RMT_CH3_ERR_INT_RAW_V 0x1 -#define RMT_CH3_ERR_INT_RAW_S 11 -/* RMT_CH3_RX_END_INT_RAW : RO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 3 turns to high level when - the receive process is done.*/ -#define RMT_CH3_RX_END_INT_RAW (BIT(10)) -#define RMT_CH3_RX_END_INT_RAW_M (BIT(10)) -#define RMT_CH3_RX_END_INT_RAW_V 0x1 -#define RMT_CH3_RX_END_INT_RAW_S 10 -/* RMT_CH3_TX_END_INT_RAW : RO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 3 turns to high level when - the transmit process is done.*/ -#define RMT_CH3_TX_END_INT_RAW (BIT(9)) -#define RMT_CH3_TX_END_INT_RAW_M (BIT(9)) -#define RMT_CH3_TX_END_INT_RAW_V 0x1 -#define RMT_CH3_TX_END_INT_RAW_S 9 -/* RMT_CH2_ERR_INT_RAW : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 2 turns to high level when - channle 2 detects some errors.*/ -#define RMT_CH2_ERR_INT_RAW (BIT(8)) -#define RMT_CH2_ERR_INT_RAW_M (BIT(8)) -#define RMT_CH2_ERR_INT_RAW_V 0x1 -#define RMT_CH2_ERR_INT_RAW_S 8 -/* RMT_CH2_RX_END_INT_RAW : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 2 turns to high level when - the receive process is done.*/ -#define RMT_CH2_RX_END_INT_RAW (BIT(7)) -#define RMT_CH2_RX_END_INT_RAW_M (BIT(7)) -#define RMT_CH2_RX_END_INT_RAW_V 0x1 -#define RMT_CH2_RX_END_INT_RAW_S 7 -/* RMT_CH2_TX_END_INT_RAW : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 2 turns to high level when - the transmit process is done.*/ -#define RMT_CH2_TX_END_INT_RAW (BIT(6)) -#define RMT_CH2_TX_END_INT_RAW_M (BIT(6)) -#define RMT_CH2_TX_END_INT_RAW_V 0x1 -#define RMT_CH2_TX_END_INT_RAW_S 6 -/* RMT_CH1_ERR_INT_RAW : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 1 turns to high level when - channle 1 detects some errors.*/ -#define RMT_CH1_ERR_INT_RAW (BIT(5)) -#define RMT_CH1_ERR_INT_RAW_M (BIT(5)) -#define RMT_CH1_ERR_INT_RAW_V 0x1 -#define RMT_CH1_ERR_INT_RAW_S 5 -/* RMT_CH1_RX_END_INT_RAW : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 1 turns to high level when - the receive process is done.*/ -#define RMT_CH1_RX_END_INT_RAW (BIT(4)) -#define RMT_CH1_RX_END_INT_RAW_M (BIT(4)) -#define RMT_CH1_RX_END_INT_RAW_V 0x1 -#define RMT_CH1_RX_END_INT_RAW_S 4 -/* RMT_CH1_TX_END_INT_RAW : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 1 turns to high level when - the transmit process is done.*/ -#define RMT_CH1_TX_END_INT_RAW (BIT(3)) -#define RMT_CH1_TX_END_INT_RAW_M (BIT(3)) -#define RMT_CH1_TX_END_INT_RAW_V 0x1 -#define RMT_CH1_TX_END_INT_RAW_S 3 -/* RMT_CH0_ERR_INT_RAW : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 0 turns to high level when - channle 0 detects some errors.*/ -#define RMT_CH0_ERR_INT_RAW (BIT(2)) -#define RMT_CH0_ERR_INT_RAW_M (BIT(2)) -#define RMT_CH0_ERR_INT_RAW_V 0x1 -#define RMT_CH0_ERR_INT_RAW_S 2 -/* RMT_CH0_RX_END_INT_RAW : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 0 turns to high level when - the receive process is done.*/ -#define RMT_CH0_RX_END_INT_RAW (BIT(1)) -#define RMT_CH0_RX_END_INT_RAW_M (BIT(1)) -#define RMT_CH0_RX_END_INT_RAW_V 0x1 -#define RMT_CH0_RX_END_INT_RAW_S 1 -/* RMT_CH0_TX_END_INT_RAW : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for channel 0 turns to high level when - the transmit process is done.*/ -#define RMT_CH0_TX_END_INT_RAW (BIT(0)) -#define RMT_CH0_TX_END_INT_RAW_M (BIT(0)) -#define RMT_CH0_TX_END_INT_RAW_V 0x1 -#define RMT_CH0_TX_END_INT_RAW_S 0 - -#define RMT_INT_ST_REG (DR_REG_RMT_BASE + 0x00a4) -/* RMT_CH7_TX_THR_EVENT_INT_ST : RO ;bitpos:[31] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 7's rmt_ch7_tx_thr_event_int_raw - when mt_ch7_tx_thr_event_int_ena is set to 1.*/ -#define RMT_CH7_TX_THR_EVENT_INT_ST (BIT(31)) -#define RMT_CH7_TX_THR_EVENT_INT_ST_M (BIT(31)) -#define RMT_CH7_TX_THR_EVENT_INT_ST_V 0x1 -#define RMT_CH7_TX_THR_EVENT_INT_ST_S 31 -/* RMT_CH6_TX_THR_EVENT_INT_ST : RO ;bitpos:[30] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 6's rmt_ch6_tx_thr_event_int_raw - when mt_ch6_tx_thr_event_int_ena is set to 1.*/ -#define RMT_CH6_TX_THR_EVENT_INT_ST (BIT(30)) -#define RMT_CH6_TX_THR_EVENT_INT_ST_M (BIT(30)) -#define RMT_CH6_TX_THR_EVENT_INT_ST_V 0x1 -#define RMT_CH6_TX_THR_EVENT_INT_ST_S 30 -/* RMT_CH5_TX_THR_EVENT_INT_ST : RO ;bitpos:[29] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 5's rmt_ch5_tx_thr_event_int_raw - when mt_ch5_tx_thr_event_int_ena is set to 1.*/ -#define RMT_CH5_TX_THR_EVENT_INT_ST (BIT(29)) -#define RMT_CH5_TX_THR_EVENT_INT_ST_M (BIT(29)) -#define RMT_CH5_TX_THR_EVENT_INT_ST_V 0x1 -#define RMT_CH5_TX_THR_EVENT_INT_ST_S 29 -/* RMT_CH4_TX_THR_EVENT_INT_ST : RO ;bitpos:[28] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 4's rmt_ch4_tx_thr_event_int_raw - when mt_ch4_tx_thr_event_int_ena is set to 1.*/ -#define RMT_CH4_TX_THR_EVENT_INT_ST (BIT(28)) -#define RMT_CH4_TX_THR_EVENT_INT_ST_M (BIT(28)) -#define RMT_CH4_TX_THR_EVENT_INT_ST_V 0x1 -#define RMT_CH4_TX_THR_EVENT_INT_ST_S 28 -/* RMT_CH3_TX_THR_EVENT_INT_ST : RO ;bitpos:[27] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 3's rmt_ch3_tx_thr_event_int_raw - when mt_ch3_tx_thr_event_int_ena is set to 1.*/ -#define RMT_CH3_TX_THR_EVENT_INT_ST (BIT(27)) -#define RMT_CH3_TX_THR_EVENT_INT_ST_M (BIT(27)) -#define RMT_CH3_TX_THR_EVENT_INT_ST_V 0x1 -#define RMT_CH3_TX_THR_EVENT_INT_ST_S 27 -/* RMT_CH2_TX_THR_EVENT_INT_ST : RO ;bitpos:[26] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 2's rmt_ch2_tx_thr_event_int_raw - when mt_ch2_tx_thr_event_int_ena is set to 1.*/ -#define RMT_CH2_TX_THR_EVENT_INT_ST (BIT(26)) -#define RMT_CH2_TX_THR_EVENT_INT_ST_M (BIT(26)) -#define RMT_CH2_TX_THR_EVENT_INT_ST_V 0x1 -#define RMT_CH2_TX_THR_EVENT_INT_ST_S 26 -/* RMT_CH1_TX_THR_EVENT_INT_ST : RO ;bitpos:[25] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 1's rmt_ch1_tx_thr_event_int_raw - when mt_ch1_tx_thr_event_int_ena is set to 1.*/ -#define RMT_CH1_TX_THR_EVENT_INT_ST (BIT(25)) -#define RMT_CH1_TX_THR_EVENT_INT_ST_M (BIT(25)) -#define RMT_CH1_TX_THR_EVENT_INT_ST_V 0x1 -#define RMT_CH1_TX_THR_EVENT_INT_ST_S 25 -/* RMT_CH0_TX_THR_EVENT_INT_ST : RO ;bitpos:[24] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 0's rmt_ch0_tx_thr_event_int_raw - when mt_ch0_tx_thr_event_int_ena is set to 1.*/ -#define RMT_CH0_TX_THR_EVENT_INT_ST (BIT(24)) -#define RMT_CH0_TX_THR_EVENT_INT_ST_M (BIT(24)) -#define RMT_CH0_TX_THR_EVENT_INT_ST_V 0x1 -#define RMT_CH0_TX_THR_EVENT_INT_ST_S 24 -/* RMT_CH7_ERR_INT_ST : RO ;bitpos:[23] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 7's rmt_ch7_err_int_raw - when rmt_ch7_err_int_ena is set to 1.*/ -#define RMT_CH7_ERR_INT_ST (BIT(23)) -#define RMT_CH7_ERR_INT_ST_M (BIT(23)) -#define RMT_CH7_ERR_INT_ST_V 0x1 -#define RMT_CH7_ERR_INT_ST_S 23 -/* RMT_CH7_RX_END_INT_ST : RO ;bitpos:[22] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 7's rmt_ch7_rx_end_int_raw - when rmt_ch7_rx_end_int_ena is set to 1.*/ -#define RMT_CH7_RX_END_INT_ST (BIT(22)) -#define RMT_CH7_RX_END_INT_ST_M (BIT(22)) -#define RMT_CH7_RX_END_INT_ST_V 0x1 -#define RMT_CH7_RX_END_INT_ST_S 22 -/* RMT_CH7_TX_END_INT_ST : RO ;bitpos:[21] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 7's mt_ch7_tx_end_int_raw - when mt_ch7_tx_end_int_ena is set to 1.*/ -#define RMT_CH7_TX_END_INT_ST (BIT(21)) -#define RMT_CH7_TX_END_INT_ST_M (BIT(21)) -#define RMT_CH7_TX_END_INT_ST_V 0x1 -#define RMT_CH7_TX_END_INT_ST_S 21 -/* RMT_CH6_ERR_INT_ST : RO ;bitpos:[20] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 6's rmt_ch6_err_int_raw - when rmt_ch6_err_int_ena is set to 1.*/ -#define RMT_CH6_ERR_INT_ST (BIT(20)) -#define RMT_CH6_ERR_INT_ST_M (BIT(20)) -#define RMT_CH6_ERR_INT_ST_V 0x1 -#define RMT_CH6_ERR_INT_ST_S 20 -/* RMT_CH6_RX_END_INT_ST : RO ;bitpos:[19] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 6's rmt_ch6_rx_end_int_raw - when rmt_ch6_rx_end_int_ena is set to 1.*/ -#define RMT_CH6_RX_END_INT_ST (BIT(19)) -#define RMT_CH6_RX_END_INT_ST_M (BIT(19)) -#define RMT_CH6_RX_END_INT_ST_V 0x1 -#define RMT_CH6_RX_END_INT_ST_S 19 -/* RMT_CH6_TX_END_INT_ST : RO ;bitpos:[18] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 6's mt_ch6_tx_end_int_raw - when mt_ch6_tx_end_int_ena is set to 1.*/ -#define RMT_CH6_TX_END_INT_ST (BIT(18)) -#define RMT_CH6_TX_END_INT_ST_M (BIT(18)) -#define RMT_CH6_TX_END_INT_ST_V 0x1 -#define RMT_CH6_TX_END_INT_ST_S 18 -/* RMT_CH5_ERR_INT_ST : RO ;bitpos:[17] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 5's rmt_ch5_err_int_raw - when rmt_ch5_err_int_ena is set to 1.*/ -#define RMT_CH5_ERR_INT_ST (BIT(17)) -#define RMT_CH5_ERR_INT_ST_M (BIT(17)) -#define RMT_CH5_ERR_INT_ST_V 0x1 -#define RMT_CH5_ERR_INT_ST_S 17 -/* RMT_CH5_RX_END_INT_ST : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 5's rmt_ch5_rx_end_int_raw - when rmt_ch5_rx_end_int_ena is set to 1.*/ -#define RMT_CH5_RX_END_INT_ST (BIT(16)) -#define RMT_CH5_RX_END_INT_ST_M (BIT(16)) -#define RMT_CH5_RX_END_INT_ST_V 0x1 -#define RMT_CH5_RX_END_INT_ST_S 16 -/* RMT_CH5_TX_END_INT_ST : RO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 5's mt_ch5_tx_end_int_raw - when mt_ch5_tx_end_int_ena is set to 1.*/ -#define RMT_CH5_TX_END_INT_ST (BIT(15)) -#define RMT_CH5_TX_END_INT_ST_M (BIT(15)) -#define RMT_CH5_TX_END_INT_ST_V 0x1 -#define RMT_CH5_TX_END_INT_ST_S 15 -/* RMT_CH4_ERR_INT_ST : RO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 4's rmt_ch4_err_int_raw - when rmt_ch4_err_int_ena is set to 1.*/ -#define RMT_CH4_ERR_INT_ST (BIT(14)) -#define RMT_CH4_ERR_INT_ST_M (BIT(14)) -#define RMT_CH4_ERR_INT_ST_V 0x1 -#define RMT_CH4_ERR_INT_ST_S 14 -/* RMT_CH4_RX_END_INT_ST : RO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 4's rmt_ch4_rx_end_int_raw - when rmt_ch4_rx_end_int_ena is set to 1.*/ -#define RMT_CH4_RX_END_INT_ST (BIT(13)) -#define RMT_CH4_RX_END_INT_ST_M (BIT(13)) -#define RMT_CH4_RX_END_INT_ST_V 0x1 -#define RMT_CH4_RX_END_INT_ST_S 13 -/* RMT_CH4_TX_END_INT_ST : RO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 4's mt_ch4_tx_end_int_raw - when mt_ch4_tx_end_int_ena is set to 1.*/ -#define RMT_CH4_TX_END_INT_ST (BIT(12)) -#define RMT_CH4_TX_END_INT_ST_M (BIT(12)) -#define RMT_CH4_TX_END_INT_ST_V 0x1 -#define RMT_CH4_TX_END_INT_ST_S 12 -/* RMT_CH3_ERR_INT_ST : RO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 3's rmt_ch3_err_int_raw - when rmt_ch3_err_int_ena is set to 1.*/ -#define RMT_CH3_ERR_INT_ST (BIT(11)) -#define RMT_CH3_ERR_INT_ST_M (BIT(11)) -#define RMT_CH3_ERR_INT_ST_V 0x1 -#define RMT_CH3_ERR_INT_ST_S 11 -/* RMT_CH3_RX_END_INT_ST : RO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 3's rmt_ch3_rx_end_int_raw - when rmt_ch3_rx_end_int_ena is set to 1.*/ -#define RMT_CH3_RX_END_INT_ST (BIT(10)) -#define RMT_CH3_RX_END_INT_ST_M (BIT(10)) -#define RMT_CH3_RX_END_INT_ST_V 0x1 -#define RMT_CH3_RX_END_INT_ST_S 10 -/* RMT_CH3_TX_END_INT_ST : RO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 3's mt_ch3_tx_end_int_raw - when mt_ch3_tx_end_int_ena is set to 1.*/ -#define RMT_CH3_TX_END_INT_ST (BIT(9)) -#define RMT_CH3_TX_END_INT_ST_M (BIT(9)) -#define RMT_CH3_TX_END_INT_ST_V 0x1 -#define RMT_CH3_TX_END_INT_ST_S 9 -/* RMT_CH2_ERR_INT_ST : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 2's rmt_ch2_err_int_raw - when rmt_ch2_err_int_ena is set to 1.*/ -#define RMT_CH2_ERR_INT_ST (BIT(8)) -#define RMT_CH2_ERR_INT_ST_M (BIT(8)) -#define RMT_CH2_ERR_INT_ST_V 0x1 -#define RMT_CH2_ERR_INT_ST_S 8 -/* RMT_CH2_RX_END_INT_ST : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 2's rmt_ch2_rx_end_int_raw - when rmt_ch2_rx_end_int_ena is set to 1.*/ -#define RMT_CH2_RX_END_INT_ST (BIT(7)) -#define RMT_CH2_RX_END_INT_ST_M (BIT(7)) -#define RMT_CH2_RX_END_INT_ST_V 0x1 -#define RMT_CH2_RX_END_INT_ST_S 7 -/* RMT_CH2_TX_END_INT_ST : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 2's mt_ch2_tx_end_int_raw - when mt_ch2_tx_end_int_ena is set to 1.*/ -#define RMT_CH2_TX_END_INT_ST (BIT(6)) -#define RMT_CH2_TX_END_INT_ST_M (BIT(6)) -#define RMT_CH2_TX_END_INT_ST_V 0x1 -#define RMT_CH2_TX_END_INT_ST_S 6 -/* RMT_CH1_ERR_INT_ST : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 1's rmt_ch1_err_int_raw - when rmt_ch1_err_int_ena is set to 1.*/ -#define RMT_CH1_ERR_INT_ST (BIT(5)) -#define RMT_CH1_ERR_INT_ST_M (BIT(5)) -#define RMT_CH1_ERR_INT_ST_V 0x1 -#define RMT_CH1_ERR_INT_ST_S 5 -/* RMT_CH1_RX_END_INT_ST : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 1's rmt_ch1_rx_end_int_raw - when rmt_ch1_rx_end_int_ena is set to 1.*/ -#define RMT_CH1_RX_END_INT_ST (BIT(4)) -#define RMT_CH1_RX_END_INT_ST_M (BIT(4)) -#define RMT_CH1_RX_END_INT_ST_V 0x1 -#define RMT_CH1_RX_END_INT_ST_S 4 -/* RMT_CH1_TX_END_INT_ST : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 1's mt_ch1_tx_end_int_raw - when mt_ch1_tx_end_int_ena is set to 1.*/ -#define RMT_CH1_TX_END_INT_ST (BIT(3)) -#define RMT_CH1_TX_END_INT_ST_M (BIT(3)) -#define RMT_CH1_TX_END_INT_ST_V 0x1 -#define RMT_CH1_TX_END_INT_ST_S 3 -/* RMT_CH0_ERR_INT_ST : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 0's rmt_ch0_err_int_raw - when rmt_ch0_err_int_ena is set to 0.*/ -#define RMT_CH0_ERR_INT_ST (BIT(2)) -#define RMT_CH0_ERR_INT_ST_M (BIT(2)) -#define RMT_CH0_ERR_INT_ST_V 0x1 -#define RMT_CH0_ERR_INT_ST_S 2 -/* RMT_CH0_RX_END_INT_ST : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 0's rmt_ch0_rx_end_int_raw - when rmt_ch0_rx_end_int_ena is set to 0.*/ -#define RMT_CH0_RX_END_INT_ST (BIT(1)) -#define RMT_CH0_RX_END_INT_ST_M (BIT(1)) -#define RMT_CH0_RX_END_INT_ST_V 0x1 -#define RMT_CH0_RX_END_INT_ST_S 1 -/* RMT_CH0_TX_END_INT_ST : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: The interrupt state bit for channel 0's mt_ch0_tx_end_int_raw - when mt_ch0_tx_end_int_ena is set to 0.*/ -#define RMT_CH0_TX_END_INT_ST (BIT(0)) -#define RMT_CH0_TX_END_INT_ST_M (BIT(0)) -#define RMT_CH0_TX_END_INT_ST_V 0x1 -#define RMT_CH0_TX_END_INT_ST_S 0 - -#define RMT_INT_ENA_REG (DR_REG_RMT_BASE + 0x00a8) -/* RMT_CH7_TX_THR_EVENT_INT_ENA : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch7_tx_thr_event_int_st.*/ -#define RMT_CH7_TX_THR_EVENT_INT_ENA (BIT(31)) -#define RMT_CH7_TX_THR_EVENT_INT_ENA_M (BIT(31)) -#define RMT_CH7_TX_THR_EVENT_INT_ENA_V 0x1 -#define RMT_CH7_TX_THR_EVENT_INT_ENA_S 31 -/* RMT_CH6_TX_THR_EVENT_INT_ENA : R/W ;bitpos:[30] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch6_tx_thr_event_int_st.*/ -#define RMT_CH6_TX_THR_EVENT_INT_ENA (BIT(30)) -#define RMT_CH6_TX_THR_EVENT_INT_ENA_M (BIT(30)) -#define RMT_CH6_TX_THR_EVENT_INT_ENA_V 0x1 -#define RMT_CH6_TX_THR_EVENT_INT_ENA_S 30 -/* RMT_CH5_TX_THR_EVENT_INT_ENA : R/W ;bitpos:[29] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch5_tx_thr_event_int_st.*/ -#define RMT_CH5_TX_THR_EVENT_INT_ENA (BIT(29)) -#define RMT_CH5_TX_THR_EVENT_INT_ENA_M (BIT(29)) -#define RMT_CH5_TX_THR_EVENT_INT_ENA_V 0x1 -#define RMT_CH5_TX_THR_EVENT_INT_ENA_S 29 -/* RMT_CH4_TX_THR_EVENT_INT_ENA : R/W ;bitpos:[28] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch4_tx_thr_event_int_st.*/ -#define RMT_CH4_TX_THR_EVENT_INT_ENA (BIT(28)) -#define RMT_CH4_TX_THR_EVENT_INT_ENA_M (BIT(28)) -#define RMT_CH4_TX_THR_EVENT_INT_ENA_V 0x1 -#define RMT_CH4_TX_THR_EVENT_INT_ENA_S 28 -/* RMT_CH3_TX_THR_EVENT_INT_ENA : R/W ;bitpos:[27] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch3_tx_thr_event_int_st.*/ -#define RMT_CH3_TX_THR_EVENT_INT_ENA (BIT(27)) -#define RMT_CH3_TX_THR_EVENT_INT_ENA_M (BIT(27)) -#define RMT_CH3_TX_THR_EVENT_INT_ENA_V 0x1 -#define RMT_CH3_TX_THR_EVENT_INT_ENA_S 27 -/* RMT_CH2_TX_THR_EVENT_INT_ENA : R/W ;bitpos:[26] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch2_tx_thr_event_int_st.*/ -#define RMT_CH2_TX_THR_EVENT_INT_ENA (BIT(26)) -#define RMT_CH2_TX_THR_EVENT_INT_ENA_M (BIT(26)) -#define RMT_CH2_TX_THR_EVENT_INT_ENA_V 0x1 -#define RMT_CH2_TX_THR_EVENT_INT_ENA_S 26 -/* RMT_CH1_TX_THR_EVENT_INT_ENA : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch1_tx_thr_event_int_st.*/ -#define RMT_CH1_TX_THR_EVENT_INT_ENA (BIT(25)) -#define RMT_CH1_TX_THR_EVENT_INT_ENA_M (BIT(25)) -#define RMT_CH1_TX_THR_EVENT_INT_ENA_V 0x1 -#define RMT_CH1_TX_THR_EVENT_INT_ENA_S 25 -/* RMT_CH0_TX_THR_EVENT_INT_ENA : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch0_tx_thr_event_int_st.*/ -#define RMT_CH0_TX_THR_EVENT_INT_ENA (BIT(24)) -#define RMT_CH0_TX_THR_EVENT_INT_ENA_M (BIT(24)) -#define RMT_CH0_TX_THR_EVENT_INT_ENA_V 0x1 -#define RMT_CH0_TX_THR_EVENT_INT_ENA_S 24 -/* RMT_CH7_ERR_INT_ENA : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch7_err_int_st.*/ -#define RMT_CH7_ERR_INT_ENA (BIT(23)) -#define RMT_CH7_ERR_INT_ENA_M (BIT(23)) -#define RMT_CH7_ERR_INT_ENA_V 0x1 -#define RMT_CH7_ERR_INT_ENA_S 23 -/* RMT_CH7_RX_END_INT_ENA : R/W ;bitpos:[22] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch7_rx_end_int_st.*/ -#define RMT_CH7_RX_END_INT_ENA (BIT(22)) -#define RMT_CH7_RX_END_INT_ENA_M (BIT(22)) -#define RMT_CH7_RX_END_INT_ENA_V 0x1 -#define RMT_CH7_RX_END_INT_ENA_S 22 -/* RMT_CH7_TX_END_INT_ENA : R/W ;bitpos:[21] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch7_tx_end_int_st.*/ -#define RMT_CH7_TX_END_INT_ENA (BIT(21)) -#define RMT_CH7_TX_END_INT_ENA_M (BIT(21)) -#define RMT_CH7_TX_END_INT_ENA_V 0x1 -#define RMT_CH7_TX_END_INT_ENA_S 21 -/* RMT_CH6_ERR_INT_ENA : R/W ;bitpos:[20] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch6_err_int_st.*/ -#define RMT_CH6_ERR_INT_ENA (BIT(20)) -#define RMT_CH6_ERR_INT_ENA_M (BIT(20)) -#define RMT_CH6_ERR_INT_ENA_V 0x1 -#define RMT_CH6_ERR_INT_ENA_S 20 -/* RMT_CH6_RX_END_INT_ENA : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch6_rx_end_int_st.*/ -#define RMT_CH6_RX_END_INT_ENA (BIT(19)) -#define RMT_CH6_RX_END_INT_ENA_M (BIT(19)) -#define RMT_CH6_RX_END_INT_ENA_V 0x1 -#define RMT_CH6_RX_END_INT_ENA_S 19 -/* RMT_CH6_TX_END_INT_ENA : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch6_tx_end_int_st.*/ -#define RMT_CH6_TX_END_INT_ENA (BIT(18)) -#define RMT_CH6_TX_END_INT_ENA_M (BIT(18)) -#define RMT_CH6_TX_END_INT_ENA_V 0x1 -#define RMT_CH6_TX_END_INT_ENA_S 18 -/* RMT_CH5_ERR_INT_ENA : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch5_err_int_st.*/ -#define RMT_CH5_ERR_INT_ENA (BIT(17)) -#define RMT_CH5_ERR_INT_ENA_M (BIT(17)) -#define RMT_CH5_ERR_INT_ENA_V 0x1 -#define RMT_CH5_ERR_INT_ENA_S 17 -/* RMT_CH5_RX_END_INT_ENA : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch5_rx_end_int_st.*/ -#define RMT_CH5_RX_END_INT_ENA (BIT(16)) -#define RMT_CH5_RX_END_INT_ENA_M (BIT(16)) -#define RMT_CH5_RX_END_INT_ENA_V 0x1 -#define RMT_CH5_RX_END_INT_ENA_S 16 -/* RMT_CH5_TX_END_INT_ENA : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch5_tx_end_int_st.*/ -#define RMT_CH5_TX_END_INT_ENA (BIT(15)) -#define RMT_CH5_TX_END_INT_ENA_M (BIT(15)) -#define RMT_CH5_TX_END_INT_ENA_V 0x1 -#define RMT_CH5_TX_END_INT_ENA_S 15 -/* RMT_CH4_ERR_INT_ENA : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch4_err_int_st.*/ -#define RMT_CH4_ERR_INT_ENA (BIT(14)) -#define RMT_CH4_ERR_INT_ENA_M (BIT(14)) -#define RMT_CH4_ERR_INT_ENA_V 0x1 -#define RMT_CH4_ERR_INT_ENA_S 14 -/* RMT_CH4_RX_END_INT_ENA : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch4_rx_end_int_st.*/ -#define RMT_CH4_RX_END_INT_ENA (BIT(13)) -#define RMT_CH4_RX_END_INT_ENA_M (BIT(13)) -#define RMT_CH4_RX_END_INT_ENA_V 0x1 -#define RMT_CH4_RX_END_INT_ENA_S 13 -/* RMT_CH4_TX_END_INT_ENA : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch4_tx_end_int_st.*/ -#define RMT_CH4_TX_END_INT_ENA (BIT(12)) -#define RMT_CH4_TX_END_INT_ENA_M (BIT(12)) -#define RMT_CH4_TX_END_INT_ENA_V 0x1 -#define RMT_CH4_TX_END_INT_ENA_S 12 -/* RMT_CH3_ERR_INT_ENA : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch3_err_int_st.*/ -#define RMT_CH3_ERR_INT_ENA (BIT(11)) -#define RMT_CH3_ERR_INT_ENA_M (BIT(11)) -#define RMT_CH3_ERR_INT_ENA_V 0x1 -#define RMT_CH3_ERR_INT_ENA_S 11 -/* RMT_CH3_RX_END_INT_ENA : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch3_rx_end_int_st.*/ -#define RMT_CH3_RX_END_INT_ENA (BIT(10)) -#define RMT_CH3_RX_END_INT_ENA_M (BIT(10)) -#define RMT_CH3_RX_END_INT_ENA_V 0x1 -#define RMT_CH3_RX_END_INT_ENA_S 10 -/* RMT_CH3_TX_END_INT_ENA : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch3_tx_end_int_st.*/ -#define RMT_CH3_TX_END_INT_ENA (BIT(9)) -#define RMT_CH3_TX_END_INT_ENA_M (BIT(9)) -#define RMT_CH3_TX_END_INT_ENA_V 0x1 -#define RMT_CH3_TX_END_INT_ENA_S 9 -/* RMT_CH2_ERR_INT_ENA : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch2_err_int_st.*/ -#define RMT_CH2_ERR_INT_ENA (BIT(8)) -#define RMT_CH2_ERR_INT_ENA_M (BIT(8)) -#define RMT_CH2_ERR_INT_ENA_V 0x1 -#define RMT_CH2_ERR_INT_ENA_S 8 -/* RMT_CH2_RX_END_INT_ENA : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch2_rx_end_int_st.*/ -#define RMT_CH2_RX_END_INT_ENA (BIT(7)) -#define RMT_CH2_RX_END_INT_ENA_M (BIT(7)) -#define RMT_CH2_RX_END_INT_ENA_V 0x1 -#define RMT_CH2_RX_END_INT_ENA_S 7 -/* RMT_CH2_TX_END_INT_ENA : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch2_tx_end_int_st.*/ -#define RMT_CH2_TX_END_INT_ENA (BIT(6)) -#define RMT_CH2_TX_END_INT_ENA_M (BIT(6)) -#define RMT_CH2_TX_END_INT_ENA_V 0x1 -#define RMT_CH2_TX_END_INT_ENA_S 6 -/* RMT_CH1_ERR_INT_ENA : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch1_err_int_st.*/ -#define RMT_CH1_ERR_INT_ENA (BIT(5)) -#define RMT_CH1_ERR_INT_ENA_M (BIT(5)) -#define RMT_CH1_ERR_INT_ENA_V 0x1 -#define RMT_CH1_ERR_INT_ENA_S 5 -/* RMT_CH1_RX_END_INT_ENA : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch1_rx_end_int_st.*/ -#define RMT_CH1_RX_END_INT_ENA (BIT(4)) -#define RMT_CH1_RX_END_INT_ENA_M (BIT(4)) -#define RMT_CH1_RX_END_INT_ENA_V 0x1 -#define RMT_CH1_RX_END_INT_ENA_S 4 -/* RMT_CH1_TX_END_INT_ENA : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch1_tx_end_int_st.*/ -#define RMT_CH1_TX_END_INT_ENA (BIT(3)) -#define RMT_CH1_TX_END_INT_ENA_M (BIT(3)) -#define RMT_CH1_TX_END_INT_ENA_V 0x1 -#define RMT_CH1_TX_END_INT_ENA_S 3 -/* RMT_CH0_ERR_INT_ENA : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch0_err_int_st.*/ -#define RMT_CH0_ERR_INT_ENA (BIT(2)) -#define RMT_CH0_ERR_INT_ENA_M (BIT(2)) -#define RMT_CH0_ERR_INT_ENA_V 0x1 -#define RMT_CH0_ERR_INT_ENA_S 2 -/* RMT_CH0_RX_END_INT_ENA : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch0_rx_end_int_st.*/ -#define RMT_CH0_RX_END_INT_ENA (BIT(1)) -#define RMT_CH0_RX_END_INT_ENA_M (BIT(1)) -#define RMT_CH0_RX_END_INT_ENA_V 0x1 -#define RMT_CH0_RX_END_INT_ENA_S 1 -/* RMT_CH0_TX_END_INT_ENA : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: Set this bit to enable rmt_ch0_tx_end_int_st.*/ -#define RMT_CH0_TX_END_INT_ENA (BIT(0)) -#define RMT_CH0_TX_END_INT_ENA_M (BIT(0)) -#define RMT_CH0_TX_END_INT_ENA_V 0x1 -#define RMT_CH0_TX_END_INT_ENA_S 0 - -#define RMT_INT_CLR_REG (DR_REG_RMT_BASE + 0x00ac) -/* RMT_CH7_TX_THR_EVENT_INT_CLR : WO ;bitpos:[31] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch7_tx_thr_event_int_raw interrupt.*/ -#define RMT_CH7_TX_THR_EVENT_INT_CLR (BIT(31)) -#define RMT_CH7_TX_THR_EVENT_INT_CLR_M (BIT(31)) -#define RMT_CH7_TX_THR_EVENT_INT_CLR_V 0x1 -#define RMT_CH7_TX_THR_EVENT_INT_CLR_S 31 -/* RMT_CH6_TX_THR_EVENT_INT_CLR : WO ;bitpos:[30] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch6_tx_thr_event_int_raw interrupt.*/ -#define RMT_CH6_TX_THR_EVENT_INT_CLR (BIT(30)) -#define RMT_CH6_TX_THR_EVENT_INT_CLR_M (BIT(30)) -#define RMT_CH6_TX_THR_EVENT_INT_CLR_V 0x1 -#define RMT_CH6_TX_THR_EVENT_INT_CLR_S 30 -/* RMT_CH5_TX_THR_EVENT_INT_CLR : WO ;bitpos:[29] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch5_tx_thr_event_int_raw interrupt.*/ -#define RMT_CH5_TX_THR_EVENT_INT_CLR (BIT(29)) -#define RMT_CH5_TX_THR_EVENT_INT_CLR_M (BIT(29)) -#define RMT_CH5_TX_THR_EVENT_INT_CLR_V 0x1 -#define RMT_CH5_TX_THR_EVENT_INT_CLR_S 29 -/* RMT_CH4_TX_THR_EVENT_INT_CLR : WO ;bitpos:[28] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch4_tx_thr_event_int_raw interrupt.*/ -#define RMT_CH4_TX_THR_EVENT_INT_CLR (BIT(28)) -#define RMT_CH4_TX_THR_EVENT_INT_CLR_M (BIT(28)) -#define RMT_CH4_TX_THR_EVENT_INT_CLR_V 0x1 -#define RMT_CH4_TX_THR_EVENT_INT_CLR_S 28 -/* RMT_CH3_TX_THR_EVENT_INT_CLR : WO ;bitpos:[27] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch3_tx_thr_event_int_raw interrupt.*/ -#define RMT_CH3_TX_THR_EVENT_INT_CLR (BIT(27)) -#define RMT_CH3_TX_THR_EVENT_INT_CLR_M (BIT(27)) -#define RMT_CH3_TX_THR_EVENT_INT_CLR_V 0x1 -#define RMT_CH3_TX_THR_EVENT_INT_CLR_S 27 -/* RMT_CH2_TX_THR_EVENT_INT_CLR : WO ;bitpos:[26] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch2_tx_thr_event_int_raw interrupt.*/ -#define RMT_CH2_TX_THR_EVENT_INT_CLR (BIT(26)) -#define RMT_CH2_TX_THR_EVENT_INT_CLR_M (BIT(26)) -#define RMT_CH2_TX_THR_EVENT_INT_CLR_V 0x1 -#define RMT_CH2_TX_THR_EVENT_INT_CLR_S 26 -/* RMT_CH1_TX_THR_EVENT_INT_CLR : WO ;bitpos:[25] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch1_tx_thr_event_int_raw interrupt.*/ -#define RMT_CH1_TX_THR_EVENT_INT_CLR (BIT(25)) -#define RMT_CH1_TX_THR_EVENT_INT_CLR_M (BIT(25)) -#define RMT_CH1_TX_THR_EVENT_INT_CLR_V 0x1 -#define RMT_CH1_TX_THR_EVENT_INT_CLR_S 25 -/* RMT_CH0_TX_THR_EVENT_INT_CLR : WO ;bitpos:[24] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch0_tx_thr_event_int_raw interrupt.*/ -#define RMT_CH0_TX_THR_EVENT_INT_CLR (BIT(24)) -#define RMT_CH0_TX_THR_EVENT_INT_CLR_M (BIT(24)) -#define RMT_CH0_TX_THR_EVENT_INT_CLR_V 0x1 -#define RMT_CH0_TX_THR_EVENT_INT_CLR_S 24 -/* RMT_CH7_ERR_INT_CLR : WO ;bitpos:[23] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch7_err_int_raw.*/ -#define RMT_CH7_ERR_INT_CLR (BIT(23)) -#define RMT_CH7_ERR_INT_CLR_M (BIT(23)) -#define RMT_CH7_ERR_INT_CLR_V 0x1 -#define RMT_CH7_ERR_INT_CLR_S 23 -/* RMT_CH7_RX_END_INT_CLR : WO ;bitpos:[22] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch7_tx_end_int_raw.*/ -#define RMT_CH7_RX_END_INT_CLR (BIT(22)) -#define RMT_CH7_RX_END_INT_CLR_M (BIT(22)) -#define RMT_CH7_RX_END_INT_CLR_V 0x1 -#define RMT_CH7_RX_END_INT_CLR_S 22 -/* RMT_CH7_TX_END_INT_CLR : WO ;bitpos:[21] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch7_rx_end_int_raw..*/ -#define RMT_CH7_TX_END_INT_CLR (BIT(21)) -#define RMT_CH7_TX_END_INT_CLR_M (BIT(21)) -#define RMT_CH7_TX_END_INT_CLR_V 0x1 -#define RMT_CH7_TX_END_INT_CLR_S 21 -/* RMT_CH6_ERR_INT_CLR : WO ;bitpos:[20] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch6_err_int_raw.*/ -#define RMT_CH6_ERR_INT_CLR (BIT(20)) -#define RMT_CH6_ERR_INT_CLR_M (BIT(20)) -#define RMT_CH6_ERR_INT_CLR_V 0x1 -#define RMT_CH6_ERR_INT_CLR_S 20 -/* RMT_CH6_RX_END_INT_CLR : WO ;bitpos:[19] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch6_tx_end_int_raw.*/ -#define RMT_CH6_RX_END_INT_CLR (BIT(19)) -#define RMT_CH6_RX_END_INT_CLR_M (BIT(19)) -#define RMT_CH6_RX_END_INT_CLR_V 0x1 -#define RMT_CH6_RX_END_INT_CLR_S 19 -/* RMT_CH6_TX_END_INT_CLR : WO ;bitpos:[18] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch6_rx_end_int_raw..*/ -#define RMT_CH6_TX_END_INT_CLR (BIT(18)) -#define RMT_CH6_TX_END_INT_CLR_M (BIT(18)) -#define RMT_CH6_TX_END_INT_CLR_V 0x1 -#define RMT_CH6_TX_END_INT_CLR_S 18 -/* RMT_CH5_ERR_INT_CLR : WO ;bitpos:[17] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch5_err_int_raw.*/ -#define RMT_CH5_ERR_INT_CLR (BIT(17)) -#define RMT_CH5_ERR_INT_CLR_M (BIT(17)) -#define RMT_CH5_ERR_INT_CLR_V 0x1 -#define RMT_CH5_ERR_INT_CLR_S 17 -/* RMT_CH5_RX_END_INT_CLR : WO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch5_tx_end_int_raw.*/ -#define RMT_CH5_RX_END_INT_CLR (BIT(16)) -#define RMT_CH5_RX_END_INT_CLR_M (BIT(16)) -#define RMT_CH5_RX_END_INT_CLR_V 0x1 -#define RMT_CH5_RX_END_INT_CLR_S 16 -/* RMT_CH5_TX_END_INT_CLR : WO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch5_rx_end_int_raw..*/ -#define RMT_CH5_TX_END_INT_CLR (BIT(15)) -#define RMT_CH5_TX_END_INT_CLR_M (BIT(15)) -#define RMT_CH5_TX_END_INT_CLR_V 0x1 -#define RMT_CH5_TX_END_INT_CLR_S 15 -/* RMT_CH4_ERR_INT_CLR : WO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch4_err_int_raw.*/ -#define RMT_CH4_ERR_INT_CLR (BIT(14)) -#define RMT_CH4_ERR_INT_CLR_M (BIT(14)) -#define RMT_CH4_ERR_INT_CLR_V 0x1 -#define RMT_CH4_ERR_INT_CLR_S 14 -/* RMT_CH4_RX_END_INT_CLR : WO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch4_tx_end_int_raw.*/ -#define RMT_CH4_RX_END_INT_CLR (BIT(13)) -#define RMT_CH4_RX_END_INT_CLR_M (BIT(13)) -#define RMT_CH4_RX_END_INT_CLR_V 0x1 -#define RMT_CH4_RX_END_INT_CLR_S 13 -/* RMT_CH4_TX_END_INT_CLR : WO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch4_rx_end_int_raw..*/ -#define RMT_CH4_TX_END_INT_CLR (BIT(12)) -#define RMT_CH4_TX_END_INT_CLR_M (BIT(12)) -#define RMT_CH4_TX_END_INT_CLR_V 0x1 -#define RMT_CH4_TX_END_INT_CLR_S 12 -/* RMT_CH3_ERR_INT_CLR : WO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch3_err_int_raw.*/ -#define RMT_CH3_ERR_INT_CLR (BIT(11)) -#define RMT_CH3_ERR_INT_CLR_M (BIT(11)) -#define RMT_CH3_ERR_INT_CLR_V 0x1 -#define RMT_CH3_ERR_INT_CLR_S 11 -/* RMT_CH3_RX_END_INT_CLR : WO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch3_tx_end_int_raw.*/ -#define RMT_CH3_RX_END_INT_CLR (BIT(10)) -#define RMT_CH3_RX_END_INT_CLR_M (BIT(10)) -#define RMT_CH3_RX_END_INT_CLR_V 0x1 -#define RMT_CH3_RX_END_INT_CLR_S 10 -/* RMT_CH3_TX_END_INT_CLR : WO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch3_rx_end_int_raw..*/ -#define RMT_CH3_TX_END_INT_CLR (BIT(9)) -#define RMT_CH3_TX_END_INT_CLR_M (BIT(9)) -#define RMT_CH3_TX_END_INT_CLR_V 0x1 -#define RMT_CH3_TX_END_INT_CLR_S 9 -/* RMT_CH2_ERR_INT_CLR : WO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch2_err_int_raw.*/ -#define RMT_CH2_ERR_INT_CLR (BIT(8)) -#define RMT_CH2_ERR_INT_CLR_M (BIT(8)) -#define RMT_CH2_ERR_INT_CLR_V 0x1 -#define RMT_CH2_ERR_INT_CLR_S 8 -/* RMT_CH2_RX_END_INT_CLR : WO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch2_tx_end_int_raw.*/ -#define RMT_CH2_RX_END_INT_CLR (BIT(7)) -#define RMT_CH2_RX_END_INT_CLR_M (BIT(7)) -#define RMT_CH2_RX_END_INT_CLR_V 0x1 -#define RMT_CH2_RX_END_INT_CLR_S 7 -/* RMT_CH2_TX_END_INT_CLR : WO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch2_rx_end_int_raw..*/ -#define RMT_CH2_TX_END_INT_CLR (BIT(6)) -#define RMT_CH2_TX_END_INT_CLR_M (BIT(6)) -#define RMT_CH2_TX_END_INT_CLR_V 0x1 -#define RMT_CH2_TX_END_INT_CLR_S 6 -/* RMT_CH1_ERR_INT_CLR : WO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch1_err_int_raw.*/ -#define RMT_CH1_ERR_INT_CLR (BIT(5)) -#define RMT_CH1_ERR_INT_CLR_M (BIT(5)) -#define RMT_CH1_ERR_INT_CLR_V 0x1 -#define RMT_CH1_ERR_INT_CLR_S 5 -/* RMT_CH1_RX_END_INT_CLR : WO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch1_tx_end_int_raw.*/ -#define RMT_CH1_RX_END_INT_CLR (BIT(4)) -#define RMT_CH1_RX_END_INT_CLR_M (BIT(4)) -#define RMT_CH1_RX_END_INT_CLR_V 0x1 -#define RMT_CH1_RX_END_INT_CLR_S 4 -/* RMT_CH1_TX_END_INT_CLR : WO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch1_rx_end_int_raw..*/ -#define RMT_CH1_TX_END_INT_CLR (BIT(3)) -#define RMT_CH1_TX_END_INT_CLR_M (BIT(3)) -#define RMT_CH1_TX_END_INT_CLR_V 0x1 -#define RMT_CH1_TX_END_INT_CLR_S 3 -/* RMT_CH0_ERR_INT_CLR : WO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch0_err_int_raw.*/ -#define RMT_CH0_ERR_INT_CLR (BIT(2)) -#define RMT_CH0_ERR_INT_CLR_M (BIT(2)) -#define RMT_CH0_ERR_INT_CLR_V 0x1 -#define RMT_CH0_ERR_INT_CLR_S 2 -/* RMT_CH0_RX_END_INT_CLR : WO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch0_tx_end_int_raw.*/ -#define RMT_CH0_RX_END_INT_CLR (BIT(1)) -#define RMT_CH0_RX_END_INT_CLR_M (BIT(1)) -#define RMT_CH0_RX_END_INT_CLR_V 0x1 -#define RMT_CH0_RX_END_INT_CLR_S 1 -/* RMT_CH0_TX_END_INT_CLR : WO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rmt_ch0_rx_end_int_raw..*/ -#define RMT_CH0_TX_END_INT_CLR (BIT(0)) -#define RMT_CH0_TX_END_INT_CLR_M (BIT(0)) -#define RMT_CH0_TX_END_INT_CLR_V 0x1 -#define RMT_CH0_TX_END_INT_CLR_S 0 - -#define RMT_CH0CARRIER_DUTY_REG (DR_REG_RMT_BASE + 0x00b0) -/* RMT_CARRIER_HIGH_CH0 : R/W ;bitpos:[31:16] ;default: 16'h40 ; */ -/*description: This register is used to configure carrier wave's high level value for channel0.*/ -#define RMT_CARRIER_HIGH_CH0 0x0000FFFF -#define RMT_CARRIER_HIGH_CH0_M ((RMT_CARRIER_HIGH_CH0_V)<<(RMT_CARRIER_HIGH_CH0_S)) -#define RMT_CARRIER_HIGH_CH0_V 0xFFFF -#define RMT_CARRIER_HIGH_CH0_S 16 -/* RMT_CARRIER_LOW_CH0 : R/W ;bitpos:[15:0] ;default: 16'h40 ; */ -/*description: This register is used to configure carrier wave's low level value for channel0.*/ -#define RMT_CARRIER_LOW_CH0 0x0000FFFF -#define RMT_CARRIER_LOW_CH0_M ((RMT_CARRIER_LOW_CH0_V)<<(RMT_CARRIER_LOW_CH0_S)) -#define RMT_CARRIER_LOW_CH0_V 0xFFFF -#define RMT_CARRIER_LOW_CH0_S 0 - -#define RMT_CH1CARRIER_DUTY_REG (DR_REG_RMT_BASE + 0x00b4) -/* RMT_CARRIER_HIGH_CH1 : R/W ;bitpos:[31:16] ;default: 16'h40 ; */ -/*description: This register is used to configure carrier wave's high level value for channel1.*/ -#define RMT_CARRIER_HIGH_CH1 0x0000FFFF -#define RMT_CARRIER_HIGH_CH1_M ((RMT_CARRIER_HIGH_CH1_V)<<(RMT_CARRIER_HIGH_CH1_S)) -#define RMT_CARRIER_HIGH_CH1_V 0xFFFF -#define RMT_CARRIER_HIGH_CH1_S 16 -/* RMT_CARRIER_LOW_CH1 : R/W ;bitpos:[15:0] ;default: 16'h40 ; */ -/*description: This register is used to configure carrier wave's low level value for channel1.*/ -#define RMT_CARRIER_LOW_CH1 0x0000FFFF -#define RMT_CARRIER_LOW_CH1_M ((RMT_CARRIER_LOW_CH1_V)<<(RMT_CARRIER_LOW_CH1_S)) -#define RMT_CARRIER_LOW_CH1_V 0xFFFF -#define RMT_CARRIER_LOW_CH1_S 0 - -#define RMT_CH2CARRIER_DUTY_REG (DR_REG_RMT_BASE + 0x00b8) -/* RMT_CARRIER_HIGH_CH2 : R/W ;bitpos:[31:16] ;default: 16'h40 ; */ -/*description: This register is used to configure carrier wave's high level value for channel2.*/ -#define RMT_CARRIER_HIGH_CH2 0x0000FFFF -#define RMT_CARRIER_HIGH_CH2_M ((RMT_CARRIER_HIGH_CH2_V)<<(RMT_CARRIER_HIGH_CH2_S)) -#define RMT_CARRIER_HIGH_CH2_V 0xFFFF -#define RMT_CARRIER_HIGH_CH2_S 16 -/* RMT_CARRIER_LOW_CH2 : R/W ;bitpos:[15:0] ;default: 16'h40 ; */ -/*description: This register is used to configure carrier wave's low level value for channel2.*/ -#define RMT_CARRIER_LOW_CH2 0x0000FFFF -#define RMT_CARRIER_LOW_CH2_M ((RMT_CARRIER_LOW_CH2_V)<<(RMT_CARRIER_LOW_CH2_S)) -#define RMT_CARRIER_LOW_CH2_V 0xFFFF -#define RMT_CARRIER_LOW_CH2_S 0 - -#define RMT_CH3CARRIER_DUTY_REG (DR_REG_RMT_BASE + 0x00bc) -/* RMT_CARRIER_HIGH_CH3 : R/W ;bitpos:[31:16] ;default: 16'h40 ; */ -/*description: This register is used to configure carrier wave's high level value for channel3.*/ -#define RMT_CARRIER_HIGH_CH3 0x0000FFFF -#define RMT_CARRIER_HIGH_CH3_M ((RMT_CARRIER_HIGH_CH3_V)<<(RMT_CARRIER_HIGH_CH3_S)) -#define RMT_CARRIER_HIGH_CH3_V 0xFFFF -#define RMT_CARRIER_HIGH_CH3_S 16 -/* RMT_CARRIER_LOW_CH3 : R/W ;bitpos:[15:0] ;default: 16'h40 ; */ -/*description: This register is used to configure carrier wave's low level value for channel3.*/ -#define RMT_CARRIER_LOW_CH3 0x0000FFFF -#define RMT_CARRIER_LOW_CH3_M ((RMT_CARRIER_LOW_CH3_V)<<(RMT_CARRIER_LOW_CH3_S)) -#define RMT_CARRIER_LOW_CH3_V 0xFFFF -#define RMT_CARRIER_LOW_CH3_S 0 - -#define RMT_CH4CARRIER_DUTY_REG (DR_REG_RMT_BASE + 0x00c0) -/* RMT_CARRIER_HIGH_CH4 : R/W ;bitpos:[31:16] ;default: 16'h40 ; */ -/*description: This register is used to configure carrier wave's high level value for channel4.*/ -#define RMT_CARRIER_HIGH_CH4 0x0000FFFF -#define RMT_CARRIER_HIGH_CH4_M ((RMT_CARRIER_HIGH_CH4_V)<<(RMT_CARRIER_HIGH_CH4_S)) -#define RMT_CARRIER_HIGH_CH4_V 0xFFFF -#define RMT_CARRIER_HIGH_CH4_S 16 -/* RMT_CARRIER_LOW_CH4 : R/W ;bitpos:[15:0] ;default: 16'h40 ; */ -/*description: This register is used to configure carrier wave's low level value for channel4.*/ -#define RMT_CARRIER_LOW_CH4 0x0000FFFF -#define RMT_CARRIER_LOW_CH4_M ((RMT_CARRIER_LOW_CH4_V)<<(RMT_CARRIER_LOW_CH4_S)) -#define RMT_CARRIER_LOW_CH4_V 0xFFFF -#define RMT_CARRIER_LOW_CH4_S 0 - -#define RMT_CH5CARRIER_DUTY_REG (DR_REG_RMT_BASE + 0x00c4) -/* RMT_CARRIER_HIGH_CH5 : R/W ;bitpos:[31:16] ;default: 16'h40 ; */ -/*description: This register is used to configure carrier wave's high level value for channel5.*/ -#define RMT_CARRIER_HIGH_CH5 0x0000FFFF -#define RMT_CARRIER_HIGH_CH5_M ((RMT_CARRIER_HIGH_CH5_V)<<(RMT_CARRIER_HIGH_CH5_S)) -#define RMT_CARRIER_HIGH_CH5_V 0xFFFF -#define RMT_CARRIER_HIGH_CH5_S 16 -/* RMT_CARRIER_LOW_CH5 : R/W ;bitpos:[15:0] ;default: 16'h40 ; */ -/*description: This register is used to configure carrier wave's low level value for channel5.*/ -#define RMT_CARRIER_LOW_CH5 0x0000FFFF -#define RMT_CARRIER_LOW_CH5_M ((RMT_CARRIER_LOW_CH5_V)<<(RMT_CARRIER_LOW_CH5_S)) -#define RMT_CARRIER_LOW_CH5_V 0xFFFF -#define RMT_CARRIER_LOW_CH5_S 0 - -#define RMT_CH6CARRIER_DUTY_REG (DR_REG_RMT_BASE + 0x00c8) -/* RMT_CARRIER_HIGH_CH6 : R/W ;bitpos:[31:16] ;default: 16'h40 ; */ -/*description: This register is used to configure carrier wave's high level value for channel6.*/ -#define RMT_CARRIER_HIGH_CH6 0x0000FFFF -#define RMT_CARRIER_HIGH_CH6_M ((RMT_CARRIER_HIGH_CH6_V)<<(RMT_CARRIER_HIGH_CH6_S)) -#define RMT_CARRIER_HIGH_CH6_V 0xFFFF -#define RMT_CARRIER_HIGH_CH6_S 16 -/* RMT_CARRIER_LOW_CH6 : R/W ;bitpos:[15:0] ;default: 16'h40 ; */ -/*description: This register is used to configure carrier wave's low level value for channel6.*/ -#define RMT_CARRIER_LOW_CH6 0x0000FFFF -#define RMT_CARRIER_LOW_CH6_M ((RMT_CARRIER_LOW_CH6_V)<<(RMT_CARRIER_LOW_CH6_S)) -#define RMT_CARRIER_LOW_CH6_V 0xFFFF -#define RMT_CARRIER_LOW_CH6_S 0 - -#define RMT_CH7CARRIER_DUTY_REG (DR_REG_RMT_BASE + 0x00cc) -/* RMT_CARRIER_HIGH_CH7 : R/W ;bitpos:[31:16] ;default: 16'h40 ; */ -/*description: This register is used to configure carrier wave's high level value for channel7.*/ -#define RMT_CARRIER_HIGH_CH7 0x0000FFFF -#define RMT_CARRIER_HIGH_CH7_M ((RMT_CARRIER_HIGH_CH7_V)<<(RMT_CARRIER_HIGH_CH7_S)) -#define RMT_CARRIER_HIGH_CH7_V 0xFFFF -#define RMT_CARRIER_HIGH_CH7_S 16 -/* RMT_CARRIER_LOW_CH7 : R/W ;bitpos:[15:0] ;default: 16'h40 ; */ -/*description: This register is used to configure carrier wave's low level value for channel7.*/ -#define RMT_CARRIER_LOW_CH7 0x0000FFFF -#define RMT_CARRIER_LOW_CH7_M ((RMT_CARRIER_LOW_CH7_V)<<(RMT_CARRIER_LOW_CH7_S)) -#define RMT_CARRIER_LOW_CH7_V 0xFFFF -#define RMT_CARRIER_LOW_CH7_S 0 - -#define RMT_CH0_TX_LIM_REG (DR_REG_RMT_BASE + 0x00d0) -/* RMT_TX_LIM_CH0 : R/W ;bitpos:[8:0] ;default: 9'h80 ; */ -/*description: When channel0 sends more than reg_rmt_tx_lim_ch0 datas then channel0 - produce the relative interrupt.*/ -#define RMT_TX_LIM_CH0 0x000001FF -#define RMT_TX_LIM_CH0_M ((RMT_TX_LIM_CH0_V)<<(RMT_TX_LIM_CH0_S)) -#define RMT_TX_LIM_CH0_V 0x1FF -#define RMT_TX_LIM_CH0_S 0 - -#define RMT_CH1_TX_LIM_REG (DR_REG_RMT_BASE + 0x00d4) -/* RMT_TX_LIM_CH1 : R/W ;bitpos:[8:0] ;default: 9'h80 ; */ -/*description: When channel1 sends more than reg_rmt_tx_lim_ch1 datas then channel1 - produce the relative interrupt.*/ -#define RMT_TX_LIM_CH1 0x000001FF -#define RMT_TX_LIM_CH1_M ((RMT_TX_LIM_CH1_V)<<(RMT_TX_LIM_CH1_S)) -#define RMT_TX_LIM_CH1_V 0x1FF -#define RMT_TX_LIM_CH1_S 0 - -#define RMT_CH2_TX_LIM_REG (DR_REG_RMT_BASE + 0x00d8) -/* RMT_TX_LIM_CH2 : R/W ;bitpos:[8:0] ;default: 9'h80 ; */ -/*description: When channel2 sends more than reg_rmt_tx_lim_ch2 datas then channel2 - produce the relative interrupt.*/ -#define RMT_TX_LIM_CH2 0x000001FF -#define RMT_TX_LIM_CH2_M ((RMT_TX_LIM_CH2_V)<<(RMT_TX_LIM_CH2_S)) -#define RMT_TX_LIM_CH2_V 0x1FF -#define RMT_TX_LIM_CH2_S 0 - -#define RMT_CH3_TX_LIM_REG (DR_REG_RMT_BASE + 0x00dc) -/* RMT_TX_LIM_CH3 : R/W ;bitpos:[8:0] ;default: 9'h80 ; */ -/*description: When channel3 sends more than reg_rmt_tx_lim_ch3 datas then channel3 - produce the relative interrupt.*/ -#define RMT_TX_LIM_CH3 0x000001FF -#define RMT_TX_LIM_CH3_M ((RMT_TX_LIM_CH3_V)<<(RMT_TX_LIM_CH3_S)) -#define RMT_TX_LIM_CH3_V 0x1FF -#define RMT_TX_LIM_CH3_S 0 - -#define RMT_CH4_TX_LIM_REG (DR_REG_RMT_BASE + 0x00e0) -/* RMT_TX_LIM_CH4 : R/W ;bitpos:[8:0] ;default: 9'h80 ; */ -/*description: When channel4 sends more than reg_rmt_tx_lim_ch4 datas then channel4 - produce the relative interrupt.*/ -#define RMT_TX_LIM_CH4 0x000001FF -#define RMT_TX_LIM_CH4_M ((RMT_TX_LIM_CH4_V)<<(RMT_TX_LIM_CH4_S)) -#define RMT_TX_LIM_CH4_V 0x1FF -#define RMT_TX_LIM_CH4_S 0 - -#define RMT_CH5_TX_LIM_REG (DR_REG_RMT_BASE + 0x00e4) -/* RMT_TX_LIM_CH5 : R/W ;bitpos:[8:0] ;default: 9'h80 ; */ -/*description: When channel5 sends more than reg_rmt_tx_lim_ch5 datas then channel5 - produce the relative interrupt.*/ -#define RMT_TX_LIM_CH5 0x000001FF -#define RMT_TX_LIM_CH5_M ((RMT_TX_LIM_CH5_V)<<(RMT_TX_LIM_CH5_S)) -#define RMT_TX_LIM_CH5_V 0x1FF -#define RMT_TX_LIM_CH5_S 0 - -#define RMT_CH6_TX_LIM_REG (DR_REG_RMT_BASE + 0x00e8) -/* RMT_TX_LIM_CH6 : R/W ;bitpos:[8:0] ;default: 9'h80 ; */ -/*description: When channel6 sends more than reg_rmt_tx_lim_ch6 datas then channel6 - produce the relative interrupt.*/ -#define RMT_TX_LIM_CH6 0x000001FF -#define RMT_TX_LIM_CH6_M ((RMT_TX_LIM_CH6_V)<<(RMT_TX_LIM_CH6_S)) -#define RMT_TX_LIM_CH6_V 0x1FF -#define RMT_TX_LIM_CH6_S 0 - -#define RMT_CH7_TX_LIM_REG (DR_REG_RMT_BASE + 0x00ec) -/* RMT_TX_LIM_CH7 : R/W ;bitpos:[8:0] ;default: 9'h80 ; */ -/*description: When channel7 sends more than reg_rmt_tx_lim_ch7 datas then channel7 - produce the relative interrupt.*/ -#define RMT_TX_LIM_CH7 0x000001FF -#define RMT_TX_LIM_CH7_M ((RMT_TX_LIM_CH7_V)<<(RMT_TX_LIM_CH7_S)) -#define RMT_TX_LIM_CH7_V 0x1FF -#define RMT_TX_LIM_CH7_S 0 - -#define RMT_APB_CONF_REG (DR_REG_RMT_BASE + 0x00f0) -/* RMT_MEM_TX_WRAP_EN : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: when datas need to be send is more than channel's mem can store - then set this bit to enable reusage of mem this bit is used together with reg_rmt_tx_lim_chn.*/ -#define RMT_MEM_TX_WRAP_EN (BIT(1)) -#define RMT_MEM_TX_WRAP_EN_M (BIT(1)) -#define RMT_MEM_TX_WRAP_EN_V 0x1 -#define RMT_MEM_TX_WRAP_EN_S 1 -/* RMT_APB_FIFO_MASK : R/W ;bitpos:[0] ;default: 1'h0 ; */ -/*description: Set this bit to disable apb fifo access*/ -#define RMT_APB_FIFO_MASK (BIT(0)) -#define RMT_APB_FIFO_MASK_M (BIT(0)) -#define RMT_APB_FIFO_MASK_V 0x1 -#define RMT_APB_FIFO_MASK_S 0 - -#define RMT_DATE_REG (DR_REG_RMT_BASE + 0x00fc) -/* RMT_DATE : R/W ;bitpos:[31:0] ;default: 32'h16022600 ; */ -/*description: This is the version register.*/ -#define RMT_DATE 0xFFFFFFFF -#define RMT_DATE_M ((RMT_DATE_V)<<(RMT_DATE_S)) -#define RMT_DATE_V 0xFFFFFFFF -#define RMT_DATE_S 0 - -/* RMT memory block address */ -#define RMT_CHANNEL_MEM(i) (DR_REG_RMT_BASE + 0x800 + 64 * 4 * (i)) - - -#endif /*_SOC_RMT_REG_H_ */ - - diff --git a/tools/sdk/include/soc/soc/rmt_struct.h b/tools/sdk/include/soc/soc/rmt_struct.h deleted file mode 100644 index 3fb254ad60b..00000000000 --- a/tools/sdk/include/soc/soc/rmt_struct.h +++ /dev/null @@ -1,262 +0,0 @@ -// 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. -#ifndef _SOC_RMT_STRUCT_H_ -#define _SOC_RMT_STRUCT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef volatile struct { - uint32_t data_ch[8]; /*The R/W ram address for channel0-7 by apb fifo access. - Note that in some circumstances, data read from the FIFO may get lost. As RMT memory area accesses using the RMTMEM method do not have this issue - and provide all the functionality that the FIFO register has, it is encouraged to use that instead.*/ - struct{ - union { - struct { - uint32_t div_cnt: 8; /*This register is used to configure the frequency divider's factor in channel0-7.*/ - uint32_t idle_thres: 16; /*In receive mode when no edge is detected on the input signal for longer than reg_idle_thres_ch0 then the receive process is done.*/ - uint32_t mem_size: 4; /*This register is used to configure the the amount of memory blocks allocated to channel0-7.*/ - uint32_t carrier_en: 1; /*This is the carrier modulation enable control bit for channel0-7.*/ - uint32_t carrier_out_lv: 1; /*This bit is used to configure the way carrier wave is modulated for channel0-7.1'b1:transmit on low output level 1'b0:transmit on high output level.*/ - uint32_t mem_pd: 1; /*This bit is used to reduce power consumed by memory. 1:memory is in low power state.*/ - uint32_t clk_en: 1; /*This bit is used to control clock.when software configure RMT internal registers it controls the register clock.*/ - }; - uint32_t val; - } conf0; - union { - struct { - uint32_t tx_start: 1; /*Set this bit to start sending data for channel0-7.*/ - uint32_t rx_en: 1; /*Set this bit to enable receiving data for channel0-7.*/ - uint32_t mem_wr_rst: 1; /*Set this bit to reset write ram address for channel0-7 by receiver access.*/ - uint32_t mem_rd_rst: 1; /*Set this bit to reset read ram address for channel0-7 by transmitter access.*/ - uint32_t apb_mem_rst: 1; /*Set this bit to reset W/R ram address for channel0-7 by apb fifo access (using fifo is discouraged, please see the note above at data_ch[] item)*/ - uint32_t mem_owner: 1; /*This is the mark of channel0-7's ram usage right.1'b1:receiver uses the ram 0:transmitter uses the ram*/ - uint32_t tx_conti_mode: 1; /*Set this bit to continue sending from the first data to the last data in channel0-7 again and again.*/ - uint32_t rx_filter_en: 1; /*This is the receive filter enable bit for channel0-7.*/ - uint32_t rx_filter_thres: 8; /*in receive mode channel0-7 ignore input pulse when the pulse width is smaller then this value.*/ - uint32_t ref_cnt_rst: 1; /*This bit is used to reset divider in channel0-7.*/ - uint32_t ref_always_on: 1; /*This bit is used to select base clock. 1'b1:clk_apb 1'b0:clk_ref*/ - uint32_t idle_out_lv: 1; /*This bit configures the output signal's level for channel0-7 in IDLE state.*/ - uint32_t idle_out_en: 1; /*This is the output enable control bit for channel0-7 in IDLE state.*/ - uint32_t reserved20: 12; - }; - uint32_t val; - } conf1; - } conf_ch[8]; - uint32_t status_ch[8]; /*The status for channel0-7*/ - uint32_t apb_mem_addr_ch[8]; /*The ram relative address in channel0-7 by apb fifo access (using fifo is discouraged, please see the note above at data_ch[] item)*/ - union { - struct { - uint32_t ch0_tx_end: 1; /*The interrupt raw bit for channel 0 turns to high level when the transmit process is done.*/ - uint32_t ch0_rx_end: 1; /*The interrupt raw bit for channel 0 turns to high level when the receive process is done.*/ - uint32_t ch0_err: 1; /*The interrupt raw bit for channel 0 turns to high level when channel 0 detects some errors.*/ - uint32_t ch1_tx_end: 1; /*The interrupt raw bit for channel 1 turns to high level when the transmit process is done.*/ - uint32_t ch1_rx_end: 1; /*The interrupt raw bit for channel 1 turns to high level when the receive process is done.*/ - uint32_t ch1_err: 1; /*The interrupt raw bit for channel 1 turns to high level when channel 1 detects some errors.*/ - uint32_t ch2_tx_end: 1; /*The interrupt raw bit for channel 2 turns to high level when the transmit process is done.*/ - uint32_t ch2_rx_end: 1; /*The interrupt raw bit for channel 2 turns to high level when the receive process is done.*/ - uint32_t ch2_err: 1; /*The interrupt raw bit for channel 2 turns to high level when channel 2 detects some errors.*/ - uint32_t ch3_tx_end: 1; /*The interrupt raw bit for channel 3 turns to high level when the transmit process is done.*/ - uint32_t ch3_rx_end: 1; /*The interrupt raw bit for channel 3 turns to high level when the receive process is done.*/ - uint32_t ch3_err: 1; /*The interrupt raw bit for channel 3 turns to high level when channel 3 detects some errors.*/ - uint32_t ch4_tx_end: 1; /*The interrupt raw bit for channel 4 turns to high level when the transmit process is done.*/ - uint32_t ch4_rx_end: 1; /*The interrupt raw bit for channel 4 turns to high level when the receive process is done.*/ - uint32_t ch4_err: 1; /*The interrupt raw bit for channel 4 turns to high level when channel 4 detects some errors.*/ - uint32_t ch5_tx_end: 1; /*The interrupt raw bit for channel 5 turns to high level when the transmit process is done.*/ - uint32_t ch5_rx_end: 1; /*The interrupt raw bit for channel 5 turns to high level when the receive process is done.*/ - uint32_t ch5_err: 1; /*The interrupt raw bit for channel 5 turns to high level when channel 5 detects some errors.*/ - uint32_t ch6_tx_end: 1; /*The interrupt raw bit for channel 6 turns to high level when the transmit process is done.*/ - uint32_t ch6_rx_end: 1; /*The interrupt raw bit for channel 6 turns to high level when the receive process is done.*/ - uint32_t ch6_err: 1; /*The interrupt raw bit for channel 6 turns to high level when channel 6 detects some errors.*/ - uint32_t ch7_tx_end: 1; /*The interrupt raw bit for channel 7 turns to high level when the transmit process is done.*/ - uint32_t ch7_rx_end: 1; /*The interrupt raw bit for channel 7 turns to high level when the receive process is done.*/ - uint32_t ch7_err: 1; /*The interrupt raw bit for channel 7 turns to high level when channel 7 detects some errors.*/ - uint32_t ch0_tx_thr_event: 1; /*The interrupt raw bit for channel 0 turns to high level when transmitter in channel0 have send data more than reg_rmt_tx_lim_ch0 after detecting this interrupt software can updata the old data with new data.*/ - uint32_t ch1_tx_thr_event: 1; /*The interrupt raw bit for channel 1 turns to high level when transmitter in channel1 have send data more than reg_rmt_tx_lim_ch1 after detecting this interrupt software can updata the old data with new data.*/ - uint32_t ch2_tx_thr_event: 1; /*The interrupt raw bit for channel 2 turns to high level when transmitter in channel2 have send data more than reg_rmt_tx_lim_ch2 after detecting this interrupt software can updata the old data with new data.*/ - uint32_t ch3_tx_thr_event: 1; /*The interrupt raw bit for channel 3 turns to high level when transmitter in channel3 have send data more than reg_rmt_tx_lim_ch3 after detecting this interrupt software can updata the old data with new data.*/ - uint32_t ch4_tx_thr_event: 1; /*The interrupt raw bit for channel 4 turns to high level when transmitter in channel4 have send data more than reg_rmt_tx_lim_ch4 after detecting this interrupt software can updata the old data with new data.*/ - uint32_t ch5_tx_thr_event: 1; /*The interrupt raw bit for channel 5 turns to high level when transmitter in channel5 have send data more than reg_rmt_tx_lim_ch5 after detecting this interrupt software can updata the old data with new data.*/ - uint32_t ch6_tx_thr_event: 1; /*The interrupt raw bit for channel 6 turns to high level when transmitter in channel6 have send data more than reg_rmt_tx_lim_ch6 after detecting this interrupt software can updata the old data with new data.*/ - uint32_t ch7_tx_thr_event: 1; /*The interrupt raw bit for channel 7 turns to high level when transmitter in channel7 have send data more than reg_rmt_tx_lim_ch7 after detecting this interrupt software can updata the old data with new data.*/ - }; - uint32_t val; - } int_raw; - union { - struct { - uint32_t ch0_tx_end: 1; /*The interrupt state bit for channel 0's mt_ch0_tx_end_int_raw when mt_ch0_tx_end_int_ena is set to 0.*/ - uint32_t ch0_rx_end: 1; /*The interrupt state bit for channel 0's rmt_ch0_rx_end_int_raw when rmt_ch0_rx_end_int_ena is set to 0.*/ - uint32_t ch0_err: 1; /*The interrupt state bit for channel 0's rmt_ch0_err_int_raw when rmt_ch0_err_int_ena is set to 0.*/ - uint32_t ch1_tx_end: 1; /*The interrupt state bit for channel 1's mt_ch1_tx_end_int_raw when mt_ch1_tx_end_int_ena is set to 1.*/ - uint32_t ch1_rx_end: 1; /*The interrupt state bit for channel 1's rmt_ch1_rx_end_int_raw when rmt_ch1_rx_end_int_ena is set to 1.*/ - uint32_t ch1_err: 1; /*The interrupt state bit for channel 1's rmt_ch1_err_int_raw when rmt_ch1_err_int_ena is set to 1.*/ - uint32_t ch2_tx_end: 1; /*The interrupt state bit for channel 2's mt_ch2_tx_end_int_raw when mt_ch2_tx_end_int_ena is set to 1.*/ - uint32_t ch2_rx_end: 1; /*The interrupt state bit for channel 2's rmt_ch2_rx_end_int_raw when rmt_ch2_rx_end_int_ena is set to 1.*/ - uint32_t ch2_err: 1; /*The interrupt state bit for channel 2's rmt_ch2_err_int_raw when rmt_ch2_err_int_ena is set to 1.*/ - uint32_t ch3_tx_end: 1; /*The interrupt state bit for channel 3's mt_ch3_tx_end_int_raw when mt_ch3_tx_end_int_ena is set to 1.*/ - uint32_t ch3_rx_end: 1; /*The interrupt state bit for channel 3's rmt_ch3_rx_end_int_raw when rmt_ch3_rx_end_int_ena is set to 1.*/ - uint32_t ch3_err: 1; /*The interrupt state bit for channel 3's rmt_ch3_err_int_raw when rmt_ch3_err_int_ena is set to 1.*/ - uint32_t ch4_tx_end: 1; /*The interrupt state bit for channel 4's mt_ch4_tx_end_int_raw when mt_ch4_tx_end_int_ena is set to 1.*/ - uint32_t ch4_rx_end: 1; /*The interrupt state bit for channel 4's rmt_ch4_rx_end_int_raw when rmt_ch4_rx_end_int_ena is set to 1.*/ - uint32_t ch4_err: 1; /*The interrupt state bit for channel 4's rmt_ch4_err_int_raw when rmt_ch4_err_int_ena is set to 1.*/ - uint32_t ch5_tx_end: 1; /*The interrupt state bit for channel 5's mt_ch5_tx_end_int_raw when mt_ch5_tx_end_int_ena is set to 1.*/ - uint32_t ch5_rx_end: 1; /*The interrupt state bit for channel 5's rmt_ch5_rx_end_int_raw when rmt_ch5_rx_end_int_ena is set to 1.*/ - uint32_t ch5_err: 1; /*The interrupt state bit for channel 5's rmt_ch5_err_int_raw when rmt_ch5_err_int_ena is set to 1.*/ - uint32_t ch6_tx_end: 1; /*The interrupt state bit for channel 6's mt_ch6_tx_end_int_raw when mt_ch6_tx_end_int_ena is set to 1.*/ - uint32_t ch6_rx_end: 1; /*The interrupt state bit for channel 6's rmt_ch6_rx_end_int_raw when rmt_ch6_rx_end_int_ena is set to 1.*/ - uint32_t ch6_err: 1; /*The interrupt state bit for channel 6's rmt_ch6_err_int_raw when rmt_ch6_err_int_ena is set to 1.*/ - uint32_t ch7_tx_end: 1; /*The interrupt state bit for channel 7's mt_ch7_tx_end_int_raw when mt_ch7_tx_end_int_ena is set to 1.*/ - uint32_t ch7_rx_end: 1; /*The interrupt state bit for channel 7's rmt_ch7_rx_end_int_raw when rmt_ch7_rx_end_int_ena is set to 1.*/ - uint32_t ch7_err: 1; /*The interrupt state bit for channel 7's rmt_ch7_err_int_raw when rmt_ch7_err_int_ena is set to 1.*/ - uint32_t ch0_tx_thr_event: 1; /*The interrupt state bit for channel 0's rmt_ch0_tx_thr_event_int_raw when mt_ch0_tx_thr_event_int_ena is set to 1.*/ - uint32_t ch1_tx_thr_event: 1; /*The interrupt state bit for channel 1's rmt_ch1_tx_thr_event_int_raw when mt_ch1_tx_thr_event_int_ena is set to 1.*/ - uint32_t ch2_tx_thr_event: 1; /*The interrupt state bit for channel 2's rmt_ch2_tx_thr_event_int_raw when mt_ch2_tx_thr_event_int_ena is set to 1.*/ - uint32_t ch3_tx_thr_event: 1; /*The interrupt state bit for channel 3's rmt_ch3_tx_thr_event_int_raw when mt_ch3_tx_thr_event_int_ena is set to 1.*/ - uint32_t ch4_tx_thr_event: 1; /*The interrupt state bit for channel 4's rmt_ch4_tx_thr_event_int_raw when mt_ch4_tx_thr_event_int_ena is set to 1.*/ - uint32_t ch5_tx_thr_event: 1; /*The interrupt state bit for channel 5's rmt_ch5_tx_thr_event_int_raw when mt_ch5_tx_thr_event_int_ena is set to 1.*/ - uint32_t ch6_tx_thr_event: 1; /*The interrupt state bit for channel 6's rmt_ch6_tx_thr_event_int_raw when mt_ch6_tx_thr_event_int_ena is set to 1.*/ - uint32_t ch7_tx_thr_event: 1; /*The interrupt state bit for channel 7's rmt_ch7_tx_thr_event_int_raw when mt_ch7_tx_thr_event_int_ena is set to 1.*/ - }; - uint32_t val; - } int_st; - union { - struct { - uint32_t ch0_tx_end: 1; /*Set this bit to enable rmt_ch0_tx_end_int_st.*/ - uint32_t ch0_rx_end: 1; /*Set this bit to enable rmt_ch0_rx_end_int_st.*/ - uint32_t ch0_err: 1; /*Set this bit to enable rmt_ch0_err_int_st.*/ - uint32_t ch1_tx_end: 1; /*Set this bit to enable rmt_ch1_tx_end_int_st.*/ - uint32_t ch1_rx_end: 1; /*Set this bit to enable rmt_ch1_rx_end_int_st.*/ - uint32_t ch1_err: 1; /*Set this bit to enable rmt_ch1_err_int_st.*/ - uint32_t ch2_tx_end: 1; /*Set this bit to enable rmt_ch2_tx_end_int_st.*/ - uint32_t ch2_rx_end: 1; /*Set this bit to enable rmt_ch2_rx_end_int_st.*/ - uint32_t ch2_err: 1; /*Set this bit to enable rmt_ch2_err_int_st.*/ - uint32_t ch3_tx_end: 1; /*Set this bit to enable rmt_ch3_tx_end_int_st.*/ - uint32_t ch3_rx_end: 1; /*Set this bit to enable rmt_ch3_rx_end_int_st.*/ - uint32_t ch3_err: 1; /*Set this bit to enable rmt_ch3_err_int_st.*/ - uint32_t ch4_tx_end: 1; /*Set this bit to enable rmt_ch4_tx_end_int_st.*/ - uint32_t ch4_rx_end: 1; /*Set this bit to enable rmt_ch4_rx_end_int_st.*/ - uint32_t ch4_err: 1; /*Set this bit to enable rmt_ch4_err_int_st.*/ - uint32_t ch5_tx_end: 1; /*Set this bit to enable rmt_ch5_tx_end_int_st.*/ - uint32_t ch5_rx_end: 1; /*Set this bit to enable rmt_ch5_rx_end_int_st.*/ - uint32_t ch5_err: 1; /*Set this bit to enable rmt_ch5_err_int_st.*/ - uint32_t ch6_tx_end: 1; /*Set this bit to enable rmt_ch6_tx_end_int_st.*/ - uint32_t ch6_rx_end: 1; /*Set this bit to enable rmt_ch6_rx_end_int_st.*/ - uint32_t ch6_err: 1; /*Set this bit to enable rmt_ch6_err_int_st.*/ - uint32_t ch7_tx_end: 1; /*Set this bit to enable rmt_ch7_tx_end_int_st.*/ - uint32_t ch7_rx_end: 1; /*Set this bit to enable rmt_ch7_rx_end_int_st.*/ - uint32_t ch7_err: 1; /*Set this bit to enable rmt_ch7_err_int_st.*/ - uint32_t ch0_tx_thr_event: 1; /*Set this bit to enable rmt_ch0_tx_thr_event_int_st.*/ - uint32_t ch1_tx_thr_event: 1; /*Set this bit to enable rmt_ch1_tx_thr_event_int_st.*/ - uint32_t ch2_tx_thr_event: 1; /*Set this bit to enable rmt_ch2_tx_thr_event_int_st.*/ - uint32_t ch3_tx_thr_event: 1; /*Set this bit to enable rmt_ch3_tx_thr_event_int_st.*/ - uint32_t ch4_tx_thr_event: 1; /*Set this bit to enable rmt_ch4_tx_thr_event_int_st.*/ - uint32_t ch5_tx_thr_event: 1; /*Set this bit to enable rmt_ch5_tx_thr_event_int_st.*/ - uint32_t ch6_tx_thr_event: 1; /*Set this bit to enable rmt_ch6_tx_thr_event_int_st.*/ - uint32_t ch7_tx_thr_event: 1; /*Set this bit to enable rmt_ch7_tx_thr_event_int_st.*/ - }; - uint32_t val; - } int_ena; - union { - struct { - uint32_t ch0_tx_end: 1; /*Set this bit to clear the rmt_ch0_rx_end_int_raw..*/ - uint32_t ch0_rx_end: 1; /*Set this bit to clear the rmt_ch0_tx_end_int_raw.*/ - uint32_t ch0_err: 1; /*Set this bit to clear the rmt_ch0_err_int_raw.*/ - uint32_t ch1_tx_end: 1; /*Set this bit to clear the rmt_ch1_rx_end_int_raw..*/ - uint32_t ch1_rx_end: 1; /*Set this bit to clear the rmt_ch1_tx_end_int_raw.*/ - uint32_t ch1_err: 1; /*Set this bit to clear the rmt_ch1_err_int_raw.*/ - uint32_t ch2_tx_end: 1; /*Set this bit to clear the rmt_ch2_rx_end_int_raw..*/ - uint32_t ch2_rx_end: 1; /*Set this bit to clear the rmt_ch2_tx_end_int_raw.*/ - uint32_t ch2_err: 1; /*Set this bit to clear the rmt_ch2_err_int_raw.*/ - uint32_t ch3_tx_end: 1; /*Set this bit to clear the rmt_ch3_rx_end_int_raw..*/ - uint32_t ch3_rx_end: 1; /*Set this bit to clear the rmt_ch3_tx_end_int_raw.*/ - uint32_t ch3_err: 1; /*Set this bit to clear the rmt_ch3_err_int_raw.*/ - uint32_t ch4_tx_end: 1; /*Set this bit to clear the rmt_ch4_rx_end_int_raw..*/ - uint32_t ch4_rx_end: 1; /*Set this bit to clear the rmt_ch4_tx_end_int_raw.*/ - uint32_t ch4_err: 1; /*Set this bit to clear the rmt_ch4_err_int_raw.*/ - uint32_t ch5_tx_end: 1; /*Set this bit to clear the rmt_ch5_rx_end_int_raw..*/ - uint32_t ch5_rx_end: 1; /*Set this bit to clear the rmt_ch5_tx_end_int_raw.*/ - uint32_t ch5_err: 1; /*Set this bit to clear the rmt_ch5_err_int_raw.*/ - uint32_t ch6_tx_end: 1; /*Set this bit to clear the rmt_ch6_rx_end_int_raw..*/ - uint32_t ch6_rx_end: 1; /*Set this bit to clear the rmt_ch6_tx_end_int_raw.*/ - uint32_t ch6_err: 1; /*Set this bit to clear the rmt_ch6_err_int_raw.*/ - uint32_t ch7_tx_end: 1; /*Set this bit to clear the rmt_ch7_rx_end_int_raw..*/ - uint32_t ch7_rx_end: 1; /*Set this bit to clear the rmt_ch7_tx_end_int_raw.*/ - uint32_t ch7_err: 1; /*Set this bit to clear the rmt_ch7_err_int_raw.*/ - uint32_t ch0_tx_thr_event: 1; /*Set this bit to clear the rmt_ch0_tx_thr_event_int_raw interrupt.*/ - uint32_t ch1_tx_thr_event: 1; /*Set this bit to clear the rmt_ch1_tx_thr_event_int_raw interrupt.*/ - uint32_t ch2_tx_thr_event: 1; /*Set this bit to clear the rmt_ch2_tx_thr_event_int_raw interrupt.*/ - uint32_t ch3_tx_thr_event: 1; /*Set this bit to clear the rmt_ch3_tx_thr_event_int_raw interrupt.*/ - uint32_t ch4_tx_thr_event: 1; /*Set this bit to clear the rmt_ch4_tx_thr_event_int_raw interrupt.*/ - uint32_t ch5_tx_thr_event: 1; /*Set this bit to clear the rmt_ch5_tx_thr_event_int_raw interrupt.*/ - uint32_t ch6_tx_thr_event: 1; /*Set this bit to clear the rmt_ch6_tx_thr_event_int_raw interrupt.*/ - uint32_t ch7_tx_thr_event: 1; /*Set this bit to clear the rmt_ch7_tx_thr_event_int_raw interrupt.*/ - }; - uint32_t val; - } int_clr; - union { - struct { - uint32_t low: 16; /*This register is used to configure carrier wave's low level value for channel0-7.*/ - uint32_t high:16; /*This register is used to configure carrier wave's high level value for channel0-7.*/ - }; - uint32_t val; - } carrier_duty_ch[8]; - union { - struct { - uint32_t limit: 9; /*When channel0-7 sends more than reg_rmt_tx_lim_ch0 data then channel0-7 produce the relative interrupt.*/ - uint32_t reserved9: 23; - }; - uint32_t val; - } tx_lim_ch[8]; - union { - struct { - uint32_t fifo_mask: 1; /*Set this bit to enable RMTMEM and disable apb fifo access (using fifo is discouraged, please see the note above at data_ch[] item)*/ - uint32_t mem_tx_wrap_en: 1; /*when data need to be send is more than channel's mem can store then set this bit to enable reuse of mem this bit is used together with reg_rmt_tx_lim_chn.*/ - uint32_t reserved2: 30; - }; - uint32_t val; - } apb_conf; - uint32_t reserved_f4; - uint32_t reserved_f8; - uint32_t date; /*This is the version register.*/ -} rmt_dev_t; -extern rmt_dev_t RMT; - -typedef struct { - union { - struct { - uint32_t duration0 :15; - uint32_t level0 :1; - uint32_t duration1 :15; - uint32_t level1 :1; - }; - uint32_t val; - }; -} rmt_item32_t; - -//Allow access to RMT memory using RMTMEM.chan[0].data32[8] -typedef volatile struct { - struct { - union { - rmt_item32_t data32[64]; - }; - } chan[8]; -} rmt_mem_t; -extern rmt_mem_t RMTMEM; - -#ifdef __cplusplus -} -#endif - -#endif /* _SOC_RMT_STRUCT_H_ */ diff --git a/tools/sdk/include/soc/soc/rtc.h b/tools/sdk/include/soc/soc/rtc.h deleted file mode 100644 index a528bdd15de..00000000000 --- a/tools/sdk/include/soc/soc/rtc.h +++ /dev/null @@ -1,726 +0,0 @@ -// 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. -#pragma once - -#include -#include -#include -#include "soc/soc.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @file rtc.h - * @brief Low-level RTC power, clock, and sleep functions. - * - * Functions in this file facilitate configuration of ESP32's RTC_CNTL peripheral. - * RTC_CNTL peripheral handles many functions: - * - enables/disables clocks and power to various parts of the chip; this is - * done using direct register access (forcing power up or power down) or by - * allowing state machines to control power and clocks automatically - * - handles sleep and wakeup functions - * - maintains a 48-bit counter which can be used for timekeeping - * - * These functions are not thread safe, and should not be viewed as high level - * APIs. For example, while this file provides a function which can switch - * CPU frequency, this function is on its own is not sufficient to implement - * frequency switching in ESP-IDF context: some coordination with RTOS, - * peripheral drivers, and WiFi/BT stacks is also required. - * - * These functions will normally not be used in applications directly. - * ESP-IDF provides, or will provide, drivers and other facilities to use - * RTC subsystem functionality. - * - * The functions are loosely split into the following groups: - * - rtc_clk: clock switching, calibration - * - rtc_time: reading RTC counter, conversion between counter values and time - * - rtc_sleep: entry into sleep modes - * - rtc_init: initialization - */ - - -/** - * @brief Possible main XTAL frequency values. - * - * Enum values should be equal to frequency in MHz. - */ -typedef enum { - RTC_XTAL_FREQ_AUTO = 0, //!< Automatic XTAL frequency detection - RTC_XTAL_FREQ_40M = 40, //!< 40 MHz XTAL - RTC_XTAL_FREQ_26M = 26, //!< 26 MHz XTAL - RTC_XTAL_FREQ_24M = 24, //!< 24 MHz XTAL -} rtc_xtal_freq_t; - -/** - * @brief CPU frequency values - */ -typedef enum { - RTC_CPU_FREQ_XTAL = 0, //!< Main XTAL frequency - RTC_CPU_FREQ_80M = 1, //!< 80 MHz - RTC_CPU_FREQ_160M = 2, //!< 160 MHz - RTC_CPU_FREQ_240M = 3, //!< 240 MHz - RTC_CPU_FREQ_2M = 4, //!< 2 MHz -} rtc_cpu_freq_t; - -/** - * @brief CPU clock source - */ -typedef enum { - RTC_CPU_FREQ_SRC_XTAL, //!< XTAL - RTC_CPU_FREQ_SRC_PLL, //!< PLL (480M or 320M) - RTC_CPU_FREQ_SRC_8M, //!< Internal 8M RTC oscillator - RTC_CPU_FREQ_SRC_APLL //!< APLL -} rtc_cpu_freq_src_t; - -/** - * @brief CPU clock configuration structure - */ -typedef struct { - rtc_cpu_freq_src_t source; //!< The clock from which CPU clock is derived - uint32_t source_freq_mhz; //!< Source clock frequency - uint32_t div; //!< Divider, freq_mhz = source_freq_mhz / div - uint32_t freq_mhz; //!< CPU clock frequency -} rtc_cpu_freq_config_t; - -/** - * @brief RTC SLOW_CLK frequency values - */ -typedef enum { - RTC_SLOW_FREQ_RTC = 0, //!< Internal 150 kHz RC oscillator - RTC_SLOW_FREQ_32K_XTAL = 1, //!< External 32 kHz XTAL - RTC_SLOW_FREQ_8MD256 = 2, //!< Internal 8 MHz RC oscillator, divided by 256 -} rtc_slow_freq_t; - -/** - * @brief RTC FAST_CLK frequency values - */ -typedef enum { - RTC_FAST_FREQ_XTALD4 = 0, //!< Main XTAL, divided by 4 - RTC_FAST_FREQ_8M = 1, //!< Internal 8 MHz RC oscillator -} rtc_fast_freq_t; - -/* With the default value of CK8M_DFREQ, 8M clock frequency is 8.5 MHz +/- 7% */ -#define RTC_FAST_CLK_FREQ_APPROX 8500000 - -/** - * @brief Clock source to be calibrated using rtc_clk_cal function - */ -typedef enum { - RTC_CAL_RTC_MUX = 0, //!< Currently selected RTC SLOW_CLK - RTC_CAL_8MD256 = 1, //!< Internal 8 MHz RC oscillator, divided by 256 - RTC_CAL_32K_XTAL = 2 //!< External 32 kHz XTAL -} rtc_cal_sel_t; - -/** - * Initialization parameters for rtc_clk_init - */ -typedef struct { - rtc_xtal_freq_t xtal_freq : 8; //!< Main XTAL frequency - rtc_cpu_freq_t cpu_freq_mhz : 10; //!< CPU frequency to set, in MHz - rtc_fast_freq_t fast_freq : 1; //!< RTC_FAST_CLK frequency to set - rtc_slow_freq_t slow_freq : 2; //!< RTC_SLOW_CLK frequency to set - uint32_t clk_8m_div : 3; //!< RTC 8M clock divider (division is by clk_8m_div+1, i.e. 0 means 8MHz frequency) - uint32_t slow_clk_dcap : 8; //!< RTC 150k clock adjustment parameter (higher value leads to lower frequency) - uint32_t clk_8m_dfreq : 8; //!< RTC 8m clock adjustment parameter (higher value leads to higher frequency) -} rtc_clk_config_t; - -/** - * Default initializer for rtc_clk_config_t - */ -#define RTC_CLK_CONFIG_DEFAULT() { \ - .xtal_freq = RTC_XTAL_FREQ_AUTO, \ - .cpu_freq_mhz = 80, \ - .fast_freq = RTC_FAST_FREQ_8M, \ - .slow_freq = RTC_SLOW_FREQ_RTC, \ - .clk_8m_div = 0, \ - .slow_clk_dcap = RTC_CNTL_SCK_DCAP_DEFAULT, \ - .clk_8m_dfreq = RTC_CNTL_CK8M_DFREQ_DEFAULT, \ -} - -/** - * Initialize clocks and set CPU frequency - * - * If cfg.xtal_freq is set to RTC_XTAL_FREQ_AUTO, this function will attempt - * to auto detect XTAL frequency. Auto detection is performed by comparing - * XTAL frequency with the frequency of internal 8MHz oscillator. Note that at - * high temperatures the frequency of the internal 8MHz oscillator may drift - * enough for auto detection to be unreliable. - * Auto detection code will attempt to distinguish between 26MHz and 40MHz - * crystals. 24 MHz crystals are not supported by auto detection code. - * If XTAL frequency can not be auto detected, this 26MHz frequency will be used. - * - * @param cfg clock configuration as rtc_clk_config_t - */ -void rtc_clk_init(rtc_clk_config_t cfg); - -/** - * @brief Get main XTAL frequency - * - * This is the value stored in RTC register RTC_XTAL_FREQ_REG by the bootloader. As passed to - * rtc_clk_init function, or if the value was RTC_XTAL_FREQ_AUTO, the detected - * XTAL frequency. - * - * @return XTAL frequency, one of rtc_xtal_freq_t - */ -rtc_xtal_freq_t rtc_clk_xtal_freq_get(); - -/** - * @brief Update XTAL frequency - * - * Updates the XTAL value stored in RTC_XTAL_FREQ_REG. Usually this value is ignored - * after startup. - * - * @param xtal_freq New frequency value - */ -void rtc_clk_xtal_freq_update(rtc_xtal_freq_t xtal_freq); - -/** - * @brief Enable or disable 32 kHz XTAL oscillator - * @param en true to enable, false to disable - */ -void rtc_clk_32k_enable(bool en); - -/** - * @brief Configure 32 kHz XTAL oscillator to accept external clock signal - */ -void rtc_clk_32k_enable_external(); - -/** - * @brief Get the state of 32k XTAL oscillator - * @return true if 32k XTAL oscillator has been enabled - */ -bool rtc_clk_32k_enabled(); - -/** - * @brief Enable 32k oscillator, configuring it for fast startup time. - * Note: to achieve higher frequency stability, rtc_clk_32k_enable function - * must be called one the 32k XTAL oscillator has started up. This function - * will initially disable the 32k XTAL oscillator, so it should not be called - * when the system is using 32k XTAL as RTC_SLOW_CLK. - * - * @param cycle Number of 32kHz cycles to bootstrap external crystal. - * If 0, no square wave will be used to bootstrap crystal oscillation. - */ -void rtc_clk_32k_bootstrap(uint32_t cycle); - -/** - * @brief Enable or disable 8 MHz internal oscillator - * - * Output from 8 MHz internal oscillator is passed into a configurable - * divider, which by default divides the input clock frequency by 256. - * Output of the divider may be used as RTC_SLOW_CLK source. - * Output of the divider is referred to in register descriptions and code as - * 8md256 or simply d256. Divider values other than 256 may be configured, but - * this facility is not currently needed, so is not exposed in the code. - * - * When 8MHz/256 divided output is not needed, the divider should be disabled - * to reduce power consumption. - * - * @param clk_8m_en true to enable 8MHz generator - * @param d256_en true to enable /256 divider - */ -void rtc_clk_8m_enable(bool clk_8m_en, bool d256_en); - -/** - * @brief Get the state of 8 MHz internal oscillator - * @return true if the oscillator is enabled - */ -bool rtc_clk_8m_enabled(); - -/** - * @brief Get the state of /256 divider which is applied to 8MHz clock - * @return true if the divided output is enabled - */ -bool rtc_clk_8md256_enabled(); - -/** - * @brief Enable or disable APLL - * - * Output frequency is given by the formula: - * apll_freq = xtal_freq * (4 + sdm2 + sdm1/256 + sdm0/65536)/((o_div + 2) * 2) - * - * The dividend in this expression should be in the range of 240 - 600 MHz. - * - * In rev. 0 of ESP32, sdm0 and sdm1 are unused and always set to 0. - * - * @param enable true to enable, false to disable - * @param sdm0 frequency adjustment parameter, 0..255 - * @param sdm1 frequency adjustment parameter, 0..255 - * @param sdm2 frequency adjustment parameter, 0..63 - * @param o_div frequency divider, 0..31 - */ -void rtc_clk_apll_enable(bool enable, uint32_t sdm0, uint32_t sdm1, - uint32_t sdm2, uint32_t o_div); - -/** - * @brief Select source for RTC_SLOW_CLK - * @param slow_freq clock source (one of rtc_slow_freq_t values) - */ -void rtc_clk_slow_freq_set(rtc_slow_freq_t slow_freq); - -/** - * @brief Get the RTC_SLOW_CLK source - * @return currently selected clock source (one of rtc_slow_freq_t values) - */ -rtc_slow_freq_t rtc_clk_slow_freq_get(); - -/** - * @brief Get the approximate frequency of RTC_SLOW_CLK, in Hz - * - * - if RTC_SLOW_FREQ_RTC is selected, returns ~150000 - * - if RTC_SLOW_FREQ_32K_XTAL is selected, returns 32768 - * - if RTC_SLOW_FREQ_8MD256 is selected, returns ~33000 - * - * rtc_clk_cal function can be used to get more precise value by comparing - * RTC_SLOW_CLK frequency to the frequency of main XTAL. - * - * @return RTC_SLOW_CLK frequency, in Hz - */ -uint32_t rtc_clk_slow_freq_get_hz(); - -/** - * @brief Select source for RTC_FAST_CLK - * @param fast_freq clock source (one of rtc_fast_freq_t values) - */ -void rtc_clk_fast_freq_set(rtc_fast_freq_t fast_freq); - -/** - * @brief Get the RTC_FAST_CLK source - * @return currently selected clock source (one of rtc_fast_freq_t values) - */ -rtc_fast_freq_t rtc_clk_fast_freq_get(); - -/** - * @brief Switch CPU frequency - * - * @note This function is deprecated and will be removed. - * See rtc_clk_cpu_freq_config_set instead. - * - * If a PLL-derived frequency is requested (80, 160, 240 MHz), this function - * will enable the PLL. Otherwise, PLL will be disabled. - * Note: this function is not optimized for switching speed. It may take several - * hundred microseconds to perform frequency switch. - * - * @param cpu_freq new CPU frequency - */ -void rtc_clk_cpu_freq_set(rtc_cpu_freq_t cpu_freq) __attribute__((deprecated)); - -/** - * @brief Switch CPU frequency - * - * @note This function is deprecated and will be removed. - * See rtc_clk_cpu_freq_set_config_fast instead. - * - * This is a faster version of rtc_clk_cpu_freq_set, which can handle some of - * the frequency switch paths (XTAL -> PLL, PLL -> XTAL). - * When switching from PLL to XTAL, PLL is not disabled (unlike rtc_clk_cpu_freq_set). - * When switching back from XTAL to PLL, only the same PLL can be used. - * Therefore it is not possible to switch 240 -> XTAL -> (80 or 160) using this - * function. - * - * For unsupported cases, this function falls back to rtc_clk_cpu_freq_set. - * - * Unlike rtc_clk_cpu_freq_set, this function relies on static data, so it is - * less safe to use it e.g. from a panic handler (when memory might be corrupted). - * - * @param cpu_freq new CPU frequency - */ -void rtc_clk_cpu_freq_set_fast(rtc_cpu_freq_t cpu_freq) __attribute__((deprecated)); - -/** - * @brief Get the currently selected CPU frequency - * - * @note This function is deprecated and will be removed. - * See rtc_clk_cpu_freq_get_config instead. - * - * Although CPU can be clocked by APLL and RTC 8M sources, such support is not - * exposed through this library. As such, this function will not return - * meaningful values when these clock sources are configured (e.g. using direct - * access to clock selection registers). In debug builds, it will assert; in - * release builds, it will return RTC_CPU_FREQ_XTAL. - * - * @return CPU frequency (one of rtc_cpu_freq_t values) - */ -rtc_cpu_freq_t rtc_clk_cpu_freq_get() __attribute__((deprecated)); - -/** - * @brief Get corresponding frequency value for rtc_cpu_freq_t enum value - * - * @note This function is deprecated and will be removed. - * See rtc_clk_cpu_freq_get/set_config instead. - * - * @param cpu_freq CPU frequency, on of rtc_cpu_freq_t values - * @return CPU frequency, in HZ - */ -uint32_t rtc_clk_cpu_freq_value(rtc_cpu_freq_t cpu_freq) __attribute__((deprecated)); - -/** - * @brief Get rtc_cpu_freq_t enum value for given CPU frequency - * - * @note This function is deprecated and will be removed. - * See rtc_clk_cpu_freq_mhz_to_config instead. - * - * @param cpu_freq_mhz CPU frequency, one of 80, 160, 240, 2, and XTAL frequency - * @param[out] out_val output, rtc_cpu_freq_t value corresponding to the frequency - * @return true if the given frequency value matches one of enum values - */ - bool rtc_clk_cpu_freq_from_mhz(int cpu_freq_mhz, rtc_cpu_freq_t* out_val) __attribute__((deprecated)); - -/** - * @brief Get CPU frequency config corresponding to a rtc_cpu_freq_t value - * @param cpu_freq CPU frequency enumeration value - * @param[out] out_config Output, CPU frequency configuration structure - */ - void rtc_clk_cpu_freq_to_config(rtc_cpu_freq_t cpu_freq, rtc_cpu_freq_config_t* out_config); - - /** - * @brief Get CPU frequency config for a given frequency - * @param freq_mhz Frequency in MHz - * @param[out] out_config Output, CPU frequency configuration structure - * @return true if frequency can be obtained, false otherwise - */ - bool rtc_clk_cpu_freq_mhz_to_config(uint32_t freq_mhz, rtc_cpu_freq_config_t* out_config); - - /** - * @brief Switch CPU frequency - * - * This function sets CPU frequency according to the given configuration - * structure. It enables PLLs, if necessary. - * - * @note This function in not intended to be called by applications in FreeRTOS - * environment. This is because it does not adjust various timers based on the - * new CPU frequency. - * - * @param config CPU frequency configuration structure - */ - void rtc_clk_cpu_freq_set_config(const rtc_cpu_freq_config_t* config); - - /** - * @brief Switch CPU frequency (optimized for speed) - * - * This function is a faster equivalent of rtc_clk_cpu_freq_set_config. - * It works faster because it does not disable PLLs when switching from PLL to - * XTAL and does not enabled them when switching back. If PLL is not already - * enabled when this function is called to switch from XTAL to PLL frequency, - * or the PLL which is enabled is the wrong one, this function will fall back - * to calling rtc_clk_cpu_freq_set_config. - * - * Unlike rtc_clk_cpu_freq_set_config, this function relies on static data, - * so it is less safe to use it e.g. from a panic handler (when memory might - * be corrupted). - * - * @note This function in not intended to be called by applications in FreeRTOS - * environment. This is because it does not adjust various timers based on the - * new CPU frequency. - * - * @param config CPU frequency configuration structure - */ - void rtc_clk_cpu_freq_set_config_fast(const rtc_cpu_freq_config_t* config); - - /** - * @brief Get the currently used CPU frequency configuration - * @param[out] out_config Output, CPU frequency configuration structure - */ - void rtc_clk_cpu_freq_get_config(rtc_cpu_freq_config_t* out_config); - - /** - * @brief Switch CPU clock source to XTAL - * - * Short form for filling in rtc_cpu_freq_config_t structure and calling - * rtc_clk_cpu_freq_set_config when a switch to XTAL is needed. - * Assumes that XTAL frequency has been determined — don't call in startup code. - */ - void rtc_clk_cpu_freq_set_xtal(); - - -/** - * @brief Store new APB frequency value into RTC_APB_FREQ_REG - * - * This function doesn't change any hardware clocks. - * - * Functions which perform frequency switching and change APB frequency call - * this function to update the value of APB frequency stored in RTC_APB_FREQ_REG - * (one of RTC general purpose retention registers). This should not normally - * be called from application code. - * - * @param apb_freq new APB frequency, in Hz - */ -void rtc_clk_apb_freq_update(uint32_t apb_freq); - -/** - * @brief Get the current stored APB frequency. - * @return The APB frequency value as last set via rtc_clk_apb_freq_update(), in Hz. - */ -uint32_t rtc_clk_apb_freq_get(); - -#define RTC_CLK_CAL_FRACT 19 //!< Number of fractional bits in values returned by rtc_clk_cal - -/** - * @brief Measure RTC slow clock's period, based on main XTAL frequency - * - * This function will time out and return 0 if the time for the given number - * of cycles to be counted exceeds the expected time twice. This may happen if - * 32k XTAL is being calibrated, but the oscillator has not started up (due to - * incorrect loading capacitance, board design issue, or lack of 32 XTAL on board). - * - * @param cal_clk clock to be measured - * @param slow_clk_cycles number of slow clock cycles to average - * @return average slow clock period in microseconds, Q13.19 fixed point format, - * or 0 if calibration has timed out - */ -uint32_t rtc_clk_cal(rtc_cal_sel_t cal_clk, uint32_t slow_clk_cycles); - -/** - * @brief Measure ratio between XTAL frequency and RTC slow clock frequency - * @param cal_clk slow clock to be measured - * @param slow_clk_cycles number of slow clock cycles to average - * @return average ratio between XTAL frequency and slow clock frequency, - * Q13.19 fixed point format, or 0 if calibration has timed out. - */ -uint32_t rtc_clk_cal_ratio(rtc_cal_sel_t cal_clk, uint32_t slow_clk_cycles); - -/** - * @brief Convert time interval from microseconds to RTC_SLOW_CLK cycles - * @param time_in_us Time interval in microseconds - * @param slow_clk_period Period of slow clock in microseconds, Q13.19 - * fixed point format (as returned by rtc_slowck_cali). - * @return number of slow clock cycles - */ -uint64_t rtc_time_us_to_slowclk(uint64_t time_in_us, uint32_t period); - -/** - * @brief Convert time interval from RTC_SLOW_CLK to microseconds - * @param time_in_us Time interval in RTC_SLOW_CLK cycles - * @param slow_clk_period Period of slow clock in microseconds, Q13.19 - * fixed point format (as returned by rtc_slowck_cali). - * @return time interval in microseconds - */ -uint64_t rtc_time_slowclk_to_us(uint64_t rtc_cycles, uint32_t period); - -/** - * @brief Get current value of RTC counter - * - * RTC has a 48-bit counter which is incremented by 2 every 2 RTC_SLOW_CLK - * cycles. Counter value is not writable by software. The value is not adjusted - * when switching to a different RTC_SLOW_CLK source. - * - * Note: this function may take up to 1 RTC_SLOW_CLK cycle to execute - * - * @return current value of RTC counter - */ -uint64_t rtc_time_get(); - -/** - * @brief Busy loop until next RTC_SLOW_CLK cycle - * - * This function returns not earlier than the next RTC_SLOW_CLK clock cycle. - * In some cases (e.g. when RTC_SLOW_CLK cycle is very close), it may return - * one RTC_SLOW_CLK cycle later. - */ -void rtc_clk_wait_for_slow_cycle(); - -/** - * @brief sleep configuration for rtc_sleep_init function - */ -typedef struct { - uint32_t lslp_mem_inf_fpu : 1; //!< force normal voltage in sleep mode (digital domain memory) - uint32_t rtc_mem_inf_fpu : 1; //!< force normal voltage in sleep mode (RTC memory) - uint32_t rtc_mem_inf_follow_cpu : 1;//!< keep low voltage in sleep mode (even if ULP/touch is used) - uint32_t rtc_fastmem_pd_en : 1; //!< power down RTC fast memory - uint32_t rtc_slowmem_pd_en : 1; //!< power down RTC slow memory - uint32_t rtc_peri_pd_en : 1; //!< power down RTC peripherals - uint32_t wifi_pd_en : 1; //!< power down WiFi - uint32_t rom_mem_pd_en : 1; //!< power down main RAM and ROM - uint32_t deep_slp : 1; //!< power down digital domain - uint32_t wdt_flashboot_mod_en : 1; //!< enable WDT flashboot mode - uint32_t dig_dbias_wak : 3; //!< set bias for digital domain, in active mode - uint32_t dig_dbias_slp : 3; //!< set bias for digital domain, in sleep mode - uint32_t rtc_dbias_wak : 3; //!< set bias for RTC domain, in active mode - uint32_t rtc_dbias_slp : 3; //!< set bias for RTC domain, in sleep mode - uint32_t lslp_meminf_pd : 1; //!< remove all peripheral force power up flags - uint32_t vddsdio_pd_en : 1; //!< power down VDDSDIO regulator - uint32_t xtal_fpu : 1; //!< keep main XTAL powered up in sleep -} rtc_sleep_config_t; - -/** - * Default initializer for rtc_sleep_config_t - * - * This initializer sets all fields to "reasonable" values (e.g. suggested for - * production use) based on a combination of RTC_SLEEP_PD_x flags. - * - * @param RTC_SLEEP_PD_x flags combined using bitwise OR - */ -#define RTC_SLEEP_CONFIG_DEFAULT(sleep_flags) { \ - .lslp_mem_inf_fpu = 0, \ - .rtc_mem_inf_fpu = 0, \ - .rtc_mem_inf_follow_cpu = ((sleep_flags) & RTC_SLEEP_PD_RTC_MEM_FOLLOW_CPU) ? 1 : 0, \ - .rtc_fastmem_pd_en = ((sleep_flags) & RTC_SLEEP_PD_RTC_FAST_MEM) ? 1 : 0, \ - .rtc_slowmem_pd_en = ((sleep_flags) & RTC_SLEEP_PD_RTC_SLOW_MEM) ? 1 : 0, \ - .rtc_peri_pd_en = ((sleep_flags) & RTC_SLEEP_PD_RTC_PERIPH) ? 1 : 0, \ - .wifi_pd_en = 0, \ - .rom_mem_pd_en = 0, \ - .deep_slp = ((sleep_flags) & RTC_SLEEP_PD_DIG) ? 1 : 0, \ - .wdt_flashboot_mod_en = 0, \ - .dig_dbias_wak = RTC_CNTL_DBIAS_1V10, \ - .dig_dbias_slp = RTC_CNTL_DBIAS_0V90, \ - .rtc_dbias_wak = RTC_CNTL_DBIAS_1V10, \ - .rtc_dbias_slp = RTC_CNTL_DBIAS_0V90, \ - .lslp_meminf_pd = 1, \ - .vddsdio_pd_en = ((sleep_flags) & RTC_SLEEP_PD_VDDSDIO) ? 1 : 0, \ - .xtal_fpu = ((sleep_flags) & RTC_SLEEP_PD_XTAL) ? 0 : 1 \ -}; - -#define RTC_SLEEP_PD_DIG BIT(0) //!< Deep sleep (power down digital domain) -#define RTC_SLEEP_PD_RTC_PERIPH BIT(1) //!< Power down RTC peripherals -#define RTC_SLEEP_PD_RTC_SLOW_MEM BIT(2) //!< Power down RTC SLOW memory -#define RTC_SLEEP_PD_RTC_FAST_MEM BIT(3) //!< Power down RTC FAST memory -#define RTC_SLEEP_PD_RTC_MEM_FOLLOW_CPU BIT(4) //!< RTC FAST and SLOW memories are automatically powered up and down along with the CPU -#define RTC_SLEEP_PD_VDDSDIO BIT(5) //!< Power down VDDSDIO regulator -#define RTC_SLEEP_PD_XTAL BIT(6) //!< Power down main XTAL - -/** - * @brief Prepare the chip to enter sleep mode - * - * This function configures various power control state machines to handle - * entry into light sleep or deep sleep mode, switches APB and CPU clock source - * (usually to XTAL), and sets bias voltages for digital and RTC power domains. - * - * This function does not actually enter sleep mode; this is done using - * rtc_sleep_start function. Software may do some other actions between - * rtc_sleep_init and rtc_sleep_start, such as set wakeup timer and configure - * wakeup sources. - * @param cfg sleep mode configuration - */ -void rtc_sleep_init(rtc_sleep_config_t cfg); - - -/** - * @brief Set target value of RTC counter for RTC_TIMER_TRIG_EN wakeup source - * @param t value of RTC counter at which wakeup from sleep will happen; - * only the lower 48 bits are used - */ -void rtc_sleep_set_wakeup_time(uint64_t t); - - -#define RTC_EXT0_TRIG_EN BIT(0) //!< EXT0 GPIO wakeup -#define RTC_EXT1_TRIG_EN BIT(1) //!< EXT1 GPIO wakeup -#define RTC_GPIO_TRIG_EN BIT(2) //!< GPIO wakeup (light sleep only) -#define RTC_TIMER_TRIG_EN BIT(3) //!< Timer wakeup -#define RTC_SDIO_TRIG_EN BIT(4) //!< SDIO wakeup (light sleep only) -#define RTC_MAC_TRIG_EN BIT(5) //!< MAC wakeup (light sleep only) -#define RTC_UART0_TRIG_EN BIT(6) //!< UART0 wakeup (light sleep only) -#define RTC_UART1_TRIG_EN BIT(7) //!< UART1 wakeup (light sleep only) -#define RTC_TOUCH_TRIG_EN BIT(8) //!< Touch wakeup -#define RTC_ULP_TRIG_EN BIT(9) //!< ULP wakeup -#define RTC_BT_TRIG_EN BIT(10) //!< BT wakeup (light sleep only) - -/** - * @brief Enter deep or light sleep mode - * - * This function enters the sleep mode previously configured using rtc_sleep_init - * function. Before entering sleep, software should configure wake up sources - * appropriately (set up GPIO wakeup registers, timer wakeup registers, - * and so on). - * - * If deep sleep mode was configured using rtc_sleep_init, and sleep is not - * rejected by hardware (based on reject_opt flags), this function never returns. - * When the chip wakes up from deep sleep, CPU is reset and execution starts - * from ROM bootloader. - * - * If light sleep mode was configured using rtc_sleep_init, this function - * returns on wakeup, or if sleep is rejected by hardware. - * - * @param wakeup_opt bit mask wake up reasons to enable (RTC_xxx_TRIG_EN flags - * combined with OR) - * @param reject_opt bit mask of sleep reject reasons: - * - RTC_CNTL_GPIO_REJECT_EN - * - RTC_CNTL_SDIO_REJECT_EN - * These flags are used to prevent entering sleep when e.g. - * an external host is communicating via SDIO slave - * @return non-zero if sleep was rejected by hardware - */ -uint32_t rtc_sleep_start(uint32_t wakeup_opt, uint32_t reject_opt); - -/** - * RTC power and clock control initialization settings - */ -typedef struct { - uint32_t ck8m_wait : 8; //!< Number of rtc_fast_clk cycles to wait for 8M clock to be ready - uint32_t xtal_wait : 8; //!< Number of rtc_fast_clk cycles to wait for XTAL clock to be ready - uint32_t pll_wait : 8; //!< Number of rtc_fast_clk cycles to wait for PLL to be ready - uint32_t clkctl_init : 1; //!< Perform clock control related initialization - uint32_t pwrctl_init : 1; //!< Perform power control related initialization - uint32_t rtc_dboost_fpd : 1; //!< Force power down RTC_DBOOST -} rtc_config_t; - -/** - * Default initializer of rtc_config_t. - * - * This initializer sets all fields to "reasonable" values (e.g. suggested for - * production use). - */ -#define RTC_CONFIG_DEFAULT() {\ - .ck8m_wait = RTC_CNTL_CK8M_WAIT_DEFAULT, \ - .xtal_wait = RTC_CNTL_XTL_BUF_WAIT_DEFAULT, \ - .pll_wait = RTC_CNTL_PLL_BUF_WAIT_DEFAULT, \ - .clkctl_init = 1, \ - .pwrctl_init = 1, \ - .rtc_dboost_fpd = 1 \ -} - -/** - * Initialize RTC clock and power control related functions - * @param cfg configuration options as rtc_config_t - */ -void rtc_init(rtc_config_t cfg); - -#define RTC_VDDSDIO_TIEH_1_8V 0 //!< TIEH field value for 1.8V VDDSDIO -#define RTC_VDDSDIO_TIEH_3_3V 1 //!< TIEH field value for 3.3V VDDSDIO - -/** - * Structure describing vddsdio configuration - */ -typedef struct { - uint32_t force : 1; //!< If 1, use configuration from RTC registers; if 0, use EFUSE/bootstrapping pins. - uint32_t enable : 1; //!< Enable VDDSDIO regulator - uint32_t tieh : 1; //!< Select VDDSDIO voltage. One of RTC_VDDSDIO_TIEH_1_8V, RTC_VDDSDIO_TIEH_3_3V - uint32_t drefh : 2; //!< Tuning parameter for VDDSDIO regulator - uint32_t drefm : 2; //!< Tuning parameter for VDDSDIO regulator - uint32_t drefl : 2; //!< Tuning parameter for VDDSDIO regulator -} rtc_vddsdio_config_t; - -/** - * Get current VDDSDIO configuration - * If VDDSDIO configuration is overridden by RTC, get values from RTC - * Otherwise, if VDDSDIO is configured by EFUSE, get values from EFUSE - * Otherwise, use default values and the level of MTDI bootstrapping pin. - * @return currently used VDDSDIO configuration - */ -rtc_vddsdio_config_t rtc_vddsdio_get_config(); - -/** - * Set new VDDSDIO configuration using RTC registers. - * If config.force == 1, this overrides configuration done using bootstrapping - * pins and EFUSE. - * - * @param config new VDDSDIO configuration - */ -void rtc_vddsdio_set_config(rtc_vddsdio_config_t config); - -#ifdef __cplusplus -} -#endif - diff --git a/tools/sdk/include/soc/soc/rtc_cntl_reg.h b/tools/sdk/include/soc/soc/rtc_cntl_reg.h deleted file mode 100644 index 090b3f7072c..00000000000 --- a/tools/sdk/include/soc/soc/rtc_cntl_reg.h +++ /dev/null @@ -1,2072 +0,0 @@ -// 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. -#ifndef _SOC_RTC_CNTL_REG_H_ -#define _SOC_RTC_CNTL_REG_H_ - -/* The value that needs to be written to RTC_CNTL_WDT_WKEY to write-enable the wdt registers */ -#define RTC_CNTL_WDT_WKEY_VALUE 0x50D83AA1 - - -#include "soc.h" -#define RTC_CNTL_OPTIONS0_REG (DR_REG_RTCCNTL_BASE + 0x0) -/* RTC_CNTL_SW_SYS_RST : WO ;bitpos:[31] ;default: 1'd0 ; */ -/*description: SW system reset*/ -#define RTC_CNTL_SW_SYS_RST (BIT(31)) -#define RTC_CNTL_SW_SYS_RST_M (BIT(31)) -#define RTC_CNTL_SW_SYS_RST_V 0x1 -#define RTC_CNTL_SW_SYS_RST_S 31 -/* RTC_CNTL_DG_WRAP_FORCE_NORST : R/W ;bitpos:[30] ;default: 1'd0 ; */ -/*description: digital core force no reset in deep sleep*/ -#define RTC_CNTL_DG_WRAP_FORCE_NORST (BIT(30)) -#define RTC_CNTL_DG_WRAP_FORCE_NORST_M (BIT(30)) -#define RTC_CNTL_DG_WRAP_FORCE_NORST_V 0x1 -#define RTC_CNTL_DG_WRAP_FORCE_NORST_S 30 -/* RTC_CNTL_DG_WRAP_FORCE_RST : R/W ;bitpos:[29] ;default: 1'd0 ; */ -/*description: digital wrap force reset in deep sleep*/ -#define RTC_CNTL_DG_WRAP_FORCE_RST (BIT(29)) -#define RTC_CNTL_DG_WRAP_FORCE_RST_M (BIT(29)) -#define RTC_CNTL_DG_WRAP_FORCE_RST_V 0x1 -#define RTC_CNTL_DG_WRAP_FORCE_RST_S 29 -/* RTC_CNTL_ANALOG_FORCE_NOISO : R/W ;bitpos:[28] ;default: 1'd1 ; */ -/*description: */ -#define RTC_CNTL_ANALOG_FORCE_NOISO (BIT(28)) -#define RTC_CNTL_ANALOG_FORCE_NOISO_M (BIT(28)) -#define RTC_CNTL_ANALOG_FORCE_NOISO_V 0x1 -#define RTC_CNTL_ANALOG_FORCE_NOISO_S 28 -/* RTC_CNTL_PLL_FORCE_NOISO : R/W ;bitpos:[27] ;default: 1'd1 ; */ -/*description: */ -#define RTC_CNTL_PLL_FORCE_NOISO (BIT(27)) -#define RTC_CNTL_PLL_FORCE_NOISO_M (BIT(27)) -#define RTC_CNTL_PLL_FORCE_NOISO_V 0x1 -#define RTC_CNTL_PLL_FORCE_NOISO_S 27 -/* RTC_CNTL_XTL_FORCE_NOISO : R/W ;bitpos:[26] ;default: 1'd1 ; */ -/*description: */ -#define RTC_CNTL_XTL_FORCE_NOISO (BIT(26)) -#define RTC_CNTL_XTL_FORCE_NOISO_M (BIT(26)) -#define RTC_CNTL_XTL_FORCE_NOISO_V 0x1 -#define RTC_CNTL_XTL_FORCE_NOISO_S 26 -/* RTC_CNTL_ANALOG_FORCE_ISO : R/W ;bitpos:[25] ;default: 1'd0 ; */ -/*description: */ -#define RTC_CNTL_ANALOG_FORCE_ISO (BIT(25)) -#define RTC_CNTL_ANALOG_FORCE_ISO_M (BIT(25)) -#define RTC_CNTL_ANALOG_FORCE_ISO_V 0x1 -#define RTC_CNTL_ANALOG_FORCE_ISO_S 25 -/* RTC_CNTL_PLL_FORCE_ISO : R/W ;bitpos:[24] ;default: 1'd0 ; */ -/*description: */ -#define RTC_CNTL_PLL_FORCE_ISO (BIT(24)) -#define RTC_CNTL_PLL_FORCE_ISO_M (BIT(24)) -#define RTC_CNTL_PLL_FORCE_ISO_V 0x1 -#define RTC_CNTL_PLL_FORCE_ISO_S 24 -/* RTC_CNTL_XTL_FORCE_ISO : R/W ;bitpos:[23] ;default: 1'd0 ; */ -/*description: */ -#define RTC_CNTL_XTL_FORCE_ISO (BIT(23)) -#define RTC_CNTL_XTL_FORCE_ISO_M (BIT(23)) -#define RTC_CNTL_XTL_FORCE_ISO_V 0x1 -#define RTC_CNTL_XTL_FORCE_ISO_S 23 -/* RTC_CNTL_BIAS_CORE_FORCE_PU : R/W ;bitpos:[22] ;default: 1'd1 ; */ -/*description: BIAS_CORE force power up*/ -#define RTC_CNTL_BIAS_CORE_FORCE_PU (BIT(22)) -#define RTC_CNTL_BIAS_CORE_FORCE_PU_M (BIT(22)) -#define RTC_CNTL_BIAS_CORE_FORCE_PU_V 0x1 -#define RTC_CNTL_BIAS_CORE_FORCE_PU_S 22 -/* RTC_CNTL_BIAS_CORE_FORCE_PD : R/W ;bitpos:[21] ;default: 1'b0 ; */ -/*description: BIAS_CORE force power down*/ -#define RTC_CNTL_BIAS_CORE_FORCE_PD (BIT(21)) -#define RTC_CNTL_BIAS_CORE_FORCE_PD_M (BIT(21)) -#define RTC_CNTL_BIAS_CORE_FORCE_PD_V 0x1 -#define RTC_CNTL_BIAS_CORE_FORCE_PD_S 21 -/* RTC_CNTL_BIAS_CORE_FOLW_8M : R/W ;bitpos:[20] ;default: 1'd0 ; */ -/*description: BIAS_CORE follow CK8M*/ -#define RTC_CNTL_BIAS_CORE_FOLW_8M (BIT(20)) -#define RTC_CNTL_BIAS_CORE_FOLW_8M_M (BIT(20)) -#define RTC_CNTL_BIAS_CORE_FOLW_8M_V 0x1 -#define RTC_CNTL_BIAS_CORE_FOLW_8M_S 20 -/* RTC_CNTL_BIAS_I2C_FORCE_PU : R/W ;bitpos:[19] ;default: 1'd1 ; */ -/*description: BIAS_I2C force power up*/ -#define RTC_CNTL_BIAS_I2C_FORCE_PU (BIT(19)) -#define RTC_CNTL_BIAS_I2C_FORCE_PU_M (BIT(19)) -#define RTC_CNTL_BIAS_I2C_FORCE_PU_V 0x1 -#define RTC_CNTL_BIAS_I2C_FORCE_PU_S 19 -/* RTC_CNTL_BIAS_I2C_FORCE_PD : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: BIAS_I2C force power down*/ -#define RTC_CNTL_BIAS_I2C_FORCE_PD (BIT(18)) -#define RTC_CNTL_BIAS_I2C_FORCE_PD_M (BIT(18)) -#define RTC_CNTL_BIAS_I2C_FORCE_PD_V 0x1 -#define RTC_CNTL_BIAS_I2C_FORCE_PD_S 18 -/* RTC_CNTL_BIAS_I2C_FOLW_8M : R/W ;bitpos:[17] ;default: 1'd0 ; */ -/*description: BIAS_I2C follow CK8M*/ -#define RTC_CNTL_BIAS_I2C_FOLW_8M (BIT(17)) -#define RTC_CNTL_BIAS_I2C_FOLW_8M_M (BIT(17)) -#define RTC_CNTL_BIAS_I2C_FOLW_8M_V 0x1 -#define RTC_CNTL_BIAS_I2C_FOLW_8M_S 17 -/* RTC_CNTL_BIAS_FORCE_NOSLEEP : R/W ;bitpos:[16] ;default: 1'd1 ; */ -/*description: BIAS_SLEEP force no sleep*/ -#define RTC_CNTL_BIAS_FORCE_NOSLEEP (BIT(16)) -#define RTC_CNTL_BIAS_FORCE_NOSLEEP_M (BIT(16)) -#define RTC_CNTL_BIAS_FORCE_NOSLEEP_V 0x1 -#define RTC_CNTL_BIAS_FORCE_NOSLEEP_S 16 -/* RTC_CNTL_BIAS_FORCE_SLEEP : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: BIAS_SLEEP force sleep*/ -#define RTC_CNTL_BIAS_FORCE_SLEEP (BIT(15)) -#define RTC_CNTL_BIAS_FORCE_SLEEP_M (BIT(15)) -#define RTC_CNTL_BIAS_FORCE_SLEEP_V 0x1 -#define RTC_CNTL_BIAS_FORCE_SLEEP_S 15 -/* RTC_CNTL_BIAS_SLEEP_FOLW_8M : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: BIAS_SLEEP follow CK8M*/ -#define RTC_CNTL_BIAS_SLEEP_FOLW_8M (BIT(14)) -#define RTC_CNTL_BIAS_SLEEP_FOLW_8M_M (BIT(14)) -#define RTC_CNTL_BIAS_SLEEP_FOLW_8M_V 0x1 -#define RTC_CNTL_BIAS_SLEEP_FOLW_8M_S 14 -/* RTC_CNTL_XTL_FORCE_PU : R/W ;bitpos:[13] ;default: 1'd1 ; */ -/*description: crystall force power up*/ -#define RTC_CNTL_XTL_FORCE_PU (BIT(13)) -#define RTC_CNTL_XTL_FORCE_PU_M (BIT(13)) -#define RTC_CNTL_XTL_FORCE_PU_V 0x1 -#define RTC_CNTL_XTL_FORCE_PU_S 13 -/* RTC_CNTL_XTL_FORCE_PD : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: crystall force power down*/ -#define RTC_CNTL_XTL_FORCE_PD (BIT(12)) -#define RTC_CNTL_XTL_FORCE_PD_M (BIT(12)) -#define RTC_CNTL_XTL_FORCE_PD_V 0x1 -#define RTC_CNTL_XTL_FORCE_PD_S 12 -/* RTC_CNTL_BBPLL_FORCE_PU : R/W ;bitpos:[11] ;default: 1'd0 ; */ -/*description: BB_PLL force power up*/ -#define RTC_CNTL_BBPLL_FORCE_PU (BIT(11)) -#define RTC_CNTL_BBPLL_FORCE_PU_M (BIT(11)) -#define RTC_CNTL_BBPLL_FORCE_PU_V 0x1 -#define RTC_CNTL_BBPLL_FORCE_PU_S 11 -/* RTC_CNTL_BBPLL_FORCE_PD : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: BB_PLL force power down*/ -#define RTC_CNTL_BBPLL_FORCE_PD (BIT(10)) -#define RTC_CNTL_BBPLL_FORCE_PD_M (BIT(10)) -#define RTC_CNTL_BBPLL_FORCE_PD_V 0x1 -#define RTC_CNTL_BBPLL_FORCE_PD_S 10 -/* RTC_CNTL_BBPLL_I2C_FORCE_PU : R/W ;bitpos:[9] ;default: 1'd0 ; */ -/*description: BB_PLL_I2C force power up*/ -#define RTC_CNTL_BBPLL_I2C_FORCE_PU (BIT(9)) -#define RTC_CNTL_BBPLL_I2C_FORCE_PU_M (BIT(9)) -#define RTC_CNTL_BBPLL_I2C_FORCE_PU_V 0x1 -#define RTC_CNTL_BBPLL_I2C_FORCE_PU_S 9 -/* RTC_CNTL_BBPLL_I2C_FORCE_PD : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: BB_PLL _I2C force power down*/ -#define RTC_CNTL_BBPLL_I2C_FORCE_PD (BIT(8)) -#define RTC_CNTL_BBPLL_I2C_FORCE_PD_M (BIT(8)) -#define RTC_CNTL_BBPLL_I2C_FORCE_PD_V 0x1 -#define RTC_CNTL_BBPLL_I2C_FORCE_PD_S 8 -/* RTC_CNTL_BB_I2C_FORCE_PU : R/W ;bitpos:[7] ;default: 1'd0 ; */ -/*description: BB_I2C force power up*/ -#define RTC_CNTL_BB_I2C_FORCE_PU (BIT(7)) -#define RTC_CNTL_BB_I2C_FORCE_PU_M (BIT(7)) -#define RTC_CNTL_BB_I2C_FORCE_PU_V 0x1 -#define RTC_CNTL_BB_I2C_FORCE_PU_S 7 -/* RTC_CNTL_BB_I2C_FORCE_PD : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: BB_I2C force power down*/ -#define RTC_CNTL_BB_I2C_FORCE_PD (BIT(6)) -#define RTC_CNTL_BB_I2C_FORCE_PD_M (BIT(6)) -#define RTC_CNTL_BB_I2C_FORCE_PD_V 0x1 -#define RTC_CNTL_BB_I2C_FORCE_PD_S 6 -/* RTC_CNTL_SW_PROCPU_RST : WO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: PRO CPU SW reset*/ -#define RTC_CNTL_SW_PROCPU_RST (BIT(5)) -#define RTC_CNTL_SW_PROCPU_RST_M (BIT(5)) -#define RTC_CNTL_SW_PROCPU_RST_V 0x1 -#define RTC_CNTL_SW_PROCPU_RST_S 5 -/* RTC_CNTL_SW_APPCPU_RST : WO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: APP CPU SW reset*/ -#define RTC_CNTL_SW_APPCPU_RST (BIT(4)) -#define RTC_CNTL_SW_APPCPU_RST_M (BIT(4)) -#define RTC_CNTL_SW_APPCPU_RST_V 0x1 -#define RTC_CNTL_SW_APPCPU_RST_S 4 -/* RTC_CNTL_SW_STALL_PROCPU_C0 : R/W ;bitpos:[3:2] ;default: 2'b0 ; */ -/*description: {reg_sw_stall_procpu_c1[5:0] reg_sw_stall_procpu_c0[1:0]} == - 0x86 will stall PRO CPU*/ -#define RTC_CNTL_SW_STALL_PROCPU_C0 0x00000003 -#define RTC_CNTL_SW_STALL_PROCPU_C0_M ((RTC_CNTL_SW_STALL_PROCPU_C0_V)<<(RTC_CNTL_SW_STALL_PROCPU_C0_S)) -#define RTC_CNTL_SW_STALL_PROCPU_C0_V 0x3 -#define RTC_CNTL_SW_STALL_PROCPU_C0_S 2 -/* RTC_CNTL_SW_STALL_APPCPU_C0 : R/W ;bitpos:[1:0] ;default: 2'b0 ; */ -/*description: {reg_sw_stall_appcpu_c1[5:0] reg_sw_stall_appcpu_c0[1:0]} == - 0x86 will stall APP CPU*/ -#define RTC_CNTL_SW_STALL_APPCPU_C0 0x00000003 -#define RTC_CNTL_SW_STALL_APPCPU_C0_M ((RTC_CNTL_SW_STALL_APPCPU_C0_V)<<(RTC_CNTL_SW_STALL_APPCPU_C0_S)) -#define RTC_CNTL_SW_STALL_APPCPU_C0_V 0x3 -#define RTC_CNTL_SW_STALL_APPCPU_C0_S 0 - -#define RTC_CNTL_SLP_TIMER0_REG (DR_REG_RTCCNTL_BASE + 0x4) -/* RTC_CNTL_SLP_VAL_LO : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: RTC sleep timer low 32 bits*/ -#define RTC_CNTL_SLP_VAL_LO 0xFFFFFFFF -#define RTC_CNTL_SLP_VAL_LO_M ((RTC_CNTL_SLP_VAL_LO_V)<<(RTC_CNTL_SLP_VAL_LO_S)) -#define RTC_CNTL_SLP_VAL_LO_V 0xFFFFFFFF -#define RTC_CNTL_SLP_VAL_LO_S 0 - -#define RTC_CNTL_SLP_TIMER1_REG (DR_REG_RTCCNTL_BASE + 0x8) -/* RTC_CNTL_MAIN_TIMER_ALARM_EN : R/W ;bitpos:[16] ;default: 1'h0 ; */ -/*description: timer alarm enable bit*/ -#define RTC_CNTL_MAIN_TIMER_ALARM_EN (BIT(16)) -#define RTC_CNTL_MAIN_TIMER_ALARM_EN_M (BIT(16)) -#define RTC_CNTL_MAIN_TIMER_ALARM_EN_V 0x1 -#define RTC_CNTL_MAIN_TIMER_ALARM_EN_S 16 -/* RTC_CNTL_SLP_VAL_HI : R/W ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: RTC sleep timer high 16 bits*/ -#define RTC_CNTL_SLP_VAL_HI 0x0000FFFF -#define RTC_CNTL_SLP_VAL_HI_M ((RTC_CNTL_SLP_VAL_HI_V)<<(RTC_CNTL_SLP_VAL_HI_S)) -#define RTC_CNTL_SLP_VAL_HI_V 0xFFFF -#define RTC_CNTL_SLP_VAL_HI_S 0 - -#define RTC_CNTL_TIME_UPDATE_REG (DR_REG_RTCCNTL_BASE + 0xc) -/* RTC_CNTL_TIME_UPDATE : WO ;bitpos:[31] ;default: 1'h0 ; */ -/*description: Set 1: to update register with RTC timer*/ -#define RTC_CNTL_TIME_UPDATE (BIT(31)) -#define RTC_CNTL_TIME_UPDATE_M (BIT(31)) -#define RTC_CNTL_TIME_UPDATE_V 0x1 -#define RTC_CNTL_TIME_UPDATE_S 31 -/* RTC_CNTL_TIME_VALID : RO ;bitpos:[30] ;default: 1'b0 ; */ -/*description: To indicate the register is updated*/ -#define RTC_CNTL_TIME_VALID (BIT(30)) -#define RTC_CNTL_TIME_VALID_M (BIT(30)) -#define RTC_CNTL_TIME_VALID_V 0x1 -#define RTC_CNTL_TIME_VALID_S 30 - -#define RTC_CNTL_TIME0_REG (DR_REG_RTCCNTL_BASE + 0x10) -/* RTC_CNTL_TIME_LO : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: RTC timer low 32 bits*/ -#define RTC_CNTL_TIME_LO 0xFFFFFFFF -#define RTC_CNTL_TIME_LO_M ((RTC_CNTL_TIME_LO_V)<<(RTC_CNTL_TIME_LO_S)) -#define RTC_CNTL_TIME_LO_V 0xFFFFFFFF -#define RTC_CNTL_TIME_LO_S 0 - -#define RTC_CNTL_TIME1_REG (DR_REG_RTCCNTL_BASE + 0x14) -/* RTC_CNTL_TIME_HI : RO ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: RTC timer high 16 bits*/ -#define RTC_CNTL_TIME_HI 0x0000FFFF -#define RTC_CNTL_TIME_HI_M ((RTC_CNTL_TIME_HI_V)<<(RTC_CNTL_TIME_HI_S)) -#define RTC_CNTL_TIME_HI_V 0xFFFF -#define RTC_CNTL_TIME_HI_S 0 - -#define RTC_CNTL_STATE0_REG (DR_REG_RTCCNTL_BASE + 0x18) -/* RTC_CNTL_SLEEP_EN : R/W ;bitpos:[31] ;default: 1'd0 ; */ -/*description: sleep enable bit*/ -#define RTC_CNTL_SLEEP_EN (BIT(31)) -#define RTC_CNTL_SLEEP_EN_M (BIT(31)) -#define RTC_CNTL_SLEEP_EN_V 0x1 -#define RTC_CNTL_SLEEP_EN_S 31 -/* RTC_CNTL_SLP_REJECT : R/W ;bitpos:[30] ;default: 1'd0 ; */ -/*description: sleep reject bit*/ -#define RTC_CNTL_SLP_REJECT (BIT(30)) -#define RTC_CNTL_SLP_REJECT_M (BIT(30)) -#define RTC_CNTL_SLP_REJECT_V 0x1 -#define RTC_CNTL_SLP_REJECT_S 30 -/* RTC_CNTL_SLP_WAKEUP : R/W ;bitpos:[29] ;default: 1'd0 ; */ -/*description: sleep wakeup bit*/ -#define RTC_CNTL_SLP_WAKEUP (BIT(29)) -#define RTC_CNTL_SLP_WAKEUP_M (BIT(29)) -#define RTC_CNTL_SLP_WAKEUP_V 0x1 -#define RTC_CNTL_SLP_WAKEUP_S 29 -/* RTC_CNTL_SDIO_ACTIVE_IND : RO ;bitpos:[28] ;default: 1'd0 ; */ -/*description: SDIO active indication*/ -#define RTC_CNTL_SDIO_ACTIVE_IND (BIT(28)) -#define RTC_CNTL_SDIO_ACTIVE_IND_M (BIT(28)) -#define RTC_CNTL_SDIO_ACTIVE_IND_V 0x1 -#define RTC_CNTL_SDIO_ACTIVE_IND_S 28 -/* RTC_CNTL_ULP_CP_SLP_TIMER_EN : R/W ;bitpos:[24] ;default: 1'd0 ; */ -/*description: ULP-coprocessor timer enable bit*/ -#define RTC_CNTL_ULP_CP_SLP_TIMER_EN (BIT(24)) -#define RTC_CNTL_ULP_CP_SLP_TIMER_EN_M (BIT(24)) -#define RTC_CNTL_ULP_CP_SLP_TIMER_EN_V 0x1 -#define RTC_CNTL_ULP_CP_SLP_TIMER_EN_S 24 -/* RTC_CNTL_TOUCH_SLP_TIMER_EN : R/W ;bitpos:[23] ;default: 1'd0 ; */ -/*description: touch timer enable bit*/ -#define RTC_CNTL_TOUCH_SLP_TIMER_EN (BIT(23)) -#define RTC_CNTL_TOUCH_SLP_TIMER_EN_M (BIT(23)) -#define RTC_CNTL_TOUCH_SLP_TIMER_EN_V 0x1 -#define RTC_CNTL_TOUCH_SLP_TIMER_EN_S 23 -/* RTC_CNTL_APB2RTC_BRIDGE_SEL : R/W ;bitpos:[22] ;default: 1'd0 ; */ -/*description: 1: APB to RTC using bridge 0: APB to RTC using sync*/ -#define RTC_CNTL_APB2RTC_BRIDGE_SEL (BIT(22)) -#define RTC_CNTL_APB2RTC_BRIDGE_SEL_M (BIT(22)) -#define RTC_CNTL_APB2RTC_BRIDGE_SEL_V 0x1 -#define RTC_CNTL_APB2RTC_BRIDGE_SEL_S 22 -/* RTC_CNTL_ULP_CP_WAKEUP_FORCE_EN : R/W ;bitpos:[21] ;default: 1'd1 ; */ -/*description: ULP-coprocessor force wake up*/ -#define RTC_CNTL_ULP_CP_WAKEUP_FORCE_EN (BIT(21)) -#define RTC_CNTL_ULP_CP_WAKEUP_FORCE_EN_M (BIT(21)) -#define RTC_CNTL_ULP_CP_WAKEUP_FORCE_EN_V 0x1 -#define RTC_CNTL_ULP_CP_WAKEUP_FORCE_EN_S 21 -/* RTC_CNTL_TOUCH_WAKEUP_FORCE_EN : R/W ;bitpos:[20] ;default: 1'd1 ; */ -/*description: touch controller force wake up*/ -#define RTC_CNTL_TOUCH_WAKEUP_FORCE_EN (BIT(20)) -#define RTC_CNTL_TOUCH_WAKEUP_FORCE_EN_M (BIT(20)) -#define RTC_CNTL_TOUCH_WAKEUP_FORCE_EN_V 0x1 -#define RTC_CNTL_TOUCH_WAKEUP_FORCE_EN_S 20 - -#define RTC_CNTL_TIMER1_REG (DR_REG_RTCCNTL_BASE + 0x1c) -/* RTC_CNTL_PLL_BUF_WAIT : R/W ;bitpos:[31:24] ;default: 8'd40 ; */ -/*description: PLL wait cycles in slow_clk_rtc*/ -#define RTC_CNTL_PLL_BUF_WAIT 0x000000FF -#define RTC_CNTL_PLL_BUF_WAIT_M ((RTC_CNTL_PLL_BUF_WAIT_V)<<(RTC_CNTL_PLL_BUF_WAIT_S)) -#define RTC_CNTL_PLL_BUF_WAIT_V 0xFF -#define RTC_CNTL_PLL_BUF_WAIT_S 24 -#define RTC_CNTL_PLL_BUF_WAIT_DEFAULT 20 -/* RTC_CNTL_XTL_BUF_WAIT : R/W ;bitpos:[23:14] ;default: 10'd80 ; */ -/*description: XTAL wait cycles in slow_clk_rtc*/ -#define RTC_CNTL_XTL_BUF_WAIT 0x000003FF -#define RTC_CNTL_XTL_BUF_WAIT_M ((RTC_CNTL_XTL_BUF_WAIT_V)<<(RTC_CNTL_XTL_BUF_WAIT_S)) -#define RTC_CNTL_XTL_BUF_WAIT_V 0x3FF -#define RTC_CNTL_XTL_BUF_WAIT_S 14 -#define RTC_CNTL_XTL_BUF_WAIT_DEFAULT 20 -/* RTC_CNTL_CK8M_WAIT : R/W ;bitpos:[13:6] ;default: 8'h10 ; */ -/*description: CK8M wait cycles in slow_clk_rtc*/ -#define RTC_CNTL_CK8M_WAIT 0x000000FF -#define RTC_CNTL_CK8M_WAIT_M ((RTC_CNTL_CK8M_WAIT_V)<<(RTC_CNTL_CK8M_WAIT_S)) -#define RTC_CNTL_CK8M_WAIT_V 0xFF -#define RTC_CNTL_CK8M_WAIT_S 6 -#define RTC_CNTL_CK8M_WAIT_DEFAULT 20 -/* RTC_CNTL_CPU_STALL_WAIT : R/W ;bitpos:[5:1] ;default: 5'd1 ; */ -/*description: CPU stall wait cycles in fast_clk_rtc*/ -#define RTC_CNTL_CPU_STALL_WAIT 0x0000001F -#define RTC_CNTL_CPU_STALL_WAIT_M ((RTC_CNTL_CPU_STALL_WAIT_V)<<(RTC_CNTL_CPU_STALL_WAIT_S)) -#define RTC_CNTL_CPU_STALL_WAIT_V 0x1F -#define RTC_CNTL_CPU_STALL_WAIT_S 1 -/* RTC_CNTL_CPU_STALL_EN : R/W ;bitpos:[0] ;default: 1'd1 ; */ -/*description: CPU stall enable bit*/ -#define RTC_CNTL_CPU_STALL_EN (BIT(0)) -#define RTC_CNTL_CPU_STALL_EN_M (BIT(0)) -#define RTC_CNTL_CPU_STALL_EN_V 0x1 -#define RTC_CNTL_CPU_STALL_EN_S 0 - -#define RTC_CNTL_TIMER2_REG (DR_REG_RTCCNTL_BASE + 0x20) -/* RTC_CNTL_MIN_TIME_CK8M_OFF : R/W ;bitpos:[31:24] ;default: 8'h1 ; */ -/*description: minimal cycles in slow_clk_rtc for CK8M in power down state*/ -#define RTC_CNTL_MIN_TIME_CK8M_OFF 0x000000FF -#define RTC_CNTL_MIN_TIME_CK8M_OFF_M ((RTC_CNTL_MIN_TIME_CK8M_OFF_V)<<(RTC_CNTL_MIN_TIME_CK8M_OFF_S)) -#define RTC_CNTL_MIN_TIME_CK8M_OFF_V 0xFF -#define RTC_CNTL_MIN_TIME_CK8M_OFF_S 24 -/* RTC_CNTL_ULPCP_TOUCH_START_WAIT : R/W ;bitpos:[23:15] ;default: 9'h10 ; */ -/*description: wait cycles in slow_clk_rtc before ULP-coprocessor / touch controller - start to work*/ -#define RTC_CNTL_ULPCP_TOUCH_START_WAIT 0x000001FF -#define RTC_CNTL_ULPCP_TOUCH_START_WAIT_M ((RTC_CNTL_ULPCP_TOUCH_START_WAIT_V)<<(RTC_CNTL_ULPCP_TOUCH_START_WAIT_S)) -#define RTC_CNTL_ULPCP_TOUCH_START_WAIT_V 0x1FF -#define RTC_CNTL_ULPCP_TOUCH_START_WAIT_S 15 - -#define RTC_CNTL_TIMER3_REG (DR_REG_RTCCNTL_BASE + 0x24) -/* RTC_CNTL_ROM_RAM_POWERUP_TIMER : R/W ;bitpos:[31:25] ;default: 7'd10 ; */ -/*description: */ -#define RTC_CNTL_ROM_RAM_POWERUP_TIMER 0x0000007F -#define RTC_CNTL_ROM_RAM_POWERUP_TIMER_M ((RTC_CNTL_ROM_RAM_POWERUP_TIMER_V)<<(RTC_CNTL_ROM_RAM_POWERUP_TIMER_S)) -#define RTC_CNTL_ROM_RAM_POWERUP_TIMER_V 0x7F -#define RTC_CNTL_ROM_RAM_POWERUP_TIMER_S 25 -/* RTC_CNTL_ROM_RAM_WAIT_TIMER : R/W ;bitpos:[24:16] ;default: 9'h16 ; */ -/*description: */ -#define RTC_CNTL_ROM_RAM_WAIT_TIMER 0x000001FF -#define RTC_CNTL_ROM_RAM_WAIT_TIMER_M ((RTC_CNTL_ROM_RAM_WAIT_TIMER_V)<<(RTC_CNTL_ROM_RAM_WAIT_TIMER_S)) -#define RTC_CNTL_ROM_RAM_WAIT_TIMER_V 0x1FF -#define RTC_CNTL_ROM_RAM_WAIT_TIMER_S 16 -/* RTC_CNTL_WIFI_POWERUP_TIMER : R/W ;bitpos:[15:9] ;default: 7'h5 ; */ -/*description: */ -#define RTC_CNTL_WIFI_POWERUP_TIMER 0x0000007F -#define RTC_CNTL_WIFI_POWERUP_TIMER_M ((RTC_CNTL_WIFI_POWERUP_TIMER_V)<<(RTC_CNTL_WIFI_POWERUP_TIMER_S)) -#define RTC_CNTL_WIFI_POWERUP_TIMER_V 0x7F -#define RTC_CNTL_WIFI_POWERUP_TIMER_S 9 -/* RTC_CNTL_WIFI_WAIT_TIMER : R/W ;bitpos:[8:0] ;default: 9'h8 ; */ -/*description: */ -#define RTC_CNTL_WIFI_WAIT_TIMER 0x000001FF -#define RTC_CNTL_WIFI_WAIT_TIMER_M ((RTC_CNTL_WIFI_WAIT_TIMER_V)<<(RTC_CNTL_WIFI_WAIT_TIMER_S)) -#define RTC_CNTL_WIFI_WAIT_TIMER_V 0x1FF -#define RTC_CNTL_WIFI_WAIT_TIMER_S 0 - -#define RTC_CNTL_TIMER4_REG (DR_REG_RTCCNTL_BASE + 0x28) -/* RTC_CNTL_DG_WRAP_POWERUP_TIMER : R/W ;bitpos:[31:25] ;default: 7'h8 ; */ -/*description: */ -#define RTC_CNTL_DG_WRAP_POWERUP_TIMER 0x0000007F -#define RTC_CNTL_DG_WRAP_POWERUP_TIMER_M ((RTC_CNTL_DG_WRAP_POWERUP_TIMER_V)<<(RTC_CNTL_DG_WRAP_POWERUP_TIMER_S)) -#define RTC_CNTL_DG_WRAP_POWERUP_TIMER_V 0x7F -#define RTC_CNTL_DG_WRAP_POWERUP_TIMER_S 25 -/* RTC_CNTL_DG_WRAP_WAIT_TIMER : R/W ;bitpos:[24:16] ;default: 9'h20 ; */ -/*description: */ -#define RTC_CNTL_DG_WRAP_WAIT_TIMER 0x000001FF -#define RTC_CNTL_DG_WRAP_WAIT_TIMER_M ((RTC_CNTL_DG_WRAP_WAIT_TIMER_V)<<(RTC_CNTL_DG_WRAP_WAIT_TIMER_S)) -#define RTC_CNTL_DG_WRAP_WAIT_TIMER_V 0x1FF -#define RTC_CNTL_DG_WRAP_WAIT_TIMER_S 16 -/* RTC_CNTL_POWERUP_TIMER : R/W ;bitpos:[15:9] ;default: 7'h5 ; */ -/*description: */ -#define RTC_CNTL_POWERUP_TIMER 0x0000007F -#define RTC_CNTL_POWERUP_TIMER_M ((RTC_CNTL_POWERUP_TIMER_V)<<(RTC_CNTL_POWERUP_TIMER_S)) -#define RTC_CNTL_POWERUP_TIMER_V 0x7F -#define RTC_CNTL_POWERUP_TIMER_S 9 -/* RTC_CNTL_WAIT_TIMER : R/W ;bitpos:[8:0] ;default: 9'h8 ; */ -/*description: */ -#define RTC_CNTL_WAIT_TIMER 0x000001FF -#define RTC_CNTL_WAIT_TIMER_M ((RTC_CNTL_WAIT_TIMER_V)<<(RTC_CNTL_WAIT_TIMER_S)) -#define RTC_CNTL_WAIT_TIMER_V 0x1FF -#define RTC_CNTL_WAIT_TIMER_S 0 - -#define RTC_CNTL_TIMER5_REG (DR_REG_RTCCNTL_BASE + 0x2c) -/* RTC_CNTL_RTCMEM_POWERUP_TIMER : R/W ;bitpos:[31:25] ;default: 7'h9 ; */ -/*description: */ -#define RTC_CNTL_RTCMEM_POWERUP_TIMER 0x0000007F -#define RTC_CNTL_RTCMEM_POWERUP_TIMER_M ((RTC_CNTL_RTCMEM_POWERUP_TIMER_V)<<(RTC_CNTL_RTCMEM_POWERUP_TIMER_S)) -#define RTC_CNTL_RTCMEM_POWERUP_TIMER_V 0x7F -#define RTC_CNTL_RTCMEM_POWERUP_TIMER_S 25 -/* RTC_CNTL_RTCMEM_WAIT_TIMER : R/W ;bitpos:[24:16] ;default: 9'h14 ; */ -/*description: */ -#define RTC_CNTL_RTCMEM_WAIT_TIMER 0x000001FF -#define RTC_CNTL_RTCMEM_WAIT_TIMER_M ((RTC_CNTL_RTCMEM_WAIT_TIMER_V)<<(RTC_CNTL_RTCMEM_WAIT_TIMER_S)) -#define RTC_CNTL_RTCMEM_WAIT_TIMER_V 0x1FF -#define RTC_CNTL_RTCMEM_WAIT_TIMER_S 16 -/* RTC_CNTL_MIN_SLP_VAL : R/W ;bitpos:[15:8] ;default: 8'h80 ; */ -/*description: minimal sleep cycles in slow_clk_rtc*/ -#define RTC_CNTL_MIN_SLP_VAL 0x000000FF -#define RTC_CNTL_MIN_SLP_VAL_M ((RTC_CNTL_MIN_SLP_VAL_V)<<(RTC_CNTL_MIN_SLP_VAL_S)) -#define RTC_CNTL_MIN_SLP_VAL_V 0xFF -#define RTC_CNTL_MIN_SLP_VAL_S 8 -#define RTC_CNTL_MIN_SLP_VAL_MIN 2 -/* RTC_CNTL_ULP_CP_SUBTIMER_PREDIV : R/W ;bitpos:[7:0] ;default: 8'd1 ; */ -/*description: */ -#define RTC_CNTL_ULP_CP_SUBTIMER_PREDIV 0x000000FF -#define RTC_CNTL_ULP_CP_SUBTIMER_PREDIV_M ((RTC_CNTL_ULP_CP_SUBTIMER_PREDIV_V)<<(RTC_CNTL_ULP_CP_SUBTIMER_PREDIV_S)) -#define RTC_CNTL_ULP_CP_SUBTIMER_PREDIV_V 0xFF -#define RTC_CNTL_ULP_CP_SUBTIMER_PREDIV_S 0 - -#define RTC_CNTL_ANA_CONF_REG (DR_REG_RTCCNTL_BASE + 0x30) -/* RTC_CNTL_PLL_I2C_PU : R/W ;bitpos:[31] ;default: 1'd0 ; */ -/*description: 1: PLL_I2C power up otherwise power down*/ -#define RTC_CNTL_PLL_I2C_PU (BIT(31)) -#define RTC_CNTL_PLL_I2C_PU_M (BIT(31)) -#define RTC_CNTL_PLL_I2C_PU_V 0x1 -#define RTC_CNTL_PLL_I2C_PU_S 31 -/* RTC_CNTL_CKGEN_I2C_PU : R/W ;bitpos:[30] ;default: 1'd0 ; */ -/*description: 1: CKGEN_I2C power up otherwise power down*/ -#define RTC_CNTL_CKGEN_I2C_PU (BIT(30)) -#define RTC_CNTL_CKGEN_I2C_PU_M (BIT(30)) -#define RTC_CNTL_CKGEN_I2C_PU_V 0x1 -#define RTC_CNTL_CKGEN_I2C_PU_S 30 -/* RTC_CNTL_RFRX_PBUS_PU : R/W ;bitpos:[28] ;default: 1'd0 ; */ -/*description: 1: RFRX_PBUS power up otherwise power down*/ -#define RTC_CNTL_RFRX_PBUS_PU (BIT(28)) -#define RTC_CNTL_RFRX_PBUS_PU_M (BIT(28)) -#define RTC_CNTL_RFRX_PBUS_PU_V 0x1 -#define RTC_CNTL_RFRX_PBUS_PU_S 28 -/* RTC_CNTL_TXRF_I2C_PU : R/W ;bitpos:[27] ;default: 1'd0 ; */ -/*description: 1: TXRF_I2C power up otherwise power down*/ -#define RTC_CNTL_TXRF_I2C_PU (BIT(27)) -#define RTC_CNTL_TXRF_I2C_PU_M (BIT(27)) -#define RTC_CNTL_TXRF_I2C_PU_V 0x1 -#define RTC_CNTL_TXRF_I2C_PU_S 27 -/* RTC_CNTL_PVTMON_PU : R/W ;bitpos:[26] ;default: 1'b0 ; */ -/*description: 1: PVTMON power up otherwise power down*/ -#define RTC_CNTL_PVTMON_PU (BIT(26)) -#define RTC_CNTL_PVTMON_PU_M (BIT(26)) -#define RTC_CNTL_PVTMON_PU_V 0x1 -#define RTC_CNTL_PVTMON_PU_S 26 -/* RTC_CNTL_BBPLL_CAL_SLP_START : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: start BBPLL calibration during sleep*/ -#define RTC_CNTL_BBPLL_CAL_SLP_START (BIT(25)) -#define RTC_CNTL_BBPLL_CAL_SLP_START_M (BIT(25)) -#define RTC_CNTL_BBPLL_CAL_SLP_START_V 0x1 -#define RTC_CNTL_BBPLL_CAL_SLP_START_S 25 -/* RTC_CNTL_PLLA_FORCE_PU : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: PLLA force power up*/ -#define RTC_CNTL_PLLA_FORCE_PU (BIT(24)) -#define RTC_CNTL_PLLA_FORCE_PU_M (BIT(24)) -#define RTC_CNTL_PLLA_FORCE_PU_V 0x1 -#define RTC_CNTL_PLLA_FORCE_PU_S 24 -/* RTC_CNTL_PLLA_FORCE_PD : R/W ;bitpos:[23] ;default: 1'b1 ; */ -/*description: PLLA force power down*/ -#define RTC_CNTL_PLLA_FORCE_PD (BIT(23)) -#define RTC_CNTL_PLLA_FORCE_PD_M (BIT(23)) -#define RTC_CNTL_PLLA_FORCE_PD_V 0x1 -#define RTC_CNTL_PLLA_FORCE_PD_S 23 - -#define RTC_CNTL_RESET_STATE_REG (DR_REG_RTCCNTL_BASE + 0x34) -/* RTC_CNTL_PROCPU_STAT_VECTOR_SEL : R/W ;bitpos:[13] ;default: 1'b1 ; */ -/*description: PRO CPU state vector sel*/ -#define RTC_CNTL_PROCPU_STAT_VECTOR_SEL (BIT(13)) -#define RTC_CNTL_PROCPU_STAT_VECTOR_SEL_M (BIT(13)) -#define RTC_CNTL_PROCPU_STAT_VECTOR_SEL_V 0x1 -#define RTC_CNTL_PROCPU_STAT_VECTOR_SEL_S 13 -/* RTC_CNTL_APPCPU_STAT_VECTOR_SEL : R/W ;bitpos:[12] ;default: 1'b1 ; */ -/*description: APP CPU state vector sel*/ -#define RTC_CNTL_APPCPU_STAT_VECTOR_SEL (BIT(12)) -#define RTC_CNTL_APPCPU_STAT_VECTOR_SEL_M (BIT(12)) -#define RTC_CNTL_APPCPU_STAT_VECTOR_SEL_V 0x1 -#define RTC_CNTL_APPCPU_STAT_VECTOR_SEL_S 12 -/* RTC_CNTL_RESET_CAUSE_APPCPU : RO ;bitpos:[11:6] ;default: 0 ; */ -/*description: reset cause of APP CPU*/ -#define RTC_CNTL_RESET_CAUSE_APPCPU 0x0000003F -#define RTC_CNTL_RESET_CAUSE_APPCPU_M ((RTC_CNTL_RESET_CAUSE_APPCPU_V)<<(RTC_CNTL_RESET_CAUSE_APPCPU_S)) -#define RTC_CNTL_RESET_CAUSE_APPCPU_V 0x3F -#define RTC_CNTL_RESET_CAUSE_APPCPU_S 6 -/* RTC_CNTL_RESET_CAUSE_PROCPU : RO ;bitpos:[5:0] ;default: 0 ; */ -/*description: reset cause of PRO CPU*/ -#define RTC_CNTL_RESET_CAUSE_PROCPU 0x0000003F -#define RTC_CNTL_RESET_CAUSE_PROCPU_M ((RTC_CNTL_RESET_CAUSE_PROCPU_V)<<(RTC_CNTL_RESET_CAUSE_PROCPU_S)) -#define RTC_CNTL_RESET_CAUSE_PROCPU_V 0x3F -#define RTC_CNTL_RESET_CAUSE_PROCPU_S 0 - -#define RTC_CNTL_WAKEUP_STATE_REG (DR_REG_RTCCNTL_BASE + 0x38) -/* RTC_CNTL_GPIO_WAKEUP_FILTER : R/W ;bitpos:[22] ;default: 1'd0 ; */ -/*description: enable filter for gpio wakeup event*/ -#define RTC_CNTL_GPIO_WAKEUP_FILTER (BIT(22)) -#define RTC_CNTL_GPIO_WAKEUP_FILTER_M (BIT(22)) -#define RTC_CNTL_GPIO_WAKEUP_FILTER_V 0x1 -#define RTC_CNTL_GPIO_WAKEUP_FILTER_S 22 -/* RTC_CNTL_WAKEUP_ENA : R/W ;bitpos:[21:11] ;default: 11'b1100 ; */ -/*description: wakeup enable bitmap*/ -#define RTC_CNTL_WAKEUP_ENA 0x000007FF -#define RTC_CNTL_WAKEUP_ENA_M ((RTC_CNTL_WAKEUP_ENA_V)<<(RTC_CNTL_WAKEUP_ENA_S)) -#define RTC_CNTL_WAKEUP_ENA_V 0x7FF -#define RTC_CNTL_WAKEUP_ENA_S 11 -/* RTC_CNTL_WAKEUP_CAUSE : RO ;bitpos:[10:0] ;default: 11'h0 ; */ -/*description: wakeup cause*/ -#define RTC_CNTL_WAKEUP_CAUSE 0x000007FF -#define RTC_CNTL_WAKEUP_CAUSE_M ((RTC_CNTL_WAKEUP_CAUSE_V)<<(RTC_CNTL_WAKEUP_CAUSE_S)) -#define RTC_CNTL_WAKEUP_CAUSE_V 0x7FF -#define RTC_CNTL_WAKEUP_CAUSE_S 0 - -#define RTC_CNTL_INT_ENA_REG (DR_REG_RTCCNTL_BASE + 0x3c) -/* RTC_CNTL_MAIN_TIMER_INT_ENA : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: enable RTC main timer interrupt*/ -#define RTC_CNTL_MAIN_TIMER_INT_ENA (BIT(8)) -#define RTC_CNTL_MAIN_TIMER_INT_ENA_M (BIT(8)) -#define RTC_CNTL_MAIN_TIMER_INT_ENA_V 0x1 -#define RTC_CNTL_MAIN_TIMER_INT_ENA_S 8 -/* RTC_CNTL_BROWN_OUT_INT_ENA : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: enable brown out interrupt*/ -#define RTC_CNTL_BROWN_OUT_INT_ENA (BIT(7)) -#define RTC_CNTL_BROWN_OUT_INT_ENA_M (BIT(7)) -#define RTC_CNTL_BROWN_OUT_INT_ENA_V 0x1 -#define RTC_CNTL_BROWN_OUT_INT_ENA_S 7 -/* RTC_CNTL_TOUCH_INT_ENA : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: enable touch interrupt*/ -#define RTC_CNTL_TOUCH_INT_ENA (BIT(6)) -#define RTC_CNTL_TOUCH_INT_ENA_M (BIT(6)) -#define RTC_CNTL_TOUCH_INT_ENA_V 0x1 -#define RTC_CNTL_TOUCH_INT_ENA_S 6 -/* RTC_CNTL_ULP_CP_INT_ENA : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: enable ULP-coprocessor interrupt*/ -#define RTC_CNTL_ULP_CP_INT_ENA (BIT(5)) -#define RTC_CNTL_ULP_CP_INT_ENA_M (BIT(5)) -#define RTC_CNTL_ULP_CP_INT_ENA_V 0x1 -#define RTC_CNTL_ULP_CP_INT_ENA_S 5 -/* RTC_CNTL_TIME_VALID_INT_ENA : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: enable RTC time valid interrupt*/ -#define RTC_CNTL_TIME_VALID_INT_ENA (BIT(4)) -#define RTC_CNTL_TIME_VALID_INT_ENA_M (BIT(4)) -#define RTC_CNTL_TIME_VALID_INT_ENA_V 0x1 -#define RTC_CNTL_TIME_VALID_INT_ENA_S 4 -/* RTC_CNTL_WDT_INT_ENA : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: enable RTC WDT interrupt*/ -#define RTC_CNTL_WDT_INT_ENA (BIT(3)) -#define RTC_CNTL_WDT_INT_ENA_M (BIT(3)) -#define RTC_CNTL_WDT_INT_ENA_V 0x1 -#define RTC_CNTL_WDT_INT_ENA_S 3 -/* RTC_CNTL_SDIO_IDLE_INT_ENA : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: enable SDIO idle interrupt*/ -#define RTC_CNTL_SDIO_IDLE_INT_ENA (BIT(2)) -#define RTC_CNTL_SDIO_IDLE_INT_ENA_M (BIT(2)) -#define RTC_CNTL_SDIO_IDLE_INT_ENA_V 0x1 -#define RTC_CNTL_SDIO_IDLE_INT_ENA_S 2 -/* RTC_CNTL_SLP_REJECT_INT_ENA : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: enable sleep reject interrupt*/ -#define RTC_CNTL_SLP_REJECT_INT_ENA (BIT(1)) -#define RTC_CNTL_SLP_REJECT_INT_ENA_M (BIT(1)) -#define RTC_CNTL_SLP_REJECT_INT_ENA_V 0x1 -#define RTC_CNTL_SLP_REJECT_INT_ENA_S 1 -/* RTC_CNTL_SLP_WAKEUP_INT_ENA : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: enable sleep wakeup interrupt*/ -#define RTC_CNTL_SLP_WAKEUP_INT_ENA (BIT(0)) -#define RTC_CNTL_SLP_WAKEUP_INT_ENA_M (BIT(0)) -#define RTC_CNTL_SLP_WAKEUP_INT_ENA_V 0x1 -#define RTC_CNTL_SLP_WAKEUP_INT_ENA_S 0 - -#define RTC_CNTL_INT_RAW_REG (DR_REG_RTCCNTL_BASE + 0x40) -/* RTC_CNTL_MAIN_TIMER_INT_RAW : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: RTC main timer interrupt raw*/ -#define RTC_CNTL_MAIN_TIMER_INT_RAW (BIT(8)) -#define RTC_CNTL_MAIN_TIMER_INT_RAW_M (BIT(8)) -#define RTC_CNTL_MAIN_TIMER_INT_RAW_V 0x1 -#define RTC_CNTL_MAIN_TIMER_INT_RAW_S 8 -/* RTC_CNTL_BROWN_OUT_INT_RAW : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: brown out interrupt raw*/ -#define RTC_CNTL_BROWN_OUT_INT_RAW (BIT(7)) -#define RTC_CNTL_BROWN_OUT_INT_RAW_M (BIT(7)) -#define RTC_CNTL_BROWN_OUT_INT_RAW_V 0x1 -#define RTC_CNTL_BROWN_OUT_INT_RAW_S 7 -/* RTC_CNTL_TOUCH_INT_RAW : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: touch interrupt raw*/ -#define RTC_CNTL_TOUCH_INT_RAW (BIT(6)) -#define RTC_CNTL_TOUCH_INT_RAW_M (BIT(6)) -#define RTC_CNTL_TOUCH_INT_RAW_V 0x1 -#define RTC_CNTL_TOUCH_INT_RAW_S 6 -/* RTC_CNTL_ULP_CP_INT_RAW : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: ULP-coprocessor interrupt raw*/ -#define RTC_CNTL_ULP_CP_INT_RAW (BIT(5)) -#define RTC_CNTL_ULP_CP_INT_RAW_M (BIT(5)) -#define RTC_CNTL_ULP_CP_INT_RAW_V 0x1 -#define RTC_CNTL_ULP_CP_INT_RAW_S 5 -/* RTC_CNTL_TIME_VALID_INT_RAW : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: RTC time valid interrupt raw*/ -#define RTC_CNTL_TIME_VALID_INT_RAW (BIT(4)) -#define RTC_CNTL_TIME_VALID_INT_RAW_M (BIT(4)) -#define RTC_CNTL_TIME_VALID_INT_RAW_V 0x1 -#define RTC_CNTL_TIME_VALID_INT_RAW_S 4 -/* RTC_CNTL_WDT_INT_RAW : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: RTC WDT interrupt raw*/ -#define RTC_CNTL_WDT_INT_RAW (BIT(3)) -#define RTC_CNTL_WDT_INT_RAW_M (BIT(3)) -#define RTC_CNTL_WDT_INT_RAW_V 0x1 -#define RTC_CNTL_WDT_INT_RAW_S 3 -/* RTC_CNTL_SDIO_IDLE_INT_RAW : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: SDIO idle interrupt raw*/ -#define RTC_CNTL_SDIO_IDLE_INT_RAW (BIT(2)) -#define RTC_CNTL_SDIO_IDLE_INT_RAW_M (BIT(2)) -#define RTC_CNTL_SDIO_IDLE_INT_RAW_V 0x1 -#define RTC_CNTL_SDIO_IDLE_INT_RAW_S 2 -/* RTC_CNTL_SLP_REJECT_INT_RAW : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: sleep reject interrupt raw*/ -#define RTC_CNTL_SLP_REJECT_INT_RAW (BIT(1)) -#define RTC_CNTL_SLP_REJECT_INT_RAW_M (BIT(1)) -#define RTC_CNTL_SLP_REJECT_INT_RAW_V 0x1 -#define RTC_CNTL_SLP_REJECT_INT_RAW_S 1 -/* RTC_CNTL_SLP_WAKEUP_INT_RAW : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: sleep wakeup interrupt raw*/ -#define RTC_CNTL_SLP_WAKEUP_INT_RAW (BIT(0)) -#define RTC_CNTL_SLP_WAKEUP_INT_RAW_M (BIT(0)) -#define RTC_CNTL_SLP_WAKEUP_INT_RAW_V 0x1 -#define RTC_CNTL_SLP_WAKEUP_INT_RAW_S 0 - -#define RTC_CNTL_INT_ST_REG (DR_REG_RTCCNTL_BASE + 0x44) -/* RTC_CNTL_MAIN_TIMER_INT_ST : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: RTC main timer interrupt state*/ -#define RTC_CNTL_MAIN_TIMER_INT_ST (BIT(8)) -#define RTC_CNTL_MAIN_TIMER_INT_ST_M (BIT(8)) -#define RTC_CNTL_MAIN_TIMER_INT_ST_V 0x1 -#define RTC_CNTL_MAIN_TIMER_INT_ST_S 8 -/* RTC_CNTL_BROWN_OUT_INT_ST : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: brown out interrupt state*/ -#define RTC_CNTL_BROWN_OUT_INT_ST (BIT(7)) -#define RTC_CNTL_BROWN_OUT_INT_ST_M (BIT(7)) -#define RTC_CNTL_BROWN_OUT_INT_ST_V 0x1 -#define RTC_CNTL_BROWN_OUT_INT_ST_S 7 -/* RTC_CNTL_TOUCH_INT_ST : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: touch interrupt state*/ -#define RTC_CNTL_TOUCH_INT_ST (BIT(6)) -#define RTC_CNTL_TOUCH_INT_ST_M (BIT(6)) -#define RTC_CNTL_TOUCH_INT_ST_V 0x1 -#define RTC_CNTL_TOUCH_INT_ST_S 6 -/* RTC_CNTL_SAR_INT_ST : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: ULP-coprocessor interrupt state*/ -#define RTC_CNTL_SAR_INT_ST (BIT(5)) -#define RTC_CNTL_SAR_INT_ST_M (BIT(5)) -#define RTC_CNTL_SAR_INT_ST_V 0x1 -#define RTC_CNTL_SAR_INT_ST_S 5 -/* RTC_CNTL_TIME_VALID_INT_ST : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: RTC time valid interrupt state*/ -#define RTC_CNTL_TIME_VALID_INT_ST (BIT(4)) -#define RTC_CNTL_TIME_VALID_INT_ST_M (BIT(4)) -#define RTC_CNTL_TIME_VALID_INT_ST_V 0x1 -#define RTC_CNTL_TIME_VALID_INT_ST_S 4 -/* RTC_CNTL_WDT_INT_ST : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: RTC WDT interrupt state*/ -#define RTC_CNTL_WDT_INT_ST (BIT(3)) -#define RTC_CNTL_WDT_INT_ST_M (BIT(3)) -#define RTC_CNTL_WDT_INT_ST_V 0x1 -#define RTC_CNTL_WDT_INT_ST_S 3 -/* RTC_CNTL_SDIO_IDLE_INT_ST : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: SDIO idle interrupt state*/ -#define RTC_CNTL_SDIO_IDLE_INT_ST (BIT(2)) -#define RTC_CNTL_SDIO_IDLE_INT_ST_M (BIT(2)) -#define RTC_CNTL_SDIO_IDLE_INT_ST_V 0x1 -#define RTC_CNTL_SDIO_IDLE_INT_ST_S 2 -/* RTC_CNTL_SLP_REJECT_INT_ST : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: sleep reject interrupt state*/ -#define RTC_CNTL_SLP_REJECT_INT_ST (BIT(1)) -#define RTC_CNTL_SLP_REJECT_INT_ST_M (BIT(1)) -#define RTC_CNTL_SLP_REJECT_INT_ST_V 0x1 -#define RTC_CNTL_SLP_REJECT_INT_ST_S 1 -/* RTC_CNTL_SLP_WAKEUP_INT_ST : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: sleep wakeup interrupt state*/ -#define RTC_CNTL_SLP_WAKEUP_INT_ST (BIT(0)) -#define RTC_CNTL_SLP_WAKEUP_INT_ST_M (BIT(0)) -#define RTC_CNTL_SLP_WAKEUP_INT_ST_V 0x1 -#define RTC_CNTL_SLP_WAKEUP_INT_ST_S 0 - -#define RTC_CNTL_INT_CLR_REG (DR_REG_RTCCNTL_BASE + 0x48) -/* RTC_CNTL_MAIN_TIMER_INT_CLR : WO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: Clear RTC main timer interrupt state*/ -#define RTC_CNTL_MAIN_TIMER_INT_CLR (BIT(8)) -#define RTC_CNTL_MAIN_TIMER_INT_CLR_M (BIT(8)) -#define RTC_CNTL_MAIN_TIMER_INT_CLR_V 0x1 -#define RTC_CNTL_MAIN_TIMER_INT_CLR_S 8 -/* RTC_CNTL_BROWN_OUT_INT_CLR : WO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: Clear brown out interrupt state*/ -#define RTC_CNTL_BROWN_OUT_INT_CLR (BIT(7)) -#define RTC_CNTL_BROWN_OUT_INT_CLR_M (BIT(7)) -#define RTC_CNTL_BROWN_OUT_INT_CLR_V 0x1 -#define RTC_CNTL_BROWN_OUT_INT_CLR_S 7 -/* RTC_CNTL_TOUCH_INT_CLR : WO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: Clear touch interrupt state*/ -#define RTC_CNTL_TOUCH_INT_CLR (BIT(6)) -#define RTC_CNTL_TOUCH_INT_CLR_M (BIT(6)) -#define RTC_CNTL_TOUCH_INT_CLR_V 0x1 -#define RTC_CNTL_TOUCH_INT_CLR_S 6 -/* RTC_CNTL_SAR_INT_CLR : WO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: Clear ULP-coprocessor interrupt state*/ -#define RTC_CNTL_SAR_INT_CLR (BIT(5)) -#define RTC_CNTL_SAR_INT_CLR_M (BIT(5)) -#define RTC_CNTL_SAR_INT_CLR_V 0x1 -#define RTC_CNTL_SAR_INT_CLR_S 5 -/* RTC_CNTL_TIME_VALID_INT_CLR : WO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: Clear RTC time valid interrupt state*/ -#define RTC_CNTL_TIME_VALID_INT_CLR (BIT(4)) -#define RTC_CNTL_TIME_VALID_INT_CLR_M (BIT(4)) -#define RTC_CNTL_TIME_VALID_INT_CLR_V 0x1 -#define RTC_CNTL_TIME_VALID_INT_CLR_S 4 -/* RTC_CNTL_WDT_INT_CLR : WO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: Clear RTC WDT interrupt state*/ -#define RTC_CNTL_WDT_INT_CLR (BIT(3)) -#define RTC_CNTL_WDT_INT_CLR_M (BIT(3)) -#define RTC_CNTL_WDT_INT_CLR_V 0x1 -#define RTC_CNTL_WDT_INT_CLR_S 3 -/* RTC_CNTL_SDIO_IDLE_INT_CLR : WO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: Clear SDIO idle interrupt state*/ -#define RTC_CNTL_SDIO_IDLE_INT_CLR (BIT(2)) -#define RTC_CNTL_SDIO_IDLE_INT_CLR_M (BIT(2)) -#define RTC_CNTL_SDIO_IDLE_INT_CLR_V 0x1 -#define RTC_CNTL_SDIO_IDLE_INT_CLR_S 2 -/* RTC_CNTL_SLP_REJECT_INT_CLR : WO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: Clear sleep reject interrupt state*/ -#define RTC_CNTL_SLP_REJECT_INT_CLR (BIT(1)) -#define RTC_CNTL_SLP_REJECT_INT_CLR_M (BIT(1)) -#define RTC_CNTL_SLP_REJECT_INT_CLR_V 0x1 -#define RTC_CNTL_SLP_REJECT_INT_CLR_S 1 -/* RTC_CNTL_SLP_WAKEUP_INT_CLR : WO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: Clear sleep wakeup interrupt state*/ -#define RTC_CNTL_SLP_WAKEUP_INT_CLR (BIT(0)) -#define RTC_CNTL_SLP_WAKEUP_INT_CLR_M (BIT(0)) -#define RTC_CNTL_SLP_WAKEUP_INT_CLR_V 0x1 -#define RTC_CNTL_SLP_WAKEUP_INT_CLR_S 0 - -#define RTC_CNTL_STORE0_REG (DR_REG_RTCCNTL_BASE + 0x4c) -/* RTC_CNTL_SCRATCH0 : R/W ;bitpos:[31:0] ;default: 0 ; */ -/*description: 32-bit general purpose retention register*/ -#define RTC_CNTL_SCRATCH0 0xFFFFFFFF -#define RTC_CNTL_SCRATCH0_M ((RTC_CNTL_SCRATCH0_V)<<(RTC_CNTL_SCRATCH0_S)) -#define RTC_CNTL_SCRATCH0_V 0xFFFFFFFF -#define RTC_CNTL_SCRATCH0_S 0 - -#define RTC_CNTL_STORE1_REG (DR_REG_RTCCNTL_BASE + 0x50) -/* RTC_CNTL_SCRATCH1 : R/W ;bitpos:[31:0] ;default: 0 ; */ -/*description: 32-bit general purpose retention register*/ -#define RTC_CNTL_SCRATCH1 0xFFFFFFFF -#define RTC_CNTL_SCRATCH1_M ((RTC_CNTL_SCRATCH1_V)<<(RTC_CNTL_SCRATCH1_S)) -#define RTC_CNTL_SCRATCH1_V 0xFFFFFFFF -#define RTC_CNTL_SCRATCH1_S 0 - -#define RTC_CNTL_STORE2_REG (DR_REG_RTCCNTL_BASE + 0x54) -/* RTC_CNTL_SCRATCH2 : R/W ;bitpos:[31:0] ;default: 0 ; */ -/*description: 32-bit general purpose retention register*/ -#define RTC_CNTL_SCRATCH2 0xFFFFFFFF -#define RTC_CNTL_SCRATCH2_M ((RTC_CNTL_SCRATCH2_V)<<(RTC_CNTL_SCRATCH2_S)) -#define RTC_CNTL_SCRATCH2_V 0xFFFFFFFF -#define RTC_CNTL_SCRATCH2_S 0 - -#define RTC_CNTL_STORE3_REG (DR_REG_RTCCNTL_BASE + 0x58) -/* RTC_CNTL_SCRATCH3 : R/W ;bitpos:[31:0] ;default: 0 ; */ -/*description: 32-bit general purpose retention register*/ -#define RTC_CNTL_SCRATCH3 0xFFFFFFFF -#define RTC_CNTL_SCRATCH3_M ((RTC_CNTL_SCRATCH3_V)<<(RTC_CNTL_SCRATCH3_S)) -#define RTC_CNTL_SCRATCH3_V 0xFFFFFFFF -#define RTC_CNTL_SCRATCH3_S 0 - -#define RTC_CNTL_EXT_XTL_CONF_REG (DR_REG_RTCCNTL_BASE + 0x5c) -/* RTC_CNTL_XTL_EXT_CTR_EN : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: enable control XTAL by external pads*/ -#define RTC_CNTL_XTL_EXT_CTR_EN (BIT(31)) -#define RTC_CNTL_XTL_EXT_CTR_EN_M (BIT(31)) -#define RTC_CNTL_XTL_EXT_CTR_EN_V 0x1 -#define RTC_CNTL_XTL_EXT_CTR_EN_S 31 -/* RTC_CNTL_XTL_EXT_CTR_LV : R/W ;bitpos:[30] ;default: 1'b0 ; */ -/*description: 0: power down XTAL at high level 1: power down XTAL at low level*/ -#define RTC_CNTL_XTL_EXT_CTR_LV (BIT(30)) -#define RTC_CNTL_XTL_EXT_CTR_LV_M (BIT(30)) -#define RTC_CNTL_XTL_EXT_CTR_LV_V 0x1 -#define RTC_CNTL_XTL_EXT_CTR_LV_S 30 - -#define RTC_CNTL_EXT_WAKEUP_CONF_REG (DR_REG_RTCCNTL_BASE + 0x60) -/* RTC_CNTL_EXT_WAKEUP1_LV : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: 0: external wakeup at low level 1: external wakeup at high level*/ -#define RTC_CNTL_EXT_WAKEUP1_LV (BIT(31)) -#define RTC_CNTL_EXT_WAKEUP1_LV_M (BIT(31)) -#define RTC_CNTL_EXT_WAKEUP1_LV_V 0x1 -#define RTC_CNTL_EXT_WAKEUP1_LV_S 31 -/* RTC_CNTL_EXT_WAKEUP0_LV : R/W ;bitpos:[30] ;default: 1'b0 ; */ -/*description: 0: external wakeup at low level 1: external wakeup at high level*/ -#define RTC_CNTL_EXT_WAKEUP0_LV (BIT(30)) -#define RTC_CNTL_EXT_WAKEUP0_LV_M (BIT(30)) -#define RTC_CNTL_EXT_WAKEUP0_LV_V 0x1 -#define RTC_CNTL_EXT_WAKEUP0_LV_S 30 - -#define RTC_CNTL_SLP_REJECT_CONF_REG (DR_REG_RTCCNTL_BASE + 0x64) -/* RTC_CNTL_REJECT_CAUSE : RO ;bitpos:[31:28] ;default: 4'b0 ; */ -/*description: sleep reject cause*/ -#define RTC_CNTL_REJECT_CAUSE 0x0000000F -#define RTC_CNTL_REJECT_CAUSE_M ((RTC_CNTL_REJECT_CAUSE_V)<<(RTC_CNTL_REJECT_CAUSE_S)) -#define RTC_CNTL_REJECT_CAUSE_V 0xF -#define RTC_CNTL_REJECT_CAUSE_S 28 -/* RTC_CNTL_DEEP_SLP_REJECT_EN : R/W ;bitpos:[27] ;default: 1'b0 ; */ -/*description: enable reject for deep sleep*/ -#define RTC_CNTL_DEEP_SLP_REJECT_EN (BIT(27)) -#define RTC_CNTL_DEEP_SLP_REJECT_EN_M (BIT(27)) -#define RTC_CNTL_DEEP_SLP_REJECT_EN_V 0x1 -#define RTC_CNTL_DEEP_SLP_REJECT_EN_S 27 -/* RTC_CNTL_LIGHT_SLP_REJECT_EN : R/W ;bitpos:[26] ;default: 1'b0 ; */ -/*description: enable reject for light sleep*/ -#define RTC_CNTL_LIGHT_SLP_REJECT_EN (BIT(26)) -#define RTC_CNTL_LIGHT_SLP_REJECT_EN_M (BIT(26)) -#define RTC_CNTL_LIGHT_SLP_REJECT_EN_V 0x1 -#define RTC_CNTL_LIGHT_SLP_REJECT_EN_S 26 -/* RTC_CNTL_SDIO_REJECT_EN : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: enable SDIO reject*/ -#define RTC_CNTL_SDIO_REJECT_EN (BIT(25)) -#define RTC_CNTL_SDIO_REJECT_EN_M (BIT(25)) -#define RTC_CNTL_SDIO_REJECT_EN_V 0x1 -#define RTC_CNTL_SDIO_REJECT_EN_S 25 -/* RTC_CNTL_GPIO_REJECT_EN : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: enable GPIO reject*/ -#define RTC_CNTL_GPIO_REJECT_EN (BIT(24)) -#define RTC_CNTL_GPIO_REJECT_EN_M (BIT(24)) -#define RTC_CNTL_GPIO_REJECT_EN_V 0x1 -#define RTC_CNTL_GPIO_REJECT_EN_S 24 - -#define RTC_CNTL_CPU_PERIOD_CONF_REG (DR_REG_RTCCNTL_BASE + 0x68) -/* RTC_CNTL_CPUPERIOD_SEL : R/W ;bitpos:[31:30] ;default: 2'b00 ; */ -/*description: CPU period sel*/ -#define RTC_CNTL_CPUPERIOD_SEL 0x00000003 -#define RTC_CNTL_CPUPERIOD_SEL_M ((RTC_CNTL_CPUPERIOD_SEL_V)<<(RTC_CNTL_CPUPERIOD_SEL_S)) -#define RTC_CNTL_CPUPERIOD_SEL_V 0x3 -#define RTC_CNTL_CPUPERIOD_SEL_S 30 -/* RTC_CNTL_CPUSEL_CONF : R/W ;bitpos:[29] ;default: 1'b0 ; */ -/*description: CPU sel option*/ -#define RTC_CNTL_CPUSEL_CONF (BIT(29)) -#define RTC_CNTL_CPUSEL_CONF_M (BIT(29)) -#define RTC_CNTL_CPUSEL_CONF_V 0x1 -#define RTC_CNTL_CPUSEL_CONF_S 29 - -#define RTC_CNTL_SDIO_ACT_CONF_REG (DR_REG_RTCCNTL_BASE + 0x6c) -/* RTC_CNTL_SDIO_ACT_DNUM : R/W ;bitpos:[31:22] ;default: 10'b0 ; */ -/*description: */ -#define RTC_CNTL_SDIO_ACT_DNUM 0x000003FF -#define RTC_CNTL_SDIO_ACT_DNUM_M ((RTC_CNTL_SDIO_ACT_DNUM_V)<<(RTC_CNTL_SDIO_ACT_DNUM_S)) -#define RTC_CNTL_SDIO_ACT_DNUM_V 0x3FF -#define RTC_CNTL_SDIO_ACT_DNUM_S 22 - -#define RTC_CNTL_CLK_CONF_REG (DR_REG_RTCCNTL_BASE + 0x70) -/* RTC_CNTL_ANA_CLK_RTC_SEL : R/W ;bitpos:[31:30] ;default: 2'd0 ; */ -/*description: slow_clk_rtc sel. 0: SLOW_CK 1: CK_XTAL_32K 2: CK8M_D256_OUT*/ -#define RTC_CNTL_ANA_CLK_RTC_SEL 0x00000003 -#define RTC_CNTL_ANA_CLK_RTC_SEL_M ((RTC_CNTL_ANA_CLK_RTC_SEL_V)<<(RTC_CNTL_ANA_CLK_RTC_SEL_S)) -#define RTC_CNTL_ANA_CLK_RTC_SEL_V 0x3 -#define RTC_CNTL_ANA_CLK_RTC_SEL_S 30 -/* RTC_CNTL_FAST_CLK_RTC_SEL : R/W ;bitpos:[29] ;default: 1'b0 ; */ -/*description: fast_clk_rtc sel. 0: XTAL div 4 1: CK8M*/ -#define RTC_CNTL_FAST_CLK_RTC_SEL (BIT(29)) -#define RTC_CNTL_FAST_CLK_RTC_SEL_M (BIT(29)) -#define RTC_CNTL_FAST_CLK_RTC_SEL_V 0x1 -#define RTC_CNTL_FAST_CLK_RTC_SEL_S 29 -/* RTC_CNTL_SOC_CLK_SEL : R/W ;bitpos:[28:27] ;default: 2'd0 ; */ -/*description: SOC clock sel. 0: XTAL 1: PLL 2: CK8M 3: APLL*/ -#define RTC_CNTL_SOC_CLK_SEL 0x00000003 -#define RTC_CNTL_SOC_CLK_SEL_M ((RTC_CNTL_SOC_CLK_SEL_V)<<(RTC_CNTL_SOC_CLK_SEL_S)) -#define RTC_CNTL_SOC_CLK_SEL_V 0x3 -#define RTC_CNTL_SOC_CLK_SEL_S 27 -#define RTC_CNTL_SOC_CLK_SEL_XTL 0 -#define RTC_CNTL_SOC_CLK_SEL_PLL 1 -#define RTC_CNTL_SOC_CLK_SEL_8M 2 -#define RTC_CNTL_SOC_CLK_SEL_APLL 3 -/* RTC_CNTL_CK8M_FORCE_PU : R/W ;bitpos:[26] ;default: 1'd0 ; */ -/*description: CK8M force power up*/ -#define RTC_CNTL_CK8M_FORCE_PU (BIT(26)) -#define RTC_CNTL_CK8M_FORCE_PU_M (BIT(26)) -#define RTC_CNTL_CK8M_FORCE_PU_V 0x1 -#define RTC_CNTL_CK8M_FORCE_PU_S 26 -/* RTC_CNTL_CK8M_FORCE_PD : R/W ;bitpos:[25] ;default: 1'd0 ; */ -/*description: CK8M force power down*/ -#define RTC_CNTL_CK8M_FORCE_PD (BIT(25)) -#define RTC_CNTL_CK8M_FORCE_PD_M (BIT(25)) -#define RTC_CNTL_CK8M_FORCE_PD_V 0x1 -#define RTC_CNTL_CK8M_FORCE_PD_S 25 -/* RTC_CNTL_CK8M_DFREQ : R/W ;bitpos:[24:17] ;default: 8'd0 ; */ -/*description: CK8M_DFREQ*/ -#define RTC_CNTL_CK8M_DFREQ 0x000000FF -#define RTC_CNTL_CK8M_DFREQ_M ((RTC_CNTL_CK8M_DFREQ_V)<<(RTC_CNTL_CK8M_DFREQ_S)) -#define RTC_CNTL_CK8M_DFREQ_V 0xFF -#define RTC_CNTL_CK8M_DFREQ_S 17 -#define RTC_CNTL_CK8M_DFREQ_DEFAULT 172 -/* RTC_CNTL_CK8M_FORCE_NOGATING : R/W ;bitpos:[16] ;default: 1'd0 ; */ -/*description: CK8M force no gating during sleep*/ -#define RTC_CNTL_CK8M_FORCE_NOGATING (BIT(16)) -#define RTC_CNTL_CK8M_FORCE_NOGATING_M (BIT(16)) -#define RTC_CNTL_CK8M_FORCE_NOGATING_V 0x1 -#define RTC_CNTL_CK8M_FORCE_NOGATING_S 16 -/* RTC_CNTL_XTAL_FORCE_NOGATING : R/W ;bitpos:[15] ;default: 1'd0 ; */ -/*description: XTAL force no gating during sleep*/ -#define RTC_CNTL_XTAL_FORCE_NOGATING (BIT(15)) -#define RTC_CNTL_XTAL_FORCE_NOGATING_M (BIT(15)) -#define RTC_CNTL_XTAL_FORCE_NOGATING_V 0x1 -#define RTC_CNTL_XTAL_FORCE_NOGATING_S 15 -/* RTC_CNTL_CK8M_DIV_SEL : R/W ;bitpos:[14:12] ;default: 3'd2 ; */ -/*description: divider = reg_ck8m_div_sel + 1*/ -#define RTC_CNTL_CK8M_DIV_SEL 0x00000007 -#define RTC_CNTL_CK8M_DIV_SEL_M ((RTC_CNTL_CK8M_DIV_SEL_V)<<(RTC_CNTL_CK8M_DIV_SEL_S)) -#define RTC_CNTL_CK8M_DIV_SEL_V 0x7 -#define RTC_CNTL_CK8M_DIV_SEL_S 12 -/* RTC_CNTL_CK8M_DFREQ_FORCE : R/W ;bitpos:[11] ;default: 1'd0 ; */ -/*description: */ -#define RTC_CNTL_CK8M_DFREQ_FORCE (BIT(11)) -#define RTC_CNTL_CK8M_DFREQ_FORCE_M (BIT(11)) -#define RTC_CNTL_CK8M_DFREQ_FORCE_V 0x1 -#define RTC_CNTL_CK8M_DFREQ_FORCE_S 11 -/* RTC_CNTL_DIG_CLK8M_EN : R/W ;bitpos:[10] ;default: 1'd0 ; */ -/*description: enable CK8M for digital core (no relationship with RTC core)*/ -#define RTC_CNTL_DIG_CLK8M_EN (BIT(10)) -#define RTC_CNTL_DIG_CLK8M_EN_M (BIT(10)) -#define RTC_CNTL_DIG_CLK8M_EN_V 0x1 -#define RTC_CNTL_DIG_CLK8M_EN_S 10 -/* RTC_CNTL_DIG_CLK8M_D256_EN : R/W ;bitpos:[9] ;default: 1'd1 ; */ -/*description: enable CK8M_D256_OUT for digital core (no relationship with RTC core)*/ -#define RTC_CNTL_DIG_CLK8M_D256_EN (BIT(9)) -#define RTC_CNTL_DIG_CLK8M_D256_EN_M (BIT(9)) -#define RTC_CNTL_DIG_CLK8M_D256_EN_V 0x1 -#define RTC_CNTL_DIG_CLK8M_D256_EN_S 9 -/* RTC_CNTL_DIG_XTAL32K_EN : R/W ;bitpos:[8] ;default: 1'd0 ; */ -/*description: enable CK_XTAL_32K for digital core (no relationship with RTC core)*/ -#define RTC_CNTL_DIG_XTAL32K_EN (BIT(8)) -#define RTC_CNTL_DIG_XTAL32K_EN_M (BIT(8)) -#define RTC_CNTL_DIG_XTAL32K_EN_V 0x1 -#define RTC_CNTL_DIG_XTAL32K_EN_S 8 -/* RTC_CNTL_ENB_CK8M_DIV : R/W ;bitpos:[7] ;default: 1'd0 ; */ -/*description: 1: CK8M_D256_OUT is actually CK8M 0: CK8M_D256_OUT is CK8M divided by 256*/ -#define RTC_CNTL_ENB_CK8M_DIV (BIT(7)) -#define RTC_CNTL_ENB_CK8M_DIV_M (BIT(7)) -#define RTC_CNTL_ENB_CK8M_DIV_V 0x1 -#define RTC_CNTL_ENB_CK8M_DIV_S 7 -/* RTC_CNTL_ENB_CK8M : R/W ;bitpos:[6] ;default: 1'd0 ; */ -/*description: disable CK8M and CK8M_D256_OUT*/ -#define RTC_CNTL_ENB_CK8M (BIT(6)) -#define RTC_CNTL_ENB_CK8M_M (BIT(6)) -#define RTC_CNTL_ENB_CK8M_V 0x1 -#define RTC_CNTL_ENB_CK8M_S 6 -/* RTC_CNTL_CK8M_DIV : R/W ;bitpos:[5:4] ;default: 2'b01 ; */ -/*description: CK8M_D256_OUT divider. 00: div128 01: div256 10: div512 11: div1024.*/ -#define RTC_CNTL_CK8M_DIV 0x00000003 -#define RTC_CNTL_CK8M_DIV_M ((RTC_CNTL_CK8M_DIV_V)<<(RTC_CNTL_CK8M_DIV_S)) -#define RTC_CNTL_CK8M_DIV_V 0x3 -#define RTC_CNTL_CK8M_DIV_S 4 - -#define RTC_CNTL_SDIO_CONF_REG (DR_REG_RTCCNTL_BASE + 0x74) -/* RTC_CNTL_XPD_SDIO_REG : R/W ;bitpos:[31] ;default: 1'd0 ; */ -/*description: SW option for XPD_SDIO_REG. Only active when reg_sdio_force = 1*/ -#define RTC_CNTL_XPD_SDIO_REG (BIT(31)) -#define RTC_CNTL_XPD_SDIO_REG_M (BIT(31)) -#define RTC_CNTL_XPD_SDIO_REG_V 0x1 -#define RTC_CNTL_XPD_SDIO_REG_S 31 -/* RTC_CNTL_DREFH_SDIO : R/W ;bitpos:[30:29] ;default: 2'b00 ; */ -/*description: SW option for DREFH_SDIO. Only active when reg_sdio_force = 1*/ -#define RTC_CNTL_DREFH_SDIO 0x00000003 -#define RTC_CNTL_DREFH_SDIO_M ((RTC_CNTL_DREFH_SDIO_V)<<(RTC_CNTL_DREFH_SDIO_S)) -#define RTC_CNTL_DREFH_SDIO_V 0x3 -#define RTC_CNTL_DREFH_SDIO_S 29 -/* RTC_CNTL_DREFM_SDIO : R/W ;bitpos:[28:27] ;default: 2'b00 ; */ -/*description: SW option for DREFM_SDIO. Only active when reg_sdio_force = 1*/ -#define RTC_CNTL_DREFM_SDIO 0x00000003 -#define RTC_CNTL_DREFM_SDIO_M ((RTC_CNTL_DREFM_SDIO_V)<<(RTC_CNTL_DREFM_SDIO_S)) -#define RTC_CNTL_DREFM_SDIO_V 0x3 -#define RTC_CNTL_DREFM_SDIO_S 27 -/* RTC_CNTL_DREFL_SDIO : R/W ;bitpos:[26:25] ;default: 2'b01 ; */ -/*description: SW option for DREFL_SDIO. Only active when reg_sdio_force = 1*/ -#define RTC_CNTL_DREFL_SDIO 0x00000003 -#define RTC_CNTL_DREFL_SDIO_M ((RTC_CNTL_DREFL_SDIO_V)<<(RTC_CNTL_DREFL_SDIO_S)) -#define RTC_CNTL_DREFL_SDIO_V 0x3 -#define RTC_CNTL_DREFL_SDIO_S 25 -/* RTC_CNTL_REG1P8_READY : RO ;bitpos:[24] ;default: 1'd0 ; */ -/*description: read only register for REG1P8_READY*/ -#define RTC_CNTL_REG1P8_READY (BIT(24)) -#define RTC_CNTL_REG1P8_READY_M (BIT(24)) -#define RTC_CNTL_REG1P8_READY_V 0x1 -#define RTC_CNTL_REG1P8_READY_S 24 -/* RTC_CNTL_SDIO_TIEH : R/W ;bitpos:[23] ;default: 1'd1 ; */ -/*description: SW option for SDIO_TIEH. Only active when reg_sdio_force = 1*/ -#define RTC_CNTL_SDIO_TIEH (BIT(23)) -#define RTC_CNTL_SDIO_TIEH_M (BIT(23)) -#define RTC_CNTL_SDIO_TIEH_V 0x1 -#define RTC_CNTL_SDIO_TIEH_S 23 -/* RTC_CNTL_SDIO_FORCE : R/W ;bitpos:[22] ;default: 1'd0 ; */ -/*description: 1: use SW option to control SDIO_REG 0: use state machine*/ -#define RTC_CNTL_SDIO_FORCE (BIT(22)) -#define RTC_CNTL_SDIO_FORCE_M (BIT(22)) -#define RTC_CNTL_SDIO_FORCE_V 0x1 -#define RTC_CNTL_SDIO_FORCE_S 22 -/* RTC_CNTL_SDIO_PD_EN : R/W ;bitpos:[21] ;default: 1'd1 ; */ -/*description: power down SDIO_REG in sleep. Only active when reg_sdio_force = 0*/ -#define RTC_CNTL_SDIO_PD_EN (BIT(21)) -#define RTC_CNTL_SDIO_PD_EN_M (BIT(21)) -#define RTC_CNTL_SDIO_PD_EN_V 0x1 -#define RTC_CNTL_SDIO_PD_EN_S 21 - -#define RTC_CNTL_BIAS_CONF_REG (DR_REG_RTCCNTL_BASE + 0x78) -/* RTC_CNTL_RST_BIAS_I2C : R/W ;bitpos:[31] ;default: 1'd0 ; */ -/*description: RST_BIAS_I2C*/ -#define RTC_CNTL_RST_BIAS_I2C (BIT(31)) -#define RTC_CNTL_RST_BIAS_I2C_M (BIT(31)) -#define RTC_CNTL_RST_BIAS_I2C_V 0x1 -#define RTC_CNTL_RST_BIAS_I2C_S 31 -/* RTC_CNTL_DEC_HEARTBEAT_WIDTH : R/W ;bitpos:[30] ;default: 1'd0 ; */ -/*description: DEC_HEARTBEAT_WIDTH*/ -#define RTC_CNTL_DEC_HEARTBEAT_WIDTH (BIT(30)) -#define RTC_CNTL_DEC_HEARTBEAT_WIDTH_M (BIT(30)) -#define RTC_CNTL_DEC_HEARTBEAT_WIDTH_V 0x1 -#define RTC_CNTL_DEC_HEARTBEAT_WIDTH_S 30 -/* RTC_CNTL_INC_HEARTBEAT_PERIOD : R/W ;bitpos:[29] ;default: 1'd0 ; */ -/*description: INC_HEARTBEAT_PERIOD*/ -#define RTC_CNTL_INC_HEARTBEAT_PERIOD (BIT(29)) -#define RTC_CNTL_INC_HEARTBEAT_PERIOD_M (BIT(29)) -#define RTC_CNTL_INC_HEARTBEAT_PERIOD_V 0x1 -#define RTC_CNTL_INC_HEARTBEAT_PERIOD_S 29 -/* RTC_CNTL_DEC_HEARTBEAT_PERIOD : R/W ;bitpos:[28] ;default: 1'd0 ; */ -/*description: DEC_HEARTBEAT_PERIOD*/ -#define RTC_CNTL_DEC_HEARTBEAT_PERIOD (BIT(28)) -#define RTC_CNTL_DEC_HEARTBEAT_PERIOD_M (BIT(28)) -#define RTC_CNTL_DEC_HEARTBEAT_PERIOD_V 0x1 -#define RTC_CNTL_DEC_HEARTBEAT_PERIOD_S 28 -/* RTC_CNTL_INC_HEARTBEAT_REFRESH : R/W ;bitpos:[27] ;default: 1'd0 ; */ -/*description: INC_HEARTBEAT_REFRESH*/ -#define RTC_CNTL_INC_HEARTBEAT_REFRESH (BIT(27)) -#define RTC_CNTL_INC_HEARTBEAT_REFRESH_M (BIT(27)) -#define RTC_CNTL_INC_HEARTBEAT_REFRESH_V 0x1 -#define RTC_CNTL_INC_HEARTBEAT_REFRESH_S 27 -/* RTC_CNTL_ENB_SCK_XTAL : R/W ;bitpos:[26] ;default: 1'd0 ; */ -/*description: ENB_SCK_XTAL*/ -#define RTC_CNTL_ENB_SCK_XTAL (BIT(26)) -#define RTC_CNTL_ENB_SCK_XTAL_M (BIT(26)) -#define RTC_CNTL_ENB_SCK_XTAL_V 0x1 -#define RTC_CNTL_ENB_SCK_XTAL_S 26 -/* RTC_CNTL_DBG_ATTEN : R/W ;bitpos:[25:24] ;default: 2'b00 ; */ -/*description: DBG_ATTEN*/ -#define RTC_CNTL_DBG_ATTEN 0x00000003 -#define RTC_CNTL_DBG_ATTEN_M ((RTC_CNTL_DBG_ATTEN_V)<<(RTC_CNTL_DBG_ATTEN_S)) -#define RTC_CNTL_DBG_ATTEN_V 0x3 -#define RTC_CNTL_DBG_ATTEN_S 24 -#define RTC_CNTL_DBG_ATTEN_DEFAULT 3 -#define RTC_CNTL_REG (DR_REG_RTCCNTL_BASE + 0x7c) -/* RTC_CNTL_FORCE_PU : R/W ;bitpos:[31] ;default: 1'd1 ; */ -/*description: RTC_REG force power up*/ -#define RTC_CNTL_FORCE_PU (BIT(31)) -#define RTC_CNTL_FORCE_PU_M (BIT(31)) -#define RTC_CNTL_FORCE_PU_V 0x1 -#define RTC_CNTL_FORCE_PU_S 31 -/* RTC_CNTL_FORCE_PD : R/W ;bitpos:[30] ;default: 1'd0 ; */ -/*description: RTC_REG force power down (for RTC_REG power down means decrease - the voltage to 0.8v or lower )*/ -#define RTC_CNTL_FORCE_PD (BIT(30)) -#define RTC_CNTL_FORCE_PD_M (BIT(30)) -#define RTC_CNTL_FORCE_PD_V 0x1 -#define RTC_CNTL_FORCE_PD_S 30 -/* RTC_CNTL_DBOOST_FORCE_PU : R/W ;bitpos:[29] ;default: 1'd1 ; */ -/*description: RTC_DBOOST force power up*/ -#define RTC_CNTL_DBOOST_FORCE_PU (BIT(29)) -#define RTC_CNTL_DBOOST_FORCE_PU_M (BIT(29)) -#define RTC_CNTL_DBOOST_FORCE_PU_V 0x1 -#define RTC_CNTL_DBOOST_FORCE_PU_S 29 -/* RTC_CNTL_DBOOST_FORCE_PD : R/W ;bitpos:[28] ;default: 1'd0 ; */ -/*description: RTC_DBOOST force power down*/ -#define RTC_CNTL_DBOOST_FORCE_PD (BIT(28)) -#define RTC_CNTL_DBOOST_FORCE_PD_M (BIT(28)) -#define RTC_CNTL_DBOOST_FORCE_PD_V 0x1 -#define RTC_CNTL_DBOOST_FORCE_PD_S 28 -/* RTC_CNTL_DBIAS_WAK : R/W ;bitpos:[27:25] ;default: 3'd4 ; */ -/*description: RTC_DBIAS during wakeup*/ -#define RTC_CNTL_DBIAS_WAK 0x00000007 -#define RTC_CNTL_DBIAS_WAK_M ((RTC_CNTL_DBIAS_WAK_V)<<(RTC_CNTL_DBIAS_WAK_S)) -#define RTC_CNTL_DBIAS_WAK_V 0x7 -#define RTC_CNTL_DBIAS_WAK_S 25 -/* RTC_CNTL_DBIAS_SLP : R/W ;bitpos:[24:22] ;default: 3'd4 ; */ -/*description: RTC_DBIAS during sleep*/ -#define RTC_CNTL_DBIAS_SLP 0x00000007 -#define RTC_CNTL_DBIAS_SLP_M ((RTC_CNTL_DBIAS_SLP_V)<<(RTC_CNTL_DBIAS_SLP_S)) -#define RTC_CNTL_DBIAS_SLP_V 0x7 -#define RTC_CNTL_DBIAS_SLP_S 22 -/* RTC_CNTL_SCK_DCAP : R/W ;bitpos:[21:14] ;default: 8'd0 ; */ -/*description: SCK_DCAP*/ -#define RTC_CNTL_SCK_DCAP 0x000000FF -#define RTC_CNTL_SCK_DCAP_M ((RTC_CNTL_SCK_DCAP_V)<<(RTC_CNTL_SCK_DCAP_S)) -#define RTC_CNTL_SCK_DCAP_V 0xFF -#define RTC_CNTL_SCK_DCAP_S 14 -#define RTC_CNTL_SCK_DCAP_DEFAULT 255 -/* RTC_CNTL_DIG_DBIAS_WAK : R/W ;bitpos:[13:11] ;default: 3'd4 ; */ -/*description: DIG_REG_DBIAS during wakeup*/ -#define RTC_CNTL_DIG_DBIAS_WAK 0x00000007 -#define RTC_CNTL_DIG_DBIAS_WAK_M ((RTC_CNTL_DIG_DBIAS_WAK_V)<<(RTC_CNTL_DIG_DBIAS_WAK_S)) -#define RTC_CNTL_DIG_DBIAS_WAK_V 0x7 -#define RTC_CNTL_DIG_DBIAS_WAK_S 11 -/* RTC_CNTL_DIG_DBIAS_SLP : R/W ;bitpos:[10:8] ;default: 3'd4 ; */ -/*description: DIG_REG_DBIAS during sleep*/ -#define RTC_CNTL_DIG_DBIAS_SLP 0x00000007 -#define RTC_CNTL_DIG_DBIAS_SLP_M ((RTC_CNTL_DIG_DBIAS_SLP_V)<<(RTC_CNTL_DIG_DBIAS_SLP_S)) -#define RTC_CNTL_DIG_DBIAS_SLP_V 0x7 -#define RTC_CNTL_DIG_DBIAS_SLP_S 8 -/* RTC_CNTL_SCK_DCAP_FORCE : R/W ;bitpos:[7] ;default: 1'd0 ; */ -/*description: N/A*/ -#define RTC_CNTL_SCK_DCAP_FORCE (BIT(7)) -#define RTC_CNTL_SCK_DCAP_FORCE_M (BIT(7)) -#define RTC_CNTL_SCK_DCAP_FORCE_V 0x1 -#define RTC_CNTL_SCK_DCAP_FORCE_S 7 - -/* Approximate mapping of voltages to RTC_CNTL_DBIAS_WAK, RTC_CNTL_DBIAS_SLP, - * RTC_CNTL_DIG_DBIAS_WAK, RTC_CNTL_DIG_DBIAS_SLP values. - * Valid if RTC_CNTL_DBG_ATTEN is 0. - */ -#define RTC_CNTL_DBIAS_0V90 0 -#define RTC_CNTL_DBIAS_0V95 1 -#define RTC_CNTL_DBIAS_1V00 2 -#define RTC_CNTL_DBIAS_1V05 3 -#define RTC_CNTL_DBIAS_1V10 4 -#define RTC_CNTL_DBIAS_1V15 5 -#define RTC_CNTL_DBIAS_1V20 6 -#define RTC_CNTL_DBIAS_1V25 7 - -#define RTC_CNTL_PWC_REG (DR_REG_RTCCNTL_BASE + 0x80) -/* RTC_CNTL_PD_EN : R/W ;bitpos:[20] ;default: 1'd0 ; */ -/*description: enable power down rtc_peri in sleep*/ -#define RTC_CNTL_PD_EN (BIT(20)) -#define RTC_CNTL_PD_EN_M (BIT(20)) -#define RTC_CNTL_PD_EN_V 0x1 -#define RTC_CNTL_PD_EN_S 20 -/* RTC_CNTL_FORCE_PU : R/W ;bitpos:[19] ;default: 1'd0 ; */ -/*description: rtc_peri force power up*/ -#define RTC_CNTL_PWC_FORCE_PU (BIT(19)) -#define RTC_CNTL_PWC_FORCE_PU_M (BIT(19)) -#define RTC_CNTL_PWC_FORCE_PU_V 0x1 -#define RTC_CNTL_PWC_FORCE_PU_S 19 -/* RTC_CNTL_FORCE_PD : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: rtc_peri force power down*/ -#define RTC_CNTL_PWC_FORCE_PD (BIT(18)) -#define RTC_CNTL_PWC_FORCE_PD_M (BIT(18)) -#define RTC_CNTL_PWC_FORCE_PD_V 0x1 -#define RTC_CNTL_PWC_FORCE_PD_S 18 -/* RTC_CNTL_SLOWMEM_PD_EN : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: enable power down RTC memory in sleep*/ -#define RTC_CNTL_SLOWMEM_PD_EN (BIT(17)) -#define RTC_CNTL_SLOWMEM_PD_EN_M (BIT(17)) -#define RTC_CNTL_SLOWMEM_PD_EN_V 0x1 -#define RTC_CNTL_SLOWMEM_PD_EN_S 17 -/* RTC_CNTL_SLOWMEM_FORCE_PU : R/W ;bitpos:[16] ;default: 1'b1 ; */ -/*description: RTC memory force power up*/ -#define RTC_CNTL_SLOWMEM_FORCE_PU (BIT(16)) -#define RTC_CNTL_SLOWMEM_FORCE_PU_M (BIT(16)) -#define RTC_CNTL_SLOWMEM_FORCE_PU_V 0x1 -#define RTC_CNTL_SLOWMEM_FORCE_PU_S 16 -/* RTC_CNTL_SLOWMEM_FORCE_PD : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: RTC memory force power down*/ -#define RTC_CNTL_SLOWMEM_FORCE_PD (BIT(15)) -#define RTC_CNTL_SLOWMEM_FORCE_PD_M (BIT(15)) -#define RTC_CNTL_SLOWMEM_FORCE_PD_V 0x1 -#define RTC_CNTL_SLOWMEM_FORCE_PD_S 15 -/* RTC_CNTL_FASTMEM_PD_EN : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: enable power down fast RTC memory in sleep*/ -#define RTC_CNTL_FASTMEM_PD_EN (BIT(14)) -#define RTC_CNTL_FASTMEM_PD_EN_M (BIT(14)) -#define RTC_CNTL_FASTMEM_PD_EN_V 0x1 -#define RTC_CNTL_FASTMEM_PD_EN_S 14 -/* RTC_CNTL_FASTMEM_FORCE_PU : R/W ;bitpos:[13] ;default: 1'b1 ; */ -/*description: Fast RTC memory force power up*/ -#define RTC_CNTL_FASTMEM_FORCE_PU (BIT(13)) -#define RTC_CNTL_FASTMEM_FORCE_PU_M (BIT(13)) -#define RTC_CNTL_FASTMEM_FORCE_PU_V 0x1 -#define RTC_CNTL_FASTMEM_FORCE_PU_S 13 -/* RTC_CNTL_FASTMEM_FORCE_PD : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: Fast RTC memory force power down*/ -#define RTC_CNTL_FASTMEM_FORCE_PD (BIT(12)) -#define RTC_CNTL_FASTMEM_FORCE_PD_M (BIT(12)) -#define RTC_CNTL_FASTMEM_FORCE_PD_V 0x1 -#define RTC_CNTL_FASTMEM_FORCE_PD_S 12 -/* RTC_CNTL_SLOWMEM_FORCE_LPU : R/W ;bitpos:[11] ;default: 1'b1 ; */ -/*description: RTC memory force no PD*/ -#define RTC_CNTL_SLOWMEM_FORCE_LPU (BIT(11)) -#define RTC_CNTL_SLOWMEM_FORCE_LPU_M (BIT(11)) -#define RTC_CNTL_SLOWMEM_FORCE_LPU_V 0x1 -#define RTC_CNTL_SLOWMEM_FORCE_LPU_S 11 -/* RTC_CNTL_SLOWMEM_FORCE_LPD : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: RTC memory force PD*/ -#define RTC_CNTL_SLOWMEM_FORCE_LPD (BIT(10)) -#define RTC_CNTL_SLOWMEM_FORCE_LPD_M (BIT(10)) -#define RTC_CNTL_SLOWMEM_FORCE_LPD_V 0x1 -#define RTC_CNTL_SLOWMEM_FORCE_LPD_S 10 -/* RTC_CNTL_SLOWMEM_FOLW_CPU : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: 1: RTC memory PD following CPU 0: RTC memory PD following RTC state machine*/ -#define RTC_CNTL_SLOWMEM_FOLW_CPU (BIT(9)) -#define RTC_CNTL_SLOWMEM_FOLW_CPU_M (BIT(9)) -#define RTC_CNTL_SLOWMEM_FOLW_CPU_V 0x1 -#define RTC_CNTL_SLOWMEM_FOLW_CPU_S 9 -/* RTC_CNTL_FASTMEM_FORCE_LPU : R/W ;bitpos:[8] ;default: 1'b1 ; */ -/*description: Fast RTC memory force no PD*/ -#define RTC_CNTL_FASTMEM_FORCE_LPU (BIT(8)) -#define RTC_CNTL_FASTMEM_FORCE_LPU_M (BIT(8)) -#define RTC_CNTL_FASTMEM_FORCE_LPU_V 0x1 -#define RTC_CNTL_FASTMEM_FORCE_LPU_S 8 -/* RTC_CNTL_FASTMEM_FORCE_LPD : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: Fast RTC memory force PD*/ -#define RTC_CNTL_FASTMEM_FORCE_LPD (BIT(7)) -#define RTC_CNTL_FASTMEM_FORCE_LPD_M (BIT(7)) -#define RTC_CNTL_FASTMEM_FORCE_LPD_V 0x1 -#define RTC_CNTL_FASTMEM_FORCE_LPD_S 7 -/* RTC_CNTL_FASTMEM_FOLW_CPU : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: 1: Fast RTC memory PD following CPU 0: fast RTC memory PD following - RTC state machine*/ -#define RTC_CNTL_FASTMEM_FOLW_CPU (BIT(6)) -#define RTC_CNTL_FASTMEM_FOLW_CPU_M (BIT(6)) -#define RTC_CNTL_FASTMEM_FOLW_CPU_V 0x1 -#define RTC_CNTL_FASTMEM_FOLW_CPU_S 6 -/* RTC_CNTL_FORCE_NOISO : R/W ;bitpos:[5] ;default: 1'd1 ; */ -/*description: rtc_peri force no ISO*/ -#define RTC_CNTL_FORCE_NOISO (BIT(5)) -#define RTC_CNTL_FORCE_NOISO_M (BIT(5)) -#define RTC_CNTL_FORCE_NOISO_V 0x1 -#define RTC_CNTL_FORCE_NOISO_S 5 -/* RTC_CNTL_FORCE_ISO : R/W ;bitpos:[4] ;default: 1'd0 ; */ -/*description: rtc_peri force ISO*/ -#define RTC_CNTL_FORCE_ISO (BIT(4)) -#define RTC_CNTL_FORCE_ISO_M (BIT(4)) -#define RTC_CNTL_FORCE_ISO_V 0x1 -#define RTC_CNTL_FORCE_ISO_S 4 -/* RTC_CNTL_SLOWMEM_FORCE_ISO : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: RTC memory force ISO*/ -#define RTC_CNTL_SLOWMEM_FORCE_ISO (BIT(3)) -#define RTC_CNTL_SLOWMEM_FORCE_ISO_M (BIT(3)) -#define RTC_CNTL_SLOWMEM_FORCE_ISO_V 0x1 -#define RTC_CNTL_SLOWMEM_FORCE_ISO_S 3 -/* RTC_CNTL_SLOWMEM_FORCE_NOISO : R/W ;bitpos:[2] ;default: 1'b1 ; */ -/*description: RTC memory force no ISO*/ -#define RTC_CNTL_SLOWMEM_FORCE_NOISO (BIT(2)) -#define RTC_CNTL_SLOWMEM_FORCE_NOISO_M (BIT(2)) -#define RTC_CNTL_SLOWMEM_FORCE_NOISO_V 0x1 -#define RTC_CNTL_SLOWMEM_FORCE_NOISO_S 2 -/* RTC_CNTL_FASTMEM_FORCE_ISO : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: Fast RTC memory force ISO*/ -#define RTC_CNTL_FASTMEM_FORCE_ISO (BIT(1)) -#define RTC_CNTL_FASTMEM_FORCE_ISO_M (BIT(1)) -#define RTC_CNTL_FASTMEM_FORCE_ISO_V 0x1 -#define RTC_CNTL_FASTMEM_FORCE_ISO_S 1 -/* RTC_CNTL_FASTMEM_FORCE_NOISO : R/W ;bitpos:[0] ;default: 1'b1 ; */ -/*description: Fast RTC memory force no ISO*/ -#define RTC_CNTL_FASTMEM_FORCE_NOISO (BIT(0)) -#define RTC_CNTL_FASTMEM_FORCE_NOISO_M (BIT(0)) -#define RTC_CNTL_FASTMEM_FORCE_NOISO_V 0x1 -#define RTC_CNTL_FASTMEM_FORCE_NOISO_S 0 - -/* Useful groups of RTC_CNTL_PWC_REG bits */ -#define RTC_CNTL_MEM_FORCE_ISO \ - (RTC_CNTL_SLOWMEM_FORCE_ISO | RTC_CNTL_FASTMEM_FORCE_ISO) -#define RTC_CNTL_MEM_FORCE_NOISO \ - (RTC_CNTL_SLOWMEM_FORCE_NOISO | RTC_CNTL_FASTMEM_FORCE_NOISO) -#define RTC_CNTL_MEM_PD_EN \ - (RTC_CNTL_SLOWMEM_PD_EN | RTC_CNTL_FASTMEM_PD_EN) -#define RTC_CNTL_MEM_FORCE_PU \ - (RTC_CNTL_SLOWMEM_FORCE_PU | RTC_CNTL_FASTMEM_FORCE_PU) -#define RTC_CNTL_MEM_FORCE_PD \ - (RTC_CNTL_SLOWMEM_FORCE_PD | RTC_CNTL_FASTMEM_FORCE_PD) -#define RTC_CNTL_MEM_FOLW_CPU \ - (RTC_CNTL_SLOWMEM_FOLW_CPU | RTC_CNTL_FASTMEM_FOLW_CPU) -#define RTC_CNTL_MEM_FORCE_LPU \ - (RTC_CNTL_SLOWMEM_FORCE_LPU | RTC_CNTL_FASTMEM_FORCE_LPU) -#define RTC_CNTL_MEM_FORCE_LPD \ - (RTC_CNTL_SLOWMEM_FORCE_LPD | RTC_CNTL_FASTMEM_FORCE_LPD) - -#define RTC_CNTL_DIG_PWC_REG (DR_REG_RTCCNTL_BASE + 0x84) -/* RTC_CNTL_DG_WRAP_PD_EN : R/W ;bitpos:[31] ;default: 0 ; */ -/*description: enable power down digital core in sleep*/ -#define RTC_CNTL_DG_WRAP_PD_EN (BIT(31)) -#define RTC_CNTL_DG_WRAP_PD_EN_M (BIT(31)) -#define RTC_CNTL_DG_WRAP_PD_EN_V 0x1 -#define RTC_CNTL_DG_WRAP_PD_EN_S 31 -/* RTC_CNTL_WIFI_PD_EN : R/W ;bitpos:[30] ;default: 0 ; */ -/*description: enable power down wifi in sleep*/ -#define RTC_CNTL_WIFI_PD_EN (BIT(30)) -#define RTC_CNTL_WIFI_PD_EN_M (BIT(30)) -#define RTC_CNTL_WIFI_PD_EN_V 0x1 -#define RTC_CNTL_WIFI_PD_EN_S 30 -/* RTC_CNTL_INTER_RAM4_PD_EN : R/W ;bitpos:[29] ;default: 0 ; */ -/*description: enable power down internal SRAM 4 in sleep*/ -#define RTC_CNTL_INTER_RAM4_PD_EN (BIT(29)) -#define RTC_CNTL_INTER_RAM4_PD_EN_M (BIT(29)) -#define RTC_CNTL_INTER_RAM4_PD_EN_V 0x1 -#define RTC_CNTL_INTER_RAM4_PD_EN_S 29 -/* RTC_CNTL_INTER_RAM3_PD_EN : R/W ;bitpos:[28] ;default: 0 ; */ -/*description: enable power down internal SRAM 3 in sleep*/ -#define RTC_CNTL_INTER_RAM3_PD_EN (BIT(28)) -#define RTC_CNTL_INTER_RAM3_PD_EN_M (BIT(28)) -#define RTC_CNTL_INTER_RAM3_PD_EN_V 0x1 -#define RTC_CNTL_INTER_RAM3_PD_EN_S 28 -/* RTC_CNTL_INTER_RAM2_PD_EN : R/W ;bitpos:[27] ;default: 0 ; */ -/*description: enable power down internal SRAM 2 in sleep*/ -#define RTC_CNTL_INTER_RAM2_PD_EN (BIT(27)) -#define RTC_CNTL_INTER_RAM2_PD_EN_M (BIT(27)) -#define RTC_CNTL_INTER_RAM2_PD_EN_V 0x1 -#define RTC_CNTL_INTER_RAM2_PD_EN_S 27 -/* RTC_CNTL_INTER_RAM1_PD_EN : R/W ;bitpos:[26] ;default: 0 ; */ -/*description: enable power down internal SRAM 1 in sleep*/ -#define RTC_CNTL_INTER_RAM1_PD_EN (BIT(26)) -#define RTC_CNTL_INTER_RAM1_PD_EN_M (BIT(26)) -#define RTC_CNTL_INTER_RAM1_PD_EN_V 0x1 -#define RTC_CNTL_INTER_RAM1_PD_EN_S 26 -/* RTC_CNTL_INTER_RAM0_PD_EN : R/W ;bitpos:[25] ;default: 0 ; */ -/*description: enable power down internal SRAM 0 in sleep*/ -#define RTC_CNTL_INTER_RAM0_PD_EN (BIT(25)) -#define RTC_CNTL_INTER_RAM0_PD_EN_M (BIT(25)) -#define RTC_CNTL_INTER_RAM0_PD_EN_V 0x1 -#define RTC_CNTL_INTER_RAM0_PD_EN_S 25 -/* RTC_CNTL_ROM0_PD_EN : R/W ;bitpos:[24] ;default: 0 ; */ -/*description: enable power down ROM in sleep*/ -#define RTC_CNTL_ROM0_PD_EN (BIT(24)) -#define RTC_CNTL_ROM0_PD_EN_M (BIT(24)) -#define RTC_CNTL_ROM0_PD_EN_V 0x1 -#define RTC_CNTL_ROM0_PD_EN_S 24 -/* RTC_CNTL_DG_WRAP_FORCE_PU : R/W ;bitpos:[20] ;default: 1'd1 ; */ -/*description: digital core force power up*/ -#define RTC_CNTL_DG_WRAP_FORCE_PU (BIT(20)) -#define RTC_CNTL_DG_WRAP_FORCE_PU_M (BIT(20)) -#define RTC_CNTL_DG_WRAP_FORCE_PU_V 0x1 -#define RTC_CNTL_DG_WRAP_FORCE_PU_S 20 -/* RTC_CNTL_DG_WRAP_FORCE_PD : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: digital core force power down*/ -#define RTC_CNTL_DG_WRAP_FORCE_PD (BIT(19)) -#define RTC_CNTL_DG_WRAP_FORCE_PD_M (BIT(19)) -#define RTC_CNTL_DG_WRAP_FORCE_PD_V 0x1 -#define RTC_CNTL_DG_WRAP_FORCE_PD_S 19 -/* RTC_CNTL_WIFI_FORCE_PU : R/W ;bitpos:[18] ;default: 1'd1 ; */ -/*description: wifi force power up*/ -#define RTC_CNTL_WIFI_FORCE_PU (BIT(18)) -#define RTC_CNTL_WIFI_FORCE_PU_M (BIT(18)) -#define RTC_CNTL_WIFI_FORCE_PU_V 0x1 -#define RTC_CNTL_WIFI_FORCE_PU_S 18 -/* RTC_CNTL_WIFI_FORCE_PD : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: wifi force power down*/ -#define RTC_CNTL_WIFI_FORCE_PD (BIT(17)) -#define RTC_CNTL_WIFI_FORCE_PD_M (BIT(17)) -#define RTC_CNTL_WIFI_FORCE_PD_V 0x1 -#define RTC_CNTL_WIFI_FORCE_PD_S 17 -/* RTC_CNTL_INTER_RAM4_FORCE_PU : R/W ;bitpos:[16] ;default: 1'd1 ; */ -/*description: internal SRAM 4 force power up*/ -#define RTC_CNTL_INTER_RAM4_FORCE_PU (BIT(16)) -#define RTC_CNTL_INTER_RAM4_FORCE_PU_M (BIT(16)) -#define RTC_CNTL_INTER_RAM4_FORCE_PU_V 0x1 -#define RTC_CNTL_INTER_RAM4_FORCE_PU_S 16 -/* RTC_CNTL_INTER_RAM4_FORCE_PD : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: internal SRAM 4 force power down*/ -#define RTC_CNTL_INTER_RAM4_FORCE_PD (BIT(15)) -#define RTC_CNTL_INTER_RAM4_FORCE_PD_M (BIT(15)) -#define RTC_CNTL_INTER_RAM4_FORCE_PD_V 0x1 -#define RTC_CNTL_INTER_RAM4_FORCE_PD_S 15 -/* RTC_CNTL_INTER_RAM3_FORCE_PU : R/W ;bitpos:[14] ;default: 1'd1 ; */ -/*description: internal SRAM 3 force power up*/ -#define RTC_CNTL_INTER_RAM3_FORCE_PU (BIT(14)) -#define RTC_CNTL_INTER_RAM3_FORCE_PU_M (BIT(14)) -#define RTC_CNTL_INTER_RAM3_FORCE_PU_V 0x1 -#define RTC_CNTL_INTER_RAM3_FORCE_PU_S 14 -/* RTC_CNTL_INTER_RAM3_FORCE_PD : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: internal SRAM 3 force power down*/ -#define RTC_CNTL_INTER_RAM3_FORCE_PD (BIT(13)) -#define RTC_CNTL_INTER_RAM3_FORCE_PD_M (BIT(13)) -#define RTC_CNTL_INTER_RAM3_FORCE_PD_V 0x1 -#define RTC_CNTL_INTER_RAM3_FORCE_PD_S 13 -/* RTC_CNTL_INTER_RAM2_FORCE_PU : R/W ;bitpos:[12] ;default: 1'd1 ; */ -/*description: internal SRAM 2 force power up*/ -#define RTC_CNTL_INTER_RAM2_FORCE_PU (BIT(12)) -#define RTC_CNTL_INTER_RAM2_FORCE_PU_M (BIT(12)) -#define RTC_CNTL_INTER_RAM2_FORCE_PU_V 0x1 -#define RTC_CNTL_INTER_RAM2_FORCE_PU_S 12 -/* RTC_CNTL_INTER_RAM2_FORCE_PD : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: internal SRAM 2 force power down*/ -#define RTC_CNTL_INTER_RAM2_FORCE_PD (BIT(11)) -#define RTC_CNTL_INTER_RAM2_FORCE_PD_M (BIT(11)) -#define RTC_CNTL_INTER_RAM2_FORCE_PD_V 0x1 -#define RTC_CNTL_INTER_RAM2_FORCE_PD_S 11 -/* RTC_CNTL_INTER_RAM1_FORCE_PU : R/W ;bitpos:[10] ;default: 1'd1 ; */ -/*description: internal SRAM 1 force power up*/ -#define RTC_CNTL_INTER_RAM1_FORCE_PU (BIT(10)) -#define RTC_CNTL_INTER_RAM1_FORCE_PU_M (BIT(10)) -#define RTC_CNTL_INTER_RAM1_FORCE_PU_V 0x1 -#define RTC_CNTL_INTER_RAM1_FORCE_PU_S 10 -/* RTC_CNTL_INTER_RAM1_FORCE_PD : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: internal SRAM 1 force power down*/ -#define RTC_CNTL_INTER_RAM1_FORCE_PD (BIT(9)) -#define RTC_CNTL_INTER_RAM1_FORCE_PD_M (BIT(9)) -#define RTC_CNTL_INTER_RAM1_FORCE_PD_V 0x1 -#define RTC_CNTL_INTER_RAM1_FORCE_PD_S 9 -/* RTC_CNTL_INTER_RAM0_FORCE_PU : R/W ;bitpos:[8] ;default: 1'd1 ; */ -/*description: internal SRAM 0 force power up*/ -#define RTC_CNTL_INTER_RAM0_FORCE_PU (BIT(8)) -#define RTC_CNTL_INTER_RAM0_FORCE_PU_M (BIT(8)) -#define RTC_CNTL_INTER_RAM0_FORCE_PU_V 0x1 -#define RTC_CNTL_INTER_RAM0_FORCE_PU_S 8 -/* RTC_CNTL_INTER_RAM0_FORCE_PD : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: internal SRAM 0 force power down*/ -#define RTC_CNTL_INTER_RAM0_FORCE_PD (BIT(7)) -#define RTC_CNTL_INTER_RAM0_FORCE_PD_M (BIT(7)) -#define RTC_CNTL_INTER_RAM0_FORCE_PD_V 0x1 -#define RTC_CNTL_INTER_RAM0_FORCE_PD_S 7 -/* RTC_CNTL_ROM0_FORCE_PU : R/W ;bitpos:[6] ;default: 1'd1 ; */ -/*description: ROM force power up*/ -#define RTC_CNTL_ROM0_FORCE_PU (BIT(6)) -#define RTC_CNTL_ROM0_FORCE_PU_M (BIT(6)) -#define RTC_CNTL_ROM0_FORCE_PU_V 0x1 -#define RTC_CNTL_ROM0_FORCE_PU_S 6 -/* RTC_CNTL_ROM0_FORCE_PD : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: ROM force power down*/ -#define RTC_CNTL_ROM0_FORCE_PD (BIT(5)) -#define RTC_CNTL_ROM0_FORCE_PD_M (BIT(5)) -#define RTC_CNTL_ROM0_FORCE_PD_V 0x1 -#define RTC_CNTL_ROM0_FORCE_PD_S 5 -/* RTC_CNTL_LSLP_MEM_FORCE_PU : R/W ;bitpos:[4] ;default: 1'b1 ; */ -/*description: memories in digital core force no PD in sleep*/ -#define RTC_CNTL_LSLP_MEM_FORCE_PU (BIT(4)) -#define RTC_CNTL_LSLP_MEM_FORCE_PU_M (BIT(4)) -#define RTC_CNTL_LSLP_MEM_FORCE_PU_V 0x1 -#define RTC_CNTL_LSLP_MEM_FORCE_PU_S 4 -/* RTC_CNTL_LSLP_MEM_FORCE_PD : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: memories in digital core force PD in sleep*/ -#define RTC_CNTL_LSLP_MEM_FORCE_PD (BIT(3)) -#define RTC_CNTL_LSLP_MEM_FORCE_PD_M (BIT(3)) -#define RTC_CNTL_LSLP_MEM_FORCE_PD_V 0x1 -#define RTC_CNTL_LSLP_MEM_FORCE_PD_S 3 - -/* Useful groups of RTC_CNTL_DIG_PWC_REG bits */ -#define RTC_CNTL_CPU_ROM_RAM_PD_EN \ - (RTC_CNTL_INTER_RAM4_PD_EN | RTC_CNTL_INTER_RAM3_PD_EN |\ - RTC_CNTL_INTER_RAM2_PD_EN | RTC_CNTL_INTER_RAM1_PD_EN |\ - RTC_CNTL_INTER_RAM0_PD_EN | RTC_CNTL_ROM0_PD_EN) -#define RTC_CNTL_CPU_ROM_RAM_FORCE_PU \ - (RTC_CNTL_INTER_RAM4_FORCE_PU | RTC_CNTL_INTER_RAM3_FORCE_PU |\ - RTC_CNTL_INTER_RAM2_FORCE_PU | RTC_CNTL_INTER_RAM1_FORCE_PU |\ - RTC_CNTL_INTER_RAM0_FORCE_PU | RTC_CNTL_ROM0_FORCE_PU) -#define RTC_CNTL_CPU_ROM_RAM_FORCE_PD \ - (RTC_CNTL_INTER_RAM4_FORCE_PD | RTC_CNTL_INTER_RAM3_FORCE_PD |\ - RTC_CNTL_INTER_RAM2_FORCE_PD | RTC_CNTL_INTER_RAM1_FORCE_PD |\ - RTC_CNTL_INTER_RAM0_FORCE_PD | RTC_CNTL_ROM0_FORCE_PD - -#define RTC_CNTL_DIG_ISO_REG (DR_REG_RTCCNTL_BASE + 0x88) -/* RTC_CNTL_DG_WRAP_FORCE_NOISO : R/W ;bitpos:[31] ;default: 1'd1 ; */ -/*description: digital core force no ISO*/ -#define RTC_CNTL_DG_WRAP_FORCE_NOISO (BIT(31)) -#define RTC_CNTL_DG_WRAP_FORCE_NOISO_M (BIT(31)) -#define RTC_CNTL_DG_WRAP_FORCE_NOISO_V 0x1 -#define RTC_CNTL_DG_WRAP_FORCE_NOISO_S 31 -/* RTC_CNTL_DG_WRAP_FORCE_ISO : R/W ;bitpos:[30] ;default: 1'd0 ; */ -/*description: digital core force ISO*/ -#define RTC_CNTL_DG_WRAP_FORCE_ISO (BIT(30)) -#define RTC_CNTL_DG_WRAP_FORCE_ISO_M (BIT(30)) -#define RTC_CNTL_DG_WRAP_FORCE_ISO_V 0x1 -#define RTC_CNTL_DG_WRAP_FORCE_ISO_S 30 -/* RTC_CNTL_WIFI_FORCE_NOISO : R/W ;bitpos:[29] ;default: 1'd1 ; */ -/*description: wifi force no ISO*/ -#define RTC_CNTL_WIFI_FORCE_NOISO (BIT(29)) -#define RTC_CNTL_WIFI_FORCE_NOISO_M (BIT(29)) -#define RTC_CNTL_WIFI_FORCE_NOISO_V 0x1 -#define RTC_CNTL_WIFI_FORCE_NOISO_S 29 -/* RTC_CNTL_WIFI_FORCE_ISO : R/W ;bitpos:[28] ;default: 1'd0 ; */ -/*description: wifi force ISO*/ -#define RTC_CNTL_WIFI_FORCE_ISO (BIT(28)) -#define RTC_CNTL_WIFI_FORCE_ISO_M (BIT(28)) -#define RTC_CNTL_WIFI_FORCE_ISO_V 0x1 -#define RTC_CNTL_WIFI_FORCE_ISO_S 28 -/* RTC_CNTL_INTER_RAM4_FORCE_NOISO : R/W ;bitpos:[27] ;default: 1'd1 ; */ -/*description: internal SRAM 4 force no ISO*/ -#define RTC_CNTL_INTER_RAM4_FORCE_NOISO (BIT(27)) -#define RTC_CNTL_INTER_RAM4_FORCE_NOISO_M (BIT(27)) -#define RTC_CNTL_INTER_RAM4_FORCE_NOISO_V 0x1 -#define RTC_CNTL_INTER_RAM4_FORCE_NOISO_S 27 -/* RTC_CNTL_INTER_RAM4_FORCE_ISO : R/W ;bitpos:[26] ;default: 1'd0 ; */ -/*description: internal SRAM 4 force ISO*/ -#define RTC_CNTL_INTER_RAM4_FORCE_ISO (BIT(26)) -#define RTC_CNTL_INTER_RAM4_FORCE_ISO_M (BIT(26)) -#define RTC_CNTL_INTER_RAM4_FORCE_ISO_V 0x1 -#define RTC_CNTL_INTER_RAM4_FORCE_ISO_S 26 -/* RTC_CNTL_INTER_RAM3_FORCE_NOISO : R/W ;bitpos:[25] ;default: 1'd1 ; */ -/*description: internal SRAM 3 force no ISO*/ -#define RTC_CNTL_INTER_RAM3_FORCE_NOISO (BIT(25)) -#define RTC_CNTL_INTER_RAM3_FORCE_NOISO_M (BIT(25)) -#define RTC_CNTL_INTER_RAM3_FORCE_NOISO_V 0x1 -#define RTC_CNTL_INTER_RAM3_FORCE_NOISO_S 25 -/* RTC_CNTL_INTER_RAM3_FORCE_ISO : R/W ;bitpos:[24] ;default: 1'd0 ; */ -/*description: internal SRAM 3 force ISO*/ -#define RTC_CNTL_INTER_RAM3_FORCE_ISO (BIT(24)) -#define RTC_CNTL_INTER_RAM3_FORCE_ISO_M (BIT(24)) -#define RTC_CNTL_INTER_RAM3_FORCE_ISO_V 0x1 -#define RTC_CNTL_INTER_RAM3_FORCE_ISO_S 24 -/* RTC_CNTL_INTER_RAM2_FORCE_NOISO : R/W ;bitpos:[23] ;default: 1'd1 ; */ -/*description: internal SRAM 2 force no ISO*/ -#define RTC_CNTL_INTER_RAM2_FORCE_NOISO (BIT(23)) -#define RTC_CNTL_INTER_RAM2_FORCE_NOISO_M (BIT(23)) -#define RTC_CNTL_INTER_RAM2_FORCE_NOISO_V 0x1 -#define RTC_CNTL_INTER_RAM2_FORCE_NOISO_S 23 -/* RTC_CNTL_INTER_RAM2_FORCE_ISO : R/W ;bitpos:[22] ;default: 1'd0 ; */ -/*description: internal SRAM 2 force ISO*/ -#define RTC_CNTL_INTER_RAM2_FORCE_ISO (BIT(22)) -#define RTC_CNTL_INTER_RAM2_FORCE_ISO_M (BIT(22)) -#define RTC_CNTL_INTER_RAM2_FORCE_ISO_V 0x1 -#define RTC_CNTL_INTER_RAM2_FORCE_ISO_S 22 -/* RTC_CNTL_INTER_RAM1_FORCE_NOISO : R/W ;bitpos:[21] ;default: 1'd1 ; */ -/*description: internal SRAM 1 force no ISO*/ -#define RTC_CNTL_INTER_RAM1_FORCE_NOISO (BIT(21)) -#define RTC_CNTL_INTER_RAM1_FORCE_NOISO_M (BIT(21)) -#define RTC_CNTL_INTER_RAM1_FORCE_NOISO_V 0x1 -#define RTC_CNTL_INTER_RAM1_FORCE_NOISO_S 21 -/* RTC_CNTL_INTER_RAM1_FORCE_ISO : R/W ;bitpos:[20] ;default: 1'd0 ; */ -/*description: internal SRAM 1 force ISO*/ -#define RTC_CNTL_INTER_RAM1_FORCE_ISO (BIT(20)) -#define RTC_CNTL_INTER_RAM1_FORCE_ISO_M (BIT(20)) -#define RTC_CNTL_INTER_RAM1_FORCE_ISO_V 0x1 -#define RTC_CNTL_INTER_RAM1_FORCE_ISO_S 20 -/* RTC_CNTL_INTER_RAM0_FORCE_NOISO : R/W ;bitpos:[19] ;default: 1'd1 ; */ -/*description: internal SRAM 0 force no ISO*/ -#define RTC_CNTL_INTER_RAM0_FORCE_NOISO (BIT(19)) -#define RTC_CNTL_INTER_RAM0_FORCE_NOISO_M (BIT(19)) -#define RTC_CNTL_INTER_RAM0_FORCE_NOISO_V 0x1 -#define RTC_CNTL_INTER_RAM0_FORCE_NOISO_S 19 -/* RTC_CNTL_INTER_RAM0_FORCE_ISO : R/W ;bitpos:[18] ;default: 1'd0 ; */ -/*description: internal SRAM 0 force ISO*/ -#define RTC_CNTL_INTER_RAM0_FORCE_ISO (BIT(18)) -#define RTC_CNTL_INTER_RAM0_FORCE_ISO_M (BIT(18)) -#define RTC_CNTL_INTER_RAM0_FORCE_ISO_V 0x1 -#define RTC_CNTL_INTER_RAM0_FORCE_ISO_S 18 -/* RTC_CNTL_ROM0_FORCE_NOISO : R/W ;bitpos:[17] ;default: 1'd1 ; */ -/*description: ROM force no ISO*/ -#define RTC_CNTL_ROM0_FORCE_NOISO (BIT(17)) -#define RTC_CNTL_ROM0_FORCE_NOISO_M (BIT(17)) -#define RTC_CNTL_ROM0_FORCE_NOISO_V 0x1 -#define RTC_CNTL_ROM0_FORCE_NOISO_S 17 -/* RTC_CNTL_ROM0_FORCE_ISO : R/W ;bitpos:[16] ;default: 1'd0 ; */ -/*description: ROM force ISO*/ -#define RTC_CNTL_ROM0_FORCE_ISO (BIT(16)) -#define RTC_CNTL_ROM0_FORCE_ISO_M (BIT(16)) -#define RTC_CNTL_ROM0_FORCE_ISO_V 0x1 -#define RTC_CNTL_ROM0_FORCE_ISO_S 16 -/* RTC_CNTL_DG_PAD_FORCE_HOLD : R/W ;bitpos:[15] ;default: 1'd0 ; */ -/*description: digital pad force hold*/ -#define RTC_CNTL_DG_PAD_FORCE_HOLD (BIT(15)) -#define RTC_CNTL_DG_PAD_FORCE_HOLD_M (BIT(15)) -#define RTC_CNTL_DG_PAD_FORCE_HOLD_V 0x1 -#define RTC_CNTL_DG_PAD_FORCE_HOLD_S 15 -/* RTC_CNTL_DG_PAD_FORCE_UNHOLD : R/W ;bitpos:[14] ;default: 1'd1 ; */ -/*description: digital pad force un-hold*/ -#define RTC_CNTL_DG_PAD_FORCE_UNHOLD (BIT(14)) -#define RTC_CNTL_DG_PAD_FORCE_UNHOLD_M (BIT(14)) -#define RTC_CNTL_DG_PAD_FORCE_UNHOLD_V 0x1 -#define RTC_CNTL_DG_PAD_FORCE_UNHOLD_S 14 -/* RTC_CNTL_DG_PAD_FORCE_ISO : R/W ;bitpos:[13] ;default: 1'd0 ; */ -/*description: digital pad force ISO*/ -#define RTC_CNTL_DG_PAD_FORCE_ISO (BIT(13)) -#define RTC_CNTL_DG_PAD_FORCE_ISO_M (BIT(13)) -#define RTC_CNTL_DG_PAD_FORCE_ISO_V 0x1 -#define RTC_CNTL_DG_PAD_FORCE_ISO_S 13 -/* RTC_CNTL_DG_PAD_FORCE_NOISO : R/W ;bitpos:[12] ;default: 1'd1 ; */ -/*description: digital pad force no ISO*/ -#define RTC_CNTL_DG_PAD_FORCE_NOISO (BIT(12)) -#define RTC_CNTL_DG_PAD_FORCE_NOISO_M (BIT(12)) -#define RTC_CNTL_DG_PAD_FORCE_NOISO_V 0x1 -#define RTC_CNTL_DG_PAD_FORCE_NOISO_S 12 -/* RTC_CNTL_DG_PAD_AUTOHOLD_EN : R/W ;bitpos:[11] ;default: 1'd0 ; */ -/*description: digital pad enable auto-hold*/ -#define RTC_CNTL_DG_PAD_AUTOHOLD_EN (BIT(11)) -#define RTC_CNTL_DG_PAD_AUTOHOLD_EN_M (BIT(11)) -#define RTC_CNTL_DG_PAD_AUTOHOLD_EN_V 0x1 -#define RTC_CNTL_DG_PAD_AUTOHOLD_EN_S 11 -/* RTC_CNTL_CLR_DG_PAD_AUTOHOLD : WO ;bitpos:[10] ;default: 1'd0 ; */ -/*description: wtite only register to clear digital pad auto-hold*/ -#define RTC_CNTL_CLR_DG_PAD_AUTOHOLD (BIT(10)) -#define RTC_CNTL_CLR_DG_PAD_AUTOHOLD_M (BIT(10)) -#define RTC_CNTL_CLR_DG_PAD_AUTOHOLD_V 0x1 -#define RTC_CNTL_CLR_DG_PAD_AUTOHOLD_S 10 -/* RTC_CNTL_DG_PAD_AUTOHOLD : RO ;bitpos:[9] ;default: 1'd0 ; */ -/*description: read only register to indicate digital pad auto-hold status*/ -#define RTC_CNTL_DG_PAD_AUTOHOLD (BIT(9)) -#define RTC_CNTL_DG_PAD_AUTOHOLD_M (BIT(9)) -#define RTC_CNTL_DG_PAD_AUTOHOLD_V 0x1 -#define RTC_CNTL_DG_PAD_AUTOHOLD_S 9 -/* RTC_CNTL_DIG_ISO_FORCE_ON : R/W ;bitpos:[8] ;default: 1'd0 ; */ -/*description: */ -#define RTC_CNTL_DIG_ISO_FORCE_ON (BIT(8)) -#define RTC_CNTL_DIG_ISO_FORCE_ON_M (BIT(8)) -#define RTC_CNTL_DIG_ISO_FORCE_ON_V 0x1 -#define RTC_CNTL_DIG_ISO_FORCE_ON_S 8 -/* RTC_CNTL_DIG_ISO_FORCE_OFF : R/W ;bitpos:[7] ;default: 1'd0 ; */ -/*description: */ -#define RTC_CNTL_DIG_ISO_FORCE_OFF (BIT(7)) -#define RTC_CNTL_DIG_ISO_FORCE_OFF_M (BIT(7)) -#define RTC_CNTL_DIG_ISO_FORCE_OFF_V 0x1 -#define RTC_CNTL_DIG_ISO_FORCE_OFF_S 7 - -/* Useful groups of RTC_CNTL_DIG_ISO_REG bits */ -#define RTC_CNTL_CPU_ROM_RAM_FORCE_ISO \ - (RTC_CNTL_INTER_RAM4_FORCE_ISO | RTC_CNTL_INTER_RAM3_FORCE_ISO |\ - RTC_CNTL_INTER_RAM2_FORCE_ISO | RTC_CNTL_INTER_RAM1_FORCE_ISO |\ - RTC_CNTL_INTER_RAM0_FORCE_ISO | RTC_CNTL_ROM0_FORCE_ISO) -#define RTC_CNTL_CPU_ROM_RAM_FORCE_NOISO \ - (RTC_CNTL_INTER_RAM4_FORCE_NOISO | RTC_CNTL_INTER_RAM3_FORCE_NOISO |\ - RTC_CNTL_INTER_RAM2_FORCE_NOISO | RTC_CNTL_INTER_RAM1_FORCE_NOISO |\ - RTC_CNTL_INTER_RAM0_FORCE_NOISO | RTC_CNTL_ROM0_FORCE_NOISO) - -#define RTC_CNTL_WDTCONFIG0_REG (DR_REG_RTCCNTL_BASE + 0x8c) -/* RTC_CNTL_WDT_EN : R/W ;bitpos:[31] ;default: 1'h0 ; */ -/*description: enable RTC WDT*/ -#define RTC_CNTL_WDT_EN (BIT(31)) -#define RTC_CNTL_WDT_EN_M (BIT(31)) -#define RTC_CNTL_WDT_EN_V 0x1 -#define RTC_CNTL_WDT_EN_S 31 -/* RTC_CNTL_WDT_STG0 : R/W ;bitpos:[30:28] ;default: 3'h0 ; */ -/*description: 1: interrupt stage en 2: CPU reset stage en 3: system reset - stage en 4: RTC reset stage en*/ -#define RTC_CNTL_WDT_STG0 0x00000007 -#define RTC_CNTL_WDT_STG0_M ((RTC_CNTL_WDT_STG0_V)<<(RTC_CNTL_WDT_STG0_S)) -#define RTC_CNTL_WDT_STG0_V 0x7 -#define RTC_CNTL_WDT_STG0_S 28 -/* RTC_CNTL_WDT_STG1 : R/W ;bitpos:[27:25] ;default: 3'h0 ; */ -/*description: 1: interrupt stage en 2: CPU reset stage en 3: system reset - stage en 4: RTC reset stage en*/ -#define RTC_CNTL_WDT_STG1 0x00000007 -#define RTC_CNTL_WDT_STG1_M ((RTC_CNTL_WDT_STG1_V)<<(RTC_CNTL_WDT_STG1_S)) -#define RTC_CNTL_WDT_STG1_V 0x7 -#define RTC_CNTL_WDT_STG1_S 25 -/* RTC_CNTL_WDT_STG2 : R/W ;bitpos:[24:22] ;default: 3'h0 ; */ -/*description: 1: interrupt stage en 2: CPU reset stage en 3: system reset - stage en 4: RTC reset stage en*/ -#define RTC_CNTL_WDT_STG2 0x00000007 -#define RTC_CNTL_WDT_STG2_M ((RTC_CNTL_WDT_STG2_V)<<(RTC_CNTL_WDT_STG2_S)) -#define RTC_CNTL_WDT_STG2_V 0x7 -#define RTC_CNTL_WDT_STG2_S 22 -/* RTC_CNTL_WDT_STG3 : R/W ;bitpos:[21:19] ;default: 3'h0 ; */ -/*description: 1: interrupt stage en 2: CPU reset stage en 3: system reset - stage en 4: RTC reset stage en*/ -#define RTC_CNTL_WDT_STG3 0x00000007 -#define RTC_CNTL_WDT_STG3_M ((RTC_CNTL_WDT_STG3_V)<<(RTC_CNTL_WDT_STG3_S)) -#define RTC_CNTL_WDT_STG3_V 0x7 -#define RTC_CNTL_WDT_STG3_S 19 -/* RTC_CNTL_WDT_EDGE_INT_EN : R/W ;bitpos:[18] ;default: 1'h0 ; */ -/*description: N/A*/ -#define RTC_CNTL_WDT_EDGE_INT_EN (BIT(18)) -#define RTC_CNTL_WDT_EDGE_INT_EN_M (BIT(18)) -#define RTC_CNTL_WDT_EDGE_INT_EN_V 0x1 -#define RTC_CNTL_WDT_EDGE_INT_EN_S 18 -/* RTC_CNTL_WDT_LEVEL_INT_EN : R/W ;bitpos:[17] ;default: 1'h0 ; */ -/*description: N/A*/ -#define RTC_CNTL_WDT_LEVEL_INT_EN (BIT(17)) -#define RTC_CNTL_WDT_LEVEL_INT_EN_M (BIT(17)) -#define RTC_CNTL_WDT_LEVEL_INT_EN_V 0x1 -#define RTC_CNTL_WDT_LEVEL_INT_EN_S 17 -/* RTC_CNTL_WDT_CPU_RESET_LENGTH : R/W ;bitpos:[16:14] ;default: 3'h1 ; */ -/*description: CPU reset counter length*/ -#define RTC_CNTL_WDT_CPU_RESET_LENGTH 0x00000007 -#define RTC_CNTL_WDT_CPU_RESET_LENGTH_M ((RTC_CNTL_WDT_CPU_RESET_LENGTH_V)<<(RTC_CNTL_WDT_CPU_RESET_LENGTH_S)) -#define RTC_CNTL_WDT_CPU_RESET_LENGTH_V 0x7 -#define RTC_CNTL_WDT_CPU_RESET_LENGTH_S 14 -/* RTC_CNTL_WDT_SYS_RESET_LENGTH : R/W ;bitpos:[13:11] ;default: 3'h1 ; */ -/*description: system reset counter length*/ -#define RTC_CNTL_WDT_SYS_RESET_LENGTH 0x00000007 -#define RTC_CNTL_WDT_SYS_RESET_LENGTH_M ((RTC_CNTL_WDT_SYS_RESET_LENGTH_V)<<(RTC_CNTL_WDT_SYS_RESET_LENGTH_S)) -#define RTC_CNTL_WDT_SYS_RESET_LENGTH_V 0x7 -#define RTC_CNTL_WDT_SYS_RESET_LENGTH_S 11 -/* RTC_CNTL_WDT_FLASHBOOT_MOD_EN : R/W ;bitpos:[10] ;default: 1'h1 ; */ -/*description: enable WDT in flash boot*/ -#define RTC_CNTL_WDT_FLASHBOOT_MOD_EN (BIT(10)) -#define RTC_CNTL_WDT_FLASHBOOT_MOD_EN_M (BIT(10)) -#define RTC_CNTL_WDT_FLASHBOOT_MOD_EN_V 0x1 -#define RTC_CNTL_WDT_FLASHBOOT_MOD_EN_S 10 -/* RTC_CNTL_WDT_PROCPU_RESET_EN : R/W ;bitpos:[9] ;default: 1'd0 ; */ -/*description: enable WDT reset PRO CPU*/ -#define RTC_CNTL_WDT_PROCPU_RESET_EN (BIT(9)) -#define RTC_CNTL_WDT_PROCPU_RESET_EN_M (BIT(9)) -#define RTC_CNTL_WDT_PROCPU_RESET_EN_V 0x1 -#define RTC_CNTL_WDT_PROCPU_RESET_EN_S 9 -/* RTC_CNTL_WDT_APPCPU_RESET_EN : R/W ;bitpos:[8] ;default: 1'd0 ; */ -/*description: enable WDT reset APP CPU*/ -#define RTC_CNTL_WDT_APPCPU_RESET_EN (BIT(8)) -#define RTC_CNTL_WDT_APPCPU_RESET_EN_M (BIT(8)) -#define RTC_CNTL_WDT_APPCPU_RESET_EN_V 0x1 -#define RTC_CNTL_WDT_APPCPU_RESET_EN_S 8 -/* RTC_CNTL_WDT_PAUSE_IN_SLP : R/W ;bitpos:[7] ;default: 1'd1 ; */ -/*description: pause WDT in sleep*/ -#define RTC_CNTL_WDT_PAUSE_IN_SLP (BIT(7)) -#define RTC_CNTL_WDT_PAUSE_IN_SLP_M (BIT(7)) -#define RTC_CNTL_WDT_PAUSE_IN_SLP_V 0x1 -#define RTC_CNTL_WDT_PAUSE_IN_SLP_S 7 -/* RTC_CNTL_WDT_STGX : */ -/*description: stage action selection values */ -#define RTC_WDT_STG_SEL_OFF 0 -#define RTC_WDT_STG_SEL_INT 1 -#define RTC_WDT_STG_SEL_RESET_CPU 2 -#define RTC_WDT_STG_SEL_RESET_SYSTEM 3 -#define RTC_WDT_STG_SEL_RESET_RTC 4 - -#define RTC_CNTL_WDTCONFIG1_REG (DR_REG_RTCCNTL_BASE + 0x90) -/* RTC_CNTL_WDT_STG0_HOLD : R/W ;bitpos:[31:0] ;default: 32'd128000 ; */ -/*description: */ -#define RTC_CNTL_WDT_STG0_HOLD 0xFFFFFFFF -#define RTC_CNTL_WDT_STG0_HOLD_M ((RTC_CNTL_WDT_STG0_HOLD_V)<<(RTC_CNTL_WDT_STG0_HOLD_S)) -#define RTC_CNTL_WDT_STG0_HOLD_V 0xFFFFFFFF -#define RTC_CNTL_WDT_STG0_HOLD_S 0 - -#define RTC_CNTL_WDTCONFIG2_REG (DR_REG_RTCCNTL_BASE + 0x94) -/* RTC_CNTL_WDT_STG1_HOLD : R/W ;bitpos:[31:0] ;default: 32'd80000 ; */ -/*description: */ -#define RTC_CNTL_WDT_STG1_HOLD 0xFFFFFFFF -#define RTC_CNTL_WDT_STG1_HOLD_M ((RTC_CNTL_WDT_STG1_HOLD_V)<<(RTC_CNTL_WDT_STG1_HOLD_S)) -#define RTC_CNTL_WDT_STG1_HOLD_V 0xFFFFFFFF -#define RTC_CNTL_WDT_STG1_HOLD_S 0 - -#define RTC_CNTL_WDTCONFIG3_REG (DR_REG_RTCCNTL_BASE + 0x98) -/* RTC_CNTL_WDT_STG2_HOLD : R/W ;bitpos:[31:0] ;default: 32'hfff ; */ -/*description: */ -#define RTC_CNTL_WDT_STG2_HOLD 0xFFFFFFFF -#define RTC_CNTL_WDT_STG2_HOLD_M ((RTC_CNTL_WDT_STG2_HOLD_V)<<(RTC_CNTL_WDT_STG2_HOLD_S)) -#define RTC_CNTL_WDT_STG2_HOLD_V 0xFFFFFFFF -#define RTC_CNTL_WDT_STG2_HOLD_S 0 - -#define RTC_CNTL_WDTCONFIG4_REG (DR_REG_RTCCNTL_BASE + 0x9c) -/* RTC_CNTL_WDT_STG3_HOLD : R/W ;bitpos:[31:0] ;default: 32'hfff ; */ -/*description: */ -#define RTC_CNTL_WDT_STG3_HOLD 0xFFFFFFFF -#define RTC_CNTL_WDT_STG3_HOLD_M ((RTC_CNTL_WDT_STG3_HOLD_V)<<(RTC_CNTL_WDT_STG3_HOLD_S)) -#define RTC_CNTL_WDT_STG3_HOLD_V 0xFFFFFFFF -#define RTC_CNTL_WDT_STG3_HOLD_S 0 - -#define RTC_CNTL_WDTFEED_REG (DR_REG_RTCCNTL_BASE + 0xa0) -/* RTC_CNTL_WDT_FEED : WO ;bitpos:[31] ;default: 1'd0 ; */ -/*description: */ -#define RTC_CNTL_WDT_FEED (BIT(31)) -#define RTC_CNTL_WDT_FEED_M (BIT(31)) -#define RTC_CNTL_WDT_FEED_V 0x1 -#define RTC_CNTL_WDT_FEED_S 31 - -#define RTC_CNTL_WDTWPROTECT_REG (DR_REG_RTCCNTL_BASE + 0xa4) -/* RTC_CNTL_WDT_WKEY : R/W ;bitpos:[31:0] ;default: 32'h50d83aa1 ; */ -/*description: */ -#define RTC_CNTL_WDT_WKEY 0xFFFFFFFF -#define RTC_CNTL_WDT_WKEY_M ((RTC_CNTL_WDT_WKEY_V)<<(RTC_CNTL_WDT_WKEY_S)) -#define RTC_CNTL_WDT_WKEY_V 0xFFFFFFFF -#define RTC_CNTL_WDT_WKEY_S 0 - -#define RTC_CNTL_TEST_MUX_REG (DR_REG_RTCCNTL_BASE + 0xa8) -/* RTC_CNTL_DTEST_RTC : R/W ;bitpos:[31:30] ;default: 2'd0 ; */ -/*description: DTEST_RTC*/ -#define RTC_CNTL_DTEST_RTC 0x00000003 -#define RTC_CNTL_DTEST_RTC_M ((RTC_CNTL_DTEST_RTC_V)<<(RTC_CNTL_DTEST_RTC_S)) -#define RTC_CNTL_DTEST_RTC_V 0x3 -#define RTC_CNTL_DTEST_RTC_S 30 -/* RTC_CNTL_ENT_RTC : R/W ;bitpos:[29] ;default: 1'd0 ; */ -/*description: ENT_RTC*/ -#define RTC_CNTL_ENT_RTC (BIT(29)) -#define RTC_CNTL_ENT_RTC_M (BIT(29)) -#define RTC_CNTL_ENT_RTC_V 0x1 -#define RTC_CNTL_ENT_RTC_S 29 - -#define RTC_CNTL_SW_CPU_STALL_REG (DR_REG_RTCCNTL_BASE + 0xac) -/* RTC_CNTL_SW_STALL_PROCPU_C1 : R/W ;bitpos:[31:26] ;default: 6'b0 ; */ -/*description: {reg_sw_stall_procpu_c1[5:0] reg_sw_stall_procpu_c0[1:0]} == - 0x86 will stall PRO CPU*/ -#define RTC_CNTL_SW_STALL_PROCPU_C1 0x0000003F -#define RTC_CNTL_SW_STALL_PROCPU_C1_M ((RTC_CNTL_SW_STALL_PROCPU_C1_V)<<(RTC_CNTL_SW_STALL_PROCPU_C1_S)) -#define RTC_CNTL_SW_STALL_PROCPU_C1_V 0x3F -#define RTC_CNTL_SW_STALL_PROCPU_C1_S 26 -/* RTC_CNTL_SW_STALL_APPCPU_C1 : R/W ;bitpos:[25:20] ;default: 6'b0 ; */ -/*description: {reg_sw_stall_appcpu_c1[5:0] reg_sw_stall_appcpu_c0[1:0]} == - 0x86 will stall APP CPU*/ -#define RTC_CNTL_SW_STALL_APPCPU_C1 0x0000003F -#define RTC_CNTL_SW_STALL_APPCPU_C1_M ((RTC_CNTL_SW_STALL_APPCPU_C1_V)<<(RTC_CNTL_SW_STALL_APPCPU_C1_S)) -#define RTC_CNTL_SW_STALL_APPCPU_C1_V 0x3F -#define RTC_CNTL_SW_STALL_APPCPU_C1_S 20 - -#define RTC_CNTL_STORE4_REG (DR_REG_RTCCNTL_BASE + 0xb0) -/* RTC_CNTL_SCRATCH4 : R/W ;bitpos:[31:0] ;default: 0 ; */ -/*description: 32-bit general purpose retention register*/ -#define RTC_CNTL_SCRATCH4 0xFFFFFFFF -#define RTC_CNTL_SCRATCH4_M ((RTC_CNTL_SCRATCH4_V)<<(RTC_CNTL_SCRATCH4_S)) -#define RTC_CNTL_SCRATCH4_V 0xFFFFFFFF -#define RTC_CNTL_SCRATCH4_S 0 - -#define RTC_CNTL_STORE5_REG (DR_REG_RTCCNTL_BASE + 0xb4) -/* RTC_CNTL_SCRATCH5 : R/W ;bitpos:[31:0] ;default: 0 ; */ -/*description: 32-bit general purpose retention register*/ -#define RTC_CNTL_SCRATCH5 0xFFFFFFFF -#define RTC_CNTL_SCRATCH5_M ((RTC_CNTL_SCRATCH5_V)<<(RTC_CNTL_SCRATCH5_S)) -#define RTC_CNTL_SCRATCH5_V 0xFFFFFFFF -#define RTC_CNTL_SCRATCH5_S 0 - -#define RTC_CNTL_STORE6_REG (DR_REG_RTCCNTL_BASE + 0xb8) -/* RTC_CNTL_SCRATCH6 : R/W ;bitpos:[31:0] ;default: 0 ; */ -/*description: 32-bit general purpose retention register*/ -#define RTC_CNTL_SCRATCH6 0xFFFFFFFF -#define RTC_CNTL_SCRATCH6_M ((RTC_CNTL_SCRATCH6_V)<<(RTC_CNTL_SCRATCH6_S)) -#define RTC_CNTL_SCRATCH6_V 0xFFFFFFFF -#define RTC_CNTL_SCRATCH6_S 0 - -#define RTC_CNTL_STORE7_REG (DR_REG_RTCCNTL_BASE + 0xbc) -/* RTC_CNTL_SCRATCH7 : R/W ;bitpos:[31:0] ;default: 0 ; */ -/*description: 32-bit general purpose retention register*/ -#define RTC_CNTL_SCRATCH7 0xFFFFFFFF -#define RTC_CNTL_SCRATCH7_M ((RTC_CNTL_SCRATCH7_V)<<(RTC_CNTL_SCRATCH7_S)) -#define RTC_CNTL_SCRATCH7_V 0xFFFFFFFF -#define RTC_CNTL_SCRATCH7_S 0 - -#define RTC_CNTL_LOW_POWER_ST_REG (DR_REG_RTCCNTL_BASE + 0xc0) -/* RTC_CNTL_RDY_FOR_WAKEUP : R/0; bitpos:[19]; default: 0 */ -/*description: 1 if RTC controller is ready to execute WAKE instruction, 0 otherwise */ -#define RTC_CNTL_RDY_FOR_WAKEUP (BIT(19)) -#define RTC_CNTL_RDY_FOR_WAKEUP_M (BIT(19)) -#define RTC_CNTL_RDY_FOR_WAKEUP_V 0x1 -#define RTC_CNTL_RDY_FOR_WAKEUP_S 19 - -/* Compatibility definition */ -#define RTC_CNTL_DIAG0_REG RTC_CNTL_LOW_POWER_ST_REG -/* RTC_CNTL_LOW_POWER_DIAG0 : RO ;bitpos:[31:0] ;default: 0 ; */ -/*description: */ -#define RTC_CNTL_LOW_POWER_DIAG0 0xFFFFFFFF -#define RTC_CNTL_LOW_POWER_DIAG0_M ((RTC_CNTL_LOW_POWER_DIAG0_V)<<(RTC_CNTL_LOW_POWER_DIAG0_S)) -#define RTC_CNTL_LOW_POWER_DIAG0_V 0xFFFFFFFF -#define RTC_CNTL_LOW_POWER_DIAG0_S 0 - -#define RTC_CNTL_DIAG1_REG (DR_REG_RTCCNTL_BASE + 0xc4) -/* RTC_CNTL_LOW_POWER_DIAG1 : RO ;bitpos:[31:0] ;default: 0 ; */ -/*description: */ -#define RTC_CNTL_LOW_POWER_DIAG1 0xFFFFFFFF -#define RTC_CNTL_LOW_POWER_DIAG1_M ((RTC_CNTL_LOW_POWER_DIAG1_V)<<(RTC_CNTL_LOW_POWER_DIAG1_S)) -#define RTC_CNTL_LOW_POWER_DIAG1_V 0xFFFFFFFF -#define RTC_CNTL_LOW_POWER_DIAG1_S 0 - -#define RTC_CNTL_HOLD_FORCE_REG (DR_REG_RTCCNTL_BASE + 0xc8) -/* RTC_CNTL_X32N_HOLD_FORCE : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define RTC_CNTL_X32N_HOLD_FORCE (BIT(17)) -#define RTC_CNTL_X32N_HOLD_FORCE_M (BIT(17)) -#define RTC_CNTL_X32N_HOLD_FORCE_V 0x1 -#define RTC_CNTL_X32N_HOLD_FORCE_S 17 -/* RTC_CNTL_X32P_HOLD_FORCE : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define RTC_CNTL_X32P_HOLD_FORCE (BIT(16)) -#define RTC_CNTL_X32P_HOLD_FORCE_M (BIT(16)) -#define RTC_CNTL_X32P_HOLD_FORCE_V 0x1 -#define RTC_CNTL_X32P_HOLD_FORCE_S 16 -/* RTC_CNTL_TOUCH_PAD7_HOLD_FORCE : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define RTC_CNTL_TOUCH_PAD7_HOLD_FORCE (BIT(15)) -#define RTC_CNTL_TOUCH_PAD7_HOLD_FORCE_M (BIT(15)) -#define RTC_CNTL_TOUCH_PAD7_HOLD_FORCE_V 0x1 -#define RTC_CNTL_TOUCH_PAD7_HOLD_FORCE_S 15 -/* RTC_CNTL_TOUCH_PAD6_HOLD_FORCE : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define RTC_CNTL_TOUCH_PAD6_HOLD_FORCE (BIT(14)) -#define RTC_CNTL_TOUCH_PAD6_HOLD_FORCE_M (BIT(14)) -#define RTC_CNTL_TOUCH_PAD6_HOLD_FORCE_V 0x1 -#define RTC_CNTL_TOUCH_PAD6_HOLD_FORCE_S 14 -/* RTC_CNTL_TOUCH_PAD5_HOLD_FORCE : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define RTC_CNTL_TOUCH_PAD5_HOLD_FORCE (BIT(13)) -#define RTC_CNTL_TOUCH_PAD5_HOLD_FORCE_M (BIT(13)) -#define RTC_CNTL_TOUCH_PAD5_HOLD_FORCE_V 0x1 -#define RTC_CNTL_TOUCH_PAD5_HOLD_FORCE_S 13 -/* RTC_CNTL_TOUCH_PAD4_HOLD_FORCE : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define RTC_CNTL_TOUCH_PAD4_HOLD_FORCE (BIT(12)) -#define RTC_CNTL_TOUCH_PAD4_HOLD_FORCE_M (BIT(12)) -#define RTC_CNTL_TOUCH_PAD4_HOLD_FORCE_V 0x1 -#define RTC_CNTL_TOUCH_PAD4_HOLD_FORCE_S 12 -/* RTC_CNTL_TOUCH_PAD3_HOLD_FORCE : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define RTC_CNTL_TOUCH_PAD3_HOLD_FORCE (BIT(11)) -#define RTC_CNTL_TOUCH_PAD3_HOLD_FORCE_M (BIT(11)) -#define RTC_CNTL_TOUCH_PAD3_HOLD_FORCE_V 0x1 -#define RTC_CNTL_TOUCH_PAD3_HOLD_FORCE_S 11 -/* RTC_CNTL_TOUCH_PAD2_HOLD_FORCE : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define RTC_CNTL_TOUCH_PAD2_HOLD_FORCE (BIT(10)) -#define RTC_CNTL_TOUCH_PAD2_HOLD_FORCE_M (BIT(10)) -#define RTC_CNTL_TOUCH_PAD2_HOLD_FORCE_V 0x1 -#define RTC_CNTL_TOUCH_PAD2_HOLD_FORCE_S 10 -/* RTC_CNTL_TOUCH_PAD1_HOLD_FORCE : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define RTC_CNTL_TOUCH_PAD1_HOLD_FORCE (BIT(9)) -#define RTC_CNTL_TOUCH_PAD1_HOLD_FORCE_M (BIT(9)) -#define RTC_CNTL_TOUCH_PAD1_HOLD_FORCE_V 0x1 -#define RTC_CNTL_TOUCH_PAD1_HOLD_FORCE_S 9 -/* RTC_CNTL_TOUCH_PAD0_HOLD_FORCE : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define RTC_CNTL_TOUCH_PAD0_HOLD_FORCE (BIT(8)) -#define RTC_CNTL_TOUCH_PAD0_HOLD_FORCE_M (BIT(8)) -#define RTC_CNTL_TOUCH_PAD0_HOLD_FORCE_V 0x1 -#define RTC_CNTL_TOUCH_PAD0_HOLD_FORCE_S 8 -/* RTC_CNTL_SENSE4_HOLD_FORCE : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define RTC_CNTL_SENSE4_HOLD_FORCE (BIT(7)) -#define RTC_CNTL_SENSE4_HOLD_FORCE_M (BIT(7)) -#define RTC_CNTL_SENSE4_HOLD_FORCE_V 0x1 -#define RTC_CNTL_SENSE4_HOLD_FORCE_S 7 -/* RTC_CNTL_SENSE3_HOLD_FORCE : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define RTC_CNTL_SENSE3_HOLD_FORCE (BIT(6)) -#define RTC_CNTL_SENSE3_HOLD_FORCE_M (BIT(6)) -#define RTC_CNTL_SENSE3_HOLD_FORCE_V 0x1 -#define RTC_CNTL_SENSE3_HOLD_FORCE_S 6 -/* RTC_CNTL_SENSE2_HOLD_FORCE : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define RTC_CNTL_SENSE2_HOLD_FORCE (BIT(5)) -#define RTC_CNTL_SENSE2_HOLD_FORCE_M (BIT(5)) -#define RTC_CNTL_SENSE2_HOLD_FORCE_V 0x1 -#define RTC_CNTL_SENSE2_HOLD_FORCE_S 5 -/* RTC_CNTL_SENSE1_HOLD_FORCE : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define RTC_CNTL_SENSE1_HOLD_FORCE (BIT(4)) -#define RTC_CNTL_SENSE1_HOLD_FORCE_M (BIT(4)) -#define RTC_CNTL_SENSE1_HOLD_FORCE_V 0x1 -#define RTC_CNTL_SENSE1_HOLD_FORCE_S 4 -/* RTC_CNTL_PDAC2_HOLD_FORCE : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define RTC_CNTL_PDAC2_HOLD_FORCE (BIT(3)) -#define RTC_CNTL_PDAC2_HOLD_FORCE_M (BIT(3)) -#define RTC_CNTL_PDAC2_HOLD_FORCE_V 0x1 -#define RTC_CNTL_PDAC2_HOLD_FORCE_S 3 -/* RTC_CNTL_PDAC1_HOLD_FORCE : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define RTC_CNTL_PDAC1_HOLD_FORCE (BIT(2)) -#define RTC_CNTL_PDAC1_HOLD_FORCE_M (BIT(2)) -#define RTC_CNTL_PDAC1_HOLD_FORCE_V 0x1 -#define RTC_CNTL_PDAC1_HOLD_FORCE_S 2 -/* RTC_CNTL_ADC2_HOLD_FORCE : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define RTC_CNTL_ADC2_HOLD_FORCE (BIT(1)) -#define RTC_CNTL_ADC2_HOLD_FORCE_M (BIT(1)) -#define RTC_CNTL_ADC2_HOLD_FORCE_V 0x1 -#define RTC_CNTL_ADC2_HOLD_FORCE_S 1 -/* RTC_CNTL_ADC1_HOLD_FORCE : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define RTC_CNTL_ADC1_HOLD_FORCE (BIT(0)) -#define RTC_CNTL_ADC1_HOLD_FORCE_M (BIT(0)) -#define RTC_CNTL_ADC1_HOLD_FORCE_V 0x1 -#define RTC_CNTL_ADC1_HOLD_FORCE_S 0 - -#define RTC_CNTL_EXT_WAKEUP1_REG (DR_REG_RTCCNTL_BASE + 0xcc) -/* RTC_CNTL_EXT_WAKEUP1_STATUS_CLR : WO ;bitpos:[18] ;default: 1'd0 ; */ -/*description: clear ext wakeup1 status*/ -#define RTC_CNTL_EXT_WAKEUP1_STATUS_CLR (BIT(18)) -#define RTC_CNTL_EXT_WAKEUP1_STATUS_CLR_M (BIT(18)) -#define RTC_CNTL_EXT_WAKEUP1_STATUS_CLR_V 0x1 -#define RTC_CNTL_EXT_WAKEUP1_STATUS_CLR_S 18 -/* RTC_CNTL_EXT_WAKEUP1_SEL : R/W ;bitpos:[17:0] ;default: 18'd0 ; */ -/*description: Bitmap to select RTC pads for ext wakeup1*/ -#define RTC_CNTL_EXT_WAKEUP1_SEL 0x0003FFFF -#define RTC_CNTL_EXT_WAKEUP1_SEL_M ((RTC_CNTL_EXT_WAKEUP1_SEL_V)<<(RTC_CNTL_EXT_WAKEUP1_SEL_S)) -#define RTC_CNTL_EXT_WAKEUP1_SEL_V 0x3FFFF -#define RTC_CNTL_EXT_WAKEUP1_SEL_S 0 - -#define RTC_CNTL_EXT_WAKEUP1_STATUS_REG (DR_REG_RTCCNTL_BASE + 0xd0) -/* RTC_CNTL_EXT_WAKEUP1_STATUS : RO ;bitpos:[17:0] ;default: 18'd0 ; */ -/*description: ext wakeup1 status*/ -#define RTC_CNTL_EXT_WAKEUP1_STATUS 0x0003FFFF -#define RTC_CNTL_EXT_WAKEUP1_STATUS_M ((RTC_CNTL_EXT_WAKEUP1_STATUS_V)<<(RTC_CNTL_EXT_WAKEUP1_STATUS_S)) -#define RTC_CNTL_EXT_WAKEUP1_STATUS_V 0x3FFFF -#define RTC_CNTL_EXT_WAKEUP1_STATUS_S 0 - -#define RTC_CNTL_BROWN_OUT_REG (DR_REG_RTCCNTL_BASE + 0xd4) -/* RTC_CNTL_BROWN_OUT_DET : RO ;bitpos:[31] ;default: 1'b0 ; */ -/*description: brown out detect*/ -#define RTC_CNTL_BROWN_OUT_DET (BIT(31)) -#define RTC_CNTL_BROWN_OUT_DET_M (BIT(31)) -#define RTC_CNTL_BROWN_OUT_DET_V 0x1 -#define RTC_CNTL_BROWN_OUT_DET_S 31 -/* RTC_CNTL_BROWN_OUT_ENA : R/W ;bitpos:[30] ;default: 1'b0 ; */ -/*description: enable brown out*/ -#define RTC_CNTL_BROWN_OUT_ENA (BIT(30)) -#define RTC_CNTL_BROWN_OUT_ENA_M (BIT(30)) -#define RTC_CNTL_BROWN_OUT_ENA_V 0x1 -#define RTC_CNTL_BROWN_OUT_ENA_S 30 -/* RTC_CNTL_DBROWN_OUT_THRES : R/W ;bitpos:[29:27] ;default: 3'b010 ; */ -/*description: brown out threshold*/ -#define RTC_CNTL_DBROWN_OUT_THRES 0x00000007 -#define RTC_CNTL_DBROWN_OUT_THRES_M ((RTC_CNTL_DBROWN_OUT_THRES_V)<<(RTC_CNTL_DBROWN_OUT_THRES_S)) -#define RTC_CNTL_DBROWN_OUT_THRES_V 0x7 -#define RTC_CNTL_DBROWN_OUT_THRES_S 27 -/* RTC_CNTL_BROWN_OUT_RST_ENA : R/W ;bitpos:[26] ;default: 1'b0 ; */ -/*description: enable brown out reset*/ -#define RTC_CNTL_BROWN_OUT_RST_ENA (BIT(26)) -#define RTC_CNTL_BROWN_OUT_RST_ENA_M (BIT(26)) -#define RTC_CNTL_BROWN_OUT_RST_ENA_V 0x1 -#define RTC_CNTL_BROWN_OUT_RST_ENA_S 26 -/* RTC_CNTL_BROWN_OUT_RST_WAIT : R/W ;bitpos:[25:16] ;default: 10'h3ff ; */ -/*description: brown out reset wait cycles*/ -#define RTC_CNTL_BROWN_OUT_RST_WAIT 0x000003FF -#define RTC_CNTL_BROWN_OUT_RST_WAIT_M ((RTC_CNTL_BROWN_OUT_RST_WAIT_V)<<(RTC_CNTL_BROWN_OUT_RST_WAIT_S)) -#define RTC_CNTL_BROWN_OUT_RST_WAIT_V 0x3FF -#define RTC_CNTL_BROWN_OUT_RST_WAIT_S 16 -/* RTC_CNTL_BROWN_OUT_PD_RF_ENA : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: enable power down RF when brown out happens*/ -#define RTC_CNTL_BROWN_OUT_PD_RF_ENA (BIT(15)) -#define RTC_CNTL_BROWN_OUT_PD_RF_ENA_M (BIT(15)) -#define RTC_CNTL_BROWN_OUT_PD_RF_ENA_V 0x1 -#define RTC_CNTL_BROWN_OUT_PD_RF_ENA_S 15 -/* RTC_CNTL_BROWN_OUT_CLOSE_FLASH_ENA : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: enable close flash when brown out happens*/ -#define RTC_CNTL_BROWN_OUT_CLOSE_FLASH_ENA (BIT(14)) -#define RTC_CNTL_BROWN_OUT_CLOSE_FLASH_ENA_M (BIT(14)) -#define RTC_CNTL_BROWN_OUT_CLOSE_FLASH_ENA_V 0x1 -#define RTC_CNTL_BROWN_OUT_CLOSE_FLASH_ENA_S 14 - -#define RTC_MEM_CONF (DR_REG_RTCCNTL_BASE + 0x40 * 4) -#define RTC_MEM_CRC_FINISH (BIT(31)) -#define RTC_MEM_CRC_FINISH_M (BIT(31)) -#define RTC_MEM_CRC_FINISH_V 0x1 -#define RTC_MEM_CRC_FINISH_S (31) -#define RTC_MEM_CRC_LEN (0x7ff) -#define RTC_MEM_CRC_LEN_M ((RTC_MEM_CRC_LEN_V)<<(RTC_MEM_CRC_LEN_S)) -#define RTC_MEM_CRC_LEN_V (0x7ff) -#define RTC_MEM_CRC_LEN_S (20) -#define RTC_MEM_CRC_ADDR (0x7ff) -#define RTC_MEM_CRC_ADDR_M ((RTC_MEM_CRC_ADDR_V)<<(RTC_MEM_CRC_ADDR_S)) -#define RTC_MEM_CRC_ADDR_V (0x7ff) -#define RTC_MEM_CRC_ADDR_S (9) -#define RTC_MEM_CRC_START (BIT(8)) -#define RTC_MEM_CRC_START_M (BIT(8)) -#define RTC_MEM_CRC_START_V 0x1 -#define RTC_MEM_CRC_START_S (8) -#define RTC_MEM_PID_CONF (0xff) -#define RTC_MEM_PID_CONF_M (0xff) -#define RTC_MEM_PID_CONF_V (0xff) -#define RTC_MEM_PID_CONF_S (0) - -#define RTC_MEM_CRC_RES (DR_REG_RTCCNTL_BASE + 0x41 * 4) - -#define RTC_CNTL_DATE_REG (DR_REG_RTCCNTL_BASE + 0x13c) -/* RTC_CNTL_CNTL_DATE : R/W ;bitpos:[27:0] ;default: 28'h1604280 ; */ -/*description: */ -#define RTC_CNTL_CNTL_DATE 0x0FFFFFFF -#define RTC_CNTL_CNTL_DATE_M ((RTC_CNTL_CNTL_DATE_V)<<(RTC_CNTL_CNTL_DATE_S)) -#define RTC_CNTL_CNTL_DATE_V 0xFFFFFFF -#define RTC_CNTL_CNTL_DATE_S 0 -#define RTC_CNTL_RTC_CNTL_DATE_VERSION 0x1604280 - - - - -#endif /*_SOC_RTC_CNTL_REG_H_ */ - - diff --git a/tools/sdk/include/soc/soc/rtc_cntl_struct.h b/tools/sdk/include/soc/soc/rtc_cntl_struct.h deleted file mode 100644 index e203722608d..00000000000 --- a/tools/sdk/include/soc/soc/rtc_cntl_struct.h +++ /dev/null @@ -1,564 +0,0 @@ -// 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. -#ifndef _SOC_RTC_CNTL_STRUCT_H_ -#define _SOC_RTC_CNTL_STRUCT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef volatile struct { - union { - struct { - uint32_t sw_stall_appcpu_c0: 2; /*{reg_sw_stall_appcpu_c1[5:0] reg_sw_stall_appcpu_c0[1:0]} == 0x86 will stall APP CPU*/ - uint32_t sw_stall_procpu_c0: 2; /*{reg_sw_stall_procpu_c1[5:0] reg_sw_stall_procpu_c0[1:0]} == 0x86 will stall PRO CPU*/ - uint32_t sw_appcpu_rst: 1; /*APP CPU SW reset*/ - uint32_t sw_procpu_rst: 1; /*PRO CPU SW reset*/ - uint32_t bb_i2c_force_pd: 1; /*BB_I2C force power down*/ - uint32_t bb_i2c_force_pu: 1; /*BB_I2C force power up*/ - uint32_t bbpll_i2c_force_pd: 1; /*BB_PLL _I2C force power down*/ - uint32_t bbpll_i2c_force_pu: 1; /*BB_PLL_I2C force power up*/ - uint32_t bbpll_force_pd: 1; /*BB_PLL force power down*/ - uint32_t bbpll_force_pu: 1; /*BB_PLL force power up*/ - uint32_t xtl_force_pd: 1; /*crystall force power down*/ - uint32_t xtl_force_pu: 1; /*crystall force power up*/ - uint32_t bias_sleep_folw_8m: 1; /*BIAS_SLEEP follow CK8M*/ - uint32_t bias_force_sleep: 1; /*BIAS_SLEEP force sleep*/ - uint32_t bias_force_nosleep: 1; /*BIAS_SLEEP force no sleep*/ - uint32_t bias_i2c_folw_8m: 1; /*BIAS_I2C follow CK8M*/ - uint32_t bias_i2c_force_pd: 1; /*BIAS_I2C force power down*/ - uint32_t bias_i2c_force_pu: 1; /*BIAS_I2C force power up*/ - uint32_t bias_core_folw_8m: 1; /*BIAS_CORE follow CK8M*/ - uint32_t bias_core_force_pd: 1; /*BIAS_CORE force power down*/ - uint32_t bias_core_force_pu: 1; /*BIAS_CORE force power up*/ - uint32_t xtl_force_iso: 1; - uint32_t pll_force_iso: 1; - uint32_t analog_force_iso: 1; - uint32_t xtl_force_noiso: 1; - uint32_t pll_force_noiso: 1; - uint32_t analog_force_noiso: 1; - uint32_t dg_wrap_force_rst: 1; /*digital wrap force reset in deep sleep*/ - uint32_t dg_wrap_force_norst: 1; /*digital core force no reset in deep sleep*/ - uint32_t sw_sys_rst: 1; /*SW system reset*/ - }; - uint32_t val; - } options0; - uint32_t slp_timer0; /*RTC sleep timer low 32 bits*/ - union { - struct { - uint32_t slp_val_hi: 16; /*RTC sleep timer high 16 bits*/ - uint32_t main_timer_alarm_en: 1; /*timer alarm enable bit*/ - uint32_t reserved17: 15; - }; - uint32_t val; - } slp_timer1; - union { - struct { - uint32_t reserved0: 30; - uint32_t valid: 1; /*To indicate the register is updated*/ - uint32_t update: 1; /*Set 1: to update register with RTC timer*/ - }; - uint32_t val; - } time_update; - uint32_t time0; /*RTC timer low 32 bits*/ - union { - struct { - uint32_t time_hi:16; /*RTC timer high 16 bits*/ - uint32_t reserved16: 16; - }; - uint32_t val; - } time1; - union { - struct { - uint32_t reserved0: 20; - uint32_t touch_wakeup_force_en: 1; /*touch controller force wake up*/ - uint32_t ulp_cp_wakeup_force_en: 1; /*ULP-coprocessor force wake up*/ - uint32_t apb2rtc_bridge_sel: 1; /*1: APB to RTC using bridge 0: APB to RTC using sync*/ - uint32_t touch_slp_timer_en: 1; /*touch timer enable bit*/ - uint32_t ulp_cp_slp_timer_en: 1; /*ULP-coprocessor timer enable bit*/ - uint32_t reserved25: 3; - uint32_t sdio_active_ind: 1; /*SDIO active indication*/ - uint32_t slp_wakeup: 1; /*sleep wakeup bit*/ - uint32_t slp_reject: 1; /*sleep reject bit*/ - uint32_t sleep_en: 1; /*sleep enable bit*/ - }; - uint32_t val; - } state0; - union { - struct { - uint32_t cpu_stall_en: 1; /*CPU stall enable bit*/ - uint32_t cpu_stall_wait: 5; /*CPU stall wait cycles in fast_clk_rtc*/ - uint32_t ck8m_wait: 8; /*CK8M wait cycles in slow_clk_rtc*/ - uint32_t xtl_buf_wait: 10; /*XTAL wait cycles in slow_clk_rtc*/ - uint32_t pll_buf_wait: 8; /*PLL wait cycles in slow_clk_rtc*/ - }; - uint32_t val; - } timer1; - union { - struct { - uint32_t reserved0: 15; - uint32_t ulpcp_touch_start_wait: 9; /*wait cycles in slow_clk_rtc before ULP-coprocessor / touch controller start to work*/ - uint32_t min_time_ck8m_off: 8; /*minimal cycles in slow_clk_rtc for CK8M in power down state*/ - }; - uint32_t val; - } timer2; - union { - struct { - uint32_t wifi_wait_timer: 9; - uint32_t wifi_powerup_timer: 7; - uint32_t rom_ram_wait_timer: 9; - uint32_t rom_ram_powerup_timer: 7; - }; - uint32_t val; - } timer3; - union { - struct { - uint32_t rtc_wait_timer: 9; - uint32_t rtc_powerup_timer: 7; - uint32_t dg_wrap_wait_timer: 9; - uint32_t dg_wrap_powerup_timer: 7; - }; - uint32_t val; - } timer4; - union { - struct { - uint32_t ulp_cp_subtimer_prediv: 8; - uint32_t min_slp_val: 8; /*minimal sleep cycles in slow_clk_rtc*/ - uint32_t rtcmem_wait_timer: 9; - uint32_t rtcmem_powerup_timer: 7; - }; - uint32_t val; - } timer5; - union { - struct { - uint32_t reserved0: 23; - uint32_t plla_force_pd: 1; /*PLLA force power down*/ - uint32_t plla_force_pu: 1; /*PLLA force power up*/ - uint32_t bbpll_cal_slp_start: 1; /*start BBPLL calibration during sleep*/ - uint32_t pvtmon_pu: 1; /*1: PVTMON power up otherwise power down*/ - uint32_t txrf_i2c_pu: 1; /*1: TXRF_I2C power up otherwise power down*/ - uint32_t rfrx_pbus_pu: 1; /*1: RFRX_PBUS power up otherwise power down*/ - uint32_t reserved29: 1; - uint32_t ckgen_i2c_pu: 1; /*1: CKGEN_I2C power up otherwise power down*/ - uint32_t pll_i2c_pu: 1; /*1: PLL_I2C power up otherwise power down*/ - }; - uint32_t val; - } ana_conf; - union { - struct { - uint32_t reset_cause_procpu: 6; /*reset cause of PRO CPU*/ - uint32_t reset_cause_appcpu: 6; /*reset cause of APP CPU*/ - uint32_t appcpu_stat_vector_sel: 1; /*APP CPU state vector sel*/ - uint32_t procpu_stat_vector_sel: 1; /*PRO CPU state vector sel*/ - uint32_t reserved14: 18; - }; - uint32_t val; - } reset_state; - union { - struct { - uint32_t wakeup_cause: 11; /*wakeup cause*/ - uint32_t rtc_wakeup_ena: 11; /*wakeup enable bitmap*/ - uint32_t gpio_wakeup_filter: 1; /*enable filter for gpio wakeup event*/ - uint32_t reserved23: 9; - }; - uint32_t val; - } wakeup_state; - union { - struct { - uint32_t slp_wakeup: 1; /*enable sleep wakeup interrupt*/ - uint32_t slp_reject: 1; /*enable sleep reject interrupt*/ - uint32_t sdio_idle: 1; /*enable SDIO idle interrupt*/ - uint32_t rtc_wdt: 1; /*enable RTC WDT interrupt*/ - uint32_t rtc_time_valid: 1; /*enable RTC time valid interrupt*/ - uint32_t rtc_ulp_cp: 1; /*enable ULP-coprocessor interrupt*/ - uint32_t rtc_touch: 1; /*enable touch interrupt*/ - uint32_t rtc_brown_out: 1; /*enable brown out interrupt*/ - uint32_t rtc_main_timer: 1; /*enable RTC main timer interrupt*/ - uint32_t reserved9: 23; - }; - uint32_t val; - } int_ena; - union { - struct { - uint32_t slp_wakeup: 1; /*sleep wakeup interrupt raw*/ - uint32_t slp_reject: 1; /*sleep reject interrupt raw*/ - uint32_t sdio_idle: 1; /*SDIO idle interrupt raw*/ - uint32_t rtc_wdt: 1; /*RTC WDT interrupt raw*/ - uint32_t rtc_time_valid: 1; /*RTC time valid interrupt raw*/ - uint32_t rtc_ulp_cp: 1; /*ULP-coprocessor interrupt raw*/ - uint32_t rtc_touch: 1; /*touch interrupt raw*/ - uint32_t rtc_brown_out: 1; /*brown out interrupt raw*/ - uint32_t rtc_main_timer: 1; /*RTC main timer interrupt raw*/ - uint32_t reserved9: 23; - }; - uint32_t val; - } int_raw; - union { - struct { - uint32_t slp_wakeup: 1; /*sleep wakeup interrupt state*/ - uint32_t slp_reject: 1; /*sleep reject interrupt state*/ - uint32_t sdio_idle: 1; /*SDIO idle interrupt state*/ - uint32_t rtc_wdt: 1; /*RTC WDT interrupt state*/ - uint32_t rtc_time_valid: 1; /*RTC time valid interrupt state*/ - uint32_t rtc_sar: 1; /*ULP-coprocessor interrupt state*/ - uint32_t rtc_touch: 1; /*touch interrupt state*/ - uint32_t rtc_brown_out: 1; /*brown out interrupt state*/ - uint32_t rtc_main_timer: 1; /*RTC main timer interrupt state*/ - uint32_t reserved9: 23; - }; - uint32_t val; - } int_st; - union { - struct { - uint32_t slp_wakeup: 1; /*Clear sleep wakeup interrupt state*/ - uint32_t slp_reject: 1; /*Clear sleep reject interrupt state*/ - uint32_t sdio_idle: 1; /*Clear SDIO idle interrupt state*/ - uint32_t rtc_wdt: 1; /*Clear RTC WDT interrupt state*/ - uint32_t rtc_time_valid: 1; /*Clear RTC time valid interrupt state*/ - uint32_t rtc_sar: 1; /*Clear ULP-coprocessor interrupt state*/ - uint32_t rtc_touch: 1; /*Clear touch interrupt state*/ - uint32_t rtc_brown_out: 1; /*Clear brown out interrupt state*/ - uint32_t rtc_main_timer: 1; /*Clear RTC main timer interrupt state*/ - uint32_t reserved9: 23; - }; - uint32_t val; - } int_clr; - uint32_t rtc_store0; /*32-bit general purpose retention register*/ - uint32_t rtc_store1; /*32-bit general purpose retention register*/ - uint32_t rtc_store2; /*32-bit general purpose retention register*/ - uint32_t rtc_store3; /*32-bit general purpose retention register*/ - union { - struct { - uint32_t reserved0: 30; - uint32_t ctr_lv: 1; /*0: power down XTAL at high level 1: power down XTAL at low level*/ - uint32_t ctr_en: 1; /*enable control XTAL by external pads*/ - }; - uint32_t val; - } ext_xtl_conf; - union { - struct { - uint32_t reserved0: 30; - uint32_t wakeup0_lv: 1; /*0: external wakeup at low level 1: external wakeup at high level*/ - uint32_t wakeup1_lv: 1; /*0: external wakeup at low level 1: external wakeup at high level*/ - }; - uint32_t val; - } ext_wakeup_conf; - union { - struct { - uint32_t reserved0: 24; - uint32_t gpio_reject_en: 1; /*enable GPIO reject*/ - uint32_t sdio_reject_en: 1; /*enable SDIO reject*/ - uint32_t light_slp_reject_en: 1; /*enable reject for light sleep*/ - uint32_t deep_slp_reject_en: 1; /*enable reject for deep sleep*/ - uint32_t reject_cause: 4; /*sleep reject cause*/ - }; - uint32_t val; - } slp_reject_conf; - union { - struct { - uint32_t reserved0: 29; - uint32_t cpusel_conf: 1; /*CPU sel option*/ - uint32_t cpuperiod_sel: 2; /*CPU period sel*/ - }; - uint32_t val; - } cpu_period_conf; - union { - struct { - uint32_t reserved0: 22; - uint32_t sdio_act_dnum:10; - }; - uint32_t val; - } sdio_act_conf; - union { - struct { - uint32_t reserved0: 4; - uint32_t ck8m_div: 2; /*CK8M_D256_OUT divider. 00: div128 01: div256 10: div512 11: div1024.*/ - uint32_t enb_ck8m: 1; /*disable CK8M and CK8M_D256_OUT*/ - uint32_t enb_ck8m_div: 1; /*1: CK8M_D256_OUT is actually CK8M 0: CK8M_D256_OUT is CK8M divided by 256*/ - uint32_t dig_xtal32k_en: 1; /*enable CK_XTAL_32K for digital core (no relationship with RTC core)*/ - uint32_t dig_clk8m_d256_en: 1; /*enable CK8M_D256_OUT for digital core (no relationship with RTC core)*/ - uint32_t dig_clk8m_en: 1; /*enable CK8M for digital core (no relationship with RTC core)*/ - uint32_t ck8m_dfreq_force: 1; - uint32_t ck8m_div_sel: 3; /*divider = reg_ck8m_div_sel + 1*/ - uint32_t xtal_force_nogating: 1; /*XTAL force no gating during sleep*/ - uint32_t ck8m_force_nogating: 1; /*CK8M force no gating during sleep*/ - uint32_t ck8m_dfreq: 8; /*CK8M_DFREQ*/ - uint32_t ck8m_force_pd: 1; /*CK8M force power down*/ - uint32_t ck8m_force_pu: 1; /*CK8M force power up*/ - uint32_t soc_clk_sel: 2; /*SOC clock sel. 0: XTAL 1: PLL 2: CK8M 3: APLL*/ - uint32_t fast_clk_rtc_sel: 1; /*fast_clk_rtc sel. 0: XTAL div 4 1: CK8M*/ - uint32_t ana_clk_rtc_sel: 2; /*slow_clk_rtc sel. 0: SLOW_CK 1: CK_XTAL_32K 2: CK8M_D256_OUT*/ - }; - uint32_t val; - } clk_conf; - union { - struct { - uint32_t reserved0: 21; - uint32_t sdio_pd_en: 1; /*power down SDIO_REG in sleep. Only active when reg_sdio_force = 0*/ - uint32_t sdio_force: 1; /*1: use SW option to control SDIO_REG 0: use state machine*/ - uint32_t sdio_tieh: 1; /*SW option for SDIO_TIEH. Only active when reg_sdio_force = 1*/ - uint32_t reg1p8_ready: 1; /*read only register for REG1P8_READY*/ - uint32_t drefl_sdio: 2; /*SW option for DREFL_SDIO. Only active when reg_sdio_force = 1*/ - uint32_t drefm_sdio: 2; /*SW option for DREFM_SDIO. Only active when reg_sdio_force = 1*/ - uint32_t drefh_sdio: 2; /*SW option for DREFH_SDIO. Only active when reg_sdio_force = 1*/ - uint32_t xpd_sdio: 1; /*SW option for XPD_SDIO_REG. Only active when reg_sdio_force = 1*/ - }; - uint32_t val; - } sdio_conf; - union { - struct { - uint32_t reserved0: 24; - uint32_t dbg_atten: 2; /*DBG_ATTEN*/ - uint32_t enb_sck_xtal: 1; /*ENB_SCK_XTAL*/ - uint32_t inc_heartbeat_refresh: 1; /*INC_HEARTBEAT_REFRESH*/ - uint32_t dec_heartbeat_period: 1; /*DEC_HEARTBEAT_PERIOD*/ - uint32_t inc_heartbeat_period: 1; /*INC_HEARTBEAT_PERIOD*/ - uint32_t dec_heartbeat_width: 1; /*DEC_HEARTBEAT_WIDTH*/ - uint32_t rst_bias_i2c: 1; /*RST_BIAS_I2C*/ - }; - uint32_t val; - } bias_conf; - union { - struct { - uint32_t reserved0: 7; - uint32_t sck_dcap_force: 1; /*N/A*/ - uint32_t dig_dbias_slp: 3; /*DIG_REG_DBIAS during sleep*/ - uint32_t dig_dbias_wak: 3; /*DIG_REG_DBIAS during wakeup*/ - uint32_t sck_dcap: 8; /*SCK_DCAP*/ - uint32_t rtc_dbias_slp: 3; /*RTC_DBIAS during sleep*/ - uint32_t rtc_dbias_wak: 3; /*RTC_DBIAS during wakeup*/ - uint32_t rtc_dboost_force_pd: 1; /*RTC_DBOOST force power down*/ - uint32_t rtc_dboost_force_pu: 1; /*RTC_DBOOST force power up*/ - uint32_t rtc_force_pd: 1; /*RTC_REG force power down (for RTC_REG power down means decrease the voltage to 0.8v or lower )*/ - uint32_t rtc_force_pu: 1; /*RTC_REG force power up*/ - }; - uint32_t val; - } rtc; - union { - struct { - uint32_t fastmem_force_noiso: 1; /*Fast RTC memory force no ISO*/ - uint32_t fastmem_force_iso: 1; /*Fast RTC memory force ISO*/ - uint32_t slowmem_force_noiso: 1; /*RTC memory force no ISO*/ - uint32_t slowmem_force_iso: 1; /*RTC memory force ISO*/ - uint32_t rtc_force_iso: 1; /*rtc_peri force ISO*/ - uint32_t force_noiso: 1; /*rtc_peri force no ISO*/ - uint32_t fastmem_folw_cpu: 1; /*1: Fast RTC memory PD following CPU 0: fast RTC memory PD following RTC state machine*/ - uint32_t fastmem_force_lpd: 1; /*Fast RTC memory force PD*/ - uint32_t fastmem_force_lpu: 1; /*Fast RTC memory force no PD*/ - uint32_t slowmem_folw_cpu: 1; /*1: RTC memory PD following CPU 0: RTC memory PD following RTC state machine*/ - uint32_t slowmem_force_lpd: 1; /*RTC memory force PD*/ - uint32_t slowmem_force_lpu: 1; /*RTC memory force no PD*/ - uint32_t fastmem_force_pd: 1; /*Fast RTC memory force power down*/ - uint32_t fastmem_force_pu: 1; /*Fast RTC memory force power up*/ - uint32_t fastmem_pd_en: 1; /*enable power down fast RTC memory in sleep*/ - uint32_t slowmem_force_pd: 1; /*RTC memory force power down*/ - uint32_t slowmem_force_pu: 1; /*RTC memory force power up*/ - uint32_t slowmem_pd_en: 1; /*enable power down RTC memory in sleep*/ - uint32_t pwc_force_pd: 1; /*rtc_peri force power down*/ - uint32_t pwc_force_pu: 1; /*rtc_peri force power up*/ - uint32_t pd_en: 1; /*enable power down rtc_peri in sleep*/ - uint32_t reserved21: 11; - }; - uint32_t val; - } rtc_pwc; - union { - struct { - uint32_t reserved0: 3; - uint32_t lslp_mem_force_pd: 1; /*memories in digital core force PD in sleep*/ - uint32_t lslp_mem_force_pu: 1; /*memories in digital core force no PD in sleep*/ - uint32_t rom0_force_pd: 1; /*ROM force power down*/ - uint32_t rom0_force_pu: 1; /*ROM force power up*/ - uint32_t inter_ram0_force_pd: 1; /*internal SRAM 0 force power down*/ - uint32_t inter_ram0_force_pu: 1; /*internal SRAM 0 force power up*/ - uint32_t inter_ram1_force_pd: 1; /*internal SRAM 1 force power down*/ - uint32_t inter_ram1_force_pu: 1; /*internal SRAM 1 force power up*/ - uint32_t inter_ram2_force_pd: 1; /*internal SRAM 2 force power down*/ - uint32_t inter_ram2_force_pu: 1; /*internal SRAM 2 force power up*/ - uint32_t inter_ram3_force_pd: 1; /*internal SRAM 3 force power down*/ - uint32_t inter_ram3_force_pu: 1; /*internal SRAM 3 force power up*/ - uint32_t inter_ram4_force_pd: 1; /*internal SRAM 4 force power down*/ - uint32_t inter_ram4_force_pu: 1; /*internal SRAM 4 force power up*/ - uint32_t wifi_force_pd: 1; /*wifi force power down*/ - uint32_t wifi_force_pu: 1; /*wifi force power up*/ - uint32_t dg_wrap_force_pd: 1; /*digital core force power down*/ - uint32_t dg_wrap_force_pu: 1; /*digital core force power up*/ - uint32_t reserved21: 3; - uint32_t rom0_pd_en: 1; /*enable power down ROM in sleep*/ - uint32_t inter_ram0_pd_en: 1; /*enable power down internal SRAM 0 in sleep*/ - uint32_t inter_ram1_pd_en: 1; /*enable power down internal SRAM 1 in sleep*/ - uint32_t inter_ram2_pd_en: 1; /*enable power down internal SRAM 2 in sleep*/ - uint32_t inter_ram3_pd_en: 1; /*enable power down internal SRAM 3 in sleep*/ - uint32_t inter_ram4_pd_en: 1; /*enable power down internal SRAM 4 in sleep*/ - uint32_t wifi_pd_en: 1; /*enable power down wifi in sleep*/ - uint32_t dg_wrap_pd_en: 1; /*enable power down digital core in sleep*/ - }; - uint32_t val; - } dig_pwc; - union { - struct { - uint32_t reserved0: 7; - uint32_t dig_iso_force_off: 1; - uint32_t dig_iso_force_on: 1; - uint32_t dg_pad_autohold: 1; /*read only register to indicate digital pad auto-hold status*/ - uint32_t clr_dg_pad_autohold: 1; /*wtite only register to clear digital pad auto-hold*/ - uint32_t dg_pad_autohold_en: 1; /*digital pad enable auto-hold*/ - uint32_t dg_pad_force_noiso: 1; /*digital pad force no ISO*/ - uint32_t dg_pad_force_iso: 1; /*digital pad force ISO*/ - uint32_t dg_pad_force_unhold: 1; /*digital pad force un-hold*/ - uint32_t dg_pad_force_hold: 1; /*digital pad force hold*/ - uint32_t rom0_force_iso: 1; /*ROM force ISO*/ - uint32_t rom0_force_noiso: 1; /*ROM force no ISO*/ - uint32_t inter_ram0_force_iso: 1; /*internal SRAM 0 force ISO*/ - uint32_t inter_ram0_force_noiso: 1; /*internal SRAM 0 force no ISO*/ - uint32_t inter_ram1_force_iso: 1; /*internal SRAM 1 force ISO*/ - uint32_t inter_ram1_force_noiso: 1; /*internal SRAM 1 force no ISO*/ - uint32_t inter_ram2_force_iso: 1; /*internal SRAM 2 force ISO*/ - uint32_t inter_ram2_force_noiso: 1; /*internal SRAM 2 force no ISO*/ - uint32_t inter_ram3_force_iso: 1; /*internal SRAM 3 force ISO*/ - uint32_t inter_ram3_force_noiso: 1; /*internal SRAM 3 force no ISO*/ - uint32_t inter_ram4_force_iso: 1; /*internal SRAM 4 force ISO*/ - uint32_t inter_ram4_force_noiso: 1; /*internal SRAM 4 force no ISO*/ - uint32_t wifi_force_iso: 1; /*wifi force ISO*/ - uint32_t wifi_force_noiso: 1; /*wifi force no ISO*/ - uint32_t dg_wrap_force_iso: 1; /*digital core force ISO*/ - uint32_t dg_wrap_force_noiso: 1; /*digital core force no ISO*/ - }; - uint32_t val; - } dig_iso; - union { - struct { - uint32_t reserved0: 7; - uint32_t pause_in_slp: 1; /*pause WDT in sleep*/ - uint32_t appcpu_reset_en: 1; /*enable WDT reset APP CPU*/ - uint32_t procpu_reset_en: 1; /*enable WDT reset PRO CPU*/ - uint32_t flashboot_mod_en: 1; /*enable WDT in flash boot*/ - uint32_t sys_reset_length: 3; /*system reset counter length*/ - uint32_t cpu_reset_length: 3; /*CPU reset counter length*/ - uint32_t level_int_en: 1; /*N/A*/ - uint32_t edge_int_en: 1; /*N/A*/ - uint32_t stg3: 3; /*1: interrupt stage en 2: CPU reset stage en 3: system reset stage en 4: RTC reset stage en*/ - uint32_t stg2: 3; /*1: interrupt stage en 2: CPU reset stage en 3: system reset stage en 4: RTC reset stage en*/ - uint32_t stg1: 3; /*1: interrupt stage en 2: CPU reset stage en 3: system reset stage en 4: RTC reset stage en*/ - uint32_t stg0: 3; /*1: interrupt stage en 2: CPU reset stage en 3: system reset stage en 4: RTC reset stage en*/ - uint32_t en: 1; /*enable RTC WDT*/ - }; - uint32_t val; - } wdt_config0; - uint32_t wdt_config1; /**/ - uint32_t wdt_config2; /**/ - uint32_t wdt_config3; /**/ - uint32_t wdt_config4; /**/ - union { - struct { - uint32_t reserved0: 31; - uint32_t feed: 1; - }; - uint32_t val; - } wdt_feed; - uint32_t wdt_wprotect; /**/ - union { - struct { - uint32_t reserved0: 29; - uint32_t ent_rtc: 1; /*ENT_RTC*/ - uint32_t dtest_rtc: 2; /*DTEST_RTC*/ - }; - uint32_t val; - } test_mux; - union { - struct { - uint32_t reserved0: 20; - uint32_t appcpu_c1: 6; /*{reg_sw_stall_appcpu_c1[5:0] reg_sw_stall_appcpu_c0[1:0]} == 0x86 will stall APP CPU*/ - uint32_t procpu_c1: 6; /*{reg_sw_stall_procpu_c1[5:0] reg_sw_stall_procpu_c0[1:0]} == 0x86 will stall PRO CPU*/ - }; - uint32_t val; - } sw_cpu_stall; - uint32_t store4; /*32-bit general purpose retention register*/ - uint32_t store5; /*32-bit general purpose retention register*/ - uint32_t store6; /*32-bit general purpose retention register*/ - uint32_t store7; /*32-bit general purpose retention register*/ - uint32_t diag0; /**/ - uint32_t diag1; /**/ - union { - struct { - uint32_t adc1_hold_force: 1; - uint32_t adc2_hold_force: 1; - uint32_t pdac1_hold_force: 1; - uint32_t pdac2_hold_force: 1; - uint32_t sense1_hold_force: 1; - uint32_t sense2_hold_force: 1; - uint32_t sense3_hold_force: 1; - uint32_t sense4_hold_force: 1; - uint32_t touch_pad0_hold_force: 1; - uint32_t touch_pad1_hold_force: 1; - uint32_t touch_pad2_hold_force: 1; - uint32_t touch_pad3_hold_force: 1; - uint32_t touch_pad4_hold_force: 1; - uint32_t touch_pad5_hold_force: 1; - uint32_t touch_pad6_hold_force: 1; - uint32_t touch_pad7_hold_force: 1; - uint32_t x32p_hold_force: 1; - uint32_t x32n_hold_force: 1; - uint32_t reserved18: 14; - }; - uint32_t val; - } hold_force; - union { - struct { - uint32_t ext_wakeup1_sel: 18; /*Bitmap to select RTC pads for ext wakeup1*/ - uint32_t ext_wakeup1_status_clr: 1; /*clear ext wakeup1 status*/ - uint32_t reserved19: 13; - }; - uint32_t val; - } ext_wakeup1; - union { - struct { - uint32_t ext_wakeup1_status:18; /*ext wakeup1 status*/ - uint32_t reserved18: 14; - }; - uint32_t val; - } ext_wakeup1_status; - union { - struct { - uint32_t reserved0: 14; - uint32_t close_flash_ena: 1; /*enable close flash when brown out happens*/ - uint32_t pd_rf_ena: 1; /*enable power down RF when brown out happens*/ - uint32_t rst_wait: 10; /*brown out reset wait cycles*/ - uint32_t rst_ena: 1; /*enable brown out reset*/ - uint32_t thres: 3; /*brown out threshold*/ - uint32_t ena: 1; /*enable brown out*/ - uint32_t det: 1; /*brown out detect*/ - }; - uint32_t val; - } brown_out; - uint32_t reserved_39; - uint32_t reserved_3d; - uint32_t reserved_41; - uint32_t reserved_45; - uint32_t reserved_49; - uint32_t reserved_4d; - union { - struct { - uint32_t date: 28; - uint32_t reserved28: 4; - }; - uint32_t val; - } date; -} rtc_cntl_dev_t; -extern rtc_cntl_dev_t RTCCNTL; - -#ifdef __cplusplus -} -#endif - -#endif /* _SOC_RTC_CNTL_STRUCT_H_ */ diff --git a/tools/sdk/include/soc/soc/rtc_gpio_channel.h b/tools/sdk/include/soc/soc/rtc_gpio_channel.h deleted file mode 100644 index c5107a0fb1d..00000000000 --- a/tools/sdk/include/soc/soc/rtc_gpio_channel.h +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2010-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. - -#ifndef _SOC_RTC_GPIO_CHANNEL_H -#define _SOC_RTC_GPIO_CHANNEL_H - -//RTC GPIO channels -#define RTCIO_GPIO36_CHANNEL 0 //RTCIO_CHANNEL_0 -#define RTCIO_CHANNEL_0_GPIO_NUM 36 - -#define RTCIO_GPIO37_CHANNEL 1 //RTCIO_CHANNEL_1 -#define RTCIO_CHANNEL_1_GPIO_NUM 37 - -#define RTCIO_GPIO38_CHANNEL 2 //RTCIO_CHANNEL_2 -#define RTCIO_CHANNEL_2_GPIO_NUM 38 - -#define RTCIO_GPIO39_CHANNEL 3 //RTCIO_CHANNEL_3 -#define RTCIO_CHANNEL_3_GPIO_NUM 39 - -#define RTCIO_GPIO34_CHANNEL 4 //RTCIO_CHANNEL_4 -#define RTCIO_CHANNEL_4_GPIO_NUM 34 - -#define RTCIO_GPIO35_CHANNEL 5 //RTCIO_CHANNEL_5 -#define RTCIO_CHANNEL_5_GPIO_NUM 35 - -#define RTCIO_GPIO25_CHANNEL 6 //RTCIO_CHANNEL_6 -#define RTCIO_CHANNEL_6_GPIO_NUM 25 - -#define RTCIO_GPIO26_CHANNEL 7 //RTCIO_CHANNEL_7 -#define RTCIO_CHANNEL_7_GPIO_NUM 26 - -#define RTCIO_GPIO33_CHANNEL 8 //RTCIO_CHANNEL_8 -#define RTCIO_CHANNEL_8_GPIO_NUM 33 - -#define RTCIO_GPIO32_CHANNEL 9 //RTCIO_CHANNEL_9 -#define RTCIO_CHANNEL_9_GPIO_NUM 32 - -#define RTCIO_GPIO4_CHANNEL 10 //RTCIO_CHANNEL_10 -#define RTCIO_CHANNEL_10_GPIO_NUM 4 - -#define RTCIO_GPIO0_CHANNEL 11 //RTCIO_CHANNEL_11 -#define RTCIO_CHANNEL_11_GPIO_NUM 0 - -#define RTCIO_GPIO2_CHANNEL 12 //RTCIO_CHANNEL_12 -#define RTCIO_CHANNEL_12_GPIO_NUM 2 - -#define RTCIO_GPIO15_CHANNEL 13 //RTCIO_CHANNEL_13 -#define RTCIO_CHANNEL_13_GPIO_NUM 15 - -#define RTCIO_GPIO13_CHANNEL 14 //RTCIO_CHANNEL_14 -#define RTCIO_CHANNEL_14_GPIO_NUM 13 - -#define RTCIO_GPIO12_CHANNEL 15 //RTCIO_CHANNEL_15 -#define RTCIO_CHANNEL_15_GPIO_NUM 12 - -#define RTCIO_GPIO14_CHANNEL 16 //RTCIO_CHANNEL_16 -#define RTCIO_CHANNEL_16_GPIO_NUM 14 - -#define RTCIO_GPIO27_CHANNEL 17 //RTCIO_CHANNEL_17 -#define RTCIO_CHANNEL_17_GPIO_NUM 27 - -#endif diff --git a/tools/sdk/include/soc/soc/rtc_i2c_reg.h b/tools/sdk/include/soc/soc/rtc_i2c_reg.h deleted file mode 100644 index be7b64c6b1c..00000000000 --- a/tools/sdk/include/soc/soc/rtc_i2c_reg.h +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright 2016-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. - -#pragma once - -#include "soc.h" - -/** - * This file lists peripheral registers of an I2C controller which is part of the RTC. - * ULP coprocessor uses this controller to implement I2C_RD and I2C_WR instructions. - * - * Part of the functionality of this controller (such as slave mode, and multi-byte - * transfers) is not wired to the ULP, and is such, is not available to the - * ULP programs. - */ - -#define RTC_I2C_SCL_LOW_PERIOD_REG (DR_REG_RTC_I2C_BASE + 0x000) -/* RTC_I2C_SCL_LOW_PERIOD : R/W ;bitpos:[18:0] ;default: 19'b0 ; */ -/*description: number of cycles that scl == 0 */ -#define RTC_I2C_SCL_LOW_PERIOD 0x1FFFFFF -#define RTC_I2C_SCL_LOW_PERIOD_M ((RTC_I2C_SCL_LOW_PERIOD_V)<<(RTC_I2C_SCL_LOW_PERIOD_S)) -#define RTC_I2C_SCL_LOW_PERIOD_V 0x1FFFFFF -#define RTC_I2C_SCL_LOW_PERIOD_S 0 - -#define RTC_I2C_CTRL_REG (DR_REG_RTC_I2C_BASE + 0x004) -/* RTC_I2C_RX_LSB_FIRST : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: Send LSB first */ -#define RTC_I2C_RX_LSB_FIRST BIT(7) -#define RTC_I2C_RX_LSB_FIRST_M BIT(7) -#define RTC_I2C_RX_LSB_FIRST_V (1) -#define RTC_I2C_RX_LSB_FIRST_S (7) -/* RTC_I2C_TX_LSB_FIRST : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: Receive LSB first */ -#define RTC_I2C_TX_LSB_FIRST BIT(6) -#define RTC_I2C_TX_LSB_FIRST_M BIT(6) -#define RTC_I2C_TX_LSB_FIRST_V (1) -#define RTC_I2C_TX_LSB_FIRST_S (6) -/* RTC_I2C_TRANS_START : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: Force to generate start condition */ -#define RTC_I2C_TRANS_START BIT(5) -#define RTC_I2C_TRANS_START_M BIT(5) -#define RTC_I2C_TRANS_START_V (1) -#define RTC_I2C_TRANS_START_S (5) -/* RTC_I2C_MS_MODE : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: Master (1) or slave (0) */ -#define RTC_I2C_MS_MODE BIT(4) -#define RTC_I2C_MS_MODE_M BIT(4) -#define RTC_I2C_MS_MODE_V (1) -#define RTC_I2C_MS_MODE_S (4) -/* RTC_I2C_SCL_FORCE_OUT : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: SCL is push-pull (1) or open-drain (0) */ -#define RTC_I2C_SCL_FORCE_OUT BIT(1) -#define RTC_I2C_SCL_FORCE_OUT_M BIT(1) -#define RTC_I2C_SCL_FORCE_OUT_V (1) -#define RTC_I2C_SCL_FORCE_OUT_S (1) -/* RTC_I2C_SDA_FORCE_OUT : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: SDA is push-pull (1) or open-drain (0) */ -#define RTC_I2C_SDA_FORCE_OUT BIT(0) -#define RTC_I2C_SDA_FORCE_OUT_M BIT(0) -#define RTC_I2C_SDA_FORCE_OUT_V (1) -#define RTC_I2C_SDA_FORCE_OUT_S (0) - -#define RTC_I2C_DEBUG_STATUS_REG (DR_REG_RTC_I2C_BASE + 0x008) -/* RTC_I2C_SCL_STATE : R/W ;bitpos:[30:28] ;default: 3'b0 ; */ -/*description: state of SCL state machine */ -#define RTC_I2C_SCL_STATE 0x7 -#define RTC_I2C_SCL_STATE_M ((RTC_I2C_SCL_STATE_V)<<(RTC_I2C_SCL_STATE_S)) -#define RTC_I2C_SCL_STATE_V 0x7 -#define RTC_I2C_SCL_STATE_S 28 -/* RTC_I2C_MAIN_STATE : R/W ;bitpos:[27:25] ;default: 3'b0 ; */ -/*description: state of the main state machine */ -#define RTC_I2C_MAIN_STATE 0x7 -#define RTC_I2C_MAIN_STATE_M ((RTC_I2C_MAIN_STATE_V)<<(RTC_I2C_MAIN_STATE_S)) -#define RTC_I2C_MAIN_STATE_V 0x7 -#define RTC_I2C_MAIN_STATE_S 25 -/* RTC_I2C_BYTE_TRANS : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: 8 bit transmit done */ -#define RTC_I2C_BYTE_TRANS BIT(6) -#define RTC_I2C_BYTE_TRANS_M BIT(6) -#define RTC_I2C_BYTE_TRANS_V (1) -#define RTC_I2C_BYTE_TRANS_S (6) -/* RTC_I2C_SLAVE_ADDR_MATCH : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: When working as a slave, whether address was matched */ -#define RTC_I2C_SLAVE_ADDR_MATCH BIT(5) -#define RTC_I2C_SLAVE_ADDR_MATCH_M BIT(5) -#define RTC_I2C_SLAVE_ADDR_MATCH_V (1) -#define RTC_I2C_SLAVE_ADDR_MATCH_S (5) -/* RTC_I2C_BUS_BUSY : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: operation is in progress */ -#define RTC_I2C_BUS_BUSY BIT(4) -#define RTC_I2C_BUS_BUSY_M BIT(4) -#define RTC_I2C_BUS_BUSY_V (1) -#define RTC_I2C_BUS_BUSY_S (4) -/* RTC_I2C_ARB_LOST : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: When working as a master, lost control of I2C bus */ -#define RTC_I2C_ARB_LOST BIT(3) -#define RTC_I2C_ARB_LOST_M BIT(3) -#define RTC_I2C_ARB_LOST_V (1) -#define RTC_I2C_ARB_LOST_S (3) -/* RTC_I2C_TIMED_OUT : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: Transfer has timed out */ -#define RTC_I2C_TIMED_OUT BIT(2) -#define RTC_I2C_TIMED_OUT_M BIT(2) -#define RTC_I2C_TIMED_OUT_V (1) -#define RTC_I2C_TIMED_OUT_S (2) -/* RTC_I2C_SLAVE_RW : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: When working as a slave, the value of R/W bit received */ -#define RTC_I2C_SLAVE_RW BIT(1) -#define RTC_I2C_SLAVE_RW_M BIT(1) -#define RTC_I2C_SLAVE_RW_V (1) -#define RTC_I2C_SLAVE_RW_S (1) -/* RTC_I2C_ACK_VAL : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: The value of an acknowledge signal on the bus */ -#define RTC_I2C_ACK_VAL BIT(0) -#define RTC_I2C_ACK_VAL_M BIT(0) -#define RTC_I2C_ACK_VAL_V (1) -#define RTC_I2C_ACK_VAL_S (0) - -#define RTC_I2C_TIMEOUT_REG (DR_REG_RTC_I2C_BASE + 0x00c) -/* RTC_I2C_TIMEOUT : R/W ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: Maximum number of FAST_CLK cycles that the transmission can take */ -#define RTC_I2C_TIMEOUT 0xFFFFF -#define RTC_I2C_TIMEOUT_M ((RTC_I2C_TIMEOUT_V)<<(RTC_I2C_TIMEOUT_S)) -#define RTC_I2C_TIMEOUT_V 0xFFFFF -#define RTC_I2C_TIMEOUT_S 0 - -#define RTC_I2C_SLAVE_ADDR_REG (DR_REG_RTC_I2C_BASE + 0x010) -/* RTC_I2C_SLAVE_ADDR_10BIT : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: Set if local slave address is 10-bit */ -#define RTC_I2C_SLAVE_ADDR_10BIT BIT(31) -#define RTC_I2C_SLAVE_ADDR_10BIT_M BIT(31) -#define RTC_I2C_SLAVE_ADDR_10BIT_V (1) -#define RTC_I2C_SLAVE_ADDR_10BIT_S (31) -/* RTC_I2C_SLAVE_ADDR : R/W ;bitpos:[14:0] ;default: 15'b0 ; */ -/*description: local slave address */ -#define RTC_I2C_SLAVE_ADDR 0x7FFF -#define RTC_I2C_SLAVE_ADDR_M ((RTC_I2C_SLAVE_ADDR_V)<<(RTC_I2C_SLAVE_ADDR_S)) -#define RTC_I2C_SLAVE_ADDR_V 0x7FFF -#define RTC_I2C_SLAVE_ADDR_S 0 - -/* Result of last read operation. Not used directly as the data will be - * returned to the ULP. Listed for debugging purposes. - */ -#define RTC_I2C_DATA_REG (DR_REG_RTC_I2C_BASE + 0x01c) - -/* Interrupt registers; since the interrupt from RTC_I2C is not connected, - * these registers are only listed for debugging purposes. - */ - -/* Interrupt raw status register */ -#define RTC_I2C_INT_RAW_REG (DR_REG_RTC_I2C_BASE + 0x020) -/* RTC_I2C_TIME_OUT_INT_RAW : R/O ;bitpos:[7] ;default: 1'b0 ; */ -/*description: time out interrupt raw status */ -#define RTC_I2C_TIME_OUT_INT_RAW BIT(7) -#define RTC_I2C_TIME_OUT_INT_RAW_M BIT(7) -#define RTC_I2C_TIME_OUT_INT_RAW_V (1) -#define RTC_I2C_TIME_OUT_INT_RAW_S (7) -/* RTC_I2C_TRANS_COMPLETE_INT_RAW : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: Stop condition has been detected interrupt raw status */ -#define RTC_I2C_TRANS_COMPLETE_INT_RAW BIT(6) -#define RTC_I2C_TRANS_COMPLETE_INT_RAW_M BIT(6) -#define RTC_I2C_TRANS_COMPLETE_INT_RAW_V (1) -#define RTC_I2C_TRANS_COMPLETE_INT_RAW_S (6) -/* RTC_I2C_MASTER_TRANS_COMPLETE_INT_RAW : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define RTC_I2C_MASTER_TRANS_COMPLETE_INT_RAW BIT(5) -#define RTC_I2C_MASTER_TRANS_COMPLETE_INT_RAW_M BIT(5) -#define RTC_I2C_MASTER_TRANS_COMPLETE_INT_RAW_V (1) -#define RTC_I2C_MASTER_TRANS_COMPLETE_INT_RAW_S (5) -/* RTC_I2C_ARBITRATION_LOST_INT_RAW : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: Master lost arbitration */ -#define RTC_I2C_ARBITRATION_LOST_INT_RAW BIT(4) -#define RTC_I2C_ARBITRATION_LOST_INT_RAW_M BIT(4) -#define RTC_I2C_ARBITRATION_LOST_INT_RAW_V (1) -#define RTC_I2C_ARBITRATION_LOST_INT_RAW_S (4) -/* RTC_I2C_SLAVE_TRANS_COMPLETE_INT_RAW : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: Slave accepted 1 byte and address matched */ -#define RTC_I2C_SLAVE_TRANS_COMPLETE_INT_RAW BIT(3) -#define RTC_I2C_SLAVE_TRANS_COMPLETE_INT_RAW_M BIT(3) -#define RTC_I2C_SLAVE_TRANS_COMPLETE_INT_RAW_V (1) -#define RTC_I2C_SLAVE_TRANS_COMPLETE_INT_RAW_S (3) - -/* Interrupt clear register */ -#define RTC_I2C_INT_CLR_REG (DR_REG_RTC_I2C_BASE + 0x024) -/* RTC_I2C_TIME_OUT_INT_CLR : W/O ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define RTC_I2C_TIME_OUT_INT_CLR BIT(8) -#define RTC_I2C_TIME_OUT_INT_CLR_M BIT(8) -#define RTC_I2C_TIME_OUT_INT_CLR_V (1) -#define RTC_I2C_TIME_OUT_INT_CLR_S (8) -/* RTC_I2C_TRANS_COMPLETE_INT_CLR : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define RTC_I2C_TRANS_COMPLETE_INT_CLR BIT(7) -#define RTC_I2C_TRANS_COMPLETE_INT_CLR_M BIT(7) -#define RTC_I2C_TRANS_COMPLETE_INT_CLR_V (1) -#define RTC_I2C_TRANS_COMPLETE_INT_CLR_S (7) -/* RTC_I2C_MASTER_TRANS_COMPLETE_INT_CLR : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define RTC_I2C_MASTER_TRANS_COMPLETE_INT_CLR BIT(6) -#define RTC_I2C_MASTER_TRANS_COMPLETE_INT_CLR_M BIT(6) -#define RTC_I2C_MASTER_TRANS_COMPLETE_INT_CLR_V (1) -#define RTC_I2C_MASTER_TRANS_COMPLETE_INT_CLR_S (6) -/* RTC_I2C_ARBITRATION_LOST_INT_CLR : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define RTC_I2C_ARBITRATION_LOST_INT_CLR BIT(5) -#define RTC_I2C_ARBITRATION_LOST_INT_CLR_M BIT(5) -#define RTC_I2C_ARBITRATION_LOST_INT_CLR_V (1) -#define RTC_I2C_ARBITRATION_LOST_INT_CLR_S (5) -/* RTC_I2C_SLAVE_TRANS_COMPLETE_INT_CLR : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define RTC_I2C_SLAVE_TRANS_COMPLETE_INT_CLR BIT(4) -#define RTC_I2C_SLAVE_TRANS_COMPLETE_INT_CLR_M BIT(4) -#define RTC_I2C_SLAVE_TRANS_COMPLETE_INT_CLR_V (1) -#define RTC_I2C_SLAVE_TRANS_COMPLETE_INT_CLR_S (4) - -/* Interrupt enable register. - * Bit definitions are not given here, because interrupt functionality - * of RTC_I2C is not used. - */ -#define RTC_I2C_INT_EN_REG (DR_REG_RTC_I2C_BASE + 0x028) - -/* Masked interrupt status register. - * Bit definitions are not given here, because interrupt functionality - * of RTC_I2C is not used. - */ -#define RTC_I2C_INT_ST_REG (DR_REG_RTC_I2C_BASE + 0x02c) - -#define RTC_I2C_SDA_DUTY_REG (DR_REG_RTC_I2C_BASE + 0x030) -/* RTC_I2C_SDA_DUTY : R/W ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: Number of FAST_CLK cycles SDA will switch after falling edge of SCL */ -#define RTC_I2C_SDA_DUTY 0xFFFFF -#define RTC_I2C_SDA_DUTY_M ((RTC_I2C_SDA_DUTY_V)<<(RTC_I2C_SDA_DUTY_S)) -#define RTC_I2C_SDA_DUTY_V 0xFFFFF -#define RTC_I2C_SDA_DUTY_S 0 - -#define RTC_I2C_SCL_HIGH_PERIOD_REG (DR_REG_RTC_I2C_BASE + 0x038) -/* RTC_I2C_SCL_HIGH_PERIOD : R/W ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: Number of FAST_CLK cycles for SCL to be high */ -#define RTC_I2C_SCL_HIGH_PERIOD 0xFFFFF -#define RTC_I2C_SCL_HIGH_PERIOD_M ((RTC_I2C_SCL_HIGH_PERIOD_V)<<(RTC_I2C_SCL_HIGH_PERIOD_S)) -#define RTC_I2C_SCL_HIGH_PERIOD_V 0xFFFFF -#define RTC_I2C_SCL_HIGH_PERIOD_S 0 - -#define RTC_I2C_SCL_START_PERIOD_REG (DR_REG_RTC_I2C_BASE + 0x040) -/* RTC_I2C_SCL_START_PERIOD : R/W ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: Number of FAST_CLK cycles to wait before generating start condition */ -#define RTC_I2C_SCL_START_PERIOD 0xFFFFF -#define RTC_I2C_SCL_START_PERIOD_M ((RTC_I2C_SCL_START_PERIOD_V)<<(RTC_I2C_SCL_START_PERIOD_S)) -#define RTC_I2C_SCL_START_PERIOD_V 0xFFFFF -#define RTC_I2C_SCL_START_PERIOD_S 0 - -#define RTC_I2C_SCL_STOP_PERIOD_REG (DR_REG_RTC_I2C_BASE + 0x044) -/* RTC_I2C_SCL_STOP_PERIOD : R/W ;bitpos:[19:0] ;default: 20'b0 ; */ -/*description: Number of FAST_CLK cycles to wait before generating stop condition */ -#define RTC_I2C_SCL_STOP_PERIOD 0xFFFFF -#define RTC_I2C_SCL_STOP_PERIOD_M ((RTC_I2C_SCL_STOP_PERIOD_V)<<(RTC_I2C_SCL_STOP_PERIOD_S)) -#define RTC_I2C_SCL_STOP_PERIOD_V 0xFFFFF -#define RTC_I2C_SCL_STOP_PERIOD_S 0 - -/* A block of 16 RTC_I2C_CMD registers which describe I2C operation to be - * performed. Unused when ULP is controlling RTC_I2C. - */ -#define RTC_I2C_CMD_REG_COUNT 16 -#define RTC_I2C_CMD_REG(i) (DR_REG_RTC_I2C_BASE + 0x048 + (i) * 4) -/* RTC_I2C_CMD_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: Bit is set by HW when command is done */ -#define RTC_I2C_CMD_DONE BIT(31) -#define RTC_I2C_CMD_DONE_M BIT(31) -#define RTC_I2C_CMD_DONE_V (1) -#define RTC_I2C_CMD_DONE_S (31) -/* RTC_I2C_VAL : R/W ;bitpos:[13:0] ;default: 14'b0 ; */ -/*description: Command content */ -#define RTC_I2C_VAL 0 -#define RTC_I2C_VAL_M ((RTC_I2C_VAL_V)<<(RTC_I2C_VAL_S)) -#define RTC_I2C_VAL_V 0x3FFF -#define RTC_I2C_VAL_S 0 - diff --git a/tools/sdk/include/soc/soc/rtc_io_reg.h b/tools/sdk/include/soc/soc/rtc_io_reg.h deleted file mode 100644 index 5a3ce10d422..00000000000 --- a/tools/sdk/include/soc/soc/rtc_io_reg.h +++ /dev/null @@ -1,1954 +0,0 @@ -// 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. -#ifndef _SOC_RTC_IO_REG_H_ -#define _SOC_RTC_IO_REG_H_ - - -#include "soc.h" -#define RTC_GPIO_OUT_REG (DR_REG_RTCIO_BASE + 0x0) -/* RTC_GPIO_OUT_DATA : R/W ;bitpos:[31:14] ;default: 0 ; */ -/*description: GPIO0~17 output value*/ -#define RTC_GPIO_OUT_DATA 0x0003FFFF -#define RTC_GPIO_OUT_DATA_M ((RTC_GPIO_OUT_DATA_V)<<(RTC_GPIO_OUT_DATA_S)) -#define RTC_GPIO_OUT_DATA_V 0x3FFFF -#define RTC_GPIO_OUT_DATA_S 14 - -#define RTC_GPIO_OUT_W1TS_REG (DR_REG_RTCIO_BASE + 0x4) -/* RTC_GPIO_OUT_DATA_W1TS : WO ;bitpos:[31:14] ;default: 0 ; */ -/*description: GPIO0~17 output value write 1 to set*/ -#define RTC_GPIO_OUT_DATA_W1TS 0x0003FFFF -#define RTC_GPIO_OUT_DATA_W1TS_M ((RTC_GPIO_OUT_DATA_W1TS_V)<<(RTC_GPIO_OUT_DATA_W1TS_S)) -#define RTC_GPIO_OUT_DATA_W1TS_V 0x3FFFF -#define RTC_GPIO_OUT_DATA_W1TS_S 14 - -#define RTC_GPIO_OUT_W1TC_REG (DR_REG_RTCIO_BASE + 0x8) -/* RTC_GPIO_OUT_DATA_W1TC : WO ;bitpos:[31:14] ;default: 0 ; */ -/*description: GPIO0~17 output value write 1 to clear*/ -#define RTC_GPIO_OUT_DATA_W1TC 0x0003FFFF -#define RTC_GPIO_OUT_DATA_W1TC_M ((RTC_GPIO_OUT_DATA_W1TC_V)<<(RTC_GPIO_OUT_DATA_W1TC_S)) -#define RTC_GPIO_OUT_DATA_W1TC_V 0x3FFFF -#define RTC_GPIO_OUT_DATA_W1TC_S 14 - -#define RTC_GPIO_ENABLE_REG (DR_REG_RTCIO_BASE + 0xc) -/* RTC_GPIO_ENABLE : R/W ;bitpos:[31:14] ;default: 0 ; */ -/*description: GPIO0~17 output enable*/ -#define RTC_GPIO_ENABLE 0x0003FFFF -#define RTC_GPIO_ENABLE_M ((RTC_GPIO_ENABLE_V)<<(RTC_GPIO_ENABLE_S)) -#define RTC_GPIO_ENABLE_V 0x3FFFF -#define RTC_GPIO_ENABLE_S 14 - -#define RTC_GPIO_ENABLE_W1TS_REG (DR_REG_RTCIO_BASE + 0x10) -/* RTC_GPIO_ENABLE_W1TS : WO ;bitpos:[31:14] ;default: 0 ; */ -/*description: GPIO0~17 output enable write 1 to set*/ -#define RTC_GPIO_ENABLE_W1TS 0x0003FFFF -#define RTC_GPIO_ENABLE_W1TS_M ((RTC_GPIO_ENABLE_W1TS_V)<<(RTC_GPIO_ENABLE_W1TS_S)) -#define RTC_GPIO_ENABLE_W1TS_V 0x3FFFF -#define RTC_GPIO_ENABLE_W1TS_S 14 - -#define RTC_GPIO_ENABLE_W1TC_REG (DR_REG_RTCIO_BASE + 0x14) -/* RTC_GPIO_ENABLE_W1TC : WO ;bitpos:[31:14] ;default: 0 ; */ -/*description: GPIO0~17 output enable write 1 to clear*/ -#define RTC_GPIO_ENABLE_W1TC 0x0003FFFF -#define RTC_GPIO_ENABLE_W1TC_M ((RTC_GPIO_ENABLE_W1TC_V)<<(RTC_GPIO_ENABLE_W1TC_S)) -#define RTC_GPIO_ENABLE_W1TC_V 0x3FFFF -#define RTC_GPIO_ENABLE_W1TC_S 14 - -#define RTC_GPIO_STATUS_REG (DR_REG_RTCIO_BASE + 0x18) -/* RTC_GPIO_STATUS_INT : R/W ;bitpos:[31:14] ;default: 0 ; */ -/*description: GPIO0~17 interrupt status*/ -#define RTC_GPIO_STATUS_INT 0x0003FFFF -#define RTC_GPIO_STATUS_INT_M ((RTC_GPIO_STATUS_INT_V)<<(RTC_GPIO_STATUS_INT_S)) -#define RTC_GPIO_STATUS_INT_V 0x3FFFF -#define RTC_GPIO_STATUS_INT_S 14 - -#define RTC_GPIO_STATUS_W1TS_REG (DR_REG_RTCIO_BASE + 0x1c) -/* RTC_GPIO_STATUS_INT_W1TS : WO ;bitpos:[31:14] ;default: 0 ; */ -/*description: GPIO0~17 interrupt status write 1 to set*/ -#define RTC_GPIO_STATUS_INT_W1TS 0x0003FFFF -#define RTC_GPIO_STATUS_INT_W1TS_M ((RTC_GPIO_STATUS_INT_W1TS_V)<<(RTC_GPIO_STATUS_INT_W1TS_S)) -#define RTC_GPIO_STATUS_INT_W1TS_V 0x3FFFF -#define RTC_GPIO_STATUS_INT_W1TS_S 14 - -#define RTC_GPIO_STATUS_W1TC_REG (DR_REG_RTCIO_BASE + 0x20) -/* RTC_GPIO_STATUS_INT_W1TC : WO ;bitpos:[31:14] ;default: 0 ; */ -/*description: GPIO0~17 interrupt status write 1 to clear*/ -#define RTC_GPIO_STATUS_INT_W1TC 0x0003FFFF -#define RTC_GPIO_STATUS_INT_W1TC_M ((RTC_GPIO_STATUS_INT_W1TC_V)<<(RTC_GPIO_STATUS_INT_W1TC_S)) -#define RTC_GPIO_STATUS_INT_W1TC_V 0x3FFFF -#define RTC_GPIO_STATUS_INT_W1TC_S 14 - -#define RTC_GPIO_IN_REG (DR_REG_RTCIO_BASE + 0x24) -/* RTC_GPIO_IN_NEXT : RO ;bitpos:[31:14] ;default: ; */ -/*description: GPIO0~17 input value*/ -#define RTC_GPIO_IN_NEXT 0x0003FFFF -#define RTC_GPIO_IN_NEXT_M ((RTC_GPIO_IN_NEXT_V)<<(RTC_GPIO_IN_NEXT_S)) -#define RTC_GPIO_IN_NEXT_V 0x3FFFF -#define RTC_GPIO_IN_NEXT_S 14 - -#define RTC_GPIO_PIN0_REG (DR_REG_RTCIO_BASE + 0x28) -/* RTC_GPIO_PIN0_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: 0 ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define RTC_GPIO_PIN0_WAKEUP_ENABLE (BIT(10)) -#define RTC_GPIO_PIN0_WAKEUP_ENABLE_M (BIT(10)) -#define RTC_GPIO_PIN0_WAKEUP_ENABLE_V 0x1 -#define RTC_GPIO_PIN0_WAKEUP_ENABLE_S 10 -/* RTC_GPIO_PIN0_INT_TYPE : R/W ;bitpos:[9:7] ;default: 0 ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define RTC_GPIO_PIN0_INT_TYPE 0x00000007 -#define RTC_GPIO_PIN0_INT_TYPE_M ((RTC_GPIO_PIN0_INT_TYPE_V)<<(RTC_GPIO_PIN0_INT_TYPE_S)) -#define RTC_GPIO_PIN0_INT_TYPE_V 0x7 -#define RTC_GPIO_PIN0_INT_TYPE_S 7 -/* RTC_GPIO_PIN0_PAD_DRIVER : R/W ;bitpos:[2] ;default: 0 ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define RTC_GPIO_PIN0_PAD_DRIVER (BIT(2)) -#define RTC_GPIO_PIN0_PAD_DRIVER_M (BIT(2)) -#define RTC_GPIO_PIN0_PAD_DRIVER_V 0x1 -#define RTC_GPIO_PIN0_PAD_DRIVER_S 2 - -#define RTC_GPIO_PIN1_REG (DR_REG_RTCIO_BASE + 0x2c) -/* RTC_GPIO_PIN1_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: 0 ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define RTC_GPIO_PIN1_WAKEUP_ENABLE (BIT(10)) -#define RTC_GPIO_PIN1_WAKEUP_ENABLE_M (BIT(10)) -#define RTC_GPIO_PIN1_WAKEUP_ENABLE_V 0x1 -#define RTC_GPIO_PIN1_WAKEUP_ENABLE_S 10 -/* RTC_GPIO_PIN1_INT_TYPE : R/W ;bitpos:[9:7] ;default: 0 ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define RTC_GPIO_PIN1_INT_TYPE 0x00000007 -#define RTC_GPIO_PIN1_INT_TYPE_M ((RTC_GPIO_PIN1_INT_TYPE_V)<<(RTC_GPIO_PIN1_INT_TYPE_S)) -#define RTC_GPIO_PIN1_INT_TYPE_V 0x7 -#define RTC_GPIO_PIN1_INT_TYPE_S 7 -/* RTC_GPIO_PIN1_PAD_DRIVER : R/W ;bitpos:[2] ;default: 0 ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define RTC_GPIO_PIN1_PAD_DRIVER (BIT(2)) -#define RTC_GPIO_PIN1_PAD_DRIVER_M (BIT(2)) -#define RTC_GPIO_PIN1_PAD_DRIVER_V 0x1 -#define RTC_GPIO_PIN1_PAD_DRIVER_S 2 - -#define RTC_GPIO_PIN2_REG (DR_REG_RTCIO_BASE + 0x30) -/* RTC_GPIO_PIN2_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: 0 ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define RTC_GPIO_PIN2_WAKEUP_ENABLE (BIT(10)) -#define RTC_GPIO_PIN2_WAKEUP_ENABLE_M (BIT(10)) -#define RTC_GPIO_PIN2_WAKEUP_ENABLE_V 0x1 -#define RTC_GPIO_PIN2_WAKEUP_ENABLE_S 10 -/* RTC_GPIO_PIN2_INT_TYPE : R/W ;bitpos:[9:7] ;default: 0 ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define RTC_GPIO_PIN2_INT_TYPE 0x00000007 -#define RTC_GPIO_PIN2_INT_TYPE_M ((RTC_GPIO_PIN2_INT_TYPE_V)<<(RTC_GPIO_PIN2_INT_TYPE_S)) -#define RTC_GPIO_PIN2_INT_TYPE_V 0x7 -#define RTC_GPIO_PIN2_INT_TYPE_S 7 -/* RTC_GPIO_PIN2_PAD_DRIVER : R/W ;bitpos:[2] ;default: 0 ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define RTC_GPIO_PIN2_PAD_DRIVER (BIT(2)) -#define RTC_GPIO_PIN2_PAD_DRIVER_M (BIT(2)) -#define RTC_GPIO_PIN2_PAD_DRIVER_V 0x1 -#define RTC_GPIO_PIN2_PAD_DRIVER_S 2 - -#define RTC_GPIO_PIN3_REG (DR_REG_RTCIO_BASE + 0x34) -/* RTC_GPIO_PIN3_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: 0 ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define RTC_GPIO_PIN3_WAKEUP_ENABLE (BIT(10)) -#define RTC_GPIO_PIN3_WAKEUP_ENABLE_M (BIT(10)) -#define RTC_GPIO_PIN3_WAKEUP_ENABLE_V 0x1 -#define RTC_GPIO_PIN3_WAKEUP_ENABLE_S 10 -/* RTC_GPIO_PIN3_INT_TYPE : R/W ;bitpos:[9:7] ;default: 0 ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define RTC_GPIO_PIN3_INT_TYPE 0x00000007 -#define RTC_GPIO_PIN3_INT_TYPE_M ((RTC_GPIO_PIN3_INT_TYPE_V)<<(RTC_GPIO_PIN3_INT_TYPE_S)) -#define RTC_GPIO_PIN3_INT_TYPE_V 0x7 -#define RTC_GPIO_PIN3_INT_TYPE_S 7 -/* RTC_GPIO_PIN3_PAD_DRIVER : R/W ;bitpos:[2] ;default: 0 ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define RTC_GPIO_PIN3_PAD_DRIVER (BIT(2)) -#define RTC_GPIO_PIN3_PAD_DRIVER_M (BIT(2)) -#define RTC_GPIO_PIN3_PAD_DRIVER_V 0x1 -#define RTC_GPIO_PIN3_PAD_DRIVER_S 2 - -#define RTC_GPIO_PIN4_REG (DR_REG_RTCIO_BASE + 0x38) -/* RTC_GPIO_PIN4_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: 0 ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define RTC_GPIO_PIN4_WAKEUP_ENABLE (BIT(10)) -#define RTC_GPIO_PIN4_WAKEUP_ENABLE_M (BIT(10)) -#define RTC_GPIO_PIN4_WAKEUP_ENABLE_V 0x1 -#define RTC_GPIO_PIN4_WAKEUP_ENABLE_S 10 -/* RTC_GPIO_PIN4_INT_TYPE : R/W ;bitpos:[9:7] ;default: 0 ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define RTC_GPIO_PIN4_INT_TYPE 0x00000007 -#define RTC_GPIO_PIN4_INT_TYPE_M ((RTC_GPIO_PIN4_INT_TYPE_V)<<(RTC_GPIO_PIN4_INT_TYPE_S)) -#define RTC_GPIO_PIN4_INT_TYPE_V 0x7 -#define RTC_GPIO_PIN4_INT_TYPE_S 7 -/* RTC_GPIO_PIN4_PAD_DRIVER : R/W ;bitpos:[2] ;default: 0 ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define RTC_GPIO_PIN4_PAD_DRIVER (BIT(2)) -#define RTC_GPIO_PIN4_PAD_DRIVER_M (BIT(2)) -#define RTC_GPIO_PIN4_PAD_DRIVER_V 0x1 -#define RTC_GPIO_PIN4_PAD_DRIVER_S 2 - -#define RTC_GPIO_PIN5_REG (DR_REG_RTCIO_BASE + 0x3c) -/* RTC_GPIO_PIN5_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: 0 ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define RTC_GPIO_PIN5_WAKEUP_ENABLE (BIT(10)) -#define RTC_GPIO_PIN5_WAKEUP_ENABLE_M (BIT(10)) -#define RTC_GPIO_PIN5_WAKEUP_ENABLE_V 0x1 -#define RTC_GPIO_PIN5_WAKEUP_ENABLE_S 10 -/* RTC_GPIO_PIN5_INT_TYPE : R/W ;bitpos:[9:7] ;default: 0 ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define RTC_GPIO_PIN5_INT_TYPE 0x00000007 -#define RTC_GPIO_PIN5_INT_TYPE_M ((RTC_GPIO_PIN5_INT_TYPE_V)<<(RTC_GPIO_PIN5_INT_TYPE_S)) -#define RTC_GPIO_PIN5_INT_TYPE_V 0x7 -#define RTC_GPIO_PIN5_INT_TYPE_S 7 -/* RTC_GPIO_PIN5_PAD_DRIVER : R/W ;bitpos:[2] ;default: 0 ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define RTC_GPIO_PIN5_PAD_DRIVER (BIT(2)) -#define RTC_GPIO_PIN5_PAD_DRIVER_M (BIT(2)) -#define RTC_GPIO_PIN5_PAD_DRIVER_V 0x1 -#define RTC_GPIO_PIN5_PAD_DRIVER_S 2 - -#define RTC_GPIO_PIN6_REG (DR_REG_RTCIO_BASE + 0x40) -/* RTC_GPIO_PIN6_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: 0 ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define RTC_GPIO_PIN6_WAKEUP_ENABLE (BIT(10)) -#define RTC_GPIO_PIN6_WAKEUP_ENABLE_M (BIT(10)) -#define RTC_GPIO_PIN6_WAKEUP_ENABLE_V 0x1 -#define RTC_GPIO_PIN6_WAKEUP_ENABLE_S 10 -/* RTC_GPIO_PIN6_INT_TYPE : R/W ;bitpos:[9:7] ;default: 0 ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define RTC_GPIO_PIN6_INT_TYPE 0x00000007 -#define RTC_GPIO_PIN6_INT_TYPE_M ((RTC_GPIO_PIN6_INT_TYPE_V)<<(RTC_GPIO_PIN6_INT_TYPE_S)) -#define RTC_GPIO_PIN6_INT_TYPE_V 0x7 -#define RTC_GPIO_PIN6_INT_TYPE_S 7 -/* RTC_GPIO_PIN6_PAD_DRIVER : R/W ;bitpos:[2] ;default: 0 ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define RTC_GPIO_PIN6_PAD_DRIVER (BIT(2)) -#define RTC_GPIO_PIN6_PAD_DRIVER_M (BIT(2)) -#define RTC_GPIO_PIN6_PAD_DRIVER_V 0x1 -#define RTC_GPIO_PIN6_PAD_DRIVER_S 2 - -#define RTC_GPIO_PIN7_REG (DR_REG_RTCIO_BASE + 0x44) -/* RTC_GPIO_PIN7_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: 0 ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define RTC_GPIO_PIN7_WAKEUP_ENABLE (BIT(10)) -#define RTC_GPIO_PIN7_WAKEUP_ENABLE_M (BIT(10)) -#define RTC_GPIO_PIN7_WAKEUP_ENABLE_V 0x1 -#define RTC_GPIO_PIN7_WAKEUP_ENABLE_S 10 -/* RTC_GPIO_PIN7_INT_TYPE : R/W ;bitpos:[9:7] ;default: 0 ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define RTC_GPIO_PIN7_INT_TYPE 0x00000007 -#define RTC_GPIO_PIN7_INT_TYPE_M ((RTC_GPIO_PIN7_INT_TYPE_V)<<(RTC_GPIO_PIN7_INT_TYPE_S)) -#define RTC_GPIO_PIN7_INT_TYPE_V 0x7 -#define RTC_GPIO_PIN7_INT_TYPE_S 7 -/* RTC_GPIO_PIN7_PAD_DRIVER : R/W ;bitpos:[2] ;default: 0 ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define RTC_GPIO_PIN7_PAD_DRIVER (BIT(2)) -#define RTC_GPIO_PIN7_PAD_DRIVER_M (BIT(2)) -#define RTC_GPIO_PIN7_PAD_DRIVER_V 0x1 -#define RTC_GPIO_PIN7_PAD_DRIVER_S 2 - -#define RTC_GPIO_PIN8_REG (DR_REG_RTCIO_BASE + 0x48) -/* RTC_GPIO_PIN8_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: 0 ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define RTC_GPIO_PIN8_WAKEUP_ENABLE (BIT(10)) -#define RTC_GPIO_PIN8_WAKEUP_ENABLE_M (BIT(10)) -#define RTC_GPIO_PIN8_WAKEUP_ENABLE_V 0x1 -#define RTC_GPIO_PIN8_WAKEUP_ENABLE_S 10 -/* RTC_GPIO_PIN8_INT_TYPE : R/W ;bitpos:[9:7] ;default: 0 ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define RTC_GPIO_PIN8_INT_TYPE 0x00000007 -#define RTC_GPIO_PIN8_INT_TYPE_M ((RTC_GPIO_PIN8_INT_TYPE_V)<<(RTC_GPIO_PIN8_INT_TYPE_S)) -#define RTC_GPIO_PIN8_INT_TYPE_V 0x7 -#define RTC_GPIO_PIN8_INT_TYPE_S 7 -/* RTC_GPIO_PIN8_PAD_DRIVER : R/W ;bitpos:[2] ;default: 0 ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define RTC_GPIO_PIN8_PAD_DRIVER (BIT(2)) -#define RTC_GPIO_PIN8_PAD_DRIVER_M (BIT(2)) -#define RTC_GPIO_PIN8_PAD_DRIVER_V 0x1 -#define RTC_GPIO_PIN8_PAD_DRIVER_S 2 - -#define RTC_GPIO_PIN9_REG (DR_REG_RTCIO_BASE + 0x4c) -/* RTC_GPIO_PIN9_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: 0 ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define RTC_GPIO_PIN9_WAKEUP_ENABLE (BIT(10)) -#define RTC_GPIO_PIN9_WAKEUP_ENABLE_M (BIT(10)) -#define RTC_GPIO_PIN9_WAKEUP_ENABLE_V 0x1 -#define RTC_GPIO_PIN9_WAKEUP_ENABLE_S 10 -/* RTC_GPIO_PIN9_INT_TYPE : R/W ;bitpos:[9:7] ;default: 0 ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define RTC_GPIO_PIN9_INT_TYPE 0x00000007 -#define RTC_GPIO_PIN9_INT_TYPE_M ((RTC_GPIO_PIN9_INT_TYPE_V)<<(RTC_GPIO_PIN9_INT_TYPE_S)) -#define RTC_GPIO_PIN9_INT_TYPE_V 0x7 -#define RTC_GPIO_PIN9_INT_TYPE_S 7 -/* RTC_GPIO_PIN9_PAD_DRIVER : R/W ;bitpos:[2] ;default: 0 ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define RTC_GPIO_PIN9_PAD_DRIVER (BIT(2)) -#define RTC_GPIO_PIN9_PAD_DRIVER_M (BIT(2)) -#define RTC_GPIO_PIN9_PAD_DRIVER_V 0x1 -#define RTC_GPIO_PIN9_PAD_DRIVER_S 2 - -#define RTC_GPIO_PIN10_REG (DR_REG_RTCIO_BASE + 0x50) -/* RTC_GPIO_PIN10_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: 0 ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define RTC_GPIO_PIN10_WAKEUP_ENABLE (BIT(10)) -#define RTC_GPIO_PIN10_WAKEUP_ENABLE_M (BIT(10)) -#define RTC_GPIO_PIN10_WAKEUP_ENABLE_V 0x1 -#define RTC_GPIO_PIN10_WAKEUP_ENABLE_S 10 -/* RTC_GPIO_PIN10_INT_TYPE : R/W ;bitpos:[9:7] ;default: 0 ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define RTC_GPIO_PIN10_INT_TYPE 0x00000007 -#define RTC_GPIO_PIN10_INT_TYPE_M ((RTC_GPIO_PIN10_INT_TYPE_V)<<(RTC_GPIO_PIN10_INT_TYPE_S)) -#define RTC_GPIO_PIN10_INT_TYPE_V 0x7 -#define RTC_GPIO_PIN10_INT_TYPE_S 7 -/* RTC_GPIO_PIN10_PAD_DRIVER : R/W ;bitpos:[2] ;default: 0 ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define RTC_GPIO_PIN10_PAD_DRIVER (BIT(2)) -#define RTC_GPIO_PIN10_PAD_DRIVER_M (BIT(2)) -#define RTC_GPIO_PIN10_PAD_DRIVER_V 0x1 -#define RTC_GPIO_PIN10_PAD_DRIVER_S 2 - -#define RTC_GPIO_PIN11_REG (DR_REG_RTCIO_BASE + 0x54) -/* RTC_GPIO_PIN11_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: 0 ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define RTC_GPIO_PIN11_WAKEUP_ENABLE (BIT(10)) -#define RTC_GPIO_PIN11_WAKEUP_ENABLE_M (BIT(10)) -#define RTC_GPIO_PIN11_WAKEUP_ENABLE_V 0x1 -#define RTC_GPIO_PIN11_WAKEUP_ENABLE_S 10 -/* RTC_GPIO_PIN11_INT_TYPE : R/W ;bitpos:[9:7] ;default: 0 ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define RTC_GPIO_PIN11_INT_TYPE 0x00000007 -#define RTC_GPIO_PIN11_INT_TYPE_M ((RTC_GPIO_PIN11_INT_TYPE_V)<<(RTC_GPIO_PIN11_INT_TYPE_S)) -#define RTC_GPIO_PIN11_INT_TYPE_V 0x7 -#define RTC_GPIO_PIN11_INT_TYPE_S 7 -/* RTC_GPIO_PIN11_PAD_DRIVER : R/W ;bitpos:[2] ;default: 0 ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define RTC_GPIO_PIN11_PAD_DRIVER (BIT(2)) -#define RTC_GPIO_PIN11_PAD_DRIVER_M (BIT(2)) -#define RTC_GPIO_PIN11_PAD_DRIVER_V 0x1 -#define RTC_GPIO_PIN11_PAD_DRIVER_S 2 - -#define RTC_GPIO_PIN12_REG (DR_REG_RTCIO_BASE + 0x58) -/* RTC_GPIO_PIN12_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: 0 ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define RTC_GPIO_PIN12_WAKEUP_ENABLE (BIT(10)) -#define RTC_GPIO_PIN12_WAKEUP_ENABLE_M (BIT(10)) -#define RTC_GPIO_PIN12_WAKEUP_ENABLE_V 0x1 -#define RTC_GPIO_PIN12_WAKEUP_ENABLE_S 10 -/* RTC_GPIO_PIN12_INT_TYPE : R/W ;bitpos:[9:7] ;default: 0 ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define RTC_GPIO_PIN12_INT_TYPE 0x00000007 -#define RTC_GPIO_PIN12_INT_TYPE_M ((RTC_GPIO_PIN12_INT_TYPE_V)<<(RTC_GPIO_PIN12_INT_TYPE_S)) -#define RTC_GPIO_PIN12_INT_TYPE_V 0x7 -#define RTC_GPIO_PIN12_INT_TYPE_S 7 -/* RTC_GPIO_PIN12_PAD_DRIVER : R/W ;bitpos:[2] ;default: 0 ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define RTC_GPIO_PIN12_PAD_DRIVER (BIT(2)) -#define RTC_GPIO_PIN12_PAD_DRIVER_M (BIT(2)) -#define RTC_GPIO_PIN12_PAD_DRIVER_V 0x1 -#define RTC_GPIO_PIN12_PAD_DRIVER_S 2 - -#define RTC_GPIO_PIN13_REG (DR_REG_RTCIO_BASE + 0x5c) -/* RTC_GPIO_PIN13_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: 0 ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define RTC_GPIO_PIN13_WAKEUP_ENABLE (BIT(10)) -#define RTC_GPIO_PIN13_WAKEUP_ENABLE_M (BIT(10)) -#define RTC_GPIO_PIN13_WAKEUP_ENABLE_V 0x1 -#define RTC_GPIO_PIN13_WAKEUP_ENABLE_S 10 -/* RTC_GPIO_PIN13_INT_TYPE : R/W ;bitpos:[9:7] ;default: 0 ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define RTC_GPIO_PIN13_INT_TYPE 0x00000007 -#define RTC_GPIO_PIN13_INT_TYPE_M ((RTC_GPIO_PIN13_INT_TYPE_V)<<(RTC_GPIO_PIN13_INT_TYPE_S)) -#define RTC_GPIO_PIN13_INT_TYPE_V 0x7 -#define RTC_GPIO_PIN13_INT_TYPE_S 7 -/* RTC_GPIO_PIN13_PAD_DRIVER : R/W ;bitpos:[2] ;default: 0 ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define RTC_GPIO_PIN13_PAD_DRIVER (BIT(2)) -#define RTC_GPIO_PIN13_PAD_DRIVER_M (BIT(2)) -#define RTC_GPIO_PIN13_PAD_DRIVER_V 0x1 -#define RTC_GPIO_PIN13_PAD_DRIVER_S 2 - -#define RTC_GPIO_PIN14_REG (DR_REG_RTCIO_BASE + 0x60) -/* RTC_GPIO_PIN14_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: 0 ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define RTC_GPIO_PIN14_WAKEUP_ENABLE (BIT(10)) -#define RTC_GPIO_PIN14_WAKEUP_ENABLE_M (BIT(10)) -#define RTC_GPIO_PIN14_WAKEUP_ENABLE_V 0x1 -#define RTC_GPIO_PIN14_WAKEUP_ENABLE_S 10 -/* RTC_GPIO_PIN14_INT_TYPE : R/W ;bitpos:[9:7] ;default: 0 ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define RTC_GPIO_PIN14_INT_TYPE 0x00000007 -#define RTC_GPIO_PIN14_INT_TYPE_M ((RTC_GPIO_PIN14_INT_TYPE_V)<<(RTC_GPIO_PIN14_INT_TYPE_S)) -#define RTC_GPIO_PIN14_INT_TYPE_V 0x7 -#define RTC_GPIO_PIN14_INT_TYPE_S 7 -/* RTC_GPIO_PIN14_PAD_DRIVER : R/W ;bitpos:[2] ;default: 0 ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define RTC_GPIO_PIN14_PAD_DRIVER (BIT(2)) -#define RTC_GPIO_PIN14_PAD_DRIVER_M (BIT(2)) -#define RTC_GPIO_PIN14_PAD_DRIVER_V 0x1 -#define RTC_GPIO_PIN14_PAD_DRIVER_S 2 - -#define RTC_GPIO_PIN15_REG (DR_REG_RTCIO_BASE + 0x64) -/* RTC_GPIO_PIN15_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: 0 ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define RTC_GPIO_PIN15_WAKEUP_ENABLE (BIT(10)) -#define RTC_GPIO_PIN15_WAKEUP_ENABLE_M (BIT(10)) -#define RTC_GPIO_PIN15_WAKEUP_ENABLE_V 0x1 -#define RTC_GPIO_PIN15_WAKEUP_ENABLE_S 10 -/* RTC_GPIO_PIN15_INT_TYPE : R/W ;bitpos:[9:7] ;default: 0 ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define RTC_GPIO_PIN15_INT_TYPE 0x00000007 -#define RTC_GPIO_PIN15_INT_TYPE_M ((RTC_GPIO_PIN15_INT_TYPE_V)<<(RTC_GPIO_PIN15_INT_TYPE_S)) -#define RTC_GPIO_PIN15_INT_TYPE_V 0x7 -#define RTC_GPIO_PIN15_INT_TYPE_S 7 -/* RTC_GPIO_PIN15_PAD_DRIVER : R/W ;bitpos:[2] ;default: 0 ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define RTC_GPIO_PIN15_PAD_DRIVER (BIT(2)) -#define RTC_GPIO_PIN15_PAD_DRIVER_M (BIT(2)) -#define RTC_GPIO_PIN15_PAD_DRIVER_V 0x1 -#define RTC_GPIO_PIN15_PAD_DRIVER_S 2 - -#define RTC_GPIO_PIN16_REG (DR_REG_RTCIO_BASE + 0x68) -/* RTC_GPIO_PIN16_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: 0 ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define RTC_GPIO_PIN16_WAKEUP_ENABLE (BIT(10)) -#define RTC_GPIO_PIN16_WAKEUP_ENABLE_M (BIT(10)) -#define RTC_GPIO_PIN16_WAKEUP_ENABLE_V 0x1 -#define RTC_GPIO_PIN16_WAKEUP_ENABLE_S 10 -/* RTC_GPIO_PIN16_INT_TYPE : R/W ;bitpos:[9:7] ;default: 0 ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define RTC_GPIO_PIN16_INT_TYPE 0x00000007 -#define RTC_GPIO_PIN16_INT_TYPE_M ((RTC_GPIO_PIN16_INT_TYPE_V)<<(RTC_GPIO_PIN16_INT_TYPE_S)) -#define RTC_GPIO_PIN16_INT_TYPE_V 0x7 -#define RTC_GPIO_PIN16_INT_TYPE_S 7 -/* RTC_GPIO_PIN16_PAD_DRIVER : R/W ;bitpos:[2] ;default: 0 ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define RTC_GPIO_PIN16_PAD_DRIVER (BIT(2)) -#define RTC_GPIO_PIN16_PAD_DRIVER_M (BIT(2)) -#define RTC_GPIO_PIN16_PAD_DRIVER_V 0x1 -#define RTC_GPIO_PIN16_PAD_DRIVER_S 2 - -#define RTC_GPIO_PIN17_REG (DR_REG_RTCIO_BASE + 0x6c) -/* RTC_GPIO_PIN17_WAKEUP_ENABLE : R/W ;bitpos:[10] ;default: 0 ; */ -/*description: GPIO wake up enable only available in light sleep*/ -#define RTC_GPIO_PIN17_WAKEUP_ENABLE (BIT(10)) -#define RTC_GPIO_PIN17_WAKEUP_ENABLE_M (BIT(10)) -#define RTC_GPIO_PIN17_WAKEUP_ENABLE_V 0x1 -#define RTC_GPIO_PIN17_WAKEUP_ENABLE_S 10 -/* RTC_GPIO_PIN17_INT_TYPE : R/W ;bitpos:[9:7] ;default: 0 ; */ -/*description: if set to 0: GPIO interrupt disable if set to 1: rising edge - trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ -#define RTC_GPIO_PIN17_INT_TYPE 0x00000007 -#define RTC_GPIO_PIN17_INT_TYPE_M ((RTC_GPIO_PIN17_INT_TYPE_V)<<(RTC_GPIO_PIN17_INT_TYPE_S)) -#define RTC_GPIO_PIN17_INT_TYPE_V 0x7 -#define RTC_GPIO_PIN17_INT_TYPE_S 7 -/* RTC_GPIO_PIN17_PAD_DRIVER : R/W ;bitpos:[2] ;default: 0 ; */ -/*description: if set to 0: normal output if set to 1: open drain*/ -#define RTC_GPIO_PIN17_PAD_DRIVER (BIT(2)) -#define RTC_GPIO_PIN17_PAD_DRIVER_M (BIT(2)) -#define RTC_GPIO_PIN17_PAD_DRIVER_V 0x1 -#define RTC_GPIO_PIN17_PAD_DRIVER_S 2 - -#define RTC_IO_RTC_DEBUG_SEL_REG (DR_REG_RTCIO_BASE + 0x70) -/* RTC_IO_DEBUG_12M_NO_GATING : R/W ;bitpos:[25] ;default: 1'd0 ; */ -/*description: */ -#define RTC_IO_DEBUG_12M_NO_GATING (BIT(25)) -#define RTC_IO_DEBUG_12M_NO_GATING_M (BIT(25)) -#define RTC_IO_DEBUG_12M_NO_GATING_V 0x1 -#define RTC_IO_DEBUG_12M_NO_GATING_S 25 -/* RTC_IO_DEBUG_SEL4 : R/W ;bitpos:[24:20] ;default: 5'd0 ; */ -/*description: */ -#define RTC_IO_DEBUG_SEL4 0x0000001F -#define RTC_IO_DEBUG_SEL4_M ((RTC_IO_DEBUG_SEL4_V)<<(RTC_IO_DEBUG_SEL4_S)) -#define RTC_IO_DEBUG_SEL4_V 0x1F -#define RTC_IO_DEBUG_SEL4_S 20 -/* RTC_IO_DEBUG_SEL3 : R/W ;bitpos:[19:15] ;default: 5'd0 ; */ -/*description: */ -#define RTC_IO_DEBUG_SEL3 0x0000001F -#define RTC_IO_DEBUG_SEL3_M ((RTC_IO_DEBUG_SEL3_V)<<(RTC_IO_DEBUG_SEL3_S)) -#define RTC_IO_DEBUG_SEL3_V 0x1F -#define RTC_IO_DEBUG_SEL3_S 15 -/* RTC_IO_DEBUG_SEL2 : R/W ;bitpos:[14:10] ;default: 5'd0 ; */ -/*description: */ -#define RTC_IO_DEBUG_SEL2 0x0000001F -#define RTC_IO_DEBUG_SEL2_M ((RTC_IO_DEBUG_SEL2_V)<<(RTC_IO_DEBUG_SEL2_S)) -#define RTC_IO_DEBUG_SEL2_V 0x1F -#define RTC_IO_DEBUG_SEL2_S 10 -/* RTC_IO_DEBUG_SEL1 : R/W ;bitpos:[9:5] ;default: 5'd0 ; */ -/*description: */ -#define RTC_IO_DEBUG_SEL1 0x0000001F -#define RTC_IO_DEBUG_SEL1_M ((RTC_IO_DEBUG_SEL1_V)<<(RTC_IO_DEBUG_SEL1_S)) -#define RTC_IO_DEBUG_SEL1_V 0x1F -#define RTC_IO_DEBUG_SEL1_S 5 -/* RTC_IO_DEBUG_SEL0 : R/W ;bitpos:[4:0] ;default: 5'd0 ; */ -/*description: */ -#define RTC_IO_DEBUG_SEL0 0x0000001F -#define RTC_IO_DEBUG_SEL0_M ((RTC_IO_DEBUG_SEL0_V)<<(RTC_IO_DEBUG_SEL0_S)) -#define RTC_IO_DEBUG_SEL0_V 0x1F -#define RTC_IO_DEBUG_SEL0_S 0 -#define RTC_IO_DEBUG_SEL0_8M 1 -#define RTC_IO_DEBUG_SEL0_32K_XTAL 4 -#define RTC_IO_DEBUG_SEL0_150K_OSC 5 - -#define RTC_IO_DIG_PAD_HOLD_REG (DR_REG_RTCIO_BASE + 0x74) -/* RTC_IO_DIG_PAD_HOLD : R/W ;bitpos:[31:0] ;default: 1'd0 ; */ -/*description: select the digital pad hold value.*/ -#define RTC_IO_DIG_PAD_HOLD 0xFFFFFFFF -#define RTC_IO_DIG_PAD_HOLD_M ((RTC_IO_DIG_PAD_HOLD_V)<<(RTC_IO_DIG_PAD_HOLD_S)) -#define RTC_IO_DIG_PAD_HOLD_V 0xFFFFFFFF -#define RTC_IO_DIG_PAD_HOLD_S 0 - -#define RTC_IO_HALL_SENS_REG (DR_REG_RTCIO_BASE + 0x78) -/* RTC_IO_XPD_HALL : R/W ;bitpos:[31] ;default: 1'd0 ; */ -/*description: Power on hall sensor and connect to VP and VN*/ -#define RTC_IO_XPD_HALL (BIT(31)) -#define RTC_IO_XPD_HALL_M (BIT(31)) -#define RTC_IO_XPD_HALL_V 0x1 -#define RTC_IO_XPD_HALL_S 31 -/* RTC_IO_HALL_PHASE : R/W ;bitpos:[30] ;default: 1'd0 ; */ -/*description: Reverse phase of hall sensor*/ -#define RTC_IO_HALL_PHASE (BIT(30)) -#define RTC_IO_HALL_PHASE_M (BIT(30)) -#define RTC_IO_HALL_PHASE_V 0x1 -#define RTC_IO_HALL_PHASE_S 30 - -#define RTC_IO_SENSOR_PADS_REG (DR_REG_RTCIO_BASE + 0x7c) -/* RTC_IO_SENSE1_HOLD : R/W ;bitpos:[31] ;default: 1'd0 ; */ -/*description: hold the current value of the output when setting the hold to Ò1Ó*/ -#define RTC_IO_SENSE1_HOLD (BIT(31)) -#define RTC_IO_SENSE1_HOLD_M (BIT(31)) -#define RTC_IO_SENSE1_HOLD_V 0x1 -#define RTC_IO_SENSE1_HOLD_S 31 -/* RTC_IO_SENSE2_HOLD : R/W ;bitpos:[30] ;default: 1'd0 ; */ -/*description: hold the current value of the output when setting the hold to Ò1Ó*/ -#define RTC_IO_SENSE2_HOLD (BIT(30)) -#define RTC_IO_SENSE2_HOLD_M (BIT(30)) -#define RTC_IO_SENSE2_HOLD_V 0x1 -#define RTC_IO_SENSE2_HOLD_S 30 -/* RTC_IO_SENSE3_HOLD : R/W ;bitpos:[29] ;default: 1'd0 ; */ -/*description: hold the current value of the output when setting the hold to Ò1Ó*/ -#define RTC_IO_SENSE3_HOLD (BIT(29)) -#define RTC_IO_SENSE3_HOLD_M (BIT(29)) -#define RTC_IO_SENSE3_HOLD_V 0x1 -#define RTC_IO_SENSE3_HOLD_S 29 -/* RTC_IO_SENSE4_HOLD : R/W ;bitpos:[28] ;default: 1'd0 ; */ -/*description: hold the current value of the output when setting the hold to Ò1Ó*/ -#define RTC_IO_SENSE4_HOLD (BIT(28)) -#define RTC_IO_SENSE4_HOLD_M (BIT(28)) -#define RTC_IO_SENSE4_HOLD_V 0x1 -#define RTC_IO_SENSE4_HOLD_S 28 -/* RTC_IO_SENSE1_MUX_SEL : R/W ;bitpos:[27] ;default: 1'd0 ; */ -/*description: Ò1Ó select the digital function Ó0Óslection the rtc function*/ -#define RTC_IO_SENSE1_MUX_SEL (BIT(27)) -#define RTC_IO_SENSE1_MUX_SEL_M (BIT(27)) -#define RTC_IO_SENSE1_MUX_SEL_V 0x1 -#define RTC_IO_SENSE1_MUX_SEL_S 27 -/* RTC_IO_SENSE2_MUX_SEL : R/W ;bitpos:[26] ;default: 1'd0 ; */ -/*description: Ò1Ó select the digital function Ó0Óslection the rtc function*/ -#define RTC_IO_SENSE2_MUX_SEL (BIT(26)) -#define RTC_IO_SENSE2_MUX_SEL_M (BIT(26)) -#define RTC_IO_SENSE2_MUX_SEL_V 0x1 -#define RTC_IO_SENSE2_MUX_SEL_S 26 -/* RTC_IO_SENSE3_MUX_SEL : R/W ;bitpos:[25] ;default: 1'd0 ; */ -/*description: Ò1Ó select the digital function Ó0Óslection the rtc function*/ -#define RTC_IO_SENSE3_MUX_SEL (BIT(25)) -#define RTC_IO_SENSE3_MUX_SEL_M (BIT(25)) -#define RTC_IO_SENSE3_MUX_SEL_V 0x1 -#define RTC_IO_SENSE3_MUX_SEL_S 25 -/* RTC_IO_SENSE4_MUX_SEL : R/W ;bitpos:[24] ;default: 1'd0 ; */ -/*description: Ò1Ó select the digital function Ó0Óslection the rtc function*/ -#define RTC_IO_SENSE4_MUX_SEL (BIT(24)) -#define RTC_IO_SENSE4_MUX_SEL_M (BIT(24)) -#define RTC_IO_SENSE4_MUX_SEL_V 0x1 -#define RTC_IO_SENSE4_MUX_SEL_S 24 -/* RTC_IO_SENSE1_FUN_SEL : R/W ;bitpos:[23:22] ;default: 2'd0 ; */ -/*description: the functional selection signal of the pad*/ -#define RTC_IO_SENSE1_FUN_SEL 0x00000003 -#define RTC_IO_SENSE1_FUN_SEL_M ((RTC_IO_SENSE1_FUN_SEL_V)<<(RTC_IO_SENSE1_FUN_SEL_S)) -#define RTC_IO_SENSE1_FUN_SEL_V 0x3 -#define RTC_IO_SENSE1_FUN_SEL_S 22 -/* RTC_IO_SENSE1_SLP_SEL : R/W ;bitpos:[21] ;default: 1'd0 ; */ -/*description: the sleep status selection signal of the pad*/ -#define RTC_IO_SENSE1_SLP_SEL (BIT(21)) -#define RTC_IO_SENSE1_SLP_SEL_M (BIT(21)) -#define RTC_IO_SENSE1_SLP_SEL_V 0x1 -#define RTC_IO_SENSE1_SLP_SEL_S 21 -/* RTC_IO_SENSE1_SLP_IE : R/W ;bitpos:[20] ;default: 1'd0 ; */ -/*description: the input enable of the pad in sleep status*/ -#define RTC_IO_SENSE1_SLP_IE (BIT(20)) -#define RTC_IO_SENSE1_SLP_IE_M (BIT(20)) -#define RTC_IO_SENSE1_SLP_IE_V 0x1 -#define RTC_IO_SENSE1_SLP_IE_S 20 -/* RTC_IO_SENSE1_FUN_IE : R/W ;bitpos:[19] ;default: 1'd0 ; */ -/*description: the input enable of the pad*/ -#define RTC_IO_SENSE1_FUN_IE (BIT(19)) -#define RTC_IO_SENSE1_FUN_IE_M (BIT(19)) -#define RTC_IO_SENSE1_FUN_IE_V 0x1 -#define RTC_IO_SENSE1_FUN_IE_S 19 -/* RTC_IO_SENSE2_FUN_SEL : R/W ;bitpos:[18:17] ;default: 2'd0 ; */ -/*description: the functional selection signal of the pad*/ -#define RTC_IO_SENSE2_FUN_SEL 0x00000003 -#define RTC_IO_SENSE2_FUN_SEL_M ((RTC_IO_SENSE2_FUN_SEL_V)<<(RTC_IO_SENSE2_FUN_SEL_S)) -#define RTC_IO_SENSE2_FUN_SEL_V 0x3 -#define RTC_IO_SENSE2_FUN_SEL_S 17 -/* RTC_IO_SENSE2_SLP_SEL : R/W ;bitpos:[16] ;default: 1'd0 ; */ -/*description: the sleep status selection signal of the pad*/ -#define RTC_IO_SENSE2_SLP_SEL (BIT(16)) -#define RTC_IO_SENSE2_SLP_SEL_M (BIT(16)) -#define RTC_IO_SENSE2_SLP_SEL_V 0x1 -#define RTC_IO_SENSE2_SLP_SEL_S 16 -/* RTC_IO_SENSE2_SLP_IE : R/W ;bitpos:[15] ;default: 1'd0 ; */ -/*description: the input enable of the pad in sleep status*/ -#define RTC_IO_SENSE2_SLP_IE (BIT(15)) -#define RTC_IO_SENSE2_SLP_IE_M (BIT(15)) -#define RTC_IO_SENSE2_SLP_IE_V 0x1 -#define RTC_IO_SENSE2_SLP_IE_S 15 -/* RTC_IO_SENSE2_FUN_IE : R/W ;bitpos:[14] ;default: 1'd0 ; */ -/*description: the input enable of the pad*/ -#define RTC_IO_SENSE2_FUN_IE (BIT(14)) -#define RTC_IO_SENSE2_FUN_IE_M (BIT(14)) -#define RTC_IO_SENSE2_FUN_IE_V 0x1 -#define RTC_IO_SENSE2_FUN_IE_S 14 -/* RTC_IO_SENSE3_FUN_SEL : R/W ;bitpos:[13:12] ;default: 2'd0 ; */ -/*description: the functional selection signal of the pad*/ -#define RTC_IO_SENSE3_FUN_SEL 0x00000003 -#define RTC_IO_SENSE3_FUN_SEL_M ((RTC_IO_SENSE3_FUN_SEL_V)<<(RTC_IO_SENSE3_FUN_SEL_S)) -#define RTC_IO_SENSE3_FUN_SEL_V 0x3 -#define RTC_IO_SENSE3_FUN_SEL_S 12 -/* RTC_IO_SENSE3_SLP_SEL : R/W ;bitpos:[11] ;default: 1'd0 ; */ -/*description: the sleep status selection signal of the pad*/ -#define RTC_IO_SENSE3_SLP_SEL (BIT(11)) -#define RTC_IO_SENSE3_SLP_SEL_M (BIT(11)) -#define RTC_IO_SENSE3_SLP_SEL_V 0x1 -#define RTC_IO_SENSE3_SLP_SEL_S 11 -/* RTC_IO_SENSE3_SLP_IE : R/W ;bitpos:[10] ;default: 1'd0 ; */ -/*description: the input enable of the pad in sleep status*/ -#define RTC_IO_SENSE3_SLP_IE (BIT(10)) -#define RTC_IO_SENSE3_SLP_IE_M (BIT(10)) -#define RTC_IO_SENSE3_SLP_IE_V 0x1 -#define RTC_IO_SENSE3_SLP_IE_S 10 -/* RTC_IO_SENSE3_FUN_IE : R/W ;bitpos:[9] ;default: 1'd0 ; */ -/*description: the input enable of the pad*/ -#define RTC_IO_SENSE3_FUN_IE (BIT(9)) -#define RTC_IO_SENSE3_FUN_IE_M (BIT(9)) -#define RTC_IO_SENSE3_FUN_IE_V 0x1 -#define RTC_IO_SENSE3_FUN_IE_S 9 -/* RTC_IO_SENSE4_FUN_SEL : R/W ;bitpos:[8:7] ;default: 2'd0 ; */ -/*description: the functional selection signal of the pad*/ -#define RTC_IO_SENSE4_FUN_SEL 0x00000003 -#define RTC_IO_SENSE4_FUN_SEL_M ((RTC_IO_SENSE4_FUN_SEL_V)<<(RTC_IO_SENSE4_FUN_SEL_S)) -#define RTC_IO_SENSE4_FUN_SEL_V 0x3 -#define RTC_IO_SENSE4_FUN_SEL_S 7 -/* RTC_IO_SENSE4_SLP_SEL : R/W ;bitpos:[6] ;default: 1'd0 ; */ -/*description: the sleep status selection signal of the pad*/ -#define RTC_IO_SENSE4_SLP_SEL (BIT(6)) -#define RTC_IO_SENSE4_SLP_SEL_M (BIT(6)) -#define RTC_IO_SENSE4_SLP_SEL_V 0x1 -#define RTC_IO_SENSE4_SLP_SEL_S 6 -/* RTC_IO_SENSE4_SLP_IE : R/W ;bitpos:[5] ;default: 1'd0 ; */ -/*description: the input enable of the pad in sleep status*/ -#define RTC_IO_SENSE4_SLP_IE (BIT(5)) -#define RTC_IO_SENSE4_SLP_IE_M (BIT(5)) -#define RTC_IO_SENSE4_SLP_IE_V 0x1 -#define RTC_IO_SENSE4_SLP_IE_S 5 -/* RTC_IO_SENSE4_FUN_IE : R/W ;bitpos:[4] ;default: 1'd0 ; */ -/*description: the input enable of the pad*/ -#define RTC_IO_SENSE4_FUN_IE (BIT(4)) -#define RTC_IO_SENSE4_FUN_IE_M (BIT(4)) -#define RTC_IO_SENSE4_FUN_IE_V 0x1 -#define RTC_IO_SENSE4_FUN_IE_S 4 - -#define RTC_IO_ADC_PAD_REG (DR_REG_RTCIO_BASE + 0x80) -/* RTC_IO_ADC1_HOLD : R/W ;bitpos:[31] ;default: 1'd0 ; */ -/*description: hold the current value of the output when setting the hold to Ò1Ó*/ -#define RTC_IO_ADC1_HOLD (BIT(31)) -#define RTC_IO_ADC1_HOLD_M (BIT(31)) -#define RTC_IO_ADC1_HOLD_V 0x1 -#define RTC_IO_ADC1_HOLD_S 31 -/* RTC_IO_ADC2_HOLD : R/W ;bitpos:[30] ;default: 1'd0 ; */ -/*description: hold the current value of the output when setting the hold to Ò1Ó*/ -#define RTC_IO_ADC2_HOLD (BIT(30)) -#define RTC_IO_ADC2_HOLD_M (BIT(30)) -#define RTC_IO_ADC2_HOLD_V 0x1 -#define RTC_IO_ADC2_HOLD_S 30 -/* RTC_IO_ADC1_MUX_SEL : R/W ;bitpos:[29] ;default: 1'd0 ; */ -/*description: Ò1Ó select the digital function Ó0Óslection the rtc function*/ -#define RTC_IO_ADC1_MUX_SEL (BIT(29)) -#define RTC_IO_ADC1_MUX_SEL_M (BIT(29)) -#define RTC_IO_ADC1_MUX_SEL_V 0x1 -#define RTC_IO_ADC1_MUX_SEL_S 29 -/* RTC_IO_ADC2_MUX_SEL : R/W ;bitpos:[28] ;default: 1'd0 ; */ -/*description: Ò1Ó select the digital function Ó0Óslection the rtc function*/ -#define RTC_IO_ADC2_MUX_SEL (BIT(28)) -#define RTC_IO_ADC2_MUX_SEL_M (BIT(28)) -#define RTC_IO_ADC2_MUX_SEL_V 0x1 -#define RTC_IO_ADC2_MUX_SEL_S 28 -/* RTC_IO_ADC1_FUN_SEL : R/W ;bitpos:[27:26] ;default: 2'd0 ; */ -/*description: the functional selection signal of the pad*/ -#define RTC_IO_ADC1_FUN_SEL 0x00000003 -#define RTC_IO_ADC1_FUN_SEL_M ((RTC_IO_ADC1_FUN_SEL_V)<<(RTC_IO_ADC1_FUN_SEL_S)) -#define RTC_IO_ADC1_FUN_SEL_V 0x3 -#define RTC_IO_ADC1_FUN_SEL_S 26 -/* RTC_IO_ADC1_SLP_SEL : R/W ;bitpos:[25] ;default: 1'd0 ; */ -/*description: the sleep status selection signal of the pad*/ -#define RTC_IO_ADC1_SLP_SEL (BIT(25)) -#define RTC_IO_ADC1_SLP_SEL_M (BIT(25)) -#define RTC_IO_ADC1_SLP_SEL_V 0x1 -#define RTC_IO_ADC1_SLP_SEL_S 25 -/* RTC_IO_ADC1_SLP_IE : R/W ;bitpos:[24] ;default: 1'd0 ; */ -/*description: the input enable of the pad in sleep status*/ -#define RTC_IO_ADC1_SLP_IE (BIT(24)) -#define RTC_IO_ADC1_SLP_IE_M (BIT(24)) -#define RTC_IO_ADC1_SLP_IE_V 0x1 -#define RTC_IO_ADC1_SLP_IE_S 24 -/* RTC_IO_ADC1_FUN_IE : R/W ;bitpos:[23] ;default: 1'd0 ; */ -/*description: the input enable of the pad*/ -#define RTC_IO_ADC1_FUN_IE (BIT(23)) -#define RTC_IO_ADC1_FUN_IE_M (BIT(23)) -#define RTC_IO_ADC1_FUN_IE_V 0x1 -#define RTC_IO_ADC1_FUN_IE_S 23 -/* RTC_IO_ADC2_FUN_SEL : R/W ;bitpos:[22:21] ;default: 2'd0 ; */ -/*description: the functional selection signal of the pad*/ -#define RTC_IO_ADC2_FUN_SEL 0x00000003 -#define RTC_IO_ADC2_FUN_SEL_M ((RTC_IO_ADC2_FUN_SEL_V)<<(RTC_IO_ADC2_FUN_SEL_S)) -#define RTC_IO_ADC2_FUN_SEL_V 0x3 -#define RTC_IO_ADC2_FUN_SEL_S 21 -/* RTC_IO_ADC2_SLP_SEL : R/W ;bitpos:[20] ;default: 1'd0 ; */ -/*description: the sleep status selection signal of the pad*/ -#define RTC_IO_ADC2_SLP_SEL (BIT(20)) -#define RTC_IO_ADC2_SLP_SEL_M (BIT(20)) -#define RTC_IO_ADC2_SLP_SEL_V 0x1 -#define RTC_IO_ADC2_SLP_SEL_S 20 -/* RTC_IO_ADC2_SLP_IE : R/W ;bitpos:[19] ;default: 1'd0 ; */ -/*description: the input enable of the pad in sleep status*/ -#define RTC_IO_ADC2_SLP_IE (BIT(19)) -#define RTC_IO_ADC2_SLP_IE_M (BIT(19)) -#define RTC_IO_ADC2_SLP_IE_V 0x1 -#define RTC_IO_ADC2_SLP_IE_S 19 -/* RTC_IO_ADC2_FUN_IE : R/W ;bitpos:[18] ;default: 1'd0 ; */ -/*description: the input enable of the pad*/ -#define RTC_IO_ADC2_FUN_IE (BIT(18)) -#define RTC_IO_ADC2_FUN_IE_M (BIT(18)) -#define RTC_IO_ADC2_FUN_IE_V 0x1 -#define RTC_IO_ADC2_FUN_IE_S 18 - -#define RTC_IO_PAD_DAC1_REG (DR_REG_RTCIO_BASE + 0x84) -/* RTC_IO_PDAC1_DRV : R/W ;bitpos:[31:30] ;default: 2'd2 ; */ -/*description: the driver strength of the pad*/ -#define RTC_IO_PDAC1_DRV 0x00000003 -#define RTC_IO_PDAC1_DRV_M ((RTC_IO_PDAC1_DRV_V)<<(RTC_IO_PDAC1_DRV_S)) -#define RTC_IO_PDAC1_DRV_V 0x3 -#define RTC_IO_PDAC1_DRV_S 30 -/* RTC_IO_PDAC1_HOLD : R/W ;bitpos:[29] ;default: 1'd0 ; */ -/*description: hold the current value of the output when setting the hold to Ò1Ó*/ -#define RTC_IO_PDAC1_HOLD (BIT(29)) -#define RTC_IO_PDAC1_HOLD_M (BIT(29)) -#define RTC_IO_PDAC1_HOLD_V 0x1 -#define RTC_IO_PDAC1_HOLD_S 29 -/* RTC_IO_PDAC1_RDE : R/W ;bitpos:[28] ;default: 1'd0 ; */ -/*description: the pull down enable of the pad*/ -#define RTC_IO_PDAC1_RDE (BIT(28)) -#define RTC_IO_PDAC1_RDE_M (BIT(28)) -#define RTC_IO_PDAC1_RDE_V 0x1 -#define RTC_IO_PDAC1_RDE_S 28 -/* RTC_IO_PDAC1_RUE : R/W ;bitpos:[27] ;default: 1'd0 ; */ -/*description: the pull up enable of the pad*/ -#define RTC_IO_PDAC1_RUE (BIT(27)) -#define RTC_IO_PDAC1_RUE_M (BIT(27)) -#define RTC_IO_PDAC1_RUE_V 0x1 -#define RTC_IO_PDAC1_RUE_S 27 -/* RTC_IO_PDAC1_DAC : R/W ;bitpos:[26:19] ;default: 8'd0 ; */ -/*description: PAD DAC1 control code.*/ -#define RTC_IO_PDAC1_DAC 0x000000FF -#define RTC_IO_PDAC1_DAC_M ((RTC_IO_PDAC1_DAC_V)<<(RTC_IO_PDAC1_DAC_S)) -#define RTC_IO_PDAC1_DAC_V 0xFF -#define RTC_IO_PDAC1_DAC_S 19 -/* RTC_IO_PDAC1_XPD_DAC : R/W ;bitpos:[18] ;default: 1'd0 ; */ -/*description: Power on DAC1. Usually we need to tristate PDAC1 if we power - on the DAC i.e. IE=0 OE=0 RDE=0 RUE=0*/ -#define RTC_IO_PDAC1_XPD_DAC (BIT(18)) -#define RTC_IO_PDAC1_XPD_DAC_M (BIT(18)) -#define RTC_IO_PDAC1_XPD_DAC_V 0x1 -#define RTC_IO_PDAC1_XPD_DAC_S 18 -/* RTC_IO_PDAC1_MUX_SEL : R/W ;bitpos:[17] ;default: 1'd0 ; */ -/*description: Ò1Ó select the digital function Ó0Óslection the rtc function*/ -#define RTC_IO_PDAC1_MUX_SEL (BIT(17)) -#define RTC_IO_PDAC1_MUX_SEL_M (BIT(17)) -#define RTC_IO_PDAC1_MUX_SEL_V 0x1 -#define RTC_IO_PDAC1_MUX_SEL_S 17 -/* RTC_IO_PDAC1_FUN_SEL : R/W ;bitpos:[16:15] ;default: 2'd0 ; */ -/*description: the functional selection signal of the pad*/ -#define RTC_IO_PDAC1_FUN_SEL 0x00000003 -#define RTC_IO_PDAC1_FUN_SEL_M ((RTC_IO_PDAC1_FUN_SEL_V)<<(RTC_IO_PDAC1_FUN_SEL_S)) -#define RTC_IO_PDAC1_FUN_SEL_V 0x3 -#define RTC_IO_PDAC1_FUN_SEL_S 15 -/* RTC_IO_PDAC1_SLP_SEL : R/W ;bitpos:[14] ;default: 1'd0 ; */ -/*description: the sleep status selection signal of the pad*/ -#define RTC_IO_PDAC1_SLP_SEL (BIT(14)) -#define RTC_IO_PDAC1_SLP_SEL_M (BIT(14)) -#define RTC_IO_PDAC1_SLP_SEL_V 0x1 -#define RTC_IO_PDAC1_SLP_SEL_S 14 -/* RTC_IO_PDAC1_SLP_IE : R/W ;bitpos:[13] ;default: 1'd0 ; */ -/*description: the input enable of the pad in sleep status*/ -#define RTC_IO_PDAC1_SLP_IE (BIT(13)) -#define RTC_IO_PDAC1_SLP_IE_M (BIT(13)) -#define RTC_IO_PDAC1_SLP_IE_V 0x1 -#define RTC_IO_PDAC1_SLP_IE_S 13 -/* RTC_IO_PDAC1_SLP_OE : R/W ;bitpos:[12] ;default: 1'd0 ; */ -/*description: the output enable of the pad in sleep status*/ -#define RTC_IO_PDAC1_SLP_OE (BIT(12)) -#define RTC_IO_PDAC1_SLP_OE_M (BIT(12)) -#define RTC_IO_PDAC1_SLP_OE_V 0x1 -#define RTC_IO_PDAC1_SLP_OE_S 12 -/* RTC_IO_PDAC1_FUN_IE : R/W ;bitpos:[11] ;default: 1'd0 ; */ -/*description: the input enable of the pad*/ -#define RTC_IO_PDAC1_FUN_IE (BIT(11)) -#define RTC_IO_PDAC1_FUN_IE_M (BIT(11)) -#define RTC_IO_PDAC1_FUN_IE_V 0x1 -#define RTC_IO_PDAC1_FUN_IE_S 11 -/* RTC_IO_PDAC1_DAC_XPD_FORCE : R/W ;bitpos:[10] ;default: 1'd0 ; */ -/*description: Power on DAC1. Usually we need to tristate PDAC1 if we power - on the DAC i.e. IE=0 OE=0 RDE=0 RUE=0*/ -#define RTC_IO_PDAC1_DAC_XPD_FORCE (BIT(10)) -#define RTC_IO_PDAC1_DAC_XPD_FORCE_M (BIT(10)) -#define RTC_IO_PDAC1_DAC_XPD_FORCE_V 0x1 -#define RTC_IO_PDAC1_DAC_XPD_FORCE_S 10 - -#define RTC_IO_PAD_DAC2_REG (DR_REG_RTCIO_BASE + 0x88) -/* RTC_IO_PDAC2_DRV : R/W ;bitpos:[31:30] ;default: 2'd2 ; */ -/*description: the driver strength of the pad*/ -#define RTC_IO_PDAC2_DRV 0x00000003 -#define RTC_IO_PDAC2_DRV_M ((RTC_IO_PDAC2_DRV_V)<<(RTC_IO_PDAC2_DRV_S)) -#define RTC_IO_PDAC2_DRV_V 0x3 -#define RTC_IO_PDAC2_DRV_S 30 -/* RTC_IO_PDAC2_HOLD : R/W ;bitpos:[29] ;default: 1'd0 ; */ -/*description: hold the current value of the output when setting the hold to Ò1Ó*/ -#define RTC_IO_PDAC2_HOLD (BIT(29)) -#define RTC_IO_PDAC2_HOLD_M (BIT(29)) -#define RTC_IO_PDAC2_HOLD_V 0x1 -#define RTC_IO_PDAC2_HOLD_S 29 -/* RTC_IO_PDAC2_RDE : R/W ;bitpos:[28] ;default: 1'd0 ; */ -/*description: the pull down enable of the pad*/ -#define RTC_IO_PDAC2_RDE (BIT(28)) -#define RTC_IO_PDAC2_RDE_M (BIT(28)) -#define RTC_IO_PDAC2_RDE_V 0x1 -#define RTC_IO_PDAC2_RDE_S 28 -/* RTC_IO_PDAC2_RUE : R/W ;bitpos:[27] ;default: 1'd0 ; */ -/*description: the pull up enable of the pad*/ -#define RTC_IO_PDAC2_RUE (BIT(27)) -#define RTC_IO_PDAC2_RUE_M (BIT(27)) -#define RTC_IO_PDAC2_RUE_V 0x1 -#define RTC_IO_PDAC2_RUE_S 27 -/* RTC_IO_PDAC2_DAC : R/W ;bitpos:[26:19] ;default: 8'd0 ; */ -/*description: PAD DAC2 control code.*/ -#define RTC_IO_PDAC2_DAC 0x000000FF -#define RTC_IO_PDAC2_DAC_M ((RTC_IO_PDAC2_DAC_V)<<(RTC_IO_PDAC2_DAC_S)) -#define RTC_IO_PDAC2_DAC_V 0xFF -#define RTC_IO_PDAC2_DAC_S 19 -/* RTC_IO_PDAC2_XPD_DAC : R/W ;bitpos:[18] ;default: 1'd0 ; */ -/*description: Power on DAC2. Usually we need to tristate PDAC1 if we power - on the DAC i.e. IE=0 OE=0 RDE=0 RUE=0*/ -#define RTC_IO_PDAC2_XPD_DAC (BIT(18)) -#define RTC_IO_PDAC2_XPD_DAC_M (BIT(18)) -#define RTC_IO_PDAC2_XPD_DAC_V 0x1 -#define RTC_IO_PDAC2_XPD_DAC_S 18 -/* RTC_IO_PDAC2_MUX_SEL : R/W ;bitpos:[17] ;default: 1'd0 ; */ -/*description: Ò1Ó select the digital function Ó0Óslection the rtc function*/ -#define RTC_IO_PDAC2_MUX_SEL (BIT(17)) -#define RTC_IO_PDAC2_MUX_SEL_M (BIT(17)) -#define RTC_IO_PDAC2_MUX_SEL_V 0x1 -#define RTC_IO_PDAC2_MUX_SEL_S 17 -/* RTC_IO_PDAC2_FUN_SEL : R/W ;bitpos:[16:15] ;default: 2'd0 ; */ -/*description: the functional selection signal of the pad*/ -#define RTC_IO_PDAC2_FUN_SEL 0x00000003 -#define RTC_IO_PDAC2_FUN_SEL_M ((RTC_IO_PDAC2_FUN_SEL_V)<<(RTC_IO_PDAC2_FUN_SEL_S)) -#define RTC_IO_PDAC2_FUN_SEL_V 0x3 -#define RTC_IO_PDAC2_FUN_SEL_S 15 -/* RTC_IO_PDAC2_SLP_SEL : R/W ;bitpos:[14] ;default: 1'd0 ; */ -/*description: the sleep status selection signal of the pad*/ -#define RTC_IO_PDAC2_SLP_SEL (BIT(14)) -#define RTC_IO_PDAC2_SLP_SEL_M (BIT(14)) -#define RTC_IO_PDAC2_SLP_SEL_V 0x1 -#define RTC_IO_PDAC2_SLP_SEL_S 14 -/* RTC_IO_PDAC2_SLP_IE : R/W ;bitpos:[13] ;default: 1'd0 ; */ -/*description: the input enable of the pad in sleep status*/ -#define RTC_IO_PDAC2_SLP_IE (BIT(13)) -#define RTC_IO_PDAC2_SLP_IE_M (BIT(13)) -#define RTC_IO_PDAC2_SLP_IE_V 0x1 -#define RTC_IO_PDAC2_SLP_IE_S 13 -/* RTC_IO_PDAC2_SLP_OE : R/W ;bitpos:[12] ;default: 1'd0 ; */ -/*description: the output enable of the pad in sleep status*/ -#define RTC_IO_PDAC2_SLP_OE (BIT(12)) -#define RTC_IO_PDAC2_SLP_OE_M (BIT(12)) -#define RTC_IO_PDAC2_SLP_OE_V 0x1 -#define RTC_IO_PDAC2_SLP_OE_S 12 -/* RTC_IO_PDAC2_FUN_IE : R/W ;bitpos:[11] ;default: 1'd0 ; */ -/*description: the input enable of the pad*/ -#define RTC_IO_PDAC2_FUN_IE (BIT(11)) -#define RTC_IO_PDAC2_FUN_IE_M (BIT(11)) -#define RTC_IO_PDAC2_FUN_IE_V 0x1 -#define RTC_IO_PDAC2_FUN_IE_S 11 -/* RTC_IO_PDAC2_DAC_XPD_FORCE : R/W ;bitpos:[10] ;default: 1'd0 ; */ -/*description: Power on DAC2. Usually we need to tristate PDAC2 if we power - on the DAC i.e. IE=0 OE=0 RDE=0 RUE=0*/ -#define RTC_IO_PDAC2_DAC_XPD_FORCE (BIT(10)) -#define RTC_IO_PDAC2_DAC_XPD_FORCE_M (BIT(10)) -#define RTC_IO_PDAC2_DAC_XPD_FORCE_V 0x1 -#define RTC_IO_PDAC2_DAC_XPD_FORCE_S 10 - -#define RTC_IO_XTAL_32K_PAD_REG (DR_REG_RTCIO_BASE + 0x8c) -/* RTC_IO_X32N_DRV : R/W ;bitpos:[31:30] ;default: 2'd2 ; */ -/*description: the driver strength of the pad*/ -#define RTC_IO_X32N_DRV 0x00000003 -#define RTC_IO_X32N_DRV_M ((RTC_IO_X32N_DRV_V)<<(RTC_IO_X32N_DRV_S)) -#define RTC_IO_X32N_DRV_V 0x3 -#define RTC_IO_X32N_DRV_S 30 -/* RTC_IO_X32N_HOLD : R/W ;bitpos:[29] ;default: 1'd0 ; */ -/*description: hold the current value of the output when setting the hold to Ò1Ó*/ -#define RTC_IO_X32N_HOLD (BIT(29)) -#define RTC_IO_X32N_HOLD_M (BIT(29)) -#define RTC_IO_X32N_HOLD_V 0x1 -#define RTC_IO_X32N_HOLD_S 29 -/* RTC_IO_X32N_RDE : R/W ;bitpos:[28] ;default: 1'd0 ; */ -/*description: the pull down enable of the pad*/ -#define RTC_IO_X32N_RDE (BIT(28)) -#define RTC_IO_X32N_RDE_M (BIT(28)) -#define RTC_IO_X32N_RDE_V 0x1 -#define RTC_IO_X32N_RDE_S 28 -/* RTC_IO_X32N_RUE : R/W ;bitpos:[27] ;default: 1'd0 ; */ -/*description: the pull up enable of the pad*/ -#define RTC_IO_X32N_RUE (BIT(27)) -#define RTC_IO_X32N_RUE_M (BIT(27)) -#define RTC_IO_X32N_RUE_V 0x1 -#define RTC_IO_X32N_RUE_S 27 -/* RTC_IO_X32P_DRV : R/W ;bitpos:[26:25] ;default: 2'd2 ; */ -/*description: the driver strength of the pad*/ -#define RTC_IO_X32P_DRV 0x00000003 -#define RTC_IO_X32P_DRV_M ((RTC_IO_X32P_DRV_V)<<(RTC_IO_X32P_DRV_S)) -#define RTC_IO_X32P_DRV_V 0x3 -#define RTC_IO_X32P_DRV_S 25 -/* RTC_IO_X32P_HOLD : R/W ;bitpos:[24] ;default: 1'd0 ; */ -/*description: hold the current value of the output when setting the hold to Ò1Ó*/ -#define RTC_IO_X32P_HOLD (BIT(24)) -#define RTC_IO_X32P_HOLD_M (BIT(24)) -#define RTC_IO_X32P_HOLD_V 0x1 -#define RTC_IO_X32P_HOLD_S 24 -/* RTC_IO_X32P_RDE : R/W ;bitpos:[23] ;default: 1'd0 ; */ -/*description: the pull down enable of the pad*/ -#define RTC_IO_X32P_RDE (BIT(23)) -#define RTC_IO_X32P_RDE_M (BIT(23)) -#define RTC_IO_X32P_RDE_V 0x1 -#define RTC_IO_X32P_RDE_S 23 -/* RTC_IO_X32P_RUE : R/W ;bitpos:[22] ;default: 1'd0 ; */ -/*description: the pull up enable of the pad*/ -#define RTC_IO_X32P_RUE (BIT(22)) -#define RTC_IO_X32P_RUE_M (BIT(22)) -#define RTC_IO_X32P_RUE_V 0x1 -#define RTC_IO_X32P_RUE_S 22 -/* RTC_IO_DAC_XTAL_32K : R/W ;bitpos:[21:20] ;default: 2'b01 ; */ -/*description: 32K XTAL bias current DAC.*/ -#define RTC_IO_DAC_XTAL_32K 0x00000003 -#define RTC_IO_DAC_XTAL_32K_M ((RTC_IO_DAC_XTAL_32K_V)<<(RTC_IO_DAC_XTAL_32K_S)) -#define RTC_IO_DAC_XTAL_32K_V 0x3 -#define RTC_IO_DAC_XTAL_32K_S 20 -/* RTC_IO_XPD_XTAL_32K : R/W ;bitpos:[19] ;default: 1'd0 ; */ -/*description: Power up 32kHz crystal oscillator*/ -#define RTC_IO_XPD_XTAL_32K (BIT(19)) -#define RTC_IO_XPD_XTAL_32K_M (BIT(19)) -#define RTC_IO_XPD_XTAL_32K_V 0x1 -#define RTC_IO_XPD_XTAL_32K_S 19 -/* RTC_IO_X32N_MUX_SEL : R/W ;bitpos:[18] ;default: 1'd0 ; */ -/*description: Ò1Ó select the digital function Ó0Óslection the rtc function*/ -#define RTC_IO_X32N_MUX_SEL (BIT(18)) -#define RTC_IO_X32N_MUX_SEL_M (BIT(18)) -#define RTC_IO_X32N_MUX_SEL_V 0x1 -#define RTC_IO_X32N_MUX_SEL_S 18 -/* RTC_IO_X32P_MUX_SEL : R/W ;bitpos:[17] ;default: 1'd0 ; */ -/*description: Ò1Ó select the digital function Ó0Óslection the rtc function*/ -#define RTC_IO_X32P_MUX_SEL (BIT(17)) -#define RTC_IO_X32P_MUX_SEL_M (BIT(17)) -#define RTC_IO_X32P_MUX_SEL_V 0x1 -#define RTC_IO_X32P_MUX_SEL_S 17 -/* RTC_IO_X32N_FUN_SEL : R/W ;bitpos:[16:15] ;default: 2'd0 ; */ -/*description: the functional selection signal of the pad*/ -#define RTC_IO_X32N_FUN_SEL 0x00000003 -#define RTC_IO_X32N_FUN_SEL_M ((RTC_IO_X32N_FUN_SEL_V)<<(RTC_IO_X32N_FUN_SEL_S)) -#define RTC_IO_X32N_FUN_SEL_V 0x3 -#define RTC_IO_X32N_FUN_SEL_S 15 -/* RTC_IO_X32N_SLP_SEL : R/W ;bitpos:[14] ;default: 1'd0 ; */ -/*description: the sleep status selection signal of the pad*/ -#define RTC_IO_X32N_SLP_SEL (BIT(14)) -#define RTC_IO_X32N_SLP_SEL_M (BIT(14)) -#define RTC_IO_X32N_SLP_SEL_V 0x1 -#define RTC_IO_X32N_SLP_SEL_S 14 -/* RTC_IO_X32N_SLP_IE : R/W ;bitpos:[13] ;default: 1'd0 ; */ -/*description: the input enable of the pad in sleep status*/ -#define RTC_IO_X32N_SLP_IE (BIT(13)) -#define RTC_IO_X32N_SLP_IE_M (BIT(13)) -#define RTC_IO_X32N_SLP_IE_V 0x1 -#define RTC_IO_X32N_SLP_IE_S 13 -/* RTC_IO_X32N_SLP_OE : R/W ;bitpos:[12] ;default: 1'd0 ; */ -/*description: the output enable of the pad in sleep status*/ -#define RTC_IO_X32N_SLP_OE (BIT(12)) -#define RTC_IO_X32N_SLP_OE_M (BIT(12)) -#define RTC_IO_X32N_SLP_OE_V 0x1 -#define RTC_IO_X32N_SLP_OE_S 12 -/* RTC_IO_X32N_FUN_IE : R/W ;bitpos:[11] ;default: 1'd0 ; */ -/*description: the input enable of the pad*/ -#define RTC_IO_X32N_FUN_IE (BIT(11)) -#define RTC_IO_X32N_FUN_IE_M (BIT(11)) -#define RTC_IO_X32N_FUN_IE_V 0x1 -#define RTC_IO_X32N_FUN_IE_S 11 -/* RTC_IO_X32P_FUN_SEL : R/W ;bitpos:[10:9] ;default: 2'd0 ; */ -/*description: the functional selection signal of the pad*/ -#define RTC_IO_X32P_FUN_SEL 0x00000003 -#define RTC_IO_X32P_FUN_SEL_M ((RTC_IO_X32P_FUN_SEL_V)<<(RTC_IO_X32P_FUN_SEL_S)) -#define RTC_IO_X32P_FUN_SEL_V 0x3 -#define RTC_IO_X32P_FUN_SEL_S 9 -/* RTC_IO_X32P_SLP_SEL : R/W ;bitpos:[8] ;default: 1'd0 ; */ -/*description: the sleep status selection signal of the pad*/ -#define RTC_IO_X32P_SLP_SEL (BIT(8)) -#define RTC_IO_X32P_SLP_SEL_M (BIT(8)) -#define RTC_IO_X32P_SLP_SEL_V 0x1 -#define RTC_IO_X32P_SLP_SEL_S 8 -/* RTC_IO_X32P_SLP_IE : R/W ;bitpos:[7] ;default: 1'd0 ; */ -/*description: the input enable of the pad in sleep status*/ -#define RTC_IO_X32P_SLP_IE (BIT(7)) -#define RTC_IO_X32P_SLP_IE_M (BIT(7)) -#define RTC_IO_X32P_SLP_IE_V 0x1 -#define RTC_IO_X32P_SLP_IE_S 7 -/* RTC_IO_X32P_SLP_OE : R/W ;bitpos:[6] ;default: 1'd0 ; */ -/*description: the output enable of the pad in sleep status*/ -#define RTC_IO_X32P_SLP_OE (BIT(6)) -#define RTC_IO_X32P_SLP_OE_M (BIT(6)) -#define RTC_IO_X32P_SLP_OE_V 0x1 -#define RTC_IO_X32P_SLP_OE_S 6 -/* RTC_IO_X32P_FUN_IE : R/W ;bitpos:[5] ;default: 1'd0 ; */ -/*description: the input enable of the pad*/ -#define RTC_IO_X32P_FUN_IE (BIT(5)) -#define RTC_IO_X32P_FUN_IE_M (BIT(5)) -#define RTC_IO_X32P_FUN_IE_V 0x1 -#define RTC_IO_X32P_FUN_IE_S 5 -/* RTC_IO_DRES_XTAL_32K : R/W ;bitpos:[4:3] ;default: 2'b10 ; */ -/*description: 32K XTAL resistor bias control.*/ -#define RTC_IO_DRES_XTAL_32K 0x00000003 -#define RTC_IO_DRES_XTAL_32K_M ((RTC_IO_DRES_XTAL_32K_V)<<(RTC_IO_DRES_XTAL_32K_S)) -#define RTC_IO_DRES_XTAL_32K_V 0x3 -#define RTC_IO_DRES_XTAL_32K_S 3 -/* RTC_IO_DBIAS_XTAL_32K : R/W ;bitpos:[2:1] ;default: 2'b00 ; */ -/*description: 32K XTAL self-bias reference control.*/ -#define RTC_IO_DBIAS_XTAL_32K 0x00000003 -#define RTC_IO_DBIAS_XTAL_32K_M ((RTC_IO_DBIAS_XTAL_32K_V)<<(RTC_IO_DBIAS_XTAL_32K_S)) -#define RTC_IO_DBIAS_XTAL_32K_V 0x3 -#define RTC_IO_DBIAS_XTAL_32K_S 1 - -#define RTC_IO_TOUCH_CFG_REG (DR_REG_RTCIO_BASE + 0x90) -/* RTC_IO_TOUCH_XPD_BIAS : R/W ;bitpos:[31] ;default: 1'd0 ; */ -/*description: touch sensor bias power on.*/ -#define RTC_IO_TOUCH_XPD_BIAS (BIT(31)) -#define RTC_IO_TOUCH_XPD_BIAS_M (BIT(31)) -#define RTC_IO_TOUCH_XPD_BIAS_V 0x1 -#define RTC_IO_TOUCH_XPD_BIAS_S 31 -/* RTC_IO_TOUCH_DREFH : R/W ;bitpos:[30:29] ;default: 2'b11 ; */ -/*description: touch sensor saw wave top voltage.*/ -#define RTC_IO_TOUCH_DREFH 0x00000003 -#define RTC_IO_TOUCH_DREFH_M ((RTC_IO_TOUCH_DREFH_V)<<(RTC_IO_TOUCH_DREFH_S)) -#define RTC_IO_TOUCH_DREFH_V 0x3 -#define RTC_IO_TOUCH_DREFH_S 29 -/* RTC_IO_TOUCH_DREFL : R/W ;bitpos:[28:27] ;default: 2'b00 ; */ -/*description: touch sensor saw wave bottom voltage.*/ -#define RTC_IO_TOUCH_DREFL 0x00000003 -#define RTC_IO_TOUCH_DREFL_M ((RTC_IO_TOUCH_DREFL_V)<<(RTC_IO_TOUCH_DREFL_S)) -#define RTC_IO_TOUCH_DREFL_V 0x3 -#define RTC_IO_TOUCH_DREFL_S 27 -/* RTC_IO_TOUCH_DRANGE : R/W ;bitpos:[26:25] ;default: 2'b11 ; */ -/*description: touch sensor saw wave voltage range.*/ -#define RTC_IO_TOUCH_DRANGE 0x00000003 -#define RTC_IO_TOUCH_DRANGE_M ((RTC_IO_TOUCH_DRANGE_V)<<(RTC_IO_TOUCH_DRANGE_S)) -#define RTC_IO_TOUCH_DRANGE_V 0x3 -#define RTC_IO_TOUCH_DRANGE_S 25 -/* RTC_IO_TOUCH_DCUR : R/W ;bitpos:[24:23] ;default: 2'b00 ; */ -/*description: touch sensor bias current. Should have option to tie with BIAS_SLEEP(When - BIAS_SLEEP this setting is available*/ -#define RTC_IO_TOUCH_DCUR 0x00000003 -#define RTC_IO_TOUCH_DCUR_M ((RTC_IO_TOUCH_DCUR_V)<<(RTC_IO_TOUCH_DCUR_S)) -#define RTC_IO_TOUCH_DCUR_V 0x3 -#define RTC_IO_TOUCH_DCUR_S 23 - -#define RTC_IO_TOUCH_PAD0_REG (DR_REG_RTCIO_BASE + 0x94) -/* RTC_IO_TOUCH_PAD0_HOLD : R/W ;bitpos:[31] ;default: 1'd0 ; */ -/*description: hold the current value of the output when setting the hold to Ò1Ó*/ -#define RTC_IO_TOUCH_PAD0_HOLD (BIT(31)) -#define RTC_IO_TOUCH_PAD0_HOLD_M (BIT(31)) -#define RTC_IO_TOUCH_PAD0_HOLD_V 0x1 -#define RTC_IO_TOUCH_PAD0_HOLD_S 31 -/* RTC_IO_TOUCH_PAD0_DRV : R/W ;bitpos:[30:29] ;default: 2'd2 ; */ -/*description: the driver strength of the pad*/ -#define RTC_IO_TOUCH_PAD0_DRV 0x00000003 -#define RTC_IO_TOUCH_PAD0_DRV_M ((RTC_IO_TOUCH_PAD0_DRV_V)<<(RTC_IO_TOUCH_PAD0_DRV_S)) -#define RTC_IO_TOUCH_PAD0_DRV_V 0x3 -#define RTC_IO_TOUCH_PAD0_DRV_S 29 -/* RTC_IO_TOUCH_PAD0_RDE : R/W ;bitpos:[28] ;default: 1'd1 ; */ -/*description: the pull down enable of the pad*/ -#define RTC_IO_TOUCH_PAD0_RDE (BIT(28)) -#define RTC_IO_TOUCH_PAD0_RDE_M (BIT(28)) -#define RTC_IO_TOUCH_PAD0_RDE_V 0x1 -#define RTC_IO_TOUCH_PAD0_RDE_S 28 -/* RTC_IO_TOUCH_PAD0_RUE : R/W ;bitpos:[27] ;default: 1'd0 ; */ -/*description: the pull up enable of the pad*/ -#define RTC_IO_TOUCH_PAD0_RUE (BIT(27)) -#define RTC_IO_TOUCH_PAD0_RUE_M (BIT(27)) -#define RTC_IO_TOUCH_PAD0_RUE_V 0x1 -#define RTC_IO_TOUCH_PAD0_RUE_S 27 -/* RTC_IO_TOUCH_PAD0_DAC : R/W ;bitpos:[25:23] ;default: 3'h4 ; */ -/*description: touch sensor slope control. 3-bit for each touch panel default 100.*/ -#define RTC_IO_TOUCH_PAD0_DAC 0x00000007 -#define RTC_IO_TOUCH_PAD0_DAC_M ((RTC_IO_TOUCH_PAD0_DAC_V)<<(RTC_IO_TOUCH_PAD0_DAC_S)) -#define RTC_IO_TOUCH_PAD0_DAC_V 0x7 -#define RTC_IO_TOUCH_PAD0_DAC_S 23 -/* RTC_IO_TOUCH_PAD0_START : R/W ;bitpos:[22] ;default: 1'd0 ; */ -/*description: start touch sensor.*/ -#define RTC_IO_TOUCH_PAD0_START (BIT(22)) -#define RTC_IO_TOUCH_PAD0_START_M (BIT(22)) -#define RTC_IO_TOUCH_PAD0_START_V 0x1 -#define RTC_IO_TOUCH_PAD0_START_S 22 -/* RTC_IO_TOUCH_PAD0_TIE_OPT : R/W ;bitpos:[21] ;default: 1'd0 ; */ -/*description: default touch sensor tie option. 0: tie low 1: tie high.*/ -#define RTC_IO_TOUCH_PAD0_TIE_OPT (BIT(21)) -#define RTC_IO_TOUCH_PAD0_TIE_OPT_M (BIT(21)) -#define RTC_IO_TOUCH_PAD0_TIE_OPT_V 0x1 -#define RTC_IO_TOUCH_PAD0_TIE_OPT_S 21 -/* RTC_IO_TOUCH_PAD0_XPD : R/W ;bitpos:[20] ;default: 1'd0 ; */ -/*description: touch sensor power on.*/ -#define RTC_IO_TOUCH_PAD0_XPD (BIT(20)) -#define RTC_IO_TOUCH_PAD0_XPD_M (BIT(20)) -#define RTC_IO_TOUCH_PAD0_XPD_V 0x1 -#define RTC_IO_TOUCH_PAD0_XPD_S 20 -/* RTC_IO_TOUCH_PAD0_MUX_SEL : R/W ;bitpos:[19] ;default: 1'd0 ; */ -/*description: Ò1Ó select the digital function Ó0Óslection the rtc function*/ -#define RTC_IO_TOUCH_PAD0_MUX_SEL (BIT(19)) -#define RTC_IO_TOUCH_PAD0_MUX_SEL_M (BIT(19)) -#define RTC_IO_TOUCH_PAD0_MUX_SEL_V 0x1 -#define RTC_IO_TOUCH_PAD0_MUX_SEL_S 19 -/* RTC_IO_TOUCH_PAD0_FUN_SEL : R/W ;bitpos:[18:17] ;default: 2'd0 ; */ -/*description: the functional selection signal of the pad*/ -#define RTC_IO_TOUCH_PAD0_FUN_SEL 0x00000003 -#define RTC_IO_TOUCH_PAD0_FUN_SEL_M ((RTC_IO_TOUCH_PAD0_FUN_SEL_V)<<(RTC_IO_TOUCH_PAD0_FUN_SEL_S)) -#define RTC_IO_TOUCH_PAD0_FUN_SEL_V 0x3 -#define RTC_IO_TOUCH_PAD0_FUN_SEL_S 17 -/* RTC_IO_TOUCH_PAD0_SLP_SEL : R/W ;bitpos:[16] ;default: 1'd0 ; */ -/*description: the sleep status selection signal of the pad*/ -#define RTC_IO_TOUCH_PAD0_SLP_SEL (BIT(16)) -#define RTC_IO_TOUCH_PAD0_SLP_SEL_M (BIT(16)) -#define RTC_IO_TOUCH_PAD0_SLP_SEL_V 0x1 -#define RTC_IO_TOUCH_PAD0_SLP_SEL_S 16 -/* RTC_IO_TOUCH_PAD0_SLP_IE : R/W ;bitpos:[15] ;default: 1'd0 ; */ -/*description: the input enable of the pad in sleep status*/ -#define RTC_IO_TOUCH_PAD0_SLP_IE (BIT(15)) -#define RTC_IO_TOUCH_PAD0_SLP_IE_M (BIT(15)) -#define RTC_IO_TOUCH_PAD0_SLP_IE_V 0x1 -#define RTC_IO_TOUCH_PAD0_SLP_IE_S 15 -/* RTC_IO_TOUCH_PAD0_SLP_OE : R/W ;bitpos:[14] ;default: 1'd0 ; */ -/*description: the output enable of the pad in sleep status*/ -#define RTC_IO_TOUCH_PAD0_SLP_OE (BIT(14)) -#define RTC_IO_TOUCH_PAD0_SLP_OE_M (BIT(14)) -#define RTC_IO_TOUCH_PAD0_SLP_OE_V 0x1 -#define RTC_IO_TOUCH_PAD0_SLP_OE_S 14 -/* RTC_IO_TOUCH_PAD0_FUN_IE : R/W ;bitpos:[13] ;default: 1'd0 ; */ -/*description: the input enable of the pad*/ -#define RTC_IO_TOUCH_PAD0_FUN_IE (BIT(13)) -#define RTC_IO_TOUCH_PAD0_FUN_IE_M (BIT(13)) -#define RTC_IO_TOUCH_PAD0_FUN_IE_V 0x1 -#define RTC_IO_TOUCH_PAD0_FUN_IE_S 13 -/* RTC_IO_TOUCH_PAD0_TO_GPIO : R/W ;bitpos:[12] ;default: 1'd0 ; */ -/*description: connect the rtc pad input to digital pad input Ó0Ó is availbale GPIO4*/ -#define RTC_IO_TOUCH_PAD0_TO_GPIO (BIT(12)) -#define RTC_IO_TOUCH_PAD0_TO_GPIO_M (BIT(12)) -#define RTC_IO_TOUCH_PAD0_TO_GPIO_V 0x1 -#define RTC_IO_TOUCH_PAD0_TO_GPIO_S 12 - -#define RTC_IO_TOUCH_PAD1_REG (DR_REG_RTCIO_BASE + 0x98) -/* RTC_IO_TOUCH_PAD1_HOLD : R/W ;bitpos:[31] ;default: 1'd0 ; */ -/*description: */ -#define RTC_IO_TOUCH_PAD1_HOLD (BIT(31)) -#define RTC_IO_TOUCH_PAD1_HOLD_M (BIT(31)) -#define RTC_IO_TOUCH_PAD1_HOLD_V 0x1 -#define RTC_IO_TOUCH_PAD1_HOLD_S 31 -/* RTC_IO_TOUCH_PAD1_DRV : R/W ;bitpos:[30:29] ;default: 2'd2 ; */ -/*description: the driver strength of the pad*/ -#define RTC_IO_TOUCH_PAD1_DRV 0x00000003 -#define RTC_IO_TOUCH_PAD1_DRV_M ((RTC_IO_TOUCH_PAD1_DRV_V)<<(RTC_IO_TOUCH_PAD1_DRV_S)) -#define RTC_IO_TOUCH_PAD1_DRV_V 0x3 -#define RTC_IO_TOUCH_PAD1_DRV_S 29 -/* RTC_IO_TOUCH_PAD1_RDE : R/W ;bitpos:[28] ;default: 1'd0 ; */ -/*description: the pull down enable of the pad*/ -#define RTC_IO_TOUCH_PAD1_RDE (BIT(28)) -#define RTC_IO_TOUCH_PAD1_RDE_M (BIT(28)) -#define RTC_IO_TOUCH_PAD1_RDE_V 0x1 -#define RTC_IO_TOUCH_PAD1_RDE_S 28 -/* RTC_IO_TOUCH_PAD1_RUE : R/W ;bitpos:[27] ;default: 1'd1 ; */ -/*description: the pull up enable of the pad*/ -#define RTC_IO_TOUCH_PAD1_RUE (BIT(27)) -#define RTC_IO_TOUCH_PAD1_RUE_M (BIT(27)) -#define RTC_IO_TOUCH_PAD1_RUE_V 0x1 -#define RTC_IO_TOUCH_PAD1_RUE_S 27 -/* RTC_IO_TOUCH_PAD1_DAC : R/W ;bitpos:[25:23] ;default: 3'h4 ; */ -/*description: touch sensor slope control. 3-bit for each touch panel default 100.*/ -#define RTC_IO_TOUCH_PAD1_DAC 0x00000007 -#define RTC_IO_TOUCH_PAD1_DAC_M ((RTC_IO_TOUCH_PAD1_DAC_V)<<(RTC_IO_TOUCH_PAD1_DAC_S)) -#define RTC_IO_TOUCH_PAD1_DAC_V 0x7 -#define RTC_IO_TOUCH_PAD1_DAC_S 23 -/* RTC_IO_TOUCH_PAD1_START : R/W ;bitpos:[22] ;default: 1'd0 ; */ -/*description: start touch sensor.*/ -#define RTC_IO_TOUCH_PAD1_START (BIT(22)) -#define RTC_IO_TOUCH_PAD1_START_M (BIT(22)) -#define RTC_IO_TOUCH_PAD1_START_V 0x1 -#define RTC_IO_TOUCH_PAD1_START_S 22 -/* RTC_IO_TOUCH_PAD1_TIE_OPT : R/W ;bitpos:[21] ;default: 1'd0 ; */ -/*description: default touch sensor tie option. 0: tie low 1: tie high.*/ -#define RTC_IO_TOUCH_PAD1_TIE_OPT (BIT(21)) -#define RTC_IO_TOUCH_PAD1_TIE_OPT_M (BIT(21)) -#define RTC_IO_TOUCH_PAD1_TIE_OPT_V 0x1 -#define RTC_IO_TOUCH_PAD1_TIE_OPT_S 21 -/* RTC_IO_TOUCH_PAD1_XPD : R/W ;bitpos:[20] ;default: 1'd0 ; */ -/*description: touch sensor power on.*/ -#define RTC_IO_TOUCH_PAD1_XPD (BIT(20)) -#define RTC_IO_TOUCH_PAD1_XPD_M (BIT(20)) -#define RTC_IO_TOUCH_PAD1_XPD_V 0x1 -#define RTC_IO_TOUCH_PAD1_XPD_S 20 -/* RTC_IO_TOUCH_PAD1_MUX_SEL : R/W ;bitpos:[19] ;default: 1'd0 ; */ -/*description: Ò1Ó select the digital function Ó0Óslection the rtc function*/ -#define RTC_IO_TOUCH_PAD1_MUX_SEL (BIT(19)) -#define RTC_IO_TOUCH_PAD1_MUX_SEL_M (BIT(19)) -#define RTC_IO_TOUCH_PAD1_MUX_SEL_V 0x1 -#define RTC_IO_TOUCH_PAD1_MUX_SEL_S 19 -/* RTC_IO_TOUCH_PAD1_FUN_SEL : R/W ;bitpos:[18:17] ;default: 2'd0 ; */ -/*description: the functional selection signal of the pad*/ -#define RTC_IO_TOUCH_PAD1_FUN_SEL 0x00000003 -#define RTC_IO_TOUCH_PAD1_FUN_SEL_M ((RTC_IO_TOUCH_PAD1_FUN_SEL_V)<<(RTC_IO_TOUCH_PAD1_FUN_SEL_S)) -#define RTC_IO_TOUCH_PAD1_FUN_SEL_V 0x3 -#define RTC_IO_TOUCH_PAD1_FUN_SEL_S 17 -/* RTC_IO_TOUCH_PAD1_SLP_SEL : R/W ;bitpos:[16] ;default: 1'd0 ; */ -/*description: the sleep status selection signal of the pad*/ -#define RTC_IO_TOUCH_PAD1_SLP_SEL (BIT(16)) -#define RTC_IO_TOUCH_PAD1_SLP_SEL_M (BIT(16)) -#define RTC_IO_TOUCH_PAD1_SLP_SEL_V 0x1 -#define RTC_IO_TOUCH_PAD1_SLP_SEL_S 16 -/* RTC_IO_TOUCH_PAD1_SLP_IE : R/W ;bitpos:[15] ;default: 1'd0 ; */ -/*description: the input enable of the pad in sleep status*/ -#define RTC_IO_TOUCH_PAD1_SLP_IE (BIT(15)) -#define RTC_IO_TOUCH_PAD1_SLP_IE_M (BIT(15)) -#define RTC_IO_TOUCH_PAD1_SLP_IE_V 0x1 -#define RTC_IO_TOUCH_PAD1_SLP_IE_S 15 -/* RTC_IO_TOUCH_PAD1_SLP_OE : R/W ;bitpos:[14] ;default: 1'd0 ; */ -/*description: the output enable of the pad in sleep status*/ -#define RTC_IO_TOUCH_PAD1_SLP_OE (BIT(14)) -#define RTC_IO_TOUCH_PAD1_SLP_OE_M (BIT(14)) -#define RTC_IO_TOUCH_PAD1_SLP_OE_V 0x1 -#define RTC_IO_TOUCH_PAD1_SLP_OE_S 14 -/* RTC_IO_TOUCH_PAD1_FUN_IE : R/W ;bitpos:[13] ;default: 1'd0 ; */ -/*description: the input enable of the pad*/ -#define RTC_IO_TOUCH_PAD1_FUN_IE (BIT(13)) -#define RTC_IO_TOUCH_PAD1_FUN_IE_M (BIT(13)) -#define RTC_IO_TOUCH_PAD1_FUN_IE_V 0x1 -#define RTC_IO_TOUCH_PAD1_FUN_IE_S 13 -/* RTC_IO_TOUCH_PAD1_TO_GPIO : R/W ;bitpos:[12] ;default: 1'd0 ; */ -/*description: connect the rtc pad input to digital pad input Ó0Ó is availbale.GPIO0*/ -#define RTC_IO_TOUCH_PAD1_TO_GPIO (BIT(12)) -#define RTC_IO_TOUCH_PAD1_TO_GPIO_M (BIT(12)) -#define RTC_IO_TOUCH_PAD1_TO_GPIO_V 0x1 -#define RTC_IO_TOUCH_PAD1_TO_GPIO_S 12 - -#define RTC_IO_TOUCH_PAD2_REG (DR_REG_RTCIO_BASE + 0x9c) -/* RTC_IO_TOUCH_PAD2_HOLD : R/W ;bitpos:[31] ;default: 1'd0 ; */ -/*description: hold the current value of the output when setting the hold to Ò1Ó*/ -#define RTC_IO_TOUCH_PAD2_HOLD (BIT(31)) -#define RTC_IO_TOUCH_PAD2_HOLD_M (BIT(31)) -#define RTC_IO_TOUCH_PAD2_HOLD_V 0x1 -#define RTC_IO_TOUCH_PAD2_HOLD_S 31 -/* RTC_IO_TOUCH_PAD2_DRV : R/W ;bitpos:[30:29] ;default: 2'd2 ; */ -/*description: the driver strength of the pad*/ -#define RTC_IO_TOUCH_PAD2_DRV 0x00000003 -#define RTC_IO_TOUCH_PAD2_DRV_M ((RTC_IO_TOUCH_PAD2_DRV_V)<<(RTC_IO_TOUCH_PAD2_DRV_S)) -#define RTC_IO_TOUCH_PAD2_DRV_V 0x3 -#define RTC_IO_TOUCH_PAD2_DRV_S 29 -/* RTC_IO_TOUCH_PAD2_RDE : R/W ;bitpos:[28] ;default: 1'd1 ; */ -/*description: the pull down enable of the pad*/ -#define RTC_IO_TOUCH_PAD2_RDE (BIT(28)) -#define RTC_IO_TOUCH_PAD2_RDE_M (BIT(28)) -#define RTC_IO_TOUCH_PAD2_RDE_V 0x1 -#define RTC_IO_TOUCH_PAD2_RDE_S 28 -/* RTC_IO_TOUCH_PAD2_RUE : R/W ;bitpos:[27] ;default: 1'd0 ; */ -/*description: the pull up enable of the pad*/ -#define RTC_IO_TOUCH_PAD2_RUE (BIT(27)) -#define RTC_IO_TOUCH_PAD2_RUE_M (BIT(27)) -#define RTC_IO_TOUCH_PAD2_RUE_V 0x1 -#define RTC_IO_TOUCH_PAD2_RUE_S 27 -/* RTC_IO_TOUCH_PAD2_DAC : R/W ;bitpos:[25:23] ;default: 3'h4 ; */ -/*description: touch sensor slope control. 3-bit for each touch panel default 100.*/ -#define RTC_IO_TOUCH_PAD2_DAC 0x00000007 -#define RTC_IO_TOUCH_PAD2_DAC_M ((RTC_IO_TOUCH_PAD2_DAC_V)<<(RTC_IO_TOUCH_PAD2_DAC_S)) -#define RTC_IO_TOUCH_PAD2_DAC_V 0x7 -#define RTC_IO_TOUCH_PAD2_DAC_S 23 -/* RTC_IO_TOUCH_PAD2_START : R/W ;bitpos:[22] ;default: 1'd0 ; */ -/*description: start touch sensor.*/ -#define RTC_IO_TOUCH_PAD2_START (BIT(22)) -#define RTC_IO_TOUCH_PAD2_START_M (BIT(22)) -#define RTC_IO_TOUCH_PAD2_START_V 0x1 -#define RTC_IO_TOUCH_PAD2_START_S 22 -/* RTC_IO_TOUCH_PAD2_TIE_OPT : R/W ;bitpos:[21] ;default: 1'd0 ; */ -/*description: default touch sensor tie option. 0: tie low 1: tie high.*/ -#define RTC_IO_TOUCH_PAD2_TIE_OPT (BIT(21)) -#define RTC_IO_TOUCH_PAD2_TIE_OPT_M (BIT(21)) -#define RTC_IO_TOUCH_PAD2_TIE_OPT_V 0x1 -#define RTC_IO_TOUCH_PAD2_TIE_OPT_S 21 -/* RTC_IO_TOUCH_PAD2_XPD : R/W ;bitpos:[20] ;default: 1'd0 ; */ -/*description: touch sensor power on.*/ -#define RTC_IO_TOUCH_PAD2_XPD (BIT(20)) -#define RTC_IO_TOUCH_PAD2_XPD_M (BIT(20)) -#define RTC_IO_TOUCH_PAD2_XPD_V 0x1 -#define RTC_IO_TOUCH_PAD2_XPD_S 20 -/* RTC_IO_TOUCH_PAD2_MUX_SEL : R/W ;bitpos:[19] ;default: 1'd0 ; */ -/*description: Ò1Ó select the digital function Ó0Óslection the rtc function*/ -#define RTC_IO_TOUCH_PAD2_MUX_SEL (BIT(19)) -#define RTC_IO_TOUCH_PAD2_MUX_SEL_M (BIT(19)) -#define RTC_IO_TOUCH_PAD2_MUX_SEL_V 0x1 -#define RTC_IO_TOUCH_PAD2_MUX_SEL_S 19 -/* RTC_IO_TOUCH_PAD2_FUN_SEL : R/W ;bitpos:[18:17] ;default: 2'd0 ; */ -/*description: the functional selection signal of the pad*/ -#define RTC_IO_TOUCH_PAD2_FUN_SEL 0x00000003 -#define RTC_IO_TOUCH_PAD2_FUN_SEL_M ((RTC_IO_TOUCH_PAD2_FUN_SEL_V)<<(RTC_IO_TOUCH_PAD2_FUN_SEL_S)) -#define RTC_IO_TOUCH_PAD2_FUN_SEL_V 0x3 -#define RTC_IO_TOUCH_PAD2_FUN_SEL_S 17 -/* RTC_IO_TOUCH_PAD2_SLP_SEL : R/W ;bitpos:[16] ;default: 1'd0 ; */ -/*description: the sleep status selection signal of the pad*/ -#define RTC_IO_TOUCH_PAD2_SLP_SEL (BIT(16)) -#define RTC_IO_TOUCH_PAD2_SLP_SEL_M (BIT(16)) -#define RTC_IO_TOUCH_PAD2_SLP_SEL_V 0x1 -#define RTC_IO_TOUCH_PAD2_SLP_SEL_S 16 -/* RTC_IO_TOUCH_PAD2_SLP_IE : R/W ;bitpos:[15] ;default: 1'd0 ; */ -/*description: the input enable of the pad in sleep status*/ -#define RTC_IO_TOUCH_PAD2_SLP_IE (BIT(15)) -#define RTC_IO_TOUCH_PAD2_SLP_IE_M (BIT(15)) -#define RTC_IO_TOUCH_PAD2_SLP_IE_V 0x1 -#define RTC_IO_TOUCH_PAD2_SLP_IE_S 15 -/* RTC_IO_TOUCH_PAD2_SLP_OE : R/W ;bitpos:[14] ;default: 1'd0 ; */ -/*description: the output enable of the pad in sleep status*/ -#define RTC_IO_TOUCH_PAD2_SLP_OE (BIT(14)) -#define RTC_IO_TOUCH_PAD2_SLP_OE_M (BIT(14)) -#define RTC_IO_TOUCH_PAD2_SLP_OE_V 0x1 -#define RTC_IO_TOUCH_PAD2_SLP_OE_S 14 -/* RTC_IO_TOUCH_PAD2_FUN_IE : R/W ;bitpos:[13] ;default: 1'd0 ; */ -/*description: the input enable of the pad*/ -#define RTC_IO_TOUCH_PAD2_FUN_IE (BIT(13)) -#define RTC_IO_TOUCH_PAD2_FUN_IE_M (BIT(13)) -#define RTC_IO_TOUCH_PAD2_FUN_IE_V 0x1 -#define RTC_IO_TOUCH_PAD2_FUN_IE_S 13 -/* RTC_IO_TOUCH_PAD2_TO_GPIO : R/W ;bitpos:[12] ;default: 1'd0 ; */ -/*description: connect the rtc pad input to digital pad input Ó0Ó is availbale.GPIO2*/ -#define RTC_IO_TOUCH_PAD2_TO_GPIO (BIT(12)) -#define RTC_IO_TOUCH_PAD2_TO_GPIO_M (BIT(12)) -#define RTC_IO_TOUCH_PAD2_TO_GPIO_V 0x1 -#define RTC_IO_TOUCH_PAD2_TO_GPIO_S 12 - -#define RTC_IO_TOUCH_PAD3_REG (DR_REG_RTCIO_BASE + 0xa0) -/* RTC_IO_TOUCH_PAD3_HOLD : R/W ;bitpos:[31] ;default: 1'd0 ; */ -/*description: hold the current value of the output when setting the hold to Ò1Ó*/ -#define RTC_IO_TOUCH_PAD3_HOLD (BIT(31)) -#define RTC_IO_TOUCH_PAD3_HOLD_M (BIT(31)) -#define RTC_IO_TOUCH_PAD3_HOLD_V 0x1 -#define RTC_IO_TOUCH_PAD3_HOLD_S 31 -/* RTC_IO_TOUCH_PAD3_DRV : R/W ;bitpos:[30:29] ;default: 2'd2 ; */ -/*description: the driver strength of the pad*/ -#define RTC_IO_TOUCH_PAD3_DRV 0x00000003 -#define RTC_IO_TOUCH_PAD3_DRV_M ((RTC_IO_TOUCH_PAD3_DRV_V)<<(RTC_IO_TOUCH_PAD3_DRV_S)) -#define RTC_IO_TOUCH_PAD3_DRV_V 0x3 -#define RTC_IO_TOUCH_PAD3_DRV_S 29 -/* RTC_IO_TOUCH_PAD3_RDE : R/W ;bitpos:[28] ;default: 1'd0 ; */ -/*description: the pull down enable of the pad*/ -#define RTC_IO_TOUCH_PAD3_RDE (BIT(28)) -#define RTC_IO_TOUCH_PAD3_RDE_M (BIT(28)) -#define RTC_IO_TOUCH_PAD3_RDE_V 0x1 -#define RTC_IO_TOUCH_PAD3_RDE_S 28 -/* RTC_IO_TOUCH_PAD3_RUE : R/W ;bitpos:[27] ;default: 1'd1 ; */ -/*description: the pull up enable of the pad*/ -#define RTC_IO_TOUCH_PAD3_RUE (BIT(27)) -#define RTC_IO_TOUCH_PAD3_RUE_M (BIT(27)) -#define RTC_IO_TOUCH_PAD3_RUE_V 0x1 -#define RTC_IO_TOUCH_PAD3_RUE_S 27 -/* RTC_IO_TOUCH_PAD3_DAC : R/W ;bitpos:[25:23] ;default: 3'h4 ; */ -/*description: touch sensor slope control. 3-bit for each touch panel default 100.*/ -#define RTC_IO_TOUCH_PAD3_DAC 0x00000007 -#define RTC_IO_TOUCH_PAD3_DAC_M ((RTC_IO_TOUCH_PAD3_DAC_V)<<(RTC_IO_TOUCH_PAD3_DAC_S)) -#define RTC_IO_TOUCH_PAD3_DAC_V 0x7 -#define RTC_IO_TOUCH_PAD3_DAC_S 23 -/* RTC_IO_TOUCH_PAD3_START : R/W ;bitpos:[22] ;default: 1'd0 ; */ -/*description: start touch sensor.*/ -#define RTC_IO_TOUCH_PAD3_START (BIT(22)) -#define RTC_IO_TOUCH_PAD3_START_M (BIT(22)) -#define RTC_IO_TOUCH_PAD3_START_V 0x1 -#define RTC_IO_TOUCH_PAD3_START_S 22 -/* RTC_IO_TOUCH_PAD3_TIE_OPT : R/W ;bitpos:[21] ;default: 1'd0 ; */ -/*description: default touch sensor tie option. 0: tie low 1: tie high.*/ -#define RTC_IO_TOUCH_PAD3_TIE_OPT (BIT(21)) -#define RTC_IO_TOUCH_PAD3_TIE_OPT_M (BIT(21)) -#define RTC_IO_TOUCH_PAD3_TIE_OPT_V 0x1 -#define RTC_IO_TOUCH_PAD3_TIE_OPT_S 21 -/* RTC_IO_TOUCH_PAD3_XPD : R/W ;bitpos:[20] ;default: 1'd0 ; */ -/*description: touch sensor power on.*/ -#define RTC_IO_TOUCH_PAD3_XPD (BIT(20)) -#define RTC_IO_TOUCH_PAD3_XPD_M (BIT(20)) -#define RTC_IO_TOUCH_PAD3_XPD_V 0x1 -#define RTC_IO_TOUCH_PAD3_XPD_S 20 -/* RTC_IO_TOUCH_PAD3_MUX_SEL : R/W ;bitpos:[19] ;default: 1'd0 ; */ -/*description: Ò1Ó select the digital function Ó0Óslection the rtc function*/ -#define RTC_IO_TOUCH_PAD3_MUX_SEL (BIT(19)) -#define RTC_IO_TOUCH_PAD3_MUX_SEL_M (BIT(19)) -#define RTC_IO_TOUCH_PAD3_MUX_SEL_V 0x1 -#define RTC_IO_TOUCH_PAD3_MUX_SEL_S 19 -/* RTC_IO_TOUCH_PAD3_FUN_SEL : R/W ;bitpos:[18:17] ;default: 2'd0 ; */ -/*description: the functional selection signal of the pad*/ -#define RTC_IO_TOUCH_PAD3_FUN_SEL 0x00000003 -#define RTC_IO_TOUCH_PAD3_FUN_SEL_M ((RTC_IO_TOUCH_PAD3_FUN_SEL_V)<<(RTC_IO_TOUCH_PAD3_FUN_SEL_S)) -#define RTC_IO_TOUCH_PAD3_FUN_SEL_V 0x3 -#define RTC_IO_TOUCH_PAD3_FUN_SEL_S 17 -/* RTC_IO_TOUCH_PAD3_SLP_SEL : R/W ;bitpos:[16] ;default: 1'd0 ; */ -/*description: the sleep status selection signal of the pad*/ -#define RTC_IO_TOUCH_PAD3_SLP_SEL (BIT(16)) -#define RTC_IO_TOUCH_PAD3_SLP_SEL_M (BIT(16)) -#define RTC_IO_TOUCH_PAD3_SLP_SEL_V 0x1 -#define RTC_IO_TOUCH_PAD3_SLP_SEL_S 16 -/* RTC_IO_TOUCH_PAD3_SLP_IE : R/W ;bitpos:[15] ;default: 1'd0 ; */ -/*description: the input enable of the pad in sleep status*/ -#define RTC_IO_TOUCH_PAD3_SLP_IE (BIT(15)) -#define RTC_IO_TOUCH_PAD3_SLP_IE_M (BIT(15)) -#define RTC_IO_TOUCH_PAD3_SLP_IE_V 0x1 -#define RTC_IO_TOUCH_PAD3_SLP_IE_S 15 -/* RTC_IO_TOUCH_PAD3_SLP_OE : R/W ;bitpos:[14] ;default: 1'd0 ; */ -/*description: the output enable of the pad in sleep status*/ -#define RTC_IO_TOUCH_PAD3_SLP_OE (BIT(14)) -#define RTC_IO_TOUCH_PAD3_SLP_OE_M (BIT(14)) -#define RTC_IO_TOUCH_PAD3_SLP_OE_V 0x1 -#define RTC_IO_TOUCH_PAD3_SLP_OE_S 14 -/* RTC_IO_TOUCH_PAD3_FUN_IE : R/W ;bitpos:[13] ;default: 1'd0 ; */ -/*description: the input enable of the pad*/ -#define RTC_IO_TOUCH_PAD3_FUN_IE (BIT(13)) -#define RTC_IO_TOUCH_PAD3_FUN_IE_M (BIT(13)) -#define RTC_IO_TOUCH_PAD3_FUN_IE_V 0x1 -#define RTC_IO_TOUCH_PAD3_FUN_IE_S 13 -/* RTC_IO_TOUCH_PAD3_TO_GPIO : R/W ;bitpos:[12] ;default: 1'd0 ; */ -/*description: connect the rtc pad input to digital pad input Ó0Ó is availbale.MTDO*/ -#define RTC_IO_TOUCH_PAD3_TO_GPIO (BIT(12)) -#define RTC_IO_TOUCH_PAD3_TO_GPIO_M (BIT(12)) -#define RTC_IO_TOUCH_PAD3_TO_GPIO_V 0x1 -#define RTC_IO_TOUCH_PAD3_TO_GPIO_S 12 - -#define RTC_IO_TOUCH_PAD4_REG (DR_REG_RTCIO_BASE + 0xa4) -/* RTC_IO_TOUCH_PAD4_HOLD : R/W ;bitpos:[31] ;default: 1'd0 ; */ -/*description: hold the current value of the output when setting the hold to Ò1Ó*/ -#define RTC_IO_TOUCH_PAD4_HOLD (BIT(31)) -#define RTC_IO_TOUCH_PAD4_HOLD_M (BIT(31)) -#define RTC_IO_TOUCH_PAD4_HOLD_V 0x1 -#define RTC_IO_TOUCH_PAD4_HOLD_S 31 -/* RTC_IO_TOUCH_PAD4_DRV : R/W ;bitpos:[30:29] ;default: 2'd2 ; */ -/*description: the driver strength of the pad*/ -#define RTC_IO_TOUCH_PAD4_DRV 0x00000003 -#define RTC_IO_TOUCH_PAD4_DRV_M ((RTC_IO_TOUCH_PAD4_DRV_V)<<(RTC_IO_TOUCH_PAD4_DRV_S)) -#define RTC_IO_TOUCH_PAD4_DRV_V 0x3 -#define RTC_IO_TOUCH_PAD4_DRV_S 29 -/* RTC_IO_TOUCH_PAD4_RDE : R/W ;bitpos:[28] ;default: 1'd1 ; */ -/*description: the pull down enable of the pad*/ -#define RTC_IO_TOUCH_PAD4_RDE (BIT(28)) -#define RTC_IO_TOUCH_PAD4_RDE_M (BIT(28)) -#define RTC_IO_TOUCH_PAD4_RDE_V 0x1 -#define RTC_IO_TOUCH_PAD4_RDE_S 28 -/* RTC_IO_TOUCH_PAD4_RUE : R/W ;bitpos:[27] ;default: 1'd0 ; */ -/*description: the pull up enable of the pad*/ -#define RTC_IO_TOUCH_PAD4_RUE (BIT(27)) -#define RTC_IO_TOUCH_PAD4_RUE_M (BIT(27)) -#define RTC_IO_TOUCH_PAD4_RUE_V 0x1 -#define RTC_IO_TOUCH_PAD4_RUE_S 27 -/* RTC_IO_TOUCH_PAD4_DAC : R/W ;bitpos:[25:23] ;default: 3'h4 ; */ -/*description: touch sensor slope control. 3-bit for each touch panel default 100.*/ -#define RTC_IO_TOUCH_PAD4_DAC 0x00000007 -#define RTC_IO_TOUCH_PAD4_DAC_M ((RTC_IO_TOUCH_PAD4_DAC_V)<<(RTC_IO_TOUCH_PAD4_DAC_S)) -#define RTC_IO_TOUCH_PAD4_DAC_V 0x7 -#define RTC_IO_TOUCH_PAD4_DAC_S 23 -/* RTC_IO_TOUCH_PAD4_START : R/W ;bitpos:[22] ;default: 1'd0 ; */ -/*description: start touch sensor.*/ -#define RTC_IO_TOUCH_PAD4_START (BIT(22)) -#define RTC_IO_TOUCH_PAD4_START_M (BIT(22)) -#define RTC_IO_TOUCH_PAD4_START_V 0x1 -#define RTC_IO_TOUCH_PAD4_START_S 22 -/* RTC_IO_TOUCH_PAD4_TIE_OPT : R/W ;bitpos:[21] ;default: 1'd0 ; */ -/*description: default touch sensor tie option. 0: tie low 1: tie high.*/ -#define RTC_IO_TOUCH_PAD4_TIE_OPT (BIT(21)) -#define RTC_IO_TOUCH_PAD4_TIE_OPT_M (BIT(21)) -#define RTC_IO_TOUCH_PAD4_TIE_OPT_V 0x1 -#define RTC_IO_TOUCH_PAD4_TIE_OPT_S 21 -/* RTC_IO_TOUCH_PAD4_XPD : R/W ;bitpos:[20] ;default: 1'd0 ; */ -/*description: touch sensor power on.*/ -#define RTC_IO_TOUCH_PAD4_XPD (BIT(20)) -#define RTC_IO_TOUCH_PAD4_XPD_M (BIT(20)) -#define RTC_IO_TOUCH_PAD4_XPD_V 0x1 -#define RTC_IO_TOUCH_PAD4_XPD_S 20 -/* RTC_IO_TOUCH_PAD4_MUX_SEL : R/W ;bitpos:[19] ;default: 1'd0 ; */ -/*description: Ò1Ó select the digital function Ó0Óslection the rtc function*/ -#define RTC_IO_TOUCH_PAD4_MUX_SEL (BIT(19)) -#define RTC_IO_TOUCH_PAD4_MUX_SEL_M (BIT(19)) -#define RTC_IO_TOUCH_PAD4_MUX_SEL_V 0x1 -#define RTC_IO_TOUCH_PAD4_MUX_SEL_S 19 -/* RTC_IO_TOUCH_PAD4_FUN_SEL : R/W ;bitpos:[18:17] ;default: 2'd0 ; */ -/*description: the functional selection signal of the pad*/ -#define RTC_IO_TOUCH_PAD4_FUN_SEL 0x00000003 -#define RTC_IO_TOUCH_PAD4_FUN_SEL_M ((RTC_IO_TOUCH_PAD4_FUN_SEL_V)<<(RTC_IO_TOUCH_PAD4_FUN_SEL_S)) -#define RTC_IO_TOUCH_PAD4_FUN_SEL_V 0x3 -#define RTC_IO_TOUCH_PAD4_FUN_SEL_S 17 -/* RTC_IO_TOUCH_PAD4_SLP_SEL : R/W ;bitpos:[16] ;default: 1'd0 ; */ -/*description: the sleep status selection signal of the pad*/ -#define RTC_IO_TOUCH_PAD4_SLP_SEL (BIT(16)) -#define RTC_IO_TOUCH_PAD4_SLP_SEL_M (BIT(16)) -#define RTC_IO_TOUCH_PAD4_SLP_SEL_V 0x1 -#define RTC_IO_TOUCH_PAD4_SLP_SEL_S 16 -/* RTC_IO_TOUCH_PAD4_SLP_IE : R/W ;bitpos:[15] ;default: 1'd0 ; */ -/*description: the input enable of the pad in sleep status*/ -#define RTC_IO_TOUCH_PAD4_SLP_IE (BIT(15)) -#define RTC_IO_TOUCH_PAD4_SLP_IE_M (BIT(15)) -#define RTC_IO_TOUCH_PAD4_SLP_IE_V 0x1 -#define RTC_IO_TOUCH_PAD4_SLP_IE_S 15 -/* RTC_IO_TOUCH_PAD4_SLP_OE : R/W ;bitpos:[14] ;default: 1'd0 ; */ -/*description: the output enable of the pad in sleep status*/ -#define RTC_IO_TOUCH_PAD4_SLP_OE (BIT(14)) -#define RTC_IO_TOUCH_PAD4_SLP_OE_M (BIT(14)) -#define RTC_IO_TOUCH_PAD4_SLP_OE_V 0x1 -#define RTC_IO_TOUCH_PAD4_SLP_OE_S 14 -/* RTC_IO_TOUCH_PAD4_FUN_IE : R/W ;bitpos:[13] ;default: 1'd0 ; */ -/*description: the input enable of the pad*/ -#define RTC_IO_TOUCH_PAD4_FUN_IE (BIT(13)) -#define RTC_IO_TOUCH_PAD4_FUN_IE_M (BIT(13)) -#define RTC_IO_TOUCH_PAD4_FUN_IE_V 0x1 -#define RTC_IO_TOUCH_PAD4_FUN_IE_S 13 -/* RTC_IO_TOUCH_PAD4_TO_GPIO : R/W ;bitpos:[12] ;default: 1'd0 ; */ -/*description: connect the rtc pad input to digital pad input Ó0Ó is availbale.MTCK*/ -#define RTC_IO_TOUCH_PAD4_TO_GPIO (BIT(12)) -#define RTC_IO_TOUCH_PAD4_TO_GPIO_M (BIT(12)) -#define RTC_IO_TOUCH_PAD4_TO_GPIO_V 0x1 -#define RTC_IO_TOUCH_PAD4_TO_GPIO_S 12 - -#define RTC_IO_TOUCH_PAD5_REG (DR_REG_RTCIO_BASE + 0xa8) -/* RTC_IO_TOUCH_PAD5_HOLD : R/W ;bitpos:[31] ;default: 1'd0 ; */ -/*description: hold the current value of the output when setting the hold to Ò1Ó*/ -#define RTC_IO_TOUCH_PAD5_HOLD (BIT(31)) -#define RTC_IO_TOUCH_PAD5_HOLD_M (BIT(31)) -#define RTC_IO_TOUCH_PAD5_HOLD_V 0x1 -#define RTC_IO_TOUCH_PAD5_HOLD_S 31 -/* RTC_IO_TOUCH_PAD5_DRV : R/W ;bitpos:[30:29] ;default: 2'd2 ; */ -/*description: the driver strength of the pad*/ -#define RTC_IO_TOUCH_PAD5_DRV 0x00000003 -#define RTC_IO_TOUCH_PAD5_DRV_M ((RTC_IO_TOUCH_PAD5_DRV_V)<<(RTC_IO_TOUCH_PAD5_DRV_S)) -#define RTC_IO_TOUCH_PAD5_DRV_V 0x3 -#define RTC_IO_TOUCH_PAD5_DRV_S 29 -/* RTC_IO_TOUCH_PAD5_RDE : R/W ;bitpos:[28] ;default: 1'd1 ; */ -/*description: the pull down enable of the pad*/ -#define RTC_IO_TOUCH_PAD5_RDE (BIT(28)) -#define RTC_IO_TOUCH_PAD5_RDE_M (BIT(28)) -#define RTC_IO_TOUCH_PAD5_RDE_V 0x1 -#define RTC_IO_TOUCH_PAD5_RDE_S 28 -/* RTC_IO_TOUCH_PAD5_RUE : R/W ;bitpos:[27] ;default: 1'd0 ; */ -/*description: the pull up enable of the pad*/ -#define RTC_IO_TOUCH_PAD5_RUE (BIT(27)) -#define RTC_IO_TOUCH_PAD5_RUE_M (BIT(27)) -#define RTC_IO_TOUCH_PAD5_RUE_V 0x1 -#define RTC_IO_TOUCH_PAD5_RUE_S 27 -/* RTC_IO_TOUCH_PAD5_DAC : R/W ;bitpos:[25:23] ;default: 3'h4 ; */ -/*description: touch sensor slope control. 3-bit for each touch panel default 100.*/ -#define RTC_IO_TOUCH_PAD5_DAC 0x00000007 -#define RTC_IO_TOUCH_PAD5_DAC_M ((RTC_IO_TOUCH_PAD5_DAC_V)<<(RTC_IO_TOUCH_PAD5_DAC_S)) -#define RTC_IO_TOUCH_PAD5_DAC_V 0x7 -#define RTC_IO_TOUCH_PAD5_DAC_S 23 -/* RTC_IO_TOUCH_PAD5_START : R/W ;bitpos:[22] ;default: 1'd0 ; */ -/*description: start touch sensor.*/ -#define RTC_IO_TOUCH_PAD5_START (BIT(22)) -#define RTC_IO_TOUCH_PAD5_START_M (BIT(22)) -#define RTC_IO_TOUCH_PAD5_START_V 0x1 -#define RTC_IO_TOUCH_PAD5_START_S 22 -/* RTC_IO_TOUCH_PAD5_TIE_OPT : R/W ;bitpos:[21] ;default: 1'd0 ; */ -/*description: default touch sensor tie option. 0: tie low 1: tie high.*/ -#define RTC_IO_TOUCH_PAD5_TIE_OPT (BIT(21)) -#define RTC_IO_TOUCH_PAD5_TIE_OPT_M (BIT(21)) -#define RTC_IO_TOUCH_PAD5_TIE_OPT_V 0x1 -#define RTC_IO_TOUCH_PAD5_TIE_OPT_S 21 -/* RTC_IO_TOUCH_PAD5_XPD : R/W ;bitpos:[20] ;default: 1'd0 ; */ -/*description: touch sensor power on.*/ -#define RTC_IO_TOUCH_PAD5_XPD (BIT(20)) -#define RTC_IO_TOUCH_PAD5_XPD_M (BIT(20)) -#define RTC_IO_TOUCH_PAD5_XPD_V 0x1 -#define RTC_IO_TOUCH_PAD5_XPD_S 20 -/* RTC_IO_TOUCH_PAD5_MUX_SEL : R/W ;bitpos:[19] ;default: 1'd0 ; */ -/*description: Ò1Ó select the digital function Ó0Óslection the rtc function*/ -#define RTC_IO_TOUCH_PAD5_MUX_SEL (BIT(19)) -#define RTC_IO_TOUCH_PAD5_MUX_SEL_M (BIT(19)) -#define RTC_IO_TOUCH_PAD5_MUX_SEL_V 0x1 -#define RTC_IO_TOUCH_PAD5_MUX_SEL_S 19 -/* RTC_IO_TOUCH_PAD5_FUN_SEL : R/W ;bitpos:[18:17] ;default: 2'd0 ; */ -/*description: the functional selection signal of the pad*/ -#define RTC_IO_TOUCH_PAD5_FUN_SEL 0x00000003 -#define RTC_IO_TOUCH_PAD5_FUN_SEL_M ((RTC_IO_TOUCH_PAD5_FUN_SEL_V)<<(RTC_IO_TOUCH_PAD5_FUN_SEL_S)) -#define RTC_IO_TOUCH_PAD5_FUN_SEL_V 0x3 -#define RTC_IO_TOUCH_PAD5_FUN_SEL_S 17 -/* RTC_IO_TOUCH_PAD5_SLP_SEL : R/W ;bitpos:[16] ;default: 1'd0 ; */ -/*description: the sleep status selection signal of the pad*/ -#define RTC_IO_TOUCH_PAD5_SLP_SEL (BIT(16)) -#define RTC_IO_TOUCH_PAD5_SLP_SEL_M (BIT(16)) -#define RTC_IO_TOUCH_PAD5_SLP_SEL_V 0x1 -#define RTC_IO_TOUCH_PAD5_SLP_SEL_S 16 -/* RTC_IO_TOUCH_PAD5_SLP_IE : R/W ;bitpos:[15] ;default: 1'd0 ; */ -/*description: the input enable of the pad in sleep status*/ -#define RTC_IO_TOUCH_PAD5_SLP_IE (BIT(15)) -#define RTC_IO_TOUCH_PAD5_SLP_IE_M (BIT(15)) -#define RTC_IO_TOUCH_PAD5_SLP_IE_V 0x1 -#define RTC_IO_TOUCH_PAD5_SLP_IE_S 15 -/* RTC_IO_TOUCH_PAD5_SLP_OE : R/W ;bitpos:[14] ;default: 1'd0 ; */ -/*description: the output enable of the pad in sleep status*/ -#define RTC_IO_TOUCH_PAD5_SLP_OE (BIT(14)) -#define RTC_IO_TOUCH_PAD5_SLP_OE_M (BIT(14)) -#define RTC_IO_TOUCH_PAD5_SLP_OE_V 0x1 -#define RTC_IO_TOUCH_PAD5_SLP_OE_S 14 -/* RTC_IO_TOUCH_PAD5_FUN_IE : R/W ;bitpos:[13] ;default: 1'd0 ; */ -/*description: the input enable of the pad*/ -#define RTC_IO_TOUCH_PAD5_FUN_IE (BIT(13)) -#define RTC_IO_TOUCH_PAD5_FUN_IE_M (BIT(13)) -#define RTC_IO_TOUCH_PAD5_FUN_IE_V 0x1 -#define RTC_IO_TOUCH_PAD5_FUN_IE_S 13 -/* RTC_IO_TOUCH_PAD5_TO_GPIO : R/W ;bitpos:[12] ;default: 1'd0 ; */ -/*description: connect the rtc pad input to digital pad input Ó0Ó is availbale.MTDI*/ -#define RTC_IO_TOUCH_PAD5_TO_GPIO (BIT(12)) -#define RTC_IO_TOUCH_PAD5_TO_GPIO_M (BIT(12)) -#define RTC_IO_TOUCH_PAD5_TO_GPIO_V 0x1 -#define RTC_IO_TOUCH_PAD5_TO_GPIO_S 12 - -#define RTC_IO_TOUCH_PAD6_REG (DR_REG_RTCIO_BASE + 0xac) -/* RTC_IO_TOUCH_PAD6_HOLD : R/W ;bitpos:[31] ;default: 1'd0 ; */ -/*description: hold the current value of the output when setting the hold to Ò1Ó*/ -#define RTC_IO_TOUCH_PAD6_HOLD (BIT(31)) -#define RTC_IO_TOUCH_PAD6_HOLD_M (BIT(31)) -#define RTC_IO_TOUCH_PAD6_HOLD_V 0x1 -#define RTC_IO_TOUCH_PAD6_HOLD_S 31 -/* RTC_IO_TOUCH_PAD6_DRV : R/W ;bitpos:[30:29] ;default: 2'd2 ; */ -/*description: the driver strength of the pad*/ -#define RTC_IO_TOUCH_PAD6_DRV 0x00000003 -#define RTC_IO_TOUCH_PAD6_DRV_M ((RTC_IO_TOUCH_PAD6_DRV_V)<<(RTC_IO_TOUCH_PAD6_DRV_S)) -#define RTC_IO_TOUCH_PAD6_DRV_V 0x3 -#define RTC_IO_TOUCH_PAD6_DRV_S 29 -/* RTC_IO_TOUCH_PAD6_RDE : R/W ;bitpos:[28] ;default: 1'd0 ; */ -/*description: the pull down enable of the pad*/ -#define RTC_IO_TOUCH_PAD6_RDE (BIT(28)) -#define RTC_IO_TOUCH_PAD6_RDE_M (BIT(28)) -#define RTC_IO_TOUCH_PAD6_RDE_V 0x1 -#define RTC_IO_TOUCH_PAD6_RDE_S 28 -/* RTC_IO_TOUCH_PAD6_RUE : R/W ;bitpos:[27] ;default: 1'd1 ; */ -/*description: the pull up enable of the pad*/ -#define RTC_IO_TOUCH_PAD6_RUE (BIT(27)) -#define RTC_IO_TOUCH_PAD6_RUE_M (BIT(27)) -#define RTC_IO_TOUCH_PAD6_RUE_V 0x1 -#define RTC_IO_TOUCH_PAD6_RUE_S 27 -/* RTC_IO_TOUCH_PAD6_DAC : R/W ;bitpos:[25:23] ;default: 3'h4 ; */ -/*description: touch sensor slope control. 3-bit for each touch panel default 100.*/ -#define RTC_IO_TOUCH_PAD6_DAC 0x00000007 -#define RTC_IO_TOUCH_PAD6_DAC_M ((RTC_IO_TOUCH_PAD6_DAC_V)<<(RTC_IO_TOUCH_PAD6_DAC_S)) -#define RTC_IO_TOUCH_PAD6_DAC_V 0x7 -#define RTC_IO_TOUCH_PAD6_DAC_S 23 -/* RTC_IO_TOUCH_PAD6_START : R/W ;bitpos:[22] ;default: 1'd0 ; */ -/*description: start touch sensor.*/ -#define RTC_IO_TOUCH_PAD6_START (BIT(22)) -#define RTC_IO_TOUCH_PAD6_START_M (BIT(22)) -#define RTC_IO_TOUCH_PAD6_START_V 0x1 -#define RTC_IO_TOUCH_PAD6_START_S 22 -/* RTC_IO_TOUCH_PAD6_TIE_OPT : R/W ;bitpos:[21] ;default: 1'd0 ; */ -/*description: default touch sensor tie option. 0: tie low 1: tie high.*/ -#define RTC_IO_TOUCH_PAD6_TIE_OPT (BIT(21)) -#define RTC_IO_TOUCH_PAD6_TIE_OPT_M (BIT(21)) -#define RTC_IO_TOUCH_PAD6_TIE_OPT_V 0x1 -#define RTC_IO_TOUCH_PAD6_TIE_OPT_S 21 -/* RTC_IO_TOUCH_PAD6_XPD : R/W ;bitpos:[20] ;default: 1'd0 ; */ -/*description: touch sensor power on.*/ -#define RTC_IO_TOUCH_PAD6_XPD (BIT(20)) -#define RTC_IO_TOUCH_PAD6_XPD_M (BIT(20)) -#define RTC_IO_TOUCH_PAD6_XPD_V 0x1 -#define RTC_IO_TOUCH_PAD6_XPD_S 20 -/* RTC_IO_TOUCH_PAD6_MUX_SEL : R/W ;bitpos:[19] ;default: 1'd0 ; */ -/*description: Ò1Ó select the digital function Ó0Óslection the rtc function*/ -#define RTC_IO_TOUCH_PAD6_MUX_SEL (BIT(19)) -#define RTC_IO_TOUCH_PAD6_MUX_SEL_M (BIT(19)) -#define RTC_IO_TOUCH_PAD6_MUX_SEL_V 0x1 -#define RTC_IO_TOUCH_PAD6_MUX_SEL_S 19 -/* RTC_IO_TOUCH_PAD6_FUN_SEL : R/W ;bitpos:[18:17] ;default: 2'd0 ; */ -/*description: the functional selection signal of the pad*/ -#define RTC_IO_TOUCH_PAD6_FUN_SEL 0x00000003 -#define RTC_IO_TOUCH_PAD6_FUN_SEL_M ((RTC_IO_TOUCH_PAD6_FUN_SEL_V)<<(RTC_IO_TOUCH_PAD6_FUN_SEL_S)) -#define RTC_IO_TOUCH_PAD6_FUN_SEL_V 0x3 -#define RTC_IO_TOUCH_PAD6_FUN_SEL_S 17 -/* RTC_IO_TOUCH_PAD6_SLP_SEL : R/W ;bitpos:[16] ;default: 1'd0 ; */ -/*description: the sleep status selection signal of the pad*/ -#define RTC_IO_TOUCH_PAD6_SLP_SEL (BIT(16)) -#define RTC_IO_TOUCH_PAD6_SLP_SEL_M (BIT(16)) -#define RTC_IO_TOUCH_PAD6_SLP_SEL_V 0x1 -#define RTC_IO_TOUCH_PAD6_SLP_SEL_S 16 -/* RTC_IO_TOUCH_PAD6_SLP_IE : R/W ;bitpos:[15] ;default: 1'd0 ; */ -/*description: the input enable of the pad in sleep status*/ -#define RTC_IO_TOUCH_PAD6_SLP_IE (BIT(15)) -#define RTC_IO_TOUCH_PAD6_SLP_IE_M (BIT(15)) -#define RTC_IO_TOUCH_PAD6_SLP_IE_V 0x1 -#define RTC_IO_TOUCH_PAD6_SLP_IE_S 15 -/* RTC_IO_TOUCH_PAD6_SLP_OE : R/W ;bitpos:[14] ;default: 1'd0 ; */ -/*description: the output enable of the pad in sleep status*/ -#define RTC_IO_TOUCH_PAD6_SLP_OE (BIT(14)) -#define RTC_IO_TOUCH_PAD6_SLP_OE_M (BIT(14)) -#define RTC_IO_TOUCH_PAD6_SLP_OE_V 0x1 -#define RTC_IO_TOUCH_PAD6_SLP_OE_S 14 -/* RTC_IO_TOUCH_PAD6_FUN_IE : R/W ;bitpos:[13] ;default: 1'd0 ; */ -/*description: the input enable of the pad*/ -#define RTC_IO_TOUCH_PAD6_FUN_IE (BIT(13)) -#define RTC_IO_TOUCH_PAD6_FUN_IE_M (BIT(13)) -#define RTC_IO_TOUCH_PAD6_FUN_IE_V 0x1 -#define RTC_IO_TOUCH_PAD6_FUN_IE_S 13 -/* RTC_IO_TOUCH_PAD6_TO_GPIO : R/W ;bitpos:[12] ;default: 1'd0 ; */ -/*description: connect the rtc pad input to digital pad input Ó0Ó is availbale.MTMS*/ -#define RTC_IO_TOUCH_PAD6_TO_GPIO (BIT(12)) -#define RTC_IO_TOUCH_PAD6_TO_GPIO_M (BIT(12)) -#define RTC_IO_TOUCH_PAD6_TO_GPIO_V 0x1 -#define RTC_IO_TOUCH_PAD6_TO_GPIO_S 12 - -#define RTC_IO_TOUCH_PAD7_REG (DR_REG_RTCIO_BASE + 0xb0) -/* RTC_IO_TOUCH_PAD7_HOLD : R/W ;bitpos:[31] ;default: 1'd0 ; */ -/*description: hold the current value of the output when setting the hold to Ò1Ó*/ -#define RTC_IO_TOUCH_PAD7_HOLD (BIT(31)) -#define RTC_IO_TOUCH_PAD7_HOLD_M (BIT(31)) -#define RTC_IO_TOUCH_PAD7_HOLD_V 0x1 -#define RTC_IO_TOUCH_PAD7_HOLD_S 31 -/* RTC_IO_TOUCH_PAD7_DRV : R/W ;bitpos:[30:29] ;default: 2'd2 ; */ -/*description: the driver strength of the pad*/ -#define RTC_IO_TOUCH_PAD7_DRV 0x00000003 -#define RTC_IO_TOUCH_PAD7_DRV_M ((RTC_IO_TOUCH_PAD7_DRV_V)<<(RTC_IO_TOUCH_PAD7_DRV_S)) -#define RTC_IO_TOUCH_PAD7_DRV_V 0x3 -#define RTC_IO_TOUCH_PAD7_DRV_S 29 -/* RTC_IO_TOUCH_PAD7_RDE : R/W ;bitpos:[28] ;default: 1'd0 ; */ -/*description: the pull down enable of the pad*/ -#define RTC_IO_TOUCH_PAD7_RDE (BIT(28)) -#define RTC_IO_TOUCH_PAD7_RDE_M (BIT(28)) -#define RTC_IO_TOUCH_PAD7_RDE_V 0x1 -#define RTC_IO_TOUCH_PAD7_RDE_S 28 -/* RTC_IO_TOUCH_PAD7_RUE : R/W ;bitpos:[27] ;default: 1'd0 ; */ -/*description: the pull up enable of the pad*/ -#define RTC_IO_TOUCH_PAD7_RUE (BIT(27)) -#define RTC_IO_TOUCH_PAD7_RUE_M (BIT(27)) -#define RTC_IO_TOUCH_PAD7_RUE_V 0x1 -#define RTC_IO_TOUCH_PAD7_RUE_S 27 -/* RTC_IO_TOUCH_PAD7_DAC : R/W ;bitpos:[25:23] ;default: 3'h4 ; */ -/*description: touch sensor slope control. 3-bit for each touch panel default 100.*/ -#define RTC_IO_TOUCH_PAD7_DAC 0x00000007 -#define RTC_IO_TOUCH_PAD7_DAC_M ((RTC_IO_TOUCH_PAD7_DAC_V)<<(RTC_IO_TOUCH_PAD7_DAC_S)) -#define RTC_IO_TOUCH_PAD7_DAC_V 0x7 -#define RTC_IO_TOUCH_PAD7_DAC_S 23 -/* RTC_IO_TOUCH_PAD7_START : R/W ;bitpos:[22] ;default: 1'd0 ; */ -/*description: start touch sensor.*/ -#define RTC_IO_TOUCH_PAD7_START (BIT(22)) -#define RTC_IO_TOUCH_PAD7_START_M (BIT(22)) -#define RTC_IO_TOUCH_PAD7_START_V 0x1 -#define RTC_IO_TOUCH_PAD7_START_S 22 -/* RTC_IO_TOUCH_PAD7_TIE_OPT : R/W ;bitpos:[21] ;default: 1'd0 ; */ -/*description: default touch sensor tie option. 0: tie low 1: tie high.*/ -#define RTC_IO_TOUCH_PAD7_TIE_OPT (BIT(21)) -#define RTC_IO_TOUCH_PAD7_TIE_OPT_M (BIT(21)) -#define RTC_IO_TOUCH_PAD7_TIE_OPT_V 0x1 -#define RTC_IO_TOUCH_PAD7_TIE_OPT_S 21 -/* RTC_IO_TOUCH_PAD7_XPD : R/W ;bitpos:[20] ;default: 1'd0 ; */ -/*description: touch sensor power on.*/ -#define RTC_IO_TOUCH_PAD7_XPD (BIT(20)) -#define RTC_IO_TOUCH_PAD7_XPD_M (BIT(20)) -#define RTC_IO_TOUCH_PAD7_XPD_V 0x1 -#define RTC_IO_TOUCH_PAD7_XPD_S 20 -/* RTC_IO_TOUCH_PAD7_MUX_SEL : R/W ;bitpos:[19] ;default: 1'd0 ; */ -/*description: Ò1Ó select the digital function Ó0Óslection the rtc function*/ -#define RTC_IO_TOUCH_PAD7_MUX_SEL (BIT(19)) -#define RTC_IO_TOUCH_PAD7_MUX_SEL_M (BIT(19)) -#define RTC_IO_TOUCH_PAD7_MUX_SEL_V 0x1 -#define RTC_IO_TOUCH_PAD7_MUX_SEL_S 19 -/* RTC_IO_TOUCH_PAD7_FUN_SEL : R/W ;bitpos:[18:17] ;default: 2'd0 ; */ -/*description: the functional selection signal of the pad*/ -#define RTC_IO_TOUCH_PAD7_FUN_SEL 0x00000003 -#define RTC_IO_TOUCH_PAD7_FUN_SEL_M ((RTC_IO_TOUCH_PAD7_FUN_SEL_V)<<(RTC_IO_TOUCH_PAD7_FUN_SEL_S)) -#define RTC_IO_TOUCH_PAD7_FUN_SEL_V 0x3 -#define RTC_IO_TOUCH_PAD7_FUN_SEL_S 17 -/* RTC_IO_TOUCH_PAD7_SLP_SEL : R/W ;bitpos:[16] ;default: 1'd0 ; */ -/*description: the sleep status selection signal of the pad*/ -#define RTC_IO_TOUCH_PAD7_SLP_SEL (BIT(16)) -#define RTC_IO_TOUCH_PAD7_SLP_SEL_M (BIT(16)) -#define RTC_IO_TOUCH_PAD7_SLP_SEL_V 0x1 -#define RTC_IO_TOUCH_PAD7_SLP_SEL_S 16 -/* RTC_IO_TOUCH_PAD7_SLP_IE : R/W ;bitpos:[15] ;default: 1'd0 ; */ -/*description: the input enable of the pad in sleep status*/ -#define RTC_IO_TOUCH_PAD7_SLP_IE (BIT(15)) -#define RTC_IO_TOUCH_PAD7_SLP_IE_M (BIT(15)) -#define RTC_IO_TOUCH_PAD7_SLP_IE_V 0x1 -#define RTC_IO_TOUCH_PAD7_SLP_IE_S 15 -/* RTC_IO_TOUCH_PAD7_SLP_OE : R/W ;bitpos:[14] ;default: 1'd0 ; */ -/*description: the output enable of the pad in sleep status*/ -#define RTC_IO_TOUCH_PAD7_SLP_OE (BIT(14)) -#define RTC_IO_TOUCH_PAD7_SLP_OE_M (BIT(14)) -#define RTC_IO_TOUCH_PAD7_SLP_OE_V 0x1 -#define RTC_IO_TOUCH_PAD7_SLP_OE_S 14 -/* RTC_IO_TOUCH_PAD7_FUN_IE : R/W ;bitpos:[13] ;default: 1'd0 ; */ -/*description: the input enable of the pad*/ -#define RTC_IO_TOUCH_PAD7_FUN_IE (BIT(13)) -#define RTC_IO_TOUCH_PAD7_FUN_IE_M (BIT(13)) -#define RTC_IO_TOUCH_PAD7_FUN_IE_V 0x1 -#define RTC_IO_TOUCH_PAD7_FUN_IE_S 13 -/* RTC_IO_TOUCH_PAD7_TO_GPIO : R/W ;bitpos:[12] ;default: 1'd0 ; */ -/*description: connect the rtc pad input to digital pad input Ó0Ó is availbale.GPIO27*/ -#define RTC_IO_TOUCH_PAD7_TO_GPIO (BIT(12)) -#define RTC_IO_TOUCH_PAD7_TO_GPIO_M (BIT(12)) -#define RTC_IO_TOUCH_PAD7_TO_GPIO_V 0x1 -#define RTC_IO_TOUCH_PAD7_TO_GPIO_S 12 - -#define RTC_IO_TOUCH_PAD8_REG (DR_REG_RTCIO_BASE + 0xb4) -/* RTC_IO_TOUCH_PAD8_DAC : R/W ;bitpos:[25:23] ;default: 3'h4 ; */ -/*description: touch sensor slope control. 3-bit for each touch panel default 100.*/ -#define RTC_IO_TOUCH_PAD8_DAC 0x00000007 -#define RTC_IO_TOUCH_PAD8_DAC_M ((RTC_IO_TOUCH_PAD8_DAC_V)<<(RTC_IO_TOUCH_PAD8_DAC_S)) -#define RTC_IO_TOUCH_PAD8_DAC_V 0x7 -#define RTC_IO_TOUCH_PAD8_DAC_S 23 -/* RTC_IO_TOUCH_PAD8_START : R/W ;bitpos:[22] ;default: 1'd0 ; */ -/*description: start touch sensor.*/ -#define RTC_IO_TOUCH_PAD8_START (BIT(22)) -#define RTC_IO_TOUCH_PAD8_START_M (BIT(22)) -#define RTC_IO_TOUCH_PAD8_START_V 0x1 -#define RTC_IO_TOUCH_PAD8_START_S 22 -/* RTC_IO_TOUCH_PAD8_TIE_OPT : R/W ;bitpos:[21] ;default: 1'd0 ; */ -/*description: default touch sensor tie option. 0: tie low 1: tie high.*/ -#define RTC_IO_TOUCH_PAD8_TIE_OPT (BIT(21)) -#define RTC_IO_TOUCH_PAD8_TIE_OPT_M (BIT(21)) -#define RTC_IO_TOUCH_PAD8_TIE_OPT_V 0x1 -#define RTC_IO_TOUCH_PAD8_TIE_OPT_S 21 -/* RTC_IO_TOUCH_PAD8_XPD : R/W ;bitpos:[20] ;default: 1'd0 ; */ -/*description: touch sensor power on.*/ -#define RTC_IO_TOUCH_PAD8_XPD (BIT(20)) -#define RTC_IO_TOUCH_PAD8_XPD_M (BIT(20)) -#define RTC_IO_TOUCH_PAD8_XPD_V 0x1 -#define RTC_IO_TOUCH_PAD8_XPD_S 20 -/* RTC_IO_TOUCH_PAD8_TO_GPIO : R/W ;bitpos:[19] ;default: 1'd0 ; */ -/*description: connect the rtc pad input to digital pad input Ó0Ó is availbale*/ -#define RTC_IO_TOUCH_PAD8_TO_GPIO (BIT(19)) -#define RTC_IO_TOUCH_PAD8_TO_GPIO_M (BIT(19)) -#define RTC_IO_TOUCH_PAD8_TO_GPIO_V 0x1 -#define RTC_IO_TOUCH_PAD8_TO_GPIO_S 19 - -#define RTC_IO_TOUCH_PAD9_REG (DR_REG_RTCIO_BASE + 0xb8) -/* RTC_IO_TOUCH_PAD9_DAC : R/W ;bitpos:[25:23] ;default: 3'h4 ; */ -/*description: touch sensor slope control. 3-bit for each touch panel default 100.*/ -#define RTC_IO_TOUCH_PAD9_DAC 0x00000007 -#define RTC_IO_TOUCH_PAD9_DAC_M ((RTC_IO_TOUCH_PAD9_DAC_V)<<(RTC_IO_TOUCH_PAD9_DAC_S)) -#define RTC_IO_TOUCH_PAD9_DAC_V 0x7 -#define RTC_IO_TOUCH_PAD9_DAC_S 23 -/* RTC_IO_TOUCH_PAD9_START : R/W ;bitpos:[22] ;default: 1'd0 ; */ -/*description: start touch sensor.*/ -#define RTC_IO_TOUCH_PAD9_START (BIT(22)) -#define RTC_IO_TOUCH_PAD9_START_M (BIT(22)) -#define RTC_IO_TOUCH_PAD9_START_V 0x1 -#define RTC_IO_TOUCH_PAD9_START_S 22 -/* RTC_IO_TOUCH_PAD9_TIE_OPT : R/W ;bitpos:[21] ;default: 1'd0 ; */ -/*description: default touch sensor tie option. 0: tie low 1: tie high.*/ -#define RTC_IO_TOUCH_PAD9_TIE_OPT (BIT(21)) -#define RTC_IO_TOUCH_PAD9_TIE_OPT_M (BIT(21)) -#define RTC_IO_TOUCH_PAD9_TIE_OPT_V 0x1 -#define RTC_IO_TOUCH_PAD9_TIE_OPT_S 21 -/* RTC_IO_TOUCH_PAD9_XPD : R/W ;bitpos:[20] ;default: 1'd0 ; */ -/*description: touch sensor power on.*/ -#define RTC_IO_TOUCH_PAD9_XPD (BIT(20)) -#define RTC_IO_TOUCH_PAD9_XPD_M (BIT(20)) -#define RTC_IO_TOUCH_PAD9_XPD_V 0x1 -#define RTC_IO_TOUCH_PAD9_XPD_S 20 -/* RTC_IO_TOUCH_PAD9_TO_GPIO : R/W ;bitpos:[19] ;default: 1'd0 ; */ -/*description: connect the rtc pad input to digital pad input Ó0Ó is availbale*/ -#define RTC_IO_TOUCH_PAD9_TO_GPIO (BIT(19)) -#define RTC_IO_TOUCH_PAD9_TO_GPIO_M (BIT(19)) -#define RTC_IO_TOUCH_PAD9_TO_GPIO_V 0x1 -#define RTC_IO_TOUCH_PAD9_TO_GPIO_S 19 - -#define RTC_IO_EXT_WAKEUP0_REG (DR_REG_RTCIO_BASE + 0xbc) -/* RTC_IO_EXT_WAKEUP0_SEL : R/W ;bitpos:[31:27] ;default: 5'd0 ; */ -/*description: select the wakeup source Ó0Ó select GPIO0 Ó1Ó select GPIO2 ...Ò17Ó select GPIO17*/ -#define RTC_IO_EXT_WAKEUP0_SEL 0x0000001F -#define RTC_IO_EXT_WAKEUP0_SEL_M ((RTC_IO_EXT_WAKEUP0_SEL_V)<<(RTC_IO_EXT_WAKEUP0_SEL_S)) -#define RTC_IO_EXT_WAKEUP0_SEL_V 0x1F -#define RTC_IO_EXT_WAKEUP0_SEL_S 27 - -#define RTC_IO_XTL_EXT_CTR_REG (DR_REG_RTCIO_BASE + 0xc0) -/* RTC_IO_XTL_EXT_CTR_SEL : R/W ;bitpos:[31:27] ;default: 5'd0 ; */ -/*description: select the external xtl power source Ó0Ó select GPIO0 Ó1Ó select - GPIO2 ...Ò17Ó select GPIO17*/ -#define RTC_IO_XTL_EXT_CTR_SEL 0x0000001F -#define RTC_IO_XTL_EXT_CTR_SEL_M ((RTC_IO_XTL_EXT_CTR_SEL_V)<<(RTC_IO_XTL_EXT_CTR_SEL_S)) -#define RTC_IO_XTL_EXT_CTR_SEL_V 0x1F -#define RTC_IO_XTL_EXT_CTR_SEL_S 27 - -#define RTC_IO_SAR_I2C_IO_REG (DR_REG_RTCIO_BASE + 0xc4) -/* RTC_IO_SAR_I2C_SDA_SEL : R/W ;bitpos:[31:30] ;default: 2'd0 ; */ -/*description: Ò0Ó using TOUCH_PAD[1] as i2c sda Ò1Ó using TOUCH_PAD[3] as i2c sda*/ -#define RTC_IO_SAR_I2C_SDA_SEL 0x00000003 -#define RTC_IO_SAR_I2C_SDA_SEL_M ((RTC_IO_SAR_I2C_SDA_SEL_V)<<(RTC_IO_SAR_I2C_SDA_SEL_S)) -#define RTC_IO_SAR_I2C_SDA_SEL_V 0x3 -#define RTC_IO_SAR_I2C_SDA_SEL_S 30 -/* RTC_IO_SAR_I2C_SCL_SEL : R/W ;bitpos:[29:28] ;default: 2'd0 ; */ -/*description: Ò0Ó using TOUCH_PAD[0] as i2c clk Ò1Ó using TOUCH_PAD[2] as i2c clk*/ -#define RTC_IO_SAR_I2C_SCL_SEL 0x00000003 -#define RTC_IO_SAR_I2C_SCL_SEL_M ((RTC_IO_SAR_I2C_SCL_SEL_V)<<(RTC_IO_SAR_I2C_SCL_SEL_S)) -#define RTC_IO_SAR_I2C_SCL_SEL_V 0x3 -#define RTC_IO_SAR_I2C_SCL_SEL_S 28 -/* RTC_IO_SAR_DEBUG_BIT_SEL : R/W ;bitpos:[27:23] ;default: 5'h0 ; */ -/*description: */ -#define RTC_IO_SAR_DEBUG_BIT_SEL 0x0000001F -#define RTC_IO_SAR_DEBUG_BIT_SEL_M ((RTC_IO_SAR_DEBUG_BIT_SEL_V)<<(RTC_IO_SAR_DEBUG_BIT_SEL_S)) -#define RTC_IO_SAR_DEBUG_BIT_SEL_V 0x1F -#define RTC_IO_SAR_DEBUG_BIT_SEL_S 23 - -#define RTC_IO_DATE_REG (DR_REG_RTCIO_BASE + 0xc8) -/* RTC_IO_IO_DATE : R/W ;bitpos:[27:0] ;default: 28'h1603160 ; */ -/*description: date*/ -#define RTC_IO_IO_DATE 0x0FFFFFFF -#define RTC_IO_IO_DATE_M ((RTC_IO_IO_DATE_V)<<(RTC_IO_IO_DATE_S)) -#define RTC_IO_IO_DATE_V 0xFFFFFFF -#define RTC_IO_IO_DATE_S 0 -#define RTC_IO_RTC_IO_DATE_VERSION 0x1703160 - - - - -#endif /*_SOC_RTC_IO_REG_H_ */ - - diff --git a/tools/sdk/include/soc/soc/rtc_io_struct.h b/tools/sdk/include/soc/soc/rtc_io_struct.h deleted file mode 100644 index f20ad4c2cf2..00000000000 --- a/tools/sdk/include/soc/soc/rtc_io_struct.h +++ /dev/null @@ -1,291 +0,0 @@ -// 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. -#ifndef _SOC_RTC_IO_STRUCT_H_ -#define _SOC_RTC_IO_STRUCT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef volatile struct { - union { - struct { - uint32_t reserved0: 14; - uint32_t data:18; /*GPIO0~17 output value*/ - }; - uint32_t val; - } out; - union { - struct { - uint32_t reserved0: 14; - uint32_t w1ts:18; /*GPIO0~17 output value write 1 to set*/ - }; - uint32_t val; - } out_w1ts; - union { - struct { - uint32_t reserved0: 14; - uint32_t w1tc:18; /*GPIO0~17 output value write 1 to clear*/ - }; - uint32_t val; - } out_w1tc; - union { - struct { - uint32_t reserved0: 14; - uint32_t enable:18; /*GPIO0~17 output enable*/ - }; - uint32_t val; - } enable; - union { - struct { - uint32_t reserved0: 14; - uint32_t w1ts:18; /*GPIO0~17 output enable write 1 to set*/ - }; - uint32_t val; - } enable_w1ts; - union { - struct { - uint32_t reserved0: 14; - uint32_t w1tc:18; /*GPIO0~17 output enable write 1 to clear*/ - }; - uint32_t val; - } enable_w1tc; - union { - struct { - uint32_t reserved0: 14; - uint32_t status:18; /*GPIO0~17 interrupt status*/ - }; - uint32_t val; - } status; - union { - struct { - uint32_t reserved0: 14; - uint32_t w1ts:18; /*GPIO0~17 interrupt status write 1 to set*/ - }; - uint32_t val; - } status_w1ts; - union { - struct { - uint32_t reserved0: 14; - uint32_t w1tc:18; /*GPIO0~17 interrupt status write 1 to clear*/ - }; - uint32_t val; - } status_w1tc; - union { - struct { - uint32_t reserved0: 14; - uint32_t in:18; /*GPIO0~17 input value*/ - }; - uint32_t val; - } in_val; - union { - struct { - uint32_t reserved0: 2; - uint32_t pad_driver: 1; /*if set to 0: normal output if set to 1: open drain*/ - uint32_t reserved3: 4; - uint32_t int_type: 3; /*if set to 0: GPIO interrupt disable if set to 1: rising edge trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/ - uint32_t wakeup_enable: 1; /*GPIO wake up enable only available in light sleep*/ - uint32_t reserved11: 21; - }; - uint32_t val; - } pin[18]; - union { - struct { - uint32_t sel0: 5; - uint32_t sel1: 5; - uint32_t sel2: 5; - uint32_t sel3: 5; - uint32_t sel4: 5; - uint32_t no_gating_12m: 1; - uint32_t reserved26: 6; - }; - uint32_t val; - } debug_sel; - uint32_t dig_pad_hold; /*select the digital pad hold value.*/ - union { - struct { - uint32_t reserved0: 30; - uint32_t hall_phase: 1; /*Reverse phase of hall sensor*/ - uint32_t xpd_hall: 1; /*Power on hall sensor and connect to VP and VN*/ - }; - uint32_t val; - } hall_sens; - union { - struct { - uint32_t reserved0: 4; - uint32_t sense4_fun_ie: 1; /*the input enable of the pad*/ - uint32_t sense4_slp_ie: 1; /*the input enable of the pad in sleep status*/ - uint32_t sense4_slp_sel: 1; /*the sleep status selection signal of the pad*/ - uint32_t sense4_fun_sel: 2; /*the functional selection signal of the pad*/ - uint32_t sense3_fun_ie: 1; /*the input enable of the pad*/ - uint32_t sense3_slp_ie: 1; /*the input enable of the pad in sleep status*/ - uint32_t sense3_slp_sel: 1; /*the sleep status selection signal of the pad*/ - uint32_t sense3_fun_sel: 2; /*the functional selection signal of the pad*/ - uint32_t sense2_fun_ie: 1; /*the input enable of the pad*/ - uint32_t sense2_slp_ie: 1; /*the input enable of the pad in sleep status*/ - uint32_t sense2_slp_sel: 1; /*the sleep status selection signal of the pad*/ - uint32_t sense2_fun_sel: 2; /*the functional selection signal of the pad*/ - uint32_t sense1_fun_ie: 1; /*the input enable of the pad*/ - uint32_t sense1_slp_ie: 1; /*the input enable of the pad in sleep status*/ - uint32_t sense1_slp_sel: 1; /*the sleep status selection signal of the pad*/ - uint32_t sense1_fun_sel: 2; /*the functional selection signal of the pad*/ - uint32_t sense4_mux_sel: 1; /*�1� select the digital function �0�slection the rtc function*/ - uint32_t sense3_mux_sel: 1; /*�1� select the digital function �0�slection the rtc function*/ - uint32_t sense2_mux_sel: 1; /*�1� select the digital function �0�slection the rtc function*/ - uint32_t sense1_mux_sel: 1; /*�1� select the digital function �0�slection the rtc function*/ - uint32_t sense4_hold: 1; /*hold the current value of the output when setting the hold to �1�*/ - uint32_t sense3_hold: 1; /*hold the current value of the output when setting the hold to �1�*/ - uint32_t sense2_hold: 1; /*hold the current value of the output when setting the hold to �1�*/ - uint32_t sense1_hold: 1; /*hold the current value of the output when setting the hold to �1�*/ - }; - uint32_t val; - } sensor_pads; - union { - struct { - uint32_t reserved0: 18; - uint32_t adc2_fun_ie: 1; /*the input enable of the pad*/ - uint32_t adc2_slp_ie: 1; /*the input enable of the pad in sleep status*/ - uint32_t adc2_slp_sel: 1; /*the sleep status selection signal of the pad*/ - uint32_t adc2_fun_sel: 2; /*the functional selection signal of the pad*/ - uint32_t adc1_fun_ie: 1; /*the input enable of the pad*/ - uint32_t adc1_slp_ie: 1; /*the input enable of the pad in sleep status*/ - uint32_t adc1_slp_sel: 1; /*the sleep status selection signal of the pad*/ - uint32_t adc1_fun_sel: 2; /*the functional selection signal of the pad*/ - uint32_t adc2_mux_sel: 1; /*�1� select the digital function �0�slection the rtc function*/ - uint32_t adc1_mux_sel: 1; /*�1� select the digital function �0�slection the rtc function*/ - uint32_t adc2_hold: 1; /*hold the current value of the output when setting the hold to �1�*/ - uint32_t adc1_hold: 1; /*hold the current value of the output when setting the hold to �1�*/ - }; - uint32_t val; - } adc_pad; - union { - struct { - uint32_t reserved0: 10; - uint32_t dac_xpd_force: 1; /*Power on DAC1. Usually we need to tristate PDAC1 if we power on the DAC i.e. IE=0 OE=0 RDE=0 RUE=0*/ - uint32_t fun_ie: 1; /*the input enable of the pad*/ - uint32_t slp_oe: 1; /*the output enable of the pad in sleep status*/ - uint32_t slp_ie: 1; /*the input enable of the pad in sleep status*/ - uint32_t slp_sel: 1; /*the sleep status selection signal of the pad*/ - uint32_t fun_sel: 2; /*the functional selection signal of the pad*/ - uint32_t mux_sel: 1; /*�1� select the digital function �0�slection the rtc function*/ - uint32_t xpd_dac: 1; /*Power on DAC1. Usually we need to tristate PDAC1 if we power on the DAC i.e. IE=0 OE=0 RDE=0 RUE=0*/ - uint32_t dac: 8; /*PAD DAC1 control code.*/ - uint32_t rue: 1; /*the pull up enable of the pad*/ - uint32_t rde: 1; /*the pull down enable of the pad*/ - uint32_t hold: 1; /*hold the current value of the output when setting the hold to �1�*/ - uint32_t drv: 2; /*the driver strength of the pad*/ - }; - uint32_t val; - } pad_dac[2]; - union { - struct { - uint32_t reserved0: 1; - uint32_t dbias_xtal_32k: 2; /*32K XTAL self-bias reference control.*/ - uint32_t dres_xtal_32k: 2; /*32K XTAL resistor bias control.*/ - uint32_t x32p_fun_ie: 1; /*the input enable of the pad*/ - uint32_t x32p_slp_oe: 1; /*the output enable of the pad in sleep status*/ - uint32_t x32p_slp_ie: 1; /*the input enable of the pad in sleep status*/ - uint32_t x32p_slp_sel: 1; /*the sleep status selection signal of the pad*/ - uint32_t x32p_fun_sel: 2; /*the functional selection signal of the pad*/ - uint32_t x32n_fun_ie: 1; /*the input enable of the pad*/ - uint32_t x32n_slp_oe: 1; /*the output enable of the pad in sleep status*/ - uint32_t x32n_slp_ie: 1; /*the input enable of the pad in sleep status*/ - uint32_t x32n_slp_sel: 1; /*the sleep status selection signal of the pad*/ - uint32_t x32n_fun_sel: 2; /*the functional selection signal of the pad*/ - uint32_t x32p_mux_sel: 1; /*�1� select the digital function �0�slection the rtc function*/ - uint32_t x32n_mux_sel: 1; /*�1� select the digital function �0�slection the rtc function*/ - uint32_t xpd_xtal_32k: 1; /*Power up 32kHz crystal oscillator*/ - uint32_t dac_xtal_32k: 2; /*32K XTAL bias current DAC.*/ - uint32_t x32p_rue: 1; /*the pull up enable of the pad*/ - uint32_t x32p_rde: 1; /*the pull down enable of the pad*/ - uint32_t x32p_hold: 1; /*hold the current value of the output when setting the hold to �1�*/ - uint32_t x32p_drv: 2; /*the driver strength of the pad*/ - uint32_t x32n_rue: 1; /*the pull up enable of the pad*/ - uint32_t x32n_rde: 1; /*the pull down enable of the pad*/ - uint32_t x32n_hold: 1; /*hold the current value of the output when setting the hold to �1�*/ - uint32_t x32n_drv: 2; /*the driver strength of the pad*/ - }; - uint32_t val; - } xtal_32k_pad; - union { - struct { - uint32_t reserved0: 23; - uint32_t dcur: 2; /*touch sensor bias current. Should have option to tie with BIAS_SLEEP(When BIAS_SLEEP this setting is available*/ - uint32_t drange: 2; /*touch sensor saw wave voltage range.*/ - uint32_t drefl: 2; /*touch sensor saw wave bottom voltage.*/ - uint32_t drefh: 2; /*touch sensor saw wave top voltage.*/ - uint32_t xpd_bias: 1; /*touch sensor bias power on.*/ - }; - uint32_t val; - } touch_cfg; - union { - struct { - uint32_t reserved0: 12; - uint32_t to_gpio: 1; /*connect the rtc pad input to digital pad input �0� is availbale GPIO4*/ - uint32_t fun_ie: 1; /*the input enable of the pad*/ - uint32_t slp_oe: 1; /*the output enable of the pad in sleep status*/ - uint32_t slp_ie: 1; /*the input enable of the pad in sleep status*/ - uint32_t slp_sel: 1; /*the sleep status selection signal of the pad*/ - uint32_t fun_sel: 2; /*the functional selection signal of the pad*/ - uint32_t mux_sel: 1; /*�1� select the digital function �0�slection the rtc function*/ - uint32_t xpd: 1; /*touch sensor power on.*/ - uint32_t tie_opt: 1; /*default touch sensor tie option. 0: tie low 1: tie high.*/ - uint32_t start: 1; /*start touch sensor.*/ - uint32_t dac: 3; /*touch sensor slope control. 3-bit for each touch panel default 100.*/ - uint32_t reserved26: 1; - uint32_t rue: 1; /*the pull up enable of the pad*/ - uint32_t rde: 1; /*the pull down enable of the pad*/ - uint32_t drv: 2; /*the driver strength of the pad*/ - uint32_t hold: 1; /*hold the current value of the output when setting the hold to �1�*/ - }; - uint32_t val; - } touch_pad[10]; - union { - struct { - uint32_t reserved0: 27; - uint32_t sel: 5; /*select the wakeup source �0� select GPIO0 �1� select GPIO2 ...�17� select GPIO17*/ - }; - uint32_t val; - } ext_wakeup0; - union { - struct { - uint32_t reserved0: 27; - uint32_t sel: 5; /*select the external xtl power source �0� select GPIO0 �1� select GPIO2 ...�17� select GPIO17*/ - }; - uint32_t val; - } xtl_ext_ctr; - union { - struct { - uint32_t reserved0: 23; - uint32_t debug_bit_sel: 5; - uint32_t scl_sel: 2; /*�0� using TOUCH_PAD[0] as i2c clk �1� using TOUCH_PAD[2] as i2c clk*/ - uint32_t sda_sel: 2; /*�0� using TOUCH_PAD[1] as i2c sda �1� using TOUCH_PAD[3] as i2c sda*/ - }; - uint32_t val; - } sar_i2c_io; - union { - struct { - uint32_t date: 28; /*date*/ - uint32_t reserved28: 4; - }; - uint32_t val; - } date; -} rtc_io_dev_t; -extern rtc_io_dev_t RTCIO; - -#ifdef __cplusplus -} -#endif - -#endif /* _SOC_RTC_IO_STRUCT_H_ */ diff --git a/tools/sdk/include/soc/soc/rtc_periph.h b/tools/sdk/include/soc/soc/rtc_periph.h deleted file mode 100644 index 832186c3d8f..00000000000 --- a/tools/sdk/include/soc/soc/rtc_periph.h +++ /dev/null @@ -1,62 +0,0 @@ -// 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. - -#ifndef _SOC_RTC_PERIPH_H -#define _SOC_RTC_PERIPH_H -#include -#include "soc/rtc_io_reg.h" -#include "soc/rtc_cntl_reg.h" -#include "soc/rtc_gpio_channel.h" -#include "soc/gpio_pins.h" -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @brief Pin function information for a single GPIO pad's RTC functions. - * - * This is an internal function of the driver, and is not usually useful - * for external use. - */ -typedef struct { - uint32_t reg; /*!< Register of RTC pad, or 0 if not an RTC GPIO */ - uint32_t mux; /*!< Bit mask for selecting digital pad or RTC pad */ - uint32_t func; /*!< Shift of pad function (FUN_SEL) field */ - uint32_t ie; /*!< Mask of input enable */ - uint32_t pullup; /*!< Mask of pullup enable */ - uint32_t pulldown; /*!< Mask of pulldown enable */ - uint32_t slpsel; /*!< If slpsel bit is set, slpie will be used as pad input enabled signal in sleep mode */ - uint32_t slpie; /*!< Mask of input enable in sleep mode */ - uint32_t hold; /*!< Mask of hold enable */ - uint32_t hold_force;/*!< Mask of hold_force bit for RTC IO in RTC_CNTL_HOLD_FORCE_REG */ - uint32_t drv_v; /*!< Mask of drive capability */ - uint32_t drv_s; /*!< Offset of drive capability */ - int rtc_num; /*!< RTC IO number, or -1 if not an RTC GPIO */ -} rtc_gpio_desc_t; - -/** - * @brief Provides access to a constant table of RTC I/O pin - * function information. - * - * This is an internal function of the driver, and is not usually useful - * for external use. - */ -extern const rtc_gpio_desc_t rtc_gpio_desc[GPIO_PIN_COUNT]; - -#ifdef __cplusplus -} -#endif - -#endif // _SOC_RTC_PERIPH_H diff --git a/tools/sdk/include/soc/soc/rtc_wdt.h b/tools/sdk/include/soc/soc/rtc_wdt.h deleted file mode 100644 index bdaea942b4d..00000000000 --- a/tools/sdk/include/soc/soc/rtc_wdt.h +++ /dev/null @@ -1,202 +0,0 @@ -// 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. - -/* Recommendation of using API RTC_WDT. -1) Setting and enabling rtc_wdt: -@code - rtc_wdt_protect_off(); - rtc_wdt_disable(); - rtc_wdt_set_length_of_reset_signal(RTC_WDT_SYS_RESET_SIG, RTC_WDT_LENGTH_3_2us); - rtc_wdt_set_stage(RTC_WDT_STAGE0, RTC_WDT_STAGE_ACTION_RESET_SYSTEM); //RTC_WDT_STAGE_ACTION_RESET_SYSTEM or RTC_WDT_STAGE_ACTION_RESET_RTC - rtc_wdt_set_time(RTC_WDT_STAGE0, 7000); // timeout rtd_wdt 7000ms. - rtc_wdt_enable(); - rtc_wdt_protect_on(); - @endcode - -* If you use this option RTC_WDT_STAGE_ACTION_RESET_SYSTEM then after reset you can see these messages. -They can help to understand where the CPUs were when the WDT was triggered. - W (30) boot: PRO CPU has been reset by WDT. - W (30) boot: WDT reset info: PRO CPU PC=0x400xxxxx - ... function where it happened - - W (31) boot: WDT reset info: APP CPU PC=0x400xxxxx - ... function where it happened - -* If you use this option RTC_WDT_STAGE_ACTION_RESET_RTC then you will see message (rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)) -without description where were CPUs when it happened. - -2) Reset counter of rtc_wdt: -@code - rtc_wdt_feed(); -@endcode - -3) Disable rtc_wdt: -@code - rtc_wdt_disable(); -@endcode - */ - -#ifndef _SOC_RTC_WDT_H -#define _SOC_RTC_WDT_H - -#include -#include -#include "soc/rtc_cntl_reg.h" -#include "esp_err.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/// List of stage of rtc watchdog. WDT has 4 stage. -typedef enum { - RTC_WDT_STAGE0 = 0, /*!< Stage 0 */ - RTC_WDT_STAGE1 = 1, /*!< Stage 1 */ - RTC_WDT_STAGE2 = 2, /*!< Stage 2 */ - RTC_WDT_STAGE3 = 3 /*!< Stage 3 */ -} rtc_wdt_stage_t; - -/// List of action. When the time of stage expires this action will be triggered. -typedef enum { - RTC_WDT_STAGE_ACTION_OFF = RTC_WDT_STG_SEL_OFF, /*!< Disabled. This stage will have no effects on the system. */ - RTC_WDT_STAGE_ACTION_INTERRUPT = RTC_WDT_STG_SEL_INT, /*!< Trigger an interrupt. When the stage expires an interrupt is triggered. */ - RTC_WDT_STAGE_ACTION_RESET_CPU = RTC_WDT_STG_SEL_RESET_CPU, /*!< Reset a CPU core. */ - RTC_WDT_STAGE_ACTION_RESET_SYSTEM = RTC_WDT_STG_SEL_RESET_SYSTEM, /*!< Reset the main system includes the CPU and all peripherals. The RTC is an exception to this, and it will not be reset. */ - RTC_WDT_STAGE_ACTION_RESET_RTC = RTC_WDT_STG_SEL_RESET_RTC /*!< Reset the main system and the RTC. */ -} rtc_wdt_stage_action_t; - -/// Type of reset signal -typedef enum { - RTC_WDT_SYS_RESET_SIG = 0, /*!< System reset signal length selection */ - RTC_WDT_CPU_RESET_SIG = 1 /*!< CPU reset signal length selection */ -} rtc_wdt_reset_sig_t; - -/// Length of reset signal -typedef enum { - RTC_WDT_LENGTH_100ns = 0, /*!< 100 ns */ - RTC_WDT_LENGTH_200ns = 1, /*!< 200 ns */ - RTC_WDT_LENGTH_300ns = 2, /*!< 300 ns */ - RTC_WDT_LENGTH_400ns = 3, /*!< 400 ns */ - RTC_WDT_LENGTH_500ns = 4, /*!< 500 ns */ - RTC_WDT_LENGTH_800ns = 5, /*!< 800 ns */ - RTC_WDT_LENGTH_1_6us = 6, /*!< 1.6 us */ - RTC_WDT_LENGTH_3_2us = 7 /*!< 3.2 us */ -} rtc_wdt_length_sig_t; - -/** - * @brief Get status of protect of rtc_wdt. - * - * @return - * - True if the protect of RTC_WDT is set - */ -bool rtc_wdt_get_protect_status(); - -/** - * @brief Set protect of rtc_wdt. - */ -void rtc_wdt_protect_on(); - -/** - * @brief Reset protect of rtc_wdt. - */ -void rtc_wdt_protect_off(); - -/** - * @brief Enable rtc_wdt. - */ -void rtc_wdt_enable(); - -/** - * @brief Enable the flash boot protection procedure for WDT. - * - * Do not recommend to use it in the app. - * This function was added to be compatibility with the old bootloaders. - * This mode is disabled in bootloader or using rtc_wdt_disable() function. - */ -void rtc_wdt_flashboot_mode_enable(); - -/** - * @brief Disable rtc_wdt. - */ -void rtc_wdt_disable(); - -/** - * @brief Reset counter rtc_wdt. - * - * It returns to stage 0 and its expiry counter restarts from 0. - */ -void rtc_wdt_feed(); - -/** - * @brief Set time for required stage. - * - * @param[in] stage Stage of rtc_wdt. - * @param[in] timeout_ms Timeout for this stage. - * - * @return - * - ESP_OK In case of success - * - ESP_ERR_INVALID_ARG If stage has invalid value - */ -esp_err_t rtc_wdt_set_time(rtc_wdt_stage_t stage, unsigned int timeout_ms); - -/** - * @brief Get the timeout set for the required stage. - * - * @param[in] stage Stage of rtc_wdt. - * @param[out] timeout_ms Timeout set for this stage. (not elapsed time). - * - * @return - * - ESP_OK In case of success - * - ESP_ERR_INVALID_ARG If stage has invalid value - */ -esp_err_t rtc_wdt_get_timeout(rtc_wdt_stage_t stage, unsigned int* timeout_ms); - -/** - * @brief Set an action for required stage. - * - * @param[in] stage Stage of rtc_wdt. - * @param[in] stage_sel Action for this stage. When the time of stage expires this action will be triggered. - * - * @return - * - ESP_OK In case of success - * - ESP_ERR_INVALID_ARG If stage or stage_sel have invalid value - */ -esp_err_t rtc_wdt_set_stage(rtc_wdt_stage_t stage, rtc_wdt_stage_action_t stage_sel); - -/** - * @brief Set a length of reset signal. - * - * @param[in] reset_src Type of reset signal. - * @param[in] reset_signal_length A length of reset signal. - * - * @return - * - ESP_OK In case of success - * - ESP_ERR_INVALID_ARG If reset_src or reset_signal_length have invalid value - */ -esp_err_t rtc_wdt_set_length_of_reset_signal(rtc_wdt_reset_sig_t reset_src, rtc_wdt_length_sig_t reset_signal_length); - -/** - * @brief Return true if rtc_wdt is enabled. - * - * @return - * - True rtc_wdt is enabled - */ -bool rtc_wdt_is_on(); - -#ifdef __cplusplus -} -#endif - -#endif // _SOC_RTC_WDT_H diff --git a/tools/sdk/include/soc/soc/sdio_slave_periph.h b/tools/sdk/include/soc/soc/sdio_slave_periph.h deleted file mode 100644 index 467104dcf4a..00000000000 --- a/tools/sdk/include/soc/soc/sdio_slave_periph.h +++ /dev/null @@ -1,49 +0,0 @@ -// 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. - -#ifndef _SOC_SDIO_SLAVE_PERIPH_H_ -#define _SOC_SDIO_SLAVE_PERIPH_H_ - -#include -//include soc related (generated) definitions -#include "soc/sdio_slave_pins.h" -#include "soc/slc_reg.h" -#include "soc/slc_struct.h" -#include "soc/host_reg.h" -#include "soc/host_struct.h" -#include "soc/hinf_reg.h" -#include "soc/hinf_struct.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** pin and signal information of each slot */ -typedef struct { - uint32_t clk_gpio; - uint32_t cmd_gpio; - uint32_t d0_gpio; - uint32_t d1_gpio; - uint32_t d2_gpio; - uint32_t d3_gpio; - int func; -} sdio_slave_slot_info_t; - -extern const sdio_slave_slot_info_t sdio_slave_slot_info[]; - -#ifdef __cplusplus -} -#endif - -#endif /* _SOC_SDIO_SLAVE_PERIPH_H_ */ \ No newline at end of file diff --git a/tools/sdk/include/soc/soc/sdio_slave_pins.h b/tools/sdk/include/soc/soc/sdio_slave_pins.h deleted file mode 100644 index 97c8bec07fd..00000000000 --- a/tools/sdk/include/soc/soc/sdio_slave_pins.h +++ /dev/null @@ -1,34 +0,0 @@ -// 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. - -#ifndef _SOC_SDIO_SLAVE_PINS_H_ -#define _SOC_SDIO_SLAVE_PINS_H_ - -#define SDIO_SLAVE_SLOT0_IOMUX_PIN_NUM_CLK 6 -#define SDIO_SLAVE_SLOT0_IOMUX_PIN_NUM_CMD 11 -#define SDIO_SLAVE_SLOT0_IOMUX_PIN_NUM_D0 7 -#define SDIO_SLAVE_SLOT0_IOMUX_PIN_NUM_D1 8 -#define SDIO_SLAVE_SLOT0_IOMUX_PIN_NUM_D2 9 -#define SDIO_SLAVE_SLOT0_IOMUX_PIN_NUM_D3 10 -#define SDIO_SLAVE_SLOT0_FUNC 0 - -#define SDIO_SLAVE_SLOT1_IOMUX_PIN_NUM_CLK 14 -#define SDIO_SLAVE_SLOT1_IOMUX_PIN_NUM_CMD 15 -#define SDIO_SLAVE_SLOT1_IOMUX_PIN_NUM_D0 2 -#define SDIO_SLAVE_SLOT1_IOMUX_PIN_NUM_D1 4 -#define SDIO_SLAVE_SLOT1_IOMUX_PIN_NUM_D2 12 -#define SDIO_SLAVE_SLOT1_IOMUX_PIN_NUM_D3 13 -#define SDIO_SLAVE_SLOT1_FUNC 4 - -#endif /* _SOC_SDIO_SLAVE_PINS_H_ */ \ No newline at end of file diff --git a/tools/sdk/include/soc/soc/sdmmc_periph.h b/tools/sdk/include/soc/soc/sdmmc_periph.h deleted file mode 100644 index 79dfaf34abd..00000000000 --- a/tools/sdk/include/soc/soc/sdmmc_periph.h +++ /dev/null @@ -1,53 +0,0 @@ -// 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. - -#ifndef _SOC_SDMMC_PERIPH_H_ -#define _SOC_SDMMC_PERIPH_H_ - -#include -//include soc related (generated) definitions -#include "soc/sdmmc_pins.h" -#include "soc/sdmmc_reg.h" -#include "soc/sdmmc_struct.h" -#include "soc/gpio_sig_map.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { - uint8_t clk_gpio; - uint8_t cmd_gpio; - uint8_t d0_gpio; - uint8_t d1_gpio; - uint8_t d2_gpio; - uint8_t d3_gpio; - uint8_t d4_gpio; - uint8_t d5_gpio; - uint8_t d6_gpio; - uint8_t d7_gpio; - uint8_t card_detect; - uint8_t write_protect; - uint8_t card_int; - uint8_t width; -} sdmmc_slot_info_t; - -/** pin and signal information of each slot */ -extern const sdmmc_slot_info_t sdmmc_slot_info[]; - -#ifdef __cplusplus -} -#endif - -#endif /* _SOC_SDMMC_PERIPH_H_ */ \ No newline at end of file diff --git a/tools/sdk/include/soc/soc/sdmmc_pins.h b/tools/sdk/include/soc/soc/sdmmc_pins.h deleted file mode 100644 index c0b328239ad..00000000000 --- a/tools/sdk/include/soc/soc/sdmmc_pins.h +++ /dev/null @@ -1,38 +0,0 @@ -// 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. - -#ifndef _SOC_SDMMC_PINS_H_ -#define _SOC_SDMMC_PINS_H_ - -#define SDMMC_SLOT0_IOMUX_PIN_NUM_CLK 6 -#define SDMMC_SLOT0_IOMUX_PIN_NUM_CMD 11 -#define SDMMC_SLOT0_IOMUX_PIN_NUM_D0 7 -#define SDMMC_SLOT0_IOMUX_PIN_NUM_D1 8 -#define SDMMC_SLOT0_IOMUX_PIN_NUM_D2 9 -#define SDMMC_SLOT0_IOMUX_PIN_NUM_D3 10 -#define SDMMC_SLOT0_IOMUX_PIN_NUM_D4 16 -#define SDMMC_SLOT0_IOMUX_PIN_NUM_D5 17 -#define SDMMC_SLOT0_IOMUX_PIN_NUM_D6 5 -#define SDMMC_SLOT0_IOMUX_PIN_NUM_D7 18 -#define SDMMC_SLOT0_FUNC 0 - -#define SDMMC_SLOT1_IOMUX_PIN_NUM_CLK 14 -#define SDMMC_SLOT1_IOMUX_PIN_NUM_CMD 15 -#define SDMMC_SLOT1_IOMUX_PIN_NUM_D0 2 -#define SDMMC_SLOT1_IOMUX_PIN_NUM_D1 4 -#define SDMMC_SLOT1_IOMUX_PIN_NUM_D2 12 -#define SDMMC_SLOT1_IOMUX_PIN_NUM_D3 13 -#define SDMMC_SLOT1_FUNC 4 - -#endif /* _SOC_SDMMC_PINS_H_ */ \ No newline at end of file diff --git a/tools/sdk/include/soc/soc/sdmmc_reg.h b/tools/sdk/include/soc/soc/sdmmc_reg.h deleted file mode 100644 index 0e92f682244..00000000000 --- a/tools/sdk/include/soc/soc/sdmmc_reg.h +++ /dev/null @@ -1,97 +0,0 @@ -// 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. -#ifndef _SOC_SDMMC_REG_H_ -#define _SOC_SDMMC_REG_H_ -#include "soc.h" - -#define SDMMC_CTRL_REG (DR_REG_SDMMC_BASE + 0x00) -#define SDMMC_PWREN_REG (DR_REG_SDMMC_BASE + 0x04) -#define SDMMC_CLKDIV_REG (DR_REG_SDMMC_BASE + 0x08) -#define SDMMC_CLKSRC_REG (DR_REG_SDMMC_BASE + 0x0c) -#define SDMMC_CLKENA_REG (DR_REG_SDMMC_BASE + 0x10) -#define SDMMC_TMOUT_REG (DR_REG_SDMMC_BASE + 0x14) -#define SDMMC_CTYPE_REG (DR_REG_SDMMC_BASE + 0x18) -#define SDMMC_BLKSIZ_REG (DR_REG_SDMMC_BASE + 0x1c) -#define SDMMC_BYTCNT_REG (DR_REG_SDMMC_BASE + 0x20) -#define SDMMC_INTMASK_REG (DR_REG_SDMMC_BASE + 0x24) -#define SDMMC_CMDARG_REG (DR_REG_SDMMC_BASE + 0x28) -#define SDMMC_CMD_REG (DR_REG_SDMMC_BASE + 0x2c) -#define SDMMC_RESP0_REG (DR_REG_SDMMC_BASE + 0x30) -#define SDMMC_RESP1_REG (DR_REG_SDMMC_BASE + 0x34) -#define SDMMC_RESP2_REG (DR_REG_SDMMC_BASE + 0x38) -#define SDMMC_RESP3_REG (DR_REG_SDMMC_BASE + 0x3c) - -#define SDMMC_MINTSTS_REG (DR_REG_SDMMC_BASE + 0x40) -#define SDMMC_RINTSTS_REG (DR_REG_SDMMC_BASE + 0x44) -#define SDMMC_STATUS_REG (DR_REG_SDMMC_BASE + 0x48) -#define SDMMC_FIFOTH_REG (DR_REG_SDMMC_BASE + 0x4c) -#define SDMMC_CDETECT_REG (DR_REG_SDMMC_BASE + 0x50) -#define SDMMC_WRTPRT_REG (DR_REG_SDMMC_BASE + 0x54) -#define SDMMC_GPIO_REG (DR_REG_SDMMC_BASE + 0x58) -#define SDMMC_TCBCNT_REG (DR_REG_SDMMC_BASE + 0x5c) -#define SDMMC_TBBCNT_REG (DR_REG_SDMMC_BASE + 0x60) -#define SDMMC_DEBNCE_REG (DR_REG_SDMMC_BASE + 0x64) -#define SDMMC_USRID_REG (DR_REG_SDMMC_BASE + 0x68) -#define SDMMC_VERID_REG (DR_REG_SDMMC_BASE + 0x6c) -#define SDMMC_HCON_REG (DR_REG_SDMMC_BASE + 0x70) -#define SDMMC_UHS_REG_REG (DR_REG_SDMMC_BASE + 0x74) -#define SDMMC_RST_N_REG (DR_REG_SDMMC_BASE + 0x78) -#define SDMMC_BMOD_REG (DR_REG_SDMMC_BASE + 0x80) -#define SDMMC_PLDMND_REG (DR_REG_SDMMC_BASE + 0x84) -#define SDMMC_DBADDR_REG (DR_REG_SDMMC_BASE + 0x88) -#define SDMMC_DBADDRU_REG (DR_REG_SDMMC_BASE + 0x8c) -#define SDMMC_IDSTS_REG (DR_REG_SDMMC_BASE + 0x8c) -#define SDMMC_IDINTEN_REG (DR_REG_SDMMC_BASE + 0x90) -#define SDMMC_DSCADDR_REG (DR_REG_SDMMC_BASE + 0x94) -#define SDMMC_DSCADDRL_REG (DR_REG_SDMMC_BASE + 0x98) -#define SDMMC_DSCADDRU_REG (DR_REG_SDMMC_BASE + 0x9c) -#define SDMMC_BUFADDRL_REG (DR_REG_SDMMC_BASE + 0xa0) -#define SDMMC_BUFADDRU_REG (DR_REG_SDMMC_BASE + 0xa4) -#define SDMMC_CARDTHRCTL_REG (DR_REG_SDMMC_BASE + 0x100) -#define SDMMC_BACK_END_POWER_REG (DR_REG_SDMMC_BASE + 0x104) -#define SDMMC_UHS_REG_EXT_REG (DR_REG_SDMMC_BASE + 0x108) -#define SDMMC_EMMC_DDR_REG_REG (DR_REG_SDMMC_BASE + 0x10c) -#define SDMMC_ENABLE_SHIFT_REG (DR_REG_SDMMC_BASE + 0x110) - -#define SDMMC_CLOCK_REG (DR_REG_SDMMC_BASE + 0x800) - -#define SDMMC_INTMASK_IO_SLOT1 BIT(17) -#define SDMMC_INTMASK_IO_SLOT0 BIT(16) -#define SDMMC_INTMASK_EBE BIT(15) -#define SDMMC_INTMASK_ACD BIT(14) -#define SDMMC_INTMASK_SBE BIT(13) -#define SDMMC_INTMASK_BCI BIT(13) -#define SDMMC_INTMASK_HLE BIT(12) -#define SDMMC_INTMASK_FRUN BIT(11) -#define SDMMC_INTMASK_HTO BIT(10) -#define SDMMC_INTMASK_DTO BIT(9) -#define SDMMC_INTMASK_RTO BIT(8) -#define SDMMC_INTMASK_DCRC BIT(7) -#define SDMMC_INTMASK_RCRC BIT(6) -#define SDMMC_INTMASK_RXDR BIT(5) -#define SDMMC_INTMASK_TXDR BIT(4) -#define SDMMC_INTMASK_DATA_OVER BIT(3) -#define SDMMC_INTMASK_CMD_DONE BIT(2) -#define SDMMC_INTMASK_RESP_ERR BIT(1) -#define SDMMC_INTMASK_CD BIT(0) - -#define SDMMC_IDMAC_INTMASK_AI BIT(9) -#define SDMMC_IDMAC_INTMASK_NI BIT(8) -#define SDMMC_IDMAC_INTMASK_CES BIT(5) -#define SDMMC_IDMAC_INTMASK_DU BIT(4) -#define SDMMC_IDMAC_INTMASK_FBE BIT(2) -#define SDMMC_IDMAC_INTMASK_RI BIT(1) -#define SDMMC_IDMAC_INTMASK_TI BIT(0) - -#endif /* _SOC_SDMMC_REG_H_ */ diff --git a/tools/sdk/include/soc/soc/sdmmc_struct.h b/tools/sdk/include/soc/soc/sdmmc_struct.h deleted file mode 100644 index 6aa64b43cc3..00000000000 --- a/tools/sdk/include/soc/soc/sdmmc_struct.h +++ /dev/null @@ -1,391 +0,0 @@ -// 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. -#ifndef _SOC_SDMMC_STRUCT_H_ -#define _SOC_SDMMC_STRUCT_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { - uint32_t reserved1: 1; - uint32_t disable_int_on_completion: 1; - uint32_t last_descriptor: 1; - uint32_t first_descriptor: 1; - uint32_t second_address_chained: 1; - uint32_t end_of_ring: 1; - uint32_t reserved2: 24; - uint32_t card_error_summary: 1; - uint32_t owned_by_idmac: 1; - uint32_t buffer1_size: 13; - uint32_t buffer2_size: 13; - uint32_t reserved3: 6; - void* buffer1_ptr; - union { - void* buffer2_ptr; - void* next_desc_ptr; - }; -} sdmmc_desc_t; - -#define SDMMC_DMA_MAX_BUF_LEN 4096 - -_Static_assert(sizeof(sdmmc_desc_t) == 16, "invalid size of sdmmc_desc_t structure"); - - -typedef struct { - uint32_t cmd_index: 6; ///< Command index - uint32_t response_expect: 1; ///< set if response is expected - uint32_t response_long: 1; ///< 0: short response expected, 1: long response expected - uint32_t check_response_crc: 1; ///< set if controller should check response CRC - uint32_t data_expected: 1; ///< 0: no data expected, 1: data expected - uint32_t rw: 1; ///< 0: read from card, 1: write to card (don't care if no data expected) - uint32_t stream_mode: 1; ///< 0: block transfer, 1: stream transfer (don't care if no data expected) - uint32_t send_auto_stop: 1; ///< set to send stop at the end of the transfer - uint32_t wait_complete: 1; ///< 0: send command at once, 1: wait for previous command to complete - uint32_t stop_abort_cmd: 1; ///< set if this is a stop or abort command intended to stop current transfer - uint32_t send_init: 1; ///< set to send init sequence (80 clocks of 1) - uint32_t card_num: 5; ///< card number - uint32_t update_clk_reg: 1; ///< 0: normal command, 1: don't send command, just update clock registers - uint32_t read_ceata: 1; ///< set if performing read from CE-ATA device - uint32_t ccs_expected: 1; ///< set if CCS is expected from CE-ATA device - uint32_t enable_boot: 1; ///< set for mandatory boot mode - uint32_t expect_boot_ack: 1; ///< when set along with enable_boot, controller expects boot ack pattern - uint32_t disable_boot: 1; ///< set to terminate boot operation (don't set along with enable_boot) - uint32_t boot_mode: 1; ///< 0: mandatory boot operation, 1: alternate boot operation - uint32_t volt_switch: 1; ///< set to enable voltage switching (for CMD11 only) - uint32_t use_hold_reg: 1; ///< clear to bypass HOLD register - uint32_t reserved: 1; - uint32_t start_command: 1; ///< Start command; once command is sent to the card, bit is cleared. -} sdmmc_hw_cmd_t; ///< command format used in cmd register; this structure is defined to make it easier to build command values - -_Static_assert(sizeof(sdmmc_hw_cmd_t) == 4, "invalid size of sdmmc_cmd_t structure"); - - -typedef volatile struct { - union { - struct { - uint32_t controller_reset: 1; - uint32_t fifo_reset: 1; - uint32_t dma_reset: 1; - uint32_t reserved1: 1; - uint32_t int_enable: 1; - uint32_t dma_enable: 1; - uint32_t read_wait: 1; - uint32_t send_irq_response: 1; - uint32_t abort_read_data: 1; - uint32_t send_ccsd: 1; - uint32_t send_auto_stop_ccsd: 1; - uint32_t ceata_device_interrupt_status: 1; - uint32_t reserved2: 4; - uint32_t card_voltage_a: 4; - uint32_t card_voltage_b: 4; - uint32_t enable_od_pullup: 1; - uint32_t use_internal_dma: 1; - uint32_t reserved3: 6; - }; - uint32_t val; - } ctrl; - - uint32_t pwren; ///< 1: enable power to card, 0: disable power to card - - union { - struct { - uint32_t div0: 8; ///< 0: bypass, 1-255: divide clock by (2*div0). - uint32_t div1: 8; ///< 0: bypass, 1-255: divide clock by (2*div0). - uint32_t div2: 8; ///< 0: bypass, 1-255: divide clock by (2*div0). - uint32_t div3: 8; ///< 0: bypass, 1-255: divide clock by (2*div0). - }; - uint32_t val; - } clkdiv; - - union { - struct { - uint32_t card0: 2; ///< 0-3: select clock divider for card 0 among div0-div3 - uint32_t card1: 2; ///< 0-3: select clock divider for card 1 among div0-div3 - uint32_t reserved: 28; - }; - uint32_t val; - } clksrc; - - union { - struct { - uint32_t cclk_enable: 16; ///< 1: enable clock to card, 0: disable clock - uint32_t cclk_low_power: 16; ///< 1: enable clock gating when card is idle, 0: disable clock gating - }; - uint32_t val; - } clkena; - - union { - struct { - uint32_t response: 8; ///< response timeout, in card output clock cycles - uint32_t data: 24; ///< data read timeout, in card output clock cycles - }; - uint32_t val; - } tmout; - - union { - struct { - uint32_t card_width: 16; ///< one bit for each card: 0: 1-bit mode, 1: 4-bit mode - uint32_t card_width_8: 16; ///< one bit for each card: 0: not 8-bit mode (corresponding card_width bit is used), 1: 8-bit mode (card_width bit is ignored) - }; - uint32_t val; - } ctype; - - uint32_t blksiz: 16; ///< block size, default 0x200 - uint32_t : 16; - - uint32_t bytcnt; ///< number of bytes to be transferred - - union { - struct { - uint32_t cd: 1; ///< Card detect interrupt enable - uint32_t re: 1; ///< Response error interrupt enable - uint32_t cmd_done: 1; ///< Command done interrupt enable - uint32_t dto: 1; ///< Data transfer over interrupt enable - uint32_t txdr: 1; ///< Transmit FIFO data request interrupt enable - uint32_t rxdr: 1; ///< Receive FIFO data request interrupt enable - uint32_t rcrc: 1; ///< Response CRC error interrupt enable - uint32_t dcrc: 1; ///< Data CRC error interrupt enable - uint32_t rto: 1; ///< Response timeout interrupt enable - uint32_t drto: 1; ///< Data read timeout interrupt enable - uint32_t hto: 1; ///< Data starvation-by-host timeout interrupt enable - uint32_t frun: 1; ///< FIFO underrun/overrun error interrupt enable - uint32_t hle: 1; ///< Hardware locked write error interrupt enable - uint32_t sbi_bci: 1; ///< Start bit error / busy clear interrupt enable - uint32_t acd: 1; ///< Auto command done interrupt enable - uint32_t ebe: 1; ///< End bit error / write no CRC interrupt enable - uint32_t sdio: 16; ///< SDIO interrupt enable - }; - uint32_t val; - } intmask; - - uint32_t cmdarg; ///< Command argument to be passed to card - - sdmmc_hw_cmd_t cmd; - - uint32_t resp[4]; ///< Response from card - - union { - struct { - uint32_t cd: 1; ///< Card detect interrupt masked status - uint32_t re: 1; ///< Response error interrupt masked status - uint32_t cmd_done: 1; ///< Command done interrupt masked status - uint32_t dto: 1; ///< Data transfer over interrupt masked status - uint32_t txdr: 1; ///< Transmit FIFO data request interrupt masked status - uint32_t rxdr: 1; ///< Receive FIFO data request interrupt masked status - uint32_t rcrc: 1; ///< Response CRC error interrupt masked status - uint32_t dcrc: 1; ///< Data CRC error interrupt masked status - uint32_t rto: 1; ///< Response timeout interrupt masked status - uint32_t drto: 1; ///< Data read timeout interrupt masked status - uint32_t hto: 1; ///< Data starvation-by-host timeout interrupt masked status - uint32_t frun: 1; ///< FIFO underrun/overrun error interrupt masked status - uint32_t hle: 1; ///< Hardware locked write error interrupt masked status - uint32_t sbi_bci: 1; ///< Start bit error / busy clear interrupt masked status - uint32_t acd: 1; ///< Auto command done interrupt masked status - uint32_t ebe: 1; ///< End bit error / write no CRC interrupt masked status - uint32_t sdio: 16; ///< SDIO interrupt masked status - }; - uint32_t val; - } mintsts; - - union { - struct { - uint32_t cd: 1; ///< Card detect raw interrupt status - uint32_t re: 1; ///< Response error raw interrupt status - uint32_t cmd_done: 1; ///< Command done raw interrupt status - uint32_t dto: 1; ///< Data transfer over raw interrupt status - uint32_t txdr: 1; ///< Transmit FIFO data request raw interrupt status - uint32_t rxdr: 1; ///< Receive FIFO data request raw interrupt status - uint32_t rcrc: 1; ///< Response CRC error raw interrupt status - uint32_t dcrc: 1; ///< Data CRC error raw interrupt status - uint32_t rto: 1; ///< Response timeout raw interrupt status - uint32_t drto: 1; ///< Data read timeout raw interrupt status - uint32_t hto: 1; ///< Data starvation-by-host timeout raw interrupt status - uint32_t frun: 1; ///< FIFO underrun/overrun error raw interrupt status - uint32_t hle: 1; ///< Hardware locked write error raw interrupt status - uint32_t sbi_bci: 1; ///< Start bit error / busy clear raw interrupt status - uint32_t acd: 1; ///< Auto command done raw interrupt status - uint32_t ebe: 1; ///< End bit error / write no CRC raw interrupt status - uint32_t sdio: 16; ///< SDIO raw interrupt status - }; - uint32_t val; - } rintsts; ///< interrupts can be cleared by writing this register - - union { - struct { - uint32_t fifo_rx_watermark: 1; ///< FIFO reached receive watermark level - uint32_t fifo_tx_watermark: 1; ///< FIFO reached transmit watermark level - uint32_t fifo_empty: 1; ///< FIFO is empty - uint32_t fifo_full: 1; ///< FIFO is full - uint32_t cmd_fsm_state: 4; ///< command FSM state - uint32_t data3_status: 1; ///< this bit reads 1 if card is present - uint32_t data_busy: 1; ///< this bit reads 1 if card is busy - uint32_t data_fsm_busy: 1; ///< this bit reads 1 if transmit/receive FSM is busy - uint32_t response_index: 6; ///< index of the previous response - uint32_t fifo_count: 13; ///< number of filled locations in the FIFO - uint32_t dma_ack: 1; ///< DMA acknowledge signal - uint32_t dma_req: 1; ///< DMA request signal - }; - uint32_t val; - } status; - - union { - struct { - uint32_t tx_watermark: 12; ///< FIFO TX watermark level - uint32_t reserved1: 4; - uint32_t rx_watermark: 12; ///< FIFO RX watermark level - uint32_t dw_dma_mts: 3; - uint32_t reserved2: 1; - }; - uint32_t val; - } fifoth; - - union { - struct { - uint32_t cards: 2; ///< bit N reads 0 if card N is present - uint32_t reserved: 30; - }; - uint32_t val; - } cdetect; - - union { - struct { - uint32_t cards: 2; ///< bit N reads 1 if card N is write protected - uint32_t reserved: 30; - }; - uint32_t val; - } wrtprt; - - uint32_t gpio; ///< unused - uint32_t tcbcnt; ///< transferred (to card) byte count - uint32_t tbbcnt; ///< transferred from host to FIFO byte count - - union { - struct { - uint32_t debounce_count: 24; ///< number of host cycles used by debounce filter, typical time should be 5-25ms - uint32_t reserved: 8; - }; - } debnce; - - uint32_t usrid; ///< user ID - uint32_t verid; ///< IP block version - uint32_t hcon; ///< compile-time IP configuration - union { - struct { - uint32_t voltage: 16; ///< voltage control for slots; no-op on ESP32. - uint32_t ddr: 16; ///< bit N enables DDR mode for card N - }; - } uhs; ///< UHS related settings - - union { - struct { - uint32_t cards: 2; ///< bit N resets card N, active low - uint32_t reserved: 30; - }; - } rst_n; - - uint32_t reserved_7c; - - union { - struct { - uint32_t sw_reset: 1; ///< set to reset DMA controller - uint32_t fb: 1; ///< set if AHB master performs fixed burst transfers - uint32_t dsl: 5; ///< descriptor skip length: number of words to skip between two unchained descriptors - uint32_t enable: 1; ///< set to enable IDMAC - uint32_t pbl: 3; ///< programmable burst length - uint32_t reserved: 21; - }; - uint32_t val; - } bmod; - - uint32_t pldmnd; ///< set any bit to resume IDMAC FSM from suspended state - sdmmc_desc_t* dbaddr; ///< descriptor list base - - union { - struct { - uint32_t ti: 1; ///< transmit interrupt status - uint32_t ri: 1; ///< receive interrupt status - uint32_t fbe: 1; ///< fatal bus error - uint32_t reserved1: 1; - uint32_t du: 1; ///< descriptor unavailable - uint32_t ces: 1; ///< card error summary - uint32_t reserved2: 2; - uint32_t nis: 1; ///< normal interrupt summary - uint32_t fbe_code: 3; ///< code of fatal bus error - uint32_t fsm: 4; ///< DMAC FSM state - uint32_t reserved3: 15; - }; - uint32_t val; - } idsts; - - union { - struct { - uint32_t ti: 1; ///< transmit interrupt enable - uint32_t ri: 1; ///< receive interrupt enable - uint32_t fbe: 1; ///< fatal bus error interrupt enable - uint32_t reserved1: 1; - uint32_t du: 1; ///< descriptor unavailable interrupt enable - uint32_t ces: 1; ///< card error interrupt enable - uint32_t reserved2: 2; - uint32_t ni: 1; ///< normal interrupt interrupt enable - uint32_t ai: 1; ///< abnormal interrupt enable - uint32_t reserved3: 22; - }; - uint32_t val; - } idinten; - - uint32_t dscaddr; ///< current host descriptor address - uint32_t dscaddrl; ///< unused - uint32_t dscaddru; ///< unused - uint32_t bufaddrl; ///< unused - uint32_t bufaddru; ///< unused - uint32_t reserved_a8[22]; - union { - struct { - uint32_t read_thr_en : 1; ///< initiate transfer only if FIFO has more space than the read threshold - uint32_t busy_clr_int_en : 1; ///< enable generation of busy clear interrupts - uint32_t write_thr_en : 1; ///< equivalent of read_thr_en for writes - uint32_t reserved1 : 13; - uint32_t card_threshold : 12; ///< threshold value for reads/writes, in bytes - }; - uint32_t val; - } cardthrctl; - uint32_t back_end_power; - uint32_t uhs_reg_ext; - uint32_t emmc_ddr_reg; - uint32_t enable_shift; - uint32_t reserved_114[443]; - union { - struct { - uint32_t phase_dout: 3; ///< phase of data output clock (0x0: 0, 0x1: 90, 0x4: 180, 0x6: 270) - uint32_t phase_din: 3; ///< phase of data input clock - uint32_t phase_core: 3; ///< phase of the clock to SDMMC peripheral - uint32_t div_factor_p: 4; ///< controls clock period; it will be (div_factor_p + 1) / 160MHz - uint32_t div_factor_h: 4; ///< controls length of high pulse; it will be (div_factor_h + 1) / 160MHz - uint32_t div_factor_m: 4; ///< should be equal to div_factor_p - }; - uint32_t val; - } clock; -} sdmmc_dev_t; -extern sdmmc_dev_t SDMMC; - -_Static_assert(sizeof(sdmmc_dev_t) == 0x804, "invalid size of sdmmc_dev_t structure"); - -#ifdef __cplusplus -} -#endif - -#endif //_SOC_SDMMC_STRUCT_H_ diff --git a/tools/sdk/include/soc/soc/sens_reg.h b/tools/sdk/include/soc/soc/sens_reg.h deleted file mode 100644 index 34834376e89..00000000000 --- a/tools/sdk/include/soc/soc/sens_reg.h +++ /dev/null @@ -1,1068 +0,0 @@ -// 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. -#ifndef _SOC_SENS_REG_H_ -#define _SOC_SENS_REG_H_ - - -#include "soc.h" -#define SENS_SAR_READ_CTRL_REG (DR_REG_SENS_BASE + 0x0000) -/* SENS_SAR1_DATA_INV : R/W ;bitpos:[28] ;default: 1'd0 ; */ -/*description: Invert SAR ADC1 data*/ -#define SENS_SAR1_DATA_INV (BIT(28)) -#define SENS_SAR1_DATA_INV_M (BIT(28)) -#define SENS_SAR1_DATA_INV_V 0x1 -#define SENS_SAR1_DATA_INV_S 28 -/* SENS_SAR1_DIG_FORCE : R/W ;bitpos:[27] ;default: 1'd0 ; */ -/*description: 1: SAR ADC1 controlled by DIG ADC1 CTRL 0: SAR ADC1 controlled by RTC ADC1 CTRL*/ -#define SENS_SAR1_DIG_FORCE (BIT(27)) -#define SENS_SAR1_DIG_FORCE_M (BIT(27)) -#define SENS_SAR1_DIG_FORCE_V 0x1 -#define SENS_SAR1_DIG_FORCE_S 27 -/* SENS_SAR1_SAMPLE_NUM : R/W ;bitpos:[26:19] ;default: 8'd0 ; */ -/*description: */ -#define SENS_SAR1_SAMPLE_NUM 0x000000FF -#define SENS_SAR1_SAMPLE_NUM_M ((SENS_SAR1_SAMPLE_NUM_V)<<(SENS_SAR1_SAMPLE_NUM_S)) -#define SENS_SAR1_SAMPLE_NUM_V 0xFF -#define SENS_SAR1_SAMPLE_NUM_S 19 -/* SENS_SAR1_CLK_GATED : R/W ;bitpos:[18] ;default: 1'b1 ; */ -/*description: */ -#define SENS_SAR1_CLK_GATED (BIT(18)) -#define SENS_SAR1_CLK_GATED_M (BIT(18)) -#define SENS_SAR1_CLK_GATED_V 0x1 -#define SENS_SAR1_CLK_GATED_S 18 -/* SENS_SAR1_SAMPLE_BIT : R/W ;bitpos:[17:16] ;default: 2'd3 ; */ -/*description: 00: for 9-bit width 01: for 10-bit width 10: for 11-bit width - 11: for 12-bit width*/ -#define SENS_SAR1_SAMPLE_BIT 0x00000003 -#define SENS_SAR1_SAMPLE_BIT_M ((SENS_SAR1_SAMPLE_BIT_V)<<(SENS_SAR1_SAMPLE_BIT_S)) -#define SENS_SAR1_SAMPLE_BIT_V 0x3 -#define SENS_SAR1_SAMPLE_BIT_S 16 -/* SENS_SAR1_SAMPLE_CYCLE : R/W ;bitpos:[15:8] ;default: 8'd9 ; */ -/*description: sample cycles for SAR ADC1*/ -#define SENS_SAR1_SAMPLE_CYCLE 0x000000FF -#define SENS_SAR1_SAMPLE_CYCLE_M ((SENS_SAR1_SAMPLE_CYCLE_V)<<(SENS_SAR1_SAMPLE_CYCLE_S)) -#define SENS_SAR1_SAMPLE_CYCLE_V 0xFF -#define SENS_SAR1_SAMPLE_CYCLE_S 8 -/* SENS_SAR1_CLK_DIV : R/W ;bitpos:[7:0] ;default: 8'd2 ; */ -/*description: clock divider*/ -#define SENS_SAR1_CLK_DIV 0x000000FF -#define SENS_SAR1_CLK_DIV_M ((SENS_SAR1_CLK_DIV_V)<<(SENS_SAR1_CLK_DIV_S)) -#define SENS_SAR1_CLK_DIV_V 0xFF -#define SENS_SAR1_CLK_DIV_S 0 - -#define SENS_SAR_READ_STATUS1_REG (DR_REG_SENS_BASE + 0x0004) -/* SENS_SAR1_READER_STATUS : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define SENS_SAR1_READER_STATUS 0xFFFFFFFF -#define SENS_SAR1_READER_STATUS_M ((SENS_SAR1_READER_STATUS_V)<<(SENS_SAR1_READER_STATUS_S)) -#define SENS_SAR1_READER_STATUS_V 0xFFFFFFFF -#define SENS_SAR1_READER_STATUS_S 0 - -#define SENS_SAR_MEAS_WAIT1_REG (DR_REG_SENS_BASE + 0x0008) -/* SENS_SAR_AMP_WAIT2 : R/W ;bitpos:[31:16] ;default: 16'd10 ; */ -/*description: */ -#define SENS_SAR_AMP_WAIT2 0x0000FFFF -#define SENS_SAR_AMP_WAIT2_M ((SENS_SAR_AMP_WAIT2_V)<<(SENS_SAR_AMP_WAIT2_S)) -#define SENS_SAR_AMP_WAIT2_V 0xFFFF -#define SENS_SAR_AMP_WAIT2_S 16 -/* SENS_SAR_AMP_WAIT1 : R/W ;bitpos:[15:0] ;default: 16'd10 ; */ -/*description: */ -#define SENS_SAR_AMP_WAIT1 0x0000FFFF -#define SENS_SAR_AMP_WAIT1_M ((SENS_SAR_AMP_WAIT1_V)<<(SENS_SAR_AMP_WAIT1_S)) -#define SENS_SAR_AMP_WAIT1_V 0xFFFF -#define SENS_SAR_AMP_WAIT1_S 0 - -#define SENS_SAR_MEAS_WAIT2_REG (DR_REG_SENS_BASE + 0x000c) -/* SENS_SAR2_RSTB_WAIT : R/W ;bitpos:[27:20] ;default: 8'd2 ; */ -/*description: */ -#define SENS_SAR2_RSTB_WAIT 0x000000FF -#define SENS_SAR2_RSTB_WAIT_M ((SENS_SAR2_RSTB_WAIT_V)<<(SENS_SAR2_RSTB_WAIT_S)) -#define SENS_SAR2_RSTB_WAIT_V 0xFF -#define SENS_SAR2_RSTB_WAIT_S 20 -/* SENS_FORCE_XPD_SAR : R/W ;bitpos:[19:18] ;default: 2'd0 ; */ -/*description: */ -#define SENS_FORCE_XPD_SAR 0x00000003 -#define SENS_FORCE_XPD_SAR_M ((SENS_FORCE_XPD_SAR_V)<<(SENS_FORCE_XPD_SAR_S)) -#define SENS_FORCE_XPD_SAR_V 0x3 -#define SENS_FORCE_XPD_SAR_S 18 -#define SENS_FORCE_XPD_SAR_SW_M (BIT1) -#define SENS_FORCE_XPD_SAR_FSM 0 // Use FSM to control power down -#define SENS_FORCE_XPD_SAR_PD 2 // Force power down -#define SENS_FORCE_XPD_SAR_PU 3 // Force power up -/* SENS_FORCE_XPD_AMP : R/W ;bitpos:[17:16] ;default: 2'd0 ; */ -/*description: */ -#define SENS_FORCE_XPD_AMP 0x00000003 -#define SENS_FORCE_XPD_AMP_M ((SENS_FORCE_XPD_AMP_V)<<(SENS_FORCE_XPD_AMP_S)) -#define SENS_FORCE_XPD_AMP_V 0x3 -#define SENS_FORCE_XPD_AMP_S 16 -#define SENS_FORCE_XPD_AMP_FSM 0 // Use FSM to control power down -#define SENS_FORCE_XPD_AMP_PD 2 // Force power down -#define SENS_FORCE_XPD_AMP_PU 3 // Force power up -/* SENS_SAR_AMP_WAIT3 : R/W ;bitpos:[15:0] ;default: 16'd10 ; */ -/*description: */ -#define SENS_SAR_AMP_WAIT3 0x0000FFFF -#define SENS_SAR_AMP_WAIT3_M ((SENS_SAR_AMP_WAIT3_V)<<(SENS_SAR_AMP_WAIT3_S)) -#define SENS_SAR_AMP_WAIT3_V 0xFFFF -#define SENS_SAR_AMP_WAIT3_S 0 - -#define SENS_SAR_MEAS_CTRL_REG (DR_REG_SENS_BASE + 0x0010) -/* SENS_SAR2_XPD_WAIT : R/W ;bitpos:[31:24] ;default: 8'h7 ; */ -/*description: */ -#define SENS_SAR2_XPD_WAIT 0x000000FF -#define SENS_SAR2_XPD_WAIT_M ((SENS_SAR2_XPD_WAIT_V)<<(SENS_SAR2_XPD_WAIT_S)) -#define SENS_SAR2_XPD_WAIT_V 0xFF -#define SENS_SAR2_XPD_WAIT_S 24 -/* SENS_SAR_RSTB_FSM : R/W ;bitpos:[23:20] ;default: 4'b0000 ; */ -/*description: */ -#define SENS_SAR_RSTB_FSM 0x0000000F -#define SENS_SAR_RSTB_FSM_M ((SENS_SAR_RSTB_FSM_V)<<(SENS_SAR_RSTB_FSM_S)) -#define SENS_SAR_RSTB_FSM_V 0xF -#define SENS_SAR_RSTB_FSM_S 20 -/* SENS_XPD_SAR_FSM : R/W ;bitpos:[19:16] ;default: 4'b0111 ; */ -/*description: */ -#define SENS_XPD_SAR_FSM 0x0000000F -#define SENS_XPD_SAR_FSM_M ((SENS_XPD_SAR_FSM_V)<<(SENS_XPD_SAR_FSM_S)) -#define SENS_XPD_SAR_FSM_V 0xF -#define SENS_XPD_SAR_FSM_S 16 -/* SENS_AMP_SHORT_REF_GND_FSM : R/W ;bitpos:[15:12] ;default: 4'b0011 ; */ -/*description: */ -#define SENS_AMP_SHORT_REF_GND_FSM 0x0000000F -#define SENS_AMP_SHORT_REF_GND_FSM_M ((SENS_AMP_SHORT_REF_GND_FSM_V)<<(SENS_AMP_SHORT_REF_GND_FSM_S)) -#define SENS_AMP_SHORT_REF_GND_FSM_V 0xF -#define SENS_AMP_SHORT_REF_GND_FSM_S 12 -/* SENS_AMP_SHORT_REF_FSM : R/W ;bitpos:[11:8] ;default: 4'b0011 ; */ -/*description: */ -#define SENS_AMP_SHORT_REF_FSM 0x0000000F -#define SENS_AMP_SHORT_REF_FSM_M ((SENS_AMP_SHORT_REF_FSM_V)<<(SENS_AMP_SHORT_REF_FSM_S)) -#define SENS_AMP_SHORT_REF_FSM_V 0xF -#define SENS_AMP_SHORT_REF_FSM_S 8 -/* SENS_AMP_RST_FB_FSM : R/W ;bitpos:[7:4] ;default: 4'b1000 ; */ -/*description: */ -#define SENS_AMP_RST_FB_FSM 0x0000000F -#define SENS_AMP_RST_FB_FSM_M ((SENS_AMP_RST_FB_FSM_V)<<(SENS_AMP_RST_FB_FSM_S)) -#define SENS_AMP_RST_FB_FSM_V 0xF -#define SENS_AMP_RST_FB_FSM_S 4 -/* SENS_XPD_SAR_AMP_FSM : R/W ;bitpos:[3:0] ;default: 4'b1111 ; */ -/*description: */ -#define SENS_XPD_SAR_AMP_FSM 0x0000000F -#define SENS_XPD_SAR_AMP_FSM_M ((SENS_XPD_SAR_AMP_FSM_V)<<(SENS_XPD_SAR_AMP_FSM_S)) -#define SENS_XPD_SAR_AMP_FSM_V 0xF -#define SENS_XPD_SAR_AMP_FSM_S 0 - -#define SENS_SAR_READ_STATUS2_REG (DR_REG_SENS_BASE + 0x0014) -/* SENS_SAR2_READER_STATUS : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define SENS_SAR2_READER_STATUS 0xFFFFFFFF -#define SENS_SAR2_READER_STATUS_M ((SENS_SAR2_READER_STATUS_V)<<(SENS_SAR2_READER_STATUS_S)) -#define SENS_SAR2_READER_STATUS_V 0xFFFFFFFF -#define SENS_SAR2_READER_STATUS_S 0 - -#define SENS_ULP_CP_SLEEP_CYC0_REG (DR_REG_SENS_BASE + 0x0018) -/* SENS_SLEEP_CYCLES_S0 : R/W ;bitpos:[31:0] ;default: 32'd200 ; */ -/*description: sleep cycles for ULP-coprocessor timer*/ -#define SENS_SLEEP_CYCLES_S0 0xFFFFFFFF -#define SENS_SLEEP_CYCLES_S0_M ((SENS_SLEEP_CYCLES_S0_V)<<(SENS_SLEEP_CYCLES_S0_S)) -#define SENS_SLEEP_CYCLES_S0_V 0xFFFFFFFF -#define SENS_SLEEP_CYCLES_S0_S 0 - -#define SENS_ULP_CP_SLEEP_CYC1_REG (DR_REG_SENS_BASE + 0x001c) -/* SENS_SLEEP_CYCLES_S1 : R/W ;bitpos:[31:0] ;default: 32'd100 ; */ -/*description: */ -#define SENS_SLEEP_CYCLES_S1 0xFFFFFFFF -#define SENS_SLEEP_CYCLES_S1_M ((SENS_SLEEP_CYCLES_S1_V)<<(SENS_SLEEP_CYCLES_S1_S)) -#define SENS_SLEEP_CYCLES_S1_V 0xFFFFFFFF -#define SENS_SLEEP_CYCLES_S1_S 0 - -#define SENS_ULP_CP_SLEEP_CYC2_REG (DR_REG_SENS_BASE + 0x0020) -/* SENS_SLEEP_CYCLES_S2 : R/W ;bitpos:[31:0] ;default: 32'd50 ; */ -/*description: */ -#define SENS_SLEEP_CYCLES_S2 0xFFFFFFFF -#define SENS_SLEEP_CYCLES_S2_M ((SENS_SLEEP_CYCLES_S2_V)<<(SENS_SLEEP_CYCLES_S2_S)) -#define SENS_SLEEP_CYCLES_S2_V 0xFFFFFFFF -#define SENS_SLEEP_CYCLES_S2_S 0 - -#define SENS_ULP_CP_SLEEP_CYC3_REG (DR_REG_SENS_BASE + 0x0024) -/* SENS_SLEEP_CYCLES_S3 : R/W ;bitpos:[31:0] ;default: 32'd40 ; */ -/*description: */ -#define SENS_SLEEP_CYCLES_S3 0xFFFFFFFF -#define SENS_SLEEP_CYCLES_S3_M ((SENS_SLEEP_CYCLES_S3_V)<<(SENS_SLEEP_CYCLES_S3_S)) -#define SENS_SLEEP_CYCLES_S3_V 0xFFFFFFFF -#define SENS_SLEEP_CYCLES_S3_S 0 - -#define SENS_ULP_CP_SLEEP_CYC4_REG (DR_REG_SENS_BASE + 0x0028) -/* SENS_SLEEP_CYCLES_S4 : R/W ;bitpos:[31:0] ;default: 32'd20 ; */ -/*description: */ -#define SENS_SLEEP_CYCLES_S4 0xFFFFFFFF -#define SENS_SLEEP_CYCLES_S4_M ((SENS_SLEEP_CYCLES_S4_V)<<(SENS_SLEEP_CYCLES_S4_S)) -#define SENS_SLEEP_CYCLES_S4_V 0xFFFFFFFF -#define SENS_SLEEP_CYCLES_S4_S 0 - -#define SENS_SAR_START_FORCE_REG (DR_REG_SENS_BASE + 0x002c) -/* SENS_SAR2_PWDET_EN : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: N/A*/ -#define SENS_SAR2_PWDET_EN (BIT(24)) -#define SENS_SAR2_PWDET_EN_M (BIT(24)) -#define SENS_SAR2_PWDET_EN_V 0x1 -#define SENS_SAR2_PWDET_EN_S 24 -/* SENS_SAR1_STOP : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: stop SAR ADC1 conversion*/ -#define SENS_SAR1_STOP (BIT(23)) -#define SENS_SAR1_STOP_M (BIT(23)) -#define SENS_SAR1_STOP_V 0x1 -#define SENS_SAR1_STOP_S 23 -/* SENS_SAR2_STOP : R/W ;bitpos:[22] ;default: 1'b0 ; */ -/*description: stop SAR ADC2 conversion*/ -#define SENS_SAR2_STOP (BIT(22)) -#define SENS_SAR2_STOP_M (BIT(22)) -#define SENS_SAR2_STOP_V 0x1 -#define SENS_SAR2_STOP_S 22 -/* SENS_PC_INIT : R/W ;bitpos:[21:11] ;default: 11'b0 ; */ -/*description: initialized PC for ULP-coprocessor*/ -#define SENS_PC_INIT 0x000007FF -#define SENS_PC_INIT_M ((SENS_PC_INIT_V)<<(SENS_PC_INIT_S)) -#define SENS_PC_INIT_V 0x7FF -#define SENS_PC_INIT_S 11 -/* SENS_SARCLK_EN : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define SENS_SARCLK_EN (BIT(10)) -#define SENS_SARCLK_EN_M (BIT(10)) -#define SENS_SARCLK_EN_V 0x1 -#define SENS_SARCLK_EN_S 10 -/* SENS_ULP_CP_START_TOP : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: Write 1 to start ULP-coprocessor only active when reg_ulp_cp_force_start_top - = 1*/ -#define SENS_ULP_CP_START_TOP (BIT(9)) -#define SENS_ULP_CP_START_TOP_M (BIT(9)) -#define SENS_ULP_CP_START_TOP_V 0x1 -#define SENS_ULP_CP_START_TOP_S 9 -/* SENS_ULP_CP_FORCE_START_TOP : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: 1: ULP-coprocessor is started by SW 0: ULP-coprocessor is started by timer*/ -#define SENS_ULP_CP_FORCE_START_TOP (BIT(8)) -#define SENS_ULP_CP_FORCE_START_TOP_M (BIT(8)) -#define SENS_ULP_CP_FORCE_START_TOP_V 0x1 -#define SENS_ULP_CP_FORCE_START_TOP_S 8 -/* SENS_SAR2_PWDET_CCT : R/W ;bitpos:[7:5] ;default: 3'b0 ; */ -/*description: SAR2_PWDET_CCT PA power detector capacitance tuning.*/ -#define SENS_SAR2_PWDET_CCT 0x00000007 -#define SENS_SAR2_PWDET_CCT_M ((SENS_SAR2_PWDET_CCT_V)<<(SENS_SAR2_PWDET_CCT_S)) -#define SENS_SAR2_PWDET_CCT_V 0x7 -#define SENS_SAR2_PWDET_CCT_S 5 -/* SENS_SAR2_EN_TEST : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: SAR2_EN_TEST only active when reg_sar2_dig_force = 0*/ -#define SENS_SAR2_EN_TEST (BIT(4)) -#define SENS_SAR2_EN_TEST_M (BIT(4)) -#define SENS_SAR2_EN_TEST_V 0x1 -#define SENS_SAR2_EN_TEST_S 4 -/* SENS_SAR2_BIT_WIDTH : R/W ;bitpos:[3:2] ;default: 2'b11 ; */ -/*description: 00: 9 bit 01: 10 bits 10: 11bits 11: 12bits*/ -#define SENS_SAR2_BIT_WIDTH 0x00000003 -#define SENS_SAR2_BIT_WIDTH_M ((SENS_SAR2_BIT_WIDTH_V)<<(SENS_SAR2_BIT_WIDTH_S)) -#define SENS_SAR2_BIT_WIDTH_V 0x3 -#define SENS_SAR2_BIT_WIDTH_S 2 -/* SENS_SAR1_BIT_WIDTH : R/W ;bitpos:[1:0] ;default: 2'b11 ; */ -/*description: 00: 9 bit 01: 10 bits 10: 11bits 11: 12bits*/ -#define SENS_SAR1_BIT_WIDTH 0x00000003 -#define SENS_SAR1_BIT_WIDTH_M ((SENS_SAR1_BIT_WIDTH_V)<<(SENS_SAR1_BIT_WIDTH_S)) -#define SENS_SAR1_BIT_WIDTH_V 0x3 -#define SENS_SAR1_BIT_WIDTH_S 0 - -#define SENS_SAR_MEM_WR_CTRL_REG (DR_REG_SENS_BASE + 0x0030) -/* SENS_RTC_MEM_WR_OFFST_CLR : WO ;bitpos:[22] ;default: 1'd0 ; */ -/*description: */ -#define SENS_RTC_MEM_WR_OFFST_CLR (BIT(22)) -#define SENS_RTC_MEM_WR_OFFST_CLR_M (BIT(22)) -#define SENS_RTC_MEM_WR_OFFST_CLR_V 0x1 -#define SENS_RTC_MEM_WR_OFFST_CLR_S 22 -/* SENS_MEM_WR_ADDR_SIZE : R/W ;bitpos:[21:11] ;default: 11'd512 ; */ -/*description: */ -#define SENS_MEM_WR_ADDR_SIZE 0x000007FF -#define SENS_MEM_WR_ADDR_SIZE_M ((SENS_MEM_WR_ADDR_SIZE_V)<<(SENS_MEM_WR_ADDR_SIZE_S)) -#define SENS_MEM_WR_ADDR_SIZE_V 0x7FF -#define SENS_MEM_WR_ADDR_SIZE_S 11 -/* SENS_MEM_WR_ADDR_INIT : R/W ;bitpos:[10:0] ;default: 11'd512 ; */ -/*description: */ -#define SENS_MEM_WR_ADDR_INIT 0x000007FF -#define SENS_MEM_WR_ADDR_INIT_M ((SENS_MEM_WR_ADDR_INIT_V)<<(SENS_MEM_WR_ADDR_INIT_S)) -#define SENS_MEM_WR_ADDR_INIT_V 0x7FF -#define SENS_MEM_WR_ADDR_INIT_S 0 - -#define SENS_SAR_ATTEN1_REG (DR_REG_SENS_BASE + 0x0034) -/* SENS_SAR1_ATTEN : R/W ;bitpos:[31:0] ;default: 32'hffffffff ; */ -/*description: 2-bit attenuation for each pad 11:1dB 10:6dB 01:3dB 00:0dB*/ -#define SENS_SAR1_ATTEN 0xFFFFFFFF -#define SENS_SAR1_ATTEN_M ((SENS_SAR1_ATTEN_V)<<(SENS_SAR1_ATTEN_S)) -#define SENS_SAR1_ATTEN_V 0xFFFFFFFF -#define SENS_SAR1_ATTEN_S 0 -#define SENS_SAR1_ATTEN_VAL_MASK 0x3 -#define SENS_SAR2_ATTEN_VAL_MASK 0x3 - -#define SENS_SAR_ATTEN2_REG (DR_REG_SENS_BASE + 0x0038) -/* SENS_SAR2_ATTEN : R/W ;bitpos:[31:0] ;default: 32'hffffffff ; */ -/*description: 2-bit attenuation for each pad 11:1dB 10:6dB 01:3dB 00:0dB*/ -#define SENS_SAR2_ATTEN 0xFFFFFFFF -#define SENS_SAR2_ATTEN_M ((SENS_SAR2_ATTEN_V)<<(SENS_SAR2_ATTEN_S)) -#define SENS_SAR2_ATTEN_V 0xFFFFFFFF -#define SENS_SAR2_ATTEN_S 0 - -#define SENS_SAR_SLAVE_ADDR1_REG (DR_REG_SENS_BASE + 0x003c) -/* SENS_MEAS_STATUS : RO ;bitpos:[29:22] ;default: 8'h0 ; */ -/*description: */ -#define SENS_MEAS_STATUS 0x000000FF -#define SENS_MEAS_STATUS_M ((SENS_MEAS_STATUS_V)<<(SENS_MEAS_STATUS_S)) -#define SENS_MEAS_STATUS_V 0xFF -#define SENS_MEAS_STATUS_S 22 -/* SENS_I2C_SLAVE_ADDR0 : R/W ;bitpos:[21:11] ;default: 11'h0 ; */ -/*description: */ -#define SENS_I2C_SLAVE_ADDR0 0x000007FF -#define SENS_I2C_SLAVE_ADDR0_M ((SENS_I2C_SLAVE_ADDR0_V)<<(SENS_I2C_SLAVE_ADDR0_S)) -#define SENS_I2C_SLAVE_ADDR0_V 0x7FF -#define SENS_I2C_SLAVE_ADDR0_S 11 -/* SENS_I2C_SLAVE_ADDR1 : R/W ;bitpos:[10:0] ;default: 11'h0 ; */ -/*description: */ -#define SENS_I2C_SLAVE_ADDR1 0x000007FF -#define SENS_I2C_SLAVE_ADDR1_M ((SENS_I2C_SLAVE_ADDR1_V)<<(SENS_I2C_SLAVE_ADDR1_S)) -#define SENS_I2C_SLAVE_ADDR1_V 0x7FF -#define SENS_I2C_SLAVE_ADDR1_S 0 - -#define SENS_SAR_SLAVE_ADDR2_REG (DR_REG_SENS_BASE + 0x0040) -/* SENS_I2C_SLAVE_ADDR2 : R/W ;bitpos:[21:11] ;default: 11'h0 ; */ -/*description: */ -#define SENS_I2C_SLAVE_ADDR2 0x000007FF -#define SENS_I2C_SLAVE_ADDR2_M ((SENS_I2C_SLAVE_ADDR2_V)<<(SENS_I2C_SLAVE_ADDR2_S)) -#define SENS_I2C_SLAVE_ADDR2_V 0x7FF -#define SENS_I2C_SLAVE_ADDR2_S 11 -/* SENS_I2C_SLAVE_ADDR3 : R/W ;bitpos:[10:0] ;default: 11'h0 ; */ -/*description: */ -#define SENS_I2C_SLAVE_ADDR3 0x000007FF -#define SENS_I2C_SLAVE_ADDR3_M ((SENS_I2C_SLAVE_ADDR3_V)<<(SENS_I2C_SLAVE_ADDR3_S)) -#define SENS_I2C_SLAVE_ADDR3_V 0x7FF -#define SENS_I2C_SLAVE_ADDR3_S 0 - -#define SENS_SAR_SLAVE_ADDR3_REG (DR_REG_SENS_BASE + 0x0044) -/* SENS_TSENS_RDY_OUT : RO ;bitpos:[30] ;default: 1'h0 ; */ -/*description: indicate temperature sensor out ready*/ -#define SENS_TSENS_RDY_OUT (BIT(30)) -#define SENS_TSENS_RDY_OUT_M (BIT(30)) -#define SENS_TSENS_RDY_OUT_V 0x1 -#define SENS_TSENS_RDY_OUT_S 30 -/* SENS_TSENS_OUT : RO ;bitpos:[29:22] ;default: 8'h0 ; */ -/*description: temperature sensor data out*/ -#define SENS_TSENS_OUT 0x000000FF -#define SENS_TSENS_OUT_M ((SENS_TSENS_OUT_V)<<(SENS_TSENS_OUT_S)) -#define SENS_TSENS_OUT_V 0xFF -#define SENS_TSENS_OUT_S 22 -/* SENS_I2C_SLAVE_ADDR4 : R/W ;bitpos:[21:11] ;default: 11'h0 ; */ -/*description: */ -#define SENS_I2C_SLAVE_ADDR4 0x000007FF -#define SENS_I2C_SLAVE_ADDR4_M ((SENS_I2C_SLAVE_ADDR4_V)<<(SENS_I2C_SLAVE_ADDR4_S)) -#define SENS_I2C_SLAVE_ADDR4_V 0x7FF -#define SENS_I2C_SLAVE_ADDR4_S 11 -/* SENS_I2C_SLAVE_ADDR5 : R/W ;bitpos:[10:0] ;default: 11'h0 ; */ -/*description: */ -#define SENS_I2C_SLAVE_ADDR5 0x000007FF -#define SENS_I2C_SLAVE_ADDR5_M ((SENS_I2C_SLAVE_ADDR5_V)<<(SENS_I2C_SLAVE_ADDR5_S)) -#define SENS_I2C_SLAVE_ADDR5_V 0x7FF -#define SENS_I2C_SLAVE_ADDR5_S 0 - -#define SENS_SAR_SLAVE_ADDR4_REG (DR_REG_SENS_BASE + 0x0048) -/* SENS_I2C_DONE : RO ;bitpos:[30] ;default: 1'h0 ; */ -/*description: indicate I2C done*/ -#define SENS_I2C_DONE (BIT(30)) -#define SENS_I2C_DONE_M (BIT(30)) -#define SENS_I2C_DONE_V 0x1 -#define SENS_I2C_DONE_S 30 -/* SENS_I2C_RDATA : RO ;bitpos:[29:22] ;default: 8'h0 ; */ -/*description: I2C read data*/ -#define SENS_I2C_RDATA 0x000000FF -#define SENS_I2C_RDATA_M ((SENS_I2C_RDATA_V)<<(SENS_I2C_RDATA_S)) -#define SENS_I2C_RDATA_V 0xFF -#define SENS_I2C_RDATA_S 22 -/* SENS_I2C_SLAVE_ADDR6 : R/W ;bitpos:[21:11] ;default: 11'h0 ; */ -/*description: */ -#define SENS_I2C_SLAVE_ADDR6 0x000007FF -#define SENS_I2C_SLAVE_ADDR6_M ((SENS_I2C_SLAVE_ADDR6_V)<<(SENS_I2C_SLAVE_ADDR6_S)) -#define SENS_I2C_SLAVE_ADDR6_V 0x7FF -#define SENS_I2C_SLAVE_ADDR6_S 11 -/* SENS_I2C_SLAVE_ADDR7 : R/W ;bitpos:[10:0] ;default: 11'h0 ; */ -/*description: */ -#define SENS_I2C_SLAVE_ADDR7 0x000007FF -#define SENS_I2C_SLAVE_ADDR7_M ((SENS_I2C_SLAVE_ADDR7_V)<<(SENS_I2C_SLAVE_ADDR7_S)) -#define SENS_I2C_SLAVE_ADDR7_V 0x7FF -#define SENS_I2C_SLAVE_ADDR7_S 0 - -#define SENS_SAR_TSENS_CTRL_REG (DR_REG_SENS_BASE + 0x004c) -/* SENS_TSENS_DUMP_OUT : R/W ;bitpos:[26] ;default: 1'b0 ; */ -/*description: temperature sensor dump out only active when reg_tsens_power_up_force = 1*/ -#define SENS_TSENS_DUMP_OUT (BIT(26)) -#define SENS_TSENS_DUMP_OUT_M (BIT(26)) -#define SENS_TSENS_DUMP_OUT_V 0x1 -#define SENS_TSENS_DUMP_OUT_S 26 -/* SENS_TSENS_POWER_UP_FORCE : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: 1: dump out & power up controlled by SW 0: by FSM*/ -#define SENS_TSENS_POWER_UP_FORCE (BIT(25)) -#define SENS_TSENS_POWER_UP_FORCE_M (BIT(25)) -#define SENS_TSENS_POWER_UP_FORCE_V 0x1 -#define SENS_TSENS_POWER_UP_FORCE_S 25 -/* SENS_TSENS_POWER_UP : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: temperature sensor power up*/ -#define SENS_TSENS_POWER_UP (BIT(24)) -#define SENS_TSENS_POWER_UP_M (BIT(24)) -#define SENS_TSENS_POWER_UP_V 0x1 -#define SENS_TSENS_POWER_UP_S 24 -/* SENS_TSENS_CLK_DIV : R/W ;bitpos:[23:16] ;default: 8'd6 ; */ -/*description: temperature sensor clock divider*/ -#define SENS_TSENS_CLK_DIV 0x000000FF -#define SENS_TSENS_CLK_DIV_M ((SENS_TSENS_CLK_DIV_V)<<(SENS_TSENS_CLK_DIV_S)) -#define SENS_TSENS_CLK_DIV_V 0xFF -#define SENS_TSENS_CLK_DIV_S 16 -/* SENS_TSENS_IN_INV : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: invert temperature sensor data*/ -#define SENS_TSENS_IN_INV (BIT(15)) -#define SENS_TSENS_IN_INV_M (BIT(15)) -#define SENS_TSENS_IN_INV_V 0x1 -#define SENS_TSENS_IN_INV_S 15 -/* SENS_TSENS_CLK_GATED : R/W ;bitpos:[14] ;default: 1'b1 ; */ -/*description: */ -#define SENS_TSENS_CLK_GATED (BIT(14)) -#define SENS_TSENS_CLK_GATED_M (BIT(14)) -#define SENS_TSENS_CLK_GATED_V 0x1 -#define SENS_TSENS_CLK_GATED_S 14 -/* SENS_TSENS_CLK_INV : R/W ;bitpos:[13] ;default: 1'b1 ; */ -/*description: */ -#define SENS_TSENS_CLK_INV (BIT(13)) -#define SENS_TSENS_CLK_INV_M (BIT(13)) -#define SENS_TSENS_CLK_INV_V 0x1 -#define SENS_TSENS_CLK_INV_S 13 -/* SENS_TSENS_XPD_FORCE : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define SENS_TSENS_XPD_FORCE (BIT(12)) -#define SENS_TSENS_XPD_FORCE_M (BIT(12)) -#define SENS_TSENS_XPD_FORCE_V 0x1 -#define SENS_TSENS_XPD_FORCE_S 12 -/* SENS_TSENS_XPD_WAIT : R/W ;bitpos:[11:0] ;default: 12'h2 ; */ -/*description: */ -#define SENS_TSENS_XPD_WAIT 0x00000FFF -#define SENS_TSENS_XPD_WAIT_M ((SENS_TSENS_XPD_WAIT_V)<<(SENS_TSENS_XPD_WAIT_S)) -#define SENS_TSENS_XPD_WAIT_V 0xFFF -#define SENS_TSENS_XPD_WAIT_S 0 - -#define SENS_SAR_I2C_CTRL_REG (DR_REG_SENS_BASE + 0x0050) -/* SENS_SAR_I2C_START_FORCE : R/W ;bitpos:[29] ;default: 1'b0 ; */ -/*description: 1: I2C started by SW 0: I2C started by FSM*/ -#define SENS_SAR_I2C_START_FORCE (BIT(29)) -#define SENS_SAR_I2C_START_FORCE_M (BIT(29)) -#define SENS_SAR_I2C_START_FORCE_V 0x1 -#define SENS_SAR_I2C_START_FORCE_S 29 -/* SENS_SAR_I2C_START : R/W ;bitpos:[28] ;default: 1'b0 ; */ -/*description: start I2C only active when reg_sar_i2c_start_force = 1*/ -#define SENS_SAR_I2C_START (BIT(28)) -#define SENS_SAR_I2C_START_M (BIT(28)) -#define SENS_SAR_I2C_START_V 0x1 -#define SENS_SAR_I2C_START_S 28 -/* SENS_SAR_I2C_CTRL : R/W ;bitpos:[27:0] ;default: 28'b0 ; */ -/*description: I2C control data only active when reg_sar_i2c_start_force = 1*/ -#define SENS_SAR_I2C_CTRL 0x0FFFFFFF -#define SENS_SAR_I2C_CTRL_M ((SENS_SAR_I2C_CTRL_V)<<(SENS_SAR_I2C_CTRL_S)) -#define SENS_SAR_I2C_CTRL_V 0xFFFFFFF -#define SENS_SAR_I2C_CTRL_S 0 - -#define SENS_SAR_MEAS_START1_REG (DR_REG_SENS_BASE + 0x0054) -/* SENS_SAR1_EN_PAD_FORCE : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: 1: SAR ADC1 pad enable bitmap is controlled by SW 0: SAR ADC1 - pad enable bitmap is controlled by ULP-coprocessor*/ -#define SENS_SAR1_EN_PAD_FORCE (BIT(31)) -#define SENS_SAR1_EN_PAD_FORCE_M (BIT(31)) -#define SENS_SAR1_EN_PAD_FORCE_V 0x1 -#define SENS_SAR1_EN_PAD_FORCE_S 31 -/* SENS_SAR1_EN_PAD : R/W ;bitpos:[30:19] ;default: 12'b0 ; */ -/*description: SAR ADC1 pad enable bitmap only active when reg_sar1_en_pad_force = 1*/ -#define SENS_SAR1_EN_PAD 0x00000FFF -#define SENS_SAR1_EN_PAD_M ((SENS_SAR1_EN_PAD_V)<<(SENS_SAR1_EN_PAD_S)) -#define SENS_SAR1_EN_PAD_V 0xFFF -#define SENS_SAR1_EN_PAD_S 19 -/* SENS_MEAS1_START_FORCE : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: 1: SAR ADC1 controller (in RTC) is started by SW 0: SAR ADC1 - controller is started by ULP-coprocessor*/ -#define SENS_MEAS1_START_FORCE (BIT(18)) -#define SENS_MEAS1_START_FORCE_M (BIT(18)) -#define SENS_MEAS1_START_FORCE_V 0x1 -#define SENS_MEAS1_START_FORCE_S 18 -/* SENS_MEAS1_START_SAR : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: SAR ADC1 controller (in RTC) starts conversion only active when - reg_meas1_start_force = 1*/ -#define SENS_MEAS1_START_SAR (BIT(17)) -#define SENS_MEAS1_START_SAR_M (BIT(17)) -#define SENS_MEAS1_START_SAR_V 0x1 -#define SENS_MEAS1_START_SAR_S 17 -/* SENS_MEAS1_DONE_SAR : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: SAR ADC1 conversion done indication*/ -#define SENS_MEAS1_DONE_SAR (BIT(16)) -#define SENS_MEAS1_DONE_SAR_M (BIT(16)) -#define SENS_MEAS1_DONE_SAR_V 0x1 -#define SENS_MEAS1_DONE_SAR_S 16 -/* SENS_MEAS1_DATA_SAR : RO ;bitpos:[15:0] ;default: 16'b0 ; */ -/*description: SAR ADC1 data*/ -#define SENS_MEAS1_DATA_SAR 0x0000FFFF -#define SENS_MEAS1_DATA_SAR_M ((SENS_MEAS1_DATA_SAR_V)<<(SENS_MEAS1_DATA_SAR_S)) -#define SENS_MEAS1_DATA_SAR_V 0xFFFF -#define SENS_MEAS1_DATA_SAR_S 0 - -#define SENS_SAR_TOUCH_CTRL1_REG (DR_REG_SENS_BASE + 0x0058) -/* SENS_HALL_PHASE_FORCE : R/W ;bitpos:[27] ;default: 1'b0 ; */ -/*description: 1: HALL PHASE is controlled by SW 0: HALL PHASE is controlled - by FSM in ULP-coprocessor*/ -#define SENS_HALL_PHASE_FORCE (BIT(27)) -#define SENS_HALL_PHASE_FORCE_M (BIT(27)) -#define SENS_HALL_PHASE_FORCE_V 0x1 -#define SENS_HALL_PHASE_FORCE_S 27 -/* SENS_XPD_HALL_FORCE : R/W ;bitpos:[26] ;default: 1'b0 ; */ -/*description: 1: XPD HALL is controlled by SW. 0: XPD HALL is controlled by - FSM in ULP-coprocessor*/ -#define SENS_XPD_HALL_FORCE (BIT(26)) -#define SENS_XPD_HALL_FORCE_M (BIT(26)) -#define SENS_XPD_HALL_FORCE_V 0x1 -#define SENS_XPD_HALL_FORCE_S 26 -/* SENS_TOUCH_OUT_1EN : R/W ;bitpos:[25] ;default: 1'b1 ; */ -/*description: 1: wakeup interrupt is generated if SET1 is "touched" 0: - wakeup interrupt is generated only if SET1 & SET2 is both "touched"*/ -#define SENS_TOUCH_OUT_1EN (BIT(25)) -#define SENS_TOUCH_OUT_1EN_M (BIT(25)) -#define SENS_TOUCH_OUT_1EN_V 0x1 -#define SENS_TOUCH_OUT_1EN_S 25 -/* SENS_TOUCH_OUT_SEL : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: 1: when the counter is greater then the threshold the touch - pad is considered as "touched" 0: when the counter is less than the threshold the touch pad is considered as "touched"*/ -#define SENS_TOUCH_OUT_SEL (BIT(24)) -#define SENS_TOUCH_OUT_SEL_M (BIT(24)) -#define SENS_TOUCH_OUT_SEL_V 0x1 -#define SENS_TOUCH_OUT_SEL_S 24 -/* SENS_TOUCH_XPD_WAIT : R/W ;bitpos:[23:16] ;default: 8'h4 ; */ -/*description: the waiting cycles (in 8MHz) between TOUCH_START and TOUCH_XPD*/ -#define SENS_TOUCH_XPD_WAIT 0x000000FF -#define SENS_TOUCH_XPD_WAIT_M ((SENS_TOUCH_XPD_WAIT_V)<<(SENS_TOUCH_XPD_WAIT_S)) -#define SENS_TOUCH_XPD_WAIT_V 0xFF -#define SENS_TOUCH_XPD_WAIT_S 16 -/* SENS_TOUCH_MEAS_DELAY : R/W ;bitpos:[15:0] ;default: 16'h1000 ; */ -/*description: the meas length (in 8MHz)*/ -#define SENS_TOUCH_MEAS_DELAY 0x0000FFFF -#define SENS_TOUCH_MEAS_DELAY_M ((SENS_TOUCH_MEAS_DELAY_V)<<(SENS_TOUCH_MEAS_DELAY_S)) -#define SENS_TOUCH_MEAS_DELAY_V 0xFFFF -#define SENS_TOUCH_MEAS_DELAY_S 0 - -#define SENS_SAR_TOUCH_THRES1_REG (DR_REG_SENS_BASE + 0x005c) -/* SENS_TOUCH_OUT_TH0 : R/W ;bitpos:[31:16] ;default: 16'h0 ; */ -/*description: the threshold for touch pad 0*/ -#define SENS_TOUCH_OUT_TH0 0x0000FFFF -#define SENS_TOUCH_OUT_TH0_M ((SENS_TOUCH_OUT_TH0_V)<<(SENS_TOUCH_OUT_TH0_S)) -#define SENS_TOUCH_OUT_TH0_V 0xFFFF -#define SENS_TOUCH_OUT_TH0_S 16 -/* SENS_TOUCH_OUT_TH1 : R/W ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: the threshold for touch pad 1*/ -#define SENS_TOUCH_OUT_TH1 0x0000FFFF -#define SENS_TOUCH_OUT_TH1_M ((SENS_TOUCH_OUT_TH1_V)<<(SENS_TOUCH_OUT_TH1_S)) -#define SENS_TOUCH_OUT_TH1_V 0xFFFF -#define SENS_TOUCH_OUT_TH1_S 0 - -#define SENS_SAR_TOUCH_THRES2_REG (DR_REG_SENS_BASE + 0x0060) -/* SENS_TOUCH_OUT_TH2 : R/W ;bitpos:[31:16] ;default: 16'h0 ; */ -/*description: the threshold for touch pad 2*/ -#define SENS_TOUCH_OUT_TH2 0x0000FFFF -#define SENS_TOUCH_OUT_TH2_M ((SENS_TOUCH_OUT_TH2_V)<<(SENS_TOUCH_OUT_TH2_S)) -#define SENS_TOUCH_OUT_TH2_V 0xFFFF -#define SENS_TOUCH_OUT_TH2_S 16 -/* SENS_TOUCH_OUT_TH3 : R/W ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: the threshold for touch pad 3*/ -#define SENS_TOUCH_OUT_TH3 0x0000FFFF -#define SENS_TOUCH_OUT_TH3_M ((SENS_TOUCH_OUT_TH3_V)<<(SENS_TOUCH_OUT_TH3_S)) -#define SENS_TOUCH_OUT_TH3_V 0xFFFF -#define SENS_TOUCH_OUT_TH3_S 0 - -#define SENS_SAR_TOUCH_THRES3_REG (DR_REG_SENS_BASE + 0x0064) -/* SENS_TOUCH_OUT_TH4 : R/W ;bitpos:[31:16] ;default: 16'h0 ; */ -/*description: the threshold for touch pad 4*/ -#define SENS_TOUCH_OUT_TH4 0x0000FFFF -#define SENS_TOUCH_OUT_TH4_M ((SENS_TOUCH_OUT_TH4_V)<<(SENS_TOUCH_OUT_TH4_S)) -#define SENS_TOUCH_OUT_TH4_V 0xFFFF -#define SENS_TOUCH_OUT_TH4_S 16 -/* SENS_TOUCH_OUT_TH5 : R/W ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: the threshold for touch pad 5*/ -#define SENS_TOUCH_OUT_TH5 0x0000FFFF -#define SENS_TOUCH_OUT_TH5_M ((SENS_TOUCH_OUT_TH5_V)<<(SENS_TOUCH_OUT_TH5_S)) -#define SENS_TOUCH_OUT_TH5_V 0xFFFF -#define SENS_TOUCH_OUT_TH5_S 0 - -#define SENS_SAR_TOUCH_THRES4_REG (DR_REG_SENS_BASE + 0x0068) -/* SENS_TOUCH_OUT_TH6 : R/W ;bitpos:[31:16] ;default: 16'h0 ; */ -/*description: the threshold for touch pad 6*/ -#define SENS_TOUCH_OUT_TH6 0x0000FFFF -#define SENS_TOUCH_OUT_TH6_M ((SENS_TOUCH_OUT_TH6_V)<<(SENS_TOUCH_OUT_TH6_S)) -#define SENS_TOUCH_OUT_TH6_V 0xFFFF -#define SENS_TOUCH_OUT_TH6_S 16 -/* SENS_TOUCH_OUT_TH7 : R/W ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: the threshold for touch pad 7*/ -#define SENS_TOUCH_OUT_TH7 0x0000FFFF -#define SENS_TOUCH_OUT_TH7_M ((SENS_TOUCH_OUT_TH7_V)<<(SENS_TOUCH_OUT_TH7_S)) -#define SENS_TOUCH_OUT_TH7_V 0xFFFF -#define SENS_TOUCH_OUT_TH7_S 0 - -#define SENS_SAR_TOUCH_THRES5_REG (DR_REG_SENS_BASE + 0x006c) -/* SENS_TOUCH_OUT_TH8 : R/W ;bitpos:[31:16] ;default: 16'h0 ; */ -/*description: the threshold for touch pad 8*/ -#define SENS_TOUCH_OUT_TH8 0x0000FFFF -#define SENS_TOUCH_OUT_TH8_M ((SENS_TOUCH_OUT_TH8_V)<<(SENS_TOUCH_OUT_TH8_S)) -#define SENS_TOUCH_OUT_TH8_V 0xFFFF -#define SENS_TOUCH_OUT_TH8_S 16 -/* SENS_TOUCH_OUT_TH9 : R/W ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: the threshold for touch pad 9*/ -#define SENS_TOUCH_OUT_TH9 0x0000FFFF -#define SENS_TOUCH_OUT_TH9_M ((SENS_TOUCH_OUT_TH9_V)<<(SENS_TOUCH_OUT_TH9_S)) -#define SENS_TOUCH_OUT_TH9_V 0xFFFF -#define SENS_TOUCH_OUT_TH9_S 0 - -#define SENS_SAR_TOUCH_OUT1_REG (DR_REG_SENS_BASE + 0x0070) -/* SENS_TOUCH_MEAS_OUT0 : RO ;bitpos:[31:16] ;default: 16'h0 ; */ -/*description: the counter for touch pad 0*/ -#define SENS_TOUCH_MEAS_OUT0 0x0000FFFF -#define SENS_TOUCH_MEAS_OUT0_M ((SENS_TOUCH_MEAS_OUT0_V)<<(SENS_TOUCH_MEAS_OUT0_S)) -#define SENS_TOUCH_MEAS_OUT0_V 0xFFFF -#define SENS_TOUCH_MEAS_OUT0_S 16 -/* SENS_TOUCH_MEAS_OUT1 : RO ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: the counter for touch pad 1*/ -#define SENS_TOUCH_MEAS_OUT1 0x0000FFFF -#define SENS_TOUCH_MEAS_OUT1_M ((SENS_TOUCH_MEAS_OUT1_V)<<(SENS_TOUCH_MEAS_OUT1_S)) -#define SENS_TOUCH_MEAS_OUT1_V 0xFFFF -#define SENS_TOUCH_MEAS_OUT1_S 0 - -#define SENS_SAR_TOUCH_OUT2_REG (DR_REG_SENS_BASE + 0x0074) -/* SENS_TOUCH_MEAS_OUT2 : RO ;bitpos:[31:16] ;default: 16'h0 ; */ -/*description: the counter for touch pad 2*/ -#define SENS_TOUCH_MEAS_OUT2 0x0000FFFF -#define SENS_TOUCH_MEAS_OUT2_M ((SENS_TOUCH_MEAS_OUT2_V)<<(SENS_TOUCH_MEAS_OUT2_S)) -#define SENS_TOUCH_MEAS_OUT2_V 0xFFFF -#define SENS_TOUCH_MEAS_OUT2_S 16 -/* SENS_TOUCH_MEAS_OUT3 : RO ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: the counter for touch pad 3*/ -#define SENS_TOUCH_MEAS_OUT3 0x0000FFFF -#define SENS_TOUCH_MEAS_OUT3_M ((SENS_TOUCH_MEAS_OUT3_V)<<(SENS_TOUCH_MEAS_OUT3_S)) -#define SENS_TOUCH_MEAS_OUT3_V 0xFFFF -#define SENS_TOUCH_MEAS_OUT3_S 0 - -#define SENS_SAR_TOUCH_OUT3_REG (DR_REG_SENS_BASE + 0x0078) -/* SENS_TOUCH_MEAS_OUT4 : RO ;bitpos:[31:16] ;default: 16'h0 ; */ -/*description: the counter for touch pad 4*/ -#define SENS_TOUCH_MEAS_OUT4 0x0000FFFF -#define SENS_TOUCH_MEAS_OUT4_M ((SENS_TOUCH_MEAS_OUT4_V)<<(SENS_TOUCH_MEAS_OUT4_S)) -#define SENS_TOUCH_MEAS_OUT4_V 0xFFFF -#define SENS_TOUCH_MEAS_OUT4_S 16 -/* SENS_TOUCH_MEAS_OUT5 : RO ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: the counter for touch pad 5*/ -#define SENS_TOUCH_MEAS_OUT5 0x0000FFFF -#define SENS_TOUCH_MEAS_OUT5_M ((SENS_TOUCH_MEAS_OUT5_V)<<(SENS_TOUCH_MEAS_OUT5_S)) -#define SENS_TOUCH_MEAS_OUT5_V 0xFFFF -#define SENS_TOUCH_MEAS_OUT5_S 0 - -#define SENS_SAR_TOUCH_OUT4_REG (DR_REG_SENS_BASE + 0x007c) -/* SENS_TOUCH_MEAS_OUT6 : RO ;bitpos:[31:16] ;default: 16'h0 ; */ -/*description: the counter for touch pad 6*/ -#define SENS_TOUCH_MEAS_OUT6 0x0000FFFF -#define SENS_TOUCH_MEAS_OUT6_M ((SENS_TOUCH_MEAS_OUT6_V)<<(SENS_TOUCH_MEAS_OUT6_S)) -#define SENS_TOUCH_MEAS_OUT6_V 0xFFFF -#define SENS_TOUCH_MEAS_OUT6_S 16 -/* SENS_TOUCH_MEAS_OUT7 : RO ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: the counter for touch pad 7*/ -#define SENS_TOUCH_MEAS_OUT7 0x0000FFFF -#define SENS_TOUCH_MEAS_OUT7_M ((SENS_TOUCH_MEAS_OUT7_V)<<(SENS_TOUCH_MEAS_OUT7_S)) -#define SENS_TOUCH_MEAS_OUT7_V 0xFFFF -#define SENS_TOUCH_MEAS_OUT7_S 0 - -#define SENS_SAR_TOUCH_OUT5_REG (DR_REG_SENS_BASE + 0x0080) -/* SENS_TOUCH_MEAS_OUT8 : RO ;bitpos:[31:16] ;default: 16'h0 ; */ -/*description: the counter for touch pad 8*/ -#define SENS_TOUCH_MEAS_OUT8 0x0000FFFF -#define SENS_TOUCH_MEAS_OUT8_M ((SENS_TOUCH_MEAS_OUT8_V)<<(SENS_TOUCH_MEAS_OUT8_S)) -#define SENS_TOUCH_MEAS_OUT8_V 0xFFFF -#define SENS_TOUCH_MEAS_OUT8_S 16 -/* SENS_TOUCH_MEAS_OUT9 : RO ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: the counter for touch pad 9*/ -#define SENS_TOUCH_MEAS_OUT9 0x0000FFFF -#define SENS_TOUCH_MEAS_OUT9_M ((SENS_TOUCH_MEAS_OUT9_V)<<(SENS_TOUCH_MEAS_OUT9_S)) -#define SENS_TOUCH_MEAS_OUT9_V 0xFFFF -#define SENS_TOUCH_MEAS_OUT9_S 0 - -#define SENS_SAR_TOUCH_CTRL2_REG (DR_REG_SENS_BASE + 0x0084) -/* SENS_TOUCH_MEAS_EN_CLR : WO ;bitpos:[30] ;default: 1'h0 ; */ -/*description: to clear reg_touch_meas_en*/ -#define SENS_TOUCH_MEAS_EN_CLR (BIT(30)) -#define SENS_TOUCH_MEAS_EN_CLR_M (BIT(30)) -#define SENS_TOUCH_MEAS_EN_CLR_V 0x1 -#define SENS_TOUCH_MEAS_EN_CLR_S 30 -/* SENS_TOUCH_SLEEP_CYCLES : R/W ;bitpos:[29:14] ;default: 16'h100 ; */ -/*description: sleep cycles for timer*/ -#define SENS_TOUCH_SLEEP_CYCLES 0x0000FFFF -#define SENS_TOUCH_SLEEP_CYCLES_M ((SENS_TOUCH_SLEEP_CYCLES_V)<<(SENS_TOUCH_SLEEP_CYCLES_S)) -#define SENS_TOUCH_SLEEP_CYCLES_V 0xFFFF -#define SENS_TOUCH_SLEEP_CYCLES_S 14 -/* SENS_TOUCH_START_FORCE : R/W ;bitpos:[13] ;default: 1'h0 ; */ -/*description: 1: to start touch fsm by SW 0: to start touch fsm by timer*/ -#define SENS_TOUCH_START_FORCE (BIT(13)) -#define SENS_TOUCH_START_FORCE_M (BIT(13)) -#define SENS_TOUCH_START_FORCE_V 0x1 -#define SENS_TOUCH_START_FORCE_S 13 -/* SENS_TOUCH_START_EN : R/W ;bitpos:[12] ;default: 1'h0 ; */ -/*description: 1: start touch fsm valid when reg_touch_start_force is set*/ -#define SENS_TOUCH_START_EN (BIT(12)) -#define SENS_TOUCH_START_EN_M (BIT(12)) -#define SENS_TOUCH_START_EN_V 0x1 -#define SENS_TOUCH_START_EN_S 12 -/* SENS_TOUCH_START_FSM_EN : R/W ;bitpos:[11] ;default: 1'h1 ; */ -/*description: 1: TOUCH_START & TOUCH_XPD is controlled by touch fsm 0: TOUCH_START - & TOUCH_XPD is controlled by registers*/ -#define SENS_TOUCH_START_FSM_EN (BIT(11)) -#define SENS_TOUCH_START_FSM_EN_M (BIT(11)) -#define SENS_TOUCH_START_FSM_EN_V 0x1 -#define SENS_TOUCH_START_FSM_EN_S 11 -/* SENS_TOUCH_MEAS_DONE : RO ;bitpos:[10] ;default: 1'h0 ; */ -/*description: fsm set 1 to indicate touch touch meas is done*/ -#define SENS_TOUCH_MEAS_DONE (BIT(10)) -#define SENS_TOUCH_MEAS_DONE_M (BIT(10)) -#define SENS_TOUCH_MEAS_DONE_V 0x1 -#define SENS_TOUCH_MEAS_DONE_S 10 -/* SENS_TOUCH_MEAS_EN : RO ;bitpos:[9:0] ;default: 10'h0 ; */ -/*description: 10-bit register to indicate which pads are "touched"*/ -#define SENS_TOUCH_MEAS_EN 0x000003FF -#define SENS_TOUCH_MEAS_EN_M ((SENS_TOUCH_MEAS_EN_V)<<(SENS_TOUCH_MEAS_EN_S)) -#define SENS_TOUCH_MEAS_EN_V 0x3FF -#define SENS_TOUCH_MEAS_EN_S 0 - -#define SENS_SAR_TOUCH_ENABLE_REG (DR_REG_SENS_BASE + 0x008c) -/* SENS_TOUCH_PAD_OUTEN1 : R/W ;bitpos:[29:20] ;default: 10'h3ff ; */ -/*description: Bitmap defining SET1 for generating wakeup interrupt. SET1 is - "touched" only if at least one of touch pad in SET1 is "touched".*/ -#define SENS_TOUCH_PAD_OUTEN1 0x000003FF -#define SENS_TOUCH_PAD_OUTEN1_M ((SENS_TOUCH_PAD_OUTEN1_V)<<(SENS_TOUCH_PAD_OUTEN1_S)) -#define SENS_TOUCH_PAD_OUTEN1_V 0x3FF -#define SENS_TOUCH_PAD_OUTEN1_S 20 -/* SENS_TOUCH_PAD_OUTEN2 : R/W ;bitpos:[19:10] ;default: 10'h3ff ; */ -/*description: Bitmap defining SET2 for generating wakeup interrupt. SET2 is - "touched" only if at least one of touch pad in SET2 is "touched".*/ -#define SENS_TOUCH_PAD_OUTEN2 0x000003FF -#define SENS_TOUCH_PAD_OUTEN2_M ((SENS_TOUCH_PAD_OUTEN2_V)<<(SENS_TOUCH_PAD_OUTEN2_S)) -#define SENS_TOUCH_PAD_OUTEN2_V 0x3FF -#define SENS_TOUCH_PAD_OUTEN2_S 10 -/* SENS_TOUCH_PAD_WORKEN : R/W ;bitpos:[9:0] ;default: 10'h3ff ; */ -/*description: Bitmap defining the working set during the measurement.*/ -#define SENS_TOUCH_PAD_WORKEN 0x000003FF -#define SENS_TOUCH_PAD_WORKEN_M ((SENS_TOUCH_PAD_WORKEN_V)<<(SENS_TOUCH_PAD_WORKEN_S)) -#define SENS_TOUCH_PAD_WORKEN_V 0x3FF -#define SENS_TOUCH_PAD_WORKEN_S 0 - -#define SENS_SAR_READ_CTRL2_REG (DR_REG_SENS_BASE + 0x0090) -/* SENS_SAR2_DATA_INV : R/W ;bitpos:[29] ;default: 1'b0 ; */ -/*description: Invert SAR ADC2 data*/ -#define SENS_SAR2_DATA_INV (BIT(29)) -#define SENS_SAR2_DATA_INV_M (BIT(29)) -#define SENS_SAR2_DATA_INV_V 0x1 -#define SENS_SAR2_DATA_INV_S 29 -/* SENS_SAR2_DIG_FORCE : R/W ;bitpos:[28] ;default: 1'b0 ; */ -/*description: 1: SAR ADC2 controlled by DIG ADC2 CTRL or PWDET CTRL 0: SAR - ADC2 controlled by RTC ADC2 CTRL*/ -#define SENS_SAR2_DIG_FORCE (BIT(28)) -#define SENS_SAR2_DIG_FORCE_M (BIT(28)) -#define SENS_SAR2_DIG_FORCE_V 0x1 -#define SENS_SAR2_DIG_FORCE_S 28 -/* SENS_SAR2_PWDET_FORCE : R/W ;bitpos:[27] ;default: 1'b0 ; */ -/*description: */ -#define SENS_SAR2_PWDET_FORCE (BIT(27)) -#define SENS_SAR2_PWDET_FORCE_M (BIT(27)) -#define SENS_SAR2_PWDET_FORCE_V 0x1 -#define SENS_SAR2_PWDET_FORCE_S 27 -/* SENS_SAR2_SAMPLE_NUM : R/W ;bitpos:[26:19] ;default: 8'd0 ; */ -/*description: */ -#define SENS_SAR2_SAMPLE_NUM 0x000000FF -#define SENS_SAR2_SAMPLE_NUM_M ((SENS_SAR2_SAMPLE_NUM_V)<<(SENS_SAR2_SAMPLE_NUM_S)) -#define SENS_SAR2_SAMPLE_NUM_V 0xFF -#define SENS_SAR2_SAMPLE_NUM_S 19 -/* SENS_SAR2_CLK_GATED : R/W ;bitpos:[18] ;default: 1'b1 ; */ -/*description: */ -#define SENS_SAR2_CLK_GATED (BIT(18)) -#define SENS_SAR2_CLK_GATED_M (BIT(18)) -#define SENS_SAR2_CLK_GATED_V 0x1 -#define SENS_SAR2_CLK_GATED_S 18 -/* SENS_SAR2_SAMPLE_BIT : R/W ;bitpos:[17:16] ;default: 2'd3 ; */ -/*description: 00: for 9-bit width 01: for 10-bit width 10: for 11-bit width - 11: for 12-bit width*/ -#define SENS_SAR2_SAMPLE_BIT 0x00000003 -#define SENS_SAR2_SAMPLE_BIT_M ((SENS_SAR2_SAMPLE_BIT_V)<<(SENS_SAR2_SAMPLE_BIT_S)) -#define SENS_SAR2_SAMPLE_BIT_V 0x3 -#define SENS_SAR2_SAMPLE_BIT_S 16 -/* SENS_SAR2_SAMPLE_CYCLE : R/W ;bitpos:[15:8] ;default: 8'd9 ; */ -/*description: sample cycles for SAR ADC2*/ -#define SENS_SAR2_SAMPLE_CYCLE 0x000000FF -#define SENS_SAR2_SAMPLE_CYCLE_M ((SENS_SAR2_SAMPLE_CYCLE_V)<<(SENS_SAR2_SAMPLE_CYCLE_S)) -#define SENS_SAR2_SAMPLE_CYCLE_V 0xFF -#define SENS_SAR2_SAMPLE_CYCLE_S 8 -/* SENS_SAR2_CLK_DIV : R/W ;bitpos:[7:0] ;default: 8'd2 ; */ -/*description: clock divider*/ -#define SENS_SAR2_CLK_DIV 0x000000FF -#define SENS_SAR2_CLK_DIV_M ((SENS_SAR2_CLK_DIV_V)<<(SENS_SAR2_CLK_DIV_S)) -#define SENS_SAR2_CLK_DIV_V 0xFF -#define SENS_SAR2_CLK_DIV_S 0 - -#define SENS_SAR_MEAS_START2_REG (DR_REG_SENS_BASE + 0x0094) -/* SENS_SAR2_EN_PAD_FORCE : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: 1: SAR ADC2 pad enable bitmap is controlled by SW 0: SAR ADC2 - pad enable bitmap is controlled by ULP-coprocessor*/ -#define SENS_SAR2_EN_PAD_FORCE (BIT(31)) -#define SENS_SAR2_EN_PAD_FORCE_M (BIT(31)) -#define SENS_SAR2_EN_PAD_FORCE_V 0x1 -#define SENS_SAR2_EN_PAD_FORCE_S 31 -/* SENS_SAR2_EN_PAD : R/W ;bitpos:[30:19] ;default: 12'b0 ; */ -/*description: SAR ADC2 pad enable bitmap only active when reg_sar2_en_pad_force = 1*/ -#define SENS_SAR2_EN_PAD 0x00000FFF -#define SENS_SAR2_EN_PAD_M ((SENS_SAR2_EN_PAD_V)<<(SENS_SAR2_EN_PAD_S)) -#define SENS_SAR2_EN_PAD_V 0xFFF -#define SENS_SAR2_EN_PAD_S 19 -/* SENS_MEAS2_START_FORCE : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: 1: SAR ADC2 controller (in RTC) is started by SW 0: SAR ADC2 - controller is started by ULP-coprocessor*/ -#define SENS_MEAS2_START_FORCE (BIT(18)) -#define SENS_MEAS2_START_FORCE_M (BIT(18)) -#define SENS_MEAS2_START_FORCE_V 0x1 -#define SENS_MEAS2_START_FORCE_S 18 -/* SENS_MEAS2_START_SAR : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: SAR ADC2 controller (in RTC) starts conversion only active when - reg_meas2_start_force = 1*/ -#define SENS_MEAS2_START_SAR (BIT(17)) -#define SENS_MEAS2_START_SAR_M (BIT(17)) -#define SENS_MEAS2_START_SAR_V 0x1 -#define SENS_MEAS2_START_SAR_S 17 -/* SENS_MEAS2_DONE_SAR : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: SAR ADC2 conversion done indication*/ -#define SENS_MEAS2_DONE_SAR (BIT(16)) -#define SENS_MEAS2_DONE_SAR_M (BIT(16)) -#define SENS_MEAS2_DONE_SAR_V 0x1 -#define SENS_MEAS2_DONE_SAR_S 16 -/* SENS_MEAS2_DATA_SAR : RO ;bitpos:[15:0] ;default: 16'b0 ; */ -/*description: SAR ADC2 data*/ -#define SENS_MEAS2_DATA_SAR 0x0000FFFF -#define SENS_MEAS2_DATA_SAR_M ((SENS_MEAS2_DATA_SAR_V)<<(SENS_MEAS2_DATA_SAR_S)) -#define SENS_MEAS2_DATA_SAR_V 0xFFFF -#define SENS_MEAS2_DATA_SAR_S 0 - -#define SENS_SAR_DAC_CTRL1_REG (DR_REG_SENS_BASE + 0x0098) -/* SENS_DAC_CLK_INV : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: 1: invert PDAC_CLK*/ -#define SENS_DAC_CLK_INV (BIT(25)) -#define SENS_DAC_CLK_INV_M (BIT(25)) -#define SENS_DAC_CLK_INV_V 0x1 -#define SENS_DAC_CLK_INV_S 25 -/* SENS_DAC_CLK_FORCE_HIGH : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: 1: force PDAC_CLK to high*/ -#define SENS_DAC_CLK_FORCE_HIGH (BIT(24)) -#define SENS_DAC_CLK_FORCE_HIGH_M (BIT(24)) -#define SENS_DAC_CLK_FORCE_HIGH_V 0x1 -#define SENS_DAC_CLK_FORCE_HIGH_S 24 -/* SENS_DAC_CLK_FORCE_LOW : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: 1: force PDAC_CLK to low*/ -#define SENS_DAC_CLK_FORCE_LOW (BIT(23)) -#define SENS_DAC_CLK_FORCE_LOW_M (BIT(23)) -#define SENS_DAC_CLK_FORCE_LOW_V 0x1 -#define SENS_DAC_CLK_FORCE_LOW_S 23 -/* SENS_DAC_DIG_FORCE : R/W ;bitpos:[22] ;default: 1'b0 ; */ -/*description: 1: DAC1 & DAC2 use DMA 0: DAC1 & DAC2 do not use DMA*/ -#define SENS_DAC_DIG_FORCE (BIT(22)) -#define SENS_DAC_DIG_FORCE_M (BIT(22)) -#define SENS_DAC_DIG_FORCE_V 0x1 -#define SENS_DAC_DIG_FORCE_S 22 -/* SENS_DEBUG_BIT_SEL : R/W ;bitpos:[21:17] ;default: 5'b0 ; */ -/*description: */ -#define SENS_DEBUG_BIT_SEL 0x0000001F -#define SENS_DEBUG_BIT_SEL_M ((SENS_DEBUG_BIT_SEL_V)<<(SENS_DEBUG_BIT_SEL_S)) -#define SENS_DEBUG_BIT_SEL_V 0x1F -#define SENS_DEBUG_BIT_SEL_S 17 -/* SENS_SW_TONE_EN : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: 1: enable CW generator 0: disable CW generator*/ -#define SENS_SW_TONE_EN (BIT(16)) -#define SENS_SW_TONE_EN_M (BIT(16)) -#define SENS_SW_TONE_EN_V 0x1 -#define SENS_SW_TONE_EN_S 16 -/* SENS_SW_FSTEP : R/W ;bitpos:[15:0] ;default: 16'b0 ; */ -/*description: frequency step for CW generator can be used to adjust the frequency*/ -#define SENS_SW_FSTEP 0x0000FFFF -#define SENS_SW_FSTEP_M ((SENS_SW_FSTEP_V)<<(SENS_SW_FSTEP_S)) -#define SENS_SW_FSTEP_V 0xFFFF -#define SENS_SW_FSTEP_S 0 - -#define SENS_SAR_DAC_CTRL2_REG (DR_REG_SENS_BASE + 0x009c) -/* SENS_DAC_CW_EN2 : R/W ;bitpos:[25] ;default: 1'b1 ; */ -/*description: 1: to select CW generator as source to PDAC2_DAC[7:0] 0: to - select register reg_pdac2_dac[7:0] as source to PDAC2_DAC[7:0]*/ -#define SENS_DAC_CW_EN2 (BIT(25)) -#define SENS_DAC_CW_EN2_M (BIT(25)) -#define SENS_DAC_CW_EN2_V 0x1 -#define SENS_DAC_CW_EN2_S 25 -/* SENS_DAC_CW_EN1 : R/W ;bitpos:[24] ;default: 1'b1 ; */ -/*description: 1: to select CW generator as source to PDAC1_DAC[7:0] 0: to - select register reg_pdac1_dac[7:0] as source to PDAC1_DAC[7:0]*/ -#define SENS_DAC_CW_EN1 (BIT(24)) -#define SENS_DAC_CW_EN1_M (BIT(24)) -#define SENS_DAC_CW_EN1_V 0x1 -#define SENS_DAC_CW_EN1_S 24 -/* SENS_DAC_INV2 : R/W ;bitpos:[23:22] ;default: 2'b0 ; */ -/*description: 00: do not invert any bits 01: invert all bits 10: invert MSB - 11: invert all bits except MSB*/ -#define SENS_DAC_INV2 0x00000003 -#define SENS_DAC_INV2_M ((SENS_DAC_INV2_V)<<(SENS_DAC_INV2_S)) -#define SENS_DAC_INV2_V 0x3 -#define SENS_DAC_INV2_S 22 -/* SENS_DAC_INV1 : R/W ;bitpos:[21:20] ;default: 2'b0 ; */ -/*description: 00: do not invert any bits 01: invert all bits 10: invert MSB - 11: invert all bits except MSB*/ -#define SENS_DAC_INV1 0x00000003 -#define SENS_DAC_INV1_M ((SENS_DAC_INV1_V)<<(SENS_DAC_INV1_S)) -#define SENS_DAC_INV1_V 0x3 -#define SENS_DAC_INV1_S 20 -/* SENS_DAC_SCALE2 : R/W ;bitpos:[19:18] ;default: 2'b0 ; */ -/*description: 00: no scale 01: scale to 1/2 10: scale to 1/4 scale to 1/8*/ -#define SENS_DAC_SCALE2 0x00000003 -#define SENS_DAC_SCALE2_M ((SENS_DAC_SCALE2_V)<<(SENS_DAC_SCALE2_S)) -#define SENS_DAC_SCALE2_V 0x3 -#define SENS_DAC_SCALE2_S 18 -/* SENS_DAC_SCALE1 : R/W ;bitpos:[17:16] ;default: 2'b0 ; */ -/*description: 00: no scale 01: scale to 1/2 10: scale to 1/4 scale to 1/8*/ -#define SENS_DAC_SCALE1 0x00000003 -#define SENS_DAC_SCALE1_M ((SENS_DAC_SCALE1_V)<<(SENS_DAC_SCALE1_S)) -#define SENS_DAC_SCALE1_V 0x3 -#define SENS_DAC_SCALE1_S 16 -/* SENS_DAC_DC2 : R/W ;bitpos:[15:8] ;default: 8'b0 ; */ -/*description: DC offset for DAC2 CW generator*/ -#define SENS_DAC_DC2 0x000000FF -#define SENS_DAC_DC2_M ((SENS_DAC_DC2_V)<<(SENS_DAC_DC2_S)) -#define SENS_DAC_DC2_V 0xFF -#define SENS_DAC_DC2_S 8 -/* SENS_DAC_DC1 : R/W ;bitpos:[7:0] ;default: 8'b0 ; */ -/*description: DC offset for DAC1 CW generator*/ -#define SENS_DAC_DC1 0x000000FF -#define SENS_DAC_DC1_M ((SENS_DAC_DC1_V)<<(SENS_DAC_DC1_S)) -#define SENS_DAC_DC1_V 0xFF -#define SENS_DAC_DC1_S 0 - -#define SENS_SAR_MEAS_CTRL2_REG (DR_REG_SENS_BASE + 0x0a0) -/* SENS_AMP_SHORT_REF_GND_FORCE : R/W ;bitpos:[18:17] ;default: 2'b0 ; */ -/*description: */ -#define SENS_AMP_SHORT_REF_GND_FORCE 0x00000003 -#define SENS_AMP_SHORT_REF_GND_FORCE_M ((SENS_AMP_SHORT_REF_GND_FORCE_V)<<(SENS_AMP_SHORT_REF_GND_FORCE_S)) -#define SENS_AMP_SHORT_REF_GND_FORCE_V 0x3 -#define SENS_AMP_SHORT_REF_GND_FORCE_S 17 -#define SENS_AMP_SHORT_REF_GND_FORCE_FSM 0 // Use FSM to control power down -#define SENS_AMP_SHORT_REF_GND_FORCE_PD 2 // Force power down -#define SENS_AMP_SHORT_REF_GND_FORCE_PU 3 // Force power up -/* SENS_AMP_SHORT_REF_FORCE : R/W ;bitpos:[16:15] ;default: 2'b0 ; */ -/*description: */ -#define SENS_AMP_SHORT_REF_FORCE 0x00000003 -#define SENS_AMP_SHORT_REF_FORCE_M ((SENS_AMP_SHORT_REF_FORCE_V)<<(SENS_AMP_SHORT_REF_FORCE_S)) -#define SENS_AMP_SHORT_REF_FORCE_V 0x3 -#define SENS_AMP_SHORT_REF_FORCE_S 15 -#define SENS_AMP_SHORT_REF_FORCE_FSM 0 // Use FSM to control power down -#define SENS_AMP_SHORT_REF_FORCE_PD 2 // Force power down -#define SENS_AMP_SHORT_REF_FORCE_PU 3 // Force power up -/* SENS_AMP_RST_FB_FORCE : R/W ;bitpos:[14:13] ;default: 2'b0 ; */ -/*description: */ -#define SENS_AMP_RST_FB_FORCE 0x00000003 -#define SENS_AMP_RST_FB_FORCE_M ((SENS_AMP_RST_FB_FORCE_V)<<(SENS_AMP_RST_FB_FORCE_S)) -#define SENS_AMP_RST_FB_FORCE_V 0x3 -#define SENS_AMP_RST_FB_FORCE_S 13 -#define SENS_AMP_RST_FB_FORCE_FSM 0 // Use FSM to control power down -#define SENS_AMP_RST_FB_FORCE_PD 2 // Force power down -#define SENS_AMP_RST_FB_FORCE_PU 3 // Force power up -/* SENS_SAR2_RSTB_FORCE : R/W ;bitpos:[12:11] ;default: 2'b0 ; */ -/*description: */ -#define SENS_SAR2_RSTB_FORCE 0x00000003 -#define SENS_SAR2_RSTB_FORCE_M ((SENS_SAR2_RSTB_FORCE_V)<<(SENS_SAR2_RSTB_FORCE_S)) -#define SENS_SAR2_RSTB_FORCE_V 0x3 -#define SENS_SAR2_RSTB_FORCE_S 11 -#define SENS_SAR2_RSTB_FORCE_FSM 0 // Use FSM to control power down -#define SENS_SAR2_RSTB_FORCE_PD 2 // Force power down -#define SENS_SAR2_RSTB_FORCE_PU 3 // Force power up -/* SENS_SAR_RSTB_FSM_IDLE : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define SENS_SAR_RSTB_FSM_IDLE (BIT(10)) -#define SENS_SAR_RSTB_FSM_IDLE_M (BIT(10)) -#define SENS_SAR_RSTB_FSM_IDLE_V 0x1 -#define SENS_SAR_RSTB_FSM_IDLE_S 10 -/* SENS_XPD_SAR_FSM_IDLE : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define SENS_XPD_SAR_FSM_IDLE (BIT(9)) -#define SENS_XPD_SAR_FSM_IDLE_M (BIT(9)) -#define SENS_XPD_SAR_FSM_IDLE_V 0x1 -#define SENS_XPD_SAR_FSM_IDLE_S 9 -/* SENS_AMP_SHORT_REF_GND_FSM_IDLE : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define SENS_AMP_SHORT_REF_GND_FSM_IDLE (BIT(8)) -#define SENS_AMP_SHORT_REF_GND_FSM_IDLE_M (BIT(8)) -#define SENS_AMP_SHORT_REF_GND_FSM_IDLE_V 0x1 -#define SENS_AMP_SHORT_REF_GND_FSM_IDLE_S 8 -/* SENS_AMP_SHORT_REF_FSM_IDLE : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define SENS_AMP_SHORT_REF_FSM_IDLE (BIT(7)) -#define SENS_AMP_SHORT_REF_FSM_IDLE_M (BIT(7)) -#define SENS_AMP_SHORT_REF_FSM_IDLE_V 0x1 -#define SENS_AMP_SHORT_REF_FSM_IDLE_S 7 -/* SENS_AMP_RST_FB_FSM_IDLE : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define SENS_AMP_RST_FB_FSM_IDLE (BIT(6)) -#define SENS_AMP_RST_FB_FSM_IDLE_M (BIT(6)) -#define SENS_AMP_RST_FB_FSM_IDLE_V 0x1 -#define SENS_AMP_RST_FB_FSM_IDLE_S 6 -/* SENS_XPD_SAR_AMP_FSM_IDLE : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define SENS_XPD_SAR_AMP_FSM_IDLE (BIT(5)) -#define SENS_XPD_SAR_AMP_FSM_IDLE_M (BIT(5)) -#define SENS_XPD_SAR_AMP_FSM_IDLE_V 0x1 -#define SENS_XPD_SAR_AMP_FSM_IDLE_S 5 -/* SENS_SAR1_DAC_XPD_FSM_IDLE : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define SENS_SAR1_DAC_XPD_FSM_IDLE (BIT(4)) -#define SENS_SAR1_DAC_XPD_FSM_IDLE_M (BIT(4)) -#define SENS_SAR1_DAC_XPD_FSM_IDLE_V 0x1 -#define SENS_SAR1_DAC_XPD_FSM_IDLE_S 4 -/* SENS_SAR1_DAC_XPD_FSM : R/W ;bitpos:[3:0] ;default: 4'b0011 ; */ -/*description: */ -#define SENS_SAR1_DAC_XPD_FSM 0x0000000F -#define SENS_SAR1_DAC_XPD_FSM_M ((SENS_SAR1_DAC_XPD_FSM_V)<<(SENS_SAR1_DAC_XPD_FSM_S)) -#define SENS_SAR1_DAC_XPD_FSM_V 0xF -#define SENS_SAR1_DAC_XPD_FSM_S 0 - -#define SENS_SAR_NOUSE_REG (DR_REG_SENS_BASE + 0x00F8) -/* SENS_SAR_NOUSE : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define SENS_SAR_NOUSE 0xFFFFFFFF -#define SENS_SAR_NOUSE_M ((SENS_SAR_NOUSE_V)<<(SENS_SAR_NOUSE_S)) -#define SENS_SAR_NOUSE_V 0xFFFFFFFF -#define SENS_SAR_NOUSE_S 0 - -#define SENS_SARDATE_REG (DR_REG_SENS_BASE + 0x00FC) -/* SENS_SAR_DATE : R/W ;bitpos:[27:0] ;default: 28'h1605180 ; */ -/*description: */ -#define SENS_SAR_DATE 0x0FFFFFFF -#define SENS_SAR_DATE_M ((SENS_SAR_DATE_V)<<(SENS_SAR_DATE_S)) -#define SENS_SAR_DATE_V 0xFFFFFFF -#define SENS_SAR_DATE_S 0 - - - - -#endif /*_SOC_SENS_REG_H_ */ - - diff --git a/tools/sdk/include/soc/soc/sens_struct.h b/tools/sdk/include/soc/soc/sens_struct.h deleted file mode 100644 index 37069a94560..00000000000 --- a/tools/sdk/include/soc/soc/sens_struct.h +++ /dev/null @@ -1,326 +0,0 @@ -// 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. -#ifndef _SOC_SENS_STRUCT_H_ -#define _SOC_SENS_STRUCT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef volatile struct { - union { - struct { - uint32_t sar1_clk_div: 8; - uint32_t sar1_sample_cycle: 8; - uint32_t sar1_sample_bit: 2; - uint32_t sar1_clk_gated: 1; - uint32_t sar1_sample_num: 8; - uint32_t sar1_dig_force: 1; /*1: ADC1 is controlled by the digital controller 0: RTC controller*/ - uint32_t sar1_data_inv: 1; - uint32_t reserved29: 3; - }; - uint32_t val; - } sar_read_ctrl; - uint32_t sar_read_status1; /**/ - union { - struct { - uint32_t sar_amp_wait1:16; - uint32_t sar_amp_wait2:16; - }; - uint32_t val; - } sar_meas_wait1; - union { - struct { - uint32_t sar_amp_wait3: 16; - uint32_t force_xpd_amp: 2; - uint32_t force_xpd_sar: 2; - uint32_t sar2_rstb_wait: 8; - uint32_t reserved28: 4; - }; - uint32_t val; - } sar_meas_wait2; - union { - struct { - uint32_t xpd_sar_amp_fsm: 4; - uint32_t amp_rst_fb_fsm: 4; - uint32_t amp_short_ref_fsm: 4; - uint32_t amp_short_ref_gnd_fsm: 4; - uint32_t xpd_sar_fsm: 4; - uint32_t sar_rstb_fsm: 4; - uint32_t sar2_xpd_wait: 8; - }; - uint32_t val; - } sar_meas_ctrl; - uint32_t sar_read_status2; /**/ - uint32_t ulp_cp_sleep_cyc0; /**/ - uint32_t ulp_cp_sleep_cyc1; /**/ - uint32_t ulp_cp_sleep_cyc2; /**/ - uint32_t ulp_cp_sleep_cyc3; /**/ - uint32_t ulp_cp_sleep_cyc4; /**/ - union { - struct { - uint32_t sar1_bit_width: 2; - uint32_t sar2_bit_width: 2; - uint32_t sar2_en_test: 1; - uint32_t sar2_pwdet_cct: 3; - uint32_t ulp_cp_force_start_top: 1; - uint32_t ulp_cp_start_top: 1; - uint32_t sarclk_en: 1; - uint32_t pc_init: 11; - uint32_t sar2_stop: 1; - uint32_t sar1_stop: 1; - uint32_t sar2_pwdet_en: 1; - uint32_t reserved25: 7; - }; - uint32_t val; - } sar_start_force; - union { - struct { - uint32_t mem_wr_addr_init: 11; - uint32_t mem_wr_addr_size: 11; - uint32_t rtc_mem_wr_offst_clr: 1; - uint32_t reserved23: 9; - }; - uint32_t val; - } sar_mem_wr_ctrl; - uint32_t sar_atten1; /**/ - uint32_t sar_atten2; /**/ - union { - struct { - uint32_t i2c_slave_addr1: 11; - uint32_t i2c_slave_addr0: 11; - uint32_t meas_status: 8; - uint32_t reserved30: 2; - }; - uint32_t val; - } sar_slave_addr1; - union { - struct { - uint32_t i2c_slave_addr3:11; - uint32_t i2c_slave_addr2:11; - uint32_t reserved22: 10; - }; - uint32_t val; - } sar_slave_addr2; - union { - struct { - uint32_t i2c_slave_addr5:11; - uint32_t i2c_slave_addr4:11; - uint32_t tsens_out: 8; - uint32_t tsens_rdy_out: 1; - uint32_t reserved31: 1; - }; - uint32_t val; - } sar_slave_addr3; - union { - struct { - uint32_t i2c_slave_addr7:11; - uint32_t i2c_slave_addr6:11; - uint32_t i2c_rdata: 8; - uint32_t i2c_done: 1; - uint32_t reserved31: 1; - }; - uint32_t val; - } sar_slave_addr4; - union { - struct { - uint32_t tsens_xpd_wait: 12; - uint32_t tsens_xpd_force: 1; - uint32_t tsens_clk_inv: 1; - uint32_t tsens_clk_gated: 1; - uint32_t tsens_in_inv: 1; - uint32_t tsens_clk_div: 8; - uint32_t tsens_power_up: 1; - uint32_t tsens_power_up_force: 1; - uint32_t tsens_dump_out: 1; - uint32_t reserved27: 5; - }; - uint32_t val; - } sar_tctrl; - union { - struct { - uint32_t sar_i2c_ctrl: 28; - uint32_t sar_i2c_start: 1; - uint32_t sar_i2c_start_force: 1; - uint32_t reserved30: 2; - }; - uint32_t val; - } sar_i2c_ctrl; - union { - struct { - uint32_t meas1_data_sar: 16; - uint32_t meas1_done_sar: 1; - uint32_t meas1_start_sar: 1; - uint32_t meas1_start_force: 1; /*1: ADC1 is controlled by the digital or RTC controller 0: Ulp coprocessor*/ - uint32_t sar1_en_pad: 12; - uint32_t sar1_en_pad_force: 1; /*1: Data ports are controlled by the digital or RTC controller 0: Ulp coprocessor*/ - }; - uint32_t val; - } sar_meas_start1; - union { - struct { - uint32_t touch_meas_delay:16; - uint32_t touch_xpd_wait: 8; - uint32_t touch_out_sel: 1; - uint32_t touch_out_1en: 1; - uint32_t xpd_hall_force: 1; /*1: Power of hall sensor is controlled by the digital or RTC controller 0: Ulp coprocessor*/ - uint32_t hall_phase_force: 1; /*1: Phase of hall sensor is controlled by the digital or RTC controller 0: Ulp coprocessor*/ - uint32_t reserved28: 4; - }; - uint32_t val; - } sar_touch_ctrl1; - union { - struct { - uint32_t l_thresh: 16; - uint32_t h_thresh: 16; - }; - uint32_t val; - } touch_thresh[5]; - union { - struct { - uint32_t l_val: 16; - uint32_t h_val: 16; - }; - uint32_t val; - } touch_meas[5]; - union { - struct { - uint32_t touch_meas_en: 10; - uint32_t touch_meas_done: 1; - uint32_t touch_start_fsm_en: 1; - uint32_t touch_start_en: 1; - uint32_t touch_start_force: 1; - uint32_t touch_sleep_cycles:16; - uint32_t touch_meas_en_clr: 1; - uint32_t reserved31: 1; - }; - uint32_t val; - } sar_touch_ctrl2; - uint32_t reserved_88; - union { - struct { - uint32_t touch_pad_worken:10; - uint32_t touch_pad_outen2:10; - uint32_t touch_pad_outen1:10; - uint32_t reserved30: 2; - }; - uint32_t val; - } sar_touch_enable; - union { - struct { - uint32_t sar2_clk_div: 8; - uint32_t sar2_sample_cycle: 8; - uint32_t sar2_sample_bit: 2; - uint32_t sar2_clk_gated: 1; - uint32_t sar2_sample_num: 8; - uint32_t sar2_pwdet_force: 1; /*1: ADC2 is controlled by PWDET 0: digital or RTC controller*/ - uint32_t sar2_dig_force: 1; /*1: ADC2 is controlled by the digital controller 0: RTC controller*/ - uint32_t sar2_data_inv: 1; - uint32_t reserved30: 2; - }; - uint32_t val; - } sar_read_ctrl2; - union { - struct { - uint32_t meas2_data_sar: 16; - uint32_t meas2_done_sar: 1; - uint32_t meas2_start_sar: 1; - uint32_t meas2_start_force: 1; /*1: ADC2 is controlled by the digital or RTC controller 0: Ulp coprocessor*/ - uint32_t sar2_en_pad: 12; - uint32_t sar2_en_pad_force: 1; /*1: Data ports are controlled by the digital or RTC controller 0: Ulp coprocessor*/ - }; - uint32_t val; - } sar_meas_start2; - union { - struct { - uint32_t sw_fstep: 16; - uint32_t sw_tone_en: 1; - uint32_t debug_bit_sel: 5; - uint32_t dac_dig_force: 1; - uint32_t dac_clk_force_low: 1; - uint32_t dac_clk_force_high: 1; - uint32_t dac_clk_inv: 1; - uint32_t reserved26: 6; - }; - uint32_t val; - } sar_dac_ctrl1; - union { - struct { - uint32_t dac_dc1: 8; - uint32_t dac_dc2: 8; - uint32_t dac_scale1: 2; - uint32_t dac_scale2: 2; - uint32_t dac_inv1: 2; - uint32_t dac_inv2: 2; - uint32_t dac_cw_en1: 1; - uint32_t dac_cw_en2: 1; - uint32_t reserved26: 6; - }; - uint32_t val; - } sar_dac_ctrl2; - union { - struct { - uint32_t sar1_dac_xpd_fsm: 4; - uint32_t sar1_dac_xpd_fsm_idle: 1; - uint32_t xpd_sar_amp_fsm_idle: 1; - uint32_t amp_rst_fb_fsm_idle: 1; - uint32_t amp_short_ref_fsm_idle: 1; - uint32_t amp_short_ref_gnd_fsm_idle: 1; - uint32_t xpd_sar_fsm_idle: 1; - uint32_t sar_rstb_fsm_idle: 1; - uint32_t sar2_rstb_force: 2; - uint32_t amp_rst_fb_force: 2; - uint32_t amp_short_ref_force: 2; - uint32_t amp_short_ref_gnd_force: 2; - uint32_t reserved19: 13; - }; - uint32_t val; - } sar_meas_ctrl2; - uint32_t reserved_a4; - uint32_t reserved_a8; - uint32_t reserved_ac; - uint32_t reserved_b0; - uint32_t reserved_b4; - uint32_t reserved_b8; - uint32_t reserved_bc; - uint32_t reserved_c0; - uint32_t reserved_c4; - uint32_t reserved_c8; - uint32_t reserved_cc; - uint32_t reserved_d0; - uint32_t reserved_d4; - uint32_t reserved_d8; - uint32_t reserved_dc; - uint32_t reserved_e0; - uint32_t reserved_e4; - uint32_t reserved_e8; - uint32_t reserved_ec; - uint32_t reserved_f0; - uint32_t reserved_f4; - uint32_t sar_nouse; /**/ - union { - struct { - uint32_t sar_date: 28; - uint32_t reserved28: 4; - }; - uint32_t val; - } sardate; -} sens_dev_t; -extern sens_dev_t SENS; - -#ifdef __cplusplus -} -#endif - -#endif /* _SOC_SENS_STRUCT_H_ */ diff --git a/tools/sdk/include/soc/soc/slc_reg.h b/tools/sdk/include/soc/soc/slc_reg.h deleted file mode 100644 index 3d4541cccbc..00000000000 --- a/tools/sdk/include/soc/soc/slc_reg.h +++ /dev/null @@ -1,3244 +0,0 @@ -// 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. -#ifndef _SOC_SLC_REG_H_ -#define _SOC_SLC_REG_H_ - - -#include "soc.h" -#define SLC_CONF0_REG (DR_REG_SLC_BASE + 0x0) -/* SLC_SLC1_TOKEN_SEL : R/W ;bitpos:[31] ;default: 1'h1 ; */ -/*description: */ -#define SLC_SLC1_TOKEN_SEL (BIT(31)) -#define SLC_SLC1_TOKEN_SEL_M (BIT(31)) -#define SLC_SLC1_TOKEN_SEL_V 0x1 -#define SLC_SLC1_TOKEN_SEL_S 31 -/* SLC_SLC1_TOKEN_AUTO_CLR : R/W ;bitpos:[30] ;default: 1'h1 ; */ -/*description: */ -#define SLC_SLC1_TOKEN_AUTO_CLR (BIT(30)) -#define SLC_SLC1_TOKEN_AUTO_CLR_M (BIT(30)) -#define SLC_SLC1_TOKEN_AUTO_CLR_V 0x1 -#define SLC_SLC1_TOKEN_AUTO_CLR_S 30 -/* SLC_SLC1_TXDATA_BURST_EN : R/W ;bitpos:[29] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC1_TXDATA_BURST_EN (BIT(29)) -#define SLC_SLC1_TXDATA_BURST_EN_M (BIT(29)) -#define SLC_SLC1_TXDATA_BURST_EN_V 0x1 -#define SLC_SLC1_TXDATA_BURST_EN_S 29 -/* SLC_SLC1_TXDSCR_BURST_EN : R/W ;bitpos:[28] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC1_TXDSCR_BURST_EN (BIT(28)) -#define SLC_SLC1_TXDSCR_BURST_EN_M (BIT(28)) -#define SLC_SLC1_TXDSCR_BURST_EN_V 0x1 -#define SLC_SLC1_TXDSCR_BURST_EN_S 28 -/* SLC_SLC1_TXLINK_AUTO_RET : R/W ;bitpos:[27] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC1_TXLINK_AUTO_RET (BIT(27)) -#define SLC_SLC1_TXLINK_AUTO_RET_M (BIT(27)) -#define SLC_SLC1_TXLINK_AUTO_RET_V 0x1 -#define SLC_SLC1_TXLINK_AUTO_RET_S 27 -/* SLC_SLC1_RXLINK_AUTO_RET : R/W ;bitpos:[26] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC1_RXLINK_AUTO_RET (BIT(26)) -#define SLC_SLC1_RXLINK_AUTO_RET_M (BIT(26)) -#define SLC_SLC1_RXLINK_AUTO_RET_V 0x1 -#define SLC_SLC1_RXLINK_AUTO_RET_S 26 -/* SLC_SLC1_RXDATA_BURST_EN : R/W ;bitpos:[25] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC1_RXDATA_BURST_EN (BIT(25)) -#define SLC_SLC1_RXDATA_BURST_EN_M (BIT(25)) -#define SLC_SLC1_RXDATA_BURST_EN_V 0x1 -#define SLC_SLC1_RXDATA_BURST_EN_S 25 -/* SLC_SLC1_RXDSCR_BURST_EN : R/W ;bitpos:[24] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC1_RXDSCR_BURST_EN (BIT(24)) -#define SLC_SLC1_RXDSCR_BURST_EN_M (BIT(24)) -#define SLC_SLC1_RXDSCR_BURST_EN_V 0x1 -#define SLC_SLC1_RXDSCR_BURST_EN_S 24 -/* SLC_SLC1_RX_NO_RESTART_CLR : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_NO_RESTART_CLR (BIT(23)) -#define SLC_SLC1_RX_NO_RESTART_CLR_M (BIT(23)) -#define SLC_SLC1_RX_NO_RESTART_CLR_V 0x1 -#define SLC_SLC1_RX_NO_RESTART_CLR_S 23 -/* SLC_SLC1_RX_AUTO_WRBACK : R/W ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_AUTO_WRBACK (BIT(22)) -#define SLC_SLC1_RX_AUTO_WRBACK_M (BIT(22)) -#define SLC_SLC1_RX_AUTO_WRBACK_V 0x1 -#define SLC_SLC1_RX_AUTO_WRBACK_S 22 -/* SLC_SLC1_RX_LOOP_TEST : R/W ;bitpos:[21] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC1_RX_LOOP_TEST (BIT(21)) -#define SLC_SLC1_RX_LOOP_TEST_M (BIT(21)) -#define SLC_SLC1_RX_LOOP_TEST_V 0x1 -#define SLC_SLC1_RX_LOOP_TEST_S 21 -/* SLC_SLC1_TX_LOOP_TEST : R/W ;bitpos:[20] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC1_TX_LOOP_TEST (BIT(20)) -#define SLC_SLC1_TX_LOOP_TEST_M (BIT(20)) -#define SLC_SLC1_TX_LOOP_TEST_V 0x1 -#define SLC_SLC1_TX_LOOP_TEST_S 20 -/* SLC_SLC1_WR_RETRY_MASK_EN : R/W ;bitpos:[19] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC1_WR_RETRY_MASK_EN (BIT(19)) -#define SLC_SLC1_WR_RETRY_MASK_EN_M (BIT(19)) -#define SLC_SLC1_WR_RETRY_MASK_EN_V 0x1 -#define SLC_SLC1_WR_RETRY_MASK_EN_S 19 -/* SLC_SLC0_WR_RETRY_MASK_EN : R/W ;bitpos:[18] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC0_WR_RETRY_MASK_EN (BIT(18)) -#define SLC_SLC0_WR_RETRY_MASK_EN_M (BIT(18)) -#define SLC_SLC0_WR_RETRY_MASK_EN_V 0x1 -#define SLC_SLC0_WR_RETRY_MASK_EN_S 18 -/* SLC_SLC1_RX_RST : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_RST (BIT(17)) -#define SLC_SLC1_RX_RST_M (BIT(17)) -#define SLC_SLC1_RX_RST_V 0x1 -#define SLC_SLC1_RX_RST_S 17 -/* SLC_SLC1_TX_RST : R/W ;bitpos:[16] ;default: 1'h0 ; */ -/*description: */ -#define SLC_SLC1_TX_RST (BIT(16)) -#define SLC_SLC1_TX_RST_M (BIT(16)) -#define SLC_SLC1_TX_RST_V 0x1 -#define SLC_SLC1_TX_RST_S 16 -/* SLC_SLC0_TOKEN_SEL : R/W ;bitpos:[15] ;default: 1'h1 ; */ -/*description: */ -#define SLC_SLC0_TOKEN_SEL (BIT(15)) -#define SLC_SLC0_TOKEN_SEL_M (BIT(15)) -#define SLC_SLC0_TOKEN_SEL_V 0x1 -#define SLC_SLC0_TOKEN_SEL_S 15 -/* SLC_SLC0_TOKEN_AUTO_CLR : R/W ;bitpos:[14] ;default: 1'h1 ; */ -/*description: */ -#define SLC_SLC0_TOKEN_AUTO_CLR (BIT(14)) -#define SLC_SLC0_TOKEN_AUTO_CLR_M (BIT(14)) -#define SLC_SLC0_TOKEN_AUTO_CLR_V 0x1 -#define SLC_SLC0_TOKEN_AUTO_CLR_S 14 -/* SLC_SLC0_TXDATA_BURST_EN : R/W ;bitpos:[13] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC0_TXDATA_BURST_EN (BIT(13)) -#define SLC_SLC0_TXDATA_BURST_EN_M (BIT(13)) -#define SLC_SLC0_TXDATA_BURST_EN_V 0x1 -#define SLC_SLC0_TXDATA_BURST_EN_S 13 -/* SLC_SLC0_TXDSCR_BURST_EN : R/W ;bitpos:[12] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC0_TXDSCR_BURST_EN (BIT(12)) -#define SLC_SLC0_TXDSCR_BURST_EN_M (BIT(12)) -#define SLC_SLC0_TXDSCR_BURST_EN_V 0x1 -#define SLC_SLC0_TXDSCR_BURST_EN_S 12 -/* SLC_SLC0_TXLINK_AUTO_RET : R/W ;bitpos:[11] ;default: 1'h1 ; */ -/*description: */ -#define SLC_SLC0_TXLINK_AUTO_RET (BIT(11)) -#define SLC_SLC0_TXLINK_AUTO_RET_M (BIT(11)) -#define SLC_SLC0_TXLINK_AUTO_RET_V 0x1 -#define SLC_SLC0_TXLINK_AUTO_RET_S 11 -/* SLC_SLC0_RXLINK_AUTO_RET : R/W ;bitpos:[10] ;default: 1'h1 ; */ -/*description: */ -#define SLC_SLC0_RXLINK_AUTO_RET (BIT(10)) -#define SLC_SLC0_RXLINK_AUTO_RET_M (BIT(10)) -#define SLC_SLC0_RXLINK_AUTO_RET_V 0x1 -#define SLC_SLC0_RXLINK_AUTO_RET_S 10 -/* SLC_SLC0_RXDATA_BURST_EN : R/W ;bitpos:[9] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC0_RXDATA_BURST_EN (BIT(9)) -#define SLC_SLC0_RXDATA_BURST_EN_M (BIT(9)) -#define SLC_SLC0_RXDATA_BURST_EN_V 0x1 -#define SLC_SLC0_RXDATA_BURST_EN_S 9 -/* SLC_SLC0_RXDSCR_BURST_EN : R/W ;bitpos:[8] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC0_RXDSCR_BURST_EN (BIT(8)) -#define SLC_SLC0_RXDSCR_BURST_EN_M (BIT(8)) -#define SLC_SLC0_RXDSCR_BURST_EN_V 0x1 -#define SLC_SLC0_RXDSCR_BURST_EN_S 8 -/* SLC_SLC0_RX_NO_RESTART_CLR : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_NO_RESTART_CLR (BIT(7)) -#define SLC_SLC0_RX_NO_RESTART_CLR_M (BIT(7)) -#define SLC_SLC0_RX_NO_RESTART_CLR_V 0x1 -#define SLC_SLC0_RX_NO_RESTART_CLR_S 7 -/* SLC_SLC0_RX_AUTO_WRBACK : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_AUTO_WRBACK (BIT(6)) -#define SLC_SLC0_RX_AUTO_WRBACK_M (BIT(6)) -#define SLC_SLC0_RX_AUTO_WRBACK_V 0x1 -#define SLC_SLC0_RX_AUTO_WRBACK_S 6 -/* SLC_SLC0_RX_LOOP_TEST : R/W ;bitpos:[5] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC0_RX_LOOP_TEST (BIT(5)) -#define SLC_SLC0_RX_LOOP_TEST_M (BIT(5)) -#define SLC_SLC0_RX_LOOP_TEST_V 0x1 -#define SLC_SLC0_RX_LOOP_TEST_S 5 -/* SLC_SLC0_TX_LOOP_TEST : R/W ;bitpos:[4] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC0_TX_LOOP_TEST (BIT(4)) -#define SLC_SLC0_TX_LOOP_TEST_M (BIT(4)) -#define SLC_SLC0_TX_LOOP_TEST_V 0x1 -#define SLC_SLC0_TX_LOOP_TEST_S 4 -/* SLC_AHBM_RST : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define SLC_AHBM_RST (BIT(3)) -#define SLC_AHBM_RST_M (BIT(3)) -#define SLC_AHBM_RST_V 0x1 -#define SLC_AHBM_RST_S 3 -/* SLC_AHBM_FIFO_RST : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define SLC_AHBM_FIFO_RST (BIT(2)) -#define SLC_AHBM_FIFO_RST_M (BIT(2)) -#define SLC_AHBM_FIFO_RST_V 0x1 -#define SLC_AHBM_FIFO_RST_S 2 -/* SLC_SLC0_RX_RST : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_RST (BIT(1)) -#define SLC_SLC0_RX_RST_M (BIT(1)) -#define SLC_SLC0_RX_RST_V 0x1 -#define SLC_SLC0_RX_RST_S 1 -/* SLC_SLC0_TX_RST : R/W ;bitpos:[0] ;default: 1'h0 ; */ -/*description: */ -#define SLC_SLC0_TX_RST (BIT(0)) -#define SLC_SLC0_TX_RST_M (BIT(0)) -#define SLC_SLC0_TX_RST_V 0x1 -#define SLC_SLC0_TX_RST_S 0 - -#define SLC_0INT_RAW_REG (DR_REG_SLC_BASE + 0x4) -/* SLC_SLC0_RX_QUICK_EOF_INT_RAW : RO ;bitpos:[26] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_QUICK_EOF_INT_RAW (BIT(26)) -#define SLC_SLC0_RX_QUICK_EOF_INT_RAW_M (BIT(26)) -#define SLC_SLC0_RX_QUICK_EOF_INT_RAW_V 0x1 -#define SLC_SLC0_RX_QUICK_EOF_INT_RAW_S 26 -/* SLC_CMD_DTC_INT_RAW : RO ;bitpos:[25] ;default: 1'b0 ; */ -/*description: */ -#define SLC_CMD_DTC_INT_RAW (BIT(25)) -#define SLC_CMD_DTC_INT_RAW_M (BIT(25)) -#define SLC_CMD_DTC_INT_RAW_V 0x1 -#define SLC_CMD_DTC_INT_RAW_S 25 -/* SLC_SLC0_TX_ERR_EOF_INT_RAW : RO ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_ERR_EOF_INT_RAW (BIT(24)) -#define SLC_SLC0_TX_ERR_EOF_INT_RAW_M (BIT(24)) -#define SLC_SLC0_TX_ERR_EOF_INT_RAW_V 0x1 -#define SLC_SLC0_TX_ERR_EOF_INT_RAW_S 24 -/* SLC_SLC0_WR_RETRY_DONE_INT_RAW : RO ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_WR_RETRY_DONE_INT_RAW (BIT(23)) -#define SLC_SLC0_WR_RETRY_DONE_INT_RAW_M (BIT(23)) -#define SLC_SLC0_WR_RETRY_DONE_INT_RAW_V 0x1 -#define SLC_SLC0_WR_RETRY_DONE_INT_RAW_S 23 -/* SLC_SLC0_HOST_RD_ACK_INT_RAW : RO ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_HOST_RD_ACK_INT_RAW (BIT(22)) -#define SLC_SLC0_HOST_RD_ACK_INT_RAW_M (BIT(22)) -#define SLC_SLC0_HOST_RD_ACK_INT_RAW_V 0x1 -#define SLC_SLC0_HOST_RD_ACK_INT_RAW_S 22 -/* SLC_SLC0_TX_DSCR_EMPTY_INT_RAW : RO ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_DSCR_EMPTY_INT_RAW (BIT(21)) -#define SLC_SLC0_TX_DSCR_EMPTY_INT_RAW_M (BIT(21)) -#define SLC_SLC0_TX_DSCR_EMPTY_INT_RAW_V 0x1 -#define SLC_SLC0_TX_DSCR_EMPTY_INT_RAW_S 21 -/* SLC_SLC0_RX_DSCR_ERR_INT_RAW : RO ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_DSCR_ERR_INT_RAW (BIT(20)) -#define SLC_SLC0_RX_DSCR_ERR_INT_RAW_M (BIT(20)) -#define SLC_SLC0_RX_DSCR_ERR_INT_RAW_V 0x1 -#define SLC_SLC0_RX_DSCR_ERR_INT_RAW_S 20 -/* SLC_SLC0_TX_DSCR_ERR_INT_RAW : RO ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_DSCR_ERR_INT_RAW (BIT(19)) -#define SLC_SLC0_TX_DSCR_ERR_INT_RAW_M (BIT(19)) -#define SLC_SLC0_TX_DSCR_ERR_INT_RAW_V 0x1 -#define SLC_SLC0_TX_DSCR_ERR_INT_RAW_S 19 -/* SLC_SLC0_TOHOST_INT_RAW : RO ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TOHOST_INT_RAW (BIT(18)) -#define SLC_SLC0_TOHOST_INT_RAW_M (BIT(18)) -#define SLC_SLC0_TOHOST_INT_RAW_V 0x1 -#define SLC_SLC0_TOHOST_INT_RAW_S 18 -/* SLC_SLC0_RX_EOF_INT_RAW : RO ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_EOF_INT_RAW (BIT(17)) -#define SLC_SLC0_RX_EOF_INT_RAW_M (BIT(17)) -#define SLC_SLC0_RX_EOF_INT_RAW_V 0x1 -#define SLC_SLC0_RX_EOF_INT_RAW_S 17 -/* SLC_SLC0_RX_DONE_INT_RAW : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_DONE_INT_RAW (BIT(16)) -#define SLC_SLC0_RX_DONE_INT_RAW_M (BIT(16)) -#define SLC_SLC0_RX_DONE_INT_RAW_V 0x1 -#define SLC_SLC0_RX_DONE_INT_RAW_S 16 -/* SLC_SLC0_TX_SUC_EOF_INT_RAW : RO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_SUC_EOF_INT_RAW (BIT(15)) -#define SLC_SLC0_TX_SUC_EOF_INT_RAW_M (BIT(15)) -#define SLC_SLC0_TX_SUC_EOF_INT_RAW_V 0x1 -#define SLC_SLC0_TX_SUC_EOF_INT_RAW_S 15 -/* SLC_SLC0_TX_DONE_INT_RAW : RO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_DONE_INT_RAW (BIT(14)) -#define SLC_SLC0_TX_DONE_INT_RAW_M (BIT(14)) -#define SLC_SLC0_TX_DONE_INT_RAW_V 0x1 -#define SLC_SLC0_TX_DONE_INT_RAW_S 14 -/* SLC_SLC0_TOKEN1_1TO0_INT_RAW : RO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TOKEN1_1TO0_INT_RAW (BIT(13)) -#define SLC_SLC0_TOKEN1_1TO0_INT_RAW_M (BIT(13)) -#define SLC_SLC0_TOKEN1_1TO0_INT_RAW_V 0x1 -#define SLC_SLC0_TOKEN1_1TO0_INT_RAW_S 13 -/* SLC_SLC0_TOKEN0_1TO0_INT_RAW : RO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TOKEN0_1TO0_INT_RAW (BIT(12)) -#define SLC_SLC0_TOKEN0_1TO0_INT_RAW_M (BIT(12)) -#define SLC_SLC0_TOKEN0_1TO0_INT_RAW_V 0x1 -#define SLC_SLC0_TOKEN0_1TO0_INT_RAW_S 12 -/* SLC_SLC0_TX_OVF_INT_RAW : RO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_OVF_INT_RAW (BIT(11)) -#define SLC_SLC0_TX_OVF_INT_RAW_M (BIT(11)) -#define SLC_SLC0_TX_OVF_INT_RAW_V 0x1 -#define SLC_SLC0_TX_OVF_INT_RAW_S 11 -/* SLC_SLC0_RX_UDF_INT_RAW : RO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_UDF_INT_RAW (BIT(10)) -#define SLC_SLC0_RX_UDF_INT_RAW_M (BIT(10)) -#define SLC_SLC0_RX_UDF_INT_RAW_V 0x1 -#define SLC_SLC0_RX_UDF_INT_RAW_S 10 -/* SLC_SLC0_TX_START_INT_RAW : RO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_START_INT_RAW (BIT(9)) -#define SLC_SLC0_TX_START_INT_RAW_M (BIT(9)) -#define SLC_SLC0_TX_START_INT_RAW_V 0x1 -#define SLC_SLC0_TX_START_INT_RAW_S 9 -/* SLC_SLC0_RX_START_INT_RAW : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_START_INT_RAW (BIT(8)) -#define SLC_SLC0_RX_START_INT_RAW_M (BIT(8)) -#define SLC_SLC0_RX_START_INT_RAW_V 0x1 -#define SLC_SLC0_RX_START_INT_RAW_S 8 -/* SLC_FRHOST_BIT7_INT_RAW : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT7_INT_RAW (BIT(7)) -#define SLC_FRHOST_BIT7_INT_RAW_M (BIT(7)) -#define SLC_FRHOST_BIT7_INT_RAW_V 0x1 -#define SLC_FRHOST_BIT7_INT_RAW_S 7 -/* SLC_FRHOST_BIT6_INT_RAW : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT6_INT_RAW (BIT(6)) -#define SLC_FRHOST_BIT6_INT_RAW_M (BIT(6)) -#define SLC_FRHOST_BIT6_INT_RAW_V 0x1 -#define SLC_FRHOST_BIT6_INT_RAW_S 6 -/* SLC_FRHOST_BIT5_INT_RAW : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT5_INT_RAW (BIT(5)) -#define SLC_FRHOST_BIT5_INT_RAW_M (BIT(5)) -#define SLC_FRHOST_BIT5_INT_RAW_V 0x1 -#define SLC_FRHOST_BIT5_INT_RAW_S 5 -/* SLC_FRHOST_BIT4_INT_RAW : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT4_INT_RAW (BIT(4)) -#define SLC_FRHOST_BIT4_INT_RAW_M (BIT(4)) -#define SLC_FRHOST_BIT4_INT_RAW_V 0x1 -#define SLC_FRHOST_BIT4_INT_RAW_S 4 -/* SLC_FRHOST_BIT3_INT_RAW : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT3_INT_RAW (BIT(3)) -#define SLC_FRHOST_BIT3_INT_RAW_M (BIT(3)) -#define SLC_FRHOST_BIT3_INT_RAW_V 0x1 -#define SLC_FRHOST_BIT3_INT_RAW_S 3 -/* SLC_FRHOST_BIT2_INT_RAW : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT2_INT_RAW (BIT(2)) -#define SLC_FRHOST_BIT2_INT_RAW_M (BIT(2)) -#define SLC_FRHOST_BIT2_INT_RAW_V 0x1 -#define SLC_FRHOST_BIT2_INT_RAW_S 2 -/* SLC_FRHOST_BIT1_INT_RAW : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT1_INT_RAW (BIT(1)) -#define SLC_FRHOST_BIT1_INT_RAW_M (BIT(1)) -#define SLC_FRHOST_BIT1_INT_RAW_V 0x1 -#define SLC_FRHOST_BIT1_INT_RAW_S 1 -/* SLC_FRHOST_BIT0_INT_RAW : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT0_INT_RAW (BIT(0)) -#define SLC_FRHOST_BIT0_INT_RAW_M (BIT(0)) -#define SLC_FRHOST_BIT0_INT_RAW_V 0x1 -#define SLC_FRHOST_BIT0_INT_RAW_S 0 - -#define SLC_0INT_ST_REG (DR_REG_SLC_BASE + 0x8) -/* SLC_SLC0_RX_QUICK_EOF_INT_ST : RO ;bitpos:[26] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_QUICK_EOF_INT_ST (BIT(26)) -#define SLC_SLC0_RX_QUICK_EOF_INT_ST_M (BIT(26)) -#define SLC_SLC0_RX_QUICK_EOF_INT_ST_V 0x1 -#define SLC_SLC0_RX_QUICK_EOF_INT_ST_S 26 -/* SLC_CMD_DTC_INT_ST : RO ;bitpos:[25] ;default: 1'b0 ; */ -/*description: */ -#define SLC_CMD_DTC_INT_ST (BIT(25)) -#define SLC_CMD_DTC_INT_ST_M (BIT(25)) -#define SLC_CMD_DTC_INT_ST_V 0x1 -#define SLC_CMD_DTC_INT_ST_S 25 -/* SLC_SLC0_TX_ERR_EOF_INT_ST : RO ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_ERR_EOF_INT_ST (BIT(24)) -#define SLC_SLC0_TX_ERR_EOF_INT_ST_M (BIT(24)) -#define SLC_SLC0_TX_ERR_EOF_INT_ST_V 0x1 -#define SLC_SLC0_TX_ERR_EOF_INT_ST_S 24 -/* SLC_SLC0_WR_RETRY_DONE_INT_ST : RO ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_WR_RETRY_DONE_INT_ST (BIT(23)) -#define SLC_SLC0_WR_RETRY_DONE_INT_ST_M (BIT(23)) -#define SLC_SLC0_WR_RETRY_DONE_INT_ST_V 0x1 -#define SLC_SLC0_WR_RETRY_DONE_INT_ST_S 23 -/* SLC_SLC0_HOST_RD_ACK_INT_ST : RO ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_HOST_RD_ACK_INT_ST (BIT(22)) -#define SLC_SLC0_HOST_RD_ACK_INT_ST_M (BIT(22)) -#define SLC_SLC0_HOST_RD_ACK_INT_ST_V 0x1 -#define SLC_SLC0_HOST_RD_ACK_INT_ST_S 22 -/* SLC_SLC0_TX_DSCR_EMPTY_INT_ST : RO ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_DSCR_EMPTY_INT_ST (BIT(21)) -#define SLC_SLC0_TX_DSCR_EMPTY_INT_ST_M (BIT(21)) -#define SLC_SLC0_TX_DSCR_EMPTY_INT_ST_V 0x1 -#define SLC_SLC0_TX_DSCR_EMPTY_INT_ST_S 21 -/* SLC_SLC0_RX_DSCR_ERR_INT_ST : RO ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_DSCR_ERR_INT_ST (BIT(20)) -#define SLC_SLC0_RX_DSCR_ERR_INT_ST_M (BIT(20)) -#define SLC_SLC0_RX_DSCR_ERR_INT_ST_V 0x1 -#define SLC_SLC0_RX_DSCR_ERR_INT_ST_S 20 -/* SLC_SLC0_TX_DSCR_ERR_INT_ST : RO ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_DSCR_ERR_INT_ST (BIT(19)) -#define SLC_SLC0_TX_DSCR_ERR_INT_ST_M (BIT(19)) -#define SLC_SLC0_TX_DSCR_ERR_INT_ST_V 0x1 -#define SLC_SLC0_TX_DSCR_ERR_INT_ST_S 19 -/* SLC_SLC0_TOHOST_INT_ST : RO ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TOHOST_INT_ST (BIT(18)) -#define SLC_SLC0_TOHOST_INT_ST_M (BIT(18)) -#define SLC_SLC0_TOHOST_INT_ST_V 0x1 -#define SLC_SLC0_TOHOST_INT_ST_S 18 -/* SLC_SLC0_RX_EOF_INT_ST : RO ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_EOF_INT_ST (BIT(17)) -#define SLC_SLC0_RX_EOF_INT_ST_M (BIT(17)) -#define SLC_SLC0_RX_EOF_INT_ST_V 0x1 -#define SLC_SLC0_RX_EOF_INT_ST_S 17 -/* SLC_SLC0_RX_DONE_INT_ST : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_DONE_INT_ST (BIT(16)) -#define SLC_SLC0_RX_DONE_INT_ST_M (BIT(16)) -#define SLC_SLC0_RX_DONE_INT_ST_V 0x1 -#define SLC_SLC0_RX_DONE_INT_ST_S 16 -/* SLC_SLC0_TX_SUC_EOF_INT_ST : RO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_SUC_EOF_INT_ST (BIT(15)) -#define SLC_SLC0_TX_SUC_EOF_INT_ST_M (BIT(15)) -#define SLC_SLC0_TX_SUC_EOF_INT_ST_V 0x1 -#define SLC_SLC0_TX_SUC_EOF_INT_ST_S 15 -/* SLC_SLC0_TX_DONE_INT_ST : RO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_DONE_INT_ST (BIT(14)) -#define SLC_SLC0_TX_DONE_INT_ST_M (BIT(14)) -#define SLC_SLC0_TX_DONE_INT_ST_V 0x1 -#define SLC_SLC0_TX_DONE_INT_ST_S 14 -/* SLC_SLC0_TOKEN1_1TO0_INT_ST : RO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TOKEN1_1TO0_INT_ST (BIT(13)) -#define SLC_SLC0_TOKEN1_1TO0_INT_ST_M (BIT(13)) -#define SLC_SLC0_TOKEN1_1TO0_INT_ST_V 0x1 -#define SLC_SLC0_TOKEN1_1TO0_INT_ST_S 13 -/* SLC_SLC0_TOKEN0_1TO0_INT_ST : RO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TOKEN0_1TO0_INT_ST (BIT(12)) -#define SLC_SLC0_TOKEN0_1TO0_INT_ST_M (BIT(12)) -#define SLC_SLC0_TOKEN0_1TO0_INT_ST_V 0x1 -#define SLC_SLC0_TOKEN0_1TO0_INT_ST_S 12 -/* SLC_SLC0_TX_OVF_INT_ST : RO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_OVF_INT_ST (BIT(11)) -#define SLC_SLC0_TX_OVF_INT_ST_M (BIT(11)) -#define SLC_SLC0_TX_OVF_INT_ST_V 0x1 -#define SLC_SLC0_TX_OVF_INT_ST_S 11 -/* SLC_SLC0_RX_UDF_INT_ST : RO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_UDF_INT_ST (BIT(10)) -#define SLC_SLC0_RX_UDF_INT_ST_M (BIT(10)) -#define SLC_SLC0_RX_UDF_INT_ST_V 0x1 -#define SLC_SLC0_RX_UDF_INT_ST_S 10 -/* SLC_SLC0_TX_START_INT_ST : RO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_START_INT_ST (BIT(9)) -#define SLC_SLC0_TX_START_INT_ST_M (BIT(9)) -#define SLC_SLC0_TX_START_INT_ST_V 0x1 -#define SLC_SLC0_TX_START_INT_ST_S 9 -/* SLC_SLC0_RX_START_INT_ST : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_START_INT_ST (BIT(8)) -#define SLC_SLC0_RX_START_INT_ST_M (BIT(8)) -#define SLC_SLC0_RX_START_INT_ST_V 0x1 -#define SLC_SLC0_RX_START_INT_ST_S 8 -/* SLC_FRHOST_BIT7_INT_ST : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT7_INT_ST (BIT(7)) -#define SLC_FRHOST_BIT7_INT_ST_M (BIT(7)) -#define SLC_FRHOST_BIT7_INT_ST_V 0x1 -#define SLC_FRHOST_BIT7_INT_ST_S 7 -/* SLC_FRHOST_BIT6_INT_ST : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT6_INT_ST (BIT(6)) -#define SLC_FRHOST_BIT6_INT_ST_M (BIT(6)) -#define SLC_FRHOST_BIT6_INT_ST_V 0x1 -#define SLC_FRHOST_BIT6_INT_ST_S 6 -/* SLC_FRHOST_BIT5_INT_ST : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT5_INT_ST (BIT(5)) -#define SLC_FRHOST_BIT5_INT_ST_M (BIT(5)) -#define SLC_FRHOST_BIT5_INT_ST_V 0x1 -#define SLC_FRHOST_BIT5_INT_ST_S 5 -/* SLC_FRHOST_BIT4_INT_ST : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT4_INT_ST (BIT(4)) -#define SLC_FRHOST_BIT4_INT_ST_M (BIT(4)) -#define SLC_FRHOST_BIT4_INT_ST_V 0x1 -#define SLC_FRHOST_BIT4_INT_ST_S 4 -/* SLC_FRHOST_BIT3_INT_ST : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT3_INT_ST (BIT(3)) -#define SLC_FRHOST_BIT3_INT_ST_M (BIT(3)) -#define SLC_FRHOST_BIT3_INT_ST_V 0x1 -#define SLC_FRHOST_BIT3_INT_ST_S 3 -/* SLC_FRHOST_BIT2_INT_ST : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT2_INT_ST (BIT(2)) -#define SLC_FRHOST_BIT2_INT_ST_M (BIT(2)) -#define SLC_FRHOST_BIT2_INT_ST_V 0x1 -#define SLC_FRHOST_BIT2_INT_ST_S 2 -/* SLC_FRHOST_BIT1_INT_ST : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT1_INT_ST (BIT(1)) -#define SLC_FRHOST_BIT1_INT_ST_M (BIT(1)) -#define SLC_FRHOST_BIT1_INT_ST_V 0x1 -#define SLC_FRHOST_BIT1_INT_ST_S 1 -/* SLC_FRHOST_BIT0_INT_ST : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT0_INT_ST (BIT(0)) -#define SLC_FRHOST_BIT0_INT_ST_M (BIT(0)) -#define SLC_FRHOST_BIT0_INT_ST_V 0x1 -#define SLC_FRHOST_BIT0_INT_ST_S 0 - -#define SLC_0INT_ENA_REG (DR_REG_SLC_BASE + 0xC) -/* SLC_SLC0_RX_QUICK_EOF_INT_ENA : R/W ;bitpos:[26] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_QUICK_EOF_INT_ENA (BIT(26)) -#define SLC_SLC0_RX_QUICK_EOF_INT_ENA_M (BIT(26)) -#define SLC_SLC0_RX_QUICK_EOF_INT_ENA_V 0x1 -#define SLC_SLC0_RX_QUICK_EOF_INT_ENA_S 26 -/* SLC_CMD_DTC_INT_ENA : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: */ -#define SLC_CMD_DTC_INT_ENA (BIT(25)) -#define SLC_CMD_DTC_INT_ENA_M (BIT(25)) -#define SLC_CMD_DTC_INT_ENA_V 0x1 -#define SLC_CMD_DTC_INT_ENA_S 25 -/* SLC_SLC0_TX_ERR_EOF_INT_ENA : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_ERR_EOF_INT_ENA (BIT(24)) -#define SLC_SLC0_TX_ERR_EOF_INT_ENA_M (BIT(24)) -#define SLC_SLC0_TX_ERR_EOF_INT_ENA_V 0x1 -#define SLC_SLC0_TX_ERR_EOF_INT_ENA_S 24 -/* SLC_SLC0_WR_RETRY_DONE_INT_ENA : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_WR_RETRY_DONE_INT_ENA (BIT(23)) -#define SLC_SLC0_WR_RETRY_DONE_INT_ENA_M (BIT(23)) -#define SLC_SLC0_WR_RETRY_DONE_INT_ENA_V 0x1 -#define SLC_SLC0_WR_RETRY_DONE_INT_ENA_S 23 -/* SLC_SLC0_HOST_RD_ACK_INT_ENA : R/W ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_HOST_RD_ACK_INT_ENA (BIT(22)) -#define SLC_SLC0_HOST_RD_ACK_INT_ENA_M (BIT(22)) -#define SLC_SLC0_HOST_RD_ACK_INT_ENA_V 0x1 -#define SLC_SLC0_HOST_RD_ACK_INT_ENA_S 22 -/* SLC_SLC0_TX_DSCR_EMPTY_INT_ENA : R/W ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_DSCR_EMPTY_INT_ENA (BIT(21)) -#define SLC_SLC0_TX_DSCR_EMPTY_INT_ENA_M (BIT(21)) -#define SLC_SLC0_TX_DSCR_EMPTY_INT_ENA_V 0x1 -#define SLC_SLC0_TX_DSCR_EMPTY_INT_ENA_S 21 -/* SLC_SLC0_RX_DSCR_ERR_INT_ENA : R/W ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_DSCR_ERR_INT_ENA (BIT(20)) -#define SLC_SLC0_RX_DSCR_ERR_INT_ENA_M (BIT(20)) -#define SLC_SLC0_RX_DSCR_ERR_INT_ENA_V 0x1 -#define SLC_SLC0_RX_DSCR_ERR_INT_ENA_S 20 -/* SLC_SLC0_TX_DSCR_ERR_INT_ENA : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_DSCR_ERR_INT_ENA (BIT(19)) -#define SLC_SLC0_TX_DSCR_ERR_INT_ENA_M (BIT(19)) -#define SLC_SLC0_TX_DSCR_ERR_INT_ENA_V 0x1 -#define SLC_SLC0_TX_DSCR_ERR_INT_ENA_S 19 -/* SLC_SLC0_TOHOST_INT_ENA : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TOHOST_INT_ENA (BIT(18)) -#define SLC_SLC0_TOHOST_INT_ENA_M (BIT(18)) -#define SLC_SLC0_TOHOST_INT_ENA_V 0x1 -#define SLC_SLC0_TOHOST_INT_ENA_S 18 -/* SLC_SLC0_RX_EOF_INT_ENA : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_EOF_INT_ENA (BIT(17)) -#define SLC_SLC0_RX_EOF_INT_ENA_M (BIT(17)) -#define SLC_SLC0_RX_EOF_INT_ENA_V 0x1 -#define SLC_SLC0_RX_EOF_INT_ENA_S 17 -/* SLC_SLC0_RX_DONE_INT_ENA : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_DONE_INT_ENA (BIT(16)) -#define SLC_SLC0_RX_DONE_INT_ENA_M (BIT(16)) -#define SLC_SLC0_RX_DONE_INT_ENA_V 0x1 -#define SLC_SLC0_RX_DONE_INT_ENA_S 16 -/* SLC_SLC0_TX_SUC_EOF_INT_ENA : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_SUC_EOF_INT_ENA (BIT(15)) -#define SLC_SLC0_TX_SUC_EOF_INT_ENA_M (BIT(15)) -#define SLC_SLC0_TX_SUC_EOF_INT_ENA_V 0x1 -#define SLC_SLC0_TX_SUC_EOF_INT_ENA_S 15 -/* SLC_SLC0_TX_DONE_INT_ENA : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_DONE_INT_ENA (BIT(14)) -#define SLC_SLC0_TX_DONE_INT_ENA_M (BIT(14)) -#define SLC_SLC0_TX_DONE_INT_ENA_V 0x1 -#define SLC_SLC0_TX_DONE_INT_ENA_S 14 -/* SLC_SLC0_TOKEN1_1TO0_INT_ENA : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TOKEN1_1TO0_INT_ENA (BIT(13)) -#define SLC_SLC0_TOKEN1_1TO0_INT_ENA_M (BIT(13)) -#define SLC_SLC0_TOKEN1_1TO0_INT_ENA_V 0x1 -#define SLC_SLC0_TOKEN1_1TO0_INT_ENA_S 13 -/* SLC_SLC0_TOKEN0_1TO0_INT_ENA : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TOKEN0_1TO0_INT_ENA (BIT(12)) -#define SLC_SLC0_TOKEN0_1TO0_INT_ENA_M (BIT(12)) -#define SLC_SLC0_TOKEN0_1TO0_INT_ENA_V 0x1 -#define SLC_SLC0_TOKEN0_1TO0_INT_ENA_S 12 -/* SLC_SLC0_TX_OVF_INT_ENA : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_OVF_INT_ENA (BIT(11)) -#define SLC_SLC0_TX_OVF_INT_ENA_M (BIT(11)) -#define SLC_SLC0_TX_OVF_INT_ENA_V 0x1 -#define SLC_SLC0_TX_OVF_INT_ENA_S 11 -/* SLC_SLC0_RX_UDF_INT_ENA : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_UDF_INT_ENA (BIT(10)) -#define SLC_SLC0_RX_UDF_INT_ENA_M (BIT(10)) -#define SLC_SLC0_RX_UDF_INT_ENA_V 0x1 -#define SLC_SLC0_RX_UDF_INT_ENA_S 10 -/* SLC_SLC0_TX_START_INT_ENA : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_START_INT_ENA (BIT(9)) -#define SLC_SLC0_TX_START_INT_ENA_M (BIT(9)) -#define SLC_SLC0_TX_START_INT_ENA_V 0x1 -#define SLC_SLC0_TX_START_INT_ENA_S 9 -/* SLC_SLC0_RX_START_INT_ENA : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_START_INT_ENA (BIT(8)) -#define SLC_SLC0_RX_START_INT_ENA_M (BIT(8)) -#define SLC_SLC0_RX_START_INT_ENA_V 0x1 -#define SLC_SLC0_RX_START_INT_ENA_S 8 -/* SLC_FRHOST_BIT7_INT_ENA : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT7_INT_ENA (BIT(7)) -#define SLC_FRHOST_BIT7_INT_ENA_M (BIT(7)) -#define SLC_FRHOST_BIT7_INT_ENA_V 0x1 -#define SLC_FRHOST_BIT7_INT_ENA_S 7 -/* SLC_FRHOST_BIT6_INT_ENA : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT6_INT_ENA (BIT(6)) -#define SLC_FRHOST_BIT6_INT_ENA_M (BIT(6)) -#define SLC_FRHOST_BIT6_INT_ENA_V 0x1 -#define SLC_FRHOST_BIT6_INT_ENA_S 6 -/* SLC_FRHOST_BIT5_INT_ENA : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT5_INT_ENA (BIT(5)) -#define SLC_FRHOST_BIT5_INT_ENA_M (BIT(5)) -#define SLC_FRHOST_BIT5_INT_ENA_V 0x1 -#define SLC_FRHOST_BIT5_INT_ENA_S 5 -/* SLC_FRHOST_BIT4_INT_ENA : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT4_INT_ENA (BIT(4)) -#define SLC_FRHOST_BIT4_INT_ENA_M (BIT(4)) -#define SLC_FRHOST_BIT4_INT_ENA_V 0x1 -#define SLC_FRHOST_BIT4_INT_ENA_S 4 -/* SLC_FRHOST_BIT3_INT_ENA : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT3_INT_ENA (BIT(3)) -#define SLC_FRHOST_BIT3_INT_ENA_M (BIT(3)) -#define SLC_FRHOST_BIT3_INT_ENA_V 0x1 -#define SLC_FRHOST_BIT3_INT_ENA_S 3 -/* SLC_FRHOST_BIT2_INT_ENA : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT2_INT_ENA (BIT(2)) -#define SLC_FRHOST_BIT2_INT_ENA_M (BIT(2)) -#define SLC_FRHOST_BIT2_INT_ENA_V 0x1 -#define SLC_FRHOST_BIT2_INT_ENA_S 2 -/* SLC_FRHOST_BIT1_INT_ENA : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT1_INT_ENA (BIT(1)) -#define SLC_FRHOST_BIT1_INT_ENA_M (BIT(1)) -#define SLC_FRHOST_BIT1_INT_ENA_V 0x1 -#define SLC_FRHOST_BIT1_INT_ENA_S 1 -/* SLC_FRHOST_BIT0_INT_ENA : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT0_INT_ENA (BIT(0)) -#define SLC_FRHOST_BIT0_INT_ENA_M (BIT(0)) -#define SLC_FRHOST_BIT0_INT_ENA_V 0x1 -#define SLC_FRHOST_BIT0_INT_ENA_S 0 - -#define SLC_0INT_CLR_REG (DR_REG_SLC_BASE + 0x10) -/* SLC_SLC0_RX_QUICK_EOF_INT_CLR : WO ;bitpos:[26] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_QUICK_EOF_INT_CLR (BIT(26)) -#define SLC_SLC0_RX_QUICK_EOF_INT_CLR_M (BIT(26)) -#define SLC_SLC0_RX_QUICK_EOF_INT_CLR_V 0x1 -#define SLC_SLC0_RX_QUICK_EOF_INT_CLR_S 26 -/* SLC_CMD_DTC_INT_CLR : WO ;bitpos:[25] ;default: 1'b0 ; */ -/*description: */ -#define SLC_CMD_DTC_INT_CLR (BIT(25)) -#define SLC_CMD_DTC_INT_CLR_M (BIT(25)) -#define SLC_CMD_DTC_INT_CLR_V 0x1 -#define SLC_CMD_DTC_INT_CLR_S 25 -/* SLC_SLC0_TX_ERR_EOF_INT_CLR : WO ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_ERR_EOF_INT_CLR (BIT(24)) -#define SLC_SLC0_TX_ERR_EOF_INT_CLR_M (BIT(24)) -#define SLC_SLC0_TX_ERR_EOF_INT_CLR_V 0x1 -#define SLC_SLC0_TX_ERR_EOF_INT_CLR_S 24 -/* SLC_SLC0_WR_RETRY_DONE_INT_CLR : WO ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_WR_RETRY_DONE_INT_CLR (BIT(23)) -#define SLC_SLC0_WR_RETRY_DONE_INT_CLR_M (BIT(23)) -#define SLC_SLC0_WR_RETRY_DONE_INT_CLR_V 0x1 -#define SLC_SLC0_WR_RETRY_DONE_INT_CLR_S 23 -/* SLC_SLC0_HOST_RD_ACK_INT_CLR : WO ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_HOST_RD_ACK_INT_CLR (BIT(22)) -#define SLC_SLC0_HOST_RD_ACK_INT_CLR_M (BIT(22)) -#define SLC_SLC0_HOST_RD_ACK_INT_CLR_V 0x1 -#define SLC_SLC0_HOST_RD_ACK_INT_CLR_S 22 -/* SLC_SLC0_TX_DSCR_EMPTY_INT_CLR : WO ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_DSCR_EMPTY_INT_CLR (BIT(21)) -#define SLC_SLC0_TX_DSCR_EMPTY_INT_CLR_M (BIT(21)) -#define SLC_SLC0_TX_DSCR_EMPTY_INT_CLR_V 0x1 -#define SLC_SLC0_TX_DSCR_EMPTY_INT_CLR_S 21 -/* SLC_SLC0_RX_DSCR_ERR_INT_CLR : WO ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_DSCR_ERR_INT_CLR (BIT(20)) -#define SLC_SLC0_RX_DSCR_ERR_INT_CLR_M (BIT(20)) -#define SLC_SLC0_RX_DSCR_ERR_INT_CLR_V 0x1 -#define SLC_SLC0_RX_DSCR_ERR_INT_CLR_S 20 -/* SLC_SLC0_TX_DSCR_ERR_INT_CLR : WO ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_DSCR_ERR_INT_CLR (BIT(19)) -#define SLC_SLC0_TX_DSCR_ERR_INT_CLR_M (BIT(19)) -#define SLC_SLC0_TX_DSCR_ERR_INT_CLR_V 0x1 -#define SLC_SLC0_TX_DSCR_ERR_INT_CLR_S 19 -/* SLC_SLC0_TOHOST_INT_CLR : WO ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TOHOST_INT_CLR (BIT(18)) -#define SLC_SLC0_TOHOST_INT_CLR_M (BIT(18)) -#define SLC_SLC0_TOHOST_INT_CLR_V 0x1 -#define SLC_SLC0_TOHOST_INT_CLR_S 18 -/* SLC_SLC0_RX_EOF_INT_CLR : WO ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_EOF_INT_CLR (BIT(17)) -#define SLC_SLC0_RX_EOF_INT_CLR_M (BIT(17)) -#define SLC_SLC0_RX_EOF_INT_CLR_V 0x1 -#define SLC_SLC0_RX_EOF_INT_CLR_S 17 -/* SLC_SLC0_RX_DONE_INT_CLR : WO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_DONE_INT_CLR (BIT(16)) -#define SLC_SLC0_RX_DONE_INT_CLR_M (BIT(16)) -#define SLC_SLC0_RX_DONE_INT_CLR_V 0x1 -#define SLC_SLC0_RX_DONE_INT_CLR_S 16 -/* SLC_SLC0_TX_SUC_EOF_INT_CLR : WO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_SUC_EOF_INT_CLR (BIT(15)) -#define SLC_SLC0_TX_SUC_EOF_INT_CLR_M (BIT(15)) -#define SLC_SLC0_TX_SUC_EOF_INT_CLR_V 0x1 -#define SLC_SLC0_TX_SUC_EOF_INT_CLR_S 15 -/* SLC_SLC0_TX_DONE_INT_CLR : WO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_DONE_INT_CLR (BIT(14)) -#define SLC_SLC0_TX_DONE_INT_CLR_M (BIT(14)) -#define SLC_SLC0_TX_DONE_INT_CLR_V 0x1 -#define SLC_SLC0_TX_DONE_INT_CLR_S 14 -/* SLC_SLC0_TOKEN1_1TO0_INT_CLR : WO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TOKEN1_1TO0_INT_CLR (BIT(13)) -#define SLC_SLC0_TOKEN1_1TO0_INT_CLR_M (BIT(13)) -#define SLC_SLC0_TOKEN1_1TO0_INT_CLR_V 0x1 -#define SLC_SLC0_TOKEN1_1TO0_INT_CLR_S 13 -/* SLC_SLC0_TOKEN0_1TO0_INT_CLR : WO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TOKEN0_1TO0_INT_CLR (BIT(12)) -#define SLC_SLC0_TOKEN0_1TO0_INT_CLR_M (BIT(12)) -#define SLC_SLC0_TOKEN0_1TO0_INT_CLR_V 0x1 -#define SLC_SLC0_TOKEN0_1TO0_INT_CLR_S 12 -/* SLC_SLC0_TX_OVF_INT_CLR : WO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_OVF_INT_CLR (BIT(11)) -#define SLC_SLC0_TX_OVF_INT_CLR_M (BIT(11)) -#define SLC_SLC0_TX_OVF_INT_CLR_V 0x1 -#define SLC_SLC0_TX_OVF_INT_CLR_S 11 -/* SLC_SLC0_RX_UDF_INT_CLR : WO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_UDF_INT_CLR (BIT(10)) -#define SLC_SLC0_RX_UDF_INT_CLR_M (BIT(10)) -#define SLC_SLC0_RX_UDF_INT_CLR_V 0x1 -#define SLC_SLC0_RX_UDF_INT_CLR_S 10 -/* SLC_SLC0_TX_START_INT_CLR : WO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_START_INT_CLR (BIT(9)) -#define SLC_SLC0_TX_START_INT_CLR_M (BIT(9)) -#define SLC_SLC0_TX_START_INT_CLR_V 0x1 -#define SLC_SLC0_TX_START_INT_CLR_S 9 -/* SLC_SLC0_RX_START_INT_CLR : WO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_START_INT_CLR (BIT(8)) -#define SLC_SLC0_RX_START_INT_CLR_M (BIT(8)) -#define SLC_SLC0_RX_START_INT_CLR_V 0x1 -#define SLC_SLC0_RX_START_INT_CLR_S 8 -/* SLC_FRHOST_BIT7_INT_CLR : WO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT7_INT_CLR (BIT(7)) -#define SLC_FRHOST_BIT7_INT_CLR_M (BIT(7)) -#define SLC_FRHOST_BIT7_INT_CLR_V 0x1 -#define SLC_FRHOST_BIT7_INT_CLR_S 7 -/* SLC_FRHOST_BIT6_INT_CLR : WO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT6_INT_CLR (BIT(6)) -#define SLC_FRHOST_BIT6_INT_CLR_M (BIT(6)) -#define SLC_FRHOST_BIT6_INT_CLR_V 0x1 -#define SLC_FRHOST_BIT6_INT_CLR_S 6 -/* SLC_FRHOST_BIT5_INT_CLR : WO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT5_INT_CLR (BIT(5)) -#define SLC_FRHOST_BIT5_INT_CLR_M (BIT(5)) -#define SLC_FRHOST_BIT5_INT_CLR_V 0x1 -#define SLC_FRHOST_BIT5_INT_CLR_S 5 -/* SLC_FRHOST_BIT4_INT_CLR : WO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT4_INT_CLR (BIT(4)) -#define SLC_FRHOST_BIT4_INT_CLR_M (BIT(4)) -#define SLC_FRHOST_BIT4_INT_CLR_V 0x1 -#define SLC_FRHOST_BIT4_INT_CLR_S 4 -/* SLC_FRHOST_BIT3_INT_CLR : WO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT3_INT_CLR (BIT(3)) -#define SLC_FRHOST_BIT3_INT_CLR_M (BIT(3)) -#define SLC_FRHOST_BIT3_INT_CLR_V 0x1 -#define SLC_FRHOST_BIT3_INT_CLR_S 3 -/* SLC_FRHOST_BIT2_INT_CLR : WO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT2_INT_CLR (BIT(2)) -#define SLC_FRHOST_BIT2_INT_CLR_M (BIT(2)) -#define SLC_FRHOST_BIT2_INT_CLR_V 0x1 -#define SLC_FRHOST_BIT2_INT_CLR_S 2 -/* SLC_FRHOST_BIT1_INT_CLR : WO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT1_INT_CLR (BIT(1)) -#define SLC_FRHOST_BIT1_INT_CLR_M (BIT(1)) -#define SLC_FRHOST_BIT1_INT_CLR_V 0x1 -#define SLC_FRHOST_BIT1_INT_CLR_S 1 -/* SLC_FRHOST_BIT0_INT_CLR : WO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT0_INT_CLR (BIT(0)) -#define SLC_FRHOST_BIT0_INT_CLR_M (BIT(0)) -#define SLC_FRHOST_BIT0_INT_CLR_V 0x1 -#define SLC_FRHOST_BIT0_INT_CLR_S 0 - -#define SLC_1INT_RAW_REG (DR_REG_SLC_BASE + 0x14) -/* SLC_SLC1_TX_ERR_EOF_INT_RAW : RO ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_ERR_EOF_INT_RAW (BIT(24)) -#define SLC_SLC1_TX_ERR_EOF_INT_RAW_M (BIT(24)) -#define SLC_SLC1_TX_ERR_EOF_INT_RAW_V 0x1 -#define SLC_SLC1_TX_ERR_EOF_INT_RAW_S 24 -/* SLC_SLC1_WR_RETRY_DONE_INT_RAW : RO ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_WR_RETRY_DONE_INT_RAW (BIT(23)) -#define SLC_SLC1_WR_RETRY_DONE_INT_RAW_M (BIT(23)) -#define SLC_SLC1_WR_RETRY_DONE_INT_RAW_V 0x1 -#define SLC_SLC1_WR_RETRY_DONE_INT_RAW_S 23 -/* SLC_SLC1_HOST_RD_ACK_INT_RAW : RO ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_HOST_RD_ACK_INT_RAW (BIT(22)) -#define SLC_SLC1_HOST_RD_ACK_INT_RAW_M (BIT(22)) -#define SLC_SLC1_HOST_RD_ACK_INT_RAW_V 0x1 -#define SLC_SLC1_HOST_RD_ACK_INT_RAW_S 22 -/* SLC_SLC1_TX_DSCR_EMPTY_INT_RAW : RO ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_DSCR_EMPTY_INT_RAW (BIT(21)) -#define SLC_SLC1_TX_DSCR_EMPTY_INT_RAW_M (BIT(21)) -#define SLC_SLC1_TX_DSCR_EMPTY_INT_RAW_V 0x1 -#define SLC_SLC1_TX_DSCR_EMPTY_INT_RAW_S 21 -/* SLC_SLC1_RX_DSCR_ERR_INT_RAW : RO ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_DSCR_ERR_INT_RAW (BIT(20)) -#define SLC_SLC1_RX_DSCR_ERR_INT_RAW_M (BIT(20)) -#define SLC_SLC1_RX_DSCR_ERR_INT_RAW_V 0x1 -#define SLC_SLC1_RX_DSCR_ERR_INT_RAW_S 20 -/* SLC_SLC1_TX_DSCR_ERR_INT_RAW : RO ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_DSCR_ERR_INT_RAW (BIT(19)) -#define SLC_SLC1_TX_DSCR_ERR_INT_RAW_M (BIT(19)) -#define SLC_SLC1_TX_DSCR_ERR_INT_RAW_V 0x1 -#define SLC_SLC1_TX_DSCR_ERR_INT_RAW_S 19 -/* SLC_SLC1_TOHOST_INT_RAW : RO ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TOHOST_INT_RAW (BIT(18)) -#define SLC_SLC1_TOHOST_INT_RAW_M (BIT(18)) -#define SLC_SLC1_TOHOST_INT_RAW_V 0x1 -#define SLC_SLC1_TOHOST_INT_RAW_S 18 -/* SLC_SLC1_RX_EOF_INT_RAW : RO ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_EOF_INT_RAW (BIT(17)) -#define SLC_SLC1_RX_EOF_INT_RAW_M (BIT(17)) -#define SLC_SLC1_RX_EOF_INT_RAW_V 0x1 -#define SLC_SLC1_RX_EOF_INT_RAW_S 17 -/* SLC_SLC1_RX_DONE_INT_RAW : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_DONE_INT_RAW (BIT(16)) -#define SLC_SLC1_RX_DONE_INT_RAW_M (BIT(16)) -#define SLC_SLC1_RX_DONE_INT_RAW_V 0x1 -#define SLC_SLC1_RX_DONE_INT_RAW_S 16 -/* SLC_SLC1_TX_SUC_EOF_INT_RAW : RO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_SUC_EOF_INT_RAW (BIT(15)) -#define SLC_SLC1_TX_SUC_EOF_INT_RAW_M (BIT(15)) -#define SLC_SLC1_TX_SUC_EOF_INT_RAW_V 0x1 -#define SLC_SLC1_TX_SUC_EOF_INT_RAW_S 15 -/* SLC_SLC1_TX_DONE_INT_RAW : RO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_DONE_INT_RAW (BIT(14)) -#define SLC_SLC1_TX_DONE_INT_RAW_M (BIT(14)) -#define SLC_SLC1_TX_DONE_INT_RAW_V 0x1 -#define SLC_SLC1_TX_DONE_INT_RAW_S 14 -/* SLC_SLC1_TOKEN1_1TO0_INT_RAW : RO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TOKEN1_1TO0_INT_RAW (BIT(13)) -#define SLC_SLC1_TOKEN1_1TO0_INT_RAW_M (BIT(13)) -#define SLC_SLC1_TOKEN1_1TO0_INT_RAW_V 0x1 -#define SLC_SLC1_TOKEN1_1TO0_INT_RAW_S 13 -/* SLC_SLC1_TOKEN0_1TO0_INT_RAW : RO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TOKEN0_1TO0_INT_RAW (BIT(12)) -#define SLC_SLC1_TOKEN0_1TO0_INT_RAW_M (BIT(12)) -#define SLC_SLC1_TOKEN0_1TO0_INT_RAW_V 0x1 -#define SLC_SLC1_TOKEN0_1TO0_INT_RAW_S 12 -/* SLC_SLC1_TX_OVF_INT_RAW : RO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_OVF_INT_RAW (BIT(11)) -#define SLC_SLC1_TX_OVF_INT_RAW_M (BIT(11)) -#define SLC_SLC1_TX_OVF_INT_RAW_V 0x1 -#define SLC_SLC1_TX_OVF_INT_RAW_S 11 -/* SLC_SLC1_RX_UDF_INT_RAW : RO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_UDF_INT_RAW (BIT(10)) -#define SLC_SLC1_RX_UDF_INT_RAW_M (BIT(10)) -#define SLC_SLC1_RX_UDF_INT_RAW_V 0x1 -#define SLC_SLC1_RX_UDF_INT_RAW_S 10 -/* SLC_SLC1_TX_START_INT_RAW : RO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_START_INT_RAW (BIT(9)) -#define SLC_SLC1_TX_START_INT_RAW_M (BIT(9)) -#define SLC_SLC1_TX_START_INT_RAW_V 0x1 -#define SLC_SLC1_TX_START_INT_RAW_S 9 -/* SLC_SLC1_RX_START_INT_RAW : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_START_INT_RAW (BIT(8)) -#define SLC_SLC1_RX_START_INT_RAW_M (BIT(8)) -#define SLC_SLC1_RX_START_INT_RAW_V 0x1 -#define SLC_SLC1_RX_START_INT_RAW_S 8 -/* SLC_FRHOST_BIT15_INT_RAW : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT15_INT_RAW (BIT(7)) -#define SLC_FRHOST_BIT15_INT_RAW_M (BIT(7)) -#define SLC_FRHOST_BIT15_INT_RAW_V 0x1 -#define SLC_FRHOST_BIT15_INT_RAW_S 7 -/* SLC_FRHOST_BIT14_INT_RAW : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT14_INT_RAW (BIT(6)) -#define SLC_FRHOST_BIT14_INT_RAW_M (BIT(6)) -#define SLC_FRHOST_BIT14_INT_RAW_V 0x1 -#define SLC_FRHOST_BIT14_INT_RAW_S 6 -/* SLC_FRHOST_BIT13_INT_RAW : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT13_INT_RAW (BIT(5)) -#define SLC_FRHOST_BIT13_INT_RAW_M (BIT(5)) -#define SLC_FRHOST_BIT13_INT_RAW_V 0x1 -#define SLC_FRHOST_BIT13_INT_RAW_S 5 -/* SLC_FRHOST_BIT12_INT_RAW : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT12_INT_RAW (BIT(4)) -#define SLC_FRHOST_BIT12_INT_RAW_M (BIT(4)) -#define SLC_FRHOST_BIT12_INT_RAW_V 0x1 -#define SLC_FRHOST_BIT12_INT_RAW_S 4 -/* SLC_FRHOST_BIT11_INT_RAW : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT11_INT_RAW (BIT(3)) -#define SLC_FRHOST_BIT11_INT_RAW_M (BIT(3)) -#define SLC_FRHOST_BIT11_INT_RAW_V 0x1 -#define SLC_FRHOST_BIT11_INT_RAW_S 3 -/* SLC_FRHOST_BIT10_INT_RAW : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT10_INT_RAW (BIT(2)) -#define SLC_FRHOST_BIT10_INT_RAW_M (BIT(2)) -#define SLC_FRHOST_BIT10_INT_RAW_V 0x1 -#define SLC_FRHOST_BIT10_INT_RAW_S 2 -/* SLC_FRHOST_BIT9_INT_RAW : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT9_INT_RAW (BIT(1)) -#define SLC_FRHOST_BIT9_INT_RAW_M (BIT(1)) -#define SLC_FRHOST_BIT9_INT_RAW_V 0x1 -#define SLC_FRHOST_BIT9_INT_RAW_S 1 -/* SLC_FRHOST_BIT8_INT_RAW : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT8_INT_RAW (BIT(0)) -#define SLC_FRHOST_BIT8_INT_RAW_M (BIT(0)) -#define SLC_FRHOST_BIT8_INT_RAW_V 0x1 -#define SLC_FRHOST_BIT8_INT_RAW_S 0 - -#define SLC_1INT_ST_REG (DR_REG_SLC_BASE + 0x18) -/* SLC_SLC1_TX_ERR_EOF_INT_ST : RO ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_ERR_EOF_INT_ST (BIT(24)) -#define SLC_SLC1_TX_ERR_EOF_INT_ST_M (BIT(24)) -#define SLC_SLC1_TX_ERR_EOF_INT_ST_V 0x1 -#define SLC_SLC1_TX_ERR_EOF_INT_ST_S 24 -/* SLC_SLC1_WR_RETRY_DONE_INT_ST : RO ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_WR_RETRY_DONE_INT_ST (BIT(23)) -#define SLC_SLC1_WR_RETRY_DONE_INT_ST_M (BIT(23)) -#define SLC_SLC1_WR_RETRY_DONE_INT_ST_V 0x1 -#define SLC_SLC1_WR_RETRY_DONE_INT_ST_S 23 -/* SLC_SLC1_HOST_RD_ACK_INT_ST : RO ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_HOST_RD_ACK_INT_ST (BIT(22)) -#define SLC_SLC1_HOST_RD_ACK_INT_ST_M (BIT(22)) -#define SLC_SLC1_HOST_RD_ACK_INT_ST_V 0x1 -#define SLC_SLC1_HOST_RD_ACK_INT_ST_S 22 -/* SLC_SLC1_TX_DSCR_EMPTY_INT_ST : RO ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_DSCR_EMPTY_INT_ST (BIT(21)) -#define SLC_SLC1_TX_DSCR_EMPTY_INT_ST_M (BIT(21)) -#define SLC_SLC1_TX_DSCR_EMPTY_INT_ST_V 0x1 -#define SLC_SLC1_TX_DSCR_EMPTY_INT_ST_S 21 -/* SLC_SLC1_RX_DSCR_ERR_INT_ST : RO ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_DSCR_ERR_INT_ST (BIT(20)) -#define SLC_SLC1_RX_DSCR_ERR_INT_ST_M (BIT(20)) -#define SLC_SLC1_RX_DSCR_ERR_INT_ST_V 0x1 -#define SLC_SLC1_RX_DSCR_ERR_INT_ST_S 20 -/* SLC_SLC1_TX_DSCR_ERR_INT_ST : RO ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_DSCR_ERR_INT_ST (BIT(19)) -#define SLC_SLC1_TX_DSCR_ERR_INT_ST_M (BIT(19)) -#define SLC_SLC1_TX_DSCR_ERR_INT_ST_V 0x1 -#define SLC_SLC1_TX_DSCR_ERR_INT_ST_S 19 -/* SLC_SLC1_TOHOST_INT_ST : RO ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TOHOST_INT_ST (BIT(18)) -#define SLC_SLC1_TOHOST_INT_ST_M (BIT(18)) -#define SLC_SLC1_TOHOST_INT_ST_V 0x1 -#define SLC_SLC1_TOHOST_INT_ST_S 18 -/* SLC_SLC1_RX_EOF_INT_ST : RO ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_EOF_INT_ST (BIT(17)) -#define SLC_SLC1_RX_EOF_INT_ST_M (BIT(17)) -#define SLC_SLC1_RX_EOF_INT_ST_V 0x1 -#define SLC_SLC1_RX_EOF_INT_ST_S 17 -/* SLC_SLC1_RX_DONE_INT_ST : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_DONE_INT_ST (BIT(16)) -#define SLC_SLC1_RX_DONE_INT_ST_M (BIT(16)) -#define SLC_SLC1_RX_DONE_INT_ST_V 0x1 -#define SLC_SLC1_RX_DONE_INT_ST_S 16 -/* SLC_SLC1_TX_SUC_EOF_INT_ST : RO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_SUC_EOF_INT_ST (BIT(15)) -#define SLC_SLC1_TX_SUC_EOF_INT_ST_M (BIT(15)) -#define SLC_SLC1_TX_SUC_EOF_INT_ST_V 0x1 -#define SLC_SLC1_TX_SUC_EOF_INT_ST_S 15 -/* SLC_SLC1_TX_DONE_INT_ST : RO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_DONE_INT_ST (BIT(14)) -#define SLC_SLC1_TX_DONE_INT_ST_M (BIT(14)) -#define SLC_SLC1_TX_DONE_INT_ST_V 0x1 -#define SLC_SLC1_TX_DONE_INT_ST_S 14 -/* SLC_SLC1_TOKEN1_1TO0_INT_ST : RO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TOKEN1_1TO0_INT_ST (BIT(13)) -#define SLC_SLC1_TOKEN1_1TO0_INT_ST_M (BIT(13)) -#define SLC_SLC1_TOKEN1_1TO0_INT_ST_V 0x1 -#define SLC_SLC1_TOKEN1_1TO0_INT_ST_S 13 -/* SLC_SLC1_TOKEN0_1TO0_INT_ST : RO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TOKEN0_1TO0_INT_ST (BIT(12)) -#define SLC_SLC1_TOKEN0_1TO0_INT_ST_M (BIT(12)) -#define SLC_SLC1_TOKEN0_1TO0_INT_ST_V 0x1 -#define SLC_SLC1_TOKEN0_1TO0_INT_ST_S 12 -/* SLC_SLC1_TX_OVF_INT_ST : RO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_OVF_INT_ST (BIT(11)) -#define SLC_SLC1_TX_OVF_INT_ST_M (BIT(11)) -#define SLC_SLC1_TX_OVF_INT_ST_V 0x1 -#define SLC_SLC1_TX_OVF_INT_ST_S 11 -/* SLC_SLC1_RX_UDF_INT_ST : RO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_UDF_INT_ST (BIT(10)) -#define SLC_SLC1_RX_UDF_INT_ST_M (BIT(10)) -#define SLC_SLC1_RX_UDF_INT_ST_V 0x1 -#define SLC_SLC1_RX_UDF_INT_ST_S 10 -/* SLC_SLC1_TX_START_INT_ST : RO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_START_INT_ST (BIT(9)) -#define SLC_SLC1_TX_START_INT_ST_M (BIT(9)) -#define SLC_SLC1_TX_START_INT_ST_V 0x1 -#define SLC_SLC1_TX_START_INT_ST_S 9 -/* SLC_SLC1_RX_START_INT_ST : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_START_INT_ST (BIT(8)) -#define SLC_SLC1_RX_START_INT_ST_M (BIT(8)) -#define SLC_SLC1_RX_START_INT_ST_V 0x1 -#define SLC_SLC1_RX_START_INT_ST_S 8 -/* SLC_FRHOST_BIT15_INT_ST : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT15_INT_ST (BIT(7)) -#define SLC_FRHOST_BIT15_INT_ST_M (BIT(7)) -#define SLC_FRHOST_BIT15_INT_ST_V 0x1 -#define SLC_FRHOST_BIT15_INT_ST_S 7 -/* SLC_FRHOST_BIT14_INT_ST : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT14_INT_ST (BIT(6)) -#define SLC_FRHOST_BIT14_INT_ST_M (BIT(6)) -#define SLC_FRHOST_BIT14_INT_ST_V 0x1 -#define SLC_FRHOST_BIT14_INT_ST_S 6 -/* SLC_FRHOST_BIT13_INT_ST : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT13_INT_ST (BIT(5)) -#define SLC_FRHOST_BIT13_INT_ST_M (BIT(5)) -#define SLC_FRHOST_BIT13_INT_ST_V 0x1 -#define SLC_FRHOST_BIT13_INT_ST_S 5 -/* SLC_FRHOST_BIT12_INT_ST : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT12_INT_ST (BIT(4)) -#define SLC_FRHOST_BIT12_INT_ST_M (BIT(4)) -#define SLC_FRHOST_BIT12_INT_ST_V 0x1 -#define SLC_FRHOST_BIT12_INT_ST_S 4 -/* SLC_FRHOST_BIT11_INT_ST : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT11_INT_ST (BIT(3)) -#define SLC_FRHOST_BIT11_INT_ST_M (BIT(3)) -#define SLC_FRHOST_BIT11_INT_ST_V 0x1 -#define SLC_FRHOST_BIT11_INT_ST_S 3 -/* SLC_FRHOST_BIT10_INT_ST : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT10_INT_ST (BIT(2)) -#define SLC_FRHOST_BIT10_INT_ST_M (BIT(2)) -#define SLC_FRHOST_BIT10_INT_ST_V 0x1 -#define SLC_FRHOST_BIT10_INT_ST_S 2 -/* SLC_FRHOST_BIT9_INT_ST : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT9_INT_ST (BIT(1)) -#define SLC_FRHOST_BIT9_INT_ST_M (BIT(1)) -#define SLC_FRHOST_BIT9_INT_ST_V 0x1 -#define SLC_FRHOST_BIT9_INT_ST_S 1 -/* SLC_FRHOST_BIT8_INT_ST : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT8_INT_ST (BIT(0)) -#define SLC_FRHOST_BIT8_INT_ST_M (BIT(0)) -#define SLC_FRHOST_BIT8_INT_ST_V 0x1 -#define SLC_FRHOST_BIT8_INT_ST_S 0 - -#define SLC_1INT_ENA_REG (DR_REG_SLC_BASE + 0x1C) -/* SLC_SLC1_TX_ERR_EOF_INT_ENA : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_ERR_EOF_INT_ENA (BIT(24)) -#define SLC_SLC1_TX_ERR_EOF_INT_ENA_M (BIT(24)) -#define SLC_SLC1_TX_ERR_EOF_INT_ENA_V 0x1 -#define SLC_SLC1_TX_ERR_EOF_INT_ENA_S 24 -/* SLC_SLC1_WR_RETRY_DONE_INT_ENA : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_WR_RETRY_DONE_INT_ENA (BIT(23)) -#define SLC_SLC1_WR_RETRY_DONE_INT_ENA_M (BIT(23)) -#define SLC_SLC1_WR_RETRY_DONE_INT_ENA_V 0x1 -#define SLC_SLC1_WR_RETRY_DONE_INT_ENA_S 23 -/* SLC_SLC1_HOST_RD_ACK_INT_ENA : R/W ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_HOST_RD_ACK_INT_ENA (BIT(22)) -#define SLC_SLC1_HOST_RD_ACK_INT_ENA_M (BIT(22)) -#define SLC_SLC1_HOST_RD_ACK_INT_ENA_V 0x1 -#define SLC_SLC1_HOST_RD_ACK_INT_ENA_S 22 -/* SLC_SLC1_TX_DSCR_EMPTY_INT_ENA : R/W ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_DSCR_EMPTY_INT_ENA (BIT(21)) -#define SLC_SLC1_TX_DSCR_EMPTY_INT_ENA_M (BIT(21)) -#define SLC_SLC1_TX_DSCR_EMPTY_INT_ENA_V 0x1 -#define SLC_SLC1_TX_DSCR_EMPTY_INT_ENA_S 21 -/* SLC_SLC1_RX_DSCR_ERR_INT_ENA : R/W ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_DSCR_ERR_INT_ENA (BIT(20)) -#define SLC_SLC1_RX_DSCR_ERR_INT_ENA_M (BIT(20)) -#define SLC_SLC1_RX_DSCR_ERR_INT_ENA_V 0x1 -#define SLC_SLC1_RX_DSCR_ERR_INT_ENA_S 20 -/* SLC_SLC1_TX_DSCR_ERR_INT_ENA : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_DSCR_ERR_INT_ENA (BIT(19)) -#define SLC_SLC1_TX_DSCR_ERR_INT_ENA_M (BIT(19)) -#define SLC_SLC1_TX_DSCR_ERR_INT_ENA_V 0x1 -#define SLC_SLC1_TX_DSCR_ERR_INT_ENA_S 19 -/* SLC_SLC1_TOHOST_INT_ENA : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TOHOST_INT_ENA (BIT(18)) -#define SLC_SLC1_TOHOST_INT_ENA_M (BIT(18)) -#define SLC_SLC1_TOHOST_INT_ENA_V 0x1 -#define SLC_SLC1_TOHOST_INT_ENA_S 18 -/* SLC_SLC1_RX_EOF_INT_ENA : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_EOF_INT_ENA (BIT(17)) -#define SLC_SLC1_RX_EOF_INT_ENA_M (BIT(17)) -#define SLC_SLC1_RX_EOF_INT_ENA_V 0x1 -#define SLC_SLC1_RX_EOF_INT_ENA_S 17 -/* SLC_SLC1_RX_DONE_INT_ENA : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_DONE_INT_ENA (BIT(16)) -#define SLC_SLC1_RX_DONE_INT_ENA_M (BIT(16)) -#define SLC_SLC1_RX_DONE_INT_ENA_V 0x1 -#define SLC_SLC1_RX_DONE_INT_ENA_S 16 -/* SLC_SLC1_TX_SUC_EOF_INT_ENA : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_SUC_EOF_INT_ENA (BIT(15)) -#define SLC_SLC1_TX_SUC_EOF_INT_ENA_M (BIT(15)) -#define SLC_SLC1_TX_SUC_EOF_INT_ENA_V 0x1 -#define SLC_SLC1_TX_SUC_EOF_INT_ENA_S 15 -/* SLC_SLC1_TX_DONE_INT_ENA : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_DONE_INT_ENA (BIT(14)) -#define SLC_SLC1_TX_DONE_INT_ENA_M (BIT(14)) -#define SLC_SLC1_TX_DONE_INT_ENA_V 0x1 -#define SLC_SLC1_TX_DONE_INT_ENA_S 14 -/* SLC_SLC1_TOKEN1_1TO0_INT_ENA : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TOKEN1_1TO0_INT_ENA (BIT(13)) -#define SLC_SLC1_TOKEN1_1TO0_INT_ENA_M (BIT(13)) -#define SLC_SLC1_TOKEN1_1TO0_INT_ENA_V 0x1 -#define SLC_SLC1_TOKEN1_1TO0_INT_ENA_S 13 -/* SLC_SLC1_TOKEN0_1TO0_INT_ENA : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TOKEN0_1TO0_INT_ENA (BIT(12)) -#define SLC_SLC1_TOKEN0_1TO0_INT_ENA_M (BIT(12)) -#define SLC_SLC1_TOKEN0_1TO0_INT_ENA_V 0x1 -#define SLC_SLC1_TOKEN0_1TO0_INT_ENA_S 12 -/* SLC_SLC1_TX_OVF_INT_ENA : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_OVF_INT_ENA (BIT(11)) -#define SLC_SLC1_TX_OVF_INT_ENA_M (BIT(11)) -#define SLC_SLC1_TX_OVF_INT_ENA_V 0x1 -#define SLC_SLC1_TX_OVF_INT_ENA_S 11 -/* SLC_SLC1_RX_UDF_INT_ENA : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_UDF_INT_ENA (BIT(10)) -#define SLC_SLC1_RX_UDF_INT_ENA_M (BIT(10)) -#define SLC_SLC1_RX_UDF_INT_ENA_V 0x1 -#define SLC_SLC1_RX_UDF_INT_ENA_S 10 -/* SLC_SLC1_TX_START_INT_ENA : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_START_INT_ENA (BIT(9)) -#define SLC_SLC1_TX_START_INT_ENA_M (BIT(9)) -#define SLC_SLC1_TX_START_INT_ENA_V 0x1 -#define SLC_SLC1_TX_START_INT_ENA_S 9 -/* SLC_SLC1_RX_START_INT_ENA : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_START_INT_ENA (BIT(8)) -#define SLC_SLC1_RX_START_INT_ENA_M (BIT(8)) -#define SLC_SLC1_RX_START_INT_ENA_V 0x1 -#define SLC_SLC1_RX_START_INT_ENA_S 8 -/* SLC_FRHOST_BIT15_INT_ENA : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT15_INT_ENA (BIT(7)) -#define SLC_FRHOST_BIT15_INT_ENA_M (BIT(7)) -#define SLC_FRHOST_BIT15_INT_ENA_V 0x1 -#define SLC_FRHOST_BIT15_INT_ENA_S 7 -/* SLC_FRHOST_BIT14_INT_ENA : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT14_INT_ENA (BIT(6)) -#define SLC_FRHOST_BIT14_INT_ENA_M (BIT(6)) -#define SLC_FRHOST_BIT14_INT_ENA_V 0x1 -#define SLC_FRHOST_BIT14_INT_ENA_S 6 -/* SLC_FRHOST_BIT13_INT_ENA : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT13_INT_ENA (BIT(5)) -#define SLC_FRHOST_BIT13_INT_ENA_M (BIT(5)) -#define SLC_FRHOST_BIT13_INT_ENA_V 0x1 -#define SLC_FRHOST_BIT13_INT_ENA_S 5 -/* SLC_FRHOST_BIT12_INT_ENA : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT12_INT_ENA (BIT(4)) -#define SLC_FRHOST_BIT12_INT_ENA_M (BIT(4)) -#define SLC_FRHOST_BIT12_INT_ENA_V 0x1 -#define SLC_FRHOST_BIT12_INT_ENA_S 4 -/* SLC_FRHOST_BIT11_INT_ENA : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT11_INT_ENA (BIT(3)) -#define SLC_FRHOST_BIT11_INT_ENA_M (BIT(3)) -#define SLC_FRHOST_BIT11_INT_ENA_V 0x1 -#define SLC_FRHOST_BIT11_INT_ENA_S 3 -/* SLC_FRHOST_BIT10_INT_ENA : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT10_INT_ENA (BIT(2)) -#define SLC_FRHOST_BIT10_INT_ENA_M (BIT(2)) -#define SLC_FRHOST_BIT10_INT_ENA_V 0x1 -#define SLC_FRHOST_BIT10_INT_ENA_S 2 -/* SLC_FRHOST_BIT9_INT_ENA : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT9_INT_ENA (BIT(1)) -#define SLC_FRHOST_BIT9_INT_ENA_M (BIT(1)) -#define SLC_FRHOST_BIT9_INT_ENA_V 0x1 -#define SLC_FRHOST_BIT9_INT_ENA_S 1 -/* SLC_FRHOST_BIT8_INT_ENA : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT8_INT_ENA (BIT(0)) -#define SLC_FRHOST_BIT8_INT_ENA_M (BIT(0)) -#define SLC_FRHOST_BIT8_INT_ENA_V 0x1 -#define SLC_FRHOST_BIT8_INT_ENA_S 0 - -#define SLC_1INT_CLR_REG (DR_REG_SLC_BASE + 0x20) -/* SLC_SLC1_TX_ERR_EOF_INT_CLR : WO ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_ERR_EOF_INT_CLR (BIT(24)) -#define SLC_SLC1_TX_ERR_EOF_INT_CLR_M (BIT(24)) -#define SLC_SLC1_TX_ERR_EOF_INT_CLR_V 0x1 -#define SLC_SLC1_TX_ERR_EOF_INT_CLR_S 24 -/* SLC_SLC1_WR_RETRY_DONE_INT_CLR : WO ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_WR_RETRY_DONE_INT_CLR (BIT(23)) -#define SLC_SLC1_WR_RETRY_DONE_INT_CLR_M (BIT(23)) -#define SLC_SLC1_WR_RETRY_DONE_INT_CLR_V 0x1 -#define SLC_SLC1_WR_RETRY_DONE_INT_CLR_S 23 -/* SLC_SLC1_HOST_RD_ACK_INT_CLR : WO ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_HOST_RD_ACK_INT_CLR (BIT(22)) -#define SLC_SLC1_HOST_RD_ACK_INT_CLR_M (BIT(22)) -#define SLC_SLC1_HOST_RD_ACK_INT_CLR_V 0x1 -#define SLC_SLC1_HOST_RD_ACK_INT_CLR_S 22 -/* SLC_SLC1_TX_DSCR_EMPTY_INT_CLR : WO ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_DSCR_EMPTY_INT_CLR (BIT(21)) -#define SLC_SLC1_TX_DSCR_EMPTY_INT_CLR_M (BIT(21)) -#define SLC_SLC1_TX_DSCR_EMPTY_INT_CLR_V 0x1 -#define SLC_SLC1_TX_DSCR_EMPTY_INT_CLR_S 21 -/* SLC_SLC1_RX_DSCR_ERR_INT_CLR : WO ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_DSCR_ERR_INT_CLR (BIT(20)) -#define SLC_SLC1_RX_DSCR_ERR_INT_CLR_M (BIT(20)) -#define SLC_SLC1_RX_DSCR_ERR_INT_CLR_V 0x1 -#define SLC_SLC1_RX_DSCR_ERR_INT_CLR_S 20 -/* SLC_SLC1_TX_DSCR_ERR_INT_CLR : WO ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_DSCR_ERR_INT_CLR (BIT(19)) -#define SLC_SLC1_TX_DSCR_ERR_INT_CLR_M (BIT(19)) -#define SLC_SLC1_TX_DSCR_ERR_INT_CLR_V 0x1 -#define SLC_SLC1_TX_DSCR_ERR_INT_CLR_S 19 -/* SLC_SLC1_TOHOST_INT_CLR : WO ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TOHOST_INT_CLR (BIT(18)) -#define SLC_SLC1_TOHOST_INT_CLR_M (BIT(18)) -#define SLC_SLC1_TOHOST_INT_CLR_V 0x1 -#define SLC_SLC1_TOHOST_INT_CLR_S 18 -/* SLC_SLC1_RX_EOF_INT_CLR : WO ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_EOF_INT_CLR (BIT(17)) -#define SLC_SLC1_RX_EOF_INT_CLR_M (BIT(17)) -#define SLC_SLC1_RX_EOF_INT_CLR_V 0x1 -#define SLC_SLC1_RX_EOF_INT_CLR_S 17 -/* SLC_SLC1_RX_DONE_INT_CLR : WO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_DONE_INT_CLR (BIT(16)) -#define SLC_SLC1_RX_DONE_INT_CLR_M (BIT(16)) -#define SLC_SLC1_RX_DONE_INT_CLR_V 0x1 -#define SLC_SLC1_RX_DONE_INT_CLR_S 16 -/* SLC_SLC1_TX_SUC_EOF_INT_CLR : WO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_SUC_EOF_INT_CLR (BIT(15)) -#define SLC_SLC1_TX_SUC_EOF_INT_CLR_M (BIT(15)) -#define SLC_SLC1_TX_SUC_EOF_INT_CLR_V 0x1 -#define SLC_SLC1_TX_SUC_EOF_INT_CLR_S 15 -/* SLC_SLC1_TX_DONE_INT_CLR : WO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_DONE_INT_CLR (BIT(14)) -#define SLC_SLC1_TX_DONE_INT_CLR_M (BIT(14)) -#define SLC_SLC1_TX_DONE_INT_CLR_V 0x1 -#define SLC_SLC1_TX_DONE_INT_CLR_S 14 -/* SLC_SLC1_TOKEN1_1TO0_INT_CLR : WO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TOKEN1_1TO0_INT_CLR (BIT(13)) -#define SLC_SLC1_TOKEN1_1TO0_INT_CLR_M (BIT(13)) -#define SLC_SLC1_TOKEN1_1TO0_INT_CLR_V 0x1 -#define SLC_SLC1_TOKEN1_1TO0_INT_CLR_S 13 -/* SLC_SLC1_TOKEN0_1TO0_INT_CLR : WO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TOKEN0_1TO0_INT_CLR (BIT(12)) -#define SLC_SLC1_TOKEN0_1TO0_INT_CLR_M (BIT(12)) -#define SLC_SLC1_TOKEN0_1TO0_INT_CLR_V 0x1 -#define SLC_SLC1_TOKEN0_1TO0_INT_CLR_S 12 -/* SLC_SLC1_TX_OVF_INT_CLR : WO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_OVF_INT_CLR (BIT(11)) -#define SLC_SLC1_TX_OVF_INT_CLR_M (BIT(11)) -#define SLC_SLC1_TX_OVF_INT_CLR_V 0x1 -#define SLC_SLC1_TX_OVF_INT_CLR_S 11 -/* SLC_SLC1_RX_UDF_INT_CLR : WO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_UDF_INT_CLR (BIT(10)) -#define SLC_SLC1_RX_UDF_INT_CLR_M (BIT(10)) -#define SLC_SLC1_RX_UDF_INT_CLR_V 0x1 -#define SLC_SLC1_RX_UDF_INT_CLR_S 10 -/* SLC_SLC1_TX_START_INT_CLR : WO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_START_INT_CLR (BIT(9)) -#define SLC_SLC1_TX_START_INT_CLR_M (BIT(9)) -#define SLC_SLC1_TX_START_INT_CLR_V 0x1 -#define SLC_SLC1_TX_START_INT_CLR_S 9 -/* SLC_SLC1_RX_START_INT_CLR : WO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_START_INT_CLR (BIT(8)) -#define SLC_SLC1_RX_START_INT_CLR_M (BIT(8)) -#define SLC_SLC1_RX_START_INT_CLR_V 0x1 -#define SLC_SLC1_RX_START_INT_CLR_S 8 -/* SLC_FRHOST_BIT15_INT_CLR : WO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT15_INT_CLR (BIT(7)) -#define SLC_FRHOST_BIT15_INT_CLR_M (BIT(7)) -#define SLC_FRHOST_BIT15_INT_CLR_V 0x1 -#define SLC_FRHOST_BIT15_INT_CLR_S 7 -/* SLC_FRHOST_BIT14_INT_CLR : WO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT14_INT_CLR (BIT(6)) -#define SLC_FRHOST_BIT14_INT_CLR_M (BIT(6)) -#define SLC_FRHOST_BIT14_INT_CLR_V 0x1 -#define SLC_FRHOST_BIT14_INT_CLR_S 6 -/* SLC_FRHOST_BIT13_INT_CLR : WO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT13_INT_CLR (BIT(5)) -#define SLC_FRHOST_BIT13_INT_CLR_M (BIT(5)) -#define SLC_FRHOST_BIT13_INT_CLR_V 0x1 -#define SLC_FRHOST_BIT13_INT_CLR_S 5 -/* SLC_FRHOST_BIT12_INT_CLR : WO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT12_INT_CLR (BIT(4)) -#define SLC_FRHOST_BIT12_INT_CLR_M (BIT(4)) -#define SLC_FRHOST_BIT12_INT_CLR_V 0x1 -#define SLC_FRHOST_BIT12_INT_CLR_S 4 -/* SLC_FRHOST_BIT11_INT_CLR : WO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT11_INT_CLR (BIT(3)) -#define SLC_FRHOST_BIT11_INT_CLR_M (BIT(3)) -#define SLC_FRHOST_BIT11_INT_CLR_V 0x1 -#define SLC_FRHOST_BIT11_INT_CLR_S 3 -/* SLC_FRHOST_BIT10_INT_CLR : WO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT10_INT_CLR (BIT(2)) -#define SLC_FRHOST_BIT10_INT_CLR_M (BIT(2)) -#define SLC_FRHOST_BIT10_INT_CLR_V 0x1 -#define SLC_FRHOST_BIT10_INT_CLR_S 2 -/* SLC_FRHOST_BIT9_INT_CLR : WO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT9_INT_CLR (BIT(1)) -#define SLC_FRHOST_BIT9_INT_CLR_M (BIT(1)) -#define SLC_FRHOST_BIT9_INT_CLR_V 0x1 -#define SLC_FRHOST_BIT9_INT_CLR_S 1 -/* SLC_FRHOST_BIT8_INT_CLR : WO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT8_INT_CLR (BIT(0)) -#define SLC_FRHOST_BIT8_INT_CLR_M (BIT(0)) -#define SLC_FRHOST_BIT8_INT_CLR_V 0x1 -#define SLC_FRHOST_BIT8_INT_CLR_S 0 - -#define SLC_RX_STATUS_REG (DR_REG_SLC_BASE + 0x24) -/* SLC_SLC1_RX_EMPTY : RO ;bitpos:[17] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC1_RX_EMPTY (BIT(17)) -#define SLC_SLC1_RX_EMPTY_M (BIT(17)) -#define SLC_SLC1_RX_EMPTY_V 0x1 -#define SLC_SLC1_RX_EMPTY_S 17 -/* SLC_SLC1_RX_FULL : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_FULL (BIT(16)) -#define SLC_SLC1_RX_FULL_M (BIT(16)) -#define SLC_SLC1_RX_FULL_V 0x1 -#define SLC_SLC1_RX_FULL_S 16 -/* SLC_SLC0_RX_EMPTY : RO ;bitpos:[1] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC0_RX_EMPTY (BIT(1)) -#define SLC_SLC0_RX_EMPTY_M (BIT(1)) -#define SLC_SLC0_RX_EMPTY_V 0x1 -#define SLC_SLC0_RX_EMPTY_S 1 -/* SLC_SLC0_RX_FULL : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_FULL (BIT(0)) -#define SLC_SLC0_RX_FULL_M (BIT(0)) -#define SLC_SLC0_RX_FULL_V 0x1 -#define SLC_SLC0_RX_FULL_S 0 - -#define SLC_0RXFIFO_PUSH_REG (DR_REG_SLC_BASE + 0x28) -/* SLC_SLC0_RXFIFO_PUSH : R/W ;bitpos:[16] ;default: 1'h0 ; */ -/*description: */ -#define SLC_SLC0_RXFIFO_PUSH (BIT(16)) -#define SLC_SLC0_RXFIFO_PUSH_M (BIT(16)) -#define SLC_SLC0_RXFIFO_PUSH_V 0x1 -#define SLC_SLC0_RXFIFO_PUSH_S 16 -/* SLC_SLC0_RXFIFO_WDATA : R/W ;bitpos:[8:0] ;default: 9'h0 ; */ -/*description: */ -#define SLC_SLC0_RXFIFO_WDATA 0x000001FF -#define SLC_SLC0_RXFIFO_WDATA_M ((SLC_SLC0_RXFIFO_WDATA_V)<<(SLC_SLC0_RXFIFO_WDATA_S)) -#define SLC_SLC0_RXFIFO_WDATA_V 0x1FF -#define SLC_SLC0_RXFIFO_WDATA_S 0 - -#define SLC_1RXFIFO_PUSH_REG (DR_REG_SLC_BASE + 0x2C) -/* SLC_SLC1_RXFIFO_PUSH : R/W ;bitpos:[16] ;default: 1'h0 ; */ -/*description: */ -#define SLC_SLC1_RXFIFO_PUSH (BIT(16)) -#define SLC_SLC1_RXFIFO_PUSH_M (BIT(16)) -#define SLC_SLC1_RXFIFO_PUSH_V 0x1 -#define SLC_SLC1_RXFIFO_PUSH_S 16 -/* SLC_SLC1_RXFIFO_WDATA : R/W ;bitpos:[8:0] ;default: 9'h0 ; */ -/*description: */ -#define SLC_SLC1_RXFIFO_WDATA 0x000001FF -#define SLC_SLC1_RXFIFO_WDATA_M ((SLC_SLC1_RXFIFO_WDATA_V)<<(SLC_SLC1_RXFIFO_WDATA_S)) -#define SLC_SLC1_RXFIFO_WDATA_V 0x1FF -#define SLC_SLC1_RXFIFO_WDATA_S 0 - -#define SLC_TX_STATUS_REG (DR_REG_SLC_BASE + 0x30) -/* SLC_SLC1_TX_EMPTY : RO ;bitpos:[17] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC1_TX_EMPTY (BIT(17)) -#define SLC_SLC1_TX_EMPTY_M (BIT(17)) -#define SLC_SLC1_TX_EMPTY_V 0x1 -#define SLC_SLC1_TX_EMPTY_S 17 -/* SLC_SLC1_TX_FULL : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_FULL (BIT(16)) -#define SLC_SLC1_TX_FULL_M (BIT(16)) -#define SLC_SLC1_TX_FULL_V 0x1 -#define SLC_SLC1_TX_FULL_S 16 -/* SLC_SLC0_TX_EMPTY : RO ;bitpos:[1] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC0_TX_EMPTY (BIT(1)) -#define SLC_SLC0_TX_EMPTY_M (BIT(1)) -#define SLC_SLC0_TX_EMPTY_V 0x1 -#define SLC_SLC0_TX_EMPTY_S 1 -/* SLC_SLC0_TX_FULL : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_FULL (BIT(0)) -#define SLC_SLC0_TX_FULL_M (BIT(0)) -#define SLC_SLC0_TX_FULL_V 0x1 -#define SLC_SLC0_TX_FULL_S 0 - -#define SLC_0TXFIFO_POP_REG (DR_REG_SLC_BASE + 0x34) -/* SLC_SLC0_TXFIFO_POP : R/W ;bitpos:[16] ;default: 1'h0 ; */ -/*description: */ -#define SLC_SLC0_TXFIFO_POP (BIT(16)) -#define SLC_SLC0_TXFIFO_POP_M (BIT(16)) -#define SLC_SLC0_TXFIFO_POP_V 0x1 -#define SLC_SLC0_TXFIFO_POP_S 16 -/* SLC_SLC0_TXFIFO_RDATA : RO ;bitpos:[10:0] ;default: 11'h0 ; */ -/*description: */ -#define SLC_SLC0_TXFIFO_RDATA 0x000007FF -#define SLC_SLC0_TXFIFO_RDATA_M ((SLC_SLC0_TXFIFO_RDATA_V)<<(SLC_SLC0_TXFIFO_RDATA_S)) -#define SLC_SLC0_TXFIFO_RDATA_V 0x7FF -#define SLC_SLC0_TXFIFO_RDATA_S 0 - -#define SLC_1TXFIFO_POP_REG (DR_REG_SLC_BASE + 0x38) -/* SLC_SLC1_TXFIFO_POP : R/W ;bitpos:[16] ;default: 1'h0 ; */ -/*description: */ -#define SLC_SLC1_TXFIFO_POP (BIT(16)) -#define SLC_SLC1_TXFIFO_POP_M (BIT(16)) -#define SLC_SLC1_TXFIFO_POP_V 0x1 -#define SLC_SLC1_TXFIFO_POP_S 16 -/* SLC_SLC1_TXFIFO_RDATA : RO ;bitpos:[10:0] ;default: 11'h0 ; */ -/*description: */ -#define SLC_SLC1_TXFIFO_RDATA 0x000007FF -#define SLC_SLC1_TXFIFO_RDATA_M ((SLC_SLC1_TXFIFO_RDATA_V)<<(SLC_SLC1_TXFIFO_RDATA_S)) -#define SLC_SLC1_TXFIFO_RDATA_V 0x7FF -#define SLC_SLC1_TXFIFO_RDATA_S 0 - -#define SLC_0RX_LINK_REG (DR_REG_SLC_BASE + 0x3C) -/* SLC_SLC0_RXLINK_PARK : RO ;bitpos:[31] ;default: 1'h0 ; */ -/*description: */ -#define SLC_SLC0_RXLINK_PARK (BIT(31)) -#define SLC_SLC0_RXLINK_PARK_M (BIT(31)) -#define SLC_SLC0_RXLINK_PARK_V 0x1 -#define SLC_SLC0_RXLINK_PARK_S 31 -/* SLC_SLC0_RXLINK_RESTART : R/W ;bitpos:[30] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RXLINK_RESTART (BIT(30)) -#define SLC_SLC0_RXLINK_RESTART_M (BIT(30)) -#define SLC_SLC0_RXLINK_RESTART_V 0x1 -#define SLC_SLC0_RXLINK_RESTART_S 30 -/* SLC_SLC0_RXLINK_START : R/W ;bitpos:[29] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RXLINK_START (BIT(29)) -#define SLC_SLC0_RXLINK_START_M (BIT(29)) -#define SLC_SLC0_RXLINK_START_V 0x1 -#define SLC_SLC0_RXLINK_START_S 29 -/* SLC_SLC0_RXLINK_STOP : R/W ;bitpos:[28] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RXLINK_STOP (BIT(28)) -#define SLC_SLC0_RXLINK_STOP_M (BIT(28)) -#define SLC_SLC0_RXLINK_STOP_V 0x1 -#define SLC_SLC0_RXLINK_STOP_S 28 -/* SLC_SLC0_RXLINK_ADDR : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: */ -#define SLC_SLC0_RXLINK_ADDR 0x000FFFFF -#define SLC_SLC0_RXLINK_ADDR_M ((SLC_SLC0_RXLINK_ADDR_V)<<(SLC_SLC0_RXLINK_ADDR_S)) -#define SLC_SLC0_RXLINK_ADDR_V 0xFFFFF -#define SLC_SLC0_RXLINK_ADDR_S 0 - -#define SLC_0TX_LINK_REG (DR_REG_SLC_BASE + 0x40) -/* SLC_SLC0_TXLINK_PARK : RO ;bitpos:[31] ;default: 1'h0 ; */ -/*description: */ -#define SLC_SLC0_TXLINK_PARK (BIT(31)) -#define SLC_SLC0_TXLINK_PARK_M (BIT(31)) -#define SLC_SLC0_TXLINK_PARK_V 0x1 -#define SLC_SLC0_TXLINK_PARK_S 31 -/* SLC_SLC0_TXLINK_RESTART : R/W ;bitpos:[30] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TXLINK_RESTART (BIT(30)) -#define SLC_SLC0_TXLINK_RESTART_M (BIT(30)) -#define SLC_SLC0_TXLINK_RESTART_V 0x1 -#define SLC_SLC0_TXLINK_RESTART_S 30 -/* SLC_SLC0_TXLINK_START : R/W ;bitpos:[29] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TXLINK_START (BIT(29)) -#define SLC_SLC0_TXLINK_START_M (BIT(29)) -#define SLC_SLC0_TXLINK_START_V 0x1 -#define SLC_SLC0_TXLINK_START_S 29 -/* SLC_SLC0_TXLINK_STOP : R/W ;bitpos:[28] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TXLINK_STOP (BIT(28)) -#define SLC_SLC0_TXLINK_STOP_M (BIT(28)) -#define SLC_SLC0_TXLINK_STOP_V 0x1 -#define SLC_SLC0_TXLINK_STOP_S 28 -/* SLC_SLC0_TXLINK_ADDR : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: */ -#define SLC_SLC0_TXLINK_ADDR 0x000FFFFF -#define SLC_SLC0_TXLINK_ADDR_M ((SLC_SLC0_TXLINK_ADDR_V)<<(SLC_SLC0_TXLINK_ADDR_S)) -#define SLC_SLC0_TXLINK_ADDR_V 0xFFFFF -#define SLC_SLC0_TXLINK_ADDR_S 0 - -#define SLC_1RX_LINK_REG (DR_REG_SLC_BASE + 0x44) -/* SLC_SLC1_RXLINK_PARK : RO ;bitpos:[31] ;default: 1'h0 ; */ -/*description: */ -#define SLC_SLC1_RXLINK_PARK (BIT(31)) -#define SLC_SLC1_RXLINK_PARK_M (BIT(31)) -#define SLC_SLC1_RXLINK_PARK_V 0x1 -#define SLC_SLC1_RXLINK_PARK_S 31 -/* SLC_SLC1_RXLINK_RESTART : R/W ;bitpos:[30] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RXLINK_RESTART (BIT(30)) -#define SLC_SLC1_RXLINK_RESTART_M (BIT(30)) -#define SLC_SLC1_RXLINK_RESTART_V 0x1 -#define SLC_SLC1_RXLINK_RESTART_S 30 -/* SLC_SLC1_RXLINK_START : R/W ;bitpos:[29] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RXLINK_START (BIT(29)) -#define SLC_SLC1_RXLINK_START_M (BIT(29)) -#define SLC_SLC1_RXLINK_START_V 0x1 -#define SLC_SLC1_RXLINK_START_S 29 -/* SLC_SLC1_RXLINK_STOP : R/W ;bitpos:[28] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RXLINK_STOP (BIT(28)) -#define SLC_SLC1_RXLINK_STOP_M (BIT(28)) -#define SLC_SLC1_RXLINK_STOP_V 0x1 -#define SLC_SLC1_RXLINK_STOP_S 28 -/* SLC_SLC1_BT_PACKET : R/W ;bitpos:[20] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC1_BT_PACKET (BIT(20)) -#define SLC_SLC1_BT_PACKET_M (BIT(20)) -#define SLC_SLC1_BT_PACKET_V 0x1 -#define SLC_SLC1_BT_PACKET_S 20 -/* SLC_SLC1_RXLINK_ADDR : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: */ -#define SLC_SLC1_RXLINK_ADDR 0x000FFFFF -#define SLC_SLC1_RXLINK_ADDR_M ((SLC_SLC1_RXLINK_ADDR_V)<<(SLC_SLC1_RXLINK_ADDR_S)) -#define SLC_SLC1_RXLINK_ADDR_V 0xFFFFF -#define SLC_SLC1_RXLINK_ADDR_S 0 - -#define SLC_1TX_LINK_REG (DR_REG_SLC_BASE + 0x48) -/* SLC_SLC1_TXLINK_PARK : RO ;bitpos:[31] ;default: 1'h0 ; */ -/*description: */ -#define SLC_SLC1_TXLINK_PARK (BIT(31)) -#define SLC_SLC1_TXLINK_PARK_M (BIT(31)) -#define SLC_SLC1_TXLINK_PARK_V 0x1 -#define SLC_SLC1_TXLINK_PARK_S 31 -/* SLC_SLC1_TXLINK_RESTART : R/W ;bitpos:[30] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TXLINK_RESTART (BIT(30)) -#define SLC_SLC1_TXLINK_RESTART_M (BIT(30)) -#define SLC_SLC1_TXLINK_RESTART_V 0x1 -#define SLC_SLC1_TXLINK_RESTART_S 30 -/* SLC_SLC1_TXLINK_START : R/W ;bitpos:[29] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TXLINK_START (BIT(29)) -#define SLC_SLC1_TXLINK_START_M (BIT(29)) -#define SLC_SLC1_TXLINK_START_V 0x1 -#define SLC_SLC1_TXLINK_START_S 29 -/* SLC_SLC1_TXLINK_STOP : R/W ;bitpos:[28] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TXLINK_STOP (BIT(28)) -#define SLC_SLC1_TXLINK_STOP_M (BIT(28)) -#define SLC_SLC1_TXLINK_STOP_V 0x1 -#define SLC_SLC1_TXLINK_STOP_S 28 -/* SLC_SLC1_TXLINK_ADDR : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: */ -#define SLC_SLC1_TXLINK_ADDR 0x000FFFFF -#define SLC_SLC1_TXLINK_ADDR_M ((SLC_SLC1_TXLINK_ADDR_V)<<(SLC_SLC1_TXLINK_ADDR_S)) -#define SLC_SLC1_TXLINK_ADDR_V 0xFFFFF -#define SLC_SLC1_TXLINK_ADDR_S 0 - -#define SLC_INTVEC_TOHOST_REG (DR_REG_SLC_BASE + 0x4C) -/* SLC_SLC1_TOHOST_INTVEC : WO ;bitpos:[23:16] ;default: 8'h0 ; */ -/*description: */ -#define SLC_SLC1_TOHOST_INTVEC 0x000000FF -#define SLC_SLC1_TOHOST_INTVEC_M ((SLC_SLC1_TOHOST_INTVEC_V)<<(SLC_SLC1_TOHOST_INTVEC_S)) -#define SLC_SLC1_TOHOST_INTVEC_V 0xFF -#define SLC_SLC1_TOHOST_INTVEC_S 16 -/* SLC_SLC0_TOHOST_INTVEC : WO ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define SLC_SLC0_TOHOST_INTVEC 0x000000FF -#define SLC_SLC0_TOHOST_INTVEC_M ((SLC_SLC0_TOHOST_INTVEC_V)<<(SLC_SLC0_TOHOST_INTVEC_S)) -#define SLC_SLC0_TOHOST_INTVEC_V 0xFF -#define SLC_SLC0_TOHOST_INTVEC_S 0 - -#define SLC_0TOKEN0_REG (DR_REG_SLC_BASE + 0x50) -/* SLC_SLC0_TOKEN0 : RO ;bitpos:[27:16] ;default: 12'h0 ; */ -/*description: */ -#define SLC_SLC0_TOKEN0 0x00000FFF -#define SLC_SLC0_TOKEN0_M ((SLC_SLC0_TOKEN0_V)<<(SLC_SLC0_TOKEN0_S)) -#define SLC_SLC0_TOKEN0_V 0xFFF -#define SLC_SLC0_TOKEN0_S 16 -/* SLC_SLC0_TOKEN0_INC_MORE : WO ;bitpos:[14] ;default: 1'h0 ; */ -/*description: */ -#define SLC_SLC0_TOKEN0_INC_MORE (BIT(14)) -#define SLC_SLC0_TOKEN0_INC_MORE_M (BIT(14)) -#define SLC_SLC0_TOKEN0_INC_MORE_V 0x1 -#define SLC_SLC0_TOKEN0_INC_MORE_S 14 -/* SLC_SLC0_TOKEN0_INC : WO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TOKEN0_INC (BIT(13)) -#define SLC_SLC0_TOKEN0_INC_M (BIT(13)) -#define SLC_SLC0_TOKEN0_INC_V 0x1 -#define SLC_SLC0_TOKEN0_INC_S 13 -/* SLC_SLC0_TOKEN0_WR : WO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TOKEN0_WR (BIT(12)) -#define SLC_SLC0_TOKEN0_WR_M (BIT(12)) -#define SLC_SLC0_TOKEN0_WR_V 0x1 -#define SLC_SLC0_TOKEN0_WR_S 12 -/* SLC_SLC0_TOKEN0_WDATA : WO ;bitpos:[11:0] ;default: 12'h0 ; */ -/*description: */ -#define SLC_SLC0_TOKEN0_WDATA 0x00000FFF -#define SLC_SLC0_TOKEN0_WDATA_M ((SLC_SLC0_TOKEN0_WDATA_V)<<(SLC_SLC0_TOKEN0_WDATA_S)) -#define SLC_SLC0_TOKEN0_WDATA_V 0xFFF -#define SLC_SLC0_TOKEN0_WDATA_S 0 - -#define SLC_0TOKEN1_REG (DR_REG_SLC_BASE + 0x54) -/* SLC_SLC0_TOKEN1 : RO ;bitpos:[27:16] ;default: 12'h0 ; */ -/*description: */ -#define SLC_SLC0_TOKEN1 0x00000FFF -#define SLC_SLC0_TOKEN1_M ((SLC_SLC0_TOKEN1_V)<<(SLC_SLC0_TOKEN1_S)) -#define SLC_SLC0_TOKEN1_V 0xFFF -#define SLC_SLC0_TOKEN1_S 16 -/* SLC_SLC0_TOKEN1_INC_MORE : WO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TOKEN1_INC_MORE (BIT(14)) -#define SLC_SLC0_TOKEN1_INC_MORE_M (BIT(14)) -#define SLC_SLC0_TOKEN1_INC_MORE_V 0x1 -#define SLC_SLC0_TOKEN1_INC_MORE_S 14 -/* SLC_SLC0_TOKEN1_INC : WO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TOKEN1_INC (BIT(13)) -#define SLC_SLC0_TOKEN1_INC_M (BIT(13)) -#define SLC_SLC0_TOKEN1_INC_V 0x1 -#define SLC_SLC0_TOKEN1_INC_S 13 -/* SLC_SLC0_TOKEN1_WR : WO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TOKEN1_WR (BIT(12)) -#define SLC_SLC0_TOKEN1_WR_M (BIT(12)) -#define SLC_SLC0_TOKEN1_WR_V 0x1 -#define SLC_SLC0_TOKEN1_WR_S 12 -/* SLC_SLC0_TOKEN1_WDATA : WO ;bitpos:[11:0] ;default: 12'h0 ; */ -/*description: */ -#define SLC_SLC0_TOKEN1_WDATA 0x00000FFF -#define SLC_SLC0_TOKEN1_WDATA_M ((SLC_SLC0_TOKEN1_WDATA_V)<<(SLC_SLC0_TOKEN1_WDATA_S)) -#define SLC_SLC0_TOKEN1_WDATA_V 0xFFF -#define SLC_SLC0_TOKEN1_WDATA_S 0 - -#define SLC_1TOKEN0_REG (DR_REG_SLC_BASE + 0x58) -/* SLC_SLC1_TOKEN0 : RO ;bitpos:[27:16] ;default: 12'h0 ; */ -/*description: */ -#define SLC_SLC1_TOKEN0 0x00000FFF -#define SLC_SLC1_TOKEN0_M ((SLC_SLC1_TOKEN0_V)<<(SLC_SLC1_TOKEN0_S)) -#define SLC_SLC1_TOKEN0_V 0xFFF -#define SLC_SLC1_TOKEN0_S 16 -/* SLC_SLC1_TOKEN0_INC_MORE : WO ;bitpos:[14] ;default: 1'h0 ; */ -/*description: */ -#define SLC_SLC1_TOKEN0_INC_MORE (BIT(14)) -#define SLC_SLC1_TOKEN0_INC_MORE_M (BIT(14)) -#define SLC_SLC1_TOKEN0_INC_MORE_V 0x1 -#define SLC_SLC1_TOKEN0_INC_MORE_S 14 -/* SLC_SLC1_TOKEN0_INC : WO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TOKEN0_INC (BIT(13)) -#define SLC_SLC1_TOKEN0_INC_M (BIT(13)) -#define SLC_SLC1_TOKEN0_INC_V 0x1 -#define SLC_SLC1_TOKEN0_INC_S 13 -/* SLC_SLC1_TOKEN0_WR : WO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TOKEN0_WR (BIT(12)) -#define SLC_SLC1_TOKEN0_WR_M (BIT(12)) -#define SLC_SLC1_TOKEN0_WR_V 0x1 -#define SLC_SLC1_TOKEN0_WR_S 12 -/* SLC_SLC1_TOKEN0_WDATA : WO ;bitpos:[11:0] ;default: 12'h0 ; */ -/*description: */ -#define SLC_SLC1_TOKEN0_WDATA 0x00000FFF -#define SLC_SLC1_TOKEN0_WDATA_M ((SLC_SLC1_TOKEN0_WDATA_V)<<(SLC_SLC1_TOKEN0_WDATA_S)) -#define SLC_SLC1_TOKEN0_WDATA_V 0xFFF -#define SLC_SLC1_TOKEN0_WDATA_S 0 - -#define SLC_1TOKEN1_REG (DR_REG_SLC_BASE + 0x5C) -/* SLC_SLC1_TOKEN1 : RO ;bitpos:[27:16] ;default: 12'h0 ; */ -/*description: */ -#define SLC_SLC1_TOKEN1 0x00000FFF -#define SLC_SLC1_TOKEN1_M ((SLC_SLC1_TOKEN1_V)<<(SLC_SLC1_TOKEN1_S)) -#define SLC_SLC1_TOKEN1_V 0xFFF -#define SLC_SLC1_TOKEN1_S 16 -/* SLC_SLC1_TOKEN1_INC_MORE : WO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TOKEN1_INC_MORE (BIT(14)) -#define SLC_SLC1_TOKEN1_INC_MORE_M (BIT(14)) -#define SLC_SLC1_TOKEN1_INC_MORE_V 0x1 -#define SLC_SLC1_TOKEN1_INC_MORE_S 14 -/* SLC_SLC1_TOKEN1_INC : WO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TOKEN1_INC (BIT(13)) -#define SLC_SLC1_TOKEN1_INC_M (BIT(13)) -#define SLC_SLC1_TOKEN1_INC_V 0x1 -#define SLC_SLC1_TOKEN1_INC_S 13 -/* SLC_SLC1_TOKEN1_WR : WO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TOKEN1_WR (BIT(12)) -#define SLC_SLC1_TOKEN1_WR_M (BIT(12)) -#define SLC_SLC1_TOKEN1_WR_V 0x1 -#define SLC_SLC1_TOKEN1_WR_S 12 -/* SLC_SLC1_TOKEN1_WDATA : WO ;bitpos:[11:0] ;default: 12'h0 ; */ -/*description: */ -#define SLC_SLC1_TOKEN1_WDATA 0x00000FFF -#define SLC_SLC1_TOKEN1_WDATA_M ((SLC_SLC1_TOKEN1_WDATA_V)<<(SLC_SLC1_TOKEN1_WDATA_S)) -#define SLC_SLC1_TOKEN1_WDATA_V 0xFFF -#define SLC_SLC1_TOKEN1_WDATA_S 0 - -#define SLC_CONF1_REG (DR_REG_SLC_BASE + 0x60) -/* SLC_CLK_EN : R/W ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define SLC_CLK_EN (BIT(22)) -#define SLC_CLK_EN_M (BIT(22)) -#define SLC_CLK_EN_V 0x1 -#define SLC_CLK_EN_S 22 -/* SLC_SLC1_RX_STITCH_EN : R/W ;bitpos:[21] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC1_RX_STITCH_EN (BIT(21)) -#define SLC_SLC1_RX_STITCH_EN_M (BIT(21)) -#define SLC_SLC1_RX_STITCH_EN_V 0x1 -#define SLC_SLC1_RX_STITCH_EN_S 21 -/* SLC_SLC1_TX_STITCH_EN : R/W ;bitpos:[20] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC1_TX_STITCH_EN (BIT(20)) -#define SLC_SLC1_TX_STITCH_EN_M (BIT(20)) -#define SLC_SLC1_TX_STITCH_EN_V 0x1 -#define SLC_SLC1_TX_STITCH_EN_S 20 -/* SLC_HOST_INT_LEVEL_SEL : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define SLC_HOST_INT_LEVEL_SEL (BIT(19)) -#define SLC_HOST_INT_LEVEL_SEL_M (BIT(19)) -#define SLC_HOST_INT_LEVEL_SEL_V 0x1 -#define SLC_HOST_INT_LEVEL_SEL_S 19 -/* SLC_SLC1_RX_CHECK_SUM_EN : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_CHECK_SUM_EN (BIT(18)) -#define SLC_SLC1_RX_CHECK_SUM_EN_M (BIT(18)) -#define SLC_SLC1_RX_CHECK_SUM_EN_V 0x1 -#define SLC_SLC1_RX_CHECK_SUM_EN_S 18 -/* SLC_SLC1_TX_CHECK_SUM_EN : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_CHECK_SUM_EN (BIT(17)) -#define SLC_SLC1_TX_CHECK_SUM_EN_M (BIT(17)) -#define SLC_SLC1_TX_CHECK_SUM_EN_V 0x1 -#define SLC_SLC1_TX_CHECK_SUM_EN_S 17 -/* SLC_SLC1_CHECK_OWNER : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_CHECK_OWNER (BIT(16)) -#define SLC_SLC1_CHECK_OWNER_M (BIT(16)) -#define SLC_SLC1_CHECK_OWNER_V 0x1 -#define SLC_SLC1_CHECK_OWNER_S 16 -/* SLC_SLC0_RX_STITCH_EN : R/W ;bitpos:[6] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC0_RX_STITCH_EN (BIT(6)) -#define SLC_SLC0_RX_STITCH_EN_M (BIT(6)) -#define SLC_SLC0_RX_STITCH_EN_V 0x1 -#define SLC_SLC0_RX_STITCH_EN_S 6 -/* SLC_SLC0_TX_STITCH_EN : R/W ;bitpos:[5] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC0_TX_STITCH_EN (BIT(5)) -#define SLC_SLC0_TX_STITCH_EN_M (BIT(5)) -#define SLC_SLC0_TX_STITCH_EN_V 0x1 -#define SLC_SLC0_TX_STITCH_EN_S 5 -/* SLC_SLC0_LEN_AUTO_CLR : R/W ;bitpos:[4] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC0_LEN_AUTO_CLR (BIT(4)) -#define SLC_SLC0_LEN_AUTO_CLR_M (BIT(4)) -#define SLC_SLC0_LEN_AUTO_CLR_V 0x1 -#define SLC_SLC0_LEN_AUTO_CLR_S 4 -/* SLC_CMD_HOLD_EN : R/W ;bitpos:[3] ;default: 1'b1 ; */ -/*description: */ -#define SLC_CMD_HOLD_EN (BIT(3)) -#define SLC_CMD_HOLD_EN_M (BIT(3)) -#define SLC_CMD_HOLD_EN_V 0x1 -#define SLC_CMD_HOLD_EN_S 3 -/* SLC_SLC0_RX_CHECK_SUM_EN : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_CHECK_SUM_EN (BIT(2)) -#define SLC_SLC0_RX_CHECK_SUM_EN_M (BIT(2)) -#define SLC_SLC0_RX_CHECK_SUM_EN_V 0x1 -#define SLC_SLC0_RX_CHECK_SUM_EN_S 2 -/* SLC_SLC0_TX_CHECK_SUM_EN : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_CHECK_SUM_EN (BIT(1)) -#define SLC_SLC0_TX_CHECK_SUM_EN_M (BIT(1)) -#define SLC_SLC0_TX_CHECK_SUM_EN_V 0x1 -#define SLC_SLC0_TX_CHECK_SUM_EN_S 1 -/* SLC_SLC0_CHECK_OWNER : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_CHECK_OWNER (BIT(0)) -#define SLC_SLC0_CHECK_OWNER_M (BIT(0)) -#define SLC_SLC0_CHECK_OWNER_V 0x1 -#define SLC_SLC0_CHECK_OWNER_S 0 - -#define SLC_0_STATE0_REG (DR_REG_SLC_BASE + 0x64) -/* SLC_SLC0_STATE0 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define SLC_SLC0_STATE0 0xFFFFFFFF -#define SLC_SLC0_STATE0_M ((SLC_SLC0_STATE0_V)<<(SLC_SLC0_STATE0_S)) -#define SLC_SLC0_STATE0_V 0xFFFFFFFF -#define SLC_SLC0_STATE0_S 0 - -#define SLC_0_STATE1_REG (DR_REG_SLC_BASE + 0x68) -/* SLC_SLC0_STATE1 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define SLC_SLC0_STATE1 0xFFFFFFFF -#define SLC_SLC0_STATE1_M ((SLC_SLC0_STATE1_V)<<(SLC_SLC0_STATE1_S)) -#define SLC_SLC0_STATE1_V 0xFFFFFFFF -#define SLC_SLC0_STATE1_S 0 - -#define SLC_1_STATE0_REG (DR_REG_SLC_BASE + 0x6C) -/* SLC_SLC1_STATE0 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define SLC_SLC1_STATE0 0xFFFFFFFF -#define SLC_SLC1_STATE0_M ((SLC_SLC1_STATE0_V)<<(SLC_SLC1_STATE0_S)) -#define SLC_SLC1_STATE0_V 0xFFFFFFFF -#define SLC_SLC1_STATE0_S 0 - -#define SLC_1_STATE1_REG (DR_REG_SLC_BASE + 0x70) -/* SLC_SLC1_STATE1 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define SLC_SLC1_STATE1 0xFFFFFFFF -#define SLC_SLC1_STATE1_M ((SLC_SLC1_STATE1_V)<<(SLC_SLC1_STATE1_S)) -#define SLC_SLC1_STATE1_V 0xFFFFFFFF -#define SLC_SLC1_STATE1_S 0 - -#define SLC_BRIDGE_CONF_REG (DR_REG_SLC_BASE + 0x74) -/* SLC_TX_PUSH_IDLE_NUM : R/W ;bitpos:[31:16] ;default: 16'ha ; */ -/*description: */ -#define SLC_TX_PUSH_IDLE_NUM 0x0000FFFF -#define SLC_TX_PUSH_IDLE_NUM_M ((SLC_TX_PUSH_IDLE_NUM_V)<<(SLC_TX_PUSH_IDLE_NUM_S)) -#define SLC_TX_PUSH_IDLE_NUM_V 0xFFFF -#define SLC_TX_PUSH_IDLE_NUM_S 16 -/* SLC_SLC1_TX_DUMMY_MODE : R/W ;bitpos:[14] ;default: 1'h1 ; */ -/*description: */ -#define SLC_SLC1_TX_DUMMY_MODE (BIT(14)) -#define SLC_SLC1_TX_DUMMY_MODE_M (BIT(14)) -#define SLC_SLC1_TX_DUMMY_MODE_V 0x1 -#define SLC_SLC1_TX_DUMMY_MODE_S 14 -/* SLC_HDA_MAP_128K : R/W ;bitpos:[13] ;default: 1'h1 ; */ -/*description: */ -#define SLC_HDA_MAP_128K (BIT(13)) -#define SLC_HDA_MAP_128K_M (BIT(13)) -#define SLC_HDA_MAP_128K_V 0x1 -#define SLC_HDA_MAP_128K_S 13 -/* SLC_SLC0_TX_DUMMY_MODE : R/W ;bitpos:[12] ;default: 1'h1 ; */ -/*description: */ -#define SLC_SLC0_TX_DUMMY_MODE (BIT(12)) -#define SLC_SLC0_TX_DUMMY_MODE_M (BIT(12)) -#define SLC_SLC0_TX_DUMMY_MODE_V 0x1 -#define SLC_SLC0_TX_DUMMY_MODE_S 12 -/* SLC_FIFO_MAP_ENA : R/W ;bitpos:[11:8] ;default: 4'h7 ; */ -/*description: */ -#define SLC_FIFO_MAP_ENA 0x0000000F -#define SLC_FIFO_MAP_ENA_M ((SLC_FIFO_MAP_ENA_V)<<(SLC_FIFO_MAP_ENA_S)) -#define SLC_FIFO_MAP_ENA_V 0xF -#define SLC_FIFO_MAP_ENA_S 8 -/* SLC_TXEOF_ENA : R/W ;bitpos:[5:0] ;default: 6'h20 ; */ -/*description: */ -#define SLC_TXEOF_ENA 0x0000003F -#define SLC_TXEOF_ENA_M ((SLC_TXEOF_ENA_V)<<(SLC_TXEOF_ENA_S)) -#define SLC_TXEOF_ENA_V 0x3F -#define SLC_TXEOF_ENA_S 0 - -#define SLC_0_TO_EOF_DES_ADDR_REG (DR_REG_SLC_BASE + 0x78) -/* SLC_SLC0_TO_EOF_DES_ADDR : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define SLC_SLC0_TO_EOF_DES_ADDR 0xFFFFFFFF -#define SLC_SLC0_TO_EOF_DES_ADDR_M ((SLC_SLC0_TO_EOF_DES_ADDR_V)<<(SLC_SLC0_TO_EOF_DES_ADDR_S)) -#define SLC_SLC0_TO_EOF_DES_ADDR_V 0xFFFFFFFF -#define SLC_SLC0_TO_EOF_DES_ADDR_S 0 - -#define SLC_0_TX_EOF_DES_ADDR_REG (DR_REG_SLC_BASE + 0x7C) -/* SLC_SLC0_TX_SUC_EOF_DES_ADDR : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define SLC_SLC0_TX_SUC_EOF_DES_ADDR 0xFFFFFFFF -#define SLC_SLC0_TX_SUC_EOF_DES_ADDR_M ((SLC_SLC0_TX_SUC_EOF_DES_ADDR_V)<<(SLC_SLC0_TX_SUC_EOF_DES_ADDR_S)) -#define SLC_SLC0_TX_SUC_EOF_DES_ADDR_V 0xFFFFFFFF -#define SLC_SLC0_TX_SUC_EOF_DES_ADDR_S 0 - -#define SLC_0_TO_EOF_BFR_DES_ADDR_REG (DR_REG_SLC_BASE + 0x80) -/* SLC_SLC0_TO_EOF_BFR_DES_ADDR : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define SLC_SLC0_TO_EOF_BFR_DES_ADDR 0xFFFFFFFF -#define SLC_SLC0_TO_EOF_BFR_DES_ADDR_M ((SLC_SLC0_TO_EOF_BFR_DES_ADDR_V)<<(SLC_SLC0_TO_EOF_BFR_DES_ADDR_S)) -#define SLC_SLC0_TO_EOF_BFR_DES_ADDR_V 0xFFFFFFFF -#define SLC_SLC0_TO_EOF_BFR_DES_ADDR_S 0 - -#define SLC_1_TO_EOF_DES_ADDR_REG (DR_REG_SLC_BASE + 0x84) -/* SLC_SLC1_TO_EOF_DES_ADDR : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define SLC_SLC1_TO_EOF_DES_ADDR 0xFFFFFFFF -#define SLC_SLC1_TO_EOF_DES_ADDR_M ((SLC_SLC1_TO_EOF_DES_ADDR_V)<<(SLC_SLC1_TO_EOF_DES_ADDR_S)) -#define SLC_SLC1_TO_EOF_DES_ADDR_V 0xFFFFFFFF -#define SLC_SLC1_TO_EOF_DES_ADDR_S 0 - -#define SLC_1_TX_EOF_DES_ADDR_REG (DR_REG_SLC_BASE + 0x88) -/* SLC_SLC1_TX_SUC_EOF_DES_ADDR : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define SLC_SLC1_TX_SUC_EOF_DES_ADDR 0xFFFFFFFF -#define SLC_SLC1_TX_SUC_EOF_DES_ADDR_M ((SLC_SLC1_TX_SUC_EOF_DES_ADDR_V)<<(SLC_SLC1_TX_SUC_EOF_DES_ADDR_S)) -#define SLC_SLC1_TX_SUC_EOF_DES_ADDR_V 0xFFFFFFFF -#define SLC_SLC1_TX_SUC_EOF_DES_ADDR_S 0 - -#define SLC_1_TO_EOF_BFR_DES_ADDR_REG (DR_REG_SLC_BASE + 0x8C) -/* SLC_SLC1_TO_EOF_BFR_DES_ADDR : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define SLC_SLC1_TO_EOF_BFR_DES_ADDR 0xFFFFFFFF -#define SLC_SLC1_TO_EOF_BFR_DES_ADDR_M ((SLC_SLC1_TO_EOF_BFR_DES_ADDR_V)<<(SLC_SLC1_TO_EOF_BFR_DES_ADDR_S)) -#define SLC_SLC1_TO_EOF_BFR_DES_ADDR_V 0xFFFFFFFF -#define SLC_SLC1_TO_EOF_BFR_DES_ADDR_S 0 - -#define SLC_AHB_TEST_REG (DR_REG_SLC_BASE + 0x90) -/* SLC_AHB_TESTADDR : R/W ;bitpos:[5:4] ;default: 2'b0 ; */ -/*description: */ -#define SLC_AHB_TESTADDR 0x00000003 -#define SLC_AHB_TESTADDR_M ((SLC_AHB_TESTADDR_V)<<(SLC_AHB_TESTADDR_S)) -#define SLC_AHB_TESTADDR_V 0x3 -#define SLC_AHB_TESTADDR_S 4 -/* SLC_AHB_TESTMODE : R/W ;bitpos:[2:0] ;default: 3'b0 ; */ -/*description: */ -#define SLC_AHB_TESTMODE 0x00000007 -#define SLC_AHB_TESTMODE_M ((SLC_AHB_TESTMODE_V)<<(SLC_AHB_TESTMODE_S)) -#define SLC_AHB_TESTMODE_V 0x7 -#define SLC_AHB_TESTMODE_S 0 - -#define SLC_SDIO_ST_REG (DR_REG_SLC_BASE + 0x94) -/* SLC_FUNC2_ACC_STATE : RO ;bitpos:[28:24] ;default: 5'b0 ; */ -/*description: */ -#define SLC_FUNC2_ACC_STATE 0x0000001F -#define SLC_FUNC2_ACC_STATE_M ((SLC_FUNC2_ACC_STATE_V)<<(SLC_FUNC2_ACC_STATE_S)) -#define SLC_FUNC2_ACC_STATE_V 0x1F -#define SLC_FUNC2_ACC_STATE_S 24 -/* SLC_FUNC1_ACC_STATE : RO ;bitpos:[20:16] ;default: 5'b0 ; */ -/*description: */ -#define SLC_FUNC1_ACC_STATE 0x0000001F -#define SLC_FUNC1_ACC_STATE_M ((SLC_FUNC1_ACC_STATE_V)<<(SLC_FUNC1_ACC_STATE_S)) -#define SLC_FUNC1_ACC_STATE_V 0x1F -#define SLC_FUNC1_ACC_STATE_S 16 -/* SLC_BUS_ST : RO ;bitpos:[14:12] ;default: 3'b0 ; */ -/*description: */ -#define SLC_BUS_ST 0x00000007 -#define SLC_BUS_ST_M ((SLC_BUS_ST_V)<<(SLC_BUS_ST_S)) -#define SLC_BUS_ST_V 0x7 -#define SLC_BUS_ST_S 12 -/* SLC_SDIO_WAKEUP : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SDIO_WAKEUP (BIT(8)) -#define SLC_SDIO_WAKEUP_M (BIT(8)) -#define SLC_SDIO_WAKEUP_V 0x1 -#define SLC_SDIO_WAKEUP_S 8 -/* SLC_FUNC_ST : RO ;bitpos:[7:4] ;default: 4'b0 ; */ -/*description: */ -#define SLC_FUNC_ST 0x0000000F -#define SLC_FUNC_ST_M ((SLC_FUNC_ST_V)<<(SLC_FUNC_ST_S)) -#define SLC_FUNC_ST_V 0xF -#define SLC_FUNC_ST_S 4 -/* SLC_CMD_ST : RO ;bitpos:[2:0] ;default: 3'b0 ; */ -/*description: */ -#define SLC_CMD_ST 0x00000007 -#define SLC_CMD_ST_M ((SLC_CMD_ST_V)<<(SLC_CMD_ST_S)) -#define SLC_CMD_ST_V 0x7 -#define SLC_CMD_ST_S 0 - -#define SLC_RX_DSCR_CONF_REG (DR_REG_SLC_BASE + 0x98) -/* SLC_SLC1_RD_RETRY_THRESHOLD : R/W ;bitpos:[31:21] ;default: 11'h80 ; */ -/*description: */ -#define SLC_SLC1_RD_RETRY_THRESHOLD 0x000007FF -#define SLC_SLC1_RD_RETRY_THRESHOLD_M ((SLC_SLC1_RD_RETRY_THRESHOLD_V)<<(SLC_SLC1_RD_RETRY_THRESHOLD_S)) -#define SLC_SLC1_RD_RETRY_THRESHOLD_V 0x7FF -#define SLC_SLC1_RD_RETRY_THRESHOLD_S 21 -/* SLC_SLC1_RX_FILL_EN : R/W ;bitpos:[20] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC1_RX_FILL_EN (BIT(20)) -#define SLC_SLC1_RX_FILL_EN_M (BIT(20)) -#define SLC_SLC1_RX_FILL_EN_V 0x1 -#define SLC_SLC1_RX_FILL_EN_S 20 -/* SLC_SLC1_RX_EOF_MODE : R/W ;bitpos:[19] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC1_RX_EOF_MODE (BIT(19)) -#define SLC_SLC1_RX_EOF_MODE_M (BIT(19)) -#define SLC_SLC1_RX_EOF_MODE_V 0x1 -#define SLC_SLC1_RX_EOF_MODE_S 19 -/* SLC_SLC1_RX_FILL_MODE : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_FILL_MODE (BIT(18)) -#define SLC_SLC1_RX_FILL_MODE_M (BIT(18)) -#define SLC_SLC1_RX_FILL_MODE_V 0x1 -#define SLC_SLC1_RX_FILL_MODE_S 18 -/* SLC_SLC1_INFOR_NO_REPLACE : R/W ;bitpos:[17] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC1_INFOR_NO_REPLACE (BIT(17)) -#define SLC_SLC1_INFOR_NO_REPLACE_M (BIT(17)) -#define SLC_SLC1_INFOR_NO_REPLACE_V 0x1 -#define SLC_SLC1_INFOR_NO_REPLACE_S 17 -/* SLC_SLC1_TOKEN_NO_REPLACE : R/W ;bitpos:[16] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC1_TOKEN_NO_REPLACE (BIT(16)) -#define SLC_SLC1_TOKEN_NO_REPLACE_M (BIT(16)) -#define SLC_SLC1_TOKEN_NO_REPLACE_V 0x1 -#define SLC_SLC1_TOKEN_NO_REPLACE_S 16 -/* SLC_SLC0_RD_RETRY_THRESHOLD : R/W ;bitpos:[15:5] ;default: 11'h80 ; */ -/*description: */ -#define SLC_SLC0_RD_RETRY_THRESHOLD 0x000007FF -#define SLC_SLC0_RD_RETRY_THRESHOLD_M ((SLC_SLC0_RD_RETRY_THRESHOLD_V)<<(SLC_SLC0_RD_RETRY_THRESHOLD_S)) -#define SLC_SLC0_RD_RETRY_THRESHOLD_V 0x7FF -#define SLC_SLC0_RD_RETRY_THRESHOLD_S 5 -/* SLC_SLC0_RX_FILL_EN : R/W ;bitpos:[4] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC0_RX_FILL_EN (BIT(4)) -#define SLC_SLC0_RX_FILL_EN_M (BIT(4)) -#define SLC_SLC0_RX_FILL_EN_V 0x1 -#define SLC_SLC0_RX_FILL_EN_S 4 -/* SLC_SLC0_RX_EOF_MODE : R/W ;bitpos:[3] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC0_RX_EOF_MODE (BIT(3)) -#define SLC_SLC0_RX_EOF_MODE_M (BIT(3)) -#define SLC_SLC0_RX_EOF_MODE_V 0x1 -#define SLC_SLC0_RX_EOF_MODE_S 3 -/* SLC_SLC0_RX_FILL_MODE : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_FILL_MODE (BIT(2)) -#define SLC_SLC0_RX_FILL_MODE_M (BIT(2)) -#define SLC_SLC0_RX_FILL_MODE_V 0x1 -#define SLC_SLC0_RX_FILL_MODE_S 2 -/* SLC_SLC0_INFOR_NO_REPLACE : R/W ;bitpos:[1] ;default: 1'b1 ; */ -/*description: */ -#define SLC_SLC0_INFOR_NO_REPLACE (BIT(1)) -#define SLC_SLC0_INFOR_NO_REPLACE_M (BIT(1)) -#define SLC_SLC0_INFOR_NO_REPLACE_V 0x1 -#define SLC_SLC0_INFOR_NO_REPLACE_S 1 -/* SLC_SLC0_TOKEN_NO_REPLACE : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TOKEN_NO_REPLACE (BIT(0)) -#define SLC_SLC0_TOKEN_NO_REPLACE_M (BIT(0)) -#define SLC_SLC0_TOKEN_NO_REPLACE_V 0x1 -#define SLC_SLC0_TOKEN_NO_REPLACE_S 0 - -#define SLC_0_TXLINK_DSCR_REG (DR_REG_SLC_BASE + 0x9C) -/* SLC_SLC0_TXLINK_DSCR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define SLC_SLC0_TXLINK_DSCR 0xFFFFFFFF -#define SLC_SLC0_TXLINK_DSCR_M ((SLC_SLC0_TXLINK_DSCR_V)<<(SLC_SLC0_TXLINK_DSCR_S)) -#define SLC_SLC0_TXLINK_DSCR_V 0xFFFFFFFF -#define SLC_SLC0_TXLINK_DSCR_S 0 - -#define SLC_0_TXLINK_DSCR_BF0_REG (DR_REG_SLC_BASE + 0xA0) -/* SLC_SLC0_TXLINK_DSCR_BF0 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define SLC_SLC0_TXLINK_DSCR_BF0 0xFFFFFFFF -#define SLC_SLC0_TXLINK_DSCR_BF0_M ((SLC_SLC0_TXLINK_DSCR_BF0_V)<<(SLC_SLC0_TXLINK_DSCR_BF0_S)) -#define SLC_SLC0_TXLINK_DSCR_BF0_V 0xFFFFFFFF -#define SLC_SLC0_TXLINK_DSCR_BF0_S 0 - -#define SLC_0_TXLINK_DSCR_BF1_REG (DR_REG_SLC_BASE + 0xA4) -/* SLC_SLC0_TXLINK_DSCR_BF1 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define SLC_SLC0_TXLINK_DSCR_BF1 0xFFFFFFFF -#define SLC_SLC0_TXLINK_DSCR_BF1_M ((SLC_SLC0_TXLINK_DSCR_BF1_V)<<(SLC_SLC0_TXLINK_DSCR_BF1_S)) -#define SLC_SLC0_TXLINK_DSCR_BF1_V 0xFFFFFFFF -#define SLC_SLC0_TXLINK_DSCR_BF1_S 0 - -#define SLC_0_RXLINK_DSCR_REG (DR_REG_SLC_BASE + 0xA8) -/* SLC_SLC0_RXLINK_DSCR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define SLC_SLC0_RXLINK_DSCR 0xFFFFFFFF -#define SLC_SLC0_RXLINK_DSCR_M ((SLC_SLC0_RXLINK_DSCR_V)<<(SLC_SLC0_RXLINK_DSCR_S)) -#define SLC_SLC0_RXLINK_DSCR_V 0xFFFFFFFF -#define SLC_SLC0_RXLINK_DSCR_S 0 - -#define SLC_0_RXLINK_DSCR_BF0_REG (DR_REG_SLC_BASE + 0xAC) -/* SLC_SLC0_RXLINK_DSCR_BF0 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define SLC_SLC0_RXLINK_DSCR_BF0 0xFFFFFFFF -#define SLC_SLC0_RXLINK_DSCR_BF0_M ((SLC_SLC0_RXLINK_DSCR_BF0_V)<<(SLC_SLC0_RXLINK_DSCR_BF0_S)) -#define SLC_SLC0_RXLINK_DSCR_BF0_V 0xFFFFFFFF -#define SLC_SLC0_RXLINK_DSCR_BF0_S 0 - -#define SLC_0_RXLINK_DSCR_BF1_REG (DR_REG_SLC_BASE + 0xB0) -/* SLC_SLC0_RXLINK_DSCR_BF1 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define SLC_SLC0_RXLINK_DSCR_BF1 0xFFFFFFFF -#define SLC_SLC0_RXLINK_DSCR_BF1_M ((SLC_SLC0_RXLINK_DSCR_BF1_V)<<(SLC_SLC0_RXLINK_DSCR_BF1_S)) -#define SLC_SLC0_RXLINK_DSCR_BF1_V 0xFFFFFFFF -#define SLC_SLC0_RXLINK_DSCR_BF1_S 0 - -#define SLC_1_TXLINK_DSCR_REG (DR_REG_SLC_BASE + 0xB4) -/* SLC_SLC1_TXLINK_DSCR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define SLC_SLC1_TXLINK_DSCR 0xFFFFFFFF -#define SLC_SLC1_TXLINK_DSCR_M ((SLC_SLC1_TXLINK_DSCR_V)<<(SLC_SLC1_TXLINK_DSCR_S)) -#define SLC_SLC1_TXLINK_DSCR_V 0xFFFFFFFF -#define SLC_SLC1_TXLINK_DSCR_S 0 - -#define SLC_1_TXLINK_DSCR_BF0_REG (DR_REG_SLC_BASE + 0xB8) -/* SLC_SLC1_TXLINK_DSCR_BF0 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define SLC_SLC1_TXLINK_DSCR_BF0 0xFFFFFFFF -#define SLC_SLC1_TXLINK_DSCR_BF0_M ((SLC_SLC1_TXLINK_DSCR_BF0_V)<<(SLC_SLC1_TXLINK_DSCR_BF0_S)) -#define SLC_SLC1_TXLINK_DSCR_BF0_V 0xFFFFFFFF -#define SLC_SLC1_TXLINK_DSCR_BF0_S 0 - -#define SLC_1_TXLINK_DSCR_BF1_REG (DR_REG_SLC_BASE + 0xBC) -/* SLC_SLC1_TXLINK_DSCR_BF1 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define SLC_SLC1_TXLINK_DSCR_BF1 0xFFFFFFFF -#define SLC_SLC1_TXLINK_DSCR_BF1_M ((SLC_SLC1_TXLINK_DSCR_BF1_V)<<(SLC_SLC1_TXLINK_DSCR_BF1_S)) -#define SLC_SLC1_TXLINK_DSCR_BF1_V 0xFFFFFFFF -#define SLC_SLC1_TXLINK_DSCR_BF1_S 0 - -#define SLC_1_RXLINK_DSCR_REG (DR_REG_SLC_BASE + 0xC0) -/* SLC_SLC1_RXLINK_DSCR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define SLC_SLC1_RXLINK_DSCR 0xFFFFFFFF -#define SLC_SLC1_RXLINK_DSCR_M ((SLC_SLC1_RXLINK_DSCR_V)<<(SLC_SLC1_RXLINK_DSCR_S)) -#define SLC_SLC1_RXLINK_DSCR_V 0xFFFFFFFF -#define SLC_SLC1_RXLINK_DSCR_S 0 - -#define SLC_1_RXLINK_DSCR_BF0_REG (DR_REG_SLC_BASE + 0xC4) -/* SLC_SLC1_RXLINK_DSCR_BF0 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define SLC_SLC1_RXLINK_DSCR_BF0 0xFFFFFFFF -#define SLC_SLC1_RXLINK_DSCR_BF0_M ((SLC_SLC1_RXLINK_DSCR_BF0_V)<<(SLC_SLC1_RXLINK_DSCR_BF0_S)) -#define SLC_SLC1_RXLINK_DSCR_BF0_V 0xFFFFFFFF -#define SLC_SLC1_RXLINK_DSCR_BF0_S 0 - -#define SLC_1_RXLINK_DSCR_BF1_REG (DR_REG_SLC_BASE + 0xC8) -/* SLC_SLC1_RXLINK_DSCR_BF1 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define SLC_SLC1_RXLINK_DSCR_BF1 0xFFFFFFFF -#define SLC_SLC1_RXLINK_DSCR_BF1_M ((SLC_SLC1_RXLINK_DSCR_BF1_V)<<(SLC_SLC1_RXLINK_DSCR_BF1_S)) -#define SLC_SLC1_RXLINK_DSCR_BF1_V 0xFFFFFFFF -#define SLC_SLC1_RXLINK_DSCR_BF1_S 0 - -#define SLC_0_TX_ERREOF_DES_ADDR_REG (DR_REG_SLC_BASE + 0xCC) -/* SLC_SLC0_TX_ERR_EOF_DES_ADDR : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define SLC_SLC0_TX_ERR_EOF_DES_ADDR 0xFFFFFFFF -#define SLC_SLC0_TX_ERR_EOF_DES_ADDR_M ((SLC_SLC0_TX_ERR_EOF_DES_ADDR_V)<<(SLC_SLC0_TX_ERR_EOF_DES_ADDR_S)) -#define SLC_SLC0_TX_ERR_EOF_DES_ADDR_V 0xFFFFFFFF -#define SLC_SLC0_TX_ERR_EOF_DES_ADDR_S 0 - -#define SLC_1_TX_ERREOF_DES_ADDR_REG (DR_REG_SLC_BASE + 0xD0) -/* SLC_SLC1_TX_ERR_EOF_DES_ADDR : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define SLC_SLC1_TX_ERR_EOF_DES_ADDR 0xFFFFFFFF -#define SLC_SLC1_TX_ERR_EOF_DES_ADDR_M ((SLC_SLC1_TX_ERR_EOF_DES_ADDR_V)<<(SLC_SLC1_TX_ERR_EOF_DES_ADDR_S)) -#define SLC_SLC1_TX_ERR_EOF_DES_ADDR_V 0xFFFFFFFF -#define SLC_SLC1_TX_ERR_EOF_DES_ADDR_S 0 - -#define SLC_TOKEN_LAT_REG (DR_REG_SLC_BASE + 0xD4) -/* SLC_SLC1_TOKEN : RO ;bitpos:[27:16] ;default: 12'b0 ; */ -/*description: */ -#define SLC_SLC1_TOKEN 0x00000FFF -#define SLC_SLC1_TOKEN_M ((SLC_SLC1_TOKEN_V)<<(SLC_SLC1_TOKEN_S)) -#define SLC_SLC1_TOKEN_V 0xFFF -#define SLC_SLC1_TOKEN_S 16 -/* SLC_SLC0_TOKEN : RO ;bitpos:[11:0] ;default: 12'b0 ; */ -/*description: */ -#define SLC_SLC0_TOKEN 0x00000FFF -#define SLC_SLC0_TOKEN_M ((SLC_SLC0_TOKEN_V)<<(SLC_SLC0_TOKEN_S)) -#define SLC_SLC0_TOKEN_V 0xFFF -#define SLC_SLC0_TOKEN_S 0 - -#define SLC_TX_DSCR_CONF_REG (DR_REG_SLC_BASE + 0xD8) -/* SLC_WR_RETRY_THRESHOLD : R/W ;bitpos:[10:0] ;default: 11'h80 ; */ -/*description: */ -#define SLC_WR_RETRY_THRESHOLD 0x000007FF -#define SLC_WR_RETRY_THRESHOLD_M ((SLC_WR_RETRY_THRESHOLD_V)<<(SLC_WR_RETRY_THRESHOLD_S)) -#define SLC_WR_RETRY_THRESHOLD_V 0x7FF -#define SLC_WR_RETRY_THRESHOLD_S 0 - -#define SLC_CMD_INFOR0_REG (DR_REG_SLC_BASE + 0xDC) -/* SLC_CMD_CONTENT0 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define SLC_CMD_CONTENT0 0xFFFFFFFF -#define SLC_CMD_CONTENT0_M ((SLC_CMD_CONTENT0_V)<<(SLC_CMD_CONTENT0_S)) -#define SLC_CMD_CONTENT0_V 0xFFFFFFFF -#define SLC_CMD_CONTENT0_S 0 - -#define SLC_CMD_INFOR1_REG (DR_REG_SLC_BASE + 0xE0) -/* SLC_CMD_CONTENT1 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define SLC_CMD_CONTENT1 0xFFFFFFFF -#define SLC_CMD_CONTENT1_M ((SLC_CMD_CONTENT1_V)<<(SLC_CMD_CONTENT1_S)) -#define SLC_CMD_CONTENT1_V 0xFFFFFFFF -#define SLC_CMD_CONTENT1_S 0 - -#define SLC_0_LEN_CONF_REG (DR_REG_SLC_BASE + 0xE4) -/* SLC_SLC0_TX_NEW_PKT_IND : RO ;bitpos:[28] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_NEW_PKT_IND (BIT(28)) -#define SLC_SLC0_TX_NEW_PKT_IND_M (BIT(28)) -#define SLC_SLC0_TX_NEW_PKT_IND_V 0x1 -#define SLC_SLC0_TX_NEW_PKT_IND_S 28 -/* SLC_SLC0_RX_NEW_PKT_IND : RO ;bitpos:[27] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_NEW_PKT_IND (BIT(27)) -#define SLC_SLC0_RX_NEW_PKT_IND_M (BIT(27)) -#define SLC_SLC0_RX_NEW_PKT_IND_V 0x1 -#define SLC_SLC0_RX_NEW_PKT_IND_S 27 -/* SLC_SLC0_TX_GET_USED_DSCR : WO ;bitpos:[26] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_GET_USED_DSCR (BIT(26)) -#define SLC_SLC0_TX_GET_USED_DSCR_M (BIT(26)) -#define SLC_SLC0_TX_GET_USED_DSCR_V 0x1 -#define SLC_SLC0_TX_GET_USED_DSCR_S 26 -/* SLC_SLC0_RX_GET_USED_DSCR : WO ;bitpos:[25] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_GET_USED_DSCR (BIT(25)) -#define SLC_SLC0_RX_GET_USED_DSCR_M (BIT(25)) -#define SLC_SLC0_RX_GET_USED_DSCR_V 0x1 -#define SLC_SLC0_RX_GET_USED_DSCR_S 25 -/* SLC_SLC0_TX_PACKET_LOAD_EN : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_PACKET_LOAD_EN (BIT(24)) -#define SLC_SLC0_TX_PACKET_LOAD_EN_M (BIT(24)) -#define SLC_SLC0_TX_PACKET_LOAD_EN_V 0x1 -#define SLC_SLC0_TX_PACKET_LOAD_EN_S 24 -/* SLC_SLC0_RX_PACKET_LOAD_EN : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_PACKET_LOAD_EN (BIT(23)) -#define SLC_SLC0_RX_PACKET_LOAD_EN_M (BIT(23)) -#define SLC_SLC0_RX_PACKET_LOAD_EN_V 0x1 -#define SLC_SLC0_RX_PACKET_LOAD_EN_S 23 -/* SLC_SLC0_LEN_INC_MORE : WO ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_LEN_INC_MORE (BIT(22)) -#define SLC_SLC0_LEN_INC_MORE_M (BIT(22)) -#define SLC_SLC0_LEN_INC_MORE_V 0x1 -#define SLC_SLC0_LEN_INC_MORE_S 22 -/* SLC_SLC0_LEN_INC : WO ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_LEN_INC (BIT(21)) -#define SLC_SLC0_LEN_INC_M (BIT(21)) -#define SLC_SLC0_LEN_INC_V 0x1 -#define SLC_SLC0_LEN_INC_S 21 -/* SLC_SLC0_LEN_WR : WO ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_LEN_WR (BIT(20)) -#define SLC_SLC0_LEN_WR_M (BIT(20)) -#define SLC_SLC0_LEN_WR_V 0x1 -#define SLC_SLC0_LEN_WR_S 20 -/* SLC_SLC0_LEN_WDATA : WO ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: */ -#define SLC_SLC0_LEN_WDATA 0x000FFFFF -#define SLC_SLC0_LEN_WDATA_M ((SLC_SLC0_LEN_WDATA_V)<<(SLC_SLC0_LEN_WDATA_S)) -#define SLC_SLC0_LEN_WDATA_V 0xFFFFF -#define SLC_SLC0_LEN_WDATA_S 0 - -#define SLC_0_LENGTH_REG (DR_REG_SLC_BASE + 0xE8) -/* SLC_SLC0_LEN : RO ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: */ -#define SLC_SLC0_LEN 0x000FFFFF -#define SLC_SLC0_LEN_M ((SLC_SLC0_LEN_V)<<(SLC_SLC0_LEN_S)) -#define SLC_SLC0_LEN_V 0xFFFFF -#define SLC_SLC0_LEN_S 0 - -#define SLC_0_TXPKT_H_DSCR_REG (DR_REG_SLC_BASE + 0xEC) -/* SLC_SLC0_TX_PKT_H_DSCR_ADDR : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define SLC_SLC0_TX_PKT_H_DSCR_ADDR 0xFFFFFFFF -#define SLC_SLC0_TX_PKT_H_DSCR_ADDR_M ((SLC_SLC0_TX_PKT_H_DSCR_ADDR_V)<<(SLC_SLC0_TX_PKT_H_DSCR_ADDR_S)) -#define SLC_SLC0_TX_PKT_H_DSCR_ADDR_V 0xFFFFFFFF -#define SLC_SLC0_TX_PKT_H_DSCR_ADDR_S 0 - -#define SLC_0_TXPKT_E_DSCR_REG (DR_REG_SLC_BASE + 0xF0) -/* SLC_SLC0_TX_PKT_E_DSCR_ADDR : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define SLC_SLC0_TX_PKT_E_DSCR_ADDR 0xFFFFFFFF -#define SLC_SLC0_TX_PKT_E_DSCR_ADDR_M ((SLC_SLC0_TX_PKT_E_DSCR_ADDR_V)<<(SLC_SLC0_TX_PKT_E_DSCR_ADDR_S)) -#define SLC_SLC0_TX_PKT_E_DSCR_ADDR_V 0xFFFFFFFF -#define SLC_SLC0_TX_PKT_E_DSCR_ADDR_S 0 - -#define SLC_0_RXPKT_H_DSCR_REG (DR_REG_SLC_BASE + 0xF4) -/* SLC_SLC0_RX_PKT_H_DSCR_ADDR : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define SLC_SLC0_RX_PKT_H_DSCR_ADDR 0xFFFFFFFF -#define SLC_SLC0_RX_PKT_H_DSCR_ADDR_M ((SLC_SLC0_RX_PKT_H_DSCR_ADDR_V)<<(SLC_SLC0_RX_PKT_H_DSCR_ADDR_S)) -#define SLC_SLC0_RX_PKT_H_DSCR_ADDR_V 0xFFFFFFFF -#define SLC_SLC0_RX_PKT_H_DSCR_ADDR_S 0 - -#define SLC_0_RXPKT_E_DSCR_REG (DR_REG_SLC_BASE + 0xF8) -/* SLC_SLC0_RX_PKT_E_DSCR_ADDR : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define SLC_SLC0_RX_PKT_E_DSCR_ADDR 0xFFFFFFFF -#define SLC_SLC0_RX_PKT_E_DSCR_ADDR_M ((SLC_SLC0_RX_PKT_E_DSCR_ADDR_V)<<(SLC_SLC0_RX_PKT_E_DSCR_ADDR_S)) -#define SLC_SLC0_RX_PKT_E_DSCR_ADDR_V 0xFFFFFFFF -#define SLC_SLC0_RX_PKT_E_DSCR_ADDR_S 0 - -#define SLC_0_TXPKTU_H_DSCR_REG (DR_REG_SLC_BASE + 0xFC) -/* SLC_SLC0_TX_PKT_START_DSCR_ADDR : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define SLC_SLC0_TX_PKT_START_DSCR_ADDR 0xFFFFFFFF -#define SLC_SLC0_TX_PKT_START_DSCR_ADDR_M ((SLC_SLC0_TX_PKT_START_DSCR_ADDR_V)<<(SLC_SLC0_TX_PKT_START_DSCR_ADDR_S)) -#define SLC_SLC0_TX_PKT_START_DSCR_ADDR_V 0xFFFFFFFF -#define SLC_SLC0_TX_PKT_START_DSCR_ADDR_S 0 - -#define SLC_0_TXPKTU_E_DSCR_REG (DR_REG_SLC_BASE + 0x100) -/* SLC_SLC0_TX_PKT_END_DSCR_ADDR : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define SLC_SLC0_TX_PKT_END_DSCR_ADDR 0xFFFFFFFF -#define SLC_SLC0_TX_PKT_END_DSCR_ADDR_M ((SLC_SLC0_TX_PKT_END_DSCR_ADDR_V)<<(SLC_SLC0_TX_PKT_END_DSCR_ADDR_S)) -#define SLC_SLC0_TX_PKT_END_DSCR_ADDR_V 0xFFFFFFFF -#define SLC_SLC0_TX_PKT_END_DSCR_ADDR_S 0 - -#define SLC_0_RXPKTU_H_DSCR_REG (DR_REG_SLC_BASE + 0x104) -/* SLC_SLC0_RX_PKT_START_DSCR_ADDR : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define SLC_SLC0_RX_PKT_START_DSCR_ADDR 0xFFFFFFFF -#define SLC_SLC0_RX_PKT_START_DSCR_ADDR_M ((SLC_SLC0_RX_PKT_START_DSCR_ADDR_V)<<(SLC_SLC0_RX_PKT_START_DSCR_ADDR_S)) -#define SLC_SLC0_RX_PKT_START_DSCR_ADDR_V 0xFFFFFFFF -#define SLC_SLC0_RX_PKT_START_DSCR_ADDR_S 0 - -#define SLC_0_RXPKTU_E_DSCR_REG (DR_REG_SLC_BASE + 0x108) -/* SLC_SLC0_RX_PKT_END_DSCR_ADDR : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define SLC_SLC0_RX_PKT_END_DSCR_ADDR 0xFFFFFFFF -#define SLC_SLC0_RX_PKT_END_DSCR_ADDR_M ((SLC_SLC0_RX_PKT_END_DSCR_ADDR_V)<<(SLC_SLC0_RX_PKT_END_DSCR_ADDR_S)) -#define SLC_SLC0_RX_PKT_END_DSCR_ADDR_V 0xFFFFFFFF -#define SLC_SLC0_RX_PKT_END_DSCR_ADDR_S 0 - -#define SLC_SEQ_POSITION_REG (DR_REG_SLC_BASE + 0x114) -/* SLC_SLC1_SEQ_POSITION : R/W ;bitpos:[15:8] ;default: 8'h5 ; */ -/*description: */ -#define SLC_SLC1_SEQ_POSITION 0x000000FF -#define SLC_SLC1_SEQ_POSITION_M ((SLC_SLC1_SEQ_POSITION_V)<<(SLC_SLC1_SEQ_POSITION_S)) -#define SLC_SLC1_SEQ_POSITION_V 0xFF -#define SLC_SLC1_SEQ_POSITION_S 8 -/* SLC_SLC0_SEQ_POSITION : R/W ;bitpos:[7:0] ;default: 8'h9 ; */ -/*description: */ -#define SLC_SLC0_SEQ_POSITION 0x000000FF -#define SLC_SLC0_SEQ_POSITION_M ((SLC_SLC0_SEQ_POSITION_V)<<(SLC_SLC0_SEQ_POSITION_S)) -#define SLC_SLC0_SEQ_POSITION_V 0xFF -#define SLC_SLC0_SEQ_POSITION_S 0 - -#define SLC_0_DSCR_REC_CONF_REG (DR_REG_SLC_BASE + 0x118) -/* SLC_SLC0_RX_DSCR_REC_LIM : R/W ;bitpos:[9:0] ;default: 10'h3ff ; */ -/*description: */ -#define SLC_SLC0_RX_DSCR_REC_LIM 0x000003FF -#define SLC_SLC0_RX_DSCR_REC_LIM_M ((SLC_SLC0_RX_DSCR_REC_LIM_V)<<(SLC_SLC0_RX_DSCR_REC_LIM_S)) -#define SLC_SLC0_RX_DSCR_REC_LIM_V 0x3FF -#define SLC_SLC0_RX_DSCR_REC_LIM_S 0 - -#define SLC_SDIO_CRC_ST0_REG (DR_REG_SLC_BASE + 0x11C) -/* SLC_DAT3_CRC_ERR_CNT : RO ;bitpos:[31:24] ;default: 8'h0 ; */ -/*description: */ -#define SLC_DAT3_CRC_ERR_CNT 0x000000FF -#define SLC_DAT3_CRC_ERR_CNT_M ((SLC_DAT3_CRC_ERR_CNT_V)<<(SLC_DAT3_CRC_ERR_CNT_S)) -#define SLC_DAT3_CRC_ERR_CNT_V 0xFF -#define SLC_DAT3_CRC_ERR_CNT_S 24 -/* SLC_DAT2_CRC_ERR_CNT : RO ;bitpos:[23:16] ;default: 8'h0 ; */ -/*description: */ -#define SLC_DAT2_CRC_ERR_CNT 0x000000FF -#define SLC_DAT2_CRC_ERR_CNT_M ((SLC_DAT2_CRC_ERR_CNT_V)<<(SLC_DAT2_CRC_ERR_CNT_S)) -#define SLC_DAT2_CRC_ERR_CNT_V 0xFF -#define SLC_DAT2_CRC_ERR_CNT_S 16 -/* SLC_DAT1_CRC_ERR_CNT : RO ;bitpos:[15:8] ;default: 8'h0 ; */ -/*description: */ -#define SLC_DAT1_CRC_ERR_CNT 0x000000FF -#define SLC_DAT1_CRC_ERR_CNT_M ((SLC_DAT1_CRC_ERR_CNT_V)<<(SLC_DAT1_CRC_ERR_CNT_S)) -#define SLC_DAT1_CRC_ERR_CNT_V 0xFF -#define SLC_DAT1_CRC_ERR_CNT_S 8 -/* SLC_DAT0_CRC_ERR_CNT : RO ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define SLC_DAT0_CRC_ERR_CNT 0x000000FF -#define SLC_DAT0_CRC_ERR_CNT_M ((SLC_DAT0_CRC_ERR_CNT_V)<<(SLC_DAT0_CRC_ERR_CNT_S)) -#define SLC_DAT0_CRC_ERR_CNT_V 0xFF -#define SLC_DAT0_CRC_ERR_CNT_S 0 - -#define SLC_SDIO_CRC_ST1_REG (DR_REG_SLC_BASE + 0x120) -/* SLC_ERR_CNT_CLR : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: */ -#define SLC_ERR_CNT_CLR (BIT(31)) -#define SLC_ERR_CNT_CLR_M (BIT(31)) -#define SLC_ERR_CNT_CLR_V 0x1 -#define SLC_ERR_CNT_CLR_S 31 -/* SLC_CMD_CRC_ERR_CNT : RO ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: */ -#define SLC_CMD_CRC_ERR_CNT 0x000000FF -#define SLC_CMD_CRC_ERR_CNT_M ((SLC_CMD_CRC_ERR_CNT_V)<<(SLC_CMD_CRC_ERR_CNT_S)) -#define SLC_CMD_CRC_ERR_CNT_V 0xFF -#define SLC_CMD_CRC_ERR_CNT_S 0 - -#define SLC_0_EOF_START_DES_REG (DR_REG_SLC_BASE + 0x124) -/* SLC_SLC0_EOF_START_DES_ADDR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define SLC_SLC0_EOF_START_DES_ADDR 0xFFFFFFFF -#define SLC_SLC0_EOF_START_DES_ADDR_M ((SLC_SLC0_EOF_START_DES_ADDR_V)<<(SLC_SLC0_EOF_START_DES_ADDR_S)) -#define SLC_SLC0_EOF_START_DES_ADDR_V 0xFFFFFFFF -#define SLC_SLC0_EOF_START_DES_ADDR_S 0 - -#define SLC_0_PUSH_DSCR_ADDR_REG (DR_REG_SLC_BASE + 0x128) -/* SLC_SLC0_RX_PUSH_DSCR_ADDR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_PUSH_DSCR_ADDR 0xFFFFFFFF -#define SLC_SLC0_RX_PUSH_DSCR_ADDR_M ((SLC_SLC0_RX_PUSH_DSCR_ADDR_V)<<(SLC_SLC0_RX_PUSH_DSCR_ADDR_S)) -#define SLC_SLC0_RX_PUSH_DSCR_ADDR_V 0xFFFFFFFF -#define SLC_SLC0_RX_PUSH_DSCR_ADDR_S 0 - -#define SLC_0_DONE_DSCR_ADDR_REG (DR_REG_SLC_BASE + 0x12C) -/* SLC_SLC0_RX_DONE_DSCR_ADDR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_DONE_DSCR_ADDR 0xFFFFFFFF -#define SLC_SLC0_RX_DONE_DSCR_ADDR_M ((SLC_SLC0_RX_DONE_DSCR_ADDR_V)<<(SLC_SLC0_RX_DONE_DSCR_ADDR_S)) -#define SLC_SLC0_RX_DONE_DSCR_ADDR_V 0xFFFFFFFF -#define SLC_SLC0_RX_DONE_DSCR_ADDR_S 0 - -#define SLC_0_SUB_START_DES_REG (DR_REG_SLC_BASE + 0x130) -/* SLC_SLC0_SUB_PAC_START_DSCR_ADDR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: */ -#define SLC_SLC0_SUB_PAC_START_DSCR_ADDR 0xFFFFFFFF -#define SLC_SLC0_SUB_PAC_START_DSCR_ADDR_M ((SLC_SLC0_SUB_PAC_START_DSCR_ADDR_V)<<(SLC_SLC0_SUB_PAC_START_DSCR_ADDR_S)) -#define SLC_SLC0_SUB_PAC_START_DSCR_ADDR_V 0xFFFFFFFF -#define SLC_SLC0_SUB_PAC_START_DSCR_ADDR_S 0 - -#define SLC_0_DSCR_CNT_REG (DR_REG_SLC_BASE + 0x134) -/* SLC_SLC0_RX_GET_EOF_OCC : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_GET_EOF_OCC (BIT(16)) -#define SLC_SLC0_RX_GET_EOF_OCC_M (BIT(16)) -#define SLC_SLC0_RX_GET_EOF_OCC_V 0x1 -#define SLC_SLC0_RX_GET_EOF_OCC_S 16 -/* SLC_SLC0_RX_DSCR_CNT_LAT : RO ;bitpos:[9:0] ;default: 10'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_DSCR_CNT_LAT 0x000003FF -#define SLC_SLC0_RX_DSCR_CNT_LAT_M ((SLC_SLC0_RX_DSCR_CNT_LAT_V)<<(SLC_SLC0_RX_DSCR_CNT_LAT_S)) -#define SLC_SLC0_RX_DSCR_CNT_LAT_V 0x3FF -#define SLC_SLC0_RX_DSCR_CNT_LAT_S 0 - -#define SLC_0_LEN_LIM_CONF_REG (DR_REG_SLC_BASE + 0x138) -/* SLC_SLC0_LEN_LIM : R/W ;bitpos:[19:0] ;default: 20'h5400 ; */ -/*description: */ -#define SLC_SLC0_LEN_LIM 0x000FFFFF -#define SLC_SLC0_LEN_LIM_M ((SLC_SLC0_LEN_LIM_V)<<(SLC_SLC0_LEN_LIM_S)) -#define SLC_SLC0_LEN_LIM_V 0xFFFFF -#define SLC_SLC0_LEN_LIM_S 0 - -#define SLC_0INT_ST1_REG (DR_REG_SLC_BASE + 0x13C) -/* SLC_SLC0_RX_QUICK_EOF_INT_ST1 : RO ;bitpos:[26] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_QUICK_EOF_INT_ST1 (BIT(26)) -#define SLC_SLC0_RX_QUICK_EOF_INT_ST1_M (BIT(26)) -#define SLC_SLC0_RX_QUICK_EOF_INT_ST1_V 0x1 -#define SLC_SLC0_RX_QUICK_EOF_INT_ST1_S 26 -/* SLC_CMD_DTC_INT_ST1 : RO ;bitpos:[25] ;default: 1'b0 ; */ -/*description: */ -#define SLC_CMD_DTC_INT_ST1 (BIT(25)) -#define SLC_CMD_DTC_INT_ST1_M (BIT(25)) -#define SLC_CMD_DTC_INT_ST1_V 0x1 -#define SLC_CMD_DTC_INT_ST1_S 25 -/* SLC_SLC0_TX_ERR_EOF_INT_ST1 : RO ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_ERR_EOF_INT_ST1 (BIT(24)) -#define SLC_SLC0_TX_ERR_EOF_INT_ST1_M (BIT(24)) -#define SLC_SLC0_TX_ERR_EOF_INT_ST1_V 0x1 -#define SLC_SLC0_TX_ERR_EOF_INT_ST1_S 24 -/* SLC_SLC0_WR_RETRY_DONE_INT_ST1 : RO ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_WR_RETRY_DONE_INT_ST1 (BIT(23)) -#define SLC_SLC0_WR_RETRY_DONE_INT_ST1_M (BIT(23)) -#define SLC_SLC0_WR_RETRY_DONE_INT_ST1_V 0x1 -#define SLC_SLC0_WR_RETRY_DONE_INT_ST1_S 23 -/* SLC_SLC0_HOST_RD_ACK_INT_ST1 : RO ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_HOST_RD_ACK_INT_ST1 (BIT(22)) -#define SLC_SLC0_HOST_RD_ACK_INT_ST1_M (BIT(22)) -#define SLC_SLC0_HOST_RD_ACK_INT_ST1_V 0x1 -#define SLC_SLC0_HOST_RD_ACK_INT_ST1_S 22 -/* SLC_SLC0_TX_DSCR_EMPTY_INT_ST1 : RO ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_DSCR_EMPTY_INT_ST1 (BIT(21)) -#define SLC_SLC0_TX_DSCR_EMPTY_INT_ST1_M (BIT(21)) -#define SLC_SLC0_TX_DSCR_EMPTY_INT_ST1_V 0x1 -#define SLC_SLC0_TX_DSCR_EMPTY_INT_ST1_S 21 -/* SLC_SLC0_RX_DSCR_ERR_INT_ST1 : RO ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_DSCR_ERR_INT_ST1 (BIT(20)) -#define SLC_SLC0_RX_DSCR_ERR_INT_ST1_M (BIT(20)) -#define SLC_SLC0_RX_DSCR_ERR_INT_ST1_V 0x1 -#define SLC_SLC0_RX_DSCR_ERR_INT_ST1_S 20 -/* SLC_SLC0_TX_DSCR_ERR_INT_ST1 : RO ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_DSCR_ERR_INT_ST1 (BIT(19)) -#define SLC_SLC0_TX_DSCR_ERR_INT_ST1_M (BIT(19)) -#define SLC_SLC0_TX_DSCR_ERR_INT_ST1_V 0x1 -#define SLC_SLC0_TX_DSCR_ERR_INT_ST1_S 19 -/* SLC_SLC0_TOHOST_INT_ST1 : RO ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TOHOST_INT_ST1 (BIT(18)) -#define SLC_SLC0_TOHOST_INT_ST1_M (BIT(18)) -#define SLC_SLC0_TOHOST_INT_ST1_V 0x1 -#define SLC_SLC0_TOHOST_INT_ST1_S 18 -/* SLC_SLC0_RX_EOF_INT_ST1 : RO ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_EOF_INT_ST1 (BIT(17)) -#define SLC_SLC0_RX_EOF_INT_ST1_M (BIT(17)) -#define SLC_SLC0_RX_EOF_INT_ST1_V 0x1 -#define SLC_SLC0_RX_EOF_INT_ST1_S 17 -/* SLC_SLC0_RX_DONE_INT_ST1 : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_DONE_INT_ST1 (BIT(16)) -#define SLC_SLC0_RX_DONE_INT_ST1_M (BIT(16)) -#define SLC_SLC0_RX_DONE_INT_ST1_V 0x1 -#define SLC_SLC0_RX_DONE_INT_ST1_S 16 -/* SLC_SLC0_TX_SUC_EOF_INT_ST1 : RO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_SUC_EOF_INT_ST1 (BIT(15)) -#define SLC_SLC0_TX_SUC_EOF_INT_ST1_M (BIT(15)) -#define SLC_SLC0_TX_SUC_EOF_INT_ST1_V 0x1 -#define SLC_SLC0_TX_SUC_EOF_INT_ST1_S 15 -/* SLC_SLC0_TX_DONE_INT_ST1 : RO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_DONE_INT_ST1 (BIT(14)) -#define SLC_SLC0_TX_DONE_INT_ST1_M (BIT(14)) -#define SLC_SLC0_TX_DONE_INT_ST1_V 0x1 -#define SLC_SLC0_TX_DONE_INT_ST1_S 14 -/* SLC_SLC0_TOKEN1_1TO0_INT_ST1 : RO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TOKEN1_1TO0_INT_ST1 (BIT(13)) -#define SLC_SLC0_TOKEN1_1TO0_INT_ST1_M (BIT(13)) -#define SLC_SLC0_TOKEN1_1TO0_INT_ST1_V 0x1 -#define SLC_SLC0_TOKEN1_1TO0_INT_ST1_S 13 -/* SLC_SLC0_TOKEN0_1TO0_INT_ST1 : RO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TOKEN0_1TO0_INT_ST1 (BIT(12)) -#define SLC_SLC0_TOKEN0_1TO0_INT_ST1_M (BIT(12)) -#define SLC_SLC0_TOKEN0_1TO0_INT_ST1_V 0x1 -#define SLC_SLC0_TOKEN0_1TO0_INT_ST1_S 12 -/* SLC_SLC0_TX_OVF_INT_ST1 : RO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_OVF_INT_ST1 (BIT(11)) -#define SLC_SLC0_TX_OVF_INT_ST1_M (BIT(11)) -#define SLC_SLC0_TX_OVF_INT_ST1_V 0x1 -#define SLC_SLC0_TX_OVF_INT_ST1_S 11 -/* SLC_SLC0_RX_UDF_INT_ST1 : RO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_UDF_INT_ST1 (BIT(10)) -#define SLC_SLC0_RX_UDF_INT_ST1_M (BIT(10)) -#define SLC_SLC0_RX_UDF_INT_ST1_V 0x1 -#define SLC_SLC0_RX_UDF_INT_ST1_S 10 -/* SLC_SLC0_TX_START_INT_ST1 : RO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_START_INT_ST1 (BIT(9)) -#define SLC_SLC0_TX_START_INT_ST1_M (BIT(9)) -#define SLC_SLC0_TX_START_INT_ST1_V 0x1 -#define SLC_SLC0_TX_START_INT_ST1_S 9 -/* SLC_SLC0_RX_START_INT_ST1 : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_START_INT_ST1 (BIT(8)) -#define SLC_SLC0_RX_START_INT_ST1_M (BIT(8)) -#define SLC_SLC0_RX_START_INT_ST1_V 0x1 -#define SLC_SLC0_RX_START_INT_ST1_S 8 -/* SLC_FRHOST_BIT7_INT_ST1 : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT7_INT_ST1 (BIT(7)) -#define SLC_FRHOST_BIT7_INT_ST1_M (BIT(7)) -#define SLC_FRHOST_BIT7_INT_ST1_V 0x1 -#define SLC_FRHOST_BIT7_INT_ST1_S 7 -/* SLC_FRHOST_BIT6_INT_ST1 : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT6_INT_ST1 (BIT(6)) -#define SLC_FRHOST_BIT6_INT_ST1_M (BIT(6)) -#define SLC_FRHOST_BIT6_INT_ST1_V 0x1 -#define SLC_FRHOST_BIT6_INT_ST1_S 6 -/* SLC_FRHOST_BIT5_INT_ST1 : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT5_INT_ST1 (BIT(5)) -#define SLC_FRHOST_BIT5_INT_ST1_M (BIT(5)) -#define SLC_FRHOST_BIT5_INT_ST1_V 0x1 -#define SLC_FRHOST_BIT5_INT_ST1_S 5 -/* SLC_FRHOST_BIT4_INT_ST1 : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT4_INT_ST1 (BIT(4)) -#define SLC_FRHOST_BIT4_INT_ST1_M (BIT(4)) -#define SLC_FRHOST_BIT4_INT_ST1_V 0x1 -#define SLC_FRHOST_BIT4_INT_ST1_S 4 -/* SLC_FRHOST_BIT3_INT_ST1 : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT3_INT_ST1 (BIT(3)) -#define SLC_FRHOST_BIT3_INT_ST1_M (BIT(3)) -#define SLC_FRHOST_BIT3_INT_ST1_V 0x1 -#define SLC_FRHOST_BIT3_INT_ST1_S 3 -/* SLC_FRHOST_BIT2_INT_ST1 : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT2_INT_ST1 (BIT(2)) -#define SLC_FRHOST_BIT2_INT_ST1_M (BIT(2)) -#define SLC_FRHOST_BIT2_INT_ST1_V 0x1 -#define SLC_FRHOST_BIT2_INT_ST1_S 2 -/* SLC_FRHOST_BIT1_INT_ST1 : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT1_INT_ST1 (BIT(1)) -#define SLC_FRHOST_BIT1_INT_ST1_M (BIT(1)) -#define SLC_FRHOST_BIT1_INT_ST1_V 0x1 -#define SLC_FRHOST_BIT1_INT_ST1_S 1 -/* SLC_FRHOST_BIT0_INT_ST1 : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT0_INT_ST1 (BIT(0)) -#define SLC_FRHOST_BIT0_INT_ST1_M (BIT(0)) -#define SLC_FRHOST_BIT0_INT_ST1_V 0x1 -#define SLC_FRHOST_BIT0_INT_ST1_S 0 - -#define SLC_0INT_ENA1_REG (DR_REG_SLC_BASE + 0x140) -/* SLC_SLC0_RX_QUICK_EOF_INT_ENA1 : R/W ;bitpos:[26] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_QUICK_EOF_INT_ENA1 (BIT(26)) -#define SLC_SLC0_RX_QUICK_EOF_INT_ENA1_M (BIT(26)) -#define SLC_SLC0_RX_QUICK_EOF_INT_ENA1_V 0x1 -#define SLC_SLC0_RX_QUICK_EOF_INT_ENA1_S 26 -/* SLC_CMD_DTC_INT_ENA1 : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: */ -#define SLC_CMD_DTC_INT_ENA1 (BIT(25)) -#define SLC_CMD_DTC_INT_ENA1_M (BIT(25)) -#define SLC_CMD_DTC_INT_ENA1_V 0x1 -#define SLC_CMD_DTC_INT_ENA1_S 25 -/* SLC_SLC0_TX_ERR_EOF_INT_ENA1 : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_ERR_EOF_INT_ENA1 (BIT(24)) -#define SLC_SLC0_TX_ERR_EOF_INT_ENA1_M (BIT(24)) -#define SLC_SLC0_TX_ERR_EOF_INT_ENA1_V 0x1 -#define SLC_SLC0_TX_ERR_EOF_INT_ENA1_S 24 -/* SLC_SLC0_WR_RETRY_DONE_INT_ENA1 : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_WR_RETRY_DONE_INT_ENA1 (BIT(23)) -#define SLC_SLC0_WR_RETRY_DONE_INT_ENA1_M (BIT(23)) -#define SLC_SLC0_WR_RETRY_DONE_INT_ENA1_V 0x1 -#define SLC_SLC0_WR_RETRY_DONE_INT_ENA1_S 23 -/* SLC_SLC0_HOST_RD_ACK_INT_ENA1 : R/W ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_HOST_RD_ACK_INT_ENA1 (BIT(22)) -#define SLC_SLC0_HOST_RD_ACK_INT_ENA1_M (BIT(22)) -#define SLC_SLC0_HOST_RD_ACK_INT_ENA1_V 0x1 -#define SLC_SLC0_HOST_RD_ACK_INT_ENA1_S 22 -/* SLC_SLC0_TX_DSCR_EMPTY_INT_ENA1 : R/W ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_DSCR_EMPTY_INT_ENA1 (BIT(21)) -#define SLC_SLC0_TX_DSCR_EMPTY_INT_ENA1_M (BIT(21)) -#define SLC_SLC0_TX_DSCR_EMPTY_INT_ENA1_V 0x1 -#define SLC_SLC0_TX_DSCR_EMPTY_INT_ENA1_S 21 -/* SLC_SLC0_RX_DSCR_ERR_INT_ENA1 : R/W ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_DSCR_ERR_INT_ENA1 (BIT(20)) -#define SLC_SLC0_RX_DSCR_ERR_INT_ENA1_M (BIT(20)) -#define SLC_SLC0_RX_DSCR_ERR_INT_ENA1_V 0x1 -#define SLC_SLC0_RX_DSCR_ERR_INT_ENA1_S 20 -/* SLC_SLC0_TX_DSCR_ERR_INT_ENA1 : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_DSCR_ERR_INT_ENA1 (BIT(19)) -#define SLC_SLC0_TX_DSCR_ERR_INT_ENA1_M (BIT(19)) -#define SLC_SLC0_TX_DSCR_ERR_INT_ENA1_V 0x1 -#define SLC_SLC0_TX_DSCR_ERR_INT_ENA1_S 19 -/* SLC_SLC0_TOHOST_INT_ENA1 : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TOHOST_INT_ENA1 (BIT(18)) -#define SLC_SLC0_TOHOST_INT_ENA1_M (BIT(18)) -#define SLC_SLC0_TOHOST_INT_ENA1_V 0x1 -#define SLC_SLC0_TOHOST_INT_ENA1_S 18 -/* SLC_SLC0_RX_EOF_INT_ENA1 : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_EOF_INT_ENA1 (BIT(17)) -#define SLC_SLC0_RX_EOF_INT_ENA1_M (BIT(17)) -#define SLC_SLC0_RX_EOF_INT_ENA1_V 0x1 -#define SLC_SLC0_RX_EOF_INT_ENA1_S 17 -/* SLC_SLC0_RX_DONE_INT_ENA1 : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_DONE_INT_ENA1 (BIT(16)) -#define SLC_SLC0_RX_DONE_INT_ENA1_M (BIT(16)) -#define SLC_SLC0_RX_DONE_INT_ENA1_V 0x1 -#define SLC_SLC0_RX_DONE_INT_ENA1_S 16 -/* SLC_SLC0_TX_SUC_EOF_INT_ENA1 : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_SUC_EOF_INT_ENA1 (BIT(15)) -#define SLC_SLC0_TX_SUC_EOF_INT_ENA1_M (BIT(15)) -#define SLC_SLC0_TX_SUC_EOF_INT_ENA1_V 0x1 -#define SLC_SLC0_TX_SUC_EOF_INT_ENA1_S 15 -/* SLC_SLC0_TX_DONE_INT_ENA1 : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_DONE_INT_ENA1 (BIT(14)) -#define SLC_SLC0_TX_DONE_INT_ENA1_M (BIT(14)) -#define SLC_SLC0_TX_DONE_INT_ENA1_V 0x1 -#define SLC_SLC0_TX_DONE_INT_ENA1_S 14 -/* SLC_SLC0_TOKEN1_1TO0_INT_ENA1 : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TOKEN1_1TO0_INT_ENA1 (BIT(13)) -#define SLC_SLC0_TOKEN1_1TO0_INT_ENA1_M (BIT(13)) -#define SLC_SLC0_TOKEN1_1TO0_INT_ENA1_V 0x1 -#define SLC_SLC0_TOKEN1_1TO0_INT_ENA1_S 13 -/* SLC_SLC0_TOKEN0_1TO0_INT_ENA1 : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TOKEN0_1TO0_INT_ENA1 (BIT(12)) -#define SLC_SLC0_TOKEN0_1TO0_INT_ENA1_M (BIT(12)) -#define SLC_SLC0_TOKEN0_1TO0_INT_ENA1_V 0x1 -#define SLC_SLC0_TOKEN0_1TO0_INT_ENA1_S 12 -/* SLC_SLC0_TX_OVF_INT_ENA1 : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_OVF_INT_ENA1 (BIT(11)) -#define SLC_SLC0_TX_OVF_INT_ENA1_M (BIT(11)) -#define SLC_SLC0_TX_OVF_INT_ENA1_V 0x1 -#define SLC_SLC0_TX_OVF_INT_ENA1_S 11 -/* SLC_SLC0_RX_UDF_INT_ENA1 : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_UDF_INT_ENA1 (BIT(10)) -#define SLC_SLC0_RX_UDF_INT_ENA1_M (BIT(10)) -#define SLC_SLC0_RX_UDF_INT_ENA1_V 0x1 -#define SLC_SLC0_RX_UDF_INT_ENA1_S 10 -/* SLC_SLC0_TX_START_INT_ENA1 : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_TX_START_INT_ENA1 (BIT(9)) -#define SLC_SLC0_TX_START_INT_ENA1_M (BIT(9)) -#define SLC_SLC0_TX_START_INT_ENA1_V 0x1 -#define SLC_SLC0_TX_START_INT_ENA1_S 9 -/* SLC_SLC0_RX_START_INT_ENA1 : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC0_RX_START_INT_ENA1 (BIT(8)) -#define SLC_SLC0_RX_START_INT_ENA1_M (BIT(8)) -#define SLC_SLC0_RX_START_INT_ENA1_V 0x1 -#define SLC_SLC0_RX_START_INT_ENA1_S 8 -/* SLC_FRHOST_BIT7_INT_ENA1 : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT7_INT_ENA1 (BIT(7)) -#define SLC_FRHOST_BIT7_INT_ENA1_M (BIT(7)) -#define SLC_FRHOST_BIT7_INT_ENA1_V 0x1 -#define SLC_FRHOST_BIT7_INT_ENA1_S 7 -/* SLC_FRHOST_BIT6_INT_ENA1 : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT6_INT_ENA1 (BIT(6)) -#define SLC_FRHOST_BIT6_INT_ENA1_M (BIT(6)) -#define SLC_FRHOST_BIT6_INT_ENA1_V 0x1 -#define SLC_FRHOST_BIT6_INT_ENA1_S 6 -/* SLC_FRHOST_BIT5_INT_ENA1 : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT5_INT_ENA1 (BIT(5)) -#define SLC_FRHOST_BIT5_INT_ENA1_M (BIT(5)) -#define SLC_FRHOST_BIT5_INT_ENA1_V 0x1 -#define SLC_FRHOST_BIT5_INT_ENA1_S 5 -/* SLC_FRHOST_BIT4_INT_ENA1 : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT4_INT_ENA1 (BIT(4)) -#define SLC_FRHOST_BIT4_INT_ENA1_M (BIT(4)) -#define SLC_FRHOST_BIT4_INT_ENA1_V 0x1 -#define SLC_FRHOST_BIT4_INT_ENA1_S 4 -/* SLC_FRHOST_BIT3_INT_ENA1 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT3_INT_ENA1 (BIT(3)) -#define SLC_FRHOST_BIT3_INT_ENA1_M (BIT(3)) -#define SLC_FRHOST_BIT3_INT_ENA1_V 0x1 -#define SLC_FRHOST_BIT3_INT_ENA1_S 3 -/* SLC_FRHOST_BIT2_INT_ENA1 : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT2_INT_ENA1 (BIT(2)) -#define SLC_FRHOST_BIT2_INT_ENA1_M (BIT(2)) -#define SLC_FRHOST_BIT2_INT_ENA1_V 0x1 -#define SLC_FRHOST_BIT2_INT_ENA1_S 2 -/* SLC_FRHOST_BIT1_INT_ENA1 : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT1_INT_ENA1 (BIT(1)) -#define SLC_FRHOST_BIT1_INT_ENA1_M (BIT(1)) -#define SLC_FRHOST_BIT1_INT_ENA1_V 0x1 -#define SLC_FRHOST_BIT1_INT_ENA1_S 1 -/* SLC_FRHOST_BIT0_INT_ENA1 : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT0_INT_ENA1 (BIT(0)) -#define SLC_FRHOST_BIT0_INT_ENA1_M (BIT(0)) -#define SLC_FRHOST_BIT0_INT_ENA1_V 0x1 -#define SLC_FRHOST_BIT0_INT_ENA1_S 0 - -#define SLC_1INT_ST1_REG (DR_REG_SLC_BASE + 0x144) -/* SLC_SLC1_TX_ERR_EOF_INT_ST1 : RO ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_ERR_EOF_INT_ST1 (BIT(24)) -#define SLC_SLC1_TX_ERR_EOF_INT_ST1_M (BIT(24)) -#define SLC_SLC1_TX_ERR_EOF_INT_ST1_V 0x1 -#define SLC_SLC1_TX_ERR_EOF_INT_ST1_S 24 -/* SLC_SLC1_WR_RETRY_DONE_INT_ST1 : RO ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_WR_RETRY_DONE_INT_ST1 (BIT(23)) -#define SLC_SLC1_WR_RETRY_DONE_INT_ST1_M (BIT(23)) -#define SLC_SLC1_WR_RETRY_DONE_INT_ST1_V 0x1 -#define SLC_SLC1_WR_RETRY_DONE_INT_ST1_S 23 -/* SLC_SLC1_HOST_RD_ACK_INT_ST1 : RO ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_HOST_RD_ACK_INT_ST1 (BIT(22)) -#define SLC_SLC1_HOST_RD_ACK_INT_ST1_M (BIT(22)) -#define SLC_SLC1_HOST_RD_ACK_INT_ST1_V 0x1 -#define SLC_SLC1_HOST_RD_ACK_INT_ST1_S 22 -/* SLC_SLC1_TX_DSCR_EMPTY_INT_ST1 : RO ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_DSCR_EMPTY_INT_ST1 (BIT(21)) -#define SLC_SLC1_TX_DSCR_EMPTY_INT_ST1_M (BIT(21)) -#define SLC_SLC1_TX_DSCR_EMPTY_INT_ST1_V 0x1 -#define SLC_SLC1_TX_DSCR_EMPTY_INT_ST1_S 21 -/* SLC_SLC1_RX_DSCR_ERR_INT_ST1 : RO ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_DSCR_ERR_INT_ST1 (BIT(20)) -#define SLC_SLC1_RX_DSCR_ERR_INT_ST1_M (BIT(20)) -#define SLC_SLC1_RX_DSCR_ERR_INT_ST1_V 0x1 -#define SLC_SLC1_RX_DSCR_ERR_INT_ST1_S 20 -/* SLC_SLC1_TX_DSCR_ERR_INT_ST1 : RO ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_DSCR_ERR_INT_ST1 (BIT(19)) -#define SLC_SLC1_TX_DSCR_ERR_INT_ST1_M (BIT(19)) -#define SLC_SLC1_TX_DSCR_ERR_INT_ST1_V 0x1 -#define SLC_SLC1_TX_DSCR_ERR_INT_ST1_S 19 -/* SLC_SLC1_TOHOST_INT_ST1 : RO ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TOHOST_INT_ST1 (BIT(18)) -#define SLC_SLC1_TOHOST_INT_ST1_M (BIT(18)) -#define SLC_SLC1_TOHOST_INT_ST1_V 0x1 -#define SLC_SLC1_TOHOST_INT_ST1_S 18 -/* SLC_SLC1_RX_EOF_INT_ST1 : RO ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_EOF_INT_ST1 (BIT(17)) -#define SLC_SLC1_RX_EOF_INT_ST1_M (BIT(17)) -#define SLC_SLC1_RX_EOF_INT_ST1_V 0x1 -#define SLC_SLC1_RX_EOF_INT_ST1_S 17 -/* SLC_SLC1_RX_DONE_INT_ST1 : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_DONE_INT_ST1 (BIT(16)) -#define SLC_SLC1_RX_DONE_INT_ST1_M (BIT(16)) -#define SLC_SLC1_RX_DONE_INT_ST1_V 0x1 -#define SLC_SLC1_RX_DONE_INT_ST1_S 16 -/* SLC_SLC1_TX_SUC_EOF_INT_ST1 : RO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_SUC_EOF_INT_ST1 (BIT(15)) -#define SLC_SLC1_TX_SUC_EOF_INT_ST1_M (BIT(15)) -#define SLC_SLC1_TX_SUC_EOF_INT_ST1_V 0x1 -#define SLC_SLC1_TX_SUC_EOF_INT_ST1_S 15 -/* SLC_SLC1_TX_DONE_INT_ST1 : RO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_DONE_INT_ST1 (BIT(14)) -#define SLC_SLC1_TX_DONE_INT_ST1_M (BIT(14)) -#define SLC_SLC1_TX_DONE_INT_ST1_V 0x1 -#define SLC_SLC1_TX_DONE_INT_ST1_S 14 -/* SLC_SLC1_TOKEN1_1TO0_INT_ST1 : RO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TOKEN1_1TO0_INT_ST1 (BIT(13)) -#define SLC_SLC1_TOKEN1_1TO0_INT_ST1_M (BIT(13)) -#define SLC_SLC1_TOKEN1_1TO0_INT_ST1_V 0x1 -#define SLC_SLC1_TOKEN1_1TO0_INT_ST1_S 13 -/* SLC_SLC1_TOKEN0_1TO0_INT_ST1 : RO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TOKEN0_1TO0_INT_ST1 (BIT(12)) -#define SLC_SLC1_TOKEN0_1TO0_INT_ST1_M (BIT(12)) -#define SLC_SLC1_TOKEN0_1TO0_INT_ST1_V 0x1 -#define SLC_SLC1_TOKEN0_1TO0_INT_ST1_S 12 -/* SLC_SLC1_TX_OVF_INT_ST1 : RO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_OVF_INT_ST1 (BIT(11)) -#define SLC_SLC1_TX_OVF_INT_ST1_M (BIT(11)) -#define SLC_SLC1_TX_OVF_INT_ST1_V 0x1 -#define SLC_SLC1_TX_OVF_INT_ST1_S 11 -/* SLC_SLC1_RX_UDF_INT_ST1 : RO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_UDF_INT_ST1 (BIT(10)) -#define SLC_SLC1_RX_UDF_INT_ST1_M (BIT(10)) -#define SLC_SLC1_RX_UDF_INT_ST1_V 0x1 -#define SLC_SLC1_RX_UDF_INT_ST1_S 10 -/* SLC_SLC1_TX_START_INT_ST1 : RO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_START_INT_ST1 (BIT(9)) -#define SLC_SLC1_TX_START_INT_ST1_M (BIT(9)) -#define SLC_SLC1_TX_START_INT_ST1_V 0x1 -#define SLC_SLC1_TX_START_INT_ST1_S 9 -/* SLC_SLC1_RX_START_INT_ST1 : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_START_INT_ST1 (BIT(8)) -#define SLC_SLC1_RX_START_INT_ST1_M (BIT(8)) -#define SLC_SLC1_RX_START_INT_ST1_V 0x1 -#define SLC_SLC1_RX_START_INT_ST1_S 8 -/* SLC_FRHOST_BIT15_INT_ST1 : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT15_INT_ST1 (BIT(7)) -#define SLC_FRHOST_BIT15_INT_ST1_M (BIT(7)) -#define SLC_FRHOST_BIT15_INT_ST1_V 0x1 -#define SLC_FRHOST_BIT15_INT_ST1_S 7 -/* SLC_FRHOST_BIT14_INT_ST1 : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT14_INT_ST1 (BIT(6)) -#define SLC_FRHOST_BIT14_INT_ST1_M (BIT(6)) -#define SLC_FRHOST_BIT14_INT_ST1_V 0x1 -#define SLC_FRHOST_BIT14_INT_ST1_S 6 -/* SLC_FRHOST_BIT13_INT_ST1 : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT13_INT_ST1 (BIT(5)) -#define SLC_FRHOST_BIT13_INT_ST1_M (BIT(5)) -#define SLC_FRHOST_BIT13_INT_ST1_V 0x1 -#define SLC_FRHOST_BIT13_INT_ST1_S 5 -/* SLC_FRHOST_BIT12_INT_ST1 : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT12_INT_ST1 (BIT(4)) -#define SLC_FRHOST_BIT12_INT_ST1_M (BIT(4)) -#define SLC_FRHOST_BIT12_INT_ST1_V 0x1 -#define SLC_FRHOST_BIT12_INT_ST1_S 4 -/* SLC_FRHOST_BIT11_INT_ST1 : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT11_INT_ST1 (BIT(3)) -#define SLC_FRHOST_BIT11_INT_ST1_M (BIT(3)) -#define SLC_FRHOST_BIT11_INT_ST1_V 0x1 -#define SLC_FRHOST_BIT11_INT_ST1_S 3 -/* SLC_FRHOST_BIT10_INT_ST1 : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT10_INT_ST1 (BIT(2)) -#define SLC_FRHOST_BIT10_INT_ST1_M (BIT(2)) -#define SLC_FRHOST_BIT10_INT_ST1_V 0x1 -#define SLC_FRHOST_BIT10_INT_ST1_S 2 -/* SLC_FRHOST_BIT9_INT_ST1 : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT9_INT_ST1 (BIT(1)) -#define SLC_FRHOST_BIT9_INT_ST1_M (BIT(1)) -#define SLC_FRHOST_BIT9_INT_ST1_V 0x1 -#define SLC_FRHOST_BIT9_INT_ST1_S 1 -/* SLC_FRHOST_BIT8_INT_ST1 : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT8_INT_ST1 (BIT(0)) -#define SLC_FRHOST_BIT8_INT_ST1_M (BIT(0)) -#define SLC_FRHOST_BIT8_INT_ST1_V 0x1 -#define SLC_FRHOST_BIT8_INT_ST1_S 0 - -#define SLC_1INT_ENA1_REG (DR_REG_SLC_BASE + 0x148) -/* SLC_SLC1_TX_ERR_EOF_INT_ENA1 : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_ERR_EOF_INT_ENA1 (BIT(24)) -#define SLC_SLC1_TX_ERR_EOF_INT_ENA1_M (BIT(24)) -#define SLC_SLC1_TX_ERR_EOF_INT_ENA1_V 0x1 -#define SLC_SLC1_TX_ERR_EOF_INT_ENA1_S 24 -/* SLC_SLC1_WR_RETRY_DONE_INT_ENA1 : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_WR_RETRY_DONE_INT_ENA1 (BIT(23)) -#define SLC_SLC1_WR_RETRY_DONE_INT_ENA1_M (BIT(23)) -#define SLC_SLC1_WR_RETRY_DONE_INT_ENA1_V 0x1 -#define SLC_SLC1_WR_RETRY_DONE_INT_ENA1_S 23 -/* SLC_SLC1_HOST_RD_ACK_INT_ENA1 : R/W ;bitpos:[22] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_HOST_RD_ACK_INT_ENA1 (BIT(22)) -#define SLC_SLC1_HOST_RD_ACK_INT_ENA1_M (BIT(22)) -#define SLC_SLC1_HOST_RD_ACK_INT_ENA1_V 0x1 -#define SLC_SLC1_HOST_RD_ACK_INT_ENA1_S 22 -/* SLC_SLC1_TX_DSCR_EMPTY_INT_ENA1 : R/W ;bitpos:[21] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_DSCR_EMPTY_INT_ENA1 (BIT(21)) -#define SLC_SLC1_TX_DSCR_EMPTY_INT_ENA1_M (BIT(21)) -#define SLC_SLC1_TX_DSCR_EMPTY_INT_ENA1_V 0x1 -#define SLC_SLC1_TX_DSCR_EMPTY_INT_ENA1_S 21 -/* SLC_SLC1_RX_DSCR_ERR_INT_ENA1 : R/W ;bitpos:[20] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_DSCR_ERR_INT_ENA1 (BIT(20)) -#define SLC_SLC1_RX_DSCR_ERR_INT_ENA1_M (BIT(20)) -#define SLC_SLC1_RX_DSCR_ERR_INT_ENA1_V 0x1 -#define SLC_SLC1_RX_DSCR_ERR_INT_ENA1_S 20 -/* SLC_SLC1_TX_DSCR_ERR_INT_ENA1 : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_DSCR_ERR_INT_ENA1 (BIT(19)) -#define SLC_SLC1_TX_DSCR_ERR_INT_ENA1_M (BIT(19)) -#define SLC_SLC1_TX_DSCR_ERR_INT_ENA1_V 0x1 -#define SLC_SLC1_TX_DSCR_ERR_INT_ENA1_S 19 -/* SLC_SLC1_TOHOST_INT_ENA1 : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TOHOST_INT_ENA1 (BIT(18)) -#define SLC_SLC1_TOHOST_INT_ENA1_M (BIT(18)) -#define SLC_SLC1_TOHOST_INT_ENA1_V 0x1 -#define SLC_SLC1_TOHOST_INT_ENA1_S 18 -/* SLC_SLC1_RX_EOF_INT_ENA1 : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_EOF_INT_ENA1 (BIT(17)) -#define SLC_SLC1_RX_EOF_INT_ENA1_M (BIT(17)) -#define SLC_SLC1_RX_EOF_INT_ENA1_V 0x1 -#define SLC_SLC1_RX_EOF_INT_ENA1_S 17 -/* SLC_SLC1_RX_DONE_INT_ENA1 : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_DONE_INT_ENA1 (BIT(16)) -#define SLC_SLC1_RX_DONE_INT_ENA1_M (BIT(16)) -#define SLC_SLC1_RX_DONE_INT_ENA1_V 0x1 -#define SLC_SLC1_RX_DONE_INT_ENA1_S 16 -/* SLC_SLC1_TX_SUC_EOF_INT_ENA1 : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_SUC_EOF_INT_ENA1 (BIT(15)) -#define SLC_SLC1_TX_SUC_EOF_INT_ENA1_M (BIT(15)) -#define SLC_SLC1_TX_SUC_EOF_INT_ENA1_V 0x1 -#define SLC_SLC1_TX_SUC_EOF_INT_ENA1_S 15 -/* SLC_SLC1_TX_DONE_INT_ENA1 : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_DONE_INT_ENA1 (BIT(14)) -#define SLC_SLC1_TX_DONE_INT_ENA1_M (BIT(14)) -#define SLC_SLC1_TX_DONE_INT_ENA1_V 0x1 -#define SLC_SLC1_TX_DONE_INT_ENA1_S 14 -/* SLC_SLC1_TOKEN1_1TO0_INT_ENA1 : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TOKEN1_1TO0_INT_ENA1 (BIT(13)) -#define SLC_SLC1_TOKEN1_1TO0_INT_ENA1_M (BIT(13)) -#define SLC_SLC1_TOKEN1_1TO0_INT_ENA1_V 0x1 -#define SLC_SLC1_TOKEN1_1TO0_INT_ENA1_S 13 -/* SLC_SLC1_TOKEN0_1TO0_INT_ENA1 : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TOKEN0_1TO0_INT_ENA1 (BIT(12)) -#define SLC_SLC1_TOKEN0_1TO0_INT_ENA1_M (BIT(12)) -#define SLC_SLC1_TOKEN0_1TO0_INT_ENA1_V 0x1 -#define SLC_SLC1_TOKEN0_1TO0_INT_ENA1_S 12 -/* SLC_SLC1_TX_OVF_INT_ENA1 : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_OVF_INT_ENA1 (BIT(11)) -#define SLC_SLC1_TX_OVF_INT_ENA1_M (BIT(11)) -#define SLC_SLC1_TX_OVF_INT_ENA1_V 0x1 -#define SLC_SLC1_TX_OVF_INT_ENA1_S 11 -/* SLC_SLC1_RX_UDF_INT_ENA1 : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_UDF_INT_ENA1 (BIT(10)) -#define SLC_SLC1_RX_UDF_INT_ENA1_M (BIT(10)) -#define SLC_SLC1_RX_UDF_INT_ENA1_V 0x1 -#define SLC_SLC1_RX_UDF_INT_ENA1_S 10 -/* SLC_SLC1_TX_START_INT_ENA1 : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_TX_START_INT_ENA1 (BIT(9)) -#define SLC_SLC1_TX_START_INT_ENA1_M (BIT(9)) -#define SLC_SLC1_TX_START_INT_ENA1_V 0x1 -#define SLC_SLC1_TX_START_INT_ENA1_S 9 -/* SLC_SLC1_RX_START_INT_ENA1 : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define SLC_SLC1_RX_START_INT_ENA1 (BIT(8)) -#define SLC_SLC1_RX_START_INT_ENA1_M (BIT(8)) -#define SLC_SLC1_RX_START_INT_ENA1_V 0x1 -#define SLC_SLC1_RX_START_INT_ENA1_S 8 -/* SLC_FRHOST_BIT15_INT_ENA1 : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT15_INT_ENA1 (BIT(7)) -#define SLC_FRHOST_BIT15_INT_ENA1_M (BIT(7)) -#define SLC_FRHOST_BIT15_INT_ENA1_V 0x1 -#define SLC_FRHOST_BIT15_INT_ENA1_S 7 -/* SLC_FRHOST_BIT14_INT_ENA1 : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT14_INT_ENA1 (BIT(6)) -#define SLC_FRHOST_BIT14_INT_ENA1_M (BIT(6)) -#define SLC_FRHOST_BIT14_INT_ENA1_V 0x1 -#define SLC_FRHOST_BIT14_INT_ENA1_S 6 -/* SLC_FRHOST_BIT13_INT_ENA1 : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT13_INT_ENA1 (BIT(5)) -#define SLC_FRHOST_BIT13_INT_ENA1_M (BIT(5)) -#define SLC_FRHOST_BIT13_INT_ENA1_V 0x1 -#define SLC_FRHOST_BIT13_INT_ENA1_S 5 -/* SLC_FRHOST_BIT12_INT_ENA1 : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT12_INT_ENA1 (BIT(4)) -#define SLC_FRHOST_BIT12_INT_ENA1_M (BIT(4)) -#define SLC_FRHOST_BIT12_INT_ENA1_V 0x1 -#define SLC_FRHOST_BIT12_INT_ENA1_S 4 -/* SLC_FRHOST_BIT11_INT_ENA1 : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT11_INT_ENA1 (BIT(3)) -#define SLC_FRHOST_BIT11_INT_ENA1_M (BIT(3)) -#define SLC_FRHOST_BIT11_INT_ENA1_V 0x1 -#define SLC_FRHOST_BIT11_INT_ENA1_S 3 -/* SLC_FRHOST_BIT10_INT_ENA1 : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT10_INT_ENA1 (BIT(2)) -#define SLC_FRHOST_BIT10_INT_ENA1_M (BIT(2)) -#define SLC_FRHOST_BIT10_INT_ENA1_V 0x1 -#define SLC_FRHOST_BIT10_INT_ENA1_S 2 -/* SLC_FRHOST_BIT9_INT_ENA1 : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT9_INT_ENA1 (BIT(1)) -#define SLC_FRHOST_BIT9_INT_ENA1_M (BIT(1)) -#define SLC_FRHOST_BIT9_INT_ENA1_V 0x1 -#define SLC_FRHOST_BIT9_INT_ENA1_S 1 -/* SLC_FRHOST_BIT8_INT_ENA1 : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define SLC_FRHOST_BIT8_INT_ENA1 (BIT(0)) -#define SLC_FRHOST_BIT8_INT_ENA1_M (BIT(0)) -#define SLC_FRHOST_BIT8_INT_ENA1_V 0x1 -#define SLC_FRHOST_BIT8_INT_ENA1_S 0 - -#define SLC_DATE_REG (DR_REG_SLC_BASE + 0x1F8) -/* SLC_DATE : R/W ;bitpos:[31:0] ;default: 32'h16022500 ; */ -/*description: */ -#define SLC_DATE 0xFFFFFFFF -#define SLC_DATE_M ((SLC_DATE_V)<<(SLC_DATE_S)) -#define SLC_DATE_V 0xFFFFFFFF -#define SLC_DATE_S 0 - -#define SLC_ID_REG (DR_REG_SLC_BASE + 0x1FC) -/* SLC_ID : R/W ;bitpos:[31:0] ;default: 32'h0100 ; */ -/*description: */ -#define SLC_ID 0xFFFFFFFF -#define SLC_ID_M ((SLC_ID_V)<<(SLC_ID_S)) -#define SLC_ID_V 0xFFFFFFFF -#define SLC_ID_S 0 - - - - -#endif /*_SOC_SLC_REG_H_ */ - - diff --git a/tools/sdk/include/soc/soc/slc_struct.h b/tools/sdk/include/soc/soc/slc_struct.h deleted file mode 100644 index 3d93ceef71d..00000000000 --- a/tools/sdk/include/soc/soc/slc_struct.h +++ /dev/null @@ -1,858 +0,0 @@ -// 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. -#ifndef _SOC_SLC_STRUCT_H_ -#define _SOC_SLC_STRUCT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef volatile struct { - union { - struct { - uint32_t slc0_tx_rst: 1; - uint32_t slc0_rx_rst: 1; - uint32_t ahbm_fifo_rst: 1; - uint32_t ahbm_rst: 1; - uint32_t slc0_tx_loop_test: 1; - uint32_t slc0_rx_loop_test: 1; - uint32_t slc0_rx_auto_wrback: 1; - uint32_t slc0_rx_no_restart_clr: 1; - uint32_t slc0_rxdscr_burst_en: 1; - uint32_t slc0_rxdata_burst_en: 1; - uint32_t slc0_rxlink_auto_ret: 1; - uint32_t slc0_txlink_auto_ret: 1; - uint32_t slc0_txdscr_burst_en: 1; - uint32_t slc0_txdata_burst_en: 1; - uint32_t slc0_token_auto_clr: 1; - uint32_t slc0_token_sel: 1; - uint32_t slc1_tx_rst: 1; - uint32_t slc1_rx_rst: 1; - uint32_t slc0_wr_retry_mask_en: 1; - uint32_t slc1_wr_retry_mask_en: 1; - uint32_t slc1_tx_loop_test: 1; - uint32_t slc1_rx_loop_test: 1; - uint32_t slc1_rx_auto_wrback: 1; - uint32_t slc1_rx_no_restart_clr: 1; - uint32_t slc1_rxdscr_burst_en: 1; - uint32_t slc1_rxdata_burst_en: 1; - uint32_t slc1_rxlink_auto_ret: 1; - uint32_t slc1_txlink_auto_ret: 1; - uint32_t slc1_txdscr_burst_en: 1; - uint32_t slc1_txdata_burst_en: 1; - uint32_t slc1_token_auto_clr: 1; - uint32_t slc1_token_sel: 1; - }; - uint32_t val; - } conf0; - union { - struct { - uint32_t frhost_bit0: 1; - uint32_t frhost_bit1: 1; - uint32_t frhost_bit2: 1; - uint32_t frhost_bit3: 1; - uint32_t frhost_bit4: 1; - uint32_t frhost_bit5: 1; - uint32_t frhost_bit6: 1; - uint32_t frhost_bit7: 1; - uint32_t rx_start: 1; - uint32_t tx_start: 1; - uint32_t rx_udf: 1; - uint32_t tx_ovf: 1; - uint32_t token0_1to0: 1; - uint32_t token1_1to0: 1; - uint32_t tx_done: 1; - uint32_t tx_suc_eof: 1; - uint32_t rx_done: 1; - uint32_t rx_eof: 1; - uint32_t tohost: 1; - uint32_t tx_dscr_err: 1; - uint32_t rx_dscr_err: 1; - uint32_t tx_dscr_empty: 1; - uint32_t host_rd_ack: 1; - uint32_t wr_retry_done: 1; - uint32_t tx_err_eof: 1; - uint32_t cmd_dtc: 1; - uint32_t rx_quick_eof: 1; - uint32_t reserved27: 5; - }; - uint32_t val; - } slc0_int_raw; - union { - struct { - uint32_t frhost_bit0: 1; - uint32_t frhost_bit1: 1; - uint32_t frhost_bit2: 1; - uint32_t frhost_bit3: 1; - uint32_t frhost_bit4: 1; - uint32_t frhost_bit5: 1; - uint32_t frhost_bit6: 1; - uint32_t frhost_bit7: 1; - uint32_t rx_start: 1; - uint32_t tx_start: 1; - uint32_t rx_udf: 1; - uint32_t tx_ovf: 1; - uint32_t token0_1to0: 1; - uint32_t token1_1to0: 1; - uint32_t tx_done: 1; - uint32_t tx_suc_eof: 1; - uint32_t rx_done: 1; - uint32_t rx_eof: 1; - uint32_t tohost: 1; - uint32_t tx_dscr_err: 1; - uint32_t rx_dscr_err: 1; - uint32_t tx_dscr_empty: 1; - uint32_t host_rd_ack: 1; - uint32_t wr_retry_done: 1; - uint32_t tx_err_eof: 1; - uint32_t cmd_dtc: 1; - uint32_t rx_quick_eof: 1; - uint32_t reserved27: 5; - }; - uint32_t val; - } slc0_int_st; - union { - struct { - uint32_t frhost_bit0: 1; - uint32_t frhost_bit1: 1; - uint32_t frhost_bit2: 1; - uint32_t frhost_bit3: 1; - uint32_t frhost_bit4: 1; - uint32_t frhost_bit5: 1; - uint32_t frhost_bit6: 1; - uint32_t frhost_bit7: 1; - uint32_t rx_start: 1; - uint32_t tx_start: 1; - uint32_t rx_udf: 1; - uint32_t tx_ovf: 1; - uint32_t token0_1to0: 1; - uint32_t token1_1to0: 1; - uint32_t tx_done: 1; - uint32_t tx_suc_eof: 1; - uint32_t rx_done: 1; - uint32_t rx_eof: 1; - uint32_t tohost: 1; - uint32_t tx_dscr_err: 1; - uint32_t rx_dscr_err: 1; - uint32_t tx_dscr_empty: 1; - uint32_t host_rd_ack: 1; - uint32_t wr_retry_done: 1; - uint32_t tx_err_eof: 1; - uint32_t cmd_dtc: 1; - uint32_t rx_quick_eof: 1; - uint32_t reserved27: 5; - }; - uint32_t val; - } slc0_int_ena; - union { - struct { - uint32_t frhost_bit0: 1; - uint32_t frhost_bit1: 1; - uint32_t frhost_bit2: 1; - uint32_t frhost_bit3: 1; - uint32_t frhost_bit4: 1; - uint32_t frhost_bit5: 1; - uint32_t frhost_bit6: 1; - uint32_t frhost_bit7: 1; - uint32_t rx_start: 1; - uint32_t tx_start: 1; - uint32_t rx_udf: 1; - uint32_t tx_ovf: 1; - uint32_t token0_1to0: 1; - uint32_t token1_1to0: 1; - uint32_t tx_done: 1; - uint32_t tx_suc_eof: 1; - uint32_t rx_done: 1; - uint32_t rx_eof: 1; - uint32_t tohost: 1; - uint32_t tx_dscr_err: 1; - uint32_t rx_dscr_err: 1; - uint32_t tx_dscr_empty: 1; - uint32_t host_rd_ack: 1; - uint32_t wr_retry_done: 1; - uint32_t tx_err_eof: 1; - uint32_t cmd_dtc: 1; - uint32_t rx_quick_eof: 1; - uint32_t reserved27: 5; - }; - uint32_t val; - } slc0_int_clr; - union { - struct { - uint32_t frhost_bit8: 1; - uint32_t frhost_bit9: 1; - uint32_t frhost_bit10: 1; - uint32_t frhost_bit11: 1; - uint32_t frhost_bit12: 1; - uint32_t frhost_bit13: 1; - uint32_t frhost_bit14: 1; - uint32_t frhost_bit15: 1; - uint32_t rx_start: 1; - uint32_t tx_start: 1; - uint32_t rx_udf: 1; - uint32_t tx_ovf: 1; - uint32_t token0_1to0: 1; - uint32_t token1_1to0: 1; - uint32_t tx_done: 1; - uint32_t tx_suc_eof: 1; - uint32_t rx_done: 1; - uint32_t rx_eof: 1; - uint32_t tohost: 1; - uint32_t tx_dscr_err: 1; - uint32_t rx_dscr_err: 1; - uint32_t tx_dscr_empty: 1; - uint32_t host_rd_ack: 1; - uint32_t wr_retry_done: 1; - uint32_t tx_err_eof: 1; - uint32_t reserved25: 7; - }; - uint32_t val; - } slc1_int_raw; - union { - struct { - uint32_t frhost_bit8: 1; - uint32_t frhost_bit9: 1; - uint32_t frhost_bit10: 1; - uint32_t frhost_bit11: 1; - uint32_t frhost_bit12: 1; - uint32_t frhost_bit13: 1; - uint32_t frhost_bit14: 1; - uint32_t frhost_bit15: 1; - uint32_t rx_start: 1; - uint32_t tx_start: 1; - uint32_t rx_udf: 1; - uint32_t tx_ovf: 1; - uint32_t token0_1to0: 1; - uint32_t token1_1to0: 1; - uint32_t tx_done: 1; - uint32_t tx_suc_eof: 1; - uint32_t rx_done: 1; - uint32_t rx_eof: 1; - uint32_t tohost: 1; - uint32_t tx_dscr_err: 1; - uint32_t rx_dscr_err: 1; - uint32_t tx_dscr_empty: 1; - uint32_t host_rd_ack: 1; - uint32_t wr_retry_done: 1; - uint32_t tx_err_eof: 1; - uint32_t reserved25: 7; - }; - uint32_t val; - } slc1_int_st; - union { - struct { - uint32_t frhost_bit8: 1; - uint32_t frhost_bit9: 1; - uint32_t frhost_bit10: 1; - uint32_t frhost_bit11: 1; - uint32_t frhost_bit12: 1; - uint32_t frhost_bit13: 1; - uint32_t frhost_bit14: 1; - uint32_t frhost_bit15: 1; - uint32_t rx_start: 1; - uint32_t tx_start: 1; - uint32_t rx_udf: 1; - uint32_t tx_ovf: 1; - uint32_t token0_1to0: 1; - uint32_t token1_1to0: 1; - uint32_t tx_done: 1; - uint32_t tx_suc_eof: 1; - uint32_t rx_done: 1; - uint32_t rx_eof: 1; - uint32_t tohost: 1; - uint32_t tx_dscr_err: 1; - uint32_t rx_dscr_err: 1; - uint32_t tx_dscr_empty: 1; - uint32_t host_rd_ack: 1; - uint32_t wr_retry_done: 1; - uint32_t tx_err_eof: 1; - uint32_t reserved25: 7; - }; - uint32_t val; - } slc1_int_ena; - union { - struct { - uint32_t frhost_bit8: 1; - uint32_t frhost_bit9: 1; - uint32_t frhost_bit10: 1; - uint32_t frhost_bit11: 1; - uint32_t frhost_bit12: 1; - uint32_t frhost_bit13: 1; - uint32_t frhost_bit14: 1; - uint32_t frhost_bit15: 1; - uint32_t rx_start: 1; - uint32_t tx_start: 1; - uint32_t rx_udf: 1; - uint32_t tx_ovf: 1; - uint32_t token0_1to0: 1; - uint32_t token1_1to0: 1; - uint32_t tx_done: 1; - uint32_t tx_suc_eof: 1; - uint32_t rx_done: 1; - uint32_t rx_eof: 1; - uint32_t tohost: 1; - uint32_t tx_dscr_err: 1; - uint32_t rx_dscr_err: 1; - uint32_t tx_dscr_empty: 1; - uint32_t host_rd_ack: 1; - uint32_t wr_retry_done: 1; - uint32_t tx_err_eof: 1; - uint32_t reserved25: 7; - }; - uint32_t val; - } slc1_int_clr; - union { - struct { - uint32_t slc0_rx_full: 1; - uint32_t slc0_rx_empty: 1; - uint32_t reserved2: 14; - uint32_t slc1_rx_full: 1; - uint32_t slc1_rx_empty: 1; - uint32_t reserved18:14; - }; - uint32_t val; - } rx_status; - union { - struct { - uint32_t rxfifo_wdata: 9; - uint32_t reserved9: 7; - uint32_t rxfifo_push: 1; - uint32_t reserved17: 15; - }; - uint32_t val; - } slc0_rxfifo_push; - union { - struct { - uint32_t rxfifo_wdata: 9; - uint32_t reserved9: 7; - uint32_t rxfifo_push: 1; - uint32_t reserved17: 15; - }; - uint32_t val; - } slc1_rxfifo_push; - union { - struct { - uint32_t slc0_tx_full: 1; - uint32_t slc0_tx_empty: 1; - uint32_t reserved2: 14; - uint32_t slc1_tx_full: 1; - uint32_t slc1_tx_empty: 1; - uint32_t reserved18:14; - }; - uint32_t val; - } tx_status; - union { - struct { - uint32_t txfifo_rdata: 11; - uint32_t reserved11: 5; - uint32_t txfifo_pop: 1; - uint32_t reserved17: 15; - }; - uint32_t val; - } slc0_txfifo_pop; - union { - struct { - uint32_t txfifo_rdata: 11; - uint32_t reserved11: 5; - uint32_t txfifo_pop: 1; - uint32_t reserved17: 15; - }; - uint32_t val; - } slc1_txfifo_pop; - union { - struct { - uint32_t addr: 20; - uint32_t reserved20: 8; - uint32_t stop: 1; - uint32_t start: 1; - uint32_t restart: 1; - uint32_t park: 1; - }; - uint32_t val; - } slc0_rx_link; - union { - struct { - uint32_t addr: 20; - uint32_t reserved20: 8; - uint32_t stop: 1; - uint32_t start: 1; - uint32_t restart: 1; - uint32_t park: 1; - }; - uint32_t val; - } slc0_tx_link; - union { - struct { - uint32_t addr: 20; - uint32_t bt_packet: 1; - uint32_t reserved21: 7; - uint32_t stop: 1; - uint32_t start: 1; - uint32_t restart: 1; - uint32_t park: 1; - }; - uint32_t val; - } slc1_rx_link; - union { - struct { - uint32_t addr: 20; - uint32_t reserved20: 8; - uint32_t stop: 1; - uint32_t start: 1; - uint32_t restart: 1; - uint32_t park: 1; - }; - uint32_t val; - } slc1_tx_link; - union { - struct { - uint32_t slc0_intvec: 8; - uint32_t reserved8: 8; - uint32_t slc1_intvec: 8; - uint32_t reserved24: 8; - }; - uint32_t val; - } intvec_tohost; - union { - struct { - uint32_t wdata: 12; - uint32_t wr: 1; - uint32_t inc: 1; - uint32_t inc_more: 1; - uint32_t reserved15: 1; - uint32_t token0: 12; - uint32_t reserved28: 4; - }; - uint32_t val; - } slc0_token0; - union { - struct { - uint32_t wdata: 12; - uint32_t wr: 1; - uint32_t inc: 1; - uint32_t inc_more: 1; - uint32_t reserved15: 1; - uint32_t token1: 12; - uint32_t reserved28: 4; - }; - uint32_t val; - } slc0_token1; - union { - struct { - uint32_t wdata: 12; - uint32_t wr: 1; - uint32_t inc: 1; - uint32_t inc_more: 1; - uint32_t reserved15: 1; - uint32_t token0: 12; - uint32_t reserved28: 4; - }; - uint32_t val; - } slc1_token0; - union { - struct { - uint32_t wdata: 12; - uint32_t wr: 1; - uint32_t inc: 1; - uint32_t inc_more: 1; - uint32_t reserved15: 1; - uint32_t token1: 12; - uint32_t reserved28: 4; - }; - uint32_t val; - } slc1_token1; - union { - struct { - uint32_t slc0_check_owner: 1; - uint32_t slc0_tx_check_sum_en: 1; - uint32_t slc0_rx_check_sum_en: 1; - uint32_t cmd_hold_en: 1; - uint32_t slc0_len_auto_clr: 1; - uint32_t slc0_tx_stitch_en: 1; - uint32_t slc0_rx_stitch_en: 1; - uint32_t reserved7: 9; - uint32_t slc1_check_owner: 1; - uint32_t slc1_tx_check_sum_en: 1; - uint32_t slc1_rx_check_sum_en: 1; - uint32_t host_int_level_sel: 1; - uint32_t slc1_tx_stitch_en: 1; - uint32_t slc1_rx_stitch_en: 1; - uint32_t clk_en: 1; - uint32_t reserved23: 9; - }; - uint32_t val; - } conf1; - uint32_t slc0_state0; /**/ - uint32_t slc0_state1; /**/ - uint32_t slc1_state0; /**/ - uint32_t slc1_state1; /**/ - union { - struct { - uint32_t txeof_ena: 6; - uint32_t reserved6: 2; - uint32_t fifo_map_ena: 4; - uint32_t slc0_tx_dummy_mode: 1; - uint32_t hda_map_128k: 1; - uint32_t slc1_tx_dummy_mode: 1; - uint32_t reserved15: 1; - uint32_t tx_push_idle_num:16; - }; - uint32_t val; - } bridge_conf; - uint32_t slc0_to_eof_des_addr; /**/ - uint32_t slc0_tx_eof_des_addr; /**/ - uint32_t slc0_to_eof_bfr_des_addr; /**/ - uint32_t slc1_to_eof_des_addr; /**/ - uint32_t slc1_tx_eof_des_addr; /**/ - uint32_t slc1_to_eof_bfr_des_addr; /**/ - union { - struct { - uint32_t mode: 3; - uint32_t reserved3: 1; - uint32_t addr: 2; - uint32_t reserved6: 26; - }; - uint32_t val; - } ahb_test; - union { - struct { - uint32_t cmd_st: 3; - uint32_t reserved3: 1; - uint32_t func_st: 4; - uint32_t sdio_wakeup: 1; - uint32_t reserved9: 3; - uint32_t bus_st: 3; - uint32_t reserved15: 1; - uint32_t func1_acc_state: 5; - uint32_t reserved21: 3; - uint32_t func2_acc_state: 5; - uint32_t reserved29: 3; - }; - uint32_t val; - } sdio_st; - union { - struct { - uint32_t slc0_token_no_replace: 1; - uint32_t slc0_infor_no_replace: 1; - uint32_t slc0_rx_fill_mode: 1; - uint32_t slc0_rx_eof_mode: 1; - uint32_t slc0_rx_fill_en: 1; - uint32_t slc0_rd_retry_threshold:11; - uint32_t slc1_token_no_replace: 1; - uint32_t slc1_infor_no_replace: 1; - uint32_t slc1_rx_fill_mode: 1; - uint32_t slc1_rx_eof_mode: 1; - uint32_t slc1_rx_fill_en: 1; - uint32_t slc1_rd_retry_threshold:11; - }; - uint32_t val; - } rx_dscr_conf; - uint32_t slc0_txlink_dscr; /**/ - uint32_t slc0_txlink_dscr_bf0; /**/ - uint32_t slc0_txlink_dscr_bf1; /**/ - uint32_t slc0_rxlink_dscr; /**/ - uint32_t slc0_rxlink_dscr_bf0; /**/ - uint32_t slc0_rxlink_dscr_bf1; /**/ - uint32_t slc1_txlink_dscr; /**/ - uint32_t slc1_txlink_dscr_bf0; /**/ - uint32_t slc1_txlink_dscr_bf1; /**/ - uint32_t slc1_rxlink_dscr; /**/ - uint32_t slc1_rxlink_dscr_bf0; /**/ - uint32_t slc1_rxlink_dscr_bf1; /**/ - uint32_t slc0_tx_erreof_des_addr; /**/ - uint32_t slc1_tx_erreof_des_addr; /**/ - union { - struct { - uint32_t slc0_token:12; - uint32_t reserved12: 4; - uint32_t slc1_token:12; - uint32_t reserved28: 4; - }; - uint32_t val; - } token_lat; - union { - struct { - uint32_t wr_retry_threshold:11; - uint32_t reserved11: 21; - }; - uint32_t val; - } tx_dscr_conf; - uint32_t cmd_infor0; /**/ - uint32_t cmd_infor1; /**/ - union { - struct { - uint32_t len_wdata: 20; - uint32_t len_wr: 1; - uint32_t len_inc: 1; - uint32_t len_inc_more: 1; - uint32_t rx_packet_load_en: 1; - uint32_t tx_packet_load_en: 1; - uint32_t rx_get_used_dscr: 1; - uint32_t tx_get_used_dscr: 1; - uint32_t rx_new_pkt_ind: 1; - uint32_t tx_new_pkt_ind: 1; - uint32_t reserved29: 3; - }; - uint32_t val; - } slc0_len_conf; - union { - struct { - uint32_t len: 20; - uint32_t reserved20:12; - }; - uint32_t val; - } slc0_length; - uint32_t slc0_txpkt_h_dscr; /**/ - uint32_t slc0_txpkt_e_dscr; /**/ - uint32_t slc0_rxpkt_h_dscr; /**/ - uint32_t slc0_rxpkt_e_dscr; /**/ - uint32_t slc0_txpktu_h_dscr; /**/ - uint32_t slc0_txpktu_e_dscr; /**/ - uint32_t slc0_rxpktu_h_dscr; /**/ - uint32_t slc0_rxpktu_e_dscr; /**/ - uint32_t reserved_10c; - uint32_t reserved_110; - union { - struct { - uint32_t slc0_position: 8; - uint32_t slc1_position: 8; - uint32_t reserved16: 16; - }; - uint32_t val; - } seq_position; - union { - struct { - uint32_t rx_dscr_rec_lim: 10; - uint32_t reserved10: 22; - }; - uint32_t val; - } slc0_dscr_rec_conf; - union { - struct { - uint32_t dat0_crc_err_cnt: 8; - uint32_t dat1_crc_err_cnt: 8; - uint32_t dat2_crc_err_cnt: 8; - uint32_t dat3_crc_err_cnt: 8; - }; - uint32_t val; - } sdio_crc_st0; - union { - struct { - uint32_t cmd_crc_err_cnt: 8; - uint32_t reserved8: 23; - uint32_t err_cnt_clr: 1; - }; - uint32_t val; - } sdio_crc_st1; - uint32_t slc0_eof_start_des; /**/ - uint32_t slc0_push_dscr_addr; /**/ - uint32_t slc0_done_dscr_addr; /**/ - uint32_t slc0_sub_start_des; /**/ - union { - struct { - uint32_t rx_dscr_cnt_lat: 10; - uint32_t reserved10: 6; - uint32_t rx_get_eof_occ: 1; - uint32_t reserved17: 15; - }; - uint32_t val; - } slc0_dscr_cnt; - union { - struct { - uint32_t len_lim: 20; - uint32_t reserved20:12; - }; - uint32_t val; - } slc0_len_lim_conf; - union { - struct { - uint32_t frhost_bit01: 1; - uint32_t frhost_bit11: 1; - uint32_t frhost_bit21: 1; - uint32_t frhost_bit31: 1; - uint32_t frhost_bit41: 1; - uint32_t frhost_bit51: 1; - uint32_t frhost_bit61: 1; - uint32_t frhost_bit71: 1; - uint32_t rx_start1: 1; - uint32_t tx_start1: 1; - uint32_t rx_udf1: 1; - uint32_t tx_ovf1: 1; - uint32_t token0_1to01: 1; - uint32_t token1_1to01: 1; - uint32_t tx_done1: 1; - uint32_t tx_suc_eof1: 1; - uint32_t rx_done1: 1; - uint32_t rx_eof1: 1; - uint32_t tohost1: 1; - uint32_t tx_dscr_err1: 1; - uint32_t rx_dscr_err1: 1; - uint32_t tx_dscr_empty1: 1; - uint32_t host_rd_ack1: 1; - uint32_t wr_retry_done1: 1; - uint32_t tx_err_eof1: 1; - uint32_t cmd_dtc1: 1; - uint32_t rx_quick_eof1: 1; - uint32_t reserved27: 5; - }; - uint32_t val; - } slc0_int_st1; - union { - struct { - uint32_t frhost_bit01: 1; - uint32_t frhost_bit11: 1; - uint32_t frhost_bit21: 1; - uint32_t frhost_bit31: 1; - uint32_t frhost_bit41: 1; - uint32_t frhost_bit51: 1; - uint32_t frhost_bit61: 1; - uint32_t frhost_bit71: 1; - uint32_t rx_start1: 1; - uint32_t tx_start1: 1; - uint32_t rx_udf1: 1; - uint32_t tx_ovf1: 1; - uint32_t token0_1to01: 1; - uint32_t token1_1to01: 1; - uint32_t tx_done1: 1; - uint32_t tx_suc_eof1: 1; - uint32_t rx_done1: 1; - uint32_t rx_eof1: 1; - uint32_t tohost1: 1; - uint32_t tx_dscr_err1: 1; - uint32_t rx_dscr_err1: 1; - uint32_t tx_dscr_empty1: 1; - uint32_t host_rd_ack1: 1; - uint32_t wr_retry_done1: 1; - uint32_t tx_err_eof1: 1; - uint32_t cmd_dtc1: 1; - uint32_t rx_quick_eof1: 1; - uint32_t reserved27: 5; - }; - uint32_t val; - } slc0_int_ena1; - union { - struct { - uint32_t frhost_bit81: 1; - uint32_t frhost_bit91: 1; - uint32_t frhost_bit101: 1; - uint32_t frhost_bit111: 1; - uint32_t frhost_bit121: 1; - uint32_t frhost_bit131: 1; - uint32_t frhost_bit141: 1; - uint32_t frhost_bit151: 1; - uint32_t rx_start1: 1; - uint32_t tx_start1: 1; - uint32_t rx_udf1: 1; - uint32_t tx_ovf1: 1; - uint32_t token0_1to01: 1; - uint32_t token1_1to01: 1; - uint32_t tx_done1: 1; - uint32_t tx_suc_eof1: 1; - uint32_t rx_done1: 1; - uint32_t rx_eof1: 1; - uint32_t tohost1: 1; - uint32_t tx_dscr_err1: 1; - uint32_t rx_dscr_err1: 1; - uint32_t tx_dscr_empty1: 1; - uint32_t host_rd_ack1: 1; - uint32_t wr_retry_done1: 1; - uint32_t tx_err_eof1: 1; - uint32_t reserved25: 7; - }; - uint32_t val; - } slc1_int_st1; - union { - struct { - uint32_t frhost_bit81: 1; - uint32_t frhost_bit91: 1; - uint32_t frhost_bit101: 1; - uint32_t frhost_bit111: 1; - uint32_t frhost_bit121: 1; - uint32_t frhost_bit131: 1; - uint32_t frhost_bit141: 1; - uint32_t frhost_bit151: 1; - uint32_t rx_start1: 1; - uint32_t tx_start1: 1; - uint32_t rx_udf1: 1; - uint32_t tx_ovf1: 1; - uint32_t token0_1to01: 1; - uint32_t token1_1to01: 1; - uint32_t tx_done1: 1; - uint32_t tx_suc_eof1: 1; - uint32_t rx_done1: 1; - uint32_t rx_eof1: 1; - uint32_t tohost1: 1; - uint32_t tx_dscr_err1: 1; - uint32_t rx_dscr_err1: 1; - uint32_t tx_dscr_empty1: 1; - uint32_t host_rd_ack1: 1; - uint32_t wr_retry_done1: 1; - uint32_t tx_err_eof1: 1; - uint32_t reserved25: 7; - }; - uint32_t val; - } slc1_int_ena1; - uint32_t reserved_14c; - uint32_t reserved_150; - uint32_t reserved_154; - uint32_t reserved_158; - uint32_t reserved_15c; - uint32_t reserved_160; - uint32_t reserved_164; - uint32_t reserved_168; - uint32_t reserved_16c; - uint32_t reserved_170; - uint32_t reserved_174; - uint32_t reserved_178; - uint32_t reserved_17c; - uint32_t reserved_180; - uint32_t reserved_184; - uint32_t reserved_188; - uint32_t reserved_18c; - uint32_t reserved_190; - uint32_t reserved_194; - uint32_t reserved_198; - uint32_t reserved_19c; - uint32_t reserved_1a0; - uint32_t reserved_1a4; - uint32_t reserved_1a8; - uint32_t reserved_1ac; - uint32_t reserved_1b0; - uint32_t reserved_1b4; - uint32_t reserved_1b8; - uint32_t reserved_1bc; - uint32_t reserved_1c0; - uint32_t reserved_1c4; - uint32_t reserved_1c8; - uint32_t reserved_1cc; - uint32_t reserved_1d0; - uint32_t reserved_1d4; - uint32_t reserved_1d8; - uint32_t reserved_1dc; - uint32_t reserved_1e0; - uint32_t reserved_1e4; - uint32_t reserved_1e8; - uint32_t reserved_1ec; - uint32_t reserved_1f0; - uint32_t reserved_1f4; - uint32_t date; /**/ - uint32_t id; /**/ -} slc_dev_t; -extern slc_dev_t SLC; - -#ifdef __cplusplus -} -#endif - -#endif /* _SOC_SLC_STRUCT_H_ */ diff --git a/tools/sdk/include/soc/soc/soc.h b/tools/sdk/include/soc/soc/soc.h deleted file mode 100644 index d1d468303cc..00000000000 --- a/tools/sdk/include/soc/soc/soc.h +++ /dev/null @@ -1,454 +0,0 @@ -// Copyright 2010-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. - -#ifndef _ESP32_SOC_H_ -#define _ESP32_SOC_H_ - -#ifndef __ASSEMBLER__ -#include -#include "esp_assert.h" -#endif - -//Register Bits{{ -#define BIT31 0x80000000 -#define BIT30 0x40000000 -#define BIT29 0x20000000 -#define BIT28 0x10000000 -#define BIT27 0x08000000 -#define BIT26 0x04000000 -#define BIT25 0x02000000 -#define BIT24 0x01000000 -#define BIT23 0x00800000 -#define BIT22 0x00400000 -#define BIT21 0x00200000 -#define BIT20 0x00100000 -#define BIT19 0x00080000 -#define BIT18 0x00040000 -#define BIT17 0x00020000 -#define BIT16 0x00010000 -#define BIT15 0x00008000 -#define BIT14 0x00004000 -#define BIT13 0x00002000 -#define BIT12 0x00001000 -#define BIT11 0x00000800 -#define BIT10 0x00000400 -#define BIT9 0x00000200 -#define BIT8 0x00000100 -#define BIT7 0x00000080 -#define BIT6 0x00000040 -#define BIT5 0x00000020 -#define BIT4 0x00000010 -#define BIT3 0x00000008 -#define BIT2 0x00000004 -#define BIT1 0x00000002 -#define BIT0 0x00000001 -//}} - -#define PRO_CPU_NUM (0) -#define APP_CPU_NUM (1) - -/* Overall memory map */ -#define SOC_IROM_LOW 0x400D0000 -#define SOC_IROM_HIGH 0x40400000 -#define SOC_DROM_LOW 0x3F400000 -#define SOC_DROM_HIGH 0x3F800000 -#define SOC_DRAM_LOW 0x3FAE0000 -#define SOC_DRAM_HIGH 0x40000000 -#define SOC_RTC_IRAM_LOW 0x400C0000 -#define SOC_RTC_IRAM_HIGH 0x400C2000 -#define SOC_RTC_DATA_LOW 0x50000000 -#define SOC_RTC_DATA_HIGH 0x50002000 -#define SOC_EXTRAM_DATA_LOW 0x3F800000 -#define SOC_EXTRAM_DATA_HIGH 0x3FC00000 - -#define SOC_MAX_CONTIGUOUS_RAM_SIZE 0x400000 ///< Largest span of contiguous memory (DRAM or IRAM) in the address space - - -#define DR_REG_DPORT_BASE 0x3ff00000 -#define DR_REG_AES_BASE 0x3ff01000 -#define DR_REG_RSA_BASE 0x3ff02000 -#define DR_REG_SHA_BASE 0x3ff03000 -#define DR_REG_FLASH_MMU_TABLE_PRO 0x3ff10000 -#define DR_REG_FLASH_MMU_TABLE_APP 0x3ff12000 -#define DR_REG_DPORT_END 0x3ff13FFC -#define DR_REG_UART_BASE 0x3ff40000 -#define DR_REG_SPI1_BASE 0x3ff42000 -#define DR_REG_SPI0_BASE 0x3ff43000 -#define DR_REG_GPIO_BASE 0x3ff44000 -#define DR_REG_GPIO_SD_BASE 0x3ff44f00 -#define DR_REG_FE2_BASE 0x3ff45000 -#define DR_REG_FE_BASE 0x3ff46000 -#define DR_REG_FRC_TIMER_BASE 0x3ff47000 -#define DR_REG_RTCCNTL_BASE 0x3ff48000 -#define DR_REG_RTCIO_BASE 0x3ff48400 -#define DR_REG_SENS_BASE 0x3ff48800 -#define DR_REG_RTC_I2C_BASE 0x3ff48C00 -#define DR_REG_IO_MUX_BASE 0x3ff49000 -#define DR_REG_HINF_BASE 0x3ff4B000 -#define DR_REG_UHCI1_BASE 0x3ff4C000 -#define DR_REG_I2S_BASE 0x3ff4F000 -#define DR_REG_UART1_BASE 0x3ff50000 -#define DR_REG_BT_BASE 0x3ff51000 -#define DR_REG_I2C_EXT_BASE 0x3ff53000 -#define DR_REG_UHCI0_BASE 0x3ff54000 -#define DR_REG_SLCHOST_BASE 0x3ff55000 -#define DR_REG_RMT_BASE 0x3ff56000 -#define DR_REG_PCNT_BASE 0x3ff57000 -#define DR_REG_SLC_BASE 0x3ff58000 -#define DR_REG_LEDC_BASE 0x3ff59000 -#define DR_REG_EFUSE_BASE 0x3ff5A000 -#define DR_REG_SPI_ENCRYPT_BASE 0x3ff5B000 -#define DR_REG_NRX_BASE 0x3ff5CC00 -#define DR_REG_BB_BASE 0x3ff5D000 -#define DR_REG_PWM_BASE 0x3ff5E000 -#define DR_REG_TIMERGROUP0_BASE 0x3ff5F000 -#define DR_REG_TIMERGROUP1_BASE 0x3ff60000 -#define DR_REG_RTCMEM0_BASE 0x3ff61000 -#define DR_REG_RTCMEM1_BASE 0x3ff62000 -#define DR_REG_RTCMEM2_BASE 0x3ff63000 -#define DR_REG_SPI2_BASE 0x3ff64000 -#define DR_REG_SPI3_BASE 0x3ff65000 -#define DR_REG_SYSCON_BASE 0x3ff66000 -#define DR_REG_APB_CTRL_BASE 0x3ff66000 /* Old name for SYSCON, to be removed */ -#define DR_REG_I2C1_EXT_BASE 0x3ff67000 -#define DR_REG_SDMMC_BASE 0x3ff68000 -#define DR_REG_EMAC_BASE 0x3ff69000 -#define DR_REG_CAN_BASE 0x3ff6B000 -#define DR_REG_PWM1_BASE 0x3ff6C000 -#define DR_REG_I2S1_BASE 0x3ff6D000 -#define DR_REG_UART2_BASE 0x3ff6E000 -#define DR_REG_PWM2_BASE 0x3ff6F000 -#define DR_REG_PWM3_BASE 0x3ff70000 -#define PERIPHS_SPI_ENCRYPT_BASEADDR DR_REG_SPI_ENCRYPT_BASE - -//Registers Operation {{ -#define ETS_UNCACHED_ADDR(addr) (addr) -#define ETS_CACHED_ADDR(addr) (addr) - -#ifndef __ASSEMBLER__ -#define BIT(nr) (1UL << (nr)) -#define BIT64(nr) (1ULL << (nr)) -#else -#define BIT(nr) (1 << (nr)) -#endif - -#ifndef __ASSEMBLER__ - -#define IS_DPORT_REG(_r) (((_r) >= DR_REG_DPORT_BASE) && (_r) <= DR_REG_DPORT_END) - -#if !defined( BOOTLOADER_BUILD ) && defined( CONFIG_ESP32_DPORT_WORKAROUND ) && defined( ESP_PLATFORM ) -#define ASSERT_IF_DPORT_REG(_r, OP) TRY_STATIC_ASSERT(!IS_DPORT_REG(_r), (Cannot use OP for DPORT registers use DPORT_##OP)); -#else -#define ASSERT_IF_DPORT_REG(_r, OP) -#endif - -//write value to register -#define REG_WRITE(_r, _v) ({ \ - ASSERT_IF_DPORT_REG((_r), REG_WRITE); \ - (*(volatile uint32_t *)(_r)) = (_v); \ - }) - -//read value from register -#define REG_READ(_r) ({ \ - ASSERT_IF_DPORT_REG((_r), REG_READ); \ - (*(volatile uint32_t *)(_r)); \ - }) - -//get bit or get bits from register -#define REG_GET_BIT(_r, _b) ({ \ - ASSERT_IF_DPORT_REG((_r), REG_GET_BIT); \ - (*(volatile uint32_t*)(_r) & (_b)); \ - }) - -//set bit or set bits to register -#define REG_SET_BIT(_r, _b) ({ \ - ASSERT_IF_DPORT_REG((_r), REG_SET_BIT); \ - (*(volatile uint32_t*)(_r) |= (_b)); \ - }) - -//clear bit or clear bits of register -#define REG_CLR_BIT(_r, _b) ({ \ - ASSERT_IF_DPORT_REG((_r), REG_CLR_BIT); \ - (*(volatile uint32_t*)(_r) &= ~(_b)); \ - }) - -//set bits of register controlled by mask -#define REG_SET_BITS(_r, _b, _m) ({ \ - ASSERT_IF_DPORT_REG((_r), REG_SET_BITS); \ - (*(volatile uint32_t*)(_r) = (*(volatile uint32_t*)(_r) & ~(_m)) | ((_b) & (_m))); \ - }) - -//get field from register, uses field _S & _V to determine mask -#define REG_GET_FIELD(_r, _f) ({ \ - ASSERT_IF_DPORT_REG((_r), REG_GET_FIELD); \ - ((REG_READ(_r) >> (_f##_S)) & (_f##_V)); \ - }) - -//set field of a register from variable, uses field _S & _V to determine mask -#define REG_SET_FIELD(_r, _f, _v) ({ \ - ASSERT_IF_DPORT_REG((_r), REG_SET_FIELD); \ - (REG_WRITE((_r),((REG_READ(_r) & ~((_f##_V) << (_f##_S)))|(((_v) & (_f##_V))<<(_f##_S))))); \ - }) - -//get field value from a variable, used when _f is not left shifted by _f##_S -#define VALUE_GET_FIELD(_r, _f) (((_r) >> (_f##_S)) & (_f)) - -//get field value from a variable, used when _f is left shifted by _f##_S -#define VALUE_GET_FIELD2(_r, _f) (((_r) & (_f))>> (_f##_S)) - -//set field value to a variable, used when _f is not left shifted by _f##_S -#define VALUE_SET_FIELD(_r, _f, _v) ((_r)=(((_r) & ~((_f) << (_f##_S)))|((_v)<<(_f##_S)))) - -//set field value to a variable, used when _f is left shifted by _f##_S -#define VALUE_SET_FIELD2(_r, _f, _v) ((_r)=(((_r) & ~(_f))|((_v)<<(_f##_S)))) - -//generate a value from a field value, used when _f is not left shifted by _f##_S -#define FIELD_TO_VALUE(_f, _v) (((_v)&(_f))<<_f##_S) - -//generate a value from a field value, used when _f is left shifted by _f##_S -#define FIELD_TO_VALUE2(_f, _v) (((_v)<<_f##_S) & (_f)) - -//read value from register -#define READ_PERI_REG(addr) ({ \ - ASSERT_IF_DPORT_REG((addr), READ_PERI_REG); \ - (*((volatile uint32_t *)ETS_UNCACHED_ADDR(addr))); \ - }) - -//write value to register -#define WRITE_PERI_REG(addr, val) ({ \ - ASSERT_IF_DPORT_REG((addr), WRITE_PERI_REG); \ - (*((volatile uint32_t *)ETS_UNCACHED_ADDR(addr))) = (uint32_t)(val); \ - }) - -//clear bits of register controlled by mask -#define CLEAR_PERI_REG_MASK(reg, mask) ({ \ - ASSERT_IF_DPORT_REG((reg), CLEAR_PERI_REG_MASK); \ - WRITE_PERI_REG((reg), (READ_PERI_REG(reg)&(~(mask)))); \ - }) - -//set bits of register controlled by mask -#define SET_PERI_REG_MASK(reg, mask) ({ \ - ASSERT_IF_DPORT_REG((reg), SET_PERI_REG_MASK); \ - WRITE_PERI_REG((reg), (READ_PERI_REG(reg)|(mask))); \ - }) - -//get bits of register controlled by mask -#define GET_PERI_REG_MASK(reg, mask) ({ \ - ASSERT_IF_DPORT_REG((reg), GET_PERI_REG_MASK); \ - (READ_PERI_REG(reg) & (mask)); \ - }) - -//get bits of register controlled by highest bit and lowest bit -#define GET_PERI_REG_BITS(reg, hipos,lowpos) ({ \ - ASSERT_IF_DPORT_REG((reg), GET_PERI_REG_BITS); \ - ((READ_PERI_REG(reg)>>(lowpos))&((1<<((hipos)-(lowpos)+1))-1)); \ - }) - -//set bits of register controlled by mask and shift -#define SET_PERI_REG_BITS(reg,bit_map,value,shift) ({ \ - ASSERT_IF_DPORT_REG((reg), SET_PERI_REG_BITS); \ - (WRITE_PERI_REG((reg),(READ_PERI_REG(reg)&(~((bit_map)<<(shift))))|(((value) & bit_map)<<(shift)) )); \ - }) - -//get field of register -#define GET_PERI_REG_BITS2(reg, mask,shift) ({ \ - ASSERT_IF_DPORT_REG((reg), GET_PERI_REG_BITS2); \ - ((READ_PERI_REG(reg)>>(shift))&(mask)); \ - }) - -#endif /* !__ASSEMBLER__ */ -//}} - -//Periheral Clock {{ -#define APB_CLK_FREQ_ROM ( 26*1000000 ) -#define CPU_CLK_FREQ_ROM APB_CLK_FREQ_ROM -#define CPU_CLK_FREQ APB_CLK_FREQ -#define APB_CLK_FREQ ( 80*1000000 ) //unit: Hz -#define REF_CLK_FREQ ( 1000000 ) -#define UART_CLK_FREQ APB_CLK_FREQ -#define WDT_CLK_FREQ APB_CLK_FREQ -#define TIMER_CLK_FREQ (80000000>>4) //80MHz divided by 16 -#define SPI_CLK_DIV 4 -#define TICKS_PER_US_ROM 26 // CPU is 80MHz -//}} - -/* Overall memory map */ -#define SOC_DROM_LOW 0x3F400000 -#define SOC_DROM_HIGH 0x3F800000 -#define SOC_IROM_LOW 0x400D0000 -#define SOC_IROM_HIGH 0x40400000 -#define SOC_IROM_MASK_LOW 0x40000000 -#define SOC_IROM_MASK_HIGH 0x40070000 -#define SOC_CACHE_PRO_LOW 0x40070000 -#define SOC_CACHE_PRO_HIGH 0x40078000 -#define SOC_CACHE_APP_LOW 0x40078000 -#define SOC_CACHE_APP_HIGH 0x40080000 -#define SOC_IRAM_LOW 0x40080000 -#define SOC_IRAM_HIGH 0x400A0000 -#define SOC_RTC_IRAM_LOW 0x400C0000 -#define SOC_RTC_IRAM_HIGH 0x400C2000 -#define SOC_RTC_DRAM_LOW 0x3FF80000 -#define SOC_RTC_DRAM_HIGH 0x3FF82000 -#define SOC_RTC_DATA_LOW 0x50000000 -#define SOC_RTC_DATA_HIGH 0x50002000 - -//First and last words of the D/IRAM region, for both the DRAM address as well as the IRAM alias. -#define SOC_DIRAM_IRAM_LOW 0x400A0000 -#define SOC_DIRAM_IRAM_HIGH 0x400BFFFC -#define SOC_DIRAM_DRAM_LOW 0x3FFE0000 -#define SOC_DIRAM_DRAM_HIGH 0x3FFFFFFC - -// Region of memory accessible via DMA. See esp_ptr_dma_capable(). -#define SOC_DMA_LOW 0x3FFAE000 -#define SOC_DMA_HIGH 0x40000000 - -// Region of memory that is byte-accessible. See esp_ptr_byte_accessible(). -#define SOC_BYTE_ACCESSIBLE_LOW 0x3FF90000 -#define SOC_BYTE_ACCESSIBLE_HIGH 0x40000000 - -//Region of memory that is internal, as in on the same silicon die as the ESP32 CPUs -//(excluding RTC data region, that's checked separately.) See esp_ptr_internal(). -#define SOC_MEM_INTERNAL_LOW 0x3FF90000 -#define SOC_MEM_INTERNAL_HIGH 0x400C2000 - -//Interrupt hardware source table -//This table is decided by hardware, don't touch this. -#define ETS_WIFI_MAC_INTR_SOURCE 0/**< interrupt of WiFi MAC, level*/ -#define ETS_WIFI_MAC_NMI_SOURCE 1/**< interrupt of WiFi MAC, NMI, use if MAC have bug to fix in NMI*/ -#define ETS_WIFI_BB_INTR_SOURCE 2/**< interrupt of WiFi BB, level, we can do some calibartion*/ -#define ETS_BT_MAC_INTR_SOURCE 3/**< will be cancelled*/ -#define ETS_BT_BB_INTR_SOURCE 4/**< interrupt of BT BB, level*/ -#define ETS_BT_BB_NMI_SOURCE 5/**< interrupt of BT BB, NMI, use if BB have bug to fix in NMI*/ -#define ETS_RWBT_INTR_SOURCE 6/**< interrupt of RWBT, level*/ -#define ETS_RWBLE_INTR_SOURCE 7/**< interrupt of RWBLE, level*/ -#define ETS_RWBT_NMI_SOURCE 8/**< interrupt of RWBT, NMI, use if RWBT have bug to fix in NMI*/ -#define ETS_RWBLE_NMI_SOURCE 9/**< interrupt of RWBLE, NMI, use if RWBT have bug to fix in NMI*/ -#define ETS_SLC0_INTR_SOURCE 10/**< interrupt of SLC0, level*/ -#define ETS_SLC1_INTR_SOURCE 11/**< interrupt of SLC1, level*/ -#define ETS_UHCI0_INTR_SOURCE 12/**< interrupt of UHCI0, level*/ -#define ETS_UHCI1_INTR_SOURCE 13/**< interrupt of UHCI1, level*/ -#define ETS_TG0_T0_LEVEL_INTR_SOURCE 14/**< interrupt of TIMER_GROUP0, TIMER0, level, we would like use EDGE for timer if permission*/ -#define ETS_TG0_T1_LEVEL_INTR_SOURCE 15/**< interrupt of TIMER_GROUP0, TIMER1, level, we would like use EDGE for timer if permission*/ -#define ETS_TG0_WDT_LEVEL_INTR_SOURCE 16/**< interrupt of TIMER_GROUP0, WATCHDOG, level*/ -#define ETS_TG0_LACT_LEVEL_INTR_SOURCE 17/**< interrupt of TIMER_GROUP0, LACT, level*/ -#define ETS_TG1_T0_LEVEL_INTR_SOURCE 18/**< interrupt of TIMER_GROUP1, TIMER0, level, we would like use EDGE for timer if permission*/ -#define ETS_TG1_T1_LEVEL_INTR_SOURCE 19/**< interrupt of TIMER_GROUP1, TIMER1, level, we would like use EDGE for timer if permission*/ -#define ETS_TG1_WDT_LEVEL_INTR_SOURCE 20/**< interrupt of TIMER_GROUP1, WATCHDOG, level*/ -#define ETS_TG1_LACT_LEVEL_INTR_SOURCE 21/**< interrupt of TIMER_GROUP1, LACT, level*/ -#define ETS_GPIO_INTR_SOURCE 22/**< interrupt of GPIO, level*/ -#define ETS_GPIO_NMI_SOURCE 23/**< interrupt of GPIO, NMI*/ -#define ETS_FROM_CPU_INTR0_SOURCE 24/**< interrupt0 generated from a CPU, level*/ /* Used for FreeRTOS */ -#define ETS_FROM_CPU_INTR1_SOURCE 25/**< interrupt1 generated from a CPU, level*/ /* Used for FreeRTOS */ -#define ETS_FROM_CPU_INTR2_SOURCE 26/**< interrupt2 generated from a CPU, level*/ /* Used for DPORT Access */ -#define ETS_FROM_CPU_INTR3_SOURCE 27/**< interrupt3 generated from a CPU, level*/ /* Used for DPORT Access */ -#define ETS_SPI0_INTR_SOURCE 28/**< interrupt of SPI0, level, SPI0 is for Cache Access, do not use this*/ -#define ETS_SPI1_INTR_SOURCE 29/**< interrupt of SPI1, level, SPI1 is for flash read/write, do not use this*/ -#define ETS_SPI2_INTR_SOURCE 30/**< interrupt of SPI2, level*/ -#define ETS_SPI3_INTR_SOURCE 31/**< interrupt of SPI3, level*/ -#define ETS_I2S0_INTR_SOURCE 32/**< interrupt of I2S0, level*/ -#define ETS_I2S1_INTR_SOURCE 33/**< interrupt of I2S1, level*/ -#define ETS_UART0_INTR_SOURCE 34/**< interrupt of UART0, level*/ -#define ETS_UART1_INTR_SOURCE 35/**< interrupt of UART1, level*/ -#define ETS_UART2_INTR_SOURCE 36/**< interrupt of UART2, level*/ -#define ETS_SDIO_HOST_INTR_SOURCE 37/**< interrupt of SD/SDIO/MMC HOST, level*/ -#define ETS_ETH_MAC_INTR_SOURCE 38/**< interrupt of ethernet mac, level*/ -#define ETS_PWM0_INTR_SOURCE 39/**< interrupt of PWM0, level, Reserved*/ -#define ETS_PWM1_INTR_SOURCE 40/**< interrupt of PWM1, level, Reserved*/ -#define ETS_PWM2_INTR_SOURCE 41/**< interrupt of PWM2, level*/ -#define ETS_PWM3_INTR_SOURCE 42/**< interruot of PWM3, level*/ -#define ETS_LEDC_INTR_SOURCE 43/**< interrupt of LED PWM, level*/ -#define ETS_EFUSE_INTR_SOURCE 44/**< interrupt of efuse, level, not likely to use*/ -#define ETS_CAN_INTR_SOURCE 45/**< interrupt of can, level*/ -#define ETS_RTC_CORE_INTR_SOURCE 46/**< interrupt of rtc core, level, include rtc watchdog*/ -#define ETS_RMT_INTR_SOURCE 47/**< interrupt of remote controller, level*/ -#define ETS_PCNT_INTR_SOURCE 48/**< interrupt of pluse count, level*/ -#define ETS_I2C_EXT0_INTR_SOURCE 49/**< interrupt of I2C controller1, level*/ -#define ETS_I2C_EXT1_INTR_SOURCE 50/**< interrupt of I2C controller0, level*/ -#define ETS_RSA_INTR_SOURCE 51/**< interrupt of RSA accelerator, level*/ -#define ETS_SPI1_DMA_INTR_SOURCE 52/**< interrupt of SPI1 DMA, SPI1 is for flash read/write, do not use this*/ -#define ETS_SPI2_DMA_INTR_SOURCE 53/**< interrupt of SPI2 DMA, level*/ -#define ETS_SPI3_DMA_INTR_SOURCE 54/**< interrupt of SPI3 DMA, level*/ -#define ETS_WDT_INTR_SOURCE 55/**< will be cancelled*/ -#define ETS_TIMER1_INTR_SOURCE 56/**< will be cancelled*/ -#define ETS_TIMER2_INTR_SOURCE 57/**< will be cancelled*/ -#define ETS_TG0_T0_EDGE_INTR_SOURCE 58/**< interrupt of TIMER_GROUP0, TIMER0, EDGE*/ -#define ETS_TG0_T1_EDGE_INTR_SOURCE 59/**< interrupt of TIMER_GROUP0, TIMER1, EDGE*/ -#define ETS_TG0_WDT_EDGE_INTR_SOURCE 60/**< interrupt of TIMER_GROUP0, WATCH DOG, EDGE*/ -#define ETS_TG0_LACT_EDGE_INTR_SOURCE 61/**< interrupt of TIMER_GROUP0, LACT, EDGE*/ -#define ETS_TG1_T0_EDGE_INTR_SOURCE 62/**< interrupt of TIMER_GROUP1, TIMER0, EDGE*/ -#define ETS_TG1_T1_EDGE_INTR_SOURCE 63/**< interrupt of TIMER_GROUP1, TIMER1, EDGE*/ -#define ETS_TG1_WDT_EDGE_INTR_SOURCE 64/**< interrupt of TIMER_GROUP1, WATCHDOG, EDGE*/ -#define ETS_TG1_LACT_EDGE_INTR_SOURCE 65/**< interrupt of TIMER_GROUP0, LACT, EDGE*/ -#define ETS_MMU_IA_INTR_SOURCE 66/**< interrupt of MMU Invalid Access, LEVEL*/ -#define ETS_MPU_IA_INTR_SOURCE 67/**< interrupt of MPU Invalid Access, LEVEL*/ -#define ETS_CACHE_IA_INTR_SOURCE 68/**< interrupt of Cache Invalied Access, LEVEL*/ - -//interrupt cpu using table, Please see the core-isa.h -/************************************************************************************************************* - * Intr num Level Type PRO CPU usage APP CPU uasge - * 0 1 extern level WMAC Reserved - * 1 1 extern level BT/BLE Host HCI DMA BT/BLE Host HCI DMA - * 2 1 extern level - * 3 1 extern level - * 4 1 extern level WBB - * 5 1 extern level BT/BLE Controller BT/BLE Controller - * 6 1 timer FreeRTOS Tick(L1) FreeRTOS Tick(L1) - * 7 1 software BT/BLE VHCI BT/BLE VHCI - * 8 1 extern level BT/BLE BB(RX/TX) BT/BLE BB(RX/TX) - * 9 1 extern level - * 10 1 extern edge - * 11 3 profiling - * 12 1 extern level - * 13 1 extern level - * 14 7 nmi Reserved Reserved - * 15 3 timer FreeRTOS Tick(L3) FreeRTOS Tick(L3) - * 16 5 timer - * 17 1 extern level - * 18 1 extern level - * 19 2 extern level - * 20 2 extern level - * 21 2 extern level - * 22 3 extern edge - * 23 3 extern level - * 24 4 extern level TG1_WDT - * 25 4 extern level CACHEERR - * 26 5 extern level - * 27 3 extern level Reserved Reserved - * 28 4 extern edge DPORT ACCESS DPORT ACCESS - * 29 3 software Reserved Reserved - * 30 4 extern edge Reserved Reserved - * 31 5 extern level - ************************************************************************************************************* - */ - -//CPU0 Interrupt number reserved, not touch this. -#define ETS_WMAC_INUM 0 -#define ETS_BT_HOST_INUM 1 -#define ETS_WBB_INUM 4 -#define ETS_TG0_T1_INUM 10 /**< use edge interrupt*/ -#define ETS_FRC1_INUM 22 -#define ETS_T1_WDT_INUM 24 -#define ETS_CACHEERR_INUM 25 -#define ETS_DPORT_INUM 28 - -//CPU0 Interrupt number used in ROM, should be cancelled in SDK -#define ETS_SLC_INUM 1 -#define ETS_UART0_INUM 5 -#define ETS_UART1_INUM 5 -//Other interrupt number should be managed by the user - -//Invalid interrupt for number interrupt matrix -#define ETS_INVALID_INUM 6 - -#endif /* _ESP32_SOC_H_ */ diff --git a/tools/sdk/include/soc/soc/soc_memory_layout.h b/tools/sdk/include/soc/soc/soc_memory_layout.h deleted file mode 100644 index fd7132cfa67..00000000000 --- a/tools/sdk/include/soc/soc/soc_memory_layout.h +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright 2010-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. -#pragma once -#include -#include -#include - -#include "soc/soc.h" -#include "sdkconfig.h" -#include "esp_attr.h" - -#ifdef CONFIG_BT_ENABLED - -#define SOC_MEM_BT_DATA_START 0x3ffae6e0 -#define SOC_MEM_BT_DATA_END 0x3ffaff10 -#define SOC_MEM_BT_EM_START 0x3ffb0000 -#define SOC_MEM_BT_EM_END 0x3ffb7cd8 -#define SOC_MEM_BT_EM_BTDM0_START 0x3ffb0000 -#define SOC_MEM_BT_EM_BTDM0_END 0x3ffb09a8 -#define SOC_MEM_BT_EM_BLE_START 0x3ffb09a8 -#define SOC_MEM_BT_EM_BLE_END 0x3ffb1ddc -#define SOC_MEM_BT_EM_BTDM1_START 0x3ffb1ddc -#define SOC_MEM_BT_EM_BTDM1_END 0x3ffb2730 -#define SOC_MEM_BT_EM_BREDR_START 0x3ffb2730 -#define SOC_MEM_BT_EM_BREDR_NO_SYNC_END 0x3ffb6388 //Not calculate with synchronize connection support -#define SOC_MEM_BT_EM_BREDR_END 0x3ffb7cd8 //Calculate with synchronize connection support -#define SOC_MEM_BT_EM_SYNC0_START 0x3ffb6388 -#define SOC_MEM_BT_EM_SYNC0_END 0x3ffb6bf8 -#define SOC_MEM_BT_EM_SYNC1_START 0x3ffb6bf8 -#define SOC_MEM_BT_EM_SYNC1_END 0x3ffb7468 -#define SOC_MEM_BT_EM_SYNC2_START 0x3ffb7468 -#define SOC_MEM_BT_EM_SYNC2_END 0x3ffb7cd8 -#define SOC_MEM_BT_BSS_START 0x3ffb8000 -#define SOC_MEM_BT_BSS_END 0x3ffb9a20 -#define SOC_MEM_BT_MISC_START 0x3ffbdb28 -#define SOC_MEM_BT_MISC_END 0x3ffbdb5c - -#define SOC_MEM_BT_EM_PER_SYNC_SIZE 0x870 - -#define SOC_MEM_BT_EM_BREDR_REAL_END (SOC_MEM_BT_EM_BREDR_NO_SYNC_END + CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_EFF * SOC_MEM_BT_EM_PER_SYNC_SIZE) - -#endif //CONFIG_BT_ENABLED - -#define SOC_MEMORY_TYPE_NO_PRIOS 3 - -/* Type descriptor holds a description for a particular type of memory on a particular SoC. - */ -typedef struct { - const char *name; ///< Name of this memory type - uint32_t caps[SOC_MEMORY_TYPE_NO_PRIOS]; ///< Capabilities for this memory type (as a prioritised set) - bool aliased_iram; ///< If true, this is data memory that is is also mapped in IRAM - bool startup_stack; ///< If true, memory of this type is used for ROM stack during startup -} soc_memory_type_desc_t; - -/* Constant table of tag descriptors for all this SoC's tags */ -extern const soc_memory_type_desc_t soc_memory_types[]; -extern const size_t soc_memory_type_count; - -/* Region descriptor holds a description for a particular region of memory on a particular SoC. - */ -typedef struct -{ - intptr_t start; ///< Start address of the region - size_t size; ///< Size of the region in bytes - size_t type; ///< Type of the region (index into soc_memory_types array) - intptr_t iram_address; ///< If non-zero, is equivalent address in IRAM -} soc_memory_region_t; - -extern const soc_memory_region_t soc_memory_regions[]; -extern const size_t soc_memory_region_count; - -/* Region descriptor holds a description for a particular region of - memory reserved on this SoC for a particular use (ie not available - for stack/heap usage.) */ -typedef struct -{ - intptr_t start; - intptr_t end; -} soc_reserved_region_t; - -/* Use this macro to reserved a fixed region of RAM (hardcoded addresses) - * for a particular purpose. - * - * Usually used to mark out memory addresses needed for hardware or ROM code - * purposes. - * - * Don't call this macro from user code which can use normal C static allocation - * instead. - * - * @param START Start address to be reserved. - * @param END One after the address of the last byte to be reserved. (ie length of - * the reserved region is (END - START) in bytes. - * @param NAME Name for the reserved region. Must be a valid variable name, - * unique to this source file. - */ -#define SOC_RESERVE_MEMORY_REGION(START, END, NAME) \ - __attribute__((section(".reserved_memory_address"))) __attribute__((used)) \ - static soc_reserved_region_t reserved_region_##NAME = { START, END }; - -/* Return available memory regions for this SoC. Each available memory - * region is a contiguous piece of memory which is not being used by - * static data, used by ROM code, or reserved by a component using - * the SOC_RESERVE_MEMORY_REGION() macro. - * - * This result is soc_memory_regions[] minus all regions reserved - * via the SOC_RESERVE_MEMORY_REGION() macro (which may also split - * some regions up.) - * - * At startup, all available memory returned by this function is - * registered as heap space. - * - * @note OS-level startup function only, not recommended to call from - * app code. - * - * @param regions Pointer to an array for reading available regions into. - * Size of the array should be at least the result of - * soc_get_available_memory_region_max_count(). Entries in the array - * will be ordered by memory address. - * - * @return Number of entries copied to 'regions'. Will be no greater than - * the result of soc_get_available_memory_region_max_count(). - */ -size_t soc_get_available_memory_regions(soc_memory_region_t *regions); - -/* Return the maximum number of available memory regions which could be - * returned by soc_get_available_memory_regions(). Used to size the - * array passed to that function. - */ -size_t soc_get_available_memory_region_max_count(); - -inline static bool IRAM_ATTR esp_ptr_dma_capable(const void *p) -{ - return (intptr_t)p >= SOC_DMA_LOW && (intptr_t)p < SOC_DMA_HIGH; -} - -inline static bool IRAM_ATTR esp_ptr_executable(const void *p) -{ - intptr_t ip = (intptr_t) p; - return (ip >= SOC_IROM_LOW && ip < SOC_IROM_HIGH) - || (ip >= SOC_IRAM_LOW && ip < SOC_IRAM_HIGH) - || (ip >= SOC_RTC_IRAM_LOW && ip < SOC_RTC_IRAM_HIGH); -} - -inline static bool IRAM_ATTR esp_ptr_byte_accessible(const void *p) -{ - bool r; - r = ((intptr_t)p >= SOC_BYTE_ACCESSIBLE_LOW && (intptr_t)p < SOC_BYTE_ACCESSIBLE_HIGH); -#if CONFIG_SPIRAM_SUPPORT - r |= ((intptr_t)p >= SOC_EXTRAM_DATA_LOW && (intptr_t)p < SOC_EXTRAM_DATA_HIGH); -#endif - return r; -} - -inline static bool IRAM_ATTR esp_ptr_internal(const void *p) { - bool r; - r = ((intptr_t)p >= SOC_MEM_INTERNAL_LOW && (intptr_t)p < SOC_MEM_INTERNAL_HIGH); - r |= ((intptr_t)p >= SOC_RTC_DATA_LOW && (intptr_t)p < SOC_RTC_DATA_HIGH); - return r; -} - - -inline static bool IRAM_ATTR esp_ptr_external_ram(const void *p) { - return ((intptr_t)p >= SOC_EXTRAM_DATA_LOW && (intptr_t)p < SOC_EXTRAM_DATA_HIGH); -} - -inline static bool IRAM_ATTR esp_ptr_in_iram(const void *p) { -#ifndef CONFIG_FREERTOS_UNICORE - return ((intptr_t)p >= SOC_IRAM_LOW && (intptr_t)p < SOC_IRAM_HIGH); -#else - return ((intptr_t)p >= SOC_CACHE_APP_LOW && (intptr_t)p < SOC_IRAM_HIGH); -#endif -} - -inline static bool IRAM_ATTR esp_ptr_in_drom(const void *p) { - return ((intptr_t)p >= SOC_DROM_LOW && (intptr_t)p < SOC_DROM_HIGH); -} - -inline static bool IRAM_ATTR esp_ptr_in_dram(const void *p) { - return ((intptr_t)p >= SOC_DRAM_LOW && (intptr_t)p < SOC_DRAM_HIGH); -} - -inline static bool IRAM_ATTR esp_ptr_in_diram_dram(const void *p) { - return ((intptr_t)p >= SOC_DIRAM_DRAM_LOW && (intptr_t)p < SOC_DIRAM_DRAM_HIGH); -} - -inline static bool IRAM_ATTR esp_ptr_in_diram_iram(const void *p) { - return ((intptr_t)p >= SOC_DIRAM_IRAM_LOW && (intptr_t)p < SOC_DIRAM_IRAM_HIGH); -} diff --git a/tools/sdk/include/soc/soc/soc_ulp.h b/tools/sdk/include/soc/soc/soc_ulp.h deleted file mode 100644 index e8c20d2b565..00000000000 --- a/tools/sdk/include/soc/soc/soc_ulp.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2010-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. -#pragma once - -// This file contains various convenience macros to be used in ULP programs. - -// Helper macros to calculate bit field width from mask, using the preprocessor. -// Used later in READ_RTC_FIELD and WRITE_RTC_FIELD. -#define IS_BIT_SET(m, i) (((m) >> (i)) & 1) -#define MASK_TO_WIDTH_HELPER1(m, i) IS_BIT_SET(m, i) -#define MASK_TO_WIDTH_HELPER2(m, i) (MASK_TO_WIDTH_HELPER1(m, i) + MASK_TO_WIDTH_HELPER1(m, i + 1)) -#define MASK_TO_WIDTH_HELPER4(m, i) (MASK_TO_WIDTH_HELPER2(m, i) + MASK_TO_WIDTH_HELPER2(m, i + 2)) -#define MASK_TO_WIDTH_HELPER8(m, i) (MASK_TO_WIDTH_HELPER4(m, i) + MASK_TO_WIDTH_HELPER4(m, i + 4)) -#define MASK_TO_WIDTH_HELPER16(m, i) (MASK_TO_WIDTH_HELPER8(m, i) + MASK_TO_WIDTH_HELPER8(m, i + 8)) -#define MASK_TO_WIDTH_HELPER32(m, i) (MASK_TO_WIDTH_HELPER16(m, i) + MASK_TO_WIDTH_HELPER16(m, i + 16)) - -// Peripheral register access macros, build around REG_RD and REG_WR instructions. -// Registers defined in rtc_cntl_reg.h, rtc_io_reg.h, sens_reg.h, and rtc_i2c_reg.h are usable with these macros. - -// Read from rtc_reg[low_bit + bit_width - 1 : low_bit] into R0, bit_width <= 16 -#define READ_RTC_REG(rtc_reg, low_bit, bit_width) \ - REG_RD (((rtc_reg) - DR_REG_RTCCNTL_BASE) / 4), ((low_bit) + (bit_width) - 1), (low_bit) - -// Write immediate value into rtc_reg[low_bit + bit_width - 1 : low_bit], bit_width <= 8 -#define WRITE_RTC_REG(rtc_reg, low_bit, bit_width, value) \ - REG_WR (((rtc_reg) - DR_REG_RTCCNTL_BASE) / 4), ((low_bit) + (bit_width) - 1), (low_bit), ((value) & 0xff) - -// Read from a field in rtc_reg into R0, up to 16 bits -#define READ_RTC_FIELD(rtc_reg, field) \ - READ_RTC_REG(rtc_reg, field ## _S, MASK_TO_WIDTH_HELPER16(field ## _V, 0)) - -// Write immediate value into a field in rtc_reg, up to 8 bits -#define WRITE_RTC_FIELD(rtc_reg, field, value) \ - WRITE_RTC_REG(rtc_reg, field ## _S, MASK_TO_WIDTH_HELPER8(field ## _V, 0), ((value) & field ## _V)) - diff --git a/tools/sdk/include/soc/soc/spi_periph.h b/tools/sdk/include/soc/soc/spi_periph.h deleted file mode 100644 index 19b3f745125..00000000000 --- a/tools/sdk/include/soc/soc/spi_periph.h +++ /dev/null @@ -1,66 +0,0 @@ -// 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. - -#ifndef _SOC_SPI_PERIPH_H_ -#define _SOC_SPI_PERIPH_H_ - -#include -#include "soc/soc.h" -#include "soc/periph_defs.h" -//include soc related (generated) definitions -#include "soc/spi_pins.h" -#include "soc/spi_reg.h" -#include "soc/spi_struct.h" -#include "soc/gpio_sig_map.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* - Stores a bunch of per-spi-peripheral data. -*/ -typedef struct { - const uint8_t spiclk_out; //GPIO mux output signals - const uint8_t spiclk_in; - const uint8_t spid_out; - const uint8_t spiq_out; - const uint8_t spiwp_out; - const uint8_t spihd_out; - const uint8_t spid_in; //GPIO mux input signals - const uint8_t spiq_in; - const uint8_t spiwp_in; - const uint8_t spihd_in; - const uint8_t spics_out[3]; // /CS GPIO output mux signals - const uint8_t spics_in; - const uint8_t spiclk_iomux_pin; //IO pins of IO_MUX muxed signals - const uint8_t spid_iomux_pin; - const uint8_t spiq_iomux_pin; - const uint8_t spiwp_iomux_pin; - const uint8_t spihd_iomux_pin; - const uint8_t spics0_iomux_pin; - const uint8_t irq; //irq source for interrupt mux - const uint8_t irq_dma; //dma irq source for interrupt mux - const periph_module_t module; //peripheral module, for enabling clock etc - spi_dev_t *hw; //Pointer to the hardware registers -} spi_signal_conn_t; - -extern const spi_signal_conn_t spi_periph_signal[3]; - -#ifdef __cplusplus -} -#endif - -#endif /* _SOC_SPI_PERIPH_H_ */ \ No newline at end of file diff --git a/tools/sdk/include/soc/soc/spi_pins.h b/tools/sdk/include/soc/soc/spi_pins.h deleted file mode 100644 index eb7af858273..00000000000 --- a/tools/sdk/include/soc/soc/spi_pins.h +++ /dev/null @@ -1,39 +0,0 @@ -// 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. - -#ifndef _SOC_SPI_PINS_H_ -#define _SOC_SPI_PINS_H_ - -#define SPI_IOMUX_PIN_NUM_MISO 7 -#define SPI_IOMUX_PIN_NUM_MOSI 8 -#define SPI_IOMUX_PIN_NUM_CLK 6 -#define SPI_IOMUX_PIN_NUM_CS 11 -#define SPI_IOMUX_PIN_NUM_WP 10 -#define SPI_IOMUX_PIN_NUM_HD 9 - -#define HSPI_IOMUX_PIN_NUM_MISO 12 -#define HSPI_IOMUX_PIN_NUM_MOSI 13 -#define HSPI_IOMUX_PIN_NUM_CLK 14 -#define HSPI_IOMUX_PIN_NUM_CS 15 -#define HSPI_IOMUX_PIN_NUM_WP 2 -#define HSPI_IOMUX_PIN_NUM_HD 4 - -#define VSPI_IOMUX_PIN_NUM_MISO 19 -#define VSPI_IOMUX_PIN_NUM_MOSI 23 -#define VSPI_IOMUX_PIN_NUM_CLK 18 -#define VSPI_IOMUX_PIN_NUM_CS 5 -#define VSPI_IOMUX_PIN_NUM_WP 22 -#define VSPI_IOMUX_PIN_NUM_HD 21 - -#endif /* _SOC_SPI_PINS_H_ */ \ No newline at end of file diff --git a/tools/sdk/include/soc/soc/spi_reg.h b/tools/sdk/include/soc/soc/spi_reg.h deleted file mode 100644 index fac2965c786..00000000000 --- a/tools/sdk/include/soc/soc/spi_reg.h +++ /dev/null @@ -1,1713 +0,0 @@ -// 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. -#ifndef __SPI_REG_H__ -#define __SPI_REG_H__ - - -#include "soc.h" -#define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i)>1) ? (((i)* 0x1000) + 0x20000) : (((~(i)) & 1)* 0x1000 ))) - -#define SPI_CMD_REG(i) (REG_SPI_BASE(i) + 0x0) -/* SPI_FLASH_READ : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: Read flash enable. Read flash operation will be triggered when - the bit is set. The bit will be cleared once the operation done. 1: enable 0: disable.*/ -#define SPI_FLASH_READ (BIT(31)) -#define SPI_FLASH_READ_M (BIT(31)) -#define SPI_FLASH_READ_V 0x1 -#define SPI_FLASH_READ_S 31 -/* SPI_FLASH_WREN : R/W ;bitpos:[30] ;default: 1'b0 ; */ -/*description: Write flash enable. Write enable command will be sent when the - bit is set. The bit will be cleared once the operation done. 1: enable 0: disable.*/ -#define SPI_FLASH_WREN (BIT(30)) -#define SPI_FLASH_WREN_M (BIT(30)) -#define SPI_FLASH_WREN_V 0x1 -#define SPI_FLASH_WREN_S 30 -/* SPI_FLASH_WRDI : R/W ;bitpos:[29] ;default: 1'b0 ; */ -/*description: Write flash disable. Write disable command will be sent when - the bit is set. The bit will be cleared once the operation done. 1: enable 0: disable.*/ -#define SPI_FLASH_WRDI (BIT(29)) -#define SPI_FLASH_WRDI_M (BIT(29)) -#define SPI_FLASH_WRDI_V 0x1 -#define SPI_FLASH_WRDI_S 29 -/* SPI_FLASH_RDID : R/W ;bitpos:[28] ;default: 1'b0 ; */ -/*description: Read JEDEC ID . Read ID command will be sent when the bit is - set. The bit will be cleared once the operation done. 1: enable 0: disable.*/ -#define SPI_FLASH_RDID (BIT(28)) -#define SPI_FLASH_RDID_M (BIT(28)) -#define SPI_FLASH_RDID_V 0x1 -#define SPI_FLASH_RDID_S 28 -/* SPI_FLASH_RDSR : R/W ;bitpos:[27] ;default: 1'b0 ; */ -/*description: Read status register-1. Read status operation will be triggered - when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ -#define SPI_FLASH_RDSR (BIT(27)) -#define SPI_FLASH_RDSR_M (BIT(27)) -#define SPI_FLASH_RDSR_V 0x1 -#define SPI_FLASH_RDSR_S 27 -/* SPI_FLASH_WRSR : R/W ;bitpos:[26] ;default: 1'b0 ; */ -/*description: Write status register enable. Write status operation will - be triggered when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ -#define SPI_FLASH_WRSR (BIT(26)) -#define SPI_FLASH_WRSR_M (BIT(26)) -#define SPI_FLASH_WRSR_V 0x1 -#define SPI_FLASH_WRSR_S 26 -/* SPI_FLASH_PP : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: Page program enable(1 byte ~256 bytes data to be programmed). - Page program operation will be triggered when the bit is set. The bit will be cleared once the operation done .1: enable 0: disable.*/ -#define SPI_FLASH_PP (BIT(25)) -#define SPI_FLASH_PP_M (BIT(25)) -#define SPI_FLASH_PP_V 0x1 -#define SPI_FLASH_PP_S 25 -/* SPI_FLASH_SE : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: Sector erase enable. A 4KB sector is erased via SPI command 20H. Sector erase operation will be triggered - when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ -#define SPI_FLASH_SE (BIT(24)) -#define SPI_FLASH_SE_M (BIT(24)) -#define SPI_FLASH_SE_V 0x1 -#define SPI_FLASH_SE_S 24 -/* SPI_FLASH_BE : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: Block erase enable. A 64KB block is erased via SPI command D8H. Block erase operation will be triggered - when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ -#define SPI_FLASH_BE (BIT(23)) -#define SPI_FLASH_BE_M (BIT(23)) -#define SPI_FLASH_BE_V 0x1 -#define SPI_FLASH_BE_S 23 -/* SPI_FLASH_CE : R/W ;bitpos:[22] ;default: 1'b0 ; */ -/*description: Chip erase enable. Chip erase operation will be triggered when - the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ -#define SPI_FLASH_CE (BIT(22)) -#define SPI_FLASH_CE_M (BIT(22)) -#define SPI_FLASH_CE_V 0x1 -#define SPI_FLASH_CE_S 22 -/* SPI_FLASH_DP : R/W ;bitpos:[21] ;default: 1'b0 ; */ -/*description: Drive Flash into power down. An operation will be triggered - when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ -#define SPI_FLASH_DP (BIT(21)) -#define SPI_FLASH_DP_M (BIT(21)) -#define SPI_FLASH_DP_V 0x1 -#define SPI_FLASH_DP_S 21 -/* SPI_FLASH_RES : R/W ;bitpos:[20] ;default: 1'b0 ; */ -/*description: This bit combined with reg_resandres bit releases Flash from - the power-down state or high performance mode and obtains the devices ID. The bit will be cleared once the operation done.1: enable 0: disable.*/ -#define SPI_FLASH_RES (BIT(20)) -#define SPI_FLASH_RES_M (BIT(20)) -#define SPI_FLASH_RES_V 0x1 -#define SPI_FLASH_RES_S 20 -/* SPI_FLASH_HPM : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: Drive Flash into high performance mode. The bit will be cleared - once the operation done.1: enable 0: disable.*/ -#define SPI_FLASH_HPM (BIT(19)) -#define SPI_FLASH_HPM_M (BIT(19)) -#define SPI_FLASH_HPM_V 0x1 -#define SPI_FLASH_HPM_S 19 -/* SPI_USR : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: User define command enable. An operation will be triggered when - the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ -#define SPI_USR (BIT(18)) -#define SPI_USR_M (BIT(18)) -#define SPI_USR_V 0x1 -#define SPI_USR_S 18 -/* SPI_FLASH_PES : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: program erase suspend bit program erase suspend operation will - be triggered when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ -#define SPI_FLASH_PES (BIT(17)) -#define SPI_FLASH_PES_M (BIT(17)) -#define SPI_FLASH_PES_V 0x1 -#define SPI_FLASH_PES_S 17 -/* SPI_FLASH_PER : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: program erase resume bit program erase suspend operation will - be triggered when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ -#define SPI_FLASH_PER (BIT(16)) -#define SPI_FLASH_PER_M (BIT(16)) -#define SPI_FLASH_PER_V 0x1 -#define SPI_FLASH_PER_S 16 - -#define SPI_ADDR_REG(i) (REG_SPI_BASE(i) + 0x4) -//The CSV actually is wrong here. It indicates that the lower 8 bits of this register are reserved. This is not true, -//all 32 bits of SPI_ADDR_REG are usable/used. - -#define SPI_CTRL_REG(i) (REG_SPI_BASE(i) + 0x8) -/* SPI_WR_BIT_ORDER : R/W ;bitpos:[26] ;default: 1'b0 ; */ -/*description: In command address write-data (MOSI) phases 1: LSB firs 0: MSB first*/ -#define SPI_WR_BIT_ORDER (BIT(26)) -#define SPI_WR_BIT_ORDER_M (BIT(26)) -#define SPI_WR_BIT_ORDER_V 0x1 -#define SPI_WR_BIT_ORDER_S 26 -/* SPI_RD_BIT_ORDER : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: In read-data (MISO) phase 1: LSB first 0: MSB first*/ -#define SPI_RD_BIT_ORDER (BIT(25)) -#define SPI_RD_BIT_ORDER_M (BIT(25)) -#define SPI_RD_BIT_ORDER_V 0x1 -#define SPI_RD_BIT_ORDER_S 25 -/* SPI_FREAD_QIO : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: In the read operations address phase and read-data phase apply - 4 signals. 1: enable 0: disable.*/ -#define SPI_FREAD_QIO (BIT(24)) -#define SPI_FREAD_QIO_M (BIT(24)) -#define SPI_FREAD_QIO_V 0x1 -#define SPI_FREAD_QIO_S 24 -/* SPI_FREAD_DIO : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: In the read operations address phase and read-data phase apply - 2 signals. 1: enable 0: disable.*/ -#define SPI_FREAD_DIO (BIT(23)) -#define SPI_FREAD_DIO_M (BIT(23)) -#define SPI_FREAD_DIO_V 0x1 -#define SPI_FREAD_DIO_S 23 -/* SPI_WRSR_2B : R/W ;bitpos:[22] ;default: 1'b0 ; */ -/*description: two bytes data will be written to status register when it is - set. 1: enable 0: disable.*/ -#define SPI_WRSR_2B (BIT(22)) -#define SPI_WRSR_2B_M (BIT(22)) -#define SPI_WRSR_2B_V 0x1 -#define SPI_WRSR_2B_S 22 -/* SPI_WP_REG : R/W ;bitpos:[21] ;default: 1'b1 ; */ -/*description: Write protect signal output when SPI is idle. 1: output high 0: output low.*/ -#define SPI_WP_REG (BIT(21)) -#define SPI_WP_REG_M (BIT(21)) -#define SPI_WP_REG_V 0x1 -#define SPI_WP_REG_S 21 -/* SPI_FREAD_QUAD : R/W ;bitpos:[20] ;default: 1'b0 ; */ -/*description: In the read operations read-data phase apply 4 signals. 1: enable 0: disable.*/ -#define SPI_FREAD_QUAD (BIT(20)) -#define SPI_FREAD_QUAD_M (BIT(20)) -#define SPI_FREAD_QUAD_V 0x1 -#define SPI_FREAD_QUAD_S 20 -/* SPI_RESANDRES : R/W ;bitpos:[15] ;default: 1'b1 ; */ -/*description: The Device ID is read out to SPI_RD_STATUS register, this bit - combine with spi_flash_res bit. 1: enable 0: disable.*/ -#define SPI_RESANDRES (BIT(15)) -#define SPI_RESANDRES_M (BIT(15)) -#define SPI_RESANDRES_V 0x1 -#define SPI_RESANDRES_S 15 -/* SPI_FREAD_DUAL : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: In the read operations read-data phase apply 2 signals. 1: enable 0: disable.*/ -#define SPI_FREAD_DUAL (BIT(14)) -#define SPI_FREAD_DUAL_M (BIT(14)) -#define SPI_FREAD_DUAL_V 0x1 -#define SPI_FREAD_DUAL_S 14 -/* SPI_FASTRD_MODE : R/W ;bitpos:[13] ;default: 1'b1 ; */ -/*description: This bit enable the bits: spi_fread_qio spi_fread_dio spi_fread_qout - and spi_fread_dout. 1: enable 0: disable.*/ -#define SPI_FASTRD_MODE (BIT(13)) -#define SPI_FASTRD_MODE_M (BIT(13)) -#define SPI_FASTRD_MODE_V 0x1 -#define SPI_FASTRD_MODE_S 13 -/* SPI_WAIT_FLASH_IDLE_EN : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: wait flash idle when program flash or erase flash. 1: enable 0: disable.*/ -#define SPI_WAIT_FLASH_IDLE_EN (BIT(12)) -#define SPI_WAIT_FLASH_IDLE_EN_M (BIT(12)) -#define SPI_WAIT_FLASH_IDLE_EN_V 0x1 -#define SPI_WAIT_FLASH_IDLE_EN_S 12 -/* SPI_TX_CRC_EN : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: For SPI1 enable crc32 when writing encrypted data to flash. - 1: enable 0:disable*/ -#define SPI_TX_CRC_EN (BIT(11)) -#define SPI_TX_CRC_EN_M (BIT(11)) -#define SPI_TX_CRC_EN_V 0x1 -#define SPI_TX_CRC_EN_S 11 -/* SPI_FCS_CRC_EN : R/W ;bitpos:[10] ;default: 1'b1 ; */ -/*description: For SPI1 initialize crc32 module before writing encrypted data - to flash. Active low.*/ -#define SPI_FCS_CRC_EN (BIT(10)) -#define SPI_FCS_CRC_EN_M (BIT(10)) -#define SPI_FCS_CRC_EN_V 0x1 -#define SPI_FCS_CRC_EN_S 10 - -#define SPI_CTRL1_REG(i) (REG_SPI_BASE(i) + 0xC) -/* SPI_CS_HOLD_DELAY : R/W ;bitpos:[31:28] ;default: 4'h5 ; */ -/*description: SPI cs signal is delayed by spi clock cycles*/ -#define SPI_CS_HOLD_DELAY 0x0000000F -#define SPI_CS_HOLD_DELAY_M ((SPI_CS_HOLD_DELAY_V)<<(SPI_CS_HOLD_DELAY_S)) -#define SPI_CS_HOLD_DELAY_V 0xF -#define SPI_CS_HOLD_DELAY_S 28 -/* SPI_CS_HOLD_DELAY_RES : R/W ;bitpos:[27:16] ;default: 12'hfff ; */ -/*description: Delay cycles of resume Flash when resume Flash is enable by spi clock.*/ -#define SPI_CS_HOLD_DELAY_RES 0x00000FFF -#define SPI_CS_HOLD_DELAY_RES_M ((SPI_CS_HOLD_DELAY_RES_V)<<(SPI_CS_HOLD_DELAY_RES_S)) -#define SPI_CS_HOLD_DELAY_RES_V 0xFFF -#define SPI_CS_HOLD_DELAY_RES_S 16 - -#define SPI_RD_STATUS_REG(i) (REG_SPI_BASE(i) + 0x10) -/* SPI_STATUS_EXT : R/W ;bitpos:[31:24] ;default: 8'h00 ; */ -/*description: In the slave mode,it is the status for master to read out.*/ -#define SPI_STATUS_EXT 0x000000FF -#define SPI_STATUS_EXT_M ((SPI_STATUS_EXT_V)<<(SPI_STATUS_EXT_S)) -#define SPI_STATUS_EXT_V 0xFF -#define SPI_STATUS_EXT_S 24 -/* SPI_WB_MODE : R/W ;bitpos:[23:16] ;default: 8'h00 ; */ -/*description: Mode bits in the flash fast read mode, it is combined with spi_fastrd_mode bit.*/ -#define SPI_WB_MODE 0x000000FF -#define SPI_WB_MODE_M ((SPI_WB_MODE_V)<<(SPI_WB_MODE_S)) -#define SPI_WB_MODE_V 0xFF -#define SPI_WB_MODE_S 16 -/* SPI_STATUS : R/W ;bitpos:[15:0] ;default: 16'b0 ; */ -/*description: In the slave mode, it is the status for master to read out.*/ -#define SPI_STATUS 0x0000FFFF -#define SPI_STATUS_M ((SPI_STATUS_V)<<(SPI_STATUS_S)) -#define SPI_STATUS_V 0xFFFF -#define SPI_STATUS_S 0 - -#define SPI_CTRL2_REG(i) (REG_SPI_BASE(i) + 0x14) -/* SPI_CS_DELAY_NUM : R/W ;bitpos:[31:28] ;default: 4'h0 ; */ -/*description: spi_cs signal is delayed by system clock cycles*/ -#define SPI_CS_DELAY_NUM 0x0000000F -#define SPI_CS_DELAY_NUM_M ((SPI_CS_DELAY_NUM_V)<<(SPI_CS_DELAY_NUM_S)) -#define SPI_CS_DELAY_NUM_V 0xF -#define SPI_CS_DELAY_NUM_S 28 -/* SPI_CS_DELAY_MODE : R/W ;bitpos:[27:26] ;default: 2'h0 ; */ -/*description: spi_cs signal is delayed by spi_clk . 0: zero 1: if spi_ck_out_edge - or spi_ck_i_edge is set 1 delayed by half cycle else delayed by one cycle 2: if spi_ck_out_edge or spi_ck_i_edge is set 1 delayed by one cycle else delayed by half cycle 3: delayed one cycle*/ -#define SPI_CS_DELAY_MODE 0x00000003 -#define SPI_CS_DELAY_MODE_M ((SPI_CS_DELAY_MODE_V)<<(SPI_CS_DELAY_MODE_S)) -#define SPI_CS_DELAY_MODE_V 0x3 -#define SPI_CS_DELAY_MODE_S 26 -/* SPI_MOSI_DELAY_NUM : R/W ;bitpos:[25:23] ;default: 3'h0 ; */ -/*description: MOSI signals are delayed by system clock cycles*/ -#define SPI_MOSI_DELAY_NUM 0x00000007 -#define SPI_MOSI_DELAY_NUM_M ((SPI_MOSI_DELAY_NUM_V)<<(SPI_MOSI_DELAY_NUM_S)) -#define SPI_MOSI_DELAY_NUM_V 0x7 -#define SPI_MOSI_DELAY_NUM_S 23 -/* SPI_MOSI_DELAY_MODE : R/W ;bitpos:[22:21] ;default: 2'h0 ; */ -/*description: MOSI signals are delayed by spi_clk. 0: zero 1: if spi_ck_out_edge - or spi_ck_i_edge is set 1 delayed by half cycle else delayed by one cycle 2: if spi_ck_out_edge or spi_ck_i_edge is set 1 delayed by one cycle else delayed by half cycle 3: delayed one cycle*/ -#define SPI_MOSI_DELAY_MODE 0x00000003 -#define SPI_MOSI_DELAY_MODE_M ((SPI_MOSI_DELAY_MODE_V)<<(SPI_MOSI_DELAY_MODE_S)) -#define SPI_MOSI_DELAY_MODE_V 0x3 -#define SPI_MOSI_DELAY_MODE_S 21 -/* SPI_MISO_DELAY_NUM : R/W ;bitpos:[20:18] ;default: 3'h0 ; */ -/*description: MISO signals are delayed by system clock cycles*/ -#define SPI_MISO_DELAY_NUM 0x00000007 -#define SPI_MISO_DELAY_NUM_M ((SPI_MISO_DELAY_NUM_V)<<(SPI_MISO_DELAY_NUM_S)) -#define SPI_MISO_DELAY_NUM_V 0x7 -#define SPI_MISO_DELAY_NUM_S 18 -/* SPI_MISO_DELAY_MODE : R/W ;bitpos:[17:16] ;default: 2'h0 ; */ -/*description: MISO signals are delayed by spi_clk. 0: zero 1: if spi_ck_out_edge - or spi_ck_i_edge is set 1 delayed by half cycle else delayed by one cycle 2: if spi_ck_out_edge or spi_ck_i_edge is set 1 delayed by one cycle else delayed by half cycle 3: delayed one cycle*/ -#define SPI_MISO_DELAY_MODE 0x00000003 -#define SPI_MISO_DELAY_MODE_M ((SPI_MISO_DELAY_MODE_V)<<(SPI_MISO_DELAY_MODE_S)) -#define SPI_MISO_DELAY_MODE_V 0x3 -#define SPI_MISO_DELAY_MODE_S 16 -/* SPI_CK_OUT_HIGH_MODE : R/W ;bitpos:[15:12] ;default: 4'h0 ; */ -/*description: modify spi clock duty ratio when the value is lager than 8, - the bits are combined with spi_clkcnt_N bits and spi_clkcnt_H bits.*/ -#define SPI_CK_OUT_HIGH_MODE 0x0000000F -#define SPI_CK_OUT_HIGH_MODE_M ((SPI_CK_OUT_HIGH_MODE_V)<<(SPI_CK_OUT_HIGH_MODE_S)) -#define SPI_CK_OUT_HIGH_MODE_V 0xF -#define SPI_CK_OUT_HIGH_MODE_S 12 -/* SPI_CK_OUT_LOW_MODE : R/W ;bitpos:[11:8] ;default: 4'h0 ; */ -/*description: modify spi clock duty ratio when the value is lager than 8, - the bits are combined with spi_clkcnt_N bits and spi_clkcnt_L bits.*/ -#define SPI_CK_OUT_LOW_MODE 0x0000000F -#define SPI_CK_OUT_LOW_MODE_M ((SPI_CK_OUT_LOW_MODE_V)<<(SPI_CK_OUT_LOW_MODE_S)) -#define SPI_CK_OUT_LOW_MODE_V 0xF -#define SPI_CK_OUT_LOW_MODE_S 8 -/* SPI_HOLD_TIME : R/W ;bitpos:[7:4] ;default: 4'h1 ; */ -/*description: delay cycles of cs pin by spi clock, this bits combined with spi_cs_hold bit.*/ -#define SPI_HOLD_TIME 0x0000000F -#define SPI_HOLD_TIME_M ((SPI_HOLD_TIME_V)<<(SPI_HOLD_TIME_S)) -#define SPI_HOLD_TIME_V 0xF -#define SPI_HOLD_TIME_S 4 -/* SPI_SETUP_TIME : R/W ;bitpos:[3:0] ;default: 4'h1 ; */ -/*description: (cycles-1) of ¡°prepare¡± phase by spi clock, this bits combined - with spi_cs_setup bit.*/ -#define SPI_SETUP_TIME 0x0000000F -#define SPI_SETUP_TIME_M ((SPI_SETUP_TIME_V)<<(SPI_SETUP_TIME_S)) -#define SPI_SETUP_TIME_V 0xF -#define SPI_SETUP_TIME_S 0 - -#define SPI_CLOCK_REG(i) (REG_SPI_BASE(i) + 0x18) -/* SPI_CLK_EQU_SYSCLK : R/W ;bitpos:[31] ;default: 1'b1 ; */ -/*description: In the master mode 1: spi_clk is eqaul to system 0: spi_clk is - divided from system clock.*/ -#define SPI_CLK_EQU_SYSCLK (BIT(31)) -#define SPI_CLK_EQU_SYSCLK_M (BIT(31)) -#define SPI_CLK_EQU_SYSCLK_V 0x1 -#define SPI_CLK_EQU_SYSCLK_S 31 -/* SPI_CLKDIV_PRE : R/W ;bitpos:[30:18] ;default: 13'b0 ; */ -/*description: In the master mode it is pre-divider of spi_clk.*/ -#define SPI_CLKDIV_PRE 0x00001FFF -#define SPI_CLKDIV_PRE_M ((SPI_CLKDIV_PRE_V)<<(SPI_CLKDIV_PRE_S)) -#define SPI_CLKDIV_PRE_V 0x1FFF -#define SPI_CLKDIV_PRE_S 18 -/* SPI_CLKCNT_N : R/W ;bitpos:[17:12] ;default: 6'h3 ; */ -/*description: In the master mode it is the divider of spi_clk. So spi_clk frequency - is system/(spi_clkdiv_pre+1)/(spi_clkcnt_N+1)*/ -#define SPI_CLKCNT_N 0x0000003F -#define SPI_CLKCNT_N_M ((SPI_CLKCNT_N_V)<<(SPI_CLKCNT_N_S)) -#define SPI_CLKCNT_N_V 0x3F -#define SPI_CLKCNT_N_S 12 -/* SPI_CLKCNT_H : R/W ;bitpos:[11:6] ;default: 6'h1 ; */ -/*description: In the master mode it must be floor((spi_clkcnt_N+1)/2-1). In - the slave mode it must be 0.*/ -#define SPI_CLKCNT_H 0x0000003F -#define SPI_CLKCNT_H_M ((SPI_CLKCNT_H_V)<<(SPI_CLKCNT_H_S)) -#define SPI_CLKCNT_H_V 0x3F -#define SPI_CLKCNT_H_S 6 -/* SPI_CLKCNT_L : R/W ;bitpos:[5:0] ;default: 6'h3 ; */ -/*description: In the master mode it must be equal to spi_clkcnt_N. In the slave - mode it must be 0.*/ -#define SPI_CLKCNT_L 0x0000003F -#define SPI_CLKCNT_L_M ((SPI_CLKCNT_L_V)<<(SPI_CLKCNT_L_S)) -#define SPI_CLKCNT_L_V 0x3F -#define SPI_CLKCNT_L_S 0 - -#define SPI_USER_REG(i) (REG_SPI_BASE(i) + 0x1C) -/* SPI_USR_COMMAND : R/W ;bitpos:[31] ;default: 1'b1 ; */ -/*description: This bit enable the command phase of an operation.*/ -#define SPI_USR_COMMAND (BIT(31)) -#define SPI_USR_COMMAND_M (BIT(31)) -#define SPI_USR_COMMAND_V 0x1 -#define SPI_USR_COMMAND_S 31 -/* SPI_USR_ADDR : R/W ;bitpos:[30] ;default: 1'b0 ; */ -/*description: This bit enable the address phase of an operation.*/ -#define SPI_USR_ADDR (BIT(30)) -#define SPI_USR_ADDR_M (BIT(30)) -#define SPI_USR_ADDR_V 0x1 -#define SPI_USR_ADDR_S 30 -/* SPI_USR_DUMMY : R/W ;bitpos:[29] ;default: 1'b0 ; */ -/*description: This bit enable the dummy phase of an operation.*/ -#define SPI_USR_DUMMY (BIT(29)) -#define SPI_USR_DUMMY_M (BIT(29)) -#define SPI_USR_DUMMY_V 0x1 -#define SPI_USR_DUMMY_S 29 -/* SPI_USR_MISO : R/W ;bitpos:[28] ;default: 1'b0 ; */ -/*description: This bit enable the read-data phase of an operation.*/ -#define SPI_USR_MISO (BIT(28)) -#define SPI_USR_MISO_M (BIT(28)) -#define SPI_USR_MISO_V 0x1 -#define SPI_USR_MISO_S 28 -/* SPI_USR_MOSI : R/W ;bitpos:[27] ;default: 1'b0 ; */ -/*description: This bit enable the write-data phase of an operation.*/ -#define SPI_USR_MOSI (BIT(27)) -#define SPI_USR_MOSI_M (BIT(27)) -#define SPI_USR_MOSI_V 0x1 -#define SPI_USR_MOSI_S 27 -/* SPI_USR_DUMMY_IDLE : R/W ;bitpos:[26] ;default: 1'b0 ; */ -/*description: spi clock is disable in dummy phase when the bit is enable.*/ -#define SPI_USR_DUMMY_IDLE (BIT(26)) -#define SPI_USR_DUMMY_IDLE_M (BIT(26)) -#define SPI_USR_DUMMY_IDLE_V 0x1 -#define SPI_USR_DUMMY_IDLE_S 26 -/* SPI_USR_MOSI_HIGHPART : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: write-data phase only access to high-part of the buffer spi_w8~spi_w15. - 1: enable 0: disable.*/ -#define SPI_USR_MOSI_HIGHPART (BIT(25)) -#define SPI_USR_MOSI_HIGHPART_M (BIT(25)) -#define SPI_USR_MOSI_HIGHPART_V 0x1 -#define SPI_USR_MOSI_HIGHPART_S 25 -/* SPI_USR_MISO_HIGHPART : R/W ;bitpos:[24] ;default: 1'b0 ; */ -/*description: read-data phase only access to high-part of the buffer spi_w8~spi_w15. - 1: enable 0: disable.*/ -#define SPI_USR_MISO_HIGHPART (BIT(24)) -#define SPI_USR_MISO_HIGHPART_M (BIT(24)) -#define SPI_USR_MISO_HIGHPART_V 0x1 -#define SPI_USR_MISO_HIGHPART_S 24 -/* SPI_USR_PREP_HOLD : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: spi is hold at prepare state the bit combined with spi_usr_hold_pol bit.*/ -#define SPI_USR_PREP_HOLD (BIT(23)) -#define SPI_USR_PREP_HOLD_M (BIT(23)) -#define SPI_USR_PREP_HOLD_V 0x1 -#define SPI_USR_PREP_HOLD_S 23 -/* SPI_USR_CMD_HOLD : R/W ;bitpos:[22] ;default: 1'b0 ; */ -/*description: spi is hold at command state the bit combined with spi_usr_hold_pol bit.*/ -#define SPI_USR_CMD_HOLD (BIT(22)) -#define SPI_USR_CMD_HOLD_M (BIT(22)) -#define SPI_USR_CMD_HOLD_V 0x1 -#define SPI_USR_CMD_HOLD_S 22 -/* SPI_USR_ADDR_HOLD : R/W ;bitpos:[21] ;default: 1'b0 ; */ -/*description: spi is hold at address state the bit combined with spi_usr_hold_pol bit.*/ -#define SPI_USR_ADDR_HOLD (BIT(21)) -#define SPI_USR_ADDR_HOLD_M (BIT(21)) -#define SPI_USR_ADDR_HOLD_V 0x1 -#define SPI_USR_ADDR_HOLD_S 21 -/* SPI_USR_DUMMY_HOLD : R/W ;bitpos:[20] ;default: 1'b0 ; */ -/*description: spi is hold at dummy state the bit combined with spi_usr_hold_pol bit.*/ -#define SPI_USR_DUMMY_HOLD (BIT(20)) -#define SPI_USR_DUMMY_HOLD_M (BIT(20)) -#define SPI_USR_DUMMY_HOLD_V 0x1 -#define SPI_USR_DUMMY_HOLD_S 20 -/* SPI_USR_DIN_HOLD : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: spi is hold at data in state the bit combined with spi_usr_hold_pol bit.*/ -#define SPI_USR_DIN_HOLD (BIT(19)) -#define SPI_USR_DIN_HOLD_M (BIT(19)) -#define SPI_USR_DIN_HOLD_V 0x1 -#define SPI_USR_DIN_HOLD_S 19 -/* SPI_USR_DOUT_HOLD : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: spi is hold at data out state the bit combined with spi_usr_hold_pol bit.*/ -#define SPI_USR_DOUT_HOLD (BIT(18)) -#define SPI_USR_DOUT_HOLD_M (BIT(18)) -#define SPI_USR_DOUT_HOLD_V 0x1 -#define SPI_USR_DOUT_HOLD_S 18 -/* SPI_USR_HOLD_POL : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: It is combined with hold bits to set the polarity of spi hold - line 1: spi will be held when spi hold line is high 0: spi will be held when spi hold line is low*/ -#define SPI_USR_HOLD_POL (BIT(17)) -#define SPI_USR_HOLD_POL_M (BIT(17)) -#define SPI_USR_HOLD_POL_V 0x1 -#define SPI_USR_HOLD_POL_S 17 -/* SPI_SIO : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: Set the bit to enable 3-line half duplex communication mosi - and miso signals share the same pin. 1: enable 0: disable.*/ -#define SPI_SIO (BIT(16)) -#define SPI_SIO_M (BIT(16)) -#define SPI_SIO_V 0x1 -#define SPI_SIO_S 16 -/* SPI_FWRITE_QIO : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: In the write operations address phase and read-data phase apply 4 signals.*/ -#define SPI_FWRITE_QIO (BIT(15)) -#define SPI_FWRITE_QIO_M (BIT(15)) -#define SPI_FWRITE_QIO_V 0x1 -#define SPI_FWRITE_QIO_S 15 -/* SPI_FWRITE_DIO : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: In the write operations address phase and read-data phase apply 2 signals.*/ -#define SPI_FWRITE_DIO (BIT(14)) -#define SPI_FWRITE_DIO_M (BIT(14)) -#define SPI_FWRITE_DIO_V 0x1 -#define SPI_FWRITE_DIO_S 14 -/* SPI_FWRITE_QUAD : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: In the write operations read-data phase apply 4 signals*/ -#define SPI_FWRITE_QUAD (BIT(13)) -#define SPI_FWRITE_QUAD_M (BIT(13)) -#define SPI_FWRITE_QUAD_V 0x1 -#define SPI_FWRITE_QUAD_S 13 -/* SPI_FWRITE_DUAL : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: In the write operations read-data phase apply 2 signals*/ -#define SPI_FWRITE_DUAL (BIT(12)) -#define SPI_FWRITE_DUAL_M (BIT(12)) -#define SPI_FWRITE_DUAL_V 0x1 -#define SPI_FWRITE_DUAL_S 12 -/* SPI_WR_BYTE_ORDER : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: In command address write-data (MOSI) phases 1: big-endian 0: litte_endian*/ -#define SPI_WR_BYTE_ORDER (BIT(11)) -#define SPI_WR_BYTE_ORDER_M (BIT(11)) -#define SPI_WR_BYTE_ORDER_V 0x1 -#define SPI_WR_BYTE_ORDER_S 11 -/* SPI_RD_BYTE_ORDER : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: In read-data (MISO) phase 1: big-endian 0: little_endian*/ -#define SPI_RD_BYTE_ORDER (BIT(10)) -#define SPI_RD_BYTE_ORDER_M (BIT(10)) -#define SPI_RD_BYTE_ORDER_V 0x1 -#define SPI_RD_BYTE_ORDER_S 10 -/* SPI_CK_OUT_EDGE : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: the bit combined with spi_mosi_delay_mode bits to set mosi signal delay mode.*/ -#define SPI_CK_OUT_EDGE (BIT(7)) -#define SPI_CK_OUT_EDGE_M (BIT(7)) -#define SPI_CK_OUT_EDGE_V 0x1 -#define SPI_CK_OUT_EDGE_S 7 -/* SPI_CK_I_EDGE : R/W ;bitpos:[6] ;default: 1'b1 ; */ -/*description: In the slave mode the bit is same as spi_ck_out_edge in master - mode. It is combined with spi_miso_delay_mode bits.*/ -#define SPI_CK_I_EDGE (BIT(6)) -#define SPI_CK_I_EDGE_M (BIT(6)) -#define SPI_CK_I_EDGE_V 0x1 -#define SPI_CK_I_EDGE_S 6 -/* SPI_CS_SETUP : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: spi cs is enable when spi is in ¡°prepare¡± phase. 1: enable 0: disable.*/ -#define SPI_CS_SETUP (BIT(5)) -#define SPI_CS_SETUP_M (BIT(5)) -#define SPI_CS_SETUP_V 0x1 -#define SPI_CS_SETUP_S 5 -/* SPI_CS_HOLD : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: spi cs keep low when spi is in ¡°done¡± phase. 1: enable 0: disable.*/ -#define SPI_CS_HOLD (BIT(4)) -#define SPI_CS_HOLD_M (BIT(4)) -#define SPI_CS_HOLD_V 0x1 -#define SPI_CS_HOLD_S 4 -/* SPI_DOUTDIN : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: Set the bit to enable full duplex communication. 1: enable 0: disable.*/ -#define SPI_DOUTDIN (BIT(0)) -#define SPI_DOUTDIN_M (BIT(0)) -#define SPI_DOUTDIN_V 0x1 -#define SPI_DOUTDIN_S 0 - -#define SPI_USER1_REG(i) (REG_SPI_BASE(i) + 0x20) -/* SPI_USR_ADDR_BITLEN : RO ;bitpos:[31:26] ;default: 6'd23 ; */ -/*description: The length in bits of address phase. The register value shall be (bit_num-1).*/ -#define SPI_USR_ADDR_BITLEN 0x0000003F -#define SPI_USR_ADDR_BITLEN_M ((SPI_USR_ADDR_BITLEN_V)<<(SPI_USR_ADDR_BITLEN_S)) -#define SPI_USR_ADDR_BITLEN_V 0x3F -#define SPI_USR_ADDR_BITLEN_S 26 -/* SPI_USR_DUMMY_CYCLELEN : R/W ;bitpos:[7:0] ;default: 8'd7 ; */ -/*description: The length in spi_clk cycles of dummy phase. The register value - shall be (cycle_num-1).*/ -#define SPI_USR_DUMMY_CYCLELEN 0x000000FF -#define SPI_USR_DUMMY_CYCLELEN_M ((SPI_USR_DUMMY_CYCLELEN_V)<<(SPI_USR_DUMMY_CYCLELEN_S)) -#define SPI_USR_DUMMY_CYCLELEN_V 0xFF -#define SPI_USR_DUMMY_CYCLELEN_S 0 - -#define SPI_USER2_REG(i) (REG_SPI_BASE(i) + 0x24) -/* SPI_USR_COMMAND_BITLEN : R/W ;bitpos:[31:28] ;default: 4'd7 ; */ -/*description: The length in bits of command phase. The register value shall be (bit_num-1)*/ -#define SPI_USR_COMMAND_BITLEN 0x0000000F -#define SPI_USR_COMMAND_BITLEN_M ((SPI_USR_COMMAND_BITLEN_V)<<(SPI_USR_COMMAND_BITLEN_S)) -#define SPI_USR_COMMAND_BITLEN_V 0xF -#define SPI_USR_COMMAND_BITLEN_S 28 -/* SPI_USR_COMMAND_VALUE : R/W ;bitpos:[15:0] ;default: 16'b0 ; */ -/*description: The value of command.*/ -#define SPI_USR_COMMAND_VALUE 0x0000FFFF -#define SPI_USR_COMMAND_VALUE_M ((SPI_USR_COMMAND_VALUE_V)<<(SPI_USR_COMMAND_VALUE_S)) -#define SPI_USR_COMMAND_VALUE_V 0xFFFF -#define SPI_USR_COMMAND_VALUE_S 0 - -#define SPI_MOSI_DLEN_REG(i) (REG_SPI_BASE(i) + 0x28) -/* SPI_USR_MOSI_DBITLEN : R/W ;bitpos:[23:0] ;default: 24'h0 ; */ -/*description: The length in bits of write-data. The register value shall be (bit_num-1).*/ -#define SPI_USR_MOSI_DBITLEN 0x00FFFFFF -#define SPI_USR_MOSI_DBITLEN_M ((SPI_USR_MOSI_DBITLEN_V)<<(SPI_USR_MOSI_DBITLEN_S)) -#define SPI_USR_MOSI_DBITLEN_V 0xFFFFFF -#define SPI_USR_MOSI_DBITLEN_S 0 - -#define SPI_MISO_DLEN_REG(i) (REG_SPI_BASE(i) + 0x2C) -/* SPI_USR_MISO_DBITLEN : R/W ;bitpos:[23:0] ;default: 24'h0 ; */ -/*description: The length in bits of read-data. The register value shall be (bit_num-1).*/ -#define SPI_USR_MISO_DBITLEN 0x00FFFFFF -#define SPI_USR_MISO_DBITLEN_M ((SPI_USR_MISO_DBITLEN_V)<<(SPI_USR_MISO_DBITLEN_S)) -#define SPI_USR_MISO_DBITLEN_V 0xFFFFFF -#define SPI_USR_MISO_DBITLEN_S 0 - -#define SPI_SLV_WR_STATUS_REG(i) (REG_SPI_BASE(i) + 0x30) -/* SPI_SLV_WR_ST : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: In the slave mode this register are the status register for the - master to write into. In the master mode this register are the higher 32bits in the 64 bits address condition.*/ -#define SPI_SLV_WR_ST 0xFFFFFFFF -#define SPI_SLV_WR_ST_M ((SPI_SLV_WR_ST_V)<<(SPI_SLV_WR_ST_S)) -#define SPI_SLV_WR_ST_V 0xFFFFFFFF -#define SPI_SLV_WR_ST_S 0 - -#define SPI_PIN_REG(i) (REG_SPI_BASE(i) + 0x34) -/* SPI_CS_KEEP_ACTIVE : R/W ;bitpos:[30] ;default: 1'b0 ; */ -/*description: spi cs line keep low when the bit is set.*/ -#define SPI_CS_KEEP_ACTIVE (BIT(30)) -#define SPI_CS_KEEP_ACTIVE_M (BIT(30)) -#define SPI_CS_KEEP_ACTIVE_V 0x1 -#define SPI_CS_KEEP_ACTIVE_S 30 -/* SPI_CK_IDLE_EDGE : R/W ;bitpos:[29] ;default: 1'b0 ; */ -/*description: 1: spi clk line is high when idle 0: spi clk line is low when idle*/ -#define SPI_CK_IDLE_EDGE (BIT(29)) -#define SPI_CK_IDLE_EDGE_M (BIT(29)) -#define SPI_CK_IDLE_EDGE_V 0x1 -#define SPI_CK_IDLE_EDGE_S 29 -/* SPI_MASTER_CK_SEL : R/W ;bitpos:[13:11] ;default: 3'b0 ; */ -/*description: In the master mode spi cs line is enable as spi clk it is combined - with spi_cs0_dis spi_cs1_dis spi_cs2_dis.*/ -#define SPI_MASTER_CK_SEL 0x00000007 -#define SPI_MASTER_CK_SEL_M ((SPI_MASTER_CK_SEL_V)<<(SPI_MASTER_CK_SEL_S)) -#define SPI_MASTER_CK_SEL_V 0x07 -#define SPI_MASTER_CK_SEL_S 11 -/* SPI_MASTER_CS_POL : R/W ;bitpos:[8:6] ;default: 3'b0 ; */ -/*description: In the master mode the bits are the polarity of spi cs line - the value is equivalent to spi_cs ^ spi_master_cs_pol.*/ -#define SPI_MASTER_CS_POL 0x00000007 -#define SPI_MASTER_CS_POL_M ((SPI_MASTER_CS_POL_V)<<(SPI_MASTER_CS_POL_S)) -#define SPI_MASTER_CS_POL_V 0x7 -#define SPI_MASTER_CS_POL_S 6 -/* SPI_CK_DIS : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: 1: spi clk out disable 0: spi clk out enable*/ -#define SPI_CK_DIS (BIT(5)) -#define SPI_CK_DIS_M (BIT(5)) -#define SPI_CK_DIS_V 0x1 -#define SPI_CK_DIS_S 5 -/* SPI_CS2_DIS : R/W ;bitpos:[2] ;default: 1'b1 ; */ -/*description: SPI CS2 pin enable, 1: disable CS2, 0: spi_cs2 signal is from/to CS2 pin*/ -#define SPI_CS2_DIS (BIT(2)) -#define SPI_CS2_DIS_M (BIT(2)) -#define SPI_CS2_DIS_V 0x1 -#define SPI_CS2_DIS_S 2 -/* SPI_CS1_DIS : R/W ;bitpos:[1] ;default: 1'b1 ; */ -/*description: SPI CS1 pin enable, 1: disable CS1, 0: spi_cs1 signal is from/to CS1 pin*/ -#define SPI_CS1_DIS (BIT(1)) -#define SPI_CS1_DIS_M (BIT(1)) -#define SPI_CS1_DIS_V 0x1 -#define SPI_CS1_DIS_S 1 -/* SPI_CS0_DIS : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: SPI CS0 pin enable, 1: disable CS0, 0: spi_cs0 signal is from/to CS0 pin*/ -#define SPI_CS0_DIS (BIT(0)) -#define SPI_CS0_DIS_M (BIT(0)) -#define SPI_CS0_DIS_V 0x1 -#define SPI_CS0_DIS_S 0 - -#define SPI_SLAVE_REG(i) (REG_SPI_BASE(i) + 0x38) -/* SPI_SYNC_RESET : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: Software reset enable, reset the spi clock line cs line and data lines.*/ -#define SPI_SYNC_RESET (BIT(31)) -#define SPI_SYNC_RESET_M (BIT(31)) -#define SPI_SYNC_RESET_V 0x1 -#define SPI_SYNC_RESET_S 31 -/* SPI_SLAVE_MODE : R/W ;bitpos:[30] ;default: 1'b0 ; */ -/*description: 1: slave mode 0: master mode.*/ -#define SPI_SLAVE_MODE (BIT(30)) -#define SPI_SLAVE_MODE_M (BIT(30)) -#define SPI_SLAVE_MODE_V 0x1 -#define SPI_SLAVE_MODE_S 30 -/* SPI_SLV_WR_RD_BUF_EN : R/W ;bitpos:[29] ;default: 1'b0 ; */ -/*description: write and read buffer enable in the slave mode*/ -#define SPI_SLV_WR_RD_BUF_EN (BIT(29)) -#define SPI_SLV_WR_RD_BUF_EN_M (BIT(29)) -#define SPI_SLV_WR_RD_BUF_EN_V 0x1 -#define SPI_SLV_WR_RD_BUF_EN_S 29 -/* SPI_SLV_WR_RD_STA_EN : R/W ;bitpos:[28] ;default: 1'b0 ; */ -/*description: write and read status enable in the slave mode*/ -#define SPI_SLV_WR_RD_STA_EN (BIT(28)) -#define SPI_SLV_WR_RD_STA_EN_M (BIT(28)) -#define SPI_SLV_WR_RD_STA_EN_V 0x1 -#define SPI_SLV_WR_RD_STA_EN_S 28 -/* SPI_SLV_CMD_DEFINE : R/W ;bitpos:[27] ;default: 1'b0 ; */ -/*description: 1: slave mode commands are defined in SPI_SLAVE3. 0: slave mode - commands are fixed as: 1: write-status 2: write-buffer and 3: read-buffer.*/ -#define SPI_SLV_CMD_DEFINE (BIT(27)) -#define SPI_SLV_CMD_DEFINE_M (BIT(27)) -#define SPI_SLV_CMD_DEFINE_V 0x1 -#define SPI_SLV_CMD_DEFINE_S 27 -/* SPI_TRANS_CNT : RO ;bitpos:[26:23] ;default: 4'b0 ; */ -/*description: The operations counter in both the master mode and the slave - mode. 4: read-status*/ -#define SPI_TRANS_CNT 0x0000000F -#define SPI_TRANS_CNT_M ((SPI_TRANS_CNT_V)<<(SPI_TRANS_CNT_S)) -#define SPI_TRANS_CNT_V 0xF -#define SPI_TRANS_CNT_S 23 -/* SPI_SLV_LAST_STATE : RO ;bitpos:[22:20] ;default: 3'b0 ; */ -/*description: In the slave mode it is the state of spi state machine.*/ -#define SPI_SLV_LAST_STATE 0x00000007 -#define SPI_SLV_LAST_STATE_M ((SPI_SLV_LAST_STATE_V)<<(SPI_SLV_LAST_STATE_S)) -#define SPI_SLV_LAST_STATE_V 0x7 -#define SPI_SLV_LAST_STATE_S 20 -/* SPI_SLV_LAST_COMMAND : RO ;bitpos:[19:17] ;default: 3'b0 ; */ -/*description: In the slave mode it is the value of command.*/ -#define SPI_SLV_LAST_COMMAND 0x00000007 -#define SPI_SLV_LAST_COMMAND_M ((SPI_SLV_LAST_COMMAND_V)<<(SPI_SLV_LAST_COMMAND_S)) -#define SPI_SLV_LAST_COMMAND_V 0x7 -#define SPI_SLV_LAST_COMMAND_S 17 -/* SPI_CS_I_MODE : R/W ;bitpos:[11:10] ;default: 2'b0 ; */ -/*description: In the slave mode this bits used to synchronize the input spi - cs signal and eliminate spi cs jitter.*/ -#define SPI_CS_I_MODE 0x00000003 -#define SPI_CS_I_MODE_M ((SPI_CS_I_MODE_V)<<(SPI_CS_I_MODE_S)) -#define SPI_CS_I_MODE_V 0x3 -#define SPI_CS_I_MODE_S 10 -/* SPI_INT_EN : R/W ;bitpos:[9:5] ;default: 5'b1_0000 ; */ -/*description: Interrupt enable bits for the below 5 sources*/ -#define SPI_INT_EN 0x0000001F -#define SPI_INT_EN_M ((SPI_INT_EN_V)<<(SPI_INT_EN_S)) -#define SPI_INT_EN_V 0x1F -#define SPI_INT_EN_S 5 -/* SPI_TRANS_DONE : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for the completion of any operation in - both the master mode and the slave mode.*/ -#define SPI_TRANS_DONE (BIT(4)) -#define SPI_TRANS_DONE_M (BIT(4)) -#define SPI_TRANS_DONE_V 0x1 -#define SPI_TRANS_DONE_S 4 -/* SPI_SLV_WR_STA_DONE : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for the completion of write-status operation - in the slave mode.*/ -#define SPI_SLV_WR_STA_DONE (BIT(3)) -#define SPI_SLV_WR_STA_DONE_M (BIT(3)) -#define SPI_SLV_WR_STA_DONE_V 0x1 -#define SPI_SLV_WR_STA_DONE_S 3 -/* SPI_SLV_RD_STA_DONE : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for the completion of read-status operation - in the slave mode.*/ -#define SPI_SLV_RD_STA_DONE (BIT(2)) -#define SPI_SLV_RD_STA_DONE_M (BIT(2)) -#define SPI_SLV_RD_STA_DONE_V 0x1 -#define SPI_SLV_RD_STA_DONE_S 2 -/* SPI_SLV_WR_BUF_DONE : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for the completion of write-buffer operation - in the slave mode.*/ -#define SPI_SLV_WR_BUF_DONE (BIT(1)) -#define SPI_SLV_WR_BUF_DONE_M (BIT(1)) -#define SPI_SLV_WR_BUF_DONE_V 0x1 -#define SPI_SLV_WR_BUF_DONE_S 1 -/* SPI_SLV_RD_BUF_DONE : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: The interrupt raw bit for the completion of read-buffer operation - in the slave mode.*/ -#define SPI_SLV_RD_BUF_DONE (BIT(0)) -#define SPI_SLV_RD_BUF_DONE_M (BIT(0)) -#define SPI_SLV_RD_BUF_DONE_V 0x1 -#define SPI_SLV_RD_BUF_DONE_S 0 - -#define SPI_SLAVE1_REG(i) (REG_SPI_BASE(i) + 0x3C) -/* SPI_SLV_STATUS_BITLEN : R/W ;bitpos:[31:27] ;default: 5'b0 ; */ -/*description: In the slave mode it is the length of status bit.*/ -#define SPI_SLV_STATUS_BITLEN 0x0000001F -#define SPI_SLV_STATUS_BITLEN_M ((SPI_SLV_STATUS_BITLEN_V)<<(SPI_SLV_STATUS_BITLEN_S)) -#define SPI_SLV_STATUS_BITLEN_V 0x1F -#define SPI_SLV_STATUS_BITLEN_S 27 -/* SPI_SLV_STATUS_FAST_EN : R/W ;bitpos:[26] ;default: 1'b0 ; */ -/*description: In the slave mode enable fast read status.*/ -#define SPI_SLV_STATUS_FAST_EN (BIT(26)) -#define SPI_SLV_STATUS_FAST_EN_M (BIT(26)) -#define SPI_SLV_STATUS_FAST_EN_V 0x1 -#define SPI_SLV_STATUS_FAST_EN_S 26 -/* SPI_SLV_STATUS_READBACK : R/W ;bitpos:[25] ;default: 1'b1 ; */ -/*description: In the slave mode 1:read register of SPI_SLV_WR_STATUS 0: read - register of SPI_RD_STATUS.*/ -#define SPI_SLV_STATUS_READBACK (BIT(25)) -#define SPI_SLV_STATUS_READBACK_M (BIT(25)) -#define SPI_SLV_STATUS_READBACK_V 0x1 -#define SPI_SLV_STATUS_READBACK_S 25 -/* SPI_SLV_RD_ADDR_BITLEN : R/W ;bitpos:[15:10] ;default: 6'h0 ; */ -/*description: In the slave mode it is the address length in bits for read-buffer - operation. The register value shall be (bit_num-1).*/ -#define SPI_SLV_RD_ADDR_BITLEN 0x0000003F -#define SPI_SLV_RD_ADDR_BITLEN_M ((SPI_SLV_RD_ADDR_BITLEN_V)<<(SPI_SLV_RD_ADDR_BITLEN_S)) -#define SPI_SLV_RD_ADDR_BITLEN_V 0x3F -#define SPI_SLV_RD_ADDR_BITLEN_S 10 -/* SPI_SLV_WR_ADDR_BITLEN : R/W ;bitpos:[9:4] ;default: 6'h0 ; */ -/*description: In the slave mode it is the address length in bits for write-buffer - operation. The register value shall be (bit_num-1).*/ -#define SPI_SLV_WR_ADDR_BITLEN 0x0000003F -#define SPI_SLV_WR_ADDR_BITLEN_M ((SPI_SLV_WR_ADDR_BITLEN_V)<<(SPI_SLV_WR_ADDR_BITLEN_S)) -#define SPI_SLV_WR_ADDR_BITLEN_V 0x3F -#define SPI_SLV_WR_ADDR_BITLEN_S 4 -/* SPI_SLV_WRSTA_DUMMY_EN : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: In the slave mode it is the enable bit of dummy phase for write-status - operations.*/ -#define SPI_SLV_WRSTA_DUMMY_EN (BIT(3)) -#define SPI_SLV_WRSTA_DUMMY_EN_M (BIT(3)) -#define SPI_SLV_WRSTA_DUMMY_EN_V 0x1 -#define SPI_SLV_WRSTA_DUMMY_EN_S 3 -/* SPI_SLV_RDSTA_DUMMY_EN : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: In the slave mode it is the enable bit of dummy phase for read-status - operations.*/ -#define SPI_SLV_RDSTA_DUMMY_EN (BIT(2)) -#define SPI_SLV_RDSTA_DUMMY_EN_M (BIT(2)) -#define SPI_SLV_RDSTA_DUMMY_EN_V 0x1 -#define SPI_SLV_RDSTA_DUMMY_EN_S 2 -/* SPI_SLV_WRBUF_DUMMY_EN : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: In the slave mode it is the enable bit of dummy phase for write-buffer - operations.*/ -#define SPI_SLV_WRBUF_DUMMY_EN (BIT(1)) -#define SPI_SLV_WRBUF_DUMMY_EN_M (BIT(1)) -#define SPI_SLV_WRBUF_DUMMY_EN_V 0x1 -#define SPI_SLV_WRBUF_DUMMY_EN_S 1 -/* SPI_SLV_RDBUF_DUMMY_EN : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: In the slave mode it is the enable bit of dummy phase for read-buffer - operations.*/ -#define SPI_SLV_RDBUF_DUMMY_EN (BIT(0)) -#define SPI_SLV_RDBUF_DUMMY_EN_M (BIT(0)) -#define SPI_SLV_RDBUF_DUMMY_EN_V 0x1 -#define SPI_SLV_RDBUF_DUMMY_EN_S 0 - -#define SPI_SLAVE2_REG(i) (REG_SPI_BASE(i) + 0x40) -/* SPI_SLV_WRBUF_DUMMY_CYCLELEN : R/W ;bitpos:[31:24] ;default: 8'b0 ; */ -/*description: In the slave mode it is the length in spi_clk cycles of dummy - phase for write-buffer operations. The register value shall be (cycle_num-1).*/ -#define SPI_SLV_WRBUF_DUMMY_CYCLELEN 0x000000FF -#define SPI_SLV_WRBUF_DUMMY_CYCLELEN_M ((SPI_SLV_WRBUF_DUMMY_CYCLELEN_V)<<(SPI_SLV_WRBUF_DUMMY_CYCLELEN_S)) -#define SPI_SLV_WRBUF_DUMMY_CYCLELEN_V 0xFF -#define SPI_SLV_WRBUF_DUMMY_CYCLELEN_S 24 -/* SPI_SLV_RDBUF_DUMMY_CYCLELEN : R/W ;bitpos:[23:16] ;default: 8'h0 ; */ -/*description: In the slave mode it is the length in spi_clk cycles of dummy - phase for read-buffer operations. The register value shall be (cycle_num-1).*/ -#define SPI_SLV_RDBUF_DUMMY_CYCLELEN 0x000000FF -#define SPI_SLV_RDBUF_DUMMY_CYCLELEN_M ((SPI_SLV_RDBUF_DUMMY_CYCLELEN_V)<<(SPI_SLV_RDBUF_DUMMY_CYCLELEN_S)) -#define SPI_SLV_RDBUF_DUMMY_CYCLELEN_V 0xFF -#define SPI_SLV_RDBUF_DUMMY_CYCLELEN_S 16 -/* SPI_SLV_WRSTA_DUMMY_CYCLELEN : R/W ;bitpos:[15:8] ;default: 8'h0 ; */ -/*description: In the slave mode it is the length in spi_clk cycles of dummy - phase for write-status operations. The register value shall be (cycle_num-1).*/ -#define SPI_SLV_WRSTA_DUMMY_CYCLELEN 0x000000FF -#define SPI_SLV_WRSTA_DUMMY_CYCLELEN_M ((SPI_SLV_WRSTA_DUMMY_CYCLELEN_V)<<(SPI_SLV_WRSTA_DUMMY_CYCLELEN_S)) -#define SPI_SLV_WRSTA_DUMMY_CYCLELEN_V 0xFF -#define SPI_SLV_WRSTA_DUMMY_CYCLELEN_S 8 -/* SPI_SLV_RDSTA_DUMMY_CYCLELEN : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: In the slave mode it is the length in spi_clk cycles of dummy - phase for read-status operations. The register value shall be (cycle_num-1).*/ -#define SPI_SLV_RDSTA_DUMMY_CYCLELEN 0x000000FF -#define SPI_SLV_RDSTA_DUMMY_CYCLELEN_M ((SPI_SLV_RDSTA_DUMMY_CYCLELEN_V)<<(SPI_SLV_RDSTA_DUMMY_CYCLELEN_S)) -#define SPI_SLV_RDSTA_DUMMY_CYCLELEN_V 0xFF -#define SPI_SLV_RDSTA_DUMMY_CYCLELEN_S 0 - -#define SPI_SLAVE3_REG(i) (REG_SPI_BASE(i) + 0x44) -/* SPI_SLV_WRSTA_CMD_VALUE : R/W ;bitpos:[31:24] ;default: 8'b0 ; */ -/*description: In the slave mode it is the value of write-status command.*/ -#define SPI_SLV_WRSTA_CMD_VALUE 0x000000FF -#define SPI_SLV_WRSTA_CMD_VALUE_M ((SPI_SLV_WRSTA_CMD_VALUE_V)<<(SPI_SLV_WRSTA_CMD_VALUE_S)) -#define SPI_SLV_WRSTA_CMD_VALUE_V 0xFF -#define SPI_SLV_WRSTA_CMD_VALUE_S 24 -/* SPI_SLV_RDSTA_CMD_VALUE : R/W ;bitpos:[23:16] ;default: 8'b0 ; */ -/*description: In the slave mode it is the value of read-status command.*/ -#define SPI_SLV_RDSTA_CMD_VALUE 0x000000FF -#define SPI_SLV_RDSTA_CMD_VALUE_M ((SPI_SLV_RDSTA_CMD_VALUE_V)<<(SPI_SLV_RDSTA_CMD_VALUE_S)) -#define SPI_SLV_RDSTA_CMD_VALUE_V 0xFF -#define SPI_SLV_RDSTA_CMD_VALUE_S 16 -/* SPI_SLV_WRBUF_CMD_VALUE : R/W ;bitpos:[15:8] ;default: 8'b0 ; */ -/*description: In the slave mode it is the value of write-buffer command.*/ -#define SPI_SLV_WRBUF_CMD_VALUE 0x000000FF -#define SPI_SLV_WRBUF_CMD_VALUE_M ((SPI_SLV_WRBUF_CMD_VALUE_V)<<(SPI_SLV_WRBUF_CMD_VALUE_S)) -#define SPI_SLV_WRBUF_CMD_VALUE_V 0xFF -#define SPI_SLV_WRBUF_CMD_VALUE_S 8 -/* SPI_SLV_RDBUF_CMD_VALUE : R/W ;bitpos:[7:0] ;default: 8'b0 ; */ -/*description: In the slave mode it is the value of read-buffer command.*/ -#define SPI_SLV_RDBUF_CMD_VALUE 0x000000FF -#define SPI_SLV_RDBUF_CMD_VALUE_M ((SPI_SLV_RDBUF_CMD_VALUE_V)<<(SPI_SLV_RDBUF_CMD_VALUE_S)) -#define SPI_SLV_RDBUF_CMD_VALUE_V 0xFF -#define SPI_SLV_RDBUF_CMD_VALUE_S 0 - -#define SPI_SLV_WRBUF_DLEN_REG(i) (REG_SPI_BASE(i) + 0x48) -/* SPI_SLV_WRBUF_DBITLEN : R/W ;bitpos:[23:0] ;default: 24'h0 ; */ -/*description: In the slave mode it is the length in bits for write-buffer operations. - The register value shall be (bit_num-1).*/ -#define SPI_SLV_WRBUF_DBITLEN 0x00FFFFFF -#define SPI_SLV_WRBUF_DBITLEN_M ((SPI_SLV_WRBUF_DBITLEN_V)<<(SPI_SLV_WRBUF_DBITLEN_S)) -#define SPI_SLV_WRBUF_DBITLEN_V 0xFFFFFF -#define SPI_SLV_WRBUF_DBITLEN_S 0 - -#define SPI_SLV_RDBUF_DLEN_REG(i) (REG_SPI_BASE(i) + 0x4C) -/* SPI_SLV_RDBUF_DBITLEN : R/W ;bitpos:[23:0] ;default: 24'h0 ; */ -/*description: In the slave mode it is the length in bits for read-buffer operations. - The register value shall be (bit_num-1).*/ -#define SPI_SLV_RDBUF_DBITLEN 0x00FFFFFF -#define SPI_SLV_RDBUF_DBITLEN_M ((SPI_SLV_RDBUF_DBITLEN_V)<<(SPI_SLV_RDBUF_DBITLEN_S)) -#define SPI_SLV_RDBUF_DBITLEN_V 0xFFFFFF -#define SPI_SLV_RDBUF_DBITLEN_S 0 - -#define SPI_CACHE_FCTRL_REG(i) (REG_SPI_BASE(i) + 0x50) -/* SPI_CACHE_FLASH_PES_EN : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: For SPI0 spi1 send suspend command before cache read flash - 1: enable 0:disable.*/ -#define SPI_CACHE_FLASH_PES_EN (BIT(3)) -#define SPI_CACHE_FLASH_PES_EN_M (BIT(3)) -#define SPI_CACHE_FLASH_PES_EN_V 0x1 -#define SPI_CACHE_FLASH_PES_EN_S 3 -/* SPI_CACHE_FLASH_USR_CMD : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: For SPI0 cache read flash for user define command 1: enable 0:disable.*/ -#define SPI_CACHE_FLASH_USR_CMD (BIT(2)) -#define SPI_CACHE_FLASH_USR_CMD_M (BIT(2)) -#define SPI_CACHE_FLASH_USR_CMD_V 0x1 -#define SPI_CACHE_FLASH_USR_CMD_S 2 -/* SPI_CACHE_USR_CMD_4BYTE : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: For SPI0 cache read flash with 4 bytes command 1: enable 0:disable.*/ -#define SPI_CACHE_USR_CMD_4BYTE (BIT(1)) -#define SPI_CACHE_USR_CMD_4BYTE_M (BIT(1)) -#define SPI_CACHE_USR_CMD_4BYTE_V 0x1 -#define SPI_CACHE_USR_CMD_4BYTE_S 1 -/* SPI_CACHE_REQ_EN : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: For SPI0 Cache access enable 1: enable 0:disable.*/ -#define SPI_CACHE_REQ_EN (BIT(0)) -#define SPI_CACHE_REQ_EN_M (BIT(0)) -#define SPI_CACHE_REQ_EN_V 0x1 -#define SPI_CACHE_REQ_EN_S 0 - -#define SPI_CACHE_SCTRL_REG(i) (REG_SPI_BASE(i) + 0x54) -/* SPI_CACHE_SRAM_USR_WCMD : R/W ;bitpos:[28] ;default: 1'b1 ; */ -/*description: For SPI0 In the spi sram mode cache write sram for user define command*/ -#define SPI_CACHE_SRAM_USR_WCMD (BIT(28)) -#define SPI_CACHE_SRAM_USR_WCMD_M (BIT(28)) -#define SPI_CACHE_SRAM_USR_WCMD_V 0x1 -#define SPI_CACHE_SRAM_USR_WCMD_S 28 -/* SPI_SRAM_ADDR_BITLEN : R/W ;bitpos:[27:22] ;default: 6'd23 ; */ -/*description: For SPI0 In the sram mode it is the length in bits of address - phase. The register value shall be (bit_num-1).*/ -#define SPI_SRAM_ADDR_BITLEN 0x0000003F -#define SPI_SRAM_ADDR_BITLEN_M ((SPI_SRAM_ADDR_BITLEN_V)<<(SPI_SRAM_ADDR_BITLEN_S)) -#define SPI_SRAM_ADDR_BITLEN_V 0x3F -#define SPI_SRAM_ADDR_BITLEN_S 22 -/* SPI_SRAM_DUMMY_CYCLELEN : R/W ;bitpos:[21:14] ;default: 8'b1 ; */ -/*description: For SPI0 In the sram mode it is the length in bits of address - phase. The register value shall be (bit_num-1).*/ -#define SPI_SRAM_DUMMY_CYCLELEN 0x000000FF -#define SPI_SRAM_DUMMY_CYCLELEN_M ((SPI_SRAM_DUMMY_CYCLELEN_V)<<(SPI_SRAM_DUMMY_CYCLELEN_S)) -#define SPI_SRAM_DUMMY_CYCLELEN_V 0xFF -#define SPI_SRAM_DUMMY_CYCLELEN_S 14 -/* SPI_SRAM_BYTES_LEN : R/W ;bitpos:[13:6] ;default: 8'b32 ; */ -/*description: For SPI0 In the sram mode it is the byte length of spi read sram data.*/ -#define SPI_SRAM_BYTES_LEN 0x000000FF -#define SPI_SRAM_BYTES_LEN_M ((SPI_SRAM_BYTES_LEN_V)<<(SPI_SRAM_BYTES_LEN_S)) -#define SPI_SRAM_BYTES_LEN_V 0xFF -#define SPI_SRAM_BYTES_LEN_S 6 -/* SPI_CACHE_SRAM_USR_RCMD : R/W ;bitpos:[5] ;default: 1'b1 ; */ -/*description: For SPI0 In the spi sram mode cache read sram for user define command.*/ -#define SPI_CACHE_SRAM_USR_RCMD (BIT(5)) -#define SPI_CACHE_SRAM_USR_RCMD_M (BIT(5)) -#define SPI_CACHE_SRAM_USR_RCMD_V 0x1 -#define SPI_CACHE_SRAM_USR_RCMD_S 5 -/* SPI_USR_RD_SRAM_DUMMY : R/W ;bitpos:[4] ;default: 1'b1 ; */ -/*description: For SPI0 In the spi sram mode it is the enable bit of dummy - phase for read operations.*/ -#define SPI_USR_RD_SRAM_DUMMY (BIT(4)) -#define SPI_USR_RD_SRAM_DUMMY_M (BIT(4)) -#define SPI_USR_RD_SRAM_DUMMY_V 0x1 -#define SPI_USR_RD_SRAM_DUMMY_S 4 -/* SPI_USR_WR_SRAM_DUMMY : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: For SPI0 In the spi sram mode it is the enable bit of dummy - phase for write operations.*/ -#define SPI_USR_WR_SRAM_DUMMY (BIT(3)) -#define SPI_USR_WR_SRAM_DUMMY_M (BIT(3)) -#define SPI_USR_WR_SRAM_DUMMY_V 0x1 -#define SPI_USR_WR_SRAM_DUMMY_S 3 -/* SPI_USR_SRAM_QIO : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: For SPI0 In the spi sram mode spi quad I/O mode enable 1: enable 0:disable*/ -#define SPI_USR_SRAM_QIO (BIT(2)) -#define SPI_USR_SRAM_QIO_M (BIT(2)) -#define SPI_USR_SRAM_QIO_V 0x1 -#define SPI_USR_SRAM_QIO_S 2 -/* SPI_USR_SRAM_DIO : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: For SPI0 In the spi sram mode spi dual I/O mode enable 1: enable 0:disable*/ -#define SPI_USR_SRAM_DIO (BIT(1)) -#define SPI_USR_SRAM_DIO_M (BIT(1)) -#define SPI_USR_SRAM_DIO_V 0x1 -#define SPI_USR_SRAM_DIO_S 1 - -#define SPI_SRAM_CMD_REG(i) (REG_SPI_BASE(i) + 0x58) -/* SPI_SRAM_RSTIO : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: For SPI0 SRAM IO mode reset enable. SRAM IO mode reset operation - will be triggered when the bit is set. The bit will be cleared once the operation done*/ -#define SPI_SRAM_RSTIO (BIT(4)) -#define SPI_SRAM_RSTIO_M (BIT(4)) -#define SPI_SRAM_RSTIO_V 0x1 -#define SPI_SRAM_RSTIO_S 4 -/* SPI_SRAM_QIO : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: For SPI0 SRAM QIO mode enable . SRAM QIO enable command will - be send when the bit is set. The bit will be cleared once the operation done.*/ -#define SPI_SRAM_QIO (BIT(1)) -#define SPI_SRAM_QIO_M (BIT(1)) -#define SPI_SRAM_QIO_V 0x1 -#define SPI_SRAM_QIO_S 1 -/* SPI_SRAM_DIO : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: For SPI0 SRAM DIO mode enable . SRAM DIO enable command will - be send when the bit is set. The bit will be cleared once the operation done.*/ -#define SPI_SRAM_DIO (BIT(0)) -#define SPI_SRAM_DIO_M (BIT(0)) -#define SPI_SRAM_DIO_V 0x1 -#define SPI_SRAM_DIO_S 0 - -#define SPI_SRAM_DRD_CMD_REG(i) (REG_SPI_BASE(i) + 0x5C) -/* SPI_CACHE_SRAM_USR_RD_CMD_BITLEN : R/W ;bitpos:[31:28] ;default: 4'h0 ; */ -/*description: For SPI0 When cache mode is enable it is the length in bits of - command phase for SRAM. The register value shall be (bit_num-1).*/ -#define SPI_CACHE_SRAM_USR_RD_CMD_BITLEN 0x0000000F -#define SPI_CACHE_SRAM_USR_RD_CMD_BITLEN_M ((SPI_CACHE_SRAM_USR_RD_CMD_BITLEN_V)<<(SPI_CACHE_SRAM_USR_RD_CMD_BITLEN_S)) -#define SPI_CACHE_SRAM_USR_RD_CMD_BITLEN_V 0xF -#define SPI_CACHE_SRAM_USR_RD_CMD_BITLEN_S 28 -/* SPI_CACHE_SRAM_USR_RD_CMD_VALUE : R/W ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: For SPI0 When cache mode is enable it is the read command value - of command phase for SRAM.*/ -#define SPI_CACHE_SRAM_USR_RD_CMD_VALUE 0x0000FFFF -#define SPI_CACHE_SRAM_USR_RD_CMD_VALUE_M ((SPI_CACHE_SRAM_USR_RD_CMD_VALUE_V)<<(SPI_CACHE_SRAM_USR_RD_CMD_VALUE_S)) -#define SPI_CACHE_SRAM_USR_RD_CMD_VALUE_V 0xFFFF -#define SPI_CACHE_SRAM_USR_RD_CMD_VALUE_S 0 - -#define SPI_SRAM_DWR_CMD_REG(i) (REG_SPI_BASE(i) + 0x60) -/* SPI_CACHE_SRAM_USR_WR_CMD_BITLEN : R/W ;bitpos:[31:28] ;default: 4'h0 ; */ -/*description: For SPI0 When cache mode is enable it is the in bits of command - phase for SRAM. The register value shall be (bit_num-1).*/ -#define SPI_CACHE_SRAM_USR_WR_CMD_BITLEN 0x0000000F -#define SPI_CACHE_SRAM_USR_WR_CMD_BITLEN_M ((SPI_CACHE_SRAM_USR_WR_CMD_BITLEN_V)<<(SPI_CACHE_SRAM_USR_WR_CMD_BITLEN_S)) -#define SPI_CACHE_SRAM_USR_WR_CMD_BITLEN_V 0xF -#define SPI_CACHE_SRAM_USR_WR_CMD_BITLEN_S 28 -/* SPI_CACHE_SRAM_USR_WR_CMD_VALUE : R/W ;bitpos:[15:0] ;default: 16'h0 ; */ -/*description: For SPI0 When cache mode is enable it is the write command value - of command phase for SRAM.*/ -#define SPI_CACHE_SRAM_USR_WR_CMD_VALUE 0x0000FFFF -#define SPI_CACHE_SRAM_USR_WR_CMD_VALUE_M ((SPI_CACHE_SRAM_USR_WR_CMD_VALUE_V)<<(SPI_CACHE_SRAM_USR_WR_CMD_VALUE_S)) -#define SPI_CACHE_SRAM_USR_WR_CMD_VALUE_V 0xFFFF -#define SPI_CACHE_SRAM_USR_WR_CMD_VALUE_S 0 - -#define SPI_SLV_RD_BIT_REG(i) (REG_SPI_BASE(i) + 0x64) -/* SPI_SLV_RDATA_BIT : RW ;bitpos:[23:0] ;default: 24'b0 ; */ -/*description: In the slave mode it is the bit length of read data. The value - is the length - 1.*/ -#define SPI_SLV_RDATA_BIT 0x00FFFFFF -#define SPI_SLV_RDATA_BIT_M ((SPI_SLV_RDATA_BIT_V)<<(SPI_SLV_RDATA_BIT_S)) -#define SPI_SLV_RDATA_BIT_V 0xFFFFFF -#define SPI_SLV_RDATA_BIT_S 0 - -#define SPI_W0_REG(i) (REG_SPI_BASE(i) + 0x80) -/* SPI_BUF0 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: data buffer*/ -#define SPI_BUF0 0xFFFFFFFF -#define SPI_BUF0_M ((SPI_BUF0_V)<<(SPI_BUF0_S)) -#define SPI_BUF0_V 0xFFFFFFFF -#define SPI_BUF0_S 0 - -#define SPI_W1_REG(i) (REG_SPI_BASE(i) + 0x84) -/* SPI_BUF1 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: data buffer*/ -#define SPI_BUF1 0xFFFFFFFF -#define SPI_BUF1_M ((SPI_BUF1_V)<<(SPI_BUF1_S)) -#define SPI_BUF1_V 0xFFFFFFFF -#define SPI_BUF1_S 0 - -#define SPI_W2_REG(i) (REG_SPI_BASE(i) + 0x88) -/* SPI_BUF2 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: data buffer*/ -#define SPI_BUF2 0xFFFFFFFF -#define SPI_BUF2_M ((SPI_BUF2_V)<<(SPI_BUF2_S)) -#define SPI_BUF2_V 0xFFFFFFFF -#define SPI_BUF2_S 0 - -#define SPI_W3_REG(i) (REG_SPI_BASE(i) + 0x8C) -/* SPI_BUF3 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: data buffer*/ -#define SPI_BUF3 0xFFFFFFFF -#define SPI_BUF3_M ((SPI_BUF3_V)<<(SPI_BUF3_S)) -#define SPI_BUF3_V 0xFFFFFFFF -#define SPI_BUF3_S 0 - -#define SPI_W4_REG(i) (REG_SPI_BASE(i) + 0x90) -/* SPI_BUF4 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: data buffer*/ -#define SPI_BUF4 0xFFFFFFFF -#define SPI_BUF4_M ((SPI_BUF4_V)<<(SPI_BUF4_S)) -#define SPI_BUF4_V 0xFFFFFFFF -#define SPI_BUF4_S 0 - -#define SPI_W5_REG(i) (REG_SPI_BASE(i) + 0x94) -/* SPI_BUF5 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: data buffer*/ -#define SPI_BUF5 0xFFFFFFFF -#define SPI_BUF5_M ((SPI_BUF5_V)<<(SPI_BUF5_S)) -#define SPI_BUF5_V 0xFFFFFFFF -#define SPI_BUF5_S 0 - -#define SPI_W6_REG(i) (REG_SPI_BASE(i) + 0x98) -/* SPI_BUF6 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: data buffer*/ -#define SPI_BUF6 0xFFFFFFFF -#define SPI_BUF6_M ((SPI_BUF6_V)<<(SPI_BUF6_S)) -#define SPI_BUF6_V 0xFFFFFFFF -#define SPI_BUF6_S 0 - -#define SPI_W7_REG(i) (REG_SPI_BASE(i) + 0x9C) -/* SPI_BUF7 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: data buffer*/ -#define SPI_BUF7 0xFFFFFFFF -#define SPI_BUF7_M ((SPI_BUF7_V)<<(SPI_BUF7_S)) -#define SPI_BUF7_V 0xFFFFFFFF -#define SPI_BUF7_S 0 - -#define SPI_W8_REG(i) (REG_SPI_BASE(i) + 0xA0) -/* SPI_BUF8 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: data buffer*/ -#define SPI_BUF8 0xFFFFFFFF -#define SPI_BUF8_M ((SPI_BUF8_V)<<(SPI_BUF8_S)) -#define SPI_BUF8_V 0xFFFFFFFF -#define SPI_BUF8_S 0 - -#define SPI_W9_REG(i) (REG_SPI_BASE(i) + 0xA4) -/* SPI_BUF9 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: data buffer*/ -#define SPI_BUF9 0xFFFFFFFF -#define SPI_BUF9_M ((SPI_BUF9_V)<<(SPI_BUF9_S)) -#define SPI_BUF9_V 0xFFFFFFFF -#define SPI_BUF9_S 0 - -#define SPI_W10_REG(i) (REG_SPI_BASE(i) + 0xA8) -/* SPI_BUF10 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: data buffer*/ -#define SPI_BUF10 0xFFFFFFFF -#define SPI_BUF10_M ((SPI_BUF10_V)<<(SPI_BUF10_S)) -#define SPI_BUF10_V 0xFFFFFFFF -#define SPI_BUF10_S 0 - -#define SPI_W11_REG(i) (REG_SPI_BASE(i) + 0xAC) -/* SPI_BUF11 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: data buffer*/ -#define SPI_BUF11 0xFFFFFFFF -#define SPI_BUF11_M ((SPI_BUF11_V)<<(SPI_BUF11_S)) -#define SPI_BUF11_V 0xFFFFFFFF -#define SPI_BUF11_S 0 - -#define SPI_W12_REG(i) (REG_SPI_BASE(i) + 0xB0) -/* SPI_BUF12 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: data buffer*/ -#define SPI_BUF12 0xFFFFFFFF -#define SPI_BUF12_M ((SPI_BUF12_V)<<(SPI_BUF12_S)) -#define SPI_BUF12_V 0xFFFFFFFF -#define SPI_BUF12_S 0 - -#define SPI_W13_REG(i) (REG_SPI_BASE(i) + 0xB4) -/* SPI_BUF13 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: data buffer*/ -#define SPI_BUF13 0xFFFFFFFF -#define SPI_BUF13_M ((SPI_BUF13_V)<<(SPI_BUF13_S)) -#define SPI_BUF13_V 0xFFFFFFFF -#define SPI_BUF13_S 0 - -#define SPI_W14_REG(i) (REG_SPI_BASE(i) + 0xB8) -/* SPI_BUF14 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: data buffer*/ -#define SPI_BUF14 0xFFFFFFFF -#define SPI_BUF14_M ((SPI_BUF14_V)<<(SPI_BUF14_S)) -#define SPI_BUF14_V 0xFFFFFFFF -#define SPI_BUF14_S 0 - -#define SPI_W15_REG(i) (REG_SPI_BASE(i) + 0xBC) -/* SPI_BUF15 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: data buffer*/ -#define SPI_BUF15 0xFFFFFFFF -#define SPI_BUF15_M ((SPI_BUF15_V)<<(SPI_BUF15_S)) -#define SPI_BUF15_V 0xFFFFFFFF -#define SPI_BUF15_S 0 - -#define SPI_TX_CRC_REG(i) (REG_SPI_BASE(i) + 0xC0) -/* SPI_TX_CRC_DATA : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: For SPI1 the value of crc32 for 256 bits data.*/ -#define SPI_TX_CRC_DATA 0xFFFFFFFF -#define SPI_TX_CRC_DATA_M ((SPI_TX_CRC_DATA_V)<<(SPI_TX_CRC_DATA_S)) -#define SPI_TX_CRC_DATA_V 0xFFFFFFFF -#define SPI_TX_CRC_DATA_S 0 - -#define SPI_EXT0_REG(i) (REG_SPI_BASE(i) + 0xF0) -/* SPI_T_PP_ENA : R/W ;bitpos:[31] ;default: 1'b1 ; */ -/*description: page program delay enable.*/ -#define SPI_T_PP_ENA (BIT(31)) -#define SPI_T_PP_ENA_M (BIT(31)) -#define SPI_T_PP_ENA_V 0x1 -#define SPI_T_PP_ENA_S 31 -/* SPI_T_PP_SHIFT : R/W ;bitpos:[19:16] ;default: 4'd10 ; */ -/*description: page program delay time shift .*/ -#define SPI_T_PP_SHIFT 0x0000000F -#define SPI_T_PP_SHIFT_M ((SPI_T_PP_SHIFT_V)<<(SPI_T_PP_SHIFT_S)) -#define SPI_T_PP_SHIFT_V 0xF -#define SPI_T_PP_SHIFT_S 16 -/* SPI_T_PP_TIME : R/W ;bitpos:[11:0] ;default: 12'd80 ; */ -/*description: page program delay time by system clock.*/ -#define SPI_T_PP_TIME 0x00000FFF -#define SPI_T_PP_TIME_M ((SPI_T_PP_TIME_V)<<(SPI_T_PP_TIME_S)) -#define SPI_T_PP_TIME_V 0xFFF -#define SPI_T_PP_TIME_S 0 - -#define SPI_EXT1_REG(i) (REG_SPI_BASE(i) + 0xF4) -/* SPI_T_ERASE_ENA : R/W ;bitpos:[31] ;default: 1'b1 ; */ -/*description: erase flash delay enable.*/ -#define SPI_T_ERASE_ENA (BIT(31)) -#define SPI_T_ERASE_ENA_M (BIT(31)) -#define SPI_T_ERASE_ENA_V 0x1 -#define SPI_T_ERASE_ENA_S 31 -/* SPI_T_ERASE_SHIFT : R/W ;bitpos:[19:16] ;default: 4'd15 ; */ -/*description: erase flash delay time shift.*/ -#define SPI_T_ERASE_SHIFT 0x0000000F -#define SPI_T_ERASE_SHIFT_M ((SPI_T_ERASE_SHIFT_V)<<(SPI_T_ERASE_SHIFT_S)) -#define SPI_T_ERASE_SHIFT_V 0xF -#define SPI_T_ERASE_SHIFT_S 16 -/* SPI_T_ERASE_TIME : R/W ;bitpos:[11:0] ;default: 12'd0 ; */ -/*description: erase flash delay time by system clock.*/ -#define SPI_T_ERASE_TIME 0x00000FFF -#define SPI_T_ERASE_TIME_M ((SPI_T_ERASE_TIME_V)<<(SPI_T_ERASE_TIME_S)) -#define SPI_T_ERASE_TIME_V 0xFFF -#define SPI_T_ERASE_TIME_S 0 - -#define SPI_EXT2_REG(i) (REG_SPI_BASE(i) + 0xF8) -/* SPI_ST : RO ;bitpos:[2:0] ;default: 3'b0 ; */ -/*description: The status of spi state machine .*/ -#define SPI_ST 0x00000007 -#define SPI_ST_M ((SPI_ST_V)<<(SPI_ST_S)) -#define SPI_ST_V 0x7 -#define SPI_ST_S 0 - -#define SPI_EXT3_REG(i) (REG_SPI_BASE(i) + 0xFC) -/* SPI_INT_HOLD_ENA : R/W ;bitpos:[1:0] ;default: 2'b0 ; */ -/*description: This register is for two SPI masters to share the same cs clock - and data signals. The bits of one SPI are set if the other SPI is busy the SPI will be hold. 1(3): hold at ¡°idle¡± phase 2: hold at ¡°prepare¡± phase.*/ -#define SPI_INT_HOLD_ENA 0x00000003 -#define SPI_INT_HOLD_ENA_M ((SPI_INT_HOLD_ENA_V)<<(SPI_INT_HOLD_ENA_S)) -#define SPI_INT_HOLD_ENA_V 0x3 -#define SPI_INT_HOLD_ENA_S 0 - -#define SPI_DMA_CONF_REG(i) (REG_SPI_BASE(i) + 0x100) -/* SPI_DMA_CONTINUE : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: spi dma continue tx/rx data.*/ -#define SPI_DMA_CONTINUE (BIT(16)) -#define SPI_DMA_CONTINUE_M (BIT(16)) -#define SPI_DMA_CONTINUE_V 0x1 -#define SPI_DMA_CONTINUE_S 16 -/* SPI_DMA_TX_STOP : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: spi dma write data stop when in continue tx/rx mode.*/ -#define SPI_DMA_TX_STOP (BIT(15)) -#define SPI_DMA_TX_STOP_M (BIT(15)) -#define SPI_DMA_TX_STOP_V 0x1 -#define SPI_DMA_TX_STOP_S 15 -/* SPI_DMA_RX_STOP : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: spi dma read data stop when in continue tx/rx mode.*/ -#define SPI_DMA_RX_STOP (BIT(14)) -#define SPI_DMA_RX_STOP_M (BIT(14)) -#define SPI_DMA_RX_STOP_V 0x1 -#define SPI_DMA_RX_STOP_S 14 -/* SPI_OUT_DATA_BURST_EN : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: spi dma read data from memory in burst mode.*/ -#define SPI_OUT_DATA_BURST_EN (BIT(12)) -#define SPI_OUT_DATA_BURST_EN_M (BIT(12)) -#define SPI_OUT_DATA_BURST_EN_V 0x1 -#define SPI_OUT_DATA_BURST_EN_S 12 -/* SPI_INDSCR_BURST_EN : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: read descriptor use burst mode when write data to memory.*/ -#define SPI_INDSCR_BURST_EN (BIT(11)) -#define SPI_INDSCR_BURST_EN_M (BIT(11)) -#define SPI_INDSCR_BURST_EN_V 0x1 -#define SPI_INDSCR_BURST_EN_S 11 -/* SPI_OUTDSCR_BURST_EN : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: read descriptor use burst mode when read data for memory.*/ -#define SPI_OUTDSCR_BURST_EN (BIT(10)) -#define SPI_OUTDSCR_BURST_EN_M (BIT(10)) -#define SPI_OUTDSCR_BURST_EN_V 0x1 -#define SPI_OUTDSCR_BURST_EN_S 10 -/* SPI_OUT_EOF_MODE : R/W ;bitpos:[9] ;default: 1'b1 ; */ -/*description: out eof flag generation mode . 1: when dma pop all data from - fifo 0:when ahb push all data to fifo.*/ -#define SPI_OUT_EOF_MODE (BIT(9)) -#define SPI_OUT_EOF_MODE_M (BIT(9)) -#define SPI_OUT_EOF_MODE_V 0x1 -#define SPI_OUT_EOF_MODE_S 9 -/* SPI_OUT_AUTO_WRBACK : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: when the link is empty jump to next automatically.*/ -#define SPI_OUT_AUTO_WRBACK (BIT(8)) -#define SPI_OUT_AUTO_WRBACK_M (BIT(8)) -#define SPI_OUT_AUTO_WRBACK_V 0x1 -#define SPI_OUT_AUTO_WRBACK_S 8 -/* SPI_OUT_LOOP_TEST : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: Set bit to test out link.*/ -#define SPI_OUT_LOOP_TEST (BIT(7)) -#define SPI_OUT_LOOP_TEST_M (BIT(7)) -#define SPI_OUT_LOOP_TEST_V 0x1 -#define SPI_OUT_LOOP_TEST_S 7 -/* SPI_IN_LOOP_TEST : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: Set bit to test in link.*/ -#define SPI_IN_LOOP_TEST (BIT(6)) -#define SPI_IN_LOOP_TEST_M (BIT(6)) -#define SPI_IN_LOOP_TEST_V 0x1 -#define SPI_IN_LOOP_TEST_S 6 -/* SPI_AHBM_RST : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: reset spi dma ahb master.*/ -#define SPI_AHBM_RST (BIT(5)) -#define SPI_AHBM_RST_M (BIT(5)) -#define SPI_AHBM_RST_V 0x1 -#define SPI_AHBM_RST_S 5 -/* SPI_AHBM_FIFO_RST : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: reset spi dma ahb master fifo pointer.*/ -#define SPI_AHBM_FIFO_RST (BIT(4)) -#define SPI_AHBM_FIFO_RST_M (BIT(4)) -#define SPI_AHBM_FIFO_RST_V 0x1 -#define SPI_AHBM_FIFO_RST_S 4 -/* SPI_OUT_RST : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: The bit is used to reset out dma fsm and out data fifo pointer.*/ -#define SPI_OUT_RST (BIT(3)) -#define SPI_OUT_RST_M (BIT(3)) -#define SPI_OUT_RST_V 0x1 -#define SPI_OUT_RST_S 3 -/* SPI_IN_RST : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: The bit is used to reset in dma fsm and in data fifo pointer.*/ -#define SPI_IN_RST (BIT(2)) -#define SPI_IN_RST_M (BIT(2)) -#define SPI_IN_RST_V 0x1 -#define SPI_IN_RST_S 2 - -#define SPI_DMA_OUT_LINK_REG(i) (REG_SPI_BASE(i) + 0x104) -/* SPI_OUTLINK_RESTART : R/W ;bitpos:[30] ;default: 1'b0 ; */ -/*description: Set the bit to mount on new outlink descriptors.*/ -#define SPI_OUTLINK_RESTART (BIT(30)) -#define SPI_OUTLINK_RESTART_M (BIT(30)) -#define SPI_OUTLINK_RESTART_V 0x1 -#define SPI_OUTLINK_RESTART_S 30 -/* SPI_OUTLINK_START : R/W ;bitpos:[29] ;default: 1'b0 ; */ -/*description: Set the bit to start to use outlink descriptor.*/ -#define SPI_OUTLINK_START (BIT(29)) -#define SPI_OUTLINK_START_M (BIT(29)) -#define SPI_OUTLINK_START_V 0x1 -#define SPI_OUTLINK_START_S 29 -/* SPI_OUTLINK_STOP : R/W ;bitpos:[28] ;default: 1'b0 ; */ -/*description: Set the bit to stop to use outlink descriptor.*/ -#define SPI_OUTLINK_STOP (BIT(28)) -#define SPI_OUTLINK_STOP_M (BIT(28)) -#define SPI_OUTLINK_STOP_V 0x1 -#define SPI_OUTLINK_STOP_S 28 -/* SPI_OUTLINK_ADDR : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: The address of the first outlink descriptor.*/ -#define SPI_OUTLINK_ADDR 0x000FFFFF -#define SPI_OUTLINK_ADDR_M ((SPI_OUTLINK_ADDR_V)<<(SPI_OUTLINK_ADDR_S)) -#define SPI_OUTLINK_ADDR_V 0xFFFFF -#define SPI_OUTLINK_ADDR_S 0 - -#define SPI_DMA_IN_LINK_REG(i) (REG_SPI_BASE(i) + 0x108) -/* SPI_INLINK_RESTART : R/W ;bitpos:[30] ;default: 1'b0 ; */ -/*description: Set the bit to mount on new inlink descriptors.*/ -#define SPI_INLINK_RESTART (BIT(30)) -#define SPI_INLINK_RESTART_M (BIT(30)) -#define SPI_INLINK_RESTART_V 0x1 -#define SPI_INLINK_RESTART_S 30 -/* SPI_INLINK_START : R/W ;bitpos:[29] ;default: 1'b0 ; */ -/*description: Set the bit to start to use inlink descriptor.*/ -#define SPI_INLINK_START (BIT(29)) -#define SPI_INLINK_START_M (BIT(29)) -#define SPI_INLINK_START_V 0x1 -#define SPI_INLINK_START_S 29 -/* SPI_INLINK_STOP : R/W ;bitpos:[28] ;default: 1'b0 ; */ -/*description: Set the bit to stop to use inlink descriptor.*/ -#define SPI_INLINK_STOP (BIT(28)) -#define SPI_INLINK_STOP_M (BIT(28)) -#define SPI_INLINK_STOP_V 0x1 -#define SPI_INLINK_STOP_S 28 -/* SPI_INLINK_AUTO_RET : R/W ;bitpos:[20] ;default: 1'b0 ; */ -/*description: when the bit is set inlink descriptor returns to the next descriptor - while a packet is wrong*/ -#define SPI_INLINK_AUTO_RET (BIT(20)) -#define SPI_INLINK_AUTO_RET_M (BIT(20)) -#define SPI_INLINK_AUTO_RET_V 0x1 -#define SPI_INLINK_AUTO_RET_S 20 -/* SPI_INLINK_ADDR : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: The address of the first inlink descriptor.*/ -#define SPI_INLINK_ADDR 0x000FFFFF -#define SPI_INLINK_ADDR_M ((SPI_INLINK_ADDR_V)<<(SPI_INLINK_ADDR_S)) -#define SPI_INLINK_ADDR_V 0xFFFFF -#define SPI_INLINK_ADDR_S 0 - -#define SPI_DMA_STATUS_REG(i) (REG_SPI_BASE(i) + 0x10C) -/* SPI_DMA_TX_EN : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: spi dma write data status bit.*/ -#define SPI_DMA_TX_EN (BIT(1)) -#define SPI_DMA_TX_EN_M (BIT(1)) -#define SPI_DMA_TX_EN_V 0x1 -#define SPI_DMA_TX_EN_S 1 -/* SPI_DMA_RX_EN : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: spi dma read data status bit.*/ -#define SPI_DMA_RX_EN (BIT(0)) -#define SPI_DMA_RX_EN_M (BIT(0)) -#define SPI_DMA_RX_EN_V 0x1 -#define SPI_DMA_RX_EN_S 0 - -#define SPI_DMA_INT_ENA_REG(i) (REG_SPI_BASE(i) + 0x110) -/* SPI_OUT_TOTAL_EOF_INT_ENA : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: The enable bit for sending all the packets to host done.*/ -#define SPI_OUT_TOTAL_EOF_INT_ENA (BIT(8)) -#define SPI_OUT_TOTAL_EOF_INT_ENA_M (BIT(8)) -#define SPI_OUT_TOTAL_EOF_INT_ENA_V 0x1 -#define SPI_OUT_TOTAL_EOF_INT_ENA_S 8 -/* SPI_OUT_EOF_INT_ENA : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: The enable bit for sending a packet to host done.*/ -#define SPI_OUT_EOF_INT_ENA (BIT(7)) -#define SPI_OUT_EOF_INT_ENA_M (BIT(7)) -#define SPI_OUT_EOF_INT_ENA_V 0x1 -#define SPI_OUT_EOF_INT_ENA_S 7 -/* SPI_OUT_DONE_INT_ENA : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: The enable bit for completing usage of a outlink descriptor .*/ -#define SPI_OUT_DONE_INT_ENA (BIT(6)) -#define SPI_OUT_DONE_INT_ENA_M (BIT(6)) -#define SPI_OUT_DONE_INT_ENA_V 0x1 -#define SPI_OUT_DONE_INT_ENA_S 6 -/* SPI_IN_SUC_EOF_INT_ENA : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: The enable bit for completing receiving all the packets from host.*/ -#define SPI_IN_SUC_EOF_INT_ENA (BIT(5)) -#define SPI_IN_SUC_EOF_INT_ENA_M (BIT(5)) -#define SPI_IN_SUC_EOF_INT_ENA_V 0x1 -#define SPI_IN_SUC_EOF_INT_ENA_S 5 -/* SPI_IN_ERR_EOF_INT_ENA : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: The enable bit for receiving error.*/ -#define SPI_IN_ERR_EOF_INT_ENA (BIT(4)) -#define SPI_IN_ERR_EOF_INT_ENA_M (BIT(4)) -#define SPI_IN_ERR_EOF_INT_ENA_V 0x1 -#define SPI_IN_ERR_EOF_INT_ENA_S 4 -/* SPI_IN_DONE_INT_ENA : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: The enable bit for completing usage of a inlink descriptor.*/ -#define SPI_IN_DONE_INT_ENA (BIT(3)) -#define SPI_IN_DONE_INT_ENA_M (BIT(3)) -#define SPI_IN_DONE_INT_ENA_V 0x1 -#define SPI_IN_DONE_INT_ENA_S 3 -/* SPI_INLINK_DSCR_ERROR_INT_ENA : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: The enable bit for inlink descriptor error.*/ -#define SPI_INLINK_DSCR_ERROR_INT_ENA (BIT(2)) -#define SPI_INLINK_DSCR_ERROR_INT_ENA_M (BIT(2)) -#define SPI_INLINK_DSCR_ERROR_INT_ENA_V 0x1 -#define SPI_INLINK_DSCR_ERROR_INT_ENA_S 2 -/* SPI_OUTLINK_DSCR_ERROR_INT_ENA : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: The enable bit for outlink descriptor error.*/ -#define SPI_OUTLINK_DSCR_ERROR_INT_ENA (BIT(1)) -#define SPI_OUTLINK_DSCR_ERROR_INT_ENA_M (BIT(1)) -#define SPI_OUTLINK_DSCR_ERROR_INT_ENA_V 0x1 -#define SPI_OUTLINK_DSCR_ERROR_INT_ENA_S 1 -/* SPI_INLINK_DSCR_EMPTY_INT_ENA : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: The enable bit for lack of enough inlink descriptors.*/ -#define SPI_INLINK_DSCR_EMPTY_INT_ENA (BIT(0)) -#define SPI_INLINK_DSCR_EMPTY_INT_ENA_M (BIT(0)) -#define SPI_INLINK_DSCR_EMPTY_INT_ENA_V 0x1 -#define SPI_INLINK_DSCR_EMPTY_INT_ENA_S 0 - -#define SPI_DMA_INT_RAW_REG(i) (REG_SPI_BASE(i) + 0x114) -/* SPI_OUT_TOTAL_EOF_INT_RAW : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: The raw bit for sending all the packets to host done.*/ -#define SPI_OUT_TOTAL_EOF_INT_RAW (BIT(8)) -#define SPI_OUT_TOTAL_EOF_INT_RAW_M (BIT(8)) -#define SPI_OUT_TOTAL_EOF_INT_RAW_V 0x1 -#define SPI_OUT_TOTAL_EOF_INT_RAW_S 8 -/* SPI_OUT_EOF_INT_RAW : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: The raw bit for sending a packet to host done.*/ -#define SPI_OUT_EOF_INT_RAW (BIT(7)) -#define SPI_OUT_EOF_INT_RAW_M (BIT(7)) -#define SPI_OUT_EOF_INT_RAW_V 0x1 -#define SPI_OUT_EOF_INT_RAW_S 7 -/* SPI_OUT_DONE_INT_RAW : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: The raw bit for completing usage of a outlink descriptor.*/ -#define SPI_OUT_DONE_INT_RAW (BIT(6)) -#define SPI_OUT_DONE_INT_RAW_M (BIT(6)) -#define SPI_OUT_DONE_INT_RAW_V 0x1 -#define SPI_OUT_DONE_INT_RAW_S 6 -/* SPI_IN_SUC_EOF_INT_RAW : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: The raw bit for completing receiving all the packets from host.*/ -#define SPI_IN_SUC_EOF_INT_RAW (BIT(5)) -#define SPI_IN_SUC_EOF_INT_RAW_M (BIT(5)) -#define SPI_IN_SUC_EOF_INT_RAW_V 0x1 -#define SPI_IN_SUC_EOF_INT_RAW_S 5 -/* SPI_IN_ERR_EOF_INT_RAW : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: The raw bit for receiving error.*/ -#define SPI_IN_ERR_EOF_INT_RAW (BIT(4)) -#define SPI_IN_ERR_EOF_INT_RAW_M (BIT(4)) -#define SPI_IN_ERR_EOF_INT_RAW_V 0x1 -#define SPI_IN_ERR_EOF_INT_RAW_S 4 -/* SPI_IN_DONE_INT_RAW : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: The raw bit for completing usage of a inlink descriptor.*/ -#define SPI_IN_DONE_INT_RAW (BIT(3)) -#define SPI_IN_DONE_INT_RAW_M (BIT(3)) -#define SPI_IN_DONE_INT_RAW_V 0x1 -#define SPI_IN_DONE_INT_RAW_S 3 -/* SPI_INLINK_DSCR_ERROR_INT_RAW : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: The raw bit for inlink descriptor error.*/ -#define SPI_INLINK_DSCR_ERROR_INT_RAW (BIT(2)) -#define SPI_INLINK_DSCR_ERROR_INT_RAW_M (BIT(2)) -#define SPI_INLINK_DSCR_ERROR_INT_RAW_V 0x1 -#define SPI_INLINK_DSCR_ERROR_INT_RAW_S 2 -/* SPI_OUTLINK_DSCR_ERROR_INT_RAW : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: The raw bit for outlink descriptor error.*/ -#define SPI_OUTLINK_DSCR_ERROR_INT_RAW (BIT(1)) -#define SPI_OUTLINK_DSCR_ERROR_INT_RAW_M (BIT(1)) -#define SPI_OUTLINK_DSCR_ERROR_INT_RAW_V 0x1 -#define SPI_OUTLINK_DSCR_ERROR_INT_RAW_S 1 -/* SPI_INLINK_DSCR_EMPTY_INT_RAW : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: The raw bit for lack of enough inlink descriptors.*/ -#define SPI_INLINK_DSCR_EMPTY_INT_RAW (BIT(0)) -#define SPI_INLINK_DSCR_EMPTY_INT_RAW_M (BIT(0)) -#define SPI_INLINK_DSCR_EMPTY_INT_RAW_V 0x1 -#define SPI_INLINK_DSCR_EMPTY_INT_RAW_S 0 - -#define SPI_DMA_INT_ST_REG(i) (REG_SPI_BASE(i) + 0x118) -/* SPI_OUT_TOTAL_EOF_INT_ST : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: The status bit for sending all the packets to host done.*/ -#define SPI_OUT_TOTAL_EOF_INT_ST (BIT(8)) -#define SPI_OUT_TOTAL_EOF_INT_ST_M (BIT(8)) -#define SPI_OUT_TOTAL_EOF_INT_ST_V 0x1 -#define SPI_OUT_TOTAL_EOF_INT_ST_S 8 -/* SPI_OUT_EOF_INT_ST : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: The status bit for sending a packet to host done.*/ -#define SPI_OUT_EOF_INT_ST (BIT(7)) -#define SPI_OUT_EOF_INT_ST_M (BIT(7)) -#define SPI_OUT_EOF_INT_ST_V 0x1 -#define SPI_OUT_EOF_INT_ST_S 7 -/* SPI_OUT_DONE_INT_ST : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: The status bit for completing usage of a outlink descriptor.*/ -#define SPI_OUT_DONE_INT_ST (BIT(6)) -#define SPI_OUT_DONE_INT_ST_M (BIT(6)) -#define SPI_OUT_DONE_INT_ST_V 0x1 -#define SPI_OUT_DONE_INT_ST_S 6 -/* SPI_IN_SUC_EOF_INT_ST : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: The status bit for completing receiving all the packets from host.*/ -#define SPI_IN_SUC_EOF_INT_ST (BIT(5)) -#define SPI_IN_SUC_EOF_INT_ST_M (BIT(5)) -#define SPI_IN_SUC_EOF_INT_ST_V 0x1 -#define SPI_IN_SUC_EOF_INT_ST_S 5 -/* SPI_IN_ERR_EOF_INT_ST : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: The status bit for receiving error.*/ -#define SPI_IN_ERR_EOF_INT_ST (BIT(4)) -#define SPI_IN_ERR_EOF_INT_ST_M (BIT(4)) -#define SPI_IN_ERR_EOF_INT_ST_V 0x1 -#define SPI_IN_ERR_EOF_INT_ST_S 4 -/* SPI_IN_DONE_INT_ST : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: The status bit for completing usage of a inlink descriptor.*/ -#define SPI_IN_DONE_INT_ST (BIT(3)) -#define SPI_IN_DONE_INT_ST_M (BIT(3)) -#define SPI_IN_DONE_INT_ST_V 0x1 -#define SPI_IN_DONE_INT_ST_S 3 -/* SPI_INLINK_DSCR_ERROR_INT_ST : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: The status bit for inlink descriptor error.*/ -#define SPI_INLINK_DSCR_ERROR_INT_ST (BIT(2)) -#define SPI_INLINK_DSCR_ERROR_INT_ST_M (BIT(2)) -#define SPI_INLINK_DSCR_ERROR_INT_ST_V 0x1 -#define SPI_INLINK_DSCR_ERROR_INT_ST_S 2 -/* SPI_OUTLINK_DSCR_ERROR_INT_ST : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: The status bit for outlink descriptor error.*/ -#define SPI_OUTLINK_DSCR_ERROR_INT_ST (BIT(1)) -#define SPI_OUTLINK_DSCR_ERROR_INT_ST_M (BIT(1)) -#define SPI_OUTLINK_DSCR_ERROR_INT_ST_V 0x1 -#define SPI_OUTLINK_DSCR_ERROR_INT_ST_S 1 -/* SPI_INLINK_DSCR_EMPTY_INT_ST : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: The status bit for lack of enough inlink descriptors.*/ -#define SPI_INLINK_DSCR_EMPTY_INT_ST (BIT(0)) -#define SPI_INLINK_DSCR_EMPTY_INT_ST_M (BIT(0)) -#define SPI_INLINK_DSCR_EMPTY_INT_ST_V 0x1 -#define SPI_INLINK_DSCR_EMPTY_INT_ST_S 0 - -#define SPI_DMA_INT_CLR_REG(i) (REG_SPI_BASE(i) + 0x11C) -/* SPI_OUT_TOTAL_EOF_INT_CLR : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: The clear bit for sending all the packets to host done.*/ -#define SPI_OUT_TOTAL_EOF_INT_CLR (BIT(8)) -#define SPI_OUT_TOTAL_EOF_INT_CLR_M (BIT(8)) -#define SPI_OUT_TOTAL_EOF_INT_CLR_V 0x1 -#define SPI_OUT_TOTAL_EOF_INT_CLR_S 8 -/* SPI_OUT_EOF_INT_CLR : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: The clear bit for sending a packet to host done.*/ -#define SPI_OUT_EOF_INT_CLR (BIT(7)) -#define SPI_OUT_EOF_INT_CLR_M (BIT(7)) -#define SPI_OUT_EOF_INT_CLR_V 0x1 -#define SPI_OUT_EOF_INT_CLR_S 7 -/* SPI_OUT_DONE_INT_CLR : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: The clear bit for completing usage of a outlink descriptor.*/ -#define SPI_OUT_DONE_INT_CLR (BIT(6)) -#define SPI_OUT_DONE_INT_CLR_M (BIT(6)) -#define SPI_OUT_DONE_INT_CLR_V 0x1 -#define SPI_OUT_DONE_INT_CLR_S 6 -/* SPI_IN_SUC_EOF_INT_CLR : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: The clear bit for completing receiving all the packets from host.*/ -#define SPI_IN_SUC_EOF_INT_CLR (BIT(5)) -#define SPI_IN_SUC_EOF_INT_CLR_M (BIT(5)) -#define SPI_IN_SUC_EOF_INT_CLR_V 0x1 -#define SPI_IN_SUC_EOF_INT_CLR_S 5 -/* SPI_IN_ERR_EOF_INT_CLR : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: The clear bit for receiving error.*/ -#define SPI_IN_ERR_EOF_INT_CLR (BIT(4)) -#define SPI_IN_ERR_EOF_INT_CLR_M (BIT(4)) -#define SPI_IN_ERR_EOF_INT_CLR_V 0x1 -#define SPI_IN_ERR_EOF_INT_CLR_S 4 -/* SPI_IN_DONE_INT_CLR : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: The clear bit for completing usage of a inlink descriptor.*/ -#define SPI_IN_DONE_INT_CLR (BIT(3)) -#define SPI_IN_DONE_INT_CLR_M (BIT(3)) -#define SPI_IN_DONE_INT_CLR_V 0x1 -#define SPI_IN_DONE_INT_CLR_S 3 -/* SPI_INLINK_DSCR_ERROR_INT_CLR : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: The clear bit for inlink descriptor error.*/ -#define SPI_INLINK_DSCR_ERROR_INT_CLR (BIT(2)) -#define SPI_INLINK_DSCR_ERROR_INT_CLR_M (BIT(2)) -#define SPI_INLINK_DSCR_ERROR_INT_CLR_V 0x1 -#define SPI_INLINK_DSCR_ERROR_INT_CLR_S 2 -/* SPI_OUTLINK_DSCR_ERROR_INT_CLR : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: The clear bit for outlink descriptor error.*/ -#define SPI_OUTLINK_DSCR_ERROR_INT_CLR (BIT(1)) -#define SPI_OUTLINK_DSCR_ERROR_INT_CLR_M (BIT(1)) -#define SPI_OUTLINK_DSCR_ERROR_INT_CLR_V 0x1 -#define SPI_OUTLINK_DSCR_ERROR_INT_CLR_S 1 -/* SPI_INLINK_DSCR_EMPTY_INT_CLR : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: The clear bit for lack of enough inlink descriptors.*/ -#define SPI_INLINK_DSCR_EMPTY_INT_CLR (BIT(0)) -#define SPI_INLINK_DSCR_EMPTY_INT_CLR_M (BIT(0)) -#define SPI_INLINK_DSCR_EMPTY_INT_CLR_V 0x1 -#define SPI_INLINK_DSCR_EMPTY_INT_CLR_S 0 - -#define SPI_IN_ERR_EOF_DES_ADDR_REG(i) (REG_SPI_BASE(i) + 0x120) -/* SPI_DMA_IN_ERR_EOF_DES_ADDR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: The inlink descriptor address when spi dma produce receiving error.*/ -#define SPI_DMA_IN_ERR_EOF_DES_ADDR 0xFFFFFFFF -#define SPI_DMA_IN_ERR_EOF_DES_ADDR_M ((SPI_DMA_IN_ERR_EOF_DES_ADDR_V)<<(SPI_DMA_IN_ERR_EOF_DES_ADDR_S)) -#define SPI_DMA_IN_ERR_EOF_DES_ADDR_V 0xFFFFFFFF -#define SPI_DMA_IN_ERR_EOF_DES_ADDR_S 0 - -#define SPI_IN_SUC_EOF_DES_ADDR_REG(i) (REG_SPI_BASE(i) + 0x124) -/* SPI_DMA_IN_SUC_EOF_DES_ADDR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: The last inlink descriptor address when spi dma produce from_suc_eof.*/ -#define SPI_DMA_IN_SUC_EOF_DES_ADDR 0xFFFFFFFF -#define SPI_DMA_IN_SUC_EOF_DES_ADDR_M ((SPI_DMA_IN_SUC_EOF_DES_ADDR_V)<<(SPI_DMA_IN_SUC_EOF_DES_ADDR_S)) -#define SPI_DMA_IN_SUC_EOF_DES_ADDR_V 0xFFFFFFFF -#define SPI_DMA_IN_SUC_EOF_DES_ADDR_S 0 - -#define SPI_INLINK_DSCR_REG(i) (REG_SPI_BASE(i) + 0x128) -/* SPI_DMA_INLINK_DSCR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: The content of current in descriptor pointer.*/ -#define SPI_DMA_INLINK_DSCR 0xFFFFFFFF -#define SPI_DMA_INLINK_DSCR_M ((SPI_DMA_INLINK_DSCR_V)<<(SPI_DMA_INLINK_DSCR_S)) -#define SPI_DMA_INLINK_DSCR_V 0xFFFFFFFF -#define SPI_DMA_INLINK_DSCR_S 0 - -#define SPI_INLINK_DSCR_BF0_REG(i) (REG_SPI_BASE(i) + 0x12C) -/* SPI_DMA_INLINK_DSCR_BF0 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: The content of next in descriptor pointer.*/ -#define SPI_DMA_INLINK_DSCR_BF0 0xFFFFFFFF -#define SPI_DMA_INLINK_DSCR_BF0_M ((SPI_DMA_INLINK_DSCR_BF0_V)<<(SPI_DMA_INLINK_DSCR_BF0_S)) -#define SPI_DMA_INLINK_DSCR_BF0_V 0xFFFFFFFF -#define SPI_DMA_INLINK_DSCR_BF0_S 0 - -#define SPI_INLINK_DSCR_BF1_REG(i) (REG_SPI_BASE(i) + 0x130) -/* SPI_DMA_INLINK_DSCR_BF1 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: The content of current in descriptor data buffer pointer.*/ -#define SPI_DMA_INLINK_DSCR_BF1 0xFFFFFFFF -#define SPI_DMA_INLINK_DSCR_BF1_M ((SPI_DMA_INLINK_DSCR_BF1_V)<<(SPI_DMA_INLINK_DSCR_BF1_S)) -#define SPI_DMA_INLINK_DSCR_BF1_V 0xFFFFFFFF -#define SPI_DMA_INLINK_DSCR_BF1_S 0 - -#define SPI_OUT_EOF_BFR_DES_ADDR_REG(i) (REG_SPI_BASE(i) + 0x134) -/* SPI_DMA_OUT_EOF_BFR_DES_ADDR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: The address of buffer relative to the outlink descriptor that produce eof.*/ -#define SPI_DMA_OUT_EOF_BFR_DES_ADDR 0xFFFFFFFF -#define SPI_DMA_OUT_EOF_BFR_DES_ADDR_M ((SPI_DMA_OUT_EOF_BFR_DES_ADDR_V)<<(SPI_DMA_OUT_EOF_BFR_DES_ADDR_S)) -#define SPI_DMA_OUT_EOF_BFR_DES_ADDR_V 0xFFFFFFFF -#define SPI_DMA_OUT_EOF_BFR_DES_ADDR_S 0 - -#define SPI_OUT_EOF_DES_ADDR_REG(i) (REG_SPI_BASE(i) + 0x138) -/* SPI_DMA_OUT_EOF_DES_ADDR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: The last outlink descriptor address when spi dma produce to_eof.*/ -#define SPI_DMA_OUT_EOF_DES_ADDR 0xFFFFFFFF -#define SPI_DMA_OUT_EOF_DES_ADDR_M ((SPI_DMA_OUT_EOF_DES_ADDR_V)<<(SPI_DMA_OUT_EOF_DES_ADDR_S)) -#define SPI_DMA_OUT_EOF_DES_ADDR_V 0xFFFFFFFF -#define SPI_DMA_OUT_EOF_DES_ADDR_S 0 - -#define SPI_OUTLINK_DSCR_REG(i) (REG_SPI_BASE(i) + 0x13C) -/* SPI_DMA_OUTLINK_DSCR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: The content of current out descriptor pointer.*/ -#define SPI_DMA_OUTLINK_DSCR 0xFFFFFFFF -#define SPI_DMA_OUTLINK_DSCR_M ((SPI_DMA_OUTLINK_DSCR_V)<<(SPI_DMA_OUTLINK_DSCR_S)) -#define SPI_DMA_OUTLINK_DSCR_V 0xFFFFFFFF -#define SPI_DMA_OUTLINK_DSCR_S 0 - -#define SPI_OUTLINK_DSCR_BF0_REG(i) (REG_SPI_BASE(i) + 0x140) -/* SPI_DMA_OUTLINK_DSCR_BF0 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: The content of next out descriptor pointer.*/ -#define SPI_DMA_OUTLINK_DSCR_BF0 0xFFFFFFFF -#define SPI_DMA_OUTLINK_DSCR_BF0_M ((SPI_DMA_OUTLINK_DSCR_BF0_V)<<(SPI_DMA_OUTLINK_DSCR_BF0_S)) -#define SPI_DMA_OUTLINK_DSCR_BF0_V 0xFFFFFFFF -#define SPI_DMA_OUTLINK_DSCR_BF0_S 0 - -#define SPI_OUTLINK_DSCR_BF1_REG(i) (REG_SPI_BASE(i) + 0x144) -/* SPI_DMA_OUTLINK_DSCR_BF1 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: The content of current out descriptor data buffer pointer.*/ -#define SPI_DMA_OUTLINK_DSCR_BF1 0xFFFFFFFF -#define SPI_DMA_OUTLINK_DSCR_BF1_M ((SPI_DMA_OUTLINK_DSCR_BF1_V)<<(SPI_DMA_OUTLINK_DSCR_BF1_S)) -#define SPI_DMA_OUTLINK_DSCR_BF1_V 0xFFFFFFFF -#define SPI_DMA_OUTLINK_DSCR_BF1_S 0 - -#define SPI_DMA_RSTATUS_REG(i) (REG_SPI_BASE(i) + 0x148) -/* SPI_DMA_OUT_STATUS : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: spi dma read data from memory status.*/ -#define SPI_DMA_OUT_STATUS 0xFFFFFFFF -#define SPI_DMA_OUT_STATUS_M ((SPI_DMA_OUT_STATUS_V)<<(SPI_DMA_OUT_STATUS_S)) -#define SPI_DMA_OUT_STATUS_V 0xFFFFFFFF -#define SPI_DMA_OUT_STATUS_S 0 - -#define SPI_DMA_TSTATUS_REG(i) (REG_SPI_BASE(i) + 0x14C) -/* SPI_DMA_IN_STATUS : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: spi dma write data to memory status.*/ -#define SPI_DMA_IN_STATUS 0xFFFFFFFF -#define SPI_DMA_IN_STATUS_M ((SPI_DMA_IN_STATUS_V)<<(SPI_DMA_IN_STATUS_S)) -#define SPI_DMA_IN_STATUS_V 0xFFFFFFFF -#define SPI_DMA_IN_STATUS_S 0 - -#define SPI_DATE_REG(i) (REG_SPI_BASE(i) + 0x3FC) -/* SPI_DATE : RO ;bitpos:[27:0] ;default: 32'h1604270 ; */ -/*description: SPI register version.*/ -#define SPI_DATE 0x0FFFFFFF -#define SPI_DATE_M ((SPI_DATE_V)<<(SPI_DATE_S)) -#define SPI_DATE_V 0xFFFFFFF -#define SPI_DATE_S 0 - - - - -#endif /*__SPI_REG_H__ */ - - diff --git a/tools/sdk/include/soc/soc/spi_struct.h b/tools/sdk/include/soc/soc/spi_struct.h deleted file mode 100644 index a52ddf41050..00000000000 --- a/tools/sdk/include/soc/soc/spi_struct.h +++ /dev/null @@ -1,686 +0,0 @@ -// 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. -#ifndef _SOC_SPI_STRUCT_H_ -#define _SOC_SPI_STRUCT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef volatile struct { - union { - struct { - uint32_t reserved0: 16; /*reserved*/ - uint32_t flash_per: 1; /*program erase resume bit program erase suspend operation will be triggered when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ - uint32_t flash_pes: 1; /*program erase suspend bit program erase suspend operation will be triggered when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ - uint32_t usr: 1; /*User define command enable. An operation will be triggered when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ - uint32_t flash_hpm: 1; /*Drive Flash into high performance mode. The bit will be cleared once the operation done.1: enable 0: disable.*/ - uint32_t flash_res: 1; /*This bit combined with reg_resandres bit releases Flash from the power-down state or high performance mode and obtains the devices ID. The bit will be cleared once the operation done.1: enable 0: disable.*/ - uint32_t flash_dp: 1; /*Drive Flash into power down. An operation will be triggered when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ - uint32_t flash_ce: 1; /*Chip erase enable. Chip erase operation will be triggered when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ - uint32_t flash_be: 1; /*Block erase enable(32KB) . Block erase operation will be triggered when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ - uint32_t flash_se: 1; /*Sector erase enable(4KB). Sector erase operation will be triggered when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ - uint32_t flash_pp: 1; /*Page program enable(1 byte ~256 bytes data to be programmed). Page program operation will be triggered when the bit is set. The bit will be cleared once the operation done .1: enable 0: disable.*/ - uint32_t flash_wrsr: 1; /*Write status register enable. Write status operation will be triggered when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ - uint32_t flash_rdsr: 1; /*Read status register-1. Read status operation will be triggered when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ - uint32_t flash_rdid: 1; /*Read JEDEC ID . Read ID command will be sent when the bit is set. The bit will be cleared once the operation done. 1: enable 0: disable.*/ - uint32_t flash_wrdi: 1; /*Write flash disable. Write disable command will be sent when the bit is set. The bit will be cleared once the operation done. 1: enable 0: disable.*/ - uint32_t flash_wren: 1; /*Write flash enable. Write enable command will be sent when the bit is set. The bit will be cleared once the operation done. 1: enable 0: disable.*/ - uint32_t flash_read: 1; /*Read flash enable. Read flash operation will be triggered when the bit is set. The bit will be cleared once the operation done. 1: enable 0: disable.*/ - }; - uint32_t val; - } cmd; - uint32_t addr; /*addr to slave / from master. SPI transfer from the MSB to the LSB. If length > 32 bits, then address continues from MSB of slv_wr_status.*/ - union { - struct { - uint32_t reserved0: 10; /*reserved*/ - uint32_t fcs_crc_en: 1; /*For SPI1 initialize crc32 module before writing encrypted data to flash. Active low.*/ - uint32_t tx_crc_en: 1; /*For SPI1 enable crc32 when writing encrypted data to flash. 1: enable 0:disable*/ - uint32_t wait_flash_idle_en: 1; /*wait flash idle when program flash or erase flash. 1: enable 0: disable.*/ - uint32_t fastrd_mode: 1; /*This bit enable the bits: spi_fread_qio spi_fread_dio spi_fread_qout and spi_fread_dout. 1: enable 0: disable.*/ - uint32_t fread_dual: 1; /*In the read operations read-data phase apply 2 signals. 1: enable 0: disable.*/ - uint32_t resandres: 1; /*The Device ID is read out to SPI_RD_STATUS register, this bit combine with spi_flash_res bit. 1: enable 0: disable.*/ - uint32_t reserved16: 4; /*reserved*/ - uint32_t fread_quad: 1; /*In the read operations read-data phase apply 4 signals. 1: enable 0: disable.*/ - uint32_t wp: 1; /*Write protect signal output when SPI is idle. 1: output high 0: output low.*/ - uint32_t wrsr_2b: 1; /*two bytes data will be written to status register when it is set. 1: enable 0: disable.*/ - uint32_t fread_dio: 1; /*In the read operations address phase and read-data phase apply 2 signals. 1: enable 0: disable.*/ - uint32_t fread_qio: 1; /*In the read operations address phase and read-data phase apply 4 signals. 1: enable 0: disable.*/ - uint32_t rd_bit_order: 1; /*In read-data (MISO) phase 1: LSB first 0: MSB first*/ - uint32_t wr_bit_order: 1; /*In command address write-data (MOSI) phases 1: LSB firs 0: MSB first*/ - uint32_t reserved27: 5; /*reserved*/ - }; - uint32_t val; - } ctrl; - union { - struct { - uint32_t reserved0: 16; /*reserved*/ - uint32_t cs_hold_delay_res:12; /*Delay cycles of resume Flash when resume Flash is enable by spi clock.*/ - uint32_t cs_hold_delay: 4; /*SPI cs signal is delayed by spi clock cycles*/ - }; - uint32_t val; - } ctrl1; - union { - struct { - uint32_t status: 16; /*In the slave mode, it is the status for master to read out.*/ - uint32_t wb_mode: 8; /*Mode bits in the flash fast read mode, it is combined with spi_fastrd_mode bit.*/ - uint32_t status_ext: 8; /*In the slave mode,it is the status for master to read out.*/ - }; - uint32_t val; - } rd_status; - union { - struct { - uint32_t setup_time: 4; /*(cycles-1) of ,prepare, phase by spi clock, this bits combined with spi_cs_setup bit.*/ - uint32_t hold_time: 4; /*delay cycles of cs pin by spi clock, this bits combined with spi_cs_hold bit.*/ - uint32_t ck_out_low_mode: 4; /*modify spi clock duty ratio when the value is lager than 8, the bits are combined with spi_clkcnt_N bits and spi_clkcnt_L bits.*/ - uint32_t ck_out_high_mode: 4; /*modify spi clock duty ratio when the value is lager than 8, the bits are combined with spi_clkcnt_N bits and spi_clkcnt_H bits.*/ - uint32_t miso_delay_mode: 2; /*MISO signals are delayed by spi_clk. 0: zero 1: if spi_ck_out_edge or spi_ck_i_edge is set 1 delayed by half cycle else delayed by one cycle 2: if spi_ck_out_edge or spi_ck_i_edge is set 1 delayed by one cycle else delayed by half cycle 3: delayed one cycle*/ - uint32_t miso_delay_num: 3; /*MISO signals are delayed by system clock cycles*/ - uint32_t mosi_delay_mode: 2; /*MOSI signals are delayed by spi_clk. 0: zero 1: if spi_ck_out_edge or spi_ck_i_edge is set 1 delayed by half cycle else delayed by one cycle 2: if spi_ck_out_edge or spi_ck_i_edge is set 1 delayed by one cycle else delayed by half cycle 3: delayed one cycle*/ - uint32_t mosi_delay_num: 3; /*MOSI signals are delayed by system clock cycles*/ - uint32_t cs_delay_mode: 2; /*spi_cs signal is delayed by spi_clk . 0: zero 1: if spi_ck_out_edge or spi_ck_i_edge is set 1 delayed by half cycle else delayed by one cycle 2: if spi_ck_out_edge or spi_ck_i_edge is set 1 delayed by one cycle else delayed by half cycle 3: delayed one cycle*/ - uint32_t cs_delay_num: 4; /*spi_cs signal is delayed by system clock cycles*/ - }; - uint32_t val; - } ctrl2; - union { - struct { - uint32_t clkcnt_l: 6; /*In the master mode it must be equal to spi_clkcnt_N. In the slave mode it must be 0.*/ - uint32_t clkcnt_h: 6; /*In the master mode it must be floor((spi_clkcnt_N+1)/2-1). In the slave mode it must be 0.*/ - uint32_t clkcnt_n: 6; /*In the master mode it is the divider of spi_clk. So spi_clk frequency is system/(spi_clkdiv_pre+1)/(spi_clkcnt_N+1)*/ - uint32_t clkdiv_pre: 13; /*In the master mode it is pre-divider of spi_clk.*/ - uint32_t clk_equ_sysclk: 1; /*In the master mode 1: spi_clk is eqaul to system 0: spi_clk is divided from system clock.*/ - }; - uint32_t val; - } clock; - union { - struct { - uint32_t doutdin: 1; /*Set the bit to enable full duplex communication. 1: enable 0: disable.*/ - uint32_t reserved1: 3; /*reserved*/ - uint32_t cs_hold: 1; /*spi cs keep low when spi is in ,done, phase. 1: enable 0: disable.*/ - uint32_t cs_setup: 1; /*spi cs is enable when spi is in ,prepare, phase. 1: enable 0: disable.*/ - uint32_t ck_i_edge: 1; /*In the slave mode the bit is same as spi_ck_out_edge in master mode. It is combined with spi_miso_delay_mode bits.*/ - uint32_t ck_out_edge: 1; /*the bit combined with spi_mosi_delay_mode bits to set mosi signal delay mode.*/ - uint32_t reserved8: 2; /*reserved*/ - uint32_t rd_byte_order: 1; /*In read-data (MISO) phase 1: big-endian 0: little_endian*/ - uint32_t wr_byte_order: 1; /*In command address write-data (MOSI) phases 1: big-endian 0: litte_endian*/ - uint32_t fwrite_dual: 1; /*In the write operations read-data phase apply 2 signals*/ - uint32_t fwrite_quad: 1; /*In the write operations read-data phase apply 4 signals*/ - uint32_t fwrite_dio: 1; /*In the write operations address phase and read-data phase apply 2 signals.*/ - uint32_t fwrite_qio: 1; /*In the write operations address phase and read-data phase apply 4 signals.*/ - uint32_t sio: 1; /*Set the bit to enable 3-line half duplex communication mosi and miso signals share the same pin. 1: enable 0: disable.*/ - uint32_t usr_hold_pol: 1; /*It is combined with hold bits to set the polarity of spi hold line 1: spi will be held when spi hold line is high 0: spi will be held when spi hold line is low*/ - uint32_t usr_dout_hold: 1; /*spi is hold at data out state the bit combined with spi_usr_hold_pol bit.*/ - uint32_t usr_din_hold: 1; /*spi is hold at data in state the bit combined with spi_usr_hold_pol bit.*/ - uint32_t usr_dummy_hold: 1; /*spi is hold at dummy state the bit combined with spi_usr_hold_pol bit.*/ - uint32_t usr_addr_hold: 1; /*spi is hold at address state the bit combined with spi_usr_hold_pol bit.*/ - uint32_t usr_cmd_hold: 1; /*spi is hold at command state the bit combined with spi_usr_hold_pol bit.*/ - uint32_t usr_prep_hold: 1; /*spi is hold at prepare state the bit combined with spi_usr_hold_pol bit.*/ - uint32_t usr_miso_highpart: 1; /*read-data phase only access to high-part of the buffer spi_w8~spi_w15. 1: enable 0: disable.*/ - uint32_t usr_mosi_highpart: 1; /*write-data phase only access to high-part of the buffer spi_w8~spi_w15. 1: enable 0: disable.*/ - uint32_t usr_dummy_idle: 1; /*spi clock is disable in dummy phase when the bit is enable.*/ - uint32_t usr_mosi: 1; /*This bit enable the write-data phase of an operation.*/ - uint32_t usr_miso: 1; /*This bit enable the read-data phase of an operation.*/ - uint32_t usr_dummy: 1; /*This bit enable the dummy phase of an operation.*/ - uint32_t usr_addr: 1; /*This bit enable the address phase of an operation.*/ - uint32_t usr_command: 1; /*This bit enable the command phase of an operation.*/ - }; - uint32_t val; - } user; - union { - struct { - uint32_t usr_dummy_cyclelen: 8; /*The length in spi_clk cycles of dummy phase. The register value shall be (cycle_num-1).*/ - uint32_t reserved8: 18; /*reserved*/ - uint32_t usr_addr_bitlen: 6; /*The length in bits of address phase. The register value shall be (bit_num-1).*/ - }; - uint32_t val; - } user1; - union { - struct { - uint32_t usr_command_value: 16; /*The value of command. Output sequence: bit 7-0 and then 15-8.*/ - uint32_t reserved16: 12; /*reserved*/ - uint32_t usr_command_bitlen: 4; /*The length in bits of command phase. The register value shall be (bit_num-1)*/ - }; - uint32_t val; - } user2; - union { - struct { - uint32_t usr_mosi_dbitlen:24; /*The length in bits of write-data. The register value shall be (bit_num-1).*/ - uint32_t reserved24: 8; /*reserved*/ - }; - uint32_t val; - } mosi_dlen; - union { - struct { - uint32_t usr_miso_dbitlen:24; /*The length in bits of read-data. The register value shall be (bit_num-1).*/ - uint32_t reserved24: 8; /*reserved*/ - }; - uint32_t val; - } miso_dlen; - uint32_t slv_wr_status; /*In the slave mode this register are the status register for the master to write into. In the master mode this register are the higher 32bits in the 64 bits address condition.*/ - union { - struct { - uint32_t cs0_dis: 1; /*SPI CS0 pin enable, 1: disable CS0, 0: spi_cs0 signal is from/to CS0 pin*/ - uint32_t cs1_dis: 1; /*SPI CS1 pin enable, 1: disable CS1, 0: spi_cs1 signal is from/to CS1 pin*/ - uint32_t cs2_dis: 1; /*SPI CS2 pin enable, 1: disable CS2, 0: spi_cs2 signal is from/to CS2 pin*/ - uint32_t reserved3: 2; /*reserved*/ - uint32_t ck_dis: 1; /*1: spi clk out disable 0: spi clk out enable*/ - uint32_t master_cs_pol: 3; /*In the master mode the bits are the polarity of spi cs line the value is equivalent to spi_cs ^ spi_master_cs_pol.*/ - uint32_t reserved9: 2; /*reserved*/ - uint32_t master_ck_sel: 3; /*In the master mode spi cs line is enable as spi clk it is combined with spi_cs0_dis spi_cs1_dis spi_cs2_dis.*/ - uint32_t reserved14: 15; /*reserved*/ - uint32_t ck_idle_edge: 1; /*1: spi clk line is high when idle 0: spi clk line is low when idle*/ - uint32_t cs_keep_active: 1; /*spi cs line keep low when the bit is set.*/ - uint32_t reserved31: 1; /*reserved*/ - }; - uint32_t val; - } pin; - union { - struct { - uint32_t rd_buf_done: 1; /*The interrupt raw bit for the completion of read-buffer operation in the slave mode.*/ - uint32_t wr_buf_done: 1; /*The interrupt raw bit for the completion of write-buffer operation in the slave mode.*/ - uint32_t rd_sta_done: 1; /*The interrupt raw bit for the completion of read-status operation in the slave mode.*/ - uint32_t wr_sta_done: 1; /*The interrupt raw bit for the completion of write-status operation in the slave mode.*/ - uint32_t trans_done: 1; /*The interrupt raw bit for the completion of any operation in both the master mode and the slave mode.*/ - uint32_t rd_buf_inten: 1; /*The interrupt enable bit for the completion of read-buffer operation in the slave mode.*/ - uint32_t wr_buf_inten: 1; /*The interrupt enable bit for the completion of write-buffer operation in the slave mode.*/ - uint32_t rd_sta_inten: 1; /*The interrupt enable bit for the completion of read-status operation in the slave mode.*/ - uint32_t wr_sta_inten: 1; /*The interrupt enable bit for the completion of write-status operation in the slave mode.*/ - uint32_t trans_inten: 1; /*The interrupt enable bit for the completion of any operation in both the master mode and the slave mode.*/ - uint32_t cs_i_mode: 2; /*In the slave mode this bits used to synchronize the input spi cs signal and eliminate spi cs jitter.*/ - uint32_t reserved12: 5; /*reserved*/ - uint32_t last_command: 3; /*In the slave mode it is the value of command.*/ - uint32_t last_state: 3; /*In the slave mode it is the state of spi state machine.*/ - uint32_t trans_cnt: 4; /*The operations counter in both the master mode and the slave mode. 4: read-status*/ - uint32_t cmd_define: 1; /*1: slave mode commands are defined in SPI_SLAVE3. 0: slave mode commands are fixed as: 1: write-status 2: write-buffer and 3: read-buffer.*/ - uint32_t wr_rd_sta_en: 1; /*write and read status enable in the slave mode*/ - uint32_t wr_rd_buf_en: 1; /*write and read buffer enable in the slave mode*/ - uint32_t slave_mode: 1; /*1: slave mode 0: master mode.*/ - uint32_t sync_reset: 1; /*Software reset enable, reset the spi clock line cs line and data lines.*/ - }; - uint32_t val; - } slave; - union { - struct { - uint32_t rdbuf_dummy_en: 1; /*In the slave mode it is the enable bit of dummy phase for read-buffer operations.*/ - uint32_t wrbuf_dummy_en: 1; /*In the slave mode it is the enable bit of dummy phase for write-buffer operations.*/ - uint32_t rdsta_dummy_en: 1; /*In the slave mode it is the enable bit of dummy phase for read-status operations.*/ - uint32_t wrsta_dummy_en: 1; /*In the slave mode it is the enable bit of dummy phase for write-status operations.*/ - uint32_t wr_addr_bitlen: 6; /*In the slave mode it is the address length in bits for write-buffer operation. The register value shall be (bit_num-1).*/ - uint32_t rd_addr_bitlen: 6; /*In the slave mode it is the address length in bits for read-buffer operation. The register value shall be (bit_num-1).*/ - uint32_t reserved16: 9; /*reserved*/ - uint32_t status_readback: 1; /*In the slave mode 1:read register of SPI_SLV_WR_STATUS 0: read register of SPI_RD_STATUS.*/ - uint32_t status_fast_en: 1; /*In the slave mode enable fast read status.*/ - uint32_t status_bitlen: 5; /*In the slave mode it is the length of status bit.*/ - }; - uint32_t val; - } slave1; - union { - struct { - uint32_t rdsta_dummy_cyclelen: 8; /*In the slave mode it is the length in spi_clk cycles of dummy phase for read-status operations. The register value shall be (cycle_num-1).*/ - uint32_t wrsta_dummy_cyclelen: 8; /*In the slave mode it is the length in spi_clk cycles of dummy phase for write-status operations. The register value shall be (cycle_num-1).*/ - uint32_t rdbuf_dummy_cyclelen: 8; /*In the slave mode it is the length in spi_clk cycles of dummy phase for read-buffer operations. The register value shall be (cycle_num-1).*/ - uint32_t wrbuf_dummy_cyclelen: 8; /*In the slave mode it is the length in spi_clk cycles of dummy phase for write-buffer operations. The register value shall be (cycle_num-1).*/ - }; - uint32_t val; - } slave2; - union { - struct { - uint32_t rdbuf_cmd_value: 8; /*In the slave mode it is the value of read-buffer command.*/ - uint32_t wrbuf_cmd_value: 8; /*In the slave mode it is the value of write-buffer command.*/ - uint32_t rdsta_cmd_value: 8; /*In the slave mode it is the value of read-status command.*/ - uint32_t wrsta_cmd_value: 8; /*In the slave mode it is the value of write-status command.*/ - }; - uint32_t val; - } slave3; - union { - struct { - uint32_t bit_len: 24; /*In the slave mode it is the length in bits for write-buffer operations. The register value shall be (bit_num-1).*/ - uint32_t reserved24: 8; /*reserved*/ - }; - uint32_t val; - } slv_wrbuf_dlen; - union { - struct { - uint32_t bit_len: 24; /*In the slave mode it is the length in bits for read-buffer operations. The register value shall be (bit_num-1).*/ - uint32_t reserved24: 8; /*reserved*/ - }; - uint32_t val; - } slv_rdbuf_dlen; - union { - struct { - uint32_t req_en: 1; /*For SPI0 Cache access enable 1: enable 0:disable.*/ - uint32_t usr_cmd_4byte: 1; /*For SPI0 cache read flash with 4 bytes command 1: enable 0:disable.*/ - uint32_t flash_usr_cmd: 1; /*For SPI0 cache read flash for user define command 1: enable 0:disable.*/ - uint32_t flash_pes_en: 1; /*For SPI0 spi1 send suspend command before cache read flash 1: enable 0:disable.*/ - uint32_t reserved4: 28; /*reserved*/ - }; - uint32_t val; - } cache_fctrl; - union { - struct { - uint32_t reserved0: 1; /*reserved*/ - uint32_t usr_sram_dio: 1; /*For SPI0 In the spi sram mode spi dual I/O mode enable 1: enable 0:disable*/ - uint32_t usr_sram_qio: 1; /*For SPI0 In the spi sram mode spi quad I/O mode enable 1: enable 0:disable*/ - uint32_t usr_wr_sram_dummy: 1; /*For SPI0 In the spi sram mode it is the enable bit of dummy phase for write operations.*/ - uint32_t usr_rd_sram_dummy: 1; /*For SPI0 In the spi sram mode it is the enable bit of dummy phase for read operations.*/ - uint32_t cache_sram_usr_rcmd: 1; /*For SPI0 In the spi sram mode cache read sram for user define command.*/ - uint32_t sram_bytes_len: 8; /*For SPI0 In the sram mode it is the byte length of spi read sram data.*/ - uint32_t sram_dummy_cyclelen: 8; /*For SPI0 In the sram mode it is the length in bits of address phase. The register value shall be (bit_num-1).*/ - uint32_t sram_addr_bitlen: 6; /*For SPI0 In the sram mode it is the length in bits of address phase. The register value shall be (bit_num-1).*/ - uint32_t cache_sram_usr_wcmd: 1; /*For SPI0 In the spi sram mode cache write sram for user define command*/ - uint32_t reserved29: 3; /*reserved*/ - }; - uint32_t val; - } cache_sctrl; - union { - struct { - uint32_t dio: 1; /*For SPI0 SRAM DIO mode enable . SRAM DIO enable command will be send when the bit is set. The bit will be cleared once the operation done.*/ - uint32_t qio: 1; /*For SPI0 SRAM QIO mode enable . SRAM QIO enable command will be send when the bit is set. The bit will be cleared once the operation done.*/ - uint32_t reserved2: 2; /*For SPI0 SRAM write enable . SRAM write operation will be triggered when the bit is set. The bit will be cleared once the operation done.*/ - uint32_t rst_io: 1; /*For SPI0 SRAM IO mode reset enable. SRAM IO mode reset operation will be triggered when the bit is set. The bit will be cleared once the operation done*/ - uint32_t reserved5:27; /*reserved*/ - }; - uint32_t val; - } sram_cmd; - union { - struct { - uint32_t usr_rd_cmd_value: 16; /*For SPI0 When cache mode is enable it is the read command value of command phase for SRAM.*/ - uint32_t reserved16: 12; /*reserved*/ - uint32_t usr_rd_cmd_bitlen: 4; /*For SPI0 When cache mode is enable it is the length in bits of command phase for SRAM. The register value shall be (bit_num-1).*/ - }; - uint32_t val; - } sram_drd_cmd; - union { - struct { - uint32_t usr_wr_cmd_value: 16; /*For SPI0 When cache mode is enable it is the write command value of command phase for SRAM.*/ - uint32_t reserved16: 12; /*reserved*/ - uint32_t usr_wr_cmd_bitlen: 4; /*For SPI0 When cache mode is enable it is the in bits of command phase for SRAM. The register value shall be (bit_num-1).*/ - }; - uint32_t val; - } sram_dwr_cmd; - union { - struct { - uint32_t slv_rdata_bit:24; /*In the slave mode it is the bit length of read data. The value is the length - 1.*/ - uint32_t reserved24: 8; /*reserved*/ - }; - uint32_t val; - } slv_rd_bit; - uint32_t reserved_68; - uint32_t reserved_6c; - uint32_t reserved_70; - uint32_t reserved_74; - uint32_t reserved_78; - uint32_t reserved_7c; - uint32_t data_buf[16]; /*data buffer*/ - uint32_t tx_crc; /*For SPI1 the value of crc32 for 256 bits data.*/ - uint32_t reserved_c4; - uint32_t reserved_c8; - uint32_t reserved_cc; - uint32_t reserved_d0; - uint32_t reserved_d4; - uint32_t reserved_d8; - uint32_t reserved_dc; - uint32_t reserved_e0; - uint32_t reserved_e4; - uint32_t reserved_e8; - uint32_t reserved_ec; - union { - struct { - uint32_t t_pp_time: 12; /*page program delay time by system clock.*/ - uint32_t reserved12: 4; /*reserved*/ - uint32_t t_pp_shift: 4; /*page program delay time shift .*/ - uint32_t reserved20:11; /*reserved*/ - uint32_t t_pp_ena: 1; /*page program delay enable.*/ - }; - uint32_t val; - } ext0; - union { - struct { - uint32_t t_erase_time: 12; /*erase flash delay time by system clock.*/ - uint32_t reserved12: 4; /*reserved*/ - uint32_t t_erase_shift: 4; /*erase flash delay time shift.*/ - uint32_t reserved20: 11; /*reserved*/ - uint32_t t_erase_ena: 1; /*erase flash delay enable.*/ - }; - uint32_t val; - } ext1; - union { - struct { - uint32_t st: 3; /*The status of spi state machine .*/ - uint32_t reserved3: 29; /*reserved*/ - }; - uint32_t val; - } ext2; - union { - struct { - uint32_t int_hold_ena: 2; /*This register is for two SPI masters to share the same cs clock and data signals. The bits of one SPI are set if the other SPI is busy the SPI will be hold. 1(3): hold at ,idle, phase 2: hold at ,prepare, phase.*/ - uint32_t reserved2: 30; /*reserved*/ - }; - uint32_t val; - } ext3; - union { - struct { - uint32_t reserved0: 2; /*reserved*/ - uint32_t in_rst: 1; /*The bit is used to reset in dma fsm and in data fifo pointer.*/ - uint32_t out_rst: 1; /*The bit is used to reset out dma fsm and out data fifo pointer.*/ - uint32_t ahbm_fifo_rst: 1; /*reset spi dma ahb master fifo pointer.*/ - uint32_t ahbm_rst: 1; /*reset spi dma ahb master.*/ - uint32_t in_loop_test: 1; /*Set bit to test in link.*/ - uint32_t out_loop_test: 1; /*Set bit to test out link.*/ - uint32_t out_auto_wrback: 1; /*when the link is empty jump to next automatically.*/ - uint32_t out_eof_mode: 1; /*out eof flag generation mode . 1: when dma pop all data from fifo 0:when ahb push all data to fifo.*/ - uint32_t outdscr_burst_en: 1; /*read descriptor use burst mode when read data for memory.*/ - uint32_t indscr_burst_en: 1; /*read descriptor use burst mode when write data to memory.*/ - uint32_t out_data_burst_en: 1; /*spi dma read data from memory in burst mode.*/ - uint32_t reserved13: 1; /*reserved*/ - uint32_t dma_rx_stop: 1; /*spi dma read data stop when in continue tx/rx mode.*/ - uint32_t dma_tx_stop: 1; /*spi dma write data stop when in continue tx/rx mode.*/ - uint32_t dma_continue: 1; /*spi dma continue tx/rx data.*/ - uint32_t reserved17: 15; /*reserved*/ - }; - uint32_t val; - } dma_conf; - union { - struct { - uint32_t addr: 20; /*The address of the first outlink descriptor.*/ - uint32_t reserved20: 8; /*reserved*/ - uint32_t stop: 1; /*Set the bit to stop to use outlink descriptor.*/ - uint32_t start: 1; /*Set the bit to start to use outlink descriptor.*/ - uint32_t restart: 1; /*Set the bit to mount on new outlink descriptors.*/ - uint32_t reserved31: 1; /*reserved*/ - }; - uint32_t val; - } dma_out_link; - union { - struct { - uint32_t addr: 20; /*The address of the first inlink descriptor.*/ - uint32_t auto_ret: 1; /*when the bit is set inlink descriptor returns to the next descriptor while a packet is wrong*/ - uint32_t reserved21: 7; /*reserved*/ - uint32_t stop: 1; /*Set the bit to stop to use inlink descriptor.*/ - uint32_t start: 1; /*Set the bit to start to use inlink descriptor.*/ - uint32_t restart: 1; /*Set the bit to mount on new inlink descriptors.*/ - uint32_t reserved31: 1; /*reserved*/ - }; - uint32_t val; - } dma_in_link; - union { - struct { - uint32_t rx_en: 1; /*spi dma read data status bit.*/ - uint32_t tx_en: 1; /*spi dma write data status bit.*/ - uint32_t reserved2: 30; /*spi dma read data from memory count.*/ - }; - uint32_t val; - } dma_status; - union { - struct { - uint32_t inlink_dscr_empty: 1; /*The enable bit for lack of enough inlink descriptors.*/ - uint32_t outlink_dscr_error: 1; /*The enable bit for outlink descriptor error.*/ - uint32_t inlink_dscr_error: 1; /*The enable bit for inlink descriptor error.*/ - uint32_t in_done: 1; /*The enable bit for completing usage of a inlink descriptor.*/ - uint32_t in_err_eof: 1; /*The enable bit for receiving error.*/ - uint32_t in_suc_eof: 1; /*The enable bit for completing receiving all the packets from host.*/ - uint32_t out_done: 1; /*The enable bit for completing usage of a outlink descriptor .*/ - uint32_t out_eof: 1; /*The enable bit for sending a packet to host done.*/ - uint32_t out_total_eof: 1; /*The enable bit for sending all the packets to host done.*/ - uint32_t reserved9: 23; /*reserved*/ - }; - uint32_t val; - } dma_int_ena; - union { - struct { - uint32_t inlink_dscr_empty: 1; /*The raw bit for lack of enough inlink descriptors.*/ - uint32_t outlink_dscr_error: 1; /*The raw bit for outlink descriptor error.*/ - uint32_t inlink_dscr_error: 1; /*The raw bit for inlink descriptor error.*/ - uint32_t in_done: 1; /*The raw bit for completing usage of a inlink descriptor.*/ - uint32_t in_err_eof: 1; /*The raw bit for receiving error.*/ - uint32_t in_suc_eof: 1; /*The raw bit for completing receiving all the packets from host.*/ - uint32_t out_done: 1; /*The raw bit for completing usage of a outlink descriptor.*/ - uint32_t out_eof: 1; /*The raw bit for sending a packet to host done.*/ - uint32_t out_total_eof: 1; /*The raw bit for sending all the packets to host done.*/ - uint32_t reserved9: 23; /*reserved*/ - }; - uint32_t val; - } dma_int_raw; - union { - struct { - uint32_t inlink_dscr_empty: 1; /*The status bit for lack of enough inlink descriptors.*/ - uint32_t outlink_dscr_error: 1; /*The status bit for outlink descriptor error.*/ - uint32_t inlink_dscr_error: 1; /*The status bit for inlink descriptor error.*/ - uint32_t in_done: 1; /*The status bit for completing usage of a inlink descriptor.*/ - uint32_t in_err_eof: 1; /*The status bit for receiving error.*/ - uint32_t in_suc_eof: 1; /*The status bit for completing receiving all the packets from host.*/ - uint32_t out_done: 1; /*The status bit for completing usage of a outlink descriptor.*/ - uint32_t out_eof: 1; /*The status bit for sending a packet to host done.*/ - uint32_t out_total_eof: 1; /*The status bit for sending all the packets to host done.*/ - uint32_t reserved9: 23; /*reserved*/ - }; - uint32_t val; - } dma_int_st; - union { - struct { - uint32_t inlink_dscr_empty: 1; /*The clear bit for lack of enough inlink descriptors.*/ - uint32_t outlink_dscr_error: 1; /*The clear bit for outlink descriptor error.*/ - uint32_t inlink_dscr_error: 1; /*The clear bit for inlink descriptor error.*/ - uint32_t in_done: 1; /*The clear bit for completing usage of a inlink descriptor.*/ - uint32_t in_err_eof: 1; /*The clear bit for receiving error.*/ - uint32_t in_suc_eof: 1; /*The clear bit for completing receiving all the packets from host.*/ - uint32_t out_done: 1; /*The clear bit for completing usage of a outlink descriptor.*/ - uint32_t out_eof: 1; /*The clear bit for sending a packet to host done.*/ - uint32_t out_total_eof: 1; /*The clear bit for sending all the packets to host done.*/ - uint32_t reserved9: 23; /*reserved*/ - }; - uint32_t val; - } dma_int_clr; - uint32_t dma_in_err_eof_des_addr; /*The inlink descriptor address when spi dma produce receiving error.*/ - uint32_t dma_in_suc_eof_des_addr; /*The last inlink descriptor address when spi dma produce from_suc_eof.*/ - uint32_t dma_inlink_dscr; /*The content of current in descriptor pointer.*/ - uint32_t dma_inlink_dscr_bf0; /*The content of next in descriptor pointer.*/ - uint32_t dma_inlink_dscr_bf1; /*The content of current in descriptor data buffer pointer.*/ - uint32_t dma_out_eof_bfr_des_addr; /*The address of buffer relative to the outlink descriptor that produce eof.*/ - uint32_t dma_out_eof_des_addr; /*The last outlink descriptor address when spi dma produce to_eof.*/ - uint32_t dma_outlink_dscr; /*The content of current out descriptor pointer.*/ - uint32_t dma_outlink_dscr_bf0; /*The content of next out descriptor pointer.*/ - uint32_t dma_outlink_dscr_bf1; /*The content of current out descriptor data buffer pointer.*/ - uint32_t dma_rx_status; /*spi dma read data from memory status.*/ - uint32_t dma_tx_status; /*spi dma write data to memory status.*/ - uint32_t reserved_150; - uint32_t reserved_154; - uint32_t reserved_158; - uint32_t reserved_15c; - uint32_t reserved_160; - uint32_t reserved_164; - uint32_t reserved_168; - uint32_t reserved_16c; - uint32_t reserved_170; - uint32_t reserved_174; - uint32_t reserved_178; - uint32_t reserved_17c; - uint32_t reserved_180; - uint32_t reserved_184; - uint32_t reserved_188; - uint32_t reserved_18c; - uint32_t reserved_190; - uint32_t reserved_194; - uint32_t reserved_198; - uint32_t reserved_19c; - uint32_t reserved_1a0; - uint32_t reserved_1a4; - uint32_t reserved_1a8; - uint32_t reserved_1ac; - uint32_t reserved_1b0; - uint32_t reserved_1b4; - uint32_t reserved_1b8; - uint32_t reserved_1bc; - uint32_t reserved_1c0; - uint32_t reserved_1c4; - uint32_t reserved_1c8; - uint32_t reserved_1cc; - uint32_t reserved_1d0; - uint32_t reserved_1d4; - uint32_t reserved_1d8; - uint32_t reserved_1dc; - uint32_t reserved_1e0; - uint32_t reserved_1e4; - uint32_t reserved_1e8; - uint32_t reserved_1ec; - uint32_t reserved_1f0; - uint32_t reserved_1f4; - uint32_t reserved_1f8; - uint32_t reserved_1fc; - uint32_t reserved_200; - uint32_t reserved_204; - uint32_t reserved_208; - uint32_t reserved_20c; - uint32_t reserved_210; - uint32_t reserved_214; - uint32_t reserved_218; - uint32_t reserved_21c; - uint32_t reserved_220; - uint32_t reserved_224; - uint32_t reserved_228; - uint32_t reserved_22c; - uint32_t reserved_230; - uint32_t reserved_234; - uint32_t reserved_238; - uint32_t reserved_23c; - uint32_t reserved_240; - uint32_t reserved_244; - uint32_t reserved_248; - uint32_t reserved_24c; - uint32_t reserved_250; - uint32_t reserved_254; - uint32_t reserved_258; - uint32_t reserved_25c; - uint32_t reserved_260; - uint32_t reserved_264; - uint32_t reserved_268; - uint32_t reserved_26c; - uint32_t reserved_270; - uint32_t reserved_274; - uint32_t reserved_278; - uint32_t reserved_27c; - uint32_t reserved_280; - uint32_t reserved_284; - uint32_t reserved_288; - uint32_t reserved_28c; - uint32_t reserved_290; - uint32_t reserved_294; - uint32_t reserved_298; - uint32_t reserved_29c; - uint32_t reserved_2a0; - uint32_t reserved_2a4; - uint32_t reserved_2a8; - uint32_t reserved_2ac; - uint32_t reserved_2b0; - uint32_t reserved_2b4; - uint32_t reserved_2b8; - uint32_t reserved_2bc; - uint32_t reserved_2c0; - uint32_t reserved_2c4; - uint32_t reserved_2c8; - uint32_t reserved_2cc; - uint32_t reserved_2d0; - uint32_t reserved_2d4; - uint32_t reserved_2d8; - uint32_t reserved_2dc; - uint32_t reserved_2e0; - uint32_t reserved_2e4; - uint32_t reserved_2e8; - uint32_t reserved_2ec; - uint32_t reserved_2f0; - uint32_t reserved_2f4; - uint32_t reserved_2f8; - uint32_t reserved_2fc; - uint32_t reserved_300; - uint32_t reserved_304; - uint32_t reserved_308; - uint32_t reserved_30c; - uint32_t reserved_310; - uint32_t reserved_314; - uint32_t reserved_318; - uint32_t reserved_31c; - uint32_t reserved_320; - uint32_t reserved_324; - uint32_t reserved_328; - uint32_t reserved_32c; - uint32_t reserved_330; - uint32_t reserved_334; - uint32_t reserved_338; - uint32_t reserved_33c; - uint32_t reserved_340; - uint32_t reserved_344; - uint32_t reserved_348; - uint32_t reserved_34c; - uint32_t reserved_350; - uint32_t reserved_354; - uint32_t reserved_358; - uint32_t reserved_35c; - uint32_t reserved_360; - uint32_t reserved_364; - uint32_t reserved_368; - uint32_t reserved_36c; - uint32_t reserved_370; - uint32_t reserved_374; - uint32_t reserved_378; - uint32_t reserved_37c; - uint32_t reserved_380; - uint32_t reserved_384; - uint32_t reserved_388; - uint32_t reserved_38c; - uint32_t reserved_390; - uint32_t reserved_394; - uint32_t reserved_398; - uint32_t reserved_39c; - uint32_t reserved_3a0; - uint32_t reserved_3a4; - uint32_t reserved_3a8; - uint32_t reserved_3ac; - uint32_t reserved_3b0; - uint32_t reserved_3b4; - uint32_t reserved_3b8; - uint32_t reserved_3bc; - uint32_t reserved_3c0; - uint32_t reserved_3c4; - uint32_t reserved_3c8; - uint32_t reserved_3cc; - uint32_t reserved_3d0; - uint32_t reserved_3d4; - uint32_t reserved_3d8; - uint32_t reserved_3dc; - uint32_t reserved_3e0; - uint32_t reserved_3e4; - uint32_t reserved_3e8; - uint32_t reserved_3ec; - uint32_t reserved_3f0; - uint32_t reserved_3f4; - uint32_t reserved_3f8; - union { - struct { - uint32_t date: 28; /*SPI register version.*/ - uint32_t reserved28: 4; /*reserved*/ - }; - uint32_t val; - } date; -} spi_dev_t; -extern spi_dev_t SPI0; /* SPI0 IS FOR INTERNAL USE*/ -extern spi_dev_t SPI1; -extern spi_dev_t SPI2; -extern spi_dev_t SPI3; - -#ifdef __cplusplus -} -#endif - -#endif /* _SOC_SPI_STRUCT_H_ */ diff --git a/tools/sdk/include/soc/soc/syscon_reg.h b/tools/sdk/include/soc/soc/syscon_reg.h deleted file mode 100644 index 5012b27e573..00000000000 --- a/tools/sdk/include/soc/soc/syscon_reg.h +++ /dev/null @@ -1,294 +0,0 @@ -// 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. -#ifndef _SOC_SYSCON_REG_H_ -#define _SOC_SYSCON_REG_H_ - -#include "soc.h" -#define SYSCON_SYSCLK_CONF_REG (DR_REG_SYSCON_BASE + 0x0) -/* SYSCON_QUICK_CLK_CHNG : R/W ;bitpos:[13] ;default: 1'b1 ; */ -/*description: */ -#define SYSCON_QUICK_CLK_CHNG (BIT(13)) -#define SYSCON_QUICK_CLK_CHNG_M (BIT(13)) -#define SYSCON_QUICK_CLK_CHNG_V 0x1 -#define SYSCON_QUICK_CLK_CHNG_S 13 -/* SYSCON_RST_TICK_CNT : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define SYSCON_RST_TICK_CNT (BIT(12)) -#define SYSCON_RST_TICK_CNT_M (BIT(12)) -#define SYSCON_RST_TICK_CNT_V 0x1 -#define SYSCON_RST_TICK_CNT_S 12 -/* SYSCON_CLK_EN : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define SYSCON_CLK_EN (BIT(11)) -#define SYSCON_CLK_EN_M (BIT(11)) -#define SYSCON_CLK_EN_V 0x1 -#define SYSCON_CLK_EN_S 11 -/* SYSCON_CLK_320M_EN : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define SYSCON_CLK_320M_EN (BIT(10)) -#define SYSCON_CLK_320M_EN_M (BIT(10)) -#define SYSCON_CLK_320M_EN_V 0x1 -#define SYSCON_CLK_320M_EN_S 10 -/* SYSCON_PRE_DIV_CNT : R/W ;bitpos:[9:0] ;default: 10'h0 ; */ -/*description: */ -#define SYSCON_PRE_DIV_CNT 0x000003FF -#define SYSCON_PRE_DIV_CNT_M ((SYSCON_PRE_DIV_CNT_V)<<(SYSCON_PRE_DIV_CNT_S)) -#define SYSCON_PRE_DIV_CNT_V 0x3FF -#define SYSCON_PRE_DIV_CNT_S 0 - -#define SYSCON_XTAL_TICK_CONF_REG (DR_REG_SYSCON_BASE + 0x4) -/* SYSCON_XTAL_TICK_NUM : R/W ;bitpos:[7:0] ;default: 8'd39 ; */ -/*description: */ -#define SYSCON_XTAL_TICK_NUM 0x000000FF -#define SYSCON_XTAL_TICK_NUM_M ((SYSCON_XTAL_TICK_NUM_V)<<(SYSCON_XTAL_TICK_NUM_S)) -#define SYSCON_XTAL_TICK_NUM_V 0xFF -#define SYSCON_XTAL_TICK_NUM_S 0 - -#define SYSCON_PLL_TICK_CONF_REG (DR_REG_SYSCON_BASE + 0x8) -/* SYSCON_PLL_TICK_NUM : R/W ;bitpos:[7:0] ;default: 8'd79 ; */ -/*description: */ -#define SYSCON_PLL_TICK_NUM 0x000000FF -#define SYSCON_PLL_TICK_NUM_M ((SYSCON_PLL_TICK_NUM_V)<<(SYSCON_PLL_TICK_NUM_S)) -#define SYSCON_PLL_TICK_NUM_V 0xFF -#define SYSCON_PLL_TICK_NUM_S 0 - -#define SYSCON_CK8M_TICK_CONF_REG (DR_REG_SYSCON_BASE + 0xC) -/* SYSCON_CK8M_TICK_NUM : R/W ;bitpos:[7:0] ;default: 8'd11 ; */ -/*description: */ -#define SYSCON_CK8M_TICK_NUM 0x000000FF -#define SYSCON_CK8M_TICK_NUM_M ((SYSCON_CK8M_TICK_NUM_V)<<(SYSCON_CK8M_TICK_NUM_S)) -#define SYSCON_CK8M_TICK_NUM_V 0xFF -#define SYSCON_CK8M_TICK_NUM_S 0 - -#define SYSCON_SARADC_CTRL_REG (DR_REG_SYSCON_BASE + 0x10) -/* SYSCON_SARADC_DATA_TO_I2S : R/W ;bitpos:[26] ;default: 1'b0 ; */ -/*description: 1: I2S input data is from SAR ADC (for DMA) 0: I2S input data - is from GPIO matrix*/ -#define SYSCON_SARADC_DATA_TO_I2S (BIT(26)) -#define SYSCON_SARADC_DATA_TO_I2S_M (BIT(26)) -#define SYSCON_SARADC_DATA_TO_I2S_V 0x1 -#define SYSCON_SARADC_DATA_TO_I2S_S 26 -/* SYSCON_SARADC_DATA_SAR_SEL : R/W ;bitpos:[25] ;default: 1'b0 ; */ -/*description: 1: sar_sel will be coded by the MSB of the 16-bit output data - in this case the resolution should not be larger than 11 bits.*/ -#define SYSCON_SARADC_DATA_SAR_SEL (BIT(25)) -#define SYSCON_SARADC_DATA_SAR_SEL_M (BIT(25)) -#define SYSCON_SARADC_DATA_SAR_SEL_V 0x1 -#define SYSCON_SARADC_DATA_SAR_SEL_S 25 -/* SYSCON_SARADC_SAR2_PATT_P_CLEAR : R/W ;bitpos:[24] ;default: 1'd0 ; */ -/*description: clear the pointer of pattern table for DIG ADC2 CTRL*/ -#define SYSCON_SARADC_SAR2_PATT_P_CLEAR (BIT(24)) -#define SYSCON_SARADC_SAR2_PATT_P_CLEAR_M (BIT(24)) -#define SYSCON_SARADC_SAR2_PATT_P_CLEAR_V 0x1 -#define SYSCON_SARADC_SAR2_PATT_P_CLEAR_S 24 -/* SYSCON_SARADC_SAR1_PATT_P_CLEAR : R/W ;bitpos:[23] ;default: 1'd0 ; */ -/*description: clear the pointer of pattern table for DIG ADC1 CTRL*/ -#define SYSCON_SARADC_SAR1_PATT_P_CLEAR (BIT(23)) -#define SYSCON_SARADC_SAR1_PATT_P_CLEAR_M (BIT(23)) -#define SYSCON_SARADC_SAR1_PATT_P_CLEAR_V 0x1 -#define SYSCON_SARADC_SAR1_PATT_P_CLEAR_S 23 -/* SYSCON_SARADC_SAR2_PATT_LEN : R/W ;bitpos:[22:19] ;default: 4'd15 ; */ -/*description: 0 ~ 15 means length 1 ~ 16*/ -#define SYSCON_SARADC_SAR2_PATT_LEN 0x0000000F -#define SYSCON_SARADC_SAR2_PATT_LEN_M ((SYSCON_SARADC_SAR2_PATT_LEN_V)<<(SYSCON_SARADC_SAR2_PATT_LEN_S)) -#define SYSCON_SARADC_SAR2_PATT_LEN_V 0xF -#define SYSCON_SARADC_SAR2_PATT_LEN_S 19 -/* SYSCON_SARADC_SAR1_PATT_LEN : R/W ;bitpos:[18:15] ;default: 4'd15 ; */ -/*description: 0 ~ 15 means length 1 ~ 16*/ -#define SYSCON_SARADC_SAR1_PATT_LEN 0x0000000F -#define SYSCON_SARADC_SAR1_PATT_LEN_M ((SYSCON_SARADC_SAR1_PATT_LEN_V)<<(SYSCON_SARADC_SAR1_PATT_LEN_S)) -#define SYSCON_SARADC_SAR1_PATT_LEN_V 0xF -#define SYSCON_SARADC_SAR1_PATT_LEN_S 15 -/* SYSCON_SARADC_SAR_CLK_DIV : R/W ;bitpos:[14:7] ;default: 8'd4 ; */ -/*description: SAR clock divider*/ -#define SYSCON_SARADC_SAR_CLK_DIV 0x000000FF -#define SYSCON_SARADC_SAR_CLK_DIV_M ((SYSCON_SARADC_SAR_CLK_DIV_V)<<(SYSCON_SARADC_SAR_CLK_DIV_S)) -#define SYSCON_SARADC_SAR_CLK_DIV_V 0xFF -#define SYSCON_SARADC_SAR_CLK_DIV_S 7 -/* SYSCON_SARADC_SAR_CLK_GATED : R/W ;bitpos:[6] ;default: 1'b1 ; */ -/*description: */ -#define SYSCON_SARADC_SAR_CLK_GATED (BIT(6)) -#define SYSCON_SARADC_SAR_CLK_GATED_M (BIT(6)) -#define SYSCON_SARADC_SAR_CLK_GATED_V 0x1 -#define SYSCON_SARADC_SAR_CLK_GATED_S 6 -/* SYSCON_SARADC_SAR_SEL : R/W ;bitpos:[5] ;default: 1'd0 ; */ -/*description: 0: SAR1 1: SAR2 only work for single SAR mode*/ -#define SYSCON_SARADC_SAR_SEL (BIT(5)) -#define SYSCON_SARADC_SAR_SEL_M (BIT(5)) -#define SYSCON_SARADC_SAR_SEL_V 0x1 -#define SYSCON_SARADC_SAR_SEL_S 5 -/* SYSCON_SARADC_WORK_MODE : R/W ;bitpos:[4:3] ;default: 2'd0 ; */ -/*description: 0: single mode 1: double mode 2: alternate mode*/ -#define SYSCON_SARADC_WORK_MODE 0x00000003 -#define SYSCON_SARADC_WORK_MODE_M ((SYSCON_SARADC_WORK_MODE_V)<<(SYSCON_SARADC_WORK_MODE_S)) -#define SYSCON_SARADC_WORK_MODE_V 0x3 -#define SYSCON_SARADC_WORK_MODE_S 3 -/* SYSCON_SARADC_SAR2_MUX : R/W ;bitpos:[2] ;default: 1'd0 ; */ -/*description: 1: SAR ADC2 is controlled by DIG ADC2 CTRL 0: SAR ADC2 is controlled - by PWDET CTRL*/ -#define SYSCON_SARADC_SAR2_MUX (BIT(2)) -#define SYSCON_SARADC_SAR2_MUX_M (BIT(2)) -#define SYSCON_SARADC_SAR2_MUX_V 0x1 -#define SYSCON_SARADC_SAR2_MUX_S 2 -/* SYSCON_SARADC_START : R/W ;bitpos:[1] ;default: 1'd0 ; */ -/*description: */ -#define SYSCON_SARADC_START (BIT(1)) -#define SYSCON_SARADC_START_M (BIT(1)) -#define SYSCON_SARADC_START_V 0x1 -#define SYSCON_SARADC_START_S 1 -/* SYSCON_SARADC_START_FORCE : R/W ;bitpos:[0] ;default: 1'd0 ; */ -/*description: */ -#define SYSCON_SARADC_START_FORCE (BIT(0)) -#define SYSCON_SARADC_START_FORCE_M (BIT(0)) -#define SYSCON_SARADC_START_FORCE_V 0x1 -#define SYSCON_SARADC_START_FORCE_S 0 - -#define SYSCON_SARADC_CTRL2_REG (DR_REG_SYSCON_BASE + 0x14) -/* SYSCON_SARADC_SAR2_INV : R/W ;bitpos:[10] ;default: 1'd0 ; */ -/*description: 1: data to DIG ADC2 CTRL is inverted otherwise not*/ -#define SYSCON_SARADC_SAR2_INV (BIT(10)) -#define SYSCON_SARADC_SAR2_INV_M (BIT(10)) -#define SYSCON_SARADC_SAR2_INV_V 0x1 -#define SYSCON_SARADC_SAR2_INV_S 10 -/* SYSCON_SARADC_SAR1_INV : R/W ;bitpos:[9] ;default: 1'd0 ; */ -/*description: 1: data to DIG ADC1 CTRL is inverted otherwise not*/ -#define SYSCON_SARADC_SAR1_INV (BIT(9)) -#define SYSCON_SARADC_SAR1_INV_M (BIT(9)) -#define SYSCON_SARADC_SAR1_INV_V 0x1 -#define SYSCON_SARADC_SAR1_INV_S 9 -/* SYSCON_SARADC_MAX_MEAS_NUM : R/W ;bitpos:[8:1] ;default: 8'd255 ; */ -/*description: max conversion number*/ -#define SYSCON_SARADC_MAX_MEAS_NUM 0x000000FF -#define SYSCON_SARADC_MAX_MEAS_NUM_M ((SYSCON_SARADC_MAX_MEAS_NUM_V)<<(SYSCON_SARADC_MAX_MEAS_NUM_S)) -#define SYSCON_SARADC_MAX_MEAS_NUM_V 0xFF -#define SYSCON_SARADC_MAX_MEAS_NUM_S 1 -/* SYSCON_SARADC_MEAS_NUM_LIMIT : R/W ;bitpos:[0] ;default: 1'd0 ; */ -/*description: */ -#define SYSCON_SARADC_MEAS_NUM_LIMIT (BIT(0)) -#define SYSCON_SARADC_MEAS_NUM_LIMIT_M (BIT(0)) -#define SYSCON_SARADC_MEAS_NUM_LIMIT_V 0x1 -#define SYSCON_SARADC_MEAS_NUM_LIMIT_S 0 - -#define SYSCON_SARADC_FSM_REG (DR_REG_SYSCON_BASE + 0x18) -/* SYSCON_SARADC_SAMPLE_CYCLE : R/W ;bitpos:[31:24] ;default: 8'd2 ; */ -/*description: sample cycles*/ -#define SYSCON_SARADC_SAMPLE_CYCLE 0x000000FF -#define SYSCON_SARADC_SAMPLE_CYCLE_M ((SYSCON_SARADC_SAMPLE_CYCLE_V)<<(SYSCON_SARADC_SAMPLE_CYCLE_S)) -#define SYSCON_SARADC_SAMPLE_CYCLE_V 0xFF -#define SYSCON_SARADC_SAMPLE_CYCLE_S 24 -/* SYSCON_SARADC_START_WAIT : R/W ;bitpos:[23:16] ;default: 8'd8 ; */ -/*description: */ -#define SYSCON_SARADC_START_WAIT 0x000000FF -#define SYSCON_SARADC_START_WAIT_M ((SYSCON_SARADC_START_WAIT_V)<<(SYSCON_SARADC_START_WAIT_S)) -#define SYSCON_SARADC_START_WAIT_V 0xFF -#define SYSCON_SARADC_START_WAIT_S 16 -/* SYSCON_SARADC_STANDBY_WAIT : R/W ;bitpos:[15:8] ;default: 8'd255 ; */ -/*description: */ -#define SYSCON_SARADC_STANDBY_WAIT 0x000000FF -#define SYSCON_SARADC_STANDBY_WAIT_M ((SYSCON_SARADC_STANDBY_WAIT_V)<<(SYSCON_SARADC_STANDBY_WAIT_S)) -#define SYSCON_SARADC_STANDBY_WAIT_V 0xFF -#define SYSCON_SARADC_STANDBY_WAIT_S 8 -/* SYSCON_SARADC_RSTB_WAIT : R/W ;bitpos:[7:0] ;default: 8'd8 ; */ -/*description: */ -#define SYSCON_SARADC_RSTB_WAIT 0x000000FF -#define SYSCON_SARADC_RSTB_WAIT_M ((SYSCON_SARADC_RSTB_WAIT_V)<<(SYSCON_SARADC_RSTB_WAIT_S)) -#define SYSCON_SARADC_RSTB_WAIT_V 0xFF -#define SYSCON_SARADC_RSTB_WAIT_S 0 - -#define SYSCON_SARADC_SAR1_PATT_TAB1_REG (DR_REG_SYSCON_BASE + 0x1C) -/* SYSCON_SARADC_SAR1_PATT_TAB1 : R/W ;bitpos:[31:0] ;default: 32'hf0f0f0f ; */ -/*description: item 0 ~ 3 for pattern table 1 (each item one byte)*/ -#define SYSCON_SARADC_SAR1_PATT_TAB1 0xFFFFFFFF -#define SYSCON_SARADC_SAR1_PATT_TAB1_M ((SYSCON_SARADC_SAR1_PATT_TAB1_V)<<(SYSCON_SARADC_SAR1_PATT_TAB1_S)) -#define SYSCON_SARADC_SAR1_PATT_TAB1_V 0xFFFFFFFF -#define SYSCON_SARADC_SAR1_PATT_TAB1_S 0 - -#define SYSCON_SARADC_SAR1_PATT_TAB2_REG (DR_REG_SYSCON_BASE + 0x20) -/* SYSCON_SARADC_SAR1_PATT_TAB2 : R/W ;bitpos:[31:0] ;default: 32'hf0f0f0f ; */ -/*description: Item 4 ~ 7 for pattern table 1 (each item one byte)*/ -#define SYSCON_SARADC_SAR1_PATT_TAB2 0xFFFFFFFF -#define SYSCON_SARADC_SAR1_PATT_TAB2_M ((SYSCON_SARADC_SAR1_PATT_TAB2_V)<<(SYSCON_SARADC_SAR1_PATT_TAB2_S)) -#define SYSCON_SARADC_SAR1_PATT_TAB2_V 0xFFFFFFFF -#define SYSCON_SARADC_SAR1_PATT_TAB2_S 0 - -#define SYSCON_SARADC_SAR1_PATT_TAB3_REG (DR_REG_SYSCON_BASE + 0x24) -/* SYSCON_SARADC_SAR1_PATT_TAB3 : R/W ;bitpos:[31:0] ;default: 32'hf0f0f0f ; */ -/*description: Item 8 ~ 11 for pattern table 1 (each item one byte)*/ -#define SYSCON_SARADC_SAR1_PATT_TAB3 0xFFFFFFFF -#define SYSCON_SARADC_SAR1_PATT_TAB3_M ((SYSCON_SARADC_SAR1_PATT_TAB3_V)<<(SYSCON_SARADC_SAR1_PATT_TAB3_S)) -#define SYSCON_SARADC_SAR1_PATT_TAB3_V 0xFFFFFFFF -#define SYSCON_SARADC_SAR1_PATT_TAB3_S 0 - -#define SYSCON_SARADC_SAR1_PATT_TAB4_REG (DR_REG_SYSCON_BASE + 0x28) -/* SYSCON_SARADC_SAR1_PATT_TAB4 : R/W ;bitpos:[31:0] ;default: 32'hf0f0f0f ; */ -/*description: Item 12 ~ 15 for pattern table 1 (each item one byte)*/ -#define SYSCON_SARADC_SAR1_PATT_TAB4 0xFFFFFFFF -#define SYSCON_SARADC_SAR1_PATT_TAB4_M ((SYSCON_SARADC_SAR1_PATT_TAB4_V)<<(SYSCON_SARADC_SAR1_PATT_TAB4_S)) -#define SYSCON_SARADC_SAR1_PATT_TAB4_V 0xFFFFFFFF -#define SYSCON_SARADC_SAR1_PATT_TAB4_S 0 - -#define SYSCON_SARADC_SAR2_PATT_TAB1_REG (DR_REG_SYSCON_BASE + 0x2C) -/* SYSCON_SARADC_SAR2_PATT_TAB1 : R/W ;bitpos:[31:0] ;default: 32'hf0f0f0f ; */ -/*description: item 0 ~ 3 for pattern table 2 (each item one byte)*/ -#define SYSCON_SARADC_SAR2_PATT_TAB1 0xFFFFFFFF -#define SYSCON_SARADC_SAR2_PATT_TAB1_M ((SYSCON_SARADC_SAR2_PATT_TAB1_V)<<(SYSCON_SARADC_SAR2_PATT_TAB1_S)) -#define SYSCON_SARADC_SAR2_PATT_TAB1_V 0xFFFFFFFF -#define SYSCON_SARADC_SAR2_PATT_TAB1_S 0 - -#define SYSCON_SARADC_SAR2_PATT_TAB2_REG (DR_REG_SYSCON_BASE + 0x30) -/* SYSCON_SARADC_SAR2_PATT_TAB2 : R/W ;bitpos:[31:0] ;default: 32'hf0f0f0f ; */ -/*description: Item 4 ~ 7 for pattern table 2 (each item one byte)*/ -#define SYSCON_SARADC_SAR2_PATT_TAB2 0xFFFFFFFF -#define SYSCON_SARADC_SAR2_PATT_TAB2_M ((SYSCON_SARADC_SAR2_PATT_TAB2_V)<<(SYSCON_SARADC_SAR2_PATT_TAB2_S)) -#define SYSCON_SARADC_SAR2_PATT_TAB2_V 0xFFFFFFFF -#define SYSCON_SARADC_SAR2_PATT_TAB2_S 0 - -#define SYSCON_SARADC_SAR2_PATT_TAB3_REG (DR_REG_SYSCON_BASE + 0x34) -/* SYSCON_SARADC_SAR2_PATT_TAB3 : R/W ;bitpos:[31:0] ;default: 32'hf0f0f0f ; */ -/*description: Item 8 ~ 11 for pattern table 2 (each item one byte)*/ -#define SYSCON_SARADC_SAR2_PATT_TAB3 0xFFFFFFFF -#define SYSCON_SARADC_SAR2_PATT_TAB3_M ((SYSCON_SARADC_SAR2_PATT_TAB3_V)<<(SYSCON_SARADC_SAR2_PATT_TAB3_S)) -#define SYSCON_SARADC_SAR2_PATT_TAB3_V 0xFFFFFFFF -#define SYSCON_SARADC_SAR2_PATT_TAB3_S 0 - -#define SYSCON_SARADC_SAR2_PATT_TAB4_REG (DR_REG_SYSCON_BASE + 0x38) -/* SYSCON_SARADC_SAR2_PATT_TAB4 : R/W ;bitpos:[31:0] ;default: 32'hf0f0f0f ; */ -/*description: Item 12 ~ 15 for pattern table 2 (each item one byte)*/ -#define SYSCON_SARADC_SAR2_PATT_TAB4 0xFFFFFFFF -#define SYSCON_SARADC_SAR2_PATT_TAB4_M ((SYSCON_SARADC_SAR2_PATT_TAB4_V)<<(SYSCON_SARADC_SAR2_PATT_TAB4_S)) -#define SYSCON_SARADC_SAR2_PATT_TAB4_V 0xFFFFFFFF -#define SYSCON_SARADC_SAR2_PATT_TAB4_S 0 - -#define SYSCON_APLL_TICK_CONF_REG (DR_REG_SYSCON_BASE + 0x3C) -/* SYSCON_APLL_TICK_NUM : R/W ;bitpos:[7:0] ;default: 8'd99 ; */ -/*description: */ -#define SYSCON_APLL_TICK_NUM 0x000000FF -#define SYSCON_APLL_TICK_NUM_M ((SYSCON_APLL_TICK_NUM_V)<<(SYSCON_APLL_TICK_NUM_S)) -#define SYSCON_APLL_TICK_NUM_V 0xFF -#define SYSCON_APLL_TICK_NUM_S 0 - -#define SYSCON_DATE_REG (DR_REG_SYSCON_BASE + 0x7C) -/* SYSCON_DATE : R/W ;bitpos:[31:0] ;default: 32'h16042000 ; */ -/*description: */ -#define SYSCON_DATE 0xFFFFFFFF -#define SYSCON_DATE_M ((SYSCON_DATE_V)<<(SYSCON_DATE_S)) -#define SYSCON_DATE_V 0xFFFFFFFF -#define SYSCON_DATE_S 0 - - - - -#endif /*_SOC_SYSCON_REG_H_ */ - - diff --git a/tools/sdk/include/soc/soc/syscon_struct.h b/tools/sdk/include/soc/soc/syscon_struct.h deleted file mode 100644 index 42bd643d169..00000000000 --- a/tools/sdk/include/soc/soc/syscon_struct.h +++ /dev/null @@ -1,123 +0,0 @@ -// 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. -#ifndef _SOC_SYSCON_STRUCT_H_ -#define _SOC_SYSCON_STRUCT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef volatile struct { - union { - struct { - uint32_t pre_div: 10; - uint32_t clk_320m_en: 1; - uint32_t clk_en: 1; - uint32_t rst_tick: 1; - uint32_t quick_clk_chng: 1; - uint32_t reserved14: 18; - }; - uint32_t val; - }clk_conf; - union { - struct { - uint32_t xtal_tick: 8; - uint32_t reserved8: 24; - }; - uint32_t val; - }xtal_tick_conf; - union { - struct { - uint32_t pll_tick: 8; - uint32_t reserved8: 24; - }; - uint32_t val; - }pll_tick_conf; - union { - struct { - uint32_t ck8m_tick: 8; - uint32_t reserved8: 24; - }; - uint32_t val; - }ck8m_tick_conf; - union { - struct { - uint32_t start_force: 1; - uint32_t start: 1; - uint32_t sar2_mux: 1; /*1: SAR ADC2 is controlled by DIG ADC2 CTRL 0: SAR ADC2 is controlled by PWDET CTRL*/ - uint32_t work_mode: 2; /*0: single mode 1: double mode 2: alternate mode*/ - uint32_t sar_sel: 1; /*0: SAR1 1: SAR2 only work for single SAR mode*/ - uint32_t sar_clk_gated: 1; - uint32_t sar_clk_div: 8; /*SAR clock divider*/ - uint32_t sar1_patt_len: 4; /*0 ~ 15 means length 1 ~ 16*/ - uint32_t sar2_patt_len: 4; /*0 ~ 15 means length 1 ~ 16*/ - uint32_t sar1_patt_p_clear: 1; /*clear the pointer of pattern table for DIG ADC1 CTRL*/ - uint32_t sar2_patt_p_clear: 1; /*clear the pointer of pattern table for DIG ADC2 CTRL*/ - uint32_t data_sar_sel: 1; /*1: sar_sel will be coded by the MSB of the 16-bit output data in this case the resolution should not be larger than 11 bits.*/ - uint32_t data_to_i2s: 1; /*1: I2S input data is from SAR ADC (for DMA) 0: I2S input data is from GPIO matrix*/ - uint32_t reserved27: 5; - }; - uint32_t val; - }saradc_ctrl; - union { - struct { - uint32_t meas_num_limit: 1; - uint32_t max_meas_num: 8; /*max conversion number*/ - uint32_t sar1_inv: 1; /*1: data to DIG ADC1 CTRL is inverted otherwise not*/ - uint32_t sar2_inv: 1; /*1: data to DIG ADC2 CTRL is inverted otherwise not*/ - uint32_t reserved11: 21; - }; - uint32_t val; - }saradc_ctrl2; - union { - struct { - uint32_t rstb_wait: 8; - uint32_t standby_wait: 8; - uint32_t start_wait: 8; - uint32_t sample_cycle: 8; /*sample cycles*/ - }; - uint32_t val; - }saradc_fsm; - uint32_t saradc_sar1_patt_tab[4]; /*item 0 ~ 3 for ADC1 pattern table*/ - uint32_t saradc_sar2_patt_tab[4]; /*item 0 ~ 3 for ADC2 pattern table*/ - union { - struct { - uint32_t apll_tick: 8; - uint32_t reserved8: 24; - }; - uint32_t val; - }apll_tick_conf; - uint32_t reserved_40; - uint32_t reserved_44; - uint32_t reserved_48; - uint32_t reserved_4c; - uint32_t reserved_50; - uint32_t reserved_54; - uint32_t reserved_58; - uint32_t reserved_5c; - uint32_t reserved_60; - uint32_t reserved_64; - uint32_t reserved_68; - uint32_t reserved_6c; - uint32_t reserved_70; - uint32_t reserved_74; - uint32_t reserved_78; - uint32_t date; /**/ -} syscon_dev_t; - -#ifdef __cplusplus -} -#endif -extern syscon_dev_t SYSCON; -#endif /* _SOC_SYSCON_STRUCT_H_ */ diff --git a/tools/sdk/include/soc/soc/timer_group_reg.h b/tools/sdk/include/soc/soc/timer_group_reg.h deleted file mode 100644 index 2db2a7e3f1b..00000000000 --- a/tools/sdk/include/soc/soc/timer_group_reg.h +++ /dev/null @@ -1,668 +0,0 @@ -// 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. -#ifndef __TIMG_REG_H__ -#define __TIMG_REG_H__ -#include "soc.h" - -/* The value that needs to be written to TIMG_WDT_WKEY to write-enable the wdt registers */ -#define TIMG_WDT_WKEY_VALUE 0x50D83AA1 - -/* Possible values for TIMG_WDT_STGx */ -#define TIMG_WDT_STG_SEL_OFF 0 -#define TIMG_WDT_STG_SEL_INT 1 -#define TIMG_WDT_STG_SEL_RESET_CPU 2 -#define TIMG_WDT_STG_SEL_RESET_SYSTEM 3 - - -#define REG_TIMG_BASE(i) (DR_REG_TIMERGROUP0_BASE + i*0x1000) -#define TIMG_T0CONFIG_REG(i) (REG_TIMG_BASE(i) + 0x0000) -/* TIMG_T0_EN : R/W ;bitpos:[31] ;default: 1'h0 ; */ -/*description: When set timer 0 time-base counter is enabled*/ -#define TIMG_T0_EN (BIT(31)) -#define TIMG_T0_EN_M (BIT(31)) -#define TIMG_T0_EN_V 0x1 -#define TIMG_T0_EN_S 31 -/* TIMG_T0_INCREASE : R/W ;bitpos:[30] ;default: 1'h1 ; */ -/*description: When set timer 0 time-base counter increment. When cleared timer - 0 time-base counter decrement.*/ -#define TIMG_T0_INCREASE (BIT(30)) -#define TIMG_T0_INCREASE_M (BIT(30)) -#define TIMG_T0_INCREASE_V 0x1 -#define TIMG_T0_INCREASE_S 30 -/* TIMG_T0_AUTORELOAD : R/W ;bitpos:[29] ;default: 1'h1 ; */ -/*description: When set timer 0 auto-reload at alarming is enabled*/ -#define TIMG_T0_AUTORELOAD (BIT(29)) -#define TIMG_T0_AUTORELOAD_M (BIT(29)) -#define TIMG_T0_AUTORELOAD_V 0x1 -#define TIMG_T0_AUTORELOAD_S 29 -/* TIMG_T0_DIVIDER : R/W ;bitpos:[28:13] ;default: 16'h1 ; */ -/*description: Timer 0 clock (T0_clk) prescale value.*/ -#define TIMG_T0_DIVIDER 0x0000FFFF -#define TIMG_T0_DIVIDER_M ((TIMG_T0_DIVIDER_V)<<(TIMG_T0_DIVIDER_S)) -#define TIMG_T0_DIVIDER_V 0xFFFF -#define TIMG_T0_DIVIDER_S 13 -/* TIMG_T0_EDGE_INT_EN : R/W ;bitpos:[12] ;default: 1'h0 ; */ -/*description: When set edge type interrupt will be generated during alarm*/ -#define TIMG_T0_EDGE_INT_EN (BIT(12)) -#define TIMG_T0_EDGE_INT_EN_M (BIT(12)) -#define TIMG_T0_EDGE_INT_EN_V 0x1 -#define TIMG_T0_EDGE_INT_EN_S 12 -/* TIMG_T0_LEVEL_INT_EN : R/W ;bitpos:[11] ;default: 1'h0 ; */ -/*description: When set level type interrupt will be generated during alarm*/ -#define TIMG_T0_LEVEL_INT_EN (BIT(11)) -#define TIMG_T0_LEVEL_INT_EN_M (BIT(11)) -#define TIMG_T0_LEVEL_INT_EN_V 0x1 -#define TIMG_T0_LEVEL_INT_EN_S 11 -/* TIMG_T0_ALARM_EN : R/W ;bitpos:[10] ;default: 1'h0 ; */ -/*description: When set alarm is enabled*/ -#define TIMG_T0_ALARM_EN (BIT(10)) -#define TIMG_T0_ALARM_EN_M (BIT(10)) -#define TIMG_T0_ALARM_EN_V 0x1 -#define TIMG_T0_ALARM_EN_S 10 - -#define TIMG_T0LO_REG(i) (REG_TIMG_BASE(i) + 0x0004) -/* TIMG_T0_LO : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: Register to store timer 0 time-base counter current value lower 32 bits.*/ -#define TIMG_T0_LO 0xFFFFFFFF -#define TIMG_T0_LO_M ((TIMG_T0_LO_V)<<(TIMG_T0_LO_S)) -#define TIMG_T0_LO_V 0xFFFFFFFF -#define TIMG_T0_LO_S 0 - -#define TIMG_T0HI_REG(i) (REG_TIMG_BASE(i) + 0x0008) -/* TIMG_T0_HI : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: Register to store timer 0 time-base counter current value higher 32 bits.*/ -#define TIMG_T0_HI 0xFFFFFFFF -#define TIMG_T0_HI_M ((TIMG_T0_HI_V)<<(TIMG_T0_HI_S)) -#define TIMG_T0_HI_V 0xFFFFFFFF -#define TIMG_T0_HI_S 0 - -#define TIMG_T0UPDATE_REG(i) (REG_TIMG_BASE(i) + 0x000c) -/* TIMG_T0_UPDATE : WO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: Write any value will trigger a timer 0 time-base counter value - update (timer 0 current value will be stored in registers above)*/ -#define TIMG_T0_UPDATE 0xFFFFFFFF -#define TIMG_T0_UPDATE_M ((TIMG_T0_UPDATE_V)<<(TIMG_T0_UPDATE_S)) -#define TIMG_T0_UPDATE_V 0xFFFFFFFF -#define TIMG_T0_UPDATE_S 0 - -#define TIMG_T0ALARMLO_REG(i) (REG_TIMG_BASE(i) + 0x0010) -/* TIMG_T0_ALARM_LO : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: Timer 0 time-base counter value lower 32 bits that will trigger the alarm*/ -#define TIMG_T0_ALARM_LO 0xFFFFFFFF -#define TIMG_T0_ALARM_LO_M ((TIMG_T0_ALARM_LO_V)<<(TIMG_T0_ALARM_LO_S)) -#define TIMG_T0_ALARM_LO_V 0xFFFFFFFF -#define TIMG_T0_ALARM_LO_S 0 - -#define TIMG_T0ALARMHI_REG(i) (REG_TIMG_BASE(i) + 0x0014) -/* TIMG_T0_ALARM_HI : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: Timer 0 time-base counter value higher 32 bits that will trigger the alarm*/ -#define TIMG_T0_ALARM_HI 0xFFFFFFFF -#define TIMG_T0_ALARM_HI_M ((TIMG_T0_ALARM_HI_V)<<(TIMG_T0_ALARM_HI_S)) -#define TIMG_T0_ALARM_HI_V 0xFFFFFFFF -#define TIMG_T0_ALARM_HI_S 0 - -#define TIMG_T0LOADLO_REG(i) (REG_TIMG_BASE(i) + 0x0018) -/* TIMG_T0_LOAD_LO : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: Lower 32 bits of the value that will load into timer 0 time-base counter*/ -#define TIMG_T0_LOAD_LO 0xFFFFFFFF -#define TIMG_T0_LOAD_LO_M ((TIMG_T0_LOAD_LO_V)<<(TIMG_T0_LOAD_LO_S)) -#define TIMG_T0_LOAD_LO_V 0xFFFFFFFF -#define TIMG_T0_LOAD_LO_S 0 - -#define TIMG_T0LOADHI_REG(i) (REG_TIMG_BASE(i) + 0x001c) -/* TIMG_T0_LOAD_HI : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: higher 32 bits of the value that will load into timer 0 time-base counter*/ -#define TIMG_T0_LOAD_HI 0xFFFFFFFF -#define TIMG_T0_LOAD_HI_M ((TIMG_T0_LOAD_HI_V)<<(TIMG_T0_LOAD_HI_S)) -#define TIMG_T0_LOAD_HI_V 0xFFFFFFFF -#define TIMG_T0_LOAD_HI_S 0 - -#define TIMG_T0LOAD_REG(i) (REG_TIMG_BASE(i) + 0x0020) -/* TIMG_T0_LOAD : WO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: Write any value will trigger timer 0 time-base counter reload*/ -#define TIMG_T0_LOAD 0xFFFFFFFF -#define TIMG_T0_LOAD_M ((TIMG_T0_LOAD_V)<<(TIMG_T0_LOAD_S)) -#define TIMG_T0_LOAD_V 0xFFFFFFFF -#define TIMG_T0_LOAD_S 0 - -#define TIMG_T1CONFIG_REG(i) (REG_TIMG_BASE(i) + 0x0024) -/* TIMG_T1_EN : R/W ;bitpos:[31] ;default: 1'h0 ; */ -/*description: When set timer 1 time-base counter is enabled*/ -#define TIMG_T1_EN (BIT(31)) -#define TIMG_T1_EN_M (BIT(31)) -#define TIMG_T1_EN_V 0x1 -#define TIMG_T1_EN_S 31 -/* TIMG_T1_INCREASE : R/W ;bitpos:[30] ;default: 1'h1 ; */ -/*description: When set timer 1 time-base counter increment. When cleared timer - 1 time-base counter decrement.*/ -#define TIMG_T1_INCREASE (BIT(30)) -#define TIMG_T1_INCREASE_M (BIT(30)) -#define TIMG_T1_INCREASE_V 0x1 -#define TIMG_T1_INCREASE_S 30 -/* TIMG_T1_AUTORELOAD : R/W ;bitpos:[29] ;default: 1'h1 ; */ -/*description: When set timer 1 auto-reload at alarming is enabled*/ -#define TIMG_T1_AUTORELOAD (BIT(29)) -#define TIMG_T1_AUTORELOAD_M (BIT(29)) -#define TIMG_T1_AUTORELOAD_V 0x1 -#define TIMG_T1_AUTORELOAD_S 29 -/* TIMG_T1_DIVIDER : R/W ;bitpos:[28:13] ;default: 16'h1 ; */ -/*description: Timer 1 clock (T1_clk) prescale value.*/ -#define TIMG_T1_DIVIDER 0x0000FFFF -#define TIMG_T1_DIVIDER_M ((TIMG_T1_DIVIDER_V)<<(TIMG_T1_DIVIDER_S)) -#define TIMG_T1_DIVIDER_V 0xFFFF -#define TIMG_T1_DIVIDER_S 13 -/* TIMG_T1_EDGE_INT_EN : R/W ;bitpos:[12] ;default: 1'h0 ; */ -/*description: When set edge type interrupt will be generated during alarm*/ -#define TIMG_T1_EDGE_INT_EN (BIT(12)) -#define TIMG_T1_EDGE_INT_EN_M (BIT(12)) -#define TIMG_T1_EDGE_INT_EN_V 0x1 -#define TIMG_T1_EDGE_INT_EN_S 12 -/* TIMG_T1_LEVEL_INT_EN : R/W ;bitpos:[11] ;default: 1'h0 ; */ -/*description: When set level type interrupt will be generated during alarm*/ -#define TIMG_T1_LEVEL_INT_EN (BIT(11)) -#define TIMG_T1_LEVEL_INT_EN_M (BIT(11)) -#define TIMG_T1_LEVEL_INT_EN_V 0x1 -#define TIMG_T1_LEVEL_INT_EN_S 11 -/* TIMG_T1_ALARM_EN : R/W ;bitpos:[10] ;default: 1'h0 ; */ -/*description: When set alarm is enabled*/ -#define TIMG_T1_ALARM_EN (BIT(10)) -#define TIMG_T1_ALARM_EN_M (BIT(10)) -#define TIMG_T1_ALARM_EN_V 0x1 -#define TIMG_T1_ALARM_EN_S 10 - -#define TIMG_T1LO_REG(i) (REG_TIMG_BASE(i) + 0x0028) -/* TIMG_T1_LO : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: Register to store timer 1 time-base counter current value lower 32 bits.*/ -#define TIMG_T1_LO 0xFFFFFFFF -#define TIMG_T1_LO_M ((TIMG_T1_LO_V)<<(TIMG_T1_LO_S)) -#define TIMG_T1_LO_V 0xFFFFFFFF -#define TIMG_T1_LO_S 0 - -#define TIMG_T1HI_REG(i) (REG_TIMG_BASE(i) + 0x002c) -/* TIMG_T1_HI : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: Register to store timer 1 time-base counter current value higher 32 bits.*/ -#define TIMG_T1_HI 0xFFFFFFFF -#define TIMG_T1_HI_M ((TIMG_T1_HI_V)<<(TIMG_T1_HI_S)) -#define TIMG_T1_HI_V 0xFFFFFFFF -#define TIMG_T1_HI_S 0 - -#define TIMG_T1UPDATE_REG(i) (REG_TIMG_BASE(i) + 0x0030) -/* TIMG_T1_UPDATE : WO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: Write any value will trigger a timer 1 time-base counter value - update (timer 1 current value will be stored in registers above)*/ -#define TIMG_T1_UPDATE 0xFFFFFFFF -#define TIMG_T1_UPDATE_M ((TIMG_T1_UPDATE_V)<<(TIMG_T1_UPDATE_S)) -#define TIMG_T1_UPDATE_V 0xFFFFFFFF -#define TIMG_T1_UPDATE_S 0 - -#define TIMG_T1ALARMLO_REG(i) (REG_TIMG_BASE(i) + 0x0034) -/* TIMG_T1_ALARM_LO : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: Timer 1 time-base counter value lower 32 bits that will trigger the alarm*/ -#define TIMG_T1_ALARM_LO 0xFFFFFFFF -#define TIMG_T1_ALARM_LO_M ((TIMG_T1_ALARM_LO_V)<<(TIMG_T1_ALARM_LO_S)) -#define TIMG_T1_ALARM_LO_V 0xFFFFFFFF -#define TIMG_T1_ALARM_LO_S 0 - -#define TIMG_T1ALARMHI_REG(i) (REG_TIMG_BASE(i) + 0x0038) -/* TIMG_T1_ALARM_HI : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: Timer 1 time-base counter value higher 32 bits that will trigger the alarm*/ -#define TIMG_T1_ALARM_HI 0xFFFFFFFF -#define TIMG_T1_ALARM_HI_M ((TIMG_T1_ALARM_HI_V)<<(TIMG_T1_ALARM_HI_S)) -#define TIMG_T1_ALARM_HI_V 0xFFFFFFFF -#define TIMG_T1_ALARM_HI_S 0 - -#define TIMG_T1LOADLO_REG(i) (REG_TIMG_BASE(i) + 0x003c) -/* TIMG_T1_LOAD_LO : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: Lower 32 bits of the value that will load into timer 1 time-base counter*/ -#define TIMG_T1_LOAD_LO 0xFFFFFFFF -#define TIMG_T1_LOAD_LO_M ((TIMG_T1_LOAD_LO_V)<<(TIMG_T1_LOAD_LO_S)) -#define TIMG_T1_LOAD_LO_V 0xFFFFFFFF -#define TIMG_T1_LOAD_LO_S 0 - -#define TIMG_T1LOADHI_REG(i) (REG_TIMG_BASE(i) + 0x0040) -/* TIMG_T1_LOAD_HI : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: higher 32 bits of the value that will load into timer 1 time-base counter*/ -#define TIMG_T1_LOAD_HI 0xFFFFFFFF -#define TIMG_T1_LOAD_HI_M ((TIMG_T1_LOAD_HI_V)<<(TIMG_T1_LOAD_HI_S)) -#define TIMG_T1_LOAD_HI_V 0xFFFFFFFF -#define TIMG_T1_LOAD_HI_S 0 - -#define TIMG_T1LOAD_REG(i) (REG_TIMG_BASE(i) + 0x0044) -/* TIMG_T1_LOAD : WO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: Write any value will trigger timer 1 time-base counter reload*/ -#define TIMG_T1_LOAD 0xFFFFFFFF -#define TIMG_T1_LOAD_M ((TIMG_T1_LOAD_V)<<(TIMG_T1_LOAD_S)) -#define TIMG_T1_LOAD_V 0xFFFFFFFF -#define TIMG_T1_LOAD_S 0 - -#define TIMG_WDTCONFIG0_REG(i) (REG_TIMG_BASE(i) + 0x0048) -/* TIMG_WDT_EN : R/W ;bitpos:[31] ;default: 1'h0 ; */ -/*description: When set SWDT is enabled*/ -#define TIMG_WDT_EN (BIT(31)) -#define TIMG_WDT_EN_M (BIT(31)) -#define TIMG_WDT_EN_V 0x1 -#define TIMG_WDT_EN_S 31 -/* TIMG_WDT_STG0 : R/W ;bitpos:[30:29] ;default: 1'd0 ; */ -/*description: Stage 0 configuration. 0: off 1: interrupt 2: reset CPU 3: reset system*/ -#define TIMG_WDT_STG0 0x00000003 -#define TIMG_WDT_STG0_M ((TIMG_WDT_STG0_V)<<(TIMG_WDT_STG0_S)) -#define TIMG_WDT_STG0_V 0x3 -#define TIMG_WDT_STG0_S 29 -/* TIMG_WDT_STG1 : R/W ;bitpos:[28:27] ;default: 1'd0 ; */ -/*description: Stage 1 configuration. 0: off 1: interrupt 2: reset CPU 3: reset system*/ -#define TIMG_WDT_STG1 0x00000003 -#define TIMG_WDT_STG1_M ((TIMG_WDT_STG1_V)<<(TIMG_WDT_STG1_S)) -#define TIMG_WDT_STG1_V 0x3 -#define TIMG_WDT_STG1_S 27 -/* TIMG_WDT_STG2 : R/W ;bitpos:[26:25] ;default: 1'd0 ; */ -/*description: Stage 2 configuration. 0: off 1: interrupt 2: reset CPU 3: reset system*/ -#define TIMG_WDT_STG2 0x00000003 -#define TIMG_WDT_STG2_M ((TIMG_WDT_STG2_V)<<(TIMG_WDT_STG2_S)) -#define TIMG_WDT_STG2_V 0x3 -#define TIMG_WDT_STG2_S 25 -/* TIMG_WDT_STG3 : R/W ;bitpos:[24:23] ;default: 1'd0 ; */ -/*description: Stage 3 configuration. 0: off 1: interrupt 2: reset CPU 3: reset system*/ -#define TIMG_WDT_STG3 0x00000003 -#define TIMG_WDT_STG3_M ((TIMG_WDT_STG3_V)<<(TIMG_WDT_STG3_S)) -#define TIMG_WDT_STG3_V 0x3 -#define TIMG_WDT_STG3_S 23 -/* TIMG_WDT_EDGE_INT_EN : R/W ;bitpos:[22] ;default: 1'h0 ; */ -/*description: When set edge type interrupt generation is enabled*/ -#define TIMG_WDT_EDGE_INT_EN (BIT(22)) -#define TIMG_WDT_EDGE_INT_EN_M (BIT(22)) -#define TIMG_WDT_EDGE_INT_EN_V 0x1 -#define TIMG_WDT_EDGE_INT_EN_S 22 -/* TIMG_WDT_LEVEL_INT_EN : R/W ;bitpos:[21] ;default: 1'h0 ; */ -/*description: When set level type interrupt generation is enabled*/ -#define TIMG_WDT_LEVEL_INT_EN (BIT(21)) -#define TIMG_WDT_LEVEL_INT_EN_M (BIT(21)) -#define TIMG_WDT_LEVEL_INT_EN_V 0x1 -#define TIMG_WDT_LEVEL_INT_EN_S 21 -/* TIMG_WDT_CPU_RESET_LENGTH : R/W ;bitpos:[20:18] ;default: 3'h1 ; */ -/*description: length of CPU reset selection. 0: 100ns 1: 200ns 2: 300ns - 3: 400ns 4: 500ns 5: 800ns 6: 1.6us 7: 3.2us*/ -#define TIMG_WDT_CPU_RESET_LENGTH 0x00000007 -#define TIMG_WDT_CPU_RESET_LENGTH_M ((TIMG_WDT_CPU_RESET_LENGTH_V)<<(TIMG_WDT_CPU_RESET_LENGTH_S)) -#define TIMG_WDT_CPU_RESET_LENGTH_V 0x7 -#define TIMG_WDT_CPU_RESET_LENGTH_S 18 -/* TIMG_WDT_SYS_RESET_LENGTH : R/W ;bitpos:[17:15] ;default: 3'h1 ; */ -/*description: length of system reset selection. 0: 100ns 1: 200ns 2: 300ns - 3: 400ns 4: 500ns 5: 800ns 6: 1.6us 7: 3.2us*/ -#define TIMG_WDT_SYS_RESET_LENGTH 0x00000007 -#define TIMG_WDT_SYS_RESET_LENGTH_M ((TIMG_WDT_SYS_RESET_LENGTH_V)<<(TIMG_WDT_SYS_RESET_LENGTH_S)) -#define TIMG_WDT_SYS_RESET_LENGTH_V 0x7 -#define TIMG_WDT_SYS_RESET_LENGTH_S 15 -/* TIMG_WDT_FLASHBOOT_MOD_EN : R/W ;bitpos:[14] ;default: 1'h1 ; */ -/*description: When set flash boot protection is enabled*/ -#define TIMG_WDT_FLASHBOOT_MOD_EN (BIT(14)) -#define TIMG_WDT_FLASHBOOT_MOD_EN_M (BIT(14)) -#define TIMG_WDT_FLASHBOOT_MOD_EN_V 0x1 -#define TIMG_WDT_FLASHBOOT_MOD_EN_S 14 - -#define TIMG_WDTCONFIG1_REG(i) (REG_TIMG_BASE(i) + 0x004c) -/* TIMG_WDT_CLK_PRESCALE : R/W ;bitpos:[31:16] ;default: 16'h1 ; */ -/*description: SWDT clock prescale value. Period = 12.5ns * value stored in this register*/ -#define TIMG_WDT_CLK_PRESCALE 0x0000FFFF -#define TIMG_WDT_CLK_PRESCALE_M ((TIMG_WDT_CLK_PRESCALE_V)<<(TIMG_WDT_CLK_PRESCALE_S)) -#define TIMG_WDT_CLK_PRESCALE_V 0xFFFF -#define TIMG_WDT_CLK_PRESCALE_S 16 - -#define TIMG_WDTCONFIG2_REG(i) (REG_TIMG_BASE(i) + 0x0050) -/* TIMG_WDT_STG0_HOLD : R/W ;bitpos:[31:0] ;default: 32'd26000000 ; */ -/*description: Stage 0 timeout value in SWDT clock cycles*/ -#define TIMG_WDT_STG0_HOLD 0xFFFFFFFF -#define TIMG_WDT_STG0_HOLD_M ((TIMG_WDT_STG0_HOLD_V)<<(TIMG_WDT_STG0_HOLD_S)) -#define TIMG_WDT_STG0_HOLD_V 0xFFFFFFFF -#define TIMG_WDT_STG0_HOLD_S 0 - -#define TIMG_WDTCONFIG3_REG(i) (REG_TIMG_BASE(i) + 0x0054) -/* TIMG_WDT_STG1_HOLD : R/W ;bitpos:[31:0] ;default: 32'h7ffffff ; */ -/*description: Stage 1 timeout value in SWDT clock cycles*/ -#define TIMG_WDT_STG1_HOLD 0xFFFFFFFF -#define TIMG_WDT_STG1_HOLD_M ((TIMG_WDT_STG1_HOLD_V)<<(TIMG_WDT_STG1_HOLD_S)) -#define TIMG_WDT_STG1_HOLD_V 0xFFFFFFFF -#define TIMG_WDT_STG1_HOLD_S 0 - -#define TIMG_WDTCONFIG4_REG(i) (REG_TIMG_BASE(i) + 0x0058) -/* TIMG_WDT_STG2_HOLD : R/W ;bitpos:[31:0] ;default: 32'hfffff ; */ -/*description: Stage 2 timeout value in SWDT clock cycles*/ -#define TIMG_WDT_STG2_HOLD 0xFFFFFFFF -#define TIMG_WDT_STG2_HOLD_M ((TIMG_WDT_STG2_HOLD_V)<<(TIMG_WDT_STG2_HOLD_S)) -#define TIMG_WDT_STG2_HOLD_V 0xFFFFFFFF -#define TIMG_WDT_STG2_HOLD_S 0 - -#define TIMG_WDTCONFIG5_REG(i) (REG_TIMG_BASE(i) + 0x005c) -/* TIMG_WDT_STG3_HOLD : R/W ;bitpos:[31:0] ;default: 32'hfffff ; */ -/*description: Stage 3 timeout value in SWDT clock cycles*/ -#define TIMG_WDT_STG3_HOLD 0xFFFFFFFF -#define TIMG_WDT_STG3_HOLD_M ((TIMG_WDT_STG3_HOLD_V)<<(TIMG_WDT_STG3_HOLD_S)) -#define TIMG_WDT_STG3_HOLD_V 0xFFFFFFFF -#define TIMG_WDT_STG3_HOLD_S 0 - -#define TIMG_WDTFEED_REG(i) (REG_TIMG_BASE(i) + 0x0060) -/* TIMG_WDT_FEED : WO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: Write any value will feed SWDT*/ -#define TIMG_WDT_FEED 0xFFFFFFFF -#define TIMG_WDT_FEED_M ((TIMG_WDT_FEED_V)<<(TIMG_WDT_FEED_S)) -#define TIMG_WDT_FEED_V 0xFFFFFFFF -#define TIMG_WDT_FEED_S 0 - -#define TIMG_WDTWPROTECT_REG(i) (REG_TIMG_BASE(i) + 0x0064) -/* TIMG_WDT_WKEY : R/W ;bitpos:[31:0] ;default: 32'h50d83aa1 ; */ -/*description: If change its value from default then write protection is on.*/ -#define TIMG_WDT_WKEY 0xFFFFFFFF -#define TIMG_WDT_WKEY_M ((TIMG_WDT_WKEY_V)<<(TIMG_WDT_WKEY_S)) -#define TIMG_WDT_WKEY_V 0xFFFFFFFF -#define TIMG_WDT_WKEY_S 0 - -#define TIMG_RTCCALICFG_REG(i) (REG_TIMG_BASE(i) + 0x0068) -/* TIMG_RTC_CALI_START : R/W ;bitpos:[31] ;default: 1'h0 ; */ -/*description: */ -#define TIMG_RTC_CALI_START (BIT(31)) -#define TIMG_RTC_CALI_START_M (BIT(31)) -#define TIMG_RTC_CALI_START_V 0x1 -#define TIMG_RTC_CALI_START_S 31 -/* TIMG_RTC_CALI_MAX : R/W ;bitpos:[30:16] ;default: 15'h1 ; */ -/*description: */ -#define TIMG_RTC_CALI_MAX 0x00007FFF -#define TIMG_RTC_CALI_MAX_M ((TIMG_RTC_CALI_MAX_V)<<(TIMG_RTC_CALI_MAX_S)) -#define TIMG_RTC_CALI_MAX_V 0x7FFF -#define TIMG_RTC_CALI_MAX_S 16 -/* TIMG_RTC_CALI_RDY : RO ;bitpos:[15] ;default: 1'h0 ; */ -/*description: */ -#define TIMG_RTC_CALI_RDY (BIT(15)) -#define TIMG_RTC_CALI_RDY_M (BIT(15)) -#define TIMG_RTC_CALI_RDY_V 0x1 -#define TIMG_RTC_CALI_RDY_S 15 -/* TIMG_RTC_CALI_CLK_SEL : R/W ;bitpos:[14:13] ;default: 2'h1 ; */ -/*description: */ -#define TIMG_RTC_CALI_CLK_SEL 0x00000003 -#define TIMG_RTC_CALI_CLK_SEL_M ((TIMG_RTC_CALI_CLK_SEL_V)<<(TIMG_RTC_CALI_CLK_SEL_S)) -#define TIMG_RTC_CALI_CLK_SEL_V 0x3 -#define TIMG_RTC_CALI_CLK_SEL_S 13 -/* TIMG_RTC_CALI_START_CYCLING : R/W ;bitpos:[12] ;default: 1'd1 ; */ -/*description: */ -#define TIMG_RTC_CALI_START_CYCLING (BIT(12)) -#define TIMG_RTC_CALI_START_CYCLING_M (BIT(12)) -#define TIMG_RTC_CALI_START_CYCLING_V 0x1 -#define TIMG_RTC_CALI_START_CYCLING_S 12 - -#define TIMG_RTCCALICFG1_REG(i) (REG_TIMG_BASE(i) + 0x006c) -/* TIMG_RTC_CALI_VALUE : RO ;bitpos:[31:7] ;default: 25'h0 ; */ -/*description: */ -#define TIMG_RTC_CALI_VALUE 0x01FFFFFF -#define TIMG_RTC_CALI_VALUE_M ((TIMG_RTC_CALI_VALUE_V)<<(TIMG_RTC_CALI_VALUE_S)) -#define TIMG_RTC_CALI_VALUE_V 0x1FFFFFF -#define TIMG_RTC_CALI_VALUE_S 7 - -#define TIMG_LACTCONFIG_REG(i) (REG_TIMG_BASE(i) + 0x0070) -/* TIMG_LACT_EN : R/W ;bitpos:[31] ;default: 1'h0 ; */ -/*description: */ -#define TIMG_LACT_EN (BIT(31)) -#define TIMG_LACT_EN_M (BIT(31)) -#define TIMG_LACT_EN_V 0x1 -#define TIMG_LACT_EN_S 31 -/* TIMG_LACT_INCREASE : R/W ;bitpos:[30] ;default: 1'h1 ; */ -/*description: */ -#define TIMG_LACT_INCREASE (BIT(30)) -#define TIMG_LACT_INCREASE_M (BIT(30)) -#define TIMG_LACT_INCREASE_V 0x1 -#define TIMG_LACT_INCREASE_S 30 -/* TIMG_LACT_AUTORELOAD : R/W ;bitpos:[29] ;default: 1'h1 ; */ -/*description: */ -#define TIMG_LACT_AUTORELOAD (BIT(29)) -#define TIMG_LACT_AUTORELOAD_M (BIT(29)) -#define TIMG_LACT_AUTORELOAD_V 0x1 -#define TIMG_LACT_AUTORELOAD_S 29 -/* TIMG_LACT_DIVIDER : R/W ;bitpos:[28:13] ;default: 16'h1 ; */ -/*description: */ -#define TIMG_LACT_DIVIDER 0x0000FFFF -#define TIMG_LACT_DIVIDER_M ((TIMG_LACT_DIVIDER_V)<<(TIMG_LACT_DIVIDER_S)) -#define TIMG_LACT_DIVIDER_V 0xFFFF -#define TIMG_LACT_DIVIDER_S 13 -/* TIMG_LACT_EDGE_INT_EN : R/W ;bitpos:[12] ;default: 1'h0 ; */ -/*description: */ -#define TIMG_LACT_EDGE_INT_EN (BIT(12)) -#define TIMG_LACT_EDGE_INT_EN_M (BIT(12)) -#define TIMG_LACT_EDGE_INT_EN_V 0x1 -#define TIMG_LACT_EDGE_INT_EN_S 12 -/* TIMG_LACT_LEVEL_INT_EN : R/W ;bitpos:[11] ;default: 1'h0 ; */ -/*description: */ -#define TIMG_LACT_LEVEL_INT_EN (BIT(11)) -#define TIMG_LACT_LEVEL_INT_EN_M (BIT(11)) -#define TIMG_LACT_LEVEL_INT_EN_V 0x1 -#define TIMG_LACT_LEVEL_INT_EN_S 11 -/* TIMG_LACT_ALARM_EN : R/W ;bitpos:[10] ;default: 1'h0 ; */ -/*description: */ -#define TIMG_LACT_ALARM_EN (BIT(10)) -#define TIMG_LACT_ALARM_EN_M (BIT(10)) -#define TIMG_LACT_ALARM_EN_V 0x1 -#define TIMG_LACT_ALARM_EN_S 10 -/* TIMG_LACT_LAC_EN : R/W ;bitpos:[9] ;default: 1'h1 ; */ -/*description: */ -#define TIMG_LACT_LAC_EN (BIT(9)) -#define TIMG_LACT_LAC_EN_M (BIT(9)) -#define TIMG_LACT_LAC_EN_V 0x1 -#define TIMG_LACT_LAC_EN_S 9 -/* TIMG_LACT_CPST_EN : R/W ;bitpos:[8] ;default: 1'h1 ; */ -/*description: */ -#define TIMG_LACT_CPST_EN (BIT(8)) -#define TIMG_LACT_CPST_EN_M (BIT(8)) -#define TIMG_LACT_CPST_EN_V 0x1 -#define TIMG_LACT_CPST_EN_S 8 -/* TIMG_LACT_RTC_ONLY : R/W ;bitpos:[7] ;default: 1'h0 ; */ -/*description: */ -#define TIMG_LACT_RTC_ONLY (BIT(7)) -#define TIMG_LACT_RTC_ONLY_M (BIT(7)) -#define TIMG_LACT_RTC_ONLY_V 0x1 -#define TIMG_LACT_RTC_ONLY_S 7 - -#define TIMG_LACTRTC_REG(i) (REG_TIMG_BASE(i) + 0x0074) -/* TIMG_LACT_RTC_STEP_LEN : R/W ;bitpos:[31:6] ;default: 26'h0 ; */ -/*description: */ -#define TIMG_LACT_RTC_STEP_LEN 0x03FFFFFF -#define TIMG_LACT_RTC_STEP_LEN_M ((TIMG_LACT_RTC_STEP_LEN_V)<<(TIMG_LACT_RTC_STEP_LEN_S)) -#define TIMG_LACT_RTC_STEP_LEN_V 0x3FFFFFF -#define TIMG_LACT_RTC_STEP_LEN_S 6 - -#define TIMG_LACTLO_REG(i) (REG_TIMG_BASE(i) + 0x0078) -/* TIMG_LACT_LO : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define TIMG_LACT_LO 0xFFFFFFFF -#define TIMG_LACT_LO_M ((TIMG_LACT_LO_V)<<(TIMG_LACT_LO_S)) -#define TIMG_LACT_LO_V 0xFFFFFFFF -#define TIMG_LACT_LO_S 0 - -#define TIMG_LACTHI_REG(i) (REG_TIMG_BASE(i) + 0x007c) -/* TIMG_LACT_HI : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define TIMG_LACT_HI 0xFFFFFFFF -#define TIMG_LACT_HI_M ((TIMG_LACT_HI_V)<<(TIMG_LACT_HI_S)) -#define TIMG_LACT_HI_V 0xFFFFFFFF -#define TIMG_LACT_HI_S 0 - -#define TIMG_LACTUPDATE_REG(i) (REG_TIMG_BASE(i) + 0x0080) -/* TIMG_LACT_UPDATE : WO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define TIMG_LACT_UPDATE 0xFFFFFFFF -#define TIMG_LACT_UPDATE_M ((TIMG_LACT_UPDATE_V)<<(TIMG_LACT_UPDATE_S)) -#define TIMG_LACT_UPDATE_V 0xFFFFFFFF -#define TIMG_LACT_UPDATE_S 0 - -#define TIMG_LACTALARMLO_REG(i) (REG_TIMG_BASE(i) + 0x0084) -/* TIMG_LACT_ALARM_LO : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define TIMG_LACT_ALARM_LO 0xFFFFFFFF -#define TIMG_LACT_ALARM_LO_M ((TIMG_LACT_ALARM_LO_V)<<(TIMG_LACT_ALARM_LO_S)) -#define TIMG_LACT_ALARM_LO_V 0xFFFFFFFF -#define TIMG_LACT_ALARM_LO_S 0 - -#define TIMG_LACTALARMHI_REG(i) (REG_TIMG_BASE(i) + 0x0088) -/* TIMG_LACT_ALARM_HI : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define TIMG_LACT_ALARM_HI 0xFFFFFFFF -#define TIMG_LACT_ALARM_HI_M ((TIMG_LACT_ALARM_HI_V)<<(TIMG_LACT_ALARM_HI_S)) -#define TIMG_LACT_ALARM_HI_V 0xFFFFFFFF -#define TIMG_LACT_ALARM_HI_S 0 - -#define TIMG_LACTLOADLO_REG(i) (REG_TIMG_BASE(i) + 0x008c) -/* TIMG_LACT_LOAD_LO : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define TIMG_LACT_LOAD_LO 0xFFFFFFFF -#define TIMG_LACT_LOAD_LO_M ((TIMG_LACT_LOAD_LO_V)<<(TIMG_LACT_LOAD_LO_S)) -#define TIMG_LACT_LOAD_LO_V 0xFFFFFFFF -#define TIMG_LACT_LOAD_LO_S 0 - -#define TIMG_LACTLOADHI_REG(i) (REG_TIMG_BASE(i) + 0x0090) -/* TIMG_LACT_LOAD_HI : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define TIMG_LACT_LOAD_HI 0xFFFFFFFF -#define TIMG_LACT_LOAD_HI_M ((TIMG_LACT_LOAD_HI_V)<<(TIMG_LACT_LOAD_HI_S)) -#define TIMG_LACT_LOAD_HI_V 0xFFFFFFFF -#define TIMG_LACT_LOAD_HI_S 0 - -#define TIMG_LACTLOAD_REG(i) (REG_TIMG_BASE(i) + 0x0094) -/* TIMG_LACT_LOAD : WO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define TIMG_LACT_LOAD 0xFFFFFFFF -#define TIMG_LACT_LOAD_M ((TIMG_LACT_LOAD_V)<<(TIMG_LACT_LOAD_S)) -#define TIMG_LACT_LOAD_V 0xFFFFFFFF -#define TIMG_LACT_LOAD_S 0 - -#define TIMG_INT_ENA_TIMERS_REG(i) (REG_TIMG_BASE(i) + 0x0098) -/* TIMG_LACT_INT_ENA : R/W ;bitpos:[3] ;default: 1'h0 ; */ -/*description: */ -#define TIMG_LACT_INT_ENA (BIT(3)) -#define TIMG_LACT_INT_ENA_M (BIT(3)) -#define TIMG_LACT_INT_ENA_V 0x1 -#define TIMG_LACT_INT_ENA_S 3 -/* TIMG_WDT_INT_ENA : R/W ;bitpos:[2] ;default: 1'h0 ; */ -/*description: Interrupt when an interrupt stage timeout*/ -#define TIMG_WDT_INT_ENA (BIT(2)) -#define TIMG_WDT_INT_ENA_M (BIT(2)) -#define TIMG_WDT_INT_ENA_V 0x1 -#define TIMG_WDT_INT_ENA_S 2 -/* TIMG_T1_INT_ENA : R/W ;bitpos:[1] ;default: 1'h0 ; */ -/*description: interrupt when timer1 alarm*/ -#define TIMG_T1_INT_ENA (BIT(1)) -#define TIMG_T1_INT_ENA_M (BIT(1)) -#define TIMG_T1_INT_ENA_V 0x1 -#define TIMG_T1_INT_ENA_S 1 -/* TIMG_T0_INT_ENA : R/W ;bitpos:[0] ;default: 1'h0 ; */ -/*description: interrupt when timer0 alarm*/ -#define TIMG_T0_INT_ENA (BIT(0)) -#define TIMG_T0_INT_ENA_M (BIT(0)) -#define TIMG_T0_INT_ENA_V 0x1 -#define TIMG_T0_INT_ENA_S 0 - -#define TIMG_INT_RAW_TIMERS_REG(i) (REG_TIMG_BASE(i) + 0x009c) -/* TIMG_LACT_INT_RAW : RO ;bitpos:[3] ;default: 1'h0 ; */ -/*description: */ -#define TIMG_LACT_INT_RAW (BIT(3)) -#define TIMG_LACT_INT_RAW_M (BIT(3)) -#define TIMG_LACT_INT_RAW_V 0x1 -#define TIMG_LACT_INT_RAW_S 3 -/* TIMG_WDT_INT_RAW : RO ;bitpos:[2] ;default: 1'h0 ; */ -/*description: Interrupt when an interrupt stage timeout*/ -#define TIMG_WDT_INT_RAW (BIT(2)) -#define TIMG_WDT_INT_RAW_M (BIT(2)) -#define TIMG_WDT_INT_RAW_V 0x1 -#define TIMG_WDT_INT_RAW_S 2 -/* TIMG_T1_INT_RAW : RO ;bitpos:[1] ;default: 1'h0 ; */ -/*description: interrupt when timer1 alarm*/ -#define TIMG_T1_INT_RAW (BIT(1)) -#define TIMG_T1_INT_RAW_M (BIT(1)) -#define TIMG_T1_INT_RAW_V 0x1 -#define TIMG_T1_INT_RAW_S 1 -/* TIMG_T0_INT_RAW : RO ;bitpos:[0] ;default: 1'h0 ; */ -/*description: interrupt when timer0 alarm*/ -#define TIMG_T0_INT_RAW (BIT(0)) -#define TIMG_T0_INT_RAW_M (BIT(0)) -#define TIMG_T0_INT_RAW_V 0x1 -#define TIMG_T0_INT_RAW_S 0 - -#define TIMG_INT_ST_TIMERS_REG(i) (REG_TIMG_BASE(i) + 0x00a0) -/* TIMG_LACT_INT_ST : RO ;bitpos:[3] ;default: 1'h0 ; */ -/*description: */ -#define TIMG_LACT_INT_ST (BIT(3)) -#define TIMG_LACT_INT_ST_M (BIT(3)) -#define TIMG_LACT_INT_ST_V 0x1 -#define TIMG_LACT_INT_ST_S 3 -/* TIMG_WDT_INT_ST : RO ;bitpos:[2] ;default: 1'h0 ; */ -/*description: Interrupt when an interrupt stage timeout*/ -#define TIMG_WDT_INT_ST (BIT(2)) -#define TIMG_WDT_INT_ST_M (BIT(2)) -#define TIMG_WDT_INT_ST_V 0x1 -#define TIMG_WDT_INT_ST_S 2 -/* TIMG_T1_INT_ST : RO ;bitpos:[1] ;default: 1'h0 ; */ -/*description: interrupt when timer1 alarm*/ -#define TIMG_T1_INT_ST (BIT(1)) -#define TIMG_T1_INT_ST_M (BIT(1)) -#define TIMG_T1_INT_ST_V 0x1 -#define TIMG_T1_INT_ST_S 1 -/* TIMG_T0_INT_ST : RO ;bitpos:[0] ;default: 1'h0 ; */ -/*description: interrupt when timer0 alarm*/ -#define TIMG_T0_INT_ST (BIT(0)) -#define TIMG_T0_INT_ST_M (BIT(0)) -#define TIMG_T0_INT_ST_V 0x1 -#define TIMG_T0_INT_ST_S 0 - -#define TIMG_INT_CLR_TIMERS_REG(i) (REG_TIMG_BASE(i) + 0x00a4) -/* TIMG_LACT_INT_CLR : WO ;bitpos:[3] ;default: 1'h0 ; */ -/*description: */ -#define TIMG_LACT_INT_CLR (BIT(3)) -#define TIMG_LACT_INT_CLR_M (BIT(3)) -#define TIMG_LACT_INT_CLR_V 0x1 -#define TIMG_LACT_INT_CLR_S 3 -/* TIMG_WDT_INT_CLR : WO ;bitpos:[2] ;default: 1'h0 ; */ -/*description: Interrupt when an interrupt stage timeout*/ -#define TIMG_WDT_INT_CLR (BIT(2)) -#define TIMG_WDT_INT_CLR_M (BIT(2)) -#define TIMG_WDT_INT_CLR_V 0x1 -#define TIMG_WDT_INT_CLR_S 2 -/* TIMG_T1_INT_CLR : WO ;bitpos:[1] ;default: 1'h0 ; */ -/*description: interrupt when timer1 alarm*/ -#define TIMG_T1_INT_CLR (BIT(1)) -#define TIMG_T1_INT_CLR_M (BIT(1)) -#define TIMG_T1_INT_CLR_V 0x1 -#define TIMG_T1_INT_CLR_S 1 -/* TIMG_T0_INT_CLR : WO ;bitpos:[0] ;default: 1'h0 ; */ -/*description: interrupt when timer0 alarm*/ -#define TIMG_T0_INT_CLR (BIT(0)) -#define TIMG_T0_INT_CLR_M (BIT(0)) -#define TIMG_T0_INT_CLR_V 0x1 -#define TIMG_T0_INT_CLR_S 0 - -#define TIMG_NTIMERS_DATE_REG(i) (REG_TIMG_BASE(i) + 0x00f8) -/* TIMG_NTIMERS_DATE : R/W ;bitpos:[27:0] ;default: 28'h1604290 ; */ -/*description: Version of this regfile*/ -#define TIMG_NTIMERS_DATE 0x0FFFFFFF -#define TIMG_NTIMERS_DATE_M ((TIMG_NTIMERS_DATE_V)<<(TIMG_NTIMERS_DATE_S)) -#define TIMG_NTIMERS_DATE_V 0xFFFFFFF -#define TIMG_NTIMERS_DATE_S 0 - -#define TIMGCLK_REG(i) (REG_TIMG_BASE(i) + 0x00fc) -/* TIMG_CLK_EN : R/W ;bitpos:[31] ;default: 1'h0 ; */ -/*description: Force clock enable for this regfile*/ -#define TIMG_CLK_EN (BIT(31)) -#define TIMG_CLK_EN_M (BIT(31)) -#define TIMG_CLK_EN_V 0x1 -#define TIMG_CLK_EN_S 31 - - - - -#endif /*__TIMG_REG_H__ */ - - diff --git a/tools/sdk/include/soc/soc/timer_group_struct.h b/tools/sdk/include/soc/soc/timer_group_struct.h deleted file mode 100644 index da9acd0c7a0..00000000000 --- a/tools/sdk/include/soc/soc/timer_group_struct.h +++ /dev/null @@ -1,205 +0,0 @@ -// 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. -#ifndef _SOC_TIMG_STRUCT_H_ -#define _SOC_TIMG_STRUCT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef volatile struct { - 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[2]; - union { - struct { - uint32_t reserved0: 14; - uint32_t flashboot_mod_en: 1; /*When set flash boot protection is enabled*/ - uint32_t sys_reset_length: 3; /*length of system reset selection. 0: 100ns 1: 200ns 2: 300ns 3: 400ns 4: 500ns 5: 800ns 6: 1.6us 7: 3.2us*/ - uint32_t cpu_reset_length: 3; /*length of CPU reset selection. 0: 100ns 1: 200ns 2: 300ns 3: 400ns 4: 500ns 5: 800ns 6: 1.6us 7: 3.2us*/ - uint32_t level_int_en: 1; /*When set level type interrupt generation is enabled*/ - uint32_t edge_int_en: 1; /*When set edge type interrupt generation is enabled*/ - uint32_t stg3: 2; /*Stage 3 configuration. 0: off 1: interrupt 2: reset CPU 3: reset system*/ - uint32_t stg2: 2; /*Stage 2 configuration. 0: off 1: interrupt 2: reset CPU 3: reset system*/ - uint32_t stg1: 2; /*Stage 1 configuration. 0: off 1: interrupt 2: reset CPU 3: reset system*/ - uint32_t stg0: 2; /*Stage 0 configuration. 0: off 1: interrupt 2: reset CPU 3: reset system*/ - uint32_t en: 1; /*When set SWDT is enabled*/ - }; - uint32_t val; - } wdt_config0; - union { - struct { - uint32_t reserved0: 16; - uint32_t clk_prescale:16; /*SWDT clock prescale value. Period = 12.5ns * value stored in this register*/ - }; - uint32_t val; - } wdt_config1; - uint32_t wdt_config2; /*Stage 0 timeout value in SWDT clock cycles*/ - uint32_t wdt_config3; /*Stage 1 timeout value in SWDT clock cycles*/ - uint32_t wdt_config4; /*Stage 2 timeout value in SWDT clock cycles*/ - uint32_t wdt_config5; /*Stage 3 timeout value in SWDT clock cycles*/ - uint32_t wdt_feed; /*Write any value will feed SWDT*/ - uint32_t wdt_wprotect; /*If change its value from default then write protection is on.*/ - union { - struct { - uint32_t reserved0: 12; - uint32_t start_cycling: 1; - uint32_t clk_sel: 2; - uint32_t rdy: 1; - uint32_t max: 15; - uint32_t start: 1; - }; - uint32_t val; - } rtc_cali_cfg; - union { - struct { - uint32_t reserved0: 7; - uint32_t value:25; - }; - uint32_t val; - } rtc_cali_cfg1; - union { - struct { - uint32_t reserved0: 7; - uint32_t rtc_only: 1; - uint32_t cpst_en: 1; - uint32_t lac_en: 1; - uint32_t alarm_en: 1; - uint32_t level_int_en: 1; - uint32_t edge_int_en: 1; - uint32_t divider: 16; - uint32_t autoreload: 1; - uint32_t increase: 1; - uint32_t en: 1; - }; - uint32_t val; - } lactconfig; - union { - struct { - uint32_t reserved0: 6; - uint32_t step_len:26; - }; - uint32_t val; - } lactrtc; - uint32_t lactlo; /**/ - uint32_t lacthi; /**/ - uint32_t lactupdate; /**/ - uint32_t lactalarmlo; /**/ - uint32_t lactalarmhi; /**/ - uint32_t lactloadlo; /**/ - uint32_t lactloadhi; /**/ - uint32_t lactload; /**/ - union { - struct { - uint32_t t0: 1; /*interrupt when timer0 alarm*/ - uint32_t t1: 1; /*interrupt when timer1 alarm*/ - uint32_t wdt: 1; /*Interrupt when an interrupt stage timeout*/ - uint32_t lact: 1; - uint32_t reserved4: 28; - }; - uint32_t val; - } int_ena; - union { - struct { - uint32_t t0: 1; /*interrupt when timer0 alarm*/ - uint32_t t1: 1; /*interrupt when timer1 alarm*/ - uint32_t wdt: 1; /*Interrupt when an interrupt stage timeout*/ - uint32_t lact: 1; - uint32_t reserved4:28; - }; - uint32_t val; - } int_raw; - union { - struct { - uint32_t t0: 1; /*interrupt when timer0 alarm*/ - uint32_t t1: 1; /*interrupt when timer1 alarm*/ - uint32_t wdt: 1; /*Interrupt when an interrupt stage timeout*/ - uint32_t lact: 1; - uint32_t reserved4: 28; - }; - uint32_t val; - } int_st_timers; - union { - struct { - uint32_t t0: 1; /*interrupt when timer0 alarm*/ - uint32_t t1: 1; /*interrupt when timer1 alarm*/ - uint32_t wdt: 1; /*Interrupt when an interrupt stage timeout*/ - uint32_t lact: 1; - uint32_t reserved4: 28; - }; - uint32_t val; - } int_clr_timers; - uint32_t reserved_a8; - uint32_t reserved_ac; - uint32_t reserved_b0; - uint32_t reserved_b4; - uint32_t reserved_b8; - uint32_t reserved_bc; - uint32_t reserved_c0; - uint32_t reserved_c4; - uint32_t reserved_c8; - uint32_t reserved_cc; - uint32_t reserved_d0; - uint32_t reserved_d4; - uint32_t reserved_d8; - uint32_t reserved_dc; - uint32_t reserved_e0; - uint32_t reserved_e4; - uint32_t reserved_e8; - uint32_t reserved_ec; - uint32_t reserved_f0; - uint32_t reserved_f4; - union { - struct { - uint32_t date:28; /*Version of this regfile*/ - uint32_t reserved28: 4; - }; - uint32_t val; - } timg_date; - union { - struct { - uint32_t reserved0: 31; - uint32_t en: 1; /*Force clock enable for this regfile*/ - }; - uint32_t val; - } clk; -} timg_dev_t; -extern timg_dev_t TIMERG0; -extern timg_dev_t TIMERG1; - -#ifdef __cplusplus -} -#endif - -#endif /* _SOC_TIMG_STRUCT_H_ */ diff --git a/tools/sdk/include/soc/soc/touch_channel.h b/tools/sdk/include/soc/soc/touch_channel.h deleted file mode 100644 index a9aa838b4e0..00000000000 --- a/tools/sdk/include/soc/soc/touch_channel.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2010-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. - -#ifndef _SOC_TOUCH_CHANNEL_H -#define _SOC_TOUCH_CHANNEL_H - -//Touch channels -#define TOUCH_PAD_GPIO4_CHANNEL TOUCH_PAD_NUM0 -#define TOUCH_PAD_NUM0_GPIO_NUM 4 - -#define TOUCH_PAD_GPIO0_CHANNEL TOUCH_PAD_NUM1 -#define TOUCH_PAD_NUM1_GPIO_NUM 0 - -#define TOUCH_PAD_GPIO2_CHANNEL TOUCH_PAD_NUM2 -#define TOUCH_PAD_NUM2_GPIO_NUM 2 - -#define TOUCH_PAD_GPIO15_CHANNEL TOUCH_PAD_NUM3 -#define TOUCH_PAD_NUM3_GPIO_NUM 15 - -#define TOUCH_PAD_GPIO13_CHANNEL TOUCH_PAD_NUM4 -#define TOUCH_PAD_NUM4_GPIO_NUM 13 - -#define TOUCH_PAD_GPIO12_CHANNEL TOUCH_PAD_NUM5 -#define TOUCH_PAD_NUM5_GPIO_NUM 12 - -#define TOUCH_PAD_GPIO14_CHANNEL TOUCH_PAD_NUM6 -#define TOUCH_PAD_NUM6_GPIO_NUM 14 - -#define TOUCH_PAD_GPIO27_CHANNEL TOUCH_PAD_NUM7 -#define TOUCH_PAD_NUM7_GPIO_NUM 27 - -#define TOUCH_PAD_GPIO33_CHANNEL TOUCH_PAD_NUM8 -#define TOUCH_PAD_NUM8_GPIO_NUM 33 - -#define TOUCH_PAD_GPIO32_CHANNEL TOUCH_PAD_NUM9 -#define TOUCH_PAD_NUM9_GPIO_NUM 32 - -#endif diff --git a/tools/sdk/include/soc/soc/uart_channel.h b/tools/sdk/include/soc/soc/uart_channel.h deleted file mode 100644 index 5b8dc56d5ae..00000000000 --- a/tools/sdk/include/soc/soc/uart_channel.h +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2010-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. - -#ifndef _SOC_UART_CHANNEL_H -#define _SOC_UART_CHANNEL_H - -//UART channels -#define UART_GPIO1_DIRECT_CHANNEL UART_NUM_0 -#define UART_NUM_0_TXD_DIRECT_GPIO_NUM 1 -#define UART_GPIO3_DIRECT_CHANNEL UART_NUM_0 -#define UART_NUM_0_RXD_DIRECT_GPIO_NUM 3 -#define UART_GPIO19_DIRECT_CHANNEL UART_NUM_0 -#define UART_NUM_0_CTS_DIRECT_GPIO_NUM 19 -#define UART_GPIO22_DIRECT_CHANNEL UART_NUM_0 -#define UART_NUM_0_RTS_DIRECT_GPIO_NUM 22 - -#define UART_TXD_GPIO1_DIRECT_CHANNEL UART_GPIO1_DIRECT_CHANNEL -#define UART_RXD_GPIO3_DIRECT_CHANNEL UART_GPIO3_DIRECT_CHANNEL -#define UART_CTS_GPIO19_DIRECT_CHANNEL UART_GPIO19_DIRECT_CHANNEL -#define UART_RTS_GPIO22_DIRECT_CHANNEL UART_GPIO22_DIRECT_CHANNEL - -#define UART_GPIO10_DIRECT_CHANNEL UART_NUM_1 -#define UART_NUM_1_TXD_DIRECT_GPIO_NUM 10 -#define UART_GPIO9_DIRECT_CHANNEL UART_NUM_1 -#define UART_NUM_1_RXD_DIRECT_GPIO_NUM 9 -#define UART_GPIO6_DIRECT_CHANNEL UART_NUM_1 -#define UART_NUM_1_CTS_DIRECT_GPIO_NUM 6 -#define UART_GPIO11_DIRECT_CHANNEL UART_NUM_1 -#define UART_NUM_1_RTS_DIRECT_GPIO_NUM 11 - -#define UART_TXD_GPIO10_DIRECT_CHANNEL UART_GPIO10_DIRECT_CHANNEL -#define UART_RXD_GPIO9_DIRECT_CHANNEL UART_GPIO9_DIRECT_CHANNEL -#define UART_CTS_GPIO6_DIRECT_CHANNEL UART_GPIO6_DIRECT_CHANNEL -#define UART_RTS_GPIO11_DIRECT_CHANNEL UART_GPIO11_DIRECT_CHANNEL - -#define UART_GPIO17_DIRECT_CHANNEL UART_NUM_2 -#define UART_NUM_2_TXD_DIRECT_GPIO_NUM 17 -#define UART_GPIO16_DIRECT_CHANNEL UART_NUM_2 -#define UART_NUM_2_RXD_DIRECT_GPIO_NUM 16 -#define UART_GPIO8_DIRECT_CHANNEL UART_NUM_2 -#define UART_NUM_2_CTS_DIRECT_GPIO_NUM 8 -#define UART_GPIO7_DIRECT_CHANNEL UART_NUM_2 -#define UART_NUM_2_RTS_DIRECT_GPIO_NUM 7 - -#define UART_TXD_GPIO17_DIRECT_CHANNEL UART_GPIO17_DIRECT_CHANNEL -#define UART_RXD_GPIO16_DIRECT_CHANNEL UART_GPIO16_DIRECT_CHANNEL -#define UART_CTS_GPIO8_DIRECT_CHANNEL UART_GPIO8_DIRECT_CHANNEL -#define UART_RTS_GPIO7_DIRECT_CHANNEL UART_GPIO7_DIRECT_CHANNEL - -#endif diff --git a/tools/sdk/include/soc/soc/uart_reg.h b/tools/sdk/include/soc/soc/uart_reg.h deleted file mode 100644 index 33b6e998edf..00000000000 --- a/tools/sdk/include/soc/soc/uart_reg.h +++ /dev/null @@ -1,1180 +0,0 @@ -// 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. -#ifndef __UART_REG_H__ -#define __UART_REG_H__ - - -#include "soc.h" - -#define REG_UART_BASE( i ) (DR_REG_UART_BASE + (i) * 0x10000 + ( (i) > 1 ? 0xe000 : 0 ) ) -#define REG_UART_AHB_BASE(i) (0x60000000 + (i) * 0x10000 + ( (i) > 1 ? 0xe000 : 0 ) ) -#define UART_FIFO_AHB_REG(i) (REG_UART_AHB_BASE(i) + 0x0) -#define UART_FIFO_REG(i) (REG_UART_BASE(i) + 0x0) - -/* UART_RXFIFO_RD_BYTE : RO ;bitpos:[7:0] ;default: 8'b0 ; */ -/*description: This register stores one byte data read by rx fifo.*/ -#define UART_RXFIFO_RD_BYTE 0x000000FF -#define UART_RXFIFO_RD_BYTE_M ((UART_RXFIFO_RD_BYTE_V)<<(UART_RXFIFO_RD_BYTE_S)) -#define UART_RXFIFO_RD_BYTE_V 0xFF -#define UART_RXFIFO_RD_BYTE_S 0 - -#define UART_INT_RAW_REG(i) (REG_UART_BASE(i) + 0x4) -/* UART_AT_CMD_CHAR_DET_INT_RAW : RO ;bitpos:[18] ;default: 1'b0 ; */ -/*description: This interrupt raw bit turns to high level when receiver detects - the configured at_cmd chars.*/ -#define UART_AT_CMD_CHAR_DET_INT_RAW (BIT(18)) -#define UART_AT_CMD_CHAR_DET_INT_RAW_M (BIT(18)) -#define UART_AT_CMD_CHAR_DET_INT_RAW_V 0x1 -#define UART_AT_CMD_CHAR_DET_INT_RAW_S 18 -/* UART_RS485_CLASH_INT_RAW : RO ;bitpos:[17] ;default: 1'b0 ; */ -/*description: This interrupt raw bit turns to high level when rs485 detects - the clash between transmitter and receiver.*/ -#define UART_RS485_CLASH_INT_RAW (BIT(17)) -#define UART_RS485_CLASH_INT_RAW_M (BIT(17)) -#define UART_RS485_CLASH_INT_RAW_V 0x1 -#define UART_RS485_CLASH_INT_RAW_S 17 -/* UART_RS485_FRM_ERR_INT_RAW : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: This interrupt raw bit turns to high level when rs485 detects - the data frame error.*/ -#define UART_RS485_FRM_ERR_INT_RAW (BIT(16)) -#define UART_RS485_FRM_ERR_INT_RAW_M (BIT(16)) -#define UART_RS485_FRM_ERR_INT_RAW_V 0x1 -#define UART_RS485_FRM_ERR_INT_RAW_S 16 -/* UART_RS485_PARITY_ERR_INT_RAW : RO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: This interrupt raw bit turns to high level when rs485 detects the parity error.*/ -#define UART_RS485_PARITY_ERR_INT_RAW (BIT(15)) -#define UART_RS485_PARITY_ERR_INT_RAW_M (BIT(15)) -#define UART_RS485_PARITY_ERR_INT_RAW_V 0x1 -#define UART_RS485_PARITY_ERR_INT_RAW_S 15 -/* UART_TX_DONE_INT_RAW : RO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: This interrupt raw bit turns to high level when transmitter has - send all the data in fifo.*/ -#define UART_TX_DONE_INT_RAW (BIT(14)) -#define UART_TX_DONE_INT_RAW_M (BIT(14)) -#define UART_TX_DONE_INT_RAW_V 0x1 -#define UART_TX_DONE_INT_RAW_S 14 -/* UART_TX_BRK_IDLE_DONE_INT_RAW : RO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: This interrupt raw bit turns to high level when transmitter has - kept the shortest duration after the last data has been send.*/ -#define UART_TX_BRK_IDLE_DONE_INT_RAW (BIT(13)) -#define UART_TX_BRK_IDLE_DONE_INT_RAW_M (BIT(13)) -#define UART_TX_BRK_IDLE_DONE_INT_RAW_V 0x1 -#define UART_TX_BRK_IDLE_DONE_INT_RAW_S 13 -/* UART_TX_BRK_DONE_INT_RAW : RO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: This interrupt raw bit turns to high level when transmitter completes - sendding 0 after all the datas in transmitter's fifo are send.*/ -#define UART_TX_BRK_DONE_INT_RAW (BIT(12)) -#define UART_TX_BRK_DONE_INT_RAW_M (BIT(12)) -#define UART_TX_BRK_DONE_INT_RAW_V 0x1 -#define UART_TX_BRK_DONE_INT_RAW_S 12 -/* UART_GLITCH_DET_INT_RAW : RO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: This interrupt raw bit turns to high level when receiver detects the start bit.*/ -#define UART_GLITCH_DET_INT_RAW (BIT(11)) -#define UART_GLITCH_DET_INT_RAW_M (BIT(11)) -#define UART_GLITCH_DET_INT_RAW_V 0x1 -#define UART_GLITCH_DET_INT_RAW_S 11 -/* UART_SW_XOFF_INT_RAW : RO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: This interrupt raw bit turns to high level when receiver receives - xon char with uart_sw_flow_con_en is set to 1.*/ -#define UART_SW_XOFF_INT_RAW (BIT(10)) -#define UART_SW_XOFF_INT_RAW_M (BIT(10)) -#define UART_SW_XOFF_INT_RAW_V 0x1 -#define UART_SW_XOFF_INT_RAW_S 10 -/* UART_SW_XON_INT_RAW : RO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: This interrupt raw bit turns to high level when receiver receives - xoff char with uart_sw_flow_con_en is set to 1.*/ -#define UART_SW_XON_INT_RAW (BIT(9)) -#define UART_SW_XON_INT_RAW_M (BIT(9)) -#define UART_SW_XON_INT_RAW_V 0x1 -#define UART_SW_XON_INT_RAW_S 9 -/* UART_RXFIFO_TOUT_INT_RAW : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: This interrupt raw bit turns to high level when receiver takes - more time than rx_tout_thrhd to receive a byte.*/ -#define UART_RXFIFO_TOUT_INT_RAW (BIT(8)) -#define UART_RXFIFO_TOUT_INT_RAW_M (BIT(8)) -#define UART_RXFIFO_TOUT_INT_RAW_V 0x1 -#define UART_RXFIFO_TOUT_INT_RAW_S 8 -/* UART_BRK_DET_INT_RAW : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: This interrupt raw bit turns to high level when receiver detects - the 0 after the stop bit.*/ -#define UART_BRK_DET_INT_RAW (BIT(7)) -#define UART_BRK_DET_INT_RAW_M (BIT(7)) -#define UART_BRK_DET_INT_RAW_V 0x1 -#define UART_BRK_DET_INT_RAW_S 7 -/* UART_CTS_CHG_INT_RAW : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: This interrupt raw bit turns to high level when receiver detects - the edge change of ctsn signal.*/ -#define UART_CTS_CHG_INT_RAW (BIT(6)) -#define UART_CTS_CHG_INT_RAW_M (BIT(6)) -#define UART_CTS_CHG_INT_RAW_V 0x1 -#define UART_CTS_CHG_INT_RAW_S 6 -/* UART_DSR_CHG_INT_RAW : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: This interrupt raw bit turns to high level when receiver detects - the edge change of dsrn signal.*/ -#define UART_DSR_CHG_INT_RAW (BIT(5)) -#define UART_DSR_CHG_INT_RAW_M (BIT(5)) -#define UART_DSR_CHG_INT_RAW_V 0x1 -#define UART_DSR_CHG_INT_RAW_S 5 -/* UART_RXFIFO_OVF_INT_RAW : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: This interrupt raw bit turns to high level when receiver receives - more data than the fifo can store.*/ -#define UART_RXFIFO_OVF_INT_RAW (BIT(4)) -#define UART_RXFIFO_OVF_INT_RAW_M (BIT(4)) -#define UART_RXFIFO_OVF_INT_RAW_V 0x1 -#define UART_RXFIFO_OVF_INT_RAW_S 4 -/* UART_FRM_ERR_INT_RAW : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: This interrupt raw bit turns to high level when receiver detects - data's frame error .*/ -#define UART_FRM_ERR_INT_RAW (BIT(3)) -#define UART_FRM_ERR_INT_RAW_M (BIT(3)) -#define UART_FRM_ERR_INT_RAW_V 0x1 -#define UART_FRM_ERR_INT_RAW_S 3 -/* UART_PARITY_ERR_INT_RAW : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: This interrupt raw bit turns to high level when receiver detects - the parity error of data.*/ -#define UART_PARITY_ERR_INT_RAW (BIT(2)) -#define UART_PARITY_ERR_INT_RAW_M (BIT(2)) -#define UART_PARITY_ERR_INT_RAW_V 0x1 -#define UART_PARITY_ERR_INT_RAW_S 2 -/* UART_TXFIFO_EMPTY_INT_RAW : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: This interrupt raw bit turns to high level when the amount of - data in transmitter's fifo is less than ((tx_mem_cnttxfifo_cnt) .*/ -#define UART_TXFIFO_EMPTY_INT_RAW (BIT(1)) -#define UART_TXFIFO_EMPTY_INT_RAW_M (BIT(1)) -#define UART_TXFIFO_EMPTY_INT_RAW_V 0x1 -#define UART_TXFIFO_EMPTY_INT_RAW_S 1 -/* UART_RXFIFO_FULL_INT_RAW : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: This interrupt raw bit turns to high level when receiver receives - more data than (rx_flow_thrhd_h3 rx_flow_thrhd).*/ -#define UART_RXFIFO_FULL_INT_RAW (BIT(0)) -#define UART_RXFIFO_FULL_INT_RAW_M (BIT(0)) -#define UART_RXFIFO_FULL_INT_RAW_V 0x1 -#define UART_RXFIFO_FULL_INT_RAW_S 0 - -#define UART_INT_ST_REG(i) (REG_UART_BASE(i) + 0x8) -/* UART_AT_CMD_CHAR_DET_INT_ST : RO ;bitpos:[18] ;default: 1'b0 ; */ -/*description: This is the status bit for at_cmd_det_int_raw when at_cmd_char_det_int_ena - is set to 1.*/ -#define UART_AT_CMD_CHAR_DET_INT_ST (BIT(18)) -#define UART_AT_CMD_CHAR_DET_INT_ST_M (BIT(18)) -#define UART_AT_CMD_CHAR_DET_INT_ST_V 0x1 -#define UART_AT_CMD_CHAR_DET_INT_ST_S 18 -/* UART_RS485_CLASH_INT_ST : RO ;bitpos:[17] ;default: 1'b0 ; */ -/*description: This is the status bit for rs485_clash_int_raw when rs485_clash_int_ena - is set to 1.*/ -#define UART_RS485_CLASH_INT_ST (BIT(17)) -#define UART_RS485_CLASH_INT_ST_M (BIT(17)) -#define UART_RS485_CLASH_INT_ST_V 0x1 -#define UART_RS485_CLASH_INT_ST_S 17 -/* UART_RS485_FRM_ERR_INT_ST : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: This is the status bit for rs485_fm_err_int_raw when rs485_fm_err_int_ena - is set to 1.*/ -#define UART_RS485_FRM_ERR_INT_ST (BIT(16)) -#define UART_RS485_FRM_ERR_INT_ST_M (BIT(16)) -#define UART_RS485_FRM_ERR_INT_ST_V 0x1 -#define UART_RS485_FRM_ERR_INT_ST_S 16 -/* UART_RS485_PARITY_ERR_INT_ST : RO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: This is the status bit for rs485_parity_err_int_raw when rs485_parity_int_ena - is set to 1.*/ -#define UART_RS485_PARITY_ERR_INT_ST (BIT(15)) -#define UART_RS485_PARITY_ERR_INT_ST_M (BIT(15)) -#define UART_RS485_PARITY_ERR_INT_ST_V 0x1 -#define UART_RS485_PARITY_ERR_INT_ST_S 15 -/* UART_TX_DONE_INT_ST : RO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: This is the status bit for tx_done_int_raw when tx_done_int_ena is set to 1.*/ -#define UART_TX_DONE_INT_ST (BIT(14)) -#define UART_TX_DONE_INT_ST_M (BIT(14)) -#define UART_TX_DONE_INT_ST_V 0x1 -#define UART_TX_DONE_INT_ST_S 14 -/* UART_TX_BRK_IDLE_DONE_INT_ST : RO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: This is the stauts bit for tx_brk_idle_done_int_raw when tx_brk_idle_done_int_ena - is set to 1.*/ -#define UART_TX_BRK_IDLE_DONE_INT_ST (BIT(13)) -#define UART_TX_BRK_IDLE_DONE_INT_ST_M (BIT(13)) -#define UART_TX_BRK_IDLE_DONE_INT_ST_V 0x1 -#define UART_TX_BRK_IDLE_DONE_INT_ST_S 13 -/* UART_TX_BRK_DONE_INT_ST : RO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: This is the status bit for tx_brk_done_int_raw when tx_brk_done_int_ena - is set to 1.*/ -#define UART_TX_BRK_DONE_INT_ST (BIT(12)) -#define UART_TX_BRK_DONE_INT_ST_M (BIT(12)) -#define UART_TX_BRK_DONE_INT_ST_V 0x1 -#define UART_TX_BRK_DONE_INT_ST_S 12 -/* UART_GLITCH_DET_INT_ST : RO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: This is the status bit for glitch_det_int_raw when glitch_det_int_ena - is set to 1.*/ -#define UART_GLITCH_DET_INT_ST (BIT(11)) -#define UART_GLITCH_DET_INT_ST_M (BIT(11)) -#define UART_GLITCH_DET_INT_ST_V 0x1 -#define UART_GLITCH_DET_INT_ST_S 11 -/* UART_SW_XOFF_INT_ST : RO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: This is the status bit for sw_xoff_int_raw when sw_xoff_int_ena is set to 1.*/ -#define UART_SW_XOFF_INT_ST (BIT(10)) -#define UART_SW_XOFF_INT_ST_M (BIT(10)) -#define UART_SW_XOFF_INT_ST_V 0x1 -#define UART_SW_XOFF_INT_ST_S 10 -/* UART_SW_XON_INT_ST : RO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: This is the status bit for sw_xon_int_raw when sw_xon_int_ena is set to 1.*/ -#define UART_SW_XON_INT_ST (BIT(9)) -#define UART_SW_XON_INT_ST_M (BIT(9)) -#define UART_SW_XON_INT_ST_V 0x1 -#define UART_SW_XON_INT_ST_S 9 -/* UART_RXFIFO_TOUT_INT_ST : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: This is the status bit for rxfifo_tout_int_raw when rxfifo_tout_int_ena - is set to 1.*/ -#define UART_RXFIFO_TOUT_INT_ST (BIT(8)) -#define UART_RXFIFO_TOUT_INT_ST_M (BIT(8)) -#define UART_RXFIFO_TOUT_INT_ST_V 0x1 -#define UART_RXFIFO_TOUT_INT_ST_S 8 -/* UART_BRK_DET_INT_ST : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: This is the status bit for brk_det_int_raw when brk_det_int_ena is set to 1.*/ -#define UART_BRK_DET_INT_ST (BIT(7)) -#define UART_BRK_DET_INT_ST_M (BIT(7)) -#define UART_BRK_DET_INT_ST_V 0x1 -#define UART_BRK_DET_INT_ST_S 7 -/* UART_CTS_CHG_INT_ST : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: This is the status bit for cts_chg_int_raw when cts_chg_int_ena is set to 1.*/ -#define UART_CTS_CHG_INT_ST (BIT(6)) -#define UART_CTS_CHG_INT_ST_M (BIT(6)) -#define UART_CTS_CHG_INT_ST_V 0x1 -#define UART_CTS_CHG_INT_ST_S 6 -/* UART_DSR_CHG_INT_ST : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: This is the status bit for dsr_chg_int_raw when dsr_chg_int_ena is set to 1.*/ -#define UART_DSR_CHG_INT_ST (BIT(5)) -#define UART_DSR_CHG_INT_ST_M (BIT(5)) -#define UART_DSR_CHG_INT_ST_V 0x1 -#define UART_DSR_CHG_INT_ST_S 5 -/* UART_RXFIFO_OVF_INT_ST : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: This is the status bit for rxfifo_ovf_int_raw when rxfifo_ovf_int_ena - is set to 1.*/ -#define UART_RXFIFO_OVF_INT_ST (BIT(4)) -#define UART_RXFIFO_OVF_INT_ST_M (BIT(4)) -#define UART_RXFIFO_OVF_INT_ST_V 0x1 -#define UART_RXFIFO_OVF_INT_ST_S 4 -/* UART_FRM_ERR_INT_ST : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: This is the status bit for frm_err_int_raw when fm_err_int_ena is set to 1.*/ -#define UART_FRM_ERR_INT_ST (BIT(3)) -#define UART_FRM_ERR_INT_ST_M (BIT(3)) -#define UART_FRM_ERR_INT_ST_V 0x1 -#define UART_FRM_ERR_INT_ST_S 3 -/* UART_PARITY_ERR_INT_ST : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: This is the status bit for parity_err_int_raw when parity_err_int_ena - is set to 1.*/ -#define UART_PARITY_ERR_INT_ST (BIT(2)) -#define UART_PARITY_ERR_INT_ST_M (BIT(2)) -#define UART_PARITY_ERR_INT_ST_V 0x1 -#define UART_PARITY_ERR_INT_ST_S 2 -/* UART_TXFIFO_EMPTY_INT_ST : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: This is the status bit for txfifo_empty_int_raw when txfifo_empty_int_ena - is set to 1.*/ -#define UART_TXFIFO_EMPTY_INT_ST (BIT(1)) -#define UART_TXFIFO_EMPTY_INT_ST_M (BIT(1)) -#define UART_TXFIFO_EMPTY_INT_ST_V 0x1 -#define UART_TXFIFO_EMPTY_INT_ST_S 1 -/* UART_RXFIFO_FULL_INT_ST : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: This is the status bit for rxfifo_full_int_raw when rxfifo_full_int_ena - is set to 1.*/ -#define UART_RXFIFO_FULL_INT_ST (BIT(0)) -#define UART_RXFIFO_FULL_INT_ST_M (BIT(0)) -#define UART_RXFIFO_FULL_INT_ST_V 0x1 -#define UART_RXFIFO_FULL_INT_ST_S 0 - -#define UART_INT_ENA_REG(i) (REG_UART_BASE(i) + 0xC) -/* UART_AT_CMD_CHAR_DET_INT_ENA : R/W ;bitpos:[18] ;default: 1'b0 ; */ -/*description: This is the enable bit for at_cmd_char_det_int_st register.*/ -#define UART_AT_CMD_CHAR_DET_INT_ENA (BIT(18)) -#define UART_AT_CMD_CHAR_DET_INT_ENA_M (BIT(18)) -#define UART_AT_CMD_CHAR_DET_INT_ENA_V 0x1 -#define UART_AT_CMD_CHAR_DET_INT_ENA_S 18 -/* UART_RS485_CLASH_INT_ENA : R/W ;bitpos:[17] ;default: 1'b0 ; */ -/*description: This is the enable bit for rs485_clash_int_st register.*/ -#define UART_RS485_CLASH_INT_ENA (BIT(17)) -#define UART_RS485_CLASH_INT_ENA_M (BIT(17)) -#define UART_RS485_CLASH_INT_ENA_V 0x1 -#define UART_RS485_CLASH_INT_ENA_S 17 -/* UART_RS485_FRM_ERR_INT_ENA : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: This is the enable bit for rs485_parity_err_int_st register.*/ -#define UART_RS485_FRM_ERR_INT_ENA (BIT(16)) -#define UART_RS485_FRM_ERR_INT_ENA_M (BIT(16)) -#define UART_RS485_FRM_ERR_INT_ENA_V 0x1 -#define UART_RS485_FRM_ERR_INT_ENA_S 16 -/* UART_RS485_PARITY_ERR_INT_ENA : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: This is the enable bit for rs485_parity_err_int_st register.*/ -#define UART_RS485_PARITY_ERR_INT_ENA (BIT(15)) -#define UART_RS485_PARITY_ERR_INT_ENA_M (BIT(15)) -#define UART_RS485_PARITY_ERR_INT_ENA_V 0x1 -#define UART_RS485_PARITY_ERR_INT_ENA_S 15 -/* UART_TX_DONE_INT_ENA : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: This is the enable bit for tx_done_int_st register.*/ -#define UART_TX_DONE_INT_ENA (BIT(14)) -#define UART_TX_DONE_INT_ENA_M (BIT(14)) -#define UART_TX_DONE_INT_ENA_V 0x1 -#define UART_TX_DONE_INT_ENA_S 14 -/* UART_TX_BRK_IDLE_DONE_INT_ENA : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: This is the enable bit for tx_brk_idle_done_int_st register.*/ -#define UART_TX_BRK_IDLE_DONE_INT_ENA (BIT(13)) -#define UART_TX_BRK_IDLE_DONE_INT_ENA_M (BIT(13)) -#define UART_TX_BRK_IDLE_DONE_INT_ENA_V 0x1 -#define UART_TX_BRK_IDLE_DONE_INT_ENA_S 13 -/* UART_TX_BRK_DONE_INT_ENA : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: This is the enable bit for tx_brk_done_int_st register.*/ -#define UART_TX_BRK_DONE_INT_ENA (BIT(12)) -#define UART_TX_BRK_DONE_INT_ENA_M (BIT(12)) -#define UART_TX_BRK_DONE_INT_ENA_V 0x1 -#define UART_TX_BRK_DONE_INT_ENA_S 12 -/* UART_GLITCH_DET_INT_ENA : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: This is the enable bit for glitch_det_int_st register.*/ -#define UART_GLITCH_DET_INT_ENA (BIT(11)) -#define UART_GLITCH_DET_INT_ENA_M (BIT(11)) -#define UART_GLITCH_DET_INT_ENA_V 0x1 -#define UART_GLITCH_DET_INT_ENA_S 11 -/* UART_SW_XOFF_INT_ENA : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: This is the enable bit for sw_xoff_int_st register.*/ -#define UART_SW_XOFF_INT_ENA (BIT(10)) -#define UART_SW_XOFF_INT_ENA_M (BIT(10)) -#define UART_SW_XOFF_INT_ENA_V 0x1 -#define UART_SW_XOFF_INT_ENA_S 10 -/* UART_SW_XON_INT_ENA : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: This is the enable bit for sw_xon_int_st register.*/ -#define UART_SW_XON_INT_ENA (BIT(9)) -#define UART_SW_XON_INT_ENA_M (BIT(9)) -#define UART_SW_XON_INT_ENA_V 0x1 -#define UART_SW_XON_INT_ENA_S 9 -/* UART_RXFIFO_TOUT_INT_ENA : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: This is the enable bit for rxfifo_tout_int_st register.*/ -#define UART_RXFIFO_TOUT_INT_ENA (BIT(8)) -#define UART_RXFIFO_TOUT_INT_ENA_M (BIT(8)) -#define UART_RXFIFO_TOUT_INT_ENA_V 0x1 -#define UART_RXFIFO_TOUT_INT_ENA_S 8 -/* UART_BRK_DET_INT_ENA : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: This is the enable bit for brk_det_int_st register.*/ -#define UART_BRK_DET_INT_ENA (BIT(7)) -#define UART_BRK_DET_INT_ENA_M (BIT(7)) -#define UART_BRK_DET_INT_ENA_V 0x1 -#define UART_BRK_DET_INT_ENA_S 7 -/* UART_CTS_CHG_INT_ENA : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: This is the enable bit for cts_chg_int_st register.*/ -#define UART_CTS_CHG_INT_ENA (BIT(6)) -#define UART_CTS_CHG_INT_ENA_M (BIT(6)) -#define UART_CTS_CHG_INT_ENA_V 0x1 -#define UART_CTS_CHG_INT_ENA_S 6 -/* UART_DSR_CHG_INT_ENA : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: This is the enable bit for dsr_chg_int_st register.*/ -#define UART_DSR_CHG_INT_ENA (BIT(5)) -#define UART_DSR_CHG_INT_ENA_M (BIT(5)) -#define UART_DSR_CHG_INT_ENA_V 0x1 -#define UART_DSR_CHG_INT_ENA_S 5 -/* UART_RXFIFO_OVF_INT_ENA : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: This is the enable bit for rxfifo_ovf_int_st register.*/ -#define UART_RXFIFO_OVF_INT_ENA (BIT(4)) -#define UART_RXFIFO_OVF_INT_ENA_M (BIT(4)) -#define UART_RXFIFO_OVF_INT_ENA_V 0x1 -#define UART_RXFIFO_OVF_INT_ENA_S 4 -/* UART_FRM_ERR_INT_ENA : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: This is the enable bit for frm_err_int_st register.*/ -#define UART_FRM_ERR_INT_ENA (BIT(3)) -#define UART_FRM_ERR_INT_ENA_M (BIT(3)) -#define UART_FRM_ERR_INT_ENA_V 0x1 -#define UART_FRM_ERR_INT_ENA_S 3 -/* UART_PARITY_ERR_INT_ENA : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: This is the enable bit for parity_err_int_st register.*/ -#define UART_PARITY_ERR_INT_ENA (BIT(2)) -#define UART_PARITY_ERR_INT_ENA_M (BIT(2)) -#define UART_PARITY_ERR_INT_ENA_V 0x1 -#define UART_PARITY_ERR_INT_ENA_S 2 -/* UART_TXFIFO_EMPTY_INT_ENA : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: This is the enable bit for rxfifo_full_int_st register.*/ -#define UART_TXFIFO_EMPTY_INT_ENA (BIT(1)) -#define UART_TXFIFO_EMPTY_INT_ENA_M (BIT(1)) -#define UART_TXFIFO_EMPTY_INT_ENA_V 0x1 -#define UART_TXFIFO_EMPTY_INT_ENA_S 1 -/* UART_RXFIFO_FULL_INT_ENA : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: This is the enable bit for rxfifo_full_int_st register.*/ -#define UART_RXFIFO_FULL_INT_ENA (BIT(0)) -#define UART_RXFIFO_FULL_INT_ENA_M (BIT(0)) -#define UART_RXFIFO_FULL_INT_ENA_V 0x1 -#define UART_RXFIFO_FULL_INT_ENA_S 0 - -#define UART_INT_CLR_REG(i) (REG_UART_BASE(i) + 0x10) -/* UART_AT_CMD_CHAR_DET_INT_CLR : WO ;bitpos:[18] ;default: 1'b0 ; */ -/*description: Set this bit to clear the at_cmd_char_det_int_raw interrupt.*/ -#define UART_AT_CMD_CHAR_DET_INT_CLR (BIT(18)) -#define UART_AT_CMD_CHAR_DET_INT_CLR_M (BIT(18)) -#define UART_AT_CMD_CHAR_DET_INT_CLR_V 0x1 -#define UART_AT_CMD_CHAR_DET_INT_CLR_S 18 -/* UART_RS485_CLASH_INT_CLR : WO ;bitpos:[17] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rs485_clash_int_raw interrupt.*/ -#define UART_RS485_CLASH_INT_CLR (BIT(17)) -#define UART_RS485_CLASH_INT_CLR_M (BIT(17)) -#define UART_RS485_CLASH_INT_CLR_V 0x1 -#define UART_RS485_CLASH_INT_CLR_S 17 -/* UART_RS485_FRM_ERR_INT_CLR : WO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rs485_frm_err_int_raw interrupt.*/ -#define UART_RS485_FRM_ERR_INT_CLR (BIT(16)) -#define UART_RS485_FRM_ERR_INT_CLR_M (BIT(16)) -#define UART_RS485_FRM_ERR_INT_CLR_V 0x1 -#define UART_RS485_FRM_ERR_INT_CLR_S 16 -/* UART_RS485_PARITY_ERR_INT_CLR : WO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rs485_parity_err_int_raw interrupt.*/ -#define UART_RS485_PARITY_ERR_INT_CLR (BIT(15)) -#define UART_RS485_PARITY_ERR_INT_CLR_M (BIT(15)) -#define UART_RS485_PARITY_ERR_INT_CLR_V 0x1 -#define UART_RS485_PARITY_ERR_INT_CLR_S 15 -/* UART_TX_DONE_INT_CLR : WO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: Set this bit to clear the tx_done_int_raw interrupt.*/ -#define UART_TX_DONE_INT_CLR (BIT(14)) -#define UART_TX_DONE_INT_CLR_M (BIT(14)) -#define UART_TX_DONE_INT_CLR_V 0x1 -#define UART_TX_DONE_INT_CLR_S 14 -/* UART_TX_BRK_IDLE_DONE_INT_CLR : WO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: Set this bit to clear the tx_brk_idle_done_int_raw interrupt.*/ -#define UART_TX_BRK_IDLE_DONE_INT_CLR (BIT(13)) -#define UART_TX_BRK_IDLE_DONE_INT_CLR_M (BIT(13)) -#define UART_TX_BRK_IDLE_DONE_INT_CLR_V 0x1 -#define UART_TX_BRK_IDLE_DONE_INT_CLR_S 13 -/* UART_TX_BRK_DONE_INT_CLR : WO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: Set this bit to clear the tx_brk_done_int_raw interrupt..*/ -#define UART_TX_BRK_DONE_INT_CLR (BIT(12)) -#define UART_TX_BRK_DONE_INT_CLR_M (BIT(12)) -#define UART_TX_BRK_DONE_INT_CLR_V 0x1 -#define UART_TX_BRK_DONE_INT_CLR_S 12 -/* UART_GLITCH_DET_INT_CLR : WO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: Set this bit to clear the glitch_det_int_raw interrupt.*/ -#define UART_GLITCH_DET_INT_CLR (BIT(11)) -#define UART_GLITCH_DET_INT_CLR_M (BIT(11)) -#define UART_GLITCH_DET_INT_CLR_V 0x1 -#define UART_GLITCH_DET_INT_CLR_S 11 -/* UART_SW_XOFF_INT_CLR : WO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: Set this bit to clear the sw_xon_int_raw interrupt.*/ -#define UART_SW_XOFF_INT_CLR (BIT(10)) -#define UART_SW_XOFF_INT_CLR_M (BIT(10)) -#define UART_SW_XOFF_INT_CLR_V 0x1 -#define UART_SW_XOFF_INT_CLR_S 10 -/* UART_SW_XON_INT_CLR : WO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: Set this bit to clear the sw_xon_int_raw interrupt.*/ -#define UART_SW_XON_INT_CLR (BIT(9)) -#define UART_SW_XON_INT_CLR_M (BIT(9)) -#define UART_SW_XON_INT_CLR_V 0x1 -#define UART_SW_XON_INT_CLR_S 9 -/* UART_RXFIFO_TOUT_INT_CLR : WO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rxfifo_tout_int_raw interrupt.*/ -#define UART_RXFIFO_TOUT_INT_CLR (BIT(8)) -#define UART_RXFIFO_TOUT_INT_CLR_M (BIT(8)) -#define UART_RXFIFO_TOUT_INT_CLR_V 0x1 -#define UART_RXFIFO_TOUT_INT_CLR_S 8 -/* UART_BRK_DET_INT_CLR : WO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: Set this bit to clear the brk_det_int_raw interrupt.*/ -#define UART_BRK_DET_INT_CLR (BIT(7)) -#define UART_BRK_DET_INT_CLR_M (BIT(7)) -#define UART_BRK_DET_INT_CLR_V 0x1 -#define UART_BRK_DET_INT_CLR_S 7 -/* UART_CTS_CHG_INT_CLR : WO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: Set this bit to clear the cts_chg_int_raw interrupt.*/ -#define UART_CTS_CHG_INT_CLR (BIT(6)) -#define UART_CTS_CHG_INT_CLR_M (BIT(6)) -#define UART_CTS_CHG_INT_CLR_V 0x1 -#define UART_CTS_CHG_INT_CLR_S 6 -/* UART_DSR_CHG_INT_CLR : WO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: Set this bit to clear the dsr_chg_int_raw interrupt.*/ -#define UART_DSR_CHG_INT_CLR (BIT(5)) -#define UART_DSR_CHG_INT_CLR_M (BIT(5)) -#define UART_DSR_CHG_INT_CLR_V 0x1 -#define UART_DSR_CHG_INT_CLR_S 5 -/* UART_RXFIFO_OVF_INT_CLR : WO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: Set this bit to clear rxfifo_ovf_int_raw interrupt.*/ -#define UART_RXFIFO_OVF_INT_CLR (BIT(4)) -#define UART_RXFIFO_OVF_INT_CLR_M (BIT(4)) -#define UART_RXFIFO_OVF_INT_CLR_V 0x1 -#define UART_RXFIFO_OVF_INT_CLR_S 4 -/* UART_FRM_ERR_INT_CLR : WO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: Set this bit to clear frm_err_int_raw interrupt.*/ -#define UART_FRM_ERR_INT_CLR (BIT(3)) -#define UART_FRM_ERR_INT_CLR_M (BIT(3)) -#define UART_FRM_ERR_INT_CLR_V 0x1 -#define UART_FRM_ERR_INT_CLR_S 3 -/* UART_PARITY_ERR_INT_CLR : WO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: Set this bit to clear parity_err_int_raw interrupt.*/ -#define UART_PARITY_ERR_INT_CLR (BIT(2)) -#define UART_PARITY_ERR_INT_CLR_M (BIT(2)) -#define UART_PARITY_ERR_INT_CLR_V 0x1 -#define UART_PARITY_ERR_INT_CLR_S 2 -/* UART_TXFIFO_EMPTY_INT_CLR : WO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: Set this bit to clear txfifo_empty_int_raw interrupt.*/ -#define UART_TXFIFO_EMPTY_INT_CLR (BIT(1)) -#define UART_TXFIFO_EMPTY_INT_CLR_M (BIT(1)) -#define UART_TXFIFO_EMPTY_INT_CLR_V 0x1 -#define UART_TXFIFO_EMPTY_INT_CLR_S 1 -/* UART_RXFIFO_FULL_INT_CLR : WO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: Set this bit to clear the rxfifo_full_int_raw interrupt.*/ -#define UART_RXFIFO_FULL_INT_CLR (BIT(0)) -#define UART_RXFIFO_FULL_INT_CLR_M (BIT(0)) -#define UART_RXFIFO_FULL_INT_CLR_V 0x1 -#define UART_RXFIFO_FULL_INT_CLR_S 0 - -#define UART_CLKDIV_REG(i) (REG_UART_BASE(i) + 0x14) -/* UART_CLKDIV_FRAG : R/W ;bitpos:[23:20] ;default: 4'h0 ; */ -/*description: The register value is the decimal part of the frequency divider's factor.*/ -#define UART_CLKDIV_FRAG 0x0000000F -#define UART_CLKDIV_FRAG_M ((UART_CLKDIV_FRAG_V)<<(UART_CLKDIV_FRAG_S)) -#define UART_CLKDIV_FRAG_V 0xF -#define UART_CLKDIV_FRAG_S 20 -/* UART_CLKDIV : R/W ;bitpos:[19:0] ;default: 20'h2B6 ; */ -/*description: The register value is the integer part of the frequency divider's factor.*/ -#define UART_CLKDIV 0x000FFFFF -#define UART_CLKDIV_M ((UART_CLKDIV_V)<<(UART_CLKDIV_S)) -#define UART_CLKDIV_V 0xFFFFF -#define UART_CLKDIV_S 0 - -#define UART_AUTOBAUD_REG(i) (REG_UART_BASE(i) + 0x18) -/* UART_GLITCH_FILT : R/W ;bitpos:[15:8] ;default: 8'h10 ; */ -/*description: when input pulse width is lower then this value igore this pulse.this - register is used in autobaud detect process.*/ -#define UART_GLITCH_FILT 0x000000FF -#define UART_GLITCH_FILT_M ((UART_GLITCH_FILT_V)<<(UART_GLITCH_FILT_S)) -#define UART_GLITCH_FILT_V 0xFF -#define UART_GLITCH_FILT_S 8 -/* UART_AUTOBAUD_EN : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: This is the enable bit for detecting baudrate.*/ -#define UART_AUTOBAUD_EN (BIT(0)) -#define UART_AUTOBAUD_EN_M (BIT(0)) -#define UART_AUTOBAUD_EN_V 0x1 -#define UART_AUTOBAUD_EN_S 0 - -#define UART_STATUS_REG(i) (REG_UART_BASE(i) + 0x1C) -/* UART_TXD : RO ;bitpos:[31] ;default: 8'h0 ; */ -/*description: This register represent the level value of the internal uart rxd signal.*/ -#define UART_TXD (BIT(31)) -#define UART_TXD_M (BIT(31)) -#define UART_TXD_V 0x1 -#define UART_TXD_S 31 -/* UART_RTSN : RO ;bitpos:[30] ;default: 1'b0 ; */ -/*description: This register represent the level value of the internal uart cts signal.*/ -#define UART_RTSN (BIT(30)) -#define UART_RTSN_M (BIT(30)) -#define UART_RTSN_V 0x1 -#define UART_RTSN_S 30 -/* UART_DTRN : RO ;bitpos:[29] ;default: 1'b0 ; */ -/*description: The register represent the level value of the internal uart dsr signal.*/ -#define UART_DTRN (BIT(29)) -#define UART_DTRN_M (BIT(29)) -#define UART_DTRN_V 0x1 -#define UART_DTRN_S 29 -/* UART_ST_UTX_OUT : RO ;bitpos:[27:24] ;default: 4'b0 ; */ -/*description: This register stores the value of transmitter's finite state - machine. 0:TX_IDLE 1:TX_STRT 2:TX_DAT0 3:TX_DAT1 4:TX_DAT2 5:TX_DAT3 6:TX_DAT4 7:TX_DAT5 8:TX_DAT6 9:TX_DAT7 10:TX_PRTY 11:TX_STP1 12:TX_STP2 13:TX_DL0 14:TX_DL1*/ -#define UART_ST_UTX_OUT 0x0000000F -#define UART_ST_UTX_OUT_M ((UART_ST_UTX_OUT_V)<<(UART_ST_UTX_OUT_S)) -#define UART_ST_UTX_OUT_V 0xF -#define UART_ST_UTX_OUT_S 24 -/* UART_TXFIFO_CNT : RO ;bitpos:[23:16] ;default: 8'b0 ; */ -/*description: (tx_mem_cnt txfifo_cnt) stores the byte num of valid datas in - transmitter's fifo.tx_mem_cnt stores the 3 most significant bits txfifo_cnt stores the 8 least significant bits.*/ -#define UART_TXFIFO_CNT 0x000000FF -#define UART_TXFIFO_CNT_M ((UART_TXFIFO_CNT_V)<<(UART_TXFIFO_CNT_S)) -#define UART_TXFIFO_CNT_V 0xFF -#define UART_TXFIFO_CNT_S 16 -/* UART_RXD : RO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: This register stores the level value of the internal uart rxd signal.*/ -#define UART_RXD (BIT(15)) -#define UART_RXD_M (BIT(15)) -#define UART_RXD_V 0x1 -#define UART_RXD_S 15 -/* UART_CTSN : RO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: This register stores the level value of the internal uart cts signal.*/ -#define UART_CTSN (BIT(14)) -#define UART_CTSN_M (BIT(14)) -#define UART_CTSN_V 0x1 -#define UART_CTSN_S 14 -/* UART_DSRN : RO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: This register stores the level value of the internal uart dsr signal.*/ -#define UART_DSRN (BIT(13)) -#define UART_DSRN_M (BIT(13)) -#define UART_DSRN_V 0x1 -#define UART_DSRN_S 13 -/* UART_ST_URX_OUT : RO ;bitpos:[11:8] ;default: 4'b0 ; */ -/*description: This register stores the value of receiver's finite state machine. - 0:RX_IDLE 1:RX_STRT 2:RX_DAT0 3:RX_DAT1 4:RX_DAT2 5:RX_DAT3 6:RX_DAT4 7:RX_DAT5 8:RX_DAT6 9:RX_DAT7 10:RX_PRTY 11:RX_STP1 12:RX_STP2 13:RX_DL1*/ -#define UART_ST_URX_OUT 0x0000000F -#define UART_ST_URX_OUT_M ((UART_ST_URX_OUT_V)<<(UART_ST_URX_OUT_S)) -#define UART_ST_URX_OUT_V 0xF -#define UART_ST_URX_OUT_S 8 -/* UART_RXFIFO_CNT : RO ;bitpos:[7:0] ;default: 8'b0 ; */ -/*description: (rx_mem_cnt rxfifo_cnt) stores the byte num of valid datas in - receiver's fifo. rx_mem_cnt register stores the 3 most significant bits rxfifo_cnt stores the 8 least significant bits.*/ -#define UART_RXFIFO_CNT 0x000000FF -#define UART_RXFIFO_CNT_M ((UART_RXFIFO_CNT_V)<<(UART_RXFIFO_CNT_S)) -#define UART_RXFIFO_CNT_V 0xFF -#define UART_RXFIFO_CNT_S 0 - -#define UART_CONF0_REG(i) (REG_UART_BASE(i) + 0x20) -/* UART_TICK_REF_ALWAYS_ON : R/W ;bitpos:[27] ;default: 1'b1 ; */ -/*description: This register is used to select the clock.1.apb clock 0:ref_tick*/ -#define UART_TICK_REF_ALWAYS_ON (BIT(27)) -#define UART_TICK_REF_ALWAYS_ON_M (BIT(27)) -#define UART_TICK_REF_ALWAYS_ON_V 0x1 -#define UART_TICK_REF_ALWAYS_ON_S 27 -/* UART_ERR_WR_MASK : R/W ;bitpos:[26] ;default: 1'b0 ; */ -/*description: 1.receiver stops storing data int fifo when data is wrong. - 0.receiver stores the data even if the received data is wrong.*/ -#define UART_ERR_WR_MASK (BIT(26)) -#define UART_ERR_WR_MASK_M (BIT(26)) -#define UART_ERR_WR_MASK_V 0x1 -#define UART_ERR_WR_MASK_S 26 -/* UART_CLK_EN : R/W ;bitpos:[25] ;default: 1'h0 ; */ -/*description: 1.force clock on for registers.support clock only when write registers*/ -#define UART_CLK_EN (BIT(25)) -#define UART_CLK_EN_M (BIT(25)) -#define UART_CLK_EN_V 0x1 -#define UART_CLK_EN_S 25 -/* UART_DTR_INV : R/W ;bitpos:[24] ;default: 1'h0 ; */ -/*description: Set this bit to inverse the level value of uart dtr signal.*/ -#define UART_DTR_INV (BIT(24)) -#define UART_DTR_INV_M (BIT(24)) -#define UART_DTR_INV_V 0x1 -#define UART_DTR_INV_S 24 -/* UART_RTS_INV : R/W ;bitpos:[23] ;default: 1'h0 ; */ -/*description: Set this bit to inverse the level value of uart rts signal.*/ -#define UART_RTS_INV (BIT(23)) -#define UART_RTS_INV_M (BIT(23)) -#define UART_RTS_INV_V 0x1 -#define UART_RTS_INV_S 23 -/* UART_TXD_INV : R/W ;bitpos:[22] ;default: 1'h0 ; */ -/*description: Set this bit to inverse the level value of uart txd signal.*/ -#define UART_TXD_INV (BIT(22)) -#define UART_TXD_INV_M (BIT(22)) -#define UART_TXD_INV_V 0x1 -#define UART_TXD_INV_S 22 -/* UART_DSR_INV : R/W ;bitpos:[21] ;default: 1'h0 ; */ -/*description: Set this bit to inverse the level value of uart dsr signal.*/ -#define UART_DSR_INV (BIT(21)) -#define UART_DSR_INV_M (BIT(21)) -#define UART_DSR_INV_V 0x1 -#define UART_DSR_INV_S 21 -/* UART_CTS_INV : R/W ;bitpos:[20] ;default: 1'h0 ; */ -/*description: Set this bit to inverse the level value of uart cts signal.*/ -#define UART_CTS_INV (BIT(20)) -#define UART_CTS_INV_M (BIT(20)) -#define UART_CTS_INV_V 0x1 -#define UART_CTS_INV_S 20 -/* UART_RXD_INV : R/W ;bitpos:[19] ;default: 1'h0 ; */ -/*description: Set this bit to inverse the level value of uart rxd signal.*/ -#define UART_RXD_INV (BIT(19)) -#define UART_RXD_INV_M (BIT(19)) -#define UART_RXD_INV_V 0x1 -#define UART_RXD_INV_S 19 -/* UART_TXFIFO_RST : R/W ;bitpos:[18] ;default: 1'h0 ; */ -/*description: Set this bit to reset uart transmitter's fifo.*/ -#define UART_TXFIFO_RST (BIT(18)) -#define UART_TXFIFO_RST_M (BIT(18)) -#define UART_TXFIFO_RST_V 0x1 -#define UART_TXFIFO_RST_S 18 -/* UART_RXFIFO_RST : R/W ;bitpos:[17] ;default: 1'h0 ; */ -/*description: Set this bit to reset uart receiver's fifo.*/ -#define UART_RXFIFO_RST (BIT(17)) -#define UART_RXFIFO_RST_M (BIT(17)) -#define UART_RXFIFO_RST_V 0x1 -#define UART_RXFIFO_RST_S 17 -/* UART_IRDA_EN : R/W ;bitpos:[16] ;default: 1'h0 ; */ -/*description: Set this bit to enable irda protocol.*/ -#define UART_IRDA_EN (BIT(16)) -#define UART_IRDA_EN_M (BIT(16)) -#define UART_IRDA_EN_V 0x1 -#define UART_IRDA_EN_S 16 -/* UART_TX_FLOW_EN : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: Set this bit to enable transmitter's flow control function.*/ -#define UART_TX_FLOW_EN (BIT(15)) -#define UART_TX_FLOW_EN_M (BIT(15)) -#define UART_TX_FLOW_EN_V 0x1 -#define UART_TX_FLOW_EN_S 15 -/* UART_LOOPBACK : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: Set this bit to enable uart loopback test mode.*/ -#define UART_LOOPBACK (BIT(14)) -#define UART_LOOPBACK_M (BIT(14)) -#define UART_LOOPBACK_V 0x1 -#define UART_LOOPBACK_S 14 -/* UART_IRDA_RX_INV : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: Set this bit to inverse the level value of irda receiver's level.*/ -#define UART_IRDA_RX_INV (BIT(13)) -#define UART_IRDA_RX_INV_M (BIT(13)) -#define UART_IRDA_RX_INV_V 0x1 -#define UART_IRDA_RX_INV_S 13 -/* UART_IRDA_TX_INV : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: Set this bit to inverse the level value of irda transmitter's level.*/ -#define UART_IRDA_TX_INV (BIT(12)) -#define UART_IRDA_TX_INV_M (BIT(12)) -#define UART_IRDA_TX_INV_V 0x1 -#define UART_IRDA_TX_INV_S 12 -/* UART_IRDA_WCTL : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: 1.the irda transmitter's 11th bit is the same to the 10th bit. - 0.set irda transmitter's 11th bit to 0.*/ -#define UART_IRDA_WCTL (BIT(11)) -#define UART_IRDA_WCTL_M (BIT(11)) -#define UART_IRDA_WCTL_V 0x1 -#define UART_IRDA_WCTL_S 11 -/* UART_IRDA_TX_EN : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: This is the start enable bit for irda transmitter.*/ -#define UART_IRDA_TX_EN (BIT(10)) -#define UART_IRDA_TX_EN_M (BIT(10)) -#define UART_IRDA_TX_EN_V 0x1 -#define UART_IRDA_TX_EN_S 10 -/* UART_IRDA_DPLX : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: Set this bit to enable irda loopback mode.*/ -#define UART_IRDA_DPLX (BIT(9)) -#define UART_IRDA_DPLX_M (BIT(9)) -#define UART_IRDA_DPLX_V 0x1 -#define UART_IRDA_DPLX_S 9 -/* UART_TXD_BRK : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: Set this bit to enbale transmitter to send 0 when the process - of sending data is done.*/ -#define UART_TXD_BRK (BIT(8)) -#define UART_TXD_BRK_M (BIT(8)) -#define UART_TXD_BRK_V 0x1 -#define UART_TXD_BRK_S 8 -/* UART_SW_DTR : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: This register is used to configure the software dtr signal which - is used in software flow control..*/ -#define UART_SW_DTR (BIT(7)) -#define UART_SW_DTR_M (BIT(7)) -#define UART_SW_DTR_V 0x1 -#define UART_SW_DTR_S 7 -/* UART_SW_RTS : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: This register is used to configure the software rts signal which - is used in software flow control.*/ -#define UART_SW_RTS (BIT(6)) -#define UART_SW_RTS_M (BIT(6)) -#define UART_SW_RTS_V 0x1 -#define UART_SW_RTS_S 6 -/* UART_STOP_BIT_NUM : R/W ;bitpos:[5:4] ;default: 2'd1 ; */ -/*description: This register is used to set the length of stop bit. 1:1bit 2:1.5bits 3:2bits*/ -#define UART_STOP_BIT_NUM 0x00000003 -#define UART_STOP_BIT_NUM_M ((UART_STOP_BIT_NUM_V)<<(UART_STOP_BIT_NUM_S)) -#define UART_STOP_BIT_NUM_V 0x3 -#define UART_STOP_BIT_NUM_S 4 -/* UART_BIT_NUM : R/W ;bitpos:[3:2] ;default: 2'd3 ; */ -/*description: This registe is used to set the length of data: 0:5bits 1:6bits 2:7bits 3:8bits*/ -#define UART_BIT_NUM 0x00000003 -#define UART_BIT_NUM_M ((UART_BIT_NUM_V)<<(UART_BIT_NUM_S)) -#define UART_BIT_NUM_V 0x3 -#define UART_BIT_NUM_S 2 -/* UART_PARITY_EN : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: Set this bit to enable uart parity check.*/ -#define UART_PARITY_EN (BIT(1)) -#define UART_PARITY_EN_M (BIT(1)) -#define UART_PARITY_EN_V 0x1 -#define UART_PARITY_EN_S 1 -/* UART_PARITY : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: This register is used to configure the parity check mode. 0:even 1:odd*/ -#define UART_PARITY (BIT(0)) -#define UART_PARITY_M (BIT(0)) -#define UART_PARITY_V 0x1 -#define UART_PARITY_S 0 - -#define UART_CONF1_REG(i) (REG_UART_BASE(i) + 0x24) -/* UART_RX_TOUT_EN : R/W ;bitpos:[31] ;default: 1'b0 ; */ -/*description: This is the enble bit for uart receiver's timeout function.*/ -#define UART_RX_TOUT_EN (BIT(31)) -#define UART_RX_TOUT_EN_M (BIT(31)) -#define UART_RX_TOUT_EN_V 0x1 -#define UART_RX_TOUT_EN_S 31 -/* UART_RX_TOUT_THRHD : R/W ;bitpos:[30:24] ;default: 7'b0 ; */ -/*description: This register is used to configure the timeout value for uart - receiver receiving a byte.*/ -#define UART_RX_TOUT_THRHD 0x0000007F -#define UART_RX_TOUT_THRHD_M ((UART_RX_TOUT_THRHD_V)<<(UART_RX_TOUT_THRHD_S)) -#define UART_RX_TOUT_THRHD_V 0x7F -#define UART_RX_TOUT_THRHD_S 24 -/* UART_RX_FLOW_EN : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: This is the flow enable bit for uart receiver. 1:choose software - flow control with configuring sw_rts signal*/ -#define UART_RX_FLOW_EN (BIT(23)) -#define UART_RX_FLOW_EN_M (BIT(23)) -#define UART_RX_FLOW_EN_V 0x1 -#define UART_RX_FLOW_EN_S 23 -/* UART_RX_FLOW_THRHD : R/W ;bitpos:[22:16] ;default: 7'h0 ; */ -/*description: when receiver receives more data than its threshold value. - receiver produce signal to tell the transmitter stop transferring data. the threshold value is (rx_flow_thrhd_h3 rx_flow_thrhd).*/ -#define UART_RX_FLOW_THRHD 0x0000007F -#define UART_RX_FLOW_THRHD_M ((UART_RX_FLOW_THRHD_V)<<(UART_RX_FLOW_THRHD_S)) -#define UART_RX_FLOW_THRHD_V 0x7F -#define UART_RX_FLOW_THRHD_S 16 -/* UART_TXFIFO_EMPTY_THRHD : R/W ;bitpos:[14:8] ;default: 7'h60 ; */ -/*description: when the data amount in transmitter fifo is less than its threshold - value. it will produce txfifo_empty_int_raw interrupt. the threshold value is (tx_mem_empty_thrhd txfifo_empty_thrhd)*/ -#define UART_TXFIFO_EMPTY_THRHD 0x0000007F -#define UART_TXFIFO_EMPTY_THRHD_M ((UART_TXFIFO_EMPTY_THRHD_V)<<(UART_TXFIFO_EMPTY_THRHD_S)) -#define UART_TXFIFO_EMPTY_THRHD_V 0x7F -#define UART_TXFIFO_EMPTY_THRHD_S 8 -/* UART_RXFIFO_FULL_THRHD : R/W ;bitpos:[6:0] ;default: 7'h60 ; */ -/*description: When receiver receives more data than its threshold value.receiver - will produce rxfifo_full_int_raw interrupt.the threshold value is (rx_flow_thrhd_h3 rxfifo_full_thrhd).*/ -#define UART_RXFIFO_FULL_THRHD 0x0000007F -#define UART_RXFIFO_FULL_THRHD_M ((UART_RXFIFO_FULL_THRHD_V)<<(UART_RXFIFO_FULL_THRHD_S)) -#define UART_RXFIFO_FULL_THRHD_V 0x7F -#define UART_RXFIFO_FULL_THRHD_S 0 - -#define UART_LOWPULSE_REG(i) (REG_UART_BASE(i) + 0x28) -/* UART_LOWPULSE_MIN_CNT : RO ;bitpos:[19:0] ;default: 20'hFFFFF ; */ -/*description: This register stores the value of the minimum duration time for - the low level pulse. it is used in baudrate-detect process.*/ -#define UART_LOWPULSE_MIN_CNT 0x000FFFFF -#define UART_LOWPULSE_MIN_CNT_M ((UART_LOWPULSE_MIN_CNT_V)<<(UART_LOWPULSE_MIN_CNT_S)) -#define UART_LOWPULSE_MIN_CNT_V 0xFFFFF -#define UART_LOWPULSE_MIN_CNT_S 0 - -#define UART_HIGHPULSE_REG(i) (REG_UART_BASE(i) + 0x2C) -/* UART_HIGHPULSE_MIN_CNT : RO ;bitpos:[19:0] ;default: 20'hFFFFF ; */ -/*description: This register stores the value of the maxinum duration time - for the high level pulse. it is used in baudrate-detect process.*/ -#define UART_HIGHPULSE_MIN_CNT 0x000FFFFF -#define UART_HIGHPULSE_MIN_CNT_M ((UART_HIGHPULSE_MIN_CNT_V)<<(UART_HIGHPULSE_MIN_CNT_S)) -#define UART_HIGHPULSE_MIN_CNT_V 0xFFFFF -#define UART_HIGHPULSE_MIN_CNT_S 0 - -#define UART_RXD_CNT_REG(i) (REG_UART_BASE(i) + 0x30) -/* UART_RXD_EDGE_CNT : RO ;bitpos:[9:0] ;default: 10'h0 ; */ -/*description: This register stores the count of rxd edge change. it is used - in baudrate-detect process.*/ -#define UART_RXD_EDGE_CNT 0x000003FF -#define UART_RXD_EDGE_CNT_M ((UART_RXD_EDGE_CNT_V)<<(UART_RXD_EDGE_CNT_S)) -#define UART_RXD_EDGE_CNT_V 0x3FF -#define UART_RXD_EDGE_CNT_S 0 - -#define UART_FLOW_CONF_REG(i) (REG_UART_BASE(i) + 0x34) -/* UART_SEND_XOFF : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: Set this bit to send xoff char. it is cleared by hardware automatically.*/ -#define UART_SEND_XOFF (BIT(5)) -#define UART_SEND_XOFF_M (BIT(5)) -#define UART_SEND_XOFF_V 0x1 -#define UART_SEND_XOFF_S 5 -/* UART_SEND_XON : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: Set this bit to send xon char. it is cleared by hardware automatically.*/ -#define UART_SEND_XON (BIT(4)) -#define UART_SEND_XON_M (BIT(4)) -#define UART_SEND_XON_V 0x1 -#define UART_SEND_XON_S 4 -/* UART_FORCE_XOFF : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: Set this bit to set ctsn to enable the transmitter to go on sending data.*/ -#define UART_FORCE_XOFF (BIT(3)) -#define UART_FORCE_XOFF_M (BIT(3)) -#define UART_FORCE_XOFF_V 0x1 -#define UART_FORCE_XOFF_S 3 -/* UART_FORCE_XON : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: Set this bit to clear ctsn to stop the transmitter from sending data.*/ -#define UART_FORCE_XON (BIT(2)) -#define UART_FORCE_XON_M (BIT(2)) -#define UART_FORCE_XON_V 0x1 -#define UART_FORCE_XON_S 2 -/* UART_XONOFF_DEL : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: Set this bit to remove flow control char from the received data.*/ -#define UART_XONOFF_DEL (BIT(1)) -#define UART_XONOFF_DEL_M (BIT(1)) -#define UART_XONOFF_DEL_V 0x1 -#define UART_XONOFF_DEL_S 1 -/* UART_SW_FLOW_CON_EN : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: Set this bit to enable software flow control. it is used with - register sw_xon or sw_xoff .*/ -#define UART_SW_FLOW_CON_EN (BIT(0)) -#define UART_SW_FLOW_CON_EN_M (BIT(0)) -#define UART_SW_FLOW_CON_EN_V 0x1 -#define UART_SW_FLOW_CON_EN_S 0 - -#define UART_SLEEP_CONF_REG(i) (REG_UART_BASE(i) + 0x38) -/* UART_ACTIVE_THRESHOLD : R/W ;bitpos:[9:0] ;default: 10'hf0 ; */ -/*description: When the input rxd edge changes more than this register value. - the uart is active from light sleeping mode.*/ -#define UART_ACTIVE_THRESHOLD 0x000003FF -#define UART_ACTIVE_THRESHOLD_M ((UART_ACTIVE_THRESHOLD_V)<<(UART_ACTIVE_THRESHOLD_S)) -#define UART_ACTIVE_THRESHOLD_V 0x3FF -#define UART_ACTIVE_THRESHOLD_S 0 - -#define UART_SWFC_CONF_REG(i) (REG_UART_BASE(i) + 0x3C) -/* UART_XOFF_CHAR : R/W ;bitpos:[31:24] ;default: 8'h13 ; */ -/*description: This register stores the xoff flow control char.*/ -#define UART_XOFF_CHAR 0x000000FF -#define UART_XOFF_CHAR_M ((UART_XOFF_CHAR_V)<<(UART_XOFF_CHAR_S)) -#define UART_XOFF_CHAR_V 0xFF -#define UART_XOFF_CHAR_S 24 -/* UART_XON_CHAR : R/W ;bitpos:[23:16] ;default: 8'h11 ; */ -/*description: This register stores the xon flow control char.*/ -#define UART_XON_CHAR 0x000000FF -#define UART_XON_CHAR_M ((UART_XON_CHAR_V)<<(UART_XON_CHAR_S)) -#define UART_XON_CHAR_V 0xFF -#define UART_XON_CHAR_S 16 -/* UART_XOFF_THRESHOLD : R/W ;bitpos:[15:8] ;default: 8'he0 ; */ -/*description: When the data amount in receiver's fifo is less than this register - value. it will send a xon char with uart_sw_flow_con_en set to 1.*/ -#define UART_XOFF_THRESHOLD 0x000000FF -#define UART_XOFF_THRESHOLD_M ((UART_XOFF_THRESHOLD_V)<<(UART_XOFF_THRESHOLD_S)) -#define UART_XOFF_THRESHOLD_V 0xFF -#define UART_XOFF_THRESHOLD_S 8 -/* UART_XON_THRESHOLD : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ -/*description: when the data amount in receiver's fifo is more than this register - value. it will send a xoff char with uart_sw_flow_con_en set to 1.*/ -#define UART_XON_THRESHOLD 0x000000FF -#define UART_XON_THRESHOLD_M ((UART_XON_THRESHOLD_V)<<(UART_XON_THRESHOLD_S)) -#define UART_XON_THRESHOLD_V 0xFF -#define UART_XON_THRESHOLD_S 0 - -#define UART_IDLE_CONF_REG(i) (REG_UART_BASE(i) + 0x40) -/* UART_TX_BRK_NUM : R/W ;bitpos:[27:20] ;default: 8'ha ; */ -/*description: This register is used to configure the num of 0 send after the - process of sending data is done. it is active when txd_brk is set to 1.*/ -#define UART_TX_BRK_NUM 0x000000FF -#define UART_TX_BRK_NUM_M ((UART_TX_BRK_NUM_V)<<(UART_TX_BRK_NUM_S)) -#define UART_TX_BRK_NUM_V 0xFF -#define UART_TX_BRK_NUM_S 20 -/* UART_TX_IDLE_NUM : R/W ;bitpos:[19:10] ;default: 10'h100 ; */ -/*description: This register is used to configure the duration time between transfers.*/ -#define UART_TX_IDLE_NUM 0x000003FF -#define UART_TX_IDLE_NUM_M ((UART_TX_IDLE_NUM_V)<<(UART_TX_IDLE_NUM_S)) -#define UART_TX_IDLE_NUM_V 0x3FF -#define UART_TX_IDLE_NUM_S 10 -/* UART_RX_IDLE_THRHD : R/W ;bitpos:[9:0] ;default: 10'h100 ; */ -/*description: when receiver takes more time than this register value to receive - a byte data. it will produce frame end signal for uhci to stop receiving data.*/ -#define UART_RX_IDLE_THRHD 0x000003FF -#define UART_RX_IDLE_THRHD_M ((UART_RX_IDLE_THRHD_V)<<(UART_RX_IDLE_THRHD_S)) -#define UART_RX_IDLE_THRHD_V 0x3FF -#define UART_RX_IDLE_THRHD_S 0 - -#define UART_RS485_CONF_REG(i) (REG_UART_BASE(i) + 0x44) -/* UART_RS485_TX_DLY_NUM : R/W ;bitpos:[9:6] ;default: 4'b0 ; */ -/*description: This register is used to delay the transmitter's internal data signal.*/ -#define UART_RS485_TX_DLY_NUM 0x0000000F -#define UART_RS485_TX_DLY_NUM_M ((UART_RS485_TX_DLY_NUM_V)<<(UART_RS485_TX_DLY_NUM_S)) -#define UART_RS485_TX_DLY_NUM_V 0xF -#define UART_RS485_TX_DLY_NUM_S 6 -/* UART_RS485_RX_DLY_NUM : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: This register is used to delay the receiver's internal data signal.*/ -#define UART_RS485_RX_DLY_NUM (BIT(5)) -#define UART_RS485_RX_DLY_NUM_M (BIT(5)) -#define UART_RS485_RX_DLY_NUM_V 0x1 -#define UART_RS485_RX_DLY_NUM_S 5 -/* UART_RS485RXBY_TX_EN : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: 1: enable rs485's transmitter to send data when rs485's receiver - is busy. 0:rs485's transmitter should not send data when its receiver is busy.*/ -#define UART_RS485RXBY_TX_EN (BIT(4)) -#define UART_RS485RXBY_TX_EN_M (BIT(4)) -#define UART_RS485RXBY_TX_EN_V 0x1 -#define UART_RS485RXBY_TX_EN_S 4 -/* UART_RS485TX_RX_EN : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: Set this bit to enable loopback transmitter's output data signal - to receiver's input data signal.*/ -#define UART_RS485TX_RX_EN (BIT(3)) -#define UART_RS485TX_RX_EN_M (BIT(3)) -#define UART_RS485TX_RX_EN_V 0x1 -#define UART_RS485TX_RX_EN_S 3 -/* UART_DL1_EN : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: Set this bit to delay the stop bit by 1 bit.*/ -#define UART_DL1_EN (BIT(2)) -#define UART_DL1_EN_M (BIT(2)) -#define UART_DL1_EN_V 0x1 -#define UART_DL1_EN_S 2 -/* UART_DL0_EN : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: Set this bit to delay the stop bit by 1 bit.*/ -#define UART_DL0_EN (BIT(1)) -#define UART_DL0_EN_M (BIT(1)) -#define UART_DL0_EN_V 0x1 -#define UART_DL0_EN_S 1 -/* UART_RS485_EN : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: Set this bit to choose rs485 mode.*/ -#define UART_RS485_EN (BIT(0)) -#define UART_RS485_EN_M (BIT(0)) -#define UART_RS485_EN_V 0x1 -#define UART_RS485_EN_S 0 - -#define UART_AT_CMD_PRECNT_REG(i) (REG_UART_BASE(i) + 0x48) -/* UART_PRE_IDLE_NUM : R/W ;bitpos:[23:0] ;default: 24'h186a00 ; */ -/*description: This register is used to configure the idle duration time before - the first at_cmd is received by receiver. when the the duration is less than this register value it will not take the next data received as at_cmd char.*/ -#define UART_PRE_IDLE_NUM 0x00FFFFFF -#define UART_PRE_IDLE_NUM_M ((UART_PRE_IDLE_NUM_V)<<(UART_PRE_IDLE_NUM_S)) -#define UART_PRE_IDLE_NUM_V 0xFFFFFF -#define UART_PRE_IDLE_NUM_S 0 - -#define UART_AT_CMD_POSTCNT_REG(i) (REG_UART_BASE(i) + 0x4c) -/* UART_POST_IDLE_NUM : R/W ;bitpos:[23:0] ;default: 24'h186a00 ; */ -/*description: This register is used to configure the duration time between - the last at_cmd and the next data. when the duration is less than this register value it will not take the previous data as at_cmd char.*/ -#define UART_POST_IDLE_NUM 0x00FFFFFF -#define UART_POST_IDLE_NUM_M ((UART_POST_IDLE_NUM_V)<<(UART_POST_IDLE_NUM_S)) -#define UART_POST_IDLE_NUM_V 0xFFFFFF -#define UART_POST_IDLE_NUM_S 0 - -#define UART_AT_CMD_GAPTOUT_REG(i) (REG_UART_BASE(i) + 0x50) -/* UART_RX_GAP_TOUT : R/W ;bitpos:[23:0] ;default: 24'h1e00 ; */ -/*description: This register is used to configure the duration time between - the at_cmd chars. when the duration time is less than this register value it will not take the datas as continous at_cmd chars.*/ -#define UART_RX_GAP_TOUT 0x00FFFFFF -#define UART_RX_GAP_TOUT_M ((UART_RX_GAP_TOUT_V)<<(UART_RX_GAP_TOUT_S)) -#define UART_RX_GAP_TOUT_V 0xFFFFFF -#define UART_RX_GAP_TOUT_S 0 - -#define UART_AT_CMD_CHAR_REG(i) (REG_UART_BASE(i) + 0x54) -/* UART_CHAR_NUM : R/W ;bitpos:[15:8] ;default: 8'h3 ; */ -/*description: This register is used to configure the num of continous at_cmd - chars received by receiver.*/ -#define UART_CHAR_NUM 0x000000FF -#define UART_CHAR_NUM_M ((UART_CHAR_NUM_V)<<(UART_CHAR_NUM_S)) -#define UART_CHAR_NUM_V 0xFF -#define UART_CHAR_NUM_S 8 -/* UART_AT_CMD_CHAR : R/W ;bitpos:[7:0] ;default: 8'h2b ; */ -/*description: This register is used to configure the content of at_cmd char.*/ -#define UART_AT_CMD_CHAR 0x000000FF -#define UART_AT_CMD_CHAR_M ((UART_AT_CMD_CHAR_V)<<(UART_AT_CMD_CHAR_S)) -#define UART_AT_CMD_CHAR_V 0xFF -#define UART_AT_CMD_CHAR_S 0 - -#define UART_MEM_CONF_REG(i) (REG_UART_BASE(i) + 0x58) -/* UART_TX_MEM_EMPTY_THRHD : R/W ;bitpos:[30:28] ;default: 3'h0 ; */ -/*description: refer to txfifo_empty_thrhd 's describtion.*/ -#define UART_TX_MEM_EMPTY_THRHD 0x00000007 -#define UART_TX_MEM_EMPTY_THRHD_M ((UART_TX_MEM_EMPTY_THRHD_V)<<(UART_TX_MEM_EMPTY_THRHD_S)) -#define UART_TX_MEM_EMPTY_THRHD_V 0x7 -#define UART_TX_MEM_EMPTY_THRHD_S 28 -/* UART_RX_MEM_FULL_THRHD : R/W ;bitpos:[27:25] ;default: 3'h0 ; */ -/*description: refer to the rxfifo_full_thrhd's describtion.*/ -#define UART_RX_MEM_FULL_THRHD 0x00000007 -#define UART_RX_MEM_FULL_THRHD_M ((UART_RX_MEM_FULL_THRHD_V)<<(UART_RX_MEM_FULL_THRHD_S)) -#define UART_RX_MEM_FULL_THRHD_V 0x7 -#define UART_RX_MEM_FULL_THRHD_S 25 -/* UART_XOFF_THRESHOLD_H2 : R/W ;bitpos:[24:23] ;default: 2'h0 ; */ -/*description: refer to the uart_xoff_threshold's describtion.*/ -#define UART_XOFF_THRESHOLD_H2 0x00000003 -#define UART_XOFF_THRESHOLD_H2_M ((UART_XOFF_THRESHOLD_H2_V)<<(UART_XOFF_THRESHOLD_H2_S)) -#define UART_XOFF_THRESHOLD_H2_V 0x3 -#define UART_XOFF_THRESHOLD_H2_S 23 -/* UART_XON_THRESHOLD_H2 : R/W ;bitpos:[22:21] ;default: 2'h0 ; */ -/*description: refer to the uart_xon_threshold's describtion.*/ -#define UART_XON_THRESHOLD_H2 0x00000003 -#define UART_XON_THRESHOLD_H2_M ((UART_XON_THRESHOLD_H2_V)<<(UART_XON_THRESHOLD_H2_S)) -#define UART_XON_THRESHOLD_H2_V 0x3 -#define UART_XON_THRESHOLD_H2_S 21 -/* UART_RX_TOUT_THRHD_H3 : R/W ;bitpos:[20:18] ;default: 3'h0 ; */ -/*description: refer to the rx_tout_thrhd's describtion.*/ -#define UART_RX_TOUT_THRHD_H3 0x00000007 -#define UART_RX_TOUT_THRHD_H3_M ((UART_RX_TOUT_THRHD_H3_V)<<(UART_RX_TOUT_THRHD_H3_S)) -#define UART_RX_TOUT_THRHD_H3_V 0x7 -#define UART_RX_TOUT_THRHD_H3_S 18 -/* UART_RX_FLOW_THRHD_H3 : R/W ;bitpos:[17:15] ;default: 3'h0 ; */ -/*description: refer to the rx_flow_thrhd's describtion.*/ -#define UART_RX_FLOW_THRHD_H3 0x00000007 -#define UART_RX_FLOW_THRHD_H3_M ((UART_RX_FLOW_THRHD_H3_V)<<(UART_RX_FLOW_THRHD_H3_S)) -#define UART_RX_FLOW_THRHD_H3_V 0x7 -#define UART_RX_FLOW_THRHD_H3_S 15 -/* UART_TX_SIZE : R/W ;bitpos:[10:7] ;default: 4'h1 ; */ -/*description: This register is used to configure the amount of mem allocated - to transmitter's fifo.the default byte num is 128.*/ -#define UART_TX_SIZE 0x0000000F -#define UART_TX_SIZE_M ((UART_TX_SIZE_V)<<(UART_TX_SIZE_S)) -#define UART_TX_SIZE_V 0xF -#define UART_TX_SIZE_S 7 -/* UART_RX_SIZE : R/W ;bitpos:[6:3] ;default: 4'h1 ; */ -/*description: This register is used to configure the amount of mem allocated - to receiver's fifo. the default byte num is 128.*/ -#define UART_RX_SIZE 0x0000000F -#define UART_RX_SIZE_M ((UART_RX_SIZE_V)<<(UART_RX_SIZE_S)) -#define UART_RX_SIZE_V 0xF -#define UART_RX_SIZE_S 3 -/* UART_MEM_PD : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: Set this bit to power down mem.when reg_mem_pd registers in - the 3 uarts are all set to 1 mem will enter low power mode.*/ -#define UART_MEM_PD (BIT(0)) -#define UART_MEM_PD_M (BIT(0)) -#define UART_MEM_PD_V 0x1 -#define UART_MEM_PD_S 0 - -#define UART_MEM_TX_STATUS_REG(i) (REG_UART_BASE(i) + 0x5c) -/* UART_MEM_TX_STATUS : RO ;bitpos:[23:0] ;default: 24'h0 ; */ -/*description: */ -#define UART_MEM_TX_STATUS 0x00FFFFFF -#define UART_MEM_TX_STATUS_M ((UART_MEM_TX_STATUS_V)<<(UART_MEM_TX_STATUS_S)) -#define UART_MEM_TX_STATUS_V 0xFFFFFF -#define UART_MEM_TX_STATUS_S 0 - -#define UART_MEM_RX_STATUS_REG(i) (REG_UART_BASE(i) + 0x60) -/* UART_MEM_RX_STATUS : RO ;bitpos:[23:0] ;default: 24'h0 ; */ -/*description: This register stores the current uart rx mem read address - and rx mem write address */ -#define UART_MEM_RX_STATUS 0x00FFFFFF -#define UART_MEM_RX_STATUS_M ((UART_MEM_RX_STATUS_V)<<(UART_MEM_RX_STATUS_S)) -#define UART_MEM_RX_STATUS_V 0xFFFFFF -#define UART_MEM_RX_STATUS_S 0 -/* UART_MEM_RX_RD_ADDR : RO ;bitpos:[12:2] ;default: 11'h0 ; */ -/*description: This register stores the rx mem read address */ -#define UART_MEM_RX_RD_ADDR 0x000007FF -#define UART_MEM_RX_RD_ADDR_M ((UART_MEM_RX_RD_ADDR_V)<<(UART_MEM_RX_RD_ADDR_S)) -#define UART_MEM_RX_RD_ADDR_V (0x7FF) -#define UART_MEM_RX_RD_ADDR_S (2) -/* UART_MEM_RX_WR_ADDR : RO ;bitpos:[23:13] ;default: 11'h0 ; */ -/*description: This register stores the rx mem write address */ -#define UART_MEM_RX_WR_ADDR 0x000007FF -#define UART_MEM_RX_WR_ADDR_M ((UART_MEM_RX_WR_ADDR_V)<<(UART_MEM_RX_WR_ADDR_S)) -#define UART_MEM_RX_WR_ADDR_V (0x7FF) -#define UART_MEM_RX_WR_ADDR_S (13) - -#define UART_MEM_CNT_STATUS_REG(i) (REG_UART_BASE(i) + 0x64) -/* UART_TX_MEM_CNT : RO ;bitpos:[5:3] ;default: 3'b0 ; */ -/*description: refer to the txfifo_cnt's describtion.*/ -#define UART_TX_MEM_CNT 0x00000007 -#define UART_TX_MEM_CNT_M ((UART_TX_MEM_CNT_V)<<(UART_TX_MEM_CNT_S)) -#define UART_TX_MEM_CNT_V 0x7 -#define UART_TX_MEM_CNT_S 3 -/* UART_RX_MEM_CNT : RO ;bitpos:[2:0] ;default: 3'b0 ; */ -/*description: refer to the rxfifo_cnt's describtion.*/ -#define UART_RX_MEM_CNT 0x00000007 -#define UART_RX_MEM_CNT_M ((UART_RX_MEM_CNT_V)<<(UART_RX_MEM_CNT_S)) -#define UART_RX_MEM_CNT_V 0x7 -#define UART_RX_MEM_CNT_S 0 - -#define UART_POSPULSE_REG(i) (REG_UART_BASE(i) + 0x68) -/* UART_POSEDGE_MIN_CNT : RO ;bitpos:[19:0] ;default: 20'hFFFFF ; */ -/*description: This register stores the count of rxd posedge edge. it is used - in boudrate-detect process.*/ -#define UART_POSEDGE_MIN_CNT 0x000FFFFF -#define UART_POSEDGE_MIN_CNT_M ((UART_POSEDGE_MIN_CNT_V)<<(UART_POSEDGE_MIN_CNT_S)) -#define UART_POSEDGE_MIN_CNT_V 0xFFFFF -#define UART_POSEDGE_MIN_CNT_S 0 - -#define UART_NEGPULSE_REG(i) (REG_UART_BASE(i) + 0x6c) -/* UART_NEGEDGE_MIN_CNT : RO ;bitpos:[19:0] ;default: 20'hFFFFF ; */ -/*description: This register stores the count of rxd negedge edge. it is used - in boudrate-detect process.*/ -#define UART_NEGEDGE_MIN_CNT 0x000FFFFF -#define UART_NEGEDGE_MIN_CNT_M ((UART_NEGEDGE_MIN_CNT_V)<<(UART_NEGEDGE_MIN_CNT_S)) -#define UART_NEGEDGE_MIN_CNT_V 0xFFFFF -#define UART_NEGEDGE_MIN_CNT_S 0 - -#define UART_DATE_REG(i) (REG_UART_BASE(i) + 0x78) -/* UART_DATE : R/W ;bitpos:[31:0] ;default: 32'h15122500 ; */ -/*description: */ -#define UART_DATE 0xFFFFFFFF -#define UART_DATE_M ((UART_DATE_V)<<(UART_DATE_S)) -#define UART_DATE_V 0xFFFFFFFF -#define UART_DATE_S 0 - -#define UART_ID_REG(i) (REG_UART_BASE(i) + 0x7C) -/* UART_ID : R/W ;bitpos:[31:0] ;default: 32'h0500 ; */ -/*description: */ -#define UART_ID 0xFFFFFFFF -#define UART_ID_M ((UART_ID_V)<<(UART_ID_S)) -#define UART_ID_V 0xFFFFFFFF -#define UART_ID_S 0 - - - - -#endif /*__UART_REG_H__ */ - - diff --git a/tools/sdk/include/soc/soc/uart_struct.h b/tools/sdk/include/soc/soc/uart_struct.h deleted file mode 100644 index 59b84d2afc2..00000000000 --- a/tools/sdk/include/soc/soc/uart_struct.h +++ /dev/null @@ -1,381 +0,0 @@ -// 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. -#ifndef _SOC_UART_STRUCT_H_ -#define _SOC_UART_STRUCT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef volatile struct { - union { - struct { - uint8_t rw_byte; /*This register stores one byte data read by rx fifo.*/ - uint8_t reserved[3]; - }; - uint32_t val; - } fifo; - union { - struct { - uint32_t rxfifo_full: 1; /*This interrupt raw bit turns to high level when receiver receives more data than (rx_flow_thrhd_h3 rx_flow_thrhd).*/ - uint32_t txfifo_empty: 1; /*This interrupt raw bit turns to high level when the amount of data in transmitter's fifo is less than ((tx_mem_cnttxfifo_cnt) .*/ - uint32_t parity_err: 1; /*This interrupt raw bit turns to high level when receiver detects the parity error of data.*/ - uint32_t frm_err: 1; /*This interrupt raw bit turns to high level when receiver detects data's frame error .*/ - uint32_t rxfifo_ovf: 1; /*This interrupt raw bit turns to high level when receiver receives more data than the fifo can store.*/ - uint32_t dsr_chg: 1; /*This interrupt raw bit turns to high level when receiver detects the edge change of dsrn signal.*/ - uint32_t cts_chg: 1; /*This interrupt raw bit turns to high level when receiver detects the edge change of ctsn signal.*/ - uint32_t brk_det: 1; /*This interrupt raw bit turns to high level when receiver detects the 0 after the stop bit.*/ - uint32_t rxfifo_tout: 1; /*This interrupt raw bit turns to high level when receiver takes more time than rx_tout_thrhd to receive a byte.*/ - uint32_t sw_xon: 1; /*This interrupt raw bit turns to high level when receiver receives xoff char with uart_sw_flow_con_en is set to 1.*/ - uint32_t sw_xoff: 1; /*This interrupt raw bit turns to high level when receiver receives xon char with uart_sw_flow_con_en is set to 1.*/ - uint32_t glitch_det: 1; /*This interrupt raw bit turns to high level when receiver detects the start bit.*/ - uint32_t tx_brk_done: 1; /*This interrupt raw bit turns to high level when transmitter completes sending 0 after all the data in transmitter's fifo are send.*/ - uint32_t tx_brk_idle_done: 1; /*This interrupt raw bit turns to high level when transmitter has kept the shortest duration after the last data has been send.*/ - uint32_t tx_done: 1; /*This interrupt raw bit turns to high level when transmitter has send all the data in fifo.*/ - uint32_t rs485_parity_err: 1; /*This interrupt raw bit turns to high level when rs485 detects the parity error.*/ - uint32_t rs485_frm_err: 1; /*This interrupt raw bit turns to high level when rs485 detects the data frame error.*/ - uint32_t rs485_clash: 1; /*This interrupt raw bit turns to high level when rs485 detects the clash between transmitter and receiver.*/ - uint32_t at_cmd_char_det: 1; /*This interrupt raw bit turns to high level when receiver detects the configured at_cmd chars.*/ - uint32_t reserved19: 13; - }; - uint32_t val; - } int_raw; - union { - struct { - uint32_t rxfifo_full: 1; /*This is the status bit for rxfifo_full_int_raw when rxfifo_full_int_ena is set to 1.*/ - uint32_t txfifo_empty: 1; /*This is the status bit for txfifo_empty_int_raw when txfifo_empty_int_ena is set to 1.*/ - uint32_t parity_err: 1; /*This is the status bit for parity_err_int_raw when parity_err_int_ena is set to 1.*/ - uint32_t frm_err: 1; /*This is the status bit for frm_err_int_raw when fm_err_int_ena is set to 1.*/ - uint32_t rxfifo_ovf: 1; /*This is the status bit for rxfifo_ovf_int_raw when rxfifo_ovf_int_ena is set to 1.*/ - uint32_t dsr_chg: 1; /*This is the status bit for dsr_chg_int_raw when dsr_chg_int_ena is set to 1.*/ - uint32_t cts_chg: 1; /*This is the status bit for cts_chg_int_raw when cts_chg_int_ena is set to 1.*/ - uint32_t brk_det: 1; /*This is the status bit for brk_det_int_raw when brk_det_int_ena is set to 1.*/ - uint32_t rxfifo_tout: 1; /*This is the status bit for rxfifo_tout_int_raw when rxfifo_tout_int_ena is set to 1.*/ - uint32_t sw_xon: 1; /*This is the status bit for sw_xon_int_raw when sw_xon_int_ena is set to 1.*/ - uint32_t sw_xoff: 1; /*This is the status bit for sw_xoff_int_raw when sw_xoff_int_ena is set to 1.*/ - uint32_t glitch_det: 1; /*This is the status bit for glitch_det_int_raw when glitch_det_int_ena is set to 1.*/ - uint32_t tx_brk_done: 1; /*This is the status bit for tx_brk_done_int_raw when tx_brk_done_int_ena is set to 1.*/ - uint32_t tx_brk_idle_done: 1; /*This is the status bit for tx_brk_idle_done_int_raw when tx_brk_idle_done_int_ena is set to 1.*/ - uint32_t tx_done: 1; /*This is the status bit for tx_done_int_raw when tx_done_int_ena is set to 1.*/ - uint32_t rs485_parity_err: 1; /*This is the status bit for rs485_parity_err_int_raw when rs485_parity_int_ena is set to 1.*/ - uint32_t rs485_frm_err: 1; /*This is the status bit for rs485_fm_err_int_raw when rs485_fm_err_int_ena is set to 1.*/ - uint32_t rs485_clash: 1; /*This is the status bit for rs485_clash_int_raw when rs485_clash_int_ena is set to 1.*/ - uint32_t at_cmd_char_det: 1; /*This is the status bit for at_cmd_det_int_raw when at_cmd_char_det_int_ena is set to 1.*/ - uint32_t reserved19: 13; - }; - uint32_t val; - } int_st; - union { - struct { - uint32_t rxfifo_full: 1; /*This is the enable bit for rxfifo_full_int_st register.*/ - uint32_t txfifo_empty: 1; /*This is the enable bit for rxfifo_full_int_st register.*/ - uint32_t parity_err: 1; /*This is the enable bit for parity_err_int_st register.*/ - uint32_t frm_err: 1; /*This is the enable bit for frm_err_int_st register.*/ - uint32_t rxfifo_ovf: 1; /*This is the enable bit for rxfifo_ovf_int_st register.*/ - uint32_t dsr_chg: 1; /*This is the enable bit for dsr_chg_int_st register.*/ - uint32_t cts_chg: 1; /*This is the enable bit for cts_chg_int_st register.*/ - uint32_t brk_det: 1; /*This is the enable bit for brk_det_int_st register.*/ - uint32_t rxfifo_tout: 1; /*This is the enable bit for rxfifo_tout_int_st register.*/ - uint32_t sw_xon: 1; /*This is the enable bit for sw_xon_int_st register.*/ - uint32_t sw_xoff: 1; /*This is the enable bit for sw_xoff_int_st register.*/ - uint32_t glitch_det: 1; /*This is the enable bit for glitch_det_int_st register.*/ - uint32_t tx_brk_done: 1; /*This is the enable bit for tx_brk_done_int_st register.*/ - uint32_t tx_brk_idle_done: 1; /*This is the enable bit for tx_brk_idle_done_int_st register.*/ - uint32_t tx_done: 1; /*This is the enable bit for tx_done_int_st register.*/ - uint32_t rs485_parity_err: 1; /*This is the enable bit for rs485_parity_err_int_st register.*/ - uint32_t rs485_frm_err: 1; /*This is the enable bit for rs485_parity_err_int_st register.*/ - uint32_t rs485_clash: 1; /*This is the enable bit for rs485_clash_int_st register.*/ - uint32_t at_cmd_char_det: 1; /*This is the enable bit for at_cmd_char_det_int_st register.*/ - uint32_t reserved19: 13; - }; - uint32_t val; - } int_ena; - union { - struct { - uint32_t rxfifo_full: 1; /*Set this bit to clear the rxfifo_full_int_raw interrupt.*/ - uint32_t txfifo_empty: 1; /*Set this bit to clear txfifo_empty_int_raw interrupt.*/ - uint32_t parity_err: 1; /*Set this bit to clear parity_err_int_raw interrupt.*/ - uint32_t frm_err: 1; /*Set this bit to clear frm_err_int_raw interrupt.*/ - uint32_t rxfifo_ovf: 1; /*Set this bit to clear rxfifo_ovf_int_raw interrupt.*/ - uint32_t dsr_chg: 1; /*Set this bit to clear the dsr_chg_int_raw interrupt.*/ - uint32_t cts_chg: 1; /*Set this bit to clear the cts_chg_int_raw interrupt.*/ - uint32_t brk_det: 1; /*Set this bit to clear the brk_det_int_raw interrupt.*/ - uint32_t rxfifo_tout: 1; /*Set this bit to clear the rxfifo_tout_int_raw interrupt.*/ - uint32_t sw_xon: 1; /*Set this bit to clear the sw_xon_int_raw interrupt.*/ - uint32_t sw_xoff: 1; /*Set this bit to clear the sw_xon_int_raw interrupt.*/ - uint32_t glitch_det: 1; /*Set this bit to clear the glitch_det_int_raw interrupt.*/ - uint32_t tx_brk_done: 1; /*Set this bit to clear the tx_brk_done_int_raw interrupt..*/ - uint32_t tx_brk_idle_done: 1; /*Set this bit to clear the tx_brk_idle_done_int_raw interrupt.*/ - uint32_t tx_done: 1; /*Set this bit to clear the tx_done_int_raw interrupt.*/ - uint32_t rs485_parity_err: 1; /*Set this bit to clear the rs485_parity_err_int_raw interrupt.*/ - uint32_t rs485_frm_err: 1; /*Set this bit to clear the rs485_frm_err_int_raw interrupt.*/ - uint32_t rs485_clash: 1; /*Set this bit to clear the rs485_clash_int_raw interrupt.*/ - uint32_t at_cmd_char_det: 1; /*Set this bit to clear the at_cmd_char_det_int_raw interrupt.*/ - uint32_t reserved19: 13; - }; - uint32_t val; - } int_clr; - union { - struct { - uint32_t div_int: 20; /*The register value is the integer part of the frequency divider's factor.*/ - uint32_t div_frag: 4; /*The register value is the decimal part of the frequency divider's factor.*/ - uint32_t reserved24: 8; - }; - uint32_t val; - } clk_div; - union { - struct { - uint32_t en: 1; /*This is the enable bit for detecting baudrate.*/ - uint32_t reserved1: 7; - uint32_t glitch_filt: 8; /*when input pulse width is lower then this value ignore this pulse.this register is used in auto-baud detect process.*/ - uint32_t reserved16: 16; - }; - uint32_t val; - } auto_baud; - union { - struct { - uint32_t rxfifo_cnt: 8; /*(rx_mem_cnt rxfifo_cnt) stores the byte number of valid data in receiver's fifo. rx_mem_cnt register stores the 3 most significant bits rxfifo_cnt stores the 8 least significant bits.*/ - uint32_t st_urx_out: 4; /*This register stores the value of receiver's finite state machine. 0:RX_IDLE 1:RX_STRT 2:RX_DAT0 3:RX_DAT1 4:RX_DAT2 5:RX_DAT3 6:RX_DAT4 7:RX_DAT5 8:RX_DAT6 9:RX_DAT7 10:RX_PRTY 11:RX_STP1 12:RX_STP2 13:RX_DL1*/ - uint32_t reserved12: 1; - uint32_t dsrn: 1; /*This register stores the level value of the internal uart dsr signal.*/ - uint32_t ctsn: 1; /*This register stores the level value of the internal uart cts signal.*/ - uint32_t rxd: 1; /*This register stores the level value of the internal uart rxd signal.*/ - uint32_t txfifo_cnt: 8; /*(tx_mem_cnt txfifo_cnt) stores the byte number of valid data in transmitter's fifo.tx_mem_cnt stores the 3 most significant bits txfifo_cnt stores the 8 least significant bits.*/ - uint32_t st_utx_out: 4; /*This register stores the value of transmitter's finite state machine. 0:TX_IDLE 1:TX_STRT 2:TX_DAT0 3:TX_DAT1 4:TX_DAT2 5:TX_DAT3 6:TX_DAT4 7:TX_DAT5 8:TX_DAT6 9:TX_DAT7 10:TX_PRTY 11:TX_STP1 12:TX_STP2 13:TX_DL0 14:TX_DL1*/ - uint32_t reserved28: 1; - uint32_t dtrn: 1; /*The register represent the level value of the internal uart dsr signal.*/ - uint32_t rtsn: 1; /*This register represent the level value of the internal uart cts signal.*/ - uint32_t txd: 1; /*This register represent the level value of the internal uart rxd signal.*/ - }; - uint32_t val; - } status; - union { - struct { - uint32_t parity: 1; /*This register is used to configure the parity check mode. 0:even 1:odd*/ - uint32_t parity_en: 1; /*Set this bit to enable uart parity check.*/ - uint32_t bit_num: 2; /*This register is used to set the length of data: 0:5bits 1:6bits 2:7bits 3:8bits*/ - uint32_t stop_bit_num: 2; /*This register is used to set the length of stop bit. 1:1bit 2:1.5bits 3:2bits*/ - uint32_t sw_rts: 1; /*This register is used to configure the software rts signal which is used in software flow control.*/ - uint32_t sw_dtr: 1; /*This register is used to configure the software dtr signal which is used in software flow control..*/ - uint32_t txd_brk: 1; /*Set this bit to enable transmitter to send 0 when the process of sending data is done.*/ - uint32_t irda_dplx: 1; /*Set this bit to enable irda loop-back mode.*/ - uint32_t irda_tx_en: 1; /*This is the start enable bit for irda transmitter.*/ - uint32_t irda_wctl: 1; /*1:the irda transmitter's 11th bit is the same to the 10th bit. 0:set irda transmitter's 11th bit to 0.*/ - uint32_t irda_tx_inv: 1; /*Set this bit to inverse the level value of irda transmitter's level.*/ - uint32_t irda_rx_inv: 1; /*Set this bit to inverse the level value of irda receiver's level.*/ - uint32_t loopback: 1; /*Set this bit to enable uart loop-back test mode.*/ - uint32_t tx_flow_en: 1; /*Set this bit to enable transmitter's flow control function.*/ - uint32_t irda_en: 1; /*Set this bit to enable irda protocol.*/ - uint32_t rxfifo_rst: 1; /*Set this bit to reset uart receiver's fifo.*/ - uint32_t txfifo_rst: 1; /*Set this bit to reset uart transmitter's fifo.*/ - uint32_t rxd_inv: 1; /*Set this bit to inverse the level value of uart rxd signal.*/ - uint32_t cts_inv: 1; /*Set this bit to inverse the level value of uart cts signal.*/ - uint32_t dsr_inv: 1; /*Set this bit to inverse the level value of uart dsr signal.*/ - uint32_t txd_inv: 1; /*Set this bit to inverse the level value of uart txd signal.*/ - uint32_t rts_inv: 1; /*Set this bit to inverse the level value of uart rts signal.*/ - uint32_t dtr_inv: 1; /*Set this bit to inverse the level value of uart dtr signal.*/ - uint32_t clk_en: 1; /*1:force clock on for registers:support clock only when write registers*/ - uint32_t err_wr_mask: 1; /*1:receiver stops storing data int fifo when data is wrong. 0:receiver stores the data even if the received data is wrong.*/ - uint32_t tick_ref_always_on: 1; /*This register is used to select the clock.1:apb clock:ref_tick*/ - uint32_t reserved28: 4; - }; - uint32_t val; - } conf0; - union { - struct { - uint32_t rxfifo_full_thrhd: 7; /*When receiver receives more data than its threshold value,receiver will produce rxfifo_full_int_raw interrupt.the threshold value is (rx_flow_thrhd_h3 rxfifo_full_thrhd).*/ - uint32_t reserved7: 1; - uint32_t txfifo_empty_thrhd: 7; /*when the data amount in transmitter fifo is less than its threshold value, it will produce txfifo_empty_int_raw interrupt. the threshold value is (tx_mem_empty_thrhd txfifo_empty_thrhd)*/ - uint32_t reserved15: 1; - uint32_t rx_flow_thrhd: 7; /*when receiver receives more data than its threshold value, receiver produce signal to tell the transmitter stop transferring data. the threshold value is (rx_flow_thrhd_h3 rx_flow_thrhd).*/ - uint32_t rx_flow_en: 1; /*This is the flow enable bit for uart receiver. 1:choose software flow control with configuring sw_rts signal*/ - uint32_t rx_tout_thrhd: 7; /*This register is used to configure the timeout value for uart receiver receiving a byte.*/ - uint32_t rx_tout_en: 1; /*This is the enable bit for uart receiver's timeout function.*/ - }; - uint32_t val; - } conf1; - union { - struct { - uint32_t min_cnt: 20; /*This register stores the value of the minimum duration time for the low level pulse, it is used in baudrate-detect process.*/ - uint32_t reserved20: 12; - }; - uint32_t val; - } lowpulse; - union { - struct { - uint32_t min_cnt: 20; /*This register stores the value of the maximum duration time for the high level pulse, it is used in baudrate-detect process.*/ - uint32_t reserved20: 12; - }; - uint32_t val; - } highpulse; - union { - struct { - uint32_t edge_cnt: 10; /*This register stores the count of rxd edge change, it is used in baudrate-detect process.*/ - uint32_t reserved10: 22; - }; - uint32_t val; - } rxd_cnt; - union { - struct { - uint32_t sw_flow_con_en: 1; /*Set this bit to enable software flow control. it is used with register sw_xon or sw_xoff .*/ - uint32_t xonoff_del: 1; /*Set this bit to remove flow control char from the received data.*/ - uint32_t force_xon: 1; /*Set this bit to clear ctsn to stop the transmitter from sending data.*/ - uint32_t force_xoff: 1; /*Set this bit to set ctsn to enable the transmitter to go on sending data.*/ - uint32_t send_xon: 1; /*Set this bit to send xon char, it is cleared by hardware automatically.*/ - uint32_t send_xoff: 1; /*Set this bit to send xoff char, it is cleared by hardware automatically.*/ - uint32_t reserved6: 26; - }; - uint32_t val; - } flow_conf; - union { - struct { - uint32_t active_threshold:10; /*When the input rxd edge changes more than this register value, the uart is active from light sleeping mode.*/ - uint32_t reserved10: 22; - }; - uint32_t val; - } sleep_conf; - union { - struct { - uint32_t xon_threshold: 8; /*when the data amount in receiver's fifo is more than this register value, it will send a xoff char with uart_sw_flow_con_en set to 1.*/ - uint32_t xoff_threshold: 8; /*When the data amount in receiver's fifo is less than this register value, it will send a xon char with uart_sw_flow_con_en set to 1.*/ - uint32_t xon_char: 8; /*This register stores the xon flow control char.*/ - uint32_t xoff_char: 8; /*This register stores the xoff flow control char.*/ - }; - uint32_t val; - } swfc_conf; - union { - struct { - uint32_t rx_idle_thrhd:10; /*when receiver takes more time than this register value to receive a byte data, it will produce frame end signal for uhci to stop receiving data.*/ - uint32_t tx_idle_num: 10; /*This register is used to configure the duration time between transfers.*/ - uint32_t tx_brk_num: 8; /*This register is used to configure the number of 0 send after the process of sending data is done. it is active when txd_brk is set to 1.*/ - uint32_t reserved28: 4; - }; - uint32_t val; - } idle_conf; - union { - struct { - uint32_t en: 1; /*Set this bit to choose rs485 mode.*/ - uint32_t dl0_en: 1; /*Set this bit to delay the stop bit by 1 bit.*/ - uint32_t dl1_en: 1; /*Set this bit to delay the stop bit by 1 bit.*/ - uint32_t tx_rx_en: 1; /*Set this bit to enable loop-back transmitter's output data signal to receiver's input data signal.*/ - uint32_t rx_busy_tx_en: 1; /*1: enable rs485's transmitter to send data when rs485's receiver is busy. 0:rs485's transmitter should not send data when its receiver is busy.*/ - uint32_t rx_dly_num: 1; /*This register is used to delay the receiver's internal data signal.*/ - uint32_t tx_dly_num: 4; /*This register is used to delay the transmitter's internal data signal.*/ - uint32_t reserved10: 22; - }; - uint32_t val; - } rs485_conf; - union { - struct { - uint32_t pre_idle_num:24; /*This register is used to configure the idle duration time before the first at_cmd is received by receiver, when the the duration is less than this register value it will not take the next data received as at_cmd char.*/ - uint32_t reserved24: 8; - }; - uint32_t val; - } at_cmd_precnt; - union { - struct { - uint32_t post_idle_num:24; /*This register is used to configure the duration time between the last at_cmd and the next data, when the duration is less than this register value it will not take the previous data as at_cmd char.*/ - uint32_t reserved24: 8; - }; - uint32_t val; - } at_cmd_postcnt; - union { - struct { - uint32_t rx_gap_tout:24; /*This register is used to configure the duration time between the at_cmd chars, when the duration time is less than this register value it will not take the data as continous at_cmd chars.*/ - uint32_t reserved24: 8; - }; - uint32_t val; - } at_cmd_gaptout; - union { - struct { - uint32_t data: 8; /*This register is used to configure the content of at_cmd char.*/ - uint32_t char_num: 8; /*This register is used to configure the number of continuous at_cmd chars received by receiver.*/ - uint32_t reserved16: 16; - }; - uint32_t val; - } at_cmd_char; - union { - struct { - uint32_t mem_pd: 1; /*Set this bit to power down memory,when reg_mem_pd registers in the 3 uarts are all set to 1 memory will enter low power mode.*/ - uint32_t reserved1: 1; - uint32_t reserved2: 1; - uint32_t rx_size: 4; /*This register is used to configure the amount of mem allocated to receiver's fifo. the default byte num is 128.*/ - uint32_t tx_size: 4; /*This register is used to configure the amount of mem allocated to transmitter's fifo.the default byte num is 128.*/ - uint32_t reserved11: 4; - uint32_t rx_flow_thrhd_h3: 3; /*refer to the rx_flow_thrhd's description.*/ - uint32_t rx_tout_thrhd_h3: 3; /*refer to the rx_tout_thrhd's description.*/ - uint32_t xon_threshold_h2: 2; /*refer to the uart_xon_threshold's description.*/ - uint32_t xoff_threshold_h2: 2; /*refer to the uart_xoff_threshold's description.*/ - uint32_t rx_mem_full_thrhd: 3; /*refer to the rxfifo_full_thrhd's description.*/ - uint32_t tx_mem_empty_thrhd: 3; /*refer to txfifo_empty_thrhd 's description.*/ - uint32_t reserved31: 1; - }; - uint32_t val; - } mem_conf; - union { - struct { - uint32_t status:24; - uint32_t reserved24: 8; - }; - uint32_t val; - } mem_tx_status; - union { - struct { - uint32_t status: 24; - uint32_t reserved24: 8; - }; - struct { - uint32_t reserved0: 2; - uint32_t rd_addr: 11; /*This register stores the rx mem read address.*/ - uint32_t wr_addr: 11; /*This register stores the rx mem write address.*/ - uint32_t reserved: 8; - }; - uint32_t val; - } mem_rx_status; - union { - struct { - uint32_t rx_cnt: 3; /*refer to the rxfifo_cnt's description.*/ - uint32_t tx_cnt: 3; /*refer to the txfifo_cnt's description.*/ - uint32_t reserved6: 26; - }; - uint32_t val; - } mem_cnt_status; - union { - struct { - uint32_t min_cnt: 20; /*This register stores the count of rxd pos-edge edge, it is used in baudrate-detect process.*/ - uint32_t reserved20: 12; - }; - uint32_t val; - } pospulse; - union { - struct { - uint32_t min_cnt: 20; /*This register stores the count of rxd neg-edge edge, it is used in baudrate-detect process.*/ - uint32_t reserved20: 12; - }; - uint32_t val; - } negpulse; - uint32_t reserved_70; - uint32_t reserved_74; - uint32_t date; /**/ - uint32_t id; /**/ -} uart_dev_t; -extern uart_dev_t UART0; -extern uart_dev_t UART1; -extern uart_dev_t UART2; - -#ifdef __cplusplus -} -#endif - -#endif /* _SOC_UART_STRUCT_H_ */ diff --git a/tools/sdk/include/soc/soc/uhci_reg.h b/tools/sdk/include/soc/soc/uhci_reg.h deleted file mode 100644 index 973c6b58929..00000000000 --- a/tools/sdk/include/soc/soc/uhci_reg.h +++ /dev/null @@ -1,1260 +0,0 @@ -// 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. -#ifndef _SOC_UHCI_REG_H_ -#define _SOC_UHCI_REG_H_ - - -#include "soc.h" -#define REG_UHCI_BASE(i) (DR_REG_UHCI0_BASE - (i) * 0x8000) -#define UHCI_CONF0_REG(i) (REG_UHCI_BASE(i) + 0x0) -/* UHCI_UART_RX_BRK_EOF_EN : R/W ;bitpos:[23] ;default: 1'b0 ; */ -/*description: Set this bit to enable to use brk char as the end of a data frame.*/ -#define UHCI_UART_RX_BRK_EOF_EN (BIT(23)) -#define UHCI_UART_RX_BRK_EOF_EN_M (BIT(23)) -#define UHCI_UART_RX_BRK_EOF_EN_V 0x1 -#define UHCI_UART_RX_BRK_EOF_EN_S 23 -/* UHCI_CLK_EN : R/W ;bitpos:[22] ;default: 1'b0 ; */ -/*description: Set this bit to enable clock-gating for read or write registers.*/ -#define UHCI_CLK_EN (BIT(22)) -#define UHCI_CLK_EN_M (BIT(22)) -#define UHCI_CLK_EN_V 0x1 -#define UHCI_CLK_EN_S 22 -/* UHCI_ENCODE_CRC_EN : R/W ;bitpos:[21] ;default: 1'b1 ; */ -/*description: Set this bit to enable crc calculation for data frame when bit6 - in the head packet is 1.*/ -#define UHCI_ENCODE_CRC_EN (BIT(21)) -#define UHCI_ENCODE_CRC_EN_M (BIT(21)) -#define UHCI_ENCODE_CRC_EN_V 0x1 -#define UHCI_ENCODE_CRC_EN_S 21 -/* UHCI_LEN_EOF_EN : R/W ;bitpos:[20] ;default: 1'b1 ; */ -/*description: Set this bit to enable to use packet_len in packet head when - the received data is equal to packet_len this means the end of a data frame.*/ -#define UHCI_LEN_EOF_EN (BIT(20)) -#define UHCI_LEN_EOF_EN_M (BIT(20)) -#define UHCI_LEN_EOF_EN_V 0x1 -#define UHCI_LEN_EOF_EN_S 20 -/* UHCI_UART_IDLE_EOF_EN : R/W ;bitpos:[19] ;default: 1'b0 ; */ -/*description: Set this bit to enable to use idle time when the idle time after - data frame is satisfied this means the end of a data frame.*/ -#define UHCI_UART_IDLE_EOF_EN (BIT(19)) -#define UHCI_UART_IDLE_EOF_EN_M (BIT(19)) -#define UHCI_UART_IDLE_EOF_EN_V 0x1 -#define UHCI_UART_IDLE_EOF_EN_S 19 -/* UHCI_CRC_REC_EN : R/W ;bitpos:[18] ;default: 1'b1 ; */ -/*description: Set this bit to enable receiver''s ability of crc calculation - when crc_en bit in head packet is 1 then there will be crc bytes after data_frame*/ -#define UHCI_CRC_REC_EN (BIT(18)) -#define UHCI_CRC_REC_EN_M (BIT(18)) -#define UHCI_CRC_REC_EN_V 0x1 -#define UHCI_CRC_REC_EN_S 18 -/* UHCI_HEAD_EN : R/W ;bitpos:[17] ;default: 1'b1 ; */ -/*description: Set this bit to enable to use head packet before the data frame.*/ -#define UHCI_HEAD_EN (BIT(17)) -#define UHCI_HEAD_EN_M (BIT(17)) -#define UHCI_HEAD_EN_V 0x1 -#define UHCI_HEAD_EN_S 17 -/* UHCI_SEPER_EN : R/W ;bitpos:[16] ;default: 1'b1 ; */ -/*description: Set this bit to use special char to separate the data frame.*/ -#define UHCI_SEPER_EN (BIT(16)) -#define UHCI_SEPER_EN_M (BIT(16)) -#define UHCI_SEPER_EN_V 0x1 -#define UHCI_SEPER_EN_S 16 -/* UHCI_MEM_TRANS_EN : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_MEM_TRANS_EN (BIT(15)) -#define UHCI_MEM_TRANS_EN_M (BIT(15)) -#define UHCI_MEM_TRANS_EN_V 0x1 -#define UHCI_MEM_TRANS_EN_S 15 -/* UHCI_OUT_DATA_BURST_EN : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: Set this bit to enable DMA burst MODE*/ -#define UHCI_OUT_DATA_BURST_EN (BIT(14)) -#define UHCI_OUT_DATA_BURST_EN_M (BIT(14)) -#define UHCI_OUT_DATA_BURST_EN_V 0x1 -#define UHCI_OUT_DATA_BURST_EN_S 14 -/* UHCI_INDSCR_BURST_EN : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: Set this bit to enable DMA out links to use burst mode.*/ -#define UHCI_INDSCR_BURST_EN (BIT(13)) -#define UHCI_INDSCR_BURST_EN_M (BIT(13)) -#define UHCI_INDSCR_BURST_EN_V 0x1 -#define UHCI_INDSCR_BURST_EN_S 13 -/* UHCI_OUTDSCR_BURST_EN : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: Set this bit to enable DMA in links to use burst mode.*/ -#define UHCI_OUTDSCR_BURST_EN (BIT(12)) -#define UHCI_OUTDSCR_BURST_EN_M (BIT(12)) -#define UHCI_OUTDSCR_BURST_EN_V 0x1 -#define UHCI_OUTDSCR_BURST_EN_S 12 -/* UHCI_UART2_CE : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: Set this bit to use UART2 to transmit or receive data.*/ -#define UHCI_UART2_CE (BIT(11)) -#define UHCI_UART2_CE_M (BIT(11)) -#define UHCI_UART2_CE_V 0x1 -#define UHCI_UART2_CE_S 11 -/* UHCI_UART1_CE : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: Set this bit to use UART1 to transmit or receive data.*/ -#define UHCI_UART1_CE (BIT(10)) -#define UHCI_UART1_CE_M (BIT(10)) -#define UHCI_UART1_CE_V 0x1 -#define UHCI_UART1_CE_S 10 -/* UHCI_UART0_CE : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: Set this bit to use UART to transmit or receive data.*/ -#define UHCI_UART0_CE (BIT(9)) -#define UHCI_UART0_CE_M (BIT(9)) -#define UHCI_UART0_CE_V 0x1 -#define UHCI_UART0_CE_S 9 -/* UHCI_OUT_EOF_MODE : R/W ;bitpos:[8] ;default: 1'b1 ; */ -/*description: Set this bit to produce eof after DMA pops all data clear this - bit to produce eof after DMA pushes all data*/ -#define UHCI_OUT_EOF_MODE (BIT(8)) -#define UHCI_OUT_EOF_MODE_M (BIT(8)) -#define UHCI_OUT_EOF_MODE_V 0x1 -#define UHCI_OUT_EOF_MODE_S 8 -/* UHCI_OUT_NO_RESTART_CLR : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: don't use*/ -#define UHCI_OUT_NO_RESTART_CLR (BIT(7)) -#define UHCI_OUT_NO_RESTART_CLR_M (BIT(7)) -#define UHCI_OUT_NO_RESTART_CLR_V 0x1 -#define UHCI_OUT_NO_RESTART_CLR_S 7 -/* UHCI_OUT_AUTO_WRBACK : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: when in link's length is 0 go on to use the next in link automatically.*/ -#define UHCI_OUT_AUTO_WRBACK (BIT(6)) -#define UHCI_OUT_AUTO_WRBACK_M (BIT(6)) -#define UHCI_OUT_AUTO_WRBACK_V 0x1 -#define UHCI_OUT_AUTO_WRBACK_S 6 -/* UHCI_OUT_LOOP_TEST : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: Set this bit to enable loop test for out links.*/ -#define UHCI_OUT_LOOP_TEST (BIT(5)) -#define UHCI_OUT_LOOP_TEST_M (BIT(5)) -#define UHCI_OUT_LOOP_TEST_V 0x1 -#define UHCI_OUT_LOOP_TEST_S 5 -/* UHCI_IN_LOOP_TEST : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: Set this bit to enable loop test for in links.*/ -#define UHCI_IN_LOOP_TEST (BIT(4)) -#define UHCI_IN_LOOP_TEST_M (BIT(4)) -#define UHCI_IN_LOOP_TEST_V 0x1 -#define UHCI_IN_LOOP_TEST_S 4 -/* UHCI_AHBM_RST : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: Set this bit to reset dma ahb interface.*/ -#define UHCI_AHBM_RST (BIT(3)) -#define UHCI_AHBM_RST_M (BIT(3)) -#define UHCI_AHBM_RST_V 0x1 -#define UHCI_AHBM_RST_S 3 -/* UHCI_AHBM_FIFO_RST : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: Set this bit to reset dma ahb fifo.*/ -#define UHCI_AHBM_FIFO_RST (BIT(2)) -#define UHCI_AHBM_FIFO_RST_M (BIT(2)) -#define UHCI_AHBM_FIFO_RST_V 0x1 -#define UHCI_AHBM_FIFO_RST_S 2 -/* UHCI_OUT_RST : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: Set this bit to reset out link operations.*/ -#define UHCI_OUT_RST (BIT(1)) -#define UHCI_OUT_RST_M (BIT(1)) -#define UHCI_OUT_RST_V 0x1 -#define UHCI_OUT_RST_S 1 -/* UHCI_IN_RST : R/W ;bitpos:[0] ;default: 1'h0 ; */ -/*description: Set this bit to reset in link operations.*/ -#define UHCI_IN_RST (BIT(0)) -#define UHCI_IN_RST_M (BIT(0)) -#define UHCI_IN_RST_V 0x1 -#define UHCI_IN_RST_S 0 - -#define UHCI_INT_RAW_REG(i) (REG_UHCI_BASE(i) + 0x4) -/* UHCI_DMA_INFIFO_FULL_WM_INT_RAW : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_DMA_INFIFO_FULL_WM_INT_RAW (BIT(16)) -#define UHCI_DMA_INFIFO_FULL_WM_INT_RAW_M (BIT(16)) -#define UHCI_DMA_INFIFO_FULL_WM_INT_RAW_V 0x1 -#define UHCI_DMA_INFIFO_FULL_WM_INT_RAW_S 16 -/* UHCI_SEND_A_Q_INT_RAW : RO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: When use always_send registers to send a series of short packets - it will produce this interrupt when dma has send the short packet.*/ -#define UHCI_SEND_A_Q_INT_RAW (BIT(15)) -#define UHCI_SEND_A_Q_INT_RAW_M (BIT(15)) -#define UHCI_SEND_A_Q_INT_RAW_V 0x1 -#define UHCI_SEND_A_Q_INT_RAW_S 15 -/* UHCI_SEND_S_Q_INT_RAW : RO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: When use single send registers to send a short packets it will - produce this interrupt when dma has send the short packet.*/ -#define UHCI_SEND_S_Q_INT_RAW (BIT(14)) -#define UHCI_SEND_S_Q_INT_RAW_M (BIT(14)) -#define UHCI_SEND_S_Q_INT_RAW_V 0x1 -#define UHCI_SEND_S_Q_INT_RAW_S 14 -/* UHCI_OUT_TOTAL_EOF_INT_RAW : RO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: When all data have been send it will produce uhci_out_total_eof_int interrupt.*/ -#define UHCI_OUT_TOTAL_EOF_INT_RAW (BIT(13)) -#define UHCI_OUT_TOTAL_EOF_INT_RAW_M (BIT(13)) -#define UHCI_OUT_TOTAL_EOF_INT_RAW_V 0x1 -#define UHCI_OUT_TOTAL_EOF_INT_RAW_S 13 -/* UHCI_OUTLINK_EOF_ERR_INT_RAW : RO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: when there are some errors about eof in outlink descriptor it - will produce uhci_outlink_eof_err_int interrupt.*/ -#define UHCI_OUTLINK_EOF_ERR_INT_RAW (BIT(12)) -#define UHCI_OUTLINK_EOF_ERR_INT_RAW_M (BIT(12)) -#define UHCI_OUTLINK_EOF_ERR_INT_RAW_V 0x1 -#define UHCI_OUTLINK_EOF_ERR_INT_RAW_S 12 -/* UHCI_IN_DSCR_EMPTY_INT_RAW : RO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: when there are not enough in links for DMA it will produce uhci_in_dscr_err_int - interrupt.*/ -#define UHCI_IN_DSCR_EMPTY_INT_RAW (BIT(11)) -#define UHCI_IN_DSCR_EMPTY_INT_RAW_M (BIT(11)) -#define UHCI_IN_DSCR_EMPTY_INT_RAW_V 0x1 -#define UHCI_IN_DSCR_EMPTY_INT_RAW_S 11 -/* UHCI_OUT_DSCR_ERR_INT_RAW : RO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: when there are some errors about the in link descriptor it will - produce uhci_out_dscr_err_int interrupt.*/ -#define UHCI_OUT_DSCR_ERR_INT_RAW (BIT(10)) -#define UHCI_OUT_DSCR_ERR_INT_RAW_M (BIT(10)) -#define UHCI_OUT_DSCR_ERR_INT_RAW_V 0x1 -#define UHCI_OUT_DSCR_ERR_INT_RAW_S 10 -/* UHCI_IN_DSCR_ERR_INT_RAW : RO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: when there are some errors about the out link descriptor it - will produce uhci_in_dscr_err_int interrupt.*/ -#define UHCI_IN_DSCR_ERR_INT_RAW (BIT(9)) -#define UHCI_IN_DSCR_ERR_INT_RAW_M (BIT(9)) -#define UHCI_IN_DSCR_ERR_INT_RAW_V 0x1 -#define UHCI_IN_DSCR_ERR_INT_RAW_S 9 -/* UHCI_OUT_EOF_INT_RAW : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: when the current descriptor's eof bit is 1 it will produce uhci_out_eof_int - interrupt.*/ -#define UHCI_OUT_EOF_INT_RAW (BIT(8)) -#define UHCI_OUT_EOF_INT_RAW_M (BIT(8)) -#define UHCI_OUT_EOF_INT_RAW_V 0x1 -#define UHCI_OUT_EOF_INT_RAW_S 8 -/* UHCI_OUT_DONE_INT_RAW : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: when a out link descriptor is completed it will produce uhci_out_done_int - interrupt.*/ -#define UHCI_OUT_DONE_INT_RAW (BIT(7)) -#define UHCI_OUT_DONE_INT_RAW_M (BIT(7)) -#define UHCI_OUT_DONE_INT_RAW_V 0x1 -#define UHCI_OUT_DONE_INT_RAW_S 7 -/* UHCI_IN_ERR_EOF_INT_RAW : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: when there are some errors about eof in in link descriptor it - will produce uhci_in_err_eof_int interrupt.*/ -#define UHCI_IN_ERR_EOF_INT_RAW (BIT(6)) -#define UHCI_IN_ERR_EOF_INT_RAW_M (BIT(6)) -#define UHCI_IN_ERR_EOF_INT_RAW_V 0x1 -#define UHCI_IN_ERR_EOF_INT_RAW_S 6 -/* UHCI_IN_SUC_EOF_INT_RAW : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: when a data packet has been received it will produce uhci_in_suc_eof_int - interrupt.*/ -#define UHCI_IN_SUC_EOF_INT_RAW (BIT(5)) -#define UHCI_IN_SUC_EOF_INT_RAW_M (BIT(5)) -#define UHCI_IN_SUC_EOF_INT_RAW_V 0x1 -#define UHCI_IN_SUC_EOF_INT_RAW_S 5 -/* UHCI_IN_DONE_INT_RAW : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: when a in link descriptor has been completed it will produce - uhci_in_done_int interrupt.*/ -#define UHCI_IN_DONE_INT_RAW (BIT(4)) -#define UHCI_IN_DONE_INT_RAW_M (BIT(4)) -#define UHCI_IN_DONE_INT_RAW_V 0x1 -#define UHCI_IN_DONE_INT_RAW_S 4 -/* UHCI_TX_HUNG_INT_RAW : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: when DMA takes a lot of time to read a data from RAM it will - produce uhci_tx_hung_int interrupt.*/ -#define UHCI_TX_HUNG_INT_RAW (BIT(3)) -#define UHCI_TX_HUNG_INT_RAW_M (BIT(3)) -#define UHCI_TX_HUNG_INT_RAW_V 0x1 -#define UHCI_TX_HUNG_INT_RAW_S 3 -/* UHCI_RX_HUNG_INT_RAW : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: when DMA takes a lot of time to receive a data it will produce - uhci_rx_hung_int interrupt.*/ -#define UHCI_RX_HUNG_INT_RAW (BIT(2)) -#define UHCI_RX_HUNG_INT_RAW_M (BIT(2)) -#define UHCI_RX_HUNG_INT_RAW_V 0x1 -#define UHCI_RX_HUNG_INT_RAW_S 2 -/* UHCI_TX_START_INT_RAW : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: when DMA detects a separator char it will produce uhci_tx_start_int interrupt.*/ -#define UHCI_TX_START_INT_RAW (BIT(1)) -#define UHCI_TX_START_INT_RAW_M (BIT(1)) -#define UHCI_TX_START_INT_RAW_V 0x1 -#define UHCI_TX_START_INT_RAW_S 1 -/* UHCI_RX_START_INT_RAW : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: when a separator char has been send it will produce uhci_rx_start_int - interrupt.*/ -#define UHCI_RX_START_INT_RAW (BIT(0)) -#define UHCI_RX_START_INT_RAW_M (BIT(0)) -#define UHCI_RX_START_INT_RAW_V 0x1 -#define UHCI_RX_START_INT_RAW_S 0 - -#define UHCI_INT_ST_REG(i) (REG_UHCI_BASE(i) + 0x8) -/* UHCI_DMA_INFIFO_FULL_WM_INT_ST : RO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_DMA_INFIFO_FULL_WM_INT_ST (BIT(16)) -#define UHCI_DMA_INFIFO_FULL_WM_INT_ST_M (BIT(16)) -#define UHCI_DMA_INFIFO_FULL_WM_INT_ST_V 0x1 -#define UHCI_DMA_INFIFO_FULL_WM_INT_ST_S 16 -/* UHCI_SEND_A_Q_INT_ST : RO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_SEND_A_Q_INT_ST (BIT(15)) -#define UHCI_SEND_A_Q_INT_ST_M (BIT(15)) -#define UHCI_SEND_A_Q_INT_ST_V 0x1 -#define UHCI_SEND_A_Q_INT_ST_S 15 -/* UHCI_SEND_S_Q_INT_ST : RO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_SEND_S_Q_INT_ST (BIT(14)) -#define UHCI_SEND_S_Q_INT_ST_M (BIT(14)) -#define UHCI_SEND_S_Q_INT_ST_V 0x1 -#define UHCI_SEND_S_Q_INT_ST_S 14 -/* UHCI_OUT_TOTAL_EOF_INT_ST : RO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_OUT_TOTAL_EOF_INT_ST (BIT(13)) -#define UHCI_OUT_TOTAL_EOF_INT_ST_M (BIT(13)) -#define UHCI_OUT_TOTAL_EOF_INT_ST_V 0x1 -#define UHCI_OUT_TOTAL_EOF_INT_ST_S 13 -/* UHCI_OUTLINK_EOF_ERR_INT_ST : RO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_OUTLINK_EOF_ERR_INT_ST (BIT(12)) -#define UHCI_OUTLINK_EOF_ERR_INT_ST_M (BIT(12)) -#define UHCI_OUTLINK_EOF_ERR_INT_ST_V 0x1 -#define UHCI_OUTLINK_EOF_ERR_INT_ST_S 12 -/* UHCI_IN_DSCR_EMPTY_INT_ST : RO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_IN_DSCR_EMPTY_INT_ST (BIT(11)) -#define UHCI_IN_DSCR_EMPTY_INT_ST_M (BIT(11)) -#define UHCI_IN_DSCR_EMPTY_INT_ST_V 0x1 -#define UHCI_IN_DSCR_EMPTY_INT_ST_S 11 -/* UHCI_OUT_DSCR_ERR_INT_ST : RO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_OUT_DSCR_ERR_INT_ST (BIT(10)) -#define UHCI_OUT_DSCR_ERR_INT_ST_M (BIT(10)) -#define UHCI_OUT_DSCR_ERR_INT_ST_V 0x1 -#define UHCI_OUT_DSCR_ERR_INT_ST_S 10 -/* UHCI_IN_DSCR_ERR_INT_ST : RO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_IN_DSCR_ERR_INT_ST (BIT(9)) -#define UHCI_IN_DSCR_ERR_INT_ST_M (BIT(9)) -#define UHCI_IN_DSCR_ERR_INT_ST_V 0x1 -#define UHCI_IN_DSCR_ERR_INT_ST_S 9 -/* UHCI_OUT_EOF_INT_ST : RO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_OUT_EOF_INT_ST (BIT(8)) -#define UHCI_OUT_EOF_INT_ST_M (BIT(8)) -#define UHCI_OUT_EOF_INT_ST_V 0x1 -#define UHCI_OUT_EOF_INT_ST_S 8 -/* UHCI_OUT_DONE_INT_ST : RO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_OUT_DONE_INT_ST (BIT(7)) -#define UHCI_OUT_DONE_INT_ST_M (BIT(7)) -#define UHCI_OUT_DONE_INT_ST_V 0x1 -#define UHCI_OUT_DONE_INT_ST_S 7 -/* UHCI_IN_ERR_EOF_INT_ST : RO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_IN_ERR_EOF_INT_ST (BIT(6)) -#define UHCI_IN_ERR_EOF_INT_ST_M (BIT(6)) -#define UHCI_IN_ERR_EOF_INT_ST_V 0x1 -#define UHCI_IN_ERR_EOF_INT_ST_S 6 -/* UHCI_IN_SUC_EOF_INT_ST : RO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_IN_SUC_EOF_INT_ST (BIT(5)) -#define UHCI_IN_SUC_EOF_INT_ST_M (BIT(5)) -#define UHCI_IN_SUC_EOF_INT_ST_V 0x1 -#define UHCI_IN_SUC_EOF_INT_ST_S 5 -/* UHCI_IN_DONE_INT_ST : RO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_IN_DONE_INT_ST (BIT(4)) -#define UHCI_IN_DONE_INT_ST_M (BIT(4)) -#define UHCI_IN_DONE_INT_ST_V 0x1 -#define UHCI_IN_DONE_INT_ST_S 4 -/* UHCI_TX_HUNG_INT_ST : RO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_TX_HUNG_INT_ST (BIT(3)) -#define UHCI_TX_HUNG_INT_ST_M (BIT(3)) -#define UHCI_TX_HUNG_INT_ST_V 0x1 -#define UHCI_TX_HUNG_INT_ST_S 3 -/* UHCI_RX_HUNG_INT_ST : RO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_RX_HUNG_INT_ST (BIT(2)) -#define UHCI_RX_HUNG_INT_ST_M (BIT(2)) -#define UHCI_RX_HUNG_INT_ST_V 0x1 -#define UHCI_RX_HUNG_INT_ST_S 2 -/* UHCI_TX_START_INT_ST : RO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_TX_START_INT_ST (BIT(1)) -#define UHCI_TX_START_INT_ST_M (BIT(1)) -#define UHCI_TX_START_INT_ST_V 0x1 -#define UHCI_TX_START_INT_ST_S 1 -/* UHCI_RX_START_INT_ST : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_RX_START_INT_ST (BIT(0)) -#define UHCI_RX_START_INT_ST_M (BIT(0)) -#define UHCI_RX_START_INT_ST_V 0x1 -#define UHCI_RX_START_INT_ST_S 0 - -#define UHCI_INT_ENA_REG(i) (REG_UHCI_BASE(i) + 0xC) -/* UHCI_DMA_INFIFO_FULL_WM_INT_ENA : R/W ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_DMA_INFIFO_FULL_WM_INT_ENA (BIT(16)) -#define UHCI_DMA_INFIFO_FULL_WM_INT_ENA_M (BIT(16)) -#define UHCI_DMA_INFIFO_FULL_WM_INT_ENA_V 0x1 -#define UHCI_DMA_INFIFO_FULL_WM_INT_ENA_S 16 -/* UHCI_SEND_A_Q_INT_ENA : R/W ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_SEND_A_Q_INT_ENA (BIT(15)) -#define UHCI_SEND_A_Q_INT_ENA_M (BIT(15)) -#define UHCI_SEND_A_Q_INT_ENA_V 0x1 -#define UHCI_SEND_A_Q_INT_ENA_S 15 -/* UHCI_SEND_S_Q_INT_ENA : R/W ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_SEND_S_Q_INT_ENA (BIT(14)) -#define UHCI_SEND_S_Q_INT_ENA_M (BIT(14)) -#define UHCI_SEND_S_Q_INT_ENA_V 0x1 -#define UHCI_SEND_S_Q_INT_ENA_S 14 -/* UHCI_OUT_TOTAL_EOF_INT_ENA : R/W ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_OUT_TOTAL_EOF_INT_ENA (BIT(13)) -#define UHCI_OUT_TOTAL_EOF_INT_ENA_M (BIT(13)) -#define UHCI_OUT_TOTAL_EOF_INT_ENA_V 0x1 -#define UHCI_OUT_TOTAL_EOF_INT_ENA_S 13 -/* UHCI_OUTLINK_EOF_ERR_INT_ENA : R/W ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_OUTLINK_EOF_ERR_INT_ENA (BIT(12)) -#define UHCI_OUTLINK_EOF_ERR_INT_ENA_M (BIT(12)) -#define UHCI_OUTLINK_EOF_ERR_INT_ENA_V 0x1 -#define UHCI_OUTLINK_EOF_ERR_INT_ENA_S 12 -/* UHCI_IN_DSCR_EMPTY_INT_ENA : R/W ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_IN_DSCR_EMPTY_INT_ENA (BIT(11)) -#define UHCI_IN_DSCR_EMPTY_INT_ENA_M (BIT(11)) -#define UHCI_IN_DSCR_EMPTY_INT_ENA_V 0x1 -#define UHCI_IN_DSCR_EMPTY_INT_ENA_S 11 -/* UHCI_OUT_DSCR_ERR_INT_ENA : R/W ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_OUT_DSCR_ERR_INT_ENA (BIT(10)) -#define UHCI_OUT_DSCR_ERR_INT_ENA_M (BIT(10)) -#define UHCI_OUT_DSCR_ERR_INT_ENA_V 0x1 -#define UHCI_OUT_DSCR_ERR_INT_ENA_S 10 -/* UHCI_IN_DSCR_ERR_INT_ENA : R/W ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_IN_DSCR_ERR_INT_ENA (BIT(9)) -#define UHCI_IN_DSCR_ERR_INT_ENA_M (BIT(9)) -#define UHCI_IN_DSCR_ERR_INT_ENA_V 0x1 -#define UHCI_IN_DSCR_ERR_INT_ENA_S 9 -/* UHCI_OUT_EOF_INT_ENA : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_OUT_EOF_INT_ENA (BIT(8)) -#define UHCI_OUT_EOF_INT_ENA_M (BIT(8)) -#define UHCI_OUT_EOF_INT_ENA_V 0x1 -#define UHCI_OUT_EOF_INT_ENA_S 8 -/* UHCI_OUT_DONE_INT_ENA : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_OUT_DONE_INT_ENA (BIT(7)) -#define UHCI_OUT_DONE_INT_ENA_M (BIT(7)) -#define UHCI_OUT_DONE_INT_ENA_V 0x1 -#define UHCI_OUT_DONE_INT_ENA_S 7 -/* UHCI_IN_ERR_EOF_INT_ENA : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_IN_ERR_EOF_INT_ENA (BIT(6)) -#define UHCI_IN_ERR_EOF_INT_ENA_M (BIT(6)) -#define UHCI_IN_ERR_EOF_INT_ENA_V 0x1 -#define UHCI_IN_ERR_EOF_INT_ENA_S 6 -/* UHCI_IN_SUC_EOF_INT_ENA : R/W ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_IN_SUC_EOF_INT_ENA (BIT(5)) -#define UHCI_IN_SUC_EOF_INT_ENA_M (BIT(5)) -#define UHCI_IN_SUC_EOF_INT_ENA_V 0x1 -#define UHCI_IN_SUC_EOF_INT_ENA_S 5 -/* UHCI_IN_DONE_INT_ENA : R/W ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_IN_DONE_INT_ENA (BIT(4)) -#define UHCI_IN_DONE_INT_ENA_M (BIT(4)) -#define UHCI_IN_DONE_INT_ENA_V 0x1 -#define UHCI_IN_DONE_INT_ENA_S 4 -/* UHCI_TX_HUNG_INT_ENA : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_TX_HUNG_INT_ENA (BIT(3)) -#define UHCI_TX_HUNG_INT_ENA_M (BIT(3)) -#define UHCI_TX_HUNG_INT_ENA_V 0x1 -#define UHCI_TX_HUNG_INT_ENA_S 3 -/* UHCI_RX_HUNG_INT_ENA : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_RX_HUNG_INT_ENA (BIT(2)) -#define UHCI_RX_HUNG_INT_ENA_M (BIT(2)) -#define UHCI_RX_HUNG_INT_ENA_V 0x1 -#define UHCI_RX_HUNG_INT_ENA_S 2 -/* UHCI_TX_START_INT_ENA : R/W ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_TX_START_INT_ENA (BIT(1)) -#define UHCI_TX_START_INT_ENA_M (BIT(1)) -#define UHCI_TX_START_INT_ENA_V 0x1 -#define UHCI_TX_START_INT_ENA_S 1 -/* UHCI_RX_START_INT_ENA : R/W ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_RX_START_INT_ENA (BIT(0)) -#define UHCI_RX_START_INT_ENA_M (BIT(0)) -#define UHCI_RX_START_INT_ENA_V 0x1 -#define UHCI_RX_START_INT_ENA_S 0 - -#define UHCI_INT_CLR_REG(i) (REG_UHCI_BASE(i) + 0x10) -/* UHCI_DMA_INFIFO_FULL_WM_INT_CLR : WO ;bitpos:[16] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_DMA_INFIFO_FULL_WM_INT_CLR (BIT(16)) -#define UHCI_DMA_INFIFO_FULL_WM_INT_CLR_M (BIT(16)) -#define UHCI_DMA_INFIFO_FULL_WM_INT_CLR_V 0x1 -#define UHCI_DMA_INFIFO_FULL_WM_INT_CLR_S 16 -/* UHCI_SEND_A_Q_INT_CLR : WO ;bitpos:[15] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_SEND_A_Q_INT_CLR (BIT(15)) -#define UHCI_SEND_A_Q_INT_CLR_M (BIT(15)) -#define UHCI_SEND_A_Q_INT_CLR_V 0x1 -#define UHCI_SEND_A_Q_INT_CLR_S 15 -/* UHCI_SEND_S_Q_INT_CLR : WO ;bitpos:[14] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_SEND_S_Q_INT_CLR (BIT(14)) -#define UHCI_SEND_S_Q_INT_CLR_M (BIT(14)) -#define UHCI_SEND_S_Q_INT_CLR_V 0x1 -#define UHCI_SEND_S_Q_INT_CLR_S 14 -/* UHCI_OUT_TOTAL_EOF_INT_CLR : WO ;bitpos:[13] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_OUT_TOTAL_EOF_INT_CLR (BIT(13)) -#define UHCI_OUT_TOTAL_EOF_INT_CLR_M (BIT(13)) -#define UHCI_OUT_TOTAL_EOF_INT_CLR_V 0x1 -#define UHCI_OUT_TOTAL_EOF_INT_CLR_S 13 -/* UHCI_OUTLINK_EOF_ERR_INT_CLR : WO ;bitpos:[12] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_OUTLINK_EOF_ERR_INT_CLR (BIT(12)) -#define UHCI_OUTLINK_EOF_ERR_INT_CLR_M (BIT(12)) -#define UHCI_OUTLINK_EOF_ERR_INT_CLR_V 0x1 -#define UHCI_OUTLINK_EOF_ERR_INT_CLR_S 12 -/* UHCI_IN_DSCR_EMPTY_INT_CLR : WO ;bitpos:[11] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_IN_DSCR_EMPTY_INT_CLR (BIT(11)) -#define UHCI_IN_DSCR_EMPTY_INT_CLR_M (BIT(11)) -#define UHCI_IN_DSCR_EMPTY_INT_CLR_V 0x1 -#define UHCI_IN_DSCR_EMPTY_INT_CLR_S 11 -/* UHCI_OUT_DSCR_ERR_INT_CLR : WO ;bitpos:[10] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_OUT_DSCR_ERR_INT_CLR (BIT(10)) -#define UHCI_OUT_DSCR_ERR_INT_CLR_M (BIT(10)) -#define UHCI_OUT_DSCR_ERR_INT_CLR_V 0x1 -#define UHCI_OUT_DSCR_ERR_INT_CLR_S 10 -/* UHCI_IN_DSCR_ERR_INT_CLR : WO ;bitpos:[9] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_IN_DSCR_ERR_INT_CLR (BIT(9)) -#define UHCI_IN_DSCR_ERR_INT_CLR_M (BIT(9)) -#define UHCI_IN_DSCR_ERR_INT_CLR_V 0x1 -#define UHCI_IN_DSCR_ERR_INT_CLR_S 9 -/* UHCI_OUT_EOF_INT_CLR : WO ;bitpos:[8] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_OUT_EOF_INT_CLR (BIT(8)) -#define UHCI_OUT_EOF_INT_CLR_M (BIT(8)) -#define UHCI_OUT_EOF_INT_CLR_V 0x1 -#define UHCI_OUT_EOF_INT_CLR_S 8 -/* UHCI_OUT_DONE_INT_CLR : WO ;bitpos:[7] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_OUT_DONE_INT_CLR (BIT(7)) -#define UHCI_OUT_DONE_INT_CLR_M (BIT(7)) -#define UHCI_OUT_DONE_INT_CLR_V 0x1 -#define UHCI_OUT_DONE_INT_CLR_S 7 -/* UHCI_IN_ERR_EOF_INT_CLR : WO ;bitpos:[6] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_IN_ERR_EOF_INT_CLR (BIT(6)) -#define UHCI_IN_ERR_EOF_INT_CLR_M (BIT(6)) -#define UHCI_IN_ERR_EOF_INT_CLR_V 0x1 -#define UHCI_IN_ERR_EOF_INT_CLR_S 6 -/* UHCI_IN_SUC_EOF_INT_CLR : WO ;bitpos:[5] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_IN_SUC_EOF_INT_CLR (BIT(5)) -#define UHCI_IN_SUC_EOF_INT_CLR_M (BIT(5)) -#define UHCI_IN_SUC_EOF_INT_CLR_V 0x1 -#define UHCI_IN_SUC_EOF_INT_CLR_S 5 -/* UHCI_IN_DONE_INT_CLR : WO ;bitpos:[4] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_IN_DONE_INT_CLR (BIT(4)) -#define UHCI_IN_DONE_INT_CLR_M (BIT(4)) -#define UHCI_IN_DONE_INT_CLR_V 0x1 -#define UHCI_IN_DONE_INT_CLR_S 4 -/* UHCI_TX_HUNG_INT_CLR : WO ;bitpos:[3] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_TX_HUNG_INT_CLR (BIT(3)) -#define UHCI_TX_HUNG_INT_CLR_M (BIT(3)) -#define UHCI_TX_HUNG_INT_CLR_V 0x1 -#define UHCI_TX_HUNG_INT_CLR_S 3 -/* UHCI_RX_HUNG_INT_CLR : WO ;bitpos:[2] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_RX_HUNG_INT_CLR (BIT(2)) -#define UHCI_RX_HUNG_INT_CLR_M (BIT(2)) -#define UHCI_RX_HUNG_INT_CLR_V 0x1 -#define UHCI_RX_HUNG_INT_CLR_S 2 -/* UHCI_TX_START_INT_CLR : WO ;bitpos:[1] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_TX_START_INT_CLR (BIT(1)) -#define UHCI_TX_START_INT_CLR_M (BIT(1)) -#define UHCI_TX_START_INT_CLR_V 0x1 -#define UHCI_TX_START_INT_CLR_S 1 -/* UHCI_RX_START_INT_CLR : WO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_RX_START_INT_CLR (BIT(0)) -#define UHCI_RX_START_INT_CLR_M (BIT(0)) -#define UHCI_RX_START_INT_CLR_V 0x1 -#define UHCI_RX_START_INT_CLR_S 0 - -#define UHCI_DMA_OUT_STATUS_REG(i) (REG_UHCI_BASE(i) + 0x14) -/* UHCI_OUT_EMPTY : RO ;bitpos:[1] ;default: 1'b1 ; */ -/*description: 1:DMA in link descriptor's fifo is empty.*/ -#define UHCI_OUT_EMPTY (BIT(1)) -#define UHCI_OUT_EMPTY_M (BIT(1)) -#define UHCI_OUT_EMPTY_V 0x1 -#define UHCI_OUT_EMPTY_S 1 -/* UHCI_OUT_FULL : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: 1:DMA out link descriptor's fifo is full.*/ -#define UHCI_OUT_FULL (BIT(0)) -#define UHCI_OUT_FULL_M (BIT(0)) -#define UHCI_OUT_FULL_V 0x1 -#define UHCI_OUT_FULL_S 0 - -#define UHCI_DMA_OUT_PUSH_REG(i) (REG_UHCI_BASE(i) + 0x18) -/* UHCI_OUTFIFO_PUSH : R/W ;bitpos:[16] ;default: 1'h0 ; */ -/*description: Set this bit to push data in out link descriptor's fifo.*/ -#define UHCI_OUTFIFO_PUSH (BIT(16)) -#define UHCI_OUTFIFO_PUSH_M (BIT(16)) -#define UHCI_OUTFIFO_PUSH_V 0x1 -#define UHCI_OUTFIFO_PUSH_S 16 -/* UHCI_OUTFIFO_WDATA : R/W ;bitpos:[8:0] ;default: 9'h0 ; */ -/*description: This is the data need to be pushed into out link descriptor's fifo.*/ -#define UHCI_OUTFIFO_WDATA 0x000001FF -#define UHCI_OUTFIFO_WDATA_M ((UHCI_OUTFIFO_WDATA_V)<<(UHCI_OUTFIFO_WDATA_S)) -#define UHCI_OUTFIFO_WDATA_V 0x1FF -#define UHCI_OUTFIFO_WDATA_S 0 - -#define UHCI_DMA_IN_STATUS_REG(i) (REG_UHCI_BASE(i) + 0x1C) -/* UHCI_RX_ERR_CAUSE : RO ;bitpos:[6:4] ;default: 3'h0 ; */ -/*description: This register stores the errors caused in out link descriptor's data packet.*/ -#define UHCI_RX_ERR_CAUSE 0x00000007 -#define UHCI_RX_ERR_CAUSE_M ((UHCI_RX_ERR_CAUSE_V)<<(UHCI_RX_ERR_CAUSE_S)) -#define UHCI_RX_ERR_CAUSE_V 0x7 -#define UHCI_RX_ERR_CAUSE_S 4 -/* UHCI_IN_EMPTY : RO ;bitpos:[1] ;default: 1'b1 ; */ -/*description: */ -#define UHCI_IN_EMPTY (BIT(1)) -#define UHCI_IN_EMPTY_M (BIT(1)) -#define UHCI_IN_EMPTY_V 0x1 -#define UHCI_IN_EMPTY_S 1 -/* UHCI_IN_FULL : RO ;bitpos:[0] ;default: 1'b0 ; */ -/*description: */ -#define UHCI_IN_FULL (BIT(0)) -#define UHCI_IN_FULL_M (BIT(0)) -#define UHCI_IN_FULL_V 0x1 -#define UHCI_IN_FULL_S 0 - -#define UHCI_DMA_IN_POP_REG(i) (REG_UHCI_BASE(i) + 0x20) -/* UHCI_INFIFO_POP : R/W ;bitpos:[16] ;default: 1'h0 ; */ -/*description: Set this bit to pop data in in link descriptor's fifo.*/ -#define UHCI_INFIFO_POP (BIT(16)) -#define UHCI_INFIFO_POP_M (BIT(16)) -#define UHCI_INFIFO_POP_V 0x1 -#define UHCI_INFIFO_POP_S 16 -/* UHCI_INFIFO_RDATA : RO ;bitpos:[11:0] ;default: 12'h0 ; */ -/*description: This register stores the data pop from in link descriptor's fifo.*/ -#define UHCI_INFIFO_RDATA 0x00000FFF -#define UHCI_INFIFO_RDATA_M ((UHCI_INFIFO_RDATA_V)<<(UHCI_INFIFO_RDATA_S)) -#define UHCI_INFIFO_RDATA_V 0xFFF -#define UHCI_INFIFO_RDATA_S 0 - -#define UHCI_DMA_OUT_LINK_REG(i) (REG_UHCI_BASE(i) + 0x24) -/* UHCI_OUTLINK_PARK : RO ;bitpos:[31] ;default: 1'h0 ; */ -/*description: 1£º the out link descriptor's fsm is in idle state. 0:the out - link descriptor's fsm is working.*/ -#define UHCI_OUTLINK_PARK (BIT(31)) -#define UHCI_OUTLINK_PARK_M (BIT(31)) -#define UHCI_OUTLINK_PARK_V 0x1 -#define UHCI_OUTLINK_PARK_S 31 -/* UHCI_OUTLINK_RESTART : R/W ;bitpos:[30] ;default: 1'b0 ; */ -/*description: Set this bit to mount on new out link descriptors*/ -#define UHCI_OUTLINK_RESTART (BIT(30)) -#define UHCI_OUTLINK_RESTART_M (BIT(30)) -#define UHCI_OUTLINK_RESTART_V 0x1 -#define UHCI_OUTLINK_RESTART_S 30 -/* UHCI_OUTLINK_START : R/W ;bitpos:[29] ;default: 1'b0 ; */ -/*description: Set this bit to start dealing with the out link descriptors.*/ -#define UHCI_OUTLINK_START (BIT(29)) -#define UHCI_OUTLINK_START_M (BIT(29)) -#define UHCI_OUTLINK_START_V 0x1 -#define UHCI_OUTLINK_START_S 29 -/* UHCI_OUTLINK_STOP : R/W ;bitpos:[28] ;default: 1'b0 ; */ -/*description: Set this bit to stop dealing with the out link descriptors.*/ -#define UHCI_OUTLINK_STOP (BIT(28)) -#define UHCI_OUTLINK_STOP_M (BIT(28)) -#define UHCI_OUTLINK_STOP_V 0x1 -#define UHCI_OUTLINK_STOP_S 28 -/* UHCI_OUTLINK_ADDR : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: This register stores the least 20 bits of the first out link - descriptor's address.*/ -#define UHCI_OUTLINK_ADDR 0x000FFFFF -#define UHCI_OUTLINK_ADDR_M ((UHCI_OUTLINK_ADDR_V)<<(UHCI_OUTLINK_ADDR_S)) -#define UHCI_OUTLINK_ADDR_V 0xFFFFF -#define UHCI_OUTLINK_ADDR_S 0 - -#define UHCI_DMA_IN_LINK_REG(i) (REG_UHCI_BASE(i) + 0x28) -/* UHCI_INLINK_PARK : RO ;bitpos:[31] ;default: 1'h0 ; */ -/*description: 1:the in link descriptor's fsm is in idle state. 0:the in link - descriptor's fsm is working*/ -#define UHCI_INLINK_PARK (BIT(31)) -#define UHCI_INLINK_PARK_M (BIT(31)) -#define UHCI_INLINK_PARK_V 0x1 -#define UHCI_INLINK_PARK_S 31 -/* UHCI_INLINK_RESTART : R/W ;bitpos:[30] ;default: 1'b0 ; */ -/*description: Set this bit to mount on new in link descriptors*/ -#define UHCI_INLINK_RESTART (BIT(30)) -#define UHCI_INLINK_RESTART_M (BIT(30)) -#define UHCI_INLINK_RESTART_V 0x1 -#define UHCI_INLINK_RESTART_S 30 -/* UHCI_INLINK_START : R/W ;bitpos:[29] ;default: 1'b0 ; */ -/*description: Set this bit to start dealing with the in link descriptors.*/ -#define UHCI_INLINK_START (BIT(29)) -#define UHCI_INLINK_START_M (BIT(29)) -#define UHCI_INLINK_START_V 0x1 -#define UHCI_INLINK_START_S 29 -/* UHCI_INLINK_STOP : R/W ;bitpos:[28] ;default: 1'b0 ; */ -/*description: Set this bit to stop dealing with the in link descriptors.*/ -#define UHCI_INLINK_STOP (BIT(28)) -#define UHCI_INLINK_STOP_M (BIT(28)) -#define UHCI_INLINK_STOP_V 0x1 -#define UHCI_INLINK_STOP_S 28 -/* UHCI_INLINK_AUTO_RET : R/W ;bitpos:[20] ;default: 1'b1 ; */ -/*description: 1:when a packet is wrong in link descriptor returns to the descriptor - which is lately used.*/ -#define UHCI_INLINK_AUTO_RET (BIT(20)) -#define UHCI_INLINK_AUTO_RET_M (BIT(20)) -#define UHCI_INLINK_AUTO_RET_V 0x1 -#define UHCI_INLINK_AUTO_RET_S 20 -/* UHCI_INLINK_ADDR : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ -/*description: This register stores the least 20 bits of the first in link descriptor's - address.*/ -#define UHCI_INLINK_ADDR 0x000FFFFF -#define UHCI_INLINK_ADDR_M ((UHCI_INLINK_ADDR_V)<<(UHCI_INLINK_ADDR_S)) -#define UHCI_INLINK_ADDR_V 0xFFFFF -#define UHCI_INLINK_ADDR_S 0 - -#define UHCI_CONF1_REG(i) (REG_UHCI_BASE(i) + 0x2C) -/* UHCI_DMA_INFIFO_FULL_THRS : R/W ;bitpos:[20:9] ;default: 12'b0 ; */ -/*description: when data amount in link descriptor's fifo is more than this - register value it will produce uhci_dma_infifo_full_wm_int interrupt.*/ -#define UHCI_DMA_INFIFO_FULL_THRS 0x00000FFF -#define UHCI_DMA_INFIFO_FULL_THRS_M ((UHCI_DMA_INFIFO_FULL_THRS_V)<<(UHCI_DMA_INFIFO_FULL_THRS_S)) -#define UHCI_DMA_INFIFO_FULL_THRS_V 0xFFF -#define UHCI_DMA_INFIFO_FULL_THRS_S 9 -/* UHCI_SW_START : R/W ;bitpos:[8] ;default: 1'b0 ; */ -/*description: Set this bit to start inserting the packet header.*/ -#define UHCI_SW_START (BIT(8)) -#define UHCI_SW_START_M (BIT(8)) -#define UHCI_SW_START_V 0x1 -#define UHCI_SW_START_S 8 -/* UHCI_WAIT_SW_START : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: Set this bit to enable software way to add packet header.*/ -#define UHCI_WAIT_SW_START (BIT(7)) -#define UHCI_WAIT_SW_START_M (BIT(7)) -#define UHCI_WAIT_SW_START_V 0x1 -#define UHCI_WAIT_SW_START_S 7 -/* UHCI_CHECK_OWNER : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: Set this bit to check the owner bit in link descriptor.*/ -#define UHCI_CHECK_OWNER (BIT(6)) -#define UHCI_CHECK_OWNER_M (BIT(6)) -#define UHCI_CHECK_OWNER_V 0x1 -#define UHCI_CHECK_OWNER_S 6 -/* UHCI_TX_ACK_NUM_RE : R/W ;bitpos:[5] ;default: 1'b1 ; */ -/*description: Set this bit to enable hardware replace ack num in packet header automatically.*/ -#define UHCI_TX_ACK_NUM_RE (BIT(5)) -#define UHCI_TX_ACK_NUM_RE_M (BIT(5)) -#define UHCI_TX_ACK_NUM_RE_V 0x1 -#define UHCI_TX_ACK_NUM_RE_S 5 -/* UHCI_TX_CHECK_SUM_RE : R/W ;bitpos:[4] ;default: 1'b1 ; */ -/*description: Set this bit to enable hardware replace check_sum in packet header - automatically.*/ -#define UHCI_TX_CHECK_SUM_RE (BIT(4)) -#define UHCI_TX_CHECK_SUM_RE_M (BIT(4)) -#define UHCI_TX_CHECK_SUM_RE_V 0x1 -#define UHCI_TX_CHECK_SUM_RE_S 4 -/* UHCI_SAVE_HEAD : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: Set this bit to save packet header .*/ -#define UHCI_SAVE_HEAD (BIT(3)) -#define UHCI_SAVE_HEAD_M (BIT(3)) -#define UHCI_SAVE_HEAD_V 0x1 -#define UHCI_SAVE_HEAD_S 3 -/* UHCI_CRC_DISABLE : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: Set this bit to disable crc calculation.*/ -#define UHCI_CRC_DISABLE (BIT(2)) -#define UHCI_CRC_DISABLE_M (BIT(2)) -#define UHCI_CRC_DISABLE_V 0x1 -#define UHCI_CRC_DISABLE_S 2 -/* UHCI_CHECK_SEQ_EN : R/W ;bitpos:[1] ;default: 1'b1 ; */ -/*description: Set this bit to enable decoder to check seq num in packet header.*/ -#define UHCI_CHECK_SEQ_EN (BIT(1)) -#define UHCI_CHECK_SEQ_EN_M (BIT(1)) -#define UHCI_CHECK_SEQ_EN_V 0x1 -#define UHCI_CHECK_SEQ_EN_S 1 -/* UHCI_CHECK_SUM_EN : R/W ;bitpos:[0] ;default: 1'b1 ; */ -/*description: Set this bit to enable decoder to check check_sum in packet header.*/ -#define UHCI_CHECK_SUM_EN (BIT(0)) -#define UHCI_CHECK_SUM_EN_M (BIT(0)) -#define UHCI_CHECK_SUM_EN_V 0x1 -#define UHCI_CHECK_SUM_EN_S 0 - -#define UHCI_STATE0_REG(i) (REG_UHCI_BASE(i) + 0x30) -/* UHCI_STATE0 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define UHCI_STATE0 0xFFFFFFFF -#define UHCI_STATE0_M ((UHCI_STATE0_V)<<(UHCI_STATE0_S)) -#define UHCI_STATE0_V 0xFFFFFFFF -#define UHCI_STATE0_S 0 - -#define UHCI_STATE1_REG(i) (REG_UHCI_BASE(i) + 0x34) -/* UHCI_STATE1 : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: */ -#define UHCI_STATE1 0xFFFFFFFF -#define UHCI_STATE1_M ((UHCI_STATE1_V)<<(UHCI_STATE1_S)) -#define UHCI_STATE1_V 0xFFFFFFFF -#define UHCI_STATE1_S 0 - -#define UHCI_DMA_OUT_EOF_DES_ADDR_REG(i) (REG_UHCI_BASE(i) + 0x38) -/* UHCI_OUT_EOF_DES_ADDR : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: This register stores the address of out link descriptoir when - eof bit in this descriptor is 1.*/ -#define UHCI_OUT_EOF_DES_ADDR 0xFFFFFFFF -#define UHCI_OUT_EOF_DES_ADDR_M ((UHCI_OUT_EOF_DES_ADDR_V)<<(UHCI_OUT_EOF_DES_ADDR_S)) -#define UHCI_OUT_EOF_DES_ADDR_V 0xFFFFFFFF -#define UHCI_OUT_EOF_DES_ADDR_S 0 - -#define UHCI_DMA_IN_SUC_EOF_DES_ADDR_REG(i) (REG_UHCI_BASE(i) + 0x3C) -/* UHCI_IN_SUC_EOF_DES_ADDR : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: This register stores the address of in link descriptor when eof - bit in this descriptor is 1.*/ -#define UHCI_IN_SUC_EOF_DES_ADDR 0xFFFFFFFF -#define UHCI_IN_SUC_EOF_DES_ADDR_M ((UHCI_IN_SUC_EOF_DES_ADDR_V)<<(UHCI_IN_SUC_EOF_DES_ADDR_S)) -#define UHCI_IN_SUC_EOF_DES_ADDR_V 0xFFFFFFFF -#define UHCI_IN_SUC_EOF_DES_ADDR_S 0 - -#define UHCI_DMA_IN_ERR_EOF_DES_ADDR_REG(i) (REG_UHCI_BASE(i) + 0x40) -/* UHCI_IN_ERR_EOF_DES_ADDR : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: This register stores the address of in link descriptor when there - are some errors in this descriptor.*/ -#define UHCI_IN_ERR_EOF_DES_ADDR 0xFFFFFFFF -#define UHCI_IN_ERR_EOF_DES_ADDR_M ((UHCI_IN_ERR_EOF_DES_ADDR_V)<<(UHCI_IN_ERR_EOF_DES_ADDR_S)) -#define UHCI_IN_ERR_EOF_DES_ADDR_V 0xFFFFFFFF -#define UHCI_IN_ERR_EOF_DES_ADDR_S 0 - -#define UHCI_DMA_OUT_EOF_BFR_DES_ADDR_REG(i) (REG_UHCI_BASE(i) + 0x44) -/* UHCI_OUT_EOF_BFR_DES_ADDR : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: This register stores the address of out link descriptor when - there are some errors in this descriptor.*/ -#define UHCI_OUT_EOF_BFR_DES_ADDR 0xFFFFFFFF -#define UHCI_OUT_EOF_BFR_DES_ADDR_M ((UHCI_OUT_EOF_BFR_DES_ADDR_V)<<(UHCI_OUT_EOF_BFR_DES_ADDR_S)) -#define UHCI_OUT_EOF_BFR_DES_ADDR_V 0xFFFFFFFF -#define UHCI_OUT_EOF_BFR_DES_ADDR_S 0 - -#define UHCI_AHB_TEST_REG(i) (REG_UHCI_BASE(i) + 0x48) -/* UHCI_AHB_TESTADDR : R/W ;bitpos:[5:4] ;default: 2'b0 ; */ -/*description: The two bits represent ahb bus address bit[20:19]*/ -#define UHCI_AHB_TESTADDR 0x00000003 -#define UHCI_AHB_TESTADDR_M ((UHCI_AHB_TESTADDR_V)<<(UHCI_AHB_TESTADDR_S)) -#define UHCI_AHB_TESTADDR_V 0x3 -#define UHCI_AHB_TESTADDR_S 4 -/* UHCI_AHB_TESTMODE : R/W ;bitpos:[2:0] ;default: 3'b0 ; */ -/*description: bit2 is ahb bus test enable ,bit1 is used to choose wrtie(1) - or read(0) mode. bit0 is used to choose test only once(1) or continue(0)*/ -#define UHCI_AHB_TESTMODE 0x00000007 -#define UHCI_AHB_TESTMODE_M ((UHCI_AHB_TESTMODE_V)<<(UHCI_AHB_TESTMODE_S)) -#define UHCI_AHB_TESTMODE_V 0x7 -#define UHCI_AHB_TESTMODE_S 0 - -#define UHCI_DMA_IN_DSCR_REG(i) (REG_UHCI_BASE(i) + 0x4C) -/* UHCI_INLINK_DSCR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: The content of current in link descriptor's third dword*/ -#define UHCI_INLINK_DSCR 0xFFFFFFFF -#define UHCI_INLINK_DSCR_M ((UHCI_INLINK_DSCR_V)<<(UHCI_INLINK_DSCR_S)) -#define UHCI_INLINK_DSCR_V 0xFFFFFFFF -#define UHCI_INLINK_DSCR_S 0 - -#define UHCI_DMA_IN_DSCR_BF0_REG(i) (REG_UHCI_BASE(i) + 0x50) -/* UHCI_INLINK_DSCR_BF0 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: The content of current in link descriptor's first dword*/ -#define UHCI_INLINK_DSCR_BF0 0xFFFFFFFF -#define UHCI_INLINK_DSCR_BF0_M ((UHCI_INLINK_DSCR_BF0_V)<<(UHCI_INLINK_DSCR_BF0_S)) -#define UHCI_INLINK_DSCR_BF0_V 0xFFFFFFFF -#define UHCI_INLINK_DSCR_BF0_S 0 - -#define UHCI_DMA_IN_DSCR_BF1_REG(i) (REG_UHCI_BASE(i) + 0x54) -/* UHCI_INLINK_DSCR_BF1 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: The content of current in link descriptor's second dword*/ -#define UHCI_INLINK_DSCR_BF1 0xFFFFFFFF -#define UHCI_INLINK_DSCR_BF1_M ((UHCI_INLINK_DSCR_BF1_V)<<(UHCI_INLINK_DSCR_BF1_S)) -#define UHCI_INLINK_DSCR_BF1_V 0xFFFFFFFF -#define UHCI_INLINK_DSCR_BF1_S 0 - -#define UHCI_DMA_OUT_DSCR_REG(i) (REG_UHCI_BASE(i) + 0x58) -/* UHCI_OUTLINK_DSCR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: The content of current out link descriptor's third dword*/ -#define UHCI_OUTLINK_DSCR 0xFFFFFFFF -#define UHCI_OUTLINK_DSCR_M ((UHCI_OUTLINK_DSCR_V)<<(UHCI_OUTLINK_DSCR_S)) -#define UHCI_OUTLINK_DSCR_V 0xFFFFFFFF -#define UHCI_OUTLINK_DSCR_S 0 - -#define UHCI_DMA_OUT_DSCR_BF0_REG(i) (REG_UHCI_BASE(i) + 0x5C) -/* UHCI_OUTLINK_DSCR_BF0 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: The content of current out link descriptor's first dword*/ -#define UHCI_OUTLINK_DSCR_BF0 0xFFFFFFFF -#define UHCI_OUTLINK_DSCR_BF0_M ((UHCI_OUTLINK_DSCR_BF0_V)<<(UHCI_OUTLINK_DSCR_BF0_S)) -#define UHCI_OUTLINK_DSCR_BF0_V 0xFFFFFFFF -#define UHCI_OUTLINK_DSCR_BF0_S 0 - -#define UHCI_DMA_OUT_DSCR_BF1_REG(i) (REG_UHCI_BASE(i) + 0x60) -/* UHCI_OUTLINK_DSCR_BF1 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ -/*description: The content of current out link descriptor's second dword*/ -#define UHCI_OUTLINK_DSCR_BF1 0xFFFFFFFF -#define UHCI_OUTLINK_DSCR_BF1_M ((UHCI_OUTLINK_DSCR_BF1_V)<<(UHCI_OUTLINK_DSCR_BF1_S)) -#define UHCI_OUTLINK_DSCR_BF1_V 0xFFFFFFFF -#define UHCI_OUTLINK_DSCR_BF1_S 0 - -#define UHCI_ESCAPE_CONF_REG(i) (REG_UHCI_BASE(i) + 0x64) -/* UHCI_RX_13_ESC_EN : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: Set this bit to enable flow control char 0x13 replace when DMA sends data.*/ -#define UHCI_RX_13_ESC_EN (BIT(7)) -#define UHCI_RX_13_ESC_EN_M (BIT(7)) -#define UHCI_RX_13_ESC_EN_V 0x1 -#define UHCI_RX_13_ESC_EN_S 7 -/* UHCI_RX_11_ESC_EN : R/W ;bitpos:[6] ;default: 1'b0 ; */ -/*description: Set this bit to enable flow control char 0x11 replace when DMA sends data.*/ -#define UHCI_RX_11_ESC_EN (BIT(6)) -#define UHCI_RX_11_ESC_EN_M (BIT(6)) -#define UHCI_RX_11_ESC_EN_V 0x1 -#define UHCI_RX_11_ESC_EN_S 6 -/* UHCI_RX_DB_ESC_EN : R/W ;bitpos:[5] ;default: 1'b1 ; */ -/*description: Set this bit to enable 0xdb char replace when DMA sends data.*/ -#define UHCI_RX_DB_ESC_EN (BIT(5)) -#define UHCI_RX_DB_ESC_EN_M (BIT(5)) -#define UHCI_RX_DB_ESC_EN_V 0x1 -#define UHCI_RX_DB_ESC_EN_S 5 -/* UHCI_RX_C0_ESC_EN : R/W ;bitpos:[4] ;default: 1'b1 ; */ -/*description: Set this bit to enable 0xc0 char replace when DMA sends data.*/ -#define UHCI_RX_C0_ESC_EN (BIT(4)) -#define UHCI_RX_C0_ESC_EN_M (BIT(4)) -#define UHCI_RX_C0_ESC_EN_V 0x1 -#define UHCI_RX_C0_ESC_EN_S 4 -/* UHCI_TX_13_ESC_EN : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: Set this bit to enable flow control char 0x13 decode when DMA receives data.*/ -#define UHCI_TX_13_ESC_EN (BIT(3)) -#define UHCI_TX_13_ESC_EN_M (BIT(3)) -#define UHCI_TX_13_ESC_EN_V 0x1 -#define UHCI_TX_13_ESC_EN_S 3 -/* UHCI_TX_11_ESC_EN : R/W ;bitpos:[2] ;default: 1'b0 ; */ -/*description: Set this bit to enable flow control char 0x11 decode when DMA receives data.*/ -#define UHCI_TX_11_ESC_EN (BIT(2)) -#define UHCI_TX_11_ESC_EN_M (BIT(2)) -#define UHCI_TX_11_ESC_EN_V 0x1 -#define UHCI_TX_11_ESC_EN_S 2 -/* UHCI_TX_DB_ESC_EN : R/W ;bitpos:[1] ;default: 1'b1 ; */ -/*description: Set this bit to enable 0xdb char decode when DMA receives data.*/ -#define UHCI_TX_DB_ESC_EN (BIT(1)) -#define UHCI_TX_DB_ESC_EN_M (BIT(1)) -#define UHCI_TX_DB_ESC_EN_V 0x1 -#define UHCI_TX_DB_ESC_EN_S 1 -/* UHCI_TX_C0_ESC_EN : R/W ;bitpos:[0] ;default: 1'b1 ; */ -/*description: Set this bit to enable 0xc0 char decode when DMA receives data.*/ -#define UHCI_TX_C0_ESC_EN (BIT(0)) -#define UHCI_TX_C0_ESC_EN_M (BIT(0)) -#define UHCI_TX_C0_ESC_EN_V 0x1 -#define UHCI_TX_C0_ESC_EN_S 0 - -#define UHCI_HUNG_CONF_REG(i) (REG_UHCI_BASE(i) + 0x68) -/* UHCI_RXFIFO_TIMEOUT_ENA : R/W ;bitpos:[23] ;default: 1'b1 ; */ -/*description: This is the enable bit for DMA send data timeout*/ -#define UHCI_RXFIFO_TIMEOUT_ENA (BIT(23)) -#define UHCI_RXFIFO_TIMEOUT_ENA_M (BIT(23)) -#define UHCI_RXFIFO_TIMEOUT_ENA_V 0x1 -#define UHCI_RXFIFO_TIMEOUT_ENA_S 23 -/* UHCI_RXFIFO_TIMEOUT_SHIFT : R/W ;bitpos:[22:20] ;default: 3'b0 ; */ -/*description: The tick count is cleared when its value >=(17'd8000>>reg_rxfifo_timeout_shift)*/ -#define UHCI_RXFIFO_TIMEOUT_SHIFT 0x00000007 -#define UHCI_RXFIFO_TIMEOUT_SHIFT_M ((UHCI_RXFIFO_TIMEOUT_SHIFT_V)<<(UHCI_RXFIFO_TIMEOUT_SHIFT_S)) -#define UHCI_RXFIFO_TIMEOUT_SHIFT_V 0x7 -#define UHCI_RXFIFO_TIMEOUT_SHIFT_S 20 -/* UHCI_RXFIFO_TIMEOUT : R/W ;bitpos:[19:12] ;default: 8'h10 ; */ -/*description: This register stores the timeout value.when DMA takes more time - than this register value to read a data from RAM it will produce uhci_rx_hung_int interrupt.*/ -#define UHCI_RXFIFO_TIMEOUT 0x000000FF -#define UHCI_RXFIFO_TIMEOUT_M ((UHCI_RXFIFO_TIMEOUT_V)<<(UHCI_RXFIFO_TIMEOUT_S)) -#define UHCI_RXFIFO_TIMEOUT_V 0xFF -#define UHCI_RXFIFO_TIMEOUT_S 12 -/* UHCI_TXFIFO_TIMEOUT_ENA : R/W ;bitpos:[11] ;default: 1'b1 ; */ -/*description: The enable bit for txfifo receive data timeout*/ -#define UHCI_TXFIFO_TIMEOUT_ENA (BIT(11)) -#define UHCI_TXFIFO_TIMEOUT_ENA_M (BIT(11)) -#define UHCI_TXFIFO_TIMEOUT_ENA_V 0x1 -#define UHCI_TXFIFO_TIMEOUT_ENA_S 11 -/* UHCI_TXFIFO_TIMEOUT_SHIFT : R/W ;bitpos:[10:8] ;default: 3'b0 ; */ -/*description: The tick count is cleared when its value >=(17'd8000>>reg_txfifo_timeout_shift)*/ -#define UHCI_TXFIFO_TIMEOUT_SHIFT 0x00000007 -#define UHCI_TXFIFO_TIMEOUT_SHIFT_M ((UHCI_TXFIFO_TIMEOUT_SHIFT_V)<<(UHCI_TXFIFO_TIMEOUT_SHIFT_S)) -#define UHCI_TXFIFO_TIMEOUT_SHIFT_V 0x7 -#define UHCI_TXFIFO_TIMEOUT_SHIFT_S 8 -/* UHCI_TXFIFO_TIMEOUT : R/W ;bitpos:[7:0] ;default: 8'h10 ; */ -/*description: This register stores the timeout value.when DMA takes more time - than this register value to receive a data it will produce uhci_tx_hung_int interrupt.*/ -#define UHCI_TXFIFO_TIMEOUT 0x000000FF -#define UHCI_TXFIFO_TIMEOUT_M ((UHCI_TXFIFO_TIMEOUT_V)<<(UHCI_TXFIFO_TIMEOUT_S)) -#define UHCI_TXFIFO_TIMEOUT_V 0xFF -#define UHCI_TXFIFO_TIMEOUT_S 0 - -#define UHCI_ACK_NUM_REG(i) (REG_UHCI_BASE(i) + 0x6C) - -#define UHCI_RX_HEAD_REG(i) (REG_UHCI_BASE(i) + 0x70) -/* UHCI_RX_HEAD : RO ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: This register stores the packet header received by DMA*/ -#define UHCI_RX_HEAD 0xFFFFFFFF -#define UHCI_RX_HEAD_M ((UHCI_RX_HEAD_V)<<(UHCI_RX_HEAD_S)) -#define UHCI_RX_HEAD_V 0xFFFFFFFF -#define UHCI_RX_HEAD_S 0 - -#define UHCI_QUICK_SENT_REG(i) (REG_UHCI_BASE(i) + 0x74) -/* UHCI_ALWAYS_SEND_EN : R/W ;bitpos:[7] ;default: 1'b0 ; */ -/*description: Set this bit to enable continuously send the same short packet*/ -#define UHCI_ALWAYS_SEND_EN (BIT(7)) -#define UHCI_ALWAYS_SEND_EN_M (BIT(7)) -#define UHCI_ALWAYS_SEND_EN_V 0x1 -#define UHCI_ALWAYS_SEND_EN_S 7 -/* UHCI_ALWAYS_SEND_NUM : R/W ;bitpos:[6:4] ;default: 3'h0 ; */ -/*description: The bits are used to choose which short packet*/ -#define UHCI_ALWAYS_SEND_NUM 0x00000007 -#define UHCI_ALWAYS_SEND_NUM_M ((UHCI_ALWAYS_SEND_NUM_V)<<(UHCI_ALWAYS_SEND_NUM_S)) -#define UHCI_ALWAYS_SEND_NUM_V 0x7 -#define UHCI_ALWAYS_SEND_NUM_S 4 -/* UHCI_SINGLE_SEND_EN : R/W ;bitpos:[3] ;default: 1'b0 ; */ -/*description: Set this bit to enable send a short packet*/ -#define UHCI_SINGLE_SEND_EN (BIT(3)) -#define UHCI_SINGLE_SEND_EN_M (BIT(3)) -#define UHCI_SINGLE_SEND_EN_V 0x1 -#define UHCI_SINGLE_SEND_EN_S 3 -/* UHCI_SINGLE_SEND_NUM : R/W ;bitpos:[2:0] ;default: 3'h0 ; */ -/*description: The bits are used to choose which short packet*/ -#define UHCI_SINGLE_SEND_NUM 0x00000007 -#define UHCI_SINGLE_SEND_NUM_M ((UHCI_SINGLE_SEND_NUM_V)<<(UHCI_SINGLE_SEND_NUM_S)) -#define UHCI_SINGLE_SEND_NUM_V 0x7 -#define UHCI_SINGLE_SEND_NUM_S 0 - -#define UHCI_Q0_WORD0_REG(i) (REG_UHCI_BASE(i) + 0x78) -/* UHCI_SEND_Q0_WORD0 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: This register stores the content of short packet's first dword*/ -#define UHCI_SEND_Q0_WORD0 0xFFFFFFFF -#define UHCI_SEND_Q0_WORD0_M ((UHCI_SEND_Q0_WORD0_V)<<(UHCI_SEND_Q0_WORD0_S)) -#define UHCI_SEND_Q0_WORD0_V 0xFFFFFFFF -#define UHCI_SEND_Q0_WORD0_S 0 - -#define UHCI_Q0_WORD1_REG(i) (REG_UHCI_BASE(i) + 0x7C) -/* UHCI_SEND_Q0_WORD1 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: This register stores the content of short packet's second dword*/ -#define UHCI_SEND_Q0_WORD1 0xFFFFFFFF -#define UHCI_SEND_Q0_WORD1_M ((UHCI_SEND_Q0_WORD1_V)<<(UHCI_SEND_Q0_WORD1_S)) -#define UHCI_SEND_Q0_WORD1_V 0xFFFFFFFF -#define UHCI_SEND_Q0_WORD1_S 0 - -#define UHCI_Q1_WORD0_REG(i) (REG_UHCI_BASE(i) + 0x80) -/* UHCI_SEND_Q1_WORD0 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: This register stores the content of short packet's first dword*/ -#define UHCI_SEND_Q1_WORD0 0xFFFFFFFF -#define UHCI_SEND_Q1_WORD0_M ((UHCI_SEND_Q1_WORD0_V)<<(UHCI_SEND_Q1_WORD0_S)) -#define UHCI_SEND_Q1_WORD0_V 0xFFFFFFFF -#define UHCI_SEND_Q1_WORD0_S 0 - -#define UHCI_Q1_WORD1_REG(i) (REG_UHCI_BASE(i) + 0x84) -/* UHCI_SEND_Q1_WORD1 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: This register stores the content of short packet's second dword*/ -#define UHCI_SEND_Q1_WORD1 0xFFFFFFFF -#define UHCI_SEND_Q1_WORD1_M ((UHCI_SEND_Q1_WORD1_V)<<(UHCI_SEND_Q1_WORD1_S)) -#define UHCI_SEND_Q1_WORD1_V 0xFFFFFFFF -#define UHCI_SEND_Q1_WORD1_S 0 - -#define UHCI_Q2_WORD0_REG(i) (REG_UHCI_BASE(i) + 0x88) -/* UHCI_SEND_Q2_WORD0 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: This register stores the content of short packet's first dword*/ -#define UHCI_SEND_Q2_WORD0 0xFFFFFFFF -#define UHCI_SEND_Q2_WORD0_M ((UHCI_SEND_Q2_WORD0_V)<<(UHCI_SEND_Q2_WORD0_S)) -#define UHCI_SEND_Q2_WORD0_V 0xFFFFFFFF -#define UHCI_SEND_Q2_WORD0_S 0 - -#define UHCI_Q2_WORD1_REG(i) (REG_UHCI_BASE(i) + 0x8C) -/* UHCI_SEND_Q2_WORD1 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: This register stores the content of short packet's second dword*/ -#define UHCI_SEND_Q2_WORD1 0xFFFFFFFF -#define UHCI_SEND_Q2_WORD1_M ((UHCI_SEND_Q2_WORD1_V)<<(UHCI_SEND_Q2_WORD1_S)) -#define UHCI_SEND_Q2_WORD1_V 0xFFFFFFFF -#define UHCI_SEND_Q2_WORD1_S 0 - -#define UHCI_Q3_WORD0_REG(i) (REG_UHCI_BASE(i) + 0x90) -/* UHCI_SEND_Q3_WORD0 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: This register stores the content of short packet's first dword*/ -#define UHCI_SEND_Q3_WORD0 0xFFFFFFFF -#define UHCI_SEND_Q3_WORD0_M ((UHCI_SEND_Q3_WORD0_V)<<(UHCI_SEND_Q3_WORD0_S)) -#define UHCI_SEND_Q3_WORD0_V 0xFFFFFFFF -#define UHCI_SEND_Q3_WORD0_S 0 - -#define UHCI_Q3_WORD1_REG(i) (REG_UHCI_BASE(i) + 0x94) -/* UHCI_SEND_Q3_WORD1 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: This register stores the content of short packet's second dword*/ -#define UHCI_SEND_Q3_WORD1 0xFFFFFFFF -#define UHCI_SEND_Q3_WORD1_M ((UHCI_SEND_Q3_WORD1_V)<<(UHCI_SEND_Q3_WORD1_S)) -#define UHCI_SEND_Q3_WORD1_V 0xFFFFFFFF -#define UHCI_SEND_Q3_WORD1_S 0 - -#define UHCI_Q4_WORD0_REG(i) (REG_UHCI_BASE(i) + 0x98) -/* UHCI_SEND_Q4_WORD0 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: This register stores the content of short packet's first dword*/ -#define UHCI_SEND_Q4_WORD0 0xFFFFFFFF -#define UHCI_SEND_Q4_WORD0_M ((UHCI_SEND_Q4_WORD0_V)<<(UHCI_SEND_Q4_WORD0_S)) -#define UHCI_SEND_Q4_WORD0_V 0xFFFFFFFF -#define UHCI_SEND_Q4_WORD0_S 0 - -#define UHCI_Q4_WORD1_REG(i) (REG_UHCI_BASE(i) + 0x9C) -/* UHCI_SEND_Q4_WORD1 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: This register stores the content of short packet's second dword*/ -#define UHCI_SEND_Q4_WORD1 0xFFFFFFFF -#define UHCI_SEND_Q4_WORD1_M ((UHCI_SEND_Q4_WORD1_V)<<(UHCI_SEND_Q4_WORD1_S)) -#define UHCI_SEND_Q4_WORD1_V 0xFFFFFFFF -#define UHCI_SEND_Q4_WORD1_S 0 - -#define UHCI_Q5_WORD0_REG(i) (REG_UHCI_BASE(i) + 0xA0) -/* UHCI_SEND_Q5_WORD0 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: This register stores the content of short packet's first dword*/ -#define UHCI_SEND_Q5_WORD0 0xFFFFFFFF -#define UHCI_SEND_Q5_WORD0_M ((UHCI_SEND_Q5_WORD0_V)<<(UHCI_SEND_Q5_WORD0_S)) -#define UHCI_SEND_Q5_WORD0_V 0xFFFFFFFF -#define UHCI_SEND_Q5_WORD0_S 0 - -#define UHCI_Q5_WORD1_REG(i) (REG_UHCI_BASE(i) + 0xA4) -/* UHCI_SEND_Q5_WORD1 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: This register stores the content of short packet's second dword*/ -#define UHCI_SEND_Q5_WORD1 0xFFFFFFFF -#define UHCI_SEND_Q5_WORD1_M ((UHCI_SEND_Q5_WORD1_V)<<(UHCI_SEND_Q5_WORD1_S)) -#define UHCI_SEND_Q5_WORD1_V 0xFFFFFFFF -#define UHCI_SEND_Q5_WORD1_S 0 - -#define UHCI_Q6_WORD0_REG(i) (REG_UHCI_BASE(i) + 0xA8) -/* UHCI_SEND_Q6_WORD0 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: This register stores the content of short packet's first dword*/ -#define UHCI_SEND_Q6_WORD0 0xFFFFFFFF -#define UHCI_SEND_Q6_WORD0_M ((UHCI_SEND_Q6_WORD0_V)<<(UHCI_SEND_Q6_WORD0_S)) -#define UHCI_SEND_Q6_WORD0_V 0xFFFFFFFF -#define UHCI_SEND_Q6_WORD0_S 0 - -#define UHCI_Q6_WORD1_REG(i) (REG_UHCI_BASE(i) + 0xAC) -/* UHCI_SEND_Q6_WORD1 : R/W ;bitpos:[31:0] ;default: 32'h0 ; */ -/*description: This register stores the content of short packet's second dword*/ -#define UHCI_SEND_Q6_WORD1 0xFFFFFFFF -#define UHCI_SEND_Q6_WORD1_M ((UHCI_SEND_Q6_WORD1_V)<<(UHCI_SEND_Q6_WORD1_S)) -#define UHCI_SEND_Q6_WORD1_V 0xFFFFFFFF -#define UHCI_SEND_Q6_WORD1_S 0 - -#define UHCI_ESC_CONF0_REG(i) (REG_UHCI_BASE(i) + 0xB0) -/* UHCI_SEPER_ESC_CHAR1 : R/W ;bitpos:[23:16] ;default: 8'hdc ; */ -/*description: This register stores the second char used to replace seperator - char in data . 0xdc 0xdb replace 0xc0 by default.*/ -#define UHCI_SEPER_ESC_CHAR1 0x000000FF -#define UHCI_SEPER_ESC_CHAR1_M ((UHCI_SEPER_ESC_CHAR1_V)<<(UHCI_SEPER_ESC_CHAR1_S)) -#define UHCI_SEPER_ESC_CHAR1_V 0xFF -#define UHCI_SEPER_ESC_CHAR1_S 16 -/* UHCI_SEPER_ESC_CHAR0 : R/W ;bitpos:[15:8] ;default: 8'hdb ; */ -/*description: This register stores thee first char used to replace seperator char in data.*/ -#define UHCI_SEPER_ESC_CHAR0 0x000000FF -#define UHCI_SEPER_ESC_CHAR0_M ((UHCI_SEPER_ESC_CHAR0_V)<<(UHCI_SEPER_ESC_CHAR0_S)) -#define UHCI_SEPER_ESC_CHAR0_V 0xFF -#define UHCI_SEPER_ESC_CHAR0_S 8 -/* UHCI_SEPER_CHAR : R/W ;bitpos:[7:0] ;default: 8'hc0 ; */ -/*description: This register stores the seperator char seperator char is used - to seperate the data frame.*/ -#define UHCI_SEPER_CHAR 0x000000FF -#define UHCI_SEPER_CHAR_M ((UHCI_SEPER_CHAR_V)<<(UHCI_SEPER_CHAR_S)) -#define UHCI_SEPER_CHAR_V 0xFF -#define UHCI_SEPER_CHAR_S 0 - -#define UHCI_ESC_CONF1_REG(i) (REG_UHCI_BASE(i) + 0xB4) -/* UHCI_ESC_SEQ0_CHAR1 : R/W ;bitpos:[23:16] ;default: 8'hdd ; */ -/*description: This register stores the second char used to replace the reg_esc_seq0 in data*/ -#define UHCI_ESC_SEQ0_CHAR1 0x000000FF -#define UHCI_ESC_SEQ0_CHAR1_M ((UHCI_ESC_SEQ0_CHAR1_V)<<(UHCI_ESC_SEQ0_CHAR1_S)) -#define UHCI_ESC_SEQ0_CHAR1_V 0xFF -#define UHCI_ESC_SEQ0_CHAR1_S 16 -/* UHCI_ESC_SEQ0_CHAR0 : R/W ;bitpos:[15:8] ;default: 8'hdb ; */ -/*description: This register stores the first char used to replace reg_esc_seq0 in data.*/ -#define UHCI_ESC_SEQ0_CHAR0 0x000000FF -#define UHCI_ESC_SEQ0_CHAR0_M ((UHCI_ESC_SEQ0_CHAR0_V)<<(UHCI_ESC_SEQ0_CHAR0_S)) -#define UHCI_ESC_SEQ0_CHAR0_V 0xFF -#define UHCI_ESC_SEQ0_CHAR0_S 8 -/* UHCI_ESC_SEQ0 : R/W ;bitpos:[7:0] ;default: 8'hdb ; */ -/*description: This register stores the first substitute char used to replace - the seperator char.*/ -#define UHCI_ESC_SEQ0 0x000000FF -#define UHCI_ESC_SEQ0_M ((UHCI_ESC_SEQ0_V)<<(UHCI_ESC_SEQ0_S)) -#define UHCI_ESC_SEQ0_V 0xFF -#define UHCI_ESC_SEQ0_S 0 - -#define UHCI_ESC_CONF2_REG(i) (REG_UHCI_BASE(i) + 0xB8) -/* UHCI_ESC_SEQ1_CHAR1 : R/W ;bitpos:[23:16] ;default: 8'hde ; */ -/*description: This register stores the second char used to replace the reg_esc_seq1 in data.*/ -#define UHCI_ESC_SEQ1_CHAR1 0x000000FF -#define UHCI_ESC_SEQ1_CHAR1_M ((UHCI_ESC_SEQ1_CHAR1_V)<<(UHCI_ESC_SEQ1_CHAR1_S)) -#define UHCI_ESC_SEQ1_CHAR1_V 0xFF -#define UHCI_ESC_SEQ1_CHAR1_S 16 -/* UHCI_ESC_SEQ1_CHAR0 : R/W ;bitpos:[15:8] ;default: 8'hdb ; */ -/*description: This register stores the first char used to replace the reg_esc_seq1 in data.*/ -#define UHCI_ESC_SEQ1_CHAR0 0x000000FF -#define UHCI_ESC_SEQ1_CHAR0_M ((UHCI_ESC_SEQ1_CHAR0_V)<<(UHCI_ESC_SEQ1_CHAR0_S)) -#define UHCI_ESC_SEQ1_CHAR0_V 0xFF -#define UHCI_ESC_SEQ1_CHAR0_S 8 -/* UHCI_ESC_SEQ1 : R/W ;bitpos:[7:0] ;default: 8'h11 ; */ -/*description: This register stores the flow control char to turn on the flow_control*/ -#define UHCI_ESC_SEQ1 0x000000FF -#define UHCI_ESC_SEQ1_M ((UHCI_ESC_SEQ1_V)<<(UHCI_ESC_SEQ1_S)) -#define UHCI_ESC_SEQ1_V 0xFF -#define UHCI_ESC_SEQ1_S 0 - -#define UHCI_ESC_CONF3_REG(i) (REG_UHCI_BASE(i) + 0xBC) -/* UHCI_ESC_SEQ2_CHAR1 : R/W ;bitpos:[23:16] ;default: 8'hdf ; */ -/*description: This register stores the second char used to replace the reg_esc_seq2 in data.*/ -#define UHCI_ESC_SEQ2_CHAR1 0x000000FF -#define UHCI_ESC_SEQ2_CHAR1_M ((UHCI_ESC_SEQ2_CHAR1_V)<<(UHCI_ESC_SEQ2_CHAR1_S)) -#define UHCI_ESC_SEQ2_CHAR1_V 0xFF -#define UHCI_ESC_SEQ2_CHAR1_S 16 -/* UHCI_ESC_SEQ2_CHAR0 : R/W ;bitpos:[15:8] ;default: 8'hdb ; */ -/*description: This register stores the first char used to replace the reg_esc_seq2 in data.*/ -#define UHCI_ESC_SEQ2_CHAR0 0x000000FF -#define UHCI_ESC_SEQ2_CHAR0_M ((UHCI_ESC_SEQ2_CHAR0_V)<<(UHCI_ESC_SEQ2_CHAR0_S)) -#define UHCI_ESC_SEQ2_CHAR0_V 0xFF -#define UHCI_ESC_SEQ2_CHAR0_S 8 -/* UHCI_ESC_SEQ2 : R/W ;bitpos:[7:0] ;default: 8'h13 ; */ -/*description: This register stores the flow_control char to turn off the flow_control*/ -#define UHCI_ESC_SEQ2 0x000000FF -#define UHCI_ESC_SEQ2_M ((UHCI_ESC_SEQ2_V)<<(UHCI_ESC_SEQ2_S)) -#define UHCI_ESC_SEQ2_V 0xFF -#define UHCI_ESC_SEQ2_S 0 - -#define UHCI_PKT_THRES_REG(i) (REG_UHCI_BASE(i) + 0xC0) -/* UHCI_PKT_THRS : R/W ;bitpos:[12:0] ;default: 13'h80 ; */ -/*description: when the amount of packet payload is greater than this value - the process of receiving data is done.*/ -#define UHCI_PKT_THRS 0x00001FFF -#define UHCI_PKT_THRS_M ((UHCI_PKT_THRS_V)<<(UHCI_PKT_THRS_S)) -#define UHCI_PKT_THRS_V 0x1FFF -#define UHCI_PKT_THRS_S 0 - -#define UHCI_DATE_REG(i) (REG_UHCI_BASE(i) + 0xFC) -/* UHCI_DATE : R/W ;bitpos:[31:0] ;default: 32'h16041001 ; */ -/*description: version information*/ -#define UHCI_DATE 0xFFFFFFFF -#define UHCI_DATE_M ((UHCI_DATE_V)<<(UHCI_DATE_S)) -#define UHCI_DATE_V 0xFFFFFFFF -#define UHCI_DATE_S 0 - - - - -#endif /*_SOC_UHCI_REG_H_ */ - - diff --git a/tools/sdk/include/soc/soc/uhci_struct.h b/tools/sdk/include/soc/soc/uhci_struct.h deleted file mode 100644 index 1c1ff0b8891..00000000000 --- a/tools/sdk/include/soc/soc/uhci_struct.h +++ /dev/null @@ -1,347 +0,0 @@ -// 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. -#ifndef _SOC_UHCI_STRUCT_H_ -#define _SOC_UHCI_STRUCT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef volatile struct { - union { - struct { - uint32_t in_rst: 1; /*Set this bit to reset in link operations.*/ - uint32_t out_rst: 1; /*Set this bit to reset out link operations.*/ - uint32_t ahbm_fifo_rst: 1; /*Set this bit to reset dma ahb fifo.*/ - uint32_t ahbm_rst: 1; /*Set this bit to reset dma ahb interface.*/ - uint32_t in_loop_test: 1; /*Set this bit to enable loop test for in links.*/ - uint32_t out_loop_test: 1; /*Set this bit to enable loop test for out links.*/ - uint32_t out_auto_wrback: 1; /*when in link's length is 0 go on to use the next in link automatically.*/ - uint32_t out_no_restart_clr: 1; /*don't use*/ - uint32_t out_eof_mode: 1; /*Set this bit to produce eof after DMA pops all data clear this bit to produce eof after DMA pushes all data*/ - uint32_t uart0_ce: 1; /*Set this bit to use UART to transmit or receive data.*/ - uint32_t uart1_ce: 1; /*Set this bit to use UART1 to transmit or receive data.*/ - uint32_t uart2_ce: 1; /*Set this bit to use UART2 to transmit or receive data.*/ - uint32_t outdscr_burst_en: 1; /*Set this bit to enable DMA in links to use burst mode.*/ - uint32_t indscr_burst_en: 1; /*Set this bit to enable DMA out links to use burst mode.*/ - uint32_t out_data_burst_en: 1; /*Set this bit to enable DMA burst MODE*/ - uint32_t mem_trans_en: 1; - uint32_t seper_en: 1; /*Set this bit to use special char to separate the data frame.*/ - uint32_t head_en: 1; /*Set this bit to enable to use head packet before the data frame.*/ - uint32_t crc_rec_en: 1; /*Set this bit to enable receiver''s ability of crc calculation when crc_en bit in head packet is 1 then there will be crc bytes after data_frame*/ - uint32_t uart_idle_eof_en: 1; /*Set this bit to enable to use idle time when the idle time after data frame is satisfied this means the end of a data frame.*/ - uint32_t len_eof_en: 1; /*Set this bit to enable to use packet_len in packet head when the received data is equal to packet_len this means the end of a data frame.*/ - uint32_t encode_crc_en: 1; /*Set this bit to enable crc calculation for data frame when bit6 in the head packet is 1.*/ - uint32_t clk_en: 1; /*Set this bit to enable clock-gating for read or write registers.*/ - uint32_t uart_rx_brk_eof_en: 1; /*Set this bit to enable to use brk char as the end of a data frame.*/ - uint32_t reserved24: 8; - }; - uint32_t val; - } conf0; - union { - struct { - uint32_t rx_start: 1; /*when a separator char has been send it will produce uhci_rx_start_int interrupt.*/ - uint32_t tx_start: 1; /*when DMA detects a separator char it will produce uhci_tx_start_int interrupt.*/ - uint32_t rx_hung: 1; /*when DMA takes a lot of time to receive a data it will produce uhci_rx_hung_int interrupt.*/ - uint32_t tx_hung: 1; /*when DMA takes a lot of time to read a data from RAM it will produce uhci_tx_hung_int interrupt.*/ - uint32_t in_done: 1; /*when a in link descriptor has been completed it will produce uhci_in_done_int interrupt.*/ - uint32_t in_suc_eof: 1; /*when a data packet has been received it will produce uhci_in_suc_eof_int interrupt.*/ - uint32_t in_err_eof: 1; /*when there are some errors about eof in in link descriptor it will produce uhci_in_err_eof_int interrupt.*/ - uint32_t out_done: 1; /*when a out link descriptor is completed it will produce uhci_out_done_int interrupt.*/ - uint32_t out_eof: 1; /*when the current descriptor's eof bit is 1 it will produce uhci_out_eof_int interrupt.*/ - uint32_t in_dscr_err: 1; /*when there are some errors about the out link descriptor it will produce uhci_in_dscr_err_int interrupt.*/ - uint32_t out_dscr_err: 1; /*when there are some errors about the in link descriptor it will produce uhci_out_dscr_err_int interrupt.*/ - uint32_t in_dscr_empty: 1; /*when there are not enough in links for DMA it will produce uhci_in_dscr_err_int interrupt.*/ - uint32_t outlink_eof_err: 1; /*when there are some errors about eof in outlink descriptor it will produce uhci_outlink_eof_err_int interrupt.*/ - uint32_t out_total_eof: 1; /*When all data have been send it will produce uhci_out_total_eof_int interrupt.*/ - uint32_t send_s_q: 1; /*When use single send registers to send a short packets it will produce this interrupt when dma has send the short packet.*/ - uint32_t send_a_q: 1; /*When use always_send registers to send a series of short packets it will produce this interrupt when dma has send the short packet.*/ - uint32_t dma_in_fifo_full_wm: 1; - uint32_t reserved17: 15; - }; - uint32_t val; - } int_raw; - union { - struct { - uint32_t rx_start: 1; - uint32_t tx_start: 1; - uint32_t rx_hung: 1; - uint32_t tx_hung: 1; - uint32_t in_done: 1; - uint32_t in_suc_eof: 1; - uint32_t in_err_eof: 1; - uint32_t out_done: 1; - uint32_t out_eof: 1; - uint32_t in_dscr_err: 1; - uint32_t out_dscr_err: 1; - uint32_t in_dscr_empty: 1; - uint32_t outlink_eof_err: 1; - uint32_t out_total_eof: 1; - uint32_t send_s_q: 1; - uint32_t send_a_q: 1; - uint32_t dma_in_fifo_full_wm: 1; - uint32_t reserved17: 15; - }; - uint32_t val; - } int_st; - union { - struct { - uint32_t rx_start: 1; - uint32_t tx_start: 1; - uint32_t rx_hung: 1; - uint32_t tx_hung: 1; - uint32_t in_done: 1; - uint32_t in_suc_eof: 1; - uint32_t in_err_eof: 1; - uint32_t out_done: 1; - uint32_t out_eof: 1; - uint32_t in_dscr_err: 1; - uint32_t out_dscr_err: 1; - uint32_t in_dscr_empty: 1; - uint32_t outlink_eof_err: 1; - uint32_t out_total_eof: 1; - uint32_t send_s_q: 1; - uint32_t send_a_q: 1; - uint32_t dma_in_fifo_full_wm: 1; - uint32_t reserved17: 15; - }; - uint32_t val; - } int_ena; - union { - struct { - uint32_t rx_start: 1; - uint32_t tx_start: 1; - uint32_t rx_hung: 1; - uint32_t tx_hung: 1; - uint32_t in_done: 1; - uint32_t in_suc_eof: 1; - uint32_t in_err_eof: 1; - uint32_t out_done: 1; - uint32_t out_eof: 1; - uint32_t in_dscr_err: 1; - uint32_t out_dscr_err: 1; - uint32_t in_dscr_empty: 1; - uint32_t outlink_eof_err: 1; - uint32_t out_total_eof: 1; - uint32_t send_s_q: 1; - uint32_t send_a_q: 1; - uint32_t dma_in_fifo_full_wm: 1; - uint32_t reserved17: 15; - }; - uint32_t val; - } int_clr; - union { - struct { - uint32_t full: 1; /*1:DMA out link descriptor's fifo is full.*/ - uint32_t empty: 1; /*1:DMA in link descriptor's fifo is empty.*/ - uint32_t reserved2: 30; - }; - uint32_t val; - } dma_out_status; - union { - struct { - uint32_t fifo_wdata: 9; /*This is the data need to be pushed into out link descriptor's fifo.*/ - uint32_t reserved9: 7; - uint32_t fifo_push: 1; /*Set this bit to push data in out link descriptor's fifo.*/ - uint32_t reserved17:15; - }; - uint32_t val; - } dma_out_push; - union { - struct { - uint32_t full: 1; - uint32_t empty: 1; - uint32_t reserved2: 2; - uint32_t rx_err_cause: 3; /*This register stores the errors caused in out link descriptor's data packet.*/ - uint32_t reserved7: 25; - }; - uint32_t val; - } dma_in_status; - union { - struct { - uint32_t fifo_rdata: 12; /*This register stores the data pop from in link descriptor's fifo.*/ - uint32_t reserved12: 4; - uint32_t fifo_pop: 1; /*Set this bit to pop data in in link descriptor's fifo.*/ - uint32_t reserved17: 15; - }; - uint32_t val; - } dma_in_pop; - union { - struct { - uint32_t addr: 20; /*This register stores the least 20 bits of the first out link descriptor's address.*/ - uint32_t reserved20: 8; - uint32_t stop: 1; /*Set this bit to stop dealing with the out link descriptors.*/ - uint32_t start: 1; /*Set this bit to start dealing with the out link descriptors.*/ - uint32_t restart: 1; /*Set this bit to mount on new out link descriptors*/ - uint32_t park: 1; /*1: the out link descriptor's fsm is in idle state. 0:the out link descriptor's fsm is working.*/ - }; - uint32_t val; - } dma_out_link; - union { - struct { - uint32_t addr: 20; /*This register stores the least 20 bits of the first in link descriptor's address.*/ - uint32_t auto_ret: 1; /*1:when a packet is wrong in link descriptor returns to the descriptor which is lately used.*/ - uint32_t reserved21: 7; - uint32_t stop: 1; /*Set this bit to stop dealing with the in link descriptors.*/ - uint32_t start: 1; /*Set this bit to start dealing with the in link descriptors.*/ - uint32_t restart: 1; /*Set this bit to mount on new in link descriptors*/ - uint32_t park: 1; /*1:the in link descriptor's fsm is in idle state. 0:the in link descriptor's fsm is working*/ - }; - uint32_t val; - } dma_in_link; - union { - struct { - uint32_t check_sum_en: 1; /*Set this bit to enable decoder to check check_sum in packet header.*/ - uint32_t check_seq_en: 1; /*Set this bit to enable decoder to check seq num in packet header.*/ - uint32_t crc_disable: 1; /*Set this bit to disable crc calculation.*/ - uint32_t save_head: 1; /*Set this bit to save packet header .*/ - uint32_t tx_check_sum_re: 1; /*Set this bit to enable hardware replace check_sum in packet header automatically.*/ - uint32_t tx_ack_num_re: 1; /*Set this bit to enable hardware replace ack num in packet header automatically.*/ - uint32_t check_owner: 1; /*Set this bit to check the owner bit in link descriptor.*/ - uint32_t wait_sw_start: 1; /*Set this bit to enable software way to add packet header.*/ - uint32_t sw_start: 1; /*Set this bit to start inserting the packet header.*/ - uint32_t dma_in_fifo_full_thrs:12; /*when data amount in link descriptor's fifo is more than this register value it will produce uhci_dma_in_fifo_full_wm_int interrupt.*/ - uint32_t reserved21: 11; - }; - uint32_t val; - } conf1; - uint32_t state0; /**/ - uint32_t state1; /**/ - uint32_t dma_out_eof_des_addr; /*This register stores the address of out link description when eof bit in this descriptor is 1.*/ - uint32_t dma_in_suc_eof_des_addr; /*This register stores the address of in link descriptor when eof bit in this descriptor is 1.*/ - uint32_t dma_in_err_eof_des_addr; /*This register stores the address of in link descriptor when there are some errors in this descriptor.*/ - uint32_t dma_out_eof_bfr_des_addr; /*This register stores the address of out link descriptor when there are some errors in this descriptor.*/ - union { - struct { - uint32_t test_mode: 3; /*bit2 is ahb bus test enable ,bit1 is used to choose write(1) or read(0) mode. bit0 is used to choose test only once(1) or continue(0)*/ - uint32_t reserved3: 1; - uint32_t test_addr: 2; /*The two bits represent ahb bus address bit[20:19]*/ - uint32_t reserved6: 26; - }; - uint32_t val; - } ahb_test; - uint32_t dma_in_dscr; /*The content of current in link descriptor's third dword*/ - uint32_t dma_in_dscr_bf0; /*The content of current in link descriptor's first dword*/ - uint32_t dma_in_dscr_bf1; /*The content of current in link descriptor's second dword*/ - uint32_t dma_out_dscr; /*The content of current out link descriptor's third dword*/ - uint32_t dma_out_dscr_bf0; /*The content of current out link descriptor's first dword*/ - uint32_t dma_out_dscr_bf1; /*The content of current out link descriptor's second dword*/ - union { - struct { - uint32_t tx_c0_esc_en: 1; /*Set this bit to enable 0xc0 char decode when DMA receives data.*/ - uint32_t tx_db_esc_en: 1; /*Set this bit to enable 0xdb char decode when DMA receives data.*/ - uint32_t tx_11_esc_en: 1; /*Set this bit to enable flow control char 0x11 decode when DMA receives data.*/ - uint32_t tx_13_esc_en: 1; /*Set this bit to enable flow control char 0x13 decode when DMA receives data.*/ - uint32_t rx_c0_esc_en: 1; /*Set this bit to enable 0xc0 char replace when DMA sends data.*/ - uint32_t rx_db_esc_en: 1; /*Set this bit to enable 0xdb char replace when DMA sends data.*/ - uint32_t rx_11_esc_en: 1; /*Set this bit to enable flow control char 0x11 replace when DMA sends data.*/ - uint32_t rx_13_esc_en: 1; /*Set this bit to enable flow control char 0x13 replace when DMA sends data.*/ - uint32_t reserved8: 24; - }; - uint32_t val; - } escape_conf; - union { - struct { - uint32_t txfifo_timeout: 8; /*This register stores the timeout value.when DMA takes more time than this register value to receive a data it will produce uhci_tx_hung_int interrupt.*/ - uint32_t txfifo_timeout_shift: 3; /*The tick count is cleared when its value >=(17'd8000>>reg_txfifo_timeout_shift)*/ - uint32_t txfifo_timeout_ena: 1; /*The enable bit for tx fifo receive data timeout*/ - uint32_t rxfifo_timeout: 8; /*This register stores the timeout value.when DMA takes more time than this register value to read a data from RAM it will produce uhci_rx_hung_int interrupt.*/ - uint32_t rxfifo_timeout_shift: 3; /*The tick count is cleared when its value >=(17'd8000>>reg_rxfifo_timeout_shift)*/ - uint32_t rxfifo_timeout_ena: 1; /*This is the enable bit for DMA send data timeout*/ - uint32_t reserved24: 8; - }; - uint32_t val; - } hung_conf; - uint32_t ack_num; /**/ - uint32_t rx_head; /*This register stores the packet header received by DMA*/ - union { - struct { - uint32_t single_send_num: 3; /*The bits are used to choose which short packet*/ - uint32_t single_send_en: 1; /*Set this bit to enable send a short packet*/ - uint32_t always_send_num: 3; /*The bits are used to choose which short packet*/ - uint32_t always_send_en: 1; /*Set this bit to enable continuously send the same short packet*/ - uint32_t reserved8: 24; - }; - uint32_t val; - } quick_sent; - struct{ - uint32_t w_data[2]; /*This register stores the content of short packet's dword*/ - } q_data[7]; - union { - struct { - uint32_t seper_char: 8; /*This register stores the separator char separator char is used to separate the data frame.*/ - uint32_t seper_esc_char0: 8; /*This register stores the first char used to replace separator char in data.*/ - uint32_t seper_esc_char1: 8; /*This register stores the second char used to replace separator char in data . 0xdc 0xdb replace 0xc0 by default.*/ - uint32_t reserved24: 8; - }; - uint32_t val; - } esc_conf0; - union { - struct { - uint32_t seq0: 8; /*This register stores the first substitute char used to replace the separate char.*/ - uint32_t seq0_char0: 8; /*This register stores the first char used to replace reg_esc_seq0 in data.*/ - uint32_t seq0_char1: 8; /*This register stores the second char used to replace the reg_esc_seq0 in data*/ - uint32_t reserved24: 8; - }; - uint32_t val; - } esc_conf1; - union { - struct { - uint32_t seq1: 8; /*This register stores the flow control char to turn on the flow_control*/ - uint32_t seq1_char0: 8; /*This register stores the first char used to replace the reg_esc_seq1 in data.*/ - uint32_t seq1_char1: 8; /*This register stores the second char used to replace the reg_esc_seq1 in data.*/ - uint32_t reserved24: 8; - }; - uint32_t val; - } esc_conf2; - union { - struct { - uint32_t seq2: 8; /*This register stores the flow_control char to turn off the flow_control*/ - uint32_t seq2_char0: 8; /*This register stores the first char used to replace the reg_esc_seq2 in data.*/ - uint32_t seq2_char1: 8; /*This register stores the second char used to replace the reg_esc_seq2 in data.*/ - uint32_t reserved24: 8; - }; - uint32_t val; - } esc_conf3; - union { - struct { - uint32_t thrs: 13; /*when the amount of packet payload is larger than this value the process of receiving data is done.*/ - uint32_t reserved13:19; - }; - uint32_t val; - } pkt_thres; - uint32_t reserved_c4; - uint32_t reserved_c8; - uint32_t reserved_cc; - uint32_t reserved_d0; - uint32_t reserved_d4; - uint32_t reserved_d8; - uint32_t reserved_dc; - uint32_t reserved_e0; - uint32_t reserved_e4; - uint32_t reserved_e8; - uint32_t reserved_ec; - uint32_t reserved_f0; - uint32_t reserved_f4; - uint32_t reserved_f8; - uint32_t date; /*version information*/ -} uhci_dev_t; -extern uhci_dev_t UHCI0; -extern uhci_dev_t UHCI1; - -#ifdef __cplusplus -} -#endif - -#endif /* _SOC_UHCI_STRUCT_H_ */ diff --git a/tools/sdk/include/soc/soc/wdev_reg.h b/tools/sdk/include/soc/soc/wdev_reg.h deleted file mode 100644 index f3217cb0d6f..00000000000 --- a/tools/sdk/include/soc/soc/wdev_reg.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2010-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. - -#pragma once - -#include "soc.h" - -/* Hardware random number generator register */ -#define WDEV_RND_REG 0x60035144 diff --git a/tools/sdk/include/spi_flash/esp_partition.h b/tools/sdk/include/spi_flash/esp_partition.h deleted file mode 100644 index b1203696b84..00000000000 --- a/tools/sdk/include/spi_flash/esp_partition.h +++ /dev/null @@ -1,327 +0,0 @@ -// 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. - -#ifndef __ESP_PARTITION_H__ -#define __ESP_PARTITION_H__ - -#include -#include -#include -#include "esp_err.h" -#include "esp_spi_flash.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @file esp_partition.h - * @brief Partition APIs - */ - - -/** - * @brief Partition type - * @note Keep this enum in sync with PartitionDefinition class gen_esp32part.py - */ -typedef enum { - ESP_PARTITION_TYPE_APP = 0x00, //!< Application partition type - ESP_PARTITION_TYPE_DATA = 0x01, //!< Data partition type -} esp_partition_type_t; - -/** - * @brief Partition subtype - * @note Keep this enum in sync with PartitionDefinition class gen_esp32part.py - */ -typedef enum { - ESP_PARTITION_SUBTYPE_APP_FACTORY = 0x00, //!< Factory application partition - ESP_PARTITION_SUBTYPE_APP_OTA_MIN = 0x10, //!< Base for OTA partition subtypes - ESP_PARTITION_SUBTYPE_APP_OTA_0 = ESP_PARTITION_SUBTYPE_APP_OTA_MIN + 0, //!< OTA partition 0 - ESP_PARTITION_SUBTYPE_APP_OTA_1 = ESP_PARTITION_SUBTYPE_APP_OTA_MIN + 1, //!< OTA partition 1 - ESP_PARTITION_SUBTYPE_APP_OTA_2 = ESP_PARTITION_SUBTYPE_APP_OTA_MIN + 2, //!< OTA partition 2 - ESP_PARTITION_SUBTYPE_APP_OTA_3 = ESP_PARTITION_SUBTYPE_APP_OTA_MIN + 3, //!< OTA partition 3 - ESP_PARTITION_SUBTYPE_APP_OTA_4 = ESP_PARTITION_SUBTYPE_APP_OTA_MIN + 4, //!< OTA partition 4 - ESP_PARTITION_SUBTYPE_APP_OTA_5 = ESP_PARTITION_SUBTYPE_APP_OTA_MIN + 5, //!< OTA partition 5 - ESP_PARTITION_SUBTYPE_APP_OTA_6 = ESP_PARTITION_SUBTYPE_APP_OTA_MIN + 6, //!< OTA partition 6 - ESP_PARTITION_SUBTYPE_APP_OTA_7 = ESP_PARTITION_SUBTYPE_APP_OTA_MIN + 7, //!< OTA partition 7 - ESP_PARTITION_SUBTYPE_APP_OTA_8 = ESP_PARTITION_SUBTYPE_APP_OTA_MIN + 8, //!< OTA partition 8 - ESP_PARTITION_SUBTYPE_APP_OTA_9 = ESP_PARTITION_SUBTYPE_APP_OTA_MIN + 9, //!< OTA partition 9 - ESP_PARTITION_SUBTYPE_APP_OTA_10 = ESP_PARTITION_SUBTYPE_APP_OTA_MIN + 10,//!< OTA partition 10 - ESP_PARTITION_SUBTYPE_APP_OTA_11 = ESP_PARTITION_SUBTYPE_APP_OTA_MIN + 11,//!< OTA partition 11 - ESP_PARTITION_SUBTYPE_APP_OTA_12 = ESP_PARTITION_SUBTYPE_APP_OTA_MIN + 12,//!< OTA partition 12 - ESP_PARTITION_SUBTYPE_APP_OTA_13 = ESP_PARTITION_SUBTYPE_APP_OTA_MIN + 13,//!< OTA partition 13 - ESP_PARTITION_SUBTYPE_APP_OTA_14 = ESP_PARTITION_SUBTYPE_APP_OTA_MIN + 14,//!< OTA partition 14 - ESP_PARTITION_SUBTYPE_APP_OTA_15 = ESP_PARTITION_SUBTYPE_APP_OTA_MIN + 15,//!< OTA partition 15 - ESP_PARTITION_SUBTYPE_APP_OTA_MAX = ESP_PARTITION_SUBTYPE_APP_OTA_MIN + 16,//!< Max subtype of OTA partition - ESP_PARTITION_SUBTYPE_APP_TEST = 0x20, //!< Test application partition - - ESP_PARTITION_SUBTYPE_DATA_OTA = 0x00, //!< OTA selection partition - ESP_PARTITION_SUBTYPE_DATA_PHY = 0x01, //!< PHY init data partition - ESP_PARTITION_SUBTYPE_DATA_NVS = 0x02, //!< NVS partition - ESP_PARTITION_SUBTYPE_DATA_COREDUMP = 0x03, //!< COREDUMP partition - ESP_PARTITION_SUBTYPE_DATA_NVS_KEYS = 0x04, //!< Partition for NVS keys - - ESP_PARTITION_SUBTYPE_DATA_ESPHTTPD = 0x80, //!< ESPHTTPD partition - ESP_PARTITION_SUBTYPE_DATA_FAT = 0x81, //!< FAT partition - ESP_PARTITION_SUBTYPE_DATA_SPIFFS = 0x82, //!< SPIFFS partition - - ESP_PARTITION_SUBTYPE_ANY = 0xff, //!< Used to search for partitions with any subtype -} esp_partition_subtype_t; - -/** - * @brief Convenience macro to get esp_partition_subtype_t value for the i-th OTA partition - */ -#define ESP_PARTITION_SUBTYPE_OTA(i) ((esp_partition_subtype_t)(ESP_PARTITION_SUBTYPE_APP_OTA_MIN + ((i) & 0xf))) - -/** - * @brief Opaque partition iterator type - */ -typedef struct esp_partition_iterator_opaque_* esp_partition_iterator_t; - -/** - * @brief partition information structure - * - * This is not the format in flash, that format is esp_partition_info_t. - * - * However, this is the format used by this API. - */ -typedef struct { - esp_partition_type_t type; /*!< partition type (app/data) */ - esp_partition_subtype_t subtype; /*!< partition subtype */ - uint32_t address; /*!< starting address of the partition in flash */ - uint32_t size; /*!< size of the partition, in bytes */ - char label[17]; /*!< partition label, zero-terminated ASCII string */ - bool encrypted; /*!< flag is set to true if partition is encrypted */ -} esp_partition_t; - -/** - * @brief Find partition based on one or more parameters - * - * @param type Partition type, one of esp_partition_type_t values - * @param subtype Partition subtype, one of esp_partition_subtype_t values. - * To find all partitions of given type, use - * ESP_PARTITION_SUBTYPE_ANY. - * @param label (optional) Partition label. Set this value if looking - * for partition with a specific name. Pass NULL otherwise. - * - * @return iterator which can be used to enumerate all the partitions found, - * or NULL if no partitions were found. - * Iterator obtained through this function has to be released - * using esp_partition_iterator_release when not used any more. - */ -esp_partition_iterator_t esp_partition_find(esp_partition_type_t type, esp_partition_subtype_t subtype, const char* label); - -/** - * @brief Find first partition based on one or more parameters - * - * @param type Partition type, one of esp_partition_type_t values - * @param subtype Partition subtype, one of esp_partition_subtype_t values. - * To find all partitions of given type, use - * ESP_PARTITION_SUBTYPE_ANY. - * @param label (optional) Partition label. Set this value if looking - * for partition with a specific name. Pass NULL otherwise. - * - * @return pointer to esp_partition_t structure, or NULL if no partition is found. - * This pointer is valid for the lifetime of the application. - */ -const esp_partition_t* esp_partition_find_first(esp_partition_type_t type, esp_partition_subtype_t subtype, const char* label); - -/** - * @brief Get esp_partition_t structure for given partition - * - * @param iterator Iterator obtained using esp_partition_find. Must be non-NULL. - * - * @return pointer to esp_partition_t structure. This pointer is valid for the lifetime - * of the application. - */ -const esp_partition_t* esp_partition_get(esp_partition_iterator_t iterator); - -/** - * @brief Move partition iterator to the next partition found - * - * Any copies of the iterator will be invalid after this call. - * - * @param iterator Iterator obtained using esp_partition_find. Must be non-NULL. - * - * @return NULL if no partition was found, valid esp_partition_iterator_t otherwise. - */ -esp_partition_iterator_t esp_partition_next(esp_partition_iterator_t iterator); - -/** - * @brief Release partition iterator - * - * @param iterator Iterator obtained using esp_partition_find. Must be non-NULL. - * - */ -void esp_partition_iterator_release(esp_partition_iterator_t iterator); - -/** - * @brief Verify partition data - * - * Given a pointer to partition data, verify this partition exists in the partition table (all fields match.) - * - * This function is also useful to take partition data which may be in a RAM buffer and convert it to a pointer to the - * permanent partition data stored in flash. - * - * Pointers returned from this function can be compared directly to the address of any pointer returned from - * esp_partition_get(), as a test for equality. - * - * @param partition Pointer to partition data to verify. Must be non-NULL. All fields of this structure must match the - * partition table entry in flash for this function to return a successful match. - * - * @return - * - If partition not found, returns NULL. - * - If found, returns a pointer to the esp_partition_t structure in flash. This pointer is always valid for the lifetime of the application. - */ -const esp_partition_t *esp_partition_verify(const esp_partition_t *partition); - -/** - * @brief Read data from the partition - * - * @param partition Pointer to partition structure obtained using - * esp_partition_find_first or esp_partition_get. - * Must be non-NULL. - * @param dst Pointer to the buffer where data should be stored. - * Pointer must be non-NULL and buffer must be at least 'size' bytes long. - * @param src_offset Address of the data to be read, relative to the - * beginning of the partition. - * @param size Size of data to be read, in bytes. - * - * @return ESP_OK, if data was read successfully; - * ESP_ERR_INVALID_ARG, if src_offset exceeds partition size; - * ESP_ERR_INVALID_SIZE, if read would go out of bounds of the partition; - * or one of error codes from lower-level flash driver. - */ -esp_err_t esp_partition_read(const esp_partition_t* partition, - size_t src_offset, void* dst, size_t size); - -/** - * @brief Write data to the partition - * - * Before writing data to flash, corresponding region of flash needs to be erased. - * This can be done using esp_partition_erase_range function. - * - * Partitions marked with an encryption flag will automatically be - * written via the spi_flash_write_encrypted() function. If writing to - * an encrypted partition, all write offsets and lengths must be - * multiples of 16 bytes. See the spi_flash_write_encrypted() function - * for more details. Unencrypted partitions do not have this - * restriction. - * - * @param partition Pointer to partition structure obtained using - * esp_partition_find_first or esp_partition_get. - * Must be non-NULL. - * @param dst_offset Address where the data should be written, relative to the - * beginning of the partition. - * @param src Pointer to the source buffer. Pointer must be non-NULL and - * buffer must be at least 'size' bytes long. - * @param size Size of data to be written, in bytes. - * - * @note Prior to writing to flash memory, make sure it has been erased with - * esp_partition_erase_range call. - * - * @return ESP_OK, if data was written successfully; - * ESP_ERR_INVALID_ARG, if dst_offset exceeds partition size; - * ESP_ERR_INVALID_SIZE, if write would go out of bounds of the partition; - * or one of error codes from lower-level flash driver. - */ -esp_err_t esp_partition_write(const esp_partition_t* partition, - size_t dst_offset, const void* src, size_t size); - -/** - * @brief Erase part of the partition - * - * @param partition Pointer to partition structure obtained using - * esp_partition_find_first or esp_partition_get. - * Must be non-NULL. - * @param start_addr Address where erase operation should start. Must be aligned - * to 4 kilobytes. - * @param size Size of the range which should be erased, in bytes. - * Must be divisible by 4 kilobytes. - * - * @return ESP_OK, if the range was erased successfully; - * ESP_ERR_INVALID_ARG, if iterator or dst are NULL; - * ESP_ERR_INVALID_SIZE, if erase would go out of bounds of the partition; - * or one of error codes from lower-level flash driver. - */ -esp_err_t esp_partition_erase_range(const esp_partition_t* partition, - uint32_t start_addr, uint32_t size); - -/** - * @brief Configure MMU to map partition into data memory - * - * Unlike spi_flash_mmap function, which requires a 64kB aligned base address, - * this function doesn't impose such a requirement. - * If offset results in a flash address which is not aligned to 64kB boundary, - * address will be rounded to the lower 64kB boundary, so that mapped region - * includes requested range. - * Pointer returned via out_ptr argument will be adjusted to point to the - * requested offset (not necessarily to the beginning of mmap-ed region). - * - * To release mapped memory, pass handle returned via out_handle argument to - * spi_flash_munmap function. - * - * @param partition Pointer to partition structure obtained using - * esp_partition_find_first or esp_partition_get. - * Must be non-NULL. - * @param offset Offset from the beginning of partition where mapping should start. - * @param size Size of the area to be mapped. - * @param memory Memory space where the region should be mapped - * @param out_ptr Output, pointer to the mapped memory region - * @param out_handle Output, handle which should be used for spi_flash_munmap call - * - * @return ESP_OK, if successful - */ -esp_err_t esp_partition_mmap(const esp_partition_t* partition, uint32_t offset, uint32_t size, - spi_flash_mmap_memory_t memory, - const void** out_ptr, spi_flash_mmap_handle_t* out_handle); - -/** - * @brief Get SHA-256 digest for required partition. - * - * For apps with SHA-256 appended to the app image, the result is the appended SHA-256 value for the app image content. - * The hash is verified before returning, if app content is invalid then the function returns ESP_ERR_IMAGE_INVALID. - * For apps without SHA-256 appended to the image, the result is the SHA-256 of all bytes in the app image. - * For other partition types, the result is the SHA-256 of the entire partition. - * - * @param[in] partition Pointer to info for partition containing app or data. (fields: address, size and type, are required to be filled). - * @param[out] sha_256 Returned SHA-256 digest for a given partition. - * - * @return - * - ESP_OK: In case of successful operation. - * - ESP_ERR_INVALID_ARG: The size was 0 or the sha_256 was NULL. - * - ESP_ERR_NO_MEM: Cannot allocate memory for sha256 operation. - * - ESP_ERR_IMAGE_INVALID: App partition doesn't contain a valid app image. - * - ESP_FAIL: An allocation error occurred. - */ -esp_err_t esp_partition_get_sha256(const esp_partition_t *partition, uint8_t *sha_256); - -/** - * @brief Check for the identity of two partitions by SHA-256 digest. - * - * @param[in] partition_1 Pointer to info for partition 1 containing app or data. (fields: address, size and type, are required to be filled). - * @param[in] partition_2 Pointer to info for partition 2 containing app or data. (fields: address, size and type, are required to be filled). - * - * @return - * - True: In case of the two firmware is equal. - * - False: Otherwise - */ -bool esp_partition_check_identity(const esp_partition_t *partition_1, const esp_partition_t *partition_2); - -#ifdef __cplusplus -} -#endif - - -#endif /* __ESP_PARTITION_H__ */ diff --git a/tools/sdk/include/spi_flash/esp_spi_flash.h b/tools/sdk/include/spi_flash/esp_spi_flash.h deleted file mode 100644 index 254e408959f..00000000000 --- a/tools/sdk/include/spi_flash/esp_spi_flash.h +++ /dev/null @@ -1,436 +0,0 @@ -// 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. - -#ifndef ESP_SPI_FLASH_H -#define ESP_SPI_FLASH_H - -#include -#include -#include -#include "esp_err.h" -#include "sdkconfig.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ESP_ERR_FLASH_BASE 0x10010 -#define ESP_ERR_FLASH_OP_FAIL (ESP_ERR_FLASH_BASE + 1) -#define ESP_ERR_FLASH_OP_TIMEOUT (ESP_ERR_FLASH_BASE + 2) - -#define SPI_FLASH_SEC_SIZE 4096 /**< SPI Flash sector size */ - -#define SPI_FLASH_MMU_PAGE_SIZE 0x10000 /**< Flash cache MMU mapping page size */ - -/** - * @brief Initialize SPI flash access driver - * - * This function must be called exactly once, before any other - * spi_flash_* functions are called. - * Currently this function is called from startup code. There is - * no need to call it from application code. - * - */ -void spi_flash_init(); - -/** - * @brief Get flash chip size, as set in binary image header - * - * @note This value does not necessarily match real flash size. - * - * @return size of flash chip, in bytes - */ -size_t spi_flash_get_chip_size(); - -/** - * @brief Erase the Flash sector. - * - * @param sector Sector number, the count starts at sector 0, 4KB per sector. - * - * @return esp_err_t - */ -esp_err_t spi_flash_erase_sector(size_t sector); - -/** - * @brief Erase a range of flash sectors - * - * @param start_address Address where erase operation has to start. - * Must be 4kB-aligned - * @param size Size of erased range, in bytes. Must be divisible by 4kB. - * - * @return esp_err_t - */ -esp_err_t spi_flash_erase_range(size_t start_address, size_t size); - - -/** - * @brief Write data to Flash. - * - * @note For fastest write performance, write a 4 byte aligned size at a - * 4 byte aligned offset in flash from a source buffer in DRAM. Varying any of - * these parameters will still work, but will be slower due to buffering. - * - * @note Writing more than 8KB at a time will be split into multiple - * write operations to avoid disrupting other tasks in the system. - * - * @param dest_addr Destination address in Flash. - * @param src Pointer to the source buffer. - * @param size Length of data, in bytes. - * - * @return esp_err_t - */ -esp_err_t spi_flash_write(size_t dest_addr, const void *src, size_t size); - - -/** - * @brief Write data encrypted to Flash. - * - * @note Flash encryption must be enabled for this function to work. - * - * @note Flash encryption must be enabled when calling this function. - * If flash encryption is disabled, the function returns - * ESP_ERR_INVALID_STATE. Use esp_flash_encryption_enabled() - * function to determine if flash encryption is enabled. - * - * @note Both dest_addr and size must be multiples of 16 bytes. For - * absolute best performance, both dest_addr and size arguments should - * be multiples of 32 bytes. - * - * @param dest_addr Destination address in Flash. Must be a multiple of 16 bytes. - * @param src Pointer to the source buffer. - * @param size Length of data, in bytes. Must be a multiple of 16 bytes. - * - * @return esp_err_t - */ -esp_err_t spi_flash_write_encrypted(size_t dest_addr, const void *src, size_t size); - -/** - * @brief Read data from Flash. - * - * @note For fastest read performance, all parameters should be - * 4 byte aligned. If source address and read size are not 4 byte - * aligned, read may be split into multiple flash operations. If - * destination buffer is not 4 byte aligned, a temporary buffer will - * be allocated on the stack. - * - * @note Reading more than 16KB of data at a time will be split - * into multiple reads to avoid disruption to other tasks in the - * system. Consider using spi_flash_mmap() to read large amounts - * of data. - * - * @param src_addr source address of the data in Flash. - * @param dest pointer to the destination buffer - * @param size length of data - * - * - * @return esp_err_t - */ -esp_err_t spi_flash_read(size_t src_addr, void *dest, size_t size); - - -/** - * @brief Read data from Encrypted Flash. - * - * If flash encryption is enabled, this function will transparently decrypt data as it is read. - * If flash encryption is not enabled, this function behaves the same as spi_flash_read(). - * - * See esp_flash_encryption_enabled() for a function to check if flash encryption is enabled. - * - * @param src source address of the data in Flash. - * @param dest pointer to the destination buffer - * @param size length of data - * - * @return esp_err_t - */ -esp_err_t spi_flash_read_encrypted(size_t src, void *dest, size_t size); - -/** - * @brief Enumeration which specifies memory space requested in an mmap call - */ -typedef enum { - SPI_FLASH_MMAP_DATA, /**< map to data memory (Vaddr0), allows byte-aligned access, 4 MB total */ - SPI_FLASH_MMAP_INST, /**< map to instruction memory (Vaddr1-3), allows only 4-byte-aligned access, 11 MB total */ -} spi_flash_mmap_memory_t; - -/** - * @brief Opaque handle for memory region obtained from spi_flash_mmap. - */ -typedef uint32_t spi_flash_mmap_handle_t; - -/** - * @brief Map region of flash memory into data or instruction address space - * - * This function allocates sufficient number of 64kB MMU pages and configures - * them to map the requested region of flash memory into the address space. - * It may reuse MMU pages which already provide the required mapping. - * - * As with any allocator, if mmap/munmap are heavily used then the address space - * may become fragmented. To troubleshoot issues with page allocation, use - * spi_flash_mmap_dump() function. - * - * @param src_addr Physical address in flash where requested region starts. - * This address *must* be aligned to 64kB boundary - * (SPI_FLASH_MMU_PAGE_SIZE) - * @param size Size of region to be mapped. This size will be rounded - * up to a 64kB boundary - * @param memory Address space where the region should be mapped (data or instruction) - * @param[out] out_ptr Output, pointer to the mapped memory region - * @param[out] out_handle Output, handle which should be used for spi_flash_munmap call - * - * @return ESP_OK on success, ESP_ERR_NO_MEM if pages can not be allocated - */ -esp_err_t spi_flash_mmap(size_t src_addr, size_t size, spi_flash_mmap_memory_t memory, - const void** out_ptr, spi_flash_mmap_handle_t* out_handle); - -/** - * @brief Map sequences of pages of flash memory into data or instruction address space - * - * This function allocates sufficient number of 64kB MMU pages and configures - * them to map the indicated pages of flash memory contiguously into address space. - * In this respect, it works in a similar way as spi_flash_mmap() but it allows mapping - * a (maybe non-contiguous) set of pages into a contiguous region of memory. - * - * @param pages An array of numbers indicating the 64kB pages in flash to be mapped - * contiguously into memory. These indicate the indexes of the 64kB pages, - * not the byte-size addresses as used in other functions. - * Array must be located in internal memory. - * @param page_count Number of entries in the pages array - * @param memory Address space where the region should be mapped (instruction or data) - * @param[out] out_ptr Output, pointer to the mapped memory region - * @param[out] out_handle Output, handle which should be used for spi_flash_munmap call - * - * @return - * - ESP_OK on success - * - ESP_ERR_NO_MEM if pages can not be allocated - * - ESP_ERR_INVALID_ARG if pagecount is zero or pages array is not in - * internal memory - */ -esp_err_t spi_flash_mmap_pages(const int *pages, size_t page_count, spi_flash_mmap_memory_t memory, - const void** out_ptr, spi_flash_mmap_handle_t* out_handle); - - -/** - * @brief Release region previously obtained using spi_flash_mmap - * - * @note Calling this function will not necessarily unmap memory region. - * Region will only be unmapped when there are no other handles which - * reference this region. In case of partially overlapping regions - * it is possible that memory will be unmapped partially. - * - * @param handle Handle obtained from spi_flash_mmap - */ -void spi_flash_munmap(spi_flash_mmap_handle_t handle); - -/** - * @brief Display information about mapped regions - * - * This function lists handles obtained using spi_flash_mmap, along with range - * of pages allocated to each handle. It also lists all non-zero entries of - * MMU table and corresponding reference counts. - */ -void spi_flash_mmap_dump(); - -/** - * @brief get free pages number which can be mmap - * - * This function will return number of free pages available in mmu table. This could be useful - * before calling actual spi_flash_mmap (maps flash range to DCache or ICache memory) to check - * if there is sufficient space available for mapping. - * - * @param memory memory type of MMU table free page - * - * @return number of free pages which can be mmaped - */ -uint32_t spi_flash_mmap_get_free_pages(spi_flash_mmap_memory_t memory); - - -#define SPI_FLASH_CACHE2PHYS_FAIL UINT32_MAX /* -#include "esp_err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Configuration structure for esp_vfs_spiffs_register - */ -typedef struct { - const char* base_path; /*!< File path prefix associated with the filesystem. */ - const char* partition_label; /*!< Optional, label of SPIFFS partition to use. If set to NULL, first partition with subtype=spiffs will be used. */ - size_t max_files; /*!< Maximum files that could be open at the same time. */ - bool format_if_mount_failed; /*!< If true, it will format the file system if it fails to mount. */ -} esp_vfs_spiffs_conf_t; - -/** - * Register and mount SPIFFS to VFS with given path prefix. - * - * @param conf Pointer to esp_vfs_spiffs_conf_t configuration structure - * - * @return - * - ESP_OK if success - * - ESP_ERR_NO_MEM if objects could not be allocated - * - ESP_ERR_INVALID_STATE if already mounted or partition is encrypted - * - ESP_ERR_NOT_FOUND if partition for SPIFFS was not found - * - ESP_FAIL if mount or format fails - */ -esp_err_t esp_vfs_spiffs_register(const esp_vfs_spiffs_conf_t * conf); - -/** - * Unregister and unmount SPIFFS from VFS - * - * @param partition_label Optional, label of the partition to unregister. - * If not specified, first partition with subtype=spiffs is used. - * - * @return - * - ESP_OK if successful - * - ESP_ERR_INVALID_STATE already unregistered - */ -esp_err_t esp_vfs_spiffs_unregister(const char* partition_label); - -/** - * Check if SPIFFS is mounted - * - * @param partition_label Optional, label of the partition to check. - * If not specified, first partition with subtype=spiffs is used. - * - * @return - * - true if mounted - * - false if not mounted - */ -bool esp_spiffs_mounted(const char* partition_label); - -/** - * Format the SPIFFS partition - * - * @param partition_label Optional, label of the partition to format. - * If not specified, first partition with subtype=spiffs is used. - * @return - * - ESP_OK if successful - * - ESP_FAIL on error - */ -esp_err_t esp_spiffs_format(const char* partition_label); - -/** - * Get information for SPIFFS - * - * @param partition_label Optional, label of the partition to get info for. - * If not specified, first partition with subtype=spiffs is used. - * @param[out] total_bytes Size of the file system - * @param[out] used_bytes Current used bytes in the file system - * - * @return - * - ESP_OK if success - * - ESP_ERR_INVALID_STATE if not mounted - */ -esp_err_t esp_spiffs_info(const char* partition_label, size_t *total_bytes, size_t *used_bytes); - -#ifdef __cplusplus -} -#endif - -#endif /* _ESP_SPIFFS_H_ */ diff --git a/tools/sdk/include/spiffs/spiffs_config.h b/tools/sdk/include/spiffs/spiffs_config.h deleted file mode 100644 index a382ba6f956..00000000000 --- a/tools/sdk/include/spiffs/spiffs_config.h +++ /dev/null @@ -1,316 +0,0 @@ -/* - * spiffs_config.h - * - * Created on: Jul 3, 2013 - * Author: petera - */ - -#ifndef SPIFFS_CONFIG_H_ -#define SPIFFS_CONFIG_H_ - -// ----------- 8< ------------ -// Following includes are for the linux test build of spiffs -// These may/should/must be removed/altered/replaced in your target -#include -#include -#include -#include -#include -#include -#include -#include - -// compile time switches -#define SPIFFS_TAG "SPIFFS" - -// Set generic spiffs debug output call. -#if CONFIG_SPIFFS_DBG -#define SPIFFS_DBG(...) ESP_LOGD(SPIFFS_TAG, __VA_ARGS__) -#else -#define SPIFFS_DBG(...) -#endif -#if CONFIG_SPIFFS_API_DBG -#define SPIFFS_API_DBG(...) ESP_LOGD(SPIFFS_TAG, __VA_ARGS__) -#else -#define SPIFFS_API_DBG(...) -#endif -#if CONFIG_SPIFFS_DBG -#define SPIFFS_GC_DBG(...) ESP_LOGD(SPIFFS_TAG, __VA_ARGS__) -#else -#define SPIFFS_GC_DBG(...) -#endif -#if CONFIG_SPIFFS_CACHE_DBG -#define SPIFFS_CACHE_DBG(...) ESP_LOGD(SPIFFS_TAG, __VA_ARGS__) -#else -#define SPIFFS_CACHE_DBG(...) -#endif -#if CONFIG_SPIFFS_CHECK_DBG -#define SPIFFS_CHECK_DBG(...) ESP_LOGD(SPIFFS_TAG, __VA_ARGS__) -#else -#define SPIFFS_CHECK_DBG(...) -#endif - -// needed types -typedef signed int s32_t; -typedef unsigned int u32_t; -typedef signed short s16_t; -typedef unsigned short u16_t; -typedef signed char s8_t; -typedef unsigned char u8_t; - -struct spiffs_t; -extern void spiffs_api_lock(struct spiffs_t *fs); -extern void spiffs_api_unlock(struct spiffs_t *fs); - -// Defines spiffs debug print formatters -// some general signed number -#define _SPIPRIi "%d" -// address -#define _SPIPRIad "%08x" -// block -#define _SPIPRIbl "%04x" -// page -#define _SPIPRIpg "%04x" -// span index -#define _SPIPRIsp "%04x" -// file descriptor -#define _SPIPRIfd "%d" -// file object id -#define _SPIPRIid "%04x" -// file flags -#define _SPIPRIfl "%02x" - - -// Enable/disable API functions to determine exact number of bytes -// for filedescriptor and cache buffers. Once decided for a configuration, -// this can be disabled to reduce flash. -#define SPIFFS_BUFFER_HELP 0 - -// Enables/disable memory read caching of nucleus file system operations. -// If enabled, memory area must be provided for cache in SPIFFS_mount. -#ifdef CONFIG_SPIFFS_CACHE -#define SPIFFS_CACHE (1) -#else -#define SPIFFS_CACHE (0) -#endif -#if SPIFFS_CACHE -// Enables memory write caching for file descriptors in hydrogen -#ifdef CONFIG_SPIFFS_CACHE_WR -#define SPIFFS_CACHE_WR (1) -#else -#define SPIFFS_CACHE_WR (0) -#endif - -// Enable/disable statistics on caching. Debug/test purpose only. -#ifdef CONFIG_SPIFFS_CACHE_STATS -#define SPIFFS_CACHE_STATS (1) -#else -#define SPIFFS_CACHE_STATS (0) -#endif -#endif - -// Always check header of each accessed page to ensure consistent state. -// If enabled it will increase number of reads, will increase flash. -#ifdef CONFIG_SPIFFS_PAGE_CHECK -#define SPIFFS_PAGE_CHECK (1) -#else -#define SPIFFS_PAGE_CHECK (0) -#endif - -// Define maximum number of gc runs to perform to reach desired free pages. -#define SPIFFS_GC_MAX_RUNS CONFIG_SPIFFS_GC_MAX_RUNS - -// Enable/disable statistics on gc. Debug/test purpose only. -#ifdef CONFIG_SPIFFS_GC_STATS -#define SPIFFS_GC_STATS (1) -#else -#define SPIFFS_GC_STATS (0) -#endif - -// Garbage collecting examines all pages in a block which and sums up -// to a block score. Deleted pages normally gives positive score and -// used pages normally gives a negative score (as these must be moved). -// To have a fair wear-leveling, the erase age is also included in score, -// whose factor normally is the most positive. -// The larger the score, the more likely it is that the block will -// picked for garbage collection. - -// Garbage collecting heuristics - weight used for deleted pages. -#define SPIFFS_GC_HEUR_W_DELET (5) -// Garbage collecting heuristics - weight used for used pages. -#define SPIFFS_GC_HEUR_W_USED (-1) -// Garbage collecting heuristics - weight used for time between -// last erased and erase of this block. -#define SPIFFS_GC_HEUR_W_ERASE_AGE (50) - -// Object name maximum length. Note that this length include the -// zero-termination character, meaning maximum string of characters -// can at most be SPIFFS_OBJ_NAME_LEN - 1. -#define SPIFFS_OBJ_NAME_LEN (CONFIG_SPIFFS_OBJ_NAME_LEN) - -// Maximum length of the metadata associated with an object. -// Setting to non-zero value enables metadata-related API but also -// changes the on-disk format, so the change is not backward-compatible. -// -// Do note: the meta length must never exceed -// logical_page_size - (SPIFFS_OBJ_NAME_LEN + SPIFFS_PAGE_EXTRA_SIZE) -// -// This is derived from following: -// logical_page_size - (SPIFFS_OBJ_NAME_LEN + sizeof(spiffs_page_header) + -// spiffs_object_ix_header fields + at least some LUT entries) -#define SPIFFS_OBJ_META_LEN (CONFIG_SPIFFS_META_LENGTH) -#define SPIFFS_PAGE_EXTRA_SIZE (64) -_Static_assert(SPIFFS_OBJ_META_LEN + SPIFFS_OBJ_NAME_LEN + SPIFFS_PAGE_EXTRA_SIZE - <= CONFIG_SPIFFS_PAGE_SIZE, "SPIFFS_OBJ_META_LEN or SPIFFS_OBJ_NAME_LEN too long"); - -// Size of buffer allocated on stack used when copying data. -// Lower value generates more read/writes. No meaning having it bigger -// than logical page size. -#define SPIFFS_COPY_BUFFER_STACK (256) - -// Enable this to have an identifiable spiffs filesystem. This will look for -// a magic in all sectors to determine if this is a valid spiffs system or -// not on mount point. If not, SPIFFS_format must be called prior to mounting -// again. -#ifdef CONFIG_SPIFFS_USE_MAGIC -#define SPIFFS_USE_MAGIC (1) -#else -#define SPIFFS_USE_MAGIC (0) -#endif - -#if SPIFFS_USE_MAGIC -// Only valid when SPIFFS_USE_MAGIC is enabled. If SPIFFS_USE_MAGIC_LENGTH is -// enabled, the magic will also be dependent on the length of the filesystem. -// For example, a filesystem configured and formatted for 4 megabytes will not -// be accepted for mounting with a configuration defining the filesystem as 2 -// megabytes. -#ifdef CONFIG_SPIFFS_USE_MAGIC_LENGTH -#define SPIFFS_USE_MAGIC_LENGTH (1) -#else -#define SPIFFS_USE_MAGIC_LENGTH (0) -#endif -#endif - -// SPIFFS_LOCK and SPIFFS_UNLOCK protects spiffs from reentrancy on api level -// These should be defined on a multithreaded system - -// define this to enter a mutex if you're running on a multithreaded system -#define SPIFFS_LOCK(fs) spiffs_api_lock(fs) -// define this to exit a mutex if you're running on a multithreaded system -#define SPIFFS_UNLOCK(fs) spiffs_api_unlock(fs) - -// Enable if only one spiffs instance with constant configuration will exist -// on the target. This will reduce calculations, flash and memory accesses. -// Parts of configuration must be defined below instead of at time of mount. -#define SPIFFS_SINGLETON 0 - -// Enable this if your target needs aligned data for index tables -#define SPIFFS_ALIGNED_OBJECT_INDEX_TABLES 0 - -// Enable this if you want the HAL callbacks to be called with the spiffs struct -#define SPIFFS_HAL_CALLBACK_EXTRA 1 - -// Enable this if you want to add an integer offset to all file handles -// (spiffs_file). This is useful if running multiple instances of spiffs on -// same target, in order to recognise to what spiffs instance a file handle -// belongs. -// NB: This adds config field fh_ix_offset in the configuration struct when -// mounting, which must be defined. -#define SPIFFS_FILEHDL_OFFSET 0 - -// Enable this to compile a read only version of spiffs. -// This will reduce binary size of spiffs. All code comprising modification -// of the file system will not be compiled. Some config will be ignored. -// HAL functions for erasing and writing to spi-flash may be null. Cache -// can be disabled for even further binary size reduction (and ram savings). -// Functions modifying the fs will return SPIFFS_ERR_RO_NOT_IMPL. -// If the file system cannot be mounted due to aborted erase operation and -// SPIFFS_USE_MAGIC is enabled, SPIFFS_ERR_RO_ABORTED_OPERATION will be -// returned. -// Might be useful for e.g. bootloaders and such. -#define SPIFFS_READ_ONLY 0 - -// Enable this to add a temporal file cache using the fd buffer. -// The effects of the cache is that SPIFFS_open will find the file faster in -// certain cases. It will make it a lot easier for spiffs to find files -// opened frequently, reducing number of readings from the spi flash for -// finding those files. -// This will grow each fd by 6 bytes. If your files are opened in patterns -// with a degree of temporal locality, the system is optimized. -// Examples can be letting spiffs serve web content, where one file is the css. -// The css is accessed for each html file that is opened, meaning it is -// accessed almost every second time a file is opened. Another example could be -// a log file that is often opened, written, and closed. -// The size of the cache is number of given file descriptors, as it piggybacks -// on the fd update mechanism. The cache lives in the closed file descriptors. -// When closed, the fd know the whereabouts of the file. Instead of forgetting -// this, the temporal cache will keep handling updates to that file even if the -// fd is closed. If the file is opened again, the location of the file is found -// directly. If all available descriptors become opened, all cache memory is -// lost. -#define SPIFFS_TEMPORAL_FD_CACHE 1 - -// Temporal file cache hit score. Each time a file is opened, all cached files -// will lose one point. If the opened file is found in cache, that entry will -// gain SPIFFS_TEMPORAL_CACHE_HIT_SCORE points. One can experiment with this -// value for the specific access patterns of the application. However, it must -// be between 1 (no gain for hitting a cached entry often) and 255. -#define SPIFFS_TEMPORAL_CACHE_HIT_SCORE 4 - -// Enable to be able to map object indices to memory. -// This allows for faster and more deterministic reading if cases of reading -// large files and when changing file offset by seeking around a lot. -// When mapping a file's index, the file system will be scanned for index pages -// and the info will be put in memory provided by user. When reading, the -// memory map can be looked up instead of searching for index pages on the -// medium. This way, user can trade memory against performance. -// Whole, parts of, or future parts not being written yet can be mapped. The -// memory array will be owned by spiffs and updated accordingly during garbage -// collecting or when modifying the indices. The latter is invoked by when the -// file is modified in some way. The index buffer is tied to the file -// descriptor. -#define SPIFFS_IX_MAP 1 - -// Set SPIFFS_TEST_VISUALISATION to non-zero to enable SPIFFS_vis function -// in the api. This function will visualize all filesystem using given printf -// function. -#ifdef CONFIG_SPIFFS_TEST_VISUALISATION -#define SPIFFS_TEST_VISUALISATION 1 -#else -#define SPIFFS_TEST_VISUALISATION 0 -#endif -#if SPIFFS_TEST_VISUALISATION -#ifndef spiffs_printf -#define spiffs_printf(...) ESP_LOGD(SPIFFS_TAG, __VA_ARGS__) -#endif -// spiffs_printf argument for a free page -#define SPIFFS_TEST_VIS_FREE_STR "_" -// spiffs_printf argument for a deleted page -#define SPIFFS_TEST_VIS_DELE_STR "/" -// spiffs_printf argument for an index page for given object id -#define SPIFFS_TEST_VIS_INDX_STR(id) "i" -// spiffs_printf argument for a data page for given object id -#define SPIFFS_TEST_VIS_DATA_STR(id) "d" -#endif - -// Types depending on configuration such as the amount of flash bytes -// given to spiffs file system in total (spiffs_file_system_size), -// the logical block size (log_block_size), and the logical page size -// (log_page_size) - -// Block index type. Make sure the size of this type can hold -// the highest number of all blocks - i.e. spiffs_file_system_size / log_block_size -typedef u16_t spiffs_block_ix; -// Page index type. Make sure the size of this type can hold -// the highest page number of all pages - i.e. spiffs_file_system_size / log_page_size -typedef u16_t spiffs_page_ix; -// Object id type - most significant bit is reserved for index flag. Make sure the -// size of this type can hold the highest object id on a full system, -// i.e. 2 + (spiffs_file_system_size / (2*log_page_size))*2 -typedef u16_t spiffs_obj_id; -// Object span index type. Make sure the size of this type can -// hold the largest possible span index on the system - -// i.e. (spiffs_file_system_size / log_page_size) - 1 -typedef u16_t spiffs_span_ix; - -#endif /* SPIFFS_CONFIG_H_ */ diff --git a/tools/sdk/include/tcp_transport/esp_transport.h b/tools/sdk/include/tcp_transport/esp_transport.h deleted file mode 100644 index e163a010cd9..00000000000 --- a/tools/sdk/include/tcp_transport/esp_transport.h +++ /dev/null @@ -1,304 +0,0 @@ -// 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. - -#ifndef _ESP_TRANSPORT_H_ -#define _ESP_TRANSPORT_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef struct esp_transport_list_t* esp_transport_list_handle_t; -typedef struct esp_transport_item_t* esp_transport_handle_t; - -typedef int (*connect_func)(esp_transport_handle_t t, const char *host, int port, int timeout_ms); -typedef int (*io_func)(esp_transport_handle_t t, const char *buffer, int len, int timeout_ms); -typedef int (*io_read_func)(esp_transport_handle_t t, char *buffer, int len, int timeout_ms); -typedef int (*trans_func)(esp_transport_handle_t t); -typedef int (*poll_func)(esp_transport_handle_t t, int timeout_ms); -typedef int (*connect_async_func)(esp_transport_handle_t t, const char *host, int port, int timeout_ms); -typedef esp_transport_handle_t (*payload_transfer_func)(esp_transport_handle_t); - -/** - * @brief Create transport list - * - * @return A handle can hold all transports - */ -esp_transport_list_handle_t esp_transport_list_init(); - -/** - * @brief Cleanup and free all transports, include itself, - * this function will invoke esp_transport_destroy of every transport have added this the list - * - * @param[in] list The list - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_transport_list_destroy(esp_transport_list_handle_t list); - -/** - * @brief Add a transport to the list, and define a scheme to indentify this transport in the list - * - * @param[in] list The list - * @param[in] t The Transport - * @param[in] scheme The scheme - * - * @return - * - ESP_OK - */ -esp_err_t esp_transport_list_add(esp_transport_list_handle_t list, esp_transport_handle_t t, const char *scheme); - -/** - * @brief This function will remove all transport from the list, - * invoke esp_transport_destroy of every transport have added this the list - * - * @param[in] list The list - * - * @return - * - ESP_OK - * - ESP_ERR_INVALID_ARG - */ -esp_err_t esp_transport_list_clean(esp_transport_list_handle_t list); - -/** - * @brief Get the transport by scheme, which has been defined when calling function `esp_transport_list_add` - * - * @param[in] list The list - * @param[in] tag The tag - * - * @return The transport handle - */ -esp_transport_handle_t esp_transport_list_get_transport(esp_transport_list_handle_t list, const char *scheme); - -/** - * @brief Initialize a transport handle object - * - * @return The transport handle - */ -esp_transport_handle_t esp_transport_init(); - -/** - * @brief Cleanup and free memory the transport - * - * @param[in] t The transport handle - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_transport_destroy(esp_transport_handle_t t); - -/** - * @brief Get default port number used by this transport - * - * @param[in] t The transport handle - * - * @return the port number - */ -int esp_transport_get_default_port(esp_transport_handle_t t); - -/** - * @brief Set default port number that can be used by this transport - * - * @param[in] t The transport handle - * @param[in] port The port number - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_transport_set_default_port(esp_transport_handle_t t, int port); - -/** - * @brief Transport connection function, to make a connection to server - * - * @param t The transport handle - * @param[in] host Hostname - * @param[in] port Port - * @param[in] timeout_ms The timeout milliseconds - * - * @return - * - socket for will use by this transport - * - (-1) if there are any errors, should check errno - */ -int esp_transport_connect(esp_transport_handle_t t, const char *host, int port, int timeout_ms); - -/** - * @brief Non-blocking transport connection function, to make a connection to server - * - * @param t The transport handle - * @param[in] host Hostname - * @param[in] port Port - * @param[in] timeout_ms The timeout milliseconds - * - * @return - * - socket for will use by this transport - * - (-1) if there are any errors, should check errno - */ -int esp_transport_connect_async(esp_transport_handle_t t, const char *host, int port, int timeout_ms); - -/** - * @brief Transport read function - * - * @param t The transport handle - * @param buffer The buffer - * @param[in] len The length - * @param[in] timeout_ms The timeout milliseconds - * - * @return - * - Number of bytes was read - * - (-1) if there are any errors, should check errno - */ -int esp_transport_read(esp_transport_handle_t t, char *buffer, int len, int timeout_ms); - -/** - * @brief Poll the transport until readable or timeout - * - * @param[in] t The transport handle - * @param[in] timeout_ms The timeout milliseconds - * - * @return - * - 0 Timeout - * - (-1) If there are any errors, should check errno - * - other The transport can read - */ -int esp_transport_poll_read(esp_transport_handle_t t, int timeout_ms); - -/** - * @brief Transport write function - * - * @param t The transport handle - * @param buffer The buffer - * @param[in] len The length - * @param[in] timeout_ms The timeout milliseconds - * - * @return - * - Number of bytes was written - * - (-1) if there are any errors, should check errno - */ -int esp_transport_write(esp_transport_handle_t t, const char *buffer, int len, int timeout_ms); - -/** - * @brief Poll the transport until writeable or timeout - * - * @param[in] t The transport handle - * @param[in] timeout_ms The timeout milliseconds - * - * @return - * - 0 Timeout - * - (-1) If there are any errors, should check errno - * - other The transport can write - */ -int esp_transport_poll_write(esp_transport_handle_t t, int timeout_ms); - -/** - * @brief Transport close - * - * @param t The transport handle - * - * @return - * - 0 if ok - * - (-1) if there are any errors, should check errno - */ -int esp_transport_close(esp_transport_handle_t t); - -/** - * @brief Get user data context of this transport - * - * @param[in] t The transport handle - * - * @return The user data context - */ -void *esp_transport_get_context_data(esp_transport_handle_t t); - -/** - * @brief Get transport handle of underlying protocol - * which can access this protocol payload directly - * (used for receiving longer msg multiple times) - * - * @param[in] t The transport handle - * - * @return Payload transport handle - */ -esp_transport_handle_t esp_transport_get_payload_transport_handle(esp_transport_handle_t t); - -/** - * @brief Set the user context data for this transport - * - * @param[in] t The transport handle - * @param data The user data context - * - * @return - * - ESP_OK - */ -esp_err_t esp_transport_set_context_data(esp_transport_handle_t t, void *data); - -/** - * @brief Set transport functions for the transport handle - * - * @param[in] t The transport handle - * @param[in] _connect The connect function pointer - * @param[in] _read The read function pointer - * @param[in] _write The write function pointer - * @param[in] _close The close function pointer - * @param[in] _poll_read The poll read function pointer - * @param[in] _poll_write The poll write function pointer - * @param[in] _destroy The destroy function pointer - * - * @return - * - ESP_OK - */ -esp_err_t esp_transport_set_func(esp_transport_handle_t t, - connect_func _connect, - io_read_func _read, - io_func _write, - trans_func _close, - poll_func _poll_read, - poll_func _poll_write, - trans_func _destroy); - - -/** - * @brief Set transport functions for the transport handle - * - * @param[in] t The transport handle - * @param[in] _connect_async_func The connect_async function pointer - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_transport_set_async_connect_func(esp_transport_handle_t t, connect_async_func _connect_async_func); - -/** - * @brief Set parent transport function to the handle - * - * @param[in] t The transport handle - * @param[in] _parent_transport The underlying transport getter pointer - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t esp_transport_set_parent_transport_func(esp_transport_handle_t t, payload_transfer_func _parent_transport); - -#ifdef __cplusplus -} -#endif -#endif /* _ESP_TRANSPORT_ */ diff --git a/tools/sdk/include/tcp_transport/esp_transport_ssl.h b/tools/sdk/include/tcp_transport/esp_transport_ssl.h deleted file mode 100644 index c42fd09353e..00000000000 --- a/tools/sdk/include/tcp_transport/esp_transport_ssl.h +++ /dev/null @@ -1,76 +0,0 @@ -// 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. - -#ifndef _ESP_TRANSPORT_SSL_H_ -#define _ESP_TRANSPORT_SSL_H_ - -#include "esp_transport.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -/** - * @brief Create new SSL transport, the transport handle must be release esp_transport_destroy callback - * - * @return the allocated esp_transport_handle_t, or NULL if the handle can not be allocated - */ -esp_transport_handle_t esp_transport_ssl_init(); - -/** - * @brief Set SSL certificate data (as PEM format). - * Note that, this function stores the pointer to data, rather than making a copy. - * So this data must remain valid until after the connection is cleaned up - * - * @param t ssl transport - * @param[in] data The pem data - * @param[in] len The length - */ -void esp_transport_ssl_set_cert_data(esp_transport_handle_t t, const char *data, int len); - -/** - * @brief Enable global CA store for SSL connection - * - * @param t ssl transport - */ -void esp_transport_ssl_enable_global_ca_store(esp_transport_handle_t t); - -/** - * @brief Set SSL client certificate data for mutual authentication (as PEM format). - * Note that, this function stores the pointer to data, rather than making a copy. - * So this data must remain valid until after the connection is cleaned up - * - * @param t ssl transport - * @param[in] data The pem data - * @param[in] len The length - */ -void esp_transport_ssl_set_client_cert_data(esp_transport_handle_t t, const char *data, int len); - -/** - * @brief Set SSL client key data for mutual authentication (as PEM format). - * Note that, this function stores the pointer to data, rather than making a copy. - * So this data must remain valid until after the connection is cleaned up - * - * @param t ssl transport - * @param[in] data The pem data - * @param[in] len The length - */ -void esp_transport_ssl_set_client_key_data(esp_transport_handle_t t, const char *data, int len); - -#ifdef __cplusplus -} -#endif -#endif /* _ESP_TRANSPORT_SSL_H_ */ - diff --git a/tools/sdk/include/tcp_transport/esp_transport_tcp.h b/tools/sdk/include/tcp_transport/esp_transport_tcp.h deleted file mode 100644 index 57ad453309f..00000000000 --- a/tools/sdk/include/tcp_transport/esp_transport_tcp.h +++ /dev/null @@ -1,36 +0,0 @@ -// 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. - -#ifndef _ESP_TRANSPORT_TCP_H_ -#define _ESP_TRANSPORT_TCP_H_ - -#include "esp_transport.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Create TCP transport, the transport handle must be release esp_transport_destroy callback - * - * @return the allocated esp_transport_handle_t, or NULL if the handle can not be allocated - */ -esp_transport_handle_t esp_transport_tcp_init(); - - -#ifdef __cplusplus -} -#endif - -#endif /* _ESP_TRANSPORT_TCP_H_ */ diff --git a/tools/sdk/include/tcp_transport/esp_transport_utils.h b/tools/sdk/include/tcp_transport/esp_transport_utils.h deleted file mode 100644 index 405b4f6b46e..00000000000 --- a/tools/sdk/include/tcp_transport/esp_transport_utils.h +++ /dev/null @@ -1,40 +0,0 @@ -// 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. - -#ifndef _ESP_TRANSPORT_UTILS_H_ -#define _ESP_TRANSPORT_UTILS_H_ -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Convert milliseconds to timeval struct - * - * @param[in] timeout_ms The timeout milliseconds - * @param[out] tv Timeval struct - */ -void esp_transport_utils_ms_to_timeval(int timeout_ms, struct timeval *tv); - - -#define ESP_TRANSPORT_MEM_CHECK(TAG, a, action) if (!(a)) { \ - ESP_LOGE(TAG,"%s:%d (%s): %s", __FILE__, __LINE__, __FUNCTION__, "Memory exhausted"); \ - action; \ - } - -#ifdef __cplusplus -} -#endif -#endif /* _ESP_TRANSPORT_UTILS_H_ */ \ No newline at end of file diff --git a/tools/sdk/include/tcp_transport/esp_transport_ws.h b/tools/sdk/include/tcp_transport/esp_transport_ws.h deleted file mode 100644 index 582c5c7da28..00000000000 --- a/tools/sdk/include/tcp_transport/esp_transport_ws.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This file is subject to the terms and conditions defined in - * file 'LICENSE', which is part of this source code package. - * Tuan PM - */ - -#ifndef _ESP_TRANSPORT_WS_H_ -#define _ESP_TRANSPORT_WS_H_ - -#include "esp_transport.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -/** - * @brief Create web socket transport - * - * @return - * - transport - * - NULL - */ -esp_transport_handle_t esp_transport_ws_init(esp_transport_handle_t parent_handle); - -void esp_transport_ws_set_path(esp_transport_handle_t t, const char *path); - - - -#ifdef __cplusplus -} -#endif - -#endif /* _ESP_TRANSPORT_WS_H_ */ diff --git a/tools/sdk/include/tcpip_adapter/tcpip_adapter.h b/tools/sdk/include/tcpip_adapter/tcpip_adapter.h deleted file mode 100644 index 7d9e4ad8cd1..00000000000 --- a/tools/sdk/include/tcpip_adapter/tcpip_adapter.h +++ /dev/null @@ -1,636 +0,0 @@ -// 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. - -#ifndef _TCPIP_ADAPTER_H_ -#define _TCPIP_ADAPTER_H_ - -/** - * @brief TCPIP adapter library - * - * The aim of this adapter is to provide an abstract layer upon TCPIP stack. - * With this layer, switch to other TCPIP stack is possible and easy in esp-idf. - * - * If users want to use other TCPIP stack, all those functions should be implemented - * by using the specific APIs of that stack. The macros in CONFIG_TCPIP_LWIP should be - * re-defined. - * - * tcpip_adapter_init should be called in the start of app_main for only once. - * - * Currently most adapter APIs are called in event_default_handlers.c. - * - * We recommend users only use set/get IP APIs, DHCP server/client APIs, - * get free station list APIs in application side. Other APIs are used in esp-idf internal, - * otherwise the state maybe wrong. - * - * TODO: ipv6 support will be added - */ - -#include -#include "rom/queue.h" -#include "esp_wifi_types.h" -#include "sdkconfig.h" - -#if CONFIG_TCPIP_LWIP -#include "lwip/ip_addr.h" -#include "dhcpserver/dhcpserver.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define IP2STR(ipaddr) ip4_addr1_16(ipaddr), \ - ip4_addr2_16(ipaddr), \ - ip4_addr3_16(ipaddr), \ - ip4_addr4_16(ipaddr) - -#define IPSTR "%d.%d.%d.%d" - -#define IPV62STR(ipaddr) IP6_ADDR_BLOCK1(&(ipaddr)), \ - IP6_ADDR_BLOCK2(&(ipaddr)), \ - IP6_ADDR_BLOCK3(&(ipaddr)), \ - IP6_ADDR_BLOCK4(&(ipaddr)), \ - IP6_ADDR_BLOCK5(&(ipaddr)), \ - IP6_ADDR_BLOCK6(&(ipaddr)), \ - IP6_ADDR_BLOCK7(&(ipaddr)), \ - IP6_ADDR_BLOCK8(&(ipaddr)) - -#define IPV6STR "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x" - -typedef struct { - ip4_addr_t ip; - ip4_addr_t netmask; - ip4_addr_t gw; -} tcpip_adapter_ip_info_t; - -typedef struct { - ip6_addr_t ip; -} tcpip_adapter_ip6_info_t; - -typedef dhcps_lease_t tcpip_adapter_dhcps_lease_t; - -typedef struct { - uint8_t mac[6]; - ip4_addr_t ip; -} tcpip_adapter_sta_info_t; - -typedef struct { - tcpip_adapter_sta_info_t sta[ESP_WIFI_MAX_CONN_NUM]; - int num; -} tcpip_adapter_sta_list_t; - -#endif - -#define ESP_ERR_TCPIP_ADAPTER_BASE 0x5000 -#define ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS ESP_ERR_TCPIP_ADAPTER_BASE + 0x01 -#define ESP_ERR_TCPIP_ADAPTER_IF_NOT_READY ESP_ERR_TCPIP_ADAPTER_BASE + 0x02 -#define ESP_ERR_TCPIP_ADAPTER_DHCPC_START_FAILED ESP_ERR_TCPIP_ADAPTER_BASE + 0x03 -#define ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STARTED ESP_ERR_TCPIP_ADAPTER_BASE + 0x04 -#define ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STOPPED ESP_ERR_TCPIP_ADAPTER_BASE + 0x05 -#define ESP_ERR_TCPIP_ADAPTER_NO_MEM ESP_ERR_TCPIP_ADAPTER_BASE + 0x06 -#define ESP_ERR_TCPIP_ADAPTER_DHCP_NOT_STOPPED ESP_ERR_TCPIP_ADAPTER_BASE + 0x07 - -typedef enum { - TCPIP_ADAPTER_IF_STA = 0, /**< ESP32 station interface */ - TCPIP_ADAPTER_IF_AP, /**< ESP32 soft-AP interface */ - TCPIP_ADAPTER_IF_ETH, /**< ESP32 ethernet interface */ - TCPIP_ADAPTER_IF_MAX -} tcpip_adapter_if_t; - -/*type of DNS server*/ -typedef enum { - TCPIP_ADAPTER_DNS_MAIN= 0, /**DNS main server address*/ - TCPIP_ADAPTER_DNS_BACKUP, /**DNS backup server address,for STA only,support soft-AP in future*/ - TCPIP_ADAPTER_DNS_FALLBACK, /**DNS fallback server address,for STA only*/ - TCPIP_ADAPTER_DNS_MAX /**Max DNS */ -} tcpip_adapter_dns_type_t; - -/*info of DNS server*/ -typedef struct { - ip_addr_t ip; -} tcpip_adapter_dns_info_t; - -/* status of DHCP client or DHCP server */ -typedef enum { - TCPIP_ADAPTER_DHCP_INIT = 0, /**< DHCP client/server in initial state */ - TCPIP_ADAPTER_DHCP_STARTED, /**< DHCP client/server already been started */ - TCPIP_ADAPTER_DHCP_STOPPED, /**< DHCP client/server already been stopped */ - TCPIP_ADAPTER_DHCP_STATUS_MAX -} tcpip_adapter_dhcp_status_t; - -/* set the option mode for DHCP client or DHCP server */ -typedef enum{ - TCPIP_ADAPTER_OP_START = 0, - TCPIP_ADAPTER_OP_SET, /**< set option mode */ - TCPIP_ADAPTER_OP_GET, /**< get option mode */ - TCPIP_ADAPTER_OP_MAX -} tcpip_adapter_option_mode_t; - -typedef enum{ - TCPIP_ADAPTER_DOMAIN_NAME_SERVER = 6, /**< domain name server */ - TCPIP_ADAPTER_ROUTER_SOLICITATION_ADDRESS = 32, /**< solicitation router address */ - TCPIP_ADAPTER_REQUESTED_IP_ADDRESS = 50, /**< request IP address pool */ - TCPIP_ADAPTER_IP_ADDRESS_LEASE_TIME = 51, /**< request IP address lease time */ - TCPIP_ADAPTER_IP_REQUEST_RETRY_TIME = 52, /**< request IP address retry counter */ -} tcpip_adapter_option_id_t; - -struct tcpip_adapter_api_msg_s; -typedef int (*tcpip_adapter_api_fn)(struct tcpip_adapter_api_msg_s *msg); -typedef struct tcpip_adapter_api_msg_s { - int type; /**< The first field MUST be int */ - int ret; - tcpip_adapter_api_fn api_fn; - tcpip_adapter_if_t tcpip_if; - tcpip_adapter_ip_info_t *ip_info; - uint8_t *mac; - void *data; -} tcpip_adapter_api_msg_t; - -typedef struct tcpip_adapter_dns_param_s { - tcpip_adapter_dns_type_t dns_type; - tcpip_adapter_dns_info_t *dns_info; -} tcpip_adapter_dns_param_t; - -#define TCPIP_ADAPTER_TRHEAD_SAFE 1 -#define TCPIP_ADAPTER_IPC_LOCAL 0 -#define TCPIP_ADAPTER_IPC_REMOTE 1 - -#define TCPIP_ADAPTER_IPC_CALL(_if, _mac, _ip, _data, _fn) do {\ - tcpip_adapter_api_msg_t msg;\ - if (tcpip_inited == false) {\ - ESP_LOGE(TAG, "tcpip_adapter is not initialized!");\ - abort();\ - }\ - memset(&msg, 0, sizeof(msg));\ - msg.tcpip_if = (_if);\ - msg.mac = (uint8_t*)(_mac);\ - msg.ip_info = (tcpip_adapter_ip_info_t*)(_ip);\ - msg.data = (void*)(_data);\ - msg.api_fn = (_fn);\ - if (TCPIP_ADAPTER_IPC_REMOTE == tcpip_adapter_ipc_check(&msg)) {\ - ESP_LOGV(TAG, "check: remote, if=%d fn=%p\n", (_if), (_fn));\ - return msg.ret;\ - } else {\ - ESP_LOGV(TAG, "check: local, if=%d fn=%p\n", (_if), (_fn));\ - }\ -}while(0) - -typedef struct tcpip_adatper_ip_lost_timer_s { - bool timer_running; -} tcpip_adapter_ip_lost_timer_t; - -/** - * @brief Initialize tcpip adapter - * - * This will initialize TCPIP stack inside. - */ -void tcpip_adapter_init(void); - -/** - * @brief Start the ethernet interface with specific MAC and IP - * - * @param[in] mac: set MAC address of this interface - * @param[in] ip_info: set IP address of this interface - * - * @return ESP_OK - * ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS - * ESP_ERR_NO_MEM - */ -esp_err_t tcpip_adapter_eth_start(uint8_t *mac, tcpip_adapter_ip_info_t *ip_info); - -/** - * @brief Start the Wi-Fi station interface with specific MAC and IP - * - * Station interface will be initialized, connect WiFi stack with TCPIP stack. - * - * @param[in] mac: set MAC address of this interface - * @param[in] ip_info: set IP address of this interface - * - * @return ESP_OK - * ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS - * ESP_ERR_NO_MEM - */ -esp_err_t tcpip_adapter_sta_start(uint8_t *mac, tcpip_adapter_ip_info_t *ip_info); - -/** - * @brief Start the Wi-Fi AP interface with specific MAC and IP - * - * softAP interface will be initialized, connect WiFi stack with TCPIP stack. - * - * DHCP server will be started automatically. - * - * @param[in] mac: set MAC address of this interface - * @param[in] ip_info: set IP address of this interface - * - * @return ESP_OK - * ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS - * ESP_ERR_NO_MEM - */ -esp_err_t tcpip_adapter_ap_start(uint8_t *mac, tcpip_adapter_ip_info_t *ip_info); - -/** - * @brief Stop an interface - * - * The interface will be cleanup in this API, if DHCP server/client are started, will be stopped. - * - * @param[in] tcpip_if: the interface which will be started - * - * @return ESP_OK - * ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS - * ESP_ERR_TCPIP_ADAPTER_IF_NOT_READY - */ -esp_err_t tcpip_adapter_stop(tcpip_adapter_if_t tcpip_if); - -/** - * @brief Bring up an interface - * - * Only station interface need to be brought up, since station interface will be shut down when disconnect. - * - * @param[in] tcpip_if: the interface which will be up - * - * @return ESP_OK - * ESP_ERR_TCPIP_ADAPTER_IF_NOT_READY - */ -esp_err_t tcpip_adapter_up(tcpip_adapter_if_t tcpip_if); - -/** - * @brief Shut down an interface - * - * Only station interface need to be shut down, since station interface will be brought up when connect. - * - * @param[in] tcpip_if: the interface which will be down - * - * @return ESP_OK - * ESP_ERR_TCPIP_ADAPTER_IF_NOT_READY - */ -esp_err_t tcpip_adapter_down(tcpip_adapter_if_t tcpip_if); - -/** - * @brief Get interface's IP information - * - * There has an IP information copy in adapter library, if interface is up, get IP information from - * interface, otherwise get from copy. - * - * @param[in] tcpip_if: the interface which we want to get IP information - * @param[out] ip_info: If successful, IP information will be returned in this argument. - * - * @return ESP_OK - * ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS - */ -esp_err_t tcpip_adapter_get_ip_info(tcpip_adapter_if_t tcpip_if, tcpip_adapter_ip_info_t *ip_info); - -/** - * @brief Set interface's IP information - * - * There has an IP information copy in adapter library, if interface is up, also set interface's IP. - * DHCP client/server should be stopped before set new IP information. - * - * This function is mainly used for setting static IP. - * - * @param[in] tcpip_if: the interface which we want to set IP information - * @param[in] ip_info: store the IP information which needs to be set to specified interface - * - * @return ESP_OK - * ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS - */ -esp_err_t tcpip_adapter_set_ip_info(tcpip_adapter_if_t tcpip_if, tcpip_adapter_ip_info_t *ip_info); - -/** - * @brief Set DNS Server's information - * - * There has an DNS Server information copy in adapter library, set DNS Server for appointed interface and type. - * - * 1.In station mode, if dhcp client is enabled, then only the fallback DNS server can be set(TCPIP_ADAPTER_DNS_FALLBACK). - * Fallback DNS server is only used if no DNS servers are set via DHCP. - * If dhcp client is disabled, then need to set main/backup dns server(TCPIP_ADAPTER_DNS_MAIN, TCPIP_ADAPTER_DNS_BACKUP). - * - * 2.In soft-AP mode, the DNS Server's main dns server offered to the station is the IP address of soft-AP, - * if the application don't want to use the IP address of soft-AP, they can set the main dns server. - * - * This function is mainly used for setting static or Fallback DNS Server. - * - * @param[in] tcpip_if: the interface which we want to set DNS Server information - * @param[in] type: the type of DNS Server,including TCPIP_ADAPTER_DNS_MAIN, TCPIP_ADAPTER_DNS_BACKUP, TCPIP_ADAPTER_DNS_FALLBACK - * @param[in] dns: the DNS Server address to be set - * - * @return - * - ESP_OK on success - * - ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS invalid params - */ -esp_err_t tcpip_adapter_set_dns_info(tcpip_adapter_if_t tcpip_if, tcpip_adapter_dns_type_t type, tcpip_adapter_dns_info_t *dns); - -/** - * @brief Get DNS Server's information - * - * When set the DNS Server information successfully, can get the DNS Server's information via the appointed tcpip_if and type - * - * This function is mainly used for getting DNS Server information. - * - * @param[in] tcpip_if: the interface which we want to get DNS Server information - * @param[in] type: the type of DNS Server,including TCPIP_ADAPTER_DNS_MAIN, TCPIP_ADAPTER_DNS_BACKUP, TCPIP_ADAPTER_DNS_FALLBACK - * @param[in] dns: the DNS Server address to be get - * - * @return - * - ESP_OK on success - * - ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS invalid params - */ -esp_err_t tcpip_adapter_get_dns_info(tcpip_adapter_if_t tcpip_if, tcpip_adapter_dns_type_t type, tcpip_adapter_dns_info_t *dns); - -/** - * @brief Get interface's old IP information - * - * When the interface successfully gets a valid IP from DHCP server or static configured, a copy of - * the IP information is set to the old IP information. When IP lost timer expires, the old IP - * information is reset to 0. - * - * @param[in] tcpip_if: the interface which we want to get old IP information - * @param[out] ip_info: If successful, IP information will be returned in this argument. - * - * @return ESP_OK - * ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS - */ -esp_err_t tcpip_adapter_get_old_ip_info(tcpip_adapter_if_t tcpip_if, tcpip_adapter_ip_info_t *ip_info); - -/** - * @brief Set interface's old IP information - * - * When the interface successfully gets a valid IP from DHCP server or static configured, a copy of - * the IP information is set to the old IP information. When IP lost timer expires, the old IP - * information is reset to 0. - * - * @param[in] tcpip_if: the interface which we want to set old IP information - * @param[in] ip_info: store the IP information which needs to be set to specified interface - * - * @return ESP_OK - * ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS - */ -esp_err_t tcpip_adapter_set_old_ip_info(tcpip_adapter_if_t tcpip_if, tcpip_adapter_ip_info_t *ip_info); - - -/** - * @brief create interface's linklocal IPv6 information - * - * @note this function will create a linklocal IPv6 address about input interface, - * if this address status changed to preferred, will call event call back , - * notify user linklocal IPv6 address has been verified - * - * @param[in] tcpip_if: the interface which we want to set IP information - * - * - * @return ESP_OK - * ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS - */ -esp_err_t tcpip_adapter_create_ip6_linklocal(tcpip_adapter_if_t tcpip_if); - -/** - * @brief get interface's linkloacl IPv6 information - * - * There has an IPv6 information copy in adapter library, if interface is up,and IPv6 info - * is preferred,it will get IPv6 linklocal IP successfully - * - * @param[in] tcpip_if: the interface which we want to set IP information - * @param[in] if_ip6: If successful, IPv6 information will be returned in this argument. - * - * @return ESP_OK - * ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS - */ -esp_err_t tcpip_adapter_get_ip6_linklocal(tcpip_adapter_if_t tcpip_if, ip6_addr_t *if_ip6); - -#if 0 -esp_err_t tcpip_adapter_get_mac(tcpip_adapter_if_t tcpip_if, uint8_t *mac); - -esp_err_t tcpip_adapter_set_mac(tcpip_adapter_if_t tcpip_if, uint8_t *mac); -#endif - -/** - * @brief Get DHCP server's status - * - * @param[in] tcpip_if: the interface which we will get status of DHCP server - * @param[out] status: If successful, the status of DHCP server will be return in this argument. - * - * @return ESP_OK - */ -esp_err_t tcpip_adapter_dhcps_get_status(tcpip_adapter_if_t tcpip_if, tcpip_adapter_dhcp_status_t *status); - -/** - * @brief Set or Get DHCP server's option - * - * @param[in] opt_op: option operate type, 1 for SET, 2 for GET. - * @param[in] opt_id: option index, 32 for ROUTER, 50 for IP POLL, 51 for LEASE TIME, 52 for REQUEST TIME - * @param[in] opt_val: option parameter - * @param[in] opt_len: option length - * - * @return ESP_OK - * ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS - * ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STOPPED - * ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STARTED - */ -esp_err_t tcpip_adapter_dhcps_option(tcpip_adapter_option_mode_t opt_op, tcpip_adapter_option_id_t opt_id, void *opt_val, uint32_t opt_len); - -/** - * @brief Start DHCP server - * - * @note Currently DHCP server is bind to softAP interface. - * - * @param[in] tcpip_if: the interface which we will start DHCP server - * - * @return ESP_OK - * ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS - * ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STARTED - */ -esp_err_t tcpip_adapter_dhcps_start(tcpip_adapter_if_t tcpip_if); - -/** - * @brief Stop DHCP server - * - * @note Currently DHCP server is bind to softAP interface. - * - * @param[in] tcpip_if: the interface which we will stop DHCP server - * - * @return ESP_OK - * ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS - * ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STOPED - * ESP_ERR_TCPIP_ADAPTER_IF_NOT_READY - */ -esp_err_t tcpip_adapter_dhcps_stop(tcpip_adapter_if_t tcpip_if); - -/** - * @brief Get DHCP client status - * - * @param[in] tcpip_if: the interface which we will get status of DHCP client - * @param[out] status: If successful, the status of DHCP client will be return in this argument. - * - * @return ESP_OK - */ -esp_err_t tcpip_adapter_dhcpc_get_status(tcpip_adapter_if_t tcpip_if, tcpip_adapter_dhcp_status_t *status); - -/** - * @brief Set or Get DHCP client's option - * - * @note This function is not implement now. - * - * @param[in] opt_op: option operate type, 1 for SET, 2 for GET. - * @param[in] opt_id: option index, 32 for ROUTER, 50 for IP POLL, 51 for LEASE TIME, 52 for REQUEST TIME - * @param[in] opt_val: option parameter - * @param[in] opt_len: option length - * - * @return ESP_OK - */ -esp_err_t tcpip_adapter_dhcpc_option(tcpip_adapter_option_mode_t opt_op, tcpip_adapter_option_id_t opt_id, void *opt_val, uint32_t opt_len); - -/** - * @brief Start DHCP client - * - * @note Currently DHCP client is bind to station interface. - * - * @param[in] tcpip_if: the interface which we will start DHCP client - * - * @return ESP_OK - * ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS - * ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STARTED - * ESP_ERR_TCPIP_ADAPTER_DHCPC_START_FAILED - */ -esp_err_t tcpip_adapter_dhcpc_start(tcpip_adapter_if_t tcpip_if); - -/** - * @brief Stop DHCP client - * - * @note Currently DHCP client is bind to station interface. - * - * @param[in] tcpip_if: the interface which we will stop DHCP client - * - * @return ESP_OK - * ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS - * ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STOPED - * ESP_ERR_TCPIP_ADAPTER_IF_NOT_READY - */ -esp_err_t tcpip_adapter_dhcpc_stop(tcpip_adapter_if_t tcpip_if); - -/** - * @brief Get data from ethernet interface - * - * This function should be installed by esp_eth_init, so Ethernet packets will be forward to TCPIP stack. - * - * @param[in] void *buffer: the received data point - * @param[in] uint16_t len: the received data length - * @param[in] void *eb: parameter - * - * @return ESP_OK - */ -esp_err_t tcpip_adapter_eth_input(void *buffer, uint16_t len, void *eb); - -/** - * @brief Get data from station interface - * - * This function should be installed by esp_wifi_reg_rxcb, so WiFi packets will be forward to TCPIP stack. - * - * @param[in] void *buffer: the received data point - * @param[in] uint16_t len: the received data length - * @param[in] void *eb: parameter - * - * @return ESP_OK - */ -esp_err_t tcpip_adapter_sta_input(void *buffer, uint16_t len, void *eb); - -/** - * @brief Get data from softAP interface - * - * This function should be installed by esp_wifi_reg_rxcb, so WiFi packets will be forward to TCPIP stack. - * - * @param[in] void *buffer: the received data point - * @param[in] uint16_t len: the received data length - * @param[in] void *eb: parameter - * - * @return ESP_OK - */ -esp_err_t tcpip_adapter_ap_input(void *buffer, uint16_t len, void *eb); - -/** - * @brief Get WiFi interface index - * - * Get WiFi interface from TCPIP interface struct pointer. - * - * @param[in] void *dev: adapter interface - * - * @return ESP_IF_WIFI_STA - * ESP_IF_WIFI_AP - * ESP_IF_ETH - * ESP_IF_MAX - */ -esp_interface_t tcpip_adapter_get_esp_if(void *dev); - -/** - * @brief Get the station information list - * - * @param[in] wifi_sta_list_t *wifi_sta_list: station list info - * @param[out] tcpip_adapter_sta_list_t *tcpip_sta_list: station list info - * - * @return ESP_OK - * ESP_ERR_TCPIP_ADAPTER_NO_MEM - * ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS - */ -esp_err_t tcpip_adapter_get_sta_list(wifi_sta_list_t *wifi_sta_list, tcpip_adapter_sta_list_t *tcpip_sta_list); - -#define TCPIP_HOSTNAME_MAX_SIZE 32 -/** - * @brief Set the hostname to the interface - * - * @param[in] tcpip_if: the interface which we will set the hostname - * @param[in] hostname: the host name for set the interface, the max length of hostname is 32 bytes - * - * @return ESP_OK:success - * ESP_ERR_TCPIP_ADAPTER_IF_NOT_READY:interface status error - * ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS:parameter error - */ -esp_err_t tcpip_adapter_set_hostname(tcpip_adapter_if_t tcpip_if, const char *hostname); - -/** - * @brief Get the hostname from the interface - * - * @param[in] tcpip_if: the interface which we will get the hostname - * @param[in] hostname: the host name from the interface - * - * @return ESP_OK:success - * ESP_ERR_TCPIP_ADAPTER_IF_NOT_READY:interface status error - * ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS:parameter error - */ -esp_err_t tcpip_adapter_get_hostname(tcpip_adapter_if_t tcpip_if, const char **hostname); - -/** - * @brief Get the LwIP netif* that is assigned to the interface - * - * @param[in] tcpip_if: the interface which we will get the hostname - * @param[out] void ** netif: pointer to fill the resulting interface - * - * @return ESP_OK:success - * ESP_ERR_TCPIP_ADAPTER_IF_NOT_READY:interface status error - * ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS:parameter error - */ -esp_err_t tcpip_adapter_get_netif(tcpip_adapter_if_t tcpip_if, void ** netif); - -/** - * @brief Test if supplied interface is up or down - * - * @param[in] tcpip_if: the interface which we will get the hostname - * - * @return true: tcpip_if is UP - * false: tcpip_if id DOWN - */ -bool tcpip_adapter_is_netif_up(tcpip_adapter_if_t tcpip_if); - -#ifdef __cplusplus -} -#endif - -#endif /* _TCPIP_ADAPTER_H_ */ - diff --git a/tools/sdk/include/ulp/esp32/ulp.h b/tools/sdk/include/ulp/esp32/ulp.h deleted file mode 100644 index 6960ac97d84..00000000000 --- a/tools/sdk/include/ulp/esp32/ulp.h +++ /dev/null @@ -1,917 +0,0 @@ -// Copyright 2016-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. - -#pragma once -#include -#include -#include -#include "esp_err.h" -#include "soc/soc.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ULP_FSM_PREPARE_SLEEP_CYCLES 2 /*!< Cycles spent by FSM preparing ULP for sleep */ -#define ULP_FSM_WAKEUP_SLEEP_CYCLES 2 /*!< Cycles spent by FSM waking up ULP from sleep */ - -/** - * @defgroup ulp_registers ULP coprocessor registers - * @{ - */ - - -#define R0 0 /*!< general purpose register 0 */ -#define R1 1 /*!< general purpose register 1 */ -#define R2 2 /*!< general purpose register 2 */ -#define R3 3 /*!< general purpose register 3 */ -/**@}*/ - -/** @defgroup ulp_opcodes ULP coprocessor opcodes, sub opcodes, and various modifiers/flags - * - * These definitions are not intended to be used directly. - * They are used in definitions of instructions later on. - * - * @{ - */ - -#define OPCODE_WR_REG 1 /*!< Instruction: write peripheral register (RTC_CNTL/RTC_IO/SARADC) (not implemented yet) */ - -#define OPCODE_RD_REG 2 /*!< Instruction: read peripheral register (RTC_CNTL/RTC_IO/SARADC) (not implemented yet) */ - -#define RD_REG_PERIPH_RTC_CNTL 0 /*!< Identifier of RTC_CNTL peripheral for RD_REG and WR_REG instructions */ -#define RD_REG_PERIPH_RTC_IO 1 /*!< Identifier of RTC_IO peripheral for RD_REG and WR_REG instructions */ -#define RD_REG_PERIPH_SENS 2 /*!< Identifier of SARADC peripheral for RD_REG and WR_REG instructions */ -#define RD_REG_PERIPH_RTC_I2C 3 /*!< Identifier of RTC_I2C peripheral for RD_REG and WR_REG instructions */ - -#define OPCODE_I2C 3 /*!< Instruction: read/write I2C (not implemented yet) */ - -#define OPCODE_DELAY 4 /*!< Instruction: delay (nop) for a given number of cycles */ - -#define OPCODE_ADC 5 /*!< Instruction: SAR ADC measurement (not implemented yet) */ - -#define OPCODE_ST 6 /*!< Instruction: store indirect to RTC memory */ -#define SUB_OPCODE_ST 4 /*!< Store 32 bits, 16 MSBs contain PC, 16 LSBs contain value from source register */ - -#define OPCODE_ALU 7 /*!< Arithmetic instructions */ -#define SUB_OPCODE_ALU_REG 0 /*!< Arithmetic instruction, both source values are in register */ -#define SUB_OPCODE_ALU_IMM 1 /*!< Arithmetic instruction, one source value is an immediate */ -#define SUB_OPCODE_ALU_CNT 2 /*!< Arithmetic instruction between counter register and an immediate (not implemented yet)*/ -#define ALU_SEL_ADD 0 /*!< Addition */ -#define ALU_SEL_SUB 1 /*!< Subtraction */ -#define ALU_SEL_AND 2 /*!< Logical AND */ -#define ALU_SEL_OR 3 /*!< Logical OR */ -#define ALU_SEL_MOV 4 /*!< Copy value (immediate to destination register or source register to destination register */ -#define ALU_SEL_LSH 5 /*!< Shift left by given number of bits */ -#define ALU_SEL_RSH 6 /*!< Shift right by given number of bits */ - -#define OPCODE_BRANCH 8 /*!< Branch instructions */ -#define SUB_OPCODE_BX 0 /*!< Branch to absolute PC (immediate or in register) */ -#define BX_JUMP_TYPE_DIRECT 0 /*!< Unconditional jump */ -#define BX_JUMP_TYPE_ZERO 1 /*!< Branch if last ALU result is zero */ -#define BX_JUMP_TYPE_OVF 2 /*!< Branch if last ALU operation caused and overflow */ -#define SUB_OPCODE_B 1 /*!< Branch to a relative offset */ -#define B_CMP_L 0 /*!< Branch if R0 is less than an immediate */ -#define B_CMP_GE 1 /*!< Branch if R0 is greater than or equal to an immediate */ - -#define OPCODE_END 9 /*!< Stop executing the program */ -#define SUB_OPCODE_END 0 /*!< Stop executing the program and optionally wake up the chip */ -#define SUB_OPCODE_SLEEP 1 /*!< Stop executing the program and run it again after selected interval */ - -#define OPCODE_TSENS 10 /*!< Instruction: temperature sensor measurement (not implemented yet) */ - -#define OPCODE_HALT 11 /*!< Halt the coprocessor */ - -#define OPCODE_LD 13 /*!< Indirect load lower 16 bits from RTC memory */ - -#define OPCODE_MACRO 15 /*!< Not a real opcode. Used to identify labels and branches in the program */ -#define SUB_OPCODE_MACRO_LABEL 0 /*!< Label macro */ -#define SUB_OPCODE_MACRO_BRANCH 1 /*!< Branch macro */ -/**@}*/ - -/**@{*/ -#define ESP_ERR_ULP_BASE 0x1200 /*!< Offset for ULP-related error codes */ -#define ESP_ERR_ULP_SIZE_TOO_BIG (ESP_ERR_ULP_BASE + 1) /*!< Program doesn't fit into RTC memory reserved for the ULP */ -#define ESP_ERR_ULP_INVALID_LOAD_ADDR (ESP_ERR_ULP_BASE + 2) /*!< Load address is outside of RTC memory reserved for the ULP */ -#define ESP_ERR_ULP_DUPLICATE_LABEL (ESP_ERR_ULP_BASE + 3) /*!< More than one label with the same number was defined */ -#define ESP_ERR_ULP_UNDEFINED_LABEL (ESP_ERR_ULP_BASE + 4) /*!< Branch instructions references an undefined label */ -#define ESP_ERR_ULP_BRANCH_OUT_OF_RANGE (ESP_ERR_ULP_BASE + 5) /*!< Branch target is out of range of B instruction (try replacing with BX) */ -/**@}*/ - - -/** - * @brief Instruction format structure - * - * All ULP instructions are 32 bit long. - * This union contains field layouts used by all of the supported instructions. - * This union also includes a special "macro" instruction layout. - * This is not a real instruction which can be executed by the CPU. It acts - * as a token which is removed from the program by the - * ulp_process_macros_and_load function. - * - * These structures are not intended to be used directly. - * Preprocessor definitions provided below fill the fields of these structure with - * the right arguments. - */ -typedef union { - - struct { - uint32_t cycles : 16; /*!< Number of cycles to sleep */ - uint32_t unused : 12; /*!< Unused */ - uint32_t opcode : 4; /*!< Opcode (OPCODE_DELAY) */ - } delay; /*!< Format of DELAY instruction */ - - struct { - uint32_t dreg : 2; /*!< Register which contains data to store */ - uint32_t sreg : 2; /*!< Register which contains address in RTC memory (expressed in words) */ - uint32_t unused1 : 6; /*!< Unused */ - uint32_t offset : 11; /*!< Offset to add to sreg */ - uint32_t unused2 : 4; /*!< Unused */ - uint32_t sub_opcode : 3; /*!< Sub opcode (SUB_OPCODE_ST) */ - uint32_t opcode : 4; /*!< Opcode (OPCODE_ST) */ - } st; /*!< Format of ST instruction */ - - struct { - uint32_t dreg : 2; /*!< Register where the data should be loaded to */ - uint32_t sreg : 2; /*!< Register which contains address in RTC memory (expressed in words) */ - uint32_t unused1 : 6; /*!< Unused */ - uint32_t offset : 11; /*!< Offset to add to sreg */ - uint32_t unused2 : 7; /*!< Unused */ - uint32_t opcode : 4; /*!< Opcode (OPCODE_LD) */ - } ld; /*!< Format of LD instruction */ - - struct { - uint32_t unused : 28; /*!< Unused */ - uint32_t opcode : 4; /*!< Opcode (OPCODE_HALT) */ - } halt; /*!< Format of HALT instruction */ - - struct { - uint32_t dreg : 2; /*!< Register which contains target PC, expressed in words (used if .reg == 1) */ - uint32_t addr : 11; /*!< Target PC, expressed in words (used if .reg == 0) */ - uint32_t unused : 8; /*!< Unused */ - uint32_t reg : 1; /*!< Target PC in register (1) or immediate (0) */ - uint32_t type : 3; /*!< Jump condition (BX_JUMP_TYPE_xxx) */ - uint32_t sub_opcode : 3; /*!< Sub opcode (SUB_OPCODE_BX) */ - uint32_t opcode : 4; /*!< Opcode (OPCODE_BRANCH) */ - } bx; /*!< Format of BRANCH instruction (absolute address) */ - - struct { - uint32_t imm : 16; /*!< Immediate value to compare against */ - uint32_t cmp : 1; /*!< Comparison to perform: B_CMP_L or B_CMP_GE */ - uint32_t offset : 7; /*!< Absolute value of target PC offset w.r.t. current PC, expressed in words */ - uint32_t sign : 1; /*!< Sign of target PC offset: 0: positive, 1: negative */ - uint32_t sub_opcode : 3; /*!< Sub opcode (SUB_OPCODE_B) */ - uint32_t opcode : 4; /*!< Opcode (OPCODE_BRANCH) */ - } b; /*!< Format of BRANCH instruction (relative address) */ - - struct { - uint32_t dreg : 2; /*!< Destination register */ - uint32_t sreg : 2; /*!< Register with operand A */ - uint32_t treg : 2; /*!< Register with operand B */ - uint32_t unused : 15; /*!< Unused */ - uint32_t sel : 4; /*!< Operation to perform, one of ALU_SEL_xxx */ - uint32_t sub_opcode : 3; /*!< Sub opcode (SUB_OPCODE_ALU_REG) */ - uint32_t opcode : 4; /*!< Opcode (OPCODE_ALU) */ - } alu_reg; /*!< Format of ALU instruction (both sources are registers) */ - - struct { - uint32_t dreg : 2; /*!< Destination register */ - uint32_t sreg : 2; /*!< Register with operand A */ - uint32_t imm : 16; /*!< Immediate value of operand B */ - uint32_t unused : 1; /*!< Unused */ - uint32_t sel : 4; /*!< Operation to perform, one of ALU_SEL_xxx */ - uint32_t sub_opcode : 3; /*!< Sub opcode (SUB_OPCODE_ALU_IMM) */ - uint32_t opcode : 4; /*!< Opcode (OPCODE_ALU) */ - } alu_imm; /*!< Format of ALU instruction (one source is an immediate) */ - - struct { - uint32_t addr : 8; /*!< Address within either RTC_CNTL, RTC_IO, or SARADC */ - uint32_t periph_sel : 2; /*!< Select peripheral: RTC_CNTL (0), RTC_IO(1), SARADC(2) */ - uint32_t data : 8; /*!< 8 bits of data to write */ - uint32_t low : 5; /*!< Low bit */ - uint32_t high : 5; /*!< High bit */ - uint32_t opcode : 4; /*!< Opcode (OPCODE_WR_REG) */ - } wr_reg; /*!< Format of WR_REG instruction */ - - struct { - uint32_t addr : 8; /*!< Address within either RTC_CNTL, RTC_IO, or SARADC */ - uint32_t periph_sel : 2; /*!< Select peripheral: RTC_CNTL (0), RTC_IO(1), SARADC(2) */ - uint32_t unused : 8; /*!< Unused */ - uint32_t low : 5; /*!< Low bit */ - uint32_t high : 5; /*!< High bit */ - uint32_t opcode : 4; /*!< Opcode (OPCODE_WR_REG) */ - } rd_reg; /*!< Format of RD_REG instruction */ - - struct { - uint32_t dreg : 2; /*!< Register where to store ADC result */ - uint32_t mux : 4; /*!< Select SARADC pad (mux + 1) */ - uint32_t sar_sel : 1; /*!< Select SARADC0 (0) or SARADC1 (1) */ - uint32_t unused1 : 1; /*!< Unused */ - uint32_t cycles : 16; /*!< TBD, cycles used for measurement */ - uint32_t unused2 : 4; /*!< Unused */ - uint32_t opcode: 4; /*!< Opcode (OPCODE_ADC) */ - } adc; /*!< Format of ADC instruction */ - - struct { - uint32_t dreg : 2; /*!< Register where to store temperature measurement result */ - uint32_t wait_delay: 14; /*!< Cycles to wait after measurement is done */ - uint32_t reserved: 12; /*!< Reserved, set to 0 */ - uint32_t opcode: 4; /*!< Opcode (OPCODE_TSENS) */ - } tsens; /*!< Format of TSENS instruction */ - - struct { - uint32_t i2c_addr : 8; /*!< I2C slave address */ - uint32_t data : 8; /*!< Data to read or write */ - uint32_t low_bits : 3; /*!< TBD */ - uint32_t high_bits : 3; /*!< TBD */ - uint32_t i2c_sel : 4; /*!< TBD, select reg_i2c_slave_address[7:0] */ - uint32_t unused : 1; /*!< Unused */ - uint32_t rw : 1; /*!< Write (1) or read (0) */ - uint32_t opcode : 4; /*!< Opcode (OPCODE_I2C) */ - } i2c; /*!< Format of I2C instruction */ - - struct { - uint32_t wakeup : 1; /*!< Set to 1 to wake up chip */ - uint32_t unused : 24; /*!< Unused */ - uint32_t sub_opcode : 3; /*!< Sub opcode (SUB_OPCODE_WAKEUP) */ - uint32_t opcode : 4; /*!< Opcode (OPCODE_END) */ - } end; /*!< Format of END instruction with wakeup */ - - struct { - uint32_t cycle_sel : 4; /*!< Select which one of SARADC_ULP_CP_SLEEP_CYCx_REG to get the sleep duration from */ - uint32_t unused : 21; /*!< Unused */ - uint32_t sub_opcode : 3; /*!< Sub opcode (SUB_OPCODE_SLEEP) */ - uint32_t opcode : 4; /*!< Opcode (OPCODE_END) */ - } sleep; /*!< Format of END instruction with sleep */ - - struct { - uint32_t label : 16; /*!< Label number */ - uint32_t unused : 8; /*!< Unused */ - uint32_t sub_opcode : 4; /*!< SUB_OPCODE_MACRO_LABEL or SUB_OPCODE_MACRO_BRANCH */ - uint32_t opcode: 4; /*!< Opcode (OPCODE_MACRO) */ - } macro; /*!< Format of tokens used by LABEL and BRANCH macros */ - -} ulp_insn_t; - -_Static_assert(sizeof(ulp_insn_t) == 4, "ULP coprocessor instruction size should be 4 bytes"); - -/** - * Delay (nop) for a given number of cycles - */ -#define I_DELAY(cycles_) { .delay = {\ - .cycles = cycles_, \ - .unused = 0, \ - .opcode = OPCODE_DELAY } } - -/** - * Halt the coprocessor. - * - * This instruction halts the coprocessor, but keeps ULP timer active. - * As such, ULP program will be restarted again by timer. - * To stop the program and prevent the timer from restarting the program, - * use I_END(0) instruction. - */ -#define I_HALT() { .halt = {\ - .unused = 0, \ - .opcode = OPCODE_HALT } } - -/** - * Map SoC peripheral register to periph_sel field of RD_REG and WR_REG - * instructions. - * - * @param reg peripheral register in RTC_CNTL_, RTC_IO_, SENS_, RTC_I2C peripherals. - * @return periph_sel value for the peripheral to which this register belongs. - */ -static inline uint32_t SOC_REG_TO_ULP_PERIPH_SEL(uint32_t reg) { - uint32_t ret = 3; - if (reg < DR_REG_RTCCNTL_BASE) { - assert(0 && "invalid register base"); - } else if (reg < DR_REG_RTCIO_BASE) { - ret = RD_REG_PERIPH_RTC_CNTL; - } else if (reg < DR_REG_SENS_BASE) { - ret = RD_REG_PERIPH_RTC_IO; - } else if (reg < DR_REG_RTC_I2C_BASE){ - ret = RD_REG_PERIPH_SENS; - } else if (reg < DR_REG_IO_MUX_BASE){ - ret = RD_REG_PERIPH_RTC_I2C; - } else { - assert(0 && "invalid register base"); - } - return ret; -} - -/** - * Write literal value to a peripheral register - * - * reg[high_bit : low_bit] = val - * This instruction can access RTC_CNTL_, RTC_IO_, SENS_, and RTC_I2C peripheral registers. - */ -#define I_WR_REG(reg, low_bit, high_bit, val) {.wr_reg = {\ - .addr = (reg & 0xff) / sizeof(uint32_t), \ - .periph_sel = SOC_REG_TO_ULP_PERIPH_SEL(reg), \ - .data = val, \ - .low = low_bit, \ - .high = high_bit, \ - .opcode = OPCODE_WR_REG } } - -/** - * Read from peripheral register into R0 - * - * R0 = reg[high_bit : low_bit] - * This instruction can access RTC_CNTL_, RTC_IO_, SENS_, and RTC_I2C peripheral registers. - */ -#define I_RD_REG(reg, low_bit, high_bit) {.rd_reg = {\ - .addr = (reg & 0xff) / sizeof(uint32_t), \ - .periph_sel = SOC_REG_TO_ULP_PERIPH_SEL(reg), \ - .unused = 0, \ - .low = low_bit, \ - .high = high_bit, \ - .opcode = OPCODE_RD_REG } } - -/** - * Set or clear a bit in the peripheral register. - * - * Sets bit (1 << shift) of register reg to value val. - * This instruction can access RTC_CNTL_, RTC_IO_, SENS_, and RTC_I2C peripheral registers. - */ -#define I_WR_REG_BIT(reg, shift, val) I_WR_REG(reg, shift, shift, val) - -/** - * Wake the SoC from deep sleep. - * - * This instruction initiates wake up from deep sleep. - * Use esp_deep_sleep_enable_ulp_wakeup to enable deep sleep wakeup - * triggered by the ULP before going into deep sleep. - * Note that ULP program will still keep running until the I_HALT - * instruction, and it will still be restarted by timer at regular - * intervals, even when the SoC is woken up. - * - * To stop the ULP program, use I_HALT instruction. - * - * To disable the timer which start ULP program, use I_END() - * instruction. I_END instruction clears the - * RTC_CNTL_ULP_CP_SLP_TIMER_EN_S bit of RTC_CNTL_STATE0_REG - * register, which controls the ULP timer. - */ -#define I_WAKE() { .end = { \ - .wakeup = 1, \ - .unused = 0, \ - .sub_opcode = SUB_OPCODE_END, \ - .opcode = OPCODE_END } } - -/** - * Stop ULP program timer. - * - * This is a convenience macro which disables the ULP program timer. - * Once this instruction is used, ULP program will not be restarted - * anymore until ulp_run function is called. - * - * ULP program will continue running after this instruction. To stop - * the currently running program, use I_HALT(). - */ -#define I_END() \ - I_WR_REG_BIT(RTC_CNTL_STATE0_REG, RTC_CNTL_ULP_CP_SLP_TIMER_EN_S, 0) -/** - * Select the time interval used to run ULP program. - * - * This instructions selects which of the SENS_SLEEP_CYCLES_Sx - * registers' value is used by the ULP program timer. - * When the ULP program stops at I_HALT instruction, ULP program - * timer start counting. When the counter reaches the value of - * the selected SENS_SLEEP_CYCLES_Sx register, ULP program - * start running again from the start address (passed to the ulp_run - * function). - * There are 5 SENS_SLEEP_CYCLES_Sx registers, so 0 <= timer_idx < 5. - * - * By default, SENS_SLEEP_CYCLES_S0 register is used by the ULP - * program timer. - */ -#define I_SLEEP_CYCLE_SEL(timer_idx) { .sleep = { \ - .cycle_sel = timer_idx, \ - .unused = 0, \ - .sub_opcode = SUB_OPCODE_SLEEP, \ - .opcode = OPCODE_END } } - -/** - * Perform temperature sensor measurement and store it into reg_dest. - * - * Delay can be set between 1 and ((1 << 14) - 1). Higher values give - * higher measurement resolution. - */ -#define I_TSENS(reg_dest, delay) { .tsens = { \ - .dreg = reg_dest, \ - .wait_delay = delay, \ - .reserved = 0, \ - .opcode = OPCODE_TSENS } } - -/** - * Perform ADC measurement and store result in reg_dest. - * - * adc_idx selects ADC (0 or 1). - * pad_idx selects ADC pad (0 - 7). - */ -#define I_ADC(reg_dest, adc_idx, pad_idx) { .adc = {\ - .dreg = reg_dest, \ - .mux = pad_idx + 1, \ - .sar_sel = adc_idx, \ - .unused1 = 0, \ - .cycles = 0, \ - .unused2 = 0, \ - .opcode = OPCODE_ADC } } - -/** - * Store value from register reg_val into RTC memory. - * - * The value is written to an offset calculated by adding value of - * reg_addr register and offset_ field (this offset is expressed in 32-bit words). - * 32 bits written to RTC memory are built as follows: - * - bits [31:21] hold the PC of current instruction, expressed in 32-bit words - * - bits [20:16] = 5'b1 - * - bits [15:0] are assigned the contents of reg_val - * - * RTC_SLOW_MEM[addr + offset_] = { 5'b0, insn_PC[10:0], val[15:0] } - */ -#define I_ST(reg_val, reg_addr, offset_) { .st = { \ - .dreg = reg_val, \ - .sreg = reg_addr, \ - .unused1 = 0, \ - .offset = offset_, \ - .unused2 = 0, \ - .sub_opcode = SUB_OPCODE_ST, \ - .opcode = OPCODE_ST } } - - -/** - * Load value from RTC memory into reg_dest register. - * - * Loads 16 LSBs from RTC memory word given by the sum of value in reg_addr and - * value of offset_. - */ -#define I_LD(reg_dest, reg_addr, offset_) { .ld = { \ - .dreg = reg_dest, \ - .sreg = reg_addr, \ - .unused1 = 0, \ - .offset = offset_, \ - .unused2 = 0, \ - .opcode = OPCODE_LD } } - - -/** - * Branch relative if R0 less than immediate value. - * - * pc_offset is expressed in words, and can be from -127 to 127 - * imm_value is a 16-bit value to compare R0 against - */ -#define I_BL(pc_offset, imm_value) { .b = { \ - .imm = imm_value, \ - .cmp = B_CMP_L, \ - .offset = abs(pc_offset), \ - .sign = (pc_offset >= 0) ? 0 : 1, \ - .sub_opcode = SUB_OPCODE_B, \ - .opcode = OPCODE_BRANCH } } - -/** - * Branch relative if R0 greater or equal than immediate value. - * - * pc_offset is expressed in words, and can be from -127 to 127 - * imm_value is a 16-bit value to compare R0 against - */ -#define I_BGE(pc_offset, imm_value) { .b = { \ - .imm = imm_value, \ - .cmp = B_CMP_GE, \ - .offset = abs(pc_offset), \ - .sign = (pc_offset >= 0) ? 0 : 1, \ - .sub_opcode = SUB_OPCODE_B, \ - .opcode = OPCODE_BRANCH } } - -/** - * Unconditional branch to absolute PC, address in register. - * - * reg_pc is the register which contains address to jump to. - * Address is expressed in 32-bit words. - */ -#define I_BXR(reg_pc) { .bx = { \ - .dreg = reg_pc, \ - .addr = 0, \ - .unused = 0, \ - .reg = 1, \ - .type = BX_JUMP_TYPE_DIRECT, \ - .sub_opcode = SUB_OPCODE_BX, \ - .opcode = OPCODE_BRANCH } } - -/** - * Unconditional branch to absolute PC, immediate address. - * - * Address imm_pc is expressed in 32-bit words. - */ -#define I_BXI(imm_pc) { .bx = { \ - .dreg = 0, \ - .addr = imm_pc, \ - .unused = 0, \ - .reg = 0, \ - .type = BX_JUMP_TYPE_DIRECT, \ - .sub_opcode = SUB_OPCODE_BX, \ - .opcode = OPCODE_BRANCH } } - -/** - * Branch to absolute PC if ALU result is zero, address in register. - * - * reg_pc is the register which contains address to jump to. - * Address is expressed in 32-bit words. - */ -#define I_BXZR(reg_pc) { .bx = { \ - .dreg = reg_pc, \ - .addr = 0, \ - .unused = 0, \ - .reg = 1, \ - .type = BX_JUMP_TYPE_ZERO, \ - .sub_opcode = SUB_OPCODE_BX, \ - .opcode = OPCODE_BRANCH } } - -/** - * Branch to absolute PC if ALU result is zero, immediate address. - * - * Address imm_pc is expressed in 32-bit words. - */ -#define I_BXZI(imm_pc) { .bx = { \ - .dreg = 0, \ - .addr = imm_pc, \ - .unused = 0, \ - .reg = 0, \ - .type = BX_JUMP_TYPE_ZERO, \ - .sub_opcode = SUB_OPCODE_BX, \ - .opcode = OPCODE_BRANCH } } - -/** - * Branch to absolute PC if ALU overflow, address in register - * - * reg_pc is the register which contains address to jump to. - * Address is expressed in 32-bit words. - */ -#define I_BXFR(reg_pc) { .bx = { \ - .dreg = reg_pc, \ - .addr = 0, \ - .unused = 0, \ - .reg = 1, \ - .type = BX_JUMP_TYPE_OVF, \ - .sub_opcode = SUB_OPCODE_BX, \ - .opcode = OPCODE_BRANCH } } - -/** - * Branch to absolute PC if ALU overflow, immediate address - * - * Address imm_pc is expressed in 32-bit words. - */ -#define I_BXFI(imm_pc) { .bx = { \ - .dreg = 0, \ - .addr = imm_pc, \ - .unused = 0, \ - .reg = 0, \ - .type = BX_JUMP_TYPE_OVF, \ - .sub_opcode = SUB_OPCODE_BX, \ - .opcode = OPCODE_BRANCH } } - - -/** - * Addition: dest = src1 + src2 - */ -#define I_ADDR(reg_dest, reg_src1, reg_src2) { .alu_reg = { \ - .dreg = reg_dest, \ - .sreg = reg_src1, \ - .treg = reg_src2, \ - .unused = 0, \ - .sel = ALU_SEL_ADD, \ - .sub_opcode = SUB_OPCODE_ALU_REG, \ - .opcode = OPCODE_ALU } } - -/** - * Subtraction: dest = src1 - src2 - */ -#define I_SUBR(reg_dest, reg_src1, reg_src2) { .alu_reg = { \ - .dreg = reg_dest, \ - .sreg = reg_src1, \ - .treg = reg_src2, \ - .unused = 0, \ - .sel = ALU_SEL_SUB, \ - .sub_opcode = SUB_OPCODE_ALU_REG, \ - .opcode = OPCODE_ALU } } - -/** - * Logical AND: dest = src1 & src2 - */ -#define I_ANDR(reg_dest, reg_src1, reg_src2) { .alu_reg = { \ - .dreg = reg_dest, \ - .sreg = reg_src1, \ - .treg = reg_src2, \ - .unused = 0, \ - .sel = ALU_SEL_AND, \ - .sub_opcode = SUB_OPCODE_ALU_REG, \ - .opcode = OPCODE_ALU } } - -/** - * Logical OR: dest = src1 | src2 - */ -#define I_ORR(reg_dest, reg_src1, reg_src2) { .alu_reg = { \ - .dreg = reg_dest, \ - .sreg = reg_src1, \ - .treg = reg_src2, \ - .unused = 0, \ - .sel = ALU_SEL_OR, \ - .sub_opcode = SUB_OPCODE_ALU_REG, \ - .opcode = OPCODE_ALU } } - -/** - * Copy: dest = src - */ -#define I_MOVR(reg_dest, reg_src) { .alu_reg = { \ - .dreg = reg_dest, \ - .sreg = reg_src, \ - .treg = 0, \ - .unused = 0, \ - .sel = ALU_SEL_MOV, \ - .sub_opcode = SUB_OPCODE_ALU_REG, \ - .opcode = OPCODE_ALU } } - -/** - * Logical shift left: dest = src << shift - */ -#define I_LSHR(reg_dest, reg_src, reg_shift) { .alu_reg = { \ - .dreg = reg_dest, \ - .sreg = reg_src, \ - .treg = reg_shift, \ - .unused = 0, \ - .sel = ALU_SEL_LSH, \ - .sub_opcode = SUB_OPCODE_ALU_REG, \ - .opcode = OPCODE_ALU } } - - -/** - * Logical shift right: dest = src >> shift - */ -#define I_RSHR(reg_dest, reg_src, reg_shift) { .alu_reg = { \ - .dreg = reg_dest, \ - .sreg = reg_src, \ - .treg = reg_shift, \ - .unused = 0, \ - .sel = ALU_SEL_RSH, \ - .sub_opcode = SUB_OPCODE_ALU_REG, \ - .opcode = OPCODE_ALU } } - -/** - * Add register and an immediate value: dest = src1 + imm - */ -#define I_ADDI(reg_dest, reg_src, imm_) { .alu_imm = { \ - .dreg = reg_dest, \ - .sreg = reg_src, \ - .imm = imm_, \ - .unused = 0, \ - .sel = ALU_SEL_ADD, \ - .sub_opcode = SUB_OPCODE_ALU_IMM, \ - .opcode = OPCODE_ALU } } - - -/** - * Subtract register and an immediate value: dest = src - imm - */ -#define I_SUBI(reg_dest, reg_src, imm_) { .alu_imm = { \ - .dreg = reg_dest, \ - .sreg = reg_src, \ - .imm = imm_, \ - .unused = 0, \ - .sel = ALU_SEL_SUB, \ - .sub_opcode = SUB_OPCODE_ALU_IMM, \ - .opcode = OPCODE_ALU } } - -/** - * Logical AND register and an immediate value: dest = src & imm - */ -#define I_ANDI(reg_dest, reg_src, imm_) { .alu_imm = { \ - .dreg = reg_dest, \ - .sreg = reg_src, \ - .imm = imm_, \ - .unused = 0, \ - .sel = ALU_SEL_AND, \ - .sub_opcode = SUB_OPCODE_ALU_IMM, \ - .opcode = OPCODE_ALU } } - -/** - * Logical OR register and an immediate value: dest = src | imm - */ -#define I_ORI(reg_dest, reg_src, imm_) { .alu_imm = { \ - .dreg = reg_dest, \ - .sreg = reg_src, \ - .imm = imm_, \ - .unused = 0, \ - .sel = ALU_SEL_OR, \ - .sub_opcode = SUB_OPCODE_ALU_IMM, \ - .opcode = OPCODE_ALU } } - -/** - * Copy an immediate value into register: dest = imm - */ -#define I_MOVI(reg_dest, imm_) { .alu_imm = { \ - .dreg = reg_dest, \ - .sreg = 0, \ - .imm = imm_, \ - .unused = 0, \ - .sel = ALU_SEL_MOV, \ - .sub_opcode = SUB_OPCODE_ALU_IMM, \ - .opcode = OPCODE_ALU } } - -/** - * Logical shift left register value by an immediate: dest = src << imm - */ -#define I_LSHI(reg_dest, reg_src, imm_) { .alu_imm = { \ - .dreg = reg_dest, \ - .sreg = reg_src, \ - .imm = imm_, \ - .unused = 0, \ - .sel = ALU_SEL_LSH, \ - .sub_opcode = SUB_OPCODE_ALU_IMM, \ - .opcode = OPCODE_ALU } } - - -/** - * Logical shift right register value by an immediate: dest = val >> imm - */ -#define I_RSHI(reg_dest, reg_src, imm_) { .alu_imm = { \ - .dreg = reg_dest, \ - .sreg = reg_src, \ - .imm = imm_, \ - .unused = 0, \ - .sel = ALU_SEL_RSH, \ - .sub_opcode = SUB_OPCODE_ALU_IMM, \ - .opcode = OPCODE_ALU } } - -/** - * Define a label with number label_num. - * - * This is a macro which doesn't generate a real instruction. - * The token generated by this macro is removed by ulp_process_macros_and_load - * function. Label defined using this macro can be used in branch macros defined - * below. - */ -#define M_LABEL(label_num) { .macro = { \ - .label = label_num, \ - .unused = 0, \ - .sub_opcode = SUB_OPCODE_MACRO_LABEL, \ - .opcode = OPCODE_MACRO } } - -/** - * Token macro used by M_B and M_BX macros. Not to be used directly. - */ -#define M_BRANCH(label_num) { .macro = { \ - .label = label_num, \ - .unused = 0, \ - .sub_opcode = SUB_OPCODE_MACRO_BRANCH, \ - .opcode = OPCODE_MACRO } } - -/** - * Macro: branch to label label_num if R0 is less than immediate value. - * - * This macro generates two ulp_insn_t values separated by a comma, and should - * be used when defining contents of ulp_insn_t arrays. First value is not a - * real instruction; it is a token which is removed by ulp_process_macros_and_load - * function. - */ -#define M_BL(label_num, imm_value) \ - M_BRANCH(label_num), \ - I_BL(0, imm_value) - -/** - * Macro: branch to label label_num if R0 is greater or equal than immediate value - * - * This macro generates two ulp_insn_t values separated by a comma, and should - * be used when defining contents of ulp_insn_t arrays. First value is not a - * real instruction; it is a token which is removed by ulp_process_macros_and_load - * function. - */ -#define M_BGE(label_num, imm_value) \ - M_BRANCH(label_num), \ - I_BGE(0, imm_value) - -/** - * Macro: unconditional branch to label - * - * This macro generates two ulp_insn_t values separated by a comma, and should - * be used when defining contents of ulp_insn_t arrays. First value is not a - * real instruction; it is a token which is removed by ulp_process_macros_and_load - * function. - */ -#define M_BX(label_num) \ - M_BRANCH(label_num), \ - I_BXI(0) - -/** - * Macro: branch to label if ALU result is zero - * - * This macro generates two ulp_insn_t values separated by a comma, and should - * be used when defining contents of ulp_insn_t arrays. First value is not a - * real instruction; it is a token which is removed by ulp_process_macros_and_load - * function. - */ -#define M_BXZ(label_num) \ - M_BRANCH(label_num), \ - I_BXZI(0) - -/** - * Macro: branch to label if ALU overflow - * - * This macro generates two ulp_insn_t values separated by a comma, and should - * be used when defining contents of ulp_insn_t arrays. First value is not a - * real instruction; it is a token which is removed by ulp_process_macros_and_load - * function. - */ -#define M_BXF(label_num) \ - M_BRANCH(label_num), \ - I_BXFI(0) - - - -#define RTC_SLOW_MEM ((uint32_t*) 0x50000000) /*!< RTC slow memory, 8k size */ - -/** - * @brief Resolve all macro references in a program and load it into RTC memory - * @param load_addr address where the program should be loaded, expressed in 32-bit words - * @param program ulp_insn_t array with the program - * @param psize size of the program, expressed in 32-bit words - * @return - * - ESP_OK on success - * - ESP_ERR_NO_MEM if auxiliary temporary structure can not be allocated - * - one of ESP_ERR_ULP_xxx if program is not valid or can not be loaded - */ -esp_err_t ulp_process_macros_and_load(uint32_t load_addr, const ulp_insn_t* program, size_t* psize); - -/** - * @brief Load ULP program binary into RTC memory - * - * ULP program binary should have the following format (all values little-endian): - * - * 1. MAGIC, (value 0x00706c75, 4 bytes) - * 2. TEXT_OFFSET, offset of .text section from binary start (2 bytes) - * 3. TEXT_SIZE, size of .text section (2 bytes) - * 4. DATA_SIZE, size of .data section (2 bytes) - * 5. BSS_SIZE, size of .bss section (2 bytes) - * 6. (TEXT_OFFSET - 12) bytes of arbitrary data (will not be loaded into RTC memory) - * 7. .text section - * 8. .data section - * - * Linker script in components/ulp/ld/esp32.ulp.ld produces ELF files which - * correspond to this format. This linker script produces binaries with load_addr == 0. - * - * @param load_addr address where the program should be loaded, expressed in 32-bit words - * @param program_binary pointer to program binary - * @param program_size size of the program binary - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_ARG if load_addr is out of range - * - ESP_ERR_INVALID_SIZE if program_size doesn't match (TEXT_OFFSET + TEXT_SIZE + DATA_SIZE) - * - ESP_ERR_NOT_SUPPORTED if the magic number is incorrect - */ -esp_err_t ulp_load_binary(uint32_t load_addr, const uint8_t* program_binary, size_t program_size); - -/** - * @brief Run the program loaded into RTC memory - * @param entry_point entry point, expressed in 32-bit words - * @return ESP_OK on success - */ -esp_err_t ulp_run(uint32_t entry_point); - -/** - * @brief Set one of ULP wakeup period values - * - * ULP coprocessor starts running the program when the wakeup timer counts up - * to a given value (called period). There are 5 period values which can be - * programmed into SENS_ULP_CP_SLEEP_CYCx_REG registers, x = 0..4. - * By default, wakeup timer will use the period set into SENS_ULP_CP_SLEEP_CYC0_REG, - * i.e. period number 0. ULP program code can use SLEEP instruction to select - * which of the SENS_ULP_CP_SLEEP_CYCx_REG should be used for subsequent wakeups. - * - * @param period_index wakeup period setting number (0 - 4) - * @param period_us wakeup period, us - * @note The ULP FSM requires two clock cycles to wakeup before being able to run the program. - * Then additional 16 cycles are reserved after wakeup waiting until the 8M clock is stable. - * The FSM also requires two more clock cycles to go to sleep after the program execution is halted. - * The minimum wakeup period that may be set up for the ULP - * is equal to the total number of cycles spent on the above internal tasks. - * For a default configuration of the ULP running at 150kHz it makes about 133us. - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_ARG if period_index is out of range - */ -esp_err_t ulp_set_wakeup_period(size_t period_index, uint32_t period_us); - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/vfs/esp_vfs.h b/tools/sdk/include/vfs/esp_vfs.h deleted file mode 100644 index 7033b267655..00000000000 --- a/tools/sdk/include/vfs/esp_vfs.h +++ /dev/null @@ -1,405 +0,0 @@ -// Copyright 2015-2019 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. - -#ifndef __ESP_VFS_H__ -#define __ESP_VFS_H__ - -#include -#include -#include -#include -#include "freertos/FreeRTOS.h" -#include "freertos/semphr.h" -#include "esp_err.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include "sdkconfig.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _SYS_TYPES_FD_SET -#error "VFS should be used with FD_SETSIZE and FD_SET from sys/types.h" -#endif - -/** - * Maximum number of (global) file descriptors. - */ -#define MAX_FDS FD_SETSIZE /* for compatibility with fd_set and select() */ - -/** - * Maximum length of path prefix (not including zero terminator) - */ -#define ESP_VFS_PATH_MAX 15 - -/** - * Default value of flags member in esp_vfs_t structure. - */ -#define ESP_VFS_FLAG_DEFAULT 0 - -/** - * Flag which indicates that FS needs extra context pointer in syscalls. - */ -#define ESP_VFS_FLAG_CONTEXT_PTR 1 - -/* - * @brief VFS identificator used for esp_vfs_register_with_id() - */ -typedef int esp_vfs_id_t; - -/** - * @brief VFS definition structure - * - * This structure should be filled with pointers to corresponding - * FS driver functions. - * - * VFS component will translate all FDs so that the filesystem implementation - * sees them starting at zero. The caller sees a global FD which is prefixed - * with an pre-filesystem-implementation. - * - * Some FS implementations expect some state (e.g. pointer to some structure) - * to be passed in as a first argument. For these implementations, - * populate the members of this structure which have _p suffix, set - * flags member to ESP_VFS_FLAG_CONTEXT_PTR and provide the context pointer - * to esp_vfs_register function. - * If the implementation doesn't use this extra argument, populate the - * members without _p suffix and set flags member to ESP_VFS_FLAG_DEFAULT. - * - * If the FS driver doesn't provide some of the functions, set corresponding - * members to NULL. - */ -typedef struct -{ - int flags; /*!< ESP_VFS_FLAG_CONTEXT_PTR or ESP_VFS_FLAG_DEFAULT */ - union { - ssize_t (*write_p)(void* p, int fd, const void * data, size_t size); - ssize_t (*write)(int fd, const void * data, size_t size); - }; - union { - off_t (*lseek_p)(void* p, int fd, off_t size, int mode); - off_t (*lseek)(int fd, off_t size, int mode); - }; - union { - ssize_t (*read_p)(void* ctx, int fd, void * dst, size_t size); - ssize_t (*read)(int fd, void * dst, size_t size); - }; - union { - int (*open_p)(void* ctx, const char * path, int flags, int mode); - int (*open)(const char * path, int flags, int mode); - }; - union { - int (*close_p)(void* ctx, int fd); - int (*close)(int fd); - }; - union { - int (*fstat_p)(void* ctx, int fd, struct stat * st); - int (*fstat)(int fd, struct stat * st); - }; - union { - int (*stat_p)(void* ctx, const char * path, struct stat * st); - int (*stat)(const char * path, struct stat * st); - }; - union { - int (*link_p)(void* ctx, const char* n1, const char* n2); - int (*link)(const char* n1, const char* n2); - }; - union { - int (*unlink_p)(void* ctx, const char *path); - int (*unlink)(const char *path); - }; - union { - int (*rename_p)(void* ctx, const char *src, const char *dst); - int (*rename)(const char *src, const char *dst); - }; - union { - DIR* (*opendir_p)(void* ctx, const char* name); - DIR* (*opendir)(const char* name); - }; - union { - struct dirent* (*readdir_p)(void* ctx, DIR* pdir); - struct dirent* (*readdir)(DIR* pdir); - }; - union { - int (*readdir_r_p)(void* ctx, DIR* pdir, struct dirent* entry, struct dirent** out_dirent); - int (*readdir_r)(DIR* pdir, struct dirent* entry, struct dirent** out_dirent); - }; - union { - long (*telldir_p)(void* ctx, DIR* pdir); - long (*telldir)(DIR* pdir); - }; - union { - void (*seekdir_p)(void* ctx, DIR* pdir, long offset); - void (*seekdir)(DIR* pdir, long offset); - }; - union { - int (*closedir_p)(void* ctx, DIR* pdir); - int (*closedir)(DIR* pdir); - }; - union { - int (*mkdir_p)(void* ctx, const char* name, mode_t mode); - int (*mkdir)(const char* name, mode_t mode); - }; - union { - int (*rmdir_p)(void* ctx, const char* name); - int (*rmdir)(const char* name); - }; - union { - int (*fcntl_p)(void* ctx, int fd, int cmd, va_list args); - int (*fcntl)(int fd, int cmd, va_list args); - }; - union { - int (*ioctl_p)(void* ctx, int fd, int cmd, va_list args); - int (*ioctl)(int fd, int cmd, va_list args); - }; - union { - int (*fsync_p)(void* ctx, int fd); - int (*fsync)(int fd); - }; - union { - int (*access_p)(void* ctx, const char *path, int amode); - int (*access)(const char *path, int amode); - }; - union { - int (*truncate_p)(void* ctx, const char *path, off_t length); - int (*truncate)(const char *path, off_t length); - }; -#ifdef CONFIG_SUPPORT_TERMIOS - union { - int (*tcsetattr_p)(void *ctx, int fd, int optional_actions, const struct termios *p); - int (*tcsetattr)(int fd, int optional_actions, const struct termios *p); - }; - union { - int (*tcgetattr_p)(void *ctx, int fd, struct termios *p); - int (*tcgetattr)(int fd, struct termios *p); - }; - union { - int (*tcdrain_p)(void *ctx, int fd); - int (*tcdrain)(int fd); - }; - union { - int (*tcflush_p)(void *ctx, int fd, int select); - int (*tcflush)(int fd, int select); - }; - union { - int (*tcflow_p)(void *ctx, int fd, int action); - int (*tcflow)(int fd, int action); - }; - union { - pid_t (*tcgetsid_p)(void *ctx, int fd); - pid_t (*tcgetsid)(int fd); - }; - union { - int (*tcsendbreak_p)(void *ctx, int fd, int duration); - int (*tcsendbreak)(int fd, int duration); - }; -#endif // CONFIG_SUPPORT_TERMIOS - - /** start_select is called for setting up synchronous I/O multiplexing of the desired file descriptors in the given VFS */ - esp_err_t (*start_select)(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, SemaphoreHandle_t *signal_sem); - /** socket select function for socket FDs with the functionality of POSIX select(); this should be set only for the socket VFS */ - int (*socket_select)(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *timeout); - /** called by VFS to interrupt the socket_select call when select is activated from a non-socket VFS driver; set only for the socket driver */ - void (*stop_socket_select)(); - /** stop_socket_select which can be called from ISR; set only for the socket driver */ - void (*stop_socket_select_isr)(BaseType_t *woken); - /** end_select is called to stop the I/O multiplexing and deinitialize the environment created by start_select for the given VFS */ - void* (*get_socket_select_semaphore)(); - /** get_socket_select_semaphore returns semaphore allocated in the socket driver; set only for the socket driver */ - void (*end_select)(); -} esp_vfs_t; - - -/** - * Register a virtual filesystem for given path prefix. - * - * @param base_path file path prefix associated with the filesystem. - * Must be a zero-terminated C string, up to ESP_VFS_PATH_MAX - * characters long, and at least 2 characters long. - * Name must start with a "/" and must not end with "/". - * For example, "/data" or "/dev/spi" are valid. - * These VFSes would then be called to handle file paths such as - * "/data/myfile.txt" or "/dev/spi/0". - * @param vfs Pointer to esp_vfs_t, a structure which maps syscalls to - * the filesystem driver functions. VFS component doesn't - * assume ownership of this pointer. - * @param ctx If vfs->flags has ESP_VFS_FLAG_CONTEXT_PTR set, a pointer - * which should be passed to VFS functions. Otherwise, NULL. - * - * @return ESP_OK if successful, ESP_ERR_NO_MEM if too many VFSes are - * registered. - */ -esp_err_t esp_vfs_register(const char* base_path, const esp_vfs_t* vfs, void* ctx); - - -/** - * Special case function for registering a VFS that uses a method other than - * open() to open new file descriptors from the interval -#include - -/** - * This header file provides POSIX-compatible definitions of directory - * access functions and related data types. - * See http://pubs.opengroup.org/onlinepubs/7908799/xsh/dirent.h.html - * for reference. - */ - -/** - * @brief Opaque directory structure - */ -typedef struct { - uint16_t dd_vfs_idx; /*!< VFS index, not to be used by applications */ - uint16_t dd_rsv; /*!< field reserved for future extension */ - /* remaining fields are defined by VFS implementation */ -} DIR; - -/** - * @brief Directory entry structure - */ -struct dirent { - int d_ino; /*!< file number */ - uint8_t d_type; /*!< not defined in POSIX, but present in BSD and Linux */ -#define DT_UNKNOWN 0 -#define DT_REG 1 -#define DT_DIR 2 - char d_name[256]; /*!< zero-terminated file name */ -}; - -DIR* opendir(const char* name); -struct dirent* readdir(DIR* pdir); -long telldir(DIR* pdir); -void seekdir(DIR* pdir, long loc); -void rewinddir(DIR* pdir); -int closedir(DIR* pdir); -int readdir_r(DIR* pdir, struct dirent* entry, struct dirent** out_dirent); - diff --git a/tools/sdk/include/vfs/sys/ioctl.h b/tools/sdk/include/vfs/sys/ioctl.h deleted file mode 100644 index 90cbb47d663..00000000000 --- a/tools/sdk/include/vfs/sys/ioctl.h +++ /dev/null @@ -1,25 +0,0 @@ -// 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. - -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -int ioctl(int fd, int request, ...); - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/include/wear_levelling/wear_levelling.h b/tools/sdk/include/wear_levelling/wear_levelling.h deleted file mode 100644 index 137b13f1d19..00000000000 --- a/tools/sdk/include/wear_levelling/wear_levelling.h +++ /dev/null @@ -1,136 +0,0 @@ -// 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. - -#ifndef _wear_levelling_H_ -#define _wear_levelling_H_ - -#include "esp_log.h" -#include "esp_partition.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** -* @brief wear levelling handle -*/ -typedef int32_t wl_handle_t; - -#define WL_INVALID_HANDLE -1 - -/** -* @brief Mount WL for defined partition -* -* @param partition that will be used for access -* @param out_handle handle of the WL instance -* -* @return -* - ESP_OK, if the allocation was successfully; -* - ESP_ERR_INVALID_ARG, if WL allocation was unsuccessful; -* - ESP_ERR_NO_MEM, if there was no memory to allocate WL components; -*/ -esp_err_t wl_mount(const esp_partition_t *partition, wl_handle_t *out_handle); - -/** -* @brief Unmount WL for defined partition -* -* @param handle WL partition handle -* -* @return -* - ESP_OK, if the operation completed successfully; -* - or one of error codes from lower-level flash driver. -*/ -esp_err_t wl_unmount(wl_handle_t handle); - -/** -* @brief Erase part of the WL storage -* -* @param handle WL handle that are related to the partition -* @param start_addr Address where erase operation should start. Must be aligned -* to the result of function wl_sector_size(...). -* @param size Size of the range which should be erased, in bytes. -* Must be divisible by result of function wl_sector_size(...).. -* -* @return -* - ESP_OK, if the range was erased successfully; -* - ESP_ERR_INVALID_ARG, if iterator or dst are NULL; -* - ESP_ERR_INVALID_SIZE, if erase would go out of bounds of the partition; -* - or one of error codes from lower-level flash driver. -*/ -esp_err_t wl_erase_range(wl_handle_t handle, size_t start_addr, size_t size); - -/** -* @brief Write data to the WL storage -* -* Before writing data to flash, corresponding region of flash needs to be erased. -* This can be done using wl_erase_range function. -* -* @param handle WL handle that are related to the partition -* @param dest_addr Address where the data should be written, relative to the -* beginning of the partition. -* @param src Pointer to the source buffer. Pointer must be non-NULL and -* buffer must be at least 'size' bytes long. -* @param size Size of data to be written, in bytes. -* -* @note Prior to writing to WL storage, make sure it has been erased with -* wl_erase_range call. -* -* @return -* - ESP_OK, if data was written successfully; -* - ESP_ERR_INVALID_ARG, if dst_offset exceeds partition size; -* - ESP_ERR_INVALID_SIZE, if write would go out of bounds of the partition; -* - or one of error codes from lower-level flash driver. -*/ -esp_err_t wl_write(wl_handle_t handle, size_t dest_addr, const void *src, size_t size); - -/** -* @brief Read data from the WL storage -* -* @param handle WL module instance that was initialized before -* @param dest Pointer to the buffer where data should be stored. -* Pointer must be non-NULL and buffer must be at least 'size' bytes long. -* @param src_addr Address of the data to be read, relative to the -* beginning of the partition. -* @param size Size of data to be read, in bytes. -* -* @return -* - ESP_OK, if data was read successfully; -* - ESP_ERR_INVALID_ARG, if src_offset exceeds partition size; -* - ESP_ERR_INVALID_SIZE, if read would go out of bounds of the partition; -* - or one of error codes from lower-level flash driver. -*/ -esp_err_t wl_read(wl_handle_t handle, size_t src_addr, void *dest, size_t size); - -/** -* @brief Get size of the WL storage -* -* @param handle WL module handle that was initialized before -* @return usable size, in bytes -*/ -size_t wl_size(wl_handle_t handle); - -/** -* @brief Get sector size of the WL instance -* -* @param handle WL module handle that was initialized before -* @return sector size, in bytes -*/ -size_t wl_sector_size(wl_handle_t handle); - - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _wear_levelling_H_ diff --git a/tools/sdk/include/wifi_provisioning/wifi_provisioning/wifi_config.h b/tools/sdk/include/wifi_provisioning/wifi_provisioning/wifi_config.h deleted file mode 100644 index 2fa64448d49..00000000000 --- a/tools/sdk/include/wifi_provisioning/wifi_provisioning/wifi_config.h +++ /dev/null @@ -1,144 +0,0 @@ -// 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. - -#ifndef _WIFI_PROV_CONFIG_H_ -#define _WIFI_PROV_CONFIG_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief WiFi STA status for conveying back to the provisioning master - */ -typedef enum { - WIFI_PROV_STA_CONNECTING, - WIFI_PROV_STA_CONNECTED, - WIFI_PROV_STA_DISCONNECTED -} wifi_prov_sta_state_t; - -/** - * @brief WiFi STA connection fail reason - */ -typedef enum { - WIFI_PROV_STA_AUTH_ERROR, - WIFI_PROV_STA_AP_NOT_FOUND -} wifi_prov_sta_fail_reason_t; - -/** - * @brief WiFi STA connected status information - */ -typedef struct { - /** - * IP Address received by station - */ - char ip_addr[IP4ADDR_STRLEN_MAX]; - - char bssid[6]; /*!< BSSID of the AP to which connection was estalished */ - char ssid[33]; /*!< SSID of the to which connection was estalished */ - uint8_t channel; /*!< Channel of the AP */ - uint8_t auth_mode; /*!< Authorization mode of the AP */ -} wifi_prov_sta_conn_info_t; - -/** - * @brief WiFi status data to be sent in response to `get_status` request from master - */ -typedef struct { - wifi_prov_sta_state_t wifi_state; /*!< WiFi state of the station */ - union { - /** - * Reason for disconnection (valid only when `wifi_state` is `WIFI_STATION_DISCONNECTED`) - */ - wifi_prov_sta_fail_reason_t fail_reason; - - /** - * Connection information (valid only when `wifi_state` is `WIFI_STATION_CONNECTED`) - */ - wifi_prov_sta_conn_info_t conn_info; - }; -} wifi_prov_config_get_data_t; - -/** - * @brief WiFi config data received by slave during `set_config` request from master - */ -typedef struct { - char ssid[33]; /*!< SSID of the AP to which the slave is to be connected */ - char password[64]; /*!< Password of the AP */ - char bssid[6]; /*!< BSSID of the AP */ - uint8_t channel; /*!< Channel of the AP */ -} wifi_prov_config_set_data_t; - -/** - * @brief Type of context data passed to each get/set/apply handler - * function set in `wifi_prov_config_handlers` structure. - * - * This is passed as an opaque pointer, thereby allowing it be defined - * later in application code as per requirements. - */ -typedef struct wifi_prov_ctx wifi_prov_ctx_t; - -/** - * @brief Internal handlers for receiving and responding to protocomm - * requests from master - * - * This is to be passed as priv_data for protocomm request handler - * (refer to `wifi_prov_config_data_handler()`) when calling `protocomm_add_endpoint()`. - */ -typedef struct wifi_prov_config_handlers { - /** - * Handler function called when connection status - * of the slave (in WiFi station mode) is requested - */ - esp_err_t (*get_status_handler)(wifi_prov_config_get_data_t *resp_data, - wifi_prov_ctx_t **ctx); - - /** - * Handler function called when WiFi connection configuration - * (eg. AP SSID, password, etc.) of the slave (in WiFi station mode) - * is to be set to user provided values - */ - esp_err_t (*set_config_handler)(const wifi_prov_config_set_data_t *req_data, - wifi_prov_ctx_t **ctx); - - /** - * Handler function for applying the configuration that was set in - * `set_config_handler`. After applying the station may get connected to - * the AP or may fail to connect. The slave must be ready to convey the - * updated connection status information when `get_status_handler` is - * invoked again by the master. - */ - esp_err_t (*apply_config_handler)(wifi_prov_ctx_t **ctx); - - /** - * Context pointer to be passed to above handler functions upon invocation - */ - wifi_prov_ctx_t *ctx; -} wifi_prov_config_handlers_t; - -/** - * @brief Handler for receiving and responding to requests from master - * - * This is to be registered as the `wifi_config` endpoint handler - * (protocomm `protocomm_req_handler_t`) using `protocomm_add_endpoint()` - */ -esp_err_t wifi_prov_config_data_handler(uint32_t session_id, const uint8_t *inbuf, ssize_t inlen, - uint8_t **outbuf, ssize_t *outlen, void *priv_data); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/include/wpa_supplicant/byteswap.h b/tools/sdk/include/wpa_supplicant/byteswap.h deleted file mode 100644 index 1a8bb8fd158..00000000000 --- a/tools/sdk/include/wpa_supplicant/byteswap.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2010 Espressif System - */ - -#ifndef BYTESWAP_H -#define BYTESWAP_H - -/* Swap bytes in 16 bit value. */ -#ifdef __GNUC__ -# define __bswap_16(x) \ - (__extension__ \ - ({ unsigned short int __bsx = (x); \ - ((((__bsx) >> 8) & 0xff) | (((__bsx) & 0xff) << 8)); })) -#else -static INLINE unsigned short int -__bswap_16 (unsigned short int __bsx) -{ - return ((((__bsx) >> 8) & 0xff) | (((__bsx) & 0xff) << 8)); -} -#endif - -/* Swap bytes in 32 bit value. */ -#ifdef __GNUC__ -# define __bswap_32(x) \ - (__extension__ \ - ({ unsigned int __bsx = (x); \ - ((((__bsx) & 0xff000000) >> 24) | (((__bsx) & 0x00ff0000) >> 8) | \ - (((__bsx) & 0x0000ff00) << 8) | (((__bsx) & 0x000000ff) << 24)); })) -#else -static INLINE unsigned int -__bswap_32 (unsigned int __bsx) -{ - return ((((__bsx) & 0xff000000) >> 24) | (((__bsx) & 0x00ff0000) >> 8) | - (((__bsx) & 0x0000ff00) << 8) | (((__bsx) & 0x000000ff) << 24)); -} -#endif - -#if defined __GNUC__ && __GNUC__ >= 2 -/* Swap bytes in 64 bit value. */ -# define __bswap_constant_64(x) \ - ((((x) & 0xff00000000000000ull) >> 56) \ - | (((x) & 0x00ff000000000000ull) >> 40) \ - | (((x) & 0x0000ff0000000000ull) >> 24) \ - | (((x) & 0x000000ff00000000ull) >> 8) \ - | (((x) & 0x00000000ff000000ull) << 8) \ - | (((x) & 0x0000000000ff0000ull) << 24) \ - | (((x) & 0x000000000000ff00ull) << 40) \ - | (((x) & 0x00000000000000ffull) << 56)) - -# define __bswap_64(x) \ - (__extension__ \ - ({ union { __extension__ unsigned long long int __ll; \ - unsigned int __l[2]; } __w, __r; \ - if (__builtin_constant_p (x)) \ - __r.__ll = __bswap_constant_64 (x); \ - else \ - { \ - __w.__ll = (x); \ - __r.__l[0] = __bswap_32 (__w.__l[1]); \ - __r.__l[1] = __bswap_32 (__w.__l[0]); \ - } \ - __r.__ll; })) -#endif - -#endif /* BYTESWAP_H */ diff --git a/tools/sdk/include/wpa_supplicant/crypto/aes.h b/tools/sdk/include/wpa_supplicant/crypto/aes.h deleted file mode 100644 index ba384a9dae3..00000000000 --- a/tools/sdk/include/wpa_supplicant/crypto/aes.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * AES functions - * Copyright (c) 2003-2006, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef AES_H -#define AES_H - -#define AES_BLOCK_SIZE 16 - -void * aes_encrypt_init(const u8 *key, size_t len); -void aes_encrypt(void *ctx, const u8 *plain, u8 *crypt); -void aes_encrypt_deinit(void *ctx); -void * aes_decrypt_init(const u8 *key, size_t len); -void aes_decrypt(void *ctx, const u8 *crypt, u8 *plain); -void aes_decrypt_deinit(void *ctx); - -#endif /* AES_H */ diff --git a/tools/sdk/include/wpa_supplicant/crypto/aes_i.h b/tools/sdk/include/wpa_supplicant/crypto/aes_i.h deleted file mode 100644 index 1063422a810..00000000000 --- a/tools/sdk/include/wpa_supplicant/crypto/aes_i.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - * AES (Rijndael) cipher - * Copyright (c) 2003-2005, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef AES_I_H -#define AES_I_H - -#include "aes.h" - -/* #define FULL_UNROLL */ -#define AES_SMALL_TABLES - -extern const u32 Te0[256]; -extern const u32 Te1[256]; -extern const u32 Te2[256]; -extern const u32 Te3[256]; -extern const u32 Te4[256]; -extern const u32 Td0[256]; -extern const u32 Td1[256]; -extern const u32 Td2[256]; -extern const u32 Td3[256]; -extern const u32 Td4[256]; -extern const u32 rcon[10]; -extern const u8 Td4s[256]; -extern const u8 rcons[10]; - -#ifndef AES_SMALL_TABLES - -#define RCON(i) rcon[(i)] - -#define TE0(i) Te0[((i) >> 24) & 0xff] -#define TE1(i) Te1[((i) >> 16) & 0xff] -#define TE2(i) Te2[((i) >> 8) & 0xff] -#define TE3(i) Te3[(i) & 0xff] -#define TE41(i) (Te4[((i) >> 24) & 0xff] & 0xff000000) -#define TE42(i) (Te4[((i) >> 16) & 0xff] & 0x00ff0000) -#define TE43(i) (Te4[((i) >> 8) & 0xff] & 0x0000ff00) -#define TE44(i) (Te4[(i) & 0xff] & 0x000000ff) -#define TE421(i) (Te4[((i) >> 16) & 0xff] & 0xff000000) -#define TE432(i) (Te4[((i) >> 8) & 0xff] & 0x00ff0000) -#define TE443(i) (Te4[(i) & 0xff] & 0x0000ff00) -#define TE414(i) (Te4[((i) >> 24) & 0xff] & 0x000000ff) -#define TE411(i) (Te4[((i) >> 24) & 0xff] & 0xff000000) -#define TE422(i) (Te4[((i) >> 16) & 0xff] & 0x00ff0000) -#define TE433(i) (Te4[((i) >> 8) & 0xff] & 0x0000ff00) -#define TE444(i) (Te4[(i) & 0xff] & 0x000000ff) -#define TE4(i) (Te4[(i)] & 0x000000ff) - -#define TD0(i) Td0[((i) >> 24) & 0xff] -#define TD1(i) Td1[((i) >> 16) & 0xff] -#define TD2(i) Td2[((i) >> 8) & 0xff] -#define TD3(i) Td3[(i) & 0xff] -#define TD41(i) (Td4[((i) >> 24) & 0xff] & 0xff000000) -#define TD42(i) (Td4[((i) >> 16) & 0xff] & 0x00ff0000) -#define TD43(i) (Td4[((i) >> 8) & 0xff] & 0x0000ff00) -#define TD44(i) (Td4[(i) & 0xff] & 0x000000ff) -#define TD0_(i) Td0[(i) & 0xff] -#define TD1_(i) Td1[(i) & 0xff] -#define TD2_(i) Td2[(i) & 0xff] -#define TD3_(i) Td3[(i) & 0xff] - -#else /* AES_SMALL_TABLES */ - -#define RCON(i) (rcons[(i)] << 24) - -static inline u32 rotr(u32 val, int bits) -{ - return (val >> bits) | (val << (32 - bits)); -} - -#define TE0(i) Te0[((i) >> 24) & 0xff] -#define TE1(i) rotr(Te0[((i) >> 16) & 0xff], 8) -#define TE2(i) rotr(Te0[((i) >> 8) & 0xff], 16) -#define TE3(i) rotr(Te0[(i) & 0xff], 24) -#define TE41(i) ((Te0[((i) >> 24) & 0xff] << 8) & 0xff000000) -#define TE42(i) (Te0[((i) >> 16) & 0xff] & 0x00ff0000) -#define TE43(i) (Te0[((i) >> 8) & 0xff] & 0x0000ff00) -#define TE44(i) ((Te0[(i) & 0xff] >> 8) & 0x000000ff) -#define TE421(i) ((Te0[((i) >> 16) & 0xff] << 8) & 0xff000000) -#define TE432(i) (Te0[((i) >> 8) & 0xff] & 0x00ff0000) -#define TE443(i) (Te0[(i) & 0xff] & 0x0000ff00) -#define TE414(i) ((Te0[((i) >> 24) & 0xff] >> 8) & 0x000000ff) -#define TE411(i) ((Te0[((i) >> 24) & 0xff] << 8) & 0xff000000) -#define TE422(i) (Te0[((i) >> 16) & 0xff] & 0x00ff0000) -#define TE433(i) (Te0[((i) >> 8) & 0xff] & 0x0000ff00) -#define TE444(i) ((Te0[(i) & 0xff] >> 8) & 0x000000ff) -#define TE4(i) ((Te0[(i)] >> 8) & 0x000000ff) - -#define TD0(i) Td0[((i) >> 24) & 0xff] -#define TD1(i) rotr(Td0[((i) >> 16) & 0xff], 8) -#define TD2(i) rotr(Td0[((i) >> 8) & 0xff], 16) -#define TD3(i) rotr(Td0[(i) & 0xff], 24) -#define TD41(i) (Td4s[((i) >> 24) & 0xff] << 24) -#define TD42(i) (Td4s[((i) >> 16) & 0xff] << 16) -#define TD43(i) (Td4s[((i) >> 8) & 0xff] << 8) -#define TD44(i) (Td4s[(i) & 0xff]) -#define TD0_(i) Td0[(i) & 0xff] -#define TD1_(i) rotr(Td0[(i) & 0xff], 8) -#define TD2_(i) rotr(Td0[(i) & 0xff], 16) -#define TD3_(i) rotr(Td0[(i) & 0xff], 24) - -#endif /* AES_SMALL_TABLES */ - -#ifdef _MSC_VER -#define SWAP(x) (_lrotl(x, 8) & 0x00ff00ff | _lrotr(x, 8) & 0xff00ff00) -#define GETU32(p) SWAP(*((u32 *)(p))) -#define PUTU32(ct, st) { *((u32 *)(ct)) = SWAP((st)); } -#else -#define GETU32(pt) (((u32)(pt)[0] << 24) ^ ((u32)(pt)[1] << 16) ^ \ -((u32)(pt)[2] << 8) ^ ((u32)(pt)[3])) -#define PUTU32(ct, st) { \ -(ct)[0] = (u8)((st) >> 24); (ct)[1] = (u8)((st) >> 16); \ -(ct)[2] = (u8)((st) >> 8); (ct)[3] = (u8)(st); } -#endif - -#define AES_PRIV_SIZE (4 * 4 * 15 + 4) -#define AES_PRIV_NR_POS (4 * 15) - -int rijndaelKeySetupEnc(u32 rk[], const u8 cipherKey[], int keyBits); - -#endif /* AES_I_H */ diff --git a/tools/sdk/include/wpa_supplicant/crypto/aes_wrap.h b/tools/sdk/include/wpa_supplicant/crypto/aes_wrap.h deleted file mode 100644 index 933031e4bad..00000000000 --- a/tools/sdk/include/wpa_supplicant/crypto/aes_wrap.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * AES-based functions - * - * - AES Key Wrap Algorithm (128-bit KEK) (RFC3394) - * - One-Key CBC MAC (OMAC1) hash with AES-128 - * - AES-128 CTR mode encryption - * - AES-128 EAX mode encryption/decryption - * - AES-128 CBC - * - * Copyright (c) 2003-2007, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef AES_WRAP_H -#define AES_WRAP_H - -int __must_check aes_wrap(const u8 *kek, int n, const u8 *plain, u8 *cipher); -int __must_check aes_unwrap(const u8 *kek, int n, const u8 *cipher, u8 *plain); -int __must_check omac1_aes_128_vector(const u8 *key, size_t num_elem, - const u8 *addr[], const size_t *len, - u8 *mac); -int __must_check omac1_aes_128(const u8 *key, const u8 *data, size_t data_len, - u8 *mac); -int __must_check aes_128_encrypt_block(const u8 *key, const u8 *in, u8 *out); -int __must_check aes_128_ctr_encrypt(const u8 *key, const u8 *nonce, - u8 *data, size_t data_len); -int __must_check aes_128_eax_encrypt(const u8 *key, - const u8 *nonce, size_t nonce_len, - const u8 *hdr, size_t hdr_len, - u8 *data, size_t data_len, u8 *tag); -int __must_check aes_128_eax_decrypt(const u8 *key, - const u8 *nonce, size_t nonce_len, - const u8 *hdr, size_t hdr_len, - u8 *data, size_t data_len, const u8 *tag); -int __must_check aes_128_cbc_encrypt(const u8 *key, const u8 *iv, u8 *data, - size_t data_len); -int __must_check aes_128_cbc_decrypt(const u8 *key, const u8 *iv, u8 *data, - size_t data_len); -int __must_check fast_aes_wrap(const uint8_t *kek, int n, const uint8_t *plain, uint8_t *cipher); -int __must_check fast_aes_unwrap(const uint8_t *kek, int n, const uint8_t *cipher, uint8_t *plain); -int __must_check fast_aes_128_cbc_encrypt(const uint8_t *key, const uint8_t *iv, uint8_t *data, - size_t data_len); -int __must_check fast_aes_128_cbc_decrypt(const uint8_t *key, const uint8_t *iv, uint8_t *data, - size_t data_len); -#endif /* AES_WRAP_H */ diff --git a/tools/sdk/include/wpa_supplicant/crypto/base64.h b/tools/sdk/include/wpa_supplicant/crypto/base64.h deleted file mode 100644 index b87a1682f8d..00000000000 --- a/tools/sdk/include/wpa_supplicant/crypto/base64.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Base64 encoding/decoding (RFC1341) - * Copyright (c) 2005, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef BASE64_H -#define BASE64_H - -unsigned char * base64_encode(const unsigned char *src, size_t len, - size_t *out_len); -unsigned char * base64_decode(const unsigned char *src, size_t len, - size_t *out_len); - -#endif /* BASE64_H */ diff --git a/tools/sdk/include/wpa_supplicant/crypto/common.h b/tools/sdk/include/wpa_supplicant/crypto/common.h deleted file mode 100644 index 319b861e45d..00000000000 --- a/tools/sdk/include/wpa_supplicant/crypto/common.h +++ /dev/null @@ -1,481 +0,0 @@ -/* - * wpa_supplicant/hostapd / common helper functions, etc. - * Copyright (c) 2002-2007, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef COMMON_H -#define COMMON_H - -#include "os.h" - -#if defined(__XTENSA__) -#include -#define __BYTE_ORDER BYTE_ORDER -#define __LITTLE_ENDIAN LITTLE_ENDIAN -#define __BIG_ENDIAN BIG_ENDIAN -#endif /*__XTENSA__*/ - -#if defined(__linux__) || defined(__GLIBC__) -#include -#include -#endif /* __linux__ */ - -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || \ - defined(__OpenBSD__) -#include -#include -#define __BYTE_ORDER _BYTE_ORDER -#define __LITTLE_ENDIAN _LITTLE_ENDIAN -#define __BIG_ENDIAN _BIG_ENDIAN -#ifdef __OpenBSD__ -#define bswap_16 swap16 -#define bswap_32 swap32 -#define bswap_64 swap64 -#else /* __OpenBSD__ */ -#define bswap_16 bswap16 -#define bswap_32 bswap32 -#define bswap_64 bswap64 -#endif /* __OpenBSD__ */ -#endif /* defined(__FreeBSD__) || defined(__NetBSD__) || - * defined(__DragonFly__) || defined(__OpenBSD__) */ - -#ifdef __APPLE__ -#include -#include -#define __BYTE_ORDER _BYTE_ORDER -#define __LITTLE_ENDIAN _LITTLE_ENDIAN -#define __BIG_ENDIAN _BIG_ENDIAN -static inline unsigned short bswap_16(unsigned short v) -{ - return ((v & 0xff) << 8) | (v >> 8); -} - -static inline unsigned int bswap_32(unsigned int v) -{ - return ((v & 0xff) << 24) | ((v & 0xff00) << 8) | - ((v & 0xff0000) >> 8) | (v >> 24); -} -#endif /* __APPLE__ */ - -#ifdef CONFIG_TI_COMPILER -#define __BIG_ENDIAN 4321 -#define __LITTLE_ENDIAN 1234 -#ifdef __big_endian__ -#define __BYTE_ORDER __BIG_ENDIAN -#else -#define __BYTE_ORDER __LITTLE_ENDIAN -#endif -#endif /* CONFIG_TI_COMPILER */ - -#ifdef __SYMBIAN32__ -#define __BIG_ENDIAN 4321 -#define __LITTLE_ENDIAN 1234 -#define __BYTE_ORDER __LITTLE_ENDIAN -#endif /* __SYMBIAN32__ */ - -#ifdef CONFIG_NATIVE_WINDOWS -#include - -typedef int socklen_t; - -#ifndef MSG_DONTWAIT -#define MSG_DONTWAIT 0 /* not supported */ -#endif - -#endif /* CONFIG_NATIVE_WINDOWS */ - -#ifdef _MSC_VER -#define inline __inline - -#undef vsnprintf -#define vsnprintf _vsnprintf -#undef close -#define close closesocket -#endif /* _MSC_VER */ - - -/* Define platform specific integer types */ - -#ifdef _MSC_VER -typedef UINT64 u64; -typedef UINT32 u32; -typedef UINT16 u16; -typedef UINT8 u8; -typedef INT64 s64; -typedef INT32 s32; -typedef INT16 s16; -typedef INT8 s8; -#define WPA_TYPES_DEFINED -#endif /* _MSC_VER */ - -#ifdef __vxworks -typedef unsigned long long u64; -typedef UINT32 u32; -typedef UINT16 u16; -typedef UINT8 u8; -typedef long long s64; -typedef INT32 s32; -typedef INT16 s16; -typedef INT8 s8; -#define WPA_TYPES_DEFINED -#endif /* __vxworks */ - -#ifdef CONFIG_TI_COMPILER -#ifdef _LLONG_AVAILABLE -typedef unsigned long long u64; -#else -/* - * TODO: 64-bit variable not available. Using long as a workaround to test the - * build, but this will likely not work for all operations. - */ -typedef unsigned long u64; -#endif -typedef unsigned int u32; -typedef unsigned short u16; -typedef unsigned char u8; -#define WPA_TYPES_DEFINED -#endif /* CONFIG_TI_COMPILER */ - -#ifdef __SYMBIAN32__ -#define __REMOVE_PLATSEC_DIAGNOSTICS__ -#include -typedef TUint64 u64; -typedef TUint32 u32; -typedef TUint16 u16; -typedef TUint8 u8; -#define WPA_TYPES_DEFINED -#endif /* __SYMBIAN32__ */ - -#ifndef WPA_TYPES_DEFINED -#ifdef CONFIG_USE_INTTYPES_H -#include -#else -#include -#endif - -typedef uint64_t u64; -typedef uint32_t u32; -typedef uint16_t u16; -typedef uint8_t u8; -typedef int64_t s64; -typedef int32_t s32; -typedef int16_t s16; -typedef int8_t s8; -#define WPA_TYPES_DEFINED -#endif /* !WPA_TYPES_DEFINED */ - - -/* Define platform specific byte swapping macros */ - -#if defined(__CYGWIN__) || defined(CONFIG_NATIVE_WINDOWS) - -static inline unsigned short wpa_swap_16(unsigned short v) -{ - return ((v & 0xff) << 8) | (v >> 8); -} - -static inline unsigned int wpa_swap_32(unsigned int v) -{ - return ((v & 0xff) << 24) | ((v & 0xff00) << 8) | - ((v & 0xff0000) >> 8) | (v >> 24); -} - -#define le_to_host16(n) (n) -#define host_to_le16(n) (n) -#define be_to_host16(n) wpa_swap_16(n) -#define host_to_be16(n) wpa_swap_16(n) -#define le_to_host32(n) (n) -#define be_to_host32(n) wpa_swap_32(n) -#define host_to_be32(n) wpa_swap_32(n) - -#define WPA_BYTE_SWAP_DEFINED - -#endif /* __CYGWIN__ || CONFIG_NATIVE_WINDOWS */ - - -#ifndef WPA_BYTE_SWAP_DEFINED - -#ifndef __BYTE_ORDER -#ifndef __LITTLE_ENDIAN -#ifndef __BIG_ENDIAN -#define __LITTLE_ENDIAN 1234 -#define __BIG_ENDIAN 4321 -#if defined(sparc) -#define __BYTE_ORDER __BIG_ENDIAN -#endif -#endif /* __BIG_ENDIAN */ -#endif /* __LITTLE_ENDIAN */ -#endif /* __BYTE_ORDER */ - -#if __BYTE_ORDER == __LITTLE_ENDIAN -#define le_to_host16(n) ((__force u16) (le16) (n)) -#define host_to_le16(n) ((__force le16) (u16) (n)) -#define be_to_host16(n) bswap_16((__force u16) (be16) (n)) -#define host_to_be16(n) ((__force be16) bswap_16((n))) -#define le_to_host32(n) ((__force u32) (le32) (n)) -#define host_to_le32(n) ((__force le32) (u32) (n)) -#define be_to_host32(n) bswap_32((__force u32) (be32) (n)) -#define host_to_be32(n) ((__force be32) bswap_32((n))) -#define le_to_host64(n) ((__force u64) (le64) (n)) -#define host_to_le64(n) ((__force le64) (u64) (n)) -#define be_to_host64(n) bswap_64((__force u64) (be64) (n)) -#define host_to_be64(n) ((__force be64) bswap_64((n))) -#elif __BYTE_ORDER == __BIG_ENDIAN -#define le_to_host16(n) bswap_16(n) -#define host_to_le16(n) bswap_16(n) -#define be_to_host16(n) (n) -#define host_to_be16(n) (n) -#define le_to_host32(n) bswap_32(n) -#define be_to_host32(n) (n) -#define host_to_be32(n) (n) -#define le_to_host64(n) bswap_64(n) -#define host_to_le64(n) bswap_64(n) -#define be_to_host64(n) (n) -#define host_to_be64(n) (n) -#ifndef WORDS_BIGENDIAN -#define WORDS_BIGENDIAN -#endif -#else -#error Could not determine CPU byte order -#endif - -#define WPA_BYTE_SWAP_DEFINED -#endif /* !WPA_BYTE_SWAP_DEFINED */ - - -/* Macros for handling unaligned memory accesses */ - -#define WPA_GET_BE16(a) ((u16) (((a)[0] << 8) | (a)[1])) -#define WPA_PUT_BE16(a, val) \ - do { \ - (a)[0] = ((u16) (val)) >> 8; \ - (a)[1] = ((u16) (val)) & 0xff; \ - } while (0) - -#define WPA_GET_LE16(a) ((u16) (((a)[1] << 8) | (a)[0])) -#define WPA_PUT_LE16(a, val) \ - do { \ - (a)[1] = ((u16) (val)) >> 8; \ - (a)[0] = ((u16) (val)) & 0xff; \ - } while (0) - -#define WPA_GET_BE24(a) ((((u32) (a)[0]) << 16) | (((u32) (a)[1]) << 8) | \ - ((u32) (a)[2])) -#define WPA_PUT_BE24(a, val) \ - do { \ - (a)[0] = (u8) ((((u32) (val)) >> 16) & 0xff); \ - (a)[1] = (u8) ((((u32) (val)) >> 8) & 0xff); \ - (a)[2] = (u8) (((u32) (val)) & 0xff); \ - } while (0) - -#define WPA_GET_BE32(a) ((((u32) (a)[0]) << 24) | (((u32) (a)[1]) << 16) | \ - (((u32) (a)[2]) << 8) | ((u32) (a)[3])) -#define WPA_PUT_BE32(a, val) \ - do { \ - (a)[0] = (u8) ((((u32) (val)) >> 24) & 0xff); \ - (a)[1] = (u8) ((((u32) (val)) >> 16) & 0xff); \ - (a)[2] = (u8) ((((u32) (val)) >> 8) & 0xff); \ - (a)[3] = (u8) (((u32) (val)) & 0xff); \ - } while (0) - -#define WPA_GET_LE32(a) ((((u32) (a)[3]) << 24) | (((u32) (a)[2]) << 16) | \ - (((u32) (a)[1]) << 8) | ((u32) (a)[0])) -#define WPA_PUT_LE32(a, val) \ - do { \ - (a)[3] = (u8) ((((u32) (val)) >> 24) & 0xff); \ - (a)[2] = (u8) ((((u32) (val)) >> 16) & 0xff); \ - (a)[1] = (u8) ((((u32) (val)) >> 8) & 0xff); \ - (a)[0] = (u8) (((u32) (val)) & 0xff); \ - } while (0) - -#define WPA_GET_BE64(a) ((((u64) (a)[0]) << 56) | (((u64) (a)[1]) << 48) | \ - (((u64) (a)[2]) << 40) | (((u64) (a)[3]) << 32) | \ - (((u64) (a)[4]) << 24) | (((u64) (a)[5]) << 16) | \ - (((u64) (a)[6]) << 8) | ((u64) (a)[7])) -#define WPA_PUT_BE64(a, val) \ - do { \ - (a)[0] = (u8) (((u64) (val)) >> 56); \ - (a)[1] = (u8) (((u64) (val)) >> 48); \ - (a)[2] = (u8) (((u64) (val)) >> 40); \ - (a)[3] = (u8) (((u64) (val)) >> 32); \ - (a)[4] = (u8) (((u64) (val)) >> 24); \ - (a)[5] = (u8) (((u64) (val)) >> 16); \ - (a)[6] = (u8) (((u64) (val)) >> 8); \ - (a)[7] = (u8) (((u64) (val)) & 0xff); \ - } while (0) - -#define WPA_GET_LE64(a) ((((u64) (a)[7]) << 56) | (((u64) (a)[6]) << 48) | \ - (((u64) (a)[5]) << 40) | (((u64) (a)[4]) << 32) | \ - (((u64) (a)[3]) << 24) | (((u64) (a)[2]) << 16) | \ - (((u64) (a)[1]) << 8) | ((u64) (a)[0])) - - -#ifndef ETH_ALEN -#define ETH_ALEN 6 -#endif -#ifndef IFNAMSIZ -#define IFNAMSIZ 16 -#endif -#ifndef ETH_P_ALL -#define ETH_P_ALL 0x0003 -#endif -#ifndef ETH_P_PAE -#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ -#endif /* ETH_P_PAE */ -#ifndef ETH_P_EAPOL -#define ETH_P_EAPOL ETH_P_PAE -#endif /* ETH_P_EAPOL */ -#ifndef ETH_P_RSN_PREAUTH -#define ETH_P_RSN_PREAUTH 0x88c7 -#endif /* ETH_P_RSN_PREAUTH */ -#ifndef ETH_P_RRB -#define ETH_P_RRB 0x890D -#endif /* ETH_P_RRB */ - - -#ifdef __GNUC__ -#define PRINTF_FORMAT(a,b) __attribute__ ((format (printf, (a), (b)))) -#define STRUCT_PACKED __attribute__ ((packed)) -#else -#define PRINTF_FORMAT(a,b) -#define STRUCT_PACKED -#endif - -#ifdef CONFIG_ANSI_C_EXTRA - -#if !defined(_MSC_VER) || _MSC_VER < 1400 -/* snprintf - used in number of places; sprintf() is _not_ a good replacement - * due to possible buffer overflow; see, e.g., - * http://www.ijs.si/software/snprintf/ for portable implementation of - * snprintf. */ -int snprintf(char *str, size_t size, const char *format, ...); - -/* vsnprintf - only used for wpa_msg() in wpa_supplicant.c */ -int vsnprintf(char *str, size_t size, const char *format, va_list ap); -#endif /* !defined(_MSC_VER) || _MSC_VER < 1400 */ - -/* getopt - only used in main.c */ -int getopt(int argc, char *const argv[], const char *optstring); -extern char *optarg; -extern int optind; - -#ifndef CONFIG_NO_SOCKLEN_T_TYPEDEF -#ifndef __socklen_t_defined -typedef int socklen_t; -#endif -#endif - -/* inline - define as __inline or just define it to be empty, if needed */ -#ifdef CONFIG_NO_INLINE -#define inline -#else -#define inline __inline -#endif - -#ifndef __func__ -#define __func__ "__func__ not defined" -#endif - -#ifndef bswap_16 -#define bswap_16(a) ((((u16) (a) << 8) & 0xff00) | (((u16) (a) >> 8) & 0xff)) -#endif - -#ifndef bswap_32 -#define bswap_32(a) ((((u32) (a) << 24) & 0xff000000) | \ - (((u32) (a) << 8) & 0xff0000) | \ - (((u32) (a) >> 8) & 0xff00) | \ - (((u32) (a) >> 24) & 0xff)) -#endif - -#ifndef MSG_DONTWAIT -#define MSG_DONTWAIT 0 -#endif - -#ifdef _WIN32_WCE -void perror(const char *s); -#endif /* _WIN32_WCE */ - -#endif /* CONFIG_ANSI_C_EXTRA */ - -#ifndef MAC2STR -#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] -#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x" -#endif - -#ifndef BIT -#define BIT(x) (1 << (x)) -#endif - -/* - * Definitions for sparse validation - * (http://kernel.org/pub/linux/kernel/people/josh/sparse/) - */ -#ifdef __CHECKER__ -#define __force __attribute__((force)) -#define __bitwise __attribute__((bitwise)) -#else -#define __force -#define __bitwise -#endif - -typedef u16 __bitwise be16; -typedef u16 __bitwise le16; -typedef u32 __bitwise be32; -typedef u32 __bitwise le32; -typedef u64 __bitwise be64; -typedef u64 __bitwise le64; - -#ifndef __must_check -#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -#define __must_check __attribute__((__warn_unused_result__)) -#else -#define __must_check -#endif /* __GNUC__ */ -#endif /* __must_check */ - -int hwaddr_aton(const char *txt, u8 *addr); -int hwaddr_aton2(const char *txt, u8 *addr); -int hexstr2bin(const char *hex, u8 *buf, size_t len); -void inc_byte_array(u8 *counter, size_t len); -void wpa_get_ntp_timestamp(u8 *buf); -int wpa_snprintf_hex(char *buf, size_t buf_size, const u8 *data, size_t len); -int wpa_snprintf_hex_uppercase(char *buf, size_t buf_size, const u8 *data, - size_t len); - -#ifdef CONFIG_NATIVE_WINDOWS -void wpa_unicode2ascii_inplace(TCHAR *str); -TCHAR * wpa_strdup_tchar(const char *str); -#else /* CONFIG_NATIVE_WINDOWS */ -#define wpa_unicode2ascii_inplace(s) do { } while (0) -#define wpa_strdup_tchar(s) strdup((s)) -#endif /* CONFIG_NATIVE_WINDOWS */ - -const char * wpa_ssid_txt(const u8 *ssid, size_t ssid_len); - -static inline int is_zero_ether_addr(const u8 *a) -{ - return !(a[0] | a[1] | a[2] | a[3] | a[4] | a[5]); -} - -/* - * gcc 4.4 ends up generating strict-aliasing warnings about some very common - * networking socket uses that do not really result in a real problem and - * cannot be easily avoided with union-based type-punning due to struct - * definitions including another struct in system header files. To avoid having - * to fully disable strict-aliasing warnings, provide a mechanism to hide the - * typecast from aliasing for now. A cleaner solution will hopefully be found - * in the future to handle these cases. - */ -void * __hide_aliasing_typecast(void *foo); -#define aliasing_hide_typecast(a,t) (t *) __hide_aliasing_typecast((a)) - -#endif /* COMMON_H */ diff --git a/tools/sdk/include/wpa_supplicant/crypto/crypto.h b/tools/sdk/include/wpa_supplicant/crypto/crypto.h deleted file mode 100644 index f6b7b2f2c49..00000000000 --- a/tools/sdk/include/wpa_supplicant/crypto/crypto.h +++ /dev/null @@ -1,968 +0,0 @@ -/* - * WPA Supplicant / wrapper functions for crypto libraries - * Copyright (c) 2004-2009, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - * - * This file defines the cryptographic functions that need to be implemented - * for wpa_supplicant and hostapd. When TLS is not used, internal - * implementation of MD5, SHA1, and AES is used and no external libraries are - * required. When TLS is enabled (e.g., by enabling EAP-TLS or EAP-PEAP), the - * crypto library used by the TLS implementation is expected to be used for - * non-TLS needs, too, in order to save space by not implementing these - * functions twice. - * - * Wrapper code for using each crypto library is in its own file (crypto*.c) - * and one of these files is build and linked in to provide the functions - * defined here. - */ - -#ifndef CRYPTO_H -#define CRYPTO_H - -#include "common.h" - -/** - * md4_vector - MD4 hash for data vector - * @num_elem: Number of elements in the data vector - * @addr: Pointers to the data areas - * @len: Lengths of the data blocks - * @mac: Buffer for the hash - * Returns: 0 on success, -1 on failure - */ -int md4_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac); - -/** - * md5_vector - MD5 hash for data vector - * @num_elem: Number of elements in the data vector - * @addr: Pointers to the data areas - * @len: Lengths of the data blocks - * @mac: Buffer for the hash - * Returns: 0 on success, -1 on failure - */ -int md5_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac); - -#ifdef CONFIG_FIPS -/** - * md5_vector_non_fips_allow - MD5 hash for data vector (non-FIPS use allowed) - * @num_elem: Number of elements in the data vector - * @addr: Pointers to the data areas - * @len: Lengths of the data blocks - * @mac: Buffer for the hash - * Returns: 0 on success, -1 on failure - */ -int md5_vector_non_fips_allow(size_t num_elem, const u8 *addr[], - const size_t *len, u8 *mac); -#else /* CONFIG_FIPS */ -#define md5_vector_non_fips_allow md5_vector -#endif /* CONFIG_FIPS */ - - -/** - * sha1_vector - SHA-1 hash for data vector - * @num_elem: Number of elements in the data vector - * @addr: Pointers to the data areas - * @len: Lengths of the data blocks - * @mac: Buffer for the hash - * Returns: 0 on success, -1 on failure - */ -int sha1_vector(size_t num_elem, const u8 *addr[], const size_t *len, - u8 *mac); - -/** - * fips186_2-prf - NIST FIPS Publication 186-2 change notice 1 PRF - * @seed: Seed/key for the PRF - * @seed_len: Seed length in bytes - * @x: Buffer for PRF output - * @xlen: Output length in bytes - * Returns: 0 on success, -1 on failure - * - * This function implements random number generation specified in NIST FIPS - * Publication 186-2 for EAP-SIM. This PRF uses a function that is similar to - * SHA-1, but has different message padding. - */ -int __must_check fips186_2_prf(const u8 *seed, size_t seed_len, u8 *x, - size_t xlen); - -/** - * sha256_vector - SHA256 hash for data vector - * @num_elem: Number of elements in the data vector - * @addr: Pointers to the data areas - * @len: Lengths of the data blocks - * @mac: Buffer for the hash - * Returns: 0 on success, -1 on failure - */ -int sha256_vector(size_t num_elem, const u8 *addr[], const size_t *len, - u8 *mac); - -/** - * fast_sha256_vector - fast SHA256 hash for data vector - * @num_elem: Number of elements in the data vector - * @addr: Pointers to the data areas - * @len: Lengths of the data blocks - * @mac: Buffer for the hash - * Returns: 0 on success, -1 on failure - */ -int fast_sha256_vector(size_t num_elem, const uint8_t *addr[], const size_t *len, - uint8_t *mac); - -/** - * des_encrypt - Encrypt one block with DES - * @clear: 8 octets (in) - * @key: 7 octets (in) (no parity bits included) - * @cypher: 8 octets (out) - */ -void des_encrypt(const u8 *clear, const u8 *key, u8 *cypher); - -/** - * aes_encrypt_init - Initialize AES for encryption - * @key: Encryption key - * @len: Key length in bytes (usually 16, i.e., 128 bits) - * Returns: Pointer to context data or %NULL on failure - */ -void * aes_encrypt_init(const u8 *key, size_t len); - -/** - * aes_encrypt - Encrypt one AES block - * @ctx: Context pointer from aes_encrypt_init() - * @plain: Plaintext data to be encrypted (16 bytes) - * @crypt: Buffer for the encrypted data (16 bytes) - */ -void aes_encrypt(void *ctx, const u8 *plain, u8 *crypt); - -/** - * aes_encrypt_deinit - Deinitialize AES encryption - * @ctx: Context pointer from aes_encrypt_init() - */ -void aes_encrypt_deinit(void *ctx); - -/** - * aes_decrypt_init - Initialize AES for decryption - * @key: Decryption key - * @len: Key length in bytes (usually 16, i.e., 128 bits) - * Returns: Pointer to context data or %NULL on failure - */ -void * aes_decrypt_init(const u8 *key, size_t len); - -/** - * aes_decrypt - Decrypt one AES block - * @ctx: Context pointer from aes_encrypt_init() - * @crypt: Encrypted data (16 bytes) - * @plain: Buffer for the decrypted data (16 bytes) - */ -void aes_decrypt(void *ctx, const u8 *crypt, u8 *plain); - -/** - * aes_decrypt_deinit - Deinitialize AES decryption - * @ctx: Context pointer from aes_encrypt_init() - */ -void aes_decrypt_deinit(void *ctx); - - -enum crypto_hash_alg { - CRYPTO_HASH_ALG_MD5, CRYPTO_HASH_ALG_SHA1, - CRYPTO_HASH_ALG_HMAC_MD5, CRYPTO_HASH_ALG_HMAC_SHA1, - CRYPTO_HASH_ALG_SHA256, CRYPTO_HASH_ALG_HMAC_SHA256 -}; - -struct crypto_hash; - -/** - * crypto_hash_init - Initialize hash/HMAC function - * @alg: Hash algorithm - * @key: Key for keyed hash (e.g., HMAC) or %NULL if not needed - * @key_len: Length of the key in bytes - * Returns: Pointer to hash context to use with other hash functions or %NULL - * on failure - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -struct crypto_hash * crypto_hash_init(enum crypto_hash_alg alg, const u8 *key, - size_t key_len); - -/** - * fast_crypto_hash_init - Initialize hash/HMAC function - * @alg: Hash algorithm - * @key: Key for keyed hash (e.g., HMAC) or %NULL if not needed - * @key_len: Length of the key in bytes - * Returns: Pointer to hash context to use with other hash functions or %NULL - * on failure - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -struct crypto_hash * fast_crypto_hash_init(enum crypto_hash_alg alg, const uint8_t *key, - size_t key_len); - -/** - * crypto_hash_update - Add data to hash calculation - * @ctx: Context pointer from crypto_hash_init() - * @data: Data buffer to add - * @len: Length of the buffer - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -void crypto_hash_update(struct crypto_hash *ctx, const u8 *data, size_t len); - -/** - * fast_crypto_hash_update - Add data to hash calculation - * @ctx: Context pointer from crypto_hash_init() - * @data: Data buffer to add - * @len: Length of the buffer - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -void fast_crypto_hash_update(struct crypto_hash *ctx, const uint8_t *data, size_t len); - -/** - * crypto_hash_finish - Complete hash calculation - * @ctx: Context pointer from crypto_hash_init() - * @hash: Buffer for hash value or %NULL if caller is just freeing the hash - * context - * @len: Pointer to length of the buffer or %NULL if caller is just freeing the - * hash context; on return, this is set to the actual length of the hash value - * Returns: 0 on success, -1 if buffer is too small (len set to needed length), - * or -2 on other failures (including failed crypto_hash_update() operations) - * - * This function calculates the hash value and frees the context buffer that - * was used for hash calculation. - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -int crypto_hash_finish(struct crypto_hash *ctx, u8 *hash, size_t *len); - -/** - * fast_crypto_hash_finish - Complete hash calculation - * @ctx: Context pointer from crypto_hash_init() - * @hash: Buffer for hash value or %NULL if caller is just freeing the hash - * context - * @len: Pointer to length of the buffer or %NULL if caller is just freeing the - * hash context; on return, this is set to the actual length of the hash value - * Returns: 0 on success, -1 if buffer is too small (len set to needed length), - * or -2 on other failures (including failed crypto_hash_update() operations) - * - * This function calculates the hash value and frees the context buffer that - * was used for hash calculation. - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -int fast_crypto_hash_finish(struct crypto_hash *ctx, uint8_t *hash, size_t *len); - - -enum crypto_cipher_alg { - CRYPTO_CIPHER_NULL = 0, CRYPTO_CIPHER_ALG_AES, CRYPTO_CIPHER_ALG_3DES, - CRYPTO_CIPHER_ALG_DES, CRYPTO_CIPHER_ALG_RC2, CRYPTO_CIPHER_ALG_RC4 -}; - -struct crypto_cipher; - -/** - * crypto_cipher_init - Initialize block/stream cipher function - * @alg: Cipher algorithm - * @iv: Initialization vector for block ciphers or %NULL for stream ciphers - * @key: Cipher key - * @key_len: Length of key in bytes - * Returns: Pointer to cipher context to use with other cipher functions or - * %NULL on failure - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -struct crypto_cipher * crypto_cipher_init(enum crypto_cipher_alg alg, - const u8 *iv, const u8 *key, - size_t key_len); - -/** - * fast_crypto_cipher_init - Initialize block/stream cipher function - * @alg: Cipher algorithm - * @iv: Initialization vector for block ciphers or %NULL for stream ciphers - * @key: Cipher key - * @key_len: Length of key in bytes - * Returns: Pointer to cipher context to use with other cipher functions or - * %NULL on failure - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -struct crypto_cipher * fast_crypto_cipher_init(enum crypto_cipher_alg alg, - const uint8_t *iv, const uint8_t *key, - size_t key_len); -/** - * crypto_cipher_encrypt - Cipher encrypt - * @ctx: Context pointer from crypto_cipher_init() - * @plain: Plaintext to cipher - * @crypt: Resulting ciphertext - * @len: Length of the plaintext - * Returns: 0 on success, -1 on failure - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -int __must_check crypto_cipher_encrypt(struct crypto_cipher *ctx, - const u8 *plain, u8 *crypt, size_t len); - -/** - * fast_crypto_cipher_encrypt - Cipher encrypt - * @ctx: Context pointer from crypto_cipher_init() - * @plain: Plaintext to cipher - * @crypt: Resulting ciphertext - * @len: Length of the plaintext - * Returns: 0 on success, -1 on failure - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -int __must_check fast_crypto_cipher_encrypt(struct crypto_cipher *ctx, - const uint8_t *plain, uint8_t *crypt, size_t len); - -/** - * crypto_cipher_decrypt - Cipher decrypt - * @ctx: Context pointer from crypto_cipher_init() - * @crypt: Ciphertext to decrypt - * @plain: Resulting plaintext - * @len: Length of the cipher text - * Returns: 0 on success, -1 on failure - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -int __must_check crypto_cipher_decrypt(struct crypto_cipher *ctx, - const u8 *crypt, u8 *plain, size_t len); - -/** - * fast_crypto_cipher_decrypt - Cipher decrypt - * @ctx: Context pointer from crypto_cipher_init() - * @crypt: Ciphertext to decrypt - * @plain: Resulting plaintext - * @len: Length of the cipher text - * Returns: 0 on success, -1 on failure - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -int __must_check fast_crypto_cipher_decrypt(struct crypto_cipher *ctx, - const uint8_t *crypt, uint8_t *plain, size_t len); - -/** - * crypto_cipher_decrypt - Free cipher context - * @ctx: Context pointer from crypto_cipher_init() - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -void crypto_cipher_deinit(struct crypto_cipher *ctx); - -/** - * fast_crypto_cipher_decrypt - Free cipher context - * @ctx: Context pointer from crypto_cipher_init() - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -void fast_crypto_cipher_deinit(struct crypto_cipher *ctx); - -struct crypto_public_key; -struct crypto_private_key; - -/** - * crypto_public_key_import - Import an RSA public key - * @key: Key buffer (DER encoded RSA public key) - * @len: Key buffer length in bytes - * Returns: Pointer to the public key or %NULL on failure - * - * This function can just return %NULL if the crypto library supports X.509 - * parsing. In that case, crypto_public_key_from_cert() is used to import the - * public key from a certificate. - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -struct crypto_public_key * crypto_public_key_import(const u8 *key, size_t len); - -/** - * crypto_private_key_import - Import an RSA private key - * @key: Key buffer (DER encoded RSA private key) - * @len: Key buffer length in bytes - * @passwd: Key encryption password or %NULL if key is not encrypted - * Returns: Pointer to the private key or %NULL on failure - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -struct crypto_private_key * crypto_private_key_import(const u8 *key, - size_t len, - const char *passwd); - -/** - * crypto_public_key_from_cert - Import an RSA public key from a certificate - * @buf: DER encoded X.509 certificate - * @len: Certificate buffer length in bytes - * Returns: Pointer to public key or %NULL on failure - * - * This function can just return %NULL if the crypto library does not support - * X.509 parsing. In that case, internal code will be used to parse the - * certificate and public key is imported using crypto_public_key_import(). - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -struct crypto_public_key * crypto_public_key_from_cert(const u8 *buf, - size_t len); - -/** - * crypto_public_key_encrypt_pkcs1_v15 - Public key encryption (PKCS #1 v1.5) - * @key: Public key - * @in: Plaintext buffer - * @inlen: Length of plaintext buffer in bytes - * @out: Output buffer for encrypted data - * @outlen: Length of output buffer in bytes; set to used length on success - * Returns: 0 on success, -1 on failure - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -int __must_check crypto_public_key_encrypt_pkcs1_v15( - struct crypto_public_key *key, const u8 *in, size_t inlen, - u8 *out, size_t *outlen); - -/** - * crypto_private_key_decrypt_pkcs1_v15 - Private key decryption (PKCS #1 v1.5) - * @key: Private key - * @in: Encrypted buffer - * @inlen: Length of encrypted buffer in bytes - * @out: Output buffer for encrypted data - * @outlen: Length of output buffer in bytes; set to used length on success - * Returns: 0 on success, -1 on failure - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -int __must_check crypto_private_key_decrypt_pkcs1_v15( - struct crypto_private_key *key, const u8 *in, size_t inlen, - u8 *out, size_t *outlen); - -/** - * crypto_private_key_sign_pkcs1 - Sign with private key (PKCS #1) - * @key: Private key from crypto_private_key_import() - * @in: Plaintext buffer - * @inlen: Length of plaintext buffer in bytes - * @out: Output buffer for encrypted (signed) data - * @outlen: Length of output buffer in bytes; set to used length on success - * Returns: 0 on success, -1 on failure - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -int __must_check crypto_private_key_sign_pkcs1(struct crypto_private_key *key, - const u8 *in, size_t inlen, - u8 *out, size_t *outlen); - -/** - * crypto_public_key_free - Free public key - * @key: Public key - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -void crypto_public_key_free(struct crypto_public_key *key); - -/** - * crypto_private_key_free - Free private key - * @key: Private key from crypto_private_key_import() - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -void crypto_private_key_free(struct crypto_private_key *key); - -/** - * crypto_public_key_decrypt_pkcs1 - Decrypt PKCS #1 signature - * @key: Public key - * @crypt: Encrypted signature data (using the private key) - * @crypt_len: Encrypted signature data length - * @plain: Buffer for plaintext (at least crypt_len bytes) - * @plain_len: Plaintext length (max buffer size on input, real len on output); - * Returns: 0 on success, -1 on failure - */ -int __must_check crypto_public_key_decrypt_pkcs1( - struct crypto_public_key *key, const u8 *crypt, size_t crypt_len, - u8 *plain, size_t *plain_len); - -/** - * crypto_global_init - Initialize crypto wrapper - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -int __must_check crypto_global_init(void); - -/** - * crypto_global_deinit - Deinitialize crypto wrapper - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -void crypto_global_deinit(void); - -/** - * crypto_mod_exp - Modular exponentiation of large integers - * @base: Base integer (big endian byte array) - * @base_len: Length of base integer in bytes - * @power: Power integer (big endian byte array) - * @power_len: Length of power integer in bytes - * @modulus: Modulus integer (big endian byte array) - * @modulus_len: Length of modulus integer in bytes - * @result: Buffer for the result - * @result_len: Result length (max buffer size on input, real len on output) - * Returns: 0 on success, -1 on failure - * - * This function calculates result = base ^ power mod modulus. modules_len is - * used as the maximum size of modulus buffer. It is set to the used size on - * success. - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -int __must_check crypto_mod_exp(const u8 *base, size_t base_len, - const u8 *power, size_t power_len, - const u8 *modulus, size_t modulus_len, - u8 *result, size_t *result_len); - -/** - * fast_crypto_mod_exp - Modular exponentiation of large integers - * @base: Base integer (big endian byte array) - * @base_len: Length of base integer in bytes - * @power: Power integer (big endian byte array) - * @power_len: Length of power integer in bytes - * @modulus: Modulus integer (big endian byte array) - * @modulus_len: Length of modulus integer in bytes - * @result: Buffer for the result - * @result_len: Result length (max buffer size on input, real len on output) - * Returns: 0 on success, -1 on failure - * - * This function calculates result = base ^ power mod modulus. modules_len is - * used as the maximum size of modulus buffer. It is set to the used size on - * success. - * - * This function is only used with internal TLSv1 implementation - * (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need - * to implement this. - */ -int __must_check fast_crypto_mod_exp(const uint8_t *base, size_t base_len, - const uint8_t *power, size_t power_len, - const uint8_t *modulus, size_t modulus_len, - uint8_t *result, size_t *result_len); - -/** - * rc4_skip - XOR RC4 stream to given data with skip-stream-start - * @key: RC4 key - * @keylen: RC4 key length - * @skip: number of bytes to skip from the beginning of the RC4 stream - * @data: data to be XOR'ed with RC4 stream - * @data_len: buf length - * Returns: 0 on success, -1 on failure - * - * Generate RC4 pseudo random stream for the given key, skip beginning of the - * stream, and XOR the end result with the data buffer to perform RC4 - * encryption/decryption. - */ -int rc4_skip(const u8 *key, size_t keylen, size_t skip, - u8 *data, size_t data_len); - - -/** - * crypto_get_random - Generate cryptographically strong pseudy-random bytes - * @buf: Buffer for data - * @len: Number of bytes to generate - * Returns: 0 on success, -1 on failure - * - * If the PRNG does not have enough entropy to ensure unpredictable byte - * sequence, this functions must return -1. - */ -int crypto_get_random(void *buf, size_t len); - - -/** - * struct crypto_bignum - bignum - * - * Internal data structure for bignum implementation. The contents is specific - * to the used crypto library. - */ -struct crypto_bignum; - -/** - * crypto_bignum_init - Allocate memory for bignum - * Returns: Pointer to allocated bignum or %NULL on failure - */ -struct crypto_bignum * crypto_bignum_init(void); - -/** - * crypto_bignum_init_set - Allocate memory for bignum and set the value - * @buf: Buffer with unsigned binary value - * @len: Length of buf in octets - * Returns: Pointer to allocated bignum or %NULL on failure - */ -struct crypto_bignum * crypto_bignum_init_set(const u8 *buf, size_t len); - -/** - * crypto_bignum_deinit - Free bignum - * @n: Bignum from crypto_bignum_init() or crypto_bignum_init_set() - * @clear: Whether to clear the value from memory - */ -void crypto_bignum_deinit(struct crypto_bignum *n, int clear); - -/** - * crypto_bignum_to_bin - Set binary buffer to unsigned bignum - * @a: Bignum - * @buf: Buffer for the binary number - * @len: Length of @buf in octets - * @padlen: Length in octets to pad the result to or 0 to indicate no padding - * Returns: Number of octets written on success, -1 on failure - */ -int crypto_bignum_to_bin(const struct crypto_bignum *a, - u8 *buf, size_t buflen, size_t padlen); - -/** - * crypto_bignum_add - c = a + b - * @a: Bignum - * @b: Bignum - * @c: Bignum; used to store the result of a + b - * Returns: 0 on success, -1 on failure - */ -int crypto_bignum_add(const struct crypto_bignum *a, - const struct crypto_bignum *b, - struct crypto_bignum *c); - -/** - * crypto_bignum_mod - c = a % b - * @a: Bignum - * @b: Bignum - * @c: Bignum; used to store the result of a % b - * Returns: 0 on success, -1 on failure - */ -int crypto_bignum_mod(const struct crypto_bignum *a, - const struct crypto_bignum *b, - struct crypto_bignum *c); - -/** - * crypto_bignum_exptmod - Modular exponentiation: d = a^b (mod c) - * @a: Bignum; base - * @b: Bignum; exponent - * @c: Bignum; modulus - * @d: Bignum; used to store the result of a^b (mod c) - * Returns: 0 on success, -1 on failure - */ -int crypto_bignum_exptmod(const struct crypto_bignum *a, - const struct crypto_bignum *b, - const struct crypto_bignum *c, - struct crypto_bignum *d); - -/** - * crypto_bignum_inverse - Inverse a bignum so that a * c = 1 (mod b) - * @a: Bignum - * @b: Bignum - * @c: Bignum; used to store the result - * Returns: 0 on success, -1 on failure - */ -int crypto_bignum_inverse(const struct crypto_bignum *a, - const struct crypto_bignum *b, - struct crypto_bignum *c); - -/** - * crypto_bignum_sub - c = a - b - * @a: Bignum - * @b: Bignum - * @c: Bignum; used to store the result of a - b - * Returns: 0 on success, -1 on failure - */ -int crypto_bignum_sub(const struct crypto_bignum *a, - const struct crypto_bignum *b, - struct crypto_bignum *c); - -/** - * crypto_bignum_div - c = a / b - * @a: Bignum - * @b: Bignum - * @c: Bignum; used to store the result of a / b - * Returns: 0 on success, -1 on failure - */ -int crypto_bignum_div(const struct crypto_bignum *a, - const struct crypto_bignum *b, - struct crypto_bignum *c); - -/** - * crypto_bignum_mulmod - d = a * b (mod c) - * @a: Bignum - * @b: Bignum - * @c: Bignum - * @d: Bignum; used to store the result of (a * b) % c - * Returns: 0 on success, -1 on failure - */ -int crypto_bignum_mulmod(const struct crypto_bignum *a, - const struct crypto_bignum *b, - const struct crypto_bignum *c, - struct crypto_bignum *d); - -/** - * crypto_bignum_cmp - Compare two bignums - * @a: Bignum - * @b: Bignum - * Returns: -1 if a < b, 0 if a == b, or 1 if a > b - */ -int crypto_bignum_cmp(const struct crypto_bignum *a, - const struct crypto_bignum *b); - -/** - * crypto_bignum_bits - Get size of a bignum in bits - * @a: Bignum - * Returns: Number of bits in the bignum - */ -int crypto_bignum_bits(const struct crypto_bignum *a); - -/** - * crypto_bignum_is_zero - Is the given bignum zero - * @a: Bignum - * Returns: 1 if @a is zero or 0 if not - */ -int crypto_bignum_is_zero(const struct crypto_bignum *a); - -/** - * crypto_bignum_is_one - Is the given bignum one - * @a: Bignum - * Returns: 1 if @a is one or 0 if not - */ -int crypto_bignum_is_one(const struct crypto_bignum *a); - -/** - * crypto_bignum_legendre - Compute the Legendre symbol (a/p) - * @a: Bignum - * @p: Bignum - * Returns: Legendre symbol -1,0,1 on success; -2 on calculation failure - */ -int crypto_bignum_legendre(const struct crypto_bignum *a, - const struct crypto_bignum *p); - - -/** - * struct crypto_ec - Elliptic curve context - * - * Internal data structure for EC implementation. The contents is specific - * to the used crypto library. - */ -struct crypto_ec; - -/** - * crypto_ec_init - Initialize elliptic curve context - * @group: Identifying number for the ECC group (IANA "Group Description" - * attribute registrty for RFC 2409) - * Returns: Pointer to EC context or %NULL on failure - */ -struct crypto_ec * crypto_ec_init(int group); - -/** - * crypto_ec_deinit - Deinitialize elliptic curve context - * @e: EC context from crypto_ec_init() - */ -void crypto_ec_deinit(struct crypto_ec *e); - -/** - * crypto_ec_prime_len - Get length of the prime in octets - * @e: EC context from crypto_ec_init() - * Returns: Length of the prime defining the group - */ -size_t crypto_ec_prime_len(struct crypto_ec *e); - -/** - * crypto_ec_prime_len_bits - Get length of the prime in bits - * @e: EC context from crypto_ec_init() - * Returns: Length of the prime defining the group in bits - */ -size_t crypto_ec_prime_len_bits(struct crypto_ec *e); - -/** - * crypto_ec_get_prime - Get prime defining an EC group - * @e: EC context from crypto_ec_init() - * Returns: Prime (bignum) defining the group - */ -const struct crypto_bignum * crypto_ec_get_prime(struct crypto_ec *e); - -/** - * crypto_ec_get_order - Get order of an EC group - * @e: EC context from crypto_ec_init() - * Returns: Order (bignum) of the group - */ -const struct crypto_bignum * crypto_ec_get_order(struct crypto_ec *e); - -/** - * struct crypto_ec_point - Elliptic curve point - * - * Internal data structure for EC implementation to represent a point. The - * contents is specific to the used crypto library. - */ -struct crypto_ec_point; - -/** - * crypto_ec_point_init - Initialize data for an EC point - * @e: EC context from crypto_ec_init() - * Returns: Pointer to EC point data or %NULL on failure - */ -struct crypto_ec_point * crypto_ec_point_init(struct crypto_ec *e); - -/** - * crypto_ec_point_deinit - Deinitialize EC point data - * @p: EC point data from crypto_ec_point_init() - * @clear: Whether to clear the EC point value from memory - */ -void crypto_ec_point_deinit(struct crypto_ec_point *p, int clear); - -/** - * crypto_ec_point_to_bin - Write EC point value as binary data - * @e: EC context from crypto_ec_init() - * @p: EC point data from crypto_ec_point_init() - * @x: Buffer for writing the binary data for x coordinate or %NULL if not used - * @y: Buffer for writing the binary data for y coordinate or %NULL if not used - * Returns: 0 on success, -1 on failure - * - * This function can be used to write an EC point as binary data in a format - * that has the x and y coordinates in big endian byte order fields padded to - * the length of the prime defining the group. - */ -int crypto_ec_point_to_bin(struct crypto_ec *e, - const struct crypto_ec_point *point, u8 *x, u8 *y); - -/** - * crypto_ec_point_from_bin - Create EC point from binary data - * @e: EC context from crypto_ec_init() - * @val: Binary data to read the EC point from - * Returns: Pointer to EC point data or %NULL on failure - * - * This function readers x and y coordinates of the EC point from the provided - * buffer assuming the values are in big endian byte order with fields padded to - * the length of the prime defining the group. - */ -struct crypto_ec_point * crypto_ec_point_from_bin(struct crypto_ec *e, - const u8 *val); - -/** - * crypto_bignum_add - c = a + b - * @e: EC context from crypto_ec_init() - * @a: Bignum - * @b: Bignum - * @c: Bignum; used to store the result of a + b - * Returns: 0 on success, -1 on failure - */ -int crypto_ec_point_add(struct crypto_ec *e, const struct crypto_ec_point *a, - const struct crypto_ec_point *b, - struct crypto_ec_point *c); - -/** - * crypto_bignum_mul - res = b * p - * @e: EC context from crypto_ec_init() - * @p: EC point - * @b: Bignum - * @res: EC point; used to store the result of b * p - * Returns: 0 on success, -1 on failure - */ -int crypto_ec_point_mul(struct crypto_ec *e, const struct crypto_ec_point *p, - const struct crypto_bignum *b, - struct crypto_ec_point *res); - -/** - * crypto_ec_point_invert - Compute inverse of an EC point - * @e: EC context from crypto_ec_init() - * @p: EC point to invert (and result of the operation) - * Returns: 0 on success, -1 on failure - */ -int crypto_ec_point_invert(struct crypto_ec *e, struct crypto_ec_point *p); - -/** - * crypto_ec_point_solve_y_coord - Solve y coordinate for an x coordinate - * @e: EC context from crypto_ec_init() - * @p: EC point to use for the returning the result - * @x: x coordinate - * @y_bit: y-bit (0 or 1) for selecting the y value to use - * Returns: 0 on success, -1 on failure - */ -int crypto_ec_point_solve_y_coord(struct crypto_ec *e, - struct crypto_ec_point *p, - const struct crypto_bignum *x, int y_bit); - -/** - * crypto_ec_point_compute_y_sqr - Compute y^2 = x^3 + ax + b - * @e: EC context from crypto_ec_init() - * @x: x coordinate - * Returns: y^2 on success, %NULL failure - */ -struct crypto_bignum * -crypto_ec_point_compute_y_sqr(struct crypto_ec *e, - const struct crypto_bignum *x); - -/** - * crypto_ec_point_is_at_infinity - Check whether EC point is neutral element - * @e: EC context from crypto_ec_init() - * @p: EC point - * Returns: 1 if the specified EC point is the neutral element of the group or - * 0 if not - */ -int crypto_ec_point_is_at_infinity(struct crypto_ec *e, - const struct crypto_ec_point *p); - -/** - * crypto_ec_point_is_on_curve - Check whether EC point is on curve - * @e: EC context from crypto_ec_init() - * @p: EC point - * Returns: 1 if the specified EC point is on the curve or 0 if not - */ -int crypto_ec_point_is_on_curve(struct crypto_ec *e, - const struct crypto_ec_point *p); - -/** - * crypto_ec_point_cmp - Compare two EC points - * @e: EC context from crypto_ec_init() - * @a: EC point - * @b: EC point - * Returns: 0 on equal, non-zero otherwise - */ -int crypto_ec_point_cmp(const struct crypto_ec *e, - const struct crypto_ec_point *a, - const struct crypto_ec_point *b); - - -#endif /* CRYPTO_H */ diff --git a/tools/sdk/include/wpa_supplicant/crypto/dh_group5.h b/tools/sdk/include/wpa_supplicant/crypto/dh_group5.h deleted file mode 100644 index f92c1115d5e..00000000000 --- a/tools/sdk/include/wpa_supplicant/crypto/dh_group5.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Diffie-Hellman group 5 operations - * Copyright (c) 2009, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef DH_GROUP5_H -#define DH_GROUP5_H - -#include "wpa/wpabuf.h" - -void * dh5_init(struct wpabuf **priv, struct wpabuf **publ); -struct wpabuf * dh5_derive_shared(void *ctx, const struct wpabuf *peer_public, - const struct wpabuf *own_private); -void dh5_free(void *ctx); - -#endif /* DH_GROUP5_H */ diff --git a/tools/sdk/include/wpa_supplicant/crypto/dh_groups.h b/tools/sdk/include/wpa_supplicant/crypto/dh_groups.h deleted file mode 100644 index 5c61539b700..00000000000 --- a/tools/sdk/include/wpa_supplicant/crypto/dh_groups.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Diffie-Hellman groups - * Copyright (c) 2007, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef DH_GROUPS_H -#define DH_GROUPS_H - -struct dh_group { - int id; - const u8 *generator; - size_t generator_len; - const u8 *prime; - size_t prime_len; -}; - -const struct dh_group * dh_groups_get(int id); -struct wpabuf * dh_init(const struct dh_group *dh, struct wpabuf **priv); -struct wpabuf * dh_derive_shared(const struct wpabuf *peer_public, - const struct wpabuf *own_private, - const struct dh_group *dh); - -#endif /* DH_GROUPS_H */ diff --git a/tools/sdk/include/wpa_supplicant/crypto/includes.h b/tools/sdk/include/wpa_supplicant/crypto/includes.h deleted file mode 100644 index dbc65759b0d..00000000000 --- a/tools/sdk/include/wpa_supplicant/crypto/includes.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * wpa_supplicant/hostapd - Default include files - * Copyright (c) 2005-2006, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - * - * This header file is included into all C files so that commonly used header - * files can be selected with OS specific ifdef blocks in one place instead of - * having to have OS/C library specific selection in many files. - */ - -#ifndef INCLUDES_H -#define INCLUDES_H - -/* Include possible build time configuration before including anything else */ -//#include "build_config.h" //don't need anymore -#ifndef __ets__ -#include -#include -#include -#include -#ifndef _WIN32_WCE -#ifndef CONFIG_TI_COMPILER -#include -#include -#endif /* CONFIG_TI_COMPILER */ -#include -#endif /* _WIN32_WCE */ -#include -#include - -#ifndef CONFIG_TI_COMPILER -#ifndef _MSC_VER -#include -#endif /* _MSC_VER */ -#endif /* CONFIG_TI_COMPILER */ - -#ifndef CONFIG_NATIVE_WINDOWS -#ifndef CONFIG_TI_COMPILER -//#include -//#include -//#include -#ifndef __vxworks -#ifndef __SYMBIAN32__ -//#include -#endif /* __SYMBIAN32__ */ -#include -#endif /* __vxworks */ -#endif /* CONFIG_TI_COMPILER */ -#endif /* CONFIG_NATIVE_WINDOWS */ - -#else - -#include "rom/ets_sys.h" - -#endif /* !__ets__ */ - -#endif /* INCLUDES_H */ diff --git a/tools/sdk/include/wpa_supplicant/crypto/md5.h b/tools/sdk/include/wpa_supplicant/crypto/md5.h deleted file mode 100644 index 6de3a5b5f1b..00000000000 --- a/tools/sdk/include/wpa_supplicant/crypto/md5.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * MD5 hash implementation and interface functions - * Copyright (c) 2003-2009, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef MD5_H -#define MD5_H - -#define MD5_MAC_LEN 16 - -int hmac_md5_vector(const uint8_t *key, size_t key_len, size_t num_elem, - const uint8_t *addr[], const size_t *len, uint8_t *mac); -int hmac_md5(const uint8_t *key, size_t key_len, const uint8_t *data, size_t data_len, - uint8_t *mac); -#ifdef CONFIG_FIPS -int hmac_md5_vector_non_fips_allow(const uint8_t *key, size_t key_len, - size_t num_elem, const uint8_t *addr[], - const size_t *len, uint8_t *mac); -int hmac_md5_non_fips_allow(const uint8_t *key, size_t key_len, const uint8_t *data, - size_t data_len, uint8_t *mac); -#else /* CONFIG_FIPS */ -#define hmac_md5_vector_non_fips_allow hmac_md5_vector -#define hmac_md5_non_fips_allow hmac_md5 -#endif /* CONFIG_FIPS */ - -#endif /* MD5_H */ diff --git a/tools/sdk/include/wpa_supplicant/crypto/md5_i.h b/tools/sdk/include/wpa_supplicant/crypto/md5_i.h deleted file mode 100644 index b7f6596052a..00000000000 --- a/tools/sdk/include/wpa_supplicant/crypto/md5_i.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * MD5 internal definitions - * Copyright (c) 2003-2005, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef MD5_I_H -#define MD5_I_H - -struct MD5Context { - u32 buf[4]; - u32 bits[2]; - u8 in[64]; -}; - -void MD5Init(struct MD5Context *context); -void MD5Update(struct MD5Context *context, unsigned char const *buf, - unsigned len); -void MD5Final(unsigned char digest[16], struct MD5Context *context); - -#endif /* MD5_I_H */ diff --git a/tools/sdk/include/wpa_supplicant/crypto/ms_funcs.h b/tools/sdk/include/wpa_supplicant/crypto/ms_funcs.h deleted file mode 100644 index dadb7d93215..00000000000 --- a/tools/sdk/include/wpa_supplicant/crypto/ms_funcs.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * WPA Supplicant / shared MSCHAPV2 helper functions - * - * - */ - -#ifndef MS_FUNCS_H -#define MS_FUNCS_H - -int generate_nt_response(const u8 *auth_challenge, const u8 *peer_challenge, - const u8 *username, size_t username_len, - const u8 *password, size_t password_len, - u8 *response); - -int generate_nt_response_pwhash(const u8 *auth_challenge, - const u8 *peer_challenge, - const u8 *username, size_t username_len, - const u8 *password_hash, - u8 *response); -int generate_authenticator_response(const u8 *password, size_t password_len, - const u8 *peer_challenge, - const u8 *auth_challenge, - const u8 *username, size_t username_len, - const u8 *nt_response, u8 *response); -int generate_authenticator_response_pwhash( - const u8 *password_hash, - const u8 *peer_challenge, const u8 *auth_challenge, - const u8 *username, size_t username_len, - const u8 *nt_response, u8 *response); -int nt_challenge_response(const u8 *challenge, const u8 *password, - size_t password_len, u8 *response); - -void challenge_response(const u8 *challenge, const u8 *password_hash, - u8 *response); -int nt_password_hash(const u8 *password, size_t password_len, - u8 *password_hash); -int hash_nt_password_hash(const u8 *password_hash, u8 *password_hash_hash); -int get_master_key(const u8 *password_hash_hash, const u8 *nt_response, - u8 *master_key); -int get_asymetric_start_key(const u8 *master_key, u8 *session_key, - size_t session_key_len, int is_send, - int is_server); -int encrypt_pw_block_with_password_hash( - const u8 *password, size_t password_len, - const u8 *password_hash, u8 *pw_block); -int __must_check encry_pw_block_with_password_hash( - const u8 *password, size_t password_len, - const u8 *password_hash, u8 *pw_block); -int __must_check new_password_encrypted_with_old_nt_password_hash( - const u8 *new_password, size_t new_password_len, - const u8 *old_password, size_t old_password_len, - u8 *encrypted_pw_block); -void nt_password_hash_encrypted_with_block(const u8 *password_hash, - const u8 *block, u8 *cypher); -int old_nt_password_hash_encrypted_with_new_nt_password_hash( - const u8 *new_password, size_t new_password_len, - const u8 *old_password, size_t old_password_len, - u8 *encrypted_password_hash); - -#endif /* MS_FUNCS_H */ diff --git a/tools/sdk/include/wpa_supplicant/crypto/random.h b/tools/sdk/include/wpa_supplicant/crypto/random.h deleted file mode 100644 index cbfa8773fdb..00000000000 --- a/tools/sdk/include/wpa_supplicant/crypto/random.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Random number generator - * Copyright (c) 2010-2011, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef RANDOM_H -#define RANDOM_H - -#define CONFIG_NO_RANDOM_POOL - -#ifdef CONFIG_NO_RANDOM_POOL -#define random_init(e) do { } while (0) -#define random_deinit() do { } while (0) -#define random_add_randomness(b, l) do { } while (0) -#define random_get_bytes(b, l) os_get_random((b), (l)) -#define random_pool_ready() 1 -#define random_mark_pool_ready() do { } while (0) -#else /* CONFIG_NO_RANDOM_POOL */ -void random_init(const char *entropy_file); -void random_deinit(void); -void random_add_randomness(const void *buf, size_t len); -int random_get_bytes(void *buf, size_t len); -#endif /* CONFIG_NO_RANDOM_POOL */ - -#endif /* RANDOM_H */ diff --git a/tools/sdk/include/wpa_supplicant/crypto/sha1.h b/tools/sdk/include/wpa_supplicant/crypto/sha1.h deleted file mode 100644 index 65e3958fc68..00000000000 --- a/tools/sdk/include/wpa_supplicant/crypto/sha1.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * SHA1 hash implementation and interface functions - * Copyright (c) 2003-2009, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef SHA1_H -#define SHA1_H - -#define SHA1_MAC_LEN 20 - -int hmac_sha1_vector(const uint8_t *key, size_t key_len, size_t num_elem, - const uint8_t *addr[], const size_t *len, uint8_t *mac); -int hmac_sha1(const uint8_t *key, size_t key_len, const uint8_t *data, size_t data_len, - uint8_t *mac); -int sha1_prf(const uint8_t *key, size_t key_len, const char *label, - const uint8_t *data, size_t data_len, uint8_t *buf, size_t buf_len); -int sha1_t_prf(const uint8_t *key, size_t key_len, const char *label, - const uint8_t *seed, size_t seed_len, uint8_t *buf, size_t buf_len); -//int __must_check tls_prf(const uint8_t *secret, size_t secret_len, -// const char *label, const uint8_t *seed, size_t seed_len, -// uint8_t *out, size_t outlen); -int pbkdf2_sha1(const char *passphrase, const char *ssid, size_t ssid_len, - int iterations, uint8_t *buf, size_t buflen); -#endif /* SHA1_H */ diff --git a/tools/sdk/include/wpa_supplicant/crypto/sha1_i.h b/tools/sdk/include/wpa_supplicant/crypto/sha1_i.h deleted file mode 100644 index ec2f82f75b9..00000000000 --- a/tools/sdk/include/wpa_supplicant/crypto/sha1_i.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * SHA1 internal definitions - * Copyright (c) 2003-2005, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef SHA1_I_H -#define SHA1_I_H - -struct SHA1Context { - u32 state[5]; - u32 count[2]; - unsigned char buffer[64]; -}; - -void SHA1Init(struct SHA1Context *context); -void SHA1Update(struct SHA1Context *context, const void *data, u32 len); -void SHA1Final(unsigned char digest[20], struct SHA1Context *context); -void SHA1Transform(u32 state[5], const unsigned char buffer[64]); - -#endif /* SHA1_I_H */ diff --git a/tools/sdk/include/wpa_supplicant/crypto/sha256.h b/tools/sdk/include/wpa_supplicant/crypto/sha256.h deleted file mode 100644 index 8025a29de37..00000000000 --- a/tools/sdk/include/wpa_supplicant/crypto/sha256.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * SHA256 hash implementation and interface functions - * Copyright (c) 2003-2006, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef SHA256_H -#define SHA256_H - -#define SHA256_MAC_LEN 32 - -void hmac_sha256_vector(const u8 *key, size_t key_len, size_t num_elem, - const u8 *addr[], const size_t *len, u8 *mac); -void hmac_sha256(const u8 *key, size_t key_len, const u8 *data, - size_t data_len, u8 *mac); -void sha256_prf(const u8 *key, size_t key_len, const char *label, - const u8 *data, size_t data_len, u8 *buf, size_t buf_len); - -void fast_hmac_sha256_vector(const uint8_t *key, size_t key_len, size_t num_elem, - const uint8_t *addr[], const size_t *len, uint8_t *mac); -void fast_hmac_sha256(const uint8_t *key, size_t key_len, const uint8_t *data, - size_t data_len, uint8_t *mac); -void fast_sha256_prf(const uint8_t *key, size_t key_len, const char *label, - const uint8_t *data, size_t data_len, uint8_t *buf, size_t buf_len); -#endif /* SHA256_H */ diff --git a/tools/sdk/include/wpa_supplicant/endian.h b/tools/sdk/include/wpa_supplicant/endian.h deleted file mode 100644 index 1e2453f1645..00000000000 --- a/tools/sdk/include/wpa_supplicant/endian.h +++ /dev/null @@ -1,231 +0,0 @@ -/*- - * Copyright (c) 2002 Thomas Moestl - * All rights reserved. - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. - * - * $FreeBSD$ - */ - -#ifndef _ENDIAN_H_ -#define _ENDIAN_H_ - -#include -#include "byteswap.h" - -#ifndef BIG_ENDIAN -#define BIG_ENDIAN 4321 -#endif -#ifndef LITTLE_ENDIAN -#define LITTLE_ENDIAN 1234 -#endif - -#ifndef BYTE_ORDER -#ifdef __IEEE_LITTLE_ENDIAN -#define BYTE_ORDER LITTLE_ENDIAN -#else -#define BYTE_ORDER BIG_ENDIAN -#endif -#endif - -#define _UINT8_T_DECLARED -#ifndef _UINT8_T_DECLARED -typedef __uint8_t uint8_t; -#define _UINT8_T_DECLARED -#endif - -#define _UINT16_T_DECLARED -#ifndef _UINT16_T_DECLARED -typedef __uint16_t uint16_t; -#define _UINT16_T_DECLARED -#endif - -#define _UINT32_T_DECLARED -#ifndef _UINT32_T_DECLARED -typedef __uint32_t uint32_t; -#define _UINT32_T_DECLARED -#endif - -#define _UINT64_T_DECLARED -#ifndef _UINT64_T_DECLARED -typedef __uint64_t uint64_t; -#define _UINT64_T_DECLARED -#endif - -/* - * General byte order swapping functions. - */ -#define bswap16(x) __bswap16(x) -#define bswap32(x) __bswap32(x) -#define bswap64(x) __bswap64(x) - -/* - * Host to big endian, host to little endian, big endian to host, and little - * endian to host byte order functions as detailed in byteorder(9). - */ -#if 1 //BYTE_ORDER == _LITTLE_ENDIAN -#define __bswap16 __bswap_16 -#define __bswap32 __bswap_32 -#define htobe16(x) bswap16((x)) -#define htobe32(x) bswap32((x)) -#define htobe64(x) bswap64((x)) -#define htole16(x) ((uint16_t)(x)) -#define htole32(x) ((uint32_t)(x)) -#define htole64(x) ((uint64_t)(x)) - -#define be16toh(x) bswap16((x)) -#define be32toh(x) bswap32((x)) -#define be64toh(x) bswap64((x)) -#define le16toh(x) ((uint16_t)(x)) -#define le32toh(x) ((uint32_t)(x)) -#define le64toh(x) ((uint64_t)(x)) - -#ifndef htons -#define htons htobe16 -#endif //htons - -#else /* _BYTE_ORDER != _LITTLE_ENDIAN */ -#define htobe16(x) ((uint16_t)(x)) -#define htobe32(x) ((uint32_t)(x)) -#define htobe64(x) ((uint64_t)(x)) -#define htole16(x) bswap16((x)) -#define htole32(x) bswap32((x)) -#define htole64(x) bswap64((x)) - -#define be16toh(x) ((uint16_t)(x)) -#define be32toh(x) ((uint32_t)(x)) -#define be64toh(x) ((uint64_t)(x)) -#define le16toh(x) bswap16((x)) -#define le32toh(x) bswap32((x)) -#define le64toh(x) bswap64((x)) -#endif /* _BYTE_ORDER == _LITTLE_ENDIAN */ - -/* Alignment-agnostic encode/decode bytestream to/from little/big endian. */ -#define INLINE __inline__ - -static INLINE uint16_t -be16dec(const void *pp) -{ - uint8_t const *p = (uint8_t const *)pp; - - return ((p[0] << 8) | p[1]); -} - -static INLINE uint32_t -be32dec(const void *pp) -{ - uint8_t const *p = (uint8_t const *)pp; - - return (((unsigned)p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]); -} - -static INLINE uint64_t -be64dec(const void *pp) -{ - uint8_t const *p = (uint8_t const *)pp; - - return (((uint64_t)be32dec(p) << 32) | be32dec(p + 4)); -} - -static INLINE uint16_t -le16dec(const void *pp) -{ - uint8_t const *p = (uint8_t const *)pp; - - return ((p[1] << 8) | p[0]); -} - -static INLINE uint32_t -le32dec(const void *pp) -{ - uint8_t const *p = (uint8_t const *)pp; - - return (((unsigned)p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0]); -} - -static INLINE uint64_t -le64dec(const void *pp) -{ - uint8_t const *p = (uint8_t const *)pp; - - return (((uint64_t)le32dec(p + 4) << 32) | le32dec(p)); -} - -static INLINE void -be16enc(void *pp, uint16_t u) -{ - uint8_t *p = (uint8_t *)pp; - - p[0] = (u >> 8) & 0xff; - p[1] = u & 0xff; -} - -static INLINE void -be32enc(void *pp, uint32_t u) -{ - uint8_t *p = (uint8_t *)pp; - - p[0] = (u >> 24) & 0xff; - p[1] = (u >> 16) & 0xff; - p[2] = (u >> 8) & 0xff; - p[3] = u & 0xff; -} - -static INLINE void -be64enc(void *pp, uint64_t u) -{ - uint8_t *p = (uint8_t *)pp; - - be32enc(p, (uint32_t)(u >> 32)); - be32enc(p + 4, (uint32_t)(u & 0xffffffffU)); -} - -static INLINE void -le16enc(void *pp, uint16_t u) -{ - uint8_t *p = (uint8_t *)pp; - - p[0] = u & 0xff; - p[1] = (u >> 8) & 0xff; -} - -static INLINE void -le32enc(void *pp, uint32_t u) -{ - uint8_t *p = (uint8_t *)pp; - - p[0] = u & 0xff; - p[1] = (u >> 8) & 0xff; - p[2] = (u >> 16) & 0xff; - p[3] = (u >> 24) & 0xff; -} - -static INLINE void -le64enc(void *pp, uint64_t u) -{ - uint8_t *p = (uint8_t *)pp; - - le32enc(p, (uint32_t)(u & 0xffffffffU)); - le32enc(p + 4, (uint32_t)(u >> 32)); -} - -#endif /* _ENDIAN_H_ */ diff --git a/tools/sdk/include/wpa_supplicant/os.h b/tools/sdk/include/wpa_supplicant/os.h deleted file mode 100644 index 0028c21e9cb..00000000000 --- a/tools/sdk/include/wpa_supplicant/os.h +++ /dev/null @@ -1,291 +0,0 @@ -/* - * OS specific functions - * Copyright (c) 2005-2009, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef OS_H -#define OS_H -#include "esp_types.h" -#include -#include -#include -#include "esp_err.h" -#include "rom/ets_sys.h" - -typedef long os_time_t; - -/** - * os_sleep - Sleep (sec, usec) - * @sec: Number of seconds to sleep - * @usec: Number of microseconds to sleep - */ -void os_sleep(os_time_t sec, os_time_t usec); - -struct os_time { - os_time_t sec; - os_time_t usec; -}; - -/** - * os_get_time - Get current time (sec, usec) - * @t: Pointer to buffer for the time - * Returns: 0 on success, -1 on failure - */ -int os_get_time(struct os_time *t); - - -/* Helper macros for handling struct os_time */ - -#define os_time_before(a, b) \ - ((a)->sec < (b)->sec || \ - ((a)->sec == (b)->sec && (a)->usec < (b)->usec)) - -#define os_time_sub(a, b, res) do { \ - (res)->sec = (a)->sec - (b)->sec; \ - (res)->usec = (a)->usec - (b)->usec; \ - if ((res)->usec < 0) { \ - (res)->sec--; \ - (res)->usec += 1000000; \ - } \ -} while (0) - -/** - * os_mktime - Convert broken-down time into seconds since 1970-01-01 - * @year: Four digit year - * @month: Month (1 .. 12) - * @day: Day of month (1 .. 31) - * @hour: Hour (0 .. 23) - * @min: Minute (0 .. 59) - * @sec: Second (0 .. 60) - * @t: Buffer for returning calendar time representation (seconds since - * 1970-01-01 00:00:00) - * Returns: 0 on success, -1 on failure - * - * Note: The result is in seconds from Epoch, i.e., in UTC, not in local time - * which is used by POSIX mktime(). - */ -int os_mktime(int year, int month, int day, int hour, int min, int sec, - os_time_t *t); - - -/** - * os_daemonize - Run in the background (detach from the controlling terminal) - * @pid_file: File name to write the process ID to or %NULL to skip this - * Returns: 0 on success, -1 on failure - */ -int os_daemonize(const char *pid_file); - -/** - * os_daemonize_terminate - Stop running in the background (remove pid file) - * @pid_file: File name to write the process ID to or %NULL to skip this - */ -void os_daemonize_terminate(const char *pid_file); - -/** - * os_get_random - Get cryptographically strong pseudo random data - * @buf: Buffer for pseudo random data - * @len: Length of the buffer - * Returns: 0 on success, -1 on failure - */ -int os_get_random(unsigned char *buf, size_t len); - -/** - * os_random - Get pseudo random value (not necessarily very strong) - * Returns: Pseudo random value - */ -unsigned long os_random(void); - -/** - * os_rel2abs_path - Get an absolute path for a file - * @rel_path: Relative path to a file - * Returns: Absolute path for the file or %NULL on failure - * - * This function tries to convert a relative path of a file to an absolute path - * in order for the file to be found even if current working directory has - * changed. The returned value is allocated and caller is responsible for - * freeing it. It is acceptable to just return the same path in an allocated - * buffer, e.g., return strdup(rel_path). This function is only used to find - * configuration files when os_daemonize() may have changed the current working - * directory and relative path would be pointing to a different location. - */ -char * os_rel2abs_path(const char *rel_path); - -/** - * os_program_init - Program initialization (called at start) - * Returns: 0 on success, -1 on failure - * - * This function is called when a programs starts. If there are any OS specific - * processing that is needed, it can be placed here. It is also acceptable to - * just return 0 if not special processing is needed. - */ -int os_program_init(void); - -/** - * os_program_deinit - Program deinitialization (called just before exit) - * - * This function is called just before a program exists. If there are any OS - * specific processing, e.g., freeing resourced allocated in os_program_init(), - * it should be done here. It is also acceptable for this function to do - * nothing. - */ -void os_program_deinit(void); - -/** - * os_setenv - Set environment variable - * @name: Name of the variable - * @value: Value to set to the variable - * @overwrite: Whether existing variable should be overwritten - * Returns: 0 on success, -1 on error - * - * This function is only used for wpa_cli action scripts. OS wrapper does not - * need to implement this if such functionality is not needed. - */ -int os_setenv(const char *name, const char *value, int overwrite); - -/** - * os_unsetenv - Delete environent variable - * @name: Name of the variable - * Returns: 0 on success, -1 on error - * - * This function is only used for wpa_cli action scripts. OS wrapper does not - * need to implement this if such functionality is not needed. - */ -int os_unsetenv(const char *name); - -/** - * os_readfile - Read a file to an allocated memory buffer - * @name: Name of the file to read - * @len: For returning the length of the allocated buffer - * Returns: Pointer to the allocated buffer or %NULL on failure - * - * This function allocates memory and reads the given file to this buffer. Both - * binary and text files can be read with this function. The caller is - * responsible for freeing the returned buffer with os_free(). - */ -char * os_readfile(const char *name, size_t *len); - -/* - * The following functions are wrapper for standard ANSI C or POSIX functions. - * By default, they are just defined to use the standard function name and no - * os_*.c implementation is needed for them. This avoids extra function calls - * by allowing the C pre-processor take care of the function name mapping. - * - * If the target system uses a C library that does not provide these functions, - * build_config.h can be used to define the wrappers to use a different - * function name. This can be done on function-by-function basis since the - * defines here are only used if build_config.h does not define the os_* name. - * If needed, os_*.c file can be used to implement the functions that are not - * included in the C library on the target system. Alternatively, - * OS_NO_C_LIB_DEFINES can be defined to skip all defines here in which case - * these functions need to be implemented in os_*.c file for the target system. - */ - -#ifndef os_malloc -#define os_malloc(s) malloc((s)) -#endif -#ifndef os_realloc -#define os_realloc(p, s) realloc((p), (s)) -#endif -#ifndef os_zalloc -#define os_zalloc(s) calloc(1, (s)) -#endif -#ifndef os_free -#define os_free(p) free((p)) -#endif - -#ifndef os_bzero -#define os_bzero(s, n) bzero(s, n) -#endif - - -#ifndef os_strdup -#ifdef _MSC_VER -#define os_strdup(s) _strdup(s) -#else -#define os_strdup(s) strdup(s) -#endif -#endif -char * ets_strdup(const char *s); - -#ifndef os_memcpy -#define os_memcpy(d, s, n) memcpy((d), (s), (n)) -#endif -#ifndef os_memmove -#define os_memmove(d, s, n) memmove((d), (s), (n)) -#endif -#ifndef os_memset -#define os_memset(s, c, n) memset(s, c, n) -#endif -#ifndef os_memcmp -#define os_memcmp(s1, s2, n) memcmp((s1), (s2), (n)) -#endif - -#ifndef os_strlen -#define os_strlen(s) strlen(s) -#endif -#ifndef os_strcasecmp -#ifdef _MSC_VER -#define os_strcasecmp(s1, s2) _stricmp((s1), (s2)) -#else -#define os_strcasecmp(s1, s2) strcasecmp((s1), (s2)) -#endif -#endif -#ifndef os_strncasecmp -#ifdef _MSC_VER -#define os_strncasecmp(s1, s2, n) _strnicmp((s1), (s2), (n)) -#else -#define os_strncasecmp(s1, s2, n) strncasecmp((s1), (s2), (n)) -#endif -#endif -#ifndef os_strchr -#define os_strchr(s, c) strchr((s), (c)) -#endif -#ifndef os_strcmp -#define os_strcmp(s1, s2) strcmp((s1), (s2)) -#endif -#ifndef os_strncmp -#define os_strncmp(s1, s2, n) strncmp((s1), (s2), (n)) -#endif -#ifndef os_strncpy -#define os_strncpy(d, s, n) strncpy((d), (s), (n)) -#endif -#ifndef os_strrchr -//hard cold -#define os_strrchr(s, c) NULL -#endif -#ifndef os_strstr -#define os_strstr(h, n) strstr((h), (n)) -#endif - -#ifndef os_snprintf -#ifdef _MSC_VER -#define os_snprintf _snprintf -#else -#define os_snprintf snprintf -#endif -#endif - -/** - * os_strlcpy - Copy a string with size bound and NUL-termination - * @dest: Destination - * @src: Source - * @siz: Size of the target buffer - * Returns: Total length of the target string (length of src) (not including - * NUL-termination) - * - * This function matches in behavior with the strlcpy(3) function in OpenBSD. - */ -size_t os_strlcpy(char *dest, const char *src, size_t siz); - - - -#endif /* OS_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa/ap_config.h b/tools/sdk/include/wpa_supplicant/wpa/ap_config.h deleted file mode 100644 index 761becb4844..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa/ap_config.h +++ /dev/null @@ -1,544 +0,0 @@ -/* - * hostapd / Configuration definitions and helpers functions - * Copyright (c) 2003-2012, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef HOSTAPD_CONFIG_H -#define HOSTAPD_CONFIG_H - -#include "wpa/defs.h" -//#include "ip_addr.h" -#include "wpa/wpa_common.h" -//#include "common/ieee802_11_common.h" -//#include "wps/wps.h" - -#define MAX_STA_COUNT 4 -#define MAX_VLAN_ID 4094 - -typedef u8 macaddr[ETH_ALEN]; - -struct mac_acl_entry { - macaddr addr; - int vlan_id; -}; - -struct hostapd_radius_servers; -struct ft_remote_r0kh; -struct ft_remote_r1kh; - -#define HOSTAPD_MAX_SSID_LEN 32 - -#define NUM_WEP_KEYS 4 -struct hostapd_wep_keys { - u8 idx; - u8 *key[NUM_WEP_KEYS]; - size_t len[NUM_WEP_KEYS]; - int keys_set; - size_t default_len; /* key length used for dynamic key generation */ -}; - -typedef enum hostap_security_policy { - SECURITY_PLAINTEXT = 0, - SECURITY_STATIC_WEP = 1, - SECURITY_IEEE_802_1X = 2, - SECURITY_WPA_PSK = 3, - SECURITY_WPA = 4 -} secpolicy; - -struct hostapd_ssid { - u8 ssid[HOSTAPD_MAX_SSID_LEN]; - size_t ssid_len; - unsigned int ssid_set:1; - unsigned int utf8_ssid:1; - -// char vlan[IFNAMSIZ + 1]; -// secpolicy security_policy; - - struct hostapd_wpa_psk *wpa_psk; - char *wpa_passphrase; -// char *wpa_psk_file; - - struct hostapd_wep_keys wep; - -#if 0 -#define DYNAMIC_VLAN_DISABLED 0 -#define DYNAMIC_VLAN_OPTIONAL 1 -#define DYNAMIC_VLAN_REQUIRED 2 - int dynamic_vlan; -#define DYNAMIC_VLAN_NAMING_WITHOUT_DEVICE 0 -#define DYNAMIC_VLAN_NAMING_WITH_DEVICE 1 -#define DYNAMIC_VLAN_NAMING_END 2 - int vlan_naming; -#ifdef CONFIG_FULL_DYNAMIC_VLAN - char *vlan_tagged_interface; -#endif /* CONFIG_FULL_DYNAMIC_VLAN */ - struct hostapd_wep_keys **dyn_vlan_keys; - size_t max_dyn_vlan_keys; -#endif -}; - -#if 0 -#define VLAN_ID_WILDCARD -1 - -struct hostapd_vlan { - struct hostapd_vlan *next; - int vlan_id; /* VLAN ID or -1 (VLAN_ID_WILDCARD) for wildcard entry */ - char ifname[IFNAMSIZ + 1]; - int dynamic_vlan; -#ifdef CONFIG_FULL_DYNAMIC_VLAN - -#define DVLAN_CLEAN_BR 0x1 -#define DVLAN_CLEAN_VLAN 0x2 -#define DVLAN_CLEAN_VLAN_PORT 0x4 -#define DVLAN_CLEAN_WLAN_PORT 0x8 - int clean; -#endif /* CONFIG_FULL_DYNAMIC_VLAN */ -}; -#endif - -#define PMK_LEN 32 -struct hostapd_sta_wpa_psk_short { - struct hostapd_sta_wpa_psk_short *next; - u8 psk[PMK_LEN]; -}; - -struct hostapd_wpa_psk { - struct hostapd_wpa_psk *next; - int group; - u8 psk[PMK_LEN]; - u8 addr[ETH_ALEN]; -}; - -#if 0 -struct hostapd_eap_user { - struct hostapd_eap_user *next; - u8 *identity; - size_t identity_len; - struct { - int vendor; - u32 method; - } methods[EAP_MAX_METHODS]; - u8 *password; - size_t password_len; - int phase2; - int force_version; - unsigned int wildcard_prefix:1; - unsigned int password_hash:1; /* whether password is hashed with - * nt_password_hash() */ - int ttls_auth; /* EAP_TTLS_AUTH_* bitfield */ -}; - -struct hostapd_radius_attr { - u8 type; - struct wpabuf *val; - struct hostapd_radius_attr *next; -}; - - -#define NUM_TX_QUEUES 4 - -struct hostapd_tx_queue_params { - int aifs; - int cwmin; - int cwmax; - int burst; /* maximum burst time in 0.1 ms, i.e., 10 = 1 ms */ -}; - - -#define MAX_ROAMING_CONSORTIUM_LEN 15 - -struct hostapd_roaming_consortium { - u8 len; - u8 oi[MAX_ROAMING_CONSORTIUM_LEN]; -}; - -struct hostapd_lang_string { - u8 lang[3]; - u8 name_len; - u8 name[252]; -}; - -#define MAX_NAI_REALMS 10 -#define MAX_NAI_REALMLEN 255 -#define MAX_NAI_EAP_METHODS 5 -#define MAX_NAI_AUTH_TYPES 4 -struct hostapd_nai_realm_data { - u8 encoding; - char realm_buf[MAX_NAI_REALMLEN + 1]; - char *realm[MAX_NAI_REALMS]; - u8 eap_method_count; - struct hostapd_nai_realm_eap { - u8 eap_method; - u8 num_auths; - u8 auth_id[MAX_NAI_AUTH_TYPES]; - u8 auth_val[MAX_NAI_AUTH_TYPES]; - } eap_method[MAX_NAI_EAP_METHODS]; -}; -#endif - -/** - * struct hostapd_bss_config - Per-BSS configuration - */ -struct hostapd_bss_config { -// char iface[IFNAMSIZ + 1]; -// char bridge[IFNAMSIZ + 1]; -// char wds_bridge[IFNAMSIZ + 1]; - -// enum hostapd_logger_level logger_syslog_level, logger_stdout_level; - -// unsigned int logger_syslog; /* module bitfield */ -// unsigned int logger_stdout; /* module bitfield */ - -// char *dump_log_name; /* file name for state dump (SIGUSR1) */ - - int max_num_sta; /* maximum number of STAs in station table */ - - int dtim_period; - - int ieee802_1x; /* use IEEE 802.1X */ - int eapol_version; -// int eap_server; /* Use internal EAP server instead of external -// * RADIUS server */ -// struct hostapd_eap_user *eap_user; -// char *eap_user_sqlite; -// char *eap_sim_db; -// struct hostapd_ip_addr own_ip_addr; -// char *nas_identifier; -// struct hostapd_radius_servers *radius; -// int acct_interim_interval; -// int radius_request_cui; -// struct hostapd_radius_attr *radius_auth_req_attr; -// struct hostapd_radius_attr *radius_acct_req_attr; -// int radius_das_port; -// unsigned int radius_das_time_window; -// int radius_das_require_event_timestamp; -// struct hostapd_ip_addr radius_das_client_addr; -// u8 *radius_das_shared_secret; -// size_t radius_das_shared_secret_len; - - struct hostapd_ssid ssid; - -// char *eap_req_id_text; /* optional displayable message sent with -// * EAP Request-Identity */ -// size_t eap_req_id_text_len; -// int eapol_key_index_workaround; - -// size_t default_wep_key_len; -// int individual_wep_key_len; - int wep_rekeying_period; - int broadcast_key_idx_min, broadcast_key_idx_max; -// int eap_reauth_period; - -// int ieee802_11f; /* use IEEE 802.11f (IAPP) */ -// char iapp_iface[IFNAMSIZ + 1]; /* interface used with IAPP broadcast -// * frames */ - - enum { - ACCEPT_UNLESS_DENIED = 0, - DENY_UNLESS_ACCEPTED = 1, - USE_EXTERNAL_RADIUS_AUTH = 2 - } macaddr_acl; -// struct mac_acl_entry *accept_mac; -// int num_accept_mac; -// struct mac_acl_entry *deny_mac; -// int num_deny_mac; -// int wds_sta; -// int isolate; - - int auth_algs; /* bitfield of allowed IEEE 802.11 authentication - * algorithms, WPA_AUTH_ALG_{OPEN,SHARED,LEAP} */ - - int wpa; /* bitfield of WPA_PROTO_WPA, WPA_PROTO_RSN */ - int wpa_key_mgmt; -#ifdef CONFIG_IEEE80211W - enum mfp_options ieee80211w; - /* dot11AssociationSAQueryMaximumTimeout (in TUs) */ - unsigned int assoc_sa_query_max_timeout; - /* dot11AssociationSAQueryRetryTimeout (in TUs) */ - int assoc_sa_query_retry_timeout; -#endif /* CONFIG_IEEE80211W */ - enum { - PSK_RADIUS_IGNORED = 0, - PSK_RADIUS_ACCEPTED = 1, - PSK_RADIUS_REQUIRED = 2 - } wpa_psk_radius; - int wpa_pairwise; - int wpa_group; - int wpa_group_rekey; - int wpa_strict_rekey; - int wpa_gmk_rekey; - int wpa_ptk_rekey; - int rsn_pairwise; - int rsn_preauth; - char *rsn_preauth_interfaces; - int peerkey; - -#ifdef CONFIG_IEEE80211R - /* IEEE 802.11r - Fast BSS Transition */ - u8 mobility_domain[MOBILITY_DOMAIN_ID_LEN]; - u8 r1_key_holder[FT_R1KH_ID_LEN]; - u32 r0_key_lifetime; - u32 reassociation_deadline; - struct ft_remote_r0kh *r0kh_list; - struct ft_remote_r1kh *r1kh_list; - int pmk_r1_push; - int ft_over_ds; -#endif /* CONFIG_IEEE80211R */ - -// char *ctrl_interface; /* directory for UNIX domain sockets */ -#ifndef CONFIG_NATIVE_WINDOWS -// gid_t ctrl_interface_gid; -#endif /* CONFIG_NATIVE_WINDOWS */ -// int ctrl_interface_gid_set; - -// char *ca_cert; -// char *server_cert; -// char *private_key; -// char *private_key_passwd; -// int check_crl; -// char *dh_file; -// u8 *pac_opaque_encr_key; -// u8 *eap_fast_a_id; -// size_t eap_fast_a_id_len; -// char *eap_fast_a_id_info; -// int eap_fast_prov; -// int pac_key_lifetime; -// int pac_key_refresh_time; -// int eap_sim_aka_result_ind; -// int tnc; -// int fragment_size; -// u16 pwd_group; - -// char *radius_server_clients; -// int radius_server_auth_port; -// int radius_server_ipv6; - -// char *test_socket; /* UNIX domain socket path for driver_test */ - -// int use_pae_group_addr; /* Whether to send EAPOL frames to PAE group -// * address instead of individual address -// * (for driver_wired.c). -// */ - - int ap_max_inactivity; - int ignore_broadcast_ssid; - - int wmm_enabled; - int wmm_uapsd; - -// struct hostapd_vlan *vlan, *vlan_tail; - - macaddr bssid; - - /* - * Maximum listen interval that STAs can use when associating with this - * BSS. If a STA tries to use larger value, the association will be - * denied with status code 51. - */ - u16 max_listen_interval; - -// int disable_pmksa_caching; -// int okc; /* Opportunistic Key Caching */ - -// int wps_state; -#ifdef CONFIG_WPS - int ap_setup_locked; - u8 uuid[16]; - char *wps_pin_requests; - char *device_name; - char *manufacturer; - char *model_name; - char *model_number; - char *serial_number; - u8 device_type[WPS_DEV_TYPE_LEN]; - char *config_methods; - u8 os_version[4]; - char *ap_pin; - int skip_cred_build; - u8 *extra_cred; - size_t extra_cred_len; - int wps_cred_processing; - u8 *ap_settings; - size_t ap_settings_len; - char *upnp_iface; - char *friendly_name; - char *manufacturer_url; - char *model_description; - char *model_url; - char *upc; - struct wpabuf *wps_vendor_ext[MAX_WPS_VENDOR_EXTENSIONS]; - int wps_nfc_dev_pw_id; - struct wpabuf *wps_nfc_dh_pubkey; - struct wpabuf *wps_nfc_dh_privkey; - struct wpabuf *wps_nfc_dev_pw; -#endif /* CONFIG_WPS */ -// int pbc_in_m1; - -#define P2P_ENABLED BIT(0) -#define P2P_GROUP_OWNER BIT(1) -#define P2P_GROUP_FORMATION BIT(2) -#define P2P_MANAGE BIT(3) -#define P2P_ALLOW_CROSS_CONNECTION BIT(4) -// int p2p; - -// int disassoc_low_ack; -// int skip_inactivity_poll; - -#define TDLS_PROHIBIT BIT(0) -#define TDLS_PROHIBIT_CHAN_SWITCH BIT(1) -// int tdls; -// int disable_11n; -// int disable_11ac; - - /* IEEE 802.11v */ -// int time_advertisement; -// char *time_zone; -// int wnm_sleep_mode; -// int bss_transition; - - /* IEEE 802.11u - Interworking */ -// int interworking; -// int access_network_type; -// int internet; -// int asra; -// int esr; -// int uesa; -// int venue_info_set; -// u8 venue_group; -// u8 venue_type; -// u8 hessid[ETH_ALEN]; - - /* IEEE 802.11u - Roaming Consortium list */ -// unsigned int roaming_consortium_count; -// struct hostapd_roaming_consortium *roaming_consortium; - - /* IEEE 802.11u - Venue Name duples */ -// unsigned int venue_name_count; -// struct hostapd_lang_string *venue_name; - - /* IEEE 802.11u - Network Authentication Type */ -// u8 *network_auth_type; -// size_t network_auth_type_len; - - /* IEEE 802.11u - IP Address Type Availability */ -// u8 ipaddr_type_availability; -// u8 ipaddr_type_configured; - - /* IEEE 802.11u - 3GPP Cellular Network */ -// u8 *anqp_3gpp_cell_net; -// size_t anqp_3gpp_cell_net_len; - - /* IEEE 802.11u - Domain Name */ -// u8 *domain_name; -// size_t domain_name_len; - -// unsigned int nai_realm_count; -// struct hostapd_nai_realm_data *nai_realm_data; - -// u16 gas_comeback_delay; -// int gas_frag_limit; - -#ifdef CONFIG_HS20 - int hs20; - int disable_dgaf; - unsigned int hs20_oper_friendly_name_count; - struct hostapd_lang_string *hs20_oper_friendly_name; - u8 *hs20_wan_metrics; - u8 *hs20_connection_capability; - size_t hs20_connection_capability_len; - u8 *hs20_operating_class; - u8 hs20_operating_class_len; -#endif /* CONFIG_HS20 */ - -// u8 wps_rf_bands; /* RF bands for WPS (WPS_RF_*) */ - -#ifdef CONFIG_RADIUS_TEST - char *dump_msk_file; -#endif /* CONFIG_RADIUS_TEST */ - -// struct wpabuf *vendor_elements; -}; - - -/** - * struct hostapd_config - Per-radio interface configuration - */ -struct hostapd_config { - struct hostapd_bss_config *bss, *last_bss; - size_t num_bss; - - u16 beacon_int; - int rts_threshold; - int fragm_threshold; - u8 send_probe_response; - u8 channel; - enum hostapd_hw_mode hw_mode; /* HOSTAPD_MODE_IEEE80211A, .. */ - enum { - LONG_PREAMBLE = 0, - SHORT_PREAMBLE = 1 - } preamble; - - int *supported_rates; - int *basic_rates; - - const struct wpa_driver_ops *driver; - - int ap_table_max_size; - int ap_table_expiration_time; - - char country[3]; /* first two octets: country code as described in - * ISO/IEC 3166-1. Third octet: - * ' ' (ascii 32): all environments - * 'O': Outdoor environemnt only - * 'I': Indoor environment only - */ - - int ieee80211d; - -// struct hostapd_tx_queue_params tx_queue[NUM_TX_QUEUES]; - - /* - * WMM AC parameters, in same order as 802.1D, i.e. - * 0 = BE (best effort) - * 1 = BK (background) - * 2 = VI (video) - * 3 = VO (voice) - */ -// struct hostapd_wmm_ac_params wmm_ac_params[4]; - - int ht_op_mode_fixed; - u16 ht_capab; - int ieee80211n; - int secondary_channel; - int require_ht; - u32 vht_capab; - int ieee80211ac; - int require_vht; - u8 vht_oper_chwidth; - u8 vht_oper_centr_freq_seg0_idx; - u8 vht_oper_centr_freq_seg1_idx; -}; - - -int hostapd_mac_comp(const void *a, const void *b); -int hostapd_mac_comp_empty(const void *a); -struct hostapd_config * hostapd_config_defaults(void); -void hostapd_config_defaults_bss(struct hostapd_bss_config *bss); -void hostapd_config_free(struct hostapd_config *conf); -int hostapd_maclist_found(struct mac_acl_entry *list, int num_entries, - const u8 *addr, int *vlan_id); -int hostapd_rate_found(int *list, int rate); -int hostapd_wep_key_cmp(struct hostapd_wep_keys *a, - struct hostapd_wep_keys *b); -const u8 * hostapd_get_psk(const struct hostapd_bss_config *conf, - const u8 *addr, const u8 *prev_psk); -int hostapd_setup_wpa_psk(struct hostapd_bss_config *conf); -//const char * hostapd_get_vlan_id_ifname(struct hostapd_vlan *vlan, -// int vlan_id); -//struct hostapd_radius_attr * -//hostapd_config_get_radius_attr(struct hostapd_radius_attr *attr, u8 type); - -#endif /* HOSTAPD_CONFIG_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa/common.h b/tools/sdk/include/wpa_supplicant/wpa/common.h deleted file mode 100644 index 2e6012f8686..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa/common.h +++ /dev/null @@ -1,337 +0,0 @@ -/* - * wpa_supplicant/hostapd / common helper functions, etc. - * Copyright (c) 2002-2007, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef COMMON_H -#define COMMON_H - -#if defined(__ets__) -#endif /* ets */ -#include "os.h" - -/* Define platform specific variable type macros */ -#if defined(ESP_PLATFORM) -#include -typedef uint64_t u64; -typedef uint32_t u32; -typedef uint16_t u16; -typedef uint8_t u8; -typedef int64_t s64; -typedef int32_t s32; -typedef int16_t s16; -typedef int8_t s8; -#endif /*ESP_PLATFORM*/ - -#if defined(__XTENSA__) -#include -#define __BYTE_ORDER BYTE_ORDER -#define __LITTLE_ENDIAN LITTLE_ENDIAN -#define __BIG_ENDIAN BIG_ENDIAN -#endif /*__XTENSA__*/ - -#if defined(__linux__) || defined(__GLIBC__) || defined(__ets__) -#include -#include -#endif /* __linux__ */ - -/* Define platform specific byte swapping macros */ - -#if defined(__CYGWIN__) || defined(CONFIG_NATIVE_WINDOWS) - -static inline unsigned short wpa_swap_16(unsigned short v) -{ - return ((v & 0xff) << 8) | (v >> 8); -} - -static inline unsigned int wpa_swap_32(unsigned int v) -{ - return ((v & 0xff) << 24) | ((v & 0xff00) << 8) | - ((v & 0xff0000) >> 8) | (v >> 24); -} - -#define le_to_host16(n) (n) -#define host_to_le16(n) (n) -#define be_to_host16(n) wpa_swap_16(n) -#define host_to_be16(n) wpa_swap_16(n) -#define le_to_host32(n) (n) -#define be_to_host32(n) wpa_swap_32(n) -#define host_to_be32(n) wpa_swap_32(n) - -#define WPA_BYTE_SWAP_DEFINED - -#endif /* __CYGWIN__ || CONFIG_NATIVE_WINDOWS */ - - -#ifndef WPA_BYTE_SWAP_DEFINED - -#ifndef __BYTE_ORDER -#ifndef __LITTLE_ENDIAN -#ifndef __BIG_ENDIAN -#define __LITTLE_ENDIAN 1234 -#define __BIG_ENDIAN 4321 -#if defined(sparc) -#define __BYTE_ORDER __BIG_ENDIAN -#endif -#endif /* __BIG_ENDIAN */ -#endif /* __LITTLE_ENDIAN */ -#endif /* __BYTE_ORDER */ - -#if __BYTE_ORDER == __LITTLE_ENDIAN -#define le_to_host16(n) ((__force u16) (le16) (n)) -#define host_to_le16(n) ((__force le16) (u16) (n)) -#define be_to_host16(n) __bswap_16((__force u16) (be16) (n)) -#define host_to_be16(n) ((__force be16) __bswap_16((n))) -#define le_to_host32(n) ((__force u32) (le32) (n)) -#define host_to_le32(n) ((__force le32) (u32) (n)) -#define be_to_host32(n) __bswap_32((__force u32) (be32) (n)) -#define host_to_be32(n) ((__force be32) __bswap_32((n))) -#define le_to_host64(n) ((__force u64) (le64) (n)) -#define host_to_le64(n) ((__force le64) (u64) (n)) -#define be_to_host64(n) __bswap_64((__force u64) (be64) (n)) -#define host_to_be64(n) ((__force be64) bswap_64((n))) -#elif __BYTE_ORDER == __BIG_ENDIAN -#define le_to_host16(n) __bswap_16(n) -#define host_to_le16(n) __bswap_16(n) -#define be_to_host16(n) (n) -#define host_to_be16(n) (n) -#define le_to_host32(n) __bswap_32(n) -#define be_to_host32(n) (n) -#define host_to_be32(n) (n) -#define le_to_host64(n) __bswap_64(n) -#define host_to_le64(n) __bswap_64(n) -#define be_to_host64(n) (n) -#define host_to_be64(n) (n) -#ifndef WORDS_BIGENDIAN -#define WORDS_BIGENDIAN -#endif -#else -#error Could not determine CPU byte order -#endif - -#define WPA_BYTE_SWAP_DEFINED -#endif /* !WPA_BYTE_SWAP_DEFINED */ - - -/* Macros for handling unaligned memory accesses */ - -#define WPA_GET_BE16(a) ((u16) (((a)[0] << 8) | (a)[1])) -#define WPA_PUT_BE16(a, val) \ - do { \ - (a)[0] = ((u16) (val)) >> 8; \ - (a)[1] = ((u16) (val)) & 0xff; \ - } while (0) - -#define WPA_GET_LE16(a) ((u16) (((a)[1] << 8) | (a)[0])) -#define WPA_PUT_LE16(a, val) \ - do { \ - (a)[1] = ((u16) (val)) >> 8; \ - (a)[0] = ((u16) (val)) & 0xff; \ - } while (0) - -#define WPA_GET_BE24(a) ((((u32) (a)[0]) << 16) | (((u32) (a)[1]) << 8) | \ - ((u32) (a)[2])) -#define WPA_PUT_BE24(a, val) \ - do { \ - (a)[0] = (u8) ((((u32) (val)) >> 16) & 0xff); \ - (a)[1] = (u8) ((((u32) (val)) >> 8) & 0xff); \ - (a)[2] = (u8) (((u32) (val)) & 0xff); \ - } while (0) - -#define WPA_GET_BE32(a) ((((u32) (a)[0]) << 24) | (((u32) (a)[1]) << 16) | \ - (((u32) (a)[2]) << 8) | ((u32) (a)[3])) -#define WPA_PUT_BE32(a, val) \ - do { \ - (a)[0] = (u8) ((((u32) (val)) >> 24) & 0xff); \ - (a)[1] = (u8) ((((u32) (val)) >> 16) & 0xff); \ - (a)[2] = (u8) ((((u32) (val)) >> 8) & 0xff); \ - (a)[3] = (u8) (((u32) (val)) & 0xff); \ - } while (0) - -#define WPA_GET_LE32(a) ((((u32) (a)[3]) << 24) | (((u32) (a)[2]) << 16) | \ - (((u32) (a)[1]) << 8) | ((u32) (a)[0])) -#define WPA_PUT_LE32(a, val) \ - do { \ - (a)[3] = (u8) ((((u32) (val)) >> 24) & 0xff); \ - (a)[2] = (u8) ((((u32) (val)) >> 16) & 0xff); \ - (a)[1] = (u8) ((((u32) (val)) >> 8) & 0xff); \ - (a)[0] = (u8) (((u32) (val)) & 0xff); \ - } while (0) - -#define WPA_GET_BE64(a) ((((u64) (a)[0]) << 56) | (((u64) (a)[1]) << 48) | \ - (((u64) (a)[2]) << 40) | (((u64) (a)[3]) << 32) | \ - (((u64) (a)[4]) << 24) | (((u64) (a)[5]) << 16) | \ - (((u64) (a)[6]) << 8) | ((u64) (a)[7])) -#define WPA_PUT_BE64(a, val) \ - do { \ - (a)[0] = (u8) (((u64) (val)) >> 56); \ - (a)[1] = (u8) (((u64) (val)) >> 48); \ - (a)[2] = (u8) (((u64) (val)) >> 40); \ - (a)[3] = (u8) (((u64) (val)) >> 32); \ - (a)[4] = (u8) (((u64) (val)) >> 24); \ - (a)[5] = (u8) (((u64) (val)) >> 16); \ - (a)[6] = (u8) (((u64) (val)) >> 8); \ - (a)[7] = (u8) (((u64) (val)) & 0xff); \ - } while (0) - -#define WPA_GET_LE64(a) ((((u64) (a)[7]) << 56) | (((u64) (a)[6]) << 48) | \ - (((u64) (a)[5]) << 40) | (((u64) (a)[4]) << 32) | \ - (((u64) (a)[3]) << 24) | (((u64) (a)[2]) << 16) | \ - (((u64) (a)[1]) << 8) | ((u64) (a)[0])) - - -#ifndef ETH_ALEN -#define ETH_ALEN 6 -#endif -//#ifndef IFNAMSIZ -//#define IFNAMSIZ 16 -//#endif -#ifndef ETH_P_ALL -#define ETH_P_ALL 0x0003 -#endif -#ifndef ETH_P_PAE -#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ -#endif /* ETH_P_PAE */ -#ifndef ETH_P_EAPOL -#define ETH_P_EAPOL ETH_P_PAE -#endif /* ETH_P_EAPOL */ -#ifndef ETH_P_RSN_PREAUTH -#define ETH_P_RSN_PREAUTH 0x88c7 -#endif /* ETH_P_RSN_PREAUTH */ -#ifndef ETH_P_RRB -#define ETH_P_RRB 0x890D -#endif /* ETH_P_RRB */ - - -#ifdef __GNUC__ -#define PRINTF_FORMAT(a,b) __attribute__ ((format (printf, (a), (b)))) -#define STRUCT_PACKED __attribute__ ((packed)) -#else -#define PRINTF_FORMAT(a,b) -#define STRUCT_PACKED -#endif - -#ifdef CONFIG_ANSI_C_EXTRA - -/* inline - define as __inline or just define it to be empty, if needed */ -#ifdef CONFIG_NO_INLINE -#define inline -#else -#define inline __inline -#endif - -#ifndef __func__ -#define __func__ "__func__ not defined" -#endif - -#ifndef bswap_16 -#define bswap_16(a) ((((u16) (a) << 8) & 0xff00) | (((u16) (a) >> 8) & 0xff)) -#endif - -#ifndef bswap_32 -#define bswap_32(a) ((((u32) (a) << 24) & 0xff000000) | \ - (((u32) (a) << 8) & 0xff0000) | \ - (((u32) (a) >> 8) & 0xff00) | \ - (((u32) (a) >> 24) & 0xff)) -#endif - -#ifndef MSG_DONTWAIT -#define MSG_DONTWAIT 0 -#endif - -#ifdef _WIN32_WCE -void perror(const char *s); -#endif /* _WIN32_WCE */ - -#endif /* CONFIG_ANSI_C_EXTRA */ - -#ifndef MAC2STR -#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] -#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x" -#endif - -#ifndef BIT -#define BIT(x) (1 << (x)) -#endif - -/* - * Definitions for sparse validation - * (http://kernel.org/pub/linux/kernel/people/josh/sparse/) - */ -#ifdef __CHECKER__ -#define __force __attribute__((force)) -#define __bitwise __attribute__((bitwise)) -#else -#define __force -#define __bitwise -#endif - -typedef u16 __bitwise be16; -typedef u16 __bitwise le16; -typedef u32 __bitwise be32; -typedef u32 __bitwise le32; -typedef u64 __bitwise be64; -typedef u64 __bitwise le64; - -#ifndef __must_check -#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -#define __must_check __attribute__((__warn_unused_result__)) -#else -#define __must_check -#endif /* __GNUC__ */ -#endif /* __must_check */ - -int hwaddr_aton(const char *txt, u8 *addr); -int hwaddr_aton2(const char *txt, u8 *addr); -int hexstr2bin(const char *hex, u8 *buf, size_t len); -void inc_byte_array(u8 *counter, size_t len); -void wpa_get_ntp_timestamp(u8 *buf); -int wpa_snprintf_hex(char *buf, size_t buf_size, const u8 *data, size_t len); -int wpa_snprintf_hex_uppercase(char *buf, size_t buf_size, const u8 *data, - size_t len); - -#ifdef CONFIG_NATIVE_WINDOWS -void wpa_unicode2ascii_inplace(TCHAR *str); -TCHAR * wpa_strdup_tchar(const char *str); -#else /* CONFIG_NATIVE_WINDOWS */ -#define wpa_unicode2ascii_inplace(s) do { } while (0) -#define wpa_strdup_tchar(s) strdup((s)) -#endif /* CONFIG_NATIVE_WINDOWS */ - -const char * wpa_ssid_txt(const u8 *ssid, size_t ssid_len); -char * wpa_config_parse_string(const char *value, size_t *len); - -static inline int is_zero_ether_addr(const u8 *a) -{ - return !(a[0] | a[1] | a[2] | a[3] | a[4] | a[5]); -} - -extern const struct eth_addr ethbroadcast; -#define broadcast_ether_addr ðbroadcast - -#include "wpabuf.h" -#include "wpa_debug.h" - - -/* - * gcc 4.4 ends up generating strict-aliasing warnings about some very common - * networking socket uses that do not really result in a real problem and - * cannot be easily avoided with union-based type-punning due to struct - * definitions including another struct in system header files. To avoid having - * to fully disable strict-aliasing warnings, provide a mechanism to hide the - * typecast from aliasing for now. A cleaner solution will hopefully be found - * in the future to handle these cases. - */ -void * __hide_aliasing_typecast(void *foo); -#define aliasing_hide_typecast(a,t) (t *) __hide_aliasing_typecast((a)) - -#endif /* COMMON_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa/defs.h b/tools/sdk/include/wpa_supplicant/wpa/defs.h deleted file mode 100644 index f019cee9927..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa/defs.h +++ /dev/null @@ -1,307 +0,0 @@ -/* - * WPA Supplicant - Common definitions - * Copyright (c) 2004-2008, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef DEFS_H -#define DEFS_H - -#ifdef FALSE -#undef FALSE -#endif -#ifdef TRUE -#undef TRUE -#endif -typedef enum { FALSE = 0, TRUE = 1 } Boolean; - -/* -#define WPA_CIPHER_NONE BIT(0) -#define WPA_CIPHER_WEP40 BIT(1) -#define WPA_CIPHER_WEP104 BIT(2) -#define WPA_CIPHER_TKIP BIT(3) -#define WPA_CIPHER_CCMP BIT(4) -#ifdef CONFIG_IEEE80211W -#define WPA_CIPHER_AES_128_CMAC BIT(5) -#endif -*/ - -/* - * NB: these values are ordered carefully; there are lots of - * of implications in any reordering. Beware that 4 is used - * only to indicate h/w TKIP MIC support in driver capabilities; - * there is no separate cipher support (it's rolled into the - * TKIP cipher support). - */ -#define IEEE80211_CIPHER_NONE 0 /* pseudo value */ -#define IEEE80211_CIPHER_TKIP 1 -#define IEEE80211_CIPHER_AES_OCB 2 -#define IEEE80211_CIPHER_AES_CCM 3 -#define IEEE80211_CIPHER_TKIPMIC 4 /* TKIP MIC capability */ -#define IEEE80211_CIPHER_CKIP 5 -#define IEEE80211_CIPHER_WEP 6 -#define IEEE80211_CIPHER_WEP40 7 -#define IEEE80211_CIPHER_WEP104 8 - - -#define IEEE80211_CIPHER_MAX (IEEE80211_CIPHER_NONE+2) - -/* capability bits in ic_cryptocaps/iv_cryptocaps */ -#define IEEE80211_CRYPTO_NONE (1<wpa_state). The current state can be retrieved with - * wpa_supplicant_get_state() function and the state can be changed by calling - * wpa_supplicant_set_state(). In WPA state machine (wpa.c and preauth.c), the - * wrapper functions wpa_sm_get_state() and wpa_sm_set_state() should be used - * to access the state variable. - */ -enum wpa_states { - /** - * WPA_DISCONNECTED - Disconnected state - * - * This state indicates that client is not associated, but is likely to - * start looking for an access point. This state is entered when a - * connection is lost. - */ - WPA_DISCONNECTED, - - /** - * WPA_INACTIVE - Inactive state (wpa_supplicant disabled) - * - * This state is entered if there are no enabled networks in the - * configuration. wpa_supplicant is not trying to associate with a new - * network and external interaction (e.g., ctrl_iface call to add or - * enable a network) is needed to start association. - */ - WPA_INACTIVE, - - /** - * WPA_SCANNING - Scanning for a network - * - * This state is entered when wpa_supplicant starts scanning for a - * network. - */ - WPA_SCANNING, - - /** - * WPA_AUTHENTICATING - Trying to authenticate with a BSS/SSID - * - * This state is entered when wpa_supplicant has found a suitable BSS - * to authenticate with and the driver is configured to try to - * authenticate with this BSS. This state is used only with drivers - * that use wpa_supplicant as the SME. - */ - WPA_AUTHENTICATING, - - /** - * WPA_ASSOCIATING - Trying to associate with a BSS/SSID - * - * This state is entered when wpa_supplicant has found a suitable BSS - * to associate with and the driver is configured to try to associate - * with this BSS in ap_scan=1 mode. When using ap_scan=2 mode, this - * state is entered when the driver is configured to try to associate - * with a network using the configured SSID and security policy. - */ - WPA_ASSOCIATING, - - /** - * WPA_ASSOCIATED - Association completed - * - * This state is entered when the driver reports that association has - * been successfully completed with an AP. If IEEE 802.1X is used - * (with or without WPA/WPA2), wpa_supplicant remains in this state - * until the IEEE 802.1X/EAPOL authentication has been completed. - */ - WPA_ASSOCIATED, - - /** - * WPA_4WAY_HANDSHAKE - WPA 4-Way Key Handshake in progress - * - * This state is entered when WPA/WPA2 4-Way Handshake is started. In - * case of WPA-PSK, this happens when receiving the first EAPOL-Key - * frame after association. In case of WPA-EAP, this state is entered - * when the IEEE 802.1X/EAPOL authentication has been completed. - */ - WPA_FIRST_HALF_4WAY_HANDSHAKE, - - WPA_LAST_HALF_4WAY_HANDSHAKE, - - /** - * WPA_GROUP_HANDSHAKE - WPA Group Key Handshake in progress - * - * This state is entered when 4-Way Key Handshake has been completed - * (i.e., when the supplicant sends out message 4/4) and when Group - * Key rekeying is started by the AP (i.e., when supplicant receives - * message 1/2). - */ - WPA_GROUP_HANDSHAKE, - - /** - * WPA_COMPLETED - All authentication completed - * - * This state is entered when the full authentication process is - * completed. In case of WPA2, this happens when the 4-Way Handshake is - * successfully completed. With WPA, this state is entered after the - * Group Key Handshake; with IEEE 802.1X (non-WPA) connection is - * completed after dynamic keys are received (or if not used, after - * the EAP authentication has been completed). With static WEP keys and - * plaintext connections, this state is entered when an association - * has been completed. - * - * This state indicates that the supplicant has completed its - * processing for the association phase and that data connection is - * fully configured. - */ - WPA_COMPLETED, - - WPA_MIC_FAILURE, // first mic_error event occur - - WPA_TKIP_COUNTERMEASURES //in countermeasure period that stop connect with ap in 60 sec -}; - -#define MLME_SETPROTECTION_PROTECT_TYPE_NONE 0 -#define MLME_SETPROTECTION_PROTECT_TYPE_RX 1 -#define MLME_SETPROTECTION_PROTECT_TYPE_TX 2 -#define MLME_SETPROTECTION_PROTECT_TYPE_RX_TX 3 - -#define MLME_SETPROTECTION_KEY_TYPE_GROUP 0 -#define MLME_SETPROTECTION_KEY_TYPE_PAIRWISE 1 - -/** - * enum hostapd_hw_mode - Hardware mode - */ -enum hostapd_hw_mode { - HOSTAPD_MODE_IEEE80211B, - HOSTAPD_MODE_IEEE80211G, - HOSTAPD_MODE_IEEE80211A, - HOSTAPD_MODE_IEEE80211AD, - NUM_HOSTAPD_MODES -}; - -#endif /* DEFS_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa/eapol_common.h b/tools/sdk/include/wpa_supplicant/wpa/eapol_common.h deleted file mode 100644 index 6a40ac33b3f..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa/eapol_common.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * EAPOL definitions shared between hostapd and wpa_supplicant - * Copyright (c) 2002-2007, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef EAPOL_COMMON_H -#define EAPOL_COMMON_H - -/* IEEE Std 802.1X-2004 */ - -struct ieee802_1x_hdr { - u8 version; - u8 type; - be16 length; - /* followed by length octets of data */ -} STRUCT_PACKED; - - -#define EAPOL_VERSION 2 - -enum { IEEE802_1X_TYPE_EAP_PACKET = 0, - IEEE802_1X_TYPE_EAPOL_START = 1, - IEEE802_1X_TYPE_EAPOL_LOGOFF = 2, - IEEE802_1X_TYPE_EAPOL_KEY = 3, - IEEE802_1X_TYPE_EAPOL_ENCAPSULATED_ASF_ALERT = 4 -}; - -enum { EAPOL_KEY_TYPE_RC4 = 1, EAPOL_KEY_TYPE_RSN = 2, - EAPOL_KEY_TYPE_WPA = 254 }; - -#define IEEE8021X_REPLAY_COUNTER_LEN 8 -#define IEEE8021X_KEY_SIGN_LEN 16 -#define IEEE8021X_KEY_IV_LEN 16 - -#define IEEE8021X_KEY_INDEX_FLAG 0x80 -#define IEEE8021X_KEY_INDEX_MASK 0x03 - -struct ieee802_1x_eapol_key { - u8 type; - /* Note: key_length is unaligned */ - u8 key_length[2]; - /* does not repeat within the life of the keying material used to - * encrypt the Key field; 64-bit NTP timestamp MAY be used here */ - u8 replay_counter[IEEE8021X_REPLAY_COUNTER_LEN]; - u8 key_iv[IEEE8021X_KEY_IV_LEN]; /* cryptographically random number */ - u8 key_index; /* key flag in the most significant bit: - * 0 = broadcast (default key), - * 1 = unicast (key mapping key); key index is in the - * 7 least significant bits */ - /* HMAC-MD5 message integrity check computed with MS-MPPE-Send-Key as - * the key */ - u8 key_signature[IEEE8021X_KEY_SIGN_LEN]; - - /* followed by key: if packet body length = 44 + key length, then the - * key field (of key_length bytes) contains the key in encrypted form; - * if packet body length = 44, key field is absent and key_length - * represents the number of least significant octets from - * MS-MPPE-Send-Key attribute to be used as the keying material; - * RC4 key used in encryption = Key-IV + MS-MPPE-Recv-Key */ -} STRUCT_PACKED; - -#endif /* EAPOL_COMMON_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa/hostapd.h b/tools/sdk/include/wpa_supplicant/wpa/hostapd.h deleted file mode 100644 index 1d52659a224..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa/hostapd.h +++ /dev/null @@ -1,312 +0,0 @@ -/* - * hostapd / Initialization and configuration - * Copyright (c) 2002-2009, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef HOSTAPD_H -#define HOSTAPD_H - -#include "wpa/defs.h" -#include "wpa/ap_config.h" - -struct wpa_driver_ops; -struct wpa_ctrl_dst; -struct radius_server_data; -struct upnp_wps_device_sm; -struct hostapd_data; -struct sta_info; -struct hostap_sta_driver_data; -struct ieee80211_ht_capabilities; -struct full_dynamic_vlan; -enum wps_event; -union wps_event_data; - -struct hostapd_iface; - -struct hapd_interfaces { - int (*reload_config)(struct hostapd_iface *iface); - struct hostapd_config * (*config_read_cb)(const char *config_fname); - int (*ctrl_iface_init)(struct hostapd_data *hapd); - void (*ctrl_iface_deinit)(struct hostapd_data *hapd); - int (*for_each_interface)(struct hapd_interfaces *interfaces, - int (*cb)(struct hostapd_iface *iface, - void *ctx), void *ctx); - int (*driver_init)(struct hostapd_iface *iface); - - size_t count; - int global_ctrl_sock; - char *global_iface_path; - char *global_iface_name; - struct hostapd_iface **iface; -}; - - -struct hostapd_probereq_cb { - int (*cb)(void *ctx, const u8 *sa, const u8 *da, const u8 *bssid, - const u8 *ie, size_t ie_len, int ssi_signal); - void *ctx; -}; - -#define HOSTAPD_RATE_BASIC 0x00000001 - -struct hostapd_rate_data { - int rate; /* rate in 100 kbps */ - int flags; /* HOSTAPD_RATE_ flags */ -}; - -struct hostapd_frame_info { - u32 channel; - u32 datarate; - int ssi_signal; /* dBm */ -}; - - -/** - * struct hostapd_data - hostapd per-BSS data structure - */ -struct hostapd_data { -// struct hostapd_iface *iface; - struct hostapd_config *iconf; - struct hostapd_bss_config *conf; - int interface_added; /* virtual interface added for this BSS */ - - u8 own_addr[ETH_ALEN]; - - int num_sta; /* number of entries in sta_list */ -// struct sta_info *sta_list; /* STA info list head */ -//#define STA_HASH_SIZE 256 -//#define STA_HASH(sta) (sta[5]) -// struct sta_info *sta_hash[STA_HASH_SIZE]; - -// /* -// * Bitfield for indicating which AIDs are allocated. Only AID values -// * 1-2007 are used and as such, the bit at index 0 corresponds to AID -// * 1. -// */ -//#define AID_WORDS ((2008 + 31) / 32) -// u32 sta_aid[AID_WORDS]; - -// const struct wpa_driver_ops *driver; -// void *drv_priv; - -// void (*new_assoc_sta_cb)(struct hostapd_data *hapd, -// struct sta_info *sta, int reassoc); - -// void *msg_ctx; /* ctx for wpa_msg() calls */ -// void *msg_ctx_parent; /* parent interface ctx for wpa_msg() calls */ - -// struct radius_client_data *radius; -// u32 acct_session_id_hi, acct_session_id_lo; -// struct radius_das_data *radius_das; - -// struct iapp_data *iapp; - -// struct hostapd_cached_radius_acl *acl_cache; -// struct hostapd_acl_query_data *acl_queries; - - struct wpa_authenticator *wpa_auth; -// struct eapol_authenticator *eapol_auth; - -// struct rsn_preauth_interface *preauth_iface; -// time_t michael_mic_failure; -// int michael_mic_failures; -// int tkip_countermeasures; - -// int ctrl_sock; -// struct wpa_ctrl_dst *ctrl_dst; - -// void *ssl_ctx; -// void *eap_sim_db_priv; -// struct radius_server_data *radius_srv; - -// int parameter_set_count; - - /* Time Advertisement */ -// u8 time_update_counter; -// struct wpabuf *time_adv; - -#ifdef CONFIG_FULL_DYNAMIC_VLAN - struct full_dynamic_vlan *full_dynamic_vlan; -#endif /* CONFIG_FULL_DYNAMIC_VLAN */ - -// struct l2_packet_data *l2; -// struct wps_context *wps; - -// int beacon_set_done; -// struct wpabuf *wps_beacon_ie; -// struct wpabuf *wps_probe_resp_ie; -#ifdef CONFIG_WPS - unsigned int ap_pin_failures; - unsigned int ap_pin_failures_consecutive; - struct upnp_wps_device_sm *wps_upnp; - unsigned int ap_pin_lockout_time; -#endif /* CONFIG_WPS */ - -// struct hostapd_probereq_cb *probereq_cb; -// size_t num_probereq_cb; - -// void (*public_action_cb)(void *ctx, const u8 *buf, size_t len, -// int freq); -// void *public_action_cb_ctx; - -// int (*vendor_action_cb)(void *ctx, const u8 *buf, size_t len, -// int freq); -// void *vendor_action_cb_ctx; - -// void (*wps_reg_success_cb)(void *ctx, const u8 *mac_addr, -// const u8 *uuid_e); -// void *wps_reg_success_cb_ctx; - -// void (*wps_event_cb)(void *ctx, enum wps_event event, -// union wps_event_data *data); -// void *wps_event_cb_ctx; - -// void (*sta_authorized_cb)(void *ctx, const u8 *mac_addr, -// int authorized, const u8 *p2p_dev_addr); -// void *sta_authorized_cb_ctx; - -// void (*setup_complete_cb)(void *ctx); -// void *setup_complete_cb_ctx; - -#ifdef CONFIG_P2P - struct p2p_data *p2p; - struct p2p_group *p2p_group; - struct wpabuf *p2p_beacon_ie; - struct wpabuf *p2p_probe_resp_ie; - - /* Number of non-P2P association stations */ - int num_sta_no_p2p; - - /* Periodic NoA (used only when no non-P2P clients in the group) */ - int noa_enabled; - int noa_start; - int noa_duration; -#endif /* CONFIG_P2P */ -#ifdef CONFIG_INTERWORKING - size_t gas_frag_limit; -#endif /* CONFIG_INTERWORKING */ - -#ifdef CONFIG_SQLITE - struct hostapd_eap_user tmp_eap_user; -#endif /* CONFIG_SQLITE */ -}; - -#if 0 -/** - * struct hostapd_iface - hostapd per-interface data structure - */ -struct hostapd_iface { - struct hapd_interfaces *interfaces; - void *owner; - char *config_fname; - struct hostapd_config *conf; - - size_t num_bss; - struct hostapd_data **bss; - - int num_ap; /* number of entries in ap_list */ - struct ap_info *ap_list; /* AP info list head */ - struct ap_info *ap_hash[STA_HASH_SIZE]; - struct ap_info *ap_iter_list; - - unsigned int drv_flags; - - /* - * A bitmap of supported protocols for probe response offload. See - * struct wpa_driver_capa in driver.h - */ - unsigned int probe_resp_offloads; - - struct hostapd_hw_modes *hw_features; - int num_hw_features; - struct hostapd_hw_modes *current_mode; - /* Rates that are currently used (i.e., filtered copy of - * current_mode->channels */ - int num_rates; - struct hostapd_rate_data *current_rates; - int *basic_rates; - int freq; - - u16 hw_flags; - - /* Number of associated Non-ERP stations (i.e., stations using 802.11b - * in 802.11g BSS) */ - int num_sta_non_erp; - - /* Number of associated stations that do not support Short Slot Time */ - int num_sta_no_short_slot_time; - - /* Number of associated stations that do not support Short Preamble */ - int num_sta_no_short_preamble; - - int olbc; /* Overlapping Legacy BSS Condition */ - - /* Number of HT associated stations that do not support greenfield */ - int num_sta_ht_no_gf; - - /* Number of associated non-HT stations */ - int num_sta_no_ht; - - /* Number of HT associated stations 20 MHz */ - int num_sta_ht_20mhz; - - /* Overlapping BSS information */ - int olbc_ht; - - u16 ht_op_mode; - void (*scan_cb)(struct hostapd_iface *iface); -}; -#endif - -#if 0 -/* hostapd.c */ -int hostapd_for_each_interface(struct hapd_interfaces *interfaces, - int (*cb)(struct hostapd_iface *iface, - void *ctx), void *ctx); -int hostapd_reload_config(struct hostapd_iface *iface); -struct hostapd_data * -hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface, - struct hostapd_config *conf, - struct hostapd_bss_config *bss); -int hostapd_setup_interface(struct hostapd_iface *iface); -int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err); -void hostapd_interface_deinit(struct hostapd_iface *iface); -void hostapd_interface_free(struct hostapd_iface *iface); -void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta, - int reassoc); -void hostapd_interface_deinit_free(struct hostapd_iface *iface); -int hostapd_enable_iface(struct hostapd_iface *hapd_iface); -int hostapd_reload_iface(struct hostapd_iface *hapd_iface); -int hostapd_disable_iface(struct hostapd_iface *hapd_iface); -int hostapd_add_iface(struct hapd_interfaces *ifaces, char *buf); -int hostapd_remove_iface(struct hapd_interfaces *ifaces, char *buf); - -/* utils.c */ -int hostapd_register_probereq_cb(struct hostapd_data *hapd, - int (*cb)(void *ctx, const u8 *sa, - const u8 *da, const u8 *bssid, - const u8 *ie, size_t ie_len, - int ssi_signal), - void *ctx); -void hostapd_prune_associations(struct hostapd_data *hapd, const u8 *addr); - -/* drv_callbacks.c (TODO: move to somewhere else?) */ -int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr, - const u8 *ie, size_t ielen, int reassoc); -void hostapd_notif_disassoc(struct hostapd_data *hapd, const u8 *addr); -void hostapd_event_sta_low_ack(struct hostapd_data *hapd, const u8 *addr); -int hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa, const u8 *da, - const u8 *bssid, const u8 *ie, size_t ie_len, - int ssi_signal); -void hostapd_event_ch_switch(struct hostapd_data *hapd, int freq, int ht, - int offset); - -const struct hostapd_eap_user * -hostapd_get_eap_user(struct hostapd_data *hapd, const u8 *identity, - size_t identity_len, int phase2); -#endif - -#endif /* HOSTAPD_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa/ieee80211_crypto.h b/tools/sdk/include/wpa_supplicant/wpa/ieee80211_crypto.h deleted file mode 100644 index be0fb9aa12a..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa/ieee80211_crypto.h +++ /dev/null @@ -1,226 +0,0 @@ -/*- - * Copyright (c) 2001 Atsushi Onoe - * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting - * All rights reserved. - * - * 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. - * - * 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. - * - * $FreeBSD$ - */ - -/* - * copyright (c) 2010-2011 Espressif System - */ -#ifndef _NET80211_IEEE80211_CRYPTO_H_ -#define _NET80211_IEEE80211_CRYPTO_H_ - -//#include "pp/esf_buf.h" - -/* - * 802.11 protocol crypto-related definitions. - */ -#define IEEE80211_KEYBUF_SIZE 16 -#define IEEE80211_MICBUF_SIZE (8+8) /* space for both tx+rx keys */ - -/* - * Old WEP-style key. Deprecated. - */ - -#if 0 -struct ieee80211_rsnparms { - uint8_t rsn_mcastcipher; /* mcast/group cipher */ - uint8_t rsn_mcastkeylen; /* mcast key length */ - uint8_t rsn_ucastcipher; /* selected unicast cipher */ - uint8_t rsn_ucastkeylen; /* unicast key length */ - uint8_t rsn_keymgmt; /* selected key mgmt algo */ - uint16_t rsn_caps; /* capabilities */ -}; -#endif //0000 - -/* - * Template for a supported cipher. Ciphers register with the - * crypto code and are typically loaded as separate modules - * (the null cipher is always present). - * XXX may need refcnts - */ - -/* - * Crypto key state. There is sufficient room for all supported - * ciphers (see below). The underlying ciphers are handled - * separately through loadable cipher modules that register with - * the generic crypto support. A key has a reference to an instance - * of the cipher; any per-key state is hung off wk_private by the - * cipher when it is attached. Ciphers are automatically called - * to detach and cleanup any such state when the key is deleted. - * - * The generic crypto support handles encap/decap of cipher-related - * frame contents for both hardware- and software-based implementations. - * A key requiring software crypto support is automatically flagged and - * the cipher is expected to honor this and do the necessary work. - * Ciphers such as TKIP may also support mixed hardware/software - * encrypt/decrypt and MIC processing. - */ -typedef uint16_t ieee80211_keyix; /* h/w key index */ - -struct ieee80211_key { - uint8_t wk_keylen; /* key length in bytes */ - uint8_t wk_pad; - uint16_t wk_flags; -#define IEEE80211_KEY_XMIT 0x0001 /* key used for xmit */ -#define IEEE80211_KEY_RECV 0x0002 /* key used for recv */ -#define IEEE80211_KEY_GROUP 0x0004 /* key used for WPA group operation */ -#define IEEE80211_KEY_SWENCRYPT 0x0010 /* host-based encrypt */ -#define IEEE80211_KEY_SWDECRYPT 0x0020 /* host-based decrypt */ -#define IEEE80211_KEY_SWENMIC 0x0040 /* host-based enmic */ -#define IEEE80211_KEY_SWDEMIC 0x0080 /* host-based demic */ -#define IEEE80211_KEY_DEVKEY 0x0100 /* device key request completed */ -#define IEEE80211_KEY_CIPHER0 0x1000 /* cipher-specific action 0 */ -#define IEEE80211_KEY_CIPHER1 0x2000 /* cipher-specific action 1 */ -#define IEEE80211_KEY_EMPTY 0x0000 - ieee80211_keyix wk_keyix; /* h/w key index */ - ieee80211_keyix wk_rxkeyix; /* optional h/w rx key index */ - uint8_t wk_key[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE]; -#define wk_txmic wk_key+IEEE80211_KEYBUF_SIZE+0 /* XXX can't () right */ -#define wk_rxmic wk_key+IEEE80211_KEYBUF_SIZE+8 /* XXX can't () right */ - /* key receive sequence counter */ - uint64_t wk_keyrsc[IEEE80211_TID_SIZE]; - uint64_t wk_keytsc; /* key transmit sequence counter */ - const struct ieee80211_cipher *wk_cipher; - //void *wk_private; /* private cipher state */ - //uint8_t wk_macaddr[IEEE80211_ADDR_LEN]; //JLU: no need ... -}; -#define IEEE80211_KEY_COMMON /* common flags passed in by apps */\ - (IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV | IEEE80211_KEY_GROUP) -#define IEEE80211_KEY_DEVICE /* flags owned by device driver */\ - (IEEE80211_KEY_DEVKEY|IEEE80211_KEY_CIPHER0|IEEE80211_KEY_CIPHER1) - -#define IEEE80211_KEY_SWCRYPT \ - (IEEE80211_KEY_SWENCRYPT | IEEE80211_KEY_SWDECRYPT) -#define IEEE80211_KEY_SWMIC (IEEE80211_KEY_SWENMIC | IEEE80211_KEY_SWDEMIC) - -//#define IEEE80211_KEYIX_NONE ((ieee80211_keyix) -1) - -/* - * NB: these values are ordered carefully; there are lots of - * of implications in any reordering. Beware that 4 is used - * only to indicate h/w TKIP MIC support in driver capabilities; - * there is no separate cipher support (it's rolled into the - * TKIP cipher support). - */ -#define IEEE80211_CIPHER_NONE 0 /* pseudo value */ -#define IEEE80211_CIPHER_TKIP 1 -#define IEEE80211_CIPHER_AES_OCB 2 -#define IEEE80211_CIPHER_AES_CCM 3 -#define IEEE80211_CIPHER_TKIPMIC 4 /* TKIP MIC capability */ -#define IEEE80211_CIPHER_CKIP 5 -#define IEEE80211_CIPHER_WEP 6 -#define IEEE80211_CIPHER_WEP40 7 -#define IEEE80211_CIPHER_WEP104 8 - - -#define IEEE80211_CIPHER_MAX (IEEE80211_CIPHER_NONE+2) - -/* capability bits in ic_cryptocaps/iv_cryptocaps */ -#define IEEE80211_CRYPTO_NONE (1<wk_cipher == &ieee80211_cipher_none) - -struct ieee80211_key *ieee80211_crypto_encap(struct ieee80211_conn *, - esf_buf *); - -struct ieee80211_key *ieee80211_crypto_decap(struct ieee80211_conn *, - esf_buf *, int); - -#if 0 //H/W MIC -/* - * Check and remove any MIC. - */ -static INLINE int -ieee80211_crypto_demic(struct ieee80211vap *vap, struct ieee80211_key *k, - esf_buf *m, int force) -{ - const struct ieee80211_cipher *cip = k->wk_cipher; - return (cip->ic_miclen > 0 ? cip->ic_demic(k, m, force) : 1); -} - -/* - * Add any MIC. - */ -static INLINE int -ieee80211_crypto_enmic(struct ieee80211vap *vap, - struct ieee80211_key *k, esf_buf *m, int force) -{ - const struct ieee80211_cipher *cip = k->wk_cipher; - return (cip->ic_miclen > 0 ? cip->ic_enmic(k, m, force) : 1); -} -#endif //0000 - -/* - * Setup crypto support for a device/shared instance. - */ -void ieee80211_crypto_attach(struct ieee80211com *ic); - -/* - * Reset key state to an unused state. The crypto - * key allocation mechanism insures other state (e.g. - * key data) is properly setup before a key is used. - */ -static inline void -ieee80211_crypto_resetkey(struct ieee80211_key *k) -{ - k->wk_cipher = NULL; - k->wk_flags = IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV; -} - -/* - * Crypt-related notification methods. - */ -//void ieee80211_notify_replay_failure(const struct ieee80211_frame *, const struct ieee80211_key *, -// uint64_t rsc, int tid); -//void ieee80211_notify_michael_failure(const struct ieee80211_frame *, u_int keyix); - -#endif /* _NET80211_IEEE80211_CRYPTO_H_ */ diff --git a/tools/sdk/include/wpa_supplicant/wpa/ieee802_11_defs.h b/tools/sdk/include/wpa_supplicant/wpa/ieee802_11_defs.h deleted file mode 100644 index 4881e39a01a..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa/ieee802_11_defs.h +++ /dev/null @@ -1,607 +0,0 @@ -/* - * IEEE 802.11 Frame type definitions - * Copyright (c) 2002-2009, Jouni Malinen - * Copyright (c) 2007-2008 Intel Corporation - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef IEEE802_11_DEFS_H -#define IEEE802_11_DEFS_H - -/* IEEE 802.11 defines */ - -#define WLAN_FC_PVER 0x0003 -#define WLAN_FC_TODS 0x0100 -#define WLAN_FC_FROMDS 0x0200 -#define WLAN_FC_MOREFRAG 0x0400 -#define WLAN_FC_RETRY 0x0800 -#define WLAN_FC_PWRMGT 0x1000 -#define WLAN_FC_MOREDATA 0x2000 -#define WLAN_FC_ISWEP 0x4000 -#define WLAN_FC_ORDER 0x8000 - -#define WLAN_FC_GET_TYPE(fc) (((fc) & 0x000c) >> 2) -#define WLAN_FC_GET_STYPE(fc) (((fc) & 0x00f0) >> 4) - -#define WLAN_GET_SEQ_FRAG(seq) ((seq) & (BIT(3) | BIT(2) | BIT(1) | BIT(0))) -#define WLAN_GET_SEQ_SEQ(seq) \ - (((seq) & (~(BIT(3) | BIT(2) | BIT(1) | BIT(0)))) >> 4) - -#define WLAN_FC_TYPE_MGMT 0 -#define WLAN_FC_TYPE_CTRL 1 -#define WLAN_FC_TYPE_DATA 2 - -/* management */ -#define WLAN_FC_STYPE_ASSOC_REQ 0 -#define WLAN_FC_STYPE_ASSOC_RESP 1 -#define WLAN_FC_STYPE_REASSOC_REQ 2 -#define WLAN_FC_STYPE_REASSOC_RESP 3 -#define WLAN_FC_STYPE_PROBE_REQ 4 -#define WLAN_FC_STYPE_PROBE_RESP 5 -#define WLAN_FC_STYPE_BEACON 8 -#define WLAN_FC_STYPE_ATIM 9 -#define WLAN_FC_STYPE_DISASSOC 10 -#define WLAN_FC_STYPE_AUTH 11 -#define WLAN_FC_STYPE_DEAUTH 12 -#define WLAN_FC_STYPE_ACTION 13 - -/* control */ -#define WLAN_FC_STYPE_PSPOLL 10 -#define WLAN_FC_STYPE_RTS 11 -#define WLAN_FC_STYPE_CTS 12 -#define WLAN_FC_STYPE_ACK 13 -#define WLAN_FC_STYPE_CFEND 14 -#define WLAN_FC_STYPE_CFENDACK 15 - -/* data */ -#define WLAN_FC_STYPE_DATA 0 -#define WLAN_FC_STYPE_DATA_CFACK 1 -#define WLAN_FC_STYPE_DATA_CFPOLL 2 -#define WLAN_FC_STYPE_DATA_CFACKPOLL 3 -#define WLAN_FC_STYPE_NULLFUNC 4 -#define WLAN_FC_STYPE_CFACK 5 -#define WLAN_FC_STYPE_CFPOLL 6 -#define WLAN_FC_STYPE_CFACKPOLL 7 -#define WLAN_FC_STYPE_QOS_DATA 8 - -/* Authentication algorithms */ -#define WLAN_AUTH_OPEN 0 -#define WLAN_AUTH_SHARED_KEY 1 -#define WLAN_AUTH_FT 2 -#define WLAN_AUTH_LEAP 128 - -#define WLAN_AUTH_CHALLENGE_LEN 128 - -#define WLAN_CAPABILITY_ESS BIT(0) -#define WLAN_CAPABILITY_IBSS BIT(1) -#define WLAN_CAPABILITY_CF_POLLABLE BIT(2) -#define WLAN_CAPABILITY_CF_POLL_REQUEST BIT(3) -#define WLAN_CAPABILITY_PRIVACY BIT(4) -#define WLAN_CAPABILITY_SHORT_PREAMBLE BIT(5) -#define WLAN_CAPABILITY_PBCC BIT(6) -#define WLAN_CAPABILITY_CHANNEL_AGILITY BIT(7) -#define WLAN_CAPABILITY_SPECTRUM_MGMT BIT(8) -#define WLAN_CAPABILITY_SHORT_SLOT_TIME BIT(10) -#define WLAN_CAPABILITY_DSSS_OFDM BIT(13) - -/* Status codes (IEEE 802.11-2007, 7.3.1.9, Table 7-23) */ -#define WLAN_STATUS_SUCCESS 0 -#define WLAN_STATUS_UNSPECIFIED_FAILURE 1 -#define WLAN_STATUS_CAPS_UNSUPPORTED 10 -#define WLAN_STATUS_REASSOC_NO_ASSOC 11 -#define WLAN_STATUS_ASSOC_DENIED_UNSPEC 12 -#define WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG 13 -#define WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION 14 -#define WLAN_STATUS_CHALLENGE_FAIL 15 -#define WLAN_STATUS_AUTH_TIMEOUT 16 -#define WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA 17 -#define WLAN_STATUS_ASSOC_DENIED_RATES 18 -/* IEEE 802.11b */ -#define WLAN_STATUS_ASSOC_DENIED_NOSHORT 19 -#define WLAN_STATUS_ASSOC_DENIED_NOPBCC 20 -#define WLAN_STATUS_ASSOC_DENIED_NOAGILITY 21 -/* IEEE 802.11h */ -#define WLAN_STATUS_SPEC_MGMT_REQUIRED 22 -#define WLAN_STATUS_PWR_CAPABILITY_NOT_VALID 23 -#define WLAN_STATUS_SUPPORTED_CHANNEL_NOT_VALID 24 -/* IEEE 802.11g */ -#define WLAN_STATUS_ASSOC_DENIED_NO_SHORT_SLOT_TIME 25 -#define WLAN_STATUS_ASSOC_DENIED_NO_ER_PBCC 26 -#define WLAN_STATUS_ASSOC_DENIED_NO_DSSS_OFDM 27 -#define WLAN_STATUS_R0KH_UNREACHABLE 28 -/* IEEE 802.11w */ -#define WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY 30 -#define WLAN_STATUS_ROBUST_MGMT_FRAME_POLICY_VIOLATION 31 -#define WLAN_STATUS_UNSPECIFIED_QOS_FAILURE 32 -#define WLAN_STATUS_REQUEST_DECLINED 37 -#define WLAN_STATUS_INVALID_PARAMETERS 38 -/* IEEE 802.11i */ -#define WLAN_STATUS_INVALID_IE 40 -#define WLAN_STATUS_GROUP_CIPHER_NOT_VALID 41 -#define WLAN_STATUS_PAIRWISE_CIPHER_NOT_VALID 42 -#define WLAN_STATUS_AKMP_NOT_VALID 43 -#define WLAN_STATUS_UNSUPPORTED_RSN_IE_VERSION 44 -#define WLAN_STATUS_INVALID_RSN_IE_CAPAB 45 -#define WLAN_STATUS_CIPHER_REJECTED_PER_POLICY 46 -#define WLAN_STATUS_TS_NOT_CREATED 47 -#define WLAN_STATUS_DIRECT_LINK_NOT_ALLOWED 48 -#define WLAN_STATUS_DEST_STA_NOT_PRESENT 49 -#define WLAN_STATUS_DEST_STA_NOT_QOS_STA 50 -#define WLAN_STATUS_ASSOC_DENIED_LISTEN_INT_TOO_LARGE 51 -/* IEEE 802.11r */ -#define WLAN_STATUS_INVALID_FT_ACTION_FRAME_COUNT 52 -#define WLAN_STATUS_INVALID_PMKID 53 -#define WLAN_STATUS_INVALID_MDIE 54 -#define WLAN_STATUS_INVALID_FTIE 55 - -/* Reason codes (IEEE 802.11-2007, 7.3.1.7, Table 7-22) */ -#define WLAN_REASON_UNSPECIFIED 1 -#define WLAN_REASON_PREV_AUTH_NOT_VALID 2 -#define WLAN_REASON_DEAUTH_LEAVING 3 -#define WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY 4 -#define WLAN_REASON_DISASSOC_AP_BUSY 5 -#define WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA 6 -#define WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA 7 -#define WLAN_REASON_DISASSOC_STA_HAS_LEFT 8 -#define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9 -/* IEEE 802.11h */ -#define WLAN_REASON_PWR_CAPABILITY_NOT_VALID 10 -#define WLAN_REASON_SUPPORTED_CHANNEL_NOT_VALID 11 -/* IEEE 802.11i */ -#define WLAN_REASON_INVALID_IE 13 -#define WLAN_REASON_MICHAEL_MIC_FAILURE 14 -#define WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT 15 -#define WLAN_REASON_GROUP_KEY_UPDATE_TIMEOUT 16 -#define WLAN_REASON_IE_IN_4WAY_DIFFERS 17 -#define WLAN_REASON_GROUP_CIPHER_NOT_VALID 18 -#define WLAN_REASON_PAIRWISE_CIPHER_NOT_VALID 19 -#define WLAN_REASON_AKMP_NOT_VALID 20 -#define WLAN_REASON_UNSUPPORTED_RSN_IE_VERSION 21 -#define WLAN_REASON_INVALID_RSN_IE_CAPAB 22 -#define WLAN_REASON_IEEE_802_1X_AUTH_FAILED 23 -#define WLAN_REASON_CIPHER_SUITE_REJECTED 24 - - -/* Information Element IDs */ -#define WLAN_EID_SSID 0 -#define WLAN_EID_SUPP_RATES 1 -#define WLAN_EID_FH_PARAMS 2 -#define WLAN_EID_DS_PARAMS 3 -#define WLAN_EID_CF_PARAMS 4 -#define WLAN_EID_TIM 5 -#define WLAN_EID_IBSS_PARAMS 6 -#define WLAN_EID_COUNTRY 7 -#define WLAN_EID_CHALLENGE 16 -/* EIDs defined by IEEE 802.11h - START */ -#define WLAN_EID_PWR_CONSTRAINT 32 -#define WLAN_EID_PWR_CAPABILITY 33 -#define WLAN_EID_TPC_REQUEST 34 -#define WLAN_EID_TPC_REPORT 35 -#define WLAN_EID_SUPPORTED_CHANNELS 36 -#define WLAN_EID_CHANNEL_SWITCH 37 -#define WLAN_EID_MEASURE_REQUEST 38 -#define WLAN_EID_MEASURE_REPORT 39 -#define WLAN_EID_QUITE 40 -#define WLAN_EID_IBSS_DFS 41 -/* EIDs defined by IEEE 802.11h - END */ -#define WLAN_EID_ERP_INFO 42 -#define WLAN_EID_HT_CAP 45 -#define WLAN_EID_RSN 48 -#define WLAN_EID_EXT_SUPP_RATES 50 -#define WLAN_EID_MOBILITY_DOMAIN 54 -#define WLAN_EID_FAST_BSS_TRANSITION 55 -#define WLAN_EID_TIMEOUT_INTERVAL 56 -#define WLAN_EID_RIC_DATA 57 -#define WLAN_EID_HT_OPERATION 61 -#define WLAN_EID_SECONDARY_CHANNEL_OFFSET 62 -#define WLAN_EID_20_40_BSS_COEXISTENCE 72 -#define WLAN_EID_20_40_BSS_INTOLERANT 73 -#define WLAN_EID_OVERLAPPING_BSS_SCAN_PARAMS 74 -#define WLAN_EID_MMIE 76 -#define WLAN_EID_VENDOR_SPECIFIC 221 - - -/* Action frame categories (IEEE 802.11-2007, 7.3.1.11, Table 7-24) */ -#define WLAN_ACTION_SPECTRUM_MGMT 0 -#define WLAN_ACTION_QOS 1 -#define WLAN_ACTION_DLS 2 -#define WLAN_ACTION_BLOCK_ACK 3 -#define WLAN_ACTION_PUBLIC 4 -#define WLAN_ACTION_RADIO_MEASUREMENT 5 -#define WLAN_ACTION_FT 6 -#define WLAN_ACTION_HT 7 -#define WLAN_ACTION_SA_QUERY 8 -#define WLAN_ACTION_WMM 17 /* WMM Specification 1.1 */ - -/* SA Query Action frame (IEEE 802.11w/D8.0, 7.4.9) */ -#define WLAN_SA_QUERY_REQUEST 0 -#define WLAN_SA_QUERY_RESPONSE 1 - -#define WLAN_SA_QUERY_TR_ID_LEN 2 - -/* Timeout Interval Type */ -#define WLAN_TIMEOUT_REASSOC_DEADLINE 1 -#define WLAN_TIMEOUT_KEY_LIFETIME 2 -#define WLAN_TIMEOUT_ASSOC_COMEBACK 3 - - -#ifdef _MSC_VER -#pragma pack(push, 1) -#endif /* _MSC_VER */ - -struct ieee80211_hdr { - le16 frame_control; - le16 duration_id; - u8 addr1[6]; - u8 addr2[6]; - u8 addr3[6]; - le16 seq_ctrl; - /* followed by 'u8 addr4[6];' if ToDS and FromDS is set in data frame - */ -} STRUCT_PACKED; - -#define IEEE80211_DA_FROMDS addr1 -#define IEEE80211_BSSID_FROMDS addr2 -#define IEEE80211_SA_FROMDS addr3 - -#define IEEE80211_HDRLEN (sizeof(struct ieee80211_hdr)) - -#define IEEE80211_FC(type, stype) host_to_le16((type << 2) | (stype << 4)) - -struct ieee80211_mgmt { - le16 frame_control; - le16 duration; - u8 da[6]; - u8 sa[6]; - u8 bssid[6]; - le16 seq_ctrl; - union { - struct { - le16 auth_alg; - le16 auth_transaction; - le16 status_code; - /* possibly followed by Challenge text */ - u8 variable[0]; - } STRUCT_PACKED auth; - struct { - le16 reason_code; - } STRUCT_PACKED deauth; - struct { - le16 capab_info; - le16 listen_interval; - /* followed by SSID and Supported rates */ - u8 variable[0]; - } STRUCT_PACKED assoc_req; - struct { - le16 capab_info; - le16 status_code; - le16 aid; - /* followed by Supported rates */ - u8 variable[0]; - } STRUCT_PACKED assoc_resp, reassoc_resp; - struct { - le16 capab_info; - le16 listen_interval; - u8 current_ap[6]; - /* followed by SSID and Supported rates */ - u8 variable[0]; - } STRUCT_PACKED reassoc_req; - struct { - le16 reason_code; - } STRUCT_PACKED disassoc; - struct { - u8 timestamp[8]; - le16 beacon_int; - le16 capab_info; - /* followed by some of SSID, Supported rates, - * FH Params, DS Params, CF Params, IBSS Params, TIM */ - u8 variable[0]; - } STRUCT_PACKED beacon; - struct { - /* only variable items: SSID, Supported rates */ - u8 variable[0]; - } STRUCT_PACKED probe_req; - struct { - u8 timestamp[8]; - le16 beacon_int; - le16 capab_info; - /* followed by some of SSID, Supported rates, - * FH Params, DS Params, CF Params, IBSS Params */ - u8 variable[0]; - } STRUCT_PACKED probe_resp; - struct { - u8 category; - union { - struct { - u8 action_code; - u8 dialog_token; - u8 status_code; - u8 variable[0]; - } STRUCT_PACKED wmm_action; - struct{ - u8 action_code; - u8 element_id; - u8 length; - u8 switch_mode; - u8 new_chan; - u8 switch_count; - } STRUCT_PACKED chan_switch; - struct { - u8 action; - u8 sta_addr[ETH_ALEN]; - u8 target_ap_addr[ETH_ALEN]; - u8 variable[0]; /* FT Request */ - } STRUCT_PACKED ft_action_req; - struct { - u8 action; - u8 sta_addr[ETH_ALEN]; - u8 target_ap_addr[ETH_ALEN]; - le16 status_code; - u8 variable[0]; /* FT Request */ - } STRUCT_PACKED ft_action_resp; - struct { - u8 action; - u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN]; - } STRUCT_PACKED sa_query_req; - struct { - u8 action; /* */ - u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN]; - } STRUCT_PACKED sa_query_resp; - } u; - } STRUCT_PACKED action; - } u; -} STRUCT_PACKED; - - -struct ieee80211_ht_capabilities { - le16 ht_capabilities_info; - u8 a_mpdu_params; - u8 supported_mcs_set[16]; - le16 ht_extended_capabilities; - le32 tx_bf_capability_info; - u8 asel_capabilities; -} STRUCT_PACKED; - - -struct ieee80211_ht_operation { - u8 control_chan; - u8 ht_param; - le16 operation_mode; - le16 stbc_param; - u8 basic_set[16]; -} STRUCT_PACKED; - -#ifdef _MSC_VER -#pragma pack(pop) -#endif /* _MSC_VER */ - -#define ERP_INFO_NON_ERP_PRESENT BIT(0) -#define ERP_INFO_USE_PROTECTION BIT(1) -#define ERP_INFO_BARKER_PREAMBLE_MODE BIT(2) - - -#define HT_CAP_INFO_LDPC_CODING_CAP ((u16) BIT(0)) -#define HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET ((u16) BIT(1)) -#define HT_CAP_INFO_SMPS_MASK ((u16) (BIT(2) | BIT(3))) -#define HT_CAP_INFO_SMPS_STATIC ((u16) 0) -#define HT_CAP_INFO_SMPS_DYNAMIC ((u16) BIT(2)) -#define HT_CAP_INFO_SMPS_DISABLED ((u16) (BIT(2) | BIT(3))) -#define HT_CAP_INFO_GREEN_FIELD ((u16) BIT(4)) -#define HT_CAP_INFO_SHORT_GI20MHZ ((u16) BIT(5)) -#define HT_CAP_INFO_SHORT_GI40MHZ ((u16) BIT(6)) -#define HT_CAP_INFO_TX_STBC ((u16) BIT(7)) -#define HT_CAP_INFO_RX_STBC_MASK ((u16) (BIT(8) | BIT(9))) -#define HT_CAP_INFO_RX_STBC_1 ((u16) BIT(8)) -#define HT_CAP_INFO_RX_STBC_12 ((u16) BIT(9)) -#define HT_CAP_INFO_RX_STBC_123 ((u16) (BIT(8) | BIT(9))) -#define HT_CAP_INFO_DELAYED_BA ((u16) BIT(10)) -#define HT_CAP_INFO_MAX_AMSDU_SIZE ((u16) BIT(11)) -#define HT_CAP_INFO_DSSS_CCK40MHZ ((u16) BIT(12)) -#define HT_CAP_INFO_PSMP_SUPP ((u16) BIT(13)) -#define HT_CAP_INFO_40MHZ_INTOLERANT ((u16) BIT(14)) -#define HT_CAP_INFO_LSIG_TXOP_PROTECT_SUPPORT ((u16) BIT(15)) - - -#define EXT_HT_CAP_INFO_PCO ((u16) BIT(0)) -#define EXT_HT_CAP_INFO_TRANS_TIME_OFFSET 1 -#define EXT_HT_CAP_INFO_MCS_FEEDBACK_OFFSET 8 -#define EXT_HT_CAP_INFO_HTC_SUPPORTED ((u16) BIT(10)) -#define EXT_HT_CAP_INFO_RD_RESPONDER ((u16) BIT(11)) - - -#define TX_BEAMFORM_CAP_TXBF_CAP ((u32) BIT(0)) -#define TX_BEAMFORM_CAP_RX_STAGGERED_SOUNDING_CAP ((u32) BIT(1)) -#define TX_BEAMFORM_CAP_TX_STAGGERED_SOUNDING_CAP ((u32) BIT(2)) -#define TX_BEAMFORM_CAP_RX_ZLF_CAP ((u32) BIT(3)) -#define TX_BEAMFORM_CAP_TX_ZLF_CAP ((u32) BIT(4)) -#define TX_BEAMFORM_CAP_IMPLICIT_ZLF_CAP ((u32) BIT(5)) -#define TX_BEAMFORM_CAP_CALIB_OFFSET 6 -#define TX_BEAMFORM_CAP_EXPLICIT_CSI_TXBF_CAP ((u32) BIT(8)) -#define TX_BEAMFORM_CAP_EXPLICIT_UNCOMPR_STEERING_MATRIX_CAP ((u32) BIT(9)) -#define TX_BEAMFORM_CAP_EXPLICIT_BF_CSI_FEEDBACK_CAP ((u32) BIT(10)) -#define TX_BEAMFORM_CAP_EXPLICIT_BF_CSI_FEEDBACK_OFFSET 11 -#define TX_BEAMFORM_CAP_EXPLICIT_UNCOMPR_STEERING_MATRIX_FEEDBACK_OFFSET 13 -#define TX_BEAMFORM_CAP_EXPLICIT_COMPRESSED_STEERING_MATRIX_FEEDBACK_OFFSET 15 -#define TX_BEAMFORM_CAP_MINIMAL_GROUPING_OFFSET 17 -#define TX_BEAMFORM_CAP_CSI_NUM_BEAMFORMER_ANT_OFFSET 19 -#define TX_BEAMFORM_CAP_UNCOMPRESSED_STEERING_MATRIX_BEAMFORMER_ANT_OFFSET 21 -#define TX_BEAMFORM_CAP_COMPRESSED_STEERING_MATRIX_BEAMFORMER_ANT_OFFSET 23 -#define TX_BEAMFORM_CAP_SCI_MAX_OF_ROWS_BEANFORMER_SUPPORTED_OFFSET 25 - - -#define ASEL_CAPABILITY_ASEL_CAPABLE ((u8) BIT(0)) -#define ASEL_CAPABILITY_EXPLICIT_CSI_FEEDBACK_BASED_TX_AS_CAP ((u8) BIT(1)) -#define ASEL_CAPABILITY_ANT_INDICES_FEEDBACK_BASED_TX_AS_CAP ((u8) BIT(2)) -#define ASEL_CAPABILITY_EXPLICIT_CSI_FEEDBACK_CAP ((u8) BIT(3)) -#define ASEL_CAPABILITY_ANT_INDICES_FEEDBACK_CAP ((u8) BIT(4)) -#define ASEL_CAPABILITY_RX_AS_CAP ((u8) BIT(5)) -#define ASEL_CAPABILITY_TX_SOUND_PPDUS_CAP ((u8) BIT(6)) - -#define HT_INFO_HT_PARAM_SECONDARY_CHNL_OFF_MASK ((u8) BIT(0) | BIT(1)) -#define HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE ((u8) BIT(0)) -#define HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW ((u8) BIT(0) | BIT(1)) -#define HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH ((u8) BIT(2)) -#define HT_INFO_HT_PARAM_RIFS_MODE ((u8) BIT(3)) -#define HT_INFO_HT_PARAM_CTRL_ACCESS_ONLY ((u8) BIT(4)) -#define HT_INFO_HT_PARAM_SRV_INTERVAL_GRANULARITY ((u8) BIT(5)) - - -#define OP_MODE_PURE 0 -#define OP_MODE_MAY_BE_LEGACY_STAS 1 -#define OP_MODE_20MHZ_HT_STA_ASSOCED 2 -#define OP_MODE_MIXED 3 - -#define HT_INFO_OPERATION_MODE_OP_MODE_MASK \ - ((le16) (0x0001 | 0x0002)) -#define HT_INFO_OPERATION_MODE_OP_MODE_OFFSET 0 -#define HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT ((u8) BIT(2)) -#define HT_INFO_OPERATION_MODE_TRANSMIT_BURST_LIMIT ((u8) BIT(3)) -#define HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT ((u8) BIT(4)) - -#define HT_INFO_STBC_PARAM_DUAL_BEACON ((u16) BIT(6)) -#define HT_INFO_STBC_PARAM_DUAL_STBC_PROTECT ((u16) BIT(7)) -#define HT_INFO_STBC_PARAM_SECONDARY_BCN ((u16) BIT(8)) -#define HT_INFO_STBC_PARAM_LSIG_TXOP_PROTECT_ALLOWED ((u16) BIT(9)) -#define HT_INFO_STBC_PARAM_PCO_ACTIVE ((u16) BIT(10)) -#define HT_INFO_STBC_PARAM_PCO_PHASE ((u16) BIT(11)) - - -#define OUI_MICROSOFT 0x0050f2 /* Microsoft (also used in Wi-Fi specs) - * 00:50:F2 */ -#define WPA_IE_VENDOR_TYPE 0x0050f201 -#define WPS_IE_VENDOR_TYPE 0x0050f204 - -#define WMM_OUI_TYPE 2 -#define WMM_OUI_SUBTYPE_INFORMATION_ELEMENT 0 -#define WMM_OUI_SUBTYPE_PARAMETER_ELEMENT 1 -#define WMM_OUI_SUBTYPE_TSPEC_ELEMENT 2 -#define WMM_VERSION 1 - -#define WMM_ACTION_CODE_ADDTS_REQ 0 -#define WMM_ACTION_CODE_ADDTS_RESP 1 -#define WMM_ACTION_CODE_DELTS 2 - -#define WMM_ADDTS_STATUS_ADMISSION_ACCEPTED 0 -#define WMM_ADDTS_STATUS_INVALID_PARAMETERS 1 -/* 2 - Reserved */ -#define WMM_ADDTS_STATUS_REFUSED 3 -/* 4-255 - Reserved */ - -/* WMM TSPEC Direction Field Values */ -#define WMM_TSPEC_DIRECTION_UPLINK 0 -#define WMM_TSPEC_DIRECTION_DOWNLINK 1 -/* 2 - Reserved */ -#define WMM_TSPEC_DIRECTION_BI_DIRECTIONAL 3 - -/* - * WMM Information Element (used in (Re)Association Request frames; may also be - * used in Beacon frames) - */ -struct wmm_information_element { - /* Element ID: 221 (0xdd); Length: 7 */ - /* required fields for WMM version 1 */ - u8 oui[3]; /* 00:50:f2 */ - u8 oui_type; /* 2 */ - u8 oui_subtype; /* 0 */ - u8 version; /* 1 for WMM version 1.0 */ - u8 qos_info; /* AP/STA specific QoS info */ - -} STRUCT_PACKED; - -#define WMM_AC_AIFSN_MASK 0x0f -#define WMM_AC_AIFNS_SHIFT 0 -#define WMM_AC_ACM 0x10 -#define WMM_AC_ACI_MASK 0x60 -#define WMM_AC_ACI_SHIFT 5 - -#define WMM_AC_ECWMIN_MASK 0x0f -#define WMM_AC_ECWMIN_SHIFT 0 -#define WMM_AC_ECWMAX_MASK 0xf0 -#define WMM_AC_ECWMAX_SHIFT 4 - -struct wmm_ac_parameter { - u8 aci_aifsn; /* AIFSN, ACM, ACI */ - u8 cw; /* ECWmin, ECWmax (CW = 2^ECW - 1) */ - le16 txop_limit; -} STRUCT_PACKED; - -/* - * WMM Parameter Element (used in Beacon, Probe Response, and (Re)Association - * Response frmaes) - */ -struct wmm_parameter_element { - /* Element ID: 221 (0xdd); Length: 24 */ - /* required fields for WMM version 1 */ - u8 oui[3]; /* 00:50:f2 */ - u8 oui_type; /* 2 */ - u8 oui_subtype; /* 1 */ - u8 version; /* 1 for WMM version 1.0 */ - u8 qos_info; /* AP/STA specif QoS info */ - u8 reserved; /* 0 */ - struct wmm_ac_parameter ac[4]; /* AC_BE, AC_BK, AC_VI, AC_VO */ - -} STRUCT_PACKED; - -/* WMM TSPEC Element */ -struct wmm_tspec_element { - u8 eid; /* 221 = 0xdd */ - u8 length; /* 6 + 55 = 61 */ - u8 oui[3]; /* 00:50:f2 */ - u8 oui_type; /* 2 */ - u8 oui_subtype; /* 2 */ - u8 version; /* 1 */ - /* WMM TSPEC body (55 octets): */ - u8 ts_info[3]; - le16 nominal_msdu_size; - le16 maximum_msdu_size; - le32 minimum_service_interval; - le32 maximum_service_interval; - le32 inactivity_interval; - le32 suspension_interval; - le32 service_start_time; - le32 minimum_data_rate; - le32 mean_data_rate; - le32 peak_data_rate; - le32 maximum_burst_size; - le32 delay_bound; - le32 minimum_phy_rate; - le16 surplus_bandwidth_allowance; - le16 medium_time; -} STRUCT_PACKED; - - -/* Access Categories / ACI to AC coding */ -enum { - WMM_AC_BE = 0 /* Best Effort */, - WMM_AC_BK = 1 /* Background */, - WMM_AC_VI = 2 /* Video */, - WMM_AC_VO = 3 /* Voice */ -}; - - -#define OUI_BROADCOM 0x00904c /* Broadcom (Epigram) */ - -#define VENDOR_HT_CAPAB_OUI_TYPE 0x33 /* 00-90-4c:0x33 */ - -/* cipher suite selectors */ -#define WLAN_CIPHER_SUITE_USE_GROUP 0x000FAC00 -#define WLAN_CIPHER_SUITE_WEP40 0x000FAC01 -#define WLAN_CIPHER_SUITE_TKIP 0x000FAC02 -/* reserved: 0x000FAC03 */ -#define WLAN_CIPHER_SUITE_CCMP 0x000FAC04 -#define WLAN_CIPHER_SUITE_WEP104 0x000FAC05 -#define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06 - -/* AKM suite selectors */ -#define WLAN_AKM_SUITE_8021X 0x000FAC01 -#define WLAN_AKM_SUITE_PSK 0x000FAC02 - -#endif /* IEEE802_11_DEFS_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa/ieee802_1x.h b/tools/sdk/include/wpa_supplicant/wpa/ieee802_1x.h deleted file mode 100644 index e10ff7b3109..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa/ieee802_1x.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * hostapd / IEEE 802.1X-2004 Authenticator - * Copyright (c) 2002-2012, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef IEEE802_1X_H -#define IEEE802_1X_H - -struct hostapd_data; -struct sta_info; -struct eapol_state_machine; -struct hostapd_config; -struct hostapd_bss_config; -struct hostapd_radius_attr; -struct radius_msg; - - -void ieee802_1x_receive(struct hostapd_data *hapd, const u8 *sa, const u8 *buf, - size_t len); - -#if 0 -void ieee802_1x_new_station(struct hostapd_data *hapd, struct sta_info *sta); -void ieee802_1x_free_station(struct sta_info *sta); - -void ieee802_1x_tx_key(struct hostapd_data *hapd, struct sta_info *sta); -void ieee802_1x_abort_auth(struct hostapd_data *hapd, struct sta_info *sta); -void ieee802_1x_set_sta_authorized(struct hostapd_data *hapd, - struct sta_info *sta, int authorized); -void ieee802_1x_dump_state(FILE *f, const char *prefix, struct sta_info *sta); -int ieee802_1x_init(struct hostapd_data *hapd); -void ieee802_1x_deinit(struct hostapd_data *hapd); -int ieee802_1x_tx_status(struct hostapd_data *hapd, struct sta_info *sta, - const u8 *buf, size_t len, int ack); -int ieee802_1x_eapol_tx_status(struct hostapd_data *hapd, struct sta_info *sta, - const u8 *data, int len, int ack); -u8 * ieee802_1x_get_identity(struct eapol_state_machine *sm, size_t *len); -u8 * ieee802_1x_get_radius_class(struct eapol_state_machine *sm, size_t *len, - int idx); -struct wpabuf * ieee802_1x_get_radius_cui(struct eapol_state_machine *sm); -const u8 * ieee802_1x_get_key(struct eapol_state_machine *sm, size_t *len); -void ieee802_1x_notify_port_enabled(struct eapol_state_machine *sm, - int enabled); -void ieee802_1x_notify_port_valid(struct eapol_state_machine *sm, - int valid); -void ieee802_1x_notify_pre_auth(struct eapol_state_machine *sm, int pre_auth); -int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen); -int ieee802_1x_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta, - char *buf, size_t buflen); -void hostapd_get_ntp_timestamp(u8 *buf); -char *eap_type_text(u8 type); - -const char *radius_mode_txt(struct hostapd_data *hapd); -int radius_sta_rate(struct hostapd_data *hapd, struct sta_info *sta); - -int add_common_radius_attr(struct hostapd_data *hapd, - struct hostapd_radius_attr *req_attr, - struct sta_info *sta, - struct radius_msg *msg); -#endif - -#endif /* IEEE802_1X_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa/includes.h b/tools/sdk/include/wpa_supplicant/wpa/includes.h deleted file mode 100644 index 993bc49941e..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa/includes.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * wpa_supplicant/hostapd - Default include files - * Copyright (c) 2005-2006, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - * - * This header file is included into all C files so that commonly used header - * files can be selected with OS specific ifdef blocks in one place instead of - * having to have OS/C library specific selection in many files. - */ - -#ifndef INCLUDES_H -#define INCLUDES_H - -/* Include possible build time configuration before including anything else */ -//#include "build_config.h" //don't need anymore - -//#include -//#include -//#include -//#include -//#include - -#endif /* INCLUDES_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa/list.h b/tools/sdk/include/wpa_supplicant/wpa/list.h deleted file mode 100644 index a67a04966c6..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa/list.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Doubly-linked list - * Copyright (c) 2009, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef LIST_H -#define LIST_H - -#include - -/** - * struct dl_list - Doubly-linked list - */ -struct dl_list { - struct dl_list *next; - struct dl_list *prev; -}; - -static inline void dl_list_init(struct dl_list *list) -{ - list->next = list; - list->prev = list; -} - -static inline void dl_list_add(struct dl_list *list, struct dl_list *item) -{ - item->next = list->next; - item->prev = list; - list->next->prev = item; - list->next = item; -} - -static inline void dl_list_add_tail(struct dl_list *list, struct dl_list *item) -{ - dl_list_add(list->prev, item); -} - -static inline void dl_list_del(struct dl_list *item) -{ - item->next->prev = item->prev; - item->prev->next = item->next; - item->next = NULL; - item->prev = NULL; -} - -static inline int dl_list_empty(struct dl_list *list) -{ - return list->next == list; -} - -static inline unsigned int dl_list_len(struct dl_list *list) -{ - struct dl_list *item; - int count = 0; - for (item = list->next; item != list; item = item->next) - count++; - return count; -} - -#ifndef offsetof -#define offsetof(type, member) ((long) &((type *) 0)->member) -#endif - -#define dl_list_entry(item, type, member) \ - ((type *) ((char *) item - offsetof(type, member))) - -#define dl_list_first(list, type, member) \ - (dl_list_empty((list)) ? NULL : \ - dl_list_entry((list)->next, type, member)) - -#define dl_list_last(list, type, member) \ - (dl_list_empty((list)) ? NULL : \ - dl_list_entry((list)->prev, type, member)) - -#define dl_list_for_each(item, list, type, member) \ - for (item = dl_list_entry((list)->next, type, member); \ - &item->member != (list); \ - item = dl_list_entry(item->member.next, type, member)) - -#define dl_list_for_each_safe(item, n, list, type, member) \ - for (item = dl_list_entry((list)->next, type, member), \ - n = dl_list_entry(item->member.next, type, member); \ - &item->member != (list); \ - item = n, n = dl_list_entry(n->member.next, type, member)) - -#define dl_list_for_each_reverse(item, list, type, member) \ - for (item = dl_list_entry((list)->prev, type, member); \ - &item->member != (list); \ - item = dl_list_entry(item->member.prev, type, member)) - -#define DEFINE_DL_LIST(name) \ - struct dl_list name = { &(name), &(name) } - -#endif /* LIST_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa/sta_info.h b/tools/sdk/include/wpa_supplicant/wpa/sta_info.h deleted file mode 100644 index 44874a2ff99..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa/sta_info.h +++ /dev/null @@ -1,194 +0,0 @@ -/* - * hostapd / Station table - * Copyright (c) 2002-2011, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef STA_INFO_H -#define STA_INFO_H - -/* STA flags */ -#define WLAN_STA_AUTH BIT(0) -#define WLAN_STA_ASSOC BIT(1) -#define WLAN_STA_PS BIT(2) -#define WLAN_STA_TIM BIT(3) -#define WLAN_STA_PERM BIT(4) -#define WLAN_STA_AUTHORIZED BIT(5) -#define WLAN_STA_PENDING_POLL BIT(6) /* pending activity poll not ACKed */ -#define WLAN_STA_SHORT_PREAMBLE BIT(7) -#define WLAN_STA_PREAUTH BIT(8) -#define WLAN_STA_WMM BIT(9) -#define WLAN_STA_MFP BIT(10) -#define WLAN_STA_HT BIT(11) -#define WLAN_STA_WPS BIT(12) -#define WLAN_STA_MAYBE_WPS BIT(13) -#define WLAN_STA_WDS BIT(14) -#define WLAN_STA_ASSOC_REQ_OK BIT(15) -#define WLAN_STA_WPS2 BIT(16) -#define WLAN_STA_GAS BIT(17) -#define WLAN_STA_VHT BIT(18) -#define WLAN_STA_PENDING_DISASSOC_CB BIT(29) -#define WLAN_STA_PENDING_DEAUTH_CB BIT(30) -#define WLAN_STA_NONERP BIT(31) - -/* Maximum number of supported rates (from both Supported Rates and Extended - * Supported Rates IEs). */ -#define WLAN_SUPP_RATES_MAX 32 - - -struct sta_info { - struct sta_info *next; /* next entry in sta list */ - struct sta_info *hnext; /* next entry in hash table list */ - u8 addr[6]; - u16 aid; /* STA's unique AID (1 .. 2007) or 0 if not yet assigned */ - u32 flags; /* Bitfield of WLAN_STA_* */ - u16 capability; - u16 listen_interval; /* or beacon_int for APs */ - u8 supported_rates[WLAN_SUPP_RATES_MAX]; - int supported_rates_len; -// u8 qosinfo; /* Valid when WLAN_STA_WMM is set */ - -// unsigned int nonerp_set:1; -// unsigned int no_short_slot_time_set:1; -// unsigned int no_short_preamble_set:1; -// unsigned int no_ht_gf_set:1; -// unsigned int no_ht_set:1; -// unsigned int ht_20mhz_set:1; -// unsigned int no_p2p_set:1; - - u16 auth_alg; -// u8 previous_ap[6]; - - enum { - STA_NULLFUNC = 0, STA_DISASSOC, STA_DEAUTH, STA_REMOVE - } timeout_next; - -// u16 deauth_reason; -// u16 disassoc_reason; - - /* IEEE 802.1X related data */ -// struct eapol_state_machine *eapol_sm; - - /* IEEE 802.11f (IAPP) related data */ -// struct ieee80211_mgmt *last_assoc_req; - -// u32 acct_session_id_hi; -// u32 acct_session_id_lo; -// time_t acct_session_start; -// int acct_session_started; -// int acct_terminate_cause; /* Acct-Terminate-Cause */ -// int acct_interim_interval; /* Acct-Interim-Interval */ - -// unsigned long last_rx_bytes; -// unsigned long last_tx_bytes; -// u32 acct_input_gigawords; /* Acct-Input-Gigawords */ -// u32 acct_output_gigawords; /* Acct-Output-Gigawords */ - -// u8 *challenge; /* IEEE 802.11 Shared Key Authentication Challenge */ - - struct wpa_state_machine *wpa_sm; -// struct rsn_preauth_interface *preauth_iface; - - struct hostapd_ssid *ssid; /* SSID selection based on (Re)AssocReq */ -// struct hostapd_ssid *ssid_probe; /* SSID selection based on ProbeReq */ - -// int vlan_id; - /* PSKs from RADIUS authentication server */ -// struct hostapd_sta_wpa_psk_short *psk; - -// char *identity; /* User-Name from RADIUS */ -// char *radius_cui; /* Chargeable-User-Identity from RADIUS */ - -// struct ieee80211_ht_capabilities *ht_capabilities; -// struct ieee80211_vht_capabilities *vht_capabilities; - -#ifdef CONFIG_IEEE80211W - int sa_query_count; /* number of pending SA Query requests; - * 0 = no SA Query in progress */ - int sa_query_timed_out; - u8 *sa_query_trans_id; /* buffer of WLAN_SA_QUERY_TR_ID_LEN * - * sa_query_count octets of pending SA Query - * transaction identifiers */ - struct os_time sa_query_start; -#endif /* CONFIG_IEEE80211W */ - -#ifdef CONFIG_INTERWORKING -#define GAS_DIALOG_MAX 8 /* Max concurrent dialog number */ - struct gas_dialog_info *gas_dialog; - u8 gas_dialog_next; -#endif /* CONFIG_INTERWORKING */ - -// struct wpabuf *wps_ie; /* WPS IE from (Re)Association Request */ -// struct wpabuf *p2p_ie; /* P2P IE from (Re)Association Request */ -// struct wpabuf *hs20_ie; /* HS 2.0 IE from (Re)Association Request */ - -// struct os_time connected_time; - -#ifdef CONFIG_SAE - enum { SAE_INIT, SAE_COMMIT, SAE_CONFIRM } sae_state; - u16 sae_send_confirm; -#endif /* CONFIG_SAE */ -}; - - -/* Default value for maximum station inactivity. After AP_MAX_INACTIVITY has - * passed since last received frame from the station, a nullfunc data frame is - * sent to the station. If this frame is not acknowledged and no other frames - * have been received, the station will be disassociated after - * AP_DISASSOC_DELAY seconds. Similarly, the station will be deauthenticated - * after AP_DEAUTH_DELAY seconds has passed after disassociation. */ -#define AP_MAX_INACTIVITY (5 * 60) -#define AP_DISASSOC_DELAY (1) -#define AP_DEAUTH_DELAY (1) -/* Number of seconds to keep STA entry with Authenticated flag after it has - * been disassociated. */ -#define AP_MAX_INACTIVITY_AFTER_DISASSOC (1 * 30) -/* Number of seconds to keep STA entry after it has been deauthenticated. */ -#define AP_MAX_INACTIVITY_AFTER_DEAUTH (1 * 5) - - -struct hostapd_data; - -int ap_for_each_sta(struct hostapd_data *hapd, - int (*cb)(struct hostapd_data *hapd, struct sta_info *sta, - void *ctx), - void *ctx); -struct sta_info * ap_get_sta(struct hostapd_data *hapd, const u8 *sta); -void ap_sta_hash_add(struct hostapd_data *hapd, struct sta_info *sta); -void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta); -void hostapd_free_stas(struct hostapd_data *hapd); -void ap_handle_timer(void *eloop_ctx, void *timeout_ctx); -void ap_sta_session_timeout(struct hostapd_data *hapd, struct sta_info *sta, - u32 session_timeout); -void ap_sta_no_session_timeout(struct hostapd_data *hapd, - struct sta_info *sta); -struct sta_info * ap_sta_add(struct hostapd_data *hapd, const u8 *addr); -void ap_sta_disassociate(struct hostapd_data *hapd, struct sta_info *sta, - u16 reason); -void ap_sta_deauthenticate(struct hostapd_data *hapd, struct sta_info *sta, - u16 reason); -#ifdef CONFIG_WPS -int ap_sta_wps_cancel(struct hostapd_data *hapd, - struct sta_info *sta, void *ctx); -#endif /* CONFIG_WPS */ -int ap_sta_bind_vlan(struct hostapd_data *hapd, struct sta_info *sta, - int old_vlanid); -void ap_sta_start_sa_query(struct hostapd_data *hapd, struct sta_info *sta); -void ap_sta_stop_sa_query(struct hostapd_data *hapd, struct sta_info *sta); -int ap_check_sa_query_timeout(struct hostapd_data *hapd, struct sta_info *sta); -void ap_sta_disconnect(struct hostapd_data *hapd, struct sta_info *sta, - const u8 *addr, u16 reason); - -void ap_sta_set_authorized(struct hostapd_data *hapd, - struct sta_info *sta, int authorized); -static inline int ap_sta_is_authorized(struct sta_info *sta) -{ - return sta->flags & WLAN_STA_AUTHORIZED; -} - -void ap_sta_deauth_cb(struct hostapd_data *hapd, struct sta_info *sta); -void ap_sta_disassoc_cb(struct hostapd_data *hapd, struct sta_info *sta); - -#endif /* STA_INFO_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa/state_machine.h b/tools/sdk/include/wpa_supplicant/wpa/state_machine.h deleted file mode 100644 index ce8c51e7700..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa/state_machine.h +++ /dev/null @@ -1,138 +0,0 @@ -/* - * wpa_supplicant/hostapd - State machine definitions - * Copyright (c) 2002-2005, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - * - * This file includes a set of pre-processor macros that can be used to - * implement a state machine. In addition to including this header file, each - * file implementing a state machine must define STATE_MACHINE_DATA to be the - * data structure including state variables (enum machine_state, - * Boolean changed), and STATE_MACHINE_DEBUG_PREFIX to be a string that is used - * as a prefix for all debug messages. If SM_ENTRY_MA macro is used to define - * a group of state machines with shared data structure, STATE_MACHINE_ADDR - * needs to be defined to point to the MAC address used in debug output. - * SM_ENTRY_M macro can be used to define similar group of state machines - * without this additional debug info. - */ - -#ifndef STATE_MACHINE_H -#define STATE_MACHINE_H - -/** - * SM_STATE - Declaration of a state machine function - * @machine: State machine name - * @state: State machine state - * - * This macro is used to declare a state machine function. It is used in place - * of a C function definition to declare functions to be run when the state is - * entered by calling SM_ENTER or SM_ENTER_GLOBAL. - */ -#define SM_STATE(machine, state) \ -static void ICACHE_FLASH_ATTR sm_ ## machine ## _ ## state ## _Enter(STATE_MACHINE_DATA *sm, \ - int global) - -/** - * SM_ENTRY - State machine function entry point - * @machine: State machine name - * @state: State machine state - * - * This macro is used inside each state machine function declared with - * SM_STATE. SM_ENTRY should be in the beginning of the function body, but - * after declaration of possible local variables. This macro prints debug - * information about state transition and update the state machine state. - */ -#define SM_ENTRY(machine, state) \ -if (!global || sm->machine ## _state != machine ## _ ## state) { \ - sm->changed = TRUE; \ - wpa_printf(MSG_DEBUG, STATE_MACHINE_DEBUG_PREFIX ": " #machine \ - " entering state " #state); \ -} \ -sm->machine ## _state = machine ## _ ## state; - -/** - * SM_ENTRY_M - State machine function entry point for state machine group - * @machine: State machine name - * @_state: State machine state - * @data: State variable prefix (full variable: prefix_state) - * - * This macro is like SM_ENTRY, but for state machine groups that use a shared - * data structure for more than one state machine. Both machine and prefix - * parameters are set to "sub-state machine" name. prefix is used to allow more - * than one state variable to be stored in the same data structure. - */ -#define SM_ENTRY_M(machine, _state, data) \ -if (!global || sm->data ## _ ## state != machine ## _ ## _state) { \ - sm->changed = TRUE; \ - wpa_printf(MSG_DEBUG, STATE_MACHINE_DEBUG_PREFIX ": " \ - #machine " entering state " #_state); \ -} \ -sm->data ## _ ## state = machine ## _ ## _state; - -/** - * SM_ENTRY_MA - State machine function entry point for state machine group - * @machine: State machine name - * @_state: State machine state - * @data: State variable prefix (full variable: prefix_state) - * - * This macro is like SM_ENTRY_M, but a MAC address is included in debug - * output. STATE_MACHINE_ADDR has to be defined to point to the MAC address to - * be included in debug. - */ -#define SM_ENTRY_MA(machine, _state, data) \ -if (!global || sm->data ## _ ## state != machine ## _ ## _state) { \ - sm->changed = TRUE; \ - wpa_printf(MSG_DEBUG, STATE_MACHINE_DEBUG_PREFIX ": " MACSTR " " \ - #machine " entering state " #_state"\n", \ - MAC2STR(STATE_MACHINE_ADDR)); \ -} \ -sm->data ## _ ## state = machine ## _ ## _state; - -/** - * SM_ENTER - Enter a new state machine state - * @machine: State machine name - * @state: State machine state - * - * This macro expands to a function call to a state machine function defined - * with SM_STATE macro. SM_ENTER is used in a state machine step function to - * move the state machine to a new state. - */ -#define SM_ENTER(machine, state) \ -sm_ ## machine ## _ ## state ## _Enter(sm, 0) - -/** - * SM_ENTER_GLOBAL - Enter a new state machine state based on global rule - * @machine: State machine name - * @state: State machine state - * - * This macro is like SM_ENTER, but this is used when entering a new state - * based on a global (not specific to any particular state) rule. A separate - * macro is used to avoid unwanted debug message floods when the same global - * rule is forcing a state machine to remain in on state. - */ -#define SM_ENTER_GLOBAL(machine, state) \ -sm_ ## machine ## _ ## state ## _Enter(sm, 1) - -/** - * SM_STEP - Declaration of a state machine step function - * @machine: State machine name - * - * This macro is used to declare a state machine step function. It is used in - * place of a C function definition to declare a function that is used to move - * state machine to a new state based on state variables. This function uses - * SM_ENTER and SM_ENTER_GLOBAL macros to enter new state. - */ -#define SM_STEP(machine) \ -static void ICACHE_FLASH_ATTR sm_ ## machine ## _Step(STATE_MACHINE_DATA *sm) - -/** - * SM_STEP_RUN - Call the state machine step function - * @machine: State machine name - * - * This macro expands to a function call to a state machine step function - * defined with SM_STEP macro. - */ -#define SM_STEP_RUN(machine) sm_ ## machine ## _Step(sm) - -#endif /* STATE_MACHINE_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa/wpa.h b/tools/sdk/include/wpa_supplicant/wpa/wpa.h deleted file mode 100644 index 9d50bb1ba57..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa/wpa.h +++ /dev/null @@ -1,179 +0,0 @@ -/* - * wpa_supplicant - WPA definitions - * Copyright (c) 2003-2007, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef WPA_H -#define WPA_H - -#include "rom/ets_sys.h" -#include "common.h" -#include "wpa/defs.h" -#include "wpa/wpa_common.h" - - -#define WPA_SM_STATE(_sm) ((_sm)->wpa_state) - -struct wpa_sm; - -int wpa_sm_rx_eapol(u8 *src_addr, u8 *buf, u32 len); - -#define WPA_ASSERT ASSERT - -struct install_key { - int mic_errors_seen; /* Michael MIC errors with the current PTK */ - int keys_cleared; - enum wpa_alg alg; - u8 addr[ETH_ALEN]; - int key_idx; - int set_tx; - u8 seq[10]; - u8 key[32]; -}; - -/** - * struct wpa_sm - Internal WPA state machine data - */ -struct wpa_sm { - u8 pmk[PMK_LEN]; - size_t pmk_len; - - struct wpa_ptk ptk, tptk; - int ptk_set, tptk_set; - u8 snonce[WPA_NONCE_LEN]; - u8 anonce[WPA_NONCE_LEN]; /* ANonce from the last 1/4 msg */ - int renew_snonce; - u8 rx_replay_counter[WPA_REPLAY_COUNTER_LEN]; - int rx_replay_counter_set; - u8 request_counter[WPA_REPLAY_COUNTER_LEN]; - - unsigned int pairwise_cipher; - unsigned int group_cipher; - unsigned int key_mgmt; - unsigned int mgmt_group_cipher; - - int rsn_enabled; /* Whether RSN is enabled in configuration */ - - int countermeasures; /*TKIP countermeasures state flag, 1:in countermeasures state*/ - ETSTimer cm_timer; - - u8 *assoc_wpa_ie; /* Own WPA/RSN IE from (Re)AssocReq */ - size_t assoc_wpa_ie_len; - - u8 eapol_version; - - int wpa_ptk_rekey; - u8 own_addr[ETH_ALEN]; - - u8 bssid[ETH_ALEN]; - - unsigned int proto; - enum wpa_states wpa_state; - - u8 *ap_wpa_ie, *ap_rsn_ie; - size_t ap_wpa_ie_len, ap_rsn_ie_len; - - struct install_key install_ptk; - struct install_key install_gtk; - int key_entry_valid; //present current avaliable entry for bssid, for pairkey:0,5,10,15,20, gtk: pairkey_no+i (i:1~4) - - struct pbuf *pb; - - void (* sendto) (struct pbuf *pb); - void (*config_assoc_ie) (u8 proto, u8 *assoc_buf, u32 assoc_wpa_ie_len); - void (*install_ppkey) (enum wpa_alg alg, u8 *addr, int key_idx, int set_tx, - u8 *seq, unsigned int seq_len, u8 *key, unsigned int key_len, int key_entry_valid); - void (*wpa_deauthenticate)(u8 reason_code); - void (*wpa_neg_complete)(); - struct wpa_gtk_data gd; //used for calllback save param - u16 key_info; //used for txcallback param -}; - -struct l2_ethhdr { - u8 h_dest[ETH_ALEN]; - u8 h_source[ETH_ALEN]; - be16 h_proto; -} STRUCT_PACKED; - -/** - * set_key - Configure encryption key - * @ifname: Interface name (for multi-SSID/VLAN support) - * @priv: private driver interface data - * @alg: encryption algorithm (%WPA_ALG_NONE, %WPA_ALG_WEP, - * %WPA_ALG_TKIP, %WPA_ALG_CCMP, %WPA_ALG_IGTK, %WPA_ALG_PMK); - * %WPA_ALG_NONE clears the key. - * @addr: address of the peer STA or ff:ff:ff:ff:ff:ff for - * broadcast/default keys - * @key_idx: key index (0..3), usually 0 for unicast keys; 0..4095 for - * IGTK - * @set_tx: configure this key as the default Tx key (only used when - * driver does not support separate unicast/individual key - * @seq: sequence number/packet number, seq_len octets, the next - * packet number to be used for in replay protection; configured - * for Rx keys (in most cases, this is only used with broadcast - * keys and set to zero for unicast keys) - * @seq_len: length of the seq, depends on the algorithm: - * TKIP: 6 octets, CCMP: 6 octets, IGTK: 6 octets - * @key: key buffer; TKIP: 16-byte temporal key, 8-byte Tx Mic key, - * 8-byte Rx Mic Key - * @key_len: length of the key buffer in octets (WEP: 5 or 13, - * TKIP: 32, CCMP: 16, IGTK: 16) - * - * Returns: 0 on success, -1 on failure - * - * Configure the given key for the kernel driver. If the driver - * supports separate individual keys (4 default keys + 1 individual), - * addr can be used to determine whether the key is default or - * individual. If only 4 keys are supported, the default key with key - * index 0 is used as the individual key. STA must be configured to use - * it as the default Tx key (set_tx is set) and accept Rx for all the - * key indexes. In most cases, WPA uses only key indexes 1 and 2 for - * broadcast keys, so key index 0 is available for this kind of - * configuration. - * - * Please note that TKIP keys include separate TX and RX MIC keys and - * some drivers may expect them in different order than wpa_supplicant - * is using. If the TX/RX keys are swapped, all TKIP encrypted packets - * will tricker Michael MIC errors. This can be fixed by changing the - * order of MIC keys by swapping te bytes 16..23 and 24..31 of the key - * in driver_*.c set_key() implementation, see driver_ndis.c for an - * example on how this can be done. - */ - - -/** - * send_eapol - Optional function for sending EAPOL packets - * @priv: private driver interface data - * @dest: Destination MAC address - * @proto: Ethertype - * @data: EAPOL packet starting with IEEE 802.1X header - * @data_len: Size of the EAPOL packet - * - * Returns: 0 on success, -1 on failure - * - * This optional function can be used to override l2_packet operations - * with driver specific functionality. If this function pointer is set, - * l2_packet module is not used at all and the driver interface code is - * responsible for receiving and sending all EAPOL packets. The - * received EAPOL packets are sent to core code with EVENT_EAPOL_RX - * event. The driver interface is required to implement get_mac_addr() - * handler if send_eapol() is used. - */ - -#define KEYENTRY_TABLE_MAP(key_entry_valid) ((key_entry_valid)%5) - -void wpa_sm_set_state(enum wpa_states state); - -char * dup_binstr(const void *src, size_t len); - -#endif /* WPA_H */ - diff --git a/tools/sdk/include/wpa_supplicant/wpa/wpa_auth.h b/tools/sdk/include/wpa_supplicant/wpa/wpa_auth.h deleted file mode 100644 index c7299234944..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa/wpa_auth.h +++ /dev/null @@ -1,292 +0,0 @@ -/* - * hostapd - IEEE 802.11i-2004 / WPA Authenticator - * Copyright (c) 2004-2007, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef WPA_AUTH_H -#define WPA_AUTH_H - -#include "wpa/defs.h" -#include "wpa/eapol_common.h" -#include "wpa/wpa_common.h" - -#ifdef _MSC_VER -#pragma pack(push, 1) -#endif /* _MSC_VER */ - -/* IEEE Std 802.11r-2008, 11A.10.3 - Remote request/response frame definition - */ -struct ft_rrb_frame { - u8 frame_type; /* RSN_REMOTE_FRAME_TYPE_FT_RRB */ - u8 packet_type; /* FT_PACKET_REQUEST/FT_PACKET_RESPONSE */ - le16 action_length; /* little endian length of action_frame */ - u8 ap_address[ETH_ALEN]; - /* - * Followed by action_length bytes of FT Action frame (from Category - * field to the end of Action Frame body. - */ -} STRUCT_PACKED; - -#define RSN_REMOTE_FRAME_TYPE_FT_RRB 1 - -#define FT_PACKET_REQUEST 0 -#define FT_PACKET_RESPONSE 1 -/* Vendor-specific types for R0KH-R1KH protocol; not defined in 802.11r */ -#define FT_PACKET_R0KH_R1KH_PULL 200 -#define FT_PACKET_R0KH_R1KH_RESP 201 -#define FT_PACKET_R0KH_R1KH_PUSH 202 - -#define FT_R0KH_R1KH_PULL_DATA_LEN 44 -#define FT_R0KH_R1KH_RESP_DATA_LEN 76 -#define FT_R0KH_R1KH_PUSH_DATA_LEN 88 - -struct ft_r0kh_r1kh_pull_frame { - u8 frame_type; /* RSN_REMOTE_FRAME_TYPE_FT_RRB */ - u8 packet_type; /* FT_PACKET_R0KH_R1KH_PULL */ - le16 data_length; /* little endian length of data (44) */ - u8 ap_address[ETH_ALEN]; - - u8 nonce[16]; - u8 pmk_r0_name[WPA_PMK_NAME_LEN]; - u8 r1kh_id[FT_R1KH_ID_LEN]; - u8 s1kh_id[ETH_ALEN]; - u8 pad[4]; /* 8-octet boundary for AES key wrap */ - u8 key_wrap_extra[8]; -} STRUCT_PACKED; - -struct ft_r0kh_r1kh_resp_frame { - u8 frame_type; /* RSN_REMOTE_FRAME_TYPE_FT_RRB */ - u8 packet_type; /* FT_PACKET_R0KH_R1KH_RESP */ - le16 data_length; /* little endian length of data (76) */ - u8 ap_address[ETH_ALEN]; - - u8 nonce[16]; /* copied from pull */ - u8 r1kh_id[FT_R1KH_ID_LEN]; /* copied from pull */ - u8 s1kh_id[ETH_ALEN]; /* copied from pull */ - u8 pmk_r1[PMK_LEN]; - u8 pmk_r1_name[WPA_PMK_NAME_LEN]; - le16 pairwise; - u8 pad[2]; /* 8-octet boundary for AES key wrap */ - u8 key_wrap_extra[8]; -} STRUCT_PACKED; - -struct ft_r0kh_r1kh_push_frame { - u8 frame_type; /* RSN_REMOTE_FRAME_TYPE_FT_RRB */ - u8 packet_type; /* FT_PACKET_R0KH_R1KH_PUSH */ - le16 data_length; /* little endian length of data (88) */ - u8 ap_address[ETH_ALEN]; - - /* Encrypted with AES key-wrap */ - u8 timestamp[4]; /* current time in seconds since unix epoch, little - * endian */ - u8 r1kh_id[FT_R1KH_ID_LEN]; - u8 s1kh_id[ETH_ALEN]; - u8 pmk_r0_name[WPA_PMK_NAME_LEN]; - u8 pmk_r1[PMK_LEN]; - u8 pmk_r1_name[WPA_PMK_NAME_LEN]; - le16 pairwise; - u8 pad[6]; /* 8-octet boundary for AES key wrap */ - u8 key_wrap_extra[8]; -} STRUCT_PACKED; - -#ifdef _MSC_VER -#pragma pack(pop) -#endif /* _MSC_VER */ - - -/* per STA state machine data */ - -struct wpa_authenticator; -struct wpa_state_machine; -struct rsn_pmksa_cache_entry; -struct eapol_state_machine; - - -struct ft_remote_r0kh { - struct ft_remote_r0kh *next; - u8 addr[ETH_ALEN]; - u8 id[FT_R0KH_ID_MAX_LEN]; - size_t id_len; - u8 key[16]; -}; - - -struct ft_remote_r1kh { - struct ft_remote_r1kh *next; - u8 addr[ETH_ALEN]; - u8 id[FT_R1KH_ID_LEN]; - u8 key[16]; -}; - - -struct wpa_auth_config { - int wpa; - int wpa_key_mgmt; - int wpa_pairwise; - int wpa_group; - int wpa_group_rekey; - int wpa_strict_rekey; - int wpa_gmk_rekey; - int wpa_ptk_rekey; - int rsn_pairwise; - int rsn_preauth; - int eapol_version; - int peerkey; - int wmm_enabled; - int wmm_uapsd; - int disable_pmksa_caching; - int okc; - int tx_status; -#ifdef CONFIG_IEEE80211W - enum mfp_options ieee80211w; -#endif /* CONFIG_IEEE80211W */ -#ifdef CONFIG_IEEE80211R -#define SSID_LEN 32 - u8 ssid[SSID_LEN]; - size_t ssid_len; - u8 mobility_domain[MOBILITY_DOMAIN_ID_LEN]; - u8 r0_key_holder[FT_R0KH_ID_MAX_LEN]; - size_t r0_key_holder_len; - u8 r1_key_holder[FT_R1KH_ID_LEN]; - u32 r0_key_lifetime; - u32 reassociation_deadline; - struct ft_remote_r0kh *r0kh_list; - struct ft_remote_r1kh *r1kh_list; - int pmk_r1_push; - int ft_over_ds; -#endif /* CONFIG_IEEE80211R */ - int disable_gtk; - int ap_mlme; -}; - -typedef enum { - LOGGER_DEBUG, LOGGER_INFO, LOGGER_WARNING -} logger_level; - -typedef enum { - WPA_EAPOL_portEnabled, WPA_EAPOL_portValid, WPA_EAPOL_authorized, - WPA_EAPOL_portControl_Auto, WPA_EAPOL_keyRun, WPA_EAPOL_keyAvailable, - WPA_EAPOL_keyDone, WPA_EAPOL_inc_EapolFramesTx -} wpa_eapol_variable; - -struct wpa_auth_callbacks { - void *ctx; - void (*logger)(void *ctx, const u8 *addr, logger_level level, - const char *txt); - void (*disconnect)(void *ctx, const u8 *addr, u16 reason); - int (*mic_failure_report)(void *ctx, const u8 *addr); - void (*set_eapol)(void *ctx, const u8 *addr, wpa_eapol_variable var, - int value); - int (*get_eapol)(void *ctx, const u8 *addr, wpa_eapol_variable var); - const u8 * (*get_psk)(void *ctx, const u8 *addr, const u8 *prev_psk); - int (*get_msk)(void *ctx, const u8 *addr, u8 *msk, size_t *len); - int (*set_key)(void *ctx, int vlan_id, enum wpa_alg alg, - const u8 *addr, int idx, u8 *key, size_t key_len); - int (*get_seqnum)(void *ctx, const u8 *addr, int idx, u8 *seq); - int (*send_eapol)(void *ctx, const u8 *addr, const u8 *data, - size_t data_len, int encrypt); - int (*for_each_sta)(void *ctx, int (*cb)(struct wpa_state_machine *sm, - void *ctx), void *cb_ctx); - int (*for_each_auth)(void *ctx, int (*cb)(struct wpa_authenticator *a, - void *ctx), void *cb_ctx); - int (*send_ether)(void *ctx, const u8 *dst, u16 proto, const u8 *data, - size_t data_len); -#ifdef CONFIG_IEEE80211R - struct wpa_state_machine * (*add_sta)(void *ctx, const u8 *sta_addr); - int (*send_ft_action)(void *ctx, const u8 *dst, - const u8 *data, size_t data_len); - int (*add_tspec)(void *ctx, const u8 *sta_addr, u8 *tspec_ie, - size_t tspec_ielen); -#endif /* CONFIG_IEEE80211R */ -}; - -struct wpa_authenticator * wpa_init(const u8 *addr, - struct wpa_auth_config *conf, - struct wpa_auth_callbacks *cb); -int wpa_init_keys(struct wpa_authenticator *wpa_auth); -void wpa_deinit(struct wpa_authenticator *wpa_auth); -int wpa_reconfig(struct wpa_authenticator *wpa_auth, - struct wpa_auth_config *conf); - -enum { - WPA_IE_OK, WPA_INVALID_IE, WPA_INVALID_GROUP, WPA_INVALID_PAIRWISE, - WPA_INVALID_AKMP, WPA_NOT_ENABLED, WPA_ALLOC_FAIL, - WPA_MGMT_FRAME_PROTECTION_VIOLATION, WPA_INVALID_MGMT_GROUP_CIPHER, - WPA_INVALID_MDIE, WPA_INVALID_PROTO -}; - -int wpa_validate_wpa_ie(struct wpa_authenticator *wpa_auth, - struct wpa_state_machine *sm, - const u8 *wpa_ie, size_t wpa_ie_len/*, - const u8 *mdie, size_t mdie_len*/); -int wpa_auth_uses_mfp(struct wpa_state_machine *sm); -struct wpa_state_machine * -wpa_auth_sta_init(struct wpa_authenticator *wpa_auth, const u8 *addr); -int wpa_auth_sta_associated(struct wpa_authenticator *wpa_auth, - struct wpa_state_machine *sm); -void wpa_auth_sta_no_wpa(struct wpa_state_machine *sm); -void wpa_auth_sta_deinit(struct wpa_state_machine *sm); -void wpa_receive(struct wpa_authenticator *wpa_auth, - struct wpa_state_machine *sm, - u8 *data, size_t data_len); -typedef enum { - WPA_AUTH, WPA_ASSOC, WPA_DISASSOC, WPA_DEAUTH, WPA_REAUTH, - WPA_REAUTH_EAPOL, WPA_ASSOC_FT -} wpa_event; -void wpa_remove_ptk(struct wpa_state_machine *sm); -int wpa_auth_sm_event(struct wpa_state_machine *sm, wpa_event event); -void wpa_auth_sm_notify(struct wpa_state_machine *sm); -void wpa_gtk_rekey(struct wpa_authenticator *wpa_auth); -int wpa_get_mib(struct wpa_authenticator *wpa_auth, char *buf, size_t buflen); -int wpa_get_mib_sta(struct wpa_state_machine *sm, char *buf, size_t buflen); -void wpa_auth_countermeasures_start(struct wpa_authenticator *wpa_auth); -int wpa_auth_pairwise_set(struct wpa_state_machine *sm); -int wpa_auth_get_pairwise(struct wpa_state_machine *sm); -int wpa_auth_sta_key_mgmt(struct wpa_state_machine *sm); -int wpa_auth_sta_wpa_version(struct wpa_state_machine *sm); -int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm, - struct rsn_pmksa_cache_entry *entry); -struct rsn_pmksa_cache_entry * -wpa_auth_sta_get_pmksa(struct wpa_state_machine *sm); -void wpa_auth_sta_local_mic_failure_report(struct wpa_state_machine *sm); -const u8 * wpa_auth_get_wpa_ie(struct wpa_authenticator *wpa_auth, - size_t *len); -int wpa_auth_pmksa_add(struct wpa_state_machine *sm, const u8 *pmk, - int session_timeout, struct eapol_state_machine *eapol); -int wpa_auth_pmksa_add_preauth(struct wpa_authenticator *wpa_auth, - const u8 *pmk, size_t len, const u8 *sta_addr, - int session_timeout, - struct eapol_state_machine *eapol); -int wpa_auth_sta_set_vlan(struct wpa_state_machine *sm, int vlan_id); -void wpa_auth_eapol_key_tx_status(struct wpa_authenticator *wpa_auth, - struct wpa_state_machine *sm, int ack); - -#ifdef CONFIG_IEEE80211R -u8 * wpa_sm_write_assoc_resp_ies(struct wpa_state_machine *sm, u8 *pos, - size_t max_len, int auth_alg, - const u8 *req_ies, size_t req_ies_len); -void wpa_ft_process_auth(struct wpa_state_machine *sm, const u8 *bssid, - u16 auth_transaction, const u8 *ies, size_t ies_len, - void (*cb)(void *ctx, const u8 *dst, const u8 *bssid, - u16 auth_transaction, u16 resp, - const u8 *ies, size_t ies_len), - void *ctx); -u16 wpa_ft_validate_reassoc(struct wpa_state_machine *sm, const u8 *ies, - size_t ies_len); -int wpa_ft_action_rx(struct wpa_state_machine *sm, const u8 *data, size_t len); -int wpa_ft_rrb_rx(struct wpa_authenticator *wpa_auth, const u8 *src_addr, - const u8 *data, size_t data_len); -void wpa_ft_push_pmk_r1(struct wpa_authenticator *wpa_auth, const u8 *addr); -#endif /* CONFIG_IEEE80211R */ - -void wpa_wnmsleep_rekey_gtk(struct wpa_state_machine *sm); -void wpa_set_wnmsleep(struct wpa_state_machine *sm, int flag); -int wpa_wnmsleep_gtk_subelem(struct wpa_state_machine *sm, u8 *pos); -int wpa_wnmsleep_igtk_subelem(struct wpa_state_machine *sm, u8 *pos); - -int wpa_auth_uses_sae(struct wpa_state_machine *sm); - -#endif /* WPA_AUTH_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa/wpa_auth_i.h b/tools/sdk/include/wpa_supplicant/wpa/wpa_auth_i.h deleted file mode 100644 index 53ad8ea941d..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa/wpa_auth_i.h +++ /dev/null @@ -1,234 +0,0 @@ -/* - * hostapd - IEEE 802.11i-2004 / WPA Authenticator: Internal definitions - * Copyright (c) 2004-2007, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef WPA_AUTH_I_H -#define WPA_AUTH_I_H - -/* max(dot11RSNAConfigGroupUpdateCount,dot11RSNAConfigPairwiseUpdateCount) */ -#define RSNA_MAX_EAPOL_RETRIES 4 - -struct wpa_group; - -struct wpa_stsl_negotiation { - struct wpa_stsl_negotiation *next; - u8 initiator[ETH_ALEN]; - u8 peer[ETH_ALEN]; -}; - - -struct wpa_state_machine { - struct wpa_authenticator *wpa_auth; - struct wpa_group *group; - - u8 addr[ETH_ALEN]; - - enum { - WPA_PTK_INITIALIZE, WPA_PTK_DISCONNECT, WPA_PTK_DISCONNECTED, - WPA_PTK_AUTHENTICATION, WPA_PTK_AUTHENTICATION2, - WPA_PTK_INITPMK, WPA_PTK_INITPSK, WPA_PTK_PTKSTART, - WPA_PTK_PTKCALCNEGOTIATING, WPA_PTK_PTKCALCNEGOTIATING2, - WPA_PTK_PTKINITNEGOTIATING, WPA_PTK_PTKINITDONE - } wpa_ptk_state; - - enum { - WPA_PTK_GROUP_IDLE = 0, - WPA_PTK_GROUP_REKEYNEGOTIATING, - WPA_PTK_GROUP_REKEYESTABLISHED, - WPA_PTK_GROUP_KEYERROR - } wpa_ptk_group_state; - - Boolean Init; - Boolean DeauthenticationRequest; - Boolean AuthenticationRequest; - Boolean ReAuthenticationRequest; - Boolean Disconnect; - int TimeoutCtr; - int GTimeoutCtr; - Boolean TimeoutEvt; - Boolean EAPOLKeyReceived; - Boolean EAPOLKeyPairwise; - Boolean EAPOLKeyRequest; - Boolean MICVerified; - Boolean GUpdateStationKeys; - u8 ANonce[WPA_NONCE_LEN]; - u8 SNonce[WPA_NONCE_LEN]; - u8 PMK[PMK_LEN]; - struct wpa_ptk PTK; - Boolean PTK_valid; - Boolean pairwise_set; - int keycount; - Boolean Pair; - struct wpa_key_replay_counter { - u8 counter[WPA_REPLAY_COUNTER_LEN]; - Boolean valid; - } key_replay[RSNA_MAX_EAPOL_RETRIES], - prev_key_replay[RSNA_MAX_EAPOL_RETRIES]; - Boolean PInitAKeys; /* WPA only, not in IEEE 802.11i */ - Boolean PTKRequest; /* not in IEEE 802.11i state machine */ - Boolean has_GTK; - Boolean PtkGroupInit; /* init request for PTK Group state machine */ - - u8 *last_rx_eapol_key; /* starting from IEEE 802.1X header */ - size_t last_rx_eapol_key_len; - - unsigned int changed:1; - unsigned int in_step_loop:1; - unsigned int pending_deinit:1; - unsigned int started:1; - unsigned int mgmt_frame_prot:1; - unsigned int rx_eapol_key_secure:1; - unsigned int update_snonce:1; -#ifdef CONFIG_IEEE80211R - unsigned int ft_completed:1; - unsigned int pmk_r1_name_valid:1; -#endif /* CONFIG_IEEE80211R */ - unsigned int is_wnmsleep:1; - - u8 req_replay_counter[WPA_REPLAY_COUNTER_LEN]; - int req_replay_counter_used; - - u8 *wpa_ie; - size_t wpa_ie_len; - - enum { - WPA_VERSION_NO_WPA = 0 /* WPA not used */, - WPA_VERSION_WPA = 1 /* WPA / IEEE 802.11i/D3.0 */, - WPA_VERSION_WPA2 = 2 /* WPA2 / IEEE 802.11i */ - } wpa; - int pairwise; /* Pairwise cipher suite, WPA_CIPHER_* */ - int wpa_key_mgmt; /* the selected WPA_KEY_MGMT_* */ -// struct rsn_pmksa_cache_entry *pmksa; - -// u32 dot11RSNAStatsTKIPLocalMICFailures; -// u32 dot11RSNAStatsTKIPRemoteMICFailures; - -#ifdef CONFIG_IEEE80211R - u8 xxkey[PMK_LEN]; /* PSK or the second 256 bits of MSK */ - size_t xxkey_len; - u8 pmk_r1_name[WPA_PMK_NAME_LEN]; /* PMKR1Name derived from FT Auth - * Request */ - u8 r0kh_id[FT_R0KH_ID_MAX_LEN]; /* R0KH-ID from FT Auth Request */ - size_t r0kh_id_len; - u8 sup_pmk_r1_name[WPA_PMK_NAME_LEN]; /* PMKR1Name from EAPOL-Key - * message 2/4 */ - u8 *assoc_resp_ftie; -#endif /* CONFIG_IEEE80211R */ - - int pending_1_of_4_timeout; -}; - - -/* per group key state machine data */ -struct wpa_group { - struct wpa_group *next; - int vlan_id; - - Boolean GInit; - int GKeyDoneStations; - Boolean GTKReKey; - int GTK_len; - int GN, GM; - Boolean GTKAuthenticator; - u8 Counter[WPA_NONCE_LEN]; - - enum { - WPA_GROUP_GTK_INIT = 0, - WPA_GROUP_SETKEYS, WPA_GROUP_SETKEYSDONE - } wpa_group_state; - - u8 GMK[WPA_GMK_LEN]; - u8 GTK[2][WPA_GTK_MAX_LEN]; - u8 GNonce[WPA_NONCE_LEN]; - Boolean changed; - Boolean first_sta_seen; - Boolean reject_4way_hs_for_entropy; -#ifdef CONFIG_IEEE80211W - u8 IGTK[2][WPA_IGTK_LEN]; - int GN_igtk, GM_igtk; -#endif /* CONFIG_IEEE80211W */ -}; - - -struct wpa_ft_pmk_cache; - -/* per authenticator data */ -struct wpa_authenticator { - struct wpa_group *group; - -// unsigned int dot11RSNAStatsTKIPRemoteMICFailures; -// u32 dot11RSNAAuthenticationSuiteSelected; -// u32 dot11RSNAPairwiseCipherSelected; -// u32 dot11RSNAGroupCipherSelected; -// u8 dot11RSNAPMKIDUsed[PMKID_LEN]; -// u32 dot11RSNAAuthenticationSuiteRequested; /* FIX: update */ -// u32 dot11RSNAPairwiseCipherRequested; /* FIX: update */ -// u32 dot11RSNAGroupCipherRequested; /* FIX: update */ -// unsigned int dot11RSNATKIPCounterMeasuresInvoked; -// unsigned int dot11RSNA4WayHandshakeFailures; - -// struct wpa_stsl_negotiation *stsl_negotiations; - - struct wpa_auth_config conf; -// struct wpa_auth_callbacks cb; - - u8 *wpa_ie; - size_t wpa_ie_len; - - u8 addr[ETH_ALEN]; - -// struct rsn_pmksa_cache *pmksa; -// struct wpa_ft_pmk_cache *ft_pmk_cache; -}; - - -int wpa_write_rsn_ie(struct wpa_auth_config *conf, u8 *buf, size_t len, - const u8 *pmkid); -#if 0 -void wpa_auth_logger(struct wpa_authenticator *wpa_auth, const u8 *addr, - logger_level level, const char *txt); -void wpa_auth_vlogger(struct wpa_authenticator *wpa_auth, const u8 *addr, - logger_level level, const char *fmt, ...); -#endif -void __wpa_send_eapol(struct wpa_authenticator *wpa_auth, - struct wpa_state_machine *sm, int key_info, - const u8 *key_rsc, const u8 *nonce, - const u8 *kde, size_t kde_len, - int keyidx, int encr, int force_version); -int wpa_auth_for_each_sta(struct wpa_authenticator *wpa_auth, - int (*cb)(struct wpa_state_machine *sm, void *ctx), - void *cb_ctx); -int wpa_auth_for_each_auth(struct wpa_authenticator *wpa_auth, - int (*cb)(struct wpa_authenticator *a, void *ctx), - void *cb_ctx); - -#ifdef CONFIG_PEERKEY -int wpa_stsl_remove(struct wpa_authenticator *wpa_auth, - struct wpa_stsl_negotiation *neg); -void wpa_smk_error(struct wpa_authenticator *wpa_auth, - struct wpa_state_machine *sm, struct wpa_eapol_key *key); -void wpa_smk_m1(struct wpa_authenticator *wpa_auth, - struct wpa_state_machine *sm, struct wpa_eapol_key *key); -void wpa_smk_m3(struct wpa_authenticator *wpa_auth, - struct wpa_state_machine *sm, struct wpa_eapol_key *key); -#endif /* CONFIG_PEERKEY */ - -#ifdef CONFIG_IEEE80211R -int wpa_write_mdie(struct wpa_auth_config *conf, u8 *buf, size_t len); -int wpa_write_ftie(struct wpa_auth_config *conf, const u8 *r0kh_id, - size_t r0kh_id_len, - const u8 *anonce, const u8 *snonce, - u8 *buf, size_t len, const u8 *subelem, - size_t subelem_len); -int wpa_auth_derive_ptk_ft(struct wpa_state_machine *sm, const u8 *pmk, - struct wpa_ptk *ptk, size_t ptk_len); -struct wpa_ft_pmk_cache * wpa_ft_pmk_cache_init(void); -void wpa_ft_pmk_cache_deinit(struct wpa_ft_pmk_cache *cache); -void wpa_ft_install_ptk(struct wpa_state_machine *sm); -#endif /* CONFIG_IEEE80211R */ - -#endif /* WPA_AUTH_I_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa/wpa_auth_ie.h b/tools/sdk/include/wpa_supplicant/wpa/wpa_auth_ie.h deleted file mode 100644 index 4999139510e..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa/wpa_auth_ie.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * hostapd - WPA/RSN IE and KDE definitions - * Copyright (c) 2004-2007, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef WPA_AUTH_IE_H -#define WPA_AUTH_IE_H - -struct wpa_eapol_ie_parse { - const u8 *wpa_ie; - size_t wpa_ie_len; - const u8 *rsn_ie; - size_t rsn_ie_len; - const u8 *pmkid; - const u8 *gtk; - size_t gtk_len; - const u8 *mac_addr; - size_t mac_addr_len; -#ifdef CONFIG_PEERKEY - const u8 *smk; - size_t smk_len; - const u8 *nonce; - size_t nonce_len; - const u8 *lifetime; - size_t lifetime_len; - const u8 *error; - size_t error_len; -#endif /* CONFIG_PEERKEY */ -#ifdef CONFIG_IEEE80211W - const u8 *igtk; - size_t igtk_len; -#endif /* CONFIG_IEEE80211W */ -#ifdef CONFIG_IEEE80211R - const u8 *mdie; - size_t mdie_len; - const u8 *ftie; - size_t ftie_len; -#endif /* CONFIG_IEEE80211R */ -}; - -int wpa_parse_kde_ies(const u8 *buf, size_t len, - struct wpa_eapol_ie_parse *ie); -u8 * wpa_add_kde(u8 *pos, u32 kde, const u8 *data, size_t data_len, - const u8 *data2, size_t data2_len); -int wpa_auth_gen_wpa_ie(struct wpa_authenticator *wpa_auth); - -#endif /* WPA_AUTH_IE_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa/wpa_common.h b/tools/sdk/include/wpa_supplicant/wpa/wpa_common.h deleted file mode 100644 index 480cf0e27e6..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa/wpa_common.h +++ /dev/null @@ -1,332 +0,0 @@ -/* - * WPA definitions shared between hostapd and wpa_supplicant - * Copyright (c) 2002-2008, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#include "os.h" -#ifndef WPA_COMMON_H -#define WPA_COMMON_H - -#define WPA_MAX_SSID_LEN 32 - -/* IEEE 802.11i */ -#define PMKID_LEN 16 -#define PMK_LEN 32 -#define WPA_REPLAY_COUNTER_LEN 8 -#define WPA_NONCE_LEN 32 -#define WPA_KEY_RSC_LEN 8 -#define WPA_GMK_LEN 32 -#define WPA_GTK_MAX_LEN 32 - -#define WPA_SELECTOR_LEN 4 -#define WPA_VERSION 1 -#define RSN_SELECTOR_LEN 4 -#define RSN_VERSION 1 - -#define RSN_SELECTOR(a, b, c, d) \ - ((((u32) (a)) << 24) | (((u32) (b)) << 16) | (((u32) (c)) << 8) | \ - (u32) (d)) - -#define WPA_AUTH_KEY_MGMT_NONE RSN_SELECTOR(0x00, 0x50, 0xf2, 0) -#define WPA_AUTH_KEY_MGMT_UNSPEC_802_1X RSN_SELECTOR(0x00, 0x50, 0xf2, 1) -#define WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X RSN_SELECTOR(0x00, 0x50, 0xf2, 2) -#define WPA_CIPHER_SUITE_NONE RSN_SELECTOR(0x00, 0x50, 0xf2, 0) -#define WPA_CIPHER_SUITE_WEP40 RSN_SELECTOR(0x00, 0x50, 0xf2, 1) -#define WPA_CIPHER_SUITE_TKIP RSN_SELECTOR(0x00, 0x50, 0xf2, 2) -#if 0 -#define WPA_CIPHER_SUITE_WRAP RSN_SELECTOR(0x00, 0x50, 0xf2, 3) -#endif -#define WPA_CIPHER_SUITE_CCMP RSN_SELECTOR(0x00, 0x50, 0xf2, 4) -#define WPA_CIPHER_SUITE_WEP104 RSN_SELECTOR(0x00, 0x50, 0xf2, 5) - - -#define RSN_AUTH_KEY_MGMT_UNSPEC_802_1X RSN_SELECTOR(0x00, 0x0f, 0xac, 1) -#define RSN_AUTH_KEY_MGMT_PSK_OVER_802_1X RSN_SELECTOR(0x00, 0x0f, 0xac, 2) -#ifdef CONFIG_IEEE80211R -#define RSN_AUTH_KEY_MGMT_FT_802_1X RSN_SELECTOR(0x00, 0x0f, 0xac, 3) -#define RSN_AUTH_KEY_MGMT_FT_PSK RSN_SELECTOR(0x00, 0x0f, 0xac, 4) -#endif /* CONFIG_IEEE80211R */ -#define RSN_AUTH_KEY_MGMT_802_1X_SHA256 RSN_SELECTOR(0x00, 0x0f, 0xac, 5) -#define RSN_AUTH_KEY_MGMT_PSK_SHA256 RSN_SELECTOR(0x00, 0x0f, 0xac, 6) - -#define RSN_CIPHER_SUITE_NONE RSN_SELECTOR(0x00, 0x0f, 0xac, 0) -#define RSN_CIPHER_SUITE_WEP40 RSN_SELECTOR(0x00, 0x0f, 0xac, 1) -#define RSN_CIPHER_SUITE_TKIP RSN_SELECTOR(0x00, 0x0f, 0xac, 2) -#if 0 -#define RSN_CIPHER_SUITE_WRAP RSN_SELECTOR(0x00, 0x0f, 0xac, 3) -#endif -#define RSN_CIPHER_SUITE_CCMP RSN_SELECTOR(0x00, 0x0f, 0xac, 4) -#define RSN_CIPHER_SUITE_WEP104 RSN_SELECTOR(0x00, 0x0f, 0xac, 5) -#ifdef CONFIG_IEEE80211W -#define RSN_CIPHER_SUITE_AES_128_CMAC RSN_SELECTOR(0x00, 0x0f, 0xac, 6) -#endif /* CONFIG_IEEE80211W */ -#define RSN_CIPHER_SUITE_NO_GROUP_ADDRESSED RSN_SELECTOR(0x00, 0x0f, 0xac, 7) -#define RSN_CIPHER_SUITE_GCMP RSN_SELECTOR(0x00, 0x0f, 0xac, 8) - -/* EAPOL-Key Key Data Encapsulation - * GroupKey and PeerKey require encryption, otherwise, encryption is optional. - */ -#define RSN_KEY_DATA_GROUPKEY RSN_SELECTOR(0x00, 0x0f, 0xac, 1) -#if 0 -#define RSN_KEY_DATA_STAKEY RSN_SELECTOR(0x00, 0x0f, 0xac, 2) -#endif -#define RSN_KEY_DATA_MAC_ADDR RSN_SELECTOR(0x00, 0x0f, 0xac, 3) -#define RSN_KEY_DATA_PMKID RSN_SELECTOR(0x00, 0x0f, 0xac, 4) -#ifdef CONFIG_PEERKEY -#define RSN_KEY_DATA_SMK RSN_SELECTOR(0x00, 0x0f, 0xac, 5) -#define RSN_KEY_DATA_NONCE RSN_SELECTOR(0x00, 0x0f, 0xac, 6) -#define RSN_KEY_DATA_LIFETIME RSN_SELECTOR(0x00, 0x0f, 0xac, 7) -#define RSN_KEY_DATA_ERROR RSN_SELECTOR(0x00, 0x0f, 0xac, 8) -#endif /* CONFIG_PEERKEY */ -#ifdef CONFIG_IEEE80211W -#define RSN_KEY_DATA_IGTK RSN_SELECTOR(0x00, 0x0f, 0xac, 9) -#endif /* CONFIG_IEEE80211W */ - -#define WPA_OUI_TYPE RSN_SELECTOR(0x00, 0x50, 0xf2, 1) - -#define RSN_SELECTOR_PUT(a, val) WPA_PUT_BE32((u8 *) (a), (val)) -#define RSN_SELECTOR_GET(a) WPA_GET_BE32((const u8 *) (a)) - -#define RSN_NUM_REPLAY_COUNTERS_1 0 -#define RSN_NUM_REPLAY_COUNTERS_2 1 -#define RSN_NUM_REPLAY_COUNTERS_4 2 -#define RSN_NUM_REPLAY_COUNTERS_16 3 - -#ifdef _MSC_VER -#pragma pack(push, 1) -#endif /* _MSC_VER */ - -#ifdef CONFIG_IEEE80211W -#define WPA_IGTK_LEN 16 -#endif /* CONFIG_IEEE80211W */ - - -/* IEEE 802.11, 7.3.2.25.3 RSN Capabilities */ -#define WPA_CAPABILITY_PREAUTH BIT(0) -#define WPA_CAPABILITY_NO_PAIRWISE BIT(1) -/* B2-B3: PTKSA Replay Counter */ -/* B4-B5: GTKSA Replay Counter */ -#define WPA_CAPABILITY_MFPR BIT(6) -#define WPA_CAPABILITY_MFPC BIT(7) -#define WPA_CAPABILITY_PEERKEY_ENABLED BIT(9) - - -/* IEEE 802.11r */ -#define MOBILITY_DOMAIN_ID_LEN 2 -#define FT_R0KH_ID_MAX_LEN 48 -#define FT_R1KH_ID_LEN 6 -#define WPA_PMK_NAME_LEN 16 - - -/* IEEE 802.11, 8.5.2 EAPOL-Key frames */ -#define WPA_KEY_INFO_TYPE_MASK ((u16) (BIT(0) | BIT(1) | BIT(2))) -#define WPA_KEY_INFO_TYPE_HMAC_MD5_RC4 BIT(0) -#define WPA_KEY_INFO_TYPE_HMAC_SHA1_AES BIT(1) -#define WPA_KEY_INFO_TYPE_AES_128_CMAC 3 -#define WPA_KEY_INFO_KEY_TYPE BIT(3) /* 1 = Pairwise, 0 = Group key */ -/* bit4..5 is used in WPA, but is reserved in IEEE 802.11i/RSN */ -#define WPA_KEY_INFO_KEY_INDEX_MASK (BIT(4) | BIT(5)) -#define WPA_KEY_INFO_KEY_INDEX_SHIFT 4 -#define WPA_KEY_INFO_INSTALL BIT(6) /* pairwise */ -#define WPA_KEY_INFO_TXRX BIT(6) /* group */ -#define WPA_KEY_INFO_ACK BIT(7) -#define WPA_KEY_INFO_MIC BIT(8) -#define WPA_KEY_INFO_SECURE BIT(9) -#define WPA_KEY_INFO_ERROR BIT(10) -#define WPA_KEY_INFO_REQUEST BIT(11) -#define WPA_KEY_INFO_ENCR_KEY_DATA BIT(12) /* IEEE 802.11i/RSN only */ -#define WPA_KEY_INFO_SMK_MESSAGE BIT(13) - - -struct wpa_eapol_key { - u8 type; - /* Note: key_info, key_length, and key_data_length are unaligned */ - u8 key_info[2]; /* big endian */ - u8 key_length[2]; /* big endian */ - u8 replay_counter[WPA_REPLAY_COUNTER_LEN]; - u8 key_nonce[WPA_NONCE_LEN]; - u8 key_iv[16]; - u8 key_rsc[WPA_KEY_RSC_LEN]; - u8 key_id[8]; /* Reserved in IEEE 802.11i/RSN */ - u8 key_mic[16]; - u8 key_data_length[2]; /* big endian */ - /* followed by key_data_length bytes of key_data */ -} STRUCT_PACKED; - -/** - * struct wpa_ptk - WPA Pairwise Transient Key - * IEEE Std 802.11i-2004 - 8.5.1.2 Pairwise key hierarchy - */ -struct wpa_ptk { - u8 kck[16]; /* EAPOL-Key Key Confirmation Key (KCK) */ - u8 kek[16]; /* EAPOL-Key Key Encryption Key (KEK) */ - u8 tk1[16]; /* Temporal Key 1 (TK1) */ - union { - u8 tk2[16]; /* Temporal Key 2 (TK2) */ - struct { - u8 tx_mic_key[8]; - u8 rx_mic_key[8]; - } auth; - } u; -} STRUCT_PACKED; - -struct wpa_gtk_data { - enum wpa_alg alg; - int tx, key_rsc_len, keyidx; - u8 gtk[32]; - int gtk_len; -}; - - -/* WPA IE version 1 - * 00-50-f2:1 (OUI:OUI type) - * 0x01 0x00 (version; little endian) - * (all following fields are optional:) - * Group Suite Selector (4 octets) (default: TKIP) - * Pairwise Suite Count (2 octets, little endian) (default: 1) - * Pairwise Suite List (4 * n octets) (default: TKIP) - * Authenticated Key Management Suite Count (2 octets, little endian) - * (default: 1) - * Authenticated Key Management Suite List (4 * n octets) - * (default: unspec 802.1X) - * WPA Capabilities (2 octets, little endian) (default: 0) - */ - -struct wpa_ie_hdr { - u8 elem_id; - u8 len; - u8 oui[4]; /* 24-bit OUI followed by 8-bit OUI type */ - u8 version[2]; /* little endian */ -} STRUCT_PACKED; - - -/* 1/4: PMKID - * 2/4: RSN IE - * 3/4: one or two RSN IEs + GTK IE (encrypted) - * 4/4: empty - * 1/2: GTK IE (encrypted) - * 2/2: empty - */ - -/* RSN IE version 1 - * 0x01 0x00 (version; little endian) - * (all following fields are optional:) - * Group Suite Selector (4 octets) (default: CCMP) - * Pairwise Suite Count (2 octets, little endian) (default: 1) - * Pairwise Suite List (4 * n octets) (default: CCMP) - * Authenticated Key Management Suite Count (2 octets, little endian) - * (default: 1) - * Authenticated Key Management Suite List (4 * n octets) - * (default: unspec 802.1X) - * RSN Capabilities (2 octets, little endian) (default: 0) - * PMKID Count (2 octets) (default: 0) - * PMKID List (16 * n octets) - * Management Group Cipher Suite (4 octets) (default: AES-128-CMAC) - */ - -struct rsn_ie_hdr { - u8 elem_id; /* WLAN_EID_RSN */ - u8 len; - u8 version[2]; /* little endian */ -} STRUCT_PACKED; - - -#ifdef CONFIG_PEERKEY -enum { - STK_MUI_4WAY_STA_AP = 1, - STK_MUI_4WAY_STAT_STA = 2, - STK_MUI_GTK = 3, - STK_MUI_SMK = 4 -}; - -enum { - STK_ERR_STA_NR = 1, - STK_ERR_STA_NRSN = 2, - STK_ERR_CPHR_NS = 3, - STK_ERR_NO_STSL = 4 -}; -#endif /* CONFIG_PEERKEY */ - -struct rsn_error_kde { - be16 mui; - be16 error_type; -} STRUCT_PACKED; - -#ifdef CONFIG_IEEE80211W -struct wpa_igtk_kde { - u8 keyid[2]; - u8 pn[6]; - u8 igtk[WPA_IGTK_LEN]; -} STRUCT_PACKED; -#endif /* CONFIG_IEEE80211W */ - -#ifdef CONFIG_IEEE80211R -struct rsn_mdie { - u8 mobility_domain[MOBILITY_DOMAIN_ID_LEN]; - u8 ft_capab; -} STRUCT_PACKED; - -#define RSN_FT_CAPAB_FT_OVER_DS BIT(0) -#define RSN_FT_CAPAB_FT_RESOURCE_REQ_SUPP BIT(1) - -struct rsn_ftie { - u8 mic_control[2]; - u8 mic[16]; - u8 anonce[WPA_NONCE_LEN]; - u8 snonce[WPA_NONCE_LEN]; - /* followed by optional parameters */ -} STRUCT_PACKED; - -#define FTIE_SUBELEM_R1KH_ID 1 -#define FTIE_SUBELEM_GTK 2 -#define FTIE_SUBELEM_R0KH_ID 3 -#define FTIE_SUBELEM_IGTK 4 - -struct rsn_rdie { - u8 id; - u8 descr_count; - le16 status_code; -} STRUCT_PACKED; - -#endif /* CONFIG_IEEE80211R */ - -struct wpa_ie_data { - int proto; - int pairwise_cipher; - int group_cipher; - int key_mgmt; - int capabilities; - size_t num_pmkid; - const u8 *pmkid; - int mgmt_group_cipher; -}; - -const char * wpa_cipher_txt(int cipher); - -int wpa_parse_wpa_ie_rsn(const u8 *rsn_ie, size_t rsn_ie_len, - struct wpa_ie_data *data); - -int wpa_eapol_key_mic(const u8 *key, int ver, const u8 *buf, size_t len, - u8 *mic); -int wpa_compare_rsn_ie(int ft_initial_assoc, - const u8 *ie1, size_t ie1len, - const u8 *ie2, size_t ie2len); - -void wpa_pmk_to_ptk(const u8 *pmk, size_t pmk_len, const char *label, - const u8 *addr1, const u8 *addr2, - const u8 *nonce1, const u8 *nonce2, - u8 *ptk, size_t ptk_len, int use_sha256); - -void rsn_pmkid(const u8 *pmk, size_t pmk_len, const u8 *aa, const u8 *spa, - u8 *pmkid, int use_sha256); - -#endif /* WPA_COMMON_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa/wpa_debug.h b/tools/sdk/include/wpa_supplicant/wpa/wpa_debug.h deleted file mode 100644 index 10fe928c3eb..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa/wpa_debug.h +++ /dev/null @@ -1,207 +0,0 @@ -/* - * wpa_supplicant/hostapd / Debug prints - * Copyright (c) 2002-2007, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef WPA_DEBUG_H -#define WPA_DEBUG_H - -#include "wpabuf.h" -#include "esp_log.h" - -#ifdef ESPRESSIF_USE - -#define TAG "wpa" - -#define MSG_ERROR ESP_LOG_ERROR -#define MSG_WARNING ESP_LOG_WARN -#define MSG_INFO ESP_LOG_INFO -#define MSG_DEBUG ESP_LOG_DEBUG -#define MSG_MSGDUMP ESP_LOG_VERBOSE - -#else -enum { MSG_MSGDUMP, MSG_DEBUG, MSG_INFO, MSG_WARNING, MSG_ERROR }; -#endif - -/** EAP authentication completed successfully */ -#define WPA_EVENT_EAP_SUCCESS "CTRL-EVENT-EAP-SUCCESS " - -int wpa_debug_open_file(const char *path); -void wpa_debug_close_file(void); - -/** - * wpa_debug_printf_timestamp - Print timestamp for debug output - * - * This function prints a timestamp in seconds_from_1970.microsoconds - * format if debug output has been configured to include timestamps in debug - * messages. - */ -void wpa_debug_print_timestamp(void); - -/** - * wpa_printf - conditional printf - * @level: priority level (MSG_*) of the message - * @fmt: printf format string, followed by optional arguments - * - * This function is used to print conditional debugging and error messages. The - * output may be directed to stdout, stderr, and/or syslog based on - * configuration. - * - * Note: New line '\n' is added to the end of the text when printing to stdout. - */ -#define DEBUG_PRINT -#define MSG_PRINT - -/** - * wpa_hexdump - conditional hex dump - * @level: priority level (MSG_*) of the message - * @title: title of for the message - * @buf: data buffer to be dumped - * @len: length of the buf - * - * This function is used to print conditional debugging and error messages. The - * output may be directed to stdout, stderr, and/or syslog based on - * configuration. The contents of buf is printed out has hex dump. - */ -#ifdef DEBUG_PRINT -#define wpa_printf(level,fmt, args...) ESP_LOG_LEVEL_LOCAL(level, TAG, fmt, ##args) - -static inline void wpa_hexdump_ascii(int level, const char *title, const u8 *buf, size_t len) -{ - -} - -static inline void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf, size_t len) -{ -} - - -void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len); - -static inline void wpa_hexdump_buf(int level, const char *title, - const struct wpabuf *buf) -{ - wpa_hexdump(level, title, wpabuf_head(buf), wpabuf_len(buf)); -} - -/** - * wpa_hexdump_key - conditional hex dump, hide keys - * @level: priority level (MSG_*) of the message - * @title: title of for the message - * @buf: data buffer to be dumped - * @len: length of the buf - * - * This function is used to print conditional debugging and error messages. The - * output may be directed to stdout, stderr, and/or syslog based on - * configuration. The contents of buf is printed out has hex dump. This works - * like wpa_hexdump(), but by default, does not include secret keys (passwords, - * etc.) in debug output. - */ -void wpa_hexdump_key(int level, const char *title, const u8 *buf, size_t len); - - -static inline void wpa_hexdump_buf_key(int level, const char *title, - const struct wpabuf *buf) -{ - wpa_hexdump_key(level, title, wpabuf_head(buf), wpabuf_len(buf)); -} - -/** - * wpa_hexdump_ascii - conditional hex dump - * @level: priority level (MSG_*) of the message - * @title: title of for the message - * @buf: data buffer to be dumped - * @len: length of the buf - * - * This function is used to print conditional debugging and error messages. The - * output may be directed to stdout, stderr, and/or syslog based on - * configuration. The contents of buf is printed out has hex dump with both - * the hex numbers and ASCII characters (for printable range) are shown. 16 - * bytes per line will be shown. - */ -void wpa_hexdump_ascii(int level, const char *title, const u8 *buf, - size_t len); - -/** - * wpa_hexdump_ascii_key - conditional hex dump, hide keys - * @level: priority level (MSG_*) of the message - * @title: title of for the message - * @buf: data buffer to be dumped - * @len: length of the buf - * - * This function is used to print conditional debugging and error messages. The - * output may be directed to stdout, stderr, and/or syslog based on - * configuration. The contents of buf is printed out has hex dump with both - * the hex numbers and ASCII characters (for printable range) are shown. 16 - * bytes per line will be shown. This works like wpa_hexdump_ascii(), but by - * default, does not include secret keys (passwords, etc.) in debug output. - */ -void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf, - size_t len); -#else -#define wpa_printf(level,fmt, args...) -#define wpa_hexdump(...) -#define wpa_hexdump_buf(...) -#define wpa_hexdump_key(...) -#define wpa_hexdump_buf_key(...) -#define wpa_hexdump_ascii(...) -#define wpa_hexdump_ascii_key(...) -#endif - -#define wpa_auth_logger -#define wpa_auth_vlogger - -/** - * wpa_msg - Conditional printf for default target and ctrl_iface monitors - * @ctx: Pointer to context data; this is the ctx variable registered - * with struct wpa_driver_ops::init() - * @level: priority level (MSG_*) of the message - * @fmt: printf format string, followed by optional arguments - * - * This function is used to print conditional debugging and error messages. The - * output may be directed to stdout, stderr, and/or syslog based on - * configuration. This function is like wpa_printf(), but it also sends the - * same message to all attached ctrl_iface monitors. - * - * Note: New line '\n' is added to the end of the text when printing to stdout. - */ -void wpa_msg(void *ctx, int level, const char *fmt, ...) PRINTF_FORMAT(3, 4); - -/** - * wpa_msg_ctrl - Conditional printf for ctrl_iface monitors - * @ctx: Pointer to context data; this is the ctx variable registered - * with struct wpa_driver_ops::init() - * @level: priority level (MSG_*) of the message - * @fmt: printf format string, followed by optional arguments - * - * This function is used to print conditional debugging and error messages. - * This function is like wpa_msg(), but it sends the output only to the - * attached ctrl_iface monitors. In other words, it can be used for frequent - * events that do not need to be sent to syslog. - */ -void wpa_msg_ctrl(void *ctx, int level, const char *fmt, ...) -PRINTF_FORMAT(3, 4); - -typedef void (*wpa_msg_cb_func)(void *ctx, int level, const char *txt, - size_t len); - -typedef void (*eloop_timeout_handler)(void *eloop_data, void *user_ctx); - -int eloop_cancel_timeout(eloop_timeout_handler handler, - void *eloop_data, void *user_data); - -int eloop_register_timeout(unsigned int secs, unsigned int usecs, - eloop_timeout_handler handler, - void *eloop_data, void *user_data); - - -#endif /* WPA_DEBUG_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa/wpa_i.h b/tools/sdk/include/wpa_supplicant/wpa/wpa_i.h deleted file mode 100644 index a43c33d332b..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa/wpa_i.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Internal WPA/RSN supplicant state machine definitions - * Copyright (c) 2004-2010, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef WPA_I_H -#define WPA_I_H - -/** - * set_key - Configure encryption key - * @ifname: Interface name (for multi-SSID/VLAN support) - * @priv: private driver interface data - * @alg: encryption algorithm (%WPA_ALG_NONE, %WPA_ALG_WEP, - * %WPA_ALG_TKIP, %WPA_ALG_CCMP, %WPA_ALG_IGTK, %WPA_ALG_PMK); - * %WPA_ALG_NONE clears the key. - * @addr: address of the peer STA or ff:ff:ff:ff:ff:ff for - * broadcast/default keys - * @key_idx: key index (0..3), usually 0 for unicast keys; 0..4095 for - * IGTK - * @set_tx: configure this key as the default Tx key (only used when - * driver does not support separate unicast/individual key - * @seq: sequence number/packet number, seq_len octets, the next - * packet number to be used for in replay protection; configured - * for Rx keys (in most cases, this is only used with broadcast - * keys and set to zero for unicast keys) - * @seq_len: length of the seq, depends on the algorithm: - * TKIP: 6 octets, CCMP: 6 octets, IGTK: 6 octets - * @key: key buffer; TKIP: 16-byte temporal key, 8-byte Tx Mic key, - * 8-byte Rx Mic Key - * @key_len: length of the key buffer in octets (WEP: 5 or 13, - * TKIP: 32, CCMP: 16, IGTK: 16) - * - * Returns: 0 on success, -1 on failure - * - * Configure the given key for the kernel driver. If the driver - * supports separate individual keys (4 default keys + 1 individual), - * addr can be used to determine whether the key is default or - * individual. If only 4 keys are supported, the default key with key - * index 0 is used as the individual key. STA must be configured to use - * it as the default Tx key (set_tx is set) and accept Rx for all the - * key indexes. In most cases, WPA uses only key indexes 1 and 2 for - * broadcast keys, so key index 0 is available for this kind of - * configuration. - * - * Please note that TKIP keys include separate TX and RX MIC keys and - * some drivers may expect them in different order than wpa_supplicant - * is using. If the TX/RX keys are swapped, all TKIP encrypted packets - * will tricker Michael MIC errors. This can be fixed by changing the - * order of MIC keys by swapping te bytes 16..23 and 24..31 of the key - * in driver_*.c set_key() implementation, see driver_ndis.c for an - * example on how this can be done. - */ - -typedef void (* WPA_SEND_FUNC)(struct pbuf *pb); - -typedef void (* WPA_SET_ASSOC_IE)(uint8 proto, u8 *assoc_buf, u32 assoc_wpa_ie_len); - -typedef void (*WPA_INSTALL_KEY) (enum wpa_alg alg, uint8 *addr, int key_idx, int set_tx, - uint8 *seq, size_t seq_len, uint8 *key, size_t key_len, int key_entry_valid); - -typedef void (*WPA_DEAUTH)(uint8 reason_code); - -typedef void (*WPA_NEG_COMPLETE)(); - -void wpa_register(char * payload, WPA_SEND_FUNC snd_func, \ - WPA_SET_ASSOC_IE set_assoc_ie_func, \ - WPA_INSTALL_KEY ppinstallkey, \ - WPA_DEAUTH wpa_deauth, \ - WPA_NEG_COMPLETE wpa_neg_complete); - -#include "pp/esf_buf.h" -void eapol_txcb(esf_buf_t *eb); - -void wpa_set_profile(uint32 wpa_proto); - -void wpa_set_bss(char *macddr, char * bssid, uint8 pairwise_cipher, uint8 group_cipher, char *passphrase, u8 *ssid, size_t ssid_len); - -int wpa_sm_rx_eapol(u8 *src_addr, u8 *buf, u32 len); -#endif /* WPA_I_H */ - diff --git a/tools/sdk/include/wpa_supplicant/wpa/wpa_ie.h b/tools/sdk/include/wpa_supplicant/wpa/wpa_ie.h deleted file mode 100644 index 94518d84578..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa/wpa_ie.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * wpa_supplicant - WPA/RSN IE and KDE definitions - * Copyright (c) 2004-2007, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef WPA_IE_H -#define WPA_IE_H - -struct wpa_eapol_ie_parse { - const u8 *wpa_ie; - size_t wpa_ie_len; - const u8 *rsn_ie; - size_t rsn_ie_len; - const u8 *pmkid; - const u8 *gtk; - size_t gtk_len; - const u8 *mac_addr; - size_t mac_addr_len; -#ifdef CONFIG_PEERKEY - const u8 *smk; - size_t smk_len; - const u8 *nonce; - size_t nonce_len; - const u8 *lifetime; - size_t lifetime_len; - const u8 *error; - size_t error_len; -#endif /* CONFIG_PEERKEY */ -#ifdef CONFIG_IEEE80211W - const u8 *igtk; - size_t igtk_len; -#endif /* CONFIG_IEEE80211W */ -#ifdef CONFIG_IEEE80211R - const u8 *mdie; - size_t mdie_len; - const u8 *ftie; - size_t ftie_len; - const u8 *reassoc_deadline; - const u8 *key_lifetime; -#endif /* CONFIG_IEEE80211R */ -}; - -int wpa_supplicant_parse_ies(const u8 *buf, size_t len, - struct wpa_eapol_ie_parse *ie); -int wpa_gen_wpa_ie(struct wpa_sm *sm, u8 *wpa_ie, size_t wpa_ie_len); - -#endif /* WPA_IE_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa/wpabuf.h b/tools/sdk/include/wpa_supplicant/wpa/wpabuf.h deleted file mode 100644 index cccfcc80ef1..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa/wpabuf.h +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Dynamic data buffer - * Copyright (c) 2007-2009, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef WPABUF_H -#define WPABUF_H - -/* - * Internal data structure for wpabuf. Please do not touch this directly from - * elsewhere. This is only defined in header file to allow inline functions - * from this file to access data. - */ -struct wpabuf { - size_t size; /* total size of the allocated buffer */ - size_t used; /* length of data in the buffer */ - u8 *ext_data; /* pointer to external data; NULL if data follows - * struct wpabuf */ - /* optionally followed by the allocated buffer */ -}; - - -int wpabuf_resize(struct wpabuf **buf, size_t add_len); -struct wpabuf * wpabuf_alloc(size_t len); -struct wpabuf * wpabuf_alloc_ext_data(u8 *data, size_t len); -struct wpabuf * wpabuf_alloc_copy(const void *data, size_t len); -struct wpabuf * wpabuf_dup(const struct wpabuf *src); -void wpabuf_free(struct wpabuf *buf); -void * wpabuf_put(struct wpabuf *buf, size_t len); -struct wpabuf * wpabuf_concat(struct wpabuf *a, struct wpabuf *b); -struct wpabuf * wpabuf_zeropad(struct wpabuf *buf, size_t len); -void wpabuf_printf(struct wpabuf *buf, char *fmt, ...) PRINTF_FORMAT(2, 3); - - -/** - * wpabuf_size - Get the currently allocated size of a wpabuf buffer - * @buf: wpabuf buffer - * Returns: Currently allocated size of the buffer - */ -static inline size_t wpabuf_size(const struct wpabuf *buf) -{ - return buf->size; -} - -/** - * wpabuf_len - Get the current length of a wpabuf buffer data - * @buf: wpabuf buffer - * Returns: Currently used length of the buffer - */ -static inline size_t wpabuf_len(const struct wpabuf *buf) -{ - return buf->used; -} - -/** - * wpabuf_tailroom - Get size of available tail room in the end of the buffer - * @buf: wpabuf buffer - * Returns: Tail room (in bytes) of available space in the end of the buffer - */ -static inline size_t wpabuf_tailroom(const struct wpabuf *buf) -{ - return buf->size - buf->used; -} - -/** - * wpabuf_head - Get pointer to the head of the buffer data - * @buf: wpabuf buffer - * Returns: Pointer to the head of the buffer data - */ -static inline const void * wpabuf_head(const struct wpabuf *buf) -{ - if (buf->ext_data) - return buf->ext_data; - return buf + 1; -} - -static inline const u8 * wpabuf_head_u8(const struct wpabuf *buf) -{ - return wpabuf_head(buf); -} - -/** - * wpabuf_mhead - Get modifiable pointer to the head of the buffer data - * @buf: wpabuf buffer - * Returns: Pointer to the head of the buffer data - */ -static inline void * wpabuf_mhead(struct wpabuf *buf) -{ - if (buf->ext_data) - return buf->ext_data; - return buf + 1; -} - -static inline u8 * wpabuf_mhead_u8(struct wpabuf *buf) -{ - return wpabuf_mhead(buf); -} - -static inline void wpabuf_put_u8(struct wpabuf *buf, u8 data) -{ - u8 *pos = wpabuf_put(buf, 1); - *pos = data; -} - -static inline void wpabuf_put_le16(struct wpabuf *buf, u16 data) -{ - u8 *pos = wpabuf_put(buf, 2); - WPA_PUT_LE16(pos, data); -} - -static inline void wpabuf_put_le32(struct wpabuf *buf, u32 data) -{ - u8 *pos = wpabuf_put(buf, 4); - WPA_PUT_LE32(pos, data); -} - -static inline void wpabuf_put_be16(struct wpabuf *buf, u16 data) -{ - u8 *pos = wpabuf_put(buf, 2); - WPA_PUT_BE16(pos, data); -} - -static inline void wpabuf_put_be24(struct wpabuf *buf, u32 data) -{ - u8 *pos = wpabuf_put(buf, 3); - WPA_PUT_BE24(pos, data); -} - -static inline void wpabuf_put_be32(struct wpabuf *buf, u32 data) -{ - u8 *pos = wpabuf_put(buf, 4); - WPA_PUT_BE32(pos, data); -} - -static inline void wpabuf_put_data(struct wpabuf *buf, const void *data, - size_t len) -{ - if (data) - os_memcpy(wpabuf_put(buf, len), data, len); -} - -static inline void wpabuf_put_buf(struct wpabuf *dst, - const struct wpabuf *src) -{ - wpabuf_put_data(dst, wpabuf_head(src), wpabuf_len(src)); -} - -static inline void wpabuf_set(struct wpabuf *buf, const void *data, size_t len) -{ - buf->ext_data = (u8 *) data; - buf->size = buf->used = len; -} - -static inline void wpabuf_put_str(struct wpabuf *dst, const char *str) -{ - wpabuf_put_data(dst, str, os_strlen(str)); -} - -#endif /* WPABUF_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa/wpas_glue.h b/tools/sdk/include/wpa_supplicant/wpa/wpas_glue.h deleted file mode 100644 index 7e254a2d7d1..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa/wpas_glue.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * WPA Supplicant - Glue code to setup EAPOL and RSN modules - * Copyright (c) 2003-2008, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef WPAS_GLUE_H -#define WPAS_GLUE_H - -u8 * wpa_sm_alloc_eapol(struct wpa_sm *sm, u8 type, - const void *data, u16 data_len, - size_t *msg_len, void **data_pos); - -int wpa_sm_mlme_setprotection(struct wpa_sm *sm, const u8 *addr, - int protect_type, int key_type); - -void wpa_sm_deauthenticate(struct wpa_sm *sm, uint8 reason_code); - -void wpa_sm_disassociate(struct wpa_sm *sm, int reason_code); - -int wpa_sm_get_beacon_ie(struct wpa_sm *sm); - -#endif /* WPAS_GLUE_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap.h b/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap.h deleted file mode 100644 index 9e1c3efa94f..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * EAP peer state machine functions (RFC 4137) - * Copyright (c) 2004-2012, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef EAP_H -#define EAP_H - -#include "wpa/defs.h" -#include "wpa2/eap_peer/eap_defs.h" - -struct eap_sm; - -struct eap_method_type { - int vendor; - EapType method; -}; - -u8 *g_wpa_anonymous_identity; -int g_wpa_anonymous_identity_len; -u8 *g_wpa_username; -int g_wpa_username_len; -const u8 *g_wpa_client_cert; -int g_wpa_client_cert_len; -const u8 *g_wpa_private_key; -int g_wpa_private_key_len; -const u8 *g_wpa_private_key_passwd; -int g_wpa_private_key_passwd_len; - -const u8 *g_wpa_ca_cert; -int g_wpa_ca_cert_len; - -u8 *g_wpa_password; -int g_wpa_password_len; - -u8 *g_wpa_new_password; -int g_wpa_new_password_len; - -const u8 * eap_get_eapKeyData(struct eap_sm *sm, size_t *len); -void eap_deinit_prev_method(struct eap_sm *sm, const char *txt); -struct wpabuf * eap_sm_build_nak(struct eap_sm *sm, EapType type, u8 id); -int eap_peer_blob_init(struct eap_sm *sm); -void eap_peer_blob_deinit(struct eap_sm *sm); -int eap_peer_config_init( - struct eap_sm *sm, u8 *private_key_passwd, - int private_key_passwd_len); -void eap_peer_config_deinit(struct eap_sm *sm); -void eap_sm_abort(struct eap_sm *sm); -int eap_peer_register_methods(void); - -#endif /* EAP_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_common.h b/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_common.h deleted file mode 100644 index 38c57100584..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_common.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * EAP common peer/server definitions - * Copyright (c) 2004-2012, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef EAP_COMMON_H -#define EAP_COMMON_H - -#include "wpa/wpabuf.h" - -int eap_hdr_len_valid(const struct wpabuf *msg, size_t min_payload); -const u8 * eap_hdr_validate(int vendor, EapType eap_type, - const struct wpabuf *msg, size_t *plen); -struct wpabuf * eap_msg_alloc(int vendor, EapType type, size_t payload_len, - u8 code, u8 identifier); -void eap_update_len(struct wpabuf *msg); -u8 eap_get_id(const struct wpabuf *msg); -EapType eap_get_type(const struct wpabuf *msg); - -#endif /* EAP_COMMON_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_config.h b/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_config.h deleted file mode 100644 index f95dcda3a12..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_config.h +++ /dev/null @@ -1,249 +0,0 @@ -/* - * EAP peer configuration data - * Copyright (c) 2003-2013, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef EAP_CONFIG_H -#define EAP_CONFIG_H - -/** - * struct eap_peer_config - EAP peer configuration/credentials - */ -struct eap_peer_config { - /** - * identity - EAP Identity - * - * This field is used to set the real user identity or NAI (for - * EAP-PSK/PAX/SAKE/GPSK). - */ - u8 *identity; - - /** - * identity_len - EAP Identity length - */ - size_t identity_len; - - u8 *anonymous_identity; - - size_t anonymous_identity_len; - - /** - * password - Password string for EAP - * - * This field can include either the plaintext password (default - * option) or a NtPasswordHash (16-byte MD4 hash of the unicode - * presentation of the password) if flags field has - * EAP_CONFIG_FLAGS_PASSWORD_NTHASH bit set to 1. NtPasswordHash can - * only be used with authentication mechanism that use this hash as the - * starting point for operation: MSCHAP and MSCHAPv2 (EAP-MSCHAPv2, - * EAP-TTLS/MSCHAPv2, EAP-TTLS/MSCHAP, LEAP). - * - * In addition, this field is used to configure a pre-shared key for - * EAP-PSK/PAX/SAKE/GPSK. The length of the PSK must be 16 for EAP-PSK - * and EAP-PAX and 32 for EAP-SAKE. EAP-GPSK can use a variable length - * PSK. - */ - u8 *password; - - /** - * password_len - Length of password field - */ - size_t password_len; - - /** - * ca_cert - File path to CA certificate file (PEM/DER) - * - * This file can have one or more trusted CA certificates. If ca_cert - * and ca_path are not included, server certificate will not be - * verified. This is insecure and a trusted CA certificate should - * always be configured when using EAP-TLS/TTLS/PEAP. Full path to the - * file should be used since working directory may change when - * wpa_supplicant is run in the background. - * - * Alternatively, a named configuration blob can be used by setting - * this to blob://blob_name. - * - * Alternatively, this can be used to only perform matching of the - * server certificate (SHA-256 hash of the DER encoded X.509 - * certificate). In this case, the possible CA certificates in the - * server certificate chain are ignored and only the server certificate - * is verified. This is configured with the following format: - * hash:://server/sha256/cert_hash_in_hex - * For example: "hash://server/sha256/ - * 5a1bc1296205e6fdbe3979728efe3920798885c1c4590b5f90f43222d239ca6a" - * - * On Windows, trusted CA certificates can be loaded from the system - * certificate store by setting this to cert_store://name, e.g., - * ca_cert="cert_store://CA" or ca_cert="cert_store://ROOT". - * Note that when running wpa_supplicant as an application, the user - * certificate store (My user account) is used, whereas computer store - * (Computer account) is used when running wpasvc as a service. - */ - u8 *ca_cert; - - /** - * ca_path - Directory path for CA certificate files (PEM) - * - * This path may contain multiple CA certificates in OpenSSL format. - * Common use for this is to point to system trusted CA list which is - * often installed into directory like /etc/ssl/certs. If configured, - * these certificates are added to the list of trusted CAs. ca_cert - * may also be included in that case, but it is not required. - */ - u8 *ca_path; - - /** - * client_cert - File path to client certificate file (PEM/DER) - * - * This field is used with EAP method that use TLS authentication. - * Usually, this is only configured for EAP-TLS, even though this could - * in theory be used with EAP-TTLS and EAP-PEAP, too. Full path to the - * file should be used since working directory may change when - * wpa_supplicant is run in the background. - * - * Alternatively, a named configuration blob can be used by setting - * this to blob://blob_name. - */ - u8 *client_cert; - - /** - * private_key - File path to client private key file (PEM/DER/PFX) - * - * When PKCS#12/PFX file (.p12/.pfx) is used, client_cert should be - * commented out. Both the private key and certificate will be read - * from the PKCS#12 file in this case. Full path to the file should be - * used since working directory may change when wpa_supplicant is run - * in the background. - * - * Windows certificate store can be used by leaving client_cert out and - * configuring private_key in one of the following formats: - * - * cert://substring_to_match - * - * hash://certificate_thumbprint_in_hex - * - * For example: private_key="hash://63093aa9c47f56ae88334c7b65a4" - * - * Note that when running wpa_supplicant as an application, the user - * certificate store (My user account) is used, whereas computer store - * (Computer account) is used when running wpasvc as a service. - * - * Alternatively, a named configuration blob can be used by setting - * this to blob://blob_name. - */ - u8 *private_key; - - /** - * private_key_passwd - Password for private key file - * - * If left out, this will be asked through control interface. - */ - u8 *private_key_passwd; - - /** - * Phase 2 - */ - u8 *ca_cert2; - - u8 *ca_path2; - - u8 *client_cert2; - - u8 *private_key2; - - u8 *private_key2_password; - - /** - * eap_methods - Allowed EAP methods - */ - struct eap_method_type *eap_methods; - - - char *phase1; - - char *phase2; - - /** - * pin - PIN for USIM, GSM SIM, and smartcards - * - * This field is used to configure PIN for SIM and smartcards for - * EAP-SIM and EAP-AKA. In addition, this is used with EAP-TLS if a - * smartcard is used for private key operations. - * - * If left out, this will be asked through control interface. - */ - char *pin; - - int mschapv2_retry; - u8 *new_password; - size_t new_password_len; - - /** - * fragment_size - Maximum EAP fragment size in bytes (default 1398) - * - * This value limits the fragment size for EAP methods that support - * fragmentation (e.g., EAP-TLS and EAP-PEAP). This value should be set - * small enough to make the EAP messages fit in MTU of the network - * interface used for EAPOL. The default value is suitable for most - * cases. - */ - int fragment_size; - -#define EAP_CONFIG_FLAGS_PASSWORD_NTHASH BIT(0) -#define EAP_CONFIG_FLAGS_EXT_PASSWORD BIT(1) - /** - * flags - Network configuration flags (bitfield) - * - * This variable is used for internal flags to describe further details - * for the network parameters. - * bit 0 = password is represented as a 16-byte NtPasswordHash value - * instead of plaintext password - * bit 1 = password is stored in external storage; the value in the - * password field is the name of that external entry - */ - u32 flags; - - /** - * ocsp - Whether to use/require OCSP to check server certificate - * - * 0 = do not use OCSP stapling (TLS certificate status extension) - * 1 = try to use OCSP stapling, but not require response - * 2 = require valid OCSP stapling response - */ - int ocsp; -}; - - -/** - * struct wpa_config_blob - Named configuration blob - * - * This data structure is used to provide storage for binary objects to store - * abstract information like certificates and private keys inlined with the - * configuration data. - */ -struct wpa_config_blob { - /** - * name - Blob name - */ - char *name; - - /** - * data - Pointer to binary data - */ - const u8 *data; - - /** - * len - Length of binary data - */ - size_t len; - - /** - * next - Pointer to next blob in the configuration - */ - struct wpa_config_blob *next; -}; - -#endif /* EAP_CONFIG_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_defs.h b/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_defs.h deleted file mode 100644 index 10995d3868e..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_defs.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * EAP server/peer: Shared EAP definitions - * Copyright (c) 2004-2007, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef EAP_DEFS_H -#define EAP_DEFS_H - -/* RFC 3748 - Extensible Authentication Protocol (EAP) */ - -#ifdef _MSC_VER -#pragma pack(push, 1) -#endif /* _MSC_VER */ - -struct eap_hdr { - u8 code; - u8 identifier; - be16 length; /* including code and identifier; network byte order */ - /* followed by length-4 octets of data */ -} STRUCT_PACKED; - - -#ifdef _MSC_VER -#pragma pack(pop) -#endif /* _MSC_VER */ - -enum { EAP_CODE_REQUEST = 1, EAP_CODE_RESPONSE = 2, EAP_CODE_SUCCESS = 3, - EAP_CODE_FAILURE = 4 }; - -/* EAP Request and Response data begins with one octet Type. Success and - * Failure do not have additional data. */ - -/* - * EAP Method Types as allocated by IANA: - * http://www.iana.org/assignments/eap-numbers - */ -typedef enum { - EAP_TYPE_NONE = 0, - EAP_TYPE_IDENTITY = 1 /* RFC 3748 */, - EAP_TYPE_NOTIFICATION = 2 /* RFC 3748 */, - EAP_TYPE_NAK = 3 /* Response only, RFC 3748 */, - EAP_TYPE_MD5 = 4, /* RFC 3748 */ - EAP_TYPE_OTP = 5 /* RFC 3748 */, - EAP_TYPE_GTC = 6, /* RFC 3748 */ - EAP_TYPE_TLS = 13 /* RFC 2716 */, - EAP_TYPE_LEAP = 17 /* Cisco proprietary */, - EAP_TYPE_SIM = 18 /* RFC 4186 */, - EAP_TYPE_TTLS = 21 /* RFC 5281 */, - EAP_TYPE_AKA = 23 /* RFC 4187 */, - EAP_TYPE_PEAP = 25 /* draft-josefsson-pppext-eap-tls-eap-06.txt */, - EAP_TYPE_MSCHAPV2 = 26 /* draft-kamath-pppext-eap-mschapv2-00.txt */, - EAP_TYPE_TLV = 33 /* draft-josefsson-pppext-eap-tls-eap-07.txt */, - EAP_TYPE_TNC = 38 /* TNC IF-T v1.0-r3; note: tentative assignment; - * type 38 has previously been allocated for - * EAP-HTTP Digest, (funk.com) */, - EAP_TYPE_FAST = 43 /* RFC 4851 */, - EAP_TYPE_PAX = 46 /* RFC 4746 */, - EAP_TYPE_PSK = 47 /* RFC 4764 */, - EAP_TYPE_SAKE = 48 /* RFC 4763 */, - EAP_TYPE_IKEV2 = 49 /* RFC 5106 */, - EAP_TYPE_AKA_PRIME = 50 /* RFC 5448 */, - EAP_TYPE_GPSK = 51 /* RFC 5433 */, - EAP_TYPE_PWD = 52 /* RFC 5931 */, - EAP_TYPE_EKE = 53 /* RFC 6124 */, - EAP_TYPE_EXPANDED = 254 /* RFC 3748 */ -} EapType; - - -/* SMI Network Management Private Enterprise Code for vendor specific types */ -enum { - EAP_VENDOR_IETF = 0, - EAP_VENDOR_MICROSOFT = 0x000137 /* Microsoft */, - EAP_VENDOR_WFA = 0x00372A /* Wi-Fi Alliance */, - EAP_VENDOR_HOSTAP = 39068 /* hostapd/wpa_supplicant project */ -}; - -struct eap_expand { - u8 vendor_id[3]; - be32 vendor_type; - u8 opcode; -} STRUCT_PACKED; - -#define EAP_VENDOR_UNAUTH_TLS EAP_VENDOR_HOSTAP -#define EAP_VENDOR_TYPE_UNAUTH_TLS 1 - -#define EAP_MSK_LEN 64 -#define EAP_EMSK_LEN 64 - -#endif /* EAP_DEFS_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_i.h b/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_i.h deleted file mode 100644 index 6adf5ec7e35..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_i.h +++ /dev/null @@ -1,149 +0,0 @@ -/* - * EAP peer state machines internal structures (RFC 4137) - * Copyright (c) 2004-2007, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef EAP_I_H -#define EAP_I_H - -#include "wpa/wpabuf.h" -#include "eap.h" -#include "eap_common.h" -#include "eap_config.h" -#include "esp_wpa2.h" - -/* RFC 4137 - EAP Peer state machine */ - -typedef enum { - DECISION_FAIL, DECISION_COND_SUCC, DECISION_UNCOND_SUCC -} EapDecision; - -typedef enum { - METHOD_NONE, METHOD_INIT, METHOD_CONT, METHOD_MAY_CONT, METHOD_DONE -} EapMethodState; - -/** - * struct eap_method_ret - EAP return values from struct eap_method::process() - * - * These structure contains OUT variables for the interface between peer state - * machine and methods (RFC 4137, Sect. 4.2). eapRespData will be returned as - * the return value of struct eap_method::process() so it is not included in - * this structure. - */ -struct eap_method_ret { - /** - * ignore - Whether method decided to drop the current packed (OUT) - */ - Boolean ignore; - - /** - * methodState - Method-specific state (IN/OUT) - */ - EapMethodState methodState; - - /** - * decision - Authentication decision (OUT) - */ - EapDecision decision; - - /** - * allowNotifications - Whether method allows notifications (OUT) - */ - Boolean allowNotifications; -}; - -struct eap_sm; - -struct eap_method { - /** - * vendor -EAP Vendor-ID - */ - int vendor; - - /** - * method - EAP type number - */ - EapType method; - - /** - * name - Name of the method (e.g., "TLS") - */ - const char *name; - - struct eap_method *next; - - void * (*init)(struct eap_sm *sm); - void (*deinit)(struct eap_sm *sm, void *priv); - struct wpabuf * (*process)(struct eap_sm *sm, void *priv, - struct eap_method_ret *ret, - const struct wpabuf *reqData); - bool (*isKeyAvailable)(struct eap_sm *sm, void *priv); - u8 * (*getKey)(struct eap_sm *sm, void *priv, size_t *len); - int (*get_status)(struct eap_sm *sm, void *priv, char *buf, - size_t buflen, int verbose); - const u8 * (*get_identity)(struct eap_sm *sm, void *priv, size_t *len); - void (*free)(struct eap_method *method); - bool (*has_reauth_data)(struct eap_sm *sm, void *priv); - void (*deinit_for_reauth)(struct eap_sm *sm, void *priv); - void * (*init_for_reauth)(struct eap_sm *sm, void *priv); - u8 * (*getSessionId)(struct eap_sm *sm, void *priv, size_t *len); -}; - -#define CLIENT_CERT_NAME "CLC" -#define CA_CERT_NAME "CAC" -#define PRIVATE_KEY_NAME "PVK" -#define BLOB_NAME_LEN 3 -#define BLOB_NUM 3 - -enum SIG_WPA2 { - SIG_WPA2_START = 0, - SIG_WPA2_RX, - SIG_WPA2_TASK_DEL, - SIG_WPA2_MAX, -}; - -/** - * struct eap_sm - EAP state machine data - */ -struct eap_sm { - void *eap_method_priv; - - void *ssl_ctx; - - unsigned int workaround; -///////////////////////////////////////////////// - struct pbuf *outbuf; - struct wpa_config_blob blob[BLOB_NUM]; - struct eap_peer_config config; - u8 current_identifier; - u8 ownaddr[ETH_ALEN]; -#ifdef USE_WPA2_TASK - u8 wpa2_sig_cnt[SIG_WPA2_MAX]; -#endif - u8 finish_state; - - int init_phase2; - bool peap_done; - - u8 *eapKeyData; - size_t eapKeyDataLen; - struct wpabuf *lastRespData; - const struct eap_method *m; -}; - -wpa2_crypto_funcs_t wpa2_crypto_funcs; - -const u8 * eap_get_config_identity(struct eap_sm *sm, size_t *len); -const u8 * eap_get_config_password(struct eap_sm *sm, size_t *len); -const u8 * eap_get_config_password2(struct eap_sm *sm, size_t *len, int *hash); -const u8 * eap_get_config_new_password(struct eap_sm *sm, size_t *len); -struct eap_peer_config * eap_get_config(struct eap_sm *sm); -const struct wpa_config_blob * eap_get_config_blob(struct eap_sm *sm, const char *name); -bool wifi_sta_get_enterprise_disable_time_check(void); - -struct wpabuf * eap_sm_build_identity_resp(struct eap_sm *sm, u8 id, int encrypted); - -#endif /* EAP_I_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_methods.h b/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_methods.h deleted file mode 100644 index 7d518dec2ce..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_methods.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * EAP peer: Method registration - * Copyright (c) 2004-2007, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef EAP_METHODS_H -#define EAP_METHODS_H - -#include "eap_defs.h" -#include "eap_config.h" - -const struct eap_method * eap_peer_get_eap_method(int vendor, EapType method); -const struct eap_method * eap_peer_get_methods(size_t *count); - -u32 eap_get_phase2_type(const char *name, int *vendor); -struct eap_method_type * eap_get_phase2_types(struct eap_peer_config *config, - size_t *count); - -struct eap_method * eap_peer_method_alloc(int verdor, EapType method, - const char *name); - -void eap_peer_method_free(struct eap_method *method); -int eap_peer_method_register(struct eap_method *method); - -void eap_peer_unregister_methods(void); - -//int eap_peer_md5_register(void); -int eap_peer_tls_register(void); -int eap_peer_peap_register(void); -int eap_peer_ttls_register(void); -int eap_peer_mschapv2_register(void); - -void eap_peer_unregister_methods(void); -int eap_peer_register_methods(void); - -#endif /* EAP_METHODS_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_peap_common.h b/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_peap_common.h deleted file mode 100644 index 7aad0dff781..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_peap_common.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * EAP-PEAP common routines - * Copyright (c) 2008-2011, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef EAP_PEAP_COMMON_H -#define EAP_PEAP_COMMON_H - -int peap_prfplus(int version, const u8 *key, size_t key_len, - const char *label, const u8 *seed, size_t seed_len, - u8 *buf, size_t buf_len); - -#endif /* EAP_PEAP_COMMON_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_tls.h b/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_tls.h deleted file mode 100644 index a8a386f22c7..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_tls.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * EAP peer: EAP-TLS/PEAP/TTLS/FAST common functions - * Copyright (c) 2004-2009, 2012, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef EAP_TLS_H -#define EAP_TLS_H - -#include "eap_i.h" -#include "eap_common.h" -#include "eap.h" -#include "wpa/wpabuf.h" - -void * eap_tls_init(struct eap_sm *sm); -void eap_tls_deinit(struct eap_sm *sm, void *priv); -struct wpabuf * eap_tls_process(struct eap_sm *sm, void *priv, - struct eap_method_ret *ret, - const struct wpabuf *reqData); - -u8 * eap_tls_getKey(struct eap_sm *sm, void *priv, size_t *len); - -#endif /* EAP_TLS_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_tls_common.h b/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_tls_common.h deleted file mode 100644 index 1a5e0f89e4e..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_tls_common.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - * EAP peer: EAP-TLS/PEAP/TTLS/FAST common functions - * Copyright (c) 2004-2009, 2012, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef EAP_TLS_COMMON_H -#define EAP_TLS_COMMON_H - -/** - * struct eap_ssl_data - TLS data for EAP methods - */ -struct eap_ssl_data { - /** - * conn - TLS connection context data from tls_connection_init() - */ - struct tls_connection *conn; - - /** - * tls_out - TLS message to be sent out in fragments - */ - struct wpabuf *tls_out; - - /** - * tls_out_pos - The current position in the outgoing TLS message - */ - size_t tls_out_pos; - - /** - * tls_out_limit - Maximum fragment size for outgoing TLS messages - */ - size_t tls_out_limit; - - /** - * tls_in - Received TLS message buffer for re-assembly - */ - struct wpabuf *tls_in; - - /** - * tls_in_left - Number of remaining bytes in the incoming TLS message - */ - size_t tls_in_left; - - /** - * tls_in_total - Total number of bytes in the incoming TLS message - */ - size_t tls_in_total; - - /** - * phase2 - Whether this TLS connection is used in EAP phase 2 (tunnel) - */ - int phase2; - - /** - * include_tls_length - Whether the TLS length field is included even - * if the TLS data is not fragmented - */ - int include_tls_length; - - /** - * eap - EAP state machine allocated with eap_peer_sm_init() - */ - struct eap_sm *eap; - - /** - * ssl_ctx - TLS library context to use for the connection - */ - void *ssl_ctx; - - /** - * eap_type - EAP method used in Phase 1 (EAP_TYPE_TLS/PEAP/TTLS/FAST) - */ - u8 eap_type; -}; - - -/* EAP TLS Flags */ -#define EAP_TLS_FLAGS_LENGTH_INCLUDED 0x80 -#define EAP_TLS_FLAGS_MORE_FRAGMENTS 0x40 -#define EAP_TLS_FLAGS_START 0x20 -#define EAP_TLS_VERSION_MASK 0x07 - - /* could be up to 128 bytes, but only the first 64 bytes are used */ -#define EAP_TLS_KEY_LEN 64 - -/* dummy type used as a flag for UNAUTH-TLS */ -#define EAP_UNAUTH_TLS_TYPE 255 - - -int eap_peer_tls_ssl_init(struct eap_sm *sm, struct eap_ssl_data *data, - struct eap_peer_config *config, u8 eap_type); -void eap_peer_tls_ssl_deinit(struct eap_sm *sm, struct eap_ssl_data *data); -u8 * eap_peer_tls_derive_key(struct eap_sm *sm, struct eap_ssl_data *data, - const char *label, size_t len); -u8 * eap_peer_tls_derive_session_id(struct eap_sm *sm, - struct eap_ssl_data *data, u8 eap_type, - size_t *len); -int eap_peer_tls_process_helper(struct eap_sm *sm, struct eap_ssl_data *data, - EapType eap_type, int peap_version, - u8 id, const u8 *in_data, size_t in_len, - struct wpabuf **out_data); -struct wpabuf * eap_peer_tls_build_ack(u8 id, EapType eap_type, - int peap_version); -int eap_peer_tls_reauth_init(struct eap_sm *sm, struct eap_ssl_data *data); -int eap_peer_tls_status(struct eap_sm *sm, struct eap_ssl_data *data, - char *buf, size_t buflen, int verbose); -const u8 * eap_peer_tls_process_init(struct eap_sm *sm, - struct eap_ssl_data *data, - EapType eap_type, - struct eap_method_ret *ret, - const struct wpabuf *reqData, - size_t *len, u8 *flags); -void eap_peer_tls_reset_input(struct eap_ssl_data *data); -void eap_peer_tls_reset_output(struct eap_ssl_data *data); -int eap_peer_tls_decrypt(struct eap_sm *sm, struct eap_ssl_data *data, - const struct wpabuf *in_data, - struct wpabuf **in_decrypted); -int eap_peer_tls_encrypt(struct eap_sm *sm, struct eap_ssl_data *data, - EapType eap_type, int peap_version, u8 id, - const struct wpabuf *in_data, - struct wpabuf **out_data); -int eap_peer_select_phase2_methods(struct eap_peer_config *config, - const char *prefix, - struct eap_method_type **types, - size_t *num_types); -int eap_peer_tls_phase2_nak(struct eap_method_type *types, size_t num_types, - struct eap_hdr *hdr, struct wpabuf **resp); - -#endif /* EAP_TLS_COMMON_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_tlv_common.h b/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_tlv_common.h deleted file mode 100644 index 3286055ab7b..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_tlv_common.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * EAP-TLV definitions (draft-josefsson-pppext-eap-tls-eap-10.txt) - * Copyright (c) 2004-2008, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef EAP_TLV_COMMON_H -#define EAP_TLV_COMMON_H - -/* EAP-TLV TLVs (draft-josefsson-ppext-eap-tls-eap-10.txt) */ -#define EAP_TLV_RESULT_TLV 3 /* Acknowledged Result */ -#define EAP_TLV_NAK_TLV 4 -#define EAP_TLV_ERROR_CODE_TLV 5 -#define EAP_TLV_CONNECTION_BINDING_TLV 6 -#define EAP_TLV_VENDOR_SPECIFIC_TLV 7 -#define EAP_TLV_URI_TLV 8 -#define EAP_TLV_EAP_PAYLOAD_TLV 9 -#define EAP_TLV_INTERMEDIATE_RESULT_TLV 10 -#define EAP_TLV_PAC_TLV 11 /* RFC 5422, Section 4.2 */ -#define EAP_TLV_CRYPTO_BINDING_TLV 12 -#define EAP_TLV_CALLING_STATION_ID_TLV 13 -#define EAP_TLV_CALLED_STATION_ID_TLV 14 -#define EAP_TLV_NAS_PORT_TYPE_TLV 15 -#define EAP_TLV_SERVER_IDENTIFIER_TLV 16 -#define EAP_TLV_IDENTITY_TYPE_TLV 17 -#define EAP_TLV_SERVER_TRUSTED_ROOT_TLV 18 -#define EAP_TLV_REQUEST_ACTION_TLV 19 -#define EAP_TLV_PKCS7_TLV 20 - -#define EAP_TLV_RESULT_SUCCESS 1 -#define EAP_TLV_RESULT_FAILURE 2 - -#define EAP_TLV_TYPE_MANDATORY 0x8000 -#define EAP_TLV_TYPE_MASK 0x3fff - -#ifdef _MSC_VER -#pragma pack(push, 1) -#endif /* _MSC_VER */ - -struct eap_tlv_hdr { - be16 tlv_type; - be16 length; -} STRUCT_PACKED; - -struct eap_tlv_nak_tlv { - be16 tlv_type; - be16 length; - be32 vendor_id; - be16 nak_type; -} STRUCT_PACKED; - -struct eap_tlv_result_tlv { - be16 tlv_type; - be16 length; - be16 status; -} STRUCT_PACKED; - -/* RFC 4851, Section 4.2.7 - Intermediate-Result TLV */ -struct eap_tlv_intermediate_result_tlv { - be16 tlv_type; - be16 length; - be16 status; - /* Followed by optional TLVs */ -} STRUCT_PACKED; - -/* RFC 4851, Section 4.2.8 - Crypto-Binding TLV */ -struct eap_tlv_crypto_binding_tlv { - be16 tlv_type; - be16 length; - u8 reserved; - u8 version; - u8 received_version; - u8 subtype; - u8 nonce[32]; - u8 compound_mac[20]; -} STRUCT_PACKED; - -struct eap_tlv_pac_ack_tlv { - be16 tlv_type; - be16 length; - be16 pac_type; - be16 pac_len; - be16 result; -} STRUCT_PACKED; - -/* RFC 4851, Section 4.2.9 - Request-Action TLV */ -struct eap_tlv_request_action_tlv { - be16 tlv_type; - be16 length; - be16 action; -} STRUCT_PACKED; - -/* RFC 5422, Section 4.2.6 - PAC-Type TLV */ -struct eap_tlv_pac_type_tlv { - be16 tlv_type; /* PAC_TYPE_PAC_TYPE */ - be16 length; - be16 pac_type; -} STRUCT_PACKED; - -#ifdef _MSC_VER -#pragma pack(pop) -#endif /* _MSC_VER */ - -#define EAP_TLV_CRYPTO_BINDING_SUBTYPE_REQUEST 0 -#define EAP_TLV_CRYPTO_BINDING_SUBTYPE_RESPONSE 1 - -#define EAP_TLV_ACTION_PROCESS_TLV 1 -#define EAP_TLV_ACTION_NEGOTIATE_EAP 2 - -#endif /* EAP_TLV_COMMON_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_ttls.h b/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_ttls.h deleted file mode 100644 index 17901d42db1..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/eap_ttls.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * EAP server/peer: EAP-TTLS (RFC 5281) - * Copyright (c) 2004-2007, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef EAP_TTLS_H -#define EAP_TTLS_H - -struct ttls_avp { - be32 avp_code; - be32 avp_length; /* 8-bit flags, 24-bit length; - * length includes AVP header */ - /* optional 32-bit Vendor-ID */ - /* Data */ -}; - -struct ttls_avp_vendor { - be32 avp_code; - be32 avp_length; /* 8-bit flags, 24-bit length; - * length includes AVP header */ - be32 vendor_id; - /* Data */ -}; - -#define AVP_FLAGS_VENDOR 0x80 -#define AVP_FLAGS_MANDATORY 0x40 - -#define AVP_PAD(start, pos) \ -do { \ - int __pad; \ - __pad = (4 - (((pos) - (start)) & 3)) & 3; \ - os_memset((pos), 0, __pad); \ - pos += __pad; \ -} while (0) - - -/* RFC 2865 */ -#define RADIUS_ATTR_USER_NAME 1 -#define RADIUS_ATTR_USER_PASSWORD 2 -#define RADIUS_ATTR_CHAP_PASSWORD 3 -#define RADIUS_ATTR_REPLY_MESSAGE 18 -#define RADIUS_ATTR_CHAP_CHALLENGE 60 -#define RADIUS_ATTR_EAP_MESSAGE 79 - -/* RFC 2548 */ -#define RADIUS_VENDOR_ID_MICROSOFT 311 -#define RADIUS_ATTR_MS_CHAP_RESPONSE 1 -#define RADIUS_ATTR_MS_CHAP_ERROR 2 -#define RADIUS_ATTR_MS_CHAP_NT_ENC_PW 6 -#define RADIUS_ATTR_MS_CHAP_CHALLENGE 11 -#define RADIUS_ATTR_MS_CHAP2_RESPONSE 25 -#define RADIUS_ATTR_MS_CHAP2_SUCCESS 26 -#define RADIUS_ATTR_MS_CHAP2_CPW 27 - -#define EAP_TTLS_MSCHAPV2_CHALLENGE_LEN 16 -#define EAP_TTLS_MSCHAPV2_RESPONSE_LEN 50 -#define EAP_TTLS_MSCHAP_CHALLENGE_LEN 8 -#define EAP_TTLS_MSCHAP_RESPONSE_LEN 50 -#define EAP_TTLS_CHAP_CHALLENGE_LEN 16 -#define EAP_TTLS_CHAP_PASSWORD_LEN 16 - -#endif /* EAP_TTLS_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/mschapv2.h b/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/mschapv2.h deleted file mode 100644 index ef750819ffe..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/eap_peer/mschapv2.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * MSCHAPV2 - */ - - -#ifndef MSCHAPV2_H -#define MSCHAPV2_H - -#define MSCHAPV2_CHAL_LEN 16 -#define MSCHAPV2_NT_RESPONSE_LEN 24 -#define MSCHAPV2_AUTH_RESPONSE_LEN 20 -#define MSCHAPV2_MASTER_KEY_LEN 16 - -const u8 * mschapv2_remove_domain(const u8 *username, size_t *len); -int mschapv2_derive_response(const u8 *username, size_t username_len, - const u8 *password, size_t password_len, - int pwhash, - const u8 *auth_challenge, - const u8 *peer_challenge, - u8 *nt_response, u8 *auth_response, - u8 *master_key); -int mschapv2_verify_auth_response(const u8 *auth_response, - const u8 *buf, size_t buf_len); -#endif /* MSCHAPV2_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/tls/asn1.h b/tools/sdk/include/wpa_supplicant/wpa2/tls/asn1.h deleted file mode 100644 index 6342c4cc79f..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/tls/asn1.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * ASN.1 DER parsing - * Copyright (c) 2006, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef ASN1_H -#define ASN1_H - -#define ASN1_TAG_EOC 0x00 /* not used with DER */ -#define ASN1_TAG_BOOLEAN 0x01 -#define ASN1_TAG_INTEGER 0x02 -#define ASN1_TAG_BITSTRING 0x03 -#define ASN1_TAG_OCTETSTRING 0x04 -#define ASN1_TAG_NULL 0x05 -#define ASN1_TAG_OID 0x06 -#define ASN1_TAG_OBJECT_DESCRIPTOR 0x07 /* not yet parsed */ -#define ASN1_TAG_EXTERNAL 0x08 /* not yet parsed */ -#define ASN1_TAG_REAL 0x09 /* not yet parsed */ -#define ASN1_TAG_ENUMERATED 0x0A /* not yet parsed */ -#define ASN1_TAG_UTF8STRING 0x0C /* not yet parsed */ -#define ANS1_TAG_RELATIVE_OID 0x0D -#define ASN1_TAG_SEQUENCE 0x10 /* shall be constructed */ -#define ASN1_TAG_SET 0x11 -#define ASN1_TAG_NUMERICSTRING 0x12 /* not yet parsed */ -#define ASN1_TAG_PRINTABLESTRING 0x13 -#define ASN1_TAG_TG1STRING 0x14 /* not yet parsed */ -#define ASN1_TAG_VIDEOTEXSTRING 0x15 /* not yet parsed */ -#define ASN1_TAG_IA5STRING 0x16 -#define ASN1_TAG_UTCTIME 0x17 -#define ASN1_TAG_GENERALIZEDTIME 0x18 /* not yet parsed */ -#define ASN1_TAG_GRAPHICSTRING 0x19 /* not yet parsed */ -#define ASN1_TAG_VISIBLESTRING 0x1A -#define ASN1_TAG_GENERALSTRING 0x1B /* not yet parsed */ -#define ASN1_TAG_UNIVERSALSTRING 0x1C /* not yet parsed */ -#define ASN1_TAG_BMPSTRING 0x1D /* not yet parsed */ - -#define ASN1_CLASS_UNIVERSAL 0 -#define ASN1_CLASS_APPLICATION 1 -#define ASN1_CLASS_CONTEXT_SPECIFIC 2 -#define ASN1_CLASS_PRIVATE 3 - - -struct asn1_hdr { - const u8 *payload; - u8 identifier, class, constructed; - unsigned int tag, length; -}; - -#define ASN1_MAX_OID_LEN 20 -struct asn1_oid { - unsigned long oid[ASN1_MAX_OID_LEN]; - size_t len; -}; - - -int asn1_get_next(const u8 *buf, size_t len, struct asn1_hdr *hdr); -int asn1_parse_oid(const u8 *buf, size_t len, struct asn1_oid *oid); -int asn1_get_oid(const u8 *buf, size_t len, struct asn1_oid *oid, - const u8 **next); -void asn1_oid_to_str(struct asn1_oid *oid, char *buf, size_t len); -unsigned long asn1_bit_string_to_long(const u8 *buf, size_t len); - -#endif /* ASN1_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/tls/bignum.h b/tools/sdk/include/wpa_supplicant/wpa2/tls/bignum.h deleted file mode 100644 index f25e26783a0..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/tls/bignum.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Big number math - * Copyright (c) 2006, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. - */ - -#ifndef BIGNUM_H -#define BIGNUM_H - -struct bignum; - -struct bignum * bignum_init(void); -void bignum_deinit(struct bignum *n); -size_t bignum_get_unsigned_bin_len(struct bignum *n); -int bignum_get_unsigned_bin(const struct bignum *n, u8 *buf, size_t *len); -int bignum_set_unsigned_bin(struct bignum *n, const u8 *buf, size_t len); -int bignum_cmp(const struct bignum *a, const struct bignum *b); -int bignum_cmp_d(const struct bignum *a, unsigned long b); -int bignum_add(const struct bignum *a, const struct bignum *b, - struct bignum *c); -int bignum_sub(const struct bignum *a, const struct bignum *b, - struct bignum *c); -int bignum_mul(const struct bignum *a, const struct bignum *b, - struct bignum *c); -int bignum_mulmod(const struct bignum *a, const struct bignum *b, - const struct bignum *c, struct bignum *d); -int bignum_exptmod(const struct bignum *a, const struct bignum *b, - const struct bignum *c, struct bignum *d); - -#endif /* BIGNUM_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/tls/libtommath.h b/tools/sdk/include/wpa_supplicant/wpa2/tls/libtommath.h deleted file mode 100644 index 9be311e86a6..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/tls/libtommath.h +++ /dev/null @@ -1,3441 +0,0 @@ -/* - * Minimal code for RSA support from LibTomMath 0.41 - * http://libtom.org/ - * http://libtom.org/files/ltm-0.41.tar.bz2 - * This library was released in public domain by Tom St Denis. - * - * The combination in this file may not use all of the optimized algorithms - * from LibTomMath and may be considerable slower than the LibTomMath with its - * default settings. The main purpose of having this version here is to make it - * easier to build bignum.c wrapper without having to install and build an - * external library. - * - * If CONFIG_INTERNAL_LIBTOMMATH is defined, bignum.c includes this - * libtommath.c file instead of using the external LibTomMath library. - */ -#include "os.h" -#include "stdarg.h" - -#ifdef MEMLEAK_DEBUG -static const char mem_debug_file[] ICACHE_RODATA_ATTR = __FILE__; -#endif - -#ifndef CHAR_BIT -#define CHAR_BIT 8 -#endif - -#define BN_MP_INVMOD_C -#define BN_S_MP_EXPTMOD_C /* Note: #undef in tommath_superclass.h; this would - * require BN_MP_EXPTMOD_FAST_C instead */ -#define BN_S_MP_MUL_DIGS_C -#define BN_MP_INVMOD_SLOW_C -#define BN_S_MP_SQR_C -#define BN_S_MP_MUL_HIGH_DIGS_C /* Note: #undef in tommath_superclass.h; this - * would require other than mp_reduce */ - -#ifdef LTM_FAST - -/* Use faster div at the cost of about 1 kB */ -#define BN_MP_MUL_D_C - -/* Include faster exptmod (Montgomery) at the cost of about 2.5 kB in code */ -#define BN_MP_EXPTMOD_FAST_C -#define BN_MP_MONTGOMERY_SETUP_C -#define BN_FAST_MP_MONTGOMERY_REDUCE_C -#define BN_MP_MONTGOMERY_CALC_NORMALIZATION_C -#define BN_MP_MUL_2_C - -/* Include faster sqr at the cost of about 0.5 kB in code */ -#define BN_FAST_S_MP_SQR_C - -#else /* LTM_FAST */ - -#define BN_MP_DIV_SMALL -#define BN_MP_INIT_MULTI_C -#define BN_MP_CLEAR_MULTI_C -#define BN_MP_ABS_C -#endif /* LTM_FAST */ - -/* Current uses do not require support for negative exponent in exptmod, so we - * can save about 1.5 kB in leaving out invmod. */ -#define LTM_NO_NEG_EXP - -/* from tommath.h */ - -#ifndef MIN - #define MIN(x,y) ((x)<(y)?(x):(y)) -#endif - -#ifndef MAX - #define MAX(x,y) ((x)>(y)?(x):(y)) -#endif - -#define OPT_CAST(x) (x *) - -typedef unsigned long mp_digit; -typedef u64 mp_word; - -#define DIGIT_BIT 28 -#define MP_28BIT - - -#define XMALLOC os_malloc -#define XFREE os_free -#define XREALLOC os_realloc - - -#define MP_MASK ((((mp_digit)1)<<((mp_digit)DIGIT_BIT))-((mp_digit)1)) - -#define MP_LT -1 /* less than */ -#define MP_EQ 0 /* equal to */ -#define MP_GT 1 /* greater than */ - -#define MP_ZPOS 0 /* positive integer */ -#define MP_NEG 1 /* negative */ - -#define MP_OKAY 0 /* ok result */ -#define MP_MEM -2 /* out of mem */ -#define MP_VAL -3 /* invalid input */ - -#define MP_YES 1 /* yes response */ -#define MP_NO 0 /* no response */ - -typedef int mp_err; - -/* define this to use lower memory usage routines (exptmods mostly) */ -#define MP_LOW_MEM - -/* default precision */ -#ifndef MP_PREC - #ifndef MP_LOW_MEM - #define MP_PREC 32 /* default digits of precision */ - #else - #define MP_PREC 8 /* default digits of precision */ - #endif -#endif - -/* size of comba arrays, should be at least 2 * 2**(BITS_PER_WORD - BITS_PER_DIGIT*2) */ -#define MP_WARRAY (1 << (sizeof(mp_word) * CHAR_BIT - 2 * DIGIT_BIT + 1)) - -/* the infamous mp_int structure */ -typedef struct { - int used, alloc, sign; - mp_digit *dp; -} mp_int; - - -/* ---> Basic Manipulations <--- */ -#define mp_iszero(a) (((a)->used == 0) ? MP_YES : MP_NO) -#define mp_iseven(a) (((a)->used > 0 && (((a)->dp[0] & 1) == 0)) ? MP_YES : MP_NO) -#define mp_isodd(a) (((a)->used > 0 && (((a)->dp[0] & 1) == 1)) ? MP_YES : MP_NO) - - -/* prototypes for copied functions */ -#define s_mp_mul(a, b, c) s_mp_mul_digs(a, b, c, (a)->used + (b)->used + 1) -static int s_mp_exptmod(mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int redmode); -static int s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs); -static int s_mp_sqr(mp_int * a, mp_int * b); -static int s_mp_mul_high_digs(mp_int * a, mp_int * b, mp_int * c, int digs); - -static int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs); - -#ifdef BN_MP_INIT_MULTI_C -static int mp_init_multi(mp_int *mp, ...); -#endif -#ifdef BN_MP_CLEAR_MULTI_C -static void mp_clear_multi(mp_int *mp, ...); -#endif -static int mp_lshd(mp_int * a, int b); -static void mp_set(mp_int * a, mp_digit b); -static void mp_clamp(mp_int * a); -static void mp_exch(mp_int * a, mp_int * b); -static void mp_rshd(mp_int * a, int b); -static void mp_zero(mp_int * a); -static int mp_mod_2d(mp_int * a, int b, mp_int * c); -static int mp_div_2d(mp_int * a, int b, mp_int * c, mp_int * d); -static int mp_init_copy(mp_int * a, mp_int * b); -static int mp_mul_2d(mp_int * a, int b, mp_int * c); -#ifndef LTM_NO_NEG_EXP -static int mp_div_2(mp_int * a, mp_int * b); -static int mp_invmod(mp_int * a, mp_int * b, mp_int * c); -static int mp_invmod_slow(mp_int * a, mp_int * b, mp_int * c); -#endif /* LTM_NO_NEG_EXP */ -static int mp_copy(mp_int * a, mp_int * b); -static int mp_count_bits(mp_int * a); -static int mp_div(mp_int * a, mp_int * b, mp_int * c, mp_int * d); -static int mp_mod(mp_int * a, mp_int * b, mp_int * c); -static int mp_grow(mp_int * a, int size); -static int mp_cmp_mag(mp_int * a, mp_int * b); -#ifdef BN_MP_ABS_C -static int mp_abs(mp_int * a, mp_int * b); -#endif -static int mp_sqr(mp_int * a, mp_int * b); -static int mp_reduce_2k_l(mp_int *a, mp_int *n, mp_int *d); -static int mp_reduce_2k_setup_l(mp_int *a, mp_int *d); -static int mp_2expt(mp_int * a, int b); -static int mp_reduce_setup(mp_int * a, mp_int * b); -static int mp_reduce(mp_int * x, mp_int * m, mp_int * mu); -static int mp_init_size(mp_int * a, int size); -#ifdef BN_MP_EXPTMOD_FAST_C -static int mp_exptmod_fast (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int redmode); -#endif /* BN_MP_EXPTMOD_FAST_C */ -#ifdef BN_FAST_S_MP_SQR_C -static int fast_s_mp_sqr (mp_int * a, mp_int * b); -#endif /* BN_FAST_S_MP_SQR_C */ -#ifdef BN_MP_MUL_D_C -static int mp_mul_d (mp_int * a, mp_digit b, mp_int * c); -#endif /* BN_MP_MUL_D_C */ - - - -/* functions from bn_.c */ - - -/* reverse an array, used for radix code */ -static void -bn_reverse (unsigned char *s, int len) -{ - int ix, iy; - unsigned char t; - - ix = 0; - iy = len - 1; - while (ix < iy) { - t = s[ix]; - s[ix] = s[iy]; - s[iy] = t; - ++ix; - --iy; - } -} - - -/* low level addition, based on HAC pp.594, Algorithm 14.7 */ -static int -s_mp_add (mp_int * a, mp_int * b, mp_int * c) -{ - mp_int *x; - int olduse, res, min, max; - - /* find sizes, we let |a| <= |b| which means we have to sort - * them. "x" will point to the input with the most digits - */ - if (a->used > b->used) { - min = b->used; - max = a->used; - x = a; - } else { - min = a->used; - max = b->used; - x = b; - } - - /* init result */ - if (c->alloc < max + 1) { - if ((res = mp_grow (c, max + 1)) != MP_OKAY) { - return res; - } - } - - /* get old used digit count and set new one */ - olduse = c->used; - c->used = max + 1; - - { - register mp_digit u, *tmpa, *tmpb, *tmpc; - register int i; - - /* alias for digit pointers */ - - /* first input */ - tmpa = a->dp; - - /* second input */ - tmpb = b->dp; - - /* destination */ - tmpc = c->dp; - - /* zero the carry */ - u = 0; - for (i = 0; i < min; i++) { - /* Compute the sum at one digit, T[i] = A[i] + B[i] + U */ - *tmpc = *tmpa++ + *tmpb++ + u; - - /* U = carry bit of T[i] */ - u = *tmpc >> ((mp_digit)DIGIT_BIT); - - /* take away carry bit from T[i] */ - *tmpc++ &= MP_MASK; - } - - /* now copy higher words if any, that is in A+B - * if A or B has more digits add those in - */ - if (min != max) { - for (; i < max; i++) { - /* T[i] = X[i] + U */ - *tmpc = x->dp[i] + u; - - /* U = carry bit of T[i] */ - u = *tmpc >> ((mp_digit)DIGIT_BIT); - - /* take away carry bit from T[i] */ - *tmpc++ &= MP_MASK; - } - } - - /* add carry */ - *tmpc++ = u; - - /* clear digits above oldused */ - for (i = c->used; i < olduse; i++) { - *tmpc++ = 0; - } - } - - mp_clamp (c); - return MP_OKAY; -} - - -/* low level subtraction (assumes |a| > |b|), HAC pp.595 Algorithm 14.9 */ -static int -s_mp_sub (mp_int * a, mp_int * b, mp_int * c) -{ - int olduse, res, min, max; - - /* find sizes */ - min = b->used; - max = a->used; - - /* init result */ - if (c->alloc < max) { - if ((res = mp_grow (c, max)) != MP_OKAY) { - return res; - } - } - olduse = c->used; - c->used = max; - - { - register mp_digit u, *tmpa, *tmpb, *tmpc; - register int i; - - /* alias for digit pointers */ - tmpa = a->dp; - tmpb = b->dp; - tmpc = c->dp; - - /* set carry to zero */ - u = 0; - for (i = 0; i < min; i++) { - /* T[i] = A[i] - B[i] - U */ - *tmpc = *tmpa++ - *tmpb++ - u; - - /* U = carry bit of T[i] - * Note this saves performing an AND operation since - * if a carry does occur it will propagate all the way to the - * MSB. As a result a single shift is enough to get the carry - */ - u = *tmpc >> ((mp_digit)(CHAR_BIT * sizeof (mp_digit) - 1)); - - /* Clear carry from T[i] */ - *tmpc++ &= MP_MASK; - } - - /* now copy higher words if any, e.g. if A has more digits than B */ - for (; i < max; i++) { - /* T[i] = A[i] - U */ - *tmpc = *tmpa++ - u; - - /* U = carry bit of T[i] */ - u = *tmpc >> ((mp_digit)(CHAR_BIT * sizeof (mp_digit) - 1)); - - /* Clear carry from T[i] */ - *tmpc++ &= MP_MASK; - } - - /* clear digits above used (since we may not have grown result above) */ - for (i = c->used; i < olduse; i++) { - *tmpc++ = 0; - } - } - - mp_clamp (c); - return MP_OKAY; -} - - -/* init a new mp_int */ -static int -mp_init (mp_int * a) -{ - int i; - - /* allocate memory required and clear it */ - a->dp = OPT_CAST(mp_digit) XMALLOC (sizeof (mp_digit) * MP_PREC); - if (a->dp == NULL) { - return MP_MEM; - } - - /* set the digits to zero */ - for (i = 0; i < MP_PREC; i++) { - a->dp[i] = 0; - } - - /* set the used to zero, allocated digits to the default precision - * and sign to positive */ - a->used = 0; - a->alloc = MP_PREC; - a->sign = MP_ZPOS; - - return MP_OKAY; -} - - -/* clear one (frees) */ -static void -mp_clear (mp_int * a) -{ - int i; - - /* only do anything if a hasn't been freed previously */ - if (a->dp != NULL) { - /* first zero the digits */ - for (i = 0; i < a->used; i++) { - a->dp[i] = 0; - } - - /* free ram */ - XFREE(a->dp); - - /* reset members to make debugging easier */ - a->dp = NULL; - a->alloc = a->used = 0; - a->sign = MP_ZPOS; - } -} - - -/* high level addition (handles signs) */ -static int -mp_add (mp_int * a, mp_int * b, mp_int * c) -{ - int sa, sb, res; - - /* get sign of both inputs */ - sa = a->sign; - sb = b->sign; - - /* handle two cases, not four */ - if (sa == sb) { - /* both positive or both negative */ - /* add their magnitudes, copy the sign */ - c->sign = sa; - res = s_mp_add (a, b, c); - } else { - /* one positive, the other negative */ - /* subtract the one with the greater magnitude from */ - /* the one of the lesser magnitude. The result gets */ - /* the sign of the one with the greater magnitude. */ - if (mp_cmp_mag (a, b) == MP_LT) { - c->sign = sb; - res = s_mp_sub (b, a, c); - } else { - c->sign = sa; - res = s_mp_sub (a, b, c); - } - } - return res; -} - - -/* high level subtraction (handles signs) */ -static int -mp_sub (mp_int * a, mp_int * b, mp_int * c) -{ - int sa, sb, res; - - sa = a->sign; - sb = b->sign; - - if (sa != sb) { - /* subtract a negative from a positive, OR */ - /* subtract a positive from a negative. */ - /* In either case, ADD their magnitudes, */ - /* and use the sign of the first number. */ - c->sign = sa; - res = s_mp_add (a, b, c); - } else { - /* subtract a positive from a positive, OR */ - /* subtract a negative from a negative. */ - /* First, take the difference between their */ - /* magnitudes, then... */ - if (mp_cmp_mag (a, b) != MP_LT) { - /* Copy the sign from the first */ - c->sign = sa; - /* The first has a larger or equal magnitude */ - res = s_mp_sub (a, b, c); - } else { - /* The result has the *opposite* sign from */ - /* the first number. */ - c->sign = (sa == MP_ZPOS) ? MP_NEG : MP_ZPOS; - /* The second has a larger magnitude */ - res = s_mp_sub (b, a, c); - } - } - return res; -} - - -/* high level multiplication (handles sign) */ -static int -mp_mul (mp_int * a, mp_int * b, mp_int * c) -{ - int res, neg; - neg = (a->sign == b->sign) ? MP_ZPOS : MP_NEG; - - /* use Toom-Cook? */ -#ifdef BN_MP_TOOM_MUL_C - if (MIN (a->used, b->used) >= TOOM_MUL_CUTOFF) { - res = mp_toom_mul(a, b, c); - } else -#endif -#ifdef BN_MP_KARATSUBA_MUL_C - /* use Karatsuba? */ - if (MIN (a->used, b->used) >= KARATSUBA_MUL_CUTOFF) { - res = mp_karatsuba_mul (a, b, c); - } else -#endif - { - /* can we use the fast multiplier? - * - * The fast multiplier can be used if the output will - * have less than MP_WARRAY digits and the number of - * digits won't affect carry propagation - */ -#ifdef BN_FAST_S_MP_MUL_DIGS_C - int digs = a->used + b->used + 1; - - if ((digs < MP_WARRAY) && - MIN(a->used, b->used) <= - (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) { - res = fast_s_mp_mul_digs (a, b, c, digs); - } else -#endif -#ifdef BN_S_MP_MUL_DIGS_C - res = s_mp_mul (a, b, c); /* uses s_mp_mul_digs */ -#else -#error mp_mul could fail - res = MP_VAL; -#endif - - } - c->sign = (c->used > 0) ? neg : MP_ZPOS; - return res; -} - - -/* d = a * b (mod c) */ -static int -mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) -{ - int res; - mp_int t; - - if ((res = mp_init (&t)) != MP_OKAY) { - return res; - } - - if ((res = mp_mul (a, b, &t)) != MP_OKAY) { - mp_clear (&t); - return res; - } - res = mp_mod (&t, c, d); - mp_clear (&t); - return res; -} - - -/* c = a mod b, 0 <= c < b */ -static int -mp_mod (mp_int * a, mp_int * b, mp_int * c) -{ - mp_int t; - int res; - - if ((res = mp_init (&t)) != MP_OKAY) { - return res; - } - - if ((res = mp_div (a, b, NULL, &t)) != MP_OKAY) { - mp_clear (&t); - return res; - } - - if (t.sign != b->sign) { - res = mp_add (b, &t, c); - } else { - res = MP_OKAY; - mp_exch (&t, c); - } - - mp_clear (&t); - return res; -} - - -/* this is a shell function that calls either the normal or Montgomery - * exptmod functions. Originally the call to the montgomery code was - * embedded in the normal function but that wasted a lot of stack space - * for nothing (since 99% of the time the Montgomery code would be called) - */ -static int -mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y) -{ -#if defined(BN_MP_DR_IS_MODULUS_C)||defined(BN_MP_REDUCE_IS_2K_C)||defined(BN_MP_EXPTMOD_FAST_C) - int dr = 0; -#endif - - /* modulus P must be positive */ - if (P->sign == MP_NEG) { - return MP_VAL; - } - - /* if exponent X is negative we have to recurse */ - if (X->sign == MP_NEG) { -#ifdef LTM_NO_NEG_EXP - return MP_VAL; -#else /* LTM_NO_NEG_EXP */ -#ifdef BN_MP_INVMOD_C - mp_int tmpG, tmpX; - int err; - - /* first compute 1/G mod P */ - if ((err = mp_init(&tmpG)) != MP_OKAY) { - return err; - } - if ((err = mp_invmod(G, P, &tmpG)) != MP_OKAY) { - mp_clear(&tmpG); - return err; - } - - /* now get |X| */ - if ((err = mp_init(&tmpX)) != MP_OKAY) { - mp_clear(&tmpG); - return err; - } - if ((err = mp_abs(X, &tmpX)) != MP_OKAY) { - mp_clear_multi(&tmpG, &tmpX, NULL); - return err; - } - - /* and now compute (1/G)**|X| instead of G**X [X < 0] */ - err = mp_exptmod(&tmpG, &tmpX, P, Y); - mp_clear_multi(&tmpG, &tmpX, NULL); - return err; -#else -#error mp_exptmod would always fail - /* no invmod */ - return MP_VAL; -#endif -#endif /* LTM_NO_NEG_EXP */ - } - -/* modified diminished radix reduction */ -#if defined(BN_MP_REDUCE_IS_2K_L_C) && defined(BN_MP_REDUCE_2K_L_C) && defined(BN_S_MP_EXPTMOD_C) - if (mp_reduce_is_2k_l(P) == MP_YES) { - return s_mp_exptmod(G, X, P, Y, 1); - } -#endif - -#ifdef BN_MP_DR_IS_MODULUS_C - /* is it a DR modulus? */ - dr = mp_dr_is_modulus(P); -#endif - -#ifdef BN_MP_REDUCE_IS_2K_C - /* if not, is it a unrestricted DR modulus? */ - if (dr == 0) { - dr = mp_reduce_is_2k(P) << 1; - } -#endif - - /* if the modulus is odd or dr != 0 use the montgomery method */ -#ifdef BN_MP_EXPTMOD_FAST_C - if (mp_isodd (P) == 1 || dr != 0) { - return mp_exptmod_fast (G, X, P, Y, dr); - } else { -#endif -#ifdef BN_S_MP_EXPTMOD_C - /* otherwise use the generic Barrett reduction technique */ - return s_mp_exptmod (G, X, P, Y, 0); -#else -#error mp_exptmod could fail - /* no exptmod for evens */ - return MP_VAL; -#endif -#ifdef BN_MP_EXPTMOD_FAST_C - } -#endif -} - - -/* compare two ints (signed)*/ -static int -mp_cmp (mp_int * a, mp_int * b) -{ - /* compare based on sign */ - if (a->sign != b->sign) { - if (a->sign == MP_NEG) { - return MP_LT; - } else { - return MP_GT; - } - } - - /* compare digits */ - if (a->sign == MP_NEG) { - /* if negative compare opposite direction */ - return mp_cmp_mag(b, a); - } else { - return mp_cmp_mag(a, b); - } -} - - -/* compare a digit */ -static int -mp_cmp_d(mp_int * a, mp_digit b) -{ - /* compare based on sign */ - if (a->sign == MP_NEG) { - return MP_LT; - } - - /* compare based on magnitude */ - if (a->used > 1) { - return MP_GT; - } - - /* compare the only digit of a to b */ - if (a->dp[0] > b) { - return MP_GT; - } else if (a->dp[0] < b) { - return MP_LT; - } else { - return MP_EQ; - } -} - - -#ifndef LTM_NO_NEG_EXP -/* hac 14.61, pp608 */ -static int -mp_invmod (mp_int * a, mp_int * b, mp_int * c) -{ - /* b cannot be negative */ - if (b->sign == MP_NEG || mp_iszero(b) == 1) { - return MP_VAL; - } - -#ifdef BN_FAST_MP_INVMOD_C - /* if the modulus is odd we can use a faster routine instead */ - if (mp_isodd (b) == 1) { - return fast_mp_invmod (a, b, c); - } -#endif - -#ifdef BN_MP_INVMOD_SLOW_C - return mp_invmod_slow(a, b, c); -#endif - -#ifndef BN_FAST_MP_INVMOD_C -#ifndef BN_MP_INVMOD_SLOW_C -#error mp_invmod would always fail -#endif -#endif - return MP_VAL; -} -#endif /* LTM_NO_NEG_EXP */ - - -/* get the size for an unsigned equivalent */ -static int -mp_unsigned_bin_size (mp_int * a) -{ - int size = mp_count_bits (a); - return (size / 8 + ((size & 7) != 0 ? 1 : 0)); -} - - -#ifndef LTM_NO_NEG_EXP -/* hac 14.61, pp608 */ -static int -mp_invmod_slow (mp_int * a, mp_int * b, mp_int * c) -{ - mp_int x, y, u, v, A, B, C, D; - int res; - - /* b cannot be negative */ - if (b->sign == MP_NEG || mp_iszero(b) == 1) { - return MP_VAL; - } - - /* init temps */ - if ((res = mp_init_multi(&x, &y, &u, &v, - &A, &B, &C, &D, NULL)) != MP_OKAY) { - return res; - } - - /* x = a, y = b */ - if ((res = mp_mod(a, b, &x)) != MP_OKAY) { - goto LBL_ERR; - } - if ((res = mp_copy (b, &y)) != MP_OKAY) { - goto LBL_ERR; - } - - /* 2. [modified] if x,y are both even then return an error! */ - if (mp_iseven (&x) == 1 && mp_iseven (&y) == 1) { - res = MP_VAL; - goto LBL_ERR; - } - - /* 3. u=x, v=y, A=1, B=0, C=0,D=1 */ - if ((res = mp_copy (&x, &u)) != MP_OKAY) { - goto LBL_ERR; - } - if ((res = mp_copy (&y, &v)) != MP_OKAY) { - goto LBL_ERR; - } - mp_set (&A, 1); - mp_set (&D, 1); - -top: - /* 4. while u is even do */ - while (mp_iseven (&u) == 1) { - /* 4.1 u = u/2 */ - if ((res = mp_div_2 (&u, &u)) != MP_OKAY) { - goto LBL_ERR; - } - /* 4.2 if A or B is odd then */ - if (mp_isodd (&A) == 1 || mp_isodd (&B) == 1) { - /* A = (A+y)/2, B = (B-x)/2 */ - if ((res = mp_add (&A, &y, &A)) != MP_OKAY) { - goto LBL_ERR; - } - if ((res = mp_sub (&B, &x, &B)) != MP_OKAY) { - goto LBL_ERR; - } - } - /* A = A/2, B = B/2 */ - if ((res = mp_div_2 (&A, &A)) != MP_OKAY) { - goto LBL_ERR; - } - if ((res = mp_div_2 (&B, &B)) != MP_OKAY) { - goto LBL_ERR; - } - } - - /* 5. while v is even do */ - while (mp_iseven (&v) == 1) { - /* 5.1 v = v/2 */ - if ((res = mp_div_2 (&v, &v)) != MP_OKAY) { - goto LBL_ERR; - } - /* 5.2 if C or D is odd then */ - if (mp_isodd (&C) == 1 || mp_isodd (&D) == 1) { - /* C = (C+y)/2, D = (D-x)/2 */ - if ((res = mp_add (&C, &y, &C)) != MP_OKAY) { - goto LBL_ERR; - } - if ((res = mp_sub (&D, &x, &D)) != MP_OKAY) { - goto LBL_ERR; - } - } - /* C = C/2, D = D/2 */ - if ((res = mp_div_2 (&C, &C)) != MP_OKAY) { - goto LBL_ERR; - } - if ((res = mp_div_2 (&D, &D)) != MP_OKAY) { - goto LBL_ERR; - } - } - - /* 6. if u >= v then */ - if (mp_cmp (&u, &v) != MP_LT) { - /* u = u - v, A = A - C, B = B - D */ - if ((res = mp_sub (&u, &v, &u)) != MP_OKAY) { - goto LBL_ERR; - } - - if ((res = mp_sub (&A, &C, &A)) != MP_OKAY) { - goto LBL_ERR; - } - - if ((res = mp_sub (&B, &D, &B)) != MP_OKAY) { - goto LBL_ERR; - } - } else { - /* v - v - u, C = C - A, D = D - B */ - if ((res = mp_sub (&v, &u, &v)) != MP_OKAY) { - goto LBL_ERR; - } - - if ((res = mp_sub (&C, &A, &C)) != MP_OKAY) { - goto LBL_ERR; - } - - if ((res = mp_sub (&D, &B, &D)) != MP_OKAY) { - goto LBL_ERR; - } - } - - /* if not zero goto step 4 */ - if (mp_iszero (&u) == 0) - goto top; - - /* now a = C, b = D, gcd == g*v */ - - /* if v != 1 then there is no inverse */ - if (mp_cmp_d (&v, 1) != MP_EQ) { - res = MP_VAL; - goto LBL_ERR; - } - - /* if its too low */ - while (mp_cmp_d(&C, 0) == MP_LT) { - if ((res = mp_add(&C, b, &C)) != MP_OKAY) { - goto LBL_ERR; - } - } - - /* too big */ - while (mp_cmp_mag(&C, b) != MP_LT) { - if ((res = mp_sub(&C, b, &C)) != MP_OKAY) { - goto LBL_ERR; - } - } - - /* C is now the inverse */ - mp_exch (&C, c); - res = MP_OKAY; -LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &A, &B, &C, &D, NULL); - return res; -} -#endif /* LTM_NO_NEG_EXP */ - - -/* compare maginitude of two ints (unsigned) */ -static int -mp_cmp_mag (mp_int * a, mp_int * b) -{ - int n; - mp_digit *tmpa, *tmpb; - - /* compare based on # of non-zero digits */ - if (a->used > b->used) { - return MP_GT; - } - - if (a->used < b->used) { - return MP_LT; - } - - /* alias for a */ - tmpa = a->dp + (a->used - 1); - - /* alias for b */ - tmpb = b->dp + (a->used - 1); - - /* compare based on digits */ - for (n = 0; n < a->used; ++n, --tmpa, --tmpb) { - if (*tmpa > *tmpb) { - return MP_GT; - } - - if (*tmpa < *tmpb) { - return MP_LT; - } - } - return MP_EQ; -} - - -/* reads a unsigned char array, assumes the msb is stored first [big endian] */ -static int -mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c) -{ - int res; - - /* make sure there are at least two digits */ - if (a->alloc < 2) { - if ((res = mp_grow(a, 2)) != MP_OKAY) { - return res; - } - } - - /* zero the int */ - mp_zero (a); - - /* read the bytes in */ - while (c-- > 0) { - if ((res = mp_mul_2d (a, 8, a)) != MP_OKAY) { - return res; - } - -#ifndef MP_8BIT - a->dp[0] |= *b++; - a->used += 1; -#else - a->dp[0] = (*b & MP_MASK); - a->dp[1] |= ((*b++ >> 7U) & 1); - a->used += 2; -#endif - } - mp_clamp (a); - return MP_OKAY; -} - - -/* store in unsigned [big endian] format */ -static int -mp_to_unsigned_bin (mp_int * a, unsigned char *b) -{ - int x, res; - mp_int t; - - if ((res = mp_init_copy (&t, a)) != MP_OKAY) { - return res; - } - - x = 0; - while (mp_iszero (&t) == 0) { -#ifndef MP_8BIT - b[x++] = (unsigned char) (t.dp[0] & 255); -#else - b[x++] = (unsigned char) (t.dp[0] | ((t.dp[1] & 0x01) << 7)); -#endif - if ((res = mp_div_2d (&t, 8, &t, NULL)) != MP_OKAY) { - mp_clear (&t); - return res; - } - } - bn_reverse (b, x); - mp_clear (&t); - return MP_OKAY; -} - - -/* shift right by a certain bit count (store quotient in c, optional remainder in d) */ -static int -mp_div_2d (mp_int * a, int b, mp_int * c, mp_int * d) -{ - mp_digit D, r, rr; - int x, res; - mp_int t; - - - /* if the shift count is <= 0 then we do no work */ - if (b <= 0) { - res = mp_copy (a, c); - if (d != NULL) { - mp_zero (d); - } - return res; - } - - if ((res = mp_init (&t)) != MP_OKAY) { - return res; - } - - /* get the remainder */ - if (d != NULL) { - if ((res = mp_mod_2d (a, b, &t)) != MP_OKAY) { - mp_clear (&t); - return res; - } - } - - /* copy */ - if ((res = mp_copy (a, c)) != MP_OKAY) { - mp_clear (&t); - return res; - } - - /* shift by as many digits in the bit count */ - if (b >= (int)DIGIT_BIT) { - mp_rshd (c, b / DIGIT_BIT); - } - - /* shift any bit count < DIGIT_BIT */ - D = (mp_digit) (b % DIGIT_BIT); - if (D != 0) { - register mp_digit *tmpc, mask, shift; - - /* mask */ - mask = (((mp_digit)1) << D) - 1; - - /* shift for lsb */ - shift = DIGIT_BIT - D; - - /* alias */ - tmpc = c->dp + (c->used - 1); - - /* carry */ - r = 0; - for (x = c->used - 1; x >= 0; x--) { - /* get the lower bits of this word in a temp */ - rr = *tmpc & mask; - - /* shift the current word and mix in the carry bits from the previous word */ - *tmpc = (*tmpc >> D) | (r << shift); - --tmpc; - - /* set the carry to the carry bits of the current word found above */ - r = rr; - } - } - mp_clamp (c); - if (d != NULL) { - mp_exch (&t, d); - } - mp_clear (&t); - return MP_OKAY; -} - - -static int -mp_init_copy (mp_int * a, mp_int * b) -{ - int res; - - if ((res = mp_init (a)) != MP_OKAY) { - return res; - } - return mp_copy (b, a); -} - - -/* set to zero */ -static void -mp_zero (mp_int * a) -{ - int n; - mp_digit *tmp; - - a->sign = MP_ZPOS; - a->used = 0; - - tmp = a->dp; - for (n = 0; n < a->alloc; n++) { - *tmp++ = 0; - } -} - - -/* copy, b = a */ -static int -mp_copy (mp_int * a, mp_int * b) -{ - int res, n; - - /* if dst == src do nothing */ - if (a == b) { - return MP_OKAY; - } - - /* grow dest */ - if (b->alloc < a->used) { - if ((res = mp_grow (b, a->used)) != MP_OKAY) { - return res; - } - } - - /* zero b and copy the parameters over */ - { - register mp_digit *tmpa, *tmpb; - - /* pointer aliases */ - - /* source */ - tmpa = a->dp; - - /* destination */ - tmpb = b->dp; - - /* copy all the digits */ - for (n = 0; n < a->used; n++) { - *tmpb++ = *tmpa++; - } - - /* clear high digits */ - for (; n < b->used; n++) { - *tmpb++ = 0; - } - } - - /* copy used count and sign */ - b->used = a->used; - b->sign = a->sign; - return MP_OKAY; -} - - -/* shift right a certain amount of digits */ -static void -mp_rshd (mp_int * a, int b) -{ - int x; - - /* if b <= 0 then ignore it */ - if (b <= 0) { - return; - } - - /* if b > used then simply zero it and return */ - if (a->used <= b) { - mp_zero (a); - return; - } - - { - register mp_digit *bottom, *top; - - /* shift the digits down */ - - /* bottom */ - bottom = a->dp; - - /* top [offset into digits] */ - top = a->dp + b; - - /* this is implemented as a sliding window where - * the window is b-digits long and digits from - * the top of the window are copied to the bottom - * - * e.g. - - b-2 | b-1 | b0 | b1 | b2 | ... | bb | ----> - /\ | ----> - \-------------------/ ----> - */ - for (x = 0; x < (a->used - b); x++) { - *bottom++ = *top++; - } - - /* zero the top digits */ - for (; x < a->used; x++) { - *bottom++ = 0; - } - } - - /* remove excess digits */ - a->used -= b; -} - - -/* swap the elements of two integers, for cases where you can't simply swap the - * mp_int pointers around - */ -static void -mp_exch (mp_int * a, mp_int * b) -{ - mp_int t; - - t = *a; - *a = *b; - *b = t; -} - - -/* trim unused digits - * - * This is used to ensure that leading zero digits are - * trimed and the leading "used" digit will be non-zero - * Typically very fast. Also fixes the sign if there - * are no more leading digits - */ -static void -mp_clamp (mp_int * a) -{ - /* decrease used while the most significant digit is - * zero. - */ - while (a->used > 0 && a->dp[a->used - 1] == 0) { - --(a->used); - } - - /* reset the sign flag if used == 0 */ - if (a->used == 0) { - a->sign = MP_ZPOS; - } -} - - -/* grow as required */ -static int -mp_grow (mp_int * a, int size) -{ - int i; - mp_digit *tmp; - - /* if the alloc size is smaller alloc more ram */ - if (a->alloc < size) { - /* ensure there are always at least MP_PREC digits extra on top */ - size += (MP_PREC * 2) - (size % MP_PREC); - - /* reallocate the array a->dp - * - * We store the return in a temporary variable - * in case the operation failed we don't want - * to overwrite the dp member of a. - */ - tmp = OPT_CAST(mp_digit) XREALLOC (a->dp, sizeof (mp_digit) * size); - if (tmp == NULL) { - /* reallocation failed but "a" is still valid [can be freed] */ - return MP_MEM; - } - - /* reallocation succeeded so set a->dp */ - a->dp = tmp; - - /* zero excess digits */ - i = a->alloc; - a->alloc = size; - for (; i < a->alloc; i++) { - a->dp[i] = 0; - } - } - return MP_OKAY; -} - - -#ifdef BN_MP_ABS_C -/* b = |a| - * - * Simple function copies the input and fixes the sign to positive - */ -static int -mp_abs (mp_int * a, mp_int * b) -{ - int res; - - /* copy a to b */ - if (a != b) { - if ((res = mp_copy (a, b)) != MP_OKAY) { - return res; - } - } - - /* force the sign of b to positive */ - b->sign = MP_ZPOS; - - return MP_OKAY; -} -#endif - - -/* set to a digit */ -static void -mp_set (mp_int * a, mp_digit b) -{ - mp_zero (a); - a->dp[0] = b & MP_MASK; - a->used = (a->dp[0] != 0) ? 1 : 0; -} - - -#ifndef LTM_NO_NEG_EXP -/* b = a/2 */ -static int -mp_div_2(mp_int * a, mp_int * b) -{ - int x, res, oldused; - - /* copy */ - if (b->alloc < a->used) { - if ((res = mp_grow (b, a->used)) != MP_OKAY) { - return res; - } - } - - oldused = b->used; - b->used = a->used; - { - register mp_digit r, rr, *tmpa, *tmpb; - - /* source alias */ - tmpa = a->dp + b->used - 1; - - /* dest alias */ - tmpb = b->dp + b->used - 1; - - /* carry */ - r = 0; - for (x = b->used - 1; x >= 0; x--) { - /* get the carry for the next iteration */ - rr = *tmpa & 1; - - /* shift the current digit, add in carry and store */ - *tmpb-- = (*tmpa-- >> 1) | (r << (DIGIT_BIT - 1)); - - /* forward carry to next iteration */ - r = rr; - } - - /* zero excess digits */ - tmpb = b->dp + b->used; - for (x = b->used; x < oldused; x++) { - *tmpb++ = 0; - } - } - b->sign = a->sign; - mp_clamp (b); - return MP_OKAY; -} -#endif /* LTM_NO_NEG_EXP */ - - -/* shift left by a certain bit count */ -static int -mp_mul_2d (mp_int * a, int b, mp_int * c) -{ - mp_digit d; - int res; - - /* copy */ - if (a != c) { - if ((res = mp_copy (a, c)) != MP_OKAY) { - return res; - } - } - - if (c->alloc < (int)(c->used + b/DIGIT_BIT + 1)) { - if ((res = mp_grow (c, c->used + b / DIGIT_BIT + 1)) != MP_OKAY) { - return res; - } - } - - /* shift by as many digits in the bit count */ - if (b >= (int)DIGIT_BIT) { - if ((res = mp_lshd (c, b / DIGIT_BIT)) != MP_OKAY) { - return res; - } - } - - /* shift any bit count < DIGIT_BIT */ - d = (mp_digit) (b % DIGIT_BIT); - if (d != 0) { - register mp_digit *tmpc, shift, mask, r, rr; - register int x; - - /* bitmask for carries */ - mask = (((mp_digit)1) << d) - 1; - - /* shift for msbs */ - shift = DIGIT_BIT - d; - - /* alias */ - tmpc = c->dp; - - /* carry */ - r = 0; - for (x = 0; x < c->used; x++) { - /* get the higher bits of the current word */ - rr = (*tmpc >> shift) & mask; - - /* shift the current word and OR in the carry */ - *tmpc = ((*tmpc << d) | r) & MP_MASK; - ++tmpc; - - /* set the carry to the carry bits of the current word */ - r = rr; - } - - /* set final carry */ - if (r != 0) { - c->dp[(c->used)++] = r; - } - } - mp_clamp (c); - return MP_OKAY; -} - - -#ifdef BN_MP_INIT_MULTI_C -static int -mp_init_multi(mp_int *mp, ...) -{ - mp_err res = MP_OKAY; /* Assume ok until proven otherwise */ - int n = 0; /* Number of ok inits */ - mp_int* cur_arg = mp; - va_list args; - - va_start(args, mp); /* init args to next argument from caller */ - while (cur_arg != NULL) { - if (mp_init(cur_arg) != MP_OKAY) { - /* Oops - error! Back-track and mp_clear what we already - succeeded in init-ing, then return error. - */ - va_list clean_args; - - /* end the current list */ - va_end(args); - - /* now start cleaning up */ - cur_arg = mp; - va_start(clean_args, mp); - while (n--) { - mp_clear(cur_arg); - cur_arg = va_arg(clean_args, mp_int*); - } - va_end(clean_args); - res = MP_MEM; - break; - } - n++; - cur_arg = va_arg(args, mp_int*); - } - va_end(args); - return res; /* Assumed ok, if error flagged above. */ -} -#endif - - -#ifdef BN_MP_CLEAR_MULTI_C -static void -mp_clear_multi(mp_int *mp, ...) -{ - mp_int* next_mp = mp; - va_list args; - va_start(args, mp); - while (next_mp != NULL) { - mp_clear(next_mp); - next_mp = va_arg(args, mp_int*); - } - va_end(args); -} -#endif - - -/* shift left a certain amount of digits */ -static int -mp_lshd (mp_int * a, int b) -{ - int x, res; - - /* if its less than zero return */ - if (b <= 0) { - return MP_OKAY; - } - - /* grow to fit the new digits */ - if (a->alloc < a->used + b) { - if ((res = mp_grow (a, a->used + b)) != MP_OKAY) { - return res; - } - } - - { - register mp_digit *top, *bottom; - - /* increment the used by the shift amount then copy upwards */ - a->used += b; - - /* top */ - top = a->dp + a->used - 1; - - /* base */ - bottom = a->dp + a->used - 1 - b; - - /* much like mp_rshd this is implemented using a sliding window - * except the window goes the otherway around. Copying from - * the bottom to the top. see bn_mp_rshd.c for more info. - */ - for (x = a->used - 1; x >= b; x--) { - *top-- = *bottom--; - } - - /* zero the lower digits */ - top = a->dp; - for (x = 0; x < b; x++) { - *top++ = 0; - } - } - return MP_OKAY; -} - - -/* returns the number of bits in an int */ -static int -mp_count_bits (mp_int * a) -{ - int r; - mp_digit q; - - /* shortcut */ - if (a->used == 0) { - return 0; - } - - /* get number of digits and add that */ - r = (a->used - 1) * DIGIT_BIT; - - /* take the last digit and count the bits in it */ - q = a->dp[a->used - 1]; - while (q > ((mp_digit) 0)) { - ++r; - q >>= ((mp_digit) 1); - } - return r; -} - - -/* calc a value mod 2**b */ -static int -mp_mod_2d (mp_int * a, int b, mp_int * c) -{ - int x, res; - - /* if b is <= 0 then zero the int */ - if (b <= 0) { - mp_zero (c); - return MP_OKAY; - } - - /* if the modulus is larger than the value than return */ - if (b >= (int) (a->used * DIGIT_BIT)) { - res = mp_copy (a, c); - return res; - } - - /* copy */ - if ((res = mp_copy (a, c)) != MP_OKAY) { - return res; - } - - /* zero digits above the last digit of the modulus */ - for (x = (b / DIGIT_BIT) + ((b % DIGIT_BIT) == 0 ? 0 : 1); x < c->used; x++) { - c->dp[x] = 0; - } - /* clear the digit that is not completely outside/inside the modulus */ - c->dp[b / DIGIT_BIT] &= - (mp_digit) ((((mp_digit) 1) << (((mp_digit) b) % DIGIT_BIT)) - ((mp_digit) 1)); - mp_clamp (c); - return MP_OKAY; -} - - -#ifdef BN_MP_DIV_SMALL - -/* slower bit-bang division... also smaller */ -static int -mp_div(mp_int * a, mp_int * b, mp_int * c, mp_int * d) -{ - mp_int ta, tb, tq, q; - int res, n, n2; - - /* is divisor zero ? */ - if (mp_iszero (b) == 1) { - return MP_VAL; - } - - /* if a < b then q=0, r = a */ - if (mp_cmp_mag (a, b) == MP_LT) { - if (d != NULL) { - res = mp_copy (a, d); - } else { - res = MP_OKAY; - } - if (c != NULL) { - mp_zero (c); - } - return res; - } - - /* init our temps */ - if ((res = mp_init_multi(&ta, &tb, &tq, &q, NULL) != MP_OKAY)) { - return res; - } - - - mp_set(&tq, 1); - n = mp_count_bits(a) - mp_count_bits(b); - if (((res = mp_abs(a, &ta)) != MP_OKAY) || - ((res = mp_abs(b, &tb)) != MP_OKAY) || - ((res = mp_mul_2d(&tb, n, &tb)) != MP_OKAY) || - ((res = mp_mul_2d(&tq, n, &tq)) != MP_OKAY)) { - goto LBL_ERR; - } - - while (n-- >= 0) { - if (mp_cmp(&tb, &ta) != MP_GT) { - if (((res = mp_sub(&ta, &tb, &ta)) != MP_OKAY) || - ((res = mp_add(&q, &tq, &q)) != MP_OKAY)) { - goto LBL_ERR; - } - } - if (((res = mp_div_2d(&tb, 1, &tb, NULL)) != MP_OKAY) || - ((res = mp_div_2d(&tq, 1, &tq, NULL)) != MP_OKAY)) { - goto LBL_ERR; - } - } - - /* now q == quotient and ta == remainder */ - n = a->sign; - n2 = (a->sign == b->sign ? MP_ZPOS : MP_NEG); - if (c != NULL) { - mp_exch(c, &q); - c->sign = (mp_iszero(c) == MP_YES) ? MP_ZPOS : n2; - } - if (d != NULL) { - mp_exch(d, &ta); - d->sign = (mp_iszero(d) == MP_YES) ? MP_ZPOS : n; - } -LBL_ERR: - mp_clear_multi(&ta, &tb, &tq, &q, NULL); - return res; -} - -#else - -/* integer signed division. - * c*b + d == a [e.g. a/b, c=quotient, d=remainder] - * HAC pp.598 Algorithm 14.20 - * - * Note that the description in HAC is horribly - * incomplete. For example, it doesn't consider - * the case where digits are removed from 'x' in - * the inner loop. It also doesn't consider the - * case that y has fewer than three digits, etc.. - * - * The overall algorithm is as described as - * 14.20 from HAC but fixed to treat these cases. -*/ -static int -mp_div (mp_int * a, mp_int * b, mp_int * c, mp_int * d) -{ - mp_int q, x, y, t1, t2; - int res, n, t, i, norm, neg; - - /* is divisor zero ? */ - if (mp_iszero (b) == 1) { - return MP_VAL; - } - - /* if a < b then q=0, r = a */ - if (mp_cmp_mag (a, b) == MP_LT) { - if (d != NULL) { - res = mp_copy (a, d); - } else { - res = MP_OKAY; - } - if (c != NULL) { - mp_zero (c); - } - return res; - } - - if ((res = mp_init_size (&q, a->used + 2)) != MP_OKAY) { - return res; - } - q.used = a->used + 2; - - if ((res = mp_init (&t1)) != MP_OKAY) { - goto LBL_Q; - } - - if ((res = mp_init (&t2)) != MP_OKAY) { - goto LBL_T1; - } - - if ((res = mp_init_copy (&x, a)) != MP_OKAY) { - goto LBL_T2; - } - - if ((res = mp_init_copy (&y, b)) != MP_OKAY) { - goto LBL_X; - } - - /* fix the sign */ - neg = (a->sign == b->sign) ? MP_ZPOS : MP_NEG; - x.sign = y.sign = MP_ZPOS; - - /* normalize both x and y, ensure that y >= b/2, [b == 2**DIGIT_BIT] */ - norm = mp_count_bits(&y) % DIGIT_BIT; - if (norm < (int)(DIGIT_BIT-1)) { - norm = (DIGIT_BIT-1) - norm; - if ((res = mp_mul_2d (&x, norm, &x)) != MP_OKAY) { - goto LBL_Y; - } - if ((res = mp_mul_2d (&y, norm, &y)) != MP_OKAY) { - goto LBL_Y; - } - } else { - norm = 0; - } - - /* note hac does 0 based, so if used==5 then its 0,1,2,3,4, e.g. use 4 */ - n = x.used - 1; - t = y.used - 1; - - /* while (x >= y*b**n-t) do { q[n-t] += 1; x -= y*b**{n-t} } */ - if ((res = mp_lshd (&y, n - t)) != MP_OKAY) { /* y = y*b**{n-t} */ - goto LBL_Y; - } - - while (mp_cmp (&x, &y) != MP_LT) { - ++(q.dp[n - t]); - if ((res = mp_sub (&x, &y, &x)) != MP_OKAY) { - goto LBL_Y; - } - } - - /* reset y by shifting it back down */ - mp_rshd (&y, n - t); - - /* step 3. for i from n down to (t + 1) */ - for (i = n; i >= (t + 1); i--) { - if (i > x.used) { - continue; - } - - /* step 3.1 if xi == yt then set q{i-t-1} to b-1, - * otherwise set q{i-t-1} to (xi*b + x{i-1})/yt */ - if (x.dp[i] == y.dp[t]) { - q.dp[i - t - 1] = ((((mp_digit)1) << DIGIT_BIT) - 1); - } else { - mp_word tmp; - tmp = ((mp_word) x.dp[i]) << ((mp_word) DIGIT_BIT); - tmp |= ((mp_word) x.dp[i - 1]); - tmp /= ((mp_word) y.dp[t]); - if (tmp > (mp_word) MP_MASK) - tmp = MP_MASK; - q.dp[i - t - 1] = (mp_digit) (tmp & (mp_word) (MP_MASK)); - } - - /* while (q{i-t-1} * (yt * b + y{t-1})) > - xi * b**2 + xi-1 * b + xi-2 - - do q{i-t-1} -= 1; - */ - q.dp[i - t - 1] = (q.dp[i - t - 1] + 1) & MP_MASK; - do { - q.dp[i - t - 1] = (q.dp[i - t - 1] - 1) & MP_MASK; - - /* find left hand */ - mp_zero (&t1); - t1.dp[0] = (t - 1 < 0) ? 0 : y.dp[t - 1]; - t1.dp[1] = y.dp[t]; - t1.used = 2; - if ((res = mp_mul_d (&t1, q.dp[i - t - 1], &t1)) != MP_OKAY) { - goto LBL_Y; - } - - /* find right hand */ - t2.dp[0] = (i - 2 < 0) ? 0 : x.dp[i - 2]; - t2.dp[1] = (i - 1 < 0) ? 0 : x.dp[i - 1]; - t2.dp[2] = x.dp[i]; - t2.used = 3; - } while (mp_cmp_mag(&t1, &t2) == MP_GT); - - /* step 3.3 x = x - q{i-t-1} * y * b**{i-t-1} */ - if ((res = mp_mul_d (&y, q.dp[i - t - 1], &t1)) != MP_OKAY) { - goto LBL_Y; - } - - if ((res = mp_lshd (&t1, i - t - 1)) != MP_OKAY) { - goto LBL_Y; - } - - if ((res = mp_sub (&x, &t1, &x)) != MP_OKAY) { - goto LBL_Y; - } - - /* if x < 0 then { x = x + y*b**{i-t-1}; q{i-t-1} -= 1; } */ - if (x.sign == MP_NEG) { - if ((res = mp_copy (&y, &t1)) != MP_OKAY) { - goto LBL_Y; - } - if ((res = mp_lshd (&t1, i - t - 1)) != MP_OKAY) { - goto LBL_Y; - } - if ((res = mp_add (&x, &t1, &x)) != MP_OKAY) { - goto LBL_Y; - } - - q.dp[i - t - 1] = (q.dp[i - t - 1] - 1UL) & MP_MASK; - } - } - - /* now q is the quotient and x is the remainder - * [which we have to normalize] - */ - - /* get sign before writing to c */ - x.sign = x.used == 0 ? MP_ZPOS : a->sign; - - if (c != NULL) { - mp_clamp (&q); - mp_exch (&q, c); - c->sign = neg; - } - - if (d != NULL) { - mp_div_2d (&x, norm, &x, NULL); - mp_exch (&x, d); - } - - res = MP_OKAY; - -LBL_Y:mp_clear (&y); -LBL_X:mp_clear (&x); -LBL_T2:mp_clear (&t2); -LBL_T1:mp_clear (&t1); -LBL_Q:mp_clear (&q); - return res; -} - -#endif - - -#ifdef MP_LOW_MEM - #define TAB_SIZE 32 -#else - #define TAB_SIZE 256 -#endif - -static int -s_mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int redmode) -{ - mp_int M[TAB_SIZE], res, mu; - mp_digit buf; - int err, bitbuf, bitcpy, bitcnt, mode, digidx, x, y, winsize; - int (*redux)(mp_int*,mp_int*,mp_int*); - - /* find window size */ - x = mp_count_bits (X); - if (x <= 7) { - winsize = 2; - } else if (x <= 36) { - winsize = 3; - } else if (x <= 140) { - winsize = 4; - } else if (x <= 450) { - winsize = 5; - } else if (x <= 1303) { - winsize = 6; - } else if (x <= 3529) { - winsize = 7; - } else { - winsize = 8; - } - -#ifdef MP_LOW_MEM - if (winsize > 5) { - winsize = 5; - } -#endif - - /* init M array */ - /* init first cell */ - if ((err = mp_init(&M[1])) != MP_OKAY) { - return err; - } - - /* now init the second half of the array */ - for (x = 1<<(winsize-1); x < (1 << winsize); x++) { - if ((err = mp_init(&M[x])) != MP_OKAY) { - for (y = 1<<(winsize-1); y < x; y++) { - mp_clear (&M[y]); - } - mp_clear(&M[1]); - return err; - } - } - - /* create mu, used for Barrett reduction */ - if ((err = mp_init (&mu)) != MP_OKAY) { - goto LBL_M; - } - - if (redmode == 0) { - if ((err = mp_reduce_setup (&mu, P)) != MP_OKAY) { - goto LBL_MU; - } - redux = mp_reduce; - } else { - if ((err = mp_reduce_2k_setup_l (P, &mu)) != MP_OKAY) { - goto LBL_MU; - } - redux = mp_reduce_2k_l; - } - - /* create M table - * - * The M table contains powers of the base, - * e.g. M[x] = G**x mod P - * - * The first half of the table is not - * computed though accept for M[0] and M[1] - */ - if ((err = mp_mod (G, P, &M[1])) != MP_OKAY) { - goto LBL_MU; - } - - /* compute the value at M[1<<(winsize-1)] by squaring - * M[1] (winsize-1) times - */ - if ((err = mp_copy (&M[1], &M[1 << (winsize - 1)])) != MP_OKAY) { - goto LBL_MU; - } - - for (x = 0; x < (winsize - 1); x++) { - /* square it */ - if ((err = mp_sqr (&M[1 << (winsize - 1)], - &M[1 << (winsize - 1)])) != MP_OKAY) { - goto LBL_MU; - } - - /* reduce modulo P */ - if ((err = redux (&M[1 << (winsize - 1)], P, &mu)) != MP_OKAY) { - goto LBL_MU; - } - } - - /* create upper table, that is M[x] = M[x-1] * M[1] (mod P) - * for x = (2**(winsize - 1) + 1) to (2**winsize - 1) - */ - for (x = (1 << (winsize - 1)) + 1; x < (1 << winsize); x++) { - if ((err = mp_mul (&M[x - 1], &M[1], &M[x])) != MP_OKAY) { - goto LBL_MU; - } - if ((err = redux (&M[x], P, &mu)) != MP_OKAY) { - goto LBL_MU; - } - } - - /* setup result */ - if ((err = mp_init (&res)) != MP_OKAY) { - goto LBL_MU; - } - mp_set (&res, 1); - - /* set initial mode and bit cnt */ - mode = 0; - bitcnt = 1; - buf = 0; - digidx = X->used - 1; - bitcpy = 0; - bitbuf = 0; - - for (;;) { - /* grab next digit as required */ - if (--bitcnt == 0) { - /* if digidx == -1 we are out of digits */ - if (digidx == -1) { - break; - } - /* read next digit and reset the bitcnt */ - buf = X->dp[digidx--]; - bitcnt = (int) DIGIT_BIT; - } - - /* grab the next msb from the exponent */ - y = (buf >> (mp_digit)(DIGIT_BIT - 1)) & 1; - buf <<= (mp_digit)1; - - /* if the bit is zero and mode == 0 then we ignore it - * These represent the leading zero bits before the first 1 bit - * in the exponent. Technically this opt is not required but it - * does lower the # of trivial squaring/reductions used - */ - if (mode == 0 && y == 0) { - continue; - } - - /* if the bit is zero and mode == 1 then we square */ - if (mode == 1 && y == 0) { - if ((err = mp_sqr (&res, &res)) != MP_OKAY) { - goto LBL_RES; - } - if ((err = redux (&res, P, &mu)) != MP_OKAY) { - goto LBL_RES; - } - continue; - } - - /* else we add it to the window */ - bitbuf |= (y << (winsize - ++bitcpy)); - mode = 2; - - if (bitcpy == winsize) { - /* ok window is filled so square as required and multiply */ - /* square first */ - for (x = 0; x < winsize; x++) { - if ((err = mp_sqr (&res, &res)) != MP_OKAY) { - goto LBL_RES; - } - if ((err = redux (&res, P, &mu)) != MP_OKAY) { - goto LBL_RES; - } - } - - /* then multiply */ - if ((err = mp_mul (&res, &M[bitbuf], &res)) != MP_OKAY) { - goto LBL_RES; - } - if ((err = redux (&res, P, &mu)) != MP_OKAY) { - goto LBL_RES; - } - - /* empty window and reset */ - bitcpy = 0; - bitbuf = 0; - mode = 1; - } - } - - /* if bits remain then square/multiply */ - if (mode == 2 && bitcpy > 0) { - /* square then multiply if the bit is set */ - for (x = 0; x < bitcpy; x++) { - if ((err = mp_sqr (&res, &res)) != MP_OKAY) { - goto LBL_RES; - } - if ((err = redux (&res, P, &mu)) != MP_OKAY) { - goto LBL_RES; - } - - bitbuf <<= 1; - if ((bitbuf & (1 << winsize)) != 0) { - /* then multiply */ - if ((err = mp_mul (&res, &M[1], &res)) != MP_OKAY) { - goto LBL_RES; - } - if ((err = redux (&res, P, &mu)) != MP_OKAY) { - goto LBL_RES; - } - } - } - } - - mp_exch (&res, Y); - err = MP_OKAY; -LBL_RES:mp_clear (&res); -LBL_MU:mp_clear (&mu); -LBL_M: - mp_clear(&M[1]); - for (x = 1<<(winsize-1); x < (1 << winsize); x++) { - mp_clear (&M[x]); - } - return err; -} - - -/* computes b = a*a */ -static int -mp_sqr (mp_int * a, mp_int * b) -{ - int res; - -#ifdef BN_MP_TOOM_SQR_C - /* use Toom-Cook? */ - if (a->used >= TOOM_SQR_CUTOFF) { - res = mp_toom_sqr(a, b); - /* Karatsuba? */ - } else -#endif -#ifdef BN_MP_KARATSUBA_SQR_C -if (a->used >= KARATSUBA_SQR_CUTOFF) { - res = mp_karatsuba_sqr (a, b); - } else -#endif - { -#ifdef BN_FAST_S_MP_SQR_C - /* can we use the fast comba multiplier? */ - if ((a->used * 2 + 1) < MP_WARRAY && - a->used < - (1 << (sizeof(mp_word) * CHAR_BIT - 2*DIGIT_BIT - 1))) { - res = fast_s_mp_sqr (a, b); - } else -#endif -#ifdef BN_S_MP_SQR_C - res = s_mp_sqr (a, b); -#else -#error mp_sqr could fail - res = MP_VAL; -#endif - } - b->sign = MP_ZPOS; - return res; -} - - -/* reduces a modulo n where n is of the form 2**p - d - This differs from reduce_2k since "d" can be larger - than a single digit. -*/ -static int -mp_reduce_2k_l(mp_int *a, mp_int *n, mp_int *d) -{ - mp_int q; - int p, res; - - if ((res = mp_init(&q)) != MP_OKAY) { - return res; - } - - p = mp_count_bits(n); -top: - /* q = a/2**p, a = a mod 2**p */ - if ((res = mp_div_2d(a, p, &q, a)) != MP_OKAY) { - goto ERR; - } - - /* q = q * d */ - if ((res = mp_mul(&q, d, &q)) != MP_OKAY) { - goto ERR; - } - - /* a = a + q */ - if ((res = s_mp_add(a, &q, a)) != MP_OKAY) { - goto ERR; - } - - if (mp_cmp_mag(a, n) != MP_LT) { - s_mp_sub(a, n, a); - goto top; - } - -ERR: - mp_clear(&q); - return res; -} - - -/* determines the setup value */ -static int -mp_reduce_2k_setup_l(mp_int *a, mp_int *d) -{ - int res; - mp_int tmp; - - if ((res = mp_init(&tmp)) != MP_OKAY) { - return res; - } - - if ((res = mp_2expt(&tmp, mp_count_bits(a))) != MP_OKAY) { - goto ERR; - } - - if ((res = s_mp_sub(&tmp, a, d)) != MP_OKAY) { - goto ERR; - } - -ERR: - mp_clear(&tmp); - return res; -} - - -/* computes a = 2**b - * - * Simple algorithm which zeroes the int, grows it then just sets one bit - * as required. - */ -static int -mp_2expt (mp_int * a, int b) -{ - int res; - - /* zero a as per default */ - mp_zero (a); - - /* grow a to accommodate the single bit */ - if ((res = mp_grow (a, b / DIGIT_BIT + 1)) != MP_OKAY) { - return res; - } - - /* set the used count of where the bit will go */ - a->used = b / DIGIT_BIT + 1; - - /* put the single bit in its place */ - a->dp[b / DIGIT_BIT] = ((mp_digit)1) << (b % DIGIT_BIT); - - return MP_OKAY; -} - - -/* pre-calculate the value required for Barrett reduction - * For a given modulus "b" it calulates the value required in "a" - */ -static int -mp_reduce_setup (mp_int * a, mp_int * b) -{ - int res; - - if ((res = mp_2expt (a, b->used * 2 * DIGIT_BIT)) != MP_OKAY) { - return res; - } - return mp_div (a, b, a, NULL); -} - - -/* reduces x mod m, assumes 0 < x < m**2, mu is - * precomputed via mp_reduce_setup. - * From HAC pp.604 Algorithm 14.42 - */ -static int -mp_reduce (mp_int * x, mp_int * m, mp_int * mu) -{ - mp_int q; - int res, um = m->used; - - /* q = x */ - if ((res = mp_init_copy (&q, x)) != MP_OKAY) { - return res; - } - - /* q1 = x / b**(k-1) */ - mp_rshd (&q, um - 1); - - /* according to HAC this optimization is ok */ - if (((unsigned long) um) > (((mp_digit)1) << (DIGIT_BIT - 1))) { - if ((res = mp_mul (&q, mu, &q)) != MP_OKAY) { - goto CLEANUP; - } - } else { -#ifdef BN_S_MP_MUL_HIGH_DIGS_C - if ((res = s_mp_mul_high_digs (&q, mu, &q, um)) != MP_OKAY) { - goto CLEANUP; - } -#elif defined(BN_FAST_S_MP_MUL_HIGH_DIGS_C) - if ((res = fast_s_mp_mul_high_digs (&q, mu, &q, um)) != MP_OKAY) { - goto CLEANUP; - } -#else - { -#error mp_reduce would always fail - res = MP_VAL; - goto CLEANUP; - } -#endif - } - - /* q3 = q2 / b**(k+1) */ - mp_rshd (&q, um + 1); - - /* x = x mod b**(k+1), quick (no division) */ - if ((res = mp_mod_2d (x, DIGIT_BIT * (um + 1), x)) != MP_OKAY) { - goto CLEANUP; - } - - /* q = q * m mod b**(k+1), quick (no division) */ - if ((res = s_mp_mul_digs (&q, m, &q, um + 1)) != MP_OKAY) { - goto CLEANUP; - } - - /* x = x - q */ - if ((res = mp_sub (x, &q, x)) != MP_OKAY) { - goto CLEANUP; - } - - /* If x < 0, add b**(k+1) to it */ - if (mp_cmp_d (x, 0) == MP_LT) { - mp_set (&q, 1); - if ((res = mp_lshd (&q, um + 1)) != MP_OKAY) { - goto CLEANUP; - } - if ((res = mp_add (x, &q, x)) != MP_OKAY) { - goto CLEANUP; - } - } - - /* Back off if it's too big */ - while (mp_cmp (x, m) != MP_LT) { - if ((res = s_mp_sub (x, m, x)) != MP_OKAY) { - goto CLEANUP; - } - } - -CLEANUP: - mp_clear (&q); - - return res; -} - - -/* multiplies |a| * |b| and only computes up to digs digits of result - * HAC pp. 595, Algorithm 14.12 Modified so you can control how - * many digits of output are created. - */ -static int -s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) -{ - mp_int t; - int res, pa, pb, ix, iy; - mp_digit u; - mp_word r; - mp_digit tmpx, *tmpt, *tmpy; - - /* can we use the fast multiplier? */ - if (((digs) < MP_WARRAY) && - MIN (a->used, b->used) < - (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) { - return fast_s_mp_mul_digs (a, b, c, digs); - } - - if ((res = mp_init_size (&t, digs)) != MP_OKAY) { - return res; - } - t.used = digs; - - /* compute the digits of the product directly */ - pa = a->used; - for (ix = 0; ix < pa; ix++) { - /* set the carry to zero */ - u = 0; - - /* limit ourselves to making digs digits of output */ - pb = MIN (b->used, digs - ix); - - /* setup some aliases */ - /* copy of the digit from a used within the nested loop */ - tmpx = a->dp[ix]; - - /* an alias for the destination shifted ix places */ - tmpt = t.dp + ix; - - /* an alias for the digits of b */ - tmpy = b->dp; - - /* compute the columns of the output and propagate the carry */ - for (iy = 0; iy < pb; iy++) { - /* compute the column as a mp_word */ - r = ((mp_word)*tmpt) + - ((mp_word)tmpx) * ((mp_word)*tmpy++) + - ((mp_word) u); - - /* the new column is the lower part of the result */ - *tmpt++ = (mp_digit) (r & ((mp_word) MP_MASK)); - - /* get the carry word from the result */ - u = (mp_digit) (r >> ((mp_word) DIGIT_BIT)); - } - /* set carry if it is placed below digs */ - if (ix + iy < digs) { - *tmpt = u; - } - } - - mp_clamp (&t); - mp_exch (&t, c); - - mp_clear (&t); - return MP_OKAY; -} - - -/* Fast (comba) multiplier - * - * This is the fast column-array [comba] multiplier. It is - * designed to compute the columns of the product first - * then handle the carries afterwards. This has the effect - * of making the nested loops that compute the columns very - * simple and schedulable on super-scalar processors. - * - * This has been modified to produce a variable number of - * digits of output so if say only a half-product is required - * you don't have to compute the upper half (a feature - * required for fast Barrett reduction). - * - * Based on Algorithm 14.12 on pp.595 of HAC. - * - */ -static int -fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) -{ - int olduse, res, pa, ix, iz; - mp_digit W[MP_WARRAY]; - register mp_word _W; - - /* grow the destination as required */ - if (c->alloc < digs) { - if ((res = mp_grow (c, digs)) != MP_OKAY) { - return res; - } - } - - /* number of output digits to produce */ - pa = MIN(digs, a->used + b->used); - - /* clear the carry */ - _W = 0; - for (ix = 0; ix < pa; ix++) { - int tx, ty; - int iy; - mp_digit *tmpx, *tmpy; - - /* get offsets into the two bignums */ - ty = MIN(b->used-1, ix); - tx = ix - ty; - - /* setup temp aliases */ - tmpx = a->dp + tx; - tmpy = b->dp + ty; - - /* this is the number of times the loop will iterrate, essentially - while (tx++ < a->used && ty-- >= 0) { ... } - */ - iy = MIN(a->used-tx, ty+1); - - /* execute loop */ - for (iz = 0; iz < iy; ++iz) { - _W += ((mp_word)*tmpx++)*((mp_word)*tmpy--); - - } - - /* store term */ - W[ix] = ((mp_digit)_W) & MP_MASK; - - /* make next carry */ - _W = _W >> ((mp_word)DIGIT_BIT); - } - - /* setup dest */ - olduse = c->used; - c->used = pa; - - { - register mp_digit *tmpc; - tmpc = c->dp; - for (ix = 0; ix < pa+1; ix++) { - /* now extract the previous digit [below the carry] */ - *tmpc++ = W[ix]; - } - - /* clear unused digits [that existed in the old copy of c] */ - for (; ix < olduse; ix++) { - *tmpc++ = 0; - } - } - mp_clamp (c); - return MP_OKAY; -} - - -/* init an mp_init for a given size */ -static int -mp_init_size (mp_int * a, int size) -{ - int x; - - /* pad size so there are always extra digits */ - size += (MP_PREC * 2) - (size % MP_PREC); - - /* alloc mem */ - a->dp = OPT_CAST(mp_digit) XMALLOC (sizeof (mp_digit) * size); - if (a->dp == NULL) { - return MP_MEM; - } - - /* set the members */ - a->used = 0; - a->alloc = size; - a->sign = MP_ZPOS; - - /* zero the digits */ - for (x = 0; x < size; x++) { - a->dp[x] = 0; - } - - return MP_OKAY; -} - - -/* low level squaring, b = a*a, HAC pp.596-597, Algorithm 14.16 */ -static int -s_mp_sqr (mp_int * a, mp_int * b) -{ - mp_int t; - int res, ix, iy, pa; - mp_word r; - mp_digit u, tmpx, *tmpt; - - pa = a->used; - if ((res = mp_init_size (&t, 2*pa + 1)) != MP_OKAY) { - return res; - } - - /* default used is maximum possible size */ - t.used = 2*pa + 1; - - for (ix = 0; ix < pa; ix++) { - /* first calculate the digit at 2*ix */ - /* calculate double precision result */ - r = ((mp_word) t.dp[2*ix]) + - ((mp_word)a->dp[ix])*((mp_word)a->dp[ix]); - - /* store lower part in result */ - t.dp[ix+ix] = (mp_digit) (r & ((mp_word) MP_MASK)); - - /* get the carry */ - u = (mp_digit)(r >> ((mp_word) DIGIT_BIT)); - - /* left hand side of A[ix] * A[iy] */ - tmpx = a->dp[ix]; - - /* alias for where to store the results */ - tmpt = t.dp + (2*ix + 1); - - for (iy = ix + 1; iy < pa; iy++) { - /* first calculate the product */ - r = ((mp_word)tmpx) * ((mp_word)a->dp[iy]); - - /* now calculate the double precision result, note we use - * addition instead of *2 since it's easier to optimize - */ - r = ((mp_word) *tmpt) + r + r + ((mp_word) u); - - /* store lower part */ - *tmpt++ = (mp_digit) (r & ((mp_word) MP_MASK)); - - /* get carry */ - u = (mp_digit)(r >> ((mp_word) DIGIT_BIT)); - } - /* propagate upwards */ - while (u != ((mp_digit) 0)) { - r = ((mp_word) *tmpt) + ((mp_word) u); - *tmpt++ = (mp_digit) (r & ((mp_word) MP_MASK)); - u = (mp_digit)(r >> ((mp_word) DIGIT_BIT)); - } - } - - mp_clamp (&t); - mp_exch (&t, b); - mp_clear (&t); - return MP_OKAY; -} - - -/* multiplies |a| * |b| and does not compute the lower digs digits - * [meant to get the higher part of the product] - */ -static int -s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) -{ - mp_int t; - int res, pa, pb, ix, iy; - mp_digit u; - mp_word r; - mp_digit tmpx, *tmpt, *tmpy; - - /* can we use the fast multiplier? */ -#ifdef BN_FAST_S_MP_MUL_HIGH_DIGS_C - if (((a->used + b->used + 1) < MP_WARRAY) - && MIN (a->used, b->used) < (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) { - return fast_s_mp_mul_high_digs (a, b, c, digs); - } -#endif - - if ((res = mp_init_size (&t, a->used + b->used + 1)) != MP_OKAY) { - return res; - } - t.used = a->used + b->used + 1; - - pa = a->used; - pb = b->used; - for (ix = 0; ix < pa; ix++) { - /* clear the carry */ - u = 0; - - /* left hand side of A[ix] * B[iy] */ - tmpx = a->dp[ix]; - - /* alias to the address of where the digits will be stored */ - tmpt = &(t.dp[digs]); - - /* alias for where to read the right hand side from */ - tmpy = b->dp + (digs - ix); - - for (iy = digs - ix; iy < pb; iy++) { - /* calculate the double precision result */ - r = ((mp_word)*tmpt) + - ((mp_word)tmpx) * ((mp_word)*tmpy++) + - ((mp_word) u); - - /* get the lower part */ - *tmpt++ = (mp_digit) (r & ((mp_word) MP_MASK)); - - /* carry the carry */ - u = (mp_digit) (r >> ((mp_word) DIGIT_BIT)); - } - *tmpt = u; - } - mp_clamp (&t); - mp_exch (&t, c); - mp_clear (&t); - return MP_OKAY; -} - - -#ifdef BN_MP_MONTGOMERY_SETUP_C -/* setups the montgomery reduction stuff */ -static int -mp_montgomery_setup (mp_int * n, mp_digit * rho) -{ - mp_digit x, b; - -/* fast inversion mod 2**k - * - * Based on the fact that - * - * XA = 1 (mod 2**n) => (X(2-XA)) A = 1 (mod 2**2n) - * => 2*X*A - X*X*A*A = 1 - * => 2*(1) - (1) = 1 - */ - b = n->dp[0]; - - if ((b & 1) == 0) { - return MP_VAL; - } - - x = (((b + 2) & 4) << 1) + b; /* here x*a==1 mod 2**4 */ - x *= 2 - b * x; /* here x*a==1 mod 2**8 */ -#if !defined(MP_8BIT) - x *= 2 - b * x; /* here x*a==1 mod 2**16 */ -#endif -#if defined(MP_64BIT) || !(defined(MP_8BIT) || defined(MP_16BIT)) - x *= 2 - b * x; /* here x*a==1 mod 2**32 */ -#endif -#ifdef MP_64BIT - x *= 2 - b * x; /* here x*a==1 mod 2**64 */ -#endif - - /* rho = -1/m mod b */ - *rho = (unsigned long)(((mp_word)1 << ((mp_word) DIGIT_BIT)) - x) & MP_MASK; - - return MP_OKAY; -} -#endif - - -#ifdef BN_FAST_MP_MONTGOMERY_REDUCE_C -/* computes xR**-1 == x (mod N) via Montgomery Reduction - * - * This is an optimized implementation of montgomery_reduce - * which uses the comba method to quickly calculate the columns of the - * reduction. - * - * Based on Algorithm 14.32 on pp.601 of HAC. -*/ -int -fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) -{ - int ix, res, olduse; - mp_word W[MP_WARRAY]; - - /* get old used count */ - olduse = x->used; - - /* grow a as required */ - if (x->alloc < n->used + 1) { - if ((res = mp_grow (x, n->used + 1)) != MP_OKAY) { - return res; - } - } - - /* first we have to get the digits of the input into - * an array of double precision words W[...] - */ - { - register mp_word *_W; - register mp_digit *tmpx; - - /* alias for the W[] array */ - _W = W; - - /* alias for the digits of x*/ - tmpx = x->dp; - - /* copy the digits of a into W[0..a->used-1] */ - for (ix = 0; ix < x->used; ix++) { - *_W++ = *tmpx++; - } - - /* zero the high words of W[a->used..m->used*2] */ - for (; ix < n->used * 2 + 1; ix++) { - *_W++ = 0; - } - } - - /* now we proceed to zero successive digits - * from the least significant upwards - */ - for (ix = 0; ix < n->used; ix++) { - /* mu = ai * m' mod b - * - * We avoid a double precision multiplication (which isn't required) - * by casting the value down to a mp_digit. Note this requires - * that W[ix-1] have the carry cleared (see after the inner loop) - */ - register mp_digit mu; - mu = (mp_digit) (((W[ix] & MP_MASK) * rho) & MP_MASK); - - /* a = a + mu * m * b**i - * - * This is computed in place and on the fly. The multiplication - * by b**i is handled by offseting which columns the results - * are added to. - * - * Note the comba method normally doesn't handle carries in the - * inner loop In this case we fix the carry from the previous - * column since the Montgomery reduction requires digits of the - * result (so far) [see above] to work. This is - * handled by fixing up one carry after the inner loop. The - * carry fixups are done in order so after these loops the - * first m->used words of W[] have the carries fixed - */ - { - register int iy; - register mp_digit *tmpn; - register mp_word *_W; - - /* alias for the digits of the modulus */ - tmpn = n->dp; - - /* Alias for the columns set by an offset of ix */ - _W = W + ix; - - /* inner loop */ - for (iy = 0; iy < n->used; iy++) { - *_W++ += ((mp_word)mu) * ((mp_word)*tmpn++); - } - } - - /* now fix carry for next digit, W[ix+1] */ - W[ix + 1] += W[ix] >> ((mp_word) DIGIT_BIT); - } - - /* now we have to propagate the carries and - * shift the words downward [all those least - * significant digits we zeroed]. - */ - { - register mp_digit *tmpx; - register mp_word *_W, *_W1; - - /* nox fix rest of carries */ - - /* alias for current word */ - _W1 = W + ix; - - /* alias for next word, where the carry goes */ - _W = W + ++ix; - - for (; ix <= n->used * 2 + 1; ix++) { - *_W++ += *_W1++ >> ((mp_word) DIGIT_BIT); - } - - /* copy out, A = A/b**n - * - * The result is A/b**n but instead of converting from an - * array of mp_word to mp_digit than calling mp_rshd - * we just copy them in the right order - */ - - /* alias for destination word */ - tmpx = x->dp; - - /* alias for shifted double precision result */ - _W = W + n->used; - - for (ix = 0; ix < n->used + 1; ix++) { - *tmpx++ = (mp_digit)(*_W++ & ((mp_word) MP_MASK)); - } - - /* zero oldused digits, if the input a was larger than - * m->used+1 we'll have to clear the digits - */ - for (; ix < olduse; ix++) { - *tmpx++ = 0; - } - } - - /* set the max used and clamp */ - x->used = n->used + 1; - mp_clamp (x); - - /* if A >= m then A = A - m */ - if (mp_cmp_mag (x, n) != MP_LT) { - return s_mp_sub (x, n, x); - } - return MP_OKAY; -} -#endif - - -#ifdef BN_MP_MUL_2_C -/* b = a*2 */ -static int -mp_mul_2(mp_int * a, mp_int * b) -{ - int x, res, oldused; - - /* grow to accommodate result */ - if (b->alloc < a->used + 1) { - if ((res = mp_grow (b, a->used + 1)) != MP_OKAY) { - return res; - } - } - - oldused = b->used; - b->used = a->used; - - { - register mp_digit r, rr, *tmpa, *tmpb; - - /* alias for source */ - tmpa = a->dp; - - /* alias for dest */ - tmpb = b->dp; - - /* carry */ - r = 0; - for (x = 0; x < a->used; x++) { - - /* get what will be the *next* carry bit from the - * MSB of the current digit - */ - rr = *tmpa >> ((mp_digit)(DIGIT_BIT - 1)); - - /* now shift up this digit, add in the carry [from the previous] */ - *tmpb++ = ((*tmpa++ << ((mp_digit)1)) | r) & MP_MASK; - - /* copy the carry that would be from the source - * digit into the next iteration - */ - r = rr; - } - - /* new leading digit? */ - if (r != 0) { - /* add a MSB which is always 1 at this point */ - *tmpb = 1; - ++(b->used); - } - - /* now zero any excess digits on the destination - * that we didn't write to - */ - tmpb = b->dp + b->used; - for (x = b->used; x < oldused; x++) { - *tmpb++ = 0; - } - } - b->sign = a->sign; - return MP_OKAY; -} -#endif - - -#ifdef BN_MP_MONTGOMERY_CALC_NORMALIZATION_C -/* - * shifts with subtractions when the result is greater than b. - * - * The method is slightly modified to shift B unconditionally up to just under - * the leading bit of b. This saves a lot of multiple precision shifting. - */ -static int -mp_montgomery_calc_normalization (mp_int * a, mp_int * b) -{ - int x, bits, res; - - /* how many bits of last digit does b use */ - bits = mp_count_bits (b) % DIGIT_BIT; - - if (b->used > 1) { - if ((res = mp_2expt (a, (b->used - 1) * DIGIT_BIT + bits - 1)) != MP_OKAY) { - return res; - } - } else { - mp_set(a, 1); - bits = 1; - } - - - /* now compute C = A * B mod b */ - for (x = bits - 1; x < (int)DIGIT_BIT; x++) { - if ((res = mp_mul_2 (a, a)) != MP_OKAY) { - return res; - } - if (mp_cmp_mag (a, b) != MP_LT) { - if ((res = s_mp_sub (a, b, a)) != MP_OKAY) { - return res; - } - } - } - - return MP_OKAY; -} -#endif - - -#ifdef BN_MP_EXPTMOD_FAST_C -/* computes Y == G**X mod P, HAC pp.616, Algorithm 14.85 - * - * Uses a left-to-right k-ary sliding window to compute the modular exponentiation. - * The value of k changes based on the size of the exponent. - * - * Uses Montgomery or Diminished Radix reduction [whichever appropriate] - */ - -static int -mp_exptmod_fast (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int redmode) -{ - mp_int M[TAB_SIZE], res; - mp_digit buf, mp; - int err, bitbuf, bitcpy, bitcnt, mode, digidx, x, y, winsize; - - /* use a pointer to the reduction algorithm. This allows us to use - * one of many reduction algorithms without modding the guts of - * the code with if statements everywhere. - */ - int (*redux)(mp_int*,mp_int*,mp_digit); - - /* find window size */ - x = mp_count_bits (X); - if (x <= 7) { - winsize = 2; - } else if (x <= 36) { - winsize = 3; - } else if (x <= 140) { - winsize = 4; - } else if (x <= 450) { - winsize = 5; - } else if (x <= 1303) { - winsize = 6; - } else if (x <= 3529) { - winsize = 7; - } else { - winsize = 8; - } - -#ifdef MP_LOW_MEM - if (winsize > 5) { - winsize = 5; - } -#endif - - /* init M array */ - /* init first cell */ - if ((err = mp_init(&M[1])) != MP_OKAY) { - return err; - } - - /* now init the second half of the array */ - for (x = 1<<(winsize-1); x < (1 << winsize); x++) { - if ((err = mp_init(&M[x])) != MP_OKAY) { - for (y = 1<<(winsize-1); y < x; y++) { - mp_clear (&M[y]); - } - mp_clear(&M[1]); - return err; - } - } - - /* determine and setup reduction code */ - if (redmode == 0) { -#ifdef BN_MP_MONTGOMERY_SETUP_C - /* now setup montgomery */ - if ((err = mp_montgomery_setup (P, &mp)) != MP_OKAY) { - goto LBL_M; - } -#else - err = MP_VAL; - goto LBL_M; -#endif - - /* automatically pick the comba one if available (saves quite a few calls/ifs) */ -#ifdef BN_FAST_MP_MONTGOMERY_REDUCE_C - if (((P->used * 2 + 1) < MP_WARRAY) && - P->used < (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) { - redux = fast_mp_montgomery_reduce; - } else -#endif - { -#ifdef BN_MP_MONTGOMERY_REDUCE_C - /* use slower baseline Montgomery method */ - redux = mp_montgomery_reduce; -#else - err = MP_VAL; - goto LBL_M; -#endif - } - } else if (redmode == 1) { -#if defined(BN_MP_DR_SETUP_C) && defined(BN_MP_DR_REDUCE_C) - /* setup DR reduction for moduli of the form B**k - b */ - mp_dr_setup(P, &mp); - redux = mp_dr_reduce; -#else - err = MP_VAL; - goto LBL_M; -#endif - } else { -#if defined(BN_MP_REDUCE_2K_SETUP_C) && defined(BN_MP_REDUCE_2K_C) - /* setup DR reduction for moduli of the form 2**k - b */ - if ((err = mp_reduce_2k_setup(P, &mp)) != MP_OKAY) { - goto LBL_M; - } - redux = mp_reduce_2k; -#else - err = MP_VAL; - goto LBL_M; -#endif - } - - /* setup result */ - if ((err = mp_init (&res)) != MP_OKAY) { - goto LBL_M; - } - - /* create M table - * - - * - * The first half of the table is not computed though accept for M[0] and M[1] - */ - - if (redmode == 0) { -#ifdef BN_MP_MONTGOMERY_CALC_NORMALIZATION_C - /* now we need R mod m */ - if ((err = mp_montgomery_calc_normalization (&res, P)) != MP_OKAY) { - goto LBL_RES; - } -#else - err = MP_VAL; - goto LBL_RES; -#endif - - /* now set M[1] to G * R mod m */ - if ((err = mp_mulmod (G, &res, P, &M[1])) != MP_OKAY) { - goto LBL_RES; - } - } else { - mp_set(&res, 1); - if ((err = mp_mod(G, P, &M[1])) != MP_OKAY) { - goto LBL_RES; - } - } - - /* compute the value at M[1<<(winsize-1)] by squaring M[1] (winsize-1) times */ - if ((err = mp_copy (&M[1], &M[1 << (winsize - 1)])) != MP_OKAY) { - goto LBL_RES; - } - - for (x = 0; x < (winsize - 1); x++) { - if ((err = mp_sqr (&M[1 << (winsize - 1)], &M[1 << (winsize - 1)])) != MP_OKAY) { - goto LBL_RES; - } - if ((err = redux (&M[1 << (winsize - 1)], P, mp)) != MP_OKAY) { - goto LBL_RES; - } - } - - /* create upper table */ - for (x = (1 << (winsize - 1)) + 1; x < (1 << winsize); x++) { - if ((err = mp_mul (&M[x - 1], &M[1], &M[x])) != MP_OKAY) { - goto LBL_RES; - } - if ((err = redux (&M[x], P, mp)) != MP_OKAY) { - goto LBL_RES; - } - } - - /* set initial mode and bit cnt */ - mode = 0; - bitcnt = 1; - buf = 0; - digidx = X->used - 1; - bitcpy = 0; - bitbuf = 0; - - for (;;) { - /* grab next digit as required */ - if (--bitcnt == 0) { - /* if digidx == -1 we are out of digits so break */ - if (digidx == -1) { - break; - } - /* read next digit and reset bitcnt */ - buf = X->dp[digidx--]; - bitcnt = (int)DIGIT_BIT; - } - - /* grab the next msb from the exponent */ - y = (mp_digit)(buf >> (DIGIT_BIT - 1)) & 1; - buf <<= (mp_digit)1; - - /* if the bit is zero and mode == 0 then we ignore it - * These represent the leading zero bits before the first 1 bit - * in the exponent. Technically this opt is not required but it - * does lower the # of trivial squaring/reductions used - */ - if (mode == 0 && y == 0) { - continue; - } - - /* if the bit is zero and mode == 1 then we square */ - if (mode == 1 && y == 0) { - if ((err = mp_sqr (&res, &res)) != MP_OKAY) { - goto LBL_RES; - } - if ((err = redux (&res, P, mp)) != MP_OKAY) { - goto LBL_RES; - } - continue; - } - - /* else we add it to the window */ - bitbuf |= (y << (winsize - ++bitcpy)); - mode = 2; - - if (bitcpy == winsize) { - /* ok window is filled so square as required and multiply */ - /* square first */ - for (x = 0; x < winsize; x++) { - if ((err = mp_sqr (&res, &res)) != MP_OKAY) { - goto LBL_RES; - } - if ((err = redux (&res, P, mp)) != MP_OKAY) { - goto LBL_RES; - } - } - - /* then multiply */ - if ((err = mp_mul (&res, &M[bitbuf], &res)) != MP_OKAY) { - goto LBL_RES; - } - if ((err = redux (&res, P, mp)) != MP_OKAY) { - goto LBL_RES; - } - - /* empty window and reset */ - bitcpy = 0; - bitbuf = 0; - mode = 1; - } - } - - /* if bits remain then square/multiply */ - if (mode == 2 && bitcpy > 0) { - /* square then multiply if the bit is set */ - for (x = 0; x < bitcpy; x++) { - if ((err = mp_sqr (&res, &res)) != MP_OKAY) { - goto LBL_RES; - } - if ((err = redux (&res, P, mp)) != MP_OKAY) { - goto LBL_RES; - } - - /* get next bit of the window */ - bitbuf <<= 1; - if ((bitbuf & (1 << winsize)) != 0) { - /* then multiply */ - if ((err = mp_mul (&res, &M[1], &res)) != MP_OKAY) { - goto LBL_RES; - } - if ((err = redux (&res, P, mp)) != MP_OKAY) { - goto LBL_RES; - } - } - } - } - - if (redmode == 0) { - /* fixup result if Montgomery reduction is used - * recall that any value in a Montgomery system is - * actually multiplied by R mod n. So we have - * to reduce one more time to cancel out the factor - * of R. - */ - if ((err = redux(&res, P, mp)) != MP_OKAY) { - goto LBL_RES; - } - } - - /* swap res with Y */ - mp_exch (&res, Y); - err = MP_OKAY; -LBL_RES:mp_clear (&res); -LBL_M: - mp_clear(&M[1]); - for (x = 1<<(winsize-1); x < (1 << winsize); x++) { - mp_clear (&M[x]); - } - return err; -} -#endif - - -#ifdef BN_FAST_S_MP_SQR_C -/* the jist of squaring... - * you do like mult except the offset of the tmpx [one that - * starts closer to zero] can't equal the offset of tmpy. - * So basically you set up iy like before then you min it with - * (ty-tx) so that it never happens. You double all those - * you add in the inner loop - -After that loop you do the squares and add them in. -*/ - -static int -fast_s_mp_sqr (mp_int * a, mp_int * b) -{ - int olduse, res, pa, ix, iz; - mp_digit W[MP_WARRAY], *tmpx; - mp_word W1; - - /* grow the destination as required */ - pa = a->used + a->used; - if (b->alloc < pa) { - if ((res = mp_grow (b, pa)) != MP_OKAY) { - return res; - } - } - - /* number of output digits to produce */ - W1 = 0; - for (ix = 0; ix < pa; ix++) { - int tx, ty, iy; - mp_word _W; - mp_digit *tmpy; - - /* clear counter */ - _W = 0; - - /* get offsets into the two bignums */ - ty = MIN(a->used-1, ix); - tx = ix - ty; - - /* setup temp aliases */ - tmpx = a->dp + tx; - tmpy = a->dp + ty; - - /* this is the number of times the loop will iterrate, essentially - while (tx++ < a->used && ty-- >= 0) { ... } - */ - iy = MIN(a->used-tx, ty+1); - - /* now for squaring tx can never equal ty - * we halve the distance since they approach at a rate of 2x - * and we have to round because odd cases need to be executed - */ - iy = MIN(iy, (ty-tx+1)>>1); - - /* execute loop */ - for (iz = 0; iz < iy; iz++) { - _W += ((mp_word)*tmpx++)*((mp_word)*tmpy--); - } - - /* double the inner product and add carry */ - _W = _W + _W + W1; - - /* even columns have the square term in them */ - if ((ix&1) == 0) { - _W += ((mp_word)a->dp[ix>>1])*((mp_word)a->dp[ix>>1]); - } - - /* store it */ - W[ix] = (mp_digit)(_W & MP_MASK); - - /* make next carry */ - W1 = _W >> ((mp_word)DIGIT_BIT); - } - - /* setup dest */ - olduse = b->used; - b->used = a->used+a->used; - - { - mp_digit *tmpb; - tmpb = b->dp; - for (ix = 0; ix < pa; ix++) { - *tmpb++ = W[ix] & MP_MASK; - } - - /* clear unused digits [that existed in the old copy of c] */ - for (; ix < olduse; ix++) { - *tmpb++ = 0; - } - } - mp_clamp (b); - return MP_OKAY; -} -#endif - - -#ifdef BN_MP_MUL_D_C -/* multiply by a digit */ -static int -mp_mul_d (mp_int * a, mp_digit b, mp_int * c) -{ - mp_digit u, *tmpa, *tmpc; - mp_word r; - int ix, res, olduse; - - /* make sure c is big enough to hold a*b */ - if (c->alloc < a->used + 1) { - if ((res = mp_grow (c, a->used + 1)) != MP_OKAY) { - return res; - } - } - - /* get the original destinations used count */ - olduse = c->used; - - /* set the sign */ - c->sign = a->sign; - - /* alias for a->dp [source] */ - tmpa = a->dp; - - /* alias for c->dp [dest] */ - tmpc = c->dp; - - /* zero carry */ - u = 0; - - /* compute columns */ - for (ix = 0; ix < a->used; ix++) { - /* compute product and carry sum for this term */ - r = ((mp_word) u) + ((mp_word)*tmpa++) * ((mp_word)b); - - /* mask off higher bits to get a single digit */ - *tmpc++ = (mp_digit) (r & ((mp_word) MP_MASK)); - - /* send carry into next iteration */ - u = (mp_digit) (r >> ((mp_word) DIGIT_BIT)); - } - - /* store final carry [if any] and increment ix offset */ - *tmpc++ = u; - ++ix; - - /* now zero digits above the top */ - while (ix++ < olduse) { - *tmpc++ = 0; - } - - /* set used count */ - c->used = a->used + 1; - mp_clamp(c); - - return MP_OKAY; -} -#endif diff --git a/tools/sdk/include/wpa_supplicant/wpa2/tls/pkcs1.h b/tools/sdk/include/wpa_supplicant/wpa2/tls/pkcs1.h deleted file mode 100644 index ed64defaafe..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/tls/pkcs1.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * PKCS #1 (RSA Encryption) - * Copyright (c) 2006-2009, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef PKCS1_H -#define PKCS1_H - -int pkcs1_encrypt(int block_type, struct crypto_rsa_key *key, - int use_private, const u8 *in, size_t inlen, - u8 *out, size_t *outlen); -int pkcs1_v15_private_key_decrypt(struct crypto_rsa_key *key, - const u8 *in, size_t inlen, - u8 *out, size_t *outlen); -int pkcs1_decrypt_public_key(struct crypto_rsa_key *key, - const u8 *crypt, size_t crypt_len, - u8 *plain, size_t *plain_len); - -#endif /* PKCS1_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/tls/pkcs5.h b/tools/sdk/include/wpa_supplicant/wpa2/tls/pkcs5.h deleted file mode 100644 index 20ddadc4572..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/tls/pkcs5.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * PKCS #5 (Password-based Encryption) - * Copyright (c) 2009, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef PKCS5_H -#define PKCS5_H - -u8 * pkcs5_decrypt(const u8 *enc_alg, size_t enc_alg_len, - const u8 *enc_data, size_t enc_data_len, - const char *passwd, size_t *data_len); - -#endif /* PKCS5_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/tls/pkcs8.h b/tools/sdk/include/wpa_supplicant/wpa2/tls/pkcs8.h deleted file mode 100644 index bebf840ba75..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/tls/pkcs8.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * PKCS #8 (Private-key information syntax) - * Copyright (c) 2006-2009, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef PKCS8_H -#define PKCS8_H - -struct crypto_private_key * pkcs8_key_import(const u8 *buf, size_t len); -struct crypto_private_key * -pkcs8_enc_key_import(const u8 *buf, size_t len, const char *passwd); - -#endif /* PKCS8_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/tls/rsa.h b/tools/sdk/include/wpa_supplicant/wpa2/tls/rsa.h deleted file mode 100644 index c236a9df444..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/tls/rsa.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * RSA - * Copyright (c) 2006, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef RSA_H -#define RSA_H - -struct crypto_rsa_key; - -struct crypto_rsa_key * -crypto_rsa_import_public_key(const u8 *buf, size_t len); -struct crypto_rsa_key * -crypto_rsa_import_private_key(const u8 *buf, size_t len); -size_t crypto_rsa_get_modulus_len(struct crypto_rsa_key *key); -int crypto_rsa_exptmod(const u8 *in, size_t inlen, u8 *out, size_t *outlen, - struct crypto_rsa_key *key, int use_private); -void crypto_rsa_free(struct crypto_rsa_key *key); - -#endif /* RSA_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/tls/tls.h b/tools/sdk/include/wpa_supplicant/wpa2/tls/tls.h deleted file mode 100644 index 983999b51d6..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/tls/tls.h +++ /dev/null @@ -1,537 +0,0 @@ -/* - * SSL/TLS interface definition - * Copyright (c) 2004-2013, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef TLS_H -#define TLS_H - -struct tls_connection; - -struct tls_keys { - const u8 *master_key; /* TLS master secret */ - size_t master_key_len; - const u8 *client_random; - size_t client_random_len; - const u8 *server_random; - size_t server_random_len; -}; - -enum tls_event { - TLS_CERT_CHAIN_SUCCESS, - TLS_CERT_CHAIN_FAILURE, - TLS_PEER_CERTIFICATE, - TLS_ALERT -}; - -/* - * Note: These are used as identifier with external programs and as such, the - * values must not be changed. - */ -enum tls_fail_reason { - TLS_FAIL_UNSPECIFIED = 0, - TLS_FAIL_UNTRUSTED = 1, - TLS_FAIL_REVOKED = 2, - TLS_FAIL_NOT_YET_VALID = 3, - TLS_FAIL_EXPIRED = 4, - TLS_FAIL_SUBJECT_MISMATCH = 5, - TLS_FAIL_ALTSUBJECT_MISMATCH = 6, - TLS_FAIL_BAD_CERTIFICATE = 7, - TLS_FAIL_SERVER_CHAIN_PROBE = 8 -}; - -union tls_event_data { - struct { - int depth; - const char *subject; - enum tls_fail_reason reason; - const char *reason_txt; - const struct wpabuf *cert; - } cert_fail; - - struct { - int depth; - const char *subject; - const struct wpabuf *cert; - const u8 *hash; - size_t hash_len; - } peer_cert; - - struct { - int is_local; - const char *type; - const char *description; - } alert; -}; - -struct tls_config { - const char *opensc_engine_path; - const char *pkcs11_engine_path; - const char *pkcs11_module_path; - int fips_mode; - int cert_in_cb; - - void (*event_cb)(void *ctx, enum tls_event ev, - union tls_event_data *data); - void *cb_ctx; -}; - -#define TLS_CONN_ALLOW_SIGN_RSA_MD5 BIT(0) -#define TLS_CONN_DISABLE_TIME_CHECKS BIT(1) -#define TLS_CONN_DISABLE_SESSION_TICKET BIT(2) -#define TLS_CONN_REQUEST_OCSP BIT(3) -#define TLS_CONN_REQUIRE_OCSP BIT(4) - -/** - * struct tls_connection_params - Parameters for TLS connection - * @ca_cert: File or reference name for CA X.509 certificate in PEM or DER - * format - * @ca_cert_blob: ca_cert as inlined data or %NULL if not used - * @ca_cert_blob_len: ca_cert_blob length - * @ca_path: Path to CA certificates (OpenSSL specific) - * @subject_match: String to match in the subject of the peer certificate or - * %NULL to allow all subjects - * @altsubject_match: String to match in the alternative subject of the peer - * certificate or %NULL to allow all alternative subjects - * @client_cert: File or reference name for client X.509 certificate in PEM or - * DER format - * @client_cert_blob: client_cert as inlined data or %NULL if not used - * @client_cert_blob_len: client_cert_blob length - * @private_key: File or reference name for client private key in PEM or DER - * format (traditional format (RSA PRIVATE KEY) or PKCS#8 (PRIVATE KEY) - * @private_key_blob: private_key as inlined data or %NULL if not used - * @private_key_blob_len: private_key_blob length - * @private_key_passwd: Passphrase for decrypted private key, %NULL if no - * passphrase is used. - * @dh_file: File name for DH/DSA data in PEM format, or %NULL if not used - * @dh_blob: dh_file as inlined data or %NULL if not used - * @dh_blob_len: dh_blob length - * @engine: 1 = use engine (e.g., a smartcard) for private key operations - * (this is OpenSSL specific for now) - * @engine_id: engine id string (this is OpenSSL specific for now) - * @ppin: pointer to the pin variable in the configuration - * (this is OpenSSL specific for now) - * @key_id: the private key's id when using engine (this is OpenSSL - * specific for now) - * @cert_id: the certificate's id when using engine - * @ca_cert_id: the CA certificate's id when using engine - * @flags: Parameter options (TLS_CONN_*) - * @ocsp_stapling_response: DER encoded file with cached OCSP stapling response - * or %NULL if OCSP is not enabled - * - * TLS connection parameters to be configured with tls_connection_set_params() - * and tls_global_set_params(). - * - * Certificates and private key can be configured either as a reference name - * (file path or reference to certificate store) or by providing the same data - * as a pointer to the data in memory. Only one option will be used for each - * field. - */ -struct tls_connection_params { - const char *ca_cert; - const u8 *ca_cert_blob; - size_t ca_cert_blob_len; - const char *ca_path; - const char *subject_match; - const char *altsubject_match; - const char *client_cert; - const u8 *client_cert_blob; - size_t client_cert_blob_len; - const char *private_key; - const u8 *private_key_blob; - size_t private_key_blob_len; - const char *private_key_passwd; - const char *dh_file; - const u8 *dh_blob; - size_t dh_blob_len; - - /* OpenSSL specific variables */ - int engine; - const char *engine_id; - const char *pin; - const char *key_id; - const char *cert_id; - const char *ca_cert_id; - - unsigned int flags; - const char *ocsp_stapling_response; -}; - - -/** - * tls_init - Initialize TLS library - * @conf: Configuration data for TLS library - * Returns: Context data to be used as tls_ctx in calls to other functions, - * or %NULL on failure. - * - * Called once during program startup and once for each RSN pre-authentication - * session. In other words, there can be two concurrent TLS contexts. If global - * library initialization is needed (i.e., one that is shared between both - * authentication types), the TLS library wrapper should maintain a reference - * counter and do global initialization only when moving from 0 to 1 reference. - */ -void * tls_init(void); - -/** - * tls_deinit - Deinitialize TLS library - * @tls_ctx: TLS context data from tls_init() - * - * Called once during program shutdown and once for each RSN pre-authentication - * session. If global library deinitialization is needed (i.e., one that is - * shared between both authentication types), the TLS library wrapper should - * maintain a reference counter and do global deinitialization only when moving - * from 1 to 0 references. - */ -void tls_deinit(void *tls_ctx); - -/** - * tls_get_errors - Process pending errors - * @tls_ctx: TLS context data from tls_init() - * Returns: Number of found error, 0 if no errors detected. - * - * Process all pending TLS errors. - */ -int tls_get_errors(void *tls_ctx); - -/** - * tls_connection_init - Initialize a new TLS connection - * @tls_ctx: TLS context data from tls_init() - * Returns: Connection context data, conn for other function calls - */ -struct tls_connection * tls_connection_init(void *tls_ctx); - -/** - * tls_connection_deinit - Free TLS connection data - * @tls_ctx: TLS context data from tls_init() - * @conn: Connection context data from tls_connection_init() - * - * Release all resources allocated for TLS connection. - */ -void tls_connection_deinit(void *tls_ctx, struct tls_connection *conn); - -/** - * tls_connection_established - Has the TLS connection been completed? - * @tls_ctx: TLS context data from tls_init() - * @conn: Connection context data from tls_connection_init() - * Returns: 1 if TLS connection has been completed, 0 if not. - */ -int tls_connection_established(void *tls_ctx, struct tls_connection *conn); - -/** - * tls_connection_shutdown - Shutdown TLS connection - * @tls_ctx: TLS context data from tls_init() - * @conn: Connection context data from tls_connection_init() - * Returns: 0 on success, -1 on failure - * - * Shutdown current TLS connection without releasing all resources. New - * connection can be started by using the same conn without having to call - * tls_connection_init() or setting certificates etc. again. The new - * connection should try to use session resumption. - */ -int tls_connection_shutdown(void *tls_ctx, struct tls_connection *conn); - -enum { - TLS_SET_PARAMS_ENGINE_PRV_VERIFY_FAILED = -3, - TLS_SET_PARAMS_ENGINE_PRV_INIT_FAILED = -2 -}; - -/** - * tls_connection_set_params - Set TLS connection parameters - * @tls_ctx: TLS context data from tls_init() - * @conn: Connection context data from tls_connection_init() - * @params: Connection parameters - * Returns: 0 on success, -1 on failure, - * TLS_SET_PARAMS_ENGINE_PRV_INIT_FAILED (-2) on possible PIN error causing - * PKCS#11 engine failure, or - * TLS_SET_PARAMS_ENGINE_PRV_VERIFY_FAILED (-3) on failure to verify the - * PKCS#11 engine private key. - */ -int __must_check -tls_connection_set_params(void *tls_ctx, struct tls_connection *conn, - const struct tls_connection_params *params); - -/** - * tls_global_set_params - Set TLS parameters for all TLS connection - * @tls_ctx: TLS context data from tls_init() - * @params: Global TLS parameters - * Returns: 0 on success, -1 on failure, - * TLS_SET_PARAMS_ENGINE_PRV_INIT_FAILED (-2) on possible PIN error causing - * PKCS#11 engine failure, or - * TLS_SET_PARAMS_ENGINE_PRV_VERIFY_FAILED (-3) on failure to verify the - * PKCS#11 engine private key. - */ -int __must_check tls_global_set_params( - void *tls_ctx, const struct tls_connection_params *params); - -/** - * tls_global_set_verify - Set global certificate verification options - * @tls_ctx: TLS context data from tls_init() - * @check_crl: 0 = do not verify CRLs, 1 = verify CRL for the user certificate, - * 2 = verify CRL for all certificates - * Returns: 0 on success, -1 on failure - */ -int __must_check tls_global_set_verify(void *tls_ctx, int check_crl); - -/** - * tls_connection_set_verify - Set certificate verification options - * @tls_ctx: TLS context data from tls_init() - * @conn: Connection context data from tls_connection_init() - * @verify_peer: 1 = verify peer certificate - * Returns: 0 on success, -1 on failure - */ -int __must_check tls_connection_set_verify(void *tls_ctx, - struct tls_connection *conn, - int verify_peer); - -/** - * tls_connection_get_keys - Get master key and random data from TLS connection - * @tls_ctx: TLS context data from tls_init() - * @conn: Connection context data from tls_connection_init() - * @keys: Structure of key/random data (filled on success) - * Returns: 0 on success, -1 on failure - */ -int __must_check tls_connection_get_keys(void *tls_ctx, - struct tls_connection *conn, - struct tls_keys *keys); - -/** - * tls_connection_prf - Use TLS-PRF to derive keying material - * @tls_ctx: TLS context data from tls_init() - * @conn: Connection context data from tls_connection_init() - * @label: Label (e.g., description of the key) for PRF - * @server_random_first: seed is 0 = client_random|server_random, - * 1 = server_random|client_random - * @out: Buffer for output data from TLS-PRF - * @out_len: Length of the output buffer - * Returns: 0 on success, -1 on failure - * - * This function is optional to implement if tls_connection_get_keys() provides - * access to master secret and server/client random values. If these values are - * not exported from the TLS library, tls_connection_prf() is required so that - * further keying material can be derived from the master secret. If not - * implemented, the function will still need to be defined, but it can just - * return -1. Example implementation of this function is in tls_prf_sha1_md5() - * when it is called with seed set to client_random|server_random (or - * server_random|client_random). - */ -int __must_check tls_connection_prf(void *tls_ctx, - struct tls_connection *conn, - const char *label, - int server_random_first, - u8 *out, size_t out_len); - -/** - * tls_connection_handshake - Process TLS handshake (client side) - * @tls_ctx: TLS context data from tls_init() - * @conn: Connection context data from tls_connection_init() - * @in_data: Input data from TLS server - * @appl_data: Pointer to application data pointer, or %NULL if dropped - * Returns: Output data, %NULL on failure - * - * The caller is responsible for freeing the returned output data. If the final - * handshake message includes application data, this is decrypted and - * appl_data (if not %NULL) is set to point this data. The caller is - * responsible for freeing appl_data. - * - * This function is used during TLS handshake. The first call is done with - * in_data == %NULL and the library is expected to return ClientHello packet. - * This packet is then send to the server and a response from server is given - * to TLS library by calling this function again with in_data pointing to the - * TLS message from the server. - * - * If the TLS handshake fails, this function may return %NULL. However, if the - * TLS library has a TLS alert to send out, that should be returned as the - * output data. In this case, tls_connection_get_failed() must return failure - * (> 0). - * - * tls_connection_established() should return 1 once the TLS handshake has been - * completed successfully. - */ -struct wpabuf * tls_connection_handshake(void *tls_ctx, - struct tls_connection *conn, - const struct wpabuf *in_data, - struct wpabuf **appl_data); - -struct wpabuf * tls_connection_handshake2(void *tls_ctx, - struct tls_connection *conn, - const struct wpabuf *in_data, - struct wpabuf **appl_data, - int *more_data_needed); - -/** - * tls_connection_server_handshake - Process TLS handshake (server side) - * @tls_ctx: TLS context data from tls_init() - * @conn: Connection context data from tls_connection_init() - * @in_data: Input data from TLS peer - * @appl_data: Pointer to application data pointer, or %NULL if dropped - * Returns: Output data, %NULL on failure - * - * The caller is responsible for freeing the returned output data. - */ -struct wpabuf * tls_connection_server_handshake(void *tls_ctx, - struct tls_connection *conn, - const struct wpabuf *in_data, - struct wpabuf **appl_data); - -/** - * tls_connection_encrypt - Encrypt data into TLS tunnel - * @tls_ctx: TLS context data from tls_init() - * @conn: Connection context data from tls_connection_init() - * @in_data: Plaintext data to be encrypted - * Returns: Encrypted TLS data or %NULL on failure - * - * This function is used after TLS handshake has been completed successfully to - * send data in the encrypted tunnel. The caller is responsible for freeing the - * returned output data. - */ -struct wpabuf * tls_connection_encrypt(void *tls_ctx, - struct tls_connection *conn, - const struct wpabuf *in_data); - -/** - * tls_connection_decrypt - Decrypt data from TLS tunnel - * @tls_ctx: TLS context data from tls_init() - * @conn: Connection context data from tls_connection_init() - * @in_data: Encrypted TLS data - * Returns: Decrypted TLS data or %NULL on failure - * - * This function is used after TLS handshake has been completed successfully to - * receive data from the encrypted tunnel. The caller is responsible for - * freeing the returned output data. - */ -struct wpabuf * tls_connection_decrypt(void *tls_ctx, - struct tls_connection *conn, - const struct wpabuf *in_data); - -struct wpabuf * tls_connection_decrypt2(void *tls_ctx, - struct tls_connection *conn, - const struct wpabuf *in_data, - int *more_data_needed); - -/** - * tls_connection_resumed - Was session resumption used - * @tls_ctx: TLS context data from tls_init() - * @conn: Connection context data from tls_connection_init() - * Returns: 1 if current session used session resumption, 0 if not - */ -int tls_connection_resumed(void *tls_ctx, struct tls_connection *conn); - -enum { - TLS_CIPHER_NONE, - TLS_CIPHER_RC4_SHA /* 0x0005 */, - TLS_CIPHER_AES128_SHA /* 0x002f */, - TLS_CIPHER_RSA_DHE_AES128_SHA /* 0x0031 */, - TLS_CIPHER_ANON_DH_AES128_SHA /* 0x0034 */ -}; - -/** - * tls_connection_set_cipher_list - Configure acceptable cipher suites - * @tls_ctx: TLS context data from tls_init() - * @conn: Connection context data from tls_connection_init() - * @ciphers: Zero (TLS_CIPHER_NONE) terminated list of allowed ciphers - * (TLS_CIPHER_*). - * Returns: 0 on success, -1 on failure - */ -int __must_check tls_connection_set_cipher_list(void *tls_ctx, - struct tls_connection *conn, - u8 *ciphers); - -/** - * tls_get_cipher - Get current cipher name - * @tls_ctx: TLS context data from tls_init() - * @conn: Connection context data from tls_connection_init() - * @buf: Buffer for the cipher name - * @buflen: buf size - * Returns: 0 on success, -1 on failure - * - * Get the name of the currently used cipher. - */ -int __must_check tls_get_cipher(void *tls_ctx, struct tls_connection *conn, - char *buf, size_t buflen); - -/** - * tls_connection_enable_workaround - Enable TLS workaround options - * @tls_ctx: TLS context data from tls_init() - * @conn: Connection context data from tls_connection_init() - * Returns: 0 on success, -1 on failure - * - * This function is used to enable connection-specific workaround options for - * buffer SSL/TLS implementations. - */ -int __must_check tls_connection_enable_workaround(void *tls_ctx, - struct tls_connection *conn); - -/** - * tls_connection_client_hello_ext - Set TLS extension for ClientHello - * @tls_ctx: TLS context data from tls_init() - * @conn: Connection context data from tls_connection_init() - * @ext_type: Extension type - * @data: Extension payload (%NULL to remove extension) - * @data_len: Extension payload length - * Returns: 0 on success, -1 on failure - */ -int __must_check tls_connection_client_hello_ext(void *tls_ctx, - struct tls_connection *conn, - int ext_type, const u8 *data, - size_t data_len); - -/** - * tls_connection_get_failed - Get connection failure status - * @tls_ctx: TLS context data from tls_init() - * @conn: Connection context data from tls_connection_init() - * - * Returns >0 if connection has failed, 0 if not. - */ -int tls_connection_get_failed(void *tls_ctx, struct tls_connection *conn); - -/** - * tls_connection_get_read_alerts - Get connection read alert status - * @tls_ctx: TLS context data from tls_init() - * @conn: Connection context data from tls_connection_init() - * Returns: Number of times a fatal read (remote end reported error) has - * happened during this connection. - */ -int tls_connection_get_read_alerts(void *tls_ctx, struct tls_connection *conn); - -/** - * tls_connection_get_write_alerts - Get connection write alert status - * @tls_ctx: TLS context data from tls_init() - * @conn: Connection context data from tls_connection_init() - * Returns: Number of times a fatal write (locally detected error) has happened - * during this connection. - */ -int tls_connection_get_write_alerts(void *tls_ctx, - struct tls_connection *conn); - -/** - * tls_connection_get_keyblock_size - Get TLS key_block size - * @tls_ctx: TLS context data from tls_init() - * @conn: Connection context data from tls_connection_init() - * Returns: Size of the key_block for the negotiated cipher suite or -1 on - * failure - */ -int tls_connection_get_keyblock_size(void *tls_ctx, - struct tls_connection *conn); - -/** - * tls_capabilities - Get supported TLS capabilities - * @tls_ctx: TLS context data from tls_init() - * Returns: Bit field of supported TLS capabilities (TLS_CAPABILITY_*) - */ -unsigned int tls_capabilities(void *tls_ctx); - -typedef int (*tls_session_ticket_cb) -(void *ctx, const u8 *ticket, size_t len, const u8 *client_random, - const u8 *server_random, u8 *master_secret); - -int __must_check tls_connection_set_session_ticket_cb( - void *tls_ctx, struct tls_connection *conn, - tls_session_ticket_cb cb, void *ctx); - -int tls_prf_sha1_md5(const u8 *secret, size_t secret_len, const char *label, - const u8 *seed, size_t seed_len, u8 *out, size_t outlen); - -#endif /* TLS_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/tls/tlsv1_client.h b/tools/sdk/include/wpa_supplicant/wpa2/tls/tlsv1_client.h deleted file mode 100644 index 8ec85f1a919..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/tls/tlsv1_client.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * TLS v1.0/v1.1/v1.2 client (RFC 2246, RFC 4346, RFC 5246) - * Copyright (c) 2006-2011, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef TLSV1_CLIENT_H -#define TLSV1_CLIENT_H - -#include "tlsv1_cred.h" - -struct tlsv1_client; - -int tlsv1_client_global_init(void); -void tlsv1_client_global_deinit(void); -struct tlsv1_client * tlsv1_client_init(void); -void tlsv1_client_deinit(struct tlsv1_client *conn); -int tlsv1_client_established(struct tlsv1_client *conn); -int tlsv1_client_prf(struct tlsv1_client *conn, const char *label, - int server_random_first, u8 *out, size_t out_len); -u8 * tlsv1_client_handshake(struct tlsv1_client *conn, - const u8 *in_data, size_t in_len, - size_t *out_len, u8 **appl_data, - size_t *appl_data_len, int *need_more_data); -int tlsv1_client_encrypt(struct tlsv1_client *conn, - const u8 *in_data, size_t in_len, - u8 *out_data, size_t out_len); -struct wpabuf * tlsv1_client_decrypt(struct tlsv1_client *conn, - const u8 *in_data, size_t in_len, - int *need_more_data); -int tlsv1_client_get_cipher(struct tlsv1_client *conn, char *buf, - size_t buflen); -int tlsv1_client_shutdown(struct tlsv1_client *conn); -int tlsv1_client_resumed(struct tlsv1_client *conn); -int tlsv1_client_hello_ext(struct tlsv1_client *conn, int ext_type, - const u8 *data, size_t data_len); -int tlsv1_client_get_keys(struct tlsv1_client *conn, struct tls_keys *keys); -int tlsv1_client_get_keyblock_size(struct tlsv1_client *conn); -int tlsv1_client_set_cipher_list(struct tlsv1_client *conn, u8 *ciphers); -int tlsv1_client_set_cred(struct tlsv1_client *conn, - struct tlsv1_credentials *cred); -void tlsv1_client_set_time_checks(struct tlsv1_client *conn, int enabled); - -typedef int (*tlsv1_client_session_ticket_cb) -(void *ctx, const u8 *ticket, size_t len, const u8 *client_random, - const u8 *server_random, u8 *master_secret); - -void tlsv1_client_set_session_ticket_cb(struct tlsv1_client *conn, - tlsv1_client_session_ticket_cb cb, - void *ctx); - -#endif /* TLSV1_CLIENT_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/tls/tlsv1_client_i.h b/tools/sdk/include/wpa_supplicant/wpa2/tls/tlsv1_client_i.h deleted file mode 100644 index 55fdcf8d043..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/tls/tlsv1_client_i.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * TLSv1 client - internal structures - * Copyright (c) 2006-2011, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef TLSV1_CLIENT_I_H -#define TLSV1_CLIENT_I_H - -struct tlsv1_client { - enum { - CLIENT_HELLO, SERVER_HELLO, SERVER_CERTIFICATE, - SERVER_KEY_EXCHANGE, SERVER_CERTIFICATE_REQUEST, - SERVER_HELLO_DONE, CLIENT_KEY_EXCHANGE, CHANGE_CIPHER_SPEC, - SERVER_CHANGE_CIPHER_SPEC, SERVER_FINISHED, ACK_FINISHED, - ESTABLISHED, FAILED - } state; - - struct tlsv1_record_layer rl; - - u8 session_id[TLS_SESSION_ID_MAX_LEN]; - size_t session_id_len; - u8 client_random[TLS_RANDOM_LEN]; - u8 server_random[TLS_RANDOM_LEN]; - u8 master_secret[TLS_MASTER_SECRET_LEN]; - - u8 alert_level; - u8 alert_description; - - unsigned int certificate_requested:1; - unsigned int session_resumed:1; - unsigned int session_ticket_included:1; - unsigned int use_session_ticket:1; - unsigned int disable_time_checks:1; - - struct crypto_public_key *server_rsa_key; - - struct tls_verify_hash verify; - -#define MAX_CIPHER_COUNT 30 - u16 cipher_suites[MAX_CIPHER_COUNT]; - size_t num_cipher_suites; - - u16 prev_cipher_suite; - - u8 *client_hello_ext; - size_t client_hello_ext_len; - - /* The prime modulus used for Diffie-Hellman */ - u8 *dh_p; - size_t dh_p_len; - /* The generator used for Diffie-Hellman */ - u8 *dh_g; - size_t dh_g_len; - /* The server's Diffie-Hellman public value */ - u8 *dh_ys; - size_t dh_ys_len; - - struct tlsv1_credentials *cred; - - tlsv1_client_session_ticket_cb session_ticket_cb; - void *session_ticket_cb_ctx; - - struct wpabuf *partial_input; -}; - - -void tls_alert(struct tlsv1_client *conn, u8 level, u8 description); -void tlsv1_client_free_dh(struct tlsv1_client *conn); -int tls_derive_pre_master_secret(u8 *pre_master_secret); -int tls_derive_keys(struct tlsv1_client *conn, - const u8 *pre_master_secret, size_t pre_master_secret_len); -u8 * tls_send_client_hello(struct tlsv1_client *conn, size_t *out_len); -u8 * tlsv1_client_send_alert(struct tlsv1_client *conn, u8 level, - u8 description, size_t *out_len); -u8 * tlsv1_client_handshake_write(struct tlsv1_client *conn, size_t *out_len, - int no_appl_data); -int tlsv1_client_process_handshake(struct tlsv1_client *conn, u8 ct, - const u8 *buf, size_t *len, - u8 **out_data, size_t *out_len); - -#endif /* TLSV1_CLIENT_I_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/tls/tlsv1_common.h b/tools/sdk/include/wpa_supplicant/wpa2/tls/tlsv1_common.h deleted file mode 100644 index f28c0cdc479..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/tls/tlsv1_common.h +++ /dev/null @@ -1,261 +0,0 @@ -/* - * TLSv1 common definitions - * Copyright (c) 2006-2011, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef TLSV1_COMMON_H -#define TLSV1_COMMON_H - -#include "crypto/crypto.h" - -#define TLS_VERSION_1 0x0301 /* TLSv1 */ -#define TLS_VERSION_1_1 0x0302 /* TLSv1.1 */ -#define TLS_VERSION_1_2 0x0303 /* TLSv1.2 */ -#ifdef CONFIG_TLSV12 -#define TLS_VERSION TLS_VERSION_1_2 -#else /* CONFIG_TLSV12 */ -#ifdef CONFIG_TLSV11 -#define TLS_VERSION TLS_VERSION_1_1 -#else /* CONFIG_TLSV11 */ -#define TLS_VERSION TLS_VERSION_1 -#endif /* CONFIG_TLSV11 */ -#endif /* CONFIG_TLSV12 */ -#define TLS_RANDOM_LEN 32 -#define TLS_PRE_MASTER_SECRET_LEN 48 -#define TLS_MASTER_SECRET_LEN 48 -#define TLS_SESSION_ID_MAX_LEN 32 -#define TLS_VERIFY_DATA_LEN 12 - -/* HandshakeType */ -enum { - TLS_HANDSHAKE_TYPE_HELLO_REQUEST = 0, - TLS_HANDSHAKE_TYPE_CLIENT_HELLO = 1, - TLS_HANDSHAKE_TYPE_SERVER_HELLO = 2, - TLS_HANDSHAKE_TYPE_NEW_SESSION_TICKET = 4 /* RFC 4507 */, - TLS_HANDSHAKE_TYPE_CERTIFICATE = 11, - TLS_HANDSHAKE_TYPE_SERVER_KEY_EXCHANGE = 12, - TLS_HANDSHAKE_TYPE_CERTIFICATE_REQUEST = 13, - TLS_HANDSHAKE_TYPE_SERVER_HELLO_DONE = 14, - TLS_HANDSHAKE_TYPE_CERTIFICATE_VERIFY = 15, - TLS_HANDSHAKE_TYPE_CLIENT_KEY_EXCHANGE = 16, - TLS_HANDSHAKE_TYPE_FINISHED = 20, - TLS_HANDSHAKE_TYPE_CERTIFICATE_URL = 21 /* RFC 4366 */, - TLS_HANDSHAKE_TYPE_CERTIFICATE_STATUS = 22 /* RFC 4366 */ -}; - -/* CipherSuite */ -#define TLS_NULL_WITH_NULL_NULL 0x0000 /* RFC 2246 */ -#define TLS_RSA_WITH_NULL_MD5 0x0001 /* RFC 2246 */ -#define TLS_RSA_WITH_NULL_SHA 0x0002 /* RFC 2246 */ -#define TLS_RSA_EXPORT_WITH_RC4_40_MD5 0x0003 /* RFC 2246 */ -#define TLS_RSA_WITH_RC4_128_MD5 0x0004 /* RFC 2246 */ -#define TLS_RSA_WITH_RC4_128_SHA 0x0005 /* RFC 2246 */ -#define TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 0x0006 /* RFC 2246 */ -#define TLS_RSA_WITH_IDEA_CBC_SHA 0x0007 /* RFC 2246 */ -#define TLS_RSA_EXPORT_WITH_DES40_CBC_SHA 0x0008 /* RFC 2246 */ -#define TLS_RSA_WITH_DES_CBC_SHA 0x0009 /* RFC 2246 */ -#define TLS_RSA_WITH_3DES_EDE_CBC_SHA 0x000A /* RFC 2246 */ -#define TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA 0x000B /* RFC 2246 */ -#define TLS_DH_DSS_WITH_DES_CBC_SHA 0x000C /* RFC 2246 */ -#define TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA 0x000D /* RFC 2246 */ -#define TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA 0x000E /* RFC 2246 */ -#define TLS_DH_RSA_WITH_DES_CBC_SHA 0x000F /* RFC 2246 */ -#define TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA 0x0010 /* RFC 2246 */ -#define TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA 0x0011 /* RFC 2246 */ -#define TLS_DHE_DSS_WITH_DES_CBC_SHA 0x0012 /* RFC 2246 */ -#define TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA 0x0013 /* RFC 2246 */ -#define TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA 0x0014 /* RFC 2246 */ -#define TLS_DHE_RSA_WITH_DES_CBC_SHA 0x0015 /* RFC 2246 */ -#define TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA 0x0016 /* RFC 2246 */ -#define TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 0x0017 /* RFC 2246 */ -#define TLS_DH_anon_WITH_RC4_128_MD5 0x0018 /* RFC 2246 */ -#define TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA 0x0019 /* RFC 2246 */ -#define TLS_DH_anon_WITH_DES_CBC_SHA 0x001A /* RFC 2246 */ -#define TLS_DH_anon_WITH_3DES_EDE_CBC_SHA 0x001B /* RFC 2246 */ -#define TLS_RSA_WITH_AES_128_CBC_SHA 0x002F /* RFC 3268 */ -#define TLS_DH_DSS_WITH_AES_128_CBC_SHA 0x0030 /* RFC 3268 */ -#define TLS_DH_RSA_WITH_AES_128_CBC_SHA 0x0031 /* RFC 3268 */ -#define TLS_DHE_DSS_WITH_AES_128_CBC_SHA 0x0032 /* RFC 3268 */ -#define TLS_DHE_RSA_WITH_AES_128_CBC_SHA 0x0033 /* RFC 3268 */ -#define TLS_DH_anon_WITH_AES_128_CBC_SHA 0x0034 /* RFC 3268 */ -#define TLS_RSA_WITH_AES_256_CBC_SHA 0x0035 /* RFC 3268 */ -#define TLS_DH_DSS_WITH_AES_256_CBC_SHA 0x0036 /* RFC 3268 */ -#define TLS_DH_RSA_WITH_AES_256_CBC_SHA 0x0037 /* RFC 3268 */ -#define TLS_DHE_DSS_WITH_AES_256_CBC_SHA 0x0038 /* RFC 3268 */ -#define TLS_DHE_RSA_WITH_AES_256_CBC_SHA 0x0039 /* RFC 3268 */ -#define TLS_DH_anon_WITH_AES_256_CBC_SHA 0x003A /* RFC 3268 */ -#define TLS_RSA_WITH_NULL_SHA256 0x003B /* RFC 5246 */ -#define TLS_RSA_WITH_AES_128_CBC_SHA256 0x003C /* RFC 5246 */ -#define TLS_RSA_WITH_AES_256_CBC_SHA256 0x003D /* RFC 5246 */ -#define TLS_DH_DSS_WITH_AES_128_CBC_SHA256 0x003E /* RFC 5246 */ -#define TLS_DH_RSA_WITH_AES_128_CBC_SHA256 0x003F /* RFC 5246 */ -#define TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 0x0040 /* RFC 5246 */ -#define TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 0x0067 /* RFC 5246 */ -#define TLS_DH_DSS_WITH_AES_256_CBC_SHA256 0x0068 /* RFC 5246 */ -#define TLS_DH_RSA_WITH_AES_256_CBC_SHA256 0x0069 /* RFC 5246 */ -#define TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 0x006A /* RFC 5246 */ -#define TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 0x006B /* RFC 5246 */ -#define TLS_DH_anon_WITH_AES_128_CBC_SHA256 0x006C /* RFC 5246 */ -#define TLS_DH_anon_WITH_AES_256_CBC_SHA256 0x006D /* RFC 5246 */ - -/* CompressionMethod */ -#define TLS_COMPRESSION_NULL 0 - -/* HashAlgorithm */ -enum { - TLS_HASH_ALG_NONE = 0, - TLS_HASH_ALG_MD5 = 1, - TLS_HASH_ALG_SHA1 = 2, - TLS_HASH_ALG_SHA224 = 3, - TLS_HASH_ALG_SHA256 = 4, - TLS_HASH_ALG_SHA384 = 5, - TLS_HASH_ALG_SHA512 = 6 -}; - -/* SignatureAlgorithm */ -enum { - TLS_SIGN_ALG_ANONYMOUS = 0, - TLS_SIGN_ALG_RSA = 1, - TLS_SIGN_ALG_DSA = 2, - TLS_SIGN_ALG_ECDSA = 3, -}; - -/* AlertLevel */ -#define TLS_ALERT_LEVEL_WARNING 1 -#define TLS_ALERT_LEVEL_FATAL 2 - -/* AlertDescription */ -#define TLS_ALERT_CLOSE_NOTIFY 0 -#define TLS_ALERT_UNEXPECTED_MESSAGE 10 -#define TLS_ALERT_BAD_RECORD_MAC 20 -#define TLS_ALERT_DECRYPTION_FAILED 21 -#define TLS_ALERT_RECORD_OVERFLOW 22 -#define TLS_ALERT_DECOMPRESSION_FAILURE 30 -#define TLS_ALERT_HANDSHAKE_FAILURE 40 -#define TLS_ALERT_BAD_CERTIFICATE 42 -#define TLS_ALERT_UNSUPPORTED_CERTIFICATE 43 -#define TLS_ALERT_CERTIFICATE_REVOKED 44 -#define TLS_ALERT_CERTIFICATE_EXPIRED 45 -#define TLS_ALERT_CERTIFICATE_UNKNOWN 46 -#define TLS_ALERT_ILLEGAL_PARAMETER 47 -#define TLS_ALERT_UNKNOWN_CA 48 -#define TLS_ALERT_ACCESS_DENIED 49 -#define TLS_ALERT_DECODE_ERROR 50 -#define TLS_ALERT_DECRYPT_ERROR 51 -#define TLS_ALERT_EXPORT_RESTRICTION 60 -#define TLS_ALERT_PROTOCOL_VERSION 70 -#define TLS_ALERT_INSUFFICIENT_SECURITY 71 -#define TLS_ALERT_INTERNAL_ERROR 80 -#define TLS_ALERT_USER_CANCELED 90 -#define TLS_ALERT_NO_RENEGOTIATION 100 -#define TLS_ALERT_UNSUPPORTED_EXTENSION 110 /* RFC 4366 */ -#define TLS_ALERT_CERTIFICATE_UNOBTAINABLE 111 /* RFC 4366 */ -#define TLS_ALERT_UNRECOGNIZED_NAME 112 /* RFC 4366 */ -#define TLS_ALERT_BAD_CERTIFICATE_STATUS_RESPONSE 113 /* RFC 4366 */ -#define TLS_ALERT_BAD_CERTIFICATE_HASH_VALUE 114 /* RFC 4366 */ - -/* ChangeCipherSpec */ -enum { - TLS_CHANGE_CIPHER_SPEC = 1 -}; - -/* TLS Extensions */ -#define TLS_EXT_SERVER_NAME 0 /* RFC 4366 */ -#define TLS_EXT_MAX_FRAGMENT_LENGTH 1 /* RFC 4366 */ -#define TLS_EXT_CLIENT_CERTIFICATE_URL 2 /* RFC 4366 */ -#define TLS_EXT_TRUSTED_CA_KEYS 3 /* RFC 4366 */ -#define TLS_EXT_TRUNCATED_HMAC 4 /* RFC 4366 */ -#define TLS_EXT_STATUS_REQUEST 5 /* RFC 4366 */ -#define TLS_EXT_SESSION_TICKET 35 /* RFC 4507 */ - -#define TLS_EXT_PAC_OPAQUE TLS_EXT_SESSION_TICKET /* EAP-FAST terminology */ - - -typedef enum { - TLS_KEY_X_NULL, - TLS_KEY_X_RSA, - TLS_KEY_X_RSA_EXPORT, - TLS_KEY_X_DH_DSS_EXPORT, - TLS_KEY_X_DH_DSS, - TLS_KEY_X_DH_RSA_EXPORT, - TLS_KEY_X_DH_RSA, - TLS_KEY_X_DHE_DSS_EXPORT, - TLS_KEY_X_DHE_DSS, - TLS_KEY_X_DHE_RSA_EXPORT, - TLS_KEY_X_DHE_RSA, - TLS_KEY_X_DH_anon_EXPORT, - TLS_KEY_X_DH_anon -} tls_key_exchange; - -typedef enum { - TLS_CIPHER_NULL, - TLS_CIPHER_RC4_40, - TLS_CIPHER_RC4_128, - TLS_CIPHER_RC2_CBC_40, - TLS_CIPHER_IDEA_CBC, - TLS_CIPHER_DES40_CBC, - TLS_CIPHER_DES_CBC, - TLS_CIPHER_3DES_EDE_CBC, - TLS_CIPHER_AES_128_CBC, - TLS_CIPHER_AES_256_CBC -} tls_cipher; - -typedef enum { - TLS_HASH_NULL, - TLS_HASH_MD5, - TLS_HASH_SHA, - TLS_HASH_SHA256 -} tls_hash; - -struct tls_cipher_suite { - u16 suite; - tls_key_exchange key_exchange; - tls_cipher cipher; - tls_hash hash; -}; - -typedef enum { - TLS_CIPHER_STREAM, - TLS_CIPHER_BLOCK -} tls_cipher_type; - -struct tls_cipher_data { - tls_cipher cipher; - tls_cipher_type type; - size_t key_material; - size_t expanded_key_material; - size_t block_size; /* also iv_size */ - enum crypto_cipher_alg alg; -}; - - -struct tls_verify_hash { - struct crypto_hash *md5_client; - struct crypto_hash *sha1_client; - struct crypto_hash *sha256_client; - struct crypto_hash *md5_server; - struct crypto_hash *sha1_server; - struct crypto_hash *sha256_server; - struct crypto_hash *md5_cert; - struct crypto_hash *sha1_cert; - struct crypto_hash *sha256_cert; -}; - - -const struct tls_cipher_suite * tls_get_cipher_suite(u16 suite); -const struct tls_cipher_data * tls_get_cipher_data(tls_cipher cipher); -int tls_server_key_exchange_allowed(tls_cipher cipher); -int tls_parse_cert(const u8 *buf, size_t len, struct crypto_public_key **pk); -int tls_verify_hash_init(struct tls_verify_hash *verify); -void tls_verify_hash_add(struct tls_verify_hash *verify, const u8 *buf, - size_t len); -void tls_verify_hash_free(struct tls_verify_hash *verify); -int tls_version_ok(u16 ver); -const char * tls_version_str(u16 ver); -int tls_prf(u16 ver, const u8 *secret, size_t secret_len, const char *label, - const u8 *seed, size_t seed_len, u8 *out, size_t outlen); - -#endif /* TLSV1_COMMON_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/tls/tlsv1_cred.h b/tools/sdk/include/wpa_supplicant/wpa2/tls/tlsv1_cred.h deleted file mode 100644 index 68fbdc92300..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/tls/tlsv1_cred.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * TLSv1 credentials - * Copyright (c) 2006-2007, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef TLSV1_CRED_H -#define TLSV1_CRED_H - -struct tlsv1_credentials { - struct x509_certificate *trusted_certs; - struct x509_certificate *cert; - struct crypto_private_key *key; - - /* Diffie-Hellman parameters */ - u8 *dh_p; /* prime */ - size_t dh_p_len; - u8 *dh_g; /* generator */ - size_t dh_g_len; -}; - - -struct tlsv1_credentials * tlsv1_cred_alloc(void); -void tlsv1_cred_free(struct tlsv1_credentials *cred); -int tlsv1_set_ca_cert(struct tlsv1_credentials *cred, const char *cert, - const u8 *cert_blob, size_t cert_blob_len, - const char *path); -int tlsv1_set_cert(struct tlsv1_credentials *cred, const char *cert, - const u8 *cert_blob, size_t cert_blob_len); -int tlsv1_set_private_key(struct tlsv1_credentials *cred, - const char *private_key, - const char *private_key_passwd, - const u8 *private_key_blob, - size_t private_key_blob_len); -int tlsv1_set_dhparams(struct tlsv1_credentials *cred, const char *dh_file, - const u8 *dh_blob, size_t dh_blob_len); - -#endif /* TLSV1_CRED_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/tls/tlsv1_record.h b/tools/sdk/include/wpa_supplicant/wpa2/tls/tlsv1_record.h deleted file mode 100644 index 48abcb0d25c..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/tls/tlsv1_record.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * TLSv1 Record Protocol - * Copyright (c) 2006-2011, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef TLSV1_RECORD_H -#define TLSV1_RECORD_H - -#include "crypto/crypto.h" - -#define TLS_MAX_WRITE_MAC_SECRET_LEN 32 -#define TLS_MAX_WRITE_KEY_LEN 32 -#define TLS_MAX_IV_LEN 16 -#define TLS_MAX_KEY_BLOCK_LEN (2 * (TLS_MAX_WRITE_MAC_SECRET_LEN + \ - TLS_MAX_WRITE_KEY_LEN + TLS_MAX_IV_LEN)) - -#define TLS_SEQ_NUM_LEN 8 -#define TLS_RECORD_HEADER_LEN 5 - -/* ContentType */ -enum { - TLS_CONTENT_TYPE_CHANGE_CIPHER_SPEC = 20, - TLS_CONTENT_TYPE_ALERT = 21, - TLS_CONTENT_TYPE_HANDSHAKE = 22, - TLS_CONTENT_TYPE_APPLICATION_DATA = 23 -}; - -struct tlsv1_record_layer { - u16 tls_version; - - u8 write_mac_secret[TLS_MAX_WRITE_MAC_SECRET_LEN]; - u8 read_mac_secret[TLS_MAX_WRITE_MAC_SECRET_LEN]; - u8 write_key[TLS_MAX_WRITE_KEY_LEN]; - u8 read_key[TLS_MAX_WRITE_KEY_LEN]; - u8 write_iv[TLS_MAX_IV_LEN]; - u8 read_iv[TLS_MAX_IV_LEN]; - - size_t hash_size; - size_t key_material_len; - size_t iv_size; /* also block_size */ - - enum crypto_hash_alg hash_alg; - enum crypto_cipher_alg cipher_alg; - - u8 write_seq_num[TLS_SEQ_NUM_LEN]; - u8 read_seq_num[TLS_SEQ_NUM_LEN]; - - u16 cipher_suite; - u16 write_cipher_suite; - u16 read_cipher_suite; - - struct crypto_cipher *write_cbc; - struct crypto_cipher *read_cbc; -}; - - -int tlsv1_record_set_cipher_suite(struct tlsv1_record_layer *rl, - u16 cipher_suite); -int tlsv1_record_change_write_cipher(struct tlsv1_record_layer *rl); -int tlsv1_record_change_read_cipher(struct tlsv1_record_layer *rl); -int tlsv1_record_send(struct tlsv1_record_layer *rl, u8 content_type, u8 *buf, - size_t buf_size, const u8 *payload, size_t payload_len, - size_t *out_len); -int tlsv1_record_receive(struct tlsv1_record_layer *rl, - const u8 *in_data, size_t in_len, - u8 *out_data, size_t *out_len, u8 *alert); - -#endif /* TLSV1_RECORD_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/tls/tlsv1_server.h b/tools/sdk/include/wpa_supplicant/wpa2/tls/tlsv1_server.h deleted file mode 100644 index a18c69e37c1..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/tls/tlsv1_server.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * TLS v1.0/v1.1/v1.2 server (RFC 2246, RFC 4346, RFC 5246) - * Copyright (c) 2006-2011, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef TLSV1_SERVER_H -#define TLSV1_SERVER_H - -#include "tlsv1_cred.h" - -struct tlsv1_server; - -int tlsv1_server_global_init(void); -void tlsv1_server_global_deinit(void); -struct tlsv1_server * tlsv1_server_init(struct tlsv1_credentials *cred); -void tlsv1_server_deinit(struct tlsv1_server *conn); -int tlsv1_server_established(struct tlsv1_server *conn); -int tlsv1_server_prf(struct tlsv1_server *conn, const char *label, - int server_random_first, u8 *out, size_t out_len); -u8 * tlsv1_server_handshake(struct tlsv1_server *conn, - const u8 *in_data, size_t in_len, size_t *out_len); -int tlsv1_server_encrypt(struct tlsv1_server *conn, - const u8 *in_data, size_t in_len, - u8 *out_data, size_t out_len); -int tlsv1_server_decrypt(struct tlsv1_server *conn, - const u8 *in_data, size_t in_len, - u8 *out_data, size_t out_len); -int tlsv1_server_get_cipher(struct tlsv1_server *conn, char *buf, - size_t buflen); -int tlsv1_server_shutdown(struct tlsv1_server *conn); -int tlsv1_server_resumed(struct tlsv1_server *conn); -int tlsv1_server_get_keys(struct tlsv1_server *conn, struct tls_keys *keys); -int tlsv1_server_get_keyblock_size(struct tlsv1_server *conn); -int tlsv1_server_set_cipher_list(struct tlsv1_server *conn, u8 *ciphers); -int tlsv1_server_set_verify(struct tlsv1_server *conn, int verify_peer); - -typedef int (*tlsv1_server_session_ticket_cb) -(void *ctx, const u8 *ticket, size_t len, const u8 *client_random, - const u8 *server_random, u8 *master_secret); - -void tlsv1_server_set_session_ticket_cb(struct tlsv1_server *conn, - tlsv1_server_session_ticket_cb cb, - void *ctx); - -#endif /* TLSV1_SERVER_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/tls/tlsv1_server_i.h b/tools/sdk/include/wpa_supplicant/wpa2/tls/tlsv1_server_i.h deleted file mode 100644 index 1f61533a5aa..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/tls/tlsv1_server_i.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * TLSv1 server - internal structures - * Copyright (c) 2006-2007, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef TLSV1_SERVER_I_H -#define TLSV1_SERVER_I_H - -struct tlsv1_server { - enum { - CLIENT_HELLO, SERVER_HELLO, SERVER_CERTIFICATE, - SERVER_KEY_EXCHANGE, SERVER_CERTIFICATE_REQUEST, - SERVER_HELLO_DONE, CLIENT_CERTIFICATE, CLIENT_KEY_EXCHANGE, - CERTIFICATE_VERIFY, CHANGE_CIPHER_SPEC, CLIENT_FINISHED, - SERVER_CHANGE_CIPHER_SPEC, SERVER_FINISHED, - ESTABLISHED, FAILED - } state; - - struct tlsv1_record_layer rl; - - u8 session_id[TLS_SESSION_ID_MAX_LEN]; - size_t session_id_len; - u8 client_random[TLS_RANDOM_LEN]; - u8 server_random[TLS_RANDOM_LEN]; - u8 master_secret[TLS_MASTER_SECRET_LEN]; - - u8 alert_level; - u8 alert_description; - - struct crypto_public_key *client_rsa_key; - - struct tls_verify_hash verify; - -#define MAX_CIPHER_COUNT 30 - u16 cipher_suites[MAX_CIPHER_COUNT]; - size_t num_cipher_suites; - - u16 cipher_suite; - - struct tlsv1_credentials *cred; - - int verify_peer; - u16 client_version; - - u8 *session_ticket; - size_t session_ticket_len; - - tlsv1_server_session_ticket_cb session_ticket_cb; - void *session_ticket_cb_ctx; - - int use_session_ticket; - - u8 *dh_secret; - size_t dh_secret_len; -}; - - -void tlsv1_server_alert(struct tlsv1_server *conn, u8 level, u8 description); -int tlsv1_server_derive_keys(struct tlsv1_server *conn, - const u8 *pre_master_secret, - size_t pre_master_secret_len); -u8 * tlsv1_server_handshake_write(struct tlsv1_server *conn, size_t *out_len); -u8 * tlsv1_server_send_alert(struct tlsv1_server *conn, u8 level, - u8 description, size_t *out_len); -int tlsv1_server_process_handshake(struct tlsv1_server *conn, u8 ct, - const u8 *buf, size_t *len); - -#endif /* TLSV1_SERVER_I_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/tls/x509v3.h b/tools/sdk/include/wpa_supplicant/wpa2/tls/x509v3.h deleted file mode 100644 index 91a35baf92b..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/tls/x509v3.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * X.509v3 certificate parsing and processing - * Copyright (c) 2006-2011, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef X509V3_H -#define X509V3_H - -#include "asn1.h" - -struct x509_algorithm_identifier { - struct asn1_oid oid; -}; - -struct x509_name_attr { - enum x509_name_attr_type { - X509_NAME_ATTR_NOT_USED, - X509_NAME_ATTR_DC, - X509_NAME_ATTR_CN, - X509_NAME_ATTR_C, - X509_NAME_ATTR_L, - X509_NAME_ATTR_ST, - X509_NAME_ATTR_O, - X509_NAME_ATTR_OU - } type; - char *value; -}; - -#define X509_MAX_NAME_ATTRIBUTES 20 - -struct x509_name { - struct x509_name_attr attr[X509_MAX_NAME_ATTRIBUTES]; - size_t num_attr; - char *email; /* emailAddress */ - - /* from alternative name extension */ - char *alt_email; /* rfc822Name */ - char *dns; /* dNSName */ - char *uri; /* uniformResourceIdentifier */ - u8 *ip; /* iPAddress */ - size_t ip_len; /* IPv4: 4, IPv6: 16 */ - struct asn1_oid rid; /* registeredID */ -}; - -struct x509_certificate { - struct x509_certificate *next; - enum { X509_CERT_V1 = 0, X509_CERT_V2 = 1, X509_CERT_V3 = 2 } version; - unsigned long serial_number; - struct x509_algorithm_identifier signature; - struct x509_name issuer; - struct x509_name subject; - os_time_t not_before; - os_time_t not_after; - struct x509_algorithm_identifier public_key_alg; - u8 *public_key; - size_t public_key_len; - struct x509_algorithm_identifier signature_alg; - u8 *sign_value; - size_t sign_value_len; - - /* Extensions */ - unsigned int extensions_present; -#define X509_EXT_BASIC_CONSTRAINTS (1 << 0) -#define X509_EXT_PATH_LEN_CONSTRAINT (1 << 1) -#define X509_EXT_KEY_USAGE (1 << 2) -#define X509_EXT_SUBJECT_ALT_NAME (1 << 3) -#define X509_EXT_ISSUER_ALT_NAME (1 << 4) - - /* BasicConstraints */ - int ca; /* cA */ - unsigned long path_len_constraint; /* pathLenConstraint */ - - /* KeyUsage */ - unsigned long key_usage; -#define X509_KEY_USAGE_DIGITAL_SIGNATURE (1 << 0) -#define X509_KEY_USAGE_NON_REPUDIATION (1 << 1) -#define X509_KEY_USAGE_KEY_ENCIPHERMENT (1 << 2) -#define X509_KEY_USAGE_DATA_ENCIPHERMENT (1 << 3) -#define X509_KEY_USAGE_KEY_AGREEMENT (1 << 4) -#define X509_KEY_USAGE_KEY_CERT_SIGN (1 << 5) -#define X509_KEY_USAGE_CRL_SIGN (1 << 6) -#define X509_KEY_USAGE_ENCIPHER_ONLY (1 << 7) -#define X509_KEY_USAGE_DECIPHER_ONLY (1 << 8) - - /* - * The DER format certificate follows struct x509_certificate. These - * pointers point to that buffer. - */ - const u8 *cert_start; - size_t cert_len; - const u8 *tbs_cert_start; - size_t tbs_cert_len; -}; - -enum { - X509_VALIDATE_OK, - X509_VALIDATE_BAD_CERTIFICATE, - X509_VALIDATE_UNSUPPORTED_CERTIFICATE, - X509_VALIDATE_CERTIFICATE_REVOKED, - X509_VALIDATE_CERTIFICATE_EXPIRED, - X509_VALIDATE_CERTIFICATE_UNKNOWN, - X509_VALIDATE_UNKNOWN_CA -}; - -void x509_certificate_free(struct x509_certificate *cert); -struct x509_certificate * x509_certificate_parse(const u8 *buf, size_t len); -void x509_name_string(struct x509_name *name, char *buf, size_t len); -int x509_name_compare(struct x509_name *a, struct x509_name *b); -void x509_certificate_chain_free(struct x509_certificate *cert); -int x509_certificate_check_signature(struct x509_certificate *issuer, - struct x509_certificate *cert); -int x509_certificate_chain_validate(struct x509_certificate *trusted, - struct x509_certificate *chain, - int *reason, int disable_time_checks); -struct x509_certificate * -x509_certificate_get_subject(struct x509_certificate *chain, - struct x509_name *name); -int x509_certificate_self_signed(struct x509_certificate *cert); - -#endif /* X509V3_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/utils/base64.h b/tools/sdk/include/wpa_supplicant/wpa2/utils/base64.h deleted file mode 100644 index aa21fd0fc1b..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/utils/base64.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Base64 encoding/decoding (RFC1341) - * Copyright (c) 2005, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef BASE64_H -#define BASE64_H - -unsigned char * base64_encode(const unsigned char *src, size_t len, - size_t *out_len); -unsigned char * base64_decode(const unsigned char *src, size_t len, - size_t *out_len); - -#endif /* BASE64_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/utils/ext_password.h b/tools/sdk/include/wpa_supplicant/wpa2/utils/ext_password.h deleted file mode 100644 index dfe8e6f0e70..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/utils/ext_password.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * External password backend - * Copyright (c) 2012, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef EXT_PASSWORD_H -#define EXT_PASSWORD_H - -struct ext_password_data; - -#ifdef CONFIG_EXT_PASSWORD - -struct ext_password_data * ext_password_init(const char *backend, - const char *params); -void ext_password_deinit(struct ext_password_data *data); - -struct wpabuf * ext_password_get(struct ext_password_data *data, - const char *name); -void ext_password_free(struct wpabuf *pw); - -#else /* CONFIG_EXT_PASSWORD */ - -#define ext_password_init(b, p) -#define ext_password_deinit(d) -#define ext_password_get(d, n) -#define ext_password_free(p) - -#endif /* CONFIG_EXT_PASSWORD */ - -#endif /* EXT_PASSWORD_H */ diff --git a/tools/sdk/include/wpa_supplicant/wpa2/utils/ext_password_i.h b/tools/sdk/include/wpa_supplicant/wpa2/utils/ext_password_i.h deleted file mode 100644 index 043e7312c62..00000000000 --- a/tools/sdk/include/wpa_supplicant/wpa2/utils/ext_password_i.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * External password backend - internal definitions - * Copyright (c) 2012, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef EXT_PASSWORD_I_H -#define EXT_PASSWORD_I_H - -#include "ext_password.h" - -struct ext_password_backend { - const char *name; - void * (*init)(const char *params); - void (*deinit)(void *ctx); - struct wpabuf * (*get)(void *ctx, const char *name); -}; - -struct wpabuf * ext_password_alloc(size_t len); - -#endif /* EXT_PASSWORD_I_H */ diff --git a/tools/sdk/include/wpa_supplicant/wps/utils/uuid.h b/tools/sdk/include/wpa_supplicant/wps/utils/uuid.h deleted file mode 100644 index 5e860cbc593..00000000000 --- a/tools/sdk/include/wpa_supplicant/wps/utils/uuid.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Universally Unique IDentifier (UUID) - * Copyright (c) 2008, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef UUID_H -#define UUID_H - -#define UUID_LEN 16 - -int uuid_str2bin(const char *str, u8 *bin); -int uuid_bin2str(const u8 *bin, char *str, size_t max_len); -int is_nil_uuid(const u8 *uuid); - -#endif /* UUID_H */ diff --git a/tools/sdk/include/wpa_supplicant/wps/wps.h b/tools/sdk/include/wpa_supplicant/wps/wps.h deleted file mode 100644 index 31092cbb836..00000000000 --- a/tools/sdk/include/wpa_supplicant/wps/wps.h +++ /dev/null @@ -1,1065 +0,0 @@ -/* - * Wi-Fi Protected Setup - * Copyright (c) 2007-2012, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef WPS_H -#define WPS_H - -#include "rom/ets_sys.h" -#include "wps_defs.h" -#include "esp_wifi_types.h" - -/** - * enum wsc_op_code - EAP-WSC OP-Code values - */ -enum wsc_op_code { - WSC_UPnP = 0 /* No OP Code in UPnP transport */, - WSC_Start = 0x01, - WSC_ACK = 0x02, - WSC_NACK = 0x03, - WSC_MSG = 0x04, - WSC_Done = 0x05, - WSC_FRAG_ACK = 0x06 -}; - -struct wps_registrar; -//struct upnp_wps_device_sm; -struct wps_er; -struct wps_parse_attr; - -/** - * struct wps_credential - WPS Credential - * @ssid: SSID - * @ssid_len: Length of SSID - * @auth_type: Authentication Type (WPS_WIFI_AUTH_OPEN, .. flags) - * @encr_type: Encryption Type (WPS_ENCR_NONE, .. flags) - * @key_idx: Key index - * @key: Key - * @key_len: Key length in octets - * @mac_addr: MAC address of the Credential receiver - * @cred_attr: Unparsed Credential attribute data (used only in cred_cb()); - * this may be %NULL, if not used - * @cred_attr_len: Length of cred_attr in octets - * @ap_channel: AP channel - */ -struct wps_credential { - u8 ssid[32]; - size_t ssid_len; - u16 auth_type; - u16 encr_type; - u8 key_idx; - u8 key[64]; - size_t key_len; - u8 mac_addr[ETH_ALEN]; - const u8 *cred_attr; - size_t cred_attr_len; - u16 ap_channel; -}; - -#define WPS_DEV_TYPE_LEN 8 -#define WPS_DEV_TYPE_BUFSIZE 21 -#define WPS_SEC_DEV_TYPE_MAX_LEN 128 -/* maximum number of advertised WPS vendor extension attributes */ -#define MAX_WPS_VENDOR_EXTENSIONS 10 -/* maximum size of WPS Vendor extension attribute */ -#define WPS_MAX_VENDOR_EXT_LEN 1024 -/* maximum number of parsed WPS vendor extension attributes */ -#define MAX_WPS_PARSE_VENDOR_EXT 10 - -/** - * struct wps_device_data - WPS Device Data - * @mac_addr: Device MAC address - * @device_name: Device Name (0..32 octets encoded in UTF-8) - * @manufacturer: Manufacturer (0..64 octets encoded in UTF-8) - * @model_name: Model Name (0..32 octets encoded in UTF-8) - * @model_number: Model Number (0..32 octets encoded in UTF-8) - * @serial_number: Serial Number (0..32 octets encoded in UTF-8) - * @pri_dev_type: Primary Device Type - * @sec_dev_type: Array of secondary device types - * @num_sec_dev_type: Number of secondary device types - * @os_version: OS Version - * @rf_bands: RF bands (WPS_RF_24GHZ, WPS_RF_50GHZ flags) - * @p2p: Whether the device is a P2P device - */ -struct wps_device_data { - u8 mac_addr[ETH_ALEN]; - char *device_name; - char *manufacturer; - char *model_name; - char *model_number; - char *serial_number; - u8 pri_dev_type[WPS_DEV_TYPE_LEN]; -#define WPS_SEC_DEVICE_TYPES 5 - u8 sec_dev_type[WPS_SEC_DEVICE_TYPES][WPS_DEV_TYPE_LEN]; - u8 num_sec_dev_types; - u32 os_version; - u8 rf_bands; - u16 config_methods; - struct wpabuf *vendor_ext_m1; - struct wpabuf *vendor_ext[MAX_WPS_VENDOR_EXTENSIONS]; - - int p2p; -}; - -/** - * struct wps_config - WPS configuration for a single registration protocol run - */ -struct wps_config { - /** - * wps - Pointer to long term WPS context - */ - struct wps_context *wps; - - /** - * registrar - Whether this end is a Registrar - */ - int registrar; - - /** - * pin - Enrollee Device Password (%NULL for Registrar or PBC) - */ - const u8 *pin; - - /** - * pin_len - Length on pin in octets - */ - size_t pin_len; - - /** - * pbc - Whether this is protocol run uses PBC - */ - int pbc; - - /** - * assoc_wps_ie: (Re)AssocReq WPS IE (in AP; %NULL if not AP) - */ - const struct wpabuf *assoc_wps_ie; - - /** - * new_ap_settings - New AP settings (%NULL if not used) - * - * This parameter provides new AP settings when using a wireless - * stations as a Registrar to configure the AP. %NULL means that AP - * will not be reconfigured, i.e., the station will only learn the - * current AP settings by using AP PIN. - */ - const struct wps_credential *new_ap_settings; - - /** - * peer_addr: MAC address of the peer in AP; %NULL if not AP - */ - const u8 *peer_addr; - - /** - * use_psk_key - Use PSK format key in Credential - * - * Force PSK format to be used instead of ASCII passphrase when - * building Credential for an Enrollee. The PSK value is set in - * struct wpa_context::psk. - */ - int use_psk_key; - - /** - * dev_pw_id - Device Password ID for Enrollee when PIN is used - */ - u16 dev_pw_id; - - /** - * p2p_dev_addr - P2P Device Address from (Re)Association Request - * - * On AP/GO, this is set to the P2P Device Address of the associating - * P2P client if a P2P IE is included in the (Re)Association Request - * frame and the P2P Device Address is included. Otherwise, this is set - * to %NULL to indicate the station does not have a P2P Device Address. - */ - const u8 *p2p_dev_addr; - - /** - * pbc_in_m1 - Do not remove PushButton config method in M1 (AP) - * - * This can be used to enable a workaround to allow Windows 7 to use - * PBC with the AP. - */ - int pbc_in_m1; -}; - -/* Bssid of the discard AP which is discarded for not select reg or other reason */ -struct discard_ap_list_t{ - u8 bssid[6]; -}; - -//struct wps_data * wps_init(const struct wps_config *cfg); -struct wps_data * wps_init(void); - -//void wps_deinit(struct wps_data *data); -void wps_deinit(void); - -/** - * enum wps_process_res - WPS message processing result - */ -enum wps_process_res { - /** - * WPS_DONE - Processing done - */ - WPS_DONE, - - /** - * WPS_CONTINUE - Processing continues - */ - WPS_CONTINUE, - - /** - * WPS_FAILURE - Processing failed - */ - WPS_FAILURE, - - /** - * WPS_PENDING - Processing continues, but waiting for an external - * event (e.g., UPnP message from an external Registrar) - */ - WPS_PENDING, - WPS_IGNORE, /* snake, ignore the re-packge */ - - WPS_FRAGMENT /* Tim, send wsc fragment ack */ -}; -enum wps_process_res wps_process_msg(struct wps_data *wps, - enum wsc_op_code op_code, - const struct wpabuf *msg); - -struct wpabuf * wps_get_msg(struct wps_data *wps, enum wsc_op_code *op_code); - -int wps_is_selected_pbc_registrar(const struct wpabuf *msg, u8 *bssid); -int wps_is_selected_pin_registrar(const struct wpabuf *msg, u8 *bssid); -int wps_ap_priority_compar(const struct wpabuf *wps_a, - const struct wpabuf *wps_b); -int wps_is_addr_authorized(const struct wpabuf *msg, const u8 *addr, - int ver1_compat); -const u8 * wps_get_uuid_e(const struct wpabuf *msg); -int wps_is_20(const struct wpabuf *msg); - -struct wpabuf * wps_build_assoc_req_ie(enum wps_request_type req_type); -struct wpabuf * wps_build_assoc_resp_ie(void); -struct wpabuf * wps_build_probe_req_ie(u16 pw_id, struct wps_device_data *dev, - const u8 *uuid, - enum wps_request_type req_type, - unsigned int num_req_dev_types, - const u8 *req_dev_types); - - -/** - * struct wps_registrar_config - WPS Registrar configuration - */ -struct wps_registrar_config { - /** - * new_psk_cb - Callback for new PSK - * @ctx: Higher layer context data (cb_ctx) - * @mac_addr: MAC address of the Enrollee - * @psk: The new PSK - * @psk_len: The length of psk in octets - * Returns: 0 on success, -1 on failure - * - * This callback is called when a new per-device PSK is provisioned. - */ - int (*new_psk_cb)(void *ctx, const u8 *mac_addr, const u8 *psk, - size_t psk_len); - - /** - * set_ie_cb - Callback for WPS IE changes - * @ctx: Higher layer context data (cb_ctx) - * @beacon_ie: WPS IE for Beacon - * @probe_resp_ie: WPS IE for Probe Response - * Returns: 0 on success, -1 on failure - * - * This callback is called whenever the WPS IE in Beacon or Probe - * Response frames needs to be changed (AP only). Callee is responsible - * for freeing the buffers. - */ - int (*set_ie_cb)(void *ctx, struct wpabuf *beacon_ie, - struct wpabuf *probe_resp_ie); - - /** - * pin_needed_cb - Callback for requesting a PIN - * @ctx: Higher layer context data (cb_ctx) - * @uuid_e: UUID-E of the unknown Enrollee - * @dev: Device Data from the unknown Enrollee - * - * This callback is called whenever an unknown Enrollee requests to use - * PIN method and a matching PIN (Device Password) is not found in - * Registrar data. - */ - void (*pin_needed_cb)(void *ctx, const u8 *uuid_e, - const struct wps_device_data *dev); - - /** - * reg_success_cb - Callback for reporting successful registration - * @ctx: Higher layer context data (cb_ctx) - * @mac_addr: MAC address of the Enrollee - * @uuid_e: UUID-E of the Enrollee - * @dev_pw: Device Password (PIN) used during registration - * @dev_pw_len: Length of dev_pw in octets - * - * This callback is called whenever an Enrollee completes registration - * successfully. - */ - void (*reg_success_cb)(void *ctx, const u8 *mac_addr, - const u8 *uuid_e, const u8 *dev_pw, - size_t dev_pw_len); - - /** - * set_sel_reg_cb - Callback for reporting selected registrar changes - * @ctx: Higher layer context data (cb_ctx) - * @sel_reg: Whether the Registrar is selected - * @dev_passwd_id: Device Password ID to indicate with method or - * specific password the Registrar intends to use - * @sel_reg_config_methods: Bit field of active config methods - * - * This callback is called whenever the Selected Registrar state - * changes (e.g., a new PIN becomes available or PBC is invoked). This - * callback is only used by External Registrar implementation; - * set_ie_cb() is used by AP implementation in similar caes, but it - * provides the full WPS IE data instead of just the minimal Registrar - * state information. - */ - void (*set_sel_reg_cb)(void *ctx, int sel_reg, u16 dev_passwd_id, - u16 sel_reg_config_methods); - - /** - * enrollee_seen_cb - Callback for reporting Enrollee based on ProbeReq - * @ctx: Higher layer context data (cb_ctx) - * @addr: MAC address of the Enrollee - * @uuid_e: UUID of the Enrollee - * @pri_dev_type: Primary device type - * @config_methods: Config Methods - * @dev_password_id: Device Password ID - * @request_type: Request Type - * @dev_name: Device Name (if available) - */ - void (*enrollee_seen_cb)(void *ctx, const u8 *addr, const u8 *uuid_e, - const u8 *pri_dev_type, u16 config_methods, - u16 dev_password_id, u8 request_type, - const char *dev_name); - - /** - * cb_ctx: Higher layer context data for Registrar callbacks - */ - void *cb_ctx; - - /** - * skip_cred_build: Do not build credential - * - * This option can be used to disable internal code that builds - * Credential attribute into M8 based on the current network - * configuration and Enrollee capabilities. The extra_cred data will - * then be used as the Credential(s). - */ - int skip_cred_build; - - /** - * extra_cred: Additional Credential attribute(s) - * - * This optional data (set to %NULL to disable) can be used to add - * Credential attribute(s) for other networks into M8. If - * skip_cred_build is set, this will also override the automatically - * generated Credential attribute. - */ - const u8 *extra_cred; - - /** - * extra_cred_len: Length of extra_cred in octets - */ - size_t extra_cred_len; - - /** - * disable_auto_conf - Disable auto-configuration on first registration - * - * By default, the AP that is started in not configured state will - * generate a random PSK and move to configured state when the first - * registration protocol run is completed successfully. This option can - * be used to disable this functionality and leave it up to an external - * program to take care of configuration. This requires the extra_cred - * to be set with a suitable Credential and skip_cred_build being used. - */ - int disable_auto_conf; - - /** - * static_wep_only - Whether the BSS supports only static WEP - */ - int static_wep_only; - - /** - * dualband - Whether this is a concurrent dualband AP - */ - int dualband; -}; - - -/** - * enum wps_event - WPS event types - */ -enum wps_event { - /** - * WPS_EV_M2D - M2D received (Registrar did not know us) - */ - WPS_EV_M2D, - - /** - * WPS_EV_FAIL - Registration failed - */ - WPS_EV_FAIL, - - /** - * WPS_EV_SUCCESS - Registration succeeded - */ - WPS_EV_SUCCESS, - - /** - * WPS_EV_PWD_AUTH_FAIL - Password authentication failed - */ - WPS_EV_PWD_AUTH_FAIL, - - /** - * WPS_EV_PBC_OVERLAP - PBC session overlap detected - */ - WPS_EV_PBC_OVERLAP, - - /** - * WPS_EV_PBC_TIMEOUT - PBC walktime expired before protocol run start - */ - WPS_EV_PBC_TIMEOUT, - - /** - * WPS_EV_ER_AP_ADD - ER: AP added - */ - WPS_EV_ER_AP_ADD, - - /** - * WPS_EV_ER_AP_REMOVE - ER: AP removed - */ - WPS_EV_ER_AP_REMOVE, - - /** - * WPS_EV_ER_ENROLLEE_ADD - ER: Enrollee added - */ - WPS_EV_ER_ENROLLEE_ADD, - - /** - * WPS_EV_ER_ENROLLEE_REMOVE - ER: Enrollee removed - */ - WPS_EV_ER_ENROLLEE_REMOVE, - - /** - * WPS_EV_ER_AP_SETTINGS - ER: AP Settings learned - */ - WPS_EV_ER_AP_SETTINGS, - - /** - * WPS_EV_ER_SET_SELECTED_REGISTRAR - ER: SetSelectedRegistrar event - */ - WPS_EV_ER_SET_SELECTED_REGISTRAR, - - /** - * WPS_EV_AP_PIN_SUCCESS - External Registrar used correct AP PIN - */ - WPS_EV_AP_PIN_SUCCESS -}; - -/** - * union wps_event_data - WPS event data - */ -union wps_event_data { - /** - * struct wps_event_m2d - M2D event data - */ - struct wps_event_m2d { - u16 config_methods; - const u8 *manufacturer; - size_t manufacturer_len; - const u8 *model_name; - size_t model_name_len; - const u8 *model_number; - size_t model_number_len; - const u8 *serial_number; - size_t serial_number_len; - const u8 *dev_name; - size_t dev_name_len; - const u8 *primary_dev_type; /* 8 octets */ - u16 config_error; - u16 dev_password_id; - } m2d; - - /** - * struct wps_event_fail - Registration failure information - * @msg: enum wps_msg_type - */ - struct wps_event_fail { - int msg; - u16 config_error; - u16 error_indication; - } fail; - - struct wps_event_pwd_auth_fail { - int enrollee; - int part; - } pwd_auth_fail; - - struct wps_event_er_ap { - const u8 *uuid; - const u8 *mac_addr; - const char *friendly_name; - const char *manufacturer; - const char *manufacturer_url; - const char *model_description; - const char *model_name; - const char *model_number; - const char *model_url; - const char *serial_number; - const char *upc; - const u8 *pri_dev_type; - u8 wps_state; - } ap; - - struct wps_event_er_enrollee { - const u8 *uuid; - const u8 *mac_addr; - int m1_received; - u16 config_methods; - u16 dev_passwd_id; - const u8 *pri_dev_type; - const char *dev_name; - const char *manufacturer; - const char *model_name; - const char *model_number; - const char *serial_number; - } enrollee; - - struct wps_event_er_ap_settings { - const u8 *uuid; - const struct wps_credential *cred; - } ap_settings; - - struct wps_event_er_set_selected_registrar { - const u8 *uuid; - int sel_reg; - u16 dev_passwd_id; - u16 sel_reg_config_methods; - enum { - WPS_ER_SET_SEL_REG_START, - WPS_ER_SET_SEL_REG_DONE, - WPS_ER_SET_SEL_REG_FAILED - } state; - } set_sel_reg; -}; -#ifdef CONFIG_WPS_UPNP -/** - * struct upnp_pending_message - Pending PutWLANResponse messages - * @next: Pointer to next pending message or %NULL - * @addr: NewWLANEventMAC - * @msg: NewMessage - * @type: Message Type - */ -struct upnp_pending_message { - struct upnp_pending_message *next; - u8 addr[ETH_ALEN]; - struct wpabuf *msg; - enum wps_msg_type type; -}; -void wps_free_pending_msgs(struct upnp_pending_message *msgs); -#endif -/** - * struct wps_context - Long term WPS context data - * - * This data is stored at the higher layer Authenticator or Supplicant data - * structures and it is maintained over multiple registration protocol runs. - */ -struct wps_context { - /** - * ap - Whether the local end is an access point - */ - int ap; - - /** - * registrar - Pointer to WPS registrar data from wps_registrar_init() - */ - struct wps_registrar *registrar; - - /** - * wps_state - Current WPS state - */ - enum wps_state wps_state; - - /** - * ap_setup_locked - Whether AP setup is locked (only used at AP) - */ - int ap_setup_locked; - - /** - * uuid - Own UUID - */ - u8 uuid[16]; - - /** - * ssid - SSID - * - * This SSID is used by the Registrar to fill in information for - * Credentials. In addition, AP uses it when acting as an Enrollee to - * notify Registrar of the current configuration. - */ - u8 ssid[32]; - - /** - * ssid_len - Length of ssid in octets - */ - size_t ssid_len; - - /** - * dev - Own WPS device data - */ - struct wps_device_data dev; - - /** - * dh_ctx - Context data for Diffie-Hellman operation - */ - void *dh_ctx; - - /** - * dh_privkey - Diffie-Hellman private key - */ - struct wpabuf *dh_privkey; - - /** - * dh_pubkey_oob - Diffie-Hellman public key - */ - struct wpabuf *dh_pubkey; - - /** - * config_methods - Enabled configuration methods - * - * Bit field of WPS_CONFIG_* - */ - u16 config_methods; - - /** - * encr_types - Enabled encryption types (bit field of WPS_ENCR_*) - */ - u16 encr_types; - - /** - * auth_types - Authentication types (bit field of WPS_AUTH_*) - */ - u16 auth_types; - - /** - * network_key - The current Network Key (PSK) or %NULL to generate new - * - * If %NULL, Registrar will generate per-device PSK. In addition, AP - * uses this when acting as an Enrollee to notify Registrar of the - * current configuration. - * - * When using WPA/WPA2-Person, this key can be either the ASCII - * passphrase (8..63 characters) or the 32-octet PSK (64 hex - * characters). When this is set to the ASCII passphrase, the PSK can - * be provided in the psk buffer and used per-Enrollee to control which - * key type is included in the Credential (e.g., to reduce calculation - * need on low-powered devices by provisioning PSK while still allowing - * other devices to get the passphrase). - */ - u8 *network_key; - - /** - * network_key_len - Length of network_key in octets - */ - size_t network_key_len; - - /** - * psk - The current network PSK - * - * This optional value can be used to provide the current PSK if - * network_key is set to the ASCII passphrase. - */ - u8 psk[32]; - - /** - * psk_set - Whether psk value is set - */ - int psk_set; - - /** - * ap_settings - AP Settings override for M7 (only used at AP) - * - * If %NULL, AP Settings attributes will be generated based on the - * current network configuration. - */ - u8 *ap_settings; - - /** - * ap_settings_len - Length of ap_settings in octets - */ - size_t ap_settings_len; - - /** - * friendly_name - Friendly Name (required for UPnP) - */ - char *friendly_name; - - /** - * manufacturer_url - Manufacturer URL (optional for UPnP) - */ - char *manufacturer_url; - - /** - * model_description - Model Description (recommended for UPnP) - */ - char *model_description; - - /** - * model_url - Model URL (optional for UPnP) - */ - char *model_url; - - /** - * upc - Universal Product Code (optional for UPnP) - */ - char *upc; - - /** - * cred_cb - Callback to notify that new Credentials were received - * @ctx: Higher layer context data (cb_ctx) - * @cred: The received Credential - * Return: 0 on success, -1 on failure - */ - int (*cred_cb)(void *ctx, const struct wps_credential *cred); - - /** - * event_cb - Event callback (state information about progress) - * @ctx: Higher layer context data (cb_ctx) - * @event: Event type - * @data: Event data - */ - void (*event_cb)(void *ctx, enum wps_event event, - union wps_event_data *data); - - /** - * cb_ctx: Higher layer context data for callbacks - */ - void *cb_ctx; - - //struct upnp_wps_device_sm *wps_upnp; - - /* Pending messages from UPnP PutWLANResponse */ - //struct upnp_pending_message *upnp_msgs; -#ifdef CONFIG_WPS_NFC - - u16 ap_nfc_dev_pw_id; - struct wpabuf *ap_nfc_dh_pubkey; - struct wpabuf *ap_nfc_dh_privkey; - struct wpabuf *ap_nfc_dev_pw; -#endif -}; - -struct wps_registrar * -wps_registrar_init(struct wps_context *wps, - const struct wps_registrar_config *cfg); -void wps_registrar_deinit(struct wps_registrar *reg); -#ifdef CONFIG_WPS_PIN - -int wps_registrar_add_pin(struct wps_registrar *reg, const u8 *addr, - const u8 *uuid, const u8 *pin, size_t pin_len, - int timeout); -int wps_registrar_invalidate_pin(struct wps_registrar *reg, const u8 *uuid); -int wps_registrar_unlock_pin(struct wps_registrar *reg, const u8 *uuid); -#endif -int wps_registrar_wps_cancel(struct wps_registrar *reg); - -int wps_registrar_button_pushed(struct wps_registrar *reg, - const u8 *p2p_dev_addr); -void wps_registrar_complete(struct wps_registrar *registrar, const u8 *uuid_e, - const u8 *dev_pw, size_t dev_pw_len); -void wps_registrar_probe_req_rx(struct wps_registrar *reg, const u8 *addr, - const struct wpabuf *wps_data, - int p2p_wildcard); -int wps_registrar_update_ie(struct wps_registrar *reg); -int wps_registrar_get_info(struct wps_registrar *reg, const u8 *addr, - char *buf, size_t buflen); -int wps_registrar_config_ap(struct wps_registrar *reg, - struct wps_credential *cred); -#ifdef CONFIG_WPS_NFC - -int wps_registrar_add_nfc_pw_token(struct wps_registrar *reg, - const u8 *pubkey_hash, u16 pw_id, - const u8 *dev_pw, size_t dev_pw_len); -int wps_registrar_add_nfc_password_token(struct wps_registrar *reg, - const u8 *oob_dev_pw, - size_t oob_dev_pw_len); -#endif -int wps_build_credential_wrap(struct wpabuf *msg, - const struct wps_credential *cred); -#ifdef CONFIG_WPS_PIN - -unsigned int wps_pin_checksum(unsigned int pin); -unsigned int wps_pin_valid(unsigned int pin); -int wps_pin_str_valid(const char *pin); -#endif -unsigned int wps_generate_pin(void); - -#ifdef CONFIG_WPS_OOB - -struct wpabuf * wps_get_oob_cred(struct wps_context *wps); -int wps_oob_use_cred(struct wps_context *wps, struct wps_parse_attr *attr); -#endif -int wps_attr_text(struct wpabuf *data, char *buf, char *end); - -struct wps_er * wps_er_init(struct wps_context *wps, const char *ifname, - const char *filter); -void wps_er_refresh(struct wps_er *er); -void wps_er_deinit(struct wps_er *er, void (*cb)(void *ctx), void *ctx); -void wps_er_set_sel_reg(struct wps_er *er, int sel_reg, u16 dev_passwd_id, - u16 sel_reg_config_methods); -int wps_er_pbc(struct wps_er *er, const u8 *uuid); -int wps_er_learn(struct wps_er *er, const u8 *uuid, const u8 *pin, - size_t pin_len); -int wps_er_set_config(struct wps_er *er, const u8 *uuid, - const struct wps_credential *cred); -int wps_er_config(struct wps_er *er, const u8 *uuid, const u8 *pin, - size_t pin_len, const struct wps_credential *cred); -#ifdef CONFIG_WPS_NFC - -struct wpabuf * wps_er_nfc_config_token(struct wps_er *er, const u8 *uuid); - -#endif - -int wps_dev_type_str2bin(const char *str, u8 dev_type[WPS_DEV_TYPE_LEN]); -char * wps_dev_type_bin2str(const u8 dev_type[WPS_DEV_TYPE_LEN], char *buf, - size_t buf_len); -void uuid_gen_mac_addr(const u8 *mac_addr, u8 *uuid); -u16 wps_config_methods_str2bin(const char *str); - -#ifdef CONFIG_WPS_NFC - -struct wpabuf * wps_build_nfc_pw_token(u16 dev_pw_id, - const struct wpabuf *pubkey, - const struct wpabuf *dev_pw); -struct wpabuf * wps_nfc_token_gen(int ndef, int *id, struct wpabuf **pubkey, - struct wpabuf **privkey, - struct wpabuf **dev_pw); -#endif - -/* ndef.c */ -struct wpabuf * ndef_parse_wifi(const struct wpabuf *buf); -struct wpabuf * ndef_build_wifi(const struct wpabuf *buf); -struct wpabuf * ndef_build_wifi_hr(void); - -#ifdef CONFIG_WPS_STRICT -int wps_validate_beacon(const struct wpabuf *wps_ie); -int wps_validate_beacon_probe_resp(const struct wpabuf *wps_ie, int probe, - const u8 *addr); -int wps_validate_probe_req(const struct wpabuf *wps_ie, const u8 *addr); -int wps_validate_assoc_req(const struct wpabuf *wps_ie); -int wps_validate_assoc_resp(const struct wpabuf *wps_ie); -int wps_validate_m1(const struct wpabuf *tlvs); -int wps_validate_m2(const struct wpabuf *tlvs); -int wps_validate_m2d(const struct wpabuf *tlvs); -int wps_validate_m3(const struct wpabuf *tlvs); -int wps_validate_m4(const struct wpabuf *tlvs); -int wps_validate_m4_encr(const struct wpabuf *tlvs, int wps2); -int wps_validate_m5(const struct wpabuf *tlvs); -int wps_validate_m5_encr(const struct wpabuf *tlvs, int wps2); -int wps_validate_m6(const struct wpabuf *tlvs); -int wps_validate_m6_encr(const struct wpabuf *tlvs, int wps2); -int wps_validate_m7(const struct wpabuf *tlvs); -int wps_validate_m7_encr(const struct wpabuf *tlvs, int ap, int wps2); -int wps_validate_m8(const struct wpabuf *tlvs); -int wps_validate_m8_encr(const struct wpabuf *tlvs, int ap, int wps2); -int wps_validate_wsc_ack(const struct wpabuf *tlvs); -int wps_validate_wsc_nack(const struct wpabuf *tlvs); -int wps_validate_wsc_done(const struct wpabuf *tlvs); -int wps_validate_upnp_set_selected_registrar(const struct wpabuf *tlvs); -#else /* CONFIG_WPS_STRICT */ -static inline int wps_validate_beacon(const struct wpabuf *wps_ie){ - return 0; -} - -static inline int wps_validate_beacon_probe_resp(const struct wpabuf *wps_ie, - int probe, const u8 *addr) -{ - return 0; -} - -static inline int wps_validate_probe_req(const struct wpabuf *wps_ie, - const u8 *addr) -{ - return 0; -} - -static inline int wps_validate_assoc_req(const struct wpabuf *wps_ie) -{ - return 0; -} - -static inline int wps_validate_assoc_resp(const struct wpabuf *wps_ie) -{ - return 0; -} - -static inline int wps_validate_m1(const struct wpabuf *tlvs) -{ - return 0; -} - -static inline int wps_validate_m2(const struct wpabuf *tlvs) -{ - return 0; -} - -static inline int wps_validate_m2d(const struct wpabuf *tlvs) -{ - return 0; -} - -static inline int wps_validate_m3(const struct wpabuf *tlvs) -{ - return 0; -} - -static inline int wps_validate_m4(const struct wpabuf *tlvs) -{ - return 0; -} - -static inline int wps_validate_m4_encr(const struct wpabuf *tlvs, int wps2) -{ - return 0; -} - -static inline int wps_validate_m5(const struct wpabuf *tlvs) -{ - return 0; -} - -static inline int wps_validate_m5_encr(const struct wpabuf *tlvs, int wps2) -{ - return 0; -} - -static inline int wps_validate_m6(const struct wpabuf *tlvs) -{ - return 0; -} - -static inline int wps_validate_m6_encr(const struct wpabuf *tlvs, int wps2) -{ - return 0; -} - -static inline int wps_validate_m7(const struct wpabuf *tlvs) -{ - return 0; -} - -static inline int wps_validate_m7_encr(const struct wpabuf *tlvs, int ap, - int wps2) -{ - return 0; -} - -static inline int wps_validate_m8(const struct wpabuf *tlvs) -{ - return 0; -} - -static inline int wps_validate_m8_encr(const struct wpabuf *tlvs, int ap, - int wps2) -{ - return 0; -} - -static inline int wps_validate_wsc_ack(const struct wpabuf *tlvs) -{ - return 0; -} - -static inline int wps_validate_wsc_nack(const struct wpabuf *tlvs) -{ - return 0; -} - -static inline int wps_validate_wsc_done(const struct wpabuf *tlvs) -{ - return 0; -} - -static inline int wps_validate_upnp_set_selected_registrar( - const struct wpabuf *tlvs) -{ - return 0; -} -#endif /* CONFIG_WPS_STRICT */ - -enum wps_cb_status { - WPS_CB_ST_SUCCESS = 0, - WPS_CB_ST_FAILED, - WPS_CB_ST_TIMEOUT, - WPS_CB_ST_WEP, - WPS_CB_ST_SCAN_ERR, -}; - -typedef void (*wps_st_cb_t)(int status); - -#ifdef USE_WPS_TASK -#define SIG_WPS_START 2 -#define SIG_WPS_RX 3 -#define SIG_WPS_NUM 9 -#endif - -#define WPS_EAP_EXT_VENDOR_TYPE "WFA-SimpleConfig-Enrollee-1-0" -#define WPS_OUTBUF_SIZE 500 -struct wps_sm { - struct wps_config *wps_cfg; - struct wps_context *wps_ctx; - struct wps_data *wps; - char identity[32]; - u8 identity_len; - u8 ownaddr[ETH_ALEN]; - u8 bssid[ETH_ALEN]; - u8 ssid[32]; - u8 ssid_len; - struct wps_device_data *dev; - u8 uuid[16]; - u8 eapol_version; - char key[64]; - u8 key_len; - ETSTimer wps_timeout_timer; - ETSTimer wps_msg_timeout_timer; - ETSTimer wps_scan_timer; - ETSTimer wps_success_cb_timer; - ETSTimer wps_eapol_start_timer; - wps_st_cb_t st_cb; - u8 current_identifier; - bool is_wps_scan; - u8 channel; - u8 scan_cnt; -#ifdef USE_WPS_TASK - u8 wps_sig_cnt[SIG_WPS_NUM]; -#endif - u8 discover_ssid_cnt; - bool ignore_sel_reg; - struct discard_ap_list_t dis_ap_list[WPS_MAX_DIS_AP_NUM]; - u8 discard_ap_cnt; - wifi_sta_config_t config; -}; - -#define IEEE80211_CAPINFO_PRIVACY 0x0010 - -struct wps_sm *wps_sm_get(void); -int wps_ssid_save(u8 *ssid, u8 ssid_len); -int wps_key_save(char *key, u8 key_len); -int wps_station_wps_register_cb(wps_st_cb_t cb); -int wps_station_wps_unregister_cb(void); -int wps_start_pending(void); -int wps_sm_rx_eapol(u8 *src_addr, u8 *buf, u32 len); - -int wps_dev_deinit(struct wps_device_data *dev); -#endif /* WPS_H */ diff --git a/tools/sdk/include/wpa_supplicant/wps/wps_attr_parse.h b/tools/sdk/include/wpa_supplicant/wps/wps_attr_parse.h deleted file mode 100644 index 86061aea062..00000000000 --- a/tools/sdk/include/wpa_supplicant/wps/wps_attr_parse.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Wi-Fi Protected Setup - attribute parsing - * Copyright (c) 2008-2012, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef WPS_ATTR_PARSE_H -#define WPS_ATTR_PARSE_H - -#include "wps/wps.h" - -struct wps_parse_attr { - /* fixed length fields */ - const u8 *version; /* 1 octet */ - const u8 *version2; /* 1 octet */ - const u8 *msg_type; /* 1 octet */ - const u8 *enrollee_nonce; /* WPS_NONCE_LEN (16) octets */ - const u8 *registrar_nonce; /* WPS_NONCE_LEN (16) octets */ - const u8 *uuid_r; /* WPS_UUID_LEN (16) octets */ - const u8 *uuid_e; /* WPS_UUID_LEN (16) octets */ - const u8 *auth_type_flags; /* 2 octets */ - const u8 *encr_type_flags; /* 2 octets */ - const u8 *conn_type_flags; /* 1 octet */ - const u8 *config_methods; /* 2 octets */ - const u8 *sel_reg_config_methods; /* 2 octets */ - const u8 *primary_dev_type; /* 8 octets */ - const u8 *rf_bands; /* 1 octet */ - const u8 *assoc_state; /* 2 octets */ - const u8 *config_error; /* 2 octets */ - const u8 *dev_password_id; /* 2 octets */ - const u8 *os_version; /* 4 octets */ - const u8 *wps_state; /* 1 octet */ - const u8 *authenticator; /* WPS_AUTHENTICATOR_LEN (8) octets */ - const u8 *r_hash1; /* WPS_HASH_LEN (32) octets */ - const u8 *r_hash2; /* WPS_HASH_LEN (32) octets */ - const u8 *e_hash1; /* WPS_HASH_LEN (32) octets */ - const u8 *e_hash2; /* WPS_HASH_LEN (32) octets */ - const u8 *r_snonce1; /* WPS_SECRET_NONCE_LEN (16) octets */ - const u8 *r_snonce2; /* WPS_SECRET_NONCE_LEN (16) octets */ - const u8 *e_snonce1; /* WPS_SECRET_NONCE_LEN (16) octets */ - const u8 *e_snonce2; /* WPS_SECRET_NONCE_LEN (16) octets */ - const u8 *key_wrap_auth; /* WPS_KWA_LEN (8) octets */ - const u8 *auth_type; /* 2 octets */ - const u8 *encr_type; /* 2 octets */ - const u8 *network_idx; /* 1 octet */ - const u8 *network_key_idx; /* 1 octet */ - const u8 *mac_addr; /* ETH_ALEN (6) octets */ - const u8 *key_prov_auto; /* 1 octet (Bool) */ - const u8 *dot1x_enabled; /* 1 octet (Bool) */ - const u8 *selected_registrar; /* 1 octet (Bool) */ - const u8 *request_type; /* 1 octet */ - const u8 *response_type; /* 1 octet */ - const u8 *ap_setup_locked; /* 1 octet */ - const u8 *settings_delay_time; /* 1 octet */ - const u8 *network_key_shareable; /* 1 octet (Bool) */ - const u8 *request_to_enroll; /* 1 octet (Bool) */ - const u8 *ap_channel; /* 2 octets */ - - /* variable length fields */ - const u8 *manufacturer; - size_t manufacturer_len; - const u8 *model_name; - size_t model_name_len; - const u8 *model_number; - size_t model_number_len; - const u8 *serial_number; - size_t serial_number_len; - const u8 *dev_name; - size_t dev_name_len; - const u8 *public_key; - size_t public_key_len; - const u8 *encr_settings; - size_t encr_settings_len; - const u8 *ssid; /* <= 32 octets */ - size_t ssid_len; - const u8 *network_key; /* <= 64 octets */ - size_t network_key_len; - const u8 *eap_type; /* <= 8 octets */ - size_t eap_type_len; - const u8 *eap_identity; /* <= 64 octets */ - size_t eap_identity_len; - const u8 *authorized_macs; /* <= 30 octets */ - size_t authorized_macs_len; - const u8 *sec_dev_type_list; /* <= 128 octets */ - size_t sec_dev_type_list_len; - const u8 *oob_dev_password; /* 38..54 octets */ - size_t oob_dev_password_len; - - /* attributes that can occur multiple times */ -#define MAX_CRED_COUNT 10 - const u8 *cred[MAX_CRED_COUNT]; - size_t cred_len[MAX_CRED_COUNT]; - size_t num_cred; - -#define MAX_REQ_DEV_TYPE_COUNT 10 - const u8 *req_dev_type[MAX_REQ_DEV_TYPE_COUNT]; - size_t num_req_dev_type; - - const u8 *vendor_ext[MAX_WPS_PARSE_VENDOR_EXT]; - size_t vendor_ext_len[MAX_WPS_PARSE_VENDOR_EXT]; - size_t num_vendor_ext; -}; - -int wps_parse_msg(const struct wpabuf *msg, struct wps_parse_attr *attr); - -#endif /* WPS_ATTR_PARSE_H */ diff --git a/tools/sdk/include/wpa_supplicant/wps/wps_defs.h b/tools/sdk/include/wpa_supplicant/wps/wps_defs.h deleted file mode 100644 index d100202da6e..00000000000 --- a/tools/sdk/include/wpa_supplicant/wps/wps_defs.h +++ /dev/null @@ -1,342 +0,0 @@ -/* - * Wi-Fi Protected Setup - message definitions - * Copyright (c) 2008, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef WPS_DEFS_H -#define WPS_DEFS_H - -#ifdef CONFIG_WPS_TESTING - -extern int wps_version_number; -extern int wps_testing_dummy_cred; -#define WPS_VERSION wps_version_number - -#else /* CONFIG_WPS_TESTING */ - -#ifdef CONFIG_WPS2 -#define WPS_VERSION 0x20 -#else /* CONFIG_WPS2 */ -#define WPS_VERSION 0x10 -#endif /* CONFIG_WPS2 */ - -#endif /* CONFIG_WPS_TESTING */ - -#define CONFIG_WPS_STRICT - -/* Diffie-Hellman 1536-bit MODP Group; RFC 3526, Group 5 */ -#define WPS_DH_GROUP 5 - -#define WPS_UUID_LEN 16 -#define WPS_NONCE_LEN 16 -#define WPS_AUTHENTICATOR_LEN 8 -#define WPS_AUTHKEY_LEN 32 -#define WPS_KEYWRAPKEY_LEN 16 -#define WPS_EMSK_LEN 32 -#define WPS_PSK_LEN 16 -#define WPS_SECRET_NONCE_LEN 16 -#define WPS_HASH_LEN 32 -#define WPS_KWA_LEN 8 -#define WPS_MGMTAUTHKEY_LEN 32 -#define WPS_MGMTENCKEY_LEN 16 -#define WPS_MGMT_KEY_ID_LEN 16 -#define WPS_OOB_DEVICE_PASSWORD_MIN_LEN 16 -#define WPS_OOB_DEVICE_PASSWORD_LEN 32 -#define WPS_OOB_PUBKEY_HASH_LEN 20 - -/* Attribute Types */ -enum wps_attribute { - ATTR_AP_CHANNEL = 0x1001, - ATTR_ASSOC_STATE = 0x1002, - ATTR_AUTH_TYPE = 0x1003, - ATTR_AUTH_TYPE_FLAGS = 0x1004, - ATTR_AUTHENTICATOR = 0x1005, - ATTR_CONFIG_METHODS = 0x1008, - ATTR_CONFIG_ERROR = 0x1009, - ATTR_CONFIRM_URL4 = 0x100a, - ATTR_CONFIRM_URL6 = 0x100b, - ATTR_CONN_TYPE = 0x100c, - ATTR_CONN_TYPE_FLAGS = 0x100d, - ATTR_CRED = 0x100e, - ATTR_ENCR_TYPE = 0x100f, - ATTR_ENCR_TYPE_FLAGS = 0x1010, - ATTR_DEV_NAME = 0x1011, - ATTR_DEV_PASSWORD_ID = 0x1012, - ATTR_E_HASH1 = 0x1014, - ATTR_E_HASH2 = 0x1015, - ATTR_E_SNONCE1 = 0x1016, - ATTR_E_SNONCE2 = 0x1017, - ATTR_ENCR_SETTINGS = 0x1018, - ATTR_ENROLLEE_NONCE = 0x101a, - ATTR_FEATURE_ID = 0x101b, - ATTR_IDENTITY = 0x101c, - ATTR_IDENTITY_PROOF = 0x101d, - ATTR_KEY_WRAP_AUTH = 0x101e, - ATTR_KEY_ID = 0x101f, - ATTR_MAC_ADDR = 0x1020, - ATTR_MANUFACTURER = 0x1021, - ATTR_MSG_TYPE = 0x1022, - ATTR_MODEL_NAME = 0x1023, - ATTR_MODEL_NUMBER = 0x1024, - ATTR_NETWORK_INDEX = 0x1026, - ATTR_NETWORK_KEY = 0x1027, - ATTR_NETWORK_KEY_INDEX = 0x1028, - ATTR_NEW_DEVICE_NAME = 0x1029, - ATTR_NEW_PASSWORD = 0x102a, - ATTR_OOB_DEVICE_PASSWORD = 0x102c, - ATTR_OS_VERSION = 0x102d, - ATTR_POWER_LEVEL = 0x102f, - ATTR_PSK_CURRENT = 0x1030, - ATTR_PSK_MAX = 0x1031, - ATTR_PUBLIC_KEY = 0x1032, - ATTR_RADIO_ENABLE = 0x1033, - ATTR_REBOOT = 0x1034, - ATTR_REGISTRAR_CURRENT = 0x1035, - ATTR_REGISTRAR_ESTABLISHED = 0x1036, - ATTR_REGISTRAR_LIST = 0x1037, - ATTR_REGISTRAR_MAX = 0x1038, - ATTR_REGISTRAR_NONCE = 0x1039, - ATTR_REQUEST_TYPE = 0x103a, - ATTR_RESPONSE_TYPE = 0x103b, - ATTR_RF_BANDS = 0x103c, - ATTR_R_HASH1 = 0x103d, - ATTR_R_HASH2 = 0x103e, - ATTR_R_SNONCE1 = 0x103f, - ATTR_R_SNONCE2 = 0x1040, - ATTR_SELECTED_REGISTRAR = 0x1041, - ATTR_SERIAL_NUMBER = 0x1042, - ATTR_WPS_STATE = 0x1044, - ATTR_SSID = 0x1045, - ATTR_TOTAL_NETWORKS = 0x1046, - ATTR_UUID_E = 0x1047, - ATTR_UUID_R = 0x1048, - ATTR_VENDOR_EXT = 0x1049, - ATTR_VERSION = 0x104a, - ATTR_X509_CERT_REQ = 0x104b, - ATTR_X509_CERT = 0x104c, - ATTR_EAP_IDENTITY = 0x104d, - ATTR_MSG_COUNTER = 0x104e, - ATTR_PUBKEY_HASH = 0x104f, - ATTR_REKEY_KEY = 0x1050, - ATTR_KEY_LIFETIME = 0x1051, - ATTR_PERMITTED_CFG_METHODS = 0x1052, - ATTR_SELECTED_REGISTRAR_CONFIG_METHODS = 0x1053, - ATTR_PRIMARY_DEV_TYPE = 0x1054, - ATTR_SECONDARY_DEV_TYPE_LIST = 0x1055, - ATTR_PORTABLE_DEV = 0x1056, - ATTR_AP_SETUP_LOCKED = 0x1057, - ATTR_APPLICATION_EXT = 0x1058, - ATTR_EAP_TYPE = 0x1059, - ATTR_IV = 0x1060, - ATTR_KEY_PROVIDED_AUTO = 0x1061, - ATTR_802_1X_ENABLED = 0x1062, - ATTR_APPSESSIONKEY = 0x1063, - ATTR_WEPTRANSMITKEY = 0x1064, - ATTR_REQUESTED_DEV_TYPE = 0x106a, - ATTR_EXTENSIBILITY_TEST = 0x10fa /* _NOT_ defined in the spec */ -}; - -#define WPS_VENDOR_ID_WFA 14122 - -/* WFA Vendor Extension subelements */ -enum { - WFA_ELEM_VERSION2 = 0x00, - WFA_ELEM_AUTHORIZEDMACS = 0x01, - WFA_ELEM_NETWORK_KEY_SHAREABLE = 0x02, - WFA_ELEM_REQUEST_TO_ENROLL = 0x03, - WFA_ELEM_SETTINGS_DELAY_TIME = 0x04 -}; - -/* Device Password ID */ -enum wps_dev_password_id { - DEV_PW_DEFAULT = 0x0000, - DEV_PW_USER_SPECIFIED = 0x0001, - DEV_PW_MACHINE_SPECIFIED = 0x0002, - DEV_PW_REKEY = 0x0003, - DEV_PW_PUSHBUTTON = 0x0004, - DEV_PW_REGISTRAR_SPECIFIED = 0x0005 -}; - -/* WPS message flag */ -enum wps_msg_flag { - WPS_MSG_FLAG_MORE = 0x01, - WPS_MSG_FLAG_LEN = 0x02 -}; - -/* Message Type */ -enum wps_msg_type { - WPS_Beacon = 0x01, - WPS_ProbeRequest = 0x02, - WPS_ProbeResponse = 0x03, - WPS_M1 = 0x04, - WPS_M2 = 0x05, - WPS_M2D = 0x06, - WPS_M3 = 0x07, - WPS_M4 = 0x08, - WPS_M5 = 0x09, - WPS_M6 = 0x0a, - WPS_M7 = 0x0b, - WPS_M8 = 0x0c, - WPS_WSC_ACK = 0x0d, - WPS_WSC_NACK = 0x0e, - WPS_WSC_DONE = 0x0f -}; - -/* Authentication Type Flags */ -#define WPS_WIFI_AUTH_OPEN 0x0001 -#define WPS_AUTH_WPAPSK 0x0002 -#define WPS_AUTH_SHARED 0x0004 -#define WPS_AUTH_WPA 0x0008 -#define WPS_AUTH_WPA2 0x0010 -#define WPS_AUTH_WPA2PSK 0x0020 -#define WPS_AUTH_TYPES (WPS_WIFI_AUTH_OPEN | WPS_AUTH_WPAPSK | WPS_AUTH_SHARED | \ - WPS_AUTH_WPA | WPS_AUTH_WPA2 | WPS_AUTH_WPA2PSK) - -/* Encryption Type Flags */ -#define WPS_ENCR_NONE 0x0001 -#define WPS_ENCR_WEP 0x0002 -#define WPS_ENCR_TKIP 0x0004 -#define WPS_ENCR_AES 0x0008 -#define WPS_ENCR_TYPES (WPS_ENCR_NONE | WPS_ENCR_WEP | WPS_ENCR_TKIP | \ - WPS_ENCR_AES) - -/* Configuration Error */ -enum wps_config_error { - WPS_CFG_NO_ERROR = 0, - WPS_CFG_OOB_IFACE_READ_ERROR = 1, - WPS_CFG_DECRYPTION_CRC_FAILURE = 2, - WPS_CFG_24_CHAN_NOT_SUPPORTED = 3, - WPS_CFG_50_CHAN_NOT_SUPPORTED = 4, - WPS_CFG_SIGNAL_TOO_WEAK = 5, - WPS_CFG_NETWORK_AUTH_FAILURE = 6, - WPS_CFG_NETWORK_ASSOC_FAILURE = 7, - WPS_CFG_NO_DHCP_RESPONSE = 8, - WPS_CFG_FAILED_DHCP_CONFIG = 9, - WPS_CFG_IP_ADDR_CONFLICT = 10, - WPS_CFG_NO_CONN_TO_REGISTRAR = 11, - WPS_CFG_MULTIPLE_PBC_DETECTED = 12, - WPS_CFG_ROGUE_SUSPECTED = 13, - WPS_CFG_DEVICE_BUSY = 14, - WPS_CFG_SETUP_LOCKED = 15, - WPS_CFG_MSG_TIMEOUT = 16, - WPS_CFG_REG_SESS_TIMEOUT = 17, - WPS_CFG_DEV_PASSWORD_AUTH_FAILURE = 18 -}; - -/* Vendor specific Error Indication for WPS event messages */ -enum wps_error_indication { - WPS_EI_NO_ERROR, - WPS_EI_SECURITY_TKIP_ONLY_PROHIBITED, - WPS_EI_SECURITY_WEP_PROHIBITED, - NUM_WPS_EI_VALUES -}; - -/* RF Bands */ -#define WPS_RF_24GHZ 0x01 -#define WPS_RF_50GHZ 0x02 - -/* Config Methods */ -#define WPS_CONFIG_USBA 0x0001 -#define WPS_CONFIG_ETHERNET 0x0002 -#define WPS_CONFIG_LABEL 0x0004 -#define WPS_CONFIG_DISPLAY 0x0008 -#define WPS_CONFIG_EXT_NFC_TOKEN 0x0010 -#define WPS_CONFIG_INT_NFC_TOKEN 0x0020 -#define WPS_CONFIG_NFC_INTERFACE 0x0040 -#define WPS_CONFIG_PUSHBUTTON 0x0080 -#define WPS_CONFIG_KEYPAD 0x0100 -#ifdef CONFIG_WPS2 -#define WPS_CONFIG_VIRT_PUSHBUTTON 0x0280 -#define WPS_CONFIG_PHY_PUSHBUTTON 0x0480 -#define WPS_CONFIG_VIRT_DISPLAY 0x2008 -#define WPS_CONFIG_PHY_DISPLAY 0x4008 -#endif /* CONFIG_WPS2 */ - -/* Connection Type Flags */ -#define WPS_CONN_ESS 0x01 -#define WPS_CONN_IBSS 0x02 - -/* Wi-Fi Protected Setup State */ -enum wps_state { - WPS_STATE_NOT_CONFIGURED = 1, - WPS_STATE_CONFIGURED = 2 -}; - -/* Association State */ -enum wps_assoc_state { - WPS_ASSOC_NOT_ASSOC = 0, - WPS_ASSOC_CONN_SUCCESS = 1, - WPS_ASSOC_CFG_FAILURE = 2, - WPS_ASSOC_FAILURE = 3, - WPS_ASSOC_IP_FAILURE = 4 -}; - - -#define WPS_DEV_OUI_WFA 0x0050f204 - -enum wps_dev_categ { - WPS_DEV_COMPUTER = 1, - WPS_DEV_INPUT = 2, - WPS_DEV_PRINTER = 3, - WPS_DEV_CAMERA = 4, - WPS_DEV_STORAGE = 5, - WPS_DEV_NETWORK_INFRA = 6, - WPS_DEV_DISPLAY = 7, - WPS_DEV_MULTIMEDIA = 8, - WPS_DEV_GAMING = 9, - WPS_DEV_PHONE = 10 -}; - -enum wps_dev_subcateg { - WPS_DEV_COMPUTER_PC = 1, - WPS_DEV_COMPUTER_SERVER = 2, - WPS_DEV_COMPUTER_MEDIA_CENTER = 3, - WPS_DEV_PRINTER_PRINTER = 1, - WPS_DEV_PRINTER_SCANNER = 2, - WPS_DEV_CAMERA_DIGITAL_STILL_CAMERA = 1, - WPS_DEV_STORAGE_NAS = 1, - WPS_DEV_NETWORK_INFRA_AP = 1, - WPS_DEV_NETWORK_INFRA_ROUTER = 2, - WPS_DEV_NETWORK_INFRA_SWITCH = 3, - WPS_DEV_DISPLAY_TV = 1, - WPS_DEV_DISPLAY_PICTURE_FRAME = 2, - WPS_DEV_DISPLAY_PROJECTOR = 3, - WPS_DEV_MULTIMEDIA_DAR = 1, - WPS_DEV_MULTIMEDIA_PVR = 2, - WPS_DEV_MULTIMEDIA_MCX = 3, - WPS_DEV_GAMING_XBOX = 1, - WPS_DEV_GAMING_XBOX360 = 2, - WPS_DEV_GAMING_PLAYSTATION = 3, - WPS_DEV_PHONE_WINDOWS_MOBILE = 1 -}; - - -/* Request Type */ -enum wps_request_type { - WPS_REQ_ENROLLEE_INFO = 0, - WPS_REQ_ENROLLEE = 1, - WPS_REQ_REGISTRAR = 2, - WPS_REQ_WLAN_MANAGER_REGISTRAR = 3 -}; - -/* Response Type */ -enum wps_response_type { - WPS_RESP_ENROLLEE_INFO = 0, - WPS_RESP_ENROLLEE = 1, - WPS_RESP_REGISTRAR = 2, - WPS_RESP_AP = 3 -}; - -/* Walk Time for push button configuration (in seconds) */ -#define WPS_PBC_WALK_TIME 120 - -#define WPS_MAX_AUTHORIZED_MACS 5 - -#define WPS_IGNORE_SEL_REG_MAX_CNT 4 - -#define WPS_MAX_DIS_AP_NUM 10 - -#endif /* WPS_DEFS_H */ diff --git a/tools/sdk/include/wpa_supplicant/wps/wps_dev_attr.h b/tools/sdk/include/wpa_supplicant/wps/wps_dev_attr.h deleted file mode 100644 index 200c9c45adc..00000000000 --- a/tools/sdk/include/wpa_supplicant/wps/wps_dev_attr.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Wi-Fi Protected Setup - device attributes - * Copyright (c) 2008, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef WPS_DEV_ATTR_H -#define WPS_DEV_ATTR_H - -struct wps_parse_attr; - -int wps_build_manufacturer(struct wps_device_data *dev, struct wpabuf *msg); -int wps_build_model_name(struct wps_device_data *dev, struct wpabuf *msg); -int wps_build_model_number(struct wps_device_data *dev, struct wpabuf *msg); -int wps_build_dev_name(struct wps_device_data *dev, struct wpabuf *msg); -int wps_build_device_attrs(struct wps_device_data *dev, struct wpabuf *msg); -int wps_build_os_version(struct wps_device_data *dev, struct wpabuf *msg); -int wps_build_vendor_ext_m1(struct wps_device_data *dev, struct wpabuf *msg); -int wps_build_rf_bands(struct wps_device_data *dev, struct wpabuf *msg); -int wps_build_primary_dev_type(struct wps_device_data *dev, - struct wpabuf *msg); -int wps_build_secondary_dev_type(struct wps_device_data *dev, - struct wpabuf *msg); -int wps_build_dev_name(struct wps_device_data *dev, struct wpabuf *msg); -int wps_process_device_attrs(struct wps_device_data *dev, - struct wps_parse_attr *attr); -int wps_process_os_version(struct wps_device_data *dev, const u8 *ver); -int wps_process_rf_bands(struct wps_device_data *dev, const u8 *bands); -void wps_device_data_dup(struct wps_device_data *dst, - const struct wps_device_data *src); -void wps_device_data_free(struct wps_device_data *dev); -int wps_build_vendor_ext(struct wps_device_data *dev, struct wpabuf *msg); -int wps_build_req_dev_type(struct wps_device_data *dev, struct wpabuf *msg, - unsigned int num_req_dev_types, - const u8 *req_dev_types); - -#endif /* WPS_DEV_ATTR_H */ diff --git a/tools/sdk/include/wpa_supplicant/wps/wps_i.h b/tools/sdk/include/wpa_supplicant/wps/wps_i.h deleted file mode 100644 index c20d5ef917c..00000000000 --- a/tools/sdk/include/wpa_supplicant/wps/wps_i.h +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Wi-Fi Protected Setup - internal definitions - * Copyright (c) 2008-2012, Jouni Malinen - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. - */ - -#ifndef WPS_I_H -#define WPS_I_H - -#include "wps.h" -#include "wps_attr_parse.h" -#include "esp_wifi_crypto_types.h" - -#ifdef CONFIG_WPS_NFC -struct wps_nfc_pw_token; -#endif -/** - * struct wps_data - WPS registration protocol data - * - * This data is stored at the EAP-WSC server/peer method and it is kept for a - * single registration protocol run. - */ -struct wps_data { - /** - * wps - Pointer to long term WPS context - */ - struct wps_context *wps; - - /** - * registrar - Whether this end is a Registrar - */ - int registrar; - - /** - * er - Whether the local end is an external registrar - */ - int er; - - enum { - /* Enrollee states */ - SEND_M1, RECV_M2, SEND_M3, RECV_M4, SEND_M5, RECV_M6, SEND_M7, - RECV_M8, RECEIVED_M2D, WPS_MSG_DONE, RECV_ACK, WPS_FINISHED, - SEND_WSC_NACK, - - /* Registrar states */ - RECV_M1, SEND_M2, RECV_M3, SEND_M4, RECV_M5, SEND_M6, - RECV_M7, SEND_M8, RECV_DONE, SEND_M2D, RECV_M2D_ACK - } state; - - u8 uuid_e[WPS_UUID_LEN]; - u8 uuid_r[WPS_UUID_LEN]; - u8 mac_addr_e[ETH_ALEN]; - u8 nonce_e[WPS_NONCE_LEN]; - u8 nonce_r[WPS_NONCE_LEN]; - u8 psk1[WPS_PSK_LEN]; - u8 psk2[WPS_PSK_LEN]; - u8 snonce[2 * WPS_SECRET_NONCE_LEN]; - u8 peer_hash1[WPS_HASH_LEN]; - u8 peer_hash2[WPS_HASH_LEN]; - - struct wpabuf *dh_privkey; - struct wpabuf *dh_pubkey_e; - struct wpabuf *dh_pubkey_r; - u8 authkey[WPS_AUTHKEY_LEN]; - u8 keywrapkey[WPS_KEYWRAPKEY_LEN]; - u8 emsk[WPS_EMSK_LEN]; - - struct wpabuf *last_msg; - - u8 *dev_password; - size_t dev_password_len; - u16 dev_pw_id; - int pbc; - - /** - * request_type - Request Type attribute from (Re)AssocReq - */ - u8 request_type; - - /** - * encr_type - Available encryption types - */ - u16 encr_type; - - /** - * auth_type - Available authentication types - */ - u16 auth_type; - - u8 *new_psk; - size_t new_psk_len; - - int wps_pin_revealed; - struct wps_credential cred; - - struct wps_device_data peer_dev; - - /** - * config_error - Configuration Error value to be used in NACK - */ - u16 config_error; - u16 error_indication; - - int ext_reg; - int int_reg; - - struct wps_credential *new_ap_settings; - - void *dh_ctx; - - void (*ap_settings_cb)(void *ctx, const struct wps_credential *cred); - void *ap_settings_cb_ctx; - - struct wps_credential *use_cred; - - int use_psk_key; - u8 p2p_dev_addr[ETH_ALEN]; /* P2P Device Address of the client or - * 00:00:00:00:00:00 if not a P2p client */ - int pbc_in_m1; -#ifdef CONFIG_WPS_NFC - struct wps_nfc_pw_token *nfc_pw_token; -#endif -}; - -wps_crypto_funcs_t wps_crypto_funcs; - -/* wps_common.c */ -void wps_kdf(const u8 *key, const u8 *label_prefix, size_t label_prefix_len, - const char *label, u8 *res, size_t res_len); -int wps_derive_keys(struct wps_data *wps); -void wps_derive_psk(struct wps_data *wps, const u8 *dev_passwd, - size_t dev_passwd_len); -struct wpabuf * wps_decrypt_encr_settings(struct wps_data *wps, const u8 *encr, - size_t encr_len); -void wps_fail_event(struct wps_context *wps, enum wps_msg_type msg, - u16 config_error, u16 error_indication); -void wps_success_event(struct wps_context *wps); -void wps_pwd_auth_fail_event(struct wps_context *wps, int enrollee, int part); -void wps_pbc_overlap_event(struct wps_context *wps); -void wps_pbc_timeout_event(struct wps_context *wps); - -struct wpabuf * wps_build_wsc_ack(struct wps_data *wps); -struct wpabuf * wps_build_wsc_nack(struct wps_data *wps); - -typedef enum wps_calc_key_mode { - WPS_CALC_KEY_NORMAL = 0, - WPS_CALC_KEY_NO_CALC, - WPS_CALC_KEY_PRE_CALC, - WPS_CALC_KEY_MAX, -} wps_key_mode_t; - -/* wps_attr_build.c */ -int wps_build_public_key(struct wps_data *wps, struct wpabuf *msg, wps_key_mode_t mode); -int wps_build_req_type(struct wpabuf *msg, enum wps_request_type type); -int wps_build_resp_type(struct wpabuf *msg, enum wps_response_type type); -int wps_build_config_methods(struct wpabuf *msg, u16 methods); -int wps_build_uuid_e(struct wpabuf *msg, const u8 *uuid); -int wps_build_dev_password_id(struct wpabuf *msg, u16 id); -int wps_build_config_error(struct wpabuf *msg, u16 err); -int wps_build_authenticator(struct wps_data *wps, struct wpabuf *msg); -int wps_build_key_wrap_auth(struct wps_data *wps, struct wpabuf *msg); -int wps_build_encr_settings(struct wps_data *wps, struct wpabuf *msg, - struct wpabuf *plain); -int wps_build_version(struct wpabuf *msg); -int wps_build_wfa_ext(struct wpabuf *msg, int req_to_enroll, - const u8 *auth_macs, size_t auth_macs_count); -int wps_build_msg_type(struct wpabuf *msg, enum wps_msg_type msg_type); -int wps_build_enrollee_nonce(struct wps_data *wps, struct wpabuf *msg); -int wps_build_registrar_nonce(struct wps_data *wps, struct wpabuf *msg); -int wps_build_auth_type_flags(struct wps_data *wps, struct wpabuf *msg); -int wps_build_encr_type_flags(struct wps_data *wps, struct wpabuf *msg); -int wps_build_conn_type_flags(struct wps_data *wps, struct wpabuf *msg); -int wps_build_assoc_state(struct wps_data *wps, struct wpabuf *msg); -int wps_build_oob_dev_pw(struct wpabuf *msg, u16 dev_pw_id, - const struct wpabuf *pubkey, const u8 *dev_pw, - size_t dev_pw_len); -struct wpabuf * wps_ie_encapsulate(struct wpabuf *data); - -/* wps_attr_process.c */ -int wps_process_authenticator(struct wps_data *wps, const u8 *authenticator, - const struct wpabuf *msg); -int wps_process_key_wrap_auth(struct wps_data *wps, struct wpabuf *msg, - const u8 *key_wrap_auth); -int wps_process_cred(struct wps_parse_attr *attr, - struct wps_credential *cred); -int wps_process_ap_settings(struct wps_parse_attr *attr, - struct wps_credential *cred); - -/* wps_enrollee.c */ -struct wpabuf * wps_enrollee_get_msg(struct wps_data *wps, - enum wsc_op_code *op_code); -enum wps_process_res wps_enrollee_process_msg(struct wps_data *wps, - enum wsc_op_code op_code, - const struct wpabuf *msg); - -/* wps_registrar.c */ -struct wpabuf * wps_registrar_get_msg(struct wps_data *wps, - enum wsc_op_code *op_code); -enum wps_process_res wps_registrar_process_msg(struct wps_data *wps, - enum wsc_op_code op_code, - const struct wpabuf *msg); -int wps_build_cred(struct wps_data *wps, struct wpabuf *msg); -int wps_device_store(struct wps_registrar *reg, - struct wps_device_data *dev, const u8 *uuid); -void wps_registrar_selected_registrar_changed(struct wps_registrar *reg); -const u8 * wps_authorized_macs(struct wps_registrar *reg, size_t *count); -int wps_registrar_pbc_overlap(struct wps_registrar *reg, - const u8 *addr, const u8 *uuid_e); -#ifdef CONFIG_WPS_NFC - -void wps_registrar_remove_nfc_pw_token(struct wps_registrar *reg, - struct wps_nfc_pw_token *token); -#endif - -#endif /* WPS_I_H */ diff --git a/tools/sdk/include/xtensa-debug-module/eri.h b/tools/sdk/include/xtensa-debug-module/eri.h deleted file mode 100644 index 33e4dd09180..00000000000 --- a/tools/sdk/include/xtensa-debug-module/eri.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef ERI_H -#define ERI_H - -#include - -/* - The ERI is a bus internal to each Xtensa core. It connects, amongst others, to the debug interface, where it - allows reading/writing the same registers as available over JTAG. -*/ - - -/** - * @brief Perform an ERI read - * @param addr : ERI register to read from - * - * @return Value read - */ -uint32_t eri_read(int addr); - - -/** - * @brief Perform an ERI write - * @param addr : ERI register to write to - * @param data : Value to write - * - * @return Value read - */ -void eri_write(int addr, uint32_t data); - - -#endif \ No newline at end of file diff --git a/tools/sdk/include/xtensa-debug-module/trax.h b/tools/sdk/include/xtensa-debug-module/trax.h deleted file mode 100644 index c1b3608eb81..00000000000 --- a/tools/sdk/include/xtensa-debug-module/trax.h +++ /dev/null @@ -1,62 +0,0 @@ -#include "soc/dport_reg.h" -#include "sdkconfig.h" -#include "esp_err.h" -#include "eri.h" -#include "xtensa-debug-module.h" - - -typedef enum { - TRAX_DOWNCOUNT_WORDS, - TRAX_DOWNCOUNT_INSTRUCTIONS -} trax_downcount_unit_t; - -typedef enum { - TRAX_ENA_NONE = 0, - TRAX_ENA_PRO, - TRAX_ENA_APP, - TRAX_ENA_PRO_APP, - TRAX_ENA_PRO_APP_SWAP -} trax_ena_select_t; - - -/** - * @brief Enable the trax memory blocks to be used as Trax memory. - * - * @param pro_cpu_enable : true if Trax needs to be enabled for the pro CPU - * @param app_cpu_enable : true if Trax needs to be enabled for the pro CPU - * @param swap_regions : Normally, the pro CPU writes to Trax mem block 0 while - * the app cpu writes to block 1. Setting this to true - * inverts this. - * - * @return esp_err_t. Fails with ESP_ERR_NO_MEM if Trax enable is requested for 2 CPUs - * but memmap only has room for 1, or if Trax memmap is disabled - * entirely. - */ -int trax_enable(trax_ena_select_t ena); - -/** - * @brief Start a Trax trace on the current CPU - * - * @param units_until_stop : Set the units of the delay that gets passed to - * trax_trigger_traceend_after_delay. One of TRAX_DOWNCOUNT_WORDS - * or TRAX_DOWNCOUNT_INSTRUCTIONS. - * - * @return esp_err_t. Fails with ESP_ERR_NO_MEM if Trax is disabled. - */ -int trax_start_trace(trax_downcount_unit_t units_until_stop); - - -/** - * @brief Trigger a Trax trace stop after the indicated delay. If this is called - * before and the previous delay hasn't ended yet, this will overwrite - * that delay with the new value. The delay will always start at the time - * the function is called. - * - * @param delay : The delay to stop the trace in, in the unit indicated to - * trax_start_trace. Note: the trace memory has 4K words available. - * - * @return esp_err_t - */ -int trax_trigger_traceend_after_delay(int delay); - - diff --git a/tools/sdk/include/xtensa-debug-module/xtensa-debug-module.h b/tools/sdk/include/xtensa-debug-module/xtensa-debug-module.h deleted file mode 100644 index 61b21825314..00000000000 --- a/tools/sdk/include/xtensa-debug-module/xtensa-debug-module.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef XTENSA_DEBUG_MODULE_H -#define XTENSA_DEBUG_MODULE_H - -/* -ERI registers / OCD offsets and field definitions -*/ - -#define ERI_DEBUG_OFFSET 0x100000 - -#define ERI_TRAX_OFFSET (ERI_DEBUG_OFFSET+0) -#define ERI_PERFMON_OFFSET (ERI_DEBUG_OFFSET+0x1000) -#define ERI_OCDREG_OFFSET (ERI_DEBUG_OFFSET+0x2000) -#define ERI_MISCDBG_OFFSET (ERI_DEBUG_OFFSET+0x3000) -#define ERI_CORESIGHT_OFFSET (ERI_DEBUG_OFFSET+0x3F00) - -#define ERI_TRAX_TRAXID (ERI_TRAX_OFFSET+0x00) -#define ERI_TRAX_TRAXCTRL (ERI_TRAX_OFFSET+0x04) -#define ERI_TRAX_TRAXSTAT (ERI_TRAX_OFFSET+0x08) -#define ERI_TRAX_TRAXDATA (ERI_TRAX_OFFSET+0x0C) -#define ERI_TRAX_TRAXADDR (ERI_TRAX_OFFSET+0x10) -#define ERI_TRAX_TRIGGERPC (ERI_TRAX_OFFSET+0x14) -#define ERI_TRAX_PCMATCHCTRL (ERI_TRAX_OFFSET+0x18) -#define ERI_TRAX_DELAYCNT (ERI_TRAX_OFFSET+0x1C) -#define ERI_TRAX_MEMADDRSTART (ERI_TRAX_OFFSET+0x20) -#define ERI_TRAX_MEMADDREND (ERI_TRAX_OFFSET+0x24) - -#define TRAXCTRL_TREN (1<<0) //Trace enable. Tracing starts on 0->1 -#define TRAXCTRL_TRSTP (1<<1) //Trace Stop. Make 1 to stop trace. -#define TRAXCTRL_PCMEN (1<<2) //PC match enable -#define TRAXCTRL_PTIEN (1<<4) //Processor-trigger enable -#define TRAXCTRL_CTIEN (1<<5) //Cross-trigger enable -#define TRAXCTRL_TMEN (1<<7) //Tracemem Enable. Always set. -#define TRAXCTRL_CNTU (1<<9) //Post-stop-trigger countdown units; selects when DelayCount-- happens. - //0 - every 32-bit word written to tracemem, 1 - every cpu instruction -#define TRAXCTRL_TSEN (1<<11) //Undocumented/deprecated? -#define TRAXCTRL_SMPER_SHIFT 12 //Send sync every 2^(9-smper) messages. 7=reserved, 0=no sync msg -#define TRAXCTRL_SMPER_MASK 0x7 //Synchronization message period -#define TRAXCTRL_PTOWT (1<<16) //Processor Trigger Out (OCD halt) enabled when stop triggered -#define TRAXCTRL_PTOWS (1<<17) //Processor Trigger Out (OCD halt) enabled when trace stop completes -#define TRAXCTRL_CTOWT (1<<20) //Cross-trigger Out enabled when stop triggered -#define TRAXCTRL_CTOWS (1<<21) //Cross-trigger Out enabled when trace stop completes -#define TRAXCTRL_ITCTO (1<<22) //Integration mode: cross-trigger output -#define TRAXCTRL_ITCTIA (1<<23) //Integration mode: cross-trigger ack -#define TRAXCTRL_ITATV (1<<24) //replaces ATID when in integration mode: ATVALID output -#define TRAXCTRL_ATID_MASK 0x7F //ARB source ID -#define TRAXCTRL_ATID_SHIFT 24 -#define TRAXCTRL_ATEN (1<<31) //ATB interface enable - -#define TRAXSTAT_TRACT (1<<0) //Trace active flag. -#define TRAXSTAT_TRIG (1<<1) //Trace stop trigger. Clears on TREN 1->0 -#define TRAXSTAT_PCMTG (1<<2) //Stop trigger caused by PC match. Clears on TREN 1->0 -#define TRAXSTAT_PJTR (1<<3) //JTAG transaction result. 1=err in preceding jtag transaction. -#define TRAXSTAT_PTITG (1<<4) //Stop trigger caused by Processor Trigger Input. Clears on TREN 1->0 -#define TRAXSTAT_CTITG (1<<5) //Stop trigger caused by Cross-Trigger Input. Clears on TREN 1->0 -#define TRAXSTAT_MEMSZ_SHIFT 8 //Traceram size inducator. Usable trace ram is 2^MEMSZ bytes. -#define TRAXSTAT_MEMSZ_MASK 0x1F -#define TRAXSTAT_PTO (1<<16) //Processor Trigger Output: current value -#define TRAXSTAT_CTO (1<<17) //Cross-Trigger Output: current value -#define TRAXSTAT_ITCTOA (1<<22) //Cross-Trigger Out Ack: current value -#define TRAXSTAT_ITCTI (1<<23) //Cross-Trigger Input: current value -#define TRAXSTAT_ITATR (1<<24) //ATREADY Input: current value - -#define TRAXADDR_TADDR_SHIFT 0 //Trax memory address, in 32-bit words. -#define TRAXADDR_TADDR_MASK 0x1FFFFF //Actually is only as big as the trace buffer size max addr. -#define TRAXADDR_TWRAP_SHIFT 21 //Amount of times TADDR has overflown -#define TRAXADDR_TWRAP_MASK 0x3FF -#define TRAXADDR_TWSAT (1<<31) //1 if TWRAP has overflown, clear by disabling tren. - -#define PCMATCHCTRL_PCML_SHIFT 0 //Amount of lower bits to ignore in pc trigger register -#define PCMATCHCTRL_PCML_MASK 0x1F -#define PCMATCHCTRL_PCMS (1<<31) //PC Match Sense, 0 - match when procs PC is in-range, 1 - match when - //out-of-range - - -#endif \ No newline at end of file diff --git a/tools/sdk/ld/esp32.common.ld b/tools/sdk/ld/esp32.common.ld deleted file mode 100644 index 179b1abdc21..00000000000 --- a/tools/sdk/ld/esp32.common.ld +++ /dev/null @@ -1,343 +0,0 @@ -/* Default entry point: */ -ENTRY(call_start_cpu0); - -SECTIONS -{ - /* RTC fast memory holds RTC wake stub code, - including from any source file named rtc_wake_stub*.c - */ - .rtc.text : - { - . = ALIGN(4); - *(.rtc.literal .rtc.text) - *rtc_wake_stub*.*(.literal .text .literal.* .text.*) - _rtc_text_end = ABSOLUTE(.); - } > rtc_iram_seg - - /* - This section is required to skip rtc.text area because rtc_iram_seg and - rtc_data_seg are reflect the same address space on different buses. - */ - .rtc.dummy : - { - _rtc_dummy_start = ABSOLUTE(.); - _rtc_fast_start = ABSOLUTE(.); - . = SIZEOF(.rtc.text); - _rtc_dummy_end = ABSOLUTE(.); - } > rtc_data_seg - - /* This section located in RTC FAST Memory area. - It holds data marked with RTC_FAST_ATTR attribute. - See the file "esp_attr.h" for more information. - */ - .rtc.force_fast : - { - . = ALIGN(4); - _rtc_force_fast_start = ABSOLUTE(.); - *(.rtc.force_fast .rtc.force_fast.*) - . = ALIGN(4) ; - _rtc_force_fast_end = ABSOLUTE(.); - } > rtc_data_seg - - /* RTC data section holds RTC wake stub - data/rodata, including from any source file - named rtc_wake_stub*.c and the data marked with - RTC_DATA_ATTR, RTC_RODATA_ATTR attributes. - The memory location of the data is dependent on - CONFIG_ESP32_RTCDATA_IN_FAST_MEM option. - */ - .rtc.data : - { - _rtc_data_start = ABSOLUTE(.); - *(.rtc.data) - *(.rtc.rodata) - *rtc_wake_stub*.*(.data .rodata .data.* .rodata.* .bss .bss.*) - _rtc_data_end = ABSOLUTE(.); - } > rtc_data_location - - /* RTC bss, from any source file named rtc_wake_stub*.c */ - .rtc.bss (NOLOAD) : - { - _rtc_bss_start = ABSOLUTE(.); - *rtc_wake_stub*.*(.bss .bss.*) - *rtc_wake_stub*.*(COMMON) - *(.rtc.bss) - _rtc_bss_end = ABSOLUTE(.); - } > rtc_data_location - - /* This section holds data that should not be initialized at power up - and will be retained during deep sleep. - User data marked with RTC_NOINIT_ATTR will be placed - into this section. See the file "esp_attr.h" for more information. - The memory location of the data is dependent on - CONFIG_ESP32_RTCDATA_IN_FAST_MEM option. - */ - .rtc_noinit (NOLOAD): - { - . = ALIGN(4); - _rtc_noinit_start = ABSOLUTE(.); - *(.rtc_noinit .rtc_noinit.*) - . = ALIGN(4) ; - _rtc_noinit_end = ABSOLUTE(.); - } > rtc_data_location - - /* This section located in RTC SLOW Memory area. - It holds data marked with RTC_SLOW_ATTR attribute. - See the file "esp_attr.h" for more information. - */ - .rtc.force_slow : - { - . = ALIGN(4); - _rtc_force_slow_start = ABSOLUTE(.); - *(.rtc.force_slow .rtc.force_slow.*) - . = ALIGN(4) ; - _rtc_force_slow_end = ABSOLUTE(.); - } > rtc_slow_seg - - /* Get size of rtc slow data based on rtc_data_location alias */ - _rtc_slow_length = (ORIGIN(rtc_slow_seg) == ORIGIN(rtc_data_location)) - ? (_rtc_force_slow_end - _rtc_data_start) - : (_rtc_force_slow_end - _rtc_force_slow_start); - - _rtc_fast_length = (ORIGIN(rtc_slow_seg) == ORIGIN(rtc_data_location)) - ? (_rtc_force_fast_end - _rtc_fast_start) - : (_rtc_noinit_end - _rtc_fast_start); - - ASSERT((_rtc_slow_length <= LENGTH(rtc_slow_seg)), - "RTC_SLOW segment data does not fit.") - - ASSERT((_rtc_fast_length <= LENGTH(rtc_data_seg)), - "RTC_FAST segment data does not fit.") - - /* Send .iram0 code to iram */ - .iram0.vectors : - { - _iram_start = ABSOLUTE(.); - /* Vectors go to IRAM */ - _init_start = ABSOLUTE(.); - /* Vectors according to builds/RF-2015.2-win32/esp108_v1_2_s5_512int_2/config.html */ - . = 0x0; - KEEP(*(.WindowVectors.text)); - . = 0x180; - KEEP(*(.Level2InterruptVector.text)); - . = 0x1c0; - KEEP(*(.Level3InterruptVector.text)); - . = 0x200; - KEEP(*(.Level4InterruptVector.text)); - . = 0x240; - KEEP(*(.Level5InterruptVector.text)); - . = 0x280; - KEEP(*(.DebugExceptionVector.text)); - . = 0x2c0; - KEEP(*(.NMIExceptionVector.text)); - . = 0x300; - KEEP(*(.KernelExceptionVector.text)); - . = 0x340; - KEEP(*(.UserExceptionVector.text)); - . = 0x3C0; - KEEP(*(.DoubleExceptionVector.text)); - . = 0x400; - *(.*Vector.literal) - - *(.UserEnter.literal); - *(.UserEnter.text); - . = ALIGN (16); - *(.entry.text) - *(.init.literal) - *(.init) - _init_end = ABSOLUTE(.); - } > iram0_0_seg - - .iram0.text : - { - /* Code marked as runnning out of IRAM */ - _iram_text_start = ABSOLUTE(.); - *(.iram1 .iram1.*) - *libesp_ringbuf.a:(.literal .text .literal.* .text.*) - *libfreertos.a:(.literal .text .literal.* .text.*) - *libheap.a:multi_heap.*(.literal .text .literal.* .text.*) - *libheap.a:multi_heap_poisoning.*(.literal .text .literal.* .text.*) - *libesp32.a:panic.*(.literal .text .literal.* .text.*) - *libesp32.a:core_dump.*(.literal .text .literal.* .text.*) - INCLUDE wifi_iram.ld - *libapp_trace.a:(.literal .text .literal.* .text.*) - *libxtensa-debug-module.a:eri.*(.literal .text .literal.* .text.*) - *librtc.a:(.literal .text .literal.* .text.*) - *libsoc.a:rtc_*.*(.literal .text .literal.* .text.*) - *libsoc.a:cpu_util.*(.literal .text .literal.* .text.*) - *libhal.a:(.literal .text .literal.* .text.*) - *libgcc.a:lib2funcs.*(.literal .text .literal.* .text.*) - *libspi_flash.a:spi_flash_rom_patch.*(.literal .text .literal.* .text.*) - *libgcov.a:(.literal .text .literal.* .text.*) - INCLUDE esp32.spiram.rom-functions-iram.ld - _iram_text_end = ABSOLUTE(.); - _iram_end = ABSOLUTE(.); - } > iram0_0_seg - - ASSERT(((_iram_text_end - ORIGIN(iram0_0_seg)) <= LENGTH(iram0_0_seg)), - "IRAM0 segment data does not fit.") - - .dram0.data : - { - _data_start = ABSOLUTE(.); - _bt_data_start = ABSOLUTE(.); - *libbt.a:(.data .data.*) - . = ALIGN (4); - _bt_data_end = ABSOLUTE(.); - _btdm_data_start = ABSOLUTE(.); - *libbtdm_app.a:(.data .data.*) - . = ALIGN (4); - _btdm_data_end = ABSOLUTE(.); - *(.data) - *(.data.*) - *(.gnu.linkonce.d.*) - *(.data1) - *(.sdata) - *(.sdata.*) - *(.gnu.linkonce.s.*) - *(.sdata2) - *(.sdata2.*) - *(.gnu.linkonce.s2.*) - *(.jcr) - *(.dram1 .dram1.*) - *libesp32.a:panic.*(.rodata .rodata.*) - *libphy.a:(.rodata .rodata.*) - *libsoc.a:rtc_clk.*(.rodata .rodata.*) - *libapp_trace.a:(.rodata .rodata.*) - *libgcov.a:(.rodata .rodata.*) - *libheap.a:multi_heap.*(.rodata .rodata.*) - *libheap.a:multi_heap_poisoning.*(.rodata .rodata.*) - INCLUDE esp32.spiram.rom-functions-dram.ld - _data_end = ABSOLUTE(.); - . = ALIGN(4); - } > dram0_0_seg - - /*This section holds data that should not be initialized at power up. - The section located in Internal SRAM memory region. The macro _NOINIT - can be used as attribute to place data into this section. - See the esp_attr.h file for more information. - */ - .noinit (NOLOAD): - { - . = ALIGN(4); - _noinit_start = ABSOLUTE(.); - *(.noinit .noinit.*) - . = ALIGN(4) ; - _noinit_end = ABSOLUTE(.); - } > dram0_0_seg - - /* Shared RAM */ - .dram0.bss (NOLOAD) : - { - . = ALIGN (8); - _bss_start = ABSOLUTE(.); - *(.ext_ram.bss*) - _bt_bss_start = ABSOLUTE(.); - *libbt.a:(.bss .bss.* COMMON) - . = ALIGN (4); - _bt_bss_end = ABSOLUTE(.); - _btdm_bss_start = ABSOLUTE(.); - *libbtdm_app.a:(.bss .bss.* COMMON) - . = ALIGN (4); - _btdm_bss_end = ABSOLUTE(.); - *(.dynsbss) - *(.sbss) - *(.sbss.*) - *(.gnu.linkonce.sb.*) - *(.scommon) - *(.sbss2) - *(.sbss2.*) - *(.gnu.linkonce.sb2.*) - *(.dynbss) - *(.bss) - *(.bss.*) - *(.share.mem) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN (8); - _bss_end = ABSOLUTE(.); - /* The heap starts right after end of this section */ - _heap_start = ABSOLUTE(.); - } > dram0_0_seg - - ASSERT(((_bss_end - ORIGIN(dram0_0_seg)) <= LENGTH(dram0_0_seg)), - "DRAM segment data does not fit.") - - .flash.rodata : - { - _rodata_start = ABSOLUTE(.); - *(.rodata) - *(.rodata.*) - *(.irom1.text) /* catch stray ICACHE_RODATA_ATTR */ - *(.gnu.linkonce.r.*) - *(.rodata1) - __XT_EXCEPTION_TABLE_ = ABSOLUTE(.); - *(.xt_except_table) - *(.gcc_except_table .gcc_except_table.*) - *(.gnu.linkonce.e.*) - *(.gnu.version_r) - . = (. + 3) & ~ 3; - __eh_frame = ABSOLUTE(.); - KEEP(*(.eh_frame)) - . = (. + 7) & ~ 3; - /* C++ constructor and destructor tables, properly ordered: */ - __init_array_start = ABSOLUTE(.); - KEEP (*crtbegin.*(.ctors)) - KEEP (*(EXCLUDE_FILE (*crtend.*) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - __init_array_end = ABSOLUTE(.); - KEEP (*crtbegin.*(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.*) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - /* C++ exception handlers table: */ - __XT_EXCEPTION_DESCS_ = ABSOLUTE(.); - *(.xt_except_desc) - *(.gnu.linkonce.h.*) - __XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.); - *(.xt_except_desc_end) - *(.dynamic) - *(.gnu.version_d) - /* Addresses of memory regions reserved via - SOC_RESERVE_MEMORY_REGION() */ - soc_reserved_memory_region_start = ABSOLUTE(.); - KEEP (*(.reserved_memory_address)) - soc_reserved_memory_region_end = ABSOLUTE(.); - _rodata_end = ABSOLUTE(.); - /* Literals are also RO data. */ - _lit4_start = ABSOLUTE(.); - *(*.lit4) - *(.lit4.*) - *(.gnu.linkonce.lit4.*) - _lit4_end = ABSOLUTE(.); - . = ALIGN(4); - _thread_local_start = ABSOLUTE(.); - *(.tdata) - *(.tdata.*) - *(.tbss) - *(.tbss.*) - _thread_local_end = ABSOLUTE(.); - . = ALIGN(4); - } >drom0_0_seg - - .flash.text : - { - _stext = .; - _text_start = ABSOLUTE(.); - *(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*) - *(.irom0.text) /* catch stray ICACHE_RODATA_ATTR */ - *(.wifi0iram .wifi0iram.*) /* catch stray WIFI_IRAM_ATTR */ - *(.fini.literal) - *(.fini) - *(.gnu.version) - _text_end = ABSOLUTE(.); - _etext = .; - - /* Similar to _iram_start, this symbol goes here so it is - resolved by addr2line in preference to the first symbol in - the flash.text segment. - */ - _flash_cache_start = ABSOLUTE(0); - } >iram0_2_seg -} diff --git a/tools/sdk/ld/esp32.extram.bss.ld b/tools/sdk/ld/esp32.extram.bss.ld deleted file mode 100644 index 582f6eb6ea2..00000000000 --- a/tools/sdk/ld/esp32.extram.bss.ld +++ /dev/null @@ -1,18 +0,0 @@ -/* This section is only included if CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY - is set, to link some sections to BSS in PSRAM */ - -SECTIONS -{ - /* external memory bss, from any global variable with EXT_RAM_ATTR attribute*/ - .ext_ram.bss (NOLOAD) : - { - _ext_ram_bss_start = ABSOLUTE(.); - *(.ext_ram.bss*) - *libnet80211.a:(.dynsbss .sbss .sbss.* .gnu.linkonce.sb.* .scommon .sbss2.* .gnu.linkonce.sb2.* .dynbss .bss .bss.* .share.mem .gnu.linkonce.b.* COMMON) - *libpp.a:(.dynsbss .sbss .sbss.* .gnu.linkonce.sb.* .scommon .sbss2.* .gnu.linkonce.sb2.* .dynbss .bss .bss.* .share.mem .gnu.linkonce.b.* COMMON) - *liblwip.a:(.dynsbss .sbss .sbss.* .gnu.linkonce.sb.* .scommon .sbss2.* .gnu.linkonce.sb2.* .dynbss .bss .bss.* .share.mem .gnu.linkonce.b.* COMMON) - *libbt.a:(EXCLUDE_FILE (libbtdm_app.a) .dynsbss .sbss .sbss.* .gnu.linkonce.sb.* .scommon .sbss2.* .gnu.linkonce.sb2.* .dynbss .bss .bss.* .share.mem .gnu.linkonce.b.* COMMON) - . = ALIGN(4); - _ext_ram_bss_end = ABSOLUTE(.); - } > extern_ram_seg -} diff --git a/tools/sdk/ld/esp32.ld b/tools/sdk/ld/esp32.ld deleted file mode 100644 index fd02e0d2108..00000000000 --- a/tools/sdk/ld/esp32.ld +++ /dev/null @@ -1,92 +0,0 @@ -/* ESP32 Linker Script Memory Layout - - This file describes the memory layout (memory blocks) as virtual - memory addresses. - - esp32.common.ld contains output sections to link compiler output - into these memory blocks. - - *** - - This linker script is passed through the C preprocessor to include - configuration options. - - Please use preprocessor features sparingly! Restrict - to simple macros with numeric values, and/or #if/#endif blocks. -*/ -#include "sdkconfig.h" - -/* If BT is not built at all */ -#ifndef CONFIG_BT_RESERVE_DRAM -#define CONFIG_BT_RESERVE_DRAM 0 -#endif - -MEMORY -{ - /* All these values assume the flash cache is on, and have the blocks this uses subtracted from the length - of the various regions. The 'data access port' dram/drom regions map to the same iram/irom regions but - are connected to the data port of the CPU and eg allow bytewise access. */ - - /* IRAM for PRO cpu. Not sure if happy with this, this is MMU area... */ - iram0_0_seg (RX) : org = 0x40080000, len = 0x20000 - - /* Even though the segment name is iram, it is actually mapped to flash - */ - iram0_2_seg (RX) : org = 0x400D0018, len = 0x330000-0x18 - - /* - (0x18 offset above is a convenience for the app binary image generation. Flash cache has 64KB pages. The .bin file - which is flashed to the chip has a 0x18 byte file header. Setting this offset makes it simple to meet the flash - cache MMU's constraint that (paddr % 64KB == vaddr % 64KB).) - */ - - - /* Shared data RAM, excluding memory reserved for ROM bss/data/stack. - - Enabling Bluetooth & Trace Memory features in menuconfig will decrease - the amount of RAM available. - - Note: Length of this section *should* be 0x50000, and this extra DRAM is available - in heap at runtime. However due to static ROM memory usage at this 176KB mark, the - additional static memory temporarily cannot be used. - */ - dram0_0_seg (RW) : org = 0x3FFB0000 + CONFIG_BT_RESERVE_DRAM, - len = 0x2c200 - CONFIG_BT_RESERVE_DRAM - - /* Flash mapped constant data */ - drom0_0_seg (R) : org = 0x3F400018, len = 0x400000-0x18 - - /* (See iram0_2_seg for meaning of 0x18 offset in the above.) */ - - /* RTC fast memory (executable). Persists over deep sleep. - */ - rtc_iram_seg(RWX) : org = 0x400C0000, len = 0x2000 - - /* RTC fast memory (same block as above), viewed from data bus */ - rtc_data_seg(RW) : org = 0x3ff80000, len = 0x2000 - - /* RTC slow memory (data accessible). Persists over deep sleep. - - Start of RTC slow memory is reserved for ULP co-processor code + data, if enabled. - */ - rtc_slow_seg(RW) : org = 0x50000000 + CONFIG_ULP_COPROC_RESERVE_MEM, - len = 0x1000 - CONFIG_ULP_COPROC_RESERVE_MEM - - /* external memory ,including data and text */ - extern_ram_seg(RWX) : org = 0x3F800000, - len = 0x400000 -} - -/* Heap ends at top of dram0_0_seg */ -_heap_end = 0x40000000 - CONFIG_TRACEMEM_RESERVE_DRAM; - -_data_seg_org = ORIGIN(rtc_data_seg); - -/* The lines below define location alias for .rtc.data section based on Kconfig option. - When the option is not defined then use slow memory segment - else the data will be placed in fast memory segment */ -#ifndef CONFIG_ESP32_RTCDATA_IN_FAST_MEM -REGION_ALIAS("rtc_data_location", rtc_slow_seg ); -#else -REGION_ALIAS("rtc_data_location", rtc_data_seg ); -#endif diff --git a/tools/sdk/ld/esp32.peripherals.ld b/tools/sdk/ld/esp32.peripherals.ld deleted file mode 100644 index 2dce0e0fcf7..00000000000 --- a/tools/sdk/ld/esp32.peripherals.ld +++ /dev/null @@ -1,32 +0,0 @@ -PROVIDE ( UART0 = 0x3ff40000 ); -PROVIDE ( SPI1 = 0x3ff42000 ); -PROVIDE ( SPI0 = 0x3ff43000 ); -PROVIDE ( GPIO = 0x3ff44000 ); -PROVIDE ( SIGMADELTA = 0x3ff44f00 ); -PROVIDE ( RTCCNTL = 0x3ff48000 ); -PROVIDE ( RTCIO = 0x3ff48400 ); -PROVIDE ( SENS = 0x3ff48800 ); -PROVIDE ( HINF = 0x3ff4B000 ); -PROVIDE ( UHCI1 = 0x3ff4C000 ); -PROVIDE ( I2S0 = 0x3ff4F000 ); -PROVIDE ( UART1 = 0x3ff50000 ); -PROVIDE ( I2C0 = 0x3ff53000 ); -PROVIDE ( UHCI0 = 0x3ff54000 ); -PROVIDE ( HOST = 0x3ff55000 ); -PROVIDE ( RMT = 0x3ff56000 ); -PROVIDE ( RMTMEM = 0x3ff56800 ); -PROVIDE ( PCNT = 0x3ff57000 ); -PROVIDE ( SLC = 0x3ff58000 ); -PROVIDE ( LEDC = 0x3ff59000 ); -PROVIDE ( MCPWM0 = 0x3ff5E000 ); -PROVIDE ( TIMERG0 = 0x3ff5F000 ); -PROVIDE ( TIMERG1 = 0x3ff60000 ); -PROVIDE ( SPI2 = 0x3ff64000 ); -PROVIDE ( SPI3 = 0x3ff65000 ); -PROVIDE ( SYSCON = 0x3ff66000 ); -PROVIDE ( I2C1 = 0x3ff67000 ); -PROVIDE ( SDMMC = 0x3ff68000 ); -PROVIDE ( CAN = 0x3ff6B000 ); -PROVIDE ( MCPWM1 = 0x3ff6C000 ); -PROVIDE ( I2S1 = 0x3ff6D000 ); -PROVIDE ( UART2 = 0x3ff6E000 ); diff --git a/tools/sdk/ld/esp32.rom.ld b/tools/sdk/ld/esp32.rom.ld deleted file mode 100644 index c1e3e94bcb2..00000000000 --- a/tools/sdk/ld/esp32.rom.ld +++ /dev/null @@ -1,1619 +0,0 @@ -/* -ESP32 ROM address table -Generated for ROM with MD5sum: -ab8282ae908fe9e7a63fb2a4ac2df013 ../../rom_image/prorom.elf -*/ -PROVIDE ( Add2SelfBigHex256 = 0x40015b7c ); -PROVIDE ( AddBigHex256 = 0x40015b28 ); -PROVIDE ( AddBigHexModP256 = 0x40015c98 ); -PROVIDE ( AddP256 = 0x40015c74 ); -PROVIDE ( AddPdiv2_256 = 0x40015ce0 ); -PROVIDE ( app_gpio_arg = 0x3ffe003c ); -PROVIDE ( app_gpio_handler = 0x3ffe0040 ); -PROVIDE ( BasePoint_x_256 = 0x3ff97488 ); -PROVIDE ( BasePoint_y_256 = 0x3ff97468 ); -PROVIDE ( bigHexInversion256 = 0x400168f0 ); -PROVIDE ( bigHexP256 = 0x3ff973bc ); -PROVIDE ( btdm_r_ble_bt_handler_tab_p_get = 0x40019b0c ); -PROVIDE ( btdm_r_btdm_option_data_p_get = 0x40010004 ); -PROVIDE ( btdm_r_btdm_rom_version_get = 0x40010078 ); -PROVIDE ( btdm_r_data_init = 0x4001002c ); -PROVIDE ( btdm_r_import_rf_phy_func_p_get = 0x40054298 ); -PROVIDE ( btdm_r_ip_func_p_get = 0x40019af0 ); -PROVIDE ( btdm_r_ip_func_p_set = 0x40019afc ); -PROVIDE ( btdm_r_modules_func_p_get = 0x4005427c ); -PROVIDE ( btdm_r_modules_func_p_set = 0x40054270 ); -PROVIDE ( btdm_r_plf_func_p_set = 0x40054288 ); -PROVIDE ( bt_util_buf_env = 0x3ffb8bd4 ); -PROVIDE ( cache_flash_mmu_set_rom = 0x400095e0 ); -PROVIDE ( Cache_Flush_rom = 0x40009a14 ); -PROVIDE ( Cache_Read_Disable_rom = 0x40009ab8 ); -PROVIDE ( Cache_Read_Enable_rom = 0x40009a84 ); -PROVIDE ( Cache_Read_Init_rom = 0x40009950 ); -PROVIDE ( cache_sram_mmu_set_rom = 0x400097f4 ); -/* This is static function, but can be used, not generated by script*/ -PROVIDE ( calc_rtc_memory_crc = 0x40008170 ); -PROVIDE ( calloc = 0x4000bee4 ); -PROVIDE ( __clear_cache = 0x40063860 ); -PROVIDE ( _close_r = 0x4000bd3c ); -PROVIDE ( co_default_bdaddr = 0x3ffae704 ); -PROVIDE ( co_null_bdaddr = 0x3ffb80e0 ); -PROVIDE ( co_sca2ppm = 0x3ff971e8 ); -PROVIDE ( crc16_be = 0x4005d09c ); -PROVIDE ( crc16_le = 0x4005d05c ); -PROVIDE ( crc32_be = 0x4005d024 ); -PROVIDE ( crc32_le = 0x4005cfec ); -PROVIDE ( crc8_be = 0x4005d114 ); -PROVIDE ( crc8_le = 0x4005d0e0 ); -PROVIDE ( _ctype_ = 0x3ff96354 ); -PROVIDE ( __ctype_ptr__ = 0x3ff96350 ); -PROVIDE ( _data_end_rom = 0x4000d5c8 ); -PROVIDE ( _data_end_btdm_rom = 0x4000d4f8 ); -PROVIDE ( _data_start_rom = 0x4000d4f8 ); -PROVIDE ( _data_start_btdm_rom = 0x4000d4f4 ); -PROVIDE ( _data_start_btdm = 0x3ffae6e0); -PROVIDE ( _data_end_btdm = 0x3ffaff10); -PROVIDE ( _bss_start_btdm = 0x3ffb8000); -PROVIDE ( _bss_end_btdm = 0x3ffbff70); -PROVIDE ( _daylight = 0x3ffae0a4 ); -PROVIDE ( dbg_default_handler = 0x3ff97218 ); -PROVIDE ( dbg_default_state = 0x3ff97220 ); -PROVIDE ( dbg_state = 0x3ffb8d5d ); -PROVIDE ( DebugE256PublicKey_x = 0x3ff97428 ); -PROVIDE ( DebugE256PublicKey_y = 0x3ff97408 ); -PROVIDE ( DebugE256SecretKey = 0x3ff973e8 ); -PROVIDE ( debug_timer = 0x3ffe042c ); -PROVIDE ( debug_timerfn = 0x3ffe0430 ); -PROVIDE ( dh_group14_generator = 0x3ff9ac60 ); -PROVIDE ( dh_group14_prime = 0x3ff9ab60 ); -PROVIDE ( dh_group15_generator = 0x3ff9ab5f ); -PROVIDE ( dh_group15_prime = 0x3ff9a9df ); -PROVIDE ( dh_group16_generator = 0x3ff9a9de ); -PROVIDE ( dh_group16_prime = 0x3ff9a7de ); -PROVIDE ( dh_group17_generator = 0x3ff9a7dd ); -PROVIDE ( dh_group17_prime = 0x3ff9a4dd ); -PROVIDE ( dh_group18_generator = 0x3ff9a4dc ); -PROVIDE ( dh_group18_prime = 0x3ff9a0dc ); -PROVIDE ( dh_group1_generator = 0x3ff9ae03 ); -PROVIDE ( dh_group1_prime = 0x3ff9ada3 ); -PROVIDE ( dh_group2_generator = 0x3ff9ada2 ); -PROVIDE ( dh_group2_prime = 0x3ff9ad22 ); -PROVIDE ( dh_group5_generator = 0x3ff9ad21 ); -PROVIDE ( dh_group5_prime = 0x3ff9ac61 ); -PROVIDE ( g_rom_spiflash_dummy_len_plus = 0x3ffae290 ); -PROVIDE ( ecc_env = 0x3ffb8d60 ); -PROVIDE ( ecc_Jacobian_InfinityPoint256 = 0x3ff972e8 ); -PROVIDE ( em_buf_env = 0x3ffb8d74 ); -PROVIDE ( environ = 0x3ffae0b4 ); -PROVIDE ( esp_crc8 = 0x4005d144 ); -PROVIDE ( _etext = 0x4000d66c ); -PROVIDE ( ets_readySet_ = 0x3ffe01f0 ); -PROVIDE ( ets_startup_callback = 0x3ffe0404 ); -PROVIDE ( rwip_coex_cfg = 0x3ff9914c ); -PROVIDE ( rwip_priority = 0x3ff99159 ); -PROVIDE ( exc_cause_table = 0x3ff991d0 ); -PROVIDE ( _exit_r = 0x4000bd28 ); -PROVIDE ( free = 0x4000beb8 ); -PROVIDE ( _fstat_r = 0x4000bccc ); -PROVIDE ( __gcc_bcmp = 0x40064a70 ); -PROVIDE ( GF_Jacobian_Point_Addition256 = 0x400163a4 ); -PROVIDE ( GF_Jacobian_Point_Double256 = 0x40016260 ); -PROVIDE ( GF_Point_Jacobian_To_Affine256 = 0x40016b0c ); -PROVIDE ( _global_impure_ptr = 0x3ffae0b0 ); -PROVIDE ( g_phyFuns_instance = 0x3ffae0c4 ); -PROVIDE ( g_rom_flashchip = 0x3ffae270 ); -PROVIDE ( gTxMsg = 0x3ffe0050 ); -PROVIDE ( hci_cmd_desc_root_tab = 0x3ff976d4 ); -PROVIDE ( hci_cmd_desc_tab_ctrl_bb = 0x3ff97b70 ); -PROVIDE ( hci_cmd_desc_tab_info_par = 0x3ff97b1c ); -PROVIDE ( hci_cmd_desc_tab_le = 0x3ff97870 ); -PROVIDE ( hci_cmd_desc_tab_lk_ctrl = 0x3ff97fc0 ); -PROVIDE ( hci_cmd_desc_tab_lk_pol = 0x3ff97f3c ); -PROVIDE ( hci_cmd_desc_tab_stat_par = 0x3ff97ac8 ); -PROVIDE ( hci_cmd_desc_tab_testing = 0x3ff97a98 ); -PROVIDE ( hci_cmd_desc_tab_vs = 0x3ff97714 ); -PROVIDE ( hci_command_handler = 0x4004c928 ); -PROVIDE ( hci_env = 0x3ffb9350 ); -PROVIDE ( rwip_env = 0x3ffb8bcc ); -PROVIDE ( hci_evt_dbg_desc_tab = 0x3ff9750c ); -PROVIDE ( hci_evt_desc_tab = 0x3ff9751c ); -PROVIDE ( hci_evt_le_desc_tab = 0x3ff974b4 ); -PROVIDE ( hci_fc_env = 0x3ffb9340 ); -PROVIDE ( jd_decomp = 0x400613e8 ); -PROVIDE ( jd_prepare = 0x40060fa8 ); -PROVIDE ( ke_env = 0x3ffb93cc ); -PROVIDE ( lb_default_handler = 0x3ff982b8 ); -PROVIDE ( lb_default_state_tab_p_get = 0x4001c198 ); -PROVIDE ( lb_env = 0x3ffb9424 ); -PROVIDE ( lb_hci_cmd_handler_tab_p_get = 0x4001c18c ); -PROVIDE ( lb_state = 0x3ffb94e8 ); -PROVIDE ( lc_default_handler = 0x3ff98648 ); -PROVIDE ( lc_default_state_tab_p_get = 0x4002f494 ); -PROVIDE ( lc_env = 0x3ffb94ec ); -PROVIDE ( lc_hci_cmd_handler_tab_p_get = 0x4002f488 ); -PROVIDE ( lc_state = 0x3ffb9508 ); -PROVIDE ( ld_acl_br_sizes = 0x3ff98a2a ); -PROVIDE ( ld_acl_br_types = 0x3ff98a36 ); -PROVIDE ( ld_acl_edr_sizes = 0x3ff98a14 ); -PROVIDE ( ld_acl_edr_types = 0x3ff98a22 ); -PROVIDE ( ld_env = 0x3ffb9510 ); -PROVIDE ( ld_pcm_settings_dft = 0x3ff98a0c ); -PROVIDE ( ld_sched_params = 0x3ffb96c0 ); -PROVIDE ( ld_sync_train_channels = 0x3ff98a3c ); -PROVIDE ( _link_r = 0x4000bc9c ); -PROVIDE ( llc_default_handler = 0x3ff98b3c ); -PROVIDE ( llc_default_state_tab_p_get = 0x40046058 ); -PROVIDE ( llc_env = 0x3ffb96d0 ); -PROVIDE ( llc_hci_acl_data_tx_handler = 0x40042398 ); -PROVIDE ( llc_hci_cmd_handler_tab_p_get = 0x40042358 ); -PROVIDE ( llc_hci_command_handler = 0x40042360 ); -PROVIDE ( llcp_pdu_handler_tab_p_get = 0x40043f64 ); -PROVIDE ( llc_state = 0x3ffb96f8 ); -PROVIDE ( lldesc_build_chain = 0x4000a850 ); -PROVIDE ( lldesc_num2link = 0x4000a948 ); -PROVIDE ( lldesc_set_owner = 0x4000a974 ); -PROVIDE ( lld_evt_deferred_elt_push = 0x400466b4 ); -PROVIDE ( lld_evt_deferred_elt_pop = 0x400466dc ); -PROVIDE ( lld_evt_winsize_change = 0x40046730 ); -PROVIDE ( lld_evt_rxwin_compute = 0x400467c8 ); -PROVIDE ( lld_evt_slave_time_compute = 0x40046818 ); -PROVIDE ( lld_evt_env = 0x3ffb9704 ); -PROVIDE ( lld_evt_elt_wait_get = 0x400468e4 ); -PROVIDE ( lld_evt_get_next_free_slot = 0x4004692c ); -PROVIDE ( lld_pdu_adv_pk_desc_tab = 0x3ff98c70 ); -PROVIDE ( lld_pdu_llcp_pk_desc_tab = 0x3ff98b68 ); -PROVIDE ( lld_pdu_tx_flush_list = 0x4004a760 ); -PROVIDE ( lld_pdu_pack = 0x4004ab14 ); -PROVIDE ( LLM_AA_CT1 = 0x3ff98d8a ); -PROVIDE ( LLM_AA_CT2 = 0x3ff98d88 ); -PROVIDE ( llm_default_handler = 0x3ff98d80 ); -PROVIDE ( llm_default_state_tab_p_get = 0x4004e718 ); -PROVIDE ( llm_hci_cmd_handler_tab_p_get = 0x4004c920 ); -PROVIDE ( llm_le_env = 0x3ffb976c ); -PROVIDE ( llm_local_cmds = 0x3ff98d38 ); -PROVIDE ( llm_local_data_len_values = 0x3ff98d1c ); -PROVIDE ( llm_local_le_feats = 0x3ff98d30 ); -PROVIDE ( llm_local_le_states = 0x3ff98d28 ); -PROVIDE ( llm_state = 0x3ffb985c ); -PROVIDE ( lm_default_handler = 0x3ff990e0 ); -PROVIDE ( lm_default_state_tab_p_get = 0x40054268 ); -PROVIDE ( lm_env = 0x3ffb9860 ); -PROVIDE ( lm_hci_cmd_handler_tab_p_get = 0x4005425c ); -PROVIDE ( lm_local_supp_feats = 0x3ff990ee ); -PROVIDE ( lm_n_page_tab = 0x3ff990e8 ); -PROVIDE ( lmp_desc_tab = 0x3ff96e6c ); -PROVIDE ( lmp_ext_desc_tab = 0x3ff96d9c ); -PROVIDE ( lm_state = 0x3ffb9a1c ); -PROVIDE ( _lseek_r = 0x4000bd8c ); -PROVIDE ( malloc = 0x4000bea0 ); -PROVIDE ( maxSecretKey_256 = 0x3ff97448 ); -PROVIDE ( __mb_cur_max = 0x3ff96530 ); -PROVIDE ( mmu_init = 0x400095a4 ); -PROVIDE ( __month_lengths = 0x3ff9609c ); -PROVIDE ( MultiplyBigHexByUint32_256 = 0x40016214 ); -PROVIDE ( MultiplyBigHexModP256 = 0x400160b8 ); -PROVIDE ( MultiplyByU32ModP256 = 0x40015fdc ); -PROVIDE ( multofup = 0x4000ab8c ); -PROVIDE ( mz_adler32 = 0x4005edbc ); -PROVIDE ( mz_crc32 = 0x4005ee88 ); -PROVIDE ( mz_free = 0x4005eed4 ); -PROVIDE ( notEqual256 = 0x40015b04 ); -PROVIDE ( one_bits = 0x3ff971f8 ); -PROVIDE ( _open_r = 0x4000bd54 ); -PROVIDE ( phy_get_romfuncs = 0x40004100 ); -PROVIDE ( _Pri_4_HandlerAddress = 0x3ffe0648 ); -PROVIDE ( _Pri_5_HandlerAddress = 0x3ffe064c ); -PROVIDE ( r_btdm_option_data = 0x3ffae6e0 ); -PROVIDE ( r_bt_util_buf_acl_rx_alloc = 0x40010218 ); -PROVIDE ( r_bt_util_buf_acl_rx_free = 0x40010234 ); -PROVIDE ( r_bt_util_buf_acl_tx_alloc = 0x40010268 ); -PROVIDE ( r_bt_util_buf_acl_tx_free = 0x40010280 ); -PROVIDE ( r_bt_util_buf_init = 0x400100e4 ); -PROVIDE ( r_bt_util_buf_lmp_tx_alloc = 0x400101d0 ); -PROVIDE ( r_bt_util_buf_lmp_tx_free = 0x400101ec ); -PROVIDE ( r_bt_util_buf_sync_clear = 0x400103c8 ); -PROVIDE ( r_bt_util_buf_sync_init = 0x400102c4 ); -PROVIDE ( r_bt_util_buf_sync_rx_alloc = 0x40010468 ); -PROVIDE ( r_bt_util_buf_sync_rx_free = 0x4001049c ); -PROVIDE ( r_bt_util_buf_sync_tx_alloc = 0x400103ec ); -PROVIDE ( r_bt_util_buf_sync_tx_free = 0x40010428 ); -PROVIDE ( r_co_bdaddr_compare = 0x40014324 ); -PROVIDE ( r_co_bytes_to_string = 0x400142e4 ); -PROVIDE ( r_co_list_check_size_available = 0x400142c4 ); -PROVIDE ( r_co_list_extract = 0x4001404c ); -PROVIDE ( r_co_list_extract_after = 0x40014118 ); -PROVIDE ( r_co_list_find = 0x4001419c ); -PROVIDE ( r_co_list_init = 0x40013f14 ); -PROVIDE ( r_co_list_insert_after = 0x40014254 ); -PROVIDE ( r_co_list_insert_before = 0x40014200 ); -PROVIDE ( r_co_list_merge = 0x400141bc ); -PROVIDE ( r_co_list_pool_init = 0x40013f30 ); -PROVIDE ( r_co_list_pop_front = 0x40014028 ); -PROVIDE ( r_co_list_push_back = 0x40013fb8 ); -PROVIDE ( r_co_list_push_front = 0x40013ff4 ); -PROVIDE ( r_co_list_size = 0x400142ac ); -PROVIDE ( r_co_nb_good_channels = 0x40014360 ); -PROVIDE ( r_co_slot_to_duration = 0x40014348 ); -PROVIDE ( r_dbg_init = 0x40014394 ); -PROVIDE ( r_dbg_platform_reset_complete = 0x400143d0 ); -PROVIDE ( r_dbg_swdiag_init = 0x40014470 ); -PROVIDE ( r_dbg_swdiag_read = 0x400144a4 ); -PROVIDE ( r_dbg_swdiag_write = 0x400144d0 ); -PROVIDE ( r_E1 = 0x400108e8 ); -PROVIDE ( r_E21 = 0x40010968 ); -PROVIDE ( r_E22 = 0x400109b4 ); -PROVIDE ( r_E3 = 0x40010a58 ); -PROVIDE ( lm_n192_mod_mul = 0x40011dc0 ); -PROVIDE ( lm_n192_mod_add = 0x40011e9c ); -PROVIDE ( lm_n192_mod_sub = 0x40011eec ); -PROVIDE ( r_ea_alarm_clear = 0x40015ab4 ); -PROVIDE ( r_ea_alarm_set = 0x40015a10 ); -PROVIDE ( _read_r = 0x4000bda8 ); -PROVIDE ( r_ea_elt_cancel = 0x400150d0 ); -PROVIDE ( r_ea_elt_create = 0x40015264 ); -PROVIDE ( r_ea_elt_insert = 0x400152a8 ); -PROVIDE ( r_ea_elt_remove = 0x400154f0 ); -PROVIDE ( r_ea_finetimer_isr = 0x400155d4 ); -PROVIDE ( r_ea_init = 0x40015228 ); -PROVIDE ( r_ea_interval_create = 0x4001555c ); -PROVIDE ( r_ea_interval_delete = 0x400155a8 ); -PROVIDE ( r_ea_interval_duration_req = 0x4001597c ); -PROVIDE ( r_ea_interval_insert = 0x4001557c ); -PROVIDE ( r_ea_interval_remove = 0x40015590 ); -PROVIDE ( ea_conflict_check = 0x40014e9c ); -PROVIDE ( ea_prog_timer = 0x40014f88 ); -PROVIDE ( realloc = 0x4000becc ); -PROVIDE ( r_ea_offset_req = 0x40015748 ); -PROVIDE ( r_ea_sleep_check = 0x40015928 ); -PROVIDE ( r_ea_sw_isr = 0x40015724 ); -PROVIDE ( r_ea_time_get_halfslot_rounded = 0x40015894 ); -PROVIDE ( r_ea_time_get_slot_rounded = 0x400158d4 ); -PROVIDE ( r_ecc_abort_key256_generation = 0x40017070 ); -PROVIDE ( r_ecc_generate_key256 = 0x40016e00 ); -PROVIDE ( r_ecc_gen_new_public_key = 0x400170c0 ); -PROVIDE ( r_ecc_gen_new_secret_key = 0x400170e4 ); -PROVIDE ( r_ecc_get_debug_Keys = 0x40017224 ); -PROVIDE ( r_ecc_init = 0x40016dbc ); -PROVIDE ( ecc_point_multiplication_uint8_256 = 0x40016804); -PROVIDE ( RecvBuff = 0x3ffe009c ); -PROVIDE ( r_em_buf_init = 0x4001729c ); -PROVIDE ( r_em_buf_rx_buff_addr_get = 0x400173e8 ); -PROVIDE ( r_em_buf_rx_free = 0x400173c4 ); -PROVIDE ( r_em_buf_tx_buff_addr_get = 0x40017404 ); -PROVIDE ( r_em_buf_tx_free = 0x4001741c ); -PROVIDE ( _rename_r = 0x4000bc28 ); -PROVIDE ( r_F1_256 = 0x400133e4 ); -PROVIDE ( r_F2_256 = 0x40013568 ); -PROVIDE ( r_F3_256 = 0x40013664 ); -PROVIDE ( RFPLL_ICP_TABLE = 0x3ffb8b7c ); -PROVIDE ( r_G_256 = 0x40013470 ); -PROVIDE ( r_H3 = 0x40013760 ); -PROVIDE ( r_H4 = 0x40013830 ); -PROVIDE ( r_h4tl_init = 0x40017878 ); -PROVIDE ( r_h4tl_start = 0x40017924 ); -PROVIDE ( r_h4tl_stop = 0x40017934 ); -PROVIDE ( r_h4tl_write = 0x400178d0 ); -PROVIDE ( r_H5 = 0x400138dc ); -PROVIDE ( r_hashConcat = 0x40013a38 ); -PROVIDE ( r_hci_acl_tx_data_alloc = 0x4001951c ); -PROVIDE ( r_hci_acl_tx_data_received = 0x40019654 ); -PROVIDE ( r_hci_bt_acl_bdaddr_register = 0x40018900 ); -PROVIDE ( r_hci_bt_acl_bdaddr_unregister = 0x400189ac ); -PROVIDE ( r_hci_bt_acl_conhdl_register = 0x4001895c ); -PROVIDE ( r_hci_cmd_get_max_param_size = 0x400192d0 ); -PROVIDE ( r_hci_cmd_received = 0x400192f8 ); -PROVIDE ( r_hci_evt_filter_add = 0x40018a64 ); -PROVIDE ( r_hci_evt_mask_set = 0x400189e4 ); -PROVIDE ( r_hci_fc_acl_buf_size_set = 0x40017988 ); -PROVIDE ( r_hci_fc_acl_en = 0x400179d8 ); -PROVIDE ( r_hci_fc_acl_packet_sent = 0x40017a3c ); -PROVIDE ( r_hci_fc_check_host_available_nb_acl_packets = 0x40017aa4 ); -PROVIDE ( r_hci_fc_check_host_available_nb_sync_packets = 0x40017ac8 ); -PROVIDE ( r_hci_fc_host_nb_acl_pkts_complete = 0x40017a6c ); -PROVIDE ( r_hci_fc_host_nb_sync_pkts_complete = 0x40017a88 ); -PROVIDE ( r_hci_fc_init = 0x40017974 ); -PROVIDE ( r_hci_fc_sync_buf_size_set = 0x400179b0 ); -PROVIDE ( r_hci_fc_sync_en = 0x40017a30 ); -PROVIDE ( r_hci_fc_sync_packet_sent = 0x40017a54 ); -PROVIDE ( r_hci_init = 0x40018538 ); -PROVIDE ( r_hci_look_for_cmd_desc = 0x40018454 ); -PROVIDE ( r_hci_look_for_dbg_evt_desc = 0x400184c4 ); -PROVIDE ( r_hci_look_for_evt_desc = 0x400184a0 ); -PROVIDE ( r_hci_look_for_le_evt_desc = 0x400184e0 ); -PROVIDE ( r_hci_reset = 0x4001856c ); -PROVIDE ( r_hci_send_2_host = 0x400185bc ); -PROVIDE ( r_hci_sync_tx_data_alloc = 0x40019754 ); -PROVIDE ( r_hci_sync_tx_data_received = 0x400197c0 ); -PROVIDE ( r_hci_tl_init = 0x40019290 ); -PROVIDE ( r_hci_tl_send = 0x40019228 ); -PROVIDE ( r_hci_util_pack = 0x40019874 ); -PROVIDE ( r_hci_util_unpack = 0x40019998 ); -PROVIDE ( r_hci_voice_settings_get = 0x40018bdc ); -PROVIDE ( r_hci_voice_settings_set = 0x40018be8 ); -PROVIDE ( r_HMAC = 0x40013968 ); -PROVIDE ( r_import_rf_phy_func = 0x3ffb8354 ); -PROVIDE ( r_import_rf_phy_func_p = 0x3ffafd64 ); -PROVIDE ( r_ip_funcs = 0x3ffae710 ); -PROVIDE ( r_ip_funcs_p = 0x3ffae70c ); -PROVIDE ( r_ke_check_malloc = 0x40019de0 ); -PROVIDE ( r_ke_event_callback_set = 0x40019ba8 ); -PROVIDE ( r_ke_event_clear = 0x40019c2c ); -PROVIDE ( r_ke_event_flush = 0x40019ccc ); -PROVIDE ( r_ke_event_get = 0x40019c78 ); -PROVIDE ( r_ke_event_get_all = 0x40019cc0 ); -PROVIDE ( r_ke_event_init = 0x40019b90 ); -PROVIDE ( r_ke_event_schedule = 0x40019cdc ); -PROVIDE ( r_ke_event_set = 0x40019be0 ); -PROVIDE ( r_ke_flush = 0x4001a374 ); -PROVIDE ( r_ke_free = 0x4001a014 ); -PROVIDE ( r_ke_get_max_mem_usage = 0x4001a1c8 ); -PROVIDE ( r_ke_get_mem_usage = 0x4001a1a0 ); -PROVIDE ( r_ke_init = 0x4001a318 ); -PROVIDE ( r_ke_is_free = 0x4001a184 ); -PROVIDE ( r_ke_malloc = 0x40019eb4 ); -PROVIDE ( r_ke_mem_init = 0x40019d3c ); -PROVIDE ( r_ke_mem_is_empty = 0x40019d8c ); -PROVIDE ( r_ke_msg_alloc = 0x4001a1e0 ); -PROVIDE ( r_ke_msg_dest_id_get = 0x4001a2e0 ); -PROVIDE ( r_ke_msg_discard = 0x4001a850 ); -PROVIDE ( r_ke_msg_forward = 0x4001a290 ); -PROVIDE ( r_ke_msg_forward_new_id = 0x4001a2ac ); -PROVIDE ( r_ke_msg_free = 0x4001a2cc ); -PROVIDE ( r_ke_msg_in_queue = 0x4001a2f8 ); -PROVIDE ( r_ke_msg_save = 0x4001a858 ); -PROVIDE ( r_ke_msg_send = 0x4001a234 ); -PROVIDE ( r_ke_msg_send_basic = 0x4001a26c ); -PROVIDE ( r_ke_msg_src_id_get = 0x4001a2ec ); -PROVIDE ( r_ke_queue_extract = 0x40055fd0 ); -PROVIDE ( r_ke_queue_insert = 0x40056020 ); -PROVIDE ( r_ke_sleep_check = 0x4001a3d8 ); -PROVIDE ( r_ke_state_get = 0x4001a7d8 ); -PROVIDE ( r_ke_state_set = 0x4001a6fc ); -PROVIDE ( r_ke_stats_get = 0x4001a3f0 ); -PROVIDE ( r_ke_task_check = 0x4001a8a4 ); -PROVIDE ( r_ke_task_create = 0x4001a674 ); -PROVIDE ( r_ke_task_delete = 0x4001a6c0 ); -PROVIDE ( r_ke_task_init = 0x4001a650 ); -PROVIDE ( r_ke_task_msg_flush = 0x4001a860 ); -PROVIDE ( r_ke_timer_active = 0x4001ac08 ); -PROVIDE ( r_ke_timer_adjust_all = 0x4001ac30 ); -PROVIDE ( r_ke_timer_clear = 0x4001ab90 ); -PROVIDE ( r_ke_timer_init = 0x4001aa9c ); -PROVIDE ( r_ke_timer_set = 0x4001aac0 ); -PROVIDE ( r_ke_timer_sleep_check = 0x4001ac50 ); -PROVIDE ( r_KPrimC = 0x40010ad4 ); -PROVIDE ( r_lb_clk_adj_activate = 0x4001ae70 ); -PROVIDE ( r_lb_clk_adj_id_get = 0x4001af14 ); -PROVIDE ( r_lb_clk_adj_period_update = 0x4001af20 ); -PROVIDE ( r_lb_init = 0x4001acd4 ); -PROVIDE ( r_lb_mst_key = 0x4001afc0 ); -PROVIDE ( r_lb_mst_key_cmp = 0x4001af74 ); -PROVIDE ( r_lb_mst_key_restart_enc = 0x4001b0d4 ); -PROVIDE ( r_lb_mst_start_act_bcst_enc = 0x4001b198 ); -PROVIDE ( r_lb_mst_stop_act_bcst_enc = 0x4001b24c ); -PROVIDE ( r_lb_reset = 0x4001ad38 ); -PROVIDE ( r_lb_send_lmp = 0x4001adbc ); -PROVIDE ( r_lb_send_pdu_clk_adj = 0x4001af3c ); -PROVIDE ( r_lb_util_get_csb_mode = 0x4001ada4 ); -PROVIDE ( r_lb_util_get_nb_broadcast = 0x4001ad80 ); -PROVIDE ( r_lb_util_get_res_lt_addr = 0x4001ad98 ); -PROVIDE ( r_lb_util_set_nb_broadcast = 0x4001ad8c ); -PROVIDE ( r_lc_afh_set = 0x4001cc74 ); -PROVIDE ( r_lc_afh_start = 0x4001d240 ); -PROVIDE ( r_lc_auth_cmp = 0x4001cd54 ); -PROVIDE ( r_lc_calc_link_key = 0x4001ce7c ); -PROVIDE ( r_lc_chg_pkt_type_cmp = 0x4001d038 ); -PROVIDE ( r_lc_chg_pkt_type_cont = 0x4001cfbc ); -PROVIDE ( r_lc_chg_pkt_type_retry = 0x4001d0ac ); -PROVIDE ( r_lc_chk_to = 0x4001d2a8 ); -PROVIDE ( r_lc_cmd_stat_send = 0x4001c914 ); -PROVIDE ( r_lc_comb_key_svr = 0x4001d30c ); -PROVIDE ( r_lc_con_cmp = 0x4001d44c ); -PROVIDE ( r_lc_con_cmp_evt_send = 0x4001d4fc ); -PROVIDE ( r_lc_conn_seq_done = 0x40021334 ); -PROVIDE ( r_lc_detach = 0x4002037c ); -PROVIDE ( r_lc_dhkey = 0x4001d564 ); -PROVIDE ( r_lc_enc_cmp = 0x4001d8bc ); -PROVIDE ( r_lc_enc_key_refresh = 0x4001d720 ); -PROVIDE ( r_lc_end_chk_colli = 0x4001d858 ); -PROVIDE ( r_lc_end_of_sniff_nego = 0x4001d9a4 ); -PROVIDE ( r_lc_enter_sniff_mode = 0x4001ddb8 ); -PROVIDE ( r_lc_epr_change_lk = 0x4001db38 ); -PROVIDE ( r_lc_epr_cmp = 0x4001da88 ); -PROVIDE ( r_lc_epr_resp = 0x4001e0b4 ); -PROVIDE ( r_lc_epr_rsw_cmp = 0x4001dd40 ); -PROVIDE ( r_lc_ext_feat = 0x40020d6c ); -PROVIDE ( r_lc_feat = 0x40020984 ); -PROVIDE ( r_lc_hl_connect = 0x400209e8 ); -PROVIDE ( r_lc_init = 0x4001c948 ); -PROVIDE ( r_lc_init_calc_f3 = 0x4001deb0 ); -PROVIDE ( r_lc_initiator_epr = 0x4001e064 ); -PROVIDE ( r_lc_init_passkey_loop = 0x4001dfc0 ); -PROVIDE ( r_lc_init_start_mutual_auth = 0x4001df60 ); -PROVIDE ( r_lc_key_exch_end = 0x4001e140 ); -PROVIDE ( r_lc_legacy_pair = 0x4001e1c0 ); -PROVIDE ( r_lc_local_switch = 0x4001e22c ); -PROVIDE ( r_lc_local_trans_mode = 0x4001e2e4 ); -PROVIDE ( r_lc_local_untrans_mode = 0x4001e3a0 ); -PROVIDE ( r_lc_loc_auth = 0x40020ecc ); -PROVIDE ( r_lc_locepr_lkref = 0x4001d648 ); -PROVIDE ( r_lc_locepr_rsw = 0x4001d5d0 ); -PROVIDE ( r_lc_loc_sniff = 0x40020a6c ); -PROVIDE ( r_lc_max_slot_mgt = 0x4001e410 ); -PROVIDE ( r_lc_mst_key = 0x4001e7c0 ); -PROVIDE ( r_lc_mst_qos_done = 0x4001ea80 ); -PROVIDE ( r_lc_mst_send_mst_key = 0x4001e8f4 ); -PROVIDE ( r_lc_mutual_auth_end = 0x4001e670 ); -PROVIDE ( r_lc_mutual_auth_end2 = 0x4001e4f4 ); -PROVIDE ( r_lc_packet_type = 0x40021038 ); -PROVIDE ( r_lc_pair = 0x40020ddc ); -PROVIDE ( r_lc_pairing_cont = 0x4001eafc ); -PROVIDE ( r_lc_passkey_comm = 0x4001ed20 ); -PROVIDE ( r_lc_prepare_all_links_for_clk_adj = 0x40021430 ); -PROVIDE ( r_lc_proc_rcv_dhkey = 0x4001edec ); -PROVIDE ( r_lc_ptt = 0x4001ee2c ); -PROVIDE ( r_lc_ptt_cmp = 0x4001eeec ); -PROVIDE ( r_lc_qos_setup = 0x4001ef50 ); -PROVIDE ( r_lc_rd_rem_name = 0x4001efd0 ); -PROVIDE ( r_lc_release = 0x4001f8a8 ); -PROVIDE ( r_lc_rem_enc = 0x4001f124 ); -PROVIDE ( r_lc_rem_name_cont = 0x4001f290 ); -PROVIDE ( r_lc_rem_nego_trans_mode = 0x4001f1b4 ); -PROVIDE ( r_lc_rem_sniff = 0x40020ca4 ); -PROVIDE ( r_lc_rem_sniff_sub_rate = 0x40020b10 ); -PROVIDE ( r_lc_rem_switch = 0x4001f070 ); -PROVIDE ( r_lc_rem_trans_mode = 0x4001f314 ); -PROVIDE ( r_lc_rem_unsniff = 0x400207a0 ); -PROVIDE ( r_lc_rem_untrans_mode = 0x4001f36c ); -PROVIDE ( r_lc_reset = 0x4001c99c ); -PROVIDE ( r_lc_resp_auth = 0x4001f518 ); -PROVIDE ( r_lc_resp_calc_f3 = 0x4001f710 ); -PROVIDE ( r_lc_resp_num_comp = 0x40020074 ); -PROVIDE ( r_lc_resp_oob_nonce = 0x4001f694 ); -PROVIDE ( r_lc_resp_oob_wait_nonce = 0x4001f66c ); -PROVIDE ( r_lc_resp_pair = 0x400208a4 ); -PROVIDE ( r_lc_resp_sec_auth = 0x4001f4a0 ); -PROVIDE ( r_lc_resp_wait_dhkey_cont = 0x4001f86c ); -PROVIDE ( r_lc_restart_enc = 0x4001f8ec ); -PROVIDE ( r_lc_restart_enc_cont = 0x4001f940 ); -PROVIDE ( r_lc_restore_afh_reporting = 0x4001f028 ); -PROVIDE ( r_lc_restore_to = 0x4001f9e0 ); -PROVIDE ( r_lc_ret_sniff_max_slot_chg = 0x4001fa30 ); -PROVIDE ( r_lc_rsw_clean_up = 0x4001dc70 ); -PROVIDE ( r_lc_rsw_done = 0x4001db94 ); -PROVIDE ( r_lc_sco_baseband_ack = 0x40022b00 ); -PROVIDE ( r_lc_sco_detach = 0x40021e40 ); -PROVIDE ( r_lc_sco_host_accept = 0x40022118 ); -PROVIDE ( r_lc_sco_host_reject = 0x400222b8 ); -PROVIDE ( r_lc_sco_host_request = 0x40021f4c ); -PROVIDE ( r_lc_sco_host_request_disc = 0x4002235c ); -PROVIDE ( r_lc_sco_init = 0x40021dc8 ); -PROVIDE ( r_lc_sco_peer_accept = 0x40022780 ); -PROVIDE ( r_lc_sco_peer_accept_disc = 0x40022a08 ); -PROVIDE ( r_lc_sco_peer_reject = 0x40022824 ); -PROVIDE ( r_lc_sco_peer_reject_disc = 0x40022a8c ); -PROVIDE ( r_lc_sco_peer_request = 0x4002240c ); -PROVIDE ( r_lc_sco_peer_request_disc = 0x400228ec ); -PROVIDE ( r_lc_sco_release = 0x40021eec ); -PROVIDE ( r_lc_sco_reset = 0x40021dfc ); -PROVIDE ( r_lc_sco_timeout = 0x40022bd4 ); -PROVIDE ( r_lc_sec_auth_compute_sres = 0x4001f3ec ); -PROVIDE ( r_lc_semi_key_cmp = 0x40020294 ); -PROVIDE ( r_lc_send_enc_chg_evt = 0x4002134c ); -PROVIDE ( r_lc_send_enc_mode = 0x40020220 ); -PROVIDE ( r_lc_send_lmp = 0x4001c1a8 ); -PROVIDE ( r_lc_send_pdu_acc = 0x4001c21c ); -PROVIDE ( r_lc_send_pdu_acc_ext4 = 0x4001c240 ); -PROVIDE ( r_lc_send_pdu_au_rand = 0x4001c308 ); -PROVIDE ( r_lc_send_pdu_auto_rate = 0x4001c5d0 ); -PROVIDE ( r_lc_send_pdu_clk_adj_ack = 0x4001c46c ); -PROVIDE ( r_lc_send_pdu_clk_adj_req = 0x4001c494 ); -PROVIDE ( r_lc_send_pdu_comb_key = 0x4001c368 ); -PROVIDE ( r_lc_send_pdu_dhkey_chk = 0x4001c8e8 ); -PROVIDE ( r_lc_send_pdu_encaps_head = 0x4001c440 ); -PROVIDE ( r_lc_send_pdu_encaps_payl = 0x4001c410 ); -PROVIDE ( r_lc_send_pdu_enc_key_sz_req = 0x4001c670 ); -PROVIDE ( r_lc_send_pdu_esco_lk_rem_req = 0x4001c5a8 ); -PROVIDE ( r_lc_send_pdu_feats_ext_req = 0x4001c6ec ); -PROVIDE ( r_lc_send_pdu_feats_res = 0x4001c694 ); -PROVIDE ( r_lc_send_pdu_in_rand = 0x4001c338 ); -PROVIDE ( r_lc_send_pdu_io_cap_res = 0x4001c72c ); -PROVIDE ( r_lc_send_pdu_lsto = 0x4001c64c ); -PROVIDE ( r_lc_send_pdu_max_slot = 0x4001c3c8 ); -PROVIDE ( r_lc_send_pdu_max_slot_req = 0x4001c3ec ); -PROVIDE ( r_lc_send_pdu_not_acc = 0x4001c26c ); -PROVIDE ( r_lc_send_pdu_not_acc_ext4 = 0x4001c294 ); -PROVIDE ( r_lc_send_pdu_num_comp_fail = 0x4001c770 ); -PROVIDE ( r_lc_send_pdu_pause_enc_aes_req = 0x4001c794 ); -PROVIDE ( r_lc_send_pdu_paus_enc_req = 0x4001c7c0 ); -PROVIDE ( r_lc_send_pdu_ptt_req = 0x4001c4c0 ); -PROVIDE ( r_lc_send_pdu_qos_req = 0x4001c82c ); -PROVIDE ( r_lc_send_pdu_resu_enc_req = 0x4001c7e4 ); -PROVIDE ( r_lc_send_pdu_sco_lk_rem_req = 0x4001c580 ); -PROVIDE ( r_lc_send_pdu_set_afh = 0x4001c2c8 ); -PROVIDE ( r_lc_send_pdu_setup_cmp = 0x4001c808 ); -PROVIDE ( r_lc_send_pdu_slot_off = 0x4001c854 ); -PROVIDE ( r_lc_send_pdu_sniff_req = 0x4001c5f0 ); -PROVIDE ( r_lc_send_pdu_sp_cfm = 0x4001c518 ); -PROVIDE ( r_lc_send_pdu_sp_nb = 0x4001c4e8 ); -PROVIDE ( r_lc_send_pdu_sres = 0x4001c548 ); -PROVIDE ( r_lc_send_pdu_tim_acc = 0x4001c6cc ); -PROVIDE ( r_lc_send_pdu_unit_key = 0x4001c398 ); -PROVIDE ( r_lc_send_pdu_unsniff_req = 0x4001c894 ); -PROVIDE ( r_lc_send_pdu_vers_req = 0x4001c8b4 ); -PROVIDE ( r_lc_skip_hl_oob_req = 0x400201bc ); -PROVIDE ( r_lc_sniff_init = 0x40022cac ); -PROVIDE ( r_lc_sniff_max_slot_chg = 0x40020590 ); -PROVIDE ( r_lc_sniff_reset = 0x40022cc8 ); -PROVIDE ( r_lc_sniff_slot_unchange = 0x40021100 ); -PROVIDE ( r_lc_sniff_sub_mode = 0x400204fc ); -PROVIDE ( r_lc_sp_end = 0x400213a8 ); -PROVIDE ( r_lc_sp_fail = 0x40020470 ); -PROVIDE ( r_lc_sp_oob_tid_fail = 0x400204cc ); -PROVIDE ( r_lc_ssr_nego = 0x4002125c ); -PROVIDE ( r_lc_start = 0x4001ca28 ); -PROVIDE ( r_lc_start_enc = 0x4001fb28 ); -PROVIDE ( r_lc_start_enc_key_size = 0x4001fd9c ); -PROVIDE ( r_lc_start_key_exch = 0x4001fe10 ); -PROVIDE ( r_lc_start_lmp_to = 0x4001fae8 ); -PROVIDE ( r_lc_start_oob = 0x4001fffc ); -PROVIDE ( r_lc_start_passkey = 0x4001feac ); -PROVIDE ( r_lc_start_passkey_loop = 0x4001ff88 ); -PROVIDE ( r_lc_stop_afh_report = 0x40020184 ); -PROVIDE ( r_lc_stop_enc = 0x40020110 ); -PROVIDE ( r_lc_switch_cmp = 0x40020448 ); -PROVIDE ( r_lc_unit_key_svr = 0x400206d8 ); -PROVIDE ( r_lc_unsniff = 0x40020c50 ); -PROVIDE ( r_lc_unsniff_cmp = 0x40020810 ); -PROVIDE ( r_lc_unsniff_cont = 0x40020750 ); -PROVIDE ( r_lc_upd_to = 0x4002065c ); -PROVIDE ( r_lc_util_convert_pref_rate_to_packet_type = 0x4002f9b0 ); -PROVIDE ( r_lc_util_get_max_packet_size = 0x4002f4ac ); -PROVIDE ( r_lc_util_get_offset_clke = 0x4002f538 ); -PROVIDE ( r_lc_util_get_offset_clkn = 0x4002f51c ); -PROVIDE ( r_lc_util_set_loc_trans_coll = 0x4002f500 ); -PROVIDE ( r_lc_version = 0x40020a30 ); -PROVIDE ( lc_set_encap_pdu_data_p192 = 0x4002e4c8 ); -PROVIDE ( lc_set_encap_pdu_data_p256 = 0x4002e454 ); -PROVIDE ( lm_get_auth_method = 0x40023420); -PROVIDE ( lmp_accepted_ext_handler = 0x40027290 ); -PROVIDE ( lmp_not_accepted_ext_handler = 0x40029c54 ); -PROVIDE ( lmp_clk_adj_handler = 0x40027468 ); -PROVIDE ( lmp_clk_adj_ack_handler = 0x400274f4 ); -PROVIDE ( lm_get_auth_method = 0x40023420); -PROVIDE ( lmp_accepted_ext_handler = 0x40027290 ); -PROVIDE ( lmp_not_accepted_ext_handler = 0x40029c54 ); -PROVIDE ( lmp_clk_adj_handler = 0x40027468 ); -PROVIDE ( lmp_clk_adj_ack_handler = 0x400274f4 ); -PROVIDE ( lmp_clk_adj_req_handler = 0x4002751c ); -PROVIDE ( lmp_feats_res_ext_handler = 0x4002cac4 ); -PROVIDE ( lmp_feats_req_ext_handler = 0x4002ccb0 ); -PROVIDE ( lmp_pkt_type_tbl_req_handler = 0x40027574 ); -PROVIDE ( lmp_esco_link_req_handler = 0x40027610 ); -PROVIDE ( lmp_rmv_esco_link_req_handler = 0x400276e8 ); -PROVIDE ( lmp_ch_class_req_handler = 0x40027730 ); -PROVIDE ( lmp_ch_class_handler = 0x4002ca18 ); -PROVIDE ( lmp_ssr_req_handler = 0x4002780c ); -PROVIDE ( lmp_ssr_res_handler = 0x40027900 ); -PROVIDE ( lmp_pause_enc_aes_req_handler = 0x400279a4 ); -PROVIDE ( lmp_pause_enc_req_handler = 0x4002df90 ); -PROVIDE ( lmp_resume_enc_req_handler = 0x4002e084 ); -PROVIDE ( lmp_num_comparison_fail_handler = 0x40027a74 ); -PROVIDE ( lmp_passkey_fail_handler = 0x40027aec ); -PROVIDE ( lmp_keypress_notif_handler = 0x4002c5c8 ); -PROVIDE ( lmp_pwr_ctrl_req_handler = 0x400263bc ); -PROVIDE ( lmp_pwr_ctrl_res_handler = 0x40026480 ); -PROVIDE ( lmp_auto_rate_handler = 0x40026548 ); -PROVIDE ( lmp_pref_rate_handler = 0x4002657c ); -PROVIDE ( lmp_name_req_handler = 0x40025050 ); -PROVIDE ( lmp_name_res_handler = 0x400250bc ); -PROVIDE ( lmp_not_accepted_handler = 0x400251d0 ); -PROVIDE ( lmp_accepted_handler = 0x4002e894 ); -PROVIDE ( lmp_clk_off_req_handler = 0x40025a44 ); -PROVIDE ( lmp_clk_off_res_handler = 0x40025ab8 ); -PROVIDE ( lmp_detach_handler = 0x40025b74 ); -PROVIDE ( lmp_tempkey_handler = 0x4002b6b0 ); -PROVIDE ( lmp_temprand_handler = 0x4002b74c ); -PROVIDE ( lmp_sres_handler = 0x4002b840 ); -PROVIDE ( lmp_aurand_handler = 0x4002bda0 ); -PROVIDE ( lmp_unitkey_handler = 0x4002c13c ); -PROVIDE ( lmp_combkey_handler = 0x4002c234 ); -PROVIDE ( lmp_inrand_handler = 0x4002c414 ); -PROVIDE ( lmp_oob_fail_handler = 0x40027b84 ); -PROVIDE ( lmp_ping_req_handler = 0x40027c08 ); -PROVIDE ( lmp_ping_res_handler = 0x40027c5c ); -PROVIDE ( lmp_enc_mode_req_handler = 0x40025c60 ); -PROVIDE ( lmp_enc_key_size_req_handler = 0x40025e54 ); -PROVIDE ( lmp_switch_req_handler = 0x40025f84 ); -PROVIDE ( lmp_start_enc_req_handler = 0x4002e124 ); -PROVIDE ( lmp_stop_enc_req_handler = 0x4002de30 ); -PROVIDE ( lmp_sniff_req_handler = 0x400260c8 ); -PROVIDE ( lmp_unsniff_req_handler = 0x400261e0 ); -PROVIDE ( lmp_incr_pwr_req_handler = 0x4002629c ); -PROVIDE ( lmp_decr_pwr_req_handler = 0x400262f8 ); -PROVIDE ( lmp_max_pwr_handler = 0x40026354 ); -PROVIDE ( lmp_min_pwr_handler = 0x40026388 ); -PROVIDE ( lmp_ver_req_handler = 0x400265f0 ); -PROVIDE ( lmp_ver_res_handler = 0x40026670 ); -PROVIDE ( lmp_qos_handler = 0x40026790 ); -PROVIDE ( lmp_qos_req_handler = 0x40026844 ); -PROVIDE ( lmp_sco_link_req_handler = 0x40026930 ); -PROVIDE ( lmp_rmv_sco_link_req_handler = 0x40026a10 ); -PROVIDE ( lmp_max_slot_handler = 0x40026a54 ); -PROVIDE ( lmp_max_slot_req_handler = 0x40026aac ); -PROVIDE ( lmp_timing_accu_req_handler = 0x40026b54 ); -PROVIDE ( lmp_timing_accu_res_handler = 0x40026bcc ); -PROVIDE ( lmp_setup_cmp_handler = 0x40026c84 ); -PROVIDE ( lmp_feats_res_handler = 0x4002b548 ); -PROVIDE ( lmp_feats_req_handler = 0x4002b620 ); -PROVIDE ( lmp_host_con_req_handler = 0x4002b3d8 ); -PROVIDE ( lmp_use_semi_perm_key_handler = 0x4002b4c4 ); -PROVIDE ( lmp_slot_off_handler = 0x40026cc8 ); -PROVIDE ( lmp_page_mode_req_handler = 0x40026d0c ); -PROVIDE ( lmp_page_scan_mode_req_handler = 0x40026d4c ); -PROVIDE ( lmp_supv_to_handler = 0x40026d94 ); -PROVIDE ( lmp_test_activate_handler = 0x40026e7c ); -PROVIDE ( lmp_test_ctrl_handler = 0x40026ee4 ); -PROVIDE ( lmp_enc_key_size_mask_req_handler = 0x40027038 ); -PROVIDE ( lmp_enc_key_size_mask_res_handler = 0x400270a4 ); -PROVIDE ( lmp_set_afh_handler = 0x4002b2e4 ); -PROVIDE ( lmp_encaps_hdr_handler = 0x40027120 ); -PROVIDE ( lmp_encaps_payl_handler = 0x4002e590 ); -PROVIDE ( lmp_sp_nb_handler = 0x4002acf0 ); -PROVIDE ( lmp_sp_cfm_handler = 0x4002b170 ); -PROVIDE ( lmp_dhkey_chk_handler = 0x4002ab48 ); -PROVIDE ( lmp_pause_enc_aes_req_handler = 0x400279a4 ); -PROVIDE ( lmp_io_cap_res_handler = 0x4002c670 ); -PROVIDE ( lmp_io_cap_req_handler = 0x4002c7a4 ); -PROVIDE ( ld_acl_tx_packet_type_select = 0x4002fb40 ); -PROVIDE ( ld_acl_sched = 0x40033268 ); -PROVIDE ( ld_acl_sniff_sched = 0x4003340c ); -PROVIDE ( ld_acl_rx = 0x4003274c ); -PROVIDE ( ld_acl_tx = 0x4002ffdc ); -PROVIDE ( ld_acl_rx_sync = 0x4002fbec ); -PROVIDE ( ld_acl_rx_sync2 = 0x4002fd8c ); -PROVIDE ( ld_acl_rx_no_sync = 0x4002fe78 ); -PROVIDE ( ld_acl_clk_isr = 0x40030cf8 ); -PROVIDE ( ld_sco_modify = 0x40031778 ); -PROVIDE ( lm_cmd_cmp_send = 0x40051838 ); -PROVIDE ( ld_sco_frm_cbk = 0x400349dc ); -PROVIDE ( ld_acl_sniff_frm_cbk = 0x4003482c ); -PROVIDE ( ld_inq_end = 0x4003ab48 ); -PROVIDE ( ld_inq_sched = 0x4003aba4 ); -PROVIDE ( ld_inq_frm_cbk = 0x4003ae4c ); -PROVIDE ( r_ld_acl_active_hop_types_get = 0x40036e10 ); -PROVIDE ( r_ld_acl_afh_confirm = 0x40036d40 ); -PROVIDE ( r_ld_acl_afh_prepare = 0x40036c84 ); -PROVIDE ( r_ld_acl_afh_set = 0x40036b60 ); -PROVIDE ( r_ld_acl_allowed_tx_packet_types_set = 0x40036810 ); -PROVIDE ( r_ld_acl_bcst_rx_dec = 0x40036394 ); -PROVIDE ( r_ld_acl_bit_off_get = 0x40036b18 ); -PROVIDE ( r_ld_acl_clk_adj_set = 0x40036a00 ); -PROVIDE ( r_ld_acl_clk_off_get = 0x40036b00 ); -PROVIDE ( r_ld_acl_clk_set = 0x40036950 ); -PROVIDE ( r_ld_acl_clock_offset_get = 0x400364c0 ); -PROVIDE ( r_ld_acl_current_tx_power_get = 0x400368f0 ); -PROVIDE ( r_ld_acl_data_flush = 0x400357bc ); -PROVIDE ( r_ld_acl_data_tx = 0x4003544c ); -PROVIDE ( r_ld_acl_edr_set = 0x4003678c ); -PROVIDE ( r_ld_acl_enc_key_load = 0x40036404 ); -PROVIDE ( r_ld_acl_flow_off = 0x40035400 ); -PROVIDE ( r_ld_acl_flow_on = 0x4003541c ); -PROVIDE ( r_ld_acl_flush_timeout_get = 0x40035f9c ); -PROVIDE ( r_ld_acl_flush_timeout_set = 0x40035fe0 ); -PROVIDE ( r_ld_acl_init = 0x40034d08 ); -PROVIDE ( r_ld_acl_lmp_flush = 0x40035d80 ); -PROVIDE ( r_ld_acl_lmp_tx = 0x40035b34 ); -PROVIDE ( r_ld_acl_lsto_get = 0x400366b4 ); -PROVIDE ( r_ld_acl_lsto_set = 0x400366f8 ); -PROVIDE ( r_ld_acl_reset = 0x40034d24 ); -PROVIDE ( r_ld_acl_role_get = 0x40036b30 ); -PROVIDE ( r_ld_acl_rssi_delta_get = 0x40037028 ); -PROVIDE ( r_ld_acl_rsw_req = 0x40035e74 ); -PROVIDE ( r_ld_acl_rx_enc = 0x40036344 ); -PROVIDE ( r_ld_acl_rx_max_slot_get = 0x40036e58 ); -PROVIDE ( r_ld_acl_rx_max_slot_set = 0x40036ea0 ); -PROVIDE ( r_ld_acl_slot_offset_get = 0x4003653c ); -PROVIDE ( r_ld_acl_slot_offset_set = 0x40036658 ); -PROVIDE ( r_ld_acl_sniff = 0x4003617c ); -PROVIDE ( r_ld_acl_sniff_trans = 0x400360a8 ); -PROVIDE ( r_ld_acl_ssr_set = 0x40036274 ); -PROVIDE ( r_ld_acl_start = 0x40034ddc ); -PROVIDE ( r_ld_acl_stop = 0x4003532c ); -PROVIDE ( r_ld_acl_test_mode_set = 0x40036f24 ); -PROVIDE ( r_ld_acl_timing_accuracy_set = 0x4003673c ); -PROVIDE ( r_ld_acl_t_poll_get = 0x40036024 ); -PROVIDE ( r_ld_acl_t_poll_set = 0x40036068 ); -PROVIDE ( r_ld_acl_tx_enc = 0x400362f8 ); -PROVIDE ( r_ld_acl_unsniff = 0x400361e0 ); -PROVIDE ( r_ld_active_check = 0x4003cac4 ); -PROVIDE ( r_ld_afh_ch_assess_data_get = 0x4003caec ); -PROVIDE ( r_ld_bcst_acl_data_tx = 0x40038d3c ); -PROVIDE ( r_ld_bcst_acl_init = 0x40038bd0 ); -PROVIDE ( r_ld_bcst_acl_reset = 0x40038bdc ); -PROVIDE ( r_ld_bcst_acl_start = 0x4003882c ); -PROVIDE ( r_ld_bcst_afh_update = 0x40038f3c ); -PROVIDE ( r_ld_bcst_enc_key_load = 0x4003906c ); -PROVIDE ( r_ld_bcst_lmp_tx = 0x40038bf8 ); -PROVIDE ( r_ld_bcst_tx_enc = 0x40038ff8 ); -PROVIDE ( r_ld_bd_addr_get = 0x4003ca20 ); -PROVIDE ( r_ld_channel_assess = 0x4003c184 ); -PROVIDE ( r_ld_class_of_dev_get = 0x4003ca34 ); -PROVIDE ( r_ld_class_of_dev_set = 0x4003ca50 ); -PROVIDE ( r_ld_csb_rx_afh_update = 0x40039af4 ); -PROVIDE ( r_ld_csb_rx_init = 0x40039690 ); -PROVIDE ( r_ld_csb_rx_reset = 0x4003969c ); -PROVIDE ( r_ld_csb_rx_start = 0x4003972c ); -PROVIDE ( r_ld_csb_rx_stop = 0x40039bb8 ); -PROVIDE ( r_ld_csb_tx_afh_update = 0x4003a5fc ); -PROVIDE ( r_ld_csb_tx_clr_data = 0x4003a71c ); -PROVIDE ( r_ld_csb_tx_dis = 0x4003a5e8 ); -PROVIDE ( r_ld_csb_tx_en = 0x4003a1c0 ); -PROVIDE ( r_ld_csb_tx_init = 0x4003a0e8 ); -PROVIDE ( r_ld_csb_tx_reset = 0x4003a0f8 ); -PROVIDE ( r_ld_csb_tx_set_data = 0x4003a6c0 ); -PROVIDE ( r_ld_fm_clk_isr = 0x4003a7a8 ); -PROVIDE ( r_ld_fm_frame_isr = 0x4003a82c ); -PROVIDE ( r_ld_fm_init = 0x4003a760 ); -PROVIDE ( r_ld_fm_prog_check = 0x4003ab28 ); -PROVIDE ( r_ld_fm_prog_disable = 0x4003a984 ); -PROVIDE ( r_ld_fm_prog_enable = 0x4003a944 ); -PROVIDE ( r_ld_fm_prog_push = 0x4003a9d4 ); -PROVIDE ( r_ld_fm_reset = 0x4003a794 ); -PROVIDE ( r_ld_fm_rx_isr = 0x4003a7f4 ); -PROVIDE ( r_ld_fm_sket_isr = 0x4003a8a4 ); -PROVIDE ( r_ld_init = 0x4003c294 ); -PROVIDE ( r_ld_inq_init = 0x4003b15c ); -PROVIDE ( r_ld_inq_reset = 0x4003b168 ); -PROVIDE ( r_ld_inq_start = 0x4003b1f0 ); -PROVIDE ( r_ld_inq_stop = 0x4003b4f0 ); -PROVIDE ( r_ld_iscan_eir_get = 0x4003c118 ); -PROVIDE ( r_ld_iscan_eir_set = 0x4003bfa0 ); -PROVIDE ( r_ld_iscan_init = 0x4003b9f0 ); -PROVIDE ( r_ld_iscan_reset = 0x4003ba14 ); -PROVIDE ( r_ld_iscan_restart = 0x4003ba44 ); -PROVIDE ( r_ld_iscan_start = 0x4003bb28 ); -PROVIDE ( r_ld_iscan_stop = 0x4003bf1c ); -PROVIDE ( r_ld_iscan_tx_pwr_get = 0x4003c138 ); -PROVIDE ( r_ld_page_init = 0x4003d808 ); -PROVIDE ( r_ld_page_reset = 0x4003d814 ); -PROVIDE ( r_ld_page_start = 0x4003d848 ); -PROVIDE ( r_ld_page_stop = 0x4003da54 ); -PROVIDE ( r_ld_pca_coarse_clock_adjust = 0x4003e324 ); -PROVIDE ( r_ld_pca_init = 0x4003deb4 ); -PROVIDE ( r_ld_pca_initiate_clock_dragging = 0x4003e4ac ); -PROVIDE ( r_ld_pca_local_config = 0x4003df6c ); -PROVIDE ( r_ld_pca_mws_frame_sync = 0x4003e104 ); -PROVIDE ( r_ld_pca_mws_moment_offset_gt = 0x4003e278 ); -PROVIDE ( r_ld_pca_mws_moment_offset_lt = 0x4003e280 ); -PROVIDE ( r_ld_pca_reporting_enable = 0x4003e018 ); -PROVIDE ( r_ld_pca_reset = 0x4003df0c ); -PROVIDE ( r_ld_pca_update_target_offset = 0x4003e050 ); -PROVIDE ( r_ld_pscan_evt_handler = 0x4003f238 ); -PROVIDE ( r_ld_pscan_init = 0x4003f474 ); -PROVIDE ( r_ld_pscan_reset = 0x4003f498 ); -PROVIDE ( r_ld_pscan_restart = 0x4003f4b8 ); -PROVIDE ( r_ld_pscan_start = 0x4003f514 ); -PROVIDE ( r_ld_pscan_stop = 0x4003f618 ); -PROVIDE ( r_ld_read_clock = 0x4003c9e4 ); -PROVIDE ( r_ld_reset = 0x4003c714 ); -PROVIDE ( r_ld_sched_acl_add = 0x4003f978 ); -PROVIDE ( r_ld_sched_acl_remove = 0x4003f99c ); -PROVIDE ( r_ld_sched_compute = 0x4003f6f8 ); -PROVIDE ( r_ld_sched_init = 0x4003f7ac ); -PROVIDE ( r_ld_sched_inq_add = 0x4003f8a8 ); -PROVIDE ( r_ld_sched_inq_remove = 0x4003f8d0 ); -PROVIDE ( r_ld_sched_iscan_add = 0x4003f7e8 ); -PROVIDE ( r_ld_sched_iscan_remove = 0x4003f808 ); -PROVIDE ( r_ld_sched_page_add = 0x4003f910 ); -PROVIDE ( r_ld_sched_page_remove = 0x4003f938 ); -PROVIDE ( r_ld_sched_pscan_add = 0x4003f828 ); -PROVIDE ( r_ld_sched_pscan_remove = 0x4003f848 ); -PROVIDE ( r_ld_sched_reset = 0x4003f7d4 ); -PROVIDE ( r_ld_sched_sco_add = 0x4003fa4c ); -PROVIDE ( r_ld_sched_sco_remove = 0x4003fa9c ); -PROVIDE ( r_ld_sched_sniff_add = 0x4003f9c4 ); -PROVIDE ( r_ld_sched_sniff_remove = 0x4003fa0c ); -PROVIDE ( r_ld_sched_sscan_add = 0x4003f868 ); -PROVIDE ( r_ld_sched_sscan_remove = 0x4003f888 ); -PROVIDE ( r_ld_sco_audio_isr = 0x40037cc8 ); -PROVIDE ( r_ld_sco_data_tx = 0x40037ee8 ); -PROVIDE ( r_ld_sco_start = 0x40037110 ); -PROVIDE ( r_ld_sco_stop = 0x40037c40 ); -PROVIDE ( r_ld_sco_update = 0x40037a74 ); -PROVIDE ( r_ld_sscan_activated = 0x4004031c ); -PROVIDE ( r_ld_sscan_init = 0x400402f0 ); -PROVIDE ( r_ld_sscan_reset = 0x400402fc ); -PROVIDE ( r_ld_sscan_start = 0x40040384 ); -PROVIDE ( r_ld_strain_init = 0x400409f4 ); -PROVIDE ( r_ld_strain_reset = 0x40040a00 ); -PROVIDE ( r_ld_strain_start = 0x40040a8c ); -PROVIDE ( r_ld_strain_stop = 0x40040df0 ); -PROVIDE ( r_ld_timing_accuracy_get = 0x4003caac ); -PROVIDE ( r_ld_util_active_master_afh_map_get = 0x4004131c ); -PROVIDE ( r_ld_util_active_master_afh_map_set = 0x40041308 ); -PROVIDE ( r_ld_util_bch_create = 0x40040fcc ); -PROVIDE ( r_ld_util_fhs_pk = 0x400411c8 ); -PROVIDE ( r_ld_util_fhs_unpk = 0x40040e54 ); -PROVIDE ( r_ld_util_stp_pk = 0x400413f4 ); -PROVIDE ( r_ld_util_stp_unpk = 0x40041324 ); -PROVIDE ( r_ld_version_get = 0x4003ca6c ); -PROVIDE ( r_ld_wlcoex_set = 0x4003caf8 ); -PROVIDE ( r_llc_ch_assess_get_current_ch_map = 0x40041574 ); -PROVIDE ( r_llc_ch_assess_get_local_ch_map = 0x4004150c ); -PROVIDE ( r_llc_ch_assess_local = 0x40041494 ); -PROVIDE ( r_llc_ch_assess_merge_ch = 0x40041588 ); -PROVIDE ( r_llc_ch_assess_reass_ch = 0x400415c0 ); -PROVIDE ( r_llc_common_cmd_complete_send = 0x40044eac ); -PROVIDE ( r_llc_common_cmd_status_send = 0x40044ee0 ); -PROVIDE ( r_llc_common_enc_change_evt_send = 0x40044f6c ); -PROVIDE ( r_llc_common_enc_key_ref_comp_evt_send = 0x40044f38 ); -PROVIDE ( r_llc_common_flush_occurred_send = 0x40044f0c ); -PROVIDE ( r_llc_common_nb_of_pkt_comp_evt_send = 0x40045000 ); -PROVIDE ( r_llc_con_update_complete_send = 0x40044d68 ); -PROVIDE ( r_llc_con_update_finished = 0x4004518c ); -PROVIDE ( r_llc_con_update_ind = 0x40045038 ); -PROVIDE ( r_llc_discon_event_complete_send = 0x40044a30 ); -PROVIDE ( r_llc_end_evt_defer = 0x40046330 ); -PROVIDE ( r_llc_feats_rd_event_send = 0x40044e0c ); -PROVIDE ( r_llc_init = 0x40044778 ); -PROVIDE ( r_llc_le_con_cmp_evt_send = 0x40044a78 ); -PROVIDE ( r_llc_llcp_ch_map_update_pdu_send = 0x40043f94 ); -PROVIDE ( r_llc_llcp_con_param_req_pdu_send = 0x400442fc ); -PROVIDE ( r_llc_llcp_con_param_rsp_pdu_send = 0x40044358 ); -PROVIDE ( r_llc_llcp_con_update_pdu_send = 0x400442c4 ); -PROVIDE ( r_llc_llcp_enc_req_pdu_send = 0x40044064 ); -PROVIDE ( r_llc_llcp_enc_rsp_pdu_send = 0x40044160 ); -PROVIDE ( r_llc_llcp_feats_req_pdu_send = 0x400443b4 ); -PROVIDE ( r_llc_llcp_feats_rsp_pdu_send = 0x400443f0 ); -PROVIDE ( r_llc_llcp_get_autorize = 0x4004475c ); -PROVIDE ( r_llc_llcp_length_req_pdu_send = 0x40044574 ); -PROVIDE ( r_llc_llcp_length_rsp_pdu_send = 0x400445ac ); -PROVIDE ( r_llc_llcp_pause_enc_req_pdu_send = 0x40043fd8 ); -PROVIDE ( r_llc_llcp_pause_enc_rsp_pdu_send = 0x40044010 ); -PROVIDE ( r_llc_llcp_ping_req_pdu_send = 0x4004454c ); -PROVIDE ( r_llc_llcp_ping_rsp_pdu_send = 0x40044560 ); -PROVIDE ( r_llc_llcp_recv_handler = 0x40044678 ); -PROVIDE ( r_llc_llcp_reject_ind_pdu_send = 0x4004425c ); -PROVIDE ( r_llc_llcp_start_enc_req_pdu_send = 0x4004441c ); -PROVIDE ( r_llc_llcp_start_enc_rsp_pdu_send = 0x400441f8 ); -PROVIDE ( r_llc_llcp_terminate_ind_pdu_send = 0x400444b0 ); -PROVIDE ( r_llc_llcp_tester_send = 0x400445e4 ); -PROVIDE ( r_llc_llcp_unknown_rsp_send_pdu = 0x40044534 ); -PROVIDE ( r_llc_llcp_version_ind_pdu_send = 0x40043f6c ); -PROVIDE ( r_llc_lsto_con_update = 0x40045098 ); -PROVIDE ( r_llc_ltk_req_send = 0x40044dc0 ); -PROVIDE ( r_llc_map_update_finished = 0x40045260 ); -PROVIDE ( r_llc_map_update_ind = 0x400450f0 ); -PROVIDE ( r_llc_pdu_acl_tx_ack_defer = 0x400464dc ); -PROVIDE ( r_llc_pdu_defer = 0x40046528 ); -PROVIDE ( r_llc_pdu_llcp_tx_ack_defer = 0x400463ac ); -PROVIDE ( r_llc_reset = 0x400447b8 ); -PROVIDE ( r_llc_start = 0x400447f4 ); -PROVIDE ( r_llc_stop = 0x400449ac ); -PROVIDE ( r_llc_util_bw_mgt = 0x4004629c ); -PROVIDE ( r_llc_util_clear_operation_ptr = 0x40046234 ); -PROVIDE ( r_llc_util_dicon_procedure = 0x40046130 ); -PROVIDE ( r_llc_util_get_free_conhdl = 0x400460c8 ); -PROVIDE ( r_llc_util_get_nb_active_link = 0x40046100 ); -PROVIDE ( r_llc_util_set_auth_payl_to_margin = 0x400461f4 ); -PROVIDE ( r_llc_util_set_llcp_discard_enable = 0x400461c8 ); -PROVIDE ( r_llc_util_update_channel_map = 0x400461ac ); -PROVIDE ( r_llc_version_rd_event_send = 0x40044e60 ); -PROVIDE ( r_lld_adv_start = 0x40048b38 ); -PROVIDE ( r_lld_adv_stop = 0x40048ea0 ); -PROVIDE ( r_lld_ch_map_ind = 0x4004a2f4 ); -PROVIDE ( r_lld_con_param_req = 0x40049f0c ); -PROVIDE ( r_lld_con_param_rsp = 0x40049e00 ); -PROVIDE ( r_lld_con_start = 0x400491f8 ); -PROVIDE ( r_lld_con_stop = 0x40049fdc ); -PROVIDE ( r_lld_con_update_after_param_req = 0x40049bcc ); -PROVIDE ( r_lld_con_update_ind = 0x4004a30c ); -PROVIDE ( r_lld_con_update_req = 0x40049b60 ); -PROVIDE ( r_lld_core_reset = 0x40048a9c ); -PROVIDE ( r_lld_crypt_isr = 0x4004a324 ); -PROVIDE ( r_lld_evt_adv_create = 0x400481f4 ); -PROVIDE ( r_lld_evt_canceled = 0x400485c8 ); -PROVIDE ( r_lld_evt_channel_next = 0x40046aac ); -PROVIDE ( r_lld_evt_deffered_elt_handler = 0x400482bc ); -PROVIDE ( r_lld_evt_delete_elt_handler = 0x40046974 ); -PROVIDE ( r_lld_evt_delete_elt_push = 0x40046a3c ); -PROVIDE ( r_lld_evt_drift_compute = 0x40047670 ); -PROVIDE ( r_lld_evt_elt_delete = 0x40047538 ); -PROVIDE ( r_lld_evt_elt_insert = 0x400474c8 ); -PROVIDE ( r_lld_evt_end = 0x400483e8 ); -PROVIDE ( r_lld_evt_end_isr = 0x4004862c ); -PROVIDE ( r_lld_evt_init = 0x40046b3c ); -PROVIDE ( r_lld_evt_init_evt = 0x40046cd0 ); -PROVIDE ( r_lld_evt_move_to_master = 0x40047ba0 ); -PROVIDE ( r_lld_evt_move_to_slave = 0x40047e18 ); -PROVIDE ( r_lld_evt_prevent_stop = 0x40047adc ); -PROVIDE ( r_lld_evt_restart = 0x40046d50 ); -PROVIDE ( r_lld_evt_rx = 0x40048578 ); -PROVIDE ( r_lld_evt_rx_isr = 0x40048678 ); -PROVIDE ( r_lld_evt_scan_create = 0x40047ae8 ); -PROVIDE ( r_lld_evt_schedule = 0x40047908 ); -PROVIDE ( r_lld_evt_schedule_next = 0x400477dc ); -PROVIDE ( r_lld_evt_schedule_next_instant = 0x400476a8 ); -PROVIDE ( r_lld_evt_slave_update = 0x40048138 ); -PROVIDE ( r_lld_evt_update_create = 0x40047cd8 ); -PROVIDE ( r_lld_get_mode = 0x40049ff8 ); -PROVIDE ( r_lld_init = 0x4004873c ); -PROVIDE ( r_lld_move_to_master = 0x400499e0 ); -PROVIDE ( r_lld_move_to_slave = 0x4004a024 ); -PROVIDE ( r_lld_pdu_adv_pack = 0x4004b488 ); -PROVIDE ( r_lld_pdu_check = 0x4004ac34 ); -PROVIDE ( r_lld_pdu_data_send = 0x4004b018 ); -PROVIDE ( r_lld_pdu_data_tx_push = 0x4004aecc ); -PROVIDE ( r_lld_pdu_rx_handler = 0x4004b4d4 ); -PROVIDE ( r_lld_pdu_send_packet = 0x4004b774 ); -PROVIDE ( r_lld_pdu_tx_flush = 0x4004b414 ); -PROVIDE ( r_lld_pdu_tx_loop = 0x4004ae40 ); -PROVIDE ( r_lld_pdu_tx_prog = 0x4004b120 ); -PROVIDE ( r_lld_pdu_tx_push = 0x4004b080 ); -PROVIDE ( r_lld_ral_renew_req = 0x4004a73c ); -PROVIDE ( r_lld_scan_start = 0x40048ee0 ); -PROVIDE ( r_lld_scan_stop = 0x40049190 ); -PROVIDE ( r_lld_test_mode_rx = 0x4004a540 ); -PROVIDE ( r_lld_test_mode_tx = 0x4004a350 ); -PROVIDE ( r_lld_test_stop = 0x4004a710 ); -PROVIDE ( r_lld_util_anchor_point_move = 0x4004bacc ); -PROVIDE ( r_lld_util_compute_ce_max = 0x4004bc0c ); -PROVIDE ( r_lld_util_connection_param_set = 0x4004ba40 ); -PROVIDE ( r_lld_util_dle_set_cs_fields = 0x4004ba90 ); -PROVIDE ( r_lld_util_eff_tx_time_set = 0x4004bd88 ); -PROVIDE ( r_lld_util_elt_programmed = 0x4004bce0 ); -PROVIDE ( r_lld_util_flush_list = 0x4004bbd8 ); -PROVIDE ( r_lld_util_freq2chnl = 0x4004b9e4 ); -PROVIDE ( r_lld_util_get_bd_address = 0x4004b8ac ); -PROVIDE ( r_lld_util_get_local_offset = 0x4004ba10 ); -PROVIDE ( r_lld_util_get_peer_offset = 0x4004ba24 ); -PROVIDE ( r_lld_util_get_tx_pkt_cnt = 0x4004bd80 ); -PROVIDE ( r_lld_util_instant_get = 0x4004b890 ); -PROVIDE ( r_lld_util_instant_ongoing = 0x4004bbfc ); -PROVIDE ( r_lld_util_priority_set = 0x4004bd10 ); -PROVIDE ( r_lld_util_priority_update = 0x4004bd78 ); -PROVIDE ( r_lld_util_ral_force_rpa_renew = 0x4004b980 ); -PROVIDE ( r_lld_util_set_bd_address = 0x4004b8f8 ); -PROVIDE ( r_lld_wlcoex_set = 0x4004bd98 ); -PROVIDE ( r_llm_ble_ready = 0x4004cc34 ); -PROVIDE ( r_llm_common_cmd_complete_send = 0x4004d288 ); -PROVIDE ( r_llm_common_cmd_status_send = 0x4004d2b4 ); -PROVIDE ( r_llm_con_req_ind = 0x4004cc54 ); -PROVIDE ( r_llm_con_req_tx_cfm = 0x4004d158 ); -PROVIDE ( r_llm_create_con = 0x4004de78 ); -PROVIDE ( r_llm_encryption_done = 0x4004dff8 ); -PROVIDE ( r_llm_encryption_start = 0x4004e128 ); -PROVIDE ( r_llm_end_evt_defer = 0x4004eb6c ); -PROVIDE ( r_llm_init = 0x4004c9f8 ); -PROVIDE ( r_llm_le_adv_report_ind = 0x4004cdf4 ); -PROVIDE ( r_llm_pdu_defer = 0x4004ec48 ); -PROVIDE ( r_llm_ral_clear = 0x4004e1fc ); -PROVIDE ( r_llm_ral_dev_add = 0x4004e23c ); -PROVIDE ( r_llm_ral_dev_rm = 0x4004e3bc ); -PROVIDE ( r_llm_ral_get_rpa = 0x4004e400 ); -PROVIDE ( r_llm_ral_set_timeout = 0x4004e4a0 ); -PROVIDE ( r_llm_ral_update = 0x4004e4f8 ); -PROVIDE ( r_llm_set_adv_data = 0x4004d960 ); -PROVIDE ( r_llm_set_adv_en = 0x4004d7ec ); -PROVIDE ( r_llm_set_adv_param = 0x4004d5f4 ); -PROVIDE ( r_llm_set_scan_en = 0x4004db64 ); -PROVIDE ( r_llm_set_scan_param = 0x4004dac8 ); -PROVIDE ( r_llm_set_scan_rsp_data = 0x4004da14 ); -PROVIDE ( r_llm_test_mode_start_rx = 0x4004d534 ); -PROVIDE ( r_llm_test_mode_start_tx = 0x4004d2fc ); -PROVIDE ( r_llm_util_adv_data_update = 0x4004e8fc ); -PROVIDE ( r_llm_util_apply_bd_addr = 0x4004e868 ); -PROVIDE ( r_llm_util_bd_addr_in_ral = 0x4004eb08 ); -PROVIDE ( r_llm_util_bd_addr_in_wl = 0x4004e788 ); -PROVIDE ( r_llm_util_bd_addr_wl_position = 0x4004e720 ); -PROVIDE ( r_llm_util_bl_add = 0x4004e9ac ); -PROVIDE ( r_llm_util_bl_check = 0x4004e930 ); -PROVIDE ( r_llm_util_bl_rem = 0x4004ea70 ); -PROVIDE ( r_llm_util_check_address_validity = 0x4004e7e4 ); -PROVIDE ( r_llm_util_check_evt_mask = 0x4004e8b0 ); -PROVIDE ( r_llm_util_check_map_validity = 0x4004e800 ); -PROVIDE ( r_llm_util_get_channel_map = 0x4004e8d4 ); -PROVIDE ( r_llm_util_get_supp_features = 0x4004e8e8 ); -PROVIDE ( r_llm_util_set_public_addr = 0x4004e89c ); -PROVIDE ( r_llm_wl_clr = 0x4004dc54 ); -PROVIDE ( r_llm_wl_dev_add = 0x4004dcc0 ); -PROVIDE ( r_llm_wl_dev_add_hdl = 0x4004dd38 ); -PROVIDE ( r_llm_wl_dev_rem = 0x4004dcfc ); -PROVIDE ( r_llm_wl_dev_rem_hdl = 0x4004dde0 ); -PROVIDE ( r_lm_acl_disc = 0x4004f148 ); -PROVIDE ( r_LM_AddSniff = 0x40022d20 ); -PROVIDE ( r_lm_add_sync = 0x40051358 ); -PROVIDE ( r_lm_afh_activate_timer = 0x4004f444 ); -PROVIDE ( r_lm_afh_ch_ass_en_get = 0x4004f3f8 ); -PROVIDE ( r_lm_afh_host_ch_class_get = 0x4004f410 ); -PROVIDE ( r_lm_afh_master_ch_map_get = 0x4004f43c ); -PROVIDE ( r_lm_afh_peer_ch_class_set = 0x4004f418 ); -PROVIDE ( r_lm_check_active_sync = 0x40051334 ); -PROVIDE ( r_LM_CheckEdrFeatureRequest = 0x4002f90c ); -PROVIDE ( r_LM_CheckSwitchInstant = 0x4002f8c0 ); -PROVIDE ( r_lm_check_sync_hl_rsp = 0x4005169c ); -PROVIDE ( r_lm_clk_adj_ack_pending_clear = 0x4004f514 ); -PROVIDE ( r_lm_clk_adj_instant_pending_set = 0x4004f4d8 ); -PROVIDE ( r_LM_ComputePacketType = 0x4002f554 ); -PROVIDE ( r_LM_ComputeSniffSubRate = 0x400233ac ); -PROVIDE ( r_lm_debug_key_compare_192 = 0x4004f3a8 ); -PROVIDE ( r_lm_debug_key_compare_256 = 0x4004f3d0 ); -PROVIDE ( r_lm_dhkey_calc_init = 0x40013234 ); -PROVIDE ( r_lm_dhkey_compare = 0x400132d8 ); -PROVIDE ( r_lm_dut_mode_en_get = 0x4004f3ec ); -PROVIDE ( r_LM_ExtractMaxEncKeySize = 0x4001aca4 ); -PROVIDE ( r_lm_f1 = 0x40012bb8 ); -PROVIDE ( r_lm_f2 = 0x40012cfc ); -PROVIDE ( r_lm_f3 = 0x40013050 ); -PROVIDE ( r_lm_g = 0x40012f90 ); -PROVIDE ( r_LM_GetAFHSwitchInstant = 0x4002f86c ); -PROVIDE ( r_lm_get_auth_en = 0x4004f1ac ); -PROVIDE ( r_lm_get_common_pkt_types = 0x4002fa1c ); -PROVIDE ( r_LM_GetConnectionAcceptTimeout = 0x4004f1f4 ); -PROVIDE ( r_LM_GetFeature = 0x4002f924 ); -PROVIDE ( r_LM_GetLinkTimeout = 0x400233ec ); -PROVIDE ( r_LM_GetLocalNameSeg = 0x4004f200 ); -PROVIDE ( r_lm_get_loopback_mode = 0x4004f248 ); -PROVIDE ( r_LM_GetMasterEncKeySize = 0x4001b29c ); -PROVIDE ( r_LM_GetMasterEncRand = 0x4001b288 ); -PROVIDE ( r_LM_GetMasterKey = 0x4001b260 ); -PROVIDE ( r_LM_GetMasterKeyRand = 0x4001b274 ); -PROVIDE ( r_lm_get_min_sync_intv = 0x400517a8 ); -PROVIDE ( r_lm_get_nb_acl = 0x4004ef9c ); -PROVIDE ( r_lm_get_nb_sync_link = 0x4005179c ); -PROVIDE ( r_lm_get_nonce = 0x400131c4 ); -PROVIDE ( r_lm_get_oob_local_commit = 0x4004f374 ); -PROVIDE ( r_lm_get_oob_local_data_192 = 0x4004f2d4 ); -PROVIDE ( r_lm_get_oob_local_data_256 = 0x4004f318 ); -PROVIDE ( r_LM_GetPINType = 0x4004f1e8 ); -PROVIDE ( r_lm_get_priv_key_192 = 0x4004f278 ); -PROVIDE ( r_lm_get_priv_key_256 = 0x4004f2b8 ); -PROVIDE ( r_lm_get_pub_key_192 = 0x4004f258 ); -PROVIDE ( r_lm_get_pub_key_256 = 0x4004f298 ); -PROVIDE ( r_LM_GetQoSParam = 0x4002f6e0 ); -PROVIDE ( r_lm_get_sec_con_host_supp = 0x4004f1d4 ); -PROVIDE ( r_LM_GetSniffSubratingParam = 0x4002325c ); -PROVIDE ( r_lm_get_sp_en = 0x4004f1c0 ); -PROVIDE ( r_LM_GetSwitchInstant = 0x4002f7f8 ); -PROVIDE ( r_lm_get_synchdl = 0x4005175c ); -PROVIDE ( r_lm_get_sync_param = 0x400503b4 ); -PROVIDE ( r_lm_init = 0x4004ed34 ); -PROVIDE ( r_lm_init_sync = 0x400512d8 ); -PROVIDE ( r_lm_is_acl_con = 0x4004f47c ); -PROVIDE ( r_lm_is_acl_con_role = 0x4004f49c ); -PROVIDE ( r_lm_is_clk_adj_ack_pending = 0x4004f4e8 ); -PROVIDE ( r_lm_is_clk_adj_instant_pending = 0x4004f4c8 ); -PROVIDE ( r_lm_local_ext_fr_configured = 0x4004f540 ); -PROVIDE ( r_lm_look_for_stored_link_key = 0x4002f948 ); -PROVIDE ( r_lm_look_for_sync = 0x40051774 ); -PROVIDE ( r_lm_lt_addr_alloc = 0x4004ef1c ); -PROVIDE ( r_lm_lt_addr_free = 0x4004ef74 ); -PROVIDE ( r_lm_lt_addr_reserve = 0x4004ef48 ); -PROVIDE ( r_LM_MakeCof = 0x4002f84c ); -PROVIDE ( r_LM_MakeRandVec = 0x400112d8 ); -PROVIDE ( r_lm_master_clk_adj_req_handler = 0x40054180 ); -PROVIDE ( r_LM_MaxSlot = 0x4002f694 ); -PROVIDE ( r_lm_modif_sync = 0x40051578 ); -PROVIDE ( r_lm_n_is_zero = 0x40012170 ); -PROVIDE ( r_lm_num_clk_adj_ack_pending_set = 0x4004f500 ); -PROVIDE ( r_lm_oob_f1 = 0x40012e54 ); -PROVIDE ( r_lm_pca_sscan_link_get = 0x4004f560 ); -PROVIDE ( r_lm_pca_sscan_link_set = 0x4004f550 ); -PROVIDE ( nvds_null_read = 0x400542a0 ); -PROVIDE ( nvds_null_write = 0x400542a8 ); -PROVIDE ( nvds_null_erase = 0x400542b0 ); -PROVIDE ( nvds_read = 0x400542c4 ); -PROVIDE ( nvds_write = 0x400542fc ); -PROVIDE ( nvds_erase = 0x40054334 ); -PROVIDE ( nvds_init_memory = 0x40054358 ); -PROVIDE ( r_lmp_pack = 0x4001135c ); -PROVIDE ( r_lmp_unpack = 0x4001149c ); -PROVIDE ( r_lm_read_features = 0x4004f0d8 ); -PROVIDE ( r_LM_RemoveSniff = 0x40023124 ); -PROVIDE ( r_LM_RemoveSniffSubrating = 0x400233c4 ); -PROVIDE ( r_lm_remove_sync = 0x400517c8 ); -PROVIDE ( r_lm_reset_sync = 0x40051304 ); -PROVIDE ( r_lm_role_switch_finished = 0x4004f028 ); -PROVIDE ( r_lm_role_switch_start = 0x4004efe0 ); -PROVIDE ( r_lm_sco_nego_end = 0x40051828 ); -PROVIDE ( r_LM_SniffSubrateNegoRequired = 0x40023334 ); -PROVIDE ( r_LM_SniffSubratingHlReq = 0x40023154 ); -PROVIDE ( r_LM_SniffSubratingPeerReq = 0x400231dc ); -PROVIDE ( r_lm_sp_debug_mode_get = 0x4004f398 ); -PROVIDE ( r_lm_sp_n192_convert_wnaf = 0x400123c0 ); -PROVIDE ( r_lm_sp_n_one = 0x400123a4 ); -PROVIDE ( r_lm_sp_p192_add = 0x40012828 ); -PROVIDE ( r_lm_sp_p192_dbl = 0x4001268c ); -PROVIDE ( r_lm_sp_p192_invert = 0x40012b6c ); -PROVIDE ( r_lm_sp_p192_point_jacobian_to_affine = 0x40012468 ); -PROVIDE ( r_lm_sp_p192_points_jacobian_to_affine = 0x400124e4 ); -PROVIDE ( r_lm_sp_p192_point_to_inf = 0x40012458 ); -PROVIDE ( r_lm_sp_pre_compute_points = 0x40012640 ); -PROVIDE ( r_lm_sp_sha256_calculate = 0x400121a0 ); -PROVIDE ( r_LM_SuppressAclPacket = 0x4002f658 ); -PROVIDE ( r_lm_sync_flow_ctrl_en_get = 0x4004f404 ); -PROVIDE ( r_LM_UpdateAclEdrPacketType = 0x4002f5d8 ); -PROVIDE ( r_LM_UpdateAclPacketType = 0x4002f584 ); -PROVIDE ( r_modules_funcs = 0x3ffafd6c ); -PROVIDE ( r_modules_funcs_p = 0x3ffafd68 ); -PROVIDE ( r_nvds_del = 0x400544c4 ); -PROVIDE ( r_nvds_get = 0x40054488 ); -PROVIDE ( r_nvds_init = 0x40054410 ); -PROVIDE ( r_nvds_lock = 0x400544fc ); -PROVIDE ( r_nvds_put = 0x40054534 ); -PROVIDE ( rom_abs_temp = 0x400054f0 ); -PROVIDE ( rom_bb_bss_bw_40_en = 0x4000401c ); -PROVIDE ( rom_bb_bss_cbw40_dig = 0x40003bac ); -PROVIDE ( rom_bb_rx_ht20_cen_bcov_en = 0x40003734 ); -PROVIDE ( rom_bb_tx_ht20_cen = 0x40003760 ); -PROVIDE ( rom_bb_wdg_test_en = 0x40003b70 ); -PROVIDE ( rom_cbw2040_cfg = 0x400040b0 ); -PROVIDE ( rom_check_noise_floor = 0x40003c78 ); -PROVIDE ( rom_chip_i2c_readReg = 0x40004110 ); -PROVIDE ( rom_chip_i2c_writeReg = 0x40004168 ); -PROVIDE ( rom_chip_v7_bt_init = 0x40004d8c ); -PROVIDE ( rom_chip_v7_rx_init = 0x40004cec ); -PROVIDE ( rom_chip_v7_rx_rifs_en = 0x40003d90 ); -PROVIDE ( rom_chip_v7_tx_init = 0x40004d18 ); -PROVIDE ( rom_clk_force_on_vit = 0x40003710 ); -PROVIDE ( rom_correct_rf_ana_gain = 0x400062a8 ); -PROVIDE ( rom_dc_iq_est = 0x400055c8 ); -PROVIDE ( rom_disable_agc = 0x40002fa4 ); -PROVIDE ( rom_enable_agc = 0x40002fcc ); -PROVIDE ( rom_en_pwdet = 0x4000506c ); -PROVIDE ( rom_gen_rx_gain_table = 0x40003e3c ); -PROVIDE ( rom_get_data_sat = 0x4000312c ); -PROVIDE ( rom_get_fm_sar_dout = 0x40005204 ); -PROVIDE ( rom_get_power_db = 0x40005fc8 ); -PROVIDE ( rom_get_pwctrl_correct = 0x400065d4 ); -PROVIDE ( rom_get_rfcal_rxiq_data = 0x40005bbc ); -PROVIDE ( rom_get_rf_gain_qdb = 0x40006290 ); -PROVIDE ( rom_get_sar_dout = 0x40006564 ); -PROVIDE ( rom_i2c_readReg = 0x40004148 ); -PROVIDE ( rom_i2c_readReg_Mask = 0x400041c0 ); -PROVIDE ( rom_i2c_writeReg = 0x400041a4 ); -PROVIDE ( rom_i2c_writeReg_Mask = 0x400041fc ); -PROVIDE ( rom_index_to_txbbgain = 0x40004df8 ); -PROVIDE ( rom_iq_est_disable = 0x40005590 ); -PROVIDE ( rom_iq_est_enable = 0x40005514 ); -PROVIDE ( rom_linear_to_db = 0x40005f64 ); -PROVIDE ( rom_loopback_mode_en = 0x400030f8 ); -PROVIDE ( rom_meas_tone_pwr_db = 0x40006004 ); -PROVIDE ( rom_mhz2ieee = 0x4000404c ); -PROVIDE ( rom_noise_floor_auto_set = 0x40003bdc ); -PROVIDE ( rom_pbus_debugmode = 0x40004458 ); -PROVIDE ( rom_pbus_force_mode = 0x40004270 ); -PROVIDE ( rom_pbus_force_test = 0x400043c0 ); -PROVIDE ( rom_pbus_rd = 0x40004414 ); -PROVIDE ( rom_pbus_rd_addr = 0x40004334 ); -PROVIDE ( rom_pbus_rd_shift = 0x40004374 ); -PROVIDE ( rom_pbus_rx_dco_cal = 0x40005620 ); -PROVIDE ( rom_pbus_set_dco = 0x40004638 ); -PROVIDE ( rom_pbus_set_rxgain = 0x40004480 ); -PROVIDE ( rom_pbus_workmode = 0x4000446c ); -PROVIDE ( rom_pbus_xpd_rx_off = 0x40004508 ); -PROVIDE ( rom_pbus_xpd_rx_on = 0x4000453c ); -PROVIDE ( rom_pbus_xpd_tx_off = 0x40004590 ); -PROVIDE ( rom_pbus_xpd_tx_on = 0x400045e0 ); -PROVIDE ( rom_phy_disable_agc = 0x40002f6c ); -PROVIDE ( rom_phy_disable_cca = 0x40003000 ); -PROVIDE ( rom_phy_enable_agc = 0x40002f88 ); -PROVIDE ( rom_phy_enable_cca = 0x4000302c ); -PROVIDE ( rom_phy_freq_correct = 0x40004b44 ); -PROVIDE ( rom_phyFuns = 0x3ffae0c0 ); -PROVIDE ( rom_phy_get_noisefloor = 0x40003c2c ); -PROVIDE ( rom_phy_get_vdd33 = 0x4000642c ); -PROVIDE ( rom_pow_usr = 0x40003044 ); -PROVIDE ( rom_read_sar_dout = 0x400051c0 ); -PROVIDE ( rom_restart_cal = 0x400046e0 ); -PROVIDE ( rom_rfcal_pwrctrl = 0x40006058 ); -PROVIDE ( rom_rfcal_rxiq = 0x40005b4c ); -PROVIDE ( rom_rfcal_txcap = 0x40005dec ); -PROVIDE ( rom_rfpll_reset = 0x40004680 ); -PROVIDE ( rom_rfpll_set_freq = 0x400047f8 ); -PROVIDE ( rom_rtc_mem_backup = 0x40003db4 ); -PROVIDE ( rom_rtc_mem_recovery = 0x40003df4 ); -PROVIDE ( rom_rx_gain_force = 0x4000351c ); -PROVIDE ( rom_rxiq_cover_mg_mp = 0x40005a68 ); -PROVIDE ( rom_rxiq_get_mis = 0x400058e4 ); -PROVIDE ( rom_rxiq_set_reg = 0x40005a00 ); -PROVIDE ( rom_set_cal_rxdc = 0x400030b8 ); -PROVIDE ( rom_set_chan_cal_interp = 0x40005ce0 ); -PROVIDE ( rom_set_channel_freq = 0x40004880 ); -PROVIDE ( rom_set_loopback_gain = 0x40003060 ); -PROVIDE ( rom_set_noise_floor = 0x40003d48 ); -PROVIDE ( rom_set_pbus_mem = 0x400031a4 ); -PROVIDE ( rom_set_rf_freq_offset = 0x40004ca8 ); -PROVIDE ( rom_set_rxclk_en = 0x40003594 ); -PROVIDE ( rom_set_txcap_reg = 0x40005d50 ); -PROVIDE ( rom_set_txclk_en = 0x40003564 ); -PROVIDE ( rom_spur_coef_cfg = 0x40003ac8 ); -PROVIDE ( rom_spur_reg_write_one_tone = 0x400037f0 ); -PROVIDE ( rom_start_tx_tone = 0x400036b4 ); -PROVIDE ( rom_start_tx_tone_step = 0x400035d0 ); -PROVIDE ( rom_stop_tx_tone = 0x40003f98 ); -PROVIDE ( _rom_store = 0x4000d66c ); -PROVIDE ( _rom_store_table = 0x4000d4f8 ); -PROVIDE ( rom_target_power_add_backoff = 0x40006268 ); -PROVIDE ( rom_tx_atten_set_interp = 0x400061cc ); -PROVIDE ( rom_txbbgain_to_index = 0x40004dc0 ); -PROVIDE ( rom_txcal_work_mode = 0x4000510c ); -PROVIDE ( rom_txdc_cal_init = 0x40004e10 ); -PROVIDE ( rom_txdc_cal_v70 = 0x40004ea4 ); -PROVIDE ( rom_txiq_cover = 0x4000538c ); -PROVIDE ( rom_txiq_get_mis_pwr = 0x400052dc ); -PROVIDE ( rom_txiq_set_reg = 0x40005154 ); -PROVIDE ( rom_tx_pwctrl_bg_init = 0x4000662c ); -PROVIDE ( rom_txtone_linear_pwr = 0x40005290 ); -PROVIDE ( rom_wait_rfpll_cal_end = 0x400047a8 ); -PROVIDE ( rom_write_gain_mem = 0x4000348c ); -PROVIDE ( rom_write_rfpll_sdm = 0x40004740 ); -PROVIDE ( roundup2 = 0x4000ab7c ); -PROVIDE ( r_plf_funcs_p = 0x3ffb8360 ); -PROVIDE ( r_rf_rw_bt_init = 0x40054868 ); -PROVIDE ( r_rf_rw_init = 0x40054b0c ); -PROVIDE ( r_rf_rw_le_init = 0x400549d0 ); -PROVIDE ( r_rwble_activity_ongoing_check = 0x40054d8c ); -PROVIDE ( r_rwble_init = 0x40054bf4 ); -PROVIDE ( r_rwble_isr = 0x40054e08 ); -PROVIDE ( r_rwble_reset = 0x40054ce8 ); -PROVIDE ( r_rwble_sleep_check = 0x40054d78 ); -PROVIDE ( r_rwble_version = 0x40054dac ); -PROVIDE ( r_rwbt_init = 0x40055160 ); -PROVIDE ( r_rwbt_isr = 0x40055248 ); -PROVIDE ( r_rwbt_reset = 0x400551bc ); -PROVIDE ( r_rwbt_sleep_check = 0x4005577c ); -PROVIDE ( r_rwbt_sleep_enter = 0x400557a4 ); -PROVIDE ( r_rwbt_sleep_wakeup = 0x400557fc ); -PROVIDE ( r_rwbt_sleep_wakeup_end = 0x400558cc ); -PROVIDE ( r_rwbt_version = 0x4005520c ); -PROVIDE ( r_rwip_assert_err = 0x40055f88 ); -PROVIDE ( r_rwip_check_wakeup_boundary = 0x400558fc ); -PROVIDE ( r_rwip_ext_wakeup_enable = 0x40055f3c ); -PROVIDE ( r_rwip_init = 0x4005595c ); -PROVIDE ( r_rwip_pca_clock_dragging_only = 0x40055f48 ); -PROVIDE ( r_rwip_prevent_sleep_clear = 0x40055ec8 ); -PROVIDE ( r_rwip_prevent_sleep_set = 0x40055e64 ); -PROVIDE ( r_rwip_reset = 0x40055ab8 ); -PROVIDE ( r_rwip_schedule = 0x40055b38 ); -PROVIDE ( r_rwip_sleep = 0x40055b5c ); -PROVIDE ( r_rwip_sleep_enable = 0x40055f30 ); -PROVIDE ( r_rwip_version = 0x40055b20 ); -PROVIDE ( r_rwip_wakeup = 0x40055dc4 ); -PROVIDE ( r_rwip_wakeup_delay_set = 0x40055e4c ); -PROVIDE ( r_rwip_wakeup_end = 0x40055e18 ); -PROVIDE ( r_rwip_wlcoex_set = 0x40055f60 ); -PROVIDE ( r_SHA_256 = 0x40013a90 ); -PROVIDE ( rwip_coex_cfg = 0x3ff9914c ); -PROVIDE ( rwip_priority = 0x3ff99159 ); -PROVIDE ( rwip_rf = 0x3ffbdb28 ); -PROVIDE ( rwip_rf_p_get = 0x400558f4 ); -PROVIDE ( r_XorKey = 0x400112c0 ); -PROVIDE ( __sf_fake_stderr = 0x3ff96458 ); -PROVIDE ( __sf_fake_stdin = 0x3ff96498 ); -PROVIDE ( __sf_fake_stdout = 0x3ff96478 ); -PROVIDE ( sha_blk_bits = 0x3ff99290 ); -PROVIDE ( sha_blk_bits_bytes = 0x3ff99288 ); -PROVIDE ( sha_blk_hash_bytes = 0x3ff9928c ); -PROVIDE ( sig_matrix = 0x3ffae293 ); -PROVIDE ( sip_after_tx_complete = 0x4000b358 ); -PROVIDE ( sip_alloc_to_host_evt = 0x4000ab9c ); -PROVIDE ( sip_get_ptr = 0x4000b34c ); -PROVIDE ( sip_get_state = 0x4000ae2c ); -PROVIDE ( sip_init_attach = 0x4000ae58 ); -PROVIDE ( sip_install_rx_ctrl_cb = 0x4000ae10 ); -PROVIDE ( sip_install_rx_data_cb = 0x4000ae20 ); -PROVIDE ( sip_is_active = 0x4000b3c0 ); -PROVIDE ( sip_post_init = 0x4000aed8 ); -PROVIDE ( sip_reclaim_from_host_cmd = 0x4000adbc ); -PROVIDE ( sip_reclaim_tx_data_pkt = 0x4000ad5c ); -PROVIDE ( sip_send = 0x4000af54 ); -PROVIDE ( sip_to_host_chain_append = 0x4000aef8 ); -PROVIDE ( sip_to_host_evt_send_done = 0x4000ac04 ); -PROVIDE ( slc_add_credits = 0x4000baf4 ); -PROVIDE ( slc_enable = 0x4000b64c ); -PROVIDE ( slc_from_host_chain_fetch = 0x4000b7e8 ); -PROVIDE ( slc_from_host_chain_recycle = 0x4000bb10 ); -PROVIDE ( slc_has_pkt_to_host = 0x4000b5fc ); -PROVIDE ( slc_init_attach = 0x4000b918 ); -PROVIDE ( slc_init_credit = 0x4000badc ); -PROVIDE ( slc_reattach = 0x4000b62c ); -PROVIDE ( slc_send_to_host_chain = 0x4000b6a0 ); -PROVIDE ( slc_set_host_io_max_window = 0x4000b89c ); -PROVIDE ( slc_to_host_chain_recycle = 0x4000b758 ); -PROVIDE ( specialModP256 = 0x4001600c ); -PROVIDE ( __stack = 0x3ffe3f20 ); -PROVIDE ( __stack_app = 0x3ffe7e30 ); -PROVIDE ( _stack_sentry = 0x3ffe1320 ); -PROVIDE ( _stack_sentry_app = 0x3ffe5230 ); -PROVIDE ( _start = 0x40000704 ); -PROVIDE ( start_tb_console = 0x4005a980 ); -PROVIDE ( _stat_r = 0x4000bcb4 ); -PROVIDE ( _stext = 0x40000560 ); -PROVIDE ( SubtractBigHex256 = 0x40015bcc ); -PROVIDE ( SubtractBigHexMod256 = 0x40015e8c ); -PROVIDE ( SubtractBigHexUint32_256 = 0x40015f8c ); -PROVIDE ( SubtractFromSelfBigHex256 = 0x40015c20 ); -PROVIDE ( SubtractFromSelfBigHexSign256 = 0x40015dc8 ); -PROVIDE ( sw_to_hw = 0x3ffb8d40 ); -PROVIDE ( syscall_table_ptr_app = 0x3ffae020 ); -PROVIDE ( syscall_table_ptr_pro = 0x3ffae024 ); -PROVIDE ( tdefl_compress = 0x400600bc ); -PROVIDE ( tdefl_compress_buffer = 0x400607f4 ); -PROVIDE ( tdefl_compress_mem_to_mem = 0x40060900 ); -PROVIDE ( tdefl_compress_mem_to_output = 0x400608e0 ); -PROVIDE ( tdefl_get_adler32 = 0x400608d8 ); -PROVIDE ( tdefl_get_prev_return_status = 0x400608d0 ); -PROVIDE ( tdefl_init = 0x40060810 ); -PROVIDE ( tdefl_write_image_to_png_file_in_memory = 0x4006091c ); -PROVIDE ( tdefl_write_image_to_png_file_in_memory_ex = 0x40060910 ); -PROVIDE ( _timezone = 0x3ffae0a0 ); -PROVIDE ( tinfl_decompress = 0x4005ef30 ); -PROVIDE ( tinfl_decompress_mem_to_callback = 0x40060090 ); -PROVIDE ( tinfl_decompress_mem_to_mem = 0x40060050 ); -PROVIDE ( _tzname = 0x3ffae030 ); -PROVIDE ( UartDev = 0x3ffe019c ); -PROVIDE ( _unlink_r = 0x4000bc84 ); -PROVIDE ( user_code_start = 0x3ffe0400 ); -PROVIDE ( veryBigHexP256 = 0x3ff9736c ); -PROVIDE ( __wctomb = 0x3ff96540 ); -PROVIDE ( _write_r = 0x4000bd70 ); -PROVIDE ( xthal_bcopy = 0x4000c098 ); -PROVIDE ( xthal_copy123 = 0x4000c124 ); -PROVIDE ( xthal_get_ccompare = 0x4000c078 ); -PROVIDE ( xthal_get_ccount = 0x4000c050 ); -PROVIDE ( xthal_get_interrupt = 0x4000c1e4 ); -PROVIDE ( xthal_get_intread = 0x4000c1e4 ); -PROVIDE ( Xthal_intlevel = 0x3ff9c2b4 ); -PROVIDE ( xthal_memcpy = 0x4000c0bc ); -PROVIDE ( xthal_set_ccompare = 0x4000c058 ); -PROVIDE ( xthal_set_intclear = 0x4000c1ec ); -PROVIDE ( _xtos_set_intlevel = 0x4000bfdc ); -PROVIDE ( g_ticks_per_us_pro = 0x3ffe01e0 ); -PROVIDE ( g_ticks_per_us_app = 0x3ffe40f0 ); -PROVIDE ( esp_rom_spiflash_config_param = 0x40063238 ); -PROVIDE ( esp_rom_spiflash_read_user_cmd = 0x400621b0 ); -PROVIDE ( esp_rom_spiflash_write_encrypted_disable = 0x40062e60 ); -PROVIDE ( esp_rom_spiflash_write_encrypted_enable = 0x40062df4 ); -PROVIDE ( esp_rom_spiflash_prepare_encrypted_data = 0x40062e1c ); -PROVIDE ( esp_rom_spiflash_select_qio_pins = 0x40061ddc ); -PROVIDE ( esp_rom_spiflash_attach = 0x40062a6c ); -PROVIDE ( esp_rom_spiflash_config_clk = 0x40062bc8 ); -PROVIDE ( g_rom_spiflash_chip = 0x3ffae270 ); - -/* -These functions are xtos-related (or call xtos-related functions) and do not play well -with multicore FreeRTOS. Where needed, we provide alternatives that are multicore -compatible. These functions also use a chunk of static RAM, by not using them we can -allocate that RAM for general use. -*/ -/* -PROVIDE ( _DebugExceptionVector = 0x40000280 ); -PROVIDE ( _DoubleExceptionVector = 0x400003c0 ); -PROVIDE ( _KernelExceptionVector = 0x40000300 ); -PROVIDE ( _GeneralException = 0x40000e14 ); -PROVIDE ( _ResetHandler = 0x40000450 ); -PROVIDE ( _ResetVector = 0x40000400 ); -PROVIDE ( _UserExceptionVector = 0x40000340 ); -PROVIDE ( _NMIExceptionVector = 0x400002c0 ); -PROVIDE ( _WindowOverflow12 = 0x40000100 ); -PROVIDE ( _WindowOverflow4 = 0x40000000 ); -PROVIDE ( _WindowOverflow8 = 0x40000080 ); -PROVIDE ( _WindowUnderflow12 = 0x40000140 ); -PROVIDE ( _WindowUnderflow4 = 0x40000040 ); -PROVIDE ( _WindowUnderflow8 = 0x400000c0 ); -PROVIDE ( _Level2FromVector = 0x40000954 ); -PROVIDE ( _Level3FromVector = 0x40000a28 ); -PROVIDE ( _Level4FromVector = 0x40000af8 ); -PROVIDE ( _Level5FromVector = 0x40000c68 ); -PROVIDE ( _Level2Vector = 0x40000180 ); -PROVIDE ( _Level3Vector = 0x400001c0 ); -PROVIDE ( _Level4Vector = 0x40000200 ); -PROVIDE ( _Level5Vector = 0x40000240 ); -PROVIDE ( _LevelOneInterrupt = 0x40000835 ); -PROVIDE ( _SyscallException = 0x400007cf ); -PROVIDE ( _xtos_alloca_handler = 0x40000010 ); -PROVIDE ( _xtos_cause3_handler = 0x40000dd8 ); -PROVIDE ( _xtos_c_handler_table = 0x3ffe0548 ); -PROVIDE ( _xtos_c_wrapper_handler = 0x40000de8 ); -PROVIDE ( _xtos_enabled = 0x3ffe0650 ); -PROVIDE ( _xtos_exc_handler_table = 0x3ffe0448 ); -PROVIDE ( _xtos_interrupt_mask_table = 0x3ffe0758 ); -PROVIDE ( _xtos_interrupt_table = 0x3ffe0658 ); -PROVIDE ( _xtos_ints_off = 0x4000bfac ); -PROVIDE ( _xtos_ints_on = 0x4000bf88 ); -PROVIDE ( _xtos_intstruct = 0x3ffe0650 ); -PROVIDE ( _xtos_l1int_handler = 0x40000814 ); -PROVIDE ( _xtos_p_none = 0x4000bfd4 ); -PROVIDE ( _xtos_restore_intlevel = 0x40000928 ); -PROVIDE ( _xtos_return_from_exc = 0x4000c034 ); -PROVIDE ( _xtos_set_exception_handler = 0x4000074c ); -PROVIDE ( _xtos_set_interrupt_handler = 0x4000bf78 ); -PROVIDE ( _xtos_set_interrupt_handler_arg = 0x4000bf34 ); -PROVIDE ( _xtos_set_min_intlevel = 0x4000bff8 ); -PROVIDE ( _xtos_set_vpri = 0x40000934 ); -PROVIDE ( _xtos_syscall_handler = 0x40000790 ); -PROVIDE ( _xtos_unhandled_exception = 0x4000c024 ); -PROVIDE ( _xtos_unhandled_interrupt = 0x4000c01c ); -PROVIDE ( _xtos_vpri_enabled = 0x3ffe0654 ); -PROVIDE ( ets_intr_count = 0x3ffe03fc ); -*/ - -/* These functions are part of the UART downloader but also contain general UART functions. */ -PROVIDE ( FilePacketSendDeflatedReqMsgProc = 0x40008b24 ); -PROVIDE ( FilePacketSendReqMsgProc = 0x40008860 ); -PROVIDE ( FlashDwnLdDeflatedStartMsgProc = 0x40008ad8 ); -PROVIDE ( FlashDwnLdParamCfgMsgProc = 0x4000891c ); -PROVIDE ( FlashDwnLdStartMsgProc = 0x40008820 ); -PROVIDE ( FlashDwnLdStopDeflatedReqMsgProc = 0x40008c18 ); -PROVIDE ( FlashDwnLdStopReqMsgProc = 0x400088ec ); -PROVIDE ( MemDwnLdStartMsgProc = 0x40008948 ); -PROVIDE ( MemDwnLdStopReqMsgProc = 0x400089dc ); -PROVIDE ( MemPacketSendReqMsgProc = 0x40008978 ); -PROVIDE ( uart_baudrate_detect = 0x40009034 ); -PROVIDE ( uart_buff_switch = 0x400093c0 ); -PROVIDE ( UartConnCheck = 0x40008738 ); -PROVIDE ( UartConnectProc = 0x40008a04 ); -PROVIDE ( UartDwnLdProc = 0x40008ce8 ); -PROVIDE ( UartRegReadProc = 0x40008a58 ); -PROVIDE ( UartRegWriteProc = 0x40008a14 ); -PROVIDE ( UartSetBaudProc = 0x40008aac ); -PROVIDE ( UartSpiAttachProc = 0x40008a6c ); -PROVIDE ( UartSpiReadProc = 0x40008a80 ); -PROVIDE ( VerifyFlashMd5Proc = 0x40008c44 ); -PROVIDE ( GetUartDevice = 0x40009598 ); -PROVIDE ( RcvMsg = 0x4000954c ); -PROVIDE ( SendMsg = 0x40009384 ); -PROVIDE ( UartGetCmdLn = 0x40009564 ); -PROVIDE ( UartRxString = 0x400092fc ); -PROVIDE ( Uart_Init = 0x40009120 ); -PROVIDE ( recv_packet = 0x40009424 ); -PROVIDE ( send_packet = 0x40009340 ); -PROVIDE ( uartAttach = 0x40008fd0 ); -PROVIDE ( uart_div_modify = 0x400090cc ); -PROVIDE ( uart_rx_intr_handler = 0x40008f4c ); -PROVIDE ( uart_rx_one_char = 0x400092d0 ); -PROVIDE ( uart_rx_one_char_block = 0x400092a4 ); -PROVIDE ( uart_rx_readbuff = 0x40009394 ); -PROVIDE ( uart_tx_flush = 0x40009258 ); -PROVIDE ( uart_tx_one_char = 0x40009200 ); -PROVIDE ( uart_tx_one_char2 = 0x4000922c ); -PROVIDE ( uart_tx_switch = 0x40009028 ); - - -/* -These functions are part of the ROM GPIO driver. We do not use them; the provided esp-idf functions -replace them and this way we can re-use the fixed RAM addresses these routines need. -*/ -/* <-- So you don't read over it: This comment disables the next lines. -PROVIDE ( gpio_init = 0x40009c20 ); -PROVIDE ( gpio_intr_ack = 0x40009dd4 ); -PROVIDE ( gpio_intr_ack_high = 0x40009e1c ); -PROVIDE ( gpio_intr_handler_register = 0x40009e6c ); -PROVIDE ( gpio_intr_pending = 0x40009cec ); -PROVIDE ( gpio_intr_pending_high = 0x40009cf8 ); -PROVIDE ( gpio_pending_mask = 0x3ffe0038 ); -PROVIDE ( gpio_pending_mask_high = 0x3ffe0044 ); -PROVIDE ( gpio_pin_intr_state_set = 0x40009d04 ); -PROVIDE ( gpio_pin_wakeup_disable = 0x40009eb0 ); -PROVIDE ( gpio_pin_wakeup_enable = 0x40009e7c ); -PROVIDE ( gpio_register_get = 0x40009cbc ); -PROVIDE ( gpio_register_set = 0x40009bbc ); -*/ -/* These are still part of that driver, but have been verified not to use static RAM, so they can be used. */ -PROVIDE ( gpio_output_set = 0x40009b24 ); -PROVIDE ( gpio_output_set_high = 0x40009b5c ); -PROVIDE ( gpio_input_get = 0x40009b88 ); -PROVIDE ( gpio_input_get_high = 0x40009b9c ); -PROVIDE ( gpio_matrix_in = 0x40009edc ); -PROVIDE ( gpio_matrix_out = 0x40009f0c ); -PROVIDE ( gpio_pad_select_gpio = 0x40009fdc ); -PROVIDE ( gpio_pad_set_drv = 0x4000a11c ); -PROVIDE ( gpio_pad_pulldown = 0x4000a348 ); -PROVIDE ( gpio_pad_pullup = 0x4000a22c ); -PROVIDE ( gpio_pad_hold = 0x4000a734 ); -PROVIDE ( gpio_pad_unhold = 0x4000a484 ); - -/* -These functions are part of the non-os kernel (etsc). -*/ -PROVIDE ( ets_aes_crypt = 0x4005c9b8 ); -PROVIDE ( ets_aes_disable = 0x4005c8f8 ); -PROVIDE ( ets_aes_enable = 0x4005c8cc ); -PROVIDE ( ets_aes_set_endian = 0x4005c928 ); -PROVIDE ( ets_aes_setkey_dec = 0x4005c994 ); -PROVIDE ( ets_aes_setkey_enc = 0x4005c97c ); -PROVIDE ( ets_bigint_disable = 0x4005c4e0 ); -PROVIDE ( ets_bigint_enable = 0x4005c498 ); -PROVIDE ( ets_bigint_mod_mult_getz = 0x4005c818 ); -PROVIDE ( ets_bigint_mod_mult_prepare = 0x4005c7b4 ); -PROVIDE ( ets_bigint_mod_power_getz = 0x4005c614 ); -PROVIDE ( ets_bigint_mod_power_prepare = 0x4005c54c ); -PROVIDE ( ets_bigint_montgomery_mult_getz = 0x4005c7a4 ); -PROVIDE ( ets_bigint_montgomery_mult_prepare = 0x4005c6fc ); -PROVIDE ( ets_bigint_mult_getz = 0x4005c6e8 ); -PROVIDE ( ets_bigint_mult_prepare = 0x4005c630 ); -PROVIDE ( ets_bigint_wait_finish = 0x4005c520 ); -PROVIDE ( ets_post = 0x4000673c ); -PROVIDE ( ets_run = 0x400066bc ); -PROVIDE ( ets_set_idle_cb = 0x40006674 ); -PROVIDE ( ets_task = 0x40006688 ); -PROVIDE ( ets_efuse_get_8M_clock = 0x40008710 ); -PROVIDE ( ets_efuse_get_spiconfig = 0x40008658 ); -PROVIDE ( ets_efuse_program_op = 0x40008628 ); -PROVIDE ( ets_efuse_read_op = 0x40008600 ); -PROVIDE ( ets_intr_lock = 0x400067b0 ); -PROVIDE ( ets_intr_unlock = 0x400067c4 ); -PROVIDE ( ets_isr_attach = 0x400067ec ); -PROVIDE ( ets_waiti0 = 0x400067d8 ); -PROVIDE ( intr_matrix_set = 0x4000681c ); -PROVIDE ( check_pos = 0x400068b8 ); -PROVIDE ( ets_set_appcpu_boot_addr = 0x4000689c ); -PROVIDE ( ets_set_startup_callback = 0x4000688c ); -PROVIDE ( ets_set_user_start = 0x4000687c ); -PROVIDE ( ets_unpack_flash_code = 0x40007018 ); -PROVIDE ( ets_unpack_flash_code_legacy = 0x4000694c ); -PROVIDE ( rom_main = 0x400076c4 ); -PROVIDE ( ets_write_char_uart = 0x40007cf8 ); -PROVIDE ( ets_install_putc1 = 0x40007d18 ); -PROVIDE ( ets_install_putc2 = 0x40007d38 ); -PROVIDE ( ets_install_uart_printf = 0x40007d28 ); -PROVIDE ( ets_printf = 0x40007d54 ); -PROVIDE ( rtc_boot_control = 0x4000821c ); -PROVIDE ( rtc_get_reset_reason = 0x400081d4 ); -PROVIDE ( rtc_get_wakeup_cause = 0x400081f4 ); -PROVIDE ( rtc_select_apb_bridge = 0x40008288 ); -PROVIDE ( set_rtc_memory_crc = 0x40008208 ); -PROVIDE ( software_reset = 0x4000824c ); -PROVIDE ( software_reset_cpu = 0x40008264 ); -PROVIDE ( ets_secure_boot_check = 0x4005cb40 ); -PROVIDE ( ets_secure_boot_check_finish = 0x4005cc04 ); -PROVIDE ( ets_secure_boot_check_start = 0x4005cbcc ); -PROVIDE ( ets_secure_boot_finish = 0x4005ca84 ); -PROVIDE ( ets_secure_boot_hash = 0x4005cad4 ); -PROVIDE ( ets_secure_boot_obtain = 0x4005cb14 ); -PROVIDE ( ets_secure_boot_rd_abstract = 0x4005cba8 ); -PROVIDE ( ets_secure_boot_rd_iv = 0x4005cb84 ); -PROVIDE ( ets_secure_boot_start = 0x4005ca34 ); -PROVIDE ( ets_sha_disable = 0x4005c0a8 ); -PROVIDE ( ets_sha_enable = 0x4005c07c ); -PROVIDE ( ets_sha_finish = 0x4005c104 ); -PROVIDE ( ets_sha_init = 0x4005c0d4 ); -PROVIDE ( ets_sha_update = 0x4005c2a0 ); -PROVIDE ( ets_delay_us = 0x40008534 ); -PROVIDE ( ets_get_cpu_frequency = 0x4000855c ); -PROVIDE ( ets_get_detected_xtal_freq = 0x40008588 ); -PROVIDE ( ets_get_xtal_scale = 0x4000856c ); -PROVIDE ( ets_update_cpu_frequency_rom = 0x40008550 ); /* Updates g_ticks_per_us on the current CPU only; not on the other core */ - -/* Following are static data, but can be used, not generated by script <<<<< btdm data */ -PROVIDE ( hci_tl_env = 0x3ffb8154 ); -PROVIDE ( ld_acl_env = 0x3ffb8258 ); -PROVIDE ( ea_env = 0x3ffb80ec ); -PROVIDE ( lc_sco_data_path_config = 0x3ffb81f8 ); -PROVIDE ( lc_sco_env = 0x3ffb81fc ); -PROVIDE ( ld_active_ch_map = 0x3ffb8334 ); -PROVIDE ( ld_bcst_acl_env = 0x3ffb8274 ); -PROVIDE ( ld_csb_rx_env = 0x3ffb8278 ); -PROVIDE ( ld_csb_tx_env = 0x3ffb827c ); -PROVIDE ( ld_env = 0x3ffb9510 ); -PROVIDE ( ld_fm_env = 0x3ffb8284 ); -PROVIDE ( ld_inq_env = 0x3ffb82e4 ); -PROVIDE ( ld_iscan_env = 0x3ffb82e8 ); -PROVIDE ( ld_page_env = 0x3ffb82f0 ); -PROVIDE ( ld_pca_env = 0x3ffb82f4 ); -PROVIDE ( ld_pscan_env = 0x3ffb8308 ); -PROVIDE ( ld_sched_env = 0x3ffb830c ); -PROVIDE ( ld_sched_params = 0x3ffb96c0 ); -PROVIDE ( ld_sco_env = 0x3ffb824c ); -PROVIDE ( ld_sscan_env = 0x3ffb832c ); -PROVIDE ( ld_strain_env = 0x3ffb8330 ); -PROVIDE ( LM_Sniff = 0x3ffb8230 ); -PROVIDE ( LM_SniffSubRate = 0x3ffb8214 ); -PROVIDE ( prbs_64bytes = 0x3ff98992 ); -PROVIDE ( nvds_env = 0x3ffb8364 ); -PROVIDE ( nvds_magic_number = 0x3ff9912a ); -PROVIDE ( TASK_DESC_LLD = 0x3ff98b58 ); -/* Above are static data, but can be used, not generated by script >>>>> btdm data */ - diff --git a/tools/sdk/ld/esp32.rom.libgcc.ld b/tools/sdk/ld/esp32.rom.libgcc.ld deleted file mode 100644 index 51448b33272..00000000000 --- a/tools/sdk/ld/esp32.rom.libgcc.ld +++ /dev/null @@ -1,91 +0,0 @@ -__absvdi2 = 0x4006387c; -__absvsi2 = 0x40063868; -__adddf3 = 0x40002590; -__addsf3 = 0x400020e8; -__addvdi3 = 0x40002cbc; -__addvsi3 = 0x40002c98; -__ashldi3 = 0x4000c818; -__ashrdi3 = 0x4000c830; -__bswapdi2 = 0x40064b08; -__bswapsi2 = 0x40064ae0; -__clrsbdi2 = 0x40064b7c; -__clrsbsi2 = 0x40064b64; -__clzdi2 = 0x4000ca50; -__clzsi2 = 0x4000c7e8; -__cmpdi2 = 0x40063820; -__ctzdi2 = 0x4000ca64; -__ctzsi2 = 0x4000c7f0; -__divdc3 = 0x400645a4; -__divdf3 = 0x40002954; -__divdi3 = 0x4000ca84; -__divsc3 = 0x4006429c; -__divsf3 = 0x4000234c; -__divsi3 = 0x4000c7b8; -__eqdf2 = 0x400636a8; -__eqsf2 = 0x40063374; -__extendsfdf2 = 0x40002c34; -__ffsdi2 = 0x4000ca2c; -__ffssi2 = 0x4000c804; -__fixdfdi = 0x40002ac4; -__fixdfsi = 0x40002a78; -__fixsfdi = 0x4000244c; -__fixsfsi = 0x4000240c; -__fixunsdfsi = 0x40002b30; -__fixunssfdi = 0x40002504; -__fixunssfsi = 0x400024ac; -__floatdidf = 0x4000c988; -__floatdisf = 0x4000c8c0; -__floatsidf = 0x4000c944; -__floatsisf = 0x4000c870; -__floatundidf = 0x4000c978; -__floatundisf = 0x4000c8b0; -__floatunsidf = 0x4000c938; -__floatunsisf = 0x4000c864; -__gedf2 = 0x40063768; -__gesf2 = 0x4006340c; -__gtdf2 = 0x400636dc; -__gtsf2 = 0x400633a0; -__ledf2 = 0x40063704; -__lesf2 = 0x400633c0; -__lshrdi3 = 0x4000c84c; -__ltdf2 = 0x40063790; -__ltsf2 = 0x4006342c; -__moddi3 = 0x4000cd4c; -__modsi3 = 0x4000c7c0; -__muldc3 = 0x40063c90; -__muldf3 = 0x4006358c; -__muldi3 = 0x4000c9fc; -__mulsc3 = 0x40063944; -__mulsf3 = 0x400632c8; -__mulsi3 = 0x4000c7b0; -__mulvdi3 = 0x40002d78; -__mulvsi3 = 0x40002d60; -__nedf2 = 0x400636a8; -__negdf2 = 0x400634a0; -__negdi2 = 0x4000ca14; -__negsf2 = 0x400020c0; -__negvdi2 = 0x40002e98; -__negvsi2 = 0x40002e78; -__nesf2 = 0x40063374; -__nsau_data = 0x3ff96544; -__paritysi2 = 0x40002f3c; -__popcount_tab = 0x3ff96544; -__popcountdi2 = 0x40002ef8; -__popcountsi2 = 0x40002ed0; -__powidf2 = 0x400638e4; -__powisf2 = 0x4006389c; -__subdf3 = 0x400026e4; -__subsf3 = 0x400021d0; -__subvdi3 = 0x40002d20; -__subvsi3 = 0x40002cf8; -__truncdfsf2 = 0x40002b90; -__ucmpdi2 = 0x40063840; -__udiv_w_sdiv = 0x40064bec; -__udivdi3 = 0x4000cff8; -__udivmoddi4 = 0x40064bf4; -__udivsi3 = 0x4000c7c8; -__umoddi3 = 0x4000d280; -__umodsi3 = 0x4000c7d0; -__umulsidi3 = 0x4000c7d8; -__unorddf2 = 0x400637f4; -__unordsf2 = 0x40063478; diff --git a/tools/sdk/ld/esp32.rom.nanofmt.ld b/tools/sdk/ld/esp32.rom.nanofmt.ld deleted file mode 100644 index ae843dff2fb..00000000000 --- a/tools/sdk/ld/esp32.rom.nanofmt.ld +++ /dev/null @@ -1,100 +0,0 @@ -/* - Address table for printf/scanf family of functions in ESP32 ROM. - These functions are compiled with newlib "nano" format option. - As such, they don's support 64-bit integer formats. - Floating point formats are supported by setting _printf_float and - _scanf_float entries in syscall table. This is done automatically - by startup code. - - Generated for ROM with MD5sum: - ab8282ae908fe9e7a63fb2a4ac2df013 eagle.pro.rom.out -*/ - -PROVIDE ( asiprintf = 0x40056d9c ); -PROVIDE ( _asiprintf_r = 0x40056d4c ); -PROVIDE ( asniprintf = 0x40056cd8 ); -PROVIDE ( _asniprintf_r = 0x40056c64 ); -PROVIDE ( asnprintf = 0x40056cd8 ); -PROVIDE ( _asnprintf_r = 0x40056c64 ); -PROVIDE ( asprintf = 0x40056d9c ); -PROVIDE ( _asprintf_r = 0x40056d4c ); -PROVIDE ( fiprintf = 0x40056efc ); -PROVIDE ( _fiprintf_r = 0x40056ed8 ); -PROVIDE ( fiscanf = 0x40058884 ); -PROVIDE ( _fiscanf_r = 0x400588b4 ); -PROVIDE ( fprintf = 0x40056efc ); -PROVIDE ( _fprintf_r = 0x40056ed8 ); -PROVIDE ( iprintf = 0x40056978 ); -PROVIDE ( _iprintf_r = 0x40056944 ); -PROVIDE ( printf = 0x40056978 ); -PROVIDE ( _printf_common = 0x40057338 ); -PROVIDE ( _printf_float = 0x4000befc ); -PROVIDE ( _printf_i = 0x40057404 ); -PROVIDE ( _printf_r = 0x40056944 ); -PROVIDE ( siprintf = 0x40056c08 ); -PROVIDE ( _siprintf_r = 0x40056bbc ); -PROVIDE ( sniprintf = 0x40056b4c ); -PROVIDE ( _sniprintf_r = 0x40056ae4 ); -PROVIDE ( snprintf = 0x40056b4c ); -PROVIDE ( _snprintf_r = 0x40056ae4 ); -PROVIDE ( sprintf = 0x40056c08 ); -PROVIDE ( _sprintf_r = 0x40056bbc ); -PROVIDE ( __sprint_r = 0x400577e4 ); -PROVIDE ( _svfiprintf_r = 0x40057100 ); -PROVIDE ( __svfiscanf_r = 0x40057b08 ); -PROVIDE ( _svfprintf_r = 0x40057100 ); -PROVIDE ( __svfscanf = 0x40057f04 ); -PROVIDE ( __svfscanf_r = 0x40057b08 ); -PROVIDE ( vasiprintf = 0x40056eb8 ); -PROVIDE ( _vasiprintf_r = 0x40056e80 ); -PROVIDE ( vasniprintf = 0x40056e58 ); -PROVIDE ( _vasniprintf_r = 0x40056df8 ); -PROVIDE ( vasnprintf = 0x40056e58 ); -PROVIDE ( _vasnprintf_r = 0x40056df8 ); -PROVIDE ( vasprintf = 0x40056eb8 ); -PROVIDE ( _vasprintf_r = 0x40056e80 ); -PROVIDE ( vfiprintf = 0x40057ae8 ); -PROVIDE ( _vfiprintf_r = 0x40057850 ); -PROVIDE ( vfiscanf = 0x40057eb8 ); -PROVIDE ( _vfiscanf_r = 0x40057f24 ); -PROVIDE ( vfprintf = 0x40057ae8 ); -PROVIDE ( _vfprintf_r = 0x40057850 ); -PROVIDE ( vfscanf = 0x40057eb8 ); -PROVIDE ( _vfscanf_r = 0x40057f24 ); -PROVIDE ( viprintf = 0x400569b4 ); -PROVIDE ( _viprintf_r = 0x400569e4 ); -PROVIDE ( viscanf = 0x40058698 ); -PROVIDE ( _viscanf_r = 0x400586c8 ); -PROVIDE ( vprintf = 0x400569b4 ); -PROVIDE ( _vprintf_r = 0x400569e4 ); -PROVIDE ( vscanf = 0x40058698 ); -PROVIDE ( _vscanf_r = 0x400586c8 ); -PROVIDE ( vsiprintf = 0x40056ac4 ); -PROVIDE ( _vsiprintf_r = 0x40056a90 ); -PROVIDE ( vsiscanf = 0x40058740 ); -PROVIDE ( _vsiscanf_r = 0x400586f8 ); -PROVIDE ( vsniprintf = 0x40056a68 ); -PROVIDE ( _vsniprintf_r = 0x40056a14 ); -PROVIDE ( vsnprintf = 0x40056a68 ); -PROVIDE ( _vsnprintf_r = 0x40056a14 ); -PROVIDE ( vsprintf = 0x40056ac4 ); -PROVIDE ( _vsprintf_r = 0x40056a90 ); -PROVIDE ( vsscanf = 0x40058740 ); -PROVIDE ( _vsscanf_r = 0x400586f8 ); -PROVIDE ( fscanf = 0x40058884 ); -PROVIDE ( _fscanf_r = 0x400588b4 ); -PROVIDE ( iscanf = 0x40058760 ); -PROVIDE ( _iscanf_r = 0x4005879c ); -PROVIDE ( scanf = 0x40058760 ); -PROVIDE ( _scanf_chars = 0x40058384 ); -PROVIDE ( _scanf_float = 0x4000bf18 ); -PROVIDE ( _scanf_i = 0x4005845c ); -PROVIDE ( _scanf_r = 0x4005879c ); -PROVIDE ( siscanf = 0x400587d0 ); -PROVIDE ( _siscanf_r = 0x40058830 ); -PROVIDE ( sscanf = 0x400587d0 ); -PROVIDE ( _sscanf_r = 0x40058830 ); -PROVIDE ( __ssvfiscanf_r = 0x4005802c ); -PROVIDE ( __ssvfscanf_r = 0x4005802c ); - - diff --git a/tools/sdk/ld/esp32.rom.redefined.ld b/tools/sdk/ld/esp32.rom.redefined.ld deleted file mode 100644 index c229640a20e..00000000000 --- a/tools/sdk/ld/esp32.rom.redefined.ld +++ /dev/null @@ -1,60 +0,0 @@ -/* - ROM Functions defined in this file are not used in ESP-IDF as is, - and different definitions for functions with the same names are provided. - This file is not used when linking ESP-IDF and is intended for reference only -*/ - -PROVIDE ( abort = 0x4000bba4 ); -PROVIDE ( aes_128_cbc_decrypt = 0x4005cc7c ); -PROVIDE ( aes_128_cbc_encrypt = 0x4005cc18 ); -PROVIDE ( aes_unwrap = 0x4005ccf0 ); -PROVIDE ( base64_decode = 0x4005ced8 ); -PROVIDE ( base64_encode = 0x4005cdbc ); -PROVIDE ( ets_isr_mask = 0x400067fc ); -PROVIDE ( ets_isr_unmask = 0x40006808 ); -PROVIDE ( ets_timer_arm = 0x40008368 ); -PROVIDE ( ets_timer_arm_us = 0x400083ac ); -PROVIDE ( ets_timer_disarm = 0x400083ec ); -PROVIDE ( ets_timer_done = 0x40008428 ); -PROVIDE ( ets_timer_init = 0x400084e8 ); -PROVIDE ( ets_timer_handler_isr = 0x40008454 ); -PROVIDE ( ets_timer_setfn = 0x40008350 ); -PROVIDE ( _free_r = 0x4000bbcc ); -PROVIDE ( _getpid_r = 0x4000bcfc ); -PROVIDE ( __getreent = 0x4000be8c ); -PROVIDE ( _gettimeofday_r = 0x4000bc58 ); -PROVIDE ( hmac_md5 = 0x4005d264 ); -PROVIDE ( hmac_md5_vector = 0x4005d17c ); -PROVIDE ( hmac_sha1 = 0x40060acc ); -PROVIDE ( hmac_sha1_vector = 0x400609e4 ); -PROVIDE ( hmac_sha256 = 0x40060d58 ); -PROVIDE ( hmac_sha256_vector = 0x40060c84 ); -PROVIDE ( _kill_r = 0x4000bd10 ); -PROVIDE ( _lock_acquire = 0x4000be14 ); -PROVIDE ( _lock_acquire_recursive = 0x4000be28 ); -PROVIDE ( _lock_close = 0x4000bdec ); -PROVIDE ( _lock_close_recursive = 0x4000be00 ); -PROVIDE ( _lock_init = 0x4000bdc4 ); -PROVIDE ( _lock_init_recursive = 0x4000bdd8 ); -PROVIDE ( _lock_release = 0x4000be64 ); -PROVIDE ( _lock_release_recursive = 0x4000be78 ); -PROVIDE ( _lock_try_acquire = 0x4000be3c ); -PROVIDE ( _lock_try_acquire_recursive = 0x4000be50 ); -PROVIDE ( _malloc_r = 0x4000bbb4 ); -PROVIDE ( MD5Final = 0x4005db1c ); -PROVIDE ( MD5Init = 0x4005da7c ); -PROVIDE ( MD5Update = 0x4005da9c ); -PROVIDE ( md5_vector = 0x4005db80 ); -PROVIDE ( pbkdf2_sha1 = 0x40060ba4 ); -PROVIDE ( rc4_skip = 0x40060928 ); -PROVIDE ( _raise_r = 0x4000bc70 ); -PROVIDE ( _realloc_r = 0x4000bbe0 ); -PROVIDE ( _sbrk_r = 0x4000bce4 ); -PROVIDE ( sha1_prf = 0x40060ae8 ); -PROVIDE ( sha1_vector = 0x40060b64 ); -PROVIDE ( sha256_prf = 0x40060d70 ); -PROVIDE ( sha256_vector = 0x40060e08 ); -PROVIDE ( _system_r = 0x4000bc10 ); -PROVIDE ( _times_r = 0x4000bc40 ); -PROVIDE ( uart_tx_wait_idle = 0x40009278 ); - diff --git a/tools/sdk/ld/esp32.rom.spiflash.ld b/tools/sdk/ld/esp32.rom.spiflash.ld deleted file mode 100644 index 709b3581144..00000000000 --- a/tools/sdk/ld/esp32.rom.spiflash.ld +++ /dev/null @@ -1,23 +0,0 @@ -/* - Address table for SPI driver functions in ESP32 ROM. - These functions are only linked from ROM when SPI_FLASH_ROM_DRIVER_PATCH is not set in configuration. -*/ - -PROVIDE ( esp_rom_spiflash_write_encrypted = 0x40062e78 ); -PROVIDE ( esp_rom_spiflash_erase_area = 0x400631ac ); -PROVIDE ( esp_rom_spiflash_erase_block = 0x40062c4c ); -PROVIDE ( esp_rom_spiflash_erase_chip = 0x40062c14 ); -PROVIDE ( esp_rom_spiflash_erase_sector = 0x40062ccc ); -PROVIDE ( esp_rom_spiflash_lock = 0x400628f0 ); -PROVIDE ( esp_rom_spiflash_read = 0x40062ed8 ); -PROVIDE ( esp_rom_spiflash_config_readmode = 0x40062b64 ); /* SPIMasterReadModeCnfig */ -PROVIDE ( esp_rom_spiflash_read_status = 0x4006226c ); -PROVIDE ( esp_rom_spiflash_read_statushigh = 0x40062448 ); -PROVIDE ( esp_rom_spiflash_write = 0x40062d50 ); -PROVIDE ( esp_rom_spiflash_enable_write = 0x40062320 ); -PROVIDE ( esp_rom_spiflash_write_status = 0x400622f0 ); - -/* always using patched versions of these functions -PROVIDE ( esp_rom_spiflash_wait_idle = 0x400622c0 ); -PROVIDE ( esp_rom_spiflash_unlock = 0x400????? ); -*/ diff --git a/tools/sdk/ld/esp32.rom.spiram_incompatible_fns.ld b/tools/sdk/ld/esp32.rom.spiram_incompatible_fns.ld deleted file mode 100644 index 17a38d35573..00000000000 --- a/tools/sdk/ld/esp32.rom.spiram_incompatible_fns.ld +++ /dev/null @@ -1,163 +0,0 @@ -/* - If the spiram compiler workaround is active, these functions from ROM cannot be used. If the workaround is not - active (e.g. because the system does not use SPI RAM) then these functions are okay to use. -*/ -PROVIDE ( abs = 0x40056340 ); -PROVIDE ( __ascii_wctomb = 0x40058ef0 ); -PROVIDE ( asctime = 0x40059588 ); -PROVIDE ( asctime_r = 0x40000ec8 ); -PROVIDE ( atoi = 0x400566c4 ); -PROVIDE ( _atoi_r = 0x400566d4 ); -PROVIDE ( atol = 0x400566ec ); -PROVIDE ( _atol_r = 0x400566fc ); -PROVIDE ( bzero = 0x4000c1f4 ); -PROVIDE ( _cleanup = 0x40001df8 ); -PROVIDE ( _cleanup_r = 0x40001d48 ); -PROVIDE ( close = 0x40001778 ); -PROVIDE ( creat = 0x40000e8c ); -PROVIDE ( ctime = 0x400595b0 ); -PROVIDE ( ctime_r = 0x400595c4 ); -PROVIDE ( div = 0x40056348 ); -PROVIDE ( __dummy_lock = 0x4000c728 ); -PROVIDE ( __dummy_lock_try = 0x4000c730 ); -PROVIDE ( __env_lock = 0x40001fd4 ); -PROVIDE ( __env_unlock = 0x40001fe0 ); -PROVIDE ( fclose = 0x400020ac ); -PROVIDE ( _fclose_r = 0x40001fec ); -PROVIDE ( fflush = 0x40059394 ); -PROVIDE ( _fflush_r = 0x40059320 ); -PROVIDE ( _findenv_r = 0x40001f44 ); -PROVIDE ( __fp_lock_all = 0x40001f1c ); -PROVIDE ( __fp_unlock_all = 0x40001f30 ); -PROVIDE ( fputwc = 0x40058ea8 ); -PROVIDE ( __fputwc = 0x40058da0 ); -PROVIDE ( _fputwc_r = 0x40058e4c ); -PROVIDE ( _fwalk = 0x4000c738 ); -PROVIDE ( _fwalk_reent = 0x4000c770 ); -PROVIDE ( __get_current_time_locale = 0x40001834 ); -PROVIDE ( _getenv_r = 0x40001fbc ); -PROVIDE ( __gettzinfo = 0x40001fcc ); -PROVIDE ( gmtime = 0x40059848 ); -PROVIDE ( gmtime_r = 0x40059868 ); -PROVIDE ( isalnum = 0x40000f04 ); -PROVIDE ( isalpha = 0x40000f18 ); -PROVIDE ( isascii = 0x4000c20c ); -PROVIDE ( _isatty_r = 0x40000ea0 ); -PROVIDE ( isblank = 0x40000f2c ); -PROVIDE ( iscntrl = 0x40000f50 ); -PROVIDE ( isdigit = 0x40000f64 ); -PROVIDE ( isgraph = 0x40000f94 ); -PROVIDE ( islower = 0x40000f78 ); -PROVIDE ( isprint = 0x40000fa8 ); -PROVIDE ( ispunct = 0x40000fc0 ); -PROVIDE ( isspace = 0x40000fd4 ); -PROVIDE ( isupper = 0x40000fe8 ); -PROVIDE ( itoa = 0x400566b4 ); -PROVIDE ( __itoa = 0x40056678 ); -PROVIDE ( labs = 0x40056370 ); -PROVIDE ( ldiv = 0x40056378 ); -PROVIDE ( __locale_charset = 0x40059540 ); -PROVIDE ( __locale_cjk_lang = 0x40059558 ); -PROVIDE ( localeconv = 0x4005957c ); -PROVIDE ( _localeconv_r = 0x40059560 ); -PROVIDE ( __locale_mb_cur_max = 0x40059548 ); -PROVIDE ( __locale_msgcharset = 0x40059550 ); -PROVIDE ( localtime = 0x400595dc ); -PROVIDE ( localtime_r = 0x400595fc ); -PROVIDE ( longjmp = 0x400562cc ); -PROVIDE ( memccpy = 0x4000c220 ); -PROVIDE ( memchr = 0x4000c244 ); -PROVIDE ( memcmp = 0x4000c260 ); -PROVIDE ( memcpy = 0x4000c2c8 ); -PROVIDE ( memmove = 0x4000c3c0 ); -PROVIDE ( memrchr = 0x4000c400 ); -PROVIDE ( memset = 0x4000c44c ); -PROVIDE ( mktime = 0x4005a5e8 ); -PROVIDE ( open = 0x4000178c ); -PROVIDE ( qsort = 0x40056424 ); -PROVIDE ( rand = 0x40001058 ); -PROVIDE ( rand_r = 0x400010d4 ); -PROVIDE ( read = 0x400017dc ); -PROVIDE ( sbrk = 0x400017f4 ); -PROVIDE ( __sccl = 0x4000c498 ); -PROVIDE ( __sclose = 0x400011b8 ); -PROVIDE ( __seofread = 0x40001148 ); -PROVIDE ( setjmp = 0x40056268 ); -PROVIDE ( setlocale = 0x40059568 ); -PROVIDE ( _setlocale_r = 0x4005950c ); -PROVIDE ( __sflush_r = 0x400591e0 ); -PROVIDE ( __sfmoreglue = 0x40001dc8 ); -PROVIDE ( __sfp = 0x40001e90 ); -PROVIDE ( __sfp_lock_acquire = 0x40001e08 ); -PROVIDE ( __sfp_lock_release = 0x40001e14 ); -PROVIDE ( __sfputs_r = 0x40057790 ); -PROVIDE ( __sfvwrite_r = 0x4005893c ); -PROVIDE ( __sinit = 0x40001e38 ); -PROVIDE ( __sinit_lock_acquire = 0x40001e20 ); -PROVIDE ( __sinit_lock_release = 0x40001e2c ); -PROVIDE ( __smakebuf_r = 0x40059108 ); -PROVIDE ( srand = 0x40001004 ); -PROVIDE ( __sread = 0x40001118 ); -PROVIDE ( __srefill_r = 0x400593d4 ); -PROVIDE ( __sseek = 0x40001184 ); -PROVIDE ( __ssprint_r = 0x40056ff8 ); -PROVIDE ( __ssputs_r = 0x40056f2c ); -PROVIDE ( __ssrefill_r = 0x40057fec ); -PROVIDE ( strcasecmp = 0x400011cc ); -PROVIDE ( strcasestr = 0x40001210 ); -PROVIDE ( strcat = 0x4000c518 ); -PROVIDE ( strchr = 0x4000c53c ); -PROVIDE ( strcmp = 0x40001274 ); -PROVIDE ( strcoll = 0x40001398 ); -PROVIDE ( strcpy = 0x400013ac ); -PROVIDE ( strcspn = 0x4000c558 ); -PROVIDE ( strdup = 0x4000143c ); -PROVIDE ( _strdup_r = 0x40001450 ); -PROVIDE ( strftime = 0x40059ab4 ); -PROVIDE ( strlcat = 0x40001470 ); -PROVIDE ( strlcpy = 0x4000c584 ); -PROVIDE ( strlen = 0x400014c0 ); -PROVIDE ( strlwr = 0x40001524 ); -PROVIDE ( strncasecmp = 0x40001550 ); -PROVIDE ( strncat = 0x4000c5c4 ); -PROVIDE ( strncmp = 0x4000c5f4 ); -PROVIDE ( strncpy = 0x400015d4 ); -PROVIDE ( strndup = 0x400016b0 ); -PROVIDE ( _strndup_r = 0x400016c4 ); -PROVIDE ( strnlen = 0x4000c628 ); -PROVIDE ( strrchr = 0x40001708 ); -PROVIDE ( strsep = 0x40001734 ); -PROVIDE ( strspn = 0x4000c648 ); -PROVIDE ( strstr = 0x4000c674 ); -PROVIDE ( __strtok_r = 0x4000c6a8 ); -PROVIDE ( strtok_r = 0x4000c70c ); -PROVIDE ( strtol = 0x4005681c ); -PROVIDE ( _strtol_r = 0x40056714 ); -PROVIDE ( strtoul = 0x4005692c ); -PROVIDE ( _strtoul_r = 0x40056834 ); -PROVIDE ( strupr = 0x4000174c ); -PROVIDE ( __submore = 0x40058f3c ); -PROVIDE ( _sungetc_r = 0x40057f6c ); -PROVIDE ( __swbuf = 0x40058cb4 ); -PROVIDE ( __swbuf_r = 0x40058bec ); -PROVIDE ( __swrite = 0x40001150 ); -PROVIDE ( __swsetup_r = 0x40058cc8 ); -PROVIDE ( time = 0x40001844 ); -PROVIDE ( __time_load_locale = 0x4000183c ); -PROVIDE ( times = 0x40001808 ); -PROVIDE ( toascii = 0x4000c720 ); -PROVIDE ( tolower = 0x40001868 ); -PROVIDE ( toupper = 0x40001884 ); -PROVIDE ( __tzcalc_limits = 0x400018a0 ); -PROVIDE ( __tz_lock = 0x40001a04 ); -PROVIDE ( tzset = 0x40001a1c ); -PROVIDE ( _tzset_r = 0x40001a28 ); -PROVIDE ( __tz_unlock = 0x40001a10 ); -PROVIDE ( ungetc = 0x400590f4 ); -PROVIDE ( _ungetc_r = 0x40058fa0 ); -PROVIDE ( utoa = 0x40056258 ); -PROVIDE ( __utoa = 0x400561f0 ); -PROVIDE ( wcrtomb = 0x40058920 ); -PROVIDE ( _wcrtomb_r = 0x400588d8 ); -PROVIDE ( _wctomb_r = 0x40058f14 ); -PROVIDE ( write = 0x4000181c ); diff --git a/tools/sdk/ld/esp32.spiram.rom-functions-dram.ld b/tools/sdk/ld/esp32.spiram.rom-functions-dram.ld deleted file mode 100644 index 205d9471f82..00000000000 --- a/tools/sdk/ld/esp32.spiram.rom-functions-dram.ld +++ /dev/null @@ -1,143 +0,0 @@ -/* - If the Newlib functions in ROM aren't used (eg because the external SPI RAM workaround is active), these functions will - be linked into the application directly instead. Normally, they would end up in flash, which is undesirable because esp-idf - and/or applications may assume that because these functions normally are in ROM, they are accessible even when flash is - inaccessible. To work around this, this ld fragment places these functions in RAM instead. If the ROM functions are used, - these defines do nothing, so they can still be included in that situation. - - This file is responsible for placing the rodata segment in DRAM. -*/ - - *libc-psram-workaround.a:*lib_a-utoa.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-longjmp.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-setjmp.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-abs.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-div.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-labs.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-ldiv.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-quorem.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-qsort.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-utoa.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-itoa.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-atoi.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-atol.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strtol.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strtoul.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-wcrtomb.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-fvwrite.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-wbuf.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-wsetup.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-fputwc.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-wctomb_r.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-ungetc.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-makebuf.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-fflush.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-refill.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-s_fpclassify.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-locale.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-asctime.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-ctime.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-ctime_r.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-lcltime.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-lcltime_r.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-gmtime.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-gmtime_r.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strftime.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-mktime.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-syswrite.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-tzset_r.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-tzset.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-toupper.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-tolower.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-toascii.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-systimes.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-time.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-bsd_qsort_r.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-qsort_r.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-gettzinfo.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strupr.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-asctime_r.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-bzero.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-close.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-creat.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-environ.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-fclose.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-isalnum.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-isalpha.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-isascii.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-isblank.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-iscntrl.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-isdigit.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-isgraph.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-islower.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-isprint.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-ispunct.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-isspace.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-isupper.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-memccpy.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-memchr.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-memcmp.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-memcpy.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-memmove.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-memrchr.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-memset.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-open.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-rand.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-rand_r.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-read.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-rshift.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-sbrk.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-srand.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strcasecmp.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strcasestr.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strcat.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strchr.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strcmp.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strcoll.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strcpy.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strcspn.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strdup.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strlcat.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strlcpy.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strlen.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strlwr.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strncasecmp.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strncat.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strncmp.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strncpy.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strndup.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strnlen.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strrchr.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strsep.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strspn.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strstr.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strtok_r.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strupr.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-stdio.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-syssbrk.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-sysclose.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-sysopen.o(.rodata .rodata.*) - *libc-psram-workaround.a:*creat.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-sysread.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-syswrite.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-impure.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-tzvars.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-sf_nan.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-tzcalc_limits.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-month_lengths.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-timelocal.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-findfp.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lock.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-getenv_r.o(.rodata .rodata.*) - *libc-psram-workaround.a:*isatty.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-fwalk.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-getenv_r.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-tzlock.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-ctype_.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-sccl.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strptime.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-envlock.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-raise.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strdup_r.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-system.o(.rodata .rodata.*) - *libc-psram-workaround.a:*lib_a-strndup_r.o(.rodata .rodata.*) diff --git a/tools/sdk/ld/esp32.spiram.rom-functions-iram.ld b/tools/sdk/ld/esp32.spiram.rom-functions-iram.ld deleted file mode 100644 index d3a264da194..00000000000 --- a/tools/sdk/ld/esp32.spiram.rom-functions-iram.ld +++ /dev/null @@ -1,140 +0,0 @@ -/* - If the Newlib functions in ROM aren't used (eg because the external SPI RAM workaround is active), these functions will - be linked into the application directly instead. Normally, they would end up in flash, which is undesirable because esp-idf - and/or applications may assume that because these functions normally are in ROM, they are accessible even when flash is - inaccessible. To work around this, this ld fragment places these functions in RAM instead. If the ROM functions are used, - these defines do nothing, so they can still be included in that situation. - - This file is responsible for placing the literal and text segments in IRAM. -*/ - - - *libc-psram-workaround.a:*lib_a-utoa.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-longjmp.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-setjmp.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-abs.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-div.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-labs.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-ldiv.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-quorem.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-utoa.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-itoa.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-atoi.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-atol.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strtol.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strtoul.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-wcrtomb.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-fvwrite.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-wbuf.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-wsetup.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-fputwc.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-wctomb_r.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-ungetc.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-makebuf.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-fflush.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-refill.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-s_fpclassify.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-asctime.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-ctime.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-ctime_r.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-lcltime.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-lcltime_r.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-gmtime.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-gmtime_r.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strftime.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-mktime.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-syswrite.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-tzset_r.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-tzset.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-toupper.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-tolower.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-toascii.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-systimes.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-time.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-gettzinfo.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strupr.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-asctime_r.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-bzero.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-close.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-creat.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-environ.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-fclose.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-isalnum.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-isalpha.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-isascii.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-isblank.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-iscntrl.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-isdigit.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-isgraph.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-islower.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-isprint.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-ispunct.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-isspace.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-isupper.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-memccpy.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-memchr.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-memcmp.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-memcpy.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-memmove.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-memrchr.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-memset.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-open.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-rand.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-rand_r.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-read.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-rshift.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-sbrk.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-srand.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strcasecmp.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strcasestr.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strcat.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strchr.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strcmp.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strcoll.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strcpy.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strcspn.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strdup.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strlcat.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strlcpy.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strlen.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strlwr.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strncasecmp.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strncat.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strncmp.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strncpy.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strndup.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strnlen.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strrchr.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strsep.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strspn.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strstr.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strtok_r.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strupr.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-stdio.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-syssbrk.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-sysclose.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-sysopen.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*creat.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-sysread.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-syswrite.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-impure.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-tzvars.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-sf_nan.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-tzcalc_limits.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-month_lengths.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-timelocal.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-findfp.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lock.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-getenv_r.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*isatty.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-fwalk.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-getenv_r.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-tzlock.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-ctype_.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-sccl.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strptime.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-envlock.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-raise.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strdup_r.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-system.o(.literal .text .literal.* .text.*) - *libc-psram-workaround.a:*lib_a-strndup_r.o(.literal .text .literal.* .text.*) diff --git a/tools/sdk/ld/esp32_out.ld b/tools/sdk/ld/esp32_out.ld deleted file mode 100644 index c644ae712a1..00000000000 --- a/tools/sdk/ld/esp32_out.ld +++ /dev/null @@ -1,74 +0,0 @@ -/* ESP32 Linker Script Memory Layout - - This file describes the memory layout (memory blocks) as virtual - memory addresses. - - esp32.common.ld contains output sections to link compiler output - into these memory blocks. - - *** - - This linker script is passed through the C preprocessor to include - configuration options. - - Please use preprocessor features sparingly! Restrict - to simple macros with numeric values, and/or #if/#endif blocks. -*/ -/* - * - * Automatically generated file; DO NOT EDIT. - * Espressif IoT Development Framework Configuration - * - */ -/* If BT is not built at all */ -MEMORY -{ - /* All these values assume the flash cache is on, and have the blocks this uses subtracted from the length - of the various regions. The 'data access port' dram/drom regions map to the same iram/irom regions but - are connected to the data port of the CPU and eg allow bytewise access. */ - /* IRAM for PRO cpu. Not sure if happy with this, this is MMU area... */ - iram0_0_seg (RX) : org = 0x40080000, len = 0x20000 - /* Even though the segment name is iram, it is actually mapped to flash - */ - iram0_2_seg (RX) : org = 0x400D0018, len = 0x330000-0x18 - /* - (0x18 offset above is a convenience for the app binary image generation. Flash cache has 64KB pages. The .bin file - which is flashed to the chip has a 0x18 byte file header. Setting this offset makes it simple to meet the flash - cache MMU's constraint that (paddr % 64KB == vaddr % 64KB).) - */ - /* Shared data RAM, excluding memory reserved for ROM bss/data/stack. - - Enabling Bluetooth & Trace Memory features in menuconfig will decrease - the amount of RAM available. - - Note: Length of this section *should* be 0x50000, and this extra DRAM is available - in heap at runtime. However due to static ROM memory usage at this 176KB mark, the - additional static memory temporarily cannot be used. - */ - dram0_0_seg (RW) : org = 0x3FFB0000 + 0xdb5c, - len = 0x2c200 - 0xdb5c - /* Flash mapped constant data */ - drom0_0_seg (R) : org = 0x3F400018, len = 0x400000-0x18 - /* (See iram0_2_seg for meaning of 0x18 offset in the above.) */ - /* RTC fast memory (executable). Persists over deep sleep. - */ - rtc_iram_seg(RWX) : org = 0x400C0000, len = 0x2000 - /* RTC fast memory (same block as above), viewed from data bus */ - rtc_data_seg(RW) : org = 0x3ff80000, len = 0x2000 - /* RTC slow memory (data accessible). Persists over deep sleep. - - Start of RTC slow memory is reserved for ULP co-processor code + data, if enabled. - */ - rtc_slow_seg(RW) : org = 0x50000000 + 512, - len = 0x1000 - 512 - /* external memory ,including data and text */ - extern_ram_seg(RWX) : org = 0x3F800000, - len = 0x400000 -} -/* Heap ends at top of dram0_0_seg */ -_heap_end = 0x40000000 - 0x0; -_data_seg_org = ORIGIN(rtc_data_seg); -/* The lines below define location alias for .rtc.data section based on Kconfig option. - When the option is not defined then use slow memory segment - else the data will be placed in fast memory segment */ -REGION_ALIAS("rtc_data_location", rtc_slow_seg ); diff --git a/tools/sdk/ld/wifi_iram.ld b/tools/sdk/ld/wifi_iram.ld deleted file mode 100644 index f8cd6dbebf1..00000000000 --- a/tools/sdk/ld/wifi_iram.ld +++ /dev/null @@ -1,4 +0,0 @@ -/* Link WiFi library .wifi0iram sections to IRAM - if this snippet is included */ -*libnet80211.a:( .wifi0iram .wifi0iram.*) -*libpp.a:( .wifi0iram .wifi0iram.*) diff --git a/tools/sdk/lib/libapp_trace.a b/tools/sdk/lib/libapp_trace.a deleted file mode 100644 index 4857b5afedf..00000000000 Binary files a/tools/sdk/lib/libapp_trace.a and /dev/null differ diff --git a/tools/sdk/lib/libapp_update.a b/tools/sdk/lib/libapp_update.a deleted file mode 100644 index 9ead7d8c63c..00000000000 Binary files a/tools/sdk/lib/libapp_update.a and /dev/null differ diff --git a/tools/sdk/lib/libasio.a b/tools/sdk/lib/libasio.a deleted file mode 100644 index 857fbae184a..00000000000 Binary files a/tools/sdk/lib/libasio.a and /dev/null differ diff --git a/tools/sdk/lib/libbootloader_support.a b/tools/sdk/lib/libbootloader_support.a deleted file mode 100644 index 465f3e83efc..00000000000 Binary files a/tools/sdk/lib/libbootloader_support.a and /dev/null differ diff --git a/tools/sdk/lib/libbt.a b/tools/sdk/lib/libbt.a deleted file mode 100644 index 4f0ffdefc7e..00000000000 Binary files a/tools/sdk/lib/libbt.a and /dev/null differ diff --git a/tools/sdk/lib/libbtdm_app.a b/tools/sdk/lib/libbtdm_app.a deleted file mode 100644 index b4d1fcfbe67..00000000000 Binary files a/tools/sdk/lib/libbtdm_app.a and /dev/null differ diff --git a/tools/sdk/lib/libc.a b/tools/sdk/lib/libc.a deleted file mode 100644 index 01c513a03a5..00000000000 Binary files a/tools/sdk/lib/libc.a and /dev/null differ diff --git a/tools/sdk/lib/libc_nano.a b/tools/sdk/lib/libc_nano.a deleted file mode 100644 index f70de941790..00000000000 Binary files a/tools/sdk/lib/libc_nano.a and /dev/null differ diff --git a/tools/sdk/lib/libcoap.a b/tools/sdk/lib/libcoap.a deleted file mode 100644 index 854b45b8587..00000000000 Binary files a/tools/sdk/lib/libcoap.a and /dev/null differ diff --git a/tools/sdk/lib/libcoexist.a b/tools/sdk/lib/libcoexist.a deleted file mode 100644 index 87f22e299ce..00000000000 Binary files a/tools/sdk/lib/libcoexist.a and /dev/null differ diff --git a/tools/sdk/lib/libconsole.a b/tools/sdk/lib/libconsole.a deleted file mode 100644 index cb2986480ea..00000000000 Binary files a/tools/sdk/lib/libconsole.a and /dev/null differ diff --git a/tools/sdk/lib/libcore.a b/tools/sdk/lib/libcore.a deleted file mode 100644 index 7e5ece4ae0a..00000000000 Binary files a/tools/sdk/lib/libcore.a and /dev/null differ diff --git a/tools/sdk/lib/libcxx.a b/tools/sdk/lib/libcxx.a deleted file mode 100644 index 1389afedb3e..00000000000 Binary files a/tools/sdk/lib/libcxx.a and /dev/null differ diff --git a/tools/sdk/lib/libdl_lib.a b/tools/sdk/lib/libdl_lib.a deleted file mode 100644 index 9a186595d35..00000000000 Binary files a/tools/sdk/lib/libdl_lib.a and /dev/null differ diff --git a/tools/sdk/lib/libdriver.a b/tools/sdk/lib/libdriver.a deleted file mode 100644 index 278349e0369..00000000000 Binary files a/tools/sdk/lib/libdriver.a and /dev/null differ diff --git a/tools/sdk/lib/libesp-tls.a b/tools/sdk/lib/libesp-tls.a deleted file mode 100644 index 9cc139c78ab..00000000000 Binary files a/tools/sdk/lib/libesp-tls.a and /dev/null differ diff --git a/tools/sdk/lib/libesp32-camera.a b/tools/sdk/lib/libesp32-camera.a deleted file mode 100644 index 1c0179837bc..00000000000 Binary files a/tools/sdk/lib/libesp32-camera.a and /dev/null differ diff --git a/tools/sdk/lib/libesp32.a b/tools/sdk/lib/libesp32.a deleted file mode 100644 index 240c82e4e22..00000000000 Binary files a/tools/sdk/lib/libesp32.a and /dev/null differ diff --git a/tools/sdk/lib/libesp_adc_cal.a b/tools/sdk/lib/libesp_adc_cal.a deleted file mode 100644 index b55ca617858..00000000000 Binary files a/tools/sdk/lib/libesp_adc_cal.a and /dev/null differ diff --git a/tools/sdk/lib/libesp_event.a b/tools/sdk/lib/libesp_event.a deleted file mode 100644 index 60ca34ef7b0..00000000000 Binary files a/tools/sdk/lib/libesp_event.a and /dev/null differ diff --git a/tools/sdk/lib/libesp_http_client.a b/tools/sdk/lib/libesp_http_client.a deleted file mode 100644 index a3f1ba83be8..00000000000 Binary files a/tools/sdk/lib/libesp_http_client.a and /dev/null differ diff --git a/tools/sdk/lib/libesp_http_server.a b/tools/sdk/lib/libesp_http_server.a deleted file mode 100644 index 6637f05562f..00000000000 Binary files a/tools/sdk/lib/libesp_http_server.a and /dev/null differ diff --git a/tools/sdk/lib/libesp_https_ota.a b/tools/sdk/lib/libesp_https_ota.a deleted file mode 100644 index 3df5593397d..00000000000 Binary files a/tools/sdk/lib/libesp_https_ota.a and /dev/null differ diff --git a/tools/sdk/lib/libesp_ringbuf.a b/tools/sdk/lib/libesp_ringbuf.a deleted file mode 100644 index 41d5e52285e..00000000000 Binary files a/tools/sdk/lib/libesp_ringbuf.a and /dev/null differ diff --git a/tools/sdk/lib/libespnow.a b/tools/sdk/lib/libespnow.a deleted file mode 100644 index 39078d7cb93..00000000000 Binary files a/tools/sdk/lib/libespnow.a and /dev/null differ diff --git a/tools/sdk/lib/libethernet.a b/tools/sdk/lib/libethernet.a deleted file mode 100644 index 4c41f923816..00000000000 Binary files a/tools/sdk/lib/libethernet.a and /dev/null differ diff --git a/tools/sdk/lib/libexpat.a b/tools/sdk/lib/libexpat.a deleted file mode 100644 index 419c8c37270..00000000000 Binary files a/tools/sdk/lib/libexpat.a and /dev/null differ diff --git a/tools/sdk/lib/libface_detection.a b/tools/sdk/lib/libface_detection.a deleted file mode 100644 index b5d9868e456..00000000000 Binary files a/tools/sdk/lib/libface_detection.a and /dev/null differ diff --git a/tools/sdk/lib/libface_recognition.a b/tools/sdk/lib/libface_recognition.a deleted file mode 100644 index b5f4486e729..00000000000 Binary files a/tools/sdk/lib/libface_recognition.a and /dev/null differ diff --git a/tools/sdk/lib/libfatfs.a b/tools/sdk/lib/libfatfs.a deleted file mode 100644 index 7a5f329ec63..00000000000 Binary files a/tools/sdk/lib/libfatfs.a and /dev/null differ diff --git a/tools/sdk/lib/libfb_gfx.a b/tools/sdk/lib/libfb_gfx.a deleted file mode 100644 index a2967139948..00000000000 Binary files a/tools/sdk/lib/libfb_gfx.a and /dev/null differ diff --git a/tools/sdk/lib/libfd.a b/tools/sdk/lib/libfd.a deleted file mode 100644 index 38ccff621f3..00000000000 Binary files a/tools/sdk/lib/libfd.a and /dev/null differ diff --git a/tools/sdk/lib/libfr.a b/tools/sdk/lib/libfr.a deleted file mode 100644 index 7ba16b25495..00000000000 Binary files a/tools/sdk/lib/libfr.a and /dev/null differ diff --git a/tools/sdk/lib/libfreemodbus.a b/tools/sdk/lib/libfreemodbus.a deleted file mode 100644 index d64373bc699..00000000000 Binary files a/tools/sdk/lib/libfreemodbus.a and /dev/null differ diff --git a/tools/sdk/lib/libfreertos.a b/tools/sdk/lib/libfreertos.a deleted file mode 100644 index 1eed10babc2..00000000000 Binary files a/tools/sdk/lib/libfreertos.a and /dev/null differ diff --git a/tools/sdk/lib/libhal.a b/tools/sdk/lib/libhal.a deleted file mode 100644 index 382f4e0ab23..00000000000 Binary files a/tools/sdk/lib/libhal.a and /dev/null differ diff --git a/tools/sdk/lib/libheap.a b/tools/sdk/lib/libheap.a deleted file mode 100644 index 56e829a4bb4..00000000000 Binary files a/tools/sdk/lib/libheap.a and /dev/null differ diff --git a/tools/sdk/lib/libimage_util.a b/tools/sdk/lib/libimage_util.a deleted file mode 100644 index a8a38c9346c..00000000000 Binary files a/tools/sdk/lib/libimage_util.a and /dev/null differ diff --git a/tools/sdk/lib/libjsmn.a b/tools/sdk/lib/libjsmn.a deleted file mode 100644 index c86b126d392..00000000000 Binary files a/tools/sdk/lib/libjsmn.a and /dev/null differ diff --git a/tools/sdk/lib/libjson.a b/tools/sdk/lib/libjson.a deleted file mode 100644 index cd0768f7352..00000000000 Binary files a/tools/sdk/lib/libjson.a and /dev/null differ diff --git a/tools/sdk/lib/liblibsodium.a b/tools/sdk/lib/liblibsodium.a deleted file mode 100644 index f26b48d8f88..00000000000 Binary files a/tools/sdk/lib/liblibsodium.a and /dev/null differ diff --git a/tools/sdk/lib/liblog.a b/tools/sdk/lib/liblog.a deleted file mode 100644 index 9e689004b2d..00000000000 Binary files a/tools/sdk/lib/liblog.a and /dev/null differ diff --git a/tools/sdk/lib/liblwip.a b/tools/sdk/lib/liblwip.a deleted file mode 100644 index 7b5d5bf5987..00000000000 Binary files a/tools/sdk/lib/liblwip.a and /dev/null differ diff --git a/tools/sdk/lib/libm.a b/tools/sdk/lib/libm.a deleted file mode 100644 index aa683ac0b96..00000000000 Binary files a/tools/sdk/lib/libm.a and /dev/null differ diff --git a/tools/sdk/lib/libmbedtls.a b/tools/sdk/lib/libmbedtls.a deleted file mode 100644 index 45929d70ac3..00000000000 Binary files a/tools/sdk/lib/libmbedtls.a and /dev/null differ diff --git a/tools/sdk/lib/libmdns.a b/tools/sdk/lib/libmdns.a deleted file mode 100644 index 8e4482766d0..00000000000 Binary files a/tools/sdk/lib/libmdns.a and /dev/null differ diff --git a/tools/sdk/lib/libmesh.a b/tools/sdk/lib/libmesh.a deleted file mode 100644 index 326bb0bfcc1..00000000000 Binary files a/tools/sdk/lib/libmesh.a and /dev/null differ diff --git a/tools/sdk/lib/libmicro-ecc.a b/tools/sdk/lib/libmicro-ecc.a deleted file mode 100644 index 3d3e108fed8..00000000000 Binary files a/tools/sdk/lib/libmicro-ecc.a and /dev/null differ diff --git a/tools/sdk/lib/libmqtt.a b/tools/sdk/lib/libmqtt.a deleted file mode 100644 index 18fd9420709..00000000000 Binary files a/tools/sdk/lib/libmqtt.a and /dev/null differ diff --git a/tools/sdk/lib/libnet80211.a b/tools/sdk/lib/libnet80211.a deleted file mode 100644 index 3effa68be48..00000000000 Binary files a/tools/sdk/lib/libnet80211.a and /dev/null differ diff --git a/tools/sdk/lib/libnewlib.a b/tools/sdk/lib/libnewlib.a deleted file mode 100644 index 640e1500160..00000000000 Binary files a/tools/sdk/lib/libnewlib.a and /dev/null differ diff --git a/tools/sdk/lib/libnghttp.a b/tools/sdk/lib/libnghttp.a deleted file mode 100644 index 8ce8eb813fd..00000000000 Binary files a/tools/sdk/lib/libnghttp.a and /dev/null differ diff --git a/tools/sdk/lib/libnvs_flash.a b/tools/sdk/lib/libnvs_flash.a deleted file mode 100644 index f2189ae77bb..00000000000 Binary files a/tools/sdk/lib/libnvs_flash.a and /dev/null differ diff --git a/tools/sdk/lib/libopenssl.a b/tools/sdk/lib/libopenssl.a deleted file mode 100644 index 935ee46a97f..00000000000 Binary files a/tools/sdk/lib/libopenssl.a and /dev/null differ diff --git a/tools/sdk/lib/libphy.a b/tools/sdk/lib/libphy.a deleted file mode 100644 index 83ccef7e85e..00000000000 Binary files a/tools/sdk/lib/libphy.a and /dev/null differ diff --git a/tools/sdk/lib/libpp.a b/tools/sdk/lib/libpp.a deleted file mode 100644 index 6354cba8ebc..00000000000 Binary files a/tools/sdk/lib/libpp.a and /dev/null differ diff --git a/tools/sdk/lib/libprotobuf-c.a b/tools/sdk/lib/libprotobuf-c.a deleted file mode 100644 index 777e595da5d..00000000000 Binary files a/tools/sdk/lib/libprotobuf-c.a and /dev/null differ diff --git a/tools/sdk/lib/libprotocomm.a b/tools/sdk/lib/libprotocomm.a deleted file mode 100644 index a2d802e3967..00000000000 Binary files a/tools/sdk/lib/libprotocomm.a and /dev/null differ diff --git a/tools/sdk/lib/libpthread.a b/tools/sdk/lib/libpthread.a deleted file mode 100644 index 6fba7a72a96..00000000000 Binary files a/tools/sdk/lib/libpthread.a and /dev/null differ diff --git a/tools/sdk/lib/librtc.a b/tools/sdk/lib/librtc.a deleted file mode 100644 index 3b3370a36a5..00000000000 Binary files a/tools/sdk/lib/librtc.a and /dev/null differ diff --git a/tools/sdk/lib/libsdmmc.a b/tools/sdk/lib/libsdmmc.a deleted file mode 100644 index 4141d2688e0..00000000000 Binary files a/tools/sdk/lib/libsdmmc.a and /dev/null differ diff --git a/tools/sdk/lib/libsmartconfig.a b/tools/sdk/lib/libsmartconfig.a deleted file mode 100644 index 04e2cb834c9..00000000000 Binary files a/tools/sdk/lib/libsmartconfig.a and /dev/null differ diff --git a/tools/sdk/lib/libsmartconfig_ack.a b/tools/sdk/lib/libsmartconfig_ack.a deleted file mode 100644 index ef0430902a8..00000000000 Binary files a/tools/sdk/lib/libsmartconfig_ack.a and /dev/null differ diff --git a/tools/sdk/lib/libsoc.a b/tools/sdk/lib/libsoc.a deleted file mode 100644 index 6dffcda805e..00000000000 Binary files a/tools/sdk/lib/libsoc.a and /dev/null differ diff --git a/tools/sdk/lib/libspi_flash.a b/tools/sdk/lib/libspi_flash.a deleted file mode 100644 index c8ae07321eb..00000000000 Binary files a/tools/sdk/lib/libspi_flash.a and /dev/null differ diff --git a/tools/sdk/lib/libspiffs.a b/tools/sdk/lib/libspiffs.a deleted file mode 100644 index 441ee6cdad0..00000000000 Binary files a/tools/sdk/lib/libspiffs.a and /dev/null differ diff --git a/tools/sdk/lib/libtcp_transport.a b/tools/sdk/lib/libtcp_transport.a deleted file mode 100644 index 1a46d0147a7..00000000000 Binary files a/tools/sdk/lib/libtcp_transport.a and /dev/null differ diff --git a/tools/sdk/lib/libtcpip_adapter.a b/tools/sdk/lib/libtcpip_adapter.a deleted file mode 100644 index 653e79b5b7e..00000000000 Binary files a/tools/sdk/lib/libtcpip_adapter.a and /dev/null differ diff --git a/tools/sdk/lib/libulp.a b/tools/sdk/lib/libulp.a deleted file mode 100644 index c5c875fa529..00000000000 Binary files a/tools/sdk/lib/libulp.a and /dev/null differ diff --git a/tools/sdk/lib/libvfs.a b/tools/sdk/lib/libvfs.a deleted file mode 100644 index 6c29a20e660..00000000000 Binary files a/tools/sdk/lib/libvfs.a and /dev/null differ diff --git a/tools/sdk/lib/libwear_levelling.a b/tools/sdk/lib/libwear_levelling.a deleted file mode 100644 index 75c615a1bf6..00000000000 Binary files a/tools/sdk/lib/libwear_levelling.a and /dev/null differ diff --git a/tools/sdk/lib/libwifi_provisioning.a b/tools/sdk/lib/libwifi_provisioning.a deleted file mode 100644 index cccbbb0f7cf..00000000000 Binary files a/tools/sdk/lib/libwifi_provisioning.a and /dev/null differ diff --git a/tools/sdk/lib/libwpa.a b/tools/sdk/lib/libwpa.a deleted file mode 100644 index ac1a36fdd4d..00000000000 Binary files a/tools/sdk/lib/libwpa.a and /dev/null differ diff --git a/tools/sdk/lib/libwpa2.a b/tools/sdk/lib/libwpa2.a deleted file mode 100644 index 4ba731fe950..00000000000 Binary files a/tools/sdk/lib/libwpa2.a and /dev/null differ diff --git a/tools/sdk/lib/libwpa_supplicant.a b/tools/sdk/lib/libwpa_supplicant.a deleted file mode 100644 index 15535d887ec..00000000000 Binary files a/tools/sdk/lib/libwpa_supplicant.a and /dev/null differ diff --git a/tools/sdk/lib/libwps.a b/tools/sdk/lib/libwps.a deleted file mode 100644 index 139e9e1b2fe..00000000000 Binary files a/tools/sdk/lib/libwps.a and /dev/null differ diff --git a/tools/sdk/lib/libxtensa-debug-module.a b/tools/sdk/lib/libxtensa-debug-module.a deleted file mode 100644 index 6b32ff1dce0..00000000000 Binary files a/tools/sdk/lib/libxtensa-debug-module.a and /dev/null differ diff --git a/tools/sdk/sdkconfig b/tools/sdk/sdkconfig deleted file mode 100644 index 08e8142f7a4..00000000000 --- a/tools/sdk/sdkconfig +++ /dev/null @@ -1,849 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# Espressif IoT Development Framework Configuration -# -CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000 - -# -# SDK tool configuration -# -CONFIG_TOOLPREFIX="xtensa-esp32-elf-" -CONFIG_PYTHON="python" -CONFIG_MAKE_WARN_UNDEFINED_VARIABLES=y - -# -# Arduino Configuration -# -CONFIG_ENABLE_ARDUINO_DEPENDS=y -CONFIG_AUTOSTART_ARDUINO=y -CONFIG_ARDUINO_RUN_CORE0= -CONFIG_ARDUINO_RUN_CORE1=y -CONFIG_ARDUINO_RUN_NO_AFFINITY= -CONFIG_ARDUINO_RUNNING_CORE=1 -CONFIG_ARDUINO_EVENT_RUN_CORE0= -CONFIG_ARDUINO_EVENT_RUN_CORE1=y -CONFIG_ARDUINO_EVENT_RUN_NO_AFFINITY= -CONFIG_ARDUINO_EVENT_RUNNING_CORE=1 -CONFIG_ARDUINO_UDP_RUN_CORE0= -CONFIG_ARDUINO_UDP_RUN_CORE1=y -CONFIG_ARDUINO_UDP_RUN_NO_AFFINITY= -CONFIG_ARDUINO_UDP_RUNNING_CORE=1 -CONFIG_DISABLE_HAL_LOCKS= - -# -# Debug Log Configuration -# -CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_NONE= -CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_ERROR=y -CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_WARN= -CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_INFO= -CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_DEBUG= -CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_VERBOSE= -CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL=1 -CONFIG_ARDUHAL_LOG_COLORS= -CONFIG_ARDUHAL_ESP_LOG=y -CONFIG_ARDUHAL_PARTITION_SCHEME_DEFAULT=y -CONFIG_ARDUHAL_PARTITION_SCHEME_MINIMAL= -CONFIG_ARDUHAL_PARTITION_SCHEME_NO_OTA= -CONFIG_ARDUHAL_PARTITION_SCHEME_HUGE_APP= -CONFIG_ARDUHAL_PARTITION_SCHEME_MIN_SPIFFS= -CONFIG_ARDUHAL_PARTITION_SCHEME="default" -CONFIG_AUTOCONNECT_WIFI= -CONFIG_ARDUINO_SELECTIVE_COMPILATION= - -# -# Bootloader config -# -CONFIG_LOG_BOOTLOADER_LEVEL_NONE=y -CONFIG_LOG_BOOTLOADER_LEVEL_ERROR= -CONFIG_LOG_BOOTLOADER_LEVEL_WARN= -CONFIG_LOG_BOOTLOADER_LEVEL_INFO= -CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG= -CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE= -CONFIG_LOG_BOOTLOADER_LEVEL=0 -CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V= -CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y -CONFIG_BOOTLOADER_FACTORY_RESET= -CONFIG_BOOTLOADER_APP_TEST= -CONFIG_BOOTLOADER_WDT_ENABLE=y -CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE= -CONFIG_BOOTLOADER_WDT_TIME_MS=9000 - -# -# Security features -# -CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT= -CONFIG_SECURE_BOOT_ENABLED= -CONFIG_FLASH_ENCRYPTION_ENABLED= - -# -# Serial flasher config -# -CONFIG_ESPTOOLPY_PORT="/dev/cu.usbserial-DO00EAB0" -CONFIG_ESPTOOLPY_BAUD_115200B= -CONFIG_ESPTOOLPY_BAUD_230400B= -CONFIG_ESPTOOLPY_BAUD_921600B=y -CONFIG_ESPTOOLPY_BAUD_2MB= -CONFIG_ESPTOOLPY_BAUD_OTHER= -CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200 -CONFIG_ESPTOOLPY_BAUD=921600 -CONFIG_ESPTOOLPY_COMPRESSED=y -CONFIG_FLASHMODE_QIO= -CONFIG_FLASHMODE_QOUT= -CONFIG_FLASHMODE_DIO=y -CONFIG_FLASHMODE_DOUT= -CONFIG_ESPTOOLPY_FLASHMODE="dio" -CONFIG_ESPTOOLPY_FLASHFREQ_80M= -CONFIG_ESPTOOLPY_FLASHFREQ_40M=y -CONFIG_ESPTOOLPY_FLASHFREQ_26M= -CONFIG_ESPTOOLPY_FLASHFREQ_20M= -CONFIG_ESPTOOLPY_FLASHFREQ="40m" -CONFIG_ESPTOOLPY_FLASHSIZE_1MB= -CONFIG_ESPTOOLPY_FLASHSIZE_2MB= -CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y -CONFIG_ESPTOOLPY_FLASHSIZE_8MB= -CONFIG_ESPTOOLPY_FLASHSIZE_16MB= -CONFIG_ESPTOOLPY_FLASHSIZE="4MB" -CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y -CONFIG_ESPTOOLPY_BEFORE_RESET=y -CONFIG_ESPTOOLPY_BEFORE_NORESET= -CONFIG_ESPTOOLPY_BEFORE="default_reset" -CONFIG_ESPTOOLPY_AFTER_RESET=y -CONFIG_ESPTOOLPY_AFTER_NORESET= -CONFIG_ESPTOOLPY_AFTER="hard_reset" -CONFIG_MONITOR_BAUD_9600B= -CONFIG_MONITOR_BAUD_57600B= -CONFIG_MONITOR_BAUD_115200B=y -CONFIG_MONITOR_BAUD_230400B= -CONFIG_MONITOR_BAUD_921600B= -CONFIG_MONITOR_BAUD_2MB= -CONFIG_MONITOR_BAUD_OTHER= -CONFIG_MONITOR_BAUD_OTHER_VAL=115200 -CONFIG_MONITOR_BAUD=115200 - -# -# Partition Table -# -CONFIG_PARTITION_TABLE_SINGLE_APP=y -CONFIG_PARTITION_TABLE_TWO_OTA= -CONFIG_PARTITION_TABLE_CUSTOM= -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" -CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp.csv" -CONFIG_PARTITION_TABLE_OFFSET=0x8000 -CONFIG_PARTITION_TABLE_MD5=y - -# -# Compiler options -# -CONFIG_OPTIMIZATION_LEVEL_DEBUG=y -CONFIG_OPTIMIZATION_LEVEL_RELEASE= -CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y -CONFIG_OPTIMIZATION_ASSERTIONS_SILENT= -CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED= -CONFIG_CXX_EXCEPTIONS=y -CONFIG_CXX_EXCEPTIONS_EMG_POOL_SIZE=0 -CONFIG_STACK_CHECK_NONE= -CONFIG_STACK_CHECK_NORM=y -CONFIG_STACK_CHECK_STRONG= -CONFIG_STACK_CHECK_ALL= -CONFIG_STACK_CHECK=y -CONFIG_WARN_WRITE_STRINGS=y -CONFIG_DISABLE_GCC8_WARNINGS= - -# -# Component config -# - -# -# Application Level Tracing -# -CONFIG_ESP32_APPTRACE_DEST_TRAX= -CONFIG_ESP32_APPTRACE_DEST_NONE=y -CONFIG_ESP32_APPTRACE_ENABLE= -CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y -CONFIG_AWS_IOT_SDK= - -# -# Bluetooth -# -CONFIG_BT_ENABLED=y - -# -# Bluetooth controller -# -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BTDM=y -CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN=3 -CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN=2 -CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN=0 -CONFIG_BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH_HCI= -CONFIG_BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH_PCM=y -CONFIG_BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH_EFF=1 -CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN_EFF=3 -CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN_EFF=2 -CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_EFF=0 -CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_0=y -CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_1= -CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE=0 -CONFIG_BTDM_CONTROLLER_HCI_MODE_VHCI=y -CONFIG_BTDM_CONTROLLER_HCI_MODE_UART_H4= - -# -# MODEM SLEEP Options -# -CONFIG_BTDM_CONTROLLER_MODEM_SLEEP=y -CONFIG_BTDM_MODEM_SLEEP_MODE_ORIG=y -CONFIG_BTDM_MODEM_SLEEP_MODE_EVED= -CONFIG_BTDM_LPCLK_SEL_MAIN_XTAL=y -CONFIG_BLE_SCAN_DUPLICATE=y -CONFIG_SCAN_DUPLICATE_BY_DEVICE_ADDR=y -CONFIG_SCAN_DUPLICATE_BY_ADV_DATA= -CONFIG_SCAN_DUPLICATE_BY_ADV_DATA_AND_DEVICE_ADDR= -CONFIG_SCAN_DUPLICATE_TYPE=0 -CONFIG_DUPLICATE_SCAN_CACHE_SIZE=20 -CONFIG_BLE_MESH_SCAN_DUPLICATE_EN= -CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_SUPPORTED=y -CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_NUM=100 -CONFIG_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 -CONFIG_BLUEDROID_ENABLED=y -CONFIG_BLUEDROID_PINNED_TO_CORE_0=y -CONFIG_BLUEDROID_PINNED_TO_CORE_1= -CONFIG_BLUEDROID_PINNED_TO_CORE=0 -CONFIG_BTC_TASK_STACK_SIZE=8192 -CONFIG_BLUEDROID_MEM_DEBUG= -CONFIG_CLASSIC_BT_ENABLED=y -CONFIG_A2DP_ENABLE=y -CONFIG_A2DP_SINK_TASK_STACK_SIZE=2048 -CONFIG_A2DP_SOURCE_TASK_STACK_SIZE=2048 -CONFIG_BT_SPP_ENABLED=y -CONFIG_HFP_ENABLE=y -CONFIG_HFP_CLIENT_ENABLE=y -CONFIG_HFP_AUDIO_DATA_PATH_PCM=y -CONFIG_HFP_AUDIO_DATA_PATH_HCI= -CONFIG_GATTS_ENABLE=y -CONFIG_GATTS_SEND_SERVICE_CHANGE_MANUAL= -CONFIG_GATTS_SEND_SERVICE_CHANGE_AUTO=y -CONFIG_GATTS_SEND_SERVICE_CHANGE_MODE=0 -CONFIG_GATTC_ENABLE=y -CONFIG_GATTC_CACHE_NVS_FLASH= -CONFIG_BLE_SMP_ENABLE=y -CONFIG_SMP_SLAVE_CON_PARAMS_UPD_ENABLE= -CONFIG_BT_STACK_NO_LOG=y -CONFIG_BT_ACL_CONNECTIONS=4 -CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=y -CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY=y -CONFIG_BLE_HOST_QUEUE_CONGESTION_CHECK= -CONFIG_SMP_ENABLE=y -CONFIG_BLE_ACTIVE_SCAN_REPORT_ADV_SCAN_RSP_INDIVIDUALLY= -CONFIG_BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT=30 -CONFIG_BT_RESERVE_DRAM=0xdb5c - -# -# Driver configurations -# - -# -# ADC configuration -# -CONFIG_ADC_FORCE_XPD_FSM= -CONFIG_ADC2_DISABLE_DAC=y - -# -# SPI configuration -# -CONFIG_SPI_MASTER_IN_IRAM= -CONFIG_SPI_MASTER_ISR_IN_IRAM=y -CONFIG_SPI_SLAVE_IN_IRAM= -CONFIG_SPI_SLAVE_ISR_IN_IRAM=y -CONFIG_C_IMPL= -CONFIG_XTENSA_IMPL=y - -# -# ESP-FACE Configuration -# -CONFIG_MTMN_LITE_QUANT=y -CONFIG_MTMN_LITE_FLOAT= -CONFIG_MTMN_HEAVY_QUANT= -CONFIG_FRMN1_QUANT=y -CONFIG_FRMN2_QUANT= -CONFIG_FRMN2P_QUANT= -CONFIG_FRMN2C_QUANT= - -# -# ESP32-specific -# -CONFIG_ESP32_REV_MIN_0=y -CONFIG_ESP32_REV_MIN_1= -CONFIG_ESP32_REV_MIN_2= -CONFIG_ESP32_REV_MIN_3= -CONFIG_ESP32_REV_MIN=0 -CONFIG_ESP32_DPORT_WORKAROUND=y -CONFIG_ESP32_DEFAULT_CPU_FREQ_80= -CONFIG_ESP32_DEFAULT_CPU_FREQ_160= -CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y -CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240 -CONFIG_SPIRAM_SUPPORT=y - -# -# SPI RAM config -# -CONFIG_SPIRAM_BOOT_INIT= -CONFIG_SPIRAM_USE_MEMMAP= -CONFIG_SPIRAM_USE_CAPS_ALLOC=y -CONFIG_SPIRAM_USE_MALLOC= -CONFIG_SPIRAM_TYPE_AUTO=y -CONFIG_SPIRAM_TYPE_ESPPSRAM32= -CONFIG_SPIRAM_TYPE_ESPPSRAM64= -CONFIG_SPIRAM_SIZE=-1 -CONFIG_SPIRAM_SPEED_40M=y -CONFIG_SPIRAM_CACHE_WORKAROUND=y -CONFIG_SPIRAM_BANKSWITCH_ENABLE=y -CONFIG_SPIRAM_BANKSWITCH_RESERVE=8 -CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST= -CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY= - -# -# PSRAM clock and cs IO for ESP32-DOWD -# -CONFIG_D0WD_PSRAM_CLK_IO=17 -CONFIG_D0WD_PSRAM_CS_IO=16 - -# -# PSRAM clock and cs IO for ESP32-D2WD -# -CONFIG_D2WD_PSRAM_CLK_IO=9 -CONFIG_D2WD_PSRAM_CS_IO=10 - -# -# PSRAM clock and cs IO for ESP32-PICO -# -CONFIG_PICO_PSRAM_CS_IO=10 -CONFIG_SPIRAM_SPIWP_SD3_PIN=7 -CONFIG_MEMMAP_TRACEMEM= -CONFIG_MEMMAP_TRACEMEM_TWOBANKS= -CONFIG_ESP32_TRAX= -CONFIG_TRACEMEM_RESERVE_DRAM=0x0 -CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH= -CONFIG_ESP32_ENABLE_COREDUMP_TO_UART= -CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y -CONFIG_ESP32_ENABLE_COREDUMP= -CONFIG_TWO_UNIVERSAL_MAC_ADDRESS= -CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y -CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4 -CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 -CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2048 -CONFIG_MAIN_TASK_STACK_SIZE=4096 -CONFIG_IPC_TASK_STACK_SIZE=1024 -CONFIG_TIMER_TASK_STACK_SIZE=4096 -CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y -CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF= -CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR= -CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF= -CONFIG_NEWLIB_STDIN_LINE_ENDING_LF= -CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y -CONFIG_NEWLIB_NANO_FORMAT= -CONFIG_CONSOLE_UART_DEFAULT=y -CONFIG_CONSOLE_UART_CUSTOM= -CONFIG_CONSOLE_UART_NONE= -CONFIG_CONSOLE_UART_NUM=0 -CONFIG_CONSOLE_UART_BAUDRATE=115200 -CONFIG_ULP_COPROC_ENABLED=y -CONFIG_ULP_COPROC_RESERVE_MEM=512 -CONFIG_ESP32_PANIC_PRINT_HALT= -CONFIG_ESP32_PANIC_PRINT_REBOOT=y -CONFIG_ESP32_PANIC_SILENT_REBOOT= -CONFIG_ESP32_PANIC_GDBSTUB= -CONFIG_ESP32_DEBUG_OCDAWARE=y -CONFIG_ESP32_DEBUG_STUBS_ENABLE=y -CONFIG_INT_WDT=y -CONFIG_INT_WDT_TIMEOUT_MS=300 -CONFIG_INT_WDT_CHECK_CPU1=y -CONFIG_TASK_WDT=y -CONFIG_TASK_WDT_PANIC=y -CONFIG_TASK_WDT_TIMEOUT_S=5 -CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y -CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1= -CONFIG_BROWNOUT_DET=y -CONFIG_BROWNOUT_DET_LVL_SEL_0=y -CONFIG_BROWNOUT_DET_LVL_SEL_1= -CONFIG_BROWNOUT_DET_LVL_SEL_2= -CONFIG_BROWNOUT_DET_LVL_SEL_3= -CONFIG_BROWNOUT_DET_LVL_SEL_4= -CONFIG_BROWNOUT_DET_LVL_SEL_5= -CONFIG_BROWNOUT_DET_LVL_SEL_6= -CONFIG_BROWNOUT_DET_LVL_SEL_7= -CONFIG_BROWNOUT_DET_LVL=0 -CONFIG_REDUCE_PHY_TX_POWER=y -CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1=y -CONFIG_ESP32_TIME_SYSCALL_USE_RTC= -CONFIG_ESP32_TIME_SYSCALL_USE_FRC1= -CONFIG_ESP32_TIME_SYSCALL_USE_NONE= -CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y -CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL= -CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC= -CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256= -CONFIG_ESP32_RTC_CLK_CAL_CYCLES=1024 -CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000 -CONFIG_ESP32_XTAL_FREQ_40= -CONFIG_ESP32_XTAL_FREQ_26= -CONFIG_ESP32_XTAL_FREQ_AUTO=y -CONFIG_ESP32_XTAL_FREQ=0 -CONFIG_DISABLE_BASIC_ROM_CONSOLE= -CONFIG_ESP_TIMER_PROFILING= -CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS= -CONFIG_ESP_ERR_TO_NAME_LOOKUP=y -CONFIG_ESP32_DPORT_DIS_INTERRUPT_LVL=5 - -# -# Wi-Fi -# -CONFIG_SW_COEXIST_ENABLE=y -CONFIG_SW_COEXIST_PREFERENCE_WIFI= -CONFIG_SW_COEXIST_PREFERENCE_BT= -CONFIG_SW_COEXIST_PREFERENCE_BALANCE=y -CONFIG_SW_COEXIST_PREFERENCE_VALUE=2 -CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=16 -CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32 -CONFIG_ESP32_WIFI_STATIC_TX_BUFFER= -CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y -CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 -CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=32 -CONFIG_ESP32_WIFI_CSI_ENABLED= -CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y -CONFIG_ESP32_WIFI_TX_BA_WIN=6 -CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y -CONFIG_ESP32_WIFI_RX_BA_WIN=16 -CONFIG_ESP32_WIFI_NVS_ENABLED=y -CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y -CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1= -CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 -CONFIG_ESP32_WIFI_IRAM_OPT=y -CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 - -# -# PHY -# -CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y -CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION= -CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 -CONFIG_ESP32_PHY_MAX_TX_POWER=20 - -# -# Power Management -# -CONFIG_PM_ENABLE= - -# -# Camera configuration -# -CONFIG_OV2640_SUPPORT=y -CONFIG_OV7725_SUPPORT=y -CONFIG_OV3660_SUPPORT=y -CONFIG_SCCB_HARDWARE_I2C=y -CONFIG_CAMERA_CORE0= -CONFIG_CAMERA_CORE1=y -CONFIG_CAMERA_NO_AFFINITY= - -# -# ADC-Calibration -# -CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y -CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y -CONFIG_ADC_CAL_LUT_ENABLE=y - -# -# Event Loop Library -# -CONFIG_EVENT_LOOP_PROFILING= - -# -# ESP HTTP client -# -CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y - -# -# HTTP Server -# -CONFIG_HTTPD_MAX_REQ_HDR_LEN=512 -CONFIG_HTTPD_MAX_URI_LEN=512 -CONFIG_HTTPD_PURGE_BUF_LEN=32 -CONFIG_HTTPD_LOG_PURGE_DATA= - -# -# Ethernet -# -CONFIG_DMA_RX_BUF_NUM=10 -CONFIG_DMA_TX_BUF_NUM=10 -CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE=y -CONFIG_EMAC_CHECK_LINK_PERIOD_MS=2000 -CONFIG_EMAC_TASK_PRIORITY=20 -CONFIG_EMAC_TASK_STACK_SIZE=3072 - -# -# FAT Filesystem support -# -CONFIG_FATFS_CODEPAGE_DYNAMIC= -CONFIG_FATFS_CODEPAGE_437= -CONFIG_FATFS_CODEPAGE_720= -CONFIG_FATFS_CODEPAGE_737= -CONFIG_FATFS_CODEPAGE_771= -CONFIG_FATFS_CODEPAGE_775= -CONFIG_FATFS_CODEPAGE_850=y -CONFIG_FATFS_CODEPAGE_852= -CONFIG_FATFS_CODEPAGE_855= -CONFIG_FATFS_CODEPAGE_857= -CONFIG_FATFS_CODEPAGE_860= -CONFIG_FATFS_CODEPAGE_861= -CONFIG_FATFS_CODEPAGE_862= -CONFIG_FATFS_CODEPAGE_863= -CONFIG_FATFS_CODEPAGE_864= -CONFIG_FATFS_CODEPAGE_865= -CONFIG_FATFS_CODEPAGE_866= -CONFIG_FATFS_CODEPAGE_869= -CONFIG_FATFS_CODEPAGE_932= -CONFIG_FATFS_CODEPAGE_936= -CONFIG_FATFS_CODEPAGE_949= -CONFIG_FATFS_CODEPAGE_950= -CONFIG_FATFS_CODEPAGE=850 -CONFIG_FATFS_LFN_NONE= -CONFIG_FATFS_LFN_HEAP= -CONFIG_FATFS_LFN_STACK=y -CONFIG_FATFS_MAX_LFN=255 -CONFIG_FATFS_API_ENCODING_ANSI_OEM=y -CONFIG_FATFS_API_ENCODING_UTF_16= -CONFIG_FATFS_API_ENCODING_UTF_8= -CONFIG_FATFS_FS_LOCK=0 -CONFIG_FATFS_TIMEOUT_MS=10000 -CONFIG_FATFS_PER_FILE_CACHE=y - -# -# Modbus configuration -# -CONFIG_MB_QUEUE_LENGTH=20 -CONFIG_MB_SERIAL_TASK_STACK_SIZE=2048 -CONFIG_MB_SERIAL_BUF_SIZE=256 -CONFIG_MB_SERIAL_TASK_PRIO=10 -CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT= -CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT=20 -CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE=20 -CONFIG_MB_CONTROLLER_STACK_SIZE=4096 -CONFIG_MB_EVENT_QUEUE_TIMEOUT=20 -CONFIG_MB_TIMER_PORT_ENABLED=y -CONFIG_MB_TIMER_GROUP=0 -CONFIG_MB_TIMER_INDEX=0 - -# -# FreeRTOS -# -CONFIG_FREERTOS_UNICORE= -CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF -CONFIG_FREERTOS_CORETIMER_0=y -CONFIG_FREERTOS_CORETIMER_1= -CONFIG_FREERTOS_HZ=1000 -CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION= -CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE= -CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL= -CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y -CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y -CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y -CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 -CONFIG_FREERTOS_ASSERT_FAIL_ABORT=y -CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE= -CONFIG_FREERTOS_ASSERT_DISABLE= -CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1024 -CONFIG_FREERTOS_ISR_STACKSIZE=1536 -CONFIG_FREERTOS_LEGACY_HOOKS= -CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16 -CONFIG_SUPPORT_STATIC_ALLOCATION= -CONFIG_TIMER_TASK_PRIORITY=1 -CONFIG_TIMER_TASK_STACK_DEPTH=2048 -CONFIG_TIMER_QUEUE_LENGTH=10 -CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 -CONFIG_FREERTOS_USE_TRACE_FACILITY= -CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS= -CONFIG_FREERTOS_DEBUG_INTERNALS= -CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER=y - -# -# Heap memory debugging -# -CONFIG_HEAP_POISONING_DISABLED= -CONFIG_HEAP_POISONING_LIGHT=y -CONFIG_HEAP_POISONING_COMPREHENSIVE= -CONFIG_HEAP_TRACING= -CONFIG_HEAP_TASK_TRACKING= - -# -# libsodium -# -CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y - -# -# Log output -# -CONFIG_LOG_DEFAULT_LEVEL_NONE= -CONFIG_LOG_DEFAULT_LEVEL_ERROR=y -CONFIG_LOG_DEFAULT_LEVEL_WARN= -CONFIG_LOG_DEFAULT_LEVEL_INFO= -CONFIG_LOG_DEFAULT_LEVEL_DEBUG= -CONFIG_LOG_DEFAULT_LEVEL_VERBOSE= -CONFIG_LOG_DEFAULT_LEVEL=1 -CONFIG_LOG_COLORS= - -# -# LWIP -# -CONFIG_L2_TO_L3_COPY= -CONFIG_LWIP_IRAM_OPTIMIZATION= -CONFIG_LWIP_MAX_SOCKETS=10 -CONFIG_USE_ONLY_LWIP_SELECT= -CONFIG_LWIP_SO_REUSE=y -CONFIG_LWIP_SO_REUSE_RXTOALL=y -CONFIG_LWIP_SO_RCVBUF=y -CONFIG_LWIP_DHCP_MAX_NTP_SERVERS=1 -CONFIG_LWIP_IP_FRAG= -CONFIG_LWIP_IP_REASSEMBLY= -CONFIG_LWIP_STATS= -CONFIG_LWIP_ETHARP_TRUST_IP_MAC=y -CONFIG_ESP_GRATUITOUS_ARP=y -CONFIG_GARP_TMR_INTERVAL=60 -CONFIG_TCPIP_RECVMBOX_SIZE=32 -CONFIG_LWIP_DHCP_DOES_ARP_CHECK= -CONFIG_LWIP_DHCP_RESTORE_LAST_IP=y - -# -# DHCP server -# -CONFIG_LWIP_DHCPS_LEASE_UNIT=60 -CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8 -CONFIG_LWIP_AUTOIP= -CONFIG_LWIP_NETIF_LOOPBACK=y -CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8 - -# -# TCP -# -CONFIG_LWIP_MAX_ACTIVE_TCP=16 -CONFIG_LWIP_MAX_LISTENING_TCP=16 -CONFIG_TCP_MAXRTX=12 -CONFIG_TCP_SYNMAXRTX=6 -CONFIG_TCP_MSS=1436 -CONFIG_TCP_MSL=60000 -CONFIG_TCP_SND_BUF_DEFAULT=5744 -CONFIG_TCP_WND_DEFAULT=5744 -CONFIG_TCP_RECVMBOX_SIZE=6 -CONFIG_TCP_QUEUE_OOSEQ=y -CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES= -CONFIG_TCP_OVERSIZE_MSS=y -CONFIG_TCP_OVERSIZE_QUARTER_MSS= -CONFIG_TCP_OVERSIZE_DISABLE= - -# -# UDP -# -CONFIG_LWIP_MAX_UDP_PCBS=16 -CONFIG_UDP_RECVMBOX_SIZE=6 -CONFIG_TCPIP_TASK_STACK_SIZE=2560 -CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY= -CONFIG_TCPIP_TASK_AFFINITY_CPU0=y -CONFIG_TCPIP_TASK_AFFINITY_CPU1= -CONFIG_TCPIP_TASK_AFFINITY=0x0 -CONFIG_PPP_SUPPORT=y -CONFIG_PPP_PAP_SUPPORT=y -CONFIG_PPP_CHAP_SUPPORT=y -CONFIG_PPP_MSCHAP_SUPPORT=y -CONFIG_PPP_MPPE_SUPPORT=y -CONFIG_PPP_DEBUG_ON= - -# -# ICMP -# -CONFIG_LWIP_MULTICAST_PING= -CONFIG_LWIP_BROADCAST_PING= - -# -# LWIP RAW API -# -CONFIG_LWIP_MAX_RAW_PCBS=16 - -# -# mbedTLS -# -CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y -CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC= -CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC= -CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC= -CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=16384 -CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN= -CONFIG_MBEDTLS_DEBUG= -CONFIG_MBEDTLS_HARDWARE_AES=y -CONFIG_MBEDTLS_HARDWARE_MPI= -CONFIG_MBEDTLS_HARDWARE_SHA= -CONFIG_MBEDTLS_HAVE_TIME=y -CONFIG_MBEDTLS_HAVE_TIME_DATE= -CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y -CONFIG_MBEDTLS_TLS_SERVER_ONLY= -CONFIG_MBEDTLS_TLS_CLIENT_ONLY= -CONFIG_MBEDTLS_TLS_DISABLED= -CONFIG_MBEDTLS_TLS_SERVER=y -CONFIG_MBEDTLS_TLS_CLIENT=y -CONFIG_MBEDTLS_TLS_ENABLED=y - -# -# TLS Key Exchange Methods -# -CONFIG_MBEDTLS_PSK_MODES=y -CONFIG_MBEDTLS_KEY_EXCHANGE_PSK=y -CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_PSK=y -CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK=y -CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_PSK=y -CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y -CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA=y -CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y -CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y -CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y -CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y -CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y -CONFIG_MBEDTLS_SSL_RENEGOTIATION=y -CONFIG_MBEDTLS_SSL_PROTO_SSL3= -CONFIG_MBEDTLS_SSL_PROTO_TLS1=y -CONFIG_MBEDTLS_SSL_PROTO_TLS1_1=y -CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y -CONFIG_MBEDTLS_SSL_PROTO_DTLS= -CONFIG_MBEDTLS_SSL_ALPN=y -CONFIG_MBEDTLS_SSL_SESSION_TICKETS=y - -# -# Symmetric Ciphers -# -CONFIG_MBEDTLS_AES_C=y -CONFIG_MBEDTLS_CAMELLIA_C= -CONFIG_MBEDTLS_DES_C= -CONFIG_MBEDTLS_RC4_DISABLED=y -CONFIG_MBEDTLS_RC4_ENABLED_NO_DEFAULT= -CONFIG_MBEDTLS_RC4_ENABLED= -CONFIG_MBEDTLS_BLOWFISH_C= -CONFIG_MBEDTLS_XTEA_C= -CONFIG_MBEDTLS_CCM_C=y -CONFIG_MBEDTLS_GCM_C=y -CONFIG_MBEDTLS_RIPEMD160_C= - -# -# Certificates -# -CONFIG_MBEDTLS_PEM_PARSE_C=y -CONFIG_MBEDTLS_PEM_WRITE_C=y -CONFIG_MBEDTLS_X509_CRL_PARSE_C=y -CONFIG_MBEDTLS_X509_CSR_PARSE_C=y -CONFIG_MBEDTLS_ECP_C=y -CONFIG_MBEDTLS_ECDH_C=y -CONFIG_MBEDTLS_ECDSA_C=y -CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y -CONFIG_MBEDTLS_ECP_NIST_OPTIM=y - -# -# mDNS -# -CONFIG_MDNS_MAX_SERVICES=10 - -# -# ESP-MQTT Configurations -# -CONFIG_MQTT_PROTOCOL_311=y -CONFIG_MQTT_TRANSPORT_SSL=y -CONFIG_MQTT_TRANSPORT_WEBSOCKET=y -CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y -CONFIG_MQTT_USE_CUSTOM_CONFIG= -CONFIG_MQTT_TASK_CORE_SELECTION_ENABLED= -CONFIG_MQTT_CUSTOM_OUTBOX= - -# -# NVS -# - -# -# OpenSSL -# -CONFIG_OPENSSL_DEBUG= -CONFIG_OPENSSL_ASSERT_DO_NOTHING=y -CONFIG_OPENSSL_ASSERT_EXIT= - -# -# PThreads -# -CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 -CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=2048 -CONFIG_PTHREAD_STACK_MIN=768 - -# -# SPI Flash driver -# -CONFIG_SPI_FLASH_VERIFY_WRITE= -CONFIG_SPI_FLASH_ENABLE_COUNTERS= -CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y -CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y -CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS= -CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED= -CONFIG_SPI_FLASH_YIELD_DURING_ERASE= - -# -# SPIFFS Configuration -# -CONFIG_SPIFFS_MAX_PARTITIONS=3 - -# -# SPIFFS Cache Configuration -# -CONFIG_SPIFFS_CACHE=y -CONFIG_SPIFFS_CACHE_WR=y -CONFIG_SPIFFS_CACHE_STATS= -CONFIG_SPIFFS_PAGE_CHECK=y -CONFIG_SPIFFS_GC_MAX_RUNS=10 -CONFIG_SPIFFS_GC_STATS= -CONFIG_SPIFFS_PAGE_SIZE=256 -CONFIG_SPIFFS_OBJ_NAME_LEN=32 -CONFIG_SPIFFS_USE_MAGIC=y -CONFIG_SPIFFS_USE_MAGIC_LENGTH=y -CONFIG_SPIFFS_META_LENGTH=4 -CONFIG_SPIFFS_USE_MTIME=y - -# -# Debug Configuration -# -CONFIG_SPIFFS_DBG= -CONFIG_SPIFFS_API_DBG= -CONFIG_SPIFFS_GC_DBG= -CONFIG_SPIFFS_CACHE_DBG= -CONFIG_SPIFFS_CHECK_DBG= -CONFIG_SPIFFS_TEST_VISUALISATION= - -# -# TCP/IP Adapter -# -CONFIG_IP_LOST_TIMER_INTERVAL=120 -CONFIG_TCPIP_LWIP=y - -# -# Virtual file system -# -CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y -CONFIG_SUPPORT_TERMIOS=y - -# -# Wear Levelling -# -CONFIG_WL_SECTOR_SIZE_512= -CONFIG_WL_SECTOR_SIZE_4096=y -CONFIG_WL_SECTOR_SIZE=4096 diff --git a/v2.x_cli_compile/cli_compile_0.json b/v2.x_cli_compile/cli_compile_0.json new file mode 100644 index 00000000000..6f63890ad62 --- /dev/null +++ b/v2.x_cli_compile/cli_compile_0.json @@ -0,0 +1,366 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32s3:PSRAM=opi,USBMode=default,PartitionScheme=huge_app", + "target": "esp32s3", + "sketches": [ +{"name": "ArduinoOTA/examples/BasicOTA", + "sizes": [{ + "flash_bytes": 733453, + "flash_percentage": 23, + "ram_bytes": 46064, + "ram_percentage": 14 + }] + }, +{"name": "ArduinoOTA/examples/OTAWebUpdater", + "sizes": [{ + "flash_bytes": 753785, + "flash_percentage": 23, + "ram_bytes": 44472, + "ram_percentage": 13 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPClient", + "sizes": [{ + "flash_bytes": 679917, + "flash_percentage": 21, + "ram_bytes": 40280, + "ram_percentage": 12 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPMulticastServer", + "sizes": [{ + "flash_bytes": 680201, + "flash_percentage": 21, + "ram_bytes": 40280, + "ram_percentage": 12 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPServer", + "sizes": [{ + "flash_bytes": 679985, + "flash_percentage": 21, + "ram_bytes": 40280, + "ram_percentage": 12 + }] + }, +{"name": "BLE/examples/BLE5_extended_scan", + "sizes": [{ + "flash_bytes": 899133, + "flash_percentage": 28, + "ram_bytes": 44188, + "ram_percentage": 13 + }] + }, +{"name": "BLE/examples/BLE5_multi_advertising", + "sizes": [{ + "flash_bytes": 899973, + "flash_percentage": 28, + "ram_bytes": 44548, + "ram_percentage": 13 + }] + }, +{"name": "BLE/examples/BLE5_periodic_advertising", + "sizes": [{ + "flash_bytes": 899761, + "flash_percentage": 28, + "ram_bytes": 44308, + "ram_percentage": 13 + }] + }, +{"name": "BLE/examples/BLE5_periodic_sync", + "sizes": [{ + "flash_bytes": 899565, + "flash_percentage": 28, + "ram_bytes": 44212, + "ram_percentage": 13 + }] + }, +{"name": "BLE/examples/BLE_Beacon_Scanner", + "sizes": [{ + "flash_bytes": 905453, + "flash_percentage": 28, + "ram_bytes": 44188, + "ram_percentage": 13 + }] + }, +{"name": "BLE/examples/BLE_EddystoneTLM_Beacon", + "sizes": [{ + "flash_bytes": 910809, + "flash_percentage": 28, + "ram_bytes": 44364, + "ram_percentage": 13 + }] + }, +{"name": "BLE/examples/BLE_EddystoneURL_Beacon", + "sizes": [{ + "flash_bytes": 908393, + "flash_percentage": 28, + "ram_bytes": 44356, + "ram_percentage": 13 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32s2", + "sketches": [ +{"name": "ArduinoOTA/examples/BasicOTA", + "sizes": [{ + "flash_bytes": 708858, + "flash_percentage": 22, + "ram_bytes": 41008, + "ram_percentage": 12 + }] + }, +{"name": "ArduinoOTA/examples/OTAWebUpdater", + "sizes": [{ + "flash_bytes": 729334, + "flash_percentage": 23, + "ram_bytes": 39440, + "ram_percentage": 12 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPClient", + "sizes": [{ + "flash_bytes": 657066, + "flash_percentage": 20, + "ram_bytes": 35424, + "ram_percentage": 10 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPMulticastServer", + "sizes": [{ + "flash_bytes": 657346, + "flash_percentage": 20, + "ram_bytes": 35424, + "ram_percentage": 10 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPServer", + "sizes": [{ + "flash_bytes": 657126, + "flash_percentage": 20, + "ram_bytes": 35424, + "ram_percentage": 10 + }] + }, +{"name": "DNSServer/examples/CaptivePortal", + "sizes": [{ + "flash_bytes": 650294, + "flash_percentage": 20, + "ram_bytes": 36824, + "ram_percentage": 11 + }] + }, +{"name": "EEPROM/examples/eeprom_class", + "sizes": [{ + "flash_bytes": 230542, + "flash_percentage": 7, + "ram_bytes": 14624, + "ram_percentage": 4 + }] + }, +{"name": "EEPROM/examples/eeprom_extra", + "sizes": [{ + "flash_bytes": 247170, + "flash_percentage": 7, + "ram_bytes": 14568, + "ram_percentage": 4 + }] + }, +{"name": "EEPROM/examples/eeprom_write", + "sizes": [{ + "flash_bytes": 229042, + "flash_percentage": 7, + "ram_bytes": 14568, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/AnalogOut/LEDCSoftwareFade", + "sizes": [{ + "flash_bytes": 202942, + "flash_percentage": 6, + "ram_bytes": 14360, + "ram_percentage": 4 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3:PartitionScheme=huge_app", + "target": "esp32c3", + "sketches": [ +{"name": "ArduinoOTA/examples/BasicOTA", + "sizes": [{ + "flash_bytes": 762032, + "flash_percentage": 24, + "ram_bytes": 40044, + "ram_percentage": 12 + }] + }, +{"name": "ArduinoOTA/examples/OTAWebUpdater", + "sizes": [{ + "flash_bytes": 780802, + "flash_percentage": 24, + "ram_bytes": 38452, + "ram_percentage": 11 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPClient", + "sizes": [{ + "flash_bytes": 703804, + "flash_percentage": 22, + "ram_bytes": 34468, + "ram_percentage": 10 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPMulticastServer", + "sizes": [{ + "flash_bytes": 704128, + "flash_percentage": 22, + "ram_bytes": 34468, + "ram_percentage": 10 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPServer", + "sizes": [{ + "flash_bytes": 703872, + "flash_percentage": 22, + "ram_bytes": 34468, + "ram_percentage": 10 + }] + }, +{"name": "BLE/examples/BLE5_extended_scan", + "sizes": [{ + "flash_bytes": 973122, + "flash_percentage": 30, + "ram_bytes": 38428, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE5_multi_advertising", + "sizes": [{ + "flash_bytes": 974370, + "flash_percentage": 30, + "ram_bytes": 38820, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE5_periodic_advertising", + "sizes": [{ + "flash_bytes": 973934, + "flash_percentage": 30, + "ram_bytes": 38556, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE5_periodic_sync", + "sizes": [{ + "flash_bytes": 973470, + "flash_percentage": 30, + "ram_bytes": 38444, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE_Beacon_Scanner", + "sizes": [{ + "flash_bytes": 978734, + "flash_percentage": 31, + "ram_bytes": 38428, + "ram_percentage": 11 + }] + } +] +}, +{ "board": "espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32", + "sketches": [ +{"name": "ArduinoOTA/examples/BasicOTA", + "sizes": [{ + "flash_bytes": 785461, + "flash_percentage": 24, + "ram_bytes": 48732, + "ram_percentage": 14 + }] + }, +{"name": "ArduinoOTA/examples/OTAWebUpdater", + "sizes": [{ + "flash_bytes": 806125, + "flash_percentage": 25, + "ram_bytes": 47148, + "ram_percentage": 14 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPClient", + "sizes": [{ + "flash_bytes": 738633, + "flash_percentage": 23, + "ram_bytes": 43404, + "ram_percentage": 13 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPMulticastServer", + "sizes": [{ + "flash_bytes": 739073, + "flash_percentage": 23, + "ram_bytes": 43404, + "ram_percentage": 13 + }] + }, +{"name": "AsyncUDP/examples/AsyncUDPServer", + "sizes": [{ + "flash_bytes": 738697, + "flash_percentage": 23, + "ram_bytes": 43404, + "ram_percentage": 13 + }] + }, +{"name": "BLE/examples/BLE_Beacon_Scanner", + "sizes": [{ + "flash_bytes": 1137393, + "flash_percentage": 36, + "ram_bytes": 39120, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE_EddystoneTLM_Beacon", + "sizes": [{ + "flash_bytes": 1141173, + "flash_percentage": 36, + "ram_bytes": 39316, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE_EddystoneURL_Beacon", + "sizes": [{ + "flash_bytes": 1138433, + "flash_percentage": 36, + "ram_bytes": 39208, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE_client", + "sizes": [{ + "flash_bytes": 1148561, + "flash_percentage": 36, + "ram_bytes": 39168, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE_iBeacon", + "sizes": [{ + "flash_bytes": 1144745, + "flash_percentage": 36, + "ram_bytes": 39128, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE_notify", + "sizes": [{ + "flash_bytes": 1142397, + "flash_percentage": 36, + "ram_bytes": 39136, + "ram_percentage": 11 + }] + } +] +} +]} diff --git a/v2.x_cli_compile/cli_compile_1.json b/v2.x_cli_compile/cli_compile_1.json new file mode 100644 index 00000000000..517579dad21 --- /dev/null +++ b/v2.x_cli_compile/cli_compile_1.json @@ -0,0 +1,366 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32s3:PSRAM=opi,USBMode=default,PartitionScheme=huge_app", + "target": "esp32s3", + "sketches": [ +{"name": "BLE/examples/BLE_client", + "sizes": [{ + "flash_bytes": 915981, + "flash_percentage": 29, + "ram_bytes": 44244, + "ram_percentage": 13 + }] + }, +{"name": "BLE/examples/BLE_iBeacon", + "sizes": [{ + "flash_bytes": 912589, + "flash_percentage": 29, + "ram_bytes": 44204, + "ram_percentage": 13 + }] + }, +{"name": "BLE/examples/BLE_notify", + "sizes": [{ + "flash_bytes": 910357, + "flash_percentage": 28, + "ram_bytes": 44204, + "ram_percentage": 13 + }] + }, +{"name": "BLE/examples/BLE_scan", + "sizes": [{ + "flash_bytes": 902425, + "flash_percentage": 28, + "ram_bytes": 44188, + "ram_percentage": 13 + }] + }, +{"name": "BLE/examples/BLE_server", + "sizes": [{ + "flash_bytes": 907013, + "flash_percentage": 28, + "ram_bytes": 44188, + "ram_percentage": 13 + }] + }, +{"name": "BLE/examples/BLE_server_multiconnect", + "sizes": [{ + "flash_bytes": 910385, + "flash_percentage": 28, + "ram_bytes": 44204, + "ram_percentage": 13 + }] + }, +{"name": "BLE/examples/BLE_uart", + "sizes": [{ + "flash_bytes": 910673, + "flash_percentage": 28, + "ram_bytes": 44204, + "ram_percentage": 13 + }] + }, +{"name": "BLE/examples/BLE_write", + "sizes": [{ + "flash_bytes": 907381, + "flash_percentage": 28, + "ram_bytes": 44188, + "ram_percentage": 13 + }] + }, +{"name": "DNSServer/examples/CaptivePortal", + "sizes": [{ + "flash_bytes": 671909, + "flash_percentage": 21, + "ram_bytes": 41576, + "ram_percentage": 12 + }] + }, +{"name": "EEPROM/examples/eeprom_class", + "sizes": [{ + "flash_bytes": 272193, + "flash_percentage": 8, + "ram_bytes": 18648, + "ram_percentage": 5 + }] + }, +{"name": "EEPROM/examples/eeprom_extra", + "sizes": [{ + "flash_bytes": 274157, + "flash_percentage": 8, + "ram_bytes": 18584, + "ram_percentage": 5 + }] + }, +{"name": "EEPROM/examples/eeprom_write", + "sizes": [{ + "flash_bytes": 270385, + "flash_percentage": 8, + "ram_bytes": 18584, + "ram_percentage": 5 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32s2", + "sketches": [ +{"name": "ESP32/examples/AnalogOut/SigmaDelta", + "sizes": [{ + "flash_bytes": 199414, + "flash_percentage": 6, + "ram_bytes": 14328, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/AnalogOut/ledcFrequency", + "sizes": [{ + "flash_bytes": 227774, + "flash_percentage": 7, + "ram_bytes": 14424, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/AnalogOut/ledcWrite_RGB", + "sizes": [{ + "flash_bytes": 226870, + "flash_percentage": 7, + "ram_bytes": 14608, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/AnalogRead", + "sizes": [{ + "flash_bytes": 245642, + "flash_percentage": 7, + "ram_bytes": 14752, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/ArduinoStackSize", + "sizes": [{ + "flash_bytes": 236114, + "flash_percentage": 7, + "ram_bytes": 14528, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/CI/CIBoardsTest", + "sizes": [{ + "flash_bytes": 247898, + "flash_percentage": 7, + "ram_bytes": 15192, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Camera/CameraWebServer", + "sizes": [{ + "flash_bytes": 1404190, + "flash_percentage": 44, + "ram_bytes": 62028, + "ram_percentage": 18 + }] + }, +{"name": "ESP32/examples/ChipID/GetChipID", + "sizes": [{ + "flash_bytes": 237822, + "flash_percentage": 7, + "ram_bytes": 14564, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/DeepSleep/ExternalWakeUp", + "sizes": [{ + "flash_bytes": 257362, + "flash_percentage": 8, + "ram_bytes": 17768, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/DeepSleep/TimerWakeUp", + "sizes": [{ + "flash_bytes": 257498, + "flash_percentage": 8, + "ram_bytes": 17768, + "ram_percentage": 5 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3:PartitionScheme=huge_app", + "target": "esp32c3", + "sketches": [ +{"name": "BLE/examples/BLE_EddystoneTLM_Beacon", + "sizes": [{ + "flash_bytes": 981922, + "flash_percentage": 31, + "ram_bytes": 38548, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE_EddystoneURL_Beacon", + "sizes": [{ + "flash_bytes": 980790, + "flash_percentage": 31, + "ram_bytes": 38540, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE_client", + "sizes": [{ + "flash_bytes": 977826, + "flash_percentage": 31, + "ram_bytes": 38492, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE_iBeacon", + "sizes": [{ + "flash_bytes": 989884, + "flash_percentage": 31, + "ram_bytes": 38436, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE_notify", + "sizes": [{ + "flash_bytes": 987582, + "flash_percentage": 31, + "ram_bytes": 38444, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE_scan", + "sizes": [{ + "flash_bytes": 974340, + "flash_percentage": 30, + "ram_bytes": 38428, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE_server", + "sizes": [{ + "flash_bytes": 981480, + "flash_percentage": 31, + "ram_bytes": 38428, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE_server_multiconnect", + "sizes": [{ + "flash_bytes": 987584, + "flash_percentage": 31, + "ram_bytes": 38444, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE_uart", + "sizes": [{ + "flash_bytes": 987888, + "flash_percentage": 31, + "ram_bytes": 38444, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE_write", + "sizes": [{ + "flash_bytes": 981814, + "flash_percentage": 31, + "ram_bytes": 38428, + "ram_percentage": 11 + }] + } +] +}, +{ "board": "espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32", + "sketches": [ +{"name": "BLE/examples/BLE_scan", + "sizes": [{ + "flash_bytes": 1134401, + "flash_percentage": 36, + "ram_bytes": 39120, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE_server", + "sizes": [{ + "flash_bytes": 1138925, + "flash_percentage": 36, + "ram_bytes": 39120, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE_server_multiconnect", + "sizes": [{ + "flash_bytes": 1142429, + "flash_percentage": 36, + "ram_bytes": 39136, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE_uart", + "sizes": [{ + "flash_bytes": 1142721, + "flash_percentage": 36, + "ram_bytes": 39128, + "ram_percentage": 11 + }] + }, +{"name": "BLE/examples/BLE_write", + "sizes": [{ + "flash_bytes": 1139281, + "flash_percentage": 36, + "ram_bytes": 39120, + "ram_percentage": 11 + }] + }, +{"name": "BluetoothSerial/examples/DiscoverConnect", + "sizes": [{ + "flash_bytes": 1116957, + "flash_percentage": 35, + "ram_bytes": 39920, + "ram_percentage": 12 + }] + }, +{"name": "BluetoothSerial/examples/GetLocalMAC", + "sizes": [{ + "flash_bytes": 1115381, + "flash_percentage": 35, + "ram_bytes": 39912, + "ram_percentage": 12 + }] + }, +{"name": "BluetoothSerial/examples/SerialToSerialBT", + "sizes": [{ + "flash_bytes": 1114041, + "flash_percentage": 35, + "ram_bytes": 39912, + "ram_percentage": 12 + }] + }, +{"name": "BluetoothSerial/examples/SerialToSerialBTM", + "sizes": [{ + "flash_bytes": 1115189, + "flash_percentage": 35, + "ram_bytes": 39928, + "ram_percentage": 12 + }] + }, +{"name": "BluetoothSerial/examples/SerialToSerialBT_SSP_pairing", + "sizes": [{ + "flash_bytes": 1115057, + "flash_percentage": 35, + "ram_bytes": 39896, + "ram_percentage": 12 + }] + }, +{"name": "BluetoothSerial/examples/bt_classic_device_discovery", + "sizes": [{ + "flash_bytes": 1115309, + "flash_percentage": 35, + "ram_bytes": 39896, + "ram_percentage": 12 + }] + } +] +} +]} diff --git a/v2.x_cli_compile/cli_compile_10.json b/v2.x_cli_compile/cli_compile_10.json new file mode 100644 index 00000000000..c3b93826c99 --- /dev/null +++ b/v2.x_cli_compile/cli_compile_10.json @@ -0,0 +1,366 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32s3:PSRAM=opi,USBMode=default,PartitionScheme=huge_app", + "target": "esp32s3", + "sketches": [ +{"name": "USB/examples/SystemControl", + "sizes": [{ + "flash_bytes": 292873, + "flash_percentage": 9, + "ram_bytes": 30948, + "ram_percentage": 9 + }] + }, +{"name": "USB/examples/USBMSC", + "sizes": [{ + "flash_bytes": 318185, + "flash_percentage": 10, + "ram_bytes": 39484, + "ram_percentage": 12 + }] + }, +{"name": "USB/examples/USBSerial", + "sizes": [{ + "flash_bytes": 308673, + "flash_percentage": 9, + "ram_bytes": 31140, + "ram_percentage": 9 + }] + }, +{"name": "USB/examples/USBVendor", + "sizes": [{ + "flash_bytes": 313389, + "flash_percentage": 9, + "ram_bytes": 31316, + "ram_percentage": 9 + }] + }, +{"name": "Update/examples/AWS_S3_OTA_Update", + "sizes": [{ + "flash_bytes": 705457, + "flash_percentage": 22, + "ram_bytes": 42208, + "ram_percentage": 12 + }] + }, +{"name": "Update/examples/HTTPS_OTA_Update", + "sizes": [{ + "flash_bytes": 835661, + "flash_percentage": 26, + "ram_bytes": 42384, + "ram_percentage": 12 + }] + }, +{"name": "Update/examples/SD_Update", + "sizes": [{ + "flash_bytes": 335081, + "flash_percentage": 10, + "ram_bytes": 19412, + "ram_percentage": 5 + }] + }, +{"name": "WebServer/examples/AdvancedWebServer", + "sizes": [{ + "flash_bytes": 751097, + "flash_percentage": 23, + "ram_bytes": 44272, + "ram_percentage": 13 + }] + }, +{"name": "WebServer/examples/FSBrowser", + "sizes": [{ + "flash_bytes": 787821, + "flash_percentage": 25, + "ram_bytes": 44256, + "ram_percentage": 13 + }] + }, +{"name": "WebServer/examples/HelloServer", + "sizes": [{ + "flash_bytes": 749929, + "flash_percentage": 23, + "ram_bytes": 44272, + "ram_percentage": 13 + }] + }, +{"name": "WebServer/examples/HttpAdvancedAuth", + "sizes": [{ + "flash_bytes": 764649, + "flash_percentage": 24, + "ram_bytes": 46512, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/HttpBasicAuth", + "sizes": [{ + "flash_bytes": 764677, + "flash_percentage": 24, + "ram_bytes": 46480, + "ram_percentage": 14 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32s2", + "sketches": [ +{"name": "USB/examples/Mouse/ButtonMouseControl", + "sizes": [{ + "flash_bytes": 254326, + "flash_percentage": 8, + "ram_bytes": 26604, + "ram_percentage": 8 + }] + }, +{"name": "USB/examples/SystemControl", + "sizes": [{ + "flash_bytes": 254070, + "flash_percentage": 8, + "ram_bytes": 26604, + "ram_percentage": 8 + }] + }, +{"name": "USB/examples/USBMSC", + "sizes": [{ + "flash_bytes": 279870, + "flash_percentage": 8, + "ram_bytes": 35012, + "ram_percentage": 10 + }] + }, +{"name": "USB/examples/USBSerial", + "sizes": [{ + "flash_bytes": 270362, + "flash_percentage": 8, + "ram_bytes": 26668, + "ram_percentage": 8 + }] + }, +{"name": "USB/examples/USBVendor", + "sizes": [{ + "flash_bytes": 276842, + "flash_percentage": 8, + "ram_bytes": 26844, + "ram_percentage": 8 + }] + }, +{"name": "Update/examples/AWS_S3_OTA_Update", + "sizes": [{ + "flash_bytes": 681082, + "flash_percentage": 21, + "ram_bytes": 37168, + "ram_percentage": 11 + }] + }, +{"name": "Update/examples/HTTPS_OTA_Update", + "sizes": [{ + "flash_bytes": 813902, + "flash_percentage": 25, + "ram_bytes": 37520, + "ram_percentage": 11 + }] + }, +{"name": "Update/examples/SD_Update", + "sizes": [{ + "flash_bytes": 309166, + "flash_percentage": 9, + "ram_bytes": 15236, + "ram_percentage": 4 + }] + }, +{"name": "WebServer/examples/AdvancedWebServer", + "sizes": [{ + "flash_bytes": 727014, + "flash_percentage": 23, + "ram_bytes": 39232, + "ram_percentage": 11 + }] + }, +{"name": "WebServer/examples/FSBrowser", + "sizes": [{ + "flash_bytes": 763678, + "flash_percentage": 24, + "ram_bytes": 39240, + "ram_percentage": 11 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3:PartitionScheme=huge_app", + "target": "esp32c3", + "sketches": [ +{"name": "WebServer/examples/HttpAdvancedAuth", + "sizes": [{ + "flash_bytes": 792906, + "flash_percentage": 25, + "ram_bytes": 40492, + "ram_percentage": 12 + }] + }, +{"name": "WebServer/examples/HttpBasicAuth", + "sizes": [{ + "flash_bytes": 792958, + "flash_percentage": 25, + "ram_bytes": 40476, + "ram_percentage": 12 + }] + }, +{"name": "WebServer/examples/MultiHomedServers", + "sizes": [{ + "flash_bytes": 790220, + "flash_percentage": 25, + "ram_bytes": 37988, + "ram_percentage": 11 + }] + }, +{"name": "WebServer/examples/PathArgServer", + "sizes": [{ + "flash_bytes": 1024044, + "flash_percentage": 32, + "ram_bytes": 43308, + "ram_percentage": 13 + }] + }, +{"name": "WebServer/examples/SDWebServer", + "sizes": [{ + "flash_bytes": 846650, + "flash_percentage": 26, + "ram_bytes": 38484, + "ram_percentage": 11 + }] + }, +{"name": "WebServer/examples/SimpleAuthentification", + "sizes": [{ + "flash_bytes": 755340, + "flash_percentage": 24, + "ram_bytes": 36100, + "ram_percentage": 11 + }] + }, +{"name": "WebServer/examples/UploadHugeFile", + "sizes": [{ + "flash_bytes": 1058324, + "flash_percentage": 33, + "ram_bytes": 41748, + "ram_percentage": 12 + }] + }, +{"name": "WebServer/examples/WebUpdate", + "sizes": [{ + "flash_bytes": 780340, + "flash_percentage": 24, + "ram_bytes": 38452, + "ram_percentage": 11 + }] + }, +{"name": "WiFi/examples/FTM/FTM_Initiator", + "sizes": [{ + "flash_bytes": 703022, + "flash_percentage": 22, + "ram_bytes": 34444, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/FTM/FTM_Responder", + "sizes": [{ + "flash_bytes": 700432, + "flash_percentage": 22, + "ram_bytes": 34428, + "ram_percentage": 10 + }] + } +] +}, +{ "board": "espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32", + "sketches": [ +{"name": "SPIFFS/examples/SPIFFS_Test", + "sizes": [{ + "flash_bytes": 317473, + "flash_percentage": 10, + "ram_bytes": 22008, + "ram_percentage": 6 + }] + }, +{"name": "SPIFFS/examples/SPIFFS_time", + "sizes": [{ + "flash_bytes": 794537, + "flash_percentage": 25, + "ram_bytes": 45056, + "ram_percentage": 13 + }] + }, +{"name": "SimpleBLE/examples/SimpleBleDevice", + "sizes": [{ + "flash_bytes": 1095117, + "flash_percentage": 34, + "ram_bytes": 39136, + "ram_percentage": 11 + }] + }, +{"name": "Ticker/examples/Arguments", + "sizes": [{ + "flash_bytes": 281621, + "flash_percentage": 8, + "ram_bytes": 21496, + "ram_percentage": 6 + }] + }, +{"name": "Ticker/examples/Blinker", + "sizes": [{ + "flash_bytes": 255057, + "flash_percentage": 8, + "ram_bytes": 21136, + "ram_percentage": 6 + }] + }, +{"name": "Update/examples/AWS_S3_OTA_Update", + "sizes": [{ + "flash_bytes": 755561, + "flash_percentage": 24, + "ram_bytes": 44884, + "ram_percentage": 13 + }] + }, +{"name": "Update/examples/HTTPS_OTA_Update", + "sizes": [{ + "flash_bytes": 897525, + "flash_percentage": 28, + "ram_bytes": 45492, + "ram_percentage": 13 + }] + }, +{"name": "Update/examples/SD_Update", + "sizes": [{ + "flash_bytes": 345101, + "flash_percentage": 10, + "ram_bytes": 22160, + "ram_percentage": 6 + }] + }, +{"name": "WebServer/examples/AdvancedWebServer", + "sizes": [{ + "flash_bytes": 803733, + "flash_percentage": 25, + "ram_bytes": 47056, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/FSBrowser", + "sizes": [{ + "flash_bytes": 850021, + "flash_percentage": 27, + "ram_bytes": 47188, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/HelloServer", + "sizes": [{ + "flash_bytes": 802185, + "flash_percentage": 25, + "ram_bytes": 46948, + "ram_percentage": 14 + }] + } +] +} +]} diff --git a/v2.x_cli_compile/cli_compile_11.json b/v2.x_cli_compile/cli_compile_11.json new file mode 100644 index 00000000000..9b4528f3d20 --- /dev/null +++ b/v2.x_cli_compile/cli_compile_11.json @@ -0,0 +1,366 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32s3:PSRAM=opi,USBMode=default,PartitionScheme=huge_app", + "target": "esp32s3", + "sketches": [ +{"name": "WebServer/examples/MultiHomedServers", + "sizes": [{ + "flash_bytes": 752489, + "flash_percentage": 23, + "ram_bytes": 44000, + "ram_percentage": 13 + }] + }, +{"name": "WebServer/examples/PathArgServer", + "sizes": [{ + "flash_bytes": 1018517, + "flash_percentage": 32, + "ram_bytes": 48940, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/SDWebServer", + "sizes": [{ + "flash_bytes": 809813, + "flash_percentage": 25, + "ram_bytes": 44524, + "ram_percentage": 13 + }] + }, +{"name": "WebServer/examples/SimpleAuthentification", + "sizes": [{ + "flash_bytes": 718389, + "flash_percentage": 22, + "ram_bytes": 41904, + "ram_percentage": 12 + }] + }, +{"name": "WebServer/examples/UploadHugeFile", + "sizes": [{ + "flash_bytes": 1045437, + "flash_percentage": 33, + "ram_bytes": 47600, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/WebUpdate", + "sizes": [{ + "flash_bytes": 753065, + "flash_percentage": 23, + "ram_bytes": 44456, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/FTM/FTM_Initiator", + "sizes": [{ + "flash_bytes": 677473, + "flash_percentage": 21, + "ram_bytes": 40256, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/FTM/FTM_Responder", + "sizes": [{ + "flash_bytes": 674981, + "flash_percentage": 21, + "ram_bytes": 40232, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/SimpleWiFiServer", + "sizes": [{ + "flash_bytes": 700697, + "flash_percentage": 22, + "ram_bytes": 41976, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WPS", + "sizes": [{ + "flash_bytes": 697177, + "flash_percentage": 22, + "ram_bytes": 40456, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiAccessPoint", + "sizes": [{ + "flash_bytes": 701089, + "flash_percentage": 22, + "ram_bytes": 41976, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiBlueToothSwitch", + "sizes": [{ + "flash_bytes": 764693, + "flash_percentage": 24, + "ram_bytes": 41424, + "ram_percentage": 12 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32s2", + "sketches": [ +{"name": "WebServer/examples/HelloServer", + "sizes": [{ + "flash_bytes": 725518, + "flash_percentage": 23, + "ram_bytes": 39232, + "ram_percentage": 11 + }] + }, +{"name": "WebServer/examples/HttpAdvancedAuth", + "sizes": [{ + "flash_bytes": 740446, + "flash_percentage": 23, + "ram_bytes": 41456, + "ram_percentage": 12 + }] + }, +{"name": "WebServer/examples/HttpBasicAuth", + "sizes": [{ + "flash_bytes": 740502, + "flash_percentage": 23, + "ram_bytes": 41440, + "ram_percentage": 12 + }] + }, +{"name": "WebServer/examples/MultiHomedServers", + "sizes": [{ + "flash_bytes": 728090, + "flash_percentage": 23, + "ram_bytes": 38968, + "ram_percentage": 11 + }] + }, +{"name": "WebServer/examples/PathArgServer", + "sizes": [{ + "flash_bytes": 994962, + "flash_percentage": 31, + "ram_bytes": 44080, + "ram_percentage": 13 + }] + }, +{"name": "WebServer/examples/SDWebServer", + "sizes": [{ + "flash_bytes": 784970, + "flash_percentage": 24, + "ram_bytes": 39492, + "ram_percentage": 12 + }] + }, +{"name": "WebServer/examples/SimpleAuthentification", + "sizes": [{ + "flash_bytes": 695826, + "flash_percentage": 22, + "ram_bytes": 37048, + "ram_percentage": 11 + }] + }, +{"name": "WebServer/examples/UploadHugeFile", + "sizes": [{ + "flash_bytes": 1020510, + "flash_percentage": 32, + "ram_bytes": 42572, + "ram_percentage": 12 + }] + }, +{"name": "WebServer/examples/WebUpdate", + "sizes": [{ + "flash_bytes": 728630, + "flash_percentage": 23, + "ram_bytes": 39440, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/FTM/FTM_Initiator", + "sizes": [{ + "flash_bytes": 654638, + "flash_percentage": 20, + "ram_bytes": 35384, + "ram_percentage": 10 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3:PartitionScheme=huge_app", + "target": "esp32c3", + "sketches": [ +{"name": "WiFi/examples/SimpleWiFiServer", + "sizes": [{ + "flash_bytes": 726770, + "flash_percentage": 23, + "ram_bytes": 35956, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WPS", + "sizes": [{ + "flash_bytes": 725302, + "flash_percentage": 23, + "ram_bytes": 34644, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiAccessPoint", + "sizes": [{ + "flash_bytes": 727264, + "flash_percentage": 23, + "ram_bytes": 35956, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiBlueToothSwitch", + "sizes": [{ + "flash_bytes": 799774, + "flash_percentage": 25, + "ram_bytes": 35652, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiClient", + "sizes": [{ + "flash_bytes": 715168, + "flash_percentage": 22, + "ram_bytes": 35740, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiClientBasic", + "sizes": [{ + "flash_bytes": 716186, + "flash_percentage": 22, + "ram_bytes": 35692, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiClientConnect", + "sizes": [{ + "flash_bytes": 702186, + "flash_percentage": 22, + "ram_bytes": 34436, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiClientEnterprise", + "sizes": [{ + "flash_bytes": 849896, + "flash_percentage": 27, + "ram_bytes": 36332, + "ram_percentage": 11 + }] + }, +{"name": "WiFi/examples/WiFiClientEvents", + "sizes": [{ + "flash_bytes": 703020, + "flash_percentage": 22, + "ram_bytes": 34428, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiClientStaticIP", + "sizes": [{ + "flash_bytes": 715576, + "flash_percentage": 22, + "ram_bytes": 35724, + "ram_percentage": 10 + }] + } +] +}, +{ "board": "espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32", + "sketches": [ +{"name": "WebServer/examples/HttpAdvancedAuth", + "sizes": [{ + "flash_bytes": 817509, + "flash_percentage": 25, + "ram_bytes": 49180, + "ram_percentage": 15 + }] + }, +{"name": "WebServer/examples/HttpBasicAuth", + "sizes": [{ + "flash_bytes": 817557, + "flash_percentage": 25, + "ram_bytes": 49148, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/MultiHomedServers", + "sizes": [{ + "flash_bytes": 804797, + "flash_percentage": 25, + "ram_bytes": 46676, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/PathArgServer", + "sizes": [{ + "flash_bytes": 1094305, + "flash_percentage": 34, + "ram_bytes": 53232, + "ram_percentage": 16 + }] + }, +{"name": "WebServer/examples/SDWebServer", + "sizes": [{ + "flash_bytes": 864613, + "flash_percentage": 27, + "ram_bytes": 47492, + "ram_percentage": 14 + }] + }, +{"name": "WebServer/examples/SimpleAuthentification", + "sizes": [{ + "flash_bytes": 778725, + "flash_percentage": 24, + "ram_bytes": 45036, + "ram_percentage": 13 + }] + }, +{"name": "WebServer/examples/UploadHugeFile", + "sizes": [{ + "flash_bytes": 1112361, + "flash_percentage": 35, + "ram_bytes": 51564, + "ram_percentage": 15 + }] + }, +{"name": "WebServer/examples/WebUpdate", + "sizes": [{ + "flash_bytes": 805493, + "flash_percentage": 25, + "ram_bytes": 47132, + "ram_percentage": 14 + }] + }, +{"name": "WiFi/examples/FTM/FTM_Initiator", + "sizes": [{ + "flash_bytes": 734717, + "flash_percentage": 23, + "ram_bytes": 43364, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/FTM/FTM_Responder", + "sizes": [{ + "flash_bytes": 733409, + "flash_percentage": 23, + "ram_bytes": 43364, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/SimpleWiFiServer", + "sizes": [{ + "flash_bytes": 750993, + "flash_percentage": 23, + "ram_bytes": 44652, + "ram_percentage": 13 + }] + } +] +} +]} diff --git a/v2.x_cli_compile/cli_compile_12.json b/v2.x_cli_compile/cli_compile_12.json new file mode 100644 index 00000000000..7a26a6e4cbc --- /dev/null +++ b/v2.x_cli_compile/cli_compile_12.json @@ -0,0 +1,366 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32s3:PSRAM=opi,USBMode=default,PartitionScheme=huge_app", + "target": "esp32s3", + "sketches": [ +{"name": "WiFi/examples/WiFiClient", + "sizes": [{ + "flash_bytes": 687657, + "flash_percentage": 21, + "ram_bytes": 41560, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiClientBasic", + "sizes": [{ + "flash_bytes": 688485, + "flash_percentage": 21, + "ram_bytes": 41504, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiClientConnect", + "sizes": [{ + "flash_bytes": 677117, + "flash_percentage": 21, + "ram_bytes": 40240, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiClientEnterprise", + "sizes": [{ + "flash_bytes": 814697, + "flash_percentage": 25, + "ram_bytes": 42152, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiClientEvents", + "sizes": [{ + "flash_bytes": 677545, + "flash_percentage": 21, + "ram_bytes": 40232, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiClientStaticIP", + "sizes": [{ + "flash_bytes": 687997, + "flash_percentage": 21, + "ram_bytes": 41544, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiIPv6", + "sizes": [{ + "flash_bytes": 685413, + "flash_percentage": 21, + "ram_bytes": 41872, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiMulti", + "sizes": [{ + "flash_bytes": 676917, + "flash_percentage": 21, + "ram_bytes": 40248, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiScan", + "sizes": [{ + "flash_bytes": 675849, + "flash_percentage": 21, + "ram_bytes": 40240, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiScanDualAntenna", + "sizes": [{ + "flash_bytes": 676717, + "flash_percentage": 21, + "ram_bytes": 40240, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiSmartConfig", + "sizes": [{ + "flash_bytes": 709529, + "flash_percentage": 22, + "ram_bytes": 40572, + "ram_percentage": 12 + }] + }, +{"name": "WiFi/examples/WiFiTelnetToSerial", + "sizes": [{ + "flash_bytes": 693085, + "flash_percentage": 22, + "ram_bytes": 41584, + "ram_percentage": 12 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32s2", + "sketches": [ +{"name": "WiFi/examples/FTM/FTM_Responder", + "sizes": [{ + "flash_bytes": 652082, + "flash_percentage": 20, + "ram_bytes": 35376, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/SimpleWiFiServer", + "sizes": [{ + "flash_bytes": 676218, + "flash_percentage": 21, + "ram_bytes": 36920, + "ram_percentage": 11 + }] + }, +{"name": "WiFi/examples/WPS", + "sizes": [{ + "flash_bytes": 674310, + "flash_percentage": 21, + "ram_bytes": 35584, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiAccessPoint", + "sizes": [{ + "flash_bytes": 676626, + "flash_percentage": 21, + "ram_bytes": 36920, + "ram_percentage": 11 + }] + }, +{"name": "WiFi/examples/WiFiClient", + "sizes": [{ + "flash_bytes": 664838, + "flash_percentage": 21, + "ram_bytes": 36688, + "ram_percentage": 11 + }] + }, +{"name": "WiFi/examples/WiFiClientBasic", + "sizes": [{ + "flash_bytes": 665662, + "flash_percentage": 21, + "ram_bytes": 36632, + "ram_percentage": 11 + }] + }, +{"name": "WiFi/examples/WiFiClientConnect", + "sizes": [{ + "flash_bytes": 654286, + "flash_percentage": 20, + "ram_bytes": 35384, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiClientEnterprise", + "sizes": [{ + "flash_bytes": 793206, + "flash_percentage": 25, + "ram_bytes": 37280, + "ram_percentage": 11 + }] + }, +{"name": "WiFi/examples/WiFiClientEvents", + "sizes": [{ + "flash_bytes": 654690, + "flash_percentage": 20, + "ram_bytes": 35376, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiClientStaticIP", + "sizes": [{ + "flash_bytes": 665198, + "flash_percentage": 21, + "ram_bytes": 36672, + "ram_percentage": 11 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3:PartitionScheme=huge_app", + "target": "esp32c3", + "sketches": [ +{"name": "WiFi/examples/WiFiIPv6", + "sizes": [{ + "flash_bytes": 713012, + "flash_percentage": 22, + "ram_bytes": 36044, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiMulti", + "sizes": [{ + "flash_bytes": 702622, + "flash_percentage": 22, + "ram_bytes": 34444, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiScan", + "sizes": [{ + "flash_bytes": 701748, + "flash_percentage": 22, + "ram_bytes": 34428, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiScanDualAntenna", + "sizes": [{ + "flash_bytes": 702242, + "flash_percentage": 22, + "ram_bytes": 34428, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiSmartConfig", + "sizes": [{ + "flash_bytes": 879906, + "flash_percentage": 27, + "ram_bytes": 35428, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiTelnetToSerial", + "sizes": [{ + "flash_bytes": 719826, + "flash_percentage": 22, + "ram_bytes": 35764, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiUDPClient", + "sizes": [{ + "flash_bytes": 709610, + "flash_percentage": 22, + "ram_bytes": 36060, + "ram_percentage": 11 + }] + }, +{"name": "WiFiClientSecure/examples/WiFiClientInsecure", + "sizes": [{ + "flash_bytes": 839004, + "flash_percentage": 26, + "ram_bytes": 36676, + "ram_percentage": 11 + }] + }, +{"name": "WiFiClientSecure/examples/WiFiClientPSK", + "sizes": [{ + "flash_bytes": 839094, + "flash_percentage": 26, + "ram_bytes": 36684, + "ram_percentage": 11 + }] + }, +{"name": "WiFiClientSecure/examples/WiFiClientSecure", + "sizes": [{ + "flash_bytes": 840196, + "flash_percentage": 26, + "ram_bytes": 36676, + "ram_percentage": 11 + }] + } +] +}, +{ "board": "espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32", + "sketches": [ +{"name": "WiFi/examples/WPS", + "sizes": [{ + "flash_bytes": 756549, + "flash_percentage": 24, + "ram_bytes": 43572, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiAccessPoint", + "sizes": [{ + "flash_bytes": 751401, + "flash_percentage": 23, + "ram_bytes": 44652, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiBlueToothSwitch", + "sizes": [{ + "flash_bytes": 906021, + "flash_percentage": 28, + "ram_bytes": 47400, + "ram_percentage": 14 + }] + }, +{"name": "WiFi/examples/WiFiClient", + "sizes": [{ + "flash_bytes": 747085, + "flash_percentage": 23, + "ram_bytes": 44668, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiClientBasic", + "sizes": [{ + "flash_bytes": 748045, + "flash_percentage": 23, + "ram_bytes": 44620, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiClientConnect", + "sizes": [{ + "flash_bytes": 735465, + "flash_percentage": 23, + "ram_bytes": 43372, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiClientEnterprise", + "sizes": [{ + "flash_bytes": 878801, + "flash_percentage": 27, + "ram_bytes": 45292, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiClientEvents", + "sizes": [{ + "flash_bytes": 736073, + "flash_percentage": 23, + "ram_bytes": 43364, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiClientStaticIP", + "sizes": [{ + "flash_bytes": 747517, + "flash_percentage": 23, + "ram_bytes": 44660, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiIPv6", + "sizes": [{ + "flash_bytes": 744733, + "flash_percentage": 23, + "ram_bytes": 44972, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiMulti", + "sizes": [{ + "flash_bytes": 735481, + "flash_percentage": 23, + "ram_bytes": 43364, + "ram_percentage": 13 + }] + } +] +} +]} diff --git a/v2.x_cli_compile/cli_compile_13.json b/v2.x_cli_compile/cli_compile_13.json new file mode 100644 index 00000000000..8dd562a7833 --- /dev/null +++ b/v2.x_cli_compile/cli_compile_13.json @@ -0,0 +1,318 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32s3:PSRAM=opi,USBMode=default,PartitionScheme=huge_app", + "target": "esp32s3", + "sketches": [ +{"name": "WiFi/examples/WiFiUDPClient", + "sizes": [{ + "flash_bytes": 683305, + "flash_percentage": 21, + "ram_bytes": 41888, + "ram_percentage": 12 + }] + }, +{"name": "WiFiClientSecure/examples/WiFiClientInsecure", + "sizes": [{ + "flash_bytes": 814525, + "flash_percentage": 25, + "ram_bytes": 42504, + "ram_percentage": 12 + }] + }, +{"name": "WiFiClientSecure/examples/WiFiClientPSK", + "sizes": [{ + "flash_bytes": 814637, + "flash_percentage": 25, + "ram_bytes": 42512, + "ram_percentage": 12 + }] + }, +{"name": "WiFiClientSecure/examples/WiFiClientSecure", + "sizes": [{ + "flash_bytes": 815737, + "flash_percentage": 25, + "ram_bytes": 42504, + "ram_percentage": 12 + }] + }, +{"name": "WiFiClientSecure/examples/WiFiClientSecureEnterprise", + "sizes": [{ + "flash_bytes": 851277, + "flash_percentage": 27, + "ram_bytes": 42936, + "ram_percentage": 13 + }] + }, +{"name": "WiFiClientSecure/examples/WiFiClientShowPeerCredentials", + "sizes": [{ + "flash_bytes": 855233, + "flash_percentage": 27, + "ram_bytes": 42496, + "ram_percentage": 12 + }] + }, +{"name": "WiFiProv/examples/WiFiProv", + "sizes": [{ + "flash_bytes": 1320897, + "flash_percentage": 41, + "ram_bytes": 61324, + "ram_percentage": 18 + }] + }, +{"name": "Wire/examples/WireMaster", + "sizes": [{ + "flash_bytes": 278529, + "flash_percentage": 8, + "ram_bytes": 18944, + "ram_percentage": 5 + }] + }, +{"name": "Wire/examples/WireScan", + "sizes": [{ + "flash_bytes": 276833, + "flash_percentage": 8, + "ram_bytes": 18880, + "ram_percentage": 5 + }] + }, +{"name": "Wire/examples/WireSlave", + "sizes": [{ + "flash_bytes": 271601, + "flash_percentage": 8, + "ram_bytes": 18880, + "ram_percentage": 5 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32s2", + "sketches": [ +{"name": "WiFi/examples/WiFiIPv6", + "sizes": [{ + "flash_bytes": 662542, + "flash_percentage": 21, + "ram_bytes": 36984, + "ram_percentage": 11 + }] + }, +{"name": "WiFi/examples/WiFiMulti", + "sizes": [{ + "flash_bytes": 654030, + "flash_percentage": 20, + "ram_bytes": 35376, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiScan", + "sizes": [{ + "flash_bytes": 652950, + "flash_percentage": 20, + "ram_bytes": 35368, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiScanDualAntenna", + "sizes": [{ + "flash_bytes": 653582, + "flash_percentage": 20, + "ram_bytes": 35368, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiSmartConfig", + "sizes": [{ + "flash_bytes": 686330, + "flash_percentage": 21, + "ram_bytes": 35676, + "ram_percentage": 10 + }] + }, +{"name": "WiFi/examples/WiFiTelnetToSerial", + "sizes": [{ + "flash_bytes": 670310, + "flash_percentage": 21, + "ram_bytes": 36728, + "ram_percentage": 11 + }] + }, +{"name": "WiFi/examples/WiFiUDPClient", + "sizes": [{ + "flash_bytes": 660422, + "flash_percentage": 20, + "ram_bytes": 37000, + "ram_percentage": 11 + }] + }, +{"name": "WiFiClientSecure/examples/WiFiClientInsecure", + "sizes": [{ + "flash_bytes": 793202, + "flash_percentage": 25, + "ram_bytes": 37632, + "ram_percentage": 11 + }] + }, +{"name": "WiFiClientSecure/examples/WiFiClientPSK", + "sizes": [{ + "flash_bytes": 793294, + "flash_percentage": 25, + "ram_bytes": 37640, + "ram_percentage": 11 + }] + }, +{"name": "WiFiClientSecure/examples/WiFiClientSecure", + "sizes": [{ + "flash_bytes": 794398, + "flash_percentage": 25, + "ram_bytes": 37632, + "ram_percentage": 11 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3:PartitionScheme=huge_app", + "target": "esp32c3", + "sketches": [ +{"name": "WiFiClientSecure/examples/WiFiClientSecureEnterprise", + "sizes": [{ + "flash_bytes": 876754, + "flash_percentage": 27, + "ram_bytes": 37020, + "ram_percentage": 11 + }] + }, +{"name": "WiFiClientSecure/examples/WiFiClientShowPeerCredentials", + "sizes": [{ + "flash_bytes": 877266, + "flash_percentage": 27, + "ram_bytes": 36676, + "ram_percentage": 11 + }] + }, +{"name": "WiFiProv/examples/WiFiProv", + "sizes": [{ + "flash_bytes": 1444508, + "flash_percentage": 45, + "ram_bytes": 55620, + "ram_percentage": 16 + }] + }, +{"name": "Wire/examples/WireMaster", + "sizes": [{ + "flash_bytes": 257648, + "flash_percentage": 8, + "ram_bytes": 13988, + "ram_percentage": 4 + }] + }, +{"name": "Wire/examples/WireScan", + "sizes": [{ + "flash_bytes": 255672, + "flash_percentage": 8, + "ram_bytes": 13924, + "ram_percentage": 4 + }] + }, +{"name": "Wire/examples/WireSlave", + "sizes": [{ + "flash_bytes": 250308, + "flash_percentage": 7, + "ram_bytes": 13916, + "ram_percentage": 4 + }] + } +] +}, +{ "board": "espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32", + "sketches": [ +{"name": "WiFi/examples/WiFiScan", + "sizes": [{ + "flash_bytes": 734289, + "flash_percentage": 23, + "ram_bytes": 43348, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiScanDualAntenna", + "sizes": [{ + "flash_bytes": 735285, + "flash_percentage": 23, + "ram_bytes": 43348, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiSmartConfig", + "sizes": [{ + "flash_bytes": 770425, + "flash_percentage": 24, + "ram_bytes": 43664, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiTelnetToSerial", + "sizes": [{ + "flash_bytes": 753097, + "flash_percentage": 23, + "ram_bytes": 44708, + "ram_percentage": 13 + }] + }, +{"name": "WiFi/examples/WiFiUDPClient", + "sizes": [{ + "flash_bytes": 742617, + "flash_percentage": 23, + "ram_bytes": 44988, + "ram_percentage": 13 + }] + }, +{"name": "WiFiClientSecure/examples/WiFiClientInsecure", + "sizes": [{ + "flash_bytes": 877873, + "flash_percentage": 27, + "ram_bytes": 45612, + "ram_percentage": 13 + }] + }, +{"name": "WiFiClientSecure/examples/WiFiClientPSK", + "sizes": [{ + "flash_bytes": 877989, + "flash_percentage": 27, + "ram_bytes": 45620, + "ram_percentage": 13 + }] + }, +{"name": "WiFiClientSecure/examples/WiFiClientSecure", + "sizes": [{ + "flash_bytes": 879085, + "flash_percentage": 27, + "ram_bytes": 45612, + "ram_percentage": 13 + }] + }, +{"name": "WiFiClientSecure/examples/WiFiClientSecureEnterprise", + "sizes": [{ + "flash_bytes": 915593, + "flash_percentage": 29, + "ram_bytes": 46084, + "ram_percentage": 14 + }] + }, +{"name": "WiFiClientSecure/examples/WiFiClientShowPeerCredentials", + "sizes": [{ + "flash_bytes": 920025, + "flash_percentage": 29, + "ram_bytes": 46624, + "ram_percentage": 14 + }] + }, +{"name": "WiFiProv/examples/WiFiProv", + "sizes": [{ + "flash_bytes": 1585685, + "flash_percentage": 50, + "ram_bytes": 56432, + "ram_percentage": 17 + }] + } +] +} +]} diff --git a/v2.x_cli_compile/cli_compile_14.json b/v2.x_cli_compile/cli_compile_14.json new file mode 100644 index 00000000000..22a3b4bc22d --- /dev/null +++ b/v2.x_cli_compile/cli_compile_14.json @@ -0,0 +1,84 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32s2", + "sketches": [ +{"name": "WiFiClientSecure/examples/WiFiClientSecureEnterprise", + "sizes": [{ + "flash_bytes": 829754, + "flash_percentage": 26, + "ram_bytes": 38064, + "ram_percentage": 11 + }] + }, +{"name": "WiFiClientSecure/examples/WiFiClientShowPeerCredentials", + "sizes": [{ + "flash_bytes": 833762, + "flash_percentage": 26, + "ram_bytes": 37624, + "ram_percentage": 11 + }] + }, +{"name": "WiFiProv/examples/WiFiProv", + "sizes": [{ + "flash_bytes": 764982, + "flash_percentage": 24, + "ram_bytes": 35452, + "ram_percentage": 10 + }] + }, +{"name": "Wire/examples/WireMaster", + "sizes": [{ + "flash_bytes": 250942, + "flash_percentage": 7, + "ram_bytes": 14920, + "ram_percentage": 4 + }] + }, +{"name": "Wire/examples/WireScan", + "sizes": [{ + "flash_bytes": 249274, + "flash_percentage": 7, + "ram_bytes": 14856, + "ram_percentage": 4 + }] + }, +{"name": "Wire/examples/WireSlave", + "sizes": [{ + "flash_bytes": 244174, + "flash_percentage": 7, + "ram_bytes": 14848, + "ram_percentage": 4 + }] + } +] +}, +{ "board": "espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32", + "sketches": [ +{"name": "Wire/examples/WireMaster", + "sizes": [{ + "flash_bytes": 295169, + "flash_percentage": 9, + "ram_bytes": 21872, + "ram_percentage": 6 + }] + }, +{"name": "Wire/examples/WireScan", + "sizes": [{ + "flash_bytes": 293413, + "flash_percentage": 9, + "ram_bytes": 21800, + "ram_percentage": 6 + }] + }, +{"name": "Wire/examples/WireSlave", + "sizes": [{ + "flash_bytes": 287861, + "flash_percentage": 9, + "ram_bytes": 21800, + "ram_percentage": 6 + }] + } +] +} +]} diff --git a/v2.x_cli_compile/cli_compile_2.json b/v2.x_cli_compile/cli_compile_2.json new file mode 100644 index 00000000000..04770dd8d9a --- /dev/null +++ b/v2.x_cli_compile/cli_compile_2.json @@ -0,0 +1,366 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32s3:PSRAM=opi,USBMode=default,PartitionScheme=huge_app", + "target": "esp32s3", + "sketches": [ +{"name": "ESP32/examples/AnalogOut/LEDCSoftwareFade", + "sizes": [{ + "flash_bytes": 242345, + "flash_percentage": 7, + "ram_bytes": 18264, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/AnalogOut/SigmaDelta", + "sizes": [{ + "flash_bytes": 238709, + "flash_percentage": 7, + "ram_bytes": 18248, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/AnalogOut/ledcFrequency", + "sizes": [{ + "flash_bytes": 253901, + "flash_percentage": 8, + "ram_bytes": 18344, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/AnalogOut/ledcWrite_RGB", + "sizes": [{ + "flash_bytes": 268637, + "flash_percentage": 8, + "ram_bytes": 18632, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/AnalogRead", + "sizes": [{ + "flash_bytes": 273853, + "flash_percentage": 8, + "ram_bytes": 18920, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/ArduinoStackSize", + "sizes": [{ + "flash_bytes": 263089, + "flash_percentage": 8, + "ram_bytes": 18544, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/CI/CIBoardsTest", + "sizes": [{ + "flash_bytes": 291357, + "flash_percentage": 9, + "ram_bytes": 19376, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/Camera/CameraWebServer", + "sizes": [{ + "flash_bytes": 2967053, + "flash_percentage": 94, + "ram_bytes": 71596, + "ram_percentage": 21 + }] + }, +{"name": "ESP32/examples/ChipID/GetChipID", + "sizes": [{ + "flash_bytes": 264625, + "flash_percentage": 8, + "ram_bytes": 18580, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/DeepSleep/ExternalWakeUp", + "sizes": [{ + "flash_bytes": 278557, + "flash_percentage": 8, + "ram_bytes": 19492, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/DeepSleep/TimerWakeUp", + "sizes": [{ + "flash_bytes": 278701, + "flash_percentage": 8, + "ram_bytes": 19492, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/DeepSleep/TouchWakeUp", + "sizes": [{ + "flash_bytes": 284889, + "flash_percentage": 9, + "ram_bytes": 19772, + "ram_percentage": 6 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32s2", + "sketches": [ +{"name": "ESP32/examples/DeepSleep/TouchWakeUp", + "sizes": [{ + "flash_bytes": 263422, + "flash_percentage": 8, + "ram_bytes": 18056, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/ESPNow/ESPNow_Basic_Master", + "sizes": [{ + "flash_bytes": 688810, + "flash_percentage": 21, + "ram_bytes": 35496, + "ram_percentage": 10 + }] + }, +{"name": "ESP32/examples/ESPNow/ESPNow_Basic_Slave", + "sizes": [{ + "flash_bytes": 656806, + "flash_percentage": 20, + "ram_bytes": 35436, + "ram_percentage": 10 + }] + }, +{"name": "ESP32/examples/ESPNow/ESPNow_MultiSlave_Master", + "sizes": [{ + "flash_bytes": 688094, + "flash_percentage": 21, + "ram_bytes": 36184, + "ram_percentage": 11 + }] + }, +{"name": "ESP32/examples/ESPNow/ESPNow_MultiSlave_Slave", + "sizes": [{ + "flash_bytes": 656914, + "flash_percentage": 20, + "ram_bytes": 35436, + "ram_percentage": 10 + }] + }, +{"name": "ESP32/examples/FreeRTOS/BasicMultiThreading", + "sizes": [{ + "flash_bytes": 253062, + "flash_percentage": 8, + "ram_bytes": 15024, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Mutex", + "sizes": [{ + "flash_bytes": 237138, + "flash_percentage": 7, + "ram_bytes": 14536, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Queue", + "sizes": [{ + "flash_bytes": 236906, + "flash_percentage": 7, + "ram_bytes": 14528, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Semaphore", + "sizes": [{ + "flash_bytes": 236258, + "flash_percentage": 7, + "ram_bytes": 14528, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/GPIO/BlinkRGB", + "sizes": [{ + "flash_bytes": 209654, + "flash_percentage": 6, + "ram_bytes": 14544, + "ram_percentage": 4 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3:PartitionScheme=huge_app", + "target": "esp32c3", + "sketches": [ +{"name": "DNSServer/examples/CaptivePortal", + "sizes": [{ + "flash_bytes": 698876, + "flash_percentage": 22, + "ram_bytes": 35876, + "ram_percentage": 10 + }] + }, +{"name": "EEPROM/examples/eeprom_class", + "sizes": [{ + "flash_bytes": 264286, + "flash_percentage": 8, + "ram_bytes": 13900, + "ram_percentage": 4 + }] + }, +{"name": "EEPROM/examples/eeprom_extra", + "sizes": [{ + "flash_bytes": 266024, + "flash_percentage": 8, + "ram_bytes": 13836, + "ram_percentage": 4 + }] + }, +{"name": "EEPROM/examples/eeprom_write", + "sizes": [{ + "flash_bytes": 245826, + "flash_percentage": 7, + "ram_bytes": 13724, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/AnalogOut/LEDCSoftwareFade", + "sizes": [{ + "flash_bytes": 224888, + "flash_percentage": 7, + "ram_bytes": 13492, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/AnalogOut/SigmaDelta", + "sizes": [{ + "flash_bytes": 221018, + "flash_percentage": 7, + "ram_bytes": 13476, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/AnalogOut/ledcFrequency", + "sizes": [{ + "flash_bytes": 227380, + "flash_percentage": 7, + "ram_bytes": 13532, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/AnalogOut/ledcWrite_RGB", + "sizes": [{ + "flash_bytes": 249166, + "flash_percentage": 7, + "ram_bytes": 13748, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/AnalogRead", + "sizes": [{ + "flash_bytes": 248742, + "flash_percentage": 7, + "ram_bytes": 13836, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/ArduinoStackSize", + "sizes": [{ + "flash_bytes": 243042, + "flash_percentage": 7, + "ram_bytes": 13692, + "ram_percentage": 4 + }] + } +] +}, +{ "board": "espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32", + "sketches": [ +{"name": "BluetoothSerial/examples/bt_remove_paired_devices", + "sizes": [{ + "flash_bytes": 1090293, + "flash_percentage": 34, + "ram_bytes": 39168, + "ram_percentage": 11 + }] + }, +{"name": "DNSServer/examples/CaptivePortal", + "sizes": [{ + "flash_bytes": 728341, + "flash_percentage": 23, + "ram_bytes": 44668, + "ram_percentage": 13 + }] + }, +{"name": "EEPROM/examples/eeprom_class", + "sizes": [{ + "flash_bytes": 288981, + "flash_percentage": 9, + "ram_bytes": 21568, + "ram_percentage": 6 + }] + }, +{"name": "EEPROM/examples/eeprom_extra", + "sizes": [{ + "flash_bytes": 291089, + "flash_percentage": 9, + "ram_bytes": 21512, + "ram_percentage": 6 + }] + }, +{"name": "EEPROM/examples/eeprom_write", + "sizes": [{ + "flash_bytes": 287469, + "flash_percentage": 9, + "ram_bytes": 21620, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogOut/LEDCSoftwareFade", + "sizes": [{ + "flash_bytes": 256305, + "flash_percentage": 8, + "ram_bytes": 21216, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogOut/SigmaDelta", + "sizes": [{ + "flash_bytes": 252253, + "flash_percentage": 8, + "ram_bytes": 21152, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogOut/ledcFrequency", + "sizes": [{ + "flash_bytes": 267993, + "flash_percentage": 8, + "ram_bytes": 21288, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogOut/ledcWrite_RGB", + "sizes": [{ + "flash_bytes": 285697, + "flash_percentage": 9, + "ram_bytes": 21584, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/AnalogRead", + "sizes": [{ + "flash_bytes": 288073, + "flash_percentage": 9, + "ram_bytes": 21648, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/ArduinoStackSize", + "sizes": [{ + "flash_bytes": 279625, + "flash_percentage": 8, + "ram_bytes": 21472, + "ram_percentage": 6 + }] + } +] +} +]} diff --git a/v2.x_cli_compile/cli_compile_3.json b/v2.x_cli_compile/cli_compile_3.json new file mode 100644 index 00000000000..cf0a1d57d8b --- /dev/null +++ b/v2.x_cli_compile/cli_compile_3.json @@ -0,0 +1,366 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32s3:PSRAM=opi,USBMode=default,PartitionScheme=huge_app", + "target": "esp32s3", + "sketches": [ +{"name": "ESP32/examples/ESPNow/ESPNow_Basic_Master", + "sizes": [{ + "flash_bytes": 712225, + "flash_percentage": 22, + "ram_bytes": 40360, + "ram_percentage": 12 + }] + }, +{"name": "ESP32/examples/ESPNow/ESPNow_Basic_Slave", + "sizes": [{ + "flash_bytes": 679693, + "flash_percentage": 21, + "ram_bytes": 40308, + "ram_percentage": 12 + }] + }, +{"name": "ESP32/examples/ESPNow/ESPNow_MultiSlave_Master", + "sizes": [{ + "flash_bytes": 711545, + "flash_percentage": 22, + "ram_bytes": 41048, + "ram_percentage": 12 + }] + }, +{"name": "ESP32/examples/ESPNow/ESPNow_MultiSlave_Slave", + "sizes": [{ + "flash_bytes": 679805, + "flash_percentage": 21, + "ram_bytes": 40308, + "ram_percentage": 12 + }] + }, +{"name": "ESP32/examples/FreeRTOS/BasicMultiThreading", + "sizes": [{ + "flash_bytes": 281305, + "flash_percentage": 8, + "ram_bytes": 19376, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Mutex", + "sizes": [{ + "flash_bytes": 263821, + "flash_percentage": 8, + "ram_bytes": 18576, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Queue", + "sizes": [{ + "flash_bytes": 263877, + "flash_percentage": 8, + "ram_bytes": 18552, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Semaphore", + "sizes": [{ + "flash_bytes": 263329, + "flash_percentage": 8, + "ram_bytes": 18552, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/GPIO/BlinkRGB", + "sizes": [{ + "flash_bytes": 250625, + "flash_percentage": 7, + "ram_bytes": 18640, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/GPIO/FunctionalInterrupt", + "sizes": [{ + "flash_bytes": 268089, + "flash_percentage": 8, + "ram_bytes": 19176, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/GPIO/FunctionalInterruptStruct", + "sizes": [{ + "flash_bytes": 266585, + "flash_percentage": 8, + "ram_bytes": 19168, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/GPIO/GPIOInterrupt", + "sizes": [{ + "flash_bytes": 267241, + "flash_percentage": 8, + "ram_bytes": 19176, + "ram_percentage": 5 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32s2", + "sketches": [ +{"name": "ESP32/examples/GPIO/FunctionalInterrupt", + "sizes": [{ + "flash_bytes": 240978, + "flash_percentage": 7, + "ram_bytes": 15120, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/GPIO/FunctionalInterruptStruct", + "sizes": [{ + "flash_bytes": 239498, + "flash_percentage": 7, + "ram_bytes": 15128, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/GPIO/GPIOInterrupt", + "sizes": [{ + "flash_bytes": 240150, + "flash_percentage": 7, + "ram_bytes": 15128, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/RMT/RMTCallback", + "sizes": [{ + "flash_bytes": 243746, + "flash_percentage": 7, + "ram_bytes": 14824, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/RMT/RMTLoopback", + "sizes": [{ + "flash_bytes": 245994, + "flash_percentage": 7, + "ram_bytes": 16832, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/RMT/RMTReadXJT", + "sizes": [{ + "flash_bytes": 244178, + "flash_percentage": 7, + "ram_bytes": 14888, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/RMT/RMTWriteNeoPixel", + "sizes": [{ + "flash_bytes": 243694, + "flash_percentage": 7, + "ram_bytes": 17872, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/ResetReason", + "sizes": [{ + "flash_bytes": 257594, + "flash_percentage": 8, + "ram_bytes": 17768, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/Serial/OnReceiveError_BREAK_Demo", + "sizes": [{ + "flash_bytes": 238886, + "flash_percentage": 7, + "ram_bytes": 14568, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Serial/OnReceive_Demo", + "sizes": [{ + "flash_bytes": 237706, + "flash_percentage": 7, + "ram_bytes": 14536, + "ram_percentage": 4 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3:PartitionScheme=huge_app", + "target": "esp32c3", + "sketches": [ +{"name": "ESP32/examples/CI/CIBoardsTest", + "sizes": [{ + "flash_bytes": 268090, + "flash_percentage": 8, + "ram_bytes": 14212, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/ChipID/GetChipID", + "sizes": [{ + "flash_bytes": 243722, + "flash_percentage": 7, + "ram_bytes": 13728, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/DeepSleep/TimerWakeUp", + "sizes": [{ + "flash_bytes": 257176, + "flash_percentage": 8, + "ram_bytes": 14720, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/ESPNow/ESPNow_Basic_Master", + "sizes": [{ + "flash_bytes": 736754, + "flash_percentage": 23, + "ram_bytes": 34548, + "ram_percentage": 10 + }] + }, +{"name": "ESP32/examples/ESPNow/ESPNow_Basic_Slave", + "sizes": [{ + "flash_bytes": 703450, + "flash_percentage": 22, + "ram_bytes": 34500, + "ram_percentage": 10 + }] + }, +{"name": "ESP32/examples/ESPNow/ESPNow_MultiSlave_Master", + "sizes": [{ + "flash_bytes": 735584, + "flash_percentage": 23, + "ram_bytes": 35244, + "ram_percentage": 10 + }] + }, +{"name": "ESP32/examples/ESPNow/ESPNow_MultiSlave_Slave", + "sizes": [{ + "flash_bytes": 703750, + "flash_percentage": 22, + "ram_bytes": 34500, + "ram_percentage": 10 + }] + }, +{"name": "ESP32/examples/FreeRTOS/BasicMultiThreading", + "sizes": [{ + "flash_bytes": 255990, + "flash_percentage": 8, + "ram_bytes": 14060, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Mutex", + "sizes": [{ + "flash_bytes": 243776, + "flash_percentage": 7, + "ram_bytes": 13708, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Queue", + "sizes": [{ + "flash_bytes": 243862, + "flash_percentage": 7, + "ram_bytes": 13692, + "ram_percentage": 4 + }] + } +] +}, +{ "board": "espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32", + "sketches": [ +{"name": "ESP32/examples/CI/CIBoardsTest", + "sizes": [{ + "flash_bytes": 298857, + "flash_percentage": 9, + "ram_bytes": 21880, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Camera/CameraWebServer", + "sizes": [{ + "flash_bytes": 1517793, + "flash_percentage": 48, + "ram_bytes": 71228, + "ram_percentage": 21 + }] + }, +{"name": "ESP32/examples/ChipID/GetChipID", + "sizes": [{ + "flash_bytes": 281809, + "flash_percentage": 8, + "ram_bytes": 21516, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/DeepSleep/ExternalWakeUp", + "sizes": [{ + "flash_bytes": 296449, + "flash_percentage": 9, + "ram_bytes": 22792, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/DeepSleep/SmoothBlink_ULP_Code", + "sizes": [{ + "flash_bytes": 299281, + "flash_percentage": 9, + "ram_bytes": 22792, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/DeepSleep/TimerWakeUp", + "sizes": [{ + "flash_bytes": 296425, + "flash_percentage": 9, + "ram_bytes": 22792, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/DeepSleep/TouchWakeUp", + "sizes": [{ + "flash_bytes": 305029, + "flash_percentage": 9, + "ram_bytes": 23304, + "ram_percentage": 7 + }] + }, +{"name": "ESP32/examples/ESPNow/ESPNow_Basic_Master", + "sizes": [{ + "flash_bytes": 772993, + "flash_percentage": 24, + "ram_bytes": 43484, + "ram_percentage": 13 + }] + }, +{"name": "ESP32/examples/ESPNow/ESPNow_Basic_Slave", + "sizes": [{ + "flash_bytes": 738261, + "flash_percentage": 23, + "ram_bytes": 43424, + "ram_percentage": 13 + }] + }, +{"name": "ESP32/examples/ESPNow/ESPNow_MultiSlave_Master", + "sizes": [{ + "flash_bytes": 772257, + "flash_percentage": 24, + "ram_bytes": 44172, + "ram_percentage": 13 + }] + }, +{"name": "ESP32/examples/ESPNow/ESPNow_MultiSlave_Slave", + "sizes": [{ + "flash_bytes": 738353, + "flash_percentage": 23, + "ram_bytes": 43424, + "ram_percentage": 13 + }] + } +] +} +]} diff --git a/v2.x_cli_compile/cli_compile_4.json b/v2.x_cli_compile/cli_compile_4.json new file mode 100644 index 00000000000..5124bd62660 --- /dev/null +++ b/v2.x_cli_compile/cli_compile_4.json @@ -0,0 +1,366 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32s3:PSRAM=opi,USBMode=default,PartitionScheme=huge_app", + "target": "esp32s3", + "sketches": [ +{"name": "ESP32/examples/HWCDC_Events", + "sizes": [{ + "flash_bytes": 235717, + "flash_percentage": 7, + "ram_bytes": 18168, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/RMT/RMTCallback", + "sizes": [{ + "flash_bytes": 272793, + "flash_percentage": 8, + "ram_bytes": 19040, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/RMT/RMTLoopback", + "sizes": [{ + "flash_bytes": 275249, + "flash_percentage": 8, + "ram_bytes": 21048, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/RMT/RMTReadXJT", + "sizes": [{ + "flash_bytes": 273217, + "flash_percentage": 8, + "ram_bytes": 19088, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/RMT/RMTWriteNeoPixel", + "sizes": [{ + "flash_bytes": 272317, + "flash_percentage": 8, + "ram_bytes": 22072, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/ResetReason", + "sizes": [{ + "flash_bytes": 278781, + "flash_percentage": 8, + "ram_bytes": 19484, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/Serial/OnReceiveError_BREAK_Demo", + "sizes": [{ + "flash_bytes": 265845, + "flash_percentage": 8, + "ram_bytes": 18584, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/Serial/OnReceive_Demo", + "sizes": [{ + "flash_bytes": 264661, + "flash_percentage": 8, + "ram_bytes": 18552, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/Serial/RxFIFOFull_Demo", + "sizes": [{ + "flash_bytes": 264013, + "flash_percentage": 8, + "ram_bytes": 18544, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/Serial/RxTimeout_Demo", + "sizes": [{ + "flash_bytes": 263857, + "flash_percentage": 8, + "ram_bytes": 18560, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/Serial/Serial_All_CPU_Freqs", + "sizes": [{ + "flash_bytes": 263973, + "flash_percentage": 8, + "ram_bytes": 18576, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/Serial/Serial_STD_Func_OnReceive", + "sizes": [{ + "flash_bytes": 264465, + "flash_percentage": 8, + "ram_bytes": 18544, + "ram_percentage": 5 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32s2", + "sketches": [ +{"name": "ESP32/examples/Serial/RxFIFOFull_Demo", + "sizes": [{ + "flash_bytes": 237062, + "flash_percentage": 7, + "ram_bytes": 14528, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Serial/RxTimeout_Demo", + "sizes": [{ + "flash_bytes": 236878, + "flash_percentage": 7, + "ram_bytes": 14528, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Serial/Serial_All_CPU_Freqs", + "sizes": [{ + "flash_bytes": 236886, + "flash_percentage": 7, + "ram_bytes": 14536, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Serial/Serial_STD_Func_OnReceive", + "sizes": [{ + "flash_bytes": 237802, + "flash_percentage": 7, + "ram_bytes": 14528, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/TWAI/TWAIreceive", + "sizes": [{ + "flash_bytes": 242086, + "flash_percentage": 7, + "ram_bytes": 14552, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/TWAI/TWAItransmit", + "sizes": [{ + "flash_bytes": 242598, + "flash_percentage": 7, + "ram_bytes": 14560, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Template/ExampleTemplate", + "sizes": [{ + "flash_bytes": 196166, + "flash_percentage": 6, + "ram_bytes": 14248, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Time/SimpleTime", + "sizes": [{ + "flash_bytes": 678354, + "flash_percentage": 21, + "ram_bytes": 36784, + "ram_percentage": 11 + }] + }, +{"name": "ESP32/examples/Timer/RepeatTimer", + "sizes": [{ + "flash_bytes": 228974, + "flash_percentage": 7, + "ram_bytes": 14592, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Timer/WatchdogTimer", + "sizes": [{ + "flash_bytes": 228606, + "flash_percentage": 7, + "ram_bytes": 14576, + "ram_percentage": 4 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3:PartitionScheme=huge_app", + "target": "esp32c3", + "sketches": [ +{"name": "ESP32/examples/FreeRTOS/Semaphore", + "sizes": [{ + "flash_bytes": 243220, + "flash_percentage": 7, + "ram_bytes": 13692, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/GPIO/BlinkRGB", + "sizes": [{ + "flash_bytes": 232886, + "flash_percentage": 7, + "ram_bytes": 13684, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/GPIO/FunctionalInterrupt", + "sizes": [{ + "flash_bytes": 246928, + "flash_percentage": 7, + "ram_bytes": 13980, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/GPIO/FunctionalInterruptStruct", + "sizes": [{ + "flash_bytes": 246388, + "flash_percentage": 7, + "ram_bytes": 13972, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/GPIO/GPIOInterrupt", + "sizes": [{ + "flash_bytes": 247024, + "flash_percentage": 7, + "ram_bytes": 13980, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/HWCDC_Events", + "sizes": [{ + "flash_bytes": 261638, + "flash_percentage": 8, + "ram_bytes": 14076, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/RMT/RMTCallback", + "sizes": [{ + "flash_bytes": 252396, + "flash_percentage": 8, + "ram_bytes": 13972, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/RMT/RMTLoopback", + "sizes": [{ + "flash_bytes": 255006, + "flash_percentage": 8, + "ram_bytes": 15988, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/RMT/RMTReadXJT", + "sizes": [{ + "flash_bytes": 252918, + "flash_percentage": 8, + "ram_bytes": 14020, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/RMT/RMTWriteNeoPixel", + "sizes": [{ + "flash_bytes": 251926, + "flash_percentage": 8, + "ram_bytes": 17012, + "ram_percentage": 5 + }] + } +] +}, +{ "board": "espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32", + "sketches": [ +{"name": "ESP32/examples/FreeRTOS/BasicMultiThreading", + "sizes": [{ + "flash_bytes": 286609, + "flash_percentage": 9, + "ram_bytes": 21656, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Mutex", + "sizes": [{ + "flash_bytes": 280717, + "flash_percentage": 8, + "ram_bytes": 21588, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Queue", + "sizes": [{ + "flash_bytes": 280429, + "flash_percentage": 8, + "ram_bytes": 21472, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/FreeRTOS/Semaphore", + "sizes": [{ + "flash_bytes": 279865, + "flash_percentage": 8, + "ram_bytes": 21472, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/GPIO/BlinkRGB", + "sizes": [{ + "flash_bytes": 248525, + "flash_percentage": 7, + "ram_bytes": 21040, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/GPIO/FunctionalInterrupt", + "sizes": [{ + "flash_bytes": 284697, + "flash_percentage": 9, + "ram_bytes": 21976, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/GPIO/FunctionalInterruptStruct", + "sizes": [{ + "flash_bytes": 283161, + "flash_percentage": 9, + "ram_bytes": 21968, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/GPIO/GPIOInterrupt", + "sizes": [{ + "flash_bytes": 283833, + "flash_percentage": 9, + "ram_bytes": 21976, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/HallSensor", + "sizes": [{ + "flash_bytes": 284369, + "flash_percentage": 9, + "ram_bytes": 21480, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/I2S/HiFreq_ADC", + "sizes": [{ + "flash_bytes": 303785, + "flash_percentage": 9, + "ram_bytes": 21616, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/RMT/RMTCallback", + "sizes": [{ + "flash_bytes": 287729, + "flash_percentage": 9, + "ram_bytes": 21976, + "ram_percentage": 6 + }] + } +] +} +]} diff --git a/v2.x_cli_compile/cli_compile_5.json b/v2.x_cli_compile/cli_compile_5.json new file mode 100644 index 00000000000..65fa35be282 --- /dev/null +++ b/v2.x_cli_compile/cli_compile_5.json @@ -0,0 +1,366 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32s3:PSRAM=opi,USBMode=default,PartitionScheme=huge_app", + "target": "esp32s3", + "sketches": [ +{"name": "ESP32/examples/TWAI/TWAIreceive", + "sizes": [{ + "flash_bytes": 269105, + "flash_percentage": 8, + "ram_bytes": 18576, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/TWAI/TWAItransmit", + "sizes": [{ + "flash_bytes": 269429, + "flash_percentage": 8, + "ram_bytes": 18584, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/Template/ExampleTemplate", + "sizes": [{ + "flash_bytes": 235717, + "flash_percentage": 7, + "ram_bytes": 18168, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/Time/SimpleTime", + "sizes": [{ + "flash_bytes": 701753, + "flash_percentage": 22, + "ram_bytes": 41640, + "ram_percentage": 12 + }] + }, +{"name": "ESP32/examples/Timer/RepeatTimer", + "sizes": [{ + "flash_bytes": 270801, + "flash_percentage": 8, + "ram_bytes": 18624, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/Timer/WatchdogTimer", + "sizes": [{ + "flash_bytes": 270381, + "flash_percentage": 8, + "ram_bytes": 18600, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/Touch/TouchButtonV2", + "sizes": [{ + "flash_bytes": 268945, + "flash_percentage": 8, + "ram_bytes": 18856, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/Touch/TouchInterrupt", + "sizes": [{ + "flash_bytes": 268845, + "flash_percentage": 8, + "ram_bytes": 18856, + "ram_percentage": 5 + }] + }, +{"name": "ESP32/examples/Touch/TouchRead", + "sizes": [{ + "flash_bytes": 269041, + "flash_percentage": 8, + "ram_bytes": 18832, + "ram_percentage": 5 + }] + }, +{"name": "ESPmDNS/examples/mDNS-SD_Extended", + "sizes": [{ + "flash_bytes": 700313, + "flash_percentage": 22, + "ram_bytes": 42152, + "ram_percentage": 12 + }] + }, +{"name": "ESPmDNS/examples/mDNS_Web_Server", + "sizes": [{ + "flash_bytes": 716257, + "flash_percentage": 22, + "ram_bytes": 43440, + "ram_percentage": 13 + }] + }, +{"name": "FFat/examples/FFat_Test", + "sizes": [{ + "flash_bytes": 318437, + "flash_percentage": 10, + "ram_bytes": 19292, + "ram_percentage": 5 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32s2", + "sketches": [ +{"name": "ESP32/examples/Touch/TouchButtonV2", + "sizes": [{ + "flash_bytes": 227110, + "flash_percentage": 7, + "ram_bytes": 14824, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Touch/TouchInterrupt", + "sizes": [{ + "flash_bytes": 227010, + "flash_percentage": 7, + "ram_bytes": 14824, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Touch/TouchRead", + "sizes": [{ + "flash_bytes": 227170, + "flash_percentage": 7, + "ram_bytes": 14816, + "ram_percentage": 4 + }] + }, +{"name": "ESPmDNS/examples/mDNS-SD_Extended", + "sizes": [{ + "flash_bytes": 677466, + "flash_percentage": 21, + "ram_bytes": 37304, + "ram_percentage": 11 + }] + }, +{"name": "ESPmDNS/examples/mDNS_Web_Server", + "sizes": [{ + "flash_bytes": 693046, + "flash_percentage": 22, + "ram_bytes": 38592, + "ram_percentage": 11 + }] + }, +{"name": "FFat/examples/FFat_Test", + "sizes": [{ + "flash_bytes": 291278, + "flash_percentage": 9, + "ram_bytes": 15268, + "ram_percentage": 4 + }] + }, +{"name": "FFat/examples/FFat_time", + "sizes": [{ + "flash_bytes": 714470, + "flash_percentage": 22, + "ram_bytes": 36908, + "ram_percentage": 11 + }] + }, +{"name": "HTTPClient/examples/Authorization", + "sizes": [{ + "flash_bytes": 831282, + "flash_percentage": 26, + "ram_bytes": 37656, + "ram_percentage": 11 + }] + }, +{"name": "HTTPClient/examples/BasicHttpClient", + "sizes": [{ + "flash_bytes": 831274, + "flash_percentage": 26, + "ram_bytes": 37656, + "ram_percentage": 11 + }] + }, +{"name": "HTTPClient/examples/BasicHttpsClient", + "sizes": [{ + "flash_bytes": 836662, + "flash_percentage": 26, + "ram_bytes": 37688, + "ram_percentage": 11 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3:PartitionScheme=huge_app", + "target": "esp32c3", + "sketches": [ +{"name": "ESP32/examples/ResetReason", + "sizes": [{ + "flash_bytes": 257350, + "flash_percentage": 8, + "ram_bytes": 14720, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Serial/OnReceiveError_BREAK_Demo", + "sizes": [{ + "flash_bytes": 246020, + "flash_percentage": 7, + "ram_bytes": 13724, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Serial/OnReceive_Demo", + "sizes": [{ + "flash_bytes": 244732, + "flash_percentage": 7, + "ram_bytes": 13700, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Serial/RxFIFOFull_Demo", + "sizes": [{ + "flash_bytes": 244158, + "flash_percentage": 7, + "ram_bytes": 13692, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Serial/RxTimeout_Demo", + "sizes": [{ + "flash_bytes": 243942, + "flash_percentage": 7, + "ram_bytes": 13700, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Serial/Serial_All_CPU_Freqs", + "sizes": [{ + "flash_bytes": 244150, + "flash_percentage": 7, + "ram_bytes": 13708, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Serial/Serial_STD_Func_OnReceive", + "sizes": [{ + "flash_bytes": 244458, + "flash_percentage": 7, + "ram_bytes": 13692, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/TWAI/TWAIreceive", + "sizes": [{ + "flash_bytes": 248880, + "flash_percentage": 7, + "ram_bytes": 13700, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/TWAI/TWAItransmit", + "sizes": [{ + "flash_bytes": 249204, + "flash_percentage": 7, + "ram_bytes": 13700, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Template/ExampleTemplate", + "sizes": [{ + "flash_bytes": 217764, + "flash_percentage": 6, + "ram_bytes": 13412, + "ram_percentage": 4 + }] + } +] +}, +{ "board": "espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32", + "sketches": [ +{"name": "ESP32/examples/RMT/RMTLoopback", + "sizes": [{ + "flash_bytes": 290085, + "flash_percentage": 9, + "ram_bytes": 23984, + "ram_percentage": 7 + }] + }, +{"name": "ESP32/examples/RMT/RMTReadXJT", + "sizes": [{ + "flash_bytes": 288193, + "flash_percentage": 9, + "ram_bytes": 22024, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/RMT/RMTWriteNeoPixel", + "sizes": [{ + "flash_bytes": 287549, + "flash_percentage": 9, + "ram_bytes": 25024, + "ram_percentage": 7 + }] + }, +{"name": "ESP32/examples/ResetReason", + "sizes": [{ + "flash_bytes": 296533, + "flash_percentage": 9, + "ram_bytes": 22792, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/OnReceiveError_BREAK_Demo", + "sizes": [{ + "flash_bytes": 282477, + "flash_percentage": 8, + "ram_bytes": 21496, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/OnReceive_Demo", + "sizes": [{ + "flash_bytes": 281269, + "flash_percentage": 8, + "ram_bytes": 21480, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/RxFIFOFull_Demo", + "sizes": [{ + "flash_bytes": 280581, + "flash_percentage": 8, + "ram_bytes": 21472, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/RxTimeout_Demo", + "sizes": [{ + "flash_bytes": 280401, + "flash_percentage": 8, + "ram_bytes": 21472, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/Serial_All_CPU_Freqs", + "sizes": [{ + "flash_bytes": 280413, + "flash_percentage": 8, + "ram_bytes": 21488, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Serial/Serial_STD_Func_OnReceive", + "sizes": [{ + "flash_bytes": 281417, + "flash_percentage": 8, + "ram_bytes": 21580, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/TWAI/TWAIreceive", + "sizes": [{ + "flash_bytes": 286217, + "flash_percentage": 9, + "ram_bytes": 21520, + "ram_percentage": 6 + }] + } +] +} +]} diff --git a/v2.x_cli_compile/cli_compile_6.json b/v2.x_cli_compile/cli_compile_6.json new file mode 100644 index 00000000000..9bb544916aa --- /dev/null +++ b/v2.x_cli_compile/cli_compile_6.json @@ -0,0 +1,366 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32s3:PSRAM=opi,USBMode=default,PartitionScheme=huge_app", + "target": "esp32s3", + "sketches": [ +{"name": "FFat/examples/FFat_time", + "sizes": [{ + "flash_bytes": 737869, + "flash_percentage": 23, + "ram_bytes": 41764, + "ram_percentage": 12 + }] + }, +{"name": "HTTPClient/examples/Authorization", + "sizes": [{ + "flash_bytes": 852737, + "flash_percentage": 27, + "ram_bytes": 42512, + "ram_percentage": 12 + }] + }, +{"name": "HTTPClient/examples/BasicHttpClient", + "sizes": [{ + "flash_bytes": 852737, + "flash_percentage": 27, + "ram_bytes": 42512, + "ram_percentage": 12 + }] + }, +{"name": "HTTPClient/examples/BasicHttpsClient", + "sizes": [{ + "flash_bytes": 858141, + "flash_percentage": 27, + "ram_bytes": 42560, + "ram_percentage": 12 + }] + }, +{"name": "HTTPClient/examples/HTTPClientEnterprise", + "sizes": [{ + "flash_bytes": 886677, + "flash_percentage": 28, + "ram_bytes": 42936, + "ram_percentage": 13 + }] + }, +{"name": "HTTPClient/examples/ReuseConnection", + "sizes": [{ + "flash_bytes": 851773, + "flash_percentage": 27, + "ram_bytes": 42704, + "ram_percentage": 13 + }] + }, +{"name": "HTTPClient/examples/StreamHttpClient", + "sizes": [{ + "flash_bytes": 851605, + "flash_percentage": 27, + "ram_bytes": 42512, + "ram_percentage": 12 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdate", + "sizes": [{ + "flash_bytes": 757517, + "flash_percentage": 24, + "ram_bytes": 42380, + "ram_percentage": 12 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdateSPIFFS", + "sizes": [{ + "flash_bytes": 756841, + "flash_percentage": 24, + "ram_bytes": 42380, + "ram_percentage": 12 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdateSecure", + "sizes": [{ + "flash_bytes": 880541, + "flash_percentage": 27, + "ram_bytes": 43324, + "ram_percentage": 13 + }] + }, +{"name": "HTTPUpdateServer/examples/WebUpdater", + "sizes": [{ + "flash_bytes": 768921, + "flash_percentage": 24, + "ram_bytes": 44544, + "ram_percentage": 13 + }] + }, +{"name": "I2S/examples/ADCPlotter", + "sizes": [{ + "flash_bytes": 282029, + "flash_percentage": 8, + "ram_bytes": 18712, + "ram_percentage": 5 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32s2", + "sketches": [ +{"name": "HTTPClient/examples/HTTPClientEnterprise", + "sizes": [{ + "flash_bytes": 864882, + "flash_percentage": 27, + "ram_bytes": 38080, + "ram_percentage": 11 + }] + }, +{"name": "HTTPClient/examples/ReuseConnection", + "sizes": [{ + "flash_bytes": 830258, + "flash_percentage": 26, + "ram_bytes": 37848, + "ram_percentage": 11 + }] + }, +{"name": "HTTPClient/examples/StreamHttpClient", + "sizes": [{ + "flash_bytes": 830106, + "flash_percentage": 26, + "ram_bytes": 37656, + "ram_percentage": 11 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdate", + "sizes": [{ + "flash_bytes": 731334, + "flash_percentage": 23, + "ram_bytes": 37312, + "ram_percentage": 11 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdateSPIFFS", + "sizes": [{ + "flash_bytes": 730674, + "flash_percentage": 23, + "ram_bytes": 37312, + "ram_percentage": 11 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdateSecure", + "sizes": [{ + "flash_bytes": 856254, + "flash_percentage": 27, + "ram_bytes": 38264, + "ram_percentage": 11 + }] + }, +{"name": "HTTPUpdateServer/examples/WebUpdater", + "sizes": [{ + "flash_bytes": 744978, + "flash_percentage": 23, + "ram_bytes": 39520, + "ram_percentage": 12 + }] + }, +{"name": "I2S/examples/ADCPlotter", + "sizes": [{ + "flash_bytes": 237090, + "flash_percentage": 7, + "ram_bytes": 14672, + "ram_percentage": 4 + }] + }, +{"name": "I2S/examples/FullDuplex", + "sizes": [{ + "flash_bytes": 237122, + "flash_percentage": 7, + "ram_bytes": 14672, + "ram_percentage": 4 + }] + }, +{"name": "I2S/examples/InputSerialPlotter", + "sizes": [{ + "flash_bytes": 237098, + "flash_percentage": 7, + "ram_bytes": 14672, + "ram_percentage": 4 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3:PartitionScheme=huge_app", + "target": "esp32c3", + "sketches": [ +{"name": "ESP32/examples/Time/SimpleTime", + "sizes": [{ + "flash_bytes": 726508, + "flash_percentage": 23, + "ram_bytes": 35828, + "ram_percentage": 10 + }] + }, +{"name": "ESP32/examples/Timer/RepeatTimer", + "sizes": [{ + "flash_bytes": 250806, + "flash_percentage": 7, + "ram_bytes": 13724, + "ram_percentage": 4 + }] + }, +{"name": "ESP32/examples/Timer/WatchdogTimer", + "sizes": [{ + "flash_bytes": 250408, + "flash_percentage": 7, + "ram_bytes": 13708, + "ram_percentage": 4 + }] + }, +{"name": "ESPmDNS/examples/mDNS-SD_Extended", + "sizes": [{ + "flash_bytes": 728660, + "flash_percentage": 23, + "ram_bytes": 36348, + "ram_percentage": 11 + }] + }, +{"name": "ESPmDNS/examples/mDNS_Web_Server", + "sizes": [{ + "flash_bytes": 746362, + "flash_percentage": 23, + "ram_bytes": 37628, + "ram_percentage": 11 + }] + }, +{"name": "FFat/examples/FFat_Test", + "sizes": [{ + "flash_bytes": 300304, + "flash_percentage": 9, + "ram_bytes": 14436, + "ram_percentage": 4 + }] + }, +{"name": "FFat/examples/FFat_time", + "sizes": [{ + "flash_bytes": 764694, + "flash_percentage": 24, + "ram_bytes": 35948, + "ram_percentage": 10 + }] + }, +{"name": "HTTPClient/examples/Authorization", + "sizes": [{ + "flash_bytes": 875318, + "flash_percentage": 27, + "ram_bytes": 36700, + "ram_percentage": 11 + }] + }, +{"name": "HTTPClient/examples/BasicHttpClient", + "sizes": [{ + "flash_bytes": 875310, + "flash_percentage": 27, + "ram_bytes": 36700, + "ram_percentage": 11 + }] + }, +{"name": "HTTPClient/examples/BasicHttpsClient", + "sizes": [{ + "flash_bytes": 881022, + "flash_percentage": 28, + "ram_bytes": 36740, + "ram_percentage": 11 + }] + } +] +}, +{ "board": "espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32", + "sketches": [ +{"name": "ESP32/examples/TWAI/TWAItransmit", + "sizes": [{ + "flash_bytes": 286477, + "flash_percentage": 9, + "ram_bytes": 21520, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Template/ExampleTemplate", + "sizes": [{ + "flash_bytes": 248525, + "flash_percentage": 7, + "ram_bytes": 21040, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Time/SimpleTime", + "sizes": [{ + "flash_bytes": 761717, + "flash_percentage": 24, + "ram_bytes": 45916, + "ram_percentage": 14 + }] + }, +{"name": "ESP32/examples/Timer/RepeatTimer", + "sizes": [{ + "flash_bytes": 287233, + "flash_percentage": 9, + "ram_bytes": 21536, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Timer/WatchdogTimer", + "sizes": [{ + "flash_bytes": 286809, + "flash_percentage": 9, + "ram_bytes": 21504, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Touch/TouchButton", + "sizes": [{ + "flash_bytes": 288249, + "flash_percentage": 9, + "ram_bytes": 21976, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Touch/TouchInterrupt", + "sizes": [{ + "flash_bytes": 287429, + "flash_percentage": 9, + "ram_bytes": 21976, + "ram_percentage": 6 + }] + }, +{"name": "ESP32/examples/Touch/TouchRead", + "sizes": [{ + "flash_bytes": 287521, + "flash_percentage": 9, + "ram_bytes": 21976, + "ram_percentage": 6 + }] + }, +{"name": "ESPmDNS/examples/mDNS-SD_Extended", + "sizes": [{ + "flash_bytes": 760809, + "flash_percentage": 24, + "ram_bytes": 45276, + "ram_percentage": 13 + }] + }, +{"name": "ESPmDNS/examples/mDNS_Web_Server", + "sizes": [{ + "flash_bytes": 777689, + "flash_percentage": 24, + "ram_bytes": 46564, + "ram_percentage": 14 + }] + }, +{"name": "Ethernet/examples/ETH_LAN8720", + "sizes": [{ + "flash_bytes": 783325, + "flash_percentage": 24, + "ram_bytes": 44644, + "ram_percentage": 13 + }] + } +] +} +]} diff --git a/v2.x_cli_compile/cli_compile_7.json b/v2.x_cli_compile/cli_compile_7.json new file mode 100644 index 00000000000..fd7e182c50f --- /dev/null +++ b/v2.x_cli_compile/cli_compile_7.json @@ -0,0 +1,366 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32s3:PSRAM=opi,USBMode=default,PartitionScheme=huge_app", + "target": "esp32s3", + "sketches": [ +{"name": "I2S/examples/FullDuplex", + "sizes": [{ + "flash_bytes": 282061, + "flash_percentage": 8, + "ram_bytes": 18720, + "ram_percentage": 5 + }] + }, +{"name": "I2S/examples/InputSerialPlotter", + "sizes": [{ + "flash_bytes": 282037, + "flash_percentage": 8, + "ram_bytes": 18712, + "ram_percentage": 5 + }] + }, +{"name": "I2S/examples/SimpleTone", + "sizes": [{ + "flash_bytes": 282009, + "flash_percentage": 8, + "ram_bytes": 18720, + "ram_percentage": 5 + }] + }, +{"name": "Insights/examples/DiagnosticsSmokeTest", + "sizes": [{ + "flash_bytes": 852253, + "flash_percentage": 27, + "ram_bytes": 44088, + "ram_percentage": 13 + }] + }, +{"name": "Insights/examples/MinimalDiagnostics", + "sizes": [{ + "flash_bytes": 851725, + "flash_percentage": 27, + "ram_bytes": 43968, + "ram_percentage": 13 + }] + }, +{"name": "LittleFS/examples/LITTLEFS_test", + "sizes": [{ + "flash_bytes": 304769, + "flash_percentage": 9, + "ram_bytes": 19096, + "ram_percentage": 5 + }] + }, +{"name": "LittleFS/examples/LITTLEFS_time", + "sizes": [{ + "flash_bytes": 738317, + "flash_percentage": 23, + "ram_bytes": 41680, + "ram_percentage": 12 + }] + }, +{"name": "NetBIOS/examples/ESP_NBNST", + "sizes": [{ + "flash_bytes": 680053, + "flash_percentage": 21, + "ram_bytes": 40296, + "ram_percentage": 12 + }] + }, +{"name": "Preferences/examples/Prefs2Struct", + "sizes": [{ + "flash_bytes": 270653, + "flash_percentage": 8, + "ram_bytes": 18568, + "ram_percentage": 5 + }] + }, +{"name": "Preferences/examples/StartCounter", + "sizes": [{ + "flash_bytes": 271357, + "flash_percentage": 8, + "ram_bytes": 18576, + "ram_percentage": 5 + }] + }, +{"name": "RainMaker/examples/RMakerCustom", + "sizes": [{ + "flash_bytes": 1668329, + "flash_percentage": 53, + "ram_bytes": 66484, + "ram_percentage": 20 + }] + }, +{"name": "RainMaker/examples/RMakerCustomAirCooler", + "sizes": [{ + "flash_bytes": 1655465, + "flash_percentage": 52, + "ram_bytes": 66596, + "ram_percentage": 20 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32s2", + "sketches": [ +{"name": "I2S/examples/SimpleTone", + "sizes": [{ + "flash_bytes": 237074, + "flash_percentage": 7, + "ram_bytes": 14680, + "ram_percentage": 4 + }] + }, +{"name": "Insights/examples/DiagnosticsSmokeTest", + "sizes": [{ + "flash_bytes": 830682, + "flash_percentage": 26, + "ram_bytes": 39216, + "ram_percentage": 11 + }] + }, +{"name": "Insights/examples/MinimalDiagnostics", + "sizes": [{ + "flash_bytes": 830158, + "flash_percentage": 26, + "ram_bytes": 39096, + "ram_percentage": 11 + }] + }, +{"name": "LittleFS/examples/LITTLEFS_test", + "sizes": [{ + "flash_bytes": 278218, + "flash_percentage": 8, + "ram_bytes": 15072, + "ram_percentage": 4 + }] + }, +{"name": "LittleFS/examples/LITTLEFS_time", + "sizes": [{ + "flash_bytes": 715518, + "flash_percentage": 22, + "ram_bytes": 36824, + "ram_percentage": 11 + }] + }, +{"name": "NetBIOS/examples/ESP_NBNST", + "sizes": [{ + "flash_bytes": 657194, + "flash_percentage": 20, + "ram_bytes": 35440, + "ram_percentage": 10 + }] + }, +{"name": "Preferences/examples/Prefs2Struct", + "sizes": [{ + "flash_bytes": 243678, + "flash_percentage": 7, + "ram_bytes": 14552, + "ram_percentage": 4 + }] + }, +{"name": "Preferences/examples/StartCounter", + "sizes": [{ + "flash_bytes": 244394, + "flash_percentage": 7, + "ram_bytes": 14552, + "ram_percentage": 4 + }] + }, +{"name": "RainMaker/examples/RMakerCustom", + "sizes": [{ + "flash_bytes": 1109890, + "flash_percentage": 35, + "ram_bytes": 40412, + "ram_percentage": 12 + }] + }, +{"name": "RainMaker/examples/RMakerCustomAirCooler", + "sizes": [{ + "flash_bytes": 1097046, + "flash_percentage": 34, + "ram_bytes": 40536, + "ram_percentage": 12 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3:PartitionScheme=huge_app", + "target": "esp32c3", + "sketches": [ +{"name": "HTTPClient/examples/HTTPClientEnterprise", + "sizes": [{ + "flash_bytes": 909746, + "flash_percentage": 28, + "ram_bytes": 37044, + "ram_percentage": 11 + }] + }, +{"name": "HTTPClient/examples/ReuseConnection", + "sizes": [{ + "flash_bytes": 874404, + "flash_percentage": 27, + "ram_bytes": 36892, + "ram_percentage": 11 + }] + }, +{"name": "HTTPClient/examples/StreamHttpClient", + "sizes": [{ + "flash_bytes": 874028, + "flash_percentage": 27, + "ram_bytes": 36700, + "ram_percentage": 11 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdate", + "sizes": [{ + "flash_bytes": 771178, + "flash_percentage": 24, + "ram_bytes": 36324, + "ram_percentage": 11 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdateSPIFFS", + "sizes": [{ + "flash_bytes": 770794, + "flash_percentage": 24, + "ram_bytes": 36324, + "ram_percentage": 11 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdateSecure", + "sizes": [{ + "flash_bytes": 901396, + "flash_percentage": 28, + "ram_bytes": 37284, + "ram_percentage": 11 + }] + }, +{"name": "HTTPUpdateServer/examples/WebUpdater", + "sizes": [{ + "flash_bytes": 796606, + "flash_percentage": 25, + "ram_bytes": 38540, + "ram_percentage": 11 + }] + }, +{"name": "Insights/examples/DiagnosticsSmokeTest", + "sizes": [{ + "flash_bytes": 890348, + "flash_percentage": 28, + "ram_bytes": 38260, + "ram_percentage": 11 + }] + }, +{"name": "Insights/examples/MinimalDiagnostics", + "sizes": [{ + "flash_bytes": 889830, + "flash_percentage": 28, + "ram_bytes": 38148, + "ram_percentage": 11 + }] + }, +{"name": "LittleFS/examples/LITTLEFS_test", + "sizes": [{ + "flash_bytes": 289886, + "flash_percentage": 9, + "ram_bytes": 14236, + "ram_percentage": 4 + }] + } +] +}, +{ "board": "espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32", + "sketches": [ +{"name": "Ethernet/examples/ETH_TLK110", + "sizes": [{ + "flash_bytes": 783329, + "flash_percentage": 24, + "ram_bytes": 44644, + "ram_percentage": 13 + }] + }, +{"name": "FFat/examples/FFat_Test", + "sizes": [{ + "flash_bytes": 337917, + "flash_percentage": 10, + "ram_bytes": 22480, + "ram_percentage": 6 + }] + }, +{"name": "FFat/examples/FFat_time", + "sizes": [{ + "flash_bytes": 799617, + "flash_percentage": 25, + "ram_bytes": 45252, + "ram_percentage": 13 + }] + }, +{"name": "HTTPClient/examples/Authorization", + "sizes": [{ + "flash_bytes": 917653, + "flash_percentage": 29, + "ram_bytes": 46648, + "ram_percentage": 14 + }] + }, +{"name": "HTTPClient/examples/BasicHttpClient", + "sizes": [{ + "flash_bytes": 917637, + "flash_percentage": 29, + "ram_bytes": 46648, + "ram_percentage": 14 + }] + }, +{"name": "HTTPClient/examples/BasicHttpsClient", + "sizes": [{ + "flash_bytes": 923193, + "flash_percentage": 29, + "ram_bytes": 46848, + "ram_percentage": 14 + }] + }, +{"name": "HTTPClient/examples/HTTPClientEnterprise", + "sizes": [{ + "flash_bytes": 952337, + "flash_percentage": 30, + "ram_bytes": 47088, + "ram_percentage": 14 + }] + }, +{"name": "HTTPClient/examples/ReuseConnection", + "sizes": [{ + "flash_bytes": 916593, + "flash_percentage": 29, + "ram_bytes": 46840, + "ram_percentage": 14 + }] + }, +{"name": "HTTPClient/examples/StreamHttpClient", + "sizes": [{ + "flash_bytes": 916417, + "flash_percentage": 29, + "ram_bytes": 46648, + "ram_percentage": 14 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdate", + "sizes": [{ + "flash_bytes": 808953, + "flash_percentage": 25, + "ram_bytes": 46060, + "ram_percentage": 14 + }] + }, +{"name": "HTTPUpdate/examples/httpUpdateSPIFFS", + "sizes": [{ + "flash_bytes": 808257, + "flash_percentage": 25, + "ram_bytes": 46060, + "ram_percentage": 14 + }] + } +] +} +]} diff --git a/v2.x_cli_compile/cli_compile_8.json b/v2.x_cli_compile/cli_compile_8.json new file mode 100644 index 00000000000..a18568cffcb --- /dev/null +++ b/v2.x_cli_compile/cli_compile_8.json @@ -0,0 +1,366 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32s3:PSRAM=opi,USBMode=default,PartitionScheme=huge_app", + "target": "esp32s3", + "sketches": [ +{"name": "RainMaker/examples/RMakerSonoffDualR3", + "sizes": [{ + "flash_bytes": 1671221, + "flash_percentage": 53, + "ram_bytes": 67084, + "ram_percentage": 20 + }] + }, +{"name": "RainMaker/examples/RMakerSwitch", + "sizes": [{ + "flash_bytes": 1678461, + "flash_percentage": 53, + "ram_bytes": 66516, + "ram_percentage": 20 + }] + }, +{"name": "SD/examples/SD_Test", + "sizes": [{ + "flash_bytes": 332685, + "flash_percentage": 10, + "ram_bytes": 19732, + "ram_percentage": 6 + }] + }, +{"name": "SD/examples/SD_time", + "sizes": [{ + "flash_bytes": 752357, + "flash_percentage": 23, + "ram_bytes": 42188, + "ram_percentage": 12 + }] + }, +{"name": "SD_MMC/examples/SDMMC_Test", + "sizes": [{ + "flash_bytes": 346101, + "flash_percentage": 11, + "ram_bytes": 19612, + "ram_percentage": 5 + }] + }, +{"name": "SD_MMC/examples/SDMMC_time", + "sizes": [{ + "flash_bytes": 768401, + "flash_percentage": 24, + "ram_bytes": 42112, + "ram_percentage": 12 + }] + }, +{"name": "SPI/examples/SPI_Multiple_Buses", + "sizes": [{ + "flash_bytes": 258209, + "flash_percentage": 8, + "ram_bytes": 18712, + "ram_percentage": 5 + }] + }, +{"name": "SPIFFS/examples/SPIFFS_Test", + "sizes": [{ + "flash_bytes": 298757, + "flash_percentage": 9, + "ram_bytes": 19088, + "ram_percentage": 5 + }] + }, +{"name": "SPIFFS/examples/SPIFFS_time", + "sizes": [{ + "flash_bytes": 732945, + "flash_percentage": 23, + "ram_bytes": 41664, + "ram_percentage": 12 + }] + }, +{"name": "SimpleBLE/examples/SimpleBleDevice", + "sizes": [{ + "flash_bytes": 863333, + "flash_percentage": 27, + "ram_bytes": 44188, + "ram_percentage": 13 + }] + }, +{"name": "Ticker/examples/Arguments", + "sizes": [{ + "flash_bytes": 275141, + "flash_percentage": 8, + "ram_bytes": 19024, + "ram_percentage": 5 + }] + }, +{"name": "Ticker/examples/Blinker", + "sizes": [{ + "flash_bytes": 254001, + "flash_percentage": 8, + "ram_bytes": 18656, + "ram_percentage": 5 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32s2", + "sketches": [ +{"name": "RainMaker/examples/RMakerSonoffDualR3", + "sizes": [{ + "flash_bytes": 1112582, + "flash_percentage": 35, + "ram_bytes": 40996, + "ram_percentage": 12 + }] + }, +{"name": "RainMaker/examples/RMakerSwitch", + "sizes": [{ + "flash_bytes": 1119890, + "flash_percentage": 35, + "ram_bytes": 40452, + "ram_percentage": 12 + }] + }, +{"name": "SD/examples/SD_Test", + "sizes": [{ + "flash_bytes": 303722, + "flash_percentage": 9, + "ram_bytes": 15540, + "ram_percentage": 4 + }] + }, +{"name": "SD/examples/SD_time", + "sizes": [{ + "flash_bytes": 727066, + "flash_percentage": 23, + "ram_bytes": 37164, + "ram_percentage": 11 + }] + }, +{"name": "SPI/examples/SPI_Multiple_Buses", + "sizes": [{ + "flash_bytes": 216082, + "flash_percentage": 6, + "ram_bytes": 14632, + "ram_percentage": 4 + }] + }, +{"name": "SPIFFS/examples/SPIFFS_Test", + "sizes": [{ + "flash_bytes": 272610, + "flash_percentage": 8, + "ram_bytes": 15064, + "ram_percentage": 4 + }] + }, +{"name": "SPIFFS/examples/SPIFFS_time", + "sizes": [{ + "flash_bytes": 710170, + "flash_percentage": 22, + "ram_bytes": 36816, + "ram_percentage": 11 + }] + }, +{"name": "Ticker/examples/Arguments", + "sizes": [{ + "flash_bytes": 246510, + "flash_percentage": 7, + "ram_bytes": 14824, + "ram_percentage": 4 + }] + }, +{"name": "Ticker/examples/Blinker", + "sizes": [{ + "flash_bytes": 212970, + "flash_percentage": 6, + "ram_bytes": 14568, + "ram_percentage": 4 + }] + }, +{"name": "USB/examples/CompositeDevice", + "sizes": [{ + "flash_bytes": 314226, + "flash_percentage": 9, + "ram_bytes": 27244, + "ram_percentage": 8 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3:PartitionScheme=huge_app", + "target": "esp32c3", + "sketches": [ +{"name": "LittleFS/examples/LITTLEFS_time", + "sizes": [{ + "flash_bytes": 767682, + "flash_percentage": 24, + "ram_bytes": 35852, + "ram_percentage": 10 + }] + }, +{"name": "NetBIOS/examples/ESP_NBNST", + "sizes": [{ + "flash_bytes": 705940, + "flash_percentage": 22, + "ram_bytes": 34484, + "ram_percentage": 10 + }] + }, +{"name": "Preferences/examples/Prefs2Struct", + "sizes": [{ + "flash_bytes": 245088, + "flash_percentage": 7, + "ram_bytes": 13716, + "ram_percentage": 4 + }] + }, +{"name": "Preferences/examples/StartCounter", + "sizes": [{ + "flash_bytes": 249070, + "flash_percentage": 7, + "ram_bytes": 13716, + "ram_percentage": 4 + }] + }, +{"name": "RainMaker/examples/RMakerCustom", + "sizes": [{ + "flash_bytes": 1797460, + "flash_percentage": 57, + "ram_bytes": 59012, + "ram_percentage": 18 + }] + }, +{"name": "RainMaker/examples/RMakerCustomAirCooler", + "sizes": [{ + "flash_bytes": 1783272, + "flash_percentage": 56, + "ram_bytes": 59076, + "ram_percentage": 18 + }] + }, +{"name": "RainMaker/examples/RMakerSonoffDualR3", + "sizes": [{ + "flash_bytes": 1799672, + "flash_percentage": 57, + "ram_bytes": 59284, + "ram_percentage": 18 + }] + }, +{"name": "RainMaker/examples/RMakerSwitch", + "sizes": [{ + "flash_bytes": 1822800, + "flash_percentage": 57, + "ram_bytes": 60604, + "ram_percentage": 18 + }] + }, +{"name": "SD/examples/SD_Test", + "sizes": [{ + "flash_bytes": 311602, + "flash_percentage": 9, + "ram_bytes": 14660, + "ram_percentage": 4 + }] + }, +{"name": "SD/examples/SD_time", + "sizes": [{ + "flash_bytes": 776168, + "flash_percentage": 24, + "ram_bytes": 36172, + "ram_percentage": 11 + }] + } +] +}, +{ "board": "espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32", + "sketches": [ +{"name": "HTTPUpdate/examples/httpUpdateSecure", + "sizes": [{ + "flash_bytes": 936209, + "flash_percentage": 29, + "ram_bytes": 47180, + "ram_percentage": 14 + }] + }, +{"name": "HTTPUpdateServer/examples/WebUpdater", + "sizes": [{ + "flash_bytes": 821853, + "flash_percentage": 26, + "ram_bytes": 47220, + "ram_percentage": 14 + }] + }, +{"name": "I2S/examples/ADCPlotter", + "sizes": [{ + "flash_bytes": 304429, + "flash_percentage": 9, + "ram_bytes": 21648, + "ram_percentage": 6 + }] + }, +{"name": "I2S/examples/FullDuplex", + "sizes": [{ + "flash_bytes": 304441, + "flash_percentage": 9, + "ram_bytes": 21656, + "ram_percentage": 6 + }] + }, +{"name": "I2S/examples/InputSerialPlotter", + "sizes": [{ + "flash_bytes": 304437, + "flash_percentage": 9, + "ram_bytes": 21648, + "ram_percentage": 6 + }] + }, +{"name": "I2S/examples/SimpleTone", + "sizes": [{ + "flash_bytes": 304417, + "flash_percentage": 9, + "ram_bytes": 21656, + "ram_percentage": 6 + }] + }, +{"name": "Insights/examples/DiagnosticsSmokeTest", + "sizes": [{ + "flash_bytes": 915669, + "flash_percentage": 29, + "ram_bytes": 47188, + "ram_percentage": 14 + }] + }, +{"name": "Insights/examples/MinimalDiagnostics", + "sizes": [{ + "flash_bytes": 915121, + "flash_percentage": 29, + "ram_bytes": 47068, + "ram_percentage": 14 + }] + }, +{"name": "LittleFS/examples/LITTLEFS_test", + "sizes": [{ + "flash_bytes": 323293, + "flash_percentage": 10, + "ram_bytes": 22016, + "ram_percentage": 6 + }] + }, +{"name": "LittleFS/examples/LITTLEFS_time", + "sizes": [{ + "flash_bytes": 799829, + "flash_percentage": 25, + "ram_bytes": 45072, + "ram_percentage": 13 + }] + }, +{"name": "NetBIOS/examples/ESP_NBNST", + "sizes": [{ + "flash_bytes": 738973, + "flash_percentage": 23, + "ram_bytes": 43420, + "ram_percentage": 13 + }] + } +] +} +]} diff --git a/v2.x_cli_compile/cli_compile_9.json b/v2.x_cli_compile/cli_compile_9.json new file mode 100644 index 00000000000..556236bb7f0 --- /dev/null +++ b/v2.x_cli_compile/cli_compile_9.json @@ -0,0 +1,366 @@ +{"boards": [ +{ "board": "espressif:esp32:esp32s3:PSRAM=opi,USBMode=default,PartitionScheme=huge_app", + "target": "esp32s3", + "sketches": [ +{"name": "USB/examples/CompositeDevice", + "sizes": [{ + "flash_bytes": 352577, + "flash_percentage": 11, + "ram_bytes": 31724, + "ram_percentage": 9 + }] + }, +{"name": "USB/examples/ConsumerControl", + "sizes": [{ + "flash_bytes": 292873, + "flash_percentage": 9, + "ram_bytes": 30948, + "ram_percentage": 9 + }] + }, +{"name": "USB/examples/CustomHIDDevice", + "sizes": [{ + "flash_bytes": 310913, + "flash_percentage": 9, + "ram_bytes": 31300, + "ram_percentage": 9 + }] + }, +{"name": "USB/examples/FirmwareMSC", + "sizes": [{ + "flash_bytes": 340761, + "flash_percentage": 10, + "ram_bytes": 31356, + "ram_percentage": 9 + }] + }, +{"name": "USB/examples/Gamepad", + "sizes": [{ + "flash_bytes": 311237, + "flash_percentage": 9, + "ram_bytes": 31308, + "ram_percentage": 9 + }] + }, +{"name": "USB/examples/HIDVendor", + "sizes": [{ + "flash_bytes": 313353, + "flash_percentage": 9, + "ram_bytes": 31380, + "ram_percentage": 9 + }] + }, +{"name": "USB/examples/Keyboard/KeyboardLogout", + "sizes": [{ + "flash_bytes": 293909, + "flash_percentage": 9, + "ram_bytes": 30964, + "ram_percentage": 9 + }] + }, +{"name": "USB/examples/Keyboard/KeyboardMessage", + "sizes": [{ + "flash_bytes": 294045, + "flash_percentage": 9, + "ram_bytes": 30964, + "ram_percentage": 9 + }] + }, +{"name": "USB/examples/Keyboard/KeyboardReprogram", + "sizes": [{ + "flash_bytes": 294249, + "flash_percentage": 9, + "ram_bytes": 30964, + "ram_percentage": 9 + }] + }, +{"name": "USB/examples/Keyboard/KeyboardSerial", + "sizes": [{ + "flash_bytes": 311161, + "flash_percentage": 9, + "ram_bytes": 31308, + "ram_percentage": 9 + }] + }, +{"name": "USB/examples/KeyboardAndMouseControl", + "sizes": [{ + "flash_bytes": 311761, + "flash_percentage": 9, + "ram_bytes": 31316, + "ram_percentage": 9 + }] + }, +{"name": "USB/examples/Mouse/ButtonMouseControl", + "sizes": [{ + "flash_bytes": 293133, + "flash_percentage": 9, + "ram_bytes": 30948, + "ram_percentage": 9 + }] + } +] +}, +{ "board": "espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32s2", + "sketches": [ +{"name": "USB/examples/ConsumerControl", + "sizes": [{ + "flash_bytes": 254062, + "flash_percentage": 8, + "ram_bytes": 26604, + "ram_percentage": 8 + }] + }, +{"name": "USB/examples/CustomHIDDevice", + "sizes": [{ + "flash_bytes": 274350, + "flash_percentage": 8, + "ram_bytes": 26820, + "ram_percentage": 8 + }] + }, +{"name": "USB/examples/FirmwareMSC", + "sizes": [{ + "flash_bytes": 302338, + "flash_percentage": 9, + "ram_bytes": 26868, + "ram_percentage": 8 + }] + }, +{"name": "USB/examples/Gamepad", + "sizes": [{ + "flash_bytes": 274690, + "flash_percentage": 8, + "ram_bytes": 26836, + "ram_percentage": 8 + }] + }, +{"name": "USB/examples/HIDVendor", + "sizes": [{ + "flash_bytes": 276810, + "flash_percentage": 8, + "ram_bytes": 26916, + "ram_percentage": 8 + }] + }, +{"name": "USB/examples/Keyboard/KeyboardLogout", + "sizes": [{ + "flash_bytes": 255094, + "flash_percentage": 8, + "ram_bytes": 26620, + "ram_percentage": 8 + }] + }, +{"name": "USB/examples/Keyboard/KeyboardMessage", + "sizes": [{ + "flash_bytes": 255230, + "flash_percentage": 8, + "ram_bytes": 26620, + "ram_percentage": 8 + }] + }, +{"name": "USB/examples/Keyboard/KeyboardReprogram", + "sizes": [{ + "flash_bytes": 255442, + "flash_percentage": 8, + "ram_bytes": 26620, + "ram_percentage": 8 + }] + }, +{"name": "USB/examples/Keyboard/KeyboardSerial", + "sizes": [{ + "flash_bytes": 272854, + "flash_percentage": 8, + "ram_bytes": 26836, + "ram_percentage": 8 + }] + }, +{"name": "USB/examples/KeyboardAndMouseControl", + "sizes": [{ + "flash_bytes": 275222, + "flash_percentage": 8, + "ram_bytes": 26844, + "ram_percentage": 8 + }] + } +] +}, +{ "board": "espressif:esp32:esp32c3:PartitionScheme=huge_app", + "target": "esp32c3", + "sketches": [ +{"name": "SPIFFS/examples/SPIFFS_Test", + "sizes": [{ + "flash_bytes": 283072, + "flash_percentage": 8, + "ram_bytes": 14228, + "ram_percentage": 4 + }] + }, +{"name": "SPIFFS/examples/SPIFFS_time", + "sizes": [{ + "flash_bytes": 761398, + "flash_percentage": 24, + "ram_bytes": 35852, + "ram_percentage": 10 + }] + }, +{"name": "Ticker/examples/Arguments", + "sizes": [{ + "flash_bytes": 254262, + "flash_percentage": 8, + "ram_bytes": 13956, + "ram_percentage": 4 + }] + }, +{"name": "Ticker/examples/Blinker", + "sizes": [{ + "flash_bytes": 236012, + "flash_percentage": 7, + "ram_bytes": 13700, + "ram_percentage": 4 + }] + }, +{"name": "Update/examples/AWS_S3_OTA_Update", + "sizes": [{ + "flash_bytes": 731638, + "flash_percentage": 23, + "ram_bytes": 36188, + "ram_percentage": 11 + }] + }, +{"name": "Update/examples/HTTPS_OTA_Update", + "sizes": [{ + "flash_bytes": 871088, + "flash_percentage": 27, + "ram_bytes": 36580, + "ram_percentage": 11 + }] + }, +{"name": "Update/examples/SD_Update", + "sizes": [{ + "flash_bytes": 312918, + "flash_percentage": 9, + "ram_bytes": 14324, + "ram_percentage": 4 + }] + }, +{"name": "WebServer/examples/AdvancedWebServer", + "sizes": [{ + "flash_bytes": 789266, + "flash_percentage": 25, + "ram_bytes": 38268, + "ram_percentage": 11 + }] + }, +{"name": "WebServer/examples/FSBrowser", + "sizes": [{ + "flash_bytes": 824582, + "flash_percentage": 26, + "ram_bytes": 38204, + "ram_percentage": 11 + }] + }, +{"name": "WebServer/examples/HelloServer", + "sizes": [{ + "flash_bytes": 788116, + "flash_percentage": 25, + "ram_bytes": 38268, + "ram_percentage": 11 + }] + } +] +}, +{ "board": "espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app", + "target": "esp32", + "sketches": [ +{"name": "Preferences/examples/Prefs2Struct", + "sizes": [{ + "flash_bytes": 287413, + "flash_percentage": 9, + "ram_bytes": 21496, + "ram_percentage": 6 + }] + }, +{"name": "Preferences/examples/StartCounter", + "sizes": [{ + "flash_bytes": 288141, + "flash_percentage": 9, + "ram_bytes": 21496, + "ram_percentage": 6 + }] + }, +{"name": "RainMaker/examples/RMakerCustom", + "sizes": [{ + "flash_bytes": 1934577, + "flash_percentage": 61, + "ram_bytes": 62368, + "ram_percentage": 19 + }] + }, +{"name": "RainMaker/examples/RMakerCustomAirCooler", + "sizes": [{ + "flash_bytes": 1912137, + "flash_percentage": 60, + "ram_bytes": 62504, + "ram_percentage": 19 + }] + }, +{"name": "RainMaker/examples/RMakerSonoffDualR3", + "sizes": [{ + "flash_bytes": 1937737, + "flash_percentage": 61, + "ram_bytes": 62864, + "ram_percentage": 19 + }] + }, +{"name": "RainMaker/examples/RMakerSwitch", + "sizes": [{ + "flash_bytes": 1945433, + "flash_percentage": 61, + "ram_bytes": 62408, + "ram_percentage": 19 + }] + }, +{"name": "SD/examples/SD_Test", + "sizes": [{ + "flash_bytes": 342761, + "flash_percentage": 10, + "ram_bytes": 22488, + "ram_percentage": 6 + }] + }, +{"name": "SD/examples/SD_time", + "sizes": [{ + "flash_bytes": 804281, + "flash_percentage": 25, + "ram_bytes": 45260, + "ram_percentage": 13 + }] + }, +{"name": "SD_MMC/examples/SDMMC_Test", + "sizes": [{ + "flash_bytes": 365289, + "flash_percentage": 11, + "ram_bytes": 22852, + "ram_percentage": 6 + }] + }, +{"name": "SD_MMC/examples/SDMMC_time", + "sizes": [{ + "flash_bytes": 830225, + "flash_percentage": 26, + "ram_bytes": 45672, + "ram_percentage": 13 + }] + }, +{"name": "SPI/examples/SPI_Multiple_Buses", + "sizes": [{ + "flash_bytes": 260045, + "flash_percentage": 8, + "ram_bytes": 21208, + "ram_percentage": 6 + }] + } +] +} +]} diff --git a/variants/Microduino-esp32/pins_arduino.h b/variants/Microduino-esp32/pins_arduino.h deleted file mode 100644 index 278525a9902..00000000000 --- a/variants/Microduino-esp32/pins_arduino.h +++ /dev/null @@ -1,88 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 22 -#define NUM_ANALOG_INPUTS 12 - -#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 LED_BUILTIN = -1; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -#define MTDO 15 -#define MTDI 12 -#define MTMS 14 -#define MTCK 13 - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 22;//23; -static const uint8_t SCL = 21;//19; - -static const uint8_t SDA1 = 12; -static const uint8_t SCL1 = 13; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -static const uint8_t A0 = 12; -static const uint8_t A1 = 13; -static const uint8_t A2 = 15; -static const uint8_t A3 = 4; -static const uint8_t A6 = 38; -static const uint8_t A7 = 37; - -static const uint8_t A8 = 32; -static const uint8_t A9 = 33; -static const uint8_t A10 = 25; -static const uint8_t A11 = 26; -static const uint8_t A12 = 27; -static const uint8_t A13 = 14; - -static const uint8_t D0 = 3; -static const uint8_t D1 = 1; -static const uint8_t D2 = 16; -static const uint8_t D3 = 17; -static const uint8_t D4 = 32;//ADC1_CH4 -static const uint8_t D5 = 33;//ADC1_CH5 -static const uint8_t D6 = 25;//ADC2_CH8 DAC_1 -static const uint8_t D7 = 26;//ADC2_CH9 DAC_2 -static const uint8_t D8 = 27;//ADC2_CH7 -static const uint8_t D9 = 14;//ADC2_CH6 -static const uint8_t D10 = 5; -static const uint8_t D11 = 23; -static const uint8_t D12 = 19; -static const uint8_t D13 = 18; -static const uint8_t D14 = 12; -static const uint8_t D15 = 13; -static const uint8_t D16 = 15; -static const uint8_t D17 = 4; -static const uint8_t D18 = 22; -static const uint8_t D19 = 21; -static const uint8_t D20 = 38; -static const uint8_t D21 = 37; - - -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/alksesp32/pins_arduino.h b/variants/alksesp32/pins_arduino.h deleted file mode 100644 index 31a237198fe..00000000000 --- a/variants/alksesp32/pins_arduino.h +++ /dev/null @@ -1,85 +0,0 @@ -#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) - -#define ALKSESP32 // tell library to not map pins again - -static const uint8_t LED_BUILTIN = 23; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t D0 = 40; -static const uint8_t D1 = 41; -static const uint8_t D2 = 15; -static const uint8_t D3 = 2; -static const uint8_t D4 = 0; -static const uint8_t D5 = 4; -static const uint8_t D6 = 16; -static const uint8_t D7 = 17; -static const uint8_t D8 = 5; -static const uint8_t D9 = 18; -static const uint8_t D10 = 19; -static const uint8_t D11 = 21; -static const uint8_t D12 = 22; -static const uint8_t D13 = 23; - -static const uint8_t A0 = 32; -static const uint8_t A1 = 33; -static const uint8_t A2 = 25; -static const uint8_t A3 = 26; -static const uint8_t A4 = 27; -static const uint8_t A5 = 14; -static const uint8_t A6 = 12; -static const uint8_t A7 = 15; - -static const uint8_t L_R = 22; -static const uint8_t L_G = 17; -static const uint8_t L_Y = 23; -static const uint8_t L_B = 5; -static const uint8_t L_RGB_R = 4; -static const uint8_t L_RGB_G = 21; -static const uint8_t L_RGB_B = 16; - -static const uint8_t SW1 = 15; -static const uint8_t SW2 = 2; -static const uint8_t SW3 = 0; - -static const uint8_t POT1 = 32; -static const uint8_t POT2 = 33; - -static const uint8_t PIEZO1 = 19; -static const uint8_t PIEZO2 = 18; - -static const uint8_t PHOTO = 25; - -static const uint8_t DHT_PIN = 26; - -static const uint8_t S1 = 4; -static const uint8_t S2 = 16; -static const uint8_t S3 = 18; -static const uint8_t S4 = 19; -static const uint8_t S5 = 21; - -static const uint8_t SDA = 27; -static const uint8_t SCL = 14; - -static const uint8_t SS = 19; -static const uint8_t MOSI = 21; -static const uint8_t MISO = 22; -static const uint8_t SCK = 23; - -static const uint8_t DAC1 = 25; -static const uint8_t DAC2 = 26; - -#endif /* Pins_Arduino_h */ diff --git a/variants/bpi-bit/pins_arduino.h b/variants/bpi-bit/pins_arduino.h deleted file mode 100644 index 2a317a9abf9..00000000000 --- a/variants/bpi-bit/pins_arduino.h +++ /dev/null @@ -1,62 +0,0 @@ -#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 BUZZER = 25; - -static const uint8_t BUTTON_A = 35; -static const uint8_t BUTTON_B = 27; - -static const uint8_t RGB_LED = 4; - -static const uint8_t LIGHT_SENSOR1 = 36; -static const uint8_t LIGHT_SENSOR2 = 39; - -static const uint8_t TEMPERATURE_SENSOR = 34; - -static const uint8_t MPU9250_INT = 0; - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -static const uint8_t P0 = 25; -static const uint8_t P1 = 32; -static const uint8_t P2 = 33; -static const uint8_t P3 = 13; -static const uint8_t P4 = 15; -static const uint8_t P5 = 35; -static const uint8_t P6 = 12; -static const uint8_t P7 = 14; -static const uint8_t P8 = 16; -static const uint8_t P9 = 17; -static const uint8_t P10 = 26; -static const uint8_t P11 = 27; -static const uint8_t P12 = 2; -static const uint8_t P13 = 18; -static const uint8_t P14 = 19; -static const uint8_t P15 = 23; -static const uint8_t P16 = 5; -static const uint8_t P19 = 22; -static const uint8_t P20 = 21; - -static const uint8_t DAC1 = 25; -static const uint8_t DAC2 = 26; - -#endif /* Pins_Arduino_h */ diff --git a/variants/d-duino-32/pins_arduino.h b/variants/d-duino-32/pins_arduino.h deleted file mode 100644 index 19a1eb91a16..00000000000 --- a/variants/d-duino-32/pins_arduino.h +++ /dev/null @@ -1,64 +0,0 @@ -#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 SDA = 5; -static const uint8_t SCL = 4; - -static const uint8_t SS = 15; -static const uint8_t MOSI = 13; -static const uint8_t MISO = 12; -static const uint8_t SCK = 14; - -static const uint8_t A0 = 36; -static const uint8_t A3 = 39; -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 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 DAC1 = 25; -static const uint8_t DAC2 = 26; - -// Wemos Grove Shield -static const uint8_t D1 = 5; -static const uint8_t D2 = 4; -static const uint8_t D3 = 0; -static const uint8_t D4 = 2; -static const uint8_t D5 = 14; -static const uint8_t D6 = 12; -static const uint8_t D7 = 13; -static const uint8_t D8 = 15; -static const uint8_t D9 = 3; -static const uint8_t D10 = 1; - -// OLed -static const uint8_t OLED_SCL = SCL; -static const uint8_t OLED_SDA = SDA; - -#endif /* Pins_Arduino_h */ diff --git a/variants/d1_mini32/pins_arduino.h b/variants/d1_mini32/pins_arduino.h deleted file mode 100644 index 757adf14149..00000000000 --- a/variants/d1_mini32/pins_arduino.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include -#include <../d32/d32_core.h> - -static const uint8_t LED_BUILTIN = 2; -#define BUILTIN_LED LED_BUILTIN // backward compatibility -static const uint8_t _VBAT = 35; // battery voltage - -#define PIN_WIRE_SDA SDA // backward compatibility -#define PIN_WIRE_SCL SCL // backward compatibility - -static const uint8_t D0 = 26; -static const uint8_t D1 = 22; -static const uint8_t D2 = 21; -static const uint8_t D3 = 17; -static const uint8_t D4 = 16; -static const uint8_t D5 = 18; -static const uint8_t D6 = 19; -static const uint8_t D7 = 23; -static const uint8_t D8 = 5; -static const uint8_t RXD = 3; -static const uint8_t TXD = 1; - -#define PIN_SPI_SS SS // backward compatibility -#define PIN_SPI_MOSI MOSI // backward compatibility -#define PIN_SPI_MISO MISO // backward compatibility -#define PIN_SPI_SCK SCK // backward compatibility - -#define PIN_A0 A0 // backward compatibility - -#endif /* Pins_Arduino_h */ diff --git a/variants/d32/d32_core.h b/variants/d32/d32_core.h deleted file mode 100644 index 787d08c2006..00000000000 --- a/variants/d32/d32_core.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef _D32_CORE_H_ -#define _D32_CORE_H_ - -#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 SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -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; - -#endif \ No newline at end of file diff --git a/variants/d32/pins_arduino.h b/variants/d32/pins_arduino.h deleted file mode 100644 index 065cef91ea8..00000000000 --- a/variants/d32/pins_arduino.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include -#include - -static const uint8_t LED_BUILTIN = 5; -#define BUILTIN_LED LED_BUILTIN // backward compatibility -static const uint8_t _VBAT = 35; // battery voltage - -#endif /* Pins_Arduino_h */ diff --git a/variants/d32_pro/pins_arduino.h b/variants/d32_pro/pins_arduino.h deleted file mode 100644 index 3be2efcaa9a..00000000000 --- a/variants/d32_pro/pins_arduino.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include -#include <../d32/d32_core.h> - -static const uint8_t LED_BUILTIN = 5; -#define BUILTIN_LED LED_BUILTIN // backward compatibility -static const uint8_t _VBAT = 35; // battery voltage - - -#define TF_CS 4 // TF (Micro SD Card) CS pin -#define TS_CS 12 // Touch Screen CS pin -#define TFT_CS 14 // TFT CS pin -#define TFT_LED 32 // TFT backlight control pin -#define TFT_RST 33 // TFT reset pin -#define TFT_DC 27 // TFT DC pin - -#define SS TF_CS - -#endif /* Pins_Arduino_h */ diff --git a/variants/doitESP32devkitV1/pins_arduino.h b/variants/doitESP32devkitV1/pins_arduino.h deleted file mode 100644 index dd6c7e77409..00000000000 --- a/variants/doitESP32devkitV1/pins_arduino.h +++ /dev/null @@ -1,59 +0,0 @@ -#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 LED_BUILTIN = 2; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/esp32-devkit-lipo/pins_arduino.h b/variants/esp32-devkit-lipo/pins_arduino.h deleted file mode 100644 index a405e764c6a..00000000000 --- a/variants/esp32-devkit-lipo/pins_arduino.h +++ /dev/null @@ -1,62 +0,0 @@ -#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; - -#define TX1 33 // Ext1 pin 8 -#define RX1 25 // Ext1 pin 9 - -#define TX2 19 // Ext2 pin 8 -#define RX2 18 // Ext2 pin 9 - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/esp32-evb/pins_arduino.h b/variants/esp32-evb/pins_arduino.h deleted file mode 100644 index 15fa98e2496..00000000000 --- a/variants/esp32-evb/pins_arduino.h +++ /dev/null @@ -1,33 +0,0 @@ -#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 KEY_BUILTIN = 34; - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -#define TX1 4 -#define RX1 36 - -static const uint8_t SDA = 13; -static const uint8_t SCL = 16; - -static const uint8_t SS = 17; -static const uint8_t MOSI = 2; -static const uint8_t MISO = 15; -static const uint8_t SCK = 14; - -#define BOARD_HAS_1BIT_SDMMC - -#endif /* Pins_Arduino_h */ diff --git a/variants/esp32-gateway/pins_arduino.h b/variants/esp32-gateway/pins_arduino.h deleted file mode 100644 index fda309271fb..00000000000 --- a/variants/esp32-gateway/pins_arduino.h +++ /dev/null @@ -1,46 +0,0 @@ -#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) - -#if ARDUINO_ESP32_GATEWAY >= 'D' -#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT -#define ETH_PHY_POWER 5 -#endif - -static const uint8_t LED_BUILTIN = 33; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t KEY_BUILTIN = 34; - -static const uint8_t SCL = 16; // This is extention pin 11 -static const uint8_t SDA = 32; // This is extention pin 13 - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -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 A7 = 35; - -static const uint8_t T9 = 32; - -#if ARDUINO_ESP32_GATEWAY >= 'F' -#define BOARD_HAS_1BIT_SDMMC -#endif - -#endif /* Pins_Arduino_h */ diff --git a/variants/esp32-poe-iso/pins_arduino.h b/variants/esp32-poe-iso/pins_arduino.h deleted file mode 100644 index 1ab04a7578b..00000000000 --- a/variants/esp32-poe-iso/pins_arduino.h +++ /dev/null @@ -1,38 +0,0 @@ -#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) - -#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT -#define ETH_PHY_POWER 12 - -static const uint8_t KEY_BUILTIN = 34; - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -#define TX1 4 -#define RX1 36 - -#define TX2 33 // ext2 pin 5 -#define RX2 35 // ext2 pin 3 - -static const uint8_t SDA = 13; -static const uint8_t SCL = 16; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 2; -static const uint8_t MISO = 15; -static const uint8_t SCK = 14; - -#define BOARD_HAS_1BIT_SDMMC - -#endif /* Pins_Arduino_h */ diff --git a/variants/esp32-poe/pins_arduino.h b/variants/esp32-poe/pins_arduino.h deleted file mode 100644 index 1ab04a7578b..00000000000 --- a/variants/esp32-poe/pins_arduino.h +++ /dev/null @@ -1,38 +0,0 @@ -#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) - -#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT -#define ETH_PHY_POWER 12 - -static const uint8_t KEY_BUILTIN = 34; - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -#define TX1 4 -#define RX1 36 - -#define TX2 33 // ext2 pin 5 -#define RX2 35 // ext2 pin 3 - -static const uint8_t SDA = 13; -static const uint8_t SCL = 16; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 2; -static const uint8_t MISO = 15; -static const uint8_t SCK = 14; - -#define BOARD_HAS_1BIT_SDMMC - -#endif /* Pins_Arduino_h */ diff --git a/variants/esp32/pins_arduino.h b/variants/esp32/pins_arduino.h deleted file mode 100644 index d50715e5c91..00000000000 --- a/variants/esp32/pins_arduino.h +++ /dev/null @@ -1,56 +0,0 @@ -#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 SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/esp320/pins_arduino.h b/variants/esp320/pins_arduino.h deleted file mode 100644 index 0c357f51929..00000000000 --- a/variants/esp320/pins_arduino.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -#define EXTERNAL_NUM_INTERRUPTS 11 -#define NUM_DIGITAL_PINS 12 -#define NUM_ANALOG_INPUTS 5 - -#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 LED_BUILTIN = 5; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 2; -static const uint8_t SCL = 14; - -static const uint8_t SS = 15; -static const uint8_t MOSI = 13; -static const uint8_t MISO = 12; -static const uint8_t SCK = 14; - -#endif /* Pins_Arduino_h */ diff --git a/variants/esp32thing/pins_arduino.h b/variants/esp32thing/pins_arduino.h deleted file mode 100644 index c035ee26eba..00000000000 --- a/variants/esp32thing/pins_arduino.h +++ /dev/null @@ -1,61 +0,0 @@ -#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 LED_BUILTIN = 5; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t KEY_BUILTIN = 0; - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 2; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/esp32vn-iot-uno/pins_arduino.h b/variants/esp32vn-iot-uno/pins_arduino.h deleted file mode 100644 index 0bdb52da4ec..00000000000 --- a/variants/esp32vn-iot-uno/pins_arduino.h +++ /dev/null @@ -1,53 +0,0 @@ -#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 SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -static const uint8_t A0 = 36; -static const uint8_t A3 = 39; -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 DAC1 = 25; -static const uint8_t DAC2 = 26; - -#endif /* Pins_Arduino_h */ diff --git a/variants/espea32/pins_arduino.h b/variants/espea32/pins_arduino.h deleted file mode 100644 index 5e729356340..00000000000 --- a/variants/espea32/pins_arduino.h +++ /dev/null @@ -1,61 +0,0 @@ -#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 LED_BUILTIN = 5; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t KEY_BUILTIN = 0; - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/espectro32/pins_arduino.h b/variants/espectro32/pins_arduino.h deleted file mode 100644 index 4163e3dd969..00000000000 --- a/variants/espectro32/pins_arduino.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -#ifndef ESPECTRO32_VERSION -#define ESPECTRO32_VERSION 1 -#endif - -#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 LED_BUILTIN = 15; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SD_SS = 33; -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/espino32/pins_arduino.h b/variants/espino32/pins_arduino.h deleted file mode 100644 index 4d65b6b40e7..00000000000 --- a/variants/espino32/pins_arduino.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 38 -#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 LED_BUILTIN = 16; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t BUILTIN_KEY = 0; - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/feather_esp32/pins_arduino.h b/variants/feather_esp32/pins_arduino.h deleted file mode 100644 index a94befc322e..00000000000 --- a/variants/feather_esp32/pins_arduino.h +++ /dev/null @@ -1,66 +0,0 @@ -#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 LED_BUILTIN = 13; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t TX = 17; -static const uint8_t RX = 16; - -#define TX1 TX -#define RX1 RX - -static const uint8_t SDA = 23; -static const uint8_t SCL = 22; - -static const uint8_t SS = 33; -static const uint8_t MOSI = 18; -static const uint8_t MISO = 19; -static const uint8_t SCK = 5; - -// mapping to match other feathers and also in order -static const uint8_t A0 = 26; -static const uint8_t A1 = 25; -static const uint8_t A2 = 34; -static const uint8_t A3 = 39; -static const uint8_t A4 = 36; -static const uint8_t A5 = 4; -static const uint8_t A6 = 14; -static const uint8_t A7 = 32; -static const uint8_t A8 = 15; -static const uint8_t A9 = 33; -static const uint8_t A10 = 27; -static const uint8_t A11 = 12; -static const uint8_t A12 = 13; - -// vbat measure -static const uint8_t A13 = 35; -//static const uint8_t Ax = 0; // not used/available -//static const uint8_t Ax = 2; // not used/available - - -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/firebeetle32/pins_arduino.h b/variants/firebeetle32/pins_arduino.h deleted file mode 100644 index 7fd3583e18d..00000000000 --- a/variants/firebeetle32/pins_arduino.h +++ /dev/null @@ -1,61 +0,0 @@ -#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 LED_BUILTIN = 2; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - - - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/fm-devkit/pins_arduino.h b/variants/fm-devkit/pins_arduino.h deleted file mode 100644 index 2302dd9f67e..00000000000 --- a/variants/fm-devkit/pins_arduino.h +++ /dev/null @@ -1,53 +0,0 @@ -#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; - -// IO -static const uint8_t LED_BUILTIN = 5; -static const uint8_t SW1 = 4; -static const uint8_t SW2 = 18; -static const uint8_t SW3 = 19; -static const uint8_t SW4 = 21; - -//I2S DAC -static const uint8_t I2S_MCLK = 2; // CLOCK must be an integer multiplier of SCLK -static const uint8_t I2S_LRCLK = 25; // LRCLK -static const uint8_t I2S_SCLK = 26; // SCLK - Fs (44100 Hz) -static const uint8_t I2S_DOUT = 22; // DATA - -//GPIO -static const uint8_t D0 = 34; // GPI - Input Only -static const uint8_t D1 = 35; // GPI - Input Only -static const uint8_t D2 = 32; // GPO - Output Only -static const uint8_t D3 = 33; // GPO - Output Only -static const uint8_t D4 = 27; -static const uint8_t D5 = 14; -static const uint8_t D6 = 12; -static const uint8_t D7 = 13; -static const uint8_t D8 = 15; -static const uint8_t D9 = 23; -static const uint8_t D10 = 0; - -// I2C BUS, 2k2 hardware pull-ups -static const uint8_t SDA = 16; -static const uint8_t SCL = 17; - -// SPI - unused but you can create your own definition in your sketch -static const int8_t SCK = -1; -static const int8_t MISO = -1; -static const int8_t MOSI = -1; -static const int8_t SS = -1; - -#endif /* Pins_Arduino_h */ diff --git a/variants/frog32/pins_arduino.h b/variants/frog32/pins_arduino.h deleted file mode 100644 index d50715e5c91..00000000000 --- a/variants/frog32/pins_arduino.h +++ /dev/null @@ -1,56 +0,0 @@ -#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 SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/gpy/pins_arduino.h b/variants/gpy/pins_arduino.h deleted file mode 100644 index affd7f5571f..00000000000 --- a/variants/gpy/pins_arduino.h +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 18 - -#define analogInputToDigitalPin(p) (((p)<40)?(esp32_adc2gpio[(p)]):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - -// Sequans Monarch LTE Cat M1/NB1 modem -// NOTE: The Pycom pinout as well as spec sheet block diagram / pin details -// incorrectly list the LTE pins. The correct pins are defined in the source and CSV -// at https://github.com/pycom/pycom-micropython-sigfox/tree/master/esp32/boards/GPY. -#define LTE_CTS 18 // GPIO18 - Sequans modem CTS -#define LTE_RTS 19 // GPIO19 - Sequans modem RTS (pull low to communicate) -#define LTE_RX 23 // GPIO23 - Sequans modem RX -#define LTE_TX 5 // GPIO5 - Sequans modem TX -#define LTE_WAKE 27 // GPIO27 - Sequans modem wake-up interrupt -#define LTE_BAUD 921600 - -static const uint8_t LED_BUILTIN = 0; // ->2812 RGB !!! -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -#define ANT_SELECT 21 // GPIO21 - WiFi external / internal antenna switch - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 12; -static const uint8_t SCL = 13; - -static const uint8_t SS = 17; -static const uint8_t MOSI = 22; -static const uint8_t MISO = 37; -static const uint8_t SCK = 13; - -static const uint8_t A0 = 36; -static const uint8_t A1 = 37; -static const uint8_t A2 = 38; -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/heltec_wifi_kit_32/pins_arduino.h b/variants/heltec_wifi_kit_32/pins_arduino.h deleted file mode 100644 index c17574a46f5..00000000000 --- a/variants/heltec_wifi_kit_32/pins_arduino.h +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -#define WIFI_Kit_32 true -#define DISPLAY_HEIGHT 64 -#define DISPLAY_WIDTH 128 - -#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 LED_BUILTIN = 25; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t KEY_BUILTIN = 0; - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -static const uint8_t A0 = 36; -static const uint8_t A1 = 37; -static const uint8_t A2 = 38; -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 Vext = 21; -static const uint8_t LED = 25; -static const uint8_t RST_OLED = 16; -static const uint8_t SCL_OLED = 15; -static const uint8_t SDA_OLED = 4; - -#endif /* Pins_Arduino_h */ diff --git a/variants/heltec_wifi_lora_32/pins_arduino.h b/variants/heltec_wifi_lora_32/pins_arduino.h deleted file mode 100644 index b8f466ec703..00000000000 --- a/variants/heltec_wifi_lora_32/pins_arduino.h +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -#define WIFI_LoRa_32 -#define DISPLAY_HEIGHT 64 -#define DISPLAY_WIDTH 128 - -#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 LED_BUILTIN = 25; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t KEY_BUILTIN = 0; - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 18; -static const uint8_t MOSI = 27; -static const uint8_t MISO = 19; -static const uint8_t SCK = 5; - -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 Vext = 21; -static const uint8_t LED = 25; -static const uint8_t RST_OLED = 16; -static const uint8_t SCL_OLED = 15; -static const uint8_t SDA_OLED = 4; -static const uint8_t RST_LoRa = 14; -static const uint8_t DIO0 = 26; -static const uint8_t DIO1 = 33; -static const uint8_t DIO2 = 32; - - -#endif /* Pins_Arduino_h */ diff --git a/variants/heltec_wifi_lora_32_V2/pins_arduino.h b/variants/heltec_wifi_lora_32_V2/pins_arduino.h deleted file mode 100644 index 1881f02f89d..00000000000 --- a/variants/heltec_wifi_lora_32_V2/pins_arduino.h +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -#define WIFI_LoRa_32_V2 -#define DISPLAY_HEIGHT 64 -#define DISPLAY_WIDTH 128 - -#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 LED_BUILTIN = 25; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t KEY_BUILTIN = 0; - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 18; -static const uint8_t MOSI = 27; -static const uint8_t MISO = 19; -static const uint8_t SCK = 5; - -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 Vext = 21; -static const uint8_t LED = 25; -static const uint8_t RST_OLED = 16; -static const uint8_t SCL_OLED = 15; -static const uint8_t SDA_OLED = 4; -static const uint8_t RST_LoRa = 14; -static const uint8_t DIO0 = 26; -static const uint8_t DIO1 = 35; -static const uint8_t DIO2 = 34; - - -#endif /* Pins_Arduino_h */ diff --git a/variants/heltec_wireless_stick/pins_arduino.h b/variants/heltec_wireless_stick/pins_arduino.h deleted file mode 100644 index 5dd199781b9..00000000000 --- a/variants/heltec_wireless_stick/pins_arduino.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -#define Wireless_Stick -#define DISPLAY_HEIGHT 32 -#define DISPLAY_WIDTH 64 - -#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 LED_BUILTIN = 25; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t KEY_BUILTIN = 0; - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 18; -static const uint8_t MOSI = 27; -static const uint8_t MISO = 19; -static const uint8_t SCK = 5; - -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 Vext = 21; -static const uint8_t LED = 25; -static const uint8_t RST_OLED = 16; -static const uint8_t SCL_OLED = 15; -static const uint8_t SDA_OLED = 4; -static const uint8_t RST_LoRa = 14; -static const uint8_t DIO0 = 26; -static const uint8_t DIO1 = 35; -static const uint8_t DIO2 = 34; - -#endif /* Pins_Arduino_h */ diff --git a/variants/hornbill32dev/pins_arduino.h b/variants/hornbill32dev/pins_arduino.h deleted file mode 100644 index 3a991e3f2f1..00000000000 --- a/variants/hornbill32dev/pins_arduino.h +++ /dev/null @@ -1,61 +0,0 @@ -#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 LED_BUILTIN = 13; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t KEY_BUILTIN = 0; - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/hornbill32minima/pins_arduino.h b/variants/hornbill32minima/pins_arduino.h deleted file mode 100644 index d18c4dacd58..00000000000 --- a/variants/hornbill32minima/pins_arduino.h +++ /dev/null @@ -1,49 +0,0 @@ -#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; //taken out on pgm header -static const uint8_t RX = 3; //taken out on pgm header - -static const uint8_t SDA = 21; //1 -static const uint8_t SCL = 22; //2 - -static const uint8_t SS = 2; //3 -static const uint8_t MOSI = 23; //4 -static const uint8_t MISO = 19; //5 -static const uint8_t SCK = 18; //6 - - - -static const uint8_t A6 = 34; //7 -static const uint8_t A7 = 35; //8 -static const uint8_t A10 = 4; //9 -static const uint8_t A11 = 0; // taken out on pgm header -static const uint8_t A12 = 2; // with SPI SS -static const uint8_t A13 = 15; //10 -static const uint8_t A14 = 13; //11 - - - -static const uint8_t DAC1 = 25; //12 -static const uint8_t DAC2 = 26; //13 - - -static const uint8_t T0 = 4; //used -static const uint8_t T1 = 0; // taken out on pgm header -static const uint8_t T2 = 2; //used -static const uint8_t T3 = 15; //used - - - - -#endif /* Pins_Arduino_h */ diff --git a/variants/intorobot-fig/pins_arduino.h b/variants/intorobot-fig/pins_arduino.h deleted file mode 100644 index a9b39d79ccb..00000000000 --- a/variants/intorobot-fig/pins_arduino.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 7 -#define NUM_ANALOG_INPUTS 10 - -#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 LED_BUILTIN = 4; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t RGB_R_BUILTIN = 27; -static const uint8_t RGB_G_BUILTIN = 21; -static const uint8_t RGB_B_BUILTIN = 22; - -static const uint8_t KEY_BUILTIN = 0; - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 23; -static const uint8_t SCL = 19; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 16; -static const uint8_t MISO = 17; -static const uint8_t SCK = 18; - -static const uint8_t A0 = 36; -static const uint8_t A1 = 39; -static const uint8_t A2 = 35; -static const uint8_t A3 = 25; -static const uint8_t A4 = 26; -static const uint8_t A5 = 14; -static const uint8_t A6 = 12; -static const uint8_t A7 = 15; -static const uint8_t A8 = 13; -static const uint8_t A9 = 2; - -static const uint8_t D0 = 19; -static const uint8_t D1 = 23; -static const uint8_t D2 = 18; -static const uint8_t D3 = 17; -static const uint8_t D4 = 16; -static const uint8_t D5 = 5; -static const uint8_t D6 = 4; - -static const uint8_t T0 = 19; -static const uint8_t T1 = 23; -static const uint8_t T2 = 18; -static const uint8_t T3 = 17; -static const uint8_t T4 = 16; -static const uint8_t T5 = 5; -static const uint8_t T6 = 4; - -static const uint8_t DAC1 = 25; -static const uint8_t DAC2 = 26; - -#endif /* Pins_Arduino_h */ diff --git a/variants/lolin32/pins_arduino.h b/variants/lolin32/pins_arduino.h deleted file mode 100644 index 274f5d231dc..00000000000 --- a/variants/lolin32/pins_arduino.h +++ /dev/null @@ -1,61 +0,0 @@ -#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 LED_BUILTIN = 5; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - - - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/lopy/pins_arduino.h b/variants/lopy/pins_arduino.h deleted file mode 100644 index 9336576654c..00000000000 --- a/variants/lopy/pins_arduino.h +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 18 - -#define analogInputToDigitalPin(p) (((p)<40)?(esp32_adc2gpio[(p)]):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - -// SPI LoRa Radio -#define LORA_SCK 5 // GPIO5 - SX1276 SCK -#define LORA_MISO 19 // GPIO19 - SX1276 MISO -#define LORA_MOSI 27 // GPIO27 - SX1276 MOSI -#define LORA_CS 17 // GPIO17 - SX1276 CS -#define LORA_RST 18 // GPIO18 - SX1276 RST -#define LORA_IRQ 23 // GPIO23 - SX1276 IO0 -#define LORA_IO0 LORA_IRQ // alias -#define LORA_IO1 LORA_IRQ // tied by diode to IO0 -#define LORA_IO2 LORA_IRQ // tied by diode to IO0 - -static const uint8_t LED_BUILTIN = 0; // ->2812 RGB !!! -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -#define ANT_SELECT 16 // GPIO16 - External Antenna Switch - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 12; -static const uint8_t SCL = 13; - -static const uint8_t SS = 17; -static const uint8_t MOSI = 22; -static const uint8_t MISO = 37; -static const uint8_t SCK = 13; - -static const uint8_t A0 = 36; -static const uint8_t A1 = 37; -static const uint8_t A2 = 38; -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/lopy4/pins_arduino.h b/variants/lopy4/pins_arduino.h deleted file mode 100644 index 70f933ced93..00000000000 --- a/variants/lopy4/pins_arduino.h +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 18 - -#define analogInputToDigitalPin(p) (((p)<40)?(esp32_adc2gpio[(p)]):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - -// SPI LoRa Radio -#define LORA_SCK 5 // GPIO5 - SX1276 SCK -#define LORA_MISO 19 // GPIO19 - SX1276 MISO -#define LORA_MOSI 27 // GPIO27 - SX1276 MOSI -#define LORA_CS 18 // GPIO18 - SX1276 CS -#define LORA_IRQ 23 // GPIO23 - SX1276 IO0 -#define LORA_IO0 LORA_IRQ // alias -#define LORA_IO1 LORA_IRQ // tied by diode to IO0 -#define LORA_IO2 LORA_IRQ // tied by diode to IO0 -#define LORA_RST NOT_A_PIN - -static const uint8_t LED_BUILTIN = 0; // ->2812 RGB !!! -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -#define ANT_SELECT 21 // GPIO21 - External Antenna Switch - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 12; -static const uint8_t SCL = 13; - -static const uint8_t SS = 18; -static const uint8_t MOSI = 22; -static const uint8_t MISO = 37; -static const uint8_t SCK = 13; - -static const uint8_t A0 = 36; -static const uint8_t A1 = 37; -static const uint8_t A2 = 38; -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/m5stack_core_esp32/pins_arduino.h b/variants/m5stack_core_esp32/pins_arduino.h deleted file mode 100644 index d2d87d4fa2d..00000000000 --- a/variants/m5stack_core_esp32/pins_arduino.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 20 -#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 TXD2 = 17; -static const uint8_t RXD2 = 16; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -static const uint8_t G23 = 23; -static const uint8_t G19 = 19; -static const uint8_t G18 = 18; -static const uint8_t G3 = 3; -static const uint8_t G16 = 16; -static const uint8_t G21 = 21; -static const uint8_t G2 = 2; -static const uint8_t G12 = 12; -static const uint8_t G15 = 15; -static const uint8_t G35 = 35; -static const uint8_t G36 = 36; -static const uint8_t G25 = 25; -static const uint8_t G26 = 26; -static const uint8_t G1 = 1; -static const uint8_t G17 = 17; -static const uint8_t G22 = 22; -static const uint8_t G5 = 5; -static const uint8_t G13 = 13; -static const uint8_t G0 = 0; -static const uint8_t G34 = 34; - -static const uint8_t DAC1 = 25; -static const uint8_t DAC2 = 26; - -static const uint8_t ADC1 = 35; -static const uint8_t ADC2 = 36; - -#endif /* Pins_Arduino_h */ diff --git a/variants/m5stack_fire/pins_arduino.h b/variants/m5stack_fire/pins_arduino.h deleted file mode 100644 index 5912a1c35c6..00000000000 --- a/variants/m5stack_fire/pins_arduino.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 20 -#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 SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -static const uint8_t G23 = 23; -static const uint8_t G19 = 19; -static const uint8_t G18 = 18; -static const uint8_t G3 = 3; -static const uint8_t G16 = 16; -static const uint8_t G21 = 21; -static const uint8_t G2 = 2; -static const uint8_t G12 = 12; -static const uint8_t G15 = 15; -static const uint8_t G35 = 35; -static const uint8_t G36 = 36; -static const uint8_t G25 = 25; -static const uint8_t G26 = 26; -static const uint8_t G1 = 1; -static const uint8_t G17 = 17; -static const uint8_t G22 = 22; -static const uint8_t G5 = 5; -static const uint8_t G13 = 13; -static const uint8_t G0 = 0; -static const uint8_t G34 = 34; - -static const uint8_t DAC1 = 25; -static const uint8_t DAC2 = 26; - -static const uint8_t ADC1 = 35; -static const uint8_t ADC2 = 36; - -#endif /* Pins_Arduino_h */ diff --git a/variants/m5stick_c/pins_arduino.h b/variants/m5stick_c/pins_arduino.h deleted file mode 100644 index 048d9b5e50b..00000000000 --- a/variants/m5stick_c/pins_arduino.h +++ /dev/null @@ -1,41 +0,0 @@ -#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 SDA = 32; -static const uint8_t SCL = 33; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 15; -static const uint8_t MISO = 36; -static const uint8_t SCK = 13; - -static const uint8_t G9 = 9; -static const uint8_t G10 = 10; -static const uint8_t G37 = 37; -static const uint8_t G39 = 39; -static const uint8_t G32 = 32; -static const uint8_t G33 = 33; -static const uint8_t G26 = 26; -static const uint8_t G36 = 36; -static const uint8_t G0 = 0; - -static const uint8_t DAC1 = 25; -static const uint8_t DAC2 = 26; - -static const uint8_t ADC1 = 35; -static const uint8_t ADC2 = 36; - -#endif /* Pins_Arduino_h */ diff --git a/variants/magicbit/pins_arduino.h b/variants/magicbit/pins_arduino.h deleted file mode 100644 index 3073ade6100..00000000000 --- a/variants/magicbit/pins_arduino.h +++ /dev/null @@ -1,71 +0,0 @@ -#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 SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -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 BUZZER = 25; -static const uint8_t RED_LED = 27; -static const uint8_t YELLOW_LED = 18; -static const uint8_t GREEN_LED = 16; -static const uint8_t BLUE_LED = 17; -static const uint8_t LDR = 36; -static const uint8_t POT = 39; -static const uint8_t RIGHT_PUTTON = 34; -static const uint8_t LEFT_BUTTON = 35; -static const uint8_t MOTOR1A = 27; -static const uint8_t MOTOR1B = 18; -static const uint8_t MOTOR2A = 16; -static const uint8_t MOTOR2B = 17; -static const uint8_t LED_BUILTIN=16; - -#endif /* Pins_Arduino_h */ diff --git a/variants/mhetesp32devkit/pins_arduino.h b/variants/mhetesp32devkit/pins_arduino.h deleted file mode 100644 index 7095fcce3ed..00000000000 --- a/variants/mhetesp32devkit/pins_arduino.h +++ /dev/null @@ -1,59 +0,0 @@ -#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 LED_BUILTIN = 2; -#define BUILTIN_LED LED_BUILTIN - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/mhetesp32minikit/pins_arduino.h b/variants/mhetesp32minikit/pins_arduino.h deleted file mode 100644 index 7095fcce3ed..00000000000 --- a/variants/mhetesp32minikit/pins_arduino.h +++ /dev/null @@ -1,59 +0,0 @@ -#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 LED_BUILTIN = 2; -#define BUILTIN_LED LED_BUILTIN - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/nano32/pins_arduino.h b/variants/nano32/pins_arduino.h deleted file mode 100644 index 4d65b6b40e7..00000000000 --- a/variants/nano32/pins_arduino.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 38 -#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 LED_BUILTIN = 16; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t BUILTIN_KEY = 0; - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/nina_w10/pins_arduino.h b/variants/nina_w10/pins_arduino.h deleted file mode 100644 index f3ce937dd26..00000000000 --- a/variants/nina_w10/pins_arduino.h +++ /dev/null @@ -1,86 +0,0 @@ -#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 LED_GREEN = 33; -static const uint8_t LED_RED = 23; -static const uint8_t LED_BLUE = 21; -static const uint8_t SW1 = 33; -static const uint8_t SW2 = 27; - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 12; -static const uint8_t SCL = 13; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -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 D0 = 3; -static const uint8_t D1 = 1; -static const uint8_t D2 = 26; -static const uint8_t D3 = 25; -static const uint8_t D4 = 35; -static const uint8_t D5 = 27; -static const uint8_t D6 = 22; -static const uint8_t D7 = 0; -static const uint8_t D8 = 15; -static const uint8_t D9 = 14; -static const uint8_t D10 = 5; -static const uint8_t D11 = 19; -static const uint8_t D12 = 23; -static const uint8_t D13 = 18; -static const uint8_t D14 = 13; -static const uint8_t D15 = 12; - -static const uint8_t D16 = 32; -static const uint8_t D17 = 33; -static const uint8_t D18 = 21; -static const uint8_t D19 = 34; -static const uint8_t D20 = 36; -static const uint8_t D21 = 39; - -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/node32s/pins_arduino.h b/variants/node32s/pins_arduino.h deleted file mode 100644 index 3bb26f1e94c..00000000000 --- a/variants/node32s/pins_arduino.h +++ /dev/null @@ -1,61 +0,0 @@ -#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 LED_BUILTIN = 2; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t KEY_BUILTIN = 0; - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/nodemcu-32s/pins_arduino.h b/variants/nodemcu-32s/pins_arduino.h deleted file mode 100644 index 3bb26f1e94c..00000000000 --- a/variants/nodemcu-32s/pins_arduino.h +++ /dev/null @@ -1,61 +0,0 @@ -#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 LED_BUILTIN = 2; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t KEY_BUILTIN = 0; - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/odroid_esp32/pins_arduino.h b/variants/odroid_esp32/pins_arduino.h deleted file mode 100644 index 301a5c82631..00000000000 --- a/variants/odroid_esp32/pins_arduino.h +++ /dev/null @@ -1,34 +0,0 @@ -#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 LED_BUILTIN = 2; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 15; -static const uint8_t SCL = 4; - -static const uint8_t SS = 22; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -static const uint8_t DAC1 = 25; -static const uint8_t DAC2 = 26; - -static const uint8_t ADC1 = 35; -static const uint8_t ADC2 = 36; - -#endif /* Pins_Arduino_h */ diff --git a/variants/onehorse32dev/pins_arduino.h b/variants/onehorse32dev/pins_arduino.h deleted file mode 100644 index daa2d8cd6fd..00000000000 --- a/variants/onehorse32dev/pins_arduino.h +++ /dev/null @@ -1,59 +0,0 @@ -#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 LED_BUILTIN = 5; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t KEY_BUILTIN = 0; - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -static const uint8_t A0 = 36; -static const uint8_t A1 = 37; -static const uint8_t A2 = 38; -static const uint8_t A3 = 39; -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 DAC1 = 25; -static const uint8_t DAC2 = 26; - -#endif /* Pins_Arduino_h */ diff --git a/variants/oroca_edubot/pins_arduino.h b/variants/oroca_edubot/pins_arduino.h deleted file mode 100644 index 7ffe17763f0..00000000000 --- a/variants/oroca_edubot/pins_arduino.h +++ /dev/null @@ -1,62 +0,0 @@ -#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 LED_BUILTIN = 13; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t TX = 17; -static const uint8_t RX = 16; - -static const uint8_t SDA = 23; -static const uint8_t SCL = 22; - -static const uint8_t SS = 2; -static const uint8_t MOSI = 18; -static const uint8_t MISO = 19; -static const uint8_t SCK = 5; - - -static const uint8_t A0 = 34; -static const uint8_t A1 = 39; -static const uint8_t A2 = 36; -static const uint8_t A3 = 33; - -static const uint8_t D0 = 4; -static const uint8_t D1 = 16; -static const uint8_t D2 = 17; -static const uint8_t D3 = 22; -static const uint8_t D4 = 23; -static const uint8_t D5 = 5; -static const uint8_t D6 = 18; -static const uint8_t D7 = 19; -static const uint8_t D8 = 33; - -// vbat measure -static const uint8_t VBAT = 35; - - -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/pico32/pins_arduino.h b/variants/pico32/pins_arduino.h deleted file mode 100644 index d50715e5c91..00000000000 --- a/variants/pico32/pins_arduino.h +++ /dev/null @@ -1,56 +0,0 @@ -#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 SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/pocket_32/pins_arduino.h b/variants/pocket_32/pins_arduino.h deleted file mode 100644 index 2ac62af94dc..00000000000 --- a/variants/pocket_32/pins_arduino.h +++ /dev/null @@ -1,61 +0,0 @@ -#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 LED_BUILTIN = 16; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - - - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/quantum/pins_arduino.h b/variants/quantum/pins_arduino.h deleted file mode 100644 index d50715e5c91..00000000000 --- a/variants/quantum/pins_arduino.h +++ /dev/null @@ -1,56 +0,0 @@ -#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 SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/sparkfun_lora_gateway_1-channel/pins_arduino.h b/variants/sparkfun_lora_gateway_1-channel/pins_arduino.h deleted file mode 100755 index 0d45940f576..00000000000 --- a/variants/sparkfun_lora_gateway_1-channel/pins_arduino.h +++ /dev/null @@ -1,58 +0,0 @@ -#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 int LED_BUILTIN = 17; - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 16; -static const uint8_t MOSI = 13; -static const uint8_t MISO = 12; -static const uint8_t SCK = 14; - -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/t-beam/pins_arduino.h b/variants/t-beam/pins_arduino.h deleted file mode 100644 index 977b6b26734..00000000000 --- a/variants/t-beam/pins_arduino.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 20 -#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) - -// SPI LoRa Radio -#define LORA_SCK 5 // GPIO5 - SX1276 SCK -#define LORA_MISO 19 // GPIO19 - SX1276 MISO -#define LORA_MOSI 27 // GPIO27 - SX1276 MOSI -#define LORA_CS 18 // GPIO18 - SX1276 CS -#define LORA_RST 23 // GPIO23 - SX1276 RST -#define LORA_IRQ 26 // GPIO26 - SX1276 IO0 -#define LORA_IO0 LORA_IRQ // alias -#define LORA_IO1 33 // GPIO33 - SX1276 IO1 -> wired on pcb AND connected to header pin LORA1 -#define LORA_IO2 32 // GPIO32 - SX1276 IO2 -> wired on pcb AND connected to header pin LORA2 - -static const uint8_t KEY_BUILTIN = 39; - -static const uint8_t LED_BUILTIN = 14; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 18; -static const uint8_t MOSI = 27; -static const uint8_t MISO = 19; -static const uint8_t SCK = 5; - -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 A14 = 13; -static const uint8_t A16 = 14; -static const uint8_t A18 = 25; - -static const uint8_t T0 = 4; -static const uint8_t T1 = 0; -static const uint8_t T2 = 2; -static const uint8_t T4 = 13; -static const uint8_t T6 = 14; -static const uint8_t T8 = 33; -static const uint8_t T9 = 32; - -static const uint8_t DAC1 = 25; - -#endif /* Pins_Arduino_h */ diff --git a/variants/tinypico/pins_arduino.h b/variants/tinypico/pins_arduino.h deleted file mode 100644 index 617cd9bf92c..00000000000 --- a/variants/tinypico/pins_arduino.h +++ /dev/null @@ -1,60 +0,0 @@ -#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 SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -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 APA_POWER = 13; -static const uint8_t APA_DATA = 2; -static const uint8_t APA_CLK = 12; - -#endif /* Pins_Arduino_h */ diff --git a/variants/ttgo-lora32-v1/pins_arduino.h b/variants/ttgo-lora32-v1/pins_arduino.h deleted file mode 100644 index 11cd3d101e2..00000000000 --- a/variants/ttgo-lora32-v1/pins_arduino.h +++ /dev/null @@ -1,77 +0,0 @@ -#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) - -// I2C OLED Display works with SSD1306 driver -#define OLED_SDA 4 -#define OLED_SCL 15 -#define OLED_RST 16 - -// SPI LoRa Radio -#define LORA_SCK 5 // GPIO5 - SX1276 SCK -#define LORA_MISO 19 // GPIO19 - SX1276 MISO -#define LORA_MOSI 27 // GPIO27 - SX1276 MOSI -#define LORA_CS 18 // GPIO18 - SX1276 CS -#define LORA_RST 14 // GPIO14 - SX1276 RST -#define LORA_IRQ 26 // GPIO26 - SX1276 IRQ (interrupt request) - -static const uint8_t LED_BUILTIN = 2; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t KEY_BUILTIN = 0; - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 18; -static const uint8_t MOSI = 27; -static const uint8_t MISO = 19; -static const uint8_t SCK = 5; - -static const uint8_t A0 = 36; -static const uint8_t A1 = 37; -static const uint8_t A2 = 38; -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/ttgo-t1/pins_arduino.h b/variants/ttgo-t1/pins_arduino.h deleted file mode 100644 index f68e5fd977f..00000000000 --- a/variants/ttgo-t1/pins_arduino.h +++ /dev/null @@ -1,62 +0,0 @@ -#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 LED_BUILTIN = 22; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t SDA = 21; -// Despite the many diagrams from TTGO showing SCL on pin 22, due to the on-board LED -// also on this pin it is better to shift to 23 instead to avoid issues. -static const uint8_t SCL = 23; - -// These are the settings used for the on-board SD card slot -static const uint8_t SS = 13; -static const uint8_t MOSI = 15; -static const uint8_t MISO = 2; -static const uint8_t SCK = 14; - -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/turta_iot_node/pins_arduino.h b/variants/turta_iot_node/pins_arduino.h deleted file mode 100644 index 81292ffac11..00000000000 --- a/variants/turta_iot_node/pins_arduino.h +++ /dev/null @@ -1,73 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -#define EXTERNAL_NUM_INTERRUPTS 20 -#define NUM_DIGITAL_PINS 21 -#define NUM_ANALOG_INPUTS 9 - -#define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - -// LED -static const uint8_t LED_BUILTIN = 13; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -// UART -static const uint8_t TX = 10; -static const uint8_t RX = 9; - -// I2C -static const uint8_t SDA = 23; -static const uint8_t SCL = 22; - -// SPI -static const uint8_t SS = 21; -static const uint8_t MOSI = 18; -static const uint8_t MISO = 19; -static const uint8_t SCK = 5; - -// Analog Inputs -static const uint8_t A0 = 4; -static const uint8_t A1 = 25; -static const uint8_t A2 = 26; -static const uint8_t A3 = 27; -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 A8 = 38; - -// Right side -static const uint8_t T0 = 4; -static const uint8_t T1 = 25; -static const uint8_t T2 = 26; -static const uint8_t T3 = 27; -static const uint8_t T4 = 32; -static const uint8_t T5 = 33; -static const uint8_t T6 = 34; -static const uint8_t T7 = 35; - -// Left side -static const uint8_t T8 = 22; -static const uint8_t T9 = 23; -static const uint8_t T10 = 10; -static const uint8_t T11 = 9; -static const uint8_t T12 = 21; -static const uint8_t T13 = 5; -static const uint8_t T14 = 18; -static const uint8_t T15 = 19; - -// Module -static const uint8_t T16 = 37; -static const uint8_t T17 = 14; -static const uint8_t T18 = 2; -static const uint8_t T19 = 38; - -// DAC -static const uint8_t DAC1 = 25; -static const uint8_t DAC2 = 26; - -#endif /* Pins_Arduino_h */ diff --git a/variants/twatch/pins_arduino.h b/variants/twatch/pins_arduino.h deleted file mode 100644 index 44570b72693..00000000000 --- a/variants/twatch/pins_arduino.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 20 -#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) - -// touch screen -#define TP_SDA 14 -#define TP_SCL 15 -#define TP_INT 38 - -// Interrupt IO port -#define RTC_INT 37 -#define APX20X_INT 35 -#define BMA42X_INT1 39 -#define BMA42X_INT2 4 - -//Serial1 Already assigned to GPS LORA -#define TX1 33 -#define RX1 34 - -static const uint8_t KEY_BUILTIN = 36; - -// Already assigned to BMA423 PCF8563 and external extensions -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; -// SPI has been configured as an SD card slot and must be removed when downloading -static const uint8_t SS = 13; -static const uint8_t MOSI = 15; -static const uint8_t MISO = 2; -static const uint8_t SCK = 14; -// Externally programmable IO -static const uint8_t DAC1 = 25; -static const uint8_t DAC2 = 26; - -#endif /* Pins_Arduino_h */ diff --git a/variants/vintlabsdevkitv1/pins_arduino.h b/variants/vintlabsdevkitv1/pins_arduino.h deleted file mode 100644 index e9cdd317b10..00000000000 --- a/variants/vintlabsdevkitv1/pins_arduino.h +++ /dev/null @@ -1,69 +0,0 @@ -#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 LED_BUILTIN = 2; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -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; - -// PWM Driver pins for PWM Driver board -static const uint8_t PWM0 = 12; -static const uint8_t PWM1 = 13; -static const uint8_t PWM2 = 14; -static const uint8_t PWM3 = 15; -static const uint8_t PWM4 = 16; -static const uint8_t PWM5 = 17; -static const uint8_t PWM6 = 18; -static const uint8_t PWM7 = 19; - -#endif /* Pins_Arduino_h */ diff --git a/variants/wesp32/pins_arduino.h b/variants/wesp32/pins_arduino.h deleted file mode 100644 index c3790504155..00000000000 --- a/variants/wesp32/pins_arduino.h +++ /dev/null @@ -1,49 +0,0 @@ -#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) - -#define TX1 12 -#define RX1 13 -#define TX2 33 -#define RX2 39 - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SCL = 4; -static const uint8_t SDA = 15; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 32; -static const uint8_t SCK = 18; - -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 T0 = 4; -static const uint8_t T2 = 2; -static const uint8_t T8 = 33; -static const uint8_t T9 = 32; - -#define ETH_PHY_ADDR 0 -#define ETH_PHY_POWER -1 -#define ETH_PHY_MDC 16 -#define ETH_PHY_MDIO 17 -#define ETH_PHY_TYPE ETH_PHY_LAN8720 -#define ETH_CLK_MODE ETH_CLOCK_GPIO0_IN - -#endif /* Pins_Arduino_h */ diff --git a/variants/widora-air/pins_arduino.h b/variants/widora-air/pins_arduino.h deleted file mode 100644 index ed5c79ff5c2..00000000000 --- a/variants/widora-air/pins_arduino.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 7 -#define NUM_ANALOG_INPUTS 10 - -#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 LED_BUILTIN = 25; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - - -static const uint8_t KEY_BUILTIN = 0; - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 23; -static const uint8_t SCL = 19; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 16; -static const uint8_t MISO = 17; -static const uint8_t SCK = 18; - -static const uint8_t A0 = 36; -static const uint8_t A1 = 39; -static const uint8_t A2 = 35; -static const uint8_t A3 = 25; -static const uint8_t A4 = 26; -static const uint8_t A5 = 14; -static const uint8_t A6 = 12; -static const uint8_t A7 = 15; -static const uint8_t A8 = 13; -static const uint8_t A9 = 2; - -static const uint8_t D0 = 19; -static const uint8_t D1 = 23; -static const uint8_t D2 = 18; -static const uint8_t D3 = 17; -static const uint8_t D4 = 16; -static const uint8_t D5 = 5; -static const uint8_t D6 = 4; - -static const uint8_t T0 = 19; -static const uint8_t T1 = 23; -static const uint8_t T2 = 18; -static const uint8_t T3 = 17; -static const uint8_t T4 = 16; -static const uint8_t T5 = 5; -static const uint8_t T6 = 4; - -static const uint8_t DAC1 = 25; -static const uint8_t DAC2 = 26; - -#endif /* Pins_Arduino_h */ diff --git a/variants/wipy3/pins_arduino.h b/variants/wipy3/pins_arduino.h deleted file mode 100644 index cfee21dc83f..00000000000 --- a/variants/wipy3/pins_arduino.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 18 - -#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 LED_BUILTIN = 0; // ->2812 RGB !!! -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -#define ANT_SELECT 21 // GPIO21 - External Antenna Switch - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 12; -static const uint8_t SCL = 13; - -static const uint8_t SS = 2; -static const uint8_t MOSI = 22; -static const uint8_t MISO = 37; -static const uint8_t SCK = 13; - -static const uint8_t A0 = 36; -static const uint8_t A1 = 37; -static const uint8_t A2 = 38; -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; - -#endif /* Pins_Arduino_h */ diff --git a/variants/xinabox/pins_arduino.h b/variants/xinabox/pins_arduino.h deleted file mode 100644 index 2cb41b91eb3..00000000000 --- a/variants/xinabox/pins_arduino.h +++ /dev/null @@ -1,28 +0,0 @@ -#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 LED_BUILTIN = 27; -#define BUILTIN_LED LED_BUILTIN // backward compatibility - -static const uint8_t TX = 1; -static const uint8_t RX = 3; - -static const uint8_t SDA = 21; -static const uint8_t SCL = 22; - -static const uint8_t SS = 5; -static const uint8_t MOSI = 23; -static const uint8_t MISO = 19; -static const uint8_t SCK = 18; - -#endif /* Pins_Arduino_h */